/**
  * Executes parent method parent::render(), creates discount category tree,
  * passes data to Smarty engine and returns name of template file "discount_main.tpl".
  *
  * @return string
  */
 public function render()
 {
     parent::render();
     $soxId = $this->getEditObjectId();
     if ($soxId != '-1' && isset($soxId)) {
         // load object
         $oDiscount = oxNew('oxdiscount');
         $oDiscount->load($soxId);
         $this->_aViewData['edit'] = $oDiscount;
         //disabling derived items
         if ($oDiscount->isDerived()) {
             $this->_aViewData['readonly'] = true;
         }
         // generating category tree for artikel choose select list
         $this->_getCategoryTree("artcattree", null);
     }
     $aColumns = array();
     $iAoc = oxConfig::getParameter("aoc");
     if ($iAoc == 1) {
         include_once 'inc/discount_articles.inc.php';
         $this->_aViewData['oxajax'] = $aColumns;
         return "popups/discount_articles.tpl";
     } elseif ($iAoc == 2) {
         include_once 'inc/discount_categories.inc.php';
         $this->_aViewData['oxajax'] = $aColumns;
         return "popups/discount_categories.tpl";
     }
     return 'discount_articles.tpl';
 }
Beispiel #2
0
 /**
  * Saves main wrapping parameters.
  *
  * @return null
  */
 public function save()
 {
     parent::save();
     $soxId = $this->getEditObjectId();
     $aParams = oxRegistry::getConfig()->getRequestParameter("editval");
     // checkbox handling
     if (!isset($aParams['oxwrapping__oxactive'])) {
         $aParams['oxwrapping__oxactive'] = 0;
     }
     // shopid
     $aParams['oxwrapping__oxshopid'] = oxRegistry::getSession()->getVariable("actshop");
     $oWrapping = oxNew("oxwrapping");
     if ($soxId != "-1") {
         $oWrapping->loadInLang($this->_iEditLang, $soxId);
         // #1173M - not all pic are deleted, after article is removed
         oxRegistry::get("oxUtilsPic")->overwritePic($oWrapping, 'oxwrapping', 'oxpic', 'WP', '0', $aParams, $this->getConfig()->getPictureDir(false));
     } else {
         $aParams['oxwrapping__oxid'] = null;
         //$aParams = $oWrapping->ConvertNameArray2Idx( $aParams);
     }
     $oWrapping->setLanguage(0);
     $oWrapping->assign($aParams);
     $oWrapping->setLanguage($this->_iEditLang);
     $oWrapping = oxRegistry::get("oxUtilsFile")->processFiles($oWrapping);
     $oWrapping->save();
     // set oxid if inserted
     $this->setEditObjectId($oWrapping->getId());
 }
 /**
  * Saves deliveryset information changes.
  *
  * @return mixed
  */
 public function save()
 {
     parent::save();
     $soxId = $this->getEditObjectId();
     $aParams = oxConfig::getParameter("editval");
     // shopid
     $sShopID = oxSession::getVar("actshop");
     $aParams['oxdeliveryset__oxshopid'] = $sShopID;
     $oDelSet = oxNew("oxdeliveryset");
     if ($soxId != "-1") {
         $oDelSet->loadInLang($this->_iEditLang, $soxId);
     } else {
         $aParams['oxdeliveryset__oxid'] = null;
     }
     // checkbox handling
     if (!isset($aParams['oxdeliveryset__oxactive'])) {
         $aParams['oxdeliveryset__oxactive'] = 0;
     }
     //$aParams = $oDelSet->ConvertNameArray2Idx( $aParams);
     $oDelSet->setLanguage(0);
     $oDelSet->assign($aParams);
     $oDelSet->setLanguage($this->_iEditLang);
     $oDelSet = oxUtilsFile::getInstance()->processFiles($oDelSet);
     $oDelSet->save();
     // set oxid if inserted
     $this->setEditObjectId($oDelSet->getId());
 }
 /**
  * Saves main orders configuration parameters.
  *
  * @return string
  */
 public function save()
 {
     parent::save();
     $soxId = $this->getEditObjectId();
     $aParams = oxConfig::getParameter("editval");
     // shopid
     $sShopID = oxSession::getVar("actshop");
     $aParams['oxorder__oxshopid'] = $sShopID;
     $oOrder = oxNew("oxorder");
     if ($soxId != "-1") {
         $oOrder->load($soxId);
     } else {
         $aParams['oxorder__oxid'] = null;
     }
     $oOrder->assign($aParams);
     $aDynvalues = oxConfig::getParameter("dynvalue");
     if (isset($aDynvalues)) {
         // #411 Dodger
         $oPayment = oxNew("oxuserpayment");
         $oPayment->load($oOrder->oxorder__oxpaymentid->value);
         $oPayment->oxuserpayments__oxvalue->setValue(oxUtils::getInstance()->assignValuesToText($aDynvalues));
         $oPayment->save();
     }
     // keeps old delivery cost
     $oOrder->reloadDelivery(false);
     // keeps old discount
     $oOrder->reloadDiscount(false);
     $oOrder->recalculateOrder();
     // set oxid if inserted
     $this->setEditObjectId($oOrder->getId());
 }
 /**
  * Executes parent method parent::render(), creates delivery category tree,
  * passes data to Smarty engine and returns name of template file "delivery_main.tpl".
  *
  * @return string
  */
 public function render()
 {
     parent::render();
     $soxId = $this->getEditObjectId();
     $sChosenArtCat2 = oxConfig::getParameter("artcat2");
     if ($soxId != "-1" && isset($soxId)) {
         $sChosenArtCat2 = $this->_getCategoryTree("artcattree", $sChosenArtCat2);
         // load object
         $oDelivery = oxNew("oxdelivery");
         $oDelivery->load($soxId);
         $this->_aViewData["edit"] = $oDelivery;
         //Disable editing for derived articles
         if ($oDelivery->isDerived()) {
             $this->_aViewData['readonly'] = true;
         }
     }
     $aColumns = array();
     $iAoc = oxConfig::getParameter("aoc");
     if ($iAoc == 1) {
         include_once 'inc/delivery_articles.inc.php';
         $this->_aViewData['oxajax'] = $aColumns;
         return "popups/delivery_articles.tpl";
     } elseif ($iAoc == 2) {
         include_once 'inc/delivery_categories.inc.php';
         $this->_aViewData['oxajax'] = $aColumns;
         return "popups/delivery_categories.tpl";
     }
     return "delivery_articles.tpl";
 }
 /**
  * Executes parent method parent::render(), creates discount category tree,
  * passes data to Smarty engine and returns name of template file "discount_main.tpl".
  *
  * @return string
  */
 public function render()
 {
     parent::render();
     $soxId = $this->getEditObjectId();
     if (isset($soxId) && $soxId != '-1') {
         // load object
         $oDiscount = oxNew('oxdiscount');
         $oDiscount->load($soxId);
         $this->_aViewData['edit'] = $oDiscount;
         //disabling derived items
         if ($oDiscount->isDerived()) {
             $this->_aViewData['readonly'] = true;
         }
         // generating category tree for artikel choose select list
         $this->_createCategoryTree("artcattree");
     }
     $iAoc = oxRegistry::getConfig()->getRequestParameter("aoc");
     if ($iAoc == 1) {
         $oDiscountArticlesAjax = oxNew('discount_articles_ajax');
         $this->_aViewData['oxajax'] = $oDiscountArticlesAjax->getColumns();
         return "popups/discount_articles.tpl";
     } elseif ($iAoc == 2) {
         $oDiscountCategoriesAjax = oxNew('discount_categories_ajax');
         $this->_aViewData['oxajax'] = $oDiscountCategoriesAjax->getColumns();
         return "popups/discount_categories.tpl";
     }
     return 'discount_articles.tpl';
 }
 /**
  * Saves user extended information.
  *
  * @return mixed
  */
 public function save()
 {
     parent::save();
     $soxId = $this->getEditObjectId();
     if (!$this->_allowAdminEdit($soxId)) {
         return false;
     }
     $aParams = oxRegistry::getConfig()->getRequestParameter("editval");
     $oUser = oxNew("oxuser");
     if ($soxId != "-1") {
         $oUser->load($soxId);
     } else {
         $aParams['oxuser__oxid'] = null;
     }
     // checkbox handling
     $aParams['oxuser__oxactive'] = $oUser->oxuser__oxactive->value;
     $blNewsParams = oxRegistry::getConfig()->getRequestParameter("editnews");
     if (isset($blNewsParams)) {
         $oNewsSubscription = $oUser->getNewsSubscription();
         $oNewsSubscription->setOptInStatus((int) $blNewsParams);
         $oNewsSubscription->setOptInEmailStatus((int) oxRegistry::getConfig()->getRequestParameter("emailfailed"));
     }
     $oUser->assign($aParams);
     $oUser->save();
     // set oxid if inserted
     $this->setEditObjectId($oUser->getId());
 }
