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(
'oxsort',
'oxactions2article', 1, 0, 0),
33 array(
'oxtitle',
'oxarticles', 1, 1, 0),
34 array(
'oxean',
'oxarticles', 1, 0, 0),
35 array(
'oxmpn',
'oxarticles', 0, 0, 0),
36 array(
'oxprice',
'oxarticles', 0, 0, 0),
37 array(
'oxstock',
'oxarticles', 0, 0, 0),
38 array(
'oxid',
'oxactions2article', 0, 0, 1)
61 $sQAdd =
" from $sArtTable where 1 ";
62 $sQAdd .=
$myConfig->getConfigParam(
'blVariantsSelection') ?
'' :
" and $sArtTable.oxparentid = '' ";
65 if ($sSynchSelId && $sSelId != $sSynchSelId) {
67 $sQAdd =
" from {$sView} left join $sArtTable on ";
68 $blVariantsSelectionParameter =
$myConfig->getConfigParam(
'blVariantsSelection');
69 $sSqlIfTrue =
" ( $sArtTable.oxid={$sView}.oxobjectid or $sArtTable.oxparentid={$sView}.oxobjectid) ";
70 $sSqlIfFalse =
" $sArtTable.oxid={$sView}.oxobjectid ";
71 $sQAdd .= $blVariantsSelectionParameter ? $sSqlIfTrue : $sSqlIfFalse;
72 $sQAdd .=
" where {$sView}.oxcatnid = " . $oDb->quote($sSelId);
75 $sQAdd =
" from {$sArtTable} left join oxactions2article " .
76 "on {$sArtTable}.oxid=oxactions2article.oxartid " .
77 " where oxactions2article.oxactionid = " . $oDb->quote($sSelId) .
78 " and oxactions2article.oxshopid = '" .
$myConfig->getShopID() .
"' ";
82 if ($sSynchSelId && $sSynchSelId != $sSelId) {
83 $sQAdd .=
" and {$sArtTable}.oxid not in ( select oxactions2article.oxartid from oxactions2article " .
84 " where oxactions2article.oxactionid = " . $oDb->quote($sSynchSelId) .
85 " and oxactions2article.oxshopid = '" .
$myConfig->getShopID() .
"' ) ";
103 if ($this->
getConfig()->getConfigParam(
'blVariantsSelection')) {
104 $sQ .=
' group by ' . $this->
_getViewName(
'oxarticles') .
'.oxid ';
107 if ($oStr->strpos($sQ,
"select count( * ) ") === 0) {
108 $sQ =
"select count( * ) from ( {$sQ} ) as _cnttable";
125 if ($sOxIdParameter && !$sSynchOxidParameter) {
126 return 'order by oxactions2article.oxsort ';
137 $aChosenArt = $this->
_getActionIds(
'oxactions2article.oxid');
142 } elseif (is_array($aChosenArt)) {
144 $sQ =
"delete from oxactions2article where oxactions2article.oxid in (" . $sChosenArticles .
") ";
165 $sQ =
"select max(oxactions2article.oxsort) from oxactions2article join {$sArtTable} " .
166 "on {$sArtTable}.oxid=oxactions2article.oxartid " .
167 "where oxactions2article.oxactionid = " . $oDb->quote($soxId) .
168 " and oxactions2article.oxshopid = '" .
$myConfig->getShopId() .
169 "'and $sArtTable.oxid is not null";
170 $iSort = ((int) $oDb->getOne($sQ,
false,
false)) + 1;
172 if ($soxId && $soxId !=
"-1" && is_array($aArticles)) {
174 foreach ($aArticles as $sAdd) {
175 $oNewGroup =
oxNew(
'oxbase');
176 $oNewGroup->init(
'oxactions2article');
177 $oNewGroup->oxactions2article__oxshopid =
new oxField($sShopId);
178 $oNewGroup->oxactions2article__oxactionid =
new oxField($soxId);
179 $oNewGroup->oxactions2article__oxartid =
new oxField($sAdd);
180 $oNewGroup->oxactions2article__oxsort =
new oxField($iSort++);
194 $sSelect =
"select * from $sArtTable left join oxactions2article on $sArtTable.oxid=oxactions2article.oxartid ";
195 $sSelect .=
"where oxactions2article.oxactionid = " .
oxDb::getDb()->quote($sSelId) .
198 $oList =
oxNew(
"oxlist");
199 $oList->init(
"oxbase",
"oxactions2article");
200 $oList->selectString($sSelect);
205 foreach ($oList as $sKey => $oSel) {
206 if ($oSel->oxactions2article__oxsort->value != $iSelCnt) {
207 $oSel->oxactions2article__oxsort->setValue($iSelCnt);
212 $aIdx2Id[$iSelCnt] = $sKey;
217 if (($iKey = array_search(
oxRegistry::getConfig()->getRequestParameter(
'sortoxid'), $aIdx2Id)) !==
false) {
218 $iDir = (
oxRegistry::getConfig()->getRequestParameter(
'direction') ==
'up') ? ($iKey - 1) : ($iKey + 1);
219 if (isset($aIdx2Id[$iDir])) {
222 $oDir1 = $oList->offsetGet($aIdx2Id[$iDir]);
223 $oDir2 = $oList->offsetGet($aIdx2Id[$iKey]);
225 $iCopy = $oDir1->oxactions2article__oxsort->value;
226 $oDir1->oxactions2article__oxsort->setValue($oDir2->oxactions2article__oxsort->value);
227 $oDir2->oxactions2article__oxsort->setValue($iCopy);
237 $sCountQ =
'select count( * ) ' . $sQAdd;