Beispiel #1
0
    function display($tmpl) {

        $model = $this->getModel('suggestions');

        $userProfile = BidsHelperTools::getUserProfileObject();

        $filter_bidtype = $model->getState('filters.filter_bidtype');
        $lists['filter_bidtype'] = JHTML::_('listauctions.selectBidType', $filter_bidtype );
        $sfilters['bid_type'] = $filter_bidtype;

        $gallery = BidsHelperGallery::getGalleryPlugin();

        $suggestions = $model->get('suggestions');
        $rownr = 0;
        foreach($suggestions as &$s) {
            $s->rownr = ++$rownr;
            $s->links = JHTML::_('auctiondetails.createLinks',$s);
            BidsHelperAuction::renderAuctionTiming($s);
            $s->countdownHtml = JHTML::_('auctiondetails.countdownHtml',$s);

            $gallery->clearImages();
            $gallery->addImageList(explode(',', $s->pictures));
            $s->thumbnail = $gallery->getThumbImage();
        }

        JHTML::script(JURI::root().'components/com_bids/js/jquery/jquery.js');
        JHTML::script(JURI::root().'components/com_bids/js/jquery/jquery.noconflict.js');

        BidsHelperHtml::loadCountdownJS();

        JHTML::script( JURI::root().'components/com_bids/js/startup.js' );

        $this->assign('auction_rows', $suggestions);
        $this->assign('pagination', $model->get('pagination') );
        $this->assign('lists', $lists);
        $this->assign('sfilters', $sfilters);
        $this->assign('userProfile',$userProfile);

        parent::display($tmpl);
    }
Beispiel #2
0
    function display($tmpl) {

        jimport('joomla.html.parameter');

        $cfg = BidsHelperTools::getConfig();

        $model = $this->getModel('auctions');
        $items = $model->get('auctions');

        $lists=array();

		$gallery = BidsHelperGallery::getGalleryPlugin();

        $i=0;
        foreach($items as $k=>&$item) {

            $item->rownr = ++$i;
            $item->params = new JParameter($item->params);

            $gallery->clearImages();
            $gallery->addImageList(explode(',',$item->pictures));
            $item->thumbnail = $gallery->getThumbImage();

            $item->start_date_text = JHTML::_('auctiondetails.startDateHtml', $item);

            $item->description = JFilterOutput::cleanText($item->description);
            $item->shortdescription = JFilterOutput::cleanText($item->shortdescription);

            $item->tagIds = $item->tagIds ? explode(',', $item->tagIds) : array();
            $item->tagNames = $item->tagNames ? explode(',', $item->tagNames) : array();

            $item->links = JHTML::_('auctiondetails.createLinks',$item);
            if (!isset($item->favorite))
                $item->favorite = false;
            $item->del_from_watchlist = (bool) $item->favorite;
            $item->add_from_watchlist = !$item->del_from_watchlist;

            if ($cfg->bid_opt_multiple_shipping) {
                $p = JTable::getInstance('bidshipzone');
                $item->shipping_zones = $p->getPriceList($item->id);
            }

            BidsHelperAuction::renderAuctionTiming($item);
            $item->countdownHtml = JHTML::_('auctiondetails.countdownHtml',$item);

            if ( BidsHelperDateTime::getTimeStamp($item->end_date) <= time() ) {
                $item->expired = true;
            } else {
                $item->expired = false;
            }

            $item->start_date_text = JHTML::_('auctiondetails.startDateHtml', $item);
            $item->end_date_text = JHTML::_('auctiondetails.endDateHtml', $item);

            BidsHelperAuction::setAuctionStatus($item);

            if ($item->params->get('max_price', '1') == 0 || $item->auction_type == AUCTION_TYPE_PRIVATE) {
                $item->highest_bid = null;
            }

            $lists['bidderPaypalButton'][$item->id] = isset($item->wonBids) ? JHTML::_('auctiondetails.bidderPaypalButton',$item) : null;
        }

        $this->assign('positions', array());

        $filter_type = $model->getState('filters.filter_type');
        $filter_bidtype = $model->getState('filters.filter_bidtype');
        $filter_archive = $model->getState('filters.filter_archive');
        $filter_order = $model->getState('filters.filter_order');
        $filter_order_Dir = $model->getState('filters.filter_order_Dir');
        $pagination = $model->get('pagination');

        $lists['archive'] = JHTML::_('listauctions.selectMyFilter', $model->getState('filters.filter_archive'));
        $lists['filter_bidtype'] = JHTML::_('listauctions.selectBidType', $model->getState('filters.filter_bidtype') );
        $lists['orders'] = JHTML::_('listauctions.selectOrder',$filter_order);
        $lists['filter_order_asc'] = JHTML::_('listauctions.selectOrderDir', $filter_order_Dir);
        $lists['filter_cats'] = JHTML::_('listAuctions.selectCategory', $model->getState('filters.cat'));
        $lists['inputKeyword'] = JHTML::_('listAuctions.inputKeyword', $model->getState('filters.keyword'));
        $filters = $model->getFilters();
        $lists['inputsHiddenFilters'] = JHTML::_('listAuctions.inputsHiddenFilters', $filters );
        $lists['htmlLabelFilters'] = JHTML::_('listAuctions.htmlLabelFilters', $filters, false );
        $lists['resetFilters'] = JHTML::_('listAuctions.linkResetFilters', $model->getState('behavior'));

        $this->assign('lists', $lists);

        $uri = JFactory::getURI();
        $this->assign("action", JRoute::_(JFilterOutput::ampReplace($uri->toString())));
        $this->assign("auction_rows", $items);

        $this->assign("filter_type", $filter_type);
        $this->assign("filter_bidtype", $filter_bidtype);
        $this->assign("filter_order_Dir", $filter_order_Dir);
        $this->assign("reverseorder_Dir", $filter_order_Dir=='ASC' ? 'ASC' : 'DESC' );
        $this->assign("filter_order", $filter_order);
        $this->assign("filter_archive", $filter_archive);
        $this->assign("pagination", $pagination);

        JHTML::script( JURI::root().'components/com_bids/js/jquery/jquery.js' );
        JHTML::script( JURI::root().'components/com_bids/js/jquery/jquery.noconflict.js' );

        JHTML::script( JURI::root().'components/com_bids/js/ratings.js' );
        JHTML::script( JURI::root().'components/com_bids/js/startup.js' );

        JHTML::_('behavior.modal');
        JHTML::_('behavior.tooltip');

        BidsHelperHtml::loadCountdownJS();

        parent::display($tmpl);
    }
