From 27e36a4f7d13584278d3249bf7f5b60facf76fea Mon Sep 17 00:00:00 2001 From: konrad Date: Wed, 30 Dec 2009 11:46:46 +0000 Subject: [PATCH] enable conditional abstracts in wob git-svn-id: https://silmor.de/svn/softmagic/smoke/trunk@378 6e3c4bff-ac9f-4ac1-96c5-d2ea494d3e33 --- src/dialogs/orderwin.cpp | 8 +++----- wob/customer.wolf | 4 ++-- wob/order.wolf | 3 +++ woc/htmlout.cpp | 15 ++++++++++++++- woc/phpout.h | 2 +- woc/processor.cpp | 11 +++++++++-- woc/processor.h | 8 ++++++-- woc/qtout.cpp | 2 +- www/inc/wext/autoload.php | 1 - www/inc/wext/customer.php | 15 --------------- 10 files changed, 39 insertions(+), 30 deletions(-) delete mode 100644 www/inc/wext/customer.php diff --git a/src/dialogs/orderwin.cpp b/src/dialogs/orderwin.cpp index 9909304..8b60a08 100644 --- a/src/dialogs/orderwin.cpp +++ b/src/dialogs/orderwin.cpp @@ -77,16 +77,14 @@ MOrderWindow::MOrderWindow(QWidget*par,const MOOrder&o) m->addAction(tr("&Close"),this,SLOT(close())); m=mb->addMenu(tr("&Payment")); - //FIXME: m->setEnabled(o.isStored()); m->addAction(tr("Receive &Payment..."),this,SLOT(payment())) - ->setEnabled(req->hasRole("orderpay")); + ->setEnabled(req->hasRight(req->ROrderPay)); m->addAction(tr("&Refund..."),this,SLOT(refund())) - ->setEnabled(req->hasRole("orderrefund")); + ->setEnabled(req->hasRight(req->ROrderRefund)); m->addAction(tr("Pay with &Voucher..."),this,SLOT(payvoucher())) - ->setEnabled(req->hasRole("usevoucher")); + ->setEnabled(req->hasRight(req->RUseVoucher)); m=mb->addMenu(tr("P&rinting")); - //FIXME: m->setEnabled(o.isStored()); m->addAction(tr("Print &Bill..."),this,SLOT(printBill())); m->addAction(tr("Save Bill &as file..."),this,SLOT(saveBill())); m->addSeparator(); diff --git a/wob/customer.wolf b/wob/customer.wolf index 120f926..6b8e23f 100644 --- a/wob/customer.wolf +++ b/wob/customer.wolf @@ -150,8 +150,8 @@ - - + + This class encapsulates the most basic information about a customer. For more complex tasks the Customer class is used. diff --git a/wob/order.wolf b/wob/order.wolf index 5c29a22..16d8a2e 100644 --- a/wob/order.wolf +++ b/wob/order.wolf @@ -408,6 +408,9 @@ + + + diff --git a/woc/htmlout.cpp b/woc/htmlout.cpp index c15205f..50de719 100644 --- a/woc/htmlout.cpp +++ b/woc/htmlout.cpp @@ -217,8 +217,21 @@ void WocHtmlOut::newClass(const WocClass&cls) QString hcd; //class declaration hcd+="

"; - if(cls.isAbstract())hcd+="Abstract "; + if(cls.isAbstract(""))hcd+="Abstract "; hcd+="Class "+cn+"

\n"; + + //conditional abstract + QStringList ab=cls.abstractLangs(); + if(ab.size()>0){ + hcd+="

The class is conditionally abstract in: "; + for(int i=0;i\n"; diff --git a/woc/phpout.h b/woc/phpout.h index c5e986f..28bddeb 100644 --- a/woc/phpout.h +++ b/woc/phpout.h @@ -86,7 +86,7 @@ class WocPHPServerOut:public WocOutput /**helper: return the PHP-class-name of a WocClass*/ QString className(const WocClass&c){return "WO"+c.name();} /**helper: return the PHP-class-name of a WocClass plus Abstract if it is abstract*/ - QString abstractClassName(const WocClass&c){return "WO"+c.name()+QString(c.isAbstract()?"Abstract":"");} + QString abstractClassName(const WocClass&c){return "WO"+c.name()+QString(c.isAbstract("php")?"Abstract":"");} /**helper: returns the PHP-class-name for a WocTransaction*/ QString trnClassName(const WocTransaction&t){return "WTr"+t.name();} diff --git a/woc/processor.cpp b/woc/processor.cpp index 576af3c..4c64a0a 100644 --- a/woc/processor.cpp +++ b/woc/processor.cpp @@ -477,9 +477,15 @@ WocClass::WocClass(const QDomElement&cls) if(s!="")m_docstrings< \ No newline at end of file diff --git a/www/inc/wext/customer.php b/www/inc/wext/customer.php deleted file mode 100644 index 9c2fa50..0000000 --- a/www/inc/wext/customer.php +++ /dev/null @@ -1,15 +0,0 @@ -, (C) 2009 -// -// Copyright: See README/COPYING files that come with this distribution -// -// - -class WOCustomerInfo extends WOCustomerInfoAbstract {}; -?> \ No newline at end of file -- 1.7.2.5