30 $this->_aViewData[
'edit'] = $oArticle =
oxNew(
'oxArticle');
37 if ($soxId !=
"-1" && isset($soxId)) {
39 $oArticle->loadInLang($this->_iEditLang, $soxId);
43 $oOtherLang = $oArticle->getAvailableInLangs();
44 if (!isset($oOtherLang[$this->_iEditLang])) {
45 $oArticle->loadInLang(key($oOtherLang), $soxId);
48 foreach ($oOtherLang as $id => $language) {
49 $oLang =
new stdClass();
50 $oLang->sLangDesc = $language;
52 $this->_aViewData[
"otherlang"][$id] = clone $oLang;
56 if ($oArticle->oxarticles__oxparentid->value) {
57 $oParentArticle =
oxNew(
'oxArticle');
58 $oParentArticle->load($oArticle->oxarticles__oxparentid->value);
59 $this->_aViewData[
"parentarticle"] = $oParentArticle;
60 $this->_aViewData[
"oxparentid"] = $oArticle->oxarticles__oxparentid->value;
68 $sArticleTable = getViewName(
'oxarticles', $this->_iEditLang);
69 $sSelect =
"select {$sArticleTable}.oxtitle, {$sArticleTable}.oxartnum, {$sArticleTable}.oxvarselect " .
70 "from {$sArticleTable} where 1 ";
72 $blVariantsSelectionParameter =
$myConfig->getConfigParam(
'blVariantsSelection');
73 $sBundleIdField =
'oxarticles__oxbundleid';
74 $sSelect .= $blVariantsSelectionParameter ?
'' :
" and {$sArticleTable}.oxparentid = '' ";
75 $sSelect .=
" and {$sArticleTable}.oxid = " . $oDB->quote($oArticle->$sBundleIdField->value);
77 $rs = $oDB->Execute($sSelect);
78 if ($rs !=
false && $rs->RecordCount() > 0) {
80 $sArtNum =
new oxField($rs->fields[1]);
81 $sArtTitle =
new oxField($rs->fields[0] .
" " . $rs->fields[2]);
85 $this->_aViewData[
'bundle_artnum'] = $sArtNum;
86 $this->_aViewData[
'bundle_title'] = $sArtTitle;
89 $iAoc = $this->
getConfig()->getRequestParameter(
"aoc");
91 $oArticleExtendAjax =
oxNew(
'article_extend_ajax');
92 $this->_aViewData[
'oxajax'] = $oArticleExtendAjax->getColumns();
94 return "popups/article_extend.tpl";
95 } elseif ($iAoc == 2) {
96 $oArticleBundleAjax =
oxNew(
'article_bundle_ajax');
97 $this->_aViewData[
'oxajax'] = $oArticleBundleAjax->getColumns();
99 return "popups/article_bundle.tpl";
103 $this->_aViewData[
'aMediaUrls'] = $oArticle->getMediaUrls();
105 return "article_extend.tpl";
117 $aMyFile = $this->
getConfig()->getUploadedFile(
"myfile");
118 $aMediaFile = $this->
getConfig()->getUploadedFile(
"mediaFile");
119 if (is_array($aMyFile[
'name']) && reset($aMyFile[
'name']) || $aMediaFile[
'name']) {
122 $oEx =
oxNew(
"oxExceptionToDisplay");
123 $oEx->setMessage(
'ARTICLE_EXTEND_UPLOADISDISABLED');
133 if (!isset($aParams[
'oxarticles__oxissearch'])) {
134 $aParams[
'oxarticles__oxissearch'] = 0;
136 if (!isset($aParams[
'oxarticles__oxblfixedprice'])) {
137 $aParams[
'oxarticles__oxblfixedprice'] = 0;
147 $oArticle =
oxNew(
"oxarticle");
148 $oArticle->loadInLang($this->_iEditLang, $soxId);
149 $sTPriceField =
'oxarticles__oxtprice';
150 $sPriceField =
'oxarticles__oxprice';
151 $dTPrice = $aParams[
'oxarticles__oxtprice'];
152 if ($dTPrice && $dTPrice != $oArticle->$sTPriceField->value && $dTPrice <= $oArticle->$sPriceField->value) {
153 $this->_aViewData[
"errorsavingtprice"] = 1;
156 $oArticle->setLanguage(0);
157 $oArticle->assign($aParams);
158 $oArticle->setLanguage($this->_iEditLang);
163 $sMediaUrl = $this->
getConfig()->getRequestParameter(
"mediaUrl");
164 $sMediaDesc = $this->
getConfig()->getRequestParameter(
"mediaDesc");
166 if (($sMediaUrl && $sMediaUrl !=
'http://') || $aMediaFile[
'name'] || $sMediaDesc) {
169 return oxRegistry::get(
"oxUtilsView")->addErrorToDisplay(
'EXCEPTION_NODESCRIPTIONADDED');
172 if ((!$sMediaUrl || $sMediaUrl ==
'http://') && !$aMediaFile[
'name']) {
173 return oxRegistry::get(
"oxUtilsView")->addErrorToDisplay(
'EXCEPTION_NOMEDIAADDED');
176 $oMediaUrl =
oxNew(
"oxMediaUrl");
177 $oMediaUrl->setLanguage($this->_iEditLang);
181 if ($aMediaFile[
'name']) {
183 $sMediaUrl =
oxRegistry::get(
"oxUtilsFile")->processFile(
'mediaFile',
'out/media/');
186 return oxRegistry::get(
"oxUtilsView")->addErrorToDisplay($e->getMessage());
198 oxNew(
"oxArticleList")->renewPriceUpdateTime();
207 $sMediaId = $this->
getConfig()->getRequestParameter(
"mediaid");
208 if ($sMediaId && $soxId) {
209 $oMediaUrl =
oxNew(
"oxMediaUrl");
210 $oMediaUrl->load($sMediaId);
211 $oMediaUrl->delete();
225 $aParams[
'oxarticles__oxexturl'] = str_replace(
"http://",
"", $aParams[
'oxarticles__oxexturl']);
235 $aMediaUrls = $this->
getConfig()->getRequestParameter(
'aMediaUrls');
236 if (is_array($aMediaUrls)) {
237 foreach ($aMediaUrls as $sMediaId => $aMediaParams) {
238 $oMedia =
oxNew(
"oxMediaUrl");
239 if ($oMedia->load($sMediaId)) {
240 $oMedia->setLanguage(0);
241 $oMedia->assign($aMediaParams);
242 $oMedia->setLanguage($this->_iEditLang);
256 if ($this->_aUnitsArray === null) {
257 $this->_aUnitsArray =
oxRegistry::getLang()->getSimilarByKey(
"_UNIT_", $this->_iEditLang,
false);