Skip to content

Commit

Permalink
select all laitteiden kopiointiin
Browse files Browse the repository at this point in the history
  • Loading branch information
mikamyllynen committed May 2, 2016
1 parent e66297d commit fc5666a
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions kopioi_laitteita.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,24 @@
require "inc/parametrit.inc";
}

echo "<SCRIPT TYPE=\"text/javascript\" LANGUAGE=\"JavaScript\">
<!--
function toggleAll(toggleBox) {
var currForm = toggleBox.form;
var isChecked = toggleBox.checked;
var nimi = toggleBox.name;
for (var elementIdx=1; elementIdx<currForm.elements.length; elementIdx++) {
if (currForm.elements[elementIdx].type == 'checkbox' && currForm.elements[elementIdx].name.substring(0,20) == nimi) {
currForm.elements[elementIdx].checked = isChecked;
}
}
}
//-->
</script>";

if ($yhtiorow['laiterekisteri_kaytossa'] == '') die(t("Yhtiön parametrit - Laiterekisteri ei ole käytössä"));

$request = array(
Expand Down Expand Up @@ -50,6 +68,7 @@ function echo_piirra_kopiointi_formi($request = array()) {

function echo_piirra_laiterivit($kopioitavat_laitteet) {
echo "<table>";
echo "<tr><td>".t("Ruksaa kaikki")." <input type='checkbox' name='kopioitavat_laitteet' onclick='toggleAll(this);'></td></tr>";
foreach ($kopioitavat_laitteet as $laite) {
echo "<tr><td style='border: 1px solid black;'>";
echo "<input type='checkbox' name='kopioitavat_laitteet[]' value='{$laite['tunnus']}'/>";
Expand Down

0 comments on commit fc5666a

Please sign in to comment.