Beispiel #8
0
 /**
  * Saves news text.
  *
  * @return mixed
  */
 public function save()
 {
     parent::save();
     $soxId = $this->getEditObjectId();
     $aParams = oxRegistry::getConfig()->getRequestParameter("editval");
     $oNews = oxNew("oxnews");
     $iNewsLang = oxRegistry::getConfig()->getRequestParameter("newslang");
     if (!isset($iNewsLang)) {
         $iNewsLang = $this->_iEditLang;
     }
     if ($soxId != "-1") {
         $oNews->loadInLang($iNewsLang, $soxId);
     } else {
         $aParams['oxnews__oxid'] = null;
     }
     // Disable editing for derived items.
     if ($oNews->isDerived()) {
         return;
     }
     $oNews->setLanguage(0);
     $oNews->assign($aParams);
     $oNews->setLanguage($iNewsLang);
     $oNews->save();
     // set oxid if inserted
     $this->setEditObjectId($oNews->getId());
 }
 /**
  * Speichert den Standort mit den jeweiligen Parameter
  * Saves selection list parameters changes.
  *
  * @return mixed
  */
 public function save()
 {
     parent::save();
     $this->resetContentCache();
     $soxId = $this->getEditObjectId();
     $aParams = oxConfig::getParameter("editval");
     if (!isset($aParams['stores__store_active'])) {
         $aParams['stores__store_active'] = 0;
     }
     $oShoplocator = oxNew("shoplocator");
     if (isset($aParams['stores__store_address'])) {
         $address = str_replace(' ', '', $aParams['stores__store_address']) . "+" . $aParams['stores__store_city'] . "+" . $aParams['stores__store_zip'];
         $pc = file_get_contents('http://maps.googleapis.com/maps/api/geocode/json?address=' . $address . '&sensor=false');
         $output = json_decode($pc);
         $aParams['stores__store_latitude'] = $output->results[0]->geometry->location->lat;
         $aParams['stores__store_logitude'] = $output->results[0]->geometry->location->lng;
     }
     if ($soxId != "-1") {
         $oShoplocator->load($soxId);
     } else {
         $aParams['stores__oxid'] = null;
     }
     //Disable editing for derived articles
     if ($oShoplocator->isDerived()) {
         return;
     }
     $oShoplocator->assign($aParams);
     $oShoplocator->save();
     // set oxid if inserted
     $this->setEditObjectId($oShoplocator->getId());
 }
 /**
  * Executes parent method parent::render() and returns name of template
  * file "statistic_service.tpl".
  *
  * @return string
  */
 public function render()
 {
     parent::render();
     $sSql = "select count(*) from oxlogs where oxshopid = '" . $this->getConfig()->getShopId() . "'";
     $this->_aViewData['iLogCount'] = oxDb::getDb()->getOne($sSql, false, false);
     return "statistic_service.tpl";
 }
 /**
  * Executes parent method parent::render(), creates oxOrder, passes
  * it's data to Smarty engine and returns name of template file
  * "order_overview.tpl".
  *
  * @return string
  */
 public function render()
 {
     $myConfig = $this->getConfig();
     parent::render();
     $oOrder = oxNew("oxOrder");
     $oCur = $myConfig->getActShopCurrencyObject();
     $oLang = oxRegistry::getLang();
     $soxId = $this->getEditObjectId();
     if ($soxId != "-1" && isset($soxId)) {
         // load object
         $oOrder->load($soxId);
         $this->_aViewData["edit"] = $oOrder;
         $this->_aViewData["aProductVats"] = $oOrder->getProductVats();
         $this->_aViewData["orderArticles"] = $oOrder->getOrderArticles();
         $this->_aViewData["giftCard"] = $oOrder->getGiftCard();
         $this->_aViewData["paymentType"] = $this->_getPaymentType($oOrder);
         $this->_aViewData["deliveryType"] = $oOrder->getDelSet();
         $sTsProtectsField = 'oxorder__oxtsprotectcosts';
         if ($oOrder->{$sTsProtectsField}->value) {
             $this->_aViewData["tsprotectcosts"] = $oLang->formatCurrency($oOrder->{$sTsProtectsField}->value, $oCur);
         }
     }
     // orders today
     $dSum = $oOrder->getOrderSum(true);
     $this->_aViewData["ordersum"] = $oLang->formatCurrency($dSum, $oCur);
     $this->_aViewData["ordercnt"] = $oOrder->getOrderCnt(true);
     // ALL orders
     $dSum = $oOrder->getOrderSum();
     $this->_aViewData["ordertotalsum"] = $oLang->formatCurrency($dSum, $oCur);
     $this->_aViewData["ordertotalcnt"] = $oOrder->getOrderCnt();
     $this->_aViewData["afolder"] = $myConfig->getConfigParam('aOrderfolder');
     $this->_aViewData["alangs"] = $oLang->getLanguageNames();
     $this->_aViewData["currency"] = $oCur;
     return "order_overview.tpl";
 }
