This is an automated email from the ASF dual-hosted git repository.

jfthomps pushed a commit to branch VCL-978_delete_request_server_name
in repository https://gitbox.apache.org/repos/asf/vcl.git


The following commit(s) were added to 
refs/heads/VCL-978_delete_request_server_name by this push:
     new ea0666bd VCL-978 - Website displays image name instead of server 
request name when deleting requests
ea0666bd is described below

commit ea0666bd47267b31fb1e2bf8a86d2e789b069e43
Author: Josh Thompson <jftho...@ncsu.edu>
AuthorDate: Tue Dec 19 17:30:16 2023 -0500

    VCL-978 - Website displays image name instead of server request name when 
deleting requests
    
    requests.php: modified AJconfirmDeleteRequest: added code to use name of 
image in prompts with name of reservation if $request['servername'] is set in 
$request
---
 web/.ht-inc/requests.php | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/web/.ht-inc/requests.php b/web/.ht-inc/requests.php
index c836668a..dc2231a2 100644
--- a/web/.ht-inc/requests.php
+++ b/web/.ht-inc/requests.php
@@ -4012,9 +4012,12 @@ function AJconfirmDeleteRequest() {
                sendJSON($data);
                return;
        }
+       $deletename = $reservation['prettyimage'];
+       if(isset($request['servername']) && $request['servername'] != '')
+               $deletename = $request['servername'];
        if(datetimeToUnix($request["start"]) > time()) {
                $text = sprintf(i("Delete reservation for %s starting %s?"),
-                               "<b>{$reservation["prettyimage"]}</b>",
+                               "<b>{$deletename}</b>",
                                prettyDatetime($request["start"]));
        }
        else {
@@ -4035,13 +4038,13 @@ function AJconfirmDeleteRequest() {
                                $showstart = prettyDatetime($dtstart);
                        if($notbyowner == 0) {
                                $text = sprintf(i("Are you finished with your 
reservation for %s that started %s?"),
-                                               
"<b>{$reservation["prettyimage"]}</b>", $showstart);
+                                               "<b>{$deletename}</b>", 
$showstart);
                        }
                        else {
                                $userinfo = getUserInfo($request["userid"], 1, 
1);
                                $text = sprintf(i("Delete reservation by %s for 
%s that started %s?"),
                                                
"{$userinfo['unityid']}@{$userinfo['affiliation']}",
-                                               
"<b>{$reservation["prettyimage"]}</b>",
+                                               "<b>{$deletename}</b>",
                                                $showstart);
                        }
                }

Reply via email to