Index: openacs-4/packages/dotlrn/dotlrn.info =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/dotlrn.info,v diff -u -r1.118.2.3.4.8 -r1.118.2.3.4.9 --- openacs-4/packages/dotlrn/dotlrn.info 13 Oct 2004 15:12:14 -0000 1.118.2.3.4.8 +++ openacs-4/packages/dotlrn/dotlrn.info 22 Nov 2004 22:23:07 -0000 1.118.2.3.4.9 @@ -15,8 +15,8 @@ <description format="text/html">Course Management</description> <provides url="dotlrn" version="2.1.0b3"/> - <requires url="acs-lang" version="5.1.2d1"/> <requires url="acs-kernel" version="5.0.0b4"/> + <requires url="acs-lang" version="5.1.2d1"/> <requires url="attachments" version="0.5"/> <requires url="new-portal" version="0.1a"/> <requires url="user-profile" version="0.1d"/> @@ -28,20 +28,20 @@ <callback type="before-uninstall" proc="dotlrn::apm::before_uninstall"/> </callbacks> <parameters> + <parameter datatype="string" min_n_values="1" max_n_values="1" name="admin_page_name" default="#dotlrn.admin_page_name#" description="The name of the admin page"/> <parameter datatype="string" min_n_values="1" max_n_values="1" name="AutoAddAuthorities" default="*" description="A comma-separated list of short-names of authorities for which users should be automatically added to .LRN, or '*' for all. In order for users to be auto-added, AutoAddUsersP needs to be set to 1, and this needs to be set to * or include the relevant authority short_names. Example: 'local,ldap'." section_name="Auto-Adding Users to .LRN"/> <parameter datatype="number" min_n_values="1" max_n_values="1" name="AutoAddUsersP" default="0" description="Automatically add OpenACS users to .LRN. 1 = yes, 0 = no. In order for users to be auto-added, this needs to be set to 1, and AutoAddAuthorities needs to be set to * or include the relevant authority short_names." section_name="Auto-Adding Users to .LRN"/> + <parameter datatype="string" min_n_values="1" max_n_values="1" name="auto_dotlrn_user_email_patterns" description="Automatic dotLRN user email patterns"/> <parameter datatype="number" min_n_values="1" max_n_values="1" name="AutoUserAccessLevel" default="1" description="The access level of auto-added users. 1 = Full access user, 0 = Limited access user" section_name="Auto-Adding Users to .LRN"/> <parameter datatype="number" min_n_values="1" max_n_values="1" name="AutoUserReadPrivateDataP" default="1" description="Auto-added user's guest status. 1 = Not a guest , 0 = Guest." section_name="Auto-Adding Users to .LRN"/> <parameter datatype="string" min_n_values="1" max_n_values="1" name="AutoUserType" default="student" description="The user type for auto-approved users." section_name="Auto-Adding Users to .LRN"/> - <parameter datatype="string" min_n_values="1" max_n_values="1" name="admin_page_name" default="#dotlrn.admin_page_name#" description="The name of the admin page"/> - <parameter datatype="string" min_n_values="1" max_n_values="1" name="auto_dotlrn_user_email_patterns" description="Automatic dotLRN user email patterns"/> + <parameter datatype="string" min_n_values="1" max_n_values="1" name="classes_pretty_name" default="#dotlrn.classes_pretty_name#" description="used to display everywhere in the ui"/> + <parameter datatype="string" min_n_values="1" max_n_values="1" name="classes_pretty_plural" default="#dotlrn.classes_pretty_plural#" description="used everywhere in the ui"/> <parameter datatype="string" min_n_values="1" max_n_values="1" name="class_group_type_key" default="dotlrn_class" description="Class Group Type"/> <parameter datatype="string" min_n_values="1" max_n_values="1" name="class_instance_pages_csv" default="#dotlrn.class_page_home_title#,#new-portal.simple_2column_layout_name#;#dotlrn.class_page_calendar_title#,#new-portal.simple_1column_layout_name#;#dotlrn.class_page_file_storage_title#,#new-portal.simple_1column_layout_name#" description="cvs list of the page_name/layout to create"/> <parameter datatype="string" min_n_values="1" max_n_values="1" name="class_instance_portal_pretty_name" default="#dotlrn.class_instance_portal_pretty_name#" description="the nice name for the class instance portal template"/> <parameter datatype="string" min_n_values="1" max_n_values="1" name="class_instances_pretty_name" default="#dotlrn.class_instances_pretty_name#" description="used to display everywhere in the ui"/> <parameter datatype="string" min_n_values="1" max_n_values="1" name="class_instances_pretty_plural" default="#dotlrn.class_instances_pretty_plural#" description="used everywhere in the ui"/> - <parameter datatype="string" min_n_values="1" max_n_values="1" name="classes_pretty_name" default="#dotlrn.classes_pretty_name#" description="used to display everywhere in the ui"/> - <parameter datatype="string" min_n_values="1" max_n_values="1" name="classes_pretty_plural" default="#dotlrn.classes_pretty_plural#" description="used everywhere in the ui"/> <parameter datatype="string" min_n_values="1" max_n_values="1" name="club_group_type_key" default="dotlrn_club" description="Class Group Type"/> <parameter datatype="string" min_n_values="1" max_n_values="1" name="club_pages_csv" default="#dotlrn.club_page_home_title#,#new-portal.simple_2column_layout_name#;#dotlrn.club_page_calendar_title#,#new-portal.simple_1column_layout_name#;#dotlrn.club_page_file_storage_title#,#new-portal.simple_1column_layout_name#;#dotlrn.club_page_people_title#,#new-portal.simple_1column_layout_name#" description="same"/> <parameter datatype="string" min_n_values="1" max_n_values="1" name="clubs_pretty_name" default="#dotlrn.clubs_pretty_name#" description="used everywhere in the ui"/> @@ -58,6 +58,8 @@ <parameter datatype="number" min_n_values="1" max_n_values="1" name="dotlrn_level_p" description="Whether this is the top-level instantiation of the DotLRN package"/> <parameter datatype="string" min_n_values="1" max_n_values="1" name="dotlrn_main_portlet_pretty_name" default="#dotlrn.dotlrn_main_portlet_pretty_name#" description="The pretty name for the dotlrn main portlet (aka "My Groups")"/> <parameter datatype="string" min_n_values="1" max_n_values="1" name="dotlrn_main_portlet_region" default="2" description="The region of the user's workspace portal to put the dotlrn main portlet into. 1 is the leftmost. 2 is the next region to the left. etc."/> + <parameter datatype="number" min_n_values="1" max_n_values="1" name="dotlrn_toolbar_enabled_p" default="1" description="Enable or disable the dotlrn toolbar" section_name="Toolbar"/> + <parameter datatype="number" min_n_values="1" max_n_values="1" name="dotlrn_toolbar_show_info_p" default="0" description="Show relevant information to developpers." section_name="Toolbar"/> <parameter datatype="string" min_n_values="1" max_n_values="1" name="group_type_key" default="dotlrn_community" description="Class Group Type"/> <parameter datatype="string" min_n_values="1" max_n_values="1" name="non_member_page_name" default="#dotlrn.non_member_page_name#" description="The name of the not a member page"/> <parameter datatype="number" min_n_values="1" max_n_values="1" name="show_portrait_p" default="1" description="Should we show and solicit user portraits? 1=Yes, 0=No"/> Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/dotlrn/lib/toolbar.adp'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/dotlrn/lib/toolbar.tcl'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/dotlrn/tcl/toolbar-procs.tcl'. Fisheye: No comparison available. Pass `N' to diff? Index: openacs-4/packages/dotlrn/www/admin/class.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/admin/class.adp,v diff -u -r1.30.6.1 -r1.30.6.2 --- openacs-4/packages/dotlrn/www/admin/class.adp 29 Oct 2004 02:50:47 -0000 1.30.6.1 +++ openacs-4/packages/dotlrn/www/admin/class.adp 22 Nov 2004 22:23:08 -0000 1.30.6.2 @@ -1,96 +1,103 @@ <% - # - # Copyright (C) 2001, 2002 MIT - # - # This file is part of dotLRN. - # - # dotLRN is free software; you can redistribute it and/or modify it under the - # terms of the GNU General Public License as published by the Free Software - # Foundation; either version 2 of the License, or (at your option) any later - # version. - # - # dotLRN is distributed in the hope that it will be useful, but WITHOUT ANY - # WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - # FOR A PARTICULAR PURPOSE. See the GNU General Public License for more - # details. - # + # + # Copyright (C) 2001, 2002 MIT + # + # This file is part of dotLRN. + # + # dotLRN is free software; you can redistribute it and/or modify it under the + # terms of the GNU General Public License as published by the Free Software + # Foundation; either version 2 of the License, or (at your option) any later + # version. + # + # dotLRN is distributed in the hope that it will be useful, but WITHOUT ANY + # WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + # FOR A PARTICULAR PURPOSE. See the GNU General Public License for more + # details. + # -%> + %> -<master src="dotlrn-admin-master"> -<property name="title">@pretty_name@</property> -<property name="context_bar">@context_bar@</property> + <master src="dotlrn-admin-master"> + <property name="title">@pretty_name@</property> + <property name="context_bar">@context_bar@</property> -<ul> + <ul> - <li> - #dotlrn.description#: -<if @description@ not nil> - @description@ -</if> -<else> - <#dotlrn.no_description#> -</else> - </li> + <li> + #dotlrn.description#: + <if @description@ not nil> + @description@ + </if> + <else> + <#dotlrn.no_description#> + </else> + </li> - <br> + <br> - <li> - <a href="class-edit?class_key=@class_key@&referer=@referer@">#dotlrn.edit_subject_properties#</a> - </li> + <li> + <a href="class-edit?class_key=@class_key@&referer=@referer@">#dotlrn.edit_subject_properties#</a> + </li> -</ul> + </ul> -<center> + <center> -<if @can_instantiate@> - <table cellpadding="5" width="95%"> - <tr> - <td align="left"> - <nobr> - <small>[ - <a href="class-instance-new?class_key=@class_key@">#dotlrn.new_class_instance#</a> - ]</small> - </nobr> - </td> - </tr> - </table> + <if @can_instantiate@> + <table cellpadding="5" width="95%"> + <tr> + <td align="left"> + <nobr> + <small>[ + <a href="class-instance-new?class_key=@class_key@">#dotlrn.new_class_instance#</a> + ]</small> + </nobr> + </td> + </tr> + </table> - <br> -</if> -<else> -<include src="need-term-note"> -</else> + <br> + </if> + <else> + <include src="need-term-note"> + </else> - <table bgcolor="#cccccc" cellpadding="5" width="95%"> - <tr bgcolor="#eeeeee"> - <th align="left" width="50%"> - <formtemplate id="term_form"> - #dotlrn.term#: <formwidget id="term_id"> - </formtemplate> - </th> - </tr> - </table> + <table bgcolor="#cccccc" cellpadding="5" width="95%"> + <tr bgcolor="#eeeeee"> + <th align="left" width="50%"> + <formtemplate id="term_form"> + #dotlrn.term#: <formwidget id="term_id"> + </formtemplate> + </th> + </tr> + </table> - <br> + <br> -<if @class_instances:rowcount@ gt 0> + <form action="class" method="GET"> + Search classes with : + <input name="keyword" onfocus="if(this.value=='Please type a keyword')this.value='';" onblur="if(this.value=='')this.value='Please type a keyword';" value="Please type a keyword" /> + <input type="hidden" name="class_key" value="@class_key@" /> + <input type="hidden" name="term_id" value="@term_id@" /> + <input type="submit" value="Go" /> + </form> - <listtemplate name="class_instances"></listtemplate> + <if @class_instances:rowcount@ gt 0> + <listtemplate name="class_instances"></listtemplate> -</if> -<else> -<table> - <tr bgcolor="#eeeeee"> - <td align="left" colspan="4"> - <i>#dotlrn.no_class_instances#</i> - </td> - </tr> -</table> -</else> + </if> + <else> + <table> + <tr bgcolor="#eeeeee"> + <td align="left" colspan="4"> + <i>#dotlrn.no_class_instances#</i> + </td> + </tr> + </table> + </else> -</center> + </center> Index: openacs-4/packages/dotlrn/www/admin/class.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/admin/class.tcl,v diff -u -r1.17.6.2 -r1.17.6.3 --- openacs-4/packages/dotlrn/www/admin/class.tcl 29 Oct 2004 02:50:47 -0000 1.17.6.2 +++ openacs-4/packages/dotlrn/www/admin/class.tcl 22 Nov 2004 22:23:08 -0000 1.17.6.3 @@ -25,6 +25,7 @@ class_key:notnull {term_id -1} {orderby "term_name,asc"} + {keyword ""} } -properties { pretty_name:onevalue description:onevalue @@ -73,6 +74,12 @@ set page_query select_all_class_instances_paginator } +if { ![empty_string_p $keyword] } { + set keyword_clause [db_map class_instances_keyword] +} else { + set keyword_clause "" +} + set can_instantiate [dotlrn_class::can_instantiate] set context_bar [list [list classes [parameter::get -localize -parameter classes_pretty_plural]] $pretty_name] @@ -86,7 +93,7 @@ template::list::create \ -name class_instances \ -multirow class_instances \ - -filters { term_id {} class_key {} } \ + -filters { term_id {} class_key {} keyword {} } \ -key class_key \ -page_size 50 \ -page_flush_p t \ @@ -99,10 +106,10 @@ orderby_desc {term_name desc} link_url_eval {[export_vars -base "term" { term_id }]} } - class_name { + pretty_name { label "[_ dotlrn.class_name_header]" - orderby_asc {class_name asc} - orderby_desc {class_name desc} + orderby_asc {pretty_name asc} + orderby_desc {pretty_name desc} link_url_col url } n_members { Index: openacs-4/packages/dotlrn/www/admin/classes-chunk.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/admin/classes-chunk.adp,v diff -u -r1.18.6.3 -r1.18.6.4 --- openacs-4/packages/dotlrn/www/admin/classes-chunk.adp 13 Oct 2004 17:32:59 -0000 1.18.6.3 +++ openacs-4/packages/dotlrn/www/admin/classes-chunk.adp 22 Nov 2004 22:23:08 -0000 1.18.6.4 @@ -1,52 +1,60 @@ <% - # - # Copyright (C) 2001, 2002 MIT - # - # This file is part of dotLRN. - # - # dotLRN is free software; you can redistribute it and/or modify it under the - # terms of the GNU General Public License as published by the Free Software - # Foundation; either version 2 of the License, or (at your option) any later - # version. - # - # dotLRN is distributed in the hope that it will be useful, but WITHOUT ANY - # WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - # FOR A PARTICULAR PURPOSE. See the GNU General Public License for more - # details. - # + # + # Copyright (C) 2001, 2002 MIT + # + # This file is part of dotLRN. + # + # dotLRN is free software; you can redistribute it and/or modify it under the + # terms of the GNU General Public License as published by the Free Software + # Foundation; either version 2 of the License, or (at your option) any later + # version. + # + # dotLRN is distributed in the hope that it will be useful, but WITHOUT ANY + # WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + # FOR A PARTICULAR PURPOSE. See the GNU General Public License for more + # details. + # -%> + %> -<center> + <center> + <table bgcolor="#cccccc" cellpadding="5" width="95%"> + <tr bgcolor="#eeeeee"> + <th align="left" width="50%"> + <formtemplate id="department_form"> + <%= [parameter::get -localize -parameter departments_pretty_name] %>: <formwidget id="department_key"> + </formtemplate> + </th> + </tr> + </table> + <br/> - <table bgcolor="#cccccc" cellpadding="5" width="95%"> - <tr bgcolor="#eeeeee"> - <th align="left" width="50%"> -<formtemplate id="department_form"> - <%= [parameter::get -localize -parameter departments_pretty_name] %>: <formwidget id="department_key"> -</formtemplate> - </th> - </tr> - </table> + <div style="text-align:center;"> + <form action="classes" method="GET"> + Search subjects with : + <input name="keyword" onfocus="if(this.value=='Please type a keyword')this.value='';" onblur="if(this.value=='')this.value='Please type a keyword';" value="Please type a keyword" /> + <input type="hidden" name="department_key" value="@department_key@" /> + <input type="hidden" name="page" value="@page@" /> + <input type="submit" value="Go" /> + </form> + </div> + + <if @classes:rowcount@ gt 0> - <br> + <br /> -<if @classes:rowcount@ gt 0> - <listtemplate name="classes"></listtemplate> -</if> -<else> -</center> -<p align="right"><a href="class-new?department_key=@department_key@&referer=@referer@" class="button">#dotlrn.new_class_1#</a> </p> -<center> -<table> - <tr bgcolor="#eeeeee"> - <td align="left" colspan="4"> - <i>#dotlrn.no_classes#</i> - </td> - </tr> -</table> -</else> + <listtemplate name="classes"></listtemplate> + </if> + <else> + <table> + <tr bgcolor="#eeeeee"> + <td align="left" colspan="4"> + <i>#dotlrn.no_classes#</i> + </td> + </tr> + </table> + </else> -<br> -</center> + <br> + </center> Index: openacs-4/packages/dotlrn/www/admin/classes-chunk.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/admin/classes-chunk.tcl,v diff -u -r1.9.6.1 -r1.9.6.2 --- openacs-4/packages/dotlrn/www/admin/classes-chunk.tcl 30 Sep 2004 17:14:09 -0000 1.9.6.1 +++ openacs-4/packages/dotlrn/www/admin/classes-chunk.tcl 22 Nov 2004 22:23:08 -0000 1.9.6.2 @@ -26,6 +26,7 @@ classes:multirow } + if {![exists_and_not_null department_key]} { set department_key "" } @@ -64,6 +65,11 @@ set page_query select_classes_by_department_paginator } +if { [exists_and_not_null keyword] } { + set keyword_clause [db_map classes_keyword] +} else { + set keyword_clause "" +} set can_create [dotlrn_class::can_create] set can_instantiate [dotlrn_class::can_instantiate] @@ -84,7 +90,7 @@ -multirow classes \ -actions $actions \ -pass_properties { can_instantiate {} } \ - -filters { department_key {} } \ + -filters { department_key {} keyword {} } \ -key class_key \ -page_size 50 \ -page_flush_p t \ @@ -96,10 +102,10 @@ orderby_desc {department_name desc} link_url_eval {[export_vars -base "department" { department_key }]} } - class_name { + pretty_name { label "[_ dotlrn.class_name]" - orderby_asc {class_name asc} - orderby_desc {class_name desc} + orderby_asc {pretty_name asc} + orderby_desc {pretty_name desc} link_url_eval {[export_vars -base "class" { class_key }]} } n_instances { Index: openacs-4/packages/dotlrn/www/admin/classes-chunk.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/admin/classes-chunk.xql,v diff -u -r1.7.6.2 -r1.7.6.3 --- openacs-4/packages/dotlrn/www/admin/classes-chunk.xql 30 Sep 2004 17:14:09 -0000 1.7.6.2 +++ openacs-4/packages/dotlrn/www/admin/classes-chunk.xql 22 Nov 2004 22:23:08 -0000 1.7.6.3 @@ -5,7 +5,6 @@ <fullquery name="select_classes"> <querytext> select dotlrn_classes_full.class_key, - dotlrn_classes_full.pretty_name as class_name, dotlrn_classes_full.pretty_name, dotlrn_classes_full.description, dotlrn_classes_full.department_key, @@ -18,6 +17,7 @@ from dotlrn_classes_full, dotlrn_departments_full where dotlrn_classes_full.department_key = dotlrn_departments_full.department_key + $keyword_clause [template::list::page_where_clause -and -name "classes" -key "dotlrn_classes_full.class_key"] [template::list::orderby_clause -orderby -name "classes"] @@ -27,7 +27,6 @@ <fullquery name="select_classes_paginator"> <querytext> select dotlrn_classes_full.class_key, - dotlrn_classes_full.pretty_name as class_name, dotlrn_classes_full.pretty_name, dotlrn_classes_full.description, dotlrn_classes_full.department_key, @@ -40,6 +39,7 @@ from dotlrn_classes_full, dotlrn_departments_full where dotlrn_classes_full.department_key = dotlrn_departments_full.department_key + $keyword_clause [template::list::orderby_clause -orderby -name "classes"] </querytext> @@ -48,7 +48,6 @@ <fullquery name="select_classes_by_department"> <querytext> select dotlrn_classes_full.class_key, - dotlrn_classes_full.pretty_name as class_name, dotlrn_classes_full.pretty_name, dotlrn_classes_full.description, dotlrn_classes_full.department_key, @@ -61,6 +60,7 @@ from dotlrn_classes_full, dotlrn_departments_full where dotlrn_classes_full.department_key = :department_key + $keyword_clause and dotlrn_classes_full.department_key = dotlrn_departments_full.department_key [template::list::page_where_clause -and -name "classes" -key "dotlrn_classes_full.class_key"] [template::list::orderby_clause -orderby -name "classes"] @@ -71,7 +71,6 @@ <fullquery name="select_classes_by_department_paginator"> <querytext> select dotlrn_classes_full.class_key, - dotlrn_classes_full.pretty_name as class_name, dotlrn_classes_full.pretty_name, dotlrn_classes_full.description, dotlrn_classes_full.department_key, @@ -84,10 +83,18 @@ from dotlrn_classes_full, dotlrn_departments_full where dotlrn_classes_full.department_key = :department_key + $keyword_clause and dotlrn_classes_full.department_key = dotlrn_departments_full.department_key [template::list::orderby_clause -orderby -name "classes"] </querytext> </fullquery> + + <partialquery name="classes_keyword"> + <querytext> + and lower(dotlrn_classes_full.pretty_name) like '%'||lower(:keyword)||'%' + </querytext> + </partialquery> + </queryset> Index: openacs-4/packages/dotlrn/www/admin/classes.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/admin/classes.adp,v diff -u -r1.13.6.2 -r1.13.6.3 --- openacs-4/packages/dotlrn/www/admin/classes.adp 20 Oct 2004 10:35:23 -0000 1.13.6.2 +++ openacs-4/packages/dotlrn/www/admin/classes.adp 22 Nov 2004 22:23:08 -0000 1.13.6.3 @@ -18,11 +18,11 @@ %> -<master src="dotlrn-admin-master"> -<property name="title">@title@</property> -<property name="context_bar">@context_bar@</property> + <master src="dotlrn-admin-master"> + <property name="title">@title@</property> + <property name="context_bar">@context_bar@</property> + + <include src="classes-chunk" page=@page@ keyword=@keyword@ department_key=@department_key@> -<include src="classes-chunk"> - Index: openacs-4/packages/dotlrn/www/admin/classes.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/admin/classes.tcl,v diff -u -r1.14.6.3 -r1.14.6.4 --- openacs-4/packages/dotlrn/www/admin/classes.tcl 21 Oct 2004 21:08:24 -0000 1.14.6.3 +++ openacs-4/packages/dotlrn/www/admin/classes.tcl 22 Nov 2004 22:23:08 -0000 1.14.6.4 @@ -22,8 +22,9 @@ @creation-date 2001-11-04 @version $Id$ } -query { - department_key:optional + {department_key ""} {orderby "department_name,asc"} + {keyword ""} {page ""} } -properties { title:onevalue Index: openacs-4/packages/dotlrn/www/admin/departments.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/admin/departments.adp,v diff -u -r1.19.6.5 -r1.19.6.6 --- openacs-4/packages/dotlrn/www/admin/departments.adp 13 Oct 2004 17:32:59 -0000 1.19.6.5 +++ openacs-4/packages/dotlrn/www/admin/departments.adp 22 Nov 2004 22:23:08 -0000 1.19.6.6 @@ -18,30 +18,37 @@ %> -<master src="dotlrn-admin-master"> -<property name="title">@title@</property> -<property name="context_bar">@context_bar@</property> - -<center> - - <if @departments:rowcount@ gt 0> - <listtemplate name="departments"></listtemplate> + <master src="dotlrn-admin-master"> + <property name="title">@title@</property> + <property name="context_bar">@context_bar@</property> + <center> + <form action="departments" method="GET"> + Search departments with : + <input name="keyword" onfocus="if(this.value=='Please type a keyword')this.value='';" onblur="if(this.value=='')this.value='Please type a keyword';" value="Please type a keyword" /> + <input type="submit" value="Go"> + </form> + </center> + <if @departments:rowcount@ gt 0> + <center> + <listtemplate name="departments"></listtemplate> + </center> </if> <else> - </center> - <p align="right"><a href="department-new?referer=@referer@" class="button">#dotlrn.new_department#</a> </p> - <center> - <table> - <tr bgcolor="#eeeeee"> - <td align="left" colspan="2"> - <em>#dotlrn.no_departments#</em> - </td> - </tr> - </table> + + <p align="right"><a href="department-new?referer=@referer@" class="button">#dotlrn.new_department#</a> </p> + <center> + <table> + <tr bgcolor="#eeeeee"> + <td align="left" colspan="2"> + <em>#dotlrn.no_departments#</em> + </td> + </tr> + </table> + </center> </else> + + <br> -<br> -</center> + - Index: openacs-4/packages/dotlrn/www/admin/departments.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/admin/departments.tcl,v diff -u -r1.9.6.2 -r1.9.6.3 --- openacs-4/packages/dotlrn/www/admin/departments.tcl 30 Sep 2004 17:14:09 -0000 1.9.6.2 +++ openacs-4/packages/dotlrn/www/admin/departments.tcl 22 Nov 2004 22:23:08 -0000 1.9.6.3 @@ -21,6 +21,7 @@ @creation-date 2002-01-20 @version $Id$ } -query { + {keyword ""} {orderby "department_name,asc"} page:optional } -properties { @@ -42,7 +43,14 @@ set actions [list "[_ dotlrn.new_department]" "[export_vars -base "department-new" -url { referer }]"] +if { ![empty_string_p $keyword] } { + set keyword_clause [db_map departments_keyword] +} { + set keyword_clause [db_map departments_without_keyword] +} + template::list::create \ + -filters { keyword {} } \ -name departments \ -multirow departments \ -actions $actions \ @@ -75,6 +83,7 @@ } + db_multirow departments select_departments {} ad_return_template Index: openacs-4/packages/dotlrn/www/admin/departments.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/admin/departments.xql,v diff -u -r1.6.10.3 -r1.6.10.4 --- openacs-4/packages/dotlrn/www/admin/departments.xql 30 Sep 2004 17:14:09 -0000 1.6.10.3 +++ openacs-4/packages/dotlrn/www/admin/departments.xql 22 Nov 2004 22:23:08 -0000 1.6.10.4 @@ -10,7 +10,7 @@ from dotlrn_classes where department_key = dotlrn_departments_full.department_key) as n_classes from dotlrn_departments_full - where 1 = 1 + $keyword_clause [template::list::page_where_clause -and -name "departments" -key "dotlrn_departments_full.department_key"] [template::list::orderby_clause -orderby -name "departments"] </querytext> @@ -24,9 +24,22 @@ from dotlrn_classes where department_key = dotlrn_departments_full.department_key) as n_classes from dotlrn_departments_full + $keyword_clause [template::list::orderby_clause -orderby -name "departments"] </querytext> </fullquery> + <partialquery name="departments_keyword"> + <querytext> + where lower(pretty_name) like '%'||lower(:keyword)||'%' + </querytext> + </partialquery> + + <partialquery name="departments_without_keyword"> + <querytext> + where 1 = 1 + </querytext> + </partialquery> + </queryset> Index: openacs-4/packages/dotlrn/www/admin/term.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/admin/term.adp,v diff -u -r1.22.6.3 -r1.22.6.4 --- openacs-4/packages/dotlrn/www/admin/term.adp 30 Sep 2004 17:14:09 -0000 1.22.6.3 +++ openacs-4/packages/dotlrn/www/admin/term.adp 22 Nov 2004 22:23:08 -0000 1.22.6.4 @@ -1,93 +1,105 @@ <% - # - # Copyright (C) 2001, 2002 MIT - # - # This file is part of dotLRN. - # - # dotLRN is free software; you can redistribute it and/or modify it under the - # terms of the GNU General Public License as published by the Free Software - # Foundation; either version 2 of the License, or (at your option) any later - # version. - # - # dotLRN is distributed in the hope that it will be useful, but WITHOUT ANY - # WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - # FOR A PARTICULAR PURPOSE. See the GNU General Public License for more - # details. - # + # + # Copyright (C) 2001, 2002 MIT + # + # This file is part of dotLRN. + # + # dotLRN is free software; you can redistribute it and/or modify it under the + # terms of the GNU General Public License as published by the Free Software + # Foundation; either version 2 of the License, or (at your option) any later + # version. + # + # dotLRN is distributed in the hope that it will be useful, but WITHOUT ANY + # WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + # FOR A PARTICULAR PURPOSE. See the GNU General Public License for more + # details. + # -%> + %> -<master src="dotlrn-admin-master"> -<property name="title">@title@</property> -<property name="context_bar">@context_bar@</property> + <master src="dotlrn-admin-master"> + <property name="title">@title@</property> + <property name="context_bar">@context_bar@</property> -<if @term_id@ ne -1> -<ul> + <if @term_id@ ne -1> + <ul> - <li> - #dotlrn.Name# - @term_name@ - </li> + <li> + #dotlrn.Name# + @term_name@ + </li> - <li> - #dotlrn.Year# - @term_year@ - </li> + <li> + #dotlrn.Year# + @term_year@ + </li> - <li> - #dotlrn.Start_date# - @start_date@ - </li> + <li> + #dotlrn.Start_date# + @start_date@ + </li> - <li> - #dotlrn.End_date# - @end_date@ - </li> + <li> + #dotlrn.End_date# + @end_date@ + </li> - <br> + <br> - <li> - <a href="term-edit?term_id=@term_id@&referer=@referer@">#dotlrn.Edit#</a> #dotlrn.term_properties# - </li> + <li> + <a href="term-edit?term_id=@term_id@&referer=@referer@">#dotlrn.Edit#</a> #dotlrn.term_properties# + </li> -</ul> + </ul> -<br> -</if> + <br> + </if> -<center> + <center> - <table bgcolor="#cccccc" cellpadding="5" width="95%"> - <tr bgcolor="#eeeeee"> - <th align="left" width="50%"> -<formtemplate id="department_form"> - <%= [parameter::get -localize -parameter departments_pretty_name] %>: <formwidget id="department_key"> -</formtemplate> - </th> - <th align="left" width="50%"> -<formtemplate id="term_form"> - #dotlrn.term#: <formwidget id="term_id"> -</formtemplate> - </th> - </tr> - </table> + <table bgcolor="#cccccc" cellpadding="5" width="95%"> + <tr bgcolor="#eeeeee"> + <th align="left" width="50%"> + <formtemplate id="department_form"> + <%= [parameter::get -localize -parameter departments_pretty_name] %>: <formwidget id="department_key"> + </formtemplate> + </th> + <th align="left" width="50%"> + <formtemplate id="term_form"> + #dotlrn.term#: <formwidget id="term_id"> + </formtemplate> + </th> + </tr> + </table> - <br> + <br> -<if @classes:rowcount@ gt 0> - <listtemplate name="classes"></listtemplate> -</if> -<else> - <table> - <tr bgcolor="#eeeeee"> - <td> - <i>#dotlrn.no_class_instances#</i> - </td> - </tr> - </table> -</else> + <if @classes:rowcount@ gt 0> + + <div style="text-align:center;"> + <form action="term" method="GET"> + Search classes with : + <input name="keyword" onfocus="if(this.value=='Please type a keyword')this.value='';" onblur="if(this.value=='')this.value='Please type a keyword';" value="Please type a keyword" /> + <input type="hidden" name="term_id" value="@term_id@" /> + <input type="hidden" name="department_key" value="@department_key@" /> + <input type="submit" value="Go" /> + </form> + </div> -<br> + <listtemplate name="classes"></listtemplate> -</center> + </if> + <else> + <table> + <tr bgcolor="#eeeeee"> + <td> + <i>#dotlrn.no_class_instances#</i> + </td> + </tr> + </table> + </else> + + <br> + + </center> Index: openacs-4/packages/dotlrn/www/admin/term.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/admin/term.tcl,v diff -u -r1.12.6.3 -r1.12.6.4 --- openacs-4/packages/dotlrn/www/admin/term.tcl 29 Oct 2004 02:50:47 -0000 1.12.6.3 +++ openacs-4/packages/dotlrn/www/admin/term.tcl 22 Nov 2004 22:23:08 -0000 1.12.6.4 @@ -25,6 +25,7 @@ {department_key ""} {orderby "department_name,asc"} page:optional + {keyword ""} } -properties { classes:multirow } @@ -104,11 +105,17 @@ set query "select_all_classes" set paginator_query "select_all_classes_paginator" } + if {![empty_string_p $department_key]} { append query "_by_department" append paginator_query "_by_department" } +if { ![empty_string_p $keyword] } { + set keyword_clause [db_map select_all_instances_keyword] +} else { + set keyword_clause [db_map select_all_instances_without_keyword] +} if {$term_id == -1} { set title "[_ dotlrn.All_Terms]" set context_bar [list [list terms [_ dotlrn.Terms]] "[_ dotlrn.All_Terms]"] @@ -167,7 +174,7 @@ template::list::create \ -name classes \ -multirow classes \ - -filters { department_key {} term_id {} } \ + -filters { department_key {} term_id {} keyword {} } \ -key class_key \ -page_size 50 \ -page_flush_p t \ Index: openacs-4/packages/dotlrn/www/admin/term.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/admin/term.xql,v diff -u -r1.7.10.1 -r1.7.10.2 --- openacs-4/packages/dotlrn/www/admin/term.xql 30 Sep 2004 17:14:09 -0000 1.7.10.1 +++ openacs-4/packages/dotlrn/www/admin/term.xql 22 Nov 2004 22:23:08 -0000 1.7.10.2 @@ -20,7 +20,8 @@ from dotlrn_member_rels_approved where dotlrn_member_rels_approved.community_id = dotlrn_class_instances_full.class_instance_id) as n_members from dotlrn_class_instances_full - where dotlrn_class_instances_full.term_id = :term_id + $keyword_clause + and dotlrn_class_instances_full.term_id = :term_id [template::list::page_where_clause -and -name "classes" -key "dotlrn_class_instances_full.class_instance_id"] [template::list::orderby_clause -orderby -name "classes"] </querytext> @@ -33,7 +34,8 @@ from dotlrn_member_rels_approved where dotlrn_member_rels_approved.community_id = dotlrn_class_instances_full.class_instance_id) as n_members from dotlrn_class_instances_full - where dotlrn_class_instances_full.term_id = :term_id + $keyword_clause + and dotlrn_class_instances_full.term_id = :term_id [template::list::orderby_clause -orderby -name "classes"] </querytext> </fullquery> @@ -45,7 +47,8 @@ from dotlrn_member_rels_approved where dotlrn_member_rels_approved.community_id = dotlrn_class_instances_full.class_instance_id) as n_members from dotlrn_class_instances_full - where dotlrn_class_instances_full.term_id = :term_id + $keyword_clause + and dotlrn_class_instances_full.term_id = :term_id and dotlrn_class_instances_full.department_key = :department_key [template::list::page_where_clause -and -name "classes" -key "dotlrn_class_instances_full.class_instance_id"] [template::list::orderby_clause -orderby -name "classes"] @@ -59,7 +62,8 @@ from dotlrn_member_rels_approved where dotlrn_member_rels_approved.community_id = dotlrn_class_instances_full.class_instance_id) as n_members from dotlrn_class_instances_full - where dotlrn_class_instances_full.term_id = :term_id + $keyword_clause + and dotlrn_class_instances_full.term_id = :term_id and dotlrn_class_instances_full.department_key = :department_key [template::list::orderby_clause -orderby -name "classes"] </querytext> @@ -72,7 +76,7 @@ from dotlrn_member_rels_approved where dotlrn_member_rels_approved.community_id = dotlrn_class_instances_full.class_instance_id) as n_members from dotlrn_class_instances_full - where 1 = 1 + $keyword_clause [template::list::page_where_clause -and -name "classes" -key "dotlrn_class_instances_full.class_instance_id"] [template::list::orderby_clause -orderby -name "classes"] </querytext> @@ -85,6 +89,7 @@ from dotlrn_member_rels_approved where dotlrn_member_rels_approved.community_id = dotlrn_class_instances_full.class_instance_id) as n_members from dotlrn_class_instances_full + $keyword_clause [template::list::orderby_clause -orderby -name "classes"] </querytext> </fullquery> @@ -96,7 +101,8 @@ from dotlrn_member_rels_approved where dotlrn_member_rels_approved.community_id = dotlrn_class_instances_full.class_instance_id) as n_members from dotlrn_class_instances_full - where dotlrn_class_instances_full.department_key = :department_key + $keyword_clause + and dotlrn_class_instances_full.department_key = :department_key [template::list::page_where_clause -and -name "classes" -key "dotlrn_class_instances_full.class_instance_id"] [template::list::orderby_clause -orderby -name "classes"] </querytext> @@ -109,9 +115,21 @@ from dotlrn_member_rels_approved where dotlrn_member_rels_approved.community_id = dotlrn_class_instances_full.class_instance_id) as n_members from dotlrn_class_instances_full - where dotlrn_class_instances_full.department_key = :department_key + $keyword_clause + and dotlrn_class_instances_full.department_key = :department_key [template::list::orderby_clause -orderby -name "classes"] </querytext> </fullquery> + <partialquery name="select_all_instances_keyword"> + <querytext> + where lower(dotlrn_class_instances_full.pretty_name) like '%'||lower(:keyword)||'%' + </querytext> + </partialquery> + + <partialquery name="select_all_instances_without_keyword"> + <querytext> + where 1 = 1 + </querytext> + </partialquery> </queryset> Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/dotlrn/www/admin/toolbar-actions.tcl'. Fisheye: No comparison available. Pass `N' to diff?