28 $sSLViewName = getViewName(
'oxselectlist');
31 $oAllSel =
oxNew(
"oxlist");
32 $oAllSel->init(
"oxselectlist");
33 $sQ =
"select * from $sSLViewName";
34 $oAllSel->selectString( $sQ);
35 $this->_aViewData[
"allsel"] = $oAllSel;
37 $oArticle =
oxNew(
"oxarticle");
38 $this->_aViewData[
"edit"] = $oArticle;
40 if ( $soxId !=
"-1" && isset( $soxId)) {
42 $oArticle->loadInLang( $this->_iEditLang, $soxId );
46 $oVariants = $oArticle->getAdminVariants( $this->_iEditLang);
48 $this->_aViewData[
"mylist"] = $oVariants;
51 $oOtherLang = $oArticle->getAvailableInLangs();
52 if (!isset($oOtherLang[ $this->_iEditLang])) {
54 $oArticle->loadInLang( key($oOtherLang), $soxId );
57 foreach ( $oOtherLang as $id => $language) {
58 $oLang=
new stdClass();
59 $oLang->sLangDesc = $language;
61 $this->_aViewData[
"otherlang"][$id] = clone $oLang;
64 if ( $oArticle->oxarticles__oxparentid->value) {
65 $this->_aViewData[
"parentarticle"] = $this->
_getProductParent( $oArticle->oxarticles__oxparentid->value );
66 $this->_aViewData[
"oxparentid"] = $oArticle->oxarticles__oxparentid->value;
67 $this->_aViewData[
"issubvariant"] = 1;
69 $this->_aViewData[
"readonly"] = 1;
75 $this->_aViewData[
"posslang"] =
$aLang;
77 foreach ( $oOtherLang as $id => $language) {
78 $oLang=
new stdClass();
79 $oLang->sLangDesc = $language;
81 $this->_aViewData[
"otherlang"][$id] = $oLang;
85 return "article_variant.tpl";
98 if ( !isset( $sOXID ) && !isset( $aParams ) ) {
104 if ( !isset( $aParams[
'oxarticles__oxactive'] ) ) {
105 $aParams[
'oxarticles__oxactive'] = 0;
113 if ( isset( $soxparentId) && $soxparentId && $soxparentId !=
"-1" ) {
114 $aParams[
'oxarticles__oxparentid'] = $soxparentId;
116 unset( $aParams[
'oxarticles__oxparentid'] );
119 $oArticle =
oxNew(
"oxarticle");
132 if ( $sOXID !=
"-1" ) {
133 $oArticle->loadInLang( $this->_iEditLang, $sOXID );
136 $oArticle->setLanguage( 0 );
137 $oArticle->assign( $aParams );
138 $oArticle->setLanguage( $this->_iEditLang );
141 $oArticle->resetRemindStatus();
143 if ( $sOXID ==
"-1" ) {
144 if ( $oParent = $this->
_getProductParent( $oArticle->oxarticles__oxparentid->value ) ) {
148 $oArticle->oxarticles__oxisconfigurable =
new oxField( $oParent->oxarticles__oxisconfigurable->value );
149 $oArticle->oxarticles__oxremindactive =
new oxField( $oParent->oxarticles__oxremindactive->value );
166 if ( $this->_oProductParent === null ||
167 ( $this->_oProductParent !==
false && $this->_oProductParent->getId() != $sParentId ) ) {
168 $this->_oProductParent =
false;
169 $oProduct =
oxNew(
"oxarticle" );
170 if ( $oProduct->load( $sParentId ) ) {
171 $this->_oProductParent = $oProduct;
186 if ( is_array( $aParams ) ) {
187 foreach ( $aParams as $soxId => $aVarParams ) {
204 $oDelete =
oxNew(
"oxarticle" );
205 $oDelete->delete( $soxId );
222 $oArticle =
oxNew(
"oxarticle" );
223 if ( $soxId !=
"-1") {
224 $oArticle->loadInLang( $this->_iEditLang, $soxId );
227 $oArticle->setLanguage( 0 );
228 $oArticle->assign( $aParams);
229 $oArticle->setLanguage( $this->_iEditLang );
241 $oArticle =
oxNew(
"oxarticle");
244 if ( $oArticle->load( $this->getEditObjectId() ) ) {
249 $oVariantHandler =
oxNew(
"oxVariantHandler" );
250 $oVariantHandler->genVariantFromSell( $aSels, $oArticle );