130 if ( !$oConfig->getConfigParam(
"bl_perfLoadReviews" ) ) {
142 if ( $oActiveRecommList ) {
143 if ( $oList && $oList->count()) {
144 $this->_iAllArtCnt = $oActiveRecommList->getArtCount();
147 $iNrofCatArticles = $this->
getConfig()->getConfigParam(
'iNrofCatArticles' );
148 $iNrofCatArticles = $iNrofCatArticles ? $iNrofCatArticles : 10;
149 $this->_iCntPages = round( $this->_iAllArtCnt / $iNrofCatArticles + 0.49 );
175 if ( $dRating !== null ) {
176 $dRating = (int) $dRating;
180 if ( $dRating !== null && $dRating >= 1 && $dRating <= 5 ) {
181 $oRating =
oxNew(
'oxrating' );
182 if ( $oRating->allowRating( $oRevUser->getId(), $sType, $oActObject->getId() ) ) {
183 $oRating->oxratings__oxuserid =
new oxField( $oRevUser->getId() );
184 $oRating->oxratings__oxtype =
new oxField( $sType );
185 $oRating->oxratings__oxobjectid =
new oxField( $oActObject->getId() );
186 $oRating->oxratings__oxrating =
new oxField( $dRating );
189 $oActObject->addToRatingAverage( $dRating);
191 $this->_blReviewSendStatus =
true;
196 $oReview =
oxNew(
'oxreview' );
197 $oReview->oxreviews__oxobjectid =
new oxField( $oActObject->getId() );
198 $oReview->oxreviews__oxtype =
new oxField( $sType );
201 $oReview->oxreviews__oxuserid =
new oxField( $oRevUser->getId() );
202 $oReview->oxreviews__oxrating =
new oxField( ( $dRating !== null ) ? $dRating : null );
205 $this->_blReviewSendStatus =
true;
218 if ( $this->_oRevUser === null ) {
219 $this->_oRevUser =
false;
220 $oUser =
oxNew(
"oxuser" );
222 if ( $sUserId = $oUser->getReviewUserId( $this->getReviewUserHash() ) ) {
224 if ( $oUser->load( $sUserId ) ) {
225 $this->_oRevUser = $oUser;
227 } elseif ( $oUser = $this->
getUser() ) {
229 $this->_oRevUser = $oUser;
253 if ( $this->_oActObject === null ) {
254 $this->_oActObject =
false;
257 $this->_oActObject = $oProduct;
259 $this->_oActObject = $oRecommList;
274 $sType =
'oxarticle';
276 $sType =
'oxrecommlist';
292 if ( $this->_oActiveRecommList === null ) {
293 $this->_oActiveRecommList =
false;
296 $oActiveRecommList =
oxNew(
'oxrecommlist');
297 if ( $oActiveRecommList->load( $sRecommId ) ) {
298 $this->_oActiveRecommList = $oActiveRecommList;
312 if ( $this->_blRate === null ) {
313 $this->_blRate =
false;
315 $oRating =
oxNew(
'oxrating' );
316 $this->_blRate = $oRating->allowRating( $oRevUser->getId(), $this->
_getActiveType(), $oActObject->getId() );
329 if ( $this->_aReviews === null ) {
330 $this->_aReviews =
false;
332 $this->_aReviews = $oObject->getReviews();
345 if ( $this->_oRecommList === null ) {
346 $this->_oRecommList =
false;
348 $oRecommList =
oxNew(
'oxrecommlist');
349 $this->_oRecommList = $oRecommList->getRecommListsByIds( array( $oProduct->getId() ) );
362 if ( $this->_oActiveRecommItems === null ) {
363 $this->_oActiveRecommItems =
false;
367 $iActPage = ($iActPage < 0) ? 0 : $iActPage;
370 $iNrofCatArticles = $this->
getConfig()->getConfigParam(
'iNrofCatArticles' );
371 $iNrofCatArticles = $iNrofCatArticles ? $iNrofCatArticles : 10;
373 $oList = $oActiveRecommList->getArticles($iNrofCatArticles * $iActPage, $iNrofCatArticles);
375 if ( $oList && $oList->count() ) {
376 foreach ( $oList as $oItem) {
377 $oItem->text = $oActiveRecommList->getArtDescription( $oItem->getId() );
379 $this->_oActiveRecommItems = $oList;
403 if ( $this->_oPageNavigation === null ) {
404 $this->_oPageNavigation =
false;
421 $sAddParams .=
'&recommid='.$oActRecommList->getId();
436 $sParams .=
"&cnid={$sCnId}";
439 $sParams .=
"&anid={$sAnId}";
442 $sParams .=
"&listtype={$sListType}";
445 $sParams .=
"&recommid={$sRecommId}";