Index: openacs-4/contrib/packages/classified-ads/tcl/classified-ads-procs-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/classified-ads/tcl/classified-ads-procs-postgresql.xql,v diff -u -r1.2 -r1.3 --- openacs-4/contrib/packages/classified-ads/tcl/classified-ads-procs-postgresql.xql 25 Jul 2003 23:53:19 -0000 1.2 +++ openacs-4/contrib/packages/classified-ads/tcl/classified-ads-procs-postgresql.xql 27 Jul 2003 00:46:16 -0000 1.3 @@ -223,89 +223,43 @@ - + - create function ca_inline_0 () - returns integer as ' - declare - v_attribute_id ca_attributes.attribute_id%TYPE; - begin - v_attribute_id := ca_attributes__create_attribute ( - ''ca_ad'', -- content_type - ''type'', -- attribute_name - ''integer'', -- datatype - ''Type'', -- pretty_name - ''Types'', -- pretty_plural - null, -- sort_order - ''0'', -- default_value - ''type_specific'', -- storage - ''cr_ca_ads'', -- table_name - ''integer'', -- column_spec - null -- package_id + SELECT ca_attributes__create_attribute ( + 'ca_ad', -- content_type + :attribute_name, -- attribute_name + :datatype, -- datatype + :pretty_name, -- pretty_name + :pretty_plural, -- pretty_plural + null, -- sort_order + :default_value, -- default_value + 'type_specific', -- storage + 'cr_ca_ads', -- table_name + :column_spec, -- column_spec + null -- package_id ); - PERFORM ca_attributes__register_widget ( - v_attribute_id, -- attribute_name - ''radio'', -- widget - ''Type'', -- label - :main_keyword_id, -- keyword_id - null, -- html_options - null, -- extra_options - ''{{"For Sale" 0} {"Wanted to Buy" 1}}'', -- select_options - ''{type {![string equal $value 0] && ![string equal $value 1]} {"Invalid option selected, please select For Sale or Wanted to Buy"}}'', -- validate - ''f'', -- optional_p - ''t'' -- enabled_p - ); - - v_attribute_id := ca_attributes__create_attribute ( - ''ca_ad'', -- content_type - ''expires_on'', -- attribute_name - ''date'', -- datatype - ''Expiry Date'', -- pretty_name - ''Expiry Dates'', -- pretty_plural - null, -- sort_order - null, -- default_value - ''type_specific'', -- storage - ''cr_ca_ads'', -- table_name - ''timestamp'', -- column_spec - null -- package_id - ); - - PERFORM ca_attributes__register_widget ( - v_attribute_id, -- attribute_name - ''date'', -- widget - ''Ad expires on'', -- label - :main_keyword_id, -- keyword_id - null, -- html_options - '' -format "MONTH DD YYYY" -help'' -- extra_options - null, -- select_options - null, -- validate - ''t'', -- optional_p - ''t'' -- enabled_p - ); - - return NULL; - end; - ' language 'plpgsql'; - - + - SELECT ca_inline_0(); + SELECT ca_attributes__register_widget ( + :attribute_id, -- attribute_name + :widget , -- widget + :pretty_name, -- label + :main_keyword_id, -- keyword_id + :html_options, -- html_options + :extra_options, -- extra_options + :select_options, -- select_options + :validate, -- validate + :optional_p, -- optional_p + :enabled_p -- enabled_p + ); - - - - - DROP FUNCTION ca_inline_0(); - - - - +