14 array(
'oxartnum',
'oxarticles', 1, 0, 0 ),
15 array(
'oxtitle',
'oxarticles', 1, 1, 0 ),
16 array(
'oxpos',
'oxobject2category', 1, 0, 0 ),
17 array(
'oxean',
'oxarticles', 0, 0, 0 ),
18 array(
'oxmpn',
'oxarticles', 0, 0, 0 ),
19 array(
'oxprice',
'oxarticles', 0, 0, 0 ),
20 array(
'oxstock',
'oxarticles', 0, 0, 0 ),
21 array(
'oxid',
'oxarticles', 0, 0, 1 )
23 'container2' => array(
24 array(
'oxartnum',
'oxarticles', 1, 0, 0 ),
25 array(
'oxtitle',
'oxarticles', 1, 1, 0 ),
26 array(
'oxean',
'oxarticles', 0, 0, 0 ),
27 array(
'oxmpn',
'oxarticles', 0, 0, 0 ),
28 array(
'oxprice',
'oxarticles', 0, 0, 0 ),
29 array(
'oxstock',
'oxarticles', 0, 0, 0 ),
30 array(
'oxid',
'oxarticles', 0, 0, 1 )
48 $sQAdd =
" from $sArtTable left join $sO2CView on $sArtTable.oxid=$sO2CView.oxobjectid where $sO2CView.oxcatnid = ".$oDb->quote( $sSynchOxid );
50 $sQAdd .=
" and $sArtTable.oxid not in ( ".implode(
", ",
oxDb::getInstance()->quoteArray( $aSkipArt ) ).
" ) ";
54 $sQAdd =
" from $sArtTable where ";
56 $sQAdd .=
" $sArtTable.oxid in ( ".implode(
", ",
oxDb::getInstance()->quoteArray( $aSkipArt ) ).
" ) ";
79 foreach ( $aSkipArt as $sId ) {
80 $sOrderBy =
" $sArtTable.oxid=" .
oxDb::getDb()->quote( $sId ) .
" ".$sSep.$sOrderBy;
83 $sOrder =
"order by ".$sOrderBy;
100 if ( is_array( $aRemoveArt ) && is_array( $aSkipArt ) ) {
101 foreach ( $aRemoveArt as $sRem ) {
102 if ( ( $iKey = array_search( $sRem, $aSkipArt ) ) !==
false ) {
103 unset( $aSkipArt[$iKey] );
112 $sSelect =
"select 1 from $sArticleTable left join $sO2CView on $sArticleTable.oxid=$sO2CView.oxobjectid ";
113 $sSelect .=
"where $sO2CView.oxcatnid = '$soxId' and $sArticleTable.oxparentid = '' and $sArticleTable.oxid ";
114 $sSelect .=
"not in ( ".implode(
", ",
oxDb::getInstance()->quoteArray( $aSkipArt ) ).
" ) ";
117 echo (
int)
oxDb::getDb()->getOne( $sSelect,
false,
false );
132 if ( !is_array( $aOrdArt ) )
137 if ( is_array( $aAddArticle ) ) {
139 foreach ($aAddArticle as $sAdd) {
140 if ( array_search( $sAdd, $aOrdArt ) ===
false )
149 $sSelect =
"select 1 from $sArticleTable left join $sO2CView on $sArticleTable.oxid=$sO2CView.oxobjectid ";
150 $sSelect .=
"where $sO2CView.oxcatnid = '$soxId' and $sArticleTable.oxparentid = '' and $sArticleTable.oxid ";
151 $sSelect .=
"not in ( ".implode(
", ",
oxDb::getInstance()->quoteArray( $aOrdArt ) ).
" ) ";
154 echo (
int)
oxDb::getDb()->getOne( $sSelect,
false,
false );
165 $oCategory =
oxNew(
"oxcategory" );
167 if ( $oCategory->load( $sId ) ) {
171 if ( is_array( $aNewOrder ) && count( $aNewOrder ) ) {
173 $sSelect =
"select * from $sO2CView where $sO2CView.oxcatnid='".$oCategory->getId().
"' and $sO2CView.oxobjectid in (".implode(
", ",
oxDb::getInstance()->quoteArray( $aNewOrder ) ).
" )";
174 $oList =
oxNew(
"oxlist" );
175 $oList->init(
"oxbase",
"oxobject2category" );
176 $oList->selectString( $sSelect );
179 foreach ( $oList as $oObj ) {
180 if ( ( $iNewPos = array_search( $oObj->oxobject2category__oxobjectid->value, $aNewOrder ) ) !==
false ) {
181 $oObj->oxobject2category__oxpos->setValue($iNewPos);
200 $oCategory =
oxNew(
"oxcategory" );
202 if ( $oCategory->load( $sId ) ) {
206 $sSelect =
"update oxobject2category set oxpos = '0' where oxobject2category.oxcatnid=" . $oDb->quote( $oCategory->getId() );
207 $oDb->execute( $sSelect );