FOSSology  3.2.0rc1
Open Source License Compliance by Open Source Software
ui-clearing-view_bulk.js
1 /*
2  Copyright (C) 2015,2018 Siemens AG
3  Author: maximilian.huber@tngtech.com
4 
5  This program is free software; you can redistribute it and/or
6  modify it under the terms of the GNU General Public License
7  version 2 as published by the Free Software Foundation.
8 
9  This program is distributed in the hope that it will be useful,
10  but WITHOUT ANY WARRANTY; without even the implied warranty of
11  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  GNU General Public License for more details.
13 
14  You should have received a copy of the GNU General Public License along
15  with this program; if not, write to the Free Software Foundation, Inc.,
16  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
17  */
18 
19 var bulkFormTableContent = (function(){
20  var content = [];
21  function updateTable(){
22  var s = "";
23  var uploadTreeId = $('#uploadTreeId').val();
24  for (i = 0; i < content.length; ++i) {
25  s += "<tr class=\"" + ((i % 2 == 1) ? "even" : "odd") + "\">"
26  + "<td align=\"center\">" + content[i].action + "</td>"
27  + "<td>" + content[i].licenseName + "</td>"
28  + "<td><a href=\"javascript:;\" style=\"color:#000000;\" id='" + content[i].licenseId + "reportinfoBulk'"
29  + "onclick=\"openTextModel("+ uploadTreeId +", " + content[i].licenseId + ", 'reportinfo', 'Bulk');\" title=''>Click to add</a></td>"
30  + "<td><a href=\"javascript:;\" style=\"color:#000000;\" id='" + content[i].licenseId + "acknowledgementBulk'"
31  + "onclick=\"openTextModel("+ uploadTreeId +", " + content[i].licenseId + ", 'acknowledgement', 'Bulk');\" title=''>Click to add</a></td>"
32  + "<td><a href=\"javascript:;\" style=\"color:#000000;\" id='" + content[i].licenseId + "commentBulk'"
33  + "onclick=\"openTextModel("+ uploadTreeId +", " + content[i].licenseId + ", 'comment', 'Bulk');\" title=''>Click to add</a></td>"
34  + "<td><a href='#' onclick='bulkFormTableContent[2](" + content[i].licenseId + ")'>"
35  + "<img src=\"images/icons/remove_16.png\" title=\"remove selected license row\" alt=\"-\"/></a></td>"
36  + "</tr>";
37  }
38  $('#bulkFormTable tbody').html(s);
39  }
40  function maybeRemoveOldEntry(lic){
41  for (i = 0; i < content.length; ++i) {
42  if (content[i].licenseId === lic){
43  content.splice(i, 1);
44  return;
45  }
46  }
47  }
48  function removeOldEntry(lic){
49  maybeRemoveOldEntry(lic);
50  updateTable();
51  }
52  function addLicense(){
53  var lic = parseInt($('#bulkLicense').val(), 10)
54  if(lic > 0){
55  maybeRemoveOldEntry(lic);
56  content.push({
57  licenseId: lic,
58  licenseName: $('#bulkLicense option:selected').text(),
59  action: "Add"
60  });
61  }
62  updateTable();
63  }
64  function rmLicense(){
65  var lic = parseInt($('#bulkLicense').val(), 10)
66  if(lic > 0){
67  maybeRemoveOldEntry(lic);
68  content.push({
69  licenseId: lic,
70  licenseName: $('#bulkLicense option:selected').text(),
71  action: "Remove"
72  });
73  }
74  updateTable();
75  }
76  function getContent(){
77  return content;
78  }
79  return [addLicense,rmLicense,removeOldEntry,getContent];
80 }());
81 
82 $('#bulkFormAddLicense').click(function(){ bulkFormTableContent[0](); });
83 $('#bulkFormRmLicense').click(function(){ bulkFormTableContent[1](); });
84 
85 function getBulkFormTableContent(){ return bulkFormTableContent[3](); }
int s
The socket that the CLI will use to communicate.
Definition: fo_cli.c:48
if(!preg_match("/\s$projectGroup\s/", $groups)&&(posix_getgid()!=$gInfo['gid']))
get monk license list of one specified uploadtree_id
Definition: migratetest.php:44