From: Chuck Scott Date: Fri, 2 Feb 2018 20:38:40 +0000 (-0500) Subject: Timezone settings now affect AJAX calls, File Library basic features now complete. X-Git-Tag: v2.10.23^2~9 X-Git-Url: http://cvs2.gaslightmedia.com/gitweb/?a=commitdiff_plain;h=d8609dc5ee66d37c56e2ec17733ca960ddd70f1f;p=WP-Plugins%2Fglm-member-db.git Timezone settings now affect AJAX calls, File Library basic features now complete. --- diff --git a/controllers/admin.php b/controllers/admin.php index 54792e83..4a8a71ea 100644 --- a/controllers/admin.php +++ b/controllers/admin.php @@ -254,6 +254,9 @@ class glmMembersAdmin extends GlmPluginSupport public function glmMembersAdminAjax() { + $defaultTimeZone = date_default_timezone_get(); + date_default_timezone_set($this->config['settings']['time_zone']); + if (GLM_MEMBERS_PLUGIN_ADMIN_DEBUG_VERBOSE) { trigger_error(glmAssociateMemoryUsage(),E_USER_NOTICE); } @@ -384,6 +387,9 @@ class glmMembersAdmin extends GlmPluginSupport trigger_error(glmAssociateMemoryUsage(),E_USER_NOTICE); } + // Restore timezone that was set before our code was called + date_default_timezone_set($defaultTimeZone); + exit; // Need to test if this is here for a reason! wp_die(); diff --git a/js/fileLibraryUpload/fileLibraryUpload.js b/js/fileLibraryUpload/fileLibraryUpload.js index 1436e1bd..0b606f90 100644 --- a/js/fileLibraryUpload/fileLibraryUpload.js +++ b/js/fileLibraryUpload/fileLibraryUpload.js @@ -319,6 +319,7 @@ jQuery(document).ready(function($) { fData = fData.replace(/\{ filename \}/g, fileData.files[i].name); fData = fData.replace(/\{ fileurl \}/g, fileData.files[i].newFileUrl); fData = fData.replace(/\{ newfilename \}/g, fileData.files[i].newFileName); + fData = fData.replace(/\{ lastaccesstime \}/g, fileData.files[i].lastAccessTime); $('#AfterNewFiles').before(fData); // $('#fileContainer_' + fileData.files[i].id).removeClass('glm-fileLibraryItemHidden'); diff --git a/models/admin/ajax/fileLibraryUpload.php b/models/admin/ajax/fileLibraryUpload.php index 52729773..edbe959c 100644 --- a/models/admin/ajax/fileLibraryUpload.php +++ b/models/admin/ajax/fileLibraryUpload.php @@ -185,9 +185,8 @@ class GlmMembersAdmin_ajax_fileLibraryUpload extends GlmDataFileLibrary $file['newFileName'] = $newFilename; $file['newFileUrl'] = GLM_MEMBERS_WORDPRESS_FILE_LIBRARY_URL.$newFilename; - - - $lastAccessTime = date('Y-m-d H:i:s'); + $file['lastAccessTimeMysql'] = date('Y-m-d H:i:s'); + $file['lastAccessTime'] = date('m/d/Y h:i A'); // Store image name in images table $sql = " @@ -205,7 +204,7 @@ class GlmMembersAdmin_ajax_fileLibraryUpload extends GlmDataFileLibrary '".$file['newFileName']."', '', '', - '$lastAccessTime' + '".$file['lastAccessTimeMysql']."' ); "; $this->wpdb->query($sql); diff --git a/views/admin/fileLibrary/index.html b/views/admin/fileLibrary/index.html index 7268dfa0..4dd72115 100644 --- a/views/admin/fileLibrary/index.html +++ b/views/admin/fileLibrary/index.html @@ -70,7 +70,7 @@   -   + { lastaccesstime } @@ -95,11 +95,11 @@
-
+

- Description: +
@@ -123,7 +123,11 @@ -

NOTE: The "Copy" button will copy the entire URL for the uploaded file to the user's "Clipboard".

+

NOTE: + Hover over a line to show actions. + For reference, any files you edit, download, or copy the link will have a difffernt background color till the page is refreshed and + the last file you edit, download, or copy will be hilighted. +

{if $paging} @@ -140,11 +144,11 @@ -     New Uploads +     New Uploads   -     Previous Uploads +     Previous Uploads {if $haveFiles} {assign var="i" value="0"} @@ -186,11 +190,11 @@
-
+

- Description: +