View | Details | Raw Unified | Return to bug 39522
Collapse All | Expand All

(-)a/t/lib/plugins/Koha/Plugin/TestValuebuilder/test_valuebuilder_popup.tt (-27 / +27 lines)
Lines 1-29 Link Here
1
<!DOCTYPE html>
1
<!DOCTYPE html>
2
<!-- prettier-ignore-start -->
2
<html>
3
<html>
3
<head>
4
    <head>
4
    <title>[% plugin_name | html %] - Valuebuilder</title>
5
        <title>[% plugin_name | html %] - Valuebuilder</title>
5
    <meta charset="UTF-8">
6
        <meta charset="UTF-8" />
6
</head>
7
    </head>
7
<body>
8
    <body>
8
    <h1>[% plugin_name | html %]</h1>
9
        <h1>[% plugin_name | html %]</h1>
9
    <p>This is a test valuebuilder popup for field: [% field_id | html %]</p>
10
        <p>This is a test valuebuilder popup for field: [% field_id | html %]</p>
10
11
11
    <form>
12
        <form>
12
        <label for="test_value">Enter a value:</label>
13
            <label for="test_value">Enter a value:</label>
13
        <input type="text" id="test_value" value="Test Value from Plugin">
14
            <input type="text" id="test_value" value="Test Value from Plugin" />
14
        <br><br>
15
            <br /><br />
15
        <button type="button" onclick="setValueAndClose()">Set Value</button>
16
            <button type="button" onclick="setValueAndClose()">Set Value</button>
16
        <button type="button" onclick="window.close()">Cancel</button>
17
            <button type="button" onclick="window.close()">Cancel</button>
17
    </form>
18
        </form>
18
19
        <script>
19
    <script>
20
            function setValueAndClose() {
20
    function setValueAndClose() {
21
                var value = document.getElementById('test_value').value;
21
        var value = document.getElementById('test_value').value;
22
                if (window.opener && window.opener.document.getElementById('[% field_id | html %]')) {
22
        if (window.opener && window.opener.document.getElementById('[% field_id | html %]')) {
23
                    window.opener.document.getElementById('[% field_id | html %]').value = value;
23
            window.opener.document.getElementById('[% field_id | html %]').value = value;
24
                }
24
        }
25
                window.close();
25
        window.close();
26
            }
26
    }
27
        </script>
27
    </script>
28
    </body>
28
</body>
29
</html>
29
</html>
30
<!-- prettier-ignore-end -->
30
- 

Return to bug 39522