예제 #1
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());
 }
예제 #2
0
 /**
  * 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);
 }
예제 #3
0
 /**
  * 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());
 }
예제 #4
0
 /**
  * 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());
 }
예제 #5
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());
 }
 /**
  * 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());
 }
 /**
  * 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());
 }
예제 #8
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());
 }
예제 #9
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());
 }
예제 #10
0
 /**
  * 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());
 }
예제 #11
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());
 }
예제 #12
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());
 }
예제 #13
0
 /**
  * Saves user history text changes.
  */
 public function save()
 {
     parent::save();
     $oRemark = oxNew("oxremark");
     // try to load if exists
     $oRemark->load(oxRegistry::getConfig()->getRequestParameter("rem_oxid"));
     $oRemark->oxremark__oxtext = new oxField(oxRegistry::getConfig()->getRequestParameter("remarktext"));
     $oRemark->oxremark__oxheader = new oxField(oxRegistry::getConfig()->getRequestParameter("remarkheader"));
     $oRemark->oxremark__oxparentid = new oxField($this->getEditObjectId());
     $oRemark->oxremark__oxtype = new oxField("r");
     $oRemark->save();
 }
예제 #14
0
 /**
  * Saves order history item text changes.
  */
 public function save()
 {
     parent::save();
     $oOrder = oxNew("oxorder");
     if ($oOrder->load($this->getEditObjectId())) {
         $oRemark = oxNew("oxremark");
         $oRemark->load(oxRegistry::getConfig()->getRequestParameter("rem_oxid"));
         $oRemark->oxremark__oxtext = new oxField(oxRegistry::getConfig()->getRequestParameter("remarktext"));
         $oRemark->oxremark__oxheader = new oxField(oxRegistry::getConfig()->getRequestParameter("remarkheader"));
         $oRemark->oxremark__oxtype = new oxField("r");
         $oRemark->oxremark__oxparentid = new oxField($oOrder->oxorder__oxuserid->value);
         $oRemark->save();
     }
 }
예제 #15
0
 /**
  * Saves shop configuration variables
  */
 public function saveConfVars()
 {
     $myConfig = $this->getConfig();
     oxAdminDetails::save();
     $sShopId = $myConfig->getShopId();
     $sModule = $this->_getModuleForConfigVars();
     foreach ($this->_aConfParams as $sType => $sParam) {
         $aConfVars = $myConfig->getRequestParameter($sParam);
         if (is_array($aConfVars)) {
             foreach ($aConfVars as $sName => $sValue) {
                 $myConfig->saveShopConfVar($sType, $sName, $this->_serializeConfVar($sType, $sName, $sValue), $sShopId, $sModule);
             }
         }
     }
 }
예제 #16
0
 /**
  * Saves content contents.
  *
  * @return mixed
  */
 public function save()
 {
     parent::save();
     $soxId = $this->getEditObjectId();
     $aParams = $this->getConfig()->getRequestParameter("editval");
     $oTest = oxNew("mibtest");
     if ($soxId != "-1") {
         $oTest->loadInLang($this->_iEditLang, $soxId);
     } else {
         $aParams['mib_test__oxid'] = null;
     }
     $oTest->assign($aParams);
     $oTest->save();
     $this->setEditObjectId($oTest->getId());
 }
예제 #17
0
 /**
  * Saves user addressing information.
  */
 public function save()
 {
     parent::save();
     if ($this->_allowAdminEdit($this->getEditObjectId())) {
         $aParams = oxRegistry::getConfig()->getRequestParameter("editval");
         $oAdress = oxNew("oxaddress");
         if (isset($aParams['oxaddress__oxid']) && $aParams['oxaddress__oxid'] == "-1") {
             $aParams['oxaddress__oxid'] = null;
         } else {
             $oAdress->load($aParams['oxaddress__oxid']);
         }
         $oAdress->assign($aParams);
         $oAdress->save();
         $this->sSavedOxid = $oAdress->getId();
     }
 }
