ajout de checkbox dans les table editor pour les champs set unique + flag actif pour...
authorx2001corpet <x2001corpet@839d8a87-29fc-0310-9880-83ba4fa771e5>
Thu, 30 Nov 2006 22:46:23 +0000 (22:46 +0000)
committerx2001corpet <x2001corpet@839d8a87-29fc-0310-9880-83ba4fa771e5>
Thu, 30 Nov 2006 22:46:23 +0000 (22:46 +0000)
git-svn-id: svn+ssh://murphy/home/svn/platal/trunk@1214 839d8a87-29fc-0310-9880-83ba4fa771e5

modules/events.php
templates/table-editor.tpl
upgrade/0.9.13/01_tips.sql

index 36451f4..c4933f7 100644 (file)
@@ -59,6 +59,7 @@ class EventsModule extends PLModule
                                        AND (promo_min = 0 OR promo_min <= {?})
                                        AND (promo_max = 0 OR promo_max >= {?})
                                        AND (priorite >= {?})
+                                       AND (state = 'active')
                                        $exclude
                              ORDER BY  RAND()
                                 LIMIT  1",
@@ -244,6 +245,7 @@ class EventsModule extends PLModule
         $table_editor->describe('promo_min', 'promo. min (0 aucune)', false);
         $table_editor->describe('promo_max', 'promo. max (0 aucune)', false);
         $table_editor->describe('titre', 'titre', true);
+        $table_editor->describe('state', 'actif', true);
         $table_editor->describe('text', 'texte (html) de l\'astuce', false);
         $table_editor->describe('priorite', 'priorité (0=min, 256=max)', false);
         $table_editor->apply($page, $action, $id);
index c4b376d..4c6b7d6 100644 (file)
@@ -58,6 +58,8 @@
     {/if}
     {if $myval.Type eq 'timestamp'}
       <span class="smaller">{$myrow.$myfield|date_format:"%x %X"}</span>
+    {elseif $myval.Type eq 'checkbox'}
+      <input type="checkbox" disabled="disabled"{if $myrow.$myfield} checked="checked"{/if}/>
     {else}
       {$myrow.$myfield}
     {/if}
           </select>
         {elseif ($myval.Type eq 'textarea') or ($myval.Type eq 'varchar200')}
           <textarea name="{$myfield}" rows="{if $myval.Type eq 'varchar200'}3{else}10{/if}" cols="70">{$entry.$myfield}</textarea>
+        {elseif ($myval.Type eq 'checkbox')}
+          <input type="checkbox" name="{$myfield}" value="{$myval.Value}"{if $entry.$myfield} checked="checked"{/if}/>
         {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}
index 933bf73..d9c68ca 100644 (file)
@@ -6,6 +6,7 @@ create table tips (
     peremption date not null default '0000-00-00',
     promo_min smallint(4) unsigned not null default 0,
     promo_max smallint(4) unsigned not null default 0,
+    active set('active') not null default 'active',
 
     primary key (id)
 );