Invert submitOnce on UI
Signed-off-by: Jonas Rittershofer <jotoeri@users.noreply.github.com>
This commit is contained in:
parent
8779ded0dc
commit
3ed4fef4fa
|
@ -174,6 +174,7 @@ class ApiController extends Controller {
|
|||
$form->setAccess([
|
||||
'type' => 'public'
|
||||
]);
|
||||
$form->setSubmitOnce(true);
|
||||
|
||||
$this->formMapper->insert($form);
|
||||
|
||||
|
|
|
@ -48,13 +48,13 @@
|
|||
</li>
|
||||
<li>
|
||||
<input id="submitOnce"
|
||||
v-model="form.submitOnce"
|
||||
v-model="submitMultiple"
|
||||
:disabled="isPublic || form.isAnonymous"
|
||||
type="checkbox"
|
||||
class="checkbox"
|
||||
@change="onSubmitOnceChange">
|
||||
<label for="submitOnce">
|
||||
{{ t('forms', 'Only allow one response per user') }}
|
||||
{{ t('forms', 'Allow multiple responses per person') }}
|
||||
</label>
|
||||
</li>
|
||||
<li>
|
||||
|
@ -177,6 +177,19 @@ export default {
|
|||
return window.location.protocol + '//' + window.location.host + generateUrl(`/apps/forms/${this.form.hash}`)
|
||||
},
|
||||
|
||||
// Inverting submitOnce for UI here. Adapt downto Db for V3, if this imposes for longterm.
|
||||
submitMultiple: {
|
||||
get() {
|
||||
if (this.form.access.type === 'public' || this.form.isAnonymous) {
|
||||
return true
|
||||
}
|
||||
return !this.form.submitOnce
|
||||
},
|
||||
set(submitMultiple) {
|
||||
this.form.submitOnce = !submitMultiple
|
||||
},
|
||||
},
|
||||
|
||||
formExpires: {
|
||||
get() {
|
||||
return this.form.expires !== 0
|
||||
|
|
Loading…
Reference in a new issue