return $max_rank;
}
+
+ // getUserPartForHeader constructs a string for user to display on pages header.
+ // It changes with "on behalf" attributes for both user and group.
+ function getUserPartForHeader() {
+ global $i18n;
+
+ $user_part = htmlspecialchars($this->name);
+ $user_part .= ' - '.htmlspecialchars($this->role_name);
+ if ($this->behalf_id) {
+ $user_part .= ' <span class="onBehalf">'.$i18n->get('label.on_behalf').' '.htmlspecialchars($this->behalf_name).'</span>';
+ }
+ if ($this->behalf_group_id) {
+ $user_part .= ', <span class="onBehalf">'.$i18n->get('label.on_behalf').' '.htmlspecialchars($this->behalf_group_name).'</span>';
+ } else {
+ if ($this->group_name) // Note: we did not require group names in the past.
+ $user_part .= ', '.$this->group_name;
+ }
+ return $user_part;
+ }
}
<br>
<table cellspacing="0" cellpadding="4" width="100%" border="0">
<tr>
- <td align="center"> Anuko Time Tracker 1.18.27.4500 | Copyright © <a href="https://www.anuko.com/lp/tt_3.htm" target="_blank">Anuko</a> |
+ <td align="center"> Anuko Time Tracker 1.18.27.4501 | Copyright © <a href="https://www.anuko.com/lp/tt_3.htm" target="_blank">Anuko</a> |
<a href="https://www.anuko.com/lp/tt_4.htm" target="_blank">{$i18n.footer.credits}</a> |
<a href="https://www.anuko.com/lp/tt_5.htm" target="_blank">{$i18n.footer.license}</a> |
<a href="https://www.anuko.com/lp/tt_7.htm" target="_blank">{$i18n.footer.improve}</a>
{if $title}
<table cellspacing="0" cellpadding="5" width="{$tab_width+20}" border="0">
<tr><td class="sectionHeader"><div class="pageTitle">{$title}{if $timestring}: {$timestring}{/if}</div></td></tr>
- {if $user->name}
- <tr><td>{$user->name|escape} - {$user->role_name|escape}{if $user->behalf_id > 0} <b>{$i18n.label.on_behalf} {$user->behalf_name|escape}</b>{/if}{if $user->group_name}, {$user->group_name|escape}{/if}</td></tr>
- {else}
- <tr><td> </td></tr>
- {/if}
+ <tr><td>{$user->getUserPartForHeader()}</td></tr> {* No need to escape as it is done in the class. *}
</table>
{/if}
<!-- end of page title and user details -->
color: #444444;
}
+.onBehalf {
+ font-weight: bold;
+}
+
.tableHeader {
font-weight: bold;
text-align: left;