Beispiel #12
0
 /**
  * Saves selection list parameters changes.
  *
  * @return mixed
  */
 public function save()
 {
     parent::save();
     $soxId = $this->getEditObjectId();
     $aParams = oxRegistry::getConfig()->getRequestParameter("editval");
     if (!isset($aParams['oxmanufacturers__oxactive'])) {
         $aParams['oxmanufacturers__oxactive'] = 0;
     }
     // shopid
     $sShopID = oxRegistry::getSession()->getVariable("actshop");
     $aParams['oxmanufacturers__oxshopid'] = $sShopID;
     $oManufacturer = oxNew("oxmanufacturer");
     if ($soxId != "-1") {
         $oManufacturer->loadInLang($this->_iEditLang, $soxId);
     } else {
         $aParams['oxmanufacturers__oxid'] = null;
     }
     //$aParams = $oManufacturer->ConvertNameArray2Idx( $aParams);
     $oManufacturer->setLanguage(0);
     $oManufacturer->assign($aParams);
     $oManufacturer->setLanguage($this->_iEditLang);
     $oManufacturer = oxRegistry::get("oxUtilsFile")->processFiles($oManufacturer);
     $oManufacturer->save();
     // set oxid if inserted
     $this->setEditObjectId($oManufacturer->getId());
 }
 /**
  * Collects article crosselling and attributes information, passes
  * them to Smarty engine and returns name or template file
  * "article_crossselling.tpl".
  *
  * @return string
  */
 public function render()
 {
     parent::render();
     $this->_aViewData['edit'] = $oArticle = oxNew('oxarticle');
     // crossselling
     $this->_createCategoryTree("artcattree");
     // accessoires
     $this->_createCategoryTree("artcattree2");
     $soxId = $this->getEditObjectId();
     if ($soxId != "-1" && isset($soxId)) {
         // load object
         $oArticle->load($soxId);
         if ($oArticle->isDerived()) {
             $this->_aViewData['readonly'] = true;
         }
     }
     $iAoc = oxRegistry::getConfig()->getRequestParameter("aoc");
     if ($iAoc == 1) {
         $oArticleCrossellingAjax = oxNew('article_crossselling_ajax');
         $this->_aViewData['oxajax'] = $oArticleCrossellingAjax->getColumns();
         return "popups/article_crossselling.tpl";
     } elseif ($iAoc == 2) {
         $oArticleAccessoriesAjax = oxNew('article_accessories_ajax');
         $this->_aViewData['oxajax'] = $oArticleAccessoriesAjax->getColumns();
         return "popups/article_accessories.tpl";
     }
     return "article_crossselling.tpl";
 }
 /**
  * Executes parent method parent::render(), creates oxpricealarm object
  * and passes it's data to Smarty engine. Returns name of template file
  * "pricealarm_main.tpl".
  *
  * @return string
  */
 public function render()
 {
     $config = $this->getConfig();
     parent::render();
     $shopId = $config->getShopId();
     //articles price in subshop and baseshop can be different
     $this->_aViewData['iAllCnt'] = 0;
     $query = "\n            SELECT oxprice, oxartid\n            FROM oxpricealarm\n            WHERE oxsended = '000-00-00 00:00:00' AND oxshopid = '{$shopId}' ";
     $result = oxDb::getDb()->select($query);
     if ($result != false && $result->count() > 0) {
         $simpleCache = array();
         while (!$result->EOF) {
             $price = $result->fields[0];
             $articleId = $result->fields[1];
             if (isset($simpleCache[$articleId])) {
                 if ($simpleCache[$articleId] <= $price) {
                     $this->_aViewData['iAllCnt'] += 1;
                 }
             } else {
                 $article = oxNew("oxArticle");
                 if ($article->load($articleId)) {
                     $articlePrice = $simpleCache[$articleId] = $article->getPrice()->getBruttoPrice();
                     if ($articlePrice <= $price) {
                         $this->_aViewData['iAllCnt'] += 1;
                     }
                 }
             }
             $result->fetchRow();
         }
     }
     return "pricealarm_mail.tpl";
 }
 /**
  * Collects article attributes and selection lists, passes them to Smarty engine,
  * returns name of template file "article_attribute.tpl".
  *
  * @return string
  */
 public function render()
 {
     parent::render();
     $this->_aViewData['edit'] = $oArticle = oxNew('oxarticle');
     $soxId = $this->getEditObjectId();
     if ($soxId != "-1" && isset($soxId)) {
         // load object
         $oArticle->load($soxId);
         if ($oArticle->isDerived()) {
             $this->_aViewData["readonly"] = true;
         }
     }
     $aColumns = array();
     $iAoc = oxConfig::getParameter("aoc");
     if ($iAoc == 1) {
         include_once 'inc/article_attribute.inc.php';
         $this->_aViewData['oxajax'] = $aColumns;
         return "popups/article_attribute.tpl";
     } elseif ($iAoc == 2) {
         include_once 'inc/article_selection.inc.php';
         $this->_aViewData['oxajax'] = $aColumns;
         return "popups/article_selection.tpl";
     }
     return "article_attribute.tpl";
 }
 public function render()
 {
     parent::render();
     $aResult = $this->_getModuleManager()->getResultFile();
     $this->addTplParam('aModules', $aResult);
     return $this->_sThisTemplate;
 }
