src/ShopArticleReviewBundle/objects/WebModules/MTPkgShopArticleReviewCore/MTPkgShopArticleReviewCore.class.php
protected function UnlockReview()
    {
        $oGlobal = TGlobal::instance();
        $oMsgManager = TCMSMessageManager::GetInstance();
        if ($oGlobal->UserDataExists(TdbShopArticleReview::URL_PARAM_ACTION_ID)) {
            $oReviewItem = TdbShopArticleReview::GetNewInstance();
            if ($oReviewItem->LoadFromField('action_id', $oGlobal->GetUserData(TdbShopArticleReview::URL_PARAM_ACTION_ID))) {
                if (0 == $oReviewItem->sqlData['publish']) {
                    $oReviewItem->AllowEditByAll(true);
                    $oReviewItem->sqlData['publish'] = true;
                    $oReviewItem->sqlData['action_id'] = '';
                    $oReviewItem->Save();
                    $oArticle = TdbShop::GetActiveItem();
                    if ($oArticle->IsVariant()) {
                        $oArticle = $oArticle->GetFieldVariantParent();
                    }
                    $oArticle->UpdateStatsReviews();
                    $oMsgManager->AddMessage(self::MSG_CONSUMER_NAME, 'ARTICLE-REVIEW-UNLOCK-SUCCESS');
                } else {
                    $oMsgManager->AddMessage(self::MSG_CONSUMER_NAME, 'ARTICLE-REVIEW-ACTION-REVIEW-NOT-BLOCKED');
                }
            } else {
                $oMsgManager->AddMessage(self::MSG_CONSUMER_NAME, 'ARTICLE-REVIEW-ACTION-REVIEW-NOT-FOUND');
            }
        } else {
            $oMsgManager->AddMessage(self::MSG_CONSUMER_NAME, 'ARTICLE-REVIEW-ACTION-MISSING-PARAMETER');
        }
        $this->RedirectToItemPage();
    }
protected function UnlockReview()
    {
        $oGlobal = TGlobal::instance();
        $oMsgManager = TCMSMessageManager::GetInstance();
        if ($oGlobal->UserDataExists(TdbShopArticleReview::URL_PARAM_ACTION_ID)) {
            $oReviewItem = TdbShopArticleReview::GetNewInstance();
            if ($oReviewItem->LoadFromField('action_id', $oGlobal->GetUserData(TdbShopArticleReview::URL_PARAM_ACTION_ID))) {
                if (0 == $oReviewItem->sqlData['publish']) {
                    $oReviewItem->AllowEditByAll(true);
                    $oReviewItem->sqlData['publish'] = true;
                    $oReviewItem->sqlData['action_id'] = '';
                    $oReviewItem->Save();
                    $oArticle = TdbShop::GetActiveItem();
                    if ($oArticle->IsVariant()) {
                        $oArticle = $oArticle->GetFieldVariantParent();
                    }
                    $oArticle->UpdateStatsReviews();
                    $oMsgManager->AddMessage(self::MSG_CONSUMER_NAME, 'ARTICLE-REVIEW-UNLOCK-SUCCESS');
                } else {
                    $oMsgManager->AddMessage(self::MSG_CONSUMER_NAME, 'ARTICLE-REVIEW-ACTION-REVIEW-NOT-BLOCKED');
                }
            } else {
                $oMsgManager->AddMessage(self::MSG_CONSUMER_NAME, 'ARTICLE-REVIEW-ACTION-REVIEW-NOT-FOUND');
            }
        } else {
            $oMsgManager->AddMessage(self::MSG_CONSUMER_NAME, 'ARTICLE-REVIEW-ACTION-MISSING-PARAMETER');
        }
        $this->RedirectToItemPage();
    }
protected function UnlockReview ( ) { $ oGlobal = TGlobal :: instance ( ) ; $ oMsgManager = TCMSMessageManager :: GetInstance ( ) ; if ( $ oGlobal -> UserDataExists ( TdbShopArticleReview :: URL_PARAM_ACTION_ID ) ) { $ oReviewItem = TdbShopArticleReview :: GetNewInstance ( ) ; if ( $ oReviewItem -> LoadFromField ( 'action_id' , $ oGlobal -> GetUserData ( TdbShopArticleReview :: URL_PARAM_ACTION_ID ) ) ) { if ( 0 == $ oReviewItem -> sqlData [ 'publish' ] ) { $ oReviewItem -> AllowEditByAll ( true ) ; $ oReviewItem -> sqlData [ 'publish' ] = true ; $ oReviewItem -> sqlData [ 'action_id' ] = '' ; $ oReviewItem -> Save ( ) ; $ oArticle = TdbShop :: GetActiveItem ( ) ; if ( $ oArticle -> IsVariant ( ) ) { $ oArticle = $ oArticle -> GetFieldVariantParent ( ) ; } $ oArticle -> UpdateStatsReviews ( ) ; $ oMsgManager -> AddMessage ( self :: MSG_CONSUMER_NAME , 'ARTICLE-REVIEW-UNLOCK-SUCCESS' ) ; } else { $ oMsgManager -> AddMessage ( self :: MSG_CONSUMER_NAME , 'ARTICLE-REVIEW-ACTION-REVIEW-NOT-BLOCKED' ) ; } } else { $ oMsgManager -> AddMessage ( self :: MSG_CONSUMER_NAME , 'ARTICLE-REVIEW-ACTION-REVIEW-NOT-FOUND' ) ; } } else { $ oMsgManager -> AddMessage ( self :: MSG_CONSUMER_NAME , 'ARTICLE-REVIEW-ACTION-MISSING-PARAMETER' ) ; } $ this -> RedirectToItemPage ( ) ; }
Unlocks a locked review.
Unlocks a locked review .