Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
 into 2.x
  • Loading branch information
jvangestel committed Dec 18, 2024
2 parents b02df08 + a8d4f49 commit 27ad609
Show file tree
Hide file tree
Showing 7 changed files with 8 additions and 56 deletions.
20 changes: 0 additions & 20 deletions src/Handlers/Respondent/RespondentHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
use Gems\Snippets\Generic\CurrentButtonRowSnippet;
use Gems\Snippets\Respondent\DeleteRespondentSnippet;
use Gems\Snippets\Respondent\RespondentDetailsSnippet;
use Gems\Snippets\Respondent\TrafficLightTokenSnippet;
use Gems\SnippetsLoader\GemsSnippetResponder;
use Gems\User\Mask\MaskRepository;
use Psr\Cache\CacheItemPoolInterface;
Expand Down Expand Up @@ -177,7 +176,6 @@ class RespondentHandler extends RespondentChildHandlerAbstract
* @var array Mixed key => value array for snippet initialization
*/
protected array $deleteParameters = [
'baseUrl' => 'getItemUrlArray',
'formTitle' => null,
'forOtherOrgs' => 'getOtherOrgs',
// 'respondentData' => 'getRespondentData',
Expand Down Expand Up @@ -601,24 +599,6 @@ public function getIndexTitle(): string
return $this->_('Respondents');
}

/**
* Return the array with items that should be used to find this item
*
* @return array
*/
public function getItemUrlArray(): array
{
$queryParams = $this->request->getQueryParams();
$patientNr = isset($queryParams[Model::REQUEST_ID1]) ? $queryParams[Model::REQUEST_ID1] : null;
$organizationId = isset($queryParams[Model::REQUEST_ID2]) ? $queryParams[Model::REQUEST_ID2] : null;
$this->currentUserRepository->assertAccessToOrganizationId($organizationId);

return [
Model::REQUEST_ID1 => $patientNr,
Model::REQUEST_ID2 => $organizationId,
];
}

/**
* The organizations whose tokens are shown.
*
Expand Down
2 changes: 2 additions & 0 deletions src/Model/OrganizationModel.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,8 @@ public function __construct(
) {
parent::__construct('gems__organizations', $metaModelLoader, $sqlRunner, $translate, 'organization');

$this->metaModelLoader->setChangeFields($this->metaModel, 'gor');

$this->addColumn("CASE WHEN gor_active = 1 THEN '' ELSE 'deleted' END", 'row_class');

$yesNo = $this->translatedUtil->getYesNo();
Expand Down
1 change: 0 additions & 1 deletion src/Screens/Respondent/Show/GemsDefaultShow.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ class GemsDefaultShow extends ShowScreenAbstract
public function getParameters(): array
{
return [
'baseUrl' => 'getItemUrlArray',
'forOtherOrgs' => 'getOtherOrgs',
'-run-once' => 'openedRespondent',
];
Expand Down
1 change: 0 additions & 1 deletion src/Screens/Respondent/Show/GemsRoundTabsShow.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ class GemsRoundTabsShow extends ShowScreenAbstract
public function getParameters(): array
{
return [
'baseUrl' => 'getItemUrlArray',
'forOtherOrgs' => 'getOtherOrgs',
'-run-once' => 'openedRespondent',
];
Expand Down
9 changes: 0 additions & 9 deletions src/Snippets/Respondent/RoundsTabsSnippet.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,15 +44,6 @@ class RoundsTabsSnippet extends TabSnippetAbstract
*/
protected $_tabs = [];

/**
* Default href parameter values
*
* Clicking a tab always resets the page counter
*
* @var array
*/
protected array $href = ['page' => null];

/**
* The RESPONDENT model, not the token model
*
Expand Down
27 changes: 4 additions & 23 deletions src/Snippets/TabSnippetAbstract.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,6 @@

abstract class TabSnippetAbstract extends SnippetAbstract
{
/**
* Optional standard url parts
*
* @var array
*/
protected array $baseUrl = [];

/**
* Shortfix to add class attribute
*
Expand All @@ -27,13 +20,13 @@ abstract class TabSnippetAbstract extends SnippetAbstract

/**
*
* @var string Id of the current tab
* @var ?string Id of the current tab
*/
protected ?string $currentTab = null;

/**
*
* @var string Id of default tab
* @var ?string Id of default tab
*/
protected ?string $defaultTab = null;

Expand All @@ -44,13 +37,6 @@ abstract class TabSnippetAbstract extends SnippetAbstract
*/
protected bool $displaySingleTab = false;

/**
* Default href parameter values
*
* @var array
*/
protected array $href = [];

/**
*
* @var string Class attribute for active tab
Expand All @@ -73,7 +59,7 @@ public function __construct(SnippetOptions $snippetOptions, RequestInfo $request
/**
* Sets the default and current tab and returns the current
*
* @return string The current tab
* @return ?string The current tab
*/
public function getCurrentTab(): ?string
{
Expand Down Expand Up @@ -115,11 +101,6 @@ public function getHtmlOutput(): ?HtmlInterface
// Set the correct parameters
$this->getCurrentTab();

// Let loose
if (is_array($this->baseUrl)) {
$this->href = $this->href + $this->baseUrl;
}

$tabRow = Html::create()->ul();

foreach ($tabs as $tabId => $content) {
Expand Down Expand Up @@ -167,7 +148,7 @@ protected function getParameterKeysFor(string $tabId): array
return array($paramKey => $tabId);
}

return array();
return [];
}

/**
Expand Down
4 changes: 2 additions & 2 deletions src/Snippets/User/OwnAccountEditAuthSnippet.php
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,7 @@ private function sendMailCode(string $mailAddress, string $code): bool
$language = $this->communicationRepository->getCommunicationLanguage($this->currentUser->getLocale());
$templateId = $this->communicationRepository->getConfirmChangeEmailTemplate($organization);

$variables = $this->communicationRepository->getUserMailFields($this->currentUser, $language);
$variables = $this->communicationRepository->getUserPasswordMailFields($this->currentUser, $language);
$variables += [
'confirmation_code' => $code,
];
Expand Down Expand Up @@ -349,7 +349,7 @@ private function sendPhoneCode(string $phoneNumber, string $code): bool
$language = $this->communicationRepository->getCommunicationLanguage($this->currentUser->getLocale());
$templateId = $this->communicationRepository->getConfirmChangePhoneTemplate($organization);

$variables = $this->communicationRepository->getUserMailFields($this->currentUser, $language);
$variables = $this->communicationRepository->getUserPasswordMailFields($this->currentUser, $language);
$variables += [
'confirmation_code' => $code,
];
Expand Down

0 comments on commit 27ad609

Please sign in to comment.