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 @@ f t - + 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-06 This is a service and library to manage IMS Content Packaging and Metadata. From version 0.4d onward it supports SCORM and Blackboard imports GPL http://www.gnu.org/copyleft/gpl.html 1 - + + 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 @@ t lors-central - + Miguel Marin Viaro Netwoks (www.viaro.net) Application to manage the services from the Learning Object Repository. 2005-03-14 This 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 Allowed Add Child Add an existent Learning Object Add File Add From Clipboard: + Add Material Add Object Add This Item Add this learning object to your clipboard Add to Clipboard Add to this course Add to this resource + Admin All Views All Views of this object + and in the following Communities: And is in use in the following courses Associations: Associate Associate/Drop - Associate to dotLRN Class + Associate to dotLRN Class or Community Associate to this class Already Associated Author: + Back Choose the file to upload + Class Memberships Class Name Classes Using this Course Click For Preview Clip This Resource + Community Memberships + Community Name Course Name Course Versions Courses @@ -36,13 +43,19 @@ Description Disabled dotLRN classes + dotLRN Communities Drop Drop association to this class Edit Edit %name% + E-mail Enabled Everywhere Filename + Grant + Grant Permission to this users + Grant Permissions + Grant / Revoke Use the "Browse..." button to locate your file, then click "Open" Here Hide @@ -54,13 +67,18 @@ Live Live Classes? Learning Object Files + Lors Central Admin + Lors Central Package Make Make Live Everywhere Make this live Manifest ID + Manage + Memberships Add New File New Learning Object No + Not Allowed of of %name% One Course @@ -70,8 +88,14 @@ One Learning Object Please type a keyword Preview + priviliges to all members + Privilege on + Revoke + Revoke Permission to this users Search Search Courses + Search for users first names, last name or email: + Search users to grant/revoke privileges Set to Shared? Shared Items In The Repository @@ -92,6 +116,8 @@ Update Versions Upload a New File or.... Usage + users to grant privileges that match that search + User Name Version Ver. # 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 sujetapapeles Agregar a este curso Agregar a este recurso + Administrar Todas las vistas Todas las vistas de este objeto + y en las siguientes comunidades: Y esta siendo utilizado en los siguientes cursos Asociaciones: Asociar @@ -23,26 +25,35 @@ Already Asociado Autor: Escoja el archivo que desea subir + Membresias con Clases Nombre de la Clase Clases que utilizan este curso Click para previsualizar Sujetar este Recurso + Membresias con Comunidades + Nombre de la comunidad Nombre del Curso Versiones del Curso Cursos - Crear el nuevo archivo + Crear el nuevo archivo o ... Actual Nombre del Departamento Descripcion Deshabilitado classes de dotLRN + comunidades de dotLRN/msg> Quitar Quitar la asociacion de esta clase Editar Editar %name% + Correo Electronico Habilitado En todos lados Nombre del archivo + Otorgar + Otorgar permisos a este usuario + Otorgar permisos + Otorgar / Quitar Utilizar el boton de "Browse..." para localizar el archivo, luego presionar"Open" Aqui Ocultar @@ -54,13 +65,16 @@ Actual Clases donde es el actual? Archivos del Objeto de Aprendizaje + Administracion de Lors Central Hacer Cambiar a actual en todas las clases Poner actual en esta clase ID del Manifesto + Membresias Agregar Nuevo Archivo Nuevo Objeto de Aprendisaje No + no otorgado de de %name% Un Curso @@ -70,8 +84,14 @@ Un Objeto de Aprendizaje Por favor ingrese una palabra Previsualizacion + privilegios a todos los miembros + Privilegios sobre + Quitar + Quitar privilegios a estos usuarios Buscar Buscar Cursos + Buscar por el nombre, apellido o correo electronico del usuario: + Buscar usarios a Otorgar/Quitar privilegios Establecer aCompartido? Objetos Compartidos en el repositorio> @@ -92,6 +112,8 @@ Actualizar Versiones Subir un Nuevo Archivo o.... Utilizacion + hay usarios a otorgar privilefios que coincidan con esa busqueda + Nombre del Usuario Version Ver. # 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 sujetapapeles Agregar a este curso Agregar a este recurso + Administrar Todas las vistas Todas las vistas de este objeto + y en las siguientes comunidades: Y esta siendo utilizado en los siguientes cursos Asociaciones: Asociar @@ -23,26 +25,35 @@ Already Asociado Autor: Escoja el archivo que desea subir + Membresias con Clases Nombre de la Clase Clases que utilizan este curso Click para previsualizar Sujetar este Recurso + Membresias con Comunidades + Nombre de la comunidad Nombre del Curso Versiones del Curso Cursos - Crear el nuevo archivo + Crear el nuevo archivo o ... Actual Nombre del Departamento Descripcion Deshabilitado classes de dotLRN + comunidades de dotLRN/msg> Quitar Quitar la asociacion de esta clase Editar Editar %name% + Correo Electronico Habilitado En todos lados Nombre del archivo + Otorgar + Otorgar permisos a este usuario + Otorgar permisos + Otorgar / Quitar Utilizar el boton de "Browse..." para localizar el archivo, luego presionar"Open" Aqui Ocultar @@ -54,13 +65,16 @@ Actual Clases donde es el actual? Archivos del Objeto de Aprendizaje + Administracion de Lors Central Hacer Cambiar a actual en todas las clases Poner actual en esta clase ID del Manifesto + Membresias Agregar Nuevo Archivo Nuevo Objeto de Aprendisaje No + no otorgado de de %name% Un Curso @@ -70,8 +84,14 @@ Un Objeto de Aprendizaje Por favor ingrese una palabra Previsualizacion + privilegios a todos los miembros + Privilegios sobre + Quitar + Quitar privilegios a estos usuarios Buscar Buscar Cursos + Buscar por el nombre, apellido o correo electronico del usuario: + Buscar usarios a Otorgar/Quitar privilegios Establecer aCompartido? Objetos Compartidos en el repositorio> @@ -92,6 +112,8 @@ Actualizar Versiones Subir un Nuevo Archivo o.... Utilizacion + hay usarios a otorgar privilefios que coincidan con esa busqueda + Nombre del Usuario Version Ver. # 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@ +
admin

