Sfoglia il codice sorgente

Ticket #3265 - Points №4 - 6. Related core changes.

AntonLV 5 anni fa
parent
commit
eef69e109f

+ 92 - 56
modules/base/text/classes/BxBaseModTextModule.php

@@ -23,7 +23,9 @@ class BxBaseModTextModule extends BxBaseModGeneralModule implements iBxDolConten
         parent::__construct($aModule);
         parent::__construct($aModule);
     }
     }
 
 
+
     // ====== ACTIONS METHODS
     // ====== ACTIONS METHODS
+
     public function actionEmbedPoll($iPollId = 0)
     public function actionEmbedPoll($iPollId = 0)
     {
     {
         if(empty($iPollId) && bx_get('poll_id') !== false)
         if(empty($iPollId) && bx_get('poll_id') !== false)
@@ -138,8 +140,11 @@ class BxBaseModTextModule extends BxBaseModGeneralModule implements iBxDolConten
 
 
         if($oForm->getCleanValue('do_submit')) {
         if($oForm->getCleanValue('do_submit')) {
             $aResult = array();
             $aResult = array();
-            if($this->_oDb->updateEntriesBy(array($CNF['FIELD_STATUS_ADMIN'] => BX_BASE_MOD_TEXT_STATUS_ACTIVE), array($CNF['FIELD_ID'] => $iContentId)))
+            if($this->_oDb->updateEntriesBy(array($CNF['FIELD_STATUS_ADMIN'] => BX_BASE_MOD_TEXT_STATUS_ACTIVE), array($CNF['FIELD_ID'] => $iContentId))) {
+                $this->onApprove($aContentInfo);
+
                 $aResult = array('msg' => _t('_sys_manage_txt_approved'), 'reload' => 1);
                 $aResult = array('msg' => _t('_sys_manage_txt_approved'), 'reload' => 1);
+            }
             else
             else
                 $aResult = array('msg' => _t('_sys_manage_err_cannot_perform_action'));
                 $aResult = array('msg' => _t('_sys_manage_err_cannot_perform_action'));
 
 
@@ -147,57 +152,6 @@ class BxBaseModTextModule extends BxBaseModGeneralModule implements iBxDolConten
         }
         }
     }
     }
 
 
-    protected function _getApproveForm($iContentId, $aContentInfo)
-    {
-        $CNF = &$this->_oConfig->CNF;
-
-        $sForm = 'sys_manage';
-        if(!empty($CNF['OBJECT_FORM_MANAGE']))
-            $sForm = $CNF['OBJECT_FORM_MANAGE'];
-
-        $sFormDisplay = 'sys_manage_approve';
-        if(!empty($CNF['OBJECT_FORM_MANAGE_APPROVE']))
-            $sFormDisplay = $CNF['OBJECT_FORM_MANAGE_APPROVE'];
-
-        $oForm = BxTemplFormView::getObjectInstance($sForm, $sFormDisplay);
-        $oForm->aFormAttrs['action'] = BX_DOL_URL_ROOT . $this->_oConfig->getBaseUri() . 'approve';
-        $oForm->aInputs['content_id']['value'] = $iContentId;
-        foreach($oForm->aInputs['controls'] as $iKey => $mixedValue)
-            if(is_numeric($iKey) && isset($mixedValue['name']) && $mixedValue['name'] == 'do_submit')
-                $oForm->aInputs['controls'][$iKey]['value'] = _t('_sys_form_manage_input_do_submit_approve');
-
-        bx_alert($this->_oConfig->getName(), 'get_approve_form', 0, 0, array(
-            'content_id' => $iContentId,
-            'content_info' => $aContentInfo,
-            'override_result' => &$oForm
-        ));
-
-        return $oForm;
-    }
-
-    protected function _sendApproveMessage($iContentId, $aContentInfo, &$oForm)
-    {
-        $CNF = &$this->_oConfig->CNF;
-
-        $sETemplate = 't_ManageApprove';
-        if(!empty($CNF['ETEMPLATE_MANAGE_APPROVE']))
-            $sETemplate = $CNF['ETEMPLATE_MANAGE_APPROVE'];
-
-        $aEParams = array(
-            'content_title' => !empty($CNF['FIELD_TITLE']) && !empty($aContentInfo[$CNF['FIELD_TITLE']]) ? $aContentInfo[$CNF['FIELD_TITLE']] : '',
-            'notes' => $oForm->getCleanValue('notes'),
-        );
-
-        bx_alert($this->_oConfig->getName(), 'get_approve_message', 0, 0, array(
-            'content_id' => $iContentId,
-            'content_info' => $aContentInfo,
-            'form' => $oForm,
-            'email_template' => &$sETemplate,
-            'email_params' => &$aEParams
-        ));
-
-        return sendMailTemplate($sETemplate, 0, $aContentInfo[$CNF['FIELD_AUTHOR']], $aEParams);
-    }
 
 
     // ====== SERVICE METHODS
     // ====== SERVICE METHODS
 
 
@@ -532,7 +486,8 @@ class BxBaseModTextModule extends BxBaseModGeneralModule implements iBxDolConten
 
 
         return $iCount;
         return $iCount;
     }
     }
