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

(-)a/installer/data/mysql/atomicupdate/bug_31028.pl (+33 lines)
Lines 52-56 return { Link Here
52
            }
52
            }
53
        );
53
        );
54
        say $out "`OpacCatalogConcerns` preference added";
54
        say $out "`OpacCatalogConcerns` preference added";
55
56
        if ( ( $dbh->selectrow_array('SELECT COUNT(*) FROM additional_contents WHERE location=?', undef, 'CatalogConcernHelp') )[0] == 0 ) { # Check to make idempotent
57
            $dbh->do(
58
                q{
59
                    INSERT INTO additional_contents ( category, code, location, title, content, lang, published_on, expirationdate, number ) VALUES ('html_customizations', 'CatalogConcernHelp_1', 'CatalogConcernHelp', 'Catalog concern help text', 'Please describe your concern clearly and the library will try to deal with it as quickly as possible', 'default', CAST(NOW() AS date), '2099-01-10', 1 )
60
                }
61
            );
62
            say $out "`CatalogConcernHelp` block added to html_customization";
63
        }
64
65
        if ( ( $dbh->selectrow_array('SELECT COUNT(*) FROM additional_contents WHERE location=?', undef, 'CatalogConcernTemplate') )[0] == 0 ) { # Check to make idempotent
66
            my $cc_template = <<~ 'END_TEMPLATE';
67
            **Describe the concern**
68
            A clear and concise description of what the concern is.
69
70
            **To Reproduce**
71
            Steps to reproduce the behavior:
72
            1. Go to '...'
73
            2. Click on '....'
74
            3. Scroll down to '....'
75
            4. See error
76
77
            **Expected behavior**
78
            A clear and concise description of what you expected to happen.
79
            END_TEMPLATE
80
81
            $dbh->do(
82
                qq{
83
                    INSERT INTO additional_contents ( category, code, location, title, content, lang, published_on, expirationdate, number ) VALUES ('html_customizations', 'CatalogConcernTemplate_1', 'CatalogConcernTemplate', 'Catalog concern template text', "$cc_template", 'default', CAST(NOW() AS date), '2099-01-10', 1 )
84
                }
85
            );
86
            say $out "`CatalogConcernTemplate` block added to html_customization";
87
        }
55
    }
88
    }
56
}
89
}
(-)a/installer/data/mysql/en/optional/sample_news.yml (+33 lines)
Lines 55-57 tables: Link Here
55
          published_on: "2007-10-29 05:34:45"
55
          published_on: "2007-10-29 05:34:45"
56
          expirationdate: "2099-01-10"
56
          expirationdate: "2099-01-10"
57
          number: 2
57
          number: 2
58
59
        - title: "Catalog concern help text"
60
          category: "html_customizations"
61
          location: "CatalogConcernHelp"
62
          code: "CatalogConcernHelp_1"
63
          content:
64
              - "Please describe your concern clearly and the library will try to deal with it as quickly as possible"
65
          lang: "default"
66
          published_on: "2007-10-29 05:25:58"
67
          expirationdate: "2099-01-10"
68
          number: 1
69
70
        - title: "Catalog concern template text"
71
          category: "html_customizations"
72
          location: "CatalogConcernTemplate"
73
          code: "CatalogConcernTemplate_1"
74
          content:
75
            - "**Describe the concern**"
76
            - "A clear and concise description of what the concern is."
77
            - ""
78
            - "**To Reproduce**"
79
            - "Steps to reproduce the behavior:"
80
            - "1. Go to '...'"
81
            - "2. Click on '....'"
82
            - "3. Scroll down to '....'"
83
            - "4. See error"
84
            - ""
85
            - "**Expected behavior**"
86
            - "A clear and concise description of what you expected to happen."
87
          lang: "default"
88
          published_on: "2007-10-29 05:25:58"
89
          expirationdate: "2099-01-10"
90
          number: 1
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/additional-contents.tt (-1 / +1 lines)
Lines 493-499 Link Here
493
            [% END %]
493
            [% END %]
494
        [% END %]
494
        [% END %]
495
    [% ELSE %]
495
    [% ELSE %]
496
        [% SET available_options = [ 'OpacNavRight', 'opacheader', 'OpacCustomSearch', 'OpacMainUserBlock', 'opaccredits', 'OpacLoginInstructions', 'OpacNav', 'OpacNavBottom', 'OpacSuggestionInstructions', 'ArticleRequestsDisclaimerText', 'OpacMoreSearches', 'OpacMySummaryNote', 'OpacLibraryInfo' ] %]
496
        [% SET available_options = [ 'OpacNavRight', 'opacheader', 'OpacCustomSearch', 'OpacMainUserBlock', 'opaccredits', 'OpacLoginInstructions', 'OpacNav', 'OpacNavBottom', 'OpacSuggestionInstructions', 'ArticleRequestsDisclaimerText', 'OpacMoreSearches', 'OpacMySummaryNote', 'OpacLibraryInfo', 'CatalogConcernHelp', 'CatalogConcernTemplate' ] %]
497
        [% FOREACH l IN available_options.sort %]
497
        [% FOREACH l IN available_options.sort %]
498
            [% IF l == location %]
498
            [% IF l == location %]
499
                <option value="[% l | html %]" selected="selected">[% l | html %]</option>
499
                <option value="[% l | html %]" selected="selected">[% l | html %]</option>
(-)a/koha-tmpl/opac-tmpl/bootstrap/css/src/opac.scss (+7 lines)
Lines 148-153 textarea { Link Here
148
    width: 50%;
148
    width: 50%;
149
}
149
}
150
150
151
.help-block {
152
    display: block;
153
    margin-top: 5px;
154
    margin-bottom: 10px;
155
    color: #737373;
156
}
157
151
legend {
158
legend {
152
    color: #727272;
159
    color: #727272;
153
    font-size: 110%;
160
    font-size: 110%;
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/includes/modals/catalog_concern.inc (-1 / +17 lines)
Lines 1-3 Link Here
1
[% USE raw %]
2
[% USE AdditionalContents %]
3
[% SET CatalogConcernHelp = AdditionalContents.get( location => "CatalogConcernHelp", lang => lang, library => logged_in_user.branchcode || default_branch ) %]
4
[% SET CatalogConcernTemplate = AdditionalContents.get( location => "CatalogConcernTemplate", lang => lang, library => logged_in_user.branchcode || default_branch ) %]
1
<!-- Add concern modal -->
5
<!-- Add concern modal -->
2
<div class="modal" id="addConcernModal" tabindex="-1" role="dialog" aria-labelledby="addConcernModalLabel" aria-hidden="true">
6
<div class="modal" id="addConcernModal" tabindex="-1" role="dialog" aria-labelledby="addConcernModalLabel" aria-hidden="true">
3
    <div class="modal-dialog modal-lg">
7
    <div class="modal-dialog modal-lg">
Lines 16-22 Link Here
16
                    </div>
20
                    </div>
17
                    <div class="form-group">
21
                    <div class="form-group">
18
                        <label for="concern_body">Please describe your concerns: </label>
22
                        <label for="concern_body">Please describe your concerns: </label>
19
                        <textarea class="form-control" name="concern_body" id="concern_body" required="required" rows="15"></textarea>
23
                        <textarea class="form-control" name="concern_body" id="concern_body" aria-describedby="helpBlock" required="required" rows="15"></textarea>
24
                        [%- IF CatalogConcernHelp && CatalogConcernHelp.content && CatalogConcernHelp.content.count > 0 -%]
25
                        [%- FOREACH help IN CatalogConcernHelp.content -%]
26
                        <p id="helpBlock" class="help-block">[%- help.content | $raw -%]</p>
27
                        [%- END -%]
28
                        [%- END -%]
29
                        <div id="concern_template" style="display: none;">
30
                        [%- IF CatalogConcernTemplate && CatalogConcernTemplate.content && CatalogConcernTemplate.content.count > 0 -%]
31
                        [%- FOREACH template IN CatalogConcernTemplate.content -%]
32
                        [%- template.content | $raw -%]
33
                        [%- END -%]
34
                        [%- END -%]
35
                        </div>
20
                    </div>
36
                    </div>
21
                </fieldset>
37
                </fieldset>
22
            </div>
38
            </div>
(-)a/koha-tmpl/opac-tmpl/bootstrap/js/modals/catalog_concern.js (-1 / +8 lines)
Lines 13-23 $(document).ready(function() { Link Here
13
    }
13
    }
14
14
15
    $('#addConcernModal').on('show.bs.modal', function(e) {
15
    $('#addConcernModal').on('show.bs.modal', function(e) {
16
        // Redirect to login modal if not logged in
16
        if (logged_in_user_id === "") {
17
        if (logged_in_user_id === "") {
17
            $('#modalAuth').append('<input type="hidden" name="return" value="' + window.location.pathname + window.location.search + '&modal=concern" />');
18
            $('#modalAuth').append('<input type="hidden" name="return" value="' + window.location.pathname + window.location.search + '&modal=concern" />');
18
            $('#loginModal').modal('show');
19
            $('#loginModal').modal('show');
19
            return false;
20
            return false;
20
        }
21
        }
22
23
        $('#addConfirm').prop('disabled', false);
24
        let concern_body = $('#concern_body');
25
        if ( concern_body.val() === "" ) {
26
            let template = $('#concern_template').text();
27
            concern_body.val(template);
28
        }
21
    });
29
    });
22
30
23
    $('#addConcernModal').on('click', '#addConfirm', function(e) {
31
    $('#addConcernModal').on('click', '#addConfirm', function(e) {
24
- 

Return to bug 31028