Skip to content
Snippets Groups Projects
Commit 647f8332 authored by Rasmus Fuhse's avatar Rasmus Fuhse
Browse files

Resolve "TIC: Einfacheres Arbeiten mit dem Formbuilder"

Closes #4117

Merge request studip/studip!2960
parent 555475cd
No related branches found
No related tags found
No related merge requests found
......@@ -297,6 +297,8 @@ class Form extends Part
\PageLayout::postSuccess($this->success_message);
}
page_close();
//This indicates that the form has been stored successfully.
echo "STUDIPFORM_STORE_SUCCESS";
die();
}
}
......
......@@ -150,12 +150,17 @@ abstract class Input
}
/**
* Returns the value of this input.
* @return null
* Returns the value of this input. If $this->value is a callable this->getValue() returns the computed result.
* @return mixed
*/
public function getValue()
{
return $this->value;
if (is_callable($this->value)) {
$callable = $this->value;
return $callable();
} else {
return $this->value;
}
}
/**
......
import { $gettext, $gettextInterpolate } from '../lib/gettext';
import Report from '../lib/report.js';
// Allow fieldsets to collapse
$(document).on(
......@@ -291,9 +292,12 @@ STUDIP.ready(function () {
url: v.STUDIPFORM_AUTOSAVEURL,
data: params,
type: 'post',
success() {
if (v.STUDIPFORM_REDIRECTURL) {
window.location.href = v.STUDIPFORM_REDIRECTURL
success(output) {
if (output === 'STUDIPFORM_STORE_SUCCESS' && v.STUDIPFORM_REDIRECTURL) {
//The form has been stored successfully:
window.location.href = v.STUDIPFORM_REDIRECTURL;
} else if (output !== 'STUDIPFORM_STORE_SUCCESS') {
Report.error($gettext('Es ist ein Fehler aufgetreten'), output);
}
}
});
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment