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

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  * Created: 31.05.2017
0023  */
0024 
0025 $isadmin = 0;
0026 if(Zend_Auth::getInstance()->hasIdentity() AND Zend_Auth::getInstance()->getIdentity()->roleName == 'admin') {
0027 $isadmin = 1;
0028 }
0029 ?>
0030 
0031 <link href="/theme/backend/lib/jquery-ui/themes/smoothness/jquery-ui.min.css" rel="stylesheet">
0032 <link href="/theme/backend/lib/jtable/themes/jqueryui/jtable_jqueryui.min.css" rel="stylesheet">
0033 <script src="/theme/backend/lib/jquery-ui/jquery-ui.min.js"></script>
0034 <script src="/theme/backend/lib/jtable/jquery.jtable.min.js"></script>
0035 
0036 <style type="text/css">
0037         img.pimage{
0038             float: left;            
0039         }
0040         div.ptitle{
0041             margin-left: 140px; 
0042             font-size: 13px;
0043             font-weight: bold;     
0044         }
0045         div.ptitle span.catTitle{
0046             display: inherit;
0047             color:#ccc;
0048         }
0049         div.ptitle span.username{
0050             display: inherit;
0051             color:#ccc;
0052         }
0053         div.jtable-main-container table.jtable tbody > tr > td{
0054             vertical-align: top;
0055             border-left:0px;
0056             border-right:0px;
0057             font-size: small;
0058         }
0059         div.jtable-main-container table.jtable{
0060             border: 0px;
0061         }
0062         div.jtable-main-container table.jtable th{
0063             border: 0px;
0064             background: none;
0065             font-weight: bold;
0066         }
0067         
0068         #products-wrapper{
0069             padding-bottom: 20px;
0070         }
0071 
0072 
0073         #explore-content .ui-state-default
0074         {
0075             background: none;
0076             border: 0px;
0077 
0078         }
0079 
0080 
0081         #explore-content div.jtable-main-container table.jtable .rating{
0082             width:80px; 
0083             margin-left:140px;
0084             padding-top:20px;
0085         }
0086         #explore-content div.jtable-main-container table.jtable .tooltipuser{
0087             color: #2673b0;
0088             cursor: pointer;
0089         }
0090         
0091         a.imghistory{
0092 
0093         }
0094 
0095        
0096 
0097 </style>
0098 <main id="explore-content">
0099   <section class="wrapper" id="products-wrapper" >
0100 <h1>
0101     Moderation
0102 </h1>    
0103     <div id="TableContainer"></div>    
0104     </section>
0105 
0106 </main>
0107 <div class="tooltip_templates" style="display: none">
0108     <span id="tooltip_content">
0109         <i class="fa fa-spinner"></i>
0110     </span>
0111 </div>
0112 <script type="text/javascript">
0113     $(document).ready(function () {
0114 
0115         var actions;
0116         actions = {
0117                 listAction: '/moderation/listmoderation'                 
0118             };
0119 
0120         $('#TableContainer').jtable({
0121             jqueryuiTheme: true,
0122             paging: true,
0123             sorting: true,                     
0124             actions: actions,
0125             recordsLoaded: function (event, data) {
0126                 TooltipUser.setup("tooltipuser","right");        
0127             },
0128             fields: {
0129                 
0130                     title: {
0131                         title: 'Project ',                         
0132                         create: false,
0133                         edit: false,
0134                         list: true,    
0135                         width:'15%',                    
0136                         display: function (data) {
0137                             if (data.record.image_small) {
0138                                 var html =   ' <a href="/p/' + data.record.project_id
0139                                         + '/" target="_blank"><img  class="pimage" src='+data.record.image_small+' /></a><div class="ptitle"><span class="title">'
0140                                         +data.record.title
0141                                         +'</span><span class="catTitle">'+data.record.cat_title+'  </span><span class="username">by '+data.record.product_username
0142                                         +'</span></div>' ;                                                             
0143                                 return html;
0144                             }
0145                         }
0146                     },
0147                     comment_text: {
0148                         title: 'Comment',                                                   
0149                         type: 'textarea',
0150                         list: true                        
0151                     },  
0152                     username:{
0153                          title: 'Moderator',
0154                           width:'5%', 
0155                          list:true,
0156                          edit: false,
0157                          display:function(data){                        
0158                             var html = '<a  class="tooltipuser" data-tooltip-content="#tooltip_content" data-user="'+data.record.member_id+'" >'+data.record.username+'</a>';
0159                              return html;
0160                         }
0161                     },                       
0162                     comment_created_at: {
0163                         title: 'comment_created_at',                                              
0164                          width:'5%',
0165                           edit: false,                    
0166                         list: true
0167                     },
0168                        
0169                       
0170                     
0171             }
0172         });
0173 
0174        
0175 
0176         $('body').on("click", 'a.member-info', function (event) {
0177             event.preventDefault();
0178             event.stopImmediatePropagation();
0179 
0180             var elementRecord = $(this).data("record");
0181 
0182             jQuery.ajax({
0183                 data: {'member_id': elementRecord},
0184                 url: '/backend/user/memberinfo/',
0185                 type: 'post',
0186                 error: function () {
0187                     alert("<span class='error'>Service is temporarily unavailable. Our engineers are working quickly to resolve this issue. <br/>Find out why you may have encountered this error.</span>");
0188                     return false;
0189                 },
0190                 success: function (results) {
0191                     $('#dialog-form').html(results.ViewRecord).dialog('open');
0192                     return false;
0193                 }
0194             });
0195 
0196             return false;
0197         });
0198 
0199 
0200         //Re-load records when user click 'load records' button.
0201         $('#LoadRecordsButton').click(function (e) {
0202             e.preventDefault();
0203             $('#TableContainer').jtable('load', {
0204                 filter_member_id: $('#filter_member_id').val(),              
0205             },function(){
0206               //TooltipUser.setup("tooltipuser","right");        
0207             });
0208         });
0209 
0210        
0211 
0212           $('#TableContainer').jtable('load', {           
0213                       
0214         },function(){
0215              
0216         });
0217 
0218        
0219       
0220 
0221                 
0222     
0223     });
0224 </script>
0225 
0226