17 array(
'oxtitle',
'oxgroups', 1, 0, 0),
18 array(
'oxid',
'oxgroups', 0, 0, 0),
19 array(
'oxid',
'oxgroups', 0, 0, 1),
21 'container2' => array(
22 array(
'oxtitle',
'oxgroups', 1, 0, 0),
23 array(
'oxid',
'oxgroups', 0, 0, 0),
24 array(
'oxid',
'oxobject2group', 0, 0, 1),
38 $sDiscountId = $this->
getConfig()->getRequestParameter(
'oxid');
39 $sSynchDiscountId = $this->
getConfig()->getRequestParameter(
'synchoxid');
43 $sQAdd =
" from $sGroupTable where 1 ";
45 $sQAdd =
" from oxobject2group left join $sGroupTable on oxobject2group.oxgroupsid=$sGroupTable.oxid ";
46 $sQAdd .=
" where oxobject2group.oxobjectid = " . $oDb->quote($sDiscountId);
49 if ($sSynchDiscountId && $sSynchDiscountId != $sDiscountId) {
50 $sQAdd .=
' and ' . $sGroupTable .
'.oxid not in ( select ' . $sGroupTable .
'.oxid from oxobject2group left join ' . $sGroupTable .
' on oxobject2group.oxgroupsid=' . $sGroupTable .
'.oxid ';
51 $sQAdd .=
" where oxobject2group.oxobjectid = " . $oDb->quote($sSynchDiscountId) .
" ) ";
63 if ($this->
getConfig()->getRequestParameter(
'all')) {
68 } elseif ($aRemoveGroups && is_array($aRemoveGroups)) {
69 $sQ =
"delete from oxobject2group where oxobject2group.oxid in (" . implode(
", ",
oxDb::getInstance()->quoteArray($aRemoveGroups)) .
") ";
80 $soxId = $this->
getConfig()->getRequestParameter(
'synchoxid');
82 if ($this->
getConfig()->getRequestParameter(
'all')) {
86 if ($soxId && $soxId !=
"-1" && is_array($aAddGroups)) {
87 foreach ($aAddGroups as $sAddgroup) {
88 $oNewGroup =
oxNew(
"oxobject2group");
89 $oNewGroup->oxobject2group__oxobjectid =
new oxField($soxId);
90 $oNewGroup->oxobject2group__oxgroupsid =
new oxField($sAddgroup);