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         $oArticle = oxNew( "oxarticle");
00132 
00133         $oArticle->setLanguage($this->_iEditLang);
00134         if ( $soxId != "-1")
00135             $oArticle->loadInLang( $this->_iEditLang, $soxId);
00136         else {
00137             $aParams['oxarticles__oxid']        = null;
00138             $aParams['oxarticles__oxissearch']  = 1;
00139             $aParams['oxarticles__oxstockflag'] = 1;
00140                 // shopid
00141                 $sShopID = oxSession::getVar( "actshop");
00142                 $aParams['oxarticles__oxshopid'] = $sShopID;
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                 $rs = $oDb->execute($sQ);
00168                 if ( $rs !== false && $rs->recordCount() > 0 ) {
00169                     while (!$rs->EOF) {
00170                         $this->resetCounter( "catArticle", $rs->fields[0] );
00171                         $rs->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 
00247     public function copyArticle( $sOldId = null, $sNewId = null, $sParentId = null )
00248     {
00249         $myConfig  = $this->getConfig();
00250 
00251         $sOldId = $sOldId?$sOldId:oxConfig::getParameter( 'oxid' );
00252         $sNewId = $sNewId?$sNewId:oxUtilsObject::getInstance()->generateUID();
00253 
00254         $oArticle = oxNew( 'oxbase' );
00255         $oArticle->init( 'oxarticles' );
00256         if ( $oArticle->load( $sOldId ) ) {
00257 
00258             if ( $myConfig->getConfigParam( 'blDisableDublArtOnCopy' ) ) {
00259                 $oArticle->oxarticles__oxactive->setValue(0);
00260                 $oArticle->oxarticles__oxactivefrom->setValue(0);
00261                 $oArticle->oxarticles__oxactiveto->setValue(0);
00262             }
00263 
00264             // setting parent id
00265             if ( $sParentId ) {
00266                 $oArticle->oxarticles__oxparentid->setValue($sParentId);
00267             }
00268 
00269             // setting oxinsert/oxtimestamp
00270             $iNow = date('Y-m-d H:i:s', oxUtilsDate::getInstance()->getTime() );
00271             $oArticle->oxarticles__oxinsert    = new oxField( $iNow );
00272             $oArticle->oxarticles__oxtimestamp = new oxField( $iNow );
00273 
00274             $oArticle->setId( $sNewId );
00275             $oArticle->save();
00276 
00277             //copy categories
00278             $this->_copyCategories( $sOldId, $sNewId );
00279 
00280             //atributes
00281             $this->_copyAttributes( $sOldId, $sNewId );
00282 
00283             //sellist
00284             $this->_copySelectlists( $sOldId, $sNewId );
00285 
00286             //crossseling
00287             $this->_copyCrossseling( $sOldId, $sNewId );
00288 
00289             //accessoire
00290             $this->_copyAccessoires( $sOldId, $sNewId );
00291 
00292             // #983A copying staffelpreis info
00293             $this->_copyStaffelpreis( $sOldId, $sNewId );
00294 
00295             //copy article extends (longdescription, tags)
00296             $this->_copyArtExtends( $sOldId, $sNewId);
00297 
00298                 // resetting
00299                 $aResetIds['vendor'][$oArticle->oxarticles__oxvendorid->value] = 1;
00300                 $aResetIds['manufacturer'][$oArticle->oxarticles__oxmanufacturerid->value] = 1;
00301                 $this->_resetCounts( $aResetIds );
00302 
00303 
00304             $myUtilsObject = oxUtilsObject::getInstance();
00305             $oDb = oxDb::getDb();
00306 
00307             //copy variants
00308             $sQ = "select oxid from oxarticles where oxparentid = ".$oDb->quote( $sOldId );
00309             $rs = $oDb->execute($sQ);
00310             if ( $rs !== false && $rs->recordCount() > 0) {
00311                 while ( !$rs->EOF ) {
00312                     $this->copyArticle( $rs->fields[0], $myUtilsObject->generateUID(), $sNewId );
00313                     $rs->moveNext();
00314                 }
00315             }
00316 
00317             // only for top articles
00318             if ( !$sParentId ) {
00319 
00320                 $this->_sSavedId = $oArticle->getId();
00321 
00322                 //article number handling, warns for artnum dublicates
00323                 if ( $myConfig->getConfigParam( 'blWarnOnSameArtNums' ) &&
00324                      $oArticle->oxarticles__oxartnum->value && oxConfig::getParameter( 'fnc' ) == 'copyArticle' ) {
00325                     $sSelect = "select oxid from ".$oArticle->getCoreTableName()."
00326                                 where oxartnum = ".$oDb->quote( $oArticle->oxarticles__oxartnum->value )." and oxid != ".$oDb->quote( $sNewId );
00327 
00328                     if ( $oArticle->assignRecord( $sSelect ) ) {
00329                         $this->_aViewData["errorsavingatricle"] = 1;
00330                     }
00331                 }
00332             }
00333         }
00334     }
00335 
00344     protected function _copyCategories( $sOldID, $sNewID )
00345     {
00346         $myConfig = $this->getConfig();
00347         $myUtils  = oxUtils::getInstance();
00348         $oActShop = $myConfig->getActiveShop();
00349         $myUtilsCount  = oxUtilsCount::getInstance();
00350         $myUtilsObject = oxUtilsObject::getInstance();
00351         $oDb = oxDb::getDb();
00352 
00353         $sO2CView = getViewName('oxobject2category');
00354         $sQ = "select oxcatnid, oxtime from $sO2CView where oxobjectid = ".$oDb->quote( $sOldID );
00355         $rs = $oDb->execute($sQ);
00356         if ($rs !== false && $rs->recordCount() > 0) {
00357             while (!$rs->EOF) {
00358                 $sUID = $myUtilsObject->generateUID();
00359                 $sCatID = $rs->fields[0];
00360                 $sTime =  $rs->fields[1];
00361 
00362                     $oDb->execute("insert into oxobject2category (oxid, oxobjectid, oxcatnid, oxtime) VALUES (".$oDb->quote( $sUID ).", ".$oDb->quote( $sNewID ).", ".$oDb->quote( $sCatID ).", ".$oDb->quote( $sTime ).") ");
00363                 $rs->moveNext();
00364 
00365                     // resetting article count in category
00366                     $this->resetCounter( "catArticle", $sCatID );
00367             }
00368         }
00369     }
00370 
00379     protected function _copyAttributes( $sOldID, $sNewID )
00380     {
00381         $myUtilsObject = oxUtilsObject::getInstance();
00382         $oDb = oxDb::getDb();
00383 
00384         $sQ = "select oxid from oxobject2attribute where oxobjectid = ".$oDb->quote( $sOldID );
00385         $rs = $oDb->Execute($sQ);
00386         if ($rs !== false && $rs->recordCount() > 0) {
00387             while (!$rs->EOF) {
00388                 // #1055A
00389                 $oAttr = oxNew( "oxbase");
00390                 $oAttr->init( "oxobject2attribute" );
00391                 $oAttr->load( $rs->fields[0]);
00392                 $oAttr->setId( $myUtilsObject->generateUID() );
00393                 $oAttr->oxobject2attribute__oxobjectid->setValue($sNewID);
00394                 $oAttr->save();
00395                 $rs->moveNext();
00396             }
00397         }
00398     }
00399 
00408     protected function _copySelectlists( $sOldID, $sNewID)
00409     {
00410         $myUtilsObject = oxUtilsObject::getInstance();
00411         $oDb = oxDb::getDb();
00412 
00413         $sQ = "select oxselnid from oxobject2selectlist where oxobjectid = ".$oDb->quote( $sOldID );
00414         $rs = $oDb->Execute($sQ);
00415 
00416         if ($rs !== false && $rs->recordCount() > 0) {
00417             while (!$rs->EOF) {
00418                 $sUID = $myUtilsObject->generateUID();
00419                 $sID = $rs->fields[0];
00420                 $oDb->Execute("insert into oxobject2selectlist (oxid, oxobjectid, oxselnid) VALUES (".$oDb->quote( $sUID ).", ".$oDb->quote( $sNewID ).", ".$oDb->quote( $sID ).") ");
00421                 $rs->moveNext();
00422             }
00423         }
00424     }
00425 
00434     protected function _copyCrossseling( $sOldID, $sNewID )
00435     {
00436         $myUtilsObject = oxUtilsObject::getInstance();
00437         $oDb = oxDb::getDb();
00438 
00439         $sQ = "select oxobjectid from oxobject2article where oxarticlenid = ".$oDb->quote( $sOldID );
00440         $rs = $oDb->Execute($sQ);
00441         if ($rs !== false && $rs->recordCount() > 0) {
00442             while (!$rs->EOF) {
00443                 $sUID = $myUtilsObject->generateUID();
00444                 $sID = $rs->fields[0];
00445                 $oDb->Execute("insert into oxobject2article (oxid, oxobjectid, oxarticlenid) VALUES (".$oDb->quote( $sUID ).", ".$oDb->quote( $sID ).", ".$oDb->quote( $sNewID )." ) ");
00446                 $rs->moveNext();
00447             }
00448         }
00449     }
00450 
00459     protected function _copyAccessoires( $sOldID, $sNewID )
00460     {
00461         $myUtilsObject = oxUtilsObject::getInstance();
00462         $oDb = oxDb::getDb();
00463 
00464         $sQ = "select oxobjectid from oxaccessoire2article where oxarticlenid= ".$oDb->quote( $sOldID );
00465         $rs = $oDb->Execute($sQ);
00466         if ($rs !== false && $rs->recordCount() > 0) {
00467             while (!$rs->EOF) {
00468                 $sUID = $myUtilsObject->generateUID();
00469                 $sID = $rs->fields[0];
00470                 $oDb->Execute("insert into oxaccessoire2article (oxid, oxobjectid, oxarticlenid) VALUES (".$oDb->quote( $sUID ).", ".$oDb->quote( $sID ).", ".$oDb->quote( $sNewID ).") ");
00471                 $rs->moveNext();
00472             }
00473         }
00474     }
00475 
00484     protected function _copyStaffelpreis( $sOldID, $sNewID )
00485     {
00486         $myConfig = $this->getConfig();
00487         $sShopID = $myConfig->getShopID();
00488         $oPriceList = oxNew("oxlist");
00489         $oPriceList->init( "oxbase", "oxprice2article");
00490         $sQ = "select * from oxprice2article where oxartid = '$sOldID' and oxshopid = '$sShopID' and (oxamount > 0 or oxamountto > 0) order by oxamount ";
00491         $oPriceList->selectString($sQ);
00492         if ($oPriceList->count()) {
00493             foreach ($oPriceList as $oItem) {
00494                 $oItem->oxprice2article__oxid->setValue($oItem->setId());
00495                 $oItem->oxprice2article__oxartid->setValue($sNewID);
00496                 $oItem->save();
00497             }
00498         }
00499     }
00500 
00509     protected function _copyArtExtends( $sOldID, $sNewID)
00510     {
00511         $oExt = oxNew( "oxbase");
00512         $oExt->init( "oxartextends" );
00513         $oExt->load( $sOldID);
00514         $oExt->setId( $sNewID );
00515         $oExt->save();
00516     }
00517 
00518 
00524     public function saveinnlang()
00525     {
00526         $myConfig  = $this->getConfig();
00527         $myUtilsCount = oxUtilsCount::getInstance();
00528 
00529         $soxId   = oxConfig::getParameter( "oxid" );
00530         $aParams = oxConfig::getParameter( "editval" );
00531 
00532         // checkbox handling
00533         if ( !isset( $aParams['oxarticles__oxactive'] ) ) {
00534             $aParams['oxarticles__oxactive'] = 0;
00535         }
00536 
00537         // default values
00538         $aParams = $this->addDefaultValues( $aParams);
00539 
00540         // null values
00541         if ($aParams['oxarticles__oxvat'] === '')
00542             $aParams['oxarticles__oxvat'] = null;
00543 
00544         // varianthandling
00545         $soxparentId = oxConfig::getParameter( "oxparentid");
00546         if ( isset( $soxparentId) && $soxparentId && $soxparentId != "-1")
00547             $aParams['oxarticles__oxparentid'] = $soxparentId;
00548 
00549         $oArticle = oxNew( "oxarticle");
00550         $oArticle->setLanguage($this->_iEditLang);
00551 
00552         if ( $soxId != "-1")
00553             $oArticle->load( $soxId);
00554         else {
00555             $aParams['oxarticles__oxid'] = null;
00556                 // shopid
00557                 $sShopID = oxSession::getVar( "actshop");
00558                 $aParams['oxarticles__oxshopid'] = $sShopID;
00559         }
00560 
00561             // #905A resetting article count in price categories if price has been changed
00562             if ( isset($aParams["oxarticles__oxprice"]) && $aParams["oxarticles__oxprice"] != $oArticle->oxarticles__oxprice->value) {
00563                 $this->resetCounter( "priceCatArticle", $oArticle->oxarticles__oxprice->value );
00564             }
00565 
00566             $aResetIds = array();
00567 
00568             if ( $aParams['oxarticles__oxactive'] != $oArticle->oxarticles__oxactive->value) {
00569                 $oDb = oxDb::getDb();
00570                 //check categories
00571                 $sQ = "select oxcatnid from oxobject2category where oxobjectid = ".$oDb->quote( $oArticle->oxarticles__oxid->value );
00572                 $rs = $oDb->Execute($sQ);
00573                 if ($rs !== false && $rs->recordCount() > 0)
00574                     while (!$rs->EOF) {
00575                         $this->resetCounter( "catArticle", $rs->fields[0] );
00576                         $rs->moveNext();
00577                     }
00578                 // vendors
00579                 $aResetIds['vendor'][$oArticle->oxarticles__oxvendorid->value] = 1;
00580                 $aResetIds['manufacturer'][$oArticle->oxarticles__oxmanufacturerid->value] = 1;
00581             }
00582 
00583             // vendors
00584             if ( isset($aParams['oxarticles__oxvendorid']) && $aParams['oxarticles__oxvendorid'] != $oArticle->oxarticles__oxvendorid->value) {
00585                 $aResetIds['vendor'][$aParams['oxarticles__oxvendorid']] = 1;
00586                 $aResetIds['vendor'][$oArticle->oxarticles__oxvendorid->value] = 1;
00587             }
00588 
00589             // manufacturers
00590             if ( isset($aParams['oxarticles__oxmanufacturerid']) && $aParams['oxarticles__oxmanufacturerid'] != $oArticle->oxarticles__oxmanufacturerid->value ) {
00591                 $aResetIds['manufacturer'][$aParams['oxarticles__oxmanufacturerid']] = 1;
00592                 $aResetIds['manufacturer'][$oArticle->oxarticles__oxmanufacturerid->value] = 1;
00593             }
00594 
00595             $this->_resetCounts( $aResetIds );
00596 
00597 
00598         //$aParams = $oArticle->ConvertNameArray2Idx( $aParams);
00599 
00600         $oArticle->setLanguage(0);
00601         $oArticle->assign( $aParams);
00602 
00603         // apply new language
00604         $sNewLanguage = oxConfig::getParameter( "new_lang");
00605         $oArticle->setLanguage( $sNewLanguage);
00606         $oArticle->save();
00607 
00608         // set for reload
00609         oxSession::setVar( "new_lang", $sNewLanguage );
00610 
00611         // set oxid if inserted
00612         if ( $soxId == "-1" )
00613             $this->_sSavedId = $oArticle->getId();
00614     }
00615 
00624     public function addDefaultValues( $aParams )
00625     {
00626         return $aParams;
00627     }
00628 
00637     protected function _formJumpList( $oArticle, $oParentArticle )
00638     {
00639         $aJumpList = array();
00640         //fetching parent article variants
00641         if ( isset( $oParentArticle ) ) {
00642             $aJumpList[] = array( $oParentArticle->oxarticles__oxid->value, $this->_getTitle( $oParentArticle ) );
00643             $oParentVariants = $oParentArticle->getAdminVariants( oxConfig::getParameter( "editlanguage" ) );
00644             if ( $oParentVariants->count()) {
00645                 foreach ( $oParentVariants as $oVar) {
00646                     $aJumpList[] = array( $oVar->oxarticles__oxid->value, " - ".$this->_getTitle( $oVar ) );
00647                     if ( $oVar->oxarticles__oxid->value == $oArticle->oxarticles__oxid->value ) {
00648                         $oVariants = $oArticle->getAdminVariants(oxConfig::getParameter( "editlanguage"));
00649                         if ( $oVariants->count() ) {
00650                             foreach ( $oVariants as $oVVar) {
00651                                 $aJumpList[] = array( $oVVar->oxarticles__oxid->value, " -- ".$this->_getTitle( $oVVar));
00652                             }
00653                         }
00654                     }
00655                 }
00656             }
00657         } else {
00658             $aJumpList[] = array( $oArticle->oxarticles__oxid->value, $this->_getTitle( $oArticle));
00659             //fetching this article variants data
00660             $oVariants = $oArticle->getAdminVariants(oxConfig::getParameter( "editlanguage"));
00661             if ( $oVariants && $oVariants->count())
00662                 foreach ($oVariants as $oVar) {
00663                     $aJumpList[] = array( $oVar->oxarticles__oxid->value, " - ".$this->_getTitle( $oVar));
00664                 }
00665         }
00666         if ( count($aJumpList) > 1)
00667             $this->_aViewData["thisvariantlist"] = $aJumpList;
00668     }
00669 
00677     protected function _getTitle( $oObj )
00678     {
00679         $sTitle = $oObj->oxarticles__oxtitle->value;
00680         if ( !strlen( $sTitle ) ) {
00681             $sTitle = $oObj->oxarticles__oxvarselect->value;
00682         }
00683 
00684         return $sTitle;
00685     }
00686 
00692     public function getCategoryList()
00693     {
00694         $oCatTree = oxNew( "oxCategoryList");
00695         $oCatTree->buildList( $this->getConfig()->getConfigParam( 'bl_perfLoadCatTree' ) );
00696         return $oCatTree;
00697     }
00698 
00704     public function getVendorList()
00705     {
00706         $oVendorlist = oxNew( "oxvendorlist" );
00707         $oVendorlist->loadVendorList();
00708 
00709         return $oVendorlist;
00710     }
00711 
00717     public function getManufacturerList()
00718     {
00719         $oManufacturerList = oxNew( "oxmanufacturerlist" );
00720         $oManufacturerList->loadManufacturerList();
00721 
00722         return $oManufacturerList;
00723     }
00724 }

Generated on Mon Oct 26 20:07:15 2009 for OXID eShop CE by  doxygen 1.5.5