22 array(
'oxartnum',
'oxarticles', 1, 0, 0),
23 array(
'oxtitle',
'oxarticles', 1, 1, 0),
24 array(
'oxean',
'oxarticles', 1, 0, 0),
25 array(
'oxmpn',
'oxarticles', 0, 0, 0),
26 array(
'oxprice',
'oxarticles', 0, 0, 0),
27 array(
'oxstock',
'oxarticles', 0, 0, 0),
28 array(
'oxid',
'oxarticles', 0, 0, 1)
30 'container2' => array(
31 array(
'oxartnum',
'oxarticles', 1, 0, 0),
32 array(
'oxtitle',
'oxarticles', 1, 1, 0),
33 array(
'oxean',
'oxarticles', 1, 0, 0),
34 array(
'oxmpn',
'oxarticles', 0, 0, 0),
35 array(
'oxprice',
'oxarticles', 0, 0, 0),
36 array(
'oxstock',
'oxarticles', 0, 0, 0),
37 array(
'oxid',
'oxobject2discount', 0, 0, 1)
54 $sOxid = $oConfig->getRequestParameter(
'oxid');
55 $sSynchOxid = $oConfig->getRequestParameter(
'synchoxid');
58 if (!$sOxid && $sSynchOxid) {
59 $sQAdd =
" from $sArticleTable where 1 ";
60 $sQAdd .= $oConfig->getConfigParam(
'blVariantsSelection') ?
'' :
"and $sArticleTable.oxparentid = '' ";
63 if ($sSynchOxid && $sOxid != $sSynchOxid) {
64 $sQAdd =
" from $sO2CView left join $sArticleTable on ";
65 $sQAdd .= $oConfig->getConfigParam(
'blVariantsSelection') ?
"($sArticleTable.oxid=$sO2CView.oxobjectid or $sArticleTable.oxparentid=$sO2CView.oxobjectid)" :
" $sArticleTable.oxid=$sO2CView.oxobjectid ";
66 $sQAdd .=
" where $sO2CView.oxcatnid = " . $oDb->quote($sOxid) .
" and $sArticleTable.oxid is not null ";
71 $sQAdd =
" from oxobject2discount, $sArticleTable where $sArticleTable.oxid=oxobject2discount.oxobjectid ";
72 $sQAdd .=
" and oxobject2discount.oxdiscountid = " . $oDb->quote($sOxid) .
" and oxobject2discount.oxtype = 'oxarticles' ";
76 if ($sSynchOxid && $sSynchOxid != $sOxid) {
78 $sSubSelect .=
" select $sArticleTable.oxid from oxobject2discount, $sArticleTable where $sArticleTable.oxid=oxobject2discount.oxobjectid ";
79 $sSubSelect .=
" and oxobject2discount.oxdiscountid = " . $oDb->quote($sSynchOxid) .
" and oxobject2discount.oxtype = 'oxarticles' ";
81 if (stristr($sQAdd,
'where') ===
false) {
86 $sQAdd .=
" $sArticleTable.oxid not in ( $sSubSelect ) ";
100 if ($this->
getConfig()->getRequestParameter(
'all')) {
105 } elseif (is_array($aChosenArt)) {
106 $sQ =
"delete from oxobject2discount where oxobject2discount.oxid in (" . implode(
", ",
oxDb::getInstance()->quoteArray($aChosenArt)) .
") ";
118 $soxId = $oConfig->getRequestParameter(
'synchoxid');
122 if ($oConfig->getRequestParameter(
'all')) {
124 $aChosenArt = $this->
_getAll(parent::_addFilter(
"select $sArticleTable.oxid " . $this->
_getQuery()));
126 if ($soxId && $soxId !=
"-1" && is_array($aChosenArt)) {
127 foreach ($aChosenArt as $sChosenArt) {
128 $oObject2Discount =
oxNew(
"oxbase");
129 $oObject2Discount->init(
'oxobject2discount');
130 $oObject2Discount->oxobject2discount__oxdiscountid =
new oxField($soxId);
131 $oObject2Discount->oxobject2discount__oxobjectid =
new oxField($sChosenArt);
132 $oObject2Discount->oxobject2discount__oxtype =
new oxField(
"oxarticles");
133 $oObject2Discount->save();