21 array(
'oxartnum',
'oxarticles', 1, 0, 0 ),
22 array(
'oxtitle',
'oxarticles', 1, 1, 0 ),
23 array(
'oxean',
'oxarticles', 1, 0, 0 ),
24 array(
'oxmpn',
'oxarticles', 0, 0, 0 ),
25 array(
'oxprice',
'oxarticles', 0, 0, 0 ),
26 array(
'oxstock',
'oxarticles', 0, 0, 0 ),
27 array(
'oxid',
'oxarticles', 0, 0, 1 )
29 'container2' => array(
30 array(
'oxartnum',
'oxarticles', 1, 0, 0 ),
31 array(
'oxsort',
'oxactions2article', 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',
'oxactions2article', 0, 0, 1 )
60 $sQAdd =
" from $sArtTable where 1 ";
61 $sQAdd .=
$myConfig->getConfigParam(
'blVariantsSelection')?
'':
" and $sArtTable.oxparentid = '' ";
64 if ( $sSynchSelId && $sSelId != $sSynchSelId ) {
66 $sQAdd =
" from $sO2CView left join $sArtTable on ";
67 $sQAdd .=
$myConfig->getConfigParam(
'blVariantsSelection' )?
" ( $sArtTable.oxid=$sO2CView.oxobjectid or $sArtTable.oxparentid=$sO2CView.oxobjectid) ":
" $sArtTable.oxid=$sO2CView.oxobjectid ";
68 $sQAdd .=
" where $sO2CView.oxcatnid = ".$oDb->quote( $sSelId );
71 $sQAdd =
" from $sArtTable left join oxactions2article on $sArtTable.oxid=oxactions2article.oxartid ";
72 $sQAdd .=
" where oxactions2article.oxactionid = ".$oDb->quote( $sSelId ).
" and oxactions2article.oxshopid = '".
$myConfig->getShopID().
"' ";
76 if ( $sSynchSelId && $sSynchSelId != $sSelId ) {
77 $sQAdd .=
" and $sArtTable.oxid not in ( select oxactions2article.oxartid from oxactions2article ";
78 $sQAdd .=
" where oxactions2article.oxactionid = ".$oDb->quote( $sSynchSelId ).
" and oxactions2article.oxshopid = '".
$myConfig->getShopID().
"' ) ";
96 if ( $this->
getConfig()->getConfigParam(
'blVariantsSelection' ) ) {
97 $sQ .=
' group by '.$this->_getViewName(
'oxarticles' ).
'.oxid ';
100 if ( $oStr->strpos( $sQ,
"select count( * ) " ) === 0 ) {
101 $sQ =
"select count( * ) from ( {$sQ} ) as _cnttable";
115 return 'order by oxactions2article.oxsort ';
126 $aChosenArt = $this->
_getActionIds(
'oxactions2article.oxid' );
131 } elseif ( is_array( $aChosenArt ) ) {
132 $sQ =
"delete from oxactions2article where oxactions2article.oxid in (" . implode(
", ",
oxDb::getInstance()->quoteArray( $aChosenArt ) ) .
") ";
155 $sQ =
"select max(oxactions2article.oxsort) from oxactions2article join $sArtTable on $sArtTable.oxid=oxactions2article.oxartid
156 where oxactions2article.oxactionid = ".$oDb->quote( $soxId ).
" and oxactions2article.oxshopid = '".
$myConfig->getShopId().
"'
157 and $sArtTable.oxid is not null";
158 $iSort = ( (int) $oDb->getOne( $sQ,
false,
false ) ) + 1;
160 if ( $soxId && $soxId !=
"-1" && is_array( $aArticles ) ) {
162 foreach ( $aArticles as $sAdd ) {
163 $oNewGroup =
oxNew(
'oxbase' );
164 $oNewGroup->init(
'oxactions2article' );
165 $oNewGroup->oxactions2article__oxshopid =
new oxField( $sShopId );
166 $oNewGroup->oxactions2article__oxactionid =
new oxField( $soxId );
167 $oNewGroup->oxactions2article__oxartid =
new oxField( $sAdd );
168 $oNewGroup->oxactions2article__oxsort =
new oxField( $iSort++ );
184 $sSelect =
"select * from $sArtTable left join oxactions2article on $sArtTable.oxid=oxactions2article.oxartid ";
185 $sSelect .=
"where oxactions2article.oxactionid = " .
oxDb::getDb()->quote( $sSelId ) .
" and oxactions2article.oxshopid = '".$myConfig->getShopID().
"' ".$this->
_getSorting();
187 $oList =
oxNew(
"oxlist" );
188 $oList->init(
"oxbase",
"oxactions2article" );
189 $oList->selectString( $sSelect );
194 foreach ( $oList as $sKey => $oSel ) {
195 if ( $oSel->oxactions2article__oxsort->value != $iSelCnt ) {
196 $oSel->oxactions2article__oxsort->setValue($iSelCnt);
201 $aIdx2Id[$iSelCnt] = $sKey;
208 if ( isset( $aIdx2Id[$iDir] ) ) {
211 $oDir1 = $oList->offsetGet( $aIdx2Id[$iDir] );
212 $oDir2 = $oList->offsetGet( $aIdx2Id[$iKey] );
214 $iCopy = $oDir1->oxactions2article__oxsort->value;
215 $oDir1->oxactions2article__oxsort->setValue($oDir2->oxactions2article__oxsort->value);
216 $oDir2->oxactions2article__oxsort->setValue($iCopy);
226 $sCountQ =
'select count( * ) ' . $sQAdd;