Idiot proof dialog ;-)
This commit is contained in:
parent
ad5aa5ac15
commit
2ad93849ab
|
@ -302,7 +302,7 @@ Contacts={
|
|||
modal: true, height: 'auto', width: 'auto',
|
||||
buttons: {
|
||||
'Ok':function() {
|
||||
Contacts.UI.Card.add(';;;;;', '',$('#selectaddressbook_dialog').find('select').val(), true);
|
||||
Contacts.UI.Card.add(';;;;;', '',$('#selectaddressbook_dialog').find('input:checked').val(), true);
|
||||
$(this).dialog('close');
|
||||
},
|
||||
'Cancel':function() { $(this).dialog('close'); }
|
||||
|
|
|
@ -1,10 +1,17 @@
|
|||
<div id="selectaddressbook_dialog" title="<?php echo $l->t("Select Address Books"); ?>">
|
||||
<form>
|
||||
<select id="adr_type" name="parameters[ADR][TYPE]" size="1">
|
||||
<?php foreach($_['addressbooks'] as $addressbook) { ?>
|
||||
<option value="<?php echo $addressbook['id']; ?>"><?php echo $addressbook['name']; ?></option>
|
||||
<table>
|
||||
<?php foreach($_['addressbooks'] as $idx => $addressbook) { ?>
|
||||
<tr>
|
||||
<td>
|
||||
<input id="book_<?php echo $addressbook['id']; ?>" name="book" type="radio" value="<?php echo $addressbook['id']; ?>" <?php echo ($idx==0?'checked="checked"':'')?>>
|
||||
</td>
|
||||
<td>
|
||||
<label for="book_<?php echo $addressbook['id']; ?>"><?php echo $addressbook['name']; ?></label>
|
||||
</td>
|
||||
</tr>
|
||||
<?php } ?>
|
||||
</select>
|
||||
</table>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
|
|
Loading…
Reference in New Issue