Skip to content

Commit

Permalink
add button on PacientiCovid19 test request detail page go to Zadanky …
Browse files Browse the repository at this point in the history
…testu Covid-19

Signed-off-by: Lukas Drahnik <ldrahnik@gmail.com>
  • Loading branch information
ldrahnik committed Aug 30, 2021
1 parent 2469af2 commit c252794
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 2 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@ Rozšíření přidává užitečné funkce do modulu [Pacienti COVID-19](https:

## Žádanky testů COVID-19 + Pacienti COVID-19

- Přidává tlačítko **Detail žádanky na Žádanky testů COVID-19** na detail žádanky v modulu **Pacienti Covid-19**

![Preview](preview/tlacitko_detail_zadanky_na_Zadanky_testu_covid_19.PNG)

- Přidává možnost přesunout vytváření žádanky z **Žádanky testů Covid 19** do modulu **Pacienti COVID-19**

![Preview](preview/preview_presunout_zadanku_do_Pacienti_covid_19.PNG)
Expand Down
26 changes: 24 additions & 2 deletions content/content.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,11 @@ function getRegistrCUDZadankyMojeZadankyUrl() {
return getEregRegistrUrl() + "/Registr/CUDZadanky/MojeZadanky";
}

function getRegistrCUDOvereniGetCertifikat(Cislo) {
function getRegistrCUDOvereniDetailCisloUrl(Cislo) {
return getRegistrZadankyDomainUrl() + "/Registr/CUD/Overeni/DetailCislo?Cislo=" + Cislo;
}

function getRegistrCUDOvereniGetCertifikatUrl(Cislo) {
return getRegistrZadankyDomainUrl() + "/Registr/CUD/Overeni/GetCertifikat?Cislo=" + Cislo;
}

Expand Down Expand Up @@ -331,7 +335,7 @@ if(CisloElement && CisloElement.value) {
var linkElement = document.createElement("a");

linkElement.setAttribute("class", "button-action ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only valid");
linkElement.setAttribute("href", getRegistrCUDOvereniGetCertifikat(CisloElement.value));
linkElement.setAttribute("href", getRegistrCUDOvereniGetCertifikatUrl(CisloElement.value));
linkElement.text = "Stáhnout certifikát";
linkElement.setAttribute("role", "button");

Expand Down Expand Up @@ -512,4 +516,22 @@ if(
}
}
);
}

if(
CisloLabel && CisloLabel.nextElementSibling.innerText &&
formActionsElement
) {

var Cislo = CisloLabel.nextElementSibling.innerText;

var button = document.createElement("button");
button.innerText = "Detail žádanky na Žádanky testů COVID-19";
button.setAttribute("class", "button-action ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only")

button.addEventListener('click', function() {
window.open(getRegistrCUDOvereniDetailCisloUrl(Cislo));
}, false);

formActionsElement.appendChild(button);
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit c252794

Please sign in to comment.