mirror of
				https://github.com/grocy/grocy.git
				synced 2025-10-31 18:49:38 +00:00 
			
		
		
		
	Fixed number input min/max amount handling Only (auto) save valid user inputs More filters on the stock journal pages Save the last price per used barcode and preselect that as a total price on purchase if not empty (closes #1131) Don't apply conversions for only_check_single_unit_in_stock ingredients (fixes #1120) Render shopping list userfields (closes #1052) Fixed Focus when adding included recipes (closes #1019) Order all base objects with NOCASE (closes #1086)
		
			
				
	
	
		
			42 lines
		
	
	
		
			1.2 KiB
		
	
	
	
		
			PHP
		
	
	
	
	
	
			
		
		
	
	
			42 lines
		
	
	
		
			1.2 KiB
		
	
	
	
		
			PHP
		
	
	
	
	
	
| <?php
 | |
| 
 | |
| namespace Grocy\Controllers;
 | |
| 
 | |
| class EquipmentController extends BaseController
 | |
| {
 | |
| 	protected $UserfieldsService;
 | |
| 
 | |
| 	public function EditForm(\Psr\Http\Message\ServerRequestInterface $request, \Psr\Http\Message\ResponseInterface $response, array $args)
 | |
| 	{
 | |
| 		if ($args['equipmentId'] == 'new')
 | |
| 		{
 | |
| 			return $this->renderPage($response, 'equipmentform', [
 | |
| 				'mode' => 'create',
 | |
| 				'userfields' => $this->getUserfieldsService()->GetFields('equipment')
 | |
| 			]);
 | |
| 		}
 | |
| 		else
 | |
| 		{
 | |
| 			return $this->renderPage($response, 'equipmentform', [
 | |
| 				'equipment' => $this->getDatabase()->equipment($args['equipmentId']),
 | |
| 				'mode' => 'edit',
 | |
| 				'userfields' => $this->getUserfieldsService()->GetFields('equipment')
 | |
| 			]);
 | |
| 		}
 | |
| 	}
 | |
| 
 | |
| 	public function Overview(\Psr\Http\Message\ServerRequestInterface $request, \Psr\Http\Message\ResponseInterface $response, array $args)
 | |
| 	{
 | |
| 		return $this->renderPage($response, 'equipment', [
 | |
| 			'equipment' => $this->getDatabase()->equipment()->orderBy('name', 'COLLATE NOCASE'),
 | |
| 			'userfields' => $this->getUserfieldsService()->GetFields('equipment'),
 | |
| 			'userfieldValues' => $this->getUserfieldsService()->GetAllValues('equipment')
 | |
| 		]);
 | |
| 	}
 | |
| 
 | |
| 	public function __construct(\DI\Container $container)
 | |
| 	{
 | |
| 		parent::__construct($container);
 | |
| 	}
 | |
| }
 |