Index: openacs-4/contrib/packages/classified-ads/sql/postgresql/ads-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/classified-ads/sql/postgresql/ads-create.sql,v diff -u -r1.1 -r1.2 --- openacs-4/contrib/packages/classified-ads/sql/postgresql/ads-create.sql 16 Jul 2003 04:52:31 -0000 1.1 +++ openacs-4/contrib/packages/classified-ads/sql/postgresql/ads-create.sql 24 Jul 2003 00:11:03 -0000 1.2 @@ -40,12 +40,15 @@ PERFORM ca_attributes__register_widget ( v_attribute_id, -- attribute_name - ''text'', -- widget + ''date'', -- widget ''Ad expires on'', -- label + null, -- keyword_id (NULL because it is site-wide) null, -- html_options + '' -format "MONTH DD YYYY" -help'' -- extra_options null, -- select_options null, -- validate - ''t'' -- optional_p + ''t'', -- optional_p + ''t'' -- enabled_p ); -- register mime_types Index: openacs-4/contrib/packages/classified-ads/sql/postgresql/attributes-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/classified-ads/sql/postgresql/attributes-create.sql,v diff -u -r1.1 -r1.2 --- openacs-4/contrib/packages/classified-ads/sql/postgresql/attributes-create.sql 16 Jul 2003 04:52:31 -0000 1.1 +++ openacs-4/contrib/packages/classified-ads/sql/postgresql/attributes-create.sql 24 Jul 2003 00:11:03 -0000 1.2 @@ -63,7 +63,21 @@ constraint ca_awv_widget_nn not null, label varchar(200), + -- + -- RBM: We have keyword_id here so we can have per-category + -- custom fields. Selling books requires ISBN, but motorcycles + -- requires something else. + -- + keyword_id integer + constraint ca_awv_keyword_id_fk + references cr_keywords(keyword_id) + constraint ca_awv_keyword_id_nn + not null, html_options varchar(400), + -- + -- RBM: If this is not null, use the form builder's -help_text. + -- + help_text text, select_options text, validate text, optional_p char(1) Index: openacs-4/contrib/packages/classified-ads/sql/postgresql/attributes-package-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/classified-ads/sql/postgresql/attributes-package-create.sql,v diff -u -r1.1 -r1.2 --- openacs-4/contrib/packages/classified-ads/sql/postgresql/attributes-package-create.sql 16 Jul 2003 04:52:31 -0000 1.1 +++ openacs-4/contrib/packages/classified-ads/sql/postgresql/attributes-package-create.sql 24 Jul 2003 00:11:03 -0000 1.2 @@ -184,26 +184,32 @@ ' language 'plpgsql'; -select define_function_args('ca_attributes__register_widget','attribute_id,widget,label,html_options,select_options,validate,optional_p'); +select define_function_args('ca_attributes__register_widget','attribute_id,widget,label,keyword_id,html_options,extra_options,select_options,validate,optional_p,enabled_p'); -create or replace function ca_attributes__register_widget (integer,varchar,varchar,varchar,varchar,varchar,varchar) +create or replace function ca_attributes__register_widget (integer,varchar,varchar,integer,varchar,text,varchar,varchar,boolean,boolean) returns integer as ' declare p_attribute_id alias for $1; p_widget alias for $2; p_label alias for $3; - p_html_options alias for $4; - p_select_options alias for $5; - p_validate alias for $6; - p_optional_p alias for $7; + p_keyword_id alias for $4; + p_html_options alias for $5; + p_extra_options alias for $6; + p_select_options alias for $7; + p_validate alias for $8; + p_optional_p alias for $9; + p_enabled_p alias for $10; begin --- DEDS: FIXME - check for options when inserting something that does not support it + -- DEDS: FIXME - check for options when inserting something that does not support it + -- RBM: 07/2003 - What does the above mean? insert into ca_attribute_widget_values - (attribute_id, widget, label, html_options, select_options, validate, optional_p) + ( attribute_id, widget, label, keyword_id, html_options, extra_options, + select_options, validate, optional_p, enabled_p ) values - (p_attribute_id, p_widget, p_label, p_html_options, p_select_options, p_validate, p_optional_p); + ( p_attribute_id, p_widget, p_label, p_keyword_id, p_html_options, p_extra_options, + p_select_options, p_validate, p_optional_p, p_enabled_p ); return null; end;