From 5d617d8d3d0258d8e810ebd622c9f45c3193037b Mon Sep 17 00:00:00 2001 From: x2001corpet Date: Thu, 30 Nov 2006 22:46:23 +0000 Subject: [PATCH] ajout de checkbox dans les table editor pour les champs set unique + flag actif pour les tips git-svn-id: svn+ssh://murphy/home/svn/platal/trunk@1214 839d8a87-29fc-0310-9880-83ba4fa771e5 --- modules/events.php | 2 ++ templates/table-editor.tpl | 4 ++++ upgrade/0.9.13/01_tips.sql | 1 + 3 files changed, 7 insertions(+) diff --git a/modules/events.php b/modules/events.php index 36451f4..c4933f7 100644 --- a/modules/events.php +++ b/modules/events.php @@ -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); diff --git a/templates/table-editor.tpl b/templates/table-editor.tpl index c4b376d..4c6b7d6 100644 --- a/templates/table-editor.tpl +++ b/templates/table-editor.tpl @@ -58,6 +58,8 @@ {/if} {if $myval.Type eq 'timestamp'} {$myrow.$myfield|date_format:"%x %X"} + {elseif $myval.Type eq 'checkbox'} + {else} {$myrow.$myfield} {/if} @@ -115,6 +117,8 @@ {elseif ($myval.Type eq 'textarea') or ($myval.Type eq 'varchar200')} + {elseif ($myval.Type eq 'checkbox')} + {else} {if $myval.Type eq 'timestamp'}jj/mm/aaaa hh:mm:ss{/if} diff --git a/upgrade/0.9.13/01_tips.sql b/upgrade/0.9.13/01_tips.sql index 933bf73..d9c68ca 100644 --- a/upgrade/0.9.13/01_tips.sql +++ b/upgrade/0.9.13/01_tips.sql @@ -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) ); -- 2.1.4