Index: openacs-4/packages/lors/lors.info
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/lors/lors.info,v
diff -u -r1.7 -r1.7.2.1
--- openacs-4/packages/lors/lors.info 17 May 2005 16:35:10 -0000 1.7
+++ openacs-4/packages/lors/lors.info 13 Jun 2005 15:10:40 -0000 1.7.2.1
@@ -7,16 +7,16 @@
ft
-
+ Ernie Ghiglione
- IMS Content Packaging and Medata Services.
-Implementation of IMS CP and MD for .LRN
+ IMS Content Packaging and Medata Services. Implementation of IMS CP and MD for .LRN 2004-08-06This is a service and library to manage IMS Content Packaging and Metadata. From version 0.4d onward it supports SCORM and Blackboard importsGPLhttp://www.gnu.org/copyleft/gpl.html1
-
+
+
Index: openacs-4/packages/lors/sql/postgresql/lors-imscp-create.sql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/lors/sql/postgresql/lors-imscp-create.sql,v
diff -u -r1.7 -r1.7.2.1
--- openacs-4/packages/lors/sql/postgresql/lors-imscp-create.sql 17 May 2005 16:35:10 -0000 1.7
+++ openacs-4/packages/lors/sql/postgresql/lors-imscp-create.sql 13 Jun 2005 15:10:41 -0000 1.7.2.1
@@ -96,7 +96,20 @@
);
+create or replace function ims_manifest__get_title (integer)
+returns varchar as '
+declare
+ get_title__man_id alias for $1;
+ get_title__course_name varchar(200);
+begin
+ return course_name
+ from ims_cp_manifests
+ where man_id = get_title__man_id;
+end;' language 'plpgsql';
+
+
+
-- Organizations
create table ims_cp_organizations (
org_id integer
@@ -133,7 +146,17 @@
'ims_organization__get_title' -- name_method
);
+create or replace function ims_organization__get_title (integer)
+returns varchar as '
+declare
+ get_title__org_id alias for $1;
+ get_title__identifier varchar(200);
+begin
+ return identifier
+ from ims_cp_organizations
+ where org_id = get_title__org_id;
+end;' language 'plpgsql';
-- Items
@@ -164,7 +187,8 @@
timelimitaction varchar(1000),
datafromlms varchar(200),
masteryscore varchar(255),
- isshared boolean default 'f' not null
+ isshared boolean default 'f' not null,
+ sort_order integer
);
-- create index for ims_cp_items
@@ -183,8 +207,19 @@
'ims_item__get_title' -- name_method
);
+create or replace function ims_item__get_title (integer)
+returns varchar as '
+declare
+ get_title__ims_item_id alias for $1;
+ get_title__item_title varchar(200);
+begin
+ return item_title
+ from ims_cp_items
+ where ims_item_id = get_title__ims_item_id;
+end;' language 'plpgsql';
+
-- Resources
create table ims_cp_resources (
@@ -222,7 +257,19 @@
'ims_resource__get_title' -- name_method
);
+create or replace function ims_resource__get_title (integer)
+returns varchar as '
+declare
+ get_title__res_id alias for $1;
+ get_title__identifier varchar(200);
+begin
+ return identifier
+ from ims_cp_resources
+ where res_id = get_title__res_id;
+end;' language 'plpgsql';
+
+
-- An item can have reference to one of more resources
-- therefore we need a table that takes care of this multiple
-- relationship
@@ -266,7 +313,7 @@
create table ims_cp_files (
file_id integer
constraint ims_cp_files_file_if_fk
- references cr_items(item_id)
+ references cr_revisions(revision_id)
on delete cascade,
res_id integer
constraint ims_cp_file_res_id_fk
@@ -298,8 +345,8 @@
constraint ims_cp_manifest_class__class_key_fk
references dotlrn_community_types(community_type),
isenabled boolean default 't' not null,
- istrackable boolean default 'f' not null,
- primary key (man_id, lorsm_instance_id)
+ istrackable boolean default 'f' not null
+ -- primary key (man_id, lorsm_instance_id)
);
comment on table ims_cp_manifest_class is '
Index: openacs-4/packages/lors/sql/postgresql/lors-imscp-drop.sql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/lors/sql/postgresql/lors-imscp-drop.sql,v
diff -u -r1.5 -r1.5.2.1
--- openacs-4/packages/lors/sql/postgresql/lors-imscp-drop.sql 17 May 2005 16:35:10 -0000 1.5
+++ openacs-4/packages/lors/sql/postgresql/lors-imscp-drop.sql 13 Jun 2005 15:10:41 -0000 1.5.2.1
@@ -19,5 +19,5 @@
drop table ims_cp_items;
drop table ims_cp_organizations;
drop table ims_cp_manifests;
+drop table lors_available_presentation_formats;
-
Index: openacs-4/packages/lors/sql/postgresql/upgrade/upgrade-0.6d-0.6d3.sql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/lors/sql/postgresql/upgrade/upgrade-0.6d-0.6d3.sql,v
diff -u -r1.1 -r1.1.2.1
--- openacs-4/packages/lors/sql/postgresql/upgrade/upgrade-0.6d-0.6d3.sql 25 Apr 2005 08:12:42 -0000 1.1
+++ openacs-4/packages/lors/sql/postgresql/upgrade/upgrade-0.6d-0.6d3.sql 13 Jun 2005 15:10:41 -0000 1.1.2.1
@@ -28,7 +28,8 @@
comment on table lorsm_course_presentation_formats is '
This table stores the available presentation formats for the courses. Its contains the pretty name
for the format, an id, and the folder in packages/lorsm/www/ where the presentation format is stored.
-Currently just two presentation formats exists, delivery and delivery-wihout-index, which we store on creation';
+Currently just tree presentation formats exists, delivery, delivery-wihout-index and delivery-bottom-bar,
+which we store on creation';
--Change presentation_id to format_id.
alter table ims_cp_manifests rename column presentation_id to course_presentation_format;
Fisheye: Tag 1.1.2.1 refers to a dead (removed) revision in file `openacs-4/packages/lors/sql/postgresql/upgrade/upgrade-0.6d3-0.6d4.sql'.
Fisheye: No comparison available. Pass `N' to diff?
Fisheye: Tag 1.1.2.1 refers to a dead (removed) revision in file `openacs-4/packages/lors/tcl/lors-callback-procs.tcl'.
Fisheye: No comparison available. Pass `N' to diff?
Index: openacs-4/packages/lors/tcl/lors-imscp-blackboard5-procs.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/lors/tcl/lors-imscp-blackboard5-procs.tcl,v
diff -u -r1.4 -r1.4.2.1
--- openacs-4/packages/lors/tcl/lors-imscp-blackboard5-procs.tcl 17 May 2005 16:35:11 -0000 1.4
+++ openacs-4/packages/lors/tcl/lors-imscp-blackboard5-procs.tcl 13 Jun 2005 15:10:41 -0000 1.4.2.1
@@ -165,7 +165,7 @@
@author Ernie Ghiglione (ErnieG@mm.st)
} {
- set docx [dom parse [read [open $file]]]
+ set docx [dom parse [::tDOM::xmlReadFile $file]]
set usersnode [$docx documentElement]
set userlist [list]
Index: openacs-4/packages/lors/tcl/lors-imscp-blackboard6-procs.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/lors/tcl/lors-imscp-blackboard6-procs.tcl,v
diff -u -r1.4 -r1.4.2.1
--- openacs-4/packages/lors/tcl/lors-imscp-blackboard6-procs.tcl 17 May 2005 16:35:11 -0000 1.4
+++ openacs-4/packages/lors/tcl/lors-imscp-blackboard6-procs.tcl 13 Jun 2005 15:10:41 -0000 1.4.2.1
@@ -207,12 +207,8 @@
@option file filename
@author Ernie Ghiglione (ErnieG@mm.st)
} {
-
- # set utf-8 system encoding
- encoding system utf-8
-
# open xml file
- set doc [dom parse [read [open $file]]]
+ set doc [dom parse [::tDOM::xmlReadFile $file]]
# coursetoc
set coursetoc [$doc documentElement]
@@ -247,12 +243,8 @@
@option file filename
@author Ernie Ghiglione (ErnieG@mm.st)
} {
-
- # set utf-8 system encoding
- encoding system utf-8
-
# open xml file
- set doc [dom parse [read [open $file]]]
+ set doc [dom parse [::tDOM::xmlReadFile $file]]
# content
set content [$doc documentElement]
@@ -328,10 +320,6 @@
@option filename directory and filename where we are putting the file
@author Ernie Ghiglione (ErnieG@mm.st)
} {
-
- # set utf-8 system encoding
- encoding system utf-8
-
# get directory info
set dirname [file dirname $filename]
@@ -389,12 +377,8 @@
@option file filename
@author Ernie Ghiglione (ErnieG@mm.st)
} {
-
- # set utf-8 system encoding
- encoding system utf-8
-
# open xml file
- set doc [dom parse [read [open $file]]]
+ set doc [dom parse [::tDOM::xmlReadFile $file]]
# content
set announcement [$doc documentElement]
@@ -552,12 +536,8 @@
@option file filename
@author Ernie Ghiglione (ErnieG@mm.st)
} {
-
- # set utf-8 system encoding
- encoding system utf-8
-
# open xml file
- set doc [dom parse [read [open $file]]]
+ set doc [dom parse [::tDOM::xmlReadFile $file]]
# content
set forum [$doc documentElement]
@@ -594,11 +574,8 @@
@option file filename
@author Ernie Ghiglione (ErnieG@mm.st)
} {
- # set utf-8 system encoding
- encoding system utf-8
-
# open manifest file with tDOM
- set doc [dom parse [read [open $tmp_dir/$file]]]
+ set doc [dom parse [::tDOM::xmlReadFile $tmp_dir/$file]]
# gets the manifest tree
set manifest [$doc documentElement]
# we add the xml namespace for dotLRN
@@ -613,7 +590,7 @@
if {[empty_string_p $metadata]} {
set filex res00001.dat
- set docx [dom parse [read [open $tmp_dir/$filex]]]
+ set docx [dom parse [::tDOM::xmlReadFile $tmp_dir/$filex]]
# gets BB's course info
set course [$docx documentElement]
@@ -669,18 +646,8 @@
@option file filename
@author Ernie Ghiglione (ErnieG@mm.st)
} {
-
- # set utf-8 system encoding
- encoding system utf-8
-
- # search for manifest file
- set file $file
-
- # set utf-8 system encoding
- encoding system utf-8
-
# open xml file
- set doc [dom parse [read [open $tmp_dir/$file]]]
+ set doc [dom parse [::tDOM::xmlReadFile $tmp_dir/$file]]
# gets the manifest tree
set manifest [$doc documentElement]
@@ -898,12 +865,8 @@
@author Ernie Ghiglione (ErnieG@mm.st)
} {
## Opens imsmanifest.xml
-
- # set utf-8 system encoding
- encoding system utf-8
-
# open manifest file with tDOM
- set doc [dom parse [read [open $tmp_dir/$file]]]
+ set doc [dom parse [::tDOM::xmlReadFile $tmp_dir/$file]]
# gets the manifest tree
set manifest [$doc documentElement]
Index: openacs-4/packages/lors/tcl/lors-imscp-procs.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/lors/tcl/lors-imscp-procs.tcl,v
diff -u -r1.7 -r1.7.2.1
--- openacs-4/packages/lors/tcl/lors-imscp-procs.tcl 17 May 2005 16:35:11 -0000 1.7
+++ openacs-4/packages/lors/tcl/lors-imscp-procs.tcl 13 Jun 2005 15:10:41 -0000 1.7.2.1
@@ -213,6 +213,7 @@
@option community_id Community ID
@option user_id user that adds the category. [ad_conn user_id] used by default.
@option creation_ip ip-address of the user that adds the category. [ad_conn peeraddr] used by default.
+ @option course_presentation_format course presentation format ID
@author Ernie Ghiglione (ErnieG@mm.st)
} {
Index: openacs-4/packages/lors/tcl/lors-imsmd-procs.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/lors/tcl/lors-imsmd-procs.tcl,v
diff -u -r1.6 -r1.6.2.1
--- openacs-4/packages/lors/tcl/lors-imsmd-procs.tcl 17 May 2005 16:35:11 -0000 1.6
+++ openacs-4/packages/lors/tcl/lors-imsmd-procs.tcl 13 Jun 2005 15:10:41 -0000 1.6.2.1
@@ -140,7 +140,8 @@
set prefix [[$tree child all imsmd:record] prefix]
set lom [$tree child all $var_lom]
} elseif { ![empty_string_p [$tree child all adlcp:location]] } {
- set lom [[dom parse [read [open $dir/[[$tree child all adlcp:location] text]]]] documentElement]
+ set doc [dom parse [::tDOM::xmlReadFile $dir/[[$tree child all adlcp:location] text]]]
+ set lom [$doc documentElement]
set prefix [$lom prefix]
} else {
set lom 0
Index: openacs-4/packages/lors-central/lors-central.info
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/lors-central/lors-central.info,v
diff -u -r1.1 -r1.1.2.1
--- openacs-4/packages/lors-central/lors-central.info 17 May 2005 16:07:47 -0000 1.1
+++ openacs-4/packages/lors-central/lors-central.info 13 Jun 2005 15:10:41 -0000 1.1.2.1
@@ -8,16 +8,16 @@
tlors-central
-
+ Miguel MarinViaro Netwoks (www.viaro.net) Application to manage the services from the Learning Object Repository. 2005-03-14This application manages the services from the Learning Object Repository: upload master courses, manage and create metadata, add resources and files to existent courses, creates new versions of LO's.
-
+
-
+
@@ -26,7 +26,8 @@
-
+
+
Index: openacs-4/packages/lors-central/catalog/lors-central.en_US.ISO-8859-1.xml
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/lors-central/catalog/lors-central.en_US.ISO-8859-1.xml,v
diff -u -r1.1 -r1.1.2.1
--- openacs-4/packages/lors-central/catalog/lors-central.en_US.ISO-8859-1.xml 17 May 2005 16:21:16 -0000 1.1
+++ openacs-4/packages/lors-central/catalog/lors-central.en_US.ISO-8859-1.xml 13 Jun 2005 15:10:41 -0000 1.1.2.1
@@ -1,32 +1,39 @@
-
+Action Not AllowedAdd ChildAdd an existent Learning ObjectAdd FileAdd From Clipboard:
+ Add MaterialAdd ObjectAdd This ItemAdd this learning object to your clipboardAdd to ClipboardAdd to this courseAdd to this resource
+ AdminAll ViewsAll Views of this object
+ and in the following Communities:And is in use in the following coursesAssociations:AssociateAssociate/Drop
- Associate to dotLRN Class
+ Associate to dotLRN Class or CommunityAssociate to this classAlready AssociatedAuthor:
+ BackChoose the file to upload
+ Class MembershipsClass NameClasses Using this CourseClick For PreviewClip This Resource
+ Community Memberships
+ Community NameCourse NameCourse VersionsCourses
@@ -36,13 +43,19 @@
DescriptionDisableddotLRN classes
+ dotLRN CommunitiesDropDrop association to this classEditEdit %name%
+ E-mailEnabledEverywhereFilename
+ Grant
+ Grant Permission to this users
+ Grant Permissions
+ Grant / RevokeUse the "Browse..." button to locate your file, then click "Open"HereHide
@@ -54,13 +67,18 @@
LiveLive Classes?Learning Object Files
+ Lors Central Admin
+ Lors Central PackageMakeMake Live EverywhereMake this liveManifest ID
+ Manage
+ MembershipsAdd New FileNew Learning ObjectNo
+ Not Allowedofof %name%One Course
@@ -70,8 +88,14 @@
One Learning ObjectPlease type a keywordPreview
+ priviliges to all members
+ Privilege on
+ Revoke
+ Revoke Permission to this usersSearchSearch Courses
+ Search for users first names, last name or email:
+ Search users to grant/revoke privilegesSet toShared?Shared Items In The Repository
@@ -92,6 +116,8 @@
Update VersionsUpload a New File or....Usage
+ users to grant privileges that match that search
+ User NameVersionVer. #Versions
Index: openacs-4/packages/lors-central/catalog/lors-central.es_ES.ISO-8859-1.xml
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/lors-central/catalog/lors-central.es_ES.ISO-8859-1.xml,v
diff -u -r1.1 -r1.1.2.1
--- openacs-4/packages/lors-central/catalog/lors-central.es_ES.ISO-8859-1.xml 17 May 2005 16:21:16 -0000 1.1
+++ openacs-4/packages/lors-central/catalog/lors-central.es_ES.ISO-8859-1.xml 13 Jun 2005 15:10:41 -0000 1.1.2.1
@@ -12,8 +12,10 @@
Agregar al sujetapapelesAgregar a este cursoAgregar a este recurso
+ AdministrarTodas las vistasTodas las vistas de este objeto
+ y en las siguientes comunidades:Y esta siendo utilizado en los siguientes cursosAsociaciones:Asociar
@@ -23,26 +25,35 @@
Already AsociadoAutor:Escoja el archivo que desea subir
+ Membresias con ClasesNombre de la ClaseClases que utilizan este cursoClick para previsualizarSujetar este Recurso
+ Membresias con Comunidades
+ Nombre de la comunidadNombre del CursoVersiones del CursoCursos
- Crear el nuevo archivo
+ Crear el nuevo archivo o ...ActualNombre del DepartamentoDescripcionDeshabilitadoclasses de dotLRN
+ comunidades de dotLRN/msg>
QuitarQuitar la asociacion de esta claseEditarEditar %name%
+ Correo ElectronicoHabilitadoEn todos ladosNombre del archivo
+ Otorgar
+ Otorgar permisos a este usuario
+ Otorgar permisos
+ Otorgar / QuitarUtilizar el boton de "Browse..." para localizar el archivo, luego presionar"Open"AquiOcultar
@@ -54,13 +65,16 @@
ActualClases donde es el actual?Archivos del Objeto de Aprendizaje
+ Administracion de Lors CentralHacerCambiar a actual en todas las clasesPoner actual en esta claseID del Manifesto
+ MembresiasAgregar Nuevo ArchivoNuevo Objeto de AprendisajeNo
+ no otorgadodede %name%Un Curso
@@ -70,8 +84,14 @@
Un Objeto de AprendizajePor favor ingrese una palabraPrevisualizacion
+ privilegios a todos los miembros
+ Privilegios sobre
+ Quitar
+ Quitar privilegios a estos usuariosBuscarBuscar Cursos
+ Buscar por el nombre, apellido o correo electronico del usuario:
+ Buscar usarios a Otorgar/Quitar privilegiosEstablecer aCompartido?Objetos Compartidos en el repositorio>
@@ -92,6 +112,8 @@
Actualizar VersionesSubir un Nuevo Archivo o....Utilizacion
+ hay usarios a otorgar privilefios que coincidan con esa busqueda
+ Nombre del UsuarioVersionVer. #Versiones
Index: openacs-4/packages/lors-central/catalog/lors-central.es_GT.ISO-8859-1.xml
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/lors-central/catalog/lors-central.es_GT.ISO-8859-1.xml,v
diff -u -r1.1 -r1.1.2.1
--- openacs-4/packages/lors-central/catalog/lors-central.es_GT.ISO-8859-1.xml 17 May 2005 16:21:16 -0000 1.1
+++ openacs-4/packages/lors-central/catalog/lors-central.es_GT.ISO-8859-1.xml 13 Jun 2005 15:10:41 -0000 1.1.2.1
@@ -12,8 +12,10 @@
Agregar al sujetapapelesAgregar a este cursoAgregar a este recurso
+ AdministrarTodas las vistasTodas las vistas de este objeto
+ y en las siguientes comunidades:Y esta siendo utilizado en los siguientes cursosAsociaciones:Asociar
@@ -23,26 +25,35 @@
Already AsociadoAutor:Escoja el archivo que desea subir
+ Membresias con ClasesNombre de la ClaseClases que utilizan este cursoClick para previsualizarSujetar este Recurso
+ Membresias con Comunidades
+ Nombre de la comunidadNombre del CursoVersiones del CursoCursos
- Crear el nuevo archivo
+ Crear el nuevo archivo o ...ActualNombre del DepartamentoDescripcionDeshabilitadoclasses de dotLRN
+ comunidades de dotLRN/msg>
QuitarQuitar la asociacion de esta claseEditarEditar %name%
+ Correo ElectronicoHabilitadoEn todos ladosNombre del archivo
+ Otorgar
+ Otorgar permisos a este usuario
+ Otorgar permisos
+ Otorgar / QuitarUtilizar el boton de "Browse..." para localizar el archivo, luego presionar"Open"AquiOcultar
@@ -54,13 +65,16 @@
ActualClases donde es el actual?Archivos del Objeto de Aprendizaje
+ Administracion de Lors CentralHacerCambiar a actual en todas las clasesPoner actual en esta claseID del Manifesto
+ MembresiasAgregar Nuevo ArchivoNuevo Objeto de AprendisajeNo
+ no otorgadodede %name%Un Curso
@@ -70,8 +84,14 @@
Un Objeto de AprendizajePor favor ingrese una palabraPrevisualizacion
+ privilegios a todos los miembros
+ Privilegios sobre
+ Quitar
+ Quitar privilegios a estos usuariosBuscarBuscar Cursos
+ Buscar por el nombre, apellido o correo electronico del usuario:
+ Buscar usarios a Otorgar/Quitar privilegiosEstablecer aCompartido?Objetos Compartidos en el repositorio>
@@ -92,6 +112,8 @@
Actualizar VersionesSubir un Nuevo Archivo o....Utilizacion
+ hay usarios a otorgar privilefios que coincidan con esa busqueda
+ Nombre del UsuarioVersionVer. #Versiones
Index: openacs-4/packages/lors-central/sql/postgresql/lors-central-create.sql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/lors-central/sql/postgresql/lors-central-create.sql,v
diff -u -r1.1 -r1.1.2.1
--- openacs-4/packages/lors-central/sql/postgresql/lors-central-create.sql 17 May 2005 16:21:17 -0000 1.1
+++ openacs-4/packages/lors-central/sql/postgresql/lors-central-create.sql 13 Jun 2005 15:10:41 -0000 1.1.2.1
@@ -1,8 +1,3 @@
-ALTER TABLE ims_cp_manifest_class DROP CONSTRAINT ims_cp_manifest_class_pkey;
-ALTER TABLE ims_cp_items ADD sort_order integer;
-ALTER TABLE ims_cp_files DROP CONSTRAINT ims_cp_files_file_if_fk;
-ALTER TABLE ims_cp_files ADD CONSTRAINT ims_cp_files_file_if_fk FOREIGN KEY (file_id) REFERENCES cr_revisions(revision_id) ON DELETE CASCADE;
-
create table ims_cp_items_map (
man_id int
constraint ims_cp_items_map_man_id_fk references ims_cp_manifests (man_id),
Index: openacs-4/packages/lors-central/tcl/apm-callbacks-procs.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/lors-central/tcl/apm-callbacks-procs.tcl,v
diff -u -r1.1 -r1.1.2.1
--- openacs-4/packages/lors-central/tcl/apm-callbacks-procs.tcl 17 May 2005 16:21:18 -0000 1.1
+++ openacs-4/packages/lors-central/tcl/apm-callbacks-procs.tcl 13 Jun 2005 15:10:42 -0000 1.1.2.1
@@ -86,5 +86,10 @@
0.1a2 0.1a3 {
lors_central::apm_callback::package_install
}
+ 0.1a3 0.1a4 {
+ apm_parameter_register "ManageLorsCentralP" "Restricts the users who can acces and modify courses in lors-central package. 1 - Only the swa, 0 - everybody. Defaults to 0" "lors-central" "0" "number"
+
+ apm_parameter_register "UploadUsingLorsCentralP" "Set to 1 if you want to upload courses using lors-central package instead of lorsm. You will need to have installed lors-central for this parameter to work." "lors-central" "0" "number"
+ }
}
-}
\ No newline at end of file
+}
Index: openacs-4/packages/lors-central/tcl/lors-central-install-procs.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/lors-central/tcl/lors-central-install-procs.tcl,v
diff -u -r1.1 -r1.1.2.1
--- openacs-4/packages/lors-central/tcl/lors-central-install-procs.tcl 17 May 2005 16:21:18 -0000 1.1
+++ openacs-4/packages/lors-central/tcl/lors-central-install-procs.tcl 13 Jun 2005 15:10:42 -0000 1.1.2.1
@@ -95,3 +95,19 @@
# Calling apm callback proc for notifications
lors_central::apm_callback::package_install
}
+
+ad_proc -private lors_central::install::package_uninstall {} {
+
+ Uninstall lors-central
+
+} {
+ set folder_id [lors_central::get_root_folder_id]
+ content::folder::delete -folder_id $folder_id -cascade_p "t"
+ set folder_id [lors_central::get_root_organizations_folder_id]
+ content::folder::delete -folder_id $folder_id -cascade_p "t"
+ set folder_id [lors_central::get_root_resources_folder_id]
+ content::folder::delete -folder_id $folder_id -cascade_p "t"
+ set folder_id [lors_central::get_root_manifest_folder_id]
+ content::folder::delete -folder_id $folder_id -cascade_p "t"
+ set folder_id [lors_central::get_root_items_folder_id]
+}
Index: openacs-4/packages/lors-central/tcl/lors-central-procs.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/lors-central/tcl/lors-central-procs.tcl,v
diff -u -r1.1 -r1.1.2.1
--- openacs-4/packages/lors-central/tcl/lors-central-procs.tcl 17 May 2005 16:21:18 -0000 1.1
+++ openacs-4/packages/lors-central/tcl/lors-central-procs.tcl 13 Jun 2005 15:10:42 -0000 1.1.2.1
@@ -8,6 +8,14 @@
namespace eval lors_central {}
+ad_proc -private lors_central::owner {
+ -user_id:required
+ -object_id:required
+} {
+ Returns 1 if user_id is the creator of the object_id, 0 otherwise
+} {
+ return [db_string get_creation_user { } -default 0]
+}
ad_proc -private lors_central::get_ims_item_id_or_res_id {
{-ims_item_id ""}
@@ -23,14 +31,68 @@
}
}
-ad_proc -private lors_central::is_swa {
+ad_proc -private lors_central::check_permissions {
+ {-object_id ""}
+ {-check_inst ""}
} {
- Check if the user (default to logged in user) has site_wide_admin privileges
+ Checks several privileges for user_id, default to logged user over the system.
+
+ @object_id Send this if you want to check if user_id has permissions over this object_id.
+ @check_inst Set it to "t" if you want to check if the user_id that watch's this page is an dotlrn
+ instructor.
} {
- if { ![acs_user::site_wide_admin_p] } {
- ad_returnredirect "not-allowed"
+ if { ![info exist user_id] } {
+ set user_id [ad_conn user_id]
+ }
+ set package_id [ad_conn package_id]
+
+ # Get the number specified in the parameter, this parameter tell if
+ # only the swa can manage lors-central or any one else
+ set sec_level [parameter::get -parameter "ManageLorsCentralP"]
+
+ if { $sec_level } {
+ if { ![acs_user::site_wide_admin_p] } {
+ ad_return_complaint 1 "[_ lors-central.we_are_sorry]"
+ ad_script_abort
+ } else {
+ return
+ }
+ } else {
+ if { ![empty_string_p $check_inst] } {
+ if { ![lors_central::check_inst -user_id $user_id] } {
+ ad_return_complaint 1 "[_ lors-central.we_are_sorry]"
+ ad_script_abort
+ }
+ }
+ if { ![empty_string_p $object_id] } {
+ permission::require_permission -party_id $user_id -object_id $object_id -privilege "admin"
+ }
+ }
+ return
+}
+
+ad_proc -private lors_central::check_inst {
+ -user_id:required
+ {-community_id ""}
+} {
+ Checks if user id has instructor or admin role in @community_id@ or any community_id, returns 1 if it does,
+ 0 otherwise
+} {
+ if { [acs_user::site_wide_admin_p] } {
+ return 1
ad_script_abort
}
+ if { ![empty_string_p $community_id] } {
+ set extra_query "and community_id = $community_id"
+ } else {
+ set extra_query ""
+ }
+ set count [db_string check_inst { } -default 0]
+ if { $count > 0 } {
+ return 1
+ } else {
+ return 0
+ }
}
ad_proc -private lors_central::set_sort_order {
@@ -88,27 +150,33 @@
ad_proc -private lors_central::get_root_folder_id { } {
- Returns the folder_id of the folder with the name "LORS Root Folder"
+ Returns the folder_id of the folder with the name "LORSM Root Folder"
} {
return [db_string get_folder_id_from_name { } ]
}
+ad_proc -private lors_central::get_root_organizations_folder_id { } {
+ Returns the folder_id of the folder with the name "LORSM Organizations Folder"
+} {
+ return [db_string get_folder_id_from_name { } ]
+}
+
ad_proc -private lors_central::get_root_resources_folder_id { } {
- Returns the folder_id of the folder with the name "LORS Resources Folder"
+ Returns the folder_id of the folder with the name "LORSM Resources Folder"
} {
return [db_string get_folder_id_from_name { } ]
}
ad_proc -private lors_central::get_root_manifest_folder_id { } {
- Returns the folder_id of the folder with the name "LORS Manifest Folder"
+ Returns the folder_id of the folder with the name "LORSM Manifest Folder"
} {
return [db_string get_folder_id_from_name { } ]
}
ad_proc -private lors_central::get_root_items_folder_id { } {
- Returns the folder_id of the folder with the name "LORS Items Folder"
+ Returns the folder_id of the folder with the name "LORSM Items Folder"
} {
return [db_string get_folder_id_from_name { } ]
}
@@ -267,14 +335,19 @@
ad_proc -private lors_central::relation_between {
- -item_id:required
+ {-item_id ""}
-community_id:required
+ {-man_id ""}
} {
Returns the 1 if there is an association between a dotlrn class or community
- and the item_id, 0 otherwise.
+ and the item_id, 0 otherwise, you should provide either man_id or item_id
@man_id@ The manifest id of the course
+ @item_id@ The item_id that has all manifests as revisions
@community_id@ The class_id or community_id of dotlrn
} {
+ if { ![empty_string_p $man_id] } {
+ set item_id [lors_central::get_item_id -revision_id $man_id]
+ }
return [db_string get_relation { } -default 0]
}
Index: openacs-4/packages/lors-central/tcl/lors-central-procs.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/lors-central/tcl/lors-central-procs.xql,v
diff -u -r1.1 -r1.1.2.1
--- openacs-4/packages/lors-central/tcl/lors-central-procs.xql 17 May 2005 16:21:18 -0000 1.1
+++ openacs-4/packages/lors-central/tcl/lors-central-procs.xql 13 Jun 2005 15:10:42 -0000 1.1.2.1
@@ -1,7 +1,31 @@
+
+
+ select
+ 1
+ from
+ acs_objects
+ where
+ creation_user = :user_id and
+ object_id = :object_id
+
+
+
+
+ select
+ count(user_id)
+ from
+ dotlrn_member_rels_full
+ where
+ user_id = :user_id and
+ ( role = 'admin' or role = 'instructor' )
+ $extra_query
+
+
+
select
@@ -238,6 +262,18 @@
+
+
+ select
+ folder_id
+ from
+ cr_folders
+ where
+ label = 'LORSM Organizations Folder'
+
+
+
+
select
Index: openacs-4/packages/lors-central/www/add-exist-item.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/lors-central/www/add-exist-item.tcl,v
diff -u -r1.1 -r1.1.2.1
--- openacs-4/packages/lors-central/www/add-exist-item.tcl 17 May 2005 16:21:19 -0000 1.1
+++ openacs-4/packages/lors-central/www/add-exist-item.tcl 13 Jun 2005 15:10:42 -0000 1.1.2.1
@@ -11,8 +11,8 @@
item_man_id:notnull
}
-# Checking swa privilege over lors-central
-lors_central::is_swa
+# Checking privilege over lors-central
+lors_central::check_permissions
set the_ims_item_id $ims_item_id
set user_id [ad_conn user_id]
Index: openacs-4/packages/lors-central/www/add-lo.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/lors-central/www/add-lo.tcl,v
diff -u -r1.1 -r1.1.2.1
--- openacs-4/packages/lors-central/www/add-lo.tcl 17 May 2005 16:21:19 -0000 1.1
+++ openacs-4/packages/lors-central/www/add-lo.tcl 13 Jun 2005 15:10:42 -0000 1.1.2.1
@@ -13,8 +13,8 @@
set user_id [ad_conn user_id]
-# Checking swa privilege over lors-central
-lors_central::is_swa
+# Checking privilege over lors-central
+lors_central::check_permissions
set new_lo_link "man_id=$man_id&org_id=$org_id&parent=$parent_item"
set page_title [_ lors-central.add_an_existent]
Index: openacs-4/packages/lors-central/www/change-lo-version.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/lors-central/www/change-lo-version.tcl,v
diff -u -r1.1 -r1.1.2.1
--- openacs-4/packages/lors-central/www/change-lo-version.tcl 17 May 2005 16:21:19 -0000 1.1
+++ openacs-4/packages/lors-central/www/change-lo-version.tcl 13 Jun 2005 15:10:42 -0000 1.1.2.1
@@ -12,8 +12,8 @@
live_hide_p:notnull
}
-# Checking swa privilege over lors-central
-lors_central::is_swa
+# Checking privilege over lors-central
+lors_central::check_permissions
if { ![info exist name] } {
set name [db_string get_name { select item_title from ims_cp_items where ims_item_id = :ims_item_id }]
Index: openacs-4/packages/lors-central/www/change-one-lo-version.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/lors-central/www/change-one-lo-version.tcl,v
diff -u -r1.1 -r1.1.2.1
--- openacs-4/packages/lors-central/www/change-one-lo-version.tcl 17 May 2005 16:21:19 -0000 1.1
+++ openacs-4/packages/lors-central/www/change-one-lo-version.tcl 13 Jun 2005 15:10:42 -0000 1.1.2.1
@@ -10,8 +10,8 @@
objects_value:multiple
}
-# Checking swa privilege over lors-central
-lors_central::is_swa
+# Checking privilege over lors-central
+lors_central::check_permissions
# object_id: A list of communities ids
# object_value: The version number to set the revision
Index: openacs-4/packages/lors-central/www/change-one-version.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/lors-central/www/change-one-version.tcl,v
diff -u -r1.1 -r1.1.2.1
--- openacs-4/packages/lors-central/www/change-one-version.tcl 17 May 2005 16:21:19 -0000 1.1
+++ openacs-4/packages/lors-central/www/change-one-version.tcl 13 Jun 2005 15:10:42 -0000 1.1.2.1
@@ -14,8 +14,8 @@
}
}
-# Checking swa privilege over lors-central
-lors_central::is_swa
+# Checking privilege over lors-central
+lors_central::check_permissions
# Validation of Range
set i 0
Index: openacs-4/packages/lors-central/www/course-add-2.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/lors-central/www/course-add-2.tcl,v
diff -u -r1.1 -r1.1.2.1
--- openacs-4/packages/lors-central/www/course-add-2.tcl 17 May 2005 16:21:19 -0000 1.1
+++ openacs-4/packages/lors-central/www/course-add-2.tcl 13 Jun 2005 15:10:42 -0000 1.1.2.1
@@ -26,8 +26,8 @@
}
}
-# Checking swa privilege over lors-central
-lors_central::is_swa
+# Checking privilege over lors-central
+lors_central::check_permissions
# To support versions
if { ![info exist man_id] } {
Index: openacs-4/packages/lors-central/www/course-add-3.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/lors-central/www/course-add-3.tcl,v
diff -u -r1.1 -r1.1.2.1
--- openacs-4/packages/lors-central/www/course-add-3.tcl 17 May 2005 16:21:19 -0000 1.1
+++ openacs-4/packages/lors-central/www/course-add-3.tcl 13 Jun 2005 15:10:42 -0000 1.1.2.1
@@ -27,13 +27,13 @@
}
}
-# Checking swa privilege over lors-central
-lors_central::is_swa
-
#check permission
set user_id [ad_conn user_id]
-# ad_require_permission $folder_id admin
+# Checking privilege over lors-central
+lors_central::check_permissions
+
+
# Display progress bar
ad_progress_bar_begin \
-title "[_ lorsm.Uploading_course]" \
@@ -316,6 +316,7 @@
ns_write "[_ lorsm.lt_Granting_permissions__1 [list course_name $course_name]] "
# PERMISSIONS FOR MANIFEST and learning objects
+ permission::grant -party_id $user_id -object_id $man_id -privilege admin
# set up in the same way as permissions for the file storage
# objects. As we want to maintain consistency btw the
Index: openacs-4/packages/lors-central/www/course-add.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/lors-central/www/course-add.tcl,v
diff -u -r1.1 -r1.1.2.1
--- openacs-4/packages/lors-central/www/course-add.tcl 17 May 2005 16:21:19 -0000 1.1
+++ openacs-4/packages/lors-central/www/course-add.tcl 13 Jun 2005 15:10:42 -0000 1.1.2.1
@@ -13,8 +13,8 @@
set user_id [ad_conn user_id]
set community_id [dotlrn_community::get_community_id]
-# Checking swa privilege over lors-central
-lors_central::is_swa
+# Checking privilege over lors-central
+lors_central::check_permissions
if { ![info exists man_id] } {
set man_id ""
Index: openacs-4/packages/lors-central/www/course-admin.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/lors-central/www/course-admin.tcl,v
diff -u -r1.1 -r1.1.2.1
--- openacs-4/packages/lors-central/www/course-admin.tcl 17 May 2005 16:21:19 -0000 1.1
+++ openacs-4/packages/lors-central/www/course-admin.tcl 13 Jun 2005 15:10:42 -0000 1.1.2.1
@@ -8,7 +8,7 @@
}
# Checking swa privilege over lors-central
-lors_central::is_swa
+lors_central::check_permissions
set title "[_ lorsm.lt_Manage_Courses_in_Rep]"
Index: openacs-4/packages/lors-central/www/course-associate.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/lors-central/www/course-associate.tcl,v
diff -u -r1.1 -r1.1.2.1
--- openacs-4/packages/lors-central/www/course-associate.tcl 17 May 2005 16:21:19 -0000 1.1
+++ openacs-4/packages/lors-central/www/course-associate.tcl 13 Jun 2005 15:10:42 -0000 1.1.2.1
@@ -10,9 +10,16 @@
{ return_url "" }
}
-# Checking swa privilege over lors-central
-lors_central::is_swa
+# Checking privilege over lors-central
+lors_central::check_permissions
+# Display progress bar
+ad_progress_bar_begin \
+ -title "[_ lors-central.associate_to]" \
+ -message_1 "[_ lors-central.associate_to]" \
+ -message_2 "[_ lorsm.lt_We_will_continue_auto]"
+
+
set man_id [content::item::get_live_revision -item_id $item_id]
foreach community_id $object_id {
@@ -34,8 +41,8 @@
if { [empty_string_p $return_url] } {
- ad_returnredirect "course-dotlrn-assoc?item_id=$item_id"
+ ad_progress_bar_end -url "course-dotlrn-assoc?item_id=$item_id"
} else {
- ad_returnredirect $return_url
+ ad_progress_bar_end -url $return_url
}
Index: openacs-4/packages/lors-central/www/course-association-drop.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/lors-central/www/course-association-drop.tcl,v
diff -u -r1.1 -r1.1.2.1
--- openacs-4/packages/lors-central/www/course-association-drop.tcl 17 May 2005 16:21:19 -0000 1.1
+++ openacs-4/packages/lors-central/www/course-association-drop.tcl 13 Jun 2005 15:10:42 -0000 1.1.2.1
@@ -9,10 +9,17 @@
{ return_url "" }
}
-# Checking swa privilege over lors-central
-lors_central::is_swa
+# Display progress bar
+ad_progress_bar_begin \
+ -title "[_ lors-central.associate_to]" \
+ -message_1 "[_ lors-central.associate_to]" \
+ -message_2 "[_ lorsm.lt_We_will_continue_auto]"
+# Checking privilege over lors-central
+lors_central::check_permissions
+
+
set man_list [db_list_of_lists get_man_ids { }]
foreach community_id $object_id {
lors_central::drop_relation -item_id $item_id -community_id $community_id
@@ -25,8 +32,8 @@
}
if { [empty_string_p $return_url] } {
- ad_returnredirect "course-dotlrn-assoc?item_id=$item_id"
+ ad_progress_bar_end -url "course-dotlrn-assoc?item_id=$item_id"
} else {
- ad_returnredirect $return_url
+ ad_progress_bar_end -url $return_url
}
Index: openacs-4/packages/lors-central/www/course-dotlrn-assoc.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/lors-central/www/course-dotlrn-assoc.adp,v
diff -u -r1.1 -r1.1.2.1
--- openacs-4/packages/lors-central/www/course-dotlrn-assoc.adp 17 May 2005 16:21:19 -0000 1.1
+++ openacs-4/packages/lors-central/www/course-dotlrn-assoc.adp 13 Jun 2005 15:10:42 -0000 1.1.2.1
@@ -2,6 +2,23 @@
@title;noquote@@context;noquote@
-
-
-
+
#lors-central.dotlrn_classes#
+
+
+
+
+
+
+
+
+
+
#lors-central.dotlrn_communities#
+
+
+
+
+
+
+
+
+
\ No newline at end of file
Index: openacs-4/packages/lors-central/www/course-dotlrn-assoc.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/lors-central/www/course-dotlrn-assoc.tcl,v
diff -u -r1.1 -r1.1.2.1
--- openacs-4/packages/lors-central/www/course-dotlrn-assoc.tcl 17 May 2005 16:21:19 -0000 1.1
+++ openacs-4/packages/lors-central/www/course-dotlrn-assoc.tcl 13 Jun 2005 15:10:42 -0000 1.1.2.1
@@ -8,8 +8,8 @@
item_id:integer,optional
}
-# Checking swa privilege over lors-central
-lors_central::is_swa
+# Checking privilege over lors-central
+lors_central::check_permissions
set title [_ lors-central.associate_to]
@@ -25,7 +25,17 @@
set user_id [ad_conn user_id]
+if { ![acs_user::site_wide_admin_p] } {
+ set extra_query_class "and drf.role = 'instructor' and drf.community_id = dc.class_instance_id and drf.user_id = :user_id "
+ set extra_query_community "and dm.community_id = dc.community_id
+ and dm.user_id = :user_id
+ and dm.role = 'admin'"
+} else {
+ set extra_query_class ""
+ set extra_query_community ""
+}
+
##################################### TO ASSOCIATE ##########################################################
db_multirow -extend { rel type } classes_list get_dotlrn_classes { } {
@@ -155,3 +165,98 @@
}
}
+
+##################################### COMMUNITIES ###########################################################
+##################################### TO ASSOCIATE ##########################################################
+
+db_multirow -extend { rel type } coms_list get_dotlrn_coms { } {
+ set rel [lors_central::relation_between -item_id $item_id -community_id $com_id]
+ set type dotlrn_club
+}
+
+template::list::create \
+ -name coms_list \
+ -multirow coms_list \
+ -key community_id \
+ -has_checkboxes\
+ -bulk_actions {
+ "\#lors-central.associate\#" "course-associate" "\#lors-central.associate_to_class\#" \
+ } \
+ -bulk_action_method post \
+ -bulk_action_export_vars {
+ item_id
+ type
+ }\
+ -row_pretty_plural "[_ lors-central.dotlrn_communities]" \
+ -elements {
+ check_box {
+ class "list-narrow"
+ label ""
+ display_template {
+
+ }
+ }
+ class {
+ label "[_ lors-central.community_name]"
+ display_template {
+ @coms_list.pretty_name@
+ }
+ }
+ associate {
+ display_template {
+
+ #lors-central.associated#
+
+ }
+ }
+ }
+
+
+############################## TO DROP ASSOCIATION ######################################
+
+db_multirow -extend { rel type } coms_list_drop get_dotlrn_coms_drop { } {
+ set rel [lors_central::relation_between -item_id $item_id -community_id $com_id]
+}
+
+template::list::create \
+ -name coms_list_drop \
+ -multirow coms_list_drop \
+ -key community_id \
+ -has_checkboxes\
+ -bulk_actions {
+ "\#lors-central.drop\#" "course-association-drop" "\#lors-central.drop_association\#" \
+ } \
+ -bulk_action_method post \
+ -bulk_action_export_vars {
+ item_id
+ type
+ }\
+ -row_pretty_plural "[_ lors-central.dotlrn_classes]" \
+ -elements {
+ check_box {
+ class "list-narrow"
+ label ""
+ display_template {
+
+ }
+ }
+ class {
+ label "[_ lors-central.community_name]"
+ display_template {
+ @coms_list_drop.pretty_name@
+ }
+ }
+ associate {
+ display_template {
+
+ #lors-central.associated#
+
+ }
+ }
+ }
Index: openacs-4/packages/lors-central/www/course-dotlrn-assoc.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/lors-central/www/course-dotlrn-assoc.xql,v
diff -u -r1.1 -r1.1.2.1
--- openacs-4/packages/lors-central/www/course-dotlrn-assoc.xql 17 May 2005 16:21:19 -0000 1.1
+++ openacs-4/packages/lors-central/www/course-dotlrn-assoc.xql 13 Jun 2005 15:10:42 -0000 1.1.2.1
@@ -11,7 +11,7 @@
dc.pretty_name,
dc.url
from
- dotlrn_class_instances_full dc
+ dotlrn_class_instances_full dc, dotlrn_instructor_rels_full drf
where
dc.class_instance_id not in
(
@@ -27,7 +27,8 @@
from cr_revisions
where item_id = :item_id
)
- )
+ )
+ $extra_query_class
order by department_name, term_name, class_name, pretty_name
@@ -42,7 +43,7 @@
dc.pretty_name,
dc.url
from
- dotlrn_class_instances_full dc
+ dotlrn_class_instances_full dc, dotlrn_instructor_rels_full drf
where
dc.class_instance_id in
(
@@ -57,11 +58,69 @@
from cr_revisions
where item_id = :item_id
)
+ )
+ $extra_query_class
+ order by department_name, term_name, class_name, pretty_name
+
+
+
+
+
+ select
+ distinct
+ dc.community_id as com_id,
+ dc.pretty_name,
+ dc.url
+ from
+ dotlrn_communities_full dc, dotlrn_member_rels_full dm
+ where
+ dc.community_id not in
+ (
+ select
+ icmc.community_id
+ from
+ ims_cp_manifest_class icmc
+ where
+ icmc.community_id is not null and
+ man_id in
+ (
+ select revision_id
+ from cr_revisions
+ where item_id = :item_id
+ )
+ )
+ and ( dc.community_type = 'dotlrn_club' or dc.community_type = 'dotlrn_community')
+ $extra_query_community
+ order by pretty_name
+
+
+
+
+
+ select distinct
+ dc.community_id as com_id,
+ dc.pretty_name,
+ dc.url
+ from
+ dotlrn_communities_full dc, dotlrn_member_rels_full dm
+ where
+ dc.community_id in
+ (
+ select
+ icmc.community_id
+ from
+ ims_cp_manifest_class icmc
+ where
+ man_id in
+ (
+ select revision_id
+ from cr_revisions
+ where item_id = :item_id
+ )
)
- order by department_name,
- term_name,
- class_name,
- pretty_name
+ and ( dc.community_type = 'dotlrn_club' or dc.community_type = 'dotlrn_community')
+ $extra_query_community
+ order by pretty_name
Index: openacs-4/packages/lors-central/www/course-live-in.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/lors-central/www/course-live-in.tcl,v
diff -u -r1.1 -r1.1.2.1
--- openacs-4/packages/lors-central/www/course-live-in.tcl 17 May 2005 16:21:19 -0000 1.1
+++ openacs-4/packages/lors-central/www/course-live-in.tcl 13 Jun 2005 15:10:42 -0000 1.1.2.1
@@ -6,8 +6,8 @@
man_id:integer,optional
}
-# Checking swa privilege over lors-central
-lors_central::is_swa
+# Checking privilege over lors-central
+lors_central::check_permissions
set title "[_ lors-central.Classes_using]"
set context [list [list "one-course-associations?man_id=$man_id" [_ lors-central.one_course_assoc]] \
Index: openacs-4/packages/lors-central/www/course-version-change.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/lors-central/www/course-version-change.tcl,v
diff -u -r1.1 -r1.1.2.1
--- openacs-4/packages/lors-central/www/course-version-change.tcl 17 May 2005 16:21:19 -0000 1.1
+++ openacs-4/packages/lors-central/www/course-version-change.tcl 13 Jun 2005 15:10:42 -0000 1.1.2.1
@@ -7,8 +7,8 @@
set user_id [ad_conn user_id]
-# Checking swa privilege over lors-central
-lors_central::is_swa
+# Checking privilege over lors-central
+lors_central::check_permissions
set item_id [lors_central::get_item_id -revision_id $man_id]
Index: openacs-4/packages/lors-central/www/course-versions.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/lors-central/www/course-versions.tcl,v
diff -u -r1.1 -r1.1.2.1
--- openacs-4/packages/lors-central/www/course-versions.tcl 17 May 2005 16:21:19 -0000 1.1
+++ openacs-4/packages/lors-central/www/course-versions.tcl 13 Jun 2005 15:10:42 -0000 1.1.2.1
@@ -9,8 +9,8 @@
set user_id [ad_conn user_id]
-# Checking swa privilege over lors-central
-lors_central::is_swa
+# Checking privilege over lors-central
+lors_central::check_permissions
if { ![info exist item_id ] } {
Index: openacs-4/packages/lors-central/www/edit-content.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/lors-central/www/edit-content.tcl,v
diff -u -r1.1 -r1.1.2.1
--- openacs-4/packages/lors-central/www/edit-content.tcl 17 May 2005 16:21:19 -0000 1.1
+++ openacs-4/packages/lors-central/www/edit-content.tcl 13 Jun 2005 15:10:42 -0000 1.1.2.1
@@ -23,8 +23,8 @@
set user_id [ad_conn user_id]
-# Checking swa privilege over lors-central
-lors_central::is_swa
+# Checking privilege over lors-central
+lors_central::check_permissions
set folder [db_string select_folder_key {select key from fs_folders where folder_id = :folder_id}]
set fs_root_folder [db_string sql {select file_storage__get_root_folder(:fs_package_id)}]
Index: openacs-4/packages/lors-central/www/file-content-edit.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/lors-central/www/file-content-edit.tcl,v
diff -u -r1.1 -r1.1.2.1
--- openacs-4/packages/lors-central/www/file-content-edit.tcl 17 May 2005 16:21:19 -0000 1.1
+++ openacs-4/packages/lors-central/www/file-content-edit.tcl 13 Jun 2005 15:10:42 -0000 1.1.2.1
@@ -32,8 +32,8 @@
nsv_lappend delivery_vars [ad_conn session_id] $ims_item_id
-# Checking swa privilege over lors-central
-lors_central::is_swa
+# Checking privilege over lors-central
+lors_central::check_permissions
# check they have read permission on this file
Index: openacs-4/packages/lors-central/www/folder-description.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/lors-central/www/folder-description.tcl,v
diff -u -r1.1 -r1.1.2.1
--- openacs-4/packages/lors-central/www/folder-description.tcl 17 May 2005 16:21:19 -0000 1.1
+++ openacs-4/packages/lors-central/www/folder-description.tcl 13 Jun 2005 15:10:42 -0000 1.1.2.1
@@ -6,8 +6,8 @@
folder_id:integer,optional
}
-# Checking swa privilege over lors-central
-lors_central::is_swa
+# Checking privilege over lors-central
+lors_central::check_permissions
if { ![info exists folder_id] } {
# Get lorsm root folder_id
Index: openacs-4/packages/lors-central/www/index.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/lors-central/www/index.adp,v
diff -u -r1.1 -r1.1.2.1
--- openacs-4/packages/lors-central/www/index.adp 17 May 2005 16:21:19 -0000 1.1
+++ openacs-4/packages/lors-central/www/index.adp 13 Jun 2005 15:10:42 -0000 1.1.2.1
@@ -2,6 +2,7 @@
@title@@context@
+
#lorsm.lt_Courses_in_your_Repos#
Index: openacs-4/packages/lors-central/www/index.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/lors-central/www/index.tcl,v
diff -u -r1.1 -r1.1.2.1
--- openacs-4/packages/lors-central/www/index.tcl 17 May 2005 16:21:19 -0000 1.1
+++ openacs-4/packages/lors-central/www/index.tcl 13 Jun 2005 15:10:42 -0000 1.1.2.1
@@ -8,9 +8,12 @@
keyword:optional
}
-# Checking swa privilege over lors-central
-lors_central::is_swa
+set user_id [ad_conn user_id]
+
+# Checking privilege over lors-central
+lors_central::check_permissions
+
set title "[_ lorsm.lt_Manage_Courses_in_Rep]"
set context [list "[_ lorsm.Manage_Courses]"]
@@ -32,6 +35,11 @@
set extra_query ""
}
+# If user is not site wide we just show the courses where he/she has admin privilege over
+if { ![acs_user::site_wide_admin_p] } {
+ append extra_query " and p.object_id = acs.object_id and p.privilege = 'admin' and p.grantee_id = :user_id"
+}
+
set package_id [ad_conn package_id]
set user_id [ad_conn user_id]
set community_id [dotlrn_community::get_community_id]
@@ -49,10 +57,11 @@
set actions [list]
-lappend actions "[_ lorsm.Add_Course]" [export_vars -base "course-add"] "[_ lorsm.lt_Add_a_IMSSCORM_Compli]"
-lappend actions "[_ lorsm.lt_Search_Learning_Objec]" [export_vars -base "search"] "[_ lorsm.lt_Search_for_Learninng_]"
+if { [lors_central::check_inst -user_id $user_id] } {
+ lappend actions "[_ lorsm.Add_Course]" [export_vars -base "course-add"] "[_ lorsm.lt_Add_a_IMSSCORM_Compli]"
+ lappend actions "[_ lorsm.lt_Search_Learning_Objec]" [export_vars -base "search"] "[_ lorsm.lt_Search_for_Learninng_]"
+}
-
template::list::create \
-name get_courses \
-multirow get_courses \
Index: openacs-4/packages/lors-central/www/index.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/lors-central/www/index.xql,v
diff -u -r1.1 -r1.1.2.1
--- openacs-4/packages/lors-central/www/index.xql 17 May 2005 16:21:19 -0000 1.1
+++ openacs-4/packages/lors-central/www/index.xql 13 Jun 2005 15:10:42 -0000 1.1.2.1
@@ -19,7 +19,7 @@
acs.creation_user,
acs.creation_date
from
- cr_revisions cr, acs_objects acs, cr_items ci
+ cr_revisions cr, acs_objects acs, cr_items ci, acs_permissions p
where
acs.object_id = cr.item_id and
ci.item_id = cr.item_id and
Index: openacs-4/packages/lors-central/www/new-clipboard-files.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/lors-central/www/new-clipboard-files.tcl,v
diff -u -r1.1 -r1.1.2.1
--- openacs-4/packages/lors-central/www/new-clipboard-files.tcl 17 May 2005 16:21:19 -0000 1.1
+++ openacs-4/packages/lors-central/www/new-clipboard-files.tcl 13 Jun 2005 15:10:42 -0000 1.1.2.1
@@ -12,6 +12,8 @@
set user_id [ad_conn user_id]
+lors_central::check_permissions
+
foreach object $object_id {
#The same file can not be added to the same res_id twice so we are going to check that
set ims_res_id [db_string get_res_id { } ]
Index: openacs-4/packages/lors-central/www/new-file.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/lors-central/www/new-file.tcl,v
diff -u -r1.1 -r1.1.2.1
--- openacs-4/packages/lors-central/www/new-file.tcl 17 May 2005 16:21:19 -0000 1.1
+++ openacs-4/packages/lors-central/www/new-file.tcl 13 Jun 2005 15:10:42 -0000 1.1.2.1
@@ -13,8 +13,8 @@
set user_id [ad_conn user_id]
-# Checking swa privilege over lors-central
-lors_central::is_swa
+# Checking privilege over lors-central
+lors_central::check_permissions
set page_title "[_ lors-central.new_file]"
set context "[list [list [export_vars -base one-resource {res_id}] \
Index: openacs-4/packages/lors-central/www/new-learning-object.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/lors-central/www/new-learning-object.tcl,v
diff -u -r1.1 -r1.1.2.1
--- openacs-4/packages/lors-central/www/new-learning-object.tcl 17 May 2005 16:21:19 -0000 1.1
+++ openacs-4/packages/lors-central/www/new-learning-object.tcl 13 Jun 2005 15:10:42 -0000 1.1.2.1
@@ -16,8 +16,8 @@
}
set user_id [ad_conn user_id]
-# Checking swa privilege over lors-central
-lors_central::is_swa
+# Checking privilege over lors-central
+lors_central::check_permissions
set title "[_ lors-central.new_object]"
Index: openacs-4/packages/lors-central/www/one-course-associations.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/lors-central/www/one-course-associations.adp,v
diff -u -r1.1 -r1.1.2.1
--- openacs-4/packages/lors-central/www/one-course-associations.adp 17 May 2005 16:21:19 -0000 1.1
+++ openacs-4/packages/lors-central/www/one-course-associations.adp 13 Jun 2005 15:10:42 -0000 1.1.2.1
@@ -10,6 +10,10 @@
+