Index: openacs-4/contrib/packages/simulation/lib/sim-insts-grouped.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/simulation/lib/Attic/sim-insts-grouped.adp,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/contrib/packages/simulation/lib/sim-insts-grouped.adp 11 Dec 2003 13:21:52 -0000 1.1
@@ -0,0 +1 @@
+
Index: openacs-4/contrib/packages/simulation/lib/sim-insts-grouped.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/simulation/lib/Attic/sim-insts-grouped.tcl,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/contrib/packages/simulation/lib/sim-insts-grouped.tcl 11 Dec 2003 13:21:52 -0000 1.1
@@ -0,0 +1,58 @@
+simulation::include_contract {
+ Displays grouped list of simulations in development and casting for the current simulation package instance.
+
+ @author Joel Aufrecht
+ @creation-date 2003-11-12
+ @cvs-id $Id: sim-insts-grouped.tcl,v 1.1 2003/12/11 13:21:52 joela Exp $
+} {
+}
+
+######################################################################
+# Set general variables
+
+set package_id [ad_conn package_id]
+set user_id [auth::get_user_id]
+set base_url [apm_package_url_from_id $package_id]
+set add_url "${base_url}/siminst/simulation-new"
+set admin_p [permission::permission_p -object_id $package_id -privilege admin]
+
+#---------------------------------------------------------------------
+# sims: simulations in development or casting
+#---------------------------------------------------------------------
+
+template::list::create \
+ -name sims \
+ -multirow sims \
+ -actions "{New Simulation From Template} $add_url" \
+ -no_data "You have no Simulations in Development or Casting" \
+ -elements {
+ status {
+ label "Status"
+ }
+ count {
+ label "Count"
+ }
+ }
+
+# if user is admin, show all. otherwise, show only records owned by user
+if { $admin_p } {
+ set sim_filter_sql ""
+} else {
+ set sim_filter_sql "and ao.creation_user = :user_id"
+}
+
+db_multirow -extend { cast_url } sims select_sims "
+ select ss.sim_type as status,
+ count(w.workflow_id) as count
+ from workflows w,
+ sim_simulations ss,
+ acs_objects ao
+ where w.object_id = :package_id
+ and ss.simulation_id = w.workflow_id
+ and ao.object_id = w.workflow_id
+ and (ss.sim_type = 'dev_sim' or ss.sim_type = 'casting_sim')
+ group by ss.sim_type
+ $sim_filter_sql
+" {
+ set cast_url [export_vars -base "cast-edit" { workflow_id }]
+}
Index: openacs-4/contrib/packages/simulation/lib/sim-objects-grouped.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/simulation/lib/Attic/sim-objects-grouped.adp,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/contrib/packages/simulation/lib/sim-objects-grouped.adp 11 Dec 2003 13:21:52 -0000 1.1
@@ -0,0 +1 @@
+
Index: openacs-4/contrib/packages/simulation/lib/sim-objects-grouped.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/simulation/lib/Attic/sim-objects-grouped.tcl,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/contrib/packages/simulation/lib/sim-objects-grouped.tcl 11 Dec 2003 13:21:52 -0000 1.1
@@ -0,0 +1,77 @@
+simulation::include_contract {
+ Displays a grouped list of simulation objects for the current simulation package instance.
+
+ @author Joel Aufrecht
+ @creation-date 2003-11-12
+ @cvs-id $Id: sim-objects-grouped.tcl,v 1.1 2003/12/11 13:21:52 joela Exp $
+} {
+}
+
+######################################################################
+# Set general variables
+
+set package_id [ad_conn package_id]
+set user_id [auth::get_user_id]
+set base_url [apm_package_url_from_id $package_id]
+set create_p [permission::permission_p -object_id $package_id -privilege sim_object_create]
+
+if { ![exists_and_not_null parent_id] } {
+ set parent_id [bcms::folder::get_id_by_package_id -parent_id 0]
+}
+
+
+######################################################################
+#
+# objects list
+#
+######################################################################
+
+#---------------------------------------------------------------------
+# Set up supporting variables for list
+
+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"
+} else {
+ set actions ""
+}
+
+#---------------------------------------------------------------------
+# Set basic elements list
+set elements {
+ pretty_name {
+ label "Type"
+ orderby upper(ot.pretty_name)
+ }
+ count {
+ label "Number"
+ orderby count
+ link_url_col view_url
+ }
+}
+
+######################################################################
+template::list::create \
+ -name objects \
+ -multirow objects \
+ -actions $actions \
+ -elements $elements
+
+#---------------------------------------------------------------------
+# database query
+
+db_multirow -extend { view_url } objects select_objects "
+ select ot.pretty_name,
+ count(*)
+ from cr_folders f,
+ cr_items i,
+ acs_object_types ot
+ where f.package_id = :package_id
+ and i.parent_id = f.folder_id
+ and ot.object_type = i.content_type
+ group by ot.pretty_name
+ [template::list::orderby_clause -orderby -name "objects"]
+" {
+ set view_url $base_url/citybuild/TODOfilter
+}
Index: openacs-4/contrib/packages/simulation/lib/sim-objects.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/simulation/lib/Attic/sim-objects.tcl,v
diff -u -r1.9 -r1.10
--- openacs-4/contrib/packages/simulation/lib/sim-objects.tcl 2 Dec 2003 13:46:53 -0000 1.9
+++ openacs-4/contrib/packages/simulation/lib/sim-objects.tcl 11 Dec 2003 13:21:52 -0000 1.10
@@ -6,7 +6,7 @@
@cvs-id $Id$
} {
display_mode {
- allowed_values {edit display display-grouped}
+ allowed_values {edit display}
default_value display
}
size {
Index: openacs-4/contrib/packages/simulation/lib/sim-template-tasks.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/simulation/lib/Attic/sim-template-tasks.tcl,v
diff -u -r1.10 -r1.11
--- openacs-4/contrib/packages/simulation/lib/sim-template-tasks.tcl 11 Dec 2003 13:19:22 -0000 1.10
+++ openacs-4/contrib/packages/simulation/lib/sim-template-tasks.tcl 11 Dec 2003 13:21:52 -0000 1.11
@@ -18,7 +18,7 @@
display {}
edit {
- set add_task_url [export_vars -base "[apm_package_url_from_id $package_id]simbuild/task-edit" { workflow_id } ]
+ set add_task_url [export_vars -base "[apm_package_url_from_id $package_id]jsimbuild/task-edit" { workflow_id } ]
}
}
Index: openacs-4/contrib/packages/simulation/lib/sim-templates.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/simulation/lib/Attic/sim-templates.tcl,v
diff -u -r1.8 -r1.9
--- openacs-4/contrib/packages/simulation/lib/sim-templates.tcl 2 Dec 2003 17:29:48 -0000 1.8
+++ openacs-4/contrib/packages/simulation/lib/sim-templates.tcl 11 Dec 2003 13:21:52 -0000 1.9
@@ -120,9 +120,13 @@
(select count(action_id)
from workflow_actions
where workflow_id = w.workflow_id) as task_count
- from workflows w, acs_objects a
+ from workflows w,
+ sim_simulations ss,
+ acs_objects a
where w.workflow_id = a.object_id
+ and ss.simulation_id = w.workflow_id
and w.object_id = :package_id
+ and ss.sim_type in ('dev_template','ready_template')
[template::list::orderby_clause -orderby -name sim_templates]
" {
set description [string_truncate -len 200 $description]
Index: openacs-4/contrib/packages/simulation/sql/postgresql/simulation-priv-test-users-create.sql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/simulation/sql/postgresql/Attic/simulation-priv-test-users-create.sql,v
diff -u -r1.2 -r1.3
--- openacs-4/contrib/packages/simulation/sql/postgresql/simulation-priv-test-users-create.sql 2 Dec 2003 17:29:48 -0000 1.2
+++ openacs-4/contrib/packages/simulation/sql/postgresql/simulation-priv-test-users-create.sql 11 Dec 2003 13:21:52 -0000 1.3
@@ -1,4 +1,4 @@
-1-- create dummy users for permissions testing
+-- create dummy users for permissions testing
-- create each user and then assign appropriate privs directly
-- this is a temp solution - should instead create all the groups
Index: openacs-4/contrib/packages/simulation/www/index.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/simulation/www/Attic/index.adp,v
diff -u -r1.25 -r1.26
--- openacs-4/contrib/packages/simulation/www/index.adp 2 Dec 2003 17:24:32 -0000 1.25
+++ openacs-4/contrib/packages/simulation/www/index.adp 11 Dec 2003 13:21:52 -0000 1.26
@@ -2,29 +2,11 @@
@page_title;noquote@
@context;noquote@
-
-
-
-
-
-
-
-
- Log in to see your active cases.
-
-
-
-
-
-
-
@@ -37,8 +19,26 @@
-
-
\ No newline at end of file
+
+
+
+
+
+
+
+
+
+ Log in to see your active cases.
+
+
+
+
+
+
Index: openacs-4/contrib/packages/simulation/www/simulation-master.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/simulation/www/Attic/simulation-master.adp,v
diff -u -r1.6 -r1.7
--- openacs-4/contrib/packages/simulation/www/simulation-master.adp 18 Nov 2003 13:31:33 -0000 1.6
+++ openacs-4/contrib/packages/simulation/www/simulation-master.adp 11 Dec 2003 13:21:52 -0000 1.7
@@ -1,15 +1,14 @@
@title;noquote@
@context;noquote@
+ @subnavbar_link;noquote@
+
-
-
- Configuration | Documentation | Tests
-
+
+
Index: openacs-4/contrib/packages/simulation/www/simulation-master.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/simulation/www/Attic/simulation-master.tcl,v
diff -u -r1.3 -r1.4
--- openacs-4/contrib/packages/simulation/www/simulation-master.tcl 18 Nov 2003 13:31:33 -0000 1.3
+++ openacs-4/contrib/packages/simulation/www/simulation-master.tcl 11 Dec 2003 13:21:52 -0000 1.4
@@ -1,5 +1,50 @@
set package_id [ad_conn package_id]
set return_url [ad_return_url]
-set admin_p [permission::permission_p -object_id $package_id -privilege admin]
+
set parameters_url [export_vars -base "/shared/parameters" {package_id return_url}]
-set documentation_url /doc/simulation
\ No newline at end of file
+set base_url [apm_package_url_from_id $package_id]
+
+######################################################################
+#
+# Build a link bar for the subsite
+#
+######################################################################
+
+set admin_p [permission::permission_p -object_id $package_id -privilege admin]
+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_object_create]
+set siminst_p [permission::permission_p -object_id $package_id -privilege sim_inst]
+
+if { $citybuild_p } {
+ lappend subnavbar_list [list "${base_url}citybuild" "CityBuild"]
+}
+
+if { $simbuild_p } {
+ lappend subnavbar_list [list "${base_url}simbuild" "SimBuild"]
+}
+
+if { $siminst_p } {
+ lappend subnavbar_list [list "${base_url}siminst" "SimInst"]
+}
+
+lappend subnavbar_list [list "${base_url}simplay" "SimPlay"]
+
+if { $admin_p } {
+ lappend subnavbar_list [list $parameters_url Configuration]
+ lappend subnavbar_list [list "/test/admin/index?by_package_key=simulation&view_by=testcase&quiet=0" Tests]
+}
+
+lappend subnavbar_list [list "/doc/simulation" "Doc"]
+
+# TODO: should use ad_navbar
+# couldn't figure out how to pass the input to ad_narbar so hacking it in here
+# and also added context checking
+set link_list ""
+foreach arg $subnavbar_list {
+ if { [string match *[lindex $arg 0]* [ad_conn url]] } {
+ lappend link_list "[lindex $arg 1]"
+ } else {
+ lappend link_list "[lindex $arg 1]"
+ }
+}
+set subnavbar_link "\[[join $link_list " | "]\]"
Index: openacs-4/contrib/packages/simulation/www/citybuild/generate-xml.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/simulation/www/citybuild/Attic/generate-xml.adp,v
diff -u -r1.1 -r1.2
--- openacs-4/contrib/packages/simulation/www/citybuild/generate-xml.adp 13 Nov 2003 14:55:26 -0000 1.1
+++ openacs-4/contrib/packages/simulation/www/citybuild/generate-xml.adp 11 Dec 2003 13:21:52 -0000 1.2
@@ -1,4 +1,4 @@
-
+
@page_title;noquote@
@context;noquote@
Index: openacs-4/contrib/packages/simulation/www/citybuild/index.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/simulation/www/citybuild/Attic/index.adp,v
diff -u -r1.2 -r1.3
--- openacs-4/contrib/packages/simulation/www/citybuild/index.adp 2 Dec 2003 13:46:53 -0000 1.2
+++ openacs-4/contrib/packages/simulation/www/citybuild/index.adp 11 Dec 2003 13:21:52 -0000 1.3
@@ -1,4 +1,4 @@
-
+
@page_title;noquote@
@context;noquote@
Index: openacs-4/contrib/packages/simulation/www/citybuild/object-delete.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/simulation/www/citybuild/Attic/object-delete.adp,v
diff -u -r1.1 -r1.2
--- openacs-4/contrib/packages/simulation/www/citybuild/object-delete.adp 13 Nov 2003 14:55:26 -0000 1.1
+++ openacs-4/contrib/packages/simulation/www/citybuild/object-delete.adp 11 Dec 2003 13:21:52 -0000 1.2
@@ -1,4 +1,4 @@
-
+
@page_title;noquote@
@context;noquote@
Index: openacs-4/contrib/packages/simulation/www/citybuild/object-edit.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/simulation/www/citybuild/Attic/object-edit.adp,v
diff -u -r1.2 -r1.3
--- openacs-4/contrib/packages/simulation/www/citybuild/object-edit.adp 2 Dec 2003 13:46:53 -0000 1.2
+++ openacs-4/contrib/packages/simulation/www/citybuild/object-edit.adp 11 Dec 2003 13:21:52 -0000 1.3
@@ -1,4 +1,4 @@
-
+
@page_title;noquote@
@context;noquote@
object.title
Index: openacs-4/contrib/packages/simulation/www/doc/data-model.dia
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/simulation/www/doc/Attic/data-model.dia,v
diff -u -r1.7 -r1.8
--- openacs-4/contrib/packages/simulation/www/doc/data-model.dia 3 Dec 2003 15:00:49 -0000 1.7
+++ openacs-4/contrib/packages/simulation/www/doc/data-model.dia 11 Dec 2003 13:21:52 -0000 1.8
@@ -1,89 +1,94 @@
-� �}M��8��B���Dd��A�`k�'���c��S5o��Tr,�
-���ܼ�� J�!%%�![�iG��)���x.�{�=�?���j9�WVVy���##��$[ϊy�^�������������<���oQ���~Ǻ2?���7�����G�|�Һ(�2 U���K���g=���0����<�S��oӺ.��u6Y��엏��ٗEY<����v�fŲ('�J��|����ǟw��y�:'��I��2K��4����!��d��eW������i�nȑ��3f7�҃?�����-�~�z��=j�^��"_���?����`�A���z���^��Wɦ(�2���>�2K�[#w�ʆ�f�R?��A �Br�������y��C�d�1����������W����}�x��_���s,�|~�q�8r��sJ�v}��?���'��W��e�6�����_�i��~G���v�gb{����\e2����C>Ϫ��m̑+���������`��:�24&��SV�.�����d��|ΛO���٬�M��:]��r>�������u�w>����������Ŵ��l���薱�D�&��<��{�q���χ&J=�t�Xfo�(c%��[ňd����aF�e�JfE�~�Gur��C�~�H�$L���_?0�=W�����r���>B�0:3����k� d�Q��I�^�{�ce�<%e:���_%����_n�<���f4��&�b[�alkǠ����qNbx��m.��ջ��C��� �p>�5������Tn�Lo%����H��N��vD���b��faؾ^l����p��9�nU$�/��ދ��HLoCA$�b
-=F�(�e��I��7��=˖a��"�(xG��lsx#m��>]��;ѝ��`�Éi�<�uZ�IZ�����3���v'����2[/NOA����������ψ:^��'�jb��ǀ[{��wO��+�{� MxC�ú0��q���>Ӿ�{˛����A쿛��1���Ǎ��#6�h���1#\Bo�BR����77����ÿ;��ý��p��b��e�8����c�tv�QH� Wːȡ�^;7�oIo�c"�ϡ>����1&iu��J3���v������"^N�� ���I~����t�q��:�Z�H��9�b��|����ˉ<������O��U�|��������~�y��[�+[�+��Y��M����A˺#�{�v%L�_;(EB&����(��-R�J��b��ڿ���Қ���G�/�S�
-�|�1F���X�eS������4���Ns�Y.��>SO�0ϩ��w��5��D�5���݆��7ő{�) 2��oM-P{���Q��녀*���1&i�)�>w��b슱+��]�j2��Ci�bW<ʮ���^8]�Uղt�1�I�I&��/`��$�v��6����,�O��x��$m��p��n��C���1{���W�*��t����~���
-����lBC� �{�OgU�P�l*��ߛ�j_���a�)�'���Py7Ul�2m�ھL=�XNj�.������{��ٹ+�l�q��%�}�6�/D��uQ��er�Cz�;Z�ڤ������̳r��g ��N�q�b��*��}>t����l�?�oao��N�T}��D�t';�5?�uc�s���=|��Y��?3�OK��hԇӗ��O��)]{�������c���ݗy}����6�� ^���~��qVfӒ/�������I�,����&լh0�;rh?d�^3�0c��yV��|c�|@��X#g��ݭ�0p� 7ָ��Ú~$����F
-�� .����=>�ݛ�b�nz���
-�� .���-��ER��N�9�� 8}�3K+ �pz�,VXs @gt�� :W�^��%D?wT(�6z��
-���W�-J\%b�:ј��x�۷4�U�EkǷ������c�@`X���N1"�[����Dl��VQӸBR"$��>��R��`~�$Tҳ����D����B����A��\-8v�XB���m��{�d$c,�gZB���N����\si��9Q���F���!4a�s)
-][E�$�����/XG�_GC"l�����$����4�`ץT��g�SS}F��´B�e�re�6�(>O�����.���d0���i�P��
-������_�!v���)��nԶ�/�~��G�����GҲ
-_3�N?/��@2:�� �N(tB�
-�P脎j :�� m�rm�|��O�/���.ϖ磝��:��*��c�O9��ߔ��w��b�
-����
-�����7a�?Lʫ%n�@A#,��MJ�Ƭ-���)A�db�j[&��>g���o�"[�����7<�^Cސ��x�ҷ����>����m��(m�;Rr��bx��_��1%���� �YRN����1�+�_�X@b�W@^y��W@^y������A��0hG\!����>?S��-u�%��It����<�4���W@\q�W@\q�W@\�D�~ zէ|�)]�����C�N�ҧ�mF�闹`L�hgJ��[�XD[�l���fF���662V�5V�{��ށ��5 N��
-8��>��ԏg��%�3,tU�:TF�Ҳ,���:^:Yf����W�&:? Kè[�>u�=Z�̞�,��������*w��8�<{�7�X��b�d0I���9i��� Kg��������C}���$��ћ ����*]?M��:���oU���.�擙~ޫۻ������9�Ǟ�k��o��szW�}Ą��+D>��d�6v��sƨ��32T��r3�:��q�Y┄�䨝Ƀ���qK�,����@��7�괬;w�������o���C��f�A��A�;h�g��*'���x#n˽�wi#J��$��ۈ5��-I
-�S�SD�}ʡ�$�Ϡ7���a���@n �jL`78 �� v�
-`7�����^���d8�=H 9\�����)ـtY�A��o��l]�e2���\?rfieRL���Zt��� :}�3�*"���۵+�������1��-Kq]�Y2Ok� !@������y2(�� u��V�3wM����&�TQ�u-8�M�XD��٬"R5{�~��PL>�/c�e��p�J�#O�5�~w�5��Z��
-D��_ ���lc��@��&�Շ(�=��x�|,�/w��B]�BP����b�e1�BP��ԅ�.u!�N���GT��*9��9���d��(��; p���O�u�� 9@T�����⤳/�"K�dO@���]qP�� 9��3ϪY�o�-�)���d��2�>���W���^",�*�G$�Jx3�������_�
-͍.��xazv��ܧ*2�$���Ϊd������oྡ�3�oཱྀ���o�e.�70ߐBXI�W�H/��W0x ����L*�$_�g�P�GB ���Z�Q}������������ ;ð�c�� 9���S��U1����`ر�N�'�C �w �����
-���:u�eIU�5*MT,\[�B�\�F����0��R�Ϛm��gS"�ކ���v����҅Q�iS� �Y� H8~�9��jUWV��nE(Z@��P���-�9�d%��!�8�����x�t���Q����͈�J ��#T��H���'g��5 �k������!���9�8��C �8���uD �8�.���Z�ը� 7�
-�W���b+�c�Jآ�6f��\6:�B�dR�����_l/LҽPvR�<٤e����
-�l#���6�l#����%���MBۣ��]$��2 :�������m�Xo D��,����9��AC�6Qm�����v��]P[\09;Y���Fal���Fal���*�O��GXaD��06P�\>j��P"�
-� �}y1���t=O���v�)_|J���-����ّQ��aL��g4ۘ��M�PNoÐ����P�sQ��I3���kG��0JI O��w�zO�(� �Oq�;���xU�Pe�Pk?�,K��wݢ;���BG~�:4���'iY�ǿ4N/�,�����+W����Y�^gͩ�z�}>�2�nլ�������{ ��of�73쿛�����Ԩ9v�c����j��Sb�V�l�p��7?2��_�6��aR�
-b4���ff�p|1|1|q�/~�N{9�8���X��7N��G�cZ�_?N�c�u��[cGo���٥ycm'���Xm��`��z�}�o�X�����{��zk�Mw��]��ְ��W�jm�!%�$�6���){u�m�k�L+�AQנ�Y�����/�.�8���X\f���>��7l,B��=�q���6.�` |2|2|���1?X�������NJ�h�)��� ,#'ܱ�zww�-��7>�Y��M�+�9|l�D[;�[�x��r���w��Z
-2��E8Tl���G�Ƈ�8���8{����]:�7����V8�4v��Jnp�7ح��83��^�����U�?���$� ��̀ld3~�����̀ld3 ���f�,��?B��
-!�=�:���\�O�b ��@��tP�]ЖQq����V��8n�rqH�Ʃ�lwT�ujva9�G�?*7�[)�("�x�q��m�qww��!�x�q��!w*�����!�P\��R�'@����Mܘ��k�,�Y�h�� 4=@��+K��|[�����ؓt��p� >�O�����\�t k�TuQ���t@o��^7b�^71�Π�(��mj