Beispiel #3
0
 function getThumbnail()
 {
     return BidsHelperGallery::getGalleryPlugin()->getThumbImage();
 }
Beispiel #4
0
    function display($tpl=null) {

        $mainframe = JFactory::getApplication();
        $database = JFactory::getDBO();
        $my = JFactory::getUser();
        $cfg = BidsHelperTools::getConfig();

        $model = $this->getModel();
        $auction = $model->get('auction');

        $document = JFactory::getDocument();
        $document->setTitle($auction->title);
        $document->setMetaData('description', strip_tags($auction->shortdescription));
        $document->setMetaData('abstract', strip_tags($auction->description));
        foreach($auction->tagNames as $tag) {
            $document->setMetaData('keywords', $tag);
        }

        $jsQuantity = 'var has_quantity = ' . ( ($cfg->bid_opt_quantity_enabled && $auction->nr_items > 1) ?
                'true' : 'false' ) . ';';
        $document->addScriptDeclaration($jsQuantity);

        $links_path = JHtml::_('auctiondetails.auctionDetailsURL',$auction);

        $pathway = $mainframe->getPathway();
        $pathway->addItem($auction->title, $links_path);

        /* PLUGINS */
        $database->setQuery("select * from #__bid_pricing where enabled=1 order by ordering");
        $pp = $database->loadObjectList();
        $pricing_plugins = array();
        foreach ($pp as $p) {
            $pricing_plugins[$p->itemname] = $p;
        }
        $this->assign('pricing_plugins', $pricing_plugins);

        $auction->countdownHtml = JHTML::_('auctiondetails.countdownHtml',$auction);

        $auctioneer = JFactory::getUser($auction->userid);
        $profile = BidsHelperTools::getUserProfileObject($auctioneer->id);

        $this->assign('auctioneer', $auctioneer);
        $this->assign('auctioneer_details', $profile);

        $document = JFactory::getDocument();
        $js = 'var must_accept_term = '.((strip_tags($cfg->terms_and_conditions))?"true;":"false;");
        $this->assign('terms_and_conditions',(strip_tags($cfg->terms_and_conditions))?1:0);
        $document->addScriptDeclaration($js);
        $document->addScriptDeclaration('var auction_currency=\''.$auction->currency.'\';');

        /* PLUGINS */
        if ($cfg->bid_opt_enable_captcha) {
            $this->assign("cs", BidsHelperHtml::init_captcha());
        }

        $u = JTable::getInstance('biduser');
        $ratings = $u->getRatingsList($auctioneer->id);

        $list = array();

        $list['auctionWatchlist'] = JHTML::_('auctiondetails.follow',$auction);
        $list['auctionReport'] = JHTML::_('auctiondetails.report',$auction);
        $list['auctionChooseWinner'] = JHTML::_('auctiondetails.chooseWinner',$auction);
        $list['auctionRate'] = JHTML::_('auctiondetails.rate',$auction);
        $list['auctionFbLikeButton'] = JHTML::_('auctionDetails.fbLikeButton',$auction);
        $list['userRated'] = JHTML::_('auctionDetails.selectUserRated',$auction);
        $list['ratingsDetails'] = JHTML::_('auctionDetails.linkRatingsDetails',$auction,$ratings);

        $modelAuctions = JModelLegacy::getInstance('auctions','bidsModel');
        $otherAuctions = $modelAuctions->getOtherAuctionsList($auction->userid,$auction->id,4);

        $gallery = BidsHelperGallery::getGalleryPlugin();
        foreach($otherAuctions as &$oa) {
            BidsHelperAuction::renderAuctionTiming($oa);

            $gallery->clearImages();
            $gallery->addImageList($oa->imagelist);

            $oa->thumbnail = $oa->get('thumbnail');
            $oa->countdownHtml = JHTML::_('auctiondetails.countdownHtml',$oa);
        }
        $list['other_items'] = $otherAuctions;
        $list['tagLinks'] = JHtml::_('auctiondetails.taglinks',$auction);

        $list['ratings'] = BidsHelperHtml::getRatingsSelect();

        if(AUCTION_TYPE_BIN_ONLY==$auction->auction_type && $auction->quantity > 1) {

            $itemsPurchased = 0;

            foreach($auction->wonBids as $wb) {
                if($wb->userid==$my->id) {
                    $itemsPurchased += $wb->quantity;
                }
            }

            $list['myPurchasedItems'] = $itemsPurchased;
        }

        $userProfile = BidsHelperTools::getUserProfileObject();

	    $gallery->writeJS();

        $sellerProfile = BidsHelperTools::getUserProfileObject($auction->userid);

        $list['bidderPaypalButton'] = JHTML::_('auctiondetails.bidderPaypalButton',$auction);

        $auction->payment_name = $auction->payment_method;
        $auction->thumbnail = $auction->get('thumbnail');
        $auction->gallery = $auction->get('gallery');
        $auction->links = JHTML::_('auctiondetails.createLinks',$auction);
        $auction->username = $sellerProfile->username;
        $auction->paypalemail = isset($sellerProfile->paypalemail) ? $sellerProfile->paypalemail : null;
        $auction->start_date_text = JHTML::_('auctiondetails.startDateHtml', $auction);
        $auction->end_date_text = JHTML::_('auctiondetails.endDateHtml', $auction);

        $auction->minIncrement = $model->getMinIncrement();
        $auction->minAcceptedPrice = $model->getMinAcceptedPrice();
        $auction->isMyAuction = $model->ownsAuction($my->id);

        $mybids = $model->getUserBids($my->id);
        $auction->myBid = reset($mybids);

        $auction->my_proxy_bid = $auction->myBid ? $auction->myBid->max_proxy_price : 0;
        $auction->mybid = $auction->myBid ? $auction->myBid->bid_price : 0;

        $auction->winner_list = $auction->wonBids;
        $auction->winBid = 0;

        if($auction->highestBid && $auction->highestBid->accept) {
            $auction->winBid = $auction->highestBid->bid_price;
        }

        $auction->highestBidder = $auction->highestBid ? $auction->highestBid->username : '';
        $auction->highestBidderId = $auction->highestBid ? $auction->highestBid->userid : 0;

        if(!$auction->highestBid) {
            $auction->highestBid = new stdClass();
            $auction->highestBid->bid_price = 0;
        }
        $auction->highestBid->bid_price =
                (
                    $auction->isMyAuction ||
                    (!empty($auction->params['max_price']) && $auction->auction_type!=AUCTION_TYPE_PRIVATE)
                ) ?
                ($auction->highestBid ? $auction->highestBid->bid_price : 0) : 'private';


        $auction->iAmWinner = $model->isWinner($my->id);

        $suggestions = isset($auction->suggestions) ? $auction->suggestions : null;

        JHTML::script(JURI::root().'components/com_bids/js/jquery/jquery.js');
        JHTML::script(JURI::root().'components/com_bids/js/jquery/jquery.noconflict.js');
        JHTML::script(JURI::root().'components/com_bids/js/auctions.js');
        JHTML::script(JURI::root().'components/com_bids/js/startup.js');
        JHTML::_('behavior.modal');

        BidsHelperHtml::loadCountdownJS();

        $this->assign('auction', $auction);
        $this->assign('userProfile',$userProfile);
        $this->assign('message_list', $model->getAuctionMessages($auction->id));
        $this->assign('bid_list', $auction->bids );
        $this->assign('bid_history', $auction->bids_history );
        $this->assign('positions', array());
        $this->assign('suggestions', $suggestions);
        $this->assign('lists', $list);

        parent::display($tpl);
    }