Index: openacs-4/packages/bug-tracker/tcl/bug-tracker-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/bug-tracker/tcl/bug-tracker-procs.tcl,v diff -u -r1.8 -r1.9 --- openacs-4/packages/bug-tracker/tcl/bug-tracker-procs.tcl 29 Aug 2002 15:15:11 -0000 1.8 +++ openacs-4/packages/bug-tracker/tcl/bug-tracker-procs.tcl 8 Sep 2002 18:02:16 -0000 1.9 @@ -509,46 +509,8 @@ return $users_list } - ##### - # - # Truncate - # - ##### - ad_proc string_truncate { - {-len} - {-format html} - string - } { - Truncates a string to len characters (defaults to the - parameter TruncateDescriptionLength), adding an ellipsis (...) if the - string was truncated. If format is html (default), any open - HTML tags are closed. Otherwise, it's converted to text using - ad_html_to_text. - @param len The lenght to truncate to. Defaults to parameter TruncateDescriptionLength. - @param format html or text. - @param string The string to truncate. - @return The truncated string, with HTML tags cloosed or - converted to text, depending on format. - } { - if { ![info exists len] } { - set len [ad_parameter "TruncateDescriptionLength" -default 200] - } - - if { [string length $string] > $len } { - set string "[string range $string 0 $len]..." - } - - if { [string equal $format "html"] } { - set string [util_close_html_tags $string] - } else { - set string [ad_html_to_text -- $string] - } - return $string - } - - ##### # Index: openacs-4/packages/bug-tracker/www/index.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/bug-tracker/www/index.tcl,v diff -u -r1.5 -r1.6 --- openacs-4/packages/bug-tracker/www/index.tcl 29 Aug 2002 15:15:12 -0000 1.5 +++ openacs-4/packages/bug-tracker/www/index.tcl 8 Sep 2002 18:02:17 -0000 1.6 @@ -113,6 +113,8 @@ } } +set truncate_len [ad_parameter "TruncateDescriptionLength" -default 200] + db_multirow -extend { description_short submitter_url status_pretty resolution_pretty bug_type_pretty original_esimate_pretty latest_estimate_pretty elapsed_time_pretty assignee_url bug_url } bugs bugs " select b.bug_id, b.bug_number, @@ -170,7 +172,7 @@ [ad_decode $where_clauses "" "" "and [join $where_clauses " and "]"] order by $order_by_clause " { - set description_short [bug_tracker::string_truncate [bug_tracker::bug_convert_comment_to_text -comment $description -format $desc_format]] + set description_short [string_truncate -len $truncate_len [bug_tracker::bug_convert_comment_to_text -comment $description -format $desc_format]] set submitter_url [acs_community_member_url -user_id $submitter_user_id] set status_pretty [bug_tracker::status_pretty $status] set resolution_pretty [bug_tracker::resolution_pretty $resolution]