Stylesheets

Stylesheets are used for quick preview of issue properties, attachments and notes.

Making such a stylesheet is not compex.

As you see on the picture all you need is write a body for an HTML document as:

<html> <body bgcolor="#DFFFD0">
<b>Nr:</b> <Field Name="ID"/>
<b>Submiter:</b> <Field Name="SUBMITER"/>
<b>Submited at:</b> <Field Name="FROMTIME"/>
<b>Status:</b> <Field Name="RSTATUS"/><br>
<b>Kind:</b> <Field Name="RKIND"/>
<b>Customer:</b> <Field Name="CUSTOMER"/>
<b>Priority:</b> <Field Name="PRIORITY"/><br>
<b>Implement in version:</b> <Field Name="IMPLVER"/>
<b>Effort:</b> <Field Name="EFFORTE"/><hr>
<b>Description:</b><br><Field Name="NAME"/>

<Condition NoNotes="1">
<hr>
<table border=1>
<tr>
<td><b>Note type</b></td>
<td><b>Submiter</b></td>
<td><b>Submited at</b></td>
</tr>
<NotesTable2>
</table>
</Condition>

<Condition NoAttachments="1">
<hr>
<table border=1>
<tr>
<td><b>File</b></td>
<td><b>Size</b></td>
<td><b>Submited at</b></td>
<td><b>Submiter</b></td>
</tr>
<AttachListTable>
</table>
</Condition>

</body>
</html>

MyTracker first process its own Macros and then shows the html file.

Macros (custom tags) give the HTML dynamic content.

Macro name Meaning
<Field Name="Field_name" NullValue="null_value"/> Shows the value of field
<AttachListTable> Produce a series of
<tr>
  <td>Attachment title</td>
  <td>Attached file name</td>
  <td>Attached file size</td>
  <td>Submited at (timestamp)</td>
  <td>Submited by</td>
</tr>
<NotesTable> Produce a series of
<tr>
  <td>Note type</td>
  <td>Submited by</td>
  <td>Submited at</td>
  <td>Note text</td>
</tr>
Note per row
<NotesTable2> Produce a series of
<tr>
  <td>Note type</td>
  <td>Submited by</td>
  <td>Submited at</td>
</tr>
<tr>
  <td colspan=3>Note text</td>
</tr>
In the first row are the note properties, in the second the note text
<HistoryTable> Produce a series of
<tr>
  <td>Field Name</td>
  <td>Changed at</td>
  <td>New value</td>
  <td>Old value</td>
  <td>Changed by</td>
</tr>
sorted by Changed at
<HistoryTableByField> Produce a series of
<tr>
  <td>Field Name</td>
  <td>Changed at</td>
  <td>New value</td>
  <td>Old value</td>
  <td>Changed by</td>
</tr>
sorted by Field Name
<AttachmentsCount> Show the number of attachment
<NotesCount> Show the number of notes

Reducing visibility of change history

For HistoryTable and HistoryTableByField you have the possiblity to reduce the visible issue field. For example if you are not interrested in field priority you can write <HistoryTable excludefields="PRIORITY">. On other side if you have 20 fields and you want to see only the status and the assigned person you can write <HistoryTable excludefields="STATUS;ASSIGNEDTO">.

So generaly:
<HistoryTable|HistoryTableByField [excludefields|includefields="f1;f2;..."]>

Advanced stylesheets with Templates

In version 1.08 was introduced a new macro Template with following syntax:
<Template source=Attachments|Notes|Changes [exclude|include="f1;f2;..."]>
Header definition
<Datarecord>
</Datarecord>
Footer definition
</Template>

This macro puts in the stylesheet first the header, then for each data row from the source puts the content of Datarecord macro and finaly puts the footer in the stylesheet.

The Datarecord macro can contain these macros:

  1. for source=Attachments
  2. for source=Notes
  3. for source=Changes

Example:

<Template source=Attachments>
	Attachments:
	<Datarecord>
		<URL>,	
	</Datarecord>
</Template>
Produce such output:

Attachments: firstattachedfile, secondattachedfile, ....


With this macro you can define your own stylesheet format for sources (Attachments|Notes|Changes). Not only these tabelar AttachListTable, NotesTable. Your stylesheet "<table>" need not necessary have all column. You can define your own row separator, etc.

Conditional output

Allows conditinal output. Syntax:
1. <Condition [Template="Template"] SimpleCondition="FIELD_NAME=VALUE">some body</Condition>
2. <Condition [Template="Template"] NoAttachments="1">some body</Condition>
3. <Condition [Template="Template"] NoNotes="1">some body</Condition>
%body in the template represents the tag body.

If the condition is true the tag body will be used otherwise the template.

If you want to display ISSUETYPE=1 in bold, so you can use this snipet:
<Condition SimpleCondition="ISSUETYPE=1" Template="<b>%body</b>"> <Field Name="ISSUETYPE"/></Condition>

This snippet can you use. If you want to display the attachmentlist only if any attachment exist

<Condition NoAttachments="1" Template="No attachments">
<b>Attachments</b>
<table border=1>
  <tr>
    <td><b>File name</b></td>
    <td><b>File size</b></td>
    <td><b>Submited at</b></td>
    <td><b>Submited by</b></td>
  </tr>
  <AttachListTable>
</table>
</Condition>

See also:
Events