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 {
|
||||||
|
|
|
||||||
|
|
@ -95,7 +95,14 @@ sub definition {
|
||||||
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,8 +163,15 @@ 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})) {
|
||||||
|
my $url = $data->{url};
|
||||||
|
if ($self->get("useContainers")) {
|
||||||
|
my $asset = WebGUI::Asset->new($self->session, $data->{assetId}, $data->{className});
|
||||||
|
if (defined $asset) {
|
||||||
|
$url = $asset->getContainer->get("url");
|
||||||
|
}
|
||||||
|
}
|
||||||
push(@results, {
|
push(@results, {
|
||||||
url=>$data->{url},
|
url => $url,
|
||||||
title => $data->{title},
|
title => $data->{title},
|
||||||
synopsis => $data->{synopsis},
|
synopsis => $data->{synopsis},
|
||||||
assetId => $data->{assetId},
|
assetId => $data->{assetId},
|
||||||
|
|
|
||||||
|
|
@ -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