-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
It's over. Pending only review and clean after delivery.
- Loading branch information
Showing
23 changed files
with
774 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
/** | ||
* | ||
*/ | ||
|
||
var addThread; | ||
var addThreadValue; | ||
var note; | ||
var noteId; | ||
var companyTelephone; | ||
var companyEmail; | ||
|
||
$('#newThreadButton').click(function() { | ||
origin = "Supplier"; | ||
addIdsList(); | ||
|
||
}); | ||
|
||
function addIdsList() { | ||
|
||
var table = document.getElementById("list"); | ||
for(var i=0; i<table.rows.length - 1;i++){ | ||
//addThread = table.rows[i+1].cells[0].innerHTML.getElementsByTagName('input')[0].checked; | ||
addThreadValue = table.rows[i+1].cells[0].getElementsByTagName('input')[0].checked; | ||
// addThreadValue = table.rows[i+1].cells[0].getElementById("addThread").checked; | ||
if(addThreadValue) { | ||
noteId = table.rows[i+1].cells[1].innerHTML; | ||
createAndFillIds(noteId, i); | ||
} | ||
} | ||
} | ||
|
||
|
||
function getData(row) { | ||
// addThread = row.getElementsById("addThread"); | ||
//companyName = company.getElementsByTagName("companyName")[0]; | ||
// addThreadValue = row.getElementsById("noteId"); | ||
//companyNameValue = companyName.childNodes[0].nodeValue; | ||
addThread = row.cells[0]; | ||
noteId = row.cells[1]; | ||
} | ||
|
||
function createAndFillIds(noteId, i) { | ||
// get reference to select element | ||
var listNode; | ||
listNode = document.getElementById('noteIdsList'); | ||
// create new option element | ||
var input = document.createElement('input'); | ||
input.setAttribute("type", "hidden"); | ||
input.setAttribute("class", "form-control"); | ||
input.setAttribute("name", "IdsList"); | ||
input.setAttribute("id", "noteId" + i); | ||
input.setAttribute("value", noteId); | ||
// create text node to add to option element (opt) | ||
//input.appendChild( document.createAttribute("type") ); | ||
|
||
// set value property of opt | ||
//opt.value = companyIdValue; | ||
// add opt to end of select box (sel) | ||
listNode.appendChild(input); | ||
} | ||
|
||
function process(responseXML) { | ||
if (responseXML == null) { | ||
alert("There is no answer from the Server."); | ||
return false; | ||
} else { | ||
companies = responseXML.getElementsByTagName("company"); | ||
if (companies.length > 0) { | ||
for (loop = 0; loop < company.length; loop++) { | ||
getData(companies[loop]); | ||
createAndFillInOption(origin); | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
<%@page import="java.util.Date"%> | ||
<%@page import="java.util.Iterator"%> | ||
<%@page import="model.BusinessNoteVO"%> | ||
<%@page import="java.util.List"%> | ||
<%@ page language="java" contentType="text/html; charset=ISO-8859-1" | ||
pageEncoding="ISO-8859-1"%> | ||
<!DOCTYPE html > | ||
<html lang="en"> | ||
<head> | ||
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> | ||
<link href="bootstrap/css/bootstrap.min.css" rel="stylesheet" /> | ||
<script src="bootstrap/jquery/jquery-2.1.3.min.js"></script> | ||
<script src="bootstrap/js/bootstrap.min.js"></script> | ||
<title>Thread Modal</title> | ||
</head> | ||
<body> | ||
<!-- INI MODALS --> | ||
|
||
<div id="NewThreadModalForm" class="modal fade" role="dialog"> | ||
<div class="modal-dialog"> | ||
|
||
<!-- Modal content--> | ||
<div class="modal-content"> | ||
<form id="newThreadModalForm" class="form-horizontal" role="form" action="notes/addElement" method="POST"> | ||
<input type="hidden" name="nextStep" id="nextStep" value="addThread"/> | ||
<input type="hidden" name="screenOrigin" value="notesListForm"/> | ||
|
||
<div class="modal-header"> | ||
<button type="button" class="close" data-dismiss="modal">×</button> | ||
<h4 class="modal-title">New Thread</h4> | ||
</div> | ||
|
||
<div class="modal-body"> | ||
<div class="form-group"> | ||
<label class="control-label col-sm-4" for="threadTitle">Thread Title:</label> | ||
<div class="col-sm-8"> | ||
<input type="text" class="form-control" name="threadTitle" id="threadTitle" | ||
placeholder="Enter title"> | ||
</div> | ||
</div> | ||
<div class="form-group"> | ||
<div class="col-sm-8" id=noteIdsList> | ||
</div> | ||
</div> | ||
</div> | ||
|
||
<div class="modal-footer"> | ||
<button type="submit" class="btn btn-default">Submit</button> | ||
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button> | ||
</div> | ||
</form> | ||
</div> | ||
</div> | ||
</div> | ||
<!-- FIN MODALS --> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
<%@page import="model.ThreadVO"%> | ||
<%@page import="java.util.Date"%> | ||
<%@page import="java.util.List"%> | ||
<%@page import="java.util.Iterator"%> | ||
<%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%> | ||
|
||
<!DOCTYPE html > | ||
<html lang="en"> | ||
<head> | ||
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> | ||
<link href="bootstrap/css/bootstrap.min.css" rel="stylesheet" /> | ||
<script src="bootstrap/jquery/jquery-2.1.3.min.js"></script> | ||
<script src="bootstrap/js/bootstrap.min.js"></script> | ||
<title>Threads List</title> | ||
</head> | ||
<body> | ||
<div class="container-fluid"> | ||
<div class="row"> | ||
<div class="col-sm-12"> | ||
<jsp:include page="dynamicNavBar.jsp" flush="true" /> | ||
</div> | ||
</div> | ||
|
||
<div class="well"> | ||
<h3>Threads List</h3> | ||
<p>Table showing all threads chronologically ordered.</p> | ||
</div> | ||
<table id="list" class="table table-condensed"> | ||
<thead> | ||
<tr> | ||
<th style="display:none;">threadId</th> | ||
<th>Creation Date</th> | ||
<th>Title</th> | ||
<th>Number of Notes</th> | ||
<th></th> | ||
<th></th> | ||
</tr> | ||
</thead> | ||
<tbody> | ||
<% | ||
List<ThreadVO> threadsList = (List<ThreadVO>)request.getAttribute("threadsList"); | ||
Iterator<ThreadVO> iterator = threadsList.iterator(); | ||
while (iterator.hasNext()) { | ||
ThreadVO thread = (ThreadVO) iterator.next(); | ||
int threadId = thread.getThreadId(); | ||
Date creationDate = thread.getCreationDate(); | ||
String threadTitle = thread.getThreadTitle(); | ||
Integer notesNumber = thread.getNotesList().size(); | ||
%> | ||
<tr> | ||
<td style="display:none;"><%=threadId%></td> | ||
<td><%=creationDate%></td> | ||
<td><%=threadTitle%></td> | ||
<td><%=notesNumber%></td> | ||
<td><a href="#">View</a></td> | ||
<td><a href="#">Delete</a></td> | ||
</tr> | ||
<% | ||
} | ||
%> | ||
</tbody> | ||
</table> | ||
</div> | ||
|
||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.