This commit is contained in:
Dennis Eichhorn 2024-01-02 23:34:19 +00:00
parent 2f359d973d
commit 2f51284d29
6 changed files with 91 additions and 103 deletions

View File

@ -34,7 +34,7 @@ use phpOMS\Views\View;
final class BackendController extends Controller
{
/**
* Routing end-point for application behaviour.
* Routing end-point for application behavior.
*
* @param RequestAbstract $request Request
* @param ResponseAbstract $response Response
@ -52,7 +52,7 @@ final class BackendController extends Controller
}
/**
* Routing end-point for application behaviour.
* Routing end-point for application behavior.
*
* @param RequestAbstract $request Request
* @param ResponseAbstract $response Response
@ -87,7 +87,7 @@ final class BackendController extends Controller
}
/**
* Routing end-point for application behaviour.
* Routing end-point for application behavior.
*
* @param RequestAbstract $request Request
* @param ResponseAbstract $response Response
@ -108,7 +108,7 @@ final class BackendController extends Controller
}
/**
* Routing end-point for application behaviour.
* Routing end-point for application behavior.
*
* @param RequestAbstract $request Request
* @param ResponseAbstract $response Response
@ -148,7 +148,7 @@ final class BackendController extends Controller
}
/**
* Routing end-point for application behaviour.
* Routing end-point for application behavior.
*
* @param RequestAbstract $request Request
* @param ResponseAbstract $response Response

View File

@ -17,7 +17,7 @@ namespace Modules\Surveys\Models;
use phpOMS\Stdlib\Base\Enum;
/**
* Permision state enum.
* Permission category enum.
*
* @package Modules\Surveys\Models
* @license OMS License 2.0

View File

@ -49,4 +49,8 @@ return ['Surveys' => [
'Type' => 'Typ',
'User' => 'Nutzer',
'UserGroup' => 'Benutzergruppe',
'Headline' => 'Headline',
'Textfield' => 'Textfeld',
'Textarea' => 'Textblock',
'Numeric' => 'Zahl',
]];

View File

@ -49,4 +49,8 @@ return ['Surveys' => [
'Type' => 'Type',
'User' => 'User',
'UserGroup' => 'User/Group',
'Headline' => 'Headline',
'Textfield' => 'Textfield',
'Textarea' => 'Textarea',
'Numeric' => 'Numeric',
]];

View File

@ -35,27 +35,51 @@ echo $this->data['nav']->render(); ?>
<form>
<div class="portlet-head"><?= $this->getHtml('Survey'); ?></div>
<div class="portlet-body">
<table class="layout wf-100">
<tr><td colspan="3"><label for="iName"><?= $this->getHtml('Name'); ?><label>
<tr><td colspan="2"><input type="text" id="iName" name="name" required><td>
<tr><td><label for="iStart"><?= $this->getHtml('Start'); ?><label><td><label for="iEnd"><?= $this->getHtml('End'); ?><label><td>
<tr><td><input type="datetime-local" id="iStart" name="start" required><td><input type="datetime-local" id="iEnd" name="end" required><td>
<tr><td colspan="3"><label for="iDesc"><?= $this->getHtml('Description'); ?><label>
<tr><td colspan="2"><textarea id="iDesc" name="desc"></textarea><td>
<tr><td colspan="3">
<div class="input-control">
<label class="checkbox" for="iPublicResult">
<input id="iPublicResult" type="checkbox" name="public_result" value="1"<?= isset($survey) && $survey->hasPublicResult ? ' checked' : ''; ?>>
<span class="checkmark"></span>
<?= $this->getHtml('ResultPublic'); ?>
</label>
</div>
<tr><td><label for="iResponsibility"><?= $this->getHtml('Responsibility'); ?><label><td colspan="2"><label for="iPerm"><?= $this->getHtml('UserGroup'); ?><label>
<tr><td><select id="iResponsibility" name="responsibility">
<option value=""><?= $this->getHtml('Questionee'); ?>
<option value=""><?= $this->getHtml('Manager'); ?>
</select><td><span class="input"><button type="button" formaction=""><i class="g-icon">book</i></button><input type="text" id="iPerm" name="permission"></span><td><button><?= $this->getHtml('Add', '0', '0'); ?></button>
</table>
<div class="form-group">
<label for="iName"><?= $this->getHtml('Name'); ?></label>
<input type="text" id="iName" name="name" value="<?= $this->printHtml($survey->l11n->title); ?>" required>
</div>
<div class="form-group">
<label for="iStart"><?= $this->getHtml('Start'); ?></label>
<input type="datetime-local" id="iStart" name="start" value="<?= $survey->start->format('Y-m-d\TH:i'); ?>" required>
</div>
<div class="form-group">
<label for="iEnd"><?= $this->getHtml('End'); ?></label>
<input type="datetime-local" id="iEnd" name="end" value="<?= $survey->end->format('Y-m-d\TH:i'); ?>" required>
</div>
<div class="form-group">
<label for="iDesc"><?= $this->getHtml('Description'); ?></label>
<textarea id="iDesc" name="desc"></textarea>
</div>
<div class="form-group">
<div class="input-control">
<label class="checkbox" for="iPublicResult">
<input id="iPublicResult" type="checkbox" name="public_result" value="1"<?= isset($survey) && $survey->hasPublicResult ? ' checked' : ''; ?>>
<span class="checkmark"></span>
<?= $this->getHtml('ResultPublic'); ?>
</label>
</div>
</div>
<div class="form-group">
<label for="iResponsibility"><?= $this->getHtml('Responsibility'); ?></label>
<select id="iResponsibility" name="responsibility">
<option value=""><?= $this->getHtml('Questionee'); ?>
<option value=""><?= $this->getHtml('Manager'); ?>
</select>
</div>
<div class="form-group">
<label for="iPerm"><?= $this->getHtml('UserGroup'); ?></label>
<span class="input"><button type="button" formaction=""><i class="g-icon">book</i></button><input type="text" id="iPerm" name="permission"></span>
</div>
<div class="form-group">
</div>
</div>
<div class="portlet-foot">
<input type="submit" value="<?= $this->getHtml('Create', '0', '0'); ?>" name="create-survey">
@ -65,23 +89,38 @@ echo $this->data['nav']->render(); ?>
</div>
<div class="col-xs-12 col-md-6">
<section class="box wf-100">
<header><h1><?= $this->getHtml('Element'); ?></h1></header>
<div class="inner">
<form>
<table class="layout wf-100">
<tr><td colspan="2"><label for="iSection"><?= $this->getHtml('Section'); ?><label>
<tr><td colspan="2"><input type="text" id="iSection" name="section">
<tr><td colspan="2"><label for="iSDesc"><?= $this->getHtml('Description'); ?><label>
<tr><td colspan="2"><textarea id="iSDesc" name="sdesc"></textarea>
<tr><td colspan="2"><label for="iSType"><?= $this->getHtml('Type'); ?><label>
<tr><td colspan="2"><select id="iSType" name="stype">
<option>
</select>
<tr><td colspan="2"><input type="submit" value="<?= $this->getHtml('Add', '0', '0'); ?>" name="add-element">
</table>
</form>
</div>
<section class="portlet">
<form>
<div class="portlet-head"><?= $this->getHtml('Element'); ?></div>
<div class="portlet-body">
<div class="form-group">
<label for="iSection"><?= $this->getHtml('Section'); ?></label>
<input type="text" id="iSection" name="section">
</div>
<div class="form-group">
<label for="iSDesc"><?= $this->getHtml('Description'); ?></label>
<textarea id="iSDesc" name="sdesc"></textarea>
</div>
<div class="form-group">
<label for="iSType"><?= $this->getHtml('Type'); ?></label>
<select id="iSType" name="stype">
<option value="<?= SurveyElementType::HEADLINE; ?>"><?= $this->getHtml('Headline') ?>
<option value="<?= SurveyElementType::DROPDOWN; ?>"><?= $this->getHtml('Dropdown') ?>
<option value="<?= SurveyElementType::CHECKBOX; ?>"><?= $this->getHtml('Checkbox') ?>
<option value="<?= SurveyElementType::RADIO; ?>"><?= $this->getHtml('Radio') ?>
<option value="<?= SurveyElementType::TEXTFIELD; ?>"><?= $this->getHtml('Textfield') ?>
<option value="<?= SurveyElementType::TEXTAREA; ?>"><?= $this->getHtml('Textarea') ?>
<option value="<?= SurveyElementType::NUMERIC; ?>"><?= $this->getHtml('Numeric') ?>
<option value="<?= SurveyElementType::DATE; ?>"><?= $this->getHtml('Date') ?>
</select>
</div>
</div>
<div class="portlet-foot">
<input type="submit" value="<?= $this->getHtml('Add', '0', '0'); ?>" name="create-survey">
</div>
</form>
</section>
</div>
</div>

View File

@ -34,38 +34,6 @@ $next = empty($surveys) ? '{/base}/survey/list' : '{/base}/survey/list?{?}&i
echo $this->data['nav']->render(); ?>
<div class="row">
<div class="col-xs-12">
<div class="box">
<ul class="crumbs-2">
<li data-href="<?= UriFactory::build('{/base}/survey/list?path=/Accounts/' . $accountDir); ?>"><a href="<?= UriFactory::build('{/base}/survey/list?path=/Accounts/' . $accountDir); ?>"><i class="g-icon">home</i></a>
<li data-href="<?= UriFactory::build('{/base}/survey/list?path=/'); ?>"><a href="<?= UriFactory::build('{/base}/survey/list?path=/'); ?>">/</a></li>
<?php
$subPath = '';
$paths = \explode('/', \ltrim($mediaPath, '/'));
$length = \count($paths);
$parentPath = '';
for ($i = 0; $i < $length; ++$i) :
if ($paths[$i] === '') {
continue;
}
if ($i === $length - 1) {
$parentPath = $subPath === '' ? '/' : $subPath;
}
$subPath .= '/' . $paths[$i];
$url = UriFactory::build('{/base}/survey/list?path=' . $subPath);
?>
<li data-href="<?= $url; ?>"<?= $i === $length - 1 ? 'class="active"' : ''; ?>><a href="<?= $url; ?>"><?= $this->printHtml($paths[$i]); ?></a></li>
<?php endfor; ?>
</ul>
</div>
</div>
</div>
<div class="row">
<div class="col-xs-12">
<div class="portlet">
@ -128,33 +96,6 @@ echo $this->data['nav']->render(); ?>
<i class="filter g-icon">filter_alt</i>
</label>
<tbody>
<?php if (!empty($parentPath)) :
$url = UriFactory::build('{/base}/survey/list?path=' . $parentPath);
?>
<tr tabindex="0" data-href="<?= $url; ?>">
<td>
<td data-label="<?= $this->getHtml('Type'); ?>"><a href="<?= $url; ?>"><i class="g-icon">folder_open</i></a>
<td data-label="<?= $this->getHtml('Name'); ?>"><a href="<?= $url; ?>">..</a>
<td>
<td>
<td>
<td>
<?php endif; ?>
<?php $count = 0;
foreach ($collections as $key => $value) : ++$count;
$url = UriFactory::build('{/base}/survey/list?path=' . \rtrim($value->getVirtualPath(), '/') . '/' . $value->name);
?>
<tr data-href="<?= $url; ?>">
<td><label class="checkbox" for="surveyList-<?= $key; ?>">
<input type="checkbox" id="surveyList-<?= $key; ?>" name="surveyselect">
<span class="checkmark"></span>
</label>
<td><a href="<?= $url; ?>"><i class="g-icon">folder_open</i></a>
<td><a href="<?= $url; ?>"><?= $this->printHtml($value->name); ?></a>
<td>
<td><a class="content" href="<?= UriFactory::build('{/base}/profile/single?{?}&for=' . $value->createdBy->id); ?>"><?= $this->printHtml($this->renderUserName('%3$s %2$s %1$s', [$value->createdBy->name1, $value->createdBy->name2, $value->createdBy->name3, $value->createdBy->login ?? ''])); ?></a>
<td><a href="<?= $url; ?>"><?= $this->printHtml($value->createdAt->format('Y-m-d')); ?></a>
<?php endforeach; ?>
<?php
$count = 0;
foreach ($surveys as $key => $value) : ++$count;