article_main.php

Go to the documentation of this file.
00001 <?php
00002 
00009 class Article_Main extends oxAdminDetails
00010 {
00016     protected $_sSavedId = null;
00017 
00024     public function render()
00025     {
00026         $myConfig = $this->getConfig();
00027         parent::render();
00028 
00029         $this->_aViewData['edit'] = $oArticle = oxNew( 'oxarticle' );
00030 
00031         $soxId  = oxConfig::getParameter( "oxid" );
00032         $svoxId = oxConfig::getParameter( "voxid" );
00033         $soxparentId = oxConfig::getParameter( "oxparentid" );
00034 
00035         // new variant ?
00036         if ( isset( $svoxId ) && $svoxId == "-1" && isset($soxparentId) && $soxparentId && $soxparentId != "-1") {
00037             $oParentArticle = oxNew( "oxarticle");
00038             $oParentArticle->load( $soxparentId);
00039             $this->_aViewData["parentarticle"] = $oParentArticle;
00040             $this->_aViewData["oxparentid"] = $soxparentId;
00041 
00042             $this->_aViewData["oxid"] =  $soxId = "-1";
00043         }
00044 
00045         // check if we right now saved a new entry
00046         if ( $this->_sSavedId ) {
00047             $this->_aViewData["oxid"] = $soxId = $this->_sSavedId;;
00048 
00049             // for reloading upper frame
00050             $this->_aViewData["updatelist"] =  "1";
00051         }
00052 
00053         if (  $soxId && $soxId != "-1") {
00054 
00055             // load object
00056             $oArticle->loadInLang( $this->_iEditLang, $soxId );
00057 
00058 
00059             // load object in other languages
00060             $oOtherLang = $oArticle->getAvailableInLangs();
00061             if (!isset($oOtherLang[$this->_iEditLang])) {
00062                 // echo "language entry doesn't exist! using: ".key($oOtherLang);
00063                 $oArticle->loadInLang( key($oOtherLang), $soxId );
00064             }
00065 
00066             // variant handling
00067             if ( $oArticle->oxarticles__oxparentid->value) {
00068                 $oParentArticle = oxNew( "oxarticle");
00069                 $oParentArticle->load( $oArticle->oxarticles__oxparentid->value);
00070                 $this->_aViewData["parentarticle"] = $oParentArticle;
00071                 $this->_aViewData["oxparentid"]    = $oArticle->oxarticles__oxparentid->value;
00072                 $this->_aViewData["issubvariant"]  = 1;
00073             }
00074 
00075             // #381A
00076             $this->_formJumpList($oArticle, $oParentArticle );
00077 
00078             //loading tags
00079             $oTagCloud = oxNew("oxTagCloud");
00080             $oArticle->tags = $oTagCloud->getTagTitle($oArticle->getTags());
00081 
00082             $aLang = array_diff (oxLang::getInstance()->getLanguageNames(), $oOtherLang);
00083             if ( count( $aLang))
00084                 $this->_aViewData["posslang"] = $aLang;
00085 
00086             foreach ( $oOtherLang as $id => $language) {
00087                 $oLang= new oxStdClass();
00088                 $oLang->sLangDesc = $language;
00089                 $oLang->selected = ($id == $this->_iEditLang);
00090                 $this->_aViewData["otherlang"][$id] =  clone $oLang;
00091             }
00092         }
00093 
00094         $this->_aViewData["editor"] = $this->_generateTextEditor( "100%", 300, $oArticle, "oxarticles__oxlongdesc", "details.tpl.css");
00095         $this->_aViewData["blUseTimeCheck"] = $myConfig->getConfigParam( 'blUseTimeCheck' );
00096 
00097         return "article_main.tpl";
00098     }
00099 
00105     public function save()
00106     {
00107         $myConfig  = $this->getConfig();
00108         $myUtilsCount = oxUtilsCount::getInstance();
00109 
00110         $soxId      = oxConfig::getParameter( "oxid" );
00111         $aParams    = oxConfig::getParameter( "editval" );
00112 
00113 
00114         // checkbox handling
00115         if ( !isset( $aParams['oxarticles__oxactive']))
00116             $aParams['oxarticles__oxactive'] = 0;
00117 
00118         // default values
00119         $aParams = $this->addDefaultValues( $aParams);
00120 
00121         // null values
00122         if ($aParams['oxarticles__oxvat'] === '')
00123             $aParams['oxarticles__oxvat'] = null;
00124 
00125         // varianthandling
00126         $soxparentId = oxConfig::getParameter( "oxparentid");
00127         if ( isset( $soxparentId) && $soxparentId && $soxparentId != "-1") {
00128             $aParams['oxarticles__oxparentid'] = $soxparentId;
00129         } else {
00130             unset( $aParams['oxarticles__oxparentid']);
00131         }
00132 
00133         $oArticle = oxNew( "oxarticle");
00134 
00135         $oArticle->setLanguage($this->_iEditLang);
00136         if ( $soxId != "-1")
00137             $oArticle->loadInLang( $this->_iEditLang, $soxId);
00138         else {
00139             $aParams['oxarticles__oxid']        = null;
00140             $aParams['oxarticles__oxissearch']  = 1;
00141             $aParams['oxarticles__oxstockflag'] = 1;
00142                 // shopid
00143                 $aParams['oxarticles__oxshopid'] = oxSession::getVar( "actshop");
00144         }
00145 
00146         //article number handling, warns for artnum dublicates
00147         if ( isset( $aParams['oxarticles__oxartnum']) && strlen($aParams['oxarticles__oxartnum']) > 0 &&
00148             $myConfig->getConfigParam( 'blWarnOnSameArtNums' ) &&
00149             $oArticle->oxarticles__oxartnum->value !=  $aParams['oxarticles__oxartnum']
00150             ) {
00151             $sSelect  = "select oxid from ".$oArticle->getCoreTableName();
00152             $sSelect .= " where oxartnum = '".$aParams['oxarticles__oxartnum']."'";
00153             $sSelect .= " and oxid != '".$aParams['oxarticles__oxid']."'";
00154             if ($oArticle->assignRecord( $sSelect ))
00155                 $this->_aViewData["errorsavingatricle"] = 1;
00156         }
00157 
00158             // #905A resetting article count in price categories if price has been changed
00159             if ( isset($aParams["oxarticles__oxprice"]) && $aParams["oxarticles__oxprice"] != $oArticle->oxarticles__oxprice->value) {
00160                 $this->resetCounter( "priceCatArticle", $oArticle->oxarticles__oxprice->value );
00161             }
00162 
00163             $aResetIds = array();
00164             if ( $aParams['oxarticles__oxactive'] != $oArticle->oxarticles__oxactive->value) {
00165                 //check categories
00166                 $oDb = oxDb::getDb();
00167                 $sQ = "select oxcatnid from oxobject2category where oxobjectid = ".$oDb->quote( $oArticle->oxarticles__oxid->value );
00168                 $oRs = $oDb->execute($sQ);
00169                 if ( $oRs !== false && $oRs->recordCount() > 0 ) {
00170                     while (!$oRs->EOF) {
00171                         $this->resetCounter( "catArticle", $oRs->fields[0] );
00172                         $oRs->moveNext();
00173                     }
00174                 }
00175 
00176                 // vendors
00177                 $aResetIds['vendor'][$oArticle->oxarticles__oxvendorid->value] = 1;
00178                 $aResetIds['manufacturer'][$oArticle->oxarticles__oxmanufacturerid->value] = 1;
00179             }
00180 
00181             // reset vendors
00182             if ( isset( $aParams["oxarticles__oxvendorid"] ) && $aParams["oxarticles__oxvendorid"] != $oArticle->oxarticles__oxvendorid->value ) {
00183                 $aResetIds['vendor'][$aParams['oxarticles__oxvendorid']] = 1;
00184                 $aResetIds['vendor'][$oArticle->oxarticles__oxvendorid->value] = 1;
00185             }
00186 
00187             // reset Manufacturers
00188             if ( isset($aParams["oxarticles__oxmanufacturerid"]) && $aParams["oxarticles__oxmanufacturerid"] != $oArticle->oxarticles__oxmanufacturerid->value) {
00189                 $aResetIds['manufacturer'][$aParams['oxarticles__oxmanufacturerid']] = 1;
00190                 $aResetIds['manufacturer'][$oArticle->oxarticles__oxmanufacturerid->value] = 1;
00191             }
00192 
00193             // resetting counts
00194             $this->_resetCounts( $aResetIds );
00195 
00196         $oArticle->setLanguage(0);
00197 
00198         //triming spaces from article title (M:876)
00199         $aParams['oxarticles__oxtitle'] = trim( $aParams['oxarticles__oxtitle'] );
00200 
00201         $oArticle->assign( $aParams );
00202         $oArticle->setLanguage($this->_iEditLang);
00203 
00204         $oArticle = oxUtilsFile::getInstance()->processFiles( $oArticle );
00205 
00206         $oArticle->save();
00207 
00208         // set oxid if inserted
00209         if ( $soxId == "-1") {
00210             $this->_sSavedId = $oArticle->getId();
00211             $sFastCat = oxConfig::getParameter( "art_category");
00212             if ( $sFastCat != "-1") {
00213                 $this->addToCategory($sFastCat, $oArticle->getId());
00214             }
00215         }
00216 
00217 
00218         $this->_aViewData["updatelist"] = "1";
00219 
00220         //saving tags
00221         $sTags = $aParams['tags'];
00222         if (!trim($sTags)) {
00223             $sTags = $oArticle->oxarticles__oxsearchkeys->value;
00224         }
00225         $oArticle->saveTags($sTags);
00226     }
00227 
00236     public function addToCategory($sCatID, $sOXID)
00237     {
00238         $myConfig  = $this->getConfig();
00239 
00240         $oNew = oxNew( "oxbase");
00241         $oNew->init( "oxobject2category" );
00242         $oNew->oxobject2category__oxtime = new oxField(time());
00243         $oNew->oxobject2category__oxobjectid = new oxField($sOXID);
00244         $oNew->oxobject2category__oxcatnid = new oxField($sCatID);
00245 
00246         $oNew->save();
00247 
00248             // resetting amount of articles in category
00249             $this->resetCounter( "catArticle", $sCatID );
00250     }
00251 
00261     public function copyArticle( $sOldId = null, $sNewId = null, $sParentId = null )
00262     {
00263         $myConfig = $this->getConfig();
00264 
00265         $sOldId = $sOldId ? $sOldId : oxConfig::getParameter( 'oxid' );
00266         $sNewId = $sNewId ? $sNewId : oxUtilsObject::getInstance()->generateUID();
00267 
00268         $oArticle = oxNew( 'oxbase' );
00269         $oArticle->init( 'oxarticles' );
00270         if ( $oArticle->load( $sOldId ) ) {
00271 
00272             if ( $myConfig->getConfigParam( 'blDisableDublArtOnCopy' ) ) {
00273                 $oArticle->oxarticles__oxactive->setValue( 0 );
00274                 $oArticle->oxarticles__oxactivefrom->setValue( 0 );
00275                 $oArticle->oxarticles__oxactiveto->setValue( 0 );
00276             }
00277 
00278             // setting parent id
00279             if ( $sParentId ) {
00280                 $oArticle->oxarticles__oxparentid->setValue( $sParentId );
00281             }
00282 
00283             // setting oxinsert/oxtimestamp
00284             $iNow = date( 'Y-m-d H:i:s', oxUtilsDate::getInstance()->getTime() );
00285             $oArticle->oxarticles__oxinsert    = new oxField( $iNow );
00286             $oArticle->oxarticles__oxtimestamp = new oxField( $iNow );
00287 
00288             // mantis#0001590: OXRATING and OXRATINGCNT not set to 0 when copying article
00289             $oArticle->oxarticles__oxrating    = new oxField( 0 );
00290             $oArticle->oxarticles__oxratingcnt = new oxField( 0 );
00291 
00292             $oArticle->setId( $sNewId );
00293             $oArticle->save();
00294 
00295             //copy categories
00296             $this->_copyCategories( $sOldId, $sNewId );
00297 
00298             //atributes
00299             $this->_copyAttributes( $sOldId, $sNewId );
00300 
00301             //sellist
00302             $this->_copySelectlists( $sOldId, $sNewId );
00303 
00304             //crossseling
00305             $this->_copyCrossseling( $sOldId, $sNewId );
00306 
00307             //accessoire
00308             $this->_copyAccessoires( $sOldId, $sNewId );
00309 
00310             // #983A copying staffelpreis info
00311             $this->_copyStaffelpreis( $sOldId, $sNewId );
00312 
00313             //copy article extends (longdescription, tags)
00314             $this->_copyArtExtends( $sOldId, $sNewId);
00315 
00316                 // resetting
00317                 $aResetIds['vendor'][$oArticle->oxarticles__oxvendorid->value] = 1;
00318                 $aResetIds['manufacturer'][$oArticle->oxarticles__oxmanufacturerid->value] = 1;
00319                 $this->_resetCounts( $aResetIds );
00320 
00321 
00322             $myUtilsObject = oxUtilsObject::getInstance();
00323             $oDb = oxDb::getDb();
00324 
00325             //copy variants
00326             $sQ = "select oxid from oxarticles where oxparentid = ".$oDb->quote( $sOldId );
00327             $oRs = $oDb->execute( $sQ );
00328             if ( $oRs !== false && $oRs->recordCount() > 0) {
00329                 while ( !$oRs->EOF ) {
00330                     $this->copyArticle( $oRs->fields[0], $myUtilsObject->generateUid(), $sNewId );
00331                     $oRs->moveNext();
00332                 }
00333             }
00334 
00335             // only for top articles
00336             if ( !$sParentId ) {
00337 
00338                 $this->_sSavedId = $oArticle->getId();
00339 
00340                 //article number handling, warns for artnum dublicates
00341                 if ( $myConfig->getConfigParam( 'blWarnOnSameArtNums' ) &&
00342                      $oArticle->oxarticles__oxartnum->value && oxConfig::getParameter( 'fnc' ) == 'copyArticle' ) {
00343                     $sSelect = "select oxid from ".$oArticle->getCoreTableName()."
00344                                 where oxartnum = ".$oDb->quote( $oArticle->oxarticles__oxartnum->value )." and oxid != ".$oDb->quote( $sNewId );
00345 
00346                     if ( $oArticle->assignRecord( $sSelect ) ) {
00347                         $this->_aViewData["errorsavingatricle"] = 1;
00348                     }
00349                 }
00350             }
00351         }
00352     }
00353 
00362     protected function _copyCategories( $sOldId, $sNewId )
00363     {
00364         $myUtilsObject = oxUtilsObject::getInstance();
00365         $oDb = oxDb::getDb();
00366 
00367 
00368         $sO2CView = getViewName( 'oxobject2category' );
00369         $sQ = "select oxcatnid, oxtime from {$sO2CView} where oxobjectid = ".$oDb->quote( $sOldId );
00370         $oRs = $oDb->execute( $sQ );
00371         if ( $oRs !== false && $oRs->recordCount() > 0 ) {
00372             while ( !$oRs->EOF ) {
00373                 $sUid = $myUtilsObject->generateUid();
00374                 $sCatId = $oRs->fields[0];
00375                 $sTime  = $oRs->fields[1];
00376 
00377 
00378                     $oDb->execute("insert into oxobject2category (oxid, oxobjectid, oxcatnid, oxtime) VALUES (".$oDb->quote( $sUid ).", ".$oDb->quote( $sNewId ).", ".$oDb->quote( $sCatId ).", ".$oDb->quote( $sTime ).") ");
00379 
00380                 $oRs->moveNext();
00381 
00382                     // resetting article count in category
00383                     $this->resetCounter( "catArticle", $sCatId );
00384             }
00385         }
00386     }
00387 
00396     protected function _copyAttributes( $sOldId, $sNewId )
00397     {
00398         $myUtilsObject = oxUtilsObject::getInstance();
00399         $oDb = oxDb::getDb();
00400 
00401         $sQ = "select oxid from oxobject2attribute where oxobjectid = ".$oDb->quote( $sOldId );
00402         $oRs = $oDb->execute($sQ);
00403         if ( $oRs !== false && $oRs->recordCount() > 0 ) {
00404             while ( !$oRs->EOF ) {
00405                 // #1055A
00406                 $oAttr = oxNew( "oxbase" );
00407                 $oAttr->init( "oxobject2attribute" );
00408                 $oAttr->load( $oRs->fields[0] );
00409                 $oAttr->setId( $myUtilsObject->generateUID() );
00410                 $oAttr->oxobject2attribute__oxobjectid->setValue( $sNewId );
00411                 $oAttr->save();
00412                 $oRs->moveNext();
00413             }
00414         }
00415     }
00416 
00425     protected function _copySelectlists( $sOldId, $sNewId )
00426     {
00427         $myUtilsObject = oxUtilsObject::getInstance();
00428         $oDb = oxDb::getDb();
00429 
00430         $sQ = "select oxselnid from oxobject2selectlist where oxobjectid = ".$oDb->quote( $sOldId );
00431         $oRs = $oDb->execute( $sQ );
00432         if ( $oRs !== false && $oRs->recordCount() > 0 ) {
00433             while ( !$oRs->EOF ) {
00434                 $sUid = $myUtilsObject->generateUID();
00435                 $sId = $oRs->fields[0];
00436                 $oDb->execute( "insert into oxobject2selectlist (oxid, oxobjectid, oxselnid) VALUES (".$oDb->quote( $sUid ).", ".$oDb->quote( $sNewId ).", ".$oDb->quote( $sId ).") " );
00437                 $oRs->moveNext();
00438             }
00439         }
00440     }
00441 
00450     protected function _copyCrossseling( $sOldId, $sNewId )
00451     {
00452         $myUtilsObject = oxUtilsObject::getInstance();
00453         $oDb = oxDb::getDb();
00454 
00455         $sQ = "select oxobjectid from oxobject2article where oxarticlenid = ".$oDb->quote( $sOldId );
00456         $oRs = $oDb->execute( $sQ );
00457         if ( $oRs !== false && $oRs->recordCount() > 0 ) {
00458             while ( !$oRs->EOF ) {
00459                 $sUid = $myUtilsObject->generateUID();
00460                 $sId = $oRs->fields[0];
00461                 $oDb->execute("insert into oxobject2article (oxid, oxobjectid, oxarticlenid) VALUES (".$oDb->quote( $sUid ).", ".$oDb->quote( $sId ).", ".$oDb->quote( $sNewId )." ) ");
00462                 $oRs->moveNext();
00463             }
00464         }
00465     }
00466 
00475     protected function _copyAccessoires( $sOldId, $sNewId )
00476     {
00477         $myUtilsObject = oxUtilsObject::getInstance();
00478         $oDb = oxDb::getDb();
00479 
00480         $sQ = "select oxobjectid from oxaccessoire2article where oxarticlenid= ".$oDb->quote( $sOldId );
00481         $oRs = $oDb->execute( $sQ );
00482         if ( $oRs !== false && $oRs->recordCount() > 0 ) {
00483             while ( !$oRs->EOF ) {
00484                 $sUId = $myUtilsObject->generateUid();
00485                 $sId = $oRs->fields[0];
00486                 $oDb->execute( "insert into oxaccessoire2article (oxid, oxobjectid, oxarticlenid) VALUES (".$oDb->quote( $sUId ).", ".$oDb->quote( $sId ).", ".$oDb->quote( $sNewId ).") " );
00487                 $oRs->moveNext();
00488             }
00489         }
00490     }
00491 
00500     protected function _copyStaffelpreis( $sOldId, $sNewId )
00501     {
00502         $sShopId = $this->getConfig()->getShopId();
00503         $oPriceList = oxNew( "oxlist" );
00504         $oPriceList->init( "oxbase", "oxprice2article" );
00505         $sQ = "select * from oxprice2article where oxartid = '$sOldId' and oxshopid = '$sShopId' and (oxamount > 0 or oxamountto > 0) order by oxamount ";
00506         $oPriceList->selectString( $sQ );
00507         if ( $oPriceList->count() ) {
00508             foreach ( $oPriceList as $oItem ) {
00509                 $oItem->oxprice2article__oxid->setValue( $oItem->setId() );
00510                 $oItem->oxprice2article__oxartid->setValue( $sNewId );
00511                 $oItem->save();
00512             }
00513         }
00514     }
00515 
00524     protected function _copyArtExtends( $sOldId, $sNewId)
00525     {
00526         $oExt = oxNew( "oxbase");
00527         $oExt->init( "oxartextends" );
00528         $oExt->load( $sOldId );
00529         $oExt->setId( $sNewId );
00530         $oExt->save();
00531     }
00532 
00533 
00539     public function saveinnlang()
00540     {
00541         $soxId   = oxConfig::getParameter( "oxid" );
00542         $aParams = oxConfig::getParameter( "editval" );
00543 
00544         // checkbox handling
00545         if ( !isset( $aParams['oxarticles__oxactive'] ) ) {
00546             $aParams['oxarticles__oxactive'] = 0;
00547         }
00548 
00549         // default values
00550         $aParams = $this->addDefaultValues( $aParams );
00551 
00552         // null values
00553         if ($aParams['oxarticles__oxvat'] === '') {
00554             $aParams['oxarticles__oxvat'] = null;
00555         }
00556 
00557         // varianthandling
00558         $soxparentId = oxConfig::getParameter( "oxparentid");
00559         if ( isset( $soxparentId) && $soxparentId && $soxparentId != "-1") {
00560             $aParams['oxarticles__oxparentid'] = $soxparentId;
00561         }
00562 
00563         $oArticle = oxNew( "oxarticle");
00564         $oArticle->setLanguage($this->_iEditLang);
00565 
00566         if ( $soxId != "-1") {
00567             $oArticle->load( $soxId);
00568         } else {
00569             $aParams['oxarticles__oxid'] = null;
00570                 // shopid
00571                 $sShopId = oxSession::getVar( "actshop");
00572                 $aParams['oxarticles__oxshopid'] = $sShopId;
00573         }
00574 
00575             // #905A resetting article count in price categories if price has been changed
00576             if ( isset($aParams["oxarticles__oxprice"]) && $aParams["oxarticles__oxprice"] != $oArticle->oxarticles__oxprice->value) {
00577                 $this->resetCounter( "priceCatArticle", $oArticle->oxarticles__oxprice->value );
00578             }
00579 
00580             $aResetIds = array();
00581 
00582             if ( $aParams['oxarticles__oxactive'] != $oArticle->oxarticles__oxactive->value) {
00583                 $oDb = oxDb::getDb();
00584                 //check categories
00585                 $sQ = "select oxcatnid from oxobject2category where oxobjectid = ".$oDb->quote( $oArticle->oxarticles__oxid->value );
00586                 $oRs = $oDb->execute($sQ);
00587                 if ($oRs !== false && $oRs->recordCount() > 0)
00588                     while (!$oRs->EOF) {
00589                         $this->resetCounter( "catArticle", $oRs->fields[0] );
00590                         $oRs->moveNext();
00591                     }
00592                 // vendors
00593                 $aResetIds['vendor'][$oArticle->oxarticles__oxvendorid->value] = 1;
00594                 $aResetIds['manufacturer'][$oArticle->oxarticles__oxmanufacturerid->value] = 1;
00595             }
00596 
00597             // vendors
00598             if ( isset($aParams['oxarticles__oxvendorid']) && $aParams['oxarticles__oxvendorid'] != $oArticle->oxarticles__oxvendorid->value) {
00599                 $aResetIds['vendor'][$aParams['oxarticles__oxvendorid']] = 1;
00600                 $aResetIds['vendor'][$oArticle->oxarticles__oxvendorid->value] = 1;
00601             }
00602 
00603             // manufacturers
00604             if ( isset($aParams['oxarticles__oxmanufacturerid']) && $aParams['oxarticles__oxmanufacturerid'] != $oArticle->oxarticles__oxmanufacturerid->value ) {
00605                 $aResetIds['manufacturer'][$aParams['oxarticles__oxmanufacturerid']] = 1;
00606                 $aResetIds['manufacturer'][$oArticle->oxarticles__oxmanufacturerid->value] = 1;
00607             }
00608 
00609             $this->_resetCounts( $aResetIds );
00610 
00611 
00612         $oArticle->setLanguage( 0 );
00613         $oArticle->assign( $aParams );
00614 
00615         // apply new language
00616         $sNewLanguage = oxConfig::getParameter( "new_lang");
00617         $oArticle->setLanguage( $sNewLanguage );
00618         $oArticle->save();
00619 
00620         // set for reload
00621         oxSession::setVar( "new_lang", $sNewLanguage );
00622 
00623         // set oxid if inserted
00624         if ( $soxId == "-1" ) {
00625             $this->_sSavedId = $oArticle->getId();
00626         }
00627     }
00628 
00637     public function addDefaultValues( $aParams )
00638     {
00639         return $aParams;
00640     }
00641 
00650     protected function _formJumpList( $oArticle, $oParentArticle )
00651     {
00652         $aJumpList = array();
00653         //fetching parent article variants
00654         if ( isset( $oParentArticle ) ) {
00655             $aJumpList[] = array( $oParentArticle->oxarticles__oxid->value, $this->_getTitle( $oParentArticle ) );
00656             $oParentVariants = $oParentArticle->getAdminVariants( oxConfig::getParameter( "editlanguage" ) );
00657             if ( $oParentVariants->count()) {
00658                 foreach ( $oParentVariants as $oVar) {
00659                     $aJumpList[] = array( $oVar->oxarticles__oxid->value, " - ".$this->_getTitle( $oVar ) );
00660                     if ( $oVar->oxarticles__oxid->value == $oArticle->oxarticles__oxid->value ) {
00661                         $oVariants = $oArticle->getAdminVariants(oxConfig::getParameter( "editlanguage"));
00662                         if ( $oVariants->count() ) {
00663                             foreach ( $oVariants as $oVVar) {
00664                                 $aJumpList[] = array( $oVVar->oxarticles__oxid->value, " -- ".$this->_getTitle( $oVVar));
00665                             }
00666                         }
00667                     }
00668                 }
00669             }
00670         } else {
00671             $aJumpList[] = array( $oArticle->oxarticles__oxid->value, $this->_getTitle( $oArticle));
00672             //fetching this article variants data
00673             $oVariants = $oArticle->getAdminVariants(oxConfig::getParameter( "editlanguage"));
00674             if ( $oVariants && $oVariants->count())
00675                 foreach ($oVariants as $oVar) {
00676                     $aJumpList[] = array( $oVar->oxarticles__oxid->value, " - ".$this->_getTitle( $oVar));
00677                 }
00678         }
00679         if ( count($aJumpList) > 1)
00680             $this->_aViewData["thisvariantlist"] = $aJumpList;
00681     }
00682 
00690     protected function _getTitle( $oObj )
00691     {
00692         $sTitle = $oObj->oxarticles__oxtitle->value;
00693         if ( !strlen( $sTitle ) ) {
00694             $sTitle = $oObj->oxarticles__oxvarselect->value;
00695         }
00696 
00697         return $sTitle;
00698     }
00699 
00705     public function getCategoryList()
00706     {
00707         $oCatTree = oxNew( "oxCategoryList");
00708         $oCatTree->buildList( $this->getConfig()->getConfigParam( 'bl_perfLoadCatTree' ) );
00709         return $oCatTree;
00710     }
00711 
00717     public function getVendorList()
00718     {
00719         $oVendorlist = oxNew( "oxvendorlist" );
00720         $oVendorlist->loadVendorList();
00721 
00722         return $oVendorlist;
00723     }
00724 
00730     public function getManufacturerList()
00731     {
00732         $oManufacturerList = oxNew( "oxmanufacturerlist" );
00733         $oManufacturerList->loadManufacturerList();
00734 
00735         return $oManufacturerList;
00736     }
00737 }