function fetchOrderStatus() { $statusList = eZOrderStatus::fetchMap(true, true); if (isset($statusList[$this->StatusID])) { return $statusList[$this->StatusID]; } return false; }
// Internal status items must not be removed if ( $status->isInternal() ) { $triedRemoveInternal = true; continue; } $status->removeThis(); $hasRemoved = true; } if ( $hasRemoved ) $messages[] = array( 'description' => ezpI18n::tr( 'kernel/shop', 'Selected order statuses were successfully removed.' ) ); if ( $triedRemoveInternal ) $messages[] = array( 'description' => ezpI18n::tr( 'kernel/shop', 'Internal orders cannot be removed.' ) ); } $orderStatusArray = eZOrderStatus::fetchList( true, true ); $tpl = eZTemplate::factory(); $tpl->setVariable( "orderstatus_array", $orderStatusArray ); $tpl->setVariable( "module", $module ); $tpl->setVariable( "messages", $messages ); $path = array(); $path[] = array( 'text' => ezpI18n::tr( 'kernel/shop', 'Order list' ), 'url' => 'shop/orderlist' ); $path[] = array( 'text' => ezpI18n::tr( 'kernel/shop', 'Status' ), 'url' => false ); $Result = array(); $Result['path'] = $path; $Result['content'] = $tpl->fetch( "design:shop/status.tpl" );
function storeCustom() { if ($this->StatusID) { eZOrderStatus::flush(); $this->store(); } else { // Lock the table while we find the highest number $db = eZDB::instance(); $db->lock('ezorder_status'); $rows = $db->arrayQuery("SELECT max( status_id ) as status_id FROM ezorder_status"); $statusID = $rows[0]['status_id']; // If the max ID is below the custom one we set as the first // custom ID, if not we increase it by one. if ($statusID < eZOrderStatus::CUSTOM) { $statusID = eZOrderStatus::CUSTOM; } else { ++$statusID; } $this->StatusID = $statusID; $this->store(); $db->unlock(); eZOrderStatus::flush(); } }
function statusObject() { if ($this->Status === null) { $this->Status = eZOrderStatus::fetchByStatus($this->StatusID); } return $this->Status; }