14 array(
'oxtitle',
'oxcategories', 1, 1, 0 ),
15 array(
'oxdesc',
'oxcategories', 1, 1, 0 ),
16 array(
'oxid',
'oxcategories', 0, 0, 0 ),
17 array(
'oxid',
'oxcategories', 0, 0, 1 )
19 'container2' => array(
20 array(
'oxtitle',
'oxcategories', 1, 1, 0 ),
21 array(
'oxdesc',
'oxcategories', 1, 1, 0 ),
22 array(
'oxid',
'oxcategories', 0, 0, 0 ),
23 array(
'oxid',
'oxobject2discount', 0, 0, 1 ),
24 array(
'oxid',
'oxcategories', 0, 0, 1 )
37 $sId = $oConfig->getRequestParameter(
'oxid' );
38 $sSynchId = $oConfig->getRequestParameter(
'synchoxid' );
44 $sQAdd =
" from $sCategoryTable";
46 $sQAdd =
" from oxobject2discount, $sCategoryTable where $sCategoryTable.oxid=oxobject2discount.oxobjectid ";
47 $sQAdd .=
" and oxobject2discount.oxdiscountid = ".$oDb->quote( $sId ).
" and oxobject2discount.oxtype = 'oxcategories' ";
50 if ( $sSynchId && $sSynchId != $sId) {
52 $sSubSelect =
" select $sCategoryTable.oxid from oxobject2discount, $sCategoryTable where $sCategoryTable.oxid=oxobject2discount.oxobjectid ";
53 $sSubSelect .=
" and oxobject2discount.oxdiscountid = ".$oDb->quote( $sSynchId ).
" and oxobject2discount.oxtype = 'oxcategories' ";
54 if ( stristr( $sQAdd,
'where' ) ===
false )
58 $sQAdd .=
" $sCategoryTable.oxid not in ( $sSubSelect ) ";
72 $aChosenCat = $this->
_getActionIds(
'oxobject2discount.oxid' );
75 if ( $oConfig->getRequestParameter(
'all' ) ) {
80 } elseif ( is_array( $aChosenCat ) ) {
81 $sQ =
"delete from oxobject2discount where oxobject2discount.oxid in (" . implode(
", ",
oxDb::getInstance()->quoteArray( $aChosenCat ) ) .
") ";
95 $soxId = $oConfig->getRequestParameter(
'synchoxid');
98 if ( $oConfig->getRequestParameter(
'all' ) ) {
102 if ( $soxId && $soxId !=
"-1" && is_array( $aChosenCat ) ) {
103 foreach ( $aChosenCat as $sChosenCat) {
104 $oObject2Discount =
oxNew(
"oxbase" );
105 $oObject2Discount->init(
'oxobject2discount' );
106 $oObject2Discount->oxobject2discount__oxdiscountid =
new oxField($soxId);
107 $oObject2Discount->oxobject2discount__oxobjectid =
new oxField($sChosenCat);
108 $oObject2Discount->oxobject2discount__oxtype =
new oxField(
"oxcategories");
109 $oObject2Discount->save();