Code

Handle a special case in debconf configuration
authorpsc <psc@594d385d-05f5-0310-b6e9-bd551577e9d8>
Mon, 19 Oct 2009 08:47:53 +0000 (08:47 +0000)
committerpsc <psc@594d385d-05f5-0310-b6e9-bd551577e9d8>
Mon, 19 Oct 2009 08:47:53 +0000 (08:47 +0000)
Use a text field for select fields which don't have a proper
list of choices, instead of a useless "Need some text..." choice
and show a warning about the requirements of such a field.
(Trac: #868)

git-svn-id: https://oss.gonicus.de/repositories/gosa/branches/2.6-lhm@14601 594d385d-05f5-0310-b6e9-bd551577e9d8

trunk/gosa-plugins/fai/admin/fai/class_debconfTemplate.inc
trunk/gosa-plugins/fai/locale/de/LC_MESSAGES/messages.po
trunk/gosa-plugins/fai/locale/messages.po

index bbbbbadf202cdcdc9b48333d1bf9a35d63c23b9f..2e9fca6b30ed59dea9958207e5274ef074f77d56 100644 (file)
@@ -190,7 +190,10 @@ class debconf
         if ((isset($entry['Type']))&&(isset($types[$entry['Type']]))){
 
           /* Produce type specific output */
-          $fn= "render_".$entry['Type'];
+          $entry_type = $entry['Type'];
+
+          $fn= sprintf("render_%s", $entry_type);
+
           $str = $this->$fn($entry);
           if(!empty($str)){
             $result.=$str."<tr><td colspan='2'><p class='seperator'>&nbsp;</p></td></tr>";
@@ -241,6 +244,7 @@ class debconf
   {
     $post_name= $data['post_name'];
     if (preg_match('/\$\{/', $data['Choices'])){
+      $data['Description'] .= '<br><br><b>' . _('This debconf question is dynamically generated during package installation and requires choosing between specific options which cannot be presented here. The entered text needs to be one of the valid choices in order to take effect.') . '</b>';
       $result= $this->render_string($data);
     } else {
       $choices= "";
@@ -301,37 +305,37 @@ class debconf
     $post_name= $data['post_name'];
 
     if (preg_match('/\$\{/', $data['Choices'])){
-      $choices= array("Need to use some text...");
+      $result = $this->render_multiselect($data);
     } else {
       $choices= "";
       foreach (split(", ", $data['Choices']) as $choice){
         $choices[]= $choice;
       }
-    }
 
 
-    $result="
-      
-      <tr>
-      <td valign='top'>
-      <h2>".$data['Topic']."</h2>".$data['Description']."
-      </td>
-      <td  valign='top'  style=\"white-space:nowrap; border-left: 1px solid rgb(160, 160, 160);\">
-      ";
+      $result="
+        
+        <tr>
+        <td valign='top'>
+        <h2>".$data['Topic']."</h2>".$data['Description']."
+        </td>
+        <td  valign='top'  style=\"white-space:nowrap; border-left: 1px solid rgb(160, 160, 160);\">
+        ";
 
-    foreach($choices as $value){
-      if($data['Default'] == $value){
-        $result.="\n<input type='radio' name='".$post_name."' value='".htmlentities($value)."' checked >".htmlentities($value)."<br>";
-      }else{
-        $result.="\n<input type='radio' name='".$post_name."' value='".htmlentities($value)."'>".htmlentities($value)."<br>";
+      foreach($choices as $value){
+        if($data['Default'] == $value){
+          $result.="\n<input type='radio' name='".$post_name."' value='".htmlentities($value)."' checked >".htmlentities($value)."<br>";
+        }else{
+          $result.="\n<input type='radio' name='".$post_name."' value='".htmlentities($value)."'>".htmlentities($value)."<br>";
+        }
       }
-    }
 
-    $result.= "
-      
-      </td>
-      </tr>
-      ";
+      $result.= "
+        
+        </td>
+        </tr>
+        ";
+    }
 
     return ($result);
   }
index 3f7fa1d59a613a6623eaa2f55b5fca11075bea79..a6a8c1735091281c4ad94010e05836a13a5afcd5 100644 (file)
@@ -13,7 +13,7 @@ msgid ""
 msgstr ""
 "Project-Id-Version: messages\n"
 "Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2009-10-02 16:27+0200\n"
+"POT-Creation-Date: 2009-10-16 17:38+0200\n"
 "PO-Revision-Date: 2008-12-04 11:27+0100\n"
 "Last-Translator: Cajus Pollmeier <pollmeier@gonicus.de>\n"
 "Language-Team: deutsch <de@li.org>\n"
@@ -23,8 +23,9 @@ msgstr ""
 "X-Generator: KBabel 1.11.4\n"
 
 #: admin/systems/services/repository/class_servRepository.inc:26
-#: admin/systems/services/repository/class_servRepository.inc:308
-#: admin/systems/services/repository/class_servRepository.inc:344
+#: admin/systems/services/repository/class_servRepository.inc:260
+#: admin/systems/services/repository/class_servRepository.inc:334
+#: admin/systems/services/repository/class_servRepository.inc:370
 #: admin/systems/services/repository/class_servRepositorySetup.inc:204
 msgid "Repository service"
 msgstr "Repositorien-Dienst"
@@ -94,7 +95,7 @@ msgstr "FAI Release"
 msgid "Name"
 msgstr "Name"
 
-#: admin/systems/services/repository/class_servRepository.inc:326
+#: admin/systems/services/repository/class_servRepository.inc:352
 #: admin/fai/class_faiManagement.inc:788
 #: admin/fai/class_faiPackageConfiguration.inc:35 admin/fai/class_FAI.inc:566
 #: admin/fai/class_faiPackage.inc:478 admin/fai/class_faiPackageEntry.inc:53
@@ -102,33 +103,33 @@ msgstr "Name"
 msgid "Service infrastructure"
 msgstr "Dienst-Infrastruktur"
 
-#: admin/systems/services/repository/class_servRepository.inc:343
+#: admin/systems/services/repository/class_servRepository.inc:369
 #: admin/systems/services/repository/servRepositorySetup.tpl:1
 #: admin/fai/faiPackage.tpl:33
 msgid "Repository"
 msgstr "Repository"
 
-#: admin/systems/services/repository/class_servRepository.inc:344
+#: admin/systems/services/repository/class_servRepository.inc:370
 msgid "Services"
 msgstr "Dienste"
 
-#: admin/systems/services/repository/class_servRepository.inc:357
+#: admin/systems/services/repository/class_servRepository.inc:383
 #: admin/systems/services/repository/servRepositorySetup.tpl:8
 msgid "Parent server"
 msgstr "Quell-Server"
 
-#: admin/systems/services/repository/class_servRepository.inc:358
+#: admin/systems/services/repository/class_servRepository.inc:384
 #: admin/fai/branch_selector.tpl:2
 msgid "Releases"
 msgstr "Releases"
 
-#: admin/systems/services/repository/class_servRepository.inc:359
+#: admin/systems/services/repository/class_servRepository.inc:385
 #: admin/systems/services/repository/class_servRepositorySetup.inc:157
 #: admin/systems/services/repository/servRepositorySetup.tpl:28
 msgid "URL"
 msgstr "URL"
 
-#: admin/systems/services/repository/class_servRepository.inc:360
+#: admin/systems/services/repository/class_servRepository.inc:386
 #: admin/systems/services/repository/servRepositorySetup.tpl:39
 #: admin/systems/services/repository/class_divListRepositories.inc:24
 #: admin/systems/services/repository/class_divListRepositories.inc:64
@@ -653,7 +654,9 @@ msgstr "Vorlagen-Gruppe"
 #: admin/fai/class_askClassName.inc:175
 #, php-format
 msgid "This FAI class name is already in use by the administrative unit '%s'."
-msgstr "Dieser FAI-Klassen-Name wird bereits von der administrativen Einheit '%s' verwendet."
+msgstr ""
+"Dieser FAI-Klassen-Name wird bereits von der administrativen Einheit '%s' "
+"verwendet."
 
 #: admin/fai/branch_selector.tpl:8
 msgid "Current release"
@@ -1073,10 +1076,22 @@ msgstr "Localboot-Produkte"
 msgid "List of scripts"
 msgstr "Liste der Skripte"
 
-#: admin/fai/class_debconfTemplate.inc:207
+#: admin/fai/class_debconfTemplate.inc:210
 msgid "This package has no debconf options."
 msgstr "Dieses Paket verfügt über keine debconf-Optionen."
 
+#: admin/fai/class_debconfTemplate.inc:247
+msgid ""
+"This debconf question is dynamically generated during package installation "
+"and requires choosing between specific options which cannot be presented "
+"here. The entered text needs to be one of the valid choices in order to take "
+"effect."
+msgstr ""
+"Diese Debconf-Frage wird während der Paket-Installation automatisch "
+"generiert und erfordert eine Auswahl aus Möglichkeiten, die hier nicht "
+"dargestellt werden können. Der angegebene Wert muss einer der gültigen "
+"Auswahlmöglichkeiten entsprechen."
+
 #: admin/fai/faiTemplateEntry.tpl:10 admin/fai/class_faiTemplateEntry.inc:220
 msgid "File name"
 msgstr "Dateiname"
index 54df2671a2b7c47a4474cf8132b548a45c3725e9..e4286cf39e49455083c4120b6ae130275c4433cf 100644 (file)
@@ -8,7 +8,7 @@ msgid ""
 msgstr ""
 "Project-Id-Version: PACKAGE VERSION\n"
 "Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2009-10-02 16:27+0200\n"
+"POT-Creation-Date: 2009-10-16 17:38+0200\n"
 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
 "Language-Team: LANGUAGE <LL@li.org>\n"
@@ -17,8 +17,9 @@ msgstr ""
 "Content-Transfer-Encoding: 8bit\n"
 
 #: admin/systems/services/repository/class_servRepository.inc:26
-#: admin/systems/services/repository/class_servRepository.inc:308
-#: admin/systems/services/repository/class_servRepository.inc:344
+#: admin/systems/services/repository/class_servRepository.inc:260
+#: admin/systems/services/repository/class_servRepository.inc:334
+#: admin/systems/services/repository/class_servRepository.inc:370
 #: admin/systems/services/repository/class_servRepositorySetup.inc:204
 msgid "Repository service"
 msgstr ""
@@ -88,7 +89,7 @@ msgstr ""
 msgid "Name"
 msgstr ""
 
-#: admin/systems/services/repository/class_servRepository.inc:326
+#: admin/systems/services/repository/class_servRepository.inc:352
 #: admin/fai/class_faiManagement.inc:788
 #: admin/fai/class_faiPackageConfiguration.inc:35 admin/fai/class_FAI.inc:566
 #: admin/fai/class_faiPackage.inc:478 admin/fai/class_faiPackageEntry.inc:53
@@ -96,33 +97,33 @@ msgstr ""
 msgid "Service infrastructure"
 msgstr ""
 
-#: admin/systems/services/repository/class_servRepository.inc:343
+#: admin/systems/services/repository/class_servRepository.inc:369
 #: admin/systems/services/repository/servRepositorySetup.tpl:1
 #: admin/fai/faiPackage.tpl:33
 msgid "Repository"
 msgstr ""
 
-#: admin/systems/services/repository/class_servRepository.inc:344
+#: admin/systems/services/repository/class_servRepository.inc:370
 msgid "Services"
 msgstr ""
 
-#: admin/systems/services/repository/class_servRepository.inc:357
+#: admin/systems/services/repository/class_servRepository.inc:383
 #: admin/systems/services/repository/servRepositorySetup.tpl:8
 msgid "Parent server"
 msgstr ""
 
-#: admin/systems/services/repository/class_servRepository.inc:358
+#: admin/systems/services/repository/class_servRepository.inc:384
 #: admin/fai/branch_selector.tpl:2
 msgid "Releases"
 msgstr ""
 
-#: admin/systems/services/repository/class_servRepository.inc:359
+#: admin/systems/services/repository/class_servRepository.inc:385
 #: admin/systems/services/repository/class_servRepositorySetup.inc:157
 #: admin/systems/services/repository/servRepositorySetup.tpl:28
 msgid "URL"
 msgstr ""
 
-#: admin/systems/services/repository/class_servRepository.inc:360
+#: admin/systems/services/repository/class_servRepository.inc:386
 #: admin/systems/services/repository/servRepositorySetup.tpl:39
 #: admin/systems/services/repository/class_divListRepositories.inc:24
 #: admin/systems/services/repository/class_divListRepositories.inc:64
@@ -1018,10 +1019,18 @@ msgstr ""
 msgid "List of scripts"
 msgstr ""
 
-#: admin/fai/class_debconfTemplate.inc:207
+#: admin/fai/class_debconfTemplate.inc:210
 msgid "This package has no debconf options."
 msgstr ""
 
+#: admin/fai/class_debconfTemplate.inc:247
+msgid ""
+"This debconf question is dynamically generated during package installation "
+"and requires choosing between specific options which cannot be presented "
+"here. The entered text needs to be one of the valid choices in order to take "
+"effect."
+msgstr ""
+
 #: admin/fai/faiTemplateEntry.tpl:10 admin/fai/class_faiTemplateEntry.inc:220
 msgid "File name"
 msgstr ""