Beispiel #17
0
 /**
  * Saves category description text to DB.
  *
  * @return mixed
  */
 public function save()
 {
     parent::save();
     $myConfig = $this->getConfig();
     $soxId = $this->getEditObjectId();
     $aParams = oxRegistry::getConfig()->getRequestParameter("editval");
     $oCategory = oxNew("oxCategory");
     $iCatLang = oxRegistry::getConfig()->getRequestParameter("catlang");
     $iCatLang = $iCatLang ? $iCatLang : 0;
     if ($soxId != "-1") {
         $oCategory->loadInLang($iCatLang, $soxId);
     } else {
         $aParams['oxcategories__oxid'] = null;
     }
     //Disable editing for derived items
     if ($oCategory->isDerived()) {
         return;
     }
     $oCategory->setLanguage(0);
     $oCategory->assign($aParams);
     $oCategory->setLanguage($iCatLang);
     $oCategory->save();
     // set oxid if inserted
     $this->setEditObjectId($oCategory->getId());
 }
 /**
  * Saves deliveryset information changes.
  *
  * @return mixed
  */
 public function save()
 {
     parent::save();
     $soxId = $this->getEditObjectId();
     $aParams = oxRegistry::getConfig()->getRequestParameter("editval");
     $oDelSet = oxNew("oxdeliveryset");
     if ($soxId != "-1") {
         $oDelSet->loadInLang($this->_iEditLang, $soxId);
     } else {
         $aParams['oxdeliveryset__oxid'] = null;
     }
     // checkbox handling
     if (!isset($aParams['oxdeliveryset__oxactive'])) {
         $aParams['oxdeliveryset__oxactive'] = 0;
     }
     //Disable editing for derived articles
     if ($oDelSet->isDerived()) {
         return;
     }
     //$aParams = $oDelSet->ConvertNameArray2Idx( $aParams);
     $oDelSet->setLanguage(0);
     $oDelSet->assign($aParams);
     $oDelSet->setLanguage($this->_iEditLang);
     $oDelSet = oxRegistry::get("oxUtilsFile")->processFiles($oDelSet);
     $oDelSet->save();
     // set oxid if inserted
     $this->setEditObjectId($oDelSet->getId());
 }
 /**
  * Executes parent method parent::render()
  * passes data to Smarty engine and returns name of template file "deliveryset_payment.tpl".
  *
  * @return string
  */
 public function render()
 {
     parent::render();
     $soxId = $this->_aViewData["oxid"] = $this->getEditObjectId();
     if (isset($soxId) && $soxId != "-1") {
         // load object
         $odeliveryset = oxNew("oxdeliveryset");
         $odeliveryset->setLanguage($this->_iEditLang);
         $odeliveryset->load($soxId);
         $oOtherLang = $odeliveryset->getAvailableInLangs();
         if (!isset($oOtherLang[$this->_iEditLang])) {
             // echo "language entry doesn't exist! using: ".key($oOtherLang);
             $odeliveryset->setLanguage(key($oOtherLang));
             $odeliveryset->load($soxId);
         }
         $this->_aViewData["edit"] = $odeliveryset;
         //Disable editing for derived articles
         if ($odeliveryset->isDerived()) {
             $this->_aViewData['readonly'] = true;
         }
     }
     $iAoc = oxRegistry::getConfig()->getRequestParameter("aoc");
     if ($iAoc == 1) {
         $oDeliverysetPaymentAjax = oxNew('deliveryset_payment_ajax');
         $this->_aViewData['oxajax'] = $oDeliverysetPaymentAjax->getColumns();
         return "popups/deliveryset_payment.tpl";
     } elseif ($iAoc == 2) {
         $oDeliverysetCountryAjax = oxNew('deliveryset_country_ajax');
         $this->_aViewData['oxajax'] = $oDeliverysetCountryAjax->getColumns();
         return "popups/deliveryset_country.tpl";
     }
     return "deliveryset_payment.tpl";
 }
 /**
  * Executes parent method parent::render()
  * passes data to Smarty engine and returns name of template file "deliveryset_payment.tpl".
  *
  * @return string
  */
 public function render()
 {
     parent::render();
     $soxId = $this->_aViewData["oxid"] = $this->getEditObjectId();
     if ($soxId != "-1" && isset($soxId)) {
         // load object
         $odeliveryset = oxNew("oxdeliveryset");
         $odeliveryset->setLanguage($this->_iEditLang);
         $odeliveryset->load($soxId);
         $oOtherLang = $odeliveryset->getAvailableInLangs();
         if (!isset($oOtherLang[$this->_iEditLang])) {
             // echo "language entry doesn't exist! using: ".key($oOtherLang);
             $odeliveryset->setLanguage(key($oOtherLang));
             $odeliveryset->load($soxId);
         }
         $this->_aViewData["edit"] = $odeliveryset;
         //Disable editing for derived articles
         if ($odeliveryset->isDerived()) {
             $this->_aViewData['readonly'] = true;
         }
     }
     $aColumns = array();
     $iAoc = oxConfig::getParameter("aoc");
     if ($iAoc == 1) {
         include_once 'inc/deliveryset_payment.inc.php';
         $this->_aViewData['oxajax'] = $aColumns;
         return "popups/deliveryset_payment.tpl";
     } elseif ($iAoc == 2) {
         include_once 'inc/deliveryset_country.inc.php';
         $this->_aViewData['oxajax'] = $aColumns;
         return "popups/deliveryset_country.tpl";
     }
     return "deliveryset_payment.tpl";
 }
 /**
  * Executes parent method parent::render(), creates delivery category tree,
  * passes data to Smarty engine and returns name of template file "delivery_main.tpl".
  *
  * @return string
  */
 public function render()
 {
     parent::render();
     $soxId = $this->getEditObjectId();
     if (isset($soxId) && $soxId != "-1") {
         $this->_createCategoryTree("artcattree");
         // load object
         $oDelivery = oxNew("oxdelivery");
         $oDelivery->load($soxId);
         $this->_aViewData["edit"] = $oDelivery;
         //Disable editing for derived articles
         if ($oDelivery->isDerived()) {
             $this->_aViewData['readonly'] = true;
         }
     }
     $iAoc = oxRegistry::getConfig()->getRequestParameter("aoc");
     if ($iAoc == 1) {
         $oDeliveryArticlesAjax = oxNew('delivery_articles_ajax');
         $this->_aViewData['oxajax'] = $oDeliveryArticlesAjax->getColumns();
         return "popups/delivery_articles.tpl";
     } elseif ($iAoc == 2) {
         $oDeliveryCategoriesAjax = oxNew('delivery_categories_ajax');
         $this->_aViewData['oxajax'] = $oDeliveryCategoriesAjax->getColumns();
         return "popups/delivery_categories.tpl";
     }
     return "delivery_articles.tpl";
 }
