| 
      
            Lines 150-155
          canned reports and writing custom SQL reports.</p>
      
      
        Link Here
      
     | 
  
        
          | 150 | 
              </div>  | 
          150 | 
              </div>  | 
        
        
          | 151 | 
          </div>  | 
          151 | 
          </div>  | 
        
        
          | 152 | 
           | 
          152 | 
           | 
        
            
               | 
               | 
              153 | 
              [% IF report_converted %]  | 
            
            
              | 154 | 
                  <div class="dialog message">  | 
            
            
              | 155 | 
                      The report "[% report_converted %]" has been converted.  | 
            
            
              | 156 | 
                  </div>  | 
            
            
              | 157 | 
              [% END %]  | 
            
            
              | 158 | 
               | 
            
            
              | 159 | 
               | 
            
        
          | 153 | 
          [% IF ( saved1 ) %]  | 
          160 | 
          [% IF ( saved1 ) %]  | 
        
        
          | 154 | 
          [% IF ( savedreports ) %]<h1>Saved reports</h1>  | 
          161 | 
          [% IF ( savedreports ) %]<h1>Saved reports</h1>  | 
        
        
          | 155 | 
           | 
          162 | 
           | 
        
  
    | 
      
            Lines 174-187
          canned reports and writing custom SQL reports.</p>
      
      
        Link Here
      
     | 
  
        
          | 174 | 
              </div>  | 
          181 | 
              </div>  | 
        
        
          | 175 | 
              [% END %]  | 
          182 | 
              [% END %]  | 
        
        
          | 176 | 
           | 
          183 | 
           | 
        
            
              | 177 | 
                 [% IF (Koha.Preference('Mana') == 1) %] | 
               | 
               | 
            
            
              | 178 | 
                  <div id="mana_search" class="dialog message">  | 
            
            
              | 179 | 
                      <p> You want more reports? Check the Mana Knowledge Base <p> <a style="cursor:pointer" data-toggle="modal" data-target="#mana_search_result">Quick Search</a></p>  | 
            
            
              | 180 | 
                  </div>  | 
            
            
              | 181 | 
                  [% END %]  | 
            
            
              | 182 | 
               | 
            
        
          | 183 | 
          </script>  | 
          184 | 
          </script>  | 
        
          
            
              | 184 | 
              <h1> [% savedreport.sql %]</h1>  | 
              185 | 
               | 
            
        
          | 185 | 
          <form action="/cgi-bin/koha/reports/guided_reports.pl" id="reports_form" method="post">  | 
          186 | 
          <form action="/cgi-bin/koha/reports/guided_reports.pl" id="reports_form" method="post">  | 
        
        
          | 186 | 
          <input type="hidden" name="phase" value="Delete Multiple" />  | 
          187 | 
          <input type="hidden" name="phase" value="Delete Multiple" />  | 
        
        
          | 187 | 
                  <table id="table_reports">  | 
          188 | 
                  <table id="table_reports">  | 
        
  
    | 
      
            Lines 212-218
          canned reports and writing custom SQL reports.</p>
      
      
        Link Here
      
     | 
  
        
          | 212 | 
                                      [% IF ( CAN_user_reports_delete_reports ) %] <!-- not break CSS -->  | 
          213 | 
                                      [% IF ( CAN_user_reports_delete_reports ) %] <!-- not break CSS -->  | 
        
        
          | 213 | 
                                          <input type="checkbox" name="ids" value="[% savedreport.id %]" />  | 
          214 | 
                                          <input type="checkbox" name="ids" value="[% savedreport.id %]" />  | 
        
        
          | 214 | 
                                      [% END %]  | 
          215 | 
                                      [% END %]  | 
        
          
            
              | 215 | 
                                      <input hidden class="report_sql" value="[% savedreport.savedsql %]">  | 
              216 | 
                                      <input hidden class="report_sql" value="[% savedreport.savedsql |html %]">  | 
            
        
          | 216 | 
                                  </td>  | 
          217 | 
                                  </td>  | 
        
        
          | 217 | 
                                  <td class="report_id"><label for="ids">[% savedreport.id %]</label></td>  | 
          218 | 
                                  <td class="report_id"><label for="ids">[% savedreport.id %]</label></td>  | 
        
        
          | 218 | 
                                  <td class="report_name">  | 
          219 | 
                                  <td class="report_name">  | 
        
  
    | 
      
            Lines 1107-1116
          Sub report:<select name="subreport">
      
      
        Link Here
      
     | 
  
        
          | 1107 | 
                          window.history.back();  | 
          1108 | 
                          window.history.back();  | 
        
        
          | 1108 | 
                      });  | 
          1109 | 
                      });  | 
        
        
          | 1109 | 
           | 
          1110 | 
           | 
        
            
              | 1110 | 
                          $(".mana_search_button").on("click",function(){ | 
               | 
               | 
            
            
              | 1111 | 
                              mana_search($(this).prev().val());  | 
            
            
              | 1112 | 
                          });  | 
            
            
              | 1113 | 
               | 
            
        
          | 1114 | 
                      $(".ShareButton").on("click", function(){ | 
          1111 | 
                      $(".ShareButton").on("click", function(){ | 
        
        
          | 1115 | 
                          if($(this).closest("tr").find(".report_notes").text().length < 20 || $(this).closest("tr").find(".report_name").text().length < 20){ | 
          1112 | 
                          if($(this).closest("tr").find(".report_notes").text().length < 20 || $(this).closest("tr").find(".report_name").text().length < 20){ | 
        
        
          | 1116 | 
                              $("#shared_infos").hide(); | 
          1113 | 
                              $("#shared_infos").hide(); | 
        
  
    | 
      
            Lines 1127-1136
          Sub report:<select name="subreport">
      
      
        Link Here
      
     | 
  
        
          | 1127 | 
                          }  | 
          1124 | 
                          }  | 
        
        
          | 1128 | 
                      });  | 
          1125 | 
                      });  | 
        
        
          | 1129 | 
           | 
          1126 | 
           | 
        
            
              | 1130 | 
                          $('#search_form').submit(function () { | 
               | 
               | 
            
            
              | 1131 | 
                              return false;  | 
            
            
              | 1132 | 
                          });  | 
            
            
              | 1133 | 
               | 
            
        
          | 1134 | 
                      $("#addColumn").on("click",function(){ | 
          1127 | 
                      $("#addColumn").on("click",function(){ | 
        
        
          | 1135 | 
                          addColumn();  | 
          1128 | 
                          addColumn();  | 
        
        
          | 1136 | 
                      });  | 
          1129 | 
                      });  | 
        
  
    | 
      
            Lines 1315-1417
          Sub report:<select name="subreport">
      
      
        Link Here
      
     | 
  
        
          | 1315 | 
                          return confirmDelete(MSG_CONFIRM_DELETE);  | 
          1308 | 
                          return confirmDelete(MSG_CONFIRM_DELETE);  | 
        
        
          | 1316 | 
                      });  | 
          1309 | 
                      });  | 
        
        
          | 1317 | 
                  });  | 
          1310 | 
                  });  | 
        
            
              | 1318 | 
                      function mana_increment(mana_id, resourcename, fieldvalue, stepvalue = 1){ | 
               | 
               | 
            
            
              | 1319 | 
                          $.ajax( { | 
            
            
              | 1320 | 
                              type: "POST",  | 
            
            
              | 1321 | 
                              url: "/cgi-bin/koha/svc/mana/addvaluetofield",  | 
            
            
              | 1322 | 
                              data: {id: mana_id, field: fieldvalue, resource: resourcename, step: stepvalue}, | 
            
            
              | 1323 | 
                              datatype: "json",  | 
            
            
              | 1324 | 
                          }).done( function() { | 
            
            
              | 1325 | 
                          }).fail( function(){ }); | 
            
            
              | 1326 | 
                      }  | 
            
            
              | 1327 | 
               | 
            
            
              | 1328 | 
                      function mana_use( mana_id ){ | 
            
            
              | 1329 | 
                          $.ajax( { | 
            
            
              | 1330 | 
                              type:"POST",  | 
            
            
              | 1331 | 
                              url: "/cgi-bin/koha/svc/mana/use",  | 
            
            
              | 1332 | 
                              data: {id:mana_id, resource: 'report', saveinbase: 1}, | 
            
            
              | 1333 | 
                              dataType: "json",  | 
            
            
              | 1334 | 
                          })  | 
            
            
              | 1335 | 
                          .done( function (result){ | 
            
            
              | 1336 | 
                              window.location = ("/cgi-bin/koha/reports/guided_reports.pl?reports=").concat(result.id).concat("&phase=Show%20SQL"); | 
            
            
              | 1337 | 
                          })  | 
            
            
              | 1338 | 
                          .fail( function ( foo, msg, longmsg){ | 
            
            
              | 1339 | 
                          });  | 
            
            
              | 1340 | 
                      }  | 
            
            
              | 1341 | 
               | 
            
            
              | 1342 | 
                      function mana_search( textquery ){ | 
            
            
              | 1343 | 
                          $.ajax({ | 
            
            
              | 1344 | 
                              type: "POST",  | 
            
            
              | 1345 | 
                              url: "/cgi-bin/koha/svc/mana/search",  | 
            
            
              | 1346 | 
                              data: {biblionumber: $("#biblionumber").val(), resource: 'report', id: textquery, usecomments: 1}, | 
            
            
              | 1347 | 
                              dataType: "html",  | 
            
            
              | 1348 | 
                          })  | 
            
            
              | 1349 | 
                          .done( function( result ) { | 
            
            
              | 1350 | 
                              $("#mana_search_result .modal-body").html(result); | 
            
            
              | 1351 | 
                              $("#mana_search_result_label").text("Results from Mana Knowledge Base"); | 
            
            
              | 1352 | 
                              $("#mana_results_datatable").dataTable($.extend(true, {}, dataTablesDefaults,{ | 
            
            
              | 1353 | 
                                  "sPaginationType":"four_button",  | 
            
            
              | 1354 | 
                                  "autoWidth": false,  | 
            
            
              | 1355 | 
                                  "columnDefs": [  | 
            
            
              | 1356 | 
                                      { "width": "35%", "targets": 1 } | 
            
            
              | 1357 | 
                                  ],  | 
            
            
              | 1358 | 
                                  "aoColumnDefs": [  | 
            
            
              | 1359 | 
                                      { 'bSortable': false, "bSearchable": false, 'aTargets': [ 'NoSort' ] }, | 
            
            
              | 1360 | 
                                      { "sType": "title-string", "aTargets" : [ "title-string" ] }, | 
            
            
              | 1361 | 
                                      { 'sType': "anti-the", 'aTargets' : [ 'anti-the'] } | 
            
            
              | 1362 | 
                                  ]  | 
            
            
              | 1363 | 
                              }));  | 
            
            
              | 1364 | 
                              if($("td.dataTables_empty").length == 0){ | 
            
            
              | 1365 | 
                                   $("#mana_search").show(); | 
            
            
              | 1366 | 
                              }  | 
            
            
              | 1367 | 
               | 
            
            
              | 1368 | 
                              $( "select[class='actionreport1']" ).show();  | 
            
            
              | 1369 | 
                              $( "button[class='actionreport2']" ).hide();  | 
            
            
              | 1370 | 
                              $("#CommentButton").on("click", function(){ | 
            
            
              | 1371 | 
                                  var resource_type = "report";  | 
            
            
              | 1372 | 
                                  var target_id = $("#selected_id").val(); | 
            
            
              | 1373 | 
                                  var manamsg = $("#manamsg").val(); | 
            
            
              | 1374 | 
                                  mana_comment(target_id, manamsg, resource_type);  | 
            
            
              | 1375 | 
                                  $("#comment_box").modal("hide"); | 
            
            
              | 1376 | 
                              });  | 
            
            
              | 1377 | 
               | 
            
            
              | 1378 | 
                              $(".showbutton").on("click", function(){ | 
            
            
              | 1379 | 
                                  $(this).parent().hide();  | 
            
            
              | 1380 | 
                                  $(this).parent().next().show();  | 
            
            
              | 1381 | 
                              });  | 
            
            
              | 1382 | 
               | 
            
            
              | 1383 | 
                              $("a[class='hidebutton']").on("click", function(){ | 
            
            
              | 1384 | 
                                  $(this).parent().hide();  | 
            
            
              | 1385 | 
                                  $(this).parent().prev().show();  | 
            
            
              | 1386 | 
                              });  | 
            
            
              | 1387 | 
               | 
            
            
              | 1388 | 
                              $("#commentCloseButton").on("click", function(){ | 
            
            
              | 1389 | 
                                  $("#comment_box").modal("hide"); | 
            
            
              | 1390 | 
                              });  | 
            
            
              | 1391 | 
               | 
            
            
              | 1392 | 
                              $(".actionreport1").on("click", function(){ | 
            
            
              | 1393 | 
                                  $("#selectedcomment").val($(this).val()); | 
            
            
              | 1394 | 
                                  $(this).parent("select").hide(); | 
            
            
              | 1395 | 
                                  $(this).parent("select").next().show(); | 
            
            
              | 1396 | 
                              });  | 
            
            
              | 1397 | 
               | 
            
            
              | 1398 | 
                              $(".actionreport2").on("click", function(){ | 
            
            
              | 1399 | 
                                  $(this).hide();  | 
            
            
              | 1400 | 
                                  $(this).prev().show();  | 
            
            
              | 1401 | 
                                  mana_increment($("#selectedcomment").val(), 'resource_comment', 'nb', -1); | 
            
            
              | 1402 | 
                              });  | 
            
            
              | 1403 | 
                          }).fail( function( result ){ | 
            
            
              | 1404 | 
                          });  | 
            
            
              | 1405 | 
                      }  | 
            
            
              | 1406 | 
               | 
            
            
              | 1407 | 
                      function mana_comment( target_id, manamsg, resource_type ){ | 
            
            
              | 1408 | 
                          $.ajax( { | 
            
            
              | 1409 | 
                              type: "POST",  | 
            
            
              | 1410 | 
                              url: "/cgi-bin/koha/svc/mana/share",  | 
            
            
              | 1411 | 
                              data: {message: manamsg, resource: resource_type , resource_id: target_id}, | 
            
            
              | 1412 | 
                              datatype: "json",  | 
            
            
              | 1413 | 
                          })  | 
            
            
              | 1414 | 
                      }  | 
            
        
          | 1415 | 
           | 
          1311 | 
           | 
        
        
          | 1416 | 
                  function addColumn() { | 
          1312 | 
                  function addColumn() { | 
        
        
          | 1417 | 
                      $("#availableColumns option:selected").clone().appendTo("#selectedColumns").attr("selected", "selected"); | 
          1313 | 
                      $("#availableColumns option:selected").clone().appendTo("#selectedColumns").attr("selected", "selected"); |