Prevents a few warnings in validation page.
authorStéphane Jacob <sj@m4x.org>
Sat, 18 Sep 2010 15:04:32 +0000 (17:04 +0200)
committerStéphane Jacob <sj@m4x.org>
Sat, 18 Sep 2010 15:04:32 +0000 (17:04 +0200)
Signed-off-by: Stéphane Jacob <sj@m4x.org>
modules/admin.php
templates/admin/validation.tpl

index c8b57bc..122492b 100644 (file)
@@ -1010,13 +1010,14 @@ class AdminModule extends PLModule
     {
         $page->changeTpl('admin/validation.tpl');
         $page->setTitle('Administration - Valider une demande');
-                $page->addCssLink('nl.css');
+        $page->addCssLink('nl.css');
         $page->addJsLink('ajax.js');
-        require_once("validations.inc.php");
+        require_once 'validations.inc.php';
 
-
-        if ($action == 'edit' and !is_null($id)) {
+        if ($action == 'edit' && !is_null($id)) {
             $page->assign('preview_id', $id);
+        } else {
+            $page->assign('preview_id', null);
         }
 
         if(Env::has('uid') && Env::has('type') && Env::has('stamp')) {
index 8c0cb21..1ac43ff 100644 (file)
@@ -37,7 +37,7 @@ function toggleField(name, id, obj) {
 
 {iterate item=valid from=$vit}
 {assign var=type value=$valid->type}
-{if !$hide_requests[$type]}
+{if !t($hide_requests[$type])}
 <br />
 <table class="bicol">
   <tr>
@@ -192,7 +192,7 @@ function toggleField(name, id, obj) {
 
 <form action="admin/validate" method="post">
   {foreach from=$categories item=type}
-    <div style="float:left;width:33%"><input type="checkbox" name="{$type}" id="hide_{$type}"{if !$hide_requests[$type]} checked="checked"{/if}/>
+    <div style="float:left;width:33%"><input type="checkbox" name="{$type}" id="hide_{$type}"{if !t($hide_requests[$type])} checked="checked"{/if}/>
     <label for="hide_{$type}">{$type}</label></div>
   {/foreach}
   <div class="center" style="clear:left"><input type="submit" name="hide" value="Valider" /></div>