File indexing completed on 2024-12-29 05:24:38

0001 <?php
0002 /**
0003  *  ocs-webserver
0004  *
0005  *  Copyright 2016 by pling GmbH.
0006  *
0007  *    This file is part of ocs-webserver.
0008  *
0009  *    This program is free software: you can redistribute it and/or modify
0010  *    it under the terms of the GNU Affero General Public License as
0011  *    published by the Free Software Foundation, either version 3 of the
0012  *    License, or (at your option) any later version.
0013  *
0014  *    This program is distributed in the hope that it will be useful,
0015  *    but WITHOUT ANY WARRANTY; without even the implied warranty of
0016  *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
0017  *    GNU Affero General Public License for more details.
0018  *
0019  *    You should have received a copy of the GNU Affero General Public License
0020  *    along with this program.  If not, see <http://www.gnu.org/licenses/>.
0021  **/
0022 
0023 $helperBuildMemberUrl = new Default_View_Helper_BuildMemberUrl();
0024 $helperBuildProductUrl = new Default_View_Helper_BuildProductUrl();
0025 $helperImage = new Default_View_Helper_Image();
0026 $plingUrl = $helperBuildProductUrl->buildProductUrl($this->product->project_id, 'pling');
0027 $auth = Zend_Auth::getInstance();
0028 ?>
0029 <div class="">
0030 
0031     <!-- RATING -->
0032     <?php 
0033     /*
0034     <?php echo $this->partial('partials/sidebarRating.phtml',
0035         array(
0036             'project_id' => $this->product->project_id,
0037         )); ?>
0038     <!-- /RATING -->
0039     */
0040     ?>
0041     <div class="prod-widget-box right">
0042 
0043         <div id="pling-box">
0044 
0045             <!-- SUPPORTER -->
0046              <p class="none"><?= count($this->supporter) ?>  Supporters for <b><?= $this->product->title; ?></b>:</p>
0047             <div class="donation-box">               
0048                 <div class="row" style="margin-left: 0px; margin-right: 0px">
0049                 <?php
0050                 if (count($this->supporter) > 0):
0051                     $countSupporter = count($this->supporter->toArray());                    
0052                     foreach ($this->supporter as $sup):
0053                          ?>
0054 
0055                         <div class="supporter" style="width: 35px;height: 35px;float: left;padding: 2px;clear: none;border-bottom: 0px none;">
0056                             <a href="<?php echo $helperBuildMemberUrl->buildMemberUrl($sup->username); ?>">
0057                                 <img width="30px" height="30px" src="<?= $helperImage->Image($sup->profile_image_url,array('width' => 30, 'height' => 30, 'crop' => 2)); ?>"/>
0058                             </a>
0059                         </div>
0060 
0061                         <?php
0062                     endforeach;
0063                 endif;
0064                 ?>
0065                 </div>
0066                 <!-- /SUPPORTER -->
0067 
0068                 <?php /*
0069 
0070                 <div class="collected">
0071                     <?php
0072                     if ($this->product->amount_received === 0 OR $this->product->amount_received === null) {
0073                         $sumAmount = '0';
0074                     } else {
0075                         $sumAmount = $this->product->amount_received;
0076                     }
0077                     ?>
0078                     <?php
0079                     if (false === empty($this->product->amount)) {
0080                         if ($sumAmount == null OR $sumAmount == '0') {
0081                             $percent = '0';
0082                         } else {
0083                             $percent = ($sumAmount / $this->product->amount) * 100;
0084                         } ?>
0085                         <h3>$<?php echo $sumAmount; ?> collected of $<?= (int)$this->product->amount ?></h3>
0086                         <div class="achieved-amount">
0087                             <div class="bar" style="width:<?php echo $percent; ?>%;"></div>
0088                         </div>
0089                     <?php } else { ?>
0090                         <h3>$<?php echo $sumAmount; ?> collected</h3>
0091                         <?php
0092                     }
0093                     if (isset($this->paymentMessage)) {
0094                         $cssClass = 'text-' . $this->paymentStatus;
0095                         ?>
0096                         <span class="<?= $cssClass ?>"><?= $this->paymentMessage ?></span>
0097                     <?php } ?>
0098                 </div>
0099                     
0100                 */ ?>
0101 
0102                 <div class="donation-box-payment row" style="text-align: right; margin-right: 0px;padding-top:20px;">                                           
0103                         
0104                         <?php /*
0105                                 <?php if ($auth->hasIdentity()): ?>
0106                                     <a  role="button" id="inline" href="#product-donate">
0107                                         <span class="btn-pling-2"><?= $this->translate('Donate') ?></span>
0108                                     </a>
0109                                 <?php else: ?>
0110                                     <a id="pling-start" href="javascript:;">
0111                                         <span class="btn-pling-2 disabled">Please login to donate</span>
0112                                     </a>
0113                                 <?php endif; ?>
0114                         */ ?>
0115                                 <?php if (!empty($this->product->paypal_mail)) : ?>
0116                                 <a role="button" id="inline" href="#product-donate" style="color:blue; "><span class="btn-pling-2"> Become a supporter</span></a> 
0117                                 <?php endif; ?>
0118                         
0119                     
0120                 </div>
0121             </div>
0122 
0123 
0124         </div>
0125 
0126 
0127     </div>
0128 
0129 
0130     <!-- SUPPORTINGS -->
0131     <?php
0132     $helperHumanTiming = new Default_View_Helper_HumanTiming();
0133     $helperUserIsOwner = new Default_View_Helper_UserIsOwner();
0134     $countSupporter = count($this->supporter->toArray());
0135     echo $this->render('product/partials/productSupporterCommentsWidget.phtml');
0136     ?>
0137 
0138     <!-- /SUPPORTER -->
0139 
0140 
0141     <!-- LICENSE -->
0142     <?php echo $this->render('partials/sidebarCcLicense.phtml'); ?>
0143     <!-- /LICENSE -->
0144 
0145 </div>
0146 <?php
0147 $this->inlineScript()->appendScript(
0148     '    $(document).ready(function(){
0149         ProductPage.setup();
0150         ProductPage.setupPlingButton();
0151         });
0152     ');