diff --git a/views/tenders/edit.ctp b/views/tenders/edit.ctp new file mode 100644 index 0000000..899bcae --- /dev/null +++ b/views/tenders/edit.ctp @@ -0,0 +1,91 @@ +' . "\n"; + +?> + +create('Tender', array('action' => 'edit')) . "\n"; +echo $form->input('id') . "\n"; + +if (empty($this->data['Tender'])) + INTERNAL_ERROR('Creation of new Tender not allowed.'); + +echo $form->input('tender_type_id', + array('div' => 'tender', + // REVISIT : 20090810 + // We're not ready to allow changing the type + // of a tender, since it will force us to deal + // with changing the LedgerEntry account (easy) + // and the associated StatementEntry accounts + // (not too hard), and make sure the tender has + // not been deposited (easy), and then deal with + // any corner cases that pop up. + 'disabled' => true, + 'onclick' => ('switchTenderType(' . + '"tender-type-div", ' . + '$(this).attr("id")' . + ')'), + )) . "\n"; + +$form->input('comment'); +foreach ($types AS $type) { + $type = $type['TenderType']; + echo('data['TenderType']['id'] + ? ' STYLE="display:none;"' : '') . + '>' . "\n"); + + echo ('' . "\n"); + + for ($i=1; $i<=4; ++$i) { + if (!empty($type["data{$i}_name"])) { + echo ("\n"); + echo $form->input("type.{$type['id']}.data$i", + array('label' => $type["data{$i}_name"], + 'div' => 'input text tender', + 'value' => + ($type['id'] == $this->data['TenderType']['id'] + ? $this->data['Tender']["data$i"] : null), + )) . "\n"; + +/* echo ('
' . */ +/* ' ' . */ +/* $type["data{$i}_name"] . */ +/* '' . "\n" . */ +/* '
' . "\n"); */ + } + } + + echo('' . "\n"); +} + +echo $form->submit('Update') . "\n"; +echo $form->submit('Cancel', array('name' => 'cancel')) . "\n"; +echo $form->end() . "\n"; +echo '' . "\n";