Index: openacs-4/packages/dotlrn-catalog/catalog/dotlrn-catalog.en_US.ISO-8859-1.xml =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-catalog/catalog/dotlrn-catalog.en_US.ISO-8859-1.xml,v diff -u -r1.1 -r1.2 --- openacs-4/packages/dotlrn-catalog/catalog/dotlrn-catalog.en_US.ISO-8859-1.xml 14 Feb 2005 22:46:11 -0000 1.1 +++ openacs-4/packages/dotlrn-catalog/catalog/dotlrn-catalog.en_US.ISO-8859-1.xml 16 Feb 2005 00:22:12 -0000 1.2 @@ -13,14 +13,15 @@ <msg key="categories">Categories</msg> <msg key="categorize">Categorize</msg> <msg key="categorized">Categorized Courses</msg> + <msg key="category">Category</msg> <msg key="class">Class</msg> <msg key="class_name">Class Name</msg> <msg key="com_name">Community Name:</msg> <msg key="community">Community</msg> <msg key="confirm_delete">Confirm Delete Of </msg> <msg key="course_admin">Course Administration</msg> <msg key="course_catalog">DotLRN Catalog Index</msg> - <msg key="course_info">Course Info:</msg> + <msg key="course_info">Description:</msg> <msg key="course_key">Course Key:</msg> <msg key="course_list">Your Course List</msg> <msg key="course_name">Course Name:</msg> @@ -48,6 +49,7 @@ <msg key="grantrevoke">Grant/Revoke</msg> <msg key="has_no">and has <b>No</b> associations to dotLRN class or community</msg> <msg key="has_one">has one association to dotLRN class or community</msg> + <msg key="info">Course Information</msg> <msg key="is_assoc">is associated to:</msg> <msg key="label_title">Check/uncheck all rows</msg> <msg key="make_live">Make This Course Live</msg> @@ -78,6 +80,7 @@ <msg key="title">Check/uncheck this row, and select an action to perform below</msg> <msg key="to">To</msg> <msg key="to_dotlrn">associations to dotLRN classes or communities</msg> + <msg key="uncat">Uncategorized</msg> <msg key="uncategorized">Uncategorized Courses</msg> <msg key="user_name">User Name:</msg> <msg key="users_to_grant">users to grant permissions that match that search</msg> Index: openacs-4/packages/dotlrn-catalog/catalog/dotlrn-catalog.es_ES.ISO-8859-1.xml =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-catalog/catalog/dotlrn-catalog.es_ES.ISO-8859-1.xml,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/dotlrn-catalog/catalog/dotlrn-catalog.es_ES.ISO-8859-1.xml 16 Feb 2005 00:22:46 -0000 1.1 @@ -0,0 +1,93 @@ +<?xml version="1.0" encoding="ISO-8859-1"?> +<message_catalog package_key="dotlrn-catalog" package_version="0.1a4" locale="es_ES" charset="ISO-8859-1"> + + <msg key="add_course_to">Agregar este curso a una categoria.</msg> + <msg key="admin_categories">Administrar Arbol de Categorias</msg> + <msg key="and_has">y tiene</msg> + <msg key="asm">Assessment</msg> + <msg key="associate">Asociar</msg> + <msg key="associate_this">Asociar este curso</msg> + <msg key="associate_to_class">Asociar a esta clase</msg> + <msg key="associate_to_com">Asociar a esta comunidad</msg> + <msg key="associated">Asociado</msg> + <msg key="categories">Categorias</msg> + <msg key="categorize">Categorizar</msg> + <msg key="categorized">Cursos Categorizados</msg> + <msg key="category">Categoria</msg> + <msg key="class">Clase</msg> + <msg key="class_name">Nombre de la Clase</msg> + <msg key="com_name">Nombre de la Comunidad</msg> + <msg key="community">Comunidad</msg> + <msg key="confirm_delete">Corfirmar borrado de</msg> + <msg key="course_admin">Administracion de Cursos</msg> + <msg key="course_catalog">Indice del Catalogo dotLRN</msg> + <msg key="course_info">Informacion del Curso:</msg> + <msg key="course_key">Llave del Curso:</msg> + <msg key="course_list">Su listado de Cursos</msg> + <msg key="course_name">Nombre del Curso:</msg> + <msg key="courses">Corsos</msg> + <msg key="create_new_ver">Crear una nueva version de</msg> + <msg key="delete">Borrar</msg> + <msg key="delete_course">Borrar Cursos</msg> + <msg key="delete_this">Borrar este Curso</msg> + <msg key="dep_name">Nombre del Departamento</msg> + <msg key="description">Descripcion</msg> + <msg key="do_you_still">Aun quiere borrarlo?</msg> + <msg key="dotlrn">dotLRN</msg> + <msg key="dotlrn_classes">Clases de dotLRN</msg> + <msg key="dotlrn_com">Comunidades de dotLRN</msg> + <msg key="dotlrn_list">Listado de dotLRN</msg> + <msg key="edit_course">Nueva version del Curso</msg> + <msg key="email">Correo electronico:</msg> + <msg key="enroll">Inscribirse</msg> + <msg key="enroll_not">Inscripcion no disponible</msg> + <msg key="grant">Otorgar</msg> + <msg key="grant_list">Usuarios a otorgar permisos</msg> + <msg key="grant_per">Otorgar Permisos</msg> + <msg key="grant_to_others">Otorgar permisos a otros usuarios</msg> + <msg key="granted">Otorgado</msg> + <msg key="grantrevoke">Otorgar/Remover</msg> + <msg key="has_no">y <b>No</b> posee asociaciones a clases o comunidades de dotLRN</msg> + <msg key="has_one">posee una asociacion a una clase o comunidad de dotLRN</msg> + <msg key="is_assoc">esta asociado a:</msg> + <msg key="label_title">Marcar/Desmarcar todas las filas</msg> + <msg key="make_live">Hacer este Curso Disponible</msg> + <msg key="manage_per">Administrar Permisos</msg> + <msg key="name_already"><b>La llave del curso ya existe</b></msg> + <msg key="new_course">Nuevo Curso</msg> + <msg key="new_ver">Nueva Version del Curso</msg> + <msg key="no">No</msg> + <msg key="not_allowed">No permitido</msg> + <msg key="not_associate">No Asociar</msg> + <msg key="not_associated">No Asociado</msg> + <msg key="one_course_info">Informacion de un Curso</msg> + <msg key="permission">Permisos:</msg> + <msg key="rev_list">Listado de Revisiones</msg> + <msg key="revisions">Revisiones</msg> + <msg key="revoke">Remover</msg> + <msg key="revoke_per">Remover Permisos</msg> + <msg key="search_email_help">buscar por direccion de correo electronico o parte de ella</msg> + <msg key="search_help">buscar por nombre o apellido.</msg> + <msg key="search_u">Busqueda de Usuarios</msg> + <msg key="search_user">Busqueda por Nombre del Usuario:</msg> + <msg key="search_user_email">Busqueda por direccion de correo electronico:</msg> + <msg key="search_users_to">Busqueda de usuarios para otrogar permisos</msg> + <msg key="see_all_rev">Ver todas las versiones</msg> + <msg key="subject_name">Nombre de la Materia</msg> + <msg key="term_name">Nombre del periodo</msg> + <msg key="this_course">Este curso posee</msg> + <msg key="title">Marcar/Desmarcar esta fila, y seleccionar una accion a realizar</msg> + <msg key="to">Para</msg> + <msg key="to_dotlrn">Asociaciones a clases o comunidades de dotLRN</msg> + <msg key="uncat">Sin categoria</msg> + <msg key="uncategorized">Cursos No Categorizados</msg> + <msg key="user_name">Nombre del Usuario:</msg> + <msg key="users_to_grant">usuarios que a otorgar permiso que coinciden con la busqueda</msg> + <msg key="version">Version</msg> + <msg key="versions">Versiones</msg> + <msg key="watch">Observar</msg> + <msg key="watch_assoc">Observar Asociaciones</msg> + <msg key="yes">Si</msg> +</message_catalog> + + Index: openacs-4/packages/dotlrn-catalog/lib/course-chunk.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-catalog/lib/course-chunk.adp,v diff -u -r1.2 -r1.3 --- openacs-4/packages/dotlrn-catalog/lib/course-chunk.adp 14 Feb 2005 22:55:39 -0000 1.2 +++ openacs-4/packages/dotlrn-catalog/lib/course-chunk.adp 16 Feb 2005 00:22:12 -0000 1.3 @@ -1,4 +1,5 @@ <table> +<h3>#dotlrn-catalog.info#:</h3> <tr> <td> <if @edit@ eq yes> @@ -20,12 +21,10 @@ <td><b>#dotlrn-catalog.course_name#</b></td><td>@name@</td> </tr> <tr><td></td> - <td><b>#dotlrn-catalog.course_info#</b></td><td>@info@</td> + <td><b>#dotlrn-catalog.course_info#</b></td><td>@info;noquote@</td> </tr> +<if @revision@ eq yes> <tr><td></td> - <td><b>#dotlrn-catalog.asm#:</b></td><td>@asm@</td> -</tr> -<tr><td></td> <td> <b>#dotlrn-catalog.dotlrn#:</b> </td> @@ -47,6 +46,12 @@ </else> </td> </tr> +</if> +<if @asm@ not eq #dotlrn-catalog.not_associated#> + <tr><td></td> + <td><b>#dotlrn-catalog.asm#:</b></td><td>@asm@</td> + </tr> +</if> <if @category_p@ eq "1"> <if @index@ not eq "yes"> <tr><td></td> @@ -88,4 +93,17 @@ </else> </tr> </table> + <br> +<if @revision@ not eq yes> +<h3>#dotlrn-catalog.dotlrn_assoc#:</h3> +<multiple name="relations"> + <if @relations.type@ eq "dotlrn_catalog_class_rel"> + <include src="/packages/dotlrn-catalog/lib/dotlrn-chunk" class_id=@relations.object_id@> + </if> + <else> + <include src="/packages/dotlrn-catalog/lib/community-chunk" community_id=@relations.object_id@> + </else> +</multiple> +</if> + Index: openacs-4/packages/dotlrn-catalog/lib/course-chunk.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-catalog/lib/course-chunk.tcl,v diff -u -r1.1 -r1.2 --- openacs-4/packages/dotlrn-catalog/lib/course-chunk.tcl 14 Feb 2005 22:46:11 -0000 1.1 +++ openacs-4/packages/dotlrn-catalog/lib/course-chunk.tcl 16 Feb 2005 00:22:12 -0000 1.2 @@ -16,10 +16,20 @@ set asmid "-1" } +if { ![info exists revision] } { + set revision "no" +} + set category_p [db_string get_category { } -default -1] +set info [ad_html_text_convert -from text/enhanced -to text/plain $info] + set cc_package_id [apm_package_id_from_key "dotlrn-catalog"] set tree_id [db_string get_tree_id { } -default "-1"] # Get the category name -set category_name "[category::get_name [category::get_mapped_categories $course_id]]" \ No newline at end of file +set category_name "[category::get_name [category::get_mapped_categories $course_id]]" + + +# For dotlrn associations +db_multirow relations relation { } \ No newline at end of file Index: openacs-4/packages/dotlrn-catalog/lib/course-chunk.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-catalog/lib/course-chunk.xql,v diff -u -r1.1 -r1.2 --- openacs-4/packages/dotlrn-catalog/lib/course-chunk.xql 14 Feb 2005 22:46:11 -0000 1.1 +++ openacs-4/packages/dotlrn-catalog/lib/course-chunk.xql 16 Feb 2005 00:22:12 -0000 1.2 @@ -13,4 +13,11 @@ </querytext> </fullquery> + <fullquery name="relation"> + <querytext> + select object_id_two as object_id, rel_type as type from acs_rels + where object_id_one = :course_id order by type + </querytext> + </fullquery> + </queryset> \ No newline at end of file Index: openacs-4/packages/dotlrn-catalog/sql/oracle/dotlrn-catalog-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-catalog/sql/oracle/dotlrn-catalog-create.sql,v diff -u -r1.1 -r1.2 --- openacs-4/packages/dotlrn-catalog/sql/oracle/dotlrn-catalog-create.sql 14 Feb 2005 22:46:11 -0000 1.1 +++ openacs-4/packages/dotlrn-catalog/sql/oracle/dotlrn-catalog-create.sql 16 Feb 2005 00:22:12 -0000 1.2 @@ -3,9 +3,9 @@ -- creation-date 2005-01-31 begin - acs_rel_type.create_role(''d_catalog_role'', ''DotLRN Course Catalog Role'', ''DotLRN Course Catalog Role''); - acs_rel_type.create_role(''dotlrn_class_role'', ''dotLRN Class Role'', ''dotLRN Class Role''); - acs_rel_type.create_role(''dotlrn_com_role'', ''dotLRN Community Role'', ''dotLRN Community Role''); + acs_rel_type.create_role('d_catalog_role', 'DotLRN Course Catalog Role', 'DotLRN Course Catalog Role'); + acs_rel_type.create_role('dotlrn_class_role', 'dotLRN Class Role', 'dotLRN Class Role'); + acs_rel_type.create_role('dotlrn_com_role', 'dotLRN Community Role', 'dotLRN Community Role'); commit; end; Index: openacs-4/packages/dotlrn-catalog/www/admin/grant-users.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-catalog/www/admin/grant-users.tcl,v diff -u -r1.1 -r1.2 --- openacs-4/packages/dotlrn-catalog/www/admin/grant-users.tcl 14 Feb 2005 22:46:11 -0000 1.1 +++ openacs-4/packages/dotlrn-catalog/www/admin/grant-users.tcl 16 Feb 2005 00:22:12 -0000 1.2 @@ -13,20 +13,9 @@ # dotlrn_catalog package_id set cc_package_id [apm_package_id_from_key "dotlrn-catalog"] -# The tree id from categories -set tree_list [category_tree::get_mapped_trees $cc_package_id] -if { [string equal [lindex [lindex $tree_list 0] 1] "dotlrn-course-catalog"] } { - set tree_id [lindex [lindex $tree_list 0] 0] -} else { - set tree_id "" -} - - # Grants Permission for all the users in p_user_id foreach user $p_user_id { permission::grant -party_id $user -object_id $cc_package_id -privilege "create" - permission::grant -party_id $user -object_id $tree_id -privilege category_tree_read - permission::grant -party_id $user -object_id $tree_id -privilege category_tree_write } Index: openacs-4/packages/dotlrn-catalog/www/admin/revoke-users.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-catalog/www/admin/revoke-users.tcl,v diff -u -r1.1 -r1.2 --- openacs-4/packages/dotlrn-catalog/www/admin/revoke-users.tcl 14 Feb 2005 22:46:11 -0000 1.1 +++ openacs-4/packages/dotlrn-catalog/www/admin/revoke-users.tcl 16 Feb 2005 00:22:12 -0000 1.2 @@ -13,20 +13,9 @@ # dotlrn_catalog package_id set cc_package_id [apm_package_id_from_key "dotlrn-catalog"] -# The tree id from categories -set tree_list [category_tree::get_mapped_trees $cc_package_id] -if { [string equal [lindex [lindex $tree_list 0] 1] "dotlrn-course-catalog"] } { - set tree_id [lindex [lindex $tree_list 0] 0] -} else { - set tree_id "" -} - - # Grants Permission for all the users in p_user_id foreach user $p_user_id { permission::revoke -party_id $user -object_id $cc_package_id -privilege "create" - permission::revoke -party_id $user -object_id $tree_id -privilege "category_tree_read" - permission::revoke -party_id $user -object_id $tree_id -privilege "category_tree_write" } Index: openacs-4/packages/dotlrn-catalog/www/dt-admin/course-add-edit.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-catalog/www/dt-admin/course-add-edit.tcl,v diff -u -r1.1 -r1.2 --- openacs-4/packages/dotlrn-catalog/www/dt-admin/course-add-edit.tcl 14 Feb 2005 22:46:11 -0000 1.1 +++ openacs-4/packages/dotlrn-catalog/www/dt-admin/course-add-edit.tcl 16 Feb 2005 00:22:12 -0000 1.2 @@ -24,16 +24,15 @@ # Check for create permissions over dotlrn-catalog package permission::require_permission -party_id $user_id -object_id $cc_package_id -privilege "create" -if { [info exists mode] } { - # Check if users has admin permission to edit the course - permission::require_permission -object_id $course_id -privilege "create" - # To disable the element course_key - set mode display +if { [info exist mode] } { + if { [string equal $mode 1] } { + permission::require_permission -object_id $course_id -privilege "create" + } + set mode_p display } else { - set mode edit + set mode_p edit } - # Get assessments set asm_package_id [apm_package_id_from_key assessment] set asm_list [list [list "[_ dotlrn-catalog.not_associate]" "-1"]] @@ -49,21 +48,20 @@ # Creates the elements to show with ad_form - foreach attribute $attribute_list { set element_mode "" set aditional_type "" set aditional_elements "" switch [lindex $attribute 4] { string { if { [string equal [lindex $attribute 2] "assessment_id"]} { - set aditional_type "(select)" - set aditional_elements [list options $asm_list] - } else { - if { [string equal [lindex $attribute 2] "course_key"]} { - set element_mode [list mode edit] - } - } + set aditional_type "(select)" + set aditional_elements [list options $asm_list] + } else { + if { [string equal [lindex $attribute 2] "course_key"]} { + set element_mode [list mode $mode_p] + } + } } text { set aditional_type "(textarea)" @@ -77,14 +75,11 @@ } } set element [list [lindex $attribute 2]:text${aditional_type} [list label [lindex $attribute 3]] $aditional_elements $element_mode] - lappend elements $element - } - # Create the form -ad_form -name add_course -export {return_url $return_url } -form { +ad_form -name add_course -export {return_url $return_url mode $mode} -form { course_id:key } @@ -99,25 +94,21 @@ } } -ad_form -extend -name add_course -validate { - { course_key - { [dotlrn_catalog::check_name -name $course_key] } - "[_ dotlrn-catalog.name_already]" - } -} -new_data { +ad_form -extend -name add_course -new_data { # New item and revision in the CR set folder_id [dotlrn_catalog::get_folder_id] set attribute_list [package_object_attribute_list -start_with dotlrn_catalog dotlrn_catalog] set form_attributes [list] + foreach attribute $attribute_list { set attr_name [lindex $attribute 2] lappend form_attributes [list $attr_name [set $attr_name]] } - - set item_id [content::item::new -name $course_key -parent_id $folder_id \ - -content_type "dotlrn_catalog" -creation_user $user_id \ - -attributes $form_attributes -is_live t] - + if { [catch { set item_id [content::item::new -name $course_key -parent_id $folder_id \ + -content_type "dotlrn_catalog" -creation_user $user_id \ + -attributes $form_attributes -is_live t] } errmsg] } { + ad_return_complaint 1 "\#dotlrn-catalog.name_already\#" + } # Grant admin privileges to the user over the item in the CR permission::grant -party_id $user_id -object_id $item_id -privilege "admin" Index: openacs-4/packages/dotlrn-catalog/www/dt-admin/course-info.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-catalog/www/dt-admin/course-info.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/dotlrn-catalog/www/dt-admin/course-info.adp 16 Feb 2005 00:22:46 -0000 1.1 @@ -0,0 +1,6 @@ +<master> +<property name=title>@page_title@</property> +<property name="context">@context;noquote@</property> +<br> + +<include src="/packages/dotlrn-catalog/lib/course-chunk" course_id=@course_id@ course_key=@course_key@ name=@course_name@ info=@course_info@ asm=@asm_name@ rel=@rel@ return_url=@return_url@ edit=yes live_revision="" item_id=@item_id@ creation_user=@creation_user@> Index: openacs-4/packages/dotlrn-catalog/www/dt-admin/course-info.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-catalog/www/dt-admin/course-info.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/dotlrn-catalog/www/dt-admin/course-info.tcl 16 Feb 2005 00:22:46 -0000 1.1 @@ -0,0 +1,23 @@ +ad_page_contract { + Displays information of one course + @author Miguel Marin (miguelmarin@viaro.net) + @author Viaro Networks www.viaro.net + @creation-date 15-02-2005 +} { + course_id:notnull + course_key:notnull + course_name:notnull +} +set page_title "$course_key [_ dotlrn-catalog.course_info]" +set context [list "[_ dotlrn-catalog.one_course_info]"] + +set return_url "index" +set asm_package_id [apm_package_id_from_key assessment] + +db_1row get_course_info { } + +set asm_name [db_string get_asm_name { } -default "[_ dotlrn-catalog.not_associated]"] +set item_id [dotlrn_catalog::get_item_id -revision_id $course_id] +set creation_user [dotlrn_catalog::get_creation_user -object_id $item_id] +set rel [dotlrn_catalog::has_relation -course_id $course_id] + Index: openacs-4/packages/dotlrn-catalog/www/dt-admin/course-info.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-catalog/www/dt-admin/course-info.xql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/dotlrn-catalog/www/dt-admin/course-info.xql 16 Feb 2005 00:22:46 -0000 1.1 @@ -0,0 +1,23 @@ +<?xml version="1.0"?> +<queryset> + +<fullquery name="get_course_info"> + <querytext> + select dc.course_info, dc.assessment_id, cr.item_id + from dotlrn_catalog dc, cr_revisions cr + where cr.revision_id = :course_id and dc.course_id = :course_id + </querytext> +</fullquery> + +<fullquery name="get_asm_name"> + <querytext> + select cr.title from + cr_folders cf, cr_items ci, cr_revisions cr, as_assessments a + where cr.revision_id = ci.latest_revision and a.assessment_id = cr.revision_id and + ci.parent_id = cf.folder_id and cf.package_id = :asm_package_id and + ci.item_id = :assessment_id order by cr.title + </querytext> +</fullquery> + + +</queryset> \ No newline at end of file Index: openacs-4/packages/dotlrn-catalog/www/dt-admin/course-list.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-catalog/www/dt-admin/course-list.adp,v diff -u -r1.1 -r1.2 --- openacs-4/packages/dotlrn-catalog/www/dt-admin/course-list.adp 14 Feb 2005 22:46:11 -0000 1.1 +++ openacs-4/packages/dotlrn-catalog/www/dt-admin/course-list.adp 16 Feb 2005 00:22:12 -0000 1.2 @@ -2,13 +2,13 @@ <property name=title>@page_title@</property> <property name="context">@context;noquote@</property> <a href="course-add-edit?return_url=@return_url@">#dotlrn-catalog.new_course#</a> -<if @tree_id@ not eq ""> -| <a href="/categories/cadmin/tree-view?tree_id=@tree_id@">#dotlrn-catalog.admin_categories#</a> -</if> <if @admin_p@ eq 1> + <if @tree_id@ not eq ""> + | <a href="/categories/cadmin/tree-view?tree_id=@tree_id@">#dotlrn-catalog.admin_categories#</a> + </if> | <a href="../admin/grant-list?return_url=@return_url@">#dotlrn-catalog.grant_per#</a> </if> <br><br> -<multiple name="course_list"> - <include src="/packages/dotlrn-catalog/lib/course-chunk" course_id=@course_list.course_id@ course_key=@course_list.course_key@ name=@course_list.course_name@ info=@course_list.course_info@ asm=@course_list.asm_name@ rel=@course_list.rel@ return_url=@return_url@ edit=yes live_revision="" item_id=@course_list.item_id@ creation_user=@course_list.creation_user@> -</multiple> +<center> +<listtemplate name=course_list></listtemplate> +</center> \ No newline at end of file Index: openacs-4/packages/dotlrn-catalog/www/dt-admin/course-list.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-catalog/www/dt-admin/course-list.tcl,v diff -u -r1.1 -r1.2 --- openacs-4/packages/dotlrn-catalog/www/dt-admin/course-list.tcl 14 Feb 2005 22:46:11 -0000 1.1 +++ openacs-4/packages/dotlrn-catalog/www/dt-admin/course-list.tcl 16 Feb 2005 00:22:12 -0000 1.2 @@ -4,7 +4,7 @@ @author Viaro Networks www.viaro.net @creation-date 28-01-2005 } { - + page:optional } set user_id [ad_conn user_id] @@ -35,15 +35,86 @@ if { [acs_user::site_wide_admin_p] } { set query get_course_info_site_wide + set paginator_query site_wide_paginator } else { set query get_course_info + set paginator_query paginator } +template::list::create \ + -name course_list \ + -multirow course_list \ + -key course_id \ + -page_groupsize 5 \ + -page_flush_p t \ + -page_query_name $query \ + -bulk_action_method post \ + -bulk_action_export_vars { + }\ + -row_pretty_plural "[_ dotlrn-catalog.courses]" \ + -elements { + key { + label "[_ dotlrn-catalog.course_key]" + display_template { + <a href=course-add-edit?course_id=@course_list.course_id@&return_url=$return_url&mode=1 \ + title="[_ dotlrn-catalog.new_ver]">\ + <img border=0 src=/resources/Edit16.gif></a> + <a href="revision-list?course_key=@course_list.course_key@&return_url=$return_url&course_id=@course_list.course_id@" title="[_ dotlrn-catalog.see_all_rev]">@course_list.course_key@</a> + } + } + name { + label "[_ dotlrn-catalog.course_name]" + display_template { + <a href="course-info?course_id=@course_list.course_id@&course_name=@course_list.course_name@&course_key=@course_list.course_key@">@course_list.course_name@</a> + } + } + assessment_id { + label "[_ dotlrn-catalog.asm]:" + display_template { + @course_list.asm_name@ + } + } + dotlrn { + label "[_ dotlrn-catalog.dotlrn]" + display_template { + <if @course_list.rel@ eq 0> + #dotlrn-catalog.no# (<a href="dotlrn-list?course_id=@course_list.course_id@&course_key=@course_list.course_key@&return_url=$return_url&course_name=@course_list.course_name@" title="\#dotlrn-catalog.associate_this\#"><i>#dotlrn-catalog.associate#</i></a>) + </if> + <else> + #dotlrn-catalog.yes# (<a href="watch-association?course_id=@course_list.course_id@&course_key=@course_list.course_key@&return_url=$return_url&course_name=@course_list.course_name@" title="\#dotlrn-catalog.watch_assoc#"><i>#dotlrn-catalog.watch#</i></a>) + </else> + } + } + category { + label "[_ dotlrn-catalog.category]" + display_template { + <div align=center> + <if @course_list.category_name@ not eq ""> + @course_list.category_name@ + </if> + <else> + #dotlrn-catalog.uncat# + </else> + </div> + } + } + permissions { + label "[_ dotlrn-catalog.permission]" + display_template { + <a href="grant-user-list?object_id=@course_list.item_id@&creation_user=@course_list.creation_user@&course_key=@course_list.course_key@">\#dotlrn-catalog.manage_per\#</a> + } + } + delete { + display_template { + <a href="course-delete?object_id=@course_list.item_id@&creation_user=@course_list.creation_user@&course_key=@course_list.course_key@" title="\#dotlrn-catalog.delete\#"><img border=0 src=/resources/Delete16.gif></a> + } + } + } -db_multirow -extend { asm_name rel item_id creation_user } course_list $query {} { +db_multirow -extend { asm_name rel item_id creation_user category_name } course_list $query {} { set asm_name [db_string get_asm_name { } -default "[_ dotlrn-catalog.not_associated]"] set item_id [dotlrn_catalog::get_item_id -revision_id $course_id] set creation_user [dotlrn_catalog::get_creation_user -object_id $item_id] set rel [dotlrn_catalog::has_relation -course_id $course_id] + set category_name "[category::get_name [category::get_mapped_categories $course_id]]" } - Index: openacs-4/packages/dotlrn-catalog/www/dt-admin/course-list.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-catalog/www/dt-admin/course-list.xql,v diff -u -r1.1 -r1.2 --- openacs-4/packages/dotlrn-catalog/www/dt-admin/course-list.xql 14 Feb 2005 22:46:11 -0000 1.1 +++ openacs-4/packages/dotlrn-catalog/www/dt-admin/course-list.xql 16 Feb 2005 00:22:12 -0000 1.2 @@ -9,7 +9,6 @@ ci.item_id in ( select object_id from acs_permissions where grantee_id = :user_id and privilege = 'admin') - </querytext> </fullquery> @@ -31,5 +30,24 @@ </querytext> </fullquery> +<fullquery name="paginator"> + <querytext> + select cc.course_id, cc.course_key, cc.course_name, cc.course_info, cc.assessment_id, ci.item_id + from dotlrn_catalog cc, cr_items ci + where cc.course_id = ci.live_revision and + ci.item_id in ( + select object_id from acs_permissions where grantee_id = :user_id and + privilege = 'admin') + </querytext> +</fullquery> +<fullquery name="site_wide_paginator"> + <querytext> + select cc.course_id, cc.course_key, cc.course_name, cc.course_info, cc.assessment_id, ci.item_id + from dotlrn_catalog cc, cr_items ci + where cc.course_id = ci.live_revision + </querytext> +</fullquery> + + </queryset> Index: openacs-4/packages/dotlrn-catalog/www/dt-admin/revision-list.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-catalog/www/dt-admin/revision-list.adp,v diff -u -r1.1 -r1.2 --- openacs-4/packages/dotlrn-catalog/www/dt-admin/revision-list.adp 14 Feb 2005 22:46:11 -0000 1.1 +++ openacs-4/packages/dotlrn-catalog/www/dt-admin/revision-list.adp 16 Feb 2005 00:22:12 -0000 1.2 @@ -4,6 +4,6 @@ <multiple name="course_list"> - <include src="/packages/dotlrn-catalog/lib/course-chunk" course_id=@course_list.course_id@ course_key=@course_list.course_key@ name=@course_list.course_name@ info=@course_list.course_info@ asm=@course_list.asm_name@ rel=@course_list.rel@ return_url=@return_url@ edit=no live_revision=@course_list.live_revision@> + <include src="/packages/dotlrn-catalog/lib/course-chunk" course_id=@course_list.course_id@ course_key=@course_list.course_key@ name=@course_list.course_name@ info=@course_list.course_info@ asm=@course_list.asm_name@ rel=@course_list.rel@ return_url=@return_url@ edit=no live_revision=@course_list.live_revision@ revision=yes> </multiple>