-    
+
+
     // ====== PERMISSION METHODS
     // ====== PERMISSION METHODS
 
 
     /**
     /**
@@ -582,7 +537,17 @@ class BxBaseModTextModule extends BxBaseModGeneralModule implements iBxDolConten
         return $this->_oDb->isPollPerformed($iObjectId, $iAuthorId, $iAuthorIp);
         return $this->_oDb->isPollPerformed($iObjectId, $iAuthorId, $iAuthorIp);
     }
     }
 
 
+
     // ====== COMMON METHODS
     // ====== COMMON METHODS
+
+    public function onApprove($mixedContent)
+    {
+        if(!is_array($mixedContent))
+            $mixedContent = $this->_oDb->getContentInfoById((int)$mixedContent);
+
+        $this->alertAfterApprove($mixedContent);
+    }
+
     public function alertAfterAdd($aContentInfo)
     public function alertAfterAdd($aContentInfo)
     {
     {
         $CNF = &$this->_oConfig->CNF;
         $CNF = &$this->_oConfig->CNF;
@@ -594,7 +559,7 @@ class BxBaseModTextModule extends BxBaseModGeneralModule implements iBxDolConten
         if(isset($CNF['FIELD_STATUS']) && isset($aContentInfo[$CNF['FIELD_STATUS']]) && $aContentInfo[$CNF['FIELD_STATUS']] == 'awaiting')
         if(isset($CNF['FIELD_STATUS']) && isset($aContentInfo[$CNF['FIELD_STATUS']]) && $aContentInfo[$CNF['FIELD_STATUS']] == 'awaiting')
             $sAction = 'deferred';
             $sAction = 'deferred';
 
 
-        $aParams = $this->_alertParams($aContentInfo);
+        $aParams = $this->_alertParamsAdd($aContentInfo);
         bx_alert('system', 'prepare_alert_params', 0, 0, array('unit'=> $this->getName(), 'action' => $sAction, 'object_id' => $iId, 'sender_id' => $iAuthorId, 'extras' => &$aParams));
         bx_alert('system', 'prepare_alert_params', 0, 0, array('unit'=> $this->getName(), 'action' => $sAction, 'object_id' => $iId, 'sender_id' => $iAuthorId, 'extras' => &$aParams));
         bx_alert($this->getName(), $sAction, $iId, $iAuthorId, $aParams);
         bx_alert($this->getName(), $sAction, $iId, $iAuthorId, $aParams);
     }
     }
@@ -608,6 +573,16 @@ class BxBaseModTextModule extends BxBaseModGeneralModule implements iBxDolConten
         $aParams = $this->_alertParams($aContentInfo);
         $aParams = $this->_alertParams($aContentInfo);
         bx_alert($this->getName(), 'edited', $iId, false, $aParams);
         bx_alert($this->getName(), 'edited', $iId, false, $aParams);
     }
     }
+    
+    public function alertAfterApprove($aContentInfo)
+    {
+        $CNF = &$this->_oConfig->CNF;
+
+        $iId = (int)$aContentInfo[$CNF['FIELD_ID']];
+
+        $aParams = $this->_alertParams($aContentInfo);
+        bx_alert($this->getName(), 'approved', $iId, false, $aParams);
+    }
 
 
     /**
     /**
      * Get array of params to be passed in Add/Edit Alert.
      * Get array of params to be passed in Add/Edit Alert.
@@ -621,6 +596,15 @@ class BxBaseModTextModule extends BxBaseModGeneralModule implements iBxDolConten
         if(!empty($CNF['FIELD_ALLOW_VIEW_TO']) && isset($aContentInfo[$CNF['FIELD_ALLOW_VIEW_TO']]))
         if(!empty($CNF['FIELD_ALLOW_VIEW_TO']) && isset($aContentInfo[$CNF['FIELD_ALLOW_VIEW_TO']]))
             $aParams['privacy_view'] = $aContentInfo[$CNF['FIELD_ALLOW_VIEW_TO']];
             $aParams['privacy_view'] = $aContentInfo[$CNF['FIELD_ALLOW_VIEW_TO']];
 
 
+        return $aParams;
+    }
+
+    protected function _alertParamsAdd($aContentInfo)
+    {
+        $aParams = $this->_alertParams($aContentInfo);
+
+        $CNF = &$this->_oConfig->CNF;
+
         if(!empty($CNF['OBJECT_METATAGS']))
         if(!empty($CNF['OBJECT_METATAGS']))
             $aParams['timeline_group'] = array(
             $aParams['timeline_group'] = array(
                 'by' => $this->getName() . '_' . (int)$aContentInfo[$CNF['FIELD_AUTHOR']] . '_' . (int)$aContentInfo[$CNF['FIELD_ID']],
                 'by' => $this->getName() . '_' . (int)$aContentInfo[$CNF['FIELD_AUTHOR']] . '_' . (int)$aContentInfo[$CNF['FIELD_ID']],
@@ -694,9 +678,61 @@ class BxBaseModTextModule extends BxBaseModGeneralModule implements iBxDolConten
         return $mResult;
         return $mResult;
     }
     }
 
 
-    
+
     // ====== PROTECTED METHODS
     // ====== PROTECTED METHODS
-    
+
+    protected function _getApproveForm($iContentId, $aContentInfo)
+    {
+        $CNF = &$this->_oConfig->CNF;
+
+        $sForm = 'sys_manage';
+        if(!empty($CNF['OBJECT_FORM_MANAGE']))
+            $sForm = $CNF['OBJECT_FORM_MANAGE'];
+
+        $sFormDisplay = 'sys_manage_approve';
+        if(!empty($CNF['OBJECT_FORM_MANAGE_APPROVE']))
+            $sFormDisplay = $CNF['OBJECT_FORM_MANAGE_APPROVE'];
+
+        $oForm = BxTemplFormView::getObjectInstance($sForm, $sFormDisplay);
+        $oForm->aFormAttrs['action'] = BX_DOL_URL_ROOT . $this->_oConfig->getBaseUri() . 'approve';
+        $oForm->aInputs['content_id']['value'] = $iContentId;
+        foreach($oForm->aInputs['controls'] as $iKey => $mixedValue)
+            if(is_numeric($iKey) && isset($mixedValue['name']) && $mixedValue['name'] == 'do_submit')
+                $oForm->aInputs['controls'][$iKey]['value'] = _t('_sys_form_manage_input_do_submit_approve');
+
+        bx_alert($this->_oConfig->getName(), 'get_approve_form', 0, 0, array(
+            'content_id' => $iContentId,
+            'content_info' => $aContentInfo,
+            'override_result' => &$oForm
+        ));
+
+        return $oForm;
+    }
+
+    protected function _sendApproveMessage($iContentId, $aContentInfo, &$oForm)
+    {
+        $CNF = &$this->_oConfig->CNF;
+
+        $sETemplate = 't_ManageApprove';
+        if(!empty($CNF['ETEMPLATE_MANAGE_APPROVE']))
+            $sETemplate = $CNF['ETEMPLATE_MANAGE_APPROVE'];
+
+        $aEParams = array(
+            'content_title' => !empty($CNF['FIELD_TITLE']) && !empty($aContentInfo[$CNF['FIELD_TITLE']]) ? $aContentInfo[$CNF['FIELD_TITLE']] : '',
+            'notes' => $oForm->getCleanValue('notes'),
+        );
+
+        bx_alert($this->_oConfig->getName(), 'get_approve_message', 0, 0, array(
+            'content_id' => $iContentId,
+            'content_info' => $aContentInfo,
+            'form' => $oForm,
+            'email_template' => &$sETemplate,
+            'email_params' => &$aEParams
+        ));
+
+        return sendMailTemplate($sETemplate, 0, $aContentInfo[$CNF['FIELD_AUTHOR']], $aEParams);
+    }
+
     protected function _getImagesForTimelinePost($aEvent, $aContentInfo, $sUrl, $aBrowseParams = array())
     protected function _getImagesForTimelinePost($aEvent, $aContentInfo, $sUrl, $aBrowseParams = array())
     {
     {
         $CNF = &$this->_oConfig->CNF;
         $CNF = &$this->_oConfig->CNF;

+ 11 - 1
modules/boonex/ads/classes/BxAdsConfig.php

@@ -48,7 +48,7 @@ class BxAdsConfig extends BxBaseModTextConfig
             'FIELD_AUTHOR' => 'author',
             'FIELD_AUTHOR' => 'author',
             'FIELD_ADDED' => 'added',
             'FIELD_ADDED' => 'added',
             'FIELD_CHANGED' => 'changed',
             'FIELD_CHANGED' => 'changed',
-            'FIELD_DELIVERED' => 'delivered',
+            'FIELD_SHIPPED' => 'shipped',
             'FIELD_RECEIVED' => 'received',
             'FIELD_RECEIVED' => 'received',
             'FIELD_TITLE' => 'title',
             'FIELD_TITLE' => 'title',
             'FIELD_NAME' => 'name',
             'FIELD_NAME' => 'name',
@@ -209,15 +209,25 @@ class BxAdsConfig extends BxBaseModTextConfig
                         'awaiting' => array('msg' => '_bx_ads_txt_processing_awaiting', 'type' => BX_INFORMER_ALERT),
                         'awaiting' => array('msg' => '_bx_ads_txt_processing_awaiting', 'type' => BX_INFORMER_ALERT),
                         'failed' => array('msg' => '_bx_ads_txt_processing_failed', 'type' => BX_INFORMER_ERROR)
                         'failed' => array('msg' => '_bx_ads_txt_processing_failed', 'type' => BX_INFORMER_ERROR)
                     ),
                     ),
+                ),
+                'auction' => array (
+                    'name' => 'bx-ads-auction',
+                    'map' => array (
+                        'offer' => array('msg' => '_bx_ads_txt_msg_auction_offer', 'type' => BX_INFORMER_INFO),
+                        'sold' => array('msg' => '_bx_ads_txt_msg_auction_sold', 'type' => BX_INFORMER_INFO)
+                    ),
                 )
                 )
             ),
             ),
 
 
             // email templates
             // email templates
             'ETEMPLATE_INTERESTED' => 'bx_ads_interested',
             'ETEMPLATE_INTERESTED' => 'bx_ads_interested',
             'ETEMPLATE_PURCHASED' => 'bx_ads_purchased',
             'ETEMPLATE_PURCHASED' => 'bx_ads_purchased',
+            'ETEMPLATE_SHIPPED' => 'bx_ads_shipped',
+            'ETEMPLATE_RECEIVED' => 'bx_ads_received',
             'ETEMPLATE_OFFER_ADDED' => 'bx_ads_offer_added',
             'ETEMPLATE_OFFER_ADDED' => 'bx_ads_offer_added',
             'ETEMPLATE_OFFER_ACCEPTED' => 'bx_ads_offer_accepted',
             'ETEMPLATE_OFFER_ACCEPTED' => 'bx_ads_offer_accepted',
             'ETEMPLATE_OFFER_DECLINED' => 'bx_ads_offer_declined',
             'ETEMPLATE_OFFER_DECLINED' => 'bx_ads_offer_declined',
+            'ETEMPLATE_OFFER_CANCELED' => 'bx_ads_offer_canceled',
 
 
             // some language keys
             // some language keys
             'T' => array (
             'T' => array (

+ 18 - 0
modules/boonex/ads/classes/BxAdsDb.php

@@ -454,6 +454,14 @@ class BxAdsDb extends BxBaseModTextDb
                     $sWhereClause = " AND `to`.`id`=:id";
                     $sWhereClause = " AND `to`.`id`=:id";
                     break;
                     break;
 
 
+                case 'accepted':
+                    $aMethod['name'] = 'getRow';
+                    $aMethod['params'][1]['content_id'] = (int)$aParams['content_id'];
+                    $aMethod['params'][1]['status'] = BX_ADS_OFFER_STATUS_ACCEPTED;
+
+                    $sWhereClause = " AND `to`.`content_id`=:content_id AND `to`.`status`=:status";
+                    break;
+
                 case 'content_author_id':
                 case 'content_author_id':
                     $aMethod['params'][1]['author_id'] = (int)$aParams['author_id'];
                     $aMethod['params'][1]['author_id'] = (int)$aParams['author_id'];
 
 
@@ -514,6 +522,16 @@ class BxAdsDb extends BxBaseModTextDb
 
 
         return (int)$this->query("UPDATE `" . $CNF['TABLE_OFFERS'] . "` SET " . $this->arrayToSQL($aSet) . " WHERE " . (!empty($aWhere) ? $this->arrayToSQL($aWhere, ' AND ') : "1")) > 0;
         return (int)$this->query("UPDATE `" . $CNF['TABLE_OFFERS'] . "` SET " . $this->arrayToSQL($aSet) . " WHERE " . (!empty($aWhere) ? $this->arrayToSQL($aWhere, ' AND ') : "1")) > 0;
     }
     }
+
+    public function deleteOffer($aWhere)
+    {
+        $CNF = &$this->_oConfig->CNF;
+
+        if(empty($aWhere) || !is_array($aWhere))
+            return false;
+
+        return (int)$this->query("DELETE FROM `" . $CNF['TABLE_OFFERS'] . "` WHERE " . (!empty($aWhere) ? $this->arrayToSQL($aWhere, ' AND ') : "1")) > 0;
+    }
 }
 }
 
 
 /** @} */
 /** @} */

+ 2 - 2
modules/boonex/ads/classes/BxAdsMenuView.php

@@ -96,8 +96,8 @@ class BxAdsMenuView extends BxBaseModTextMenuView
                 $bResult = $this->_oModule->isAllowedApprove($this->_aContentInfo);
                 $bResult = $this->_oModule->isAllowedApprove($this->_aContentInfo);
                 break;
                 break;
 
 
-            case 'delivered':
-                $bResult = $this->_oModule->isAllowedMarkDelivered($this->_aContentInfo);
+            case 'shipped':
+                $bResult = $this->_oModule->isAllowedMarkShipped($this->_aContentInfo);
                 break;
                 break;
 
 
             case 'received':
             case 'received':

+ 2 - 2
modules/boonex/ads/classes/BxAdsMenuViewActions.php

@@ -60,8 +60,8 @@ class BxAdsMenuViewActions extends BxBaseModTextMenuViewActions
     {
     {
         return $this->_getMenuItemByNameActions($aItem);
         return $this->_getMenuItemByNameActions($aItem);
     }
     }
-    
-    protected function _getMenuItemDelivered($aItem)
+
+    protected function _getMenuItemShipped($aItem)
     {
     {
         return $this->_getMenuItemByNameActions($aItem);
         return $this->_getMenuItemByNameActions($aItem);
     }
     }

