14 array(
'oxtitle',
'oxcountry', 1, 1, 0 ),
15 array(
'oxisoalpha2',
'oxcountry', 1, 0, 0 ),
16 array(
'oxisoalpha3',
'oxcountry', 0, 0, 0 ),
17 array(
'oxunnum3',
'oxcountry', 0, 0, 0 ),
18 array(
'oxid',
'oxcountry', 0, 0, 1 )
20 'container2' => array(
21 array(
'oxtitle',
'oxcountry', 1, 1, 0 ),
22 array(
'oxisoalpha2',
'oxcountry', 1, 0, 0 ),
23 array(
'oxisoalpha3',
'oxcountry', 0, 0, 0 ),
24 array(
'oxunnum3',
'oxcountry', 0, 0, 0 ),
25 array(
'oxid',
'oxobject2discount', 0, 0, 1 )
39 $sId = $oConfig->getRequestParameter(
'oxid' );
40 $sSynchId = $oConfig->getRequestParameter(
'synchoxid' );
44 $sQAdd =
" from $sCountryTable where $sCountryTable.oxactive = '1' ";
46 $sQAdd =
" from oxobject2discount, $sCountryTable where $sCountryTable.oxid=oxobject2discount.oxobjectid ";
47 $sQAdd .=
"and oxobject2discount.oxdiscountid = ".$oDb->quote( $sId ).
" and oxobject2discount.oxtype = 'oxcountry' ";
50 if ( $sSynchId && $sSynchId != $sId) {
51 $sQAdd .=
"and $sCountryTable.oxid not in ( select $sCountryTable.oxid from oxobject2discount, $sCountryTable where $sCountryTable.oxid=oxobject2discount.oxobjectid ";
52 $sQAdd .=
"and oxobject2discount.oxdiscountid = ".$oDb->quote( $sSynchId ).
" and oxobject2discount.oxtype = 'oxcountry' ) ";
67 $aChosenCntr = $this->
_getActionIds(
'oxobject2discount.oxid' );
68 if ( $oConfig->getRequestParameter(
'all' ) ) {
73 } elseif ( is_array( $aChosenCntr ) ) {
74 $sQ =
"delete from oxobject2discount where oxobject2discount.oxid in (" . implode(
", ",
oxDb::getInstance()->quoteArray( $aChosenCntr ) ) .
") ";
88 $soxId = $oConfig->getRequestParameter(
'synchoxid');
91 if ( $oConfig->getRequestParameter(
'all' ) ) {
95 if ( $soxId && $soxId !=
"-1" && is_array( $aChosenCntr ) ) {
96 foreach ( $aChosenCntr as $sChosenCntr) {
97 $oObject2Discount =
oxNew(
"oxbase" );
98 $oObject2Discount->init(
'oxobject2discount' );
99 $oObject2Discount->oxobject2discount__oxdiscountid =
new oxField($soxId);
100 $oObject2Discount->oxobject2discount__oxobjectid =
new oxField($sChosenCntr);
101 $oObject2Discount->oxobject2discount__oxtype =
new oxField(
"oxcountry");
102 $oObject2Discount->save();