예제 #18
0
 /**
  * Saves payment parameters changes.
  *
  * @return mixed
  */
 public function save()
 {
     parent::save();
     $soxId = $this->getEditObjectId();
     $aParams = oxRegistry::getConfig()->getRequestParameter("editval");
     // checkbox handling
     if (!isset($aParams['oxpayments__oxactive'])) {
         $aParams['oxpayments__oxactive'] = 0;
     }
     if (!isset($aParams['oxpayments__oxchecked'])) {
         $aParams['oxpayments__oxchecked'] = 0;
     }
     $oPayment = oxNew("oxpayment");
     if ($soxId != "-1") {
         $oPayment->loadInLang($this->_iEditLang, $soxId);
     } else {
         $aParams['oxpayments__oxid'] = null;
         //$aParams = $oPayment->ConvertNameArray2Idx( $aParams);
     }
     $oPayment->setLanguage(0);
     $oPayment->assign($aParams);
     // setting add sum calculation rules
     $aRules = (array) oxRegistry::getConfig()->getRequestParameter("oxpayments__oxaddsumrules");
     // if sum eqals 0, show notice, that default value will be used.
     if (empty($aRules)) {
         $this->_aViewData["noticeoxaddsumrules"] = 1;
     }
     $oPayment->oxpayments__oxaddsumrules = new oxField(array_sum($aRules));
     //#708
     if (!is_array($this->_aFieldArray)) {
         $this->_aFieldArray = oxRegistry::getUtils()->assignValuesFromText($oPayment->oxpayments__oxvaldesc->value);
     }
     // build value
     $sValdesc = "";
     foreach ($this->_aFieldArray as $oField) {
         $sValdesc .= $oField->name . "__@@";
     }
     $oPayment->oxpayments__oxvaldesc = new oxField($sValdesc, oxField::T_RAW);
     $oPayment->setLanguage($this->_iEditLang);
     $oPayment->save();
     // set oxid if inserted
     $this->setEditObjectId($oPayment->getId());
 }
예제 #19
0
 /**
  * Saves user payment settings.
  */
 public function save()
 {
     parent::save();
     $soxId = $this->getEditObjectId();
     if ($this->_allowAdminEdit($soxId)) {
         $aParams = oxRegistry::getConfig()->getRequestParameter("editval");
         $aDynvalues = oxRegistry::getConfig()->getRequestParameter("dynvalue");
         if (isset($aDynvalues)) {
             // store the dynvalues
             $aParams['oxuserpayments__oxvalue'] = oxRegistry::getUtils()->assignValuesToText($aDynvalues);
         }
         if ($aParams['oxuserpayments__oxid'] == "-1") {
             $aParams['oxuserpayments__oxid'] = null;
         }
         $oAdress = oxNew("oxuserpayment");
         $oAdress->assign($aParams);
         $oAdress->save();
     }
 }
예제 #20
0
 /**
  * Saves changed main shop configuration parameters.
  *
  * @return null
  */
 public function save()
 {
     parent::save();
     $config = $this->getConfig();
     $shopId = $this->getEditObjectId();
     $parameters = oxRegistry::getConfig()->getRequestParameter("editval");
     $user = $this->getUser();
     $shopId = $this->updateShopIdByUser($user, $shopId, false);
     //  #918 S
     // checkbox handling
     $parameters['oxshops__oxactive'] = isset($parameters['oxshops__oxactive']) && $parameters['oxshops__oxactive'] == true ? 1 : 0;
     $parameters['oxshops__oxproductive'] = isset($parameters['oxshops__oxproductive']) && $parameters['oxshops__oxproductive'] == true ? 1 : 0;
     $subjLang = oxRegistry::getConfig()->getRequestParameter("subjlang");
     $shopLanguageId = $subjLang && $subjLang > 0 ? $subjLang : 0;
     $shop = oxNew("oxshop");
     if ($shopId != self::NEW_SHOP_ID) {
         $shop->loadInLang($shopLanguageId, $shopId);
     } else {
         $parameters = $this->updateParameters($parameters);
     }
     if ($parameters['oxshops__oxsmtp']) {
         $parameters['oxshops__oxsmtp'] = trim($parameters['oxshops__oxsmtp']);
     }
     $shop->setLanguage(0);
     $shop->assign($parameters);
     $shop->setLanguage($shopLanguageId);
     if ($newSMPTPass = oxRegistry::getConfig()->getRequestParameter("oxsmtppwd")) {
         $shop->oxshops__oxsmtppwd->setValue($newSMPTPass == '-' ? "" : $newSMPTPass);
     }
     $canCreateShop = $this->canCreateShop($shopId, $shop, $config);
     if (!$canCreateShop) {
         return;
     }
     try {
         $shop->save();
     } catch (oxException $e) {
         $this->checkExceptionType($e);
         return;
     }
     $this->_aViewData["updatelist"] = "1";
     $this->updateShopInformation($config, $shop, $shopId);
     oxRegistry::getSession()->setVariable("actshop", $shopId);
 }