+ 164 - 14
modules/boonex/ads/classes/BxAdsModule.php

@@ -9,9 +9,13 @@
  * @{
  * @{
  */
  */
 
 
+define('BX_ADS_STATUS_OFFER', 'offer');
+define('BX_ADS_STATUS_SOLD', 'sold');
+
 define('BX_ADS_OFFER_STATUS_ACCEPTED', 'accepted');
 define('BX_ADS_OFFER_STATUS_ACCEPTED', 'accepted');
 define('BX_ADS_OFFER_STATUS_AWAITING', 'awaiting');
 define('BX_ADS_OFFER_STATUS_AWAITING', 'awaiting');
 define('BX_ADS_OFFER_STATUS_DECLINED', 'declined');
 define('BX_ADS_OFFER_STATUS_DECLINED', 'declined');
+define('BX_ADS_OFFER_STATUS_CANCELED', 'canceled');
 
 
 /**
 /**
  * Ads module
  * Ads module
@@ -171,9 +175,32 @@ class BxAdsModule extends BxBaseModTextModule
         return echoJson(array('popup' => array('html' => $sContent, 'options' => array('closeOnOuterClick' => false, 'removeOnClose' => true))));
         return echoJson(array('popup' => array('html' => $sContent, 'options' => array('closeOnOuterClick' => false, 'removeOnClose' => true))));
     }
     }
 
 
-    public function actionDelivered()
+    public function actionCancelOffer()
     {
     {
-        return echoJson($this->_actionMarkAs('delivered'));
+        $CNF = &$this->_oConfig->CNF;
+
+        $iOfferId = bx_process_input(bx_get('id'), BX_DATA_INT);
+        $aOffer = $this->_oDb->getOffersBy(array(
+            'type' => 'id', 
+            'id' => $iOfferId
+        ));
+
+        if(empty($aOffer) || !is_array($aOffer))
+            return echoJson(array());
+
+        if(!$this->_oDb->updateOffer(array($CNF['FIELD_OFR_STATUS'] => BX_ADS_OFFER_STATUS_CANCELED), array($CNF['FIELD_OFR_ID'] => $iOfferId)))
+            return echoJson(array('msg' => _t('_bx_ads_txt_err_cannot_perform_action')));
+
+        $this->_oDb->updateEntriesBy(array($CNF['FIELD_STATUS'] => BX_BASE_MOD_TEXT_STATUS_ACTIVE), array($CNF['FIELD_ID'] => $aOffer[$CNF['FIELD_OFR_CONTENT']]));
+
+        $this->onOfferCanceled($iOfferId);
+
+        return echoJson(array('msg' => _t('_bx_ads_txt_msg_offer_canceled'), 'reload' => 1));
+    }
+
+    public function actionShipped()
+    {
+        return echoJson($this->_actionMarkAs('shipped'));
     }
     }
 
 
     public function actionReceived()
     public function actionReceived()
@@ -706,13 +733,18 @@ class BxAdsModule extends BxBaseModTextModule
             return array();
             return array();
 
 
         $aEntry = $this->_oDb->getContentInfoById($iItemId);
         $aEntry = $this->_oDb->getContentInfoById($iItemId);
-        if(empty($aEntry) || !is_array($aEntry) || (int)$aEntry[$CNF['FIELD_QUANTITY']] <= 0)
+        $iEntryQnt = (int)$aEntry[$CNF['FIELD_QUANTITY']];
+        if(empty($aEntry) || !is_array($aEntry) || ($iEntryQnt - $iItemCount) < 0)
             return array();
             return array();
 
 
         if(!$this->_oDb->registerLicense($iClientId, $iItemId, $iItemCount, $sOrder, $sLicense))
         if(!$this->_oDb->registerLicense($iClientId, $iItemId, $iItemCount, $sOrder, $sLicense))
             return array();
             return array();
 
 
-        $this->_oDb->updateEntriesBy(array($CNF['FIELD_QUANTITY'] => (int)$aEntry[$CNF['FIELD_QUANTITY']] - $iItemCount), array($CNF['FIELD_ID'] => $iItemId));
+        $iEntryQnt -= $iItemCount;
+        $this->_oDb->updateEntriesBy(array(
+            $CNF['FIELD_QUANTITY'] => $iEntryQnt,
+            $CNF['FIELD_STATUS'] => $iEntryQnt == 0 ? BX_ADS_STATUS_SOLD : BX_BASE_MOD_TEXT_STATUS_ACTIVE
+        ), array($CNF['FIELD_ID'] => $iItemId));
 
 
         bx_alert($this->getName(), 'license_register', 0, false, array(
         bx_alert($this->getName(), 'license_register', 0, false, array(
             'product_id' => $iItemId,
             'product_id' => $iItemId,
@@ -722,6 +754,11 @@ class BxAdsModule extends BxBaseModTextModule
             'count' => $iItemCount
             'count' => $iItemCount
         ));
         ));
 
 
+        if($iEntryQnt == 0) {
+            $aParams = $this->_alertParams($aEntry);
+            bx_alert($this->getName(), 'sold', $iItemId, false, $aParams);
+        }
+
         $oClient = BxDolProfile::getInstanceMagic($iClientId);
         $oClient = BxDolProfile::getInstanceMagic($iClientId);
         $oSeller = BxDolProfile::getInstanceMagic($iSellerId);
         $oSeller = BxDolProfile::getInstanceMagic($iSellerId);
         $sSellerUrl = $oSeller->getUrl();
         $sSellerUrl = $oSeller->getUrl();
@@ -1017,6 +1054,22 @@ class BxAdsModule extends BxBaseModTextModule
         return $this->_oTemplate->entryOfferAccepted($iUserId, $aContent, $aOffer);
         return $this->_oTemplate->entryOfferAccepted($iUserId, $aContent, $aOffer);
     }
     }
 
 
+    public function isEntryActive($aContentInfo)
+    {
+        $CNF = &$this->_oConfig->CNF;
+
+        if($aContentInfo[$CNF['FIELD_AUTHOR']] == bx_get_logged_profile_id() || $this->_isModerator())
+            return true;
+
+        if(isset($CNF['FIELD_STATUS']) && !in_array($aContentInfo[$CNF['FIELD_STATUS']], array(BX_BASE_MOD_TEXT_STATUS_ACTIVE, BX_ADS_STATUS_OFFER, BX_ADS_STATUS_SOLD)))
+            return false;
+
+        if(isset($CNF['FIELD_STATUS_ADMIN']) && $aContentInfo[$CNF['FIELD_STATUS_ADMIN']] != 'active')
+            return false;
+
+        return true;        
+    }
+
     public function isAuction($aContentInfo)
     public function isAuction($aContentInfo)
     {
     {
         $CNF = &$this->_oConfig->CNF;
         $CNF = &$this->_oConfig->CNF;
@@ -1077,12 +1130,12 @@ class BxAdsModule extends BxBaseModTextModule
         return _t($sTxtError);
         return _t($sTxtError);
     }
     }
 
 
-    public function isAllowedMarkDelivered($mixedContent, $isPerformAction = false)
+    public function isAllowedMarkShipped($mixedContent, $isPerformAction = false)
     {
     {
-        return $this->checkAllowedMarkDelivered($mixedContent, $isPerformAction) === CHECK_ACTION_RESULT_ALLOWED;
+        return $this->checkAllowedMarkShipped($mixedContent, $isPerformAction) === CHECK_ACTION_RESULT_ALLOWED;
     }
     }
 
 
-    public function checkAllowedMarkDelivered($mixedContent, $isPerformAction = false)
+    public function checkAllowedMarkShipped($mixedContent, $isPerformAction = false)
     {
     {
         $CNF = &$this->_oConfig->CNF;
         $CNF = &$this->_oConfig->CNF;
         $sTxtError = '_sys_txt_access_denied';
         $sTxtError = '_sys_txt_access_denied';
@@ -1093,7 +1146,7 @@ class BxAdsModule extends BxBaseModTextModule
         if(empty($mixedContent) || !is_array($mixedContent))
         if(empty($mixedContent) || !is_array($mixedContent))
             return _t($sTxtError);
             return _t($sTxtError);
 
 
-        if((int)$mixedContent[$CNF['FIELD_DELIVERED']] != 0 || $mixedContent[$CNF['FIELD_AUTHOR']] != bx_get_logged_profile_id())
+        if((int)$mixedContent[$CNF['FIELD_SHIPPED']] != 0 || $mixedContent[$CNF['FIELD_AUTHOR']] != bx_get_logged_profile_id())
             return _t($sTxtError);
             return _t($sTxtError);
 
 
         return CHECK_ACTION_RESULT_ALLOWED;
         return CHECK_ACTION_RESULT_ALLOWED;
@@ -1140,8 +1193,8 @@ class BxAdsModule extends BxBaseModTextModule
         sendMailTemplate($CNF['ETEMPLATE_OFFER_ADDED'], 0, $aContentInfo[$CNF['FIELD_AUTHOR']], array(
         sendMailTemplate($CNF['ETEMPLATE_OFFER_ADDED'], 0, $aContentInfo[$CNF['FIELD_AUTHOR']], array(
             'viewer_name' => $oViewer->getDisplayName(),
             'viewer_name' => $oViewer->getDisplayName(),
             'viewer_url' => $oViewer->getUrl(),
             'viewer_url' => $oViewer->getUrl(),
-            'ad_name' => $aContentInfo[$CNF['FIELD_TITLE']],
-            'ad_url' => BX_DOL_URL_ROOT . BxDolPermalinks::getInstance()->permalink('page.php', array(
+            'entry_name' => $aContentInfo[$CNF['FIELD_TITLE']],
+            'entry_url' => BX_DOL_URL_ROOT . BxDolPermalinks::getInstance()->permalink('page.php', array(
                 'i' => $CNF['URI_VIEW_ENTRY'], 
                 'i' => $CNF['URI_VIEW_ENTRY'], 
                 $CNF['FIELD_ID'] => $iContentId
                 $CNF['FIELD_ID'] => $iContentId
             ))
             ))
@@ -1164,14 +1217,17 @@ class BxAdsModule extends BxBaseModTextModule
         if(empty($aContentInfo) || !is_array($aContentInfo))
         if(empty($aContentInfo) || !is_array($aContentInfo))
             return;
             return;
 
 
+        if(!$this->_oDb->updateEntriesBy(array($CNF['FIELD_STATUS'] => BX_ADS_STATUS_OFFER), array($CNF['FIELD_ID'] => $iContentId)))
+            return;
+
         $iOfferer = (int)$aOfferInfo[$CNF['FIELD_OFR_AUTHOR']];
         $iOfferer = (int)$aOfferInfo[$CNF['FIELD_OFR_AUTHOR']];
         $oOfferer = BxDolProfile::getInstanceMagic($iOfferer);
         $oOfferer = BxDolProfile::getInstanceMagic($iOfferer);
 
 
         sendMailTemplate($CNF['ETEMPLATE_OFFER_ACCEPTED'], 0, $iOfferer, array(
         sendMailTemplate($CNF['ETEMPLATE_OFFER_ACCEPTED'], 0, $iOfferer, array(
             'offerer_name' => $oOfferer->getDisplayName(),
             'offerer_name' => $oOfferer->getDisplayName(),
             'offerer_url' => $oOfferer->getUrl(),
             'offerer_url' => $oOfferer->getUrl(),
-            'ad_name' => $aContentInfo[$CNF['FIELD_TITLE']],
-            'ad_url' => BX_DOL_URL_ROOT . BxDolPermalinks::getInstance()->permalink('page.php', array(
+            'entry_name' => $aContentInfo[$CNF['FIELD_TITLE']],
+            'entry_url' => BX_DOL_URL_ROOT . BxDolPermalinks::getInstance()->permalink('page.php', array(
                 'i' => $CNF['URI_VIEW_ENTRY'], 
                 'i' => $CNF['URI_VIEW_ENTRY'], 
                 $CNF['FIELD_ID'] => $iContentId
                 $CNF['FIELD_ID'] => $iContentId
             ))
             ))
@@ -1200,8 +1256,8 @@ class BxAdsModule extends BxBaseModTextModule
         sendMailTemplate($CNF['ETEMPLATE_OFFER_DECLINED'], 0, $iOfferer, array(
         sendMailTemplate($CNF['ETEMPLATE_OFFER_DECLINED'], 0, $iOfferer, array(
             'offerer_name' => $oOfferer->getDisplayName(),
             'offerer_name' => $oOfferer->getDisplayName(),
             'offerer_url' => $oOfferer->getUrl(),
             'offerer_url' => $oOfferer->getUrl(),
-            'ad_name' => $aContentInfo[$CNF['FIELD_TITLE']],
-            'ad_url' => BX_DOL_URL_ROOT . BxDolPermalinks::getInstance()->permalink('page.php', array(
+            'entry_name' => $aContentInfo[$CNF['FIELD_TITLE']],
+            'entry_url' => BX_DOL_URL_ROOT . BxDolPermalinks::getInstance()->permalink('page.php', array(
                 'i' => $CNF['URI_VIEW_ENTRY'], 
                 'i' => $CNF['URI_VIEW_ENTRY'], 
                 $CNF['FIELD_ID'] => $iContentId
                 $CNF['FIELD_ID'] => $iContentId
             ))
             ))
@@ -1211,10 +1267,100 @@ class BxAdsModule extends BxBaseModTextModule
         bx_alert($this->getName(), 'offer_declined', $iOfferId, $aContentInfo[$CNF['FIELD_AUTHOR']], $aParams);
         bx_alert($this->getName(), 'offer_declined', $iOfferId, $aContentInfo[$CNF['FIELD_AUTHOR']], $aParams);
     }
     }
 
 
+    public function onOfferCanceled($iOfferId)
+    {
+        $CNF = &$this->_oConfig->CNF;
+
+        $aOfferInfo = $this->_oDb->getOffersBy(array('type' => 'id', 'id' => $iOfferId));
+        if(empty($aOfferInfo) || !is_array($aOfferInfo))
+            return;
+
+        $iContentId = (int)$aOfferInfo[$CNF['FIELD_OFR_CONTENT']];
+        $aContentInfo = $this->_oDb->getContentInfoById($iContentId);
+        if(empty($aContentInfo) || !is_array($aContentInfo))
+            return;
+
+        $iOfferer = (int)$aOfferInfo[$CNF['FIELD_OFR_AUTHOR']];
+        $oOfferer = BxDolProfile::getInstanceMagic($iOfferer);
+
+        sendMailTemplate($CNF['ETEMPLATE_OFFER_CANCELED'], 0, (int)$aContentInfo[$CNF['FIELD_AUTHOR']], array(
+            'offerer_name' => $oOfferer->getDisplayName(),
+            'offerer_url' => $oOfferer->getUrl(),
+            'entry_name' => $aContentInfo[$CNF['FIELD_TITLE']],
+            'entry_url' => BX_DOL_URL_ROOT . BxDolPermalinks::getInstance()->permalink('page.php', array(
+                'i' => $CNF['URI_VIEW_ENTRY'], 
+                $CNF['FIELD_ID'] => $iContentId
+            ))
+        ));
+
+        $aParams = $this->_alertParamsOffer($aContentInfo, $aOfferInfo);
+        bx_alert($this->getName(), 'offer_canceled', $iOfferId, $aContentInfo[$CNF['FIELD_AUTHOR']], $aParams);
+    }
 
 
     /**
     /**
      * Common methods.
      * Common methods.
      */
      */
+    public function onShipped($mixedContent)
+    {
+        $CNF = &$this->_oConfig->CNF;
+
+        if(!is_array($mixedContent))
+            $mixedContent = $this->_oDb->getContentInfoById((int)$mixedContent);
+        $iContentId = (int)$mixedContent[$CNF['FIELD_ID']];
+
+        $aOffer = $this->_oDb->getOffersBy(array('type' => 'accepted', 'content_id' => $iContentId));
+        if(empty($aOffer) || !is_array($aOffer))
+            return;
+
+        $iClient = (int)$aOffer[$CNF['FIELD_OFR_AUTHOR']];
+        $iVendor = (int)$mixedContent[$CNF['FIELD_AUTHOR']];
+        $oVendor = BxDolProfile::getInstanceMagic($iVendor);
+
+        sendMailTemplate($CNF['ETEMPLATE_SHIPPED'], 0, $iClient, array(
+            'vendor_name' => $oVendor->getDisplayName(),
+            'vendor_url' => $oVendor->getUrl(),
+            'entry_name' => $mixedContent[$CNF['FIELD_TITLE']],
+            'entry_url' => BX_DOL_URL_ROOT . BxDolPermalinks::getInstance()->permalink('page.php', array(
+                'i' => $CNF['URI_VIEW_ENTRY'], 
+                $CNF['FIELD_ID'] => $iContentId
+            ))
+        ));
+
+        $aParams = $this->_alertParams($mixedContent);
+        $aParams['offer_author_id'] = $iClient;
+        bx_alert($this->getName(), 'shipped', $iContentId, false, $aParams);
+    }
+
+    public function onReceived($mixedContent)
+    {
+        $CNF = &$this->_oConfig->CNF;
+
+        if(!is_array($mixedContent))
+            $mixedContent = $this->_oDb->getContentInfoById((int)$mixedContent);
+        $iContentId = (int)$mixedContent[$CNF['FIELD_ID']];
+
+        $aOffer = $this->_oDb->getOffersBy(array('type' => 'accepted', 'content_id' => $iContentId));
+        if(empty($aOffer) || !is_array($aOffer))
+            return;
+
+        $iClient = (int)$aOffer[$CNF['FIELD_OFR_AUTHOR']];
+        $oClient = BxDolProfile::getInstanceMagic($iClient);
+
+        sendMailTemplate($CNF['ETEMPLATE_RECEIVED'], 0, (int)$mixedContent[$CNF['FIELD_AUTHOR']], array(
+            'client_name' => $oClient->getDisplayName(),
+            'client_url' => $oClient->getUrl(),
+            'entry_name' => $mixedContent[$CNF['FIELD_TITLE']],
+            'entry_url' => BX_DOL_URL_ROOT . BxDolPermalinks::getInstance()->permalink('page.php', array(
+                'i' => $CNF['URI_VIEW_ENTRY'], 
+                $CNF['FIELD_ID'] => $iContentId
+            ))
+        ));
+
+        $aParams = $this->_alertParams($mixedContent);
+        $aParams['offer_author_id'] = $iClient;
+        bx_alert($this->getName(), 'received', $iContentId, false, $aParams);
+    }
+
     public function processMetasAdd($iContentId)
     public function processMetasAdd($iContentId)
     {
     {
         if(!parent::processMetasAdd($iContentId))
         if(!parent::processMetasAdd($iContentId))
@@ -1289,6 +1435,10 @@ class BxAdsModule extends BxBaseModTextModule
 
 
         $this->$sMethodCheck($aContentInfo, true);
         $this->$sMethodCheck($aContentInfo, true);
 
 
+        $sMethodOnResult = 'on' . bx_gen_method_name($sAction);
+        if(method_exists($this, $sMethodOnResult))
+            $this->$sMethodOnResult($aContentInfo);        
+
         return array(
         return array(
             'reload' => 1
             'reload' => 1
         );
         );

+ 18 - 0
modules/boonex/ads/classes/BxAdsPageEntry.php

@@ -19,6 +19,24 @@ class BxAdsPageEntry extends BxBaseModTextPageEntry
         $this->MODULE = 'bx_ads';
         $this->MODULE = 'bx_ads';
 
 
         parent::__construct($aObject, $oTemplate);
         parent::__construct($aObject, $oTemplate);
+
+        $CNF = &$this->_oModule->_oConfig->CNF;
+
+        if(($oInformer = BxDolInformer::getInstance($this->_oTemplate)) !== false) {
+            $aInformers = array();
+            $sStatus = isset($CNF['FIELD_STATUS']) && isset($this->_aContentInfo[$CNF['FIELD_STATUS']]) ? $this->_aContentInfo[$CNF['FIELD_STATUS']] : '';
+
+            //--- Display 'auction' informer.
+            if(!empty($CNF['INFORMERS']['auction']) && isset($CNF['INFORMERS']['auction']['map'][$sStatus])) {
+                $aInformer = $CNF['INFORMERS']['auction'];
+                $aInformers[] = array ('name' => $aInformer['name'], 'msg' => _t($aInformer['map'][$sStatus]['msg']), 'type' => $aInformer['map'][$sStatus]['type']);
+            }
+
+            //--- Add informers
+            if($aInformers)
+                foreach($aInformers as $aInformer)
+                    $oInformer->add($aInformer['name'], $this->_replaceMarkers($aInformer['msg']), $aInformer['type']);
+        }
     }
     }
 
 
     public function getCode ()
     public function getCode ()

+ 9 - 7
modules/boonex/ads/classes/BxAdsTemplate.php

@@ -27,21 +27,23 @@ class BxAdsTemplate extends BxBaseModTextTemplate
     {
     {
         $CNF = &$this->_oConfig->CNF;
         $CNF = &$this->_oConfig->CNF;
 
 
-        $sJsCode = $sJsMethod = '';
-        $aJs = BxDolPayments::getInstance()->getAddToCartJs($aContent[$CNF['FIELD_AUTHOR']], $this->MODULE, $aContent[$CNF['FIELD_ID']], $aOffer[$CNF['FIELD_OFR_QUANTITY']], true);
-        if(!empty($aJs) && is_array($aJs))
-            list($sJsCode, $sJsMethod) = $aJs;
+        $sJsCodePay = $sJsMethodPay = '';
+        $aJsPay = BxDolPayments::getInstance()->getAddToCartJs($aContent[$CNF['FIELD_AUTHOR']], $this->MODULE, $aContent[$CNF['FIELD_ID']], $aOffer[$CNF['FIELD_OFR_QUANTITY']], true);
+        if(!empty($aJsPay) && is_array($aJsPay))
+            list($sJsCodePay, $sJsMethodPay) = $aJsPay;
 
 
         return $this->parseHtmlByName('entry-offer-accepted.html', array(
         return $this->parseHtmlByName('entry-offer-accepted.html', array(
+            'js_object' => $this->_oConfig->getJsObject('entry'),
+            'id' => $aOffer['id'],
             'amount' => _t_format_currency($aOffer['amount']),
             'amount' => _t_format_currency($aOffer['amount']),
             'quantity' => _t('_bx_ads_txt_n_items', $aOffer['quantity']),
             'quantity' => _t('_bx_ads_txt_n_items', $aOffer['quantity']),
             'bx_if:show_pay' => array(
             'bx_if:show_pay' => array(
-                'condition' => !empty($sJsMethod),
+                'condition' => !empty($sJsMethodPay),
                 'content' => array(
                 'content' => array(
-                    'js_method' => $sJsMethod,
+                    'js_method_pay' => $sJsMethodPay,
                 )
                 )
             ),
             ),
-            'js_code' => $sJsCode
+            'js_code' => $sJsCodePay
         ));
         ));
     }
     }
 
 

+ 34 - 8
modules/boonex/ads/install/langs/en.xml

@@ -291,8 +291,8 @@
     <string name="_bx_ads_menu_item_title_edit_entry"><![CDATA[Edit]]></string>
     <string name="_bx_ads_menu_item_title_edit_entry"><![CDATA[Edit]]></string>
     <string name="_bx_ads_menu_item_title_system_delete_entry"><![CDATA[Delete]]></string>
     <string name="_bx_ads_menu_item_title_system_delete_entry"><![CDATA[Delete]]></string>
     <string name="_bx_ads_menu_item_title_delete_entry"><![CDATA[Delete]]></string>
     <string name="_bx_ads_menu_item_title_delete_entry"><![CDATA[Delete]]></string>
-    <string name="_bx_ads_menu_item_title_system_mark_delivered"><![CDATA[Delivered]]></string>
-    <string name="_bx_ads_menu_item_title_mark_delivered"><![CDATA[Delivered]]></string>
+    <string name="_bx_ads_menu_item_title_system_mark_shipped"><![CDATA[Shipped]]></string>
+    <string name="_bx_ads_menu_item_title_mark_shipped"><![CDATA[Shipped]]></string>
     <string name="_bx_ads_menu_item_title_system_mark_received"><![CDATA[Received]]></string>
     <string name="_bx_ads_menu_item_title_system_mark_received"><![CDATA[Received]]></string>
     <string name="_bx_ads_menu_item_title_mark_received"><![CDATA[Received]]></string>
     <string name="_bx_ads_menu_item_title_mark_received"><![CDATA[Received]]></string>
     <string name="_bx_ads_menu_item_title_system_review_entry"><![CDATA[Review]]></string>
     <string name="_bx_ads_menu_item_title_system_review_entry"><![CDATA[Review]]></string>
@@ -458,33 +458,54 @@
 <p><b><a href="{viewer_url}">{viewer_name}</a></b> is interested in your ad <b><a href="{ad_url}">{ad_name}</a></b>.</p>
 <p><b><a href="{viewer_url}">{viewer_name}</a></b> is interested in your ad <b><a href="{ad_url}">{ad_name}</a></b>.</p>
 {email_footer}]]></string>
 {email_footer}]]></string>
 
 