#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 @@ +

#lors-central.and_in_the#

+ + +
#lors-central.associate_drop# Index: openacs-4/packages/lors-central/www/one-course-associations.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lors-central/www/one-course-associations.tcl,v diff -u -r1.1 -r1.1.2.1 --- openacs-4/packages/lors-central/www/one-course-associations.tcl 17 May 2005 16:21:19 -0000 1.1 +++ openacs-4/packages/lors-central/www/one-course-associations.tcl 13 Jun 2005 15:10:42 -0000 1.1.2.1 @@ -11,8 +11,9 @@ } +set user_id [ad_conn user_id] +lors_central::check_permissions - # Get the item_id that the manifest_id has associated if { ![info exist item_id] } { set item_id [lors_central::get_item_id -revision_id $man_id] @@ -202,3 +203,78 @@ } +############################################ Communities ############################################### + + +template::list::create \ + -name dotlrn_communities \ + -multirow com_list \ + -key com_id \ + -has_checkboxes \ + -bulk_actions { #lors-central.update_versions# "change-one-version" #lors-central.update_course_ver# }\ + -bulk_action_method post \ + -bulk_action_export_vars { + item_id + } \ + -row_pretty_plural "[_ lors-central.dotlrn_classes]" \ + -elements { + community { + label "[_ lors-central.community_name]" + display_template { + @com_list.pretty_name@   + + [_ lors-central.views] + + } + } + current { + label "[_ lors-central.current]" + display_template { + @com_list.ver_num@ [_ lors-central.of] @com_list.ver_count@ + } + } + set_to { + label "[_ lors-central.set_to]" + display_template { + + + + } + } + tracking { + label "[_ lors-central.tracking]" + display_template { +
+ + + [_ lors-central.enabled] + + + [_ lors-central.disabled] + + +
+ } + } + } + +db_multirow -extend { ver_num ver_count manifest_id options tracking } com_list get_dotlrn_communities { } { + set manifest_id [lors_central::get_man_id -community_id $com_id -item_id $item_id] + set ver_count [lors_central::count_versions -man_id $manifest_id] + set ver_num [lors_central::get_version_num -revision_id $manifest_id] + set tracking [db_string get_tracking { }] + # Create the options for the select menu + set options "" + for { set i 1 } { $i < [expr $ver_count + 1] } { incr i } { + if { [string equal $i $ver_num] } { + append options "
+
@d_courses.hasmetadata@
-
+ } - } + } isscorm { label "[_ lorsm.SCORM]" html { align center } @@ -73,9 +73,22 @@ istrackable { label "[_ lorsm.Tracking]" link_url_eval {tracking/?[export_vars man_id]} - link_html {title "[_ lorsm.lt_Track_Students_Progre]" class button} + link_html {title "[_ lorsm.lt_Track_Students_Progre]" class button} html { align center } } + deliverymethod { + label "[_ lorsm.Default_delivery]" + html { align center } + } + hasrtedata { + label "[_ lorsm.SCORM_session]" + display_template { + +
+ @d_courses.hasrtedata@ + + } + } creation_user { label "[_ lorsm.Owner]" display_eval {[person::name -person_id $creation_user]} @@ -112,7 +125,7 @@ cp.identifier, cp.version, case - when hasmetadata = 't' then 'Yes' + when cp.hasmetadata = 't' then 'Yes' else 'No' end as hasmetadata, case @@ -136,10 +149,30 @@ case when cpmc.istrackable = 't' then 'Yes' else 'No' - end as istrackable - + end as istrackable, + -- micheles + -- addition for rte stuff +-- 'Click here' as hasrtedata, + case + when + upper(scorm_type) = 'SCO' + then 'Click here' + else '' + end as hasrtedata, + case + when + upper(scorm_type) = 'SCO' + then 'delivery-scorm' + else 'delivery' + end as deliverymethod + from - ims_cp_manifests cp, acs_objects acs, ims_cp_manifest_class cpmc, lorsm_course_presentation_formats pf + acs_objects acs, + ims_cp_manifest_class cpmc, + lorsm_course_presentation_formats pf, + -- micheles + ims_cp_manifests cp left join (select man_id, max(scorm_type) as scorm_type from ims_cp_resources group by man_id ) as cpr using (man_id) + where cp.man_id = acs.object_id and @@ -151,11 +184,13 @@ and cp.man_id in (select cr.live_revision from cr_items cr where content_type = 'ims_manifest_object') - order by acs.creation_date desc + + order by acs.creation_date desc, cp.man_id asc + } { set ims_md_id $man_id if { [string eq $format_name "default"] } { - set course_url "$course_name" + set course_url "$course_name" } else { set course_url "$course_name" } Index: openacs-4/packages/lorsm/www/delivery/record-view.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/delivery/record-view.tcl,v diff -u -r1.2 -r1.2.2.1 --- openacs-4/packages/lorsm/www/delivery/record-view.tcl 17 May 2005 17:03:40 -0000 1.2 +++ openacs-4/packages/lorsm/www/delivery/record-view.tcl 13 Jun 2005 15:10:56 -0000 1.2.2.1 @@ -64,6 +64,12 @@ } } +# get already imported data (like an assessment) +# it normally points relatively to the correct location in some parent folder +if {[regexp {^\.\.} $href]} { + ad_returnredirect $href +} + # If no cr_item_id, this item is probably a folder # Else deliver the page Index: openacs-4/packages/lorsm/www/delivery-no-index/index.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/delivery-no-index/index.tcl,v diff -u -r1.3 -r1.3.2.1 --- openacs-4/packages/lorsm/www/delivery-no-index/index.tcl 17 May 2005 21:48:05 -0000 1.3 +++ openacs-4/packages/lorsm/www/delivery-no-index/index.tcl 13 Jun 2005 15:10:56 -0000 1.3.2.1 @@ -103,5 +103,5 @@ } if { !$viewed_item_count } { - set first_item_id [lindex [lorsm::get_item_list $man_id $user_id] 1] + set first_item_id [lindex [lorsm::get_item_list $man_id $user_id] 0] } Index: openacs-4/packages/lorsm/www/delivery-no-index/record-view.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/delivery-no-index/record-view.tcl,v diff -u -r1.2 -r1.2.2.1 --- openacs-4/packages/lorsm/www/delivery-no-index/record-view.tcl 17 May 2005 21:48:05 -0000 1.2 +++ openacs-4/packages/lorsm/www/delivery-no-index/record-view.tcl 13 Jun 2005 15:10:56 -0000 1.2.2.1 @@ -51,6 +51,11 @@ set cr_item_id [lors::cr::get_item_id -folder_id $content_root -name $href] +# get already imported data (like an assessment) +# it normally points relatively to the correct location in some parent folder +if {[regexp {^\.\.} $href]} { + ad_returnredirect $href +} # If no fs_item_id, this item is probably a folder # Else deliver the page Index: openacs-4/packages/lorsm/www/delivery-no-index/view/index.vuh =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/delivery-no-index/view/index.vuh,v diff -u -r1.2 -r1.2.2.1 --- openacs-4/packages/lorsm/www/delivery-no-index/view/index.vuh 17 May 2005 21:48:05 -0000 1.2 +++ openacs-4/packages/lorsm/www/delivery-no-index/view/index.vuh 13 Jun 2005 15:10:56 -0000 1.2.2.1 @@ -20,6 +20,7 @@ # Get the paths set the_root [ns_info pageroot] set the_url [ad_conn path_info] + set content_type "content_revision" set content_root [lindex [nsv_get delivery_vars [ad_conn session_id]] 0] Index: openacs-4/packages/lorsm/www/doc/index.html =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/doc/index.html,v diff -u -r1.3 -r1.3.2.1 --- openacs-4/packages/lorsm/www/doc/index.html 17 May 2005 17:03:41 -0000 1.3 +++ openacs-4/packages/lorsm/www/doc/index.html 13 Jun 2005 15:10:57 -0000 1.3.2.1 @@ -32,6 +32,8 @@
  • Authoring/Creating Course Packages
  • +
  • SCORM delivery in LORS
  • +


    Fisheye: Tag 1.1.2.1 refers to a dead (removed) revision in file `openacs-4/packages/lorsm/www/doc/lorsm-rte.html'. Fisheye: No comparison available. Pass `N' to diff? Index: openacs-4/packages/lorsm/www/doc/images/scorm1.png =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/doc/images/Attic/scorm1.png,v diff -u -r1.1.2.1 -r1.1.2.2 Binary files differ Index: openacs-4/packages/lorsm-portlet/www/lorsm-admin-portlet.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm-portlet/www/lorsm-admin-portlet.adp,v diff -u -r1.3 -r1.3.4.1 --- openacs-4/packages/lorsm-portlet/www/lorsm-admin-portlet.adp 29 Nov 2004 17:28:23 -0000 1.3 +++ openacs-4/packages/lorsm-portlet/www/lorsm-admin-portlet.adp 13 Jun 2005 15:10:57 -0000 1.3.4.1 @@ -1,3 +1,17 @@ + + + + - + Index: openacs-4/packages/lorsm-portlet/www/lorsm-admin-portlet.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm-portlet/www/lorsm-admin-portlet.tcl,v diff -u -r1.3 -r1.3.2.1 --- openacs-4/packages/lorsm-portlet/www/lorsm-admin-portlet.tcl 17 May 2005 17:53:36 -0000 1.3 +++ openacs-4/packages/lorsm-portlet/www/lorsm-admin-portlet.tcl 13 Jun 2005 15:10:59 -0000 1.3.2.1 @@ -10,6 +10,17 @@ } + +set lors_central_package_id [apm_package_id_from_key "lors-central"] +set lors_central_url [apm_package_url_from_id $lors_central_package_id] + +if { ![string equal $lors_central_package_id 0] } { + set use_lc_p [parameter::get -parameter "UploadUsingLorsCentralP" -package_id $lors_central_package_id] +} else { + set use_lc_p 0 +} + + array set config $cf set list_of_package_ids $config(package_id) @@ -23,3 +34,4 @@ set url [lindex [site_node::get_url_from_object_id -object_id $package_id] 0] ad_return_template + Index: openacs-4/packages/lorsm-portlet/www/lorsm-portlet.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm-portlet/www/lorsm-portlet.adp,v diff -u -r1.2 -r1.2.4.1 --- openacs-4/packages/lorsm-portlet/www/lorsm-portlet.adp 4 Sep 2004 14:09:02 -0000 1.2 +++ openacs-4/packages/lorsm-portlet/www/lorsm-portlet.adp 13 Jun 2005 15:10:59 -0000 1.2.4.1 @@ -10,7 +10,6 @@ -