rfe: Search Asset returns URLs
This commit is contained in:
parent
99337c3473
commit
1b51697dbd
4 changed files with 60 additions and 33 deletions
|
|
@ -1,5 +1,6 @@
|
||||||
7.5.0
|
7.5.0
|
||||||
- rfe: Default log level to ERROR
|
- rfe: Default log level to ERROR
|
||||||
|
- rfe: Search Asset returns URLs
|
||||||
- Added link to return to inbox from message in inbox message template (Diona Kidd, Knowmad Technologies)
|
- Added link to return to inbox from message in inbox message template (Diona Kidd, Knowmad Technologies)
|
||||||
- fix: Cannot delete private message (Diona Kidd, Knowmad Technologies)
|
- fix: Cannot delete private message (Diona Kidd, Knowmad Technologies)
|
||||||
- fix: Workflow activities don't pick up new default values
|
- fix: Workflow activities don't pick up new default values
|
||||||
|
|
|
||||||
|
|
@ -20,19 +20,19 @@ my $quiet; # this line required
|
||||||
|
|
||||||
my $session = start(); # this line required
|
my $session = start(); # this line required
|
||||||
|
|
||||||
# upgrade functions go here
|
|
||||||
addFriendsNetwork($session);
|
addFriendsNetwork($session);
|
||||||
|
addSearchWithContainers($session);
|
||||||
|
|
||||||
finish($session); # this line required
|
finish($session); # this line required
|
||||||
|
|
||||||
|
|
||||||
##-------------------------------------------------
|
#-------------------------------------------------
|
||||||
#sub exampleFunction {
|
sub addSearchWithContainers {
|
||||||
# my $session = shift;
|
my $session = shift;
|
||||||
# print "\tWe're doing some stuff here that you should know about..." unless $quiet;
|
print "\tMaking search capable of displaying containers in search results instead of individaul assets." unless $quiet;
|
||||||
# # and here's our code
|
$session->db->write("alter table Search add column useContainers int not null default 0");
|
||||||
# print "DONE!\n" unless $quiet;
|
print "DONE!\n" unless $quiet;
|
||||||
#}
|
}
|
||||||
|
|
||||||
#----------------------------------------------------------------------------
|
#----------------------------------------------------------------------------
|
||||||
sub addFriendsNetwork {
|
sub addFriendsNetwork {
|
||||||
|
|
|
||||||
|
|
@ -72,30 +72,37 @@ sub definition {
|
||||||
my %properties;
|
my %properties;
|
||||||
tie %properties, 'Tie::IxHash';
|
tie %properties, 'Tie::IxHash';
|
||||||
%properties = (
|
%properties = (
|
||||||
templateId =>{
|
templateId => {
|
||||||
fieldType=>"template",
|
fieldType => "template",
|
||||||
defaultValue=>'PBtmpl0000000000000200',
|
defaultValue => 'PBtmpl0000000000000200',
|
||||||
tab=>"display",
|
tab => "display",
|
||||||
namespace=>"Search",
|
namespace => "Search",
|
||||||
hoverHelp=>$i18n->get('search template description'),
|
hoverHelp => $i18n->get('search template description'),
|
||||||
label=>$i18n->get('search template')
|
label => $i18n->get('search template')
|
||||||
},
|
},
|
||||||
searchRoot => {
|
searchRoot => {
|
||||||
fieldType=>"asset",
|
fieldType => "asset",
|
||||||
defaultValue=>$session->setting->get("defaultPage"),
|
defaultValue => $session->setting->get("defaultPage"),
|
||||||
tab=>"properties",
|
tab => "properties",
|
||||||
hoverHelp=>$i18n->get("search root description"),
|
hoverHelp => $i18n->get("search root description"),
|
||||||
label=>$i18n->get('search root')
|
label => $i18n->get('search root')
|
||||||
},
|
},
|
||||||
classLimiter => {
|
classLimiter => {
|
||||||
fieldType => "checkList",
|
fieldType => "checkList",
|
||||||
defaultValue => undef,
|
defaultValue => undef,
|
||||||
vertical=>1,
|
vertical => 1,
|
||||||
tab=>"properties",
|
tab => "properties",
|
||||||
hoverHelp=>$i18n->get("class limiter description"),
|
hoverHelp => $i18n->get("class limiter description"),
|
||||||
label=>$i18n->get("class limiter"),
|
label => $i18n->get("class limiter"),
|
||||||
options=>$session->db->buildHashRef("select distinct(className) from asset")
|
options => $session->db->buildHashRef("select distinct(className) from asset")
|
||||||
}
|
},
|
||||||
|
useContainers => {
|
||||||
|
tab => "properties",
|
||||||
|
hoverHelp => "useContainers help",
|
||||||
|
label => "useContainers",
|
||||||
|
fieldType => "yesNo",
|
||||||
|
defaultValue => 0,
|
||||||
|
},
|
||||||
);
|
);
|
||||||
push(@{$definition}, {
|
push(@{$definition}, {
|
||||||
assetName=>$i18n->get('assetName'),
|
assetName=>$i18n->get('assetName'),
|
||||||
|
|
@ -156,11 +163,18 @@ sub view {
|
||||||
my $rs = $search->getResultSet;
|
my $rs = $search->getResultSet;
|
||||||
while (my $data = $rs->hashRef) {
|
while (my $data = $rs->hashRef) {
|
||||||
if ($self->session->user->userId eq $data->{ownerUserId} || $self->session->user->isInGroup($data->{groupIdView}) || $self->session->user->isInGroup($data->{groupIdEdit})) {
|
if ($self->session->user->userId eq $data->{ownerUserId} || $self->session->user->isInGroup($data->{groupIdView}) || $self->session->user->isInGroup($data->{groupIdEdit})) {
|
||||||
push(@results, {
|
my $url = $data->{url};
|
||||||
url=>$data->{url},
|
if ($self->get("useContainers")) {
|
||||||
title=>$data->{title},
|
my $asset = WebGUI::Asset->new($self->session, $data->{assetId}, $data->{className});
|
||||||
synopsis=>$data->{synopsis},
|
if (defined $asset) {
|
||||||
assetId=>$data->{assetId},
|
$url = $asset->getContainer->get("url");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
push(@results, {
|
||||||
|
url => $url,
|
||||||
|
title => $data->{title},
|
||||||
|
synopsis => $data->{synopsis},
|
||||||
|
assetId => $data->{assetId},
|
||||||
});
|
});
|
||||||
$var{results_found} = 1;
|
$var{results_found} = 1;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -2,6 +2,18 @@ package WebGUI::i18n::English::Asset_Search; ##Be sure to change the package na
|
||||||
|
|
||||||
our $I18N = { ##hashref of hashes
|
our $I18N = { ##hashref of hashes
|
||||||
|
|
||||||
|
'useContainers' => {
|
||||||
|
message => q|Use container URLs in results?|,
|
||||||
|
lastUpdated => 0,
|
||||||
|
context => q|an asset property|
|
||||||
|
},
|
||||||
|
|
||||||
|
'useContainers help' => {
|
||||||
|
message => q|Set this to "Yes" if you'd like the search results to return full pages instead of individual assets.|,
|
||||||
|
lastUpdated => 0,
|
||||||
|
context => q|an asset property help|
|
||||||
|
},
|
||||||
|
|
||||||
'search' => {
|
'search' => {
|
||||||
message => q|search|,
|
message => q|search|,
|
||||||
lastUpdated => 0,
|
lastUpdated => 0,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue