diff --git a/include/staff/templates/user-lookup.tmpl.php b/include/staff/templates/user-lookup.tmpl.php index de8dedb4e79b8d513dedf64c5134d6f1a579f783..74508a023ba86fcbd9e2b69cc98b7193dcdf054d 100644 --- a/include/staff/templates/user-lookup.tmpl.php +++ b/include/staff/templates/user-lookup.tmpl.php @@ -1,3 +1,4 @@ +<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><<span id="user-email"><?php echo $user ? $user->getEmail() : ''; ?></span>></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" }); diff --git a/include/staff/templates/user.tmpl.php b/include/staff/templates/user.tmpl.php index 43176c79609fce7b6da36bc1ff340e3ed414d466..aaf0cdedbfdd7ea6409c0f5b4d49aba014d2c792 100644 --- a/include/staff/templates/user.tmpl.php +++ b/include/staff/templates/user.tmpl.php @@ -22,7 +22,20 @@ if ($info['error']) { <div><b><a href="#" id="edituser"><i class="icon-edit"></i> <?php echo $user->getName(); ?></a></b></div> <div><<?php echo $user->getEmail(); ?>></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>