Skip to content
Snippets Groups Projects
Commit 07ec37de authored by Jared Hancock's avatar Jared Hancock
Browse files

Add all contact information to user lookup popup

Previously only the name, email, and phone number would be displayed on the
pop up dialog
parent 7b853b45
Branches
Tags
No related merge requests found
<div id="the-lookup-form">
<h3><?php echo $info['title']; ?></h3>
<b><a class="close" href="#"><i class="icon-remove-circle"></i></a></b>
<hr/>
......@@ -17,6 +18,21 @@ if ($info['error']) {
id="unselect-user" href="#"><i class="icon-remove"></i> Add New User</a>
<div><strong id="user-name"><?php echo $user ? $user->getName() : ''; ?></strong></div>
<div>&lt;<span id="user-email"><?php echo $user ? $user->getEmail() : ''; ?></span>&gt;</div>
<?php if ($user) { ?>
<table style="margin-top: 1em;">
<?php foreach ($user->getDynamicData() as $entry) { ?>
<tr><td colspan="2" style="border-bottom: 1px dotted black"><strong><?php
echo $entry->getForm()->get('title'); ?></strong></td></tr>
<?php foreach ($entry->getAnswers() as $a) { ?>
<tr style="vertical-align:top"><td style="width:30%;border-bottom: 1px dotted #ccc"><?php echo Format::htmlchars($a->getField()->get('label'));
?>:</td>
<td style="border-bottom: 1px dotted #ccc"><?php echo $a->toString(); ?></td>
</tr>
<?php }
}
?>
</table>
<?php } ?>
<div class="clear"></div>
<hr>
<p class="full-width">
......@@ -49,6 +65,7 @@ if ($info['error']) {
</form>
</div>
<div class="clear"></div>
</div>
<script type="text/javascript">
$(function() {
$('#user-search').typeahead({
......@@ -62,12 +79,9 @@ $(function() {
});
},
onselect: function (obj) {
$('#user-name').text(obj.name);
$('#user-email').text(obj.email);
$('#user-id').val(obj.id);
$('div#selected-user-info').show();
$('div#new-user-form').hide();
$('#user-search').val('');
$('#the-lookup-form').load(
"ajax.php/users/select/"+obj.id
);
},
property: "/bin/true"
});
......
......@@ -22,7 +22,20 @@ if ($info['error']) {
<div><b><a href="#" id="edituser"><i class="icon-edit"></i>&nbsp;<?php
echo $user->getName(); ?></a></b></div>
<div>&lt;<?php echo $user->getEmail(); ?>&gt;</div>
<div><?php echo $user->getPhoneNumber(); ?></div>
<table style="margin-top: 1em;">
<?php foreach ($user->getDynamicData() as $entry) {
?>
<tr><td colspan="2" style="border-bottom: 1px dotted black"><strong><?php
echo $entry->getForm()->get('title'); ?></strong></td></tr>
<?php foreach ($entry->getAnswers() as $a) { ?>
<tr style="vertical-align:top"><td style="width:30%;border-bottom: 1px dotted #ccc"><?php echo Format::htmlchars($a->getField()->get('label'));
?>:</td>
<td style="border-bottom: 1px dotted #ccc"><?php echo $a->toString(); ?></td>
</tr>
<?php }
}
?>
</table></div>
<div class="clear"></div>
<hr>
<div class="faded">Last updated <b><?php echo Format::db_datetime($user->getUpdateDate()); ?> </b></div>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment