Index: openacs-4/packages/simulation/lib/simulations-available.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/simulation/lib/simulations-available.tcl,v diff -u -r1.1 -r1.2 --- openacs-4/packages/simulation/lib/simulations-available.tcl 14 Nov 2003 14:31:41 -0000 1.1 +++ openacs-4/packages/simulation/lib/simulations-available.tcl 8 Jan 2004 14:24:44 -0000 1.2 @@ -12,30 +12,59 @@ set package_id [ad_conn package_id] + # TODO: if invited instead of open, say "accept invitation to enroll" + set elements { pretty_name { label "Simulation" orderby upper(w.pretty_name) } + description { + label "Description" + display_template { + @avail_sims.description;noquote@ + } + } + enroll { + label "Enroll" + display_template { + Self-enroll + } + } + } template::list::create \ -name avail_sims \ -multirow avail_sims \ - -no_data "No simulations available to join." \ + -no_data "No simulations available to self-enroll." \ -elements $elements -db_multirow avail_sims select_avail_sims " - select w.pretty_name +# TODO: verify that the first half of this query returns the sims to which the user is invited (data model may have changed since this was coded) +# TODO: exclude simulations for which the user is currently enrolled + +db_multirow -extend {enroll_url} avail_sims select_avail_sims " + select w.workflow_id, + w.pretty_name, + w.description, + w.description_mime_type from workflows w, sim_party_sim_map spsm where w.workflow_id = spsm.simulation_id and spsm.simulation_id = :party_id UNION - select w.pretty_name + select w.workflow_id, + w.pretty_name, + w.description, + w.description_mime_type from workflows w, sim_simulations ss - where ss.enroll_start <= now() + where ss.simulation_id = w.workflow_id + and ss.enroll_start <= now() and ss.enroll_end >= now() and ss.enroll_type = 'open' -" \ No newline at end of file +" { + set enroll_url [export_vars -base "[apm_package_url_from_id $package_id]simplay/enroll" {workflow_id} ] + set description [ad_html_text_convert -from $description_mime_type -maxlen 200 -- $description] + +} \ No newline at end of file