article_bundle.inc.php

Go to the documentation of this file.
00001 <?php
00002 
00003 $aColumns = array( 'container1' => array(    // field , table,         visible, multilanguage, ident
00004                                         array( 'oxartnum', 'oxarticles', 1, 0, 0 ),
00005                                         array( 'oxtitle',  'oxarticles', 1, 1, 0 ),
00006                                         array( 'oxean',    'oxarticles', 1, 0, 0 ),
00007                                         array( 'oxprice',  'oxarticles', 0, 0, 0 ),
00008                                         array( 'oxstock',  'oxarticles', 0, 0, 0 ),
00009                                         array( 'oxid',     'oxarticles', 0, 0, 1 )
00010                                         )
00011                     );
00015 class ajaxComponent extends ajaxListComponent
00016 {
00022     protected function _getQuery()
00023     {
00024         $myConfig      = $this->getConfig();
00025         $sArticleTable = getViewName( 'oxarticles' );
00026         $sO2CView      = getViewName( 'oxobject2category' );
00027 
00028         $sSelId      = oxConfig::getParameter( 'oxid' );
00029         $sSynchSelId = oxConfig::getParameter( 'synchoxid' );
00030 
00031         // category selected or not ?
00032         if ( !$sSelId ) {
00033             $sQAdd  = " from $sArticleTable where 1 ";
00034             $sQAdd .= $myConfig->getConfigParam( 'blVariantsSelection' )?'':" and $sArticleTable.oxparentid = '' ";
00035         } else {
00036             // selected category ?
00037             if ( $sSynchSelId ) {
00038                 $sQAdd  = " from $sO2CView as oxobject2category left join $sArticleTable on ";
00039                 $sQAdd .= $myConfig->getConfigParam( 'blVariantsSelection' )?" ($sArticleTable.oxid=oxobject2category.oxobjectid or $sArticleTable.oxparentid=oxobject2category.oxobjectid)":" $sArticleTable.oxid=oxobject2category.oxobjectid ";
00040                 $sQAdd .= " where oxobject2category.oxcatnid = '$sSelId' ";
00041             }
00042         }
00043         // #1513C/#1826C - skip references, to not existing articles
00044         $sQAdd .= " and $sArticleTable.oxid IS NOT NULL ";
00045 
00046         // skipping self from list
00047         $sQAdd .= " and $sArticleTable.oxid != '". $sSynchSelId ."' ";
00048 
00049         return $sQAdd;
00050     }
00051 
00057     public function removearticlebundle()
00058     {
00059         $aChosenArt = oxConfig::getParameter( 'oxid');
00060 
00061         $sQ = "update oxarticles set oxarticles.oxbundleid = '' where oxarticles.oxid  = '" . $aChosenArt . "' ";
00062         oxDb::getDb()->Execute( $sQ );
00063     }
00064 
00070     public function addarticlebundle()
00071     {
00072         $sChosenArt = oxConfig::getParameter( 'oxbundleid' );
00073         $soxId      = oxConfig::getParameter( 'oxid' );
00074 
00075         $sQ = "update oxarticles set oxarticles.oxbundleid = '" . $sChosenArt . "' where oxarticles.oxid  = '" . $soxId . "' ";
00076         oxDb::getDb()->Execute( $sQ );
00077     }
00078 
00079 }

Generated on Wed May 13 13:25:50 2009 for OXID eShop CE by  doxygen 1.5.5