article_main.php

Go to the documentation of this file.
00001 <?php
00002 
00009 class Article_Main extends oxAdminDetails
00010 {
00011 
00018     public function render()
00019     {
00020         parent::render();
00021 
00022         $this->getConfig()->setConfigParam('bl_perfLoadPrice', true);
00023 
00024         $oArticle = oxNew('oxArticle');
00025         $oArticle->enablePriceLoad();
00026 
00027         $this->_aViewData['edit'] = $oArticle;
00028 
00029         $sOxId = $this->getEditObjectId();
00030         $sVoxId = $this->getConfig()->getRequestParameter("voxid");
00031         $sOxParentId = $this->getConfig()->getRequestParameter("oxparentid");
00032 
00033         // new variant ?
00034         if (isset($sVoxId) && $sVoxId == "-1" && isset($sOxParentId) && $sOxParentId && $sOxParentId != "-1") {
00035             $oParentArticle = oxNew("oxArticle");
00036             $oParentArticle->load($sOxParentId);
00037             $this->_aViewData["parentarticle"] = $oParentArticle;
00038             $this->_aViewData["oxparentid"] = $sOxParentId;
00039 
00040             $this->_aViewData["oxid"] = $sOxId = "-1";
00041         }
00042 
00043         if ($sOxId && $sOxId != "-1") {
00044 
00045             // load object
00046             $oArticle->loadInLang($this->_iEditLang, $sOxId);
00047 
00048 
00049             // load object in other languages
00050             $oOtherLang = $oArticle->getAvailableInLangs();
00051             if (!isset($oOtherLang[$this->_iEditLang])) {
00052                 // echo "language entry doesn't exist! using: ".key($oOtherLang);
00053                 $oArticle->loadInLang(key($oOtherLang), $sOxId);
00054             }
00055 
00056             // variant handling
00057             if ($oArticle->oxarticles__oxparentid->value) {
00058                 $oParentArticle = oxNew("oxArticle");
00059                 $oParentArticle->load($oArticle->oxarticles__oxparentid->value);
00060                 $this->_aViewData["parentarticle"] = $oParentArticle;
00061                 $this->_aViewData["oxparentid"] = $oArticle->oxarticles__oxparentid->value;
00062                 $this->_aViewData["issubvariant"] = 1;
00063             }
00064 
00065             // #381A
00066             $this->_formJumpList($oArticle, $oParentArticle);
00067 
00068             //loading tags
00069             $oArticleTagList = oxNew("oxArticleTagList");
00070             $oArticleTagList->loadInLang($this->_iEditLang, $oArticle->getId());
00071             $oArticle->tags = $oArticleTagList->get();
00072 
00073             $aLang = array_diff(oxRegistry::getLang()->getLanguageNames(), $oOtherLang);
00074             if (count($aLang)) {
00075                 $this->_aViewData["posslang"] = $aLang;
00076             }
00077 
00078             foreach ($oOtherLang as $id => $language) {
00079                 $oLang = new stdClass();
00080                 $oLang->sLangDesc = $language;
00081                 $oLang->selected = ($id == $this->_iEditLang);
00082                 $this->_aViewData["otherlang"][$id] = clone $oLang;
00083             }
00084         }
00085 
00086         $this->_aViewData["editor"] = $this->_generateTextEditor(
00087             "100%",
00088             300,
00089             $oArticle,
00090             "oxarticles__oxlongdesc",
00091             "details.tpl.css"
00092         );
00093         $this->_aViewData["blUseTimeCheck"] = $this->getConfig()->getConfigParam('blUseTimeCheck');
00094 
00095         return "article_main.tpl";
00096     }
00097 
00106     protected function _getEditValue($oObject, $sField)
00107     {
00108         $sEditObjectValue = '';
00109         if ($oObject) {
00110             $oDescField = $oObject->getLongDescription();
00111             $sEditObjectValue = $this->_processEditValue($oDescField->getRawValue());
00112             $oDescField = new oxField($sEditObjectValue, oxField::T_RAW);
00113         }
00114 
00115         return $sEditObjectValue;
00116     }
00117 
00121     public function save()
00122     {
00123         parent::save();
00124 
00125         $oConfig = $this->getConfig();
00126         $soxId = $this->getEditObjectId();
00127         $aParams = $oConfig->getRequestParameter("editval");
00128 
00129         // default values
00130         $aParams = $this->addDefaultValues($aParams);
00131 
00132         // null values
00133         if (isset($aParams['oxarticles__oxvat']) && $aParams['oxarticles__oxvat'] === '') {
00134             $aParams['oxarticles__oxvat'] = null;
00135         }
00136 
00137         // varianthandling
00138         $soxparentId = $oConfig->getRequestParameter("oxparentid");
00139         if (isset($soxparentId) && $soxparentId && $soxparentId != "-1") {
00140             $aParams['oxarticles__oxparentid'] = $soxparentId;
00141         } else {
00142             unset($aParams['oxarticles__oxparentid']);
00143         }
00144 
00145         $oArticle = oxNew("oxarticle");
00146         $oArticle->setLanguage($this->_iEditLang);
00147 
00148         if ($soxId != "-1") {
00149             $oArticle->loadInLang($this->_iEditLang, $soxId);
00150         } else {
00151             $aParams['oxarticles__oxid'] = null;
00152             $aParams['oxarticles__oxissearch'] = 1;
00153             $aParams['oxarticles__oxstockflag'] = 1;
00154             if (empty($aParams['oxarticles__oxstock'])) {
00155                 $aParams['oxarticles__oxstock'] = 0;
00156             }
00157 
00158             // shopid
00159             $aParams['oxarticles__oxshopid'] = oxRegistry::getSession()->getVariable("actshop");
00160 
00161             if (!isset($aParams['oxarticles__oxactive'])) {
00162                 $aParams['oxarticles__oxactive'] = 0;
00163             }
00164         }
00165 
00166         //article number handling, warns for artnum dublicates
00167         if (isset($aParams['oxarticles__oxartnum']) && strlen($aParams['oxarticles__oxartnum']) > 0 &&
00168             $oConfig->getConfigParam('blWarnOnSameArtNums') &&
00169             $oArticle->oxarticles__oxartnum->value != $aParams['oxarticles__oxartnum']
00170         ) {
00171             $sSelect = "select oxid from " . getViewName('oxarticles');
00172             $sSelect .= " where oxartnum = '" . $aParams['oxarticles__oxartnum'] . "'";
00173             $sSelect .= " and oxid != '" . $aParams['oxarticles__oxid'] . "'";
00174             if ($oArticle->assignRecord($sSelect)) {
00175                 $this->_aViewData["errorsavingatricle"] = 1;
00176             }
00177         }
00178 
00179 
00180         // #905A resetting article count in price categories if price has been changed
00181         $sOxIdField = 'oxarticles__oxid';
00182         $sPriceField = 'oxarticles__oxprice';
00183         $sActiveField = 'oxarticles__oxactive';
00184         $sVendorField = 'oxarticles__oxvendorid';
00185         $sManufacturerField = 'oxarticles__oxmanufacturerid';
00186         if (isset($aParams[$sPriceField]) && $aParams[$sPriceField] != $oArticle->$sPriceField->value) {
00187             $this->resetCounter("priceCatArticle", $oArticle->$sPriceField->value);
00188         }
00189 
00190         $aResetIds = array();
00191         if (isset($aParams[$sActiveField]) && $aParams[$sActiveField] != $oArticle->$sActiveField->value) {
00192             //check categories
00193             $this->_resetCategoriesCounter($oArticle->$sOxIdField->value);
00194 
00195             // vendors
00196             $aResetIds['vendor'][$oArticle->$sVendorField->value] = 1;
00197             $aResetIds['manufacturer'][$oArticle->$sManufacturerField->value] = 1;
00198         }
00199 
00200         // vendors
00201         if (isset($aParams[$sVendorField]) && $aParams[$sVendorField] != $oArticle->$sVendorField->value) {
00202             $aResetIds['vendor'][$aParams[$sVendorField]] = 1;
00203             $aResetIds['vendor'][$oArticle->$sVendorField->value] = 1;
00204         }
00205 
00206         // manufacturers
00207         if (isset($aParams[$sManufacturerField]) &&
00208             $aParams[$sManufacturerField] != $oArticle->$sManufacturerField->value) {
00209 
00210             $aResetIds['manufacturer'][$aParams[$sManufacturerField]] = 1;
00211             $aResetIds['manufacturer'][$oArticle->$sManufacturerField->value] = 1;
00212         }
00213 
00214         // resetting counts
00215         $this->_resetCounts($aResetIds);
00216 
00217         $oArticle->setLanguage(0);
00218 
00219         //triming spaces from article title (M:876)
00220         if (isset($aParams['oxarticles__oxtitle'])) {
00221             $aParams['oxarticles__oxtitle'] = trim($aParams['oxarticles__oxtitle']);
00222         }
00223 
00224         $oArticle->assign($aParams);
00225         $oArticle->setArticleLongDesc($this->_processLongDesc($aParams['oxarticles__oxlongdesc']));
00226         $oArticle->setLanguage($this->_iEditLang);
00227         $oArticle = oxRegistry::get("oxUtilsFile")->processFiles($oArticle);
00228         $oArticle->save();
00229 
00230         // set oxid if inserted
00231         if ($soxId == "-1") {
00232             $sFastCat = $oConfig->getRequestParameter("art_category");
00233             if ($sFastCat != "-1") {
00234                 $this->addToCategory($sFastCat, $oArticle->getId());
00235             }
00236         }
00237 
00238         //saving tags
00239         if (isset($aParams['tags'])) {
00240             $sTags = $aParams['tags'];
00241             if (!trim($sTags)) {
00242                 $sTags = $oArticle->oxarticles__oxsearchkeys->value;
00243             }
00244             $aInvalidTags = $this->_setTags($sTags, $oArticle->getId());
00245             if (!empty($aInvalidTags)) {
00246                 $this->_aViewData["invalid_tags"] = implode(', ', $aInvalidTags);
00247             }
00248         }
00249 
00250         $this->setEditObjectId($oArticle->getId());
00251     }
00252 
00260     protected function _processLongDesc($sValue)
00261     {
00262         // TODO: the code below is redundant, optimize it, assignments should go smooth without conversions
00263         // hack, if editor screws up text, htmledit tends to do so
00264         $sValue = str_replace('&amp;nbsp;', '&nbsp;', $sValue);
00265         $sValue = str_replace('&amp;', '&', $sValue);
00266         $sValue = str_replace('&quot;', '"', $sValue);
00267         $sValue = str_replace('&lang=', '&amp;lang=', $sValue);
00268         $sValue = str_replace('<p>&nbsp;</p>', '', $sValue);
00269         $sValue = str_replace('<p>&nbsp; </p>', '', $sValue);
00270 
00271         return $sValue;
00272     }
00273 
00279     protected function _resetCategoriesCounter($sArticleId)
00280     {
00281         $oDb = oxDb::getDb();
00282         $sQ = "select oxcatnid from oxobject2category where oxobjectid = " . $oDb->quote($sArticleId);
00283         $oRs = $oDb->execute($sQ);
00284         if ($oRs !== false && $oRs->recordCount() > 0) {
00285             while (!$oRs->EOF) {
00286                 $this->resetCounter("catArticle", $oRs->fields[0]);
00287                 $oRs->moveNext();
00288             }
00289         }
00290     }
00291 
00300     protected function _setTags($sTags, $sArticleId)
00301     {
00302         $oArticleTagList = oxNew('oxarticletaglist');
00303         $oArticleTagList->loadInLang($this->_iEditLang, $sArticleId);
00304         $oArticleTagList->set($sTags);
00305         $oArticleTagList->save();
00306 
00307         return $oArticleTagList->get()->getInvalidTags();
00308     }
00309 
00316     public function addToCategory($sCatID, $sOXID)
00317     {
00318         $myConfig = $this->getConfig();
00319 
00320         $oNew = oxNew("oxbase");
00321         $oNew->init("oxobject2category");
00322         $oNew->oxobject2category__oxtime = new oxField(0);
00323         $oNew->oxobject2category__oxobjectid = new oxField($sOXID);
00324         $oNew->oxobject2category__oxcatnid = new oxField($sCatID);
00325 
00326         $oNew->save();
00327 
00328         // resetting amount of articles in category
00329         $this->resetCounter("catArticle", $sCatID);
00330     }
00331 
00339     public function copyArticle($sOldId = null, $sNewId = null, $sParentId = null)
00340     {
00341         $myConfig = $this->getConfig();
00342 
00343         $sOldId = $sOldId ? $sOldId : $this->getEditObjectId();
00344         $sNewId = $sNewId ? $sNewId : oxUtilsObject::getInstance()->generateUID();
00345 
00346         $oArticle = oxNew('oxbase');
00347         $oArticle->init('oxarticles');
00348         if ($oArticle->load($sOldId)) {
00349 
00350             if ($myConfig->getConfigParam('blDisableDublArtOnCopy')) {
00351                 $oArticle->oxarticles__oxactive->setValue(0);
00352                 $oArticle->oxarticles__oxactivefrom->setValue(0);
00353                 $oArticle->oxarticles__oxactiveto->setValue(0);
00354             }
00355 
00356             // setting parent id
00357             if ($sParentId) {
00358                 $oArticle->oxarticles__oxparentid->setValue($sParentId);
00359             }
00360 
00361             // setting oxinsert/oxtimestamp
00362             $iNow = date('Y-m-d H:i:s', oxRegistry::get("oxUtilsDate")->getTime());
00363             $oArticle->oxarticles__oxinsert = new oxField($iNow);
00364 
00365             // mantis#0001590: OXRATING and OXRATINGCNT not set to 0 when copying article
00366             $oArticle->oxarticles__oxrating = new oxField(0);
00367             $oArticle->oxarticles__oxratingcnt = new oxField(0);
00368 
00369             $oArticle->setId($sNewId);
00370             $oArticle->save();
00371 
00372             //copy categories
00373             $this->_copyCategories($sOldId, $sNewId);
00374 
00375             //atributes
00376             $this->_copyAttributes($sOldId, $sNewId);
00377 
00378             //sellist
00379             $this->_copySelectlists($sOldId, $sNewId);
00380 
00381             //crossseling
00382             $this->_copyCrossseling($sOldId, $sNewId);
00383 
00384             //accessoire
00385             $this->_copyAccessoires($sOldId, $sNewId);
00386 
00387             // #983A copying staffelpreis info
00388             $this->_copyStaffelpreis($sOldId, $sNewId);
00389 
00390             //copy article extends (longdescription, tags)
00391             $this->_copyArtExtends($sOldId, $sNewId);
00392 
00393             //files
00394             $this->_copyFiles($sOldId, $sNewId);
00395 
00396             // resetting
00397             $aResetIds['vendor'][$oArticle->oxarticles__oxvendorid->value] = 1;
00398             $aResetIds['manufacturer'][$oArticle->oxarticles__oxmanufacturerid->value] = 1;
00399             $this->_resetCounts($aResetIds);
00400 
00401             $this->resetContentCache();
00402 
00403             $myUtilsObject = oxUtilsObject::getInstance();
00404             $oDb = oxDb::getDb();
00405 
00406             //copy variants
00407             $sQ = "select oxid from oxarticles where oxparentid = " . $oDb->quote($sOldId);
00408             $oRs = $oDb->execute($sQ);
00409             if ($oRs !== false && $oRs->recordCount() > 0) {
00410                 while (!$oRs->EOF) {
00411                     $this->copyArticle($oRs->fields[0], $myUtilsObject->generateUid(), $sNewId);
00412                     $oRs->moveNext();
00413                 }
00414             }
00415 
00416             // only for top articles
00417             if (!$sParentId) {
00418 
00419                 $this->setEditObjectId($oArticle->getId());
00420 
00421                 //article number handling, warns for artnum dublicates
00422                 $sFncParameter = oxRegistry::getConfig()->getRequestParameter('fnc');
00423                 $sArtNumField = 'oxarticles__oxartnum';
00424                 if ($myConfig->getConfigParam('blWarnOnSameArtNums') &&
00425                     $oArticle->$sArtNumField->value && $sFncParameter == 'copyArticle'
00426                 ) {
00427                     $sSelect = "select oxid from " . $oArticle->getCoreTableName() .
00428                                " where oxartnum = " . $oDb->quote($oArticle->$sArtNumField->value) .
00429                                " and oxid != " . $oDb->quote($sNewId);
00430 
00431                     if ($oArticle->assignRecord($sSelect)) {
00432                         $this->_aViewData["errorsavingatricle"] = 1;
00433                     }
00434                 }
00435             }
00436         }
00437     }
00438 
00445     protected function _copyCategories($sOldId, $sNewId)
00446     {
00447         $myUtilsObject = oxUtilsObject::getInstance();
00448         $oDb = oxDb::getDb();
00449 
00450         $sO2CView = getViewName('oxobject2category');
00451         $sQ = "select oxcatnid, oxtime from {$sO2CView} where oxobjectid = " . $oDb->quote($sOldId);
00452         $oRs = $oDb->execute($sQ);
00453         if ($oRs !== false && $oRs->recordCount() > 0) {
00454             while (!$oRs->EOF) {
00455                 $sUid = $myUtilsObject->generateUid();
00456                 $sCatId = $oRs->fields[0];
00457                 $sTime = $oRs->fields[1];
00458 
00459 
00460                 $sSql = "insert into oxobject2category (oxid, oxobjectid, oxcatnid, oxtime) " .
00461                         "VALUES (" . $oDb->quote($sUid) . ", " . $oDb->quote($sNewId) . ", " .
00462                         $oDb->quote($sCatId) . ", " . $oDb->quote($sTime) . ") ";
00463                 $oDb->execute($sSql);
00464 
00465                 $oRs->moveNext();
00466 
00467                 // resetting article count in category
00468                 $this->resetCounter("catArticle", $sCatId);
00469             }
00470         }
00471     }
00472 
00479     protected function _copyAttributes($sOldId, $sNewId)
00480     {
00481         $myUtilsObject = oxUtilsObject::getInstance();
00482         $oDb = oxDb::getDb();
00483 
00484         $sQ = "select oxid from oxobject2attribute where oxobjectid = " . $oDb->quote($sOldId);
00485         $oRs = $oDb->execute($sQ);
00486         if ($oRs !== false && $oRs->recordCount() > 0) {
00487             while (!$oRs->EOF) {
00488                 // #1055A
00489                 $oAttr = oxNew("oxbase");
00490                 $oAttr->init("oxobject2attribute");
00491                 $oAttr->load($oRs->fields[0]);
00492                 $oAttr->setId($myUtilsObject->generateUID());
00493                 $oAttr->oxobject2attribute__oxobjectid->setValue($sNewId);
00494                 $oAttr->save();
00495                 $oRs->moveNext();
00496             }
00497         }
00498     }
00499 
00506     protected function _copyFiles($sOldId, $sNewId)
00507     {
00508         $myUtilsObject = oxUtilsObject::getInstance();
00509         $oDb = oxDb::getDb(oxDB::FETCH_MODE_ASSOC);
00510 
00511         $sQ = "SELECT * FROM `oxfiles` WHERE `oxartid` = " . $oDb->quote($sOldId);
00512         $oRs = $oDb->execute($sQ);
00513         if ($oRs !== false && $oRs->recordCount() > 0) {
00514             while (!$oRs->EOF) {
00515 
00516                 $oFile = oxNew("oxfile");
00517                 $oFile->setId($myUtilsObject->generateUID());
00518                 $oFile->oxfiles__oxartid = new oxField($sNewId);
00519                 $oFile->oxfiles__oxfilename = new oxField($oRs->fields['OXFILENAME']);
00520                 $oFile->oxfiles__oxfilesize = new oxField($oRs->fields['OXFILESIZE']);
00521                 $oFile->oxfiles__oxstorehash = new oxField($oRs->fields['OXSTOREHASH']);
00522                 $oFile->oxfiles__oxpurchasedonly = new oxField($oRs->fields['OXPURCHASEDONLY']);
00523                 $oFile->save();
00524                 $oRs->moveNext();
00525             }
00526         }
00527     }
00528 
00535     protected function _copySelectlists($sOldId, $sNewId)
00536     {
00537         $myUtilsObject = oxUtilsObject::getInstance();
00538         $oDb = oxDb::getDb();
00539 
00540         $sQ = "select oxselnid from oxobject2selectlist where oxobjectid = " . $oDb->quote($sOldId);
00541         $oRs = $oDb->execute($sQ);
00542         if ($oRs !== false && $oRs->recordCount() > 0) {
00543             while (!$oRs->EOF) {
00544                 $sUid = $myUtilsObject->generateUID();
00545                 $sId = $oRs->fields[0];
00546                 $sSql = "insert into oxobject2selectlist (oxid, oxobjectid, oxselnid) " .
00547                         "VALUES (" . $oDb->quote($sUid) . ", " . $oDb->quote($sNewId) . ", " . $oDb->quote($sId) . ") ";
00548                 $oDb->execute($sSql);
00549                 $oRs->moveNext();
00550             }
00551         }
00552     }
00553 
00560     protected function _copyCrossseling($sOldId, $sNewId)
00561     {
00562         $myUtilsObject = oxUtilsObject::getInstance();
00563         $oDb = oxDb::getDb();
00564 
00565         $sQ = "select oxobjectid from oxobject2article where oxarticlenid = " . $oDb->quote($sOldId);
00566         $oRs = $oDb->execute($sQ);
00567         if ($oRs !== false && $oRs->recordCount() > 0) {
00568             while (!$oRs->EOF) {
00569                 $sUid = $myUtilsObject->generateUID();
00570                 $sId = $oRs->fields[0];
00571                 $sSql = "insert into oxobject2article (oxid, oxobjectid, oxarticlenid) " .
00572                        "VALUES (" . $oDb->quote($sUid) . ", " . $oDb->quote($sId) . ", " . $oDb->quote($sNewId) . " ) ";
00573                 $oDb->execute($sSql);
00574                 $oRs->moveNext();
00575             }
00576         }
00577     }
00578 
00585     protected function _copyAccessoires($sOldId, $sNewId)
00586     {
00587         $myUtilsObject = oxUtilsObject::getInstance();
00588         $oDb = oxDb::getDb();
00589 
00590         $sQ = "select oxobjectid from oxaccessoire2article where oxarticlenid= " . $oDb->quote($sOldId);
00591         $oRs = $oDb->execute($sQ);
00592         if ($oRs !== false && $oRs->recordCount() > 0) {
00593             while (!$oRs->EOF) {
00594                 $sUId = $myUtilsObject->generateUid();
00595                 $sId = $oRs->fields[0];
00596                 $sSql = "insert into oxaccessoire2article (oxid, oxobjectid, oxarticlenid) " .
00597                         "VALUES (" . $oDb->quote($sUId) . ", " . $oDb->quote($sId) . ", " . $oDb->quote($sNewId) . ") ";
00598                 $oDb->execute($sSql);
00599                 $oRs->moveNext();
00600             }
00601         }
00602     }
00603 
00610     protected function _copyStaffelpreis($sOldId, $sNewId)
00611     {
00612         $sShopId = $this->getConfig()->getShopId();
00613         $oPriceList = oxNew("oxlist");
00614         $oPriceList->init("oxbase", "oxprice2article");
00615         $sQ = "select * from oxprice2article where oxartid = '{$sOldId}' and oxshopid = '{$sShopId}' " .
00616               "and (oxamount > 0 or oxamountto > 0) order by oxamount ";
00617         $oPriceList->selectString($sQ);
00618         if ($oPriceList->count()) {
00619             foreach ($oPriceList as $oItem) {
00620                 $oItem->oxprice2article__oxid->setValue($oItem->setId());
00621                 $oItem->oxprice2article__oxartid->setValue($sNewId);
00622                 $oItem->save();
00623             }
00624         }
00625     }
00626 
00633     protected function _copyArtExtends($sOldId, $sNewId)
00634     {
00635         $oExt = oxNew("oxbase");
00636         $oExt->init("oxartextends");
00637         $oExt->load($sOldId);
00638         $oExt->setId($sNewId);
00639         $oExt->save();
00640     }
00641 
00642 
00646     public function saveinnlang()
00647     {
00648         $this->save();
00649     }
00650 
00659     public function addDefaultValues($aParams)
00660     {
00661         return $aParams;
00662     }
00663 
00670     protected function _formJumpList($oArticle, $oParentArticle)
00671     {
00672         $aJumpList = array();
00673         //fetching parent article variants
00674         $sOxIdField = 'oxarticles__oxid';
00675         if (isset($oParentArticle)) {
00676             $aJumpList[] = array($oParentArticle->$sOxIdField->value, $this->_getTitle($oParentArticle));
00677             $sEditLanguageParameter = oxRegistry::getConfig()->getRequestParameter("editlanguage");
00678             $oParentVariants = $oParentArticle->getAdminVariants($sEditLanguageParameter);
00679             if ($oParentVariants->count()) {
00680                 foreach ($oParentVariants as $oVar) {
00681                     $aJumpList[] = array($oVar->$sOxIdField->value, " - " . $this->_getTitle($oVar));
00682                     if ($oVar->$sOxIdField->value == $oArticle->$sOxIdField->value) {
00683                         $oVariants = $oArticle->getAdminVariants($sEditLanguageParameter);
00684                         if ($oVariants->count()) {
00685                             foreach ($oVariants as $oVVar) {
00686                                 $aJumpList[] = array($oVVar->$sOxIdField->value, " -- " . $this->_getTitle($oVVar));
00687                             }
00688                         }
00689                     }
00690                 }
00691             }
00692         } else {
00693             $aJumpList[] = array($oArticle->$sOxIdField->value, $this->_getTitle($oArticle));
00694             //fetching this article variants data
00695             $oVariants = $oArticle->getAdminVariants(oxRegistry::getConfig()->getRequestParameter("editlanguage"));
00696             if ($oVariants && $oVariants->count()) {
00697                 foreach ($oVariants as $oVar) {
00698                     $aJumpList[] = array($oVar->$sOxIdField->value, " - " . $this->_getTitle($oVar));
00699                 }
00700             }
00701         }
00702         if (count($aJumpList) > 1) {
00703             $this->_aViewData["thisvariantlist"] = $aJumpList;
00704         }
00705     }
00706 
00714     protected function _getTitle($oObj)
00715     {
00716         $sTitle = $oObj->oxarticles__oxtitle->value;
00717         if (!strlen($sTitle)) {
00718             $sTitle = $oObj->oxarticles__oxvarselect->value;
00719         }
00720 
00721         return $sTitle;
00722     }
00723 
00729     public function getCategoryList()
00730     {
00731         $oCatTree = oxNew("oxCategoryList");
00732         $oCatTree->loadList();
00733 
00734         return $oCatTree;
00735     }
00736 
00742     public function getVendorList()
00743     {
00744         $oVendorlist = oxNew("oxvendorlist");
00745         $oVendorlist->loadVendorList();
00746 
00747         return $oVendorlist;
00748     }
00749 
00755     public function getManufacturerList()
00756     {
00757         $oManufacturerList = oxNew("oxmanufacturerlist");
00758         $oManufacturerList->loadManufacturerList();
00759 
00760         return $oManufacturerList;
00761     }
00762 }