Beispiel #22
0
 /**
  * Saves selection list parameters changes.
  *
  * @return mixed
  */
 public function save()
 {
     parent::save();
     $soxId = $this->getEditObjectId();
     $aParams = oxRegistry::getConfig()->getRequestParameter("editval");
     if (!isset($aParams['oxvendor__oxactive'])) {
         $aParams['oxvendor__oxactive'] = 0;
     }
     $oVendor = oxNew("oxvendor");
     if ($soxId != "-1") {
         $oVendor->loadInLang($this->_iEditLang, $soxId);
     } else {
         $aParams['oxvendor__oxid'] = null;
     }
     //Disable editing for derived articles
     if ($oVendor->isDerived()) {
         return;
     }
     $oVendor->setLanguage(0);
     $oVendor->assign($aParams);
     $oVendor->setLanguage($this->_iEditLang);
     $oVendor = oxRegistry::get("oxUtilsFile")->processFiles($oVendor);
     $oVendor->save();
     // set oxid if inserted
     $this->setEditObjectId($oVendor->getId());
 }
 /**
  * Saves changed main shop configuration parameters.
  *
  * @return null
  */
 public function save()
 {
     parent::save();
     $myConfig = $this->getConfig();
     $soxId = $this->getEditObjectId();
     $aParams = oxConfig::getParameter("editval");
     //  #918 S
     // checkbox handling
     $aParams['oxshops__oxactive'] = isset($aParams['oxshops__oxactive']) && $aParams['oxshops__oxactive'] == true ? 1 : 0;
     $aParams['oxshops__oxproductive'] = isset($aParams['oxshops__oxproductive']) && $aParams['oxshops__oxproductive'] == true ? 1 : 0;
     $isubjlang = oxConfig::getParameter("subjlang");
     $iLang = $isubjlang && $isubjlang > 0 ? $isubjlang : 0;
     $oShop = oxNew("oxshop");
     if ($soxId != "-1") {
         $oShop->loadInLang($iLang, $soxId);
     } else {
         $aParams['oxshops__oxid'] = null;
     }
     if ($aParams['oxshops__oxsmtp']) {
         $aParams['oxshops__oxsmtp'] = trim($aParams['oxshops__oxsmtp']);
     }
     $oShop->setLanguage(0);
     $oShop->assign($aParams);
     $oShop->setLanguage($iLang);
     if ($sNewSMPTPass = oxConfig::getParameter("oxsmtppwd")) {
         $oShop->oxshops__oxsmtppwd->setValue($sNewSMPTPass == '-' ? "" : $sNewSMPTPass);
     }
     $oShop->save();
     $this->_aViewData["updatelist"] = "1";
     oxSession::setVar("actshop", $soxId);
 }
 /**
  * Collects article crosselling and attributes information, passes
  * them to Smarty engine and returns name or template file
  * "article_crossselling.tpl".
  *
  * @return string
  */
 public function render()
 {
     parent::render();
     $this->_aViewData['edit'] = $oArticle = oxNew('oxarticle');
     // crossselling
     $sChosenArtCat = $this->_getCategoryTree("artcattree", oxConfig::getParameter("artcat"));
     // accessoires
     $sChosenArtCat2 = $this->_getCategoryTree("artcattree2", oxConfig::getParameter("artcat2"));
     $soxId = $this->getEditObjectId();
     if ($soxId != "-1" && isset($soxId)) {
         // load object
         $oArticle->load($soxId);
         if ($oArticle->isDerived()) {
             $this->_aViewData['readonly'] = true;
         }
     }
     $aColumns = array();
     $iAoc = oxConfig::getParameter("aoc");
     if ($iAoc == 1) {
         include_once 'inc/article_crossselling.inc.php';
         $this->_aViewData['oxajax'] = $aColumns;
         return "popups/article_crossselling.tpl";
     } elseif ($iAoc == 2) {
         include_once 'inc/article_accessories.inc.php';
         $this->_aViewData['oxajax'] = $aColumns;
         return "popups/article_accessories.tpl";
     }
     return "article_crossselling.tpl";
 }
