Forum OpenACS Development: Does Calendar pkg support multiple private calendar?

Request notifications

Does Calendar pkg support multiple private calendars?

Furthermore, assuming a user has two calendars: one private, the other shared. How does he access the shared calendar?

Currently, it shows data only from the private and unique calendar

That QRY in the index page /calendar/ throws errors if more private calendars are created to users.

select calendar_id
from calendars
where owner_id = :party_id
and private_p = 't'

Is there any way to enable access to shared calendars?

Database operation "0or1row" failed (exception NSINT, "Query returned more than one row.")

while executing
"ns_pg_bind 0or1row nsdb0 {
select calendar_id
from calendars
where owner_id = :party_id
and private_p = 't'
}"
("uplevel" body line 1)
invoked from within
"uplevel $ulevel [list ns_pg_bind $type $db $sql]"
invoked from within
"db_exec 0or1row $db $full_name $sql"
("uplevel" body line 2)
invoked from within
"uplevel 1 $code_block "
invoked from within
"db_with_handle -dbn $dbn db {
set selection [db_exec 0or1row $db $full_name $sql]
}"
(procedure "::nsf::procs::db_string" line 27)
invoked from within
"db_string get_calendar_info {} -default 0"

Collapse
Posted by Iuri Sampaio on
so far, I went through the source code, starting at include src=“cal-option” , line 40, cal-options.adp

Then, set calendar_list [calendar::calendar_list] line 24, cal-options.tcl

and, set new_list [db_list_of_lists select_calendar_list {}] line 328, calendar-procs.tcl

fullquery statement, name="calendar::calendar_list.select_calendar_list" leads back to TCL file, respectively $permission_clause, which is empty as well as $privilege

select calendar_name,
calendar_id,
acs_permission__permission_p(calendar_id, :user_id, 'calendar_admin') as calendar_admin_p
from calendars
where (private_p = 'f' and package_id = :package_id $permissions_clause) or
(private_p = 't' and owner_id = :user_id)
order by private_p asc, upper(calendar_name)

I wrote ns_logs within ad_proc calendar_list and noticed neither $permission_clause nor $privilege were assigned (i.e. they were null).

[08/Jul/2018:07:25:49][2783.7fe0b0a3d700][-conn:evex:5:4249-] Notice: Running ad_proc calendar::calendar_list | |
[08/Jul/2018:07:25:49][2783.7fe0b0a3d700][-conn:evex:5:4250-] Error: Could not read file /var/www/evex/content-reposito

I’ve tried to grant permissions on calendar’s package apm permission UI.

However, I didn’t find a potential candidate of permission for such a specific granularity, which I would call calendar_shared_read, calendar_shared_write, calendar_shared_admin, …

It'd be even better if permissions such as calendar_read, calendar_show, … could serve to all types: private and shared.

/permissions/grant?application_url=&object_id=1291

Collapse
Posted by Iuri Sampaio on
This thread is somehow related to another one I created previously, regarding private and shared calendar.

https://openacs.org/forums/message-view?message_id=5376185