mirror of
https://github.com/Karaka-Management/oms-Surveys.git
synced 2026-01-11 16:08:41 +00:00
make id public, organigram impl. media password/encryption, settings bug fix, Money->FloatInt change, ...
This commit is contained in:
parent
a66b2a6fbf
commit
cbda7c75b0
|
|
@ -30,7 +30,7 @@ final class SurveyAnswer
|
|||
* @var int
|
||||
* @since 1.0.0
|
||||
*/
|
||||
protected int $id = 0;
|
||||
public int $id = 0;
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
|
|
|
|||
|
|
@ -36,7 +36,7 @@ class SurveyTemplate
|
|||
* @var int
|
||||
* @since 1.0.0
|
||||
*/
|
||||
protected int $id = 0;
|
||||
public int $id = 0;
|
||||
|
||||
/**
|
||||
* Status.
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@ class SurveyTemplateElement
|
|||
* @var int
|
||||
* @since 1.0.0
|
||||
*/
|
||||
protected int $id = 0;
|
||||
public int $id = 0;
|
||||
|
||||
/**
|
||||
* Type.
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@ class SurveyTemplateElementL11n implements \JsonSerializable
|
|||
* @var int
|
||||
* @since 1.0.0
|
||||
*/
|
||||
protected int $id = 0;
|
||||
public int $id = 0;
|
||||
|
||||
/**
|
||||
* Surveys ID.
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@ class SurveyTemplateL11n implements \JsonSerializable
|
|||
* @var int
|
||||
* @since 1.0.0
|
||||
*/
|
||||
protected int $id = 0;
|
||||
public int $id = 0;
|
||||
|
||||
/**
|
||||
* Surveys ID.
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@ class SurveyTemplateLabelL11n implements \JsonSerializable
|
|||
* @var int
|
||||
* @since 1.0.0
|
||||
*/
|
||||
protected int $id = 0;
|
||||
public int $id = 0;
|
||||
|
||||
/**
|
||||
* element ID.
|
||||
|
|
|
|||
|
|
@ -146,15 +146,15 @@ echo $this->getData('nav')->render(); ?>
|
|||
foreach ($elementValues as $elementValue) :
|
||||
if ($element->type === SurveyElementType::CHECKBOX) : ?>
|
||||
<div class="input-control value">
|
||||
<label class="checkbox" for="i<?= $element->getId() . '-' . $this->printHtml($elementValue); ?>">
|
||||
<input id="i<?= $element->getId() . '-' . $this->printHtml($elementValue); ?>" type="checkbox" name="i<?= $element->getId() . '-' . $this->printHtml($elementValue); ?>" value="1">
|
||||
<label class="checkbox" for="i<?= $element->id . '-' . $this->printHtml($elementValue); ?>">
|
||||
<input id="i<?= $element->id . '-' . $this->printHtml($elementValue); ?>" type="checkbox" name="i<?= $element->id . '-' . $this->printHtml($elementValue); ?>" value="1">
|
||||
<span class="checkmark"></span>
|
||||
</label>
|
||||
</div>
|
||||
<?php elseif ($element->type === SurveyElementType::RADIO) : ?>
|
||||
<div class="input-control value">
|
||||
<label class="radio" for="i<?= $element->getId() . '-' . $this->printHtml($elementValue); ?>">
|
||||
<input id="i<?= $element->getId() . '-' . $this->printHtml($elementValue); ?>" type="radio" name="i<?= $element->getId(); ?>" value="<?= $this->printHtml($elementValue); ?>"<?= isset($survey) && $survey->hasPublicResult ? '' : ''; ?>>
|
||||
<label class="radio" for="i<?= $element->id . '-' . $this->printHtml($elementValue); ?>">
|
||||
<input id="i<?= $element->id . '-' . $this->printHtml($elementValue); ?>" type="radio" name="i<?= $element->id; ?>" value="<?= $this->printHtml($elementValue); ?>"<?= isset($survey) && $survey->hasPublicResult ? '' : ''; ?>>
|
||||
<span class="checkmark"></span>
|
||||
</label>
|
||||
</div>
|
||||
|
|
@ -163,20 +163,20 @@ echo $this->getData('nav')->render(); ?>
|
|||
elseif ($element->type === SurveyElementType::DROPDOWN) :
|
||||
$elementValues = $element->getValues();
|
||||
|
||||
echo '<select name="i' . $element->getId() . '>';
|
||||
echo '<select name="i' . $element->id . '>';
|
||||
$elementLabels = \array_values($element->getLabels());
|
||||
foreach ($elementValues as $key => $elementValue) : ?>
|
||||
<option value="<?= $this->printHtml($elementValue); ?>"><?= $this->printHtml($elementLabels[$key]->title); ?>
|
||||
<?php endforeach;
|
||||
echo '</select>';
|
||||
elseif ($element->type === SurveyElementType::TEXTFIELD) : ?>
|
||||
<input type="text" name="i<?= $element->getId() ?>">
|
||||
<input type="text" name="i<?= $element->id ?>">
|
||||
<?php elseif ($element->type === SurveyElementType::TEXTAREA) : ?>
|
||||
<textarea name="i<?= $element->getId() ?>"></textarea>
|
||||
<textarea name="i<?= $element->id ?>"></textarea>
|
||||
<?php elseif ($element->type === SurveyElementType::NUMERIC) : ?>
|
||||
<input type="number" name="i<?= $element->getId() ?>">
|
||||
<input type="number" name="i<?= $element->id ?>">
|
||||
<?php elseif ($element->type === SurveyElementType::DATE) : ?>
|
||||
<input type="datetime-local" name="i<?= $element->getId() ?>">
|
||||
<input type="datetime-local" name="i<?= $element->id ?>">
|
||||
<?php endif;
|
||||
echo '</div>'; // closing "values-section"
|
||||
echo '</div>'; // closing "survey-value-element"
|
||||
|
|
|
|||
|
|
@ -23,14 +23,14 @@ $surveys = $this->getData('surveys') ?? [];
|
|||
/** @var \Modules\Admin\Models\Account $account */
|
||||
$account = $this->getData('account');
|
||||
|
||||
$accountDir = $account->getId() . ' ' . $account->login;
|
||||
$accountDir = $account->id . ' ' . $account->login;
|
||||
|
||||
/** @var \Modules\Media\Models\Collection[] */
|
||||
$collections = $this->getData('collections');
|
||||
$mediaPath = \urldecode($this->getData('path') ?? '/');
|
||||
|
||||
$previous = empty($surveys) ? '{/base}/survey/list' : '{/base}/survey/list?{?}&id=' . \reset($surveys)->getId() . '&ptype=p';
|
||||
$next = empty($surveys) ? '{/base}/survey/list' : '{/base}/survey/list?{?}&id=' . \end($surveys)->getId() . '&ptype=n';
|
||||
$previous = empty($surveys) ? '{/base}/survey/list' : '{/base}/survey/list?{?}&id=' . \reset($surveys)->id . '&ptype=p';
|
||||
$next = empty($surveys) ? '{/base}/survey/list' : '{/base}/survey/list?{?}&id=' . \end($surveys)->id . '&ptype=n';
|
||||
|
||||
echo $this->getData('nav')->render(); ?>
|
||||
|
||||
|
|
@ -152,13 +152,13 @@ echo $this->getData('nav')->render(); ?>
|
|||
<td><a href="<?= $url; ?>"><i class="fa fa-folder-open-o"></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->getId()); ?>"><?= $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 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;
|
||||
$url = UriFactory::build('{/base}/survey/edit?{?}&id=' . $value->getId());
|
||||
$url = UriFactory::build('{/base}/survey/edit?{?}&id=' . $value->id);
|
||||
?>
|
||||
<tr data-href="<?= $url; ?>">
|
||||
<td><label class="checkbox" for="surveyList-<?= $key; ?>">
|
||||
|
|
@ -168,7 +168,7 @@ echo $this->getData('nav')->render(); ?>
|
|||
<td>
|
||||
<td><a href="<?= $url; ?>"><?= $value->getL11n()->title; ?></a>
|
||||
<td>
|
||||
<td><a class="content" href="<?= UriFactory::build('{/base}/profile/single?{?}&for=' . $value->createdBy->getId()); ?>"><?= $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 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; ?>"><?= $value->createdAt->format('Y-m-d'); ?></a>
|
||||
<?php endforeach; ?>
|
||||
<?php if ($count === 0) : ?>
|
||||
|
|
|
|||
|
|
@ -126,7 +126,7 @@ final class ApiControllerTest extends \PHPUnit\Framework\TestCase
|
|||
$request->setData('media', \json_encode([1]));
|
||||
|
||||
$this->module->apiSurveyTemplateCreate($request, $response);
|
||||
self::assertGreaterThan(0, $response->get('')['response']->getId());
|
||||
self::assertGreaterThan(0, $response->get('')['response']->id);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -167,7 +167,7 @@ final class ApiControllerTest extends \PHPUnit\Framework\TestCase
|
|||
}
|
||||
|
||||
$this->module->apiSurveyTemplateElementCreate($request, $response);
|
||||
self::assertGreaterThan(0, $response->get('')['response']->getId());
|
||||
self::assertGreaterThan(0, $response->get('')['response']->id);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -201,7 +201,7 @@ final class ApiControllerTest extends \PHPUnit\Framework\TestCase
|
|||
|
||||
$this->module->apiSurveyAnswerCreate($request, $response);
|
||||
self::markTestIncomplete();
|
||||
self::assertGreaterThan(0, $response->get('')['response']->getId());
|
||||
self::assertGreaterThan(0, $response->get('')['response']->id);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -37,6 +37,6 @@ final class NullSurveyTemplateElementL11nTest extends \PHPUnit\Framework\TestCas
|
|||
public function testId() : void
|
||||
{
|
||||
$null = new NullSurveyTemplateElementL11n(2);
|
||||
self::assertEquals(2, $null->getId());
|
||||
self::assertEquals(2, $null->id);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -37,6 +37,6 @@ final class NullSurveyTemplateElementTest extends \PHPUnit\Framework\TestCase
|
|||
public function testId() : void
|
||||
{
|
||||
$null = new NullSurveyTemplateElement(2);
|
||||
self::assertEquals(2, $null->getId());
|
||||
self::assertEquals(2, $null->id);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -37,6 +37,6 @@ final class NullSurveyTemplateL11nTest extends \PHPUnit\Framework\TestCase
|
|||
public function testId() : void
|
||||
{
|
||||
$null = new NullSurveyTemplateL11n(2);
|
||||
self::assertEquals(2, $null->getId());
|
||||
self::assertEquals(2, $null->id);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -37,6 +37,6 @@ final class NullSurveyTemplateLabelL11nTest extends \PHPUnit\Framework\TestCase
|
|||
public function testId() : void
|
||||
{
|
||||
$null = new NullSurveyTemplateLabelL11n(2);
|
||||
self::assertEquals(2, $null->getId());
|
||||
self::assertEquals(2, $null->id);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -37,6 +37,6 @@ final class NullSurveyTemplateTest extends \PHPUnit\Framework\TestCase
|
|||
public function testId() : void
|
||||
{
|
||||
$null = new NullSurveyTemplate(2);
|
||||
self::assertEquals(2, $null->getId());
|
||||
self::assertEquals(2, $null->id);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -38,7 +38,7 @@ final class SurveyTemplateElementL11nTest extends \PHPUnit\Framework\TestCase
|
|||
*/
|
||||
public function testDefault() : void
|
||||
{
|
||||
self::assertEquals(0, $this->l11n->getId());
|
||||
self::assertEquals(0, $this->l11n->id);
|
||||
self::assertEquals('', $this->l11n->text);
|
||||
self::assertEquals('', $this->l11n->description);
|
||||
self::assertEquals('', $this->l11n->descriptionPlain);
|
||||
|
|
|
|||
|
|
@ -40,7 +40,7 @@ final class SurveyTemplateElementTest extends \PHPUnit\Framework\TestCase
|
|||
*/
|
||||
public function testDefault() : void
|
||||
{
|
||||
self::assertEquals(0, $this->element->getId());
|
||||
self::assertEquals(0, $this->element->id);
|
||||
|
||||
$date = new \DateTime('now');
|
||||
self::assertEquals([], $this->element->getLabels());
|
||||
|
|
|
|||
|
|
@ -38,7 +38,7 @@ final class SurveyTemplateL11nTest extends \PHPUnit\Framework\TestCase
|
|||
*/
|
||||
public function testDefault() : void
|
||||
{
|
||||
self::assertEquals(0, $this->l11n->getId());
|
||||
self::assertEquals(0, $this->l11n->id);
|
||||
self::assertEquals('', $this->l11n->title);
|
||||
self::assertEquals('', $this->l11n->description);
|
||||
self::assertEquals('', $this->l11n->descriptionPlain);
|
||||
|
|
|
|||
|
|
@ -38,7 +38,7 @@ final class SurveyTemplateLabelL11nTest extends \PHPUnit\Framework\TestCase
|
|||
*/
|
||||
public function testDefault() : void
|
||||
{
|
||||
self::assertEquals(0, $this->l11n->getId());
|
||||
self::assertEquals(0, $this->l11n->id);
|
||||
self::assertEquals('', $this->l11n->title);
|
||||
self::assertEquals(ISO639x1Enum::_EN, $this->l11n->getLanguage());
|
||||
}
|
||||
|
|
|
|||
|
|
@ -42,7 +42,7 @@ final class SurveyTemplateTest extends \PHPUnit\Framework\TestCase
|
|||
*/
|
||||
public function testDefault() : void
|
||||
{
|
||||
self::assertEquals(0, $this->survey->getId());
|
||||
self::assertEquals(0, $this->survey->id);
|
||||
|
||||
$date = new \DateTime('now');
|
||||
self::assertEquals([], $this->survey->getElements());
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user