From a1fd9cd45203475bb61792aa01393e5c66fd0a3a Mon Sep 17 00:00:00 2001
From: Szymon Olewniczak
Date: Tue, 9 Jan 2018 14:29:10 +0100
Subject: [PATCH 01/50] class hierarchy
---
helper/fieldmulticheck.php | 9 ++++++
helper/fieldmultiselect.php | 60 +++++++++++++++++++++++++++++++++++++
2 files changed, 69 insertions(+)
create mode 100644 helper/fieldmulticheck.php
create mode 100644 helper/fieldmultiselect.php
diff --git a/helper/fieldmulticheck.php b/helper/fieldmulticheck.php
new file mode 100644
index 0000000..e3bd641
--- /dev/null
+++ b/helper/fieldmulticheck.php
@@ -0,0 +1,9 @@
+init($args);
+ $this->opt['args'] = array_map('trim', explode('|',array_shift($args)));
+ $this->standardArgs($args);
+ if (!isset($this->opt['value']) && isset($this->opt['optional'])) {
+ array_unshift($this->opt['args'],' ');
+ }
+ }
+
+ /**
+ * Render the field as XHTML
+ *
+ * Outputs the represented field using the passed Doku_Form object.
+ * Additional parameters (CSS class & HTML name) are passed in $params.
+ *
+ * @params array $params Additional HTML specific parameters
+ * @params Doku_Form $form The target Doku_Form object
+ * @params int $formid unique identifier of the form which contains this field
+ */
+ public function renderfield($params, Doku_Form $form, $formid) {
+ $this->_handlePreload();
+ if(!$form->_infieldset){
+ $form->startFieldset('');
+ }
+ if ($this->error) {
+ $params['class'] = 'bureaucracy_error';
+ }
+ $params = array_merge($this->opt, $params);
+ $form->addElement(call_user_func_array('form_makeListboxField',
+ $this->_parse_tpl(
+ array(
+ '@@NAME@@',
+ $params['args'],
+ '@@VALUE|' . $params['args'][0] . '@@',
+ '@@DISPLAY@@',
+ '@@ID@@',
+ '@@CLASS@@'
+ ),
+ $params
+ )));
+ }
+}
\ No newline at end of file
From 91f85cb68acd701f2ebf6f985cd7c92b14cd798b Mon Sep 17 00:00:00 2001
From: Szymon Olewniczak
Date: Wed, 10 Jan 2018 11:38:40 +0100
Subject: [PATCH 02/50] multiple select for bureaucracy
this commit creates a syntax for multiple select:
multiselect "Label" "Opt1|Opt2|Opt3" =Opt1|Opt3
"=" - one or more default options
In mail action all options will be joined by ", " in e-mail message
In template action:
- if field is marked with "@" all selected options will be joined with page separator
- during template substitution all options will be joined by ", " or you can provide optional separator:
@@Label(separator)@@
needs docs update
---
helper/actionmail.php | 1 +
helper/actiontemplate.php | 1 +
helper/fieldmulticheck.php | 9 ------
helper/fieldmultiselect.php | 63 ++++++++++++++++++++++++++++++++-----
4 files changed, 58 insertions(+), 16 deletions(-)
delete mode 100644 helper/fieldmulticheck.php
diff --git a/helper/actionmail.php b/helper/actionmail.php
index dc32b76..a2aa5bf 100644
--- a/helper/actionmail.php
+++ b/helper/actionmail.php
@@ -140,6 +140,7 @@ protected function processFieldsBuildTable($fields, $mail) {
default:
if($value === null || $label === null) break;
+ if(is_array($value)) $value = implode(', ', $value);
list($html, $text) = $this->mail_buildRow($label, $value);
if(!is_null($field->getParam('replyto'))) {
diff --git a/helper/actiontemplate.php b/helper/actiontemplate.php
index 8e5a2cf..e2d86ee 100644
--- a/helper/actiontemplate.php
+++ b/helper/actiontemplate.php
@@ -70,6 +70,7 @@ protected function buildTargetPagename($fields, $sep) {
foreach ($fields as $field) {
$pname = $field->getParam('pagename');
if (!is_null($pname)) {
+ if (is_array($pname)) $pname = implode($sep, $pname);
$this->pagename .= $sep . $pname;
}
}
diff --git a/helper/fieldmulticheck.php b/helper/fieldmulticheck.php
deleted file mode 100644
index e3bd641..0000000
--- a/helper/fieldmulticheck.php
+++ /dev/null
@@ -1,9 +0,0 @@
-init($args);
$this->opt['args'] = array_map('trim', explode('|',array_shift($args)));
$this->standardArgs($args);
- if (!isset($this->opt['value']) && isset($this->opt['optional'])) {
- array_unshift($this->opt['args'],' ');
+ if (isset($this->opt['value'])) {
+ $this->opt['value'] = array_map('trim', explode('|', $this->opt['value']));
+ } else {
+ $this->opt['value'] = array();
}
}
+ /**
+ * Get the replacement pattern used by action
+ *
+ * @return string
+ */
+ public function getReplacementPattern() {
+ $label = $this->opt['label'];
+ $value = $this->opt['value'];
+
+ return '/(@@|##)' . preg_quote($label, '/') .
+ '(?:\((?P.*?)\))?' .//delimiter
+ '(?:\|(?P.*?))' . (count($value) == 0 ? '' : '?') .
+ '\1/si';
+ }
+
+ /**
+ * Used as an callback for preg_replace_callback
+ *
+ * @param $matches
+ * @return string
+ */
+ public function replacementValueCallback($matches) {
+ $value = $this->opt['value'];
+
+ //default value
+ if (is_null($value) || $value === false) {
+ if (isset($matches['default']) && $matches['default'] != '') {
+ return $matches['default'];
+ }
+ return $matches[0];
+ }
+
+ //check if matched string containts a pair of brackets
+ $delimiter = preg_match('/\(.*\)/s', $matches[0]) ? $matches['delimiter'] : ', ';
+
+ return implode($delimiter, $value);
+ }
+
+ /**
+ * Return the callback for user replacement
+ *
+ * @return array
+ */
+ public function getReplacementValue() {
+ return array($this, 'replacementValueCallback');
+ }
+
/**
* Render the field as XHTML
*
@@ -47,12 +95,13 @@ public function renderfield($params, Doku_Form $form, $formid) {
$form->addElement(call_user_func_array('form_makeListboxField',
$this->_parse_tpl(
array(
- '@@NAME@@',
+ '@@NAME@@[]',
$params['args'],
- '@@VALUE|' . $params['args'][0] . '@@',
+ $this->opt['value'],
'@@DISPLAY@@',
'@@ID@@',
- '@@CLASS@@'
+ '@@CLASS@@',
+ array('multiple' => 'multiple')
),
$params
)));
From eb9f1ebade8b14ff6cdbb3ed1be46155814023ca Mon Sep 17 00:00:00 2001
From: Szymon Olewniczak
Date: Wed, 10 Jan 2018 13:03:55 +0100
Subject: [PATCH 03/50] move mutliselect logic into field class
this simplifies struct's bureaucracy integration code
---
helper/field.php | 36 ++++++++++++++++++++++++++++
helper/fieldmultiselect.php | 47 -------------------------------------
2 files changed, 36 insertions(+), 47 deletions(-)
diff --git a/helper/field.php b/helper/field.php
index 7ee325d..06b4a9a 100644
--- a/helper/field.php
+++ b/helper/field.php
@@ -219,11 +219,42 @@ public function getFieldType() {
public function getReplacementPattern() {
$label = $this->opt['label'];
$value = $this->opt['value'];
+
+ if (is_array($value)) {
+ return '/(@@|##)' . preg_quote($label, '/') .
+ '(?:\((?P.*?)\))?' .//delimiter
+ '(?:\|(?P.*?))' . (count($value) == 0 ? '' : '?') .
+ '\1/si';
+ }
+
return '/(@@|##)' . preg_quote($label, '/') .
'(?:\|(.*?))' . (is_null($value) ? '' : '?') .
'\1/si';
}
+ /**
+ * Used as an callback for preg_replace_callback
+ *
+ * @param $matches
+ * @return string
+ */
+ public function replacementMultiValueCallback($matches) {
+ $value = $this->opt['value'];
+
+ //default value
+ if (is_null($value) || $value === false) {
+ if (isset($matches['default']) && $matches['default'] != '') {
+ return $matches['default'];
+ }
+ return $matches[0];
+ }
+
+ //check if matched string containts a pair of brackets
+ $delimiter = preg_match('/\(.*\)/s', $matches[0]) ? $matches['delimiter'] : ', ';
+
+ return implode($delimiter, $value);
+ }
+
/**
* Get the value used by action
* If value is a callback preg_replace_callback is called instead preg_replace
@@ -232,6 +263,11 @@ public function getReplacementPattern() {
*/
public function getReplacementValue() {
$value = $this->opt['value'];
+
+ if (is_array($value)) {
+ return array($this, 'replacementMultiValueCallback');
+ }
+
return is_null($value) || $value === false ? '$2' : $value;
}
diff --git a/helper/fieldmultiselect.php b/helper/fieldmultiselect.php
index c3f9802..7fec731 100644
--- a/helper/fieldmultiselect.php
+++ b/helper/fieldmultiselect.php
@@ -26,53 +26,6 @@ public function initialize($args) {
}
}
- /**
- * Get the replacement pattern used by action
- *
- * @return string
- */
- public function getReplacementPattern() {
- $label = $this->opt['label'];
- $value = $this->opt['value'];
-
- return '/(@@|##)' . preg_quote($label, '/') .
- '(?:\((?P.*?)\))?' .//delimiter
- '(?:\|(?P.*?))' . (count($value) == 0 ? '' : '?') .
- '\1/si';
- }
-
- /**
- * Used as an callback for preg_replace_callback
- *
- * @param $matches
- * @return string
- */
- public function replacementValueCallback($matches) {
- $value = $this->opt['value'];
-
- //default value
- if (is_null($value) || $value === false) {
- if (isset($matches['default']) && $matches['default'] != '') {
- return $matches['default'];
- }
- return $matches[0];
- }
-
- //check if matched string containts a pair of brackets
- $delimiter = preg_match('/\(.*\)/s', $matches[0]) ? $matches['delimiter'] : ', ';
-
- return implode($delimiter, $value);
- }
-
- /**
- * Return the callback for user replacement
- *
- * @return array
- */
- public function getReplacementValue() {
- return array($this, 'replacementValueCallback');
- }
-
/**
* Render the field as XHTML
*
From c7753ea5717e99a252b2921766dc15c03433b87a Mon Sep 17 00:00:00 2001
From: Szymon Olewniczak
Date: Wed, 10 Jan 2018 13:30:44 +0100
Subject: [PATCH 04/50] use "," instead of "|" as multi default value separator
for compatibility with struct plugin
---
helper/fieldmultiselect.php | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/helper/fieldmultiselect.php b/helper/fieldmultiselect.php
index 7fec731..5311d90 100644
--- a/helper/fieldmultiselect.php
+++ b/helper/fieldmultiselect.php
@@ -20,7 +20,7 @@ public function initialize($args) {
$this->opt['args'] = array_map('trim', explode('|',array_shift($args)));
$this->standardArgs($args);
if (isset($this->opt['value'])) {
- $this->opt['value'] = array_map('trim', explode('|', $this->opt['value']));
+ $this->opt['value'] = array_map('trim', explode(',', $this->opt['value']));
} else {
$this->opt['value'] = array();
}
From d617126d2ccd2cfa0f4836567c370f63184b2342 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Schplurtz=20le=20D=C3=A9boulonn=C3=A9?=
Date: Thu, 1 Feb 2018 05:45:05 +0100
Subject: [PATCH 05/50] translation update
---
lang/fr/lang.php | 65 ++++++++++++++++++++++++--------------------
lang/fr/settings.php | 9 ++++--
2 files changed, 43 insertions(+), 31 deletions(-)
diff --git a/lang/fr/lang.php b/lang/fr/lang.php
index 5610500..e3a3a6e 100644
--- a/lang/fr/lang.php
+++ b/lang/fr/lang.php
@@ -1,31 +1,38 @@
+ */
+$lang['e_unknowntype'] = 'Type inconu "%s"';
+$lang['e_unknownaction'] = 'Action inconnue "%s"';
+$lang['e_missingargs'] = 'Pas assez d\'arguments pour %s %s';
+$lang['e_noaction'] = 'Pas d\'action définie - que faire des données ?';
+$lang['e_mail'] = 'Erreur lors de l\'envoi des données';
+$lang['e_unknownconstraint'] = 'Contrainte de champ inconue %s';
+$lang['e_labelpage'] = 'Page de label %s non trouvée.';
+$lang['e_required'] = '"%s" est requis';
+$lang['e_match'] = '"%s" n\'a pas été remplis correctement. %s';
+$lang['checkagainst'] = '(vérifié avec /%s/i)';
+$lang['e_email'] = '"%s" doit être une adresse e-mail valide.';
+$lang['e_numeric'] = '"%s" doit être un nombre.';
+$lang['e_date'] = '"%s" doit être une date valide au format yyyy-mm-dd.';
+$lang['e_time'] = '"%s" nécessite une heure valide au format (h)h:mm(:ss).';
+$lang['e_user'] = '"%s" doit être le nom d\'un utilisateur existant.';
+$lang['e_users'] = '"%s" doit être une liste de noms d\'utilisateurs séparés par des virgules.';
+$lang['e_min'] = '"%s" doit être plus grand que %s.';
+$lang['e_max'] = '"%s" doit être plus petit que %s.';
+$lang['e_pagename'] = 'Nom de page manquant.';
+$lang['e_pageexists'] = 'La page "%s" existe déjà. Choisissez un autre nom.';
+$lang['e_template'] = 'Modèle "%s" introuvable. Il n\'existe pas ou vous n\'avez pas l\'autorisation de lecture.';
+$lang['e_denied'] = 'Vous n\'avez pas le droit de créer cette page, vous êtes vous connecté ?';
+$lang['mailsubject'] = 'Données du formulaire soumises à %s';
+$lang['mailintro'] = 'Les données suivantes on été envoyées vers %s.';
+$lang['mail_thanks'] = 'Données envoyées avec succès. Merci.';
+$lang['template_thanks'] = 'La page a été créée, suivez le lien pour l\'ouvrir.';
+$lang['summary'] = 'Créé depuis le formulaire %s';
+$lang['attachmentMailEmpty'] = '(fichier non envoyé)';
+$lang['attachmentMailToLarge'] = '(pièce jointe trop grosse)';
+$lang['attachmentMailToLarge_userinfo'] = 'fichier "%s" trop gros comme pièce jointe (>%s). Le message a tout de même été envoyé.';
+$lang['submit'] = 'Envoyer';
diff --git a/lang/fr/settings.php b/lang/fr/settings.php
index 1b4fd6c..a97393d 100644
--- a/lang/fr/settings.php
+++ b/lang/fr/settings.php
@@ -1,4 +1,9 @@
+ */
+$lang['runas'] = 'Mode «template» : teste les ACL avec les permissions de cet utilisateur (virtuel) pour la lecture des page modèles et la création de page.';
+$lang['maxEmailAttachmentSize'] = 'Taille max en octet des pièces jointes dans les courriels. (par fichier)';
From e787cd7c3b64127689e3cde16785fe8af6b9da03 Mon Sep 17 00:00:00 2001
From: Davor Turkalj
Date: Sat, 3 Feb 2018 19:35:38 +0100
Subject: [PATCH 06/50] translation update
---
lang/hr/lang.php | 68 +++++++++++++++++++++++---------------------
lang/hr/settings.php | 9 ++++--
2 files changed, 43 insertions(+), 34 deletions(-)
diff --git a/lang/hr/lang.php b/lang/hr/lang.php
index f3a36ac..339d3b8 100644
--- a/lang/hr/lang.php
+++ b/lang/hr/lang.php
@@ -1,34 +1,38 @@
+ */
+$lang['e_unknowntype'] = 'Nepoznat tip "%s"';
+$lang['e_unknownaction'] = 'Nepoznata aktivnost "%s"';
+$lang['e_missingargs'] = 'Nema dovoljno argumenata za %s %s';
+$lang['e_noaction'] = 'Nema definirane akcije - gdje podaci trebaju biti poslani?';
+$lang['e_mail'] = 'Nešto je pošlo krivo s slanjem ovih podataka';
+$lang['e_unknownconstraint'] = 'Nepoznato ograničenje polja %s';
+$lang['e_labelpage'] = 'Stranica s labelama %s nije nađena';
+$lang['e_required'] = '"%s" je obvezan';
+$lang['e_match'] = '"%s" nije ispravno popunjen. %s';
+$lang['checkagainst'] = '(Provjereno prema /%s/i)';
+$lang['e_email'] = '"%s" treba biti valjana adresa e-pošte.';
+$lang['e_numeric'] = '"%s" treba biti broj.';
+$lang['e_date'] = '"%s" treba biti valjani datum u obliku gggg-mm-dd.';
+$lang['e_time'] = '"%s" treba biti u valjanom obliku (h)h:mm(:ss).';
+$lang['e_user'] = '"%s" treba biti ime postojećeg korisnika.';
+$lang['e_users'] = '"%s" treba biti zarezom odvojena lista imena postojećih korisnika.';
+$lang['e_min'] = '"%s" treba biti veći od %s.';
+$lang['e_max'] = '"%s" treba biti manji od %s.';
+$lang['e_pagename'] = 'Nedostaje ime stranice.';
+$lang['e_pageexists'] = 'Strnaica "%s" već postoji. Molimo odaberite drugo ime stranice.';
+$lang['e_template'] = 'Nemogu pročitati predložak "%s". Možda ne postoji ili nemate pravo čitanja?';
+$lang['e_denied'] = 'Nije Vam dopušteno stvaranje ove stranice, možda ste se zaboravili prijaviti?';
+$lang['mailsubject'] = 'Podaci proslijeđeni u %s';
+$lang['mailintro'] = 'Slijedeći podaci su proslijeđeni u %s.';
+$lang['mail_thanks'] = 'Vaši podaci su uspješno poslani. Hvala.';
+$lang['template_thanks'] = 'Stranica je kreirana, slijedi vezu za njeno otvaranje.';
+$lang['summary'] = 'Kreirano iz forme u %s';
+$lang['attachmentMailEmpty'] = '(datoteka nije poslana)';
+$lang['attachmentMailToLarge'] = '(datoteka prevelika za prilog pošte)';
+$lang['attachmentMailToLarge_userinfo'] = 'datoteka "%s" prevelika za prilog pošte (>%s) (pošta je ipak poslana)';
+$lang['submit'] = 'Proslijedi';
diff --git a/lang/hr/settings.php b/lang/hr/settings.php
index 68b3b33..d9df8dd 100644
--- a/lang/hr/settings.php
+++ b/lang/hr/settings.php
@@ -1,4 +1,9 @@
+ */
+$lang['runas'] = 'Utječe na mod predloška. Koristi ove (virtualne) ovlasti kada provjeravaš ACL za čitanje predloška i stvaranje stranice.';
+$lang['maxEmailAttachmentSize'] = 'Maksimalna veličina priloga pošti u Bajtovima. (po datoteci)';
From f1bc6d04063fe837e3bc50ab35243943de9fb9ed Mon Sep 17 00:00:00 2001
From: Szymon Olewniczak
Date: Thu, 8 Feb 2018 11:06:48 +0100
Subject: [PATCH 07/50] yesno replacement bugfix
The current version of bureaucracy doesn't handle yesno template replacements correctly. The @@yesno@@ placeholder is always replaced by "1" or "0" regardless values provided in ";
saveWikiText($template_id, $template_syntax, 'summary');
+ /** @var \syntax_plugin_bureaucracy $syntax_plugin */
$syntax_plugin = plugin_load('syntax', 'bureaucracy');
$data = $syntax_plugin->handle($form_syntax, 0, 0, new \Doku_Handler());
$actionData = $data['actions'][0];
+ /** @var \helper_plugin_bureaucracy_action $action */
$action = plugin_load('helper', $actionData['actionname']);
//this is the only form
$form_id = 0;
for ($i = 0; $i < count($data['fields']); ++$i) {
//set null for not existing values
- if (!isset($values[$i])) $values[$i] = null;
+ if (!isset($values[$i])) {
+ $values[$i] = null;
+ }
+ /** @var \helper_plugin_bureaucracy_field $field */
$field = $data['fields'][$i];
$isValid = $field->handle_post($values[$i], $data['fields'], $i, $form_id);
if (!$isValid) {
From 2f5beeec46f717af8caf5c4facd955bc47a6472e Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Michael=20Gro=C3=9Fe?=
Date: Tue, 15 May 2018 09:47:07 +0200
Subject: [PATCH 19/50] test: use foreach loop if handling every element of an
array
---
_test/BureaucracyTest.php | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/_test/BureaucracyTest.php b/_test/BureaucracyTest.php
index 53322c6..6bc67b2 100644
--- a/_test/BureaucracyTest.php
+++ b/_test/BureaucracyTest.php
@@ -43,14 +43,12 @@ protected function send_form_action_template($form_syntax, $template_syntax, &$v
//this is the only form
$form_id = 0;
- for ($i = 0; $i < count($data['fields']); ++$i) {
- //set null for not existing values
+ /** @var \helper_plugin_bureaucracy_field $field */
+ foreach ($data['fields'] as $i => $field) {
if (!isset($values[$i])) {
$values[$i] = null;
}
- /** @var \helper_plugin_bureaucracy_field $field */
- $field = $data['fields'][$i];
$isValid = $field->handle_post($values[$i], $data['fields'], $i, $form_id);
if (!$isValid) {
$validation_errors[] = $field->getParam('label');
From 2014d3542ea3c9727df5b4617f5ad962f12e2fd9 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Michael=20Gro=C3=9Fe?=
Date: Tue, 15 May 2018 10:07:13 +0200
Subject: [PATCH 20/50] test: Add tests for radio field
---
_test/BureaucracyTest.php | 6 ++++
_test/field_radio.test.php | 74 ++++++++++++++++++++++++++++++++++++++
2 files changed, 80 insertions(+)
create mode 100644 _test/field_radio.test.php
diff --git a/_test/BureaucracyTest.php b/_test/BureaucracyTest.php
index 6bc67b2..90373d8 100644
--- a/_test/BureaucracyTest.php
+++ b/_test/BureaucracyTest.php
@@ -5,6 +5,12 @@
class BureaucracyTest extends \DokuWikiTest
{
+
+ const FORM_PREFIX_HTML = '';
+
protected $pluginsEnabled = ['bureaucracy'];
/**
diff --git a/_test/field_radio.test.php b/_test/field_radio.test.php
new file mode 100644
index 0000000..34839f6
--- /dev/null
+++ b/_test/field_radio.test.php
@@ -0,0 +1,74 @@
+assertEquals($expectedWikiText, $actualWikiText, $msg);
+ $this->assertEquals($expectedValidationErrors, $actualValidationErrors, $msg);
+ }
+
+ public function test_field_date_render()
+ {
+ $formSyntax = 'radio "radioLabel" "Peaches|Apples|Oranges"';
+ $instr = p_get_instructions("");
+
+ $actualHTML = p_render('xhtml', $instr, $info);
+
+ $expectedFieldHTML = '
+
+';
+ $expectedHTML = self::FORM_PREFIX_HTML . "\n$expectedFieldHTML\n" . self::FORM_SUFFIX_HTML;
+ $this->assertEquals(trim($expectedHTML), trim($actualHTML));
+ }
+}
From b4bc2c400e7331cd3a98c1b8358a09067e9b95f3 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Michael=20Gro=C3=9Fe?=
Date: Tue, 15 May 2018 10:30:19 +0200
Subject: [PATCH 21/50] test: Add tests for the date field
---
_test/field_date.test.php | 80 +++++++++++++++++++++++++++++++++++++++
1 file changed, 80 insertions(+)
create mode 100644 _test/field_date.test.php
diff --git a/_test/field_date.test.php b/_test/field_date.test.php
new file mode 100644
index 0000000..ff51566
--- /dev/null
+++ b/_test/field_date.test.php
@@ -0,0 +1,80 @@
+assertEquals($expectedWikiText, $actualWikiText, $msg);
+ }
+ $this->assertEquals($expectedValidationErrors, $actualValidationErrors, $msg);
+ }
+
+ public function test_field_date_render()
+ {
+ $formSyntax = 'date "dateLabel"';
+ $instr = p_get_instructions("");
+
+ $actualHTML = p_render('xhtml', $instr, $info);
+
+ $expectedFieldHTML = '';
+ $expectedHTML = self::FORM_PREFIX_HTML . "\n$expectedFieldHTML\n" . self::FORM_SUFFIX_HTML;
+ $this->assertEquals(trim($expectedHTML), trim($actualHTML));
+ }
+}
From f9e3f8b4730e70923bed0580661cd2260ce97a54 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Michael=20Gro=C3=9Fe?=
Date: Tue, 15 May 2018 10:37:19 +0200
Subject: [PATCH 22/50] test: Add tests for the time field
---
_test/field_time.test.php | 86 +++++++++++++++++++++++++++++++++++++++
1 file changed, 86 insertions(+)
create mode 100644 _test/field_time.test.php
diff --git a/_test/field_time.test.php b/_test/field_time.test.php
new file mode 100644
index 0000000..b027d8c
--- /dev/null
+++ b/_test/field_time.test.php
@@ -0,0 +1,86 @@
+assertEquals($expectedWikiText, $actualWikiText, $msg);
+ }
+ $this->assertEquals($expectedValidationErrors, $actualValidationErrors, $msg);
+ }
+
+ public function test_field_time_render()
+ {
+ $formSyntax = 'time "timeLabel"';
+ $instr = p_get_instructions("");
+
+ $actualHTML = p_render('xhtml', $instr, $info);
+
+ $expectedFieldHTML = '';
+ $expectedHTML = self::FORM_PREFIX_HTML . "\n$expectedFieldHTML\n" . self::FORM_SUFFIX_HTML;
+ $this->assertEquals(trim($expectedHTML), trim($actualHTML));
+ }
+}
From e0122e76fcf43ae1163c3777ae080f6a64032c21 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Michael=20Gro=C3=9Fe?=
Date: Tue, 15 May 2018 11:11:29 +0200
Subject: [PATCH 23/50] test: Add tests for the email field
---
_test/field_email.test.php | 92 ++++++++++++++++++++++++++++++++++++++
1 file changed, 92 insertions(+)
create mode 100644 _test/field_email.test.php
diff --git a/_test/field_email.test.php b/_test/field_email.test.php
new file mode 100644
index 0000000..c3c522a
--- /dev/null
+++ b/_test/field_email.test.php
@@ -0,0 +1,92 @@
+assertEquals($expectedWikiText, $actualWikiText, $msg);
+ }
+ $this->assertEquals($expectedValidationErrors, $actualValidationErrors, $msg);
+ }
+
+ public function test_field_email_render()
+ {
+ $formSyntax = 'email emailLabel';
+ $instr = p_get_instructions("");
+
+ $actualHTML = p_render('xhtml', $instr, $info);
+
+ $expectedFieldHTML = '';
+ $expectedHTML = self::FORM_PREFIX_HTML . "\n$expectedFieldHTML\n" . self::FORM_SUFFIX_HTML;
+ $this->assertEquals(trim($expectedHTML), trim($actualHTML));
+ }
+}
From eb0eb5d6f722885c6f1ed4d3f634b006226364c0 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Michael=20Gro=C3=9Fe?=
Date: Tue, 15 May 2018 13:44:43 +0200
Subject: [PATCH 24/50] test: Add tests for the hidden field
---
_test/field_hidden.test.php | 77 +++++++++++++++++++++++++++++++++++++
1 file changed, 77 insertions(+)
create mode 100644 _test/field_hidden.test.php
diff --git a/_test/field_hidden.test.php b/_test/field_hidden.test.php
new file mode 100644
index 0000000..386b28b
--- /dev/null
+++ b/_test/field_hidden.test.php
@@ -0,0 +1,77 @@
+assertEquals($expectedWikiText, $actualWikiText, $msg);
+ }
+ $this->assertEquals($expectedValidationErrors, $actualValidationErrors, $msg);
+ }
+
+ public function test_field_time_render()
+ {
+ $formSyntax = 'hidden hiddenLabel "=default value of the hidden field"';
+ $instr = p_get_instructions("");
+
+ $actualHTML = p_render('xhtml', $instr, $info);
+
+ $hiddenFormPrefix = '';
+ $expectedHTML = "$hiddenFormPrefix$expectedFieldHTML$hiddenFormSuffix";
+
+ $this->assertEquals(trim($expectedHTML), trim($actualHTML));
+ }
+}
From 973887b2adbf7d51120272e02fd3c0141e00b703 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Michael=20Gro=C3=9Fe?=
Date: Tue, 15 May 2018 13:53:44 +0200
Subject: [PATCH 25/50] test: Add tests for custom date format
---
_test/field_date.test.php | 16 ++++++++++++++++
1 file changed, 16 insertions(+)
diff --git a/_test/field_date.test.php b/_test/field_date.test.php
index ff51566..fb9dd3e 100644
--- a/_test/field_date.test.php
+++ b/_test/field_date.test.php
@@ -30,6 +30,22 @@ public function dataProvider()
['dateLabel'],
'invalid date',
],
+ [
+ 'Date: @DATE(@@dateLabel@@)@',
+ 'date "dateLabel"',
+ '2018-02-15',
+ 'Date: 2018/02/15 00:00',
+ [],
+ 'formatted date with $conf[\'dformat\'] format',
+ ],
+ [
+ 'Month: @DATE(@@dateLabel@@,%%m)@',
+ 'date "dateLabel"',
+ '2018-02-15',
+ 'Month: 02',
+ [],
+ 'formatted date with custom format',
+ ],
];
}
From 15bdef96099f861b31f733384aa0b8e1122bb966 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Michael=20Gro=C3=9Fe?=
Date: Thu, 17 May 2018 17:24:16 +0200
Subject: [PATCH 26/50] test: Refactor user and users field tests to make them
similar to the others
---
_test/field_user.test.php | 48 ++++++++++++++++++++++----------------
_test/field_users.test.php | 46 +++++++++++++++++++-----------------
2 files changed, 53 insertions(+), 41 deletions(-)
diff --git a/_test/field_user.test.php b/_test/field_user.test.php
index dc8e996..5012c1d 100644
--- a/_test/field_user.test.php
+++ b/_test/field_user.test.php
@@ -26,6 +26,7 @@ public function dataProvider()
return [
[
'user:@@user@@',
+ 'user user',
'mwuser',
'user:mwuser',
[],
@@ -33,6 +34,7 @@ public function dataProvider()
],
[
'user:@@user@@',
+ 'user user',
'',
'user:',
['user'],
@@ -40,6 +42,7 @@ public function dataProvider()
],
[
'user:@@user.name@@',
+ 'user user',
'mwuser',
'user:Wiki User',
[],
@@ -47,6 +50,7 @@ public function dataProvider()
],
[
'user:@@user.mail@@',
+ 'user user',
'mwuser',
'user:wikiuser@example.com',
[],
@@ -54,6 +58,7 @@ public function dataProvider()
],
[
'user:@@user.grps@@',
+ 'user user',
'mwuser',
'user:group1, group2',
[],
@@ -61,6 +66,7 @@ public function dataProvider()
],
[
'user:@@user.grps(;)@@',
+ 'user user',
'mwuser',
'user:group1;group2',
[],
@@ -68,6 +74,7 @@ public function dataProvider()
],
[
'user:@@user.grps())@@',
+ 'user user',
'mwuser',
'user:group1)group2',
[],
@@ -75,6 +82,7 @@ public function dataProvider()
],
[
'user:@@user.no_sutch_attribute@@',
+ 'user user',
'mwuser',
'user:@@user.no_sutch_attribute@@',
[],
@@ -82,6 +90,7 @@ public function dataProvider()
],
[
'user:##user##',
+ 'user user',
'mwuser',
'user:mwuser',
[],
@@ -89,6 +98,7 @@ public function dataProvider()
],
[
'user:##user.mail##',
+ 'user user',
'mwuser',
'user:wikiuser@example.com',
[],
@@ -96,6 +106,7 @@ public function dataProvider()
],
[
'user:##user@@',
+ 'user user',
'mwuser',
'user:##user@@',
[],
@@ -103,6 +114,7 @@ public function dataProvider()
],
[
"user:@@user@@\n\nmail:@@user.mail@@\n\ngrps:@@user.grps(\n)@@",
+ 'user user',
'mwuser',
"user:mwuser\n\nmail:wikiuser@example.com\n\ngrps:group1\ngroup2",
[],
@@ -110,6 +122,7 @@ public function dataProvider()
],
[
"grps1:@@user.grps(\n)@@\n\ngrps2:@@user.grps(())@@",
+ 'user user',
'mwuser',
"grps1:group1\ngroup2\n\ngrps2:group1()group2",
[],
@@ -117,6 +130,7 @@ public function dataProvider()
],
[
'grps:@@user.grps(end))@@',
+ 'user user',
'mwuser',
'grps:group1end)group2',
[],
@@ -124,6 +138,7 @@ public function dataProvider()
],
[
'grps:@@user.grps()@@',
+ 'user user',
'mwuser',
'grps:group1group2',
[],
@@ -131,6 +146,7 @@ public function dataProvider()
],
[
'user:@@user@@',
+ 'user user',
'non_existant_user',
'user:non_existant_user',
['user'],
@@ -138,6 +154,7 @@ public function dataProvider()
],
[
'user:@@user.name@@',
+ 'user user',
'non_existant_user',
'user:@@user.name@@',
['user'],
@@ -150,41 +167,32 @@ public function dataProvider()
/**
* @dataProvider dataProvider
*
- * @param string $templateSyntax
- * @param string|array $users value of 'users' field or array('label' => 'own label', 'value' => 'value')
- * @param string $expectedWikiText
- * @param string $expectedValidationErrors
- * @param string $msg
+ * @param string $templateSyntax
+ * @param string $formSyntax
+ * @param string $postedValue value of 'user' field
+ * @param string $expectedWikiText
+ * @param string $expectedValidationErrors
+ * @param string $msg
*
- * @throws \InvalidArgumentException
*/
public function test_field_user(
$templateSyntax,
- $users,
+ $formSyntax,
+ $postedValue,
$expectedWikiText,
$expectedValidationErrors,
$msg
) {
$actualValidationErrors = [];
- $label = 'user';
- if (is_array($users)) {
- if (!isset($users['value'])) {
- throw new \InvalidArgumentException('$users should be string or array("label" => label, "value" => value');
- }
- if (isset($users['label'])) {
- $label = $users['label'];
- }
- $users = $users['value'];
- }
$actualWikiText = parent::send_form_action_template(
- 'user "' . $label . '"',
+ $formSyntax,
$templateSyntax,
$actualValidationErrors,
- $users
+ $postedValue
);
- $this->assertEquals($expectedWikiText, $actualWikiText, $msg);
$this->assertEquals($expectedValidationErrors, $actualValidationErrors, $msg);
+ $this->assertEquals($expectedWikiText, $actualWikiText, $msg);
}
}
diff --git a/_test/field_users.test.php b/_test/field_users.test.php
index 44a7bbb..d162357 100644
--- a/_test/field_users.test.php
+++ b/_test/field_users.test.php
@@ -29,6 +29,7 @@ public function dataProvider()
return [
[
'users:@@users@@',
+ 'users users',
'user1, user2',
'users:user1, user2',
[],
@@ -36,6 +37,7 @@ public function dataProvider()
],
[
'users:@@users@@',
+ 'users users',
'',
'users:',
['users'],
@@ -43,6 +45,7 @@ public function dataProvider()
],
[
'users:@@users(;)@@',
+ 'users users',
'user1, user2',
'users:user1;user2',
[],
@@ -50,6 +53,7 @@ public function dataProvider()
],
[
"users:@@users(\n)@@",
+ 'users users',
'user1, user2',
"users:user1\nuser2",
[],
@@ -57,6 +61,7 @@ public function dataProvider()
],
[
'users:@@users()@@',
+ 'users users',
'user1, user2',
'users:user1user2',
[],
@@ -64,6 +69,7 @@ public function dataProvider()
],
[
'users:@@users.name@@',
+ 'users users',
'user1, user2',
'users:user1Name, user2Name',
[],
@@ -71,6 +77,7 @@ public function dataProvider()
],
[
'users:@@users(;).name@@',
+ 'users users',
'user1, user2',
'users:user1Name;user2Name',
[],
@@ -78,6 +85,7 @@ public function dataProvider()
],
[
'users:@@users.mail@@',
+ 'users users',
'user1, user2',
'users:user1@example.com, user2@example.com',
[],
@@ -85,6 +93,7 @@ public function dataProvider()
],
[
"mails:@@users.mail@@\n\nnames:@@users(\n).name@@",
+ 'users users',
'user1, user2',
"mails:user1@example.com, user2@example.com\n\nnames:user1Name\nuser2Name",
[],
@@ -92,6 +101,7 @@ public function dataProvider()
],
[
'users:@@users@@',
+ 'users users',
'not_existing1, not_existing2',
'users:not_existing1, not_existing2',
['users'],
@@ -99,6 +109,7 @@ public function dataProvider()
],
[
'users:@@users.unknown_attribute@@',
+ 'users users',
'user1, user2',
'users:@@users.unknown_attribute@@',
[],
@@ -106,14 +117,16 @@ public function dataProvider()
],
[
'users:@@*]]@@', // the label must be something to break a regex when not properly quoted
- ['label' => '*]]', 'value' => 'user1, user2'],
+ 'users "*]]"',
+ 'user1, user2',
'users:user1, user2',
[],
'ensure label desn\'t break regex',
],
[
'users:@@tHis Is UsEr@@',
- ['label' => 'tHis Is UsEr', 'value' => 'user1, user2'],
+ 'users "tHis Is UsEr"',
+ 'user1, user2',
'users:user1, user2',
[],
'label with spaces and mixed case',
@@ -124,38 +137,29 @@ public function dataProvider()
/**
* @dataProvider dataProvider
*
- * @param string $templateSyntax
- * @param string|array $users value of 'users' field or array('label' => 'own label', 'value' => 'value')
- * @param string $expectedWikiText
- * @param string $expectedValidationErrors
- * @param string $msg
+ * @param string $templateSyntax
+ * @param string $formSyntax
+ * @param string $postedValue value of 'users' field
+ * @param string $expectedWikiText
+ * @param string $expectedValidationErrors
+ * @param string $msg
*
- * @throws \InvalidArgumentException
*/
public function test_field_users(
$templateSyntax,
- $users,
+ $formSyntax,
+ $postedValue,
$expectedWikiText,
$expectedValidationErrors,
$msg
) {
$actualValidationErrors = [];
- $label = 'users';
- if (is_array($users)) {
- if (!isset($users['value'])) {
- throw new \InvalidArgumentException('$users should be string or array("label" => label, "value" => value');
- }
- if (isset($users['label'])) {
- $label = $users['label'];
- }
- $users = $users['value'];
- }
$actualWikiText = parent::send_form_action_template(
- 'users "' . $label . '"',
+ $formSyntax,
$templateSyntax,
$actualValidationErrors,
- $users
+ $postedValue
);
$this->assertEquals($expectedWikiText, $actualWikiText, $msg);
From 7e43563755bc5b391965e7d3029d9499f92191aa Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Michael=20Gro=C3=9Fe?=
Date: Thu, 17 May 2018 17:25:36 +0200
Subject: [PATCH 27/50] =?UTF-8?q?style(tests):=20Minor=20style=20adjustmen?=
=?UTF-8?q?ts=20for=20user=20and=20users=20fields=20tests=20=F0=9F=8E=A8?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
_test/field_user.test.php | 9 ++++++---
_test/field_users.test.php | 2 +-
2 files changed, 7 insertions(+), 4 deletions(-)
diff --git a/_test/field_user.test.php b/_test/field_user.test.php
index 5012c1d..8e739c3 100644
--- a/_test/field_user.test.php
+++ b/_test/field_user.test.php
@@ -1,16 +1,19 @@
createUser("user1", "54321", "user1Name", "user1@example.com");
$auth->createUser("user2", "543210", "user2Name", "user2@example.com");
- $auth->createUser("mwuser", "12345", "Wiki User", "wikiuser@example.com", array('group1', 'group2'));
+ $auth->createUser("mwuser", "12345", "Wiki User", "wikiuser@example.com", ['group1', 'group2']);
}
public function dataProvider()
diff --git a/_test/field_users.test.php b/_test/field_users.test.php
index d162357..20e9133 100644
--- a/_test/field_users.test.php
+++ b/_test/field_users.test.php
@@ -21,7 +21,7 @@ public function setUp()
$auth->createUser('user1', '54321', 'user1Name', 'user1@example.com');
$auth->createUser('user2', '543210', 'user2Name', 'user2@example.com');
- $auth->createUser('mwuser', '12345', 'Wiki User', 'me@example.com', array('group1', 'group2'));
+ $auth->createUser('mwuser', '12345', 'Wiki User', 'me@example.com', ['group1', 'group2']);
}
public function dataProvider()
From c07c9deb93610e86fe235581c06bf2957d069020 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Michael=20Gro=C3=9Fe?=
Date: Thu, 17 May 2018 17:28:08 +0200
Subject: [PATCH 28/50] =?UTF-8?q?fix(user=20field):=20An=20empty=20field?=
=?UTF-8?q?=20should=20remove=20template=20placeholder=20=F0=9F=90=9B?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
This adds another test to ensure that a user field submitted with an empty string results in the
expected behavior, which is to replace the placeholder with an empty string.
---
_test/field_user.test.php | 8 ++++++++
helper/fielduser.php | 2 +-
2 files changed, 9 insertions(+), 1 deletion(-)
diff --git a/_test/field_user.test.php b/_test/field_user.test.php
index 8e739c3..e4ff488 100644
--- a/_test/field_user.test.php
+++ b/_test/field_user.test.php
@@ -43,6 +43,14 @@ public function dataProvider()
['user'],
'error for empty substitution',
],
+ [
+ 'user:@@user@@',
+ 'user user !',
+ '',
+ 'user:',
+ [],
+ 'ok for empty substitution in optional field',
+ ],
[
'user:@@user.name@@',
'user user',
diff --git a/helper/fielduser.php b/helper/fielduser.php
index 866c071..49608e1 100644
--- a/helper/fielduser.php
+++ b/helper/fielduser.php
@@ -47,7 +47,7 @@ public function replacementValueCallback($matches) {
$value = $this->opt['value'];
//attr doesn't exists
if (!isset($matches[2])) {
- return is_null($value) || $value === false ? $matches[0] : $value;
+ return is_null($value) || $value === false ? '' : $value;
}
$attr = $matches[2];
From 214300f25bcca07131b0e1fadacc0d52382438ac Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Michael=20Gro=C3=9Fe?=
Date: Thu, 17 May 2018 17:31:52 +0200
Subject: [PATCH 29/50] =?UTF-8?q?docs(tests):=20adjust=20phpdoc=20block=20?=
=?UTF-8?q?to=20match=20signature=20=F0=9F=92=A1?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
_test/field_date.test.php | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/_test/field_date.test.php b/_test/field_date.test.php
index fb9dd3e..3164630 100644
--- a/_test/field_date.test.php
+++ b/_test/field_date.test.php
@@ -53,7 +53,8 @@ public function dataProvider()
* @dataProvider dataProvider
*
* @param string $templateSyntax
- * @param $postedValue
+ * @param string $formSyntax
+ * @param string $postedValue
* @param string $expectedWikiText
* @param string $expectedValidationErrors
* @param string $msg
From 54503b18cca9ebfbe9d68553a0c32d01bb289f75 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Michael=20Gro=C3=9Fe?=
Date: Thu, 17 May 2018 17:42:55 +0200
Subject: [PATCH 30/50] =?UTF-8?q?ci:=20Remove=20scrutinizer=20coverage=20a?=
=?UTF-8?q?gain=20-=20this=20needs=20more=20work=20=F0=9F=92=9A?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
While code coverage via scrutinizer works well in principle, it is
currently still clunky. Also, it is currently not activated for
splitbrain/dokuwiki-plugin-bureaucracy and thus causes the ci check to
fail.
---
.scrutinizer.yml | 2 --
.travis.yml | 4 +---
phpunit.xml | 32 --------------------------------
3 files changed, 1 insertion(+), 37 deletions(-)
delete mode 100644 .scrutinizer.yml
delete mode 100644 phpunit.xml
diff --git a/.scrutinizer.yml b/.scrutinizer.yml
deleted file mode 100644
index d73cd74..0000000
--- a/.scrutinizer.yml
+++ /dev/null
@@ -1,2 +0,0 @@
-tools:
- external_code_coverage: true
diff --git a/.travis.yml b/.travis.yml
index 2a87475..3ee2bb1 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -8,6 +8,4 @@ before_install: wget https://raw.github.com/splitbrain/dokuwiki-travis/master/tr
install: sh travis.sh
script:
- cd _test
- - phpunit --configuration=../lib/plugins/bureaucracy/phpunit.xml --group plugin_bureaucracy --coverage-clover=coverage.clover
- - wget https://scrutinizer-ci.com/ocular.phar
- - php ocular.phar code-coverage:upload --format=php-clover coverage.clover --repository=g/$TRAVIS_REPO_SLUG --revision=$TRAVIS_COMMIT
+ - phpunit --group plugin_bureaucracy
diff --git a/phpunit.xml b/phpunit.xml
deleted file mode 100644
index b6873af..0000000
--- a/phpunit.xml
+++ /dev/null
@@ -1,32 +0,0 @@
-
-
-
-
-
- ./_test
-
-
-
-
-
- flaky
-
-
-
-
-
- .
-
- ./lang/
- ./_test/
-
-
-
-
-
From 4c8cd48880e4fb15a7ea085f885847eb7a750cb0 Mon Sep 17 00:00:00 2001
From: Andreas Gohr
Date: Thu, 17 May 2018 23:50:11 +0200
Subject: [PATCH 31/50] Version upped
---
plugin.info.txt | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/plugin.info.txt b/plugin.info.txt
index 90c4ecd..ac8b8e8 100644
--- a/plugin.info.txt
+++ b/plugin.info.txt
@@ -1,7 +1,7 @@
base bureaucracy
author Andreas Gohr
email andi@splitbrain.org
-date 2018-03-28
+date 2018-05-17
name Bureaucracy Plugin
desc Create forms and generate pages or emails from them
url https://www.dokuwiki.org/plugin:bureaucracy
From 8fb29ac4b8a5d09aa5885a214f90d9f46002876a Mon Sep 17 00:00:00 2001
From: Damien Regad
Date: Fri, 13 Oct 2017 15:24:46 +0000
Subject: [PATCH 32/50] Remove extra
in thanks message
Because of the way consecutive
tags are rendered, wrapping each
$thanks string in such tags causes unnecessary additional blank lines to
be displayed before the message.
For example, given a message `Page created`:
- helper_plugin_bureaucracy_actiontemplate::buildThankYouPage() returns
`
Page created
`;
- then syntax_plugin_bureaucracy::_handlepost() adds an extra
wrapping, so we get `
Page created
`
- The browser renders this as
`
Page created
`
so we get extra whitespace before and after the thanks message
---
syntax.php | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/syntax.php b/syntax.php
index 59c17b9..c61f431 100644
--- a/syntax.php
+++ b/syntax.php
@@ -356,10 +356,7 @@ private function _handlepost($data) {
}
// create thanks string
- $thanks = '';
- foreach(array_unique($thanks_array) as $thanks_string) {
- $thanks .= '
' . $thanks_string . '
';
- }
+ $thanks = implode('', array_unique($thanks_array));
return $thanks;
}
From 04a7a0329169e9fe796739ecf8ac4f3589bde93c Mon Sep 17 00:00:00 2001
From: Damien Regad
Date: Fri, 13 Oct 2017 11:02:05 +0000
Subject: [PATCH 33/50] Remove '-' from scriptNamePattern valid chars
Since '-' is not a valid char for PHP keywords, it cannot be used in the
script handler file name, as we would get an error when submitting the
form (either because the class was not found, or because of a syntax
error in the script).
---
helper/actionscript.php | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/helper/actionscript.php b/helper/actionscript.php
index 277306f..a955b55 100644
--- a/helper/actionscript.php
+++ b/helper/actionscript.php
@@ -2,7 +2,7 @@
class helper_plugin_bureaucracy_actionscript extends helper_plugin_bureaucracy_action {
- protected $scriptNamePattern = '/^[-_a-zA-Z0-9]+\.php$/';
+ protected $scriptNamePattern = '/^[_a-zA-Z0-9]+\.php$/';
/**
* @inheritDoc
From 075ea528aca94f99f23bedcff6522d7ce57b60fc Mon Sep 17 00:00:00 2001
From: Damien Regad
Date: Fri, 13 Oct 2017 09:56:12 +0000
Subject: [PATCH 34/50] Change actionscript handler class prefix
The class name prefix is now 'helper_plugin_bureaucracy_', so that
handlers can use the Bureaucracy plugin's language strings.
Fixes #219
---
helper/actionscript.php | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/helper/actionscript.php b/helper/actionscript.php
index 277306f..b860c3d 100644
--- a/helper/actionscript.php
+++ b/helper/actionscript.php
@@ -30,7 +30,7 @@ public function run($fields, $thanks, $argv) {
require $path;
$classFragment = substr($scriptName, 0, strpos($scriptName, '.'));
- $className = 'bureaucracy_handler_' . $classFragment;
+ $className = 'helper_plugin_bureaucracy_handler_' . $classFragment;
/** @var dokuwiki\plugin\bureaucracy\interfaces\bureaucracy_handler_interface $handler */
$handler = new $className;
From be68ab873bc322c1510b1aa32a9b7e6ace511a02 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Michael=20Gro=C3=9Fe?=
Date: Sat, 7 Jul 2018 00:27:57 +0200
Subject: [PATCH 35/50] =?UTF-8?q?=E2=9C=85=20Add=20tests=20for=20multisele?=
=?UTF-8?q?ct=20field?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
_test/BureaucracyTest.php | 3 --
_test/field_multiselect.test.php | 81 ++++++++++++++++++++++++++++++++
2 files changed, 81 insertions(+), 3 deletions(-)
create mode 100644 _test/field_multiselect.test.php
diff --git a/_test/BureaucracyTest.php b/_test/BureaucracyTest.php
index 90373d8..5a381e6 100644
--- a/_test/BureaucracyTest.php
+++ b/_test/BureaucracyTest.php
@@ -25,9 +25,6 @@ class BureaucracyTest extends \DokuWikiTest
*/
protected function send_form_action_template($form_syntax, $template_syntax, &$validation_errors, ...$values)
{
- if (is_array($values[0])) {
- $values = $values[0];
- }
$id = uniqid('page', true);
$template_id = uniqid('template', true);
diff --git a/_test/field_multiselect.test.php b/_test/field_multiselect.test.php
new file mode 100644
index 0000000..9445dc2
--- /dev/null
+++ b/_test/field_multiselect.test.php
@@ -0,0 +1,81 @@
+assertEquals($expectedWikiText, $actualWikiText, $msg);
+ $this->assertEquals($expectedValidationErrors, $actualValidationErrors, $msg);
+ }
+
+ public function test_field_multiselect_render()
+ {
+ $formSyntax = 'multiselect "multiSelectLabel" "Peaches|Apples|Oranges" =Peaches,Oranges';
+ $instr = p_get_instructions("");
+
+ $actualHTML = p_render('xhtml', $instr, $info);
+
+ $expectedFieldHTML = '';
+ $expectedHTML = self::FORM_PREFIX_HTML . "\n$expectedFieldHTML\n" . self::FORM_SUFFIX_HTML;
+ $this->assertEquals(trim($expectedHTML), trim($actualHTML));
+ }
+}
From 704f945dda62f48edf1c9337ad8815a549e3cb9f Mon Sep 17 00:00:00 2001
From: Andreas Gohr
Date: Sat, 7 Jul 2018 23:50:11 +0200
Subject: [PATCH 36/50] Version upped
---
plugin.info.txt | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/plugin.info.txt b/plugin.info.txt
index ac8b8e8..24b5989 100644
--- a/plugin.info.txt
+++ b/plugin.info.txt
@@ -1,7 +1,7 @@
base bureaucracy
author Andreas Gohr
email andi@splitbrain.org
-date 2018-05-17
+date 2018-07-06
name Bureaucracy Plugin
desc Create forms and generate pages or emails from them
url https://www.dokuwiki.org/plugin:bureaucracy
From 5d3f7ae92921d8f8fff9f90022663f0a651af640 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Michael=20Gro=C3=9Fe?=
Date: Tue, 14 Aug 2018 11:37:17 +0200
Subject: [PATCH 37/50] Make changes backwards compatible
This should give people that are currently using this functionality time
to update their code.
---
helper/actionscript.php | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/helper/actionscript.php b/helper/actionscript.php
index b860c3d..bb26f71 100644
--- a/helper/actionscript.php
+++ b/helper/actionscript.php
@@ -32,6 +32,13 @@ public function run($fields, $thanks, $argv) {
$classFragment = substr($scriptName, 0, strpos($scriptName, '.'));
$className = 'helper_plugin_bureaucracy_handler_' . $classFragment;
+ $deprecatedClassName = 'bureaucracy_handler_' . $classFragment;
+ if (!class_exists($className) && class_exists($deprecatedClassName)) {
+ msg("Please change this script's class-name to $className.
+Your current scheme $deprecatedClassName is deprecated and will stop working in the future.", 2);
+ $className = $deprecatedClassName;
+ }
+
/** @var dokuwiki\plugin\bureaucracy\interfaces\bureaucracy_handler_interface $handler */
$handler = new $className;
From bbb7cad0d1b9f50f5ee5d68e993128fd9a7a2739 Mon Sep 17 00:00:00 2001
From: Andreas Gohr
Date: Tue, 14 Aug 2018 23:50:11 +0200
Subject: [PATCH 38/50] Version upped
---
plugin.info.txt | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/plugin.info.txt b/plugin.info.txt
index 24b5989..5c6c891 100644
--- a/plugin.info.txt
+++ b/plugin.info.txt
@@ -1,7 +1,7 @@
base bureaucracy
author Andreas Gohr
email andi@splitbrain.org
-date 2018-07-06
+date 2018-08-14
name Bureaucracy Plugin
desc Create forms and generate pages or emails from them
url https://www.dokuwiki.org/plugin:bureaucracy
From 6bd81c8ddfb6d4967d71cf1abdc100ea84192ce0 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Michael=20Gro=C3=9Fe?=
Date: Thu, 16 Aug 2018 09:12:15 +0200
Subject: [PATCH 39/50] Ensure there is still a
around thanks messages
8fb29ac4b8a5d09aa5885a214f90d9f46002876a correctly removed the wrapping
in syntax.php, as these produced invalid HTML for the template
action. However that measure left the thanks message from the mail
action without
tags. This commit fixes that.
---
helper/actionmail.php | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/helper/actionmail.php b/helper/actionmail.php
index dc32b76..9d106b6 100644
--- a/helper/actionmail.php
+++ b/helper/actionmail.php
@@ -79,7 +79,7 @@ public function run($fields, $thanks, $argv) {
if(!$mail->send()) {
throw new Exception($this->getLang('e_mail'));
}
- return $thanks;
+ return '
' . $thanks . '
';
}
/**
From 8ac056fc75e891fe95dc6d9c952357ede87f58da Mon Sep 17 00:00:00 2001
From: Andreas Gohr
Date: Thu, 16 Aug 2018 23:50:12 +0200
Subject: [PATCH 40/50] Version upped
---
plugin.info.txt | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/plugin.info.txt b/plugin.info.txt
index 5c6c891..fa926ba 100644
--- a/plugin.info.txt
+++ b/plugin.info.txt
@@ -1,7 +1,7 @@
base bureaucracy
author Andreas Gohr
email andi@splitbrain.org
-date 2018-08-14
+date 2018-08-16
name Bureaucracy Plugin
desc Create forms and generate pages or emails from them
url https://www.dokuwiki.org/plugin:bureaucracy
From 27f971a9359f3a9b76222d3841d458dd5efab7bf Mon Sep 17 00:00:00 2001
From: HokkaidoPerson
Date: Fri, 7 Sep 2018 14:45:38 +0200
Subject: [PATCH 41/50] translation update
---
lang/ja/lang.php | 64 ++++++++++++++++++++++----------------------
lang/ja/settings.php | 8 +++---
2 files changed, 37 insertions(+), 35 deletions(-)
diff --git a/lang/ja/lang.php b/lang/ja/lang.php
index c2788f2..5c57791 100644
--- a/lang/ja/lang.php
+++ b/lang/ja/lang.php
@@ -3,36 +3,36 @@
/**
* @license GPL 2 (http://www.gnu.org/licenses/gpl.html)
*
+ * @author HokkaidoPerson
*/
-$lang['e_unknowntype'] = '"%s" という型はありません。';
-$lang['e_missingargs'] = '%s %s には引数が十分ではありません。';
-$lang['e_noaction'] = 'action が定義されていません - どこにデータを送信するのですか?';
-$lang['e_mail'] = 'データの送信について何かがおかしいです。';
-$lang['e_unknownconstraint'] = '%s という項目制約がありません。';
-$lang['e_labelpage'] = '%s という Labelpage がありません。';
-
-$lang['e_required'] = '"%s" が必要です。';
-$lang['e_match'] = '"%s" が正しく記入されていません。%s';
-$lang['e_email'] = '"%s" は有効なメールアドレスである必要があります。';
-$lang['checkagainst'] = '(/%s/i と照合)';
-$lang['e_numeric'] = '"%s" は数字である必要があります。';
-$lang['e_date'] = '"%s" は yyyy-mm-dd 形式の日付である必要があります。';
-$lang['e_user'] = '"%s" 既存のユーザー名である必要があります。';
-$lang['e_users'] = '"%s" 既存のユーザー名のカンマ区切り一覧である必要があります。';
-$lang['e_min'] = '"%s" は %s より大きい必要があります。';
-$lang['e_max'] = '"%s" は %s より小さい必要があります。';
-
-$lang['e_pagename'] = 'ページ名がありません。';
-$lang['e_pageexists'] = '"%s" というページは既に存在します。別のページ名を選んで下さい。';
-$lang['e_template'] = '"%s" というテンプレートが読めません。存在しないか読み込み権限がないのではないですか?';
-$lang['e_denied'] = 'このページの作成は許可されません。ログインし忘れていませんか?';
-
-$lang['mailsubject'] = 'フォームのデータは %s へ送信されました。';
-$lang['mailintro'] = '以下のデータは %s に送信されました。';
-
-$lang['mail_thanks'] = 'データは正常に送信されました。ありがとう。';
-$lang['template_thanks'] = 'ページは作成されました。開くためにリンクをたどってください。';
-
-$lang['summary'] = '%s のフォームから作成されました。';
-
-$lang['submit'] = '送信';
+$lang['e_unknowntype'] = '"%s" という型はありません。';
+$lang['e_unknownaction'] = '不明なアクション「%s」';
+$lang['e_missingargs'] = '%s %s には引数が十分ではありません。';
+$lang['e_noaction'] = 'action が定義されていません - どこにデータを送信するのですか?';
+$lang['e_mail'] = 'データの送信について何かがおかしいです。';
+$lang['e_unknownconstraint'] = '%s という項目制約がありません。';
+$lang['e_labelpage'] = '%s という Labelpage がありません。';
+$lang['e_required'] = '"%s" が必要です。';
+$lang['e_match'] = '"%s" が正しく記入されていません。%s';
+$lang['checkagainst'] = '(/%s/i と照合)';
+$lang['e_email'] = '"%s" は有効なメールアドレスである必要があります。';
+$lang['e_numeric'] = '"%s" は数字である必要があります。';
+$lang['e_date'] = '"%s" は yyyy-mm-dd 形式の日付である必要があります。';
+$lang['e_time'] = '「%s」は、型 (h)h:mm(:ss) に沿った適切な時刻である必要があります。';
+$lang['e_user'] = '"%s" 既存のユーザー名である必要があります。';
+$lang['e_users'] = '"%s" 既存のユーザー名のカンマ区切り一覧である必要があります。';
+$lang['e_min'] = '"%s" は %s より大きい必要があります。';
+$lang['e_max'] = '"%s" は %s より小さい必要があります。';
+$lang['e_pagename'] = 'ページ名がありません。';
+$lang['e_pageexists'] = '"%s" というページは既に存在します。別のページ名を選んで下さい。';
+$lang['e_template'] = '"%s" というテンプレートが読めません。存在しないか読み込み権限がないのではないですか?';
+$lang['e_denied'] = 'このページの作成は許可されません。ログインし忘れていませんか?';
+$lang['mailsubject'] = 'フォームのデータは %s へ送信されました。';
+$lang['mailintro'] = '以下のデータは %s に送信されました。';
+$lang['mail_thanks'] = 'データは正常に送信されました。ありがとう。';
+$lang['template_thanks'] = 'ページは作成されました。開くためにリンクをたどってください。';
+$lang['summary'] = '%s のフォームから作成されました。';
+$lang['attachmentMailEmpty'] = '(ファイル未選択)';
+$lang['attachmentMailToLarge'] = '(メールに添付するにはファイルが大き過ぎます)';
+$lang['attachmentMailToLarge_userinfo'] = 'ファイル「%s」はメールに添付するには大き過ぎます(>%s)(メール自体は送信されました)';
+$lang['submit'] = '送信';
diff --git a/lang/ja/settings.php b/lang/ja/settings.php
index 1078daf..ae1478a 100644
--- a/lang/ja/settings.php
+++ b/lang/ja/settings.php
@@ -1,7 +1,9 @@
*/
-$lang['runas'] = 'テンプレートモードに影響があります。テンプレートを読み込み、ページを作成するために ACL チェックする場合、この(仮想)ユーザーの権限を使用してください。';
+$lang['runas'] = 'テンプレートモードに影響があります。テンプレートを読み込み、ページを作成するために ACL チェックする場合、この(仮想)ユーザーの権限を使用してください。';
+$lang['maxEmailAttachmentSize'] = 'メールに添付するファイルの最大サイズ(バイト数/1ファイルごと)';
From 9c944070ec00efbad11f5565aff9852d6ba2bcc1 Mon Sep 17 00:00:00 2001
From: Andreas Gohr
Date: Mon, 10 Sep 2018 20:37:20 +0200
Subject: [PATCH 42/50] add missing formid parameter for hiddenautoinc field
fixes #252
---
helper/fieldhiddenautoinc.php | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/helper/fieldhiddenautoinc.php b/helper/fieldhiddenautoinc.php
index b359fb4..787e081 100644
--- a/helper/fieldhiddenautoinc.php
+++ b/helper/fieldhiddenautoinc.php
@@ -23,10 +23,11 @@ function initialize($args) {
*
* Outputs the represented field using the passed Doku_Form object.
*
- * @params array $params Additional HTML specific parameters
- * @params Doku_Form $form The target Doku_Form object
+ * @param array $params Additional HTML specific parameters
+ * @param Doku_Form $form The target Doku_Form object
+ * @param $formid
*/
- function renderfield($params, Doku_Form $form) {
+ function renderfield($params, Doku_Form $form, $formid) {
$this->_handlePreload();
$form->addHidden($params['name'], $this->getParam('value') . '');
}
From 5fa58a8bf0df616efb7ad4a1f6d0fd741ecaf999 Mon Sep 17 00:00:00 2001
From: Andreas Gohr
Date: Mon, 10 Sep 2018 23:50:11 +0200
Subject: [PATCH 43/50] Version upped
---
plugin.info.txt | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/plugin.info.txt b/plugin.info.txt
index fa926ba..37ef825 100644
--- a/plugin.info.txt
+++ b/plugin.info.txt
@@ -1,7 +1,7 @@
base bureaucracy
author Andreas Gohr
email andi@splitbrain.org
-date 2018-08-16
+date 2018-09-10
name Bureaucracy Plugin
desc Create forms and generate pages or emails from them
url https://www.dokuwiki.org/plugin:bureaucracy
From a12a2f3bef19748e7c65d920d8061a15d2702819 Mon Sep 17 00:00:00 2001
From: Vicente
Date: Sun, 7 Oct 2018 22:50:11 +0200
Subject: [PATCH 44/50] translation update
---
lang/es/lang.php | 38 ++++++++++++++++++++++++++++++++++++++
lang/es/settings.php | 9 +++++++++
2 files changed, 47 insertions(+)
create mode 100644 lang/es/lang.php
create mode 100644 lang/es/settings.php
diff --git a/lang/es/lang.php b/lang/es/lang.php
new file mode 100644
index 0000000..52624d7
--- /dev/null
+++ b/lang/es/lang.php
@@ -0,0 +1,38 @@
+
+ */
+$lang['e_unknowntype'] = 'Tipo desconocido "%s"';
+$lang['e_unknownaction'] = 'Acción desconocida "%s"';
+$lang['e_missingargs'] = 'Faltan argumentos para %s %s';
+$lang['e_noaction'] = 'Falta definir la acción - ¿Dónde enviamos los datos?';
+$lang['e_mail'] = 'Algún problema al enviar los datos';
+$lang['e_unknownconstraint'] = 'Faltan los límites del campo %s';
+$lang['e_labelpage'] = 'Pagina de LABELS "%s" no encontrada';
+$lang['e_required'] = '"%s" es necesario';
+$lang['e_match'] = '"%s" no esta completado correctamente. %s';
+$lang['checkagainst'] = '(Comprobado con /%s/i)';
+$lang['e_email'] = '"%s" tiene que ser un eMail válido.';
+$lang['e_numeric'] = '"%s" debe ser numérico.';
+$lang['e_date'] = '"%s" debe que ser una fecha válida con formato yyyy-mm-dd';
+$lang['e_time'] = '"%s" debe ser una hora válida con formato (h)h:mm(:ss)';
+$lang['e_user'] = '"%s" debe ser el nombre de un usuario existente.';
+$lang['e_users'] = '"%s" tiene que contener una lista de usuarios existentes separados por comas.';
+$lang['e_min'] = '"%s" debe ser mayor de %s.';
+$lang['e_max'] = '"%s" debe ser menor de %s.';
+$lang['e_pagename'] = 'Falta el nombre de la página.';
+$lang['e_pageexists'] = 'La pagina "%s" existe. Escoja un nombre diferente.';
+$lang['e_template'] = 'No se puede leer la plantilla "%s". O no existe, o no tenemos permisos de lectura.';
+$lang['e_denied'] = 'No tiene permisos para crear la página, ¿Esta logueado?';
+$lang['mailsubject'] = 'Formulario enviado en %s';
+$lang['mailintro'] = 'Los siguientes datos enviados en %s';
+$lang['mail_thanks'] = 'Formulario enviado correctamente. Gracias.';
+$lang['template_thanks'] = 'La página esta creada, siga el enlace para abrirla.';
+$lang['summary'] = 'Creada desde el formulario en %s';
+$lang['attachmentMailEmpty'] = '(fichero no enviado)';
+$lang['attachmentMailToLarge'] = '(fichero demasiado largo para incrustarlo en un eMail)';
+$lang['attachmentMailToLarge_userinfo'] = 'Fichero "%s" demasiado largo para incrustarlo en un eMail (>%s) (eMail enviado de todas formas)';
+$lang['submit'] = 'Enviar';
diff --git a/lang/es/settings.php b/lang/es/settings.php
new file mode 100644
index 0000000..e783e78
--- /dev/null
+++ b/lang/es/settings.php
@@ -0,0 +1,9 @@
+
+ */
+$lang['runas'] = 'Afecta el modo plantilla. Use los permisos de este usuario (virtual) cuando compruebe los ACLs para leer plantillas y crear páginas.';
+$lang['maxEmailAttachmentSize'] = 'Maximo tamaño, en Bytes, de los elementos incrustados en un eMail. (por fichero)';
From 0c86297b4bcc22672a5da663e82d84a06fe7f903 Mon Sep 17 00:00:00 2001
From: Rafael Grando
Date: Mon, 12 Nov 2018 15:00:44 +0100
Subject: [PATCH 45/50] translation update
---
lang/pt/lang.php | 37 +++++++++++++++++++++++++++++++++++++
lang/pt/settings.php | 9 +++++++++
2 files changed, 46 insertions(+)
create mode 100644 lang/pt/lang.php
create mode 100644 lang/pt/settings.php
diff --git a/lang/pt/lang.php b/lang/pt/lang.php
new file mode 100644
index 0000000..3e9913d
--- /dev/null
+++ b/lang/pt/lang.php
@@ -0,0 +1,37 @@
+
+ */
+$lang['e_unknowntype'] = 'Tipo desconhecido "%s"';
+$lang['e_unknownaction'] = 'Ação desconhecida "%s"';
+$lang['e_missingargs'] = 'Argumentos insuficientes para %s %s';
+$lang['e_noaction'] = 'Nenhuma ação definida - para onde os dados devem ser enviados?';
+$lang['e_mail'] = 'Algo deu errado ao enviar esses dados';
+$lang['e_unknownconstraint'] = 'Restrição de campo desconhecida %s';
+$lang['e_labelpage'] = 'Labelpage %s não encontrada';
+$lang['e_required'] = '"%s" é obrigatório';
+$lang['e_match'] = '"%s" não foi preenchido corretamente. %s';
+$lang['checkagainst'] = '(Verificado contra /%s/i)';
+$lang['e_email'] = '"%s" precisa ser um endereço de email válido.';
+$lang['e_numeric'] = '"%s" precisa ser um número.';
+$lang['e_date'] = '"%s" precisa ser uma data válida no formato aaaa-mm-dd.';
+$lang['e_time'] = '"%s" precisa ser um horário válido no formato (h)h:mm:(:ss).';
+$lang['e_user'] = '"%s" precisa ser o nome de um usuário existente.';
+$lang['e_users'] = '"%s" precisa ser uma lista separada por vírgulas de nomes de usuários existentes.';
+$lang['e_min'] = '"%s" precisa ser maior que %s.';
+$lang['e_max'] = '"%s" precisa ser menor que %s.';
+$lang['e_pageexists'] = 'A página "%s" já existe. Por favor, escolha um nome diferente para a página.';
+$lang['e_template'] = 'Não foi possível ler o modelo "%s". Talvez ele não exista ou você não tenha permissões de leitura?';
+$lang['e_denied'] = 'Você não está autorizado a criar esta página. Talvez tenha esquecido de entrar?';
+$lang['mailsubject'] = 'Dados do formulário enviados às %s';
+$lang['mailintro'] = 'Os dados a seguir foram enviados em %s.';
+$lang['mail_thanks'] = 'Seus dados foram enviados com sucesso. Obrigado.';
+$lang['template_thanks'] = 'A página foi criada, siga o link para abri-la.';
+$lang['summary'] = 'Criado do formulário às %s.';
+$lang['attachmentMailEmpty'] = '(arquivo não enviado)';
+$lang['attachmentMailToLarge'] = '(arquivo muito grande para anexar ao email)';
+$lang['attachmentMailToLarge_userinfo'] = 'arquivo "%s" é muito grande para anexar ao email (>%s) (email enviado mesmo assim)';
+$lang['submit'] = 'Enviar';
diff --git a/lang/pt/settings.php b/lang/pt/settings.php
new file mode 100644
index 0000000..174eb1c
--- /dev/null
+++ b/lang/pt/settings.php
@@ -0,0 +1,9 @@
+
+ */
+$lang['runas'] = 'Afeta o modo template. Use essas permissões (virtuais) de usuário quando checar ACLs para ler modelos e criar páginas.';
+$lang['maxEmailAttachmentSize'] = 'Tamanho máximo de anexos em bytes. (por arquivo)';
From b3ccaa806f50eb819ed87ffc77ad0fdcb19e9c36 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Schplurtz=20le=20D=C3=A9boulonn=C3=A9?=
Date: Wed, 27 Feb 2019 08:15:20 +0100
Subject: [PATCH 46/50] translation update
---
lang/fr/lang.php | 18 +++++++++---------
lang/fr/settings.php | 2 +-
2 files changed, 10 insertions(+), 10 deletions(-)
diff --git a/lang/fr/lang.php b/lang/fr/lang.php
index e3a3a6e..5bae4e0 100644
--- a/lang/fr/lang.php
+++ b/lang/fr/lang.php
@@ -13,26 +13,26 @@
$lang['e_unknownconstraint'] = 'Contrainte de champ inconue %s';
$lang['e_labelpage'] = 'Page de label %s non trouvée.';
$lang['e_required'] = '"%s" est requis';
-$lang['e_match'] = '"%s" n\'a pas été remplis correctement. %s';
+$lang['e_match'] = '"%s" n\'est pas remplis correctement. %s';
$lang['checkagainst'] = '(vérifié avec /%s/i)';
-$lang['e_email'] = '"%s" doit être une adresse e-mail valide.';
+$lang['e_email'] = '"%s" doit être une adresse de courriel valide.';
$lang['e_numeric'] = '"%s" doit être un nombre.';
$lang['e_date'] = '"%s" doit être une date valide au format yyyy-mm-dd.';
$lang['e_time'] = '"%s" nécessite une heure valide au format (h)h:mm(:ss).';
$lang['e_user'] = '"%s" doit être le nom d\'un utilisateur existant.';
-$lang['e_users'] = '"%s" doit être une liste de noms d\'utilisateurs séparés par des virgules.';
+$lang['e_users'] = '"%s" doit être une liste à virgules de noms d\'utilisateurs.';
$lang['e_min'] = '"%s" doit être plus grand que %s.';
$lang['e_max'] = '"%s" doit être plus petit que %s.';
$lang['e_pagename'] = 'Nom de page manquant.';
-$lang['e_pageexists'] = 'La page "%s" existe déjà. Choisissez un autre nom.';
+$lang['e_pageexists'] = 'La page "%s" existe déjà. Veuillez choisir un autre nom.';
$lang['e_template'] = 'Modèle "%s" introuvable. Il n\'existe pas ou vous n\'avez pas l\'autorisation de lecture.';
$lang['e_denied'] = 'Vous n\'avez pas le droit de créer cette page, vous êtes vous connecté ?';
-$lang['mailsubject'] = 'Données du formulaire soumises à %s';
-$lang['mailintro'] = 'Les données suivantes on été envoyées vers %s.';
+$lang['mailsubject'] = 'Données du formulaire de la page %s';
+$lang['mailintro'] = 'Les données suivantes ont été envoyées le %s.';
$lang['mail_thanks'] = 'Données envoyées avec succès. Merci.';
-$lang['template_thanks'] = 'La page a été créée, suivez le lien pour l\'ouvrir.';
+$lang['template_thanks'] = 'La page est créée, suivez le lien pour l\'ouvrir.';
$lang['summary'] = 'Créé depuis le formulaire %s';
$lang['attachmentMailEmpty'] = '(fichier non envoyé)';
-$lang['attachmentMailToLarge'] = '(pièce jointe trop grosse)';
-$lang['attachmentMailToLarge_userinfo'] = 'fichier "%s" trop gros comme pièce jointe (>%s). Le message a tout de même été envoyé.';
+$lang['attachmentMailToLarge'] = '(fichier trop grand comme pièce jointe de courriel)';
+$lang['attachmentMailToLarge_userinfo'] = 'fichier "%s" trop grand comme pièce jointe (>%s). Le message est tout de même parti.';
$lang['submit'] = 'Envoyer';
diff --git a/lang/fr/settings.php b/lang/fr/settings.php
index a97393d..72031df 100644
--- a/lang/fr/settings.php
+++ b/lang/fr/settings.php
@@ -5,5 +5,5 @@
*
* @author Schplurtz le Déboulonné
*/
-$lang['runas'] = 'Mode «template» : teste les ACL avec les permissions de cet utilisateur (virtuel) pour la lecture des page modèles et la création de page.';
+$lang['runas'] = 'Mode «template» : teste les ACL avec les permissions de cet utilisateur (virtuel) pour la lecture des modèles et la création de page.';
$lang['maxEmailAttachmentSize'] = 'Taille max en octet des pièces jointes dans les courriels. (par fichier)';
From d37046c05edc4cee2556bc80531e049ff911e5e9 Mon Sep 17 00:00:00 2001
From: Andreas Gohr
Date: Wed, 20 Mar 2019 16:38:36 +0100
Subject: [PATCH 47/50] fix testing
---
.travis.yml | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/.travis.yml b/.travis.yml
index 3ee2bb1..8f5c366 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -1,5 +1,6 @@
language: php
php:
+ - "7.3"
- "7.2"
- "7.1"
- "7.0"
@@ -8,4 +9,4 @@ before_install: wget https://raw.github.com/splitbrain/dokuwiki-travis/master/tr
install: sh travis.sh
script:
- cd _test
- - phpunit --group plugin_bureaucracy
+ - ./phpunit.phar --group plugin_bureaucracy
From f559cfc49dff6b5706a0c831850d0751c5aed604 Mon Sep 17 00:00:00 2001
From: Andreas Gohr
Date: Wed, 20 Mar 2019 23:50:12 +0100
Subject: [PATCH 48/50] Version upped
---
plugin.info.txt | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/plugin.info.txt b/plugin.info.txt
index 37ef825..bd35457 100644
--- a/plugin.info.txt
+++ b/plugin.info.txt
@@ -1,7 +1,7 @@
base bureaucracy
author Andreas Gohr
email andi@splitbrain.org
-date 2018-09-10
+date 2019-03-20
name Bureaucracy Plugin
desc Create forms and generate pages or emails from them
url https://www.dokuwiki.org/plugin:bureaucracy
From be2c77b33297d0c8bdc8391f896a07dc2e46d2f7 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Maur=C3=ADcio=20Sampaio?=
Date: Thu, 30 May 2019 16:33:14 -0300
Subject: [PATCH 49/50] Update lang.php
Add translation for $lang['e_time']
---
lang/pt-br/lang.php | 1 +
1 file changed, 1 insertion(+)
diff --git a/lang/pt-br/lang.php b/lang/pt-br/lang.php
index f69c6ea..a3ab322 100644
--- a/lang/pt-br/lang.php
+++ b/lang/pt-br/lang.php
@@ -12,6 +12,7 @@
$lang['e_email'] = '"%s" tem de ser um endereço de email válido.';
$lang['e_numeric'] = '"%s" tem de ser um número.';
$lang['e_date'] = '"%s" tem de ser uma data válida no formato dd-mm-yyyy.';
+$lang['e_time'] = '"%s" tem de ser um horário válido no formato (h)h:mm(:ss).';
$lang['e_user'] = '"%s" tem de ser o nome de um usuário existente.';
$lang['e_users'] = '"%s" tem de ser uma lista de nomes de usuários existentes separados por vírgulas.';
$lang['e_min'] = '"%s" tem de ser maior que %s.';
From 22adff34400903c487f338dd1f706ab0721b6e2a Mon Sep 17 00:00:00 2001
From: Andreas Gohr
Date: Wed, 19 Jun 2019 23:50:07 +0200
Subject: [PATCH 50/50] Version upped
---
plugin.info.txt | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/plugin.info.txt b/plugin.info.txt
index bd35457..ff5973e 100644
--- a/plugin.info.txt
+++ b/plugin.info.txt
@@ -1,7 +1,7 @@
base bureaucracy
author Andreas Gohr
email andi@splitbrain.org
-date 2019-03-20
+date 2019-05-30
name Bureaucracy Plugin
desc Create forms and generate pages or emails from them
url https://www.dokuwiki.org/plugin:bureaucracy