14 array(
'oxtitle',
'oxgroups', 1, 0, 0 ),
15 array(
'oxid',
'oxgroups', 0, 0, 0 ),
16 array(
'oxid',
'oxgroups', 0, 0, 1 ),
18 'container2' => array(
19 array(
'oxtitle',
'oxgroups', 1, 0, 0 ),
20 array(
'oxid',
'oxgroups', 0, 0, 0 ),
21 array(
'oxid',
'oxobject2discount', 0, 0, 1 ),
36 $sId = $oConfig->getRequestParameter(
'oxid' );
37 $sSynchId = $oConfig->getRequestParameter(
'synchoxid' );
41 $sQAdd =
" from $sGroupTable where 1 ";
43 $sQAdd .=
" from oxobject2discount, $sGroupTable where $sGroupTable.oxid=oxobject2discount.oxobjectid ";
44 $sQAdd .=
" and oxobject2discount.oxdiscountid = ".$oDb->quote( $sId ).
" and oxobject2discount.oxtype = 'oxgroups' ";
47 if ( $sSynchId && $sSynchId != $sId) {
48 $sQAdd .=
" and $sGroupTable.oxid not in ( select $sGroupTable.oxid from oxobject2discount, $sGroupTable where $sGroupTable.oxid=oxobject2discount.oxobjectid ";
49 $sQAdd .=
" and oxobject2discount.oxdiscountid = ".$oDb->quote( $sSynchId ).
" and oxobject2discount.oxtype = 'oxgroups' ) ";
64 $aRemoveGroups = $this->
_getActionIds(
'oxobject2discount.oxid' );
65 if ( $oConfig->getRequestParameter(
'all' ) ) {
70 } elseif ( $aRemoveGroups && is_array( $aRemoveGroups ) ) {
71 $sQ =
"delete from oxobject2discount where oxobject2discount.oxid in (" . implode(
", ",
oxDb::getInstance()->quoteArray( $aRemoveGroups ) ) .
") ";
85 $soxId = $oConfig->getRequestParameter(
'synchoxid' );
88 if ( $oConfig->getRequestParameter(
'all' ) ) {
92 if ( $soxId && $soxId !=
"-1" && is_array( $aChosenCat ) ) {
93 foreach ( $aChosenCat as $sChosenCat) {
94 $oObject2Discount =
oxNew(
"oxbase" );
95 $oObject2Discount->init(
'oxobject2discount' );
96 $oObject2Discount->oxobject2discount__oxdiscountid =
new oxField($soxId);
97 $oObject2Discount->oxobject2discount__oxobjectid =
new oxField($sChosenCat);
98 $oObject2Discount->oxobject2discount__oxtype =
new oxField(
"oxgroups");
99 $oObject2Discount->save();