diff --git a/views/elements/add_edit_line_item.ctp b/views/elements/add_edit_line_item.ctp
index 02e41515..95b2e0f8 100755
--- a/views/elements/add_edit_line_item.ctp
+++ b/views/elements/add_edit_line_item.ctp
@@ -1,4 +1,4 @@
- echo $form->input('Product.principle_id', array('id'=>'principleAttachmentSelect', 'label'=>'Principle','empty'=>'Select Principle'));?>
+ echo $form->input('Product.principle_id', array('id'=>'principleSelect', 'label'=>'Principle','empty'=>'Select Principle'));?>
diff --git a/webroot/css/quotenik.css b/webroot/css/quotenik.css
index 6416cfa1..f0b724b3 100755
--- a/webroot/css/quotenik.css
+++ b/webroot/css/quotenik.css
@@ -1578,6 +1578,7 @@ div.address span {
}
table.lineItems {
+ margin-top: 0.2em;
border: 1px solid;
border-spacing: 0px;
}
@@ -1647,8 +1648,8 @@ div.warning {
tr.no_items {
- font-size: 2em;
- padding: 0.5em;
+ font-size: 1.5em;
+ padding: 1em;
}
#Attachments {
margin-top: 1.5em;
diff --git a/webroot/js/document_attachments.js b/webroot/js/document_attachments.js
index ac567008..7baf2960 100644
--- a/webroot/js/document_attachments.js
+++ b/webroot/js/document_attachments.js
@@ -18,24 +18,18 @@ $(function() {
var attachmentInputs = $('#DocumentAttachmentAddForm').find('input');
$.post('/documents/saveAttachments', attachmentInputs, function(data) {
- if(data == 'SUCCESS') {
- loadAttachments();
- $(this).dialog('close');
- }
- else {
- alert("Attachments could not be saved")
- }
-
+ $("#addAttachmentModal").dialog( "close" );
});
+
},
Cancel: function() {
$( this ).dialog( "close" );
- }
+ }
},
close: function() {
loadAttachments();
- }
+ }
});
@@ -45,6 +39,10 @@ $(function() {
loadPrincipleAttachments(principleID);
});
+ $("#removeAttachments").click(function() {
+ removeAttachments();
+ });
+
function loadPrincipleAttachments(id) {
$.get('/documents/getAttachmentsByPrinciple/'+id, function(attachments) {
$('#principleAttachments').html(attachments);
@@ -52,13 +50,17 @@ $(function() {
}
function loadAttachments() {
-
$.get('/documents/getAttachments/'+documentID, function(attachments) {
-
-
+ $("#attachments-table").html(attachments);
});
-
-
+ }
+
+ function removeAttachments() {
+ var selectedAttachments = $(".documentAttachment-checkbox:checked");
+ $.post('/documents/removeAttachments', selectedAttachments, function(data) {
+ loadAttachments();
+ });
+
}
});