- | input('DocumentAttachment.id', array('type'=>'checkbox', 'value'=> $attachment['DocumentAttachment']['id'], 'label' => false, 'class'=>'documentAttachment-checkbox')); ?> |
+ input("DocumentAttachment.{$index}.id", array('type'=>'checkbox', 'value'=> $attachment['DocumentAttachment']['id'], 'label' => false, 'class'=>'documentAttachment-checkbox')); ?> |
link($attachment['Attachment']['filename'], '/attachments/view/'.$attachment['Attachment']['id']); ?>
|
diff --git a/app/views/documents/view.ctp b/app/views/documents/view.ctp
index 6a4da433..0c261447 100755
--- a/app/views/documents/view.ctp
+++ b/app/views/documents/view.ctp
@@ -47,7 +47,7 @@ echo $form->input("DocPage.content", array('class'=>'page', 'label'=>'Page', 'be
foreach($attachments as $index => $attachment) {
?>
- | input("DocumentAttachment[{$index}].id",
+ | input("DocumentAttachment.{$index}.id",
array('type'=>'checkbox',
'value'=> $attachment['DocumentAttachment']['id'],
'label' => false, 'class'=>'documentAttachment-checkbox')); ?> |
diff --git a/app/webroot/js/document_add_edit.js b/app/webroot/js/document_add_edit.js
index c07fba4c..ff13d715 100755
--- a/app/webroot/js/document_add_edit.js
+++ b/app/webroot/js/document_add_edit.js
@@ -544,16 +544,9 @@ function savePages() {
});
$.post('/documents/ajax_edit', docPages, function(data) {
- if(data =='SUCCESS') {
$("#flashMessage").html("Pages Saved Successfully");
- }
- else {
- $("#flashMessage").html("Unable to Save Pages");
- }
-
- $("#flashMessage").show();
-
- loadLineItems();
+ $("#flashMessage").show();
+ loadLineItems();
});
}
diff --git a/app/webroot/js/document_attachments.js b/app/webroot/js/document_attachments.js
index 7baf2960..7fd8feeb 100755
--- a/app/webroot/js/document_attachments.js
+++ b/app/webroot/js/document_attachments.js
@@ -57,7 +57,7 @@ $(function() {
function removeAttachments() {
var selectedAttachments = $(".documentAttachment-checkbox:checked");
- $.post('/documents/removeAttachments', selectedAttachments, function(data) {
+ $.post('/documents/removeAttachments', selectedAttachments, function(data) {
loadAttachments();
});