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

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

Return to bug 39522