File indexing completed on 2025-05-04 05:29:31

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 $this->tab = 'downloadhistory';
0024 $identity = Zend_Auth::getInstance()->getStorage()->read();
0025 $this->issupport = $this->isSupporter($this->member->member_id);
0026 //Rating for ACTIVE SUPPORTERS only
0027 
0028 $pageCount = $this->downloadhistory->getTotalItemCount()/$this->downloadhistory->getItemCountPerPage();
0029 ?>
0030 <style type="text/css">
0031   .rate-comment{
0032     display: block;
0033     clear: both;
0034   }
0035 
0036 </style>
0037 <main class="user-admin-page">
0038     <?php echo $this->render('user/partials/userHeader_top.phtml'); ?>  
0039     <section class="body-wrap">
0040         <section class="wrapper product-page">
0041             <!-- PAGE BODY -->
0042             <section class="my-products-page">
0043                 <!-- NAVIGATION -->
0044                 <?php echo $this->render('user/partials/userHeader.phtml'); ?>
0045                 <!-- /NAVIGATION -->
0046              
0047               <div class="my-products-heading">
0048                    <h1 class="page-title left"><?= $this->translate('Download History') ?></h1>                   
0049                </div>
0050 
0051 
0052                 <div class="my-downloadshistory-list" id="my-downloadshistory-list">
0053 
0054                 <div class="row">
0055                     <div class="col-lg-12">
0056                     <small class="pull-right">
0057                         <div class="row totaldownloads"><?=$this->downloadhistory->getTotalItemCount()?> Downloads</div>
0058                         <?php if ($pageCount > 1) echo $this->paginationControl($this->downloadhistory, 'Sliding', '/partials/paginationControlBootstrap.phtml',
0059                             array('params' => array(), 'dom_target' => 'div#my-downloadshistory-list')); ?>
0060                       </small>                    
0061                     </div>
0062                 </div>
0063 
0064                    <div class="row">
0065                        <div class="col-lg-5">
0066                        </div>
0067                        <div class="col-lg-2">
0068                         Downloaded at
0069                        </div>
0070                        <div class="col-lg-2">                        
0071                        </div>
0072                        <div class="col-lg-2">
0073                            Ratings&Reviews
0074                        </div>
0075                       <div class="col-lg-1">
0076                        
0077                        </div>
0078                         
0079                    </div>
0080                     <?php  
0081                         $this->result = array();                                                
0082                         foreach ($this->downloadhistory as $element) {
0083                             $this->result[$element['project_id']][] = $element;
0084                         }                       
0085                         foreach($this->result as $this->projectfiles){                                                            
0086                             $i = 0;
0087                             foreach($this->projectfiles as $file){                                                                                            
0088                                 echo $this->partial('user/partials/loopDownloadHistory.phtml',  array(
0089                                         "file"  => (object)$file,
0090                                         "isSupporter" =>$this->isSupporter,
0091                                         "member_id" =>$this->member->member_id,
0092                                         "authMember" =>$this->member,
0093                                         "counter" => $i++
0094                                     ));                                                                                                  
0095                             }
0096                         }
0097                     ?>                                                               
0098                 </div>
0099             </section>
0100 
0101             <!-- /PAGE BODY -->
0102 
0103         </section>
0104 
0105     </section>
0106 
0107 </main>
0108 
0109 
0110   <?php if (Zend_Auth::getInstance()->hasIdentity() /*&& $this->issupport */ ) { ?>
0111     <div id="review-product-modal" class="modal" tabindex="-1" role="dialog">
0112         <div class="modal-dialog modal-sm" role="document">
0113             <div class="modal-content" style="padding-bottom: 20px">
0114                <div class="modal-header">
0115                     <label id="votelabel"> </label>
0116                    <button type="button" class="close col-md-1" data-dismiss="modal" aria-label="Close"><span
0117                                aria-hidden="true">&times;</span></button>
0118                </div>
0119                <div class="modal-body">
0120                  <form class="full-width product-add-comment-review" action="/productcomment/addreplyreview/" method="post">
0121                   <input type="hidden" name="p" id="form_p"/>
0122                   <input type="hidden" name="m" value="<?= $identity->member_id ?>" id="loginuser"/>
0123                   <input type="hidden" name="v" value="1" id="voteup"/>                                                        
0124                   <textarea name="msg" class="full-width" id="commenttext"></textarea>
0125                   <button type="submit" class="small pull-right">Rate Now</button>
0126                 </form>
0127                 </div>
0128             </div>
0129         </div>
0130     </div> 
0131 
0132 
0133     <div id="score-product-modal" class="modal" tabindex="-1" role="dialog">
0134         <div class="modal-dialog modal-sm" role="document">
0135             <div class="modal-content" style="padding-bottom: 20px">
0136                <div class="modal-header">                    
0137                    <button type="button" class="close col-md-1" data-dismiss="modal" aria-label="Close"><span
0138                                aria-hidden="true">&times;</span></button>
0139                                <label id="votelabel"> </label>
0140                </div>
0141                <form class="full-width product-add-comment-review-new" action="/productcomment/addreplyreviewnew/" method="post" id="reviewform">
0142                <div class="modal-body">
0143                  
0144                     <input type="hidden" name="p" id="form_p"/>
0145                     <input type="hidden" name="m" value="<?= $identity->member_id ?>" id="loginuser"/> 
0146                     <input type="hidden" name="s" id="userscorevalue"/>
0147                     <input type="hidden" name="v" value="1" id="voteup"/>
0148                     <textarea name="msg" class="full-width" id="commenttext"></textarea>
0149                 
0150                 </div>
0151                  <div class="modal-footer">
0152                             <button type="button" class="small" id="modal-btn-cancel" style="float: left;">Cancel</button>                             
0153                             <button type="submit" class="small pull-right"  id="modal-btn-onsubmit">Rate Now</button>
0154                 </div>
0155                 </form>
0156             </div>
0157         </div>
0158     </div>
0159 
0160 
0161 <?php }?>
0162 
0163 <?php
0164 $this->inlineScript()->appendScript(
0165     '    $(document).ready(function(){                        
0166              CreateScoreRatingPopup.setup();             
0167              PartialCommentReviewFormNew.setup();
0168              PartialsButton.setup();
0169         });
0170     ');