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 
00402             $myUtilsObject = oxUtilsObject::getInstance();
00403             $oDb = oxDb::getDb();
00404 
00405             //copy variants
00406             $sQ = "select oxid from oxarticles where oxparentid = " . $oDb->quote($sOldId);
00407             $oRs = $oDb->execute($sQ);
00408             if ($oRs !== false && $oRs->recordCount() > 0) {
00409                 while (!$oRs->EOF) {
00410                     $this->copyArticle($oRs->fields[0], $myUtilsObject->generateUid(), $sNewId);
00411                     $oRs->moveNext();
00412                 }
00413             }
00414 
00415             // only for top articles
00416             if (!$sParentId) {
00417 
00418                 $this->setEditObjectId($oArticle->getId());
00419 
00420                 //article number handling, warns for artnum dublicates
00421                 $sFncParameter = oxRegistry::getConfig()->getRequestParameter('fnc');
00422                 $sArtNumField = 'oxarticles__oxartnum';
00423                 if ($myConfig->getConfigParam('blWarnOnSameArtNums') &&
00424                     $oArticle->$sArtNumField->value && $sFncParameter == 'copyArticle'
00425                 ) {
00426                     $sSelect = "select oxid from " . $oArticle->getCoreTableName() .
00427                                " where oxartnum = " . $oDb->quote($oArticle->$sArtNumField->value) .
00428                                " and oxid != " . $oDb->quote($sNewId);
00429 
00430                     if ($oArticle->assignRecord($sSelect)) {
00431                         $this->_aViewData["errorsavingatricle"] = 1;
00432                     }
00433                 }
00434             }
00435         }
00436     }
00437 
00444     protected function _copyCategories($sOldId, $sNewId)
00445     {
00446         $myUtilsObject = oxUtilsObject::getInstance();
00447         $oDb = oxDb::getDb();
00448 
00449         $sO2CView = getViewName('oxobject2category');
00450         $sQ = "select oxcatnid, oxtime from {$sO2CView} where oxobjectid = " . $oDb->quote($sOldId);
00451         $oRs = $oDb->execute($sQ);
00452         if ($oRs !== false && $oRs->recordCount() > 0) {
00453             while (!$oRs->EOF) {
00454                 $sUid = $myUtilsObject->generateUid();
00455                 $sCatId = $oRs->fields[0];
00456                 $sTime = $oRs->fields[1];
00457 
00458 
00459                 $sSql = "insert into oxobject2category (oxid, oxobjectid, oxcatnid, oxtime) " .
00460                         "VALUES (" . $oDb->quote($sUid) . ", " . $oDb->quote($sNewId) . ", " .
00461                         $oDb->quote($sCatId) . ", " . $oDb->quote($sTime) . ") ";
00462                 $oDb->execute($sSql);
00463 
00464                 $oRs->moveNext();
00465 
00466                 // resetting article count in category
00467                 $this->resetCounter("catArticle", $sCatId);
00468             }
00469         }
00470     }
00471 
00478     protected function _copyAttributes($sOldId, $sNewId)
00479     {
00480         $myUtilsObject = oxUtilsObject::getInstance();
00481         $oDb = oxDb::getDb();
00482 
00483         $sQ = "select oxid from oxobject2attribute where oxobjectid = " . $oDb->quote($sOldId);
00484         $oRs = $oDb->execute($sQ);
00485         if ($oRs !== false && $oRs->recordCount() > 0) {
00486             while (!$oRs->EOF) {
00487                 // #1055A
00488                 $oAttr = oxNew("oxbase");
00489                 $oAttr->init("oxobject2attribute");
00490                 $oAttr->load($oRs->fields[0]);
00491                 $oAttr->setId($myUtilsObject->generateUID());
00492                 $oAttr->oxobject2attribute__oxobjectid->setValue($sNewId);
00493                 $oAttr->save();
00494                 $oRs->moveNext();
00495             }
00496         }
00497     }
00498 
00505     protected function _copyFiles($sOldId, $sNewId)
00506     {
00507         $myUtilsObject = oxUtilsObject::getInstance();
00508         $oDb = oxDb::getDb(oxDB::FETCH_MODE_ASSOC);
00509 
00510         $sQ = "SELECT * FROM `oxfiles` WHERE `oxartid` = " . $oDb->quote($sOldId);
00511         $oRs = $oDb->execute($sQ);
00512         if ($oRs !== false && $oRs->recordCount() > 0) {
00513             while (!$oRs->EOF) {
00514 
00515                 $oFile = oxNew("oxfile");
00516                 $oFile->setId($myUtilsObject->generateUID());
00517                 $oFile->oxfiles__oxartid = new oxField($sNewId);
00518                 $oFile->oxfiles__oxfilename = new oxField($oRs->fields['OXFILENAME']);
00519                 $oFile->oxfiles__oxfilesize = new oxField($oRs->fields['OXFILESIZE']);
00520                 $oFile->oxfiles__oxstorehash = new oxField($oRs->fields['OXSTOREHASH']);
00521                 $oFile->oxfiles__oxpurchasedonly = new oxField($oRs->fields['OXPURCHASEDONLY']);
00522                 $oFile->save();
00523                 $oRs->moveNext();
00524             }
00525         }
00526     }
00527 
00534     protected function _copySelectlists($sOldId, $sNewId)
00535     {
00536         $myUtilsObject = oxUtilsObject::getInstance();
00537         $oDb = oxDb::getDb();
00538 
00539         $sQ = "select oxselnid from oxobject2selectlist where oxobjectid = " . $oDb->quote($sOldId);
00540         $oRs = $oDb->execute($sQ);
00541         if ($oRs !== false && $oRs->recordCount() > 0) {
00542             while (!$oRs->EOF) {
00543                 $sUid = $myUtilsObject->generateUID();
00544                 $sId = $oRs->fields[0];
00545                 $sSql = "insert into oxobject2selectlist (oxid, oxobjectid, oxselnid) " .
00546                         "VALUES (" . $oDb->quote($sUid) . ", " . $oDb->quote($sNewId) . ", " . $oDb->quote($sId) . ") ";
00547                 $oDb->execute($sSql);
00548                 $oRs->moveNext();
00549             }
00550         }
00551     }
00552 
00559     protected function _copyCrossseling($sOldId, $sNewId)
00560     {
00561         $myUtilsObject = oxUtilsObject::getInstance();
00562         $oDb = oxDb::getDb();
00563 
00564         $sQ = "select oxobjectid from oxobject2article where oxarticlenid = " . $oDb->quote($sOldId);
00565         $oRs = $oDb->execute($sQ);
00566         if ($oRs !== false && $oRs->recordCount() > 0) {
00567             while (!$oRs->EOF) {
00568                 $sUid = $myUtilsObject->generateUID();
00569                 $sId = $oRs->fields[0];
00570                 $sSql = "insert into oxobject2article (oxid, oxobjectid, oxarticlenid) " .
00571                        "VALUES (" . $oDb->quote($sUid) . ", " . $oDb->quote($sId) . ", " . $oDb->quote($sNewId) . " ) ";
00572                 $oDb->execute($sSql);
00573                 $oRs->moveNext();
00574             }
00575         }
00576     }
00577 
00584     protected function _copyAccessoires($sOldId, $sNewId)
00585     {
00586         $myUtilsObject = oxUtilsObject::getInstance();
00587         $oDb = oxDb::getDb();
00588 
00589         $sQ = "select oxobjectid from oxaccessoire2article where oxarticlenid= " . $oDb->quote($sOldId);
00590         $oRs = $oDb->execute($sQ);
00591         if ($oRs !== false && $oRs->recordCount() > 0) {
00592             while (!$oRs->EOF) {
00593                 $sUId = $myUtilsObject->generateUid();
00594                 $sId = $oRs->fields[0];
00595                 $sSql = "insert into oxaccessoire2article (oxid, oxobjectid, oxarticlenid) " .
00596                         "VALUES (" . $oDb->quote($sUId) . ", " . $oDb->quote($sId) . ", " . $oDb->quote($sNewId) . ") ";
00597                 $oDb->execute($sSql);
00598                 $oRs->moveNext();
00599             }
00600         }
00601     }
00602 
00609     protected function _copyStaffelpreis($sOldId, $sNewId)
00610     {
00611         $sShopId = $this->getConfig()->getShopId();
00612         $oPriceList = oxNew("oxlist");
00613         $oPriceList->init("oxbase", "oxprice2article");
00614         $sQ = "select * from oxprice2article where oxartid = '{$sOldId}' and oxshopid = '{$sShopId}' " .
00615               "and (oxamount > 0 or oxamountto > 0) order by oxamount ";
00616         $oPriceList->selectString($sQ);
00617         if ($oPriceList->count()) {
00618             foreach ($oPriceList as $oItem) {
00619                 $oItem->oxprice2article__oxid->setValue($oItem->setId());
00620                 $oItem->oxprice2article__oxartid->setValue($sNewId);
00621                 $oItem->save();
00622             }
00623         }
00624     }
00625 
00632     protected function _copyArtExtends($sOldId, $sNewId)
00633     {
00634         $oExt = oxNew("oxbase");
00635         $oExt->init("oxartextends");
00636         $oExt->load($sOldId);
00637         $oExt->setId($sNewId);
00638         $oExt->save();
00639     }
00640 
00641 
00645     public function saveinnlang()
00646     {
00647         $this->save();
00648     }
00649 
00658     public function addDefaultValues($aParams)
00659     {
00660         return $aParams;
00661     }
00662 
00669     protected function _formJumpList($oArticle, $oParentArticle)
00670     {
00671         $aJumpList = array();
00672         //fetching parent article variants
00673         $sOxIdField = 'oxarticles__oxid';
00674         if (isset($oParentArticle)) {
00675             $aJumpList[] = array($oParentArticle->$sOxIdField->value, $this->_getTitle($oParentArticle));
00676             $sEditLanguageParameter = oxRegistry::getConfig()->getRequestParameter("editlanguage");
00677             $oParentVariants = $oParentArticle->getAdminVariants($sEditLanguageParameter);
00678             if ($oParentVariants->count()) {
00679                 foreach ($oParentVariants as $oVar) {
00680                     $aJumpList[] = array($oVar->$sOxIdField->value, " - " . $this->_getTitle($oVar));
00681                     if ($oVar->$sOxIdField->value == $oArticle->$sOxIdField->value) {
00682                         $oVariants = $oArticle->getAdminVariants($sEditLanguageParameter);
00683                         if ($oVariants->count()) {
00684                             foreach ($oVariants as $oVVar) {
00685                                 $aJumpList[] = array($oVVar->$sOxIdField->value, " -- " . $this->_getTitle($oVVar));
00686                             }
00687                         }
00688                     }
00689                 }
00690             }
00691         } else {
00692             $aJumpList[] = array($oArticle->$sOxIdField->value, $this->_getTitle($oArticle));
00693             //fetching this article variants data
00694             $oVariants = $oArticle->getAdminVariants(oxRegistry::getConfig()->getRequestParameter("editlanguage"));
00695             if ($oVariants && $oVariants->count()) {
00696                 foreach ($oVariants as $oVar) {
00697                     $aJumpList[] = array($oVar->$sOxIdField->value, " - " . $this->_getTitle($oVar));
00698                 }
00699             }
00700         }
00701         if (count($aJumpList) > 1) {
00702             $this->_aViewData["thisvariantlist"] = $aJumpList;
00703         }
00704     }
00705 
00713     protected function _getTitle($oObj)
00714     {
00715         $sTitle = $oObj->oxarticles__oxtitle->value;
00716         if (!strlen($sTitle)) {
00717             $sTitle = $oObj->oxarticles__oxvarselect->value;
00718         }
00719 
00720         return $sTitle;
00721     }
00722 
00728     public function getCategoryList()
00729     {
00730         $oCatTree = oxNew("oxCategoryList");
00731         $oCatTree->loadList();
00732 
00733         return $oCatTree;
00734     }
00735 
00741     public function getVendorList()
00742     {
00743         $oVendorlist = oxNew("oxvendorlist");
00744         $oVendorlist->loadVendorList();
00745 
00746         return $oVendorlist;
00747     }
00748 
00754     public function getManufacturerList()
00755     {
00756         $oManufacturerList = oxNew("oxmanufacturerlist");
00757         $oManufacturerList->loadManufacturerList();
00758 
00759         return $oManufacturerList;
00760     }
00761 }