-
-
Couldn't load subscription status.
- Fork 1.5k
Main add history on consumables and cartridge #21618
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -143,6 +143,19 @@ public function backToStock(array $input, $history = true) | |||||||||||||||||||||||||||||
| ] | ||||||||||||||||||||||||||||||
| ); | ||||||||||||||||||||||||||||||
| if ($result) { | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| $this->getFromDB($input['id']); | ||||||||||||||||||||||||||||||
| Log::history( | ||||||||||||||||||||||||||||||
| $this->fields["consumableitems_id"], | ||||||||||||||||||||||||||||||
| ConsumableItem::class, | ||||||||||||||||||||||||||||||
| [ | ||||||||||||||||||||||||||||||
| 0, | ||||||||||||||||||||||||||||||
| '', | ||||||||||||||||||||||||||||||
| __('Return') . ' : ' . $this->getPreAdditionalInfosForName() . ' (' . $input['id'] . '), ' . __('To') . ' : ' . __('Stock'), | ||||||||||||||||||||||||||||||
| ], | ||||||||||||||||||||||||||||||
| static::class, | ||||||||||||||||||||||||||||||
| Log::HISTORY_UPDATE_SUBITEM | ||||||||||||||||||||||||||||||
| ); | ||||||||||||||||||||||||||||||
| return true; | ||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||
| return false; | ||||||||||||||||||||||||||||||
|
|
@@ -188,6 +201,29 @@ public function out($ID, $itemtype = '', $items_id = 0) | |||||||||||||||||||||||||||||
| ] | ||||||||||||||||||||||||||||||
| ); | ||||||||||||||||||||||||||||||
| if ($result) { | ||||||||||||||||||||||||||||||
| switch ($itemtype) { | ||||||||||||||||||||||||||||||
| case 'User' : | ||||||||||||||||||||||||||||||
| $model = new User(); | ||||||||||||||||||||||||||||||
| $model->getFromDB($items_id); | ||||||||||||||||||||||||||||||
| $name = strtoupper($model->fields['name']); | ||||||||||||||||||||||||||||||
| break; | ||||||||||||||||||||||||||||||
| case 'Group' : | ||||||||||||||||||||||||||||||
| default: | ||||||||||||||||||||||||||||||
| $model = new Group(); | ||||||||||||||||||||||||||||||
| $model->getFromDB($items_id); | ||||||||||||||||||||||||||||||
| break; | ||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||
| switch ($itemtype) { | |
| case 'User' : | |
| $model = new User(); | |
| $model->getFromDB($items_id); | |
| $name = strtoupper($model->fields['name']); | |
| break; | |
| case 'Group' : | |
| default: | |
| $model = new Group(); | |
| $model->getFromDB($items_id); | |
| break; | |
| } | |
| $item = getItemForItemtype($itemtype); | |
| $item->getFromDB($items_id); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for your return, I realized the change
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't the itemtype information missing here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Adding the itemtype allows for better understanding, I hadded the information
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's probably easier to read and translate to use one sentence with replacements rather than a string concatenation:
(same applies for other cases in this PR)
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for your return, I realized the change