Sfoglia il codice sorgente

Success message and redirect url should also work for 'login require' types webforms

fixes https://github.com/frappe/erpnext/issues/9073
version-14
Manas Solanki 8 anni fa
parent
commit
bb7cfda345
1 ha cambiato i file con 4 aggiunte e 12 eliminazioni
  1. +4
    -12
      frappe/website/js/web_form.js

+ 4
- 12
frappe/website/js/web_form.js Vedi File

@@ -280,19 +280,11 @@ frappe.ready(function() {
callback: function(data) {
if(!data.exc) {
frappe.doc_name = data.message;
if(!frappe.login_required) {
$form.addClass("hide");
$(".comments, .introduction, .page-head").addClass("hide");
scroll(0, 0);
set_message(frappe.success_link, true);
} else {
set_message(__('Saved'));
}
$form.addClass("hide");
$(".comments, .introduction, .page-head").addClass("hide");
scroll(0, 0);
set_message(frappe.success_link, true);

if(frappe.is_new && frappe.login_required) {
// reload page (with ID)
window.location.href = window.location.pathname + "?name=" + frappe.doc_name;
}
if(for_payment && data.message) {
// redirect to payment
window.location.href = data.message;


Caricamento…
Annulla
Salva