-
YELLOW PAGES
+
-
Index: openacs-4/contrib/packages/simulation/www/object-edit.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/simulation/www/Attic/object-edit.tcl,v
diff -u -r1.18 -r1.19
--- openacs-4/contrib/packages/simulation/www/object-edit.tcl 10 Nov 2003 12:09:21 -0000 1.18
+++ openacs-4/contrib/packages/simulation/www/object-edit.tcl 12 Nov 2003 14:51:16 -0000 1.19
@@ -9,7 +9,6 @@
{content_type {sim_prop}}
}
-# TODO: Joel will do something about this?
auth::require_login
if { ![ad_form_new_p -key item_id] } {
@@ -90,8 +89,11 @@
relations {
image {
label "Image"
- section "Related Objects"
+ section "Related Images"
}
+ associated {
+ label "Associated with"
+ }
stylesheet {
label "Stylesheet"
}
@@ -119,6 +121,9 @@
sim_prop {
content_method richtext
relations {
+ associated {
+ label "Associated with"
+ }
stylesheet {
label "Stylesheet"
}
Index: openacs-4/contrib/packages/simulation/www/role-edit.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/simulation/www/Attic/role-edit.tcl,v
diff -u -r1.4 -r1.5
--- openacs-4/contrib/packages/simulation/www/role-edit.tcl 6 Nov 2003 15:35:47 -0000 1.4
+++ openacs-4/contrib/packages/simulation/www/role-edit.tcl 12 Nov 2003 14:51:16 -0000 1.5
@@ -6,7 +6,6 @@
} {
workflow_id:optional
role_id:optional
- {limit_characters_p "0"}
} -validate {
workflow_id_or_role_id {
if { ![exists_and_not_null workflow_id] &&
@@ -31,41 +30,14 @@
# deliberately not checking to see if character is already cast in sim
# because no reason not to have same character in multiple roles (?)
-# if we are limiting to only characters already in the sim,
-# create the sql filter and generate a link to end the filter
-# if not, create the opposite filter and link
-
-if { $limit_characters_p } {
- set char_options [db_list_of_lists character_option_list {
+set char_options [db_list_of_lists character_option_list {
select ci.name,
ci.item_id
- from cr_items ci,
- sim_workflow_object_map swom
- where ci.content_type = 'sim_character'
- and ci.item_id = swom.object_id
- and swom.workflow_id = :workflow_id
- order by upper(ci.name)
- }]
- set toggle_text "show all"
-} else {
- set char_options [db_list_of_lists character_option_list {
- select ci.name,
- ci.item_id
from cr_items ci
where ci.content_type = 'sim_character'
order by upper(ci.name)
}]
- set toggle_text "(
limit to characters
in template)"
-}
-
-set character_filter_html "
$toggle_text"
-
-
######################################################################
#
# role
@@ -84,7 +56,7 @@
{role_id:key}
{workflow_id:integer(hidden),optional}
{character_id:text(select)
- {label "Character
$character_filter_html"}
+ {label "Character"}
{options $char_options}
}
{name:text
Index: openacs-4/packages/simulation/lib/sim-template-roles.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/simulation/lib/sim-template-roles.adp,v
diff -u -r1.2 -r1.3
--- openacs-4/packages/simulation/lib/sim-template-roles.adp 12 Nov 2003 13:14:07 -0000 1.2
+++ openacs-4/packages/simulation/lib/sim-template-roles.adp 12 Nov 2003 14:51:16 -0000 1.3
@@ -2,6 +2,3 @@
-
- » Add a role
-
Index: openacs-4/packages/simulation/lib/sim-template-roles.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/simulation/lib/sim-template-roles.tcl,v
diff -u -r1.2 -r1.3
--- openacs-4/packages/simulation/lib/sim-template-roles.tcl 12 Nov 2003 13:14:07 -0000 1.2
+++ openacs-4/packages/simulation/lib/sim-template-roles.tcl 12 Nov 2003 14:51:16 -0000 1.3
@@ -6,6 +6,14 @@
@cvs-id $Id$
} {
workflow_id {}
+ display_mode {
+ allowed_values {edit display}
+ default_value display
+ }
+ size {
+ allowed_values {short long}
+ default_value long
+ }
}
set package_id [ad_conn package_id]
@@ -14,10 +22,17 @@
# roles list
#-------------------------------------------------------------
+if { $display_mode == "edit"} {
+ set actions [list "Add a Role" [export_vars -base role-edit {workflow_id} ]]
+} else {
+ set actions ""
+}
+
template::list::create \
-name roles \
-multirow roles \
-no_data "No roles in this Simulation Template" \
+ -actions $actions \
-elements {
edit {
sub_class narrow
Index: openacs-4/packages/simulation/lib/sim-template-tasks.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/simulation/lib/sim-template-tasks.adp,v
diff -u -r1.2 -r1.3
--- openacs-4/packages/simulation/lib/sim-template-tasks.adp 12 Nov 2003 13:14:07 -0000 1.2
+++ openacs-4/packages/simulation/lib/sim-template-tasks.adp 12 Nov 2003 14:51:16 -0000 1.3
@@ -1,7 +1,2 @@
-
-
- » Add a task
-
-
Index: openacs-4/packages/simulation/lib/sim-template-tasks.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/simulation/lib/sim-template-tasks.tcl,v
diff -u -r1.3 -r1.4
--- openacs-4/packages/simulation/lib/sim-template-tasks.tcl 12 Nov 2003 13:14:07 -0000 1.3
+++ openacs-4/packages/simulation/lib/sim-template-tasks.tcl 12 Nov 2003 14:51:16 -0000 1.4
@@ -36,12 +36,17 @@
# TODO: missing: discription, type
# how is type going to work? open question pending prototyping
+if { $display_mode == "edit"} {
+ set actions [list "Add a Task" [export_vars -base task-edit {workflow_id} ]]
+} else {
+ set actions ""
+}
-
template::list::create \
-name tasks \
-multirow tasks \
-no_data "No tasks in this Simulation Template" \
+ -actions $actions \
-elements {
edit {
hide_p {[ad_decode $display_mode edit 0 1]}
Index: openacs-4/packages/simulation/lib/sim-templates.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/simulation/lib/sim-templates.tcl,v
diff -u -r1.2 -r1.3
--- openacs-4/packages/simulation/lib/sim-templates.tcl 12 Nov 2003 13:24:09 -0000 1.2
+++ openacs-4/packages/simulation/lib/sim-templates.tcl 12 Nov 2003 14:51:16 -0000 1.3
@@ -100,7 +100,9 @@
select w.workflow_id,
w.pretty_name as name,
'placeholder' as description,
- a.creation_user as created_by,
+ (select p.first_names || ' ' || p.last_name
+ from persons p
+ where p.person_id = a.creation_user) as created_by,
(select count(object_id)
from sim_workflow_object_map
where workflow_id = w.workflow_id) as object_count,
Index: openacs-4/packages/simulation/sql/postgresql/simulation-content-types-create.sql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/simulation/sql/postgresql/simulation-content-types-create.sql,v
diff -u -r1.10 -r1.11
--- openacs-4/packages/simulation/sql/postgresql/simulation-content-types-create.sql 12 Nov 2003 12:47:54 -0000 1.10
+++ openacs-4/packages/simulation/sql/postgresql/simulation-content-types-create.sql 12 Nov 2003 14:51:16 -0000 1.11
@@ -158,7 +158,7 @@
'sim_character', -- content_type
'sim_location', -- target_type
'associated', -- relation_tag
- 0, -- min_n
+ 1, -- min_n
1 -- max_n
);
Index: openacs-4/packages/simulation/test/run
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/simulation/test/Attic/run,v
diff -u -r1.1 -r1.2
--- openacs-4/packages/simulation/test/run 11 Nov 2003 15:17:34 -0000 1.1
+++ openacs-4/packages/simulation/test/run 12 Nov 2003 14:51:16 -0000 1.2
@@ -1,3 +1,3 @@
#/bin/sh
-/usr/local/tclwebtest/tclwebtest -config_file /web/install-dev/install.tcl demo-data-setup.test
+/usr/local/tclwebtest/tclwebtest demo-data-setup.test
Index: openacs-4/packages/simulation/www/directory.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/simulation/www/Attic/directory.adp,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/simulation/www/directory.adp 12 Nov 2003 14:51:31 -0000 1.1
@@ -0,0 +1,6 @@
+
+ @page_title;noquote@
+ @context;noquote@
+
+
+
Index: openacs-4/packages/simulation/www/directory.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/simulation/www/Attic/directory.tcl,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/simulation/www/directory.tcl 12 Nov 2003 14:51:31 -0000 1.1
@@ -0,0 +1,94 @@
+ad_page_contract {
+
+ @creation-date 2003-10-13
+ @cvs-id $Id: directory.tcl,v 1.1 2003/11/12 14:51:31 joela Exp $
+} {
+ parent_id:optional
+ {orderby "title,asc"}
+ {type:optional}
+}
+
+set page_title "Sim Objects"
+set context [list $page_title]
+set package_id [ad_conn package_id]
+set admin_p [permission::permission_p -object_id $package_id -privilege admin]
+
+if { ![exists_and_not_null parent_id] } {
+ set parent_id [bcms::folder::get_id_by_package_id -parent_id 0]
+}
+
+template::list::create \
+ -name objects \
+ -multirow objects \
+ -elements {
+ edit {
+ sub_class narrow
+ link_url_col edit_url
+ display_template {
+
+ }
+ }
+ object_type_pretty {
+ label "Type"
+ orderby upper(ot.pretty_name)
+ }
+ title {
+ label "Name"
+ orderby r.title
+ link_url_col view_url
+ }
+ description {
+ label "Description"
+ orderby r.description
+ }
+ delete {
+ sub_class narrow
+ link_url_col delete_url
+ display_template {
+
+ }
+ }
+ }
+
+
+set package_id [ad_conn package_id]
+
+db_multirow -extend { edit_url view_url delete_url } objects select_objects "
+ select i.item_id,
+ i.name,
+ r.title,
+ r.description,
+ r.mime_type,
+ i.content_type,
+ ot.pretty_name as object_type_pretty
+ from cr_folders f,
+ cr_items i,
+ cr_revisions r,
+ acs_object_types ot
+ 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
+ [template::list::orderby_clause -orderby -name "objects"]
+" {
+ set description [string_truncate -len 200 $description]
+ set edit_url [export_vars -base "object-edit" { item_id }]
+ set delete_url [export_vars -base "object-delete" { item_id }]
+
+ switch -glob $mime_type {
+ text/* - {} {
+ set view_url [export_vars -base "object/$name"]
+ }
+ default {
+ set view_url [export_vars -base "object-content/$name"]
+ }
+ }
+}
+
+set create_object_url [export_vars -base object-edit { parent_id }]
+
+set notification_widget [notification::display::request_widget \
+ -type [simulation::notification::xml_map::type_short_name] \
+ -object_id [ad_conn package_id] \
+ -pretty_name [simulation::notification::xml_map::type_pretty_name] \
+ -url "[ad_conn url]?[ad_conn query]"]
Index: openacs-4/packages/simulation/www/index.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/simulation/www/index.adp,v
diff -u -r1.14 -r1.15
--- openacs-4/packages/simulation/www/index.adp 12 Nov 2003 13:14:07 -0000 1.14
+++ openacs-4/packages/simulation/www/index.adp 12 Nov 2003 14:51:16 -0000 1.15
@@ -23,8 +23,8 @@
-
-
YELLOW PAGES
+
-
Index: openacs-4/packages/simulation/www/object-edit.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/simulation/www/Attic/object-edit.tcl,v
diff -u -r1.18 -r1.19
--- openacs-4/packages/simulation/www/object-edit.tcl 10 Nov 2003 12:09:21 -0000 1.18
+++ openacs-4/packages/simulation/www/object-edit.tcl 12 Nov 2003 14:51:16 -0000 1.19
@@ -9,7 +9,6 @@
{content_type {sim_prop}}
}
-# TODO: Joel will do something about this?
auth::require_login
if { ![ad_form_new_p -key item_id] } {
@@ -90,8 +89,11 @@
relations {
image {
label "Image"
- section "Related Objects"
+ section "Related Images"
}
+ associated {
+ label "Associated with"
+ }
stylesheet {
label "Stylesheet"
}
@@ -119,6 +121,9 @@
sim_prop {
content_method richtext
relations {
+ associated {
+ label "Associated with"
+ }
stylesheet {
label "Stylesheet"
}
Index: openacs-4/packages/simulation/www/role-edit.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/simulation/www/Attic/role-edit.tcl,v
diff -u -r1.4 -r1.5
--- openacs-4/packages/simulation/www/role-edit.tcl 6 Nov 2003 15:35:47 -0000 1.4
+++ openacs-4/packages/simulation/www/role-edit.tcl 12 Nov 2003 14:51:16 -0000 1.5
@@ -6,7 +6,6 @@
} {
workflow_id:optional
role_id:optional
- {limit_characters_p "0"}
} -validate {
workflow_id_or_role_id {
if { ![exists_and_not_null workflow_id] &&
@@ -31,41 +30,14 @@
# deliberately not checking to see if character is already cast in sim
# because no reason not to have same character in multiple roles (?)
-# if we are limiting to only characters already in the sim,
-# create the sql filter and generate a link to end the filter
-# if not, create the opposite filter and link
-
-if { $limit_characters_p } {
- set char_options [db_list_of_lists character_option_list {
+set char_options [db_list_of_lists character_option_list {
select ci.name,
ci.item_id
- from cr_items ci,
- sim_workflow_object_map swom
- where ci.content_type = 'sim_character'
- and ci.item_id = swom.object_id
- and swom.workflow_id = :workflow_id
- order by upper(ci.name)
- }]
- set toggle_text "show all"
-} else {
- set char_options [db_list_of_lists character_option_list {
- select ci.name,
- ci.item_id
from cr_items ci
where ci.content_type = 'sim_character'
order by upper(ci.name)
}]
- set toggle_text "(
limit to characters
in template)"
-}
-
-set character_filter_html "
$toggle_text"
-
-
######################################################################
#
# role
@@ -84,7 +56,7 @@
{role_id:key}
{workflow_id:integer(hidden),optional}
{character_id:text(select)
- {label "Character
$character_filter_html"}
+ {label "Character"}
{options $char_options}
}
{name:text