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

(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/suggestion/suggestion.tt (-14 / +30 lines)
Lines 399-405 Link Here
399
            <li>
399
            <li>
400
                <label for="managedby_name">by:</label>
400
                <label for="managedby_name">by:</label>
401
                <div>
401
                <div>
402
                    <span id="managedby_name">
402
                    <span id="managedby_name" name="managedby_name">
403
                        <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% logged_in_user.borrowernumber | uri %]">You</a>
403
                        <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% logged_in_user.borrowernumber | uri %]">You</a>
404
                    </span>
404
                    </span>
405
                    [% IF managedby_patron.borrowernumber && logged_in_user.borrowernumber != managedby_patron.borrowernumber %]
405
                    [% IF managedby_patron.borrowernumber && logged_in_user.borrowernumber != managedby_patron.borrowernumber %]
Lines 694-702 Link Here
694
            <div class="col-sm-2">
694
            <div class="col-sm-2">
695
                <fieldset>
695
                <fieldset>
696
                    <label for="set_manager_[% loop.count %]">Update manager</label><br/>
696
                    <label for="set_manager_[% loop.count %]">Update manager</label><br/>
697
                    <a id="edit_manager" class="new_window" href="#"><i class="fa fa-search"></i> Select manager</a>
697
                    <a id="set_manager_[% loop.count %]" data-tab="[% loop.count %]" class="set_manager" href="#"><i class="fa fa-search"></i> Select manager</a>
698
                    <span id="managedby_name"></span>
698
                    <span id="managedby_name[% loop.count %]"></span>
699
                    <input type="hidden" name="suggestion_managedby" id="managedby" value="[% logged_in_user.borrowernumber | html %]" />
699
                    <input type="hidden" name="suggestion_managedby" id="managedby[% loop.count %]" value="[% logged_in_user.borrowernumber | html %]" />
700
                    <input type="hidden" name="branchcode" value="[% branchfilter | html %]" />
700
                    <input type="hidden" name="branchcode" value="[% branchfilter | html %]" />
701
                    <fieldset class="action"><button type="submit" class="btn btn-default btn-xs" value="update_manager"/>Submit</button></fieldset>
701
                    <fieldset class="action"><button type="submit" class="btn btn-default btn-xs" value="update_manager"/>Submit</button></fieldset>
702
                </fieldset>
702
                </fieldset>
Lines 771-778 Link Here
771
                </fieldset>
771
                </fieldset>
772
				 <fieldset class="brief"><h4 class="local_collapse"><a href="#">Suggestion information</a></h4>
772
				 <fieldset class="brief"><h4 class="local_collapse"><a href="#">Suggestion information</a></h4>
773
                    <ol>
773
                    <ol>
774
                        <li>
775
                            <label for="archived" style="display: inline;">Include archived:</label>
776
                            <input type="checkbox" id="archived" name="filter_archived" value="archived" title="Include archived suggestions in the search" />
777
                      </li>
774
                      <li>
778
                      <li>
775
                          <label for="STATUS"> Status:</label>
779
                          <label for="STATUS"> Status:</label>
780
776
                          <select name="STATUS" id="STATUS">
781
                          <select name="STATUS" id="STATUS">
777
                              <option value="">Any</option>
782
                              <option value="">Any</option>
778
783
Lines 885-891 Link Here
885
    [% INCLUDE 'calendar.inc' %]
890
    [% INCLUDE 'calendar.inc' %]
886
891
887
    <script type="text/javascript">
892
    <script type="text/javascript">
888
        function editManagerPopup() {
893
        var tab = '';
894
        function editManagerPopup(selected_tab) {
895
            tab = selected_tab;
889
            window.open("/cgi-bin/koha/suggestion/add_user_search.pl?selection_type=select",
896
            window.open("/cgi-bin/koha/suggestion/add_user_search.pl?selection_type=select",
890
                'PatronPopup',
897
                'PatronPopup',
891
                'width=740,height=450,location=yes,toolbar=no,'
898
                'width=740,height=450,location=yes,toolbar=no,'
Lines 893-907 Link Here
893
            );
900
            );
894
        }
901
        }
895
        function select_user(borrowernumber, borrower) {
902
        function select_user(borrowernumber, borrower) {
896
            $("#managedby_name").empty();
903
            var managedby_name = $("#managedby_name"+tab);
897
            $("#managedby").val('');
904
            var managedby = $("#managedby"+tab);
905
            managedby_name.empty();
906
            managedby.val('');
898
            var borrowername = borrower.firstname + ' ' + borrower.surname;
907
            var borrowername = borrower.firstname + ' ' + borrower.surname;
899
            if (borrowernumber) {
908
            if (borrowernumber) {
900
                var managerlink = '<a href="/cgi-bin/koha/members/moremember.pl'
909
                var managerlink = '<a href="/cgi-bin/koha/members/moremember.pl'
901
                    + '?borrowernumber=' + borrowernumber + '">'
910
                    + '?borrowernumber=' + borrowernumber + '">'
902
                    + borrowername + '</a>';
911
                    + borrowername + '</a>';
903
                $('#managedby_name').html(managerlink);
912
                managedby_name.html(managerlink);
904
                $('#managedby').val(borrowernumber);
913
                managedby.val(borrowernumber);
905
            }
914
            }
906
915
907
            [% IF op == "save" %]
916
            [% IF op == "save" %]
Lines 919-926 Link Here
919
        $(document).ready(function(){
928
        $(document).ready(function(){
920
            $("#edit_manager").on("click",function(e){
929
            $("#edit_manager").on("click",function(e){
921
                e.preventDefault();
930
                e.preventDefault();
922
                editManagerPopup();
931
                editManagerPopup('');
923
            });
932
            });
933
            $(".set_manager").on("click",function(e){
934
                e.preventDefault();
935
                var selected_tab = $(this).data('tab');
936
                editManagerPopup(selected_tab);
937
            });
938
924
        });
939
        });
925
    </script>
940
    </script>
926
941
Lines 1025-1032 Link Here
1025
                });
1040
                });
1026
1041
1027
                $("button[type='submit']").on("click", function(e) {
1042
                $("button[type='submit']").on("click", function(e) {
1028
                    var form = $(this).parents("form");
1043
                    var submit_button = this;
1029
                    var action = $(this).val();
1044
                    var form = $(submit_button).parents("form");
1045
                    var action = $(submit_button).val();
1030
                    var selected_suggestions = $(form).find("input[name='suggestionid']:checked");
1046
                    var selected_suggestions = $(form).find("input[name='suggestionid']:checked");
1031
                    if ( selected_suggestions.length == 0 ) {
1047
                    if ( selected_suggestions.length == 0 ) {
1032
                        alert(_("Please select at least one suggestion"));
1048
                        alert(_("Please select at least one suggestion"));
Lines 1046-1052 Link Here
1046
                            }
1062
                            }
1047
                        }
1063
                        }
1048
                    } else if ( action == "update_manager" ) {
1064
                    } else if ( action == "update_manager" ) {
1049
                        if ( $("#managedby").val() == "" ) {
1065
                        var managedby = $(submit_button).siblings("suggestion_managedby");
1066
                        if ( managedby.val() == "" ) {
1050
                            alert(_("Please select a manager to assign to the selected suggestions"));
1067
                            alert(_("Please select a manager to assign to the selected suggestions"));
1051
                            e.preventDefault();
1068
                            e.preventDefault();
1052
                            return false;
1069
                            return false;
1053
- 

Return to bug 23590