From 47f517897206a0b953214f19b96a42f2707fc107 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Rapha=C3=ABl=20Barrois?= Date: Mon, 27 Jun 2011 00:24:07 +0200 Subject: [PATCH] Update PlTableEditor field display (Closes #1505) MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Most of these updates are simply clarifying the 'item' behaviour when 'display_list' is false. Signed-off-by: Raphaël Barrois --- modules/admin.php | 14 +++++++------- modules/auth.php | 2 +- modules/events.php | 6 +++--- modules/newsletter.php | 2 +- modules/openid.php | 6 ++++-- modules/payment.php | 12 ++++++------ modules/profile.php | 6 +++--- 7 files changed, 25 insertions(+), 23 deletions(-) diff --git a/modules/admin.php b/modules/admin.php index 6a61466..b9e9b18 100644 --- a/modules/admin.php +++ b/modules/admin.php @@ -1161,7 +1161,7 @@ class AdminModule extends PLModule $table_editor = new PLTableEditor('admin/validate/answers','requests_answers','id'); $table_editor->describe('category','catégorie',true); $table_editor->describe('title','titre',true); - $table_editor->describe('answer','texte',false); + $table_editor->describe('answer','texte',false, true); $table_editor->apply($page, $action, $id); } @@ -1172,10 +1172,10 @@ class AdminModule extends PLModule $table_editor = new PLTableEditor('admin/skins','skins','id'); $table_editor->describe('name','nom',true); $table_editor->describe('skin_tpl','nom du template',true); - $table_editor->describe('auteur','auteur',false); + $table_editor->describe('auteur','auteur',false, true); $table_editor->describe('comment','commentaire',true); - $table_editor->describe('date','date',false); - $table_editor->describe('ext','extension du screenshot',false); + $table_editor->describe('date','date',false, true); + $table_editor->describe('ext','extension du screenshot',false, true); $table_editor->apply($page, $action, $id); } @@ -1205,7 +1205,7 @@ class AdminModule extends PLModule $table_editor = new PLTableEditor('admin/mx/broken', 'mx_watch', 'host', true); $table_editor->describe('host', 'Masque', true); $table_editor->describe('state', 'Niveau', true); - $table_editor->describe('text', 'Description du problème', false); + $table_editor->describe('text', 'Description du problème', false, true); $table_editor->apply($page, $action, $id); } @@ -1225,10 +1225,10 @@ class AdminModule extends PLModule $page->assign('title', 'Gestion des coupures'); $table_editor = new PLTableEditor('admin/downtime','downtimes','id'); $table_editor->describe('debut','date',true); - $table_editor->describe('duree','durée',false); + $table_editor->describe('duree','durée',false, true); $table_editor->describe('resume','résumé',true); $table_editor->describe('services','services affectés',true); - $table_editor->describe('description','description',false); + $table_editor->describe('description','description',false, true); $table_editor->apply($page, $action, $id); } diff --git a/modules/auth.php b/modules/auth.php index 88a1e9d..f302f1b 100644 --- a/modules/auth.php +++ b/modules/auth.php @@ -167,7 +167,7 @@ class AuthModule extends PLModule $page->assign('title', 'Gestion de l\'authentification centralisée'); $table_editor = new PLTableEditor('admin/auth-groupes-x','group_auth','id'); $table_editor->describe('name','nom',true); - $table_editor->describe('privkey','clé privée',false); + $table_editor->describe('privkey','clé privée',false, true); $table_editor->describe('datafields','champs renvoyés',true); $table_editor->describe('returnurls','urls de retour',true); $table_editor->describe('last_used', 'dernière utilisation', true); diff --git a/modules/events.php b/modules/events.php index 96a80dd..3c4df28 100644 --- a/modules/events.php +++ b/modules/events.php @@ -315,11 +315,11 @@ class EventsModule extends PLModule $page->assign('title', 'Gestion des Astuces'); $table_editor = new PLTableEditor('admin/tips', 'reminder_tips', 'id'); $table_editor->describe('expiration', 'date de péremption', true); - $table_editor->describe('promo_min', 'promo. min (0 aucune)', false); - $table_editor->describe('promo_max', 'promo. max (0 aucune)', false); + $table_editor->describe('promo_min', 'promo. min (0 aucune)', false, true); + $table_editor->describe('promo_max', 'promo. max (0 aucune)', false, true); $table_editor->describe('title', 'titre', true); $table_editor->describe('state', 'actif', true); - $table_editor->describe('text', 'texte (html) de l\'astuce', false); + $table_editor->describe('text', 'texte (html) de l\'astuce', false, true); $table_editor->describe('priority', '0<=priorité<=255', true); $table_editor->list_on_edit(false); $table_editor->apply($page, $action, $id); diff --git a/modules/newsletter.php b/modules/newsletter.php index 0f57706..149e27b 100644 --- a/modules/newsletter.php +++ b/modules/newsletter.php @@ -451,7 +451,7 @@ class NewsletterModule extends PLModule $table_editor->describe('nlid', 'ID NL', true); } else { $table_editor->force_field_value('nlid', $nl->id); - $table_editor->describe('nlid', 'nlid', false); + $table_editor->describe('nlid', 'nlid', false, false); } // Prevent deletion. $table_editor->on_delete(null, null); diff --git a/modules/openid.php b/modules/openid.php index 395313b..49b08c1 100644 --- a/modules/openid.php +++ b/modules/openid.php @@ -209,7 +209,8 @@ class OpenidModule extends PLModule $page->assign('title', 'Mes sites tiers de confiance pour OpenId'); $table_editor = new PLTableEditor('openid/trusted', 'account_auth_openid', 'id'); $table_editor->set_where_clause(XDB::format('uid = {?}', S::user()->id())); - $table_editor->vars['uid']['display'] = false; + $table_editor->vars['uid']['display_list'] = false; + $table_editor->vars['uid']['display_item'] = false; $table_editor->describe('url', 'site tiers', true); $page->assign('deleteonly', true); $table_editor->apply($page, $action, $id); @@ -221,7 +222,8 @@ class OpenidModule extends PLModule $page->assign('title', 'Sites tiers de confiance globaux pour OpenId'); $table_editor = new PLTableEditor('admin/openid/trusted', 'account_auth_openid', 'id'); $table_editor->set_where_clause('uid IS NULL'); - $table_editor->vars['uid']['display'] = false; + $table_editor->vars['uid']['display_list'] = false; + $table_editor->vars['uid']['display_item'] = false; $table_editor->describe('url', 'site tiers', true); $page->assign('readonly', true); $table_editor->apply($page, $action, $id); diff --git a/modules/payment.php b/modules/payment.php index bd6139b..06efdb8 100644 --- a/modules/payment.php +++ b/modules/payment.php @@ -552,12 +552,12 @@ class PaymentModule extends PLModule $table_editor->add_sort_field('id', true, true); $table_editor->on_delete("UPDATE payments SET flags = 'old' WHERE id = {?}", "Le paiement a été archivé"); $table_editor->describe('text', 'intitulé', true); - $table_editor->describe('url', 'site web', false); - $table_editor->describe('amount_def', 'montant par défaut', false); - $table_editor->describe('amount_min', 'montant minimum', false); - $table_editor->describe('amount_max', 'montant maximum', false); + $table_editor->describe('url', 'site web', false, true); + $table_editor->describe('amount_def', 'montant par défaut', false, true); + $table_editor->describe('amount_min', 'montant minimum', false, true); + $table_editor->describe('amount_max', 'montant maximum', false, true); $table_editor->describe('mail', 'email contact', true); - $table_editor->describe('confirmation', 'message confirmation', false); + $table_editor->describe('confirmation', 'message confirmation', false, true); // adds a column with the start date of the linked event if there is one $table_editor->add_option_table('group_events', 'group_events.paiement_id = t.id'); @@ -586,7 +586,7 @@ class PaymentModule extends PLModule $page->assign('title', "Liste des RIBs"); $table_editor = new PLTableEditor('admin/payments/bankaccounts', 'payment_bankaccounts', 'id'); - $table_editor->describe('asso_id', 'ID du groupe', false); + $table_editor->describe('asso_id', 'ID du groupe', false, false); $table_editor->describe('owner', 'titulaire', true); $table_editor->add_option_table('groups', 'groups.id = t.asso_id'); $table_editor->add_option_field('groups.diminutif', 'group_name', 'groupe', 'varchar','account'); diff --git a/modules/profile.php b/modules/profile.php index 9333997..954753e 100644 --- a/modules/profile.php +++ b/modules/profile.php @@ -715,7 +715,7 @@ class ProfileModule extends PLModule $table_editor->add_join_table('profile_education', 'eduid', true); $table_editor->add_join_table('profile_education_degree', 'eduid', true); $table_editor->describe('name', 'intitulé', true); - $table_editor->describe('url', 'site web', false); + $table_editor->describe('url', 'site web', false, true); $table_editor->apply($page, $action, $id); } function handler_admin_education_field($page, $action = 'list', $id = null) { @@ -763,7 +763,7 @@ class ProfileModule extends PLModule $page->assign('title', 'Gestion des types de networking'); $table_editor = new PLTableEditor('admin/networking', 'profile_networking_enum', 'nwid'); $table_editor->describe('name', 'intitulé', true); - $table_editor->describe('icon', 'nom de l\'icône', false); + $table_editor->describe('icon', 'nom de l\'icône', false, true); $table_editor->describe('filter', 'filtre', true); $table_editor->describe('link', 'lien web', true); $table_editor->apply($page, $action, $id); @@ -790,7 +790,7 @@ class ProfileModule extends PLModule $page->assign('title', 'Gestion des Distinctions'); $table_editor = new PLTableEditor('admin/medals','profile_medal_enum','id'); $table_editor->describe('text', 'intitulé', true); - $table_editor->describe('img', 'nom de l\'image', false); + $table_editor->describe('img', 'nom de l\'image', false, true); $table_editor->describe('flags', 'valider', true); $table_editor->apply($page, $action, $id); if ($id && $action == 'edit') { -- 2.1.4