Fix displaying form if only one address book is available.
authorJan Schneider <jan@horde.org>
Wed, 18 Aug 2010 10:35:11 +0000 (12:35 +0200)
committerJan Schneider <jan@horde.org>
Wed, 18 Aug 2010 10:35:11 +0000 (12:35 +0200)
turba/templates/search/duplicate.html.php

index 7fe1cf4..826deb5 100644 (file)
@@ -1,11 +1,14 @@
-<?php if (count($this->addressBooks) > 1): ?>
 <strong><label for="source"><?php echo _("Search duplicates in:") ?></label></strong>
+<?php if (count($this->addressBooks) > 1): ?>
 <select id="turbaSearchSource" name="source">
   <?php foreach ($this->addressBooks as $key => $entry): ?>
   <option<?php echo $key == $this->source ? ' selected="selected"' : '' ?> value="<?php echo $key ?>"><?php echo $this->h($entry['title']) ?></option>
   <?php endforeach; ?>
 </select>
-<input class="button" type="submit" name="search" value="<?php echo _("Search") ?>" />
+<?php else: ?>
+<?php echo $this->h($this->addressBooks[key($this->addressBooks)]['title']) ?>
+<input type="hidden" name="source" value="<?php echo key($this->addressBooks) ?>" />
 <?php endif; ?>
+<input class="button" type="submit" name="search" value="<?php echo _("Search") ?>" />
 </form>
 </div>