Beispiel #25
0
 /**
  * Executes parent method parent::render(),
  * and returns name of template file
  * "object_main.tpl".
  *
  * @return string
  */
 public function render()
 {
     parent::render();
     if ($sType = $this->_getType()) {
         $oObject = oxNew($sType);
         if ($oObject->load($this->getEditObjectId())) {
             $oOtherLang = $oObject->getAvailableInLangs();
             if (!isset($oOtherLang[$iLang])) {
                 $oObject->loadInLang(key($oOtherLang), $this->getEditObjectId());
             }
             $this->_aViewData['edit'] = $oObject;
         }
         if ($oObject->isDerived()) {
             $this->_aViewData['readonly'] = true;
         }
     }
     $iLang = $this->getEditLang();
     $aLangs = oxRegistry::getLang()->getLanguageNames();
     foreach ($aLangs as $sLangId => $sLanguage) {
         $oLang = new stdClass();
         $oLang->sLangDesc = $sLanguage;
         $oLang->selected = $sLangId == $iLang;
         $this->_aViewData['otherlang'][$sLangId] = clone $oLang;
     }
     return 'object_seo.tpl';
 }
 /**
  * Loads article Mercators info, passes it to Smarty engine and
  * returns name of template file "Mercator_main.tpl".
  *
  * @return string
  */
 public function render()
 {
     parent::render();
     $oSysReq = new oxSysRequirements();
     $this->_aViewData['aInfo'] = $oSysReq->getSystemInfo();
     $this->_aViewData['aCollations'] = $oSysReq->checkCollation();
     return "sysreq_main.tpl";
 }
 /**
  * Render the yapital order detail template
  *
  * @return string
  */
 public function render()
 {
     parent::render();
     if ($this->_getPaymentSid() === 'paymill_cc' || $this->_getPaymentSid() === 'paymill_elv') {
         return 'paymill_order_details.tpl';
     }
     return 'paymill_order_no_details.tpl';
 }
 /**
  * Executes parent method parent::render(), passes data
  * to Smarty engine, returns name of template file "order_downloads.tpl".
  *
  * @return string
  */
 public function render()
 {
     parent::render();
     if ($oOrder = $this->getEditObject()) {
         $this->_aViewData["edit"] = $oOrder;
     }
     return "order_downloads.tpl";
 }
