/** * Check if item has been selected via the dynamic report interface * * Data is stored in the session and updated via AJAX * * @access public * @param string $type 'notification' or 'template' * @param integer $id Optional facetoface id * @param object $item Item * @return bool */ function facetoface_is_report_item_selected($type, $id = null, $item) { // Check to see if selected if (facetoface_get_selected_report_items($type, $id, array($item))) { return true; } else { return false; } }
if (in_array($data->bulk_update, array('set_active', 'set_inactive'))) { // Perform bulk action // Get all notifications $notifications = $DB->get_records_sql( 'SELECT id, status FROM {facetoface_notification} WHERE facetofaceid = ?', array($facetoface->id)); if (!empty($notifications)) { $selected = facetoface_get_selected_report_items('notification', $update, $notifications); foreach ($selected as $item) { $notification = new facetoface_notification(array('id' => $item->id), true); $notification->status = $data->bulk_update == 'set_active' ? 1 : 0; $notification->update(); } } } facetoface_reset_selected_report_items('notification', $update); redirect($redirectto); } $streditinga = get_string('editinga', 'moodle', 'facetoface'); $strmodulenameplural = get_string('modulenameplural', 'facetoface');
set_notification(get_string('roomdeleted', 'facetoface'), $redirectto, array('class' => 'notifysuccess')); } // Check for form submission if (($data = data_submitted()) && !empty($data->bulk_update)) { // Check sesskey if (!confirm_sesskey()) { print_error('confirmsesskeybad', 'error'); } if ($data->bulk_update == 'delete') { // Perform bulk delete action if ($rooms = $DB->get_records('facetoface_room', null, '', 'id')) { $selected = facetoface_get_selected_report_items('room', null, $rooms); foreach ($selected as $item) { $DB->delete_records('facetoface_room', array('id' => $item->id)); } } } facetoface_reset_selected_report_items('room'); redirect($redirectto); } // Display local_js(array( JS_DIALOG, )
if (in_array($data->bulk_update, array('set_active', 'set_inactive'))) { // Perform bulk action // Get all notifications $notifications = $DB->get_records_sql( " SELECT id, status FROM {facetoface_notification_tpl} " ); if (!empty($notifications)) { $selected = facetoface_get_selected_report_items('template', null, $notifications); foreach ($selected as $item) { $item->status = $data->bulk_update == 'set_active' ? 1 : 0; $DB->update_record('facetoface_notification_tpl', $item); } } } facetoface_reset_selected_report_items('template'); redirect($redirectto->out()); } // Header local_js();