add tags to DB and classes
authorKonrad Rosenbaum <konrad@silmor.de>
Mon, 16 Jan 2012 20:08:58 +0000 (21:08 +0100)
committerKonrad Rosenbaum <konrad@silmor.de>
Mon, 16 Jan 2012 20:08:58 +0000 (21:08 +0100)
wob/classes/customer.wolf
wob/classes/order.wolf
wob/classes/template.wolf
wob/db/cart.wolf
wob/db/customer.wolf
wob/db/event.wolf
wob/db/order.wolf
wob/db/template.wolf

index 5ec831c..9fed41a 100644 (file)
@@ -85,6 +85,8 @@
                <Property name="firstname" type="string"/>
                <Property name="name" type="string"/>
                <Property name="comments" type="string"/>
+               <Property name="cflags" type="string"/>
+               <Property name="tags" type="string"/>
                <!--online login data-->
                <Property name="email" type="string"/>
                <!-- password is never sent from server to client -->
                        <Map column="firstname"/>
                        <Map column="name"/>
                        <Map column="comments"/>
+                       <Map column="cflags"/>
+                       <Map column="tags"/>
                        <Map column="email"/>
                        <Map property="addresses">
                                <Call lang="php" method="WOAddress::fromTableArrayaddress(WTaddress::selectFromDB('customerid='.$GLOBALS['db']->escapeInt($table->customerid)))"/>
index 340cd76..5def7fb 100644 (file)
@@ -37,6 +37,7 @@
                <Property name="orderid" type="int"/>
                <Property name="pricecategoryid" type="int"/>
                <Property name="pricecategory" type="PriceCategory"/>
+               <Property name="tags" type="string"/>
                
                <Mapping table="ticket">
                        <Map column="ticketid"/>
@@ -44,6 +45,7 @@
                        <Map column="eventid"/>
                        <Map column="status"/>
                        <Map column="orderid" property="orderid"/>
+                       <Map column="tags"/>
                        <Map column="pricecategoryid"/>
                        <Map property="pricecategory">
                                <Call lang="php" method="WOPriceCategory::fromTablepricecategory(WTpricecategory::getFromDB($table->pricecategoryid))"/>
@@ -63,6 +65,7 @@
                        <Map column="price"/>
                        <Map column="eventid"/>
                        <Map column="status"/>
+                       <Map column="tags"/>
                        <Map column="orderid" property="orderid"/>
                        <Map column="pricecategoryid"/>
                        <Map property="pricecategory">
                <Property name="status" type="VoucherState" optional="1"/>
                <Property name="isused" type="bool"/>
                <Property name="orderid" type="int"/>
+               <Property name="tags" type="string"/>
                <Mapping table="voucher">
                        <Map column="voucherid"/>
                        <Map column="value"/>
                        <Map column="price"/>
                        <Map column="orderid"/>
                        <Map column="isused"/>
+                       <Map column="tags"/>
                        <Map property="status">
                                <!-- dummy, since this conversion is only used for existing valid vouchers -->
                                <Call lang="php" method="self::Ok"/>
                        <Map column="price"/>
                        <Map column="orderid"/>
                        <Map column="isused"/>
+                       <Map column="tags"/>
                        <Map property="status">
                                <!-- dummy, since this conversion is only used for existing valid vouchers -->
                                <Call lang="php" method="self::Ok"/>
                <Property name="senttime" type="int64"/>
                
                <Property name="comments" type="string"/>
+               
+               <Property name="tags" type="string"/>
                <!-- etc.pp. -->
                
                <Mapping table="order">
                        <Map column="ordertime"/>
                        <Map column="senttime"/>
                        <Map column="comments"/>
+                       <Map column="tags"/>
                        
                        <Map property="tickets"><Call lang="php" method="WOTicket::fromTableArrayticket(WTticket::selectFromDB('orderid='.$GLOBALS['db']->escapeInt($table->orderid)))"/></Map>
                        <Map property="vouchers"><Call lang="php" method="WOVoucher::fromTableArrayvoucher(WTvoucher::selectFromDB('orderid='.$GLOBALS['db']->escapeInt($table->orderid)))"/></Map>
index dbbcea8..f83da66 100644 (file)
@@ -15,6 +15,7 @@
                <Property name="hash" type="astring"/> <!--md5-->
                <Property name="dolog" type="bool"/>
                <Property name="flags" type="string"/>
+               <Property name="tags" type="string"/>
                <Property name="canuse" type="bool"/>
                <Mapping table="template">
                        <Map column="filename"/>
@@ -23,6 +24,7 @@
                        <Map column="hash"/>
                        <Map column="dolog"/>
                        <Map column="flags"/>
+                       <Map column="tags"/>
                        <Map property="canuse">
                                <Call lang="php" method="$GLOBALS['session']->checkFlags($data->getflags())"/>
                        </Map>
index 52c6683..f5687fe 100644 (file)
@@ -2,7 +2,7 @@
 <!-- Cart MagicSmoke WOLF
    - shopping cart management (web interface)
    -
-   - (c) Konrad Rosenbaum, 2009-2011
+   - (c) Konrad Rosenbaum, 2009-2012
    - this file is protected under the GNU AGPLv3 or at your option any newer
    - see COPYING.AGPL for details
    -->
index 4366860..f0f0450 100644 (file)
@@ -2,7 +2,7 @@
 <!-- Customer MagicSmoke WOLF
   - customer management
   -
-  - (c) Konrad Rosenbaum, 2009-2011
+  - (c) Konrad Rosenbaum, 2009-2012
   - this file is protected under the GNU AGPLv3 or at your option any newer
   - see COPYING.AGPL for details
   -->
