Work in progress adding checks for enabled plugins for pages.
[timetracker.git] / WEB-INF / templates / header.tpl
1 <html>
2 <head>
3   <meta http-equiv="content-type" content="text/html; charset={$smarty.const.CHARSET}">
4   <link rel="icon" href="favicon.ico" type="image/x-icon">
5   <link rel="shortcut icon" href="favicon.ico" type="image/x-icon">
6   <link href="{$smarty.const.DEFAULT_CSS}" rel="stylesheet" type="text/css">
7 {if $i18n.language.rtl}
8   <link href="{$smarty.const.RTL_CSS}" rel="stylesheet" type="text/css">
9 {/if}
10   <title>Time Tracker{if $title} - {$title}{/if}</title>
11   <script src="js/strftime.js"></script>
12   <script>
13     {* Setup locale for strftime *}
14     {$js_date_locale}
15   </script>
16   <script src="js/strptime.js"></script>
17 </head>
18
19 <body leftmargin="0" topmargin="0" marginheight="0" marginwidth="0" {$onload}>
20
21 {assign var="tab_width" value="700"}
22
23 <!--  101% height here is a workaround for Firefox shifting content horizontally when scrollbar appears / disappears.
24 See https://bugzilla.mozilla.org/show_bug.cgi?id=279425.
25 With 101% height we essentially force the scrollbar to always appear. -->
26 <table height="101%" cellspacing="0" cellpadding="0" width="100%" border="0">
27   <tr>
28     <td valign="top" align="center"> <!-- This is to centrally align all our content. -->
29
30       <!-- top image -->
31       <table cellspacing="0" cellpadding="0" width="100%" border="0">
32         <tr>
33 {if $user->custom_logo}
34           <td align="center">
35 {else}
36           <td bgcolor="#a6ccf7" background="images/top_bg.gif" align="center">
37 {/if}
38             <table cellspacing="0" cellpadding="0" width="{$tab_width}" border="0">
39               <tr>
40                 <td valign="top">
41                   <table cellspacing="0" cellpadding="0" width="100%" border="0">
42                     <tr><td height="6" colspan="2"><img width="1" height="6" src="images/1x1.gif" border="0"></td></tr>
43                     <tr valign="top">
44 {if $user->custom_logo}
45                       <td height="55" align="center"><img alt="Time Tracker" width="300" height="43" src="{$custom_logo}" border="0"></a></td>
46 {else}
47                       <td height="55" align="center"><a href="https://www.anuko.com/lp/tt_1.htm" target="_blank"><img alt="Anuko Time Tracker" width="300" height="43" src="images/tt_logo.png" border="0"></a></td>
48 {/if}
49                     </tr>
50                   </table>
51                 </td>
52               </tr>
53             </table>
54           </td>
55         </tr>
56       </table>
57       <!-- end of top image -->
58
59 {if $authenticated}
60   {if $user->isAdmin()}
61       <!-- top menu for admin -->
62       <table cellspacing="0" cellpadding="3" width="100%" border="0">
63         <tr>
64           <td class="systemMenu" height="17" align="center">&nbsp;
65             <a class="systemMenu" href="logout.php">{$i18n.menu.logout}</a> &middot;
66             <a class="systemMenu" href="{$smarty.const.FORUM_LINK}" target="_blank">{$i18n.menu.forum}</a> &middot;
67             <a class="systemMenu" href="{$smarty.const.HELP_LINK}" target="_blank">{$i18n.menu.help}</a>
68           </td>
69         </tr>
70       </table>
71       <!-- end of top menu for admin -->
72
73       <!-- sub menu for admin -->
74       <table cellspacing="0" cellpadding="3" width="100%" border="0">
75         <tr>
76           <td align="center" bgcolor="#d9d9d9" nowrap height="17" background="images/subm_bg.gif">&nbsp;
77             <a class="mainMenu" href="admin_teams.php">{$i18n.menu.teams}</a> &middot;
78             <a class="mainMenu" href="admin_options.php">{$i18n.menu.options}</a>
79           </td>
80         </tr>
81       </table>
82       <!-- end of sub menu for admin -->
83   {else}
84       <!-- top menu for authorized user -->
85       <table cellspacing="0" cellpadding="3" width="100%" border="0">
86         <tr>
87           <td class="systemMenu" height="17" align="center">&nbsp;
88             <a class="systemMenu" href="logout.php">{$i18n.menu.logout}</a> &middot;
89             <a class="systemMenu" href="profile_edit.php">{$i18n.menu.profile}</a> &middot;
90             <a class="systemMenu" href="{$smarty.const.FORUM_LINK}" target="_blank">{$i18n.menu.forum}</a> &middot;
91             <a class="systemMenu" href="{$smarty.const.HELP_LINK}" target="_blank">{$i18n.menu.help}</a>
92           </td>
93         </tr>
94       </table>
95       <!-- end of top menu for authorized user -->
96
97       <!-- sub menu for authorized user -->
98       <table cellspacing="0" cellpadding="3" width="100%" border="0">
99         <tr>
100           <td align="center" bgcolor="#d9d9d9" nowrap height="17" background="images/subm_bg.gif">&nbsp;
101     {if !$user->isClient()}
102            <a class="mainMenu" href="time.php">{$i18n.menu.time}</a>
103     {/if}
104     {if $user->isPluginEnabled('ex') && !$user->isClient()}
105             &middot; <a class="mainMenu" href="expenses.php">{$i18n.menu.expenses}</a>
106     {/if}
107             {if !$user->isClient()}&middot; {/if}<a class="mainMenu" href="reports.php">{$i18n.menu.reports}</a>
108     {if ($user->canManageTeam() || $user->isClient()) && $user->isPluginEnabled('iv')}
109             &middot; <a class="mainMenu" href="invoices.php">{$i18n.title.invoices}</a>
110     {/if}
111     {if ($user->isPluginEnabled('ch') && !$user->isClient()) && ($smarty.const.MODE_PROJECTS == $user->tracking_mode
112       || $smarty.const.MODE_PROJECTS_AND_TASKS == $user->tracking_mode || $user->isPluginEnabled('cl'))}
113             &middot; <a class="mainMenu" href="charts.php">{$i18n.menu.charts}</a>
114     {/if}
115     {if !$user->isClient() && ($smarty.const.MODE_PROJECTS == $user->tracking_mode || $smarty.const.MODE_PROJECTS_AND_TASKS == $user->tracking_mode)}
116             &middot; <a class="mainMenu" href="projects.php">{$i18n.menu.projects}</a>
117     {/if}
118     {if $user->canManageTeam() && ($smarty.const.MODE_PROJECTS_AND_TASKS == $user->tracking_mode)}
119             &middot; <a class="mainMenu" href="tasks.php">{$i18n.menu.tasks}</a>
120     {/if}
121     {if !$user->isClient()}
122             &middot; <a class="mainMenu" href="users.php">{$i18n.menu.users}</a>
123     {/if}
124     {if $user->canManageTeam() && $user->isPluginEnabled('cl')}
125             &middot; <a class="mainMenu" href="clients.php">{$i18n.menu.clients}</a>
126     {/if}
127     {if $user->isManager()}
128             &middot; <a class="mainMenu" href="export.php">{$i18n.menu.export}</a>
129     {/if}
130           </td>
131         </tr>
132       </table>
133       <!-- end of sub menu for authorized user -->
134   {/if}
135 {else}
136       <!-- top menu for non authorized user -->
137       <table cellspacing="0" cellpadding="3" width="100%" border="0">
138         <tr>
139           <td class="systemMenu" height="17" align="center">&nbsp;
140             <a class="systemMenu" href="login.php">{$i18n.menu.login}</a> &middot;
141   {if isTrue($smarty.const.MULTITEAM_MODE) && $smarty.const.AUTH_MODULE == 'db'}
142             <a class="systemMenu" href="register.php">{$i18n.menu.create_team}</a> &middot;
143   {/if}
144             <a class="systemMenu" href="{$smarty.const.FORUM_LINK}" target="_blank">{$i18n.menu.forum}</a> &middot;
145             <a class="systemMenu" href="{$smarty.const.HELP_LINK}" target="_blank">{$i18n.menu.help}</a>
146           </td>
147         </tr>
148       </table>
149 {/if}
150       <br>
151
152       <!-- page title and user details -->
153 {if $title}
154       <table cellspacing="0" cellpadding="5" width="{$tab_width+20}" border="0">
155         <tr><td class="sectionHeader"><div class="pageTitle">{$title}{if $timestring}: {$timestring}{/if}</div></td></tr>
156         <tr><td>{$user->name|escape:'html'}{if $user->isAdmin()} {$i18n.label.role_admin}{elseif $user->isManager()} {$i18n.label.role_manager}{elseif $user->canManageTeam()} {$i18n.label.role_comanager}{/if}{if $user->behalf_id > 0} <b>{$i18n.label.on_behalf} {$user->behalf_name|escape:'html'}</b>{/if}{if $user->team}, {$user->team|escape:'html'}{/if}</td></tr>
157       </table>
158 {/if}
159       <!-- end of page title and user details -->
160
161       <!-- output errors -->
162 {if $err->yes()}
163       <table cellspacing="4" cellpadding="7" width="{$tab_width}" border="0">
164         <tr>
165           <td class="error">
166   {foreach $err->getErrors() as $error}
167             {$error.message}<br> {* No need to escape as they are not coming from user and may contain a link. *}
168   {/foreach}
169           </td>
170         </tr>
171       </table>
172 {/if}
173       <!-- end of output errors -->
174
175       <!-- output messages -->
176 {if $msg->yes()}
177       <table cellspacing="4" cellpadding="7" width="{$tab_width}" border="0">
178         <tr>
179           <td class="info_message">
180   {foreach $msg->getErrors() as $message}
181             {$message.message}<br> {* No need to escape. *}
182   {/foreach}
183           </td>
184         </tr>
185       </table>
186 {/if}
187       <!-- end of output messages -->