29 $sSLViewName = getViewName(
'oxselectlist');
32 $oAllSel =
oxNew(
"oxlist");
33 $oAllSel->init(
"oxselectlist");
34 $sQ =
"select * from $sSLViewName";
35 $oAllSel->selectString($sQ);
36 $this->_aViewData[
"allsel"] = $oAllSel;
38 $oArticle =
oxNew(
"oxarticle");
39 $this->_aViewData[
"edit"] = $oArticle;
41 if ($soxId !=
"-1" && isset($soxId)) {
43 $oArticle->loadInLang($this->_iEditLang, $soxId);
47 $oVariants = $oArticle->getAdminVariants($this->_iEditLang);
49 $this->_aViewData[
"mylist"] = $oVariants;
52 $oOtherLang = $oArticle->getAvailableInLangs();
53 if (!isset($oOtherLang[$this->_iEditLang])) {
55 $oArticle->loadInLang(key($oOtherLang), $soxId);
58 foreach ($oOtherLang as $id => $language) {
59 $oLang =
new stdClass();
60 $oLang->sLangDesc = $language;
62 $this->_aViewData[
"otherlang"][$id] = clone $oLang;
65 if ($oArticle->oxarticles__oxparentid->value) {
66 $this->_aViewData[
"parentarticle"] = $this->
_getProductParent($oArticle->oxarticles__oxparentid->value);
67 $this->_aViewData[
"oxparentid"] = $oArticle->oxarticles__oxparentid->value;
68 $this->_aViewData[
"issubvariant"] = 1;
70 $this->_aViewData[
"readonly"] = 1;
76 $this->_aViewData[
"posslang"] =
$aLang;
79 foreach ($oOtherLang as $id => $language) {
80 $oLang =
new stdClass();
81 $oLang->sLangDesc = $language;
83 $this->_aViewData[
"otherlang"][$id] = $oLang;
87 return "article_variant.tpl";
98 public function savevariant($sOXID = null, $aParams = null)
100 if (!isset($sOXID) && !isset($aParams)) {
110 if (isset($soxparentId) && $soxparentId && $soxparentId !=
"-1") {
111 $aParams[
'oxarticles__oxparentid'] = $soxparentId;
113 unset($aParams[
'oxarticles__oxparentid']);
116 $oArticle =
oxNew(
"oxarticle");
118 if ($sOXID !=
"-1") {
119 $oArticle->loadInLang($this->_iEditLang, $sOXID);
123 if (is_array($aParams) && !isset($aParams[
'oxarticles__oxactive'])) {
124 $aParams[
'oxarticles__oxactive'] = 0;
131 $oArticle->setLanguage(0);
132 $oArticle->assign($aParams);
133 $oArticle->setLanguage($this->_iEditLang);
136 $oArticle->resetRemindStatus();
138 if ($sOXID ==
"-1") {
139 if ($oParent = $this->
_getProductParent($oArticle->oxarticles__oxparentid->value)) {
143 $oArticle->oxarticles__oxisconfigurable =
new oxField($oParent->oxarticles__oxisconfigurable->value);
144 $oArticle->oxarticles__oxremindactive =
new oxField($oParent->oxarticles__oxremindactive->value);
161 if (!is_array($aData)) {
164 foreach ($aData as $sKey => $sValue) {
165 if (isset($oProduct->$sKey) && $oProduct->$sKey->value != $aData[$sKey]) {
182 if ($this->_oProductParent === null ||
183 ($this->_oProductParent !==
false && $this->_oProductParent->getId() != $sParentId)
185 $this->_oProductParent =
false;
186 $oProduct =
oxNew(
"oxarticle");
187 if ($oProduct->load($sParentId)) {
188 $this->_oProductParent = $oProduct;
202 if (is_array($aParams)) {
203 foreach ($aParams as $soxId => $aVarParams) {
204 $this->savevariant($soxId, $aVarParams);
222 $oDelete =
oxNew(
"oxarticle");
223 $oDelete->delete($soxId);
239 $oArticle =
oxNew(
"oxarticle");
240 if ($soxId !=
"-1") {
241 $oArticle->loadInLang($this->_iEditLang, $soxId);
244 $oArticle->setLanguage(0);
245 $oArticle->assign($aParams);
246 $oArticle->setLanguage($this->_iEditLang);
258 $oArticle =
oxNew(
"oxarticle");
261 if ($oArticle->load($this->getEditObjectId())) {
267 $oVariantHandler =
oxNew(
"oxVariantHandler");
268 $oVariantHandler->genVariantFromSell($aSels, $oArticle);