Refactoring. Moved week_menu config option to plugin config.
[timetracker.git] / WEB-INF / templates / week.tpl
index 6fc08b8..6f97c4d 100644 (file)
@@ -23,11 +23,13 @@ function fillDropdowns() {
 
 {$forms.weekTimeForm.open}
 <table cellspacing="4" cellpadding="0" border="0">
+{if $show_navigation}
   <tr>
     <td align="center" colspan=2">
       <a href="time.php?date={$selected_date->toString()}">{$i18n.label.day_view}</a>&nbsp;/&nbsp;<a href="week.php?date={$selected_date->toString()}">{$i18n.label.week_view}</a>
     </td>
   </tr>
+{/if}
   <tr>
     <td valign="top">
       <table>
@@ -37,9 +39,9 @@ function fillDropdowns() {
           <td>{$forms.weekTimeForm.onBehalfUser.control}</td>
         </tr>
 {/if}
-{if $user->isPluginEnabled('cl')}
+{if $show_client}
         <tr>
-          <td align="right">{$i18n.label.client}{if $user->isPluginEnabled('cm')} (*){/if}:</td>
+          <td align="right">{$i18n.label.client}{if $user->isOptionEnabled('client_required')} (*){/if}:</td>
           <td>{$forms.weekTimeForm.client.control}</td>
         </tr>
 {/if}
@@ -54,19 +56,19 @@ function fillDropdowns() {
           <td align="right">{$custom_fields->fields[0]['label']|escape}{if $custom_fields->fields[0]['required']} (*){/if}:</td><td>{$forms.weekTimeForm.cf_1.control}</td>
         </tr>
 {/if}
-{if ($smarty.const.MODE_PROJECTS == $user->tracking_mode || $smarty.const.MODE_PROJECTS_AND_TASKS == $user->tracking_mode)}
+{if $show_project}
         <tr>
           <td align="right">{$i18n.label.project} (*):</td>
           <td>{$forms.weekTimeForm.project.control}</td>
         </tr>
 {/if}
-{if ($smarty.const.MODE_PROJECTS_AND_TASKS == $user->tracking_mode)}
+{if $show_task}
         <tr>
           <td align="right">{$i18n.label.task}:</td>
           <td>{$forms.weekTimeForm.task.control}</td>
         </tr>
 {/if}
-{if $user->isPluginEnabled('wvn')}
+{if $show_week_note}
         <tr>
           <td align="right">{$i18n.label.week_note}:</td>
           <td>{$forms.weekTimeForm.note.control}</td>
@@ -94,7 +96,7 @@ function fillDropdowns() {
   <tr><td>&nbsp;</td></tr>
 </table>
 
-{if $user->isPluginEnabled('wvl')}
+{if $show_week_list}
 <table width="720">
 <tr>
   <td valign="top">
@@ -117,6 +119,9 @@ function fillDropdowns() {
   {/if}
         <td width="5%" class="tableHeader">{$i18n.label.duration}</td>
         <td class="tableHeader">{$i18n.label.note}</td>
+  {if $show_files}
+        <td></td>
+  {/if}
         <td></td>
         <td></td>
       </tr>
@@ -138,6 +143,13 @@ function fillDropdowns() {
     {/if}
         <td align="right" valign="top">{if ($record.duration == '0:00' && $record.start <> '')}<font color="#ff0000">{$i18n.form.time.uncompleted}</font>{else}{$record.duration}{/if}</td>
         <td valign="top">{if $record.comment}{$record.comment|escape}{else}&nbsp;{/if}</td>
+    {if $show_files}
+      {if $record.has_files}
+        <td valign="top" align="center"><a href="time_files.php?id={$record.id}"><img class="table_icon" alt="{$i18n.label.files}" src="images/icon_files.png"></a></td>
+      {else}
+        <td valign="top" align="center"><a href="time_files.php?id={$record.id}"><img class="table_icon" alt="{$i18n.label.files}" src="images/icon_file.png"></a></td>
+      {/if}
+    {/if}
         <td valign="top" align="center">
     {if $record.approved || $record.timesheet_id || $record.invoice_id}
           &nbsp;
@@ -169,7 +181,7 @@ function fillDropdowns() {
 
 {if $time_records}
 <table cellpadding="3" cellspacing="1" width="720">
-  {if $user->isPluginEnabled('wvl')}
+  {if $show_week_list}
   <tr>
     <td align="left">{$i18n.label.week_total}: {$week_total}</td>
     <td></td>