]> git.plutz.net Git - invoices/commitdiff
different redirect targets for form submit
authorPaul Hänsch <paul@plutz.net>
Thu, 30 Nov 2023 11:33:37 +0000 (12:33 +0100)
committerPaul Hänsch <paul@plutz.net>
Thu, 30 Nov 2023 11:33:37 +0000 (12:33 +0100)
invoices.cgi

index 22d3da32739ab27a3c9fa3829028b5b90781b3b1..35847fe964707a5759bd808e2c7ecd2b25ab1d83 100755 (executable)
@@ -33,7 +33,7 @@ serverkey' >.gitignore
     DB3 write "$file"
     REDIRECT "/doc/${id}"
     ;;
-  update_invoice)
+  update_invoice|update_invoice_return)
     id="$(POST id)" file="$_DATA/${id}.kvd" seq=''
     if [ "$(POST tid)" = "$(transid "$file")" ] && LOCK "$file"; then
       DB3 open "$file"
@@ -55,7 +55,11 @@ serverkey' >.gitignore
     else
       debug "TID mismatch updating $file"
     fi
-    REDIRECT "$PATH_INFO"
+    if [ $(POST action) = update_invoice_return ]; then
+      REDIRECT /
+    else
+      REDIRECT "$PATH_INFO"
+    fi
     ;;
   pdf_export)
     id="$(POST id)" file="$_DATA/${id}.kvd" tmp="$(randomid)"