Removes empty section and adds unique key on section names.
authorStéphane Jacob <sj@m4x.org>
Tue, 1 Jun 2010 10:04:46 +0000 (12:04 +0200)
committerStéphane Jacob <sj@m4x.org>
Tue, 1 Jun 2010 10:04:46 +0000 (12:04 +0200)
Signed-off-by: Stéphane Jacob <sj@m4x.org>
templates/profile/groups.tpl
upgrade/account/05_section.sql [new file with mode: 0644]

index 541ebb8..116f1f3 100644 (file)
@@ -34,7 +34,7 @@
     <td class="titre" style="width: 30%">{if $old}ex-{/if}Section</td>
     <td>
       <select name="section">
-        {select_db_table table="profile_section_enum" valeur=$section}
+        {select_db_table table="profile_section_enum" valeur=$section pad="1"}
       </select>
     </td>
   </tr>
@@ -43,7 +43,7 @@
     <td class="titre">{if $old}ex-{/if}Binet(s)</td>
     <td>
       <select name="binets_sel" onchange="updateElement('binets')">
-        {select_db_table table="profile_binet_enum" valeur=0 champ="text" pad='1'}
+        {select_db_table table="profile_binet_enum" valeur=0 champ="text" pad="1"}
       </select>
       <a id="binets_add" style="display: none"
          href="javascript:addBinet()">{icon name="add" title="Ajouter ce binet"}</a>
diff --git a/upgrade/account/05_section.sql b/upgrade/account/05_section.sql
new file mode 100644 (file)
index 0000000..5268d94
--- /dev/null
@@ -0,0 +1,4 @@
+DELETE FROM profile_section_enum WHERE text = '';
+ALTER TABLE profile_section_enum ADD UNIQUE KEY (text);
+
+# vim:set syntax=mysql: