From ec151b00897d4cfece82558086e003f4eb666cb4 Mon Sep 17 00:00:00 2001 From: Kevin Mueller Date: Sat, 21 Jun 2025 22:30:30 -0600 Subject: [PATCH 1/4] fixing xajaxResponse::addAssign to xajaxResponse::assign --- rack_maint.inc.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/rack_maint.inc.php b/rack_maint.inc.php index 81faed0..b5a5d54 100644 --- a/rack_maint.inc.php +++ b/rack_maint.inc.php @@ -255,8 +255,8 @@ class="act" // Insert the new table into the window // Instantiate the xajaxResponse object $response = new xajaxResponse(); - $response->addAssign("{$form['form_id']}_racks_count", "innerHTML", "({$count})"); - $response->addAssign("{$form['content_id']}", "innerHTML", $html); + $response->assign("{$form['form_id']}_racks_count", "innerHTML", "({$count})"); + $response->assign("{$form['content_id']}", "innerHTML", $html); // $response->addScript($js); return($response->getXML()); } @@ -1931,7 +1931,7 @@ function ws_display_info($window_name, $form='') { // Insert the new html into the window // Instantiate the xajaxResponse object $response = new xajaxResponse(); - $response->addAssign("rack_unit_info", "innerHTML", $html); + $response->assign("rack_unit_info", "innerHTML", $html); if ($js) { $response->addScript($js); } return($response->getXML()); @@ -2041,7 +2041,7 @@ function ws_display($window_name, $form='') { array_pop($_SESSION['ona']['work_space']['history']); $html .= "
Rack doesn't exist!
"; $response = new xajaxResponse(); - $response->addAssign("work_space_content", "innerHTML", $html); + $response->assign("work_space_content", "innerHTML", $html); return($response->getXML()); } @@ -2461,7 +2461,7 @@ class="act" // Insert the new html into the window // Instantiate the xajaxResponse object $response = new xajaxResponse(); - $response->addAssign("work_space_content", "innerHTML", $html); + $response->assign("work_space_content", "innerHTML", $html); if ($js) { $response->addScript($js); } return($response->getXML()); } From eeee81a8151eecbcf1593ceab4ec1b708f8077c0 Mon Sep 17 00:00:00 2001 From: Kevin Mueller Date: Sat, 21 Jun 2025 22:53:10 -0600 Subject: [PATCH 2/4] fixing xajaxResponse::getXML to getOutput --- rack_maint.inc.php | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/rack_maint.inc.php b/rack_maint.inc.php index b5a5d54..97ae2b5 100644 --- a/rack_maint.inc.php +++ b/rack_maint.inc.php @@ -128,7 +128,7 @@ function ws_display_list($window_name, $form) { if (! (auth('rack_add') or auth('advanced'))){ $response = new xajaxResponse(); $response->addScript("alert('Permission denied!');"); - return($response->getXML()); + return($response->getOutput()); } // If the group supplied an array in a string, build the array and store it in $form @@ -258,7 +258,7 @@ class="act" $response->assign("{$form['form_id']}_racks_count", "innerHTML", "({$count})"); $response->assign("{$form['content_id']}", "innerHTML", $html); // $response->addScript($js); - return($response->getXML()); + return($response->getOutput()); } @@ -1286,7 +1286,7 @@ function ws_rack_editor($window_name, $form='') { if (! (auth('rack_add') or auth('advanced'))){ $response = new xajaxResponse(); $response->addScript("alert('Permission denied!');"); - return($response->getXML()); + return($response->getOutput()); } // If the user supplied an array in a string, build the array and store it in $form @@ -1469,7 +1469,7 @@ function ws_ru_editor($window_name, $form='') { if (! (auth('rack_add') or auth('advanced'))){ $response = new xajaxResponse(); $response->addScript("alert('Permission denied!');"); - return($response->getXML()); + return($response->getOutput()); } // If the user supplied an array in a string, build the array and store it in $form @@ -1697,7 +1697,7 @@ function ws_rack_save($window_name, $form='') { if (! (auth('rack_add') or auth('advanced'))){ $response = new xajaxResponse(); $response->addScript("alert('Permission denied!');"); - return($response->getXML()); + return($response->getOutput()); } // Instantiate the xajaxResponse object @@ -1734,7 +1734,7 @@ function ws_rack_save($window_name, $form='') { // Insert the new table into the window $response->addScript($js); - return($response->getXML()); + return($response->getOutput()); } @@ -1759,7 +1759,7 @@ function ws_save($window_name, $form='') { if (! (auth('rack_add') or auth('advanced'))){ $response = new xajaxResponse(); $response->addScript("alert('Permission denied!');"); - return($response->getXML()); + return($response->getOutput()); } // Instantiate the xajaxResponse object @@ -1797,7 +1797,7 @@ function ws_save($window_name, $form='') { // Insert the new table into the window $response->addScript($js); - return($response->getXML()); + return($response->getOutput()); } @@ -1820,7 +1820,7 @@ function ws_rack_delete($window_name, $form='') { if (! (auth('rack_del') or auth('advanced'))){ $response = new xajaxResponse(); $response->addScript("alert('Permission denied!');"); - return($response->getXML()); + return($response->getOutput()); } // If an array in a string was provided, build the array and store it in $form @@ -1844,7 +1844,7 @@ function ws_rack_delete($window_name, $form='') { // Return an XML response $response->addScript($js); - return($response->getXML()); + return($response->getOutput()); } @@ -1869,7 +1869,7 @@ function ws_delete($window_name, $form='') { if (! (auth('rack_del') or auth('advanced'))){ $response = new xajaxResponse(); $response->addScript("alert('Permission denied!');"); - return($response->getXML()); + return($response->getOutput()); } // If an array in a string was provided, build the array and store it in $form @@ -1893,7 +1893,7 @@ function ws_delete($window_name, $form='') { // Return an XML response $response->addScript($js); - return($response->getXML()); + return($response->getOutput()); } @@ -1933,7 +1933,7 @@ function ws_display_info($window_name, $form='') { $response = new xajaxResponse(); $response->assign("rack_unit_info", "innerHTML", $html); if ($js) { $response->addScript($js); } - return($response->getXML()); + return($response->getOutput()); }*/ @@ -2042,7 +2042,7 @@ function ws_display($window_name, $form='') { $html .= "
Rack doesn't exist!
"; $response = new xajaxResponse(); $response->assign("work_space_content", "innerHTML", $html); - return($response->getXML()); + return($response->getOutput()); } // get location info @@ -2463,7 +2463,7 @@ class="act" $response = new xajaxResponse(); $response->assign("work_space_content", "innerHTML", $html); if ($js) { $response->addScript($js); } - return($response->getXML()); + return($response->getOutput()); } From affd2070e5d3b0c6a7f6f67ef48f1482d195dbc5 Mon Sep 17 00:00:00 2001 From: Kevin Mueller Date: Sat, 21 Jun 2025 23:05:13 -0600 Subject: [PATCH 3/4] trying printOutput instead --- rack_maint.inc.php | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/rack_maint.inc.php b/rack_maint.inc.php index 97ae2b5..8350388 100644 --- a/rack_maint.inc.php +++ b/rack_maint.inc.php @@ -128,7 +128,7 @@ function ws_display_list($window_name, $form) { if (! (auth('rack_add') or auth('advanced'))){ $response = new xajaxResponse(); $response->addScript("alert('Permission denied!');"); - return($response->getOutput()); + return($response->printOutput()); } // If the group supplied an array in a string, build the array and store it in $form @@ -258,7 +258,7 @@ class="act" $response->assign("{$form['form_id']}_racks_count", "innerHTML", "({$count})"); $response->assign("{$form['content_id']}", "innerHTML", $html); // $response->addScript($js); - return($response->getOutput()); + return($response->printOutput()); } @@ -1286,7 +1286,7 @@ function ws_rack_editor($window_name, $form='') { if (! (auth('rack_add') or auth('advanced'))){ $response = new xajaxResponse(); $response->addScript("alert('Permission denied!');"); - return($response->getOutput()); + return($response->printOutput()); } // If the user supplied an array in a string, build the array and store it in $form @@ -1469,7 +1469,7 @@ function ws_ru_editor($window_name, $form='') { if (! (auth('rack_add') or auth('advanced'))){ $response = new xajaxResponse(); $response->addScript("alert('Permission denied!');"); - return($response->getOutput()); + return($response->printOutput()); } // If the user supplied an array in a string, build the array and store it in $form @@ -1697,7 +1697,7 @@ function ws_rack_save($window_name, $form='') { if (! (auth('rack_add') or auth('advanced'))){ $response = new xajaxResponse(); $response->addScript("alert('Permission denied!');"); - return($response->getOutput()); + return($response->printOutput()); } // Instantiate the xajaxResponse object @@ -1734,7 +1734,7 @@ function ws_rack_save($window_name, $form='') { // Insert the new table into the window $response->addScript($js); - return($response->getOutput()); + return($response->printOutput()); } @@ -1759,7 +1759,7 @@ function ws_save($window_name, $form='') { if (! (auth('rack_add') or auth('advanced'))){ $response = new xajaxResponse(); $response->addScript("alert('Permission denied!');"); - return($response->getOutput()); + return($response->printOutput()); } // Instantiate the xajaxResponse object @@ -1797,7 +1797,7 @@ function ws_save($window_name, $form='') { // Insert the new table into the window $response->addScript($js); - return($response->getOutput()); + return($response->printOutput()); } @@ -1820,7 +1820,7 @@ function ws_rack_delete($window_name, $form='') { if (! (auth('rack_del') or auth('advanced'))){ $response = new xajaxResponse(); $response->addScript("alert('Permission denied!');"); - return($response->getOutput()); + return($response->printOutput()); } // If an array in a string was provided, build the array and store it in $form @@ -1844,7 +1844,7 @@ function ws_rack_delete($window_name, $form='') { // Return an XML response $response->addScript($js); - return($response->getOutput()); + return($response->printOutput()); } @@ -1869,7 +1869,7 @@ function ws_delete($window_name, $form='') { if (! (auth('rack_del') or auth('advanced'))){ $response = new xajaxResponse(); $response->addScript("alert('Permission denied!');"); - return($response->getOutput()); + return($response->printOutput()); } // If an array in a string was provided, build the array and store it in $form @@ -1893,7 +1893,7 @@ function ws_delete($window_name, $form='') { // Return an XML response $response->addScript($js); - return($response->getOutput()); + return($response->printOutput()); } @@ -1933,7 +1933,7 @@ function ws_display_info($window_name, $form='') { $response = new xajaxResponse(); $response->assign("rack_unit_info", "innerHTML", $html); if ($js) { $response->addScript($js); } - return($response->getOutput()); + return($response->printOutput()); }*/ @@ -2042,7 +2042,7 @@ function ws_display($window_name, $form='') { $html .= "
Rack doesn't exist!
"; $response = new xajaxResponse(); $response->assign("work_space_content", "innerHTML", $html); - return($response->getOutput()); + return($response->printOutput()); } // get location info @@ -2463,7 +2463,7 @@ class="act" $response = new xajaxResponse(); $response->assign("work_space_content", "innerHTML", $html); if ($js) { $response->addScript($js); } - return($response->getOutput()); + return($response->printOutput()); } From 4d5b39609fadda23aefaca447a136f7d24b23b71 Mon Sep 17 00:00:00 2001 From: Kevin Mueller Date: Sat, 21 Jun 2025 23:17:02 -0600 Subject: [PATCH 4/4] fixing addScript to includeScript --- rack_maint.inc.php | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/rack_maint.inc.php b/rack_maint.inc.php index 8350388..b6ba2fe 100644 --- a/rack_maint.inc.php +++ b/rack_maint.inc.php @@ -127,7 +127,7 @@ function ws_display_list($window_name, $form) { // Check permissions if (! (auth('rack_add') or auth('advanced'))){ $response = new xajaxResponse(); - $response->addScript("alert('Permission denied!');"); + $response->includeScript("alert('Permission denied!');"); return($response->printOutput()); } @@ -257,7 +257,7 @@ class="act" $response = new xajaxResponse(); $response->assign("{$form['form_id']}_racks_count", "innerHTML", "({$count})"); $response->assign("{$form['content_id']}", "innerHTML", $html); - // $response->addScript($js); + // $response->includeScript($js); return($response->printOutput()); } @@ -1285,7 +1285,7 @@ function ws_rack_editor($window_name, $form='') { // Check permissions if (! (auth('rack_add') or auth('advanced'))){ $response = new xajaxResponse(); - $response->addScript("alert('Permission denied!');"); + $response->includeScript("alert('Permission denied!');"); return($response->printOutput()); } @@ -1468,7 +1468,7 @@ function ws_ru_editor($window_name, $form='') { // Check permissions if (! (auth('rack_add') or auth('advanced'))){ $response = new xajaxResponse(); - $response->addScript("alert('Permission denied!');"); + $response->includeScript("alert('Permission denied!');"); return($response->printOutput()); } @@ -1696,7 +1696,7 @@ function ws_rack_save($window_name, $form='') { // Check permissions if (! (auth('rack_add') or auth('advanced'))){ $response = new xajaxResponse(); - $response->addScript("alert('Permission denied!');"); + $response->includeScript("alert('Permission denied!');"); return($response->printOutput()); } @@ -1733,7 +1733,7 @@ function ws_rack_save($window_name, $form='') { } // Insert the new table into the window - $response->addScript($js); + $response->includeScript($js); return($response->printOutput()); } @@ -1758,7 +1758,7 @@ function ws_save($window_name, $form='') { // Check permissions if (! (auth('rack_add') or auth('advanced'))){ $response = new xajaxResponse(); - $response->addScript("alert('Permission denied!');"); + $response->includeScript("alert('Permission denied!');"); return($response->printOutput()); } @@ -1796,7 +1796,7 @@ function ws_save($window_name, $form='') { } // Insert the new table into the window - $response->addScript($js); + $response->includeScript($js); return($response->printOutput()); } @@ -1819,7 +1819,7 @@ function ws_rack_delete($window_name, $form='') { // Check permissions if (! (auth('rack_del') or auth('advanced'))){ $response = new xajaxResponse(); - $response->addScript("alert('Permission denied!');"); + $response->includeScript("alert('Permission denied!');"); return($response->printOutput()); } @@ -1843,7 +1843,7 @@ function ws_rack_delete($window_name, $form='') { $js .= $form['js']; // usually js will refresh the window we got called from // Return an XML response - $response->addScript($js); + $response->includeScript($js); return($response->printOutput()); } @@ -1868,7 +1868,7 @@ function ws_delete($window_name, $form='') { // Check permissions if (! (auth('rack_del') or auth('advanced'))){ $response = new xajaxResponse(); - $response->addScript("alert('Permission denied!');"); + $response->includeScript("alert('Permission denied!');"); return($response->printOutput()); } @@ -1892,7 +1892,7 @@ function ws_delete($window_name, $form='') { $js .= $form['js']; // usually js will refresh the window we got called from // Return an XML response - $response->addScript($js); + $response->includeScript($js); return($response->printOutput()); } @@ -1932,7 +1932,7 @@ function ws_display_info($window_name, $form='') { // Instantiate the xajaxResponse object $response = new xajaxResponse(); $response->assign("rack_unit_info", "innerHTML", $html); - if ($js) { $response->addScript($js); } + if ($js) { $response->includeScript($js); } return($response->printOutput()); }*/ @@ -2462,7 +2462,7 @@ class="act" // Instantiate the xajaxResponse object $response = new xajaxResponse(); $response->assign("work_space_content", "innerHTML", $html); - if ($js) { $response->addScript($js); } + if ($js) { $response->includeScript($js); } return($response->printOutput()); }