Пример #1
0
 protected function postLoad()
 {
     $this->profile->setProfileId($this->getId());
     $this->profile->load();
     $this->orderStatus->loadByProfileId($this->getId());
     $this->statusTracking = DatabaseObject_Helper_Admin_OrderManager::retrieveStatusTracking($this->_db, $this->getId());
 }
 public function marksellerarbitrationstatusAction()
 {
     $request = $this->getRequest();
     $this->adminOrders = new Zend_Session_Namespace('adminOrders');
     $orderItemId = $this->getRequest()->getParam('id');
     $decision = $this->getRequest()->getParam('decision');
     if ($orderItemId != '' && is_numeric($orderItemId) && isset($orderItemId)) {
         $product = new DatabaseObject_OrderProfile($this->db);
         //must check to see if the person is seller. because a seller can approve them selves as buyers if they are not the seller.
         if ($product->load($orderItemId)) {
             if ($decision == 'APPROVED') {
                 $product->orderStatus->seller_claim_approved = true;
                 $product->orderStatus->order_status = 'HELD_BY_SELLER_FOR_ARBITRATION_APPROVED';
                 $product->orderStatus->seller_claim_approved_date = date('Y-m-d G:i:s');
                 if ($product->orderStatus->save()) {
                     DatabaseObject_Helper_Admin_OrderManager::updateStatusTracking($this->db, $orderItemId, 'HELD_BY_SELLER_FOR_ARBITRATION_APPROVED');
                 }
             } elseif ($decision == 'DENIED') {
                 $product->orderStatus->seller_claim_approved = true;
                 $product->orderStatus->order_status = 'HELD_BY_SELLER_FOR_ARBITRATION_DENIED';
                 if ($product->orderStatus->save()) {
                     DatabaseObject_Helper_Admin_OrderManager::updateStatusTracking($this->db, $orderItemId, 'HELD_BY_SELLER_FOR_ARBITRATION_DENIED');
                 }
             }
         } else {
             //logg error
         }
     } else {
         //logg error
     }
 }
 public function vieworderprofiledetailsAction()
 {
     $id = $this->getRequest()->getParam('profileId');
     $order_id = $this->getRequest()->getParam('orderId');
     if (isset($id) && $id != '') {
         $order = DatabaseObject_Helper_Admin_OrderManager::retrieveOrderProfile($this->db, $id, 'profile_id');
         $order['statusTracking'] = DatabaseObject_Helper_Admin_OrderManager::retrieveStatusTracking($this->db, $id);
         $this->view->viewType = '_profile_detail.tpl';
     } elseif (isset($order_id) && $order_id != '') {
         $order = DatabaseObject_Helper_Admin_OrderManager::retrieveOrderSummaryFromOrderUniqueId($this->db, $order_id);
         $this->view->viewType = '_order_detail.tpl';
     }
     $this->view->product = $order;
     $this->view->orderProfiles = $this->adminOrders->orderProfiles;
     Zend_Debug::dump($order);
 }
 public function filingaclaimAction()
 {
     $request = $this->getRequest();
     $this->productId = $request->getParam('profileId');
     $this->filedByType = $request->getParam('filedByType');
     if ($this->productId == '' || !is_numeric($this->productId)) {
         $this->messenger->addMessage('We are very sorry, there is an error with this request.');
         $this->_redirect($_SERVER['HTTP_REFERER']);
     }
     $product = new DatabaseObject_OrderProfile($this->db);
     if ($product->load($this->productId)) {
         //when it is delivered and when return is allowed and the buyer belongs to the profile.
         if ($product->orderStatus->order_status == 'DELIVERED' && $product->return_allowed == 0 && $product->buyer_id == $this->signedInUserSessionInfoHolder->generalInfo->userID) {
             $product->orderStatus->order_status = 'HELD_BY_BUYER_FOR_ARBITRATION';
             $product->orderStatus->buyer_return_claim_filed = true;
             $product->orderStatus->buyer_return_claim_filed_date = date('Y-m-d G:i:s');
             //seller has 3 days to approve or DR will step in and figure out the problem.
             $product->orderStatus->buyer_return_claim_approved_by_seller_latest_date = date('Y-m-d', mktime(0, 0, 0, date("m"), date("d") + 3, date("Y")));
             if ($product->orderStatus->save()) {
                 DatabaseObject_Helper_Admin_OrderManager::updateStatusTracking($this->db, $this->productId, 'HELD_BY_BUYER_FOR_ARBITRATION');
                 $claim = new DatabaseObject_OrderProfileClaims($this->db);
                 $claim->order_profile_id = $this->productId;
                 $claim->filed_by_type = $this->filedByType;
                 $claim->filer_name = $product->buyer_name;
                 $claim->filing_reason = $request->getParam('orderClaimReason');
                 $claim->filer_phone_number = $request->getParam('filerPhoneNumber');
                 $claim->description = $request->getParam('description');
                 $claim->status = 'UNREVIEWED';
                 $claim->save();
                 $this->messenger->addMessage('Claim successfully filed. Dancerialto will contact you inregards to your claim.');
                 //$this->_redirect($_SERVER['HTTP_REFERER']);
             }
         } elseif ($product->orderStatus->order_status == 'RETURN_DELIVERED' && $product->uploader_id == $this->signedInUserSessionInfoHolder->generalInfo->userID) {
             $product->orderStatus->order_status = 'HELD_BY_SELLER_FOR_ARBITRATION';
             $product->orderStatus->seller_claim_filed = true;
             $product->orderStatus->seller_claim_filed_date = date('Y-m-d G:i:s');
             if ($product->orderStatus->save()) {
                 DatabaseObject_Helper_Admin_OrderManager::updateStatusTracking($this->db, $this->productId, 'HELD_BY_SELLER_FOR_ARBITRATION');
                 $claim = new DatabaseObject_OrderProfileClaims($this->db);
                 $claim->order_profile_id = $this->productId;
                 $claim->filed_by_type = $this->filedByType;
                 $claim->filer_name = $product->buyer_name;
                 $claim->filing_reason = $request->getParam('orderClaimReason');
                 $claim->description = $request->getParam('description');
                 $claim->filer_phone_number = $request->getParam('filerPhoneNumber');
                 $claim->status = 'UNREVIEWED';
                 $claim->save();
                 $this->messenger->addMessage('Claim successfully filed. Dancerialto will contact you inregards to your claim.');
                 //$this->_redirect($_SERVER['HTTP_REFERER']);
             }
         } else {
             $this->messenger->addMessage('You can not file a claim at this moment');
             //$this->_redirect($_SERVER['HTTP_REFERER']);
         }
     } else {
         $this->messenger->addMessage('An error had occured.');
         //$this->_redirect($_SERVER['HTTP_REFERER']);
     }
 }