From 6a64de8b26960f8e34b6670ccde85db9277f7aa0 Mon Sep 17 00:00:00 2001 From: Kevin Cottrell Date: Thu, 16 Jun 2022 15:18:42 -0400 Subject: [PATCH] update php and add aeon javascript --- Dockerfile | 2 +- assets/aeon/aeonRequestsDialog.css | 14 ++++++++++++ assets/aeon/aeonRequestsDialog.min.js | 33 +++++++++++++++++++++++++++ 3 files changed, 48 insertions(+), 1 deletion(-) create mode 100644 assets/aeon/aeonRequestsDialog.css create mode 100644 assets/aeon/aeonRequestsDialog.min.js diff --git a/Dockerfile b/Dockerfile index aba3d16889..445d5ff1ac 100644 --- a/Dockerfile +++ b/Dockerfile @@ -13,7 +13,7 @@ ENV PATH /app/apache2/bin:$PATH RUN sed -i "s/\/snap\/bin/\/snap\/bin:\/app\/apache2\/bin/" /etc/sudoers #PHP -ARG PHP_VERSION=7.4.29 +ARG PHP_VERSION=7.4.30 RUN apt-get -qq install libcurl4-gnutls-dev pkg-config libpng-dev libonig-dev libsqlite3-dev libxml2-dev libzip-dev libmemcached-dev memcached && wget https://www.php.net/distributions/php-$PHP_VERSION.tar.gz && tar xzf php-$PHP_VERSION.tar.gz && cd php-$PHP_VERSION && './configure' '--prefix=/usr/local' '--with-apxs2=/app/apache2/bin/apxs' '--with-mysqli' '--enable-mbstring' '--with-pdo-mysql' '--with-openssl' '--with-zlib' '--enable-gd' '--enable-opcache' '--with-curl' '--enable-exif' '--with-zip' && make -j$(nproc) && make install && cp php.ini-production /usr/local/lib/php.ini && cd .. && rm -rf php-$PHP_VERSION* RUN apt-get -qq install autoconf && wget https://pecl.php.net/get/memcached-3.1.5.tgz && tar xzf memcached-3.1.5.tgz && cd memcached-3.1.5 && phpize && ./configure && make && make install && echo "extension=memcached.so" >> /usr/local/lib/php.ini && cd .. && rm -rf memcached-3.1.5* diff --git a/assets/aeon/aeonRequestsDialog.css b/assets/aeon/aeonRequestsDialog.css new file mode 100644 index 0000000000..6a043d5322 --- /dev/null +++ b/assets/aeon/aeonRequestsDialog.css @@ -0,0 +1,14 @@ +.ui-dialog .ui-dialog-titlebar{text-align:left} +.aeon_request {font-size: .8em; text-align: left} +.aeon_request .label { font-weight: bold; } +.aeon_request .requestDesc { margin-left: 2em; } +.aeon_request_header, .aeon_request .select_all_buttons,.aeon_request .requestItem, .aeon_request .notes, .aeon_request .scheduled_date, .aeon_request .review, .aeon_request .buttons, .aeon_request .simple_copy_opt, .aeon_request .advanced_copy_opt, .aeon_request .aeon_request_items{ margin-bottom: 1em; } +.aeon_request .request_inputs { float:left; } +.aeon_request .rev_sched_opt { float:left; clear:left; margin-right: 1em; height: 3em; } +.aeon_request .buttons { clear:both; } +.aeon_request .disabled { color: #aaa; } +.aeon_request .advanced_copy_opt .label { display: inline-block; width: 14em;} +.aeon_request .adv_copy_select { width: 20em;} +.aeon_request .message { font-weight: bold; margin-bottom: .2em; } +.aeon_request .select_all, .aeon_request .dialog_submit { margin-right: .5em; } +.aeon_request .aeon_request_items { max-height: 500px; overflow-y: auto; } diff --git a/assets/aeon/aeonRequestsDialog.min.js b/assets/aeon/aeonRequestsDialog.min.js new file mode 100644 index 0000000000..e5fa2f044c --- /dev/null +++ b/assets/aeon/aeonRequestsDialog.min.js @@ -0,0 +1,33 @@ +(function($){var methods={init:function(options){var $this=this,data=this.data("aeonRequestsDialog"),settings;if(!data){settings=$.extend({"url":"","dialogId":"aeon_request_dialog","submitButtonSelector":".aeon_submit","AeonForm":"EADRequest","RequestType":"Loan","globalFields":[],"itemFields":[],"items":[],"datasource":"form","form":"EADRequest","requestsSelector":'input[name="Request"]',"jsonUrl":null,"jsonCallback":null,"jsonContent":null,"jsonSubmit":function(){return true},"jsonComplete":function(data){return true}, +"customCallback":null,"useDefaultBindings":true,"createDialog":function(){return this},"destroyDialog":function(){return this},"onSubmit":function(){return true},"minWidth":750,"title":"Confirm your request","header":"","footer":"","submitButtonsMessage":"","submitButtonLabel":"Submit Request","cancelButtonLabel":"Cancel Request","submitButtonsTag":"input","selectAllButtonsPosition":"","selectAllButtonsShowAt":0,"selectAllButtonsTag":"button","selectAllButtonLabel":"Select All","selectNoneButtonLabel":"Select None", +"includeSimpleCopyOption":false,"simpleCopyLabel":"Requesting Duplication of Material","simpleCopyMessage":"","includeAdvancedCopyOptions":false,"advancedCopyMessage":"","formatLabel":"Format","formatOptions":["Photocopy","Scan (DVD/CD)","Scan (Electronic Delivery)"],"serviceLevelLabel":"Intended Use","serviceLevelOptions":["Advertisement (Commercial)","Advertisement (PSA)","Educational Use","Government","Live Presentation","Museum Use","Non Profit","Personal Use","Preservation Use"],"shippingOptionLabel":"Shipping Option", +"shippingOptions":["Download/FTP (User Provided)","Download/FTP (Institution Provided)","Pick up Onsite","Fed Ex (User Account)","UPS (User Account)","USPS (First Class)","USPS (Overseas)"],"forPublicationLabel":"For Publication","includeNotes":true,"notesMessage":"Please include any notes that might help us identify the specific items requested or any other pertinent information:","includeScheduledDate":true,"scheduledDateMessage":"","scheduledDateLabel":"Scheduled Date","userReviewLabel":"Keep this request saved in your account for later review. It will not be sent to Libraries staff for fulfilment.", +"compressRequests":false,"compressRequestsField":"ItemNumber","stripUnchecked":true,"cleanValues":function(s){return s.replace(/^\s*/,"").replace(/\s*$/,"")},"cleanNotes":true,"itemsAttachpointSelector":".aeon_request_items","itemsTemplate":"
"+"<% for ( var x=0; x < this.items.length; x++ ) { %>"+'
'+'
'+''+"<% for ( var y=0; y < this.items[x].fields.length; y++ ){ %>"+ +''+"<% } %>"+"
"+"<% for ( var y=0; y < this.items[x].fields.length; y++ ){ %>"+"<% if ( this.items[x].fields[y].label ) { %>"+'
<%= this.items[x].fields[y].label %>: <%= this.items[x].fields[y].value %>
'+"<% } %>"+"<% } %>"+"
"+"<% } %>"+"
","template":'
'+ +''+''+''+"<% for (var x=0; x < this.globalFields.length; x++ ) { %>"+''+"<% } %>"+"<% if ( this.header ) { %>"+'
<%= this.header %>
'+"<% } %>"+'<% if ( this.selectAllButtonsPosition === "top" || this.selectAllButtonsPosition === "both" ) { %>'+ +"<% if ( !this.selectAllButtonsShowAt || ( this.items.length >= this.selectAllButtonsShowAt ) ) { %>"+'
'+'<<%= this.selectAllButtonsTag %> class="select_all" <%= this.selectAllButtonsTag === \'a\' ? \'href="#"\' : "" %>><%= this.selectAllButtonLabel %>>'+'<<%= this.selectAllButtonsTag %> class="select_none" <%= this.selectAllButtonsTag === \'a\' ? \'href="#"\' : "" %>><%= this.selectNoneButtonLabel %>>'+ +"
"+"<% } %>"+"<% } %>"+'
'+'<% if ( this.selectAllButtonsPosition === "bottom" || this.selectAllButtonsPosition === "both" ) { %>'+"<% if ( !this.selectAllButtonsShowAt || ( this.items.length >= this.selectAllButtonsShowAt ) ) { %>"+'
'+'<<%= this.selectAllButtonsTag %> class="select_all" <%= this.selectAllButtonsTag === \'a\' ? \'href="#"\' : "" %>><%= this.selectAllButtonLabel %>>'+'<<%= this.selectAllButtonsTag %> class="select_none" <%= this.selectAllButtonsTag === \'a\' ? \'href="#"\' : "" %>><%= this.selectNoneButtonLabel %>>'+ +"
"+"<% } %>"+"<% } %>"+"<% if ( this.includeSimpleCopyOption ) { %>"+'
'+"<% if ( this.simpleCopyMessage ) { %>"+'
<%= this.simpleCopyMessage %>
'+"<% } %>"+'
'+''+"
"+'
'+"
"+"<% } %>"+"<% if ( this.includeAdvancedCopyOptions ) { %>"+ +'
'+"<% if ( this.advancedCopyMessage ) { %>"+'
<%= this.advancedCopyMessage %>
'+"<% } %>"+'
'+''+'"+"
"+'
'+''+'"+"
"+'
'+''+'"+"
"+ +'
'+''+''+"
"+"
"+"<% } %>"+"<% if ( this.includeNotes ) { %>"+'
'+"<% if ( this.notesMessage ) { %>"+'
'+"<% } %>"+''+"
"+"<% } %>"+"<% if (this.includeScheduledDate) { %>"+ +'
'+"<% if ( this.scheduledDateMessage ) { %>"+'
<%= this.scheduledDateMessage %>
'+"<% } %>"+'
'+''+"
"+'
'+'
'+''+ +"
"+'
'+''+"
"+'
'+''+"
"+"
"+"<% } %>"+'
'+"<% if ( this.submitButtonsMessage ) { %>"+'
<%= this.submitButtonsMessage %>
'+"<% } %>"+'<% if ( this.submitButtonsTag === "input" ) { %>'+''+ +''+"<% } else { %>"+'<<%= this.submitButtonsTag %> class="dialog_submit" <%= this.submitButtonsTag === \'a\' ? \'href="#"\' : "" %>><%= this.submitButtonLabel %>>'+'<<%= this.submitButtonsTag %> class="dialog_cancel" <%= this.submitButtonsTag === \'a\' ? \'href="#"\' : "" %>><%= this.cancelButtonLabel %>>'+"<% } %>"+"
"+"<% if ( this.footer ) { %>"+''+ +"<% } %>"+"
"},options);if(settings.includeAdvancedCopyOptions)settings.RequestType="Copy";$(settings.submitButtonSelector).on("click.aeonRequestsDialogMain",function(e){e.preventDefault();e.stopPropagation();methods.show.apply($this,null)});$(this).data("aeonRequestsDialog",{settings:settings});$("body").jqoteapp('
',settings)}else console.log("aeonRequestsDialog already initialized"); +return this},show:function(){var settings=this.data("aeonRequestsDialog").settings,$this=this;if(settings.datasource==="form"){methods._processForm.apply(this,null);methods._showDialog.apply(this,null)}if(settings.datasource==="json"){if(!settings.jsonSubmit())return;$.getJSON(settings.jsonUrl,settings.jsonContent,function(data){if(!settings.jsonComplete(data))return;var o=settings.jsonCallback(data);if(o){methods.options.apply($this,[o]);methods._showDialog.apply($this,null)}})}if(settings.datasource=== +"custom"){var o=settings.customCallback();if(o){methods.options.apply($this,[o]);methods._showDialog.apply($this,null)}}},_showDialog:function(){var settings=this.data("aeonRequestsDialog").settings,$this=this,$dialog=$("#"+settings.dialogId),opts={modal:true,autoOpen:false,close:function(){if(settings.useDefaultBindings)methods._defaultDestroyDialog.apply($this,null);settings.destroyDialog();$(window).off(".aeonRequestsDialog"+"#"+settings.dialogId);$dialog.dialog("destroy");$dialog.html("")}},f= +["height","width"],f2=["min","max"];$dialog.jqotesub(settings.template,settings);$("#"+settings.dialogId+" "+settings.itemsAttachpointSelector).jqotesub(settings.itemsTemplate,settings);for(var x=0;x<2;x++){if(settings[f[x]]){opts[f[x]]=settings[f[x]];continue}for(var y=0;y<2;y++){var s=f2[y]+f[x].charAt(0).toUpperCase()+f[x].slice(1);if(settings[s])opts[s]=settings[s]}}$dialog.dialog(opts);if(settings.useDefaultBindings)methods._defaultCreateDialog.apply(this,null);settings.createDialog();$dialog.dialog("open"); +return this},_defaultCreateDialog:function(){var $this=this;var settings=this.data("aeonRequestsDialog").settings;var idSelector="#"+settings.dialogId;$(idSelector+" .datepicker").datepicker({minDate:0}).val($.datepicker.formatDate("mm/dd/yy",new Date));$(idSelector+" .select_all").on("click.aeonRequestsDialog"+idSelector,function(e){e.preventDefault();e.stopPropagation();$(idSelector+" "+settings.requestsSelector).prop("checked",true)});$(idSelector+" .select_none").on("click.aeonRequestsDialog"+ +idSelector,function(e){e.preventDefault();e.stopPropagation();$(idSelector+" "+settings.requestsSelector).prop("checked",false)});if(settings.includeSimpleCopyOption)$(idSelector+" .copy_check").on("change.aeonRequestsDialog"+idSelector,function(){if(this.checked)$(idSelector+' input[name="RequestType"]').val("Copy");else $(idSelector+' input[name="RequestType"]').val("Loan")});if(settings.includeScheduledDate)$(idSelector+" .schedule_opt").on("change.aeonRequestsDialog"+idSelector,function(){if(this.checked&& +this.value==="Yes"){$(idSelector+" .datepicker").prop("disabled","disabled");$(idSelector+" .scheduled_date").addClass("disabled");$(idSelector+" .review").removeClass("disabled")}else{$(idSelector+" .datepicker").prop("disabled","");$(idSelector+" .scheduled_date").removeClass("disabled");$(idSelector+" .review").addClass("disabled")}});$(idSelector+" .dialog_submit").on("click.aeonRequestsDialog"+idSelector,function(e){e.preventDefault();e.stopPropagation();if($(idSelector+" "+settings.requestsSelector+ +":checked").length==0)return;if(!settings.onSubmit())return;$("div.ui-widget-overlay").remove();$("div.ui-dialog").css("display","none");if(settings.stripUnchecked)methods._stripUnchecked.apply($this,null);if(settings.compressRequests)methods._compressRequests.apply($this,null);if(settings.includeNotes&&settings.cleanNotes)methods._cleanNotes.apply($this,null);$(idSelector+" .aeon_request_form").submit()});$(idSelector+" .dialog_cancel").on("click.aeonRequestsDialog"+idSelector,function(){$(idSelector).dialog("close")})}, +_defaultDestroyDialog:function(){var settings=this.data("aeonRequestsDialog").settings;$("#"+settings.dialogId+" .datepicker").datepicker("destroy");$(window).off(".aeonRequestsDialog#"+settings.dialogId)},"_processForm":function(){var settings=this.data("aeonRequestsDialog").settings;settings.items=[];$(settings.requestsSelector+":checked").each(function(){var id=$(this).val();var i={"fields":[]};for(var x=0;x").prop("type", +"hidden").prop("name","Request").val(newReqNum).appendTo(idSelector+" .aeon_request_form");for(var field in newRequest)$("").prop("type","hidden").prop("name",field+"_"+newReqNum).val(newRequest[field]).appendTo(idSelector+" .aeon_request_form");newReqNum++}},_stripUnchecked:function(){var settings=this.data("aeonRequestsDialog").settings;var idSelector="#"+settings.dialogId;var uncheckedSelector=idSelector+" "+settings.requestsSelector+":not(:checked)";$(uncheckedSelector).each(function(){$(idSelector+ +' input[name$="_'+$(this).val()+'"]').remove()})},_cleanNotes:function(){var settings=this.data("aeonRequestsDialog").settings;var notes=$("#"+settings.dialogId+' textarea[name="Notes"]');var s=notes.val();s=s.replace(/\n/g," ");notes.val(s)},options:function(){var settings=this.data("aeonRequestsDialog").settings;if(arguments.length===0)return settings;else if(arguments.length===1)if(typeof arguments[0]==="object")settings=$.extend(settings,arguments[0]);else if(typeof arguments[0]==="string"){if(undefined=== +settings[arguments[0]]){console.log("Unknown key sent to arguments.");return null}return settings[arguments[0]]}else{console.log("Argument to options must be of type Object or String");return null}else if(arguments.length===2)settings[arguments[0]]=arguments[1];else{console.log("Illegal number of arguments sent to options.");return null}this.data("aeonRequestsDialog",{settings:settings});return settings},destroy:function(){var data=this.data("aeonRequestsDialog");$(window).off(".aeonRequestsDialogMain"); +$this.removeData("aeonRequestsDialog");return this}};$.fn.aeonRequestsDialog=function(method){if(methods[method])return methods[method].apply(this,Array.prototype.slice.call(arguments,1));else if(typeof method==="object"||!method)return methods.init.apply(this,arguments);else{$.error("Method "+method+" does not exist on jQuery.aeonRequestDialog");return null}}})(jQuery); \ No newline at end of file