article_main.php

Go to the documentation of this file.
00001 <?php
00002 
00009 class Article_Main extends oxAdminDetails
00010 {
00017     public function render()
00018     {
00019         $myConfig = $this->getConfig();
00020         parent::render();
00021 
00022         $this->_aViewData['edit'] = $oArticle = oxNew( 'oxarticle' );
00023 
00024         $soxId = $this->getEditObjectId();
00025         $svoxId = oxConfig::getParameter( "voxid" );
00026         $soxparentId = oxConfig::getParameter( "oxparentid" );
00027 
00028         // new variant ?
00029         if ( isset( $svoxId ) && $svoxId == "-1" && isset($soxparentId) && $soxparentId && $soxparentId != "-1") {
00030             $oParentArticle = oxNew( "oxarticle");
00031             $oParentArticle->load( $soxparentId);
00032             $this->_aViewData["parentarticle"] = $oParentArticle;
00033             $this->_aViewData["oxparentid"] = $soxparentId;
00034 
00035             $this->_aViewData["oxid"] =  $soxId = "-1";
00036         }
00037 
00038         if (  $soxId && $soxId != "-1") {
00039 
00040             // load object
00041             $oArticle->loadInLang( $this->_iEditLang, $soxId );
00042 
00043 
00044             // load object in other languages
00045             $oOtherLang = $oArticle->getAvailableInLangs();
00046             if (!isset($oOtherLang[$this->_iEditLang])) {
00047                 // echo "language entry doesn't exist! using: ".key($oOtherLang);
00048                 $oArticle->loadInLang( key($oOtherLang), $soxId );
00049             }
00050 
00051             // variant handling
00052             if ( $oArticle->oxarticles__oxparentid->value) {
00053                 $oParentArticle = oxNew( "oxarticle");
00054                 $oParentArticle->load( $oArticle->oxarticles__oxparentid->value);
00055                 $this->_aViewData["parentarticle"] = $oParentArticle;
00056                 $this->_aViewData["oxparentid"]    = $oArticle->oxarticles__oxparentid->value;
00057                 $this->_aViewData["issubvariant"]  = 1;
00058             }
00059 
00060             // #381A
00061             $this->_formJumpList($oArticle, $oParentArticle );
00062 
00063             //loading tags
00064             $oArticleTagList = oxNew( "oxarticletaglist" );
00065             $oArticleTagList->loadInLang( $this->_iEditLang, $oArticle->getId() );
00066             $oArticle->tags = $oArticleTagList->get();
00067 
00068             $aLang = array_diff (oxRegistry::getLang()->getLanguageNames(), $oOtherLang);
00069             if ( count( $aLang))
00070                 $this->_aViewData["posslang"] = $aLang;
00071 
00072             foreach ( $oOtherLang as $id => $language) {
00073                 $oLang= new stdClass();
00074                 $oLang->sLangDesc = $language;
00075                 $oLang->selected = ($id == $this->_iEditLang);
00076                 $this->_aViewData["otherlang"][$id] =  clone $oLang;
00077             }
00078         }
00079 
00080         $this->_aViewData["editor"] = $this->_generateTextEditor( "100%", 300, $oArticle, "oxarticles__oxlongdesc", "details.tpl.css");
00081         $this->_aViewData["blUseTimeCheck"] = $myConfig->getConfigParam( 'blUseTimeCheck' );
00082 
00083         return "article_main.tpl";
00084     }
00085 
00094     protected function _getEditValue( $oObject, $sField )
00095     {
00096         $sEditObjectValue = '';
00097         if ( $oObject ) {
00098             $oDescField = $oObject->getLongDescription();
00099             $sEditObjectValue = $this->_processEditValue( $oDescField->getRawValue() );
00100             $oDescField = new oxField( $sEditObjectValue, oxField::T_RAW );
00101         }
00102 
00103         return $sEditObjectValue;
00104     }
00105 
00111     public function save()
00112     {
00113         parent::save();
00114 
00115         $oConfig = $this->getConfig();
00116         $soxId    = $this->getEditObjectId();
00117         $aParams  = $oConfig->getRequestParameter( "editval" );
00118 
00119         // default values
00120         $aParams = $this->addDefaultValues( $aParams );
00121 
00122         // null values
00123         if (isset($aParams['oxarticles__oxvat']) && $aParams['oxarticles__oxvat'] === '') {
00124             $aParams['oxarticles__oxvat'] = null;
00125         }
00126 
00127         // varianthandling
00128         $soxparentId = $oConfig->getRequestParameter( "oxparentid");
00129         if ( isset( $soxparentId) && $soxparentId && $soxparentId != "-1") {
00130             $aParams['oxarticles__oxparentid'] = $soxparentId;
00131         } else {
00132             unset( $aParams['oxarticles__oxparentid']);
00133         }
00134 
00135         $oArticle = oxNew( "oxarticle");
00136         $oArticle->setLanguage($this->_iEditLang);
00137 
00138         if ( $soxId != "-1") {
00139             $oArticle->loadInLang( $this->_iEditLang, $soxId);
00140         } else {
00141             $aParams['oxarticles__oxid']        = null;
00142             $aParams['oxarticles__oxissearch']  = 1;
00143             $aParams['oxarticles__oxstockflag'] = 1;
00144                 // shopid
00145                 $aParams['oxarticles__oxshopid'] = oxRegistry::getSession()->getVariable( "actshop");
00146 
00147             if (!isset($aParams['oxarticles__oxactive'])) {
00148                 $aParams['oxarticles__oxactive'] = 0;
00149             }
00150         }
00151 
00152         //article number handling, warns for artnum dublicates
00153         if ( isset( $aParams['oxarticles__oxartnum']) && strlen($aParams['oxarticles__oxartnum']) > 0 &&
00154             $oConfig->getConfigParam( 'blWarnOnSameArtNums' ) &&
00155             $oArticle->oxarticles__oxartnum->value !=  $aParams['oxarticles__oxartnum']
00156             ) {
00157             $sSelect  = "select oxid from ".getViewName( 'oxarticles' );
00158             $sSelect .= " where oxartnum = '".$aParams['oxarticles__oxartnum']."'";
00159             $sSelect .= " and oxid != '".$aParams['oxarticles__oxid']."'";
00160             if ($oArticle->assignRecord( $sSelect ))
00161                 $this->_aViewData["errorsavingatricle"] = 1;
00162         }
00163 
00164             // #905A resetting article count in price categories if price has been changed
00165             if ( isset($aParams["oxarticles__oxprice"]) && $aParams["oxarticles__oxprice"] != $oArticle->oxarticles__oxprice->value) {
00166                 $this->resetCounter( "priceCatArticle", $oArticle->oxarticles__oxprice->value );
00167             }
00168 
00169             $aResetIds = array();
00170             if ( isset($aParams['oxarticles__oxactive']) && $aParams['oxarticles__oxactive'] != $oArticle->oxarticles__oxactive->value) {
00171                 //check categories
00172                 $this->_resetCategoriesCounter( $oArticle->oxarticles__oxid->value );
00173 
00174                 // vendors
00175                 $aResetIds['vendor'][$oArticle->oxarticles__oxvendorid->value] = 1;
00176                 $aResetIds['manufacturer'][$oArticle->oxarticles__oxmanufacturerid->value] = 1;
00177             }
00178 
00179             // vendors
00180             if ( isset($aParams['oxarticles__oxvendorid']) && $aParams['oxarticles__oxvendorid'] != $oArticle->oxarticles__oxvendorid->value) {
00181                 $aResetIds['vendor'][$aParams['oxarticles__oxvendorid']] = 1;
00182                 $aResetIds['vendor'][$oArticle->oxarticles__oxvendorid->value] = 1;
00183             }
00184 
00185             // manufacturers
00186             if ( isset($aParams['oxarticles__oxmanufacturerid']) && $aParams['oxarticles__oxmanufacturerid'] != $oArticle->oxarticles__oxmanufacturerid->value ) {
00187                 $aResetIds['manufacturer'][$aParams['oxarticles__oxmanufacturerid']] = 1;
00188                 $aResetIds['manufacturer'][$oArticle->oxarticles__oxmanufacturerid->value] = 1;
00189             }
00190 
00191             // resetting counts
00192             $this->_resetCounts( $aResetIds );
00193 
00194         $oArticle->setLanguage(0);
00195 
00196         //triming spaces from article title (M:876)
00197         if (isset($aParams['oxarticles__oxtitle'])) {
00198             $aParams['oxarticles__oxtitle'] = trim( $aParams['oxarticles__oxtitle'] );
00199         }
00200 
00201         $oArticle->assign( $aParams );
00202         $oArticle->setArticleLongDesc( $this->_processLongDesc( $aParams['oxarticles__oxlongdesc'] ) );
00203         $oArticle->setLanguage($this->_iEditLang);
00204         $oArticle = oxRegistry::get("oxUtilsFile")->processFiles( $oArticle );
00205         $oArticle->save();
00206 
00207         // set oxid if inserted
00208         if ( $soxId == "-1") {
00209             $sFastCat = $oConfig->getRequestParameter( "art_category");
00210             if ( $sFastCat != "-1") {
00211                 $this->addToCategory($sFastCat, $oArticle->getId());
00212             }
00213         }
00214 
00215         //saving tags
00216         if (isset($aParams['tags'])) {
00217             $sTags = $aParams['tags'];
00218             if (!trim($sTags)) {
00219                 $sTags = $oArticle->oxarticles__oxsearchkeys->value;
00220             }
00221             $aInvalidTags = $this->_setTags( $sTags, $oArticle->getId() );
00222             if ( !empty( $aInvalidTags ) ) {
00223                 $this->_aViewData["invalid_tags"] = implode( ', ', $aInvalidTags );
00224             }
00225         }
00226 
00227         $this->setEditObjectId( $oArticle->getId() );
00228     }
00229 
00237     protected function _processLongDesc( $sValue )
00238     {
00239         // TODO: the code below is redundant, optimize it, assignments should go smooth without conversions
00240         // hack, if editor screws up text, htmledit tends to do so
00241         $sValue = str_replace( '&amp;nbsp;', '&nbsp;', $sValue );
00242         $sValue = str_replace( '&amp;', '&', $sValue );
00243         $sValue = str_replace( '&quot;', '"', $sValue );
00244         $sValue = str_replace( '&lang=', '&amp;lang=', $sValue);
00245 
00246         return $sValue;
00247     }
00248 
00256     protected function _resetCategoriesCounter( $sArticleId )
00257     {
00258         $oDb = oxDb::getDb();
00259         $sQ = "select oxcatnid from oxobject2category where oxobjectid = ".$oDb->quote( $sArticleId );
00260         $oRs = $oDb->execute($sQ);
00261         if ( $oRs !== false && $oRs->recordCount() > 0 ) {
00262             while (!$oRs->EOF) {
00263                 $this->resetCounter( "catArticle", $oRs->fields[0] );
00264                 $oRs->moveNext();
00265             }
00266         }
00267     }
00268 
00277     protected function _setTags( $sTags, $sArticleId )
00278     {
00279         $oArticleTagList = oxNew('oxarticletaglist');
00280         $oArticleTagList->loadInLang( $this->_iEditLang, $sArticleId );
00281         $oArticleTagList->set( $sTags );
00282         $oArticleTagList->save();
00283 
00284         return $oArticleTagList->get()->getInvalidTags();
00285     }
00286 
00295     public function addToCategory($sCatID, $sOXID)
00296     {
00297         $myConfig  = $this->getConfig();
00298 
00299         $oNew = oxNew( "oxbase");
00300         $oNew->init( "oxobject2category" );
00301         $oNew->oxobject2category__oxtime     = new oxField( 0 );
00302         $oNew->oxobject2category__oxobjectid = new oxField( $sOXID );
00303         $oNew->oxobject2category__oxcatnid   = new oxField( $sCatID );
00304 
00305         $oNew->save();
00306 
00307             // resetting amount of articles in category
00308             $this->resetCounter( "catArticle", $sCatID );
00309     }
00310 
00320     public function copyArticle( $sOldId = null, $sNewId = null, $sParentId = null )
00321     {
00322         $myConfig = $this->getConfig();
00323 
00324         $sOldId = $sOldId ? $sOldId : $this->getEditObjectId();
00325         $sNewId = $sNewId ? $sNewId : oxUtilsObject::getInstance()->generateUID();
00326 
00327         $oArticle = oxNew( 'oxbase' );
00328         $oArticle->init( 'oxarticles' );
00329         if ( $oArticle->load( $sOldId ) ) {
00330 
00331             if ( $myConfig->getConfigParam( 'blDisableDublArtOnCopy' ) ) {
00332                 $oArticle->oxarticles__oxactive->setValue( 0 );
00333                 $oArticle->oxarticles__oxactivefrom->setValue( 0 );
00334                 $oArticle->oxarticles__oxactiveto->setValue( 0 );
00335             }
00336 
00337             // setting parent id
00338             if ( $sParentId ) {
00339                 $oArticle->oxarticles__oxparentid->setValue( $sParentId );
00340             }
00341 
00342             // setting oxinsert/oxtimestamp
00343             $iNow = date( 'Y-m-d H:i:s', oxRegistry::get("oxUtilsDate")->getTime() );
00344             $oArticle->oxarticles__oxinsert    = new oxField( $iNow );
00345 
00346             // mantis#0001590: OXRATING and OXRATINGCNT not set to 0 when copying article
00347             $oArticle->oxarticles__oxrating    = new oxField( 0 );
00348             $oArticle->oxarticles__oxratingcnt = new oxField( 0 );
00349 
00350             $oArticle->setId( $sNewId );
00351             $oArticle->save();
00352 
00353             //copy categories
00354             $this->_copyCategories( $sOldId, $sNewId );
00355 
00356             //atributes
00357             $this->_copyAttributes( $sOldId, $sNewId );
00358 
00359             //sellist
00360             $this->_copySelectlists( $sOldId, $sNewId );
00361 
00362             //crossseling
00363             $this->_copyCrossseling( $sOldId, $sNewId );
00364 
00365             //accessoire
00366             $this->_copyAccessoires( $sOldId, $sNewId );
00367 
00368             // #983A copying staffelpreis info
00369             $this->_copyStaffelpreis( $sOldId, $sNewId );
00370 
00371             //copy article extends (longdescription, tags)
00372             $this->_copyArtExtends( $sOldId, $sNewId);
00373 
00374             //files
00375             $this->_copyFiles( $sOldId, $sNewId );
00376 
00377                 // resetting
00378                 $aResetIds['vendor'][$oArticle->oxarticles__oxvendorid->value] = 1;
00379                 $aResetIds['manufacturer'][$oArticle->oxarticles__oxmanufacturerid->value] = 1;
00380                 $this->_resetCounts( $aResetIds );
00381 
00382 
00383             $myUtilsObject = oxUtilsObject::getInstance();
00384             $oDb = oxDb::getDb();
00385 
00386             //copy variants
00387             $sQ = "select oxid from oxarticles where oxparentid = ".$oDb->quote( $sOldId );
00388             $oRs = $oDb->execute( $sQ );
00389             if ( $oRs !== false && $oRs->recordCount() > 0) {
00390                 while ( !$oRs->EOF ) {
00391                     $this->copyArticle( $oRs->fields[0], $myUtilsObject->generateUid(), $sNewId );
00392                     $oRs->moveNext();
00393                 }
00394             }
00395 
00396             // only for top articles
00397             if ( !$sParentId ) {
00398 
00399                 $this->setEditObjectId( $oArticle->getId() );
00400 
00401                 //article number handling, warns for artnum dublicates
00402                 if ( $myConfig->getConfigParam( 'blWarnOnSameArtNums' ) &&
00403                      $oArticle->oxarticles__oxartnum->value && oxConfig::getParameter( 'fnc' ) == 'copyArticle' ) {
00404                     $sSelect = "select oxid from ".$oArticle->getCoreTableName()."
00405                                 where oxartnum = ".$oDb->quote( $oArticle->oxarticles__oxartnum->value )." and oxid != ".$oDb->quote( $sNewId );
00406 
00407                     if ( $oArticle->assignRecord( $sSelect ) ) {
00408                         $this->_aViewData["errorsavingatricle"] = 1;
00409                     }
00410                 }
00411             }
00412         }
00413     }
00414 
00423     protected function _copyCategories( $sOldId, $sNewId )
00424     {
00425         $myUtilsObject = oxUtilsObject::getInstance();
00426         $oShopMetaData = oxRegistry::get("oxShopMetaData");
00427         $oDb = oxDb::getDb();
00428 
00429 
00430         $sO2CView = getViewName( 'oxobject2category' );
00431         $sQ = "select oxcatnid, oxtime from {$sO2CView} where oxobjectid = ".$oDb->quote( $sOldId );
00432         $oRs = $oDb->execute( $sQ );
00433         if ( $oRs !== false && $oRs->recordCount() > 0 ) {
00434             while ( !$oRs->EOF ) {
00435                 $sUid = $myUtilsObject->generateUid();
00436                 $sCatId = $oRs->fields[0];
00437                 $sTime  = $oRs->fields[1];
00438 
00439 
00440                     $oDb->execute("insert into oxobject2category (oxid, oxobjectid, oxcatnid, oxtime) VALUES (".$oDb->quote( $sUid ).", ".$oDb->quote( $sNewId ).", ".$oDb->quote( $sCatId ).", ".$oDb->quote( $sTime ).") ");
00441 
00442                 $oRs->moveNext();
00443 
00444                     // resetting article count in category
00445                     $this->resetCounter( "catArticle", $sCatId );
00446             }
00447         }
00448     }
00449 
00458     protected function _copyAttributes( $sOldId, $sNewId )
00459     {
00460         $myUtilsObject = oxUtilsObject::getInstance();
00461         $oDb = oxDb::getDb();
00462 
00463         $sQ = "select oxid from oxobject2attribute where oxobjectid = ".$oDb->quote( $sOldId );
00464         $oRs = $oDb->execute($sQ);
00465         if ( $oRs !== false && $oRs->recordCount() > 0 ) {
00466             while ( !$oRs->EOF ) {
00467                 // #1055A
00468                 $oAttr = oxNew( "oxbase" );
00469                 $oAttr->init( "oxobject2attribute" );
00470                 $oAttr->load( $oRs->fields[0] );
00471                 $oAttr->setId( $myUtilsObject->generateUID() );
00472                 $oAttr->oxobject2attribute__oxobjectid->setValue( $sNewId );
00473                 $oAttr->save();
00474                 $oRs->moveNext();
00475             }
00476         }
00477     }
00478 
00487     protected function _copyFiles( $sOldId, $sNewId )
00488     {
00489         $myUtilsObject = oxUtilsObject::getInstance();
00490         $oDb = oxDb::getDb( oxDB::FETCH_MODE_ASSOC );
00491 
00492         $sQ = "SELECT * FROM `oxfiles` WHERE `oxartid` = ".$oDb->quote( $sOldId );
00493         $oRs = $oDb->execute($sQ);
00494         if ( $oRs !== false && $oRs->recordCount() > 0 ) {
00495             while ( !$oRs->EOF ) {
00496 
00497                 $oFile = oxNew( "oxfile" );
00498                 $oFile->setId( $myUtilsObject->generateUID() );
00499                 $oFile->oxfiles__oxartid = new oxField( $sNewId );
00500                 $oFile->oxfiles__oxfilename =  new oxField( $oRs->fields['OXFILENAME'] );
00501                 $oFile->oxfiles__oxfilesize =  new oxField( $oRs->fields['OXFILESIZE'] );
00502                 $oFile->oxfiles__oxstorehash =  new oxField( $oRs->fields['OXSTOREHASH'] );
00503                 $oFile->oxfiles__oxpurchasedonly =  new oxField( $oRs->fields['OXPURCHASEDONLY'] );
00504                 $oFile->save();
00505                 $oRs->moveNext();
00506             }
00507         }
00508     }
00509 
00518     protected function _copySelectlists( $sOldId, $sNewId )
00519     {
00520         $myUtilsObject = oxUtilsObject::getInstance();
00521         $oDb = oxDb::getDb();
00522 
00523         $sQ = "select oxselnid from oxobject2selectlist where oxobjectid = ".$oDb->quote( $sOldId );
00524         $oRs = $oDb->execute( $sQ );
00525         if ( $oRs !== false && $oRs->recordCount() > 0 ) {
00526             while ( !$oRs->EOF ) {
00527                 $sUid = $myUtilsObject->generateUID();
00528                 $sId = $oRs->fields[0];
00529                 $oDb->execute( "insert into oxobject2selectlist (oxid, oxobjectid, oxselnid) VALUES (".$oDb->quote( $sUid ).", ".$oDb->quote( $sNewId ).", ".$oDb->quote( $sId ).") " );
00530                 $oRs->moveNext();
00531             }
00532         }
00533     }
00534 
00543     protected function _copyCrossseling( $sOldId, $sNewId )
00544     {
00545         $myUtilsObject = oxUtilsObject::getInstance();
00546         $oDb = oxDb::getDb();
00547 
00548         $sQ = "select oxobjectid from oxobject2article where oxarticlenid = ".$oDb->quote( $sOldId );
00549         $oRs = $oDb->execute( $sQ );
00550         if ( $oRs !== false && $oRs->recordCount() > 0 ) {
00551             while ( !$oRs->EOF ) {
00552                 $sUid = $myUtilsObject->generateUID();
00553                 $sId = $oRs->fields[0];
00554                 $oDb->execute("insert into oxobject2article (oxid, oxobjectid, oxarticlenid) VALUES (".$oDb->quote( $sUid ).", ".$oDb->quote( $sId ).", ".$oDb->quote( $sNewId )." ) ");
00555                 $oRs->moveNext();
00556             }
00557         }
00558     }
00559 
00568     protected function _copyAccessoires( $sOldId, $sNewId )
00569     {
00570         $myUtilsObject = oxUtilsObject::getInstance();
00571         $oDb = oxDb::getDb();
00572 
00573         $sQ = "select oxobjectid from oxaccessoire2article where oxarticlenid= ".$oDb->quote( $sOldId );
00574         $oRs = $oDb->execute( $sQ );
00575         if ( $oRs !== false && $oRs->recordCount() > 0 ) {
00576             while ( !$oRs->EOF ) {
00577                 $sUId = $myUtilsObject->generateUid();
00578                 $sId = $oRs->fields[0];
00579                 $oDb->execute( "insert into oxaccessoire2article (oxid, oxobjectid, oxarticlenid) VALUES (".$oDb->quote( $sUId ).", ".$oDb->quote( $sId ).", ".$oDb->quote( $sNewId ).") " );
00580                 $oRs->moveNext();
00581             }
00582         }
00583     }
00584 
00593     protected function _copyStaffelpreis( $sOldId, $sNewId )
00594     {
00595         $sShopId = $this->getConfig()->getShopId();
00596         $oPriceList = oxNew( "oxlist" );
00597         $oPriceList->init( "oxbase", "oxprice2article" );
00598         $sQ = "select * from oxprice2article where oxartid = '$sOldId' and oxshopid = '$sShopId' and (oxamount > 0 or oxamountto > 0) order by oxamount ";
00599         $oPriceList->selectString( $sQ );
00600         if ( $oPriceList->count() ) {
00601             foreach ( $oPriceList as $oItem ) {
00602                 $oItem->oxprice2article__oxid->setValue( $oItem->setId() );
00603                 $oItem->oxprice2article__oxartid->setValue( $sNewId );
00604                 $oItem->save();
00605             }
00606         }
00607     }
00608 
00617     protected function _copyArtExtends( $sOldId, $sNewId)
00618     {
00619         $oExt = oxNew( "oxbase");
00620         $oExt->init( "oxartextends" );
00621         $oExt->load( $sOldId );
00622         $oExt->setId( $sNewId );
00623         $oExt->save();
00624     }
00625 
00626 
00632     public function saveinnlang()
00633     {
00634         $this->save();
00635     }
00636 
00645     public function addDefaultValues( $aParams )
00646     {
00647         return $aParams;
00648     }
00649 
00658     protected function _formJumpList( $oArticle, $oParentArticle )
00659     {
00660         $aJumpList = array();
00661         //fetching parent article variants
00662         if ( isset( $oParentArticle ) ) {
00663             $aJumpList[] = array( $oParentArticle->oxarticles__oxid->value, $this->_getTitle( $oParentArticle ) );
00664             $oParentVariants = $oParentArticle->getAdminVariants( oxConfig::getParameter( "editlanguage" ) );
00665             if ( $oParentVariants->count()) {
00666                 foreach ( $oParentVariants as $oVar) {
00667                     $aJumpList[] = array( $oVar->oxarticles__oxid->value, " - ".$this->_getTitle( $oVar ) );
00668                     if ( $oVar->oxarticles__oxid->value == $oArticle->oxarticles__oxid->value ) {
00669                         $oVariants = $oArticle->getAdminVariants(oxConfig::getParameter( "editlanguage"));
00670                         if ( $oVariants->count() ) {
00671                             foreach ( $oVariants as $oVVar) {
00672                                 $aJumpList[] = array( $oVVar->oxarticles__oxid->value, " -- ".$this->_getTitle( $oVVar));
00673                             }
00674                         }
00675                     }
00676                 }
00677             }
00678         } else {
00679             $aJumpList[] = array( $oArticle->oxarticles__oxid->value, $this->_getTitle( $oArticle));
00680             //fetching this article variants data
00681             $oVariants = $oArticle->getAdminVariants(oxConfig::getParameter( "editlanguage"));
00682             if ( $oVariants && $oVariants->count())
00683                 foreach ($oVariants as $oVar) {
00684                     $aJumpList[] = array( $oVar->oxarticles__oxid->value, " - ".$this->_getTitle( $oVar));
00685                 }
00686         }
00687         if ( count($aJumpList) > 1)
00688             $this->_aViewData["thisvariantlist"] = $aJumpList;
00689     }
00690 
00698     protected function _getTitle( $oObj )
00699     {
00700         $sTitle = $oObj->oxarticles__oxtitle->value;
00701         if ( !strlen( $sTitle ) ) {
00702             $sTitle = $oObj->oxarticles__oxvarselect->value;
00703         }
00704 
00705         return $sTitle;
00706     }
00707 
00713     public function getCategoryList()
00714     {
00715         $oCatTree = oxNew( "oxCategoryList");
00716         $oCatTree->buildList( $this->getConfig()->getConfigParam( 'bl_perfLoadCatTree' ) );
00717         return $oCatTree;
00718     }
00719 
00725     public function getVendorList()
00726     {
00727         $oVendorlist = oxNew( "oxvendorlist" );
00728         $oVendorlist->loadVendorList();
00729 
00730         return $oVendorlist;
00731     }
00732 
00738     public function getManufacturerList()
00739     {
00740         $oManufacturerList = oxNew( "oxmanufacturerlist" );
00741         $oManufacturerList->loadManufacturerList();
00742 
00743         return $oManufacturerList;
00744     }
00745 }