src/ShopArticleReviewBundle/objects/WebModules/MTPkgShopArticleReviewCore/MTPkgShopArticleReviewCore.class.php
public function ChangeReviewReportNotificationState()
    {
        $oGlobal = TGlobal::instance();
        $oMsgManager = TCMSMessageManager::GetInstance();
        if ($oGlobal->UserDataExists(TdbShopArticleReview::URL_PARAM_REVIEW_ID)) {
            $oReviewItem = TdbShopArticleReview::GetNewInstance();
            if ($oReviewItem->Load($oGlobal->GetUserData(TdbShopArticleReview::URL_PARAM_REVIEW_ID)) && $oReviewItem->IsOwner()) {
                $sReviewReportNotificationState = $oReviewItem->fieldSendCommentNotification;
                if ($sReviewReportNotificationState) {
                    $sReviewReportNotificationState = 0;
                } else {
                    $sReviewReportNotificationState = 1;
                }
                $oReviewItem->sqlData['send_comment_notification'] = $sReviewReportNotificationState;
                $oReviewItem->AllowEditByAll(true);
                $oReviewItem->Save();
                $oMsgManager->AddMessage(self::MSG_CONSUMER_NAME, 'ARTICLE-REVIEW-CHANGE-REPORT-NOTIFICATION-STATE-SUCCESS');
            } 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();
    }
public function ChangeReviewReportNotificationState()
    {
        $oGlobal = TGlobal::instance();
        $oMsgManager = TCMSMessageManager::GetInstance();
        if ($oGlobal->UserDataExists(TdbShopArticleReview::URL_PARAM_REVIEW_ID)) {
            $oReviewItem = TdbShopArticleReview::GetNewInstance();
            if ($oReviewItem->Load($oGlobal->GetUserData(TdbShopArticleReview::URL_PARAM_REVIEW_ID)) && $oReviewItem->IsOwner()) {
                $sReviewReportNotificationState = $oReviewItem->fieldSendCommentNotification;
                if ($sReviewReportNotificationState) {
                    $sReviewReportNotificationState = 0;
                } else {
                    $sReviewReportNotificationState = 1;
                }
                $oReviewItem->sqlData['send_comment_notification'] = $sReviewReportNotificationState;
                $oReviewItem->AllowEditByAll(true);
                $oReviewItem->Save();
                $oMsgManager->AddMessage(self::MSG_CONSUMER_NAME, 'ARTICLE-REVIEW-CHANGE-REPORT-NOTIFICATION-STATE-SUCCESS');
            } 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();
    }
public function ChangeReviewReportNotificationState ( ) { $ oGlobal = TGlobal :: instance ( ) ; $ oMsgManager = TCMSMessageManager :: GetInstance ( ) ; if ( $ oGlobal -> UserDataExists ( TdbShopArticleReview :: URL_PARAM_REVIEW_ID ) ) { $ oReviewItem = TdbShopArticleReview :: GetNewInstance ( ) ; if ( $ oReviewItem -> Load ( $ oGlobal -> GetUserData ( TdbShopArticleReview :: URL_PARAM_REVIEW_ID ) ) && $ oReviewItem -> IsOwner ( ) ) { $ sReviewReportNotificationState = $ oReviewItem -> fieldSendCommentNotification ; if ( $ sReviewReportNotificationState ) { $ sReviewReportNotificationState = 0 ; } else { $ sReviewReportNotificationState = 1 ; } $ oReviewItem -> sqlData [ 'send_comment_notification' ] = $ sReviewReportNotificationState ; $ oReviewItem -> AllowEditByAll ( true ) ; $ oReviewItem -> Save ( ) ; $ oMsgManager -> AddMessage ( self :: MSG_CONSUMER_NAME , 'ARTICLE-REVIEW-CHANGE-REPORT-NOTIFICATION-STATE-SUCCESS' ) ; } 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 ( ) ; }
Changes the report notification state for one review.
this can only be called from the owning user.
Changes the report notification state for one review . this can only be called from the owning user .