Skip to content

Commit ac557e3

Browse files
committed
feat(question): forbid use of some qustion types with public forms
Signed-off-by: btry <tbugier@teclib.com>
1 parent 4969e64 commit ac557e3

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+401
-31
lines changed

inc/fieldinterface.class.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -192,4 +192,10 @@ public function greaterThan($value);
192192
* @return boolean True if the value is less than the field value
193193
*/
194194
public function LessThan($value);
195+
196+
/**
197+
* Is the field compatible with anonymous form ?
198+
* @return boolean true if the field can work with anonymous forms
199+
*/
200+
public function isAnonymousFormCompatible();
195201
}

inc/fields/actorfield.class.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -293,4 +293,8 @@ public function greaterThan($value) {
293293
public function lessThan($value) {
294294
throw new PluginFormcreatorComparisonException('Meaningless comparison');
295295
}
296+
297+
public function isAnonymousFormCompatible() {
298+
return false;
299+
}
296300
}

inc/fields/checkboxesfield.class.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -280,4 +280,8 @@ public function greaterThan($value) {
280280
public function lessThan($value) {
281281
throw new PluginFormcreatorComparisonException('Meaningless comparison');
282282
}
283+
284+
public function isAnonymousFormCompatible() {
285+
return true;
286+
}
283287
}

inc/fields/datefield.class.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,4 +160,8 @@ public function parseAnswerValues($input) {
160160
$this->value = $input[$key];
161161
return true;
162162
}
163+
164+
public function isAnonymousFormCompatible() {
165+
return true;
166+
}
163167
}

inc/fields/datetimefield.class.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,4 +162,8 @@ public function parseAnswerValues($input) {
162162
$this->value = $input[$key];
163163
return true;
164164
}
165+
166+
public function isAnonymousFormCompatible() {
167+
return true;
168+
}
165169
}

inc/fields/descriptionfield.class.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,4 +130,8 @@ public function lessThan($value) {
130130
public function parseAnswerValues($input) {
131131
return true;
132132
}
133+
134+
public function isAnonymousFormCompatible() {
135+
return true;
136+
}
133137
}

inc/fields/dropdownfield.class.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -330,4 +330,8 @@ public function parseAnswerValues($input) {
330330
$this->value = $input[$key];
331331
return true;
332332
}
333+
334+
public function isAnonymousFormCompatible() {
335+
return false;
336+
}
333337
}

inc/fields/emailfield.class.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,4 +173,8 @@ public function greaterThan($value) {
173173
public function lessThan($value) {
174174
throw new PluginFormcreatorComparisonException('Meaningless comparison');
175175
}
176+
177+
public function isAnonymousFormCompatible() {
178+
return true;
179+
}
176180
}

inc/fields/filefield.class.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -228,4 +228,8 @@ public function greaterThan($value) {
228228
public function lessThan($value) {
229229
throw new PluginFormcreatorComparisonException('Meaningless comparison');
230230
}
231+
232+
public function isAnonymousFormCompatible() {
233+
return true;
234+
}
231235
}

inc/fields/floatfield.class.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -250,4 +250,8 @@ public function greaterThan($value) {
250250
public function lessThan($value) {
251251
return !$this->greaterThan($value) && !$this->equals($value);
252252
}
253+
254+
public function isAnonymousFormCompatible() {
255+
return true;
256+
}
253257
}

0 commit comments

Comments
 (0)