void MOverview::updateEvents()
{
- QList<MOEvent>evl=req->queryGetAllEvents().getevents();
+ QList<MOEvent>evl;
+ try{
+ evl=req->queryGetAllEvents().getevents();
+ }catch(WException e){
+ qDebug("Error getting all events (%s): %s",e.component().toAscii().data(),e.error().toAscii().data());
+ return;
+ }
eventmodel->clear();
eventmodel->insertColumns(0,6);
eventmodel->setHorizontalHeaderLabels(QStringList()<<tr("Start Time")<<tr("Title")<<tr("Free")<<tr("Reserved")<<tr("Sold")<<tr("Capacity"));
<Property name="end" type="int64"/>
<Property name="capacity" type="int"/>
<Property name="defaultprice" type="int"/>
- <Property name="cancelled" type="bool"/>
<Property name="title" type="string"/>
<Property name="artist" type="string"/>
<Property name="room" type="string"/>
+ <Property name="iscancelled" type="bool"/>
<Property name="cancelreason" type="string"/>
<Property name="amountSold" type="int"/>
<Property name="amountReserved" type="int"/>
<Property name="description" type="string"/>
+ <Property name="tax" type="int"/>
+
+ <Mapping table="event">
+ <Map column="eventid" property="id"/>
+ <Map column="title"/>
+ <Map column="artist"/>
+ <Map column="description"/>
+ <Map column="comment"/>
+ <!--timing and location-->
+ <Map column="starttime"/>
+ <Map column="endtime"/>
+ <Map column="roomid" property="room"/>
+ <!--Map column="seatplanid"/-->
+ <!--initially a copy from room, can be adjusted-->
+ <Map column="capacity"/>
+ <!-- flags -->
+ <Map column="iscancelled"/>
+ <Map column="flags"/>
+ <Map column="tax"/>
+ <!-- reason the event has been cancelled-->
+ <Map column="cancelreason"/>
+ </Mapping>
</Class>
<Class name="Room">
<Transaction name="GetAllEvents">
<Input/>
- <Call lang="php" method="GetAllEventsXml2($this);"/>
+ <Call lang="php" method="Event::getAllEvents($this);"/>
<Output>
<Var name="events" type="List:Event"/>
</Output>
code+="\t$data[\""+map[j].second+"\"]=$table->"+map[j].first+";\n";
}
code+="\treturn new WO"+cls.name()+"($data);\n}\n";
+ code+="static public function fromTableArray"+k[i]+"(array $table){\n\t$ret=array();\n";
+ code+="\tfor($i=0;$i<count($table);$i++)$ret[]=self::fromTable"+k[i]+"($table[$i]);\n";
+ code+="\treturn $ret;\n}\n";
}
return code;
return;
}
m_backup=str2bool(tbl.attribute("backup","0"));
- m_base=tbl.attribute("base","WocTable");
+ m_base=tbl.attribute("base","WobTable");
qDebug("Info: parsing table %s",m_name.toAscii().data());
QDomNodeList nl=tbl.elementsByTagName("Column");
//Columns
}
return $this->capacity - $amt;
}
+
+ /**XML iface: get all events*/
+ public static function getAllEvents($trans)
+ {
+ $evlst=WOEvent::fromTableArrayevent(WTevent::selectFromDB(""));
+ $trans->setevents($evlst);
+ }
};
/**machine-function: get the requested events as XML data*/