61 lines
1.4 KiB
PHP
61 lines
1.4 KiB
PHP
<?php
|
|
|
|
/** Ticket Meta Genra
|
|
*
|
|
* @version 1.0.0
|
|
* @since 2007-10-13
|
|
* @author martin lenzelbauer
|
|
*
|
|
*/
|
|
class TicketGenre extends TicketObject{
|
|
|
|
|
|
/** C'tor
|
|
*/
|
|
//------------------------------------------------
|
|
function TicketCategory($id, $parent){
|
|
//------------------------------------------------
|
|
parent::TicketObject($id, $parent);
|
|
$this->name = "[unbenanntes Genre]";
|
|
}
|
|
|
|
|
|
/** @see TicketCategory::canBeDeleted()
|
|
*/
|
|
//-----------------------------------------------
|
|
function canBeDeleted(){
|
|
//-----------------------------------------------
|
|
$query = sprintf("SELECT id FROM bruckm_ticketevent WHERE genre = %d LIMIT 1",
|
|
$this->id);
|
|
$result = dbQuery($query);
|
|
if(mysql_num_rows($result) > 0){
|
|
$this->addError("Das Genre kann nicht gelöscht werden, da es bei einer oder mehreren Veranstaltungen in Verwendung ist!");
|
|
return false;
|
|
}
|
|
return true;
|
|
}
|
|
|
|
|
|
/** @see CmsObject::doPrintClassContent()
|
|
*/
|
|
//-----------------------------------------------
|
|
function doPrintClassContent(){
|
|
//-----------------------------------------------
|
|
$t = new Template(CMS_TEMPLATE_DIR."ticketgenre.html");
|
|
$t->setVar("NAME", htmlspecialchars($this->name));
|
|
return $t->toString();
|
|
}
|
|
|
|
|
|
/** @see CmsObject::getCssClass()
|
|
*/
|
|
//------------------------------------------------
|
|
function getCssClass(){
|
|
//------------------------------------------------
|
|
return "itemTicketGenre";
|
|
}
|
|
|
|
|
|
};
|
|
|
|
?>
|