Beispiel #29
0
 /**
  * Saves main orders configuration parameters.
  */
 public function save()
 {
     parent::save();
     $soxId = $this->getEditObjectId();
     $aParams = oxRegistry::getConfig()->getRequestParameter("editval");
     $oOrder = oxNew("oxorder");
     if ($soxId != "-1") {
         $oOrder->load($soxId);
     } else {
         $aParams['oxorder__oxid'] = null;
     }
     $needOrderRecalculate = false;
     if (is_array($aParams)) {
         foreach ($aParams as $parameter => $value) {
             //parameter changes for not whitelisted parameters trigger order recalculation
             $orderField = $oOrder->{$parameter};
             if ($value != $orderField->value && !in_array($parameter, $this->fieldsTriggerNoOrderRecalculation)) {
                 $needOrderRecalculate = true;
                 continue;
             }
         }
     }
     //change payment
     $sPayId = oxRegistry::getConfig()->getRequestParameter("setPayment");
     if (!empty($sPayId) && $sPayId != $oOrder->oxorder__oxpaymenttype->value) {
         $aParams['oxorder__oxpaymenttype'] = $sPayId;
         $needOrderRecalculate = true;
     }
     $oOrder->assign($aParams);
     $aDynvalues = oxRegistry::getConfig()->getRequestParameter("dynvalue");
     if (isset($aDynvalues)) {
         $oPayment = oxNew("oxuserpayment");
         $oPayment->load($oOrder->oxorder__oxpaymentid->value);
         $oPayment->oxuserpayments__oxvalue->setValue(oxRegistry::getUtils()->assignValuesToText($aDynvalues));
         $oPayment->save();
         $needOrderRecalculate = true;
     }
     //change delivery set
     $sDelSetId = oxRegistry::getConfig()->getRequestParameter("setDelSet");
     if (!empty($sDelSetId) && $sDelSetId != $oOrder->oxorder__oxdeltype->value) {
         $oOrder->oxorder__oxpaymenttype->setValue("oxempty");
         $oOrder->setDelivery($sDelSetId);
         $needOrderRecalculate = true;
     } else {
         // keeps old delivery cost
         $oOrder->reloadDelivery(false);
     }
     if ($needOrderRecalculate) {
         // keeps old discount
         $oOrder->reloadDiscount(false);
         $oOrder->recalculateOrder();
     } else {
         //nothing changed in order that requires a full recalculation
         $oOrder->save();
     }
     // set oxid if inserted
     $this->setEditObjectId($oOrder->getId());
 }
 public function render()
 {
     $sModuleId = $this->getEditObjectId();
     $oModule = oxNew('oxModule');
     if ($sModuleId && $oModule->load($sModuleId)) {
         $this->addTplParam("oModule", $oModule);
     }
     return parent::render();
 }