Index: openacs-4/packages/dotlrn/dotlrn.info =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/dotlrn.info,v diff -u -r1.138 -r1.139 --- openacs-4/packages/dotlrn/dotlrn.info 31 Oct 2011 00:50:15 -0000 1.138 +++ openacs-4/packages/dotlrn/dotlrn.info 1 Nov 2013 21:08:28 -0000 1.139 @@ -7,25 +7,26 @@ f f - + OpenACS A Course Management System 2011-10-30 OpenACS Course Management - + + - + @@ -40,24 +41,24 @@ - + - + - + - + @@ -79,14 +80,14 @@ - + - + - + Index: openacs-4/packages/dotlrn/install.xml =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/install.xml,v diff -u -r1.21 -r1.22 --- openacs-4/packages/dotlrn/install.xml 10 Oct 2009 22:38:09 -0000 1.21 +++ openacs-4/packages/dotlrn/install.xml 1 Nov 2013 21:08:28 -0000 1.22 @@ -19,38 +19,41 @@ - - + + - + - + - + - + - - - - - - + + + + + + - + Index: openacs-4/packages/dotlrn/lib/member-email-confirm.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/lib/member-email-confirm.tcl,v diff -u -r1.4 -r1.5 --- openacs-4/packages/dotlrn/lib/member-email-confirm.tcl 29 Sep 2013 13:49:45 -0000 1.4 +++ openacs-4/packages/dotlrn/lib/member-email-confirm.tcl 1 Nov 2013 21:08:28 -0000 1.5 @@ -51,7 +51,7 @@ } -on_submit { if {![info exists btn_cancel] || $btn_cancel eq ""} { set email [template::util::richtext::get_property content $email] - if {![empty_string_p $community_id]} { + if {$community_id ne ""} { foreach one_user_id $user_id { dotlrn_community::send_member_email \ Index: openacs-4/packages/dotlrn/lib/member-email.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/lib/member-email.tcl,v diff -u -r1.5 -r1.6 --- openacs-4/packages/dotlrn/lib/member-email.tcl 9 Nov 2008 23:29:23 -0000 1.5 +++ openacs-4/packages/dotlrn/lib/member-email.tcl 1 Nov 2013 21:08:28 -0000 1.6 @@ -32,7 +32,7 @@ dotlrn::require_user_admin_community -community_id $community_id } -if {[empty_string_p $community_id]} { +if {$community_id eq ""} { db_0or1row member_email { select email_id from dotlrn_member_emails @@ -61,7 +61,7 @@ {email_id:key} } -if {![string equal "" $available_vars_help]} { +if {$available_vars_help ne ""} { ad_form -extend -name "member_email" -form { {help:text(inform) {label "Available variables"} {value $available_vars_help}} } Index: openacs-4/packages/dotlrn/lib/toolbar.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/lib/toolbar.tcl,v diff -u -r1.3 -r1.4 --- openacs-4/packages/dotlrn/lib/toolbar.tcl 9 Nov 2008 23:29:23 -0000 1.3 +++ openacs-4/packages/dotlrn/lib/toolbar.tcl 1 Nov 2013 21:08:28 -0000 1.4 @@ -22,7 +22,7 @@ # hide/show dotlrn toolbar set hide_me_url [export_vars -base "$dotlrn_admin_url/toolbar-actions" {{action hide} return_url}] - if { [empty_string_p $community_id ] } { + if { $community_id eq "" } { set portal_id [dotlrn::get_portal_id -user_id $user_id] } else { set portal_id [dotlrn_community::get_portal_id -community_id $community_id] Index: openacs-4/packages/dotlrn/sql/postgresql/admin-profile-provider-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/sql/postgresql/admin-profile-provider-create.sql,v diff -u -r1.3 -r1.4 --- openacs-4/packages/dotlrn/sql/postgresql/admin-profile-provider-create.sql 8 Aug 2006 21:26:22 -0000 1.3 +++ openacs-4/packages/dotlrn/sql/postgresql/admin-profile-provider-create.sql 1 Nov 2013 21:08:28 -0000 1.4 @@ -21,55 +21,55 @@ -- @version $Id$ -- -create function inline_0() -returns integer as ' -begin +CREATE OR REPLACE FUNCTION inline_0() RETURNS integer AS $$ +BEGIN -- create the implementation perform acs_sc_impl__new( - ''profile_provider'', - ''dotlrn_admin_profile_provider'', - ''dotlrn_admin_profile_provider'' + 'profile_provider', + 'dotlrn_admin_profile_provider', + 'dotlrn_admin_profile_provider' ); -- add the bindings to the method implementations -- name method perform acs_sc_impl_alias__new( - ''profile_provider'', - ''dotlrn_admin_profile_provider'', - ''name'', - ''dotlrn_admin_profile_provider::name'', - ''TCL'' + 'profile_provider', + 'dotlrn_admin_profile_provider', + 'name', + 'dotlrn_admin_profile_provider::name', + 'TCL' ); -- prettyName method perform acs_sc_impl_alias__new( - ''profile_provider'', - ''dotlrn_admin_profile_provider'', - ''prettyName'', - ''dotlrn_admin_profile_provider::prettyName'', - ''TCL'' + 'profile_provider', + 'dotlrn_admin_profile_provider', + 'prettyName', + 'dotlrn_admin_profile_provider::prettyName', + 'TCL' ); -- render method perform acs_sc_impl_alias__new( - ''profile_provider'', - ''dotlrn_admin_profile_provider'', - ''render'', - ''dotlrn_admin_profile_provider::render'', - ''TCL'' + 'profile_provider', + 'dotlrn_admin_profile_provider', + 'render', + 'dotlrn_admin_profile_provider::render', + 'TCL' ); -- bind this implementation to the interface it implements perform acs_sc_binding__new( - ''profile_provider'', - ''dotlrn_admin_profile_provider'' + 'profile_provider', + 'dotlrn_admin_profile_provider' ); return 0; -end;' language 'plpgsql'; +END; +$$ LANGUAGE plpgsql; select inline_0(); drop function inline_0(); Index: openacs-4/packages/dotlrn/sql/postgresql/admin-profile-provider-drop.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/sql/postgresql/admin-profile-provider-drop.sql,v diff -u -r1.3 -r1.4 --- openacs-4/packages/dotlrn/sql/postgresql/admin-profile-provider-drop.sql 8 Aug 2006 21:26:22 -0000 1.3 +++ openacs-4/packages/dotlrn/sql/postgresql/admin-profile-provider-drop.sql 1 Nov 2013 21:08:28 -0000 1.4 @@ -22,51 +22,58 @@ -- @version $Id$ -- -create function inline_0() -returns integer as ' -declare + + +-- +-- procedure inline_0/0 +-- +CREATE OR REPLACE FUNCTION inline_0( + +) RETURNS integer AS $$ +DECLARE foo integer; -begin +BEGIN -- drop the binding between this implementation and the interface it -- implements perform acs_sc_binding__delete( - ''profile_provider'', - ''dotlrn_admin_profile_provider'' + 'profile_provider', + 'dotlrn_admin_profile_provider' ); -- drop the bindings to the method implementations -- name method perform acs_sc_impl_alias__delete( - ''profile_provider'', - ''dotlrn_admin_profile_provider'', - ''name'' + 'profile_provider', + 'dotlrn_admin_profile_provider', + 'name' ); -- prettyName method perform acs_sc_impl_alias__delete( - ''profile_provider'', - ''dotlrn_admin_profile_provider'', - ''prettyName'' + 'profile_provider', + 'dotlrn_admin_profile_provider', + 'prettyName' ); -- render method perform acs_sc_impl_alias__delete( - ''profile_provider'', - ''dotlrn_admin_profile_provider'', - ''render'' + 'profile_provider', + 'dotlrn_admin_profile_provider', + 'render' ); -- drop the implementation perform acs_sc_impl__delete( - ''profile_provider'', - ''dotlrn_admin_profile_provider'' + 'profile_provider', + 'dotlrn_admin_profile_provider' ); return 0; -end; -' language 'plpgsql'; +END; +$$ LANGUAGE plpgsql; + select inline_0(); drop function inline_0(); Index: openacs-4/packages/dotlrn/sql/postgresql/admins-init.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/sql/postgresql/admins-init.sql,v diff -u -r1.5 -r1.6 --- openacs-4/packages/dotlrn/sql/postgresql/admins-init.sql 8 Aug 2006 21:26:22 -0000 1.5 +++ openacs-4/packages/dotlrn/sql/postgresql/admins-init.sql 1 Nov 2013 21:08:28 -0000 1.6 @@ -22,28 +22,34 @@ -- -create function inline_1() -returns integer as ' -declare + + +-- +-- procedure inline_1/0 +-- +CREATE OR REPLACE FUNCTION inline_1( + +) RETURNS integer AS $$ +DECLARE foo integer; gid integer; sid integer; dotlrn_users_group_id integer; -begin +BEGIN PERFORM acs_rel_type__create_type( - ''dotlrn_admin_profile_rel'', - ''dotLRN Profile Admin'', - ''dotLRN Profile Admins'', - ''dotlrn_user_profile_rel'', - ''dotlrn_admin_profile_rels'', - ''rel_id'', - ''dotlrn_admin_profile_rel'', - ''profiled_group'', + 'dotlrn_admin_profile_rel', + 'dotLRN Profile Admin', + 'dotLRN Profile Admins', + 'dotlrn_user_profile_rel', + 'dotlrn_admin_profile_rels', + 'rel_id', + 'dotlrn_admin_profile_rel', + 'profiled_group', null, 0, null, - ''user'', + 'user', null, 0, 1 @@ -52,29 +58,29 @@ select min(impl_id) into foo from acs_sc_impls - where impl_name = ''dotlrn_admin_profile_provider''; + where impl_name = 'dotlrn_admin_profile_provider'; gid := profiled_group__new( foo, - ''dotLRN Admins'' + 'dotLRN Admins' ); sid := rel_segment__new( - ''dotLRN Admins'', + 'dotLRN Admins', gid, - ''dotlrn_admin_profile_rel'' + 'dotlrn_admin_profile_rel' ); insert into dotlrn_user_types (type, pretty_name, rel_type, group_id, segment_id) values - (''admin'', ''#dotlrn.user_type_staff_pretty_name#'', ''dotlrn_admin_profile_rel'', gid, sid); + ('admin', '#dotlrn.user_type_staff_pretty_name#', 'dotlrn_admin_profile_rel', gid, sid); select group_id into dotlrn_users_group_id from groups - where group_name = ''dotLRN Users''; + where group_name = 'dotLRN Users'; foo := composition_rel__new( dotlrn_users_group_id, @@ -83,8 +89,9 @@ return 0; -end; -' language 'plpgsql'; +END; +$$ LANGUAGE plpgsql; + select inline_1(); drop function inline_1(); Index: openacs-4/packages/dotlrn/sql/postgresql/admins-package-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/sql/postgresql/admins-package-create.sql,v diff -u -r1.4 -r1.5 --- openacs-4/packages/dotlrn/sql/postgresql/admins-package-create.sql 8 Aug 2006 21:26:22 -0000 1.4 +++ openacs-4/packages/dotlrn/sql/postgresql/admins-package-create.sql 1 Nov 2013 21:08:28 -0000 1.5 @@ -26,18 +26,24 @@ select define_function_args ('dotlrn_admin_profile_rel__delete','rel_id'); -create function dotlrn_admin_profile_rel__new(integer,integer,integer,integer,varchar,varchar,integer,integer,varchar) -returns integer as ' + + +-- +-- procedure dotlrn_admin_profile_rel__new/9 +-- +CREATE OR REPLACE FUNCTION dotlrn_admin_profile_rel__new( + p_rel_id integer, + p_user_id integer, + p_portal_id integer, + p_theme_id integer, + p_id varchar, + p_rel_type varchar, -- default 'dotlrn_admin_profile_rel' + p_group_id integer, + p_creation_user integer, + p_creation_ip varchar + +) RETURNS integer AS $$ DECLARE - p_rel_id alias for $1; - p_user_id alias for $2; - p_portal_id alias for $3; - p_theme_id alias for $4; - p_id alias for $5; - p_rel_type alias for $6; - p_group_id alias for $7; - p_creation_user alias for $8; - p_creation_ip alias for $9; v_rel_id dotlrn_user_profile_rels.rel_id%TYPE; v_group_id groups.group_id%TYPE; BEGIN @@ -47,7 +53,7 @@ from profiled_groups where profile_provider = (select min(impl_id) from acs_sc_impls - where impl_name = ''dotlrn_admin_profile_provider''); + where impl_name = 'dotlrn_admin_profile_provider'); else v_group_id := p_group_id; end if; @@ -72,13 +78,19 @@ return v_rel_id; END; -' language 'plpgsql'; +$$ LANGUAGE plpgsql; -create function dotlrn_admin_profile_rel__delete(integer) -returns integer as ' + + + +-- +-- procedure dotlrn_admin_profile_rel__delete/1 +-- +CREATE OR REPLACE FUNCTION dotlrn_admin_profile_rel__delete( + p_rel_id integer +) RETURNS integer AS $$ DECLARE - p_rel_id alias for $1; BEGIN delete from dotlrn_admin_profile_rels @@ -87,6 +99,7 @@ PERFORM dotlrn_user_profile_rel__delete(p_rel_id); return (0); END; -' language 'plpgsql'; +$$ LANGUAGE plpgsql; + Index: openacs-4/packages/dotlrn/sql/postgresql/admins-sanitize.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/sql/postgresql/admins-sanitize.sql,v diff -u -r1.3 -r1.4 --- openacs-4/packages/dotlrn/sql/postgresql/admins-sanitize.sql 8 Aug 2006 21:26:22 -0000 1.3 +++ openacs-4/packages/dotlrn/sql/postgresql/admins-sanitize.sql 1 Nov 2013 21:08:28 -0000 1.4 @@ -22,42 +22,55 @@ -- @version $Id$ -- -create function inline_0() -returns integer as ' -declare + + +-- +-- procedure inline_0/0 +-- +CREATE OR REPLACE FUNCTION inline_0( + +) RETURNS integer AS $$ +DECLARE foo integer; -begin +BEGIN select min(segment_id) into foo from rel_segments - where segment_name = ''dotLRN Full Profiled Admins''; + where segment_name = 'dotLRN Full Profiled Admins'; perform rel_segment__delete( foo ); perform acs_rel_type__drop_type( - ''dotlrn_full_admin_profile_rel'', - ''t'' + 'dotlrn_full_admin_profile_rel', + 't' ); return 0; -end; -' language 'plpgsql'; +END; + +$$ LANGUAGE plpgsql; select inline_0(); drop function inline_0(); -create function inline_1() -returns integer as ' -declare + + +-- +-- procedure inline_1/0 +-- +CREATE OR REPLACE FUNCTION inline_1( + +) RETURNS integer AS $$ +DECLARE foo integer; -begin +BEGIN select min(segment_id) into foo from rel_segments - where segment_name = ''dotLRN Profiled Admins''; + where segment_name = 'dotLRN Profiled Admins'; perform rel_segment__delete( foo @@ -68,7 +81,7 @@ from profiled_groups where profile_provider = (select min(impl_id) from acs_sc_impls - where impl_name = ''dotlrn_admin_profile_provider''); + where impl_name = 'dotlrn_admin_profile_provider'); delete from dotlrn_user_types @@ -79,13 +92,14 @@ ); perform acs_rel_type__drop_type( - ''dotlrn_admin_profile_rel'', - ''t'' + 'dotlrn_admin_profile_rel', + 't' ); return 0; -end; -' language 'plpgsql'; +END; +$$ LANGUAGE plpgsql; + select inline_1(); drop function inline_1(); Index: openacs-4/packages/dotlrn/sql/postgresql/applet-sc-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/sql/postgresql/applet-sc-create.sql,v diff -u -r1.3 -r1.4 --- openacs-4/packages/dotlrn/sql/postgresql/applet-sc-create.sql 9 Aug 2002 18:39:25 -0000 1.3 +++ openacs-4/packages/dotlrn/sql/postgresql/applet-sc-create.sql 1 Nov 2013 21:08:29 -0000 1.4 @@ -33,303 +33,303 @@ -- **** SEE THE ORACLE VERSION FOR FULL DESCRIPTIONS **** -- -create function inline_0() -returns integer as ' -begin +CREATE OR REPLACE FUNCTION inline_0() RETURNS integer AS $$ +BEGIN perform acs_sc_contract__new ( - ''dotlrn_applet'', - ''dotLRN Applet contract'' + 'dotlrn_applet', + 'dotLRN Applet contract' ); -- Get a pretty name perform acs_sc_msg_type__new ( - ''dotlrn_applet.GetPrettyName.InputType'', - '''' + 'dotlrn_applet.GetPrettyName.InputType', + '' ); perform acs_sc_msg_type__new ( - ''dotlrn_applet.GetPrettyName.OutputType'', - ''pretty_name:string'' + 'dotlrn_applet.GetPrettyName.OutputType', + 'pretty_name:string' ); perform acs_sc_operation__new ( - ''dotlrn_applet'', - ''GetPrettyName'', - ''Get the pretty name of the applet'', - ''t'', + 'dotlrn_applet', + 'GetPrettyName', + 'Get the pretty name of the applet', + 't', 0, - ''dotlrn_applet.GetPrettyName.InputType'', - ''dotlrn_applet.GetPrettyName.OutputType'' + 'dotlrn_applet.GetPrettyName.InputType', + 'dotlrn_applet.GetPrettyName.OutputType' ); -- Add the applet to dotlrn (used for one-time initialization) perform acs_sc_msg_type__new( - ''dotlrn_applet.AddApplet.InputType'', - '''' + 'dotlrn_applet.AddApplet.InputType', + '' ); perform acs_sc_msg_type__new( - ''dotlrn_applet.AddApplet.OutputType'', - ''success_p:boolean,error_message:string'' + 'dotlrn_applet.AddApplet.OutputType', + 'success_p:boolean,error_message:string' ); perform acs_sc_operation__new ( - ''dotlrn_applet'', - ''AddApplet'', - ''Add the Applet to dotlrn - used for one-time initialization'', - ''f'', + 'dotlrn_applet', + 'AddApplet', + 'Add the Applet to dotlrn - used for one-time initialization', + 'f', 0, - ''dotlrn_applet.AddApplet.InputType'', - ''dotlrn_applet.AddApplet.OutputType'' + 'dotlrn_applet.AddApplet.InputType', + 'dotlrn_applet.AddApplet.OutputType' ); -- RemoveApplet: Removes the applet from dotlrn (used for one-time destroy) -- ** Not yet implimented ** perform acs_sc_msg_type__new( - ''dotlrn_applet.RemoveApplet.InputType'', - '''' + 'dotlrn_applet.RemoveApplet.InputType', + '' ); perform acs_sc_msg_type__new( - ''dotlrn_applet.RemoveApplet.OutputType'', - ''success_p:boolean,error_message:string'' + 'dotlrn_applet.RemoveApplet.OutputType', + 'success_p:boolean,error_message:string' ); perform acs_sc_operation__new ( - ''dotlrn_applet'', - ''RemoveApplet'', - ''Remove the applet'', - ''f'', + 'dotlrn_applet', + 'RemoveApplet', + 'Remove the applet', + 'f', 0, - ''dotlrn_applet.RemoveApplet.InputType'', - ''dotlrn_applet.RemoveApplet.OutputType'' + 'dotlrn_applet.RemoveApplet.InputType', + 'dotlrn_applet.RemoveApplet.OutputType' ); -- Add the applet to a community -- Called at community creation time. Adding applets after creation time -- is ** not implimented yet ** perform acs_sc_msg_type__new( - ''dotlrn_applet.AddAppletToCommunity.InputType'', - ''community_id:integer'' + 'dotlrn_applet.AddAppletToCommunity.InputType', + 'community_id:integer' ); perform acs_sc_msg_type__new( - ''dotlrn_applet.AddAppletToCommunity.OutputType'', - ''success_p:boolean,error_message:string'' + 'dotlrn_applet.AddAppletToCommunity.OutputType', + 'success_p:boolean,error_message:string' ); perform acs_sc_operation__new ( - ''dotlrn_applet'', - ''AddAppletToCommunity'', - ''Add the Applet to a specific dotlrn community'', - ''f'', + 'dotlrn_applet', + 'AddAppletToCommunity', + 'Add the Applet to a specific dotlrn community', + 'f', 1, - ''dotlrn_applet.AddAppletToCommunity.InputType'', - ''dotlrn_applet.AddAppletToCommunity.OutputType'' + 'dotlrn_applet.AddAppletToCommunity.InputType', + 'dotlrn_applet.AddAppletToCommunity.OutputType' ); -- RemoveAppletFromCommunity: Removes the appletl from a community -- Called at community delete time. Deleting applets before that time -- ** not implimented yet ** perform acs_sc_msg_type__new( - ''dotlrn_applet.RemoveAppletFromCommunity.InputType'', - ''community_id:integer'' + 'dotlrn_applet.RemoveAppletFromCommunity.InputType', + 'community_id:integer' ); perform acs_sc_msg_type__new( - ''dotlrn_applet.RemoveAppletFromCommunity.OutputType'', - ''success_p:boolean,error_message:string'' + 'dotlrn_applet.RemoveAppletFromCommunity.OutputType', + 'success_p:boolean,error_message:string' ); perform acs_sc_operation__new ( - ''dotlrn_applet'', - ''RemoveAppletFromCommunity'', - ''Remove the applet from a given community'', - ''f'', + 'dotlrn_applet', + 'RemoveAppletFromCommunity', + 'Remove the applet from a given community', + 'f', 1, - ''dotlrn_applet.RemoveAppletFromCommunity.InputType'', - ''dotlrn_applet.RemoveAppletFromCommunity.OutputType'' + 'dotlrn_applet.RemoveAppletFromCommunity.InputType', + 'dotlrn_applet.RemoveAppletFromCommunity.OutputType' ); -- add a user to dotlrn (used for user-specific one time stuff) -- Called when a user is added as a dotlrn user. An example: -- dotlrn-calendar will create a personal calendar for the new user. perform acs_sc_msg_type__new( - ''dotlrn_applet.AddUser.InputType'', - ''user_id:integer'' + 'dotlrn_applet.AddUser.InputType', + 'user_id:integer' ); perform acs_sc_msg_type__new( - ''dotlrn_applet.AddUser.OutputType'', - ''success_p:boolean,error_message:string'' + 'dotlrn_applet.AddUser.OutputType', + 'success_p:boolean,error_message:string' ); perform acs_sc_operation__new ( - ''dotlrn_applet'', - ''AddUser'', - ''Add a user to dotlrn, used for user-specific one-time init'', - ''f'', + 'dotlrn_applet', + 'AddUser', + 'Add a user to dotlrn, used for user-specific one-time init', + 'f', 1, - ''dotlrn_applet.AddUser.InputType'', - ''dotlrn_applet.AddUser.OutputType'' + 'dotlrn_applet.AddUser.InputType', + 'dotlrn_applet.AddUser.OutputType' ); -- RemoveUser: used for user-specific one time stuff -- Just like AddUser above, but when we delete a dotlrn user - -- Example: dotlrn-calendar would delete the user''s personal calendar + -- Example: dotlrn-calendar would delete the user's personal calendar perform acs_sc_msg_type__new( - ''dotlrn_applet.RemoveUser.InputType'', - ''user_id:integer'' + 'dotlrn_applet.RemoveUser.InputType', + 'user_id:integer' ); perform acs_sc_msg_type__new( - ''dotlrn_applet.RemoveUser.OutputType'', - ''success_p:boolean,error_message:string'' + 'dotlrn_applet.RemoveUser.OutputType', + 'success_p:boolean,error_message:string' ); perform acs_sc_operation__new ( - ''dotlrn_applet'', - ''RemoveUser'', - ''Remove a user from dotlrn'', - ''f'', + 'dotlrn_applet', + 'RemoveUser', + 'Remove a user from dotlrn', + 'f', 1, - ''dotlrn_applet.RemoveUser.InputType'', - ''dotlrn_applet.RemoveUser.OutputType'' + 'dotlrn_applet.RemoveUser.InputType', + 'dotlrn_applet.RemoveUser.OutputType' ); -- AddUserToCommunity: Adds a user to the a specfic dotlrn community. - -- An example of this is to make the community''s calendar items - -- visable on user''s personal calendar + -- An example of this is to make the community's calendar items + -- visable on user's personal calendar perform acs_sc_msg_type__new( - ''dotlrn_applet.AddUserToCommunity.InputType'', - ''community_id:integer,user_id:integer'' + 'dotlrn_applet.AddUserToCommunity.InputType', + 'community_id:integer,user_id:integer' ); perform acs_sc_msg_type__new( - ''dotlrn_applet.AddUserToCommunity.OutputType'', - ''success_p:boolean,error_message:string'' + 'dotlrn_applet.AddUserToCommunity.OutputType', + 'success_p:boolean,error_message:string' ); perform acs_sc_operation__new ( - ''dotlrn_applet'', - ''AddUserToCommunity'', - ''Add a user to a community'', - ''f'', + 'dotlrn_applet', + 'AddUserToCommunity', + 'Add a user to a community', + 'f', 2, - ''dotlrn_applet.AddUserToCommunity.InputType'', - ''dotlrn_applet.AddUserToCommunity.OutputType'' + 'dotlrn_applet.AddUserToCommunity.InputType', + 'dotlrn_applet.AddUserToCommunity.OutputType' ); -- RemoveUserFromCommunity: Removes a user from a specfic dotlrn -- community. Just like above, but removal. perform acs_sc_msg_type__new( - ''dotlrn_applet.RemoveUserFromCommunity.InputType'', - ''community_id:integer,user_id:integer'' + 'dotlrn_applet.RemoveUserFromCommunity.InputType', + 'community_id:integer,user_id:integer' ); perform acs_sc_msg_type__new( - ''dotlrn_applet.RemoveUserFromCommunity.OutputType'', - ''success_p:boolean,error_message:string'' + 'dotlrn_applet.RemoveUserFromCommunity.OutputType', + 'success_p:boolean,error_message:string' ); perform acs_sc_operation__new ( - ''dotlrn_applet'', - ''RemoveUserFromCommunity'', - ''Remove a user from a community, applet does appropriate cleanup'', - ''f'', + 'dotlrn_applet', + 'RemoveUserFromCommunity', + 'Remove a user from a community, applet does appropriate cleanup', + 'f', 2, - ''dotlrn_applet.RemoveUserFromCommunity.InputType'', - ''dotlrn_applet.RemoveUserFromCommunity.OutputType'' + 'dotlrn_applet.RemoveUserFromCommunity.InputType', + 'dotlrn_applet.RemoveUserFromCommunity.OutputType' ); -- AddPortlet: Adds the underlying portlet to the given portal perform acs_sc_msg_type__new( - ''dotlrn_applet.AddPortlet.InputType'', - ''portal_id:integer'' + 'dotlrn_applet.AddPortlet.InputType', + 'portal_id:integer' ); perform acs_sc_msg_type__new( - ''dotlrn_applet.AddPortlet.OutputType'', - ''success_p:boolean,error_message:string'' + 'dotlrn_applet.AddPortlet.OutputType', + 'success_p:boolean,error_message:string' ); perform acs_sc_operation__new ( - ''dotlrn_applet'', - ''AddPortlet'', - ''Adds the underlying portlet to the portal specified'', - ''f'', + 'dotlrn_applet', + 'AddPortlet', + 'Adds the underlying portlet to the portal specified', + 'f', 1, - ''dotlrn_applet.AddPortlet.InputType'', - ''dotlrn_applet.AddPortlet.OutputType'' + 'dotlrn_applet.AddPortlet.InputType', + 'dotlrn_applet.AddPortlet.OutputType' ); -- RemovePortlet: the remove corollary of above perform acs_sc_msg_type__new( - ''dotlrn_applet.RemovePortlet.InputType'', - ''portal_id:integer,args:string'' + 'dotlrn_applet.RemovePortlet.InputType', + 'portal_id:integer,args:string' ); perform acs_sc_msg_type__new( - ''dotlrn_applet.RemovePortlet.OutputType'', - ''success_p:boolean,error_message:string'' + 'dotlrn_applet.RemovePortlet.OutputType', + 'success_p:boolean,error_message:string' ); perform acs_sc_operation__new ( - ''dotlrn_applet'', - ''RemovePortlet'', - ''Removes the underlying portlet from the given portal'', - ''f'', + 'dotlrn_applet', + 'RemovePortlet', + 'Removes the underlying portlet from the given portal', + 'f', 2, - ''dotlrn_applet.RemovePortlet.InputType'', - ''dotlrn_applet.RemovePortlet.OutputType'' + 'dotlrn_applet.RemovePortlet.InputType', + 'dotlrn_applet.RemovePortlet.OutputType' ); -- Clone: Attack of the Clones! perform acs_sc_msg_type__new( - ''dotlrn_applet.Clone.InputType'', - ''old_community_id:integer,new_community_id:integer'' + 'dotlrn_applet.Clone.InputType', + 'old_community_id:integer,new_community_id:integer' ); perform acs_sc_msg_type__new( - ''dotlrn_applet.Clone.OutputType'', - ''success_p:boolean,error_message:string'' + 'dotlrn_applet.Clone.OutputType', + 'success_p:boolean,error_message:string' ); perform acs_sc_operation__new ( - ''dotlrn_applet'', - ''Clone'', - ''Clone this applets content from the old to the new community'', - ''f'', + 'dotlrn_applet', + 'Clone', + 'Clone this applets content from the old to the new community', + 'f', 2, - ''dotlrn_applet.Clone.InputType'', - ''dotlrn_applet.Clone.OutputType'' + 'dotlrn_applet.Clone.InputType', + 'dotlrn_applet.Clone.OutputType' ); perform acs_sc_msg_type__new( - ''dotlrn_applet.ChangeEventHandler.InputType'', - ''community_id:integer,event:string,old_value:string,new_value:string'' + 'dotlrn_applet.ChangeEventHandler.InputType', + 'community_id:integer,event:string,old_value:string,new_value:string' ); perform acs_sc_msg_type__new( - ''dotlrn_applet.ChangeEventHandler.OutputType'', - ''success_p:boolean,error_message:string'' + 'dotlrn_applet.ChangeEventHandler.OutputType', + 'success_p:boolean,error_message:string' ); perform acs_sc_operation__new ( - ''dotlrn_applet'', - ''ChangeEventHandler'', - ''Handles changes to communities'', - ''f'', + 'dotlrn_applet', + 'ChangeEventHandler', + 'Handles changes to communities', + 'f', 4, - ''dotlrn_applet.ChangeEventHandler.InputType'', - ''dotlrn_applet.ChangeEventHandler.OutputType'' + 'dotlrn_applet.ChangeEventHandler.InputType', + 'dotlrn_applet.ChangeEventHandler.OutputType' ); return 0; -end; -' language 'plpgsql'; +END; +$$ LANGUAGE plpgsql; + select inline_0(); drop function inline_0(); Index: openacs-4/packages/dotlrn/sql/postgresql/applet-sc-drop.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/sql/postgresql/applet-sc-drop.sql,v diff -u -r1.3 -r1.4 --- openacs-4/packages/dotlrn/sql/postgresql/applet-sc-drop.sql 9 Aug 2002 18:39:25 -0000 1.3 +++ openacs-4/packages/dotlrn/sql/postgresql/applet-sc-drop.sql 1 Nov 2013 21:08:29 -0000 1.4 @@ -23,186 +23,186 @@ -- @author dan chak (chak@openforce.net) -- porting to PG on 2002-07-01 -create function inline_0() -returns integer as ' -begin +CREATE OR REPLACE FUNCTION inline_0() RETURNS integer AS $$ +BEGIN perform acs_sc_operation__delete( - ''dotlrn_applet'', - ''GetPrettyName'' + 'dotlrn_applet', + 'GetPrettyName' ); perform acs_sc_msg_type__delete( - ''dotlrn_applet.GetPrettyName.InputType'' + 'dotlrn_applet.GetPrettyName.InputType' ); perform acs_sc_msg_type__delete( - ''dotlrn_applet.GetPrettyName.OutputType'' + 'dotlrn_applet.GetPrettyName.OutputType' ); perform acs_sc_operation__delete( - ''dotlrn_applet'', - ''AddApplet'' + 'dotlrn_applet', + 'AddApplet' ); perform acs_sc_msg_type__delete( - ''dotlrn_applet.AddApplet.InputType'' + 'dotlrn_applet.AddApplet.InputType' ); perform acs_sc_msg_type__delete( - ''dotlrn_applet.AddApplet.OutputType'' + 'dotlrn_applet.AddApplet.OutputType' ); perform acs_sc_operation__delete( - ''dotlrn_applet'', - ''RemoveApplet'' + 'dotlrn_applet', + 'RemoveApplet' ); perform acs_sc_msg_type__delete( - ''dotlrn_applet.RemoveApplet.InputType'' + 'dotlrn_applet.RemoveApplet.InputType' ); perform acs_sc_msg_type__delete( - ''dotlrn_applet.RemoveApplet.OutputType'' + 'dotlrn_applet.RemoveApplet.OutputType' ); perform acs_sc_operation__delete( - ''dotlrn_applet'', - ''AddAppletToCommunity'' + 'dotlrn_applet', + 'AddAppletToCommunity' ); perform acs_sc_msg_type__delete( - ''dotlrn_applet.AddAppletToCommunity.InputType'' + 'dotlrn_applet.AddAppletToCommunity.InputType' ); perform acs_sc_msg_type__delete( - ''dotlrn_applet.AddAppletToCommunity.OutputType'' + 'dotlrn_applet.AddAppletToCommunity.OutputType' ); perform acs_sc_operation__delete( - ''dotlrn_applet'', - ''RemoveAppletFromCommunity'' + 'dotlrn_applet', + 'RemoveAppletFromCommunity' ); perform acs_sc_msg_type__delete( - ''dotlrn_applet.RemoveAppletFromCommunity.InputType'' + 'dotlrn_applet.RemoveAppletFromCommunity.InputType' ); perform acs_sc_msg_type__delete( - ''dotlrn_applet.RemoveAppletFromCommunity.OutputType'' + 'dotlrn_applet.RemoveAppletFromCommunity.OutputType' ); perform acs_sc_operation__delete( - ''dotlrn_applet'', - ''AddUser'' + 'dotlrn_applet', + 'AddUser' ); perform acs_sc_msg_type__delete( - ''dotlrn_applet.AddUser.InputType'' + 'dotlrn_applet.AddUser.InputType' ); perform acs_sc_msg_type__delete( - ''dotlrn_applet.AddUser.OutputType'' + 'dotlrn_applet.AddUser.OutputType' ); perform acs_sc_operation__delete( - ''dotlrn_applet'', - ''RemoveUser'' + 'dotlrn_applet', + 'RemoveUser' ); perform acs_sc_msg_type__delete( - ''dotlrn_applet.RemoveUser.InputType'' + 'dotlrn_applet.RemoveUser.InputType' ); perform acs_sc_msg_type__delete( - ''dotlrn_applet.RemoveUser.OutputType'' + 'dotlrn_applet.RemoveUser.OutputType' ); perform acs_sc_operation__delete( - ''dotlrn_applet'', - ''AddUserToCommunity'' + 'dotlrn_applet', + 'AddUserToCommunity' ); perform acs_sc_msg_type__delete( - ''dotlrn_applet.AddUserToCommunity.InputType'' + 'dotlrn_applet.AddUserToCommunity.InputType' ); perform acs_sc_msg_type__delete( - ''dotlrn_applet.AddUserToCommunity.OutputType'' + 'dotlrn_applet.AddUserToCommunity.OutputType' ); perform acs_sc_operation__delete( - ''dotlrn_applet'', - ''RemoveUserFromCommunity'' + 'dotlrn_applet', + 'RemoveUserFromCommunity' ); perform acs_sc_msg_type__delete( - ''dotlrn_applet.RemoveUserFromCommunity.InputType'' + 'dotlrn_applet.RemoveUserFromCommunity.InputType' ); perform acs_sc_msg_type__delete( - ''dotlrn_applet.RemoveUserFromCommunity.OutputType'' + 'dotlrn_applet.RemoveUserFromCommunity.OutputType' ); perform acs_sc_operation__delete( - ''dotlrn_applet'', - ''AddPortlet'' + 'dotlrn_applet', + 'AddPortlet' ); perform acs_sc_msg_type__delete( - ''dotlrn_applet.AddPortlet.InputType'' + 'dotlrn_applet.AddPortlet.InputType' ); perform acs_sc_msg_type__delete( - ''dotlrn_applet.AddPortlet.OutputType'' + 'dotlrn_applet.AddPortlet.OutputType' ); perform acs_sc_operation__delete( - ''dotlrn_applet'', - ''RemovePortlet'' + 'dotlrn_applet', + 'RemovePortlet' ); perform acs_sc_msg_type__delete( - ''dotlrn_applet.RemovePortlet.InputType'' + 'dotlrn_applet.RemovePortlet.InputType' ); perform acs_sc_msg_type__delete( - ''dotlrn_applet.RemovePortlet.OutputType'' + 'dotlrn_applet.RemovePortlet.OutputType' ); perform acs_sc_operation__delete( - ''dotlrn_applet'', - ''Clone'' + 'dotlrn_applet', + 'Clone' ); perform acs_sc_msg_type__delete( - ''dotlrn_applet.Clone.InputType'' + 'dotlrn_applet.Clone.InputType' ); perform acs_sc_msg_type__delete( - ''dotlrn_applet.Clone.OutputType'' + 'dotlrn_applet.Clone.OutputType' ); perform acs_sc_operation__delete( - ''dotlrn_applet'', - ''ChangeEventHandler'' + 'dotlrn_applet', + 'ChangeEventHandler' ); perform acs_sc_msg_type__delete( - ''dotlrn_applet.ChangeEventHandler.InputType'' + 'dotlrn_applet.ChangeEventHandler.InputType' ); perform acs_sc_msg_type__delete( - ''dotlrn_applet.ChangeEventHandler.OutputType'' + 'dotlrn_applet.ChangeEventHandler.OutputType' ); perform acs_sc_contract__delete( - ''dotlrn_applet'' + 'dotlrn_applet' ); return 0; -end;' language 'plpgsql'; +END; +$$ LANGUAGE plpgsql; select inline_0(); drop function inline_0(); Index: openacs-4/packages/dotlrn/sql/postgresql/class-membership-drop.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/sql/postgresql/class-membership-drop.sql,v diff -u -r1.3 -r1.4 --- openacs-4/packages/dotlrn/sql/postgresql/class-membership-drop.sql 8 Aug 2006 21:26:22 -0000 1.3 +++ openacs-4/packages/dotlrn/sql/postgresql/class-membership-drop.sql 1 Nov 2013 21:08:29 -0000 1.4 @@ -24,38 +24,38 @@ -- @version $Id$ -- -create function inline_0() -returns integer as ' -begin +CREATE OR REPLACE FUNCTION inline_0() RETURNS integer AS $$ +BEGIN perform acs_rel_type__drop_type ( - ''dotlrn_student_rel'', - ''t'' + 'dotlrn_student_rel', + 't' ); perform acs_rel_type__drop_type ( - ''dotlrn_ta_rel'', - ''t'' + 'dotlrn_ta_rel', + 't' ); perform acs_rel_type__drop_type ( - ''dotlrn_ca_rel'', - ''t'' + 'dotlrn_ca_rel', + 't' ); perform acs_rel_type__drop_type ( - ''dotlrn_cadmin_rel'', - ''t'' + 'dotlrn_cadmin_rel', + 't' ); perform acs_rel_type__drop_type ( - ''dotlrn_instructor_rel'', - ''t'' + 'dotlrn_instructor_rel', + 't' ); return 0; -end;' language 'plpgsql'; +END; +$$ LANGUAGE plpgsql; select inline_0(); drop function inline_0(); Index: openacs-4/packages/dotlrn/sql/postgresql/class-memberships-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/sql/postgresql/class-memberships-create.sql,v diff -u -r1.3 -r1.4 --- openacs-4/packages/dotlrn/sql/postgresql/class-memberships-create.sql 8 Aug 2006 21:26:22 -0000 1.3 +++ openacs-4/packages/dotlrn/sql/postgresql/class-memberships-create.sql 1 Nov 2013 21:08:29 -0000 1.4 @@ -125,101 +125,101 @@ where dotlrn_admin_rels_full.rel_id = dotlrn_instructor_rels.rel_id; -create function inline_0() -returns integer as ' -begin +CREATE OR REPLACE FUNCTION inline_0() RETURNS integer AS $$ +BEGIN perform acs_rel_type__create_type ( - ''dotlrn_student_rel'', - ''dotLRN Student Community Membership'', - ''dotLRN Student Community Memberships'', - ''dotlrn_member_rel'', - ''dotlrn_student_rels'', - ''rel_id'', - ''dotlrn_student_rel'', - ''dotlrn_class_instance'', + 'dotlrn_student_rel', + 'dotLRN Student Community Membership', + 'dotLRN Student Community Memberships', + 'dotlrn_member_rel', + 'dotlrn_student_rels', + 'rel_id', + 'dotlrn_student_rel', + 'dotlrn_class_instance', null, 0, null, - ''user'', - ''student'', + 'user', + 'student', 0, null ); perform acs_rel_type__create_type ( - ''dotlrn_ta_rel'', - ''dotLRN Teaching Assistant Community Membership'', - ''dotLRN Teaching Assistant Community Memberships'', - ''dotlrn_admin_rel'', - ''dotlrn_ta_rels'', - ''rel_id'', - ''dotlrn_ta_rel'', - ''dotlrn_class_instance'', + 'dotlrn_ta_rel', + 'dotLRN Teaching Assistant Community Membership', + 'dotLRN Teaching Assistant Community Memberships', + 'dotlrn_admin_rel', + 'dotlrn_ta_rels', + 'rel_id', + 'dotlrn_ta_rel', + 'dotlrn_class_instance', null, 0, null, - ''user'', - ''teaching_assistant'', + 'user', + 'teaching_assistant', 0, null ); perform acs_rel_type__create_type ( - ''dotlrn_ca_rel'', - ''dotLRN Course Assitant Community Membership'', - ''dotLRN Course Assitant Community Memberships'', - ''dotlrn_admin_rel'', - ''dotlrn_ca_rels'', - ''rel_id'', - ''dotlrn_ca_rel'', - ''dotlrn_class_instance'', null, + 'dotlrn_ca_rel', + 'dotLRN Course Assitant Community Membership', + 'dotLRN Course Assitant Community Memberships', + 'dotlrn_admin_rel', + 'dotlrn_ca_rels', + 'rel_id', + 'dotlrn_ca_rel', + 'dotlrn_class_instance', null, 0, null, - ''user'', - ''course_assistant'', + 'user', + 'course_assistant', 0, null ); perform acs_rel_type__create_type ( - ''dotlrn_cadmin_rel'', - ''dotLRN Course Administrator Community Membership'', - ''dotLRN Course Administrator Community Memberships'', - ''dotlrn_admin_rel'', - ''dotlrn_cadmin_rels'', - ''rel_id'', - ''dotlrn_cadmin_rel'', - ''dotlrn_class_instance'', + 'dotlrn_cadmin_rel', + 'dotLRN Course Administrator Community Membership', + 'dotLRN Course Administrator Community Memberships', + 'dotlrn_admin_rel', + 'dotlrn_cadmin_rels', + 'rel_id', + 'dotlrn_cadmin_rel', + 'dotlrn_class_instance', null, 0, null, - ''user'', - ''course_admin'', + 'user', + 'course_admin', 0, null ); perform acs_rel_type__create_type ( - ''dotlrn_instructor_rel'', - ''dotLRN Instructor Community Membership'', - ''dotLRN Instructor Community Memberships'', - ''dotlrn_admin_rel'', - ''dotlrn_instructor_rels'', - ''rel_id'', - ''dotlrn_instructor_rel'', - ''dotlrn_class_instance'', null, + 'dotlrn_instructor_rel', + 'dotLRN Instructor Community Membership', + 'dotLRN Instructor Community Memberships', + 'dotlrn_admin_rel', + 'dotlrn_instructor_rels', + 'rel_id', + 'dotlrn_instructor_rel', + 'dotlrn_class_instance', null, 0, null, - ''user'', - ''instructor'', + 'user', + 'instructor', 0, null ); return 0; END; -' language 'plpgsql'; +$$ LANGUAGE plpgsql; + select inline_0(); drop function inline_0(); Index: openacs-4/packages/dotlrn/sql/postgresql/classes-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/sql/postgresql/classes-create.sql,v diff -u -r1.6 -r1.7 --- openacs-4/packages/dotlrn/sql/postgresql/classes-create.sql 8 Aug 2006 21:26:22 -0000 1.6 +++ openacs-4/packages/dotlrn/sql/postgresql/classes-create.sql 1 Nov 2013 21:08:29 -0000 1.7 @@ -161,23 +161,28 @@ select define_function_args ('dotlrn_department__delete', 'department_key'); -create function dotlrn_department__new(varchar,varchar,varchar,varchar,integer,timestamptz,integer,varchar,integer) -returns varchar as ' + + +-- +-- procedure dotlrn_department__new/9 +-- +CREATE OR REPLACE FUNCTION dotlrn_department__new( + p_department_key varchar, + p_pretty_name varchar, + p_pretty_plural varchar, + p_description varchar, + p_package_id integer, + p_creation_date timestamptz, + p_creation_user integer, + p_creation_ip varchar, + p_context_id integer +) RETURNS varchar AS $$ DECLARE - p_department_key alias for $1; - p_pretty_name alias for $2; - p_pretty_plural alias for $3; - p_description alias for $4; - p_package_id alias for $5; - p_creation_date alias for $6; - p_creation_user alias for $7; - p_creation_ip alias for $8; - p_context_id alias for $9; v_department_key dotlrn_departments.department_key%TYPE; BEGIN v_department_key := dotlrn_community_type__new ( p_department_key, - ''dotlrn_class_instance'', + 'dotlrn_class_instance', p_pretty_name, p_pretty_plural, p_description, @@ -194,13 +199,19 @@ return v_department_key; END; -' language 'plpgsql'; +$$ LANGUAGE plpgsql; -create function dotlrn_department__delete(varchar) -returns integer as ' + + + +-- +-- procedure dotlrn_department__delete/1 +-- +CREATE OR REPLACE FUNCTION dotlrn_department__delete( + p_department_key varchar +) RETURNS integer AS $$ DECLARE - p_department_key alias for $1; BEGIN delete from dotlrn_departments @@ -209,27 +220,33 @@ PERFORM dotlrn_community_type__delete(p_department_key); return(0); END; -' language 'plpgsql'; +$$ LANGUAGE plpgsql; + select define_function_args('dotlrn_class__new','class_key,department_key,pretty_name,pretty_plural,description,package_id,creation_date,creation_user,creation_ip,context_id'); select define_function_args('dotlrn_class__delete','class_key'); -create function dotlrn_class__new(varchar,varchar,varchar,varchar,varchar,integer,timestamptz,integer,varchar,integer) -returns varchar as ' + + +-- +-- procedure dotlrn_class__new/10 +-- +CREATE OR REPLACE FUNCTION dotlrn_class__new( + p_class_key varchar, + p_department_key varchar, + p_pretty_name varchar, + p_pretty_plural varchar, + p_description varchar, + p_package_id integer, + p_creation_date timestamptz, + p_creation_user integer, + p_creation_ip varchar, + p_context_id integer +) RETURNS varchar AS $$ DECLARE - p_class_key alias for $1; - p_department_key alias for $2; - p_pretty_name alias for $3; - p_pretty_plural alias for $4; - p_description alias for $5; - p_package_id alias for $6; - p_creation_date alias for $7; - p_creation_user alias for $8; - p_creation_ip alias for $9; - p_context_id alias for $10; v_class_key dotlrn_classes.class_key%TYPE; BEGIN v_class_key := dotlrn_community_type__new ( @@ -251,13 +268,19 @@ return v_class_key; END; -' language 'plpgsql'; +$$ LANGUAGE plpgsql; -create function dotlrn_class__delete(varchar) -returns integer as ' + + + +-- +-- procedure dotlrn_class__delete/1 +-- +CREATE OR REPLACE FUNCTION dotlrn_class__delete( + p_class_key varchar +) RETURNS integer AS $$ DECLARE - p_class_key alias for $1; BEGIN delete from dotlrn_classes @@ -266,32 +289,38 @@ PERFORM dotlrn_community_type__delete(p_class_key); return(0); END; -' language 'plpgsql'; +$$ LANGUAGE plpgsql; + select define_function_args('dotlrn_class_instance__new','class_instance_id,class_key,term_id,community_key,pretty_name,description,package_id,portal_id,non_member_portal_id,join_policy,creation_date,creation_user,creation_ip,context_id'); select define_function_args('dotlrn_class_instance__delete','class_instance_id'); -create function dotlrn_class_instance__new(integer,varchar,integer,varchar,varchar,varchar,integer,integer,integer,varchar,timestamptz,integer,varchar,integer) -returns integer as ' + + +-- +-- procedure dotlrn_class_instance__new/14 +-- +CREATE OR REPLACE FUNCTION dotlrn_class_instance__new( + p_class_instance_id integer, + p_class_key varchar, + p_term_id integer, + p_community_key varchar, + p_pretty_name varchar, + p_description varchar, + p_package_id integer, + p_portal_id integer, + p_non_member_portal_id integer, + p_join_policy varchar, + p_creation_date timestamptz, + p_creation_user integer, + p_creation_ip varchar, + p_context_id integer +) RETURNS integer AS $$ DECLARE - p_class_instance_id alias for $1; - p_class_key alias for $2; - p_term_id alias for $3; - p_community_key alias for $4; - p_pretty_name alias for $5; - p_description alias for $6; - p_package_id alias for $7; - p_portal_id alias for $8; - p_non_member_portal_id alias for $9; - p_join_policy alias for $10; - p_creation_date alias for $11; - p_creation_user alias for $12; - p_creation_ip alias for $13; - p_context_id alias for $14; v_class_instance_id dotlrn_class_instances.class_instance_id%TYPE; BEGIN v_class_instance_id := dotlrn_community__new ( @@ -301,7 +330,7 @@ p_community_key, p_pretty_name, p_description, - ''f'', + 'f', p_portal_id, p_non_member_portal_id, p_package_id, @@ -320,13 +349,19 @@ return v_class_instance_id; END; -' language 'plpgsql'; +$$ LANGUAGE plpgsql; -create function dotlrn_class_instance__delete(integer) -returns integer as ' + + + +-- +-- procedure dotlrn_class_instance__delete/1 +-- +CREATE OR REPLACE FUNCTION dotlrn_class_instance__delete( + p_class_instance_id integer +) RETURNS integer AS $$ DECLARE - p_class_instance_id alias for $1; BEGIN delete from dotlrn_class_instances @@ -335,5 +370,6 @@ PERFORM dotlrn_community__delete(p_class_instance_id); return(0); END; -' language 'plpgsql'; +$$ LANGUAGE plpgsql; + Index: openacs-4/packages/dotlrn/sql/postgresql/clubs-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/sql/postgresql/clubs-create.sql,v diff -u -r1.5 -r1.6 --- openacs-4/packages/dotlrn/sql/postgresql/clubs-create.sql 8 Aug 2006 21:26:22 -0000 1.5 +++ openacs-4/packages/dotlrn/sql/postgresql/clubs-create.sql 1 Nov 2013 21:08:29 -0000 1.6 @@ -51,31 +51,36 @@ select define_function_args ('dotlrn_club__delete','club_id'); -create function dotlrn_club__new(integer,varchar,varchar,varchar,integer,integer,integer,varchar,timestamptz,integer,varchar,integer) -returns integer as ' + + +-- +-- procedure dotlrn_club__new/12 +-- +CREATE OR REPLACE FUNCTION dotlrn_club__new( + p_club_id integer, + p_community_key varchar, + p_pretty_name varchar, + p_description varchar, + p_package_id integer, + p_portal_id integer, + p_non_member_portal_id integer, + p_join_policy varchar, + p_creation_date timestamptz, + p_creation_user integer, + p_creation_ip varchar, + p_context_id integer +) RETURNS integer AS $$ DECLARE - p_club_id alias for $1; - p_community_key alias for $2; - p_pretty_name alias for $3; - p_description alias for $4; - p_package_id alias for $5; - p_portal_id alias for $6; - p_non_member_portal_id alias for $7; - p_join_policy alias for $8; - p_creation_date alias for $9; - p_creation_user alias for $10; - p_creation_ip alias for $11; - p_context_id alias for $12; v_club_id integer; BEGIN v_club_id := dotlrn_community__new( p_club_id, null, - ''dotlrn_club'', + 'dotlrn_club', p_community_key, p_pretty_name, p_description, - ''f'', + 'f', p_portal_id, p_non_member_portal_id, p_package_id, @@ -92,13 +97,19 @@ return v_club_id; END; -' language 'plpgsql'; +$$ LANGUAGE plpgsql; -create function dotlrn_club__delete(integer) -returns integer as ' + + + +-- +-- procedure dotlrn_club__delete/1 +-- +CREATE OR REPLACE FUNCTION dotlrn_club__delete( + p_club_id integer +) RETURNS integer AS $$ DECLARE - p_club_id alias for $1; BEGIN delete from dotlrn_clubs @@ -107,5 +118,6 @@ PERFORM dotlrn_community__delete(p_club_id); return(0); END; -' language 'plpgsql'; +$$ LANGUAGE plpgsql; + Index: openacs-4/packages/dotlrn/sql/postgresql/communities-package-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/sql/postgresql/communities-package-create.sql,v diff -u -r1.10 -r1.11 --- openacs-4/packages/dotlrn/sql/postgresql/communities-package-create.sql 8 Nov 2010 13:17:44 -0000 1.10 +++ openacs-4/packages/dotlrn/sql/postgresql/communities-package-create.sql 1 Nov 2013 21:08:29 -0000 1.11 @@ -31,14 +31,22 @@ select define_function_args ('dotlrn_community_type__name','community_type'); -create or replace function dotlrn_community_type__new (varchar,varchar,varchar,varchar,varchar) -returns varchar as ' + + +-- +-- procedure dotlrn_community_type__new/5 +-- +CREATE OR REPLACE FUNCTION dotlrn_community_type__new( + p_community_type varchar, + p_parent_type varchar, + p_pretty_name varchar, + p_pretty_plural varchar, + p_description varchar +) RETURNS varchar AS $$ +-- +-- dotlrn_community_type__new/5 maybe obsolete, when we define proper defaults for /10 +-- DECLARE - p_community_type alias for $1; - p_parent_type alias for $2; - p_pretty_name alias for $3; - p_pretty_plural alias for $4; - p_description alias for $5; BEGIN return dotlrn_community_type__new( p_community_type, @@ -53,31 +61,38 @@ null ); END; -' language 'plpgsql'; -create or replace function dotlrn_community_type__new (varchar,varchar,varchar,varchar,varchar,integer,timestamptz,integer,varchar,integer) -returns varchar as ' +$$ LANGUAGE plpgsql; + + + +-- +-- procedure dotlrn_community_type__new/10 +-- +CREATE OR REPLACE FUNCTION dotlrn_community_type__new( + p_community_type varchar, + p_parent_type varchar, -- default 'dotlrn_community' + p_pretty_name varchar, + p_pretty_plural varchar, + p_description varchar, + p_package_id integer, + p_creation_date timestamptz, + p_creation_user integer, + p_creation_ip varchar, + p_context_id integer + +) RETURNS varchar AS $$ DECLARE - p_community_type alias for $1; - p_parent_type alias for $2; - p_pretty_name alias for $3; - p_pretty_plural alias for $4; - p_description alias for $5; - p_package_id alias for $6; - p_creation_date alias for $7; - p_creation_user alias for $8; - p_creation_ip alias for $9; - p_context_id alias for $10; v_parent_object_type acs_object_types.object_type%TYPE; v_unique_name acs_objects.object_id%TYPE; BEGIN if p_parent_type is null then - v_parent_object_type:= ''application_group''; + v_parent_object_type:= 'application_group'; else v_parent_object_type:= p_parent_type; end if; - select nextval(''t_acs_object_id_seq'') + select nextval('t_acs_object_id_seq') into v_unique_name from dual; @@ -89,16 +104,16 @@ cast(v_unique_name as varchar), cast(v_unique_name as varchar), cast(v_unique_name as varchar), - ''f'', + 'f', null, - ''acs_group.name'' + 'acs_group.name' ); insert into group_types (group_type, default_join_policy) values - (p_community_type, ''closed''); + (p_community_type, 'closed'); insert into dotlrn_community_types @@ -116,13 +131,19 @@ return p_community_type; END; -' language 'plpgsql'; +$$ LANGUAGE plpgsql; -create function dotlrn_community_type__delete(varchar) -returns integer as ' + + + +-- +-- procedure dotlrn_community_type__delete/1 +-- +CREATE OR REPLACE FUNCTION dotlrn_community_type__delete( + p_community_type varchar +) RETURNS integer AS $$ DECLARE - p_community_type alias for $1; BEGIN delete from dotlrn_community_types @@ -132,16 +153,22 @@ from group_types where group_type = p_community_type; - PERFORM acs_object_type__drop_type(p_community_type, ''f''); + PERFORM acs_object_type__drop_type(p_community_type, 'f'); return 0; END; -' language 'plpgsql'; +$$ LANGUAGE plpgsql; -create function dotlrn_community_type__name(varchar) -returns varchar as ' + + + +-- +-- procedure dotlrn_community_type__name/1 +-- +CREATE OR REPLACE FUNCTION dotlrn_community_type__name( + p_community_type varchar +) RETURNS varchar AS $$ DECLARE - p_community_type alias for $1; v_name dotlrn_community_types.pretty_name%TYPE; BEGIN select dotlrn_community_types.pretty_name @@ -151,31 +178,38 @@ return v_name; END; -' language 'plpgsql'; +$$ LANGUAGE plpgsql; + -- dotlrn_community select define_function_args('dotlrn_community__new','community_id,parent_community_id,community_type,community_key,pretty_name,description,archived_p;f,portal_id,non_member_portal_id,package_id,join_policy,creation_date,creation_user,creation_ip,context_id'); -create or replace function dotlrn_community__new(integer,integer,varchar,varchar,varchar,varchar,varchar,integer,integer,integer,varchar,timestamptz,integer,varchar,integer) -returns integer as ' + + +-- +-- procedure dotlrn_community__new/15 +-- +CREATE OR REPLACE FUNCTION dotlrn_community__new( + p_community_id integer, + p_parent_community_id integer, + p_community_type varchar, + p_community_key varchar, + p_pretty_name varchar, + p_description varchar, + p_archived_p varchar, -- default 'f' + p_portal_id integer, + p_non_member_portal_id integer, + p_package_id integer, + p_join_policy varchar, + p_creation_date timestamptz, + p_creation_user integer, + p_creation_ip varchar, + p_context_id integer + +) RETURNS integer AS $$ DECLARE - p_community_id alias for $1; - p_parent_community_id alias for $2; - p_community_type alias for $3; - p_community_key alias for $4; - p_pretty_name alias for $5; - p_description alias for $6; - p_archived_p alias for $7; - p_portal_id alias for $8; - p_non_member_portal_id alias for $9; - p_package_id alias for $10; - p_join_policy alias for $11; - p_creation_date alias for $12; - p_creation_user alias for $13; - p_creation_ip alias for $14; - p_context_id alias for $15; c_id integer; v_group_type_exists_p integer; BEGIN @@ -219,16 +253,22 @@ return c_id; END; -' language 'plpgsql'; +$$ LANGUAGE plpgsql; + select define_function_args('dotlrn_community__set_active_dates','community_id,start_date,end_date'); -create function dotlrn_community__set_active_dates(integer,date,date) -returns integer as ' + + +-- +-- procedure dotlrn_community__set_active_dates/3 +-- +CREATE OR REPLACE FUNCTION dotlrn_community__set_active_dates( + p_community_id integer, + p_start_date date, + p_end_date date +) RETURNS integer AS $$ DECLARE - p_community_id alias for $1; - p_start_date alias for $2; - p_end_date alias for $3; BEGIN update dotlrn_communities_all set active_start_date = p_start_date, @@ -237,14 +277,20 @@ return p_community_id; END; -' language 'plpgsql'; +$$ LANGUAGE plpgsql; + select define_function_args('dotlrn_community__delete','community_id'); -create function dotlrn_community__delete(integer) -returns integer as ' + + +-- +-- procedure dotlrn_community__delete/1 +-- +CREATE OR REPLACE FUNCTION dotlrn_community__delete( + p_community_id integer +) RETURNS integer AS $$ DECLARE - p_community_id alias for $1; BEGIN delete from dotlrn_communities @@ -253,34 +299,46 @@ PERFORM acs_group__delete(p_community_id); return 0; END; -' language 'plpgsql'; +$$ LANGUAGE plpgsql; + select define_function_args('dotlrn_community__name','community_id'); -create function dotlrn_community__name(integer) -returns varchar as ' + + +-- +-- procedure dotlrn_community__name/1 +-- +CREATE OR REPLACE FUNCTION dotlrn_community__name( + p_community_id integer +) RETURNS varchar AS $$ DECLARE - p_community_id alias for $1; BEGIN return acs_group__name(p_community_id); END; -' language 'plpgsql'; +$$ LANGUAGE plpgsql; + select define_function_args('dotlrn_community__member_p','community_id,party_id'); -create function dotlrn_community__member_p(integer,integer) -returns boolean as ' + + +-- +-- procedure dotlrn_community__member_p/2 +-- +CREATE OR REPLACE FUNCTION dotlrn_community__member_p( + p_community_id integer, + p_party_id integer +) RETURNS boolean AS $$ DECLARE - p_community_id alias for $1; - p_party_id alias for $2; v_member_p char(1); BEGIN select CASE WHEN count(*) = 0 - THEN ''f'' - ELSE ''t'' + THEN 'f' + ELSE 't' END into v_member_p from dual @@ -292,39 +350,51 @@ return v_member_p; END; -' language 'plpgsql'; +$$ LANGUAGE plpgsql; + select define_function_args('dotlrn_community__admin_p','community_id,party_id'); -create function dotlrn_community__admin_p(integer,integer) -returns boolean as ' + + +-- +-- procedure dotlrn_community__admin_p/2 +-- +CREATE OR REPLACE FUNCTION dotlrn_community__admin_p( + p_community_id integer, + p_party_id integer +) RETURNS boolean AS $$ DECLARE - p_community_id alias for $1; - p_party_id alias for $2; r_rv char(1); BEGIN -- THIS NEEDS TO BE CHECKED! -- chak, 2002-07-01 select CASE - WHEN acs_permission__permission_p(p_community_id, p_party_id, ''dotlrn_admin_community'') = ''f'' - THEN acs_permission__permission_p(p_community_id,p_party_id,''admin'') - ELSE ''t'' + WHEN acs_permission__permission_p(p_community_id, p_party_id, 'dotlrn_admin_community') = 'f' + THEN acs_permission__permission_p(p_community_id,p_party_id,'admin') + ELSE 't' END into r_rv from dual; return r_rv; END; -' language 'plpgsql'; +$$ LANGUAGE plpgsql; + select define_function_args('dotlrn_community__url','community_id'); -create function dotlrn_community__url(integer) -returns varchar as ' + + +-- +-- procedure dotlrn_community__url/1 +-- +CREATE OR REPLACE FUNCTION dotlrn_community__url( + p_community_id integer +) RETURNS varchar AS $$ DECLARE - p_community_id alias for $1; v_node_id site_nodes.node_id%TYPE; BEGIN select site_nodes.node_id into v_node_id @@ -337,30 +407,40 @@ -- exception -- when no_data_found then --- return ''; +-- return '; END; -' language 'plpgsql'; +$$ LANGUAGE plpgsql; -create function dotlrn_community__has_subcomm_p(integer) -returns varchar as ' + + + +-- added +select define_function_args('dotlrn_community__has_subcomm_p','community_id'); + +-- +-- procedure dotlrn_community__has_subcomm_p/1 +-- +CREATE OR REPLACE FUNCTION dotlrn_community__has_subcomm_p( + p_community_id integer +) RETURNS varchar AS $$ DECLARE - p_community_id alias for $1; r_rv char(1); BEGIN select CASE WHEN count(*) = 0 - THEN ''f'' - ELSE ''t'' + THEN 'f' + ELSE 't' END into r_rv from dual where dotlrn_communities_all.community_id = p_community_id; return r_rv; END; -' language 'plpgsql'; +$$ LANGUAGE plpgsql; + create view dotlrn_communities_full as select dotlrn_communities.*, Index: openacs-4/packages/dotlrn/sql/postgresql/communities-tree-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/sql/postgresql/communities-tree-create.sql,v diff -u -r1.4 -r1.5 --- openacs-4/packages/dotlrn/sql/postgresql/communities-tree-create.sql 9 Aug 2002 18:39:25 -0000 1.4 +++ openacs-4/packages/dotlrn/sql/postgresql/communities-tree-create.sql 1 Nov 2013 21:08:29 -0000 1.5 @@ -14,19 +14,25 @@ -- details. -- -create function dotlrn_community_types_in_tr() -returns opaque as ' -declare + + +-- +-- procedure dotlrn_community_types_in_tr/0 +-- +CREATE OR REPLACE FUNCTION dotlrn_community_types_in_tr( + +) RETURNS trigger AS $$ +DECLARE v_parent_sortkey dotlrn_community_types.tree_sortkey%TYPE; v_max_child_sortkey dotlrn_community_types.max_child_sortkey%TYPE; -begin +BEGIN if new.supertype is null then - -- if this is the root community_type we leave it''s sortkey as null + -- if this is the root community_type we leave it's sortkey as null return new; else -- else get the max_child_sortkey of the parent community_type - select coalesce(tree_sortkey, ''''), max_child_sortkey + select coalesce(tree_sortkey, ''), max_child_sortkey into v_parent_sortkey, v_max_child_sortkey from dotlrn_community_types where community_type = new.supertype @@ -44,24 +50,31 @@ new.tree_sortkey := v_parent_sortkey || v_max_child_sortkey; return new; -end;' language 'plpgsql'; +END; +$$ LANGUAGE plpgsql; create trigger dotlrn_community_types_in_tr before insert on dotlrn_community_types for each row execute procedure dotlrn_community_types_in_tr(); -create function dotlrn_communities_in_tr() -returns opaque as ' -declare + + +-- +-- procedure dotlrn_communities_in_tr/0 +-- +CREATE OR REPLACE FUNCTION dotlrn_communities_in_tr( + +) RETURNS trigger AS $$ +DECLARE v_parent_sortkey dotlrn_communities_all.tree_sortkey%TYPE; v_max_child_sortkey dotlrn_communities_all.max_child_sortkey%TYPE; -begin +BEGIN if new.parent_community_id is null then - select coalesce(tree_sortkey, ''''), max_child_sortkey + select coalesce(tree_sortkey, ''), max_child_sortkey into v_parent_sortkey, v_max_child_sortkey from dotlrn_community_types where community_type = new.community_type @@ -75,7 +88,7 @@ else - select coalesce(tree_sortkey, ''''), max_child_sortkey + select coalesce(tree_sortkey, ''), max_child_sortkey into v_parent_sortkey, v_max_child_sortkey from dotlrn_communities_all where community_id = new.parent_community_id @@ -93,7 +106,8 @@ return new; -end;' language 'plpgsql'; +END; +$$ LANGUAGE plpgsql; create trigger dotlrn_communities_in_tr before insert on dotlrn_communities_all Index: openacs-4/packages/dotlrn/sql/postgresql/community-memberships-packages-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/sql/postgresql/community-memberships-packages-create.sql,v diff -u -r1.5 -r1.6 --- openacs-4/packages/dotlrn/sql/postgresql/community-memberships-packages-create.sql 15 Aug 2002 18:00:49 -0000 1.5 +++ openacs-4/packages/dotlrn/sql/postgresql/community-memberships-packages-create.sql 1 Nov 2013 21:08:29 -0000 1.6 @@ -28,17 +28,23 @@ select define_function_args('dotlrn_member_rel__new','rel_id,rel_type;dotlrn_member_rel,portal_id,community_id,user_id,member_state;approved,creation_user,creation_ip'); -create function dotlrn_member_rel__new(integer,varchar,integer,integer,integer,varchar,integer,varchar) -returns integer as ' + + +-- +-- procedure dotlrn_member_rel__new/8 +-- +CREATE OR REPLACE FUNCTION dotlrn_member_rel__new( + p_rel_id integer, + p_rel_type varchar, -- default 'dotlrn_member_rel' + p_portal_id integer, + p_community_id integer, + p_user_id integer, + p_member_state varchar, -- default 'approved' + p_creation_user integer, + p_creation_ip varchar + +) RETURNS integer AS $$ DECLARE - p_rel_id alias for $1; - p_rel_type alias for $2; - p_portal_id alias for $3; - p_community_id alias for $4; - p_user_id alias for $5; - p_member_state alias for $6; - p_creation_user alias for $7; - p_creation_ip alias for $8; v_rel_id integer; BEGIN v_rel_id:= membership_rel__new( @@ -59,39 +65,52 @@ return v_rel_id; END; -' language 'plpgsql'; +$$ LANGUAGE plpgsql; + select define_function_args('dotlrn_member_rel__delete','rel_id'); -create function dotlrn_member_rel__delete(integer) -returns integer as ' + + +-- +-- procedure dotlrn_member_rel__delete/1 +-- +CREATE OR REPLACE FUNCTION dotlrn_member_rel__delete( + p_rel_id integer +) RETURNS integer AS $$ DECLARE - p_rel_id alias for $1; BEGIN delete from dotlrn_member_rels where rel_id = p_rel_id; PERFORM membership_rel__delete(p_rel_id); return 0; END; -' language 'plpgsql'; +$$ LANGUAGE plpgsql; + select define_function_args('dotlrn_admin_rel__new','rel_id,rel_type;dotlrn_admin_rel,community_id,user_id,member_state,portal_id,creation_user,creation_ip'); -create function dotlrn_admin_rel__new(integer,varchar,integer,integer,varchar,integer,integer,varchar) -returns integer as ' + + +-- +-- procedure dotlrn_admin_rel__new/8 +-- +CREATE OR REPLACE FUNCTION dotlrn_admin_rel__new( + p_rel_id integer, + p_rel_type varchar, -- default 'dotlrn_admin_rel' + p_community_id integer, + p_user_id integer, + p_member_state varchar, + p_portal_id integer, + p_creation_user integer, + p_creation_ip varchar + +) RETURNS integer AS $$ DECLARE - p_rel_id alias for $1; - p_rel_type alias for $2; - p_community_id alias for $3; - p_user_id alias for $4; - p_member_state alias for $5; - p_portal_id alias for $6; - p_creation_user alias for $7; - p_creation_ip alias for $8; v_rel_id integer; BEGIN v_rel_id:= dotlrn_member_rel__new( @@ -113,38 +132,51 @@ return v_rel_id; END; -' language 'plpgsql'; +$$ LANGUAGE plpgsql; + select define_function_args('dotlrn_admin_rel__delete','rel_id'); -create function dotlrn_admin_rel__delete(integer) -returns integer as ' + + +-- +-- procedure dotlrn_admin_rel__delete/1 +-- +CREATE OR REPLACE FUNCTION dotlrn_admin_rel__delete( + p_rel_id integer +) RETURNS integer AS $$ DECLARE - p_rel_id alias for $1; BEGIN delete from dotlrn_admin_rels where rel_id = p_rel_id; PERFORM dotlrn_member_rel__delete(p_rel_id); return 0; END; -' language 'plpgsql'; +$$ LANGUAGE plpgsql; + select define_function_args('dotlrn_student_rel__new','rel_id,rel_type;dotlrn_student_rel,portal_id,class_instance_id,user_id,member_state,creation_user,creation_ip'); -create function dotlrn_student_rel__new(integer,varchar,integer,integer,integer,varchar,integer,varchar) -returns integer as ' + + +-- +-- procedure dotlrn_student_rel__new/8 +-- +CREATE OR REPLACE FUNCTION dotlrn_student_rel__new( + p_rel_id integer, + p_rel_type varchar, -- default 'dotlrn_student_rel' + p_portal_id integer, + p_class_instance_id integer, + p_user_id integer, + p_member_state varchar, + p_creation_user integer, + p_creation_ip varchar + +) RETURNS integer AS $$ DECLARE - p_rel_id alias for $1; - p_rel_type alias for $2; - p_portal_id alias for $3; - p_class_instance_id alias for $4; - p_user_id alias for $5; - p_member_state alias for $6; - p_creation_user alias for $7; - p_creation_ip alias for $8; v_rel_id integer; BEGIN v_rel_id:= dotlrn_member_rel__new( @@ -166,42 +198,55 @@ return v_rel_id; END; -' language 'plpgsql'; +$$ LANGUAGE plpgsql; + select define_function_args('dotlrn_student_rel__delete','rel_id'); -create function dotlrn_student_rel__delete(integer) -returns integer as ' + + +-- +-- procedure dotlrn_student_rel__delete/1 +-- +CREATE OR REPLACE FUNCTION dotlrn_student_rel__delete( + p_rel_id integer +) RETURNS integer AS $$ DECLARE - p_rel_id alias for $1; BEGIN delete from dotlrn_student_rels where rel_id= p_rel_id; PERFORM dotlrn_member_rel__delete(p_rel_id); return 0; END; -' language 'plpgsql'; +$$ LANGUAGE plpgsql; + select define_function_args('dotlrn_ta_rel__new','rel_id,rel_type;dotlrn_ta_rel,class_instance_id,user_id,member_state,portal_id,creation_user,creation_ip'); select define_function_args('dotlrn_ta_rel__delete','rel_id'); -create function dotlrn_ta_rel__new(integer,varchar,integer,integer,varchar,integer,integer,varchar) -returns integer as ' + + +-- +-- procedure dotlrn_ta_rel__new/8 +-- +CREATE OR REPLACE FUNCTION dotlrn_ta_rel__new( + p_rel_id integer, + p_rel_type varchar, -- default 'dotlrn_ta_rel' + p_class_instance_id integer, + p_user_id integer, + p_member_state varchar, + p_portal_id integer, + p_creation_user integer, + p_creation_ip varchar + +) RETURNS integer AS $$ DECLARE - p_rel_id alias for $1; - p_rel_type alias for $2; - p_class_instance_id alias for $3; - p_user_id alias for $4; - p_member_state alias for $5; - p_portal_id alias for $6; - p_creation_user alias for $7; - p_creation_ip alias for $8; v_rel_id integer; BEGIN v_rel_id:= dotlrn_admin_rel__new( @@ -223,13 +268,19 @@ return v_rel_id; END; -' language 'plpgsql'; +$$ LANGUAGE plpgsql; -create function dotlrn_ta_rel__delete(integer) -returns integer as ' + + + +-- +-- procedure dotlrn_ta_rel__delete/1 +-- +CREATE OR REPLACE FUNCTION dotlrn_ta_rel__delete( + p_rel_id integer +) RETURNS integer AS $$ DECLARE - p_rel_id alias for $1; BEGIN delete from dotlrn_ta_rels @@ -239,27 +290,34 @@ return 0; END; -' language 'plpgsql'; +$$ LANGUAGE plpgsql; + -- ca rel select define_function_args('dotlrn_ca_rel__new','rel_id,rel_type;dotlrn_ca_rel,class_instance_id,user_id,member_state,portal_id,creation_user,creation_ip'); select define_function_args('dotlrn_ca_rel__delete','rel_id'); -create function dotlrn_ca_rel__new(integer,varchar,integer,integer,varchar,integer,integer,varchar) -returns integer as ' + + +-- +-- procedure dotlrn_ca_rel__new/8 +-- +CREATE OR REPLACE FUNCTION dotlrn_ca_rel__new( + p_rel_id integer, + p_rel_type varchar, -- default 'dotlrn_ca_rel' + p_class_instance_id integer, + p_user_id integer, + p_member_state varchar, + p_portal_id integer, + p_creation_user integer, + p_creation_ip varchar + +) RETURNS integer AS $$ DECLARE - p_rel_id alias for $1; - p_rel_type alias for $2; - p_class_instance_id alias for $3; - p_user_id alias for $4; - p_member_state alias for $5; - p_portal_id alias for $6; - p_creation_user alias for $7; - p_creation_ip alias for $8; v_rel_id integer; BEGIN v_rel_id:= dotlrn_admin_rel__new( @@ -281,13 +339,19 @@ return v_rel_id; END; -' language 'plpgsql'; +$$ LANGUAGE plpgsql; -create function dotlrn_ca_rel__delete(integer) -returns integer as ' + + + +-- +-- procedure dotlrn_ca_rel__delete/1 +-- +CREATE OR REPLACE FUNCTION dotlrn_ca_rel__delete( + p_rel_id integer +) RETURNS integer AS $$ DECLARE - p_rel_id alias for $1; BEGIN delete from dotlrn_ca_rels @@ -297,27 +361,34 @@ return 0; END; -' language 'plpgsql'; +$$ LANGUAGE plpgsql; + -- course admin select define_function_args('dotlrn_cadmin_rel__new','rel_id,rel_type;dotlrn_cadmin_rel,class_instance_id,user_id,member_state,portal_id,creation_user,creation_ip'); select define_function_args('dotlrn_cadmin_rel__delete','rel_id'); -create function dotlrn_cadmin_rel__new(integer,varchar,integer,integer,varchar,integer,integer,varchar) -returns integer as ' + + +-- +-- procedure dotlrn_cadmin_rel__new/8 +-- +CREATE OR REPLACE FUNCTION dotlrn_cadmin_rel__new( + p_rel_id integer, + p_rel_type varchar, -- default 'dotlrn_cadmin_rel' + p_class_instance_id integer, + p_user_id integer, + p_member_state varchar, + p_portal_id integer, + p_creation_user integer, + p_creation_ip varchar + +) RETURNS integer AS $$ DECLARE - p_rel_id alias for $1; - p_rel_type alias for $2; - p_class_instance_id alias for $3; - p_user_id alias for $4; - p_member_state alias for $5; - p_portal_id alias for $6; - p_creation_user alias for $7; - p_creation_ip alias for $8; v_rel_id integer; BEGIN v_rel_id:= dotlrn_admin_rel__new( @@ -339,13 +410,19 @@ return v_rel_id; END; -' language 'plpgsql'; +$$ LANGUAGE plpgsql; -create function dotlrn_cadmin_rel__delete(integer) -returns integer as ' + + + +-- +-- procedure dotlrn_cadmin_rel__delete/1 +-- +CREATE OR REPLACE FUNCTION dotlrn_cadmin_rel__delete( + p_rel_id integer +) RETURNS integer AS $$ DECLARE - p_rel_id alias for $1; BEGIN delete from dotlrn_cadmin_rels @@ -355,27 +432,34 @@ return 0; END; -' language 'plpgsql'; +$$ LANGUAGE plpgsql; + -- instructor rel select define_function_args('dotlrn_instructor_rel__new','rel_id,rel_type;dotlrn_instructor_rel,class_instance_id,user_id,member_state,portal_id,creation_user,creation_ip'); select define_function_args('dotlrn_instructor_rel__delete','rel_id'); -create function dotlrn_instructor_rel__new(integer,varchar,integer,integer,varchar,integer,integer,varchar) -returns integer as ' + + +-- +-- procedure dotlrn_instructor_rel__new/8 +-- +CREATE OR REPLACE FUNCTION dotlrn_instructor_rel__new( + p_rel_id integer, + p_rel_type varchar, -- default 'dotlrn_instructor_rel' + p_class_instance_id integer, + p_user_id integer, + p_member_state varchar, + p_portal_id integer, + p_creation_user integer, + p_creation_ip varchar + +) RETURNS integer AS $$ DECLARE - p_rel_id alias for $1; - p_rel_type alias for $2; - p_class_instance_id alias for $3; - p_user_id alias for $4; - p_member_state alias for $5; - p_portal_id alias for $6; - p_creation_user alias for $7; - p_creation_ip alias for $8; v_rel_id integer; BEGIN v_rel_id:= dotlrn_admin_rel__new( @@ -397,13 +481,19 @@ return v_rel_id; END; -' language 'plpgsql'; +$$ LANGUAGE plpgsql; -create function dotlrn_instructor_rel__delete(integer) -returns integer as ' + + + +-- +-- procedure dotlrn_instructor_rel__delete/1 +-- +CREATE OR REPLACE FUNCTION dotlrn_instructor_rel__delete( + p_rel_id integer +) RETURNS integer AS $$ DECLARE - p_rel_id alias for $1; BEGIN delete from dotlrn_instructor_rels @@ -413,5 +503,6 @@ return 0; END; -' language 'plpgsql'; +$$ LANGUAGE plpgsql; + Index: openacs-4/packages/dotlrn/sql/postgresql/custom-permissions.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/sql/postgresql/custom-permissions.sql,v diff -u -r1.2 -r1.3 --- openacs-4/packages/dotlrn/sql/postgresql/custom-permissions.sql 4 Dec 2002 09:51:03 -0000 1.2 +++ openacs-4/packages/dotlrn/sql/postgresql/custom-permissions.sql 1 Nov 2013 21:08:29 -0000 1.3 @@ -23,22 +23,30 @@ -- above assumptions, rewrite this function. -create or replace function dotlrn_community_admin_p (integer, integer) -returns char as ' - declare - p_group_id alias for $1; - p_party_id alias for $2; - begin + + +-- added +select define_function_args('dotlrn_community_admin_p','group_id,party_id'); + +-- +-- procedure dotlrn_community_admin_p/2 +-- +CREATE OR REPLACE FUNCTION dotlrn_community_admin_p( + p_group_id integer, + p_party_id integer +) RETURNS char AS $$ +DECLARE + BEGIN -- -- direct permissions if exists ( select 1 from acs_object_grantee_priv_map where object_id = p_group_id and grantee_id = p_party_id - and privilege = ''admin'') + and privilege = 'admin') then - return ''t''; + return 't'; end if; -- check to see if the user belongs to a rel seg that has @@ -51,12 +59,13 @@ rel_seg_approved_member_map rs where rs.group_id = p_group_id and ogpm.object_id = rs.group_id - and ogpm.privilege = ''admin'' + and ogpm.privilege = 'admin' and ogpm.grantee_id = rs.segment_id and rs.member_id = p_party_id) then - return ''t''; + return 't'; end if; - return ''f''; -end;' language 'plpgsql'; + return 'f'; +END; +$$ LANGUAGE plpgsql; Index: openacs-4/packages/dotlrn/sql/postgresql/dotlrn-init.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/sql/postgresql/dotlrn-init.sql,v diff -u -r1.13 -r1.14 --- openacs-4/packages/dotlrn/sql/postgresql/dotlrn-init.sql 8 Aug 2006 21:26:22 -0000 1.13 +++ openacs-4/packages/dotlrn/sql/postgresql/dotlrn-init.sql 1 Nov 2013 21:08:29 -0000 1.14 @@ -26,371 +26,371 @@ -- @note We remember September 11th, 2001 -- -create function inline_0() -returns integer as ' -begin +CREATE OR REPLACE FUNCTION inline_0() RETURNS integer AS $$ +BEGIN -- Create the base community type perform dotlrn_community_type__new( - ''dotlrn_community'', + 'dotlrn_community', null, - ''#dotlrn.dotlrn_community_pretty_name#'', - ''#dotlrn.dotlrn_community_pretty_plural#'', - ''#dotlrn.dotlrn_community_description#'' + '#dotlrn.dotlrn_community_pretty_name#', + '#dotlrn.dotlrn_community_pretty_plural#', + '#dotlrn.dotlrn_community_description#' ); -- these are the possible attributes of a community perform acs_attribute__create_attribute( - ''dotlrn_community'', - ''header_font'', - ''string'', - ''#dotlrn.Header_Font#'', - ''#dotlrn.Header_Fonts#'', + 'dotlrn_community', + 'header_font', + 'string', + '#dotlrn.Header_Font#', + '#dotlrn.Header_Fonts#', null, null, null, 0, 1, null, - ''generic'', - ''f'' + 'generic', + 'f' ); perform acs_attribute__create_attribute( - ''dotlrn_community'', - ''header_font_size'', - ''string'', - ''#dotlrn.Header_Font_Size#'', - ''#dotlrn.Header_Font_Sizes#'', + 'dotlrn_community', + 'header_font_size', + 'string', + '#dotlrn.Header_Font_Size#', + '#dotlrn.Header_Font_Sizes#', null, null, null, 0, 1, null, - ''generic'', - ''f'' + 'generic', + 'f' ); perform acs_attribute__create_attribute( - ''dotlrn_community'', - ''header_font_color'', - ''string'', - ''#dotlrn.Header_Font_Color#'', - ''#dotlrn.Header_Font_Colors#'', + 'dotlrn_community', + 'header_font_color', + 'string', + '#dotlrn.Header_Font_Color#', + '#dotlrn.Header_Font_Colors#', null, null, null, 0, 1, null, - ''generic'', - ''f'' + 'generic', + 'f' ); perform acs_attribute__create_attribute( - ''dotlrn_community'', - ''header_logo_item_id'', - ''integer'', - ''#dotlrn.Header_Logo_Item_ID#'', - ''#dotlrn.Header_Logo_Item_ID#'', + 'dotlrn_community', + 'header_logo_item_id', + 'integer', + '#dotlrn.Header_Logo_Item_ID#', + '#dotlrn.Header_Logo_Item_ID#', null, null, null, 0, 1, null, - ''generic'', - ''f'' + 'generic', + 'f' ); perform acs_attribute__create_attribute( - ''dotlrn_community'', - ''header_logo_alt_text'', - ''integer'', - ''#dotlrn.Header_Logo_Alt_Text#'', - ''#dotlrn.Header_Logo_Alt_Text#'', + 'dotlrn_community', + 'header_logo_alt_text', + 'integer', + '#dotlrn.Header_Logo_Alt_Text#', + '#dotlrn.Header_Logo_Alt_Text#', null, null, null, 0, 1, null, - ''generic'', - ''f'' + 'generic', + 'f' ); -- create the dotlrn_class community type perform dotlrn_community_type__new( - ''dotlrn_class_instance'', - ''dotlrn_community'', - ''#dotlrn.dotlrn_class_instance_pretty_name#'', - ''#dotlrn.dotlrn_class_instance_pretty_plural#'', - ''#dotlrn.dotlrn_class_instance_description#'' + 'dotlrn_class_instance', + 'dotlrn_community', + '#dotlrn.dotlrn_class_instance_pretty_name#', + '#dotlrn.dotlrn_class_instance_pretty_plural#', + '#dotlrn.dotlrn_class_instance_description#' ); -- create the dotlrn_club community type perform dotlrn_community_type__new( - ''dotlrn_club'', - ''dotlrn_community'', - ''#dotlrn.dotlrn_club_pretty_name#'', - ''#dotlrn.dotlrn_club_pretty_plural#'', - ''#dotlrn.dotlrn_club_description#'' + 'dotlrn_club', + 'dotlrn_community', + '#dotlrn.dotlrn_club_pretty_name#', + '#dotlrn.dotlrn_club_pretty_plural#', + '#dotlrn.dotlrn_club_description#' ); - update acs_object_types set table_name = ''dotlrn_community'', package_name = ''dotlrn_community'' where object_type = ''dotlrn_community''; - update acs_object_types set table_name = ''dotlrn_class_instance'', package_name = ''dotlrn_class_instance'' where object_type = ''dotlrn_class_instance''; - update acs_object_types set table_name = ''dotlrn_club'', package_name = ''dotlrn_club'' where object_type = ''dotlrn_club''; + update acs_object_types set table_name = 'dotlrn_community', package_name = 'dotlrn_community' where object_type = 'dotlrn_community'; + update acs_object_types set table_name = 'dotlrn_class_instance', package_name = 'dotlrn_class_instance' where object_type = 'dotlrn_class_instance'; + update acs_object_types set table_name = 'dotlrn_club', package_name = 'dotlrn_club' where object_type = 'dotlrn_club'; perform acs_attribute__create_attribute( - ''dotlrn_community'', - ''member_pretty_name'', - ''string'', - ''Member Pretty Name'', - ''Member Pretty Name'', + 'dotlrn_community', + 'member_pretty_name', + 'string', + 'Member Pretty Name', + 'Member Pretty Name', null, null, null, 0, 1, null, - ''generic'', - ''f'' + 'generic', + 'f' ); perform acs_attribute__create_attribute( - ''dotlrn_community'', - ''member_pretty_plural'', - ''string'', - ''Member Pretty Plural'', - ''Member Pretty Plural'', + 'dotlrn_community', + 'member_pretty_plural', + 'string', + 'Member Pretty Plural', + 'Member Pretty Plural', null, null, null, 0, 1, null, - ''generic'', - ''f'' + 'generic', + 'f' ); -- create roles - perform acs_rel_type__create_role(''student'', ''#dotlrn.student_role_pretty_name#'', ''#dotlrn.student_role_pretty_plural#''); - perform acs_rel_type__create_role(''course_assistant'', ''#dotlrn.course_assistant_role_pretty_name#'', ''#dotlrn.course_assistant_role_pretty_plural#''); - perform acs_rel_type__create_role(''teaching_assistant'', ''#dotlrn.teaching_assistant_role_pretty_name#'', ''#dotlrn.teaching_assistant_role_pretty_plural#''); - perform acs_rel_type__create_role(''instructor'', ''#dotlrn.instructor_role_pretty_name#'', ''#dotlrn.instructor_role_pretty_plural#''); - perform acs_rel_type__create_role(''course_admin'', ''#dotlrn.course_admin_role_pretty_name#'', ''#dotlrn.course_admin_role_pretty_plural#''); + perform acs_rel_type__create_role('student', '#dotlrn.student_role_pretty_name#', '#dotlrn.student_role_pretty_plural#'); + perform acs_rel_type__create_role('course_assistant', '#dotlrn.course_assistant_role_pretty_name#', '#dotlrn.course_assistant_role_pretty_plural#'); + perform acs_rel_type__create_role('teaching_assistant', '#dotlrn.teaching_assistant_role_pretty_name#', '#dotlrn.teaching_assistant_role_pretty_plural#'); + perform acs_rel_type__create_role('instructor', '#dotlrn.instructor_role_pretty_name#', '#dotlrn.instructor_role_pretty_plural#'); + perform acs_rel_type__create_role('course_admin', '#dotlrn.course_admin_role_pretty_name#', '#dotlrn.course_admin_role_pretty_plural#'); perform acs_attribute__create_attribute ( - ''dotlrn_community'', - ''student_pretty_name'', - ''string'', - ''Student Pretty Name'', - ''Student Pretty Name'', + 'dotlrn_community', + 'student_pretty_name', + 'string', + 'Student Pretty Name', + 'Student Pretty Name', null, null, null, 0, 1, null, - ''generic'', - ''f'' + 'generic', + 'f' ); perform acs_attribute__create_attribute ( - ''dotlrn_community'', - ''student_pretty_plural'', - ''string'', - ''Student Pretty Plural'', - ''Student Pretty Plural'', + 'dotlrn_community', + 'student_pretty_plural', + 'string', + 'Student Pretty Plural', + 'Student Pretty Plural', null, null, null, 0, 1, null, - ''generic'', - ''f'' + 'generic', + 'f' ); perform acs_attribute__create_attribute ( - ''dotlrn_community'', - ''course_assistant_pretty_name'', - ''string'', - ''Course Assistant Pretty Name'', - ''Course Assistant Pretty Name'', + 'dotlrn_community', + 'course_assistant_pretty_name', + 'string', + 'Course Assistant Pretty Name', + 'Course Assistant Pretty Name', null, null, null, 0, 1, null, - ''generic'', - ''f'' + 'generic', + 'f' ); perform acs_attribute__create_attribute ( - ''dotlrn_community'', - ''course_assistant_pretty_plural'', - ''string'', - ''Course Assistant Pretty Plural'', - ''Course Assistant Pretty Plural'', + 'dotlrn_community', + 'course_assistant_pretty_plural', + 'string', + 'Course Assistant Pretty Plural', + 'Course Assistant Pretty Plural', null, null, null, 0, 1, null, - ''generic'', - ''f'' + 'generic', + 'f' ); perform acs_attribute__create_attribute ( - ''dotlrn_community'', - ''teaching_assistant_pretty_name'', - ''string'', - ''Teaching Assistant Pretty Name'', - ''Teaching Assistant Pretty Name'', + 'dotlrn_community', + 'teaching_assistant_pretty_name', + 'string', + 'Teaching Assistant Pretty Name', + 'Teaching Assistant Pretty Name', null, null, null, 0, 1, null, - ''generic'', - ''f'' + 'generic', + 'f' ); perform acs_attribute__create_attribute ( - ''dotlrn_community'', - ''teaching_assistant_pretty_plural'', - ''string'', - ''Teaching Assistant Pretty Plural'', - ''Teaching Assistant Pretty Plural'', + 'dotlrn_community', + 'teaching_assistant_pretty_plural', + 'string', + 'Teaching Assistant Pretty Plural', + 'Teaching Assistant Pretty Plural', null, null, null, 0, 1, null, - ''generic'', - ''f'' + 'generic', + 'f' ); perform acs_attribute__create_attribute ( - ''dotlrn_community'', - ''instructor_pretty_name'', - ''string'', - ''Professor Pretty Name'', - ''Professor Pretty Name'', + 'dotlrn_community', + 'instructor_pretty_name', + 'string', + 'Professor Pretty Name', + 'Professor Pretty Name', null, null, null, 0, 1, null, - ''generic'', - ''f'' + 'generic', + 'f' ); perform acs_attribute__create_attribute ( - ''dotlrn_community'', - ''instructor_pretty_plural'', - ''string'', - ''Professor Pretty Plural'', - ''Professor Pretty Plural'', + 'dotlrn_community', + 'instructor_pretty_plural', + 'string', + 'Professor Pretty Plural', + 'Professor Pretty Plural', null, null, null, 0, 1, null, - ''generic'', - ''f'' + 'generic', + 'f' ); perform acs_attribute__create_attribute ( - ''dotlrn_community'', - ''course_admin_pretty_name'', - ''string'', - ''Course Administrator Pretty Name'', - ''Course Administrator Pretty Name'', + 'dotlrn_community', + 'course_admin_pretty_name', + 'string', + 'Course Administrator Pretty Name', + 'Course Administrator Pretty Name', null, null, null, 0, 1, null, - ''generic'', - ''f'' + 'generic', + 'f' ); perform acs_attribute__create_attribute ( - ''dotlrn_community'', - ''course_admin_pretty_plural'', - ''string'', - ''Course Administrator Pretty Plural'', - ''Course Administrator Pretty Plural'', + 'dotlrn_community', + 'course_admin_pretty_plural', + 'string', + 'Course Administrator Pretty Plural', + 'Course Administrator Pretty Plural', null, null, null, 0, 1, null, - ''generic'', - ''f'' + 'generic', + 'f' ); perform acs_attribute__create_attribute ( - ''dotlrn_community'', - ''admin_pretty_name'', - ''string'', - ''Administrator Pretty Name'', - ''Administrator Pretty Name'', + 'dotlrn_community', + 'admin_pretty_name', + 'string', + 'Administrator Pretty Name', + 'Administrator Pretty Name', null, null, null, 0, 1, null, - ''generic'', - ''f'' + 'generic', + 'f' ); perform acs_attribute__create_attribute ( - ''dotlrn_community'', - ''admin_pretty_plural'', - ''string'', - ''Administrator Pretty Plural'', - ''Administrator Pretty Plural'', + 'dotlrn_community', + 'admin_pretty_plural', + 'string', + 'Administrator Pretty Plural', + 'Administrator Pretty Plural', null, null, null, 0, 1, null, - ''generic'', - ''f'' + 'generic', + 'f' ); -- create basic rel_types perform acs_rel_type__create_type ( - ''dotlrn_member_rel'', - ''#dotlrn.dotlrn_member_rel_pretty_name#'', - ''#dotlrn.dotlrn_member_rel_pretty_plural#'', - ''membership_rel'', - ''dotlrn_member_rels'', - ''rel_id'', - ''dotlrn_member_rel'', - ''dotlrn_community'', + 'dotlrn_member_rel', + '#dotlrn.dotlrn_member_rel_pretty_name#', + '#dotlrn.dotlrn_member_rel_pretty_plural#', + 'membership_rel', + 'dotlrn_member_rels', + 'rel_id', + 'dotlrn_member_rel', + 'dotlrn_community', null, 0, null, - ''user'', - ''member'', + 'user', + 'member', 0, null ); perform acs_rel_type__create_type ( - ''dotlrn_admin_rel'', - ''#dotlrn.dotlrn_admin_rel_pretty_name#'', - ''#dotlrn.dotlrn_admin_rel_pretty_plural#'', - ''dotlrn_member_rel'', - ''dotlrn_admin_rels'', - ''rel_id'', - ''dotlrn_admin_rel'', - ''dotlrn_community'', + 'dotlrn_admin_rel', + '#dotlrn.dotlrn_admin_rel_pretty_name#', + '#dotlrn.dotlrn_admin_rel_pretty_plural#', + 'dotlrn_member_rel', + 'dotlrn_admin_rels', + 'rel_id', + 'dotlrn_admin_rel', + 'dotlrn_community', null, 0, null, - ''user'', - ''admin'', + 'user', + 'admin', 0, null ); -- all rels to communities must have a portal_id perform acs_attribute__create_attribute ( - ''dotlrn_member_rel'', - ''portal_id'', - ''integer'', - ''Page ID'', - ''Page IDs'', + 'dotlrn_member_rel', + 'portal_id', + 'integer', + 'Page ID', + 'Page IDs', null, null, null, 1, 1, null, - ''type_specific'', - ''f'' + 'type_specific', + 'f' ); return 0; -end;' language 'plpgsql'; +END; +$$ LANGUAGE plpgsql; select inline_0(); drop function inline_0(); Index: openacs-4/packages/dotlrn/sql/postgresql/dotlrn-sanitize.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/sql/postgresql/dotlrn-sanitize.sql,v diff -u -r1.3 -r1.4 --- openacs-4/packages/dotlrn/sql/postgresql/dotlrn-sanitize.sql 8 Aug 2006 21:26:22 -0000 1.3 +++ openacs-4/packages/dotlrn/sql/postgresql/dotlrn-sanitize.sql 1 Nov 2013 21:08:29 -0000 1.4 @@ -26,160 +26,160 @@ -- @note We remember September 11th, 2001 -- -create function inline_0() -returns integer as ' -begin +CREATE OR REPLACE FUNCTION inline_0() RETURNS integer AS $$ +BEGIN perform acs_rel_type__drop_type( - ''dotlrn_admin_rel'', - ''t'' + 'dotlrn_admin_rel', + 't' ); -- all rels to communities must have a portal_id perform acs_attribute__drop_attribute( - ''dotlrn_member_rel'', - ''portal_id'' + 'dotlrn_member_rel', + 'portal_id' ); -- drop basic rel_types perform acs_rel_type__drop_type( - ''dotlrn_member_rel'', - ''t'' + 'dotlrn_member_rel', + 't' ); -- drop roles perform acs_rel_type__drop_role( - ''student'' + 'student' ); perform acs_attribute__drop_attribute( - ''dotlrn_community'', - ''student_pretty_name'' + 'dotlrn_community', + 'student_pretty_name' ); perform acs_attribute__drop_attribute( - ''dotlrn_community'', - ''student_pretty_plural'' + 'dotlrn_community', + 'student_pretty_plural' ); perform acs_rel_type__drop_role( - ''course_assistant'' + 'course_assistant' ); perform acs_attribute__drop_attribute( - ''dotlrn_community'', - ''course_assistant_pretty_name'' + 'dotlrn_community', + 'course_assistant_pretty_name' ); perform acs_attribute__drop_attribute( - ''dotlrn_community'', - ''course_assistant_pretty_plural'' + 'dotlrn_community', + 'course_assistant_pretty_plural' ); perform acs_rel_type__drop_role( - ''teaching_assistant'' + 'teaching_assistant' ); perform acs_attribute__drop_attribute( - ''dotlrn_community'', - ''teaching_assistant_pretty_name'' + 'dotlrn_community', + 'teaching_assistant_pretty_name' ); perform acs_attribute__drop_attribute( - ''dotlrn_community'', - ''teaching_assistant_pretty_plural'' + 'dotlrn_community', + 'teaching_assistant_pretty_plural' ); perform acs_rel_type__drop_role( - ''instructor'' + 'instructor' ); perform acs_attribute__drop_attribute( - ''dotlrn_community'', - ''instructor_pretty_name'' + 'dotlrn_community', + 'instructor_pretty_name' ); perform acs_attribute__drop_attribute( - ''dotlrn_community'', - ''instructor_pretty_plural'' + 'dotlrn_community', + 'instructor_pretty_plural' ); perform acs_rel_type__drop_role( - ''course_admin'' + 'course_admin' ); perform acs_attribute__drop_attribute( - ''dotlrn_community'', - ''course_admin_pretty_name'' + 'dotlrn_community', + 'course_admin_pretty_name' ); perform acs_attribute__drop_attribute( - ''dotlrn_community'', - ''course_admin_pretty_plural'' + 'dotlrn_community', + 'course_admin_pretty_plural' ); perform acs_rel_type__drop_role( - ''admin'' + 'admin' ); perform acs_attribute__drop_attribute( - ''dotlrn_community'', - ''admin_pretty_name'' + 'dotlrn_community', + 'admin_pretty_name' ); perform acs_attribute__drop_attribute( - ''dotlrn_community'', - ''admin_pretty_plural'' + 'dotlrn_community', + 'admin_pretty_plural' ); -- drop the dotlrn_club community type perform dotlrn_community_type__delete( - ''dotlrn_club'' + 'dotlrn_club' ); -- drop the dotlrn_class community type perform dotlrn_community_type__delete( - ''dotlrn_class_instance'' + 'dotlrn_class_instance' ); perform acs_attribute__drop_attribute( - ''dotlrn_community'', - ''header_font'' + 'dotlrn_community', + 'header_font' ); perform acs_attribute__drop_attribute( - ''dotlrn_community'', - ''header_font_size'' + 'dotlrn_community', + 'header_font_size' ); perform acs_attribute__drop_attribute( - ''dotlrn_community'', - ''header_font_color'' + 'dotlrn_community', + 'header_font_color' ); perform acs_attribute__drop_attribute( - ''dotlrn_community'', - ''header_logo_item_id'' + 'dotlrn_community', + 'header_logo_item_id' ); perform acs_attribute__drop_attribute( - ''dotlrn_community'', - ''member_pretty_name'' + 'dotlrn_community', + 'member_pretty_name' ); perform acs_attribute__drop_attribute( - ''dotlrn_community'', - ''member_pretty_plural'' + 'dotlrn_community', + 'member_pretty_plural' ); -- drop the base community type perform dotlrn_community_type__delete( - ''dotlrn_community'' + 'dotlrn_community' ); return 0; -end;' language 'plpgsql'; +END; +$$ LANGUAGE plpgsql; select inline_0(); drop function inline_0(); Index: openacs-4/packages/dotlrn/sql/postgresql/external-profile-provider-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/sql/postgresql/external-profile-provider-create.sql,v diff -u -r1.3 -r1.4 --- openacs-4/packages/dotlrn/sql/postgresql/external-profile-provider-create.sql 8 Aug 2006 21:26:22 -0000 1.3 +++ openacs-4/packages/dotlrn/sql/postgresql/external-profile-provider-create.sql 1 Nov 2013 21:08:29 -0000 1.4 @@ -21,55 +21,55 @@ -- @version $Id$ -- -create function inline_0() -returns integer as ' -begin +CREATE OR REPLACE FUNCTION inline_0() RETURNS integer AS $$ +BEGIN -- create the implementation perform acs_sc_impl__new( - ''profile_provider'', - ''dotlrn_external_profile_provider'', - ''dotlrn_external_profile_provider'' + 'profile_provider', + 'dotlrn_external_profile_provider', + 'dotlrn_external_profile_provider' ); -- add the bindings to the method implementations -- name method perform acs_sc_impl_alias__new( - ''profile_provider'', - ''dotlrn_external_profile_provider'', - ''name'', - ''dotlrn_external_profile_provider::name'', - ''TCL'' + 'profile_provider', + 'dotlrn_external_profile_provider', + 'name', + 'dotlrn_external_profile_provider::name', + 'TCL' ); -- prettyName method perform acs_sc_impl_alias__new( - ''profile_provider'', - ''dotlrn_external_profile_provider'', - ''prettyName'', - ''dotlrn_external_profile_provider::prettyName'', - ''TCL'' + 'profile_provider', + 'dotlrn_external_profile_provider', + 'prettyName', + 'dotlrn_external_profile_provider::prettyName', + 'TCL' ); -- render method perform acs_sc_impl_alias__new( - ''profile_provider'', - ''dotlrn_external_profile_provider'', - ''render'', - ''dotlrn_external_profile_provider::render'', - ''TCL'' + 'profile_provider', + 'dotlrn_external_profile_provider', + 'render', + 'dotlrn_external_profile_provider::render', + 'TCL' ); -- bind this implementation to the interface it implements perform acs_sc_binding__new( - ''profile_provider'', - ''dotlrn_external_profile_provider'' + 'profile_provider', + 'dotlrn_external_profile_provider' ); return 0; -end;' language 'plpgsql'; +END; +$$ LANGUAGE plpgsql; select inline_0(); drop function inline_0(); Index: openacs-4/packages/dotlrn/sql/postgresql/external-profile-provider-drop.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/sql/postgresql/external-profile-provider-drop.sql,v diff -u -r1.3 -r1.4 --- openacs-4/packages/dotlrn/sql/postgresql/external-profile-provider-drop.sql 8 Aug 2006 21:26:22 -0000 1.3 +++ openacs-4/packages/dotlrn/sql/postgresql/external-profile-provider-drop.sql 1 Nov 2013 21:08:29 -0000 1.4 @@ -22,52 +22,59 @@ -- @version $Id$ -- -create function inline_0() -returns integer as ' -declare + + +-- +-- procedure inline_0/0 +-- +CREATE OR REPLACE FUNCTION inline_0( + +) RETURNS integer AS $$ +DECLARE foo integer; -begin +BEGIN -- drop the binding between this implementation and the interface it -- implements. perform acs_sc_binding__delete( - ''profile_provider'', - ''dotlrn_external_profile_provider'' + 'profile_provider', + 'dotlrn_external_profile_provider' ); -- drop the bindings to the method implementations -- name method perform acs_sc_impl_alias__delete( - ''profile_provider'', - ''dotlrn_external_profile_provider'', - ''name'' + 'profile_provider', + 'dotlrn_external_profile_provider', + 'name' ); -- prettyName method perform acs_sc_impl_alias__delete( - ''profile_provider'', - ''dotlrn_external_profile_provider'', - ''prettyName'' + 'profile_provider', + 'dotlrn_external_profile_provider', + 'prettyName' ); -- render method perform acs_sc_impl_alias__delete( - ''profile_provider'', - ''dotlrn_external_profile_provider'', - ''render'' + 'profile_provider', + 'dotlrn_external_profile_provider', + 'render' ); -- drop the implementation perform acs_sc_impl__delete( - ''profile_provider'', - ''dotlrn_external_profile_provider'' + 'profile_provider', + 'dotlrn_external_profile_provider' ); return 0; -end; -' language 'plpgsql'; +END; +$$ LANGUAGE plpgsql; + select inline_0(); drop function inline_0(); Index: openacs-4/packages/dotlrn/sql/postgresql/externals-init.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/sql/postgresql/externals-init.sql,v diff -u -r1.5 -r1.6 --- openacs-4/packages/dotlrn/sql/postgresql/externals-init.sql 8 Aug 2006 21:26:22 -0000 1.5 +++ openacs-4/packages/dotlrn/sql/postgresql/externals-init.sql 1 Nov 2013 21:08:29 -0000 1.6 @@ -22,28 +22,34 @@ -- -create function inline_1() -returns integer as ' -declare + + +-- +-- procedure inline_1/0 +-- +CREATE OR REPLACE FUNCTION inline_1( + +) RETURNS integer AS $$ +DECLARE foo integer; gid integer; sid integer; dotlrn_users_group_id integer; -begin +BEGIN PERFORM acs_rel_type__create_type( - ''dotlrn_external_profile_rel'', - ''dotLRN Profile External'', - ''dotLRN External Externals'', - ''dotlrn_user_profile_rel'', - ''dotlrn_external_profile_rels'', - ''rel_id'', - ''dotlrn_external_profile_rel'', - ''profiled_group'', + 'dotlrn_external_profile_rel', + 'dotLRN Profile External', + 'dotLRN External Externals', + 'dotlrn_user_profile_rel', + 'dotlrn_external_profile_rels', + 'rel_id', + 'dotlrn_external_profile_rel', + 'profiled_group', null, 0, null, - ''user'', + 'user', null, 0, 1 @@ -52,29 +58,29 @@ select min(impl_id) into foo from acs_sc_impls - where impl_name = ''dotlrn_external_profile_provider''; + where impl_name = 'dotlrn_external_profile_provider'; gid := profiled_group__new( foo, - ''dotLRN Externals'' + 'dotLRN Externals' ); sid := rel_segment__new( - ''dotLRN Externals'', + 'dotLRN Externals', gid, - ''dotlrn_external_profile_rel'' + 'dotlrn_external_profile_rel' ); insert into dotlrn_user_types (type, pretty_name, rel_type, group_id, segment_id) values - (''external'', ''#dotlrn.user_type_external_pretty_name#'', ''dotlrn_external_profile_rel'', gid, sid); + ('external', '#dotlrn.user_type_external_pretty_name#', 'dotlrn_external_profile_rel', gid, sid); select group_id into dotlrn_users_group_id from groups - where group_name = ''dotLRN Users''; + where group_name = 'dotLRN Users'; foo := composition_rel__new( dotlrn_users_group_id, @@ -83,9 +89,10 @@ return 0; -end; -' language 'plpgsql'; +END; +$$ LANGUAGE plpgsql; + select inline_1(); drop function inline_1(); Index: openacs-4/packages/dotlrn/sql/postgresql/externals-package-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/sql/postgresql/externals-package-create.sql,v diff -u -r1.5 -r1.6 --- openacs-4/packages/dotlrn/sql/postgresql/externals-package-create.sql 8 Aug 2006 21:26:22 -0000 1.5 +++ openacs-4/packages/dotlrn/sql/postgresql/externals-package-create.sql 1 Nov 2013 21:08:29 -0000 1.6 @@ -26,18 +26,24 @@ select define_function_args ('dotlrn_external_profile_rel__delete','rel_id'); -create function dotlrn_external_profile_rel__new(integer,integer,integer,integer,varchar,varchar,integer,integer,varchar) -returns integer as ' + + +-- +-- procedure dotlrn_external_profile_rel__new/9 +-- +CREATE OR REPLACE FUNCTION dotlrn_external_profile_rel__new( + p_rel_id integer, + p_user_id integer, + p_portal_id integer, + p_theme_id integer, + p_id varchar, + p_rel_type varchar, -- default 'dotlrn_external_profile_rel' + p_group_id integer, + p_creation_user integer, + p_creation_ip varchar + +) RETURNS integer AS $$ DECLARE - p_rel_id alias for $1; - p_user_id alias for $2; - p_portal_id alias for $3; - p_theme_id alias for $4; - p_id alias for $5; - p_rel_type alias for $6; - p_group_id alias for $7; - p_creation_user alias for $8; - p_creation_ip alias for $9; v_rel_id dotlrn_user_profile_rels.rel_id%TYPE; v_group_id groups.group_id%TYPE; BEGIN @@ -47,7 +53,7 @@ from profiled_groups where profile_provider = (select min(impl_id) from acs_sc_impls - where impl_name = ''dotlrn_external_profile_provider''); + where impl_name = 'dotlrn_external_profile_provider'); else v_group_id := p_group_id; end if; @@ -72,13 +78,19 @@ return v_rel_id; END; -' language 'plpgsql'; +$$ LANGUAGE plpgsql; -create function dotlrn_external_profile_rel__delete(integer) -returns integer as ' + + + +-- +-- procedure dotlrn_external_profile_rel__delete/1 +-- +CREATE OR REPLACE FUNCTION dotlrn_external_profile_rel__delete( + p_rel_id integer +) RETURNS integer AS $$ DECLARE - p_rel_id alias for $1; BEGIN delete from dotlrn_external_profile_rels @@ -87,5 +99,6 @@ PERFORM dotlrn_user_profile_rel__delete(p_rel_id); return (0); END; -' language 'plpgsql'; +$$ LANGUAGE plpgsql; + Index: openacs-4/packages/dotlrn/sql/postgresql/externals-sanitize.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/sql/postgresql/externals-sanitize.sql,v diff -u -r1.3 -r1.4 --- openacs-4/packages/dotlrn/sql/postgresql/externals-sanitize.sql 8 Aug 2006 21:26:22 -0000 1.3 +++ openacs-4/packages/dotlrn/sql/postgresql/externals-sanitize.sql 1 Nov 2013 21:08:29 -0000 1.4 @@ -22,43 +22,56 @@ -- @version $Id$ -- -create function inline_0() -returns integer as ' -declare + + +-- +-- procedure inline_0/0 +-- +CREATE OR REPLACE FUNCTION inline_0( + +) RETURNS integer AS $$ +DECLARE foo integer; -begin +BEGIN select min(segment_id) into foo from rel_segments - where segment_name = ''dotLRN Full Profiled Externals''; + where segment_name = 'dotLRN Full Profiled Externals'; perform rel_segment__delete( foo ); perform acs_rel_type__drop_type( - ''dotlrn_full_external_profile_rel'', - ''t'' + 'dotlrn_full_external_profile_rel', + 't' ); return 0; -end;' language 'plpgsql'; +END; +$$ LANGUAGE plpgsql; select inline_0(); drop function inline_0(); -create function inline_1() -returns integer as ' -declare + + +-- +-- procedure inline_1/0 +-- +CREATE OR REPLACE FUNCTION inline_1( + +) RETURNS integer AS $$ +DECLARE foo integer; -begin +BEGIN select min(segment_id) into foo from rel_segments - where segment_name = ''dotLRN Profiled Externals''; + where segment_name = 'dotLRN Profiled Externals'; perform rel_segment__delete( foo @@ -69,7 +82,7 @@ from profiled_groups where profile_provider = (select min(impl_id) from acs_sc_impls - where impl_name = ''dotlrn_external_profile_provider''); + where impl_name = 'dotlrn_external_profile_provider'); delete from dotlrn_user_types @@ -80,14 +93,15 @@ ); perform acs_rel_type__drop_type( - ''dotlrn_external_profile_rel'', - ''t'' + 'dotlrn_external_profile_rel', + 't' ); return 0; -end; -' language 'plpgsql'; +END; +$$ LANGUAGE plpgsql; + select inline_1(); drop function inline_1(); Index: openacs-4/packages/dotlrn/sql/postgresql/main-portlet-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/sql/postgresql/main-portlet-create.sql,v diff -u -r1.3 -r1.4 --- openacs-4/packages/dotlrn/sql/postgresql/main-portlet-create.sql 8 Aug 2006 21:26:22 -0000 1.3 +++ openacs-4/packages/dotlrn/sql/postgresql/main-portlet-create.sql 1 Nov 2013 21:08:29 -0000 1.4 @@ -31,17 +31,23 @@ -- License version 2 or higher. Full text of the license is available -- from the GNU Project: http://www.fsf.org/copyleft/gpl.html -create function inline_0 () -returns integer as ' -declare + + +-- +-- procedure inline_0/0 +-- +CREATE OR REPLACE FUNCTION inline_0( + +) RETURNS integer AS $$ +DECLARE ds_id portal_datasources.datasource_id%TYPE; foo integer; -begin +BEGIN ds_id := portal_datasource__new( null, - ''dotlrn_main_portlet'', - ''Displays the list of communities a user belongs to'', - ''portal_datasource'', + 'dotlrn_main_portlet', + 'Displays the list of communities a user belongs to', + 'portal_datasource', now(), null, null, @@ -52,103 +58,104 @@ -- shadeable_p perform portal_datasource__set_def_param( - ds_id, ''t'', ''t'', ''shadeable_p'', ''f'' + ds_id, 't', 't', 'shadeable_p', 'f' ); -- hideable_p perform portal_datasource__set_def_param( - ds_id, ''t'', ''t'', ''hideable_p'', ''f'' + ds_id, 't', 't', 'hideable_p', 'f' ); -- user_editable_p perform portal_datasource__set_def_param( - ds_id, ''t'', ''t'', ''user_editable_p'', ''f'' + ds_id, 't', 't', 'user_editable_p', 'f' ); -- shaded_p perform portal_datasource__set_def_param( - ds_id, ''t'', ''t'', ''shaded_p'', ''f'' + ds_id, 't', 't', 'shaded_p', 'f' ); -- link_hideable_p perform portal_datasource__set_def_param( - ds_id, ''t'', ''t'', ''link_hideable_p'', ''t'' + ds_id, 't', 't', 'link_hideable_p', 't' ); -- create the implementation perform acs_sc_impl__new( - ''portal_datasource'', - ''dotlrn_main_portlet'', - ''dotlrn_main_portlet'' + 'portal_datasource', + 'dotlrn_main_portlet', + 'dotlrn_main_portlet' ); -- add all the hooks perform acs_sc_impl_alias__new ( - ''portal_datasource'', - ''dotlrn_main_portlet'', - ''GetMyName'', - ''dotlrn_main_portlet::get_my_name'', - ''TCL'' + 'portal_datasource', + 'dotlrn_main_portlet', + 'GetMyName', + 'dotlrn_main_portlet::get_my_name', + 'TCL' ); perform acs_sc_impl_alias__new ( - ''portal_datasource'', - ''dotlrn_main_portlet'', - ''GetPrettyName'', - ''dotlrn_main_portlet::get_pretty_name'', - ''TCL'' + 'portal_datasource', + 'dotlrn_main_portlet', + 'GetPrettyName', + 'dotlrn_main_portlet::get_pretty_name', + 'TCL' ); perform acs_sc_impl_alias__new ( - ''portal_datasource'', - ''dotlrn_main_portlet'', - ''Link'', - ''dotlrn_main_portlet::link'', - ''TCL'' + 'portal_datasource', + 'dotlrn_main_portlet', + 'Link', + 'dotlrn_main_portlet::link', + 'TCL' ); perform acs_sc_impl_alias__new ( - ''portal_datasource'', - ''dotlrn_main_portlet'', - ''AddSelfToPage'', - ''dotlrn_main_portlet::add_self_to_page'', - ''TCL'' + 'portal_datasource', + 'dotlrn_main_portlet', + 'AddSelfToPage', + 'dotlrn_main_portlet::add_self_to_page', + 'TCL' ); perform acs_sc_impl_alias__new ( - ''portal_datasource'', - ''dotlrn_main_portlet'', - ''RemoveSelfFromPage'', - ''dotlrn_main_portlet::remove_self_from_page'', - ''TCL'' + 'portal_datasource', + 'dotlrn_main_portlet', + 'RemoveSelfFromPage', + 'dotlrn_main_portlet::remove_self_from_page', + 'TCL' ); perform acs_sc_impl_alias__new ( - ''portal_datasource'', - ''dotlrn_main_portlet'', - ''Show'', - ''dotlrn_main_portlet::show'', - ''TCL'' + 'portal_datasource', + 'dotlrn_main_portlet', + 'Show', + 'dotlrn_main_portlet::show', + 'TCL' ); perform acs_sc_impl_alias__new ( - ''portal_datasource'', - ''dotlrn_main_portlet'', - ''Edit'', - ''dotlrn_main_portlet::edit'', - ''TCL'' + 'portal_datasource', + 'dotlrn_main_portlet', + 'Edit', + 'dotlrn_main_portlet::edit', + 'TCL' ); -- Add the binding perform acs_sc_binding__new ( - ''portal_datasource'', - ''dotlrn_main_portlet'' + 'portal_datasource', + 'dotlrn_main_portlet' ); return 0; -end; -' language 'plpgsql'; +END; +$$ LANGUAGE plpgsql; + select inline_0(); drop function inline_0(); Index: openacs-4/packages/dotlrn/sql/postgresql/main-portlet-drop.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/sql/postgresql/main-portlet-drop.sql,v diff -u -r1.3 -r1.4 --- openacs-4/packages/dotlrn/sql/postgresql/main-portlet-drop.sql 8 Aug 2006 21:26:22 -0000 1.3 +++ openacs-4/packages/dotlrn/sql/postgresql/main-portlet-drop.sql 1 Nov 2013 21:08:29 -0000 1.4 @@ -26,68 +26,74 @@ -- License version 2 or higher. Full text of the license is available -- from the GNU Project: http://www.fsf.org/copyleft/gpl.html -create function inline_0 () -returns integer as ' -declare + + +-- +-- procedure inline_0/0 +-- +CREATE OR REPLACE FUNCTION inline_0( + +) RETURNS integer AS $$ +DECLARE ds_id portal_datasources.datasource_id%TYPE; -begin +BEGIN perform acs_sc_binding__delete( - ''portal_datasource'', - ''dotlrn_main_portlet'' + 'portal_datasource', + 'dotlrn_main_portlet' ); perform acs_sc_impl_alias__delete( - ''portal_datasource'', - ''dotlrn_main_portlet'', - ''GetMyName'' + 'portal_datasource', + 'dotlrn_main_portlet', + 'GetMyName' ); perform acs_sc_impl_alias__delete( - ''portal_datasource'', - ''dotlrn_main_portlet'', - ''GetPrettyName'' + 'portal_datasource', + 'dotlrn_main_portlet', + 'GetPrettyName' ); perform acs_sc_impl_alias__delete( - ''portal_datasource'', - ''dotlrn_main_portlet'', - ''Link'' + 'portal_datasource', + 'dotlrn_main_portlet', + 'Link' ); perform acs_sc_impl_alias__delete( - ''portal_datasource'', - ''dotlrn_main_portlet'', - ''AddSelfToPage'' + 'portal_datasource', + 'dotlrn_main_portlet', + 'AddSelfToPage' ); perform acs_sc_impl_alias__delete( - ''portal_datasource'', - ''dotlrn_main_portlet'', - ''RemoveSelfFromPage'' + 'portal_datasource', + 'dotlrn_main_portlet', + 'RemoveSelfFromPage' ); perform acs_sc_impl_alias__delete( - ''portal_datasource'', - ''dotlrn_main_portlet'', - ''Show'' + 'portal_datasource', + 'dotlrn_main_portlet', + 'Show' ); perform acs_sc_impl_alias__delete( - ''portal_datasource'', - ''dotlrn_main_portlet'', - ''Edit'' + 'portal_datasource', + 'dotlrn_main_portlet', + 'Edit' ); perform acs_sc_impl__delete( - ''portal_datasource'', - ''dotlrn_main_portlet'' + 'portal_datasource', + 'dotlrn_main_portlet' ); begin select datasource_id into ds_id from portal_datasources - where name = ''dotlrn-main-portlet''; + where name = 'dotlrn-main-portlet'; -- cant seem to get the exception working properly.. -- is it really necessary here? look into it later. -dan chak 2002-07-02 -- exception when no_data_found then @@ -100,9 +106,10 @@ return 0; -end; -' language 'plpgsql'; +END; +$$ LANGUAGE plpgsql; + select inline_0(); drop function inline_0(); Index: openacs-4/packages/dotlrn/sql/postgresql/privacy-init.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/sql/postgresql/privacy-init.sql,v diff -u -r1.2 -r1.3 --- openacs-4/packages/dotlrn/sql/postgresql/privacy-init.sql 20 Apr 2004 21:13:17 -0000 1.2 +++ openacs-4/packages/dotlrn/sql/postgresql/privacy-init.sql 1 Nov 2013 21:08:29 -0000 1.3 @@ -16,74 +16,81 @@ -- private information such as the names of students taking a -- particular class. -- -create function inline_1() -returns integer as ' -declare + + +-- +-- procedure inline_1/0 +-- +CREATE OR REPLACE FUNCTION inline_1( + +) RETURNS integer AS $$ +DECLARE v_guest_segment_id integer; v_non_guest_segment_id integer; v_object_id integer; -begin +BEGIN -- -- Guests -- perform acs_rel_type__create_type( - ''dotlrn_guest_rel'', - ''.LRN Guest'', - ''.LRN Guests'', - ''membership_rel'', - ''dotlrn_guest_rels'', - ''rel_id'', - ''dotlrn_guest_rel'', - ''group'', + 'dotlrn_guest_rel', + '.LRN Guest', + '.LRN Guests', + 'membership_rel', + 'dotlrn_guest_rels', + 'rel_id', + 'dotlrn_guest_rel', + 'group', null, 0, null, - ''user'', + 'user', null, 0, 1 ); v_guest_segment_id := rel_segment__new( - ''Registered .LRN Guests'', - acs__magic_object_id(''registered_users''), - ''dotlrn_guest_rel'' + 'Registered .LRN Guests', + acs__magic_object_id('registered_users'), + 'dotlrn_guest_rel' ); -- -- Non Guests -- perform acs_rel_type__create_type( - ''dotlrn_non_guest_rel'', - ''.LRN Non-Guest'', - ''.LRN Non-Guests'', - ''membership_rel'', - ''dotlrn_non_guest_rels'', - ''rel_id'', - ''dotlrn_non_guest_rel'', - ''group'', + 'dotlrn_non_guest_rel', + '.LRN Non-Guest', + '.LRN Non-Guests', + 'membership_rel', + 'dotlrn_non_guest_rels', + 'rel_id', + 'dotlrn_non_guest_rel', + 'group', null, 0, null, - ''user'', + 'user', null, 0, 1 ); v_non_guest_segment_id := rel_segment__new( - ''Registered .LRN Non-Guests'', - acs__magic_object_id(''registered_users''), - ''dotlrn_non_guest_rel'' + 'Registered .LRN Non-Guests', + acs__magic_object_id('registered_users'), + 'dotlrn_non_guest_rel' ); return(0); -end; -' language 'plpgsql'; +END; +$$ LANGUAGE plpgsql; + select inline_1(); drop function inline_1(); Index: openacs-4/packages/dotlrn/sql/postgresql/privacy-package-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/sql/postgresql/privacy-package-create.sql,v diff -u -r1.2 -r1.3 --- openacs-4/packages/dotlrn/sql/postgresql/privacy-package-create.sql 20 Apr 2004 21:13:17 -0000 1.2 +++ openacs-4/packages/dotlrn/sql/postgresql/privacy-package-create.sql 1 Nov 2013 21:08:29 -0000 1.3 @@ -9,115 +9,145 @@ -- provides extra checking to a simple view query, since Guest status is not -- yet used uniformly across OACS. -- -create or replace function dotlrn_privacy__guest_p (integer) -returns char as ' -declare - v_user_id alias for $1; + + +-- +-- procedure dotlrn_privacy__guest_p/1 +-- +CREATE OR REPLACE FUNCTION dotlrn_privacy__guest_p( + p_user_id integer +) RETURNS char AS $$ +DECLARE v_count integer; v_guest_p char(1); -begin - select count(*) into v_count from dotlrn_guest_status where user_id = v_user_id; +BEGIN + select count(*) into v_count from dotlrn_guest_status where user_id = p_user_id; if v_count > 1 then - raise EXCEPTION ''-20000: Guest status is multiply defined for user %'', v_user_id; + raise EXCEPTION '-20000: Guest status is multiply defined for user %', p_user_id; end if; if v_count = 0 then - raise EXCEPTION ''-20000: Guest status is not defined for user %'', v_user_id; + raise EXCEPTION '-20000: Guest status is not defined for user %', p_user_id; end if; - select guest_p into v_guest_p from dotlrn_guest_status where user_id = v_user_id; + select guest_p into v_guest_p from dotlrn_guest_status where user_id = p_user_id; return v_guest_p; -end;' language 'plpgsql'; +END; +$$ LANGUAGE plpgsql; -create or replace function dotlrn_privacy__set_user_non_guest (integer) -returns integer as ' -declare - v_user_id alias for $1; + + +-- +-- procedure dotlrn_privacy__set_user_non_guest/1 +-- +CREATE OR REPLACE FUNCTION dotlrn_privacy__set_user_non_guest( + p_user_id integer +) RETURNS integer AS $$ +DECLARE v_rel_id integer; cur record; -begin +BEGIN for cur in select r.rel_id from acs_rels r, membership_rels m where m.rel_id = r.rel_id - and (r.rel_type = ''dotlrn_guest_rel'' - or r.rel_type = ''dotlrn_non_guest_rel'') - and r.object_id_one = acs__magic_object_id(''registered_users'') - and r.object_id_two = v_user_id + and (r.rel_type = 'dotlrn_guest_rel' + or r.rel_type = 'dotlrn_non_guest_rel') + and r.object_id_one = acs__magic_object_id('registered_users') + and r.object_id_two = p_user_id loop perform membership_rel__delete(cur.rel_id); end loop; v_rel_id := membership_rel__new( null, - ''dotlrn_non_guest_rel'', - acs__magic_object_id(''registered_users''), - v_user_id, - ''approved'', + 'dotlrn_non_guest_rel', + acs__magic_object_id('registered_users'), + p_user_id, + 'approved', null, null ); return 0; -end;' language 'plpgsql'; +END; +$$ LANGUAGE plpgsql; -create or replace function dotlrn_privacy__set_user_guest (integer) -returns integer as ' -declare - v_user_id alias for $1; + + +-- +-- procedure dotlrn_privacy__set_user_guest/1 +-- +CREATE OR REPLACE FUNCTION dotlrn_privacy__set_user_guest( + p_user_id integer +) RETURNS integer AS $$ +DECLARE v_rel_id integer; cur record; -begin +BEGIN for cur in select r.rel_id from acs_rels r, membership_rels m where m.rel_id = r.rel_id - and (r.rel_type = ''dotlrn_guest_rel'' - or r.rel_type = ''dotlrn_non_guest_rel'') - and r.object_id_one = acs__magic_object_id(''registered_users'') - and r.object_id_two = v_user_id + and (r.rel_type = 'dotlrn_guest_rel' + or r.rel_type = 'dotlrn_non_guest_rel') + and r.object_id_one = acs__magic_object_id('registered_users') + and r.object_id_two = p_user_id loop perform membership_rel__delete(cur.rel_id); end loop; v_rel_id := membership_rel__new( null, - ''dotlrn_guest_rel'', - acs__magic_object_id(''registered_users''), - v_user_id, - ''approved'', + 'dotlrn_guest_rel', + acs__magic_object_id('registered_users'), + p_user_id, + 'approved', null, null ); return 0; -end;' language 'plpgsql'; +END; +$$ LANGUAGE plpgsql; -create or replace function dotlrn_privacy__grant_rd_prv_dt_to_rel (integer,varchar) -returns integer as ' -declare - v_object_id alias for $1; - v_rel_type alias for $2; + + +-- +-- procedure dotlrn_privacy__grant_rd_prv_dt_to_rel/2 +-- +CREATE OR REPLACE FUNCTION dotlrn_privacy__grant_rd_prv_dt_to_rel( + v_object_id integer, + v_rel_type varchar +) RETURNS integer AS $$ +DECLARE v_segment_id integer; -begin +BEGIN select segment_id into v_segment_id from rel_segments - where group_id = acs__magic_object_id(''registered_users'') + where group_id = acs__magic_object_id('registered_users') and rel_type = v_rel_type; - perform acs_permission__grant_permission(v_object_id,v_segment_id,''read_private_data''); + perform acs_permission__grant_permission(v_object_id,v_segment_id,'read_private_data'); return 0; -end;' language 'plpgsql'; +END; +$$ LANGUAGE plpgsql; -create or replace function dotlrn_privacy__revoke_rd_prv_dt_from_rel (integer,varchar) -returns integer as ' -declare - v_object_id alias for $1; - v_rel_type alias for $2; + + +-- +-- procedure dotlrn_privacy__revoke_rd_prv_dt_from_rel/2 +-- +CREATE OR REPLACE FUNCTION dotlrn_privacy__revoke_rd_prv_dt_from_rel( + v_object_id integer, + v_rel_type varchar +) RETURNS integer AS $$ +DECLARE v_segment_id integer; -begin +BEGIN select segment_id into v_segment_id from rel_segments - where group_id = acs__magic_object_id(''registered_users'') + where group_id = acs__magic_object_id('registered_users') and rel_type = v_rel_type; - perform acs_permission__revoke_permission(v_object_id,v_segment_id,''read_private_data''); + perform acs_permission__revoke_permission(v_object_id,v_segment_id,'read_private_data'); return 0; -end;' language 'plpgsql'; +END; +$$ LANGUAGE plpgsql; Index: openacs-4/packages/dotlrn/sql/postgresql/professor-profile-provider-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/sql/postgresql/professor-profile-provider-create.sql,v diff -u -r1.3 -r1.4 --- openacs-4/packages/dotlrn/sql/postgresql/professor-profile-provider-create.sql 8 Aug 2006 21:26:22 -0000 1.3 +++ openacs-4/packages/dotlrn/sql/postgresql/professor-profile-provider-create.sql 1 Nov 2013 21:08:29 -0000 1.4 @@ -22,55 +22,55 @@ -- @version $Id$ -- -create function inline_0() -returns integer as ' -begin +CREATE OR REPLACE FUNCTION inline_0() RETURNS integer AS $$ +BEGIN -- create the implementation perform acs_sc_impl__new( - ''profile_provider'', - ''dotlrn_professor_profile_provider'', - ''dotlrn_professor_profile_provider'' + 'profile_provider', + 'dotlrn_professor_profile_provider', + 'dotlrn_professor_profile_provider' ); -- add the bindings to the method implementations -- name method perform acs_sc_impl_alias__new( - ''profile_provider'', - ''dotlrn_professor_profile_provider'', - ''name'', - ''dotlrn_professor_profile_provider::name'', - ''TCL'' + 'profile_provider', + 'dotlrn_professor_profile_provider', + 'name', + 'dotlrn_professor_profile_provider::name', + 'TCL' ); -- prettyName method perform acs_sc_impl_alias__new( - ''profile_provider'', - ''dotlrn_professor_profile_provider'', - ''prettyName'', - ''dotlrn_professor_profile_provider::prettyName'', - ''TCL'' + 'profile_provider', + 'dotlrn_professor_profile_provider', + 'prettyName', + 'dotlrn_professor_profile_provider::prettyName', + 'TCL' ); -- render method perform acs_sc_impl_alias__new( - ''profile_provider'', - ''dotlrn_professor_profile_provider'', - ''render'', - ''dotlrn_professor_profile_provider::render'', - ''TCL'' + 'profile_provider', + 'dotlrn_professor_profile_provider', + 'render', + 'dotlrn_professor_profile_provider::render', + 'TCL' ); -- bind this implementation to the interface it implements perform acs_sc_binding__new( - ''profile_provider'', - ''dotlrn_professor_profile_provider'' + 'profile_provider', + 'dotlrn_professor_profile_provider' ); return 0; -end;' language 'plpgsql'; +END; +$$ LANGUAGE plpgsql; select inline_0(); drop function inline_0(); Index: openacs-4/packages/dotlrn/sql/postgresql/professor-profile-provider-drop.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/sql/postgresql/professor-profile-provider-drop.sql,v diff -u -r1.3 -r1.4 --- openacs-4/packages/dotlrn/sql/postgresql/professor-profile-provider-drop.sql 8 Aug 2006 21:26:22 -0000 1.3 +++ openacs-4/packages/dotlrn/sql/postgresql/professor-profile-provider-drop.sql 1 Nov 2013 21:08:29 -0000 1.4 @@ -22,51 +22,58 @@ -- @version $Id$ -- -create function inline_0() -returns integer as ' -declare + + +-- +-- procedure inline_0/0 +-- +CREATE OR REPLACE FUNCTION inline_0( + +) RETURNS integer AS $$ +DECLARE foo integer; -begin +BEGIN -- drop the binding between this implementation and the interface it -- implements. perform acs_sc_binding__delete( - ''profile_provider'', - ''dotlrn_professor_profile_provider'' + 'profile_provider', + 'dotlrn_professor_profile_provider' ); -- drop the bindings to the method implementations -- name method perform acs_sc_impl_alias__delete( - ''profile_provider'', - ''dotlrn_professor_profile_provider'', - ''name'' + 'profile_provider', + 'dotlrn_professor_profile_provider', + 'name' ); -- prettyName method perform acs_sc_impl_alias__delete( - ''profile_provider'', - ''dotlrn_professor_profile_provider'', - ''prettyName'' + 'profile_provider', + 'dotlrn_professor_profile_provider', + 'prettyName' ); -- render method perform acs_sc_impl_alias__delete( - ''profile_provider'', - ''dotlrn_professor_profile_provider'', - ''render'' + 'profile_provider', + 'dotlrn_professor_profile_provider', + 'render' ); -- drop the implementation perform acs_sc_impl__delete( - ''profile_provider'', - ''dotlrn_professor_profile_provider'' + 'profile_provider', + 'dotlrn_professor_profile_provider' ); return 0; -end; -' language 'plpgsql'; +END; +$$ LANGUAGE plpgsql; + select inline_0(); drop function inline_0(); Index: openacs-4/packages/dotlrn/sql/postgresql/professors-init.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/sql/postgresql/professors-init.sql,v diff -u -r1.5 -r1.6 --- openacs-4/packages/dotlrn/sql/postgresql/professors-init.sql 8 Aug 2006 21:26:22 -0000 1.5 +++ openacs-4/packages/dotlrn/sql/postgresql/professors-init.sql 1 Nov 2013 21:08:29 -0000 1.6 @@ -22,28 +22,34 @@ -- -create function inline_1() -returns integer as ' -declare + + +-- +-- procedure inline_1/0 +-- +CREATE OR REPLACE FUNCTION inline_1( + +) RETURNS integer AS $$ +DECLARE foo integer; gid integer; sid integer; dotlrn_users_group_id integer; -begin +BEGIN PERFORM acs_rel_type__create_type( - ''dotlrn_professor_profile_rel'', - ''dotLRN Professor Profile Professor'', - ''dotLRN Professor Profile Professors'', - ''dotlrn_user_profile_rel'', - ''dotlrn_professor_profile_rels'', - ''rel_id'', - ''dotlrn_professor_profile_rel'', - ''profiled_group'', + 'dotlrn_professor_profile_rel', + 'dotLRN Professor Profile Professor', + 'dotLRN Professor Profile Professors', + 'dotlrn_user_profile_rel', + 'dotlrn_professor_profile_rels', + 'rel_id', + 'dotlrn_professor_profile_rel', + 'profiled_group', null, 0, null, - ''user'', + 'user', null, 0, 1 @@ -52,29 +58,29 @@ select min(impl_id) into foo from acs_sc_impls - where impl_name = ''dotlrn_professor_profile_provider''; + where impl_name = 'dotlrn_professor_profile_provider'; gid := profiled_group__new( foo, - ''dotLRN Professors'' + 'dotLRN Professors' ); sid := rel_segment__new( - ''dotLRN Professors'', + 'dotLRN Professors', gid, - ''dotlrn_professor_profile_rel'' + 'dotlrn_professor_profile_rel' ); insert into dotlrn_user_types (type, pretty_name, rel_type, group_id, segment_id) values - (''professor'', ''#dotlrn.instructor_role_pretty_name#'', ''dotlrn_professor_profile_rel'', gid, sid); + ('professor', '#dotlrn.instructor_role_pretty_name#', 'dotlrn_professor_profile_rel', gid, sid); select group_id into dotlrn_users_group_id from groups - where group_name = ''dotLRN Users''; + where group_name = 'dotLRN Users'; foo := composition_rel__new( dotlrn_users_group_id, @@ -83,9 +89,10 @@ return 0; -end; -' language 'plpgsql'; +END; +$$ LANGUAGE plpgsql; + select inline_1(); drop function inline_1(); Index: openacs-4/packages/dotlrn/sql/postgresql/professors-package-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/sql/postgresql/professors-package-create.sql,v diff -u -r1.4 -r1.5 --- openacs-4/packages/dotlrn/sql/postgresql/professors-package-create.sql 8 Aug 2006 21:26:22 -0000 1.4 +++ openacs-4/packages/dotlrn/sql/postgresql/professors-package-create.sql 1 Nov 2013 21:08:29 -0000 1.5 @@ -26,18 +26,24 @@ select define_function_args ('dotlrn_professor_profile_rel__delete','rel_id'); -create function dotlrn_professor_profile_rel__new(integer,integer,integer,integer,varchar,varchar,integer,integer,varchar) -returns integer as ' + + +-- +-- procedure dotlrn_professor_profile_rel__new/9 +-- +CREATE OR REPLACE FUNCTION dotlrn_professor_profile_rel__new( + p_rel_id integer, + p_user_id integer, + p_portal_id integer, + p_theme_id integer, + p_id varchar, + p_rel_type varchar, -- default 'dotlrn_professor_profile_rel' + p_group_id integer, + p_creation_user integer, + p_creation_ip varchar + +) RETURNS integer AS $$ DECLARE - p_rel_id alias for $1; - p_user_id alias for $2; - p_portal_id alias for $3; - p_theme_id alias for $4; - p_id alias for $5; - p_rel_type alias for $6; - p_group_id alias for $7; - p_creation_user alias for $8; - p_creation_ip alias for $9; v_rel_id dotlrn_user_profile_rels.rel_id%TYPE; v_group_id groups.group_id%TYPE; BEGIN @@ -47,7 +53,7 @@ from profiled_groups where profile_provider = (select min(impl_id) from acs_sc_impls - where impl_name = ''dotlrn_professor_profile_provider''); + where impl_name = 'dotlrn_professor_profile_provider'); else v_group_id := p_group_id; end if; @@ -72,13 +78,19 @@ return v_rel_id; END; -' language 'plpgsql'; +$$ LANGUAGE plpgsql; -create function dotlrn_professor_profile_rel__delete(integer) -returns integer as ' + + + +-- +-- procedure dotlrn_professor_profile_rel__delete/1 +-- +CREATE OR REPLACE FUNCTION dotlrn_professor_profile_rel__delete( + p_rel_id integer +) RETURNS integer AS $$ DECLARE - p_rel_id alias for $1; BEGIN delete from dotlrn_professor_profile_rels @@ -87,6 +99,7 @@ PERFORM dotlrn_user_profile_rel__delete(p_rel_id); return (0); END; -' language 'plpgsql'; +$$ LANGUAGE plpgsql; + Index: openacs-4/packages/dotlrn/sql/postgresql/professors-sanitize.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/sql/postgresql/professors-sanitize.sql,v diff -u -r1.3 -r1.4 --- openacs-4/packages/dotlrn/sql/postgresql/professors-sanitize.sql 8 Aug 2006 21:26:22 -0000 1.3 +++ openacs-4/packages/dotlrn/sql/postgresql/professors-sanitize.sql 1 Nov 2013 21:08:29 -0000 1.4 @@ -22,43 +22,56 @@ -- @version $Id$ -- -create function inline_0() -returns integer as ' -declare + + +-- +-- procedure inline_0/0 +-- +CREATE OR REPLACE FUNCTION inline_0( + +) RETURNS integer AS $$ +DECLARE foo integer; -begin +BEGIN select min(segment_id) into foo from rel_segments - where segment_name = ''dotLRN Full Profiled Professors''; + where segment_name = 'dotLRN Full Profiled Professors'; perform rel_segment__delete( foo ); perform acs_rel_type__drop_type( - ''dotlrn_full_professor_profile_rel'', - ''t'' + 'dotlrn_full_professor_profile_rel', + 't' ); return 0; -end; -' language 'plpgsql'; +END; + +$$ LANGUAGE plpgsql; select inline_0(); drop function inline_0(); -create function inline_1() -returns integer as ' -declare + + +-- +-- procedure inline_1/0 +-- +CREATE OR REPLACE FUNCTION inline_1( + +) RETURNS integer AS $$ +DECLARE foo integer; -begin +BEGIN select min(segment_id) into foo from rel_segments - where segment_name = ''dotLRN Profiled Professors''; + where segment_name = 'dotLRN Profiled Professors'; perform rel_segment__delete( foo @@ -69,7 +82,7 @@ from profiled_groups where profile_provider = (select min(impl_id) from acs_sc_impls - where impl_name = ''dotlrn_professor_profile_provider''); + where impl_name = 'dotlrn_professor_profile_provider'); delete from dotlrn_user_types @@ -80,12 +93,13 @@ ); perform acs_rel_type__drop_type( - ''dotlrn_professor_profile_rel'', - ''t'' + 'dotlrn_professor_profile_rel', + 't' ); return 0; -end; -' language 'plpgsql'; +END; + +$$ LANGUAGE plpgsql; select inline_1(); drop function inline_1(); Index: openacs-4/packages/dotlrn/sql/postgresql/security-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/sql/postgresql/security-create.sql,v diff -u -r1.6 -r1.7 --- openacs-4/packages/dotlrn/sql/postgresql/security-create.sql 8 Aug 2006 21:26:22 -0000 1.6 +++ openacs-4/packages/dotlrn/sql/postgresql/security-create.sql 1 Nov 2013 21:08:29 -0000 1.7 @@ -28,56 +28,56 @@ -- Security Setup for dotLRN -- privileges, privilege inheritance -- -create function inline0() -returns integer as ' -begin +CREATE OR REPLACE FUNCTION inline0() RETURNS integer AS $$ +BEGIN -- the ability to browse dotLRN in general - perform acs_privilege__create_privilege(''dotlrn_browse''); + perform acs_privilege__create_privilege('dotlrn_browse'); -- the ability to even view that a community exists - perform acs_privilege__create_privilege(''dotlrn_view_community''); + perform acs_privilege__create_privilege('dotlrn_view_community'); -- the ability to participate in a community - perform acs_privilege__create_privilege(''dotlrn_edit_community''); + perform acs_privilege__create_privilege('dotlrn_edit_community'); -- the ability to admin a community - perform acs_privilege__create_privilege(''dotlrn_admin_community''); + perform acs_privilege__create_privilege('dotlrn_admin_community'); -- the ability to create a community - perform acs_privilege__create_privilege(''dotlrn_create_community''); + perform acs_privilege__create_privilege('dotlrn_create_community'); -- the ability to even view a community type - perform acs_privilege__create_privilege(''dotlrn_view_community_type''); + perform acs_privilege__create_privilege('dotlrn_view_community_type'); -- the ability to admin a community type - perform acs_privilege__create_privilege(''dotlrn_admin_community_type''); + perform acs_privilege__create_privilege('dotlrn_admin_community_type'); -- the ability to create a community type - perform acs_privilege__create_privilege(''dotlrn_create_community_type''); + perform acs_privilege__create_privilege('dotlrn_create_community_type'); -- the ability to spam a community - perform acs_privilege__create_privilege(''dotlrn_spam_community''); + perform acs_privilege__create_privilege('dotlrn_spam_community'); -- Consistent permissions - perform acs_privilege__add_child(''dotlrn_edit_community'', ''dotlrn_view_community''); - perform acs_privilege__add_child(''dotlrn_admin_community'', ''dotlrn_edit_community''); - perform acs_privilege__add_child(''dotlrn_admin_community'', ''dotlrn_spam_community''); + perform acs_privilege__add_child('dotlrn_edit_community', 'dotlrn_view_community'); + perform acs_privilege__add_child('dotlrn_admin_community', 'dotlrn_edit_community'); + perform acs_privilege__add_child('dotlrn_admin_community', 'dotlrn_spam_community'); -- inheritance - perform acs_privilege__add_child(''create'', ''dotlrn_create_community_type''); - perform acs_privilege__add_child(''create'', ''dotlrn_create_community''); - perform acs_privilege__add_child(''write'', ''dotlrn_edit_community''); - perform acs_privilege__add_child(''read'', ''dotlrn_view_community''); - perform acs_privilege__add_child(''read'', ''dotlrn_view_community_type''); - perform acs_privilege__add_child(''admin'', ''dotlrn_admin_community''); - perform acs_privilege__add_child(''admin'', ''dotlrn_admin_community_type''); + perform acs_privilege__add_child('create', 'dotlrn_create_community_type'); + perform acs_privilege__add_child('create', 'dotlrn_create_community'); + perform acs_privilege__add_child('write', 'dotlrn_edit_community'); + perform acs_privilege__add_child('read', 'dotlrn_view_community'); + perform acs_privilege__add_child('read', 'dotlrn_view_community_type'); + perform acs_privilege__add_child('admin', 'dotlrn_admin_community'); + perform acs_privilege__add_child('admin', 'dotlrn_admin_community_type'); -- for now, we only want admins to be able to browse by default - perform acs_privilege__add_child(''admin'', ''dotlrn_browse''); + perform acs_privilege__add_child('admin', 'dotlrn_browse'); -- no default permissions return 0; -end;' language 'plpgsql'; +END; +$$ LANGUAGE plpgsql; select inline0(); drop function inline0(); Index: openacs-4/packages/dotlrn/sql/postgresql/security-drop.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/sql/postgresql/security-drop.sql,v diff -u -r1.4 -r1.5 --- openacs-4/packages/dotlrn/sql/postgresql/security-drop.sql 8 Aug 2006 21:26:22 -0000 1.4 +++ openacs-4/packages/dotlrn/sql/postgresql/security-drop.sql 1 Nov 2013 21:08:29 -0000 1.5 @@ -24,47 +24,47 @@ -- @version $Id$ -- -create function inline0() -returns integer as ' -begin +CREATE OR REPLACE FUNCTION inline0() RETURNS integer AS $$ +BEGIN - perform acs_privilege__remove_child(''admin'', ''dotlrn_admin_community''); - perform acs_privilege__remove_child(''admin'', ''dotlrn_admin_community_type''); - perform acs_privilege__remove_child(''admin'', ''dotlrn_browse''); - perform acs_privilege__remove_child(''create'', ''dotlrn_create_community''); - perform acs_privilege__remove_child(''create'', ''dotlrn_create_community_type''); - perform acs_privilege__remove_child(''read'', ''dotlrn_view_community''); - perform acs_privilege__remove_child(''read'', ''dotlrn_view_community_type''); - perform acs_privilege__remove_child(''write'', ''dotlrn_edit_community''); + perform acs_privilege__remove_child('admin', 'dotlrn_admin_community'); + perform acs_privilege__remove_child('admin', 'dotlrn_admin_community_type'); + perform acs_privilege__remove_child('admin', 'dotlrn_browse'); + perform acs_privilege__remove_child('create', 'dotlrn_create_community'); + perform acs_privilege__remove_child('create', 'dotlrn_create_community_type'); + perform acs_privilege__remove_child('read', 'dotlrn_view_community'); + perform acs_privilege__remove_child('read', 'dotlrn_view_community_type'); + perform acs_privilege__remove_child('write', 'dotlrn_edit_community'); - perform acs_privilege__remove_child(''dotlrn_edit_community'', ''dotlrn_view_community''); - perform acs_privilege__remove_child(''dotlrn_admin_community'', ''dotlrn_edit_community''); - perform acs_privilege__remove_child(''dotlrn_admin_community'', ''dotlrn_spam_community''); + perform acs_privilege__remove_child('dotlrn_edit_community', 'dotlrn_view_community'); + perform acs_privilege__remove_child('dotlrn_admin_community', 'dotlrn_edit_community'); + perform acs_privilege__remove_child('dotlrn_admin_community', 'dotlrn_spam_community'); delete from acs_permissions - where privilege in (''dotlrn_admin_community'', - ''dotlrn_admin_community_type'', - ''dotlrn_browse'', - ''dotlrn_create_community'', - ''dotlrn_create_community_type'', - ''dotlrn_edit_community'', - ''dotlrn_view_community'', - ''dotlrn_view_community_type''); + where privilege in ('dotlrn_admin_community', + 'dotlrn_admin_community_type', + 'dotlrn_browse', + 'dotlrn_create_community', + 'dotlrn_create_community_type', + 'dotlrn_edit_community', + 'dotlrn_view_community', + 'dotlrn_view_community_type'); - perform acs_privilege__drop_privilege(''dotlrn_admin_community''); - perform acs_privilege__drop_privilege(''dotlrn_admin_community_type''); - perform acs_privilege__drop_privilege(''dotlrn_browse''); - perform acs_privilege__drop_privilege(''dotlrn_create_community''); - perform acs_privilege__drop_privilege(''dotlrn_create_community_type''); - perform acs_privilege__drop_privilege(''dotlrn_edit_community''); - perform acs_privilege__drop_privilege(''dotlrn_view_community''); - perform acs_privilege__drop_privilege(''dotlrn_view_community_type''); - perform acs_privilege__drop_privilege(''dotlrn_spam_community''); + perform acs_privilege__drop_privilege('dotlrn_admin_community'); + perform acs_privilege__drop_privilege('dotlrn_admin_community_type'); + perform acs_privilege__drop_privilege('dotlrn_browse'); + perform acs_privilege__drop_privilege('dotlrn_create_community'); + perform acs_privilege__drop_privilege('dotlrn_create_community_type'); + perform acs_privilege__drop_privilege('dotlrn_edit_community'); + perform acs_privilege__drop_privilege('dotlrn_view_community'); + perform acs_privilege__drop_privilege('dotlrn_view_community_type'); + perform acs_privilege__drop_privilege('dotlrn_spam_community'); return 0; -end;' language 'plpgsql'; +END; +$$ LANGUAGE plpgsql; select inline0(); drop function inline0(); Index: openacs-4/packages/dotlrn/sql/postgresql/site-templates-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/sql/postgresql/site-templates-create.sql,v diff -u -r1.3 -r1.4 --- openacs-4/packages/dotlrn/sql/postgresql/site-templates-create.sql 8 Nov 2010 13:17:44 -0000 1.3 +++ openacs-4/packages/dotlrn/sql/postgresql/site-templates-create.sql 1 Nov 2013 21:08:29 -0000 1.4 @@ -63,30 +63,37 @@ -- and users.user_id = persons.person_id; ---Creating default site tempaltes +--Creating default site templates -create function inline_0() -returns integer as ' -declare + + +-- +-- procedure inline_0/0 +-- +CREATE OR REPLACE FUNCTION inline_0( + +) RETURNS integer AS $$ +DECLARE v_site_template_id dotlrn_site_templates.site_template_id%TYPE; v_theme_id portal_element_themes.theme_id%TYPE; -begin +BEGIN select theme_id into v_theme_id from portal_element_themes - where name = ''#new-portal.sloan_theme_name#''; + where name = '#new-portal.sloan_theme_name#'; - select nextval(''t_acs_object_id_seq'') + select nextval('t_acs_object_id_seq') into v_site_template_id from dual; insert into dotlrn_site_templates (site_template_id, pretty_name, site_master, portal_theme_id ) values - (v_site_template_id, ''#new-portal.sloan_theme_name#'',''/packages/dotlrn/www/dotlrn-master'', v_theme_id); + (v_site_template_id, '#new-portal.sloan_theme_name#','/packages/dotlrn/www/dotlrn-master', v_theme_id); return v_site_template_id; -end;' language 'plpgsql'; +END; +$$ LANGUAGE plpgsql; select inline_0(); Index: openacs-4/packages/dotlrn/sql/postgresql/student-profile-provider-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/sql/postgresql/student-profile-provider-create.sql,v diff -u -r1.3 -r1.4 --- openacs-4/packages/dotlrn/sql/postgresql/student-profile-provider-create.sql 8 Aug 2006 21:26:22 -0000 1.3 +++ openacs-4/packages/dotlrn/sql/postgresql/student-profile-provider-create.sql 1 Nov 2013 21:08:29 -0000 1.4 @@ -22,55 +22,55 @@ -- @version $Id$ -- -create function inline_0() -returns integer as ' -begin +CREATE OR REPLACE FUNCTION inline_0() RETURNS integer AS $$ +BEGIN -- create the implementation perform acs_sc_impl__new( - ''profile_provider'', - ''dotlrn_student_profile_provider'', - ''dotlrn_student_profile_provider'' + 'profile_provider', + 'dotlrn_student_profile_provider', + 'dotlrn_student_profile_provider' ); -- add the bindings to the method implementations -- name method perform acs_sc_impl_alias__new( - ''profile_provider'', - ''dotlrn_student_profile_provider'', - ''name'', - ''dotlrn_student_profile_provider::name'', - ''TCL'' + 'profile_provider', + 'dotlrn_student_profile_provider', + 'name', + 'dotlrn_student_profile_provider::name', + 'TCL' ); -- prettyName method perform acs_sc_impl_alias__new( - ''profile_provider'', - ''dotlrn_student_profile_provider'', - ''prettyName'', - ''dotlrn_student_profile_provider::prettyName'', - ''TCL'' + 'profile_provider', + 'dotlrn_student_profile_provider', + 'prettyName', + 'dotlrn_student_profile_provider::prettyName', + 'TCL' ); -- render method perform acs_sc_impl_alias__new( - ''profile_provider'', - ''dotlrn_student_profile_provider'', - ''render'', - ''dotlrn_student_profile_provider::render'', - ''TCL'' + 'profile_provider', + 'dotlrn_student_profile_provider', + 'render', + 'dotlrn_student_profile_provider::render', + 'TCL' ); -- bind this implementation to the interface it implements perform acs_sc_binding__new( - ''profile_provider'', - ''dotlrn_student_profile_provider'' + 'profile_provider', + 'dotlrn_student_profile_provider' ); return 0; -end;' language 'plpgsql'; +END; +$$ LANGUAGE plpgsql; select inline_0(); drop function inline_0(); Index: openacs-4/packages/dotlrn/sql/postgresql/student-profile-provider-drop.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/sql/postgresql/student-profile-provider-drop.sql,v diff -u -r1.3 -r1.4 --- openacs-4/packages/dotlrn/sql/postgresql/student-profile-provider-drop.sql 8 Aug 2006 21:26:22 -0000 1.3 +++ openacs-4/packages/dotlrn/sql/postgresql/student-profile-provider-drop.sql 1 Nov 2013 21:08:29 -0000 1.4 @@ -22,50 +22,57 @@ -- @version $Id$ -- -create function inline_0() -returns integer as ' -declare + + +-- +-- procedure inline_0/0 +-- +CREATE OR REPLACE FUNCTION inline_0( + +) RETURNS integer AS $$ +DECLARE foo integer; -begin +BEGIN -- drop the binding between this implementation and the interface it -- implements__ perform acs_sc_binding__delete( - ''profile_provider'', - ''dotlrn_student_profile_provider'' + 'profile_provider', + 'dotlrn_student_profile_provider' ); -- drop the bindings to the method implementations -- name method perform acs_sc_impl_alias__delete( - ''profile_provider'', - ''dotlrn_student_profile_provider'', - ''name'' + 'profile_provider', + 'dotlrn_student_profile_provider', + 'name' ); -- prettyName method perform acs_sc_impl_alias__delete( - ''profile_provider'', - ''dotlrn_student_profile_provider'', - ''prettyName'' + 'profile_provider', + 'dotlrn_student_profile_provider', + 'prettyName' ); -- render method perform acs_sc_impl_alias__delete( - ''profile_provider'', - ''dotlrn_student_profile_provider'', - ''render'' + 'profile_provider', + 'dotlrn_student_profile_provider', + 'render' ); -- drop the implementation perform acs_sc_impl__delete( - ''profile_provider'', - ''dotlrn_student_profile_provider'' + 'profile_provider', + 'dotlrn_student_profile_provider' ); return 0; -end;' language 'plpgsql'; +END; +$$ LANGUAGE plpgsql; select inline_0(); drop function inline_0(); Index: openacs-4/packages/dotlrn/sql/postgresql/students-init.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/sql/postgresql/students-init.sql,v diff -u -r1.5 -r1.6 --- openacs-4/packages/dotlrn/sql/postgresql/students-init.sql 8 Aug 2006 21:26:22 -0000 1.5 +++ openacs-4/packages/dotlrn/sql/postgresql/students-init.sql 1 Nov 2013 21:08:29 -0000 1.6 @@ -22,28 +22,34 @@ -- -create function inline_1() -returns integer as ' -declare + + +-- +-- procedure inline_1/0 +-- +CREATE OR REPLACE FUNCTION inline_1( + +) RETURNS integer AS $$ +DECLARE foo integer; gid integer; sid integer; dotlrn_users_group_id integer; -begin +BEGIN PERFORM acs_rel_type__create_type( - ''dotlrn_student_profile_rel'', - ''dotLRN Profile Student'', - ''dotLRN Profile Students'', - ''dotlrn_user_profile_rel'', - ''dotlrn_student_profile_rels'', - ''rel_id'', - ''dotlrn_student_profile_rel'', - ''profiled_group'', + 'dotlrn_student_profile_rel', + 'dotLRN Profile Student', + 'dotLRN Profile Students', + 'dotlrn_user_profile_rel', + 'dotlrn_student_profile_rels', + 'rel_id', + 'dotlrn_student_profile_rel', + 'profiled_group', null, 0, null, - ''user'', + 'user', null, 0, 1 @@ -52,29 +58,29 @@ select min(impl_id) into foo from acs_sc_impls - where impl_name = ''dotlrn_student_profile_provider''; + where impl_name = 'dotlrn_student_profile_provider'; gid := profiled_group__new( foo, - ''dotLRN Students'' + 'dotLRN Students' ); sid := rel_segment__new( - ''dotLRN Students'', + 'dotLRN Students', gid, - ''dotlrn_student_profile_rel'' + 'dotlrn_student_profile_rel' ); insert into dotlrn_user_types (type, pretty_name, rel_type, group_id, segment_id) values - (''student'', ''#dotlrn.student_role_pretty_name#'', ''dotlrn_student_profile_rel'', gid, sid); + ('student', '#dotlrn.student_role_pretty_name#', 'dotlrn_student_profile_rel', gid, sid); select group_id into dotlrn_users_group_id from groups - where group_name = ''dotLRN Users''; + where group_name = 'dotLRN Users'; foo := composition_rel__new( dotlrn_users_group_id, @@ -83,9 +89,10 @@ return 0; -end; -' language 'plpgsql'; +END; +$$ LANGUAGE plpgsql; + select inline_1(); drop function inline_1(); Index: openacs-4/packages/dotlrn/sql/postgresql/students-package-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/sql/postgresql/students-package-create.sql,v diff -u -r1.4 -r1.5 --- openacs-4/packages/dotlrn/sql/postgresql/students-package-create.sql 8 Aug 2006 21:26:22 -0000 1.4 +++ openacs-4/packages/dotlrn/sql/postgresql/students-package-create.sql 1 Nov 2013 21:08:29 -0000 1.5 @@ -26,18 +26,24 @@ select define_function_args ('dotlrn_student_profile_rel__delete','rel_id'); -create function dotlrn_student_profile_rel__new(integer,integer,integer,integer,varchar,varchar,integer,integer,varchar) -returns integer as ' + + +-- +-- procedure dotlrn_student_profile_rel__new/9 +-- +CREATE OR REPLACE FUNCTION dotlrn_student_profile_rel__new( + p_rel_id integer, + p_user_id integer, + p_portal_id integer, + p_theme_id integer, + p_id varchar, + p_rel_type varchar, -- default 'dotlrn_student_profile_rel' + p_group_id integer, + p_creation_user integer, + p_creation_ip varchar + +) RETURNS integer AS $$ DECLARE - p_rel_id alias for $1; - p_user_id alias for $2; - p_portal_id alias for $3; - p_theme_id alias for $4; - p_id alias for $5; - p_rel_type alias for $6; - p_group_id alias for $7; - p_creation_user alias for $8; - p_creation_ip alias for $9; v_rel_id dotlrn_user_profile_rels.rel_id%TYPE; v_group_id groups.group_id%TYPE; BEGIN @@ -47,7 +53,7 @@ from profiled_groups where profile_provider = (select min(impl_id) from acs_sc_impls - where impl_name = ''dotlrn_student_profile_provider''); + where impl_name = 'dotlrn_student_profile_provider'); else v_group_id := p_group_id; end if; @@ -81,13 +87,19 @@ return v_rel_id; END; -' language 'plpgsql'; +$$ LANGUAGE plpgsql; -create function dotlrn_student_profile_rel__delete(integer) -returns integer as ' + + + +-- +-- procedure dotlrn_student_profile_rel__delete/1 +-- +CREATE OR REPLACE FUNCTION dotlrn_student_profile_rel__delete( + p_rel_id integer +) RETURNS integer AS $$ DECLARE - p_rel_id alias for $1; BEGIN delete from dotlrn_student_profile_rels @@ -96,6 +108,7 @@ PERFORM dotlrn_user_profile_rel__delete(p_rel_id); return (0); END; -' language 'plpgsql'; +$$ LANGUAGE plpgsql; + Index: openacs-4/packages/dotlrn/sql/postgresql/students-sanitize.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/sql/postgresql/students-sanitize.sql,v diff -u -r1.3 -r1.4 --- openacs-4/packages/dotlrn/sql/postgresql/students-sanitize.sql 8 Aug 2006 21:26:22 -0000 1.3 +++ openacs-4/packages/dotlrn/sql/postgresql/students-sanitize.sql 1 Nov 2013 21:08:29 -0000 1.4 @@ -22,43 +22,56 @@ -- @version $Id$ -- -create function inline_0() -returns integer as ' -declare + + +-- +-- procedure inline_0/0 +-- +CREATE OR REPLACE FUNCTION inline_0( + +) RETURNS integer AS $$ +DECLARE foo integer; -begin +BEGIN select min(segment_id) into foo from rel_segments - where segment_name = ''dotLRN Full Profiled Students''; + where segment_name = 'dotLRN Full Profiled Students'; perform rel_segment__delete( foo ); perform acs_rel_type__drop_type( - ''dotlrn_full_student_profile_rel'', - ''t'' + 'dotlrn_full_student_profile_rel', + 't' ); return 0; -end; -' language 'plpgsql'; +END; +$$ LANGUAGE plpgsql; + select inline_0(); drop function inline_0(); -create function inline_1() -returns integer as ' -declare + + +-- +-- procedure inline_1/0 +-- +CREATE OR REPLACE FUNCTION inline_1( + +) RETURNS integer AS $$ +DECLARE foo integer; -begin +BEGIN select min(segment_id) into foo from rel_segments - where segment_name = ''dotLRN Profiled Students''; + where segment_name = 'dotLRN Profiled Students'; perform rel_segment__delete( foo @@ -69,7 +82,7 @@ from profiled_groups where profile_provider = (select min(impl_id) from acs_sc_impls - where impl_name = ''dotlrn_student_profile_provider''); + where impl_name = 'dotlrn_student_profile_provider'); delete from dotlrn_user_types @@ -80,13 +93,14 @@ ); perform acs_rel_type__drop_type( - ''dotlrn_student_profile_rel'', - ''t'' + 'dotlrn_student_profile_rel', + 't' ); return 0; -end; -' language 'plpgsql'; +END; +$$ LANGUAGE plpgsql; + select inline_1(); drop function inline_1(); Index: openacs-4/packages/dotlrn/sql/postgresql/user-extension-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/sql/postgresql/user-extension-create.sql,v diff -u -r1.3 -r1.4 --- openacs-4/packages/dotlrn/sql/postgresql/user-extension-create.sql 8 Aug 2006 21:26:22 -0000 1.3 +++ openacs-4/packages/dotlrn/sql/postgresql/user-extension-create.sql 1 Nov 2013 21:08:29 -0000 1.4 @@ -24,71 +24,71 @@ -- 01/22/2002 -- -create function inline_0() -returns integer as ' -begin +CREATE OR REPLACE FUNCTION inline_0() RETURNS integer AS $$ +BEGIN -- create the implementation perform acs_sc_impl__new ( - ''UserData'', - ''dotlrn_user_extension'', - ''dotlrn_user_extension'' + 'UserData', + 'dotlrn_user_extension', + 'dotlrn_user_extension' ); -- add all the hooks -- UserNew perform acs_sc_impl_alias__new ( - ''UserData'', - ''dotlrn_user_extension'', - ''UserNew'', - ''dotlrn_user_extension::user_new'', - ''TCL'' + 'UserData', + 'dotlrn_user_extension', + 'UserNew', + 'dotlrn_user_extension::user_new', + 'TCL' ); -- UserNew perform acs_sc_impl_alias__new ( - ''UserData'', - ''dotlrn_user_extension'', - ''UserApprove'', - ''dotlrn_user_extension::user_approve'', - ''TCL'' + 'UserData', + 'dotlrn_user_extension', + 'UserApprove', + 'dotlrn_user_extension::user_approve', + 'TCL' ); -- UserNew perform acs_sc_impl_alias__new ( - ''UserData'', - ''dotlrn_user_extension'', - ''UserDeapprove'', - ''dotlrn_user_extension::user_deapprove'', - ''TCL'' + 'UserData', + 'dotlrn_user_extension', + 'UserDeapprove', + 'dotlrn_user_extension::user_deapprove', + 'TCL' ); -- UserNew perform acs_sc_impl_alias__new ( - ''UserData'', - ''dotlrn_user_extension'', - ''UserModify'', - ''dotlrn_user_extension::user_modify'', - ''TCL'' + 'UserData', + 'dotlrn_user_extension', + 'UserModify', + 'dotlrn_user_extension::user_modify', + 'TCL' ); -- UserNew perform acs_sc_impl_alias__new ( - ''UserData'', - ''dotlrn_user_extension'', - ''UserDelete'', - ''dotlrn_user_extension::user_delete'', - ''TCL'' + 'UserData', + 'dotlrn_user_extension', + 'UserDelete', + 'dotlrn_user_extension::user_delete', + 'TCL' ); -- Add the binding perform acs_sc_binding__new ( - ''UserData'', - ''dotlrn_user_extension'' + 'UserData', + 'dotlrn_user_extension' ); return 0; -end;' language 'plpgsql'; +END; +$$ LANGUAGE plpgsql; select inline_0(); drop function inline_0(); Index: openacs-4/packages/dotlrn/sql/postgresql/user-extension-drop.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/sql/postgresql/user-extension-drop.sql,v diff -u -r1.3 -r1.4 --- openacs-4/packages/dotlrn/sql/postgresql/user-extension-drop.sql 8 Aug 2006 21:26:22 -0000 1.3 +++ openacs-4/packages/dotlrn/sql/postgresql/user-extension-drop.sql 1 Nov 2013 21:08:29 -0000 1.4 @@ -24,54 +24,54 @@ -- -- -create function inline_0() -returns integer as ' -begin +CREATE OR REPLACE FUNCTION inline_0() RETURNS integer AS $$ +BEGIN perform acs_sc_binding__delete ( - ''UserData'', - ''dotlrn_user_extension'' + 'UserData', + 'dotlrn_user_extension' ); perform acs_sc_impl_alias__delete ( - ''UserData'', - ''dotlrn_user_extension'', - ''UserNew'' + 'UserData', + 'dotlrn_user_extension', + 'UserNew' ); perform acs_sc_impl_alias__delete ( - ''UserData'', - ''dotlrn_user_extension'', - ''UserApprove'' + 'UserData', + 'dotlrn_user_extension', + 'UserApprove' ); perform acs_sc_impl_alias__delete ( - ''UserData'', - ''dotlrn_user_extension'', - ''UserDeapprove'' + 'UserData', + 'dotlrn_user_extension', + 'UserDeapprove' ); perform acs_sc_impl_alias__delete ( - ''UserData'', - ''dotlrn_user_extension'', - ''UserModify'' + 'UserData', + 'dotlrn_user_extension', + 'UserModify' ); perform acs_sc_impl_alias__delete ( - ''UserData'', - ''dotlrn_user_extension'', - ''UserDelete'' + 'UserData', + 'dotlrn_user_extension', + 'UserDelete' ); -- create the implementation perform acs_sc_impl__delete( - ''UserData'', - ''dotlrn_user_extension'' + 'UserData', + 'dotlrn_user_extension' ); return 0; -end;' language 'plpgsql'; +END; +$$ LANGUAGE plpgsql; select inline_0(); drop function inline_0(); Index: openacs-4/packages/dotlrn/sql/postgresql/user-profile-provider-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/sql/postgresql/user-profile-provider-create.sql,v diff -u -r1.3 -r1.4 --- openacs-4/packages/dotlrn/sql/postgresql/user-profile-provider-create.sql 8 Aug 2006 21:26:22 -0000 1.3 +++ openacs-4/packages/dotlrn/sql/postgresql/user-profile-provider-create.sql 1 Nov 2013 21:08:29 -0000 1.4 @@ -20,55 +20,55 @@ -- @author yon@openforce.net -- @version $Id$ -- -create function inline_0() -returns integer as ' -begin +CREATE OR REPLACE FUNCTION inline_0() RETURNS integer AS $$ +BEGIN -- create the implementation perform acs_sc_impl__new( - ''profile_provider'', - ''dotlrn_user_profile_provider'', - ''dotlrn_user_profile_provider'' + 'profile_provider', + 'dotlrn_user_profile_provider', + 'dotlrn_user_profile_provider' ); -- add the bindings to the method implementations -- name method perform acs_sc_impl_alias__new( - ''profile_provider'', - ''dotlrn_user_profile_provider'', - ''name'', - ''dotlrn_user_profile_provider::name'', - ''TCL'' + 'profile_provider', + 'dotlrn_user_profile_provider', + 'name', + 'dotlrn_user_profile_provider::name', + 'TCL' ); -- prettyName method perform acs_sc_impl_alias__new( - ''profile_provider'', - ''dotlrn_user_profile_provider'', - ''prettyName'', - ''dotlrn_user_profile_provider::prettyName'', - ''TCL'' + 'profile_provider', + 'dotlrn_user_profile_provider', + 'prettyName', + 'dotlrn_user_profile_provider::prettyName', + 'TCL' ); -- render method perform acs_sc_impl_alias__new( - ''profile_provider'', - ''dotlrn_user_profile_provider'', - ''render'', - ''dotlrn_user_profile_provider::render'', - ''TCL'' + 'profile_provider', + 'dotlrn_user_profile_provider', + 'render', + 'dotlrn_user_profile_provider::render', + 'TCL' ); -- bind this implementation to the interface it implements perform acs_sc_binding__new( - ''profile_provider'', - ''dotlrn_user_profile_provider'' + 'profile_provider', + 'dotlrn_user_profile_provider' ); return 0; -end;' language 'plpgsql'; +END; +$$ LANGUAGE plpgsql; select inline_0(); drop function inline_0(); Index: openacs-4/packages/dotlrn/sql/postgresql/user-profile-provider-drop.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/sql/postgresql/user-profile-provider-drop.sql,v diff -u -r1.3 -r1.4 --- openacs-4/packages/dotlrn/sql/postgresql/user-profile-provider-drop.sql 8 Aug 2006 21:26:22 -0000 1.3 +++ openacs-4/packages/dotlrn/sql/postgresql/user-profile-provider-drop.sql 1 Nov 2013 21:08:29 -0000 1.4 @@ -22,50 +22,57 @@ -- @version $Id$ -- -create function inline_0() -returns integer as ' -declare + + +-- +-- procedure inline_0/0 +-- +CREATE OR REPLACE FUNCTION inline_0( + +) RETURNS integer AS $$ +DECLARE foo integer; -begin +BEGIN -- drop the binding between this implementation and the interface it -- implements. perform acs_sc_binding__delete( - ''profile_provider'', - ''dotlrn_user_profile_provider'' + 'profile_provider', + 'dotlrn_user_profile_provider' ); -- drop the bindings to the method implementations -- name method perform acs_sc_impl_alias__delete( - ''profile_provider'', - ''dotlrn_user_profile_provider'', - ''name'' + 'profile_provider', + 'dotlrn_user_profile_provider', + 'name' ); -- prettyName method perform acs_sc_impl_alias__delete( - ''profile_provider'', - ''dotlrn_user_profile_provider'', - ''prettyName'' + 'profile_provider', + 'dotlrn_user_profile_provider', + 'prettyName' ); -- render method perform acs_sc_impl_alias__delete( - ''profile_provider'', - ''dotlrn_user_profile_provider'', - ''render'' + 'profile_provider', + 'dotlrn_user_profile_provider', + 'render' ); -- drop the implementation perform acs_sc_impl__delete( - ''profile_provider'', - ''dotlrn_user_profile_provider'' + 'profile_provider', + 'dotlrn_user_profile_provider' ); return 0; -END;' language 'plpgsql'; +END; +$$ LANGUAGE plpgsql; select inline_0(); drop function inline_0(); Index: openacs-4/packages/dotlrn/sql/postgresql/users-init.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/sql/postgresql/users-init.sql,v diff -u -r1.3 -r1.4 --- openacs-4/packages/dotlrn/sql/postgresql/users-init.sql 8 Aug 2006 21:26:22 -0000 1.3 +++ openacs-4/packages/dotlrn/sql/postgresql/users-init.sql 1 Nov 2013 21:08:30 -0000 1.4 @@ -21,25 +21,31 @@ -- @version $Id$ -- -create function inline_1() -returns integer as ' -declare + + +-- +-- procedure inline_1/0 +-- +CREATE OR REPLACE FUNCTION inline_1( + +) RETURNS integer AS $$ +DECLARE foo integer; -begin +BEGIN perform acs_rel_type__create_type( - ''dotlrn_user_profile_rel'', - ''dotLRN Profile User'', - ''dotLRN Profile Users'', - ''user_profile_rel'', - ''dotlrn_user_profile_rels'', - ''rel_id'', - ''dotlrn_user_profile_rel'', - ''profiled_group'', + 'dotlrn_user_profile_rel', + 'dotLRN Profile User', + 'dotLRN Profile Users', + 'user_profile_rel', + 'dotlrn_user_profile_rels', + 'rel_id', + 'dotlrn_user_profile_rel', + 'profiled_group', null, 0, null, - ''user'', + 'user', null, 0, 1 @@ -48,22 +54,23 @@ select min(impl_id) into foo from acs_sc_impls - where impl_name = ''dotlrn_user_profile_provider''; + where impl_name = 'dotlrn_user_profile_provider'; foo := profiled_group__new( foo, - ''dotLRN Users'' + 'dotLRN Users' ); foo := rel_segment__new( - ''dotLRN Users'', + 'dotLRN Users', foo, - ''dotlrn_user_profile_rel'' + 'dotlrn_user_profile_rel' ); return(0); -end; -' language 'plpgsql'; +END; +$$ LANGUAGE plpgsql; + select inline_1(); drop function inline_1(); Index: openacs-4/packages/dotlrn/sql/postgresql/users-package-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/sql/postgresql/users-package-create.sql,v diff -u -r1.4 -r1.5 --- openacs-4/packages/dotlrn/sql/postgresql/users-package-create.sql 8 Aug 2006 21:26:22 -0000 1.4 +++ openacs-4/packages/dotlrn/sql/postgresql/users-package-create.sql 1 Nov 2013 21:08:30 -0000 1.5 @@ -21,23 +21,33 @@ -- @version $Id$ -- -select define_function_args ('dotlrn_user_profile_rel__new','rel_id,id,rel_type;dotlrn_user_profile_rel,group_id,user_id,creation_user,creation_ip'); +-- old define_function_args ('dotlrn_user_profile_rel__new','rel_id,id,rel_type;dotlrn_user_profile_rel,group_id,user_id,creation_user,creation_ip') +-- new +select define_function_args('dotlrn_user_profile_rel__new','rel_id,user_id,portal_id;dotlrn_user_profile_rel,theme_id,id,rel_type,group_id,creation_user,creation_ip'); + + select define_function_args ('dotlrn_user_profile_rel__delete','rel_id'); -create function dotlrn_user_profile_rel__new(integer,integer,integer,integer,varchar,varchar,integer,integer,varchar) -returns integer as ' + + +-- +-- procedure dotlrn_user_profile_rel__new/9 +-- +CREATE OR REPLACE FUNCTION dotlrn_user_profile_rel__new( + p_rel_id integer, + p_user_id integer, + p_portal_id integer, -- default 'dotlrn_user_profile_rel' + p_theme_id integer, + p_id varchar, + p_rel_type varchar, + p_group_id integer, + p_creation_user integer, + p_creation_ip varchar + +) RETURNS integer AS $$ DECLARE - p_rel_id alias for $1; - p_user_id alias for $2; - p_portal_id alias for $3; - p_theme_id alias for $4; - p_id alias for $5; - p_rel_type alias for $6; - p_group_id alias for $7; - p_creation_user alias for $8; - p_creation_ip alias for $9; v_rel_id user_profile_rels.rel_id%TYPE; v_group_id groups.group_id%TYPE; BEGIN @@ -47,7 +57,7 @@ from profiled_groups where profile_provider = (select min(impl_id) from acs_sc_impls - where impl_name = ''dotlrn_user_profile_provider''); + where impl_name = 'dotlrn_user_profile_provider'); else v_group_id := p_group_id; end if; @@ -69,13 +79,19 @@ return v_rel_id; END; -' language 'plpgsql'; +$$ LANGUAGE plpgsql; -create function dotlrn_user_profile_rel__delete(integer) -returns integer as ' + + + +-- +-- procedure dotlrn_user_profile_rel__delete/1 +-- +CREATE OR REPLACE FUNCTION dotlrn_user_profile_rel__delete( + p_rel_id integer +) RETURNS integer AS $$ DECLARE - p_rel_id alias for $1; BEGIN delete from dotlrn_user_profile_rels @@ -84,28 +100,35 @@ PERFORM user_profile_rel__delete(p_rel_id); return (0); END; -' language 'plpgsql'; +$$ LANGUAGE plpgsql; + -- full users select define_function_args('dotlrn_full_user_profile_rel__new','rel_id,portal_id,theme_id,id,rel_type;dotlrn_full_user_profile_rel,group_id,user_id,creation_user,creation_ip'); select define_function_args('dotlrn_full_user_profile_rel__delete','rel_id'); -create function dotlrn_full_user_profile_rel__new(integer,integer,integer,varchar,varchar,integer,integer,integer,varchar) -returns integer as ' + + +-- +-- procedure dotlrn_full_user_profile_rel__new/9 +-- +CREATE OR REPLACE FUNCTION dotlrn_full_user_profile_rel__new( + p_rel_id integer, + p_portal_id integer, + p_theme_id integer, + p_id varchar, + p_rel_type varchar, -- default 'dotlrn_full_user_profile_rel' + p_group_id integer, + p_user_id integer, + p_creation_user integer, + p_creation_ip varchar + +) RETURNS integer AS $$ DECLARE - p_rel_id alias for $1; - p_portal_id alias for $2; - p_theme_id alias for $3; - p_id alias for $4; - p_rel_type alias for $5; - p_group_id alias for $6; - p_user_id alias for $7; - p_creation_user alias for $8; - p_creation_ip alias for $9; v_rel_id dotlrn_user_profile_rels.rel_id%TYPE; v_group_id groups.group_id%TYPE; BEGIN @@ -115,7 +138,7 @@ from profiled_groups where profile_provider = (select min(impl_id) from acs_sc_impls - where impl_name = ''dotlrn_user_profile_provider''); + where impl_name = 'dotlrn_user_profile_provider'); else v_group_id := p_group_id; end if; @@ -138,13 +161,19 @@ return v_rel_id; END; -' language 'plpgsql'; +$$ LANGUAGE plpgsql; -create function dotlrn_full_user_profile_rel__delete(integer) -returns integer as ' + + + +-- +-- procedure dotlrn_full_user_profile_rel__delete/1 +-- +CREATE OR REPLACE FUNCTION dotlrn_full_user_profile_rel__delete( + p_rel_id integer +) RETURNS integer AS $$ DECLARE - p_rel_id alias for $1; BEGIN delete from dotlrn_full_user_profile_rels @@ -153,4 +182,5 @@ PERFORM dotlrn_user_profile_rel__delete(p_rel_id); return (0); END; -' language 'plpgsql'; + +$$ LANGUAGE plpgsql; Index: openacs-4/packages/dotlrn/sql/postgresql/users-sanitize.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/sql/postgresql/users-sanitize.sql,v diff -u -r1.3 -r1.4 --- openacs-4/packages/dotlrn/sql/postgresql/users-sanitize.sql 8 Aug 2006 21:26:22 -0000 1.3 +++ openacs-4/packages/dotlrn/sql/postgresql/users-sanitize.sql 1 Nov 2013 21:08:30 -0000 1.4 @@ -22,30 +22,37 @@ -- @version $Id$ -- -create function inline_0() -returns integer as ' -declare + + +-- +-- procedure inline_0/0 +-- +CREATE OR REPLACE FUNCTION inline_0( + +) RETURNS integer AS $$ +DECLARE foo integer; -begin +BEGIN select min(segment_id) into foo from rel_segments - where segment_name = ''dotLRN Full Profiled Users''; + where segment_name = 'dotLRN Full Profiled Users'; perform rel_segment__delete( foo ); perform acs_rel_type__drop_type( - ''dotlrn_full_user_profile_rel'', - ''t'' + 'dotlrn_full_user_profile_rel', + 't' ); return 0; -end; -' language 'plpgsql'; +END; +$$ LANGUAGE plpgsql; + select inline_0(); drop function inline_0(); @@ -59,7 +66,7 @@ select min(segment_id) into foo from rel_segments - where segment_name = ''Profiled Users''; + where segment_name = 'Profiled Users'; perform rel_segment__delete( foo @@ -70,20 +77,21 @@ from profiled_groups where profile_provider = (select min(impl_id) from acs_sc_impls - where impl_name = ''dotlrn_user_profile_provider''); + where impl_name = 'dotlrn_user_profile_provider'); perform profiled_group__delete( foo ); perform acs_rel_type__drop_type( - ''dotlrn_user_profile_rel'', - ''t'' + 'dotlrn_user_profile_rel', + 't' ); return 0; -end; -' language 'plpgsql'; +END; +$$ LANGUAGE plpgsql; + select inline_1(); drop function inline_1(); Index: openacs-4/packages/dotlrn/sql/postgresql/upgrade/upgrade-2.0a3-2.0.2.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/sql/postgresql/upgrade/upgrade-2.0a3-2.0.2.sql,v diff -u -r1.2 -r1.3 --- openacs-4/packages/dotlrn/sql/postgresql/upgrade/upgrade-2.0a3-2.0.2.sql 20 Apr 2004 21:13:18 -0000 1.2 +++ openacs-4/packages/dotlrn/sql/postgresql/upgrade/upgrade-2.0a3-2.0.2.sql 1 Nov 2013 21:08:30 -0000 1.3 @@ -11,22 +11,28 @@ -- This function was copied in from privacy-init.sql (v1.1.2.3) but -- given an extra "if" condition. We could have put the "if" directly -- in privacy-init.sql but it doesn't really belong there. -create function inline_1() -returns integer as ' -declare + + +-- +-- procedure inline_1/0 +-- +CREATE OR REPLACE FUNCTION inline_1( + +) RETURNS integer AS $$ +DECLARE v_guest_segment_id integer; v_non_guest_segment_id integer; v_object_id integer; v_count integer; -begin +BEGIN -- - -- Only run this code if the new rel_types haven''t been created. + -- Only run this code if the new rel_types haven't been created. -- Fix for bug #1633. -- select count(*) into v_count from acs_object_types - where object_type = ''dotlrn_guest_rel''; + where object_type = 'dotlrn_guest_rel'; if v_count = 0 then @@ -35,63 +41,64 @@ -- perform acs_rel_type__create_type( - ''dotlrn_guest_rel'', - ''.LRN Guest'', - ''.LRN Guests'', - ''membership_rel'', - ''dotlrn_guest_rels'', - ''rel_id'', - ''dotlrn_guest_rel'', - ''group'', + 'dotlrn_guest_rel', + '.LRN Guest', + '.LRN Guests', + 'membership_rel', + 'dotlrn_guest_rels', + 'rel_id', + 'dotlrn_guest_rel', + 'group', null, 0, null, - ''user'', + 'user', null, 0, 1 ); v_guest_segment_id := rel_segment__new( - ''Registered .LRN Guests'', - acs__magic_object_id(''registered_users''), - ''dotlrn_guest_rel'' + 'Registered .LRN Guests', + acs__magic_object_id('registered_users'), + 'dotlrn_guest_rel' ); -- -- Non Guests -- perform acs_rel_type__create_type( - ''dotlrn_non_guest_rel'', - ''.LRN Non-Guest'', - ''.LRN Non-Guests'', - ''membership_rel'', - ''dotlrn_non_guest_rels'', - ''rel_id'', - ''dotlrn_non_guest_rel'', - ''group'', + 'dotlrn_non_guest_rel', + '.LRN Non-Guest', + '.LRN Non-Guests', + 'membership_rel', + 'dotlrn_non_guest_rels', + 'rel_id', + 'dotlrn_non_guest_rel', + 'group', null, 0, null, - ''user'', + 'user', null, 0, 1 ); v_non_guest_segment_id := rel_segment__new( - ''Registered .LRN Non-Guests'', - acs__magic_object_id(''registered_users''), - ''dotlrn_non_guest_rel'' + 'Registered .LRN Non-Guests', + acs__magic_object_id('registered_users'), + 'dotlrn_non_guest_rel' ); end if; return(0); -end; -' language 'plpgsql'; +END; +$$ LANGUAGE plpgsql; + select inline_1(); drop function inline_1(); @@ -112,15 +119,21 @@ -- prompt Establishing non-guest or guest status for each user... -create function inline_1() -returns integer as ' -declare + + +-- +-- procedure inline_1/0 +-- +CREATE OR REPLACE FUNCTION inline_1( + +) RETURNS integer AS $$ +DECLARE v_dotlrn_package_id integer; v_permission_p char(1); v_non_guest_relseg_id integer; v_guest_relseg_id integer; user record; -begin +BEGIN -- -- Load some constants. @@ -130,18 +143,18 @@ select c.object_id into v_dotlrn_package_id from site_nodes c, site_nodes p where p.node_id = c.parent_id - and c.name = ''dotlrn'' + and c.name = 'dotlrn' and p.parent_id is null; select segment_id into v_non_guest_relseg_id from rel_segments - where group_id = acs__magic_object_id(''registered_users'') - and rel_type = ''dotlrn_non_guest_rel''; + where group_id = acs__magic_object_id('registered_users') + and rel_type = 'dotlrn_non_guest_rel'; select segment_id into v_guest_relseg_id from rel_segments - where group_id = acs__magic_object_id(''registered_users'') - and rel_type = ''dotlrn_guest_rel''; + where group_id = acs__magic_object_id('registered_users') + and rel_type = 'dotlrn_guest_rel'; -- -- Convert permissions to relationships for each user. @@ -150,13 +163,13 @@ for user in select user_id from dotlrn_users loop select acs_permission__permission_p( - v_dotlrn_package_id,user.user_id,''read_private_data'') + v_dotlrn_package_id,user.user_id,'read_private_data') into v_permission_p from dual; - if v_permission_p = ''t'' then + if v_permission_p = 't' then perform acs_permission__revoke_permission( - v_dotlrn_package_id,user.user_id,''read_private_data''); + v_dotlrn_package_id,user.user_id,'read_private_data'); perform dotlrn_privacy__set_user_non_guest(user.user_id); else perform dotlrn_privacy__set_user_guest(user.user_id); @@ -165,37 +178,45 @@ end loop; return(0); -end; -' language 'plpgsql'; +END; +$$ LANGUAGE plpgsql; + select inline_1(); drop function inline_1(); -- prompt Granting read_private_data privilege to non-guests on each community... -create function inline_1() -returns integer as ' -declare + + +-- +-- procedure inline_1/0 +-- +CREATE OR REPLACE FUNCTION inline_1( + +) RETURNS integer AS $$ +DECLARE v_count integer; v_parameter_id integer; community record; -begin +BEGIN for community in select community_id, package_id from dotlrn_communities_all loop -- Grant permission to non-guests on community. perform dotlrn_privacy__grant_rd_prv_dt_to_rel( - community.community_id,''dotlrn_non_guest_rel''); + community.community_id,'dotlrn_non_guest_rel'); end loop; return(0); -end; -' language 'plpgsql'; +END; +$$ LANGUAGE plpgsql; + select inline_1(); drop function inline_1(); Index: openacs-4/packages/dotlrn/sql/postgresql/upgrade/upgrade-2.2.0d1-2.2.0d2.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/sql/postgresql/upgrade/upgrade-2.2.0d1-2.2.0d2.sql,v diff -u -r1.2 -r1.3 --- openacs-4/packages/dotlrn/sql/postgresql/upgrade/upgrade-2.2.0d1-2.2.0d2.sql 8 Aug 2006 21:26:23 -0000 1.2 +++ openacs-4/packages/dotlrn/sql/postgresql/upgrade/upgrade-2.2.0d1-2.2.0d2.sql 1 Nov 2013 21:08:30 -0000 1.3 @@ -65,15 +65,21 @@ --Creating default site tempaltes -create function inline_0() -returns integer as ' -declare + + +-- +-- procedure inline_0/0 +-- +CREATE OR REPLACE FUNCTION inline_0( + +) RETURNS integer AS $$ +DECLARE v_site_template_id dotlrn_site_templates.site_template_id%TYPE; v_theme_id portal_element_themes.theme_id%TYPE; -begin +BEGIN select theme_id into v_theme_id from portal_element_themes - where name = ''#new-portal.sloan_theme_name#''; + where name = '#new-portal.sloan_theme_name#'; select acs_object_id_seq.nextval into v_site_template_id @@ -82,7 +88,7 @@ insert into dotlrn_site_templates (site_template_id, pretty_name, site_master, portal_theme_id ) values - (v_site_template_id, ''#new-portal.sloan_theme_name#'',''/packages/dotlrn/www/dotlrn-master'', v_theme_id); + (v_site_template_id, '#new-portal.sloan_theme_name#','/packages/dotlrn/www/dotlrn-master', v_theme_id); update dotlrn_communities_all set site_template_id = v_site_template_id; @@ -92,13 +98,14 @@ set attr_value = v_site_template_id where parameter_id in ( select parameter_id from apm_parameters - where parameter_name = ''CommDefaultSiteTemplate_p'' or parameter_name = ''UserDefaultSiteTemplate_p''); + where parameter_name = 'CommDefaultSiteTemplate_p' or parameter_name = 'UserDefaultSiteTemplate_p'); return v_site_template_id; -end;' language 'plpgsql'; +END; +$$ LANGUAGE plpgsql; select inline_0(); Index: openacs-4/packages/dotlrn/sql/postgresql/upgrade/upgrade-2.5.0d2-2.5.0d3.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/sql/postgresql/upgrade/upgrade-2.5.0d2-2.5.0d3.sql,v diff -u -r1.1 -r1.2 --- openacs-4/packages/dotlrn/sql/postgresql/upgrade/upgrade-2.5.0d2-2.5.0d3.sql 1 Feb 2009 21:56:45 -0000 1.1 +++ openacs-4/packages/dotlrn/sql/postgresql/upgrade/upgrade-2.5.0d2-2.5.0d3.sql 1 Nov 2013 21:08:30 -0000 1.2 @@ -1,22 +1,28 @@ -create or replace function dotlrn_community__new(integer,integer,varchar,varchar,varchar,varchar,varchar,integer,integer,integer,varchar,timestamptz,integer,varchar,integer) -returns integer as ' + + +-- +-- procedure dotlrn_community__new/15 +-- +CREATE OR REPLACE FUNCTION dotlrn_community__new( + p_community_id integer, + p_parent_community_id integer, + p_community_type varchar, + p_community_key varchar, + p_pretty_name varchar, + p_description varchar, + p_archived_p varchar, -- default 'f' + p_portal_id integer, + p_non_member_portal_id integer, + p_package_id integer, + p_join_policy varchar, + p_creation_date timestamptz, + p_creation_user integer, + p_creation_ip varchar, + p_context_id integer + +) RETURNS integer AS $$ DECLARE - p_community_id alias for $1; - p_parent_community_id alias for $2; - p_community_type alias for $3; - p_community_key alias for $4; - p_pretty_name alias for $5; - p_description alias for $6; - p_archived_p alias for $7; - p_portal_id alias for $8; - p_non_member_portal_id alias for $9; - p_package_id alias for $10; - p_join_policy alias for $11; - p_creation_date alias for $12; - p_creation_user alias for $13; - p_creation_ip alias for $14; - p_context_id alias for $15; c_id integer; v_group_type_exists_p integer; BEGIN @@ -60,26 +66,35 @@ return c_id; END; -' language 'plpgsql'; -create or replace function dotlrn_community_type__new (varchar,varchar,varchar,varchar,varchar,integer,timestamptz,integer,varchar,integer) -returns varchar as ' +$$ LANGUAGE plpgsql; + + + +-- added +select define_function_args('dotlrn_community_type__new','community_type,parent_type,pretty_name,pretty_plural,description,package_id,creation_date,creation_user,creation_ip,context_id'); + +-- +-- procedure dotlrn_community_type__new/10 +-- +CREATE OR REPLACE FUNCTION dotlrn_community_type__new( + p_community_type varchar, + p_parent_type varchar, + p_pretty_name varchar, + p_pretty_plural varchar, + p_description varchar, + p_package_id integer, + p_creation_date timestamptz, + p_creation_user integer, + p_creation_ip varchar, + p_context_id integer +) RETURNS varchar AS $$ DECLARE - p_community_type alias for $1; - p_parent_type alias for $2; - p_pretty_name alias for $3; - p_pretty_plural alias for $4; - p_description alias for $5; - p_package_id alias for $6; - p_creation_date alias for $7; - p_creation_user alias for $8; - p_creation_ip alias for $9; - p_context_id alias for $10; v_parent_object_type acs_object_types.object_type%TYPE; v_unique_name acs_objects.object_id%TYPE; BEGIN if p_parent_type is null then - v_parent_object_type:= ''application_group''; + v_parent_object_type:= 'application_group'; else v_parent_object_type:= p_parent_type; end if; @@ -96,16 +111,16 @@ cast(v_unique_name as varchar), cast(v_unique_name as varchar), cast(v_unique_name as varchar), - ''f'', + 'f', null, - ''acs_group.name'' + 'acs_group.name' ); insert into group_types (group_type, default_join_policy) values - (p_community_type, ''closed''); + (p_community_type, 'closed'); insert into dotlrn_community_types @@ -123,28 +138,35 @@ return p_community_type; END; -' language 'plpgsql'; +$$ LANGUAGE plpgsql; + select define_function_args('dotlrn_community__new','community_id,parent_community_id,community_type,community_key,pretty_name,description,archived_p;f,portal_id,non_member_portal_id,package_id,join_policy,creation_date,creation_user,creation_ip,context_id'); -create or replace function dotlrn_community__new(integer,integer,varchar,varchar,varchar,varchar,varchar,integer,integer,integer,varchar,timestamptz,integer,varchar,integer) -returns integer as ' + + +-- +-- procedure dotlrn_community__new/15 +-- +CREATE OR REPLACE FUNCTION dotlrn_community__new( + p_community_id integer, + p_parent_community_id integer, + p_community_type varchar, + p_community_key varchar, + p_pretty_name varchar, + p_description varchar, + p_archived_p varchar, -- default 'f' + p_portal_id integer, + p_non_member_portal_id integer, + p_package_id integer, + p_join_policy varchar, + p_creation_date timestamptz, + p_creation_user integer, + p_creation_ip varchar, + p_context_id integer + +) RETURNS integer AS $$ DECLARE - p_community_id alias for $1; - p_parent_community_id alias for $2; - p_community_type alias for $3; - p_community_key alias for $4; - p_pretty_name alias for $5; - p_description alias for $6; - p_archived_p alias for $7; - p_portal_id alias for $8; - p_non_member_portal_id alias for $9; - p_package_id alias for $10; - p_join_policy alias for $11; - p_creation_date alias for $12; - p_creation_user alias for $13; - p_creation_ip alias for $14; - p_context_id alias for $15; c_id integer; v_group_type_exists_p integer; BEGIN @@ -188,5 +210,6 @@ return c_id; END; -' language 'plpgsql'; +$$ LANGUAGE plpgsql; + Index: openacs-4/packages/dotlrn/sql/postgresql/upgrade/upgrade-2.6.0d1-2.6.0d2.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/sql/postgresql/upgrade/upgrade-2.6.0d1-2.6.0d2.sql,v diff -u -r1.1 -r1.2 --- openacs-4/packages/dotlrn/sql/postgresql/upgrade/upgrade-2.6.0d1-2.6.0d2.sql 8 Nov 2010 13:17:44 -0000 1.1 +++ openacs-4/packages/dotlrn/sql/postgresql/upgrade/upgrade-2.6.0d1-2.6.0d2.sql 1 Nov 2013 21:08:30 -0000 1.2 @@ -8,29 +8,37 @@ -- PG 9.0 compatibility. Changes regarding usage of sequences. -create or replace function dotlrn_community_type__new (varchar,varchar,varchar,varchar,varchar,integer,timestamptz,integer,varchar,integer) -returns varchar as ' + + +-- added +select define_function_args('dotlrn_community_type__new','community_type,parent_type,pretty_name,pretty_plural,description,package_id,creation_date,creation_user,creation_ip,context_id'); + +-- +-- procedure dotlrn_community_type__new/10 +-- +CREATE OR REPLACE FUNCTION dotlrn_community_type__new( + p_community_type varchar, + p_parent_type varchar, + p_pretty_name varchar, + p_pretty_plural varchar, + p_description varchar, + p_package_id integer, + p_creation_date timestamptz, + p_creation_user integer, + p_creation_ip varchar, + p_context_id integer +) RETURNS varchar AS $$ DECLARE - p_community_type alias for $1; - p_parent_type alias for $2; - p_pretty_name alias for $3; - p_pretty_plural alias for $4; - p_description alias for $5; - p_package_id alias for $6; - p_creation_date alias for $7; - p_creation_user alias for $8; - p_creation_ip alias for $9; - p_context_id alias for $10; v_parent_object_type acs_object_types.object_type%TYPE; v_unique_name acs_objects.object_id%TYPE; BEGIN if p_parent_type is null then - v_parent_object_type:= ''application_group''; + v_parent_object_type:= 'application_group'; else v_parent_object_type:= p_parent_type; end if; - select nextval(''t_acs_object_id_seq'') + select nextval('t_acs_object_id_seq') into v_unique_name from dual; @@ -42,16 +50,16 @@ cast(v_unique_name as varchar), cast(v_unique_name as varchar), cast(v_unique_name as varchar), - ''f'', + 'f', null, - ''acs_group.name'' + 'acs_group.name' ); insert into group_types (group_type, default_join_policy) values - (p_community_type, ''closed''); + (p_community_type, 'closed'); insert into dotlrn_community_types @@ -69,5 +77,6 @@ return p_community_type; END; -' language 'plpgsql'; +$$ LANGUAGE plpgsql; + Index: openacs-4/packages/dotlrn/tcl/apm-callback-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/tcl/apm-callback-procs.tcl,v diff -u -r1.11 -r1.12 --- openacs-4/packages/dotlrn/tcl/apm-callback-procs.tcl 13 Feb 2009 02:10:13 -0000 1.11 +++ openacs-4/packages/dotlrn/tcl/apm-callback-procs.tcl 1 Nov 2013 21:08:30 -0000 1.12 @@ -41,8 +41,8 @@ -parameter HomeName \ -value "#dotlrn.control_panel#" - # Make sure that privacy is turned on - acs_privacy::privacy_control_set 1 + # Make sure that privacy is turned on + acs_privacy::privacy_control_set 1 } @@ -55,7 +55,7 @@ set group_id [db_string group_id_from_name " select group_id from groups where group_name='dotlrn-admin'" -default ""] - if {![empty_string_p $group_id] } { + if {$group_id ne "" } { #Admin privs permission::grant \ @@ -64,10 +64,16 @@ -privilege "admin" } - # Get the default Site Template + # + # Get the default Site Template; Use here + # #new-portal.sloan_theme_name# rather than the zen version, + # since the sloan varian is part of the dotlrn-package, and + # *zen* part of the zen-theme. + # set default_template_name [parameter::get \ -package_id $package_id \ - -parameter DefaultSiteTemplate] + -parameter DefaultSiteTemplate \ + -default "#theme-zen.Zen_Theme#"] set site_template_id [db_string select_st_id {}] # for communities @@ -90,7 +96,7 @@ set group_id [db_string group_id_from_name " select group_id from groups where group_name='dotlrn-admin'" -default ""] - if {![empty_string_p $group_id] } { + if {$group_id ne "" } { permission::revoke \ -party_id $group_id \ Index: openacs-4/packages/dotlrn/tcl/applets-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/tcl/applets-procs.tcl,v diff -u -r1.23 -r1.24 --- openacs-4/packages/dotlrn/tcl/applets-procs.tcl 8 Nov 2010 13:17:44 -0000 1.23 +++ openacs-4/packages/dotlrn/tcl/applets-procs.tcl 1 Nov 2013 21:08:30 -0000 1.24 @@ -87,7 +87,7 @@ {-url ""} {-pretty_name ""} } { - if {[empty_string_p $url]} { + if {$url eq ""} { set url $package_key } @@ -181,7 +181,7 @@ } { call a particular applet op } { - acs_sc_call dotlrn_applet $op $list_args $applet_key + acs_sc::invoke -contract dotlrn_applet -operation $op -call_args $list_args -impl $applet_key } } Index: openacs-4/packages/dotlrn/tcl/class-applets-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/tcl/class-applets-procs.tcl,v diff -u -r1.5 -r1.6 --- openacs-4/packages/dotlrn/tcl/class-applets-procs.tcl 23 Oct 2002 12:38:38 -0000 1.5 +++ openacs-4/packages/dotlrn/tcl/class-applets-procs.tcl 1 Nov 2013 21:08:30 -0000 1.6 @@ -82,7 +82,7 @@ set list_of_callbacks [lindex $applet 2] foreach callback $list_of_callbacks { - if {[string equal [lindex $callback 0] $callback_name]} { + if {[lindex $callback 0] eq $callback_name} { eval [lindex $callback 1] $args } } Index: openacs-4/packages/dotlrn/tcl/class-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/tcl/class-procs.tcl,v diff -u -r1.51 -r1.52 --- openacs-4/packages/dotlrn/tcl/class-procs.tcl 8 Aug 2006 21:26:23 -0000 1.51 +++ openacs-4/packages/dotlrn/tcl/class-procs.tcl 1 Nov 2013 21:08:30 -0000 1.52 @@ -98,7 +98,7 @@ } { - if [empty_string_p $community_type_key] { + if {$community_type_key eq ""} { set community_type_key "$department_key.$class_key" } @@ -126,7 +126,7 @@ This class can then be instantiated for a particular semester. } { - if [empty_string_p $class_key] { + if {$class_key eq ""} { set new_class_key $department_key.[dotlrn::generate_key -name $pretty_name] } else { set new_class_key $class_key @@ -208,7 +208,7 @@ ns_set put $extra_vars class_key $class_key ns_set put $extra_vars join_policy $join_policy - if {[empty_string_p $pretty_name]} { + if {$pretty_name eq ""} { set pretty_name "[dotlrn_community::get_community_type_name $class_key]; $term $year" } db_transaction { @@ -239,7 +239,7 @@ Assigns a user to a particular role for that class. Roles in dotLRN can be student, prof, ta, admin } { - if {[empty_string_p $rel_type]} { + if {$rel_type eq ""} { set rel_type "dotlrn_student_rel" } Index: openacs-4/packages/dotlrn/tcl/club-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/tcl/club-procs.tcl,v diff -u -r1.28 -r1.29 --- openacs-4/packages/dotlrn/tcl/club-procs.tcl 6 Jul 2007 12:13:23 -0000 1.28 +++ openacs-4/packages/dotlrn/tcl/club-procs.tcl 1 Nov 2013 21:08:30 -0000 1.29 @@ -112,7 +112,7 @@ } { Assigns a user to a particular role for that club. } { - if [empty_string_p $rel_type] { + if {$rel_type eq ""} { set rel_type "dotlrn_member_rel" } @@ -131,7 +131,7 @@ } { Assigns a user to a particular role for these clubs. } { - if [empty_string_p $rel_type] { + if {$rel_type eq ""} { set rel_type "dotlrn_member_rel" } @@ -150,18 +150,18 @@ {-package_id:required} {-form:required} {-object_type:required} - {-party_id} + {-party_id ""} } { If organisation, ask to create new club } { - if {$object_type != "person" } { + if {$object_type ne "person" } { set already_linked_p "f" - if {[exists_and_not_null party_id]} { + if {$party_id ne ""} { # if we are in edit mode we need to make that we are not # already linked to a community - if {[application_data_link::get_linked -from_object_id $party_id -to_object_type "dotlrn_club"] != ""} { + if {[application_data_link::get_linked -from_object_id $party_id -to_object_type "dotlrn_club"] ne ""} { set already_linked_p "t" } } @@ -187,7 +187,7 @@ } { upvar create_club_p create_club_p - if {[exists_and_not_null create_club_p] + if {([info exists create_club_p] && $create_club_p ne "") && $create_club_p == "t"} { # Create the new club and create a link between it and # the new contact. Index: openacs-4/packages/dotlrn/tcl/community-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/tcl/community-procs.tcl,v diff -u -r1.206 -r1.207 --- openacs-4/packages/dotlrn/tcl/community-procs.tcl 29 Sep 2013 13:49:45 -0000 1.206 +++ openacs-4/packages/dotlrn/tcl/community-procs.tcl 1 Nov 2013 21:08:30 -0000 1.207 @@ -175,7 +175,7 @@ create a new community } { - if {[empty_string_p $community_key]} { + if {$community_key eq ""} { set community_key [dotlrn_community::generate_key -name $pretty_name] } @@ -188,7 +188,7 @@ set dotlrn_package_id $package_id # Set up extra vars - if {[empty_string_p $extra_vars]} { + if {$extra_vars eq ""} { set extra_vars [ns_set create] } @@ -249,7 +249,7 @@ dotlrn_community::create_rel_segments -community_id $community_id # Set up the node - if {[empty_string_p $parent_community_id]} { + if {$parent_community_id eq ""} { set parent_node_id [get_type_node_id $community_type] } else { set parent_node_id [get_community_node_id $parent_community_id] @@ -277,17 +277,17 @@ # Add the default applets based on the community type # 2. the the list of default applets for this type - if {[string equal $community_type dotlrn_community]} { + if {$community_type eq "dotlrn_community"} { set default_applets [parameter::get \ -package_id $dotlrn_package_id \ -parameter default_subcomm_applets \ ] - } elseif {[string equal $community_type dotlrn_club]} { + } elseif {$community_type eq "dotlrn_club"} { set default_applets [parameter::get \ -package_id $dotlrn_package_id \ -parameter default_club_applets \ ] - } elseif {[string equal $community_type user]} { + } elseif {$community_type eq "user"} { set default_applets [parameter::get \ -package_id $dotlrn_package_id \ -parameter default_user_portal_applets \ @@ -326,7 +326,7 @@ set dotlrn_admin_group_id [db_string group_id_from_name " select group_id from groups where group_name='dotlrn-admin'" -default ""] - if {![empty_string_p $dotlrn_admin_group_id] } { + if {$dotlrn_admin_group_id ne "" } { permission::grant \ -party_id $dotlrn_admin_group_id \ @@ -341,7 +341,7 @@ #this block sets permissions for subcommunities while {1} { - if {![empty_string_p $parent_community_id]} { + if {$parent_community_id ne ""} { #admin of the parent need admin on the subcommunity. set parent_admin_party [db_string "parent_admin_party" "select segment_id from rel_segments where group_id = :parent_community_id and rel_type='dotlrn_admin_rel'"] permission::grant -party_id $parent_admin_party -object_id $community_id -privilege "admin" @@ -386,7 +386,7 @@ } { This gets the relative URL for a package_id under a particular node_id } { - if {[empty_string_p $current_node_id]} { + if {$current_node_id eq ""} { set current_node_id [site_node::get_node_id -url [ad_conn url]] } @@ -398,7 +398,7 @@ } { get default rel_type data for this community } { - if {[empty_string_p $community_id]} { + if {$community_id eq ""} { set community_id [get_community_id] } set community_type [get_community_type_from_community_id $community_id] @@ -421,7 +421,7 @@ ad_proc -private get_roles { {-community_id ""} } { - if {[empty_string_p $community_id]} { + if {$community_id eq ""} { set community_id [get_community_id] } set default_roles [eval concat [get_default_roles -community_id $community_id]] @@ -436,14 +436,14 @@ set i [lsearch -exact $attributes "${role}_pretty_name"] if {$i > -1} { - lappend new_role [lindex $attributes [expr $i + 1]] + lappend new_role [lindex $attributes $i+1] } else { lappend new_role $pretty_name } set i [lsearch -exact $attributes "${role}_pretty_plural"] if {$i > -1} { - lappend new_role [lindex $attributes [expr $i + 1]] + lappend new_role [lindex $attributes $i+1] } else { lappend new_role $pretty_plural } @@ -460,7 +460,7 @@ } { get the pretty name for the role associated with this rel_type } { - if {[empty_string_p $community_id]} { + if {$community_id eq ""} { set community_id [get_community_id] } @@ -469,7 +469,7 @@ set pretty_name "" if {$i > -1} { - set pretty_name [lindex $roles [expr $i + 2]] + set pretty_name [lindex $roles $i+2] } return [lang::util::localize $pretty_name] @@ -481,7 +481,7 @@ } { get the pretty plural for the role associated with this rel_type } { - if {[empty_string_p $community_id]} { + if {$community_id eq ""} { set community_id [get_community_id] } @@ -490,7 +490,7 @@ set pretty_plural "" if {$i > -1} { - set pretty_plural [lindex $roles [expr $i + 3]] + set pretty_plural [lindex $roles $i+3] } return [lang::util::localize $pretty_plural] @@ -524,7 +524,7 @@ } { set the pretty_name and pretty_plural for several roles } { - if {[empty_string_p $community_id]} { + if {$community_id eq ""} { set community_id [get_community_id] } @@ -547,23 +547,23 @@ } { set the pretty_name and pretty_plural of a role for a community } { - if {[empty_string_p $community_id]} { + if {$community_id eq ""} { set community_id [get_community_id] } set roles [eval concat [get_roles -community_id $community_id]] set i [lsearch -exact $roles $rel_type] if {$i > -1} { - set old_pretty_name [lindex $roles [expr $i + 2]] + set old_pretty_name [lindex $roles $i+2] if {![string match $pretty_name $old_pretty_name]} { set_attribute \ -community_id $community_id \ -attribute_name "${role}_pretty_name" \ -attribute_value $pretty_name } - set old_pretty_plural [lindex $roles [expr $i + 3]] + set old_pretty_plural [lindex $roles $i+3] if {![string match $pretty_plural $old_pretty_plural]} { set_attribute \ -community_id $community_id \ @@ -763,16 +763,16 @@ set toplevel_community_type \ [get_toplevel_community_type_from_community_id $community_id] - if {[string equal $toplevel_community_type dotlrn_class_instance]} { - if {$rel_type == "dotlrn_member_rel"} { + if {$toplevel_community_type eq "dotlrn_class_instance"} { + if {$rel_type eq "dotlrn_member_rel"} { set rel_type "dotlrn_student_rel" } dotlrn_class::add_user \ -rel_type $rel_type \ -community_id $community_id \ -user_id $user_id \ -member_state $member_state - } elseif {[string equal $toplevel_community_type dotlrn_club]} { + } elseif {$toplevel_community_type eq "dotlrn_club"} { dotlrn_club::add_user \ -rel_type $rel_type \ -community_id $community_id \ @@ -808,7 +808,7 @@ db_transaction { # Create the form - if {[empty_string_p $extra_vars]} { + if {$extra_vars eq ""} { set extra_vars [ns_set create] } @@ -834,7 +834,7 @@ } } - if {[string equal $member_state approved]} { + if {$member_state eq "approved"} { membership_approve -user_id $user_id -community_id $community_id } } @@ -972,7 +972,7 @@ } { set type [get_community_type_from_community_id $community_id] - if {[string equal $type dotlrn_community] == 1} { + if {$type eq "dotlrn_community"} { return $type } @@ -1016,11 +1016,11 @@ } { returns the community from a URL } { - if {[empty_string_p $url]} { + if {$url eq ""} { set url [ad_conn url] } - set package_id [site_node_closest_ancestor_package -url $url dotlrn] + set package_id [site_node::closest_ancestor_package -include_self -url $url -package_key dotlrn] return [get_community_id -package_id $package_id] } @@ -1036,8 +1036,11 @@ @param package_id PackageID for which to search the community_id for @return community_id of the community where the package is mounted, empty string if not found } { - if {[empty_string_p $package_id]} { - set package_id [site_node_closest_ancestor_package -default [ad_conn package_id] dotlrn] + if {$package_id eq ""} { + set package_id [site_node::closest_ancestor_package -include_self -package_key dotlrn] + if {$package_id eq ""} { + set package_id [ad_conn package_id] + } } if {$package_id ne ""} { @@ -1064,7 +1067,7 @@ under a dotlrn community, such as workflow panels, that cannot be passed their community_id. } { - if {[empty_string_p $package_id]} { + if {$package_id eq ""} { set package_id [ad_conn package_id] } @@ -1107,7 +1110,7 @@ } { set parent_id [get_parent_id -community_id $community_id] - if {[empty_string_p $parent_id]} { + if {$parent_id eq ""} { return "" } else { return [get_community_name $parent_id] @@ -1139,7 +1142,7 @@ community by checking that it's not the same as an existing (possible) sibling's name. } { - if {![empty_string_p $parent_community_id]} { + if {$parent_community_id ne ""} { set valid_p [ad_decode [db_string collision_check_with_parent {}] 0 1 0] } else { # LARS 2003-10-21: Should this check only against communities with null parent_id? @@ -1228,7 +1231,7 @@ } { set chunk "" - if {[empty_string_p $user_id]} { + if {$user_id eq ""} { set user_id [ad_conn user_id] } @@ -1494,7 +1497,7 @@ } { get the id of the comm's portal } { - if {[empty_string_p $community_id]} { + if {$community_id eq ""} { set community_id [get_community_id] } @@ -1514,7 +1517,7 @@ } { Get the community portal_id for non-members } { - if {[empty_string_p $community_id]} { + if {$community_id eq ""} { set community_id [get_community_id] } @@ -1534,7 +1537,7 @@ } { Get the community Admin portal_id } { - if {[empty_string_p $community_id]} { + if {$community_id eq ""} { set community_id [get_community_id] } @@ -1649,17 +1652,17 @@ set extra_vars [ns_set create] # there is some special stuff for cloning subcomms - if {[string equal "dotlrn_community" $community_type]} { + if {"dotlrn_community" eq $community_type} { set subcomm_p 1 # we need this here in case we are being called from ourself - if {[empty_string_p $parent_community_id]} { + if {$parent_community_id eq ""} { set parent_community_id [get_parent_id -community_id $community_id] } set parent_type [dotlrn_community::get_community_type_from_community_id $parent_community_id] - if {![string equal $parent_type [dotlrn_club::community_type]] && - ![string equal $parent_type dotlrn_community]} { + if {$parent_type ne [dotlrn_club::community_type] && + $parent_type ne "dotlrn_community" } { # we want to make a subgroup of a class instance # get the term_id, since the subgroup should not # outlive the class @@ -1679,7 +1682,7 @@ -complain_if_invalid \ -community_key $key - if {![empty_string_p $term_id]} { + if {$term_id ne ""} { # it's a class instance that we're cloning ns_set put $extra_vars class_key [db_string get_class_key { select class_key @@ -1693,7 +1696,7 @@ } } - if {[empty_string_p $pretty_name]} { + if {$pretty_name eq ""} { set pretty_name $key } @@ -1795,8 +1798,8 @@ -privilege admin # for a subcomm of a "class instance" set the start and end dates - if {![string equal $parent_type [dotlrn_club::community_type]] && - ![string equal $parent_type "dotlrn_community"]} { + if {$parent_type ne [dotlrn_club::community_type] && + $parent_type ne "dotlrn_community" } { dotlrn_community::set_active_dates \ -community_id $clone_id \ @@ -1964,15 +1967,15 @@ delete_rel_segments -community_id $community_id - if {![empty_string_p $admin_portal_id]} { + if {$admin_portal_id ne ""} { portal::delete $admin_portal_id } - if {![empty_string_p $non_member_portal_id]} { + if {$non_member_portal_id ne ""} { portal::delete $non_member_portal_id } - if {![empty_string_p $portal_id]} { + if {$portal_id ne ""} { portal::delete $portal_id } @@ -2032,7 +2035,7 @@ } { call a particular applet op } { - acs_sc_call dotlrn_applet $op $list_args $applet_key + acs_sc::invoke -contract dotlrn_applet -operation $op -call_args $list_args -impl $applet_key } ad_proc -public get_available_attributes {} { @@ -2054,7 +2057,7 @@ } { get the attributes of a given community } { - if {[empty_string_p $community_id]} { + if {$community_id eq ""} { set community_id [get_community_id] } @@ -2105,17 +2108,17 @@ # this is serious, we are trying to set an attribute that doesn't # exist set attribute_id [get_attribute_id -attribute_name $attribute_name] - if {[empty_string_p $attribute_id]} { + if {$attribute_id eq ""} { error "dotlrn_community::set_attribute: invalid attribute $attribute_name" } # we don't accept empty values (essentially, we are making the # acs_attribute_values.attr_value not null, which it is not in the db). - if {[empty_string_p $attribute_value]} { + if {$attribute_value eq ""} { return } - if {[empty_string_p $community_id]} { + if {$community_id eq ""} { set community_id [get_community_id] } @@ -2140,14 +2143,14 @@ } { ussets an attribute of this community } { - if {[empty_string_p $community_id]} { + if {$community_id eq ""} { set community_id [get_community_id] } # this is serious, we are trying to unset an attribute that doesn't # exist set attribute_id [get_attribute_id -attribute_name $attribute_name] - if {[empty_string_p $attribute_id]} { + if {$attribute_id eq ""} { error "dotlrn_community::set_attribute: invalid attribute $attribute_name" } # remove the row @@ -2291,13 +2294,13 @@ # bother to create the welcome message in the first place (will be spam filtered...) MalteS if { ([info exists subject] && $subject ne "") || $override_subject ne "" } { ns_log Debug "DAVEB override email '${override_email}' override_subject '${override_subject}'" - if {[exists_and_not_null override_email]} { + if {([info exists override_email] && $override_email ne "")} { set email $override_email } - if {[exists_and_not_null override_subject]} { + if {([info exists override_subject] && $override_subject ne "")} { set subject $override_subject } - if {[info exists email] && ![string equal "" [string trim $email]]} { + if {[info exists email] && "" ne [string trim $email] } { # user %varname% to substitute variables in email set subject_vars [lang::message::get_embedded_vars $subject] @@ -2315,11 +2318,11 @@ return [list $subject $email] } # Shamelessly cut & pasted from bulk mail - if { ![exists_and_not_null from_addr] } { + if { (![info exists from_addr] || $from_addr eq "") } { set from_addr [ad_system_owner] } - if {[empty_string_p $email_send_to]} { + if {$email_send_to eq ""} { set to_addr [cc_email_from_party $to_user] } else { set to_addr [cc_email_from_party $email_send_to] Index: openacs-4/packages/dotlrn/tcl/department-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/tcl/department-procs.tcl,v diff -u -r1.12 -r1.13 --- openacs-4/packages/dotlrn/tcl/department-procs.tcl 8 Aug 2006 21:26:23 -0000 1.12 +++ openacs-4/packages/dotlrn/tcl/department-procs.tcl 1 Nov 2013 21:08:30 -0000 1.13 @@ -33,7 +33,7 @@ Create a new department. } { - if [empty_string_p $department_key] { + if {$department_key eq ""} { set department_key [dotlrn::generate_key -name $pretty_name] } Index: openacs-4/packages/dotlrn/tcl/dotlrn-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/tcl/dotlrn-procs.tcl,v diff -u -r1.77 -r1.78 --- openacs-4/packages/dotlrn/tcl/dotlrn-procs.tcl 21 Feb 2011 14:27:27 -0000 1.77 +++ openacs-4/packages/dotlrn/tcl/dotlrn-procs.tcl 1 Nov 2013 21:08:30 -0000 1.78 @@ -108,7 +108,7 @@ } { set list [site_node::get_children -package_key $package_key \ -node_id [get_node_id]] - return [expr [llength $list] > 0 ? 1 : 0] + return [expr {[llength $list] > 0 ? 1 : 0}] } ad_proc -public mount_package { @@ -237,7 +237,7 @@ } { Mount an application under a particular community } { - if {[empty_string_p $mount_point]} { + if {$mount_point eq ""} { set mount_point $package_key } @@ -328,7 +328,7 @@ } { set id [db_string select {} -default ""] - if {[empty_string_p $id]} { + if {$id eq ""} { set type dotlrn_class_instance # aks: this next line is necessary # for dotlrn_class_instances, don't remove it! @@ -356,13 +356,13 @@ # based on the type: # 1. get the page_names and layouts # 2. the the list of default applets for this type - if {[string equal $type dotlrn_community]} { + if {$type eq "dotlrn_community"} { set csv_list [dotlrn::parameter -name subcomm_pages_csv] set default_applets [dotlrn::parameter -name default_subcomm_applets] - } elseif {[string equal $type dotlrn_club]} { + } elseif {$type eq "dotlrn_club"} { set csv_list [dotlrn::parameter -name club_pages_csv] set default_applets [dotlrn::parameter -name default_club_applets] - } elseif {[string equal $type user]} { + } elseif {$type eq "user"} { set csv_list [dotlrn::parameter -name user_portal_pages_csv] set default_applets [dotlrn::parameter -name default_user_portal_applets] } else { @@ -494,8 +494,7 @@ Returns the master template for a given site template } { return [db_string select_site_template_master {} \ - -default [parameter::get -package_id [dotlrn::get_package_id] \ - -parameter DefaultMaster_p]] + -default [parameter::get -package_id [dotlrn::get_package_id] -parameter DefaultMaster_p]] } ad_proc -public assign_default_sitetemplate { Index: openacs-4/packages/dotlrn/tcl/dotlrn-security-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/tcl/dotlrn-security-procs.tcl,v diff -u -r1.59 -r1.60 --- openacs-4/packages/dotlrn/tcl/dotlrn-security-procs.tcl 8 Aug 2006 21:26:23 -0000 1.59 +++ openacs-4/packages/dotlrn/tcl/dotlrn-security-procs.tcl 1 Nov 2013 21:08:30 -0000 1.60 @@ -38,7 +38,7 @@ return [util_text_to_url \ -replacement {} \ -existing_urls { members configure spam index not-allowed clone help } \ - -no_resolve=[expr !$increment_p] \ + -no_resolve=[expr {!$increment_p}] \ -- $name] } @@ -96,7 +96,7 @@ } # default ID to email address - if {[empty_string_p $id]} { + if {$id eq ""} { set id [cc_email_from_party $user_id] } @@ -176,7 +176,7 @@ } { set rel_id [db_string select_rel_id {} -default ""] - if {![empty_string_p $rel_id]} { + if {$rel_id ne ""} { relation_remove $rel_id } } @@ -225,7 +225,7 @@ acs_user::delete -user_id $user_id -permanent } errMsg] } { ns_log Notice "dotlrn::remove_user_completely: permanent removal failed for user $user_id. Invoking on_fail option '$on_fail'" - if { [string equal $on_fail soft_delete] } { + if {$on_fail eq "soft_delete"} { acs_user::delete -user_id $user_id } else { error $errMsg @@ -365,7 +365,7 @@ } { check if a user is a member of a community } { - if {[empty_string_p $user_id]} { + if {$user_id eq ""} { set user_id [ad_conn user_id] } Index: openacs-4/packages/dotlrn/tcl/navigation-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/tcl/navigation-procs.tcl,v diff -u -r1.26 -r1.27 --- openacs-4/packages/dotlrn/tcl/navigation-procs.tcl 8 Aug 2006 21:26:23 -0000 1.26 +++ openacs-4/packages/dotlrn/tcl/navigation-procs.tcl 1 Nov 2013 21:08:30 -0000 1.27 @@ -75,13 +75,13 @@ set application_name $node_array(instance_name) set application_url $node_array(url) - if { [string match admin/* [ad_conn extra_url]] } { + if { [string match "admin/*" [ad_conn extra_url]] } { set application_admin_context [list [list "${application_url}admin/" "Administration"]] } else { set application_admin_context [list] } - if { ![string equal $node_array(package_key) "dotlrn"] } { + if { $node_array(package_key) ne "dotlrn" } { set application_context [list [list $application_url $application_name]] } else { set application_context [list] @@ -91,11 +91,11 @@ set application_context [concat $application_context $application_admin_context] } - if { ![empty_string_p $context] } { + if { $context ne "" } { set application_context [concat $application_context $context] } else { # Make last entry be just the label - set application_context [lreplace $application_context end end [lindex [lindex $application_context end] 1]] + set application_context [lreplace $application_context end end [lindex $application_context end 1]] } } else { set application_context [list] @@ -128,28 +128,28 @@ Creates a Navigation Bar for dotLRN } { # Fetch community_id and community_type if they're not there - if {[empty_string_p $community_id] && [empty_string_p $community_type]} { + if {$community_id eq "" && $community_type eq ""} { set community_id [dotlrn_community::get_community_id] set community_type [dotlrn_community::get_community_type] } - if {![empty_string_p $community_id]} { + if {$community_id ne ""} { set community_type [dotlrn_community::get_community_type_from_community_id $community_id] } set first_args [] lappend first_args [list [get_url] dotLRN] - if {[string equal ${community_type} "dotlrn_class_instance"] != 0} { + if {$community_type eq "dotlrn_class_instance"} { lappend first_args [list [dotlrn_community::get_community_type_url $community_type] [parameter::get -localize -parameter classes_pretty_plural]] - } elseif {[string equal ${community_type} "dotlrn_club"] != 0} { + } elseif {$community_type eq "dotlrn_club"} { lappend first_args [list [dotlrn_community::get_community_type_url $community_type] [parameter::get -localize -parameter clubs_pretty_plural]] - } elseif {[string equal ${community_type} "dotlrn_community"] != 0} { + } elseif {$community_type eq "dotlrn_community"} { } else { lappend first_args [list [dotlrn_community::get_community_type_url $community_type] [dotlrn_community::get_community_type_name $community_type]] } - if {![empty_string_p $community_id]} { + if {$community_id ne ""} { lappend first_args [list [dotlrn_community::get_community_url $community_id] [dotlrn_community::get_community_name $community_id]] } @@ -197,7 +197,7 @@ set control_panel_name control-panel set control_panel_url "$dotlrn_url/$control_panel_name" - if {[empty_string_p $community_id]} { + if {$community_id eq ""} { # We are not under a dotlrn community. However we could be # under /dotlrn (i.e. in the user's portal) or anywhere # else on the site @@ -271,7 +271,7 @@ regsub -all {[^0-9]} $page_num {} page_num db_foreach list_page_nums_select {} { - if { ("$dotlrn_url/" == [ad_conn url] || "$dotlrn_url/index" == [ad_conn url]) && $sort_key == 0 && $page_num == ""} { + if { ("$dotlrn_url/" == [ad_conn url] || "$dotlrn_url/index" == [ad_conn url]) && $sort_key == 0 && $page_num eq ""} { # active tab is first tab and page_num may be "" append navbar "
  • $pretty_name
  • " } elseif {$page_num == $sort_key} { Index: openacs-4/packages/dotlrn/tcl/privacy-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/tcl/privacy-procs.tcl,v diff -u -r1.3 -r1.4 --- openacs-4/packages/dotlrn/tcl/privacy-procs.tcl 8 Aug 2006 21:26:23 -0000 1.3 +++ openacs-4/packages/dotlrn/tcl/privacy-procs.tcl 1 Nov 2013 21:08:30 -0000 1.4 @@ -44,7 +44,7 @@ action should be "grant" or "revoke" rel_type should be "dotlrn_guest_rel" or "dotlrn_non_guest_rel" } { - if { [string equal $action "grant"] } { + if {$action eq "grant"} { set db_proc "grant_rd_prv_dt_to_rel" } else { set db_proc "revoke_rd_prv_dt_from_rel" Index: openacs-4/packages/dotlrn/tcl/spam-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/tcl/spam-procs.tcl,v diff -u -r1.8 -r1.9 --- openacs-4/packages/dotlrn/tcl/spam-procs.tcl 15 May 2009 22:38:13 -0000 1.8 +++ openacs-4/packages/dotlrn/tcl/spam-procs.tcl 1 Nov 2013 21:08:30 -0000 1.9 @@ -96,7 +96,7 @@ # if there were any errors sending the emails, then send an email to the # sender letting them know. - if {![empty_string_p $errors]} { + if {$errors ne ""} { set error_subject "There were errors with this spam" set error_message "

    Index: openacs-4/packages/dotlrn/tcl/term-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/tcl/term-procs.tcl,v diff -u -r1.11 -r1.12 --- openacs-4/packages/dotlrn/tcl/term-procs.tcl 8 Nov 2010 13:17:44 -0000 1.11 +++ openacs-4/packages/dotlrn/tcl/term-procs.tcl 1 Nov 2013 21:08:30 -0000 1.12 @@ -123,7 +123,7 @@ set start_year [template::util::date::get_property year $start_date] set end_year [template::util::date::get_property year $end_date] - if {![string equal $start_year $end_year]} { + if {$start_year ne $end_year } { return "$start_year/$end_year" } Index: openacs-4/packages/dotlrn/tcl/test/dotlrn-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/tcl/test/dotlrn-procs.tcl,v diff -u -r1.2 -r1.3 --- openacs-4/packages/dotlrn/tcl/test/dotlrn-procs.tcl 8 Aug 2006 21:26:23 -0000 1.2 +++ openacs-4/packages/dotlrn/tcl/test/dotlrn-procs.tcl 1 Nov 2013 21:08:30 -0000 1.3 @@ -23,7 +23,7 @@ set date [template::util::date::today] set year [template::util::date::get_property year $date] - set next_year [expr $year+1] + set next_year [expr {$year+1}] set day [template::util::date::get_property day $date] set month [template::util::date::get_property month $date] @@ -60,7 +60,7 @@ set date [template::util::date::today] set year [template::util::date::get_property year $date] - set next_year [expr $year+1] + set next_year [expr {$year+1}] set day [template::util::date::get_property day $date] set month [template::util::date::get_property month $date] Index: openacs-4/packages/dotlrn/tcl/test/dotlrn-security-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/tcl/test/dotlrn-security-procs.tcl,v diff -u -r1.3 -r1.4 --- openacs-4/packages/dotlrn/tcl/test/dotlrn-security-procs.tcl 2 Jun 2005 07:34:12 -0000 1.3 +++ openacs-4/packages/dotlrn/tcl/test/dotlrn-security-procs.tcl 1 Nov 2013 21:08:30 -0000 1.4 @@ -26,6 +26,6 @@ aa_log "now calling dotlrn::remove_user_completely to try and remove this user" dotlrn::remove_user_completely -user_id $creation_info(user_id) - aa_true "user_must_not_exist" [string equal [db_string check_user "select count(*) from users where user_id = $creation_info(user_id)"] 0] + aa_true "user_must_not_exist" [string equal [db_string check_user "select count(*) from users where user_id = $creation_info(user_id)"] "0"] } } Index: openacs-4/packages/dotlrn/www/approve.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/approve.tcl,v diff -u -r1.8 -r1.9 --- openacs-4/packages/dotlrn/www/approve.tcl 8 Aug 2006 21:26:23 -0000 1.8 +++ openacs-4/packages/dotlrn/www/approve.tcl 1 Nov 2013 21:08:30 -0000 1.9 @@ -26,14 +26,14 @@ {referer "./"} } -ad_maybe_redirect_for_registration +auth::require_login -if {[empty_string_p $community_id]} { +if {$community_id eq ""} { set community_id [dotlrn_community::get_community_id] } foreach uid $user_id { - if {[empty_string_p $uid]} { + if {$uid eq ""} { set uid [ad_conn user_id] } else { dotlrn::require_user_admin_community -community_id $community_id Index: openacs-4/packages/dotlrn/www/change-site-template.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/change-site-template.tcl,v diff -u -r1.2 -r1.3 --- openacs-4/packages/dotlrn/www/change-site-template.tcl 8 Aug 2006 21:26:23 -0000 1.2 +++ openacs-4/packages/dotlrn/www/change-site-template.tcl 1 Nov 2013 21:08:30 -0000 1.3 @@ -24,7 +24,7 @@ set community_id [dotlrn_community::get_community_id] set dotlrn_package_id [dotlrn::get_package_id] -if { [empty_string_p $community_id]} { +if { $community_id eq ""} { set allowed_to_change [parameter::get -package_id $dotlrn_package_id -parameter "UserChangeSiteTemplate_p" \ -default 0] set site_template_id [dotlrn::get_site_template_id -user_id $user_id] @@ -48,8 +48,8 @@ {value $site_template_id} } } -on_submit { - if {![empty_string_p $site_templates]} { - if {[empty_string_p $community_id]} { + if {$site_templates ne ""} { + if {$community_id eq ""} { dotlrn::set_site_template_id -user_id $user_id -site_template_id $site_templates } else { dotlrn_community::set_site_template_id -community_id $community_id -site_template_id $site_templates Index: openacs-4/packages/dotlrn/www/clone.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/clone.tcl,v diff -u -r1.10 -r1.11 --- openacs-4/packages/dotlrn/www/clone.tcl 29 Sep 2013 13:49:45 -0000 1.10 +++ openacs-4/packages/dotlrn/www/clone.tcl 1 Nov 2013 21:08:30 -0000 1.11 @@ -39,8 +39,8 @@ set portal_id [dotlrn_community::get_portal_id -community_id $community_id] set top_community_type [dotlrn_community::get_toplevel_community_type_from_community_id $community_id] -if { $top_community_type != "dotlrn_club" - && $top_community_type != "dotlrn_community" } { +if { $top_community_type ne "dotlrn_club" + && $top_community_type ne "dotlrn_community" } { set class_instance_p 1 set term_id [dotlrn_class::get_term_id -class_instance_id $community_id] Index: openacs-4/packages/dotlrn/www/communities-chunk.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/communities-chunk.tcl,v diff -u -r1.12 -r1.13 --- openacs-4/packages/dotlrn/www/communities-chunk.tcl 15 May 2007 20:14:25 -0000 1.12 +++ openacs-4/packages/dotlrn/www/communities-chunk.tcl 1 Nov 2013 21:08:30 -0000 1.13 @@ -33,7 +33,7 @@ set user_id [ad_conn user_id] -if {![empty_string_p $community_type]} { +if {$community_type ne ""} { set n_communities [db_string select_all_communities_count_by_type {}] } else { set n_communities [db_string select_all_communities_count {}] @@ -45,12 +45,12 @@ {select_all_non_memberships join {}} }]]] -if {![empty_string_p $community_type]} { +if {$community_type ne ""} { append filter "_by_type" } db_multirow -extend {query referer} communities $filter {} { - if {![exists_and_not_null referer]} { + if {(![info exists referer] || $referer eq "")} { set referer "./" } set query $filter Index: openacs-4/packages/dotlrn/www/communities.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/communities.tcl,v diff -u -r1.11 -r1.12 --- openacs-4/packages/dotlrn/www/communities.tcl 29 Sep 2013 13:49:45 -0000 1.11 +++ openacs-4/packages/dotlrn/www/communities.tcl 1 Nov 2013 21:08:31 -0000 1.12 @@ -34,7 +34,7 @@ set portal_id [dotlrn::get_portal_id -user_id [ad_conn user_id]] set dotlrn_url [dotlrn::get_url] # Make sure user is logged in -set user_id [ad_maybe_redirect_for_registration] +set user_id [auth::require_login] set portlet_title [_ dotlrn.Communities] set title [_ dotlrn.Communities] set context [list [_ dotlrn.Communities]] Index: openacs-4/packages/dotlrn/www/community-edit-2.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/community-edit-2.tcl,v diff -u -r1.19 -r1.20 --- openacs-4/packages/dotlrn/www/community-edit-2.tcl 29 Sep 2013 13:49:45 -0000 1.19 +++ openacs-4/packages/dotlrn/www/community-edit-2.tcl 1 Nov 2013 21:08:31 -0000 1.20 @@ -53,7 +53,7 @@ set mime_type [ns_guesstype $header_img] -if {[empty_string_p $tmp_filename]} { +if {$tmp_filename eq ""} { set tmp_size 0 set revision_id 0 } else { @@ -64,7 +64,7 @@ # # strip off the C:\directories... crud and just get the file name -if ![regexp {([^/\\]+)$} $header_img match client_filename] { +if {![regexp {([^/\\]+)$} $header_img match client_filename]} { set client_filename $header_img } @@ -93,7 +93,7 @@ set item_id [content::item::get_id_by_name -name $logo_name -parent_id $parent_id] # if it's a new upload, create the item - if { [empty_string_p $item_id]} { + if { $item_id eq ""} { set item_id [content::item::new -name $logo_name -parent_id $parent_id -content_type image] # since it's just the header logo, which can't be accessed outside of @@ -145,7 +145,7 @@ # Font stuff # -if {[empty_string_p $header_font]} { +if {$header_font eq ""} { set header_font_text "sans-serif (None chosen)" set header_font_fragment "" } else { @@ -160,7 +160,7 @@ set header_font_size_text $header_font_size set style_fragment "font-family: $header_font_fragment Verdana, Arial, Helvetica, sans-serif; font-size: $header_font_size;" -if {[empty_string_p $header_font_color]} { +if {$header_font_color eq ""} { set header_font_color_text "[_ dotlrn.Black_None_chosen]" set header_font_color "black" } else { @@ -170,7 +170,7 @@ append style_fragment " " "color: $header_font_color;" #logo stuff -if {[empty_string_p $revision_id]} { +if {$revision_id eq ""} { set comm_type [dotlrn_community::get_community_type_from_community_id $community_id] @@ -184,7 +184,7 @@ } - if {$comm_type == "dotlrn_club"} { + if {$comm_type eq "dotlrn_club"} { #community colors set scope_name "comm" } else { @@ -251,7 +251,7 @@ header_logo_item_id \ header_logo_alt_text - if {[string equal $yes_button $yes_label]} { + if {$yes_button eq $yes_label} { dotlrn_community::set_attributes \ -community_id $community_id \ Index: openacs-4/packages/dotlrn/www/community-edit-revert.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/community-edit-revert.tcl,v diff -u -r1.8 -r1.9 --- openacs-4/packages/dotlrn/www/community-edit-revert.tcl 8 Aug 2006 21:26:23 -0000 1.8 +++ openacs-4/packages/dotlrn/www/community-edit-revert.tcl 1 Nov 2013 21:08:31 -0000 1.9 @@ -30,7 +30,7 @@ set community_id [dotlrn_community::get_community_id] dotlrn::require_user_admin_community -user_id $user_id -community_id $community_id -if {![empty_string_p $header_logo_only]} { +if {$header_logo_only ne ""} { # just blow away the header logo stuff dotlrn_community::unset_attribute \ -community_id $community_id \ @@ -49,7 +49,7 @@ set parent_id [db_string get_root_folder {}] set logo_name "community_logo_$community_id" set item_id [db_string get_item_id "" -default ""] -if { ![empty_string_p $item_id] } { +if { $item_id ne "" } { db_exec_plsql delete_cr_item "" } Index: openacs-4/packages/dotlrn/www/community-edit.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/community-edit.tcl,v diff -u -r1.16 -r1.17 --- openacs-4/packages/dotlrn/www/community-edit.tcl 3 Apr 2009 15:07:13 -0000 1.16 +++ openacs-4/packages/dotlrn/www/community-edit.tcl 1 Nov 2013 21:08:31 -0000 1.17 @@ -149,7 +149,7 @@ # Customized logos are stored in the public file-storage folder # for the community. -if {[empty_string_p $revision_id]} { +if {$revision_id eq ""} { set comm_type [dotlrn_community::get_community_type_from_community_id $community_id] @@ -163,7 +163,7 @@ } - if {$comm_type == "dotlrn_club"} { + if {$comm_type eq "dotlrn_club"} { #community colors set scope_name "comm" } else { Index: openacs-4/packages/dotlrn/www/configure-element-2.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/configure-element-2.tcl,v diff -u -r1.11 -r1.12 --- openacs-4/packages/dotlrn/www/configure-element-2.tcl 8 Aug 2006 21:26:24 -0000 1.11 +++ openacs-4/packages/dotlrn/www/configure-element-2.tcl 1 Nov 2013 21:08:31 -0000 1.12 @@ -33,7 +33,7 @@ } # Make sure user is logged in -set user_id [ad_maybe_redirect_for_registration] +set user_id [auth::require_login] portal::set_element_param $element_id $key $value Index: openacs-4/packages/dotlrn/www/configure-element.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/configure-element.tcl,v diff -u -r1.21 -r1.22 --- openacs-4/packages/dotlrn/www/configure-element.tcl 16 Apr 2009 11:00:17 -0000 1.21 +++ openacs-4/packages/dotlrn/www/configure-element.tcl 1 Nov 2013 21:08:31 -0000 1.22 @@ -33,7 +33,7 @@ ad_script_abort } -set user_id [ad_maybe_redirect_for_registration] +set user_id [auth::require_login] if {[parameter::get -parameter community_level_p] == 1} { @@ -49,7 +49,7 @@ } else { set portal_id [dotlrn::get_portal_id -user_id $user_id] - if {[empty_string_p $portal_id]} { + if {$portal_id eq ""} { # do something ad_returnredirect "./" } else { Index: openacs-4/packages/dotlrn/www/courses.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/courses.tcl,v diff -u -r1.5 -r1.6 --- openacs-4/packages/dotlrn/www/courses.tcl 29 Sep 2013 13:49:45 -0000 1.5 +++ openacs-4/packages/dotlrn/www/courses.tcl 1 Nov 2013 21:08:31 -0000 1.6 @@ -34,7 +34,7 @@ set portal_id [dotlrn::get_portal_id -user_id [ad_conn user_id]] set dotlrn_url [dotlrn::get_url] # Make sure user is logged in -set user_id [ad_maybe_redirect_for_registration] +set user_id [auth::require_login] set portlet_title [_ dotlrn.Courses] set title [_ dotlrn.Courses] set context [list [_ dotlrn.Courses]] Index: openacs-4/packages/dotlrn/www/deregister-confirm.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/deregister-confirm.tcl,v diff -u -r1.4 -r1.5 --- openacs-4/packages/dotlrn/www/deregister-confirm.tcl 8 Aug 2006 21:26:24 -0000 1.4 +++ openacs-4/packages/dotlrn/www/deregister-confirm.tcl 1 Nov 2013 21:08:31 -0000 1.5 @@ -26,14 +26,14 @@ {referer ""} } -ad_maybe_redirect_for_registration +auth::require_login set time_per_user 15 set num_users_display_limit 99 set num_users [llength $user_id] -set num_seconds [expr $time_per_user*$num_users] -set num_minutes [expr $num_seconds/60] +set num_seconds [expr {$time_per_user*$num_users}] +set num_minutes [expr {$num_seconds/60}] # Note: This query will not work (in Oracle) # if num_users_display_limit is over 100. Index: openacs-4/packages/dotlrn/www/deregister.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/deregister.tcl,v diff -u -r1.9 -r1.10 --- openacs-4/packages/dotlrn/www/deregister.tcl 8 Aug 2006 21:26:24 -0000 1.9 +++ openacs-4/packages/dotlrn/www/deregister.tcl 1 Nov 2013 21:08:31 -0000 1.10 @@ -36,13 +36,13 @@ # wouldn't break. This does have the unfortunate consequence that the name # user_id is not intuative when it is a list of many user_ids. (teadams@alum.mit.edu) -ad_maybe_redirect_for_registration +auth::require_login -if {[empty_string_p $community_id]} { +if {$community_id eq ""} { set community_id [dotlrn_community::get_community_id] } -if {[empty_string_p $user_id]} { +if {$user_id eq ""} { set user_id [ad_conn user_id] } else { dotlrn::require_user_admin_community -community_id $community_id Index: openacs-4/packages/dotlrn/www/dotlrn-main-portlet.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/dotlrn-main-portlet.tcl,v diff -u -r1.20 -r1.21 --- openacs-4/packages/dotlrn/www/dotlrn-main-portlet.tcl 10 Jul 2009 16:22:25 -0000 1.20 +++ openacs-4/packages/dotlrn/www/dotlrn-main-portlet.tcl 1 Nov 2013 21:08:31 -0000 1.21 @@ -24,19 +24,19 @@ } { } -if {![exists_and_not_null show_buttons_p]} { +if {(![info exists show_buttons_p] || $show_buttons_p eq "")} { set show_buttons_p 0 } -if {![exists_and_not_null show_archived_p]} { +if {(![info exists show_archived_p] || $show_archived_p eq "")} { set show_archived_p 0 } #DRB: This is a hack that depends on .LRN having clubs and classes. Done quickly for #theme-selva for .LRN 2.2. set community_type_clause "" -if { [exists_and_not_null community_filter] } { +if { ([info exists community_filter] && $community_filter ne "") } { set show_subtitle_p 0 if { $community_filter eq "class_instances" } { set community_type_clause "and dotlrn_communities_all.community_type not in ('dotlrn_community', 'dotlrn_club', 'dotlrn_pers_community')" @@ -67,30 +67,30 @@ set intra_type_ul_tags "" set previous_type_ul_tags "" set new_type_p 0 - if {![string equal $simple_community_type dotlrn_community]} { + if {$simple_community_type ne "dotlrn_community" } { set comm_type $simple_community_type } else { set simple_community_type $comm_type } #Checking for existence of old_simple_community_type gives us an #easy way to detect the first row. Don't pre-define it! if { ![info exists old_simple_community_type] || - ![string equal $old_simple_community_type $simple_community_type] } { + $old_simple_community_type ne $simple_community_type } { set base_level $tree_level set new_type_p 1 } if { [info exists old_simple_community_type] && - ![string equal $old_simple_community_type $simple_community_type] } { + $old_simple_community_type ne $simple_community_type } { append previous_type_ul_tags [string repeat "" $old_depth] set old_depth 0 } - set depth [expr $tree_level - $base_level] + set depth [expr {$tree_level - $base_level}] if { $depth > $old_depth } { - append intra_type_ul_tags [string repeat "

    • " [expr $depth - $old_depth]] + append intra_type_ul_tags [string repeat "
      • " [expr {$depth - $old_depth}]] } if { $old_depth > $depth } { - append intra_type_ul_tags [string repeat "
      " [expr $old_depth - $depth]] + append intra_type_ul_tags [string repeat "
    " [expr {$old_depth - $depth}]] append intra_type_ul_tags "
  • " } if { $depth == $old_depth && !$new_type_p } { Index: openacs-4/packages/dotlrn/www/dotlrn-master-custom.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/dotlrn-master-custom.tcl,v diff -u -r1.4 -r1.5 --- openacs-4/packages/dotlrn/www/dotlrn-master-custom.tcl 29 Sep 2013 13:49:45 -0000 1.4 +++ openacs-4/packages/dotlrn/www/dotlrn-master-custom.tcl 1 Nov 2013 21:08:31 -0000 1.5 @@ -2,7 +2,7 @@ set community_id [dotlrn_community::get_community_id] set dotlrn_package_id [dotlrn::get_package_id] -if {![empty_string_p $community_id]} { +if {$community_id ne ""} { set dotlrn_master [dotlrn_community::get_dotlrn_master -community_id $community_id] } elseif {$user_id } { set dotlrn_master [dotlrn::get_dotlrn_master -user_id $user_id] @@ -12,11 +12,11 @@ } # Set page title -if { ![info exists doc(title)] && [exists_and_not_null title] } { +if { ![info exists doc(title)] && [info exists title] && $title ne "" } { set doc(title) $title -} elseif { [info exists doc(title)] && ![exists_and_not_null title] } { +} elseif { [info exists doc(title)] && ![info exists title] || $title eq "" } { set title $doc(title) -} elseif { ![info exists doc(title)] && [exists_and_not_null title] } { +} elseif { ![info exists doc(title)] && [info exists title] && $title ne "" } { set title [ad_system_name] set doc(title) $title } Index: openacs-4/packages/dotlrn/www/dotlrn-master-kelp.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/dotlrn-master-kelp.tcl,v diff -u -r1.6 -r1.7 --- openacs-4/packages/dotlrn/www/dotlrn-master-kelp.tcl 29 Sep 2013 13:49:45 -0000 1.6 +++ openacs-4/packages/dotlrn/www/dotlrn-master-kelp.tcl 1 Nov 2013 21:08:31 -0000 1.7 @@ -69,7 +69,7 @@ set td_align "align=\"center\" valign=\"top\"" -if {![empty_string_p $community_id]} { +if {$community_id ne ""} { set have_comm_id_p 1 } else { set have_comm_id_p 0 @@ -79,7 +79,7 @@ # navbar vars set show_navbar_p 1 -if {[exists_and_not_null no_navbar_p] && $no_navbar_p} { +if {([info exists no_navbar_p] && $no_navbar_p ne "") && $no_navbar_p} { set show_navbar_p 0 } @@ -97,7 +97,7 @@ set link_control_panel 1 } -if { ![string equal [ad_conn package_key] [dotlrn::package_key]] } { +if { [ad_conn package_key] ne [dotlrn::package_key] } { # Peter M: We are in a package (an application) that may or may not be under a dotlrn instance # (i.e. in a news instance of a class) # and we want all links in the navbar to be active so the user can return easily to the class homepage @@ -157,7 +157,7 @@ set user_name [acs_user::get_element -user_id [ad_conn untrusted_user_id] -element name] } -if {![exists_and_not_null title]} { +if {(![info exists title] || $title eq "")} { set title [ad_system_name] } @@ -171,7 +171,7 @@ set control_panel_text [_ "dotlrn.control_panel"] -if {![empty_string_p $community_id]} { +if {$community_id ne ""} { # in a community or just under one in a mounted package like /calendar set comm_type [dotlrn_community::get_community_type_from_community_id $community_id] set control_panel_text [_ acs-subsite.Admin] @@ -181,7 +181,7 @@ set comm_type [dotlrn_community::get_community_type_from_community_id [dotlrn_community::get_parent_id -community_id $community_id]] } - if {$comm_type == "dotlrn_club"} { + if {$comm_type eq "dotlrn_club"} { #community colors set scope_name "comm" set scope_main_color "#" @@ -223,7 +223,7 @@ -attribute_name header_font ] - if {![empty_string_p $community_header_font]} { + if {$community_header_font ne ""} { set header_font "$community_header_font,$header_font" } @@ -244,7 +244,7 @@ -attribute_name header_logo_item_id ] - if {![empty_string_p $header_logo_item_id]} { + if {$header_logo_item_id ne ""} { # Need filename set item_id [content::revision::item_id -revision_id $header_logo_item_id] set header_img_url "[subsite::get_url]image/$item_id" @@ -256,13 +256,13 @@ -attribute_name header_logo_alt_text ] - if {![empty_string_p $header_logo_alt_text]} { + if {$header_logo_alt_text ne ""} { set header_img_alt_text $header_logo_alt_text } set text [dotlrn::user_context_bar -community_id $community_id] - if { [string equal [ad_conn package_key] [dotlrn::package_key]] } { + if {[ad_conn package_key] eq [dotlrn::package_key]} { set text "$text" } Index: openacs-4/packages/dotlrn/www/dotlrn-master.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/dotlrn-master.tcl,v diff -u -r1.41 -r1.42 --- openacs-4/packages/dotlrn/www/dotlrn-master.tcl 29 Sep 2013 13:49:45 -0000 1.41 +++ openacs-4/packages/dotlrn/www/dotlrn-master.tcl 1 Nov 2013 21:08:31 -0000 1.42 @@ -70,7 +70,7 @@ set td_align "align=\"center\" valign=\"top\"" -if {![empty_string_p $community_id]} { +if {$community_id ne ""} { set have_comm_id_p 1 } else { set have_comm_id_p 0 @@ -80,15 +80,15 @@ # navbar vars set show_navbar_p 1 -if {[exists_and_not_null no_navbar_p] && $no_navbar_p} { +if {[info exists no_navbar_p] && $no_navbar_p} { set show_navbar_p 0 } -if { [empty_string_p $community_id] && \ - [parameter::get \ - -parameter hide_personal_portal_p \ - -package_id [dotlrn::get_package_id] \ - -default 0] } { +if { $community_id eq "" && + [parameter::get \ + -parameter hide_personal_portal_p \ + -package_id [dotlrn::get_package_id] \ + -default 0] } { #We're not in a community portal, and we've been asked to #hide the personal portal. set show_navbar_p 0 @@ -108,7 +108,7 @@ set link_control_panel 1 } -if { ![string equal [ad_conn package_key] [dotlrn::package_key]] } { +if { [ad_conn package_key] ne [dotlrn::package_key] } { # Peter M: We are in a package (an application) that may or may not be under a dotlrn instance # (i.e. in a news instance of a class) # and we want all links in the navbar to be active so the user can return easily to the class homepage @@ -168,7 +168,7 @@ set user_name [acs_user::get_element -user_id [ad_conn untrusted_user_id] -element name] } -if {![exists_and_not_null title]} { +if {![info exists title] || $title eq ""} { set title [ad_system_name] } @@ -182,7 +182,7 @@ set control_panel_text [_ "dotlrn.control_panel"] -if {![empty_string_p $community_id]} { +if {$community_id ne ""} { # in a community or just under one in a mounted package like /calendar set comm_type [dotlrn_community::get_community_type_from_community_id $community_id] set control_panel_text [_ acs-subsite.Admin] @@ -192,7 +192,7 @@ set comm_type [dotlrn_community::get_community_type_from_community_id [dotlrn_community::get_parent_id -community_id $community_id]] } - if {$comm_type == "dotlrn_club"} { + if {$comm_type eq "dotlrn_club"} { #community colors set scope_name "comm" set scope_main_color "#CC6633" @@ -234,7 +234,7 @@ -attribute_name header_font ] - if {![empty_string_p $community_header_font]} { + if {$community_header_font ne ""} { set header_font "$community_header_font,$header_font" } @@ -255,7 +255,7 @@ -attribute_name header_logo_item_id ] - if {![empty_string_p $header_logo_item_id]} { + if {$header_logo_item_id ne ""} { # Need filename set item_id [content::revision::item_id -revision_id $header_logo_item_id] set header_img_url "[subsite::get_url]image/$item_id" @@ -267,13 +267,13 @@ -attribute_name header_logo_alt_text ] - if {![empty_string_p $header_logo_alt_text]} { + if {$header_logo_alt_text ne ""} { set header_img_alt_text $header_logo_alt_text } set text [dotlrn::user_context_bar -community_id $community_id] - if { [string equal [ad_conn package_key] [dotlrn::package_key]] } { + if {[ad_conn package_key] eq [dotlrn::package_key]} { set text "$text" } @@ -340,7 +340,7 @@ # Hack for title and context bar outside of dotlrn -set in_dotlrn_p [expr [string match "[dotlrn::get_url]/*" [ad_conn url]]] +set in_dotlrn_p [expr {[string match "[dotlrn::get_url]/*" [ad_conn url]]}] if { [info exists context] } { set context_bar [eval ad_context_bar -- $context] Index: openacs-4/packages/dotlrn/www/element-rename.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/element-rename.tcl,v diff -u -r1.2 -r1.3 --- openacs-4/packages/dotlrn/www/element-rename.tcl 8 Aug 2006 21:26:24 -0000 1.2 +++ openacs-4/packages/dotlrn/www/element-rename.tcl 1 Nov 2013 21:08:31 -0000 1.3 @@ -18,7 +18,7 @@ template::form create element_rename -if [template::form is_valid element_rename] { +if {[template::form is_valid element_rename]} { ns_log notice "-element_id $element_id -pretty_name $pretty_name" portal::set_pretty_name -element_id $element_id -pretty_name $pretty_name ad_returnredirect "element-list" Index: openacs-4/packages/dotlrn/www/index-not-a-user.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/index-not-a-user.tcl,v diff -u -r1.17 -r1.18 --- openacs-4/packages/dotlrn/www/index-not-a-user.tcl 8 Aug 2006 21:26:24 -0000 1.17 +++ openacs-4/packages/dotlrn/www/index-not-a-user.tcl 1 Nov 2013 21:08:31 -0000 1.18 @@ -45,13 +45,13 @@ -default {}] ","] # A star is enough - if { [lsearch -exact $auth_add_auths "*"] == -1 } { + if {"*" ni $auth_add_auths} { # No star set authority_id [acs_user::get_element -user_id [ad_conn user_id] -element authority_id] set authority_short_name [auth::authority::get_element -authority_id $authority_id -element short_name] # If not a star, then this user's authority needs to be named - if { [lsearch -exact $auth_add_auths $authority_short_name] == -1 } { + if {$authority_short_name ni $auth_add_auths} { # Nope, authority not listed, either set auto_add_p 0 } Index: openacs-4/packages/dotlrn/www/index.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/index.tcl,v diff -u -r1.47 -r1.48 --- openacs-4/packages/dotlrn/www/index.tcl 13 Mar 2008 17:28:26 -0000 1.47 +++ openacs-4/packages/dotlrn/www/index.tcl 1 Nov 2013 21:08:31 -0000 1.48 @@ -36,7 +36,7 @@ ad_script_abort } -set user_id [ad_maybe_redirect_for_registration] +set user_id [auth::require_login] if {![dotlrn::user_p -user_id $user_id]} { ad_returnredirect "index-not-a-user" Index: openacs-4/packages/dotlrn/www/join-policy-toggle.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/join-policy-toggle.tcl,v diff -u -r1.9 -r1.10 --- openacs-4/packages/dotlrn/www/join-policy-toggle.tcl 8 Aug 2006 21:26:24 -0000 1.9 +++ openacs-4/packages/dotlrn/www/join-policy-toggle.tcl 1 Nov 2013 21:08:31 -0000 1.10 @@ -26,11 +26,7 @@ {referer "one-community-admin"} } -validate { policy_ck -requires {policy:notnull} { - if {!( - [string equal $policy "open"] == 1 || - [string equal $policy "needs approval"] == 1 || - [string equal $policy "closed"] == 1 - )} { + if {$policy ni {open needs approval closed}} { ad_complain [_ dotlrn.lt_policy_must_be_one_of] } } @@ -40,7 +36,7 @@ # i.e. AllowChangeEnrollmentPolicy dotlrn_portlet::is_allowed -parameter cenrollment -if {[empty_string_p $community_id]} { +if {$community_id eq ""} { set community_id [dotlrn_community::get_community_id] } Index: openacs-4/packages/dotlrn/www/manage-memberships.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/manage-memberships.tcl,v diff -u -r1.20 -r1.21 --- openacs-4/packages/dotlrn/www/manage-memberships.tcl 14 Jul 2009 10:07:35 -0000 1.20 +++ openacs-4/packages/dotlrn/www/manage-memberships.tcl 1 Nov 2013 21:08:31 -0000 1.21 @@ -122,7 +122,7 @@ set member_query "select_member_classes" -if {![empty_string_p $member_department_key]} { +if {$member_department_key ne ""} { append member_query "_by_department" } @@ -247,7 +247,7 @@ set non_member_query "select_non_member_classes" -if {![empty_string_p $non_member_department_key]} { +if {$non_member_department_key ne ""} { append non_member_query "_by_department" } Index: openacs-4/packages/dotlrn/www/member-add-2.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/member-add-2.tcl,v diff -u -r1.15 -r1.16 --- openacs-4/packages/dotlrn/www/member-add-2.tcl 15 May 2009 21:35:41 -0000 1.15 +++ openacs-4/packages/dotlrn/www/member-add-2.tcl 1 Nov 2013 21:08:31 -0000 1.16 @@ -60,7 +60,7 @@ if {$member_p} { set existing_role [dotlrn_community::get_role_pretty_name -community_id $community_id -rel_type [db_string select_role {}]] - if {[empty_string_p $existing_role]} { + if {$existing_role eq ""} { set existing_role "member" } } Index: openacs-4/packages/dotlrn/www/member-confirm.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/member-confirm.tcl,v diff -u -r1.2 -r1.3 --- openacs-4/packages/dotlrn/www/member-confirm.tcl 8 Aug 2006 21:26:24 -0000 1.2 +++ openacs-4/packages/dotlrn/www/member-confirm.tcl 1 Nov 2013 21:08:32 -0000 1.3 @@ -13,7 +13,7 @@ set community_id [dotlrn_community::get_community_id] -if { [exists_and_not_null user_id] } { +if { ([info exists user_id] && $user_id ne "") } { # we're dropping just one user set page_title "Drop Membership" set confirm_message "Are you sure you want to remove this user from this community ?" @@ -22,7 +22,7 @@ # we're dropping a group of members set rel_types [dotlrn_community::get_roles -community_id $community_id] foreach role $rel_types { - if { [string equal $reltype [lindex $role 0]] } { + if {$reltype eq [lindex $role 0]} { set role_shortname [lang::util::localize [lindex $role 0]] set role_prettyname [lang::util::localize [lindex $role 2]] } Index: openacs-4/packages/dotlrn/www/members-chunk-table.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/members-chunk-table.tcl,v diff -u -r1.28 -r1.29 --- openacs-4/packages/dotlrn/www/members-chunk-table.tcl 21 Dec 2006 15:57:53 -0000 1.28 +++ openacs-4/packages/dotlrn/www/members-chunk-table.tcl 1 Nov 2013 21:08:32 -0000 1.29 @@ -55,8 +55,8 @@ set admin_p 1 } -if {![exists_and_not_null referer]} { - if {[string equal $admin_p t] == 1} { +if {(![info exists referer] || $referer eq "")} { + if {$admin_p == "t"} { set referer "one-community-admin" } else { set referer "one-community" @@ -67,7 +67,7 @@ set parent_community_name [dotlrn_community::get_parent_name -community_id $community_id] set community_name [dotlrn_community::get_community_name $community_id] -if {[string compare $order_direction "asc"]==0} { +if {$order_direction eq "asc" } { set order_html "" set opposite_order_direction "desc" } else { Index: openacs-4/packages/dotlrn/www/members-chunk.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/members-chunk.tcl,v diff -u -r1.21 -r1.22 --- openacs-4/packages/dotlrn/www/members-chunk.tcl 29 Sep 2013 13:49:45 -0000 1.21 +++ openacs-4/packages/dotlrn/www/members-chunk.tcl 1 Nov 2013 21:08:32 -0000 1.22 @@ -41,8 +41,8 @@ set read_private_data_p 1 } -if {![exists_and_not_null referer]} { - if {[string equal $admin_p "t"] == 1} { +if {(![info exists referer] || $referer eq "")} { + if {$admin_p == "t"} { set referer "one-community-admin" } else { set referer "one-community" Index: openacs-4/packages/dotlrn/www/members.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/members.tcl,v diff -u -r1.31 -r1.32 --- openacs-4/packages/dotlrn/www/members.tcl 29 Sep 2013 13:49:45 -0000 1.31 +++ openacs-4/packages/dotlrn/www/members.tcl 1 Nov 2013 21:08:32 -0000 1.32 @@ -31,13 +31,13 @@ set context [list [list "one-community-admin" [_ dotlrn.Admin]] [_ dotlrn.Manage_Members]] set community_id [dotlrn_community::get_community_id] set spam_p [dotlrn::user_can_spam_community_p -user_id [ad_conn user_id] -community_id $community_id] -set approval_policy_p [string eq [group::join_policy -group_id $community_id] "needs approval"] +set approval_policy_p [string equal [group::join_policy -group_id $community_id] "needs approval"] set subcomm_p [dotlrn_community::subcommunity_p -community_id $community_id] set referer [ns_conn url] set return_url "[ns_conn url]?[ns_conn query]" -set csv_p [exists_and_not_null csv] +set csv_p ([info exists csv] && $csv ne "") set site_wide_admin_p [permission::permission_p -object_id [acs_magic_object security_context_root] -privilege admin] @@ -47,8 +47,8 @@ set admin_p 1 } -if {![exists_and_not_null referer]} { - if {[string equal $admin_p t] == 1} { +if {(![info exists referer] || $referer eq "")} { + if {$admin_p == "t"} { set referer "one-community-admin" } else { set referer "one-community" @@ -231,7 +231,7 @@ } -if {[exists_and_not_null reset] && [exists_and_not_null reltype]} { +if {([info exists reset] && $reset ne "") && ([info exists reltype] && $reltype ne "")} { set result "" db_multirow reset_members select_members {} { rp_form_put user_id $member_id Index: openacs-4/packages/dotlrn/www/my-communities.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/my-communities.tcl,v diff -u -r1.10 -r1.11 --- openacs-4/packages/dotlrn/www/my-communities.tcl 8 Aug 2006 21:26:24 -0000 1.10 +++ openacs-4/packages/dotlrn/www/my-communities.tcl 1 Nov 2013 21:08:32 -0000 1.11 @@ -25,7 +25,7 @@ communities:multirow } -set user_id [ad_maybe_redirect_for_registration] +set user_id [auth::require_login] set user_can_browse_p [dotlrn::user_can_browse_p -user_id $user_id] if {![info exists referer]} { Index: openacs-4/packages/dotlrn/www/one-community-type.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/one-community-type.tcl,v diff -u -r1.24 -r1.25 --- openacs-4/packages/dotlrn/www/one-community-type.tcl 8 Aug 2006 21:26:24 -0000 1.24 +++ openacs-4/packages/dotlrn/www/one-community-type.tcl 1 Nov 2013 21:08:32 -0000 1.25 @@ -56,15 +56,15 @@ set description [lang::util::localize $description] -if {[string equal ${community_type} dotlrn_class_instance] != 0} { +if {$community_type eq "dotlrn_class_instance"} { set community_type_title [parameter::get -localize -parameter classes_pretty_plural] set communities_title [parameter::get -localize -parameter class_instances_pretty_name] set title [parameter::get -localize -parameter classes_pretty_plural] -} elseif {[string equal ${community_type} dotlrn_club] != 0} { +} elseif {$community_type eq "dotlrn_club"} { set community_type_title [parameter::get -localize -parameter clubs_pretty_plural] set communities_title [parameter::get -localize -parameter clubs_pretty_plural] set title [parameter::get -localize -parameter clubs_pretty_plural] -} elseif {[string equal ${ancestor_type} dotlrn_class_instance] != 0} { +} elseif {$ancestor_type eq "dotlrn_class_instance"} { set community_type_title [parameter::get -localize -parameter classes_pretty_plural] set communities_title [parameter::get -localize -parameter class_instances_pretty_name] set title [lang::util::localize $pretty_name] Index: openacs-4/packages/dotlrn/www/privacy-policy-toggle.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/privacy-policy-toggle.tcl,v diff -u -r1.3 -r1.4 --- openacs-4/packages/dotlrn/www/privacy-policy-toggle.tcl 8 Aug 2006 21:26:24 -0000 1.3 +++ openacs-4/packages/dotlrn/www/privacy-policy-toggle.tcl 1 Nov 2013 21:08:32 -0000 1.4 @@ -26,24 +26,21 @@ {referer "one-community-admin"} } -validate { policy_ck -requires {policy:notnull} { - if {!( - [string equal $policy "yes"] == 1 || - [string equal $policy "no"] == 1 - )} { + if {$policy ni {yes no}} { ad_complain [_ dotlrn.prv_policy_must_be_one_of] } } } -if {[empty_string_p $community_id]} { +if {$community_id eq ""} { set community_id [dotlrn_community::get_community_id] } #Only dotlrn-wide admins should be able to set privacy policies, #per discussion with Dee. -AG dotlrn::require_admin -if { [string equal $policy "yes"] } { +if {$policy eq "yes"} { dotlrn_privacy::grant_read_private_data_to_guests -object_id $community_id } else { dotlrn_privacy::revoke_read_private_data_from_guests -object_id $community_id Index: openacs-4/packages/dotlrn/www/register-link.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/register-link.tcl,v diff -u -r1.2 -r1.3 --- openacs-4/packages/dotlrn/www/register-link.tcl 15 May 2007 20:14:25 -0000 1.2 +++ openacs-4/packages/dotlrn/www/register-link.tcl 1 Nov 2013 21:08:32 -0000 1.3 @@ -14,18 +14,18 @@ } -errors { } -if { ![exists_and_not_null url] } { +if { (![info exists url] || $url eq "") } { set base_url "register" } else { set base_url $url } -if { [exists_and_not_null referer] } { +if { ([info exists referer] && $referer ne "") } { set url "[export_vars -base $base_url {community_id}]&referer=$referer" } else { set url [export_vars -base $base_url {community_id}] } -if { ![exists_and_not_null label] } { +if { (![info exists label] || $label eq "") } { set label [_ dotlrn.Join] } Index: openacs-4/packages/dotlrn/www/register.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/register.tcl,v diff -u -r1.16 -r1.17 --- openacs-4/packages/dotlrn/www/register.tcl 29 Sep 2013 13:49:45 -0000 1.16 +++ openacs-4/packages/dotlrn/www/register.tcl 1 Nov 2013 21:08:32 -0000 1.17 @@ -27,7 +27,7 @@ {referer "./"} } -if { ! [parameter::get -parameter SelfRegistrationP -package_id [dotlrn::get_package_id] -default 1] } { +if { ![parameter::get -parameter SelfRegistrationP -package_id [dotlrn::get_package_id] -default 1] } { set redirect_to [parameter::get -parameter SelfRegistrationRedirectTo -package_id [dotlrn::get_package_id] -default ""] if { $redirect_to ne "" } { @@ -38,13 +38,13 @@ ad_script_abort } -ad_maybe_redirect_for_registration +auth::require_login -if {[empty_string_p $community_id]} { +if {$community_id eq ""} { set community_id [dotlrn_community::get_community_id] } -if {[empty_string_p $user_id]} { +if {$user_id eq ""} { set user_id [ad_conn user_id] } else { dotlrn::require_user_admin_community -community_id $community_id @@ -61,8 +61,11 @@ # This should prevent most double clicks, leaving # the catch below to trap the rest. -if { [dotlrn_community::member_p $community_id $user_id] || \ - ([string equal $join_policy "needs approval"] && [dotlrn_community::member_pending_p -community_id $community_id -user_id $user_id]) } { +if { [dotlrn_community::member_p $community_id $user_id] || + ($join_policy eq "needs approval" + && [dotlrn_community::member_pending_p -community_id $community_id -user_id $user_id] + ) + } { ad_returnredirect $referer ad_script_abort } Index: openacs-4/packages/dotlrn/www/reject.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/reject.tcl,v diff -u -r1.8 -r1.9 --- openacs-4/packages/dotlrn/www/reject.tcl 8 Aug 2006 21:26:24 -0000 1.8 +++ openacs-4/packages/dotlrn/www/reject.tcl 1 Nov 2013 21:08:32 -0000 1.9 @@ -26,14 +26,14 @@ {referer "./"} } -ad_maybe_redirect_for_registration +auth::require_login -if {[empty_string_p $community_id]} { +if {$community_id eq ""} { set community_id [dotlrn_community::get_community_id] } foreach uid $user_id { - if {[empty_string_p $uid]} { + if {$uid eq ""} { set uid [ad_conn user_id] } else { dotlrn::require_user_admin_community -community_id $community_id Index: openacs-4/packages/dotlrn/www/spam-2.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/spam-2.tcl,v diff -u -r1.9 -r1.10 --- openacs-4/packages/dotlrn/www/spam-2.tcl 8 Aug 2006 21:26:24 -0000 1.9 +++ openacs-4/packages/dotlrn/www/spam-2.tcl 1 Nov 2013 21:08:32 -0000 1.10 @@ -33,9 +33,9 @@ form get_values spam_message subject message format -if {$format == "html"} { +if {$format eq "html"} { set preview_message "$message" -} elseif {$format == "pre"} { +} elseif {$format eq "pre"} { set preview_message [ad_text_to_html $message] } else { set preview_message [ad_quotehtml $message] Index: openacs-4/packages/dotlrn/www/spam-policy-toggle.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/spam-policy-toggle.tcl,v diff -u -r1.3 -r1.4 --- openacs-4/packages/dotlrn/www/spam-policy-toggle.tcl 8 Aug 2006 21:26:24 -0000 1.3 +++ openacs-4/packages/dotlrn/www/spam-policy-toggle.tcl 1 Nov 2013 21:08:32 -0000 1.4 @@ -23,22 +23,19 @@ {referer "one-community-admin"} } -validate { policy_ck -requires {policy:notnull} { - if {!( - [string equal $policy "all"] == 1 || - [string equal $policy "admins"] == 1 - )} { + if { $policy ni {all admins} } { ad_complain [_ dotlrn.lt_spam_policy_must_be_o] } } } -if {[empty_string_p $community_id]} { +if {$community_id eq ""} { set community_id [dotlrn_community::get_community_id] } dotlrn::require_user_admin_community -community_id $community_id -if { [string equal $policy all] } { +if {$policy eq "all"} { set action "grant" } else { set action "revoke" Index: openacs-4/packages/dotlrn/www/spam-recipients.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/spam-recipients.tcl,v diff -u -r1.6 -r1.7 --- openacs-4/packages/dotlrn/www/spam-recipients.tcl 11 Mar 2008 14:49:00 -0000 1.6 +++ openacs-4/packages/dotlrn/www/spam-recipients.tcl 1 Nov 2013 21:08:32 -0000 1.7 @@ -7,7 +7,7 @@ set spam_name [bulk_mail::parameter -parameter PrettyName -default [_ dotlrn.Spam]] set context_bar [list [list $referer [_ dotlrn.Admin]] "$spam_name [_ dotlrn.Community]"] -if { ![exists_and_not_null community_id] } { +if { (![info exists community_id] || $community_id eq "") } { set community_id [dotlrn_community::get_community_id] } set community_name [dotlrn_community::get_community_name $community_id] Index: openacs-4/packages/dotlrn/www/spam.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/spam.tcl,v diff -u -r1.30 -r1.31 --- openacs-4/packages/dotlrn/www/spam.tcl 29 Sep 2013 13:49:45 -0000 1.30 +++ openacs-4/packages/dotlrn/www/spam.tcl 1 Nov 2013 21:08:32 -0000 1.31 @@ -43,20 +43,20 @@ recipients_specified { set recipients_p 0 - if {[info exists rel_types] && ![empty_string_p $rel_types]} { + if {[info exists rel_types] && $rel_types ne ""} { set recipients_p 1 - } elseif {[info exists recipients] && ![empty_string_p $recipients]} { + } elseif {[info exists recipients] && $recipients ne ""} { set recipients_p 1 } elseif {[info exists spam_all] && $spam_all != 0} { set recipients_p 1 - } elseif { [info exists rel_types_str] && ![empty_string_p $rel_types_str] } { + } elseif { [info exists rel_types_str] && $rel_types_str ne "" } { set recipients_p 1 - } elseif { [info exists recipients_str] && ![empty_string_p $recipients_str] } { + } elseif { [info exists recipients_str] && $recipients_str ne "" } { set recipients_p 1 } if { $recipients_p == 0} { - if {[exists_and_not_null community_id]} { + if {([info exists community_id] && $community_id ne "")} { # This is call using the old URL reference ad_returnredirect "spam-recipients?referer=$referer" } else { @@ -65,10 +65,10 @@ } } if_bad_combination { - if { ![empty_string_p $rel_types] && ![empty_string_p $recipients] } { + if { $rel_types ne "" && $recipients ne "" } { ad_complain "If you select a role, you can't select people at the same time." } - if { $spam_all && ( ![empty_string_p $rel_types] || ![empty_string_p $recipients] ) } { + if { $spam_all && ( $rel_types ne "" || $recipients ne "" ) } { ad_complain "You can't select roles or recipients if you have selected the \"send to everyone\" option" } } @@ -81,7 +81,7 @@ set spam_name [bulk_mail::parameter -parameter PrettyName -default [_ dotlrn.Spam_]] set context [list [list $referer [_ dotlrn.Admin]] "$spam_name [_ dotlrn.Community]"] -if {[empty_string_p $community_id]} { +if {$community_id eq ""} { set community_id [dotlrn_community::get_community_id] } @@ -175,13 +175,13 @@ set community_name [dotlrn_community::get_community_name $community_id] set community_url "[parameter::get -package_id [ad_acs_kernel_id] -parameter SystemURL][dotlrn_community::get_community_url $community_id]" - if { ![empty_string_p $recipients_str] } { + if { $recipients_str ne "" } { set recipients_str [join [split $recipients_str] ,] append who_will_receive_this_clause [db_map recipients_clause] } - if { ![empty_string_p $rel_types_str] } { + if { $rel_types_str ne "" } { set rel_types_str "'[join [split $rel_types_str] ',']'" append who_will_receive_this_clause [db_map rel_types_clause] } @@ -201,10 +201,10 @@ set query [db_map sender_info] - if {$format == "html"} { + if {$format eq "html"} { set message "$message" set message_type "html" - } elseif {$format == "pre"} { + } elseif {$format eq "pre"} { set message [ad_text_to_html $message] set message_type "html" } else { @@ -230,7 +230,7 @@ set confirm_data [form export] append confirm_data {} - template::set_file "[file dir $__adp_stub]/spam-2" + template::set_file "[file dirname $__adp_stub]/spam-2" } Index: openacs-4/packages/dotlrn/www/subcommunity-archive.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/subcommunity-archive.tcl,v diff -u -r1.10 -r1.11 --- openacs-4/packages/dotlrn/www/subcommunity-archive.tcl 29 Sep 2013 13:49:45 -0000 1.10 +++ openacs-4/packages/dotlrn/www/subcommunity-archive.tcl 1 Nov 2013 21:08:32 -0000 1.11 @@ -26,7 +26,7 @@ title:onevalue } -if {[empty_string_p $community_id]} { +if {$community_id eq ""} { set community_id [dotlrn_community::get_community_id] } @@ -68,7 +68,7 @@ if {[form is_valid archive_form]} { form get_values archive_form community_id referer no_button yes_button - if {[string equal $yes_button $yes_label]} { + if {$yes_button eq $yes_label} { db_transaction { set subcomm_id [dotlrn_community::archive \ Index: openacs-4/packages/dotlrn/www/subcommunity-new.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/subcommunity-new.tcl,v diff -u -r1.25 -r1.26 --- openacs-4/packages/dotlrn/www/subcommunity-new.tcl 29 Sep 2013 13:49:45 -0000 1.25 +++ openacs-4/packages/dotlrn/www/subcommunity-new.tcl 1 Nov 2013 21:08:32 -0000 1.26 @@ -80,8 +80,8 @@ set extra_vars [ns_set create] ns_set put $extra_vars join_policy $join_policy - if {![string equal $parent_type [dotlrn_club::community_type]] && - ![string equal $parent_type dotlrn_community]} { + if {$parent_type ne [dotlrn_club::community_type] && + $parent_type ne "dotlrn_community" } { # we want to make a subgroup of a class instance # get the term_id, since the subgroup should not # outlive the class @@ -110,8 +110,8 @@ -privilege admin # for a subcomm of a "class instance" set the start and end dates - if {![string equal $parent_type [dotlrn_club::community_type]] && - ![string equal $parent_type "dotlrn_community"]} { + if {$parent_type ne [dotlrn_club::community_type] && + $parent_type ne "dotlrn_community" } { dotlrn_community::set_active_dates \ -community_id $subcomm_id \ Index: openacs-4/packages/dotlrn/www/subscribe-members.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/subscribe-members.tcl,v diff -u -r1.3 -r1.4 --- openacs-4/packages/dotlrn/www/subscribe-members.tcl 8 Aug 2006 21:26:24 -0000 1.3 +++ openacs-4/packages/dotlrn/www/subscribe-members.tcl 1 Nov 2013 21:08:32 -0000 1.4 @@ -37,7 +37,7 @@ foreach user $users { # Add notification for this user if they're not already subscribed for an instant alert set user_id [ns_set get $user user_id] - if {[string equal [notification::request::get_request_id -user_id $user_id -type_id $type_id -object_id $forum_id] ""] } { + if {[notification::request::get_request_id -user_id $user_id -type_id $type_id -object_id $forum_id] eq ""} { notification::request::new -type_id $type_id -user_id $user_id -object_id $forum_id -interval_id $interval_id \ -delivery_method_id $delivery_method_id } Index: openacs-4/packages/dotlrn/www/user-add-2.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/user-add-2.tcl,v diff -u -r1.14 -r1.15 --- openacs-4/packages/dotlrn/www/user-add-2.tcl 29 Sep 2013 13:49:45 -0000 1.14 +++ openacs-4/packages/dotlrn/www/user-add-2.tcl 1 Nov 2013 21:08:32 -0000 1.15 @@ -69,7 +69,7 @@ } set redirect "user-add-2?[export_vars {user_id password referer type can_browse_p read_private_data_p dotlrn_interactive_p add_membership_p}]" -if { [string equal $add_membership_p t] && [string equal $referer "/acs-admin/users"] } { +if { $add_membership_p == "t" && $referer eq "/acs-admin/users" } { set redirect "one-community-admin" } else { set redirect $referer @@ -80,7 +80,7 @@ # set redirect "../${redirect}" ad_returnredirect "admin/user-new-2?[export_vars {user_id {referer $redirect}}]" ad_script_abort -} elseif { [string equal $add_membership_p t] } { +} elseif {$add_membership_p == "t"} { ad_returnredirect "member-add-2?[export_vars {user_id {referer $redirect}}]" ad_script_abort } Index: openacs-4/packages/dotlrn/www/user-add-3.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/user-add-3.tcl,v diff -u -r1.12 -r1.13 --- openacs-4/packages/dotlrn/www/user-add-3.tcl 29 Sep 2013 13:49:45 -0000 1.12 +++ openacs-4/packages/dotlrn/www/user-add-3.tcl 1 Nov 2013 21:08:32 -0000 1.13 @@ -40,7 +40,7 @@ set msg_subst_values [list system_name [ad_system_name] system_url [parameter::get -parameter SystemUrl]] set email_subject [_ dotlrn.user_add_confirm_email_subject $msg_subst_values] -if [catch {acs_mail_lite::send -send_immediately -to_addr $email -from_addr $admin_email -subject $email_subject -body $message} errmsg] { +if {[catch {acs_mail_lite::send -send_immediately -to_addr $email -from_addr $admin_email -subject $email_subject -body $message} errmsg]} { ad_return_error "[_ dotlrn.Mail_Failed]" "[_ dotlrn.lt_The_system_was_unable]
     [ad_quotehtml $errmsg]
    Index: openacs-4/packages/dotlrn/www/user-add.tcl
    ===================================================================
    RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/user-add.tcl,v
    diff -u -r1.34 -r1.35
    --- openacs-4/packages/dotlrn/www/user-add.tcl	15 Dec 2006 22:45:22 -0000	1.34
    +++ openacs-4/packages/dotlrn/www/user-add.tcl	1 Nov 2013 21:08:32 -0000	1.35
    @@ -40,13 +40,13 @@
     
     # Set read_private_data_p and can_browse_p to me the most restrictive defaults.
     
    -set current_user_id [ad_maybe_redirect_for_registration]
    +set current_user_id [auth::require_login]
     set community_id [dotlrn_community::get_community_id]
     
     # If can_browse_p is 1, this means the new user would be able to join 
     # all communities. 
         
    -if {![empty_string_p $community_id]} {
    +if {$community_id ne ""} {
         dotlrn::require_user_admin_community -community_id [dotlrn_community::get_community_id]
         set context [list [list "one-community-admin" [_ dotlrn.Admin]] [_ dotlrn.Add_User]]
         set community_p 1
    Index: openacs-4/packages/dotlrn/www/weblog-control-panel.tcl
    ===================================================================
    RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/weblog-control-panel.tcl,v
    diff -u -r1.4 -r1.5
    --- openacs-4/packages/dotlrn/www/weblog-control-panel.tcl	8 Aug 2006 21:26:24 -0000	1.4
    +++ openacs-4/packages/dotlrn/www/weblog-control-panel.tcl	1 Nov 2013 21:08:32 -0000	1.5
    @@ -22,7 +22,7 @@
         @version $Id$
     }
     
    -set user_id [ad_maybe_redirect_for_registration]
    +set user_id [auth::require_login]
     
     
     set dotlrn_package_id [dotlrn::get_package_id]
    Index: openacs-4/packages/dotlrn/www/weblog-new.tcl
    ===================================================================
    RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/weblog-new.tcl,v
    diff -u -r1.5 -r1.6
    --- openacs-4/packages/dotlrn/www/weblog-new.tcl	8 Aug 2006 21:26:24 -0000	1.5
    +++ openacs-4/packages/dotlrn/www/weblog-new.tcl	1 Nov 2013 21:08:32 -0000	1.6
    @@ -26,7 +26,7 @@
         
     }
     
    -set user_id [ad_maybe_redirect_for_registration]
    +set user_id [auth::require_login]
     
     set weblog_package_id [site_node_apm_integration::get_child_package_id  -package_key "forums"]
     set existing_forum_ids [db_list weblog_forum_id {select forum_id from forums_forums_enabled f, acs_objects o where o.object_id = forum_id and o.creation_user = :user_id and f.package_id = :weblog_package_id}]
    Index: openacs-4/packages/dotlrn/www/admin/admin-add-2.tcl
    ===================================================================
    RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/admin/admin-add-2.tcl,v
    diff -u -r1.4 -r1.5
    --- openacs-4/packages/dotlrn/www/admin/admin-add-2.tcl	8 Aug 2006 21:26:28 -0000	1.4
    +++ openacs-4/packages/dotlrn/www/admin/admin-add-2.tcl	1 Nov 2013 21:08:33 -0000	1.5
    @@ -49,7 +49,7 @@
                 select group_id from groups where group_name='dotlrn-admin'" -default ""]
     
     if {!$member_p} {
    -    if {![empty_string_p $group_id] } {
    +    if {$group_id ne "" } {
             group::add_member -group_id $group_id -user_id $user_id
         }
     }
    Index: openacs-4/packages/dotlrn/www/admin/admin-remove.tcl
    ===================================================================
    RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/admin/admin-remove.tcl,v
    diff -u -r1.5 -r1.6
    --- openacs-4/packages/dotlrn/www/admin/admin-remove.tcl	8 Aug 2006 21:26:28 -0000	1.5
    +++ openacs-4/packages/dotlrn/www/admin/admin-remove.tcl	1 Nov 2013 21:08:33 -0000	1.6
    @@ -13,7 +13,7 @@
     #  FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
     #  details.
     #
    -ad_maybe_redirect_for_registration
    +auth::require_login
     ad_page_contract {
         Remove dotLRN Administrators 
     
    @@ -29,7 +29,7 @@
     
     set group_id [db_string group_id_from_name "
                 select group_id from groups where group_name='dotlrn-admin'" -default ""]
    -        if {![empty_string_p $group_id] } {
    +        if {$group_id ne "" } {
                group::remove_member -group_id $group_id -user_id $user_id
             }
     
    Index: openacs-4/packages/dotlrn/www/admin/class-instance-new.tcl
    ===================================================================
    RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/admin/class-instance-new.tcl,v
    diff -u -r1.32 -r1.33
    --- openacs-4/packages/dotlrn/www/admin/class-instance-new.tcl	29 Sep 2013 13:49:45 -0000	1.32
    +++ openacs-4/packages/dotlrn/www/admin/class-instance-new.tcl	1 Nov 2013 21:08:33 -0000	1.33
    @@ -113,7 +113,7 @@
     
         db_dml update_community_info {}
     
    -    if {[empty_string_p $referer]} {
    +    if {$referer eq ""} {
             set referer "[dotlrn::get_admin_url]/class?[export_vars -url {class_key}]"
         }
     
    Index: openacs-4/packages/dotlrn/www/admin/class-new.tcl
    ===================================================================
    RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/admin/class-new.tcl,v
    diff -u -r1.19 -r1.20
    --- openacs-4/packages/dotlrn/www/admin/class-new.tcl	7 Oct 2007 22:36:56 -0000	1.19
    +++ openacs-4/packages/dotlrn/www/admin/class-new.tcl	1 Nov 2013 21:08:33 -0000	1.20
    @@ -77,7 +77,7 @@
             department_key pretty_name description referer subject_key
     
         # If we do not provide a special subject_key make use of the pretty_name instead
    -    if {[empty_string_p $subject_key]} {
    +    if {$subject_key eq ""} {
     	set subject_key $department_key.[dotlrn::generate_key -name $pretty_name]
         }
     
    Index: openacs-4/packages/dotlrn/www/admin/class.tcl
    ===================================================================
    RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/admin/class.tcl,v
    diff -u -r1.20 -r1.21
    --- openacs-4/packages/dotlrn/www/admin/class.tcl	15 May 2007 20:14:25 -0000	1.20
    +++ openacs-4/packages/dotlrn/www/admin/class.tcl	1 Nov 2013 21:08:33 -0000	1.21
    @@ -74,7 +74,7 @@
         set page_query select_all_class_instances_paginator
     }
     
    -if { ![empty_string_p $keyword] } {
    +if { $keyword ne "" } {
         set keyword_clause [db_map class_instances_keyword]
     } else {
         set keyword_clause ""
    Index: openacs-4/packages/dotlrn/www/admin/classes-chunk.tcl
    ===================================================================
    RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/admin/classes-chunk.tcl,v
    diff -u -r1.12 -r1.13
    --- openacs-4/packages/dotlrn/www/admin/classes-chunk.tcl	7 Oct 2007 22:36:56 -0000	1.12
    +++ openacs-4/packages/dotlrn/www/admin/classes-chunk.tcl	1 Nov 2013 21:08:33 -0000	1.13
    @@ -27,7 +27,7 @@
     }
     
     
    -if {![exists_and_not_null department_key]} {
    +if {(![info exists department_key] || $department_key eq "")} {
         set department_key ""
     }
     
    @@ -54,18 +54,18 @@
         form get_values department_form department_key
     }
     
    -if {![exists_and_not_null referer]} {
    +if {(![info exists referer] || $referer eq "")} {
         set referer "classes"
     }
     
     set query select_classes
     set page_query select_classes_paginator
    -if {![empty_string_p $department_key]} {
    +if {$department_key ne ""} {
         set query select_classes_by_department
         set page_query select_classes_by_department_paginator
     }
     
    -if { [exists_and_not_null keyword] } {
    +if { ([info exists keyword] && $keyword ne "") } {
         set keyword_clause [db_map classes_keyword]
     } else {
         set keyword_clause ""
    Index: openacs-4/packages/dotlrn/www/admin/cockpit.adp
    ===================================================================
    RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/admin/cockpit.adp,v
    diff -u -r1.3 -r1.4
    Binary files differ
    Index: openacs-4/packages/dotlrn/www/admin/cockpit.tcl
    ===================================================================
    RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/admin/cockpit.tcl,v
    diff -u -r1.3 -r1.4
    Binary files differ
    Index: openacs-4/packages/dotlrn/www/admin/community-members-add-to-community.tcl
    ===================================================================
    RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/admin/community-members-add-to-community.tcl,v
    diff -u -r1.5 -r1.6
    --- openacs-4/packages/dotlrn/www/admin/community-members-add-to-community.tcl	8 Aug 2006 21:26:28 -0000	1.5
    +++ openacs-4/packages/dotlrn/www/admin/community-members-add-to-community.tcl	1 Nov 2013 21:08:33 -0000	1.6
    @@ -77,7 +77,7 @@
         form get_values select_community \
             source_community_id community_id
     
    -    if {![empty_string_p $community_id]} {
    +    if {$community_id ne ""} {
             db_transaction {
                 foreach user $users {
     		set user_id [ns_set get $user user_id]
    @@ -114,6 +114,6 @@
         ad_script_abort
     }
     
    -set estimated_number_of_seconds [expr [llength $users] * 3]
    +set estimated_number_of_seconds [expr {[llength $users] * 3}]
     
     ad_return_template
    Index: openacs-4/packages/dotlrn/www/admin/department-delete.tcl
    ===================================================================
    RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/admin/department-delete.tcl,v
    diff -u -r1.6 -r1.7
    --- openacs-4/packages/dotlrn/www/admin/department-delete.tcl	8 Aug 2006 21:26:28 -0000	1.6
    +++ openacs-4/packages/dotlrn/www/admin/department-delete.tcl	1 Nov 2013 21:08:33 -0000	1.7
    @@ -71,7 +71,7 @@
     if {[form is_valid delete_department]} {
         form get_values delete_department department_key pretty_name referer no_button yes_button
     
    -    if {[string equal $yes_button $yes_label]} {
    +    if {$yes_button eq $yes_label} {
     
             db_transaction {
                 set subcomm_id [dotlrn_department::delete \
    Index: openacs-4/packages/dotlrn/www/admin/department.tcl
    ===================================================================
    RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/admin/department.tcl,v
    diff -u -r1.15 -r1.16
    --- openacs-4/packages/dotlrn/www/admin/department.tcl	8 Aug 2006 21:26:28 -0000	1.15
    +++ openacs-4/packages/dotlrn/www/admin/department.tcl	1 Nov 2013 21:08:33 -0000	1.16
    @@ -34,7 +34,7 @@
     #Pages in this directory are only runnable by dotlrn-wide admins.
     dotlrn::require_admin 
     
    -if {[empty_string_p $department_key]} {
    +if {$department_key eq ""} {
         ad_returnredirect "[dotlrn::get_admin_url]/classes"
         ad_script_abort
     }
    Index: openacs-4/packages/dotlrn/www/admin/departments.tcl
    ===================================================================
    RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/admin/departments.tcl,v
    diff -u -r1.11 -r1.12
    --- openacs-4/packages/dotlrn/www/admin/departments.tcl	8 Aug 2006 21:26:28 -0000	1.11
    +++ openacs-4/packages/dotlrn/www/admin/departments.tcl	1 Nov 2013 21:08:33 -0000	1.12
    @@ -43,7 +43,7 @@
     
     set actions [list "[_ dotlrn.new_department]" "[export_vars -base "department-new" -url { referer }]"]
     
    -if { ![empty_string_p $keyword] } {
    +if { $keyword ne "" } {
         set keyword_clause [db_map departments_keyword]
     } {
         set keyword_clause [db_map departments_without_keyword]
    Index: openacs-4/packages/dotlrn/www/admin/site-wide-admin-toggle.tcl
    ===================================================================
    RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/admin/site-wide-admin-toggle.tcl,v
    diff -u -r1.12 -r1.13
    --- openacs-4/packages/dotlrn/www/admin/site-wide-admin-toggle.tcl	9 Nov 2008 23:29:23 -0000	1.12
    +++ openacs-4/packages/dotlrn/www/admin/site-wide-admin-toggle.tcl	1 Nov 2013 21:08:33 -0000	1.13
    @@ -39,9 +39,9 @@
     	return
     }
     
    -if {[string equal $value "grant"] == 1} {
    +if {$value eq "grant"} {
         ad_permission_grant $user_id [acs_magic_object "security_context_root"] "admin"
    -} elseif {[string equal $value "revoke"] == 1} {
    +} elseif {$value eq "revoke"} {
         ad_permission_revoke $user_id [acs_magic_object "security_context_root"] "admin"
     }
     
    Index: openacs-4/packages/dotlrn/www/admin/term.tcl
    ===================================================================
    RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/admin/term.tcl,v
    diff -u -r1.16 -r1.17
    --- openacs-4/packages/dotlrn/www/admin/term.tcl	15 May 2007 20:14:25 -0000	1.16
    +++ openacs-4/packages/dotlrn/www/admin/term.tcl	1 Nov 2013 21:08:33 -0000	1.17
    @@ -95,7 +95,7 @@
         }
     }
     
    -if {![exists_and_not_null referer]} {
    +if {(![info exists referer] || $referer eq "")} {
         set referer "terms"
     }
     
    @@ -106,12 +106,12 @@
         set paginator_query "select_all_classes_paginator"
     }
     
    -if {![empty_string_p $department_key]} {
    +if {$department_key ne ""} {
         append query "_by_department"
         append paginator_query "_by_department"
     }
     
    -if { ![empty_string_p $keyword] } {
    +if { $keyword ne "" } {
         set keyword_clause [db_map select_all_instances_keyword]
     } else {
         set keyword_clause [db_map select_all_instances_without_keyword]
    Index: openacs-4/packages/dotlrn/www/admin/toolbar-actions.tcl
    ===================================================================
    RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/admin/toolbar-actions.tcl,v
    diff -u -r1.2 -r1.3
    --- openacs-4/packages/dotlrn/www/admin/toolbar-actions.tcl	13 Jan 2005 13:57:21 -0000	1.2
    +++ openacs-4/packages/dotlrn/www/admin/toolbar-actions.tcl	1 Nov 2013 21:08:33 -0000	1.3
    @@ -7,7 +7,7 @@
         {return_url ""}
     } -validate {
         if_search {
    -	if { [string equal $action "search"] && ( [empty_string_p $search_type] || [empty_string_p $keyword] ) } {
    +	if { $action eq "search" && ( $search_type eq "" || $keyword eq "" ) } {
     	    ad_complain "If you want to search please type some keyword and in where to search"
     	}
         }
    Index: openacs-4/packages/dotlrn/www/admin/unarchive.tcl
    ===================================================================
    RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/admin/unarchive.tcl,v
    diff -u -r1.2 -r1.3
    Binary files differ
    Index: openacs-4/packages/dotlrn/www/admin/user-new-2.tcl
    ===================================================================
    RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/admin/user-new-2.tcl,v
    diff -u -r1.35 -r1.36
    --- openacs-4/packages/dotlrn/www/admin/user-new-2.tcl	29 Sep 2013 13:49:46 -0000	1.35
    +++ openacs-4/packages/dotlrn/www/admin/user-new-2.tcl	1 Nov 2013 21:08:34 -0000	1.36
    @@ -103,7 +103,7 @@
         }
         
         
    -    if [catch {acs_mail_lite::send -send_immediately -to_addr $email -from_addr $email_from -subject $subject -body $message} errmsg] {
    +    if {[catch {acs_mail_lite::send -send_immediately -to_addr $email -from_addr $email_from -subject $subject -body $message} errmsg]} {
             
             ns_log Error "Error sending email from user-new-2.tcl" $errmsg
             ad_return_error \
    @@ -121,7 +121,7 @@
     Message: $message"
     
     
    -        if [catch {acs_mail_lite::send -send_immediately -to_addr $email_from -from_addr $email_from -subject $admin_subject -body $admin_message} errmsg] {
    +        if {[catch {acs_mail_lite::send -send_immediately -to_addr $email_from -from_addr $email_from -subject $admin_subject -body $admin_message} errmsg]} {
                 
                 ns_log Error "Error sending email from user-new-2.tcl" $errmsg
                 ad_return_error \
    Index: openacs-4/packages/dotlrn/www/admin/user-nuke.tcl
    ===================================================================
    RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/admin/user-nuke.tcl,v
    diff -u -r1.5 -r1.6
    --- openacs-4/packages/dotlrn/www/admin/user-nuke.tcl	8 Aug 2006 21:26:28 -0000	1.5
    +++ openacs-4/packages/dotlrn/www/admin/user-nuke.tcl	1 Nov 2013 21:08:34 -0000	1.6
    @@ -34,10 +34,10 @@
     
     set context_bar [list [list users [_ dotlrn.Users]] [_ dotlrn.Nuke]]
     
    -if [form is_valid confirm_delete] {
    +if {[form is_valid confirm_delete]} {
         form get_values confirm_delete user_id confirmed_p
    -    if [string equal $confirmed_p t] {
    -	if [catch { dotlrn::remove_user_completely -user_id $user_id } errMsg ] {
    +    if {$confirmed_p == "t"} {
    +	if {[catch { dotlrn::remove_user_completely -user_id $user_id } errMsg ]} {
             set error_msg $errMsg
     	    ad_return_template user-nuke-error
     	} else {
    Index: openacs-4/packages/dotlrn/www/admin/user.tcl
    ===================================================================
    RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/admin/user.tcl,v
    diff -u -r1.27 -r1.28
    --- openacs-4/packages/dotlrn/www/admin/user.tcl	29 Sep 2013 13:49:46 -0000	1.27
    +++ openacs-4/packages/dotlrn/www/admin/user.tcl	1 Nov 2013 21:08:34 -0000	1.28
    @@ -53,11 +53,11 @@
         ad_return_complaint 1 "
  • [_ dotlrn.couldnt_find_user_id [list user_id $user_id]]
  • " ad_script_abort } -if {[empty_string_p $screen_name]} { +if {$screen_name eq ""} { set screen_name "([_ dotlrn.none_set_up])" } set registration_date [lc_time_fmt $registration_date "%q"] -if {![empty_string_p $last_visit]} { +if {$last_visit ne ""} { set last_visit [lc_time_fmt $last_visit "%q"] } Index: openacs-4/packages/dotlrn/www/admin/users-add-to-community.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/admin/users-add-to-community.tcl,v diff -u -r1.16 -r1.17 --- openacs-4/packages/dotlrn/www/admin/users-add-to-community.tcl 15 May 2007 20:14:25 -0000 1.16 +++ openacs-4/packages/dotlrn/www/admin/users-add-to-community.tcl 1 Nov 2013 21:08:34 -0000 1.17 @@ -75,7 +75,7 @@ users community_id - if {![empty_string_p $community_id]} { + if {$community_id ne ""} { db_transaction { foreach user $users { dotlrn_community::add_user $community_id $user Index: openacs-4/packages/dotlrn/www/admin/users-bulk-approve.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/admin/users-bulk-approve.tcl,v diff -u -r1.4 -r1.5 --- openacs-4/packages/dotlrn/www/admin/users-bulk-approve.tcl 29 Sep 2013 13:49:46 -0000 1.4 +++ openacs-4/packages/dotlrn/www/admin/users-bulk-approve.tcl 1 Nov 2013 21:08:34 -0000 1.5 @@ -29,8 +29,8 @@ set pending_user_count [db_string count_pending_users {}] -set hours [expr int($pending_user_count / 120)] -set minutes [expr int($pending_user_count / 2) % 60] +set hours [expr {int($pending_user_count / 120)}] +set minutes [expr {int($pending_user_count / 2) % 60}] set browse_options [list [list "[_ dotlrn.Full_Access]" 1] [list "[_ dotlrn.Limited_Access]" 0]] set guest_options [list [list [_ dotlrn.No] f] [list [_ dotlrn.Yes] t]] @@ -79,7 +79,7 @@ } else { # notify user of approval - if [catch {acs_mail_lite::send -send_immediately -to_addr $email -from_addr $email_from -subject $subject -body $message} errmsg] { + if {[catch {acs_mail_lite::send -send_immediately -to_addr $email -from_addr $email_from -subject $subject -body $message} errmsg]} { ns_log Error "Error sending email from users-bulk-approve" $errmsg ns_write "Error sending mail
    " Index: openacs-4/packages/dotlrn/www/admin/users-bulk-upload-2.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/admin/users-bulk-upload-2.tcl,v diff -u -r1.23 -r1.24 --- openacs-4/packages/dotlrn/www/admin/users-bulk-upload-2.tcl 29 Sep 2013 13:49:46 -0000 1.23 +++ openacs-4/packages/dotlrn/www/admin/users-bulk-upload-2.tcl 1 Nov 2013 21:08:34 -0000 1.24 @@ -137,7 +137,7 @@ # Send note to new user if { $row(notify) == "t" } { # Send note to new user - if [catch {acs_mail_lite::send -send_immediately -to_addr $row(email) -from_addr $admin_email -subject $subject -body $message} errmsg] { + if {[catch {acs_mail_lite::send -send_immediately -to_addr $row(email) -from_addr $admin_email -subject $subject -body $message} errmsg]} { doc_body_append "[_ dotlrn.lt_emailing_this_user_fa]" set fail_p 1 } else { Index: openacs-4/packages/dotlrn/www/admin/users-chunk-large.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/admin/users-chunk-large.tcl,v diff -u -r1.13 -r1.14 --- openacs-4/packages/dotlrn/www/admin/users-chunk-large.tcl 8 Aug 2006 21:26:28 -0000 1.13 +++ openacs-4/packages/dotlrn/www/admin/users-chunk-large.tcl 1 Nov 2013 21:08:34 -0000 1.14 @@ -25,11 +25,11 @@ users:multirow } -if {![exists_and_not_null type]} { +if {![info exists type] || $type eq ""} { set type admin } -if {![exists_and_not_null referer]} { +if {![info exists referer] || $referer eq ""} { set referer "[dotlrn::get_admin_url]/users" } @@ -63,12 +63,12 @@ set root_object_id [acs_magic_object security_context_root] set i 1 - if {[string equal $type deactivated] == 1} { + if {$type eq "deactivated"} { db_multirow users select_deactivated_users {} { set users:${i}(access_level) Limited incr i } - } elseif {[string equal $type pending] == 1} { + } elseif {$type eq "pending"} { db_multirow users select_non_dotlrn_users {} { set users:${i}(access_level) N/A incr i Index: openacs-4/packages/dotlrn/www/admin/users-chunk-medium.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/admin/users-chunk-medium.tcl,v diff -u -r1.15 -r1.16 --- openacs-4/packages/dotlrn/www/admin/users-chunk-medium.tcl 8 Aug 2006 21:26:28 -0000 1.15 +++ openacs-4/packages/dotlrn/www/admin/users-chunk-medium.tcl 1 Nov 2013 21:08:34 -0000 1.16 @@ -30,11 +30,11 @@ set dotlrn_package_id [dotlrn::get_package_id] set root_object_id [acs_magic_object security_context_root] -if {![exists_and_not_null type]} { +if {(![info exists type] || $type eq "")} { set type admin } -if {![exists_and_not_null referer]} { +if {(![info exists referer] || $referer eq "")} { set referer "[dotlrn::get_admin_url]/users" } @@ -47,18 +47,18 @@ set control_bar [portal::dimensional -no_bars [list [list section {} $section $dimensions]]] set i 1 -if {[string equal $type deactivated] == 1} { +if {$type eq "deactivated"} { set query select_deactivated_users - if {[string match Other $section]} { + if {"Other" eq $section} { append query "_other" } db_multirow users $query {} { set users:${i}(access_level) Limited incr i } -} elseif {[string equal $type pending] == 1} { +} elseif {$type eq "pending"} { set query select_non_dotlrn_users - if {[string match Other $section]} { + if {"Other" eq $section} { append query "_other" } db_multirow users $query {} { @@ -67,7 +67,7 @@ } } else { set query select_dotlrn_users - if {[string match Other $section]} { + if {"Other" eq $section} { append query "_other" } db_multirow users $query {} { Index: openacs-4/packages/dotlrn/www/admin/users-chunk-small.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/admin/users-chunk-small.tcl,v diff -u -r1.12 -r1.13 --- openacs-4/packages/dotlrn/www/admin/users-chunk-small.tcl 8 Aug 2006 21:26:28 -0000 1.12 +++ openacs-4/packages/dotlrn/www/admin/users-chunk-small.tcl 1 Nov 2013 21:08:35 -0000 1.13 @@ -28,22 +28,22 @@ set dotlrn_package_id [dotlrn::get_package_id] set root_object_id [acs_magic_object security_context_root] -if {![exists_and_not_null type]} { +if {(![info exists type] || $type eq "")} { set type admin } -if {![exists_and_not_null referer]} { +if {(![info exists referer] || $referer eq "")} { set referer "[dotlrn::get_admin_url]/users" } # Currently, just present a list of dotLRN users set i 1 -if {[string equal $type deactivated] == 1} { +if {$type eq "deactivated"} { db_multirow users select_deactivated_users {} { set users:${i}(access_level) Limited incr i } -} elseif {[string equal $type pending] == 1} { +} elseif {$type eq "pending"} { db_multirow users select_non_dotlrn_users {} { set users:${i}(access_level) N/A incr i Index: openacs-4/packages/dotlrn/www/admin/users-chunk.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/admin/users-chunk.tcl,v diff -u -r1.11 -r1.12 --- openacs-4/packages/dotlrn/www/admin/users-chunk.tcl 15 May 2007 20:14:25 -0000 1.11 +++ openacs-4/packages/dotlrn/www/admin/users-chunk.tcl 1 Nov 2013 21:08:35 -0000 1.12 @@ -26,7 +26,7 @@ set oacs_site_wide_admin_p [acs_user::site_wide_admin_p] -if {![exists_and_not_null referer]} { +if {![info exists referer] || $referer eq ""} { set referer "[dotlrn::get_admin_url]/users" } Index: openacs-4/packages/dotlrn/www/admin/users-search.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/admin/users-search.tcl,v diff -u -r1.28 -r1.29 --- openacs-4/packages/dotlrn/www/admin/users-search.tcl 28 Apr 2009 10:16:37 -0000 1.28 +++ openacs-4/packages/dotlrn/www/admin/users-search.tcl 1 Nov 2013 21:08:35 -0000 1.29 @@ -152,7 +152,7 @@ form get_values user_search \ id type can_browse_p guest_p last_visit_greater last_visit_less name join_criteria - if {([string equal "and" $join_criteria] == 0) && ([string equal "or" $join_criteria] == 0)} { + if { $join_criteria ni {and or} } { ad_return_error \ "[_ dotlrn.lt_There_was_a_bug_in_th]" \ "[_ dotlrn.lt_There_was_a_bug_in_th_1]" @@ -171,16 +171,16 @@ ] set wheres [list] - if {![empty_string_p $name]} { + if {$name ne ""} { lappend wheres "(lower(dotlrn_users.last_name) like lower('%' || :name || '%') or lower(dotlrn_users.first_names) like lower('%' || :name || '%') or lower(dotlrn_users.email) like lower('%' || :name || '%'))" } - if {![empty_string_p $id]} { + if {$id ne ""} { lappend wheres "(lower(dotlrn_users.id) like lower('%' || :id || '%'))" } - if {![empty_string_p $type]} { - if {[string equal "any" $type] == 1} { + if {$type ne ""} { + if {"any" eq $type} { lappend wheres "dotlrn_users.type in (\'[join [dotlrn::get_user_types] \',\']\')" } else { lappend wheres "dotlrn_users.type = :type" @@ -207,15 +207,15 @@ } } - if {![empty_string_p $last_visit_greater]} { - if {[lsearch -exact $tables "users"] == -1} { + if {$last_visit_greater ne ""} { + if {"users" ni $tables} { lappend tables "users" } lappend wheres [db_map last_visit_g] } - if {![empty_string_p $last_visit_less]} { - if {[lsearch -exact $tables "users"] == -1} { + if {$last_visit_less ne ""} { + if {"users" ni $tables} { lappend tables "users" } lappend wheres [db_map last_visit_l] @@ -225,7 +225,7 @@ set role_list_length [llength $role_list] if {$role_list_length} { - if {[lsearch -exact $tables "acs_rels"] == -1} { + if {"acs_rels" ni $tables} { lappend tables "acs_rels" } set in_clause "(dotlrn_users.user_id = acs_rels.object_id_two and acs_rels.rel_type in (" Index: openacs-4/packages/dotlrn/www/admin/users.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/admin/users.tcl,v diff -u -r1.22 -r1.23 --- openacs-4/packages/dotlrn/www/admin/users.tcl 15 May 2007 20:14:25 -0000 1.22 +++ openacs-4/packages/dotlrn/www/admin/users.tcl 1 Nov 2013 21:08:35 -0000 1.23 @@ -58,9 +58,9 @@ set control_bar [ad_dimensional [list [list type "[_ dotlrn.User_Type]:" $type $dotlrn_roles_localized]]] -if {[string equal $type "deactivated"] == 1} { +if {$type eq "deactivated"} { set n_users $n_deactivated_users -} elseif {[string equal $type "pending"] == 1} { +} elseif {$type eq "pending"} { set n_users $n_pending_users } else { set n_users [db_string select_dotlrn_users_count {}] Index: openacs-4/packages/dotlrn/www/help/index.vuh =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/help/index.vuh,v diff -u -r1.1 -r1.2 --- openacs-4/packages/dotlrn/www/help/index.vuh 16 Jul 2009 09:37:28 -0000 1.1 +++ openacs-4/packages/dotlrn/www/help/index.vuh 1 Nov 2013 21:08:35 -0000 1.2 @@ -14,7 +14,7 @@ # redirect if possible set path_info [ad_conn path_info] -if { [string eq $path_info ""] } { +if {$path_info eq ""} { set path_info "index" }