Fixed bug with adding attachments from the same principle. Closes #67
This commit is contained in:
parent
5b9b2139ce
commit
476768a32d
|
|
@ -47,6 +47,8 @@ echo $form->input("DocPage.content", array('class'=>'page', 'label'=>'Page', 'be
|
||||||
foreach($attachments as $index => $attachment) {
|
foreach($attachments as $index => $attachment) {
|
||||||
?>
|
?>
|
||||||
<tr>
|
<tr>
|
||||||
|
<?php echo $form->input('DocumentAttachment.document_id',
|
||||||
|
array('type'=>'hidden', 'value'=> $document['Document']['id'])); ?>
|
||||||
<td><?php echo $form->input("DocumentAttachment.{$index}.id",
|
<td><?php echo $form->input("DocumentAttachment.{$index}.id",
|
||||||
array('type'=>'checkbox',
|
array('type'=>'checkbox',
|
||||||
'value'=> $attachment['DocumentAttachment']['id'],
|
'value'=> $attachment['DocumentAttachment']['id'],
|
||||||
|
|
|
||||||
|
|
@ -15,7 +15,7 @@ $(function() {
|
||||||
buttons: {
|
buttons: {
|
||||||
"Add Attachment": function() {
|
"Add Attachment": function() {
|
||||||
|
|
||||||
var attachmentInputs = $('#DocumentAttachmentAddForm').find('input');
|
var attachmentInputs = $('#DocumentAttachmentAddForm').find('input:checked, #DocumentAttachmentDocumentId');
|
||||||
|
|
||||||
$.post('/documents/saveAttachments', attachmentInputs, function(data) {
|
$.post('/documents/saveAttachments', attachmentInputs, function(data) {
|
||||||
$("#addAttachmentModal").dialog( "close" );
|
$("#addAttachmentModal").dialog( "close" );
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue