Skip to content
This repository has been archived by the owner on Nov 25, 2020. It is now read-only.

Commit

Permalink
Fix notification when it's pointing to Root.
Browse files Browse the repository at this point in the history
  • Loading branch information
cdujeu committed Mar 19, 2014
1 parent 0f4be33 commit 471a2df
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
Expand Up @@ -117,6 +117,12 @@ protected function replaceVars($tplString, $mess, $rich = true)
"AJXP_DATE" => SystemTextEncoding::fromUTF8(AJXP_Utils::relativeDate($this->getDate(),$mess)),
);

if($replaces["AJXP_NODE_LABEL"]==$em.$me){
$replaces["AJXP_NODE_LABEL"] = $em. "[".$replaces["AJXP_REPOSITORY_LABEL"]."]".$me;
}
if($replaces["AJXP_PARENT_LABEL"] == $em.$me ){
$replaces["AJXP_PARENT_LABEL"] = $em. "[".$replaces["AJXP_REPOSITORY_LABEL"]."]".$me;
}
if((strstr($tplString, "AJXP_TARGET_FOLDER") !== false || strstr($tplString, "AJXP_SOURCE_FOLDER")) &&
isSet($this->secondaryNode)
){
Expand Down
Expand Up @@ -108,7 +108,9 @@ Class.create("NotificationLoader", {
}
alerts = true;
}
var block = '<div class="notif_event_label">'+el.getLabel()+'</div>';
var elLabel = el.getLabel();
if(!elLabel) elLabel = "/";
var block = '<div class="notif_event_label">'+elLabel+'</div>';
var detail = '';
if(el.getMetadata().get('event_repository_label')){
detail += '<div class="notif_event_repository">'+ el.getMetadata().get('event_repository_label') + '</div>';
Expand Down Expand Up @@ -149,7 +151,7 @@ Class.create("NotificationLoader", {
});
if(this.lastAlertID && alertID > this.lastAlertID ){
newNotifs.push({
title:el.getLabel(),
title:elLabel,
body :detail.stripTags()
});
}
Expand All @@ -158,7 +160,7 @@ Class.create("NotificationLoader", {
var eventID = parseInt(el.getMetadata().get("event_id"));
if(this.lastEventID && eventID > this.lastEventID ){
newNotifs.push({
title:el.getLabel(),
title:elLabel,
body :detail.stripTags()
});
}
Expand Down

0 comments on commit 471a2df

Please sign in to comment.