-    <string name="_bx_ads_et_txt_name_purchased"><![CDATA[Ad purchased.]]></string>
+    <string name="_bx_ads_et_txt_name_purchased"><![CDATA[Ad was purchased.]]></string>
     <string name="_bx_ads_et_txt_subject_purchased"><![CDATA[You've purchased {entry_name} ad.]]></string>
     <string name="_bx_ads_et_txt_subject_purchased"><![CDATA[You've purchased {entry_name} ad.]]></string>
     <string name="_bx_ads_et_txt_body_purchased"><![CDATA[{email_header}
     <string name="_bx_ads_et_txt_body_purchased"><![CDATA[{email_header}
 <p>Hello, {client_name}.</p>
 <p>Hello, {client_name}.</p>
 <p>You've purchased <a href="{entry_url}">{entry_name}</a> ad ({count} item(s)) from <a href="{vendor_url}">{vendor_name}</a>.<br />Your license is <b>{license}</b>.</p>
 <p>You've purchased <a href="{entry_url}">{entry_name}</a> ad ({count} item(s)) from <a href="{vendor_url}">{vendor_name}</a>.<br />Your license is <b>{license}</b>.</p>
 <p>{notes}</p>
 <p>{notes}</p>
+{email_footer}]]></string>
+
+    <string name="_bx_ads_et_txt_name_shipped"><![CDATA[Ad was shipped.]]></string>
+    <string name="_bx_ads_et_txt_subject_shipped"><![CDATA[Ad {entry_name} was shipped.]]></string>
+    <string name="_bx_ads_et_txt_body_shipped"><![CDATA[{email_header}
+<p>Hello, {profile_name}.</p>
+<p>The <a href="{entry_url}">{entry_name}</a> ad was shipped by <a href="{vendor_url}">{vendor_name}</a>.</p>
+{email_footer}]]></string>
+
+    <string name="_bx_ads_et_txt_name_received"><![CDATA[Ad received.]]></string>
+    <string name="_bx_ads_et_txt_subject_received"><![CDATA[Ad {entry_name} was received.]]></string>
+    <string name="_bx_ads_et_txt_body_received"><![CDATA[{email_header}
+<p>Hello, {profile_name}.</p>
+<p>The <a href="{entry_url}">{entry_name}</a> ad was received by <a href="{client_url}">{client_name}</a>.</p>
 {email_footer}]]></string>
 {email_footer}]]></string>
 
 
     <string name="_bx_ads_et_txt_name_offer_added"><![CDATA[New offer was added.]]></string>
     <string name="_bx_ads_et_txt_name_offer_added"><![CDATA[New offer was added.]]></string>
     <string name="_bx_ads_et_txt_subject_offer_added"><![CDATA[{viewer_name} added an offer for your ad.]]></string>
     <string name="_bx_ads_et_txt_subject_offer_added"><![CDATA[{viewer_name} added an offer for your ad.]]></string>
     <string name="_bx_ads_et_txt_body_offer_added"><![CDATA[{email_header}
     <string name="_bx_ads_et_txt_body_offer_added"><![CDATA[{email_header}
 <p>Hello, {profile_name}.</p>
 <p>Hello, {profile_name}.</p>
-<p><b><a href="{viewer_url}">{viewer_name}</a></b> added an offer for your ad <b><a href="{ad_url}">{ad_name}</a></b>.</p>
+<p><b><a href="{viewer_url}">{viewer_name}</a></b> added an offer for your ad <b><a href="{entry_url}">{entry_name}</a></b>.</p>
 {email_footer}]]></string>
 {email_footer}]]></string>
 
 
     <string name="_bx_ads_et_txt_name_offer_accepted"><![CDATA[The offer was accepted.]]></string>
     <string name="_bx_ads_et_txt_name_offer_accepted"><![CDATA[The offer was accepted.]]></string>
-    <string name="_bx_ads_et_txt_subject_offer_accepted"><![CDATA[Your offer for {ad_name} ad was accepted.]]></string>
+    <string name="_bx_ads_et_txt_subject_offer_accepted"><![CDATA[Your offer for {entry_name} ad was accepted.]]></string>
     <string name="_bx_ads_et_txt_body_offer_accepted"><![CDATA[{email_header}
     <string name="_bx_ads_et_txt_body_offer_accepted"><![CDATA[{email_header}
 <p>Hello, {offerer_name}.</p>
 <p>Hello, {offerer_name}.</p>
-<p>Your offer for <b><a href="{ad_url}">{ad_name}</a></b> ad was accepted.</p>
+<p>Your offer for <b><a href="{entry_url}">{entry_name}</a></b> ad was accepted.</p>
 {email_footer}]]></string>
 {email_footer}]]></string>
 
 
     <string name="_bx_ads_et_txt_name_offer_declined"><![CDATA[The offer was declined.]]></string>
     <string name="_bx_ads_et_txt_name_offer_declined"><![CDATA[The offer was declined.]]></string>
-    <string name="_bx_ads_et_txt_subject_offer_declined"><![CDATA[Your offer for {ad_name} ad was declined.]]></string>
+    <string name="_bx_ads_et_txt_subject_offer_declined"><![CDATA[Your offer for {entry_name} ad was declined.]]></string>
     <string name="_bx_ads_et_txt_body_offer_declined"><![CDATA[{email_header}
     <string name="_bx_ads_et_txt_body_offer_declined"><![CDATA[{email_header}
 <p>Hello, {offerer_name}.</p>
 <p>Hello, {offerer_name}.</p>
-<p>Your offer for <b><a href="{ad_url}">{ad_name}</a></b> ad was declined.</p>
+<p>Your offer for <b><a href="{entry_url}">{entry_name}</a></b> ad was declined.</p>
+{email_footer}]]></string>
+
+    <string name="_bx_ads_et_txt_name_offer_canceled"><![CDATA[The offer was canceled.]]></string>
+    <string name="_bx_ads_et_txt_subject_offer_canceled"><![CDATA[{offerer_name} canceled the offer for {entry_name} ad.]]></string>
+    <string name="_bx_ads_et_txt_body_offer_canceled"><![CDATA[{email_header}
+<p>Hello, {profile_name}.</p>
+<p><a href="{offerer_url}">{offerer_name}</a> canceled the offer for <b><a href="{entry_url}">{entry_name}</a></b> ad.</p>
 {email_footer}]]></string>
 {email_footer}]]></string>
 
 
     <string name="_bx_ads_txt_all_entries_in"><![CDATA[<a href="{0}">All Ads in {1} ({2})</a>]]></string>
     <string name="_bx_ads_txt_all_entries_in"><![CDATA[<a href="{0}">All Ads in {1} ({2})</a>]]></string>
@@ -507,15 +528,20 @@
     <string name="_bx_ads_txt_offer_status_awaiting"><![CDATA[Awaiting]]></string>
     <string name="_bx_ads_txt_offer_status_awaiting"><![CDATA[Awaiting]]></string>
     <string name="_bx_ads_txt_offer_status_accepted"><![CDATA[Accepted]]></string>
     <string name="_bx_ads_txt_offer_status_accepted"><![CDATA[Accepted]]></string>
     <string name="_bx_ads_txt_offer_status_declined"><![CDATA[Declined]]></string>
     <string name="_bx_ads_txt_offer_status_declined"><![CDATA[Declined]]></string>
+    <string name="_bx_ads_txt_offer_status_canceled"><![CDATA[Canceled]]></string>
     <string name="_bx_ads_txt_your_offer"><![CDATA[Your offer]]></string>
     <string name="_bx_ads_txt_your_offer"><![CDATA[Your offer]]></string>
     <string name="_bx_ads_txt_accepted"><![CDATA[was accepted]]></string>
     <string name="_bx_ads_txt_accepted"><![CDATA[was accepted]]></string>
     <string name="_bx_ads_txt_n_items"><![CDATA[{0} item(s)]]></string>
     <string name="_bx_ads_txt_n_items"><![CDATA[{0} item(s)]]></string>
     <string name="_bx_ads_txt_pay"><![CDATA[Pay]]></string>
     <string name="_bx_ads_txt_pay"><![CDATA[Pay]]></string>
+    <string name="_bx_ads_txt_cancel"><![CDATA[Cancel]]></string>
 
 
     <string name="_bx_ads_txt_msg_status_hidden"><![CDATA[This ad was hidden.]]></string>
     <string name="_bx_ads_txt_msg_status_hidden"><![CDATA[This ad was hidden.]]></string>
     <string name="_bx_ads_txt_msg_status_pending"><![CDATA[This ad is pending approval.]]></string>
     <string name="_bx_ads_txt_msg_status_pending"><![CDATA[This ad is pending approval.]]></string>
+    <string name="_bx_ads_txt_msg_auction_offer"><![CDATA[This ad is under offer.]]></string>
+    <string name="_bx_ads_txt_msg_auction_sold"><![CDATA[This ad was sold.]]></string>
     <string name="_bx_ads_txt_msg_author_notified"><![CDATA[Advertiser was notified, that you're interested in his ad. Please wait.]]></string>
     <string name="_bx_ads_txt_msg_author_notified"><![CDATA[Advertiser was notified, that you're interested in his ad. Please wait.]]></string>
     <string name="_bx_ads_txt_msg_offer_added"><![CDATA[Your offer was added. Advertiser will be notified about it. Please wait.]]></string>
     <string name="_bx_ads_txt_msg_offer_added"><![CDATA[Your offer was added. Advertiser will be notified about it. Please wait.]]></string>
+    <string name="_bx_ads_txt_msg_offer_canceled"><![CDATA[The offer was canceled.]]></string>
     <string name="_bx_ads_txt_err_offer_duplicate"><![CDATA[You already made an offer. Please wait for the results.]]></string>
     <string name="_bx_ads_txt_err_offer_duplicate"><![CDATA[You already made an offer. Please wait for the results.]]></string>
     <string name="_bx_ads_txt_err_offer_accepted"><![CDATA[Your offer was already accepted.]]></string>
     <string name="_bx_ads_txt_err_offer_accepted"><![CDATA[Your offer was already accepted.]]></string>
     <string name="_bx_ads_txt_err_your_own"><![CDATA[You cannot do the action because it's your own ad.]]></string>
     <string name="_bx_ads_txt_err_your_own"><![CDATA[You cannot do the action because it's your own ad.]]></string>

+ 6 - 3
modules/boonex/ads/install/sql/enable.sql

@@ -252,7 +252,7 @@ INSERT INTO `sys_menu_items`(`set_name`, `module`, `name`, `title_system`, `titl
 ('bx_ads_view', 'bx_ads', 'edit-ad', '_bx_ads_menu_item_title_system_edit_entry', '_bx_ads_menu_item_title_edit_entry', 'page.php?i=edit-ad&id={content_id}', '', '', 'pencil-alt', '', 2147483647, 1, 0, 20),
 ('bx_ads_view', 'bx_ads', 'edit-ad', '_bx_ads_menu_item_title_system_edit_entry', '_bx_ads_menu_item_title_edit_entry', 'page.php?i=edit-ad&id={content_id}', '', '', 'pencil-alt', '', 2147483647, 1, 0, 20),
 ('bx_ads_view', 'bx_ads', 'delete-ad', '_bx_ads_menu_item_title_system_delete_entry', '_bx_ads_menu_item_title_delete_entry', 'page.php?i=delete-ad&id={content_id}', '', '', 'remove', '', 2147483647, 1, 0, 30),
 ('bx_ads_view', 'bx_ads', 'delete-ad', '_bx_ads_menu_item_title_system_delete_entry', '_bx_ads_menu_item_title_delete_entry', 'page.php?i=delete-ad&id={content_id}', '', '', 'remove', '', 2147483647, 1, 0, 30),
 ('bx_ads_view', 'bx_ads', 'approve', '_sys_menu_item_title_system_va_approve', '_sys_menu_item_title_va_approve', 'javascript:void(0)', 'javascript:bx_approve(this,  ''{module_uri}'', {content_id});', '', 'check', '', 2147483647, 1, 0, 40),
 ('bx_ads_view', 'bx_ads', 'approve', '_sys_menu_item_title_system_va_approve', '_sys_menu_item_title_va_approve', 'javascript:void(0)', 'javascript:bx_approve(this,  ''{module_uri}'', {content_id});', '', 'check', '', 2147483647, 1, 0, 40),
-('bx_ads_view', 'bx_ads', 'delivered', '_bx_ads_menu_item_title_system_mark_delivered', '_bx_ads_menu_item_title_mark_delivered', 'javascript:void(0)', 'javascript:{js_object}.delivered(this, {content_id})', '', 'truck', '', 2147483647, 1, 0, 50),
+('bx_ads_view', 'bx_ads', 'shipped', '_bx_ads_menu_item_title_system_mark_shipped', '_bx_ads_menu_item_title_mark_shipped', 'javascript:void(0)', 'javascript:{js_object}.shipped(this, {content_id})', '', 'truck', '', 2147483647, 1, 0, 50),
 ('bx_ads_view', 'bx_ads', 'received', '_bx_ads_menu_item_title_system_mark_received', '_bx_ads_menu_item_title_mark_received', 'javascript:void(0)', 'javascript:{js_object}.received(this, {content_id})', '', 'clipboard-check', '', 2147483647, 1, 0, 55);
 ('bx_ads_view', 'bx_ads', 'received', '_bx_ads_menu_item_title_system_mark_received', '_bx_ads_menu_item_title_mark_received', 'javascript:void(0)', 'javascript:{js_object}.received(this, {content_id})', '', 'clipboard-check', '', 2147483647, 1, 0, 55);
 
 
 -- MENU: all actions menu for view entry 
 -- MENU: all actions menu for view entry 
@@ -270,7 +270,7 @@ INSERT INTO `sys_menu_items`(`set_name`, `module`, `name`, `title_system`, `titl
 ('bx_ads_view_actions', 'bx_ads', 'edit-ad', '_bx_ads_menu_item_title_system_edit_entry', '', '', '', '', '', '', '', 0, 2147483647, 1, 0, 20),
 ('bx_ads_view_actions', 'bx_ads', 'edit-ad', '_bx_ads_menu_item_title_system_edit_entry', '', '', '', '', '', '', '', 0, 2147483647, 1, 0, 20),
 ('bx_ads_view_actions', 'bx_ads', 'delete-ad', '_bx_ads_menu_item_title_system_delete_entry', '', '', '', '', '', '', '', 0, 2147483647, 1, 0, 30),
 ('bx_ads_view_actions', 'bx_ads', 'delete-ad', '_bx_ads_menu_item_title_system_delete_entry', '', '', '', '', '', '', '', 0, 2147483647, 1, 0, 30),
 ('bx_ads_view_actions', 'bx_ads', 'approve', '_sys_menu_item_title_system_va_approve', '', '', '', '', '', '', '', 0, 2147483647, 1, 0, 40),
 ('bx_ads_view_actions', 'bx_ads', 'approve', '_sys_menu_item_title_system_va_approve', '', '', '', '', '', '', '', 0, 2147483647, 1, 0, 40),
-('bx_ads_view_actions', 'bx_ads', 'delivered', '_bx_ads_menu_item_title_system_mark_delivered', '', '', '', '', '', '', '', 0, 2147483647, 1, 0, 50),
+('bx_ads_view_actions', 'bx_ads', 'shipped', '_bx_ads_menu_item_title_system_mark_shipped', '', '', '', '', '', '', '', 0, 2147483647, 1, 0, 50),
 ('bx_ads_view_actions', 'bx_ads', 'received', '_bx_ads_menu_item_title_system_mark_received', '', '', '', '', '', '', '', 0, 2147483647, 1, 0, 55),
 ('bx_ads_view_actions', 'bx_ads', 'received', '_bx_ads_menu_item_title_system_mark_received', '', '', '', '', '', '', '', 0, 2147483647, 1, 0, 55),
 ('bx_ads_view_actions', 'bx_ads', 'review', '_bx_ads_menu_item_title_system_review_entry', '', '', '', '', '', '', '', 0, 2147483647, 0, 0, 190),
 ('bx_ads_view_actions', 'bx_ads', 'review', '_bx_ads_menu_item_title_system_review_entry', '', '', '', '', '', '', '', 0, 2147483647, 0, 0, 190),
 ('bx_ads_view_actions', 'bx_ads', 'comment', '_sys_menu_item_title_system_va_comment', '', '', '', '', '', '', '', 0, 2147483647, 0, 0, 200),
 ('bx_ads_view_actions', 'bx_ads', 'comment', '_sys_menu_item_title_system_va_comment', '', '', '', '', '', '', '', 0, 2147483647, 0, 0, 200),
@@ -633,6 +633,9 @@ INSERT INTO `sys_cron_jobs` (`name`, `time`, `class`, `file`, `service_call`) VA
 INSERT INTO `sys_email_templates` (`Module`, `NameSystem`, `Name`, `Subject`, `Body`) VALUES 
 INSERT INTO `sys_email_templates` (`Module`, `NameSystem`, `Name`, `Subject`, `Body`) VALUES 
 ('bx_ads', '_bx_ads_et_txt_name_interested', 'bx_ads_interested', '_bx_ads_et_txt_subject_interested', '_bx_ads_et_txt_body_interested'),
 ('bx_ads', '_bx_ads_et_txt_name_interested', 'bx_ads_interested', '_bx_ads_et_txt_subject_interested', '_bx_ads_et_txt_body_interested'),
 ('bx_ads', '_bx_ads_et_txt_name_purchased', 'bx_ads_purchased', '_bx_ads_et_txt_subject_purchased', '_bx_ads_et_txt_body_purchased'),
 ('bx_ads', '_bx_ads_et_txt_name_purchased', 'bx_ads_purchased', '_bx_ads_et_txt_subject_purchased', '_bx_ads_et_txt_body_purchased'),
+('bx_ads', '_bx_ads_et_txt_name_shipped', 'bx_ads_shipped', '_bx_ads_et_txt_subject_shipped', '_bx_ads_et_txt_body_shipped'),
+('bx_ads', '_bx_ads_et_txt_name_received', 'bx_ads_received', '_bx_ads_et_txt_subject_received', '_bx_ads_et_txt_body_received'),
 ('bx_ads', '_bx_ads_et_txt_name_offer_added', 'bx_ads_offer_added', '_bx_ads_et_txt_subject_offer_added', '_bx_ads_et_txt_body_offer_added'),
 ('bx_ads', '_bx_ads_et_txt_name_offer_added', 'bx_ads_offer_added', '_bx_ads_et_txt_subject_offer_added', '_bx_ads_et_txt_body_offer_added'),
 ('bx_ads', '_bx_ads_et_txt_name_offer_accepted', 'bx_ads_offer_accepted', '_bx_ads_et_txt_subject_offer_accepted', '_bx_ads_et_txt_body_offer_accepted'),
 ('bx_ads', '_bx_ads_et_txt_name_offer_accepted', 'bx_ads_offer_accepted', '_bx_ads_et_txt_subject_offer_accepted', '_bx_ads_et_txt_body_offer_accepted'),
-('bx_ads', '_bx_ads_et_txt_name_offer_declined', 'bx_ads_offer_declined', '_bx_ads_et_txt_subject_offer_declined', '_bx_ads_et_txt_body_offer_declined');
+('bx_ads', '_bx_ads_et_txt_name_offer_declined', 'bx_ads_offer_declined', '_bx_ads_et_txt_subject_offer_declined', '_bx_ads_et_txt_body_offer_declined'),
+('bx_ads', '_bx_ads_et_txt_name_offer_canceled', 'bx_ads_offer_canceled', '_bx_ads_et_txt_subject_offer_canceled', '_bx_ads_et_txt_body_offer_canceled');

+ 3 - 3
modules/boonex/ads/install/sql/install.sql

@@ -4,7 +4,7 @@ CREATE TABLE IF NOT EXISTS `bx_ads_entries` (
   `author` int(11) NOT NULL,
   `author` int(11) NOT NULL,
   `added` int(11) NOT NULL,
   `added` int(11) NOT NULL,
   `changed` int(11) NOT NULL,
   `changed` int(11) NOT NULL,
-  `delivered` int(11) NOT NULL,
+  `shipped` int(11) NOT NULL,
   `received` int(11) NOT NULL,
   `received` int(11) NOT NULL,
   `category` int(11) NOT NULL,
   `category` int(11) NOT NULL,
   `thumb` int(11) NOT NULL,
   `thumb` int(11) NOT NULL,
@@ -33,7 +33,7 @@ CREATE TABLE IF NOT EXISTS `bx_ads_entries` (
   `reports` int(11) NOT NULL default '0',
   `reports` int(11) NOT NULL default '0',
   `featured` int(11) NOT NULL default '0',
   `featured` int(11) NOT NULL default '0',
   `allow_view_to` varchar(16) NOT NULL DEFAULT '3',
   `allow_view_to` varchar(16) NOT NULL DEFAULT '3',
-  `status` enum('active','awaiting','hidden') NOT NULL DEFAULT 'active',
+  `status` enum('active','awaiting','offer','sold','hidden') NOT NULL DEFAULT 'active',
   `status_admin` enum('active','hidden','pending') NOT NULL DEFAULT 'active',
   `status_admin` enum('active','hidden','pending') NOT NULL DEFAULT 'active',
   PRIMARY KEY (`id`),
   PRIMARY KEY (`id`),
   FULLTEXT KEY `title_text` (`title`,`text`)
   FULLTEXT KEY `title_text` (`title`,`text`)
@@ -522,7 +522,7 @@ CREATE TABLE IF NOT EXISTS `bx_ads_offers` (
   `amount` float NOT NULL default '0',
   `amount` float NOT NULL default '0',
   `quantity` int(11) NOT NULL default '0',
   `quantity` int(11) NOT NULL default '0',
   `message` text NOT NULL,
   `message` text NOT NULL,
-  `status` enum('accepted','awaiting','declined') NOT NULL DEFAULT 'awaiting',
+  `status` enum('accepted','awaiting','declined','canceled') NOT NULL DEFAULT 'awaiting',
   PRIMARY KEY (`id`)
   PRIMARY KEY (`id`)
 );
 );
 
 

+ 12 - 2
modules/boonex/ads/js/entry.js

@@ -26,8 +26,18 @@ BxAdsEntry.prototype.makeOffer = function(oElement, iContentId) {
     this._performAction(oElement, 'make_offer', iContentId);
     this._performAction(oElement, 'make_offer', iContentId);
 };
 };
 
 
-BxAdsEntry.prototype.delivered = function(oElement, iContentId) {
-    this._performAction(oElement, 'delivered', iContentId);
+BxAdsEntry.prototype.onMakeOffer = function(oData) {};
+
+BxAdsEntry.prototype.cancelOffer = function(oElement, iOfferId) {
+    var $this = this;
+
+    bx_confirm('', function() {
+        $this._performAction(oElement, 'cancel_offer', iOfferId);
+    });
+};
+
+BxAdsEntry.prototype.shipped = function(oElement, iContentId) {
+    this._performAction(oElement, 'shipped', iContentId);
 };
 };
 
 
 BxAdsEntry.prototype.received = function(oElement, iContentId) {
 BxAdsEntry.prototype.received = function(oElement, iContentId) {

+ 10 - 1
modules/boonex/ads/template/css/entry.css

@@ -3,7 +3,16 @@
     position: relative;
     position: relative;
 }
 }
 
 
+.bx-ads-eoa {
+    position: relative;
+    display: -webkit-flex;
+    display: flex;
+    -webkit-align-items: flex-start;
+    align-items: flex-start;
+    -webkit-justify-content: center;
+    justify-content: center;
+}
+
 .bx-ads-eoa .bx-btn {
 .bx-ads-eoa .bx-btn {
-    display: inline-block;
     float: none;
     float: none;
 }
 }

+ 7 - 5
modules/boonex/ads/template/entry-offer-accepted.html

@@ -4,11 +4,13 @@
         <div class="bx-def-font-h2 bx-def-margin-top">__amount__</div>
         <div class="bx-def-font-h2 bx-def-margin-top">__amount__</div>
         <div class="bx-def-font-small bx-def-margin-bottom bx-def-font-grayed">__quantity__</div>
         <div class="bx-def-font-small bx-def-margin-bottom bx-def-font-grayed">__quantity__</div>
         <div class="bx-def-font-h3"><bx_text:_bx_ads_txt_accepted /></div>
         <div class="bx-def-font-h3"><bx_text:_bx_ads_txt_accepted /></div>
-        <bx_if:show_pay>
-            <div class="bx-ads-eoa bx-def-margin-top">
-                <a class="bx-btn" href="javascript:void(0)" onclick="__js_method__"><bx_text:_bx_ads_txt_pay /></a>
-            </div>
-        </bx_if:show_pay>
+        <div class="bx-ads-eoa bx-def-margin-top">
+            <bx_if:show_pay>
+                <a class="bx-btn bx-btn-primary bx-def-margin-right" href="javascript:void(0)" onclick="__js_method_pay__"><bx_text:_bx_ads_txt_pay /></a>
+            </bx_if:show_pay>
+            <a class="bx-btn" href="javascript:void(0)" onclick="javascript:__js_object__.cancelOffer(this, __id__)"><bx_text:_bx_ads_txt_cancel /></a>
+        </div>
+        
         __js_code__
         __js_code__
     </div>
     </div>
 </div>
 </div>

+ 20 - 2
modules/boonex/russian/data/langs/bx_ads/ru.xml

@@ -291,8 +291,8 @@
     <string name="_bx_ads_menu_item_title_edit_entry"><![CDATA[Редактировать]]></string>
     <string name="_bx_ads_menu_item_title_edit_entry"><![CDATA[Редактировать]]></string>
     <string name="_bx_ads_menu_item_title_system_delete_entry"><![CDATA[Удалить]]></string>
     <string name="_bx_ads_menu_item_title_system_delete_entry"><![CDATA[Удалить]]></string>
     <string name="_bx_ads_menu_item_title_delete_entry"><![CDATA[Удалить]]></string>
     <string name="_bx_ads_menu_item_title_delete_entry"><![CDATA[Удалить]]></string>
-    <string name="_bx_ads_menu_item_title_system_mark_delivered"><![CDATA[Доставлен]]></string>
-    <string name="_bx_ads_menu_item_title_mark_delivered"><![CDATA[Доставлен]]></string>
+    <string name="_bx_ads_menu_item_title_system_mark_shipped"><![CDATA[Отправлен]]></string>
+    <string name="_bx_ads_menu_item_title_mark_shipped"><![CDATA[Отправлен]]></string>
     <string name="_bx_ads_menu_item_title_system_mark_received"><![CDATA[Получен]]></string>
     <string name="_bx_ads_menu_item_title_system_mark_received"><![CDATA[Получен]]></string>
     <string name="_bx_ads_menu_item_title_mark_received"><![CDATA[Получен]]></string>
     <string name="_bx_ads_menu_item_title_mark_received"><![CDATA[Получен]]></string>
     <string name="_bx_ads_menu_item_title_system_review_entry"><![CDATA[Разместить обзор]]></string>
     <string name="_bx_ads_menu_item_title_system_review_entry"><![CDATA[Разместить обзор]]></string>
@@ -464,6 +464,13 @@
 <p>Здравствуйте, {client_name}.</p>
 <p>Здравствуйте, {client_name}.</p>
 <p>Вы оплатили <a href="{entry_url}">{entry_name}</a> объявление ({count} шт.), размещенное <a href="{vendor_url}">{vendor_name}</a>.<br />Ваша лицензия - <b>{license}</b>.</p>
 <p>Вы оплатили <a href="{entry_url}">{entry_name}</a> объявление ({count} шт.), размещенное <a href="{vendor_url}">{vendor_name}</a>.<br />Ваша лицензия - <b>{license}</b>.</p>
 <p>{notes}</p>
 <p>{notes}</p>
+{email_footer}]]></string>
+
+    <string name="_bx_ads_et_txt_name_shipped"><![CDATA[Товар отправлен.]]></string>
+    <string name="_bx_ads_et_txt_subject_shipped"><![CDATA[{entry_name}: Товар отправлен.]]></string>
+    <string name="_bx_ads_et_txt_body_shipped"><![CDATA[{email_header}
+<p>Здравствуйте, {client_name}.</p>
+<p>Товар был отправлен продавцом (<a href="{vendor_url}">{vendor_name}</a>) в соответствии с <a href="{entry_url}">{entry_name}</a> объявлением.</p>
 {email_footer}]]></string>
 {email_footer}]]></string>
 
 
     <string name="_bx_ads_et_txt_name_offer_added"><![CDATA[У вас новое предложение.]]></string>
     <string name="_bx_ads_et_txt_name_offer_added"><![CDATA[У вас новое предложение.]]></string>
@@ -485,6 +492,13 @@
     <string name="_bx_ads_et_txt_body_offer_declined"><![CDATA[{email_header}
     <string name="_bx_ads_et_txt_body_offer_declined"><![CDATA[{email_header}
 <p>Здравствуйте, {offerer_name}.</p>
 <p>Здравствуйте, {offerer_name}.</p>
 <p>Ваше предложение по <b><a href="{ad_url}">{ad_name}</a></b> объявлению было отклонено.</p>
 <p>Ваше предложение по <b><a href="{ad_url}">{ad_name}</a></b> объявлению было отклонено.</p>
+{email_footer}]]></string>
+
+    <string name="_bx_ads_et_txt_name_offer_canceled"><![CDATA[Предложение было отменено.]]></string>
+    <string name="_bx_ads_et_txt_subject_offer_canceled"><![CDATA[{offerer_name} отменил его предложение по {ad_name} объявлению.]]></string>
+    <string name="_bx_ads_et_txt_body_offer_canceled"><![CDATA[{email_header}
+<p>Здравствуйте, {profile_name}.</p>
+<p><a href="{offerer_url}">{offerer_name}</a> отменил его предложение по <b><a href="{ad_url}">{ad_name}</a></b> объявлению.</p>
 {email_footer}]]></string>
 {email_footer}]]></string>
 
 
     <string name="_bx_ads_txt_all_entries_in"><![CDATA[<a href="{0}">Все объявления в {1} ({2})</a>]]></string>
     <string name="_bx_ads_txt_all_entries_in"><![CDATA[<a href="{0}">Все объявления в {1} ({2})</a>]]></string>
@@ -511,11 +525,15 @@
     <string name="_bx_ads_txt_accepted"><![CDATA[было принято]]></string>
     <string name="_bx_ads_txt_accepted"><![CDATA[было принято]]></string>
     <string name="_bx_ads_txt_n_items"><![CDATA[{0} шт.]]></string>
     <string name="_bx_ads_txt_n_items"><![CDATA[{0} шт.]]></string>
     <string name="_bx_ads_txt_pay"><![CDATA[Оплатить]]></string>
     <string name="_bx_ads_txt_pay"><![CDATA[Оплатить]]></string>
+    <string name="_bx_ads_txt_cancel"><![CDATA[Отменить]]></string>
 
 
     <string name="_bx_ads_txt_msg_status_hidden"><![CDATA[Данное объявление было скрыто.]]></string>
     <string name="_bx_ads_txt_msg_status_hidden"><![CDATA[Данное объявление было скрыто.]]></string>
     <string name="_bx_ads_txt_msg_status_pending"><![CDATA[Данное объявление ожидает утверждения.]]></string>
     <string name="_bx_ads_txt_msg_status_pending"><![CDATA[Данное объявление ожидает утверждения.]]></string>
+    <string name="_bx_ads_txt_msg_auction_offer"><![CDATA[Данное объявление находится в стадии предложения.]]></string>
+    <string name="_bx_ads_txt_msg_auction_sold"><![CDATA[Продано.]]></string>
     <string name="_bx_ads_txt_msg_author_notified"><![CDATA[Рекламодатель был оповещен, что Вы заинтересованы в его объявлении. Пожалуйста ждите.]]></string>
     <string name="_bx_ads_txt_msg_author_notified"><![CDATA[Рекламодатель был оповещен, что Вы заинтересованы в его объявлении. Пожалуйста ждите.]]></string>
     <string name="_bx_ads_txt_msg_offer_added"><![CDATA[Ваше предложение было сохранено. Рекламодатель будет оповещен об этом. Пожалуйста ждите.]]></string>
     <string name="_bx_ads_txt_msg_offer_added"><![CDATA[Ваше предложение было сохранено. Рекламодатель будет оповещен об этом. Пожалуйста ждите.]]></string>
+    <string name="_bx_ads_txt_msg_offer_canceled"><![CDATA[Предложение было отменено.]]></string>
     <string name="_bx_ads_txt_err_offer_duplicate"><![CDATA[Вы уже сделали ваше предложение. Пожалуйста ожидайте результатов.]]></string>
     <string name="_bx_ads_txt_err_offer_duplicate"><![CDATA[Вы уже сделали ваше предложение. Пожалуйста ожидайте результатов.]]></string>
     <string name="_bx_ads_txt_err_offer_accepted"><![CDATA[Ваше предложение Your offer was already accepted.]]></string>
     <string name="_bx_ads_txt_err_offer_accepted"><![CDATA[Ваше предложение Your offer was already accepted.]]></string>
     <string name="_bx_ads_txt_err_your_own"><![CDATA[Вы не можете выполнить действие, т.к. это ваше объявление.]]></string>
     <string name="_bx_ads_txt_err_your_own"><![CDATA[Вы не можете выполнить действие, т.к. это ваше объявление.]]></string>