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.6 -r1.7 --- openacs-4/packages/dotlrn-catalog/catalog/dotlrn-catalog.en_US.ISO-8859-1.xml 17 Feb 2005 22:56:10 -0000 1.6 +++ openacs-4/packages/dotlrn-catalog/catalog/dotlrn-catalog.en_US.ISO-8859-1.xml 19 Feb 2005 02:32:07 -0000 1.7 @@ -71,6 +71,7 @@ <msg key="please_type">Please type a keyword</msg> <msg key="privilege_on">Privilege on</msg> <msg key="privilege_on_catalog">Privilege on dotLRN-Catalog:</msg> + <msg key="professor">Professor:</msg> <msg key="rev_list">Revision List</msg> <msg key="revisions">Revisions</msg> <msg key="revoke">Revoke</msg> 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.6 -r1.7 --- openacs-4/packages/dotlrn-catalog/lib/course-chunk.adp 17 Feb 2005 22:56:10 -0000 1.6 +++ openacs-4/packages/dotlrn-catalog/lib/course-chunk.adp 19 Feb 2005 02:32:07 -0000 1.7 @@ -72,7 +72,7 @@ <td> <if @edit@ eq no> <if @index@ eq "yes"> - <if @asmid@ gt "-1"> + <if @asmid@ not eq "-1"> <a class="button" href="/assessment/assessment?assessment_id=@asmid@">#dotlrn-catalog.enroll#</a> </if> <else> @@ -102,26 +102,21 @@ <br> <if @revision@ not eq yes> -<if @obj_n@ not eq "0"> - <h3>#dotlrn-catalog.dotlrn_assoc#:</h3> + <if @obj_n@ not eq "0"> + </if> + <else> + <if @admin_p@ eq 1> + <if @index@ not eq "yes"> + <h3>#dotlrn-catalog.dotlrn_assoc#:</h3> + #dotlrn-catalog.no# + (<a href="dotlrn-list?course_id=@course_id@&course_key=@course_key@&course_name=@name@" title="#dotlrn-catalog.associate_this#"><i>#dotlrn-catalog.associate#</i></a>) + </if> + </if> + </else> </if> -<else> - <if @admin_p@ eq 1> - <if @index@ not eq "yes"> - <h3>#dotlrn-catalog.dotlrn_assoc#:</h3> - #dotlrn-catalog.no# - (<a href="dotlrn-list?course_id=@course_id@&course_key=@course_key@&course_name=@name@" title="#dotlrn-catalog.associate_this#"><i>#dotlrn-catalog.associate#</i></a>) - </if> - </if> -</else> -<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> +<h2>@course_key@ (@name@) #dotlrn-catalog.dotlrn_classes#:</h2> +<listtemplate name="dotlrn_classes"></listtemplate> +<h2>@course_key@ (@name@) #dotlrn-catalog.dotlrn_com#:</h2> +<listtemplate name="dotlrn_communities"></listtemplate> 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.3 -r1.4 --- openacs-4/packages/dotlrn-catalog/lib/course-chunk.tcl 16 Feb 2005 22:21:30 -0000 1.3 +++ openacs-4/packages/dotlrn-catalog/lib/course-chunk.tcl 19 Feb 2005 02:32:07 -0000 1.4 @@ -49,7 +49,71 @@ } set obj_n 0 +set dotlrn_class "(" +set dotlrn_com "(" + # For dotlrn associations db_multirow -extend { obj_n admin_p } relations relation { } { set obj_n 1 -} \ No newline at end of file + if { [string equal $type "dotlrn_catalog_class_rel" ]} { + append dotlrn_class "'$object_id'" + append dotlrn_class "," + } else { + append dotlrn_com "'$object_id'" + append dotlrn_com "," + } +} +append dotlrn_class "0)" +append dotlrn_com "0)" + +db_multirow classes_list get_dotlrn_classes { } + +template::list::create \ + -name dotlrn_classes \ + -multirow classes_list \ + -key object_id \ + -row_pretty_plural "[_ dotlrn-catalog.dotlrn_classes]" \ + -elements { + class { + label "[_ dotlrn-catalog.class_name]" + display_template { + <a href="dotlrn-info?object_id=@classes_list.object_id@&type=class&course_id=$course_id&course_name=$name&course_key=$course_key">@classes_list.pretty_name@</a> + } + } + dep_name { + label "[_ dotlrn-catalog.dep_name]" + display_template { + @classes_list.department_name@ + } + } + term_name { + label "[_ dotlrn-catalog.term_name]" + display_template { + @classes_list.term_name@ + } + } + subject { + label "[_ dotlrn-catalog.subject_name]" + display_template { + @classes_list.class_name@ + } + } + } + + +db_multirow com_list get_dotlrn_communities { } + + +template::list::create \ + -name dotlrn_communities \ + -multirow com_list \ + -key object_id \ + -row_pretty_plural "[_ dotlrn-catalog.dotlrn_com]" \ + -elements { + community { + label "[_ dotlrn-catalog.com_name]" + display_template { + <a href="dotlrn-info?object_id=@com_list.object_id@&type=community&course_id=$course_id&course_name=$name&course_key=$course_key">@com_list.pretty_name@</a> + } + } + } 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.2 -r1.3 --- openacs-4/packages/dotlrn-catalog/lib/course-chunk.xql 16 Feb 2005 00:22:12 -0000 1.2 +++ openacs-4/packages/dotlrn-catalog/lib/course-chunk.xql 19 Feb 2005 02:32:07 -0000 1.3 @@ -16,8 +16,23 @@ <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 + where object_id_one = :course_id order by type </querytext> </fullquery> + <fullquery name="get_dotlrn_classes"> + <querytext> + select class_instance_id as object_id, department_name, term_name, class_name, pretty_name, url + from dotlrn_class_instances_full where class_instance_id in $dotlrn_class + order by department_name, term_name, class_name, pretty_name + </querytext> + </fullquery> + + <fullquery name="get_dotlrn_communities"> + <querytext> + select community_id as object_id, pretty_name, url from dotlrn_clubs_full + where community_id in $dotlrn_com order by pretty_name + </querytext> + </fullquery> + </queryset> \ No newline at end of file Index: openacs-4/packages/dotlrn-catalog/lib/tree-chunk.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-catalog/lib/tree-chunk.adp,v diff -u -r1.1 -r1.2 --- openacs-4/packages/dotlrn-catalog/lib/tree-chunk.adp 14 Feb 2005 22:46:11 -0000 1.1 +++ openacs-4/packages/dotlrn-catalog/lib/tree-chunk.adp 19 Feb 2005 02:32:07 -0000 1.2 @@ -1,11 +1,12 @@ -<h3>#dotlrn-catalog.categorized#:</h3> -@tree_view;noquote@ <br> -<if @uncat_p@ eq 1> - <h3>#dotlrn-catalog.uncategorized#:</h3> -</if> -<ul> -<multiple name="uncat"> - <li><a href="course-info?course_id=@course_id@&course_key=@course_key@&course_name=@course_name@">(@uncat.course_key@) @uncat.course_name@</a> -</multiple> -</ul> \ No newline at end of file +<table cellpadding="3" cellspacing="3"> + <tr> + <td class="list-filter-pane" valign="top"> + <listfilters name="course_list"></listfilters> + </td> + <td valign="top"> + <listtemplate name=course_list></listtemplate> + </td> + </tr> +</table> + Index: openacs-4/packages/dotlrn-catalog/lib/tree-chunk.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-catalog/lib/tree-chunk.tcl,v diff -u -r1.1 -r1.2 --- openacs-4/packages/dotlrn-catalog/lib/tree-chunk.tcl 14 Feb 2005 22:46:11 -0000 1.1 +++ openacs-4/packages/dotlrn-catalog/lib/tree-chunk.tcl 19 Feb 2005 02:32:07 -0000 1.2 @@ -5,38 +5,68 @@ @creation-date 11-02-2005 } { - + category_f:optional + uncat_f:optional } - +# Get all tree categories set tree_list [category_tree::get_tree -all $tree_id] -set tree_view "" -set cat_obj_list [dotlrn_catalog::get_categories_from_tree -tree_id $tree_id] - -# Display all courses associated to one category +# Create a list of values for the list filter +set tree [list] foreach element $tree_list { - set level [lindex $element 3] + set ident [lindex $element 3] set spacer "" - for { set i 0 } { $i < $level } { incr i } { - append spacer " " + for { set i 1 } { $i < $ident } { incr i } { + append spacer ". . " } - if { [string equal $level 1] } { - append tree_view "<b>${spacer}[lindex $element 1]<br></b>" - } else { - append tree_view "${spacer}[lindex $element 1]<br>" - } - foreach item $cat_obj_list { - if { [string equal [lindex $item 0] [lindex $element 0] ]} { - set course_id "[lindex $item 1]" - db_0or1row get_course_info { } - append tree_view "${spacer}   <a href=\"course-info?course_id=$course_id&course_key=$course_key&course_name=$course_name\">($course_key) $course_name</a><br>" + lappend tree [list "${spacer}[lindex "$element" 1]" [lindex $element 0]] +} + +# Get all objects_ids and category_id +set cat_obj_list [dotlrn_catalog::get_categories_from_tree -tree_id $tree_id] + +template::list::create \ + -name course_list \ + -multirow course_list \ + -key course_id \ + -filters { + category_f { + label "[_ dotlrn-catalog.categories]" + values { $tree } + where_clause { dc.course_id in ( select object_id from category_object_map where category_id = :category_f )} } + uncat_f { + label "[_ dotlrn-catalog.uncat]" + values { "Watch" } + where_clause { dc.course_id not in ( select object_id from category_object_map where category_id in \ + ( select category_id from categories where tree_id =:tree_id )) + } + } + } \ + -bulk_action_method post \ + -bulk_action_export_vars { + }\ + -row_pretty_plural "[_ dotlrn-catalog.courses]" \ + -elements { + course_key { + label "[_ dotlrn-catalog.course_key]" + display_template { + <div align=left> + @course_list.course_key@ + </div> + } + } + name { + label "[_ dotlrn-catalog.course_name]" + display_template { + <div align=left> + <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> + </div> + } + } } -} -# Display courses without category -set uncat_p 0 -db_multirow uncat get_courses_uncat { } { - set uncat_p 1 -} \ No newline at end of file + +db_multirow course_list get_courses {} + Index: openacs-4/packages/dotlrn-catalog/lib/tree-chunk.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-catalog/lib/tree-chunk.xql,v diff -u -r1.1 -r1.2 --- openacs-4/packages/dotlrn-catalog/lib/tree-chunk.xql 14 Feb 2005 22:46:11 -0000 1.1 +++ openacs-4/packages/dotlrn-catalog/lib/tree-chunk.xql 19 Feb 2005 02:32:07 -0000 1.2 @@ -1,26 +1,13 @@ <?xml version="1.0"?> <queryset> -<fullquery name="get_course_info"> +<fullquery name="get_courses"> <querytext> - select dc.course_id, dc.course_key, dc.course_name + select dc.course_id, dc.course_key, dc.course_name, dc.assessment_id from dotlrn_catalog dc, cr_items ci - where dc.course_id = ci.live_revision and dc.course_id = :course_id - </querytext> + where dc.course_id = ci.live_revision + [template::list::filter_where_clauses -and -name course_list] + </querytext> </fullquery> - -<fullquery name="get_courses_uncat"> - <querytext> - select dc.course_id, dc.course_key, dc.course_name - from dotlrn_catalog dc, cr_items ci - where dc.course_id = ci.live_revision and dc.course_id not in ( - select object_id from category_object_map where category_id in ( - select category_id from categories where tree_id =:tree_id - ) - ) - </querytext> -</fullquery> - - </queryset> Index: openacs-4/packages/dotlrn-catalog/www/dotlrn-info.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-catalog/www/dotlrn-info.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/dotlrn-catalog/www/dotlrn-info.adp 19 Feb 2005 02:32:47 -0000 1.1 @@ -0,0 +1,10 @@ +<master> +<property name=title>@page_title@</property> +<property name="context">@context;noquote@</property> + +<if @type@ eq "class"> + <include src="/packages/dotlrn-catalog/lib/dotlrn-chunk" class_id=@object_id@> +</if> +<else> + <include src="/packages/dotlrn-catalog/lib/community-chunk" community_id=@object_id@> +</else> Index: openacs-4/packages/dotlrn-catalog/www/dotlrn-info.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-catalog/www/dotlrn-info.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/dotlrn-catalog/www/dotlrn-info.tcl 19 Feb 2005 02:32:47 -0000 1.1 @@ -0,0 +1,15 @@ +ad_page_contract { + Displays the information of class or community + @author Miguel Marin (miguelmarin@viaro.net) + @author Viaro Networks www.viaro.net + @creation-date 08-01-2005 +} { + type:notnull + object_id:notnull + {course_id ""} + {course_name ""} + {course_key ""} +} + +set page_title "[_ dotlrn-catalog.description]" +set context "[list [list "course-info?course_id=$course_id&course_name=$course_name&course_key=$course_key" "[_ dotlrn-catalog.one_course_info]"] $page_title]" \ No newline at end of file