[Cpan-forum-commit] rev 201 - in trunk: . lib/CPAN templates
svn at pti.co.il
svn at pti.co.il
Wed Aug 30 09:30:00 IDT 2006
Author: gabor
Date: 2006-08-30 09:30:00 +0300 (Wed, 30 Aug 2006)
New Revision: 201
Modified:
trunk/
trunk/lib/CPAN/Forum.pm
trunk/templates/search_form.tmpl
Log:
add search based on PAUSEID
Property changes on: trunk
___________________________________________________________________
Name: svk:merge
- 8c4c90e1-83eb-0310-96eb-e7cb62807872:/local/cpan-forum:11065
+ 8c4c90e1-83eb-0310-96eb-e7cb62807872:/local/cpan-forum:11071
Modified: trunk/lib/CPAN/Forum.pm
===================================================================
--- trunk/lib/CPAN/Forum.pm 2006-08-29 15:43:43 UTC (rev 200)
+++ trunk/lib/CPAN/Forum.pm 2006-08-30 06:30:00 UTC (rev 201)
@@ -1545,11 +1545,21 @@
$self->session->param(search_name => $name);
if ($what and $name) {
- if ($what eq "module") {
+ if ($what eq "module" or $what eq "pauseid") {
+ my $it;
+ if ($what eq "module") {
+ $it = CPAN::Forum::Groups->search_like(name => '%' . $name . '%');
+ } else {
+ my ($author) = CPAN::Forum::Authors->search(pauseid => uc $name);
+ if ($author) {
+ $it = CPAN::Forum::Groups->search(pauseid => $author->id);
+ }
+ }
my @things;
- my $it = CPAN::Forum::Groups->search_like(name => '%' . $name . '%');
- while (my $group = $it->next) {
- push @things, {name => $group->name};
+ if ($it) {
+ while (my $group = $it->next) {
+ push @things, {name => $group->name};
+ }
}
$any_result = 1 if @things;
$t->param(groups => \@things);
Modified: trunk/templates/search_form.tmpl
===================================================================
--- trunk/templates/search_form.tmpl 2006-08-29 15:43:43 UTC (rev 200)
+++ trunk/templates/search_form.tmpl 2006-08-30 06:30:00 UTC (rev 201)
@@ -3,6 +3,7 @@
<input type="hidden" name="rm" value="search" />
<select name="what">
<option value="module" <TMPL_IF module> SELECTED</TMPL_IF>>Modules by name</option>
+<option value="pauseid" <TMPL_IF pauseid> SELECTED</TMPL_IF>>Modules by PAUSEID</option>
<option value="user" <TMPL_IF user> SELECTED</TMPL_IF>>Users by name</option>
<option value="subject" <TMPL_IF subject>SELECTED</TMPL_IF>>Posts by text in subject</option>
<option value="text" <TMPL_IF text> SELECTED</TMPL_IF>>Posts by text in body</option>
More information about the Cpan-forum-commit
mailing list