echo '<div style="float: right;"><a href="reservation.php">' . Display::return_icon('sessions.gif', get_lang('BookingCalendarView')) . ' ' . get_lang('GoToCalendarView') . '</a></div>'; echo '<a href="m_item.php?view=list">' . Display::return_icon('cube.png', get_lang('Resources')) . ' ' . get_lang('Resources') . '</a>'; echo ' <a href="m_reservation.php?view=list">' . Display::return_icon('calendar_day.gif', get_lang('BookingPeriods')) . ' ' . get_lang('BookingPeriods') . '</a>'; echo ' <a href="m_reservation.php?action=add&view=list">' . Display::return_icon('calendar_add.gif', get_lang('BookIt')) . ' ' . get_lang('BookIt') . '</a>'; if (api_is_platform_admin()) { //echo ' <a href="m_category.php">'.Display::return_icon('settings.gif',get_lang('Configuration')).' '.get_lang('Configuration').'</a>'; } echo '</div><br />'; } if (isset($_POST['action'])) { switch ($_POST['action']) { case 'delete_subscriptions': $ids = $_POST['subscriptions']; if (count($ids) > 0) { foreach ($ids as $id) { Rsys::delete_subscription(substr($id, 0, strpos($id, '-')), substr($id, strrpos($id, '-') + 1)); } } break; } } $table = new SortableTable('subscription', array('Rsys', 'get_num_subscriptions'), array('Rsys', 'get_table_subscriptions'), 2); $table->set_header(0, '', false, array('style' => 'width:10px')); $table->set_header(1, get_lang('ResourceName'), true); $table->set_header(2, get_lang('StartDate'), true); $table->set_header(3, get_lang('EndDate'), true); $table->set_header(4, get_lang('Accept'), true); $table->set_header(5, get_lang('Modify'), false, array('style' => 'width:50px;')); $table->set_column_filter(5, 'modify_filter'); $table->set_form_actions(array('delete_subscriptions' => get_lang('DeleteSelectedSubscriptions')), 'subscriptions'); $table->display();
$table->set_header(4, get_lang('SubscribedPerson'), true); $table->set_header(5, get_lang('SubscribedStartDate'), true); $table->set_header(6, get_lang('SubscribedEndDate'), true); $table->set_header(7, get_lang('Accept'), true); $table->display(); break; case 'accept': $NoSearchResults = get_lang('NoReservation'); if (empty($_GET['rid'])) { $_GET['rid'] = $_POST['rid']; } if ($_GET['switch'] == 'edit') { Rsys::set_accepted($_GET['dummy'], $_GET['set']); } if ($_GET['switch'] == 'delete') { Rsys::delete_subscription($_GET['rid'], $_GET['dummy']); } $interbreadcrumb[] = array("url" => "mysubscriptions.php", "name" => get_lang('Booking')); $interbreadcrumb[] = array("url" => "m_reservation.php", "name" => get_lang('ManageBookingPeriods')); Display::display_header(get_lang('AutoAccept')); api_display_tool_title(get_lang('AutoAccept')); $table = new SortableTable('accepting', array('Rsys', 'get_num_waiting_users'), array('Rsys', 'get_table_waiting_users'), 1); $table->set_additional_parameters(array('rid' => $_GET['rid'], 'action' => 'accept')); $table->set_header(0, '', false, array('style' => 'width:10px')); $table->set_header(1, get_lang('SubscribedPerson'), true); $table->set_header(2, get_lang('Class'), true); $table->set_header(3, get_lang('SubscribedStartDate'), false); $table->set_header(4, get_lang('SubscribedEndDate'), false); $table->set_header(5, get_lang('Accept'), false, array('style' => 'width:30px;')); $table->set_header(6, get_lang('Delete'), false, array('style' => 'width:30px;')); $table->set_form_actions(array('accept_users' => get_lang('AcceptUsers'), 'unaccept_users' => get_lang('UnacceptedUsers'), 'delete_subscriptions' => get_lang('DeleteSubscriptions')), 'accepting');