23         if ($sOxId != 
"-1" && isset($sOxId)) {
 
   25             $oDiscount = 
oxNew(
"oxdiscount");
 
   26             $oDiscount->loadInLang($this->_iEditLang, $sOxId);
 
   28             $oOtherLang = $oDiscount->getAvailableInLangs();
 
   29             if (!isset($oOtherLang[$this->_iEditLang])) {
 
   31                 $oDiscount->loadInLang(key($oOtherLang), $sOxId);
 
   34             $this->_aViewData[
"edit"] = $oDiscount;
 
   41                 $this->_aViewData[
"posslang"] = 
$aLang;
 
   44             foreach ($oOtherLang as $id => $language) {
 
   45                 $oLang = 
new stdClass();
 
   46                 $oLang->sLangDesc = $language;
 
   48                 $this->_aViewData[
"otherlang"][$id] = clone $oLang;
 
   54                 $oDiscountMainAjax = 
oxNew(
'discount_main_ajax');
 
   55                 $this->_aViewData[
'oxajax'] = $oDiscountMainAjax->getColumns();
 
   57                 return "popups/discount_main.tpl";
 
   58             } elseif ($iAoc == 
"2") {
 
   62                 $oDiscountItemAjax = 
oxNew(
'discount_item_ajax');
 
   63                 $this->_aViewData[
'oxajax'] = $oDiscountItemAjax->getColumns();
 
   65                 return "popups/discount_item.tpl";
 
   69         return "discount_main.tpl";
 
   81         if ($sOxId != 
"-1" && isset($sOxId)) {
 
   82             $sViewName = getViewName(
"oxarticles", $this->_iEditLang);
 
   84             $sQ = 
"select concat( $sViewName.oxartnum, ' ', $sViewName.oxtitle ) from oxdiscount 
   85                    left join $sViewName on $sViewName.oxid=oxdiscount.oxitmartid 
   86                    where oxdiscount.oxitmartid != '' and oxdiscount.oxid=" . $oDb->quote($sOxId);
 
   87             $sTitle = $oDb->getOne($sQ, 
false, 
false);
 
   90         return $sTitle ? $sTitle : 
" -- ";
 
  106         $aParams[
'oxdiscount__oxshopid'] = $sShopID;
 
  108         $oDiscount = 
oxNew(
"oxDiscount");
 
  109         if ($sOxId != 
"-1") {
 
  110             $oDiscount->load($sOxId);
 
  112             $aParams[
'oxdiscount__oxid'] = null;
 
  116         if (!isset($aParams[
'oxdiscount__oxactive'])) {
 
  117             $aParams[
'oxdiscount__oxactive'] = 0;
 
  122         $oDiscount->setLanguage(0);
 
  123         $oDiscount->assign($aParams);
 
  124         $oDiscount->setLanguage($this->_iEditLang);
 
  146         $aParams[
'oxdiscount__oxshopid'] = $sShopID;
 
  147         $oAttr = 
oxNew(
"oxdiscount");
 
  148         if ($sOxId != 
"-1") {
 
  149             $oAttr->load($sOxId);
 
  151             $aParams[
'oxdiscount__oxid'] = null;
 
  154         if (!isset($aParams[
'oxdiscount__oxactive'])) {
 
  155             $aParams[
'oxdiscount__oxactive'] = 0;
 
  160         $oAttr->setLanguage(0);
 
  161         $oAttr->assign($aParams);
 
  162         $oAttr->setLanguage($this->_iEditLang);