How to create a message box with 3 buttons in Koha?
Hello I would like to work on Bug 7791 "Deleting basket should not delete all existing orders without warning" My idea : If there are non cancelled orders in the baskets, create a js popup alert giving the choice between : - Cancel (do NOT supress the basket) - Supress the basket and all the orders within - Supress the basket and all the orders within AND all the records if possible But I don't know the best way for creating a popup with 3 choices according to Koha guidelines (maybe jquery "dialog" box?). All examples I found are "confirm" boxes with only 2 buttons. Could you tell me how you would do that, or an example of a template with currently 3 buttons in a js popup ? Regards, Mathieu -- Mathieu Saby Service d'Informatique Documentaire Service Commun de la Documentation Université Rennes 2 Téléphone : 02 99 14 12 65 Courriel : mathieu.saby@univ-rennes2.fr
My idea : If there are non cancelled orders in the baskets, create a js popup alert
You can't create a JavaScript-only alert with three buttons. This does not exist. I see a couple of choices: 1. Handle the operation without JavaScript and use a <div class="dialog alert"> in the body of the page to offer the choice of actions. Of course this would involve a trip to the server and a page reload. 2. Use a Bootstrap modal: http://getbootstrap.com/2.3.2/javascript.html#modals An example of this can be found in acqui/basket.tt. Option 2 is probably most like what you're imagining. -- Owen -- Web Developer Athens County Public Libraries http://www.myacpl.org
Owen Leonard a écrit :
My idea : If there are non cancelled orders in the baskets, create a js popup alert
You can't create a JavaScript-only alert with three buttons. This does not exist.
I see a couple of choices:
1. Handle the operation without JavaScript and use a <div class="dialog alert"> in the body of the page to offer the choice of actions. Of course this would involve a trip to the server and a page reload.
I have seen things like that, yes. Maybe to big a change.
2. Use a Bootstrap modal: http://getbootstrap.com/2.3.2/javascript.html#modals An example of this can be found in acqui/basket.tt.
Option 2 is probably most like what you're imagining.
-- Owen
That's it! I had thought using jquery ui "dialog" like on that page, but I don't think it is used in Koha : http://jqueryui.com/dialog/#modal-confirmation Thanks a lot -- Mathieu Saby Service d'Informatique Documentaire Service Commun de la Documentation Université Rennes 2 Téléphone : 02 99 14 12 65 Courriel : mathieu.saby@univ-rennes2.fr
Hi Owen I've made a patch for bug 7791, with a bootstrap modal : http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7791 I hope I have understood the way it works... M. Saby Mathieu Saby a écrit :
Owen Leonard a écrit :
My idea : If there are non cancelled orders in the baskets, create a js popup alert
You can't create a JavaScript-only alert with three buttons. This does not exist.
I see a couple of choices:
1. Handle the operation without JavaScript and use a <div class="dialog alert"> in the body of the page to offer the choice of actions. Of course this would involve a trip to the server and a page reload.
I have seen things like that, yes. Maybe to big a change.
2. Use a Bootstrap modal: http://getbootstrap.com/2.3.2/javascript.html#modals An example of this can be found in acqui/basket.tt.
Option 2 is probably most like what you're imagining.
-- Owen
That's it!
I had thought using jquery ui "dialog" like on that page, but I don't think it is used in Koha : http://jqueryui.com/dialog/#modal-confirmation
Thanks a lot -- Mathieu Saby Service d'Informatique Documentaire Service Commun de la Documentation Université Rennes 2 Téléphone : 02 99 14 12 65 Courriel : mathieu.saby@univ-rennes2.fr
------------------------------------------------------------------------
_______________________________________________ Koha-devel mailing list Koha-devel@lists.koha-community.org http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-devel website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/
-- Mathieu Saby Service d'Informatique Documentaire Service Commun de la Documentation Université Rennes 2 Téléphone : 02 99 14 12 65 Courriel : mathieu.saby@univ-rennes2.fr
participants (2)
-
Mathieu Saby -
Owen Leonard