예제 #21
0
 /**
  * Saves ordering address information.
  */
 public function save()
 {
     parent::save();
     $soxId = $this->getEditObjectId();
     $aParams = (array) oxRegistry::getConfig()->getRequestParameter("editval");
     //TODO check if shop id is realy necessary at this place.
     $sShopID = oxRegistry::getSession()->getVariable("actshop");
     $aParams['oxorder__oxshopid'] = $sShopID;
     $oOrder = oxNew("oxorder");
     if ($soxId != "-1") {
         $oOrder->load($soxId);
     } else {
         $aParams['oxorder__oxid'] = null;
     }
     $aParams = $this->_processAddress($aParams, "oxorder__oxdel", array("oxorder__oxdelsal"));
     $oOrder->assign($aParams);
     $oOrder->save();
     // set oxid if inserted
     $this->setEditObjectId($oOrder->getId());
 }
 /**
  * Saves category description text to DB.
  *
  * @return mixed
  */
 public function save()
 {
     parent::save();
     $myConfig = $this->getConfig();
     $soxId = $this->getEditObjectId();
     $aParams = oxConfig::getParameter("editval");
     $oCategory = oxNew("oxcategory");
     $iCatLang = oxConfig::getParameter("catlang");
     $iCatLang = $iCatLang ? $iCatLang : 0;
     if ($soxId != "-1") {
         $oCategory->loadInLang($iCatLang, $soxId);
     } else {
         $aParams['oxcategories__oxid'] = null;
     }
     $oCategory->setLanguage(0);
     $oCategory->assign($aParams);
     $oCategory->setLanguage($iCatLang);
     $oCategory->save();
     // set oxid if inserted
     $this->setEditObjectId($oCategory->getId());
 }
예제 #23
0
 /**
  * Saves guestbook record changes.
  */
 public function save()
 {
     parent::save();
     $soxId = $this->getEditObjectId();
     $aParams = oxRegistry::getConfig()->getRequestParameter("editval");
     // checkbox handling
     if (!isset($aParams['oxgbentries__oxactive'])) {
         $aParams['oxgbentries__oxactive'] = 0;
     }
     $oLinks = $this->getGuestbookEntryObject();
     if ($soxId != "-1") {
         $oLinks->load($soxId);
     } else {
         $aParams['oxgbentries__oxid'] = null;
         // author
         $aParams['oxgbentries__oxuserid'] = oxRegistry::getSession()->getVariable('auth');
     }
     $aParams = $this->appendAdditionalParametersForSave($aParams);
     $oLinks->assign($aParams);
     $oLinks->save();
     $this->setEditObjectId($oLinks->getId());
 }
예제 #24
0
 /**
  * Saves changed usergroup parameters.
  *
  * @return mixed
  */
 public function save()
 {
     parent::save();
     $soxId = $this->getEditObjectId();
     $aParams = oxRegistry::getConfig()->getRequestParameter("editval");
     // checkbox handling
     if (!isset($aParams['oxgroups__oxactive'])) {
         $aParams['oxgroups__oxactive'] = 0;
     }
     $oGroup = oxNew("oxgroups");
     if ($soxId != "-1") {
         $oGroup->load($soxId);
     } else {
         $aParams['oxgroups__oxid'] = null;
     }
     $oGroup->setLanguage(0);
     $oGroup->assign($aParams);
     $oGroup->setLanguage($this->_iEditLang);
     $oGroup->save();
     // set oxid if inserted
     $this->setEditObjectId($oGroup->getId());
 }
 /**
  * Saves guestbook record changes.
  *
  * @return null
  */
 public function save()
 {
     parent::save();
     $soxId = $this->getEditObjectId();
     $aParams = oxConfig::getParameter("editval");
     // checkbox handling
     if (!isset($aParams['oxgbentries__oxactive'])) {
         $aParams['oxgbentries__oxactive'] = 0;
     }
     // shopid
     $aParams['oxgbentries__oxshopid'] = oxSession::getVar("actshop");
     $oLinks = oxNew("oxgbentry");
     if ($soxId != "-1") {
         $oLinks->load($soxId);
     } else {
         $aParams['oxgbentries__oxid'] = null;
         // author
         $aParams['oxgbentries__oxuserid'] = oxSession::getVar('auth');
     }
     $oLinks->assign($aParams);
     $oLinks->save();
     $this->setEditObjectId($oLinks->getId());
 }
