22 if ( $sOxId !=
"-1" && isset( $sOxId)) {
24 $oDiscount =
oxNew(
"oxdiscount" );
25 $oDiscount->loadInLang( $this->_iEditLang, $sOxId );
27 $oOtherLang = $oDiscount->getAvailableInLangs();
28 if (!isset($oOtherLang[$this->_iEditLang])) {
30 $oDiscount->loadInLang( key( $oOtherLang ), $sOxId );
33 $this->_aViewData[
"edit"] = $oDiscount;
40 $this->_aViewData[
"posslang"] =
$aLang;
43 foreach ( $oOtherLang as $id => $language) {
44 $oLang=
new stdClass();
45 $oLang->sLangDesc = $language;
47 $this->_aViewData[
"otherlang"][$id] = clone $oLang;
53 $oDiscountMainAjax =
oxNew(
'discount_main_ajax' );
54 $this->_aViewData[
'oxajax'] = $oDiscountMainAjax->getColumns();
56 return "popups/discount_main.tpl";
57 } elseif ( $iAoc ==
"2" ) {
61 $oDiscountItemAjax =
oxNew(
'discount_item_ajax' );
62 $this->_aViewData[
'oxajax'] = $oDiscountItemAjax->getColumns();
64 return "popups/discount_item.tpl";
67 return "discount_main.tpl";
79 if ( $sOxId !=
"-1" && isset( $sOxId)) {
80 $sViewName = getViewName(
"oxarticles", $this->_iEditLang );
82 $sQ =
"select concat( $sViewName.oxartnum, ' ', $sViewName.oxtitle ) from oxdiscount
83 left join $sViewName on $sViewName.oxid=oxdiscount.oxitmartid
84 where oxdiscount.oxitmartid != '' and oxdiscount.oxid=" . $oDb->quote( $sOxId );
85 $sTitle = $oDb->getOne( $sQ,
false,
false );
88 return $sTitle ? $sTitle :
" -- ";
105 $aParams[
'oxdiscount__oxshopid'] = $sShopID;
107 $oAttr =
oxNew(
"oxdiscount" );
108 if ( $sOxId !=
"-1") {
109 $oAttr->load( $sOxId );
111 $aParams[
'oxdiscount__oxid'] = null;
115 if ( !isset( $aParams[
'oxdiscount__oxactive'])) {
116 $aParams[
'oxdiscount__oxactive'] = 0;
121 $oAttr->setLanguage(0);
122 $oAttr->assign( $aParams );
123 $oAttr->setLanguage($this->_iEditLang);
145 $aParams[
'oxdiscount__oxshopid'] = $sShopID;
146 $oAttr =
oxNew(
"oxdiscount" );
148 $oAttr->load( $sOxId);
150 $aParams[
'oxdiscount__oxid'] = null;
152 if ( !isset( $aParams[
'oxdiscount__oxactive']))
153 $aParams[
'oxdiscount__oxactive'] = 0;
157 $oAttr->setLanguage(0);
158 $oAttr->assign( $aParams);
159 $oAttr->setLanguage($this->_iEditLang);