15 array(
'oxtitle',
'oxcountry', 1, 1, 0),
16 array(
'oxisoalpha2',
'oxcountry', 1, 0, 0),
17 array(
'oxisoalpha3',
'oxcountry', 0, 0, 0),
18 array(
'oxunnum3',
'oxcountry', 0, 0, 0),
19 array(
'oxid',
'oxcountry', 0, 0, 1)
21 'container2' => array(
22 array(
'oxtitle',
'oxcountry', 1, 1, 0),
23 array(
'oxisoalpha2',
'oxcountry', 1, 0, 0),
24 array(
'oxisoalpha3',
'oxcountry', 0, 0, 0),
25 array(
'oxunnum3',
'oxcountry', 0, 0, 0),
26 array(
'oxid',
'oxobject2discount', 0, 0, 1)
40 $sId = $oConfig->getRequestParameter(
'oxid');
41 $sSynchId = $oConfig->getRequestParameter(
'synchoxid');
45 $sQAdd =
" from $sCountryTable where $sCountryTable.oxactive = '1' ";
47 $sQAdd =
" from oxobject2discount, $sCountryTable where $sCountryTable.oxid=oxobject2discount.oxobjectid ";
48 $sQAdd .=
"and oxobject2discount.oxdiscountid = " . $oDb->quote($sId) .
" and oxobject2discount.oxtype = 'oxcountry' ";
51 if ($sSynchId && $sSynchId != $sId) {
52 $sQAdd .=
"and $sCountryTable.oxid not in ( select $sCountryTable.oxid from oxobject2discount, $sCountryTable where $sCountryTable.oxid=oxobject2discount.oxobjectid ";
53 $sQAdd .=
"and oxobject2discount.oxdiscountid = " . $oDb->quote($sSynchId) .
" and oxobject2discount.oxtype = 'oxcountry' ) ";
66 $aChosenCntr = $this->
_getActionIds(
'oxobject2discount.oxid');
67 if ($oConfig->getRequestParameter(
'all')) {
72 } elseif (is_array($aChosenCntr)) {
73 $sQ =
"delete from oxobject2discount where oxobject2discount.oxid in (" . implode(
", ",
oxDb::getInstance()->quoteArray($aChosenCntr)) .
") ";
85 $soxId = $oConfig->getRequestParameter(
'synchoxid');
88 if ($oConfig->getRequestParameter(
'all')) {
92 if ($soxId && $soxId !=
"-1" && is_array($aChosenCntr)) {
93 foreach ($aChosenCntr as $sChosenCntr) {
94 $oObject2Discount =
oxNew(
"oxbase");
95 $oObject2Discount->init(
'oxobject2discount');
96 $oObject2Discount->oxobject2discount__oxdiscountid =
new oxField($soxId);
97 $oObject2Discount->oxobject2discount__oxobjectid =
new oxField($sChosenCntr);
98 $oObject2Discount->oxobject2discount__oxtype =
new oxField(
"oxcountry");
99 $oObject2Discount->save();