if(isselect){
hl->addWidget(p=new QPushButton(tr("Select")),0);
connect(p,SIGNAL(clicked()),this,SLOT(accept()));
+ connect(m_listview,SIGNAL(doubleClicked(const QModelIndex&)),this,SLOT(accept()));
hl->addWidget(p=new QPushButton(tr("Cancel")),0);
connect(p,SIGNAL(clicked()),this,SLOT(reject()));
}else{
QGridLayout*gl;
vl->addLayout(gl=new QGridLayout,0);
int rw=0;
+ QLabel*lab;
gl->addWidget(new QLabel(tr("Order ID:")),rw,0);
gl->addWidget(m_orderid=new QLabel(QString::number(m_order.orderID())),rw,1);
gl->addWidget(new QLabel(tr("Order Date:")),++rw,0);
gl->addWidget(m_sentdate=new QLabel(m_order.sentDateTimeStr()),rw,1);
gl->addWidget(new QLabel(tr("Customer:")),++rw,0);
gl->addWidget(new QLabel(m_order.customer().getNameAddress()),rw,1);
+ gl->addWidget(new QLabel(tr("Delivery Address:")),++rw,0);
+ gl->addWidget(lab=new QLabel(m_order.deliveryAddress()),rw,1);
+ lab->setWordWrap(true);
gl->addWidget(new QLabel(tr("Sold by:")),++rw,0);
gl->addWidget(new QLabel(m_order.seller()),rw,1);
gl->addWidget(new QLabel(tr("Total Price:")),++rw,0);
gl->addWidget(m_paid=new QLabel(m_order.amountPaidString()),rw,1);
gl->addWidget(new QLabel(tr("Order State:")),++rw,0);
gl->addWidget(m_state=new QLabel(m_order.orderStatusString()),rw,1);
+ gl->addWidget(new QLabel(tr("Order Comment:")),++rw,0);
+ gl->addWidget(lab=new QLabel(m_order.comment()),rw,1);
+ lab->setWordWrap(true);
gl->setColumnStretch(0,0);
gl->setColumnStretch(1,10);
ordertable->setModel(ordermodel=new QStandardItemModel(this));
ordertable->setSelectionMode(QAbstractItemView::SingleSelection);
ordertable->setEditTriggers(QAbstractItemView::NoEditTriggers);
+ connect(ordertable,SIGNAL(doubleClicked(const QModelIndex&)),this,SLOT(orderDetails()));
hl->addLayout(vl=new QVBoxLayout,0);
vl->addWidget(p=new QPushButton(tr("Update")),0);
connect(p,SIGNAL(clicked()),this,SLOT(updateOrders()));
QPushButton*p;
hl->addWidget(p=new QPushButton(tr("Select")),0);
connect(p,SIGNAL(clicked()),&dlg,SLOT(accept()));
+ connect(tv,SIGNAL(doubleClicked(const QModelIndex&)),&dlg,SLOT(accept()));
hl->addWidget(p=new QPushButton(tr("Cancel")),0);
connect(p,SIGNAL(clicked()),&dlg,SLOT(reject()));
//wait for it
return true;
}
+
+ /**creating orders: set a delivery address*/
+ public function setDeliveryAddress($da)
+ {
+ $this->deliveryaddress=trim($da);
+ }
+
+ /**creating orders: set comment*/
+ public function setComment($cm)
+ {
+ $this->comment=trim($cm);
+ }
};
function createOrderXml($xmldata,$action)
}
//TODO: get vouchers
+ //get opt. address
+ foreach($doc->getElementsByTagName("DeliveryAddress") as $da){
+ foreach($da->childNodes as $cn)
+ if($cn->nodeType==XML_TEXT_NODE)
+ $order->setDeliveryAddress($cn->wholeText);
+ }
+ foreach($doc->getElementsByTagName("Comment") as $da){
+ foreach($da->childNodes as $cn)
+ if($cn->nodeType==XML_TEXT_NODE)
+ $order->setComment($cn->wholeText);
+ }
+ //get opt. comment
//check action
switch($action){
case "check":