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

(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/circ-menu.inc (+6 lines)
Lines 200-205 Link Here
200
                <h4 class="modal-title" id="patronImageEditLabel">Patron photo</h4>
200
                <h4 class="modal-title" id="patronImageEditLabel">Patron photo</h4>
201
            </div>
201
            </div>
202
            <div class="modal-body">
202
            <div class="modal-body">
203
                [% IF ( patron.cardnumber ) %]
203
                <div id="upload-patron-image" class="patroninfo-section">
204
                <div id="upload-patron-image" class="patroninfo-section">
204
                    <h5>Upload patron photo</h5>
205
                    <h5>Upload patron photo</h5>
205
                    <form method="post" id="picture-upload" action="/cgi-bin/koha/tools/picture-upload.pl"
206
                    <form method="post" id="picture-upload" action="/cgi-bin/koha/tools/picture-upload.pl"
Lines 277-282 Link Here
277
                        <span id="camera-error-message"></span>
278
                        <span id="camera-error-message"></span>
278
                    </div>
279
                    </div>
279
                </div>
280
                </div>
281
                [% ELSE %]
282
                    <div id="missing-cardnumber-picture-upload">
283
                        <p>The patron must have a cardnumber before a patron photo can be uploaded.</p>
284
                    </div>
285
                [% END %]
280
            </div>
286
            </div>
281
            <div class="modal-footer">
287
            <div class="modal-footer">
282
                <button type="button" class="btn btn-default" data-dismiss="modal">Cancel</button>
288
                <button type="button" class="btn btn-default" data-dismiss="modal">Cancel</button>
(-)a/koha-tmpl/intranet-tmpl/prog/js/members-menu.js (-1 / +1 lines)
Lines 87-93 $(document).ready(function(){ Link Here
87
        $("#patronImageEdit").on("hidden.bs.modal", function(){
87
        $("#patronImageEdit").on("hidden.bs.modal", function(){
88
            /* Stop using the user's camera when modal is closed */
88
            /* Stop using the user's camera when modal is closed */
89
            let viewfinder = document.getElementById("viewfinder");
89
            let viewfinder = document.getElementById("viewfinder");
90
            if( viewfinder.srcObject ){
90
            if( viewfinder && viewfinder.srcObject ){
91
                viewfinder.srcObject.getTracks().forEach( track => {
91
                viewfinder.srcObject.getTracks().forEach( track => {
92
                    if( track.readyState == 'live' && track.kind === 'video'){
92
                    if( track.readyState == 'live' && track.kind === 'video'){
93
                        track.stop();
93
                        track.stop();
(-)a/koha-tmpl/intranet-tmpl/prog/js/patron-webcam.js (-1 / +5 lines)
Lines 43-48 function startup() { Link Here
43
    camera = document.getElementById("camera");
43
    camera = document.getElementById("camera");
44
    uploadfiletext = document.getElementById("uploadfiletext");
44
    uploadfiletext = document.getElementById("uploadfiletext");
45
45
46
    if ( ! video ){
47
        //If there is no video element, don't try to start up camera
48
        return;
49
    }
50
46
    try {
51
    try {
47
        navigator.mediaDevices.getUserMedia({
52
        navigator.mediaDevices.getUserMedia({
48
            video: true,
53
            video: true,
49
- 

Return to bug 35344