예제 #26
0
 /**
  * Saves selection list parameters changes.
  *
  * @return mixed
  */
 public function save()
 {
     parent::save();
     $soxId = $this->getEditObjectId();
     $aParams = oxRegistry::getConfig()->getRequestParameter("editval");
     if (!isset($aParams['oxcountry__oxactive'])) {
         $aParams['oxcountry__oxactive'] = 0;
     }
     $oCountry = oxNew("oxcountry");
     if ($soxId != "-1") {
         $oCountry->loadInLang($this->_iEditLang, $soxId);
     } else {
         $aParams['oxcountry__oxid'] = null;
     }
     //$aParams = $oCountry->ConvertNameArray2Idx( $aParams);
     $oCountry->setLanguage(0);
     $oCountry->assign($aParams);
     $oCountry->setLanguage($this->_iEditLang);
     $oCountry = oxRegistry::get("oxUtilsFile")->processFiles($oCountry);
     $oCountry->save();
     // set oxid if inserted
     $this->setEditObjectId($oCountry->getId());
 }
예제 #27
0
 /**
  * Saves article Inventori information changes.
  */
 public function save()
 {
     parent::save();
     $soxId = $this->getEditObjectId();
     $aParams = oxRegistry::getConfig()->getRequestParameter("editval");
     // shopid
     $sShopID = oxRegistry::getSession()->getVariable("actshop");
     $aParams['oxarticles__oxshopid'] = $sShopID;
     $oArticle = oxNew("oxarticle");
     $oArticle->loadInLang($this->_iEditLang, $soxId);
     $oArticle->setLanguage(0);
     // checkbox handling
     if (!$oArticle->oxarticles__oxparentid->value && !isset($aParams['oxarticles__oxremindactive'])) {
         $aParams['oxarticles__oxremindactive'] = 0;
     }
     $oArticle->assign($aParams);
     //tells to article to save in different language
     $oArticle->setLanguage($this->_iEditLang);
     $oArticle = oxRegistry::get("oxUtilsFile")->processFiles($oArticle);
     $oArticle->resetRemindStatus();
     $oArticle->updateVariantsRemind();
     $oArticle->save();
 }
예제 #28
0
 /**
  * Saves news text.
  *
  * @return mixed
  */
 public function save()
 {
     parent::save();
     $myConfig = $this->getConfig();
     $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;
     }
     //$aParams = $oNews->ConvertNameArray2Idx( $aParams);
     $oNews->setLanguage(0);
     $oNews->assign($aParams);
     $oNews->setLanguage($iNewsLang);
     $oNews->save();
     // set oxid if inserted
     $this->setEditObjectId($oNews->getId());
 }
예제 #29
0
 /**
  * Saves selection list parameters changes.
  *
  * @return mixed
  */
 public function save()
 {
     parent::save();
     $soxId = $this->getEditObjectId();
     $aParams = oxConfig::getParameter("editval");
     if (!isset($aParams['oxvendor__oxactive'])) {
         $aParams['oxvendor__oxactive'] = 0;
     }
     // shopid
     $aParams['oxvendor__oxshopid'] = oxSession::getVar("actshop");
     $oVendor = oxNew("oxvendor");
     if ($soxId != "-1") {
         $oVendor->loadInLang($this->_iEditLang, $soxId);
     } else {
         $aParams['oxvendor__oxid'] = null;
     }
     $oVendor->setLanguage(0);
     $oVendor->assign($aParams);
     $oVendor->setLanguage($this->_iEditLang);
     $oVendor = oxUtilsFile::getInstance()->processFiles($oVendor);
     $oVendor->save();
     // set oxid if inserted
     $this->setEditObjectId($oVendor->getId());
 }
예제 #30
0
 /**
  * Saves (uploads) pictures to server.
  *
  * @return mixed
  */
 public function save()
 {
     $myConfig = $this->getConfig();
     if ($myConfig->isDemoShop()) {
         // disabling uploading pictures if this is demo shop
         $oEx = oxNew("oxExceptionToDisplay");
         $oEx->setMessage('ARTICLE_PICTURES_UPLOADISDISABLED');
         oxRegistry::get("oxUtilsView")->addErrorToDisplay($oEx, false);
         return;
     }
     parent::save();
     $oArticle = oxNew("oxArticle");
     if ($oArticle->load($this->getEditObjectId())) {
         $oArticle->assign(oxRegistry::getConfig()->getRequestParameter("editval"));
         oxRegistry::get("oxUtilsFile")->processFiles($oArticle);
         // Show that no new image added
         if (oxRegistry::get("oxUtilsFile")->getNewFilesCounter() == 0) {
             $oEx = oxNew("oxExceptionToDisplay");
             $oEx->setMessage('NO_PICTURES_CHANGES');
             oxRegistry::get("oxUtilsView")->addErrorToDisplay($oEx, false);
         }
         $oArticle->save();
     }
 }