@@ -32,6 +32,9 @@
                <Column name="rsttill" type="int64" null="yes">timer until which the reset code is valid</Column>
                <!-- customer flags, like newsletter, etc. -->
                <Column name="cflags" type="string" null="yes">flags of the customer, these are not to be confused with user flags, instead they can be set by the customer eg. to get a newsletter</Column>
+               <Column name="tags" type="string" null="yes">
+               additional tags for this customer, can be used by scripts; these cannot be manipulated or even seen by customers
+               </Column>
        </Table>
        <Table name="address" backup="yes">
                <Doc>customer data: addresses</Doc>
index a4e3238..73f2eba 100644 (file)
@@ -2,7 +2,7 @@
 <!-- Event Definition MagicSmoke WOLF
   - declares everything needed to define events
   -
-  - (c) Konrad Rosenbaum, 2009-2011
+  - (c) Konrad Rosenbaum, 2009-2012
   - this file is protected under the GNU AGPLv3 or at your option any newer
   - see COPYING.AGPL for details
   -->
index 738a908..7f1edd6 100644 (file)
@@ -2,7 +2,7 @@
 <!-- Order MagicSmoke WOLF
   - Tables and Comm Objects for Orders, Tickets, Vouchers, etc.
   -
-  - (c) Konrad Rosenbaum, 2009-2011
+  - (c) Konrad Rosenbaum, 2009-2012
   - this file is protected under the GNU AGPLv3 or at your option any newer
   - see COPYING.AGPL for details
   -->
@@ -63,6 +63,9 @@
                <Column name="shippingtype" type="int32" null="yes" foreignkey="shipping:shipid">
                pointer to shipping type (none per default, programmatic default is in config)
                </Column>
+               <Column name="tags" type="string" null="yes">
+               additional tags for this order, can be used by scripts
+               </Column>
                
                <!-- in audit: monitor the type of payment -->
                <AuditColumn name="paytype" type="string:64" foreignkey="paymenttype:paytype"/>
                </Column>
                <Column name="orderid" type="int32" foreignkey="order:orderid" notnull="yes"/>
                <Column name="seat" type="string:32" null="yes"/>
+               <Column name="tags" type="string" null="yes">
+               additional tags for this ticket, can be used by scripts
+               </Column>
                
                <!-- TODO: add check constraint that eventid,pricecategoryid exist in eventprice-->
        </Table>
        <Table name="voucher" backup="yes" base="BarcodeTable" audit="yes">
-               <!--a 8-32 char code (code39: case-insensitive letters+digits) for the voucher-->
                <Column name="voucherid" type="string:32" primarykey="yes">
+               a 8-32 char code (code39: case-insensitive letters+digits) for the voucher
                        <Call lang="php" method="BarcodeTable::getNewVoucherId()"/>
                </Column>
-               <!--price of the voucher (0 if cancelled)-->
-               <Column name="price" type="int32" notnull="yes"/>
-               <!--order this voucher belongs to-->
-               <Column name="orderid" type="int32" foreignkey="order:orderid" notnull="yes"/>
-               <!--marker: voucher has been used to pay something-->
-               <Column name="isused" type="bool" default="false"/>
-               <!--remaining value in cents (0 for cancelled)-->
-               <Column name="value" type="int32" notnull="yes"/>
+               <Column name="price" type="int32" notnull="yes">
+               price of the voucher (0 if cancelled)
+               </Column>
+               <Column name="orderid" type="int32" foreignkey="order:orderid" notnull="yes">
+               order this voucher belongs to
+               </Column>
+               <Column name="isused" type="bool" default="false">
+               marker: voucher has been used to pay something
+               </Column>
+               <Column name="value" type="int32" notnull="yes">
+               remaining value in cents (0 for cancelled)
+               </Column>
+               <Column name="tags" type="string" null="yes">
+               additional tags for this voucher, can be used by scripts
+               </Column>
                <!-- comments in auditing -->
                <AuditColumn name="comment" type="string" null="yes">
                        <Call lang="php" method="WOVoucher::getTransactionComment()"/>
                <Column name="barcode" type="string" null="yes">usually the EAN code</Column>
                <Column name="flags" type="string">filter: who can sell this product</Column>
                <Column name="tax" type="int32"/>
+               <Column name="tags" type="string" null="yes">
+               additional tags for this product, can be used by scripts
+               </Column>
        </Table>
        <Table name="item" backup="yes" audit="yes">
                <Doc>A sold item other than a ticket or voucher.</Doc>
                <Column name="orderid" type="int32" foreignkey="order:orderid" notnull="yes"/>
                <Column name="amount" type="int32" notnull="yes"/>
                <Column name="totalprice" type="int32" notnull="yes"/>
+               <Column name="tags" type="string" null="yes">
+               additional tags for this item, can be used by scripts
+               </Column>
        </Table>
 </Wolf>
\ No newline at end of file
index 0f07dd0..3fe4fcd 100644 (file)
@@ -2,7 +2,7 @@
 <!-- Template MagicSmoke WOLF
   - template tables
   -
-  - (c) Konrad Rosenbaum, 2009-2011
+  - (c) Konrad Rosenbaum, 2009-2012
   - this file is protected under the GNU AGPLv3 or at your option any newer
   - see COPYING.AGPL for details
   -->
@@ -14,5 +14,8 @@
                <Column name="hash" type="string:32" notnull="yes"/> <!--md5-->
                <Column name="dolog" type="bool" default="0"/>
                <Column name="flags" type="string">filter: who can use this template</Column>
+               <Column name="tags" type="string" null="yes">
+               additional tags for this template, can be used by scripts
+               </Column>
        </Table>
 </Wolf>