Search - Paginate results (#713)
This commit is contained in:
parent
c35ef01b49
commit
20460192a6
4 changed files with 39 additions and 8 deletions
|
|
@ -7,7 +7,8 @@
|
||||||
- Made Classname from control a subclass of ReadOnly.
|
- Made Classname from control a subclass of ReadOnly.
|
||||||
- Added query keys to WebGUI::Crud.
|
- Added query keys to WebGUI::Crud.
|
||||||
- EMS Saved Address (#8864)
|
- EMS Saved Address (#8864)
|
||||||
- Inclusion of UsersOnline macro into the core (#766)
|
- rfe: Inclusion of UsersOnline macro into the core (#766)
|
||||||
|
- rfe: Search - Paginate results (#713)
|
||||||
- WebGUI::Crud can now automatically resolve differences between its
|
- WebGUI::Crud can now automatically resolve differences between its
|
||||||
definition and the table schema.
|
definition and the table schema.
|
||||||
- Fixed a limit bug in the asset discovery service.
|
- Fixed a limit bug in the asset discovery service.
|
||||||
|
|
|
||||||
|
|
@ -32,14 +32,23 @@ my $session = start(); # this line required
|
||||||
repairManageWorkflows($session);
|
repairManageWorkflows($session);
|
||||||
addPreTextToThingyFields($session);
|
addPreTextToThingyFields($session);
|
||||||
updateAddressBook($session);
|
updateAddressBook($session);
|
||||||
|
changeDefaultPaginationInSearch($session);
|
||||||
addUsersOnlineMacro($session);
|
addUsersOnlineMacro($session);
|
||||||
finish($session); # this line required
|
finish($session); # this line required
|
||||||
|
|
||||||
|
|
||||||
|
#----------------------------------------------------------------------------
|
||||||
|
sub changeDefaultPaginationInSearch {
|
||||||
|
my $session = shift;
|
||||||
|
print "\tAllow content managers to change the default pagination in the search asset... " unless $quiet;
|
||||||
|
$session->db->write("ALTER TABLE `search` ADD COLUMN `paginateAfter` INTEGER NOT NULL DEFAULT 25");
|
||||||
|
print "DONE!\n" unless $quiet;
|
||||||
|
}
|
||||||
|
|
||||||
#----------------------------------------------------------------------------
|
#----------------------------------------------------------------------------
|
||||||
sub addUsersOnlineMacro {
|
sub addUsersOnlineMacro {
|
||||||
my $session = shift;
|
my $session = shift;
|
||||||
print "\tMaking the UsersOnline macro available." unless $quiet;
|
print "\tMaking the UsersOnline macro available... " unless $quiet;
|
||||||
$session->config->addToHash("macros","UsersOnline","UsersOnline");
|
$session->config->addToHash("macros","UsersOnline","UsersOnline");
|
||||||
print "DONE!\n" unless $quiet;
|
print "DONE!\n" unless $quiet;
|
||||||
}
|
}
|
||||||
|
|
@ -47,7 +56,7 @@ sub addUsersOnlineMacro {
|
||||||
#----------------------------------------------------------------------------
|
#----------------------------------------------------------------------------
|
||||||
sub updateAddressBook {
|
sub updateAddressBook {
|
||||||
my $session = shift;
|
my $session = shift;
|
||||||
print "\tAdding organization and email to address book." unless $quiet;
|
print "\tAdding organization and email to address book... " unless $quiet;
|
||||||
my $db = $session->db;
|
my $db = $session->db;
|
||||||
$db->write("alter table address add column organization char(255)");
|
$db->write("alter table address add column organization char(255)");
|
||||||
$db->write("alter table address add column email char(255)");
|
$db->write("alter table address add column email char(255)");
|
||||||
|
|
|
||||||
|
|
@ -104,7 +104,15 @@ sub definition {
|
||||||
fieldType => "yesNo",
|
fieldType => "yesNo",
|
||||||
defaultValue => 0,
|
defaultValue => 0,
|
||||||
},
|
},
|
||||||
);
|
paginateAfter => {
|
||||||
|
hoverHelp => $i18n->get("paginate after help"),
|
||||||
|
label => $i18n->get("paginate after"),
|
||||||
|
tab => "display",
|
||||||
|
fieldType => "integer",
|
||||||
|
defaultValue => 25,
|
||||||
|
},
|
||||||
|
);
|
||||||
|
|
||||||
push(@{$definition}, {
|
push(@{$definition}, {
|
||||||
assetName=>$i18n->get('assetName'),
|
assetName=>$i18n->get('assetName'),
|
||||||
icon=>'search.gif',
|
icon=>'search.gif',
|
||||||
|
|
@ -152,9 +160,9 @@ sub view {
|
||||||
my %var;
|
my %var;
|
||||||
|
|
||||||
$var{'form_header' } = WebGUI::Form::formHeader($session, {
|
$var{'form_header' } = WebGUI::Form::formHeader($session, {
|
||||||
action=>$self->getUrl("doit=1")
|
action=>$self->getUrl
|
||||||
});
|
})
|
||||||
#.WebGUI::Form::hidden($self->session,{name=>"doit", value=>"1"});
|
.WebGUI::Form::hidden($self->session,{name=>"doit", value=>"1"});
|
||||||
$var{'form_footer' } = WebGUI::Form::formFooter($session);
|
$var{'form_footer' } = WebGUI::Form::formFooter($session);
|
||||||
$var{'form_submit' } = WebGUI::Form::submit($session, {
|
$var{'form_submit' } = WebGUI::Form::submit($session, {
|
||||||
value=>$i18n->get("search")
|
value=>$i18n->get("search")
|
||||||
|
|
@ -187,7 +195,8 @@ sub view {
|
||||||
|
|
||||||
#Set up the paginator
|
#Set up the paginator
|
||||||
my $p = $search->getPaginatorResultSet (
|
my $p = $search->getPaginatorResultSet (
|
||||||
$self->getUrl('doit=1;keywords='.$session->url->escape($keywords))
|
$self->getUrl('doit=1;keywords='.$session->url->escape($keywords)),
|
||||||
|
$self->get("paginateAfter"),
|
||||||
);
|
);
|
||||||
|
|
||||||
my @results = ();
|
my @results = ();
|
||||||
|
|
|
||||||
|
|
@ -3,6 +3,18 @@ use strict;
|
||||||
|
|
||||||
our $I18N = { ##hashref of hashes
|
our $I18N = { ##hashref of hashes
|
||||||
|
|
||||||
|
'paginate after' => {
|
||||||
|
message => q|Paginate After|,
|
||||||
|
lastUpdated => 0,
|
||||||
|
context => q|an asset property|
|
||||||
|
},
|
||||||
|
|
||||||
|
'paginate after help' => {
|
||||||
|
message => q|The number of items to be displayed before breaking further items into additional pages.|,
|
||||||
|
lastUpdated => 0,
|
||||||
|
context => q|an asset property help|
|
||||||
|
},
|
||||||
|
|
||||||
'useContainers' => {
|
'useContainers' => {
|
||||||
message => q|Use container URLs in results?|,
|
message => q|Use container URLs in results?|,
|
||||||
lastUpdated => 0,
|
lastUpdated => 0,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue