63 lines
1.5 KiB
PHP
63 lines
1.5 KiB
PHP
<?php
|
|
|
|
/** Ticket Category
|
|
*
|
|
* @version 1.9.0
|
|
* @since 2007-02-16
|
|
* @author martin lenzelbauer
|
|
*
|
|
*/
|
|
class TicketCategory extends TicketObject{
|
|
|
|
|
|
/** C'tor
|
|
*/
|
|
//------------------------------------------------
|
|
function TicketCategory($id, $parent){
|
|
//------------------------------------------------
|
|
parent::TicketObject($id, $parent);
|
|
$this->name = "[unbenannte Kategorie]";
|
|
}
|
|
|
|
|
|
/** @see TicketCategory::canBeDeleted()
|
|
*/
|
|
//-----------------------------------------------
|
|
function canBeDeleted(){
|
|
//-----------------------------------------------
|
|
$query = sprintf("SELECT id FROM bruckm_ticketevent WHERE category1 = %d OR category2 = %d OR category3 = %d LIMIT 1",
|
|
$this->id,
|
|
$this->id,
|
|
$this->id);
|
|
$result = dbQuery($query);
|
|
if(mysql_num_rows($result) > 0){
|
|
$this->addError("Die Kategorie kann nicht gelöscht werden, da sie bei einer oder mehreren Veranstaltungen in Verwendung ist!");
|
|
return false;
|
|
}
|
|
return true;
|
|
}
|
|
|
|
|
|
/** @see CmsObject::doPrintClassContent()
|
|
*/
|
|
//-----------------------------------------------
|
|
function doPrintClassContent(){
|
|
//-----------------------------------------------
|
|
$t = new Template(CMS_TEMPLATE_DIR."ticketcategory.html");
|
|
$t->setVar("NAME", htmlspecialchars($this->name));
|
|
return $t->toString();
|
|
}
|
|
|
|
|
|
/** @see CmsObject::getCssClass()
|
|
*/
|
|
//------------------------------------------------
|
|
function getCssClass(){
|
|
//------------------------------------------------
|
|
return "itemTicketCategory";
|
|
}
|
|
|
|
|
|
};
|
|
|
|
?>
|