Added some basic error checking for addedit line items

This commit is contained in:
Karl Cordes 2011-06-16 16:14:32 +10:00
parent 3a39d5ba63
commit 4cc13184c5
3 changed files with 28 additions and 5 deletions

6
vendors/pdfdoc.php vendored
View file

@ -121,8 +121,12 @@ ENDHTML;
$this->MultiCell($firstColWidth, 0, "$docTypeFullName TO:", 'LTR', 'L', 0, 0);
$this->MultiCell($secondColWidth, 0, $companyName, 'LTR', 'L', 0, 0);
$fromString = <<<ENDSTRING
<a href="mailto:{$fromEmail}">{$fromName}</a>
ENDSTRING;
$this->MultiCell($thirdColWidth, 0, "FROM:", 'LT', 'L', 0, 0);
$this->MultiCell($fourthColWidth, 0, "<a href=\"mailto:$fromEmail\">$fromName</a>", 'TR', 'L', false, 1, null,null, true,0,true, false, 0, null, false); //Start a new line after this.
$this->MultiCell($fourthColWidth, 0, $fromString, 'TR','L', 0, 1, null, null, true, 0, true); //Start a new line after this.
$this->MultiCell($firstColWidth, 0, "EMAIL TO:", 'LR', 'L', 0, 0);

View file

@ -38,10 +38,10 @@ foreach($document['DocPage'] as $page) {
$pdfdoc->DetailsBox($docTypeFullName, $companyName, $emailTo, $attention, $fromName,
$fromEmail, $enquiryNumber, $your_reference, $issue_date);
/*$pdfdoc->DetailsBoxHTML($docTypeFullName, $companyName, $emailTo, $attention, $fromName,
$fromEmail, $enquiryNumber, $your_reference, $issue_date);*/
$firstPageDone = true;
}

View file

@ -36,8 +36,16 @@ $(function() {
var thisLineItemInputs = $('#LineItemAddForm').find('input,select,textarea');
$.post('/line_items/ajax_add', thisLineItemInputs, function(data) {
$( "#addLineItemModal" ).dialog('close');
if(data == 'SUCCESS') {
$( "#addLineItemModal" ).dialog('close');
}
else {
alert("Line Item could not be saved")
$('#LineItemDescription').ckeditor(config);
}
});
},
@ -69,8 +77,19 @@ $(function() {
var thisLineItemInputs = $('#LineItemEditForm').find('input,select,textarea');
$.post('/line_items/ajax_edit', thisLineItemInputs, function(data) {
$( "#editLineItemModal" ).dialog('close');
if(data == 'SUCCESS') {
$( "#editLineItemModal" ).dialog('close');
}
else {
alert("Line Item could not be saved")
$('#LineItemDescription').ckeditor(config);
}
});
},