## $Revision$ $Date$ ## - URL generator macros ----------------------------------------------------- #macro(linkUser $user) #linkUserShort($user) #if(${user.firstName} && ${user.lastName}) ($textFormatter.escape(${user.lastName}), $textFormatter.escape(${user.firstName})) #end #end #macro(linkUserShort $user) #if( !${user.name} || ${user.name} == "") -- #else $textFormatter.escape(${user.name}) #end #end #macro(linkUserEmail $user) $textFormatter.escape(${user.email}) #end #macro(linkUserPhone $user) #if( !${user.phone} || ${user.phone} == "") -- #else $textFormatter.escape(${user.phone}) #end #end #macro(linkGeoIP $geoIP) #if( !${geoIP.mapUrl}) -- #else $textFormatter.escape(${geoIP.location}) #end #end ## Link to any ReferableDto #macro(linkReferableDto $referable) #linkReferableDtoWithParams($referable "") #end ## $refereable The link will be created to this referable ## $params Optional parameters on the url #macro(linkReferableDtoWithParams $referable $params) #set($url = "${cbBaseUrl}${referable.urlLink}") #set($url = ${textFormatter.buildUrl(${url},${params})}) ${textFormatter.escape($!{referable.shortDescription})} #end #macro(linkProject $project)#linkReferableDto($project)#end #macro(linkArtifact $artifact) $textFormatter.escape(${artifact.name}) #end #macro(linkArtifactParent $artifact) $textFormatter.escape(${artifact.ScopeName}) #end #macro(linkArtifactComments $artifact) View all comments on $textFormatter.escape(${artifact.name}) #end #macro(linkWikiPageComments $wikiPage) View all comments on $textFormatter.escape(${wikiPage.name}) #end #macro(linkTrackerItemPane $item $trackerItemTabPane) #if( !$trackerItemTabPane || $trackerItemTabPane == "") #set( $trackerItemTabPane = "task-details-comments" ) #end #if( !$item.summary || $item.summary == "") #set($description = ${item.id}) #else #set($description = $textFormatter.escape(${item.summary})) #end ${item.typeName} #if($item.closed) [${item.keyAndId}] #else [${item.keyAndId}] #end - ${description} #end #macro(linkTrackerItem $item) #linkTrackerItemPane($item "task-details-comments") #end #macro(linkTrackerItemAttachment $item) #linkTrackerItemPane($item "task-details-attachments") #end #macro(linkTrackerItemComment $item) #linkTrackerItemPane($item "task-details-comments") #end #macro(linkTrackerItemAssociation $item) #linkTrackerItemPane($item "task-details-associations") #end #macro(linkAssociationDetails $association) #if (${association.ToTypeId} == 5) Association: [DOC:${association.ToId}]
#elseif (${association.urlReference}) Association: [${association.url}]
#elseif (${association.toUrl}) Association: [${association.toInterwikiReference} $textFormatter.escape(${association.toDescription})]
#end ## ${association}, ToTypeId: ${association.ToTypeId}, ToId: ${association.ToId} #end ##macro(linkTrackerItemAttachment $attachment) ## ${attachment.filename} ##end #macro(linkTracker $tracker) $textFormatter.escape(${tracker.name}) #end #macro(linkMembersPane $project $linkName $membersTabPane) #if( !$membersTabPane || $membersTabPane == "") #set( $membersTabPane = "project-members-roles-accounts" ) #end $textFormatter.escape(${linkName}) #end #macro(linkForumThread ${forumPost}) #set ($anchor = "") #if (${forumPost.threadId} > 0 && ${forumPost.threadId} != ${forumPost.id}) #set ($anchor = "#MSG_${forumPost.id}") #end #set ($forumPostLink = "${cbBaseUrl}/proj/forum/viewMessage.do?thread_id=${forumPost.threadId}" ) $textFormatter.escape(${forumPost.subject}) #end #macro(linkForumPostAttachment ${forumPost}) $textFormatter.escape(${forumPost.attachmentFileName}) #end #macro(linkWikiPage $wikiPage) ${wikiPage.name} #end #macro(linkReport $doc) #if(${doc.additionalInfo.contentLastModifiedBy.name}) #set( $lastModifiedBy = ${doc.additionalInfo.contentLastModifiedBy.name}) #else #set( $lastModifiedBy = "--") #end #set( $lastModified = "Last modified: $textFormatter.formatDate(${user}, ${doc.additionalInfo.contentLastModifiedAt}, true) by $textFormatter.escape($lastModifiedBy)" ) #if($doc.writable)${doc.name}#else${doc.name}  ${lastModified}#end #end ## - Table macros ------------------------------------------------------------- #macro(tableOpen) $rowCounter.reset() #end #macro(tableOpenStyled $style) $rowCounter.reset()
#end #macro(tableClose)
#end #macro(trTitle $text $style) ${text} #end #macro(titleHr $style)
#end #macro(bold $text) ${text} #end #macro (trOpen) #end #macro (trClose) #end #macro(trSeparator) #end #macro(thField $text) $text #end #macro(tdField $text) #if( !$text || $text == "") -- #else $!{text} #end #end #macro(tdText $text) #if( !$text || $text == "") -- #else $!{text} #end #end #macro(tdNumber $text) #if( !$text || $text == "") -- #else $textFormatter.formatLong(${text}) ## $!{text} #end #end #macro( tdSeparator ) #end ## - Other macros ------------------------------------------------------------- #macro (br)
#end ## prints any NamedDto #macro (named $named) #if($named) ${named.name} #else -- #end #end #macro (account $user) Account: #linkUser(${user}) #end ## prints a tiny highlighted "New!" sign #macro (newTablet) #set($Q = '"') New! #end ## puts the reason why the recipient receives this artifact approval related email #macro (artifactApprovalReason $artifact)
## check against the last modifier #if(${artifact.lastModifiedBy.id} == ${recipient.id}) #set($lastModifiedBy = true) #end #you($recipient) are receiving this email, because #if($lastModifiedBy == true) this has been most recently updated by you. #else you are participating in its approval process. #end
#end ## puts the reason why the recipient receives this tracker item related email #macro (trackerItemReason $trackerItem)
#set($submittedBy = false) #set($assignedToYou = false) #set($assignedToYourRole = false) #set($supervisedBy = false) #set($subscribedBy = false) #set($projectAdmin = false) #set($escalatedTo = false) ## check against the submitter #if(${trackerItem.submitter.id} == ${recipient.id}) #set($submittedBy = true) #end #set($notificationReasonsForUser = ${notificationReasons.get($recipient)}) #foreach($reason in ${notificationReasonsForUser}) #if ($reason == 'ASSIGNED_TO_USER') #set($assignedToYou = true) #end #if ($reason == 'ASSIGNED_TO_ROLE') #set($assignedToYourRole = true) #end #if ($reason == 'OWNER_AS_ROLE' || $reason == 'OWNER_AS_USER') #set($supervisedBy = true) #end #if ($reason == 'SUBSCRIBED_BY_ROLE' || $reason == 'SUBSCRIBED_BY_USER') #set($subscribedBy = true) #end #if ($reason == 'PROJECT_ADMIN') #set($projectAdmin = true) #end #if ($reason == 'ESCALATION_TO_ROLE' || $reason == 'ESCALATION_TO_USER') #set($escalatedTo = true) #end #end ## check against all the assignees #set($assignedToYouOnly = ${notificationReasons.isAssignedToAnUserOnly(${recipient})}) #you($recipient) are receiving this email, because #if($submittedBy == true) this ${trackerItem.typeName} has been submitted by you. #elseif($assignedToYouOnly == true) this ${trackerItem.typeName} is assigned to you. #elseif($assignedToYou == true) this ${trackerItem.typeName} is assigned to you and some other users or roles. #elseif($assignedToYourRole == true) this ${trackerItem.typeName} is assigned to your role. #elseif($supervisedBy == true) this ${trackerItem.typeName} is supervised by you. #elseif($escalatedTo == true) this ${trackerItem.typeName} was escalated to you. #elseif($projectAdmin == true) you are project administrator in "$textFormatter.escape(${trackerItem.project.name})". #else ## that must be -> subscribedBy == true, so not checking that flag you have subscribed this ${trackerItem.typeName} or the ${trackerItem.tracker.trackerTypeName} "$textFormatter.escape(${trackerItem.tracker.name})". #end
#end #macro(you $user) #if(${user.firstName}) $textFormatter.escape(${user.firstName}), you #else You #end #end ######## duplicate macros from different ".vm" files #macro( PrintArrayJSnamed $name $array ) $name = new Array(#foreach( $item in $array )#if( $velocityCount!=1 ),#end "${item.name}"#end); #end #macro( incr $value ) #set( $value = $value + 1 ) #end #macro (printParametersSet $list ) #set($comma ="") #foreach( $item in $list ) #set($paramString = "") #foreach ($par in ${item.getParametersSet()} ) #set($paramString = $paramString + "&${par.key}=${par.value}") #end ${comma} "${paramString}" #if(${comma} != ",") #set($comma = ",")#end #end #end #macro( tableRow $cells ) #trOpen() #foreach( $cell in $cells ) #tdText( ${cell} ) #end #trClose() #end #macro( tdTextRight $text ) $text #end ## macro to insert a cell with r_arrow.gif image #macro( tdArrow ) #end