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

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 $helperPrintDate = new Default_View_Helper_PrintDate();
0026 $helperBuildProductUrl = new Default_View_Helper_BuildProductUrl();
0027 $helperImage = new Default_View_Helper_Image();
0028 $helpMemberUrl = new Default_View_Helper_BuildMemberUrl();
0029 
0030 ?>
0031 
0032 <link href="/theme/backend/lib/jquery-ui/themes/smoothness/jquery-ui.min.css" rel="stylesheet">
0033 <link href="/theme/backend/lib/jtable/themes/jqueryui/jtable_jqueryui.min.css" rel="stylesheet">
0034 <script src="/theme/backend/lib/jquery-ui/jquery-ui.min.js"></script>
0035 <script src="/theme/backend/lib/jtable/jquery.jtable.min.js"></script>
0036 
0037 <style type="text/css">
0038         img.pimage{
0039             float: left;            
0040         }
0041         div.ptitle{
0042             margin-left: 140px; 
0043             font-size: 13px;
0044             font-weight: bold;     
0045         }
0046         div.jtable-main-container table.jtable tbody > tr > td{
0047             vertical-align: top;
0048             border-left:0px;
0049             border-right:0px;
0050             font-size: small;
0051         }
0052         div.jtable-main-container table.jtable{
0053             border: 0px;
0054         }
0055         div.jtable-main-container table.jtable th{
0056             border: 0px;
0057             background: none;
0058             font-weight: bold;
0059         }
0060         
0061         #products-wrapper{
0062             padding-bottom: 20px;
0063         }
0064 
0065 
0066         #explore-content .ui-state-default
0067         {
0068             background: none;
0069             border: 0px;
0070 
0071         }
0072 
0073 
0074         #explore-content div.jtable-main-container table.jtable .rating{
0075             width:80px; 
0076             margin-left:140px;
0077             padding-top:20px;
0078         }
0079         #explore-content div.jtable-main-container table.jtable .tooltipuser{
0080             color: #2673b0;
0081             cursor: pointer;
0082         }
0083         
0084         a.imghistory{
0085 
0086         }
0087 
0088        
0089 
0090 </style>
0091 <main id="explore-content">
0092   <section class="wrapper" id="products-wrapper" >
0093 <h1>
0094     Duplicates Project Source   
0095 </h1>
0096     
0097      <form style="margin-top: 20px; margin-bottom: 20px">       
0098             Source_url Filter  :
0099             <select name="filter_type" id="filter_type" >
0100                 <option value="1">Show ALL Duplicates</option>
0101                 <option value="2">filter source_url from Duplicates</option>
0102                 <option value="3">filter source_url like '/in/photolist'</option>
0103             </select>
0104             <input name="filter_source_url" id="filter_source_url"/>                
0105             <button type="submit" id="LoadRecordsButton"><?= $this->translate('Load records'); ?></button>                         
0106     </form>
0107         
0108     <div id="TableContainer"></div>    
0109     </section>
0110 
0111 </main>
0112 <div class="tooltip_templates" style="display: none">
0113     <span id="tooltip_content">
0114         <i class="fa fa-spinner"></i>
0115     </span>
0116 </div>
0117 <script type="text/javascript">
0118     $(document).ready(function () {
0119 
0120         $("#dialog-form").dialog({
0121             autoOpen: false,
0122             //height: 350,
0123             width: 600,
0124             modal: true,
0125             buttons: {
0126                 Close: function () {
0127                     $(this).dialog("close");
0128                 }
0129             }
0130         });
0131 
0132         $('#filter_type').on('change',function(){
0133             $('#filter_source_url').val('');        
0134         })
0135 
0136         $('#TableContainer').jtable({
0137             jqueryuiTheme: true,
0138             paging: true,
0139             sorting: true,                     
0140             actions: {
0141                 listAction: '/duplicates/list'                
0142             },
0143             fields: {
0144                     source_url: {
0145                                      title: 'Source',
0146                                      key: true,
0147                                      create: false,
0148                                      edit: false,
0149                                      list: true                   
0150                                  },
0151                     cnt: {
0152                                      title: 'cnt', 
0153                                      width:'5%',                                  
0154                                      create: false,
0155                                      edit: false,
0156                                      list: true                   
0157                                  },
0158                     pids:{
0159                          title: 'Projects',                         
0160                          list:true,
0161                          edit: false,
0162                          display:function(data){   
0163                             var pids = data.record.pids.split(",");  
0164                             var html='';
0165                             pids.forEach(function(element,idx, array) {
0166                                html = html+'<a target="_blank" href="/p/'+element+'">'+element+'</a>';
0167                                if (idx !== array.length - 1){ 
0168                                        html=html+','; 
0169                                 }
0170                             });                   
0171                             return html;
0172                         }
0173                     }
0174                              
0175                     
0176             }
0177         });
0178 
0179         $('body').on("click", 'a.toggle-status', function (event) {
0180             event.preventDefault();
0181             event.stopImmediatePropagation();
0182 
0183         });
0184 
0185      
0186         //Re-load records when user click 'load records' button.
0187         $('#LoadRecordsButton').click(function (e) {
0188             e.preventDefault();
0189             $('#TableContainer').jtable('load', {
0190                 filter_source_url: $('#filter_source_url').val(),
0191                 filter_type: $('#filter_type').val(),             
0192             },function(){
0193               TooltipUser.setup("tooltipuser","right");        
0194             });
0195         });
0196 
0197         //Re-load records when user click 'remove filter' button.
0198         $('#RemoveFilterButton').click(function (e) {
0199             e.preventDefault();            
0200           $("#filter_member_id option[value='']").attr('selected', true)      
0201             $('#TableContainer').jtable('load', {            
0202                 filter_member_id: null,              
0203             });
0204         });
0205 
0206         // $('#TableContainer').jtable('load', {           
0207         //     filter_member_id: $('#filter_member_id').val()            
0208         // });
0209 
0210         $('#TableContainer').jtable('load', {                       
0211         },function(){
0212                 
0213         });
0214 
0215         $('body').on("click", 'a.imghistory', function (event) {
0216             event.preventDefault();
0217             event.stopImmediatePropagation();
0218            
0219             return false;
0220         });
0221 
0222       
0223 
0224                 
0225     
0226     });
0227 </script>
0228 
0229