Index: openacs-4/contrib/packages/simulation/www/sim-template-objects.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/simulation/www/Attic/sim-template-objects.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/simulation/www/sim-template-objects.adp 27 Oct 2003 07:42:48 -0000 1.1 @@ -0,0 +1,3 @@ +

+

Add Sim +Objects to this Workflow Index: openacs-4/contrib/packages/simulation/www/sim-template-objects.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/simulation/www/Attic/sim-template-objects.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/simulation/www/sim-template-objects.tcl 27 Oct 2003 07:42:48 -0000 1.1 @@ -0,0 +1,83 @@ +# an includelet + +############################################################## +# +# sim_objects +# +# A list of all objects associated with the Simulation Template +# +############################################################## + +# maybe replace this chunk of copied text with an includable template +# which passes in a filter for the workflow_id? + + +#------------------------------------------------------------- +# sim_objects list +#------------------------------------------------------------- + +template::list::create \ + -name sim_objects \ + -multirow sim_objects \ + -no_data "No Sim Objects are associated with this Simulation Template" \ + -elements { + edit { + sub_class narrow + link_url_col edit_url + display_template { + Edit + } + } + object_type_pretty { + label "Type" + orderby upper(ot.pretty_name) + } + title { + label "Title" + orderby r.title + link_url_col view_url + } + description { + label "Description" + orderby r.description + } + } + +db_multirow -extend { edit_url view_url delete_url } sim_objects select_sim_objects " + select i.item_id, + i.name, + r.title, + r.description, + i.content_type, + ot.pretty_name as object_type_pretty + from cr_folders f, + cr_items i, + cr_revisions r, + acs_object_types ot, + sim_workflow_object_map swom + where f.package_id = :package_id + and i.parent_id = f.folder_id + and r.revision_id = i.live_revision + and ot.object_type = i.content_type + and swom.workflow_id = :workflow_id + and swom.object_id = i.item_id + + [template::list::orderby_clause -orderby -name "sim_objects"] +" { + set description [string_truncate -len 200 $description] + set edit_url [export_vars -base "object-edit" { item_id }] + set view_url [export_vars -base "object/$name"] + set delete_url [export_vars -base "object-delete" { item_id }] +} + +set sim_types { sim_character sim_prop sim_home } + +db_multirow -extend { create_url label } object_types select_object_types " + select ot.object_type as content_type, + ot.pretty_name + from acs_object_types ot + where ot.object_type in ('[join $sim_types "','"]') +" { + set create_url [export_vars -base object-edit { content_type parent_id }] + set label "Create new $pretty_name" +} Index: openacs-4/contrib/packages/simulation/www/sim-template-roles.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/simulation/www/Attic/sim-template-roles.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/simulation/www/sim-template-roles.adp 27 Oct 2003 07:42:48 -0000 1.1 @@ -0,0 +1,2 @@ +

+

Add a role Index: openacs-4/contrib/packages/simulation/www/sim-template-roles.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/simulation/www/Attic/sim-template-roles.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/simulation/www/sim-template-roles.tcl 27 Oct 2003 07:42:48 -0000 1.1 @@ -0,0 +1,67 @@ +# an includelet + +############################################################## +# +# roles +# +# A list of all roles associated with the Simulation Template +# +############################################################## + +# maybe replace this chunk of copied text with an includable template +# which passes in a filter for the workflow_id? + + +#------------------------------------------------------------- +# roles list +#------------------------------------------------------------- + +template::list::create \ + -name roles \ + -multirow roles \ + -no_data "No roles in this Simulation Template" \ + -elements { + edit { + sub_class narrow + link_url_col edit_url + display_template { + Edit + } + } + name { + label "Name" + } + character { + label "Character" + link_url_col char_url + } + delete { + sub_class narrow + link_url_col delete_url + display_template { + Edit + } + } + } + +# TODO: fix this so it returns rows when it should +db_multirow -extend { edit_url char_url delete_url } roles select_roles " + select wr.role_id, + wr.pretty_name as name, + wr.sort_order, + cr.title as character, + i.name as char_name + from workflow_roles wr, + sim_roles sr, + cr_revisions cr, + cr_items i + where wr.workflow_id = :workflow_id + and sr.role_id = wr.role_id + and cr.item_id = sr.character_id + and i.item_id = sr.character_id + [template::list::orderby_clause -orderby -name "roles"] +" { + set edit_url [export_vars -base "role-edit" { role_id }] + set char_url [export_vars -base "object/$char_name"] + set delete_url [export_vars -base "role-delete" { role_id }] +} Index: openacs-4/packages/simulation/www/sim-template-objects.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/simulation/www/Attic/sim-template-objects.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/simulation/www/sim-template-objects.adp 27 Oct 2003 07:42:48 -0000 1.1 @@ -0,0 +1,3 @@ +

