Merge pull request #311 from nextcloud/enh/php-cs
This commit is contained in:
commit
15c78500b4
39 changed files with 1824 additions and 1780 deletions
1
.gitattributes
vendored
Normal file
1
.gitattributes
vendored
Normal file
|
|
@ -0,0 +1 @@
|
|||
/js/* binary
|
||||
48
.github/workflows/lint.yml
vendored
48
.github/workflows/lint.yml
vendored
|
|
@ -28,6 +28,30 @@ jobs:
|
|||
- name: Lint
|
||||
run: composer run lint
|
||||
|
||||
php-cs-fixer:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
strategy:
|
||||
matrix:
|
||||
php-versions: ['7.4']
|
||||
|
||||
name: cs php${{ matrix.php-versions }}
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@master
|
||||
|
||||
- name: Set up php
|
||||
uses: shivammathur/setup-php@master
|
||||
with:
|
||||
php-version: ${{ matrix.php-versions }}
|
||||
coverage: none
|
||||
|
||||
- name: Install dependencies
|
||||
run: composer i
|
||||
|
||||
- name: Run coding standards check
|
||||
run: composer run cs:check || ( echo 'Please run `composer run cs:fix` to format your code' && exit 1 )
|
||||
|
||||
node:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
|
|
@ -35,7 +59,7 @@ jobs:
|
|||
matrix:
|
||||
node-versions: [12.x]
|
||||
|
||||
name: node${{ matrix.node-versions }}
|
||||
name: eslint node${{ matrix.node-versions }}
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
|
||||
|
|
@ -49,3 +73,25 @@ jobs:
|
|||
|
||||
- name: Lint
|
||||
run: npm run lint
|
||||
|
||||
stylelint:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
strategy:
|
||||
matrix:
|
||||
node-versions: [12.x]
|
||||
|
||||
name: stylelint node${{ matrix.node-versions }}
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
|
||||
- name: Set up node ${{ matrix.node-versions }}
|
||||
uses: actions/setup-node@v1
|
||||
with:
|
||||
node-versions: ${{ matrix.node-versions }}
|
||||
|
||||
- name: Install dependencies
|
||||
run: npm ci
|
||||
|
||||
- name: Lint
|
||||
run: npm run stylelint
|
||||
|
|
|
|||
5
.gitignore
vendored
5
.gitignore
vendored
|
|
@ -26,4 +26,7 @@ cypress/snapshots
|
|||
js/
|
||||
|
||||
# Compile-Cache
|
||||
v8-compile-cache-0/
|
||||
v8-compile-cache-0/
|
||||
|
||||
# php-cs cache
|
||||
.php_cs.cache
|
||||
17
.php_cs.dist
Normal file
17
.php_cs.dist
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
require_once './vendor/autoload.php';
|
||||
|
||||
use Nextcloud\CodingStandard\Config;
|
||||
|
||||
$config = new Config();
|
||||
$config
|
||||
->getFinder()
|
||||
->notPath('build')
|
||||
->notPath('l10n')
|
||||
->notPath('src')
|
||||
->notPath('vendor')
|
||||
->in(__DIR__);
|
||||
return $config;
|
||||
|
|
@ -8,17 +8,19 @@
|
|||
<version>2.0.0-beta1</version>
|
||||
<licence>agpl</licence>
|
||||
|
||||
<author>Vinzenz Rosenkranz</author>
|
||||
<author>René Gieling</author>
|
||||
<author>Kai Schröer</author>
|
||||
<author>Natalie Gilbert</author>
|
||||
<author>Nick Gallo</author>
|
||||
<author>Inigo Jiron</author>
|
||||
<author>Affan Hussain</author>
|
||||
<author>Ajfar Huq</author>
|
||||
<author>Tim Sattizahn</author>
|
||||
<author>Stephan Link</author>
|
||||
<author>Inigo Jiron</author>
|
||||
<author>John Molakvoæ</author>
|
||||
<author>Jonas Rittershofer</author>
|
||||
<author>Kai Schröer</author>
|
||||
<author>Kameron Sheppard</author>
|
||||
<author>Natalie Gilbert</author>
|
||||
<author>Nick Gallo</author>
|
||||
<author>René Gieling</author>
|
||||
<author>Stephan Link</author>
|
||||
<author>Tim Sattizahn</author>
|
||||
<author>Vinzenz Rosenkranz</author>
|
||||
|
||||
<category>tools</category>
|
||||
<category>social</category>
|
||||
|
|
|
|||
|
|
@ -2,22 +2,25 @@
|
|||
/**
|
||||
* @copyright Copyright (c] 2017 Vinzenz Rosenkranz <vinzenz.rosenkranz@gmail.com>
|
||||
*
|
||||
* @author Vinzenz Rosenkranz <vinzenz.rosenkranz@gmail.com>
|
||||
* @author affan98 <affan98@gmail.com>
|
||||
* @author John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
|
||||
* @author Jonas Rittershofer <jotoeri@users.noreply.github.com>
|
||||
* @author Roeland Jago Douma <roeland@famdouma.nl>
|
||||
*
|
||||
* @license GNU AGPL version 3 or any later version
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as
|
||||
* published by the Free Software Foundation, either version 3 of the
|
||||
* License, or (at your option] any later version.
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as
|
||||
* published by the Free Software Foundation, either version 3 of the
|
||||
* License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
|
|
|
|||
|
|
@ -2,22 +2,18 @@
|
|||
"name": "nextcloud/forms",
|
||||
"type": "project",
|
||||
"license": "AGPLv3",
|
||||
"authors": [
|
||||
{
|
||||
"name": "Vinzenz Rosenkranz"
|
||||
},
|
||||
{
|
||||
"name": "Kai Schröer"
|
||||
},
|
||||
{
|
||||
"name": "René Gieling"
|
||||
}
|
||||
],
|
||||
"require-dev": {
|
||||
"christophwurst/nextcloud": "^16.0",
|
||||
"phpunit/phpunit": "^8"
|
||||
},
|
||||
"scripts": {
|
||||
"lint": "find . -name \\*.php -not -path './vendor/*' -exec php -l \"{}\" \\;"
|
||||
}
|
||||
"christophwurst/nextcloud": "^17.0",
|
||||
"phpunit/phpunit": "^8",
|
||||
"nextcloud/coding-standard": "^0.3.0"
|
||||
},
|
||||
"config": {
|
||||
"optimize-autoloader": true,
|
||||
"classmap-authoritative": true
|
||||
},
|
||||
"scripts": {
|
||||
"lint": "find . -name \\*.php -not -path './vendor/*' -exec php -l \"{}\" \\;",
|
||||
"cs:check": "php-cs-fixer fix --dry-run --diff",
|
||||
"cs:fix": "php-cs-fixer fix"
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,37 +1,36 @@
|
|||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
/**
|
||||
* @copyright Copyright (c) 2017 Vinzenz Rosenkranz <vinzenz.rosenkranz@gmail.com>
|
||||
*
|
||||
* @author Vinzenz Rosenkranz <vinzenz.rosenkranz@gmail.com>
|
||||
* @author affan98 <affan98@gmail.com>
|
||||
* @author Roeland Jago Douma <roeland@famdouma.nl>
|
||||
*
|
||||
* @license GNU AGPL version 3 or any later version
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as
|
||||
* published by the Free Software Foundation, either version 3 of the
|
||||
* License, or (at your option) any later version.
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as
|
||||
* published by the Free Software Foundation, either version 3 of the
|
||||
* License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
namespace OCA\Forms\AppInfo;
|
||||
|
||||
use OCP\AppFramework\App;
|
||||
use OCP\IL10N;
|
||||
use OCP\INavigationManager;
|
||||
use OCP\IURLGenerator;
|
||||
|
||||
class Application extends App {
|
||||
|
||||
const APP_ID = 'forms';
|
||||
public const APP_ID = 'forms';
|
||||
|
||||
/**
|
||||
* Application constructor.
|
||||
|
|
|
|||
|
|
@ -1,29 +1,26 @@
|
|||
<?php
|
||||
|
||||
|
||||
/**
|
||||
* @copyright Copyright (c) 2017 Vinzenz Rosenkranz <vinzenz.rosenkranz@gmail.com>
|
||||
*
|
||||
* @author René Gieling <github@dartcafe.de>
|
||||
* @author Natalie Gilbert <ngilb634@umd.edu>
|
||||
* @author Inigo Jiron
|
||||
* @author Affan Hussain
|
||||
* @author affan98 <affan98@gmail.com>
|
||||
* @author John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
|
||||
* @author Jonas Rittershofer <jotoeri@users.noreply.github.com>
|
||||
* @author Roeland Jago Douma <roeland@famdouma.nl>
|
||||
*
|
||||
* @license GNU AGPL version 3 or any later version
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as
|
||||
* published by the Free Software Foundation, either version 3 of the
|
||||
* License, or (at your option) any later version.
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as
|
||||
* published by the Free Software Foundation, either version 3 of the
|
||||
* License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
|
|
@ -50,7 +47,6 @@ use OCP\IUserSession;
|
|||
use OCP\Security\ISecureRandom;
|
||||
|
||||
class ApiController extends Controller {
|
||||
|
||||
protected $appName;
|
||||
|
||||
/** @var SubmissionMapper */
|
||||
|
|
@ -126,8 +122,8 @@ class ApiController extends Controller {
|
|||
|
||||
/**
|
||||
* @NoAdminRequired
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
* Read all information to edit a Form (form, questions, options, except submissions/answers).
|
||||
*/
|
||||
public function getForm(int $id): Http\JSONResponse {
|
||||
|
|
@ -310,14 +306,14 @@ class ApiController extends Controller {
|
|||
}
|
||||
|
||||
// Check if array contains duplicates
|
||||
if ( array_unique($newOrder) !== $newOrder ) {
|
||||
if (array_unique($newOrder) !== $newOrder) {
|
||||
$this->logger->debug('The given Array contains duplicates.');
|
||||
return new Http\JSONResponse([], Http::STATUS_BAD_REQUEST);
|
||||
}
|
||||
|
||||
// Check if all questions are given in Array.
|
||||
$questions = $this->questionMapper->findByForm($formId);
|
||||
if ( sizeof($questions) !== sizeof($newOrder) ) {
|
||||
if (sizeof($questions) !== sizeof($newOrder)) {
|
||||
$this->logger->debug('The length of the given array does not match the number of stored questions');
|
||||
return new Http\JSONResponse([], Http::STATUS_BAD_REQUEST);
|
||||
}
|
||||
|
|
@ -326,8 +322,7 @@ class ApiController extends Controller {
|
|||
$response = []; // Array of ['questionId' => ['order' => newOrder]]
|
||||
|
||||
// Store array of Question-Entities and check the Questions FormId & old Order.
|
||||
foreach($newOrder as $arrayKey => $questionId) {
|
||||
|
||||
foreach ($newOrder as $arrayKey => $questionId) {
|
||||
try {
|
||||
$questions[$arrayKey] = $this->questionMapper->findById($questionId);
|
||||
} catch (IMapperException $e) {
|
||||
|
|
@ -347,7 +342,7 @@ class ApiController extends Controller {
|
|||
|
||||
// Abort if a question is already marked as deleted (order==0)
|
||||
$oldOrder = $questions[$arrayKey]->getOrder();
|
||||
if ( $oldOrder === 0) {
|
||||
if ($oldOrder === 0) {
|
||||
$this->logger->debug('This Question has already been marked as deleted: Id: {id}', [
|
||||
'id' => $questions[$arrayKey]->getId()
|
||||
]);
|
||||
|
|
@ -362,7 +357,7 @@ class ApiController extends Controller {
|
|||
}
|
||||
|
||||
// Write to Database
|
||||
foreach($questions as $question) {
|
||||
foreach ($questions as $question) {
|
||||
$this->questionMapper->update($question);
|
||||
|
||||
$response[$question->getId()] = [
|
||||
|
|
@ -446,7 +441,7 @@ class ApiController extends Controller {
|
|||
$formQuestions = $this->questionMapper->findByForm($form->getId());
|
||||
foreach ($formQuestions as $question) {
|
||||
$questionOrder = $question->getOrder();
|
||||
if ( $questionOrder > $deletedOrder ) {
|
||||
if ($questionOrder > $deletedOrder) {
|
||||
$question->setOrder($questionOrder - 1);
|
||||
$this->questionMapper->update($question);
|
||||
}
|
||||
|
|
@ -492,7 +487,7 @@ class ApiController extends Controller {
|
|||
/**
|
||||
* @NoAdminRequired
|
||||
* Writes the given key-value pairs into Database.
|
||||
|
||||
*
|
||||
* @param int $id OptionId of option to update
|
||||
* @param array $keyValuePairs Array of key=>value pairs to update.
|
||||
*/
|
||||
|
|
@ -592,7 +587,7 @@ class ApiController extends Controller {
|
|||
/**
|
||||
* @NoAdminRequired
|
||||
* @PublicPage
|
||||
*
|
||||
*
|
||||
* Process a new submission
|
||||
* @param int $formId
|
||||
* @param array $answers [question_id => arrayOfString]
|
||||
|
|
@ -620,7 +615,7 @@ class ApiController extends Controller {
|
|||
$submission->setTimestamp(time());
|
||||
|
||||
// If not logged in or anonymous use anonID
|
||||
if (!$user || $form->getIsAnonymous()){
|
||||
if (!$user || $form->getIsAnonymous()) {
|
||||
$anonID = "anon-user-". hash('md5', (time() + rand()));
|
||||
$submission->setUserId($anonID);
|
||||
} else {
|
||||
|
|
@ -632,7 +627,7 @@ class ApiController extends Controller {
|
|||
$submissionId = $submission->getId();
|
||||
|
||||
// Process Answers
|
||||
foreach($answers as $questionId => $answerArray) {
|
||||
foreach ($answers as $questionId => $answerArray) {
|
||||
// Search corresponding Question, skip processing if not found
|
||||
$questionIndex = array_search($questionId, array_column($questions, 'id'));
|
||||
if ($questionIndex === false) {
|
||||
|
|
@ -641,11 +636,11 @@ class ApiController extends Controller {
|
|||
$question = $questions[$questionIndex];
|
||||
}
|
||||
|
||||
foreach($answerArray as $answer) {
|
||||
if($question['type'] === 'multiple' || $question['type'] === 'multiple_unique') {
|
||||
foreach ($answerArray as $answer) {
|
||||
if ($question['type'] === 'multiple' || $question['type'] === 'multiple_unique') {
|
||||
// Search corresponding option, skip processing if not found
|
||||
$optionIndex = array_search($answer, array_column($question['options'], 'id'));
|
||||
if($optionIndex === false) {
|
||||
if ($optionIndex === false) {
|
||||
continue;
|
||||
} else {
|
||||
$option = $question['options'][$optionIndex];
|
||||
|
|
@ -653,7 +648,6 @@ class ApiController extends Controller {
|
|||
|
||||
// Load option-text
|
||||
$answerText = $option['text'];
|
||||
|
||||
} else {
|
||||
$answerText = $answer; // Not a multiple-question, answerText is given answer
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,28 +2,26 @@
|
|||
/**
|
||||
* @copyright Copyright (c) 2017 Vinzenz Rosenkranz <vinzenz.rosenkranz@gmail.com>
|
||||
*
|
||||
* @author Vinzenz Rosenkranz <vinzenz.rosenkranz@gmail.com>
|
||||
* @author René Gieling <github@dartcafe.de>
|
||||
* @author Inigo Jiron <ijiron@terpmail.umd.edu>
|
||||
* @author Natalie Gilbert
|
||||
* @author Affan Hussain
|
||||
* @author John Molakvoæ <skjnldsv@protonmail.com>
|
||||
* @author affan98 <affan98@gmail.com>
|
||||
* @author John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
|
||||
* @author Jonas Rittershofer <jotoeri@users.noreply.github.com>
|
||||
* @author Marcel Klehr <mklehr@gmx.net>
|
||||
* @author Roeland Jago Douma <roeland@famdouma.nl>
|
||||
*
|
||||
* @license GNU AGPL version 3 or any later version
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as
|
||||
* published by the Free Software Foundation, either version 3 of the
|
||||
* License, or (at your option) any later version.
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as
|
||||
* published by the Free Software Foundation, either version 3 of the
|
||||
* License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
|
|
@ -46,7 +44,6 @@ use OCP\IUserSession;
|
|||
use OCP\Util;
|
||||
|
||||
class PageController extends Controller {
|
||||
|
||||
protected $appName;
|
||||
|
||||
/** @var FormMapper */
|
||||
|
|
@ -117,7 +114,7 @@ class PageController extends Controller {
|
|||
/**
|
||||
* @NoAdminRequired
|
||||
* @NoCSRFRequired
|
||||
*
|
||||
*
|
||||
* TODO: Implement cloning
|
||||
*
|
||||
* @return TemplateResponse
|
||||
|
|
@ -191,7 +188,7 @@ class PageController extends Controller {
|
|||
/**
|
||||
* @NoAdminRequired
|
||||
* Check if user has access to this form
|
||||
*
|
||||
*
|
||||
* @param Form $form
|
||||
* @return boolean
|
||||
*/
|
||||
|
|
@ -217,7 +214,7 @@ class PageController extends Controller {
|
|||
// Refuse access, if SubmitOnce is set and user already has taken part.
|
||||
if ($form->getSubmitOnce()) {
|
||||
$participants = $this->submissionMapper->findParticipantsByForm($form->getId());
|
||||
foreach($participants as $participant) {
|
||||
foreach ($participants as $participant) {
|
||||
if ($participant === $user->getUID()) {
|
||||
return false;
|
||||
}
|
||||
|
|
@ -237,7 +234,7 @@ class PageController extends Controller {
|
|||
|
||||
// Check if access granted by group.
|
||||
foreach ($access['groups'] as $group) {
|
||||
if( $this->groupManager->isInGroup($user->getUID(), $group) ) {
|
||||
if ($this->groupManager->isInGroup($user->getUID(), $group)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,22 +2,23 @@
|
|||
/**
|
||||
* @copyright Copyright (c) 2017 Vinzenz Rosenkranz <vinzenz.rosenkranz@gmail.com>
|
||||
*
|
||||
* @author René Gieling <github@dartcafe.de>
|
||||
* @author affan98 <affan98@gmail.com>
|
||||
* @author Roeland Jago Douma <roeland@famdouma.nl>
|
||||
*
|
||||
* @license GNU AGPL version 3 or any later version
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as
|
||||
* published by the Free Software Foundation, either version 3 of the
|
||||
* License, or (at your option) any later version.
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as
|
||||
* published by the Free Software Foundation, either version 3 of the
|
||||
* License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
|
|
@ -28,13 +29,10 @@ use OCP\AppFramework\Http;
|
|||
use OCP\AppFramework\Http\DataResponse;
|
||||
|
||||
use OCP\IGroupManager;
|
||||
use OCP\IUser;
|
||||
use OCP\IUserManager;
|
||||
use OCP\IConfig;
|
||||
use OCP\IRequest;
|
||||
|
||||
class SystemController extends Controller {
|
||||
|
||||
public function __construct(
|
||||
string $appName,
|
||||
IGroupManager $groupManager,
|
||||
|
|
@ -51,9 +49,9 @@ class SystemController extends Controller {
|
|||
* @NoAdminRequired
|
||||
* @return DataResponse
|
||||
*/
|
||||
public function getSiteUsersAndGroups($query = '', $getGroups = true, $getUsers = true, $skipGroups = array(), $skipUsers = array()) {
|
||||
$list = array();
|
||||
$data = array();
|
||||
public function getSiteUsersAndGroups($query = '', $getGroups = true, $getUsers = true, $skipGroups = [], $skipUsers = []) {
|
||||
$list = [];
|
||||
$data = [];
|
||||
if ($getGroups) {
|
||||
$groups = $this->groupManager->search($query);
|
||||
foreach ($groups as $group) {
|
||||
|
|
|
|||
|
|
@ -1,25 +1,28 @@
|
|||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
/**
|
||||
* @copyright Copyright (c) 2020 Jonas Rittershofer <jotoeri@users.noreply.github.com>
|
||||
*
|
||||
* @author affan98 <affan98@gmail.com>
|
||||
* @author Jonas Rittershofer <jotoeri@users.noreply.github.com>
|
||||
* @author Roeland Jago Douma <roeland@famdouma.nl>
|
||||
*
|
||||
* @license GNU AGPL version 3 or any later version
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as
|
||||
* published by the Free Software Foundation, either version 3 of the
|
||||
* License, or (at your option) any later version.
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as
|
||||
* published by the Free Software Foundation, either version 3 of the
|
||||
* License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
|
|
@ -56,5 +59,4 @@ class Answer extends Entity {
|
|||
'text' => htmlspecialchars_decode($this->getText()),
|
||||
];
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,22 +2,24 @@
|
|||
/**
|
||||
* @copyright Copyright (c) 2020 Jonas Rittershofer <jotoeri@users.noreply.github.com>
|
||||
*
|
||||
* @author affan98 <affan98@gmail.com>
|
||||
* @author John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
|
||||
* @author Jonas Rittershofer <jotoeri@users.noreply.github.com>
|
||||
*
|
||||
*
|
||||
* @license GNU AGPL version 3 or any later version
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as
|
||||
* published by the Free Software Foundation, either version 3 of the
|
||||
* License, or (at your option) any later version.
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as
|
||||
* published by the Free Software Foundation, either version 3 of the
|
||||
* License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
|
|
@ -56,8 +58,8 @@ class AnswerMapper extends QBMapper {
|
|||
}
|
||||
|
||||
/**
|
||||
* @param int $submissionId
|
||||
*/
|
||||
* @param int $submissionId
|
||||
*/
|
||||
public function deleteBySubmission(int $submissionId): void {
|
||||
$qb = $this->db->getQueryBuilder();
|
||||
|
||||
|
|
@ -68,5 +70,4 @@ class AnswerMapper extends QBMapper {
|
|||
|
||||
$qb->execute();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,26 +1,27 @@
|
|||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
/**
|
||||
* @copyright Copyright (c) 2017 Vinzenz Rosenkranz <vinzenz.rosenkranz@gmail.com>
|
||||
*
|
||||
* @author Vinzenz Rosenkranz <vinzenz.rosenkranz@gmail.com>
|
||||
* @author Kai Schröer <git@schroeer.co>
|
||||
* @author René Gieling <github@dartcafe.de>
|
||||
*
|
||||
* @author affan98 <affan98@gmail.com>
|
||||
* @author Jonas Rittershofer <jotoeri@users.noreply.github.com>
|
||||
*
|
||||
* @license GNU AGPL version 3 or any later version
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as
|
||||
* published by the Free Software Foundation, either version 3 of the
|
||||
* License, or (at your option) any later version.
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as
|
||||
* published by the Free Software Foundation, either version 3 of the
|
||||
* License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
|
|
@ -49,7 +50,6 @@ use OCP\AppFramework\Db\Entity;
|
|||
* @method void setSubmitOnce(bool $value)
|
||||
*/
|
||||
class Form extends Entity {
|
||||
|
||||
protected $hash;
|
||||
protected $title;
|
||||
protected $description;
|
||||
|
|
|
|||
|
|
@ -2,23 +2,24 @@
|
|||
/**
|
||||
* @copyright Copyright (c) 2017 Vinzenz Rosenkranz <vinzenz.rosenkranz@gmail.com>
|
||||
*
|
||||
* @author Vinzenz Rosenkranz <vinzenz.rosenkranz@gmail.com>
|
||||
* @author René Gieling <github@dartcafe.de>
|
||||
* @author affan98 <affan98@gmail.com>
|
||||
* @author Jonas Rittershofer <jotoeri@users.noreply.github.com>
|
||||
* @author Roeland Jago Douma <roeland@famdouma.nl>
|
||||
*
|
||||
* @license GNU AGPL version 3 or any later version
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as
|
||||
* published by the Free Software Foundation, either version 3 of the
|
||||
* License, or (at your option) any later version.
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as
|
||||
* published by the Free Software Foundation, either version 3 of the
|
||||
* License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
|
|
@ -32,7 +33,7 @@ class FormMapper extends QBMapper {
|
|||
|
||||
/**
|
||||
* FormMapper constructor.
|
||||
*
|
||||
*
|
||||
* @param IDBConnection $db
|
||||
*/
|
||||
public function __construct(IDBConnection $db) {
|
||||
|
|
@ -101,5 +102,4 @@ class FormMapper extends QBMapper {
|
|||
|
||||
return $this->findEntities($qb);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,25 +1,26 @@
|
|||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
/**
|
||||
* @copyright Copyright (c) 2019 Inigo Jiron <ijiron@terpmail.umd.edu>
|
||||
*
|
||||
* @author Inigo Jiron <ijiron@terpmail.umd.edu>
|
||||
* @author Jonas Rittershofer <jotoeri@users.noreply.github.com>
|
||||
*
|
||||
* @license GNU AGPL version 3 or any later version
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as
|
||||
* published by the Free Software Foundation, either version 3 of the
|
||||
* License, or (at your option) any later version.
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as
|
||||
* published by the Free Software Foundation, either version 3 of the
|
||||
* License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
|
|
|
|||
|
|
@ -1,34 +1,34 @@
|
|||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
/**
|
||||
* @copyright Copyright (c) 2019 Inigo Jiron <ijiron@terpmail.umd.edu>
|
||||
*
|
||||
* @author Inigo Jiron <ijiron@terpmail.umd.edu>
|
||||
* @author Natalie Gilbert <ngilb634@umd.edu>
|
||||
* @author Jonas Rittershofer <jotoeri@users.noreply.github.com>
|
||||
*
|
||||
* @license GNU AGPL version 3 or any later version
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as
|
||||
* published by the Free Software Foundation, either version 3 of the
|
||||
* License, or (at your option) any later version.
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as
|
||||
* published by the Free Software Foundation, either version 3 of the
|
||||
* License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
namespace OCA\Forms\Db;
|
||||
|
||||
use OCP\DB\QueryBuilder\IQueryBuilder;
|
||||
use OCP\IDBConnection;
|
||||
use OCP\AppFramework\Db\DoesNotExistException;
|
||||
use OCP\AppFramework\Db\QBMapper;
|
||||
use OCP\IDBConnection;
|
||||
|
||||
class OptionMapper extends QBMapper {
|
||||
|
||||
|
|
@ -42,7 +42,7 @@ class OptionMapper extends QBMapper {
|
|||
|
||||
/**
|
||||
* @param int $questionId
|
||||
* @throws \OCP\AppFramework\Db\DoesNotExistException if not found
|
||||
* @throws DoesNotExistException if not found
|
||||
* @return Option[]
|
||||
*/
|
||||
|
||||
|
|
@ -80,5 +80,4 @@ class OptionMapper extends QBMapper {
|
|||
|
||||
return $this->findEntity($qb);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,24 +1,29 @@
|
|||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
/**
|
||||
* @copyright Copyright (c) 2019 Inigo Jiron <ijiron@terpmail.umd.edu>
|
||||
*
|
||||
* @author Inigo Jiron <ijiron@terpmail.umd.edu>
|
||||
* @author affan98 <affan98@gmail.com>
|
||||
* @author John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
|
||||
* @author Jonas Rittershofer <jotoeri@users.noreply.github.com>
|
||||
* @author Roeland Jago Douma <roeland@famdouma.nl>
|
||||
*
|
||||
* @license GNU AGPL version 3 or any later version
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as
|
||||
* published by the Free Software Foundation, either version 3 of the
|
||||
* License, or (at your option) any later version.
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as
|
||||
* published by the Free Software Foundation, either version 3 of the
|
||||
* License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
|
|
@ -43,7 +48,7 @@ class Question extends Entity {
|
|||
protected $mandatory;
|
||||
protected $text;
|
||||
|
||||
const TYPES = [
|
||||
public const TYPES = [
|
||||
'short',
|
||||
'long',
|
||||
'multiple',
|
||||
|
|
|
|||
|
|
@ -2,36 +2,36 @@
|
|||
/**
|
||||
* @copyright Copyright (c) 2019 Inigo Jiron <ijiron@terpmail.umd.edu>
|
||||
*
|
||||
* @author Inigo Jiron <ijiron@terpmail.umd.edu>
|
||||
* @author Natalie Gilbert <ngilb634@umd.edu>
|
||||
* @author affan98 <affan98@gmail.com>
|
||||
* @author John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
|
||||
* @author Jonas Rittershofer <jotoeri@users.noreply.github.com>
|
||||
* @author Roeland Jago Douma <roeland@famdouma.nl>
|
||||
*
|
||||
* @license GNU AGPL version 3 or any later version
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as
|
||||
* published by the Free Software Foundation, either version 3 of the
|
||||
* License, or (at your option) any later version.
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as
|
||||
* published by the Free Software Foundation, either version 3 of the
|
||||
* License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
namespace OCA\Forms\Db;
|
||||
|
||||
use OCP\AppFramework\Db\QBMapper;
|
||||
use OCP\DB\QueryBuilder\IQueryBuilder;
|
||||
use OCP\IDBConnection;
|
||||
use OCP\AppFramework\Db\QBMapper;
|
||||
|
||||
use OCA\Forms\Db\OptionMapper;
|
||||
use OCP\AppFramework\Db\DoesNotExistException;
|
||||
|
||||
class QuestionMapper extends QBMapper {
|
||||
|
||||
private $optionMapper;
|
||||
|
||||
public function __construct(IDBConnection $db, OptionMapper $optionMapper) {
|
||||
|
|
@ -42,7 +42,7 @@ class QuestionMapper extends QBMapper {
|
|||
|
||||
/**
|
||||
* @param int $formId
|
||||
* @throws \OCP\AppFramework\Db\DoesNotExistException if not found
|
||||
* @throws DoesNotExistException if not found
|
||||
* @return Question[]
|
||||
*/
|
||||
|
||||
|
|
@ -100,5 +100,4 @@ class QuestionMapper extends QBMapper {
|
|||
|
||||
return $this->findEntity($qb);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,25 +1,28 @@
|
|||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
/**
|
||||
* @copyright Copyright (c) 2020 Jonas Rittershofer <jotoeri@users.noreply.github.com>
|
||||
*
|
||||
* @author affan98 <affan98@gmail.com>
|
||||
* @author Jonas Rittershofer <jotoeri@users.noreply.github.com>
|
||||
* @author Roeland Jago Douma <roeland@famdouma.nl>
|
||||
*
|
||||
* @license GNU AGPL version 3 or any later version
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as
|
||||
* published by the Free Software Foundation, either version 3 of the
|
||||
* License, or (at your option) any later version.
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as
|
||||
* published by the Free Software Foundation, either version 3 of the
|
||||
* License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
|
|
@ -56,5 +59,4 @@ class Submission extends Entity {
|
|||
'timestamp' => $this->getTimestamp(),
|
||||
];
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,35 +2,35 @@
|
|||
/**
|
||||
* @copyright Copyright (c) 2020 Jonas Rittershofer <jotoeri@users.noreply.github.com>
|
||||
*
|
||||
* @author affan98 <affan98@gmail.com>
|
||||
* @author Jonas Rittershofer <jotoeri@users.noreply.github.com>
|
||||
* @author Roeland Jago Douma <roeland@famdouma.nl>
|
||||
*
|
||||
* @license GNU AGPL version 3 or any later version
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as
|
||||
* published by the Free Software Foundation, either version 3 of the
|
||||
* License, or (at your option) any later version.
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as
|
||||
* published by the Free Software Foundation, either version 3 of the
|
||||
* License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
namespace OCA\Forms\Db;
|
||||
|
||||
use OCP\AppFramework\Db\DoesNotExistException;
|
||||
use OCP\AppFramework\Db\QBMapper;
|
||||
use OCP\DB\QueryBuilder\IQueryBuilder;
|
||||
use OCP\IDBConnection;
|
||||
use OCP\AppFramework\Db\QBMapper;
|
||||
|
||||
use OCA\Forms\Db\AnswerMapper;
|
||||
|
||||
class SubmissionMapper extends QBMapper {
|
||||
|
||||
private $answerMapper;
|
||||
|
||||
/**
|
||||
|
|
@ -46,7 +46,7 @@ class SubmissionMapper extends QBMapper {
|
|||
|
||||
/**
|
||||
* @param int $formId
|
||||
* @throws \OCP\AppFramework\Db\DoesNotExistException if not found
|
||||
* @throws DoesNotExistException if not found
|
||||
* @return Submission[]
|
||||
*/
|
||||
public function findByForm(int $formId): array {
|
||||
|
|
@ -63,7 +63,7 @@ class SubmissionMapper extends QBMapper {
|
|||
|
||||
/**
|
||||
* @param int $formId
|
||||
* @throws \OCP\AppFramework\Db\DoesNotExistException if not found
|
||||
* @throws DoesNotExistException if not found
|
||||
* @return array
|
||||
*/
|
||||
public function findParticipantsByForm(int $formId): array {
|
||||
|
|
@ -78,7 +78,7 @@ class SubmissionMapper extends QBMapper {
|
|||
$submissionEntities = $this->findEntities($qb);
|
||||
|
||||
// From array of submissionEntities produce array of userIds.
|
||||
$userIds = array_map(function($submissionEntity) {
|
||||
$userIds = array_map(function ($submissionEntity) {
|
||||
return $submissionEntity->getUserId();
|
||||
}, $submissionEntities);
|
||||
|
||||
|
|
@ -86,8 +86,8 @@ class SubmissionMapper extends QBMapper {
|
|||
}
|
||||
|
||||
/**
|
||||
* @param int $formId
|
||||
*/
|
||||
* @param int $formId
|
||||
*/
|
||||
public function deleteByForm(int $formId): void {
|
||||
$qb = $this->db->getQueryBuilder();
|
||||
|
||||
|
|
|
|||
|
|
@ -6,28 +6,25 @@
|
|||
*
|
||||
* @license GNU AGPL version 3 or any later version
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as
|
||||
* published by the Free Software Foundation, either version 3 of the
|
||||
* License, or (at your option) any later version.
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as
|
||||
* published by the Free Software Foundation, either version 3 of the
|
||||
* License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
namespace OCA\Forms\Migration;
|
||||
|
||||
use Doctrine\DBAL\Exception\TableNotFoundException;
|
||||
use Doctrine\DBAL\Platforms\PostgreSqlPlatform;
|
||||
use Doctrine\DBAL\Types\Type;
|
||||
use OCP\DB\ISchemaWrapper;
|
||||
use OCP\DB\QueryBuilder\IQueryBuilder;
|
||||
use OCP\IConfig;
|
||||
use OCP\IDBConnection;
|
||||
use OCP\Migration\SimpleMigrationStep;
|
||||
|
|
|
|||
|
|
@ -2,6 +2,29 @@
|
|||
|
||||
declare(strict_types=1);
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
* @author John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
|
||||
* @author Jonas Rittershofer <jotoeri@users.noreply.github.com>
|
||||
* @author Roeland Jago Douma <roeland@famdouma.nl>
|
||||
*
|
||||
* @license GNU AGPL version 3 or any later version
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as
|
||||
* published by the Free Software Foundation, either version 3 of the
|
||||
* License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
namespace OCA\Forms\Migration;
|
||||
|
||||
use Closure;
|
||||
|
|
|
|||
|
|
@ -2,29 +2,28 @@
|
|||
/**
|
||||
* @copyright Copyright (c) 2020 Jonas Rittershofer <jotoeri@users.noreply.github.com>
|
||||
*
|
||||
* @author John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
|
||||
* @author Jonas Rittershofer <jotoeri@users.noreply.github.com>
|
||||
*
|
||||
* @license GNU AGPL version 3 or any later version
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as
|
||||
* published by the Free Software Foundation, either version 3 of the
|
||||
* License, or (at your option) any later version.
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as
|
||||
* published by the Free Software Foundation, either version 3 of the
|
||||
* License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
namespace OCA\Forms\Migration;
|
||||
|
||||
use Doctrine\DBAL\Exception\TableNotFoundException;
|
||||
use Doctrine\DBAL\Platforms\PostgreSqlPlatform;
|
||||
use Doctrine\DBAL\Types\Type;
|
||||
use OCP\DB\ISchemaWrapper;
|
||||
use OCP\DB\QueryBuilder\IQueryBuilder;
|
||||
|
|
@ -213,7 +212,7 @@ class Version010200Date20200323141300 extends SimpleMigrationStep {
|
|||
$schema = $schemaClosure();
|
||||
|
||||
// if Database exists.
|
||||
if( $schema->hasTable('forms_events') ){
|
||||
if ($schema->hasTable('forms_events')) {
|
||||
$id_mapping = [];
|
||||
$id_mapping['events'] = []; // Maps oldevent-id => ['newId' => newevent-id, 'nextQuestionOrder' => integer]
|
||||
$id_mapping['questions'] = []; // Maps oldquestion-id => ['newId' => newquestion-id]
|
||||
|
|
@ -226,7 +225,7 @@ class Version010200Date20200323141300 extends SimpleMigrationStep {
|
|||
$qb_fetch->select('id', 'hash', 'title', 'description', 'owner', 'created', 'access', 'expire', 'is_anonymous', 'unique')
|
||||
->from('forms_events');
|
||||
$cursor = $qb_fetch->execute();
|
||||
while( $event = $cursor->fetch() ){
|
||||
while ($event = $cursor->fetch()) {
|
||||
$newAccessJSON = $this->convertAccessList($event['access']);
|
||||
|
||||
$qb_restore->insert('forms_v2_forms')
|
||||
|
|
@ -256,9 +255,9 @@ class Version010200Date20200323141300 extends SimpleMigrationStep {
|
|||
$qb_fetch->select('id', 'form_id', 'form_question_type', 'form_question_text')
|
||||
->from('forms_questions');
|
||||
$cursor = $qb_fetch->execute();
|
||||
while( $question = $cursor->fetch() ){
|
||||
while ($question = $cursor->fetch()) {
|
||||
//In case the old Question would have been longer than current possible length, create a warning and shorten text to avoid Error on upgrade.
|
||||
if(strlen($question['form_question_text']) > 2048) {
|
||||
if (strlen($question['form_question_text']) > 2048) {
|
||||
$output->warning("Question-text is too long for new Database: '" . $question['form_question_text'] . "'");
|
||||
$question['form_question_text'] = substr($question['form_question_text'], 0, 2048);
|
||||
}
|
||||
|
|
@ -282,9 +281,9 @@ class Version010200Date20200323141300 extends SimpleMigrationStep {
|
|||
$qb_fetch->select('question_id', 'text')
|
||||
->from('forms_answers');
|
||||
$cursor = $qb_fetch->execute();
|
||||
while( $answer = $cursor->fetch() ){
|
||||
while ($answer = $cursor->fetch()) {
|
||||
//In case the old Answer would have been longer than current possible length, create a warning and shorten text to avoid Error on upgrade.
|
||||
if(strlen($answer['text']) > 1024) {
|
||||
if (strlen($answer['text']) > 1024) {
|
||||
$output->warning("Option-text is too long for new Database: '" . $answer['text'] . "'");
|
||||
$answer['text'] = substr($answer['text'], 0, 1024);
|
||||
}
|
||||
|
|
@ -306,7 +305,7 @@ class Version010200Date20200323141300 extends SimpleMigrationStep {
|
|||
$qb_fetch->select('id')
|
||||
->from('forms_events');
|
||||
$cursor = $qb_fetch->execute();
|
||||
while( $tmp = $cursor->fetch() ){
|
||||
while ($tmp = $cursor->fetch()) {
|
||||
$event_structure[$tmp['id']] = $tmp;
|
||||
}
|
||||
$cursor->closeCursor();
|
||||
|
|
@ -318,7 +317,7 @@ class Version010200Date20200323141300 extends SimpleMigrationStep {
|
|||
->from('forms_questions')
|
||||
->where($qb_fetch->expr()->eq('form_id', $qb_fetch->createNamedParameter($event['id'], IQueryBuilder::PARAM_INT)));
|
||||
$cursor = $qb_fetch->execute();
|
||||
while( $tmp = $cursor->fetch() ) {
|
||||
while ($tmp = $cursor->fetch()) {
|
||||
$event_structure[$event['id']]['questions'][] = $tmp;
|
||||
}
|
||||
$cursor->closeCursor();
|
||||
|
|
@ -336,9 +335,9 @@ class Version010200Date20200323141300 extends SimpleMigrationStep {
|
|||
$qb_fetch->select('id', 'form_id', 'user_id', 'vote_option_id', 'vote_option_text', 'vote_answer')
|
||||
->from('forms_votes');
|
||||
$cursor = $qb_fetch->execute();
|
||||
while( $vote = $cursor->fetch() ){
|
||||
while ($vote = $cursor->fetch()) {
|
||||
//If the form changed, if the user changed or if vote_option_id became smaller than last one, then a new submission is interpreted.
|
||||
if ( ($vote['form_id'] != $last_vote['form_id']) || ($vote['user_id'] != $last_vote['user_id']) || ($vote['vote_option_id'] < $last_vote['vote_option_id'])) {
|
||||
if (($vote['form_id'] != $last_vote['form_id']) || ($vote['user_id'] != $last_vote['user_id']) || ($vote['vote_option_id'] < $last_vote['vote_option_id'])) {
|
||||
$qb_restore->insert('forms_v2_submissions')
|
||||
->values([
|
||||
'form_id' => $qb_restore->createNamedParameter($id_mapping['events'][$vote['form_id']]['newId'], IQueryBuilder::PARAM_INT),
|
||||
|
|
@ -351,7 +350,7 @@ class Version010200Date20200323141300 extends SimpleMigrationStep {
|
|||
$last_vote = $vote;
|
||||
|
||||
//In case the old Answer would have been longer than current possible length, create a warning and shorten text to avoid Error on upgrade.
|
||||
if(strlen($vote['vote_answer']) > 2048) {
|
||||
if (strlen($vote['vote_answer']) > 2048) {
|
||||
$output->warning("Answer-text is too long for new Database: '" . $vote['vote_answer'] . "'");
|
||||
$vote['vote_answer'] = substr($vote['vote_answer'], 0, 2048);
|
||||
}
|
||||
|
|
@ -395,7 +394,7 @@ class Version010200Date20200323141300 extends SimpleMigrationStep {
|
|||
$accessArray['groups'] = [];
|
||||
|
||||
$stringExplode = explode(';', $accessString);
|
||||
foreach($stringExplode as $string) {
|
||||
foreach ($stringExplode as $string) {
|
||||
if (strpos($string, 'user_') === 0) {
|
||||
$accessArray['users'][] = substr($string, 5);
|
||||
} elseif (strpos($string, 'group_') === 0) {
|
||||
|
|
|
|||
|
|
@ -2,21 +2,22 @@
|
|||
/**
|
||||
* @copyright Copyright (c) 2020 John Molakvoæ <skjnldsv@protonmail.com>
|
||||
*
|
||||
* @author John Molakvoæ <skjnldsv@protonmail.com>
|
||||
* @author John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
|
||||
*
|
||||
* @license GNU AGPL version 3 or any later version
|
||||
*
|
||||
* This code is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License, version 3,
|
||||
* as published by the Free Software Foundation.
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as
|
||||
* published by the Free Software Foundation, either version 3 of the
|
||||
* License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License, version 3,
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
|
|
@ -53,12 +54,11 @@ class FormsService {
|
|||
|
||||
public function getOptions(int $questionId): array {
|
||||
$optionList = [];
|
||||
try{
|
||||
try {
|
||||
$optionEntities = $this->optionMapper->findByQuestion($questionId);
|
||||
foreach ($optionEntities as $optionEntity) {
|
||||
$optionList[] = $optionEntity->read();
|
||||
}
|
||||
|
||||
} catch (DoesNotExistException $e) {
|
||||
//handle silently
|
||||
} finally {
|
||||
|
|
@ -68,17 +68,16 @@ class FormsService {
|
|||
|
||||
public function getQuestions(int $formId): array {
|
||||
$questionList = [];
|
||||
try{
|
||||
try {
|
||||
$questionEntities = $this->questionMapper->findByForm($formId);
|
||||
foreach ($questionEntities as $questionEntity) {
|
||||
$question = $questionEntity->read();
|
||||
$question['options'] = $this->getOptions($question['id']);
|
||||
$questionList[] = $question;
|
||||
}
|
||||
|
||||
} catch (DoesNotExistException $e) {
|
||||
//handle silently
|
||||
}finally{
|
||||
} finally {
|
||||
return $questionList;
|
||||
}
|
||||
}
|
||||
|
|
@ -97,5 +96,4 @@ class FormsService {
|
|||
|
||||
return $result;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
390
license.php
Normal file
390
license.php
Normal file
|
|
@ -0,0 +1,390 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* @author Thomas Müller
|
||||
*
|
||||
* @copyright Copyright (c) 2015, ownCloud, Inc.
|
||||
* @license AGPL-3.0
|
||||
*
|
||||
* This code is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License, version 3,
|
||||
* as published by the Free Software Foundation.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License, version 3,
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>
|
||||
*
|
||||
*/
|
||||
class Licenses {
|
||||
protected $paths = [];
|
||||
protected $mailMap = [];
|
||||
protected $checkFiles = [];
|
||||
public $authors = [];
|
||||
|
||||
public function __construct() {
|
||||
$this->licenseText = <<<EOD
|
||||
/**
|
||||
@COPYRIGHT@
|
||||
*
|
||||
@AUTHORS@
|
||||
*
|
||||
* @license GNU AGPL version 3 or any later version
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as
|
||||
* published by the Free Software Foundation, either version 3 of the
|
||||
* License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
EOD;
|
||||
$this->licenseTextLegacy = <<<EOD
|
||||
/**
|
||||
@COPYRIGHT@
|
||||
*
|
||||
@AUTHORS@
|
||||
*
|
||||
* @license AGPL-3.0
|
||||
*
|
||||
* This code is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License, version 3,
|
||||
* as published by the Free Software Foundation.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License, version 3,
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>
|
||||
*
|
||||
*/
|
||||
EOD;
|
||||
$this->licenseTextLegacy = str_replace('@YEAR@', date("Y"), $this->licenseTextLegacy);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string|string[] $folder
|
||||
* @param string|bool $gitRoot
|
||||
*/
|
||||
public function exec($folder, $gitRoot = false) {
|
||||
if (is_array($folder)) {
|
||||
foreach ($folder as $f) {
|
||||
$this->exec($f, $gitRoot);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
if ($gitRoot !== false && substr($gitRoot, -1) !== '/') {
|
||||
$gitRoot .= '/';
|
||||
}
|
||||
|
||||
if (is_file($folder)) {
|
||||
$this->handleFile($folder, $gitRoot);
|
||||
$this->printFilesToCheck();
|
||||
return;
|
||||
}
|
||||
|
||||
$excludes = array_map(function ($item) use ($folder) {
|
||||
return $folder . '/' . $item;
|
||||
}, ['vendor', '3rdparty', '.git', 'l10n', 'templates', 'composer']);
|
||||
|
||||
$iterator = new RecursiveDirectoryIterator($folder, RecursiveDirectoryIterator::SKIP_DOTS);
|
||||
$iterator = new RecursiveCallbackFilterIterator($iterator, function ($item) use ($folder, $excludes) {
|
||||
/** @var SplFileInfo $item */
|
||||
foreach ($excludes as $exclude) {
|
||||
if (substr($item->getPath(), 0, strlen($exclude)) === $exclude) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
});
|
||||
$iterator = new RecursiveIteratorIterator($iterator);
|
||||
$iterator = new RegexIterator($iterator, '/^.+\.php$/i');
|
||||
|
||||
foreach ($iterator as $file) {
|
||||
/** @var SplFileInfo $file */
|
||||
$this->handleFile($file, $gitRoot);
|
||||
}
|
||||
|
||||
$this->printFilesToCheck();
|
||||
}
|
||||
|
||||
public function writeAuthorsFile() {
|
||||
ksort($this->authors);
|
||||
$template = "Nextcloud is written by:
|
||||
@AUTHORS@
|
||||
|
||||
With help from many libraries and frameworks including:
|
||||
Open Collaboration Services
|
||||
SabreDAV
|
||||
jQuery
|
||||
…
|
||||
";
|
||||
$authors = implode(PHP_EOL, array_map(function ($author) {
|
||||
return " - ".$author;
|
||||
}, $this->authors));
|
||||
$template = str_replace('@AUTHORS@', $authors, $template);
|
||||
file_put_contents(__DIR__.'/../AUTHORS', $template);
|
||||
}
|
||||
|
||||
public function handleFile($path, $gitRoot) {
|
||||
$source = file_get_contents($path);
|
||||
if ($this->isMITLicensed($source)) {
|
||||
echo "MIT licensed file: $path" . PHP_EOL;
|
||||
return;
|
||||
}
|
||||
$copyrightNotices = $this->getCopyrightNotices($path, $source);
|
||||
$authors = $this->getAuthors($path, $gitRoot);
|
||||
if ($this->isOwnCloudLicensed($source)) {
|
||||
$license = str_replace('@AUTHORS@', $authors, $this->licenseTextLegacy);
|
||||
$this->checkCopyrightState($path, $gitRoot);
|
||||
} else {
|
||||
$license = str_replace('@AUTHORS@', $authors, $this->licenseText);
|
||||
}
|
||||
|
||||
if ($copyrightNotices === '') {
|
||||
$license = str_replace('@COPYRIGHT@', ' *', $license);
|
||||
} else {
|
||||
$license = str_replace('@COPYRIGHT@', $copyrightNotices, $license);
|
||||
}
|
||||
|
||||
[$source, $isStrict] = $this->eatOldLicense($source);
|
||||
if ($isStrict) {
|
||||
$source = "<?php" . PHP_EOL . PHP_EOL . 'declare(strict_types=1);' . PHP_EOL . PHP_EOL . $license . PHP_EOL . $source;
|
||||
} else {
|
||||
$source = "<?php" . PHP_EOL . $license . PHP_EOL . $source;
|
||||
}
|
||||
file_put_contents($path,$source);
|
||||
echo "License updated: $path" . PHP_EOL;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $source
|
||||
* @return bool
|
||||
*/
|
||||
private function isMITLicensed($source) {
|
||||
$lines = explode(PHP_EOL, $source);
|
||||
while (!empty($lines)) {
|
||||
$line = $lines[0];
|
||||
array_shift($lines);
|
||||
if (strpos($line, 'The MIT License') !== false) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
private function isOwnCloudLicensed($source) {
|
||||
$lines = explode(PHP_EOL, $source);
|
||||
while (!empty($lines)) {
|
||||
$line = $lines[0];
|
||||
array_shift($lines);
|
||||
if (strpos($line, 'ownCloud, Inc') !== false || strpos($line, 'ownCloud GmbH') !== false) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $source
|
||||
* @return string
|
||||
*/
|
||||
private function eatOldLicense($source) {
|
||||
$lines = explode(PHP_EOL, $source);
|
||||
$isStrict = false;
|
||||
while (!empty($lines)) {
|
||||
$line = $lines[0];
|
||||
if (trim($line) === '<?php') {
|
||||
array_shift($lines);
|
||||
continue;
|
||||
}
|
||||
if (strpos($line, '<?php declare(strict_types') !== false) {
|
||||
$isStrict = true;
|
||||
array_shift($lines);
|
||||
continue;
|
||||
}
|
||||
if (strpos($line, 'declare (strict_types') !== false) {
|
||||
$isStrict = true;
|
||||
array_shift($lines);
|
||||
continue;
|
||||
}
|
||||
if (strpos($line, 'declare(strict_types') !== false) {
|
||||
$isStrict = true;
|
||||
array_shift($lines);
|
||||
continue;
|
||||
}
|
||||
if (strpos($line, '/**') !== false) {
|
||||
array_shift($lines);
|
||||
continue;
|
||||
}
|
||||
if (strpos($line, '*/') !== false) {
|
||||
array_shift($lines);
|
||||
break;
|
||||
}
|
||||
if (strpos($line, '*') !== false) {
|
||||
array_shift($lines);
|
||||
continue;
|
||||
}
|
||||
if (trim($line) === '') {
|
||||
array_shift($lines);
|
||||
continue;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
return [implode(PHP_EOL, $lines), $isStrict];
|
||||
}
|
||||
|
||||
private function getCopyrightNotices($path, $file) {
|
||||
$licenseHeaderEndsAtLine = (int)trim(shell_exec("grep -n '*/' $path | head -n 1 | cut -d ':' -f 1"));
|
||||
$lineByLine = explode(PHP_EOL, $file, $licenseHeaderEndsAtLine + 1);
|
||||
$copyrightNotice = [];
|
||||
$licensePart = array_slice($lineByLine, 0, $licenseHeaderEndsAtLine);
|
||||
foreach ($licensePart as $line) {
|
||||
if (strpos($line, '@copyright') !== false) {
|
||||
$copyrightNotice[] = $line;
|
||||
}
|
||||
}
|
||||
|
||||
return implode(PHP_EOL, $copyrightNotice);
|
||||
}
|
||||
|
||||
/**
|
||||
* check if all lines where changed after the Nextcloud fork.
|
||||
* That's not a guarantee that we can switch to AGPLv3 or later,
|
||||
* but a good indicator that we should have a look at the file
|
||||
*
|
||||
* @param $path
|
||||
* @param $gitRoot
|
||||
*/
|
||||
private function checkCopyrightState($path, $gitRoot) {
|
||||
// This was the date the Nextcloud fork was created
|
||||
$deadline = new DateTime('06/06/2016');
|
||||
$deadlineTimestamp = $deadline->getTimestamp();
|
||||
|
||||
$buildDir = getcwd();
|
||||
if ($gitRoot) {
|
||||
chdir($gitRoot);
|
||||
$path = substr($path, strlen($gitRoot));
|
||||
}
|
||||
$out = shell_exec("git --no-pager blame --line-porcelain $path | sed -n 's/^author-time //p'");
|
||||
if ($gitRoot) {
|
||||
chdir($buildDir);
|
||||
}
|
||||
$timestampChanges = explode(PHP_EOL, $out);
|
||||
$timestampChanges = array_slice($timestampChanges, 0, count($timestampChanges)-1);
|
||||
foreach ($timestampChanges as $timestamp) {
|
||||
if ((int)$timestamp < $deadlineTimestamp) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
//all changes after the deadline
|
||||
$this->checkFiles[] = $path;
|
||||
}
|
||||
|
||||
private function printFilesToCheck() {
|
||||
if (!empty($this->checkFiles)) {
|
||||
print "\n";
|
||||
print "For following files all lines changed since the Nextcloud fork." . PHP_EOL;
|
||||
print "Please check if these files can be moved over to AGPLv3 or later" . PHP_EOL;
|
||||
print "\n";
|
||||
foreach ($this->checkFiles as $file) {
|
||||
print $file . PHP_EOL;
|
||||
}
|
||||
print "\n";
|
||||
}
|
||||
}
|
||||
|
||||
private function getAuthors($file, $gitRoot) {
|
||||
// only add authors that changed code and not the license header
|
||||
$licenseHeaderEndsAtLine = trim(shell_exec("grep -n '*/' $file | head -n 1 | cut -d ':' -f 1"));
|
||||
$buildDir = getcwd();
|
||||
if ($gitRoot) {
|
||||
chdir($gitRoot);
|
||||
$file = substr($file, strlen($gitRoot));
|
||||
}
|
||||
$out = shell_exec("git blame --line-porcelain -L $licenseHeaderEndsAtLine, $file | sed -n 's/^author //p;s/^author-mail //p' | sed 'N;s/\\n/ /' | sort -f | uniq");
|
||||
if ($gitRoot) {
|
||||
chdir($buildDir);
|
||||
}
|
||||
$authors = explode(PHP_EOL, $out);
|
||||
|
||||
$authors = array_filter($authors, function ($author) {
|
||||
return !in_array($author, [
|
||||
'',
|
||||
'Not Committed Yet <not.committed.yet>',
|
||||
'Jenkins for ownCloud <owncloud-bot@tmit.eu>',
|
||||
'Scrutinizer Auto-Fixer <auto-fixer@scrutinizer-ci.com>',
|
||||
]);
|
||||
});
|
||||
|
||||
if ($gitRoot) {
|
||||
$authors = array_map([$this, 'checkCoreMailMap'], $authors);
|
||||
$authors = array_unique($authors);
|
||||
}
|
||||
|
||||
$authors = array_map(function ($author) {
|
||||
$author = $this->fixInvalidEmail($author);
|
||||
$this->authors[$author] = $author;
|
||||
return " * @author $author";
|
||||
}, $authors);
|
||||
|
||||
return implode(PHP_EOL, $authors);
|
||||
}
|
||||
|
||||
private function checkCoreMailMap($author) {
|
||||
if (empty($this->mailMap)) {
|
||||
$content = file_get_contents(__DIR__ . '/../.mailmap');
|
||||
$entries = explode("\n", $content);
|
||||
foreach ($entries as $entry) {
|
||||
if (strpos($entry, '> ') === false) {
|
||||
$this->mailMap[$entry] = $entry;
|
||||
} else {
|
||||
list($use, $actual) = explode('> ', $entry);
|
||||
$this->mailMap[$actual] = $use . '>';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (isset($this->mailMap[$author])) {
|
||||
return $this->mailMap[$author];
|
||||
}
|
||||
return $author;
|
||||
}
|
||||
|
||||
private function fixInvalidEmail($author) {
|
||||
preg_match('/<(.*)>/', $author, $mailMatch);
|
||||
if (count($mailMatch) === 2 && !filter_var($mailMatch[1], FILTER_VALIDATE_EMAIL)) {
|
||||
$author = str_replace('<'.$mailMatch[1].'>', '"'.$mailMatch[1].'"', $author);
|
||||
}
|
||||
return $author;
|
||||
}
|
||||
}
|
||||
|
||||
$licenses = new Licenses;
|
||||
if (isset($argv[1])) {
|
||||
$licenses->exec($argv[1], isset($argv[2]) ? $argv[1] : false);
|
||||
} else {
|
||||
$licenses->exec([
|
||||
'./appinfo',
|
||||
'./lib',
|
||||
'./templates'
|
||||
]);
|
||||
$licenses->writeAuthorsFile();
|
||||
}
|
||||
2156
package-lock.json
generated
2156
package-lock.json
generated
File diff suppressed because it is too large
Load diff
58
package.json
58
package.json
|
|
@ -2,50 +2,6 @@
|
|||
"name": "forms",
|
||||
"description": "Forms app for nextcloud",
|
||||
"version": "2.0.0-beta1",
|
||||
"authors": [
|
||||
{
|
||||
"name": "Vinzenz Rosenkranz",
|
||||
"email": "vinzenz.rosenkranz@gmail.com",
|
||||
"role": "Polls App Developer"
|
||||
},
|
||||
{
|
||||
"name": "Rene Gieling",
|
||||
"email": "github@dartcafe.de",
|
||||
"role": "Polls App Developer"
|
||||
},
|
||||
{
|
||||
"name": "Natalie Gilbert",
|
||||
"role": "Forms Team Lead/Back End Developer"
|
||||
},
|
||||
{
|
||||
"name": "Inigo Jiron",
|
||||
"role": "Back End Developer/Database Specialist"
|
||||
},
|
||||
{
|
||||
"name": "Affan Hussain",
|
||||
"role": "Forms Technical Lead"
|
||||
},
|
||||
{
|
||||
"name": "Nick Gallo",
|
||||
"role": "Front End Developer"
|
||||
},
|
||||
{
|
||||
"name": "Ajfar Huq",
|
||||
"role": "Front End Developer"
|
||||
},
|
||||
{
|
||||
"name": "Tim Sattizahn",
|
||||
"role": "Forms QA Lead"
|
||||
},
|
||||
{
|
||||
"name": "Stephan Link",
|
||||
"role": "Quality Assurance"
|
||||
},
|
||||
{
|
||||
"name": "Kameron Sheppard",
|
||||
"role": "Quality Assurance"
|
||||
}
|
||||
],
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/nextcloud/forms.git"
|
||||
|
|
@ -62,10 +18,8 @@
|
|||
"watch": "NODE_ENV=development webpack --progress --watch --config webpack.dev.js",
|
||||
"lint": "eslint --ext .js,.vue src",
|
||||
"lint:fix": "eslint --ext .js,.vue src --fix",
|
||||
"stylelint": "stylelint src",
|
||||
"stylelint:fix": "stylelint src --fix",
|
||||
"test": "jest",
|
||||
"test:coverage": "jest --coverage"
|
||||
"stylelint": "stylelint css/*.css css/*.scss src/**/*.vue",
|
||||
"stylelint:fix": "stylelint css/*.css css/*.scss src/**/*.vue --fix"
|
||||
},
|
||||
"dependencies": {
|
||||
"@nextcloud/auth": "^1.2.3",
|
||||
|
|
@ -118,10 +72,10 @@
|
|||
"file-loader": "^6.0.0",
|
||||
"node-sass": "^4.14.0",
|
||||
"sass-loader": "^8.0.2",
|
||||
"stylelint": "^8.4.0",
|
||||
"stylelint-config-recommended-scss": "^3.3.0",
|
||||
"stylelint-scss": "^3.17.1",
|
||||
"stylelint-webpack-plugin": "^0.10.5",
|
||||
"stylelint": "^13.3.3",
|
||||
"stylelint-config-recommended-scss": "^4.2.0",
|
||||
"stylelint-scss": "^3.17.0",
|
||||
"stylelint-webpack-plugin": "^1.2.3",
|
||||
"url-loader": "^4.1.0",
|
||||
"vue-loader": "^15.9.1",
|
||||
"vue-style-loader": "^4.1.1",
|
||||
|
|
|
|||
|
|
@ -177,7 +177,3 @@ export default {
|
|||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
|
||||
</style>
|
||||
|
|
|
|||
|
|
@ -182,7 +182,6 @@ export default {
|
|||
&:focus {
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
cursor: grab;
|
||||
|
||||
&:active {
|
||||
|
|
|
|||
|
|
@ -101,30 +101,30 @@ export default {
|
|||
|
||||
<style lang="scss">
|
||||
.user-row {
|
||||
display: flex;
|
||||
flex-grow: 0;
|
||||
align-items: center;
|
||||
margin-left: 0;
|
||||
margin-top: 0;
|
||||
display: flex;
|
||||
flex-grow: 0;
|
||||
align-items: center;
|
||||
margin-left: 0;
|
||||
margin-top: 0;
|
||||
|
||||
> div {
|
||||
margin: 2px 4px;
|
||||
}
|
||||
> div {
|
||||
margin: 2px 4px;
|
||||
}
|
||||
|
||||
.description {
|
||||
opacity: 0.7;
|
||||
flex-grow: 0;
|
||||
}
|
||||
.description {
|
||||
opacity: 0.7;
|
||||
flex-grow: 0;
|
||||
}
|
||||
|
||||
.avatar {
|
||||
height: 32px;
|
||||
width: 32px;
|
||||
flex-grow: 0;
|
||||
}
|
||||
.avatar {
|
||||
height: 32px;
|
||||
width: 32px;
|
||||
flex-grow: 0;
|
||||
}
|
||||
|
||||
.user-name {
|
||||
opacity: 0.5;
|
||||
flex-grow: 1;
|
||||
}
|
||||
.user-name {
|
||||
opacity: 0.5;
|
||||
flex-grow: 1;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
|
|
|||
|
|
@ -151,6 +151,7 @@ $mediabreak-3: $group-1-width + $owner-width + max($group-2-1-width, $group-2-2-
|
|||
border-bottom: 1px solid var(--color-border);
|
||||
|
||||
&.table-header {
|
||||
opacity: 0.5;
|
||||
.name, .description {
|
||||
padding-left: ($thumbnail-width + $table-padding *2);
|
||||
}
|
||||
|
|
@ -177,10 +178,6 @@ $mediabreak-3: $group-1-width + $owner-width + max($group-2-1-width, $group-2-2-
|
|||
}
|
||||
|
||||
}
|
||||
|
||||
&.table-header {
|
||||
opacity: 0.5;
|
||||
}
|
||||
}
|
||||
|
||||
.wrapper {
|
||||
|
|
@ -188,8 +185,6 @@ $mediabreak-3: $group-1-width + $owner-width + max($group-2-1-width, $group-2-2-
|
|||
align-items: center;
|
||||
position: relative;
|
||||
flex-grow: 0;
|
||||
div {
|
||||
}
|
||||
}
|
||||
|
||||
.name {
|
||||
|
|
@ -253,10 +248,10 @@ $mediabreak-3: $group-1-width + $owner-width + max($group-2-1-width, $group-2-2-
|
|||
}
|
||||
|
||||
.created {
|
||||
width: $group-2-1-width;;
|
||||
width: $group-2-1-width;
|
||||
}
|
||||
.expiry, .participants {
|
||||
width: $group-2-2-width;;
|
||||
width: $group-2-2-width;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -277,83 +272,83 @@ $mediabreak-3: $group-1-width + $owner-width + max($group-2-1-width, $group-2-2-
|
|||
}
|
||||
|
||||
.thumbnail {
|
||||
width: 44px;
|
||||
height: 44px;
|
||||
padding-right: 4px;
|
||||
font-size: 0;
|
||||
background-color: var(--color-text-light);
|
||||
&.dateform {
|
||||
mask-image: var(--icon-calendar-000) no-repeat 50% 50%;
|
||||
-webkit-mask: var(--icon-calendar-000) no-repeat 50% 50%;
|
||||
mask-size: 16px;
|
||||
}
|
||||
&.textform {
|
||||
mask-image: var(--icon-organization-000) no-repeat 50% 50%;
|
||||
-webkit-mask: var(--icon-organization-000) no-repeat 50% 50%;
|
||||
mask-size: 16px;
|
||||
}
|
||||
&.expired {
|
||||
background-color: var(--color-background-darker);
|
||||
}
|
||||
&.access {
|
||||
display: inherit;
|
||||
&.hidden {
|
||||
mask-image: var(--icon-password-000) no-repeat 50% 50%;
|
||||
-webkit-mask: var(--icon-password-000) no-repeat 50% 50%;
|
||||
mask-size: 16px;
|
||||
}
|
||||
&.public {
|
||||
mask-image: var(--icon-link-000) no-repeat 50% 50%;
|
||||
-webkit-mask: var(--icon-link-000) no-repeat 50% 50%;
|
||||
mask-size: 16px;
|
||||
}
|
||||
&.select {
|
||||
mask-image: var(--icon-share-000) no-repeat 50% 50%;
|
||||
-webkit-mask: var(--icon-share-000) no-repeat 50% 50%;
|
||||
mask-size: 16px;
|
||||
}
|
||||
&.registered {
|
||||
mask-image: var(--icon-group-000) no-repeat 50% 50%;
|
||||
-webkit-mask: var(--icon-group-000) no-repeat 50% 50%;
|
||||
mask-size: 16px;
|
||||
}
|
||||
width: 44px;
|
||||
height: 44px;
|
||||
padding-right: 4px;
|
||||
font-size: 0;
|
||||
background-color: var(--color-text-light);
|
||||
&.dateform {
|
||||
mask-image: var(--icon-calendar-000) no-repeat 50% 50%;
|
||||
-webkit-mask: var(--icon-calendar-000) no-repeat 50% 50%;
|
||||
mask-size: 16px;
|
||||
}
|
||||
&.textform {
|
||||
mask-image: var(--icon-organization-000) no-repeat 50% 50%;
|
||||
-webkit-mask: var(--icon-organization-000) no-repeat 50% 50%;
|
||||
mask-size: 16px;
|
||||
}
|
||||
&.expired {
|
||||
background-color: var(--color-background-darker);
|
||||
}
|
||||
&.access {
|
||||
display: inherit;
|
||||
&.hidden {
|
||||
mask-image: var(--icon-password-000) no-repeat 50% 50%;
|
||||
-webkit-mask: var(--icon-password-000) no-repeat 50% 50%;
|
||||
mask-size: 16px;
|
||||
}
|
||||
&.public {
|
||||
mask-image: var(--icon-link-000) no-repeat 50% 50%;
|
||||
-webkit-mask: var(--icon-link-000) no-repeat 50% 50%;
|
||||
mask-size: 16px;
|
||||
}
|
||||
&.select {
|
||||
mask-image: var(--icon-share-000) no-repeat 50% 50%;
|
||||
-webkit-mask: var(--icon-share-000) no-repeat 50% 50%;
|
||||
mask-size: 16px;
|
||||
}
|
||||
&.registered {
|
||||
mask-image: var(--icon-group-000) no-repeat 50% 50%;
|
||||
-webkit-mask: var(--icon-group-000) no-repeat 50% 50%;
|
||||
mask-size: 16px;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.icon-voted {
|
||||
background-image: var(--icon-checkmark-fff);
|
||||
background-image: var(--icon-checkmark-fff);
|
||||
}
|
||||
|
||||
.app-navigation-entry-utils-counter {
|
||||
padding-right: 0 !important;
|
||||
overflow: hidden;
|
||||
text-align: right;
|
||||
font-size: 9pt;
|
||||
line-height: 44px;
|
||||
padding: 0 12px;
|
||||
// min-width: 25px;
|
||||
&.highlighted {
|
||||
padding: 0;
|
||||
text-align: center;
|
||||
span {
|
||||
padding: 2px 5px;
|
||||
border-radius: 10px;
|
||||
background-color: var(--color-primary);
|
||||
color: var(--color-primary-text);
|
||||
}
|
||||
}
|
||||
overflow: hidden;
|
||||
text-align: right;
|
||||
font-size: 9pt;
|
||||
line-height: 44px;
|
||||
padding: 0 12px;
|
||||
padding-right: 0 !important;
|
||||
// min-width: 25px;
|
||||
&.highlighted {
|
||||
padding: 0;
|
||||
text-align: center;
|
||||
span {
|
||||
padding: 2px 5px;
|
||||
border-radius: 10px;
|
||||
background-color: var(--color-primary);
|
||||
color: var(--color-primary-text);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.symbol.icon-voted {
|
||||
position: absolute;
|
||||
left: 11px;
|
||||
top: 16px;
|
||||
background-size: 0;
|
||||
min-width: 8px;
|
||||
min-height: 8px;
|
||||
background-color: var(--color-success);
|
||||
border-radius: 50%;
|
||||
position: absolute;
|
||||
left: 11px;
|
||||
top: 16px;
|
||||
background-size: 0;
|
||||
min-width: 8px;
|
||||
min-height: 8px;
|
||||
background-color: var(--color-success);
|
||||
border-radius: 50%;
|
||||
}
|
||||
</style>
|
||||
x
|
||||
|
|
|
|||
|
|
@ -262,8 +262,8 @@ ul {
|
|||
padding: 8px;
|
||||
display: block;
|
||||
|
||||
span[class^="icon-"],
|
||||
span[class*=" icon-"] {
|
||||
span[class^='icon-'],
|
||||
span[class*=' icon-'] {
|
||||
background-position: 4px;
|
||||
padding-left: 24px;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -154,6 +154,7 @@ export default {
|
|||
flex-direction: column;
|
||||
|
||||
// Force hide navigation toggle as there is no navigation
|
||||
// stylelint-disable-next-line selector-pseudo-element-no-unknown
|
||||
::v-deep #app-navigation-toggle {
|
||||
display: none !important;
|
||||
}
|
||||
|
|
@ -195,6 +196,7 @@ export default {
|
|||
.question {
|
||||
// Less padding needed as submit view does not have drag handles
|
||||
padding-left: 16px;
|
||||
// stylelint-disable-next-line selector-pseudo-element-no-unknown
|
||||
::v-deep &__content {
|
||||
// Left-align multiple choice and checkboxes with question text
|
||||
// Only in submit view
|
||||
|
|
|
|||
|
|
@ -1,25 +1,23 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* @copyright Copyright (c) 2019 Inigo Jiron <ijiron@terpmail.umd.edu>
|
||||
*
|
||||
* @author Inigo Jiron <ijiron@terpmail.umd.edu>
|
||||
* @author John Molakvoæ <skjnldsv@protonmail.com>
|
||||
* @author John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
|
||||
*
|
||||
* @license GNU AGPL version 3 or any later version
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as
|
||||
* published by the Free Software Foundation, either version 3 of the
|
||||
* License, or (at your option) any later version.
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as
|
||||
* published by the Free Software Foundation, either version 3 of the
|
||||
* License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
/**
|
||||
* @copyright Copyright (c) 2020 John Molakvoæ <skjnldsv@protonmail.com>
|
||||
*
|
||||
* @author John Molakvoæ <skjnldsv@protonmail.com>
|
||||
* @author John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
|
||||
*
|
||||
* @license GNU AGPL version 3 or any later version
|
||||
*
|
||||
|
|
@ -13,7 +13,7 @@
|
|||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
|
|
|
|||
|
|
@ -1,25 +1,23 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* @copyright Copyright (c) 2019 Inigo Jiron <ijiron@terpmail.umd.edu>
|
||||
*
|
||||
* @author Inigo Jiron <ijiron@terpmail.umd.edu>
|
||||
* @author John Molakvoæ <skjnldsv@protonmail.com>
|
||||
* @author John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
|
||||
*
|
||||
* @license GNU AGPL version 3 or any later version
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as
|
||||
* published by the Free Software Foundation, either version 3 of the
|
||||
* License, or (at your option) any later version.
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as
|
||||
* published by the Free Software Foundation, either version 3 of the
|
||||
* License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
|
|
|
|||
|
|
@ -2,22 +2,22 @@
|
|||
/**
|
||||
* @copyright Copyright (c) 2017 Kai Schröer <git@schroeer.co>
|
||||
*
|
||||
* @author Kai Schröer <git@schroeer.co>
|
||||
* @author affan98 <affan98@gmail.com>
|
||||
*
|
||||
* @license GNU AGPL version 3 or any later version
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as
|
||||
* published by the Free Software Foundation, either version 3 of the
|
||||
* License, or (at your option) any later version.
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as
|
||||
* published by the Free Software Foundation, either version 3 of the
|
||||
* License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
|
|
|
|||
|
|
@ -49,7 +49,9 @@ module.exports = {
|
|||
},
|
||||
plugins: [
|
||||
new VueLoaderPlugin(),
|
||||
new StyleLintPlugin(),
|
||||
new StyleLintPlugin({
|
||||
files: ['**/*.vue'],
|
||||
}),
|
||||
// Make appName & appVersion available as a constant
|
||||
new webpack.DefinePlugin({ appName }),
|
||||
new webpack.DefinePlugin({ appVersion }),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue