Example #1
0
 function testEditTicketType()
 {
     // Test the forum edits
     $this->tickettype_id = $GLOBALS['SITE_DB']->query_value_null_ok('translate', 'id', array('text_original' => "platinum"));
     edit_ticket_type($this->tickettype_id, "gold", 0, 0);
     // Test the forum was actually created
     $this->assertTrue('gold' == get_translated_text($this->tickettype_id));
 }
Example #2
0
 /**
  * The actualiser to edit/delete a ticket type.
  *
  * @return tempcode		The UI
  */
 function _edit_ticket_type()
 {
     $title = get_page_title('EDIT_TICKET_TYPE');
     $type = get_param_integer('ticket_type');
     if (post_param_integer('delete', 0) == 1) {
         $title = get_page_title('DELETE_TICKET_TYPE');
         delete_ticket_type($type);
     } else {
         $trans_old_ticket_type = get_translated_text($type);
         edit_ticket_type($type, post_param('new_type'), post_param_integer('guest_emails_mandatory', 0), post_param_integer('search_faq', 0));
         $GLOBALS['SITE_DB']->query_delete('group_category_access', array('module_the_name' => 'tickets', 'category_name' => $trans_old_ticket_type), '', 1);
         require_code('permissions2');
         set_category_permissions_from_environment('tickets', post_param('new_type'));
     }
     // Show it worked / Refresh
     $url = build_url(array('page' => '_SELF', 'type' => 'misc'), '_SELF');
     return redirect_screen($title, $url, do_lang_tempcode('SUCCESS'));
 }