ok for template to delete entry, next validate form for that
This commit is contained in:
parent
4aacfb204f
commit
d6a6ec9153
5 changed files with 74 additions and 0 deletions
|
|
@ -4,6 +4,7 @@ namespace Garradin\Plugin\Materiels;
|
|||
|
||||
use Garradin\DB;
|
||||
use Garradin\Plugin\Materiels\Equipment;
|
||||
use Garradin\Plugin\Materiels\Output;
|
||||
|
||||
class Entry
|
||||
{
|
||||
|
|
@ -28,6 +29,11 @@ class Entry
|
|||
$db->update('plugin_materiels_entry', $data, $db->where('id', $id));
|
||||
}
|
||||
|
||||
public function get($id)
|
||||
{
|
||||
return DB::getInstance()->first('SELECT * FROM plugin_materiels_entry WHERE id = ?;', $id);
|
||||
}
|
||||
|
||||
public function listAll()
|
||||
{
|
||||
return DB::getInstance()->get('SELECT * FROM plugin_materiels_entry ORDER BY entry_date DESC;');
|
||||
|
|
@ -52,4 +58,18 @@ class Entry
|
|||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public function PossibilityDeleteEntry($entry)
|
||||
{
|
||||
$output = new Output;
|
||||
if ($entry->kind == 'Location / Prêt')
|
||||
{
|
||||
return $output->PossibilityNoOwnedEqmtOutput(
|
||||
$entry->equipment_id, $entry->equipment_number, $entry->entry_date);
|
||||
} else
|
||||
{
|
||||
return $output->PossibilityOwnedEqmtOutput(
|
||||
$entry->equipment_id, $entry->equipment_number, $entry->entry_date);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue