Index: openacs-4/contrib/packages/events/NOTES =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/events/NOTES,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/events/NOTES 9 Mar 2003 12:07:04 -0000 1.1 @@ -0,0 +1,57 @@ +-- Org role design issues + +allow two tables to hold org roles so that + o event editors can modify roles after creating event w/o affecting original role? + +-- Custom fields design issues + +-- Chat with Arjun about attachments + +ms: ok, so every time fs is instanciated it creates a new root folder mapped to the new fs package_id. you manually map the package_id of the package that you want attacments for (events in your case) to the specific fs root folder id you want + +arjun: so when i'm using the attachments api, i'll use the fs package_id for the -object_id switches? + +ms: no don't pass the fs package_id as object id. object_id = the acs object you are attaching something to (forum post, cal event) once the fs root folder is setup once, you don't have to worry about it again + +arjun: any way to automate this process for packages? should i set up an init proc to map the folder and write an attachments_p flag to one of my tables? (i'd write an attachments enabled flag if my init proc could find an fs_root_folder to map to) + +ms: yes, that would be how i would do it. using a _post_instanciation proc in your pkgs -init file + +thoughts + o add post_instantiation proc that creates new fs and attachments instances under events and creates the root folder mapping as arjun mentioned above + +-- Notes and code snippets for bios work + + + +select attr_value +from acs_attribute_values +where object_id = :user_id +and attribute_id = + (select attribute_id + from acs_attributes + where object_type = 'person' + and attribute_name = 'bio') + + + + if { $bio_change_to == 0 } { + # perform the insert + db_dml insert_bio "insert into acs_attribute_values + (object_id, attribute_id, attr_value) + values + (:user_id, (select attribute_id + from acs_attributes + where object_type = 'person' + and attribute_name = 'bio'), :bio)" + } elseif { $bio_change_to == 2 } { + # perform the update + db_dml update_bio "update acs_attribute_values + set attr_value = :bio + where object_id = :user_id + and attribute_id = + (select attribute_id + from acs_attributes + where object_type = 'person' + and attribute_name = 'bio')" + } Index: openacs-4/contrib/packages/events/TODO =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/events/TODO,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/events/TODO 9 Mar 2003 12:07:04 -0000 1.1 @@ -0,0 +1,58 @@ +needed functionality +-------------------- +o integration with survey +o add interface for editing organizer bio (reinstate organizer-add-2?) +o system doesn't handle multi-day events like 3.x did (?) +o update 3.x documentation! + +clean up +-------- +o clean up packages and the files that rely on them so they do not ask for redundant info - if we care about this?? + - events-registrations-package-create.sql asks for both user_id and creation_user (we may want this to have staff add somebody - we'll see) +o bring proc namespace declarations inline with new conventions +o decide on party_id vs. user_id then make API consistent +o move parts of event.adp and activity.adp to adp chunks for reuse? + - look for other similar candidates for template sharing +o convert forms to use ad_form (possibly change pages as well - event-role-ae, etc.) +o check ad_page_contract usage consistency (properties, etc.) +o use related_link_url field in acs_events rather than our own detail_url? + - move form element to event-ae pages + - adjust event.new + - adjust order-one, event-info, activity + ! acs_event.new doesn't accept related_url arg (even though it's in acs_events) so deal with this later? + - ask someone on irc to commit changes to plsql interface +o remove unnecessary permissions... as it stands we don't need any special permissions (it only relies on read, write and admin) + +wish list +--------- +o support for recurring events +o integrate with search (active events only) +o generate rss feed for active events +o integrate with provider-profile to display events a user has attended or is registered for +o integrate usps_abbrev for venues with the ref-zip codes (or whatever else it is called) module so we can enter the state for an event + + +-- +THINGS THAT HAVE BEEN FINISHED +------------------------------ +MICHAEL +o integrate with attachments for agenda upload +o move common queries from *.xql to procs (done?) MATTHEW AGREES THAT THIS IS DONE +o move oracle specific stuff [(+), decode(), etc.] to -oracle.xql files + - is logical_negation() cross platform? MATTHEW AGREES THAT THIS IS DONE + + + +MATTHEW +o integrate with bulk-mail for spamming +o implement permissions +NOT DOING THIS AS PER COMMMUNITY CONSENSUS o templating system integration with master template for admin, and some small UI useablility changes +o subsite awareness +o when adding an event, maximum capacity should not be allowed to be higher than the max capacity of that venue - I think we should just leave it like that. +o activity and event check on various pages (i.e., does id exists in db?) +o check that order-one won't serve up past reg_deadline (-validate) +UNNECCESARY?? EVENT_ADD_2 ISN'T USED o more error checking in event-add-2 (deadline > sysdate) +IT IS GOOD ENOUGHo delete unnecessary code (once we are "done") - this way somebody looking at the code won't + change one file and not realize that the problem is elsewhere for example: + - tcl/venue-database.xql I don't think it needs the events::venue::new.new query +FIXED o events page -> "view page users see" broken - event page shows old events (why?) Index: openacs-4/contrib/packages/events/events.info =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/events/events.info,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/events/events.info 9 Mar 2003 12:07:04 -0000 1.1 @@ -0,0 +1,319 @@ + + + + + Events + Events + f + f + + + + oracle + postgresql + + Michael Steigman + This software module gives organizations a way to register people for events such as a lecture series or a social gathering online. + Organizations often have a number of set events which they like to repeat. For example, a company may have a certain presentation which it makes over and over. A photoraphy club may hold monthly outings. A marathon race could occur annually. The Events package provides a way to coordinate activities, venues, and users via a web page. This is a port of the ACS Classic 3.x events package originally written by Arsdigita. See package documentation for more info. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Index: openacs-4/contrib/packages/events/sql/oracle/events-activities-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/events/sql/oracle/events-activities-create.sql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/events/sql/oracle/events-activities-create.sql 9 Mar 2003 12:07:16 -0000 1.1 @@ -0,0 +1,83 @@ +-- +-- The Events Package +-- +-- @author Michael Steigman (michael@steigman.net) +-- @version $Id: events-activities-create.sql,v 1.1 2003/03/09 12:07:16 lars Exp $ +-- +-- This package was originally written by Bryan Che and Phillip Greenspun +-- +-- GNU GPL v2 +-- + +-- Activity Object Type + +declare +begin + + acs_object_type.create_type( + object_type => 'events_activity', + pretty_name => 'Event Activity', + pretty_plural => 'Event Activities', + supertype => 'acs_activity', + table_name => 'events_activities', + id_column => 'activity_id' + ); + +end; +/ +show errors; + +-- create activity attributes +declare + attr_id acs_attributes.attribute_id%TYPE; +begin + + attr_id := acs_attribute.create_attribute ( + object_type => 'events_activity', + attribute_name => 'description', + datatype => 'string', + pretty_name => 'Description', + pretty_plural => 'Descriptions' + ); + + attr_id := acs_attribute.create_attribute ( + object_type => 'events_activity', + attribute_name => 'detail_url', + datatype => 'string', + pretty_name => 'Detail URL', + pretty_plural => 'Detail URLs' + ); +end; +/ +show errors; + +-- Each activity has the super_type of ACS_ACTIVITY +-- Table events_activities supplies additional information +create table events_activities ( + activity_id integer + constraint events_activity_id_fk + references acs_activities + constraint events_activity_id_pk + primary key, + -- FIXME: (from old package) activities are owned by user groups + -- use map function in acs_activity? why? + -- + -- keep track of event package instances in this table + package_id integer + constraint events_activities_pkg_id_fk + references apm_packages(package_id) + on delete cascade, + default_price number default 0 not null, + currency char(3) default 'USD', + -- Is this activity occurring? If not, we can't assign + -- any new events to it. + available_p char(1) default 't' check (available_p in ('t', 'f')), + deleted_p char(1) default 'f' check (deleted_p in ('t', 'f')), + -- URL for more details + detail_url varchar(256), + default_contact_user_id integer references users +); + +comment on table events_activities is ' + Table events_activities supplies additional information for events_activities type. +'; Index: openacs-4/contrib/packages/events/sql/oracle/events-activities-drop.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/events/sql/oracle/events-activities-drop.sql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/events/sql/oracle/events-activities-drop.sql 9 Mar 2003 12:07:16 -0000 1.1 @@ -0,0 +1,19 @@ +-- +-- The Events Package +-- +-- @author Michael Steigman (michael@steigman.net) +-- @version $Id: events-activities-drop.sql,v 1.1 2003/03/09 12:07:16 lars Exp $ +-- +-- This package was orinally written by Bryan Che and Philip Greenspun +-- +-- GNU GPL v2 +-- + +drop table events_activities; +delete from acs_objects where object_type = 'events_activity'; + +declare begin + acs_object_type.drop_type (object_type => 'events_activity' ); +end; +/ +show errors; Index: openacs-4/contrib/packages/events/sql/oracle/events-activities-package-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/events/sql/oracle/events-activities-package-create.sql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/events/sql/oracle/events-activities-package-create.sql 9 Mar 2003 12:07:16 -0000 1.1 @@ -0,0 +1,104 @@ +-- +-- The Events Package +-- +-- @author Michael Steigman (michael@steigman.net) +-- @version $Id: events-activities-package-create.sql,v 1.1 2003/03/09 12:07:16 lars Exp $ +-- +-- This package was orinally written by Bryan Che and Philip Greenspun +-- +-- GNU GPL v2 +-- + + +-- The Activity Package + +create or replace package events_activity +as + function new ( + activity_id in events_activities.activity_id%TYPE default null, + package_id in events_activities.package_id%TYPE, + detail_url in events_activities.detail_url%TYPE default null, + default_contact_user_id in events_activities.default_contact_user_id%TYPE default null, + name in acs_activities.name%TYPE default null, + description in acs_activities.description%TYPE default null, + html_p in acs_activities.html_p%TYPE default 'f', + status_summary in acs_activities.status_summary%TYPE default null, + object_type in acs_object_types.object_type%TYPE default 'events_activity', + creation_date in acs_objects.creation_date%TYPE default sysdate, + creation_user in acs_objects.creation_user%TYPE, + creation_ip in acs_objects.creation_ip%TYPE, + context_id in acs_objects.context_id%TYPE default null + ) return events_activities.activity_id%TYPE; + + procedure del ( + activity_id in events_activities.activity_id%TYPE + ); + +end events_activity; +/ +show errors; + + + +create or replace package body events_activity +as + function new ( + activity_id in events_activities.activity_id%TYPE default null, + package_id in events_activities.package_id%TYPE, + detail_url in events_activities.detail_url%TYPE default null, + default_contact_user_id in events_activities.default_contact_user_id%TYPE default null, + name in acs_activities.name%TYPE default null, + description in acs_activities.description%TYPE default null, + html_p in acs_activities.html_p%TYPE default 'f', + status_summary in acs_activities.status_summary%TYPE default null, + object_type in acs_object_types.object_type%TYPE default 'events_activity', + creation_date in acs_objects.creation_date%TYPE default sysdate, + creation_user in acs_objects.creation_user%TYPE, + creation_ip in acs_objects.creation_ip%TYPE, + context_id in acs_objects.context_id%TYPE default null + ) return events_activities.activity_id%TYPE + is + v_activity_id events_activities.activity_id%TYPE; + begin + v_activity_id:= acs_activity.new ( + activity_id => activity_id, + name => name, + description => description, + html_p => html_p, + status_summary => status_summary, + object_type => object_type, + creation_date => creation_date, + creation_user => creation_user, + creation_ip => creation_ip, + context_id => context_id + ); + + insert into events_activities + (activity_id, package_id, detail_url, default_contact_user_id) + values + (v_activity_id, package_id, detail_url, default_contact_user_id); + + return v_activity_id; + end new; + + procedure del ( + activity_id in events_activities.activity_id%TYPE + ) + is + cursor v_activity_events is + select event_id from acs_events + where activity_id = del.activity_id; + begin + -- find and delete event instances + for row in v_activity_events loop + events_event.del(row.event_id); + end loop; + delete from events_def_actvty_attr_map where activity_id = del.activity_id; + delete from events_org_role_activity_map where activity_id = del.activity_id; + delete from events_activities where activity_id = del.activity_id; + acs_object.delete(activity_id); + end del; + +end events_activity; +/ +show errors; Index: openacs-4/contrib/packages/events/sql/oracle/events-activities-package-drop.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/events/sql/oracle/events-activities-package-drop.sql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/events/sql/oracle/events-activities-package-drop.sql 9 Mar 2003 12:07:16 -0000 1.1 @@ -0,0 +1,12 @@ +-- +-- The Events Package +-- +-- @author Michael Steigman (michael@steigman.net) +-- @version $Id: events-activities-package-drop.sql,v 1.1 2003/03/09 12:07:16 lars Exp $ +-- +-- This package was orinally written by Bryan Che and Phillip Greenspun +-- +-- GNU GPL v2 +-- + +drop package events_activity; Index: openacs-4/contrib/packages/events/sql/oracle/events-attributes-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/events/sql/oracle/events-attributes-create.sql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/events/sql/oracle/events-attributes-create.sql 9 Mar 2003 12:07:16 -0000 1.1 @@ -0,0 +1,77 @@ +-- +-- The Events Package +-- +-- @author Michael Steigman (michael@steigman.net) +-- @version $Id: events-attributes-create.sql,v 1.1 2003/03/09 12:07:16 lars Exp $ +-- +-- This package was originally written by Bryan Che and Philip Greenspun +-- +-- GNU GPL v2 +-- + +-- Each event can have custom fields registrants should enter. To +-- accomplish this, we use the acs_attribute system, adding attributes +-- to the events_registration object and keeping a mapping of attribute to +-- each event/activity. + +create table events_event_attr_map ( + event_id integer + constraint evnts_evnt_attr_map_evnt_id_fk + references events_events, + attribute_id integer + constraint evnts_evnt_attr_map_attr_id_fk + references acs_attributes, + constraint event_attr_map_pk + primary key(event_id, attribute_id) +); + +create index evnts_attr_map_event_id_idx on events_event_attr_map (event_id); + +create table events_def_actvty_attr_map ( + activity_id integer + constraint evnts_act_attr_map_act_id_fk + references events_activities, + attribute_id integer + constraint evnts_act_attr_map_attr_id_fk + references acs_attributes, + constraint events_activity_attr_map_pk + primary key(activity_id, attribute_id) +); + +create index evnts_act_attr_map_act_id_idx on events_def_actvty_attr_map (activity_id); + +create sequence events_attr_cat_seq start with 1; +create table events_attr_categories ( + category_id integer + constraint events_attr_categories_pk + primary key, + category_name varchar(100) +); + +create table events_attr_category_map ( + attribute_id integer + constraint events_attr_cat_map_attr_id_fk + references acs_attributes, + category_id integer + constraint events_attr_cat_map_cat_id_fk + references events_attr_categories, + constraint events_attr_category_map_pk + primary key(attribute_id, category_id) +); + +create index evnts_attr_cat_map_attr_id_idx on events_attr_category_map (attribute_id); + +insert into events_attr_categories +(category_id, category_name) +values +(events_attr_cat_seq.nextval, 'Personal'); + +insert into events_attr_categories +(category_id, category_name) +values +(events_attr_cat_seq.nextval, 'Professional'); + +insert into events_attr_categories +(category_id, category_name) +values +(events_attr_cat_seq.nextval, 'Travel\Accomodations'); Index: openacs-4/contrib/packages/events/sql/oracle/events-attributes-drop.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/events/sql/oracle/events-attributes-drop.sql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/events/sql/oracle/events-attributes-drop.sql 9 Mar 2003 12:07:16 -0000 1.1 @@ -0,0 +1,17 @@ +-- +-- The Events Package +-- +-- @author Michael Steigman (michael@steigman.net) +-- @version $Id: events-attributes-drop.sql,v 1.1 2003/03/09 12:07:16 lars Exp $ +-- +-- This package was originally written by Bryan Che and Philip Greenspun +-- +-- GNU GPL v2 +-- + +drop sequence events_attr_cat_seq; +drop table events_attr_category_map; +drop table events_attr_categories; +drop table events_def_actvty_attr_map; +drop table events_event_attr_map; + Index: openacs-4/contrib/packages/events/sql/oracle/events-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/events/sql/oracle/events-create.sql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/events/sql/oracle/events-create.sql 9 Mar 2003 12:07:16 -0000 1.1 @@ -0,0 +1,43 @@ +-- +-- The Events Package +-- +-- @author Michael Steigman (michael@steigman.net) +-- @version $Id: events-create.sql,v 1.1 2003/03/09 12:07:16 lars Exp $ +-- +-- This package was originally written by Bryan Che and Philip Greenspun +-- +-- GNU GPL v2 +-- + +-- event venues +@ events-venues-create.sql +@ events-venues-package-create.sql + +-- events and activities +@ events-events-create.sql +@ events-activities-create.sql + +-- venue hierarchy and connections +@ events-venues-hc-create.sql + +-- event prices +@ events-prices-create.sql + +-- event registrations and orders +@ events-orders-create.sql +@ events-orders-package-create.sql +@ events-registrations-create.sql +@ events-registrations-package-create.sql + +-- custom fields +@ events-attributes-create.sql + +-- event organizers +@ events-organizers-create.sql + +-- events package (references custom fields) +@ events-events-package-create.sql +@ events-activities-package-create.sql + +-- events permissions +@ events-permissions-create.sql \ No newline at end of file Index: openacs-4/contrib/packages/events/sql/oracle/events-drop.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/events/sql/oracle/events-drop.sql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/events/sql/oracle/events-drop.sql 9 Mar 2003 12:07:17 -0000 1.1 @@ -0,0 +1,41 @@ +-- +-- The Events Package +-- +-- @author Michael Steigman (michael@steigman.net) +-- @version $Id: events-drop.sql,v 1.1 2003/03/09 12:07:17 lars Exp $ +-- +-- This package was originally written by Bryan Che and Phillip Greenspun +-- +-- GNU GPL v2 +-- + +-- event organizers +@ events-organizers-drop.sql + +-- custom fields +@ events-attributes-drop.sql + +-- event registrations and orders +@ events-registrations-drop.sql +@ events-registrations-package-drop.sql +@ events-orders-drop.sql +@ events-orders-package-drop.sql + +-- event prices +@ events-prices-drop.sql + +-- venue hierarchy and connections +@ events-venues-hc-drop.sql + +-- events and activities +@ events-events-drop.sql +@ events-events-package-drop.sql +@ events-activities-drop.sql +@ events-activities-package-drop.sql + +-- event venues +@ events-venues-drop.sql +@ events-venues-package-drop.sql + +-- events permissions +@ events-permissions-drop.sql Index: openacs-4/contrib/packages/events/sql/oracle/events-events-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/events/sql/oracle/events-events-create.sql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/events/sql/oracle/events-events-create.sql 9 Mar 2003 12:07:17 -0000 1.1 @@ -0,0 +1,136 @@ +-- +-- The Events Package +-- +-- @author Michael Steigman (michael@steigman.net) +-- @version $Id: events-events-create.sql,v 1.1 2003/03/09 12:07:17 lars Exp $ +-- +-- This package was originally written by Bryan Che and Philip Greenspun +-- +-- GNU GPL v2 +-- + +-- +-- Event Object Type +-- +declare +begin + + acs_object_type.create_type( + object_type => 'events_event', + pretty_name => 'Event', + pretty_plural => 'Events', + supertype => 'acs_event', + table_name => 'events_events', + id_column => 'event_id' + ); + +end; +/ +show errors + +declare + attr_id acs_attributes.attribute_id%TYPE; +begin + attr_id := acs_attribute.create_attribute ( + object_type => 'events_event', + attribute_name => 'max_people', + datatype => 'integer', + pretty_name => 'Max People', + pretty_plural => 'Max People' + ); + + attr_id := acs_attribute.create_attribute ( + object_type => 'events_event', + attribute_name => 'reg_deadline', + datatype => 'date', + pretty_name => 'Registration Deadline', + pretty_plural => 'Registration Deadlines' + ); + + attr_id := acs_attribute.create_attribute ( + object_type => 'events_event', + attribute_name => 'available_p', + datatype => 'string', + pretty_name => 'Available?', + pretty_plural => 'Available?' + ); + + attr_id := acs_attribute.create_attribute ( + object_type => 'events_event', + attribute_name => 'display_after', + datatype => 'string', + pretty_name => 'Display After', + pretty_plural => 'Display After' + ); + + attr_id := acs_attribute.create_attribute ( + object_type => 'events_event', + attribute_name => 'av_note', + datatype => 'string', + pretty_name => 'Audio/Visual Note', + pretty_plural => 'Audio/Visual Notes' + ); + + attr_id := acs_attribute.create_attribute ( + object_type => 'events_event', + attribute_name => 'refreshments_note', + datatype => 'string', + pretty_name => 'Refreshment Note', + pretty_plural => 'Refreshment Notes' + ); + + attr_id := acs_attribute.create_attribute ( + object_type => 'events_event', + attribute_name => 'additional_note', + datatype => 'string', + pretty_name => 'Additional Note', + pretty_plural => 'Additional Notes' + ); +end; +/ +show errors; + + +-- Each event has the super_type of ACS_EVENTS +-- Table events_events supplies additional information +create table events_events ( + event_id integer + constraint events_event_id_fk + references acs_events + constraint events_event_id_pk + primary key, + venue_id integer + constraint events_venue_id_fk + references events_venues, + display_after varchar(4000), + max_people integer, + contact_user_id integer + constraint events_cntct_usr_id_fk + references users, + reg_deadline date not null, + available_p char(1) default 't' check (available_p in ('t', 'f')), + deleted_p char(1) default 'f' check (deleted_p in ('t', 'f')), + reg_cancellable_p char(1) default 't' check (reg_cancellable_p in ('t', 'f')), + reg_needs_approval_p char(1) default 'f' check (reg_needs_approval_p in ('t', 'f')), + av_note varchar(4000), + refreshments_note varchar(4000), + additional_note varchar(4000), + alternative_reg varchar(4000), + bulk_mail_id integer + constraint bulk_mail_id_fk + references bulk_mail_messages +); + +comment on table events_events is ' + Table events_events supplies additional information for events_event type. +'; + +comment on column events_events.event_id is ' + Primary Key +'; + +comment on column events_events.display_after is ' + This field contains text that will be displayed to user + after registering for an event. +'; + Index: openacs-4/contrib/packages/events/sql/oracle/events-events-drop.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/events/sql/oracle/events-events-drop.sql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/events/sql/oracle/events-events-drop.sql 9 Mar 2003 12:07:17 -0000 1.1 @@ -0,0 +1,32 @@ +-- +-- The Events Package +-- +-- @author Michael Steigman (michael@steigman.net) +-- @version $Id: events-events-drop.sql,v 1.1 2003/03/09 12:07:17 lars Exp $ +-- +-- This package was originally written by Bryan Che and Philip Greenspun +-- +-- GNU GPL v2 +-- + +declare + cursor v_event_ids is + select event_id from events_events; +begin + for row in v_event_ids loop + delete from events_events where event_id = row.event_id; + delete from acs_events where event_id = row.event_id; + delete from acs_objects where object_id = row.event_id; + end loop; +end; +/ +show errors; + +drop table events_events; + +declare begin + acs_object_type.drop_type (object_type => 'events_event'); +end; +/ +show errors; + Index: openacs-4/contrib/packages/events/sql/oracle/events-events-package-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/events/sql/oracle/events-events-package-create.sql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/events/sql/oracle/events-events-package-create.sql 9 Mar 2003 12:07:17 -0000 1.1 @@ -0,0 +1,221 @@ +-- +-- The Events Package +-- +-- @author Michael Steigman (michael@steigman.net) +-- @version $Id: events-events-package-create.sql,v 1.1 2003/03/09 12:07:17 lars Exp $ +-- +-- This package was orinally written by Bryan Che and Philip Greenspun +-- +-- GNU GPL v2 +-- + + +-- The Event Package + +create or replace package events_event +as + procedure new ( + event_id in events_events.event_id%TYPE default null, + venue_id in events_venues.venue_id%TYPE, + display_after in events_events.display_after%TYPE default null, + max_people in events_events.max_people%TYPE default null, + reg_deadline in events_events.reg_deadline%TYPE, + available_p in events_events.available_p%TYPE default 't', + deleted_p in events_events.deleted_p%TYPE default 'f', + reg_cancellable_p in events_events.reg_cancellable_p%TYPE, + reg_needs_approval_p in events_events.reg_needs_approval_p%TYPE, + contact_user_id in events_events.contact_user_id%TYPE default null, + refreshments_note in events_events.refreshments_note%TYPE default null, + av_note in events_events.av_note%TYPE default null, + additional_note in events_events.additional_note%TYPE default null, + alternative_reg in events_events.alternative_reg%TYPE default null, + activity_id in acs_events.activity_id%TYPE + ); + +-- function new ( +-- event_id in events_events.event_id%TYPE default null, +-- venue_id in events_venues.venue_id%TYPE, +-- display_after in events_events.display_after%TYPE default null, +-- max_people in events_events.max_people%TYPE default null, +-- reg_deadline in events_events.reg_deadline%TYPE, +-- available_p in events_events.available_p%TYPE default 't', +-- deleted_p in events_events.deleted_p%TYPE default 'f', +-- reg_cancellable_p in events_events.reg_cancellable_p%TYPE, +-- reg_needs_approval_p in events_events.reg_needs_approval_p%TYPE, +-- refreshments_note in events_events.refreshments_note%TYPE default null, +-- av_note in events_events.av_note%TYPE default null, +-- additional_note in events_events.additional_note%TYPE default null, +-- alternative_reg in events_events.alternative_reg%TYPE default null, +-- activity_id in acs_events.activity_id%TYPE, +-- name in acs_events.name%TYPE default null, +-- description in acs_events.description%TYPE default null, +-- html_p in acs_events.html_p%TYPE default 'f', +-- status_summary in acs_events.status_summary%TYPE default null, +-- timespan_id in acs_events.timespan_id%TYPE, +-- recurrence_id in acs_events.recurrence_id%TYPE default null, +-- object_type in acs_objects.object_type%TYPE default 'events_event', +-- creation_date in acs_objects.creation_date%TYPE default sysdate, +-- creation_user in acs_objects.creation_user%TYPE, +-- creation_ip in acs_objects.creation_ip%TYPE, +-- context_id in acs_objects.context_id%TYPE default null +-- ) return events_events.event_id%TYPE; + + procedure del ( + event_id in events_events.event_id%TYPE + ); + +end events_event; +/ +show errors; + +create or replace package body events_event +as + procedure new ( + event_id in events_events.event_id%TYPE default null, + venue_id in events_venues.venue_id%TYPE, + display_after in events_events.display_after%TYPE default null, + max_people in events_events.max_people%TYPE default null, + reg_deadline in events_events.reg_deadline%TYPE, + available_p in events_events.available_p%TYPE default 't', + deleted_p in events_events.deleted_p%TYPE default 'f', + reg_cancellable_p in events_events.reg_cancellable_p%TYPE, + reg_needs_approval_p in events_events.reg_needs_approval_p%TYPE, + contact_user_id in events_events.contact_user_id%TYPE default null, + refreshments_note in events_events.refreshments_note%TYPE default null, + av_note in events_events.av_note%TYPE default null, + additional_note in events_events.additional_note%TYPE default null, + alternative_reg in events_events.alternative_reg%TYPE default null, + activity_id in acs_events.activity_id%TYPE + ) + is + cursor v_activity_attrs is + select attribute_id + from events_def_actvty_attr_map edaam + where edaam.activity_id = new.activity_id; + cursor v_activity_org_roles is + select role_id + from events_org_role_activity_map eoram + where eoram.activity_id = new.activity_id; + begin + + insert into events_events + (event_id, contact_user_id, venue_id, display_after, max_people, reg_deadline, available_p, + deleted_p, reg_cancellable_p, reg_needs_approval_p, refreshments_note, av_note, + additional_note, alternative_reg) + values + (event_id, contact_user_id, venue_id, display_after, max_people, reg_deadline, available_p, + deleted_p, reg_cancellable_p, reg_needs_approval_p, refreshments_note, av_note, + additional_note, alternative_reg); + + -- copy over pointers to custom fields (registration attributes) + for row in v_activity_attrs loop + insert into events_event_attr_map + (event_id, attribute_id) + values + (event_id, row.attribute_id); + end loop; + + for row in v_activity_org_roles loop + insert into events_org_role_event_map + (event_id, role_id) + values + (event_id, row.role_id); + end loop; + end new; + +-- function new ( +-- event_id in events_events.event_id%TYPE default null, +-- venue_id in events_venues.venue_id%TYPE, +-- display_after in events_events.display_after%TYPE default null, +-- max_people in events_events.max_people%TYPE default null, +-- reg_deadline in events_events.reg_deadline%TYPE, +-- available_p in events_events.available_p%TYPE default 't', +-- deleted_p in events_events.deleted_p%TYPE default 'f', +-- reg_cancellable_p in events_events.reg_cancellable_p%TYPE, +-- reg_needs_approval_p in events_events.reg_needs_approval_p%TYPE, +-- refreshments_note in events_events.refreshments_note%TYPE default null, +-- av_note in events_events.av_note%TYPE default null, +-- additional_note in events_events.additional_note%TYPE default null, +-- alternative_reg in events_events.alternative_reg%TYPE default null, +-- activity_id in acs_events.activity_id%TYPE, +-- name in acs_events.name%TYPE default null, +-- description in acs_events.description%TYPE default null, +-- html_p in acs_events.html_p%TYPE default 'f', +-- status_summary in acs_events.status_summary%TYPE default null, +-- timespan_id in acs_events.timespan_id%TYPE, +-- recurrence_id in acs_events.recurrence_id%TYPE default null, +-- object_type in acs_objects.object_type%TYPE default 'events_event', +-- creation_date in acs_objects.creation_date%TYPE default sysdate, +-- creation_user in acs_objects.creation_user%TYPE, +-- creation_ip in acs_objects.creation_ip%TYPE, +-- context_id in acs_objects.context_id%TYPE default null +-- ) return events_events.event_id%TYPE +-- is +-- v_event_id events_events.event_id%TYPE; +-- cursor v_activity_attrs is +-- select attribute_id +-- from events_def_actvty_attr_map edaam +-- where edaam.activity_id = new.activity_id; +-- cursor v_activity_org_roles is +-- select role_id +-- from events_org_role_activity_map eoram +-- where eoram.activity_id = new.activity_id; +-- begin +-- v_event_id := acs_event.new ( +-- event_id => event_id, +-- name => name, +-- description => description, +-- html_p => html_p, +-- status_summary => status_summary, +-- timespan_id => timespan_id, +-- activity_id => activity_id, +-- recurrence_id => recurrence_id, +-- object_type => object_type, +-- creation_date => creation_date, +-- creation_user => creation_user, +-- creation_ip => creation_ip, +-- context_id => context_id +-- ); + +-- insert into events_events +-- (event_id, venue_id, display_after, max_people, reg_deadline, available_p, +-- deleted_p, reg_cancellable_p, reg_needs_approval_p, refreshments_note, av_note, +-- additional_note, alternative_reg) +-- values +-- (v_event_id, venue_id, display_after, max_people, reg_deadline, available_p, +-- deleted_p, reg_cancellable_p, reg_needs_approval_p, refreshments_note, av_note, +-- additional_note, alternative_reg); + +-- -- copy over pointers to custom fields (registration attributes) +-- for row in v_activity_attrs loop +-- insert into events_event_attr_map +-- (event_id, attribute_id) +-- values +-- (v_event_id, row.attribute_id); +-- end loop; + +-- for row in v_activity_org_roles loop +-- insert into events_org_role_event_map +-- (event_id, role_id) +-- values +-- (v_event_id, row.role_id); +-- end loop; + +-- return v_event_id; +-- end new; + + procedure del ( + event_id in events_events.event_id%TYPE + ) + is + begin + delete from events_org_role_event_map where event_id = del.event_id; + delete from events_event_attr_map where event_id = del.event_id; + delete from events_events where event_id = del.event_id; + acs_object.delete(event_id); + end del; + +end events_event; +/ +show errors; + Index: openacs-4/contrib/packages/events/sql/oracle/events-events-package-drop.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/events/sql/oracle/events-events-package-drop.sql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/events/sql/oracle/events-events-package-drop.sql 9 Mar 2003 12:07:17 -0000 1.1 @@ -0,0 +1,12 @@ +-- +-- The Events Package +-- +-- @author Michael Steigman (michael@steigman.net) +-- @version $Id: events-events-package-drop.sql,v 1.1 2003/03/09 12:07:17 lars Exp $ +-- +-- This package was orinally written by Bryan Che and Phillip Greenspun +-- +-- GNU GPL v2 +-- + +drop package events_event; Index: openacs-4/contrib/packages/events/sql/oracle/events-orders-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/events/sql/oracle/events-orders-create.sql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/events/sql/oracle/events-orders-create.sql 9 Mar 2003 12:07:17 -0000 1.1 @@ -0,0 +1,49 @@ +-- +-- The Events Package +-- +-- @author Michael Steigman (michael@steigman.net) +-- @version $Id: events-orders-create.sql,v 1.1 2003/03/09 12:07:17 lars Exp $ +-- +-- This package was originally written by Bryan Che and Phillip Greenspun +-- +-- GNU GPL v2 +-- + +-- Order Object Type + +declare +begin + + acs_object_type.create_type( + object_type => 'events_order', + pretty_name => 'Order', + pretty_plural => 'Orders', + supertype => 'acs_object', + table_name => 'events_orders', + id_column => 'order_id' + ); + +end; +/ +show errors; + +-- Table to hold additional attributes +create table events_orders ( + order_id constraint events_orders_order_id_fk + references acs_objects + constraint events_orders_order_id_pk + primary key, + -- ec_order_id integer references ec_orders, + -- the person who made the order + user_id integer + constraint events_orders_user_id_fk + references users, + paid_p char(1) default null check (paid_p in ('t', 'f', null)), + payment_method varchar(50), + confirmed_date date, + price_charged number, + -- the date this registration was refunded, if it was refunded + refunded_date date, + price_refunded number +); + Index: openacs-4/contrib/packages/events/sql/oracle/events-orders-drop.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/events/sql/oracle/events-orders-drop.sql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/events/sql/oracle/events-orders-drop.sql 9 Mar 2003 12:07:17 -0000 1.1 @@ -0,0 +1,23 @@ +-- +-- The Events Package +-- +-- @author Michael Steigman (michael@steigman.net) +-- @version $Id: events-orders-drop.sql,v 1.1 2003/03/09 12:07:17 lars Exp $ +-- +-- This package was orinally written by Bryan Che and Philip Greenspun +-- +-- GNU GPL v2 +-- + +drop table events_orders; +delete from acs_objects where object_type = 'events_order'; + +declare +begin + + acs_object_type.drop_type ( + object_type => 'events_order' + ); +end; +/ +show errors; Index: openacs-4/contrib/packages/events/sql/oracle/events-orders-package-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/events/sql/oracle/events-orders-package-create.sql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/events/sql/oracle/events-orders-package-create.sql 9 Mar 2003 12:07:17 -0000 1.1 @@ -0,0 +1,75 @@ +-- +-- The Events Package +-- +-- @author Michael Steigman (michael@steigman.net) +-- @version $Id: events-orders-package-create.sql,v 1.1 2003/03/09 12:07:17 lars Exp $ +-- +-- This package was originally written by Bryan Che and Philip Greenspun +-- +-- GNU GPL v2 +-- + +-- Order Package + +create or replace package events_order +as + function new ( + order_id in events_orders.order_id%TYPE default null, + user_id in users.user_id%TYPE, + creation_date in acs_objects.creation_date%TYPE default sysdate, + creation_user in acs_objects.creation_user%TYPE, + creation_ip in acs_objects.creation_ip%TYPE, + context_id in acs_objects.context_id%TYPE default null + ) return events_orders.order_id%TYPE; + + procedure del ( + order_id in events_orders.order_id%TYPE + ); + +end events_order; +/ +show errors; + + + +create or replace package body events_order +as + function new ( + order_id in events_orders.order_id%TYPE default null, + user_id in users.user_id%TYPE, + creation_date in acs_objects.creation_date%TYPE default sysdate, + creation_user in acs_objects.creation_user%TYPE, + creation_ip in acs_objects.creation_ip%TYPE, + context_id in acs_objects.context_id%TYPE default null + ) return events_orders.order_id%TYPE + is + v_order_id acs_objects.object_id%TYPE; + begin + v_order_id:= acs_object.new ( + object_id => order_id, + object_type => 'events_order', + creation_date => creation_date, + creation_user => creation_user, + creation_ip => creation_ip, + context_id => context_id + ); + + insert into events_orders + (order_id, user_id) + values + (v_order_id, user_id); + + return v_order_id; + end new; + + procedure del ( + order_id in events_orders.order_id%TYPE + ) + is + begin + acs_object.delete(del.order_id); + end del; + +end events_order; +/ +show errors; Index: openacs-4/contrib/packages/events/sql/oracle/events-orders-package-drop.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/events/sql/oracle/events-orders-package-drop.sql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/events/sql/oracle/events-orders-package-drop.sql 9 Mar 2003 12:07:17 -0000 1.1 @@ -0,0 +1,12 @@ +-- +-- The Events Package +-- +-- @author Michael Steigman (michael@steigman.net) +-- @version $Id: events-orders-package-drop.sql,v 1.1 2003/03/09 12:07:17 lars Exp $ +-- +-- This package was orinally written by Bryan Che and Phillip Greenspun +-- +-- GNU GPL v2 +-- + +drop package events_order; Index: openacs-4/contrib/packages/events/sql/oracle/events-organizers-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/events/sql/oracle/events-organizers-create.sql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/events/sql/oracle/events-organizers-create.sql 9 Mar 2003 12:07:17 -0000 1.1 @@ -0,0 +1,81 @@ +-- +-- The Events Package +-- +-- @author Michael Steigman (michael@steigman.net) +-- @version $Id: events-organizers-create.sql,v 1.1 2003/03/09 12:07:17 lars Exp $ +-- +-- This package was originally written by Bryan Che and Philip Greenspun +-- +-- GNU GPL v2 +-- + +-- Organizer roles for activities and events + +create sequence events_org_roles_seq start with 1; +create table events_organizer_roles ( + role_id integer + constraint evnts_org_roles_role_id_pk + primary key, + role varchar(200) + constraint evnts_org_roles_role_nn + not null, + responsibilities clob, + -- is this a role that we want event registrants to see? + public_role_p char(1) default 'f' + constraint evnts_org_roles_public_role_p + check (public_role_p in ('t', 'f')), + package_id integer + constraint evnts_org_roles_pkg_id_fk + references apm_packages + on delete cascade +); + +create table events_org_role_activity_map ( + role_id integer + constraint evnts_org_role_am_role_id_fk + references events_organizer_roles, + activity_id integer + constraint evnts_org_role_act_id_fk + references events_activities +); + +create table events_org_role_event_map ( + role_id integer + constraint evnts_org_role_em_role_id_fk + references events_organizer_roles, + event_id integer + constraint evnts_org_role_evnt_id_fk + references events_events +); + +create table events_organizers_map ( + user_id constraint evnt_org_map_user_id_nn + not null + constraint evnt_org_map_user_id_fk + references users, + role_id integer + constraint evnt_org_map_role_id_nn + not null + constraint evnt_org_map_role_id_fk + references events_organizer_roles, + event_id integer + constraint evnt_org_map_evnt_id_nn + not null + constraint evnt_org_map_evnt_id_fk + references events_events, + constraint events_org_map_pk primary key (user_id, role_id, event_id) +); + +-- create a view to see event organizer roles and the people in those roles +create or replace view events_organizers +as +select eor.*, eom.user_id, eorem.event_id + from events_organizer_roles eor, + events_org_role_event_map eorem, + events_organizers_map eom + where eor.role_id = eorem.role_id + and eorem.role_id = eom.role_id(+); + + + + Index: openacs-4/contrib/packages/events/sql/oracle/events-organizers-drop.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/events/sql/oracle/events-organizers-drop.sql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/events/sql/oracle/events-organizers-drop.sql 9 Mar 2003 12:07:17 -0000 1.1 @@ -0,0 +1,17 @@ +-- +-- The Events Package +-- +-- @author Michael Steigman (michael@steigman.net) +-- @version $Id: events-organizers-drop.sql,v 1.1 2003/03/09 12:07:17 lars Exp $ +-- +-- This package was orinally written by Bryan Che and Phillip Greenspun +-- +-- GNU GPL v2 +-- + +drop sequence events_org_roles_seq; +drop table events_org_role_event_map; +drop table events_org_role_activity_map; +drop table events_organizers_map; +drop table events_organizer_roles; +drop view events_organizers Index: openacs-4/contrib/packages/events/sql/oracle/events-permissions-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/events/sql/oracle/Attic/events-permissions-create.sql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/events/sql/oracle/events-permissions-create.sql 9 Mar 2003 12:07:17 -0000 1.1 @@ -0,0 +1,38 @@ +-- +-- The Events Package +-- +-- @author Michael Steigman (michael@steigman.net) +-- @version $Id: events-permissions-create.sql,v 1.1 2003/03/09 12:07:17 lars Exp $ +-- +-- This package was originally written by Bryan Che and Philip Greenspun +-- +-- GNU GPL v2 +-- + +-- +-- Privileges +-- +declare +begin + + acs_privilege.create_privilege('events_event_create',null,null); + acs_privilege.create_privilege('events_activity_create',null,null); + acs_privilege.create_privilege('events_event_write',null,null); + acs_privilege.create_privilege('events_activity_write',null,null); + acs_privilege.create_privilege('events_event_delete',null,null); + acs_privilege.create_privilege('events_activity_delete',null,null); + acs_privilege.create_privilege('events_event_read',null,null); + acs_privilege.create_privilege('events_activity_read',null,null); + + -- add children + acs_privilege.add_child('create','events_event_create'); + acs_privilege.add_child('create','events_activity_create'); + acs_privilege.add_child('write','events_event_write'); + acs_privilege.add_child('write','events_activity_write'); + acs_privilege.add_child('delete','events_event_delete'); + acs_privilege.add_child('delete','events_activity_delete'); + acs_privilege.add_child('read','events_event_read'); + acs_privilege.add_child('read','events_activity_read'); +end; +/ +show errors; Index: openacs-4/contrib/packages/events/sql/oracle/events-permissions-drop.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/events/sql/oracle/Attic/events-permissions-drop.sql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/events/sql/oracle/events-permissions-drop.sql 9 Mar 2003 12:07:17 -0000 1.1 @@ -0,0 +1,39 @@ +-- +-- The Events Package +-- +-- @author Michael Steigman (michael@steigman.net) +-- @version $Id: events-permissions-drop.sql,v 1.1 2003/03/09 12:07:17 lars Exp $ +-- +-- This package was originally written by Bryan Che and Philip Greenspun +-- +-- GNU GPL v2 +-- + +-- +-- Privileges +-- +declare +begin + + -- remove children + acs_privilege.remove_child('create','events_event_create'); + acs_privilege.remove_child('create','events_activity_create'); + acs_privilege.remove_child('write','events_event_write'); + acs_privilege.remove_child('write','events_activity_write'); + acs_privilege.remove_child('delete','events_event_delete'); + acs_privilege.remove_child('delete','events_activity_delete'); + acs_privilege.remove_child('read','events_event_read'); + acs_privilege.remove_child('read','events_activity_read'); + + acs_privilege.drop_privilege('events_event_create'); + acs_privilege.drop_privilege('events_activity_create'); + acs_privilege.drop_privilege('events_event_write'); + acs_privilege.drop_privilege('events_activity_write'); + acs_privilege.drop_privilege('events_event_delete'); + acs_privilege.drop_privilege('events_activity_delete'); + acs_privilege.drop_privilege('events_event_read'); + acs_privilege.drop_privilege('events_activity_read'); + +end; +/ +show errors; Index: openacs-4/contrib/packages/events/sql/oracle/events-prices-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/events/sql/oracle/events-prices-create.sql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/events/sql/oracle/events-prices-create.sql 9 Mar 2003 12:07:17 -0000 1.1 @@ -0,0 +1,35 @@ +-- +-- The Events Package +-- +-- @author Michael Steigman (michael@steigman.net) +-- @version $Id: events-prices-create.sql,v 1.1 2003/03/09 12:07:17 lars Exp $ +-- +-- This package was orinally written by Bryan Che and Phillip Greenspun +-- +-- GNU GPL v2 +-- + +-- Not implemented yet + +create sequence events_price_id_sequence; + +create table events_prices ( + price_id integer primary key, + event_id integer not null references events_events, + -- e.g., "Developer", "Student" + description varchar(100) not null, + -- we also store the price here too in case someone doesn't want + -- to use the ecommerce module but still wants to have prices + price number not null, + -- This is for hooking up to ecommerce. + -- Each product is a different price for this event. For example, + -- student price and normal price products for an event. +-- product_id integer references ec_products, + -- prices may be different for early, normal, late, on-site + -- admission, + -- depending on the date + expire_date date not null, + available_date date not null +); + +create index evnt_price_idx on events_prices(price_id, event_id); Index: openacs-4/contrib/packages/events/sql/oracle/events-prices-drop.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/events/sql/oracle/events-prices-drop.sql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/events/sql/oracle/events-prices-drop.sql 9 Mar 2003 12:07:17 -0000 1.1 @@ -0,0 +1,13 @@ +-- +-- The Events Package +-- +-- @author Michael Steigman (michael@steigman.net) +-- @version $Id: events-prices-drop.sql,v 1.1 2003/03/09 12:07:17 lars Exp $ +-- +-- This package was orinally written by Bryan Che and Phillip Greenspun +-- +-- GNU GPL v2 +-- + +drop sequence events_price_id_sequence; +drop table events_prices; Index: openacs-4/contrib/packages/events/sql/oracle/events-registrations-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/events/sql/oracle/events-registrations-create.sql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/events/sql/oracle/events-registrations-create.sql 9 Mar 2003 12:07:17 -0000 1.1 @@ -0,0 +1,241 @@ +-- +-- The Events Package +-- +-- @author Michael Steigman (michael@steigman.net) +-- @version $Id: events-registrations-create.sql,v 1.1 2003/03/09 12:07:17 lars Exp $ +-- +-- This package was orinally written by Bryan Che and Phillip Greenspun +-- +-- GNU GPL v2 +-- + +-- +-- Registration Object Type +-- +declare +begin + + acs_object_type.create_type( + object_type => 'events_registration', + pretty_name => 'Registration', + pretty_plural => 'Registrations', + supertype => 'acs_object', + table_name => 'events_registrations', + id_column => 'reg_id' + ); + +end; +/ +show errors; + + +-- declare +-- attr_id acs_attributes.attribute_id%TYPE; +-- begin +-- -- +-- -- events_registration foundation attributes +-- -- +-- attr_id := acs_attribute.create_attribute ( +-- object_type => 'events_registration', +-- attribute_name => 'reg_state', +-- datatype => 'string', +-- pretty_name => 'Registration State', +-- pretty_plural => 'Registration States' +-- ); +-- +-- attr_id := acs_attribute.create_attribute ( +-- object_type => 'events_registration', +-- attribute_name => 'shipped_date', +-- datatype => 'date', +-- pretty_name => 'Shipped Date', +-- pretty_plural => 'Shipped Dates' +-- ); +-- +-- -- +-- -- create built-in user-visible registration attributes +-- -- +-- attr_id := acs_attribute.create_attribute ( +-- object_type => 'events_registration', +-- attribute_name => 'org', +-- datatype => 'string', +-- pretty_name => 'Organization', +-- pretty_plural => 'Organizations', +-- sort_order => 1 +-- ); +-- +-- attr_id := acs_attribute.create_attribute ( +-- object_type => 'events_registration', +-- attribute_name => 'title_at_org', +-- datatype => 'string', +-- pretty_name => 'Title', +-- pretty_plural => 'Titles', +-- sort_order => 2 +-- ); +-- +-- attr_id := acs_attribute.create_attribute ( +-- object_type => 'events_registration', +-- attribute_name => 'attending_reason', +-- datatype => 'string', +-- pretty_name => 'Reason for attending', +-- pretty_plural => 'Reasons for attending', +-- sort_order => 3 +-- ); +-- +-- attr_id := acs_attribute.create_attribute ( +-- object_type => 'events_registration', +-- attribute_name => 'where_heard', +-- datatype => 'string', +-- pretty_name => 'Where did you hear about this activity?', +-- pretty_plural => 'Where did you hear about these activities?', +-- sort_order => 4 +-- ); +-- +-- attr_id := acs_attribute.create_attribute ( +-- object_type => 'events_registration', +-- attribute_name => 'need_hotel_p', +-- datatype => 'boolean', +-- pretty_name => 'Do you need a hotel?', +-- pretty_plural => 'Do you need a hotel?', +-- sort_order => 5 +-- ); +-- +-- attr_id := acs_attribute.create_attribute ( +-- object_type => 'events_registration', +-- attribute_name => 'need_car_p', +-- datatype => 'boolean', +-- pretty_name => 'Do you need a car?', +-- pretty_plural => 'Do you need a car?', +-- sort_order => 6 +-- ); +-- +-- attr_id := acs_attribute.create_attribute ( +-- object_type => 'events_registration', +-- attribute_name => 'need_plane_p', +-- datatype => 'boolean', +-- pretty_name => 'Do you need a plane ticket?', +-- pretty_plural => 'Do you need a plane ticket?', +-- sort_order => 7 +-- ); +-- +-- -- no sort order - comments will always be last +-- attr_id := acs_attribute.create_attribute ( +-- object_type => 'events_registration', +-- attribute_name => 'comments', +-- datatype => 'string', +-- pretty_name => 'Comments', +-- pretty_plural => 'Comments' +-- ); +-- +-- end; +-- / +-- show errors; +-- +create table events_registrations( + -- Goes into table at confirmation time: + reg_id integer not null primary key, + event_id integer not null references events_events, +-- order_id integer not null references events_orders, +-- price_id integer not null references events_prices, + -- the person registered for this reg_id (may not be the person + -- who made the order) + user_id integer not null references users, + -- reg_states: pending, shipped, canceled, waiting + --pending: waiting for approval + --shipped: registration all set + --canceled: registration canceled + --waiting: registration is wait-listed + reg_state varchar(50) not null check (reg_state in ('pending', 'approved', 'canceled', 'waiting')), + -- when the registration was made + -- reg_date date, + -- when the registration was approved + approval_date date, +-- org varchar(500), +-- title_at_org varchar(500), +-- attending_reason clob, +-- where_heard varchar(4000), + -- does this person need a hotel? +-- need_hotel_p char(1) default 'f' check (need_hotel_p in ('t', 'f')), + -- does this person need a rental car? +-- need_car_p char(1) default 'f' check (need_car_p in ('t', 'f')), + -- does this person need airfare? +-- need_plane_p char(1) default 'f' check (need_plane_p in ('t', 'f')), + comments varchar(4000) +); + + +-- +-- Indexes +-- + +-- removed price_id from index - 7/19/02 +create index evnt_reg_idx on events_registrations(reg_id, user_id, reg_state); + +-- need this index for speeding up /events/admin/order-history-one.tcl +--create index users_last_name_idx on users(lower(last_name), last_name, first_names, email, user_id); + +-- +-- Triggers +-- + +-- trigger for recording when a registration ships +create or replace trigger event_ship_date_trigger +before insert or update on events_registrations +for each row +when (old.reg_state <> 'approved' and new.reg_state = 'approved') +begin + :new.approval_date := sysdate; +end; +/ +show errors + +-- +-- Views +-- +-- +-- create or replace view events_reg_not_canceled +-- as +-- select * +-- from events_registrations +-- where reg_state <> 'canceled'; +-- +-- create or replace view events_reg_canceled +-- as +-- select * +-- from events_registrations +-- where reg_state = 'canceled'; +-- +-- create or replace view events_reg_shipped +-- as +-- select * +-- from events_registrations +-- where reg_state = 'shipped'; +-- +-- create a view that shows order states based upon each order's +-- registrations. The order states are: +-- void: All registrations canceled +-- incomplete: This order is not completely fulfilled--some registrations +-- are either canceled, waiting, or pending +-- fulfilled: This order is completely fulfilled +-- create or replace view events_orders_states +-- as +-- select o.*, +-- o_states.order_state +-- from events_orders o, +-- (select +-- order_id, +-- decode (floor(avg (decode (reg_state, +-- 'canceled', 0, +-- 'waiting', 1, +-- 'pending', 2, +-- 'shipped', 3, +-- 0))), +-- 0, 'canceled', +-- 1, 'incomplete', +-- 2, 'incomplete', +-- 3, 'fulfilled', +-- 'void') as order_state +-- from events_registrations +-- group by order_id) o_states +--where o_states.order_id = o.order_id; + + Index: openacs-4/contrib/packages/events/sql/oracle/events-registrations-drop.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/events/sql/oracle/events-registrations-drop.sql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/events/sql/oracle/events-registrations-drop.sql 9 Mar 2003 12:07:17 -0000 1.1 @@ -0,0 +1,28 @@ +-- +-- The Events Package +-- +-- @author Michael Steigman (michael@steigman.net) +-- @version $Id: events-registrations-drop.sql,v 1.1 2003/03/09 12:07:17 lars Exp $ +-- +-- This package was orinally written by Bryan Che and Phillip Greenspun +-- +-- GNU GPL v2 +-- + +--drop view events_orders_states; +--drop view events_reg_not_canceled; +--drop view events_reg_canceled; +--drop view events_reg_shipped; +drop table events_registrations; + +delete from acs_objects where object_type = 'events_registration'; + +declare +begin + + acs_object_type.drop_type ( + object_type => 'events_registration' + ); +end; +/ +show errors; Index: openacs-4/contrib/packages/events/sql/oracle/events-registrations-package-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/events/sql/oracle/events-registrations-package-create.sql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/events/sql/oracle/events-registrations-package-create.sql 9 Mar 2003 12:07:17 -0000 1.1 @@ -0,0 +1,81 @@ +-- +-- The Events Package +-- +-- @author Michael Steigman (michael@steigman.net) +-- @version $Id: events-registrations-package-create.sql,v 1.1 2003/03/09 12:07:17 lars Exp $ +-- +-- This package was orinally written by Bryan Che and Philip Greenspun +-- +-- GNU GPL v2 +-- + +-- The Registration Package + +create or replace package events_registration +as + function new ( + reg_id in events_registrations.reg_id%TYPE default null, + event_id in events_events.event_id%TYPE, + user_id in users.user_id%TYPE, + reg_state in events_registrations.reg_state%TYPE, + comments in events_registrations.comments%TYPE, + creation_date in acs_objects.creation_date%TYPE default sysdate, + creation_user in acs_objects.creation_user%TYPE, + creation_ip in acs_objects.creation_ip%TYPE, + context_id in acs_objects.context_id%TYPE default null + ) return events_registrations.reg_id%TYPE; + + procedure del ( + reg_id in events_registrations.reg_id%TYPE + ); + +end events_registration; +/ +show errors; + + + +create or replace package body events_registration +as + function new ( + reg_id in events_registrations.reg_id%TYPE default null, + event_id in events_events.event_id%TYPE, + user_id in users.user_id%TYPE, + reg_state in events_registrations.reg_state%TYPE, + comments in events_registrations.comments%TYPE, + creation_date in acs_objects.creation_date%TYPE default sysdate, + creation_user in acs_objects.creation_user%TYPE, + creation_ip in acs_objects.creation_ip%TYPE, + context_id in acs_objects.context_id%TYPE default null + ) return events_registrations.reg_id%TYPE + is + v_reg_id acs_objects.object_id%TYPE; + begin + v_reg_id:= acs_object.new ( + object_id => reg_id, + object_type => 'events_registration', + creation_date => creation_date, + creation_user => creation_user, + creation_ip => creation_ip, + context_id => context_id + ); + + insert into events_registrations + (reg_id, event_id, user_id, reg_state, comments) + values + (v_reg_id, event_id, user_id, reg_state, comments); + + return v_reg_id; + end new; + + procedure del ( + reg_id in events_registrations.reg_id%TYPE + ) + is + begin + acs_object.delete(reg_id); + end del; + +end events_registration; +/ +show errors; Index: openacs-4/contrib/packages/events/sql/oracle/events-registrations-package-drop.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/events/sql/oracle/events-registrations-package-drop.sql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/events/sql/oracle/events-registrations-package-drop.sql 9 Mar 2003 12:07:17 -0000 1.1 @@ -0,0 +1,12 @@ +-- +-- The Events Package +-- +-- @author Michael Steigman (michael@steigman.net) +-- @version $Id: events-registrations-package-drop.sql,v 1.1 2003/03/09 12:07:17 lars Exp $ +-- +-- This package was orinally written by Bryan Che and Phillip Greenspun +-- +-- GNU GPL v2 +-- + +drop package events_registration; Index: openacs-4/contrib/packages/events/sql/oracle/events-venues-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/events/sql/oracle/events-venues-create.sql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/events/sql/oracle/events-venues-create.sql 9 Mar 2003 12:07:17 -0000 1.1 @@ -0,0 +1,162 @@ +-- +-- The Events Package +-- +-- @author Michael Steigman (michael@steigman.net) +-- @version $Id: events-venues-create.sql,v 1.1 2003/03/09 12:07:17 lars Exp $ +-- +-- This package was originally written by Bryan Che and Philip Greenspun +-- +-- GNU GPL v2 +-- + + +-- +-- Venue Object Types +-- + +declare +begin + + acs_object_type.create_type( + object_type => 'events_venue', + pretty_name => 'Venue', + pretty_plural => 'Venues', + supertype => 'acs_object', + table_name => 'events_venues', + id_column => 'venue_id', + package_name => 'events_venue' + ); + +end; +/ +show errors; + +declare + attr_id acs_attributes.attribute_id%TYPE; +begin + attr_id := acs_attribute.create_attribute ( + object_type => 'events_venue', + attribute_name => 'venue_name', + datatype => 'string', + pretty_name => 'Name', + pretty_plural => 'Names' + ); + + attr_id := acs_attribute.create_attribute ( + object_type => 'events_venue', + attribute_name => 'address1', + datatype => 'string', + pretty_name => 'Address 1', + pretty_plural => 'Address 1' + ); + + attr_id := acs_attribute.create_attribute ( + object_type => 'events_venue', + attribute_name => 'address2', + datatype => 'string', + pretty_name => 'Address 2', + pretty_plural => 'Address 2' + ); + + attr_id := acs_attribute.create_attribute ( + object_type => 'events_venue', + attribute_name => 'city', + datatype => 'string', + pretty_name => 'City', + pretty_plural => 'Cities' + ); + + attr_id := acs_attribute.create_attribute ( + object_type => 'events_venue', + attribute_name => 'usps_abbrev', + datatype => 'string', + pretty_name => 'USPS Abbreviation', + pretty_plural => 'USPS Abbreviations' + ); + + attr_id := acs_attribute.create_attribute ( + object_type => 'events_venue', + attribute_name => 'postal_code', + datatype => 'string', + pretty_name => 'Postal Code', + pretty_plural => 'Postal Codes' + ); + + attr_id := acs_attribute.create_attribute ( + object_type => 'events_venue', + attribute_name => 'iso', + datatype => 'string', + pretty_name => 'Country Code', + pretty_plural => 'Country Codes' + ); + + attr_id := acs_attribute.create_attribute ( + object_type => 'events_venue', + attribute_name => 'description', + datatype => 'string', + pretty_name => 'Description', + pretty_plural => 'Descriptions' + ); + + attr_id := acs_attribute.create_attribute ( + object_type => 'events_venue', + attribute_name => 'fax_number', + datatype => 'string', + pretty_name => 'Fax Number', + pretty_plural => 'Fax Numbers' + ); + + attr_id := acs_attribute.create_attribute ( + object_type => 'events_venue', + attribute_name => 'phone_number', + datatype => 'string', + pretty_name => 'Phone Number', + pretty_plural => 'Phone Numbers' + ); + + attr_id := acs_attribute.create_attribute ( + object_type => 'events_venue', + attribute_name => 'email', + datatype => 'string', + pretty_name => 'Email Address', + pretty_plural => 'Email Addresses' + ); + + attr_id := acs_attribute.create_attribute ( + object_type => 'events_venue', + attribute_name => 'max_people', + datatype => 'string', + pretty_name => 'Maximum Number of People', + pretty_plural => 'Maximum Number of People' + ); + +end; +/ +show errors; + + +-- where the events occur +create table events_venues ( + venue_id integer + constraint events_venues_pk + primary key, + venue_name varchar(200) not null, + address1 varchar(100), + address2 varchar(100), + city varchar(100), + usps_abbrev char(2), + postal_code varchar(20), + iso char(2) default 'US' references countries, + time_zone number references timezones(tz_id), + -- some contact info for this venue + phone_number varchar(30), + fax_number varchar(30), + email varchar(100), + needs_reserve_p char(1) default 'f' check (needs_reserve_p in ('t', 'f')), + max_people integer, + description varchar(4000), + package_id integer + constraint evnts_venues_pkg_id_fk + references apm_packages + on delete cascade +); \ No newline at end of file Index: openacs-4/contrib/packages/events/sql/oracle/events-venues-drop.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/events/sql/oracle/events-venues-drop.sql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/events/sql/oracle/events-venues-drop.sql 9 Mar 2003 12:07:17 -0000 1.1 @@ -0,0 +1,23 @@ +-- +-- The Events Package +-- +-- @author Michael Steigman (michael@steigman.net) +-- @version $Id: events-venues-drop.sql,v 1.1 2003/03/09 12:07:17 lars Exp $ +-- +-- This package was orinally written by Bryan Che and Philip Greenspun +-- +-- GNU GPL v2 +-- + +drop table events_venues cascade constraints; +delete from acs_objects where object_type = 'events_venue'; + +declare +begin + + acs_object_type.drop_type ( + object_type => 'events_venue' + ); +end; +/ +show errors; \ No newline at end of file Index: openacs-4/contrib/packages/events/sql/oracle/events-venues-hc-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/events/sql/oracle/events-venues-hc-create.sql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/events/sql/oracle/events-venues-hc-create.sql 9 Mar 2003 12:07:17 -0000 1.1 @@ -0,0 +1,56 @@ +-- +-- The Events Package +-- +-- @author Brad Duell (bduell@ncacasi.org) +-- @version $Id: events-venues-hc-create.sql,v 1.1 2003/03/09 12:07:17 lars Exp $ +-- +-- GNU GPL v2 +-- + +-- allow venue hierarchy +create table events_venues_venues_map ( + parent_venue_id integer not null, + child_venue_id integer not null, + package_id integer + constraint events_v_v_pkg_id_fk + references apm_packages + on delete cascade, + constraint events_v_v_pk + primary key(parent_venue_id, child_venue_id, package_id), + constraint events_v_v_pv_id_fk foreign key(parent_venue_id) + references events_venues(venue_id), + constraint events_v_v_cv_id_fk foreign key(child_venue_id) + references events_venues(venue_id)); + +-- allow venue connections +create table events_venues_connecting_map ( + left_venue_id integer not null, + right_venue_id integer not null, + package_id integer + constraint events_v_c_pkg_id_fk + references apm_packages + on delete cascade, + constraint events_v_c_pk + primary key(left_venue_id, right_venue_id, package_id), + constraint events_v_c_lv_id_fk foreign key(left_venue_id) + references events_venues(venue_id), + constraint events_v_c_rv_id_fk foreign key(right_venue_id) + references events_venues(venue_id)); + +-- use-case mapping between venue connections +create table events_venues_conn_used_map ( + event_id integer not null, + venue_id integer not null, + connected_venue_id integer not null, + package_id integer + constraint events_v_cu_pkg_id_fk + references apm_packages + on delete cascade, + constraint events_v_cu_pk + primary key(event_id, venue_id, connected_venue_id, package_id), + constraint events_v_cu_v_id_fk foreign key(venue_id) + references events_venues(venue_id), + constraint events_v_cu_cv_id_fk foreign key(connected_venue_id) + references events_venues(venue_id), + constraint events_v_cu_e_id_fk foreign key(event_id) + references events_events(event_id)); \ No newline at end of file Index: openacs-4/contrib/packages/events/sql/oracle/events-venues-hc-drop.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/events/sql/oracle/events-venues-hc-drop.sql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/events/sql/oracle/events-venues-hc-drop.sql 9 Mar 2003 12:07:17 -0000 1.1 @@ -0,0 +1,12 @@ +-- +-- The Events Package +-- +-- @author Brad Duell (bduell@ncacasi.org) +-- @version $Id: events-venues-hc-drop.sql,v 1.1 2003/03/09 12:07:17 lars Exp $ +-- +-- GNU GPL v2 +-- + +drop table events_venues_conn_used_map; +drop table events_venues_connecting_map; +drop table events_venues_venues_map; \ No newline at end of file Index: openacs-4/contrib/packages/events/sql/oracle/events-venues-package-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/events/sql/oracle/events-venues-package-create.sql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/events/sql/oracle/events-venues-package-create.sql 9 Mar 2003 12:07:17 -0000 1.1 @@ -0,0 +1,89 @@ +-- +-- The Events Package +-- +-- @author Michael Steigman (michael@steigman.net) +-- @version $Id: events-venues-package-create.sql,v 1.1 2003/03/09 12:07:17 lars Exp $ +-- +-- This package was orinally written by Bryan Che and Philip Greenspun +-- +-- GNU GPL v2 +-- + + +-- The Venue Package + +create or replace package events_venue +as + function new ( + venue_id in events_venues.venue_id%TYPE default null, + package_id in events_venues.package_id%TYPE default null, + venue_name in events_venues.venue_name%TYPE, + address1 in events_venues.address1%TYPE default null, + address2 in events_venues.address2%TYPE default null, + city in events_venues.city%TYPE, + usps_abbrev in events_venues.usps_abbrev%TYPE default null, + postal_code in events_venues.postal_code%TYPE default null, + time_zone in events_venues.time_zone%TYPE default null, + iso in events_venues.iso%TYPE default null, + phone_number in events_venues.phone_number%TYPE default null, + fax_number in events_venues.fax_number%TYPE default null, + email in events_venues.email%TYPE default null, + needs_reserve_p in events_venues.needs_reserve_p%TYPE default 'f', + max_people in events_venues.max_people%TYPE default null, + description in events_venues.description%TYPE default null + ) return events_venues.venue_id%TYPE; + + procedure del ( + venue_id in events_venues.venue_id%TYPE + ); + +end events_venue; +/ +show errors; + +create or replace package body events_venue +as + function new ( + venue_id in events_venues.venue_id%TYPE default null, + package_id in events_venues.package_id%TYPE default null, + venue_name in events_venues.venue_name%TYPE, + address1 in events_venues.address1%TYPE default null, + address2 in events_venues.address2%TYPE default null, + city in events_venues.city%TYPE, + usps_abbrev in events_venues.usps_abbrev%TYPE default null, + postal_code in events_venues.postal_code%TYPE default null, + time_zone in events_venues.time_zone%TYPE default null, + iso in events_venues.iso%TYPE default null, + phone_number in events_venues.phone_number%TYPE default null, + fax_number in events_venues.fax_number%TYPE default null, + email in events_venues.email%TYPE default null, + needs_reserve_p in events_venues.needs_reserve_p%TYPE default 'f', + max_people in events_venues.max_people%TYPE default null, + description in events_venues.description%TYPE default null + ) return events_venues.venue_id%TYPE + is + v_venue_id events_venues.venue_id%TYPE; + begin + + insert into events_venues + (venue_id, venue_name, address1, address2, city, usps_abbrev, postal_code, iso, phone_number, + time_zone, fax_number, email, needs_reserve_p, max_people, description, package_id) + values + (venue_id, venue_name, address1, address2, city, usps_abbrev, postal_code, iso, phone_number, + time_zone, fax_number, email, needs_reserve_p, max_people, description, package_id); + + return v_venue_id; + end new; + + procedure del ( + venue_id in events_venues.venue_id%TYPE + ) + is + begin + delete from events_venues where venue_id = del.venue_id; + acs_object.delete(del.venue_id); + end del; + +end events_venue; +/ +show errors; Index: openacs-4/contrib/packages/events/sql/oracle/events-venues-package-drop.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/events/sql/oracle/events-venues-package-drop.sql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/events/sql/oracle/events-venues-package-drop.sql 9 Mar 2003 12:07:17 -0000 1.1 @@ -0,0 +1,12 @@ +-- +-- The Events Package +-- +-- @author Michael Steigman (michael@steigman.net) +-- @version $Id: events-venues-package-drop.sql,v 1.1 2003/03/09 12:07:17 lars Exp $ +-- +-- This package was orinally written by Bryan Che and Phillip Greenspun +-- +-- GNU GPL v2 +-- + +drop package events_venue; Index: openacs-4/contrib/packages/events/sql/postgresql/events-activities-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/events/sql/postgresql/events-activities-create.sql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/events/sql/postgresql/events-activities-create.sql 9 Mar 2003 12:07:30 -0000 1.1 @@ -0,0 +1,112 @@ +-- +-- The Events Package +-- +-- @author Michael Steigman (michael@steigman.net) +-- @version $Id: events-activities-create.sql,v 1.1 2003/03/09 12:07:30 lars Exp $ +-- +-- This package was originally written by Bryan Che and Philip Greenspun +-- +-- GNU GPL v2 +-- + +-- Activity Object Type + +create function inline_0 () +returns integer as ' +begin + PERFORM acs_object_type__create_type ( + ''events_activity'', -- object_type + ''Event Activity'', -- pretty_name + ''Event Activities'', -- pretty_plural + ''acs_activity'', -- supertype + ''events_activities'', -- table_name + ''activity_id'', -- id_column + null, -- package_name + ''f'', -- abstract_p + null, -- type_extensions_table + ''events_activity.name'' -- name_method + ); + + return 0; +end;' language 'plpgsql'; + +select inline_0 (); + +drop function inline_0 (); + + + +create function inline_1 () +returns integer as ' +begin + PERFORM acs_attribute__create_attribute ( + ''events_activity'', -- object_type + ''description'', -- attribute_name + ''string'', -- datatype + ''Description'', -- pretty_name + ''Descriptions'', -- pretty_plural + null, -- table_name + null, -- column_name + null, -- default_value + 1, -- min_n_values + 1, -- max_n_values + null, -- sort_order + ''type_specific'', -- storage + ''f'' -- static_p + ); + + PERFORM acs_attribute__create_attribute ( + ''events_activity'', -- object_type + ''detail_url'', -- attribute_name + ''string'', -- datatype + ''Detail URL'', -- pretty_name + ''Detail URLs'', -- pretty_plural + null, -- table_name + null, -- column_name + null, -- default_value + 1, -- min_n_values + 1, -- max_n_values + null, -- sort_order + ''type_specific'', -- storage + ''f'' -- static_p + ); + + return 0; +end;' language 'plpgsql'; + +select inline_1 (); + +drop function inline_1 (); + + + +-- Each activity has the super_type of ACS_ACTIVITY +-- Table events_activities supplies additional information +create table events_activities ( + activity_id integer + constraint events_activity_id_fk + references acs_activities + constraint events_activity_id_pk + primary key, + -- FIXME: (from old package) activities are owned by user groups + -- use map function in acs_activity? why? + -- + -- keep track of event package instances in this table + package_id integer + constraint events_activities_pkg_id_fk + references apm_packages(package_id) + on delete cascade, + default_price numeric default 0 not null, + currency char(3) default 'USD', + -- Is this activity occurring? If not, we can't assign + -- any new events to it. + available_p boolean default 't', + deleted_p boolean default 'f', + -- URL for more details + detail_url varchar(256), + default_contact_user_id integer references users +); + +comment on table events_activities is ' + Table events_activities supplies additional information for events_activities type. +'; Index: openacs-4/contrib/packages/events/sql/postgresql/events-activities-drop.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/events/sql/postgresql/events-activities-drop.sql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/events/sql/postgresql/events-activities-drop.sql 9 Mar 2003 12:07:30 -0000 1.1 @@ -0,0 +1,18 @@ +-- +-- The Events Package +-- +-- @author Michael Steigman (michael@steigman.net) +-- @version $Id: events-activities-drop.sql,v 1.1 2003/03/09 12:07:30 lars Exp $ +-- +-- This package was orinally written by Bryan Che and Phillip Greenspun +-- +-- GNU GPL v2 +-- + +drop table events_activities; +delete from acs_objects where object_type = 'events_activity'; + +select acs_object_type__drop_type( + 'events_activity', + 't' + ); Index: openacs-4/contrib/packages/events/sql/postgresql/events-activities-package-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/events/sql/postgresql/events-activities-package-create.sql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/events/sql/postgresql/events-activities-package-create.sql 9 Mar 2003 12:07:30 -0000 1.1 @@ -0,0 +1,113 @@ +-- +-- The Events Package +-- +-- @author Michael Steigman (michael@steigman.net) +-- @version $Id: events-activities-package-create.sql,v 1.1 2003/03/09 12:07:30 lars Exp $ +-- +-- This package was orinally written by Bryan Che and Philip Greenspun +-- +-- GNU GPL v2 +-- + + +-- The Activity Package + +select define_function_args('events_activity__new','activity_id,package_id,detail_url,default_contact_user_id,name,description,html_p;f,status_summary,object_type;events_activity,creation_date,creation_user,creation_ip,context_id'); + +create function events_activity__new (integer,integer,varchar,integer,varchar,varchar,boolean,varchar,varchar,timestamp,integer,varchar,integer) +returns integer as ' +declare + p_activity_id alias for $1; -- default null + p_package_id alias for $2; + p_detail_url alias for $3; -- default null + p_default_contact_user_id alias for $4; + p_name alias for $5; -- default null + p_description alias for $6; -- default null + p_html_p alias for $7; -- default ''f'' + p_status_summary alias for $8; -- default null + p_object_type alias for $9; -- default ''events_activity'' + p_creation_date alias for $10; -- default now() + p_creation_user alias for $11; + p_creation_ip alias for $12; + p_context_id alias for $13; -- default null + v_activity_id integer; +begin + v_activity_id := acs_activity__new ( + p_activity_id, + p_name, + p_description, + p_html_p, + p_status_summary, + p_object_type, + p_creation_date, + p_creation_user, + p_creation_ip, + coalesce(p_context_id, p_package_id) + ); + + insert into events_activities + (activity_id, package_id, detail_url, default_contact_user_id) + values + (v_activity_id, p_package_id, p_detail_url, p_default_contact_user_id); + + + return v_activity_id; + +end;' language 'plpgsql'; + + + +select define_function_args('events_activity__name','activity_id'); + +create function events_activity__name(integer) +returns varchar as ' +declare + p_activity_id alias for $1; +begin + return name from acs_activities where activity_id = p_activity_id; +end; +' language 'plpgsql'; + + + +select define_function_args('events_activity__delete','activity_id'); + +create function events_activity__delete (integer) +returns integer as ' +declare + p_activity_id alias for $1; +begin + cursor v_activity_events is + select event_id as v_event_id from acs_events + where activity_id = p_activity_id; + begin + -- find and delete event instances + for row in v_activity_events loop + events_event__delete(v_event_id); + end loop; + delete from events_def_actvty_attr_map where activity_id = p_activity_id; + delete from events_org_role_activity_map where activity_id = p_activity_id; + delete from events_activities where activity_id = p_activity_id; + + raise NOTICE ''Deleting note...''; + PERFORM acs_object__delete(p_activity_id); + + return 0; + +end;' language 'plpgsql'; + + + + + + + + + + + + + + + + Index: openacs-4/contrib/packages/events/sql/postgresql/events-activities-package-drop.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/events/sql/postgresql/events-activities-package-drop.sql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/events/sql/postgresql/events-activities-package-drop.sql 9 Mar 2003 12:07:30 -0000 1.1 @@ -0,0 +1,14 @@ +-- +-- The Events Package +-- +-- @author Michael Steigman (michael@steigman.net) +-- @version $Id: events-activities-package-drop.sql,v 1.1 2003/03/09 12:07:30 lars Exp $ +-- +-- This package was orinally written by Bryan Che and Phillip Greenspun +-- +-- GNU GPL v2 +-- + +drop function events_activity__new (integer,integer,varchar,integer,varchar,varchar,boolean,varchar,varchar,timestamp,integer,varchar,integer); +drop function events_activity__name(integer); +drop function events_activity__delete (integer); Index: openacs-4/contrib/packages/events/sql/postgresql/events-attributes-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/events/sql/postgresql/events-attributes-create.sql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/events/sql/postgresql/events-attributes-create.sql 9 Mar 2003 12:07:30 -0000 1.1 @@ -0,0 +1,77 @@ +-- +-- The Events Package +-- +-- @author Michael Steigman (michael@steigman.net) +-- @version $Id: events-attributes-create.sql,v 1.1 2003/03/09 12:07:30 lars Exp $ +-- +-- This package was originally written by Bryan Che and Philip Greenspun +-- +-- GNU GPL v2 +-- + +-- Each event can have custom fields registrants should enter. To +-- accomplish this, we use the acs_attribute system, adding attributes +-- to the events_registration object and keeping a mapping of attribute to +-- each event/activity. + +create table events_event_attr_map ( + event_id integer + constraint evnts_evnt_attr_map_evnt_id_fk + references events_events, + attribute_id integer + constraint evnts_evnt_attr_map_attr_id_fk + references acs_attributes, + constraint event_attr_map_pk + primary key(event_id, attribute_id) +); + +create index evnts_attr_map_event_id_idx on events_event_attr_map (event_id); + +create table events_def_actvty_attr_map ( + activity_id integer + constraint evnts_act_attr_map_act_id_fk + references events_activities, + attribute_id integer + constraint evnts_act_attr_map_attr_id_fk + references acs_attributes, + constraint events_activity_attr_map_pk + primary key(activity_id, attribute_id) +); + +create index evnts_act_attr_map_act_id_idx on events_def_actvty_attr_map (activity_id); + +create sequence events_attr_cat_seq start 1; +create table events_attr_categories ( + category_id integer + constraint events_attr_categories_pk + primary key, + category_name varchar(100) +); + +create table events_attr_category_map ( + attribute_id integer + constraint events_attr_cat_map_attr_id_fk + references acs_attributes, + category_id integer + constraint events_attr_cat_map_cat_id_fk + references events_attr_categories, + constraint events_attr_category_map_pk + primary key(attribute_id, category_id) +); + +create index evnts_attr_cat_map_attr_id_idx on events_attr_category_map (attribute_id); + +insert into events_attr_categories +(category_id, category_name) +values +(nextval('events_attr_cat_seq'), 'Personal'); + +insert into events_attr_categories +(category_id, category_name) +values +(nextval('events_attr_cat_seq'), 'Professional'); + +insert into events_attr_categories +(category_id, category_name) +values +(nextval('events_attr_cat_seq'), 'Travel\Accomodations'); Index: openacs-4/contrib/packages/events/sql/postgresql/events-attributes-drop.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/events/sql/postgresql/events-attributes-drop.sql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/events/sql/postgresql/events-attributes-drop.sql 9 Mar 2003 12:07:30 -0000 1.1 @@ -0,0 +1,17 @@ +-- +-- The Events Package +-- +-- @author Michael Steigman (michael@steigman.net) +-- @version $Id: events-attributes-drop.sql,v 1.1 2003/03/09 12:07:30 lars Exp $ +-- +-- This package was originally written by Bryan Che and Philip Greenspun +-- +-- GNU GPL v2 +-- + +drop sequence events_attr_cat_seq; +drop table events_attr_category_map; +drop table events_attr_categories; +drop table events_def_actvty_attr_map; +drop table events_event_attr_map; + Index: openacs-4/contrib/packages/events/sql/postgresql/events-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/events/sql/postgresql/events-create.sql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/events/sql/postgresql/events-create.sql 9 Mar 2003 12:07:30 -0000 1.1 @@ -0,0 +1,43 @@ +-- +-- The Events Package +-- +-- @author Michael Steigman (michael@steigman.net) +-- @version $Id: events-create.sql,v 1.1 2003/03/09 12:07:30 lars Exp $ +-- +-- This package was originally written by Bryan Che and Philip Greenspun +-- +-- GNU GPL v2 +-- + +-- event venues +\i events-venues-create.sql +\i events-venues-package-create.sql + +-- events and activities +\i events-events-create.sql +\i events-activities-create.sql +\i events-activities-package-create.sql + +-- venue hierarchy and connections +\i events-venues-hc-create.sql + +-- event prices +\i events-prices-create.sql + +-- event registrations and orders +\i events-orders-create.sql +\i events-orders-package-create.sql +\i events-registrations-create.sql +\i events-registrations-package-create.sql + +-- custom fields +\i events-attributes-create.sql + +-- events package (references custom fields) +\i events-events-package-create.sql + +-- event organizers +\i events-organizers-create.sql + +-- events permissions +\i events-permissions-create.sql Index: openacs-4/contrib/packages/events/sql/postgresql/events-drop.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/events/sql/postgresql/events-drop.sql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/events/sql/postgresql/events-drop.sql 9 Mar 2003 12:07:30 -0000 1.1 @@ -0,0 +1,41 @@ +-- +-- The Events Package +-- +-- @author Michael Steigman (michael@steigman.net) +-- @version $Id: events-drop.sql,v 1.1 2003/03/09 12:07:30 lars Exp $ +-- +-- This package was originally written by Bryan Che and Phillip Greenspun +-- +-- GNU GPL v2 +-- + +-- event organizers +\i events-organizers-drop.sql + +-- custom fields +\i events-attributes-drop.sql + +-- venue hierarchy and connections +\i events-venues-hc-drop.sql + +-- events and activities +\i events-events-drop.sql +\i events-events-package-drop.sql +\i events-activities-drop.sql +\i events-activities-package-drop.sql + +-- event registrations and orders +\i events-registrations-drop.sql +\i events-registrations-package-drop.sql +\i events-orders-drop.sql +\i events-orders-package-drop.sql + +-- event prices +\i events-prices-drop.sql + +-- event venues +\i events-venues-drop.sql +\i events-venues-package-drop.sql + +-- events permissions +\i events-permissions-drop.sql Index: openacs-4/contrib/packages/events/sql/postgresql/events-events-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/events/sql/postgresql/events-events-create.sql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/events/sql/postgresql/events-events-create.sql 9 Mar 2003 12:07:30 -0000 1.1 @@ -0,0 +1,222 @@ +-- +-- The Events Package +-- +-- @author Michael Steigman (michael@steigman.net) +-- @version $Id: events-events-create.sql,v 1.1 2003/03/09 12:07:30 lars Exp $ +-- +-- This package was originally written by Bryan Che and Philip Greenspun +-- +-- GNU GPL v2 +-- + +-- +-- Event Object Type +-- + +create function inline_0 () +returns integer as ' +begin + PERFORM acs_object_type__create_type ( + ''events_event'', -- object_type + ''Event'', -- pretty_name + ''Events'', -- pretty_plural + ''acs_event'', -- supertype + ''events_events'', -- table_name + ''event_id'', -- id_column + null, -- package_name + ''f'', -- abstract_p + null, -- type_extensions_table + ''events_event.name'' -- name_method + ); + + return 0; +end;' language 'plpgsql'; + +select inline_0 (); + +drop function inline_0 (); + + + + + + + + +create function inline_1 () +returns integer as ' +begin + PERFORM acs_attribute__create_attribute ( + ''events_event'', -- object_type + ''max_people'', -- attribute_name + ''string'', -- datatype + ''Max People'', -- pretty_name + ''Max People'', -- pretty_plural + null, -- table_name + null, -- column_name + null, -- default_value + 1, -- min_n_values + 1, -- max_n_values + null, -- sort_order + ''type_specific'', -- storage + ''f'' -- static_p + ); + + PERFORM acs_attribute__create_attribute ( + ''events_event'', -- object_type + ''reg_deadline'', -- attribute_name + ''string'', -- datatype + ''Registration Deadline'', -- pretty_name + ''Registrations Deadlines'', -- pretty_plural + null, -- table_name + null, -- column_name + null, -- default_value + 1, -- min_n_values + 1, -- max_n_values + null, -- sort_order + ''type_specific'', -- storage + ''f'' -- static_p + ); + + PERFORM acs_attribute__create_attribute ( + ''events_event'', -- object_type + ''available_p'', -- attribute_name + ''string'', -- datatype + ''Available?'', -- pretty_name + ''Available?'', -- pretty_plural + null, -- table_name + null, -- column_name + null, -- default_value + 1, -- min_n_values + 1, -- max_n_values + null, -- sort_order + ''type_specific'', -- storage + ''f'' -- static_p + ); + + PERFORM acs_attribute__create_attribute ( + ''events_event'', -- object_type + ''display_after'', -- attribute_name + ''string'', -- datatype + ''Display After'', -- pretty_name + ''Display After'', -- pretty_plural + null, -- table_name + null, -- column_name + null, -- default_value + 1, -- min_n_values + 1, -- max_n_values + null, -- sort_order + ''type_specific'', -- storage + ''f'' -- static_p + ); + + PERFORM acs_attribute__create_attribute ( + ''events_event'', -- object_type + ''av_note'', -- attribute_name + ''string'', -- datatype + ''Audio/Visual Note'', -- pretty_name + ''Audio/Visual Notes'', -- pretty_plural + null, -- table_name + null, -- column_name + null, -- default_value + 1, -- min_n_values + 1, -- max_n_values + null, -- sort_order + ''type_specific'', -- storage + ''f'' -- static_p + ); + + PERFORM acs_attribute__create_attribute ( + ''events_event'', -- object_type + ''refreshements_note'', -- attribute_name + ''string'', -- datatype + ''Refreshment Note'', -- pretty_name + ''Refreshment Notes'', -- pretty_plural + null, -- table_name + null, -- column_name + null, -- default_value + 1, -- min_n_values + 1, -- max_n_values + null, -- sort_order + ''type_specific'', -- storage + ''f'' -- static_p + ); + + PERFORM acs_attribute__create_attribute ( + ''events_event'', -- object_type + ''additional_note'', -- attribute_name + ''string'', -- datatype + ''Additional Note'', -- pretty_name + ''Additional Notes'', -- pretty_plural + null, -- table_name + null, -- column_name + null, -- default_value + 1, -- min_n_values + 1, -- max_n_values + null, -- sort_order + ''type_specific'', -- storage + ''f'' -- static_p + ); + + return 0; +end;' language 'plpgsql'; + +select inline_1 (); + +drop function inline_1 (); + + + + + + + + + + + + + +-- Each event has the super_type of ACS_EVENTS +-- Table events_events supplies additional information +create table events_events ( + event_id integer + constraint events_event_id_fk + references acs_events + constraint events_event_id_pk + primary key, + venue_id integer + constraint events_venue_id_fk + references events_venues, + display_after varchar(4000), + max_people integer, + contact_user_id integer + constraint events_cntct_usr_id_fk + references users, + reg_deadline timestamp not null, + available_p boolean default 't', + deleted_p boolean default 'f', + reg_cancellable_p boolean default 't', + reg_needs_approval_p boolean default 'f', + av_note varchar(4000), + refreshments_note varchar(4000), + additional_note varchar(4000), + alternative_reg varchar(4000), + bulk_mail_id integer + constraint bulk_mail_id_fk + references bulk_mail_messages +); + +comment on table events_events is ' + Table events_events supplies additional information for events_event type. +'; + +comment on column events_events.event_id is ' + Primary Key +'; + +comment on column events_events.display_after is ' + This field contains text that will be displayed to user + after registering for an event. +'; + Index: openacs-4/contrib/packages/events/sql/postgresql/events-events-drop.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/events/sql/postgresql/events-events-drop.sql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/events/sql/postgresql/events-events-drop.sql 9 Mar 2003 12:07:30 -0000 1.1 @@ -0,0 +1,34 @@ +-- +-- The Events Package +-- +-- @author Michael Steigman (michael@steigman.net) +-- @version $Id: events-events-drop.sql,v 1.1 2003/03/09 12:07:30 lars Exp $ +-- +-- This package was originally written by Bryan Che and Philip Greenspun +-- +-- GNU GPL v2 +-- + +create function inline_0 () +returns integer as ' +declare + event_rec record; +begin + for event_rec in select event_id from events_events + loop + delete from events_events where event_id = event_rec.event_id; + delete from acs_events where event_id = event_rec.event_id; + delete from acs_objects where object_id = event_rec.event_id; + end loop; + return 0; +end;' language 'plpgsql'; + +select inline_0(); +drop function inline_0(); + +drop table events_events; + +select acs_object_type__drop_type( + 'events_event', + 't' + ); Index: openacs-4/contrib/packages/events/sql/postgresql/events-events-package-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/events/sql/postgresql/events-events-package-create.sql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/events/sql/postgresql/events-events-package-create.sql 9 Mar 2003 12:07:30 -0000 1.1 @@ -0,0 +1,111 @@ +-- +-- The Events Package +-- +-- @author Michael Steigman (michael@steigman.net) +-- @version $Id: events-events-package-create.sql,v 1.1 2003/03/09 12:07:30 lars Exp $ +-- +-- This package was orinally written by Bryan Che and Philip Greenspun +-- +-- GNU GPL v2 +-- +-- +-- +-- -- The Event Package +-- + +select define_function_args('events_event__new','event_id,venue_id,display_after,max_people,reg_deadline,available_p;t,deleted_p;f,reg_cancellable_p,reg_needs_approval_p,refreshments_note,av_note,additional_note,alternative_reg,activity_id'); + +create function events_event__new (integer,integer,varchar,integer,timestamp,boolean,boolean,boolean,boolean,integer,varchar,varchar,varchar,varchar,integer) +returns integer as ' +declare + p_event_id alias for $1; -- default null + p_venue_id alias for $2; + p_display_after alias for $3; -- default null + p_max_people alias for $4; -- default null + p_reg_deadline alias for $5; + p_available_p alias for $6; -- default ''t'' + p_deleted_p alias for $7; -- default ''f'' + p_reg_cancellable_p alias for $8; + p_reg_needs_approval_p alias for $9; + p_contact_user_id alias for $10; + p_refreshments_note alias for $11; -- default null + p_av_note alias for $12; -- default null + p_additional_note alias for $13; -- null + p_alternative_reg alias for $14; -- null + p_activity_id alias for $15; + v_activity_attrs record; + v_activity_org_roles record; +begin + + + insert into events_events + (event_id, contact_user_id, venue_id, display_after, max_people, reg_deadline, available_p, deleted_p, reg_cancellable_p, reg_needs_approval_p, refreshments_note, av_note, additional_note, alternative_reg) + values + (p_event_id, p_contact_user_id, p_venue_id, p_display_after, p_max_people, p_reg_deadline::timestamp, p_available_p, p_deleted_p, p_reg_cancellable_p, p_reg_needs_approval_p, p_refreshments_note, p_av_note, p_additional_note, p_alternative_reg); + + for v_activity_attrs in select + attribute_id as v_attribute_id + from events_def_actvty_attr_map edaam + where edaam.activity_id = p_activity_id + LOOP + -- copy over pointers to custom fields (registration attributes) + insert into events_event_attr_map + (event_id, attribute_id) + values + (p_event_id, v_activity_attrs.v_attribute_id); + end loop; + + + + for v_activity_org_roles in select + role_id as v_role_id + from events_org_role_activity_map eoram + where eoram.activity_id = p_activity_id + LOOP + -- copy over pointers to custom fields (registration attributes) + insert into events_org_role_event_map + (event_id, role_id) + values + (p_event_id, v_activity_org_roles.v_role_id); + end loop; + + + return p_event_id; + +end;' language 'plpgsql'; + + +select define_function_args('events_event__name','event_id'); + +create function events_event__name(integer) +returns varchar as ' +declare + p_event_id alias for $1; +begin + return aa.name from acs_activities aa, acs_events ae where + aa.activity_id = ae.activity_id + and ae.event_id = p_event_id; +end; +' language 'plpgsql'; + + + + +select define_function_args('events_event__delete','event_id'); + +create function events_event__delete (integer) +returns integer as ' +declare + p_event_id alias for $1; +begin + delete from events_org_role_event_map where event_id = del.event_id; + delete from events_event_attr_map where event_id = del.event_id; + delete from events_events where event_id = del.event_id; + + raise NOTICE ''Deleting note...''; + PERFORM acs_object__delete(p_event_id); + + return 0; + +end;' language 'plpgsql'; + Index: openacs-4/contrib/packages/events/sql/postgresql/events-events-package-drop.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/events/sql/postgresql/events-events-package-drop.sql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/events/sql/postgresql/events-events-package-drop.sql 9 Mar 2003 12:07:30 -0000 1.1 @@ -0,0 +1,14 @@ +-- +-- The Events Package +-- +-- @author Michael Steigman (michael@steigman.net) +-- @version $Id: events-events-package-drop.sql,v 1.1 2003/03/09 12:07:30 lars Exp $ +-- +-- This package was orinally written by Bryan Che and Phillip Greenspun +-- +-- GNU GPL v2 +-- + +drop function events_event__delete (integer); +drop function events_event__name(integer); +drop function events_event__new (integer,integer,varchar,integer,timestamp,boolean,boolean,boolean,boolean,integer,varchar,varchar,varchar,varchar,integer); Index: openacs-4/contrib/packages/events/sql/postgresql/events-orders-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/events/sql/postgresql/events-orders-create.sql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/events/sql/postgresql/events-orders-create.sql 9 Mar 2003 12:07:30 -0000 1.1 @@ -0,0 +1,61 @@ +-- +-- The Events Package +-- +-- @author Michael Steigman (michael@steigman.net) +-- @version $Id: events-orders-create.sql,v 1.1 2003/03/09 12:07:30 lars Exp $ +-- +-- This package was originally written by Bryan Che and Philip Greenspun +-- +-- GNU GPL v2 +-- + +-- Order Object Type + + +create function inline_0 () +returns integer as ' +begin + PERFORM acs_object_type__create_type ( + ''events_order'', -- object_type + ''Order'', -- pretty_name + ''Orders'', -- pretty_plural + ''acs_object'', -- supertype + ''events_orders'', -- table_name + ''order_id'', -- id_column + null, -- package_name + ''f'', -- abstract_p + null, -- type_extensions_table + null -- name_method + ); + + return 0; +end;' language 'plpgsql'; + +select inline_0 (); + +drop function inline_0 (); + +-- Table to hold additional attributes +-- +-- THE ORACLE CODE DIDN'T SAY ORDER_ID WAS AN INTEGER???? is this okay???? Does it need to be added??? +-- +create table events_orders ( + order_id integer + constraint events_orders_order_id_fk + references acs_objects + constraint events_orders_order_id_pk + primary key, + -- ec_order_id integer references ec_orders, + -- the person who made the order + user_id integer + constraint events_orders_user_id_fk + references users, + paid_p boolean default null, + payment_method varchar(50), + confirmed_date timestamp, + price_charged numeric, + -- the date this registration was refunded, if it was refunded + refunded_date timestamp, + price_refunded numeric +); + Index: openacs-4/contrib/packages/events/sql/postgresql/events-orders-drop.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/events/sql/postgresql/events-orders-drop.sql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/events/sql/postgresql/events-orders-drop.sql 9 Mar 2003 12:07:30 -0000 1.1 @@ -0,0 +1,19 @@ +-- +-- The Events Package +-- +-- @author Michael Steigman (michael@steigman.net) +-- @version $Id: events-orders-drop.sql,v 1.1 2003/03/09 12:07:30 lars Exp $ +-- +-- This package was orinally written by Bryan Che and Philip Greenspun +-- +-- GNU GPL v2 +-- + +delete from acs_objects where object_type = 'events_order'; +select acs_object_type__drop_type( + 'events_order', + 't' + ); + + +drop table events_orders; Index: openacs-4/contrib/packages/events/sql/postgresql/events-orders-package-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/events/sql/postgresql/events-orders-package-create.sql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/events/sql/postgresql/events-orders-package-create.sql 9 Mar 2003 12:07:30 -0000 1.1 @@ -0,0 +1,82 @@ +-- +-- The Events Package +-- +-- @author Matthew Geddert (geddert@yahoo.com) +-- @version $Id: events-orders-package-create.sql,v 1.1 2003/03/09 12:07:30 lars Exp $ +-- +-- This package was originally written by Bryan Che and Philip Greenspun +-- +-- GNU GPL v2 +-- + +-- Order Package + +select define_function_args('events_order__new','order_id,event_id,user_id,creation_date,creation_user,creation_ip,context_id'); + +create function events_order__new (integer,integer,integer,timestamp,integer,varchar,integer) +returns integer as ' +declare + p_order_id alias for $1; -- default null + p_event_id alias for $2; + p_user_id alias for $3; + p_creation_date alias for $4; -- default now() + p_creation_user alias for $5; + p_creation_ip alias for $6; + p_context_id alias for $7; -- default null + v_order_id integer; +begin + v_order_id := acs_object__new ( + p_order_id, + ''events_order'', + p_creation_date, + p_creation_user, + p_creation_ip, + coalesce(p_context_id, p_event_id) + ); + + + insert into events_orders + (order_id, user_id) + values + (v_order_id, p_user_id); + + return v_order_id; + +end;' language 'plpgsql'; + + + + +-- select define_function_args('events_order__name','order_id'); +-- +-- create function events_order__name(integer) +-- returns varchar as ' +-- declare +-- p_order_id alias for $1; +-- begin +-- return p_order_id as event_order_name; +-- end; +-- ' language 'plpgsql'; +-- + + + + + +select define_function_args('events_order__delete','order_id'); + +create function events_order__delete (integer) +returns integer as ' +declare + p_order_id alias for $1; +begin + + delete from events_orders + where order_id = p_order_id; + + raise NOTICE ''Deleting note...''; + PERFORM acs_object__delete(p_order_id); + + return 0; + +end;' language 'plpgsql'; Index: openacs-4/contrib/packages/events/sql/postgresql/events-orders-package-drop.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/events/sql/postgresql/events-orders-package-drop.sql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/events/sql/postgresql/events-orders-package-drop.sql 9 Mar 2003 12:07:30 -0000 1.1 @@ -0,0 +1,14 @@ +-- +-- The Events Package +-- +-- @author Michael Steigman (michael@steigman.net) +-- @version $Id: events-orders-package-drop.sql,v 1.1 2003/03/09 12:07:30 lars Exp $ +-- +-- This package was orinally written by Bryan Che and Phillip Greenspun +-- +-- GNU GPL v2 +-- + +drop function events_order__new (integer,integer,integer,timestamp,integer,varchar,integer); +-- drop function events_order__name (integer); +drop function events_order__delete (integer); Index: openacs-4/contrib/packages/events/sql/postgresql/events-organizers-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/events/sql/postgresql/events-organizers-create.sql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/events/sql/postgresql/events-organizers-create.sql 9 Mar 2003 12:07:30 -0000 1.1 @@ -0,0 +1,89 @@ +-- +-- The Events Package +-- +-- @author Michael Steigman (michael@steigman.net) +-- @version $Id: events-organizers-create.sql,v 1.1 2003/03/09 12:07:30 lars Exp $ +-- +-- This package was originally written by Bryan Che and Philip Greenspun +-- +-- GNU GPL v2 +-- + +-- Organizer roles for activities and events + +create sequence events_org_roles_seq start 1; +create table events_organizer_roles ( + role_id integer + constraint evnts_org_roles_role_id_pk + primary key, + role varchar(200) + constraint evnts_org_roles_role_nn + not null, + responsibilities text, + -- is this a role that we want event registrants to see? + public_role_p boolean default 'f', + package_id integer + constraint evnts_org_roles_pkg_id_fk + references apm_packages + on delete cascade +); + +create table events_org_role_activity_map ( + role_id integer + constraint evnts_org_role_am_role_id_fk + references events_organizer_roles, + activity_id integer + constraint evnts_org_role_act_id_fk + references events_activities +); + +create table events_org_role_event_map ( + role_id integer + constraint evnts_org_role_em_role_id_fk + references events_organizer_roles, + event_id integer + constraint evnts_org_role_evnt_id_fk + references events_events +); + +create table events_organizers_map ( + user_id integer + constraint evnt_org_map_user_id_nn + not null + constraint evnt_org_map_user_id_fk + references users, + role_id integer + constraint evnt_org_map_role_id_nn + not null + constraint evnt_org_map_role_id_fk + references events_organizer_roles, + event_id integer + constraint evnt_org_map_evnt_id_nn + not null + constraint evnt_org_map_evnt_id_fk + references events_events, + + constraint events_org_map_pk unique (user_id, role_id, event_id) +); + +-- create a view to see event organizer roles and the people in those roles + + + +create view events_organizers +as +select eor.*, eom.user_id, eom.event_id + from events_organizer_roles eor, + events_org_role_event_map eorem left join events_organizers_map eom on (eorem.role_id = eom.role_id) + where eor.role_id = eorem.role_id; + +-- this is the old view +-- +--create view events_organizers +--as +--select eor.*, eom.user_id, eom.event_id +-- from events_organizer_roles eor, +-- events_organizers_map eom +-- where eor.role_id = eom.role_id; + + Index: openacs-4/contrib/packages/events/sql/postgresql/events-organizers-drop.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/events/sql/postgresql/events-organizers-drop.sql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/events/sql/postgresql/events-organizers-drop.sql 9 Mar 2003 12:07:30 -0000 1.1 @@ -0,0 +1,19 @@ +-- +-- The Events Package +-- +-- @author Michael Steigman (michael@steigman.net) +-- @version $Id: events-organizers-drop.sql,v 1.1 2003/03/09 12:07:30 lars Exp $ +-- +-- This package was orinally written by Bryan Che and Phillip Greenspun +-- +-- GNU GPL v2 +-- + + +drop view events_organizers; +drop sequence events_org_roles_seq; +drop table events_org_role_event_map; +drop table events_org_role_activity_map; +drop table events_organizer_roles; +drop table events_organizers_map; + Index: openacs-4/contrib/packages/events/sql/postgresql/events-permissions-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/events/sql/postgresql/Attic/events-permissions-create.sql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/events/sql/postgresql/events-permissions-create.sql 9 Mar 2003 12:07:30 -0000 1.1 @@ -0,0 +1,52 @@ +-- +-- The Events Package +-- +-- @author Michael Steigman (michael@steigman.net) +-- @version $Id: events-permissions-create.sql,v 1.1 2003/03/09 12:07:30 lars Exp $ +-- +-- This package was originally written by Bryan Che and Philip Greenspun +-- +-- GNU GPL v2 +-- + +-- +-- Privileges +-- + +begin; + + select acs_privilege__create_privilege('events_event_create',null,null); + select acs_privilege__create_privilege('events_activity_create',null,null); + select acs_privilege__create_privilege('events_event_write',null,null); + select acs_privilege__create_privilege('events_activity_write',null,null); + select acs_privilege__create_privilege('events_event_delete',null,null); + select acs_privilege__create_privilege('events_activity_delete',null,null); + select acs_privilege__create_privilege('events_event_read',null,null); + select acs_privilege__create_privilege('events_activity_read',null,null); + + + -- temporarily drop this trigger to avoid a data-change violation + -- on acs_privilege_hierarchy_index while updating the child privileges. + +drop trigger acs_priv_hier_ins_del_tr on acs_privilege_hierarchy; + + select acs_privilege__add_child('create','events_event_create'); + select acs_privilege__add_child('create','events_activity_create'); + select acs_privilege__add_child('write','events_event_write'); + select acs_privilege__add_child('write','events_activity_write'); + select acs_privilege__add_child('delete','events_event_delete'); + select acs_privilege__add_child('delete','events_activity_delete'); + + -- re-enable the trigger before the last insert to force the + -- acs_privilege_hierarchy_index table to be updated. + + create trigger acs_priv_hier_ins_del_tr after insert or delete + on acs_privilege_hierarchy for each row + execute procedure acs_priv_hier_ins_del_tr (); + +select acs_privilege__add_child('read','events_activity_read'); +end; + + + + Index: openacs-4/contrib/packages/events/sql/postgresql/events-permissions-drop.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/events/sql/postgresql/Attic/events-permissions-drop.sql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/events/sql/postgresql/events-permissions-drop.sql 9 Mar 2003 12:07:30 -0000 1.1 @@ -0,0 +1,51 @@ +-- +-- The Events Package +-- +-- @author Michael Steigman (michael@steigman.net) +-- @version $Id: events-permissions-drop.sql,v 1.1 2003/03/09 12:07:30 lars Exp $ +-- +-- This package was originally written by Bryan Che and Philip Greenspun +-- +-- GNU GPL v2 +-- + +-- +-- Privileges +-- + +-- Drop permission metadata +delete from acs_permissions + where privilege in + ('events_event_create', 'events_activity_create', 'events_event_write', 'events_activity_write','events_event_delete', 'events_activity_delete', 'events_event_read', 'events_activity_read'); + +delete from acs_privilege_hierarchy + where privilege in + ('events_event_create', 'events_activity_create', 'events_event_write', 'events_activity_write','events_event_delete', 'events_activity_delete', 'events_event_read', 'events_activity_read'); + +delete from acs_privilege_hierarchy + where child_privilege in + ('events_event_create', 'events_activity_create', 'events_event_write', 'events_activity_write','events_event_delete', 'events_activity_delete', 'events_event_read', 'events_activity_read'); + +delete from acs_privileges + where privilege in + ('events_event_create', 'events_activity_create', 'events_event_write', 'events_activity_write','events_event_delete', 'events_activity_delete', 'events_event_read', 'events_activity_read'); + + + + + + + + + + + + + + + + + + + + Index: openacs-4/contrib/packages/events/sql/postgresql/events-prices-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/events/sql/postgresql/events-prices-create.sql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/events/sql/postgresql/events-prices-create.sql 9 Mar 2003 12:07:30 -0000 1.1 @@ -0,0 +1,39 @@ +-- +-- The Events Package +-- +-- @author Michael Steigman (michael@steigman.net) +-- @version $Id: events-prices-create.sql,v 1.1 2003/03/09 12:07:30 lars Exp $ +-- +-- This package was orinally written by Bryan Che and Philip Greenspun +-- +-- GNU GPL v2 +-- + +-- Not implemented yet + + +-- +-- IS THIS HOW TO CREATE A SEQUENCE ????? +-- +create sequence events_price_id_sequence; + +create table events_prices ( + price_id integer primary key, + event_id integer not null references events_events, + -- e.g., "Developer", "Student" + description varchar(100) not null, + -- we also store the price here too in case someone doesn't want + -- to use the ecommerce module but still wants to have prices + price numeric not null, + -- This is for hooking up to ecommerce. + -- Each product is a different price for this event. For example, + -- student price and normal price products for an event. +-- product_id integer references ec_products, + -- prices may be different for early, normal, late, on-site + -- admission, + -- depending on the date + expire_date timestamp not null, + available_date timestamp not null +); + +create index evnt_price_idx on events_prices(price_id, event_id); Index: openacs-4/contrib/packages/events/sql/postgresql/events-prices-drop.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/events/sql/postgresql/events-prices-drop.sql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/events/sql/postgresql/events-prices-drop.sql 9 Mar 2003 12:07:30 -0000 1.1 @@ -0,0 +1,18 @@ +-- +-- The Events Package +-- +-- @author Michael Steigman (michael@steigman.net) +-- @version $Id: events-prices-drop.sql,v 1.1 2003/03/09 12:07:30 lars Exp $ +-- +-- This package was orinally written by Bryan Che and Phillip Greenspun +-- +-- GNU GPL v2 +-- + + +-- +-- IS THIS HOW TO DROP A SEQUENCE???? +-- + +drop sequence events_price_id_sequence; +drop table events_prices; Index: openacs-4/contrib/packages/events/sql/postgresql/events-registrations-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/events/sql/postgresql/events-registrations-create.sql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/events/sql/postgresql/events-registrations-create.sql 9 Mar 2003 12:07:30 -0000 1.1 @@ -0,0 +1,350 @@ +-- +-- The Events Package +-- +-- @author Michael Steigman (michael@steigman.net) +-- @version $Id: events-registrations-create.sql,v 1.1 2003/03/09 12:07:30 lars Exp $ +-- +-- This package was orinally written by Bryan Che and Philip Greenspun +-- +-- GNU GPL v2 +-- + +-- +-- Registration Object Type +-- + +create function inline_0 () +returns integer as ' +begin + PERFORM acs_object_type__create_type ( + ''events_registration'', -- object_type + ''Registration'', -- pretty_name + ''Registrations'', -- pretty_plural + ''acs_object'', -- supertype + ''events_registrations'', -- table_name + ''reg_id'', -- id_column + null, -- package_name + ''f'', -- abstract_p + null, -- type_extensions_table + null -- name_method + ); + + return 0; +end;' language 'plpgsql'; + +select inline_0 (); + +drop function inline_0 (); + + + + + + + +-- create function inline_1 () +-- returns integer as ' +-- begin +-- +-- PERFORM acs_attribute__create_attribute ( +-- ''events_registration'', -- object_type +-- ''reg_state'', -- attribute_name +-- ''string'', -- datatype +-- ''Registration State'', -- pretty_name +-- ''Registration States'', -- pretty_plural +-- null, -- table_name +-- null, -- column_name +-- null, -- default_value +-- 1, -- min_n_values +-- 1, -- max_n_values +-- null, -- sort_order +-- ''type_specific'', -- storage +-- ''f'' -- static_p +-- ); +-- +-- PERFORM acs_attribute__create_attribute ( +-- ''events_registration'', -- object_type +-- ''shipped_date'', -- attribute_name +-- ''string'', -- datatype +-- ''Shipped Date'', -- pretty_name +-- ''Shipped Dates'', -- pretty_plural +-- null, -- table_name +-- null, -- column_name +-- null, -- default_value +-- 1, -- min_n_values +-- 1, -- max_n_values +-- null, -- sort_order +-- ''type_specific'', -- storage +-- ''f'' -- static_p +-- ); +-- +-- -- +-- -- create built-in user-visible registration attributes +-- +-- +-- PERFORM acs_attribute__create_attribute ( +-- ''events_registration'', -- object_type +-- ''org'', -- attribute_name +-- ''string'', -- datatype +-- ''Organization'', -- pretty_name +-- ''Organizations'', -- pretty_plural +-- null, -- table_name +-- null, -- column_name +-- null, -- default_value +-- 1, -- min_n_values +-- 1, -- max_n_values +-- ''1'', -- sort_order +-- ''type_specific'', -- storage +-- ''f'' -- static_p +-- ); +-- +-- PERFORM acs_attribute__create_attribute ( +-- ''events_registration'', -- object_type +-- ''title_at_org'', -- attribute_name +-- ''string'', -- datatype +-- ''Title'', -- pretty_name +-- ''Titles'', -- pretty_plural +-- null, -- table_name +-- null, -- column_name +-- null, -- default_value +-- 1, -- min_n_values +-- 1, -- max_n_values +-- ''2'', -- sort_order +-- ''type_specific'', -- storage +-- ''f'' -- static_p +-- ); +-- +-- PERFORM acs_attribute__create_attribute ( +-- ''events_registration'', -- object_type +-- ''attending_reason'', -- attribute_name +-- ''string'', -- datatype +-- ''Reason for attending'', -- pretty_name +-- ''Reasons for attending'', -- pretty_plural +-- null, -- table_name +-- null, -- column_name +-- null, -- default_value +-- 1, -- min_n_values +-- 1, -- max_n_values +-- ''3'', -- sort_order +-- ''type_specific'', -- storage +-- ''f'' -- static_p +-- ); +-- +-- PERFORM acs_attribute__create_attribute ( +-- ''events_registration'', -- object_type +-- ''where_hear'', -- attribute_name +-- ''string'', -- datatype +-- ''Where did you hear about this activity?'', -- pretty_name +-- ''Where did you hear about these activities'', -- pretty_plural +-- null, -- table_name +-- null, -- column_name +-- null, -- default_value +-- 1, -- min_n_values +-- 1, -- max_n_values +-- ''4'', -- sort_order +-- ''type_specific'', -- storage +-- ''f'' -- static_p +-- ); +-- +-- PERFORM acs_attribute__create_attribute ( +-- ''events_registration'', -- object_type +-- ''need_hotel_p'', -- attribute_name +-- ''boolean'', -- datatype +-- ''Do you need a hotel?'', -- pretty_name +-- ''Do you need a hotel?'', -- pretty_plural +-- null, -- table_name +-- null, -- column_name +-- null, -- default_value +-- 1, -- min_n_values +-- 1, -- max_n_values +-- ''5'', -- sort_order +-- ''type_specific'', -- storage +-- ''f'' -- static_p +-- ); +-- +-- PERFORM acs_attribute__create_attribute ( +-- ''events_registration'', -- object_type +-- ''need_car_p'', -- attribute_name +-- ''boolean'', -- datatype +-- ''Do you need a car?'', -- pretty_name +-- ''Do you need a car?'', -- pretty_plural +-- null, -- table_name +-- null, -- column_name +-- null, -- default_value +-- 1, -- min_n_values +-- 1, -- max_n_values +-- ''6'', -- sort_order +-- ''type_specific'', -- storage +-- ''f'' -- static_p +-- ); +-- +-- PERFORM acs_attribute__create_attribute ( +-- ''events_registration'', -- object_type +-- ''need_plane_p'', -- attribute_name +-- ''boolean'', -- datatype +-- ''Do you need a plane ticket?'', -- pretty_name +-- ''Do you need a plane ticket?'', -- pretty_plural +-- null, -- table_name +-- null, -- column_name +-- null, -- default_value +-- 1, -- min_n_values +-- 1, -- max_n_values +-- ''7'', -- sort_order +-- ''type_specific'', -- storage +-- ''f'' -- static_p +-- ); +-- +-- +-- -- no sort order - comments will always be last +-- +-- PERFORM acs_attribute__create_attribute ( +-- ''events_registration'', -- object_type +-- ''comments'', -- attribute_name +-- ''string'', -- datatype +-- ''Comments'', -- pretty_name +-- ''Comments'', -- pretty_plural +-- null, -- table_name +-- null, -- column_name +-- null, -- default_value +-- 1, -- min_n_values +-- 1, -- max_n_values +-- null, -- sort_order +-- ''type_specific'', -- storage +-- ''f'' -- static_p +-- ); +-- +-- return 0; +-- end;' language 'plpgsql'; +-- +-- select inline_1 (); +-- +-- drop function inline_1 (); +-- +-- +-- + +create table events_registrations( + reg_id integer not null primary key, + event_id integer not null references events_events, +-- order_id integer not null references events_orders, +-- price_id integer not null references events_prices, + -- the person registered for this reg_id (may not be the person who made the order - we haven't implemented this) + user_id integer not null references users, + -- reg_states: pending, approved, canceled, waiting + --pending: waiting for approval + --approved: registration all set + --canceled: registration canceled + --waiting: registration is wait-listed + reg_state varchar(50) not null check (reg_state in ('pending', 'approved', 'canceled', 'waiting')), + -- when the registration was made + -- reg_date date, + -- when the registration was approved + + approval_date timestamp, +-- org varchar(500), +-- title_at_org varchar(500), +-- attending_reason text, +-- where_heard varchar(4000), + -- does this person need a hotel? +-- need_hotel_p boolean default 'f', + -- does this person need a rental car? +-- need_car_p boolean default 'f', + -- does this person need airfare? +-- need_plane_p boolean default 'f', + comments text +); + + +-- +-- Indexes +-- + +-- removed price_id from index - 7/19/02 +-- mgeddert - removed org and title at org from index - we will use survey service contracts for this +create index evnt_reg_idx on events_registrations(reg_id, user_id,reg_state); + +-- need this index for speeding up /events/admin/order-history-one.tcl +--create index users_last_name_idx on users(lower(last_name), last_name, first_names, email, user_id); + +-- +-- Triggers +-- + +-- trigger for recording when a registration is approved ??????????? +-- +CREATE FUNCTION event_ship_date_trigger_proc () RETURNS OPAQUE AS ' + BEGIN + IF NEW.reg_state = ''approved'' + THEN + NEW.approval_date := now(); + END IF; + RETURN NEW; + END; +' LANGUAGE 'plpgsql'; + + +create trigger event_ship_date_trigger before insert or update on events_registrations + for each row execute procedure event_ship_date_trigger_proc(); + + + + + +-- Views +-- +-- mgeddert: THESE VIEWS SEEM COMPELTELY UNNECESSARY +-- +--create view events_reg_not_canceled as +--select * from events_registrations +--where reg_state <> 'canceled'; +-- +--create view events_reg_canceled as +--select * from events_registrations +--where reg_state = 'canceled'; +-- +--create view events_reg_approved as +--select * from events_registrations +--where reg_state = 'approved'; +-- +-- create a view that shows order states based upon each order's +-- registrations. The order states are: +-- void: All registrations canceled +-- incomplete: This order is not completely fulfilled--some registrations +-- are either canceled, waiting, or pending +-- fulfilled: This order is completely fulfilled +-- +-- +-- +-- +-- +-- +-- +-- +-- +-- +-- +--create view events_orders_states as +--select o.*, o_states.order_state +--from events_orders o, ( +-- SELECT order_id, CASE (floor(avg( +-- CASE reg_state +-- WHEN 'canceled' THEN 0 +-- WHEN 'waiting' THEN 1 +-- WHEN 'pending' THEN 2 +-- WHEN 'approved' THEN 3 +-- ELSE 0 +-- END ))) +-- WHEN 0 THEN 'canceled' +-- WHEN 1 THEN 'incomplete' +-- WHEN 2 THEN 'incomplete' +-- WHEN 3 THEN 'fulfilled' +-- ELSE 'void' +-- END +-- as order_state +-- FROM events_registrations +-- GROUP BY order_id ) o_states +--WHERE o_states.order_id = o.order_id; +-- +-- +-- +-- Index: openacs-4/contrib/packages/events/sql/postgresql/events-registrations-drop.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/events/sql/postgresql/events-registrations-drop.sql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/events/sql/postgresql/events-registrations-drop.sql 9 Mar 2003 12:07:30 -0000 1.1 @@ -0,0 +1,27 @@ +-- +-- The Events Package +-- +-- @author Michael Steigman (michael@steigman.net) +-- @version $Id: events-registrations-drop.sql,v 1.1 2003/03/09 12:07:30 lars Exp $ +-- +-- This package was orinally written by Bryan Che and Phillip Greenspun +-- +-- GNU GPL v2 +-- +delete from acs_objects where object_type = 'events_registration'; +select acs_object_type__drop_type( + 'events_registration', + 't' + ); + + +--drop view events_orders_states; +--drop view events_reg_not_canceled; +--drop view events_reg_canceled; +--drop view events_reg_shipped; +DROP FUNCTION event_ship_date_trigger_proc (); +DROP trigger event_ship_date_trigger on events_registrations; +drop table events_registrations; + + + Index: openacs-4/contrib/packages/events/sql/postgresql/events-registrations-package-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/events/sql/postgresql/events-registrations-package-create.sql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/events/sql/postgresql/events-registrations-package-create.sql 9 Mar 2003 12:07:30 -0000 1.1 @@ -0,0 +1,108 @@ +-- +-- The Events Package +-- +-- @author Michael Steigman (michael@steigman.net) +-- @version $Id: events-registrations-package-create.sql,v 1.1 2003/03/09 12:07:30 lars Exp $ +-- +-- This package was orinally written by Bryan Che and Philip Greenspun +-- +-- GNU GPL v2 +-- + +-- The Registration Package +select define_function_args('events_registration__new','reg_id,event_id,user_id,reg_state,comments,creation_date,creation_user,creation_ip,context_id'); + +create function events_registration__new (integer,integer,integer,varchar,varchar,timestamp,integer,varchar,integer) +returns integer as ' +declare + p_reg_id alias for $1; -- default null + p_event_id alias for $2; + p_user_id alias for $3; + p_reg_state alias for $4; + p_comments alias for $5; + p_creation_date alias for $6; -- default now() + p_creation_user alias for $7; + p_creation_ip alias for $8; + p_context_id alias for $9; -- default null + v_reg_id integer; +begin + v_reg_id := acs_object__new ( + null, + ''events_registration'', + now(), + p_creation_user, + p_creation_ip, + p_event_id + ); + + + insert into events_registrations + (reg_id, event_id, user_id, reg_state, comments) + values + (v_reg_id, p_event_id, p_user_id, p_reg_state, p_comments); + + return v_reg_id; + +end;' language 'plpgsql'; + + + + +-- select define_function_args('events_registration__name','registration_id'); +-- +-- create function events_registration__name(integer) +-- returns varchar as ' +-- declare +-- p_registration_id alias for $1; +-- begin +-- return p_registration_id as events_registration_name; +-- end; +-- ' language 'plpgsql'; + + + + +select define_function_args('events_registration__delete','reg_id'); + +create function events_registration__delete (integer) +returns integer as ' +declare + p_reg_id alias for $1; +begin + + delete from events_registrations + where reg_id = p_reg_id; + + raise NOTICE ''Deleting note...''; + PERFORM acs_object__delete(p_reg_id); + + return 0; + +end;' language 'plpgsql'; + + + + + + + + + + + + + + + + + + + + + + + + + + + Index: openacs-4/contrib/packages/events/sql/postgresql/events-registrations-package-drop.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/events/sql/postgresql/events-registrations-package-drop.sql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/events/sql/postgresql/events-registrations-package-drop.sql 9 Mar 2003 12:07:30 -0000 1.1 @@ -0,0 +1,14 @@ +-- +-- The Events Package +-- +-- @author Michael Steigman (michael@steigman.net) +-- @version $Id: events-registrations-package-drop.sql,v 1.1 2003/03/09 12:07:30 lars Exp $ +-- +-- This package was orinally written by Bryan Che and Phillip Greenspun +-- +-- GNU GPL v2 +-- + +drop function events_registration__new (integer,integer,integer,varchar,varchar,timestamp,integer,varchar,integer); +-- drop function events_registration__name (integer); +drop function events_registration__delete (integer); Index: openacs-4/contrib/packages/events/sql/postgresql/events-venues-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/events/sql/postgresql/events-venues-create.sql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/events/sql/postgresql/events-venues-create.sql 9 Mar 2003 12:07:30 -0000 1.1 @@ -0,0 +1,290 @@ +-- +-- The Events Package +-- +-- @author Michael Steigman (michael@steigman.net) +-- @version $Id: events-venues-create.sql,v 1.1 2003/03/09 12:07:30 lars Exp $ +-- +-- This package was originally written by Bryan Che and Philip Greenspun +-- +-- GNU GPL v2 +-- +-- +-- Venue Object Types +-- + + +create function inline_0 () +returns integer as ' +begin + PERFORM acs_object_type__create_type ( + ''events_venue'', -- object_type + ''Venue'', -- pretty_name + ''Venues'', -- pretty_plural + ''acs_object'', -- supertype + ''events_venues'', -- table_name + ''venue_id'', -- id_column + ''events_venue'', -- package_name + ''f'', -- abstract_p + null, -- type_extensions_table + ''events_venue.name'' -- name_method + ); + + return 0; +end;' language 'plpgsql'; + +select inline_0 (); + +drop function inline_0 (); + + + + + + + + +create function inline_1 () +returns integer as ' +begin + PERFORM acs_attribute__create_attribute ( + ''events_venue'', -- object_type + ''venue_name'', -- attribute_name + ''string'', -- datatype + ''Name'', -- pretty_name + ''Names'', -- pretty_plural + null, -- table_name + null, -- column_name + null, -- default_value + 1, -- min_n_values + 1, -- max_n_values + null, -- sort_order + ''type_specific'', -- storage + ''f'' -- static_p + ); + + PERFORM acs_attribute__create_attribute ( + ''events_venue'', -- object_type + ''address1'', -- attribute_name + ''string'', -- datatype + ''Address 1'', -- pretty_name + ''Address 1'', -- pretty_plural + null, -- table_name + null, -- column_name + null, -- default_value + 1, -- min_n_values + 1, -- max_n_values + null, -- sort_order + ''type_specific'', -- storage + ''f'' -- static_p + ); + + PERFORM acs_attribute__create_attribute ( + ''events_venue'', -- object_type + ''address2'', -- attribute_name + ''string'', -- datatype + ''Address 2'', -- pretty_name + ''Address 2'', -- pretty_plural + null, -- table_name + null, -- column_name + null, -- default_value + 1, -- min_n_values + 1, -- max_n_values + null, -- sort_order + ''type_specific'', -- storage + ''f'' -- static_p + ); + + PERFORM acs_attribute__create_attribute ( + ''events_venue'', -- object_type + ''city'', -- attribute_name + ''string'', -- datatype + ''City'', -- pretty_name + ''Cities'', -- pretty_plural + null, -- table_name + null, -- column_name + null, -- default_value + 1, -- min_n_values + 1, -- max_n_values + null, -- sort_order + ''type_specific'', -- storage + ''f'' -- static_p + ); + + PERFORM acs_attribute__create_attribute ( + ''events_venue'', -- object_type + ''usps_abbrev'', -- attribute_name + ''string'', -- datatype + ''USPS Abbreviation'', -- pretty_name + ''USPS Abbreviations'', -- pretty_plural + null, -- table_name + null, -- column_name + null, -- default_value + 1, -- min_n_values + 1, -- max_n_values + null, -- sort_order + ''type_specific'', -- storage + ''f'' -- static_p + ); + + PERFORM acs_attribute__create_attribute ( + ''events_venue'', -- object_type + ''postal_code'', -- attribute_name + ''string'', -- datatype + ''Postal Code'', -- pretty_name + ''Postal Codes'', -- pretty_plural + null, -- table_name + null, -- column_name + null, -- default_value + 1, -- min_n_values + 1, -- max_n_values + null, -- sort_order + ''type_specific'', -- storage + ''f'' -- static_p + ); + + PERFORM acs_attribute__create_attribute ( + ''events_venue'', -- object_type + ''iso'', -- attribute_name + ''string'', -- datatype + ''Country Code'', -- pretty_name + ''Country Codes'', -- pretty_plural + null, -- table_name + null, -- column_name + null, -- default_value + 1, -- min_n_values + 1, -- max_n_values + null, -- sort_order + ''type_specific'', -- storage + ''f'' -- static_p + ); + + PERFORM acs_attribute__create_attribute ( + ''events_venue'', -- object_type + ''description'', -- attribute_name + ''string'', -- datatype + ''Description'', -- pretty_name + ''Descriptions'', -- pretty_plural + null, -- table_name + null, -- column_name + null, -- default_value + 1, -- min_n_values + 1, -- max_n_values + null, -- sort_order + ''type_specific'', -- storage + ''f'' -- static_p + ); + + PERFORM acs_attribute__create_attribute ( + ''events_venue'', -- object_type + ''fax_number'', -- attribute_name + ''string'', -- datatype + ''Fax Number'', -- pretty_name + ''Fax Numbers'', -- pretty_plural + null, -- table_name + null, -- column_name + null, -- default_value + 1, -- min_n_values + 1, -- max_n_values + null, -- sort_order + ''type_specific'', -- storage + ''f'' -- static_p + ); + + PERFORM acs_attribute__create_attribute ( + ''events_venue'', -- object_type + ''phone_number'', -- attribute_name + ''string'', -- datatype + ''Phone Number'', -- pretty_name + ''Phone Numbers'', -- pretty_plural + null, -- table_name + null, -- column_name + null, -- default_value + 1, -- min_n_values + 1, -- max_n_values + null, -- sort_order + ''type_specific'', -- storage + ''f'' -- static_p + ); + + PERFORM acs_attribute__create_attribute ( + ''events_venue'', -- object_type + ''email'', -- attribute_name + ''string'', -- datatype + ''Email Address'', -- pretty_name + ''Email Addresses'', -- pretty_plural + null, -- table_name + null, -- column_name + null, -- default_value + 1, -- min_n_values + 1, -- max_n_values + null, -- sort_order + ''type_specific'', -- storage + ''f'' -- static_p + ); + + PERFORM acs_attribute__create_attribute ( + ''events_venue'', -- object_type + ''max_people'', -- attribute_name + ''string'', -- datatype + ''Maximum Number of People'', -- pretty_name + ''Maximum Number of People'', -- pretty_plural + null, -- table_name + null, -- column_name + null, -- default_value + 1, -- min_n_values + 1, -- max_n_values + null, -- sort_order + ''type_specific'', -- storage + ''f'' -- static_p + ); + + return 0; +end;' language 'plpgsql'; + +select inline_1 (); + +drop function inline_1 (); + + + + + + + + + + + + + + +-- +-- +-- Should usps_abbrev be - referneces us_states(abbrev)? +-- +-- +-- where the events occur +create table events_venues ( + venue_id integer + constraint events_venues_pk + primary key, + venue_name varchar(200) not null, + address1 varchar(100), + address2 varchar(100), + city varchar(100), + usps_abbrev char(2), + postal_code varchar(20), + iso char(2) default 'US' references countries, + time_zone integer references timezones(tz_id), + -- some contact info for this venue + phone_number varchar(30), + fax_number varchar(30), + email varchar(100), + needs_reserve_p boolean default 'f', + max_people integer, + description varchar(4000), + package_id integer + constraint evnts_venues_pkg_id_fk + references apm_packages + on delete cascade +); \ No newline at end of file Index: openacs-4/contrib/packages/events/sql/postgresql/events-venues-drop.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/events/sql/postgresql/events-venues-drop.sql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/events/sql/postgresql/events-venues-drop.sql 9 Mar 2003 12:07:30 -0000 1.1 @@ -0,0 +1,18 @@ +-- +-- The Events Package +-- +-- @author Michael Steigman (michael@steigman.net) +-- @version $Id: events-venues-drop.sql,v 1.1 2003/03/09 12:07:30 lars Exp $ +-- +-- This package was orinally written by Bryan Che and Philip Greenspun +-- +-- GNU GPL v2 +-- + +delete from acs_objects where object_type = 'events_venue'; +select acs_object_type__drop_type( + 'events_venue', + 't' + ); + +drop table events_venues; \ No newline at end of file Index: openacs-4/contrib/packages/events/sql/postgresql/events-venues-hc-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/events/sql/postgresql/events-venues-hc-create.sql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/events/sql/postgresql/events-venues-hc-create.sql 9 Mar 2003 12:07:30 -0000 1.1 @@ -0,0 +1,44 @@ +-- +-- The Events Package +-- +-- @author Brad Duell (bduell@ncacasi.org) +-- @version $Id: events-venues-hc-create.sql,v 1.1 2003/03/09 12:07:30 lars Exp $ +-- +-- GNU GPL v2 +-- + +-- allow venue hierarchy +create table events_venues_venues_map ( + parent_venue_id integer not null references events_venues(venue_id), + child_venue_id integer not null references events_venues(venue_id), + package_id integer + constraint events_v_v_pkg_id_fk + references apm_packages(package_id) + on delete cascade, + primary key (parent_venue_id, child_venue_id, package_id) + +); + +-- allow venue connections +create table events_venues_connecting_map ( + left_venue_id integer not null references events_venues(venue_id), + right_venue_id integer not null references events_venues(venue_id), + package_id integer + constraint events_v_c_pkg_id_fk + references apm_packages(package_id) + on delete cascade, + primary key (left_venue_id, right_venue_id, package_id) + +); + +-- use-case mapping between venue connections +create table events_venues_conn_used_map ( + event_id integer not null references events_events, + venue_id integer not null references events_venues, + connected_venue_id integer not null references events_venues(venue_id), + package_id integer + constraint events_v_cu_pkg_id_fk + references apm_packages(package_id) + on delete cascade, + primary key (event_id, venue_id, connected_venue_id, package_id) +); \ No newline at end of file Index: openacs-4/contrib/packages/events/sql/postgresql/events-venues-hc-drop.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/events/sql/postgresql/events-venues-hc-drop.sql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/events/sql/postgresql/events-venues-hc-drop.sql 9 Mar 2003 12:07:30 -0000 1.1 @@ -0,0 +1,12 @@ +-- +-- The Events Package +-- +-- @author Brad Duell (bduell@ncacasi.org) +-- @version $Id: events-venues-hc-drop.sql,v 1.1 2003/03/09 12:07:30 lars Exp $ +-- +-- GNU GPL v2 +-- + +drop table events_venues_conn_used_map; +drop table events_venues_connecting_map; +drop table events_venues_venues_map; \ No newline at end of file Index: openacs-4/contrib/packages/events/sql/postgresql/events-venues-package-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/events/sql/postgresql/events-venues-package-create.sql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/events/sql/postgresql/events-venues-package-create.sql 9 Mar 2003 12:07:30 -0000 1.1 @@ -0,0 +1,76 @@ +-- +-- The Events Package +-- +-- @author Michael Steigman (michael@steigman.net), Matthew Geddert (geddert@yahoo.com) +-- @version $Id: events-venues-package-create.sql,v 1.1 2003/03/09 12:07:30 lars Exp $ +-- +-- This package was orinally written by Bryan Che and Philip Greenspun +-- +-- GNU GPL v2 +-- + + +-- The Venue Package + +select define_function_args('events_venue__new','venue_id,package_id,venue_name,address1,address2,city,usps_abbrev,postal_code,time_zone,iso,phone_number,fax_number,email,needs_reserve_p;f,max_people,description'); + +create function events_venue__new (integer,integer,varchar,varchar,varchar,varchar,varchar,varchar,integer,varchar,varchar,varchar,varchar,boolean,integer,varchar) +returns integer as ' +declare + p_venue_id alias for $1; -- default null + p_package_id alias for $2; + p_venue_name alias for $3; + p_address1 alias for $4; -- default null + p_address2 alias for $5; -- default null + p_city alias for $6; + p_usps_abbrev alias for $7; -- default null + p_postal_code alias for $8; -- default null + p_time_zone alias for $9; -- default null + p_iso alias for $10; -- default null + p_phone_number alias for $11; -- default null + p_fax_number alias for $12; -- default null + p_email alias for $13; -- default null + p_needs_reserve_p alias for $14; -- default ''f'' + p_max_people alias for $15; -- default null + p_description alias for $16; -- default null +begin + + insert into events_venues + (venue_id, venue_name, address1, address2, city, phone_number, fax_number, email, needs_reserve_p, max_people, description, usps_abbrev, postal_code, time_zone, iso, package_id) + values + (p_venue_id, p_venue_name, p_address1, p_address2, p_city, p_phone_number, p_fax_number, p_email, p_needs_reserve_p, p_max_people, p_description, p_usps_abbrev, p_postal_code, p_time_zone, p_iso, p_package_id); + + return p_venue_id; + +end;' language 'plpgsql'; + + +select define_function_args('events_venue__name','venue_id'); + +create function events_venue__name(integer) +returns varchar as ' +declare + p_venue_id alias for $1; +begin + return venue_name from events_venues where venue_id = p_venue_id; +end; +' language 'plpgsql'; + + + +select define_function_args('events_venue__delete','venue_id'); + +create function events_venue__delete (integer) +returns integer as ' +declare + p_venue_id alias for $1; +begin + + delete from events_venues where venue_id = p_venue_id; + + raise NOTICE ''Deleting events_venue...''; + PERFORM acs_object__delete(p_venue_id); + + return 0; + +end;' language 'plpgsql'; Index: openacs-4/contrib/packages/events/sql/postgresql/events-venues-package-drop.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/events/sql/postgresql/events-venues-package-drop.sql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/events/sql/postgresql/events-venues-package-drop.sql 9 Mar 2003 12:07:30 -0000 1.1 @@ -0,0 +1,14 @@ +-- +-- The Events Package +-- +-- @author Michael Steigman (michael@steigman.net) +-- @version $Id: events-venues-package-drop.sql,v 1.1 2003/03/09 12:07:30 lars Exp $ +-- +-- This package was orinally written by Bryan Che and Phillip Greenspun +-- +-- GNU GPL v2 +-- + +drop function events_venue__new (integer,integer,varchar,varchar,varchar,varchar,varchar,varchar,integer,varchar,varchar,varchar,varchar,boolean,integer,varchar); +drop function events_venue__name (integer); +drop function events_venue__delete (integer); Index: openacs-4/contrib/packages/events/tcl/activities-procs-oracle.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/events/tcl/activities-procs-oracle.xql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/events/tcl/activities-procs-oracle.xql 9 Mar 2003 12:07:42 -0000 1.1 @@ -0,0 +1,25 @@ + + + + + + select a.name, a.description, ae.available_p, ae.detail_url, + ae.default_contact_user_id, u.email as default_contact_email, + u.first_names || ' ' || u.last_name as default_contact_name + from acs_activities a, events_activities ae, cc_users u + where a.activity_id = :activity_id + and a.activity_id = ae.activity_id + and ae.default_contact_user_id = u.user_id(+) + + + + + + declare begin + events_activity.del(:activity_id); + end; + + + + + Index: openacs-4/contrib/packages/events/tcl/activities-procs-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/events/tcl/activities-procs-postgresql.xql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/events/tcl/activities-procs-postgresql.xql 9 Mar 2003 12:07:42 -0000 1.1 @@ -0,0 +1,23 @@ + + + + + + select a.name, a.description, ae.available_p, ae.detail_url, + ae.default_contact_user_id, u.email as default_contact_email, + u.first_names || ' ' || u.last_name as default_contact_name + from acs_activities a, events_activities ae left join cc_users u on (ae.default_contact_user_id = u.user_id) + where a.activity_id = :activity_id + and a.activity_id = ae.activity_id + + + + + + select + events_activity__del(:activity_id); + + + + + Index: openacs-4/contrib/packages/events/tcl/activities-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/events/tcl/activities-procs.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/events/tcl/activities-procs.tcl 9 Mar 2003 12:07:42 -0000 1.1 @@ -0,0 +1,117 @@ +ad_library { + + Activity Library + + @creation-date 2002-07-23 + @author Michael Steigman (michael@steigman.net) + @cvs-id $Id: activities-procs.tcl,v 1.1 2003/03/09 12:07:42 lars Exp $ + +} + +namespace eval events::activity { + + ad_proc -public new { + {-activity_id ""} + {-package_id:required} + {-name:required} + {-detail_url ""} + {-default_contact_user_id ""} + {-description ""} + } { + create a new activity + } { + # Prepare the variables for instantiation + set extra_vars [ns_set create] + oacs_util::vars_to_ns_set -ns_set $extra_vars -var_list \ + {activity_id package_id name detail_url default_contact_user_id description} + + set var_list [list [list context_id $package_id]] + + # Instantiate the activity + return [package_instantiate_object -var_list $var_list -extra_vars $extra_vars events_activity] + } + + ad_proc -public edit { + {-activity_id ""} + {-name:required} + {-detail_url:required} + {-description ""} + {-html_p ""} + {-available_p ""} + {-default_contact_user_id ""} + + } { + edit an activity + } { + # Need to update 2 tables + db_dml update_acs_activities {} + db_dml update_events_activities {} + } + + ad_proc -public get { + {-activity_id:required} + {-array:required} + } { + get stuffs the following into array: + + } { + # Select the info into the upvar'ed Tcl Array + upvar $array row + db_1row select_activity_info {} -column_array row + } + + ad_proc -public get_creator { + {-activity_id:required} + {-array:required} + } { + get creator name and email + } { + upvar $array row + db_1row select_creator_info {} -column_array row + } + + ad_proc -public get_stats { + {-activity_id:required} + {-array:required} + } { + get stuffs the following into array: + + } { + # Select the info into the upvar'ed Tcl Array + upvar $array row + db_1row select_activity_stats {} -column_array row + } + + ad_proc -public delete { + {-activity_id:required} + } { + delete an activity + } { + db_exec_plsql delete_activity {} + } + + ad_proc -private exists_p { + {-activity_id:required} + } { + does the activity exist in this package instance? + + @return 1 if activity exists + } { + set package_id [ad_conn package_id] + return [db_0or1row exists_p_select {}] + } + +} Index: openacs-4/contrib/packages/events/tcl/activities-procs.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/events/tcl/activities-procs.xql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/events/tcl/activities-procs.xql 9 Mar 2003 12:07:42 -0000 1.1 @@ -0,0 +1,65 @@ + + + + + + update acs_activities + set name= :name, + description= :description, + html_p= :html_p + where activity_id = :activity_id + + + + + + update events_activities + set available_p = :available_p, + detail_url = :detail_url, + default_contact_user_id = :default_contact_user_id + where activity_id = :activity_id + + + + + + select u.first_names || ' ' || u.last_name as name, + u.email as email + from acs_objects ao, cc_users u + where ao.object_id = :activity_id + and ao.creation_user = u.user_id + + + + + + select 1 + from events_activities + where activity_id = :activity_id + and package_id = :package_id + + + + + + select a.count as approved, + p.count as pending, + w.count as waiting, + c.count as canceled + from (select count(*) as count + from events_registrations er, acs_events ae + where ae.activity_id = :activity_id and ae.event_id = er.event_id and er.reg_state = 'approved') a, + (select count(*) as count + from events_registrations er, acs_events ae + where ae.activity_id = :activity_id and ae.event_id = er.event_id and er.reg_state = 'pending') p, + (select count(*) as count + from events_registrations er, acs_events ae + where ae.activity_id = :activity_id and ae.event_id = er.event_id and er.reg_state = 'waiting') w, + (select count(*) as count + from events_registrations er, acs_events ae + where ae.activity_id = :activity_id and ae.event_id = er.event_id and er.reg_state = 'canceled') c + + + + + Index: openacs-4/contrib/packages/events/tcl/email-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/events/tcl/email-procs.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/events/tcl/email-procs.tcl 9 Mar 2003 12:07:42 -0000 1.1 @@ -0,0 +1,262 @@ +ad_library { + Email library + + @author Matthew Geddert (geddert@yahoo.com) + @creation-date 2002-11-06 +} + +namespace eval events::email { + + + ad_proc -public request_approved { + {-reg_id:required} + } { + This takes a reg_id and sends the participant a message via + acs-mail-lite which tells them that their reservation has been approved + and the details of their event + } { + # Get the data + events::registration::get -reg_id $reg_id -array reg_info + events::event::get -event_id $reg_info(event_id) -array event_info + events::venue::get -venue_id $event_info(venue_id) -array venue_info + + set subject "Directions to $event_info(name)" + + set email_body "$reg_info(user_name),\n\n" + append email_body "Your place is reserved for $event_info(name), which is to take place $event_info(timespan).\n\n" + append email_body "[util_striphtml $event_info(display_after)]\n\n" + if { ![apm_package_installed_p bulk-mail] } { + append email_body "You'll get spammed with a reminder email a day or two before the event.\n\n" + } + append email_body "Venue description and directions:\n\n" + append email_body "$venue_info(venue_name)\n" + append email_body "$venue_info(address1)\n" + if {[exists_and_not_null venue_info(address2)]} { + append message "$venue_info(address2)\n" + } + append email_body "$venue_info(city) $venue_info(usps_abbrev)\n" + append email_body "[util_striphtml $venue_info(description)]\n\n" + if {[string compare $event_info(reg_cancellable_p) "t"] == 0} { + append email_body "If you would like to cancel your registration, you may visit: \n" + append email_body "$reg_info(package_url)order-check?reg_id=$reg_id" + } + + if {[exists_and_not_null event_info(contact_email)]} { + set from_addr $event_info(contact_email) + } else { + # do we want a parameter for this? + set from_addr [ad_outgoing_sender] + } + + # Send the email + acs_mail_lite::send -to_addr $reg_info(user_email) \ + -from_addr $from_addr \ + -subject $subject \ + -body $email_body + + return "message sent" + + } + + + ad_proc -public request_pending { + {-reg_id:required} + } { + This takes a reg_id and sends the participant a message which tells them their reservtion + is pending via acs-mail-lite + } { + # Get the data + events::registration::get -reg_id $reg_id -array reg_info + events::event::get -event_id $reg_info(event_id) -array event_info + + set subject "Registration Request Received" + + set email_body "$reg_info(user_name),\n\n" + append email_body "We have recieved your request to register for $event_info(name). " + append email_body "We will notify you shortly if your registration is approved.\n\n" + append email_body "If you would like to cancel this request, you may visit: \n" + append email_body "$reg_info(package_url)order-check?reg_id=$reg_id" + + + if {[exists_and_not_null event_info(contact_email)]} { + set from_addr $event_info(contact_email) + } else { + # do we want a parameter for this? + set from_addr [ad_outgoing_sender] + } + + # Send the email + acs_mail_lite::send -to_addr $reg_info(user_email) \ + -from_addr $from_addr \ + -subject $subject \ + -body $email_body + + return "message sent" + + } + + ad_proc -public request_waiting { + {-reg_id:required} + } { + This takes a reg_id and sends the participant a message via + acs-mail-lite which tells them that they have been placed on + the waiting list for an event + } { + # Get the data + events::registration::get -reg_id $reg_id -array reg_info + events::event::get -event_id $reg_info(event_id) -array event_info + + set subject "Waiting list addition for $event_info(name)" + + set email_body "$reg_info(user_name),\n\n" + append email_body "You have been placed on the waiting list for $event_info(name)\n\n" + append email_body "We will e-mail you if a space opens up.\n\n" + append email_body "If you would like to cancel your registration, you may visit: \n" + append email_body "$reg_info(package_url)order-check?reg_id=$reg_id" + + + if {[exists_and_not_null event_info(contact_email)]} { + set from_addr $event_info(contact_email) + } else { + # do we want a parameter for this? + set from_addr [ad_outgoing_sender] + } + + # Send the email + acs_mail_lite::send -to_addr $reg_info(user_email) \ + -from_addr $from_addr \ + -subject $subject \ + -body $email_body + + return "message sent" + + } + + ad_proc -public request_canceled { + {-reg_id:required} + {-email_body:required} + } { + This takes a reg_id and email_body of a message and sends the participant a message via + acs-mail-lite which tells them that their reservation has been + } { + # Get the data + events::registration::get -reg_id $reg_id -array reg_info + events::event::get -event_id $reg_info(event_id) -array event_info + + set subject "Your registration for $event_info(name) has been canceled" + + if {[exists_and_not_null event_info(contact_email)]} { + set from_addr $event_info(contact_email) + } else { + # do we want a parameter for this? + set from_addr [ad_outgoing_sender] + } + + # Send the email + acs_mail_lite::send -to_addr $reg_info(user_email) \ + -from_addr $from_addr \ + -subject $subject \ + -body $email_body + + return "message sent" + + } + + ad_proc -public admin_waiting { + {-reg_id:required} + } { + This takes a reg_id and sends the event admin (if he/she exists) a message via + acs-mail-lite which tells them that this person's has automatically been placed + on the waiting list. + } { + # Get the data + events::registration::get -reg_id $reg_id -array reg_info + events::event::get -event_id $reg_info(event_id) -array event_info + + if {[exists_and_not_null event_info(contact_email)]} { + set from_addr $event_info(contact_email) + + set subject "Admin: User added to waiting list for $event_info(name)" + + set email_body "Since registration for $event_info(name) is full, " + append email_body "$reg_info(user_name) has been placed on a waiting list. \n\n" + append email_body "If you would like to change this persons registration, status you may visit: \n" + append email_body "$reg_info(package_url)admin/reg-view?reg_id=$reg_id" + + # Send the email + acs_mail_lite::send -to_addr $from_addr \ + -from_addr $from_addr \ + -subject $subject \ + -body $email_body + } + + return "message sent" + + } + + + ad_proc -public admin_pending { + {-reg_id:required} + } { + This takes a reg_id and sends the event admin (if he/she exists) a message via + acs-mail-lite which tells them that this person's registration status is waiting + for their approval. + } { + # Get the data + events::registration::get -reg_id $reg_id -array reg_info + events::event::get -event_id $reg_info(event_id) -array event_info + + if {[exists_and_not_null event_info(contact_email)]} { + set from_addr $event_info(contact_email) + + set subject "Admin: Approval requested for $event_info(name)" + + set email_body "Since registering for $event_info(name) requires registrations to be approved, " + append email_body "$reg_info(user_name) has been added as a pending reservation.\n\n" + append email_body "Please come either approve or deny $reg_info(user_name)'s request for registration:\n" + append email_body "$reg_info(package_url)admin/reg-view?reg_id=$reg_id" + + # Send the email + acs_mail_lite::send -to_addr $from_addr \ + -from_addr $from_addr \ + -subject $subject \ + -body $email_body + } + + return "message sent" + + } + + + ad_proc -public admin_canceled { + {-reg_id:required} + } { + This takes a reg_id and sends the event admin (if he/she exists) a message via + acs-mail-lite which tells them that this person's registration status has been + changed to canceled. + } { + # Get the data + events::registration::get -reg_id $reg_id -array reg_info + events::event::get -event_id $reg_info(event_id) -array event_info + + if {[exists_and_not_null event_info(contact_email)]} { + set from_addr $event_info(contact_email) + + set subject "Admin: User canceled for $event_info(name)" + + set email_body "$reg_info(user_name) has canceled his/her reservation for $event_info(name)." + + # Send the email + acs_mail_lite::send -to_addr $from_addr \ + -from_addr $from_addr \ + -subject $subject \ + -body $email_body + } + + return "message sent" + + } + + + +} Index: openacs-4/contrib/packages/events/tcl/events-procs-oracle.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/events/tcl/events-procs-oracle.xql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/events/tcl/events-procs-oracle.xql 9 Mar 2003 12:07:42 -0000 1.1 @@ -0,0 +1,203 @@ + + + + + + declare begin + :1 := timespan.new ( + start_date => to_date(:sql_start_date,:date_format), + end_date => to_date(:sql_end_date,:date_format) + ); + end; + + + + + + declare begin + :1 := acs_event.new ( + activity_id => :activity_id, + timespan_id => :timespan_id, + creation_user => :creation_user, + creation_ip => :creation_ip, + context_id => :context_id + ); + end; + + + + + + declare begin + events_event.new ( + event_id => :event_id, + venue_id => :venue_id, + display_after => :display_after, + max_people => :max_people, + reg_deadline => to_date(:sql_reg_deadline,:date_format), + available_p => :available_p, + deleted_p => :deleted_p, + reg_cancellable_p => :reg_cancellable_p, + reg_needs_approval_p => :reg_needs_approval_p, + contact_user_id => :contact_user_id, + refreshments_note => :refreshments_note, + av_note => :av_note, + additional_note => :additional_note, + alternative_reg => :alternative_reg, + activity_id => :activity_id + ); + end; + + + + + + declare begin + :1 := events_event.new ( + activity_id => :activity_id, + venue_id => :venue_id, + display_after => :display_after, + max_people => :max_people, + reg_deadline => to_date(:sql_reg_deadline,:date_format), + available_p => :available_p, + deleted_p => :deleted_p, + reg_cancellable_p => :reg_cancellable_p, + reg_needs_approval_p => :reg_needs_approval_p, + refreshments_note => :refreshments_note, + av_note => :av_note, + additional_note => :additional_note, + alternative_reg => :alternative_reg, + timespan_id => :timespan_id, + creation_user => :creation_user, + creation_ip => :creation_ip + ); + end; + + + + + + select a.activity_id, aa.name, aa.description, e.display_after, v.city, v.usps_abbrev, + v.venue_id, + CASE WHEN to_char(t.start_date, 'YYYY-MM-DD') = to_char(t.end_date, 'YYYY-MM-DD') + THEN to_char(t.start_date, :date_format) || ' (' || to_char(t.start_date, :time_format) || ' - ' || to_char(t.end_date, :time_format) || ')' + ELSE to_char(t.start_date, :date_format) || ' ' || to_char(t.start_date, :time_format) || ' - ' || to_char(t.end_date, :date_format) || ' ' || to_char(t.end_date, :time_format) + END as timespan, + to_char(e.reg_deadline, :date_format) || ' ' || to_char(e.reg_deadline, :time_format) as reg_deadline, + e.available_p, e.max_people, e.refreshments_note, e.av_note, + e.additional_note, ae.timespan_id, a.detail_url, + decode(e.reg_cancellable_p, + 't', 'Yes', + 'f', 'No', + 'No') as pretty_reg_cancellable_p, + decode (e.reg_needs_approval_p, + 't', 'Yes', + 'f', 'No', + 'No') as pretty_reg_needs_approval_p, + e.reg_cancellable_p, + e.reg_needs_approval_p, + e.contact_user_id, + nvl (u.email, '') as contact_email + from acs_events ae, + acs_activities aa, + events_events e, + events_activities a, + events_venues v, + timespans s, + time_intervals t, + cc_users u + where e.event_id = :event_id + and ae.event_id = :event_id + and e.contact_user_id = u.user_id(+) + and ae.activity_id = a.activity_id + and a.activity_id = aa.activity_id + and v.venue_id = e.venue_id + and ae.timespan_id = s.timespan_id + and s.interval_id = t.interval_id + + + + + + + update events_events + set venue_id = :venue_id, + max_people = :max_people, + reg_cancellable_p = :reg_cancellable_p, + reg_needs_approval_p = :reg_needs_approval_p, + contact_user_id = :contact_user_id, + display_after = :display_after, + reg_deadline = to_date(:sql_reg_deadline,:date_format) + where event_id = :event_id + + + + + + update time_intervals + set start_date = to_date(:sql_start_date,:date_format), + end_date = to_date(:sql_end_date,:date_format) + where interval_id = :interval_id + + + + + + + declare begin + events_event.del(:event_id); + end; + + + + + + update events_events + set available_p = util.logical_negation(available_p) + where event_id = :event_id + + + + + + select to_date(:bulk_mail_send_date, 'DDD YYYY HH24:MI:SS') as bulk_mail_send_date from dual + + + + + + update bulk_mail_messages + set send_date = to_date(:bulk_mail_send_date, :bulk_mail_date_format), + message = :message, + from_addr = :from_addr, + sent_p = 'f' + where bulk_mail_id = :bulk_mail_id + + + + + + $query and rownum=1 + + + + + + select t.count as total_interested, + ee.max_people, + a.count as approved, + p.count as pending, + w.count as waiting, + c.count as canceled, v.venue_id + from (select count(*) as count from events_registrations where event_id = :event_id and reg_state = 'approved') a, + (select count(*) as count from events_registrations where event_id = :event_id and reg_state = 'pending') p, + (select count(*) as count from events_registrations where event_id = :event_id and reg_state = 'waiting') w, + (select count(*) as count from events_registrations where event_id = :event_id and reg_state = 'canceled') c, + (select count(*) as count from events_registrations where event_id = :event_id and reg_state <> 'canceled') t, + events_events ee, + events_venues v + where ee.event_id = :event_id and ee.venue_id = v.venue_id + + + + Index: openacs-4/contrib/packages/events/tcl/events-procs-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/events/tcl/events-procs-postgresql.xql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/events/tcl/events-procs-postgresql.xql 9 Mar 2003 12:07:42 -0000 1.1 @@ -0,0 +1,176 @@ + + + + + + select timespan__new ( + :sql_start_date::timestamp, + :sql_end_date::timestamp + ) + + + + + + select acs_event__new ( + null, + null, + null, + null, + null, + :timespan_id, + :activity_id, + null, + 'acs_event', + now(), + :creation_user, + :creation_ip, + :context_id + ) + + + + + + select events_event__new ( + :event_id, + :venue_id, + :display_after, + :max_people, + :sql_reg_deadline::timestamp, + :available_p, + :deleted_p, + :reg_cancellable_p, + :reg_needs_approval_p, + :contact_user_id, + :refreshments_note, + :av_note, + :additional_note, + :alternative_reg, + :activity_id + ) + + + + + + + + select a.activity_id, aa.name, aa.description, e.display_after, v.city, v.usps_abbrev, + v.venue_id, + CASE WHEN to_char(t.start_date, 'YYYY-MM-DD') = to_char(t.end_date, 'YYYY-MM-DD') + THEN to_char(t.start_date, :date_format) || ' (' || to_char(t.start_date, :time_format) || ' - ' || to_char(t.end_date, :time_format) || ')' + ELSE to_char(t.start_date, :date_format) || ' ' || to_char(t.start_date, :time_format) || ' - ' || to_char(t.end_date, :date_format) || ' ' || to_char(t.end_date, :time_format) + END as timespan, + to_char(e.reg_deadline, :date_format) || ' ' || to_char(e.reg_deadline, :time_format) as reg_deadline, + e.available_p, e.max_people, + e.refreshments_note, e.av_note, + e.additional_note, ae.timespan_id, a.detail_url, + CASE WHEN e.reg_cancellable_p THEN 'Yes' + ELSE 'No' + END as pretty_reg_cancellable_p, + CASE WHEN e.reg_needs_approval_p THEN 'Yes' + ELSE 'No' + END as pretty_reg_needs_approval_p, + e.reg_cancellable_p, + e.reg_needs_approval_p, + e.contact_user_id, + coalesce(u.email, '') as contact_email + from acs_events ae, + acs_activities aa, + events_activities a, + events_venues v, + timespans s, + time_intervals t, + events_events e left join cc_users u on (e.contact_user_id = u.user_id) + where e.event_id = :event_id + and ae.event_id = :event_id + and ae.activity_id = a.activity_id + and a.activity_id = aa.activity_id + and v.venue_id = e.venue_id + and ae.timespan_id = s.timespan_id + and s.interval_id = t.interval_id + + + + + + + update events_events + set venue_id = :venue_id, + max_people = :max_people, + reg_cancellable_p = :reg_cancellable_p, + reg_needs_approval_p = :reg_needs_approval_p, + contact_user_id = :contact_user_id, + display_after = :display_after, + reg_deadline = :sql_reg_deadline::timestamp + where event_id = :event_id + + + + + + update time_intervals + set start_date = :sql_start_date::timestamp, + end_date = :sql_end_date::timestamp + where interval_id = :interval_id + + + + + + select + events_event__del(:event_id); + + + + + + update events_events + set available_p = util__logical_negation(available_p) + where event_id = :event_id + + + + + + select to_timestamp(:bulk_mail_send_date, 'DDD YYYY HH24:MI:SS') as bulk_mail_send_date + + + + + + update bulk_mail_messages + set send_date = to_timestamp(:bulk_mail_send_date, :bulk_mail_date_format), + message = :message, + from_addr = :from_addr, + sent_p = 'f' + where bulk_mail_id = :bulk_mail_id + + + + + + $query limit 1 + + + + + + select t.count as total_interested, ee.max_people, + ee.max_people as max_people, + a.count as approved, + p.count as pending, + w.count as waiting, + c.count as canceled, v.venue_id + from (select count(*) as count from events_registrations where event_id = :event_id and reg_state = 'approved') a, + (select count(*) as count from events_registrations where event_id = :event_id and reg_state = 'pending') p, + (select count(*) as count from events_registrations where event_id = :event_id and reg_state = 'waiting') w, + (select count(*) as count from events_registrations where event_id = :event_id and reg_state = 'canceled') c, + (select count(*) as count from events_registrations where event_id = :event_id and reg_state <> 'canceled') t, + events_events ee, events_venues v + where ee.event_id = :event_id and ee.venue_id = v.venue_id + + + + Index: openacs-4/contrib/packages/events/tcl/events-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/events/tcl/events-procs.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/events/tcl/events-procs.tcl 9 Mar 2003 12:07:42 -0000 1.1 @@ -0,0 +1,372 @@ +ad_library { + + Events Library + + @creation-date 2002-07-23 + @author Michael Steigman (michael@steigman.net) + @cvs-id $Id: events-procs.tcl,v 1.1 2003/03/09 12:07:42 lars Exp $ + +} + +namespace eval events::event { + + ad_proc -public new { + {-activity_id:required} + {-venue_id:required} + {-display_after ""} + {-max_people ""} + {-start_time:required} + {-end_time:required} + {-reg_deadline:required} + {-available_p "t"} + {-deleted_p "f"} + {-reg_cancellable_p ""} + {-reg_needs_approval_p ""} + {-contact_user_id ""} + {-refreshments_note ""} + {-av_note ""} + {-additional_note ""} + {-alternative_reg ""} + } { + create a new event based on activity_id + } { + + + set sql_start_date [events::time::to_sql_datetime -datetime $start_time] + set sql_end_date [events::time::to_sql_datetime -datetime $end_time] + set sql_reg_deadline [events::time::to_sql_datetime -datetime $reg_deadline] + +# these are replaced by the events::time procs +# set sql_start_date [template::util::date::get_property linear_date $start_time] +# set sql_end_date [template::util::date::get_property linear_date $end_time] +# set sql_reg_deadline [template::util::date::get_property linear_date $reg_deadline] + + # oracle needs date_format to take the sql dates + set date_format "YYYY MM DD HH24 MI SS" + + set timespan_id [db_exec_plsql new_timespan {}] + + # Should be moved to calling pages and sent via arguments? + # don't think we want to deal with connection stuff here + set creation_user [ad_conn user_id] + set creation_ip [ad_conn peeraddr] + set context_id $activity_id + set event_id [db_exec_plsql new_acs_event {}] + db_exec_plsql new_event {} + + events::event::verify_bulk_mail_reminder -event_id $event_id + return $event_id + } + + ad_proc -public edit { + {-event_id:required} + {-venue_id:required} + {-max_people ""} + {-reg_cancellable_p ""} + {-reg_needs_approval_p ""} + {-contact_user_id ""} + {-display_after ""} + {-start_time:required} + {-end_time:required} + {-reg_deadline:required} + } { + edit an event + } { + set date_format "YYYY MM DD HH24 MI SS" + set sql_reg_deadline [events::time::to_sql_datetime -datetime $reg_deadline] +# set sql_reg_deadline [template::util::date::get_property linear_date $reg_deadline] + db_dml update_event {} + + set interval_id [db_string select_interval_id {}] + set sql_start_date [events::time::to_sql_datetime -datetime $start_time] + set sql_end_date [events::time::to_sql_datetime -datetime $end_time] +# set sql_start_date [template::util::date::get_property linear_date $start_time] +# set sql_end_date [template::util::date::get_property linear_date $end_time] + db_dml update_time_interval {} + events::event::verify_bulk_mail_reminder -event_id $event_id + } + + ad_proc -public edit_event_notes { + {-event_id:required} + {-refreshments_note ""} + {-av_note ""} + {-additional_note ""} + } { + edit event notes + } { + db_dml update_event_notes {} + } + + ad_proc -public get { + {-event_id:required} + {-array:required} + } { + get stuffs the following into array: + + } { + # Select the info into the upvar'ed Tcl Array + set date_format [parameter::get -parameter date_format -default "MM/DD/YYYY"] + set time_format [parameter::get -parameter time_format -default "HH12:MIam"] + + upvar $array row + db_1row select_event_info {} -column_array row + + # Venue(s) + set max [events::venue::connecting_max -event_id $event_id -venue_id $row(venue_id) -package_id [ad_conn package_id]] + if { [empty_string_p $row(max_people)] && ![empty_string_p $max] } { + set row(max_people) $max + } + } + + ad_proc -public get_creator { + {-event_id:required} + {-array:required} + } { + get creator name and email + } { + upvar $array row + db_1row select_creator_info {} -column_array row + } + + ad_proc -public get_stats { + {-event_id:required} + {-array:required} + } { + get stuffs the following into array: + + } { + # Select the info into the upvar'ed Tcl Array + upvar $array row + db_1row select_event_stats {} -column_array row + + # Venue(s) + set max [events::venue::connecting_max -event_id $event_id -venue_id $row(venue_id) -package_id [ad_conn package_id]] + if { [empty_string_p $row(max_people)] && ![empty_string_p $max] } { + set row(max_people) $max + } + } + + ad_proc -public delete { + {-event_id:required} + } { + delete an event + } { + db_exec_plsql delete_event {} + } + + ad_proc -private make_event_date { + {-which_type:required} + {-timespan_id ""} + {-event_id ""} + } { + return a templating date type suitable for use with forms. + timespan_id is necessary to make start_time and end_time, + event_id is necessary to make reg_deadline. + } { + set date_format "YYYY MM DD HH24 MI" + switch $which_type { + start_time { + set which_date "t.start_date" + set raw_date [db_string select_event_date {}] + } + end_time { + set which_date "t.end_date" + set raw_date [db_string select_event_date {}] + } + reg_deadline { + set raw_date [db_string select_reg_deadline {}] + } + + return [template::util::date::create \ + [lindex $raw_date 0] \ + [lindex $raw_date 1] \ + [lindex $raw_date 2] \ + [lindex $raw_date 3] \ + [lindex $raw_date 4] \ + $date_format \ + ] + } + } + + ad_proc -public toggle_available_p { + {-event_id:required} + } { + toggle event availability + } { + db_dml toggle {} + } + + ad_proc -public attachments_enabled_p { + } { + are attachments configured? + + attachments require the attachment package mounted + under events (as attach) and a row in the attachments_fs_root_folder_map + with the events package_id and the desired fs instance root + folder + } { + set package_id [ad_conn package_id] + if {[site_node_apm_integration::child_package_exists_p -package_key attachments] && \ + [db_0or1row root_folder_exists_p {}] } { + return 1 + } else { + return 0 + } + + } + + ad_proc -private exists_p { + {-event_id:required} + } { + does the event exist as part of this package instance? + + @return 1 if event exists + } { + set package_id [ad_conn package_id] + return [db_0or1row exists_p_select {}] + } + + ad_proc -private reg_deadline_elapsed_p { + {-event_id:required} + } { + has the reg deadline elapsed + + @return 1 if event exists + } { + return [db_0or1row reg_deadline_elapsed_p_select {}] + } + + + + ad_proc -private verify_bulk_mail_reminder { + {-event_id:required} + } { + if bulk mail is installed, this proc will check if + the given event has a bulk mail email reminder, if it + does it will make update the send date to fit any changes + in an events start date, if none exists, then it will + create such a reminder. The reason this isn't broken + into two different procs is because some people might + choose to install bulk mail after some events have already + been created, then if they update an event it will automatically + create a reminder email for that events registrants + + @param event_id + @return 1 if compelete successfully 0 if bulk mail is not installed + } { + + # first, lets make sure they have bulk-mail installed. + if { ![apm_package_installed_p bulk-mail] } { + return 0 + } else { + + + # first we see whether or not a bulk mail message has already been + # created. we do this by seeing if the bulk_mail_id column of the + # events_events table has an associated bulk mail message with it + # while we are at it we will also pull out the event's start date + # in the format we want to determine a bulk mail send_date + # which is two days prior to the events start date + + db_1row select_startdate_and_bulk_mail_id {} + + # this is ugly, but it seems to work. + # in order to manipulate the day of the year we need to remove leading zeros + # to do this i will search for a string at the beginning to see there are + # leading zeros + set day_of_year [string trim $day_of_year] + set day_of_year " $day_of_year " + # if there is a leading zero append START to the front and END to the back + regsub -nocase -all {([^a-zA-Z0-9]+)(0[^\(\)<>\s]+)} $day_of_year "\\1\tSTART\\2END\t" day_of_year + # remove 2 leading zero's if they exist + regsub -all {\tSTART00([^\t]*)END\t} $day_of_year {\1} day_of_year + # remove 1 leading zero if it exists + regsub -all {\tSTART0([^\t]*)END\t} $day_of_year {\1} day_of_year + set day_of_year [string trim $day_of_year] + + set two_days_ago [expr $day_of_year - 2] + set year_two_days_ago $year + if { $two_days_ago <= 0 } { + set year_two_days_ago [expr $year -1] + # this isn't taking leap years with 366 days into acocunt - but i think it is close enough + # so once every 4 years for events on jan 1 and 2 the reminder will be three days before + # the event and not two + set two_days_ago [expr 365 + $two_days_ago] + } + + # although this works with regular updates, it isn't working with bulk_mail::new so i need + # to go to the database to format this in a way postgresql will like i.e. 'YYYY-MM-DD HH24:MI:SS' + set bulk_mail_send_date "$two_days_ago $year_two_days_ago $time" + + db_1row convert_to_timestamp_the_db_likes {} + set bulk_mail_date_format "YYYY-MM-DD HH24:MI:SS" + + # now lets create the email message we want to send + events::event::get -event_id $event_id -array event_info + events::venue::get -venue_id $event_info(venue_id) -array venue_info + + if {[exists_and_not_null event_info(contact_email)]} { + set from_addr $event_info(contact_email) + } else { + # do we want a parameter for this? + set from_addr [ad_outgoing_sender] + } + + set subject "Reminder: $event_info(name) - $event_info(timespan)." + + set message "This is a reminder to all registered users for $event_info(name), " + append message "that the event is going to take place $event_info(timespan).\n\n" + append message "Once again, here is the venue description and directions:\n\n" + append message "$venue_info(venue_name)\n" + append message "$venue_info(address1)\n" + if {[exists_and_not_null venue_info(address2)]} { + append message "$venue_info(address2)\n" + } + append message "$venue_info(city) $venue_info(usps_abbrev)\n" + append message "[util_striphtml $venue_info(description)]\n\n" + + if {[exists_and_not_null bulk_mail_id]} { + db_dml update_bulk_mail {} + } else { + # there is no bulk mail reminder so we need to create one + + set query [db_map select_approved_registrants] + + if { [db_0or1row check_email_list [db_map check_emails]] } { + set bulk_mail_id [bulk_mail::new -from_addr $from_addr -send_date $bulk_mail_send_date -date_format $bulk_mail_date_format -subject $subject -message $message -query $query] + db_dml update_events_events_bulk_mail_id {} + } + } + return 1 + } + } +} \ No newline at end of file Index: openacs-4/contrib/packages/events/tcl/events-procs.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/events/tcl/events-procs.xql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/events/tcl/events-procs.xql 9 Mar 2003 12:07:42 -0000 1.1 @@ -0,0 +1,114 @@ + + + + + + select u.first_names || ' ' || u.last_name as name, + u.email as email + from acs_objects ao, cc_users u + where ao.object_id = :event_id + and ao.creation_user = u.user_id + + + + + + select t.interval_id + from time_intervals t, timespans s, acs_events ae + where ae.event_id = :event_id + and ae.timespan_id = s.timespan_id + and s.interval_id = t.interval_id + + + + + + select to_char($which_date,'$date_format') + from time_intervals t, timespans s + where s.timespan_id = :timespan_id + and t.interval_id = s.interval_id + + + + + + select to_char(reg_deadline,'$date_format') + from events_events e + where event_id = :event_id + + + + + + update events_events + set refreshments_note = :refreshments_note, + av_note = :av_note, + additional_note = :additional_note + where event_id = :event_id + + + + + + select 1 from attachments_fs_root_folder_map + where package_id = :package_id + + + + + + select 1 + from events_events ee, + events_activities ea, + acs_events ae + where ee.event_id = :event_id + and ae.event_id = :event_id + and ae.activity_id = ea.activity_id + and ea.package_id = :package_id + + + + + + select 1 + from events_events ee, + dual + where ee.event_id = :event_id + and ee.reg_deadline < sysdate + + + + + + update events_events + set bulk_mail_id = :bulk_mail_id + where event_id = :event_id + + + + + + select to_char(ti.start_date, 'DDD') as day_of_year, + to_char(ti.start_date, 'YYYY') as year, + to_char(ti.start_date, 'HH24:MI:SS') as time, + ee.bulk_mail_id + from time_intervals ti, timespans ts, acs_events ae, events_events ee + where ti.interval_id = ts.interval_id + and ts.timespan_id = ae.timespan_id + and ae.event_id = :event_id + and ee.event_id = :event_id + + + + + + select pa.email + from parties pa, events_registrations er + where er.user_id = pa.party_id + and er.reg_state = 'approved' + and event_id = '$event_id' + + + + + Index: openacs-4/contrib/packages/events/tcl/organizers-procs-oracle.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/events/tcl/organizers-procs-oracle.xql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/events/tcl/organizers-procs-oracle.xql 9 Mar 2003 12:07:42 -0000 1.1 @@ -0,0 +1,13 @@ + + + + + + select role, responsibilities, public_role_p, eom.user_id + from events_organizer_roles eor, events_organizers_map eom + where eor.role_id = :role_id + and eor.role_id = eom.role_id(+) + + + + Index: openacs-4/contrib/packages/events/tcl/organizers-procs-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/events/tcl/organizers-procs-postgresql.xql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/events/tcl/organizers-procs-postgresql.xql 9 Mar 2003 12:07:42 -0000 1.1 @@ -0,0 +1,12 @@ + + + + + + select role, responsibilities, public_role_p, eom.user_id + from events_organizer_roles eor left join events_organizers_map eom using ( role_id ) + where eor.role_id = :role_id + + + + Index: openacs-4/contrib/packages/events/tcl/organizers-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/events/tcl/organizers-procs.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/events/tcl/organizers-procs.tcl 9 Mar 2003 12:07:42 -0000 1.1 @@ -0,0 +1,141 @@ +ad_library { + + Organizer Role Library + + @creation-date 2002-07-23 + @author Michael Steigman (michael@steigman.net) + @cvs-id $Id: organizers-procs.tcl,v 1.1 2003/03/09 12:07:42 lars Exp $ + +} + +namespace eval events::organizer { + + ad_proc -public new_role { + {-activity_id ""} + {-event_id ""} + {-role ""} + {-responsibilities ""} + {-public_role_p ""} + {-user_id ""} + } { + create new organizer role; returns role_id + } { + set role_id [db_nextval events_org_roles_seq] + db_dml new_org_role {} + return $role_id + } + + ad_proc -public get_role { + {-role_id:required} + {-array:required} + } { + retrieve an organizer role + } { + # Select the info into the upvar'ed Tcl Array + upvar $array row + db_1row select_org_role_info {} -column_array row + } + + ad_proc -public edit_role { + {-role_id:required} + {-role ""} + {-responsibilities ""} + {-public_role_p ""} + } { + edit an organizer role + } { + db_dml edit_org_role {} + } + + ad_proc -public delete_role { + {-role_id:required} + } { + remove org role from system + } { + db_dml delete_org_role {} + } + + ad_proc -public map_role { + {-role_id ""} + {-role_id_list ""} + {-activity_id ""} + {-event_id ""} + } { + map a role (or roles) to an activity or an event + } { + if {[exists_and_not_null event_id]} { + db_dml insert_into_events_org_role_event_map {} + } else { + db_dml insert_into_events_org_role_activity_map {} + } + } + + ad_proc -public unmap_role { + {-role_id ""} + {-role_id_list ""} + {-activity_id ""} + {-event_id ""} + } { + unmap a role (or roles) from an activity or an event + } { + if {[exists_and_not_null event_id]} { + db_dml delete_from_events_organizers_map {} + db_dml delete_from_events_org_role_event_map {} + } else { + db_dml delete_from_events_org_role_activity_map {} + } + } + + ad_proc -public add_organizer { + {-role_id:required} + {-party_id:required} + {-event_id:required} + } { + add an organizer in a role + } { + db_dml insert_into_events_organizers_map {} + } + + ad_proc -public edit_organizer { + {-role_id:required} + {-party_id:required} + {-event_id:required} + } { + edit an organizer in a role + } { + db_dml update_events_organizers_map {} + } + + ad_proc -public delete_organizer { + {-role_id:required} + {-party_id:required} + {-event_id:required} + } { + delete an organizer from a role + } { + db_dml delete_from_events_organizers_map {} + } + + ad_proc users_get_options { + {-package_id ""} + } { + build options list for contacts + } { + set users_list [db_list_of_lists users {}] + set users_list [concat $users_list { { "None" "" } } { { "Search for a user..." ":search:" } }] + return $users_list + } + + ad_proc -private organizer_exists_p { + {-role_id:required} + {-event_id:required} + } { + is there an organizer for this role_id/event_id? we're not worried about + being smart enough to check for an exact match - if there's an organizer + in this role, we'll update (need to change logic to support many-to-one + organizer relationship) + } { + return [db_0or1row check_events_organizers_map {}] + } + +} Index: openacs-4/contrib/packages/events/tcl/organizers-procs.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/events/tcl/organizers-procs.xql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/events/tcl/organizers-procs.xql 9 Mar 2003 12:07:42 -0000 1.1 @@ -0,0 +1,119 @@ + + + + + + insert into events_organizer_roles + (role_id, role, responsibilities, public_role_p) + values + (:role_id, :role, :responsibilities, :public_role_p) + + + + + + insert into events_org_role_event_map + (role_id, event_id) + values + (:role_id, :event_id) + + + + + + insert into events_org_role_activity_map + (role_id, activity_id) + values + (:role_id, :activity_id) + + + + + + delete from events_org_role_event_map + where role_id = :role_id + and event_id = :event_id + + + + + + delete from events_organizers_map + where role_id = :role_id + and event_id = :event_id + + + + + + delete from events_org_role_activity_map + where role_id = :role_id + and activity_id = :activity_id + + + + + + update events_organizer_roles + set role = :role, + responsibilities = :responsibilities, + public_role_p = :public_role_p + where role_id = :role_id + + + + + + delete from events_organizer_roles + where role_id = :role_id + + + + + + insert into events_organizers_map + (role_id, event_id, user_id) + values + (:role_id, :event_id, :party_id) + + + + + + update events_organizers_map + set user_id = :party_id + where role_id = :role_id + and event_id = :event_id + + + + + + delete from events_organizers_map + where role_id = :role_id + and event_id = :event_id + + + + + + select distinct + u.first_names || ' ' || u.last_name as name, + u.user_id + from cc_users u + order by name + + + + + + select * from events_organizers_map + where role_id = :role_id + and event_id = :event_id + + + + + + + Index: openacs-4/contrib/packages/events/tcl/registrations-procs-oracle.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/events/tcl/registrations-procs-oracle.xql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/events/tcl/registrations-procs-oracle.xql 9 Mar 2003 12:07:42 -0000 1.1 @@ -0,0 +1,61 @@ + + + + + + select er.event_id, + er.user_id, + person.name(er.user_id) as user_name, + pa.email as user_email, + er.reg_state, + to_char(ao.creation_date, :date_format) || ' ' || to_char(ao.creation_date, :time_format) as creation_date, + to_char(er.approval_date, :date_format) || ' ' || to_char(er.approval_date, :time_format) as approval_date, + er.comments, + :url || site_node.url(sn.node_id) as package_url + from events_registrations er, + parties pa, + acs_objects ao, + site_nodes sn + where er.reg_id = :reg_id + and sn.object_id = :package_id + and er.reg_id = ao.object_id + and er.user_id = pa.party_id + + + + + + declare begin + events_registration.del(:reg_id); + end; + + + + + + declare begin + :1 := acs_attribute.create_attribute ( + object_type => 'events_registration', + attribute_name => :attribute_name, + datatype => :datatype, + pretty_name => :pretty_name, + pretty_plural => :pretty_plural, + storage => 'generic', + sort_order => :sort_order + ); + end; + + + + + + declare begin + acs_attribute.drop_attribute ( + object_type => 'events_registration', + attribute_name => :attribute_name + ); + end; + + + + Index: openacs-4/contrib/packages/events/tcl/registrations-procs-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/events/tcl/registrations-procs-postgresql.xql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/events/tcl/registrations-procs-postgresql.xql 9 Mar 2003 12:07:42 -0000 1.1 @@ -0,0 +1,67 @@ + + + + + + select er.event_id, + er.user_id, + person__name(er.user_id) as user_name, + pa.email as user_email, + er.reg_state, + to_char(ao.creation_date, :date_format) || ' ' || to_char(ao.creation_date, :time_format) as creation_date, + to_char(er.approval_date, :date_format) || ' ' || to_char(er.approval_date, :time_format) as approval_date, + er.comments, + :url || site_node__url(sn.node_id) as package_url + from events_registrations er, + parties pa, + acs_objects ao, + site_nodes sn + where er.reg_id = :reg_id + and sn.object_id = :package_id + and er.reg_id = ao.object_id + and er.user_id = pa.party_id + + + + + + declare begin + events_registration.del(:reg_id); + end; + + + + + + select acs_attribute__create_attribute ( + 'events_registration', + :attribute_name, + :datatype, + :pretty_name, + :pretty_plural, + null, + null, + null, + 1, + 1, + :sort_order + 'generic', + 'f' + ); + + + + + + select acs_attribute__drop_attribute('events_registration', :attribute_name) + + + + + + + + + + + Index: openacs-4/contrib/packages/events/tcl/registrations-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/events/tcl/registrations-procs.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/events/tcl/registrations-procs.tcl 9 Mar 2003 12:07:42 -0000 1.1 @@ -0,0 +1,282 @@ +ad_library { + + Registrations Library + + @creation-date 2002-08-24 + @modified Matthew Geddert (geddert@yahoo.com) + @author Michael Steigman (michael@steigman.net) + @cvs-id $Id: registrations-procs.tcl,v 1.1 2003/03/09 12:07:42 lars Exp $ + +} + +namespace eval events::registration { + + ad_proc -public new { + {-reg_id ""} + {-event_id:required} + {-user_id:required} + {-comments ""} + } { + create a new registration + } { + # check what reg state this user will get + events::event::get -event_id $event_id -array event_info + # first we check if the registration needs approval + if {[string compare $event_info(reg_needs_approval_p) "t"] == 0} { + set reg_state "pending" + } else { + # it doesn't need approval, so we need to check if they will automatically be waitlisted + events::event::get_stats -event_id $event_id -array event_stats + if { ![empty_string_p $event_stats(max_people)] && ( 0 >= [expr $event_stats(max_people) - $event_stats(approved)] || $event_stats(waiting) > 0 ) } { + # there are no more spots available + set reg_state "waiting" + } else { + # there are spots left + set reg_state "approved" + + } + } + + # Prepare the variables for instantiation + set extra_vars [ns_set create] + oacs_util::vars_to_ns_set -ns_set $extra_vars -var_list \ + {reg_id event_id user_id reg_state comments} + + # Instantiate the registration, if one doesn't already exist + set new_reg_id [events::registration::exists_for_activity_p -user_id $user_id -event_id $event_id] + if { $new_reg_id==0 } { + set new_reg_id [package_instantiate_object -extra_vars $extra_vars events_registration] + } else { + db_dml update_registration "update events_registrations set reg_state=:reg_state where reg_id=:new_reg_id" + } + + if {[string compare $reg_state "approved"] == 0} { + events::email::request_approved -reg_id $new_reg_id + } + + if {[string compare $reg_state "pending"] == 0} { + events::email::request_pending -reg_id $new_reg_id + events::email::admin_pending -reg_id $new_reg_id + } + + if {[string compare $reg_state "waiting"] == 0} { + events::email::request_waiting -reg_id $new_reg_id + events::email::admin_waiting -reg_id $new_reg_id + } + + return $new_reg_id + } + + ad_proc -public get { + {-reg_id:required} + {-array:required} + } { + get stuffs the following into array: + + } { + # Select the info into the upvar'ed Tcl Array + set date_format [parameter::get -parameter date_format] + set time_format [parameter::get -parameter time_format] + set package_id [ad_conn package_id] + set url [ad_url] + + upvar $array row + db_1row select_registration_info {} -column_array row + } + + ad_proc -public cancel { + {-reg_id:required} + {-email_body:required} + } { + cancel a registration + } { + db_dml cancel_registration {} + events::email::request_canceled -reg_id $reg_id -email_body $email_body + + return $reg_id + } + + ad_proc -public approve { + {-reg_id:required} + } { + cancel a registration + } { + db_dml approve_registration {} + events::email::request_approved -reg_id $reg_id + + return $reg_id + } + + ad_proc -public waiting { + {-reg_id:required} + } { + cancel a registration + } { + db_dml waiting_registration {} + events::email::request_waiting -reg_id $reg_id + + return $reg_id + } + + ad_proc -private exists_p { + {-reg_id:required} + } { + does the registration exist as part of this package instance? + + @return 1 if event exists + } { + set package_id [ad_conn package_id] + return [db_0or1row exists_p_select {}] + } + + ad_proc -public edit_reg_comments { + {-reg_id:required} + {-comments:required} + } { + edit a registration comments + } { + db_dml edit_reg_comments {} + } + + ad_proc -private exists_for_activity_p { + {-user_id:required} + {-event_id:required} + } { + does a registration for this user exist for this event? + + @return 0 if registration doesn't exist, else return reg_id + } { + if { [db_0or1row exists_for_activity_p_select "select reg_id from events_registrations where event_id=:event_id and user_id=:user_id"] } { + return $reg_id + } else { + return 0 + } + } + +# ad_proc -public edit { +# {-reg_id:required} +# {-party_id:required} +# {-reg_state:required} +# } { +# edit a registration +# } { +# db_dml edit_registration {} +# } +# +# ad_proc -public delete { +# {-reg_id:required} +# } { +# delete a registration +# } { +# db_exec_plsql delete_registration {} +# } +# +# ad_proc -public new_attribute { +# {-attribute_name:required} +# {-after ""} +# {-pretty_name:required} +# {-pretty_plural ""} +# {-datatype:required} +# {-category_id:required} +# } { +# create a registration attribute +# +# @return attribute_id +# } { +# set sort_order [events::registration::get_sort_order $category_id] +# set attribute_id [db_exec_plsql create_reg_attribute {}] +# db_dml insert_into_events_attr_category_map {} +# return $attribute_id +# } +# +# ad_proc -public get_attribute { +# {-attribute_id:required} +# {-array:required} +# } { +# get attribute info +# } { +# # Select the info into the upvar'ed Tcl Array +# upvar $array row +# db_1row select_attribute_info {} -column_array row +# } +# +# ad_proc -public edit_attribute { +# {-attribute_id:required} +# {-attribute_name:required} +# {-pretty_name:required} +# {-pretty_plural ""} +# {-datatype:required} +# {-category_id:required} +# } { +# edit a registration attribute +# } { +# db_dml edit_reg_attribute {} +# db_dml edit_reg_attr_category {} +# } +# +# ad_proc -public delete_attribute { +# {-attribute_name:required} +# {-attribute_id:required} +# } { +# delete a registration attribute +# } { +# db_dml del_from_events_attr_category_map {} +# db_exec_plsql drop_reg_attribute {} +# } +# +# ad_proc -public map_attribute { +# {-activity_id ""} +# {-event_id ""} +# {-attribute_id ""} +# {-attribute_id_list ""} +# } { +# map an attribute (or attributes) to an activity/event +# } { +# if {[exists_and_not_null event_id]} { +# db_dml insert_into_events_event_attr_map {} +# } else { +# db_dml insert_into_events_def_actvty_attr_map {} +# } +# } +# +# ad_proc -public unmap_attribute { +# {-attribute_id:required} +# {-activity_id ""} +# {-event_id ""} +# {-attribute_id_list ""} +# } { +# unmap an attribute (or attributes) from an activity/event +# +# @param attribute_id attribute_id to unmap +# } { +# if {[exists_and_not_null event_id]} { +# db_dml delete_from_events_event_attr_map {} +# } else { +# db_dml delete_from_events_def_actvty_attr_map {} +# } +# } +# +# ad_proc -private get_sort_order { +# { category_id } +# } { +# helper proc to get the sort_order for a new registration attribute +# +# @param category_id category for which we're finding sort_order + 1 +# +# @author Michael Steigman (michael@steigman.net) +# } { +# db_1row get_sort_order_max {} +# return [expr $sort_order_max + 1] +# } +} + Index: openacs-4/contrib/packages/events/tcl/registrations-procs.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/events/tcl/registrations-procs.xql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/events/tcl/registrations-procs.xql 9 Mar 2003 12:07:42 -0000 1.1 @@ -0,0 +1,147 @@ + + + + + + update events_registrations + set comments = :comments + where reg_id = :reg_id + + + + + + select 1 + from events_registrations er, + events_activities ea, + acs_events ae + where er.reg_id = :reg_id + and er.event_id = ae.event_id + and ae.activity_id = ea.activity_id + and ea.package_id = :package_id + + + + + + update events_registrations + set reg_state = 'waiting' + where reg_id = :reg_id + + + + + + update events_registrations + set reg_state = 'approved' + where reg_id = :reg_id + + + + + + update events_registrations + set reg_state = 'canceled' + where reg_id = :reg_id + + + + + + update events_registrations + set reg_state = :reg_state, + user_id = :party_id + where reg_id = :reg_id + + + + + + insert into events_attr_category_map + (attribute_id, category_id) + values + (:attribute_id, :category_id) + + + + + + select aa.attribute_id, aa.attribute_name as name, + aa.sort_order, aa.datatype, aa.pretty_name, + aa.pretty_plural, eac.category_name, eac.category_id + from acs_attributes aa, events_attr_categories eac, + events_attr_category_map eacm + where aa.attribute_id = :attribute_id + and aa.attribute_id = eacm.attribute_id + and eacm.category_id = eac.category_id + + f + + + + update acs_attributes + set attribute_name = :attribute_name, + pretty_name = :pretty_name, + pretty_plural = :pretty_plural, + datatype = :datatype + where attribute_id = :attribute_id + + + + + + update events_attr_category_map + set category_id = :category_id + where attribute_id = :attribute_id + + + + + + delete from events_attr_category_map + where attribute_id = :attribute_id + + + + + + insert into events_event_attr_map + (event_id, attribute_id) + values + (:event_id, :attribute_id) + + + + + + insert into events_def_actvty_attr_map + (activity_id, attribute_id) + values + (:activity_id, :attribute_id) + + + + + + delete from events_event_attr_map + where attribute_id = :attribute_id + + + + + + delete from events_def_actvty_attr_map + where attribute_id = :attribute_id + + + + + + select max(aa.sort_order) as sort_order_max + from acs_attributes aa, events_attr_category_map eacm + where category_id = :category_id + and aa.attribute_id = eacm.attribute_id + + + + Index: openacs-4/contrib/packages/events/tcl/security-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/events/tcl/security-procs.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/events/tcl/security-procs.tcl 9 Mar 2003 12:07:42 -0000 1.1 @@ -0,0 +1,117 @@ +ad_library { + + Events Security Library + + each security type has two associated procs, the can_*****_p returns a zero or one if the + party requesting permission has permission in that area. The require_***** proc redirects + the user to the not-allowed page. + + @creation-date 2002-11-04 + @author Matthew Geddert (geddert@yahoo.com) + @cvs-id $Id: + +} + +namespace eval events::security { + + ad_proc -private do_abort {} { + do an abort if security violation + } { + if { [ad_conn user_id] == 0 } { + ad_redirect_for_registration + } else { +# +# if you want it +# implement logging here +# + ad_returnredirect "not-allowed" + } + ad_script_abort + } + +# events permissions + + ad_proc -public can_read_event_p { + {-user_id ""} + {-event_id:required} + } { + return [permission::permission_p -party_id $user_id -object_id $event_id -privilege read] + } + + ad_proc -public require_read_event { + {-user_id ""} + {-event_id:required} + } { + if {![can_read_event_p -user_id $user_id -event_id $event_id]} { + do_abort + } + } + + ad_proc -public can_admin_event_p { + {-user_id ""} + {-event_id:required} + } { + return [permission::permission_p -party_id $user_id -object_id $event_id -privilege admin] + } + + ad_proc -public require_admin_event { + {-user_id ""} + {-event_id:required} + } { + if {![can_admin_event_p -user_id $user_id -event_id $event_id]} { + do_abort + } + } + + ad_proc -public can_register_for_event_p { + {-user_id ""} + {-event_id:required} + } { + return [permission::permission_p -party_id $user_id -object_id $event_id -privilege write] + } + + ad_proc -public require_register_for_event { + {-user_id ""} + {-event_id:required} + } { + if {![can_register_for_event_p -user_id $user_id -event_id $event_id]} { + do_abort + } + } + +# activity permissions + + ad_proc -public can_read_activity_p { + {-user_id ""} + {-activity_id:required} + } { + return [permission::permission_p -party_id $user_id -object_id $activity_id -privilege read] + } + + ad_proc -public require_read_activity { + {-user_id ""} + {-activity_id:required} + } { + if {![can_read_activity_p -user_id $user_id -activity_id $activity_id]} { + do_abort + } + } + + ad_proc -public can_admin_activity_p { + {-user_id ""} + {-activity_id:required} + } { + return [permission::permission_p -party_id $user_id -object_id $activity_id -privilege admin] + } + + ad_proc -public require_admin_activity { + {-user_id ""} + {-activity_id:required} + } { + if {![can_admin_activity_p -user_id $user_id -activity_id $activity_id]} { + do_abort + } + } + +# End of namespace +} Index: openacs-4/contrib/packages/events/tcl/time-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/events/tcl/time-procs.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/events/tcl/time-procs.tcl 9 Mar 2003 12:07:42 -0000 1.1 @@ -0,0 +1,29 @@ +ad_library { + @author Matthew Geddert (geddert@yahoo.com) + @creation-date 2002-11-02 +} + +namespace eval events::time { + + ad_proc -public to_sql_datetime { + {-datetime:required} + } { + This takes a date from a form, and converts it into a format that + the databases like, i.e. + YYYY-MM-DD HH24:MM + } { + + set year [template::util::date::get_property year $datetime] + set month [template::util::date::get_property month $datetime] + set day [template::util::date::get_property day $datetime] + set hours [template::util::date::get_property hours $datetime] + set minutes [template::util::date::get_property minutes $datetime] + + return "$year-$month-$day $hours:$minutes" + + } + +} + + + Index: openacs-4/contrib/packages/events/tcl/venues-procs-oracle.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/events/tcl/venues-procs-oracle.xql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/events/tcl/venues-procs-oracle.xql 9 Mar 2003 12:07:42 -0000 1.1 @@ -0,0 +1,39 @@ + + + + + + declare begin + :1 := acs_object.new ( + object_type => 'events_venue', + creation_user => :user_id, + creation_ip => :creation_ip, + context_id => :context_id + ); + end; + + + + + + declare begin + events_venue.del(:venue_id); + end; + + + + + + select 1 from events_events + where venue_id = :venue_id + and rownum = 1 + + + + + + select 1 from events_venues where $parent_id in ([events::venue::all_parents_or_children -venue_id $child_id -package_id $package_id -sql_p "t" -parent_p "t"]) and rownum = 1 + + + + Index: openacs-4/contrib/packages/events/tcl/venues-procs-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/events/tcl/venues-procs-postgresql.xql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/events/tcl/venues-procs-postgresql.xql 9 Mar 2003 12:07:42 -0000 1.1 @@ -0,0 +1,60 @@ + + + + + + select acs_object__new ( + null, + 'events_venue', + now(), + :user_id, + :creation_ip, + :context_id + ) + + + + + + select events_venue__new( + :venue_id, + 'events_venue', + :venue_name, + :address1, + :address2, + :city, + :phone_number, + :fax_number, + :email, + :needs_reserve_p, + :max_people, + :description, + :creation_date, + null, + null, + null, + ) + + + + + + select events_venue__delete(:venue_id); + + + + + + select 1 from events_events + where venue_id = :venue_id + limit 1 + + + + + + select 1 from events_venues where $parent_id in ([events::venue::all_parents_or_children -venue_id $child_id -package_id $package_id -sql_p "t" -parent_p "t"]) limit 1 + + + + Index: openacs-4/contrib/packages/events/tcl/venues-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/events/tcl/venues-procs.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/events/tcl/venues-procs.tcl 9 Mar 2003 12:07:42 -0000 1.1 @@ -0,0 +1,573 @@ +ad_library { + + Venue Library + + @creation-date 2002-07-23 + @author Michael Steigman (michael@steigman.net) + @cvs-id $Id: venues-procs.tcl,v 1.1 2003/03/09 12:07:42 lars Exp $ + +} + +namespace eval events::venue { + + ad_proc -public new { + {-venue_id ""} + {-package_id ""} + {-venue_name:required} + {-address1 ""} + {-address2 ""} + {-city:required} + {-usps_abbrev ""} + {-postal_code ""} + {-time_zone ""} + {-iso ""} + {-phone_number ""} + {-fax_number ""} + {-email ""} + {-needs_reserve_p ""} + {-max_people ""} + {-description ""} + } { + create a new venue + + @return new venue_id + } { + # Prepare the variables for instantiation + set extra_vars [ns_set create] + + set user_id [ad_conn user_id] + set context_id [ad_conn package_id] + set creation_ip [ad_conn peeraddr] + + db_transaction { + set venue_id [db_exec_plsql new_acs_venue {}] + + set extra_vars [ns_set create] + oacs_util::vars_to_ns_set -ns_set $extra_vars -var_list {venue_id package_id venue_name address1 address2 city usps_abbrev postal_code time_zone iso phone_number fax_number email needs_reserve_p max_people description} + + set var_list [list [list context_id [ad_conn package_id]]] + + # Instantiate the venue + set rval [package_instantiate_object -var_list $var_list -extra_vars $extra_vars events_venue] + } + + return $rval + } + + ad_proc -public edit { + {-venue_id:required} + {-venue_name:required} + {-address1 ""} + {-address2 ""} + {-city:required} + {-usps_abbrev ""} + {-postal_code ""} + {-time_zone ""} + {-iso ""} + {-phone_number ""} + {-fax_number ""} + {-email ""} + {-needs_reserve_p ""} + {-max_people ""} + {-description ""} + } { + edit a venue + } { + db_dml update_events_venues {} + } + + ad_proc -public get { + {-venue_id:required} + {-array:required} + } { + get stuffs the following into array: +

+

+ } { + upvar $array row + db_1row select_venue_info {} -column_array row + } + + ad_proc -public delete { + {-venue_id:required} + } { + delete a venue + } { + db_exec_plsql delete_venue {} + } + + ad_proc -public in_use_p { + {-venue_id:required} + } { + is the venue being used? + + @return 1 if venue is being used by an event + } { + return [db_0or1row in_use_p_select {}] + } + + ad_proc -private exists_p { + {-venue_id:required} + } { + does the venue exist? + + @return 1 if venue exists + } { + return [db_0or1row exists_p_select {}] + } + + ad_proc -private venues_get_options { + {-package_id ""} + } { + returns a list of lists suitable for use in a form + + @return list of lists {venue_name, venue_id} + } { + # should filter by package_id + return [db_list_of_lists select_venues {}] + } + + ad_proc -private unsafe_parental_relationship_p { + {-parent_id:required} + {-child_id:required} + {-package_id ""} + } { + will there be a safe parental relationship between this parent and child venue in this package? + + @return 1 if there will not be a safe parental relationship + } { + if { [empty_string_p $package_id] } { + set package_id [ad_conn package_id] + } + + if { $parent_id == $child_id } { + # Can't have a child of one-self + return 1 + } else { + if { [events::venue::child_of_p -parent_id $parent_id -child_id $child_id -package_id $package_id] || [events::venue::child_of_p -parent_id $child_id -child_id $parent_id -package_id $package_id] } { + # Can't be a parent of already a child, also can't be a parent if already a parent + return 1 + } + } + return 0 + } + + ad_proc -private child_of_p { + {-parent_id:required} + {-child_id:required} + {-package_id ""} + } { + is this child a child of this parent in this package? + + @return 1 if this child is a child of this parent + } { + set rval 0 + + if { [empty_string_p $package_id] } { + set package_id [ad_conn package_id] + } + + if { [db_0or1row select_parents {}] } { + set rval 1 + } + return $rval + } + + ad_proc -public make_child_of { + {-parent_id:required} + {-child_id:required} + {-package_id ""} + } { + make this child a child of this parent for this package. + } { + if { [empty_string_p $package_id] } { + set package_id [ad_conn package_id] + } + + if { ![db_0or1row check_venue_one {}] || ![db_0or1row check_venue_two {}] } { + ad_return_complaint 1 "You must choose two valid venues to make a relationship." + ad_script_abort + } + + if { ![unsafe_parental_relationship_p -parent_id $parent_id -child_id $child_id -package_id $package_id] } { + # It's ok to do this + db_dml insert_relationship {} + } else { + ad_return_complaint 1 "This addition either already exists, or will cause a circular relationship, and cannot be done." + ad_script_abort + } + } + + ad_proc -private unsafe_connecting_relationship_p { + {-left_id:required} + {-right_id:required} + {-package_id ""} + } { + will there be a safe connecting relationship between this left and right venue in this package? + + @return 1 if there will not be a safe connecting relationship + } { + if { [empty_string_p $package_id] } { + set package_id [ad_conn package_id] + } + + if { $left_id == $right_id } { + # Can't connect to one's self + return 1 + } else { + if { [events::venue::connected_p -left_id $left_id -right_id $right_id -package_id $package_id] } { + # Can't be a left of an already right, also can't be a left if already a left + return 1 + } + } + return 0 + } + + ad_proc -private right_of_p { + {-left_id:required} + {-right_id:required} + {-package_id ""} + } { + is this right a right of this left in this package? + + @return 1 if this right is a right of this left + } { + set rval 0 + + if { [empty_string_p $package_id] } { + set package_id [ad_conn package_id] + } + + if { [db_0or1row select_starting_point {}] } { + set rval 1 + } + return $rval + } + + ad_proc -public connect { + {-left_id:required} + {-right_id:required} + {-package_id ""} + } { + connect this left and right venues together for this package. + } { + if { [empty_string_p $package_id] } { + set package_id [ad_conn package_id] + } + + if { ![db_0or1row check_venue_one {}] || ![db_0or1row check_venue_two {}] } { + ad_return_complaint 1 "You must choose two valid venues to make a relationship." + ad_script_abort + } + + if { ![unsafe_connecting_relationship_p -left_id $left_id -right_id $right_id -package_id $package_id] } { + # It's ok to do this + db_dml insert_relationship {} + } else { + ad_return_complaint 1 "This addition either already exists, or will cause a circular relationship, and cannot be done." + ad_script_abort + } + } + + ad_proc -public disconnect { + {-left_id:required} + {-right_id:required} + {-package_id ""} + } { + disconnect this left venue from this right venues in this package. + } { + if { [empty_string_p $package_id] } { + set package_id [ad_conn package_id] + } + + if { ![db_0or1row check_venue_one {}] || ![db_0or1row check_venue_two {}] } { + ad_return_complaint 1 "You must choose two valid venues to remove a relationship." + ad_script_abort + } + + if { [events::venue::connected_p -left_id $left_id -right_id $right_id -package_id $package_id] } { + # It's ok to do this + db_dml delete_relationship {} + } else { + ad_return_complaint 1 "These venues are not connected." + ad_script_abort + } + } + + ad_proc -public connecting { + {-venue_id:required} + {-package_id ""} + {-sql_p "f"} + } { + return any and all connecting venues or null or '' (if sql_p) if there aren't any. + + @return any and all connecting venues + } { + set rval "" + + if { [empty_string_p $package_id] } { + set package_id [ad_conn package_id] + } + + db_foreach select_venues {} { + if { [events::venue::connected_p -left_id $venue_id -right_id $this_venue_id -package_id $package_id] } { + if { ![empty_string_p $rval] } { + append rval ", " + } else { + append rval " " + } + if { $sql_p } { + append rval $this_venue_id + } else { + append rval $venue_name + } + } + } + + if { $sql_p && [empty_string_p $rval] } { + return "''" + } else { + return $rval + } + } + + ad_proc -public connected_p { + {-left_id:required} + {-right_id:required} + {-package_id ""} + } { + are these venues directly connected in this package? + + @return 1 if these venues are directly connected + } { + if { [empty_string_p $package_id] } { + set package_id [ad_conn package_id] + } + + if { [events::venue::right_of_p -left_id $right_id -right_id $left_id -package_id $package_id] || [events::venue::right_of_p -left_id $left_id -right_id $right_id -package_id $package_id] } { + # It was found + return 1 + } else { + return 0 + } + } + + ad_proc -private parents_or_children { + {-venue_id:required} + {-package_id ""} + {-parent_p "f"} + } { + return all initial parent or children venues or null if there aren't any. + + @return all initial parent or children venues + } { + set rval "" + + if { [empty_string_p $package_id] } { + set package_id [ad_conn package_id] + } + + if { $parent_p } { + # We want a list of parents + db_foreach select_parents {} { + if { ![empty_string_p $rval] } { + append rval " " + } + append rval $venue_1 + } + } else { + # We want a list of children + db_foreach select_children {} { + if { ![empty_string_p $rval] } { + append rval " " + } + append rval $venue_1 + } + } + + return $rval + } + + ad_proc -public all_parents_or_children { + {-venue_id:required} + {-package_id ""} + {-parent_p "f"} + {-sql_p "f"} + } { + return ALL parent or children venues or null if there aren't any. + + @return any and all parent or children venues + } { + set list_of_children [parents_or_children -venue_id $venue_id -package_id $package_id -parent_p $parent_p] + set rval $list_of_children + for { set i 0 } { $i < [llength $list_of_children] } { incr i } { + set new_rval [all_parents_or_children -venue_id [lindex $list_of_children $i] -package_id $package_id -parent_p $parent_p -sql_p $sql_p] + if { ![empty_string_p $new_rval] } { + lappend rval $new_rval + } + } + regsub -all {[{}]} $rval "" rval + + if { $sql_p } { + if { [empty_string_p $rval] } { + return "''" + } else { + regsub -all " " $rval "," rval + } + } + return $rval + } + + ad_proc -public venues_get_connecting_options { + {-this_venue_id:required} + {-package_id ""} + {-connecting "f"} + {-none_p "t"} + } { + build options list for connecting venues + } { + if { [empty_string_p $package_id] } { + set package_id [ad_conn package_id] + } + + set venue_list [list] + + db_foreach select_venues {} { + if { $connecting } { + if { ![events::venue::connected_p -left_id $this_venue_id -right_id $venue_id -package_id $package_id] } { + lappend venue_list [list $venue_name $venue_id] + } + } else { + if { [events::venue::connected_p -left_id $this_venue_id -right_id $venue_id -package_id $package_id] } { + lappend venue_list [list $venue_name $venue_id] + } + } + } + if { $none_p } { + set venue_list [concat $venue_list {{ "None" "" }}] + } + return $venue_list + } + + ad_proc -private connected { + {-event_id:required} + {-venue_id:required} + {-package_id ""} + {-sql_p "t"} + } { + returns list of already connected venues + } { + set rval "" + + if { [empty_string_p $package_id] } { + set package_id [ad_conn package_id] + } + + db_foreach select_connecting {} { + if { $sql_p } { + lappend rval $connected_venue_id + } else { + lappend rval $connected_venue_name + } + } + + if { $sql_p } { + if { [empty_string_p $rval] } { + set rval "''" + } else { + regsub -all " " $rval ", " rval + } + } + + return $rval + } + + ad_proc -public venues_get_hierarchy_options { + {-this_venue_id:required} + {-package_id ""} + {-parent_p "t"} + {-add_p "f"} + } { + build options list for 'parentizing' or 'childizing' venues + } { + if { [empty_string_p $package_id] } { + set package_id [ad_conn package_id] + } + + set venue_list [list] + + db_foreach select_venues {} { + if { $add_p } { + if { ![events::venue::child_of_p -parent_id $this_venue_id -child_id $venue_id -package_id $package_id] && ![events::venue::child_of_p -parent_id $venue_id -child_id $this_venue_id -package_id $package_id] } { + lappend venue_list [list $venue_name $venue_id] + } + } else { + if { $parent_p } { + if { [events::venue::child_of_p -parent_id $venue_id -child_id $this_venue_id -package_id $package_id] } { + lappend venue_list [list $venue_name $venue_id] + } + } else { + if { [events::venue::child_of_p -parent_id $this_venue_id -child_id $venue_id -package_id $package_id] } { + lappend venue_list [list $venue_name $venue_id] + } + } + } + } + set venue_list [concat $venue_list {{ "None" "" }}] + return $venue_list + } + + ad_proc -public dechildize { + {-parent_id:required} + {-child_id:required} + {-package_id ""} + } { + removes the child from this parent and fixes any subtrees accordingly + } { + if { [empty_string_p $package_id] } { + set package_id [ad_conn package_id] + } + + if { [events::venue::child_of_p -parent_id $parent_id -child_id $child_id -package_id $package_id] } { + db_dml delete_child {} + } + } + + ad_proc -public connecting_max { + {-event_id:required} + {-venue_id:required} + {-package_id ""} + } { + if { [empty_string_p $package_id] } { + set package_id [ad_conn package_id] + } + + # Connecting venues - this query must remain in the .tcl proc + if { [db_0or1row select_connecting_max "select sum(max_people) as max from events_venues where venue_id=:venue_id or venue_id in ([events::venue::connected -event_id $event_id -venue_id $venue_id -package_id $package_id])"] } { + set rval $max + } + + # Parental venues + if { [db_0or1row select_parents {}] && ![empty_string_p $min] && $min<$rval } { + set rval $min + } + + return $rval + } + +} \ No newline at end of file Index: openacs-4/contrib/packages/events/tcl/venues-procs.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/events/tcl/venues-procs.xql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/events/tcl/venues-procs.xql 9 Mar 2003 12:07:42 -0000 1.1 @@ -0,0 +1,156 @@ + + + + + + update events_venues + set venue_name = :venue_name, + address1 = :address1, + address2 = :address2, + city = :city, + usps_abbrev = :usps_abbrev, + postal_code = :postal_code, + iso = :iso, + time_zone = :time_zone, + phone_number = :phone_number, + fax_number = :fax_number, + email = :email, + needs_reserve_p = :needs_reserve_p, + max_people = :max_people, + description = :description + where venue_id = :venue_id + + + + + + select venue_name, address1, address2, city, usps_abbrev, postal_code, iso, + time_zone, phone_number, fax_number, email, + needs_reserve_p, max_people, description + from events_venues + where venue_id = :venue_id + + + + + + select 1 from events_venues where venue_id = :venue_id + + + + + + select venue_name, venue_id + from events_venues + + + + + + select venue_id from events_venues where venue_id=:parent_id and package_id=:package_id + + + + + + select venue_id from events_venues where venue_id=:child_id and package_id=:package_id + + + + + + insert into events_venues_venues_map (parent_venue_id, child_venue_id, package_id) values (:parent_id, :child_id, :package_id) + + + + + + select right_venue_id from events_venues_connecting_map where right_venue_id=:right_id and left_venue_id=:left_id and package_id=:package_id + + + + + + select venue_id from events_venues where venue_id=:left_id and package_id=:package_id + + + + + + select venue_id from events_venues where venue_id=:right_id and package_id=:package_id + + + + + + insert into events_venues_connecting_map (left_venue_id, right_venue_id, package_id) values (:left_id, :right_id, :package_id) + + + + + + select venue_id from events_venues where venue_id=:left_id and package_id=:package_id + + + + + + select venue_id from events_venues where venue_id=:right_id and package_id=:package_id + + + + + + delete from events_venues_connecting_map where package_id=:package_id and ((left_venue_id=:left_id and right_venue_id=:right_id) or (right_venue_id=:left_id and left_venue_id=:right_id)) + + + + + + select venue_id as this_venue_id, venue_name from events_venues where package_id=:package_id and venue_id<>:venue_id order by venue_name, venue_id + + + + + + select parent_venue_id as venue_1, child_venue_id as venue_2 from events_venues_venues_map where child_venue_id=$venue_id and package_id=$package_id + + + + + + select child_venue_id as venue_1, parent_venue_id as venue_2 from events_venues_venues_map where parent_venue_id=$venue_id and package_id=$package_id + + + + + + select venue_id, venue_name from events_venues where package_id=:package_id + + + + + + select venue_id, venue_name from events_venues where venue_id<>:this_venue_id and package_id=:package_id + + + + + + delete from events_venues_venues_map where child_venue_id=:child_id and (parent_venue_id=:parent_id or parent_venue_id in ([events::venue::all_parents_or_children -venue_id $parent_id -parent_p "f" -sql_p "t"])) and package_id=:package_id + + + + + + select connected_venue_id, events_venues.venue_name as connected_venue_name from events_venues_conn_used_map, events_venues where events_venues_conn_used_map.event_id=:event_id and events_venues_conn_used_map.venue_id=:venue_id and events_venues_conn_used_map.package_id=:package_id and events_venues_conn_used_map.connected_venue_id=events_venues.venue_id + + + + + + select min(max_people) as min from events_venues where venue_id in ([events::venue::all_parents_or_children -venue_id $venue_id -parent_p "t" -sql_p "t"]) + + + + \ No newline at end of file Index: openacs-4/contrib/packages/events/www/activity-oracle.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/events/www/activity-oracle.xql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/events/www/activity-oracle.xql 9 Mar 2003 12:08:08 -0000 1.1 @@ -0,0 +1,35 @@ + + + + + select e.event_id, v.city, t.start_date, + CASE WHEN to_char(t.start_date, 'YYYY-MM-DD') = to_char(t.end_date, 'YYYY-MM-DD') + THEN to_char(t.start_date, :date_format) || ' (' || to_char(t.start_date, :time_format) || ' - ' || to_char(t.end_date, :time_format) || ')' + ELSE to_char(t.start_date, :date_format) || ' ' || to_char(t.start_date, :time_format) || ' - ' || to_char(t.end_date, :date_format) || ' ' || to_char(t.end_date, :time_format) + END as timespan + from acs_events ae, + acs_activities aa, + dual, + events_events e, + events_activities a, + events_venues v, + timespans s, + time_intervals t + where aa.activity_id = :activity_id + and aa.activity_id = a.activity_id + and a.activity_id = ae.activity_id + and ae.event_id = e.event_id + and e.available_p <> 'f' + and t.start_date > sysdate + and v.venue_id = e.venue_id + and ae.timespan_id = s.timespan_id + and s.interval_id = t.interval_id + and acs_permission.permission_p( + e.event_id, + nvl(:user_id, acs.magic_object_id('the_public')), + 'read') = 't' + order by t.start_date + + + + Index: openacs-4/contrib/packages/events/www/activity-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/events/www/activity-postgresql.xql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/events/www/activity-postgresql.xql 9 Mar 2003 12:08:08 -0000 1.1 @@ -0,0 +1,35 @@ + + + + + select e.event_id, v.city, t.start_date, + CASE WHEN to_char(t.start_date, 'YYYY-MM-DD') = to_char(t.end_date, 'YYYY-MM-DD') + THEN to_char(t.start_date, :date_format) || ' (' || to_char(t.start_date, :time_format) || ' - ' || to_char(t.end_date, :time_format) || ')' + ELSE to_char(t.start_date, :date_format) || ' ' || to_char(t.start_date, :time_format) || ' - ' || to_char(t.end_date, :date_format) || ' ' || to_char(t.end_date, :time_format) + END as timespan + from acs_events ae, + acs_activities aa, + dual, + events_events e, + events_activities a, + events_venues v, + timespans s, + time_intervals t + where aa.activity_id = :activity_id + and aa.activity_id = a.activity_id + and a.activity_id = ae.activity_id + and ae.event_id = e.event_id + and e.available_p <> 'f' + and t.start_date > sysdate + and v.venue_id = e.venue_id + and ae.timespan_id = s.timespan_id + and s.interval_id = t.interval_id + and acs_permission__permission_p( + e.event_id, + coalesce(:user_id, acs__magic_object_id('the_public')), + 'read') = 't' + order by t.start_date + + + + Index: openacs-4/contrib/packages/events/www/activity.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/events/www/activity.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/events/www/activity.adp 9 Mar 2003 12:08:08 -0000 1.1 @@ -0,0 +1,27 @@ + +Upcoming Events for @activity_info.name@ +@context@ + + + +

[Administer This Activity]

+
+ +

@activity_info.name@ Info:

+ +@activity_info.description@ + + +

Upcoming Events for This Activity

+ +
+ + + + + + Index: openacs-4/contrib/packages/events/www/activity.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/events/www/activity.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/events/www/activity.tcl 9 Mar 2003 12:08:08 -0000 1.1 @@ -0,0 +1,44 @@ +# events/www/activity.tcl + +ad_page_contract { + Takes in an activity_id, displays the related activity + to the user and shows all upcoming events for this activity. + + @param activity_id the activity in which we're interested + + @author Bryan Che (bryanche@arsdigita.com) + @cvs_id $Id: activity.tcl,v 1.1 2003/03/09 12:08:08 lars Exp $ +} { + {activity_id:naturalnum,notnull} +} -properties { + upcoming_events:multirow +} -validate { + activity_exists -requires {activity_id} { + if { ![db_0or1row activity_exists {}] } { + ad_complain "We couldn't find the activity you asked for." + return 0 + } + return 1 + } +} + + +events::security::require_read_activity -activity_id $activity_id +set admin_p [events::security::can_admin_activity_p -activity_id $activity_id] + +events::activity::get -activity_id $activity_id -array activity_info + +set context [list $activity_info(name)] +set title $activity_info(name) +set user_id [ad_verify_and_get_user_id] + +if { [string equal $activity_info(available_p) f] } { + ad_return_template "unavailable" +} + +set date_format [parameter::get -parameter date_format -default "MM/DD/YYYY"] +set time_format [parameter::get -parameter time_format -default "HH12:MIam"] + +db_multirow upcoming_events select_upcoming_events {} + +ad_return_template Index: openacs-4/contrib/packages/events/www/activity.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/events/www/activity.xql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/events/www/activity.xql 9 Mar 2003 12:08:08 -0000 1.1 @@ -0,0 +1,12 @@ + + + + + + select 1 + from events_activities + where activity_id = :activity_id + + + + Index: openacs-4/contrib/packages/events/www/event-info.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/events/www/event-info.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/events/www/event-info.adp 9 Mar 2003 12:08:08 -0000 1.1 @@ -0,0 +1,116 @@ + +@event_info.name@ +@context@ + + + +

[Administer This Event]

+
+ + + +

You are already registered for @event_info.name@

+

+ If you'd like, you may: +

+

+
+ + +

About the Event

+ + + + + + + + + + + + + + + + + + + + + + + + + +<% if { [llength $organizers] > 0 } { %> + + + + +<% } %> + + + + + + + + + + + +
When@event_info.timespan@ + ( view other times )
Where@event_info.city@ (you'll get specifics after you register)
Registration DeadlineThe deadline to register for this event was @event_info.reg_deadline@
Registration Deadline@event_info.reg_deadline@
Organizers +
    +<% + foreach organizer $organizers { + if {![empty_string_p [lindex $organizer 4]]} { + template::adp_puts "
  • [lindex $organizer 0]: [lindex $organizer 3]
  • " + } else { + template::adp_puts "
  • [lindex $organizer 0]: [lindex $organizer 3]
  • " + } + } +%> +
+
Event Agenda/Attachments + +
Related Web Site@detail_url@
+ +

+@event_info.description@ + + + + + + + +

+ + + + + + + +
  • You do not have permission to register for this Event
+
+
+ +
  • You must first login before you can register for this Event
+
+
+ + Index: openacs-4/contrib/packages/events/www/event-info.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/events/www/event-info.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/events/www/event-info.tcl 9 Mar 2003 12:08:08 -0000 1.1 @@ -0,0 +1,62 @@ +# events/www/event-info.tcl + +ad_page_contract { + Displays event info + + @author Michael Steigman (michael@steigman.net) + @author Bryan Che (bryanche@arsdigita.com) + @cvs_id $Id: event-info.tcl,v 1.1 2003/03/09 12:08:08 lars Exp $ + +} { + {event_id:naturalnum,notnull} +} -validate { + event_exists_p -requires {event_id} { + if { ![events::event::exists_p -event_id $event_id] } { + ad_complain "We couldn't find the event you asked for." + return 0 + } + return 1 + } +} + +set user_id [ad_verify_and_get_user_id] + +if { [events::event::reg_deadline_elapsed_p -event_id $event_id] } { + set reg_deadline_has_passed_p t +} else { + set reg_deadline_has_passed_p f +} + +events::security::require_read_event -event_id $event_id +set admin_p [events::security::can_admin_event_p -event_id $event_id] +set can_register_p [events::security::can_register_for_event_p -event_id $event_id] + +events::event::get -event_id $event_id -array event_info + +db_0or1row get_reg_id {} +if {[exists_and_not_null reg_id]} { + set title "Already registered for $event_info(name)" +} else { + set title "$event_info(name) in $event_info(city) on $event_info(timespan)" + set reg_id "0" +} + + +set organizers [list] +db_foreach select_organizers {} { + lappend organizers [list $role $role_id $user_id $organizer_name [db_string select_bio {} -default ""]] +} + +set attachments_enabled_p [events::event::attachments_enabled_p] +if {$attachments_enabled_p} { + set attachments [attachments::get_attachments -object_id $event_id] +} + +set detail_url "[ad_convert_to_html $event_info(detail_url)]" +if { ![ad_looks_like_html_p $detail_url] } { + set detail_url "$detail_url" +} +set title "$event_info(name) in $event_info(city) on $event_info(timespan)" +set context [list "$event_info(name) in $event_info(city)"] + +ad_return_template Index: openacs-4/contrib/packages/events/www/event-info.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/events/www/event-info.xql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/events/www/event-info.xql 9 Mar 2003 12:08:08 -0000 1.1 @@ -0,0 +1,38 @@ + + + + + + select reg_id + from events_registrations + where event_id = :event_id + and user_id = :user_id + and reg_state <> 'canceled' + + + + + + select eo.role, eo.user_id, eo.role_id, + u.first_names || ' ' || u.last_name as organizer_name + from events_organizers eo, cc_users u + where eo.event_id = :event_id + and eo.public_role_p = 't' + and u.user_id = eo.user_id + + + + + + select attr_value + from acs_attribute_values + where object_id = :user_id + and attribute_id = + (select attribute_id + from acs_attributes + where object_type = 'person' + and attribute_name = 'bio') + + + + Index: openacs-4/contrib/packages/events/www/index-oracle.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/events/www/index-oracle.xql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/events/www/index-oracle.xql 9 Mar 2003 12:08:08 -0000 1.1 @@ -0,0 +1,35 @@ + + + + + + select a.activity_id, e.event_id, aa.name, v.city, + CASE WHEN to_char(t.start_date, 'YYYY-MM-DD') = to_char(t.end_date, 'YYYY-MM-DD') + THEN to_char(t.start_date, :date_format) || ' (' || to_char(t.start_date, :time_format) || ' - ' || to_char(t.end_date, :time_format) || ')' + ELSE to_char(t.start_date, :date_format) || ' ' || to_char(t.start_date, :time_format) || ' - ' || to_char(t.end_date, :date_format) || ' ' || to_char(t.end_date, :time_format) + END as timespan + from acs_events ae, + acs_activities aa, + dual, + events_events e, + events_activities a, + events_venues v, + timespans s, + time_intervals t + where a.package_id = :package_id + and ae.event_id = e.event_id + and ae.activity_id = a.activity_id + and a.activity_id = aa.activity_id + and e.reg_deadline > sysdate + and e.available_p <> 'f' + and v.venue_id = e.venue_id + and ae.timespan_id = s.timespan_id + and s.interval_id = t.interval_id + and acs_permission.permission_p( + e.event_id, + nvl(:user_id, acs.magic_object_id('the_public')), + 'read') = 't' + order by t.start_date + + + Index: openacs-4/contrib/packages/events/www/index-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/events/www/index-postgresql.xql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/events/www/index-postgresql.xql 9 Mar 2003 12:08:08 -0000 1.1 @@ -0,0 +1,35 @@ + + + + + + select a.activity_id, e.event_id, aa.name, v.city, + CASE WHEN to_char(t.start_date, 'YYYY-MM-DD') = to_char(t.end_date, 'YYYY-MM-DD') + THEN to_char(t.start_date, :date_format) || ' (' || to_char(t.start_date, :time_format) || ' - ' || to_char(t.end_date, :time_format) || ')' + ELSE to_char(t.start_date, :date_format) || ' ' || to_char(t.start_date, :time_format) || ' - ' || to_char(t.end_date, :date_format) || ' ' || to_char(t.end_date, :time_format) + END as timespan + from acs_events ae, + acs_activities aa, + dual, + events_events e, + events_activities a, + events_venues v, + timespans s, + time_intervals t + where a.package_id = :package_id + and ae.event_id = e.event_id + and ae.activity_id = a.activity_id + and a.activity_id = aa.activity_id + and e.reg_deadline > sysdate + and e.available_p <> 'f' + and v.venue_id = e.venue_id + and ae.timespan_id = s.timespan_id + and s.interval_id = t.interval_id + and acs_permission__permission_p( + e.event_id, + coalesce(:user_id, acs__magic_object_id('the_public')), + 'read') = 't' + order by t.start_date + + + Index: openacs-4/contrib/packages/events/www/index.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/events/www/index.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/events/www/index.adp 9 Mar 2003 12:08:08 -0000 1.1 @@ -0,0 +1,21 @@ + +Upcoming Events +@context@ + + +
[ Administer Events ]
+
+ + +

Upcoming Events

+ +
    + + +
  • @events.name@ in @events.city@ - @events.timespan@
  • +
    +
    + +
  • There are no events currently available.
  • +
    +
Index: openacs-4/contrib/packages/events/www/index.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/events/www/index.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/events/www/index.tcl 9 Mar 2003 12:08:08 -0000 1.1 @@ -0,0 +1,33 @@ +# /events/www/index.tcl + +ad_page_contract { + + Displays all upcoming events and the breakdown of registrations + for them. Offers various admin options, such as looking at + registration stats or available venues/activities. New event + creation, and checking out/editing events not currently available to + the public, must be done through subsidiary pages. + @param orderby for ad_table + + @author Michael Steigman (michael@steigman.net) + @author Bryan Che (bryanche@arsdigita.com) + @cvs-id $Id index.tcl,v 3.19.2.5 2000/09/22 01:37:37 kevin Exp $ +} { +} -properties { + select_event_info:multirow + context_bar:onevalue + admin_p:onevalue + package_id:onevalue +} + +set context {} +set user_id [ad_verify_and_get_user_id] +set package_id [ad_conn package_id] +set admin_p [ad_permission_p $package_id admin] + +set date_format [parameter::get -parameter date_format -default "MM/DD/YYYY"] +set time_format [parameter::get -parameter time_format -default "HH12:MIam"] + +db_multirow events select_event_info {} + +ad_return_template Index: openacs-4/contrib/packages/events/www/order-cancel.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/events/www/order-cancel.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/events/www/order-cancel.adp 9 Mar 2003 12:08:08 -0000 1.1 @@ -0,0 +1,6 @@ + + +@title@ +@context@ + + Index: openacs-4/contrib/packages/events/www/order-cancel.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/events/www/order-cancel.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/events/www/order-cancel.tcl 9 Mar 2003 12:08:08 -0000 1.1 @@ -0,0 +1,102 @@ +# events/www/order-cancel.tcl +ad_page_contract { + + Purpose: Give users the option of cancelling a registration. + + @param reg_id the registration to cancel + + @author Matthew Geddert (geddert@yahoo.com) + @author Bryan Che (bryanche@arsdigita.com) + @creation date 2002-11-11 + +} { + {reg_id:naturalnum,notnull} +} -validate { + registration_exists_p -requires {reg_id} { + if { ![events::registration::exists_p -reg_id $reg_id] } { + ad_complain "We could not find the registration you asked for." + return 0 + } + return 1 + } +} + +set user_id [ad_verify_and_get_user_id] +ad_maybe_redirect_for_registration + +if { ![db_0or1row reg_exists {}] } { + ad_return_warning "Could Not Find Registration" "We could not find the + registration you asked for, or the registration you + ask for does not belong to you." +} + +events::registration::get -reg_id $reg_id -array reg_info +events::event::get -event_id $reg_info(event_id) -array event_info +events::venue::get -venue_id $event_info(venue_id) -array venue_info + +if {[string compare $event_info(reg_cancellable_p) "f"] == 0} { + if {[string compare $reg_info(reg_state) "approved"] == 0} { + ad_return_warning "This Registration Cannot Be Canceled" "Since this registration has been + approved, you may not cancel it through this website." + + } +} + +set title "Cancel Your Registration for $event_info(name)" +set context [list [list "event-info?event_id=$reg_info(event_id)" "$event_info(name) in $venue_info(city)"] "Cancel Your Registration"] + + +form create confirm_cancel + +element create confirm_cancel reg_id \ + -datatype integer \ + -widget hidden \ + -value $reg_id + +element create confirm_cancel user_name \ + -label "Your Name" \ + -datatype text \ + -widget inform \ + -value "
$reg_info(user_name) \[not you? login as somebody else\]
" + +element create confirm_cancel inform_of_cancel \ + -label "Action" \ + -datatype text \ + -widget inform \ + -value "Cancel my reservation for $event_info(name)" + +element create confirm_cancel inform_of_action \ + -label "Warning" \ + -datatype text \ + -widget inform \ + -value "This action is irreversible. You may choose to re-register for this event at a later time, but you will be placed at the end of the waiting list." + +element create confirm_cancel confirm_p \ + -label "Are you sure you want to cancel?" \ + -datatype text \ + -widget radio \ + -options {{yes t} {no f}} + +if {[template::form is_valid confirm_cancel]} { + template::form get_values confirm_cancel reg_id confirm_p + + + if {[string compare $confirm_p "t"] == 0} { + + set email_body "$reg_info(user_name),\n\n" + append email_body "As per your request, your registration for $event_info(name) has been canceled.\n\n" + append email_body "If you change your mind, you may place a new registration for this event here:\n" + append email_body "$reg_info(package_url)order-one?event_id=$reg_info(event_id)" + + events::registration::cancel -reg_id $reg_id -email_body $email_body + events::email::admin_canceled -reg_id $reg_id + + } + +ad_returnredirect "order-check?reg_id=$reg_id" +ad_script_abort + +} + +ad_return_template + Index: openacs-4/contrib/packages/events/www/order-cancel.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/events/www/order-cancel.xql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/events/www/order-cancel.xql 9 Mar 2003 12:08:08 -0000 1.1 @@ -0,0 +1,13 @@ + + + + + + select 1 + from events_registrations + where reg_id = :reg_id + and user_id = :user_id + + + + Index: openacs-4/contrib/packages/events/www/order-check.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/events/www/order-check.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/events/www/order-check.adp 9 Mar 2003 12:08:08 -0000 1.1 @@ -0,0 +1,61 @@ + +@title@ +@context@ + + +@reg_info.user_name@, +

+ + + Your place is reserved for @event_info.name@. +

+ @event_info.display_after@ +

+

About @event_info.name@

+ + + + + + + + + +
When@event_info.timespan@ + ( view other times )
Where@venue_info.venue_name@ +
@venue_info.address1@
+
@venue_info.address2@
+ +
@venue_info.city@ @venue_info.usps_abbrev@ +
+

+ @venue_info.description@ +

+

+ + If you would like to, you may cancel your registration. + + + + + Thank you for your interest in @event_info.name@. This + event requires final approval for your registration from one of the + event organizers. You have been placed on a registration queue, and + we will notify you by e-mail once your registrating status changes. +

+ If you would like to, you may cancel your request. + + + + Thank you for your interest in @event_info.name@. Unfortunately, + all spaces for this event were filled before you applied. Thus, you have + been placed on a waiting list. We will notify you by e-mail if your + registration status changes. +

+ If you would like to, you may cancel your registration. + + + + Your registration has been canceled. If you want, you may + place a new registration. + Index: openacs-4/contrib/packages/events/www/order-check.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/events/www/order-check.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/events/www/order-check.tcl 9 Mar 2003 12:08:08 -0000 1.1 @@ -0,0 +1,45 @@ +# events/www/order-check.tcl + +ad_page_contract { + Allows users to check the status of an order/registration + + @param reg_id The registration to check + + @author Matthew Geddert (geddert@yahoo.com) + @creation date 2002-11-10 + @original OpenACS 3.x version author Bryan Che (bryanche@arsdigita.com) + + +} { + {reg_id:naturalnum,notnull} +} -validate { + registration_exists_p -requires {reg_id} { + if { ![events::registration::exists_p -reg_id $reg_id] } { + ad_complain "We could not find the registration you asked for." + return 0 + } + return 1 + } +} + +set user_id [ad_verify_and_get_user_id] +ad_maybe_redirect_for_registration + +# check and see if this reg belongs to this user +if { ![db_0or1row reg_exists {}] } { + ad_return_warning "Could Not Find Registration" "We could not find the + registration you asked for, or the registration you + asked for does not belong to you." +} + +events::registration::get -reg_id $reg_id -array reg_info +events::event::get -event_id $reg_info(event_id) -array event_info +events::venue::get -venue_id $event_info(venue_id) -array venue_info + +set title "Status of Registration for $event_info(name)" +set context [list [list "event-info?event_id=$reg_info(event_id)" "$event_info(name) in $venue_info(city)"] "Status of Registration"] + +ad_return_template + + + Index: openacs-4/contrib/packages/events/www/order-check.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/events/www/order-check.xql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/events/www/order-check.xql 9 Mar 2003 12:08:08 -0000 1.1 @@ -0,0 +1,13 @@ + + + + + + select 1 + from events_registrations + where reg_id = :reg_id + and user_id = :user_id + + + + Index: openacs-4/contrib/packages/events/www/order-one-oracle.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/events/www/order-one-oracle.xql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/events/www/order-one-oracle.xql 9 Mar 2003 12:08:08 -0000 1.1 @@ -0,0 +1,12 @@ + + + + + + declare begin + :1 := person.name(person_id => :user_id); + end; + + + + Index: openacs-4/contrib/packages/events/www/order-one-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/events/www/order-one-postgresql.xql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/events/www/order-one-postgresql.xql 9 Mar 2003 12:08:08 -0000 1.1 @@ -0,0 +1,10 @@ + + + + + + select person__name(:user_id) as user_name + + + + Index: openacs-4/contrib/packages/events/www/order-one.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/events/www/order-one.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/events/www/order-one.adp 9 Mar 2003 12:08:08 -0000 1.1 @@ -0,0 +1,35 @@ + +Register for @event_info.name@ +@context@ + + +

About the Event

+ + + + + + + + + + + + + + +
When@event_info.timespan@
Where@event_info.city@ (you'll get specifics after you register)
Registration Deadline@event_info.reg_deadline@
+ + + +

Registration Notes:

+
    +@reg_notes@ +
+
+ +

About You

+ +
+ +
Index: openacs-4/contrib/packages/events/www/order-one.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/events/www/order-one.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/events/www/order-one.tcl 9 Mar 2003 12:08:08 -0000 1.1 @@ -0,0 +1,139 @@ +# events/www/order-one.tcl + +ad_page_contract { + Registration form for an event. + + @param event_id the event for which the user is signing up + + @author Matthew Geddert (geddert@yahoo.com) + @author Michael Steigman (michael@steigman.net) + @author Bryan Che (bryanche@arsdigita.com) + @cvs_id $Id order-one.tcl,v 3.19.2.5 2000/09/22 01:37:33 kevin Exp $ +} { + {event_id:integer,notnull} +} -properties { + + detail_url:onevalue +} -validate { + event_exists_p -requires {event_id} { + if { ![events::event::exists_p -event_id $event_id] } { + ad_complain "We couldn't find the event you asked for." + return 0 + } + return 1 + } +} +set user_id [ad_verify_and_get_user_id] + +if { [events::event::reg_deadline_elapsed_p -event_id $event_id] } { + ad_return_warning "Registration Deadline Elapsed" "The registration + deadline for this event has passed." +} + + +# check to see if this person has already registered +if {[db_0or1row get_reg_id {}]} { + ad_return_warning "Already Registered" "You have already registered for this Event. You are not permitted + to register more than once." +} + + + + +events::security::require_read_event -event_id $event_id +events::event::get -event_id $event_id -array event_info +events::event::get_stats -event_id $event_id -array event_stats + +set context [list [list "event-info?event_id=$event_id" "$event_info(name) in $event_info(city)"] Register] + +set detail_url [ad_convert_to_html $event_info(detail_url)] + + + +set reg_notes_p f + + +if { [string equal $event_info(reg_needs_approval_p) "t"] } { + set reg_notes_p t + append reg_notes "
  • A registration for this event + requires final approval from an administrator. If you sign up + for $event_info(name), your final registration will be pending + administrator approval.<\/font><\/li>" + if {![empty_string_p $event_stats(max_people)] && 0 >= [expr $event_stats(max_people) - $event_stats(approved)]} { + append reg_notes "
  • The maximum number of registrations have already been approved + and registered. If an administrator approves of your request, you + will likely be placed on the waiting list.<\/font><\/li>" + } + if { [string equal $event_info(reg_cancellable_p) "f"] } { + append reg_notes "
  • Registrations for this event cannot be canceled. Once approved, + you are committed to coming.<\/font><\/li>" + } +} else { + if {![empty_string_p $event_stats(max_people)] && 0 >= [expr $event_stats(max_people) - $event_stats(approved)]} { + set reg_notes_p t + append reg_notes "
  • This event has already received its maximum number of + registrations. If you register for this event, you will be + placed on a waiting list.<\/font><\/li>" + } else { + if { $event_stats(waiting) > 0 } { + set reg_notes_p t + append reg_notes "
  • Although this event is not filled to maximum + capacity, there is a waiting list. If you register for this event an administrator + will need to approve of your registration.<\/font><\/li>" + } + } + if { [string equal $event_info(reg_cancellable_p) "f"] } { + set reg_notes_p t + append reg_notes "
  • Registrations for this event cannot be canceled. Once registered, + you are committed to coming.<\/font><\/li>" + } +} + + +set user_name [db_exec_plsql select_user_name {}] + + +form create registration + +element create registration event_id \ + -datatype integer \ + -widget hidden \ + -value $event_id + +element create registration user_id \ + -datatype integer \ + -widget hidden \ + -value $user_id + +element create registration user_name \ + -label "Your Name" \ + -datatype text \ + -widget inform \ + -value "
    $user_name \[not you? login as somebody else\]
    " + +element create registration comments \ + -label "Comments" \ + -datatype text \ + -widget textarea \ + -html {cols 70 rows 8 wrap soft} \ + -optional + +if {[template::form is_valid registration]} { + template::form get_values registration event_id user_id comments + + set reg_id [events::registration::new -event_id $event_id -user_id $user_id -comments $comments] + + ad_returnredirect "order-check?reg_id=$reg_id" + ad_script_abort +} + +ad_return_template + +# CUSTOM FIELDS WILL BE DEALT WITH VIA A SERVICE CONTRACT WITH SURVEY +# +#db_foreach select_custom_fields {} { +# set element " +# {$name:[attribute::translate_datatype $datatype](text) +# {label $pretty_name}}" +# ad_form -extend -name registration -form $element +#} Index: openacs-4/contrib/packages/events/www/order-one.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/events/www/order-one.xql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/events/www/order-one.xql 9 Mar 2003 12:08:08 -0000 1.1 @@ -0,0 +1,29 @@ + + + + + + select reg_id + from events_registrations + where event_id = :event_id + and user_id = :user_id + and reg_state <> 'canceled' + + + + + + select eaam.attribute_id, aa.attribute_name as name, + aa.sort_order as after, aa.datatype, aa.pretty_name, + eac.category_name, eac.category_id + from events_event_attr_map eaam, acs_attributes aa, + events_attr_categories eac, events_attr_category_map eacm + where eaam.event_id = :event_id + and eaam.attribute_id = aa.attribute_id + and eacm.attribute_id = aa.attribute_id + and eacm.category_id = eac.category_id + order by eac.category_name, aa.sort_order asc + + + + Index: openacs-4/contrib/packages/events/www/organizer.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/events/www/organizer.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/events/www/organizer.adp 9 Mar 2003 12:08:08 -0000 1.1 @@ -0,0 +1,8 @@ + +@title@ +@context@ + +About @organizer_name@: + +

    +@bio@ Index: openacs-4/contrib/packages/events/www/organizer.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/events/www/organizer.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/events/www/organizer.tcl 9 Mar 2003 12:08:08 -0000 1.1 @@ -0,0 +1,33 @@ +ad_page_contract { + Displays information about an event organizer + + @param role_id the organizer's role + @param user_id the organizer + + @author Michael Steigman (michael@steigman.net) + @author Bryan Che (bryanche@arsdigita.com) + @cvs_id $Id: organizer.tcl,v 1.1 2003/03/09 12:08:08 lars Exp $ +} { + {role_id:integer,notnull} + {user_id:integer,notnull} +} -validate { + organizer_check -requires {role_id user_id} { + if { ![db_0or1row select_organizer_info {}] } { + ad_complain "Invalid Organizer Request This page + came in with an invalid organizer request." + return 0 + } + return 1 + } +} + +events::event::get -event_id $event_id -array event_info + +set title "$organizer_name: $role for $event_info(name)" +set context [list [list "event-info?event_id=$event_id" "One Event"] "$role"] + +set bio [db_string select_bio {}] +set bio [ad_decode $bio "" "$organizer_name has not provided any information about himself to display" $bio] + +ad_return_template + Index: openacs-4/contrib/packages/events/www/organizer.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/events/www/organizer.xql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/events/www/organizer.xql 9 Mar 2003 12:08:08 -0000 1.1 @@ -0,0 +1,29 @@ + + + + + + select eo.role, eo.user_id, eo.role_id, eo.event_id, + u.first_names || ' ' || u.last_name as organizer_name + from events_organizers eo, cc_users u + where eo.role_id = :role_id + and eo.public_role_p = 't' + and u.user_id = eo.user_id + and u.user_id = :user_id + + + + + + select attr_value + from acs_attribute_values + where object_id = :user_id + and attribute_id = + (select attribute_id + from acs_attributes + where object_type = 'person' + and attribute_name = 'bio') + + + + Index: openacs-4/contrib/packages/events/www/admin/activities.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/events/www/admin/Attic/activities.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/events/www/admin/activities.adp 9 Mar 2003 12:08:22 -0000 1.1 @@ -0,0 +1,34 @@ + +Activities +@context_bar@ + +

    + +

    Current Activities

    + + + +

    Discontinued Activities

    + + + Index: openacs-4/contrib/packages/events/www/admin/activities.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/events/www/admin/Attic/activities.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/events/www/admin/activities.tcl 9 Mar 2003 12:08:22 -0000 1.1 @@ -0,0 +1,21 @@ +# events/www/admin/activities.tcl +ad_page_contract { + Displays a list of current and discontinued activities. + Details for specific activities are one click deep. + + @author Michael Steigman (michael@steigman.net) + @author Bryan Che (bryanche@arsdigita.com) + @cvs_id $Id: activities.tcl,v 1.1 2003/03/09 12:08:22 lars Exp $ + +} { +} + +set package_id [ad_conn package_id] + +set context_bar [ad_context_bar Activities] + +db_multirow available_activities select_available_activities {} + +db_multirow unavailable_activities select_unavailable_activities {} + +ad_return_template Index: openacs-4/contrib/packages/events/www/admin/activities.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/events/www/admin/Attic/activities.xql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/events/www/admin/activities.xql 9 Mar 2003 12:08:22 -0000 1.1 @@ -0,0 +1,23 @@ + + + + + select a.activity_id, a.name, ea.available_p + from events_activities ea, acs_activities a + where ea.activity_id = a.activity_id + and package_id = :package_id + and ea.available_p = 't' + order by name asc + + + + + select a.activity_id, a.name, ea.available_p + from events_activities ea, acs_activities a + where ea.activity_id = a.activity_id + and package_id = :package_id + and ea.available_p = 'f' + order by name asc + + + Index: openacs-4/contrib/packages/events/www/admin/activity-add.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/events/www/admin/Attic/activity-add.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/events/www/admin/activity-add.adp 9 Mar 2003 12:08:22 -0000 1.1 @@ -0,0 +1,10 @@ + +Add a New Activity +@context_bar@ + +

    Activity Description

    + +
    + +
    + Index: openacs-4/contrib/packages/events/www/admin/activity-add.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/events/www/admin/activity-add.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/events/www/admin/activity-add.tcl 9 Mar 2003 12:08:22 -0000 1.1 @@ -0,0 +1,83 @@ +#/packages/events/www/admin/activity-ae.tcl + +ad_page_contract { + If an activity_id is supplied, the page will display + the activity to an admin with options + for modifying the event. Otherwise, a blank form for + the creation of a new event will be provided. + + @param activity_id the activity at which we're looking + @param email_from_search + @param user_id_from_search + @param no_contact + @param default_contact_user_id + + @author Michael Steigman (michael@steigman.net) + @author Bryan Che (bryanche@arsdigita.com) + @cvs_id $Id: activity-add.tcl,v 1.1 2003/03/09 12:08:22 lars Exp $ +} { + {activity_id:naturalnum,optional} + {email_from_search:optional} + {user_id_from_search:optional} + {no_contact_flag:optional} + {default_contact_user_id:naturalnum,optional} +} + +set context_bar [ad_context_bar [list activities Activities] "New Activity"] + +form create activity + +element create activity name \ + -label "Activity Name" \ + -datatype text \ + -widget text \ + -html {size 60} + +element create activity default_contact_user_id \ + -label "Default Contact Person" \ + -datatype search \ + -widget search \ + -result_datatype integer \ + -options [events::organizer::users_get_options] \ + -optional \ + -value "" \ + -search_query { + select distinct u.first_names || ' ' || u.last_name as name, u.user_id + from cc_users u + where upper(decode(u.first_names,' ', '') || decode(u.last_name,' ', '') || u.email || ' ' || decode(u.screen_name, ' ', '')) like upper('%'||:value||'%') + order by name +} + +element create activity detail_url \ + -label "Details URL" \ + -datatype text \ + -widget text \ + -html {size 50} \ + -help_text "Note: If you don't put http:// in
    your url, the link will be relative" \ + -optional + +element create activity description \ + -label Description \ + -datatype text \ + -widget textarea \ + -html {cols 60 rows 10 wrap soft} \ + -optional + +if {[template::form is_valid activity]} { + template::form get_values activity \ + name description detail_url default_contact_user_id + + set package_id [ad_conn package_id] + set activity_id [events::activity::new \ + -name $name \ + -description $description \ + -detail_url $detail_url \ + -default_contact_user_id $default_contact_user_id \ + -package_id $package_id + ] + + ad_returnredirect "activity?activity_id=$activity_id" + ad_script_abort +} + +ad_return_template Index: openacs-4/contrib/packages/events/www/admin/activity-edit.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/events/www/admin/Attic/activity-edit.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/events/www/admin/activity-edit.adp 9 Mar 2003 12:08:22 -0000 1.1 @@ -0,0 +1,9 @@ + +@title@ +@context_bar@ + +

    Activity Description

    + +
    + +
    Index: openacs-4/contrib/packages/events/www/admin/activity-edit.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/events/www/admin/Attic/activity-edit.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/events/www/admin/activity-edit.tcl 9 Mar 2003 12:08:22 -0000 1.1 @@ -0,0 +1,113 @@ +# events/www/admin/activity-edit.tcl + +ad_page_contract { + Allows admins to edit an activity's properties. + + @param activity_id the activity to edit + @param email_from_search optional default contact person's email + @param user_id_from_search optional default contact person's user_id + @param no_contact_flat optional flag stating there is not default contact + @param default_contact_user_id optional default contact person's user_id + + @author Michael Steigman (michael@steigman.net) + @author Bryan Che (bryanche@arsdigita.com) + @cvs-id activity-edit.tcl,v 3.8.2.7 2000/09/29 14:49:46 bryanche Exp +} { + {activity_id:naturalnum,notnull} +} -validate { + activity_exists -requires {activity_id} { + if { ![db_0or1row activity_exists {}] } { + ad_complain "We couldn't find the activity you asked for." + return 0 + } + return 1 + } +} + +set context_bar [ad_context_bar [list activities "Activities"] \ + [list "activity?activity_id=$activity_id" "Activity"] "Edit Activity"] + +form create activity + +element create activity activity_id \ + -label "Activity ID" \ + -datatype integer \ + -widget hidden + +element create activity name \ + -label "Activity Name" \ + -datatype text \ + -widget text \ + -html {size 60} + +element create activity creator \ + -label "Creator" \ + -datatype text \ + -widget inform + +element create activity default_contact_user_id \ + -label "Default Contact Person" \ + -datatype search \ + -widget search \ + -result_datatype integer \ + -options [events::organizer::users_get_options] \ + -optional \ + -search_query { + select distinct u.first_names || ' ' || u.last_name as name, u.user_id + from cc_users u + where upper(decode(u.first_names,' ', '') || decode(u.last_name,' ', '') || u.email || ' ' || decode(u.screen_name, ' ', '')) like upper('%'||:value||'%') + order by name +} + +element create activity detail_url \ + -label "Details URL" \ + -datatype text \ + -widget text \ + -html {size 50} \ + -help_text "Leave out http:// for relative URLs" \ + -optional + +element create activity description \ + -label Description \ + -datatype text \ + -widget textarea \ + -html {cols 60 rows 10 wrap soft} \ + -optional + +element create activity available_p \ + -label "Current or Discontinued" \ + -datatype text \ + -widget radio \ + -options {{Current t} {Discontinued f}} \ + -help_text "Discontinuing an activity will not cancel
    an activity's existing events. It only prevents
    you from adding new events to the activity" + +if {[template::form is_valid activity]} { + template::form get_values activity \ + activity_id name detail_url description available_p default_contact_user_id + + events::activity::edit \ + -activity_id $activity_id \ + -name $name \ + -detail_url $detail_url \ + -description $description \ + -available_p $available_p \ + -default_contact_user_id $default_contact_user_id + + ad_returnredirect "activity?activity_id=$activity_id" + ad_script_abort +} + +events::activity::get -activity_id $activity_id -array activity_info +set title "Edit $activity_info(name)" + +element set_properties activity activity_id -value $activity_id +element set_properties activity name -value $activity_info(name) +element set_properties activity default_contact_user_id -value $activity_info(default_contact_user_id) +element set_properties activity detail_url -value $activity_info(detail_url) +element set_properties activity description -value $activity_info(description) +element set_properties activity available_p -value $activity_info(available_p) + +events::activity::get_creator -activity_id $activity_id -array creator_info +element set_properties activity creator -value $creator_info(name) +ad_return_template + Index: openacs-4/contrib/packages/events/www/admin/activity-edit.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/events/www/admin/Attic/activity-edit.xql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/events/www/admin/activity-edit.xql 9 Mar 2003 12:08:22 -0000 1.1 @@ -0,0 +1,25 @@ + + + + + + select 1 + from events_activities + where activity_id = :activity_id + + + + + + select a.name, + a.description, + ae.available_p, + ae.detail_url, + ae.default_contact_user_id + from acs_activities a, events_activities ae + where a.activity_id = :activity_id + and a.activity_id = ae.activity_id + + + + Index: openacs-4/contrib/packages/events/www/admin/activity-oracle.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/events/www/admin/Attic/activity-oracle.xql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/events/www/admin/activity-oracle.xql 9 Mar 2003 12:08:22 -0000 1.1 @@ -0,0 +1,50 @@ + + + + + + select role, eor.role_id, + decode(public_role_p, 't', ' (public role)', '') as public_role_p + from events_organizer_roles eor, events_org_role_activity_map eoram + where eoram.activity_id = :activity_id + and eoram.role_id = eor.role_id + order by role + + + + + + select CASE WHEN to_char(t.start_date, 'YYYY-MM-DD') = to_char(t.end_date, 'YYYY-MM-DD') + THEN to_char(t.start_date, :date_format) || ' (' || to_char(t.start_date, :time_format) || ' - ' || to_char(t.end_date, :time_format) || ')' + ELSE to_char(t.start_date, :date_format) || ' ' || to_char(t.start_date, :time_format) || ' - ' || to_char(t.end_date, :date_format) || ' ' || to_char(t.end_date, :time_format) + END as timespan, + nvl(e.name, a.name) as name, + e.event_id, + v.city, + v.usps_abbrev + from acs_activities a, + acs_events e, + events_activities ea, + events_events ee, + timespans s, + time_intervals t, + events_venues v + where e.timespan_id = s.timespan_id + and s.interval_id = t.interval_id + and e.activity_id = a.activity_id + and a.activity_id = ea.activity_id + and e.activity_id = :activity_id + and e.event_id = ee.event_id + and v.venue_id = ee.venue_id + and ee.available_p = 't' + and ea.package_id = :package_id + order by t.start_date + + + + + + + + + Index: openacs-4/contrib/packages/events/www/admin/activity-orders-oracle.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/events/www/admin/Attic/activity-orders-oracle.xql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/events/www/admin/activity-orders-oracle.xql 9 Mar 2003 12:08:22 -0000 1.1 @@ -0,0 +1,74 @@ + + + + + + select er.reg_id, + person.name(er.user_id) as name, + er.user_id, + pa.email, + er.reg_state, + to_char(ao.creation_date, :date_format) || ' ' || to_char(ao.creation_date, :time_format) as creation_date, + ae.event_id, + ev.venue_name, + CASE WHEN to_char(t.start_date, 'YYYY-MM-DD') = to_char(t.end_date, 'YYYY-MM-DD') + THEN to_char(t.start_date, :date_format) || ' (' || to_char(t.start_date, :time_format) || ' - ' || to_char(t.end_date, :time_format) || ')' + ELSE to_char(t.start_date, :date_format) || ' ' || to_char(t.start_date, :time_format) || ' - ' || to_char(t.end_date, :date_format) || ' ' || to_char(t.end_date, :time_format) + END as timespan + from events_registrations er, + parties pa, + acs_objects ao, + acs_events ae, + events_venues ev, + events_events ee, + timespans s, + time_intervals t + where er.user_id = pa.party_id + and ae.activity_id = :activity_id + and ae.event_id = er.event_id + and ae.event_id = ee.event_id + and ee.venue_id = ev.venue_id + and er.reg_state <> 'canceled' + and er.reg_id = ao.object_id + and ae.timespan_id = s.timespan_id + and s.interval_id = t.interval_id + order by creation_date + + + + + + select er.reg_id, + person.name(er.user_id) as name, + er.user_id, + pa.email, + er.reg_state, + to_char(ao.creation_date, :date_format) || ' ' || to_char(ao.creation_date, :time_format) as creation_date, + ae.event_id, + ev.venue_name, + CASE WHEN to_char(t.start_date, 'YYYY-MM-DD') = to_char(t.end_date, 'YYYY-MM-DD') + THEN to_char(t.start_date, :date_format) || ' (' || to_char(t.start_date, :time_format) || ' - ' || to_char(t.end_date, :time_format) || ')' + ELSE to_char(t.start_date, :date_format) || ' ' || to_char(t.start_date, :time_format) || ' - ' || to_char(t.end_date, :date_format) || ' ' || to_char(t.end_date, :time_format) + END as timespan + from events_registrations er, + parties pa, + acs_objects ao, + acs_events ae, + events_venues ev, + events_events ee, + timespans s, + time_intervals t + where er.user_id = pa.party_id + and ae.activity_id = :activity_id + and ae.event_id = er.event_id + and ae.event_id = ee.event_id + and ee.venue_id = ev.venue_id + and er.reg_state = :specific_reg_type + and er.reg_id = ao.object_id + and ae.timespan_id = s.timespan_id + and s.interval_id = t.interval_id + order by creation_date + + + + Index: openacs-4/contrib/packages/events/www/admin/activity-orders-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/events/www/admin/Attic/activity-orders-postgresql.xql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/events/www/admin/activity-orders-postgresql.xql 9 Mar 2003 12:08:22 -0000 1.1 @@ -0,0 +1,74 @@ + + + + + + select er.reg_id, + person__name(er.user_id) as name, + er.user_id, + pa.email, + er.reg_state, + to_char(ao.creation_date, :date_format) || ' ' || to_char(ao.creation_date, :time_format) as creation_date, + ae.event_id, + ev.venue_name, + CASE WHEN to_char(t.start_date, 'YYYY-MM-DD') = to_char(t.end_date, 'YYYY-MM-DD') + THEN to_char(t.start_date, :date_format) || ' (' || to_char(t.start_date, :time_format) || ' - ' || to_char(t.end_date, :time_format) || ')' + ELSE to_char(t.start_date, :date_format) || ' ' || to_char(t.start_date, :time_format) || ' - ' || to_char(t.end_date, :date_format) || ' ' || to_char(t.end_date, :time_format) + END as timespan + from events_registrations er, + parties pa, + acs_objects ao, + acs_events ae, + events_venues ev, + events_events ee, + timespans s, + time_intervals t + where er.user_id = pa.party_id + and ae.activity_id = :activity_id + and ae.event_id = er.event_id + and ae.event_id = ee.event_id + and ee.venue_id = ev.venue_id + and er.reg_state <> 'canceled' + and er.reg_id = ao.object_id + and ae.timespan_id = s.timespan_id + and s.interval_id = t.interval_id + order by creation_date + + + + + + select er.reg_id, + person__name(er.user_id) as name, + er.user_id, + pa.email, + er.reg_state, + to_char(ao.creation_date, :date_format) || ' ' || to_char(ao.creation_date, :time_format) as creation_date, + ae.event_id, + ev.venue_name, + CASE WHEN to_char(t.start_date, 'YYYY-MM-DD') = to_char(t.end_date, 'YYYY-MM-DD') + THEN to_char(t.start_date, :date_format) || ' (' || to_char(t.start_date, :time_format) || ' - ' || to_char(t.end_date, :time_format) || ')' + ELSE to_char(t.start_date, :date_format) || ' ' || to_char(t.start_date, :time_format) || ' - ' || to_char(t.end_date, :date_format) || ' ' || to_char(t.end_date, :time_format) + END as timespan + from events_registrations er, + parties pa, + acs_objects ao, + acs_events ae, + events_venues ev, + events_events ee, + timespans s, + time_intervals t + where er.user_id = pa.party_id + and ae.activity_id = :activity_id + and ae.event_id = er.event_id + and ae.event_id = ee.event_id + and ee.venue_id = ev.venue_id + and er.reg_state = :specific_reg_type + and er.reg_id = ao.object_id + and ae.timespan_id = s.timespan_id + and s.interval_id = t.interval_id + order by creation_date + + + + Index: openacs-4/contrib/packages/events/www/admin/activity-orders.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/events/www/admin/Attic/activity-orders.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/events/www/admin/activity-orders.adp 9 Mar 2003 12:08:22 -0000 1.1 @@ -0,0 +1,90 @@ + +@title@ +@context@ + + + + + + + + + + +
    Activity@activity_info.name@
    + + + + + + + + + + + + + +
    ApprovedPendingWaitingCanceled
    @activity_stats.approved@@activity_stats.pending@@activity_stats.waiting@@activity_stats.canceled@
    + +
    + + +
      +
    • No registrants fit this category +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + +
    LocationTimeReg. IDNameEmailReg. DateReg. State
    @activity_members.venue_name@@activity_members.timespan@@activity_members.reg_id@@activity_members.name@@activity_members.email@@activity_members.creation_date@ + + + @activity_members.reg_state@ + waitlist + - cancel + + + @activity_members.reg_state@ +approve - + cancel + + + @activity_members.reg_state@ +approve - + waitlist + - cancel + + + @activity_members.reg_state@ +approve - + waitlist + + +
    +
    + +
    Index: openacs-4/contrib/packages/events/www/admin/activity-orders.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/events/www/admin/Attic/activity-orders.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/events/www/admin/activity-orders.tcl 9 Mar 2003 12:08:22 -0000 1.1 @@ -0,0 +1,43 @@ +# events/www/admin/order-history-one.tcl + +ad_page_contract { + + displays the order history of an event + + @param event_id + @author Matthew Geddert (geddert@yahoo.com) + +} { + {specific_reg_type ""} + {activity_id:integer} +} -properties { + activity_members:multirow +} -validate { + activity_exists_p -requires {activity_id} { + if { ![events::activity::exists_p -activity_id $activity_id] } { + ad_complain "We couldn't find the activity you asked for." + return 0 + } + return 1 + } +} + +# what reg state do we plug into the database? +set date_format [parameter::get -parameter date_format -default "MM/DD/YYYY"] +set time_format [parameter::get -parameter time_format -default "HH12:MIam"] + +if {[string equal $specific_reg_type "canceled"] || + [string equal $specific_reg_type "approved"] || + [string equal $specific_reg_type "waiting"] || + [string equal $specific_reg_type "pending"]} { +db_multirow activity_members select_specific_reg_type {} +} else { +db_multirow activity_members select_activity_members {} +} + +events::activity::get -activity_id $activity_id -array activity_info +events::activity::get_stats -activity_id $activity_id -array activity_stats +set title "Order History for $activity_info(name)" +set context [list [list "activities" Activities] [list "activity?activity_id=$activity_id" $activity_info(name)] "Orders"] + +ad_return_template Index: openacs-4/contrib/packages/events/www/admin/activity-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/events/www/admin/Attic/activity-postgresql.xql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/events/www/admin/activity-postgresql.xql 9 Mar 2003 12:08:22 -0000 1.1 @@ -0,0 +1,47 @@ + + + + + + select role, eor.role_id, public_role_p, + CASE when public_role_p = 't' then ' (public role)' + ELSE '' + END + from events_organizer_roles eor, events_org_role_activity_map eoram + where eoram.activity_id = :activity_id + and eoram.role_id = eor.role_id + order by role + + + + + + select CASE WHEN to_char(t.start_date, 'YYYY-MM-DD') = to_char(t.end_date, 'YYYY-MM-DD') + THEN to_char(t.start_date, :date_format) || ' (' || to_char(t.start_date, :time_format) || ' - ' || to_char(t.end_date, :time_format) || ')' + ELSE to_char(t.start_date, :date_format) || ' ' || to_char(t.start_date, :time_format) || ' - ' || to_char(t.end_date, :date_format) || ' ' || to_char(t.end_date, :time_format) + END as timespan, + coalesce(e.name, a.name) as name, + e.event_id, + v.city, + v.usps_abbrev + from acs_activities a, + acs_events e, + events_activities ea, + events_events ee, + timespans s, + time_intervals t, + events_venues v + where e.timespan_id = s.timespan_id + and s.interval_id = t.interval_id + and e.activity_id = a.activity_id + and a.activity_id = ea.activity_id + and e.activity_id = :activity_id + and e.event_id = ee.event_id + and v.venue_id = ee.venue_id + and ee.available_p = 't' + and ea.package_id = :package_id + order by t.start_date + + + + Index: openacs-4/contrib/packages/events/www/admin/activity.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/events/www/admin/Attic/activity.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/events/www/admin/activity.adp 9 Mar 2003 12:08:22 -0000 1.1 @@ -0,0 +1,99 @@ + +@activity_info.name@ +@context_bar@ + +

    Events for this Activity

    + + + +

    Activity Description

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    Name@activity_info.name@
    Creator@creator_info.name@
    Default Contact Person@default_contact_email@
    URL@detail_url@
    Description@activity_info.description@
    Current or DiscontinuedCurrentDiscontinued
    + +

    +

    + +

    Organizer Roles

    +You may create default organizer roles for this activity type. +
      + + +
    • @org_roles.role@ @org_roles.public_role_p@    + [ remove ] +
    • +
      +
      + +
    • There are no organizer roles for this activity
    • +
      +

      +
    • Add an organizer role +
    + +

    Event Statistics

    + + + + + + + + + + + + + +
    ApprovedPendingWaitingCanceled
    @activity_stats.approved@@activity_stats.pending@@activity_stats.waiting@@activity_stats.canceled@
    + + + + + + + + Index: openacs-4/contrib/packages/events/www/admin/activity.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/events/www/admin/Attic/activity.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/events/www/admin/activity.tcl 9 Mar 2003 12:08:22 -0000 1.1 @@ -0,0 +1,91 @@ +# /events/www/admin/activity.tcl + +ad_page_contract { + Displays a particular activity to an admin, with options + for modifying the event. + + @param activity_id the activity at which we're looking + + @author Michael Steigman (michael@steigman.net) + @author Bryan Che (bryanche@arsdigita.com) + @cvs_id $Id: activity.tcl,v 1.1 2003/03/09 12:08:22 lars Exp $ +} { + activity_id:integer,notnull +} -validate { + activity_exists -requires {activity_id} { + if { ![events::activity::exists_p -activity_id $activity_id] } { + ad_complain "We couldn't find the activity you asked for." + return 0 + } + return 1 + } +} + + +set package_id [ad_conn package_id] + +events::activity::get -activity_id $activity_id -array activity_info +events::activity::get_creator -activity_id $activity_id -array creator_info +events::activity::get_stats -activity_id $activity_id -array activity_stats + +set context_bar [ad_context_bar [list activities "Activities"] $activity_info(name)] + +# html'ify email and url +set default_contact_email [ad_convert_to_html $activity_info(default_contact_email)] +set detail_url [ad_convert_to_html $activity_info(detail_url)] + +set date_format [parameter::get -parameter date_format -default "MM/DD/YYYY"] +set time_format [parameter::get -parameter time_format -default "HH12:MIam"] + +set events "" +db_foreach select_activity_events {} { + # do something for each group of which user 123456 is in the role + # of "administrator" + events::event::get_stats -event_id $event_id -array event_stats + + append events "
  • " + if { [empty_string_p $city] } { + append events "$name" + } else { + append events "$city" + } + if { ![empty_string_p $usps_abbrev] } { + if { ![empty_string_p $city] } { + append events ", " + } else { + append events " - " + } + append events "$usps_abbrev" + } + append events " - $timespan - " + if { [empty_string_p $event_stats(max_people)] } { + append events "unlimited registrations" + } else { + append events "([expr $event_stats(max_people) - $event_stats(approved)]<\/b> of $event_stats(max_people) spots left" + } + + if {![string compare $event_stats(pending) "0"] == 0} { + append events " with $event_stats(pending) pending<\/font>" + if {![string compare $event_stats(waiting) "0"] == 0} { + append events " and $event_stats(waiting) waiting<\/font>" + } + } else { + if {![string compare $event_stats(waiting) "0"] == 0} { + append events " with $event_stats(waiting) waiting<\/font>" + } + } + + if { ![empty_string_p $event_stats(max_people)] } { + append events ")" + } +} + +if {![exists_and_not_null events]} { + set events "
  • No events for this activity have been created.<\/li>" +} + + +db_multirow custom_fields select_custom_fields {} +db_multirow org_roles select_org_roles {} + +ad_return_template Index: openacs-4/contrib/packages/events/www/admin/activity.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/events/www/admin/Attic/activity.xql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/events/www/admin/activity.xql 9 Mar 2003 12:08:22 -0000 1.1 @@ -0,0 +1,45 @@ + + + + + + select a.name, + a.description, + ae.available_p, + ae.detail_url, + ae.default_contact_user_id + from acs_activities a, events_activities ae + where a.activity_id = :activity_id + and a.activity_id = ae.activity_id + + + + + + select column_name, pretty_name, column_type, column_actual_type, + column_extra, sort_key + from events_activity_fields + where activity_id = :activity_id + order by sort_key + + + + + + select edaam.attribute_id, aa.attribute_name as name, + aa.sort_order as after, aa.datatype, eac.category_name, + eac.category_id + from events_def_actvty_attr_map edaam, acs_attributes aa, + events_attr_categories eac, events_attr_category_map eacm + where edaam.activity_id = :activity_id + and edaam.attribute_id = aa.attribute_id + and eacm.attribute_id = aa.attribute_id + and eacm.category_id = eac.category_id + order by eac.category_name, aa.sort_order asc + + + + + + + Index: openacs-4/contrib/packages/events/www/admin/administer.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/events/www/admin/administer.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/events/www/admin/administer.tcl 9 Mar 2003 12:08:22 -0000 1.1 @@ -0,0 +1,86 @@ +ad_page_contract { + This is the Site-Wide Events Administration Page. + + @author Bryan Che (bryanche@arsdigita.com) + @cvs_id index.tcl,v 1.5.2.3 2000/09/22 01:35:07 kevin Exp +} { +} + +set events_admin_group_id [db_string evnt_sel_admin_group "select +group_id +from user_groups +where group_name = 'Events Administration' +and group_type = 'administration' +and short_name = 'events'"] + +append whole_page "[ad_header "Events Administration"] +

    Events Administration

    +[ad_admin_context_bar "Events"] +
    + +

    Administrate Events

    + + + +

    Join a User Group

    + +If you wish to administrate an event, you must belong to that event's +activity's owning user group. Following is a list of user groups +which currently own activities. You may add yourself (or another +person) as a member/administrator to any of these groups so that you +can administrate that group's activities. + +
      +" + +set first_group_p 1 +set last_group_id "" + +db_foreach evnt_sel_evnt_groups "select +distinct ug.group_id, ug.group_name, ug.group_type, a.short_name +from user_groups ug, events_activities a +where ug.group_id = a.group_id +order by upper(group_name), upper(short_name) +" { + if {($last_group_id != $group_id) || ($first_group_p == 1)} { + if {$first_group_p != 1} { + append whole_page "
    " + } + + append whole_page " +
  • + $group_name ($group_type group type) +
      + " + set first_group_p 0 + set last_group_id $group_id + } + + append whole_page "
    • $short_name" +} + +append whole_page "
    " + +set header "Join All Activity User Groups" +set message "Are you sure you want to join all the user groups +that own activities?" +set yes_url "/admin/events/join-groups?proceed=1" +set no_url "/admin/events/" + +append whole_page " +

    +

  • Join all the above user groups +" + +append whole_page "[ad_footer] +" + + + +doc_return 200 text/html $whole_page \ No newline at end of file Index: openacs-4/contrib/packages/events/www/admin/event-add-2-oracle.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/events/www/admin/Attic/event-add-2-oracle.xql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/events/www/admin/event-add-2-oracle.xql 9 Mar 2003 12:08:22 -0000 1.1 @@ -0,0 +1,38 @@ + + + + oracle8.1.6 + + + + + begin + :1 := ec_product.new( + creation_user => :user_id, + creation_ip => :peeraddr, + context_id => :event_id, + product_name => '$activity_info(name) $date_time', + price => :event_price, + sku => 'event_$event_id', + one_line_description => '$activity_info(name); $date_time; $venue_info(city), $venue_info(usps_abbrev)', + detailed_description => '$activity_info(description)', + search_keywords => '$activity_info(name), $venue_info(city), $venue_info(usps_abbrev), $venue_info(venue_name)', + present_p => 't', + stock_status => 'i', + email_on_purchase_list => :email, + url => '$activity_info(detail_url)', + no_shipping_avail_p => 't', + active_p => 't' + ); + end; + + + + + + + insert into ec_category_product_map values (:product_id, :category_id, null, sysdate, :user_id, :peeraddr) + + + + \ No newline at end of file Index: openacs-4/contrib/packages/events/www/admin/event-add-2-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/events/www/admin/Attic/event-add-2-postgresql.xql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/events/www/admin/event-add-2-postgresql.xql 9 Mar 2003 12:08:22 -0000 1.1 @@ -0,0 +1,35 @@ + + + + postgresql7.1 + + + + + select ec_product__new( + null, + :user_id, + :event_id, + '$activity_info(name) $date_time', + :event_price, + 'event_$event_id', + '$activity_info(name); $date_time; $venue_info(city), $venue_info(usps_abbrev)', + '$activity_info(description)', + '$activity_info(name), $venue_info(city), $venue_info(usps_abbrev), $venue_info(venue_name)', + 't', + 'i', + null, + to_date(current_timestamp, 'YYYY-MM-DD'), + :peeraddr + ) + + + + + + + insert into ec_category_product_map values (:product_id, :category_id, null, current_timestamp, :user_id, :peeraddr) + + + + \ No newline at end of file Index: openacs-4/contrib/packages/events/www/admin/event-add-2.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/events/www/admin/Attic/event-add-2.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/events/www/admin/event-add-2.adp 9 Mar 2003 12:08:22 -0000 1.1 @@ -0,0 +1,10 @@ + +@title@ +@context_bar@ + +

    +

    Event Details

    + +
    + +
    Index: openacs-4/contrib/packages/events/www/admin/event-add-2.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/events/www/admin/Attic/event-add-2.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/events/www/admin/event-add-2.tcl 9 Mar 2003 12:08:22 -0000 1.1 @@ -0,0 +1,217 @@ +# events/www/admin/event-add-2.tcl + +ad_page_contract { + Purpose: allow an admin to insert info for a new event, one a + venue has been chosen. + + @param activity_id the activity type of the new event + @param venue_id where the new event will be located + + @author Michael Steigman (michael@steigman.net) + @author Bryan Che (bryanche@arsdigita.com) + @cvs_id $Id: event-add-2.tcl,v 1.1 2003/03/09 12:08:22 lars Exp $ +} { + {activity_id:integer,notnull} + {venue_id:integer,notnull} +} + +form create event_add + +element create event_add venue_id \ + -datatype integer \ + -widget hidden \ + -value $venue_id + +element create event_add activity_id \ + -datatype integer \ + -widget hidden \ + -value $activity_id + +element create event_add venue_name \ + -label "Location" \ + -datatype text \ + -widget inform + +element create event_add event_price \ + -label "Price" \ + -datatype text \ + -widget text \ + -html {size 20} \ + -help_text "A base price, if any, for this event." \ + -optional + +set ecommerce_list [db_list_of_lists ecommerce "select category_name, category_id from ec_categories order by category_name"] +set ecommerce_list [concat $ecommerce_list { { "None" "" } }] + +element create event_add category_id \ + -label "Ecommerce Category" \ + -datatype search \ + -widget search \ + -result_datatype integer \ + -options $ecommerce_list \ + -optional \ + -value "" + +element create event_add start_time \ + -label "Start" \ + -datatype date \ + -widget date \ + -format "MONTH DD YYYY HH12:MI AM" \ + -minutes_interval { 0 59 5 } \ + -help + +element create event_add end_time \ + -label "End" \ + -datatype date \ + -widget date \ + -format "MONTH DD YYYY HH12:MI AM" \ + -minutes_interval { 0 59 5 } \ + -help \ + -validate { \ + { expr {[template::util::date::compare [template::element::get_value event_add start_time] $value] < 0} } \ + {End time must be after start time} } + +element create event_add reg_deadline \ + -label "Registration Deadline" \ + -datatype date \ + -widget date \ + -format "MONTH DD YYYY HH12:MI AM" \ + -minutes_interval { 0 59 5 } \ + -help \ + -help_text "at latest the Start Time" \ + -validate { \ + { expr {[template::util::date::compare $value [template::element::get_value event_add start_time]] <= 0} } \ + {Registration Deadline must be no later than the start date} } + +element create event_add reg_cancellable_p \ + -label "Registration Cancellable?" \ + -datatype text \ + -widget select \ + -options {{Yes t} {No f}} \ + -help_text "Can someone cancel his registration?" + +element create event_add reg_needs_approval_p \ + -label "Registration Needs Approval?" \ + -datatype text \ + -widget select \ + -options {{Yes t} {No f}} \ + -help_text "Does a registration need to be approved?" + +element create event_add max_people \ + -label "Maximum Capacity" \ + -datatype text \ + -widget text \ + -html {size 20} \ + -help_text "The max number of people that can register before new registrants are automatically wait-listed. If this field is empty, wait-listing won't automatically kick in." \ + -optional + +element create event_add contact_user_id \ + -label "Event Contact Person" \ + -datatype search \ + -widget search \ + -result_datatype integer \ + -options [events::organizer::users_get_options] \ + -optional \ + -value "" \ + -search_query { + select distinct u.first_names || ' ' || u.last_name as name, u.user_id + from cc_users u + where upper(decode(u.first_names,' ', '') || decode(u.last_name,' ', '') || u.email || ' ' || decode(u.screen_name, ' ', '')) like upper('%'||:value||'%') + order by name +} + +element create event_add display_after \ + -label "Confirmation Message" \ + -datatype text \ + -widget textarea \ + -html {cols 70 rows 8 wrap soft} + +element create event_add refreshments_note \ + -label "Refreshment Notes" \ + -datatype text \ + -widget textarea \ + -html {cols 70 rows 8 wrap soft} \ + -optional + +element create event_add av_note \ + -label "Audio/Visual Notes" \ + -datatype text \ + -widget textarea \ + -html {cols 70 rows 8 wrap soft} \ + -optional + +element create event_add additional_note \ + -label "Additional Notes" \ + -datatype text \ + -widget textarea \ + -html {cols 70 rows 8 wrap soft} \ + -optional + +if {[template::form is_valid event_add]} { + template::form get_values event_add activity_id venue_id start_time end_time reg_deadline \ + reg_cancellable_p reg_needs_approval_p contact_user_id max_people display_after refreshments_note \ + av_note additional_note event_price category_id + + events::venue::get -venue_id $venue_id -array venue_info + events::activity::get -activity_id $activity_id -array activity_info + + set user_id [ad_conn user_id] + set peeraddr [ns_conn peeraddr] + + db_1row select_email {} + if { ![empty_string_p $contact_user_id] && $user_id!=$contact_user_id } { + db_1row select_contact_email {} + append email ", $contact_email" + } + + db_transaction { + + set event_id [events::event::new -activity_id $activity_id \ + -venue_id $venue_id \ + -start_time $start_time \ + -end_time $end_time \ + -display_after $display_after \ + -max_people $max_people \ + -available_p "t" \ + -deleted_p "f" \ + -reg_deadline $reg_deadline \ + -reg_cancellable_p $reg_cancellable_p \ + -reg_needs_approval_p $reg_needs_approval_p \ + -contact_user_id $contact_user_id \ + -refreshments_note $refreshments_note \ + -av_note $av_note \ + -additional_note $additional_note \ + ] + + if { $event_price > 0 } { + set date_time "[lindex $start_time 1]/[lindex $start_time 2]/[lindex $start_time 0]" + set end_date_time "[lindex $end_time 1]/[lindex $end_time 2]/[lindex $end_time 0]" + if { $end_date_time != $date_time } { + set date_time "$date_time-$end_date_time" + } + + set product_id [db_exec_plsql product_insert {}] + + if { ![empty_string_p $category_id] } { + db_dml mapping_insert {} + } + + db_dml contact_update {} + } + } + + ad_returnredirect "event?event_id=$event_id" +} + +events::activity::get -activity_id $activity_id -array activity_info +events::venue::get -venue_id $venue_id -array venue_info +set activity_name $activity_info(name) + +element set_properties event_add start_time -value [template::util::date::today] +element set_properties event_add end_time -value [template::util::date::today] +element set_properties event_add reg_deadline -value [template::util::date::today] +element set_properties event_add display_after -value "Thanks for registering for $activity_name!" +element set_properties event_add venue_name -value $venue_info(venue_name) +element set_properties event_add max_people -value $venue_info(max_people) +set title "Add a New Event for $activity_name" +set context_bar [ad_context_bar [list "activities" Activities] [list "activity?activity_id=$activity_id" Activity] "Add Event"] \ No newline at end of file Index: openacs-4/contrib/packages/events/www/admin/event-add-2.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/events/www/admin/Attic/event-add-2.xql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/events/www/admin/event-add-2.xql 9 Mar 2003 12:08:22 -0000 1.1 @@ -0,0 +1,28 @@ + + + + + + select to_char(sysdate, 'MONTH DD YYYY HH12:MI AM') from dual + + + + + + select email from parties where party_id=:user_id + + + + + + select email as contact_email from parties where party_id=:contact_user_id + + + + + + update ec_products set email_on_purchase_list=:email, url='$activity_info(detail_url)',no_shipping_avail_p='t', active_p='t' where product_id=:product_id + + + + \ No newline at end of file Index: openacs-4/contrib/packages/events/www/admin/event-add.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/events/www/admin/Attic/event-add.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/events/www/admin/event-add.adp 9 Mar 2003 12:08:22 -0000 1.1 @@ -0,0 +1,20 @@ + +@title@ +@context_bar@ + +

    +

    Choose a Venue

    +

    + + + + + + +
    + +
    +

    +If you do not see your venue above, you may add a new venue. +

    +
    Index: openacs-4/contrib/packages/events/www/admin/event-add.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/events/www/admin/Attic/event-add.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/events/www/admin/event-add.tcl 9 Mar 2003 12:08:22 -0000 1.1 @@ -0,0 +1,42 @@ +# events/www/admin/event-add.tcl + +ad_page_contract { + Purpose: Allow an admin to select a venue for a new event, or + add a new venue if necessary first. + + @param activity_id the activity to which we're adding an event + + @author Michael Steigman (michael@steigman.net) + @author Bryan Che (bryanche@arsdigita.com) + @cvs_id $Id: event-add.tcl,v 1.1 2003/03/09 12:08:22 lars Exp $ +} { + {activity_id:integer,notnull} +} + +set venues [events::venue::venues_get_options] + +if {[llength $venues] == 0} { + set no_venues 1 +} else { + set no_venues 0 +} + +form create venue_select -action event-add-2 + +element create venue_select activity_id \ + -label "Activity ID" \ + -datatype text \ + -widget hidden \ + -value $activity_id + +element create venue_select venue_id \ + -label "Select a venue for your new event" \ + -datatype text \ + -widget select \ + -options $venues + +events::activity::get -activity_id $activity_id -array activity_info +set context_bar [ad_context_bar [list "activities" Activities] [list "activity?activity_id=$activity_id" Activity] "Add Event"] +set activity_name $activity_info(name) +set title "Add a New Event for $activity_name" +set return_url "event-add-2?activity_id=$activity_id" Index: openacs-4/contrib/packages/events/www/admin/event-add.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/events/www/admin/Attic/event-add.xql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/events/www/admin/event-add.xql 9 Mar 2003 12:08:22 -0000 1.1 @@ -0,0 +1,11 @@ + + + + + + select venue_name, venue_id + from events_venues + + + + Index: openacs-4/contrib/packages/events/www/admin/event-edit-oracle.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/events/www/admin/Attic/event-edit-oracle.xql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/events/www/admin/event-edit-oracle.xql 9 Mar 2003 12:08:22 -0000 1.1 @@ -0,0 +1,64 @@ + + + + oracle8.1.6 + + + + select ec_products.product_id, ec_products.price, ec_category_product_map.category_id, min(sale_price) as sale_price from acs_objects, ec_products, ec_category_product_map, ec_sale_prices_current where acs_objects.context_id=:event_id and acs_objects.object_id=ec_products.product_id and ec_category_product_map.product_id(+)=ec_products.product_id and ec_sale_prices_current.product_id(+)=ec_products.product_id group by ec_products.product_id, ec_products.price, ec_category_product_map.category_id + + + + + + select ec_products.product_id from acs_objects, ec_products, ec_category_product_map where acs_objects.context_id=:event_id and acs_objects.object_id=ec_products.product_id and ec_category_product_map.product_id(+)=ec_products.product_id + + + + + + last_modified=sysdate, last_modifying_user=:user_id, modified_ip_address=:peeraddr + + + + + + insert into ec_category_product_map values (:product_id, :category_id, null, sysdate, :user_id, :peeraddr) + + + + + + + begin + :1 := ec_product.new( + creation_user => :user_id, + creation_ip => :peeraddr, + context_id => :event_id, + product_name => '$activity_info(name) $date_time', + price => :event_price, + sku => 'event_$event_id', + one_line_description => '$activity_info(name); $date_time; $pretty_location', + detailed_description => '$activity_info(description)', + search_keywords => '$activity_info(name), $venue_info(venue_name), $pretty_location', + present_p => 't', + stock_status => 'i', + email_on_purchase_list => :email, + url => '$activity_info(detail_url)', + no_shipping_avail_p => 't', + active_p => 't' + ); + end; + + + + + + + begin + ec_product.delete(:product_id); + end; + + + + \ No newline at end of file Index: openacs-4/contrib/packages/events/www/admin/event-edit-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/events/www/admin/Attic/event-edit-postgresql.xql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/events/www/admin/event-edit-postgresql.xql 9 Mar 2003 12:08:22 -0000 1.1 @@ -0,0 +1,59 @@ + + + + postgresql7.1 + + + + select ec_products.product_id, ec_products.price, ec_category_product_map.category_id, min(sale_price) as sale_price from acs_objects, ec_products left join ec_category_product_map on ec_category_product_map.product_id=ec_products.product_id left join ec_sale_prices_current on ec_sale_prices_current.product_id=ec_products.product_id where acs_objects.context_id=:event_id and acs_objects.object_id=ec_products.product_id group by ec_products.product_id, ec_products.price, ec_category_product_map.category_id + + + + + + select ec_products.product_id from acs_objects, ec_products left join ec_category_product_map on ec_category_product_map.product_id=ec_products.product_id where acs_objects.context_id=:event_id and acs_objects.object_id=ec_products.product_id + + + + + + last_modified=current_timestamp, last_modifying_user=:user_id, modified_ip_address=:peeraddr + + + + + + insert into ec_category_product_map values (:product_id, :category_id, null, current_timestamp, :user_id, :peeraddr) + + + + + + + select ec_product__new( + null, + :user_id, + :event_id, + '$activity_info(name) $date_time', + :event_price, + 'event_$event_id', + '$activity_info(name); $date_time; $pretty_location', + '$activity_info(description)', + '$activity_info(name), $venue_info(venue_name), $pretty_location', + 't', + 'i', + null, + to_date(current_timestamp, 'YYYY-MM-DD'), + :peeraddr + ) + + + + + + + select ec_product__delete(:product_id) + + + + \ No newline at end of file Index: openacs-4/contrib/packages/events/www/admin/event-edit.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/events/www/admin/Attic/event-edit.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/events/www/admin/event-edit.adp 9 Mar 2003 12:08:22 -0000 1.1 @@ -0,0 +1,7 @@ + +@title@ +@context_bar@ + +
    + +
    Index: openacs-4/contrib/packages/events/www/admin/event-edit.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/events/www/admin/Attic/event-edit.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/events/www/admin/event-edit.tcl 9 Mar 2003 12:08:22 -0000 1.1 @@ -0,0 +1,301 @@ +# events/www/admin/event-edit.tcl + +ad_page_contract { + Allows admins to edit an event's properties. + Provides a form with existing data filled in. + + @param event_id the event to edit + @param venue_id the event's new venue (if changing the venue) + @param user_id_from_search optional new contact person's user_id + @param email_from_search optional new contact person's email + + @author Michael Steigman (michael@steigman.net) + @author Bryan Che (bryanche@arsdigita.com) + @cvs_id $Id: event-edit.tcl,v 1.1 2003/03/09 12:08:22 lars Exp $ +} { + {event_id:integer,notnull} + {venue_id:integer,optional} +} -validate { + event_exists_p -requires {event_id} { + if { ![events::event::exists_p -event_id $event_id] } { + ad_complain "We couldn't find the event you asked for." + return 0 + } + return 1 + } +} + +set user_id [ad_conn user_id] + +events::event::get -event_id $event_id -array event_info +events::event::get_stats -event_id $event_id -array stat_info + +set admin_text "" +if { ![db_0or1row select_ecommerce_info {}] } { + set category_id "" + set price "" +} else { + if { ![empty_string_p $sale_price] && $sale_price < $price } { + set price $sale_price + } + # If admin + if { [permission::permission_p -no_cache -party_id $user_id -object_id $event_id -privilege "admin"] } { + set admin_text "
    (edit user class prices)
    " + } +} + +form create event_edit + +element create event_edit event_id \ + -datatype integer \ + -widget hidden + +element create event_edit action \ + -label "Action" \ + -datatype text \ + -widget inform + +element create event_edit venue_id \ + -label "Venue" \ + -datatype integer \ + -widget select \ + -options [events::venue::venues_get_options] + +set venues_connecting [events::venue::venues_get_connecting_options -this_venue_id $event_info(venue_id) -none_p "f"] +if { ![empty_string_p $venues_connecting] } { + element create event_edit event_connecting \ + -label "Use Connecting" \ + -datatype text \ + -widget checkbox \ + -help_text "Use the following connecting venues" \ + -options $venues_connecting \ + -optional +} else { + element create event_edit event_connecting \ + -optional \ + -widget hidden +} + +element create event_edit event_price \ + -label "Price" \ + -datatype text \ + -widget text \ + -html {size 20} \ + -help_text "A base price, if any, for this event.$admin_text" \ + -optional + +set ecommerce_list [db_list_of_lists ecommerce "select category_name, category_id from ec_categories order by category_name"] +set ecommerce_list [concat $ecommerce_list { { "None" "" } }] + +element create event_edit category_id \ + -label "Ecommerce Category" \ + -datatype search \ + -widget search \ + -result_datatype integer \ + -options $ecommerce_list \ + -optional + +element create event_edit max_people \ + -label "Maximum Capacity" \ + -datatype text \ + -widget text \ + -html {size 20} \ + -optional + +element create event_edit reg_cancellable_p \ + -label "Registration Cancellable?" \ + -datatype text \ + -widget select \ + -options {{Yes t} {No f}} \ + -help_text "Can someone cancel his registration?" + +element create event_edit reg_needs_approval_p \ + -label "Registration Needs Approval?" \ + -datatype text \ + -widget select \ + -options {{Yes t} {No f}} \ + -help_text "Does a registration need to be approved?" + +element create event_edit contact_user_id \ + -label "Event Contact Person" \ + -datatype search \ + -widget search \ + -result_datatype integer \ + -options [events::organizer::users_get_options] \ + -optional \ + -search_query { + select distinct u.first_names || ' ' || u.last_name as name, u.user_id + from cc_users u + where upper(decode(u.first_names,' ', '') || decode(u.last_name,' ', '') || u.email || ' ' || decode(u.screen_name, ' ', '')) like upper('%'||:value||'%') + order by name +} + +element create event_edit display_after \ + -label "Confirmation Message" \ + -datatype text \ + -widget textarea \ + -html {cols 70 rows 8 wrap soft} + +element create event_edit start_time \ + -label "Start" \ + -datatype date \ + -widget date \ + -format "MONTH DD YYYY HH12:MI AM" \ + -help + +element create event_edit end_time \ + -label "End" \ + -datatype date \ + -widget date \ + -format "MONTH DD YYYY HH12:MI AM" \ + -help \ + -validate { \ + { expr {[template::util::date::compare [template::element::get_value event_edit start_time] $value] < 0} } \ + {End time must be after start time} } + +element create event_edit reg_deadline \ + -label "Registration Deadline" \ + -datatype date \ + -widget date \ + -format "MONTH DD YYYY HH12:MI AM" \ + -help \ + -help_text "at latest the Start Time" \ + -validate { \ + { expr {[template::util::date::compare $value [template::element::get_value event_edit start_time]] <= 0} } \ + {Registration Deadline must be no later than the start date} } + +if {[template::form is_valid event_edit]} { + template::form get_values event_edit event_id venue_id max_people \ + reg_cancellable_p reg_needs_approval_p contact_user_id \ + display_after start_time end_time reg_deadline event_price category_id + + set event_connecting [template::element get_values event_edit event_connecting] + + events::venue::get -venue_id $venue_id -array venue_info + events::activity::get -activity_id $event_info(activity_id) -array activity_info + + set peeraddr [ns_conn peeraddr] + + db_1row select_email {} + if { ![empty_string_p $contact_user_id] && $user_id!=$contact_user_id } { + db_1row select_contact_email {} + append email ", $contact_email" + } + + set pretty_location "" + if { ![empty_string_p $event_info(city)] } { + append pretty_location "$event_info(city)" + } + if { ![empty_string_p $event_info(usps_abbrev)] } { + if { ![empty_string_p $event_info(city)] } { + append pretty_location ", " + } + append pretty_location "$event_info(usps_abbrev)" + } + + db_transaction { + + if { ![db_0or1row select_product_id {}] } { + set product_id "" + } + + db_dml mapping_remove {} + + # Update connecting venues + db_dml delete_connecting {} + for { set i 0 } { $i < [llength $event_connecting] } { incr i } { + set connecting_venue_id [lindex $event_connecting $i] + if { ![empty_string_p $connecting_venue_id] && [db_0or1row valid_venue {}] } { + db_dml insert_connecting {} + } + } + + set venue [events::venue::connected -event_id $event_id -venue_id $venue_id -sql_p "f"] + for { set i 0 } { $i < [llength $venue] } { incr i } { + append venue_info(venue_name) ", [lindex $venue $i]" + } + + if { $event_price > 0 } { + set date_time "[lindex $start_time 1]/[lindex $start_time 2]/[lindex $start_time 0]" + set end_date_time "[lindex $end_time 1]/[lindex $end_time 2]/[lindex $end_time 0]" + if { $end_date_time != $date_time } { + set date_time "$date_time-$end_date_time" + } + + if { ![empty_string_p $product_id] } { + + set audit_update [db_map audit_update_sql] + + db_dml product_update {} + + } else { + set product_id [db_exec_plsql product_insert {}] + + db_dml contact_update {} + } + + if { ![empty_string_p $category_id] } { + # insert category map + db_dml mapping_insert {} + } + } else { + # Remove this event from ecommerce + db_exec_plsql product_delete {} + } + + if { ![empty_string_p $max_people] && (([expr [expr $stat_info(approved) + $stat_info(pending)] + $stat_info(waiting)] > $max_people) || [events::venue::connecting_max -event_id $event_id -venue_id $venue_id]<$max_people) } { + ad_return_complaint 1 "You cannot have more registrants than your Venue Capacity." + ad_script_abort + } + + # We've made it this far. Do the update. + events::event::edit \ + -event_id $event_id \ + -venue_id $venue_id \ + -max_people $max_people \ + -reg_cancellable_p $reg_cancellable_p \ + -reg_needs_approval_p $reg_needs_approval_p \ + -contact_user_id $contact_user_id \ + -display_after $display_after \ + -start_time $start_time \ + -end_time $end_time \ + -reg_deadline $reg_deadline + + } + + ad_returnredirect "event?event_id=$event_id" + ad_script_abort +} + +# Slug form with any/all connected venues to this event ... +set connected_venue_list "" +for { set i 0 } { $i < [llength $venues_connecting] } { incr i } { + set venue_id [lindex [lindex $venues_connecting $i] 1] + if { [db_0or1row select_connecting {}] } { + lappend connected_venue_list $venue_id + } +} +element set_properties event_edit event_connecting -values $connected_venue_list + +element set_properties event_edit action -value "Edit $event_info(name) on $event_info(timespan)" +element set_properties event_edit event_id -value $event_id +element set_properties event_edit venue_id -value $event_info(venue_id) +element set_properties event_edit event_price -value $price +element set_properties event_edit category_id -value $category_id +element set_properties event_edit max_people -value $event_info(max_people) +element set_properties event_edit reg_cancellable_p -value $event_info(reg_cancellable_p) +element set_properties event_edit reg_needs_approval_p -value $event_info(reg_needs_approval_p) +element set_properties event_edit contact_user_id -value $event_info(contact_user_id) +element set_properties event_edit display_after -value $event_info(display_after) +element set_properties event_edit start_time -value [events::event::make_event_date \ + -which_type start_time -timespan_id $event_info(timespan_id)] +element set_properties event_edit end_time -value [events::event::make_event_date \ + -which_type end_time -timespan_id $event_info(timespan_id)] +element set_properties event_edit reg_deadline -value [events::event::make_event_date \ + -which_type reg_deadline -event_id $event_id] + +set context_bar [ad_context_bar [list "activities" Activities] [list "activity?activity_id=$event_info(activity_id)" Activity] [list "event?event_id=$event_id" "Event"] "Edit Event"] +set return_url "event-edit.tcl?event_id=$event_id" +set title "Edit Event" + +ad_return_template \ No newline at end of file Index: openacs-4/contrib/packages/events/www/admin/event-edit.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/events/www/admin/Attic/event-edit.xql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/events/www/admin/event-edit.xql 9 Mar 2003 12:08:22 -0000 1.1 @@ -0,0 +1,79 @@ + + + + + + select 1 + from events_events + where event_id = :event_id + + + + + + select email from parties where party_id=:user_id + + + + + + select email as contact_email from parties where party_id=:contact_user_id + + + + + + update ec_products set email_on_purchase_list=:email, url='$activity_info(detail_url)',no_shipping_avail_p='t', active_p='t' where product_id=:product_id + + + + + + delete from ec_category_product_map where product_id=:product_id + + + + + + update ec_products + set product_name='$activity_info(name) $date_time', + sku='event_$event_id', + one_line_description='$activity_info(name); $date_time; $pretty_location', + detailed_description='$activity_info(description)', + email_on_purchase_list=:email, + search_keywords='$activity_info(name), $venue_info(venue_name), $pretty_location', + url='$activity_info(detail_url)', + price=:event_price, + no_shipping_avail_p='t', + present_p='$event_info(available_p)', + available_date=sysdate, + $audit_update + where product_id=:product_id + + + + + + delete from events_venues_conn_used_map where event_id=:event_id and package_id=[ad_conn package_id] + + + + + + insert into events_venues_conn_used_map values (:event_id, :venue_id, [lindex $event_connecting $i], [ad_conn package_id]) + + + + + + select connected_venue_id from events_venues_conn_used_map where event_id=:event_id and venue_id=$event_info(venue_id) and package_id=[ad_conn package_id] and connected_venue_id=:venue_id + + + + + + select venue_id from events_venues where venue_id=:venue_id and $connecting_venue_id in ([events::venue::connecting -venue_id $venue_id -package_id [ad_conn package_id] -sql_p "t"]) + + + + \ No newline at end of file Index: openacs-4/contrib/packages/events/www/admin/event-oracle.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/events/www/admin/Attic/event-oracle.xql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/events/www/admin/event-oracle.xql 9 Mar 2003 12:08:22 -0000 1.1 @@ -0,0 +1,18 @@ + + + + + + select eo.role, eo.user_id, eo.role_id, eo.event_id, + decode(eo.public_role_p, 't', '(public role)', '') as public_role_p, + p.first_names || ' ' || p.last_name as organizer_name + from events_organizers eo, users u, persons p + where eo.user_id = u.user_id(+) + and p.person_id(+) = u.user_id + and eo.event_id = :event_id + order by role + + + + + Index: openacs-4/contrib/packages/events/www/admin/event-orders-oracle.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/events/www/admin/Attic/event-orders-oracle.xql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/events/www/admin/event-orders-oracle.xql 9 Mar 2003 12:08:22 -0000 1.1 @@ -0,0 +1,28 @@ + + + + + + select er.reg_id, person.name(er.user_id) as name, er.user_id, + pa.email, er.reg_state, ao.creation_date + from events_registrations er, parties pa, acs_objects ao + where er.user_id = pa.party_id + and er.event_id = :event_id + and reg_state <> 'canceled' + and er.reg_id = ao.object_id + + + + + + select er.reg_id, person.name(er.user_id) as name, er.user_id, + pa.email, er.reg_state, ao.creation_date + from events_registrations er, parties pa, acs_objects ao + where er.user_id = pa.party_id + and er.event_id = :event_id + and reg_state = :specific_reg_type + and er.reg_id = ao.object_id + + + + Index: openacs-4/contrib/packages/events/www/admin/event-orders-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/events/www/admin/Attic/event-orders-postgresql.xql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/events/www/admin/event-orders-postgresql.xql 9 Mar 2003 12:08:22 -0000 1.1 @@ -0,0 +1,28 @@ + + + + + + select er.reg_id, person__name(er.user_id) as name, er.user_id, + pa.email, er.reg_state, ao.creation_date + from events_registrations er, parties pa, acs_objects ao + where er.user_id = pa.party_id + and er.event_id = :event_id + and reg_state <> 'canceled' + and er.reg_id = ao.object_id + + + + + + select er.reg_id, person__name(er.user_id) as name, er.user_id, + pa.email, er.reg_state, ao.creation_date + from events_registrations er, parties pa, acs_objects ao + where er.user_id = pa.party_id + and er.event_id = :event_id + and reg_state = :specific_reg_type + and er.reg_id = ao.object_id + + + + Index: openacs-4/contrib/packages/events/www/admin/event-orders.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/events/www/admin/Attic/event-orders.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/events/www/admin/event-orders.adp 9 Mar 2003 12:08:22 -0000 1.1 @@ -0,0 +1,108 @@ + +@title@ +@context@ + + + + + + + + + + + + + + + + + + + + + +
    Activity@event_info.name@
    Location@event_info.city@
    Time@event_info.timespan@
    Registration Deadline@event_info.reg_deadline@
    + + + + + + + + + + + + + + + + +
    Max AllowedSpots RemainingApprovedPendingWaitingCanceled
    N/A@event_stats.max_people@N/A@count_spotsremaining@ + @event_stats.approved@@event_stats.pending@@event_stats.waiting@@event_stats.canceled@
    + +

    + The maximum number of people allowed have been registered for this event.
    + You cannot approve users unless you waitlist or cancel somebody
    + else's registration (or modify the maximum capacity of this this event)
    + + +

    + + + + +
      +
    • No registrants fit this category +
    +
    + + + + + + + + + + + + + + + + + + + + + + +
    Reg. IDNameEmailReg. DateReg. State
    @event_members.reg_id@@event_members.name@@event_members.email@@event_members.creation_date@ + + @event_members.reg_state@ + waitlist + - cancel + + + @event_members.reg_state@ +approve - + cancel + + + @event_members.reg_state@ +approve - + waitlist + - cancel + + + @event_members.reg_state@ +approve - + waitlist + + +
    +
    + +
    Index: openacs-4/contrib/packages/events/www/admin/event-orders.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/events/www/admin/Attic/event-orders.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/events/www/admin/event-orders.tcl 9 Mar 2003 12:08:22 -0000 1.1 @@ -0,0 +1,50 @@ +# events/www/admin/order-history-one.tcl + +ad_page_contract { + + displays the order history of an event + + @param event_id + @author Matthew Geddert (geddert@yahoo.com) + +} { + {specific_reg_type ""} + {event_id:integer} +} -properties { + event_members:multirow +} -validate { + event_exists_p -requires {event_id} { + if { ![events::event::exists_p -event_id $event_id] } { + ad_complain "We couldn't find the event you asked for." + return 0 + } + return 1 + } +} + +# what reg state do we plug into the database? +set date_format [parameter::get -parameter date_format -default "MM/DD/YYYY"] +set time_format [parameter::get -parameter time_format -default "HH12:MIam"] + +if {[string equal $specific_reg_type "canceled"] || + [string equal $specific_reg_type "approved"] || + [string equal $specific_reg_type "waiting"] || + [string equal $specific_reg_type "pending"]} { +db_multirow event_members select_specific_reg_type {} +} else { +db_multirow event_members select_event_members {} +} + +events::event::get_stats -event_id $event_id -array event_stats +events::event::get -event_id $event_id -array event_info +set title "Order History for $event_info(name)" +set context [list [list "activities" Activities] [list "activity?activity_id=$event_info(activity_id)" $event_info(name)] [list "event?event_id=$event_id" "$event_info(city)"] "Orders"] +set count_spotsremaining [expr $event_stats(max_people) - $event_stats(approved)] + +if { ![empty_string_p $event_stats(max_people)] && $count_spotsremaining == 0 } { + set max_approved t +} else { + set max_approved f +} + +ad_return_template Index: openacs-4/contrib/packages/events/www/admin/event-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/events/www/admin/Attic/event-postgresql.xql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/events/www/admin/event-postgresql.xql 9 Mar 2003 12:08:22 -0000 1.1 @@ -0,0 +1,20 @@ + + + + + + select eo.role, eo.user_id, eo.role_id, eo.event_id, + CASE WHEN eo.public_role_p THEN '(public role)' + ELSE '' + END as public_role_p, + p.first_names || ' ' || p.last_name as organizer_name + from + events_organizers eo left join users u on (eo.user_id = u.user_id), + persons p + where eo.event_id = :event_id + and p.person_id = u.user_id + order by role + + + + Index: openacs-4/contrib/packages/events/www/admin/event-price-ae-2.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/events/www/admin/Attic/event-price-ae-2.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/events/www/admin/event-price-ae-2.tcl 9 Mar 2003 12:08:22 -0000 1.1 @@ -0,0 +1,118 @@ +# File: events/admin/event-price-ae-2.tcl +# Owner: bryanche@arsdigita.com +# Purpose: Verify and insert price/ecommerce data +##### + +### we're not supporting prices yet. +return + +### if we were... +set_the_usual_form_variables +#event_id, +#maybe product_id, product_name, price, available_date, expire_date, price_id + +set user_id [ad_maybe_redirect_for_registration] + + + +set exception_count 0 +set exception_text "" + +### Error checking. +## simple checks... +if { [ns_dbformvalue [ns_conn form] available_time datetime available_time_value] <= 0 } { + incr exception_count + append exception_text "
  • Strange... couldn't parse the available time.\n" +} + +if { [ns_dbformvalue [ns_conn form] expire_time datetime expire_time_value] <= 0 } { + incr exception_count + append exception_text "
  • Strange... couldn't parse the expiration +time.\n" +} + +if {![exists_and_not_null product_name]} { + incr exception_count + append exception_text "
  • Please enter a price description.\n" +} + +if {![exists_and_not_null price]} { + incr excpetion_count + append exception_text "
  • Please enter a price.\n" +} + +if {![valid_number_p $price]} { + incr exception_count + append exception_text "
  • Please enter a valid number for the price.\n" +} + +## date check +set selection [ns_db 0or1row $db "select 1 + from dual, events_events + where to_date('$available_time_value', 'YYYY-MM-DD HH24:MI:SS') + < to_date('$expire_time_value', 'YYYY-MM-DD HH24:MI:SS') + and to_date('$expire_time_value', 'YYYY-MM-DD HH24:MI:SS') + <= end_time + and event_id = $event_id"] + +if {[empty_string_p $selection]} { + incr exception_count + append exception_text "
  • + Please make sure your avaiable time is before your + expiration time and your expiration time no later than + your event's end time.\n" +} + +## return with errors if any +if { $exception_count > 0 } { + ad_return_complaint $exception_count $exception_text + return +} + +## even if we were supporting prices, no ecommerce yet +#db_transaction { + +#db_dml unused "update ec_products +# set product_name = '$QQproduct_name', +# price = $price, +# last_modified = sysdate, +# last_modifying_user = $user_id, +# modified_ip_address = '[DoubleApos [ns_conn peeraddr]]', +# available_date = to_date('$available_time_value', 'YYYY-MM-DD HH24:MI:SS') +#where product_id = $product_id" + +db_dml unused "update events_prices + set expire_date = to_date('$expire_time_value', 'YYYY-MM-DD HH24:MI:SS'), + available_date = to_date('$available_time_value', 'YYYY-MM-DD HH24:MI:SS'), + description='$QQproduct_name', + price = $price + where price_id = $price_id" + +if {[db_resultrows] == 0} { + +## again, no ecommerce yet +# db_dml unused "insert into ec_products +# (product_id, product_name, creation_date, price, available_date, +# last_modified, last_modifying_user, modified_ip_address) +# values +# ($product_id, '$QQproduct_name', sysdate, $price, +# to_date('$available_time_value', 'YYYY-MM-DD HH24:MI:SS'), +# sysdate, $user_id, '[DoubleApos [ns_conn peeraddr]]')" + + db_dml unused "insert into events_prices + (price_id, event_id, description, expire_date, + available_date, price) + values + ($price_id, $event_id, '$QQproduct_name', + to_date('$expire_time_value', 'YYYY-MM-DD HH24:MI:SS'), + to_date('$available_time_value', 'YYYY-MM-DD HH24:MI:SS'), + $price)" +} + +### clean up, redirect. + +#} +db_release_unused_handles +ad_returnredirect "event.tcl?[export_url_vars event_id]" + +##### EOF Index: openacs-4/contrib/packages/events/www/admin/event-price-ae.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/events/www/admin/Attic/event-price-ae.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/events/www/admin/event-price-ae.tcl 9 Mar 2003 12:08:22 -0000 1.1 @@ -0,0 +1,102 @@ +# File: events/admin/event-price-ae.tcl +# Owner: bryanche@arsdigita.com +# Purpose: Allow admins to edit and update prices/ecommerce info +##### + +### we're not supporting prices at this time +return + +### but if we were... + +set_the_usual_form_variables +#event_id, maybe price_id + + + +set time_elements " + + Date available: + [_ns_dateentrywidget available_time] [_ns_timeentrywidget available_time] + + Date expires: + [_ns_dateentrywidget expire_time] [_ns_timeentrywidget expire_time] +" + +if {[exists_and_not_null price_id]} { + #we're editing + set adding_p 0 + + set page_title "Edit Price" + set submit_text "Update Price" + set selection [ns_db 1row $db "select + product_id, price, description as product_name, + to_char(available_date, 'YYYY-MM-DD HH24:MI:SS') as available_timestamp, + to_char(expire_date, 'YYYY-MM-DD HH24:MI:SS') as expire_timestamp, + price_id + from events_prices + where price_id = $price_id"] + + set_variables_after_query + + set end_time [db_string unused " + select to_char(end_time, 'YYYY-MM-DD HH24:MI:SS') + from events_events + where event_id = $event_id"] + +} else { + #we're adding + set adding_p 1 + + set page_title "Add New Price" + set submit_text "Add Price" +# set product_id [db_string unused "select ec_product_id_sequence.nextval from dual"] + set product_name "" + set price "" + set price_id [db_string unused "select events_price_id_sequence.nextval from dual"] + + set selection [ns_db 1row $db "select + to_char(sysdate, 'YYYY-MM-DD HH24:MI:SS') as available_timestamp, + to_char(end_time, 'YYYY-MM-DD HH24:MI:SS') as expire_timestamp + from events_events, dual + where event_id = $event_id"] + + set_variables_after_query + + set end_time $expire_timestamp +} + +set stuffed_with_a [ns_dbformvalueput $time_elements "available_time" + "timestamp" $available_timestamp] +set times [ns_dbformvalueput $stuffed_with_a "expire_time" + "timestamp" $expire_timestamp] + +set context_bar "[ad_admin_context_bar [list "index.tcl" "Events"] "Pricing"]" + +## Clean up, return the page +db_release_unused_handles + +ReturnHeaders + +ns_write " +[ad_partner_header] +
    +[export_form_vars price_id product_id event_id] + + + + +
    Price Description: + +
    Price: + +$times +(Expiration date can be no later than $end_time) +
    +

    +

    + +
    +
    +[ad_partner_footer]" + +##### EOF Index: openacs-4/contrib/packages/events/www/admin/event-toggle-available-p-oracle.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/events/www/admin/Attic/event-toggle-available-p-oracle.xql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/events/www/admin/event-toggle-available-p-oracle.xql 9 Mar 2003 12:08:22 -0000 1.1 @@ -0,0 +1,15 @@ + + + + oracle8.1.6 + + + + update ec_products + set active_p = '$event_info(available_p)', last_modified = sysdate, last_modifying_user = :user_id, + modified_ip_address = :peeraddr + where product_id = :product_id + + + + \ No newline at end of file Index: openacs-4/contrib/packages/events/www/admin/event-toggle-available-p-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/events/www/admin/Attic/event-toggle-available-p-postgresql.xql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/events/www/admin/event-toggle-available-p-postgresql.xql 9 Mar 2003 12:08:22 -0000 1.1 @@ -0,0 +1,17 @@ + + + + postgresql7.1 + + + + update ec_products + set active_p = '$event_info(available_p)', + last_modified = current_timestamp, + last_modifying_user = :user_id, + modified_ip_address = :peeraddr + where product_id = :product_id + + + + \ No newline at end of file Index: openacs-4/contrib/packages/events/www/admin/event-toggle-available-p.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/events/www/admin/Attic/event-toggle-available-p.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/events/www/admin/event-toggle-available-p.tcl 9 Mar 2003 12:08:22 -0000 1.1 @@ -0,0 +1,37 @@ +# events/www/admin/event-toggle-available-p.tcl + +ad_page_contract { + Toggles the availability of an event. + + @param event_id the event whose availability we're toggling + + @author Bryan Che (bryanche@arsdigita.com) + @cvs_id $Id: event-toggle-available-p.tcl,v 1.1 2003/03/09 12:08:22 lars Exp $ +} { + {event_id:integer,notnull} +} -validate { + event_exists_p -requires {event_id} { + if { ![events::event::exists_p -event_id $event_id] } { + ad_complain "We couldn't find the event you asked for." + return 0 + } + return 1 + } +} + +db_transaction { + + events::event::toggle_available_p -event_id $event_id + + events::event::get -event_id $event_id -array event_info + + if { [db_0or1row select_ecommerce_info {}] } { + set user_id [ad_get_user_id] + set peeraddr [ns_conn peeraddr] + + db_dml toggle_active_p_update {} + } + +} + +ad_returnredirect "event?event_id=$event_id" \ No newline at end of file Index: openacs-4/contrib/packages/events/www/admin/event-toggle-available-p.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/events/www/admin/Attic/event-toggle-available-p.xql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/events/www/admin/event-toggle-available-p.xql 9 Mar 2003 12:08:22 -0000 1.1 @@ -0,0 +1,10 @@ + + + + + + select ec_products.product_id from acs_objects, ec_products where acs_objects.context_id=:event_id and acs_objects.object_id=ec_products.product_id + + + + \ No newline at end of file Index: openacs-4/contrib/packages/events/www/admin/event.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/events/www/admin/Attic/event.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/events/www/admin/event.adp 9 Mar 2003 12:08:22 -0000 1.1 @@ -0,0 +1,154 @@ + +@title@ +@context@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    Creator@creator_name@
    Location@pretty_location@
    Confirmation Message@event_info.display_after@
    Time@event_info.timespan@
    Registration Deadline@event_info.reg_deadline@
    Event Statistics + + + + + + + + + + + + + + + + + + + + + + + +
    Max AllowedSpots RemainingApprovedPendingWaitingCanceled
    N/A@event_stats.max_people@N/A@count_spotsremaining@@event_stats.approved@@event_stats.pending@@event_stats.waiting@@event_stats.canceled@
    + + + + +
    Registration Cancellable?@event_info.pretty_reg_cancellable_p@
    Registration Needs Approval?@event_info.pretty_reg_needs_approval_p@
    Event Contact Person@contact_email@
    Availability StatusCurrent +   (toggle) + + + Discontinued +   (toggle) + +   +
    You may want to + email the registrants for this event + to notify them the event is canceled. +
    + + +
    + + + +

    Organizers

    + + + + +

    Agenda Files

    + + +
    + +

    Event Notes

    + Index: openacs-4/contrib/packages/events/www/admin/event.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/events/www/admin/Attic/event.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/events/www/admin/event.tcl 9 Mar 2003 12:08:22 -0000 1.1 @@ -0,0 +1,122 @@ +# events/www/admin/event.tcl + +ad_page_contract { + Purpose: List one event with details, for administration. + (that is, with links for altering and updating the event info) + + @param event_id the event at which we're looking + + @author Michael Steigman (michael@steigman.net) + @author Bryan Che (bryanche@arsdigita.com) + @cvs_id $Id: event.tcl,v 1.1 2003/03/09 12:08:22 lars Exp $ +} { + {event_id:integer,notnull} +} -properties { + custom_fields:multirow + org_roles:multirow + event_organizers:onevalue +} -validate { + event_exists_p -requires {event_id} { + if { ![events::event::exists_p -event_id $event_id] } { + ad_complain "We couldn't find the event you asked for." + return 0 + } + return 1 + } +} + +events::event::get -event_id $event_id -array event_info +events::event::get_stats -event_id $event_id -array event_stats + +set count_spotsremaining [expr $event_stats(max_people) - $event_stats(approved)] + +set contact_email [ad_convert_to_html $event_info(contact_email)] + +set pretty_location "" +if { [empty_string_p $event_info(city)] } { + append pretty_location "$event_info(name)" +} else { + append pretty_location "$event_info(city)" +} +if { ![empty_string_p $event_info(usps_abbrev)] } { + if { ![empty_string_p $event_info(city)] } { + append pretty_location ", " + } else { + append pretty_location " - " + } + append pretty_location "$event_info(usps_abbrev)" +} +set title "$pretty_location: $event_info(timespan)" +set context [list [list "activities" Activities] [list "activity?activity_id=$event_info(activity_id)" $event_info(name)] $pretty_location] + +set attachments_enabled_p [events::event::attachments_enabled_p] +if {$attachments_enabled_p} { + set attachments [attachments::get_attachments -base_url "../" -object_id $event_id] + set attachment_link "../attach/attach?object_id=$event_id&return_url=../admin/event?event_id=$event_id&pretty_name=$event_info(name)" +} + +set cancelled_p 0 +if {[string compare $event_info(available_p) "f"] == 0 && $event_stats(total_interested) > 0} { + set cancelled_p 1 +} + +#db_multirow custom_fields select_custom_fields {} +db_multirow org_roles select_org_roles {} +set event_organizers [db_string select_event_organizers_count {}] +#db_multirow eoe select_event_organizers_email {} + +events::event::get_creator -event_id $event_id -array creator_info +set creator_name $creator_info(name) +set creator_email $creator_info(email) + +form create event_notes + +element create event_notes event_id \ + -datatype integer \ + -widget hidden + +element create event_notes refreshments_note \ + -label "Refreshments Note" \ + -datatype text \ + -widget textarea \ + -html {cols 65 rows 6 wrap soft} \ + -optional + +element create event_notes av_note \ + -label "Audio/Visual Note" \ + -datatype text \ + -widget textarea \ + -html {cols 65 rows 6 wrap soft} \ + -optional + +element create event_notes additional_note\ + -label "Additional Note" \ + -datatype text \ + -widget textarea \ + -html {cols 65 rows 6 wrap soft} \ + -optional + +element create event_notes submit \ + -label "Update" \ + -datatype text \ + -widget submit + +if {[form is_submission event_notes]} { + template::form get_values event_notes \ + event_id refreshments_note av_note additional_note + + events::event::edit_event_notes \ + -event_id $event_id \ + -refreshments_note $refreshments_note \ + -av_note $av_note \ + -additional_note $additional_note + + ad_returnredirect "event?event_id=$event_id" +} + +element set_properties event_notes event_id -value $event_id +element set_properties event_notes refreshments_note -value $event_info(refreshments_note) +element set_properties event_notes av_note -value $event_info(av_note) +element set_properties event_notes additional_note -value $event_info(additional_note) + +ad_return_template Index: openacs-4/contrib/packages/events/www/admin/event.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/events/www/admin/Attic/event.xql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/events/www/admin/event.xql 9 Mar 2003 12:08:22 -0000 1.1 @@ -0,0 +1,49 @@ + + + + + + select count(*) + from events_organizers + where event_id = :event_id + and user_id is not null + + + + + + select distinct users.priv_email, users.user_id + from users, events_organizers eo, events_org_role_event_map eorem + where eorem.event_id = :event_id + and eorem.role_id = eo.role_id + and users.user_id = eo.user_id + order by users.user_id + + + + + + select eaam.attribute_id, aa.attribute_name as name, + aa.sort_order as after, aa.datatype, + eac.category_name, eac.category_id + from events_event_attr_map eaam, acs_attributes aa, + events_attr_categories eac, events_attr_category_map eacm + where eaam.event_id = :event_id + and eaam.attribute_id = aa.attribute_id + and eacm.attribute_id = aa.attribute_id + and eacm.category_id = eac.category_id + order by eac.category_name, aa.sort_order asc + + + + + + select column_name, pretty_name, column_type, column_actual_type, + column_extra, sort_key + from events_event_fields + where event_id = :event_id + order by sort_key + + + + Index: openacs-4/contrib/packages/events/www/admin/field-add.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/events/www/admin/field-add.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/events/www/admin/field-add.adp 9 Mar 2003 12:08:22 -0000 1.1 @@ -0,0 +1,15 @@ + +@title@ +@context_bar@ + +

    Choose a field (or fields)

    + +
    + +
    +If you do not see the field you wish to add above, you may add a new field +

    +
    + + + Index: openacs-4/contrib/packages/events/www/admin/field-add.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/events/www/admin/field-add.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/events/www/admin/field-add.tcl 9 Mar 2003 12:08:22 -0000 1.1 @@ -0,0 +1,89 @@ +# File: events/www/admin/field-add.tcl + +ad_page_contract { + Allows admins to select from existing custom fields + + @param activity_id the field's activity + @param event_id the field's event + + @author Michael Steigman (michael@steigman.net) + @author Bryan Che (bryanche@arsdigita.com) + @cvs_id activity-field-remove.tcl,v 3.6.6.4 2000/09/22 01:37:35 kevin Exp +} { + {event_id ""} + {activity_id ""} + {attribute_ids:multiple ""} +} + +if {[exists_and_not_null event_id]} { + set title "Add Custom Fields" + set field_create "field-create?activity_id=$activity_id&event_id=$event_id" + set context_bar [ad_context_bar [list "activities" "Activities"] \ + [list "activity?activity_id=$activity_id" "Activity"] \ + [list "event?event_id=$event_id" "Event"] "Add Custom Fields"] + set attributes [db_list_of_lists select_available_event_fields {}] +} else { + set title "Add Default Custom Fields" + set field_create "field-create?activity_id=$activity_id" + set context_bar [ad_context_bar [list "activities" "Activities"] \ + [list "activity?activity_id=$activity_id" "Activity"] "Add Default Custom Fields"] + set attributes [db_list_of_lists select_available_activity_fields {}] +} + +if {[exists_and_not_null attributes]} { + set attributes_p t +} else { + set attributes_p f +} + +form create field_add + +element create field_add activity_id \ + -optional \ + -widget hidden \ + -datatype integer + +element create field_add event_id \ + -optional \ + -widget hidden \ + -datatype integer + +element create field_add attribute_ids \ + -label "Available Fields" \ + -widget multiselect \ + -datatype integer \ + -help_text "Select multiple fields by holding down the Control key" \ + -options $attributes + +element create field_add submit \ + -label "Add fields" \ + -datatype text \ + -widget submit + +if {[template::form is_valid field_add]} { + + if {[exists_and_not_null event_id]} { + foreach attribute_id $attribute_ids { + events::registration::map_attribute -event_id $event_id -attribute_id $attribute_id + } + set redirect_url "event?event_id=$event_id" + } else { + foreach attribute_id $attribute_ids { + events::registration::map_attribute -activity_id $activity_id -attribute_id $attribute_id + } + set redirect_url "activity?activity_id=$activity_id" + } + + ad_returnredirect $redirect_url + ad_script_abort + +} + +if {[exists_and_not_null event_id]} { + element set_properties field_add activity_id -value $activity_id + element set_properties field_add event_id -value $event_id +} else { + element set_properties field_add activity_id -value $activity_id +} + +ad_return_template Index: openacs-4/contrib/packages/events/www/admin/field-add.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/events/www/admin/field-add.xql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/events/www/admin/field-add.xql 9 Mar 2003 12:08:22 -0000 1.1 @@ -0,0 +1,34 @@ + + + + + + select eac.category_name || ' >> ' || aa.attribute_name || ' ( datatype : ' || aa.datatype || ' )' as name, + aa.attribute_id + from acs_attributes aa, events_attr_categories eac, + events_attr_category_map eacm + where eacm.attribute_id = aa.attribute_id + and eacm.category_id = eac.category_id + and aa.attribute_id not in (select attribute_id + from events_def_actvty_attr_map + where activity_id = :activity_id) + order by name asc + + + + + + select eac.category_name || ' >> ' || aa.attribute_name || ' ( datatype : ' || aa.datatype || ' )' as name, + aa.attribute_id + from acs_attributes aa, events_attr_categories eac, + events_attr_category_map eacm + where eacm.attribute_id = aa.attribute_id + and eacm.category_id = eac.category_id + and aa.attribute_id not in (select attribute_id + from events_event_attr_map + where event_id = :event_id) + order by name asc + + + + Index: openacs-4/contrib/packages/events/www/admin/field-create.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/events/www/admin/field-create.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/events/www/admin/field-create.adp 9 Mar 2003 12:08:22 -0000 1.1 @@ -0,0 +1,12 @@ + +@title@ +@context_bar@ + +

    +Add a new field +

    + +
    + +
    + Index: openacs-4/contrib/packages/events/www/admin/field-create.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/events/www/admin/field-create.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/events/www/admin/field-create.tcl 9 Mar 2003 12:08:22 -0000 1.1 @@ -0,0 +1,119 @@ +# events/www/admin/field-add.tcl + +ad_page_contract { + Purpose: allows admins to add a custom field to the registrations + forms for the specified event. + + @param event_id the activity to which we are adding a field + @param after field after which this new field will appear + + @author Michael Steigman (michael@steigman.net) + @author Bryan Che (bryanche@arsdigita.com) + @cvs_id activity-field-add.tcl,v 3.6.6.4 2000/09/22 01:37:35 kevin Exp +} { + {event_id:integer,optional} + {activity_id:integer,optional} + {after:optional} +} + +set datatypes [db_list_of_lists select_attribute_datatypes {}] + +set categories [db_list_of_lists select_categories {}] + +if {[exists_and_not_null event_id]} { + set context_bar [ad_context_bar [list "activities" Activities] [list "activity?activity_id=$activity_id" Activity] [list "event?event_id=$event_id" Event] "Custom Field"] + set title "Add a New Custom Field" +} elseif {[exists_and_not_null activity_id]} { + set context_bar [ad_context_bar [list "activities" Activities] [list "activity?activity_id=$activity_id" Activity] "Custom Field"] + set title "Add a New Default Custom Field" +} else { + set context_bar [ad_context_bar [list "fields" "Custom Fields"] "Custom Field"] + set title "Add a New Custom Field" +} + +form create custom_field + +element create custom_field activity_id \ + -datatype integer \ + -widget hidden \ + -optional + +element create custom_field event_id \ + -datatype integer \ + -widget hidden \ + -optional + +#element create custom_field after \ +# -label "After" \ +# -datatype integer \ +# -widget hidden + +element create custom_field attribute_name \ + -label "Field Name" \ + -datatype text \ + -widget text \ + -html {size 40} + +element create custom_field pretty_name \ + -label "Pretty Name" \ + -datatype text \ + -widget text \ + -html {size 40} + +element create custom_field pretty_plural \ + -label "Pretty Plural" \ + -datatype text \ + -widget text \ + -html {size 40} + +element create custom_field datatype \ + -label "Type of Data" \ + -datatype text \ + -widget select \ + -options $datatypes + +element create custom_field category_id \ + -label "Category" \ + -datatype text \ + -widget select \ + -options $categories + +if {[template::form is_valid custom_field]} { + template::form get_values custom_field attribute_name \ + pretty_name pretty_plural datatype category_id + + set attribute_id [events::registration::new_attribute \ + -attribute_name $attribute_name \ + -pretty_name $pretty_name \ + -pretty_plural $pretty_plural \ + -category_id $category_id \ + -datatype $datatype] + + if {[exists_and_not_null event_id]} { + set redirect_url "event?event_id=$event_id" + events::registration::map_attribute -event_id $event_id \ + -attribute_id $attribute_id + } elseif {[exists_and_not_null activity_id]} { + set redirect_url "event?activity_id=$activity_id" + events::registration::map_attribute -activity_id $activity_id \ + -attribute_id $attribute_id + } else { + set redirect_url "fields?field_id=$activity_id" + } + + ad_returnredirect $redirect_url + ad_script_abort +} + +if {[exists_and_not_null event_id]} { + element set_properties custom_field event_id -value $event_id + element set_properties custom_field activity_id -value $activity_id +} elseif {[exists_and_not_null activity_id]} { + element set_properties custom_field activity_id -value $activity_id +} + +if {[exists_and_not_null after]} { + element set_properties custom_field after -value $after +} + +ad_return_template Index: openacs-4/contrib/packages/events/www/admin/field-create.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/events/www/admin/field-create.xql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/events/www/admin/field-create.xql 9 Mar 2003 12:08:22 -0000 1.1 @@ -0,0 +1,18 @@ + + + + + + select datatype, datatype + from acs_datatypes + + + + + + select category_name, category_id + from events_attr_categories + + + + Index: openacs-4/contrib/packages/events/www/admin/field-delete.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/events/www/admin/field-delete.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/events/www/admin/field-delete.adp 9 Mar 2003 12:08:22 -0000 1.1 @@ -0,0 +1,10 @@ + +@title@ +@context_bar@ + +

    @prompt@

    + +
    + +
    + Index: openacs-4/contrib/packages/events/www/admin/field-delete.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/events/www/admin/field-delete.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/events/www/admin/field-delete.tcl 9 Mar 2003 12:08:22 -0000 1.1 @@ -0,0 +1,50 @@ +# File: events/www/admin/field-delete.tcl + +ad_page_contract { + Allows admins to confirm the removal of a field + + @param role_id the id of the role + + @author Michael Steigman (michael@steigman.net) + @author Bryan Che (bryanche@arsdigita.com) + @cvs_id activity-field-remove.tcl,v 3.6.6.4 2000/09/22 01:37:35 kevin Exp +} { + {attribute_id:naturalnum,notnull} +} + +events::registration::get_attribute -attribute_id $attribute_id -array attribute_info + +set title "Delete Field?" + +set context_bar [ad_context_bar [list "fields" "Custom Fields"] [list "field?attribute_id=$attribute_id" "Custom Field"] "Delete Custom Field"] + +set prompt "Delete custom field from system?" + +form create field_delete + +element create field_delete field \ + -label "Custom Field" \ + -datatype text \ + -widget inform \ + -value $attribute_info(name) + +element create field_delete attribute_id \ + -datatype integer \ + -widget hidden \ + -value $attribute_id + +element create field_delete submit \ + -label "Delete field" \ + -datatype text \ + -widget submit + +if {[template::form is_valid field_delete]} { + events::registration::delete_attribute \ + -attribute_id $attribute_id \ + -attribute_name $attribute_info(name) + + ad_returnredirect fields + ad_script_abort +} + +ad_return_template Index: openacs-4/contrib/packages/events/www/admin/field-edit.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/events/www/admin/field-edit.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/events/www/admin/field-edit.adp 9 Mar 2003 12:08:22 -0000 1.1 @@ -0,0 +1,12 @@ + +@title@ +@context_bar@ + +

    +Edit a custom field +

    + +
    + +
    + Index: openacs-4/contrib/packages/events/www/admin/field-edit.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/events/www/admin/field-edit.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/events/www/admin/field-edit.tcl 9 Mar 2003 12:08:22 -0000 1.1 @@ -0,0 +1,86 @@ +# events/www/admin/field-edit.tcl + +ad_page_contract { + Allows admins to confirm the removal of a field + associated with the selected activity/event + + @param attribute_id the name of the field's table column + + @author Michael Steigman (michael@steigman.net) + @author Bryan Che (bryanche@arsdigita.com) + @cvs_id activity-field-remove.tcl,v 3.6.6.4 2000/09/22 01:37:35 kevin Exp +} { + {attribute_id:integer,notnull} +} + +set datatypes [db_list_of_lists select_attribute_datatypes {}] + +set categories [db_list_of_lists select_categories {}] + +set context_bar [ad_context_bar [list "fields" "Custom Fields"] "Edit Custom Field"] + +set title "Edit Custom Field" + +form create custom_field + +element create custom_field attribute_id \ + -datatype integer \ + -widget hidden \ + -value $attribute_id + +element create custom_field attribute_name \ + -label "Field Name" \ + -datatype text \ + -widget text \ + -html {size 40} + +element create custom_field pretty_name \ + -label "Pretty Name" \ + -datatype text \ + -widget text \ + -html {size 40} + +element create custom_field pretty_plural \ + -label "Pretty Plural" \ + -datatype text \ + -widget text \ + -html {size 40} + +element create custom_field datatype \ + -label "Type of Data" \ + -datatype text \ + -widget select \ + -options $datatypes + +element create custom_field category_id \ + -label "Category" \ + -datatype text \ + -widget select \ + -options $categories + +if {[template::form is_valid custom_field]} { + template::form get_values custom_field attribute_name \ + pretty_name pretty_plural datatype category_id + + events::registration::edit_attribute \ + -attribute_id $attribute_id \ + -attribute_name $attribute_name \ + -pretty_name $pretty_name \ + -pretty_plural $pretty_plural \ + -category_id $category_id \ + -datatype $datatype + + set redirect_url "fields?attribute_id=$attribute_id" + ad_returnredirect $redirect_url + ad_script_abort +} + +events::registration::get_attribute -attribute_id $attribute_id -array attribute_info + +element set_properties custom_field attribute_name -value $attribute_info(name) +element set_properties custom_field pretty_name -value $attribute_info(pretty_name) +element set_properties custom_field pretty_plural -value $attribute_info(pretty_plural) +element set_properties custom_field datatype -value $attribute_info(datatype) +element set_properties custom_field category_id -value $attribute_info(category_id) + +ad_return_template Index: openacs-4/contrib/packages/events/www/admin/field-edit.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/events/www/admin/field-edit.xql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/events/www/admin/field-edit.xql 9 Mar 2003 12:08:22 -0000 1.1 @@ -0,0 +1,18 @@ + + + + + + select datatype, datatype + from acs_datatypes + + + + + + select category_name, category_id + from events_attr_categories + + + + Index: openacs-4/contrib/packages/events/www/admin/field-remove.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/events/www/admin/field-remove.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/events/www/admin/field-remove.adp 9 Mar 2003 12:08:22 -0000 1.1 @@ -0,0 +1,12 @@ + +@title@ +@context_bar@ + +

    +@prompt@ +

    + +

    + +
    + Index: openacs-4/contrib/packages/events/www/admin/field-remove.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/events/www/admin/field-remove.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/events/www/admin/field-remove.tcl 9 Mar 2003 12:08:22 -0000 1.1 @@ -0,0 +1,87 @@ +# File: events/www/admin/activity-field-delete.tcl + +ad_page_contract { + Allows admins to confirm the removal of a field + associated with the selected activity/event + + @param activity_id the field's activity + @param event_id the field's event + @param attribute_name the name of the field's table column + @param attribute_id the name of the field's table column + + @author Michael Steigman (michael@steigman.net) + @author Bryan Che (bryanche@arsdigita.com) + @cvs_id activity-field-remove.tcl,v 3.6.6.4 2000/09/22 01:37:35 kevin Exp +} { + {event_id ""} + {activity_id ""} + {attribute_id:integer,notnull} + {attribute_name ""} +} + +if {[exists_and_not_null event_id]} { + events::event::get -event_id $event_id -array info + set context_bar [ad_context_bar [list "activities" Activities] [list "activity?activity_id=$activity_id" Activity] [list "event?event_id=$event_id" Event] "Remove Custom Field"] +} else { + events::activity::get -activity_id $activity_id -array info + set context_bar [ad_context_bar [list "activities" Activities] [list "activity?activity_id=$activity_id" Activity] "Remove Custom Field"] +} + +set title "Remove Custom Field?" + +set prompt "Remove field from $info(name)?" + +form create field_remove + +element create field_remove activity_id \ + -datatype integer \ + -optional \ + -widget hidden + +element create field_remove event_id \ + -datatype integer \ + -optional \ + -widget hidden + +element create field_remove attribute_name \ + -label "Field Name" \ + -datatype integer \ + -widget inform \ + -optional \ + -value $attribute_name + +element create field_remove attribute_id \ + -datatype integer \ + -widget hidden \ + -value $attribute_id + +element create field_remove submit \ + -label "Remove custom field" \ + -datatype text \ + -widget submit + +if {[template::form is_valid field_remove]} { + template::form get_values field_remove attribute_id + + if {[exists_and_not_null event_id]} { + set redirect_url "event?event_id=$event_id" + events::registration::unmap_attribute -attribute_id $attribute_id \ + -event_id $event_id + } else { + set redirect_url "activity?activity_id=$activity_id" + events::registration::unmap_attribute -attribute_id $attribute_id \ + -activity_id $activity_id + } + + ad_returnredirect $redirect_url + ad_script_abort +} + +if {[exists_and_not_null event_id]} { + element set_properties field_remove activity_id -value $activity_id + element set_properties field_remove event_id -value $event_id +} else { + element set_properties field_remove activity_id -value $activity_id +} + +ad_return_template Index: openacs-4/contrib/packages/events/www/admin/field.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/events/www/admin/field.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/events/www/admin/field.adp 9 Mar 2003 12:08:22 -0000 1.1 @@ -0,0 +1,64 @@ + +@attribute_info.name@ +@context_bar@ + +

    Events using this field

    + +
      + + +
    • @eam.name@ (@eam.pretty_start_date@ - @eam.pretty_end_date@)
    • +
      +
      + +
    • No events are currently using this field
    • +
      +
    + +

    Activities using the field

    + +
      + + +
    • @aam.name@
    • +
      +
      + +
    • No activities are currently using this field
    • +
      +
    + +

    Custom Field Description

    + + + + + + + + + + + + + + + + + + + + + + + + + + +
    Name@attribute_info.name@
    Pretty Name@attribute_info.pretty_name@
    Pretty Plural@attribute_info.pretty_plural@
    Data type@attribute_info.datatype@
    Category@attribute_info.category_name@
    Sort Order@attribute_info.sort_order@
    + + + Index: openacs-4/contrib/packages/events/www/admin/field.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/events/www/admin/field.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/events/www/admin/field.tcl 9 Mar 2003 12:08:22 -0000 1.1 @@ -0,0 +1,25 @@ +# events/www/admin/fields.tcl + +ad_page_contract { + Displays a list of fields + Details for specific roles are one click deep. + + @author Michael Steigman (michael@steigman.net) + @author Bryan Che (bryanche@arsdigita.com) + @cvs_id activities.tcl,v 3.8.2.6 2000/09/22 01:37:34 kevin Exp + +} { + {attribute_id:naturalnum,notnull} +} + +set title "One Custom Field" + +set context_bar [ad_context_bar [list "fields" "Custom Fields"] "One Custom Field"] + +events::registration::get_attribute -attribute_id $attribute_id -array attribute_info + +db_multirow aam select_activity_custom_field_mappings {} + +db_multirow eam select_event_custom_field_mappings {} + +ad_return_template Index: openacs-4/contrib/packages/events/www/admin/field.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/events/www/admin/field.xql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/events/www/admin/field.xql 9 Mar 2003 12:08:22 -0000 1.1 @@ -0,0 +1,33 @@ + + + + + + select aa.activity_id, aa.name + from events_activities ea, events_def_actvty_attr_map edaam, + acs_activities aa + where aa.activity_id = ea.activity_id + and ea.activity_id = edaam.activity_id + and edaam.attribute_id = :attribute_id + order by aa.name asc + + + + + + select ee.event_id, aa.name, + to_char(t.start_date, 'fmMonth DD, YYYY, HH12:MI PM') as pretty_start_date, + to_char(t.end_date, 'fmMonth DD, YYYY, HH12:MI PM') as pretty_end_date + from events_events ee, events_event_attr_map eeam, + acs_events ae, acs_activities aa, timespans s, time_intervals t + where ee.event_id = eeam.event_id + and eeam.event_id = ae.event_id + and aa.activity_id = ae.activity_id + and ae.timespan_id = s.timespan_id + and s.interval_id = t.interval_id + and eeam.attribute_id = :attribute_id + order by aa.name asc + + + + Index: openacs-4/contrib/packages/events/www/admin/fields.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/events/www/admin/fields.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/events/www/admin/fields.adp 9 Mar 2003 12:08:22 -0000 1.1 @@ -0,0 +1,29 @@ + +Custom Fields +@context_bar@ + + + +

    Custom Fields

    +You may define custom fields that you would like to collect from registrants. + +

    +Custom fields currently in the system: + + + + +
    + +

    +

      +
    • There are no custom fields in the system. You may add a new one
    • +
    +
    Index: openacs-4/contrib/packages/events/www/admin/fields.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/events/www/admin/fields.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/events/www/admin/fields.tcl 9 Mar 2003 12:08:22 -0000 1.1 @@ -0,0 +1,19 @@ +# events/www/admin/roles.tcl +ad_page_contract { + Displays a list of roles + Details for specific roles are one click deep. + + @author Michael Steigman (michael@steigman.net) + @author Bryan Che (bryanche@arsdigita.com) + @cvs_id activities.tcl,v 3.8.2.6 2000/09/22 01:37:34 kevin Exp + +} { +} -properties { + custom_fields:multirow +} + +set context_bar [ad_context_bar "Custom Fields"] + +db_multirow custom_fields select_custom_fields {} + +ad_return_template Index: openacs-4/contrib/packages/events/www/admin/fields.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/events/www/admin/fields.xql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/events/www/admin/fields.xql 9 Mar 2003 12:08:22 -0000 1.1 @@ -0,0 +1,17 @@ + + + + + + select aa.attribute_id, aa.attribute_name as name, + aa.sort_order as after, aa.datatype, + eac.category_name, eac.category_id + from acs_attributes aa, events_attr_categories eac, + events_attr_category_map eacm + where aa.attribute_id = eacm.attribute_id + and eacm.category_id = eac.category_id + order by eac.category_name, aa.sort_order asc + + + + Index: openacs-4/contrib/packages/events/www/admin/index-oracle.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/events/www/admin/index-oracle.xql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/events/www/admin/index-oracle.xql 9 Mar 2003 12:08:22 -0000 1.1 @@ -0,0 +1,31 @@ + + + + + + select CASE WHEN to_char(t.start_date, 'YYYY-MM-DD') = to_char(t.end_date, 'YYYY-MM-DD') + THEN to_char(t.start_date, :date_format) || ' (' || to_char(t.start_date, :time_format) || ' - ' || to_char(t.end_date, :time_format) || ')' + ELSE to_char(t.start_date, :date_format) || ' ' || to_char(t.start_date, :time_format) || ' - ' || to_char(t.end_date, :date_format) || ' ' || to_char(t.end_date, :time_format) + END as timespan, + nvl(e.name, a.name) as name, + e.event_id, + v.city + from acs_activities a, + acs_events e, + events_activities ea, + events_events ee, + timespans s, + time_intervals t, + events_venues v + where e.timespan_id = s.timespan_id + and s.interval_id = t.interval_id + and e.activity_id = a.activity_id + and a.activity_id = ea.activity_id + and e.event_id = ee.event_id + and v.venue_id = ee.venue_id + and ee.available_p = 't' + and ea.package_id = :package_id + + + + Index: openacs-4/contrib/packages/events/www/admin/index-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/events/www/admin/Attic/index-postgresql.xql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/events/www/admin/index-postgresql.xql 9 Mar 2003 12:08:22 -0000 1.1 @@ -0,0 +1,31 @@ + + + + + + select CASE WHEN to_char(t.start_date, 'YYYY-MM-DD') = to_char(t.end_date, 'YYYY-MM-DD') + THEN to_char(t.start_date, :date_format) || ' (' || to_char(t.start_date, :time_format) || ' - ' || to_char(t.end_date, :time_format) || ')' + ELSE to_char(t.start_date, :date_format) || ' ' || to_char(t.start_date, :time_format) || ' - ' || to_char(t.end_date, :date_format) || ' ' || to_char(t.end_date, :time_format) + END as timespan, + coalesce(e.name, a.name) as name, + e.event_id, + v.city + from acs_activities a, + acs_events e, + events_activities ea, + events_events ee, + timespans s, + time_intervals t, + events_venues v + where e.timespan_id = s.timespan_id + and s.interval_id = t.interval_id + and e.activity_id = a.activity_id + and a.activity_id = ea.activity_id + and e.event_id = ee.event_id + and v.venue_id = ee.venue_id + and ee.available_p = 't' + and ea.package_id = :package_id + + + + Index: openacs-4/contrib/packages/events/www/admin/index.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/events/www/admin/Attic/index.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/events/www/admin/index.adp 9 Mar 2003 12:08:22 -0000 1.1 @@ -0,0 +1,39 @@ + +Events Administration +@context_bar@ + + +

    +(Note: To add/edit an event, you must first go to the +activities page to select the type of +activity for your event. Then, you may add/edit an event +based upon that activity.) + + +

    Current Events Registration Status

    + + +
      +
    • There are no current events to display +
    +
    + + + + + + + + + + + +
    ActivityLocationDate
    + @available_events_and_locations.name@@available_events_and_locations.city@@available_events_and_locations.timespan@
    +
    + +

    Index: openacs-4/contrib/packages/events/www/admin/index.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/events/www/admin/Attic/index.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/events/www/admin/index.tcl 9 Mar 2003 12:08:22 -0000 1.1 @@ -0,0 +1,41 @@ +# /events/www/admin/index.tcl + +ad_page_contract { + + Displays all upcoming events and the breakdown of registrations + for them. Offers various admin options, such as looking at + registration stats or available venues/activities. New event + creation, and checking out/editing events not currently available to + the public, must be done through subsidiary pages. + @param orderby for ad_table + + This is the index page for events administration. + + @author Matthew Geddert (geddert@yahoo.com) + @author Michael Steigman (michael@steigman.net) + @author Bryan Che (bryanche@arsdigita.com) + @cvs-id $Id index.tcl,v 3.19.2.5 2000/09/22 01:37:37 kevin Exp $ +} { +} -properties { + available_events_and_locations:multirow + context_bar:onevalue +} + + +ad_require_permission [ad_conn package_id] admin +set package_id [ad_conn package_id] +set context_bar [ad_context_bar] + +set date_format [parameter::get -parameter date_format -default "MM/DD/YYYY"] +set time_format [parameter::get -parameter time_format -default "HH12:MIam"] + +db_multirow available_events_and_locations select_available_events_and_locations {} + +ad_return_template + + + + + + + Index: openacs-4/contrib/packages/events/www/admin/join-groups.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/events/www/admin/join-groups.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/events/www/admin/join-groups.tcl 9 Mar 2003 12:08:22 -0000 1.1 @@ -0,0 +1,67 @@ +ad_page_contract { + Adds user to all user groups which own event activities. + + @param dummy parameter that prevents people from accidentally clicking on this page and joining a bunch of groups + + @author Bryan Che (bryanche@arsdigita.com) + @cvs_id join-groups.tcl,v 1.1.2.4 2000/09/22 01:35:07 kevin Exp +} { + {proceed:notnull} +} + +#we force this page to take a variable so that someone can't just +#load the page and accidentally join all the user groups + +set user_id [ad_verify_and_get_user_id] + +append whole_page " +[ad_header "Joined Groups"] +

    Joined Groups

    +[ad_admin_context_bar [list "index" "Events"] "Join Groups"] +
    +You were added as an administrator to the following groups: +
      +" + +db_transaction { + + set groups_html "" + + set ip_address [ns_conn peeraddr] + + db_foreach evnt_sel_groups_to_join { + select + distinct ug.group_id, ug.group_name, ug.group_type + from user_groups ug, events_activities a + where ug.group_id = a.group_id + and ug.group_id not in + (select group_id + from user_group_map + where user_id = :user_id) + } { + db_dml evnt_join_ug { + insert into user_group_map + (group_id, user_id, role, mapping_user, mapping_ip_address) + values + (:group_id, :user_id, 'administrator', :user_id, :ip_address) + } + append groups_html "
    • $group_name ($group_type group type)" + } +} + +if {[empty_string_p $groups_html]} { + append whole_page "
    • You were not added to any groups. You + probably already belonged to them all." +} else { + append whole_page $groups_html +} + +append whole_page " +
    + +[ad_footer] +" + + +doc_return 200 text/html $whole_page + Index: openacs-4/contrib/packages/events/www/admin/one-role.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/events/www/admin/Attic/one-role.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/events/www/admin/one-role.adp 9 Mar 2003 12:08:22 -0000 1.1 @@ -0,0 +1,52 @@ + +@role_info.role@ +@context_bar@ + +

    Event associations

    + +
      + + +
    • @erm.name@ (@erm.pretty_start_date@ - @erm.pretty_end_date@)
    • +
      +
      + +
    • No event mappings for this role
    • +
      +
    + +

    Activity associations

    + +
      + + +
    • @arm.name@
    • +
      +
      + +
    • No activity mappings for this role
    • +
      +
    + +

    Role Description

    + + + + + + + + + + + + + + +
    Role Name@role_info.role@
    Responsibilities@role_info.responsibilities@
    Public Role?YesNo
    + + + Index: openacs-4/contrib/packages/events/www/admin/one-role.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/events/www/admin/Attic/one-role.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/events/www/admin/one-role.tcl 9 Mar 2003 12:08:22 -0000 1.1 @@ -0,0 +1,25 @@ +# events/www/admin/roles.tcl + +ad_page_contract { + Displays a list of roles + Details for specific roles are one click deep. + + @author Michael Steigman (michael@steigman.net) + @author Bryan Che (bryanche@arsdigita.com) + @cvs_id $Id: one-role.tcl,v 1.1 2003/03/09 12:08:22 lars Exp $ + +} { + {role_id:naturalnum,notnull} +} + +set title "One Role" + +set context_bar [ad_context_bar [list "roles" "Roles"] "One Role"] + +events::organizer::get_role -role_id $role_id -array role_info + +db_multirow arm select_activity_role_mappings {} + +db_multirow erm select_event_role_mappings {} + +ad_return_template Index: openacs-4/contrib/packages/events/www/admin/one-role.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/events/www/admin/Attic/one-role.xql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/events/www/admin/one-role.xql 9 Mar 2003 12:08:22 -0000 1.1 @@ -0,0 +1,33 @@ + + + + + + select aa.activity_id, aa.name + from events_activities ea, events_org_role_activity_map eoram, + acs_activities aa + where aa.activity_id = ea.activity_id + and ea.activity_id = eoram.activity_id + and eoram.role_id = :role_id + order by aa.name asc + + + + + + select ee.event_id, aa.name, + to_char(t.start_date, 'Month DD, YYYY HH12:MI PM') as pretty_start_date, + to_char(t.end_date, 'Month DD, YYYY HH12:MI PM') as pretty_end_date + from events_events ee, events_org_role_event_map eorem, + acs_events ae, acs_activities aa, timespans s, time_intervals t + where ee.event_id = eorem.event_id + and eorem.event_id = ae.event_id + and aa.activity_id = ae.activity_id + and ae.timespan_id = s.timespan_id + and s.interval_id = t.interval_id + and eorem.role_id = :role_id + order by aa.name asc + + + + Index: openacs-4/contrib/packages/events/www/admin/order-history-activity.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/events/www/admin/order-history-activity.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/events/www/admin/order-history-activity.tcl 9 Mar 2003 12:08:22 -0000 1.1 @@ -0,0 +1,77 @@ +# File: events/admin/order-history-activity.tcl +# Owner: bryanche@arsdigita.com +# Purpose: Display order history grouped by activity +##### +ad_page_contract { + Display order history grouped by activity + + @author Bryan Che (bryanche@arsdigita.com) + @cvs_id order-history-activity.tcl,v 3.6.6.4 2000/09/22 01:37:37 kevin Exp +} { +} + + +set admin_id [ad_maybe_redirect_for_registration] + +set whole_page "" + +append whole_page "[ad_header "[ad_system_name] Events Administration: Order History - By Activity"] + +

    Order History - By Activity

    +[ad_context_bar_ws [list "index.tcl" "Events Administration"] [list "order-history.tcl" "Order History"] "By Activity"] +
    + + + + + \n" + } else { + append whole_page "
    Activity # +Name +Registrations +" + + + +# count the number of orders (in events_registrations) for each activity_id in +# events_activities + +db_foreach sel_activities "select + a.short_name, a.activity_id, count(r.reg_id) as n_reg + from events_activities a, events_registrations r, events_events e, + events_prices p + where p.event_id = e.event_id + and p.price_id = r.price_id(+) + and a.activity_id = e.activity_id + and a.group_id in (select distinct group_id + from user_group_map + where user_id = :admin_id) + group by a.activity_id, a.short_name +union + select a.short_name, a.activity_id, count(r.reg_id) as n_reg + from events_activities a, events_registrations r, events_events e, + events_prices p + where p.event_id = e.event_id + and p.price_id = r.price_id(+) + and a.activity_id = e.activity_id + and a.group_id is null + group by a.activity_id, a.short_name + order by activity_id +" { + append whole_page " +
    $activity_id + $short_name + " + if {$n_reg > 0} { + append whole_page " + $n_reg
    $n_reg" + } +} +## clean up, return page. +append whole_page "
    \n [ad_footer] " + + + +doc_return 200 text/html $whole_page + +##### EOF Index: openacs-4/contrib/packages/events/www/admin/order-history-date.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/events/www/admin/order-history-date.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/events/www/admin/order-history-date.tcl 9 Mar 2003 12:08:22 -0000 1.1 @@ -0,0 +1,88 @@ +# File: events/admin/order-history-date.tcl +# Owner: bryanche@arsdigita.com +# Purpose: Displays order-history grouped by date. +##### + +ad_page_contract { + Displays order-history grouped by date. + + @param year optional arg for what year to view + @param month optional arg for what month to view + + @author Bryan Che (bryanche@arsdigita.com) + @cvs_id order-history-date.tcl,v 3.10.2.5 2000/09/22 01:37:37 kevin Exp +} { + {year:optional} + {month:optional} +} + +set admin_id [ad_maybe_redirect_for_registration] + +if {[info exists year] && [info exists month]} { + set page_title "Orders in $month $year" + set where_clause " + where to_char(reg_date,'fmMonth') = :month + and to_char(reg_date,'YYYY') = :year + and " +} else { + set page_title "Orders by Date" + set where_clause "where" +} + +# prepare page to be returned +set whole_page "" + +append whole_page "[ad_header $page_title] + +

    $page_title

    +[ad_context_bar_ws [list "index.tcl" "Events Administration"] [list "order-history.tcl" "Order History"] "By Date"] +
    + + + + +
    Date + Orders +" + + + +# count the number of orders (in events_registrations) for each date in +# events_registrations + +set history_type "date" + +db_foreach sel_regs " + select trunc(reg_date) as reg_date, + count(reg_id) as n_orders + from events_registrations r, events_events e, events_prices p + $where_clause p.event_id = e.event_id + and p.price_id = r.price_id + and r.reg_id not in (select distinct r.reg_id + from events_registrations r,events_activities a, events_events e, + events_prices p + $where_clause p.event_id = e.event_id + and e.activity_id = a.activity_id + and p.price_id = r.price_id + and a.group_id not in (select distinct group_id + from user_group_map + where user_id = :admin_id) ) + group by trunc(reg_date) + order by reg_date desc +" { + #can't export reg_date since ® is a special character + set r_date $reg_date + + append whole_page "
    [util_IllustraDatetoPrettyDate $reg_date] + $n_orders\n" + +} + +### clean up, return page. +append whole_page "
    \n [ad_footer] " + + + +doc_return 200 text/html $whole_page +##### File Over. + Index: openacs-4/contrib/packages/events/www/admin/order-history-month.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/events/www/admin/order-history-month.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/events/www/admin/order-history-month.tcl 9 Mar 2003 12:08:22 -0000 1.1 @@ -0,0 +1,67 @@ +# File: events/admin/order-history-month.tcl +# Owner: bryanche@arsdigita.com +# Purpose: Provides an overview of order history grouped by month. +##### + +ad_page_contract { + Purpose: Provides an overview of order history grouped by month. + + @author Bryan Che (bryanche@arsdigita.com) + @cvs_id order-history-month.tcl,v 3.7.6.5 2000/09/22 01:37:37 kevin Exp +} { +} + +set admin_id [ad_maybe_redirect_for_registration] + +# prepare page to be returned +set whole_page "" +append whole_page " + [ad_header "[ad_system_name] Events Administration: Order History - By Month"] +

    Order History - By Month

    +[ad_context_bar_ws [list "index.tcl" "Events Administration"] [list "order-history.tcl" "Order History"] "By Month"] +
    + + + + + \n" +} + +## clean up, return page + +append whole_page "
    Month +Orders +" + + +# count the number of orders (in events_registrations) for each date in +# events_registrations +db_foreach sel_reg " + select to_char(reg_date,'YYYY') as year, + to_char(reg_date,'fmMonth') as month, + to_char(reg_date,'MM') as month_number, + count(reg_id) as n_orders + from events_registrations r, events_events e, events_prices p + where p.event_id = e.event_id + and p.price_id = r.price_id + and r.reg_id not in (select distinct r.reg_id + from events_registrations r,events_activities a, events_events e, + events_prices p + where p.event_id = e.event_id + and e.activity_id = a.activity_id + and p.price_id = r.price_id + and a.group_id not in (select distinct group_id + from user_group_map + where user_id = :admin_id) ) +group by to_char(reg_date,'YYYY'), + to_char(reg_date,'fmMonth'), + to_char(reg_date,'MM') +order by year,month +" { + append whole_page "
    $month $year + $n_orders
    \n [ad_footer] " + + +doc_return 200 text/html $whole_page + +##### File Over Index: openacs-4/contrib/packages/events/www/admin/order-history-one-activity.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/events/www/admin/order-history-one-activity.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/events/www/admin/order-history-one-activity.tcl 9 Mar 2003 12:08:22 -0000 1.1 @@ -0,0 +1,68 @@ +# File: events/admin/order-history-one-activity.tcl +# Owner: bryanche@arsdigita.com +# Purpose: To provide an overview of order history grouped by activity. +##### + +ad_page_contract { + Purpose: To provide an overview of order history grouped by activity. + + @param activity_id the activity whose history we are viewing + + @author Bryan Che (bryanche@arsdigita.com) + @cvs_id order-history-one-activity.tcl,v 3.7.6.4 2000/09/22 01:37:37 kevin Exp +} { + {activity_id:integer,notnull} +} + +set whole_page "" + +append whole_page "[ad_header "[ad_system_name] Events Administration: Order History - By Activity"]" + + + +set short_name [db_string sel_name "select short_name from events_activities where activity_id=$activity_id"] + +append whole_page " +

    Order History - For Activity # $activity_id ($short_name)

    +[ad_context_bar_ws [list "index.tcl" "Events Administration"] [list "order-history.tcl" "Order History"] [list "order-history-activity.tcl" "By Activity"] "Activity"] +
    + + + + +
    Event Location + Date + Number of Registrations +" + +set history_type "event" + +db_foreach sel_reg "select + e.event_id, e.start_time, v.city, + decode(v.iso, 'us', v.usps_abbrev, cc.country_name) as big_location, + count(r.reg_id) as n_reg + from events_activities a, events_events e, events_registrations r, + events_venues v, events_prices p, country_codes cc +where e.activity_id = a.activity_id + and a.activity_id = :activity_id + and p.event_id = e.event_id + and p.price_id = r.price_id(+) + and v.venue_id = e.venue_id + and cc.iso = v.iso +group by e.event_id, e.start_time, v.city, v.usps_abbrev, v.iso, cc.country_name +order by e.start_time desc +" { + append whole_page "
    $city, $big_location + [util_AnsiDatetoPrettyDate $start_time] + $n_reg registrations" +} + +## clean up, return page + +append whole_page "
    \n [ad_footer] " + + + +doc_return 200 text/html $whole_page + +##### File Over Index: openacs-4/contrib/packages/events/www/admin/order-history-person.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/events/www/admin/order-history-person.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/events/www/admin/order-history-person.adp 9 Mar 2003 12:08:22 -0000 1.1 @@ -0,0 +1,73 @@ + +@title@ +@context@ + + + + + + + + + + + +
    Name@user_name@
    Email@user_email@
    Community Page@member_link@
    + + +
      +
    • @user_name@ has not registered for any events +
    +
    + + + + + + + + + + + + + + + + + + + + + +
    Reg. IDActivityEventReg. State
    @reg_history.reg_id@@reg_history.name@@reg_history.venue_name@ - @reg_history.timespan@ + + @reg_history.reg_state@ + waitlist + - cancel + + + @reg_history.reg_state@ + approve + - cancel + + + @reg_history.reg_state@ + approve + - waitlist + - cancel + + + canceled + + +
    +
    + + Index: openacs-4/contrib/packages/events/www/admin/order-history-person.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/events/www/admin/order-history-person.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/events/www/admin/order-history-person.tcl 9 Mar 2003 12:08:22 -0000 1.1 @@ -0,0 +1,44 @@ +# events/www/admin/order-history-person.tcl + +ad_page_contract { + + displays the order history of a person + + @param user_id + @author Matthew Geddert (geddert@yahoo.com) + +} { + {user_id:integer,notnull} +} -properties { + reg_history:multirow +} -validate { + user_name_select -requires {user_id} { + if { ![db_0or1row select_user_info {}] } { + ad_complain "We couldn't find the user you asked for." + return 0 + } + return 1 + } +} + +db_1row select_user_info {} +set user_email [ad_convert_to_html $user_email] + + +set ad_url [ad_url] + +set member_link [acs_community_member_link -user_id $user_id -label "${ad_url}[acs_community_member_url -user_id $user_id]"] + + +# get the variables needed by the sql query +set date_format [parameter::get -parameter date_format -default "MM/DD/YYYY"] +set time_format [parameter::get -parameter time_format -default "HH12:MIam"] +set package_id [ad_conn package_id] + +db_multirow reg_history select_reg_history {} + +set title "$user_name's Order History" +set context [list $title] + +ad_return_template + Index: openacs-4/contrib/packages/events/www/admin/order-history-person.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/events/www/admin/order-history-person.xql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/events/www/admin/order-history-person.xql 9 Mar 2003 12:08:22 -0000 1.1 @@ -0,0 +1,40 @@ + + + + + +select CASE WHEN to_char(t.start_date, 'YYYY-MM-DD') = to_char(t.end_date, 'YYYY-MM-DD') + THEN to_char(t.start_date, :date_format) || ' (' || to_char(t.start_date, :time_format) || ' - ' || to_char(t.end_date, :time_format) || ')' + ELSE to_char(t.start_date, :date_format) || ' ' || to_char(t.start_date, :time_format) || ' - ' || to_char(t.end_date, :date_format) || ' ' || to_char(t.end_date, :time_format) + END as timespan, + aa.name, ae.activity_id, ae.event_id, reg_id, ev.venue_name, er.reg_state + from acs_events ae, + acs_activities aa, + events_registrations er, + timespans s, + time_intervals t, + events_venues ev, + events_events ee, + events_activities ea + where er.user_id = :user_id + and er.event_id = ae.event_id + and ae.activity_id = aa.activity_id + and ae.timespan_id = s.timespan_id + and s.interval_id = t.interval_id + and ee.event_id = ae.event_id + and ee.venue_id = ev.venue_id + and aa.activity_id = ea.activity_id + and ea.package_id = :package_id + + + + + + select first_names || ' ' || last_name as user_name, email as user_email + from persons, parties + where person_id = :user_id + and person_id = party_id + + + + Index: openacs-4/contrib/packages/events/www/admin/order-history-state.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/events/www/admin/order-history-state.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/events/www/admin/order-history-state.tcl 9 Mar 2003 12:08:22 -0000 1.1 @@ -0,0 +1,65 @@ +# File: events/admin/order-history-state.tcl +# Owner: bryanche@arsdigita.com +# Purpose: ... +##### +ad_page_contract { + Lists number of registrations in each state. + + @author Bryan Che (bryanche@arsdigita.com) + @cvs_id order-history-state.tcl,v 3.9.2.4 2000/09/22 01:37:38 kevin Exp +} { +} + +set admin_id [ad_maybe_redirect_for_registration] + +append whole_page "[ad_header "[ad_system_name] Events Administration: Order History - By Order State"] + +

    Order History - By Registration State

    +[ad_context_bar_ws [list "index.tcl" "Events Administration"] [list "order-history.tcl" "Order History"] "By Registration State"] + +
    + + + +\n" +} + +append whole_page "
    Registration State +Registrations +" + + + +# count the number of orders (in events_registrations) for each order_state in +# events_registrations + +set history_type "state" + +db_foreach sel_regs " +select +reg_state, count(reg_id) as n_orders +from events_registrations r, events_activities a, events_events e, +events_prices p +where p.event_id = e.event_id +and p.price_id = r.price_id +and e.activity_id = a.activity_id + and r.reg_id not in (select distinct r.reg_id + from events_registrations r,events_activities a, events_events e, + events_prices p + where p.event_id = e.event_id + and e.activity_id = a.activity_id + and p.price_id = r.price_id + and a.group_id not in (select distinct group_id + from user_group_map + where user_id = :admin_id) ) +group by reg_state +order by reg_state +" { + #set r_state $reg_state + set state_filter $reg_state + + append whole_page "
    $reg_state$n_orders
    \n [ad_footer] " + + +doc_return 200 text/html $whole_page +##### Index: openacs-4/contrib/packages/events/www/admin/order-history-ug.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/events/www/admin/order-history-ug.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/events/www/admin/order-history-ug.tcl 9 Mar 2003 12:08:22 -0000 1.1 @@ -0,0 +1,106 @@ +# File: events/admin/order-history-ug.tcl +# Owner: bryanche@arsdigita.com +# Purpose: Displays order history grouped by user group. +##### + +ad_page_contract { + Displays order history grouped by user group. + + @author Bryan Che (bryanche@arsdigita.com) + @cvs_id order-history-ug.tcl,v 3.8.6.5 2000/09/22 01:37:38 kevin Exp +} { +} + +set user_id [ad_maybe_redirect_for_registration] + +# prepare the page to be returned +set whole_page "" + +append whole_page "[ad_header "[ad_system_name] Events Administration: Order History - By User Group"] + +

    Order History - By User Group

    +[ad_context_bar_ws [list "index.tcl" "Events Administration"] [list "order-history.tcl" "Order History"] "By User Group"] +
    + + + + + + +
    User Group + Orders +" + +set history_type "group" + +#create a bunch of views to do this select... +db_foreach sel_regs " + select group_name, um.group_id, sum(distinct group_orders) as n_orders + from user_groups ug, user_group_map um, + (select group_id, sum(ev_num) as group_orders + from events_activities a, + (select activity_id, sum(num) as ev_num + from events_events e, + (select p.event_id, count(1) as num + from events_registrations r, events_prices p + where p.price_id = r.price_id group by p.event_id + ) order_count + where e.event_id = order_count.event_id(+) + group by activity_id + ) ev_count + where a.activity_id = ev_count.activity_id(+) + group by group_id + ) group_count + where ug.group_id = group_count.group_id(+) + and um.user_id = :user_id + and ug.group_id = um.group_id + group by group_name, um.group_id + order by group_name +" { + if {[empty_string_p $n_orders]} { + append whole_page "
    $group_name + 0" + } else { + append whole_page "
    $group_name + $n_orders\n" + } +} + +db_1row sel_no_group " + select decode(sum(group_orders), null, 0, sum(group_orders)) as n_orders + from (select group_id, sum(ev_num) as group_orders + from events_activities a, + (select activity_id, sum(num) as ev_num + from events_events e, + (select p.event_id, count(1) as num + from events_registrations r, events_prices p + where p.price_id = r.price_id + group by event_id + ) order_count + where e.event_id = order_count.event_id(+) + group by activity_id + ) ev_count + where a.activity_id = ev_count.activity_id(+) + group by group_id + ) group_count + where group_count.group_id is null +" + +append whole_page " +
    No group +" +if {$n_orders > 0 } { + append whole_page " + $n_orders\n" +} else { + append whole_page " 0 " +} + +## clean up, return page + +append whole_page "
    \n [ad_footer]" + + +doc_return 200 text/html $whole_page + +##### Index: openacs-4/contrib/packages/events/www/admin/order-history.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/events/www/admin/order-history.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/events/www/admin/order-history.adp 9 Mar 2003 12:08:22 -0000 1.1 @@ -0,0 +1,23 @@ + +Order History +@context@ + +

    View Orders/Statistics by:

    + + +
    +

    Search For an Individual Registration:

    +We should change this to a formtemplate +
    +Enter either the registration number or the customer's last name for the order you wish to view:
    +
      + + +
          
      Registration #Last Name
    +
    Index: openacs-4/contrib/packages/events/www/admin/order-history.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/events/www/admin/order-history.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/events/www/admin/order-history.tcl 9 Mar 2003 12:08:22 -0000 1.1 @@ -0,0 +1,18 @@ +# /events/www/admin/order-history.tcl +ad_page_contract { + + Present a selection of views for order history. + + @author Matthew Geddert (geddert@yahoo.com) + @author Bryan Che (bryanche@arsdigita.com) + @cvs_id order-history.tcl,v 3.4.6.3 2000/09/22 01:37:38 kevin Exp + + +} { +} -properties { + context_bar:onevalue +} +ad_require_permission [ad_conn package_id] admin +set context [list "Order History"] + +ad_return_template Index: openacs-4/contrib/packages/events/www/admin/order-same-person.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/events/www/admin/Attic/order-same-person.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/events/www/admin/order-same-person.tcl 9 Mar 2003 12:08:22 -0000 1.1 @@ -0,0 +1,71 @@ +# File: events/admin/order-same-person.tcl +# Owner: bryanche@arsdigita.com +# Purpose: ... +##### + + +ad_page_contract { + Lists registrations by one user + + @param user_id the user whose registrations we're listing + + @author Bryan Che (bryanche@arsdigita.com) + @cvs_id order-same-person.tcl,v 3.5.2.4 2000/09/22 01:37:38 kevin Exp +} { + {user_id:integer,notnull} +} + +set admin_id [ad_maybe_redirect_for_registration] + +set output_html_page "whole_page" +# this is for events_write_order_summary + +set whole_page "" + + +db_1row sel_names " + select first_names, last_name from users + where user_id = :user_id" + +append whole_page " + [ad_header "Orders by $first_names $last_name"] +

    Orders by $first_names $last_name

    +[ad_context_bar_ws [list "index.tcl" "Events Administration"] "Order History"] +
    + +
      +" + +db_foreach sel_regs " + select r.reg_id, r.reg_state, a.short_name, r.reg_date + from events_registrations r, events_activities a, events_events e, + user_groups ug, user_group_map ugm, events_prices p + where p.event_id = e.event_id + and r.price_id = p.price_id + and e.activity_id = a.activity_id + and r.user_id = :user_id + and a.group_id = ugm.group_id + and ugm.group_id = ug.group_id + and ugm.user_id = :admin_id +union + select r.reg_id, r.reg_state, a.short_name, r.reg_date + from events_registrations r, events_activities a, events_events e, + user_groups ug, user_group_map ugm, events_prices p + where p.event_id = e.event_id + and r.price_id = p.price_id + and e.activity_id = a.activity_id + and r.user_id = :user_id + and a.group_id is null + order by reg_id desc" { + append whole_page "\n
    • " + events_write_order_summary +} + +## clean up, return page. + +append whole_page "
    \n [ad_footer] " + + +doc_return 200 text/html $whole_page + +##### File Over Index: openacs-4/contrib/packages/events/www/admin/order-search.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/events/www/admin/Attic/order-search.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/events/www/admin/order-search.tcl 9 Mar 2003 12:08:22 -0000 1.1 @@ -0,0 +1,88 @@ +# File: events/admin/order-search.tcl +# Owner: bryanche@arsdigita.com +# Purpose: Full text search of existing orders +##### + +ad_page_contract { + Search for existing orders + + @param id_query a registration id to search for + @param name_query a name to search for + + @author Bryan Che (bryanche@arsdigita.com) + @cvs_id order-search.tcl,v 3.9.2.4 2000/09/22 01:37:38 kevin Exp +} { + {id_query:integer,optional} + {name_query:trim,optional} +} + +set admin_id [ad_maybe_redirect_for_registration] +set output_html_page "whole_page" +# for events_write_order_summary + +set whole_page "" + +if { [info exists id_query] && [string compare $id_query ""] != 0 } { + ad_returnredirect "reg-view.tcl?reg_id=$id_query" + return +} elseif { ![info exists name_query] || [string compare $name_query ""] == 0 } { + ad_return_warning "Please enter search info" "Please enter either an order # or the customer's last name" + return +} + +append whole_page " + [ad_header "Orders with Last Name Containing \"$name_query\""] +

    Orders with Last Name Containing \"$name_query\"

    +[ad_context_bar_ws [list "index.tcl" "Events Administration"] [list "order-history.tcl" "Order History"] "Search"] +
    + +
      +" + +set n_rows_found 0 + +db_foreach sel_regs " +select u.first_names, u.last_name, r.reg_id, r.reg_state, +a.short_name, v.city, v.usps_abbrev, v.iso +from events_registrations r, events_activities a, events_events e, +events_prices p, events_venues v, users u, +user_group_map ugm +where upper(u.last_name) like upper(:name_query) +and r.user_id = u.user_id +and p.price_id = r.price_id +and e.event_id = p.event_id +and a.activity_id = e.activity_id +and v.venue_id = e.venue_id +and ugm.group_id = a.group_id +and ugm.user_id = :admin_id +union +select u.first_names, u.last_name, r.reg_id, r.reg_state, +a.short_name, v.city, v.usps_abbrev, v.iso +from events_registrations r, events_activities a, events_events e, +events_prices p, events_venues v, users u +where upper(u.last_name) like upper(:name_query) +and r.user_id = u.user_id +and p.price_id = r.price_id +and e.event_id = p.event_id +and a.activity_id = e.activity_id +and v.venue_id = e.venue_id +and a.group_id is null +order by reg_id +" { + incr n_rows_found + append whole_page "
    • " + events_write_order_summary +} + +if { $n_rows_found == 0 } { + append whole_page "no orders found" +} + +## clean up, return + +append whole_page "
    \n [ad_footer] " + + +doc_return 200 text/html $whole_page + +##### EOF Index: openacs-4/contrib/packages/events/www/admin/organizer-add.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/events/www/admin/organizer-add.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/events/www/admin/organizer-add.adp 9 Mar 2003 12:08:22 -0000 1.1 @@ -0,0 +1,13 @@ + +@title@ +@context_bar@ + +

    @title@

    +@context_bar@ +
    +

    Identify Organizer

    +

    +Search for a user to be the organizer of the @name@ event:
    +

    + +
    Index: openacs-4/contrib/packages/events/www/admin/organizer-add.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/events/www/admin/organizer-add.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/events/www/admin/organizer-add.tcl 9 Mar 2003 12:08:22 -0000 1.1 @@ -0,0 +1,70 @@ +# events/www/admin/organizer-add.tcl + +ad_page_contract { + Choose a user to add as an organizer for an event. + + @param event_id the event to which to add the organizer + @param role_id the role for which we're adding an organizer, if it has already been created + + @author Michael Steigman (michael@steigman.net) + @author Bryan Che (bryanche@arsdigita.com) + @cvs_id $Id: organizer-add.tcl,v 1.1 2003/03/09 12:08:22 lars Exp $ +} { + {event_id:integer,notnull} + {activity_id:integer,notnull} + {role_id:integer,optional} +} + +events::event::get -event_id $event_id -array event_info + +set name $event_info(name) + +set title "Add a New Organizer" + +set context_bar [ad_context_bar [list "activities" Activities] [list "activity?activity_id=$activity_id" Activity] [list "event?event_id=$event_id" "Event"] "Add Organizer"] + +form create organizer_add -action /acs-admin/users/search + +element create organizer_add target \ + -datatype text \ + -widget hidden \ + -value "[ad_conn package_url]admin/organizer-add-2.tcl" + +element create organizer_add custom_title \ + -datatype text \ + -widget hidden \ + -value "Choose a Member to Add as a Organizer for the $name event" + +element create organizer_add passthrough \ + -datatype text \ + -widget hidden \ + -value "event_id role_id" + +element create organizer_add event_id \ + -datatype text \ + -widget hidden \ + -value $event_id + +element create organizer_add role_id \ + -datatype text \ + -widget hidden \ + -value $role_id + +element create organizer_add email \ + -label "by Email address" \ + -datatype text \ + -widget text \ + -html {size 40} + +element create organizer_add last_name \ + -label "or by Last name" \ + -datatype text \ + -widget text \ + -html {size 40} + +element create organizer_add submit \ + -widget submit \ + -label "Search for an organizer" + +ad_return_template + Index: openacs-4/contrib/packages/events/www/admin/organizer-edit.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/events/www/admin/Attic/organizer-edit.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/events/www/admin/organizer-edit.adp 9 Mar 2003 12:08:22 -0000 1.1 @@ -0,0 +1,10 @@ + +@title@ +@context_bar@ + +

    Select Organizer for Role

    + +
    + +
    + Index: openacs-4/contrib/packages/events/www/admin/organizer-edit.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/events/www/admin/Attic/organizer-edit.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/events/www/admin/organizer-edit.tcl 9 Mar 2003 12:08:22 -0000 1.1 @@ -0,0 +1,98 @@ +#/packages/events/www/admin/organizer-edit.tcl + +ad_page_contract { + + Edit an organizer for an event role + + @param activity_id the activity in question + @param event_id the event in question + @param role_id the role which we're to edit + + @author Michael Steigman (michael@steigman.net) + @author Bryan Che (bryanche@arsdigita.com) + @cvs_id $Id: organizer-edit.tcl,v 1.1 2003/03/09 12:08:22 lars Exp $ +} { + {role_id:naturalnum,notnull} + {event_id:naturalnum,notnull} + {activity_id:naturalnum,notnull} +} + +events::organizer::get_role -role_id $role_id -array org_role_info + +set context_bar [ad_context_bar [list "activities" "Activities"] \ + [list "activity?activity_id=$activity_id" "Activity"] \ + [list "event?event_id=$event_id" "Event"] "Edit Organizer Role"] +set title "Edit Organizer" + +form create organizer_edit + +element create organizer_edit activity_id \ + -datatype integer \ + -widget hidden \ + -value $activity_id + +element create organizer_edit event_id \ + -datatype integer \ + -widget hidden \ + -value $event_id + +element create organizer_edit role_id \ + -datatype integer \ + -widget hidden \ + -value $role_id + +element create organizer_edit role \ + -label "Role" \ + -datatype text \ + -widget inform \ + -value $org_role_info(role) + +element create organizer_edit user_id \ + -label "User in this role" \ + -datatype search \ + -widget search \ + -result_datatype integer \ + -options [events::organizer::users_get_options] \ + -optional \ + -search_query { + select distinct u.first_names || ' ' || u.last_name as name, u.user_id + from cc_users u + where upper(decode(u.first_names,' ', '') || decode(u.last_name,' ', '') || u.email || ' ' || decode(u.screen_name, ' ', '')) like upper('%'||:value||'%') + order by name +} + +if {[template::form is_valid organizer_edit]} { + template::form get_values organizer_edit user_id + + set organizer_exists_p [events::organizer::organizer_exists_p \ + -event_id $event_id -role_id $role_id] + + if {$organizer_exists_p && [exists_and_not_null user_id]} { + events::organizer::edit_organizer \ + -event_id $event_id \ + -role_id $role_id \ + -party_id $user_id + } elseif {$organizer_exists_p} { + ns_log Notice "deleting organizer" + events::organizer::delete_organizer \ + -event_id $event_id \ + -role_id $role_id \ + -party_id $user_id + } else { + events::organizer::add_organizer \ + -event_id $event_id \ + -role_id $role_id \ + -party_id $user_id + } + + ad_returnredirect "event?event_id=$event_id" + ad_script_abort +} + +element set_properties organizer_edit user_id -value $org_role_info(user_id) + +ad_return_template + + + + Index: openacs-4/contrib/packages/events/www/admin/reg-approve.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/events/www/admin/reg-approve.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/events/www/admin/reg-approve.tcl 9 Mar 2003 12:08:22 -0000 1.1 @@ -0,0 +1,43 @@ +# events/www/admin/reg-approve.tcl +ad_page_contract { + + Approve a Registration. + + @param reg_id the registration to cancel + + @author Matthew Geddert (geddert@yahoo.com) + @creation date 2002-11-11 + +} { + {reg_id:naturalnum,notnull} + {return_url ""} +} -validate { + registration_exists_p -requires {reg_id} { + if { ![events::registration::exists_p -reg_id $reg_id] } { + ad_complain "We could not find the registration you asked for." + return 0 + } + return 1 + } +} + +events::registration::get -reg_id $reg_id -array reg_info +events::event::get_stats -event_id $reg_info(event_id) -array event_stats + +set count_spotsremaining [expr $event_stats(max_people) - $event_stats(approved)] + +if { ![empty_string_p $event_stats(max_people)] && $count_spotsremaining == 0 } { + ad_return_error "Max Number Already Reached" "The maximum number of registrations for this event has already been reached. + You cannot approve of this registration before cancelling or waitlisting somebody else, or editing + the maximum number of registrants allowed for this event." +} else { + events::registration::approve -reg_id $reg_id + + if {![exists_and_not_null return_url]} { + set return_url "reg-view?reg_id=$reg_id" + } + + ad_returnredirect $return_url +} + +ad_script_abort Index: openacs-4/contrib/packages/events/www/admin/reg-cancel-2.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/events/www/admin/reg-cancel-2.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/events/www/admin/reg-cancel-2.tcl 9 Mar 2003 12:08:22 -0000 1.1 @@ -0,0 +1,144 @@ +# File: events/admin/reg-cancel-2.tcl +# Owner: bryanche@arsdigita.com +# Purpose: Cancel one registration +##### + +ad_page_contract { + Cancels a registration. + + @param reg_id the registration to cancel + @param cancel_reason why we are canceling this reg + + @author Bryan Che (bryanche@arsdigita.com) + @cvs_id reg-cancel-2.tcl,v 3.9.2.5 2000/09/22 01:37:39 kevin Exp +} { + {reg_id:integer,notnull} + {cancel_reason:html,trim,optional} +} + +set user_id [ad_maybe_redirect_for_registration] + +if {![exists_and_not_null cancel_reason]} { + set cancel_msg "" +} else { + set cancel_msg "Explanation:\n\n" + + # Strip all ^M's out of any interactively entered text message. + # This is because Windows browsers insist on inserting CRLF at + # the end of each line of a TEXTAREA. + regsub -all "\r" $cancel_reason "" cancel_reason + append cancel_msg $cancel_reason +} + + + +set reg_check [db_0or1row sel_reg "select '1_reg_check' from +events_registrations +where reg_id = :reg_id +"] + +if {!$reg_check} { + append whole_page " + [ad_header "Could not find registration"] +

    Couldn't find registration

    + [ad_context_bar_ws [list "index.tcl" "Events Administration"] "Cancel Registration"] +
    + + Registration $reg_id was not found in the database. + [ad_footer]" + + return +} + +#cancel the registration +db_transaction { + db_dml update_reg "update events_registrations + set reg_state = 'canceled' + where reg_id = :reg_id" + + #try to remove the user from the event's user group + set user_check [db_0or1row sel_user_info "select + e.group_id as event_group_id, r.user_id as reg_user_id, e.event_id + from events_events e, events_registrations r, events_prices p + where r.reg_id = :reg_id + and p.price_id = r.price_id + and e.event_id = p.event_id"] + + if {$user_check > 0} { + db_dml del_ugm "delete from user_group_map + where group_id = :event_group_id + and user_id = :reg_user_id + and role <> 'administrator'" + } + +} + +set to_email [db_string sel_to_email " + select u.email + from users u, events_registrations r + where r.reg_id = :reg_id + and u.user_id = r.user_id"] + +append whole_page "[ad_header "Registration Canceled"] +

    Registration Canceled

    +[ad_context_bar_ws [list "index.tcl" "Events Administration"] "Cancel Registration"] +
    + +$to_email's registration has been canceled. $to_email has been notified +by e-mail: +" + +#e-mail the registrant to let him know we canceled his registration +#set from_email [db_string unused "select email from +#users where user_id = $user_id"] +set from_email [db_string sel_from_email "select u.email +from users u, event_info ei, events_events e +where e.event_id = :event_id +and ei.group_id = e.group_id +and u.user_id = ei.contact_user_id"] + +set to_email [db_string sel_to_email_addr " + select u.email + from users u, events_registrations r + where r.reg_id = :reg_id + and u.user_id = r.user_id"] + +set event_id [db_string sel_event_id " + select event_id + from events_registrations r, events_prices p + where r.reg_id = :reg_id + and p.price_id = r.price_id"] + +set email_subject "Registration Canceled" +set email_body "Your registration for:\n +[events_pretty_event $event_id]\n +has been canceled.\n + +$cancel_msg + +[ad_parameter SystemURL]/events/ +" + +append whole_page " +
    +To: $to_email
    +From: $from_email
    +Subject: $email_subject
    +
    +$email_body
    +
    + +

    +Return to events administration +[ad_footer] +" + + +doc_return 200 text/html $whole_page +ns_conn close + +if [catch { ns_sendmail $to_email $from_email $email_subject $email_body } errmsg] { + ns_log Notice "failed sending confirmation email to customer: $errmsg" +} + +##### EOF Index: openacs-4/contrib/packages/events/www/admin/reg-cancel.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/events/www/admin/reg-cancel.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/events/www/admin/reg-cancel.adp 9 Mar 2003 12:08:22 -0000 1.1 @@ -0,0 +1,6 @@ + + +@title@ +@context@ + + Index: openacs-4/contrib/packages/events/www/admin/reg-cancel.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/events/www/admin/reg-cancel.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/events/www/admin/reg-cancel.tcl 9 Mar 2003 12:08:22 -0000 1.1 @@ -0,0 +1,104 @@ +# events/www/admin/reg-cancel.tcl +ad_page_contract { + + Cancel a Registration. + + @param reg_id the registration to cancel + + @author Matthew Geddert (geddert@yahoo.com) + @creation date 2002-11-11 + +} { + {reg_id:naturalnum,notnull} + {return_url ""} +} -validate { + registration_exists_p -requires {reg_id} { + if { ![events::registration::exists_p -reg_id $reg_id] } { + ad_complain "We could not find the registration you asked for." + return 0 + } + return 1 + } +} + +events::registration::get -reg_id $reg_id -array reg_info +events::event::get -event_id $reg_info(event_id) -array event_info +events::venue::get -venue_id $event_info(venue_id) -array venue_info + +set title "Cancel $reg_info(user_name)'s Registration" +set context [list [list "event?event_id=$reg_info(event_id)" "$event_info(name) in $venue_info(city)"] "Cancel $reg_info(user_name)'s Registration"] + +form create confirm_cancel + +element create confirm_cancel return_url \ + -datatype text \ + -widget hidden \ + -value $return_url + +element create confirm_cancel reg_id \ + -datatype integer \ + -widget hidden \ + -value $reg_id + +element create confirm_cancel inform_of_cancel \ + -label "Action" \ + -datatype text \ + -widget inform \ + -value "Cancel a reservation for $event_info(name), and send the registrant a message to notify him/her that their reservation was canceled" + +if {[exists_and_not_null event_info(contact_email)]} { + set from_addr "$event_info(contact_email) (the default contact for this event)" +} else { +# do we want a parameter for this? + set from_addr "[ad_outgoing_sender] (the system wide default outgoing sender)" +} + +element create confirm_cancel send_message_from \ + -label "From" \ + -datatype text \ + -widget inform \ + -value $from_addr + +element create confirm_cancel send_message_to \ + -label "To" \ + -datatype text \ + -widget inform \ + -value $reg_info(user_email) + +element create confirm_cancel message_subject \ + -label "Subject" \ + -datatype text \ + -widget inform \ + -value "Your registration for $event_info(name) has been canceled" + + +element create confirm_cancel email_body \ + -label "Email Message" \ + -datatype text \ + -widget textarea \ + -html {cols 70 rows 8 wrap soft} \ + -value "$reg_info(user_name), + +Your registration request for $event_info(name) - $event_info(timespan) has been canceled. + +Sincerely, + +Event Administrator" + +if {[template::form is_valid confirm_cancel]} { + template::form get_values confirm_cancel reg_id email_body return_url + + events::registration::cancel -reg_id $reg_id -email_body $email_body + + if {![exists_and_not_null return_url]} { + set return_url "reg-view?reg_id=$reg_id" + } + + + ad_returnredirect $return_url + ad_script_abort + +} + +ad_return_template + Index: openacs-4/contrib/packages/events/www/admin/reg-cancel.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/events/www/admin/reg-cancel.xql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/events/www/admin/reg-cancel.xql 9 Mar 2003 12:08:22 -0000 1.1 @@ -0,0 +1,12 @@ + + + + + + select 1 + from events_registrations + where reg_id = :reg_id + + + + Index: openacs-4/contrib/packages/events/www/admin/reg-comments.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/events/www/admin/reg-comments.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/events/www/admin/reg-comments.tcl 9 Mar 2003 12:08:22 -0000 1.1 @@ -0,0 +1,49 @@ +# File: events/admin/reg-comments.tcl +# Owner: bryanche@arsdigita.com +# Purpose: Update comments for one registration. +##### + +ad_page_contract { + Update comments for one registration. + + @param reg_id the registration whose comments we're updating + + @author Bryan Che (bryanche@arsdigita.com) + @cvs_id reg-comments.tcl,v 3.6.6.4 2000/09/22 01:37:39 kevin Exp +} { + {reg_id:integer,notnull} +} + + +db_1row sel_comments " + select r.comments, p.event_id, r.reg_date, u.first_names, u.last_name + from events_registrations r, events_events e, users u, events_prices p + where p.event_id = e.event_id + and u.user_id = r.user_id + and r.reg_id = $reg_id + and p.price_id = r.price_id +" + +append whole_page " + [ad_header "Add/Edit Comments Regarding Registration #$reg_id"] +

    Add/Edit Comments Regarding Registration #$reg_id

    +[ad_context_bar_ws [list "index.tcl" "Events Administration"] "Registration"] +
    + +

    Comments

    + +on this order from $first_names $last_name on $reg_date for +[events_event_name $event_id] + +
    +[philg_hidden_input reg_id $reg_id] + + +
    +
    +[ad_footer] +" + + +doc_return 200 text/html $whole_page +##### EOF Index: openacs-4/contrib/packages/events/www/admin/reg-view.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/events/www/admin/reg-view.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/events/www/admin/reg-view.adp 9 Mar 2003 12:08:23 -0000 1.1 @@ -0,0 +1,78 @@ + +@title@ +@context@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    Event Information
    Activity:@event_info.name@
    Event:@venue_info.city@ - @event_info.timespan@
    Registration Information
    Name:@reg_info.user_name@
    Email:@reg_info.user_email@
    Reg. Date:@reg_info.creation_date@
    Reg. State: + + approved on @reg_info.approval_date@ + [ waitlist | + cancel ] + + + + waiting + [ +approve | + cancel ] + + The maximum number of people for this event have already been approved. + + + + + + pending + [ +approve | + waitlist | + cancel ] + + The maximum number of people for this event have already been approved. + + + + + canceled + +
    + + Index: openacs-4/contrib/packages/events/www/admin/reg-view.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/events/www/admin/reg-view.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/events/www/admin/reg-view.tcl 9 Mar 2003 12:08:23 -0000 1.1 @@ -0,0 +1,70 @@ +# events/www/order-check.tcl + +ad_page_contract { + Allows users to check the status of an order/registration + + @param reg_id The registration to check + + @author Matthew Geddert (geddert@yahoo.com) + @creation date 2002-11-10 +} { + {reg_id:naturalnum,notnull} +} -validate { + registration_exists_p -requires {reg_id} { + if { ![events::registration::exists_p -reg_id $reg_id] } { + ad_complain "We could not find the registration you asked for." + return 0 + } + return 1 + } +} + +events::registration::get -reg_id $reg_id -array reg_info +events::event::get -event_id $reg_info(event_id) -array event_info +events::venue::get -venue_id $event_info(venue_id) -array venue_info +events::event::get_stats -event_id $reg_info(event_id) -array event_stats + +set title "Registration \#$reg_id" +set context [list [list "event?event_id=$reg_info(event_id)" "$event_info(name) in $venue_info(city)"] "Status of Registration"] + +set count_spotsremaining [expr $event_stats(max_people) - $event_stats(approved)] + +if { ![empty_string_p $event_stats(max_people)] && $count_spotsremaining == 0 } { + set max_approved t +} else { + set max_approved f +} + + + +form create reg_comments + +element create reg_comments reg_id \ + -datatype integer \ + -widget hidden \ + -value $reg_id + +element create reg_comments comments \ + -label "Reg. Comments:" \ + -datatype text \ + -widget textarea \ + -html {cols 65 rows 6 wrap soft} \ + -optional \ + -value $reg_info(comments) + +element create reg_comments submit \ + -label "Update" \ + -datatype text \ + -widget submit + +if {[form is_submission reg_comments]} { + template::form get_values reg_comments comments reg_id + + events::registration::edit_reg_comments \ + -reg_id $reg_id \ + -comments $comments + + ad_returnredirect "reg-view?reg_id=$reg_id" +} + +ad_return_template Index: openacs-4/contrib/packages/events/www/admin/reg-view.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/events/www/admin/reg-view.xql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/events/www/admin/reg-view.xql 9 Mar 2003 12:08:23 -0000 1.1 @@ -0,0 +1,12 @@ + + + + + + select 1 + from events_registrations + where reg_id = :reg_id + + + + Index: openacs-4/contrib/packages/events/www/admin/reg-waitlist.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/events/www/admin/reg-waitlist.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/events/www/admin/reg-waitlist.tcl 9 Mar 2003 12:08:23 -0000 1.1 @@ -0,0 +1,34 @@ +# events/www/admin/reg-approve.tcl +ad_page_contract { + + Approve a Registration. + + @param reg_id the registration to cancel + + @author Matthew Geddert (geddert@yahoo.com) + @creation date 2002-11-11 + +} { + {reg_id:naturalnum,notnull} + {return_url ""} +} -validate { + registration_exists_p -requires {reg_id} { + if { ![events::registration::exists_p -reg_id $reg_id] } { + ad_complain "We could not find the registration you asked for." + return 0 + } + return 1 + } +} + +events::registration::waiting -reg_id $reg_id + +if {![exists_and_not_null return_url]} { + set return_url "reg-view?reg_id=$reg_id" +} + + +ad_returnredirect $return_url +ad_script_abort + + Index: openacs-4/contrib/packages/events/www/admin/role-add-oracle.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/events/www/admin/Attic/role-add-oracle.xql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/events/www/admin/role-add-oracle.xql 9 Mar 2003 12:08:23 -0000 1.1 @@ -0,0 +1,30 @@ + + + + + + select role || ' ' || + decode(public_role_p, 't', ' (public role)', '') as public_role_p, + role_id + from events_organizer_roles + where role_id not in + (select role_id + from events_org_role_activity_map + where activity_id = :activity_id) + + + + + + select role || ' ' || + decode(public_role_p, 't', ' (public role)', '') as public_role_p, + role_id + from events_organizer_roles + where role_id not in + (select role_id + from events_org_role_event_map + where event_id = :event_id) + + + + Index: openacs-4/contrib/packages/events/www/admin/role-add-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/events/www/admin/Attic/role-add-postgresql.xql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/events/www/admin/role-add-postgresql.xql 9 Mar 2003 12:08:23 -0000 1.1 @@ -0,0 +1,28 @@ + + + + + + select role || '' || CASE WHEN public_role_p THEN ' (public role)' ELSE '' END, + role_id + from events_organizer_roles + where role_id not in + (select role_id + from events_org_role_activity_map + where activity_id = :activity_id) + + + + + + select role || '' || CASE WHEN public_role_p = 't' THEN ' (public role)' ELSE '' END, + role_id + from events_organizer_roles + where role_id not in + (select role_id + from events_org_role_event_map + where event_id = :event_id) + + + + Index: openacs-4/contrib/packages/events/www/admin/role-add.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/events/www/admin/Attic/role-add.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/events/www/admin/role-add.adp 9 Mar 2003 12:08:23 -0000 1.1 @@ -0,0 +1,15 @@ + +@title@ +@context_bar@ + +

    Choose a role (or roles)

    + +
    + +
    +If you do not see the role you wish to add above, you may add a new role +

    +
    + + + Index: openacs-4/contrib/packages/events/www/admin/role-add.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/events/www/admin/Attic/role-add.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/events/www/admin/role-add.tcl 9 Mar 2003 12:08:23 -0000 1.1 @@ -0,0 +1,89 @@ +# File: events/www/admin/role-add.tcl + +ad_page_contract { + Allows admins to select from existing system roles + + @param activity_id the field's activity + @param event_id the field's event + + @author Michael Steigman (michael@steigman.net) + @author Bryan Che (bryanche@arsdigita.com) + @cvs_id $Id: role-add.tcl,v 1.1 2003/03/09 12:08:23 lars Exp $ +} { + {event_id ""} + {activity_id ""} + {role_ids:multiple ""} +} + +if {[exists_and_not_null event_id]} { + set title "Add Organizer Roles" + set role_create "role-create?activity_id=$activity_id&event_id=$event_id" + set context_bar [ad_context_bar [list "activities" "Activities"] \ + [list "activity?activity_id=$activity_id" "Activity"] \ + [list "event?event_id=$event_id" "Event"] "Add Organizer Roles"] + set roles [db_list_of_lists select_available_event_roles {}] +} else { + set title "Add Default Organizer Roles" + set role_create "role-create?activity_id=$activity_id" + set context_bar [ad_context_bar [list "activities" "Activities"] \ + [list "activity?activity_id=$activity_id" "Activity"] "Add Default Organizer Roles"] + set roles [db_list_of_lists select_available_activity_roles {}] +} + +if {[exists_and_not_null roles]} { + set roles_p t +} else { + set roles_p f +} + +form create role_add + +element create role_add activity_id \ + -optional \ + -widget hidden \ + -datatype integer + +element create role_add event_id \ + -optional \ + -widget hidden \ + -datatype integer + +element create role_add role_ids \ + -label "Available Roles" \ + -widget multiselect \ + -datatype integer \ + -help_text "Select multiple roles by holding down the Control key" \ + -options $roles + +element create role_add submit \ + -label "Add roles" \ + -datatype text \ + -widget submit + +if {[template::form is_valid role_add]} { + + if {[exists_and_not_null event_id]} { + foreach role_id $role_ids { + events::organizer::map_role -event_id $event_id -role_id $role_id + } + set redirect_url "event?event_id=$event_id" + } else { + foreach role_id $role_ids { + events::organizer::map_role -activity_id $activity_id -role_id $role_id + } + set redirect_url "activity?activity_id=$activity_id" + } + + ad_returnredirect $redirect_url + ad_script_abort + +} + +if {[exists_and_not_null event_id]} { + element set_properties role_add activity_id -value $activity_id + element set_properties role_add event_id -value $event_id +} else { + element set_properties role_add activity_id -value $activity_id +} + +ad_return_template Index: openacs-4/contrib/packages/events/www/admin/role-create.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/events/www/admin/Attic/role-create.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/events/www/admin/role-create.adp 9 Mar 2003 12:08:23 -0000 1.1 @@ -0,0 +1,10 @@ + +@title@ +@context_bar@ + +

    Role Description

    + +
    + +
    + Index: openacs-4/contrib/packages/events/www/admin/role-create.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/events/www/admin/Attic/role-create.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/events/www/admin/role-create.tcl 9 Mar 2003 12:08:23 -0000 1.1 @@ -0,0 +1,142 @@ +#/packages/events/www/admin/role-create.tcl + +ad_page_contract { + + Create an org role + + @param activity_id the activity in question + @param event_id the event in question + @param role_id the role which we're to edit + + @author Michael Steigman (michael@steigman.net) + @author Bryan Che (bryanche@arsdigita.com) + @cvs_id $Id: role-create.tcl,v 1.1 2003/03/09 12:08:23 lars Exp $ +} { + {activity_id:naturalnum,optional} + {event_id:naturalnum,optional} +} + +if {[exists_and_not_null event_id]} { + set context_bar [ad_context_bar [list "activities" "Activities"] \ + [list "activity?activity_id=$activity_id" "Activity"] \ + [list "event?event_id=$event_id" "Event"] "New Organizer Role"] + set title "Add a New Organizer Role" +} elseif {[exists_and_not_null activity_id]} { + set context_bar [ad_context_bar [list "activities" "Activities"] \ + [list "activity?activity_id=$activity_id" "Activity"] "New Default Organizer Role"] + set title "Add a New Default Organizer Role" +} else { + set context_bar [ad_context_bar [list "roles" "Roles"] "New Organizer Role"] + set title "Add a New Organizer Role" +} + +form create organizer_role + +element create organizer_role activity_id \ + -datatype integer \ + -widget hidden \ + -optional + +element create organizer_role event_id \ + -datatype integer \ + -widget hidden \ + -optional + +element create organizer_role role \ + -label "Role" \ + -datatype text \ + -widget text \ + -html {size 20} \ + -required + +element create organizer_role responsibilities \ + -label "Responsibilities" \ + -datatype text \ + -widget textarea \ + -optional \ + -html {cols 70 rows 10 wrap soft} + +element create organizer_role public_role_p \ + -label "Public Role?" \ + -datatype text \ + -widget select \ + -options {{No f} {Yes t}} + +if {[exists_and_not_null event_id]} { + element create organizer_role user_id \ + -label "User in this role" \ + -datatype search \ + -widget search \ + -result_datatype integer \ + -options [events::organizer::users_get_options] \ + -optional \ + -search_query { + select distinct u.first_names || ' ' || u.last_name as name, u.user_id + from cc_users u + where upper(decode(u.first_names,' ', '') || decode(u.last_name,' ', '') || u.email || ' ' || decode(u.screen_name, ' ', '')) like upper('%'||:value||'%') + order by name + } + + element create organizer_role submit \ + -label "Add a Role" \ + -datatype text \ + -widget submit + +} else { + element create organizer_role submit \ + -label "Add a Default Role" \ + -datatype text \ + -widget submit + +} + +if {[template::form is_submission organizer_role]} { + + if {[exists_and_not_null event_id]} { + # create role and map to event_id + set redirect_url "event?event_id=$event_id" + template::form get_values organizer_role \ + role responsibilities public_role_p user_id + set role_id [events::organizer::new_role \ + -role $role \ + -responsibilities $responsibilities \ + -public_role_p $public_role_p] + events::organizer::map_role -role_id $role_id -event_id $event_id + if {[exists_and_not_null user_id]} { + # add organizer while we're at it + events::organizer::add_organizer -role_id $role_id \ + -party_id $user_id -event_id $event_id + } + } elseif {[exists_and_not_null activity_id]} { + # create role and map to activity_id + set redirect_url "activity?activity_id=$activity_id" + template::form get_values organizer_role \ + role responsibilities public_role_p + set role_id [events::organizer::new_role \ + -role $role \ + -responsibilities $responsibilities \ + -public_role_p $public_role_p] + events::organizer::map_role -role_id $role_id -activity_id $activity_id + } else { + # no event/activity association; just create the role + set redirect_url "roles" + template::form get_values organizer_role role public_role_p responsibilities + events::organizer::new_role \ + -role $role \ + -responsibilities $responsibilities \ + -public_role_p $public_role_p + } + + ad_returnredirect $redirect_url + ad_script_abort +} + +if {[exists_and_not_null event_id]} { + element set_properties organizer_role event_id -value $event_id + element set_properties organizer_role user_id -value "" +} elseif {[exists_and_not_null activity_id]} { + element set_properties organizer_role activity_id -value $activity_id +} + +ad_return_template + Index: openacs-4/contrib/packages/events/www/admin/role-delete.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/events/www/admin/Attic/role-delete.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/events/www/admin/role-delete.adp 9 Mar 2003 12:08:23 -0000 1.1 @@ -0,0 +1,10 @@ + +@title@ +@context_bar@ + +

    @question@

    + +
    + +
    + Index: openacs-4/contrib/packages/events/www/admin/role-delete.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/events/www/admin/Attic/role-delete.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/events/www/admin/role-delete.tcl 9 Mar 2003 12:08:23 -0000 1.1 @@ -0,0 +1,50 @@ +# File: events/www/admin/role-delete.tcl + +ad_page_contract { + Allows admins to confirm the removal of a role + + @param role_id the id of the role + + @author Michael Steigman (michael@steigman.net) + @author Bryan Che (bryanche@arsdigita.com) + @cvs_id $Id: role-delete.tcl,v 1.1 2003/03/09 12:08:23 lars Exp $ +} { + {role_id:naturalnum,notnull} +} + +events::organizer::get_role -role_id $role_id -array role_info + +set title "Delete Role?" + +set context_bar [ad_context_bar [list "roles" Roles] [list "role?role_id=$role_id" Role] "Delete Role"] + +set question "Delete role from system?" + +form create role_delete + +element create role_delete role \ + -label "Role name" \ + -datatype text \ + -widget inform \ + -value $role_info(role) + +element create role_delete role_id \ + -label "Role" \ + -datatype integer \ + -widget hidden \ + -value $role_id + +element create role_delete submit \ + -label "Delete role" \ + -datatype text \ + -widget submit + +if {[template::form is_valid role_delete]} { + events::organizer::delete_role \ + -role_id $role_id + + ad_returnredirect roles + ad_script_abort +} + +ad_return_template Index: openacs-4/contrib/packages/events/www/admin/role-edit.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/events/www/admin/Attic/role-edit.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/events/www/admin/role-edit.adp 9 Mar 2003 12:08:23 -0000 1.1 @@ -0,0 +1,10 @@ + +@title@ +@context_bar@ + +

    Role Description

    + +
    + +
    + Index: openacs-4/contrib/packages/events/www/admin/role-edit.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/events/www/admin/Attic/role-edit.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/events/www/admin/role-edit.tcl 9 Mar 2003 12:08:23 -0000 1.1 @@ -0,0 +1,110 @@ +#/packages/events/www/admin/role-edit.tcl + +ad_page_contract { + + Edit an org role for either an event or an activity + + @param activity_id the activity in question + @param event_id the event in question + @param role_id the role which we're to edit + + @author Michael Steigman (michael@steigman.net) + @author Bryan Che (bryanche@arsdigita.com) + @cvs_id $Id: role-edit.tcl,v 1.1 2003/03/09 12:08:23 lars Exp $ +} { + {role_id:naturalnum,notnull} + {event_id:naturalnum,optional} + {activity_id:naturalnum,optional} +} + +events::organizer::get_role -role_id $role_id -array org_role_info + +form create organizer_role + +if {[exists_and_not_null event_id]} { + set context_bar [ad_context_bar [list "activities" "Activities"] \ + [list "activity?activity_id=$activity_id" "Activity"] \ + [list "event?event_id=$event_id" "Event"] "Edit Organizer Role"] + set title "Edit Organizer Role" +} elseif {[exists_and_not_null activity_id]} { + set context_bar [ad_context_bar [list "activities" "Activities"] \ + [list "activity?activity_id=$activity_id" "Activity"] "Edit Organizer Role"] + set title "Edit Default Activity Organizer Role" +} else { + set context_bar [ad_context_bar [list "roles" "Roles"] \ + [list "one-role?role_id=$role_id" "One Role"] "Edit Organizer Role"] + set title "Edit Organizer Role" +} + +element create organizer_role activity_id \ + -datatype integer \ + -widget hidden \ + -optional + +element create organizer_role event_id \ + -datatype integer \ + -widget hidden \ + -optional + +element create organizer_role role_id \ + -datatype integer \ + -widget hidden \ + -value $role_id + +element create organizer_role role \ + -label "Role" \ + -datatype text \ + -widget text \ + -html {size 20} \ + -required + +element create organizer_role responsibilities \ + -label "Responsibilities" \ + -datatype text \ + -widget textarea \ + -html {cols 70 rows 10 wrap soft} + + +element create organizer_role public_role_p \ + -label "Public Role?" \ + -datatype text \ + -widget select \ + -options {{No f} {Yes t}} + +if {[template::form is_valid organizer_role]} { + template::form get_values organizer_role \ + role_id role responsibilities public_role_p event_id + + if {[exists_and_not_null event_id]} { + set redirect_url "event?event_id=$event_id" + } elseif {[exists_and_not_null activity_id]} { + set redirect_url "activity?activity_id=$activity_id" + } else { + set redirect_url "one-role?role_id=$role_id" + } + + events::organizer::edit_role \ + -role_id $role_id \ + -role $role \ + -responsibilities $responsibilities \ + -public_role_p $public_role_p + + ad_returnredirect $redirect_url + ad_script_abort +} + +element set_properties organizer_role role -value $org_role_info(role) +element set_properties organizer_role responsibilities -value $org_role_info(responsibilities) +element set_properties organizer_role public_role_p -value $org_role_info(public_role_p) + +if {[exists_and_not_null event_id]} { + element set_properties organizer_role event_id -value $event_id +} elseif {[exists_and_not_null activity_id]} { + element set_properties organizer_role activity_id -value $activity_id +} + +ad_return_template + + + + Index: openacs-4/contrib/packages/events/www/admin/role-remove.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/events/www/admin/Attic/role-remove.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/events/www/admin/role-remove.adp 9 Mar 2003 12:08:23 -0000 1.1 @@ -0,0 +1,10 @@ + +@title@ +@context_bar@ + +

    @question@

    + +
    + +
    + Index: openacs-4/contrib/packages/events/www/admin/role-remove.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/events/www/admin/Attic/role-remove.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/events/www/admin/role-remove.tcl 9 Mar 2003 12:08:23 -0000 1.1 @@ -0,0 +1,89 @@ +# File: events/www/admin/activity-field-delete.tcl + +ad_page_contract { + Allows admins to confirm the removal of a role + associated with the selected activity/event + + @param activity_id the field's activity + @param event_id the field's event + @param attribute_name the name of the field's table column + @param attribute_id the name of the field's table column + + @author Michael Steigman (michael@steigman.net) + @author Bryan Che (bryanche@arsdigita.com) + @cvs_id $Id: role-remove.tcl,v 1.1 2003/03/09 12:08:23 lars Exp $ +} { + {event_id ""} + {activity_id ""} + {role_id:integer} +} + +events::organizer::get_role -role_id $role_id -array role_info + +if {[exists_and_not_null event_id]} { + events::event::get -event_id $event_id -array info + set title "Remove Role from Event?" + set context_bar [ad_context_bar [list "activities" Activities] [list "event?event_id=$event_id" Event] "Remove Role"] +} else { + events::activity::get -activity_id $activity_id -array info + set title "Remove Role from Activity?" + set context_bar [ad_context_bar [list "activities" Activities] [list "activity?activity_id=$activity_id" Activity] "Remove Role"] +} + +set question "Remove role from $info(name)?" + +form create role_remove + +element create role_remove activity_id \ + -datatype integer \ + -optional \ + -widget hidden + +element create role_remove event_id \ + -datatype integer \ + -optional \ + -widget hidden + +element create role_remove role \ + -label "Role name" \ + -datatype text \ + -widget inform \ + -value $role_info(role) + +element create role_remove role_id \ + -label "Role" \ + -datatype integer \ + -widget hidden \ + -value $role_id + +element create role_remove submit \ + -label "Remove role" \ + -datatype text \ + -widget submit + +if {[template::form is_valid role_remove]} { + template::form get_values role_remove role_id + if {[exists_and_not_null event_id]} { + set redirect_url "event?event_id=$event_id" + events::organizer::unmap_role \ + -event_id $event_id \ + -role_id $role_id + } else { + set redirect_url "activity?activity_id=$activity_id" + events::organizer::unmap_role \ + -activity_id $activity_id \ + -role_id $role_id + } + + ad_returnredirect $redirect_url + ad_script_abort +} + +if {[exists_and_not_null event_id]} { + element set_properties role_remove activity_id -value $activity_id + element set_properties role_remove event_id -value $event_id +} else { + element set_properties role_remove activity_id -value $activity_id +} + +ad_return_template Index: openacs-4/contrib/packages/events/www/admin/roles-oracle.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/events/www/admin/Attic/roles-oracle.xql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/events/www/admin/roles-oracle.xql 9 Mar 2003 12:08:23 -0000 1.1 @@ -0,0 +1,13 @@ + + + + + + select role, role_id, + decode(public_role_p, 't', ' (public role)', '') as public_role_p + from events_organizer_roles + order by role asc + + + + Index: openacs-4/contrib/packages/events/www/admin/roles-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/events/www/admin/Attic/roles-postgresql.xql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/events/www/admin/roles-postgresql.xql 9 Mar 2003 12:08:23 -0000 1.1 @@ -0,0 +1,15 @@ + + + + + + select role, role_id, public_role_p, + CASE when public_role_p = 't' then ' (public role)' + ELSE '' + END + from events_organizer_roles + order by role asc + + + + Index: openacs-4/contrib/packages/events/www/admin/roles.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/events/www/admin/Attic/roles.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/events/www/admin/roles.adp 9 Mar 2003 12:08:23 -0000 1.1 @@ -0,0 +1,24 @@ + +Roles +@context_bar@ + + + +

    Event Roles

    + + + + + +
      +
    • There are no roles defined in the system. You may create one now.
    • +
    +
    + + Index: openacs-4/contrib/packages/events/www/admin/roles.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/events/www/admin/Attic/roles.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/events/www/admin/roles.tcl 9 Mar 2003 12:08:23 -0000 1.1 @@ -0,0 +1,19 @@ +# events/www/admin/roles.tcl +ad_page_contract { + Displays a list of roles + Details for specific roles are one click deep. + + @author Michael Steigman (michael@steigman.net) + @author Bryan Che (bryanche@arsdigita.com) + @cvs_id $Id: roles.tcl,v 1.1 2003/03/09 12:08:23 lars Exp $ + +} { +} -properties { + roles:multirow +} + +set context_bar [ad_context_bar Roles] + +db_multirow roles select_roles {} + +ad_return_template Index: openacs-4/contrib/packages/events/www/admin/send-mail.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/events/www/admin/Attic/send-mail.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/events/www/admin/send-mail.adp 9 Mar 2003 12:08:23 -0000 1.1 @@ -0,0 +1,6 @@ + + +@title@ +@context@ + + Index: openacs-4/contrib/packages/events/www/admin/send-mail.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/events/www/admin/Attic/send-mail.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/events/www/admin/send-mail.tcl 9 Mar 2003 12:08:23 -0000 1.1 @@ -0,0 +1,299 @@ +# events/www/admin/send-mail.tcl + +ad_page_contract { + + this page allows you to sending email in bulk to event or activity registrants, + it relies on the bulk-mail package + + @param activty_id + @param event_id + @param return_url + + @author Matthew Geddert + @creation date 2002-11-01 + @cvs-id $Id: send-mail.tcl,v 1.1 2003/03/09 12:08:23 lars Exp $ +} { + {activity_id:integer,optional} + {event_id:integer,optional} + {group ""} + {return_url ""} +} + +# first, lets make sure they have bulk-mail installed. +if { ![apm_package_installed_p bulk-mail] } { + ad_return_warning "Bulk-Mail is not installed" "Sending email message in bulk relies on bulk mail, + please see your webmaster to see if he/she can install it for you." +} + +set user_id [ad_conn user_id] + +if {[exists_and_not_null event_id]} { + if {[exists_and_not_null activity_id]} { + ad_return_warning "Both Variables Cannot Be Specified" "You must either specify Event_id or Activity_id, not both at the same time." + } + if { ![events::event::exists_p -event_id $event_id] } { + ad_return_warning "Event doesn't exist" "We couldn't find the event you asked for." + } +} else { + if {[exists_and_not_null activity_id]} { + if { ![events::activity::exists_p -activity_id $activity_id] } { + ad_return_warning "Activity doesn't exist" "We couldn't find the activity you asked for." + } + } else { + ad_return_warning "You must supply a variable" "You must either specify Event_id or Activity_id." + } +} + + +if {[exists_and_not_null event_id]} { + # we are sending a message to folks involved with a particular event + events::event::get -event_id $event_id -array event_info + + set title "Send Mail to $event_info(name) [string totitle $group]" + set context [list [list "activities" Activities] [list "activity?activity_id=$event_info(activity_id)" $event_info(name)] [list "event?event_id=$event_id" "$event_info(city)"] "Send Mail"] + + form create send-bulk-mail + + element create send-bulk-mail event_id \ + -datatype integer \ + -widget hidden \ + -value $event_id + + element create send-bulk-mail return_url \ + -datatype text \ + -widget hidden \ + -value $return_url + + db_1row select_event_from_addr_count {} + db_1row select_my_email_address {} + + if {[string compare $from_addr_count "1"] == 0} { + + element create send-bulk-mail from_addr \ + -label "Send Mail From" \ + -datatype text \ + -widget inform \ + -value $from_addr + + } else { + + element create send-bulk-mail from_addr \ + -label "Send Mail From" \ + -datatype text \ + -widget select \ + -options [db_list_of_lists select_event_from_addr {}] \ + -value $from_addr + } + + # are we sending mail to registrants or organizers? + switch $group { + registrants { + element create send-bulk-mail to \ + -label "Send Mail To" \ + -datatype text \ + -widget radio \ + -options { {{All Approved, Waitlisted, and Pending Registrants} all} + {{Approved Registrants} approved} + {{Waitlisted Registrants} waiting} + {{Pending Registrants} pending} + } + } + organizers { + element create send-bulk-mail to \ + -datatype text \ + -widget hidden \ + -value "organizers" + } + } + + element create send-bulk-mail subject \ + -label "Message Subject" \ + -datatype text \ + -widget text \ + -html {size 50} \ + -value "$event_info(name) on $event_info(timespan)" + + element create send-bulk-mail message \ + -label "Enter Message" \ + -datatype text \ + -widget textarea \ + -html {cols 60 rows 8 wrap soft} + + element create send-bulk-mail submit \ + -label "Send Message" \ + -datatype text \ + -widget submit + + if {[template::form is_valid send-bulk-mail]} { + template::form get_values send-bulk-mail event_id return_url from_addr to subject message + + set query "" + + switch $to { + all { + set query [db_map select_all_event_registrants] + } + approved { + set query [db_map select_event_reg_state_registrants] + } + waiting { + set query [db_map select_event_reg_state_registrants] + } + pending { + set query [db_map select_event_reg_state_registrants] + } + organizers { + set query [db_map select_event_organizers] + } + } + + ns_log notice "EVENTS-MAIL-EVENT-REGS: $query" + + bulk_mail::new \ + -from_addr $from_addr \ + -subject $subject \ + -message $message \ + -query $query + + if {![exists_and_not_null return_url]} { + set return_url "event?event_id=$event_id" + } + + ad_returnredirect $return_url + ad_script_abort + } +} + + + + +if {[exists_and_not_null activity_id]} { +# we are sending a message to everybody involved with an activity + events::activity::get -activity_id $activity_id -array activity_info + + set title "Send Mail To The $activity_info(name) Activity Registrants" + set context [list [list "activities" Activities] [list "activity?activity_id=$activity_id" $activity_info(name)] "Send Mail"] + + form create send-bulk-mail + + element create send-bulk-mail activity_id \ + -datatype integer \ + -widget hidden \ + -value $activity_id + + element create send-bulk-mail return_url \ + -datatype text \ + -widget hidden \ + -value $return_url + + db_1row select_activity_from_addr_count {} + db_1row select_my_email_address {} + + if {[string compare $from_addr_count "1"] == 0} { + + element create send-bulk-mail from_addr \ + -label "Send Mail From" \ + -datatype text \ + -widget inform \ + -value $from_addr + + } else { + + element create send-bulk-mail from_addr \ + -label "Send Mail From" \ + -datatype text \ + -widget select \ + -options [db_list_of_lists select_activity_from_addr {}] \ + -value $from_addr + } + + element create send-bulk-mail to \ + -label "Send Mail To" \ + -datatype text \ + -widget radio \ + -options { {{All Approved, Waitlisted, and Pending Registrants} all} + {{Approved Registrants} approved} + {{Waitlisted Registrants} waiting} + {{Pending Registrants} pending} + } + + element create send-bulk-mail time \ + -label "Registered For" \ + -datatype text \ + -widget select \ + -options { {{All Past and Future Events} all} + {{Future Events} future} + {{Past Events} past} + } \ + -value future + + + element create send-bulk-mail subject \ + -label "Message Subject" \ + -datatype text \ + -widget text \ + -html {size 50} \ + -value "$activity_info(name)" + + element create send-bulk-mail message \ + -label "Enter Message" \ + -datatype text \ + -widget textarea \ + -html {cols 60 rows 8 wrap soft} + + element create send-bulk-mail submit \ + -label "Send Message" \ + -datatype text \ + -widget submit + + if {[template::form is_valid send-bulk-mail]} { + template::form get_values send-bulk-mail activity_id return_url from_addr to time subject message + + set query "" + + switch $time { + all { + if {[string compare $to "all"] == 0} { + set query [db_map select_activity_all_all] + } else { + set query [db_map select_activity_reg_state_all] + } + } + future { + if {[string compare $to "all"] == 0} { + set query [db_map select_activity_all_future] + } else { + set query [db_map select_activity_reg_state_future] + } + } + past { + if {[string compare $to "all"] == 0} { + set query [db_map select_activity_all_past] + } else { + set query [db_map select_activity_reg_state_past] + } + } + } + + ns_log notice "EVENTS-MAIL-ACTIVITY-REGS: $query" + + set package_id [ad_conn package_id] + + bulk_mail::new \ + -package_id $package_id \ + -from_addr $from_addr \ + -subject $subject \ + -message $message \ + -query $query + + if {![exists_and_not_null return_url]} { + set return_url "activity?activity_id=$activity_id" + } + + ad_returnredirect $return_url + ad_script_abort + } +} + + +ad_return_template Index: openacs-4/contrib/packages/events/www/admin/send-mail.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/events/www/admin/Attic/send-mail.xql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/events/www/admin/send-mail.xql 9 Mar 2003 12:08:23 -0000 1.1 @@ -0,0 +1,208 @@ + + + + + + select count(*) as from_addr_count + from parties pa, + events_activities ea + where ea.default_contact_user_id = pa.party_id + and ea.activity_id = :activity_id + or pa.party_id = :user_id + + + + + + select CASE WHEN ea.default_contact_user_id = pa.party_id AND ea.default_contact_user_id <> :user_id THEN pa.email || ' (the default contact for this activity)' + ELSE pa.email END as from_addr, pa.email + from parties pa, + events_activities ea + where ea.default_contact_user_id = pa.party_id + and ea.activity_id = :activity_id + or pa.party_id = :user_id + + + + + + select count(*) as from_addr_count + from parties pa, + events_events ee + where ee.contact_user_id = pa.party_id + and ee.event_id = :event_id + or pa.party_id = :user_id + + + + + + select CASE WHEN ee.contact_user_id = pa.party_id AND ee.contact_user_id <> :user_id THEN pa.email || ' (the default contact for this event)' + ELSE pa.email END as from_addr, pa.email + from parties pa, + events_events ee + where ee.contact_user_id = pa.party_id + and ee.event_id = :event_id + or pa.party_id = :user_id + + + + + + select email as from_addr + from parties + where party_id = :user_id + + + + + + select pa.email + from parties pa, + events_registrations er + where er.user_id = pa.party_id + and er.reg_state <> 'canceled' + and event_id = '$event_id' + + + + + + select pa.email + from parties pa, + events_registrations er + where er.user_id = pa.party_id + and er.reg_state = '$to' + and event_id = '$event_id' + + + + + + select pa.email + from parties pa, + events_organizers eo + where eo.user_id = pa.party_id + and eo.event_id = '$event_id' + + + + + + select pa.email + from events_registrations er, + parties pa, + acs_events ae, + timespans s, + time_intervals t, + dual + where er.user_id = pa.party_id + and ae.activity_id = '$activity_id' + and ae.event_id = er.event_id + and ae.timespan_id = s.timespan_id + and s.interval_id = t.interval_id + and er.reg_state = '$to' + and t.start_date > sysdate + group by pa.email + + + + + + select pa.email + from events_registrations er, + parties pa, + acs_events ae, + timespans s, + time_intervals t, + dual + where er.user_id = pa.party_id + and ae.activity_id = '$activity_id' + and ae.event_id = er.event_id + and ae.timespan_id = s.timespan_id + and s.interval_id = t.interval_id + and er.reg_state <> 'canceled' + and t.start_date > sysdate + group by pa.email + + + + + + select pa.email + from events_registrations er, + parties pa, + acs_events ae, + timespans s, + time_intervals t, + dual + where er.user_id = pa.party_id + and ae.activity_id = '$activity_id' + and ae.event_id = er.event_id + and ae.timespan_id = s.timespan_id + and s.interval_id = t.interval_id + and er.reg_state <> 'canceled' + and t.start_date < sysdate + group by pa.email + + + + + + select pa.email + from events_registrations er, + parties pa, + acs_events ae, + timespans s, + time_intervals t, + dual + where er.user_id = pa.party_id + and ae.activity_id = '$activity_id' + and ae.event_id = er.event_id + and ae.timespan_id = s.timespan_id + and s.interval_id = t.interval_id + and er.reg_state = '$to' + and t.start_date < sysdate + group by pa.email + + + + + + select pa.email + from events_registrations er, + parties pa, + acs_events ae, + timespans s, + time_intervals t, + dual + where er.user_id = pa.party_id + and ae.activity_id = '$activity_id' + and ae.event_id = er.event_id + and ae.timespan_id = s.timespan_id + and s.interval_id = t.interval_id + and er.reg_state = '$to' + group by pa.email + + + + + + select pa.email + from events_registrations er, + parties pa, + acs_events ae, + timespans s, + time_intervals t, + dual + where er.user_id = pa.party_id + and ae.activity_id = '$activity_id' + and ae.event_id = er.event_id + and ae.timespan_id = s.timespan_id + and s.interval_id = t.interval_id + and er.reg_state <> 'canceled' + group by pa.email + + + + Index: openacs-4/contrib/packages/events/www/admin/spam-selected-events.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/events/www/admin/spam-selected-events.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/events/www/admin/spam-selected-events.tcl 9 Mar 2003 12:08:23 -0000 1.1 @@ -0,0 +1,177 @@ +# File: events/admin/spam-selected-events.tcl +# Owner: bryanche@arsdigita.com +# Purpose: Select events to spam. +##### + +#perhaps orderby +#perhaps event_id if we only want to spam one event + +ad_page_contract { + Select events to spam. + + @param orderby order param for ad_table + @param event_id optionally, the event to spam if we only want to spam one event + + @author Bryan Che (bryanche@arsdigita.com) + @cvs_id spam-selected-events.tcl,v 3.16.2.5 2000/09/22 01:37:40 kevin Exp +} { + {orderby "short_name"} + {event_id:integer,optional} +} + +set admin_id [ad_maybe_redirect_for_registration] + +if {![exists_and_not_null orderby]} { + set orderby "short_name" +} + + +set whole_page "" +append whole_page "[ad_header "Spam Selected Events"]" + +append whole_page " +

    Spam Selected Events

    +[ad_context_bar_ws [list "index.tcl" "Events Administration"] "Spam Selected Events"] +
    " + +if {[exists_and_not_null event_id]} { + set event_sql_filter "and event_id = $event_id" + + #the table definition for ad_table + set table_def { + {check_box "" {no_sort} {}} + {short_name "Activity" {upper_name $order} {$short_name}} + {city "Location" {upper_city $order} {$city, $big_location}} + {start_time "Start" {} {[util_AnsiDatetoPrettyDate $start_time]}} + {end_time "End" {} {[util_AnsiDatetoPrettyDate $end_time]}} + } + +} else { + #this is for stuffing into the spam module + set sql_post_select "select distinct + users.email, users.user_id, users.email_type + from users_spammable users, events_reg_not_canceled r + where users.user_id = r.user_id + and r.reg_id not in + (select distinct r.reg_id + from events_registrations r,events_activities a, events_events e, + events_prices p + where p.event_id = e.event_id + and e.activity_id = a.activity_id + and p.price_id = r.price_id + and a.group_id not in + (select distinct group_id + from user_group_map + where user_id = $admin_id) ) + order by users.user_id + " + append whole_page " + Select the event(s) whose registrants you would like to spam

    + or +

    + [export_form_vars sql_post_select] + +
    + " + + #the table definition for ad_table + set table_def { + {check_box "" {no_sort} {}} + {short_name "Activity" {upper_name $order} {$short_name}} + {city "Location" {upper_city $order} {$city, $big_location}} + {start_time "Start" {} {[util_AnsiDatetoPrettyDate $start_time]}} + {end_time "End" {} {[util_AnsiDatetoPrettyDate $end_time]}} + } + + set event_sql_filter "" +} + +append whole_page " +
    +[philg_hidden_input spam_selected_events 1] +" + +if {![exists_and_not_null state_filter]} { + set state_filter "all" +} + +#dimensional filter for which conferences to show +set dimensional { + {state_filter "Show Events Starting in the:" all { + {last_month "Last Month" {where "start_time > sysdate - 32 and start_time <= sysdate"}} + {last_6_months "Last 6 Months" {where "start_time > sysdate - 187 and start_time <= sysdate"}} + {last_year "Last Year" {where "start_time > sysdate - 366 and start_time <= sysdate"}} + {future "Future" {where "start_time > sysdate"}} + {all "All" {}} + } + } +} + + +#the columns for ad_table +set col [list check_box short_name city start_time end_time] + +set sql "select +upper(a.short_name) as upper_name, upper(v.city) as upper_city, +e.event_id, e.start_time, e.end_time, +v.city, +decode(v.iso, 'us', v.usps_abbrev, cc.country_name) as big_location, +a.short_name +from events_activities a, events_events e, events_venues v, +country_codes cc, +user_groups ug, user_group_map ugm +where a.activity_id = e.activity_id +and a.group_id = ugm.group_id +and ugm.group_id = ug.group_id +and ugm.user_id = :admin_id +and v.venue_id = e.venue_id +and cc.iso = v.iso +$event_sql_filter +[ad_dimensional_sql $dimensional where] +union +select +upper(a.short_name) as upper_name, upper(v.city) as upper_city, +e.event_id, e.start_time, e.end_time, +v.city, +decode(v.iso, 'us', v.usps_abbrev, cc.country_name) as big_location, +a.short_name +from events_activities a, events_events e, events_venues v, +country_codes cc +where a.activity_id = e.activity_id +and a.group_id is null +and v.venue_id = e.venue_id +and cc.iso = v.iso +$event_sql_filter +[ad_dimensional_sql $dimensional where] +[ad_order_by_from_sort_spec $orderby $table_def] +" + +set bind_vars [ad_tcl_vars_to_ns_set admin_id] + +append whole_page " +[ad_dimensional $dimensional] +

    +[ad_table -bind $bind_vars -Tcolumns $col -Tmissing_text "There are no current events to display" -Torderby $orderby sel_events $sql $table_def] +" + +append whole_page " +

    +Do you want to spam: +

    +Confirmed Registrants
    +Pending Registrants
    +Wait-Listed Registrants
    +All Registrants
    +" + +## clean up, return page + +append whole_page " +

    +
    +[ad_footer]" + + + +doc_return 200 text/html $whole_page +##### EOF Index: openacs-4/contrib/packages/events/www/admin/venue-delete.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/events/www/admin/Attic/venue-delete.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/events/www/admin/venue-delete.tcl 9 Mar 2003 12:08:23 -0000 1.1 @@ -0,0 +1,35 @@ +# events/www/admin/venue-delete.tcl + +ad_page_contract { + deletes a venue + + @param venue_id the venue to be deleted + + @author Michael Steigman (michael@steigman.net) + @author Bryan Che (bryanche@arsdigita.com) + @cvs_id $Id: venue-delete.tcl,v 1.1 2003/03/09 12:08:23 lars Exp $ +} { + {venue_id:integer,notnull} +} -validate { + exists_p -requires {venue_id} { + if { ![events::venue::exists_p -venue_id $venue_id] } { + ad_complain "We couldn't find the venue you specified." + return 0 + } + return 1 + } + in_use_p -requires {venue_id} { + if { [events::venue::in_use_p -venue_id $venue_id] } { + ad_complain "This venue is being + used by one or more events. You cannot delete this + venue unless no events are located there." + return 0 + } + return 1 + } +} + +events::venue::delete -venue_id $venue_id + +ad_returnredirect "venues" + Index: openacs-4/contrib/packages/events/www/admin/venues-ae.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/events/www/admin/Attic/venues-ae.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/events/www/admin/venues-ae.adp 9 Mar 2003 12:08:23 -0000 1.1 @@ -0,0 +1,14 @@ + +@title@ +@context@ + +

    Venue Description

    + +
    + +
    + + +

    Delete this Venue

    + +
    Index: openacs-4/contrib/packages/events/www/admin/venues-ae.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/events/www/admin/Attic/venues-ae.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/events/www/admin/venues-ae.tcl 9 Mar 2003 12:08:23 -0000 1.1 @@ -0,0 +1,159 @@ +# events/www/admin/venues-ae.tcl + +ad_page_contract { + Add or edit a venue. + + @param venue_id the venue if we're editing a venue + @param return_url the return url if we're adding a venue + + @author Michael Steigman (michael@steigman.net) + @author Bryan Che (bryanche@arsdigita.com) + @cvs_id $Id: venues-ae.tcl,v 1.1 2003/03/09 12:08:23 lars Exp $ +} { + venue_id:integer,optional + {return_url:optional} +} -properties { + title:onevalue + context:onevalue + in_use_p:onevalue +} + +set tz_list [db_list_of_lists get_timezones "select tz, tz_id from timezones order by tz"] +set tz_list [linsert $tz_list 0 ""] + +set iso_list [db_list_of_lists get_isos "select default_name, iso from countries order by default_name"] + +ad_form -name venues_ae -export {return_url} -form { + +venue_id:key + +{venue_name:text(text) + {label "Venue Name"} + {html {size 20}}} + +{address1:text(text) + {label "Address 1"} + {html {size 50}} + optional} + +{address2:text(text) + {label "Address 2"} + {html {size 50}} + optional} + +{city:text(text) + {label "City"} + {html {size 50}} + optional} + +{usps_abbrev:text(text) + {label "State"} + {html {size 2}} + optional} + +{postal_code:text(text) + {label "Postal Code"} + {html {size 20}} + optional} + +{time_zone:text(select) + {label "Time Zone"} + {options $tz_list} + optional} + +{iso:text(select) + {label "Country"} + {options $iso_list}} + +{phone_number:text(text) + {label "Phone Number"} + {html {size 30}} + optional} + +{fax_number:text(text) + {label "Fax Number"} + {html {size 30}} + optional} + +{email:text(text) + {label "Email"} + {html {size 30}} + optional} + +{max_people:integer(text) + {label "Maximum Capacity"} + {html {size 20}} + optional} + +{needs_reserve_p:text(select) + {label "Needs Reservation"} + {options {{No f} {Yes t}}}} + +{description:text(textarea) + {label "Description"} + {html {cols 70 rows 8 wrap soft}} + {help_text "Include directions"}} + +} -select_query_name select_venue -validate { + +} -new_data { + set package_id [ad_conn package_id] + set venue_id [events::venue::new -venue_id $venue_id \ + -package_id $package_id \ + -venue_name $venue_name \ + -address1 $address1 \ + -address2 $address2 \ + -city $city \ + -usps_abbrev $usps_abbrev \ + -postal_code $postal_code \ + -time_zone $time_zone \ + -iso $iso \ + -phone_number $phone_number \ + -fax_number $fax_number \ + -email $email \ + -needs_reserve_p $needs_reserve_p \ + -max_people $max_people \ + -description $description ] + +} -edit_data { + + events::venue::edit -venue_id $venue_id \ + -venue_name $venue_name \ + -address1 $address1 \ + -address2 $address2 \ + -city $city \ + -usps_abbrev $usps_abbrev \ + -postal_code $postal_code \ + -time_zone $time_zone \ + -iso $iso \ + -phone_number $phone_number \ + -fax_number $fax_number \ + -email $email \ + -needs_reserve_p $needs_reserve_p \ + -max_people $max_people \ + -description $description + +} -after_submit { + + if {[exists_and_not_null return_url]} { + ad_returnredirect "$return_url&venue_id=$venue_id" + } else { + ad_returnredirect "venues" + } + ad_script_abort +} + +if { ![ad_form_new_p -key venue_id] } { + set title "Update a Venue" + set context [ad_context_bar [list "venues" "Venues"] " Edit Venue"] + set in_use_p [events::venue::in_use_p -venue_id $venue_id] +} else { + set title "Add a New Venue" + set context [ad_context_bar [list "venues" "Venues"] " New Venue"] + set in_use_p 1 + element set_value venues_ae iso "US" +} + +ad_return_template + + Index: openacs-4/contrib/packages/events/www/admin/venues-ae.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/events/www/admin/Attic/venues-ae.xql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/events/www/admin/venues-ae.xql 9 Mar 2003 12:08:23 -0000 1.1 @@ -0,0 +1,14 @@ + + + + + + select venue_name, address1, address2, city, usps_abbrev, postal_code, iso, + time_zone, phone_number, fax_number, email, + needs_reserve_p, max_people, description + from events_venues + where venue_id = :venue_id + + + + Index: openacs-4/contrib/packages/events/www/admin/venues-connecting.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/events/www/admin/Attic/venues-connecting.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/events/www/admin/venues-connecting.adp 9 Mar 2003 12:08:23 -0000 1.1 @@ -0,0 +1,11 @@ + +Connecting/Disconnecting Venues +@context_bar@ + +

    Connecting/Disconnecting Venues

    + +

    Venue : @venue_name@

    + +
    + +
    Index: openacs-4/contrib/packages/events/www/admin/venues-connecting.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/events/www/admin/Attic/venues-connecting.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/events/www/admin/venues-connecting.tcl 9 Mar 2003 12:08:23 -0000 1.1 @@ -0,0 +1,66 @@ +# events/www/admin/venues-connecting.tcl + +ad_page_contract { + Allows admins to connect/disconnect venues. + + @param venue_id the venue to edit + + @author Brad Duell (bduell@ncacasi.org) +} { + {venue_id:naturalnum,notnull} +} -validate { + venue_exists -requires {venue_id} { + if { ![db_0or1row activity_exists "select venue_name from events_venues where venue_id=:venue_id"] } { + ad_complain "We couldn't find the venue you asked for." + return 0 + } + return 1 + } +} + +set context_bar [ad_context_bar [list "venues" "Venues"] " Venue Connections"] + +form create venue + +element create venue venue_id \ + -label "Venue ID" \ + -datatype integer \ + -widget hidden + +element create venue connect_to_id \ + -label "Connect Venue To" \ + -datatype search \ + -widget search \ + -result_datatype integer \ + -options [events::venue::venues_get_connecting_options -this_venue_id $venue_id -connecting "t"] \ + -optional \ + -value "" + +element create venue disconnect_from_id \ + -label "Disconnect Venue From" \ + -datatype search \ + -widget search \ + -result_datatype integer \ + -options [events::venue::venues_get_connecting_options -this_venue_id $venue_id -connecting "f"] \ + -optional \ + -value "" + +if {[template::form is_valid venue]} { + template::form get_values venue \ + venue_id connect_to_id disconnect_from_id + + if { ![empty_string_p $connect_to_id] } { + # Connect + events::venue::connect -left_id $venue_id -right_id $connect_to_id + } + if { ![empty_string_p $disconnect_from_id] } { + # Disconnect + events::venue::disconnect -left_id $venue_id -right_id $disconnect_from_id + } + ad_returnredirect "venues" + ad_script_abort +} + +element set_properties venue venue_id -value $venue_id + +ad_return_template \ No newline at end of file Index: openacs-4/contrib/packages/events/www/admin/venues-hierarchy.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/events/www/admin/Attic/venues-hierarchy.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/events/www/admin/venues-hierarchy.adp 9 Mar 2003 12:08:23 -0000 1.1 @@ -0,0 +1,11 @@ + +Venue Hierarchy +@context_bar@ + +

    Venue Hierarchy

    + +

    Venue : @venue_name@

    + +
    + +
    Index: openacs-4/contrib/packages/events/www/admin/venues-hierarchy.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/events/www/admin/Attic/venues-hierarchy.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/events/www/admin/venues-hierarchy.tcl 9 Mar 2003 12:08:23 -0000 1.1 @@ -0,0 +1,96 @@ +# events/www/admin/venues-hierarchy.tcl + +ad_page_contract { + Allows admins to make levels of venues. + + @param venue_id the venue to edit + + @author Brad Duell (bduell@ncacasi.org) +} { + {venue_id:naturalnum,notnull} +} -validate { + venue_exists -requires {venue_id} { + if { ![db_0or1row activity_exists "select venue_name from events_venues where venue_id=:venue_id"] } { + ad_complain "We couldn't find the venue you asked for." + return 0 + } + return 1 + } +} + +set context_bar [ad_context_bar [list "venues" "Venues"] " Venue Hierarchy"] + +form create venue + +element create venue venue_id \ + -label "Venue ID" \ + -datatype integer \ + -widget hidden + +element create venue add_parent_id \ + -label "Add Parent" \ + -datatype search \ + -widget search \ + -result_datatype integer \ + -options [events::venue::venues_get_hierarchy_options -this_venue_id $venue_id -parent_p "t" -add_p "t"] \ + -optional \ + -value "" + +element create venue remove_parent_id \ + -label "Remove Parent" \ + -datatype search \ + -widget search \ + -result_datatype integer \ + -options [events::venue::venues_get_hierarchy_options -this_venue_id $venue_id -parent_p "t" -add_p "f"] \ + -optional \ + -value "" + +element create venue add_child_id \ + -label "Add Child" \ + -datatype search \ + -widget search \ + -result_datatype integer \ + -options [events::venue::venues_get_hierarchy_options -this_venue_id $venue_id -parent_p "f" -add_p "t"] \ + -optional \ + -value "" + +element create venue remove_child_id \ + -label "Remove Child" \ + -datatype search \ + -widget search \ + -result_datatype integer \ + -options [events::venue::venues_get_hierarchy_options -this_venue_id $venue_id -parent_p "f" -add_p "f"] \ + -optional \ + -value "" + +if {[template::form is_valid venue]} { + template::form get_values venue \ + venue_id add_parent_id remove_parent_id add_child_id remove_child_id + + if { ![empty_string_p $add_parent_id] } { + # Add Parent + if { $add_parent_id != $add_child_id } { + events::venue::make_child_of -parent_id $add_parent_id -child_id $venue_id + } + } + if { ![empty_string_p $remove_parent_id] } { + # Remove Parent + events::venue::dechildize -parent_id $remove_parent_id -child_id $venue_id + } + if { ![empty_string_p $add_child_id] } { + # Add Child + if { $add_parent_id != $add_child_id } { + events::venue::make_child_of -parent_id $venue_id -child_id $add_child_id + } + } + if { ![empty_string_p $remove_child_id] } { + # Remove Child + events::venue::dechildize -parent_id $venue_id -child_id $remove_child_id + } + ad_returnredirect "venues" + ad_script_abort +} + +element set_properties venue venue_id -value $venue_id + +ad_return_template \ No newline at end of file Index: openacs-4/contrib/packages/events/www/admin/venues.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/events/www/admin/Attic/venues.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/events/www/admin/venues.adp 9 Mar 2003 12:08:23 -0000 1.1 @@ -0,0 +1,14 @@ + +Venues +@context_bar@ + + + +

    Venues

    + +

    ParentsChildren of Venue : @venue_name@

    + +@table@ \ No newline at end of file Index: openacs-4/contrib/packages/events/www/admin/venues.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/events/www/admin/Attic/venues.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/events/www/admin/venues.tcl 9 Mar 2003 12:08:23 -0000 1.1 @@ -0,0 +1,63 @@ +# File: events/www/admin/venues.tcl + +ad_page_contract { + Lists event venues. + + @param orderby for ad_table + + @author Michael Steigman (michael@steigman.net) + @author Bryan Che (bryanche@arsdigita.com) + @cvs_id $Id: venues.tcl,v 1.1 2003/03/09 12:08:23 lars Exp $ +} { + {orderby "venue_name"} + {venue_id:optional ""} + {parent_p:optional "f"} +} -validate { + venue_exists -requires {venue_id} { + if { ![db_0or1row activity_exists "select venue_name from events_venues where venue_id=:venue_id"] } { + ad_complain "We couldn't find the venue you asked for." + return 0 + } + return 1 + } +} + +set context_bar [ad_context_bar "Venues"] + +#the columns for ad_table +set col [list venue_name city state max_people connecting] + +set table_def { + {venue_name "Venue Name" {} {$venue_name}} + {city "City" {} {$city}} + {state "State" {} {$state}} + {max_people "Max People" {} {$max_people}} + {connecting "Connecting" {} {change [events::venue::connecting -venue_id $venue_id]  (parents)  (children)  (add/remove hierarchy)}} +} + +if { [empty_string_p $venue_id] } { + # Select top-level venues only + set sql " + select v.venue_id, v.venue_name, v.city, + v.usps_abbrev as state, max_people + from events_venues v where venue_id not in (select child_venue_id from events_venues_venues_map) + [ad_order_by_from_sort_spec $orderby $table_def]" +} else { + if { $parent_p } { + # Select parent venues (if any) for this venue + set sql " + select v.venue_id, v.venue_name, v.city, + v.usps_abbrev as state, max_people + from events_venues v where venue_id in ([events::venue::all_parents_or_children -venue_id $venue_id -parent_p "t" -sql_p "t"]) + [ad_order_by_from_sort_spec $orderby $table_def]" + } else { + # Select children venues (if any) for this venue + set sql " + select v.venue_id, v.venue_name, v.city, + v.usps_abbrev as state, max_people + from events_venues v where venue_id in ([events::venue::all_parents_or_children -venue_id $venue_id -parent_p "f" -sql_p "t"]) + [ad_order_by_from_sort_spec $orderby $table_def]" + } +} + +set table [ad_table -Tcolumns $col -Tmissing_text "There are no venues to display" -Torderby $orderby venues_list $sql $table_def] \ No newline at end of file Index: openacs-4/contrib/packages/events/www/admin/spam/action-choose.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/events/www/admin/spam/action-choose.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/events/www/admin/spam/action-choose.tcl 9 Mar 2003 12:08:36 -0000 1.1 @@ -0,0 +1,262 @@ +# action-choose.tcl,v 1.1.2.2 2000/02/03 09:50:01 ron Exp +# events/admin/action-choose.tcl +# Owner: bryanche@arsdigita.com +# Purpose: A page allowing admins to spam users and providing +# info on who spam will be sent to. +##### + +# maybe user_class_id (to indicate a previousely-selected class of users) +# maybe a whole host of user criteria +# maybe msg_text, maybe create_comment_p and event_id. If these variables exists, then a comment will be created for all the registrants of this event + +ad_page_contract { + A page allowing admins to spam users and providing + info on who spam will be sent to. Note that the interface + and code for this page comes mainly from the spam module + + @param sql_post_select a sql query describing which users to select + @param msg_text optional default email text + @param create_comment_p should this email also be saved as comments for event registrants + @param event_id (optional) the event for which this spam is creating a comment + + @param spam_selected_events flag indicating that this page should handle processing of /events/admin/spam-selected-events.tcl + @param event array of event_id's indicating which events to spam + @param reg_state which registration state to spam for the events + + @author Bryan Che (bryanche@arsdigita.com) + @cvs_id action-choose.tcl,v 3.15.2.5 2000/09/22 01:37:41 kevin Exp +} { + {sql_post_select:optional} + {msg_text:html,trim,optional} + {create_comment_p:html,optional} + {event_id:integer,optional} + + {spam_selected_events:optional} + {event:array,optional} + {reg_state:optional} +} + +set admin_user_id [ad_verify_and_get_user_id] +ad_maybe_redirect_for_registration + +page_validation { + set error_msg "" + + #if this page should insert a comment, then it needs to know + #for what event these users are being spammed. + if {[exists_and_not_null create_comment_p]} { + if {$create_comment_p != 0 && ![exists_and_not_null event_id]} { + append error_msg "
  • This page came in without an event_id" + } + } + + if {![empty_string_p $error_msg]} { + error $error_msg + } +} + +############################################# + +#BEGIN PROCESS CODE FROM SPAM-SELECTED-EVENTS + +#Unfortunately, Netscape and IE seem to have limits to how long +#a URL they can parse. So, we'll move the code from spam-selected-events-2 +#to this page so that it won't have to redirect to this page +#using a long url. It's ugly, but we can't get around it... + + + +if {[exists_and_not_null spam_selected_events]} { + + page_validation { + if {![exists_and_not_null reg_state]} { + error "
  • You did not select which types of registrants + you wish to spam" + } + } + + set events_list [list] + + # see which events to spam + db_foreach evnt_sel_spam_events " + select e.event_id + from events_activities a, events_events e, + user_groups ug, user_group_map ugm + where a.activity_id = e.activity_id + and a.group_id = ugm.group_id + and ugm.group_id = ug.group_id + and ugm.user_id = :admin_user_id + union + select e.event_id + from events_activities a, events_events e + where a.activity_id = e.activity_id + and a.group_id is null + " { + set event_var "event($event_id)" + + if {[info exists $event_var]} { + lappend events_list $event_id + } + } + + if {[llength $events_list] == 0} { + ad_return_warning "No Events Selected" "You didn't select any events to spam" + return + } + + switch $reg_state { + "shipped" {set reg_state_sql "and r.reg_state = 'shipped'"} + "pending" {set reg_state_sql "and r.reg_state = 'pending'"} + "waiting" {set reg_state_sql "and r.reg_state = 'waiting'"} + "all" {set reg_state_sql ""} + default {set reg_state_sql ""} + } + + set sql_post_select "select distinct + users.user_id, users.email, users.email_type + from users_spammable users, events_reg_not_canceled r, events_prices p + where users.user_id = r.user_id + and p.price_id = r.price_id + $reg_state_sql + and ( + " + + set first_flag 1 + foreach event_id $events_list { + if {$first_flag} { + set first_flag 0 + append sql_post_select " p.event_id = $event_id\n" + } else { + append sql_post_select " or p.event_id = $event_id\n" + } + } + + append sql_post_select ")\norder by users.user_id" +} + +#END PROCESS CODE FROM SPAM-SELECTED-EVENTS + +############################################# + + +# we get a form that specifies a class of user + +#set users_description [ad_user_class_description [ns_conn form]] +set users_description "users returned by $sql_post_select" + +#text we want to already show up in the email body +if {![exists_and_not_null msg_text]} { + set msg_text "" +} + +## We store the page in whole_page as we go. + +set whole_page "" +append whole_page " + [ad_admin_header "Spam"] +

    Spam

    + +[ad_context_bar_ws [list "../index.tcl" "Events Administration"] "Spam"] +
    + +

    +" + +# + +#regsub {from users} $sql_post_select {from users_spammable users} sql_post_select + +#set query [ad_user_class_query_count_only [ns_conn form]] +set query "select count(count_view.email) +from ($sql_post_select) count_view" +if [catch {set n_users [db_string evnt_spam_count_users $query]} errmsg] { + + db_release_unused_handles + ns_warning "invalid query" "The query \n

    \n $query \n
    " + return +} + + +#ad_return_error "query" "
    $query
    " +#return + +if {$n_users == 0} { + ad_return_error "No people to e-mail" "There are no people to e-mail." + return +} +set action_heading "" + +if {$n_users == 1} { + append action_heading "You are e-mailing $n_users person." +} else { + append action_heading "You are e-mailing [util_commify_number $n_users] people." +} + +# generate unique key here so we can handle the "user hit submit twice" case +set spam_id [db_string evnt_spam_spam_id_seq "select spam_id_sequence.nextval from dual"] + +# Generate the SQL query from the user_class_id, if supplied, or else from the +# pile of form vars as args to ad_user_class_query + +#set users_sql_query [ad_user_class_query [ns_getform]] +set users_sql_query $sql_post_select + +append whole_page " + + + " + +if {$n_users > 0} { +# append whole_page " +# +# View whom you're spamming +# " + + #this is ugly, but netscape/ie can't handle long url's + #as of 6/2000. So, we have to send sql_post_select + #using a form post + append whole_page " + + " +} + +append whole_page " +
    To: $action_heading +
    + [export_form_vars sql_post_select] + +
    +
    +
    +[export_form_vars spam_id users_sql_query users_description create_comment_p event_id] + +From: +

    +" + + +append whole_page " +

    Send Date:[_ns_dateentrywidget "send_date"] +
    Send Time:[_ns_timeentrywidget "send_date"] + +

    +Subject: +

    +Message: +

    + +

    +

    +
    +

    + +[ad_footer] +" + +## clean up, return the page. + + + +doc_return 200 text/html $whole_page + +##### EOF Index: openacs-4/contrib/packages/events/www/admin/spam/spam-confirm.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/events/www/admin/spam/spam-confirm.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/events/www/admin/spam/spam-confirm.tcl 9 Mar 2003 12:08:36 -0000 1.1 @@ -0,0 +1,170 @@ +# spam-confirm.tcl,v 1.1.2.2 2000/02/03 09:50:02 ron Exp +# File: events/admin/spam-confirm.tcl +# Creator: hqm@arsdigita.com +# +# A good thing to do before sending out 100,000 emails: +# ask user to confirm the outgoing spam before queuing it. +##### + +ad_page_contract { + Confirms sending spam. + + @param spam_id id of the spam to send + @param from_address email address the spam is from + @param subject the email's subject + @param message email message + @param from_file_p is this email from a file + @param users_sql_query sql query describing which users to spam + @param users_description description of the users to spam + @param template_p is this email a tcl template + + @param create_comment_p should this spam create a registration comment + @param event_id which event to comment about when spamming a selected event + + @author Bryan Che (bryanche@arsdigita.com) + @cvs_id spam-confirm.tcl,v 3.7.6.8 2000/09/22 01:37:41 kevin Exp +} { + {spam_id:integer,notnull} + {from_address:trim,notnull} + {subject:trim,notnull} + {message:html,trim,notnull} + {message_html:html,optional} + {from_file_p:optional} + {users_sql_query} + {users_description:optional} + {template_p:optional} + + {create_comment_p:optional} + {event_id:integer,optional} +} + +# spam_id, from_address, subject, send_date, message +# +# maybe: message_html +# from_file_p If == 't', get message texts from default +# filesystem location +# users_sql_query The SQL needed to get the list of target users +# users_description English descritpion of target users +# +# or else user_class_id, which can be passed to ad_user_class_query to +# generate a SQL query. +# +# maybe: template_p If == 't', then run subst on the message +# subject and body. A scary prospect, but spam can only be +# created by site admins anyhow. (seems to be disabled here) + +#maybe create_comment_p & event_id + +set admin_user_id [ad_verify_and_get_user_id] +ad_maybe_redirect_for_registration + +if {[info exists from_file_p] && [string compare $from_file_p "t"] == 0} { + set message [get_spam_from_filesystem "plain"] + set message_html [get_spam_from_filesystem "html"] + set message_aol [get_spam_from_filesystem "aol"] +} + +set exception_count 0 +set exception_text "" + +if {[catch {ns_dbformvalue [ns_conn form] send_date datetime send_date} errmsg]} { + incr exception_count + append exception_text "

  • Please make sure your date is valid." +} + +if {[exists_and_not_null create_comment_p]} { + if {$create_comment_p != 0 && ![exists_and_not_null event_id]} { + incr exception_count + append exception_text "
  • This page came in without an event_id" + } +} + +if {[empty_string_p $subject]} { + incr exception_count + append exception_text "
  • Please enter a subject" +} + +if {[empty_string_p $message]} { + incr exception_count + append exception_text "
  • Please enter a message." +} + + +if {$exception_count > 0 } { + ad_return_complaint $exception_count $exception_text + return +} + +ns_dbformvalue [ns_conn form] send_date datetime send_date + +if {[info exists template_p] && [string match $template_p "t"]} { +} else { + set template_p "f" +} + +## Begin to return the page... + +# Wrap message text properly +set message [spam_wrap_text $message 80] + +append pagebody "[ad_admin_header "Confirm sending spam"] +

    Confirm Sending Spam

    +[ad_context_bar_ws [list "../index.tcl" "Events Administration"] "Confirm Spam"] + +
    + +The following spam will be queued for delivery: +

    +" + +append pagebody " +

    + +
    + + + + + + + + +" + +if {[info exists message_html] && ![empty_string_p $message_html]} { + append pagebody " + + + " +} + +if {[info exists message_aol] && ![empty_string_p $message_aol]} { + append pagebody " + + + " +} + +append pagebody "
    Date: $send_date
    From:$from_address
    Subject:$subject
    Plain Text Message: +
    [ns_quotehtml $message]
    +
    HTML Message: $message_html
    AOL Message: $message_aol
    " + +set count_users_query "select count(*) from ($users_sql_query)" +set total_users [db_string evnt_spam_confirm_count $count_users_query] + +append pagebody " +You will send email to $total_users users. +

    +

    + +[export_form_vars users_sql_query spam_id from_address subject message message_html message_aol send_date template_p users_description create_comment_p event_id] +
    +[ad_footer]" + +## clean up, return the page. + + + +doc_return 200 text/html $pagebody + +##### EOF Index: openacs-4/contrib/packages/events/www/admin/spam/spam.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/events/www/admin/spam/spam.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/events/www/admin/spam/spam.tcl 9 Mar 2003 12:08:36 -0000 1.1 @@ -0,0 +1,229 @@ +# spam.tcl,v 3.10.2.7 2000/09/22 01:37:42 kevin Exp +# spam.tcl +# +# hqm@arsdigita.com +# +# Queues an outgoing spam message to a group of users, +# by adding it to the spam_history table + +# spam_id, from_address, subject, +# message (optionally message_html, message_aol) +# maybe send_date +# from_file_p +# template_p +# +#maybe create_comment_p, event_id + +ad_page_contract { + Confirms sending spam. + + @param spam_id id of the spam to send + @param from_address email address the spam is from + @param subject the email's subject + @param message email message + @param message_html email message in html format + @param message_aol email message in aol format + @param send_date when to send the email + @param from_file_p is this email from a file + @param users_sql_query sql query describing which users to spam + @param users_description description of the users to spam + @param template_p is this email a tcl template + + @param create_comment_p should this spam create a registration comment + @param event_id which event to comment about when spamming a selected event + + @author Bryan Che (bryanche@arsdigita.com) + @cvs_id spam.tcl,v 3.10.2.7 2000/09/22 01:37:42 kevin Exp +} { + {spam_id:integer,notnull} + {from_address:notnull} + {subject:trim [db_null]} + {message:html,trim,optional} + {message_html:html,trim,optional} + {message_aol:html,trim,optional} + {send_date:optional} + {from_file_p:optional} + {users_sql_query} + {users_description:optional} + {template_p:optional} + + {create_comment_p:optional} + {event_id:integer,optional} +} + + +ns_log Notice "spam.tcl: entering page" + +set admin_user_id [ad_verify_and_get_user_id] +ad_maybe_redirect_for_registration + +# Strip all ^M's out of any itneractively entered text message. +# This is because Windows browsers insist on inserting CRLF at +# the end of each line of a TEXTAREA. +if {[info exists message]} { + regsub -all "\r" $message "" message_stripped +} + +if {[info exists from_file_p] && [string compare $from_file_p "t"] == 0} { + set message [get_spam_from_filesystem "plain"] + set message_html [get_spam_from_filesystem "html"] + set message_aol [get_spam_from_filesystem "aol"] +} + +if {[info exists template_p] && [string match $template_p "t"]} { +} else { + set template_p "f" +} + +if {![info exists send_date]} { + set send_date "" +} + +if {![info exists message_html]} { + set message_html "" +} + +if {![info exists message_aol]} { + set message_aol "" +} + +set exception_count 0 +set exception_text "" + +if {[empty_string_p $subject] && [empty_string_p $message_stripped] && [empty_string_p $message_html] && [empty_string_p $message_aol]} { + incr exception_count + append exception_text "
  • The contents of your message and subject line is the empty string. You must send something in the message body" +} + +if {$exception_count > 0 } { + ad_return_complaint $exception_count $exception_text + return +} + + +# Generate the SQL query from the user_class_id, if supplied +if {[info exists user_class_id] && ![empty_string_p $user_class_id]} { + set users_sql_query [ad_user_class_query [ns_getform]] + set class_name [db_string evnt_spam_sel_class_name "select name from user_classes where user_class_id = :user_class_id "] + + set sql_description [db_string evnt_spam_sel_sql_desc "select sql_description from user_classes where user_class_id = :user_class_id "] + set users_description "$class_name: $sql_description" +} + +#set spam_query [spam_rewrite_user_class_query $users_sql_query] +set spam_query $users_sql_query + +if [catch { + spam_post_new_spam_message -spam_id $spam_id -template_p $template_p \ + -from_address $from_address \ + -title $subject \ + -body_plain $message_stripped \ + -body_html $message_html \ + -body_aol $message_aol \ + -target_users_description $users_description \ + -target_users_query $spam_query \ + -send_date $send_date \ + -creation_user $admin_user_id +} errmsg] { + # choked; let's see if it is because + if { [db_string evnt_spam_dbl_click "select count(*) from spam_history where spam_id = $spam_id"] > 0 } { + doc_return 200 text/html "[ad_admin_header "Double Click?"] + +

    Double Click?

    + +
    + +This spam has already been sent. Perhaps you double clicked? In any +case, you can check the progress of this spam on +the history page. + +[ad_admin_footer]" + } else { + ad_return_error "Ouch!" "The database choked on your insert: +
    +$errmsg +
    +" + } + return +} + +#Perhaps create a comment for the users' registrations +#Note that this only makes sense if the spam is sent immediately. +#If the spam were sent in the future, then it could be sent to +#registrants whose registrations weren't marked with this +#comment because the registrations took place after these comments +#were created but before the spam was sent. Also note that +#there still could be a few people who register in the short time +#between the comments below are created and the spam is sent. In that +#case, these users' registrations won't be marked with comments +#either. + +if {[exists_and_not_null create_comment_p] && [exists_and_not_null event_id] && $create_comment_p != 0} { + + db_foreach evnt_spam_create_comment "select + r.reg_id, r.comments + from events_reg_not_canceled r, events_prices p + where p.event_id = $event_id + and r.price_id = p.price_id + and r.user_id in + (select distinct u.user_id + from users u, ($users_sql_query) sql_query + where u.email = sql_query.email) + " { + append comments "\n------\nSent the following e-mail to this registrant on $send_date:\n\n$message_stripped\n------" + + db_dml evnt_spam_create_comment "update events_registrations + set comments = :comments + where reg_id = :reg_id" + } +} + +append pagebody "[ad_admin_header "Spamming $users_description"] + +

    Spamming Users

    +[ad_context_bar_ws [list "../index.tcl" "Events Administration"] "Spam"] + +
    + +Class description: $users_description. + +

    + +Query to be used: + +

    +$users_sql_query
    +
    + +

    + +Message to be sent: + +

      +
    • from: $from_address +
    • subject: $subject +
    • send on: $send_date +
    • body:
      $message_stripped
      + +
    + +" + +append pagebody " + +Queued for delivery by the spam sending daemon. +

    + +[ad_admin_footer] +" +db_release_unused_handles + +doc_return 200 text/html $pagebody + +ns_conn close + +ns_log Notice "spam.tcl: calling spam queue sweeper $spam_id now from interactive spam.tcl page" +send_scheduled_spam_messages +ns_log Notice "spam.tcl: spam $spam_id sent" + Index: openacs-4/contrib/packages/events/www/admin/spam/spamees-view.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/events/www/admin/spam/spamees-view.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/events/www/admin/spam/spamees-view.tcl 9 Mar 2003 12:08:36 -0000 1.1 @@ -0,0 +1,49 @@ +# spamees-view.tcl,v 1.1.2.2 2000/02/03 09:50:05 ron Exp +# events/admin/spamees-view.tcl +# Owner: bryanche@arsdigita.com +##### + +ad_page_contract { + Purpose: To show an admin about to spam a bunch of people a list + of all the spamees. + + @param sql_post_select sql query for which users to show + + @author Bryan Che (bryanche@arsdigita.com) + @cvs_id spamees-view.tcl,v 3.5.6.4 2000/09/22 01:37:42 kevin Exp +} { + {sql_post_select:notnull} +} + +if {![exists_and_not_null sql_post_select]} { + ad_return_complaint 1 "

  • You have entered this page without + a sql_post_select variable" +} + +# we collect the page body in whole_page +set whole_page "" +append whole_page "[ad_admin_header "Spam"] + +

    Spam

    + +[ad_context_bar_ws [list "../index.tcl" "Events Administration"] [list "action-choose.tcl?[export_url_vars sql_post_select]" "Spam"] "Spamees"] + +
    + +You are spamming the following people: +
      +" + + +db_foreach evnt_spamees_view $sql_post_select { + append whole_page "
    • $email" +} +append whole_page "
    [ad_footer]" + +## clean up, return the page + + + +doc_return 200 text/html $whole_page + +##### EOF Index: openacs-4/contrib/packages/events/www/doc/index.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/events/www/doc/index.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/events/www/doc/index.adp 9 Mar 2003 12:08:50 -0000 1.1 @@ -0,0 +1,343 @@ + +Events Module +"Events Documentation" + +

    Events

    + +(part of the ArsDigita Community System, +originally by Philip Greenspun and Bryan Che) + +

    +Note: this documentation refers to the 3.x version of Events. I plan +to update these soon but even as is, they will give a good overview of the +functionality as well as some possible future directions. The new +version uses ACS Events and many of the new 4.x modules including bulk +mail and attachments. Bryan Che also wrote an ASJ article on Events, +which I've included at /doc/events/asj. +

    + +
      +
    • User-accessible directory: /events/ (or wherever you've mounted events) +
    • Administrator directory: /events/admin/ +
    • data model and Tcl procs: /api-doc +
    + +

    The Big Idea

    + +

    +Organizations often present events, such as a lecture series or a social +gathering. This software module gives organizations a way to register +people for events online. + + +

    The Medium-sized Idea

    + +

    +Organizations often have a number of set events which they like to +repeat. For example, a company may have a certain presentation which it +makes over and over. A photoraphy club may hold monthly outings. A +marathon race could occur annually. Therefore, we organize events in +the following way: + +

    +Each organization has a series of activities that it holds. An +event is a particular instance of an activity--it is the actual +occurance of an activity. Each event has an organizer and takes place +in a physical location and during a certain time. For example, a +software company might hold a series of talks as activities: + +
    Company Talks
    +

      +
    • Why you should think our software is the best +
    • Why you should do things our way +
    • Why the Government should leave us alone and let us innovate +
    +

    +That software company could then present these talks as lecture events: +

    + + + + + +
    Talk (Activity) + Lecture Speaker (Event organizer) + Lecture Date +
    Why you should think our software is the best + billy + 05-07-2000 +
    Why you should think our software is the best + stevie + 08-29-2000 +
    Why the Government should leave us alone and let us innovate + billy + 09-10-2000 +
    + +

    +Organizations that organize their events using this convention may +then fully administer and register those events online using this +module. + +

    The Fine-details

    + +

    Activities

    + +

    +An organization is not necessarily an entire company--it can be a +company department or office or project or any other group of people. +Therefore, activities are owned by ACS user groups. Each user group +represents an organization of people. An activity also has a creator, a +name, a description, and a flag indicating if it is available. Finally, +an activity can link to a url for more information: + +

    +create table events_activities (
    +	activity_id	integer primary key,
    +	-- activities are owned by user groups
    +	group_id	integer references user_groups,
    +        creator_id      integer not null references users,
    +	short_name	varchar(100) not null,
    +	default_price   number default 0 not null,
    +	currency	char(3) default 'USD',
    +	description	clob,
    +        -- Is this activity occurring? If not, we can't assign
    +        -- any new events to it.
    +        available_p	char(1) default 't' check (available_p in ('t', 'f')),
    +        deleted_p	char(1) default 'f' check (deleted_p in ('t', 'f')),
    +        detail_url 	varchar(256) -- URL for more details,
    +	default_contact_user_id integer references users
    +);
    +
    + +

    Events

    +

    +For each event, we need to track its organizers, its location, and its +time. We define the organizers' roles and their responsibilities. We +also store extra information that might pertain to that specific event, +such as refreshemnts or audio/visual information. In addition, we store +of which activity this event is an instance. + +

    +create table events_events (
    +        event_id              integer not null primary key,
    +        activity_id	      integer not null references events_activities,
    +	venue_id	      integer not null references events_venues,
    +	-- the user group that is created for this event's registrants
    +	group_id	      integer not null references user_groups,
    +	creator_id	      integer not null references users,
    +        -- HTML to be displayed after a successful order.
    +        display_after         varchar(4000),
    +        -- Date and time.
    +        start_time            date not null,
    +        end_time              date not null,
    +	reg_deadline	      date not null,
    +        -- An event may have been cancelled.
    +        available_p	      char(1) default 't' check (available_p in ('t', 'f')),	
    +        deleted_p	      char(1) default 'f' check (deleted_p in ('t', 'f')),
    +        max_people	      integer,
    +	-- can someone cancel his registration?		
    +	reg_cancellable_p     char(1) default 't' check (reg_cancellable_p in ('t', 'f')),
    +	-- does a registration need approval to become finalized?
    +	reg_needs_approval_p  char(1) default 'f' check (reg_needs_approval_p in ('t', 'f')),
    +	-- notes for doing av setup
    +	av_note		      clob,
    +	-- notes for catering
    +	refreshments_note     clob,
    +	-- extra info about this event
    +	additional_note	      clob,
    +	-- besides the web, is there another way to register?
    +	alternative_reg	      clob,
    +        check (start_time < end_time),
    +	check (reg_deadline <= start_time)
    +);
    +
    +
    +-- where the events occur
    +create table events_venues (
    +       venue_id		  integer primary key,
    +       venue_name	  varchar(200) not null,
    +       address1		  varchar(100),
    +       address2		  varchar(100),
    +       city		  varchar(100) not null,
    +       usps_abbrev	  char(2),
    +       postal_code	  varchar(20),
    +       iso		  char(2) default 'us' references country_codes,
    +       time_zone	  varchar(50),
    +       -- some contact info for this venue
    +       fax_number	  varchar(30),
    +       phone_number	  varchar(30),
    +       email		  varchar(100),
    +       needs_reserve_p	  char(1) default 'f' check (needs_reserve_p in ('t', 'f')),
    +       max_people	  integer,	
    +       description	  clob
    +);
    +
    +
    + +

    +This data model also contains extensions for selling admission to +events, althought the tcl pages do not currently implement this feature. +These extensions can tie in with the +ecommerce module. + +

    +create table events_prices (
    +    price_id            integer primary key,
    +    event_id            integer not null references events_events,
    +    -- e.g., "Developer", "Student"
    +    description         varchar(100) not null,
    +    -- we also store the price here too in case someone doesn't want
    +    -- to use the ecommerce module but still wants to have prices
    +    price		number not null,
    +    -- This is for hooking up to ecommerce.	
    +    -- Each product is a different price for this event.  For example,
    +    -- student price and normal price products for an event.
    +--  product_id          integer references ec_products,
    +    -- prices may be different for early, normal, late, on-site
    +    -- admission,
    +    -- depending on the date
    +    expire_date	      date not null,
    +    available_date    date not null
    +);
    +
    +
    + +

    + + +

    Organizers

    + +Each event should have at least one organizer role. An organizer role +is an official position for that event. For example, a lecture +might have the organizer role of "speaker." Organizers are people +who fill an organizer role position. + + +
    +create table events_event_organizer_roles (
    +       role_id			integer 
    +				constraint evnt_ev_org_roles_role_id_pk 
    +				primary key,
    +       event_id			integer 
    +				constraint evnt_ev_org_roles_event_id_fk 
    +				references events_events
    +				constraint evnt_ev_org_roles_event_id_nn
    +				not null,  
    +       role			varchar(200) 
    +				constraint evnt_ev_org_roles_role_nn
    +				not null,
    +       responsibilities		clob,
    +       -- is this a role that we want event registrants to see?
    +       public_role_p		char(1) default 'f' 
    +				constraint evnt_ev_roles_public_role_p
    +				check (public_role_p in ('t', 'f'))
    +);
    +
    +create table events_organizers_map (
    +       user_id			   constraint evnt_org_map_user_id_nn
    +				   not null
    +				   constraint evnt_org_map_user_id_fk
    +				   references users,
    +       role_id			   integer 
    +				   constraint evnt_org_map_role_id_nn
    +				   not null 
    +				   constraint evnt_org_map_role_id_fk
    +				   references events_event_organizer_roles,
    +       constraint events_org_map_pk primary key (user_id, role_id)
    +);
    +
    +
    + +

    Registrations

    +For each person who registers for an event, we record a bunch of +information. This helps the organizations understand who is coming to +their events and why. It also helps the organization accomodate its +attendees' needs and group them together. + +

    +We organize registrations in the following way: a registration +represents a person who has expressed interest in attending the event. +There is one registration for each person who wants to attend. +Registrations can have different states. For example, a registration +may be wait-listed because there are already too many registrations for +a particular event. Or, a registration may be canceled. +

    +An order is a set of registrations. Typically, when a person +registers himself for an event, he will create one order containing his +single registration. But, there may be an individual who wishes to +register multiple people at once. In that case, the individual would +make one order containing multiple registrations. Thus, this data +model allows people to make multiple registrations. The tcl pages do +not yet implement this feature, though. + +

    +create table events_orders (
    +       order_id		integer not null primary key,
    +--       ec_order_id	integer references ec_orders,
    +       -- the person who made the order
    +       user_id		integer not null references users,
    +       paid_p		char(1) default null check (paid_p in ('t', 'f', null)),
    +	payment_method	varchar(50),
    +	confirmed_date	date,
    +	price_charged	number,
    +	-- the date this registration was refunded, if it was refunded
    +	refunded_date	date,
    +	price_refunded	number,	
    +       	ip_address	varchar(50) not null
    +);
    +
    +create table events_registrations(
    +        -- Goes into table at confirmation time:
    +	reg_id		integer not null primary key,
    +	order_id	integer not null references events_orders,
    +	price_id	integer not null references events_prices,
    +	-- the person registered for this reg_id (may not be the person
    +	-- who made the order)
    +	user_id		integer not null references users,
    +	-- reg_states: pending, shipped, canceled, waiting
    +	--pending: waiting for approval
    +	--shipped: registration all set 
    +	--canceled: registration canceled
    +	--waiting: registration is wait-listed
    +	reg_state	varchar(50) not null check (reg_state in ('pending', 'shipped', 'canceled',  'waiting')),
    +	-- when the registration was made
    +	reg_date	date,
    +	-- when the registration was shipped
    +	shipped_date	date,
    +	org		varchar(4000),
    +	title_at_org	varchar(4000),
    +	attending_reason  clob,
    +	where_heard	varchar(4000),
    +	-- does this person need a hotel?
    +        need_hotel_p	char(1) default 'f' check (need_hotel_p in ('t', 'f')),
    +	-- does this person need a rental car?
    +        need_car_p	char(1) default 'f' check (need_car_p in ('t', 'f')),
    +	-- does this person need airfare?
    +	need_plane_p	char(1) default 'f' check (need_plane_p in ('t', 'f')),
    +	comments	clob
    +);
    +
    +
    + +

    Using Events

    + +

    +With the events module, organizations can create, edit, and remove +activities. They can do the same to events and organizers. Thus, +organizations can fully describe and advertise any activity event +online. + +

    +Organizations can also obtain information about who is coming to their +events and spam those attendees. They can review order histories to see +how many people registered for a given event and why they came. In +addition, they can view order statistics by activity, month, date, and +order state. Finally, they can spam their own organizers to remind them +about their upcoming events. + +

    +People coming to register online at a site using this module will be +able to find upcoming activity events and sign up for them. + Index: openacs-4/contrib/packages/events/www/doc/asj/activity-admin.html =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/events/www/doc/asj/activity-admin.html,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/events/www/doc/asj/activity-admin.html 9 Mar 2003 12:09:03 -0000 1.1 @@ -0,0 +1,97 @@ + + + + +3 Week Boot Camp + + + + +

    3 Week Boot Camp

    +Your Workspace : Events Administration : Activities : Activity +
    + +

    Events for this Activity

    + +

    Activity Description

    + + + + + + + + + + + + + + + + + + + + + + + + + + +
    Name3 Week Boot Camp
    CreatorBrian Stein
    Default Contact Person
    Owning GroupArsDigita Bootcamps
    URL + http://www.arsdigita.com/boot-camp/threeweekbootcamp.html +
    DescriptionA lab environment for programmers to learn about the ArsDigita Community System and related tools. 3+ problem sets will be covered.
    Current or DiscontinuedCurrent
    + +

    +

    + +

    Activity Custom Fields

    + You may define default custom fields which you would like to + collect from registrants for this activity type. +

    + + + + +
    • app_letter (Application Letter), varchar2(4000) (text) +
    insert after | swap with next | delete ] + +
    • resume (Resume), clob (text) +
    insert after | delete ] + +

    +

    +

    Organizer Roles

    + +You may create default organizer roles for this activity type. + + +

    Accounting

    + + + + + +
    + +
    webmaster@arsdigita.com
    + + \ No newline at end of file Index: openacs-4/contrib/packages/events/www/doc/asj/bboard.html =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/events/www/doc/asj/bboard.html,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/events/www/doc/asj/bboard.html 9 Mar 2003 12:09:03 -0000 1.1 @@ -0,0 +1,36 @@ + + +Cambridge threads in ArsDigita General + + + + +

    Cambridge Threads

    + +Your Workspace : ArsDigita Discussion Forums : ArsDigita General : One Category + + +
    + + + + +
    +
    bryanche@arsdigita.com
    + + + Index: openacs-4/contrib/packages/events/www/doc/asj/chat.html =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/events/www/doc/asj/chat.html,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/events/www/doc/asj/chat.html 9 Mar 2003 12:09:03 -0000 1.1 @@ -0,0 +1,25 @@ + + + +Chat + + + +
    Mouth.

    Chat

    + Your Workspace : Chat
    +
    + + + + +
    + +
    bryanche@arsdigita.com
    + + \ No newline at end of file Index: openacs-4/contrib/packages/events/www/doc/asj/demo.html =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/events/www/doc/asj/demo.html,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/events/www/doc/asj/demo.html 9 Mar 2003 12:09:03 -0000 1.1 @@ -0,0 +1,17 @@ + + +Just A Demo + + +

    Just A Demo

    +
    + +You have clicked on a link or button from a demo page. As it is only a +demo, the links and submit buttons don't actually do anything other +than send you to this page. + +
    +
    bryanche@arsdigita.com
    + + + \ No newline at end of file Index: openacs-4/contrib/packages/events/www/doc/asj/event-admin.html =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/events/www/doc/asj/event-admin.html,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/events/www/doc/asj/event-admin.html 9 Mar 2003 12:09:03 -0000 1.1 @@ -0,0 +1,139 @@ + + + +Cambridge, MA: Thursday, May 11, 2000 + + + +

    Cambridge, MA: Thursday, May 11, 2000

    +Your Workspace : Events Administration : Activities : Activity : Event +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    CreatorBootcamp Admin
    LocationCambridge, MA
    Confirmation MessageYou have been accepted into the 3-week bootcamp starting May 8th in the ArsDigita headquarters in Cambridge bootcamp. Please show up between 9 and 10 on the first Monday of bootcamp. Reference books and most other materials will be provided. Still got questions? Send mail to bootcamp@arsdigita.com.
    Start Time2000-05-11 09:00
    End Time2000-05-26 18:00
    Registration Deadline2000-05-11 08:59
    Maximum Capacity + 28 +
    Registration Cancellable? + yes +
    Registration Needs Approval? + yes +
    Event Contact Person + bootcamp@arsdigita.com +
    Availability StatusCurrent   (toggle) + +
    + + +

    Custom Fields

    +You may define custom fields that you would like to +collect from registrants. +

    + + +
    • app_letter (Application Letter), varchar2(4000) (text) +
    insert after | swap with next | delete ] + +
      +
    • resume (Resume), clob (text) +
    insert after | delete ] + +
    +

    +

    +

    Organizers

    +

    Agenda Files

    + +

    Event User Group

    + You may manage the user group for this event. + + +

    Event Notes

    + + + + + + + + + + +
    Refreshments Note
    + + + +
    + +
    +
    Audio/Visual Note
    + + + +
    + +
    +
    Additional Note
    + + + +
    + +
    +
    + + + +
    + +
    webmaster@arsdigita.com
    + + \ No newline at end of file Index: openacs-4/contrib/packages/events/www/doc/asj/index.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/events/www/doc/asj/index.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/events/www/doc/asj/index.adp 9 Mar 2003 12:09:03 -0000 1.1 @@ -0,0 +1,746 @@ + +Web-Based Event Planning and Registration +"Events Documentation : ASJ Article" +

    +ArsDigita Systems Journal: Web-Based Event Planning and Registration +

    + by Bryan Che + +

    Sumbitted on: 2000-06-09 +
    Last updated: 2000-09-25
    + +

    +Online registration harnesses much of the Internet's power. It saves +time, enhances productivity, and simplifies operations. It lowers +costs. It facilitates community. It provides flexibility. +Surprisingly, though, online registration provides these benefits more +to event administrators than to the people who register for events. +

    + +Web-based registration does provide some measure of ease for event +attendees. In addition to eliminating paper forms, Web-based +registration can facilitate collaboration among registrants. +It can also provide immediate feedback to people when they register. +For event planners, though, online registration offers the ability to: + +

      +
    • Make it easy to offer repeated events +
    • Make it easy to collect, aggregate, and view registrations +
    • Provide convenient means for communicating with registrants +
    • Provide means for coordinating registrants +
    + +These four advantages can save event administrators a tremendous amount +of work and time. Thus, even though event participants may gain from +Web-based event registration, event administrators are the ones who +truly profit from it. + +

    Events Module Goals Overview

    +The events module has four main goals. In accordance with the fact that +online events handling benefits event planners the most, these goals +focus on helping event administrators. The events module aims to: + +
      +
    • Simplify offering repeat events +
    • Simplify handling registrations +
    • Simplify communicating with registrants +
    • Simplify coordinating registrants +
    + + +

    Repeated Events

    + +Organizations often offer the same basic event on a repeated basis. For +example, ArsDigita runs a series of bootcamps each month. These +bootcamps are essentially the same -- they teach the same material, +last the same amount of time, and provide similar experiences. The only +things that really vary are where and when these bootcamps occur. +Therefore, data within the events module divides into activities +and events. +

    + +An activity is a kind of event; it is the type of thing for which people +register. Activities might be bootcamps or lectures or conferences. An +event is an instance of an activity. An event might be a three-week +bootcamp starting on June 28, 2000 in Cambridge, MA or an Oracle +conference in Amsterdam from July 23-25, 2001. +

    + +By making this distinction between activities and events, the events +module can help event planners avoid repeated work. For example, people +who want to manage ArsDigita bootcamps need only perform all of their +major planning once. They can plan what their bootcamp activity will +cover, what type of information registrants need to provide, and so on +the first time they plan a bootcamp. From then on, whenever they want +to create an online registration form for a new bootcamp, they do not +need to repeat entering information that is the same across all +bootcamps. Instead, they may simply edit items specific to a particular +bootcamp event -- where and when that bootcamp takes place, for +example. The events module will then generate an appropriate +registration form for users based upon the bootcamp's activity +information and its specific event information. This process makes it +quite convenient to offer events on a repeated basis. +

    + +[screenshot of order histories for different events of a particular activity] + +

    Handling Registrations

    + +Filling out a registration form by hand may not +be terribly inconvenient. But, processing thousands of hand-written +registration forms is. Therefore, offering online, electronic +registration forms can save event administrators significant time. +Online registration forms means that as soon as a registrant submits his +application, event administrators may review the registration online +without much hassle. Furthermore, they can easily view aggregate +information, such as how many people have registered for a particular +event. And, they may approve, deny, or mark registrations using simple +point-and-click interfaces. Managing registrations online can save +event planners a significant amount of work. +

    + +[screenshot of admin page for wait-listing a registration] + +

    Communicating with Registrants

    + +Another benefit of online registration is that it can facilitate easy +communication between event planners and registrants. The events module +collects e-mail addresses from each person who registers for a certain +event. Thus, it can provide an interface for helping event planners do +things like "e-mail all the people who attended these three conferences" +or "e-mail this particular registrant to request more information about +his work history." Because all registration, event, and communication +information is provided through the same user interface (the Web), +communicating with various event registrants is a simple task. Thus, +online registration can greatly help event designers to communicate with +registrants. +

    + +[screenshot of page for e-mailing registrants] + +

    Coordinating Registrants

    + +Because registrants have entered some personal information online when +registering for an event, the events module can help event +administrators organize these registrants into user groups. These +groups of users can then interact with bulletin boards, calendars, and +other features which the event administrator sees fit to add. In this +way, event administrators can easily provide a variety of +community-fostering features for people who register online. If these +people had not registered online and were not entered into a database, +then they would not be able to socialize, communicate, and work together +over the Internet as members of the same event. +

    + +[screenshot of entrance to ACS chat rooms] + +

    Events Module Implementation

    + +

    The Data Model

    + +The events module's data model consists of four main sections: + +
      +
    • tables for managing the events +
    • tables for collecting custom fields +
    • tables for managing events organizers +
    • tables for managing events registrants +
    + +

    +

    + +
    +

    + +

    Managing Events
    + +
    Activities
    + +An organization is not necessarily an entire company -- it can be a +company department or office or project or any other group of +people. Therefore, activities are owned by ACS user groups. Each user +group represents an organization of people. An activity also has a +creator, a name, a description, and a flag indicating if it is +available. Finally, an activity can link to a url for more information: +

    + +

    +
    +create table events_activities (
    +	activity_id	integer primary key,
    +	-- activities are owned by user groups
    +	group_id	integer references user_groups,
    +        creator_id      integer not null references users,
    +	short_name	varchar(100) not null,
    +	default_price   number default 0 not null,
    +	currency	char(3) default 'USD',
    +	description	clob,
    +        -- Is this activity occurring? If not, we can't assign
    +        -- any new events to it.
    +        available_p	char(1) default 't' check (available_p in ('t', 'f')),
    +        deleted_p	char(1) default 'f' check (deleted_p in ('t', 'f')),
    +        detail_url 	varchar(256), -- URL for more details
    +	default_contact_user_id integer references users
    +);
    +
    +
    +

    + +

    Events
    + +Information about the events are stored in the tables events_events, +events_prices, and events_venues. events_events tracks data such as an +event's start and end times, where it occurs, and how many people may +register for it. +

    + +

    +
    +create table events_events (
    +        event_id              integer not null primary key,
    +        activity_id	      integer not null references events_activities,
    +	venue_id	      integer not null references events_venues,
    +	-- the user group that is created for this event's registrants
    +	group_id	      integer not null references user_groups,
    +	creator_id	      integer not null references users,
    +        -- HTML to be displayed after a successful order.
    +        display_after         varchar(4000),
    +        -- Date and time.
    +        start_time            date not null,
    +        end_time              date not null,
    +	reg_deadline	      date not null,
    +        -- An event may have been cancelled.
    +        available_p	      char(1) default 't' check (available_p in ('t', 'f')),	
    +        deleted_p	      char(1) default 'f' check (deleted_p in ('t', 'f')),
    +        max_people	      integer,
    +	-- can someone cancel his registration?		
    +	reg_cancellable_p     char(1) default 't' check (reg_cancellable_p in ('t', 'f')),
    +	-- does a registration need approval to become finalized?
    +	reg_needs_approval_p  char(1) default 'f' check (reg_needs_approval_p in ('t', 'f')),
    +	-- notes for doing av setup
    +	av_note		      clob,
    +	-- notes for catering
    +	refreshments_note     clob,
    +	-- extra info about this event
    +	additional_note	      clob,
    +	-- besides the web, is there another way to register?
    +	alternative_reg	      clob,
    +        check (start_time < end_time),
    +	check (reg_deadline <= start_time)
    +);
    +
    +
    +

    + +This data model contains, through events_prices, extensions for selling +admission to events. The presentation pages, however, do not currently +implement this feature. These extensions can tie in with the ecommerce +module. + + +

    +
    +create table events_prices (
    +    price_id            integer primary key,
    +    event_id            integer not null references events_events,
    +    -- e.g., "Developer", "Student"
    +    description         varchar(100) not null,
    +    -- we also store the price here too in case someone doesn't want
    +    -- to use the ecommerce module but still wants to have prices
    +    price		number not null,
    +    -- This is for hooking up to ecommerce.	
    +    -- Each product is a different price for this event.  For example,
    +    -- student price and normal price products for an event.
    +--  product_id          integer references ec_products,
    +    -- prices may be different for early, normal, late, on-site
    +    -- admission,
    +    -- depending on the date
    +    expire_date	      date not null,
    +    available_date    date not null
    +);
    +
    +
    +

    + +The table events_venues retains knowledge about all the different +locations in which an event might take place. + + +

    Collecting Custom Fields
    + +One of the hallmark features of the events module is its ability to let +event administrators collect customized information from events +registrants. Organizations are usually interested in obtaining more +than just a name and e-mail address. For example, a company might +request registrants to provide their resumes. The company could do this +in the events module by creating a custom field for its event called +resume. + +

    + +

    +
    +create table events_event_fields (
    +	event_id	not null references events_events,
    +	column_name	varchar(30) not null,
    +	pretty_name	varchar(50) not null,
    +	-- something generic and suitable for handing to AOLserver, 
    +	-- e.g., boolean or text
    +	column_type	varchar(50) not null,
    +	-- something nitty gritty and Oracle-specific, e.g.,
    +	-- char(1) instead of boolean
    +	-- things like "not null"
    +	column_actual_type	varchar(100) not null,
    +	column_extra	varchar(100),
    +	-- Sort key for display of columns.
    +	sort_key	integer not null
    +);
    +
    +
    +

    + +

    Managing Organizers
    + +Each event should have at least one organizer role. An organizer role is +an official position for that event. For example, a lecture might have +the organizer role of "speaker." Organizers are people who fill an +organizer role position. +

    + +

    +
    +create table events_event_organizer_roles (
    +       role_id			integer 
    +				constraint evnt_ev_org_roles_role_id_pk 
    +				primary key,
    +       event_id			integer 
    +				constraint evnt_ev_org_roles_event_id_fk 
    +				references events_events
    +				constraint evnt_ev_org_roles_event_id_nn
    +				not null,  
    +       role			varchar(200) 
    +				constraint evnt_ev_org_roles_role_nn
    +				not null,
    +       responsibilities		clob,
    +       -- is this a role that we want event registrants to see?
    +       public_role_p		char(1) default 'f' 
    +				constraint evnt_ev_roles_public_role_p
    +				check (public_role_p in ('t', 'f'))
    +);
    +
    +create table events_organizers_map (
    +       user_id			   constraint evnt_org_map_user_id_nn
    +				   not null
    +				   constraint evnt_org_map_user_id_fk
    +				   references users,
    +       role_id			   integer 
    +				   constraint evnt_org_map_role_id_nn
    +				   not null 
    +				   constraint evnt_org_map_role_id_fk
    +				   references events_event_organizer_roles,
    +       constraint events_org_map_pk primary key (user_id, role_id)
    +);
    +
    +
    +

    + +

    Managing Registrations
    + +For each person who registers for an event, the software helps +organizations understand who is coming to their events and why. It also +helps an organization accommodate its attendees' needs and group them +together. +

    + +The events module organizes registrations in the following way: a +registration represents a person who has expressed interest in attending +the event. There is one registration for each person who wants to +attend. Registrations can have different states. For example, a +registration may be wait-listed because there are already too many +registrations for a particular event. Or, a registration may be +canceled. +

    + +An order is a set of registrations. Typically, when a person registers +himself for an event, he will create one order containing his single +registration. But, there may be an individual who wishes to register +multiple people at once. In that case, the individual would make one +order containing multiple registrations. Thus, this data model allows +people to make multiple registrations. The Web pages do not yet +implement this feature, though. +

    + +

    +
    +create table events_orders (
    +       order_id		integer not null primary key,
    +--       ec_order_id	integer references ec_orders,
    +       -- the person who made the order
    +       user_id		integer not null references users,
    +       paid_p		char(1) default null check (paid_p in ('t', 'f', null)),
    +	payment_method	varchar(50),
    +	confirmed_date	date,
    +	price_charged	number,
    +	-- the date this registration was refunded, if it was refunded
    +	refunded_date	date,
    +	price_refunded	number,	
    +       	ip_address	varchar(50) not null
    +);
    +
    +create table events_registrations(
    +        -- Goes into table at confirmation time:
    +	reg_id		integer not null primary key,
    +	order_id	integer not null references events_orders,
    +	price_id	integer not null references events_prices,
    +	-- the person registered for this reg_id (may not be the person
    +	-- who made the order)
    +	user_id		integer not null references users,
    +	-- reg_states: pending, shipped, canceled, waiting
    +	--pending: waiting for approval
    +	--shipped: registration all set 
    +	--canceled: registration canceled
    +	--waiting: registration is wait-listed
    +	reg_state	varchar(50) not null check (reg_state in ('pending', 'shipped', 'canceled',  'waiting')),
    +	-- when the registration was made
    +	reg_date	date,
    +	-- when the registration was shipped
    +	shipped_date	date,
    +	org		varchar(4000),
    +	title_at_org	varchar(4000),
    +	attending_reason  clob,
    +	where_heard	varchar(4000),
    +	-- does this person need a hotel?
    +        need_hotel_p	char(1) default 'f' check (need_hotel_p in ('t', 'f')),
    +	-- does this person need a rental car?
    +        need_car_p	char(1) default 'f' check (need_car_p in ('t', 'f')),
    +	-- does this person need airfare?
    +	need_plane_p	char(1) default 'f' check (need_plane_p in ('t', 'f')),
    +	comments	clob
    +);
    +
    +
    +

    + +

    The Presentation Pages

    + +The vast majority of the events module's Web interface is located in its +admin directory. From these pages, an event administrator can manage +his events and event registrants. + +
    The Main Admin Page
    + +The main administration page provides a summary of current event +registrations and links to the key functions he can perform: +
      +
    • Managing activities +
    • Managing venues +
    • Viewing order histories +
    • Spamming (e-mailing) registrants +
    +

    + +[screenshot of main admin page] +

    + +

    Managing Activities and Events
    + +As previously stated, one of the goals of the events module was to +facilitate repeating events through the use of activities and events. +Separate admin pages for managing activities and events accomplish this +goal. Furthermore, the event admin page links to pages which fulfill +other goals for the events module: The event admin page links to pages +displaying order-histories, helping administrators handle registrations. +It also links to pages for e-mailing registrants, providing for easy +communication to registrants. Finally, it links to the event's user +group, letting the administrator coordinate registrants. +

    + +[screenshot of activity admin page] +

    + +[screenshot of event admin page] +

    + +One of the links from the main administration page is for managing +venues. Venues are locations where events occur. Since an organization +or person's events will usually take place within a certain set of +venues, the events module provides a means of creating and managing +these locations. Then, when an event administrator creates an event, he +can easily select an existing venue for his event -- and save himself the +work of typing in all the relevant information for that venue again. +

    + +[screenshot of venues admin page] +

    + +

    Managing Registrations
    + +The Order History pages provide most of the functionality for managing +registrations. From these pages, event administrators can view +aggregated registration information and answer questions such as, "how +many people registered for that event," or "how many people placed +registrations on this date?" +

    + +[screenshot of order history index page] +

    + +Event administrators can also view a single registration and perform +actions upon it, like approving it. +

    + +[screenshot of single registration order history] +

    + + +

    E-mailing Registrants
    + +When a person places a registration in the events module, he has to +provide his e-mail address. This means that event administrators can +e-mail groups of registrants and individual registrants from the admin +pages -- perhaps, for example, to advertise an upcoming, similar event. +

    + +[screenshot of page for e-mailing registrants] +

    + +

    Coordinating Registrants
    + +Because the events module is part of the ArsDigita Community System +(ACS), it has access to all of the community-building features within +the ACS. Each event, as explained earlier, has a corresponding ACS user +group. All registrants for a particular event are automatically placed +into their respective event's user group. This means that event +administrators can easily provide, using other ACS modules, the ability +for an event's registrants to communicate and collaborate together in a +variety of ways. For example, the event administrator could add a +bboard to an event's user group. Then, the individuals within that user +group could post messages for each other. The link to managing the +event's user group comes from the event admin page. +

    + +[screenshot of an ACS bulletin board] +

    + +

    User Registration
    + +Although the power and convenience of online registration benefits +events administrators the most, registrants should still find it simple +to register for an event. Thus, the user interface for placing a +registration is fairly straightforward. The events module tries to fill +in as much personal information as possible for the registrant if he is +already an ACS user of the registration Web site. Then, the user must +simply provide the rest of the registration material in which the even +planners are interested. +

    + +[screenshot of registration page] +

    + +

    Events Module Comparison

    + +

    Key3Media

    + +Because the events module focuses on enabling event administrators +rather than event registrants, it offers significant advantages against +most online registration offerings, which traditionally view Web-based +registration as simply another way to collect registration information. +Registration sites which do not offer special capabilities for event +planners lose out on much of the power and efficiency that comes from +offering events online. For example, Key3Media is a large company which +handles online registration for a number of events, including Comdex, +JavaOne, and Linux Business Expo. But, Key3Media treats online +registration as nothing more than another means to collect information +as part of a complicated setup for registering people. +

    + +Key3Media collects registration information for events through both +paper and Web applications. Web applications go directly into a +database; paper applications are entered into the database by Key3Media +employees. Once Key3Media processes an application, it sends a +confirmation message to the application's registrant. Online +registrants receive an online confirmation, and paper applicants receive +a paper confirmation. +

    + +Upon completing signups for an event, Key3Media exports all of its +registration information into a file -- typically a Microsoft Excel +spreadsheet -- and gives the file to another company. This company +serves as a "holding tank" for the registration data and eventually +passes the records to a third company. This third company may be the +Key3Media client running the event or perhaps a company building a Web +site for the client's event, and it uses the registration data as it +wishes. +

    + +Key3Media's solution for handling event registration seems to work fine +for collecting information. But, its solution does little to help event +planners communicate with registrants, coordinate registrants, and +aggregate information about registrants. Key3Media cannot inform a +client for what other of the client's events a person has registered. +Key3Media cannot help registrants collaborate and communicate. +Key3Media cannot offer a centralized, unified, and integrated interface +to event management. The events module, by focusing on event planners, +does offer all these features in addition to facilitating easy online +event-registration. +

    + +<% +#UNCOMMENT THIS SECTION OUT ONCE WE HAVE APPROVAL +#FROM ORACLE TO PUBLISH IT + +#One significant reason for choosing Key3Media is that it will process both +#paper and electronic registrations. Because the events module is a +#Web-based application, it cannot intrinsically handle paper +#applications. However, event administrators may still take advantage of +#the planning and organizing capabilities of the events module while +#contracting out registration-handling to a company like Key3Media. +#Indeed, this is what Oracle is doing for its iDevelop 2000 Conferences +#site (http://idevelop2000.com). +#

    +# +#ArsDigita is building the Oracle iDevelop site based upon the events +#module. By doing so, ArsDigita enables Oracle iDevelop planners to +#manage their conferences and conference attendants. But, Oracle has +#hired another company (Key3Media) to handle its registrations, allowing +#Oracle to offer multiple means of registration. Once Key3Media has +#collected its registration data, it will pass the information to +#ArsDigita. ArsDigita will then upload the registration information into +#the events module -- allowing iDevelop administrators to organize their +#conferences and attendees just as if the attendees had registered for +#iDevelop through the events module's own registration pages. In this +#way, Oracle will be able to harness virtually all of the power of the +#events module while still allowing for paper-based registrations. Of +#course, why anyone attending an Oracle Technology Network conference +#would choose a paper application over the Internet is another matter. +%> + +

    Evite.com

    + +Although most Web sites that offer online registration do not support +much functionality for event planners, there are a number of sites +springing up which offer users some basic abilities to plan and organize +personal functions. Evite.com +(http://www.evite.com) is one such +popular site. +

    + +Evite.com focuses on helping users to plan events for which they would +like to invite guests. It does this by offering a simple interface for +individuals to: + +

      +
    • plan a series of events +
    • invite people to those events +
    • RSVP to events to which they are invited +
    • see who is coming to their events +
    • remind themselves about events +
    + +In many ways, Evite.com and other, similar sites +(http://socialeventplanner.com, +http://invites.yahoo.com, +http://www.pleasersvp.com, +and so on) understand that their sites are +useful because they enable people to plan and organize events. Evite +even supports, to some extent, the four goals outlined for the events +module. +

    + +Evite supports repeating events as well as the distinction between +activities and events. For example, a user can create invitations for a +"Birthday" event and have this Birthday event repeat every year. +Birthdays, then, are like activities in the events module, and the +annual Birthday parties are like events within the events module. +Evite.com, though, does not support creating arbitrary activities like +the events module. +

    + +Evite helps users handle registrations by allowing users to setup lists +of guests to invite to their events. Once a user has setup a guest list +for an event, Evite sends e-mail to each person on the user's guest +list, notifying him that he has been invited to an event. Evite also +allows these invitees to RSVP so that users may see who is coming to +their events. Evite lacks, however, a number of the aggregation and +advanced registration-handling functions of the events module. Evite +also does not let users create events for which arbitrary users can +register -- event registrants must first be invited. +

    + +Communicating with invitees through Evite takes place through Evite's +address book features. Users may store email contacts and create groups +of contacts within their address book. Then, they can send e-mail to +individual e-mail addresses or to groups of e-mail addresses. This +functionality seems fairly limited as it does not provide much support +for communicating within the context of an event. For example, users +cannot ask to e-mail "all the people who attended these three +events" -- as they could within the events module. +

    + +If Evite offers limited communications capabilities, it supports even +fewer community-building options. Unlike the events module, which +supports a host of community capabilities through other ACS modules, +Evite merely lets invitees see who else is coming to a particular event. +

    + +Evite.com and other event planning sites on the Internet are optimized +to help individuals plan social events like a Memorial Day barbeque. +The events module was designed to handle enterprise event planning and +registration -- and is consequently much more powerful than a site like +Evite.com. People may still use the events module, though, to implement +something like Evite.com; its data model and Web pages intrinsically +support virtually all of the functionality of Evite. + + +

    Events Module Future Features

    + +ArsDigita has been using the events module for several months now on its +own Web site +(http://www.arsdigita.com/events). +This module has handled thousands of registrations for lectures, +bootcamps, and other activities. So far, the events module has +performed well and provided event administrators with a great deal of +time-saving and convenience. The module more than adequately achieves +the four goals I outlined in the beginning of this article. Still, +there are several key areas in which ArsDigita plans to improve +this module. +

    + +First of all, the data model for the events module supports +tasks which the Web pages do not yet implement. These main +features are support for various event prices, support for online +payment for events, and support for multiple registrations per order. +Adding these features will enable organizations to charge registrants +for their events, charge different types of registrants different +amounts of money, and allow one person to place multiple registrations +on behalf of other people. +

    + +ArsDigita also plans to expand its support of event registrations for +sub-communities. The events module already allows ACS user groups to +own event activities. Consequently, user groups may administrate their +own events and also restrict others from administering those same +events. But, this is the extent of the event module's sub-community +features. ArsDigita intends to further aid sub-communities by making it +possible for them to maintain their own "instances" of the events +module. Thus, sub-sites will be able to offer their own, distinct +registration pages and URL's as well as administration pages. An +ArsDigita Boot Camp sub-community could, for example, offer its own +events at www.arsdigita.com/bootcamp/events/ instead of listing its boot +camps along with all the other events at www.arsdigita.com/events/. +

    + +Finally, there are some areas in the data model ArsDigita plans to +re-write because they are not elegant. Foremost of these areas is how +the module handles event custom fields. Currently, the data model is +styled after the user group module and creates a new event_n_info table +for each event. Ideally, the module would store custom information +within the user_group_member_fields/user_group_member_field_map tables. +But, these tables do not support enough data types for the events module +yet. There are plans, though, to update these user group tables in the +near future so that the events module may store information within them +for registrants. + +

    +Submitted by Bryan Che Index: openacs-4/contrib/packages/events/www/doc/asj/main-admin.html =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/events/www/doc/asj/main-admin.html,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/events/www/doc/asj/main-admin.html 9 Mar 2003 12:09:03 -0000 1.1 @@ -0,0 +1,219 @@ + + + +ArsDigita Events Administration + + + + +

    Events Administration

    +Your Workspace : Events Administration +
    + + + +

    Current Events Registration Status

    + +

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +Activity  +Location  +Start v +End  +Confirmed  +Pending  +Wait-Listed  +Total 
    2 Week Boot CampCambridge, MASeptember 5, 2000September 15, 2000 + + 23 +13 + + 27 +
    Two-day Boot Camp (long weekend)Atlanta, GASeptember 9, 2000September 10, 2000 + + 22 + + + 1 +0 + + 23 +
    1 Week Boot CampBerkeley, CASeptember 11, 2000September 15, 2000 + + 10 +00 + + 10 +
    One-day Course: Web Tools for Online CommunitiesCyberjaya, MalaysiaSeptember 13, 2000September 13, 2000 + + 10 +00 + + 10 +
    One-day Course: Web Tools for Online CommunitiesCyberjaya, Selangor, MalaysiaSeptember 14, 2000September 14, 2000 + + 40 +00 + + 40 +
    1 Week Boot CampWashington, DCSeptember 25, 2000September 29, 20000000
    Two-day Boot Camp (long weekend)Cambridge, MASeptember 30, 2000October 1, 20000 + + 1 +0 + + 1 +
    2 Week Boot CampCambridge, MAOctober 2, 2000October 13, 20000 + + 3 +0 + + 3 +
    ACS installation Boot CampHamburg, GermanyOctober 2, 2000October 2, 2000 + + 1 + + + 4 +0 + + 5 +
    3 Week Boot CampHamburg, GermanyOctober 4, 2000October 20, 2000 + + 12 + + + 3 +0 + + 15 +
    + + + + +


    + +
    webmaster@arsdigita.com
    + + Index: openacs-4/contrib/packages/events/www/doc/asj/order-history-one-activity.html =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/events/www/doc/asj/order-history-one-activity.html,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/events/www/doc/asj/order-history-one-activity.html 9 Mar 2003 12:09:03 -0000 1.1 @@ -0,0 +1,58 @@ + + + +ArsDigita Events Administration: Order History - By Activity + + + +

    Order History - For Activity # 221 (One-day Course: Web Tools for Online Communities)

    +Your Workspace : Events Administration : Order History : By Activity : Activity +
    + + + + + + + + + + + + + + +
    Event Location + Date + Number of Registrations +
    Seattle, WA + July 16, 2000 + 2 registrations
    Cambridge, MA + June 24, 2000 + 116 registrations
    Tel Aviv, Israel + June 15, 2000 + 40 registrations
    Philadelphia, PA + April 9, 2000 + 82 registrations
    Cambridge, MA + April 2, 2000 + 334 registrations
    Cambridge, MA + January 9, 2000 + 334 registrations
    Palo Alto, CA + December 21, 1999 + 217 registrations
    Munich, Germany + December 14, 1999 + 36 registrations
    Bristol, United Kingdom + November 30, 1999 + 50 registrations
    Berkeley, CA + November 22, 1999 + 253 registrations
    Pasadena, CA + November 14, 1999 + 184 registrations
    + + + +
    + +
    webmaster@arsdigita.com
    + + \ No newline at end of file Index: openacs-4/contrib/packages/events/www/doc/asj/order-history.html =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/events/www/doc/asj/order-history.html,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/events/www/doc/asj/order-history.html 9 Mar 2003 12:09:03 -0000 1.1 @@ -0,0 +1,40 @@ + + + +ArsDigita Events Administration: Events Order History + + + + +

    Order History

    +Your Workspace : Events Administration : Order History +
    + +

    View Orders/Statistics by:

    + + +
    +

    Search For an Individual Registration:

    + +
    +Enter either the registration number or the customer's last name for the order you wish to view:
    +
      + + +
          
      Registration #Last Name
    +
    + + + + +
    + +
    webmaster@arsdigita.com
    + + Index: openacs-4/contrib/packages/events/www/doc/asj/order-one.html =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/events/www/doc/asj/order-one.html,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/events/www/doc/asj/order-one.html 9 Mar 2003 12:09:03 -0000 1.1 @@ -0,0 +1,355 @@ + + + +Register + + + + +Register + for + 3 Week Boot Camp + in Pasadena, CA +

    +Your Workspace : Events : Register +
    +

    Note: A registration for this event + requires final approval from an administrator. If you sign up + for 3 Week Boot Camp, your final registration will be pending + administrator approval. +

    + + + + + +

    About the Event

    +
      + +

    • Start Date: Monday, June 12, 2000, +9:00 AM + + +
    • End Date: Friday, June 30, 2000, +8:00 PM + +
    • Registration Deadline: Monday, +June 12, 2000, +8:00 AM + +
    • Pasadena, CA +(you'll get specifics after you register) + +
    +
    • Cost: free
    + + +

    About You

    +
    + + + + + + + + + + + + + +
    NameBryan Che +
    Emailbryanche@arsdigita.com +
    Telephone number
    What is your organization? + +
    What is your title or main job description? + +
    Where did you hear
    about this activity?
    +
    +
    Reason for attending:
    +
    + + + + + +
    Application Letter + +
    Resume +
    + +

    Mailing Address

    + + + + + + +
    Line 1 + +
    Line 2 + +
    City + + State + Postal Code +
    Country + + +
    + +
    +
    +
    + + + +
    + +
    webmaster@arsdigita.com
    + + \ No newline at end of file Index: openacs-4/contrib/packages/events/www/doc/asj/reg-wait-list.html =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/events/www/doc/asj/reg-wait-list.html,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/events/www/doc/asj/reg-wait-list.html 9 Mar 2003 12:09:03 -0000 1.1 @@ -0,0 +1,34 @@ + + + + +Wait-List Registration + + + +

    Wait-List Registration for 2 Week Boot Camp

    +Your Workspace : Events Administration : Wait-List Registration +
    + +
    + +Are you sure that you want to wait-list alyssa_p_hacker@mit.edu's registration for 2 Week Boot Camp? +

    +If you would like, you may enter a comment for why you +are wait-listing this registration: +

    + + +

    +

    + +
    + + + +
    + +
    webmaster@arsdigita.com
    + + Index: openacs-4/contrib/packages/events/www/doc/asj/single-order-history.html =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/events/www/doc/asj/single-order-history.html,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/events/www/doc/asj/single-order-history.html 9 Mar 2003 12:09:03 -0000 1.1 @@ -0,0 +1,166 @@ + + + +Registration # 17470 (canceled) + + + +

    Registration # 17470 (canceled)

    +Your Workspace : Events Administration : Order History : Registration +
    + + +
    + +

    Event Information

    +3 Week Boot Camp in + Berkeley, CA +
    from May 8, 2000 to May 26, 2000 + + +

    Registration Information

    + + + + + +
    Registration State +canceled +
    Registration Date + 2000-05-01 13:05:29
    + +
    + +

    Customer Information

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameBryan Che
    Emailbryanche@arsdigita.com
    Telephone number617-555-3141
    Address500 Memorial Dr
     #243
     Cambridge, MA 02139
    Attending reasonSounds like fun
    Heard fromme
    Application LetterHi, this is my application
    ResumeI work
    Needs
      +

      Comments

      +------
      +Sent the following e-mail to this registrant on 2000-05-01 13:13:54:
      +
      +We need more information to process your registration for
      +3 Week Boot-Camp in 
      +    Berkeley, CA 
      +    from May 8, 2000 to May 26, 2000
      +    
      +Please come to
      +http://www.arsdigita.com/events/order-one.tcl?event_id=831
      +------
      + +
      + +

      Registration Maintenance

      + + +
      +

      All info in events_registrations table regarding registration # 17470

      +This is probably only worth looking at if there's a problem with the registration. +

      + + + + + + + + + + + + + + + + + +
      REG_ID + 17470 +
      ORDER_ID + 79320 +
      PRICE_ID + 382 +
      USER_ID + 1929 +
      REG_STATE + canceled +
      ORG + aD +
      TITLE_AT_ORG + developer +
      ATTENDING_REASON + Sounds like fun +
      WHERE_HEARD + me +
      NEED_HOTEL_P + f +
      NEED_CAR_P + f +
      NEED_PLANE_P + f +
      COMMENTS + +------ +Sent the following e-mail to this registrant on 2000-05-01 13:13:54: + +We need more information to process your registration for +3 Week Boot-Camp in + Berkeley, CA + from May 8, 2000 to May 26, 2000 + +Please come to +http://www.arsdigita.com/events/order-one.tcl?event_id=831 +------ +
      REG_DATE + 2000-05-01 +
      SHIPPED_DATE + +
      + + + +


      + +
      webmaster@arsdigita.com
      + + Index: openacs-4/contrib/packages/events/www/doc/asj/spam-selected-events.html =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/events/www/doc/asj/spam-selected-events.html,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/events/www/doc/asj/spam-selected-events.html 9 Mar 2003 12:09:03 -0000 1.1 @@ -0,0 +1,192 @@ + + + +Spam Selected Events + + + +

      Spam Selected Events

      +Your Workspace : Events Administration : Spam Selected Events +
      + Select the event(s) whose registrants you would like to spam

      + or + + + + +

      + +
      + + + + + + + + + +
      Show Events Starting in the:
      [Last Month | Last 6 Months | Last Year | Future | All]
      + +

      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      +Activity v +Location  +Start  +End 
      3 Week Boot CampCambridge, MAMay 11, 2000May 26, 2000
      3 Week Boot CampCambridge, MAMarch 6, 2000March 24, 2000
      3 Week Boot CampHamburg, GermanyOctober 4, 2000October 20, 2000
      Evening Course: Web Application DesignToronto, Ontario, CanadaJune 26, 1999June 26, 1999
      Future EventsPalo Alto, CAJune 1, 2000July 1, 2000
      One-day Course: Web Application DesignCambridge, MAJanuary 11, 1999January 11, 1999
      One-day Course: Web Application DesignCambridge, MAJune 25, 1999June 25, 1999
      One-evening Web CourseMelbourne, AustraliaJuly 24, 2000July 24, 2000
      One-evening Web CourseSydney, AustraliaJuly 21, 2000July 21, 2000
      Oracle iDevelop ConferenceTaipei, TaiwanAugust 9, 2000August 9, 2000
      Oracle iDevelop ConferenceTel Aviv, IsraelJune 12, 2000June 12, 2000
      Oracle iDevelop ConferenceTel Aviv, IsraelJune 13, 1999June 13, 1999
      Oracle iDevelop ConferenceToronto, CanadaJune 26, 2000June 26, 2000
      Test ActivityCambridge, MAAugust 24, 1999August 24, 1999
      Two-day Boot Camp (long weekend)Washington, DCJuly 15, 2000July 16, 2000
      Two-day Boot Camp (long weekend)Washington, DCAugust 26, 2000August 27, 2000
      + + +

      +Do you want to spam: +

      +Confirmed Registrants
      +Pending Registrants
      +Wait-Listed Registrants
      +All Registrants
      + +

      +
      + + + +
      + +
      webmaster@arsdigita.com
      + + \ No newline at end of file Index: openacs-4/contrib/packages/events/www/doc/asj/spam.html =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/events/www/doc/asj/spam.html,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/events/www/doc/asj/spam.html 9 Mar 2003 12:09:03 -0000 1.1 @@ -0,0 +1,62 @@ + + + + +Spam + + + +

      Spam

      + +Your Workspace : Events Administration : Spam +
      + +

      + +

      + +From: +

      +To: You are e-mailing 11 people. + + + View whom you're spamming + +

      Send Date:   +
      Send Time:  + +

      +Subject: +

      +Message: +

      + +

      +

      +
      +

      + + + + +


      + +
      bryanche@arsdigita.com
      + + Index: openacs-4/contrib/packages/events/www/doc/asj/venues-admin.html =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/events/www/doc/asj/venues-admin.html,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/events/www/doc/asj/venues-admin.html 9 Mar 2003 12:09:03 -0000 1.1 @@ -0,0 +1,199 @@ + + +Update a Venue + + + +

      Update a Venue

      Your +Workspace : Events +Administration : Venues : Venue +
      + +
      + + + + + + + + + + + + + + + +
      Venue Name: + +
      Address 1: + +
      Address 2: + +
      City: + +
      State: + +
      Zip Code: + +
      Country: + +
      Phone Number: + +
      Fax Number: + +
      E-mail: + +
      Maximum Capacity: + +
      Needs Reservation? + +
      Description
      (Include directions) +
      +
      +

      +

      +
      + +
      webmaster@arsdigita.com