+

Add Sim +Objects to this Workflow Index: openacs-4/packages/simulation/www/sim-template-objects.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/simulation/www/Attic/sim-template-objects.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/simulation/www/sim-template-objects.tcl 27 Oct 2003 07:42:48 -0000 1.1 @@ -0,0 +1,83 @@ +# an includelet + +############################################################## +# +# sim_objects +# +# A list of all objects associated with the Simulation Template +# +############################################################## + +# maybe replace this chunk of copied text with an includable template +# which passes in a filter for the workflow_id? + + +#------------------------------------------------------------- +# sim_objects list +#------------------------------------------------------------- + +template::list::create \ + -name sim_objects \ + -multirow sim_objects \ + -no_data "No Sim Objects are associated with this Simulation Template" \ + -elements { + edit { + sub_class narrow + link_url_col edit_url + display_template { + Edit + } + } + object_type_pretty { + label "Type" + orderby upper(ot.pretty_name) + } + title { + label "Title" + orderby r.title + link_url_col view_url + } + description { + label "Description" + orderby r.description + } + } + +db_multirow -extend { edit_url view_url delete_url } sim_objects select_sim_objects " + select i.item_id, + i.name, + r.title, + r.description, + i.content_type, + ot.pretty_name as object_type_pretty + from cr_folders f, + cr_items i, + cr_revisions r, + acs_object_types ot, + sim_workflow_object_map swom + where f.package_id = :package_id + and i.parent_id = f.folder_id + and r.revision_id = i.live_revision + and ot.object_type = i.content_type + and swom.workflow_id = :workflow_id + and swom.object_id = i.item_id + + [template::list::orderby_clause -orderby -name "sim_objects"] +" { + set description [string_truncate -len 200 $description] + set edit_url [export_vars -base "object-edit" { item_id }] + set view_url [export_vars -base "object/$name"] + set delete_url [export_vars -base "object-delete" { item_id }] +} + +set sim_types { sim_character sim_prop sim_home } + +db_multirow -extend { create_url label } object_types select_object_types " + select ot.object_type as content_type, + ot.pretty_name + from acs_object_types ot + where ot.object_type in ('[join $sim_types "','"]') +" { + set create_url [export_vars -base object-edit { content_type parent_id }] + set label "Create new $pretty_name" +} Index: openacs-4/packages/simulation/www/sim-template-roles.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/simulation/www/Attic/sim-template-roles.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/simulation/www/sim-template-roles.adp 27 Oct 2003 07:42:48 -0000 1.1 @@ -0,0 +1,2 @@ +

+

Add a role Index: openacs-4/packages/simulation/www/sim-template-roles.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/simulation/www/Attic/sim-template-roles.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/simulation/www/sim-template-roles.tcl 27 Oct 2003 07:42:48 -0000 1.1 @@ -0,0 +1,67 @@ +# an includelet + +############################################################## +# +# roles +# +# A list of all roles associated with the Simulation Template +# +############################################################## + +# maybe replace this chunk of copied text with an includable template +# which passes in a filter for the workflow_id? + + +#------------------------------------------------------------- +# roles list +#------------------------------------------------------------- + +template::list::create \ + -name roles \ + -multirow roles \ + -no_data "No roles in this Simulation Template" \ + -elements { + edit { + sub_class narrow + link_url_col edit_url + display_template { + Edit + } + } + name { + label "Name" + } + character { + label "Character" + link_url_col char_url + } + delete { + sub_class narrow + link_url_col delete_url + display_template { + Edit + } + } + } + +# TODO: fix this so it returns rows when it should +db_multirow -extend { edit_url char_url delete_url } roles select_roles " + select wr.role_id, + wr.pretty_name as name, + wr.sort_order, + cr.title as character, + i.name as char_name + from workflow_roles wr, + sim_roles sr, + cr_revisions cr, + cr_items i + where wr.workflow_id = :workflow_id + and sr.role_id = wr.role_id + and cr.item_id = sr.character_id + and i.item_id = sr.character_id + [template::list::orderby_clause -orderby -name "roles"] +" { + set edit_url [export_vars -base "role-edit" { role_id }] + set char_url [export_vars -base "object/$char_name"] + set delete_url [export_vars -base "role-delete" { role_id }] +}