Index: openacs-4/packages/contacts/lib/changes.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/contacts/lib/changes.adp,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/contacts/lib/changes.adp 13 Sep 2005 15:35:14 -0000 1.1
@@ -0,0 +1,3 @@
+
#contacts.Watch_all_changes#
+
+
\ No newline at end of file
Index: openacs-4/packages/contacts/lib/changes.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/contacts/lib/changes.tcl,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/contacts/lib/changes.tcl 13 Sep 2005 15:35:14 -0000 1.1
@@ -0,0 +1,39 @@
+if { [string is false [contact::exists_p -party_id $party_id]] } {
+ error "[_ contacts.lt_The_party_id_specifie]"
+}
+
+if { ![exists_and_not_null revision_id] } {
+ set revision_id ""
+}
+
+template::list::create \
+ -name changes \
+ -multirow changes \
+ -elements {
+ revision_id {
+ display_template {
+ @changes.revision_id@
+
+ <<
+
+ }
+ }
+ publish_date {
+ label "[_ contacts.Changed_date]"
+ }
+ name {
+ label "[_ contacts.Modify_by]"
+ }
+ latest_revision {
+ display_template {
+
+ #contacts.Latest#
+
+ }
+ }
+ }
+
+
+db_multirow changes get_changes { }
+
+
Index: openacs-4/packages/contacts/lib/changes.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/contacts/lib/changes.xql,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/contacts/lib/changes.xql 13 Sep 2005 15:35:14 -0000 1.1
@@ -0,0 +1,23 @@
+
+
+
+
+
+ select
+ cp.revision_id,
+ to_char(cp.publish_date, 'YYYY-MM-DD HH:MM:SS') as publish_date,
+ cu.first_names ||' '|| cu.last_name as name,
+ i.live_revision
+ from
+ contact_party_revisionsx cp,
+ cc_users cu,
+ cr_items i
+ where
+ cp.item_id = :party_id
+ and cu.user_id = cp.creation_user
+ and i.item_id = cp.item_id
+ order by revision_id desc
+
+
+
+
\ No newline at end of file
Index: openacs-4/packages/contacts/lib/contact-master.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/contacts/lib/contact-master.tcl,v
diff -u -r1.12 -r1.13
--- openacs-4/packages/contacts/lib/contact-master.tcl 6 Jul 2005 23:36:05 -0000 1.12
+++ openacs-4/packages/contacts/lib/contact-master.tcl 13 Sep 2005 15:35:57 -0000 1.13
@@ -40,6 +40,9 @@
lappend link_list "${prefix}message"
lappend link_list "[_ contacts.Mail]"
+
+ lappend link_list "${prefix}changes"
+ lappend link_list "[_ contacts.Changes]"
}
# Convert the list to a multirow and add the selected_p attribute
Index: openacs-4/packages/contacts/www/changes.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/contacts/www/changes.adp,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/contacts/www/changes.adp 13 Sep 2005 15:37:09 -0000 1.1
@@ -0,0 +1,19 @@
+
+@party_id@
+
+
+
+
+
+
+
+ #contacts.Preview#
+ |
+
+
+
+
+ |
+
+
+
\ No newline at end of file
Index: openacs-4/packages/contacts/www/changes.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/contacts/www/changes.tcl,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/contacts/www/changes.tcl 13 Sep 2005 15:37:09 -0000 1.1
@@ -0,0 +1,17 @@
+ad_page_contract {
+
+ @author Miguel Marin (miguelmarin@viaro.net)
+ @author Viaro Networks www.viaro.net
+ @creation-date 2005-09-12
+} {
+ {party_id:integer}
+ {revision_id:integer "" }
+} -validate {
+ contact_exists -requires {party_id} {
+ if { ![contact::exists_p -party_id $party_id] } {
+ ad_complain "[_ contacts.lt_The_contact_specified]"
+ }
+ }
+}
+
+ad_return_template
Index: openacs-4/packages/contacts/www/index.vuh
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/contacts/www/index.vuh,v
diff -u -r1.7 -r1.8
--- openacs-4/packages/contacts/www/index.vuh 9 Aug 2005 12:44:19 -0000 1.7
+++ openacs-4/packages/contacts/www/index.vuh 13 Sep 2005 15:37:09 -0000 1.8
@@ -26,7 +26,7 @@
ad_returnredirect "[ad_conn package_url]${party_id}/"
ad_script_abort
}
- set valid_pages [list "" edit files groups relationships comments message history]
+ set valid_pages [list "" edit files groups relationships comments message history changes]
if { [lsearch $valid_pages $action] >= 0 && [llength $file_list] == "2" } {
switch $action {
edit { set file "contact-edit" }
@@ -39,6 +39,7 @@
email { set file "email" }
complaint { set file "complaint" }
history { set file "history" }
+ changes { set file "changes" }
default { set file [parameter::get -parameter "ContactSummaryViewTemplate" -default "/packages/contacts/www/contact"] }
}
set form_supplied_party_id [ns_queryget party_id]