Esempio n. 1
0
/**
 * Shows all bookings made by one person.
 */
function em_bookings_person()
{
    global $EM_Person;
    ?>
	<div class='wrap'>
		<div id='icon-users' class='icon32'>
			<br/>
		</div>
  		<h2>
  			<?php 
    _e('Manage Person\'s Booking', 'dbem');
    ?>
  			<a href="admin.php?page=events-manager-bookings&action=person_delete&person_id=<?php 
    echo $EM_Person->id;
    ?>
" onclick="if( !confirm('<?php 
    _e('Are you sure you want to delete this person? All bookings corresponding to this person will be deleted and this is not reversible.', 'dbem');
    ?>
') ){ return false; }" class="button add-new-h2"><?php 
    _e('Delete Person', 'dbem');
    ?>
</a>
  		</h2>
  		<div id="poststuff" class="metabox-holder has-right-sidebar">
	  		<div id="post-body">
				<div id="post-body-content">
					<div id="event_name" class="stuffbox">
						<h3>
							<?php 
    _e('Personal Details', 'dbem');
    ?>
						</h3>
						<div class="inside">
							<?php 
    em_person_edit_form();
    ?>
						</div>
					</div> 
				</div>
			</div>
		</div>
		<br style="clear:both;" />
		<h3><?php 
    _e('Past And Present Bookings', 'dbem');
    ?>
</h3>
		<?php 
    em_bookings_person_table();
    ?>
	</div>
	<?php 
}
Esempio n. 2
0
/**
 * Shows all bookings made by one person.
 */
function em_bookings_person()
{
    global $EM_Person, $EM_Notices;
    $EM_Person->get_bookings();
    $has_booking = false;
    foreach ($EM_Person->get_bookings() as $EM_Booking) {
        if ($EM_Booking->can_manage('manage_bookings', 'manage_others_bookings')) {
            $has_booking = true;
        }
    }
    if (!$has_booking) {
        ?>
		<div class="wrap"><h2><?php 
        _e('Unauthorized Access', 'dbem');
        ?>
</h2><p><?php 
        _e('You do not have the rights to manage this event.', 'dbem');
        ?>
</p></div>
		<?php 
        return false;
    }
    ?>
	<div class='wrap'>
		<div id='icon-users' class='icon32'>
			<br/>
		</div>
  		<h2>
  			<?php 
    _e('Manage Person\'s Booking', 'dbem');
    ?>
  			<?php 
    if (current_user_can('edit_users')) {
        ?>
  			<a href="user-edit.php?user_id=<?php 
        echo $EM_Person->ID;
        ?>
" class="button add-new-h2"><?php 
        _e('Edit User', 'dbem');
        ?>
</a>
  			<?php 
    }
    ?>
  		</h2>
  		<?php 
    echo $EM_Notices;
    ?>
		<?php 
    do_action('em_bookings_person_header');
    ?>
  		<div id="poststuff" class="metabox-holder has-right-sidebar">
	  		<div id="post-body">
				<div id="post-body-content">
					<div id="event_name" class="stuffbox">
						<h3>
							<?php 
    _e('Personal Details', 'dbem');
    ?>
						</h3>
						<div class="inside">
							<?php 
    echo $EM_Person->display_summary();
    ?>
						</div>
					</div> 
				</div>
			</div>
		</div>
		<br style="clear:both;" />
		<?php 
    do_action('em_bookings_person_body_1');
    ?>
		<h3><?php 
    _e('Past And Present Bookings', 'dbem');
    ?>
</h3>
		<?php 
    em_bookings_person_table();
    ?>
		<?php 
    do_action('em_bookings_person_footer', $EM_Person);
    ?>
	</div>
	<?php 
}