Commit ea4efa2e authored by Frank Bergmann's avatar Frank Bergmann

- Upgrade to OpenACS 5.6

parent 5f25ba44
<?xml version="1.0" encoding="utf-8"?>
<message_catalog package_key="acs-subsite" locale="cs_CZ" charset="utf-8">
<msg key="Change_locale_label">Změnit jazyk</msg>
<msg key="Change_pass_email_por">Změnit heslo, e-mail, portrét</msg>
<msg key="Logout">Odhlásit</msg>
<msg key="Logout_from_system">Odhlásit z %system_name%</msg>
<msg key="Welcome_user">Vítejte, %user_name%</msg>
<msg key="Your_Account">Váš účet</msg>
</message_catalog>
This diff is collapsed.
This diff is collapsed.
<?xml version="1.0" encoding="utf-8"?>
<message_catalog package_key="acs-subsite" locale="pa_IN" charset="utf-8">
<msg key="Change_pass_email_por">ਗੁਪਤ-ਕੋਡ, ਈ-ਮੇਲ, ਪੋਰਟਰੇਟ</msg>
<msg key="Logout">ਲਾਗਆਉਟ</msg>
<msg key="Logout_from_system">%system_name% ਤੋਂ ਲਾਗ ਆਉਟ</msg>
<msg key="Welcome_user">%user_name% ਜੀ ਆਇਆਂ ਨੂੰ</msg>
</message_catalog>
<?xml version="1.0" encoding="utf-8"?>
<message_catalog package_key="acs-subsite" locale="th_TH" charset="utf-8">
<msg key="Change_pass_email_por">เปลี่ยนรหัสเข้า อีเมล์ รูปภาพ</msg>
<msg key="Logout">ออกจากระบบ</msg>
<msg key="Logout_from_system">ออกจาก %system_name%</msg>
<msg key="Welcome_user">ยินดีต้อนรับ, %user_name%</msg>
</message_catalog>
<if @user_info.email_verified_p@ true>
<property name="title">#acs-subsite.lt_Your_email_is_confirm#</property>
<if @user_info.member_state@ eq "approved">
#acs-subsite.lt_Your_email_has_been_c#
<p>
<form action="index" method=post>
@export_vars;noquote@
<input type=submit value="#acs-kernel.common_continue#">
</form>
</if>
<else>
<p> #acs-subsite.lt_Your_email_has_been_c_1# </p>
</else>
</if>
<else>
<property name="title">#acs-subsite.Email_not_Requested#</property>
<p> #acs-subsite.lt_We_were_not_awaiting_# </p>
<p> #acs-subsite.lt_Please_try_to_a_hrefi# </p>
</else>
if {![db_0or1row userp {select 1 from users where user_id = :user_id}]
|| $token ne [auth::get_user_secret_token -user_id $user_id] } {
set title "Bad token"
set message "The link given to authenticate your email was invalid."
ad_return_template /packages/acs-subsite/lib/message
} else {
auth::set_email_verified -user_id $user_id
acs_user::get -user_id $user_id -array user_info
set export_vars [export_vars -form { { username $user_info(username) } }]
set site_link [ad_site_home_link]
set system_name [ad_system_name]
}
<table>
<tr valign="top">
<td style="width:35%">
<div class="portlet-wrapper">
<div class="portlet-header">
<div class="portlet-title">
<h1>#acs-subsite.Edit_Options#</h1>
</div>
</div>
<div class="portlet">
<ul>
<li><a href="../user/password-update">#acs-subsite.Change_my_Password#</a></li>
<if @notifications_url@ not nil>
<li><a href="@notifications_url@">#acs-subsite.Manage_your_notifications#</a></li>
</if>
<if @account_status@ ne "closed">
<li><a href="unsubscribe">#acs-subsite.Close_your_account#</a></li>
</if>
</ul>
</div>
</div>
<div class="portlet-wrapper">
<div class="portlet-header">
<div class="portlet-title">
<h1>#acs-subsite.Privacy#</h1>
</div>
</div>
<div class="portlet">
<ul>
<li><a href="@community_member_url@">#acs-subsite.lt_What_other_people_see#</a></li>
<li><a href="@whos_online_url@">#acs-subsite.Whos_Online_link_label#</a></li>
<li><a href="../user/email-privacy-level">#acs-subsite.Change_my_email_P#</a></li>
</ul>
<if @invisible_p@ true>
#acs-subsite.Currently_invisible_msg#
<ul>
<li><a href="@make_visible_url@">#acs-subsite.Make_yourself_visible_label#</a></li>
</ul>
</if>
<else>
#acs-subsite.Currently_visible_msg#
<ul>
<li><a href="@make_invisible_url@">#acs-subsite.Make_yourself_invisible_label#</a></li>
</ul>
</else>
</div>
</div>
</td>
<td>
<div class="portlet-wrapper">
<div class="portlet-header">
<div class="portlet-title">
<h1>#acs-subsite.My_Account#</h1>
</div>
</div>
<div class="portlet">
<include src="@user_info_template@" />
<if @account_status@ eq "closed">
#acs-subsite.Account_closed_workspace_msg#
</if>
</div>
</div>
<if @portrait_state@ eq upload>
<div class="portlet-wrapper">
<div class="portlet-header">
<div class="portlet-title">
<h1>#acs-subsite.Your_Portrait#</h1>
</div>
</div>
<div class="portlet">
<p>
#acs-subsite.lt_Show_everyone_else_at# <a href="@portrait_upload_url@">#acs-subsite.upload_a_portrait#</a>
</p>
</div>
</div>
</if>
<if @portrait_state@ eq show>
<div class="portlet-wrapper">
<div class="portlet-header">
<div class="portlet-title">
<h1>#acs-subsite.Your_Portrait#</h1>
</div>
</div>
<div class="portlet">
<p>#acs-subsite.lt_On_portrait_publish_d#.</p>
<table>
<tr valign="top">
<td>
<img height=100 src="/shared/portrait-bits.tcl?user_id=@user_id@" alt="Portrait">
<p><a href="/user/portrait/?return_url=/pvt/home">#acs-subsite.Edit#</a></p>
</td>
<td>
@portrait_description@
</td>
</tr>
</table>
</div>
</div>
</if>
<div class="portlet-wrapper">
<div class="portlet-header">
<div class="portlet-title">
<h1>#acs-subsite.Groups#</h1>
</div>
</div>
<div class="portlet">
<list name="fragments">
@fragments:item;noquote@
</list>
</div>
</div>
</td>
</tr>
</table>
# /pvt/home.tcl
ad_page_contract {
user's workspace page
@cvs-id $Id$
} -properties {
system_name:onevalue
context:onevalue
full_name:onevalue
email:onevalue
url:onevalue
screen_name:onevalue
bio:onevalue
portrait_state:onevalue
portrait_publish_date:onevalue
portrait_title:onevalue
portrait_description:onevalue
export_user_id:onevalue
ad_url:onevalue
member_link:onevalue
pvt_home_url:onevalue
}
set user_id [auth::require_login -account_status closed]
acs_user::get -array user -include_bio -user_id $user_id
set account_status [ad_conn account_status]
set login_url [ad_get_login_url]
set subsite_url [ad_conn vhost_subsite_url]
set page_title [ad_pvt_home_name]
set pvt_home_url [ad_pvt_home]
set context [list $page_title]
set fragments [callback -catch user::workspace -user_id $user_id]
set ad_url [ad_url]
set community_member_url [acs_community_member_url -user_id $user_id]
set notifications_url [lindex [site_node::get_children -node_id [subsite::get_element -element node_id] -package_key "notifications"] 0]
set system_name [ad_system_name]
set portrait_upload_url [export_vars -base "../user/portrait/upload" { { return_url [ad_return_url] } }]
if {[parameter::get -parameter SolicitPortraitP -default 0]} {
# we have portraits for some users
if {![db_0or1row get_portrait_info "
select cr.publish_date, nvl(cr.title,'your portrait') as portrait_title,
nvl(cr.description,'no description') as portrait_description
from cr_revisions cr, cr_items ci, acs_rels a
where cr.revision_id = ci.live_revision
and ci.item_id = a.object_id_two
and a.object_id_one = :user_id
and a.rel_type = 'user_portrait_rel'
"]} {
set portrait_state "upload"
} else {
if { $portrait_title eq "" } {
set portrait_title "[_ acs-subsite.no_portrait_title_message]"
}
set portrait_state "show"
set portrait_publish_date [lc_time_fmt $publish_date "%q"]
}
} else {
set portrait_state "none"
}
set whos_online_url "[subsite::get_element -element url]shared/whos-online"
set make_visible_url "[subsite::get_element -element url]shared/make-visible"
set make_invisible_url "[subsite::get_element -element url]shared/make-invisible"
set invisible_p [whos_online::user_invisible_p [ad_conn untrusted_user_id]]
set subsite_id [ad_conn subsite_id]
set user_info_template [parameter::get -parameter "UserInfoTemplate" -package_id $subsite_id]
if {$user_info_template eq ""} {
set user_info_template "/packages/acs-subsite/lib/user-info"
}
<?xml version="1.0"?>
<queryset>
<fullquery name="pvt_home_user_info">
<querytext>
select first_names, last_name, email, url, screen_name
from cc_users
where user_id=:user_id
</querytext>
</fullquery>
<fullquery name="biography">
<querytext>
select attr_value
from acs_attribute_values
where object_id = :user_id
and attribute_id =
(select attribute_id
from acs_attributes
where object_type = 'person'
and attribute_name = 'bio')
</querytext>
</fullquery>
<fullquery name="get_portrait_info">
<querytext>
select cr.publish_date, cr.title as portrait_title, cr.description as portrait_description
from cr_revisions cr, cr_items ci, acs_rels a
where cr.revision_id = ci.live_revision
and ci.item_id = a.object_id_two
and a.object_id_one = :user_id
and a.rel_type = 'user_portrait_rel'
</querytext>
</fullquery>
<fullquery name="email_info">
<querytext>
select email
from cc_users
where user_iad=:user_id
</querytext>
</fullquery>
</queryset>
<master>
<property name="title">@title;noquote@</property>
<property name="context">@context;noquote@</property>
@message;noquote@
ad_page_contract {
This include expects "message" to be set as html
and if no title is present uses "Message". Used to inform of actions
in registration etc.
@cvs-id $Id$
}
if {![exists_and_not_null title]} {
set page_title Message
}
set context [list $title]
<?xml version="1.0"?>
<queryset>
<fullquery name="select_subsites">
<querytext>
select p.package_id,
p.instance_name,
n.node_id,
n.name,
:subsite_url || n.name as url,
(select count(*)
from group_approved_member_map m
where m.rel_type = 'membership_rel'
and m.group_id = ag.group_id) as num_members,
(select min(r2.member_state)
from group_member_map m2,
membership_rels r2
where m2.group_id = ag.group_id
and m2.member_id = :untrusted_user_id
and r2.rel_id = m2.rel_id) as member_state,
g.group_id,
g.join_policy
from site_nodes n,
apm_packages p,
application_groups ag,
groups g
where n.parent_id = :subsite_node_id
and p.package_id = n.object_id
and p.package_key in ('[join [subsite::package_keys] {','}]')
and ag.package_id = p.package_id
and g.group_id = ag.group_id
and (exists (select 1
from all_object_party_privilege_map perm
where perm.object_id = p.package_id
and perm.privilege = 'read'
and perm.party_id = :untrusted_user_id) or g.join_policy != 'closed')
order by lower(instance_name)
</querytext>
</fullquery>
</queryset>
<?xml version="1.0"?>
<queryset>
<fullquery name="get_timezones">
<querytext>
select tz || ' ' || gmt_offset as full_tz, tz
from timezones
order by tz
</querytext>
</fullquery>
<fullquery name="get_locales">
<querytext>
select label, locale
from enabled_locales
order by label
</querytext>
</fullquery>
</queryset>
<if @groups:rowcount@ gt 0>
<h2>#acs-subsite.You_are_in_the_follow#</h2>
<ul>
<multiple name="groups">
<li> <a href="@groups.url@">@groups.group_name@</a><if @groups.admin_p@ true>&nbsp;[<a href="@groups.url@admin/">#acs-kernel.common_Administration#</a>]</if></li>
</multiple>
</ul>
</if>
\ No newline at end of file
db_multirow -extend {url admin_p} groups groups {
select distinct ap.package_id, groups.group_id, lower(groups.group_name), groups.group_name
from groups, group_member_map gm, application_groups ap
where groups.group_id = gm.group_id and gm.member_id=:user_id
and ap.group_id = groups.group_id
order by lower(groups.group_name)
} {
set admin_p [permission::permission_p -party_id $user_id -object_id $group_id -privilege "admin"]
set url [apm_package_url_from_id $package_id]
}
--
-- packages/acs-subsite/sql/portraits-drop.sql
--
-- author Miguel Marin (miguelmarin@viaro.net) Viaro Networks (www.viaro.net)
-- creation-date 2005-01-22
--
drop table email_images;
begin
acs_rel_type.drop_type('email_image_rel');
end;
/
show errors
-- Email-Image Data Model
-- author Miguel Marin (miguelmarin@viaro.net) Viaro Networks (www.viaro.net)
-- creation-date 2005-01-22
create table email_images (
user_id constraint email_images_user_id_fk
references users
constraint email_images_user_id_pk
primary key
);
begin
acs_rel_type.create_role('email_image', 'Email Image', 'Email Images');
acs_rel_type.create_type (
rel_type => 'email_image_rel',
pretty_name => 'Email Image',
pretty_plural => 'Email Images',
object_type_one => 'user',
role_one => 'user',
table_name => 'email_images',
id_column => 'user_id',
package_name => 'email_image_rel',
min_n_rels_one => 1,
max_n_rels_one => 1,
object_type_two => 'content_item',
min_n_rels_two => 0,
max_n_rels_two => 1
);
commit;
end;
/
show errors
-- For now, at least, there's no reason for this table to include objects. When a subsite_theme
-- is installed, it can add to the table. When it is uninstalled, it can delete from the
-- table. Theme switching is only accessible from the admin UI for subsites, therefore
-- we don't need permissions on subsite_themes ...
-- the css column contains a list of CSS file/media pairs.
-- css and the form/list templates can be null because evil old OpenACS provides defaults
-- for these.
create table subsite_themes (
key varchar(100)
constraint subsite_themes_key_pk
primary key,
name varchar(100)
constraint subsite_theme_name_nn
not null,
template varchar(200)
constraint subsite_theme_template_nn
not null,
css varchar(2000),
form_template varchar(200),
list_template varchar(200),
list_filter_template varchar(200)
);
-- Insert the old themes that were hard-wired into earlier versions of acs-subsite.
insert into subsite_themes
(key, name, template)
values
('obsolete_plain', 'Obsolete Plain', '/www/default-master');
insert into subsite_themes
(key, name, template)
values
('obsolete_tabbed', 'Obsolete Tabbed', '/packages/acs-subsite/www/group-master');
drop table subsite_themes;
--
--
--
-- @author Dave Bauer (dave@thedesignexperience.org)
-- @creation-date 2005-11-29
-- @arch-tag: 6595c279-ae92-4dd8-955f-1184e1fccbd7
-- @cvs-id $Id$
--
alter table site_nodes_selection drop constraint site_nodes_sel_id_fk;
alter table site_nodes_selection add constraint site_nodes_sel_id_fk foreign key (node_id) references acs_objects(object_id) on delete cascade;
-- For now, at least, there's no reason for this table to include objects. When a subsite_theme
-- is installed, it can add to the table. When it is uninstalled, it can delete from the
-- table. Theme switching is only accessible from the admin UI for subsites, therefore
-- we don't need permissions on subsite_themes ...
-- the css column contains a list of CSS file/media pairs.
-- css and the form/list templates can be null because evil old OpenACS provides defaults
-- for these.
create table subsite_themes (
key varchar(100)
constraint subsite_theme_key_pk
primary key,
name varchar(100)
constraint subsite_theme_name_nn
not null,
template varchar(200)
constraint subsite_theme_template_nn
not null,
css varchar(200),
form_template varchar(200),
list_template varchar(200),
list_filter_template varchar(200)
);
-- Insert the old themes that were hard-wired into earlier versions of acs-subsite.
insert into subsite_themes
(key, name, template)
values
('obsolete_plain', 'Obsolete Plain', '/www/default-master');
insert into subsite_themes
(key, name, template)
values
('obsolete_tabbed', 'Obsolete Tabbed', '/packages/acs-subsite/www/group-master');
create or replace package application_group
is
function new (
group_id in application_groups.group_id%TYPE default null,
object_type in acs_objects.object_type%TYPE
default 'application_group',
creation_date in acs_objects.creation_date%TYPE
default sysdate,
creation_user in acs_objects.creation_user%TYPE
default null,
creation_ip in acs_objects.creation_ip%TYPE default null,
email in parties.email%TYPE default null,
url in parties.url%TYPE default null,
group_name in groups.group_name%TYPE,
package_id in application_groups.package_id%TYPE,
join_policy in groups.join_policy%TYPE default null,
context_id in acs_objects.context_id%TYPE default null
) return application_groups.group_id%TYPE;
procedure del (
group_id in application_groups.group_id%TYPE
);
function group_id_from_package_id (
package_id in application_groups.group_id%TYPE,
no_complain_p in char default 'f'
) return char;
end application_group;
/
show errors
create or replace package body application_group
is
function new (
group_id in application_groups.group_id%TYPE default null,
object_type in acs_objects.object_type%TYPE
default 'application_group',
creation_date in acs_objects.creation_date%TYPE
default sysdate,
creation_user in acs_objects.creation_user%TYPE
default null,
creation_ip in acs_objects.creation_ip%TYPE default null,
email in parties.email%TYPE default null,
url in parties.url%TYPE default null,
group_name in groups.group_name%TYPE,
package_id in application_groups.package_id%TYPE,
join_policy in groups.join_policy%TYPE default null,
context_id in acs_objects.context_id%TYPE default null
)
return application_groups.group_id%TYPE
is
v_group_id application_groups.group_id%TYPE;
begin
v_group_id := acs_group.new (
group_id => group_id,
object_type => object_type,
creation_date => creation_date,
creation_user => creation_user,
creation_ip => creation_ip,
email => email,
url => url,
group_name => group_name,
context_id => context_id,
join_policy => join_policy
);
insert into application_groups (group_id, package_id)
values (v_group_id, package_id);
return v_group_id;
end new;
procedure del (
group_id in application_groups.group_id%TYPE
)
is
begin
acs_group.del(group_id);
end del;
function group_id_from_package_id (
package_id in application_groups.group_id%TYPE,
no_complain_p in char default 'f'
) return char
is
v_group_id application_groups.group_id%TYPE;
begin
select group_id
into v_group_id
from application_groups
where package_id = group_id_from_package_id.package_id;
return v_group_id;
exception when no_data_found then
if no_complain_p != 't' then
raise_application_error(-20000, 'No group_id found for package ' ||
package_id || ' (' || acs_object.name(package_id) || ').' );
end if;
return null;
end group_id_from_package_id;
end application_group;
/
show errors
--
-- packages/acs-subsite/sql/email-image-drop.sql
--
-- author Miguel Marin (miguelmarin@viaro.net) Viaro Networks (www.viaro.net)
-- creation-date 2005-01-22
--
select acs_rel_type__drop_type('email_image_rel', 'f');
select acs_rel_type__drop_role('email_image');
drop table email_images;
-- Email Image Data Model
-- author Miguel Marin (miguelmarin@viaro.net) Viaro Networks (www.viaro.net)
-- creation-date 2005-01-22
create table email_images (
user_id integer constraint email_images_user_id_fk
references users
constraint email_images_user_id_pk
primary key
);
create function inline_0 ()
returns integer as '
begin
PERFORM acs_rel_type__create_role(''email_image'', ''Email Image'', ''Email Images'');
PERFORM acs_rel_type__create_type (
''email_image_rel'',
''Email Image'',
''Email Images'',
''relationship'',
''email_images'',
''user_id'',
''email_image_rel'',
''user'',
''user'',
1,
1,
''content_item'',
null,
0,
1
);
return 0;
end;' language 'plpgsql';
select inline_0 ();
drop function inline_0 ();
-- For now, at least, there's no reason for this table to include objects. When a subsite_theme
-- is installed, it can add to the table. When it is uninstalled, it can delete from the
-- table. Theme switching is only accessible from the admin UI for subsites, therefore
-- we don't need permissions on subsite_themes ...
-- the css column contains a list of CSS file/media pairs.
-- css and the form/list templates can be null because evil old OpenACS provides defaults
-- for these.
create table subsite_themes (
key text
constraint subsite_themes_key_pk
primary key,
name text
constraint subsite_theme_name_nn
not null,
template text
constraint subsite_theme_template_nn
not null,
css text,
form_template text,
list_template text,
list_filter_template text
);
-- Insert the old themes that were hard-wired into earlier versions of acs-subsite.
insert into subsite_themes
(key, name, template)
values
('obsolete_plain', 'Obsolete Plain', '/www/default-master');
insert into subsite_themes
(key, name, template)
values
('obsolete_tabbed', 'Obsolete Tabbed', '/packages/acs-subsite/www/group-master');
drop table subsite_themes;
--
--
--
-- @author Dave Bauer (dave@thedesignexperience.org)
-- @creation-date 2005-11-29
-- @arch-tag: 2e1f8368-2c55-49fb-9b34-9cd6564288e1
-- @cvs-id $Id$
--
alter table site_nodes_selection drop constraint site_nodes_sel_id_fk;
alter table site_nodes_selection add constraint site_nodes_sel_id_fk foreign key (node_id) references acs_objects(object_id) on delete cascade;
-- For now, at least, there's no reason for this table to include objects. When a subsite_theme
-- is installed, it can add to the table. When it is uninstalled, it can delete from the
-- table. Theme switching is only accessible from the admin UI for subsites, therefore
-- we don't need permissions on subsite_themes ...
-- the css column contains a list of CSS file/media pairs.
-- css and the form/list templates can be null because evil old OpenACS provides defaults
-- for these.
create table subsite_themes (
key text
constraint subsite_theme_key_pk
primary key,
name text
constraint subsite_theme_name_nn
not null,
template text
constraint subsite_theme_template_nn
not null,
css text,
form_template text,
list_template text,
list_filter_template text
);
-- Insert the old themes that were hard-wired into earlier versions of acs-subsite.
insert into subsite_themes
(key, name, template)
values
('obsolete_plain', 'Obsolete Plain', '/www/default-master');
insert into subsite_themes
(key, name, template)
values
('obsolete_tabbed', 'Obsolete Tabbed', '/packages/acs-subsite/www/group-master');
select define_function_args('application_group__new','group_id,object_type;application_group,creation_date;now(),creation_user,creation_ip,email,url,group_name,package_id,join_policy,context_id');
create or replace function application_group__new(integer,varchar,timestamptz,integer,varchar,varchar,varchar,varchar,integer,varchar,integer)
returns integer as '
declare
new__group_id alias for $1;
new__object_type alias for $2; -- default ''application_group'',
new__creation_date alias for $3; -- default sysdate,
new__creation_user alias for $4; -- default null,
new__creation_ip alias for $5; -- default null,
new__email alias for $6; -- default null,
new__url alias for $7; -- default null,
new__group_name alias for $8;
new__package_id alias for $9;
new__join_policy alias for $10;
new__context_id alias for $11; -- default null
v_group_id application_groups.group_id%TYPE;
begin
v_group_id := acs_group__new (
new__group_id,
new__object_type,
new__creation_date,
new__creation_user,
new__creation_ip,
new__email,
new__url,
new__group_name,
new__join_policy,
new__context_id
);
insert into application_groups (group_id, package_id)
values (v_group_id, new__package_id);
return v_group_id;
end;' language 'plpgsql';
ad_library {
Installation procs for email-image management
@author Miguel Marin (miguelmarin@viaro.net) Viaro Networks (www.viaro.net)
}
namespace eval subsite {}
ad_proc -private subsite::package_install {} {} {
set type_id [content::type::new -content_type "email_image" -pretty_name "Email_Image" \
-pretty_plural "Email_Images" -table_name "users_email_image" -id_column "email_image_id"]
set folder_id [content::folder::new -name "Email_Images" -label "Email_Images"]
content::folder::register_content_type -folder_id $folder_id -content_type "email_image"
}
ad_proc -private subsite::after_upgrade {
{-from_version_name:required}
{-to_version_name:required}
} {
After upgrade callback for acs-subsite.
} {
apm_upgrade_logic \
-from_version_name $from_version_name \
-to_version_name $to_version_name \
-spec {
5.2.0d1 5.2.0d2 {
set type_id [content::type::new -content_type "email_image" -pretty_name "Email_Image" \
-pretty_plural "Email_Images" -table_name "users_email_image" -id_column "email_image_id"]
set folder_id [content::folder::new -name "Email_Images" -label "Email_Images"]
content::folder::register_content_type -folder_id $folder_id -content_type "email_image"
}
5.2.0a1 5.2.0a2 {
set value [parameter::get -parameter "AsmForRegisterId" -package_id [subsite::main_site_id]]
if {$value eq ""} {
apm_parameter_register "AsmForRegisterId" "Assessment used on the registration process." "acs-subsite" "0" "number" "user-login"
}
apm_parameter_register "RegImplName" "Name of the implementation used in the registration process" "acs-subsite" "asm_url" "string" "user-login"
}
5.2.0a1 5.2.0a2 {
set value [parameter::get -parameter "RegistrationId" -package_id [subsite::main_site_id]]
if {$value eq ""} {
apm_parameter_register "RegistrationId" "Assessment used on the registration process." "acs-subsite" "0" "number" "user-login"
}
set value [parameter::get -parameter "RegistrationId" -package_id [subsite::main_site_id]]
if {$value eq ""} {
apm_parameter_register "RegistrationImplName" "Name of the implementation used in the registration process" "acs-subsite" "asm_url" "string" "user-login"
}
}
5.2.0a2 5.2.0a3 {
db_transaction {
db_foreach select_group_name {select group_id, group_name from groups} {
if { ![empty_string_p [info procs "::lang::util::convert_to_i18n"]] } {
set pretty_name [lang::util::convert_to_i18n -message_key "group_title_${group_id}" -text "$group_name"]
} else {
set pretty_name "$group_name"
}
db_dml title_update "update acs_objects set title=:pretty_name where object_id = :group_id"
}
}
}
5.2.0a1 5.2.0a2 {
set value [parameter::get -parameter "RegistrationId" -package_id [subsite::main_site_id]]
if {$value eq ""} {
apm_parameter_register "RegistrationId" "Assessment used on the registration process." "acs-subsite" "0" "number" "user-login"
}
set value [parameter::get -parameter "RegistrationId" -package_id [subsite::main_site_id]]
if {$value eq ""} {
apm_parameter_register "RegistrationImplName" "Name of the implementation used in the registration process" "acs-subsite" "asm_url" "string" "user-login"
}
}
5.2.0a2 5.2.0a3 {
db_transaction {
db_foreach select_group_name {select group_id, group_name from groups} {
if { ![empty_string_p [info procs "::lang::util::convert_to_i18n"]] } {
set pretty_name [lang::util::convert_to_i18n -message_key "group_title_${group_id}" -text "$group_name"]
} else {
set pretty_name "$group_name"
}
db_dml title_update "update acs_objects set title=:pretty_name where object_id = :group_id"
}
}
}
5.5.0d7 5.5.0d8 {
db_transaction {
set package_keys ([join '[subsite::package_keys]' ,])
foreach subsite_id [db_list get_subsite_ids {}] {
set new_css [list]
set css [parameter::get \
-package_id $subsite_id \
-parameter ThemeCSS \
-default ""]
if { $css ne "" } {
foreach css $css {
lappend new_css [list [list href [lindex $css 0]] \
[list media [lindex $css 1]]]
}
parameter::set_value \
-package_id $subsite_id \
-parameter ThemeCSS \
-value $new_css
}
}
}
}
}
}
<?xml version="1.0"?>
<queryset>
<fullquery name="subsite::after_upgrade.get_subsite_ids">
<querytext>
select package_id
from apm_packages
where package_key in $package_keys
</querytext>
</fullquery>
</queryset>
ad_library {
Callback definitions
@author Jeff Davis <davis@xarg.net>
@creation-date 2005-03-11
@cvs-id $Id$
}
ad_proc -public -callback user::workspace {
-user_id
} {
used to generate html fragments for display on the /pvt/home page.
The html fragment should have an h2 header for sectioning.
@param user_id - the user to display
@see callback::user::workspace::impl::acs-subsite
} -
ad_proc -public -callback user::workspace -impl acs-subsite {
-user_id
} {
Generate a table showing the application group membership
} {
return [template::adp_include /packages/acs-subsite/lib/user-subsites [list user_id $user_id]]
}
ad_proc -public -callback user::registration {
-package_id
} {
used to verify if there is another registration process.
The implementation must return the url of the registration page.
} -
ad_proc -callback subsite::get_extra_headers {
} {
returns any further header stuff that needs to be added
} -
ad_proc -callback subsite::header_onload {
} {
returns any javascript function that needs to be loaded
the callback implementation should simply do:
return {your_function(params);}
} -
<?xml version="1.0"?>
<queryset>
<rdbms><type>oracle</type><version>8.1.6</version></rdbms>
<fullquery name="email_image::new_item.lob_size">
<querytext>
update cr_revisions
set content_length = dbms_lob.getlength(content)
where revision_id = :revision_id
</querytext>
</fullquery>
<fullquery name="email_image::new_item.lob_content">
<querytext>
update cr_revisions
set content = empty_blob()
where revision_id = :revision_id
returning content into :1
</querytext>
</fullquery>
<fullquery name="email_image::edit_email_image.lob_size">
<querytext>
update cr_revisions
set content_length = dbms_lob.getlength(content)
where revision_id = :revision_id
</querytext>
</fullquery>
<fullquery name="email_image::edit_email_image.lob_content">
<querytext>
update cr_revisions
set content = empty_blob()
where revision_id = :revision_id
returning content into :1
</querytext>
</fullquery>
<fullquery name="email_image::add_relation.add_relation">
<querytext>
begin
:1 := acs_rel.new (
rel_type => 'email_image_rel',
object_id_one => :user_id,
object_id_two => :item_id);
end;
</querytext>
</fullquery>
</queryset>
<?xml version="1.0"?>
<queryset>
<rdbms><type>postgresql</type><version>7.1</version></rdbms>
<fullquery name="email_image::new_item.lob_size">
<querytext>
update cr_revisions
set content_length = lob_length(lob)
where revision_id = :revision_id
</querytext>
</fullquery>
<fullquery name="email_image::new_item.lob_content">
<querytext>
update cr_revisions
set mime_type = :mime_type,
lob = [set __lob_id [db_string get_lob_id "select empty_lob()"]]
where revision_id = :revision_id
</querytext>
</fullquery>
<fullquery name="email_image::edit_email_image.lob_size">
<querytext>
update cr_revisions
set content_length = lob_length(lob)
where revision_id = :revision_id
</querytext>
</fullquery>
<fullquery name="email_image::edit_email_image.lob_content">
<querytext>
update cr_revisions
set mime_type = :mime_type,
lob = [set __lob_id [db_string get_lob_id "select empty_lob()"]]
where revision_id = :revision_id
</querytext>
</fullquery>
<fullquery name="email_image::add_relation.add_relation">
<querytext>
select acs_rel__new (
null,
'email_image_rel',
:user_id,
:item_id,
null,
null,
null
)
</querytext>
</fullquery>
</queryset>
This diff is collapsed.
<?xml version="1.0"?>
<queryset>
<fullquery name="email_image::get_email.get_email">
<querytext>
select email
from parties
where party_id = :user_id
</querytext>
</fullquery>
<fullquery name="email_image::get_priv_email.get_private_email">
<querytext>
select priv_email
from users
where user_id = :user_id
</querytext>
</fullquery>
<fullquery name="email_image::get_folder_id.check_folder_name">
<querytext>
select folder_id from cr_folders
where label = 'Email_Images'
</querytext>
</fullquery>
<fullquery name="email_image::get_related_item_id.get_rel_item">
<querytext>
select object_id_two from acs_rels
where rel_type = 'email_image_rel' and object_id_one = :user_id
</querytext>
</fullquery>
<fullquery name="email_image::update_private_p.update_users">
<querytext>
update users
set priv_email = :level
where user_id = :user_id
</querytext>
</fullquery>
<fullquery name="email_image::new_item.update_cr_items">
<querytext>
update cr_items
set live_revision = :revision_id
where item_id = :item_id
</querytext>
</fullquery>
<fullquery name="email_image::edit_email_image.update_cr_items">
<querytext>
update cr_items
set live_revision = :revision_id
where item_id = :item_id
</querytext>
</fullquery>
</queryset>
# /packages/subsite/tcl/subsite-procs.tcl
ad_library {
Procs to manage the default template's navigation multirow.
@author Don Baccus (dhogaza@pacifier.com)
@creation-date 2008-04-26
@cvs-id $Id$
}
namespace eval subsite_navigation {
}
ad_proc -public subsite_navigation::define_pageflow {
{-subsite_id ""}
{-show_applications_p 1}
{-no_tab_application_list ""}
{-initial_pageflow ""}
{-navigation_multirow navigation}
{-group main}
{-subgroup sub}
} {
Defines the page flow of the subsite.
This sets up a navigation multirow as defined by the default master installed
by openacs, which renders it as one or more rows of tabs. The standard CSS
defines classes for two rows of tabs, if you want more, you must define your own
CSS classes.
If the navigation multirow doesn't exist, we create it.
@param subsite_id The package id of the subsite we're interested in (defaults to current)
@param show_applications_p If true, autogenerate tabs for applications (not declared
boolean because the tabbed master takes this from a package parameter)
@param no_tab_application_list A list of application package keys to ignore when
autogenerating tabs for applications
@param initial_pageflow Add these subsections before computing the rest of the page flow
@param navigation_multirow The name of the multirow used to build the nav bars
@param group Group name for the primary section
@param subgroup Group name for the subsection (opened under a selected tab)
} {
if { $subsite_id eq "" } {
set subsite_id [ad_conn subsite_id]
}
set pageflow [subsite_navigation::get_pageflow_struct \
-subsite_id $subsite_id \
-initial_pageflow $initial_pageflow \
-show_applications_p $show_applications_p \
-no_tab_application_list $no_tab_application_list]
set base_url [subsite::get_element -subsite_id $subsite_id -element url]
if { ![template::multirow exists $navigation_multirow] } {
template::multirow create $navigation_multirow group label href target \
title lang accesskey class id tabindex
}
foreach { section_name section_spec } $pageflow {
array set section_a {
label {}
url {}
title {}
subsections {}
folder {}
selected_patterns {}
accesskey {}
}
array set section_a $section_spec
set section_a(name) $section_name
set selected_p [add_section_row \
-subsite_id $subsite_id \
-array section_a \
-base_url $base_url \
-group $group \
-multirow $navigation_multirow]
if { $selected_p } {
foreach { subsection_name subsection_spec } $section_a(subsections) {
array set subsection_a {
label {}
title {}
folder {}
url {}
selected_patterns {}
accesskey {}
}
array set subsection_a $subsection_spec
set subsection_a(name) $subsection_name
set subsection_a(folder) [file join $section_a(folder) $subsection_a(folder)]
add_section_row \
-subsite_id $subsite_id \
-array subsection_a \
-base_url $base_url \
-group $subgroup \
-multirow $navigation_multirow
}
}
}
}
ad_proc -public subsite_navigation::add_section_row {
{-subsite_id ""}
{-array:required}
{-base_url:required}
{-multirow:required}
{-group:required}
{-section {}}
} {
Helper proc for adding rows of sections to the page flow of the subsite.
@see subsite_navigation::define_pageflow
} {
upvar $array info
# the folder index page is called .
if { $info(url) eq "" || $info(url) eq "index" || \
[string match "*/" $info(url)] || [string match "*/index" $info(url)] } {
set info(url) "[string range $info(url) 0 [string last / $info(url)]]."
}
if { [ad_conn node_id] ==
[site_node::closest_ancestor_package -include_self \
-node_id [site_node::get_node_id_from_object_id -object_id $subsite_id] \
-package_key [subsite::package_keys] \
-url [ad_conn url]] } {
set current_url [ad_conn extra_url]
} else {
# Need to prepend the path from the subsite to this package
set current_url [string range [ad_conn url] [string length $base_url] end]
}
set info(url) [file join $info(folder) $info(url)]
regsub {\.$} $info(url) "" info(url)
# Default to not selected
set selected_p 0
set info(tabindex) [template::multirow size $multirow]
if { $info(accesskey) eq "" } {
set info(accesskey) $info(tabindex)
}
if { $current_url eq $info(url) || $info(name) eq $section } {
set selected_p 1
} else {
foreach pattern $info(selected_patterns) {
set full_pattern [file join $info(folder) $pattern]
if { [string match $full_pattern $current_url] } {
set selected_p 1
break
}
}
}
# DRB: Expr thinks "-" is a subtraction operator thus this caveman if...
if { $selected_p } {
set navigation_id ${group}-navigation-active
} else {
set navigation_id ""
}
template::multirow append $multirow $group $info(label) [file join $base_url $info(url)] \
"" $info(title) "" $info(accesskey) "" $navigation_id [template::multirow size $multirow]
return $selected_p
}
ad_proc -public subsite_navigation::get_section_info {
{-array "section_info"}
{-navigation_multirow "navigation"}
} {
Takes the navigation_multirow and sets the passed array name
with the elements label and url of the selected section.
} {
upvar $array row
# Find the label of the selected section
array set row {
label {}
url {}
}
template::multirow foreach $navigation_multirow {
if { [template::util::is_true $selected_p] } {
set row(label) $label
set row(url) $url
break
}
}
}
ad_proc -public subsite_navigation::get_pageflow_struct {
{-subsite_id ""}
{-initial_pageflow ""}
{-show_applications_p 1}
{-no_tab_application_list ""}
} {
Defines the page flow structure.
@param subsite_id The package id of the subsite we're interested in (defaults to current)
@param initial_pageflow Add these subsections before computing the rest of the page flow
@param show_applications_p If true, autogenerate tabs for applications (not declared
boolean because the tabbed master takes this from a package parameter)
@param no_tab_application_list A list of application package keys to ignore when
autogenerating tabs for applications
} {
set pageflow $initial_pageflow
set subsite_node_id [site_node::get_node_id_from_object_id -object_id $subsite_id]
set subsite_url [site_node::get_element -node_id $subsite_node_id -element url]
set user_id [ad_conn user_id]
set admin_p [permission::permission_p \
-object_id [site_node::closest_ancestor_package -include_self \
-node_id $subsite_node_id \
-package_key [subsite::package_keys] \
-url [ad_conn url]] \
-privilege admin \
-party_id [ad_conn untrusted_user_id]]
set show_member_list_to [parameter::get -parameter "ShowMembersListTo" -package_id $subsite_id -default 2]
if { $admin_p || ($user_id != 0 && $show_member_list_to == 1) || \
$show_member_list_to == 0 } {
set pageflow [concat $pageflow [parameter::get -package_id [ad_conn subsite_id] \
-parameter MembersViewNavbarTabsList -default ""]]
}
set index_redirect_url [parameter::get -parameter "IndexRedirectUrl" -package_id $subsite_id]
set index_internal_redirect_url [parameter::get -parameter "IndexInternalRedirectUrl" -package_id $subsite_id]
regsub {(.*)/packages} $index_internal_redirect_url "" index_internal_redirect_url
regexp {(/[-[:alnum:]]+/)(.*)$} $index_internal_redirect_url dummy index_internal_redirect_url
set child_urls [lsort -ascii [site_node::get_children -node_id $subsite_node_id -package_type apm_application]]
if { $show_applications_p } {
foreach child_url $child_urls {
array set child_node [site_node::get_from_url -exact -url $child_url]
if { $child_url ne $index_redirect_url &&
$child_url ne $index_internal_redirect_url &&
[lsearch -exact $no_tab_application_list $child_node(package_key)] == -1 } {
lappend pageflow $child_node(name) [list \
label $child_node(instance_name) \
folder $child_node(name) \
url {} \
selected_patterns *]
}
}
}
if { $admin_p } {
set pageflow [concat $pageflow [parameter::get -package_id [ad_conn subsite_id] \
-parameter AdminNavbarTabsList -default ""]]
}
return $pageflow
}
<master>
<property name="title">#acs-subsite.manage_users_email#</property>
<property name="context">@context;noquote@</property>
<formtemplate id=private-email></formtemplate>
\ No newline at end of file
ad_page_contract {
Administer the PrivateEmailLevelP parameter
@author Miguel Marin (miguelmarin@viaro.net) Viaro Networks (www.viaro.net)
} {
} -properties {
context:onevalue
}
set page_title "\"#acs-subsite.manage_users_email\#\""
set context [list [list "." "Users"] "\"#acs-subsite.manage_users_email\#\""]
set user_id [auth::require_login -account_status closed]
ad_form -name private-email -form {
{level:integer(select)
{label "\#acs-subsite.Change_my_email_P\#:"}
{options {{"[_ acs-subsite.email_as_text_admin]" 4} {"[_ acs-subsite.email_as_image_admin]" 3} \
{"[_ acs-subsite.email_as_a_form_admin]" 2} {"[_ acs-subsite.email_dont_show_admin]" 1}}}
}
} -on_request {
set level [parameter::get_from_package_key -package_key "acs-subsite" \
-parameter "PrivateEmailLevelP" -default 4]
} -on_submit {
set package_id [apm_package_id_from_key acs-subsite]
parameter::set_value -package_id $package_id -parameter "PrivateEmailLevelP" -value $level
} -after_submit {
ad_returnredirect "/acs-admin/users/"
}
\ No newline at end of file
<master>
<property name="title">@page_title@</property>
<property name="context">@context@</property>
<property name="focus">subsite.instance_name</property>
<formtemplate id="subsite"></formtemplate>
ad_page_contract {
Convert the current subsite to one of its descendent subsite types.
@author Steffen Tiedemann Christensen (steffen@christensen.name)
@creation-date 2003-09-26
}
auth::require_login
set page_title "Convert Subsite To Descendent Type"
set context [list $page_title]
set subsite_package_options [apm::get_package_descendent_options [ad_conn package_key]]
if { [llength $subsite_package_options] == 0 } {
return .
ad_script_abort
}
ad_form -name subsite -cancel_url . -form {
{package_key:text(select)
{label "Subsite Package"}
{help_text "Choose the new subsite package type"}
{options $subsite_package_options}
}
} -on_submit {
if { $package_key ne [ad_conn package_key] } {
apm::convert_type \
-package_id [ad_conn package_id] \
-old_package_key [ad_conn package_key] \
-new_package_key $package_key
}
ad_returnredirect .
ad_script_abort
}
ad_page_contract {
spits out correctly MIME-typed bits for a user's email-image
@author Miguel Marin (miguelmarin@viaro.net) Viaro Networks (www.viaro.net)
} {
revision_id:integer
}
cr_write_content -revision_id $revision_id
<master>
<property name="title">@page_title;noquote@</property>
<property name="context">@context;noquote@</property>
<h4>#acs-subsite.mail_a_message_to# @first_names@ @last_name@</h4>
<formtemplate id=send-email></formtemplate>
\ No newline at end of file
ad_page_contract {
Sends an email to the user with user_id = sendto
@author Miguel Marin (miguelmarin@viaro.net) Viaro Networks (www.viaro.net)
} {
sendto:notnull
{return_url ""}
} -properties {
context:onevalue
}
set user_id [auth::require_login -account_status closed]
set page_title "\#acs-subsite.Send_email_to_this_user\#"
set context [list [list [ad_pvt_home] [ad_pvt_home_name]] "Send Email"]
if {$return_url eq ""} {
set return_url [ad_pvt_home]
}
db_1row user_to_info { *SQL* }
set from [email_image::get_email -user_id $user_id]
ad_form -name send-email -export {sendto return_url} -form {
{from:text(text),optional
{label "From:"}
{html {{disabled ""} {size 40}}}
{value $from}
}
{subject:text(text)
{label "Subject:"}
{html {size 70}}
}
{body:text(textarea),nospell
{label "Body:"}
{html {rows 10 cols 55}}
{value ""}
}
} -on_submit {
set to [email_image::get_email -user_id $sendto]
if {[catch {acs_mail_lite::send -send_immediately -to_addr $to -from_addr $from -subject $subject -body $body} errmsg]} {
ad_return_error "Mail Failed" "<p>The system was unable to send email. Please notify the user personally. This problem is probably caused by a misconfiguration of your email system. Here is the error:</p>
<div><code> [ad_quotehtml $errmsg] </code></div>"
}
} -after_submit {
ad_returnredirect $return_url
}
<?xml version="1.0"?>
<queryset>
<fullquery name="user_to_info">
<querytext>
select first_names, last_name
from cc_users
where user_id = :sendto
</querytext>
</fullquery>
</queryset>
<master>
<property name="&doc">doc</property>
<property name="context">@context;noquote@</property>
<formtemplate id=private-email></formtemplate>
\ No newline at end of file
ad_page_contract {
Allows users to change their priv_email field in the users table
@author Miguel Marin (miguelmarin@viaro.net) Viaro Networks (www.viaro.net)
} {
{user_id ""}
{return_url ""}
}
if { $return_url eq "" } {
set return_url [ad_pvt_home]
}
set doc(title) [_ acs-subsite.Change_my_email_P]
set context [list [list [ad_pvt_home] [ad_pvt_home_name]] $doc(title)]
if {$user_id eq ""} {
set user_id [auth::require_login -account_status closed]
}
ad_form -name private-email -export return_url -form {
{level:integer(select)
{label "\#acs-subsite.Change_my_email_P\#:"}
{options {{"[_ acs-subsite.email_as_text]" 4} {"[_ acs-subsite.email_as_image]" 3} \
{"[_ acs-subsite.email_as_a_form]" 2} {"[_ acs-subsite.email_dont_show]" 1}}}
}
} -on_request {
set level [email_image::get_priv_email -user_id $user_id]
} -on_submit {
email_image::update_private_p -user_id $user_id -level $level
} -after_submit {
ad_returnredirect $return_url
}
\ No newline at end of file
<master>
<property name="title">#acs-subsite.Reset_Password#</property>
<property name="context">@context;noquote@</property>
<if @message@ not nil>
<div class="general-message">@message@</div>
</if>
<formtemplate id="reset"></formtemplate>
ad_page_contract {
Let's the user reset his/her password.
@cvs-id $Id$
} {
{user_id {[ad_conn untrusted_user_id]}}
{return_url ""}
{password_hash ""}
{message ""}
}
# Redirect to HTTPS if so configured
if { [security::RestrictLoginToSSLP] } {
security::require_secure_conn
}
if { ![auth::password::can_change_p -user_id $user_id] } {
ad_return_error "Not supported" "Changing password is not supported."
}
set admin_p [permission::permission_p -object_id $user_id -privilege admin]
if { !$admin_p } {
permission::require_permission -party_id $user_id -object_id $user_id -privilege write
}
set page_title [_ acs-subsite.Reset_Password]
set context [list [list [ad_pvt_home] [ad_pvt_home_name]] $page_title]
set system_name [ad_system_name]
set site_link [ad_site_home_link]
acs_user::get -user_id $user_id -array user
ad_form -name reset -edit_buttons [list [list [_ acs-kernel.common_update] "ok"]] -form {
{user_id:integer(hidden)}
{return_url:text(hidden),optional}
{password_hash:text(hidden),optional}
{message:text(hidden),optional}
}
ad_form -extend -name reset -form {
{password_1:text(password)
{label {[_ acs-subsite.New_Password]}}
{html {size 20}}
}
{password_2:text(password)
{label {[_ acs-subsite.Confirm]}}
{html {size 20}}
}
} -on_request {
} -validate {
{password_1
{ [string equal $password_1 $password_2] }
{ Passwords don't match }
}
} -on_submit {
set password_hash_local [db_string get_password_hash {SELECT password FROM users WHERE user_id = :user_id}]
if {$password_hash_local eq $password_hash} {
array set result [auth::password::change \
-user_id $user_id \
-old_password "" \
-new_password $password_1]
switch $result(password_status) {
ok {
# Continue
}
default {
form set_error reset password_1 $result(password_message)
break
}
}
} else {
form set_error reset password_1 "Invalid hash"
break
}
} -after_submit {
if { $return_url eq "" } {
set return_url [ad_pvt_home]
set pvt_home_name [ad_pvt_home_name]
set continue_label [_ acs-subsite.Continue_to_your_account]
} else {
set continue_label [_ acs-subsite.Continue]
}
set message [_ acs-subsite.confirmation_password_changed]
set continue_url $return_url
ad_return_template /packages/acs-subsite/www/register/display-message
}
<?xml version="1.0"?>
<!DOCTYPE queryset PUBLIC "-//OpenACS//DTD XQL 1.0//EN" "http://www.thecodemill.biz/repository/xql.dtd">
<!-- packages/acs-subsite/www/user/portrait/comment-edit.xql -->
<!-- @author Emmanuelle Raffenne (eraffenne@dia.uned.es) -->
<!-- @creation-date 2007-11-27 -->
<!-- @arch-tag: d51369f7-896b-494e-8f83-92366f1a5349 -->
<!-- @cvs-id $Id$ -->
<queryset>
<fullquery name="user_info">
<querytext>
select first_names, last_name
from persons
where person_id = :user_id
</querytext>
</fullquery>
<fullquery name="portrait_info">
<querytext>
select description
from cr_revisions
where revision_id = (select live_revision
from cr_items c, acs_rels a
where c.item_id = a.object_id_two
and a.object_id_one = :user_id
and a.rel_type = 'user_portrait_rel')
</querytext>
</fullquery>
<fullquery name="comment_update">
<querytext>
update cr_revisions
set description=:description
where revision_id = (select live_revision
from acs_rels a, cr_items c
where a.object_id_two = c.item_id
and a.object_id_one = :user_id
and a.rel_type = 'user_portrait_rel')
</querytext>
</fullquery>
</queryset>
\ No newline at end of file
<?xml version="1.0"?>
<!DOCTYPE queryset PUBLIC "-//OpenACS//DTD XQL 1.0//EN" "http://www.thecodemill.biz/repository/xql.dtd">
<!-- packages/acs-subsite/www/user/portrait/erase.xql -->
<!-- @author Emmanuelle Raffenne (eraffenne@dia.uned.es) -->
<!-- @creation-date 2007-11-27 -->
<queryset>
<fullquery name="get_item_id">
<querytext>
select object_id_two
from acs_rels
where object_id_one = :user_id
and rel_type = 'user_portrait_rel'
</querytext>
</fullquery>
<fullquery name="get_images">
<querytext>
select object_id
from acs_objects
where object_type in ('cr_item_child_rel','image')
and context_id = :item_id
and object_id not in (select live_revision from cr_items where item_id = :item_id)
</querytext>
</fullquery>
<fullquery name="old_item_id">
<querytext>
select object_id
from acs_objects
where object_type = 'content_item'
and context_id = :item_id
</querytext>
</fullquery>
<fullquery name="delete_rel">
<querytext>
delete from acs_rels
where object_id_two = :item_id
and object_id_one = :user_id
and rel_type = 'user_portrait_rel'
</querytext>
</fullquery>
</queryset>
\ No newline at end of file
<?xml version="1.0"?>
<queryset>
<rdbms><type>oracle</type><version>8.1.6</version></rdbms>
<fullquery name="create_rel">
<querytext>
begin
:1 := acs_rel.new (
rel_type => 'user_portrait_rel',
object_id_one => :user_id,
object_id_two => :item_id);
end;
</querytext>
</fullquery>
</queryset>
<?xml version="1.0"?>
<queryset>
<rdbms><type>postgresql</type><version>7.1</version></rdbms>
<fullquery name="create_rel">
<querytext>
select acs_rel__new (
null,
'user_portrait_rel',
:user_id,
:item_id,
null,
null,
null
)
</querytext>
</fullquery>
</queryset>
<?xml version="1.0"?>
<!DOCTYPE queryset PUBLIC "-//OpenACS//DTD XQL 1.0//EN" "http://www.thecodemill.biz/repository/xql.dtd">
<!-- packages/acs-subsite/www/user/portrait/upload.xql -->
<!-- @author Emmanuelle Raffenne (eraffenne@dia.uned.es) -->
<!-- @creation-date 2007-11-21 -->
<!-- @arch-tag: 136be82f-a97a-44ec-ba75-939bdcad0004 -->
<!-- @cvs-id $Id$ -->
<queryset>
<fullquery name="checkportrait">
<querytext>
SELECT live_revision as revision_id, item_id
FROM acs_rels a, cr_items c
WHERE a.object_id_two = c.item_id
AND a.rel_type = 'user_portrait_rel'
AND a.object_id_one = :current_user_id
AND c.live_revision is not NULL
</querytext>
</fullquery>
<fullquery name="getstory">
<querytext>
select description
from cr_revisions
where revision_id = :revision_id
</querytext>
</fullquery>
<fullquery name="get_name">
<querytext>
select first_names, last_name
from persons
where person_id=:user_id
</querytext>
</fullquery>
</queryset>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment