diff --git a/lib/mshoplib/config/mshop/order.php b/lib/mshoplib/config/mshop/order.php index 25ae45a974..195b1f00fc 100644 --- a/lib/mshoplib/config/mshop/order.php +++ b/lib/mshoplib/config/mshop/order.php @@ -624,9 +624,9 @@ INSERT INTO "mshop_order_base" ( "customerid", "sitecode", "langid", "currencyid", "price", "costs", "rebate", "tax", "taxflag", "comment", - "status", "mtime", "editor", "siteid", "ctime" + "mtime", "editor", "siteid", "ctime" ) VALUES ( - ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? + ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? ) ' ), @@ -635,7 +635,7 @@ UPDATE "mshop_order_base" SET "customerid" = ?, "sitecode" = ?, "langid" = ?, "currencyid" = ?, "price" = ?, "costs" = ?, "rebate" = ?, "tax" = ?, "taxflag" = ?, - "comment" = ?, "status" = ?, "mtime" = ?, "editor" = ? + "comment" = ?, "mtime" = ?, "editor" = ? WHERE "siteid" = ? AND "id" = ? ' ), @@ -647,14 +647,14 @@ mordba."price" AS "order.base.price", mordba."costs" AS "order.base.costs", mordba."rebate" AS "order.base.rebate", mordba."tax" AS "order.base.taxvalue", mordba."taxflag" AS "order.base.taxflag", mordba."comment" AS "order.base.comment", - mordba."status" AS "order.base.status", mordba."mtime" AS "order.base.mtime", - mordba."editor" AS "order.base.editor", mordba."ctime" AS "order.base.ctime" + mordba."mtime" AS "order.base.mtime", mordba."ctime" AS "order.base.ctime", + mordba."editor" AS "order.base.editor" FROM "mshop_order_base" AS mordba :joins WHERE :cond GROUP BY mordba."id", mordba."siteid", mordba."sitecode", mordba."customerid", mordba."langid", mordba."currencyid", mordba."price", mordba."costs", - mordba."rebate", mordba."tax", mordba."taxflag", mordba."comment", mordba."status", + mordba."rebate", mordba."tax", mordba."taxflag", mordba."comment", mordba."mtime", mordba."editor", mordba."ctime" /*-columns*/ , :columns /*columns-*/ /*-orderby*/ ORDER BY :order /*orderby-*/ LIMIT :size OFFSET :start diff --git a/lib/mshoplib/setup/default/schema/order.php b/lib/mshoplib/setup/default/schema/order.php index e36d7717cd..5423d4f041 100644 --- a/lib/mshoplib/setup/default/schema/order.php +++ b/lib/mshoplib/setup/default/schema/order.php @@ -32,7 +32,6 @@ $table->addColumn( 'tax', 'decimal', array( 'precision' => 14, 'scale' => 4 ) ); $table->addColumn( 'taxflag', 'smallint', [] ); $table->addColumn( 'comment', 'text', array( 'length' => 0xfff ) ); - $table->addColumn( 'status', 'smallint', [] ); $table->addColumn( 'mtime', 'datetime', [] ); $table->addColumn( 'ctime', 'datetime', [] ); $table->addColumn( 'editor', 'string', array('length' => 255 ) ); diff --git a/lib/mshoplib/src/MShop/Order/Item/Base/Iface.php b/lib/mshoplib/src/MShop/Order/Item/Base/Iface.php index e4c1c2255d..947c37738f 100644 --- a/lib/mshoplib/src/MShop/Order/Item/Base/Iface.php +++ b/lib/mshoplib/src/MShop/Order/Item/Base/Iface.php @@ -19,7 +19,7 @@ * @subpackage Order */ interface Iface - extends \Aimeos\MW\Observer\Publisher\Iface, \Aimeos\MShop\Common\Item\Iface, \Aimeos\MShop\Common\Item\Status\Iface + extends \Aimeos\MW\Observer\Publisher\Iface, \Aimeos\MShop\Common\Item\Iface { /** * Tests if all necessary items are available to create the order. diff --git a/lib/mshoplib/src/MShop/Order/Item/Base/Standard.php b/lib/mshoplib/src/MShop/Order/Item/Base/Standard.php index 7c0549c58d..017b72c6dc 100644 --- a/lib/mshoplib/src/MShop/Order/Item/Base/Standard.php +++ b/lib/mshoplib/src/MShop/Order/Item/Base/Standard.php @@ -180,39 +180,6 @@ public function setComment( $comment ) } - /** - * Returns the current status of the order base item. - * - * @return integer Status of the item - */ - public function getStatus() - { - if( isset( $this->values['order.base.status'] ) ) { - return (int) $this->values['order.base.status']; - } - - return 1; - } - - - /** - * Sets the new status of the order base item. - * - * @param integer $value Status of the item - * @return \Aimeos\MShop\Order\Item\Base\Iface Order base item for chaining method calls - */ - public function setStatus( $value ) - { - if( (int) $value !== $this->getStatus() ) - { - $this->values['order.base.status'] = (int) $value; - $this->modified = true; - } - - return $this; - } - - /** * Returns modify date/time of the order item base product. * @@ -407,10 +374,9 @@ public function fromArray( array &$list, $private = false ) switch( $key ) { case 'order.base.id': !$private ?: $item = $item->setId( $value ); break; + case 'order.base.customerid': !$private ?: $item = $item->setCustomerId( $value ); break; + case 'order.base.languageid': !$private ?: $locale = $locale->setLanguageId( $value ); break; case 'order.base.comment': $item = $item->setComment( $value ); break; - case 'order.base.customerid': $item = $item->setCustomerId( $value ); break; - case 'order.base.status': $item = $item->setStatus( $value ); break; - case 'order.base.languageid': $locale = $locale->setLanguageId( $value ); break; default: continue 2; } @@ -442,7 +408,6 @@ public function toArray( $private = false ) 'order.base.rebate' => $price->getRebate(), 'order.base.taxvalue' => $price->getTaxValue(), 'order.base.taxflag' => $price->getTaxFlag(), - 'order.base.status' => $this->getStatus(), 'order.base.comment' => $this->getComment(), ); diff --git a/lib/mshoplib/src/MShop/Order/Manager/Base/Standard.php b/lib/mshoplib/src/MShop/Order/Manager/Base/Standard.php index 49ef018871..cb89c36247 100644 --- a/lib/mshoplib/src/MShop/Order/Manager/Base/Standard.php +++ b/lib/mshoplib/src/MShop/Order/Manager/Base/Standard.php @@ -110,13 +110,6 @@ class Standard extends Base 'type' => 'string', 'internaltype' => \Aimeos\MW\DB\Statement\Base::PARAM_STR, ), - 'order.base.status' => array( - 'code' => 'order.base.status', - 'internalcode' => 'mordba."status"', - 'label' => 'Order subscription status', - 'type' => 'integer', - 'internaltype' => \Aimeos\MW\DB\Statement\Base::PARAM_INT, - ), 'order.base.ctime' => array( 'code' => 'order.base.ctime', 'internalcode' => 'mordba."ctime"', @@ -670,16 +663,15 @@ public function saveItem( \Aimeos\MShop\Common\Item\Iface $item, $fetch = true ) $stmt->bind( 8, $priceItem->getTaxValue() ); $stmt->bind( 9, $priceItem->getTaxFlag(), \Aimeos\MW\DB\Statement\Base::PARAM_INT ); $stmt->bind( 10, $item->getComment() ); - $stmt->bind( 11, $item->getStatus(), \Aimeos\MW\DB\Statement\Base::PARAM_INT ); - $stmt->bind( 12, $date ); // mtime - $stmt->bind( 13, $context->getEditor() ); - $stmt->bind( 14, $localeItem->getSiteId(), \Aimeos\MW\DB\Statement\Base::PARAM_INT ); + $stmt->bind( 11, $date ); // mtime + $stmt->bind( 12, $context->getEditor() ); + $stmt->bind( 13, $localeItem->getSiteId(), \Aimeos\MW\DB\Statement\Base::PARAM_INT ); if( $id !== null ) { - $stmt->bind( 15, $id, \Aimeos\MW\DB\Statement\Base::PARAM_INT ); + $stmt->bind( 14, $id, \Aimeos\MW\DB\Statement\Base::PARAM_INT ); $item->setId( $id ); } else { - $stmt->bind( 15, $date ); // ctime + $stmt->bind( 14, $date ); // ctime } $stmt->execute()->finish(); diff --git a/lib/mshoplib/tests/MShop/Order/Item/Base/StandardTest.php b/lib/mshoplib/tests/MShop/Order/Item/Base/StandardTest.php index 95b18b99c5..58b1fdf9be 100644 --- a/lib/mshoplib/tests/MShop/Order/Item/Base/StandardTest.php +++ b/lib/mshoplib/tests/MShop/Order/Item/Base/StandardTest.php @@ -26,7 +26,6 @@ protected function setUp() 'order.base.siteid' => 99, 'order.base.customerid' => 'testuser', 'order.base.comment' => 'this is a comment from unittest', - 'order.base.status' => 0, 'order.base.mtime' => '2011-01-01 00:00:02', 'order.base.ctime' => '2011-01-01 00:00:01', 'order.base.editor' => 'unitTestUser' @@ -142,30 +141,19 @@ public function testSetComment() $this->assertTrue( $this->object->isModified() ); } - public function testGetStatus() - { - $this->assertEquals( 0, $this->object->getStatus() ); - } - - public function testSetStatus() - { - $return = $this->object->setStatus( 1 ); - - $this->assertInstanceOf( \Aimeos\MShop\Order\Item\Base\Iface::class, $return ); - $this->assertEquals( 1, $this->object->getStatus() ); - $this->assertTrue( $this->object->isModified() ); - } public function testGetTimeModified() { $this->assertEquals( '2011-01-01 00:00:02', $this->object->getTimeModified() ); } + public function testGetTimeCreated() { $this->assertEquals( '2011-01-01 00:00:01', $this->object->getTimeCreated() ); } + public function testGetEditor() { $this->assertEquals( 'unitTestUser', $this->object->getEditor() ); @@ -181,7 +169,6 @@ public function testFromArray() 'order.base.comment' => 'test comment', 'order.base.languageid' => 'de', 'order.base.customerid' => 3, - 'order.base.status' => 4, ); $item = $item->fromArray( $entries, true ); @@ -191,7 +178,6 @@ public function testFromArray() $this->assertEquals( $list['order.base.customerid'], $item->getCustomerId() ); $this->assertEquals( $list['order.base.languageid'], $item->getLocale()->getLanguageId() ); $this->assertEquals( $list['order.base.comment'], $item->getComment() ); - $this->assertEquals( $list['order.base.status'], $item->getStatus() ); } @@ -205,7 +191,6 @@ public function testToArray() $this->assertEquals( $this->object->getCustomerId(), $list['order.base.customerid'] ); $this->assertEquals( $this->object->getLocale()->getLanguageId(), $list['order.base.languageid'] ); $this->assertEquals( $this->object->getComment(), $list['order.base.comment'] ); - $this->assertEquals( $this->object->getStatus(), $list['order.base.status'] ); $this->assertEquals( $this->object->getTimeCreated(), $list['order.base.ctime'] ); $this->assertEquals( $this->object->getTimeModified(), $list['order.base.mtime'] ); $this->assertEquals( $this->object->getEditor(), $list['order.base.editor'] ); diff --git a/lib/mshoplib/tests/MShop/Order/Manager/Base/StandardTest.php b/lib/mshoplib/tests/MShop/Order/Manager/Base/StandardTest.php index 58bcee2378..5cabda9d86 100644 --- a/lib/mshoplib/tests/MShop/Order/Manager/Base/StandardTest.php +++ b/lib/mshoplib/tests/MShop/Order/Manager/Base/StandardTest.php @@ -169,7 +169,6 @@ public function testSaveUpdateDeleteItem() $this->assertEquals( $item->getCoupons(), $itemSaved->getCoupons() ); $this->assertEquals( $item->getServices(), $itemSaved->getServices() ); $this->assertEquals( $item->getComment(), $itemSaved->getComment() ); - $this->assertEquals( $item->getStatus(), $itemSaved->getStatus() ); $this->assertEquals( $item->getSiteCode(), $itemSaved->getSiteCode() ); $this->assertEquals( $this->editor, $itemSaved->getEditor() ); @@ -190,7 +189,6 @@ public function testSaveUpdateDeleteItem() $this->assertEquals( $itemExp->getCoupons(), $itemUpd->getCoupons() ); $this->assertEquals( $itemExp->getServices(), $itemUpd->getServices() ); $this->assertEquals( $itemExp->getComment(), $itemUpd->getComment() ); - $this->assertEquals( $itemExp->getStatus(), $itemUpd->getStatus() ); $this->assertEquals( $itemExp->getSiteCode(), $itemUpd->getSiteCode() ); $this->assertEquals( $this->editor, $itemUpd->getEditor() );