Index: openacs-4/packages/simulation/simulation.info
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/simulation/simulation.info,v
diff -u -r1.15 -r1.16
--- openacs-4/packages/simulation/simulation.info 20 Apr 2004 21:12:21 -0000 1.15
+++ openacs-4/packages/simulation/simulation.info 30 Nov 2004 21:09:00 -0000 1.16
@@ -19,18 +19,29 @@
2004-01-30
+
-
+
+
-
-
+
+
+
+
+
+
+
+
+
+
+
Index: openacs-4/packages/simulation/catalog/simulation.en_US.ISO-8859-1.xml
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/simulation/catalog/simulation.en_US.ISO-8859-1.xml,v
diff -u -r1.3 -r1.4
--- openacs-4/packages/simulation/catalog/simulation.en_US.ISO-8859-1.xml 29 Jun 2004 10:17:34 -0000 1.3
+++ openacs-4/packages/simulation/catalog/simulation.en_US.ISO-8859-1.xml 30 Nov 2004 21:09:00 -0000 1.4
@@ -1,7 +1,10 @@
- add new characters
+ Abort the session
+ Add a template
+ Add an Object
+ Add an object
Administration
All
All Messages
@@ -15,10 +18,20 @@
Case History
Case home
CityBuild
+ CityBuild Help
+ Clear filter
+ Clone this template
+ Colophon
+ Contact Info
Contacts
You are <a href="%role.character_url%">%role.character_title%</a>
(%role.role_pretty%)
+ Copy
+ Count
Create props
+ Created by
+ Current State
+ Delete
Delete this case
Delete this template
Description
@@ -27,20 +40,25 @@
Document Portfolio
Documents
Edit
+ Edit this template
Dear %user_name%,
This is to notify you that you have been enrolled in simulation %sim_template.pretty_name%. You may visit the
casting page at %casting_page_url% to choose case or role.
You have been enrolled in simulation %sim_template.pretty_name%
+ File size
From
+ Home
<strong>Note:</strong> Ignoring %ignored_actions_count% tasks that don't have the task
name "%action.pretty_name%". Please back up your browser if you
want to change the selection of tasks.
+ Import a template
Dear %user_name%,
You have been invited to join simulation %sim_template.pretty_name%. Please visit the enrollment page at %enrollment_page_url% to accept the invitation. Thank you!
You have been invited to join simulation %sim_template.pretty_name%
<b>Invitations</b> are sent,
when this wizard is completed and
casting begins.
+ Join
Join a Simulation
join case
join role
@@ -58,10 +76,9 @@
all messages you receive
All tasks in the simulation
all tasks you're assigned to
- and refresh
- this page.
Are you sure you want to delete this object?
Are you sure you want to delete this case?
+ Are you sure you want to delete template
Attachments in received message:
Back to template %sim_template_array.pretty_name%
Be the first user in a new case
@@ -84,10 +101,12 @@
Case "%case.label%" has been deleted.
Choose new roles for user %user.name%
Choose new users for role %role.pretty_name%
+ Create new simulation templates or edit existing ones.
Delete case "%case.label%"
Delete %name% and tasks
Did not generate an XML file.
Document %document% uploaded
+ Duration in hours, decimals are allowed; example: 0.25 = 15 minutes.
Each role may be played by one or by
many users. Each role can only be played by users in the groups
specified below. If a group is not selected for any role, users
@@ -99,28 +118,40 @@
Full History for %case.label%
Generate Map XML file and send notifications
Generated map XML file and sent any notifications.
+ has dependent tasks (some task is either enabled in this state or this state is defined as the next state of some task). If you delete this state, all the dependent tasks will also be deleted.
If you are using the respond button to respond to multiple tasks
then all checked tasks must share the same task name.
+ if you think you're uploading a proper file.
in CityBuild before you can finish setting up these tasks.
+ In CityBuild you can create new Sieberdam objects.
Join a Case in Simulation "%workflow.pretty_name%"
Join a Case in Simulation "%simulation.pretty_name%"
+ Join a simulation or continue a simulation session.
Make a copy of the selected template, including all tasks and
roles, but not any objects.
Mark this template ready for use
Messages for %role_array.pretty_name%
- %name% has dependent tasks. Do you want to delete this role
-and all related tasks?
+ %name% has dependent tasks (either as an assignee or as a recipient of a message). Do you want to delete this role and all related tasks?
+ New Simulation From Template
+ No attachments.
No empty slots in role "%role.pretty_name%"
+ No simulations available to join.
Not allowed to cast in role "%role.pretty_name%"
Not enrolled in simulation "%simulation.pretty_name%"
Notify me of changes to map XML
Placeholder for flash map
+ Please contact
+ the system administrator
Portfolio for %role_array.pretty_name% in %case_array.label%
Portfolio for %role_array.pretty_name%
+ Restrict to items matching word or phrase
Restrict to previous task matching word or phrase
+ Return to Simulation root
Return to template list page
+ Right-click document name and select "Save as" (or equiv.) to download a document to your computer.
Roles with actions only
- Select from existing characters in the Yellow Pages, or
+ "search_terms" must be a string containing three or more characters
+ Select a character to play each role in simulation.
Select which case and role to join, or create a new case for
yourself. If you do not select a case and role to join, you will
be automatically assigned to a case and role when the simulation
@@ -129,6 +160,8 @@
yourself. If you do not select a case to join, you will
be automatically assigned to a case when the simulation
begins.
+ Sieberdam/ROCS Availability
+ SimInst is used to start new simulations.
Simulation Case List
Simulation "%simulation.pretty_name%" is in state
%simulation.sim_type% and you cannot enroll in it now. Contact your
@@ -138,13 +171,15 @@
Some of the tasks of this simulation require attachments. However, there are no CityBuild props to select from.
Start a simulation with this template
Stop notifying me of changes to map XML
+ Subscribe to %pretty_name%
Take action on selected tasks
Templates must be marked ready for use by template authors in order to appear on this list.
The enrollment period for simulation
"%simulation.pretty_name%" is between %simulation.enroll_start%
and %simulation.enroll_end% and you cannot enroll at this time.
Contact your administrator if you believe this is an error. Thank you!
The following errors were encountered:
+ The mime type of your file was not recognised.
The template "%simulation.pretty_name%" is not ready for casting.
There are no cases in this simulation yet
There are no documents.
@@ -160,6 +195,7 @@
Users playing role %role.pretty_name% in case %case.label%
Warning: this simulation is already in casting. Clicking the finish button may have unwanted consequences such as sending notifications twice to users.
We couldn't find any roles that you could join in case "%case.label%" of simulation "%simulation.pretty_name%". You would need to join a new case. Select your administrator about this. Thank you!
+ Yellow Pages is the directory of Sieberdam locations and cahacters.
Yes, delete the object
You administer these cases
You are already cast in the following roles:
@@ -174,11 +210,13 @@
You have been enrolled in simulation
"%simulation.pretty_name%"
You have deleted template "%template_name%".
+ You have no Simulations in Development or Casting
You must supply both case_id and role_id
You will be automatically cast in "%simulation.pretty_name%"
Your Current Simulations
Your Tasks in Simulation %simulation.pretty_name%
Manage groups
+ Map help
Map XML
Max # users
Message
@@ -199,19 +237,24 @@
Thank you.
Messages
messages
+ mime type
Move user
My Notifications
+ Name
New Users
+ No attachments.
No available roles
No, cancel
No documents
No messages.
Notifications
Notifications for
+ Number
Number of tasks
Parent Task
Portfolio
Re:
+ Ready
Received
Recent Messages
Related Tasks
@@ -223,17 +266,31 @@
Simulation %simulation_name% starts on %simulation_start_date%
Remove user
Respond
+ Return to SimPlay
Role
Roles
+ Send a message to
Send new message
+ Session
+ Session
+ Session Home
+ Sieberdam History
+ Sieberdam Map
+ Sieberdam/ROCS Info
SimBuild
+ SimBuild Help
SimInst
+ SimInst Help
SimPlay
+ SimPlay Help
+ Simplay Help
Simulation
+ Simulation Home
%simulation_name%
Dear %user_name%,
Simulation %simulation.pretty_name% has now started. Please visit %simplay_url% to participate. Thank you!
Simulation %simulation.pretty_name% has started
+ Simulation Templates
States
Status
Sub-States
@@ -247,6 +304,7 @@
tasks
Template
Template Description
+ Template Name
Thank you!
Time
Timeout
@@ -257,14 +315,17 @@
<font color="red"><em>NOTE</em></font>: To attach a document to your message you need to <a
href="%document_upload_url%">upload a document</a> to your
portfolio before writing the message.
+ Type
Unknown type
Unsubscribe
Upload a document
+ Upload date
User
# Users
View Map XML
Yellow Pages
Yes, delete the case
+ You are
Your Options
Your Tasks
Index: openacs-4/packages/simulation/catalog/simulation.nl_NL.ISO-8859-1.xml
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/simulation/catalog/simulation.nl_NL.ISO-8859-1.xml,v
diff -u -r1.2 -r1.3
--- openacs-4/packages/simulation/catalog/simulation.nl_NL.ISO-8859-1.xml 20 Apr 2004 21:12:22 -0000 1.2
+++ openacs-4/packages/simulation/catalog/simulation.nl_NL.ISO-8859-1.xml 30 Nov 2004 21:09:00 -0000 1.3
@@ -1,5 +1,5 @@
-
+
Annuleren
Verwijder dit sjabloon
Index: openacs-4/packages/simulation/lib/cases-admin.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/simulation/lib/cases-admin.tcl,v
diff -u -r1.6 -r1.7
--- openacs-4/packages/simulation/lib/cases-admin.tcl 20 Apr 2004 21:12:22 -0000 1.6
+++ openacs-4/packages/simulation/lib/cases-admin.tcl 30 Nov 2004 21:09:00 -0000 1.7
@@ -8,33 +8,54 @@
party_id {
default_value ""
}
+ case_admin_order {
+ required_p 0
+ }
}
+
set package_id [ad_conn package_id]
set user_id [auth::get_user_id]
set elements {
label {
label {[_ simulation.Case]}
- orderby upper(w.pretty_name)
+ orderby label
link_url_eval {[export_vars -base [ad_conn package_url]simplay/case-admin { case_id }]}
}
pretty_name {
label {[_ simulation.Simulation]}
orderby upper(w.pretty_name)
}
+ status {
+ label {[_ simulation.Status]}
+ orderby status
+ }
+ num_roles {
+ label {[_ simulation.Roles]}
+ orderby num_roles
+ }
}
template::list::create \
-name cases \
-multirow cases \
-no_data [_ simulation.lt_You_are_not_administe] \
+ -orderby_name case_admin_order \
-elements $elements
db_multirow cases select_cases "
select wc.case_id,
sc.label,
- w.pretty_name
+ w.pretty_name,
+ case when (select count(*)
+ from workflow_case_enabled_actions wcea
+ where wcea.case_id = wc.case_id) = 0 then 'Completed'
+ else 'Active'
+ end as status,
+ (select count(*)
+ from workflow_roles wr
+ where wr.workflow_id = w.workflow_id) as num_roles
from workflow_cases wc,
sim_cases sc,
workflows w,
@@ -43,5 +64,5 @@
and sc.sim_case_id = wc.object_id
and w.workflow_id = ao.object_id
and ao.creation_user = :user_id
- order by w.workflow_id, wc.case_id
+ [template::list::orderby_clause -orderby -name "cases"]
"
Index: openacs-4/packages/simulation/lib/cases.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/simulation/lib/cases.tcl,v
diff -u -r1.17 -r1.18
--- openacs-4/packages/simulation/lib/cases.tcl 20 Apr 2004 21:12:22 -0000 1.17
+++ openacs-4/packages/simulation/lib/cases.tcl 30 Nov 2004 21:09:00 -0000 1.18
@@ -13,13 +13,13 @@
set package_id [ad_conn package_id]
set elements {
+ pretty_name {
+ label {[_ simulation.Simulation]}
+ }
label {
label {[_ simulation.Case]}
link_url_eval {[export_vars -base "[ad_conn package_url]simplay/case" { case_id role_id }]}
}
- pretty_name {
- label {[_ simulation.Simulation]}
- }
role_pretty {
label {[_ simulation.Role]}
}
Index: openacs-4/packages/simulation/lib/messages.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/simulation/lib/messages.tcl,v
diff -u -r1.19 -r1.20
--- openacs-4/packages/simulation/lib/messages.tcl 29 Jun 2004 10:17:34 -0000 1.19
+++ openacs-4/packages/simulation/lib/messages.tcl 30 Nov 2004 21:09:00 -0000 1.20
@@ -75,7 +75,18 @@
lappend extend body
}
-if { [exists_and_not_null case_id] && [exists_and_not_null role_id] } {
+if { [exists_and_not_null case_id] } {
+ set num_enabled_actions [db_string select_num_enabled_actions {
+ select count(*)
+ from workflow_case_enabled_actions
+ where case_id = :case_id
+ }]
+ set complete_p [expr $num_enabled_actions == 0]
+} else {
+ set complete_p 0
+}
+
+if { [string match $complete_p "0"] && [exists_and_not_null role_id] } {
set actions [list [_ simulation.Send_new_message] [export_vars -base message { case_id role_id }] {}]
} else {
set actions [list]
@@ -96,19 +107,23 @@
w.pretty_name as sim_name,
sm.creation_date,
to_char(sm.creation_date, 'YYYY-MM-DD HH24:MI:SS') as creation_date_ansi,
- (select scx.title
+ (select wr.pretty_name || ' (' || scx.title || ')' as from
from sim_roles fr,
sim_charactersx scx,
- cr_items ci
+ cr_items ci,
+ workflow_roles wr
where fr.role_id = sm.from_role_id
+ and fr.role_id = wr.role_id
and scx.item_id = fr.character_id
and ci.item_id = scx.item_id
and ci.live_revision = scx.object_id) as from,
- (select scx.title
+ (select wr.pretty_name || ' (' || scx.title || ')' as to
from sim_roles tr,
sim_charactersx scx,
- cr_items ci
+ cr_items ci,
+ workflow_roles wr
where tr.role_id = sm.to_role_id
+ and tr.role_id = wr.role_id
and scx.item_id = tr.character_id
and ci.item_id = scx.item_id
and ci.live_revision = scx.object_id) as to,
@@ -126,33 +141,6 @@
sim_cases sc
where cr.revision_id = sm.message_id
and wc.case_id = sm.case_id
- [ad_decode $role_id "" "" "and (sm.entry_id is null or not (
- -- The whole expression in the not parenthesis is true if there is an assigned action
- -- responding to the message in which case the message shouldnt show up in the message list
-
- -- message is associated with an action that put us in the current state
- sm.entry_id in (select max(wcl.entry_id)
- from workflow_case_log wcl,
- workflow_fsm_actions wfa,
- workflow_case_fsm wcf,
- sim_messagesx sm2
- where wcl.case_id = sm.case_id
- and wcl.action_id = wfa.action_id
- and wcf.case_id = wcl.case_id
- and wfa.new_state = wcf.current_state
- and sm2.entry_id = wcl.entry_id
- and sm2.to_role_id = :role_id
- )
- and
- -- There is an assigned action with a recipient being sender of the message
- exists (select 1
- from workflow_case_assigned_actions wcaa,
- sim_task_recipients str
- where wcaa.case_id = sm.case_id
- and wcaa.role_id = :role_id
- and str.task_id = wcaa.action_id
- and str.recipient = sm.from_role_id)
- ))"]
[ad_decode $role_id "" "" "and (sm.to_role_id = :role_id or sm.from_role_id = :role_id)"]
and wc.case_id = sm.case_id
and sc.sim_case_id = wc.object_id
@@ -172,4 +160,4 @@
if { $show_body_p } {
set body [ad_html_text_convert -from $mime_type -to "text/plain" $content]
}
-}
+}
\ No newline at end of file
Index: openacs-4/packages/simulation/lib/object-display.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/simulation/lib/object-display.adp,v
diff -u -r1.8 -r1.9
--- openacs-4/packages/simulation/lib/object-display.adp 20 Apr 2004 21:12:22 -0000 1.8
+++ openacs-4/packages/simulation/lib/object-display.adp 30 Nov 2004 21:09:00 -0000 1.9
@@ -1,15 +1,26 @@
-
+
+
+
+
+
+
@page_title;noquote@
@context;noquote@
-
-
-
@content_html;noquote@
-
-
- #simulation.Edit#
-
+
+
+
+ #simulation.Edit#
+
+
+
+
+
+ #simulation.Send_a_message_to# @page_title@
+
+
+
\ No newline at end of file
Index: openacs-4/packages/simulation/lib/object-display.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/simulation/lib/object-display.tcl,v
diff -u -r1.14 -r1.15
--- openacs-4/packages/simulation/lib/object-display.tcl 5 Mar 2004 10:47:45 -0000 1.14
+++ openacs-4/packages/simulation/lib/object-display.tcl 30 Nov 2004 21:09:00 -0000 1.15
@@ -7,19 +7,33 @@
} {
revision_id:optional,naturalnum
{printer_friendly_p:optional 0}
+ case_id:optional
+ role_id:optional
+ recipient_role_id:optional
}
set package_id [ad_conn package_id]
+set package_url [ad_conn package_url]
+
set root_id [bcms::folder::get_id_by_package_id -parent_id 0]
+set base_url [ad_conn urlv]
+
+set simplay 1
+if { [lsearch -exact $base_url "simplay"] == -1 } {
+ set simplay 0
+}
+
# This little exercise removes the object/ part from the extra_url
-set extra_url [eval file join [lrange [file split [ad_conn extra_url]] 1 end]]
+# Let's just use path_info
+# set extra_url [eval file join [lrange [file split [ad_conn extra_url]] 1 end]]
+set extra_url [ad_conn path_info]
if { [empty_string_p $extra_url] } {
set extra_url "index"
}
-# get the item by url if now revision id is given
+# get the item by url if no revision id is given
if { ![info exists revision_id] } {
array set item [bcms::item::get_item_by_url -root_id $root_id -url $extra_url -revision live]
} else {
@@ -79,6 +93,28 @@
set page_title $item(title)
set context [list $page_title]
+set recipient_p 0
+
+# We are in simplay/object, so we need stuff for the control and context bars
+if { $simplay } {
+ # We do have case_id, it's required by simplay/object/index.vuh
+ simulation::case::get -case_id $case_id -array case
+ set section_uri [apm_package_url_from_id $package_id]simplay/
+ set case_url [export_vars -base ${section_uri}case { case_id role_id }]
+
+ if { [exists_and_not_null recipient_role_id] } {
+ set role_name [simulation::role::get_element -role_id $recipient_role_id -element pretty_name]
+ set recipient_p 1
+ set message_url [export_vars -base ../message { role_id case_id recipient_role_id }]
+ set page_title "${item(title)} (${role_name})"
+ }
+
+ set context [list [list $section_uri [_ simulation.SimPlay]] [list $case_url $case(label)] $page_title]
+
+}
+
+
+
foreach name [lsort [array names content]] {
multirow append attributes $name $content($name)
}
Index: openacs-4/packages/simulation/lib/portfolio.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/simulation/lib/portfolio.adp,v
diff -u -r1.1 -r1.2
--- openacs-4/packages/simulation/lib/portfolio.adp 19 Dec 2003 13:39:33 -0000 1.1
+++ openacs-4/packages/simulation/lib/portfolio.adp 30 Nov 2004 21:09:00 -0000 1.2
@@ -1 +1,2 @@
-
+
+#simulation.lt_Right-click_document_#
Index: openacs-4/packages/simulation/lib/portfolio.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/simulation/lib/portfolio.tcl,v
diff -u -r1.8 -r1.9
--- openacs-4/packages/simulation/lib/portfolio.tcl 20 Apr 2004 21:12:22 -0000 1.8
+++ openacs-4/packages/simulation/lib/portfolio.tcl 30 Nov 2004 21:09:00 -0000 1.9
@@ -7,8 +7,10 @@
} {
case_id {}
role_id {}
+ portfolio_orderby { required_p 0 }
}
+
simulation::case::assert_user_may_play_role -case_id $case_id -role_id $role_id
set upload_url [export_vars -base document-upload { case_id role_id }]
@@ -19,23 +21,59 @@
set user_roles [list]
}
+if { [exists_and_not_null case_id] } {
+ set num_enabled_actions [db_string select_num_enabled_actions {
+ select count(*)
+ from workflow_case_enabled_actions
+ where case_id = :case_id
+ }]
+ set complete_p [expr $num_enabled_actions == 0]
+} else {
+ set complete_p 0
+}
+
+if { [string match $complete_p "0"] && [exists_and_not_null role_id] } {
+ set actions [list [_ simulation.Upload_a_document] $upload_url]
+} else {
+ set actions [list]
+}
+
template::list::create \
-name documents \
-multirow documents \
-no_data [_ simulation.lt_There_are_no_document] \
- -actions [list [_ simulation.Upload_a_document] $upload_url] \
+ -actions $actions \
+ -filters { case_id {} role_id {} } \
+ -orderby_name portfolio_orderby \
-elements {
document_title {
label {[_ simulation.Document]}
link_url_col document_url
+ orderby upper(cr.title)
}
+ publish_date {
+ label {[_ simulation.Upload_date]}
+ orderby cr.publish_date
+ display_col publish_date_pretty
+ }
+ mime_type {
+ label "[_ simulation.mime_type]"
+ orderby cr.mime_type
+ }
+ content_length {
+ label "[_ simulation.File_size]"
+ orderby cr.content_length
+ }
}
-db_multirow -extend { document_url } documents select_documents "
+db_multirow -extend { document_url publish_date_pretty } documents select_documents "
select scrom.object_id as document_id,
ci.name as document_name,
cr.title as document_title,
- wr.pretty_name as role_name
+ wr.pretty_name as role_name,
+ cr.publish_date as publish_date,
+ cr.mime_type,
+ cr.content_length
from sim_case_role_object_map scrom,
workflow_roles wr,
cr_items ci,
@@ -45,7 +83,9 @@
and scrom.role_id = wr.role_id
and scrom.object_id = ci.item_id
and ci.live_revision = cr.revision_id
- order by scrom.order_n
+ [template::list::orderby_clause -orderby -name "documents"]
" {
set document_url [simulation::object::content_url -name $document_name]
+
+ set publish_date_pretty [lc_time_fmt $publish_date "%x %X"]
}
Index: openacs-4/packages/simulation/lib/sim-insts-grouped.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/simulation/lib/sim-insts-grouped.tcl,v
diff -u -r1.3 -r1.4
--- openacs-4/packages/simulation/lib/sim-insts-grouped.tcl 12 Jan 2004 13:24:57 -0000 1.3
+++ openacs-4/packages/simulation/lib/sim-insts-grouped.tcl 30 Nov 2004 21:09:00 -0000 1.4
@@ -23,14 +23,14 @@
template::list::create \
-name sims \
-multirow sims \
- -actions "{New Simulation From Template} $add_url" \
- -no_data "You have no Simulations in Development or Casting" \
+ -actions "{[_ simulation.lt_New_Simulation_From_T]} $add_url" \
+ -no_data "[_ simulation.lt_You_have_no_Simulatio]" \
-elements {
status {
- label "Status"
+ label "[_ simulation.Status]"
}
count {
- label "Count"
+ label "[_ simulation.Count]"
}
}
Index: openacs-4/packages/simulation/lib/sim-objects-grouped.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/simulation/lib/sim-objects-grouped.tcl,v
diff -u -r1.2 -r1.3
--- openacs-4/packages/simulation/lib/sim-objects-grouped.tcl 12 Jan 2004 11:35:33 -0000 1.2
+++ openacs-4/packages/simulation/lib/sim-objects-grouped.tcl 30 Nov 2004 21:09:00 -0000 1.3
@@ -5,6 +5,7 @@
@creation-date 2003-11-12
@cvs-id $Id$
} {
+ sog_orderby { required_p 0 }
}
######################################################################
@@ -32,7 +33,7 @@
set add_url [export_vars -base "[ad_conn package_url]citybuild/object-edit" { parent_id }]
if { $create_p } {
- set actions "{Add an object} $add_url"
+ set actions "{[_ simulation.Add_an_object]} $add_url"
} else {
set actions ""
}
@@ -41,11 +42,11 @@
# Set basic elements list
set elements {
pretty_name {
- label "Type"
+ label "[_ simulation.Type]"
orderby upper(ot.pretty_name)
}
count {
- label "Number"
+ label "[_ simulation.Number]"
orderby count
}
}
@@ -55,6 +56,7 @@
-name objects \
-multirow objects \
-actions $actions \
+ -orderby_name sog_orderby \
-elements $elements
#---------------------------------------------------------------------
Index: openacs-4/packages/simulation/lib/sim-objects.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/simulation/lib/sim-objects.tcl,v
diff -u -r1.13 -r1.14
--- openacs-4/packages/simulation/lib/sim-objects.tcl 29 Jan 2004 15:12:48 -0000 1.13
+++ openacs-4/packages/simulation/lib/sim-objects.tcl 30 Nov 2004 21:09:00 -0000 1.14
@@ -74,6 +74,11 @@
orderby r.title
link_url_col view_url
}
+ name {
+ label "URI"
+ orderby lower(i.name)
+ }
+
}
#---------------------------------------------------------------------
@@ -167,6 +172,9 @@
set edit_p [expr $write_p || [permission::write_permission_p -object_id $item_id]]
switch -glob $mime_type {
+ text/calendar - text/rtf {
+ set view_url [simulation::object::content_url -name $name]
+ }
text/* - {} {
set view_url [simulation::object::url -name $name]
}
Index: openacs-4/packages/simulation/lib/sim-template-states.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/simulation/lib/sim-template-states.tcl,v
diff -u -r1.5 -r1.6
--- openacs-4/packages/simulation/lib/sim-template-states.tcl 29 Jun 2004 10:17:34 -0000 1.5
+++ openacs-4/packages/simulation/lib/sim-template-states.tcl 30 Nov 2004 21:09:01 -0000 1.6
@@ -79,9 +79,9 @@
set edit_url [export_vars -base "[ad_conn package_url]simbuild/state-edit" { state_id { return_url [ad_return_url] } }]
set delete_url [export_vars -base "[ad_conn package_url]simbuild/state-delete" { state_id { return_url [ad_return_url] } }]
if { $counter > 1 } {
- set up_url [export_vars -base "[ad_conn package_url]simbuild/template-object-reorder" { { type state } state_id { direction up } { return_url [ad_return_url] } }]
+ set up_url [export_vars -base "[ad_conn package_url]simbuild/template-object-reorder" { { type state } state_id { direction up } { return_url [ad_return_url] } { parent_action_id $parent_action_id } }]
}
- set down_url [export_vars -base "[ad_conn package_url]simbuild/template-object-reorder" { { type state } state_id { direction down } { return_url [ad_return_url] } }]
+ set down_url [export_vars -base "[ad_conn package_url]simbuild/template-object-reorder" { { type state } state_id { direction down } { return_url [ad_return_url] } { parent_action_id $parent_action_id } }]
}
# Get rid of the last down_url
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.43 -r1.44
--- openacs-4/packages/simulation/lib/sim-template-tasks.tcl 29 Jun 2004 10:17:34 -0000 1.43
+++ openacs-4/packages/simulation/lib/sim-template-tasks.tcl 30 Nov 2004 21:09:01 -0000 1.44
@@ -30,7 +30,7 @@
#-------------------------------------------------------------
if { $display_mode == "edit"} {
- set list_actions [list "Add a Task" [export_vars -base task-edit { workflow_id parent_action_id {return_url "[ad_return_url]\#tasks" } }] {}]
+ set list_actions [list "Add a Task" [export_vars -base task-edit { workflow_id parent_action_id {return_url "[ad_return_url]" } }] {}]
} else {
set list_actions [list]
}
@@ -221,11 +221,11 @@
order by wa.sort_order
" {
incr counter
- set edit_url [export_vars -base "[apm_package_url_from_id $package_id]simbuild/task-edit" -anchor tasks { action_id {return_url "[ad_return_url]\#tasks"} }]
- set view_url [export_vars -base "[apm_package_url_from_id $package_id]simbuild/task-edit" -anchor tasks { action_id {return_url "[ad_return_url]\#tasks"}}]
+ set edit_url [export_vars -base "[apm_package_url_from_id $package_id]simbuild/task-edit" -anchor tasks { action_id {return_url "[ad_return_url]"} }]
+ set view_url [export_vars -base "[apm_package_url_from_id $package_id]simbuild/task-edit" -anchor tasks { action_id {return_url "[ad_return_url]"}}]
set delete_url \
- [export_vars -base "[apm_package_url_from_id $package_id]simbuild/task-delete" { action_id {return_url "[ad_return_url]\#tasks"} }]
- set copy_url [export_vars -base task-copy { action_id {return_url "[ad_return_url]\#tasks"} }]
+ [export_vars -base "[apm_package_url_from_id $package_id]simbuild/task-delete" { action_id workflow_id {return_url "[ad_return_url]"} }]
+ set copy_url [export_vars -base task-copy { action_id workflow_id {return_url "[ad_return_url]"} }]
set assigned_role_edit_url \
[export_vars -base "[apm_package_url_from_id $package_id]simbuild/role-edit" { { role_id $assigned_role } }]
@@ -239,9 +239,9 @@
} else {
set state_$state_id enabled
}
- set state_${state_id}_url [export_vars -base task-enabled-in-state-update { action_id state_id { enabled_p f } { return_url {[ad_return_url]\#tasks} } }]
+ set state_${state_id}_url [export_vars -base task-enabled-in-state-update { action_id state_id { enabled_p f } { return_url {[ad_return_url]} } }]
} else {
- set state_${state_id}_url [export_vars -base task-enabled-in-state-update { action_id state_id { return_url {[ad_return_url]\#tasks} } }]
+ set state_${state_id}_url [export_vars -base task-enabled-in-state-update { action_id state_id { return_url {[ad_return_url]} } }]
}
if { $new_state == $state_id } {
@@ -250,9 +250,9 @@
}
if { $counter > 1 } {
- set up_url [export_vars -base "[ad_conn package_url]simbuild/template-object-reorder" { { type action } action_id { direction up } { return_url "[ad_return_url]\#tasks" } }]
+ set up_url [export_vars -base "[ad_conn package_url]simbuild/template-object-reorder" { { type action } action_id { direction up } { return_url "[ad_return_url]" } { parent_action_id $parent_action_id } }]
}
- set down_url [export_vars -base "[ad_conn package_url]simbuild/template-object-reorder" { { type action } action_id { direction down } { return_url "[ad_return_url]\#tasks" } }]
+ set down_url [export_vars -base "[ad_conn package_url]simbuild/template-object-reorder" { { type action } action_id { direction down } { return_url "[ad_return_url]" } { parent_action_id $parent_action_id } }]
switch $trigger_type {
workflow - parallel - dynamic {
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.18 -r1.19
--- openacs-4/packages/simulation/lib/sim-templates.tcl 23 Jan 2004 11:11:28 -0000 1.18
+++ openacs-4/packages/simulation/lib/sim-templates.tcl 30 Nov 2004 21:09:01 -0000 1.19
@@ -9,6 +9,7 @@
allowed_values {short long}
default_value long
}
+ sb_orderby { required_p 0 }
}
set package_id [ad_conn package_id]
@@ -17,22 +18,22 @@
set create_p [permission::permission_p -object_id $package_id -privilege sim_template_create]
set package_admin_p [permission::permission_p -object_id $package_id -privilege admin]
-set actions [list "Add a template" $add_url {} \
- "Import a template" "[apm_package_url_from_id $package_id]simbuild/template-load" {}]
+set actions [list "[_ simulation.Add_a_template]" $add_url {} \
+ "[_ simulation.Import_a_template]" "[apm_package_url_from_id $package_id]simbuild/template-load" {}]
switch $size {
short {
set elements {
name {
- label "Template"
+ label "[_ simulation.Template]"
link_url_col edit_url
- orderby upper(ot.pretty_name)
+ orderby upper(w.pretty_name)
}
role_count {
- label "Roles"
+ label "[_ simulation.Roles]"
}
task_count {
- label "Tasks"
+ label "[_ simulation.Tasks]"
}
}
}
@@ -42,54 +43,54 @@
sub_class narrow
display_template {
-
-
+
+
}
}
name {
- label "Template Name"
- orderby upper(ot.pretty_name)
+ label "[_ simulation.Template_Name]"
+ orderby upper(w.pretty_name)
link_url_col view_url
}
description {
- label "Description"
- orderby r.description
+ label "[_ simulation.Description]"
+ orderby description
display_template {@sim_templates.description;noquote@}
}
created_by {
- label "Created by"
- orderby r.createdby
+ label "[_ simulation.Created_by]"
+ orderby created_by
}
role_count {
- label "Roles"
+ label "[_ simulation.Roles]"
}
task_count {
- label "Tasks"
+ label "[_ simulation.Tasks]"
}
sim_type {
- label "Ready"
+ label "[_ simulation.Ready]"
display_eval {[ad_decode $sim_type "ready_template" "Yes" "No"]}
}
copy {
sub_class narrow
display_template {
-
+
}
link_url_col clone_url
- link_html { title "Clone this template" }
+ link_html { title "[_ simulation.Clone_this_template]" }
}
delete {
sub_class narrow
link_url_col delete_url
link_html {
- title "Delete this template"
- onclick "return confirm('Are you sure you want to delete template @sim_templates.name@?');"
+ title "[_ simulation.Delete_this_template]"
+ onclick "return confirm('[_ simulation.lt_Are_you_sure_you_want_2] @sim_templates.name@?');"
}
display_template {
-
+
}
}
@@ -101,6 +102,7 @@
-name sim_templates \
-multirow sim_templates \
-actions $actions \
+ -orderby_name sb_orderby \
-elements $elements
@@ -119,7 +121,7 @@
db_multirow -extend { edit_url view_url delete_url clone_url edit_p } sim_templates select_sim_templates "
select w.workflow_id,
w.pretty_name as name,
- w.description,
+ w.description as description,
w.description_mime_type,
ss.sim_type,
(select p.first_names || ' ' || p.last_name
@@ -143,9 +145,9 @@
" {
set description [ad_html_text_convert -from $description_mime_type -maxlen 200 -- $description]
- set edit_url [export_vars -base "[apm_package_url_from_id $package_id]simbuild/template-edit" { workflow_id }]
+ set edit_url [export_vars -base "[apm_package_url_from_id $package_id]simbuild/template-sim-type-update" { workflow_id { sim_type "dev_template" } }]
- set view_url [export_vars -base "[apm_package_url_from_id $package_id]simbuild/template-edit" { workflow_id }]
+ set view_url [export_vars -base "[apm_package_url_from_id $package_id]simbuild/template-sim-type-update" { workflow_id { sim_type "dev_template" } }]
set clone_url [export_vars -base "[apm_package_url_from_id $package_id]simbuild/template-clone" { workflow_id }]
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.4 -r1.5
--- openacs-4/packages/simulation/lib/simulations-available.tcl 15 Jan 2004 14:56:26 -0000 1.4
+++ openacs-4/packages/simulation/lib/simulations-available.tcl 30 Nov 2004 21:09:01 -0000 1.5
@@ -8,35 +8,39 @@
party_id {
default_value ""
}
+ as_orderby {
+ required_p 0
+ }
}
set package_id [ad_conn package_id]
set user_id [ad_conn user_id]
set elements {
pretty_name {
- label "Simulation"
+ label "[_ simulation.Simulation]"
orderby upper(w.pretty_name)
}
description {
- label "Description"
+ label "[_ simulation.Description]"
display_template {
@avail_sims.description;noquote@
}
}
enroll {
- label "Join"
+ label "[_ simulation.Join]"
display_template {
- Join
+ [_ simulation.Join]
}
}
}
template::list::create \
-name avail_sims \
+ -orderby_name as_orderby \
-multirow avail_sims \
- -no_data "No simulations available to join." \
+ -no_data "[_ simulation.lt_No_simulations_availa]" \
-elements $elements
db_multirow -extend { enroll_url } avail_sims select_avail_sims "
Index: openacs-4/packages/simulation/lib/template-clone.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/simulation/lib/template-clone.tcl,v
diff -u -r1.1 -r1.2
--- openacs-4/packages/simulation/lib/template-clone.tcl 23 Jan 2004 14:31:36 -0000 1.1
+++ openacs-4/packages/simulation/lib/template-clone.tcl 30 Nov 2004 21:09:01 -0000 1.2
@@ -1,9 +1,11 @@
simulation::template::get -workflow_id $workflow_id -array simulation
-set pretty_name "Clone of $simulation(pretty_name)"
+set pretty_name "Copy of $simulation(pretty_name)"
-ad_form -name clone -export { workflow_id } -edit_buttons [list [list "Clone" ok]] -form {
+ad_form -name clone \
+ -cancel_url [util_current_location][util_current_directory] \
+ -export { workflow_id } -edit_buttons [list [list "Clone" ok]] -form {
{pretty_name:text
{label "Name"}
{html {size 50}}
Index: openacs-4/packages/simulation/lib/yellow-pages.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/simulation/lib/yellow-pages.adp,v
diff -u -r1.3 -r1.4
--- openacs-4/packages/simulation/lib/yellow-pages.adp 9 Mar 2004 17:04:23 -0000 1.3
+++ openacs-4/packages/simulation/lib/yellow-pages.adp 30 Nov 2004 21:09:01 -0000 1.4
@@ -1,3 +1,8 @@
+
+
+Search filter: @search_terms@
+
+
Index: openacs-4/packages/simulation/lib/yellow-pages.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/simulation/lib/yellow-pages.tcl,v
diff -u -r1.6 -r1.7
--- openacs-4/packages/simulation/lib/yellow-pages.tcl 10 Mar 2004 10:13:46 -0000 1.6
+++ openacs-4/packages/simulation/lib/yellow-pages.tcl 30 Nov 2004 21:09:01 -0000 1.7
@@ -6,6 +6,10 @@
@author Joel Aufrecht
@creation-date 2003-11-12
@cvs-id $Id$
+} {
+ yp_orderby { required_p 0 }
+ case_id { required_p 0 }
+ role_id { required_p 0 }
}
######################################################################
@@ -22,17 +26,30 @@
search_terms:optional
}
+if { ![exists_and_not_null search_terms] } {
+ set search_terms ""
+}
+set base_url [ad_conn urlv]
+
+set simplay 1
+if { [lsearch -exact $base_url "simplay"] == -1 } {
+ set simplay 0
+}
+
+set cancel_url [export_vars -base "./yellow-pages" { case_id role_id }]
+
ad_form -name search -form {
- {search_terms:text,optional {label "Restrict to items matching word or phrase"}}
+ {search_terms:text,optional {label "[_ simulation.lt_Restrict_to_items_mat]"}}
+} -export { case_id role_id
} -validate {
{search_terms
{[string length $search_terms] >= 3}
- "\"search_terms\" must be a string containing three or more characters"
+ {[_ simulation.lt_search_terms_must_be_]}
}
} -method GET -on_submit {
# foobar
-}
+} -cancel_url $cancel_url -cancel_label "[_ simulation.Clear_filter]"
######################################################################
@@ -45,18 +62,18 @@
# Set basic elements list
set elements {
object_type {
- label "Type"
- orderby upper(ot.pretty_name)
+ label "[_ simulation.Type]"
+ orderby object_type_pretty
display_col object_type_pretty
}
title {
- label "Name"
- orderby r.title
+ label "[_ simulation.Name]"
+ orderby title
link_url_col view_url
}
description {
- label "Description"
- orderby r.description
+ label "[_ simulation.Description]"
+ orderby description
}
}
@@ -65,6 +82,8 @@
template::list::create \
-name objects \
-multirow objects \
+ -orderby_name yp_orderby \
+ -filters { role_id {} case_id {} search_terms {} } \
-elements $elements
#---------------------------------------------------------------------
@@ -87,11 +106,11 @@
select sl.object_id,
sl.object_type,
ot.pretty_name as object_type_pretty,
- sl.title,
+ sl.title as title,
sl.mime_type,
sl.name,
sl.item_id,
- sl.description
+ sl.description as description
from sim_locationsx sl,
cr_items ci,
acs_object_types ot,
@@ -105,11 +124,11 @@
select sc.object_id,
sc.object_type,
ot.pretty_name as object_type_pretty,
- sc.title,
+ sc.title as title,
sc.mime_type,
sc.name,
sc.item_id,
- sc.description
+ sc.description as description
from sim_charactersx sc,
cr_items ci,
acs_object_types ot,
@@ -125,7 +144,11 @@
set description [string_truncate -len 200 $description]
switch -glob $mime_type {
text/* - {} {
- set view_url [simulation::object::url -name $name]
+ if { $simplay } {
+ set view_url [export_vars -base [simulation::object::url -name $name -simplay $simplay] { case_id role_id } ]
+ } else {
+ set view_url [simulation::object::url -name $name]
+ }
}
default {
set view_url [simulation::object::content_url -name $name]
Index: openacs-4/packages/simulation/sql/postgresql/upgrade/upgrade-1.0.0b4-1.0.0b5.sql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/simulation/sql/postgresql/upgrade/upgrade-1.0.0b4-1.0.0b5.sql,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/simulation/sql/postgresql/upgrade/upgrade-1.0.0b4-1.0.0b5.sql 30 Nov 2004 21:09:01 -0000 1.1
@@ -0,0 +1,5 @@
+alter table sim_tasks add
+ default_text text;
+
+alter table sim_tasks add
+ default_text_mime_type varchar(200);
\ No newline at end of file
Index: openacs-4/packages/simulation/tcl/apm-callback-procs.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/simulation/tcl/apm-callback-procs.tcl,v
diff -u -r1.15 -r1.16
--- openacs-4/packages/simulation/tcl/apm-callback-procs.tcl 20 Apr 2004 21:12:23 -0000 1.15
+++ openacs-4/packages/simulation/tcl/apm-callback-procs.tcl 30 Nov 2004 21:09:01 -0000 1.16
@@ -11,6 +11,10 @@
ad_proc -private simulation::apm::after_install {} {
simulation::notification::xml_map::register
simulation::notification::message::register
+
+ cr_create_mime_type -extension rtf -mime_type {text/rtf} -description "RTF - Rich Text Format"
+ cr_create_mime_type -extension ics -mime_type {text/calendar} -description "iCal Calendar"
+
}
ad_proc -private simulation::apm::before_uninstall {} {
@@ -81,7 +85,6 @@
"Sim Admins" {sim_admin}
"Template Authors" {sim_template_creator sim_inst sim_object_create}
"Case Authors" {sim_inst sim_object_create sim_adminplayer}
- "Service Admins" {}
"City Admins" {sim_set_map_p sim_object_writer}
"Actors" {}
} {
@@ -95,10 +98,6 @@
permission::grant -party_id $permission_group_id -object_id $package_id -privilege $privilege
}
- # Grant subsite admin to the admin groups so that they can admin groups
- if { [string equal $group_name "Sim Admins"] || [string equal $group_name "Service Admins"] } {
- permission::grant -party_id $permission_group_id -object_id $subsite_package_id -privilege admin
- }
}
Index: openacs-4/packages/simulation/tcl/object-procs.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/simulation/tcl/object-procs.tcl,v
diff -u -r1.12 -r1.13
--- openacs-4/packages/simulation/tcl/object-procs.tcl 9 Mar 2004 17:04:24 -0000 1.12
+++ openacs-4/packages/simulation/tcl/object-procs.tcl 30 Nov 2004 21:09:01 -0000 1.13
@@ -19,6 +19,7 @@
{-package_id ""}
{-name:required}
{-mime_type ""}
+ {-simplay ""}
} {
The URL for the page displaying contents and name of
an item.
@@ -29,9 +30,17 @@
set package_id [ad_conn package_id]
set package_url "[ad_url][apm_package_url_from_id $package_id]"
}
+
+ if { [empty_string_p $simplay] } {
+ set simplay 0
+ }
if { [empty_string_p $mime_type] || [string match "text/*" $mime_type] } {
- return "${package_url}object/${name}"
+ if { !$simplay } {
+ return "${package_url}object/${name}"
+ } else {
+ return "${package_url}simplay/object/${name}"
+ }
} else {
return "${package_url}object-content/${name}"
}
Index: openacs-4/packages/simulation/tcl/sim-action-procs.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/simulation/tcl/sim-action-procs.tcl,v
diff -u -r1.8 -r1.9
--- openacs-4/packages/simulation/tcl/sim-action-procs.tcl 15 Mar 2004 17:22:18 -0000 1.8
+++ openacs-4/packages/simulation/tcl/sim-action-procs.tcl 30 Nov 2004 21:09:02 -0000 1.9
@@ -87,7 +87,7 @@
# Handle columns in the sim_tasks table
foreach attr {
- attachment_num
+ attachment_num default_text default_text_mime_type
} {
if { [info exists row($attr)] } {
set varname attr_$attr
@@ -136,6 +136,16 @@
}
}
+ switch $operation {
+ update {
+ if { [info exists row(trigger_type)] } {
+ if { [empty_string_p $row(trigger_type)] } {
+ unset row(trigger_type)
+ }
+ }
+ }
+ }
+
db_transaction {
# Base row
set action_id [workflow::action::fsm::edit \
@@ -224,7 +234,7 @@
}
db_1row select_action {
- select attachment_num
+ select attachment_num, default_text, default_text_mime_type
from sim_tasks
where task_id = :action_id
} -column_array local_row
@@ -283,10 +293,22 @@
}
array set row [workflow::action::fsm::generate_spec -action_id $action_id -handlers $handlers]
+ ############
+ # DEBUGGING
+ if { [exists_and_not_null row(parent_action_id)] } {
+ ns_log notice "simulation::action::generate_spec: row(parent_action_id) is $row(parent_action_id)"
+ } else {
+ ns_log notice "simulation::action::generate_spec: no paren_action_id in sight :("
+ }
+ # STOP DEBUGGING
+ ###############
+
+
# Get local spec, remove unwanted entries
get -action_id $action_id -array local_row -local_only
array unset local_row recipients
+
# Copy local stuff in over the parent stuff
array set row [array get local_row]
@@ -363,6 +385,10 @@
set action_spec(pretty_name) "Copy of $action_spec(pretty_name)"
+ if { [exists_and_not_null action(parent_action_id)] } {
+ set action_spec(parent_action_id) $action(parent_action_id)
+ }
+
foreach type { child_actions child_states child_roles } {
if { [info exists action_spec($type)] } {
unset action_spec($type)
Index: openacs-4/packages/simulation/tcl/sim-case-procs.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/simulation/tcl/sim-case-procs.tcl,v
diff -u -r1.6 -r1.7
--- openacs-4/packages/simulation/tcl/sim-case-procs.tcl 19 Jan 2004 17:45:27 -0000 1.6
+++ openacs-4/packages/simulation/tcl/sim-case-procs.tcl 30 Nov 2004 21:09:02 -0000 1.7
@@ -167,3 +167,23 @@
}
return 1
}
+
+ad_proc -public simulation::case::complete_p {
+ {-case_id:required}
+} {
+ Checks if the case has been completed.
+
+ @param case_id The ID of the case
+
+ @return 1 if the case has been completed, 0 otherwise
+
+ @author Jarkko Laine (jarkko@jlaine.net)
+} {
+ set num_enabled_actions [db_string select_num_enabled_actions {
+ select count(*)
+ from workflow_case_enabled_actions
+ where case_id = :case_id
+ }]
+
+ return [expr $num_enabled_actions == 0]
+}
\ No newline at end of file
Index: openacs-4/packages/simulation/tcl/template-procs.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/simulation/tcl/template-procs.tcl,v
diff -u -r1.69 -r1.70
--- openacs-4/packages/simulation/tcl/template-procs.tcl 20 Apr 2004 21:12:23 -0000 1.69
+++ openacs-4/packages/simulation/tcl/template-procs.tcl 30 Nov 2004 21:09:02 -0000 1.70
@@ -1324,17 +1324,12 @@
}
# 3. Tasks
- set prop_empty_count [db_string prop_empty_count {
- select sum((select count(*) from sim_task_object_map where task_id = wa.action_id) - st.attachment_num)
- from sim_tasks st,
- workflow_actions wa
- where st.task_id = wa.action_id
- and wa.workflow_id = :workflow_id
- }]
- if { $prop_empty_count == 0 } {
- set tab_complete_p(map-tasks) 1
- }
+ # Jarkko: I took away the check because the attachments shouldn't
+ # be obligatory
+ set tab_complete_p(map-tasks) 1
+
+
# 4. Participants
set num_parties [db_string num_parties { select count(*) from sim_party_sim_map where simulation_id = :workflow_id}]
if { [string equal $sim_template(enroll_type) "open"] || $num_parties > 0 } {
@@ -1513,3 +1508,46 @@
and pamm.member_id = :user_id
}]
}
+
+ad_proc -public simulation::template::check_init_p {
+ {-workflow_id:required}
+} {
+ Checks that given simulation template and all its subworkflows
+ and parallel tasks have an initial action. Returns 1 if everything
+ is ok and 0 if an init action is missing.
+
+ @param workflow_id ID of simulation template.
+} {
+ set ret_val 1
+
+ if { ![db_string get_init "
+ select count(*)
+ from workflow_actions
+ where workflow_id = :workflow_id and
+ trigger_type = 'init' and
+ parent_action_id is null"] } {
+ return 0
+ }
+
+ db_foreach get_subworkflows {
+ select action_id
+ from workflow_actions
+ where workflow_id = :workflow_id and
+ trigger_type in ('workflow')
+ } {
+ if { ![db_string get_sub_init "
+ select count(*)
+ from workflow_actions
+ where workflow_id = :workflow_id and
+ trigger_type = 'init' and
+ parent_action_id = :action_id"] } {
+ set ret_val 0
+ break
+ }
+ }
+
+ return $ret_val
+}
+
+
+
Index: openacs-4/packages/simulation/tcl/ui-procs.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/simulation/tcl/ui-procs.tcl,v
diff -u -r1.5 -r1.6
--- openacs-4/packages/simulation/tcl/ui-procs.tcl 30 Jan 2004 11:23:25 -0000 1.5
+++ openacs-4/packages/simulation/tcl/ui-procs.tcl 30 Nov 2004 21:09:02 -0000 1.6
@@ -27,7 +27,10 @@
}
}
-ad_proc -public simulation::ui::forms::document_upload::documents_element_value { action_id } {
+ad_proc -public simulation::ui::forms::document_upload::documents_element_value {
+ {-content_p:boolean {0}}
+ action_id
+} {
Get a piece of HTML with links to documents for the documents form element.
} {
set documents ""
@@ -44,8 +47,13 @@
and cr.revision_id = ci.live_revision
order by m.order_n
} {
- set object_url [simulation::object::url \
- -name $object_name]
+ if { !$content_p } {
+ set object_url [simulation::object::url \
+ -name $object_name]
+ } else {
+ set object_url [simulation::object::content_url \
+ -name $object_name]
+ }
append documents "$object_title "
}
@@ -54,7 +62,36 @@
return $documents
}
+ad_proc -public simulation::ui::forms::document_upload::documents_element_value_content {
+ action_id
+} {
+ Get a piece of HTML with links to documents' content for the documents form element.
+} {
+ set documents ""
+
+ db_foreach documents {
+ select cr.title as object_title,
+ ci.name as object_name
+ from sim_task_object_map m,
+ cr_items ci,
+ cr_revisions cr
+ where m.task_id = :action_id
+ and m.relation_tag = 'attachment'
+ and ci.item_id = m.object_id
+ and cr.revision_id = ci.live_revision
+ order by m.order_n
+ } {
+ set object_url [simulation::object::content_url \
+ -name $object_name]
+ append documents "$object_title "
+ }
+ append documents " "
+
+ return $documents
+}
+
+
ad_proc -public simulation::ui::forms::document_upload::insert_document {
case_id
role_id
@@ -103,3 +140,56 @@
}
}
}
+
+ad_proc -public simulation::ui::forms::document_upload::check_mime {
+ -document_file
+} {
+ Checks that the mime type of the given file can be found in the cr_mime_types
+ table. Using this avoids bombs later on in the upload process
+
+ @param document_file the file being uploaded
+
+ @author Jarkko Laine (jarkko@jlaine.net)
+} {
+ set upload_filename [template::util::file::get_property filename $document_file]
+
+ if { ![exists_and_not_null mime_type] } {
+ set mime_type [template::util::file::get_property mime_type $document_file]
+ }
+
+ ns_log notice "check_mime(1): mime_type is <$mime_type>"
+
+ if { ![exists_and_not_null mime_type] } {
+ set mime_type [cr_filename_to_mime_type -create $upload_filename]
+ }
+
+ ns_log notice "check_mime(2): mime_type is <$mime_type>"
+
+ set mime_count [db_string get_mime {
+ select count(*) from cr_mime_types where mime_type = :mime_type}]
+
+ if { $mime_count > 0 } {
+ return 1
+ } else {
+ return 0
+ }
+}
+
+ad_proc -public simulation::ui::forms::document_upload::add_mime {
+ -document_file
+} {
+ Tries to add the mime type of a file to cr_mime_types unless
+ it already exists there.
+
+ @param document_file the file being uploaded
+
+ @author Jarkko Laine (jarkko@jlaine.net)
+} {
+ set upload_filename [template::util::file::get_property filename $document_file]
+ set extension [string tolower [string trimleft [file extension $upload_filename] "."]]
+ set orig_mime_type [template::util::file::get_property mime_type $document_file]
+
+ ns_log notice "add_mime: mime_type is <$orig_mime_type>"
+
+ cr_create_mime_type -extension $extension -mime_type $orig_mime_type
+}
\ No newline at end of file
Index: openacs-4/packages/simulation/tcl/test/simulation-procs.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/simulation/tcl/test/simulation-procs.tcl,v
diff -u -r1.4 -r1.5
--- openacs-4/packages/simulation/tcl/test/simulation-procs.tcl 18 Nov 2003 13:31:33 -0000 1.4
+++ openacs-4/packages/simulation/tcl/test/simulation-procs.tcl 30 Nov 2004 21:09:02 -0000 1.5
@@ -12,6 +12,7 @@
procs.
} {
aa_log [simulation::object::url -name "test_name"]
+ aa_log [simulation::object::url -name "test_name_2" -simplay 1]
aa_log [simulation::object::content_url -name "test_name"]
}
Index: openacs-4/packages/simulation/www/control-bar.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/simulation/www/control-bar.adp,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/simulation/www/control-bar.adp 30 Nov 2004 21:09:03 -0000 1.1
@@ -0,0 +1,65 @@
+
\ No newline at end of file
Index: openacs-4/packages/simulation/www/control-bar.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/simulation/www/control-bar.tcl,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/simulation/www/control-bar.tcl 30 Nov 2004 21:09:03 -0000 1.1
@@ -0,0 +1,25 @@
+simulation::include_contract {
+ Displays a menu/control bar in simulation root directory
+
+ @author Jarkko Laine (jarkko@jlaine.net)
+ @creation-date 2004-11-25
+ @cvs-id $Id: control-bar.tcl,v 1.1 2004/11/30 21:09:03 jarkko Exp $
+} {
+}
+
+set package_id [ad_conn package_id]
+set package_url [ad_conn package_url]
+
+set history_url [ad_conn package_url]object/[parameter::get -package_id $package_id -parameter SieberdamHistoryFile]
+set info_url [ad_conn package_url]object/[parameter::get -package_id $package_id -parameter SieberdamRocsInfoFile]
+set contact_url [ad_conn package_url]object/[parameter::get -package_id $package_id -parameter ContactInformationFile]
+set colophon_url [ad_conn package_url]object/[parameter::get -package_id $package_id -parameter ColophonFile]
+set avail_url [ad_conn package_url]object/[parameter::get -package_id $package_id -parameter AvailabilityInfoFile]
+
+set citybuild_p [permission::permission_p -object_id $package_id -privilege sim_object_create]
+set simbuild_p [permission::permission_p -object_id $package_id -privilege sim_template_read]
+set siminst_p [permission::permission_p -object_id $package_id -privilege sim_inst]
+
+set curr_url [ad_conn url]
+ns_log notice curr_url is $curr_url
+ns_log notice package_url is $package_url
Index: openacs-4/packages/simulation/www/dynamic-map.swf
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/simulation/www/dynamic-map.swf,v
diff -u
Binary files differ
Index: openacs-4/packages/simulation/www/index.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/simulation/www/index.adp,v
diff -u -r1.33 -r1.34
--- openacs-4/packages/simulation/www/index.adp 17 May 2004 15:14:38 -0000 1.33
+++ openacs-4/packages/simulation/www/index.adp 30 Nov 2004 21:09:03 -0000 1.34
@@ -2,41 +2,4 @@
@page_title;noquote@
@context;noquote@
-
-
-
-
-
-
-
-
-
- Your Current Simulations
-
-
-
- Log in to see your active cases.
-
-
-
Join a Simulation
-
-
-
-
+
\ No newline at end of file
Index: openacs-4/packages/simulation/www/index.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/simulation/www/index.tcl,v
diff -u -r1.15 -r1.16
--- openacs-4/packages/simulation/www/index.tcl 16 Mar 2004 15:43:41 -0000 1.15
+++ openacs-4/packages/simulation/www/index.tcl 30 Nov 2004 21:09:03 -0000 1.16
@@ -6,158 +6,6 @@
} -properties {
}
-set package_id [ad_conn package_id]
-set page_title "Simulation"
+set page_title "[_ simulation.Simulation]"
set context ""
-set user_id [auth::get_user_id]
-set login_url [ad_get_login_url -return]
-
-set citybuild_p [permission::permission_p -object_id $package_id -privilege sim_object_create]
-set simbuild_p [permission::permission_p -object_id $package_id -privilege sim_template_read]
-set siminst_p [permission::permission_p -object_id $package_id -privilege sim_inst]
-
-######################################################################
-#
-# active_cases
-#
-# a list of active cases for logged-in user
-#
-######################################################################
-
-#---------------------------------------------------------------------
-# active_cases list
-#---------------------------------------------------------------------
-
-template::list::create \
- -name active_cases \
- -multirow active_cases \
- -html {width "100%"}\
- -elements {
- case_name {
- label "Case"
- orderby case_name
- }
- task_count {
- label "Tasks"
- orderby task_count
- html { align right }
- }
- }
-
-#---------------------------------------------------------------------
-# active_cases database query
-#---------------------------------------------------------------------
-# this is currently a dummy query. It should get all cases
-# for which the logged-in user has a role, and a count of active tasks
-# for that role.
-
-db_multirow active_cases active_cases_select {
- select 'case one' as case_name,
- 2 as task_count
-}
-
-
-######################################################################
-#
-# object_count
-#
-# A count of all objects in the system, by type, for admins
-#
-######################################################################
-
-#---------------------------------------------------------------------
-# object_count list
-#---------------------------------------------------------------------
-if { ![exists_and_not_null parent_id] } {
- set parent_id [bcms::folder::get_id_by_package_id -parent_id 0]
-}
-
-set action_list [list "Add an Object" [export_vars -base object-edit { parent_id }] ]
-
-template::list::create \
- -name object_count \
- -multirow object_count \
- -actions $action_list \
- -html {width "100%"} \
- -elements {
- type {
- label "Type"
- }
- count {
- label "Count"
- link_url_col view_url
- html { align right }
- }
- }
-
-#---------------------------------------------------------------------
-# object_count database query
-#---------------------------------------------------------------------
-# this query should be package-sensitive. Not sure how to do that -
-# should it return only items in folders associated with the package id?
-# if so, how do we also count items in child folders?
-
-db_multirow -extend { view_url } object_count object_count_select "
- select content_type as type,
- count(content_type) as count
- from cr_items
- where content_type like 'sim_%'
- or content_type like 'image'
- or content_type like 'stylesheet'
- group by content_type
-" {
- set view_url [export_vars -base "citybuild/" { type }]
-}
-
-
-######################################################################
-#
-# sim_template_count
-#
-# A count of all templates, for admins
-# They should probably be grouped, but I'm not sure what to group
-# them by yet
-#
-######################################################################
-
-#---------------------------------------------------------------------
-# sim_template_count list
-#---------------------------------------------------------------------
-
-template::list::create \
- -name sim_template_count \
- -multirow sim_template_count \
- -html {width "100%"} \
- -elements {
- count {
- label "Simulation Templates"
- link_url_col view_url
- }
- }
-
-
-
-template::list::create \
- -name template_count \
- -multirow template_count \
- -elements {
- type {
- label "Type"
- }
- count {
- label "Count"
- link_url_col view_url
- }
- }
-
-#---------------------------------------------------------------------
-# template_count database query
-#---------------------------------------------------------------------
-
-db_multirow -extend { view_url } sim_template_count sim_template_count_query "
- select count(workflow_id) as count
- from workflows w
-" {
- set view_url [export_vars -base "simbuild/"]
-}
Index: openacs-4/packages/simulation/www/map-master.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/simulation/www/map-master.adp,v
diff -u -r1.9 -r1.10
--- openacs-4/packages/simulation/www/map-master.adp 17 May 2004 15:14:38 -0000 1.9
+++ openacs-4/packages/simulation/www/map-master.adp 30 Nov 2004 21:09:03 -0000 1.10
@@ -7,12 +7,14 @@
-
+
-
- Placeholder for flash map
+
Index: openacs-4/packages/simulation/www/map-master.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/simulation/www/map-master.tcl,v
diff -u -r1.2 -r1.3
--- openacs-4/packages/simulation/www/map-master.tcl 18 Nov 2003 09:44:31 -0000 1.2
+++ openacs-4/packages/simulation/www/map-master.tcl 30 Nov 2004 21:09:03 -0000 1.3
@@ -1,3 +1,5 @@
set package_id [ad_conn package_id]
set return_url [ad_return_url]
set parameters_url [export_vars -base "/shared/parameters" {package_id return_url}]
+
+set map_help_url [ad_conn url]object/[parameter::get -package_id $package_id -parameter MapHelpFile]
\ No newline at end of file
Index: openacs-4/packages/simulation/www/map.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/simulation/www/map.adp,v
diff -u -r1.1 -r1.2
--- openacs-4/packages/simulation/www/map.adp 17 Dec 2003 08:47:15 -0000 1.1
+++ openacs-4/packages/simulation/www/map.adp 30 Nov 2004 21:09:03 -0000 1.2
@@ -5,14 +5,13 @@
id="map"
ALIGN=""
alt="Flash map of the city">
-
+
-
-
-
\ No newline at end of file
+
\ No newline at end of file
Index: openacs-4/packages/simulation/www/map.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/simulation/www/map.tcl,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/simulation/www/map.tcl 30 Nov 2004 21:09:03 -0000 1.1
@@ -0,0 +1 @@
+set url [site_node_closest_ancestor_package_url -package_key simulation]
\ No newline at end of file
Index: openacs-4/packages/simulation/www/normal-master.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/simulation/www/normal-master.adp,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/simulation/www/normal-master.adp 30 Nov 2004 21:09:03 -0000 1.1
@@ -0,0 +1,14 @@
+
+ @title;noquote@
+ @context;noquote@
+
+
Index: openacs-4/packages/simulation/www/normal-master.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/simulation/www/normal-master.tcl,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/simulation/www/normal-master.tcl 30 Nov 2004 21:09:03 -0000 1.1
@@ -0,0 +1 @@
\ No newline at end of file
Index: openacs-4/packages/simulation/www/simulation-master.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/simulation/www/simulation-master.adp,v
diff -u -r1.10 -r1.11
--- openacs-4/packages/simulation/www/simulation-master.adp 12 Dec 2003 12:23:35 -0000 1.10
+++ openacs-4/packages/simulation/www/simulation-master.adp 30 Nov 2004 21:09:03 -0000 1.11
@@ -5,11 +5,9 @@
@focus;noquote@
-
+
@header_stuff;noquote@
-
-
-
+
\ No newline at end of file
Index: openacs-4/packages/simulation/www/static-map.swf
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/simulation/www/static-map.swf,v
diff -u
Binary files differ
Index: openacs-4/packages/simulation/www/yellow-pages.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/simulation/www/yellow-pages.adp,v
diff -u -r1.5 -r1.6
--- openacs-4/packages/simulation/www/yellow-pages.adp 16 Dec 2003 14:16:28 -0000 1.5
+++ openacs-4/packages/simulation/www/yellow-pages.adp 30 Nov 2004 21:09:03 -0000 1.6
@@ -1,7 +1,14 @@
-
+
@page_title;noquote@
@context;noquote@
+
+
+
+
+
+
+
Index: openacs-4/packages/simulation/www/yellow-pages.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/simulation/www/yellow-pages.tcl,v
diff -u -r1.1 -r1.2
--- openacs-4/packages/simulation/www/yellow-pages.tcl 13 Nov 2003 14:55:25 -0000 1.1
+++ openacs-4/packages/simulation/www/yellow-pages.tcl 30 Nov 2004 21:09:03 -0000 1.2
@@ -6,7 +6,12 @@
parent_id:optional
{orderby "title,asc"}
{type:optional}
+ yp_orderby:optional
}
+if { ![exists_and_not_null yp_orderby] } {
+ set yp_orderby 0
+}
+
set page_title "Yellow Pages"
set context [list $page_title]
Index: openacs-4/packages/simulation/www/citybuild/index.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/simulation/www/citybuild/index.adp,v
diff -u -r1.7 -r1.8
--- openacs-4/packages/simulation/www/citybuild/index.adp 20 Apr 2004 21:12:24 -0000 1.7
+++ openacs-4/packages/simulation/www/citybuild/index.adp 30 Nov 2004 21:09:03 -0000 1.8
@@ -2,6 +2,8 @@
@page_title;noquote@
@context;noquote@
+
+
Index: openacs-4/packages/simulation/www/citybuild/index.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/simulation/www/citybuild/index.tcl,v
diff -u -r1.6 -r1.7
--- openacs-4/packages/simulation/www/citybuild/index.tcl 30 Jan 2004 09:34:05 -0000 1.6
+++ openacs-4/packages/simulation/www/citybuild/index.tcl 30 Nov 2004 21:09:03 -0000 1.7
@@ -11,7 +11,10 @@
set page_title "CityBuild"
set context [list $page_title]
set package_id [ad_conn package_id]
+set package_url [ad_conn package_url]
+set help_url "${package_url}object/[parameter::get -package_id $package_id -parameter CityBuildHelpFile]"
+
permission::require_permission -object_id $package_id -privilege sim_object_create
set admin_p [permission::permission_p -object_id $package_id -privilege admin]
Index: openacs-4/packages/simulation/www/citybuild/map.xml
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/simulation/www/citybuild/map.xml,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/simulation/www/citybuild/map.xml 30 Nov 2004 21:09:03 -0000 1.1
@@ -0,0 +1,612 @@
+
+
+
+ sd001
+ Achterhaven
+ http://rocs.uvt.nl/simulation/object/sd-001
+ images/th_sd001.jpg
+ De Achterhaven is een van de drie oude havens van Sieberdam.
+
+
+ sd002
+ Antex uitzendbureau
+ http://rocs.uvt.nl/simulation/object/sd-002
+ images/th_sd002.jpg
+ Antex heeft zich in de loop der tijd gespecialiseerd in dienstverlenende beroepen.
+
+
+ sd003
+ Apotheek Sieberdam
+ http://rocs.uvt.nl/simulation/object/sd-003
+ images/th_sd003.jpg
+ De oude apotheek van Sieberdam is in 1932 geheel uitgebrand. Sindsdien is zij in Middelberg gevestigd.
+
+
+ sd004
+ Artsenpraktijk NGF
+ http://rocs.uvt.nl/simulation/object/sd-004
+ images/th_sd004.jpg
+ Artsenpraktijk NGF is een recente samenvoeging van enkele bestaande huisartsenpraktijken.
+
+
+ sd005
+ Bakker Bas
+ http://rocs.uvt.nl/simulation/object/sd-005
+ images/th_sd005.jpg
+ Al sinds de middeleeuwen zit de bakkerij in de oude stad. Er wordt nog elke nacht brood gebakken.
+
+
+ sd006
+ Basisschool Amalia
+ http://rocs.uvt.nl/simulation/object/sd-006
+ images/th_sd006.jpg
+ De basisschool Amalia opende in 1978 haar deuren. De laatste jaren is er steevast een wachtlijst.
+
+
+ sd007
+ Bastion Hotel
+ http://rocs.uvt.nl/simulation/object/sd-007
+ images/th_sd007.jpg
+ Bastion Hotel Sieberdam is onderdeel van de gelijknamige keten. Open sinds 1998.
+
+
+ sd008
+ Begraafplaats Sieberhof
+ http://rocs.uvt.nl/simulation/object/sd-008
+ images/th_sd008.jpg
+ Begraafplaats Middelberg is gelegen op de plek waar reeds in de Romeinse tijd begraven werd.
+
+
+ sd009
+ Bibliotheek Sieberdam
+ http://rocs.uvt.nl/simulation/object/sd-009
+ images/th_sd009.jpg
+ De bibliotheek van Sieberdam heeft een duidelijke streekfunctie. Multimedia zijn er sterk in opkomst.
+
+
+ sd010
+ Brandweer
+ http://rocs.uvt.nl/simulation/object/sd-010
+ images/th_sd010.jpg
+ De brandweer prijst zich gelukkig met nieuw materiaal en enthousiaste vrijwilligers. Ingesteld in 1867!
+
+
+ sd011
+ Buikstra cargadoorsbedrijf
+ http://rocs.uvt.nl/simulation/object/sd-011
+ images/th_sd011.jpg
+ Cargadoorsbedrijf Buikstra is onderdeel van Sieberdam als Regionaal Overslag Centrum.
+
+
+ sd012
+ Buitenhaven
+ http://rocs.uvt.nl/simulation/object/sd-012
+ images/th_sd012.jpg
+ De Buitenhaven is een van de drie nieuwe havens, tot stand gekomen nadat de bruggen gebouwd waren.
+
+
+ sd013
+ Cafe Beukers
+ http://rocs.uvt.nl/simulation/object/sd-013
+ images/th_sd013.jpg
+ Cafe Beukers is vanouds de verzamelplaats van de Sieberdamse kunst-scene en vrije beroepers.
+
+
+ sd014
+ Cafe Locus
+ http://rocs.uvt.nl/simulation/object/sd-014
+ images/th_sd014.jpg
+ Cafe Locus is bekend om zijn volks karakter, dat versterkt wordt door de ''volkse"" (zang)activiteiten.
+
+
+ sd015
+ Cafe-restaurant 't Oude Raedthuys
+ http://rocs.uvt.nl/simulation/object/sd-015
+ images/th_sd015.jpg
+ t Oude Raedhuys is trots op haar oorsprong als middeleeuwse herberg, welke uitstraling het koestert.
+
+
+ sd016
+ Cash & co gerechtsdeurwaarder
+ http://rocs.uvt.nl/simulation/object/sd-016
+ images/th_sd016.jpg
+ Onze klanten staan centraal. Ons motto: maximaal resultaat tegen een redelijke prijs.
+
+
+ sd017
+ Catharina College
+ http://rocs.uvt.nl/simulation/object/sd-017
+ images/th_sd017.jpg
+ Het Catharina College is de middelbare scholengemeenschap van Sieberdam.
+
+
+ sd018
+ Copyshop NORP
+ http://rocs.uvt.nl/simulation/object/sd-018
+ images/th_sd018.jpg
+ Copyshop NORP staat voor NoRePro. Daarmee slaan we de creatieve spijker van ons vak op de kop.
+
+
+ sd019
+ De oude fabriek
+ http://rocs.uvt.nl/simulation/object/sd-019
+ images/th_sd019.jpg
+ De locatie van deze voormalige textielfabriek wordt de laatste jaren herontwikkeld
+
+
+ sd020
+ De Stalhof factory outlet
+ http://rocs.uvt.nl/simulation/object/sd-020
+ images/th_sd020.jpg
+ Voor een brede range aan originele producten bent u hier tientallen procenten goedkoper uit.
+
+
+ sd021
+ De Vries makelaardij
+ http://rocs.uvt.nl/simulation/object/sd-021
+ images/th_sd021.jpg
+ De Vries Makelaardij is een veelzijdig makelaarskantoor. U bent welkom in een van de vier kantoren.
+
+
+ sd022
+ De Waag
+ http://rocs.uvt.nl/simulation/object/sd-022
+ images/th_sd022.jpg
+ Volgens de overlevering is De Waag opgericht door Schotse kooplui in de 16e eeuw.
+
+
+ sd023
+ Discotheek Breakout
+ http://rocs.uvt.nl/simulation/object/sd-023
+ images/th_sd023.jpg
+ Breakout is iedere zaterdagavond geopend en ook voor speciale evenementen. Kijk op onze E-pages.
+
+
+ sd024
+ DMM inspectiediensten
+ http://rocs.uvt.nl/simulation/object/sd-024
+ images/th_sd024.jpg
+ Al meer dan 65 jaar is DMM actief met inspectiemethoden en andere gespecialiseerde diensten.
+
+
+ sd025
+ ENSIE energiebedrijf
+ http://rocs.uvt.nl/simulation/object/sd-025
+ images/th_sd025.jpg
+ De ENSIE is een gerenommeerd en betrouwbare partner van haar afnemers. Comfort thuis en in bedrijf.
+
+
+ sd026
+ Gezondheidscentrum Siedok
+ http://rocs.uvt.nl/simulation/object/sd-026
+ images/th_sd026.jpg
+ Gezondheidscentrum SieDok omvat een artsenpraktijk, fysiotherapeuten en maatschappelijk werk.
+
+
+ sd027
+ Global Inc
+ http://rocs.uvt.nl/simulation/object/sd-027
+ images/th_sd027.jpg
+ Global Inc. is de eerste multinational in Sieberdam. ICT en ruimtevaart zijn haar kernactiviteiten.
+
+
+ sd028
+ Groentenboer Boorn
+ http://rocs.uvt.nl/simulation/object/sd-028
+ images/th_sd028.jpg
+ Al 22 jaar lang is familiebedrijf Boorn de groentenboer van heel Sieberdam.
+
+
+ sd029
+ Historisch Museum
+ http://rocs.uvt.nl/simulation/object/sd-029
+ images/th_sd029.jpg
+ In 1996 ging het Historisch Museum Sieberdam open voor het publiek.
+
+
+ sd030
+ Hoek Vastgoed BV
+ http://rocs.uvt.nl/simulation/object/sd-030
+ images/th_sd030.jpg
+ Hoek Vastgoed BV is geopend maandag t/m vrijdag van 09.00 tot 17.00 uur en zaterdag tot 14.00 uur.
+
+
+ sd031
+ Hotel 't Wapen van Sielre
+ http://rocs.uvt.nl/simulation/object/sd-031
+ images/th_sd031.jpg
+ t Wapen van Sielre is ouder dan Sieberdam zelf. Nu met een online reserverings-systeem.
+
+
+ sd032
+ Industriegebied Alfa
+ http://rocs.uvt.nl/simulation/object/sd-032
+ images/th_sd032.jpg
+ Industrieterrein Alfa is de perfecte plaats voor bedrijven die ruimte en bereikbaarheid wensen.
+
+
+ sd033
+ Kraakpand Bezet
+ http://rocs.uvt.nl/simulation/object/sd-033
+ images/th_sd033.jpg
+ Kraakpand bezet is een uiting van zo'n 80 woningzoekenden die geen hotel willen maar een huis.
+
+
+ sd034
+ Laapers ziekenhuis
+ http://rocs.uvt.nl/simulation/object/sd-034
+ images/th_sd034.jpg
+ Het Laapersziekenhuis heeft een streekfunctie. Vrijwel alle specialismen zijn aanwezig.
+
+
+ sd035
+ LIG coffeeshop
+ http://rocs.uvt.nl/simulation/object/sd-035
+ images/th_sd035.jpg
+ De beste weed langs de IJssel. Ook voor uw smartproducten en uw growshop.
+
+
+ sd036
+ Lincoln garage
+ http://rocs.uvt.nl/simulation/object/sd-036
+ images/th_sd036.jpg
+ Merkgarage Lincoln specialiseert zich in in Amerikaanse auto's, die wij zelf importeren.
+
+
+ sd037
+ McDonalds
+ http://rocs.uvt.nl/simulation/object/sd-037
+ images/th_sd037.jpg
+ I'm lovin it brengt de lifestyle van onze gasten in contact met McDonalds.
+
+
+ sd038
+ Mevlana Moskee
+ http://rocs.uvt.nl/simulation/object/sd-038
+ images/th_sd038.jpg
+ Moslims in Sieberdam hebben sinds oktober 2001 een nieuwe moskee: de Mevlana Moskee.
+
+
+ sd039
+ MKB Sieberdam
+ http://rocs.uvt.nl/simulation/object/sd-039
+ images/th_sd039.jpg
+ De regionale MKB-organisatie is een belangrijke gesprekspartner op lokaal en regionaal terrein.
+
+
+ sd040
+ Molen Voorspoed
+ http://rocs.uvt.nl/simulation/object/sd-040
+ images/th_sd040.jpg
+ Deze ronde stenen stellingmolen heeft zijn huidige vorm sinds 1711.
+
+
+ sd041
+ Nieuwe Industriehaven
+ http://rocs.uvt.nl/simulation/object/sd-041
+ images/th_sd041.jpg
+ De Nieuwe Industriehaven is de middelste van de drie nieuwe havens, buiten de bruggen.
+
+
+ sd042
+ Nieuwe Kerk
+ http://rocs.uvt.nl/simulation/object/sd-042
+ images/th_sd042.jpg
+ In de nieuwe kerk vindt u de Christelijke Gereformeerde Kerk van Sieberdam.
+
+
+ sd043
+ Notaris Koers
+ http://rocs.uvt.nl/simulation/object/sd-043
+ images/th_sd043.jpg
+ Koers heeft ervaring met en kennis van nagenoeg alle rechtsgebieden.
+
+
+ sd044
+ NS station Sieberdam
+ http://rocs.uvt.nl/simulation/object/sd-044
+ images/th_sd044.jpg
+ Het NS station Sieberdam staat op de lijst van nieuwbouw-stations van de NS - naar verwachting 2008.
+
+
+ sd045
+ Oude Kerk
+ http://rocs.uvt.nl/simulation/object/sd-045
+ images/th_sd045.jpg
+ Kerkdienst elke zondagochtend om 10.00 uur, waarna ontmoeting en gespreksmogelijkheid, met koffie.
+
+
+ sd046
+ Oude Kerk
+ http://rocs.uvt.nl/simulation/object/sd-046
+ images/th_sd046.jpg
+ Kerkdienst elke zondagochtend om 10.00 uur, waarna ontmoeting en gespreksmogelijkheid, met koffie.
+
+
+ sd047
+ Oude spoorbrug
+ http://rocs.uvt.nl/simulation/object/sd-047
+ images/th_sd047.jpg
+ De oude spoorbrug is ingrijpend gereconstrueerd, waarbij een fietspad is toegevoegd.
+
+
+ sd048
+ Overslagbedrijf SCT
+ http://rocs.uvt.nl/simulation/object/sd-048
+ images/th_sd048.jpg
+ SCT bv is gecertificeerd voor HACCP, GMP, Minas- en Japanstandaard.
+
+
+ sd049
+ Penitentiaire inrichting IJsselstein
+ http://rocs.uvt.nl/simulation/object/sd-049
+ images/th_sd049.jpg
+ De Penitentiaire Inrichting IJsselstein maakt deel uit van de DJI van het Ministerie van Justitie.
+
+
+ sd050
+ Peters Mediation
+ http://rocs.uvt.nl/simulation/object/sd-050
+ images/th_sd050.jpg
+ Peters Mediation lost het op. NMI erkend mediator.
+
+
+ sd051
+ Gerechtsgebouw Sieberdam
+ http://rocs.uvt.nl/simulation/object/sd-051
+ images/th_sd051.jpg
+ De zittingen in het gerechtsgebouw zijn openbaar. Melden bij de informatiebalie.
+
+
+ sd052
+ SC Sieberdam
+ http://rocs.uvt.nl/simulation/object/sd-052
+ images/th_sd052.jpg
+ SC Sieberdam houdt al generaties Sieberdammers in beweging. Voetbal is meer dan gezondheid.
+
+
+ sd053
+ Sieber Gazette
+ http://rocs.uvt.nl/simulation/object/sd-053
+ images/th_sd053.jpg
+ De Sieber Gazette behoort tot de oudste kranten van Nederland. Haar eerste statuut gaat terug tot 1824.
+
+
+ sd054
+ Sieberdam Beton Groep
+ http://rocs.uvt.nl/simulation/object/sd-054
+ images/th_sd054.jpg
+ De Sieberdam Beton Groep is een erkend hoofdaannemer voor de publieke en de private sector.
+
+
+ sd055
+ Sieberdam Golf Club
+ http://rocs.uvt.nl/simulation/object/sd-055
+ images/th_sd055.jpg
+ De Sieberdam Golfclub is een rustige jonge baan. De club telt inmiddels meer dan 300 leden.
+
+
+ sd056
+ Sieberdam Shipyards
+ http://rocs.uvt.nl/simulation/object/sd-056
+ images/th_sd056.jpg
+ Sieberdam Ship Yards: nieuwbouw, onderhoud, reparatie en andere vormen van dienstverlening.
+
+
+ sd057
+ Sieberlande VINEX locatie
+ http://rocs.uvt.nl/simulation/object/sd-057
+ images/th_sd057.jpg
+ Vinex locatie Sieberlande biedt plaats aan 4000 woningen, in deelplannen met elk een eigen karakter.
+
+
+ sd058
+ Sielrezand vereniging
+ http://rocs.uvt.nl/simulation/object/sd-058
+ images/th_sd058.jpg
+ Sielrezand is een natuurgebied in ontwikkeling. Contact: Vereniging ter behoud van Sielrezand.
+
+
+ sd059
+ Slagerij Slots
+ http://rocs.uvt.nl/simulation/object/sd-059
+ images/th_sd059.jpg
+ Slagerij Slots is een familiebedrijf, dat in 2003 van vader op dochter is overgegaan.
+
+
+ sd060
+ Sloopbedrijf De Haas & dochters
+ http://rocs.uvt.nl/simulation/object/sd-060
+ images/th_sd060.jpg
+ Sloopbedrijf De Haas en Dochters - asbestverwijdering, renovatie-, sloop-, grond-, riool- en straatwerk.
+
+
+ sd061
+ Sportfondsenbad Sieberberg
+ http://rocs.uvt.nl/simulation/object/sd-061
+ images/th_sd061.jpg
+ Het sportfondsenbad met veel zwemplezier voor elke doelgroep. Met binnenbad in de Sieberberg.
+
+
+ sd062
+ Stad Sieberdam Verzekeringen
+ http://rocs.uvt.nl/simulation/object/sd-062
+ images/th_sd062.jpg
+ Stad Sieberdam Verzekeringen is een middelgrote verzekeraar, landelijk opererend vanuit Zoetermeer.
+
+
+ sd063
+ Stadhuis
+ http://rocs.uvt.nl/simulation/object/sd-063
+ images/th_sd063.jpg
+ Het gemeentehuis aan de Lapersweg 2-20 is elke dag voor het publiek geopend van 09.00 - 17.00 uur.
+
+
+ sd064
+ Stadspark De Plantage
+ http://rocs.uvt.nl/simulation/object/sd-064
+ images/th_sd064.jpg
+ Stadspark De Plantage is onderdeel van de 'groene long' van Sieberdam. Het is er goed toeven.
+
+
+ sd065
+ Supermarkt De Hemel
+ http://rocs.uvt.nl/simulation/object/sd-065
+ images/th_sd065.jpg
+ Supermarkt De Hemel: een goed en supervoordeling winkelaanbod. Lage dagprijzen - weekaanbiedingen.
+
+
+ sd066
+ SV architecten
+ http://rocs.uvt.nl/simulation/object/sd-066
+ images/th_sd066.jpg
+ Architectenbureau Siebervisie is een volwaardige partner in uw bouwproces.
+
+
+ sd067
+ Tankstation Di-namo
+ http://rocs.uvt.nl/simulation/object/sd-067
+ images/th_sd067.jpg
+ Tankstation DI-namo - shop, carwash, handwash, Bart's Bakerstreet, 24-uurs buitenpaal.
+
+
+ sd068
+ Uitvaartcentrum Sieberdam
+ http://rocs.uvt.nl/simulation/object/sd-068
+ images/th_sd068.jpg
+ Het uitvaartcentrum Sieberdam verzorgt al jaren begrafenissen en crematies.
+
+
+ sd069
+ Veilinghuis Van der Hijden
+ http://rocs.uvt.nl/simulation/object/sd-069
+ images/th_sd069.jpg
+ Veilinghuis Van der Hijden - reeds dertig jaar een vaste waarde in het Nederlands veilinglandschap.
+
+
+ sd070
+ Verkeersbrug
+ http://rocs.uvt.nl/simulation/object/sd-070
+ images/th_sd070.jpg
+ De verkeersbrug is geruime tijd na de Oude Spoorbrug aangelegd als vaste oeververbinding.
+
+
+ sd071
+ Vervoerbedrijf Travel
+ http://rocs.uvt.nl/simulation/object/sd-071
+ images/th_sd071.jpg
+ Vervoerbedrijf Travel heeft sinds 1921 ervaring en know-how met elk gewenst vervoer.
+
+
+ sd072
+ Volkspark
+ http://rocs.uvt.nl/simulation/object/sd-072
+ images/th_sd072.jpg
+ Het Volkspark is meer dan 60 jaar geleden aangelegd. De parkvijver dateert uit 1989.
+
+
+ sd073
+ Volkstuinvereniging DANIG
+ http://rocs.uvt.nl/simulation/object/sd-073
+ images/th_sd073.jpg
+ Volkstuinvereniging Door Arbeid Noest In 't Groen biedt velen een waar buitenleven.
+
+
+ sd074
+ Voorhaven
+ http://rocs.uvt.nl/simulation/object/sd-074
+ images/th_sd074.jpg
+ De Voorhaven is een van de drie oude havens van Sieberdam.
+
+
+ sd075
+ Watch Out beveiliging
+ http://rocs.uvt.nl/simulation/object/sd-075
+ images/th_sd075.jpg
+ Beveiligingsbedrijf Watch Out kiest voor een no-nonsense benadering bij uitvoering en risicoanalyse.
+
+
+ sd076
+ Winkeliersvereniging Sieberdam
+ http://rocs.uvt.nl/simulation/object/sd-076
+ images/th_sd076.jpg
+ De Winkeliersvereniging Sieberdam is opgericht op 1 januari 1884.
+
+
+ sd077
+ Woningbouwvereniging EMM
+ http://rocs.uvt.nl/simulation/object/sd-077
+ images/th_sd077.jpg
+ EMM is een woningbouwvereniging met bijna 2600 woningen. In 2002 behaalde zij het KWH-huurlabel.
+
+
+ sd078
+ Woningbouwvereniging Sielrebouw
+ http://rocs.uvt.nl/simulation/object/sd-078
+ images/th_sd078.jpg
+ Woningbouwvereniging Sielrebouw legt zich toe op grootschalige renovatieprojecten.
+
+
+ sd079
+ Woonwagenkamp Sjaanie
+ http://rocs.uvt.nl/simulation/object/sd-079
+ images/th_sd079.jpg
+ Woonwagenkamp Sjaanie was sinds 1961 gevestigd op het terrein van de Oude Fabriek.
+
+
+ sd080
+ Zalmhaven
+ http://rocs.uvt.nl/simulation/object/sd-080
+ images/th_sd080.jpg
+ De Zalmhaven is een van de drie oude havens van Sieberdam. Het is thans de jachthaven.
+
+
+ sd081
+ Zoon & Zonen aannemersbedrijf
+ http://rocs.uvt.nl/simulation/object/sd-081
+ images/th_sd081.jpg
+ Op aannemersbedrijf Zoon & Zonen kunt u bouwen. Gespecialiseerd in vrije sector woningen.
+
+
+ sd082
+ De Dokken
+ http://rocs.uvt.nl/simulation/object/sd-082
+ images/th_sd082.jpg
+ In De Dokken wordt de oude havens van Sieberdam nieuw leven in geblazen met bewoning en recreatie.
+
+
+ sd083
+ Laaperspoort
+ http://rocs.uvt.nl/simulation/object/sd-083
+ images/th_sd083.jpg
+ De Laaperspoort is een van de toegangspoorten tot een oude stad.
+
+
+ sd084
+ Sieberpark stadion
+ http://rocs.uvt.nl/simulation/object/sd-084
+ images/th_sd084.jpg
+ Het Sieberpark stadion is op 31 juli 2000 officieel geopend. SEC Sieberdam speelt er Hoofdklasse A.
+
+
+ sd085
+ Speeltuin Het Torentje
+ http://rocs.uvt.nl/simulation/object/sd-085
+ images/th_sd085.jpg
+ Speeltuin Het Torentje - al 33 jaar speelplezier voor jong en oud.
+
+
+ sd086
+ Spoorhaven
+ http://rocs.uvt.nl/simulation/object/sd-086
+ images/th_sd086.jpg
+ De Spoorhaven is de grootste van de drie nieuwe havens, buiten de bruggen. De Sieberwerf ligt er aan.
+
+
+ sd087
+ Standbeeld
+ http://rocs.uvt.nl/simulation/object/sd-087
+ images/th_sd087.jpg
+ Het standbeeld van de Griekse koopman Solomon verwijst naar het Hanze-verleden van de stad.
+
+
Index: openacs-4/packages/simulation/www/citybuild/object-edit.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/simulation/www/citybuild/object-edit.tcl,v
diff -u -r1.24 -r1.25
--- openacs-4/packages/simulation/www/citybuild/object-edit.tcl 1 Mar 2004 11:06:52 -0000 1.24
+++ openacs-4/packages/simulation/www/citybuild/object-edit.tcl 30 Nov 2004 21:09:03 -0000 1.25
@@ -556,6 +556,10 @@
lappend attributes [list $attribute_name $value]
}
+ if { [exists_and_not_null content_file] && ![simulation::ui::forms::document_upload::check_mime -document_file $content_file] } {
+ simulation::ui::forms::document_upload::add_mime -document_file $content_file
+ }
+
} -new_data {
# TODO B: For now, assume we are always using this to create global objects -- LARS: Not sure what to do on this
Index: openacs-4/packages/simulation/www/resources/under-construction.css
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/simulation/www/resources/under-construction.css,v
diff -u -r1.3 -r1.4
--- openacs-4/packages/simulation/www/resources/under-construction.css 17 Oct 2003 11:11:25 -0000 1.3
+++ openacs-4/packages/simulation/www/resources/under-construction.css 30 Nov 2004 21:09:15 -0000 1.4
@@ -4,3 +4,10 @@
.notloggedin {
background-color: silver;
}
+
+.help-link {
+ float: right;
+ clear: none;
+ margin-left: -200px;
+ margin-top: -30px;
+}
\ No newline at end of file
Index: openacs-4/packages/simulation/www/simbuild/index.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/simulation/www/simbuild/index.adp,v
diff -u -r1.3 -r1.4
--- openacs-4/packages/simulation/www/simbuild/index.adp 11 Dec 2003 13:21:53 -0000 1.3
+++ openacs-4/packages/simulation/www/simbuild/index.adp 30 Nov 2004 21:09:16 -0000 1.4
@@ -2,4 +2,11 @@
@page_title;noquote@
@context;noquote@
+
+
+
+
+
+
+
Index: openacs-4/packages/simulation/www/simbuild/index.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/simulation/www/simbuild/index.tcl,v
diff -u -r1.3 -r1.4
--- openacs-4/packages/simulation/www/simbuild/index.tcl 2 Dec 2003 17:24:32 -0000 1.3
+++ openacs-4/packages/simulation/www/simbuild/index.tcl 30 Nov 2004 21:09:16 -0000 1.4
@@ -1,9 +1,17 @@
ad_page_contract {
List workflows designated as templates (but not simulations or cases) in this package.
+} {
+ sb_orderby:optional
}
+if { ![exists_and_not_null sb_orderby] } {
+ set sb_orderby 0
+}
+
set page_title "SimBuild"
set context [list $page_title]
set package_id [ad_conn package_id]
+set package_url [ad_conn package_url]
+set help_url "${package_url}object/[parameter::get -package_id $package_id -parameter SimBuildHelpFile]"
permission::require_permission -object_id $package_id -privilege sim_template_read
Index: openacs-4/packages/simulation/www/simbuild/role-delete.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/simulation/www/simbuild/role-delete.adp,v
diff -u -r1.3 -r1.4
--- openacs-4/packages/simulation/www/simbuild/role-delete.adp 20 Apr 2004 21:12:25 -0000 1.3
+++ openacs-4/packages/simulation/www/simbuild/role-delete.adp 30 Nov 2004 21:09:16 -0000 1.4
@@ -2,7 +2,7 @@
@page_title;noquote@
@context;noquote@
-#simulation.lt_name_has_dependent_ta#
+
#simulation.lt_name_has_dependent_ta#
#simulation.Related_Tasks#
Index: openacs-4/packages/simulation/www/simbuild/role-delete.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/simulation/www/simbuild/role-delete.tcl,v
diff -u -r1.4 -r1.5
--- openacs-4/packages/simulation/www/simbuild/role-delete.tcl 23 Jan 2004 11:16:15 -0000 1.4
+++ openacs-4/packages/simulation/www/simbuild/role-delete.tcl 30 Nov 2004 21:09:16 -0000 1.5
@@ -10,12 +10,21 @@
}
set package_id [ad_conn package_id]
-set num_of_tasks [db_string task_count "
-select count(*)
+
+set tasks [db_list tasks "
+select action_id
from workflow_actions wa
where wa.assigned_role = :role_id
+union
+select task_id as action_id
+ from sim_task_recipients
+ where recipient = :role_id
"
]
+
+set num_of_tasks [llength $tasks]
+
+
workflow::role::get -role_id $role_id -array role_array
set name $role_array(pretty_name)
set workflow_id $role_array(workflow_id)
@@ -26,8 +35,21 @@
if { [template::util::is_true $confirm_p] || $num_of_tasks == 0 } {
permission::require_write_permission -object_id $workflow_id
+
+ # confirm_p is true and we have tasks
+ if { $num_of_tasks > 0 } {
+ foreach task $tasks {
+ simulation::action::edit -operation delete -action_id $task
+ }
+ }
+
simulation::role::edit -operation "delete" -role_id $role_id
- ad_returnredirect $return_url
+
+ # Let's mark this template edited
+ set sim_type "dev_template"
+
+ ad_returnredirect [export_vars -base "template-sim-type-update" { workflow_id sim_type return_url }]
+
}
workflow::get -workflow_id $workflow_id -array sim_template_array
Index: openacs-4/packages/simulation/www/simbuild/role-edit.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/simulation/www/simbuild/role-edit.tcl,v
diff -u -r1.7 -r1.8
--- openacs-4/packages/simulation/www/simbuild/role-edit.tcl 16 Dec 2003 18:34:00 -0000 1.7
+++ openacs-4/packages/simulation/www/simbuild/role-edit.tcl 30 Nov 2004 21:09:16 -0000 1.8
@@ -58,7 +58,8 @@
set page_title "Edit Role template $pretty_name"
set context [list [list "." "Sim Templates"] [list "template-edit?workflow_id=$workflow_id" "$sim_template_array(pretty_name)"] $page_title]
-} -new_request {
+} -cancel_url [export_vars -base "template-edit" { workflow_id }] \
+-new_request {
permission::require_write_permission -object_id $workflow_id
workflow::get -workflow_id $workflow_id -array sim_template_array
set page_title "Add Role to $sim_template_array(pretty_name)"
@@ -87,7 +88,10 @@
-workflow_id $workflow_id \
-array row]
- ad_returnredirect [export_vars -base "template-edit" { workflow_id }]
+ # Let's mark this template edited
+ set sim_type "dev_template"
+
+ ad_returnredirect [export_vars -base "template-sim-type-update" { workflow_id sim_type }]
ad_script_abort
}
Index: openacs-4/packages/simulation/www/simbuild/state-delete.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/simulation/www/simbuild/state-delete.adp,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/simulation/www/simbuild/state-delete.adp 30 Nov 2004 21:09:16 -0000 1.1
@@ -0,0 +1,19 @@
+
+ @page_title;noquote@
+ @context;noquote@
+
+@name@ #simulation.lt_has_dependent_tasks_s#
+
+#simulation.Related_Tasks#
+
+
+
+
+ » #simulation.lt_Delete_name_and_tasks#
+
+
+
+ » #simulation.Cancel#
+
+
+
Index: openacs-4/packages/simulation/www/simbuild/state-delete.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/simulation/www/simbuild/state-delete.tcl,v
diff -u -r1.1 -r1.2
--- openacs-4/packages/simulation/www/simbuild/state-delete.tcl 16 Dec 2003 18:34:00 -0000 1.1
+++ openacs-4/packages/simulation/www/simbuild/state-delete.tcl 30 Nov 2004 21:09:16 -0000 1.2
@@ -2,15 +2,71 @@
Delete a state
} {
+ {confirm_p:boolean "f"}
state_id:integer
{return_url ""}
}
+set package_id [ad_conn package_id]
+
set workflow_id [workflow::state::fsm::get_element -state_id $state_id -element workflow_id]
-permission::require_write_permission -object_id $workflow_id
-workflow::state::fsm::edit -operation "delete" -state_id $state_id
+workflow::state::fsm::get -state_id $state_id -array state_array
+
+set name $state_array(pretty_name)
+set workflow_id $state_array(workflow_id)
+
+set tasks [db_list enabled_tasks "
+select action_id
+from workflow_fsm_action_en_in_st wfa,
+ workflow_fsm_states wfs
+where wfa.state_id = wfs.state_id
+ and wfs.state_id = :state_id
+ and wfs.workflow_id = :workflow_id
+"
+ ]
+
+set tasks [concat $tasks [db_list next_state_tasks "
+select wa.action_id
+from workflow_fsm_actions wfa,
+ workflow_actions wa
+where wa.action_id = wfa.action_id
+ and wfa.new_state = :state_id
+ and wa.workflow_id = :workflow_id
+"
+ ]
+ ]
+
+set num_of_tasks [llength $tasks]
+
if { [empty_string_p $return_url] } {
set return_url [export_vars -base template-edit { workflow_id }]
}
-ad_returnredirect $return_url
+
+if { [template::util::is_true $confirm_p] || $num_of_tasks == 0 } {
+ permission::require_write_permission -object_id $workflow_id
+
+ # confirm_p is true and we have tasks
+ if { $num_of_tasks > 0 } {
+ foreach task $tasks {
+ simulation::action::edit -operation delete -action_id $task
+ }
+ }
+
+ workflow::state::fsm::edit -operation "delete" -state_id $state_id
+
+ # Let's mark this template edited
+ set sim_type "dev_template"
+
+ ad_returnredirect [export_vars -base "template-sim-type-update" { workflow_id sim_type return_url }]
+
+}
+
+
+workflow::get -workflow_id $workflow_id -array sim_template_array
+
+set page_title "Delete $name"
+set context [list [list "." "Sim Templates"] [list "template-edit?workflow_id=$workflow_id" "$sim_template_array(pretty_name)"] $page_title]
+
+set delete_url [export_vars -base [ad_conn url] { state_id return_url { confirm_p 1 } }]
+set cancel_url $return_url
\ No newline at end of file
Index: openacs-4/packages/simulation/www/simbuild/state-edit.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/simulation/www/simbuild/state-edit.tcl,v
diff -u -r1.5 -r1.6
--- openacs-4/packages/simulation/www/simbuild/state-edit.tcl 26 Jan 2004 12:34:47 -0000 1.5
+++ openacs-4/packages/simulation/www/simbuild/state-edit.tcl 30 Nov 2004 21:09:16 -0000 1.6
@@ -34,6 +34,12 @@
workflow::get -workflow_id $workflow_id -array sim_template_array
+
+if { ![exists_and_not_null return_url] } {
+ set return_url [export_vars -base "template-edit" { workflow_id }]
+}
+
+
if { ![ad_form_new_p -key state_id] } {
set page_title "Edit State $state_array(pretty_name)"
} else {
@@ -63,7 +69,8 @@
ad_form \
-name state \
- -edit_buttons [list [list [ad_decode [ad_form_new_p -key state_id] 1 [_ acs-kernel.common_add] [_ acs-kernel.common_edit]] ok]] \
+ -cancel_url $return_url \
+ -edit_buttons [list [list [ad_decode [ad_form_new_p -key state_id] 1 [_ acs-kernel.common_OK] [_ acs-kernel.common_OK]] ok]] \
-export { return_url } \
-form {
{state_id:key}
@@ -74,7 +81,7 @@
{parent_action_id:integer(select)
{label "Parent task"}
{mode display}
- {options {[workflow::action::get_options -workflow_id $workflow_id]}}
+ {options {[workflow::action::get_options -all=1 -workflow_id $workflow_id]}}
}
}
} else {
@@ -133,9 +140,10 @@
-workflow_id $workflow_id \
-array row]
- if { ![exists_and_not_null return_url] } {
- set return_url [export_vars -base "template-edit" { workflow_id }]
- }
- ad_returnredirect $return_url
+ # Let's mark this template edited
+ set sim_type "dev_template"
+
+ ad_returnredirect [export_vars -base "template-sim-type-update" { workflow_id sim_type return_url }]
+
ad_script_abort
}
Index: openacs-4/packages/simulation/www/simbuild/task-copy.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/simulation/www/simbuild/task-copy.tcl,v
diff -u -r1.1 -r1.2
--- openacs-4/packages/simulation/www/simbuild/task-copy.tcl 15 Mar 2004 17:22:19 -0000 1.1
+++ openacs-4/packages/simulation/www/simbuild/task-copy.tcl 30 Nov 2004 21:09:16 -0000 1.2
@@ -4,13 +4,23 @@
@author Peter Marklund
} {
action_id:integer
+ {workflow_id ""}
{return_url ""}
-
}
+if { ![exists_and_not_null workflow_id] } {
+ set workflow_id [workflow::action::get_element -action_id $action_id -element workflow_id]
+}
+
+permission::require_write_permission -object_id $workflow_id
+
simulation::action::clone -action_id $action_id
if { [empty_string_p $return_url] } {
set return_url [export_vars -base template-edit { workflow_id }]
}
-ad_returnredirect $return_url
+
+# Let's mark this template edited
+set sim_type "dev_template"
+
+ad_returnredirect [export_vars -base "template-sim-type-update" { workflow_id sim_type return_url }]
\ No newline at end of file
Index: openacs-4/packages/simulation/www/simbuild/task-delete.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/simulation/www/simbuild/task-delete.tcl,v
diff -u -r1.3 -r1.4
--- openacs-4/packages/simulation/www/simbuild/task-delete.tcl 16 Dec 2003 18:34:00 -0000 1.3
+++ openacs-4/packages/simulation/www/simbuild/task-delete.tcl 30 Nov 2004 21:09:16 -0000 1.4
@@ -6,11 +6,20 @@
{return_url ""}
}
-set workflow_id [workflow::action::get_element -action_id $action_id -element workflow_id]
+if { ![exists_and_not_null workflow_id] } {
+ set workflow_id [workflow::action::get_element \
+ -action_id $action_id \
+ -element workflow_id]
+}
+
permission::require_write_permission -object_id $workflow_id
simulation::action::edit -operation "delete" -action_id $action_id
if { [empty_string_p $return_url] } {
set return_url [export_vars -base template-edit { workflow_id }]
}
-ad_returnredirect $return_url
+
+# Let's mark this template edited
+set sim_type "dev_template"
+
+ad_returnredirect [export_vars -base "template-sim-type-update" { workflow_id sim_type return_url }]
\ No newline at end of file
Index: openacs-4/packages/simulation/www/simbuild/task-details.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/simulation/www/simbuild/task-details.tcl,v
diff -u -r1.1 -r1.2
--- openacs-4/packages/simulation/www/simbuild/task-details.tcl 23 Jan 2004 15:01:27 -0000 1.1
+++ openacs-4/packages/simulation/www/simbuild/task-details.tcl 30 Nov 2004 21:09:16 -0000 1.2
@@ -25,8 +25,11 @@
set page_title "Task $task_array(pretty_name)"
-set template_url [export_vars -base "template-edit" { workflow_id }]
+# Let's mark this template edited
+set sim_type "dev_template"
+set template_url [export_vars -base "template-sim-type-update" { workflow_id sim_type return_url }]
+
set context [list [list "." "SimBuild"] [list $template_url "$sim_template_array(pretty_name)"] $page_title]
if { ![empty_string_p $task_array(parent_action_id)] } {
Index: openacs-4/packages/simulation/www/simbuild/task-edit.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/simulation/www/simbuild/task-edit.tcl,v
diff -u -r1.36 -r1.37
--- openacs-4/packages/simulation/www/simbuild/task-edit.tcl 12 Mar 2004 11:02:39 -0000 1.36
+++ openacs-4/packages/simulation/www/simbuild/task-edit.tcl 30 Nov 2004 21:09:16 -0000 1.37
@@ -5,7 +5,7 @@
@cvs-id $Id$
} {
{workflow_id:integer ""}
- action_id:integer,optional
+ action_id:optional
parent_action_id:integer,optional
return_url:optional
} -validate {
@@ -60,6 +60,11 @@
set page_title "Add Task to $sim_template_array(pretty_name)"
}
+
+if { ![exists_and_not_null return_url] } {
+ set return_url [export_vars -base "template-edit" -anchor "tasks" { workflow_id }]
+}
+
set context [list [list "." "SimBuild"] [list [export_vars -base "template-edit" { workflow_id }] "$sim_template_array(pretty_name)"] $page_title]
#---------------------------------------------------------------------
@@ -100,9 +105,10 @@
ad_form \
-name task \
-export { workflow_id return_url } \
+ -cancel_url $return_url \
-edit_buttons [list \
[list \
- [ad_decode [ad_form_new_p -key action_id] 1 [_ acs-kernel.common_add] [_ acs-kernel.common_finish]] \
+ [ad_decode [ad_form_new_p -key action_id] 1 [_ acs-kernel.common_OK] [_ acs-kernel.common_OK]] \
ok]] \
-form {
{action_id:key}
@@ -114,7 +120,7 @@
{parent_action_id:integer(select)
{label "Parent task"}
{mode display}
- {options {[workflow::action::get_options -workflow_id $workflow_id]}}
+ {options {[workflow::action::get_options -all=1 -workflow_id $workflow_id]}}
}
}
} else {
@@ -181,25 +187,18 @@
switch $trigger_type {
- user - message - workflow - parallel - dynamic {
+ user - message - workflow - parallel - dynamic - time {
ad_form -extend -name task -form {
- {timeout_hours:integer(text),optional
+ {timeout_hours:float(text),optional
{label "Timeout"}
{after_html "hours"}
+ {help_text "[_ simulation.lt_Duration_in_hours_dec]"}
}
}
}
- time {
- ad_form -extend -name task -form {
- {timeout_hours:integer(text)
- {label "Timeout"}
- {after_html "hours"}
- }
- }
- }
default {
ad_form -extend -name task -form {
- {timeout_hours:integer(hidden),optional}
+ {timeout_hours:float(hidden),optional}
}
}
}
@@ -218,6 +217,16 @@
}
}
+if { [string equal $trigger_type "user"] && [string equal $task_type "message"] } {
+ ad_form -extend -name task -form {
+ {default_text:richtext,optional
+ {label "Default Message"}
+ {html {cols 60 rows 8}}
+ {help_text "Suggested message; can be edited when template is instantiated."}
+ }
+ }
+}
+
if { [string equal $trigger_type "user"] } {
ad_form -extend -name task -form {
{attachment_num:integer(text)
@@ -261,7 +270,9 @@
ad_form -extend -name task -edit_request {
set workflow_id $task_array(workflow_id)
permission::require_write_permission -object_id $workflow_id
+
set description [template::util::richtext::create $task_array(description) $task_array(description_mime_type)]
+ set default_text [template::util::richtext::create $task_array(default_text) $task_array(default_text_mime_type)]
foreach elm {
pretty_name new_state_id
@@ -273,7 +284,7 @@
set timeout_hours ""
if { ![empty_string_p $task_array(timeout_seconds)] } {
- set timeout_hours [expr $task_array(timeout_seconds) / 3600]
+ set timeout_hours [expr $task_array(timeout_seconds) / 3600.0]
}
} -new_request {
@@ -308,6 +319,11 @@
set description [template::util::richtext::get_property contents $description]
}
+ if { [info exists default_text] } {
+ set default_text_mime_type [template::util::richtext::get_property format $default_text]
+ set default_text [template::util::richtext::get_property contents $default_text]
+ }
+
switch $task_type {
message {
}
@@ -320,7 +336,7 @@
foreach elm {
pretty_name pretty_past_tense assigned_role description description_mime_type
- new_state_id
+ new_state_id default_text default_text_mime_type
recipient_roles attachment_num trigger_type parent_action_id
} {
if { [info exists $elm] } {
@@ -355,9 +371,11 @@
-action_id $action_id \
-array row]
- if { ![exists_and_not_null return_url] } {
- set return_url [export_vars -base "template-edit" -anchor "tasks" { workflow_id }]
- }
- ad_returnredirect $return_url
+
+ # Let's mark this template edited
+ set sim_type "dev_template"
+
+ ad_returnredirect [export_vars -base "template-sim-type-update" { workflow_id sim_type return_url }]
+
ad_script_abort
}
Index: openacs-4/packages/simulation/www/simbuild/task-enabled-in-state-update.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/simulation/www/simbuild/task-enabled-in-state-update.tcl,v
diff -u -r1.2 -r1.3
--- openacs-4/packages/simulation/www/simbuild/task-enabled-in-state-update.tcl 27 Jan 2004 14:53:42 -0000 1.2
+++ openacs-4/packages/simulation/www/simbuild/task-enabled-in-state-update.tcl 30 Nov 2004 21:09:16 -0000 1.3
@@ -8,18 +8,23 @@
{return_url {}}
}
+set workflow_id [workflow::action::get_element \
+ -action_id $action_id \
+ -element workflow_id]
+
+permission::require_write_permission -object_id $workflow_id
+
workflow::action::fsm::set_enabled_in_state \
-action_id $action_id \
-state_id $state_id \
-enabled=[template::util::is_true $enabled_p] \
-assigned=[template::util::is_true $assigned_p]
-if { [empty_string_p $return_url] } {
- set workflow_id [workflow::action::get_element \
- -action_id $action_id \
- -element workflow_id]
-
+if { [empty_string_p $return_url] } {
set return_url [export_vars -base template-edit { workflow_id }]
}
-ad_returnredirect $return_url
+# Let's mark this template edited
+set sim_type "dev_template"
+
+ad_returnredirect [export_vars -base "template-sim-type-update" { workflow_id sim_type return_url }]
\ No newline at end of file
Index: openacs-4/packages/simulation/www/simbuild/template-edit.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/simulation/www/simbuild/template-edit.tcl,v
diff -u -r1.22 -r1.23
--- openacs-4/packages/simulation/www/simbuild/template-edit.tcl 29 Jan 2004 14:36:39 -0000 1.22
+++ openacs-4/packages/simulation/www/simbuild/template-edit.tcl 30 Nov 2004 21:09:16 -0000 1.23
@@ -111,6 +111,12 @@
break
}
+ if { [string match $template_ready_p "t"] && ![simulation::template::check_init_p -workflow_id $workflow_id] } {
+ form set_error sim_template template_ready_p "This template or one of its subworkflows or parallel tasks is missing an initial action. You can't mark a template ready for use until you have added all required initial actions."
+ break
+
+ }
+
set description_mime_type [template::util::richtext::get_property format $description]
set description [template::util::richtext::get_property contents $description]
} -new_data {
Index: openacs-4/packages/simulation/www/simbuild/template-load.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/simulation/www/simbuild/template-load.tcl,v
diff -u -r1.3 -r1.4
--- openacs-4/packages/simulation/www/simbuild/template-load.tcl 7 Jan 2004 13:12:17 -0000 1.3
+++ openacs-4/packages/simulation/www/simbuild/template-load.tcl 30 Nov 2004 21:09:16 -0000 1.4
@@ -1,24 +1,33 @@
ad_page_contract {
Load a simulation from a spec
+} {
+ cancel_url:optional
}
+if { ![exists_and_not_null cancel_url] } {
+ set cancel_url [get_referrer]
+}
+
permission::require_permission -object_id [ad_conn package_id] -privilege sim_template_create
set page_title "Load Template"
set context [list [list "." "SimBuild"] $page_title]
-ad_form -name load -edit_buttons [list [list "Load" ok]] -form {
- {pretty_name:text
- {label "Name"}
- {html {size 50}}
- }
- {spec:text(textarea),nospell
- {label "Spec"}
- {help_text {Copy and paste the specification here. A specification is a plain-text file which can be generated when editing a template.}}
- {html {cols 80 rows 10}}
- }
+ad_form -name load \
+ -cancel_url $cancel_url \
+ -edit_buttons [list [list "Load" ok]] -form {
+ {pretty_name:text
+ {label "Name"}
+ {html {size 50}}
+ }
+ {spec:text(textarea),nospell
+ {label "Spec"}
+ {help_text {Copy and paste the specification here. A specification is a plain-text file which can be generated when editing a template.}}
+ {html {cols 80 rows 10}}
+ }
+ {cancel_url:text(hidden) }
} -on_request {
} -on_submit {
Index: openacs-4/packages/simulation/www/simbuild/template-object-reorder.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/simulation/www/simbuild/template-object-reorder.tcl,v
diff -u -r1.3 -r1.4
--- openacs-4/packages/simulation/www/simbuild/template-object-reorder.tcl 29 Jun 2004 10:17:34 -0000 1.3
+++ openacs-4/packages/simulation/www/simbuild/template-object-reorder.tcl 30 Nov 2004 21:09:16 -0000 1.4
@@ -5,6 +5,7 @@
state_id:optional
action_id:optional
role_id:optional
+ parent_action_id:optional
{direction down}
{return_url "."}
}
@@ -16,18 +17,36 @@
switch $type {
state {
set object_id $state_id
- set workflow_id [workflow::state::fsm::get_element -state_id $state_id -element workflow_id]
- set all_ids [workflow::state::fsm::get_ids -workflow_id $workflow_id]
+ set workflow_id [workflow::state::fsm::get_element \
+ -state_id $state_id -element workflow_id]
+ # Use parent_action_id if we're not on the top-level
+ if { [exists_and_not_null parent_action_id] } {
+ set all_ids [workflow::state::fsm::get_ids \
+ -workflow_id $workflow_id \
+ -parent_action_id $parent_action_id]
+ } else {
+ set all_ids [workflow::state::fsm::get_ids -workflow_id $workflow_id]
+ }
}
role {
set object_id $role_id
set workflow_id [workflow::role::get_element -role_id $role_id -element workflow_id]
+
+ # Roles are only available on a top-level workflow so we don't need the
+ # parent_action_id here
set all_ids [workflow::role::get_ids -workflow_id $workflow_id]
}
action {
set object_id $action_id
set workflow_id [workflow::action::get_element -action_id $action_id -element workflow_id]
- set all_ids [workflow::action::get_ids -workflow_id $workflow_id]
+
+ # Use parent_action_id if we're not on the top-level
+ if { [exists_and_not_null parent_action_id] } {
+ set all_ids [workflow::action::get_ids -workflow_id $workflow_id \
+ -parent_action_id $parent_action_id]
+ } else {
+ set all_ids [workflow::action::get_ids -workflow_id $workflow_id]
+ }
}
default {
error "Invalid type, $type, only implemented for 'state', 'role', and 'action'."
@@ -89,4 +108,7 @@
}
}
-ad_returnredirect $return_url
+# Let's mark this template edited
+set sim_type "dev_template"
+
+ad_returnredirect [export_vars -base "template-sim-type-update" { workflow_id sim_type return_url }]
Index: openacs-4/packages/simulation/www/simbuild/template-sim-type-update.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/simulation/www/simbuild/template-sim-type-update.tcl,v
diff -u -r1.1 -r1.2
--- openacs-4/packages/simulation/www/simbuild/template-sim-type-update.tcl 8 Jan 2004 10:50:34 -0000 1.1
+++ openacs-4/packages/simulation/www/simbuild/template-sim-type-update.tcl 30 Nov 2004 21:09:16 -0000 1.2
@@ -4,6 +4,18 @@
workflow_id:integer
{sim_type "ready_template"}
{return_url {[export_vars -base "template-edit" { workflow_id }]}}
+} -validate {
+ inits_exist -requires {workflow_id:integer} {
+ if { [string match $sim_type "ready_template"] } {
+ if { ![simulation::template::check_init_p -workflow_id $workflow_id] } {
+ ad_complain "Either the simulation template or one of its subworkflows
+ seems to be missing an initial action. Please correct this
+ before you try to mark this template ready for use.
+ Note that every subworkflow and parallel task must
+ also have its own initial action.
"
+ }
+ }
+ }
}
permission::require_write_permission -object_id $workflow_id
@@ -14,4 +26,4 @@
-workflow_id $workflow_id \
-array row
-ad_returnredirect $return_url
+ad_returnredirect $return_url
\ No newline at end of file
Index: openacs-4/packages/simulation/www/siminst/index.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/simulation/www/siminst/index.adp,v
diff -u -r1.20 -r1.21
--- openacs-4/packages/simulation/www/siminst/index.adp 20 Apr 2004 21:12:26 -0000 1.20
+++ openacs-4/packages/simulation/www/siminst/index.adp 30 Nov 2004 21:09:16 -0000 1.21
@@ -2,16 +2,21 @@
@page_title;noquote@
@context;noquote@
+
+
+#simulation.lt_New_Simulation_From_T#
+
+
#simulation.lt_Simulations_in_Develo#
-
-
#simulation.lt_Simulations_in_Castin#
+
\ No newline at end of file
Index: openacs-4/packages/simulation/www/siminst/index.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/simulation/www/siminst/index.tcl,v
diff -u -r1.33 -r1.34
--- openacs-4/packages/simulation/www/siminst/index.tcl 23 Jan 2004 14:31:36 -0000 1.33
+++ openacs-4/packages/simulation/www/siminst/index.tcl 30 Nov 2004 21:09:17 -0000 1.34
@@ -1,15 +1,21 @@
ad_page_contract {
The index page for SimInst
+} {
+ ds_orderby:optional
+ cs_orderby:optional
}
set page_title "SimInst"
set context [list $page_title]
set package_id [ad_conn package_id]
set user_id [ad_conn user_id]
+set package_uri [apm_package_url_from_id $package_id]
+set help_url "${package_uri}object/[parameter::get -package_id $package_id -parameter SimInstHelpFile]"
+
permission::require_permission -object_id $package_id -privilege sim_inst
set admin_p [permission::permission_p -object_id $package_id -privilege admin]
-set base_url [apm_package_url_from_id $package_id]
+set base_url $package_uri
#---------------------------------------------------------------------
# dev_sims: simulations in development
@@ -18,9 +24,9 @@
template::list::create \
-name dev_sims \
-multirow dev_sims \
- -actions "{New Simulation From Template} simulation-new" \
-no_data "No Simulations are in Development" \
-sub_class "narrow" \
+ -orderby_name ds_orderby \
-elements {
edit {
sub_class narrow
@@ -42,14 +48,6 @@
display_template {@dev_sims.description;noquote@}
}
- copy {
- sub_class narrow
- display_template {
-
- }
- link_url_col clone_url
- link_html { title "Clone this template" }
- }
delete {
sub_class narrow
link_url_col delete_url
@@ -93,6 +91,7 @@
and ao.object_id = w.workflow_id
and ss.sim_type = 'dev_sim'
$sim_in_dev_filter_sql
+ [template::list::orderby_clause -orderby -name "dev_sims"]
" {
set description [ad_html_text_convert -from $description_mime_type -maxlen 200 -- $description]
@@ -120,18 +119,11 @@
-name casting_sims \
-multirow casting_sims \
-no_data "No Simulations are in Casting" \
+ -orderby_name cs_orderby \
-elements {
- edit {
- sub_class narrow
- link_url_eval {[export_vars -base wizard { workflow_id }]}
- display_template {
-
- }
- }
pretty_name {
label "Simulation"
orderby upper(w.pretty_name)
- link_url_eval {[export_vars -base wizard { workflow_id }]}
}
n_users {
label "Users enrolled"
@@ -143,6 +135,7 @@
}
case_start {
label "Start date"
+ orderby case_start
}
start_now {
label "Start"
@@ -151,12 +144,6 @@
Start immediately
}
}
- copy {
- sub_class narrow
- display_template {
-
- }
- }
delete {
sub_class narrow
link_url_col delete_url
@@ -197,6 +184,7 @@
and ao.object_id = w.workflow_id
and ss.sim_type = 'casting_sim'
$sim_in_dev_filter_sql
+ [template::list::orderby_clause -orderby -name "casting_sims"]
" {
set delete_url [export_vars -base "${base_url}siminst/simulation-delete" { workflow_id }]
set start_url [export_vars -base "simulation-start" { workflow_id }]
Index: openacs-4/packages/simulation/www/siminst/map-characters.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/simulation/www/siminst/map-characters.adp,v
diff -u -r1.14 -r1.15
--- openacs-4/packages/simulation/www/siminst/map-characters.adp 20 Apr 2004 21:12:26 -0000 1.14
+++ openacs-4/packages/simulation/www/siminst/map-characters.adp 30 Nov 2004 21:09:17 -0000 1.15
@@ -1,6 +1,5 @@
#simulation.lt_Select_from_existing#
- #simulation.add_new_characters# #simulation.lt_and_refresh__this_pag#
Index: openacs-4/packages/simulation/www/siminst/map-tasks.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/simulation/www/siminst/map-tasks.tcl,v
diff -u -r1.15 -r1.16
--- openacs-4/packages/simulation/www/siminst/map-tasks.tcl 29 Jun 2004 10:17:34 -0000 1.15
+++ openacs-4/packages/simulation/www/siminst/map-tasks.tcl 30 Nov 2004 21:09:17 -0000 1.16
@@ -28,6 +28,8 @@
a.pretty_name,
a.description,
a.description_mime_type,
+ st.default_text,
+ st.default_text_mime_type,
st.attachment_num,
(select pretty_name from workflow_roles where role_id = a.assigned_role) as assigned_role_pretty
from workflow_actions a,
@@ -66,7 +68,18 @@
{html {cols 60 rows 4}} \
{section $section_name} ]]
set description_$row(action_id) [template::util::richtext::create $row(description) $row(description_mime_type)]
-
+
+ # Show default message text field if this is a message-type task
+ if { ![empty_string_p $recipient_role_pretty] } {
+ ad_form -extend -name tasks -form \
+ [list [list default_text_$row(action_id):richtext,optional \
+ {label "Task Default message"} \
+ {help_text "This is the default text that will appear in a message-type task form."} \
+ {html {cols 60 rows 4}} \
+ {section $section_name} ]]
+ set default_text_$row(action_id) [template::util::richtext::create $row(default_text) $row(default_text_mime_type)]
+ }
+
# Save attachment_num for later
ad_form -extend -name tasks -form \
[list [list attachment_num_$row(action_id):integer(hidden),optional \
@@ -79,7 +92,7 @@
}
ad_form -extend -name tasks -form \
- [list [list attachment_$row(action_id)_${i}:integer(select) \
+ [list [list attachment_$row(action_id)_${i}:integer(select),optional \
{label "Attachment $i"} \
{options $prop_options} \
{help_text "Select from existing attachments or (i.e. Started, Open, Written...)"}
{options {{"Show states" t} {"Don't show states" f}}}
}
- {stylesheet:integer(select),optional
- {label "CSS Stylesheet"}
- {options $stylesheet_options}
- }
} -on_request {
foreach elm {
@@ -60,7 +54,6 @@
enroll_start
enroll_end
show_states_p
- stylesheet
} {
set $elm $sim_template($elm)
}
@@ -167,7 +160,7 @@
}
foreach elm { send_start_note_date case_start case_end pretty_name description description_mime_type enroll_type enroll_start enroll_end
- show_states_p stylesheet } {
+ show_states_p } {
set row($elm) [set $elm]
}
Index: openacs-4/packages/simulation/www/siminst/simulation-new.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/simulation/www/siminst/simulation-new.tcl,v
diff -u -r1.6 -r1.7
--- openacs-4/packages/simulation/www/siminst/simulation-new.tcl 23 Jan 2004 13:18:43 -0000 1.6
+++ openacs-4/packages/simulation/www/siminst/simulation-new.tcl 30 Nov 2004 21:09:17 -0000 1.7
@@ -1,5 +1,7 @@
ad_page_contract {
A list of available simulation templates
+} {
+ orderby:optional
}
set page_title "New Simulation From Template"
@@ -31,6 +33,7 @@
number_of_tasks {
label "Tasks"
html { align center }
+ orderby number_of_tasks
}
map {
label ""
@@ -41,7 +44,7 @@
}
}
-db_multirow -extend {map_url} ready_templates select_ready_templates {
+db_multirow -extend {map_url} ready_templates select_ready_templates "
select workflow_id,
suggested_duration,
pretty_name,
@@ -57,7 +60,8 @@
where ss.simulation_id = w.workflow_id
and w.object_id = :package_id
and ss.sim_type = 'ready_template'
-} {
+ [template::list::orderby_clause -orderby -name "ready_templates"]
+" {
set map_url [export_vars -base "map-create" { workflow_id }]
if { [empty_string_p $suggested_duration] } {
Index: openacs-4/packages/simulation/www/simplay/case-admin-user-move.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/simulation/www/simplay/case-admin-user-move.tcl,v
diff -u -r1.3 -r1.4
--- openacs-4/packages/simulation/www/simplay/case-admin-user-move.tcl 20 Apr 2004 21:12:26 -0000 1.3
+++ openacs-4/packages/simulation/www/simplay/case-admin-user-move.tcl 30 Nov 2004 21:09:17 -0000 1.4
@@ -12,8 +12,8 @@
set page_title [_ simulation.lt_Choose_new_roles_for]
set context [list [list . [_ simulation.SimPlay]] \
- [list [export_vars -base case-admin { case_id }]
- [_ simulation.lt_Administer_caselabel]]
+ [list [export_vars -base case-admin { case_id }] \
+ [_ simulation.lt_Administer_caselabel]] \
$page_title]
workflow::case::get -case_id $case_id -array case
Index: openacs-4/packages/simulation/www/simplay/case-admin.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/simulation/www/simplay/case-admin.adp,v
diff -u -r1.15 -r1.16
--- openacs-4/packages/simulation/www/simplay/case-admin.adp 29 Jun 2004 10:17:34 -0000 1.15
+++ openacs-4/packages/simulation/www/simplay/case-admin.adp 30 Nov 2004 21:09:17 -0000 1.16
@@ -8,7 +8,7 @@
- Add users in uncast role
+ #simulation.lt_Add_users_in_uncast_r#
@@ -17,7 +17,8 @@
@@ -28,3 +29,4 @@
+
Index: openacs-4/packages/simulation/www/simplay/case-admin.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/simulation/www/simplay/case-admin.tcl,v
diff -u -r1.17 -r1.18
--- openacs-4/packages/simulation/www/simplay/case-admin.tcl 20 Apr 2004 21:12:26 -0000 1.17
+++ openacs-4/packages/simulation/www/simplay/case-admin.tcl 30 Nov 2004 21:09:17 -0000 1.18
@@ -20,14 +20,16 @@
set user_id [ad_conn user_id]
set section_uri [apm_package_url_from_id $package_id]simplay/
+set complete_p [simulation::case::complete_p -case_id $case_id]
+
set elements {
role {
label {[_ simulation.Role]}
link_url_eval {[export_vars -base case { case_id role_id }]}
}
role_action {
display_template {
- Add user to role
+ [ad_decode $complete_p 1 "" "Add user to role "]
}
}
user_name {
@@ -37,8 +39,9 @@
user_actions {
label ""
display_template {
- [_ simulation.Move_user] \
- [_ simulation.Remove_user]
+ [ad_decode $complete_p 1 "" " \
+ [_ simulation.Move_user] \
+ [_ simulation.Remove_user] "]
}
}
max_n_users {
Index: openacs-4/packages/simulation/www/simplay/case.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/simulation/www/simplay/case.adp,v
diff -u -r1.15 -r1.16
--- openacs-4/packages/simulation/www/simplay/case.adp 29 Jun 2004 10:17:34 -0000 1.15
+++ openacs-4/packages/simulation/www/simplay/case.adp 30 Nov 2004 21:09:17 -0000 1.16
@@ -1,25 +1,31 @@
@title;noquote@
@context;noquote@
+ @workflow_id;noquote@
-
Recent Messages
+#simulation.Recent_Messages#
-
Tasks
+#simulation.Tasks#
-
Document Portfolio
+#simulation.Document_Portfolio#
+
+
+
+
+
Index: openacs-4/packages/simulation/www/simplay/case.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/simulation/www/simplay/case.tcl,v
diff -u -r1.7 -r1.8
--- openacs-4/packages/simulation/www/simplay/case.tcl 20 Apr 2004 21:12:26 -0000 1.7
+++ openacs-4/packages/simulation/www/simplay/case.tcl 30 Nov 2004 21:09:17 -0000 1.8
@@ -3,6 +3,7 @@
} {
case_id:integer,notnull
role_id:integer,notnull
+ portfolio_orderby:optional
}
simulation::case::assert_user_may_play_role \
@@ -14,10 +15,14 @@
set simulation_name [simulation::template::get_element \
-workflow_id $workflow_id -element pretty_name]
-set title [_ simulation.simulation_name]
+set title [_ simulation.Session_Home]
set context [list [list . [_ simulation.SimPlay]] $title]
set user_id [ad_conn user_id]
set package_id [ad_conn package_id]
set section_uri [apm_package_url_from_id $package_id]simplay/
set messages_url [export_vars -base messages { case_id role_id }]
+
+if { ![exists_and_not_null portfolio_orderby] } {
+ set portfolio_orderby 0
+}
\ No newline at end of file
Index: openacs-4/packages/simulation/www/simplay/control-bar.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/simulation/www/simplay/control-bar.adp,v
diff -u -r1.19 -r1.20
--- openacs-4/packages/simulation/www/simplay/control-bar.adp 17 May 2004 15:14:39 -0000 1.19
+++ openacs-4/packages/simulation/www/simplay/control-bar.adp 30 Nov 2004 21:09:17 -0000 1.20
@@ -1,6 +1,6 @@
@@ -10,26 +10,47 @@
-
+
+@curr_state@: @state_name@
+
-
Your Options
+
#simulation.Your_Options#
+
+
+
+
Index: openacs-4/packages/simulation/www/simplay/control-bar.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/simulation/www/simplay/control-bar.tcl,v
diff -u -r1.17 -r1.18
--- openacs-4/packages/simulation/www/simplay/control-bar.tcl 20 Apr 2004 21:12:26 -0000 1.17
+++ openacs-4/packages/simulation/www/simplay/control-bar.tcl 30 Nov 2004 21:09:17 -0000 1.18
@@ -9,20 +9,24 @@
role_id {}
}
+set current_url [export_vars -base [ad_conn url] { case_id role_id }]
set package_id [ad_conn package_id]
set user_id [ad_conn user_id]
set section_uri [apm_package_url_from_id $package_id]simplay/
+set page_role_id $role_id
simulation::case::get -case_id $case_id -array case
set workflow_id $case(workflow_id)
+set case_name $case(label)
+
db_1row getflags {
select show_contacts_p, show_states_p
from sim_simulations
where simulation_id=:workflow_id}
-set case_home_url [export_vars -base "case" { case_id role_id }]
+set case_home_url [export_vars -base ${section_uri}case { case_id role_id }]
set message_count [db_string message_count_sql "
select count(*)
@@ -60,7 +64,7 @@
and ci.live_revision = scx.object_id
} -column_array role
-set role(character_url) [simulation::object::url -name $role(character_name)]
+set role(character_url) [export_vars -base [simulation::object::url -name $role(character_name) -simplay 1] { case_id role_id }]
array set thumbnail [lindex \
[util_list_of_ns_sets_to_list_of_lists -list_of_ns_sets \
@@ -99,18 +103,30 @@
and ci.live_revision = scx.object_id
and wr.role_id != :role_id
" {
- set character_url [simulation::object::url -name $character_name]
+ set character_url [export_vars -base [simulation::object::url -name $character_name -simplay 1] { case_id {role_id $page_role_id} {recipient_role_id $role_id} }]
}
-set notifications_url [export_vars -base notifications { case_id role_id }]
+set notifications_url [export_vars -base ${section_uri}notifications { case_id role_id }]
-db_multirow -unclobber states select_states {
- select wfs.pretty_name,
- wfs.state_id,
- wcf.current_state
- from workflow_case_fsm wcf,
- workflow_fsm_states wfs
- where wfs.workflow_id = :workflow_id
- and wcf.case_id = :case_id
- order by wfs.sort_order
-}
+set yp_url [export_vars -base ${section_uri}yellow-pages { case_id role_id }]
+
+set map_url [export_vars -base ${section_uri}map { case_id role_id }]
+
+set help_url [export_vars -base "${section_uri}object/[parameter::get -parameter SimPlayHelpFile]" { case_id role_id }]
+
+set curr_state [_ simulation.curr_state]
+
+db_1row get_state {
+ select wfs.pretty_name as state_name,
+ s.show_states_p
+ from workflow_fsm_states wfs,
+ workflow_case_fsm wcf,
+ workflow_cases wc,
+ sim_simulations s
+ where wcf.case_id = wc.case_id and
+ wcf.current_state = wfs.state_id and
+ s.simulation_id = wc.workflow_id and
+ wc.workflow_id = :workflow_id and
+ wcf.case_id = :case_id and
+ wcf.parent_enabled_action_id is NULL
+}
\ No newline at end of file
Index: openacs-4/packages/simulation/www/simplay/document-upload.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/simulation/www/simplay/document-upload.tcl,v
diff -u -r1.10 -r1.11
--- openacs-4/packages/simulation/www/simplay/document-upload.tcl 20 Apr 2004 21:12:26 -0000 1.10
+++ openacs-4/packages/simulation/www/simplay/document-upload.tcl 30 Nov 2004 21:09:17 -0000 1.11
@@ -25,12 +25,24 @@
set focus "document.document_file"
+if { [exists_and_not_null document_file] && ![simulation::ui::forms::document_upload::check_mime -document_file $document_file] } {
+ simulation::ui::forms::document_upload::add_mime -document_file $document_file
+}
+
ad_form -name document -export { case_id role_id workflow_id return_url } -html {enctype multipart/form-data} \
+ -cancel_url $return_url \
-form [simulation::ui::forms::document_upload::form_block] \
- -on_submit {
+ -validate {
+ {document_file
+ {[simulation::ui::forms::document_upload::check_mime -document_file $document_file]}
+ "[_ simulation.lt_The_mime_type_of_your] [_ simulation.lt_Please_contact_______]
+ ([ad_host_administrator] )
+ [_ simulation.lt_if_you_think_youre_up]"
+ }
+ } -on_submit {
simulation::ui::forms::document_upload::insert_document \
$case_id $role_id $item_id $document_file $title
ad_returnredirect $return_url
- }
+ }
\ No newline at end of file
Index: openacs-4/packages/simulation/www/simplay/index.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/simulation/www/simplay/index.adp,v
diff -u -r1.26 -r1.27
--- openacs-4/packages/simulation/www/simplay/index.adp 29 Jun 2004 10:17:34 -0000 1.26
+++ openacs-4/packages/simulation/www/simplay/index.adp 30 Nov 2004 21:09:17 -0000 1.27
@@ -2,6 +2,8 @@
@title;noquote@
@context;noquote@
+
+
@@ -11,7 +13,12 @@
#simulation.lt_You_administer_these#
+
+
+
+
+
@@ -26,3 +33,8 @@
+
\ No newline at end of file
Index: openacs-4/packages/simulation/www/simplay/index.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/simulation/www/simplay/index.tcl,v
diff -u -r1.11 -r1.12
--- openacs-4/packages/simulation/www/simplay/index.tcl 20 Apr 2004 21:12:26 -0000 1.11
+++ openacs-4/packages/simulation/www/simplay/index.tcl 30 Nov 2004 21:09:17 -0000 1.12
@@ -2,14 +2,22 @@
Simplay index page.
} {
{case_id:integer ""}
+ case_admin_order:optional
}
+if { ![exists_and_not_null case_admin_order] } {
+ set case_admin_order 0
+}
+
set title [_ simulation.SimPlay]
set context [list $title]
set user_id [ad_conn user_id]
set package_id [ad_conn package_id]
-set section_uri [apm_package_url_from_id $package_id]simplay/
+set package_uri [apm_package_url_from_id $package_id]
+set section_uri ${package_uri}simplay/
+set help_url "${package_uri}object/[parameter::get -package_id $package_id -parameter SimPlayHelpFile]"
+
set adminplayer_p [permission::permission_p -object_id $package_id -privilege sim_adminplayer]
set case_list [db_list_of_lists case_count {
Index: openacs-4/packages/simulation/www/simplay/map.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/simulation/www/simplay/map.adp,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/simulation/www/simplay/map.adp 30 Nov 2004 21:09:17 -0000 1.1
@@ -0,0 +1,6 @@
+
+ @title;noquote@
+ @context;noquote@
+
+
+
\ No newline at end of file
Index: openacs-4/packages/simulation/www/simplay/map.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/simulation/www/simplay/map.tcl,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/simulation/www/simplay/map.tcl 30 Nov 2004 21:09:17 -0000 1.1
@@ -0,0 +1,25 @@
+ad_page_contract {
+ Simplay home page for a user in one case.
+} {
+ case_id:integer,notnull
+ role_id:integer,notnull
+ portfolio_orderby:optional
+}
+
+simulation::case::assert_user_may_play_role \
+ -case_id $case_id -role_id $role_id
+
+set workflow_id [simulation::case::get_element -case_id $case_id \
+ -element workflow_id]
+
+set simulation_name [simulation::template::get_element \
+ -workflow_id $workflow_id -element pretty_name]
+
+set sim_title [_ simulation.simulation_name]
+set title "Sieberdam Map"
+set context [list [list . [_ simulation.SimPlay]] [list [export_vars -base case {case_id role_id }] $sim_title] $title]
+set user_id [ad_conn user_id]
+set package_id [ad_conn package_id]
+set section_uri [apm_package_url_from_id $package_id]simplay/
+
+set messages_url [export_vars -base messages { case_id role_id }]
\ No newline at end of file
Index: openacs-4/packages/simulation/www/simplay/message.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/simulation/www/simplay/message.adp,v
diff -u -r1.12 -r1.13
--- openacs-4/packages/simulation/www/simplay/message.adp 20 Apr 2004 21:12:26 -0000 1.12
+++ openacs-4/packages/simulation/www/simplay/message.adp 30 Nov 2004 21:09:17 -0000 1.13
@@ -4,10 +4,11 @@
@focus;noquote@
-
- #simulation.to_attach_document_to_message#
-
+
+
+ #simulation.to_attach_document_to_message#
+
+
-
Index: openacs-4/packages/simulation/www/simplay/message.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/simulation/www/simplay/message.tcl,v
diff -u -r1.29 -r1.30
--- openacs-4/packages/simulation/www/simplay/message.tcl 29 Jun 2004 10:17:34 -0000 1.29
+++ openacs-4/packages/simulation/www/simplay/message.tcl 30 Nov 2004 21:09:17 -0000 1.30
@@ -16,17 +16,22 @@
set context [list [list "." [_ simulation.SimPlay]] [list [export_vars -base case { case_id role_id }] [_ simulation.Case]] $page_title]
set package_id [ad_conn package_id]
+set return_url [export_vars -base case { case_id role_id }]
+
set workflow_id [workflow::case::get_element -case_id $case_id -element workflow_id]
set all_role_options [list]
foreach one_role_id [workflow::role::get_ids -workflow_id $workflow_id] {
- set pretty_name [simulation::role::get_element -role_id $one_role_id -element character_title]
- lappend all_role_options [list $pretty_name $one_role_id]
+ set character_title [simulation::role::get_element -role_id $one_role_id -element character_title]
+ set pretty_name [simulation::role::get_element -role_id $one_role_id -element pretty_name]
+ lappend all_role_options [list "$pretty_name ($character_title)" $one_role_id]
}
set to_role_options [list]
foreach one_role_id [workflow::role::get_ids -workflow_id $workflow_id] {
- lappend to_role_options [list [simulation::role::get_element -role_id $one_role_id -element character_title] $one_role_id]
+ set character_title [simulation::role::get_element -role_id $one_role_id -element character_title]
+ set pretty_name [simulation::role::get_element -role_id $one_role_id -element pretty_name]
+ lappend to_role_options [list "$pretty_name ($character_title)" $one_role_id]
}
set attachment_options [simulation::case::attachment_options -case_id $case_id -role_id $role_id]
@@ -42,15 +47,22 @@
-item_id $item_id \
-array content
- set recipient_role_id $content(from_role_id)
+ set sender_role_id $content(from_role_id)
set subject "[_ simulation.Re] $content(title)"
+ set sender_pretty_name [simulation::role::get_element -role_id $sender_role_id -element pretty_name]
+ set sender_character_title [simulation::role::get_element -role_id $sender_role_id -element character_title]
+ set recipient_pretty_name [simulation::role::get_element -role_id $content(to_role_id) \
+ -element pretty_name]
+ set recipient_character_title [simulation::role::get_element -role_id $content(to_role_id) \
+ -element character_title]
set body_text "
+
-----Original Message-----
-From: [simulation::role::get_element -role_id $content(from_role_id) -element character_title]
+From: $sender_pretty_name ($sender_character_title)
Sent: [lc_time_fmt $content(creation_date) "%x %X"]
-To: [simulation::role::get_element -role_id $content(to_role_id) -element character_title]
+To: $recipient_pretty_name ($recipient_character_title)
Subject: $content(title)
[ad_html_text_convert -from $content(mime_type) -to "text/plain" $content(text)]"
@@ -59,8 +71,10 @@
ad_returnredirect [export_vars -base [ad_conn url] { case_id role_id recipient_role_id subject body_text body_mime_type }]
}
-set form_mode [ad_decode [ad_form_new_p -key item_id] 1 "edit" "display"]
+set form_new_p [ad_form_new_p -key item_id]
+set form_mode [ad_decode $form_new_p 1 "edit" "display"]
+
set focus "message.recipient_role_id"
set sender_role_id $role_id
@@ -70,6 +84,7 @@
-edit_buttons { { Send ok } } \
-export { case_id role_id } \
-mode $form_mode \
+ -cancel_url $return_url \
-form {
{item_id:key}
{sender_role_id:text(select)
@@ -79,7 +94,7 @@
}
}
-if { [ad_form_new_p -key item_id] } {
+if { $form_new_p } {
if { [llength $to_role_options] == 1 } {
ad_form -extend -name message -form {
{recipient_role_id_inform:text(inform)
@@ -120,8 +135,16 @@
}
}
-if { [llength $attachment_options] > 0 } {
- if { ![string equal $form_mode "display"] } {
+if { !$form_new_p } {
+ set attachments_set_list [bcms::item::list_related_items \
+ -revision live \
+ -item_id $item_id \
+ -relation_tag attachment \
+ -return_list]
+}
+
+if { ![string equal $form_mode "display"] } {
+ if { [llength $attachment_options] > 0 } {
# edit/new mode - show checkboxes
ad_form -extend -name message -form {
{attachments:integer(checkbox),multiple,optional
@@ -130,20 +153,26 @@
}
}
} else {
- # display mode - show a list of attached documents
- ad_form -extend -name message -form {
- {attachments:text(inform),optional
- {label {[_ simulation.Attachments]}}
- }
- }
+ ad_form -extend -name message -form {
+ {attachments:integer(hidden),optional}
+ }
}
-
-} else {
+} elseif { [llength $attachments_set_list] > 0 } {
+ # display mode - show a list of attached documents
ad_form -extend -name message -form {
- {attachments:integer(hidden),optional}
+ {attachments:text(inform),optional
+ {label {[_ simulation.Attachments]}}
+ }
}
+} else {
+ # this is just to avoid ad_form freakin' out because it needs a
+ # field called attachments
+ ad_form -extend -name message -form {
+ {attachments:integer(hidden),optional}
+ }
}
+
ad_form -extend -name message -new_request {
if { [info exists body_text] } {
if { ![info exists body_mime_type] } {
@@ -172,13 +201,6 @@
form set_properties message -actions { }
}
-
- set attachments_set_list [bcms::item::list_related_items \
- -revision live \
- -item_id $item_id \
- -relation_tag attachment \
- -return_list]
-
if { ![string equal $form_mode "display"] } {
# edit/new mode - set checkbox integer values
set attachments [list]
@@ -220,7 +242,7 @@
}
}
- ad_returnredirect [export_vars -base case { case_id role_id }]
+ ad_returnredirect $return_url
ad_script_abort
}
Index: openacs-4/packages/simulation/www/simplay/notifications.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/simulation/www/simplay/notifications.adp,v
diff -u -r1.3 -r1.4
--- openacs-4/packages/simulation/www/simplay/notifications.adp 20 Apr 2004 21:12:26 -0000 1.3
+++ openacs-4/packages/simulation/www/simplay/notifications.adp 30 Nov 2004 21:09:17 -0000 1.4
@@ -1,4 +1,4 @@
-
+
@page_title;noquote@
@context;noquote@
Index: openacs-4/packages/simulation/www/simplay/notifications.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/simulation/www/simplay/notifications.tcl,v
diff -u -r1.2 -r1.3
--- openacs-4/packages/simulation/www/simplay/notifications.tcl 20 Apr 2004 21:12:26 -0000 1.2
+++ openacs-4/packages/simulation/www/simplay/notifications.tcl 30 Nov 2004 21:09:17 -0000 1.3
@@ -9,8 +9,17 @@
set case_url [export_vars -base case { case_id role_id }]
set page_title [_ simulation.Notifications]
-set context [list [list . [_ simulation.SimPlay]] [list $case_url $case(label)] $page_title]
+set workflow_id [simulation::case::get_element -case_id $case_id \
+ -element workflow_id]
+
+set simulation_name [simulation::template::get_element \
+ -workflow_id $workflow_id -element pretty_name]
+
+set sim_title [_ simulation.simulation_name]
+
+set context [list [list . [_ simulation.SimPlay]] [list [export_vars -base case {case_id role_id }] $sim_title] $page_title]
+
set package_id [ad_conn package_id]
set user_id [ad_conn user_id]
set return_url [ad_return_url]
@@ -66,7 +75,7 @@
multirow append notifications \
$url \
[string totitle $pretty_name] \
- [ad_decode $subscribed_p 1 [_ simulation.lt_Unsubscribe_from_pret] "Subscribe to %pretty_name%"] \
+ [ad_decode $subscribed_p 1 [_ simulation.lt_Unsubscribe_from_pret] [_ simulation.lt_Subscribe_to_pretty_n]] \
$subscribed_p
}
}
Index: openacs-4/packages/simulation/www/simplay/play-master.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/simulation/www/simplay/play-master.adp,v
diff -u -r1.6 -r1.7
--- openacs-4/packages/simulation/www/simplay/play-master.adp 12 Jan 2004 13:43:14 -0000 1.6
+++ openacs-4/packages/simulation/www/simplay/play-master.adp 30 Nov 2004 21:09:17 -0000 1.7
@@ -1,9 +1,33 @@
@title;noquote@
@context;noquote@
- @header_stuff;noquote@
+
+@header_stuff;noquote@
+
+
+
+
+
+
+
+
+
@focus;noquote@
+
-
+
\ No newline at end of file
Index: openacs-4/packages/simulation/www/simplay/play-master.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/simulation/www/simplay/play-master.tcl,v
diff -u -r1.5 -r1.6
--- openacs-4/packages/simulation/www/simplay/play-master.tcl 20 Apr 2004 21:12:26 -0000 1.5
+++ openacs-4/packages/simulation/www/simplay/play-master.tcl 30 Nov 2004 21:09:17 -0000 1.6
@@ -9,6 +9,17 @@
set role_id [ns_queryget role_id]
}
+simulation::case::get -case_id $case_id -array case
+
+if { ![exists_and_not_null workflow_id] } {
+ set workflow_id $case(workflow_id)
+}
+
+set simulation_name [simulation::template::get_element \
+ -workflow_id $workflow_id -element pretty_name]
+
+set simulation_title "${simulation_name} — $case(label)"
+
# Get any simulation specific Stylesheet
#
set stylesheet_link ""
Index: openacs-4/packages/simulation/www/simplay/portfolio.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/simulation/www/simplay/portfolio.adp,v
diff -u -r1.5 -r1.6
--- openacs-4/packages/simulation/www/simplay/portfolio.adp 12 Jan 2004 15:37:28 -0000 1.5
+++ openacs-4/packages/simulation/www/simplay/portfolio.adp 30 Nov 2004 21:09:17 -0000 1.6
@@ -2,5 +2,11 @@
@title;noquote@
@context;noquote@
+
+
+
+
+
+
Index: openacs-4/packages/simulation/www/simplay/portfolio.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/simulation/www/simplay/portfolio.tcl,v
diff -u -r1.7 -r1.8
--- openacs-4/packages/simulation/www/simplay/portfolio.tcl 20 Apr 2004 21:12:26 -0000 1.7
+++ openacs-4/packages/simulation/www/simplay/portfolio.tcl 30 Nov 2004 21:09:17 -0000 1.8
@@ -3,6 +3,7 @@
} {
case_id:integer
role_id:integer
+ portfolio_orderby:optional
}
set workflow_id [simulation::case::get_element -case_id $case_id -element workflow_id]
@@ -14,3 +15,7 @@
set user_id [ad_conn user_id]
set package_id [ad_conn package_id]
set section_uri [apm_package_url_from_id $package_id]simplay/
+
+if { ![exists_and_not_null portfolio_orderby] } {
+ set portfolio_orderby 0
+}
\ No newline at end of file
Index: openacs-4/packages/simulation/www/simplay/task-detail.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/simulation/www/simplay/task-detail.adp,v
diff -u -r1.12 -r1.13
--- openacs-4/packages/simulation/www/simplay/task-detail.adp 20 Apr 2004 21:12:26 -0000 1.12
+++ openacs-4/packages/simulation/www/simplay/task-detail.adp 30 Nov 2004 21:09:17 -0000 1.13
@@ -25,20 +25,33 @@
@action.description@
-
-@documents_pre_form;noquote@
-
-
-
+
+
- #simulation.to_attach_a_document#
+ #simulation.no_attachments#
+
+
+
#simulation.Documents#
+ @documents_pre_form;noquote@
+
+
+
+
+
+
+ #simulation.to_attach_a_document#
+
+
+
+
#simulation.lt_Attachments_in_receiv# @received_attachments;noquote@
+
Index: openacs-4/packages/simulation/www/simplay/task-detail.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/simulation/www/simplay/task-detail.tcl,v
diff -u -r1.25 -r1.26
--- openacs-4/packages/simulation/www/simplay/task-detail.tcl 29 Jun 2004 10:17:34 -0000 1.25
+++ openacs-4/packages/simulation/www/simplay/task-detail.tcl 30 Nov 2004 21:09:17 -0000 1.26
@@ -52,7 +52,7 @@
set object_url [simulation::object::content_url -name [ns_set get $attachment_set name]]
set object_title [ns_set get $attachment_set title]
set mime_type [ns_set get $attachment_set mime_type]
- append received_attachments "$object_title ($mime_type) "
+ append received_attachments "$object_title ($mime_type) "
}
} else {
@@ -94,9 +94,9 @@
set body "
-----Original Message-----
-From: [workflow::role::get_element -role_id $from_role_id -element character_title]
+From: [simulation::role::get_element -role_id $from_role_id -element character_title]
Sent: [lc_time_fmt $creation_date "%x %X"]
-To: [workflow::role::get_element -role_id $to_role_id -element character_title]
+To: [simulation::role::get_element -role_id $to_role_id -element character_title]
Subject: $subject
[ad_html_text_convert -from $mime_type -to "text/plain" $triggering_body]"
@@ -163,7 +163,13 @@
set document_upload_url [export_vars -base document-upload {case_id role_id {return_url {[ad_return_url]}}}]
-if { ![empty_string_p $action(recipients)] } {
+if { [empty_string_p $action(recipients)] } {
+ set message_p false
+} else {
+ set message_p true
+}
+
+if { $message_p } {
# We have recipient roles - use message form
if { !$bulk_p } {
@@ -176,7 +182,7 @@
set form_id action
- ad_form -name $form_id -edit_buttons { { Send ok } } -export { case_id role_id {enabled_action_ids $enabled_action_id} bulk_p} \
+ ad_form -name $form_id -edit_buttons { { Send ok } } -cancel_url $return_url -export { case_id role_id {enabled_action_ids $enabled_action_id} bulk_p} \
-form {
{pretty_name:text(inform)
{label {[_ simulation.Task]}}
@@ -214,23 +220,37 @@
}
set body [template::util::richtext::create $body $body_mime_type]
set focus "action.body"
- }
+ } else {
+ if { ![empty_string_p $action(default_text)] } {
+ set body [template::util::richtext::create $action(default_text) $action(default_text_mime_type)]
+ set body_mime_type $action(default_text_mime_type)
+ }
+ }
set pretty_name $action(pretty_name)
set description [template::util::richtext::create $action(description) $action(description_mime_type)]
- set documents [simulation::ui::forms::document_upload::documents_element_value $action_id]
+ set documents [simulation::ui::forms::document_upload::documents_element_value_content \
+ $action_id]
+
+ # Let's tell users if there's no attachments instead of giving
+ # them an empty pair.
+ if { [string match "" $documents] } {
+ set documents "[_ simulation.no_attachments] "
+ }
+
set documents_pre_form ""
set recipient_list [list]
foreach recipient_id $action(recipients) {
- lappend recipient_list [simulation::role::get_element -role_id $recipient_id -element character_title]
+ simulation::role::get -role_id $recipient_id -array recipient_role
+ lappend recipient_list "$recipient_role(pretty_name) ($recipient_role(character_title))"
}
set recipient_names [join $recipient_list ", "]
if { ![empty_string_p $action(assigned_role_id)] } {
simulation::role::get -role_id $action(assigned_role_id) -array sender_role
- set sender_name $sender_role(character_title)
+ set sender_name "$sender_role(pretty_name) ($sender_role(character_title))"
}
} -on_submit {
@@ -273,21 +293,30 @@
set form_id document
+ set documents_pre_form [simulation::ui::forms::document_upload::documents_element_value_content $action_id]
+ set documents_pre_form_empty_p [string match "" $documents_pre_form]
+
ad_form -name $form_id \
-export { case_id role_id workflow_id {enabled_action_ids $enabled_action_id} bulk_p} \
+ -cancel_url $return_url \
-html {enctype multipart/form-data} \
-form [concat {{pretty_name:text(inform) {label {[_ simulation.Task]}}}} \
[simulation::ui::forms::document_upload::form_block]] \
-on_request {
set pretty_name $action(pretty_name)
- set documents_pre_form [simulation::ui::forms::document_upload::documents_element_value $action_id]
-
- } -on_submit {
-
+ } -validate {
+ {document_file
+ {[simulation::ui::forms::document_upload::check_mime -document_file $document_file]}
+ "[_ simulation.lt_The_mime_type_of_your] [_ simulation.lt_Please_contact_______]
+ ([ad_host_administrator] )
+ [_ simulation.lt_if_you_think_youre_up]"
+ }
+ } -on_submit {
+
db_transaction {
foreach one_action $common_enabled_action_ids {
set case_id [lindex $one_action 1]
-
+
set document [lindex $document_file 0]
set entry_id [workflow::case::action::execute \
-case_id $case_id \
Index: openacs-4/packages/simulation/www/simplay/yellow-pages.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/simulation/www/simplay/yellow-pages.adp,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/simulation/www/simplay/yellow-pages.adp 30 Nov 2004 21:09:17 -0000 1.1
@@ -0,0 +1,14 @@
+
+ @page_title;noquote@
+ @context;noquote@
+
+
+
+
+
+
+
+
+
+
+
Index: openacs-4/packages/simulation/www/simplay/yellow-pages.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/simulation/www/simplay/yellow-pages.tcl,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/simulation/www/simplay/yellow-pages.tcl 30 Nov 2004 21:09:17 -0000 1.1
@@ -0,0 +1,28 @@
+ad_page_contract {
+
+ @creation-date 2003-10-13
+ @cvs-id $Id: yellow-pages.tcl,v 1.1 2004/11/30 21:09:17 jarkko Exp $
+} {
+ parent_id:optional
+ {type:optional}
+ yp_orderby:optional
+ case_id:integer,notnull
+ role_id:integer,notnull
+}
+
+if { ![exists_and_not_null yp_orderby] } {
+ set yp_orderby 0
+}
+
+simulation::case::get -case_id $case_id -array case
+set case_url [export_vars -base case { case_id role_id }]
+
+set page_title [_ simulation.Yellow_Pages]
+
+set workflow_id [simulation::case::get_element -case_id $case_id \
+ -element workflow_id]
+
+set simulation_name [simulation::template::get_element \
+ -workflow_id $workflow_id -element pretty_name]
+set sim_title [_ simulation.simulation_name]
+set context [list [list . [_ simulation.SimPlay]] [list [export_vars -base case {case_id role_id }] $sim_title] $page_title]
\ No newline at end of file
Index: openacs-4/packages/simulation/www/simplay/object/index.vuh
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/simulation/www/simplay/object/index.vuh,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/simulation/www/simplay/object/index.vuh 30 Nov 2004 21:09:18 -0000 1.1
@@ -0,0 +1,15 @@
+ad_page_contract {
+ Displays a Simulation Object
+
+ @author Jarkko Laine (jarkko@jlaine.net)
+ @creation-date 2003-10-14
+ @cvs-id $Id: index.vuh,v 1.1 2004/11/30 21:09:18 jarkko Exp $
+} {
+ role_id:integer,notnull
+ case_id:integer,notnull
+ recipient_role_id:integer,optional
+}
+
+set path [file join [acs_package_root_dir "simulation"] lib object-display]
+
+rp_internal_redirect -absolute_path $path