Index: openacs-4/packages/contacts/contacts.info =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/contacts/contacts.info,v diff -u -r1.7 -r1.8 --- openacs-4/packages/contacts/contacts.info 3 Jun 2005 19:58:15 -0000 1.7 +++ openacs-4/packages/contacts/contacts.info 4 Jun 2005 12:36:44 -0000 1.8 @@ -20,6 +20,7 @@ + Index: openacs-4/packages/contacts/catalog/contacts.en_US.ISO-8859-1.xml =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/contacts/catalog/contacts.en_US.ISO-8859-1.xml,v diff -u -r1.7 -r1.8 --- openacs-4/packages/contacts/catalog/contacts.en_US.ISO-8859-1.xml 3 Jun 2005 19:58:15 -0000 1.7 +++ openacs-4/packages/contacts/catalog/contacts.en_US.ISO-8859-1.xml 4 Jun 2005 12:36:44 -0000 1.8 @@ -2,6 +2,7 @@ -- select a group -- + --select one-- Action Add a Person Add an Organization @@ -27,7 +28,10 @@ Clear the currently selected Search Comments Contact + Contact Relationship Contact Type + Contact Type One + Contact Type Two Contacts Create a role Create project @@ -41,9 +45,11 @@ last Last Name Limit Contacts to + Add relationship type Advanced searches are very powerful but in return they require very specific input... All searches are case insensitive, capitalization does not matter. If more than one contact match the search a list of results is returned. If only one contact meets the search criteria you are redirected to that contact. %comments.pretty_date% at %comments.pretty_time% - + Contact Relationships Currently, the system is able to handle the following types of relationships: Debugging Code - Only SW Admins See This Define a new relationship type @@ -58,7 +64,11 @@ Make sure you do not add the same attribute to multiple groups Once ready for release this will be taken care of in code "Organization Name" contains "Search_Word" or + Organization Relationship + Organization Relationships "Party ID" equals "Search_Word" + Person or Organization + The contact specified does not exist The default group must have first_names and last_name for person objects and name for organization objects, both of them need email This contact is not part of any groups - this is a problem. What role does %contact_name_one% have when %contact_name_two% is a %secondary_role_pretty%: @@ -77,12 +87,18 @@ of Ordering Organization + Organizations + Party Revision + Party Revisions Person PROJECT Public Page READ THESE + Relationship types Relationships Required + Role One + Role Two Roles Search Send an email message to the selected contacts Index: openacs-4/packages/contacts/sql/postgresql/contacts-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/contacts/sql/postgresql/contacts-create.sql,v diff -u -r1.3 -r1.4 --- openacs-4/packages/contacts/sql/postgresql/contacts-create.sql 18 May 2005 16:45:49 -0000 1.3 +++ openacs-4/packages/contacts/sql/postgresql/contacts-create.sql 4 Jun 2005 12:36:45 -0000 1.4 @@ -20,8 +20,8 @@ select content_type__create_type ( 'contact_party_revision', -- content_type 'content_revision', -- supertype - 'Party Revision', -- pretty_name - 'Party Revisions', -- pretty_plural + '#contacts.Party_Revision#', -- pretty_name + '#contacts.Party_Revisions#', -- pretty_plural 'contact_party_revisions', -- table_name (should this be pm_task?) 'party_revision_id', -- id_column 'contact_party_revision__name' -- name_method @@ -124,56 +124,12 @@ comment_format varchar(50) default 'text/plain' ); -select acs_rel_type__create_type ( - 'contact_rel', - 'Contact Relationship', - 'Contact Relationships', - 'relationship', - 'contact_rels', - 'rel_id', - 'contact_rel', - NULL, - 'party', - 0, - null::integer, - 'party', - 0, - null::integer -); - create table organization_rels ( rel_id integer constraint organization_rels_rel_id_fk references membership_rels(rel_id) on delete cascade constraint organization_rels_rel_id_pk primary key ); -select acs_rel_type__create_role ( - 'organization', - 'Organization', - 'Organizations' -); - -select acs_rel_type__create_type ( - 'organization_rel', - 'Organization Relationship', - 'Organization Relationships', - 'membership_rel', - 'organization_rels', - 'rel_id', - 'organization_rel', - NULL, - 'group', - 0, - null::integer, - 'organization', - 0, - null::integer -); - - --- create table contact_groups_package_map ( --- group_id --- ); \i contacts-package-create.sql \i contacts-search-create.sql Index: openacs-4/packages/contacts/tcl/attribute-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/contacts/tcl/attribute-procs.tcl,v diff -u -r1.3 -r1.4 --- openacs-4/packages/contacts/tcl/attribute-procs.tcl 18 May 2005 16:45:49 -0000 1.3 +++ openacs-4/packages/contacts/tcl/attribute-procs.tcl 4 Jun 2005 12:36:45 -0000 1.4 @@ -1,190 +1,190 @@ -ad_library { - - Support procs for attributes in the contacts package - - @author Matthew Geddert openacs@geddert.com - @creation-date 2004-07-28 - @cvs-id $Id$ - -} - -namespace eval contacts::attribute { - - ad_proc -private create { - {-widget_id:required} - {-label:required} - {-help_text ""} - {-help_p ""} - {-html ""} - {-format ""} - } { - this code creates a new attributes - } { - set creation_user [ad_conn user_id] - set creation_ip [ad_conn peeraddr] - return [db_exec_plsql create_attribute {}] - } - - - ad_proc -private delete { - {-attribute_id:required} - } { - this code deletes an attribute - } { - return [db_exec_plsql delete_attribute {} ] - } - - - ad_proc -public name { - {-locale ""} - attribute_id - } { - this code returns the name of an attribute - } { - - if { ![exists_and_not_null locale] } { - set locale [lang::conn::locale -site_wide] - } - - db_0or1row get_attribute_name {} - - if { ![exists_and_not_null name] } { - set locale "en_US" - db_0or1row get_view_name {} - } - - return $name - - } - - - - -} - - -namespace eval contacts::attribute::value { - - ad_proc -private save { - {-party_id:required} - {-attribute_id:required} - {-option_map_id ""} - {-address_id ""} - {-number_id ""} - {-time ""} - {-value ""} - {-deleted_p "f"} - } { - this code creates a new attributes - } { - set creation_user [ad_conn user_id] - set creation_ip [ad_conn peeraddr] - return [db_exec_plsql attribute_value_save {}] - } - - -} - -namespace eval contacts::postal_address { - - - ad_proc -private new { - {-additional_text ""} - {-country_code ""} - {-delivery_address ""} - {-municipality ""} - {-postal_code ""} - {-postal_type ""} - {-region ""} - } { - this code saves a contact's address - } { - set creation_user [ad_conn user_id] - set creation_ip [ad_conn peeraddr] - - return [db_exec_plsql postal_address_new {}] - } - - ad_proc -public get { - {-address_id:required} - {-array:required} - } { - get the info from addresses - } { - upvar $array row - - db_1row select_address_info {} -column_array row - } - -} - - - - -namespace eval contacts::telecom_number { - - ad_proc -private new { - {-area_city_code ""} - {-best_contact_time ""} - {-extension ""} - {-itu_id ""} - {-location ""} - {-national_number ""} - {-sms_enabled_p ""} - {-subscriber_number ""} - } { - this code saves a contact's phone_number - } { - set creation_user [ad_conn user_id] - set creation_ip [ad_conn peeraddr] - - return [db_exec_plsql telecom_number_new {}] - } - - - - ad_proc -public get { - {-number_id:required} - {-array:required} - } { - get the variables from phone_numbers - } { - upvar $array row - db_0or1row select_telecom_number_info {} -column_array row - } - -} - - -namespace eval contacts::date { - - ad_proc -private sqlify { - {-date:required} - } { - this turns a form date into a timestamp postgresql likes - } { - set year [template::util::date::get_property year $date] - set month [template::util::date::get_property month $date] - set day [template::util::date::get_property day $date] - set hours [template::util::date::get_property hours $date] - set minutes [template::util::date::get_property minutes $date] - - set date "$year-$month-$day $hours:$minutes" - if { $date == "-- :" } { - set date "" - } - return $date - } - - -} - - - - - - - - - - +ad_library { + + Support procs for attributes in the contacts package + + @author Matthew Geddert openacs@geddert.com + @creation-date 2004-07-28 + @cvs-id $Id$ + +} + +namespace eval contacts::attribute { + + ad_proc -private create { + {-widget_id:required} + {-label:required} + {-help_text ""} + {-help_p ""} + {-html ""} + {-format ""} + } { + this code creates a new attributes + } { + set creation_user [ad_conn user_id] + set creation_ip [ad_conn peeraddr] + return [db_exec_plsql create_attribute {}] + } + + + ad_proc -private delete { + {-attribute_id:required} + } { + this code deletes an attribute + } { + return [db_exec_plsql delete_attribute {} ] + } + + + ad_proc -public name { + {-locale ""} + attribute_id + } { + this code returns the name of an attribute + } { + + if { ![exists_and_not_null locale] } { + set locale [lang::conn::locale -site_wide] + } + + db_0or1row get_attribute_name {} + + if { ![exists_and_not_null name] } { + set locale "en_US" + db_0or1row get_view_name {} + } + + return $name + + } + + + + +} + + +namespace eval contacts::attribute::value { + + ad_proc -private save { + {-party_id:required} + {-attribute_id:required} + {-option_map_id ""} + {-address_id ""} + {-number_id ""} + {-time ""} + {-value ""} + {-deleted_p "f"} + } { + this code creates a new attributes + } { + set creation_user [ad_conn user_id] + set creation_ip [ad_conn peeraddr] + return [db_exec_plsql attribute_value_save {}] + } + + +} + +namespace eval contacts::postal_address { + + + ad_proc -private new { + {-additional_text ""} + {-country_code ""} + {-delivery_address ""} + {-municipality ""} + {-postal_code ""} + {-postal_type ""} + {-region ""} + } { + this code saves a contact's address + } { + set creation_user [ad_conn user_id] + set creation_ip [ad_conn peeraddr] + + return [db_exec_plsql postal_address_new {}] + } + + ad_proc -public get { + {-address_id:required} + {-array:required} + } { + get the info from addresses + } { + upvar $array row + + db_1row select_address_info {} -column_array row + } + +} + + + + +namespace eval contacts::telecom_number { + + ad_proc -private new { + {-area_city_code ""} + {-best_contact_time ""} + {-extension ""} + {-itu_id ""} + {-location ""} + {-national_number ""} + {-sms_enabled_p ""} + {-subscriber_number ""} + } { + this code saves a contact's phone_number + } { + set creation_user [ad_conn user_id] + set creation_ip [ad_conn peeraddr] + + return [db_exec_plsql telecom_number_new {}] + } + + + + ad_proc -public get { + {-number_id:required} + {-array:required} + } { + get the variables from phone_numbers + } { + upvar $array row + db_0or1row select_telecom_number_info {} -column_array row + } + +} + + +namespace eval contacts::date { + + ad_proc -private sqlify { + {-date:required} + } { + this turns a form date into a timestamp postgresql likes + } { + set year [template::util::date::get_property year $date] + set month [template::util::date::get_property month $date] + set day [template::util::date::get_property day $date] + set hours [template::util::date::get_property hours $date] + set minutes [template::util::date::get_property minutes $date] + + set date "$year-$month-$day $hours:$minutes" + if { $date == "-- :" } { + set date "" + } + return $date + } + + +} + + + + + + + + + + Index: openacs-4/packages/contacts/tcl/category-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/contacts/tcl/category-procs.tcl,v diff -u -r1.3 -r1.4 --- openacs-4/packages/contacts/tcl/category-procs.tcl 18 May 2005 16:45:49 -0000 1.3 +++ openacs-4/packages/contacts/tcl/category-procs.tcl 4 Jun 2005 12:36:45 -0000 1.4 @@ -1,75 +1,75 @@ -ad_library { - - Support procs for the categorys in the contacts package - - @author Matthew Geddert openacs@geddert.com - @creation-date 2004-07-28 - @cvs-id $Id$ - -} - - -namespace eval contacts::categories:: { - - - ad_proc -public enabled_p { - } { - returns 1 if categories are enabled or 0 if not - } { - if { [empty_string_p [category_tree::get_mapped_trees [ad_conn package_id]]] } { - return 0 - } else { - return 1 - } - } - - - ad_proc -public get_selects { - {-export_vars ""} - {-category_id ""} - } { - } { - # this is borrowed from project-manager but will be re-written - - - # Categories are arranged into category trees. - # Set up an array for each tree. The array contains the category for each tree - set package_id [ad_conn package_id] - - set category_select "" - set number_of_categories 0 - set last_tree "" - set category_select "" - - db_foreach get_categories {} { - - if {![string equal $tree_name $last_tree] } { - append category_select "" - } - - if {[string equal $cat_id $category_id]} { - set select "selected" - } else { - set select "" - } - - append category_select "" - - set last_tree $tree_name - incr number_of_categories - } - - if {$number_of_categories < 1} { - return "" - } - - set return_val "
$export_vars -
" - - return $return_val -} - -} - +ad_library { + + Support procs for the categorys in the contacts package + + @author Matthew Geddert openacs@geddert.com + @creation-date 2004-07-28 + @cvs-id $Id$ + +} + + +namespace eval contacts::categories:: { + + + ad_proc -public enabled_p { + } { + returns 1 if categories are enabled or 0 if not + } { + if { [empty_string_p [category_tree::get_mapped_trees [ad_conn package_id]]] } { + return 0 + } else { + return 1 + } + } + + + ad_proc -public get_selects { + {-export_vars ""} + {-category_id ""} + } { + } { + # this is borrowed from project-manager but will be re-written + + + # Categories are arranged into category trees. + # Set up an array for each tree. The array contains the category for each tree + set package_id [ad_conn package_id] + + set category_select "" + set number_of_categories 0 + set last_tree "" + set category_select "" + + db_foreach get_categories {} { + + if {![string equal $tree_name $last_tree] } { + append category_select "" + } + + if {[string equal $cat_id $category_id]} { + set select "selected" + } else { + set select "" + } + + append category_select "" + + set last_tree $tree_name + incr number_of_categories + } + + if {$number_of_categories < 1} { + return "" + } + + set return_val "
$export_vars +
" + + return $return_val +} + +} + Index: openacs-4/packages/contacts/tcl/contacts-install-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/contacts/tcl/contacts-install-procs.tcl,v diff -u -r1.4 -r1.5 --- openacs-4/packages/contacts/tcl/contacts-install-procs.tcl 3 Jun 2005 22:19:36 -0000 1.4 +++ openacs-4/packages/contacts/tcl/contacts-install-procs.tcl 4 Jun 2005 12:36:45 -0000 1.5 @@ -26,6 +26,56 @@ } { } +ad_proc -public contacts::install::package_install { +} { + @author Malte Sussdorff (sussdorff@sussdorff.de) + @creation-date 2005-06-04 + + @return + + @error +} { + + # Register Relationships + + rel_types::new -table_name "contact_rels" -create_table_p "f" \ + "contact_rel" \ + "Contact Relationship" \ + "Contact Relationships" \ + "party" \ + "0" \ + "" \ + "party" \ + "0" \ + "" + + rel_types::create_role -role "organization" -pretty_name "Organization" -pretty_plural "Organizations" + + rel_types::new -table_name "organization_rels" -create_table_p "f" \ + "organization_rel" \ + "Organization Relationship" \ + "Organization Relationships" \ + "group" \ + "0" \ + "" \ + "organization" \ + "0" \ + "" + + rel_types::create_role -role "employee" -pretty_name "Employee" -pretty_plural "Employees" + rel_types::create_role -role "employer" -pretty_name "Employer" -pretty_plural "Employers" + rel_types::new -table_name "contact_rel_employment" -create_table_p "t" -supertype "contact_rel" -role_one "employee" -role_two "employer" \ + "contact_rels_employment" \ + "Contact Rel Employment" \ + "Contact Rels Employment" \ + "person" \ + "0" \ + "" \ + "organization" \ + "0" \ + "" +} + ad_proc -public -callback pm::project_new -impl contacts { {-package_id:required} {-project_id:required} @@ -34,7 +84,8 @@ map selected organization to new project } { array set callback_data $data - set project_rev_id [pm::project::get_project_id -project_item_id $project_id] + set project_rev_id [pm::project::get_project_id \ + -project_item_id $project_id] if {[exists_and_not_null callback_data(organization_id)]} { application_data_link::new -this_object_id $project_rev_id -target_object_id $callback_data(organization_id) @@ -49,7 +100,8 @@ map selected organization to updated project } { array set callback_data $data - set project_rev_id [pm::project::get_project_id -project_item_id $project_id] + set project_rev_id [pm::project::get_project_id \ + -project_item_id $project_id] if {[exists_and_not_null callback_data(organization_id)]} { application_data_link::new -this_object_id $project_rev_id -target_object_id $callback_data(organization_id) @@ -61,9 +113,9 @@ } { # We want to instantiate the contacts package so that registered - # users have some attributes mapped by default. This could be - # extended in custom packages. + # users have some attributes mapped by default. This could be extended in custom packages. + ams::widgets_init set list_id [ams::list::new \ -package_key "contacts" \ @@ -73,13 +125,12 @@ -description "" \ -description_mime_type ""] - set attribute_id [attribute::new \ -object_type "person" \ -attribute_name "first_names" \ -datatype "string" \ - -pretty_name "#ams.person_first_names#" \ - -pretty_plural "#ams.person_first_names_plural#" \ + -pretty_name "#acs-translations.person_first_names#" \ + -pretty_plural "#acs-translations.person_first_names_plural#" \ -table_name "" \ -column_name "" \ -default_value "" \ @@ -90,8 +141,8 @@ -static_p "f" \ -if_does_not_exist] - lang::message::register en_US ams person_last_name "First Names" - lang::message::register en_US ams person_last_name_plural "First Names" + lang::message::register en_US acs-translations person_last_name "First Names" + lang::message::register en_US acs-translations person_last_name_plural "First Names" ams::attribute::new -attribute_id $attribute_id -widget "textbox" -dynamic_p "f" @@ -106,8 +157,8 @@ -object_type "person" \ -attribute_name "last_name" \ -datatype "string" \ - -pretty_name "#ams.person_last_name#" \ - -pretty_plural "#ams.person_last_name_plural#" \ + -pretty_name "#acs-translations.person_last_name#" \ + -pretty_plural "#acs-translations.person_last_name_plural#" \ -table_name "" \ -column_name "" \ -default_value "" \ @@ -118,8 +169,8 @@ -static_p "f" \ -if_does_not_exist] - lang::message::register en_US ams person_first_names "Last Name" - lang::message::register en_US ams person_first_names_plural "Last Names" + lang::message::register en_US acs-translations person_first_names "Last Name" + lang::message::register en_US acs-translations person_first_names_plural "Last Names" ams::attribute::new -attribute_id $attribute_id -widget "textbox" -dynamic_p "f" @@ -130,13 +181,12 @@ -required_p "f" \ -section_heading "" - set attribute_id [attribute::new \ -object_type "party" \ -attribute_name "email" \ -datatype "string" \ - -pretty_name "#ams.party_email#" \ - -pretty_plural "#ams.party_email_plural#" \ + -pretty_name "#acs-translations.party_email#" \ + -pretty_plural "#acs-translations.party_email_plural#" \ -table_name "" \ -column_name "" \ -default_value "" \ @@ -147,10 +197,10 @@ -static_p "f" \ -if_does_not_exist] - lang::message::register en_US ams party_email "Email Address" - lang::message::register en_US ams party_email_plural "Email Addresses" + lang::message::register en_US acs-translations party_email "Email Address" + lang::message::register en_US acs-translations party_email_plural "Email Addresses" - ams::attribute::new -attribute_id $attribute_id -widget "email" -dynamic_p "f" + ams::attribute::new -attribute_id $attribute_id -widget "email" -dynamic_p "f" ams::list::attribute::map \ -list_id $list_id \ @@ -163,8 +213,8 @@ -object_type "person" \ -attribute_name "home_address" \ -datatype "string" \ - -pretty_name "#ams.person_address#" \ - -pretty_plural "#ams.person_address_plural#" \ + -pretty_name "#acs-translations.person_address#" \ + -pretty_plural "#acs-translations.person_address_plural#" \ -table_name "" \ -column_name "" \ -default_value "" \ @@ -175,10 +225,10 @@ -static_p "f" \ -if_does_not_exist] - lang::message::register en_US ams person_address "Home Address" - lang::message::register en_US ams person_address_plural "Home Address" + lang::message::register en_US acs-translations person_address "Home Address" + lang::message::register en_US acs-translations person_address_plural "Home Address" - ams::attribute::new -attribute_id $attribute_id -widget "postal_address" -dynamic_p "t" + ams::attribute::new -attribute_id $attribute_id -widget "postal_address" -dynamic_p "t" ams::list::attribute::map \ -list_id $list_id \ @@ -191,8 +241,8 @@ -object_type "person" \ -attribute_name "home_phone" \ -datatype "string" \ - -pretty_name "#ams.home_phone#" \ - -pretty_plural "#ams.home_phone_plural#" \ + -pretty_name "#acs-translations.home_phone#" \ + -pretty_plural "#acs-translations.home_phone_plural#" \ -table_name "" \ -column_name "" \ -default_value "" \ @@ -203,8 +253,8 @@ -static_p "f" \ -if_does_not_exist] - lang::message::register en_US ams home_phone "Home Phone" - lang::message::register en_US ams home_phone_plural "Home Phone" + lang::message::register en_US acs-translations home_phone "Home Phone" + lang::message::register en_US acs-translations home_phone_plural "Home Phone" ams::attribute::new -attribute_id $attribute_id -widget "telecom_number" -dynamic_p "t" @@ -219,8 +269,8 @@ -object_type "person" \ -attribute_name "mobile_phone" \ -datatype "string" \ - -pretty_name "#ams.mobile_phone#" \ - -pretty_plural "#ams.mobile_phone_plural#" \ + -pretty_name "#acs-translations.mobile_phone#" \ + -pretty_plural "#acs-translations.mobile_phone_plural#" \ -table_name "" \ -column_name "" \ -default_value "" \ @@ -231,8 +281,8 @@ -static_p "f" \ -if_does_not_exist] - lang::message::register en_US ams mobile_phone "Mobile Phone" - lang::message::register en_US ams mobile_phone_plural "Mobile Phone" + lang::message::register en_US acs-translations mobile_phone "Mobile Phone" + lang::message::register en_US acs-translations mobile_phone_plural "Mobile Phone" ams::attribute::new -attribute_id $attribute_id -widget "telecom_number" -dynamic_p "t" @@ -243,11 +293,7 @@ -required_p "f" \ -section_heading "" - ################### - # # ORGANIZATIONS - # - ################### set list_id [ams::list::new \ -package_key "contacts" \ @@ -261,8 +307,8 @@ -object_type "organization" \ -attribute_name "name" \ -datatype "string" \ - -pretty_name "#ams.organization_name#" \ - -pretty_plural "#ams.organization_name_plural#" \ + -pretty_name "#acs-translations.organization_name#" \ + -pretty_plural "#acs-translations.organization_name_plural#" \ -table_name "" \ -column_name "" \ -default_value "" \ @@ -273,24 +319,24 @@ -static_p "f" \ -if_does_not_exist] - lang::message::register en_US ams organization_name "Organization Name" - lang::message::register en_US ams organization_name_plural "Organization Names" + lang::message::register en_US acs-translations organization_name "Organization Name" + lang::message::register en_US acs-translations organization_name_plural "Organization Names" ams::attribute::new -attribute_id $attribute_id -widget "textbox" -dynamic_p "t" ams::list::attribute::map \ - -list_id $list_id \ - -attribute_id $attribute_id \ - -sort_order "1" \ - -required_p "f" \ - -section_heading "" + -list_id $list_id \ + -attribute_id $attribute_id \ + -sort_order "1" \ + -required_p "f" \ + -section_heading "" set attribute_id [attribute::new \ - -object_type "person" \ - -attribute_name "organization_address" \ - -datatype "string" \ - -pretty_name "#ams.organization_address#" \ - -pretty_plural "#ams.organization_address_plural#" \ + -object_type "person" \ + -attribute_name "organization_address" \ + -datatype "string" \ + -pretty_name "#acs-translations.organization_address#" \ + -pretty_plural "#acs-translations.organization_address_plural#" \ -table_name "" \ -column_name "" \ -default_value "" \ @@ -301,8 +347,8 @@ -static_p "f" \ -if_does_not_exist] - lang::message::register en_US ams organization_address "Address" - lang::message::register en_US ams organization_address_plural "Address" + lang::message::register en_US acs-translations organization_address "Address" + lang::message::register en_US acs-translations organization_address_plural "Address" ams::attribute::new -attribute_id $attribute_id -widget "postal_address" -dynamic_p "t" @@ -317,8 +363,8 @@ -object_type "person" \ -attribute_name "organization_url" \ -datatype "string" \ - -pretty_name "#ams.organization_url#" \ - -pretty_plural "#ams.organization_url_plural#" \ + -pretty_name "#acs-translations.organization_url#" \ + -pretty_plural "#acs-translations.organization_url_plural#" \ -table_name "" \ -column_name "" \ -default_value "" \ @@ -329,8 +375,8 @@ -static_p "f" \ -if_does_not_exist] - lang::message::register en_US ams organization_url "Website" - lang::message::register en_US ams organization_url_plural "Website" + lang::message::register en_US acs-translations organization_url "Website" + lang::message::register en_US acs-translations organization_url_plural "Website" ams::attribute::new -attribute_id $attribute_id -widget "url" -dynamic_p "t" @@ -340,8 +386,11 @@ -sort_order "3" \ -required_p "f" \ -section_heading "" - - # Make the registered users group mapped by default + + # Relationships + + # Make the registered users group mapped by default + contacts::insert_map -group_id "-2" -default_p "t" -package_id $package_id } @@ -350,25 +399,22 @@ {-default_p:required} {-package_id:required} } { - @author Malte Sussdorff (sussdorff@sussdorff.de) @creation-date 2005-06-03 - + @param group_id @param default_p @param package_id - @return - - @error + @return + + @error } { - db_dml insert_map { insert into contact_groups (group_id,default_p,package_id) values - (:group_id,:default_p,:package_id) - } + (:group_id,:default_p,:package_id)} } Index: openacs-4/packages/contacts/tcl/contacts-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/contacts/tcl/contacts-procs.tcl,v diff -u -r1.5 -r1.6 --- openacs-4/packages/contacts/tcl/contacts-procs.tcl 27 May 2005 00:18:58 -0000 1.5 +++ openacs-4/packages/contacts/tcl/contacts-procs.tcl 4 Jun 2005 12:36:45 -0000 1.6 @@ -5,7 +5,6 @@ @author Matthew Geddert openacs@geddert.com @creation-date 2004-07-28 @cvs-id $Id$ - } namespace eval contacts:: {} @@ -14,29 +13,27 @@ namespace eval contact::group:: {} namespace eval contact::revision:: {} namespace eval contact::special_attributes:: {} +namespace eval contact::rels:: {} - ad_proc -public contacts::default_group { {-package_id ""} } { returns the group_id for which this group is a component, if none then it return null } { - if { [string is false [exists_and_not_null package_id]] } { + if {[string is false [exists_and_not_null package_id]]} { set package_id [ad_conn package_id] } - return [db_string get_default_group { select group_id from contact_groups where package_id =:package_id and default_p } -default {}] + return [db_string get_default_group {select group_id from contact_groups where package_id =:package_id and default_p} -default {}] } - - ad_proc -private contact::util::interpolate { {-values:required} {-text:required} } { Interpolates a set of values into a string. This is directly copied from the bulk mail package @param values a list of key, value pairs, each one consisting of a - target string and the value it is to be replaced with. + target string and the value it is to be replaced with. @param text the string that is to be interpolated @return the interpolated string @@ -47,7 +44,6 @@ return $text } - ad_proc -private contact::util::generate_filename { {-title:required} {-extension:required} @@ -57,16 +53,18 @@ Generate a pretty filename that relates to the title supplied @param party_id if supplied the filenames associated with this party will be used as existing_filenames if existing filenames is not provided - + @param existing_filenames a list of filenames that the generated filename must not be equal to } { - if { [exists_and_not_null party_id] && [string is integer $party_id] && ![exists_and_not_null existing_filenames] } { + if {[exists_and_not_null party_id] + && [string is integer $party_id] && ![exists_and_not_null existing_filenames]} { set existing_filenames [db_list get_parties_existing_filenames {}] } - set filename [util_text_to_url -text ${title} -replacement "_"] + set filename [util_text_to_url \ + -text ${title} -replacement "_"] set output_filename "${filename}.${extension}" set num 1 - while { [lsearch $existing_filenames $output_filename] >= 0 } { + while {[lsearch $existing_filenames $output_filename] >= 0} { set output_filename "${filename}${num}.${extension}" incr num } @@ -81,19 +79,21 @@ return [lindex [split $filename "."] end] } - - - ad_proc -public contact::name { {-party_id:required} } { this returns the contact's name } { - if { [contact::person_p -party_id $party_id] } { - return [person::name -person_id $party_id] + if {[contact::person_p \ + -party_id $party_id]} { + return [person::name \ + -person_id $party_id] } else { - # if there is an org the name is returned otherwise null is returned - return [db_string get_org_name { select name from organizations where organization_id = :party_id } -default {}] + + # if there is an org the name is returned otherwise null is + # returned + + return [db_string get_org_name {select name from organizations where organization_id = :party_id} -default {}] } } @@ -102,9 +102,11 @@ } { this returns the contact's name } { - if { [contact::person_p -party_id $party_id] } { + if {[contact::person_p \ + -party_id $party_id]} { return "person" - } elseif { [contact::organization_p -party_id $party_id] } { + } elseif {[contact::organization_p \ + -party_id $party_id]} { return "organization" } else { return "" @@ -116,10 +118,14 @@ } { does this contact exist? } { + # persons can be organizations so we need to do the check this way - if { [contact::person_p -party_id $party_id] } { + + if {[contact::person_p \ + -party_id $party_id]} { return 1 - } elseif { [contact::organization_p -party_id $party_id] } { + } elseif {[contact::organization_p \ + -party_id $party_id]} { return 1 } else { return 0 @@ -131,30 +137,28 @@ } { this returns the contact's name } { - if { [db_0or1row contact_person_exists_p { select '1' from persons where person_id = :party_id }] } { - return 1 - } else { - return 0 - } + if {[db_0or1row contact_person_exists_p {select '1' from persons where person_id = :party_id}]} { + return 1} else { + return 0 + } } ad_proc -public contact::organization_p { {-party_id:required} } { this returns the contact's name } { - if { [contact::person_p -party_id $party_id] } { + if {[contact::person_p \ + -party_id $party_id]} { return 0 } else { - if { [db_0or1row contact_org_exists_p { select '1' from organizations where organization_id = :party_id }] } { - return 1 - } else { - return 0 - } + if {[db_0or1row contact_org_exists_p {select '1' from organizations where organization_id = :party_id}]} { + return 1} else { + return 0 + } } } - ad_proc -public contact::url { {-party_id:required} } { @@ -170,35 +174,33 @@ create a contact revision } { set extra_vars [ns_set create] - oacs_util::vars_to_ns_set -ns_set $extra_vars -var_list { party_id party_revision_id } - return [package_instantiate_object -extra_vars $extra_vars contact_party_revision] + oacs_util::vars_to_ns_set -ns_set $extra_vars -var_list {party_id party_revision_id} + return [package_instantiate_object \ + -extra_vars $extra_vars contact_party_revision] } - + ad_proc -public contact::live_revision { {-party_id:required} } { create a contact revision } { - if { [db_0or1row revision_exists_p { select 1 from cr_items where item_id = :party_id }] } { - return [item::get_live_revision $party_id] - } else { - return "" - } + if {[db_0or1row revision_exists_p {select 1 from cr_items where item_id = :party_id}]} { + return [item::get_live_revision $party_id]} else { + return "" + } } ad_proc -public contact::subsite_user_group { {-party_id:required} } { create a contact revision } { - if { [db_0or1row revision_exists_p { select 1 from cr_items where item_id = :party_id }] } { - return [item::get_live_revision $party_id] - } else { - return "" - } + if {[db_0or1row revision_exists_p {select 1 from cr_items where item_id = :party_id}]} { + return [item::get_live_revision $party_id]} else { + return "" + } } - ad_proc -private contact::group::new { {-group_id ""} {-email ""} @@ -222,16 +224,15 @@ } { this creates a new group for use with contacts (and the permissions system) } { - if { [exists_and_not_null owner_id] } { + if {[exists_and_not_null owner_id]} { set owner_id [ad_conn user_id] } - if { [exists_and_not_null package_id] } { + if {[exists_and_not_null package_id]} { set package_id [ad_conn package_id] } db_dml map_group {} } - ad_proc -public contact::group::parent { -group_id:required } { @@ -251,12 +252,13 @@ set user_id [ad_conn user_id] set group_list [list] db_foreach get_groups {} { - if { $mapped_p || $all_p } { + if {$mapped_p + || $all_p} { lappend group_list [list $group_name $group_id $member_count "1" $mapped_p $default_p] - if { $component_count > 0 && ( $expand == "all" || $expand == $group_id ) } { + if {$component_count > 0 + && ( $expand == "all" || $expand == $group_id ) } { db_foreach get_components {} { - lappend group_list [list "$indent_with$group_name" $group_id $member_count "2" $mapped_p $default_p] - } + lappend group_list [list "$indent_with$group_name" $group_id $member_count "2" $mapped_p $default_p]} } } } @@ -273,51 +275,48 @@ foreach group $group_list { lappend ad_form_output [list [lindex $group 0] [lindex $group 1]] } - return $ad_form_output + return $ad_form_output } default { return $group_list } } } - ad_proc -public contact::special_attributes::ad_form_values { -party_id:required -form:required } { } { - set object_type [contact::type -party_id $party_id] + set object_type [contact::type \ + -party_id $party_id] db_1row get_extra_info { select email, url from parties - where party_id = :party_id - } + where party_id = :party_id} set element_list [list email url] - if { $object_type == "person" } { + if {$object_type == "person" } { - array set person [person::get -person_id $party_id] + array set person [person::get \ + -person_id $party_id] set first_names $person(first_names) set last_name $person(last_name) lappend element_list first_names last_name + } elseif {$object_type == "organization" } { - } elseif { $object_type == "organization" } { - db_0or1row get_org_info { select name, legal_name, reg_number, notes - from organizations - where organization_id = :party_id - } + from organizations + where organization_id = :party_id} lappend element_list name legal_name reg_number notes - } foreach element $element_list { - if { [exists_and_not_null $element] } { - if { [template::element::exists $form $element] } { + if {[exists_and_not_null $element]} { + if {[template::element::exists $form $element]} { template::element::set_value $form $element [set $element] } } @@ -329,66 +328,70 @@ -form:required } { } { - set object_type [contact::type -party_id $party_id] + set object_type [contact::type \ + -party_id $party_id] set element_list [list email url] - if { $object_type == "person" } { + if {$object_type == "person" } { lappend element_list first_names last_name - } elseif { $object_type == "organization" } { + } elseif {$object_type == "organization" } { lappend element_list name legal_name reg_number notes } foreach element $element_list { - if { [template::element::exists $form $element] } { + if {[template::element::exists $form $element]} { set value [template::element::get_value $form $element] switch $element { email { - if { [db_0or1row party_is_user_p { select '1' from users where user_id = :party_id }] } { - if { [exists_and_not_null value] } { + if {[db_0or1row party_is_user_p {select '1' from users where user_id = :party_id}]} { + if {[exists_and_not_null value]} { set username $value } else { set username $party_id } acs_user::update -user_id $party_id -username $username } - party::update -party_id $party_id -email $value -url [db_string get_url { select url from parties where party_id = :party_id } -default {}] + party::update -party_id $party_id -email $value -url [db_string get_url {select url from parties where party_id = :party_id} -default {}] } url { - party::update -party_id $party_id -email [db_string get_email { select email from parties where party_id = :party_id } -default {}] -url $value + party::update -party_id $party_id -email [db_string get_email {select email from parties where party_id = :party_id} -default {}] -url $value } default { set $element $value } } } } - if { $object_type == "person" } { + if {$object_type == "person" } { + # first_names and last_name are required - if { [exists_and_not_null first_names] && [exists_and_not_null last_name] } { + + if {[exists_and_not_null first_names] + && [exists_and_not_null last_name]} { person::update -person_id $party_id -first_names $first_names -last_name $last_name } else { - if { ![exists_and_not_null first_names] } { + if {![exists_and_not_null first_names]} { error "The object type was person but first_names (a required element) did not exist" } - if { ![exists_and_not_null last_name] } { + if {![exists_and_not_null last_name]} { error "The object type was person but first_names (a required element) did not exist" } } - } elseif { $object_type == "organization" } { + } elseif {$object_type == "organization" } { + # name is required - if { [exists_and_not_null name] } { - if { ![exists_and_not_null legal_name] } { set legal_name "" } - if { ![exists_and_not_null reg_number] } { set reg_number "" } - if { ![exists_and_not_null notes] } { set notes "" } + + if {[exists_and_not_null name]} { + if {![exists_and_not_null legal_name]} {set legal_name "" } + if {![exists_and_not_null reg_number]} {set reg_number "" } + if {![exists_and_not_null notes]} {set notes "" } db_dml update_org { update organizations - set name = :name, - legal_name = :legal_name, - reg_number = :reg_number, - notes = :notes - where organization_id = :party_id - } + set name = :name, + legal_name = :legal_name, + reg_number = :reg_number, + notes = :notes + where organization_id = :party_id} } else { error "The object type was organization but name (a required element) did not exist" } } - } Index: openacs-4/packages/contacts/tcl/view-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/contacts/tcl/Attic/view-procs.tcl,v diff -u -r1.3 -r1.4 --- openacs-4/packages/contacts/tcl/view-procs.tcl 18 May 2005 16:45:49 -0000 1.3 +++ openacs-4/packages/contacts/tcl/view-procs.tcl 4 Jun 2005 12:36:45 -0000 1.4 @@ -1,177 +1,177 @@ -ad_library { - - Support procs for the contacts package - - @author Matthew Geddert openacs@geddert.com - @creation-date 2004-07-28 - @cvs-id $Id$ - -} - - -namespace eval contacts::view:: { - - ad_proc -public create { - {-src} - {-privilege_required "read"} - {-privilege_object_id} - {-contact_object_type} - {-package_id ""} - {-sort_order ""} - {-creation_user ""} - {-creation_ip ""} - {-context_id ""} - } { - this code returns 1 if the view_id exists for this object_type - } { - if { ![exists_and_not_null package_id] } { set package_id [ad_conn package_id] } - if { ![exists_and_not_null sort_order] } { - db_0or1row select_last_sort_order_value {} - if { [exists_and_not_null sort_order] } { - incr sort_order - } else { - set sort_order "1" - } - } - - db_1row create_contact_view {} - return $view_id - - } - - ad_proc -public name { - {-view_id} - {-locale "en_US"} - {-name} - } { - this code returns 1 if the view_id exists for this object_type - } { - db_1row save_view_name {} - - } - - ad_proc -private init {} { - initialize views - } { - - if { [string is false [db_0or1row views_exist_p {} ]] } { - - db_1row get_package_id {} - - set view_id [contacts::view::create -src "/packages/contacts/www/view/contact-view" \ - -privilege_required "read" \ - -privilege_object_id $package_id \ - -contact_object_type "organization" \ - -package_id $package_id \ - -sort_order "1"] - contacts::view::name -view_id $view_id -name "Contact Info" - - set view_id [contacts::view::create -src "/packages/contacts/www/view/comments-view" \ - -privilege_required "read" \ - -privilege_object_id $package_id \ - -contact_object_type "organization" \ - -package_id $package_id \ - -sort_order "1"] - contacts::view::name -view_id $view_id -name "Comments" - - set view_id [contacts::view::create -src "/packages/contacts/www/view/contact-view" \ - -privilege_required "read" \ - -privilege_object_id $package_id \ - -contact_object_type "person" \ - -package_id $package_id \ - -sort_order "1"] - contacts::view::name -view_id $view_id -name "Contact Info" - - set view_id [contacts::view::create -src "/packages/contacts/www/view/comments-view" \ - -privilege_required "read" \ - -privilege_object_id $package_id \ - -contact_object_type "person" \ - -package_id $package_id \ - -sort_order "1"] - contacts::view::name -view_id $view_id -name "Comments" - - } - - } - - ad_proc -public exists_p { - {-object_type ""} - view_id - } { - this code returns 1 if the view_id exists for this object_type - } { - return [db_0or1row exists_p_select {}] - } - - ad_proc -public get { - {-locale ""} - view_id - } { - get the info on the view - } { - - db_0or1row get_view_info {} - - if { ![exists_and_not_null locale] } { - set locale [lang::conn::locale -site_wide] - } - set view_name [contacts::view::get::name -locale $locale $view_id] - - set view_info [ns_set create] - ns_set put $view_info src $src - ns_set put $view_info privilege_required $privilege_required - ns_set put $view_info privilege_object_id $privilege_object_id - ns_set put $view_info contact_object_type $contact_object_type - ns_set put $view_info sort_order $sort_order - ns_set put $view_info view_name $view_name - - # Now, set the variables in the caller's environment - ad_ns_set_to_tcl_vars -level 2 $view_info - ns_set free $view_info - - } - - - -} - - -namespace eval contacts::view::get:: { - - ad_proc -public name { - {-locale ""} - view_id - } { - get the view name - } { - - if { ![exists_and_not_null locale] } { - set locale [lang::conn::locale -site_wide] - } - - db_0or1row get_view_name {} - - if { ![exists_and_not_null name] } { - set locale "en_US" - db_0or1row get_view_name { - select name from contact_view_names where view_id = :view_id and locale = :locale - } - } - - return $name - - } - - ad_proc -public first_view_id { - object_type - } { - get the first object type view_id - } { - - return [db_string get_first_view_id {}] - - } - - -} - +ad_library { + + Support procs for the contacts package + + @author Matthew Geddert openacs@geddert.com + @creation-date 2004-07-28 + @cvs-id $Id$ + +} + + +namespace eval contacts::view:: { + + ad_proc -public create { + {-src} + {-privilege_required "read"} + {-privilege_object_id} + {-contact_object_type} + {-package_id ""} + {-sort_order ""} + {-creation_user ""} + {-creation_ip ""} + {-context_id ""} + } { + this code returns 1 if the view_id exists for this object_type + } { + if { ![exists_and_not_null package_id] } { set package_id [ad_conn package_id] } + if { ![exists_and_not_null sort_order] } { + db_0or1row select_last_sort_order_value {} + if { [exists_and_not_null sort_order] } { + incr sort_order + } else { + set sort_order "1" + } + } + + db_1row create_contact_view {} + return $view_id + + } + + ad_proc -public name { + {-view_id} + {-locale "en_US"} + {-name} + } { + this code returns 1 if the view_id exists for this object_type + } { + db_1row save_view_name {} + + } + + ad_proc -private init {} { + initialize views + } { + + if { [string is false [db_0or1row views_exist_p {} ]] } { + + db_1row get_package_id {} + + set view_id [contacts::view::create -src "/packages/contacts/www/view/contact-view" \ + -privilege_required "read" \ + -privilege_object_id $package_id \ + -contact_object_type "organization" \ + -package_id $package_id \ + -sort_order "1"] + contacts::view::name -view_id $view_id -name "Contact Info" + + set view_id [contacts::view::create -src "/packages/contacts/www/view/comments-view" \ + -privilege_required "read" \ + -privilege_object_id $package_id \ + -contact_object_type "organization" \ + -package_id $package_id \ + -sort_order "1"] + contacts::view::name -view_id $view_id -name "Comments" + + set view_id [contacts::view::create -src "/packages/contacts/www/view/contact-view" \ + -privilege_required "read" \ + -privilege_object_id $package_id \ + -contact_object_type "person" \ + -package_id $package_id \ + -sort_order "1"] + contacts::view::name -view_id $view_id -name "Contact Info" + + set view_id [contacts::view::create -src "/packages/contacts/www/view/comments-view" \ + -privilege_required "read" \ + -privilege_object_id $package_id \ + -contact_object_type "person" \ + -package_id $package_id \ + -sort_order "1"] + contacts::view::name -view_id $view_id -name "Comments" + + } + + } + + ad_proc -public exists_p { + {-object_type ""} + view_id + } { + this code returns 1 if the view_id exists for this object_type + } { + return [db_0or1row exists_p_select {}] + } + + ad_proc -public get { + {-locale ""} + view_id + } { + get the info on the view + } { + + db_0or1row get_view_info {} + + if { ![exists_and_not_null locale] } { + set locale [lang::conn::locale -site_wide] + } + set view_name [contacts::view::get::name -locale $locale $view_id] + + set view_info [ns_set create] + ns_set put $view_info src $src + ns_set put $view_info privilege_required $privilege_required + ns_set put $view_info privilege_object_id $privilege_object_id + ns_set put $view_info contact_object_type $contact_object_type + ns_set put $view_info sort_order $sort_order + ns_set put $view_info view_name $view_name + + # Now, set the variables in the caller's environment + ad_ns_set_to_tcl_vars -level 2 $view_info + ns_set free $view_info + + } + + + +} + + +namespace eval contacts::view::get:: { + + ad_proc -public name { + {-locale ""} + view_id + } { + get the view name + } { + + if { ![exists_and_not_null locale] } { + set locale [lang::conn::locale -site_wide] + } + + db_0or1row get_view_name {} + + if { ![exists_and_not_null name] } { + set locale "en_US" + db_0or1row get_view_name { + select name from contact_view_names where view_id = :view_id and locale = :locale + } + } + + return $name + + } + + ad_proc -public first_view_id { + object_type + } { + get the first object type view_id + } { + + return [db_string get_first_view_id {}] + + } + + +} + Index: openacs-4/packages/contacts/www/contact-rels-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/contacts/www/contact-rels-postgresql.xql,v diff -u -r1.1 -r1.2 --- openacs-4/packages/contacts/www/contact-rels-postgresql.xql 21 May 2005 21:00:41 -0000 1.1 +++ openacs-4/packages/contacts/www/contact-rels-postgresql.xql 4 Jun 2005 12:36:45 -0000 1.2 @@ -11,8 +11,8 @@ -select acs_rel_type__role_pretty_name(primary_role), - primary_role +select acs_rel_type__role_pretty_name(primary_role) as pretty_name, + primary_role as role from contact_rel_types where secondary_object_type in ( :contact_type, 'party' ) group by primary_role Index: openacs-4/packages/contacts/www/contact-rels.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/contacts/www/contact-rels.tcl,v diff -u -r1.4 -r1.5 --- openacs-4/packages/contacts/www/contact-rels.tcl 27 May 2005 09:02:14 -0000 1.4 +++ openacs-4/packages/contacts/www/contact-rels.tcl 4 Jun 2005 12:36:45 -0000 1.5 @@ -192,19 +192,15 @@ set map_url [export_vars -base "${package_url}relationship-add" -url {{party_one $original_party_id} {party_two $party_id} {role_two $role_two}}] } +set rel_options [list [list "[_ contacts.--select_one--]" ""]] +db_foreach get_rels {} { + regsub -all {(\#([-a-zA-Z0-9_:\.]+)\#)} $pretty_name {[template::expand_percentage_signs [lang::message::lookup [ad_conn locale] {\2} {TRANSLATION MISSING} {} -1]]} pretty_name + + lappend rel_options [list [subst $pretty_name] $role] + } - -set rel_options [db_list_of_lists get_rels {}] - -set rel_options "{{-Select One-} {}} $rel_options" - - - - - - ad_form -name "search" -method "GET" -export {party_id} -form { {role_two:text(select) {label "Add: "} {options $rel_options}} {query:text(text) {label ""} {html {size 24}}} @@ -216,15 +212,6 @@ } -after_submit { } - - - - - - - - - template::list::create \ -html {width 100%} \ -name "relationships" \ Index: openacs-4/packages/contacts/www/files-delete.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/contacts/www/files-delete.tcl,v diff -u -r1.1 -r1.2 --- openacs-4/packages/contacts/www/files-delete.tcl 27 May 2005 00:18:58 -0000 1.1 +++ openacs-4/packages/contacts/www/files-delete.tcl 4 Jun 2005 12:36:45 -0000 1.2 @@ -1,19 +1,19 @@ -ad_page_contract { - - Update sort order - - @author Matthew Geddert openacs@geddert.com - @creation-date 2005-05-24 - @cvs-id $Id$ - -} { - item_id:multiple,notnull - party_id -} - -db_transaction { - foreach item_id $item_id { - db_dml expire_item { update cr_items set publish_status = 'expired', live_revision = NULL where item_id = :item_id } - } -} -ad_returnredirect "${party_id}/files" +ad_page_contract { + + Update sort order + + @author Matthew Geddert openacs@geddert.com + @creation-date 2005-05-24 + @cvs-id $Id$ + +} { + item_id:multiple,notnull + party_id +} + +db_transaction { + foreach item_id $item_id { + db_dml expire_item { update cr_items set publish_status = 'expired', live_revision = NULL where item_id = :item_id } + } +} +ad_returnredirect "${party_id}/files" Index: openacs-4/packages/contacts/www/files-update.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/contacts/www/files-update.tcl,v diff -u -r1.1 -r1.2 --- openacs-4/packages/contacts/www/files-update.tcl 27 May 2005 00:18:58 -0000 1.1 +++ openacs-4/packages/contacts/www/files-update.tcl 4 Jun 2005 12:36:45 -0000 1.2 @@ -1,41 +1,41 @@ -ad_page_contract { - - Update sort order - - @author Matthew Geddert openacs@geddert.com - @creation-date 2005-05-24 - @cvs-id $Id$ - -} { - rename:array - party_id:integer,notnull -} - -set item_ids [db_list get_item_ids { select item_id from cr_items where parent_id = :party_id and publish_status = 'ready' } ] -db_transaction { - foreach item_id $item_ids { - set new_title [string trim $rename(${item_id})] - if { [exists_and_not_null new_title] } { - db_0or1row get_item_date { -select ci.name, - cr.title, - cr.mime_type, - cr.content, - cr.content_length - from cr_items ci, cr_revisions cr, acs_objects ao - where ci.parent_id = :party_id - and ci.live_revision = cr.revision_id - and cr.revision_id = ao.object_id - and ci.item_id = :item_id } - - if { $new_title != $title } { - set filename [contact::util::generate_filename -title $new_title -extension [contact::util::get_file_extension -filename $name] -party_id $party_id] - set revision_id [content::revision::new -item_id $item_id -is_live "t" -title $new_title -mime_type $mime_type] - db_dml update_revision { update cr_revisions set content = :content, content_length = :content_length where revision_id = :revision_id } - db_dml update_item { update cr_items set name = :filename where item_id = :item_id } - } - } - - } -} -ad_returnredirect "${party_id}/files" +ad_page_contract { + + Update sort order + + @author Matthew Geddert openacs@geddert.com + @creation-date 2005-05-24 + @cvs-id $Id$ + +} { + rename:array + party_id:integer,notnull +} + +set item_ids [db_list get_item_ids { select item_id from cr_items where parent_id = :party_id and publish_status = 'ready' } ] +db_transaction { + foreach item_id $item_ids { + set new_title [string trim $rename(${item_id})] + if { [exists_and_not_null new_title] } { + db_0or1row get_item_date { +select ci.name, + cr.title, + cr.mime_type, + cr.content, + cr.content_length + from cr_items ci, cr_revisions cr, acs_objects ao + where ci.parent_id = :party_id + and ci.live_revision = cr.revision_id + and cr.revision_id = ao.object_id + and ci.item_id = :item_id } + + if { $new_title != $title } { + set filename [contact::util::generate_filename -title $new_title -extension [contact::util::get_file_extension -filename $name] -party_id $party_id] + set revision_id [content::revision::new -item_id $item_id -is_live "t" -title $new_title -mime_type $mime_type] + db_dml update_revision { update cr_revisions set content = :content, content_length = :content_length where revision_id = :revision_id } + db_dml update_item { update cr_items set name = :filename where item_id = :item_id } + } + } + + } +} +ad_returnredirect "${party_id}/files" Index: openacs-4/packages/contacts/www/person-groups-ae.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/contacts/www/person-groups-ae.tcl,v diff -u -r1.1 -r1.2 --- openacs-4/packages/contacts/www/person-groups-ae.tcl 18 May 2005 16:45:50 -0000 1.1 +++ openacs-4/packages/contacts/www/person-groups-ae.tcl 4 Jun 2005 12:36:45 -0000 1.2 @@ -1,83 +1,83 @@ -ad_page_contract { - - @author Matthew Geddert openacs@geddert.com - @creation-date 2004-07-28 - @cvs-id $Id$ - - -} { - {person_id:integer,optional} -} - - -if { [exists_and_not_null person_id] } { - set admin_user_url [acs_community_member_admin_url -user_id $person_id] - set user_url [acs_community_member_url -user_id $person_id] -} else { - set admin_user_url "" - set user_url "" -} - -set list_name "person_[ad_conn package_id]" -set object_type "person" -set package_key "contacts" - -if { [ad_form_new_p -key person_id] } { - set title "Add a Person" - set mode "edit" -} else { - set title [person::name -person_id $person_id] - set mode "display" -} -set context [list $title] - - - - - - - - -# groups -ad_form -name groups_ae \ - -mode "display" \ - -has_edit "t" \ - -actions { - {"Add to Group" "formbutton:edit"} - } -form { - {person_id:key} - } - -set package_id [ad_conn package_id] -set group_options [db_list_of_lists get_groups { - select groups.group_name, - groups.group_id, - ( select count(distinct member_id) from group_member_map where group_member_map.group_id = groups.group_id ) as member_count - from groups left join ( select group_id, owner_id, group_type, deprecated_p - from contact_groups - where package_id = :package_id ) contact_groups on (groups.group_id = contact_groups.group_id) - where groups.group_id != '-1' -}] - -set groups_available [db_list_of_lists get_groups { - select groups.group_name, - groups.group_id, - ( select count(distinct member_id) from group_member_map where group_member_map.group_id = groups.group_id ) as member_count - from groups left join ( select group_id, owner_id, group_type, deprecated_p - from contact_groups - where package_id = :package_id ) contact_groups on (groups.group_id = contact_groups.group_id) - where groups.group_id != '-1' -}] -ad_form -extend -name groups_ae -form { - {group_id:integer(checkbox),multiple {label "Groups"} {options $group_options}} - } -edit_request { - set group_id [db_list get_them { select distinct group_id from group_member_map where member_id = :person_id }] - #ad_return_error $group_id $group_id - } -on_submit { - } -after_submit { - ad_returnredirect -message "Group Information Saved." [export_vars -base "person-ae" -url {person_id}] - } - - - -ad_return_template +ad_page_contract { + + @author Matthew Geddert openacs@geddert.com + @creation-date 2004-07-28 + @cvs-id $Id$ + + +} { + {person_id:integer,optional} +} + + +if { [exists_and_not_null person_id] } { + set admin_user_url [acs_community_member_admin_url -user_id $person_id] + set user_url [acs_community_member_url -user_id $person_id] +} else { + set admin_user_url "" + set user_url "" +} + +set list_name "person_[ad_conn package_id]" +set object_type "person" +set package_key "contacts" + +if { [ad_form_new_p -key person_id] } { + set title "Add a Person" + set mode "edit" +} else { + set title [person::name -person_id $person_id] + set mode "display" +} +set context [list $title] + + + + + + + + +# groups +ad_form -name groups_ae \ + -mode "display" \ + -has_edit "t" \ + -actions { + {"Add to Group" "formbutton:edit"} + } -form { + {person_id:key} + } + +set package_id [ad_conn package_id] +set group_options [db_list_of_lists get_groups { + select groups.group_name, + groups.group_id, + ( select count(distinct member_id) from group_member_map where group_member_map.group_id = groups.group_id ) as member_count + from groups left join ( select group_id, owner_id, group_type, deprecated_p + from contact_groups + where package_id = :package_id ) contact_groups on (groups.group_id = contact_groups.group_id) + where groups.group_id != '-1' +}] + +set groups_available [db_list_of_lists get_groups { + select groups.group_name, + groups.group_id, + ( select count(distinct member_id) from group_member_map where group_member_map.group_id = groups.group_id ) as member_count + from groups left join ( select group_id, owner_id, group_type, deprecated_p + from contact_groups + where package_id = :package_id ) contact_groups on (groups.group_id = contact_groups.group_id) + where groups.group_id != '-1' +}] +ad_form -extend -name groups_ae -form { + {group_id:integer(checkbox),multiple {label "Groups"} {options $group_options}} + } -edit_request { + set group_id [db_list get_them { select distinct group_id from group_member_map where member_id = :person_id }] + #ad_return_error $group_id $group_id + } -on_submit { + } -after_submit { + ad_returnredirect -message "Group Information Saved." [export_vars -base "person-ae" -url {person_id}] + } + + + +ad_return_template Index: openacs-4/packages/contacts/www/relationship-ae.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/contacts/www/relationship-ae.tcl,v diff -u -r1.2 -r1.3 --- openacs-4/packages/contacts/www/relationship-ae.tcl 25 May 2005 02:09:52 -0000 1.2 +++ openacs-4/packages/contacts/www/relationship-ae.tcl 4 Jun 2005 12:36:45 -0000 1.3 @@ -63,15 +63,6 @@ } - - - - - - - - - if { !$list_exists_p || [template::form::is_valid "rel_form"] } { set existing_rel_id [db_string rel_exists_p {} -default {}] Index: openacs-4/packages/contacts/www/search-help.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/contacts/www/search-help.tcl,v diff -u -r1.1 -r1.2 --- openacs-4/packages/contacts/www/search-help.tcl 18 May 2005 16:45:50 -0000 1.1 +++ openacs-4/packages/contacts/www/search-help.tcl 4 Jun 2005 12:36:45 -0000 1.2 @@ -1,14 +1,14 @@ -ad_page_contract { - List and manage contacts. - - @author Matthew Geddert openacs@geddert.com - @creation-date 2004-07-28 - @cvs-id $Id$ -} { -} -validate { -} -set admin_p [ad_permission_p [ad_conn package_id] admin] -#set default_group_id [contacts::default_group_id] -set title "Search Help" -set context [list $title] - +ad_page_contract { + List and manage contacts. + + @author Matthew Geddert openacs@geddert.com + @creation-date 2004-07-28 + @cvs-id $Id$ +} { +} -validate { +} +set admin_p [ad_permission_p [ad_conn package_id] admin] +#set default_group_id [contacts::default_group_id] +set title "Search Help" +set context [list $title] + Index: openacs-4/packages/contacts/www/settings.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/contacts/www/settings.tcl,v diff -u -r1.1 -r1.2 --- openacs-4/packages/contacts/www/settings.tcl 18 May 2005 16:45:50 -0000 1.1 +++ openacs-4/packages/contacts/www/settings.tcl 4 Jun 2005 12:36:45 -0000 1.2 @@ -1,59 +1,59 @@ -ad_page_contract { - - @author Matthew Geddert openacs@geddert.com - @creation-date 2004-07-28 - @cvs-id $Id$ - - -} { -} - -set title "Settings" -set context [list $title] -set package_id [ad_conn package_id] -set party_id [ad_conn user_id] -set admin_p [ad_permission_p [ad_conn package_id] admin] - -template::list::create \ - -name "signatures" \ - -multirow "signatures" \ - -row_pretty_plural "signatures" \ - -elements { - default_p { - label "" - display_template { - - Default Signature - - } - } - title { - label "" - display_col title - link_url_eval $signature_url - } - signature { - label "" - display_col signature;noquote - } - } -filters { - } -orderby { - } - - -db_multirow -extend { signature_url } signatures select_signatures { - select signature_id, - title, - signature, - default_p - from contact_signatures - where party_id = :party_id - order by default_p, upper(title), upper(signature) -} { - set signature [ad_convert_to_html $signature] - set signature_url [export_vars -base signature -url {signature_id }] -} - - - -ad_return_template +ad_page_contract { + + @author Matthew Geddert openacs@geddert.com + @creation-date 2004-07-28 + @cvs-id $Id$ + + +} { +} + +set title "Settings" +set context [list $title] +set package_id [ad_conn package_id] +set party_id [ad_conn user_id] +set admin_p [ad_permission_p [ad_conn package_id] admin] + +template::list::create \ + -name "signatures" \ + -multirow "signatures" \ + -row_pretty_plural "signatures" \ + -elements { + default_p { + label "" + display_template { + + Default Signature + + } + } + title { + label "" + display_col title + link_url_eval $signature_url + } + signature { + label "" + display_col signature;noquote + } + } -filters { + } -orderby { + } + + +db_multirow -extend { signature_url } signatures select_signatures { + select signature_id, + title, + signature, + default_p + from contact_signatures + where party_id = :party_id + order by default_p, upper(title), upper(signature) +} { + set signature [ad_convert_to_html $signature] + set signature_url [export_vars -base signature -url {signature_id }] +} + + + +ad_return_template Index: openacs-4/packages/contacts/www/signature.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/contacts/www/signature.tcl,v diff -u -r1.1 -r1.2 --- openacs-4/packages/contacts/www/signature.tcl 18 May 2005 16:45:50 -0000 1.1 +++ openacs-4/packages/contacts/www/signature.tcl 4 Jun 2005 12:36:45 -0000 1.2 @@ -1,68 +1,68 @@ -ad_page_contract { - List and manage contacts. - - @author Matthew Geddert openacs@geddert.com - @creation-date 2004-07-28 - @cvs-id $Id$ -} { - {signature_id:integer,optional} -} -validate { - valid_signature_id -requires {signature_id} { - set party_id [ad_conn user_id] - if { ![ad_form_new_p -key signature_id] } { - if { [string is false [db_0or1row sig_is_mine_p {select '1' from contact_signatures where signature_id = :signature_id and party_id = :party_id}]] } { - ad_complain "This signature specified either does not exist or does not belong to you" - } - } - } -} - - -if { [ad_form_new_p -key signature_id] } { - set page_title "Create a Signature" - set edit_buttons [list [list "Create" save]] -} else { - set page_title "Edit a Signature" - set edit_buttons [list [list "Save" save] [list "Delete" delete]] -} - -set context [list $page_title] -set party_id [ad_conn user_id] -set form_elements { - signature_id:key - {title:text(text) {label "Save As"} {html {size 35 maxlength 35}}} - {signature:text(textarea) {label "Signature"} {html {cols 45 rows 5}}} - {default_p:boolean(checkbox),optional {label ""} {options {{{this is my default signature} 1}}}} -} - - -ad_form -action signature \ - -name signature \ - -cancel_label "Cancel" \ - -cancel_url "settings" \ - -edit_buttons $edit_buttons \ - -form $form_elements \ - -on_request { - } -new_request { - } -edit_request { - db_1row get_sig_info { select * from contact_signatures where signature_id = :signature_id } - } -on_submit { - if { [ns_queryget "formbutton:delete"] != "" } { - db_dml delete_it { delete from contact_signatures where signature_id = :signature_id and party_id = :party_id } - ad_returnredirect "settings" - ad_script_abort - } - if { [string is false [exists_and_not_null default_p]] } { - set default_p 0 - } else { - # its true and we reset the default - db_dml update_defaults { update contact_signatures set default_p = 'f' where party_id = :party_id } - } - } -new_data { - db_dml insert_sig { insert into contact_signatures values ( :signature_id, :title, :signature, :default_p, :party_id ) } - } -edit_data { - db_dml update_sig { update contact_signatures set title = :title, signature = :signature, default_p = :default_p where signature_id = :signature_id } - } -after_submit { - ad_returnredirect "settings" - } - +ad_page_contract { + List and manage contacts. + + @author Matthew Geddert openacs@geddert.com + @creation-date 2004-07-28 + @cvs-id $Id$ +} { + {signature_id:integer,optional} +} -validate { + valid_signature_id -requires {signature_id} { + set party_id [ad_conn user_id] + if { ![ad_form_new_p -key signature_id] } { + if { [string is false [db_0or1row sig_is_mine_p {select '1' from contact_signatures where signature_id = :signature_id and party_id = :party_id}]] } { + ad_complain "This signature specified either does not exist or does not belong to you" + } + } + } +} + + +if { [ad_form_new_p -key signature_id] } { + set page_title "Create a Signature" + set edit_buttons [list [list "Create" save]] +} else { + set page_title "Edit a Signature" + set edit_buttons [list [list "Save" save] [list "Delete" delete]] +} + +set context [list $page_title] +set party_id [ad_conn user_id] +set form_elements { + signature_id:key + {title:text(text) {label "Save As"} {html {size 35 maxlength 35}}} + {signature:text(textarea) {label "Signature"} {html {cols 45 rows 5}}} + {default_p:boolean(checkbox),optional {label ""} {options {{{this is my default signature} 1}}}} +} + + +ad_form -action signature \ + -name signature \ + -cancel_label "Cancel" \ + -cancel_url "settings" \ + -edit_buttons $edit_buttons \ + -form $form_elements \ + -on_request { + } -new_request { + } -edit_request { + db_1row get_sig_info { select * from contact_signatures where signature_id = :signature_id } + } -on_submit { + if { [ns_queryget "formbutton:delete"] != "" } { + db_dml delete_it { delete from contact_signatures where signature_id = :signature_id and party_id = :party_id } + ad_returnredirect "settings" + ad_script_abort + } + if { [string is false [exists_and_not_null default_p]] } { + set default_p 0 + } else { + # its true and we reset the default + db_dml update_defaults { update contact_signatures set default_p = 'f' where party_id = :party_id } + } + } -new_data { + db_dml insert_sig { insert into contact_signatures values ( :signature_id, :title, :signature, :default_p, :party_id ) } + } -edit_data { + db_dml update_sig { update contact_signatures set title = :title, signature = :signature, default_p = :default_p where signature_id = :signature_id } + } -after_submit { + ad_returnredirect "settings" + } + Index: openacs-4/packages/contacts/www/admin/relationship-ae.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/contacts/www/admin/relationship-ae.tcl,v diff -u -r1.1 -r1.2 --- openacs-4/packages/contacts/www/admin/relationship-ae.tcl 18 May 2005 16:45:50 -0000 1.1 +++ openacs-4/packages/contacts/www/admin/relationship-ae.tcl 4 Jun 2005 12:36:45 -0000 1.2 @@ -15,34 +15,41 @@ } -validate { type_exists -requires {rel_type} { if { ![db_0or1row get_it { select 1 from contact_rel_types where rel_type = :rel_type}] } { - ad_complain "The contact specified does not exist" + ad_complain "[_ contacts.lt_The_contact_specified]" } } } -set title "Add relationship type" -set context [list [list "[ad_conn package_url]admin/relationships" "Relationship types"] $title] +set title "[_ contacts.lt_Add_relationship_type]" +set context [list [list "[ad_conn package_url]admin/relationships" "[_ contacts.Relationship_types]"] $title] -set object_types_list { - {{Person or Organization} party} - {{Person} person} - {{Organization} organization} -} +set object_types_list [list [list [_ contacts.lt_Person_or_Organizatio] party] \ + [list [_ contacts.Person] person] \ + [list [_ contacts.Organization] organization] + ] +set locale [ad_conn locale] -set roles_list {{{--select one--} {}}} -append roles_list " [db_list_of_lists select_roles { +set roles_list [list [list "[_ contacts.--select_one--]" ""]] + +db_foreach select_roles { select r.pretty_name, r.role - from acs_rel_roles r - order by lower(r.role) -}]" + from acs_rel_roles r + order by lower(r.role)} { + regsub -all {(\#([-a-zA-Z0-9_:\.]+)\#)} $pretty_name {[template::expand_percentage_signs [lang::message::lookup [ad_conn locale] {\2} {TRANSLATION MISSING} {} -1]]} pretty_name + + lappend roles_list [list [subst $pretty_name] $role] + } + +# replace the list with I18N + ad_form -name "rel_type" \ -form { {return_url:text(hidden),optional} - {object_type_one:text(select) {label "Contact Type One"} {options $object_types_list}} - {role_one:text(select) {label "Role One"} {options $roles_list}} - {object_type_two:text(select) {label "Contact Type Two"} {options $object_types_list}} - {role_two:text(select) {label "Role Two"} {options $roles_list}} + {object_type_one:text(select) {label "[_ contacts.Contact_Type_One]"} {options $object_types_list}} + {role_one:text(select) {label "[_ contacts.Role_One]"} {options $roles_list}} + {object_type_two:text(select) {label "[_ contacts.Contact_Type_Two]"} {options $object_types_list}} + {role_two:text(select) {label "[_ contacts.Role_Two]"} {options $roles_list}} } -on_request { # if { [exists_and_not_null rel_type] } { # db_1row get_them { select * from acs_rel_types where rel_type=:rel_type } @@ -64,26 +71,16 @@ set table_name "contact_rel_${next_object_id}" set package_name "contact_rel__${next_object_id}" - db_1row create_rel { - select acs_rel_type__create_type ( - :rel_type, - :pretty_name, - :pretty_plural, - 'contact_rel', - :table_name, - 'rel_id', - :package_name, - :object_type_one, - :role_one, - 0, - NULL, - :object_type_two, - :role_two, - 0, - NULL - ) - } - + rel_types::new -table_name "$table_name" -create_table_p "t" -supertype "contact_rel" -role_one $role_one -role_two $role_two \ + "$rel_type" \ + "$pretty_name" \ + "$pretty_plural" \ + "$object_type_one" \ + "0" \ + "" \ + "$object_type_two" \ + "0" \ + "" } -after_submit { ad_returnredirect $return_url Index: openacs-4/packages/contacts/www/admin/role-ae.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/contacts/www/admin/role-ae.tcl,v diff -u -r1.1 -r1.2 --- openacs-4/packages/contacts/www/admin/role-ae.tcl 18 May 2005 16:45:50 -0000 1.1 +++ openacs-4/packages/contacts/www/admin/role-ae.tcl 4 Jun 2005 12:36:45 -0000 1.2 @@ -39,19 +39,15 @@ -html {maxlength 100} if { [template::form is_valid role_form] } { - set role [util_text_to_url -text $pretty_name -replacement "_" -existing_urls [db_list get_roles { select role from acs_rel_roles }]] if { [db_string role_exists_with_same_names_p { select count(r.role) from acs_rel_roles r where r.pretty_name = :pretty_name or r.pretty_plural = :pretty_plural }] } { ad_return_complaint 1 "
  • The role you entered \"$pretty_name\" or the plural \"$pretty_plural\" already exists." return } - db_transaction { - db_exec_plsql create_role { - select acs_rel_type__create_role(:role, :pretty_name, :pretty_plural) - } - } + rel_types::create_role -pretty_name $pretty_name -pretty_plural $pretty_plural + ad_returnredirect $return_url ad_script_abort } Index: openacs-4/packages/contacts/www/admin/widgets.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/contacts/www/admin/widgets.tcl,v diff -u -r1.3 -r1.4 --- openacs-4/packages/contacts/www/admin/widgets.tcl 18 May 2005 16:45:50 -0000 1.3 +++ openacs-4/packages/contacts/www/admin/widgets.tcl 4 Jun 2005 12:36:45 -0000 1.4 @@ -1,79 +1,79 @@ -ad_page_contract { - - list all attributes avaiable, and let the user edit edit permissions, regroup, etc. - - @author Matthew Geddert openacs@geddert.com - @creation-date 2004-07-28 - @cvs-id $Id$ - -} { - groupby:optional - orderby:optional - {format "normal"} - {status "normal"} -} - -set title "Widgets" -set context [list [list "attributes" "Attributes"] $title] - - -list::create \ - -name entries \ - -multirow entries \ - -key course_id \ - -row_pretty_plural "Attributes" \ - -checkbox_name checkbox \ - -selected_format $format \ - -class "list" \ - -main_class "list" \ - -sub_class "narrow" \ - -pass_properties { - variable - } -actions { - } -bulk_actions { - } -elements { - description { - display_col description - label "Description" - } - widget { - display_col widget - label "Widget" - } - datatype { - display_col datatype - label "Datatype" - } - html { - display_col html - label "HTML" - } - format { - display_col format - label "Format" - } - - } -filters { - } -groupby { - } -orderby { - } -formats { - normal { - label "Table" - layout table - row { - description {} - widget {} - datatype {} - html {} - format {} - } - } - - } - - - -db_multirow -unclobber entries get_widgets "" - - -ad_return_template +ad_page_contract { + + list all attributes avaiable, and let the user edit edit permissions, regroup, etc. + + @author Matthew Geddert openacs@geddert.com + @creation-date 2004-07-28 + @cvs-id $Id$ + +} { + groupby:optional + orderby:optional + {format "normal"} + {status "normal"} +} + +set title "Widgets" +set context [list [list "attributes" "Attributes"] $title] + + +list::create \ + -name entries \ + -multirow entries \ + -key course_id \ + -row_pretty_plural "Attributes" \ + -checkbox_name checkbox \ + -selected_format $format \ + -class "list" \ + -main_class "list" \ + -sub_class "narrow" \ + -pass_properties { + variable + } -actions { + } -bulk_actions { + } -elements { + description { + display_col description + label "Description" + } + widget { + display_col widget + label "Widget" + } + datatype { + display_col datatype + label "Datatype" + } + html { + display_col html + label "HTML" + } + format { + display_col format + label "Format" + } + + } -filters { + } -groupby { + } -orderby { + } -formats { + normal { + label "Table" + layout table + row { + description {} + widget {} + datatype {} + html {} + format {} + } + } + + } + + + +db_multirow -unclobber entries get_widgets "" + + +ad_return_template