24 $iLang = $oLang->getTplLanguage();
27 unset( $this->_aViewData[
"sumtype"][2]);
31 $oType =
new stdClass();
33 $oType->sDesc = $oLang->translateString(
"amount", $iLang );
34 $aDelTypes[
'a'] = $oType;
35 $oType =
new stdClass();
37 $oType->sDesc = $oLang->translateString(
"size", $iLang );
38 $aDelTypes[
's'] = $oType;
39 $oType =
new stdClass();
41 $oType->sDesc = $oLang->translateString(
"weight", $iLang );
42 $aDelTypes[
'w'] = $oType;
43 $oType =
new stdClass();
45 $oType->sDesc = $oLang->translateString(
"price", $iLang );
46 $aDelTypes[
'p'] = $oType;
49 if ( $soxId !=
"-1" && isset( $soxId)) {
51 $oDelivery =
oxNew(
"oxdelivery" );
52 $oDelivery->loadInLang( $this->_iEditLang, $soxId );
54 $oOtherLang = $oDelivery->getAvailableInLangs();
55 if (!isset($oOtherLang[$this->_iEditLang])) {
57 $oDelivery->loadInLang( key($oOtherLang), $soxId );
60 $this->_aViewData[
"edit"] = $oDelivery;
64 $aLang = array_diff ( $oLang->getLanguageNames(), $oOtherLang);
66 $this->_aViewData[
"posslang"] =
$aLang;
68 foreach ( $oOtherLang as $id => $language) {
69 $oLang=
new stdClass();
70 $oLang->sLangDesc = $language;
72 $this->_aViewData[
"otherlang"][$id] = clone $oLang;
76 if ( !$oDelivery->oxdelivery__oxdeltype->value ) {
77 $oDelivery->oxdelivery__oxdeltype =
new oxField(
"a");
79 $aDelTypes[$oDelivery->oxdelivery__oxdeltype->value]->selected =
true;
82 $this->_aViewData[
"deltypes"] = $aDelTypes;
85 $oDeliveryMainAjax =
oxNew(
'delivery_main_ajax' );
86 $this->_aViewData[
'oxajax'] = $oDeliveryMainAjax->getColumns();
88 return "popups/delivery_main.tpl";
90 return "delivery_main.tpl";
107 $aParams[
'oxdelivery__oxshopid'] = $sShopID;
109 $oDelivery =
oxNew(
"oxdelivery" );
111 if ( $soxId !=
"-1") {
112 $oDelivery->loadInLang( $this->_iEditLang, $soxId );
114 $aParams[
'oxdelivery__oxid'] = null;
118 if ( !isset( $aParams[
'oxdelivery__oxactive']))
119 $aParams[
'oxdelivery__oxactive'] = 0;
120 if ( !isset( $aParams[
'oxdelivery__oxfixed']))
121 $aParams[
'oxdelivery__oxfixed'] = 0;
122 if ( !isset( $aParams[
'oxdelivery__oxfinalize']))
123 $aParams[
'oxdelivery__oxfinalize'] = 0;
124 if ( !isset( $aParams[
'oxdelivery__oxsort']))
125 $aParams[
'oxdelivery__oxsort'] = 9999;
128 $oDelivery->setLanguage(0);
129 $oDelivery->assign( $aParams );
130 $oDelivery->setLanguage($this->_iEditLang);
131 $oDelivery =
oxRegistry::get(
"oxUtilsFile")->processFiles( $oDelivery );
150 $aParams[
'oxdelivery__oxshopid'] = $sShopID;
152 $oDelivery =
oxNew(
"oxdelivery" );
154 if ( $soxId !=
"-1") {
155 $oDelivery->loadInLang( $this->_iEditLang, $soxId );
157 $aParams[
'oxdelivery__oxid'] = null;
161 if ( !isset( $aParams[
'oxdelivery__oxactive'])) {
162 $aParams[
'oxdelivery__oxactive'] = 0;
164 if ( !isset( $aParams[
'oxdelivery__oxfixed'])) {
165 $aParams[
'oxdelivery__oxfixed'] = 0;
169 $oDelivery->setLanguage(0);
170 $oDelivery->assign( $aParams);
171 $oDelivery->setLanguage($this->_iEditLang);
172 $oDelivery =
oxRegistry::get(
"oxUtilsFile")->processFiles( $oDelivery );