Skip to content

Commit

Permalink
hotfixes 03/28/2023
Browse files Browse the repository at this point in the history
FIX: add breadcrumbs

FIX: use Sanitizer::string to allow spaces in key fields

FIX: use Sanitizer::string for key fields

FIX: include file upcx

FIX: use Sanitizer::string

FIX: use Sanitizer::string

FIX: remove response

FIX: only show response if there is an error

FIX: use Sanitizer::string for custitemiID

FIX: use page::searchLookupUrl()

FIX: only show response if error

FEAT: set headline

FIX: hide default breadcrumbs

Create bread-crumbs.twig

Update search.twig

FIX: use Sanitizer::string

Update Upcx.php

Update XrefUpc.module

Update Itmimg.php
  • Loading branch information
Pauldro committed Mar 28, 2023
1 parent e73e341 commit acdc5bc
Show file tree
Hide file tree
Showing 43 changed files with 243 additions and 153 deletions.
6 changes: 3 additions & 3 deletions site/modules/Dplus/Itm/Itm.module
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ class Itm extends WireData implements Module {
$this->inputUpdate($input);
break;
default:
$itemID = $values->text('itemID');
$itemID = $values->string('itemID');
$message = self::DESCRIPTION_RECORD . " ($itemID) was not saved, no action was specified";
$response = ItmResponse::response_error($itemID, $message);
$this->wire('session')->setFor('response', 'itm', $response);
Expand All @@ -263,7 +263,7 @@ class Itm extends WireData implements Module {
private function inputDelete(WireInput $input) {
$rm = strtolower($input->requestMethod());
$values = $input->$rm;
$itemID = $values->text('itemID');
$itemID = $values->string('itemID');

if ($this->exists($itemID) === false) {
return true;
Expand Down Expand Up @@ -298,7 +298,7 @@ class Itm extends WireData implements Module {
$values = $input->$rm;
$configIn = $this->configIn();

$itemID = $configIn->useUppercaseItemid() ? strtoupper($values->text('itemID')) : $values->text('itemID');
$itemID = $configIn->useUppercaseItemid() ? strtoupper($values->string('itemID')) : $values->string('itemID');
$record = $this->getCreateItem($itemID);
$invalidfields = array();

Expand Down
4 changes: 2 additions & 2 deletions site/modules/Dplus/Itm/ItmCosting.module
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ class ItmCosting extends WireData implements Module {
public function processInput(WireInput $input) {
$rm = strtolower($input->requestMethod());
$values = $input->$rm;
$itemID = $values->text('itemID');
$itemID = $values->string('itemID');

switch ($values->action) {
case 'update-itm-costing':
Expand All @@ -128,7 +128,7 @@ class ItmCosting extends WireData implements Module {
private function inputUpdate(WireInput $input) {
$rm = strtolower($input->requestMethod());
$values = $input->$rm;
$itemID = $values->text('itemID');
$itemID = $values->string('itemID');
$itm = $this->wire('modules')->get('Itm');

if ($itm->exists($itemID) === false) {
Expand Down
2 changes: 1 addition & 1 deletion site/modules/Dplus/Itm/ItmHazmat.module
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ class ItmHazmat extends WireData implements Module {
$rm = strtolower($input->requestMethod());
$values = $input->$rm;
$itm = $this->wire('modules')->get('Itm');
$itemID = $itm->itemid($values->text('itemID'));
$itemID = $itm->itemid($values->string('itemID'));

if ($itm->exists($itemID) === false) {
$this->setResponse(ItmResponse::response_error($itemID, "$itemID does not exist"));
Expand Down
8 changes: 4 additions & 4 deletions site/modules/Dplus/Itm/ItmPricing.module
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ class ItmPricing extends WireData implements Module {
*/
public function get_create_itempricing(WireInput $input) {
$rm = strtolower($input->requestMethod());
$itemID = $input->$rm->text('itemID');
$itemID = $input->$rm->string('itemID');

if ($this->wire('modules')->get('Itm')->exists($itemID)) {
return $this->get_pricing($itemID);
Expand Down Expand Up @@ -167,7 +167,7 @@ class ItmPricing extends WireData implements Module {
$itm = $this->wire('modules')->get('Itm');
$rm = strtolower($input->requestMethod());
$values = $input->$rm;
$itemID = $values->text('itemID');
$itemID = $values->string('itemID');

switch ($values->text('action')) {
case 'update-itm-pricing':
Expand All @@ -190,7 +190,7 @@ class ItmPricing extends WireData implements Module {
$itm = $this->wire('modules')->get('Itm');
$rm = strtolower($input->requestMethod());
$values = $input->$rm;
$itemID = $values->text('itemID');
$itemID = $values->string('itemID');

if ($itm->exists($itemID) === false) {
$response = ItmResponse::response_error($itemID, "No Item with ItemID $itemID exists");
Expand Down Expand Up @@ -251,7 +251,7 @@ class ItmPricing extends WireData implements Module {
$values = $input->$rm;
$itm = $this->wire('modules')->get('Itm');

$itemID = $values->text('itemID');
$itemID = $values->string('itemID');
$item = $itm->item($itemID);
return $this->updateItmItem($item, $input);
}
Expand Down
4 changes: 2 additions & 2 deletions site/modules/Dplus/Itm/ItmWarehouse.module
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ class ItmWarehouse extends WireData implements Module {
public function input_delete(WireInput $input) {
$rm = strtolower($input->requestMethod());
$values = $input->$rm;
$itemID = $values->text('itemID');
$itemID = $values->string('itemID');
$whseID = $values->text('whseID');

if ($this->itemwarehouse_exists($itemID, $whseID)) {
Expand Down Expand Up @@ -252,7 +252,7 @@ class ItmWarehouse extends WireData implements Module {
$validate = new ItmwValidator();
$rm = strtolower($input->requestMethod());
$values = $input->$rm;
$itemID = $values->text('itemID');
$itemID = $values->string('itemID');
$whseID = $values->text('whseID');
$record = $this->getOrCreate($itemID, $whseID);

Expand Down
6 changes: 3 additions & 3 deletions site/modules/Dplus/Itm/ItmXrefs.module
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ class ItmXrefs extends WireData implements Module {
public function processInput(WireInput $input) {
$rm = strtolower($input->requestMethod());
$values = $input->$rm;
$itemID = $values->text('itemID');
$itemID = $values->string('itemID');
$itm = $this->wire('modules')->get('Itm');

if ($itm->exists($itemID) === false) {
Expand All @@ -70,7 +70,7 @@ class ItmXrefs extends WireData implements Module {
$itm = $this('modules')->get('Itm');
$rm = strtolower($input->requestMethod());
$values = $input->$rm;
$item = $itm->item($values->text('itemID'));
$item = $itm->item($values->string('itemID'));

if ($item->isNew() === false) {
$itm->lockrecord($item->itemid);
Expand Down Expand Up @@ -136,7 +136,7 @@ class ItmXrefs extends WireData implements Module {
$cxm = $this->wire('modules')->get('XrefCxm');
$rm = strtolower($input->requestMethod());
$values = $input->$rm;
$itemID = $values->text('itemID');
$itemID = $values->string('itemID');
$shortitemID = $values->text('shortitemID');

// Delete record if blank
Expand Down
10 changes: 5 additions & 5 deletions site/modules/Dplus/Itm/src/Dimensions.php
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ private function updateInput(WireInput $input) {
$values = $input->$rm;

$itm = $this->wire('modules')->get('Itm');
$itemID = $values->text('itemID');
$itemID = $values->string('itemID');

if ($itm->exists($itemID) === false) {
return false;
Expand Down Expand Up @@ -143,11 +143,11 @@ private function updateInputItm(WireInput $input) {
$rm = strtolower($input->requestMethod());
$values = $input->$rm;

if ($this->validateAndLockItemid($values->text('itemID')) === false) {
if ($this->validateAndLockItemid($values->string('itemID')) === false) {
return false;
}
$itm = $this->wire('modules')->get('Itm');
$item = $itm->item($values->text('itemID'));
$item = $itm->item($values->string('itemID'));
$item->setQty_pack_inner($values->float('innerpack'));
$item->setQty_pack_outer($values->float('outerpack'));
$item->setQty_tare($values->float('qtytare'));
Expand All @@ -169,11 +169,11 @@ private function updateInputDimension(WireInput $input) {
$rm = strtolower($input->requestMethod());
$values = $input->$rm;

if ($this->validateAndLockItemid($values->text('itemID')) === false) {
if ($this->validateAndLockItemid($values->string('itemID')) === false) {
return false;
}

$dim = $this->getOrCreateDimension($values->text('itemID'));
$dim = $this->getOrCreateDimension($values->string('itemID'));
$dim->setLength($values->float('length'));
$dim->setWidth($values->float('width'));
$dim->setThickness($values->float('thickness'));
Expand Down
22 changes: 11 additions & 11 deletions site/modules/Dplus/Itm/src/Options/Codes.php
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ private function updateInput(WireInput $input) {
$values = $input->$rm;

$itm = $this->wire('modules')->get('Itm');
$itemID = $values->text('itemID');
$itemID = $values->string('itemID');

if ($itm->exists($itemID) === false) {
return false;
Expand All @@ -174,9 +174,9 @@ private function updateInput(WireInput $input) {
private function updateInputCode(WireInput $input) {
$rm = strtolower($input->requestMethod());
$values = $input->$rm;
$itemID = $values->text('itemID');
$sysop = $values->text('sysop');
$code = $values->text('code');
$itemID = $values->string('itemID');
$sysop = $values->string('sysop');
$code = $values->string('code');

$sysopM = $this->getSysop();

Expand Down Expand Up @@ -213,9 +213,9 @@ private function updateCodeUsingSysopRules(MsaSysopCode $sysOption, InvOptCode $
$input = $this->wire('input');
$rm = strtolower($input->requestMethod());
$values = $input->$rm;
$itemID = $values->text('itemID');
$sysop = $values->text('sysop');
$code = $values->text('code');
$itemID = $values->string('itemID');
$sysop = $values->string('sysop');
$code = $values->string('code');

if ($sysOption->force() && $sysop == '') {
$msg = "Sysop $sysop is Required";
Expand Down Expand Up @@ -260,7 +260,7 @@ private function deleteInput(WireInput $input) {
$values = $input->$rm;

$itm = $this->wire('modules')->get('Itm');
$itemID = $values->text('itemID');
$itemID = $values->string('itemID');

if ($itm->exists($itemID) === false) {
return false;
Expand All @@ -280,9 +280,9 @@ private function deleteInput(WireInput $input) {
private function deleteInputCode(WireInput $input) {
$rm = strtolower($input->requestMethod());
$values = $input->$rm;
$itemID = $values->text('itemID');
$sysop = $values->text('sysop');
$code = $values->text('code');
$itemID = $values->string('itemID');
$sysop = $values->string('sysop');
$code = $values->string('code');

$sysopM = $this->getSysop();

Expand Down
6 changes: 3 additions & 3 deletions site/modules/Dplus/Itm/src/Options/Qnotes.php
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ protected function _inputUpdate(WireInput $input) {
return false;
}

$itemID = $values->text('itemID');
$itemID = $values->string('itemID');

if ($sysop->force() && empty($values->textarea('note'))) {
$responseQnotes = Response::responseError("$sysop->notecode Notes are required");
Expand Down Expand Up @@ -186,7 +186,7 @@ protected function _inputUpdate(WireInput $input) {
private function writeNotes(WireInput $input, MsaSysopCode $sysop) {
$rm = strtolower($input->requestMethod());
$values = $input->$rm;
$itemID = $values->text('itemID');
$itemID = $values->string('itemID');

$this->deleteNotes($itemID, $sysop->notecode);

Expand Down Expand Up @@ -249,7 +249,7 @@ protected function _inputDelete(WireInput $input) {
$rm = strtolower($input->requestMethod());
$values = $input->$rm;
$sysopM = $this->getSysop();
$itemID = $values->text('itemID');
$itemID = $values->string('itemID');
$sysop = $sysopM->code(self::SYSTEM, $values->text('sysop'));

if ($sysop->force()) {
Expand Down
14 changes: 7 additions & 7 deletions site/modules/Dplus/Itm/src/Substitutes.php
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ private function inputDelete(WireInput $input) {

$itm = $this->getItm();
$itm->init();
$itemID = $itm->itemid($values->text('itemID'));
$itemID = $itm->itemid($values->string('itemID'));

if ($itm->exists($itemID) === false) {
return false;
Expand All @@ -198,7 +198,7 @@ private function inputDeleteSub(WireInput $input) {
$rm = strtolower($input->requestMethod());
$values = $input->$rm;

$itemID = $values->text('itemID');
$itemID = $values->string('itemID');
$subitemID = $values->text('subitemID');
$sub = $this->getOrCreate($itemID, $subitemID);

Expand Down Expand Up @@ -235,7 +235,7 @@ private function inputUpdate(WireInput $input) {

$itm = $this->getItm();
$itm->init();
$itemID = $itm->itemid($values->text('itemID'));
$itemID = $itm->itemid($values->string('itemID'));

if ($itm->exists($itemID) === false) {
return false;
Expand All @@ -256,7 +256,7 @@ private function inputUpdateSub(WireInput $input) {
$rm = strtolower($input->requestMethod());
$values = $input->$rm;

$itemID = $values->text('itemID');
$itemID = $values->string('itemID');
$subitemID = $values->text('subitemID');
$sub = $this->getOrCreate($itemID, $subitemID);

Expand Down Expand Up @@ -307,12 +307,12 @@ private function setSubFieldsValidated(ItemSubstitute $sub, WireInput $input) {
$itm = $this->getItm();

if ($sub->isNew()) {
if ($itm->exists($values->text('itemID')) === false) {
if ($itm->exists($values->string('itemID')) === false) {
$invalid['itemID'] = 'Item ID';
}

if ($itm->exists($values->text('itemID'))) {
$sub->setItemid($values->text('itemID'));
if ($itm->exists($values->string('itemID'))) {
$sub->setItemid($values->string('itemID'));
}
}

Expand Down
10 changes: 5 additions & 5 deletions site/modules/Dplus/Min/src/Inmain/Addm/Addm.php
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ public function processInput(WireInput $input) {
return $this->inputUpdate($input);
break;
default:
$key = implode('-', [$values->text('itemID'), $values->text('addonID')]);
$key = implode('-', [$values->string('itemID'), $values->string('addonID')]);
$message = self::DESCRIPTION_RECORD . " ($key) was not saved, no action was specified";
$this->setResponse(Response::responseError($key, $message));
return false;
Expand All @@ -222,8 +222,8 @@ public function processInput(WireInput $input) {
public function inputUpdate(WireInput $input) {
$rm = strtolower($input->requestMethod());
$values = $input->$rm;
$itemID = $values->text('itemID');
$addonID = $values->text('addonID');
$itemID = $values->string('itemID');
$addonID = $values->string('addonID');
$xref = $this->getOrCreate($itemID, $addonID);

if ($this->lockrecord($xref) === false && $xref->isNew() === false) {
Expand Down Expand Up @@ -255,8 +255,8 @@ public function inputUpdate(WireInput $input) {
protected function inputDelete(WireInput $input) {
$rm = strtolower($input->requestMethod());
$values = $input->$rm;
$itemID = $values->text('itemID');
$addonID = $values->text('addonID');
$itemID = $values->string('itemID');
$addonID = $values->string('addonID');

if ($this->exists($itemID, $addonID)) {
$xref = $this->xref($itemID, $addonID);
Expand Down
10 changes: 5 additions & 5 deletions site/modules/Dplus/Min/src/Inmain/I2i/I2i.php
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ public function processInput(WireInput $input) {
return $this->inputUpdate($input);
break;
default:
$key = implode('-', [$values->text('parentID'), $values->text('childID')]);
$key = implode('-', [$values->string('parentID'), $values->string('childID')]);
$message = self::DESCRIPTION_RECORD . " ($key) was not saved, no action was specified";
$this->setResponse(Response::responseError($key, $message));
return false;
Expand All @@ -226,8 +226,8 @@ public function processInput(WireInput $input) {
public function inputUpdate(WireInput $input) {
$rm = strtolower($input->requestMethod());
$values = $input->$rm;
$parentID = $values->text('parentID');
$childID = $values->text('childID');
$parentID = $values->string('parentID');
$childID = $values->string('childID');
$xref = $this->getOrCreate($parentID, $childID);

if ($this->lockrecord($xref) === false && $xref->isNew() === false) {
Expand All @@ -249,8 +249,8 @@ public function inputUpdate(WireInput $input) {
protected function inputDelete(WireInput $input) {
$rm = strtolower($input->requestMethod());
$values = $input->$rm;
$parentID = $values->text('parentID');
$childID = $values->text('childID');
$parentID = $values->string('parentID');
$childID = $values->string('childID');

if ($this->exists($parentID, $childID)) {
$xref = $this->xref($parentID, $childID);
Expand Down
4 changes: 2 additions & 2 deletions site/modules/Dplus/Min/src/Inmain/Itmimg.php
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ public function inputUpdate(WireInput $input) {
private function upload(WireInput $input) {
$rm = strtolower($input->requestMethod());
$values = $input->$rm;
$itemID = $values->text('itemID');
$itemID = $values->string('itemID');

$uploader = Uploader::getInstance();
$uploader->useAutoFile($this->useAutofile);
Expand All @@ -140,7 +140,7 @@ private function upload(WireInput $input) {
}

$response = Response::responseSuccess("Uploaded $itemID Image");
$response->setKey($values->text('itemID'));
$response->setKey($values->string('itemID'));
$this->setResponse($response);

return true;
Expand Down
Loading

0 comments on commit acdc5bc

Please sign in to comment.