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             $oArticle->tags = $oArticle->getTags();
00080 
00081             $aLang = array_diff (oxLang::getInstance()->getLanguageNames(), $oOtherLang);
00082             if ( count( $aLang))
00083                 $this->_aViewData["posslang"] = $aLang;
00084 
00085             foreach ( $oOtherLang as $id => $language) {
00086                 $oLang= new oxStdClass();
00087                 $oLang->sLangDesc = $language;
00088                 $oLang->selected = ($id == $this->_iEditLang);
00089                 $this->_aViewData["otherlang"][$id] =  clone $oLang;
00090             }
00091         }
00092 
00093         $this->_aViewData["editor"] = $this->_generateTextEditor( "100%", 300, $oArticle, "oxarticles__oxlongdesc", "details.tpl.css");
00094         $this->_aViewData["blUseTimeCheck"] = $myConfig->getConfigParam( 'blUseTimeCheck' );
00095 
00096         return "article_main.tpl";
00097     }
00098 
00104     public function save()
00105     {
00106         $myConfig  = $this->getConfig();
00107         $myUtilsCount = oxUtilsCount::getInstance();
00108 
00109         $soxId      = oxConfig::getParameter( "oxid" );
00110         $aParams    = oxConfig::getParameter( "editval" );
00111 
00112 
00113         // checkbox handling
00114         if ( !isset( $aParams['oxarticles__oxactive']))
00115             $aParams['oxarticles__oxactive'] = 0;
00116 
00117         // default values
00118         $aParams = $this->addDefaultValues( $aParams);
00119 
00120         // null values
00121         if ($aParams['oxarticles__oxvat'] === '')
00122             $aParams['oxarticles__oxvat'] = null;
00123 
00124         // varianthandling
00125         $soxparentId = oxConfig::getParameter( "oxparentid");
00126         if ( isset( $soxparentId) && $soxparentId && $soxparentId != "-1") {
00127             $aParams['oxarticles__oxparentid'] = $soxparentId;
00128         } else {
00129             unset( $aParams['oxarticles__oxparentid']);
00130         }
00131 
00132         $oArticle = oxNew( "oxarticle");
00133 
00134         $oArticle->setLanguage($this->_iEditLang);
00135         if ( $soxId != "-1")
00136             $oArticle->loadInLang( $this->_iEditLang, $soxId);
00137         else {
00138             $aParams['oxarticles__oxid']        = null;
00139             $aParams['oxarticles__oxissearch']  = 1;
00140             $aParams['oxarticles__oxstockflag'] = 1;
00141                 // shopid
00142                 $aParams['oxarticles__oxshopid'] = oxSession::getVar( "actshop");
00143         }
00144 
00145         //article number handling, warns for artnum dublicates
00146         if ( isset( $aParams['oxarticles__oxartnum']) && strlen($aParams['oxarticles__oxartnum']) > 0 &&
00147             $myConfig->getConfigParam( 'blWarnOnSameArtNums' ) &&
00148             $oArticle->oxarticles__oxartnum->value !=  $aParams['oxarticles__oxartnum']
00149             ) {
00150             $sSelect  = "select oxid from ".$oArticle->getCoreTableName();
00151             $sSelect .= " where oxartnum = '".$aParams['oxarticles__oxartnum']."'";
00152             $sSelect .= " and oxid != '".$aParams['oxarticles__oxid']."'";
00153             if ($oArticle->assignRecord( $sSelect ))
00154                 $this->_aViewData["errorsavingatricle"] = 1;
00155         }
00156 
00157             // #905A resetting article count in price categories if price has been changed
00158             if ( isset($aParams["oxarticles__oxprice"]) && $aParams["oxarticles__oxprice"] != $oArticle->oxarticles__oxprice->value) {
00159                 $this->resetCounter( "priceCatArticle", $oArticle->oxarticles__oxprice->value );
00160             }
00161 
00162             $aResetIds = array();
00163             if ( $aParams['oxarticles__oxactive'] != $oArticle->oxarticles__oxactive->value) {
00164                 //check categories
00165                 $oDb = oxDb::getDb();
00166                 $sQ = "select oxcatnid from oxobject2category where oxobjectid = ".$oDb->quote( $oArticle->oxarticles__oxid->value );
00167                 $oRs = $oDb->execute($sQ);
00168                 if ( $oRs !== false && $oRs->recordCount() > 0 ) {
00169                     while (!$oRs->EOF) {
00170                         $this->resetCounter( "catArticle", $oRs->fields[0] );
00171                         $oRs->moveNext();
00172                     }
00173                 }
00174 
00175                 // vendors
00176                 $aResetIds['vendor'][$oArticle->oxarticles__oxvendorid->value] = 1;
00177                 $aResetIds['manufacturer'][$oArticle->oxarticles__oxmanufacturerid->value] = 1;
00178             }
00179 
00180             // reset vendors
00181             if ( isset( $aParams["oxarticles__oxvendorid"] ) && $aParams["oxarticles__oxvendorid"] != $oArticle->oxarticles__oxvendorid->value ) {
00182                 $aResetIds['vendor'][$aParams['oxarticles__oxvendorid']] = 1;
00183                 $aResetIds['vendor'][$oArticle->oxarticles__oxvendorid->value] = 1;
00184             }
00185 
00186             // reset Manufacturers
00187             if ( isset($aParams["oxarticles__oxmanufacturerid"]) && $aParams["oxarticles__oxmanufacturerid"] != $oArticle->oxarticles__oxmanufacturerid->value) {
00188                 $aResetIds['manufacturer'][$aParams['oxarticles__oxmanufacturerid']] = 1;
00189                 $aResetIds['manufacturer'][$oArticle->oxarticles__oxmanufacturerid->value] = 1;
00190             }
00191 
00192             // resetting counts
00193             $this->_resetCounts( $aResetIds );
00194 
00195         $oArticle->setLanguage(0);
00196 
00197         //triming spaces from article title (M:876)
00198         $aParams['oxarticles__oxtitle'] = trim( $aParams['oxarticles__oxtitle'] );
00199 
00200         $oArticle->assign( $aParams );
00201         $oArticle->setLanguage($this->_iEditLang);
00202 
00203         $oArticle = oxUtilsFile::getInstance()->processFiles( $oArticle );
00204 
00205         $oArticle->save();
00206 
00207         // set oxid if inserted
00208         if ( $soxId == "-1") {
00209             $this->_sSavedId = $oArticle->getId();
00210 
00211             $sFastCat = oxConfig::getParameter( "art_category");
00212 
00213             if ( $sFastCat != "-1") {
00214                 $oNew = oxNew( "oxbase");
00215                 $oNew->init( "oxobject2category" );
00216                 $oNew->oxobject2category__oxtime = new oxField(time());
00217                 $oNew->oxobject2category__oxobjectid = new oxField($oArticle->getId());
00218                 $oNew->oxobject2category__oxcatnid = new oxField($sFastCat);
00219 
00220                 $oNew->save();
00221 
00222                     // resetting amount of articles in category
00223                     $this->resetCounter( "catArticle", $sFastCat );
00224             }
00225         }
00226 
00227 
00228         $this->_aViewData["updatelist"] = "1";
00229 
00230         //saving tags
00231         $sTags = $aParams['tags'];
00232         if (!trim($sTags))
00233             $sTags = $oArticle->oxarticles__oxsearchkeys->value;
00234         $oArticle->saveTags($sTags);
00235     }
00236 
00246     public function copyArticle( $sOldId = null, $sNewId = null, $sParentId = null )
00247     {
00248         $myConfig = $this->getConfig();
00249 
00250         $sOldId = $sOldId ? $sOldId : oxConfig::getParameter( 'oxid' );
00251         $sNewId = $sNewId ? $sNewId : oxUtilsObject::getInstance()->generateUID();
00252 
00253         $oArticle = oxNew( 'oxbase' );
00254         $oArticle->init( 'oxarticles' );
00255         if ( $oArticle->load( $sOldId ) ) {
00256 
00257             if ( $myConfig->getConfigParam( 'blDisableDublArtOnCopy' ) ) {
00258                 $oArticle->oxarticles__oxactive->setValue( 0 );
00259                 $oArticle->oxarticles__oxactivefrom->setValue( 0 );
00260                 $oArticle->oxarticles__oxactiveto->setValue( 0 );
00261             }
00262 
00263             // setting parent id
00264             if ( $sParentId ) {
00265                 $oArticle->oxarticles__oxparentid->setValue( $sParentId );
00266             }
00267 
00268             // setting oxinsert/oxtimestamp
00269             $iNow = date( 'Y-m-d H:i:s', oxUtilsDate::getInstance()->getTime() );
00270             $oArticle->oxarticles__oxinsert    = new oxField( $iNow );
00271             $oArticle->oxarticles__oxtimestamp = new oxField( $iNow );
00272 
00273             $oArticle->setId( $sNewId );
00274             $oArticle->save();
00275 
00276             //copy categories
00277             $this->_copyCategories( $sOldId, $sNewId );
00278 
00279             //atributes
00280             $this->_copyAttributes( $sOldId, $sNewId );
00281 
00282             //sellist
00283             $this->_copySelectlists( $sOldId, $sNewId );
00284 
00285             //crossseling
00286             $this->_copyCrossseling( $sOldId, $sNewId );
00287 
00288             //accessoire
00289             $this->_copyAccessoires( $sOldId, $sNewId );
00290 
00291             // #983A copying staffelpreis info
00292             $this->_copyStaffelpreis( $sOldId, $sNewId );
00293 
00294             //copy article extends (longdescription, tags)
00295             $this->_copyArtExtends( $sOldId, $sNewId);
00296 
00297                 // resetting
00298                 $aResetIds['vendor'][$oArticle->oxarticles__oxvendorid->value] = 1;
00299                 $aResetIds['manufacturer'][$oArticle->oxarticles__oxmanufacturerid->value] = 1;
00300                 $this->_resetCounts( $aResetIds );
00301 
00302 
00303             $myUtilsObject = oxUtilsObject::getInstance();
00304             $oDb = oxDb::getDb();
00305 
00306             //copy variants
00307             $sQ = "select oxid from oxarticles where oxparentid = ".$oDb->quote( $sOldId );
00308             $oRs = $oDb->execute( $sQ );
00309             if ( $oRs !== false && $oRs->recordCount() > 0) {
00310                 while ( !$oRs->EOF ) {
00311                     $this->copyArticle( $oRs->fields[0], $myUtilsObject->generateUid(), $sNewId );
00312                     $oRs->moveNext();
00313                 }
00314             }
00315 
00316             // only for top articles
00317             if ( !$sParentId ) {
00318 
00319                 $this->_sSavedId = $oArticle->getId();
00320 
00321                 //article number handling, warns for artnum dublicates
00322                 if ( $myConfig->getConfigParam( 'blWarnOnSameArtNums' ) &&
00323                      $oArticle->oxarticles__oxartnum->value && oxConfig::getParameter( 'fnc' ) == 'copyArticle' ) {
00324                     $sSelect = "select oxid from ".$oArticle->getCoreTableName()."
00325                                 where oxartnum = ".$oDb->quote( $oArticle->oxarticles__oxartnum->value )." and oxid != ".$oDb->quote( $sNewId );
00326 
00327                     if ( $oArticle->assignRecord( $sSelect ) ) {
00328                         $this->_aViewData["errorsavingatricle"] = 1;
00329                     }
00330                 }
00331             }
00332         }
00333     }
00334 
00343     protected function _copyCategories( $sOldId, $sNewId )
00344     {
00345         $myUtilsObject = oxUtilsObject::getInstance();
00346         $oDb = oxDb::getDb();
00347 
00348 
00349         $sO2CView = getViewName( 'oxobject2category' );
00350         $sQ = "select oxcatnid, oxtime from {$sO2CView} where oxobjectid = ".$oDb->quote( $sOldId );
00351         $oRs = $oDb->execute( $sQ );
00352         if ( $oRs !== false && $oRs->recordCount() > 0 ) {
00353             while ( !$oRs->EOF ) {
00354                 $sUid = $myUtilsObject->generateUid();
00355                 $sCatId = $oRs->fields[0];
00356                 $sTime  = $oRs->fields[1];
00357 
00358 
00359                     $oDb->execute("insert into oxobject2category (oxid, oxobjectid, oxcatnid, oxtime) VALUES (".$oDb->quote( $sUid ).", ".$oDb->quote( $sNewId ).", ".$oDb->quote( $sCatId ).", ".$oDb->quote( $sTime ).") ");
00360 
00361                 $oRs->moveNext();
00362 
00363                     // resetting article count in category
00364                     $this->resetCounter( "catArticle", $sCatId );
00365             }
00366         }
00367     }
00368 
00377     protected function _copyAttributes( $sOldId, $sNewId )
00378     {
00379         $myUtilsObject = oxUtilsObject::getInstance();
00380         $oDb = oxDb::getDb();
00381 
00382         $sQ = "select oxid from oxobject2attribute where oxobjectid = ".$oDb->quote( $sOldId );
00383         $oRs = $oDb->execute($sQ);
00384         if ( $oRs !== false && $oRs->recordCount() > 0 ) {
00385             while ( !$oRs->EOF ) {
00386                 // #1055A
00387                 $oAttr = oxNew( "oxbase" );
00388                 $oAttr->init( "oxobject2attribute" );
00389                 $oAttr->load( $oRs->fields[0] );
00390                 $oAttr->setId( $myUtilsObject->generateUID() );
00391                 $oAttr->oxobject2attribute__oxobjectid->setValue( $sNewId );
00392                 $oAttr->save();
00393                 $oRs->moveNext();
00394             }
00395         }
00396     }
00397 
00406     protected function _copySelectlists( $sOldId, $sNewId )
00407     {
00408         $myUtilsObject = oxUtilsObject::getInstance();
00409         $oDb = oxDb::getDb();
00410 
00411         $sQ = "select oxselnid from oxobject2selectlist where oxobjectid = ".$oDb->quote( $sOldId );
00412         $oRs = $oDb->execute( $sQ );
00413         if ( $oRs !== false && $oRs->recordCount() > 0 ) {
00414             while ( !$oRs->EOF ) {
00415                 $sUid = $myUtilsObject->generateUID();
00416                 $sId = $oRs->fields[0];
00417                 $oDb->execute( "insert into oxobject2selectlist (oxid, oxobjectid, oxselnid) VALUES (".$oDb->quote( $sUid ).", ".$oDb->quote( $sNewId ).", ".$oDb->quote( $sId ).") " );
00418                 $oRs->moveNext();
00419             }
00420         }
00421     }
00422 
00431     protected function _copyCrossseling( $sOldId, $sNewId )
00432     {
00433         $myUtilsObject = oxUtilsObject::getInstance();
00434         $oDb = oxDb::getDb();
00435 
00436         $sQ = "select oxobjectid from oxobject2article where oxarticlenid = ".$oDb->quote( $sOldId );
00437         $oRs = $oDb->execute( $sQ );
00438         if ( $oRs !== false && $oRs->recordCount() > 0 ) {
00439             while ( !$oRs->EOF ) {
00440                 $sUid = $myUtilsObject->generateUID();
00441                 $sId = $oRs->fields[0];
00442                 $oDb->execute("insert into oxobject2article (oxid, oxobjectid, oxarticlenid) VALUES (".$oDb->quote( $sUid ).", ".$oDb->quote( $sId ).", ".$oDb->quote( $sNewId )." ) ");
00443                 $oRs->moveNext();
00444             }
00445         }
00446     }
00447 
00456     protected function _copyAccessoires( $sOldId, $sNewId )
00457     {
00458         $myUtilsObject = oxUtilsObject::getInstance();
00459         $oDb = oxDb::getDb();
00460 
00461         $sQ = "select oxobjectid from oxaccessoire2article where oxarticlenid= ".$oDb->quote( $sOldId );
00462         $oRs = $oDb->execute( $sQ );
00463         if ( $oRs !== false && $oRs->recordCount() > 0 ) {
00464             while ( !$oRs->EOF ) {
00465                 $sUId = $myUtilsObject->generateUid();
00466                 $sId = $oRs->fields[0];
00467                 $oDb->execute( "insert into oxaccessoire2article (oxid, oxobjectid, oxarticlenid) VALUES (".$oDb->quote( $sUId ).", ".$oDb->quote( $sId ).", ".$oDb->quote( $sNewId ).") " );
00468                 $oRs->moveNext();
00469             }
00470         }
00471     }
00472 
00481     protected function _copyStaffelpreis( $sOldId, $sNewId )
00482     {
00483         $sShopId = $this->getConfig()->getShopId();
00484         $oPriceList = oxNew( "oxlist" );
00485         $oPriceList->init( "oxbase", "oxprice2article" );
00486         $sQ = "select * from oxprice2article where oxartid = '$sOldId' and oxshopid = '$sShopId' and (oxamount > 0 or oxamountto > 0) order by oxamount ";
00487         $oPriceList->selectString( $sQ );
00488         if ( $oPriceList->count() ) {
00489             foreach ( $oPriceList as $oItem ) {
00490                 $oItem->oxprice2article__oxid->setValue( $oItem->setId() );
00491                 $oItem->oxprice2article__oxartid->setValue( $sNewId );
00492                 $oItem->save();
00493             }
00494         }
00495     }
00496 
00505     protected function _copyArtExtends( $sOldId, $sNewId)
00506     {
00507         $oExt = oxNew( "oxbase");
00508         $oExt->init( "oxartextends" );
00509         $oExt->load( $sOldId );
00510         $oExt->setId( $sNewId );
00511         $oExt->save();
00512     }
00513 
00514 
00520     public function saveinnlang()
00521     {
00522         $soxId   = oxConfig::getParameter( "oxid" );
00523         $aParams = oxConfig::getParameter( "editval" );
00524 
00525         // checkbox handling
00526         if ( !isset( $aParams['oxarticles__oxactive'] ) ) {
00527             $aParams['oxarticles__oxactive'] = 0;
00528         }
00529 
00530         // default values
00531         $aParams = $this->addDefaultValues( $aParams );
00532 
00533         // null values
00534         if ($aParams['oxarticles__oxvat'] === '') {
00535             $aParams['oxarticles__oxvat'] = null;
00536         }
00537 
00538         // varianthandling
00539         $soxparentId = oxConfig::getParameter( "oxparentid");
00540         if ( isset( $soxparentId) && $soxparentId && $soxparentId != "-1") {
00541             $aParams['oxarticles__oxparentid'] = $soxparentId;
00542         }
00543 
00544         $oArticle = oxNew( "oxarticle");
00545         $oArticle->setLanguage($this->_iEditLang);
00546 
00547         if ( $soxId != "-1") {
00548             $oArticle->load( $soxId);
00549         } else {
00550             $aParams['oxarticles__oxid'] = null;
00551                 // shopid
00552                 $sShopId = oxSession::getVar( "actshop");
00553                 $aParams['oxarticles__oxshopid'] = $sShopId;
00554         }
00555 
00556             // #905A resetting article count in price categories if price has been changed
00557             if ( isset($aParams["oxarticles__oxprice"]) && $aParams["oxarticles__oxprice"] != $oArticle->oxarticles__oxprice->value) {
00558                 $this->resetCounter( "priceCatArticle", $oArticle->oxarticles__oxprice->value );
00559             }
00560 
00561             $aResetIds = array();
00562 
00563             if ( $aParams['oxarticles__oxactive'] != $oArticle->oxarticles__oxactive->value) {
00564                 $oDb = oxDb::getDb();
00565                 //check categories
00566                 $sQ = "select oxcatnid from oxobject2category where oxobjectid = ".$oDb->quote( $oArticle->oxarticles__oxid->value );
00567                 $oRs = $oDb->execute($sQ);
00568                 if ($oRs !== false && $oRs->recordCount() > 0)
00569                     while (!$oRs->EOF) {
00570                         $this->resetCounter( "catArticle", $oRs->fields[0] );
00571                         $oRs->moveNext();
00572                     }
00573                 // vendors
00574                 $aResetIds['vendor'][$oArticle->oxarticles__oxvendorid->value] = 1;
00575                 $aResetIds['manufacturer'][$oArticle->oxarticles__oxmanufacturerid->value] = 1;
00576             }
00577 
00578             // vendors
00579             if ( isset($aParams['oxarticles__oxvendorid']) && $aParams['oxarticles__oxvendorid'] != $oArticle->oxarticles__oxvendorid->value) {
00580                 $aResetIds['vendor'][$aParams['oxarticles__oxvendorid']] = 1;
00581                 $aResetIds['vendor'][$oArticle->oxarticles__oxvendorid->value] = 1;
00582             }
00583 
00584             // manufacturers
00585             if ( isset($aParams['oxarticles__oxmanufacturerid']) && $aParams['oxarticles__oxmanufacturerid'] != $oArticle->oxarticles__oxmanufacturerid->value ) {
00586                 $aResetIds['manufacturer'][$aParams['oxarticles__oxmanufacturerid']] = 1;
00587                 $aResetIds['manufacturer'][$oArticle->oxarticles__oxmanufacturerid->value] = 1;
00588             }
00589 
00590             $this->_resetCounts( $aResetIds );
00591 
00592 
00593         $oArticle->setLanguage( 0 );
00594         $oArticle->assign( $aParams );
00595 
00596         // apply new language
00597         $sNewLanguage = oxConfig::getParameter( "new_lang");
00598         $oArticle->setLanguage( $sNewLanguage );
00599         $oArticle->save();
00600 
00601         // set for reload
00602         oxSession::setVar( "new_lang", $sNewLanguage );
00603 
00604         // set oxid if inserted
00605         if ( $soxId == "-1" ) {
00606             $this->_sSavedId = $oArticle->getId();
00607         }
00608     }
00609 
00618     public function addDefaultValues( $aParams )
00619     {
00620         return $aParams;
00621     }
00622 
00631     protected function _formJumpList( $oArticle, $oParentArticle )
00632     {
00633         $aJumpList = array();
00634         //fetching parent article variants
00635         if ( isset( $oParentArticle ) ) {
00636             $aJumpList[] = array( $oParentArticle->oxarticles__oxid->value, $this->_getTitle( $oParentArticle ) );
00637             $oParentVariants = $oParentArticle->getAdminVariants( oxConfig::getParameter( "editlanguage" ) );
00638             if ( $oParentVariants->count()) {
00639                 foreach ( $oParentVariants as $oVar) {
00640                     $aJumpList[] = array( $oVar->oxarticles__oxid->value, " - ".$this->_getTitle( $oVar ) );
00641                     if ( $oVar->oxarticles__oxid->value == $oArticle->oxarticles__oxid->value ) {
00642                         $oVariants = $oArticle->getAdminVariants(oxConfig::getParameter( "editlanguage"));
00643                         if ( $oVariants->count() ) {
00644                             foreach ( $oVariants as $oVVar) {
00645                                 $aJumpList[] = array( $oVVar->oxarticles__oxid->value, " -- ".$this->_getTitle( $oVVar));
00646                             }
00647                         }
00648                     }
00649                 }
00650             }
00651         } else {
00652             $aJumpList[] = array( $oArticle->oxarticles__oxid->value, $this->_getTitle( $oArticle));
00653             //fetching this article variants data
00654             $oVariants = $oArticle->getAdminVariants(oxConfig::getParameter( "editlanguage"));
00655             if ( $oVariants && $oVariants->count())
00656                 foreach ($oVariants as $oVar) {
00657                     $aJumpList[] = array( $oVar->oxarticles__oxid->value, " - ".$this->_getTitle( $oVar));
00658                 }
00659         }
00660         if ( count($aJumpList) > 1)
00661             $this->_aViewData["thisvariantlist"] = $aJumpList;
00662     }
00663 
00671     protected function _getTitle( $oObj )
00672     {
00673         $sTitle = $oObj->oxarticles__oxtitle->value;
00674         if ( !strlen( $sTitle ) ) {
00675             $sTitle = $oObj->oxarticles__oxvarselect->value;
00676         }
00677 
00678         return $sTitle;
00679     }
00680 
00686     public function getCategoryList()
00687     {
00688         $oCatTree = oxNew( "oxCategoryList");
00689         $oCatTree->buildList( $this->getConfig()->getConfigParam( 'bl_perfLoadCatTree' ) );
00690         return $oCatTree;
00691     }
00692 
00698     public function getVendorList()
00699     {
00700         $oVendorlist = oxNew( "oxvendorlist" );
00701         $oVendorlist->loadVendorList();
00702 
00703         return $oVendorlist;
00704     }
00705 
00711     public function getManufacturerList()
00712     {
00713         $oManufacturerList = oxNew( "oxmanufacturerlist" );
00714         $oManufacturerList->loadManufacturerList();
00715 
00716         return $oManufacturerList;
00717     }
00718 }

Generated by  doxygen 1.6.2