phpBMS

Ticket #215 (new enhancement)

Opened 4 years ago

Last modified 2 years ago

Check For Changes before Navigating Away From Page

Reported by: Thomas Owned by: brieb
Priority: minor Milestone: unknown
Component: phpbms Version: 0.92
Keywords: Cc:

Description

In the invoice_addedit, it is possible to print the invoice before saving any change done, in that case, all changes are lost on the order when coming back.

It would be safer to request a save changes before printing or simply not show the button until all changes are saved.

Change History

Changed 4 years ago by brieb

This actually points to a fundamental problem (well sort of) with all phpbms (indeed many web applications). There are many areas where you might want to confirm with users that changes have been made before leaving the page. For instance, at any time during creation or edit you can use the menu system to navigate away from the page despite any form entry you may have performed.

Take the sales order screen. If you are editing an existing sales order, at any time, you can click on the attachments tab and you will lose any changes you might have put into the order itself.

Now given this fundamental flaw, we can still do some small things easily to curb the chances of this happen - removing the print button on new sales orders is one of them.

Thomas,

This is a great candidate for helping contribute to the code. The changes needed to implment this are small. Try checking out the trunk using svn, make the necessary changes, and then create a patch. You can then submit the patch as an attachment to this ticket. If everything looks good, we'll apply the patch and commit it!

Changed 4 years ago by Thomas

OK, I'll check that out and come back with a proposal.

Changed 4 years ago by Thomas

My proposal is to add a new function in the invoice.js, disablePrints, in the function we'll go through theform collection to disable the button Print when the lineitemschanged is true. The call to the function can be done from the MarkChanged? function of lineitems object.

I need to figure out how to use SVN now and post the patch.

Changed 4 years ago by Thomas

Hi bried,

Is my proposition that bad, that you don't even want to reply?

Changed 4 years ago by brieb

Sorry Thomas. I had been getting an unusually high amount of spam, and must of missed the notification e-mail for this ticket. The markChanged function for line items only signifies when line items have been changed, and not when the invoice has changed (like the payment)

I suggest that as a partial solution, we remove or disable the print button from NEW orders (if there is not id set). This would at least prevent people from clicking the print button on a new order.

The full, nice, and super complex solution would be to use the new JavaScript? listeners format, and add an onchange listener to all non-hidden form elements that when changed, sets a flag. Next a second set of listerns would go on the print button and tab links (and possibly the menu?) that would pop a warning that the "record has changed, are you sure you want to proceed (all changes would be lost)" type thing. This can be complicated, and possibly warrants more research.

Changed 2 years ago by brieb

  • summary changed from In V0.92, before allowing to print, check if any modifications were performed on the lineitems to Check For Changes before Navigating Away From Page

Changed 2 years ago by brieb

  • type changed from defect to enhancement

Changed 2 years ago by brieb

  • keywords Print invoice removed
Note: See TracTickets for help on using tickets.
Scanned by Orvant Copyright © 2010 Kreotek, LLC. All Rights reserved.