Index: openacs-4/packages/accounts-ledger/www/doc/index.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/accounts-ledger/www/doc/index.adp,v diff -u -r1.2 -r1.3 --- openacs-4/packages/accounts-ledger/www/doc/index.adp 8 Jun 2006 10:22:28 -0000 1.2 +++ openacs-4/packages/accounts-ledger/www/doc/index.adp 3 Jul 2006 11:24:21 -0000 1.3 @@ -80,4 +80,97 @@ some of the TEXT types were changed to VARCHAR so that they get indexed FLOAT changed to NUMERIC +
These parameters need to be put into their respective packages
++ -- this is a 1-row table + -- it contains all settings that the admin can change from the admin pages + -- most of the configuration is done using the parameters .ini file + -- wtem@olywa.net 03-10-2001 + -- the following two tables probably need an additional column to support subsites + -- in which case it will have multiple rows, one for each instance of ecommerce + -- since these are really parameters for the instance of ecommerce, + -- it might be better to move them to ad_parameters + create table ec_admin_settings ( + -- this is here just so that the insert statement (a page or + -- so down) can't be executed twice + admin_setting_id integer not null primary key, + -- the following columns are related to shipping costs + base_shipping_cost numeric, + default_shipping_per_item numeric, + weight_shipping_cost numeric, + add_exp_base_shipping_cost numeric, + add_exp_amount_per_item numeric, + add_exp_amount_by_weight numeric, + -- default template to use if the product isn't assigned to one + -- (until the admin changes it, it will be 1, which will be + -- the preloaded template) + default_template integer default 1 not null + references ec_templates, + last_modified timestamptz not null, + last_modifying_user integer not null references users, + modified_ip_address varchar(20) not null + ); +-- create table ec_admin_settings_audit ( +-- admin_setting_id integer, +-- base_shipping_cost numeric, +-- default_shipping_per_item numeric, +-- weight_shipping_cost numeric, +-- add_exp_base_shipping_cost numeric, +-- add_exp_amount_per_item numeric, +-- add_exp_amount_by_weight numeric, +-- default_template integer, +-- last_modified timestamptz, +-- last_modifying_user integer, +-- modified_ip_address varchar(20), +-- delete_p boolean default 'f' +-- ); +-- +-- create function ec_admin_settings_audit_tr () +-- returns opaque as ' +-- begin +-- insert into ec_admin_settings_audit ( +-- admin_setting_id, base_shipping_cost, default_shipping_per_item, +-- weight_shipping_cost, add_exp_base_shipping_cost, +-- add_exp_amount_per_item, add_exp_amount_by_weight, +-- default_template, +-- last_modified, +-- last_modifying_user, modified_ip_address +-- ) values ( +-- old.admin_setting_id, old.base_shipping_cost, +-- old.default_shipping_per_item, +-- old.weight_shipping_cost, old.add_exp_base_shipping_cost, +-- old.add_exp_amount_per_item, old.add_exp_amount_by_weight, +-- old.default_template, +-- old.last_modified, +-- old.last_modifying_user, old.modified_ip_address +-- ); +-- return new; +-- end;' language 'plpgsql'; +-- +-- create trigger ec_admin_settings_audit_tr +-- after update or delete on ec_admin_settings +-- for each row execute procedure ec_admin_settings_audit_tr (); +-- +-- -- this is where the ec_amdin_settings insert was +-- +-- +-- -- put one row into ec_admin_settings so that I don't have to use 0or1row +-- insert into ec_admin_settings ( +-- admin_setting_id, +-- default_template, +-- last_modified, +-- last_modifying_user, +-- modified_ip_address +-- ) values ( +-- 1, +-- 1, +-- now(), (select grantee_id +-- from acs_permissions +-- where object_id = acs__magic_object_id('security_context_root') +-- and privilege = 'admin' +-- limit 1), +-- 'none'); +-- +-- +