Prints last marketing date on the validation page for a marketing proposal
[platal.git] / templates / table-editor.tpl
index 392c55a..c4b376d 100644 (file)
 {**************************************************************************}
 
 
-
 <h1>{$title}</h1>
 
 {if $list}
-
+<script type="text/javascript">
+       {literal}
+       function redirect(a) {
+               document.location = a;
+       }
+       {/literal}
+</script>
 <table class="bicol">
 <tr>
-  {foreach from=$t->vars item=myval}{if $myval.display}
-    <th>{$myval.desc}</th>
+  {foreach from=$t->vars item=myval key=myvar}{if $myval.display}
+    <th style="cursor:pointer" onclick="redirect('{$t->pl}/sort{if $t->sortfield eq $myvar && !$t->sortdesc}desc{/if}/{$myvar}')">{$myval.desc}{if $t->sortfield eq $myvar}{if $t->sortdesc}{icon name="bullet_arrow_down"}{else}{icon name="bullet_arrow_up"}{/if}{/if}</th>
   {/if}{/foreach}
   {if !$hideactions}
   <th>action</th>
@@ -72,8 +77,8 @@
 
 {if ($p_prev > -1) || ($p_next > -1)}
 <p class="pagenavigation">
-{if $p_prev > -1}<a href="{$smarty.request.PHP_SELF}?start={$p_prev}">{$msg_previous_page}</a>&nbsp;{/if}
-{if $p_next > -1}<a href="{$smarty.request.PHP_SELF}?start={$p_next}">{$msg_next_page}</a>{/if}
+{if $p_prev > -1}<a href="{$platal->path}?start={$p_prev}">{$msg_previous_page}</a>&nbsp;{/if}
+{if $p_next > -1}<a href="{$platal->path}?start={$p_next}">{$msg_next_page}</a>{/if}
 </p>
 {/if}
 
         {elseif $myval.Type eq 'enum'}
           <select name="{$myfield}">
             {foreach from=$myval.List item=option}
-              <option value="{$option}" {if $entry.$myfield.$option}selected="selected"{/if}>{$option}</option>
+              <option value="{$option}" {if $entry.$myfield eq $option}selected="selected"{/if}>{$option}</option>
             {/foreach}
           </select>
         {elseif ($myval.Type eq 'textarea') or ($myval.Type eq 'varchar200')}
         {else}
           <input type="text" name="{$myfield}" value="{$entry.$myfield}" {if $myval.Size}size="{$myval.Size}" maxlength="{$myval.Maxlength}"{/if}/>
           {if $myval.Type eq 'timestamp'}<em>jj/mm/aaaa hh:mm:ss</em>{/if}
+          {if $myval.Type eq 'date'}<em>jj/mm/aaaa</em>{/if}
           {if $myval.Type eq 'time'}<em>hh:mm:ss</em>{/if}
         {/if}
       </td>