Update PlTableEditor field display (Closes #1505)
authorRaphaël Barrois <raphael.barrois@polytechnique.org>
Sun, 26 Jun 2011 22:24:07 +0000 (00:24 +0200)
committerRaphaël Barrois <raphael.barrois@polytechnique.org>
Sun, 26 Jun 2011 22:25:32 +0000 (00:25 +0200)
Most of these updates are simply clarifying the 'item' behaviour when 'display_list' is false.

Signed-off-by: Raphaël Barrois <raphael.barrois@polytechnique.org>
modules/admin.php
modules/auth.php
modules/events.php
modules/newsletter.php
modules/openid.php
modules/payment.php
modules/profile.php

index 6a61466..b9e9b18 100644 (file)
@@ -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);
     }
 
index 88a1e9d..f302f1b 100644 (file)
@@ -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);
index 96a80dd..3c4df28 100644 (file)
@@ -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);
index 0f57706..149e27b 100644 (file)
@@ -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);
index 395313b..49b08c1 100644 (file)
@@ -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);
index bd6139b..06efdb8 100644 (file)
@@ -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');
index 9333997..954753e 100644 (file)
@@ -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') {