updated thread templates to remove approve/deny links and add archive/unarchive links
fixed unarchive bug changed post rating system to thumbs up/down
This commit is contained in:
parent
f503b4328e
commit
404749e32b
13 changed files with 68 additions and 64 deletions
|
|
@ -30,6 +30,8 @@
|
|||
- Added archive/unarchive options to CS threads.
|
||||
- Added a mechanism to send emails to a CS which will accept them as posts.
|
||||
- Increased the performance of CS Thread viewing by 500%.
|
||||
- Changed the CS post rating mechinism to thumbs up/down to be less
|
||||
confusing.
|
||||
- Added install/uninstall functions to the asset and wobject skeletons to
|
||||
make custom assets easier to distribute.
|
||||
- Added a mechanism for importing and exporting packages. This is useful for
|
||||
|
|
|
|||
|
|
@ -19,11 +19,11 @@
|
|||
<b><tmpl_var views.label>:</b> <tmpl_var views><br />
|
||||
<b><tmpl_var rating.label>:</b> <tmpl_var rating>
|
||||
<tmpl_unless hasRated>
|
||||
<tmpl_var rate.label> [ <a href="<tmpl_var rate.url.1>">1</a>, <a href="<tmpl_var rate.url.2>">2</a>, <a href="<tmpl_var rate.url.3>">3</a>, <a href="<tmpl_var rate.url.4>">4</a>, <a href="<tmpl_var rate.url.5>">5</a> ]
|
||||
<tmpl_var rate.label> [ <p style="display:inline;vertical-align:middle;"><a href="<tmpl_var rate.url.thumbsUp>"><img src="<tmpl_var thumbsUp.icon.url>" alt="+" style="border: 0px;vertical-align:middle;" /></a></p> | <p style="display:inline;vertical-align:middle;"><a href="<tmpl_var rate.url.thumbsDown>"><img src="<tmpl_var thumbsDown.icon.url>" alt="-" style="border: 0px;vertical-align:middle;" /></a></p> ]
|
||||
</tmpl_unless>
|
||||
<br />
|
||||
<tmpl_if user.isModerator>
|
||||
<b><tmpl_var status.label>:</b> <tmpl_var status> [ <a href="<tmpl_var approve.url>"><tmpl_var approve.label></a> | <a href="<tmpl_var deny.url>"><tmpl_var deny.label></a> ]<br />
|
||||
<b><tmpl_var status.label>:</b> <tmpl_var status> [ <tmpl_if isArchived><a href="<tmpl_var unarchive.url>"><tmpl_var unarchive.label></a> <tmpl_else> <a href="<tmpl_var archive.url>"><tmpl_var archive.label></a></tmpl_if> ]<br />
|
||||
<tmpl_else>
|
||||
<tmpl_if user.isPoster>
|
||||
<b><tmpl_var status.label>:</b> <tmpl_var status><br />
|
||||
|
|
@ -117,16 +117,12 @@
|
|||
<b><tmpl_var views.label>:</b> <tmpl_var views><br />
|
||||
<b><tmpl_var rating.label>:</b> <tmpl_var rating>
|
||||
<tmpl_unless hasRated>
|
||||
<tmpl_var rate.label> [ <a href="<tmpl_var rate.url.1>">1</a>, <a href="<tmpl_var rate.url.2>">2</a>, <a href="<tmpl_var rate.url.3>">3</a>, <a href="<tmpl_var rate.url.4>">4</a>, <a href="<tmpl_var rate.url.5>">5</a> ]
|
||||
<tmpl_var rate.label> [ <p style="display:inline;vertical-align:middle;"><a href="<tmpl_var rate.url.thumbsUp>"><img src="<tmpl_var thumbsUp.icon.url>" alt="+" style="border: 0px;vertical-align:middle;" /></a></p> | <p style="display:inline;vertical-align:middle;"><a href="<tmpl_var rate.url.thumbsDown>"><img src="<tmpl_var thumbsDown.icon.url>" alt="-" style="border: 0px;vertical-align:middle;" /></a></p> ]
|
||||
</tmpl_unless>
|
||||
<br />
|
||||
<tmpl_if user.isModerator>
|
||||
<b><tmpl_var status.label>:</b> <tmpl_var status> [ <a href="<tmpl_var approve.url>"><tmpl_var approve.label></a> | <a href="<tmpl_var deny.url>"><tmpl_var deny.label></a> ]<br />
|
||||
<tmpl_else>
|
||||
<tmpl_if user.isPoster>
|
||||
<b><tmpl_var status.label>:</b> <tmpl_var status><br />
|
||||
</tmpl_if>
|
||||
</tmpl_if>
|
||||
</div>
|
||||
</div>
|
||||
<div class="postMessage">
|
||||
|
|
@ -180,16 +176,12 @@
|
|||
<b><tmpl_var views.label>:</b> <tmpl_var views><br />
|
||||
<b><tmpl_var rating.label>:</b> <tmpl_var rating>
|
||||
<tmpl_unless hasRated>
|
||||
<tmpl_var rate.label> [ <a href="<tmpl_var rate.url.1>">1</a>, <a href="<tmpl_var rate.url.2>">2</a>, <a href="<tmpl_var rate.url.3>">3</a>, <a href="<tmpl_var rate.url.4>">4</a>, <a href="<tmpl_var rate.url.5>">5</a> ]
|
||||
<tmpl_var rate.label> [ <p style="display:inline;vertical-align:middle;"><a href="<tmpl_var rate.url.thumbsUp>"><img src="<tmpl_var thumbsUp.icon.url>" alt="+" style="border: 0px;vertical-align:middle;" /></a></p> | <p style="display:inline;vertical-align:middle;"><a href="<tmpl_var rate.url.thumbsDown>"><img src="<tmpl_var thumbsDown.icon.url>" alt="-" style="border: 0px;vertical-align:middle;" /></a></p> ]
|
||||
</tmpl_unless>
|
||||
<br />
|
||||
<tmpl_if user.isModerator>
|
||||
<b><tmpl_var status.label>:</b> <tmpl_var status> [ <a href="<tmpl_var approve.url>"><tmpl_var approve.label></a> | <a href="<tmpl_var deny.url>"><tmpl_var deny.label></a> ]<br />
|
||||
<tmpl_else>
|
||||
<tmpl_if user.isPoster>
|
||||
<b><tmpl_var status.label>:</b> <tmpl_var status><br />
|
||||
</tmpl_if>
|
||||
</tmpl_if>
|
||||
</div>
|
||||
</div>
|
||||
<div class="postMessage">
|
||||
|
|
@ -360,4 +352,4 @@
|
|||
{
|
||||
height:auto;
|
||||
min-height:100px;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -41,11 +41,11 @@
|
|||
<b><tmpl_var views.label>:</b> <tmpl_var views><br />
|
||||
<b><tmpl_var rating.label>:</b> <tmpl_var rating>
|
||||
<tmpl_unless hasRated>
|
||||
<tmpl_var rate.label> [ <a href="<tmpl_var rate.url.1>">1</a>, <a href="<tmpl_var rate.url.2>">2</a>, <a href="<tmpl_var rate.url.3>">3</a>, <a href="<tmpl_var rate.url.4>">4</a>, <a href="<tmpl_var rate.url.5>">5</a> ]
|
||||
<tmpl_var rate.label> [ <p style="display:inline;vertical-align:middle;"><a href="<tmpl_var rate.url.thumbsUp>"><img src="<tmpl_var thumbsUp.icon.url>" alt="+" style="border: 0px;vertical-align:middle;" /></a></p> | <p style="display:inline;vertical-align:middle;"><a href="<tmpl_var rate.url.thumbsDown>"><img src="<tmpl_var thumbsDown.icon.url>" alt="-" style="border: 0px;vertical-align:middle;" /></a></p> ]
|
||||
</tmpl_unless>
|
||||
<br />
|
||||
<tmpl_if user.isModerator>
|
||||
<b><tmpl_var status.label>:</b> <tmpl_var status> [ <a href="<tmpl_var approve.url>"><tmpl_var approve.label></a> | <a href="<tmpl_var deny.url>"><tmpl_var deny.label></a> ]<br />
|
||||
<b><tmpl_var status.label>:</b> <tmpl_var status> [ <tmpl_if isArchived><a href="<tmpl_var unarchive.url>"><tmpl_var unarchive.label></a> <tmpl_else> <a href="<tmpl_var archive.url>"><tmpl_var archive.label></a></tmpl_if> ]<br />
|
||||
<tmpl_else>
|
||||
<tmpl_if user.isPoster>
|
||||
<b><tmpl_var status.label>:</b> <tmpl_var status><br />
|
||||
|
|
@ -101,16 +101,12 @@
|
|||
<b><tmpl_var views.label>:</b> <tmpl_var views><br />
|
||||
<b><tmpl_var rating.label>:</b> <tmpl_var rating>
|
||||
<tmpl_unless hasRated>
|
||||
<tmpl_var rate.label> [ <a href="<tmpl_var rate.url.1>">1</a>, <a href="<tmpl_var rate.url.2>">2</a>, <a href="<tmpl_var rate.url.3>">3</a>, <a href="<tmpl_var rate.url.4>">4</a>, <a href="<tmpl_var rate.url.5>">5</a> ]
|
||||
<tmpl_var rate.label> [ <p style="display:inline;vertical-align:middle;"><a href="<tmpl_var rate.url.thumbsUp>"><img src="<tmpl_var thumbsUp.icon.url>" alt="+" style="border: 0px;vertical-align:middle;" /></a></p> | <p style="display:inline;vertical-align:middle;"><a href="<tmpl_var rate.url.thumbsDown>"><img src="<tmpl_var thumbsDown.icon.url>" alt="-" style="border: 0px;vertical-align:middle;" /></a></p> ]
|
||||
</tmpl_unless>
|
||||
<br />
|
||||
<tmpl_if user.isModerator>
|
||||
<b><tmpl_var status.label>:</b> <tmpl_var status> [ <a href="<tmpl_var approve.url>"><tmpl_var approve.label></a> | <a href="<tmpl_var deny.url>"><tmpl_var deny.label></a> ]<br />
|
||||
<tmpl_else>
|
||||
<tmpl_if user.isPoster>
|
||||
<b><tmpl_var status.label>:</b> <tmpl_var status><br />
|
||||
</tmpl_if>
|
||||
</tmpl_if>
|
||||
</div>
|
||||
</div>
|
||||
<div class="postMessage">
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@
|
|||
|
||||
<tmpl_if user.isModerator>
|
||||
<div style="float: right; font-size: 11px; border: 1px solid #cccccc; padding: 2px; margin: 2px;">
|
||||
<b><tmpl_var status.label>:</b> <tmpl_var status> [ <a href="<tmpl_var approve.url>"><tmpl_var approve.label></a> | <a href="<tmpl_var deny.url>"><tmpl_var deny.label></a> ]<br />
|
||||
<b><tmpl_var status.label>:</b> <tmpl_var status> [ <tmpl_if isArchived><a href="<tmpl_var unarchive.url>"><tmpl_var unarchive.label></a> <tmpl_else> <a href="<tmpl_var archive.url>"><tmpl_var archive.label></a></tmpl_if> ]<br />
|
||||
</div>
|
||||
</tmpl_if>
|
||||
|
||||
|
|
@ -105,16 +105,12 @@
|
|||
<b><tmpl_var views.label>:</b> <tmpl_var views><br />
|
||||
<b><tmpl_var rating.label>:</b> <tmpl_var rating>
|
||||
<tmpl_unless hasRated>
|
||||
<tmpl_var rate.label> [ <a href="<tmpl_var rate.url.1>">1</a>, <a href="<tmpl_var rate.url.2>">2</a>, <a href="<tmpl_var rate.url.3>">3</a>, <a href="<tmpl_var rate.url.4>">4</a>, <a href="<tmpl_var rate.url.5>">5</a> ]
|
||||
<tmpl_var rate.label> [ <p style="display:inline;vertical-align:middle;"><a href="<tmpl_var rate.url.thumbsUp>"><img src="<tmpl_var thumbsUp.icon.url>" alt="+" style="border: 0px;vertical-align:middle;" /></a></p> | <p style="display:inline;vertical-align:middle;"><a href="<tmpl_var rate.url.thumbsDown>"><img src="<tmpl_var thumbsDown.icon.url>" alt="-" style="border: 0px;vertical-align:middle;" /></a></p> ]
|
||||
</tmpl_unless>
|
||||
<br />
|
||||
<tmpl_if user.isModerator>
|
||||
<b><tmpl_var status.label>:</b> <tmpl_var status> [ <a href="<tmpl_var approve.url>"><tmpl_var approve.label></a> | <a href="<tmpl_var deny.url>"><tmpl_var deny.label></a> ]<br />
|
||||
<tmpl_else>
|
||||
<tmpl_if user.isPoster>
|
||||
<b><tmpl_var status.label>:</b> <tmpl_var status><br />
|
||||
</tmpl_if>
|
||||
</tmpl_if>
|
||||
</div>
|
||||
</div>
|
||||
<div class="postMessage">
|
||||
|
|
@ -168,16 +164,12 @@
|
|||
<b><tmpl_var views.label>:</b> <tmpl_var views><br />
|
||||
<b><tmpl_var rating.label>:</b> <tmpl_var rating>
|
||||
<tmpl_unless hasRated>
|
||||
<tmpl_var rate.label> [ <a href="<tmpl_var rate.url.1>">1</a>, <a href="<tmpl_var rate.url.2>">2</a>, <a href="<tmpl_var rate.url.3>">3</a>, <a href="<tmpl_var rate.url.4>">4</a>, <a href="<tmpl_var rate.url.5>">5</a> ]
|
||||
<tmpl_var rate.label> [ <p style="display:inline;vertical-align:middle;"><a href="<tmpl_var rate.url.thumbsUp>"><img src="<tmpl_var thumbsUp.icon.url>" alt="+" style="border: 0px;vertical-align:middle;" /></a></p> | <p style="display:inline;vertical-align:middle;"><a href="<tmpl_var rate.url.thumbsDown>"><img src="<tmpl_var thumbsDown.icon.url>" alt="-" style="border: 0px;vertical-align:middle;" /></a></p> ]
|
||||
</tmpl_unless>
|
||||
<br />
|
||||
<tmpl_if user.isModerator>
|
||||
<b><tmpl_var status.label>:</b> <tmpl_var status> [ <a href="<tmpl_var approve.url>"><tmpl_var approve.label></a> | <a href="<tmpl_var deny.url>"><tmpl_var deny.label></a> ]<br />
|
||||
<tmpl_else>
|
||||
<tmpl_if user.isPoster>
|
||||
<b><tmpl_var status.label>:</b> <tmpl_var status><br />
|
||||
</tmpl_if>
|
||||
</tmpl_if>
|
||||
</div>
|
||||
</div>
|
||||
<div class="postMessage">
|
||||
|
|
@ -328,4 +320,4 @@
|
|||
border:solid #DADADA 1px;
|
||||
font-family:arial;
|
||||
font-size:9pt;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@
|
|||
|
||||
<tmpl_if user.isModerator>
|
||||
<div style="float: right; font-size: 11px; border: 1px solid #cccccc; padding: 2px; margin: 2px;">
|
||||
<b><tmpl_var status.label>:</b> <tmpl_var status> [ <a href="<tmpl_var approve.url>"><tmpl_var approve.label></a> | <a href="<tmpl_var deny.url>"><tmpl_var deny.label></a> ]<br />
|
||||
<b><tmpl_var status.label>:</b> <tmpl_var status> [ <tmpl_if isArchived><a href="<tmpl_var unarchive.url>"><tmpl_var unarchive.label></a> <tmpl_else> <a href="<tmpl_var archive.url>"><tmpl_var archive.label></a></tmpl_if> ]<br />
|
||||
</div>
|
||||
</tmpl_if>
|
||||
|
||||
|
|
@ -88,16 +88,12 @@
|
|||
<b><tmpl_var views.label>:</b> <tmpl_var views><br />
|
||||
<b><tmpl_var rating.label>:</b> <tmpl_var rating>
|
||||
<tmpl_unless hasRated>
|
||||
<tmpl_var rate.label> [ <a href="<tmpl_var rate.url.1>">1</a>, <a href="<tmpl_var rate.url.2>">2</a>, <a href="<tmpl_var rate.url.3>">3</a>, <a href="<tmpl_var rate.url.4>">4</a>, <a href="<tmpl_var rate.url.5>">5</a> ]
|
||||
<tmpl_var rate.label> [ <p style="display:inline;vertical-align:middle;"><a href="<tmpl_var rate.url.thumbsUp>"><img src="<tmpl_var thumbsUp.icon.url>" alt="+" style="border: 0px;vertical-align:middle;" /></a></p> | <p style="display:inline;vertical-align:middle;"><a href="<tmpl_var rate.url.thumbsDown>"><img src="<tmpl_var thumbsDown.icon.url>" alt="-" style="border: 0px;vertical-align:middle;" /></a></p> ]
|
||||
</tmpl_unless>
|
||||
<br />
|
||||
<tmpl_if user.isModerator>
|
||||
<b><tmpl_var status.label>:</b> <tmpl_var status> [ <a href="<tmpl_var approve.url>"><tmpl_var approve.label></a> | <a href="<tmpl_var deny.url>"><tmpl_var deny.label></a> ]<br />
|
||||
<tmpl_else>
|
||||
<tmpl_if user.isPoster>
|
||||
<b><tmpl_var status.label>:</b> <tmpl_var status><br />
|
||||
</tmpl_if>
|
||||
</tmpl_if>
|
||||
</div>
|
||||
</div>
|
||||
<div class="postMessage">
|
||||
|
|
@ -149,16 +145,12 @@
|
|||
<b><tmpl_var views.label>:</b> <tmpl_var views><br />
|
||||
<b><tmpl_var rating.label>:</b> <tmpl_var rating>
|
||||
<tmpl_unless hasRated>
|
||||
<tmpl_var rate.label> [ <a href="<tmpl_var rate.url.1>">1</a>, <a href="<tmpl_var rate.url.2>">2</a>, <a href="<tmpl_var rate.url.3>">3</a>, <a href="<tmpl_var rate.url.4>">4</a>, <a href="<tmpl_var rate.url.5>">5</a> ]
|
||||
<tmpl_var rate.label> [ <p style="display:inline;vertical-align:middle;"><a href="<tmpl_var rate.url.thumbsUp>"><img src="<tmpl_var thumbsUp.icon.url>" alt="+" style="border: 0px;vertical-align:middle;" /></a></p> | <p style="display:inline;vertical-align:middle;"><a href="<tmpl_var rate.url.thumbsDown>"><img src="<tmpl_var thumbsDown.icon.url>" alt="-" style="border: 0px;vertical-align:middle;" /></a></p> ]
|
||||
</tmpl_unless>
|
||||
<br />
|
||||
<tmpl_if user.isModerator>
|
||||
<b><tmpl_var status.label>:</b> <tmpl_var status> [ <a href="<tmpl_var approve.url>"><tmpl_var approve.label></a> | <a href="<tmpl_var deny.url>"><tmpl_var deny.label></a> ]<br />
|
||||
<tmpl_else>
|
||||
<tmpl_if user.isPoster>
|
||||
<b><tmpl_var status.label>:</b> <tmpl_var status><br />
|
||||
</tmpl_if>
|
||||
</tmpl_if>
|
||||
</div>
|
||||
</div>
|
||||
<div class="postMessage">
|
||||
|
|
|
|||
|
|
@ -238,6 +238,9 @@ sub updateCs {
|
|||
}, "csworkflow000000000001");
|
||||
my $activity = $workflow->addActivity("WebGUI::Workflow::Activity::GetCsMail","csactivity000000000001");
|
||||
$activity->set("title","Get the mail");
|
||||
print "\t\tDeleteing old ratings due to new rating system.\n";
|
||||
$session->db->write("delete from Post_rating");
|
||||
$session->db->write("update Post set rating=0");
|
||||
}
|
||||
|
||||
#-------------------------------------------------
|
||||
|
|
|
|||
|
|
@ -447,11 +447,8 @@ sub getTemplateVars {
|
|||
$var{'reply.withquote.url'} = $self->getReplyUrl(1);
|
||||
$var{'url'} = $self->getUrl.'#id'.$self->getId;
|
||||
$var{'rating.value'} = $self->get("rating")+0;
|
||||
$var{'rate.url.1'} = $self->getRateUrl(1);
|
||||
$var{'rate.url.2'} = $self->getRateUrl(2);
|
||||
$var{'rate.url.3'} = $self->getRateUrl(3);
|
||||
$var{'rate.url.4'} = $self->getRateUrl(4);
|
||||
$var{'rate.url.5'} = $self->getRateUrl(5);
|
||||
$var{'rate.url.thumbsUp'} = $self->getRateUrl(1);
|
||||
$var{'rate.url.thumbsDown'} = $self->getRateUrl(-1);
|
||||
$var{'hasRated'} = $self->hasRated;
|
||||
my $gotImage;
|
||||
my $gotAttachment;
|
||||
|
|
@ -773,16 +770,14 @@ An integer between 1 and 5 (5 being best) to rate this post with.
|
|||
|
||||
sub rate {
|
||||
my $self = shift;
|
||||
my $rating = shift || 3;
|
||||
my $rating = shift;
|
||||
return undef unless ($rating == -1 || $rating == 1);
|
||||
unless ($self->hasRated) {
|
||||
$self->session->db->write("insert into Post_rating (assetId,userId,ipAddress,dateOfRating,rating) values ("
|
||||
.$self->session->db->quote($self->getId).", ".$self->session->db->quote($self->session->user->userId).", ".$self->session->db->quote($self->session->env->get("REMOTE_ADDR")).",
|
||||
".$self->session->datetime->time().", ".$self->session->db->quote($rating).")");
|
||||
my ($count) = $self->session->db->quickArray("select count(*) from Post_rating where assetId=".$self->session->db->quote($self->getId));
|
||||
$count = $count || 1;
|
||||
my ($sum) = $self->session->db->quickArray("select sum(rating) from Post_rating where assetId=".$self->session->db->quote($self->getId));
|
||||
my $average = WebGUI::Utility::round($sum/$count);
|
||||
$self->update({rating=>$average});
|
||||
$self->update({rating=>$sum});
|
||||
$self->getThread->rate($rating);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -249,7 +249,7 @@ Returns a list of the post objects in this thread, including the thread post its
|
|||
|
||||
sub getPosts {
|
||||
my $self = shift;
|
||||
$self->getLineage(["self","descendants"], {returnObjects=>1});
|
||||
$self->getLineage(["self","descendants"], {returnObjects=>1, includeArchived=>1});
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
|
@ -548,15 +548,13 @@ An integer between 1 and 5 (5 being best) to rate this post with.
|
|||
sub rate {
|
||||
my $self = shift;
|
||||
my $rating = shift;
|
||||
return undef unless ($rating == -1 || $rating == 1);
|
||||
unless ($self->hasRated) {
|
||||
$self->session->db->write("insert into Post_rating (assetId,userId,ipAddress,dateOfRating,rating) values ("
|
||||
.$self->session->db->quote($self->getId).", ".$self->session->db->quote($self->session->user->userId).", ".$self->session->db->quote($self->session->env->get("REMOTE_ADDR")).",
|
||||
".$self->session->datetime->time().", ".$self->session->db->quote($rating).")");
|
||||
my ($count) = $self->session->db->quickArray("select count(*) from Post left join asset on Post.assetId=asset.assetId where Post.threadId=".$self->session->db->quote($self->getId)." and Post.rating>0");
|
||||
$count = $count || 1;
|
||||
my ($sum) = $self->session->db->quickArray("select sum(Post.rating) from Post left join asset on Post.assetId=asset.assetId where Post.threadId=".$self->session->db->quote($self->getId)." and Post.rating>0");
|
||||
my $average = round($sum/$count);
|
||||
$self->update({rating=>$average});
|
||||
$self->update({rating=>$sum});
|
||||
if ($self->session->setting->get("useKarma")) {
|
||||
my $poster = WebGUI::User->new($self->session, $self->get("ownerUserId"));
|
||||
$poster->karma($rating*$self->getParent->get("karmaRatingMultiplier"),"collaboration rating","someone rated post ".$self->getId);
|
||||
|
|
@ -761,6 +759,9 @@ sub view {
|
|||
$var->{'subscribe.url'} = $self->getSubscribeUrl;
|
||||
$var->{'unsubscribe.url'} = $self->getUnsubscribeUrl;
|
||||
|
||||
$var->{'thumbsUp.icon.url'} = $self->session->config->get("extrasURL").'/thumbup.gif';
|
||||
$var->{'thumbsDown.icon.url'} = $self->session->config->get("extrasURL").'/thumbdown.gif';
|
||||
|
||||
$var->{'isArchived'} = $self->get("status") eq "archived";
|
||||
$var->{'archive.url'} = $self->getArchiveUrl;
|
||||
$var->{'unarchive.url'} = $self->getUnarchiveUrl;
|
||||
|
|
|
|||
|
|
@ -110,6 +110,8 @@ sub appendTemplateLabels {
|
|||
$var->{"addquestion.label"} = $i18n->get("addquestion");
|
||||
$var->{'answer.label'} = $i18n->get("answer");
|
||||
$var->{'attachment.label'} = $i18n->get("attachment");
|
||||
$var->{'archive.label'} = $i18n->get("archive");
|
||||
$var->{'unarchive.label'} = $i18n->get("unarchive");
|
||||
$var->{"by.label"} = $i18n->get("by");
|
||||
$var->{'body.label'} = $i18n->get("body");
|
||||
$var->{"back.label"} = $i18n->get("back");
|
||||
|
|
|
|||
|
|
@ -249,6 +249,10 @@ A boolean indicating whether the resulting asset tree should be returned in reve
|
|||
|
||||
An array reference containing a list of asset classes to include in the result. If this is specified then no other classes except these will be returned. The opposite of the excludeClasses rule.
|
||||
|
||||
=head4 includeArchived
|
||||
|
||||
A boolean indicating that we should include archived assets in the result set.
|
||||
|
||||
=head4 joinClass
|
||||
|
||||
An array reference containing asset classes to join in. There is no real reason to use a joinClass without a whereClause, but it's trivial to use a whereClause if you don't use a joinClass. You will only be able to filter on the asset table, however.
|
||||
|
|
@ -340,7 +344,8 @@ sub getLineage {
|
|||
$where = "asset.state='published'";
|
||||
}
|
||||
## get only approved items or those that i'm currently working on
|
||||
$where .= " and (assetData.status='approved' or assetData.tagId=".$self->session->db->quote($self->session->scratch->get("versionTag")).")";
|
||||
my $archived = " or assetData.status='archived' " if ($rules->{includeArchived});
|
||||
$where .= " and (assetData.status='approved' $archived or assetData.tagId=".$self->session->db->quote($self->session->scratch->get("versionTag")).")";
|
||||
## class exclusions
|
||||
if (exists $rules->{excludeClasses}) {
|
||||
my @set;
|
||||
|
|
@ -360,7 +365,7 @@ sub getLineage {
|
|||
}
|
||||
# based upon all available criteria, let's get some assets
|
||||
my $columns = "asset.assetId, asset.className, asset.parentId, assetData.revisionDate";
|
||||
$where .= " and assetData.revisionDate=(SELECT max(revisionDate) from assetData where assetData.assetId=asset.assetId and (assetData.status='approved' or assetData.tagId=".$self->session->db->quote($self->session->scratch->get("versionTag")).")) ";
|
||||
$where .= " and assetData.revisionDate=(SELECT max(revisionDate) from assetData where assetData.assetId=asset.assetId and (assetData.status='approved' $archived or assetData.tagId=".$self->session->db->quote($self->session->scratch->get("versionTag")).")) ";
|
||||
my $sortOrder = ($rules->{invertTree}) ? "asset.lineage desc" : "asset.lineage asc";
|
||||
if (exists $rules->{orderByClause}) {
|
||||
$sortOrder = $rules->{orderByClause};
|
||||
|
|
|
|||
|
|
@ -2,6 +2,18 @@ package WebGUI::i18n::English::Asset_Collaboration;
|
|||
|
||||
our $I18N = {
|
||||
|
||||
'archive' => {
|
||||
message => q|Archive|,
|
||||
lastUpdated => 0,
|
||||
context => q|thread link|
|
||||
},
|
||||
|
||||
'unarchive' => {
|
||||
message => q|Unarchive|,
|
||||
lastUpdated => 0,
|
||||
context => q|thread link|
|
||||
},
|
||||
|
||||
'mail prefix' => {
|
||||
message => q|Prefix|,
|
||||
lastUpdated => 0,
|
||||
|
|
|
|||
|
|
@ -216,8 +216,12 @@ The URL for this Post.
|
|||
The current rating for this Post.
|
||||
<p>
|
||||
|
||||
<b>rate.url.<i>N</i></b><br>
|
||||
URLs that are used to rate this post. N goes from 1 to 5.
|
||||
<b>rate.url.thumbsUp</b><br>
|
||||
A positive rating.
|
||||
<p>
|
||||
|
||||
<b>rate.url.thumbsDown</b><br>
|
||||
A negative rating.
|
||||
<p>
|
||||
|
||||
<b>hasRated</b><br>
|
||||
|
|
@ -388,7 +392,7 @@ back the data with a simple <tmpl_var userDefined1>.
|
|||
<p>
|
||||
|
||||
|,
|
||||
lastUpdated => 1134670360,
|
||||
lastUpdated => 1145111051,
|
||||
},
|
||||
|
||||
'post received' => {
|
||||
|
|
|
|||
|
|
@ -27,6 +27,14 @@ A weighting factor for difficulty, complexity, or handicap in contests.
|
|||
This is karma divided by karma scale.
|
||||
<p>
|
||||
|
||||
<b>thumbsUp.icon.url</b><br>
|
||||
The URL to the thumbs up icon.
|
||||
<p>
|
||||
|
||||
<b>thumbsDown.icon.url</b><br>
|
||||
The URL to the thumbs down icon.
|
||||
<p>
|
||||
|
||||
<b>user.isVisitor</b><br>
|
||||
A conditional indicating that the current user is a Visitor.
|
||||
<p>
|
||||
|
|
@ -191,7 +199,7 @@ The description of the collaboration system that this post is a part of.
|
|||
<p>
|
||||
|
||||
|,
|
||||
lastUpdated => 1141142205,
|
||||
lastUpdated => 1145111313,
|
||||
},
|
||||
|
||||
'assetName' => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue