Ejemplo n.º 1
0
 /**
  * Standard aed_module delete actualiser.
  *
  * @param  ID_TEXT		The entry being deleted
  */
 function delete_actualisation($id)
 {
     delete_event_type(intval($id));
 }
Ejemplo n.º 2
0
 function tearDown()
 {
     delete_event_type($this->eventtype_id);
     parent::tearDown();
 }
Ejemplo n.º 3
0
/**
 * Delete a bookable.
 *
 * @param  AUTO_LINK	Bookable ID.
 */
function delete_bookable($bookable_id)
{
    if (!is_null($GLOBALS['SITE_DB']->query_value_null_ok('booking', 'id', array('bookable_id' => $bookable_id)))) {
        warn_exit(do_lang_tempcode('CANNOT_DELETE_BOOKINGS_EXIST'));
    }
    $_old_bookable = $GLOBALS['SITE_DB']->query_select('bookable', array('*'), array('id' => $bookable_id), '', 1);
    if (!array_key_exists(0, $_old_bookable)) {
        warn_exit(do_lang_tempcode('MISSING_RESOURCE'));
    }
    $title = get_translated_text($_old_bookable[0]['title']);
    delete_lang($_old_bookable[0]['title']);
    delete_lang($_old_bookable[0]['description']);
    delete_lang($_old_bookable[0]['categorisation']);
    $calendar_type = $_old_bookable[0]['calendar_type'];
    if (is_null($calendar_type) && is_null($GLOBALS['SITE_DB']->query_value_null_ok('calendar_types', 'id', array('id' => $calendar_type))) && $GLOBALS['SITE_DB']->query_value('calendar_events', 'COUNT(*)', array('e_type' => $calendar_type)) == 0) {
        require_code('calendar2');
        delete_event_type($calendar_type);
    }
    $GLOBALS['SITE_DB']->query_delete('bookable', array('id' => $bookable_id), '', 1);
    $GLOBALS['SITE_DB']->query_delete('bookable_blacked_for', array('bookable_id' => $bookable_id));
    $GLOBALS['SITE_DB']->query_delete('bookable_codes', array('bookable_id' => $bookable_id));
    $GLOBALS['SITE_DB']->query_delete('bookable_supplement_for', array('bookable_id' => $bookable_id));
    log_it('DELETE_BOOKABLE', strval($bookable_id), $title);
}