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             $sFastCat = oxConfig::getParameter( "art_category");
00211             if ( $sFastCat != "-1") {
00212                 $this->addToCategory($sFastCat, $oArticle->getId());
00213             }
00214         }
00215 
00216 
00217         $this->_aViewData["updatelist"] = "1";
00218 
00219         //saving tags
00220         $sTags = $aParams['tags'];
00221         if (!trim($sTags)) {
00222             $sTags = $oArticle->oxarticles__oxsearchkeys->value;
00223         }
00224         $oArticle->saveTags($sTags);
00225     }
00226 
00235     public function addToCategory($sCatID, $sOXID)
00236     {
00237         $myConfig  = $this->getConfig();
00238 
00239         $oNew = oxNew( "oxbase");
00240         $oNew->init( "oxobject2category" );
00241         $oNew->oxobject2category__oxtime = new oxField(time());
00242         $oNew->oxobject2category__oxobjectid = new oxField($sOXID);
00243         $oNew->oxobject2category__oxcatnid = new oxField($sCatID);
00244 
00245         $oNew->save();
00246 
00247             // resetting amount of articles in category
00248             $this->resetCounter( "catArticle", $sCatID );
00249     }
00250 
00260     public function copyArticle( $sOldId = null, $sNewId = null, $sParentId = null )
00261     {
00262         $myConfig = $this->getConfig();
00263 
00264         $sOldId = $sOldId ? $sOldId : oxConfig::getParameter( 'oxid' );
00265         $sNewId = $sNewId ? $sNewId : oxUtilsObject::getInstance()->generateUID();
00266 
00267         $oArticle = oxNew( 'oxbase' );
00268         $oArticle->init( 'oxarticles' );
00269         if ( $oArticle->load( $sOldId ) ) {
00270 
00271             if ( $myConfig->getConfigParam( 'blDisableDublArtOnCopy' ) ) {
00272                 $oArticle->oxarticles__oxactive->setValue( 0 );
00273                 $oArticle->oxarticles__oxactivefrom->setValue( 0 );
00274                 $oArticle->oxarticles__oxactiveto->setValue( 0 );
00275             }
00276 
00277             // setting parent id
00278             if ( $sParentId ) {
00279                 $oArticle->oxarticles__oxparentid->setValue( $sParentId );
00280             }
00281 
00282             // setting oxinsert/oxtimestamp
00283             $iNow = date( 'Y-m-d H:i:s', oxUtilsDate::getInstance()->getTime() );
00284             $oArticle->oxarticles__oxinsert    = new oxField( $iNow );
00285             $oArticle->oxarticles__oxtimestamp = new oxField( $iNow );
00286 
00287             // mantis#0001590: OXRATING and OXRATINGCNT not set to 0 when copying article
00288             $oArticle->oxarticles__oxrating    = new oxField( 0 );
00289             $oArticle->oxarticles__oxratingcnt = new oxField( 0 );
00290 
00291             $oArticle->setId( $sNewId );
00292             $oArticle->save();
00293 
00294             //copy categories
00295             $this->_copyCategories( $sOldId, $sNewId );
00296 
00297             //atributes
00298             $this->_copyAttributes( $sOldId, $sNewId );
00299 
00300             //sellist
00301             $this->_copySelectlists( $sOldId, $sNewId );
00302 
00303             //crossseling
00304             $this->_copyCrossseling( $sOldId, $sNewId );
00305 
00306             //accessoire
00307             $this->_copyAccessoires( $sOldId, $sNewId );
00308 
00309             // #983A copying staffelpreis info
00310             $this->_copyStaffelpreis( $sOldId, $sNewId );
00311 
00312             //copy article extends (longdescription, tags)
00313             $this->_copyArtExtends( $sOldId, $sNewId);
00314 
00315                 // resetting
00316                 $aResetIds['vendor'][$oArticle->oxarticles__oxvendorid->value] = 1;
00317                 $aResetIds['manufacturer'][$oArticle->oxarticles__oxmanufacturerid->value] = 1;
00318                 $this->_resetCounts( $aResetIds );
00319 
00320 
00321             $myUtilsObject = oxUtilsObject::getInstance();
00322             $oDb = oxDb::getDb();
00323 
00324             //copy variants
00325             $sQ = "select oxid from oxarticles where oxparentid = ".$oDb->quote( $sOldId );
00326             $oRs = $oDb->execute( $sQ );
00327             if ( $oRs !== false && $oRs->recordCount() > 0) {
00328                 while ( !$oRs->EOF ) {
00329                     $this->copyArticle( $oRs->fields[0], $myUtilsObject->generateUid(), $sNewId );
00330                     $oRs->moveNext();
00331                 }
00332             }
00333 
00334             // only for top articles
00335             if ( !$sParentId ) {
00336 
00337                 $this->_sSavedId = $oArticle->getId();
00338 
00339                 //article number handling, warns for artnum dublicates
00340                 if ( $myConfig->getConfigParam( 'blWarnOnSameArtNums' ) &&
00341                      $oArticle->oxarticles__oxartnum->value && oxConfig::getParameter( 'fnc' ) == 'copyArticle' ) {
00342                     $sSelect = "select oxid from ".$oArticle->getCoreTableName()."
00343                                 where oxartnum = ".$oDb->quote( $oArticle->oxarticles__oxartnum->value )." and oxid != ".$oDb->quote( $sNewId );
00344 
00345                     if ( $oArticle->assignRecord( $sSelect ) ) {
00346                         $this->_aViewData["errorsavingatricle"] = 1;
00347                     }
00348                 }
00349             }
00350         }
00351     }
00352 
00361     protected function _copyCategories( $sOldId, $sNewId )
00362     {
00363         $myUtilsObject = oxUtilsObject::getInstance();
00364         $oDb = oxDb::getDb();
00365 
00366 
00367         $sO2CView = getViewName( 'oxobject2category' );
00368         $sQ = "select oxcatnid, oxtime from {$sO2CView} where oxobjectid = ".$oDb->quote( $sOldId );
00369         $oRs = $oDb->execute( $sQ );
00370         if ( $oRs !== false && $oRs->recordCount() > 0 ) {
00371             while ( !$oRs->EOF ) {
00372                 $sUid = $myUtilsObject->generateUid();
00373                 $sCatId = $oRs->fields[0];
00374                 $sTime  = $oRs->fields[1];
00375 
00376 
00377                     $oDb->execute("insert into oxobject2category (oxid, oxobjectid, oxcatnid, oxtime) VALUES (".$oDb->quote( $sUid ).", ".$oDb->quote( $sNewId ).", ".$oDb->quote( $sCatId ).", ".$oDb->quote( $sTime ).") ");
00378 
00379                 $oRs->moveNext();
00380 
00381                     // resetting article count in category
00382                     $this->resetCounter( "catArticle", $sCatId );
00383             }
00384         }
00385     }
00386 
00395     protected function _copyAttributes( $sOldId, $sNewId )
00396     {
00397         $myUtilsObject = oxUtilsObject::getInstance();
00398         $oDb = oxDb::getDb();
00399 
00400         $sQ = "select oxid from oxobject2attribute where oxobjectid = ".$oDb->quote( $sOldId );
00401         $oRs = $oDb->execute($sQ);
00402         if ( $oRs !== false && $oRs->recordCount() > 0 ) {
00403             while ( !$oRs->EOF ) {
00404                 // #1055A
00405                 $oAttr = oxNew( "oxbase" );
00406                 $oAttr->init( "oxobject2attribute" );
00407                 $oAttr->load( $oRs->fields[0] );
00408                 $oAttr->setId( $myUtilsObject->generateUID() );
00409                 $oAttr->oxobject2attribute__oxobjectid->setValue( $sNewId );
00410                 $oAttr->save();
00411                 $oRs->moveNext();
00412             }
00413         }
00414     }
00415 
00424     protected function _copySelectlists( $sOldId, $sNewId )
00425     {
00426         $myUtilsObject = oxUtilsObject::getInstance();
00427         $oDb = oxDb::getDb();
00428 
00429         $sQ = "select oxselnid from oxobject2selectlist where oxobjectid = ".$oDb->quote( $sOldId );
00430         $oRs = $oDb->execute( $sQ );
00431         if ( $oRs !== false && $oRs->recordCount() > 0 ) {
00432             while ( !$oRs->EOF ) {
00433                 $sUid = $myUtilsObject->generateUID();
00434                 $sId = $oRs->fields[0];
00435                 $oDb->execute( "insert into oxobject2selectlist (oxid, oxobjectid, oxselnid) VALUES (".$oDb->quote( $sUid ).", ".$oDb->quote( $sNewId ).", ".$oDb->quote( $sId ).") " );
00436                 $oRs->moveNext();
00437             }
00438         }
00439     }
00440 
00449     protected function _copyCrossseling( $sOldId, $sNewId )
00450     {
00451         $myUtilsObject = oxUtilsObject::getInstance();
00452         $oDb = oxDb::getDb();
00453 
00454         $sQ = "select oxobjectid from oxobject2article where oxarticlenid = ".$oDb->quote( $sOldId );
00455         $oRs = $oDb->execute( $sQ );
00456         if ( $oRs !== false && $oRs->recordCount() > 0 ) {
00457             while ( !$oRs->EOF ) {
00458                 $sUid = $myUtilsObject->generateUID();
00459                 $sId = $oRs->fields[0];
00460                 $oDb->execute("insert into oxobject2article (oxid, oxobjectid, oxarticlenid) VALUES (".$oDb->quote( $sUid ).", ".$oDb->quote( $sId ).", ".$oDb->quote( $sNewId )." ) ");
00461                 $oRs->moveNext();
00462             }
00463         }
00464     }
00465 
00474     protected function _copyAccessoires( $sOldId, $sNewId )
00475     {
00476         $myUtilsObject = oxUtilsObject::getInstance();
00477         $oDb = oxDb::getDb();
00478 
00479         $sQ = "select oxobjectid from oxaccessoire2article where oxarticlenid= ".$oDb->quote( $sOldId );
00480         $oRs = $oDb->execute( $sQ );
00481         if ( $oRs !== false && $oRs->recordCount() > 0 ) {
00482             while ( !$oRs->EOF ) {
00483                 $sUId = $myUtilsObject->generateUid();
00484                 $sId = $oRs->fields[0];
00485                 $oDb->execute( "insert into oxaccessoire2article (oxid, oxobjectid, oxarticlenid) VALUES (".$oDb->quote( $sUId ).", ".$oDb->quote( $sId ).", ".$oDb->quote( $sNewId ).") " );
00486                 $oRs->moveNext();
00487             }
00488         }
00489     }
00490 
00499     protected function _copyStaffelpreis( $sOldId, $sNewId )
00500     {
00501         $sShopId = $this->getConfig()->getShopId();
00502         $oPriceList = oxNew( "oxlist" );
00503         $oPriceList->init( "oxbase", "oxprice2article" );
00504         $sQ = "select * from oxprice2article where oxartid = '$sOldId' and oxshopid = '$sShopId' and (oxamount > 0 or oxamountto > 0) order by oxamount ";
00505         $oPriceList->selectString( $sQ );
00506         if ( $oPriceList->count() ) {
00507             foreach ( $oPriceList as $oItem ) {
00508                 $oItem->oxprice2article__oxid->setValue( $oItem->setId() );
00509                 $oItem->oxprice2article__oxartid->setValue( $sNewId );
00510                 $oItem->save();
00511             }
00512         }
00513     }
00514 
00523     protected function _copyArtExtends( $sOldId, $sNewId)
00524     {
00525         $oExt = oxNew( "oxbase");
00526         $oExt->init( "oxartextends" );
00527         $oExt->load( $sOldId );
00528         $oExt->setId( $sNewId );
00529         $oExt->save();
00530     }
00531 
00532 
00538     public function saveinnlang()
00539     {
00540         $soxId   = oxConfig::getParameter( "oxid" );
00541         $aParams = oxConfig::getParameter( "editval" );
00542 
00543         // checkbox handling
00544         if ( !isset( $aParams['oxarticles__oxactive'] ) ) {
00545             $aParams['oxarticles__oxactive'] = 0;
00546         }
00547 
00548         // default values
00549         $aParams = $this->addDefaultValues( $aParams );
00550 
00551         // null values
00552         if ($aParams['oxarticles__oxvat'] === '') {
00553             $aParams['oxarticles__oxvat'] = null;
00554         }
00555 
00556         // varianthandling
00557         $soxparentId = oxConfig::getParameter( "oxparentid");
00558         if ( isset( $soxparentId) && $soxparentId && $soxparentId != "-1") {
00559             $aParams['oxarticles__oxparentid'] = $soxparentId;
00560         }
00561 
00562         $oArticle = oxNew( "oxarticle");
00563         $oArticle->setLanguage($this->_iEditLang);
00564 
00565         if ( $soxId != "-1") {
00566             $oArticle->load( $soxId);
00567         } else {
00568             $aParams['oxarticles__oxid'] = null;
00569                 // shopid
00570                 $sShopId = oxSession::getVar( "actshop");
00571                 $aParams['oxarticles__oxshopid'] = $sShopId;
00572         }
00573 
00574             // #905A resetting article count in price categories if price has been changed
00575             if ( isset($aParams["oxarticles__oxprice"]) && $aParams["oxarticles__oxprice"] != $oArticle->oxarticles__oxprice->value) {
00576                 $this->resetCounter( "priceCatArticle", $oArticle->oxarticles__oxprice->value );
00577             }
00578 
00579             $aResetIds = array();
00580 
00581             if ( $aParams['oxarticles__oxactive'] != $oArticle->oxarticles__oxactive->value) {
00582                 $oDb = oxDb::getDb();
00583                 //check categories
00584                 $sQ = "select oxcatnid from oxobject2category where oxobjectid = ".$oDb->quote( $oArticle->oxarticles__oxid->value );
00585                 $oRs = $oDb->execute($sQ);
00586                 if ($oRs !== false && $oRs->recordCount() > 0)
00587                     while (!$oRs->EOF) {
00588                         $this->resetCounter( "catArticle", $oRs->fields[0] );
00589                         $oRs->moveNext();
00590                     }
00591                 // vendors
00592                 $aResetIds['vendor'][$oArticle->oxarticles__oxvendorid->value] = 1;
00593                 $aResetIds['manufacturer'][$oArticle->oxarticles__oxmanufacturerid->value] = 1;
00594             }
00595 
00596             // vendors
00597             if ( isset($aParams['oxarticles__oxvendorid']) && $aParams['oxarticles__oxvendorid'] != $oArticle->oxarticles__oxvendorid->value) {
00598                 $aResetIds['vendor'][$aParams['oxarticles__oxvendorid']] = 1;
00599                 $aResetIds['vendor'][$oArticle->oxarticles__oxvendorid->value] = 1;
00600             }
00601 
00602             // manufacturers
00603             if ( isset($aParams['oxarticles__oxmanufacturerid']) && $aParams['oxarticles__oxmanufacturerid'] != $oArticle->oxarticles__oxmanufacturerid->value ) {
00604                 $aResetIds['manufacturer'][$aParams['oxarticles__oxmanufacturerid']] = 1;
00605                 $aResetIds['manufacturer'][$oArticle->oxarticles__oxmanufacturerid->value] = 1;
00606             }
00607 
00608             $this->_resetCounts( $aResetIds );
00609 
00610 
00611         $oArticle->setLanguage( 0 );
00612         $oArticle->assign( $aParams );
00613 
00614         // apply new language
00615         $sNewLanguage = oxConfig::getParameter( "new_lang");
00616         $oArticle->setLanguage( $sNewLanguage );
00617         $oArticle->save();
00618 
00619         // set for reload
00620         oxSession::setVar( "new_lang", $sNewLanguage );
00621 
00622         // set oxid if inserted
00623         if ( $soxId == "-1" ) {
00624             $this->_sSavedId = $oArticle->getId();
00625         }
00626     }
00627 
00636     public function addDefaultValues( $aParams )
00637     {
00638         return $aParams;
00639     }
00640 
00649     protected function _formJumpList( $oArticle, $oParentArticle )
00650     {
00651         $aJumpList = array();
00652         //fetching parent article variants
00653         if ( isset( $oParentArticle ) ) {
00654             $aJumpList[] = array( $oParentArticle->oxarticles__oxid->value, $this->_getTitle( $oParentArticle ) );
00655             $oParentVariants = $oParentArticle->getAdminVariants( oxConfig::getParameter( "editlanguage" ) );
00656             if ( $oParentVariants->count()) {
00657                 foreach ( $oParentVariants as $oVar) {
00658                     $aJumpList[] = array( $oVar->oxarticles__oxid->value, " - ".$this->_getTitle( $oVar ) );
00659                     if ( $oVar->oxarticles__oxid->value == $oArticle->oxarticles__oxid->value ) {
00660                         $oVariants = $oArticle->getAdminVariants(oxConfig::getParameter( "editlanguage"));
00661                         if ( $oVariants->count() ) {
00662                             foreach ( $oVariants as $oVVar) {
00663                                 $aJumpList[] = array( $oVVar->oxarticles__oxid->value, " -- ".$this->_getTitle( $oVVar));
00664                             }
00665                         }
00666                     }
00667                 }
00668             }
00669         } else {
00670             $aJumpList[] = array( $oArticle->oxarticles__oxid->value, $this->_getTitle( $oArticle));
00671             //fetching this article variants data
00672             $oVariants = $oArticle->getAdminVariants(oxConfig::getParameter( "editlanguage"));
00673             if ( $oVariants && $oVariants->count())
00674                 foreach ($oVariants as $oVar) {
00675                     $aJumpList[] = array( $oVar->oxarticles__oxid->value, " - ".$this->_getTitle( $oVar));
00676                 }
00677         }
00678         if ( count($aJumpList) > 1)
00679             $this->_aViewData["thisvariantlist"] = $aJumpList;
00680     }
00681 
00689     protected function _getTitle( $oObj )
00690     {
00691         $sTitle = $oObj->oxarticles__oxtitle->value;
00692         if ( !strlen( $sTitle ) ) {
00693             $sTitle = $oObj->oxarticles__oxvarselect->value;
00694         }
00695 
00696         return $sTitle;
00697     }
00698 
00704     public function getCategoryList()
00705     {
00706         $oCatTree = oxNew( "oxCategoryList");
00707         $oCatTree->buildList( $this->getConfig()->getConfigParam( 'bl_perfLoadCatTree' ) );
00708         return $oCatTree;
00709     }
00710 
00716     public function getVendorList()
00717     {
00718         $oVendorlist = oxNew( "oxvendorlist" );
00719         $oVendorlist->loadVendorList();
00720 
00721         return $oVendorlist;
00722     }
00723 
00729     public function getManufacturerList()
00730     {
00731         $oManufacturerList = oxNew( "oxmanufacturerlist" );
00732         $oManufacturerList->loadManufacturerList();
00733 
00734         return $oManufacturerList;
00735     }
00736 }

Generated by  doxygen 1.6.2