diff --git a/materiels.tar.gz b/materiels.tar.gz index 65b8a9d..0c46472 100644 Binary files a/materiels.tar.gz and b/materiels.tar.gz differ diff --git a/src/lib/Entry.php b/src/lib/Entry.php index 9766c0f..a455462 100644 --- a/src/lib/Entry.php +++ b/src/lib/Entry.php @@ -4,7 +4,7 @@ namespace Garradin\Plugin\Materiels; use Garradin\DB; -class Entry // entrées définitives +class Entry { protected $columns_order = array( 'id', diff --git a/src/schema.sql b/src/schema.sql index 27d23fc..8af9085 100644 --- a/src/schema.sql +++ b/src/schema.sql @@ -22,31 +22,11 @@ CREATE TABLE IF NOT EXISTS plugin_materiels_entry ( FOREIGN KEY ( equipment_id ) REFERENCES plugin_materiels_equipment( id ) ON DELETE RESTRICT ON UPDATE CASCADE ); -CREATE TABLE IF NOT EXISTS plugin_materiels_temporary_entry ( - id integer NOT NULL PRIMARY KEY autoincrement, - kind varchar(20) NOT NULL, - number_of_equipments integer NOT NULL, - equipment_id integer NOT NULL, - start_date date NOT NULL, - end_date date, - FOREIGN KEY ( equipment_id ) REFERENCES plugin_materiels_equipment( id ) ON DELETE RESTRICT ON UPDATE CASCADE -); - CREATE TABLE IF NOT EXISTS plugin_materiels_output ( id integer NOT NULL PRIMARY KEY autoincrement, kind varchar(20) NOT NULL, number_of_equipments integer NOT NULL, equipment_id integer NOT NULL, output_date date NOT NULL, - FOREIGN KEY ( equipment_id ) REFERENCES plugin_materiels_entry( equipment_id ) ON DELETE RESTRICT ON UPDATE CASCADE -); - -CREATE TABLE IF NOT EXISTS plugin_materiels_temporary_output ( - id integer NOT NULL PRIMARY KEY autoincrement, - kind varchar(20) NOT NULL, - number_of_equipments integer NOT NULL, - equipment_id integer NOT NULL, - start_date date NOT NULL, - end_date date, - FOREIGN KEY ( equipment_id ) REFERENCES plugin_materiels_entry( equipment_id ) ON DELETE RESTRICT ON UPDATE CASCADE + FOREIGN KEY ( equipment_id ) REFERENCES plugin_materiels_equipment( id ) ON DELETE RESTRICT ON UPDATE CASCADE ); diff --git a/src/templates/_nav.tpl b/src/templates/_nav.tpl index 9ed7323..53d00bb 100644 --- a/src/templates/_nav.tpl +++ b/src/templates/_nav.tpl @@ -1,11 +1,9 @@ diff --git a/src/templates/entrees/definitives/deja_repertorie.tpl b/src/templates/entrees/deja_repertorie.tpl similarity index 66% rename from src/templates/entrees/definitives/deja_repertorie.tpl rename to src/templates/entrees/deja_repertorie.tpl index 1353504..a9f7c70 100644 --- a/src/templates/entrees/definitives/deja_repertorie.tpl +++ b/src/templates/entrees/deja_repertorie.tpl @@ -1,6 +1,6 @@ {include file="admin/_head.tpl" title="%s"|args:$plugin.nom current="plugin_%s"|args:$plugin.id} -{include file="%s_nav.tpl"|args:$plugin_tpl current="entrees_definitives"} +{include file="%s_nav.tpl"|args:$plugin_tpl current="entrees"} déjà repertorie diff --git a/src/templates/entrees/definitives/index.tpl b/src/templates/entrees/index.tpl similarity index 84% rename from src/templates/entrees/definitives/index.tpl rename to src/templates/entrees/index.tpl index f09d0b5..4f7500a 100644 --- a/src/templates/entrees/definitives/index.tpl +++ b/src/templates/entrees/index.tpl @@ -1,9 +1,9 @@ {include file="admin/_head.tpl" title="%s"|args:$plugin.nom current="plugin_%s"|args:$plugin.id} -{include file="%s_nav.tpl"|args:$plugin_tpl current="entrees_definitives"} +{include file="%s_nav.tpl"|args:$plugin_tpl current="entrees"}
- Ajouter une entrée définitive pour du + Ajouter une entrée pour du {linkbutton shape="plus" label="Matériel pas encore répertorié" href="non_repertorie.php"} {linkbutton shape="plus" label="Matériel déjà répertorié" href="deja_repertorie.php"}
diff --git a/src/templates/entrees/definitives/non_repertorie.tpl b/src/templates/entrees/non_repertorie.tpl similarity index 90% rename from src/templates/entrees/definitives/non_repertorie.tpl rename to src/templates/entrees/non_repertorie.tpl index 9a87bec..504d976 100644 --- a/src/templates/entrees/definitives/non_repertorie.tpl +++ b/src/templates/entrees/non_repertorie.tpl @@ -1,10 +1,10 @@ {include file="admin/_head.tpl" title="%s"|args:$plugin.nom current="plugin_%s"|args:$plugin.id} -{include file="%s_nav.tpl"|args:$plugin_tpl current="entrees_definitives"} +{include file="%s_nav.tpl"|args:$plugin_tpl current="entrees"}
- Ajouter une entrée définitive d'un matériel pas encore répertorié + Ajouter une entrée d'un matériel pas encore répertorié {form_errors}
(obligatoire)
diff --git a/src/templates/entrees_provisoires.tpl b/src/templates/sorties.tpl similarity index 63% rename from src/templates/entrees_provisoires.tpl rename to src/templates/sorties.tpl index 1c6b217..a458237 100644 --- a/src/templates/entrees_provisoires.tpl +++ b/src/templates/sorties.tpl @@ -1,5 +1,5 @@ {include file="admin/_head.tpl" title="%s"|args:$plugin.nom current="plugin_%s"|args:$plugin.id} -{include file="%s_nav.tpl"|args:$plugin_tpl current="entrees_provisoires"} +{include file="%s_nav.tpl"|args:$plugin_tpl current="sorties"} {include file="admin/_foot.tpl"} diff --git a/src/templates/sorties_definitives.tpl b/src/templates/sorties_definitives.tpl deleted file mode 100644 index 3aaee83..0000000 --- a/src/templates/sorties_definitives.tpl +++ /dev/null @@ -1,5 +0,0 @@ -{include file="admin/_head.tpl" title="%s"|args:$plugin.nom current="plugin_%s"|args:$plugin.id} - -{include file="%s_nav.tpl"|args:$plugin_tpl current="sorties_definitives"} - -{include file="admin/_foot.tpl"} diff --git a/src/templates/sorties_provisoires.tpl b/src/templates/sorties_provisoires.tpl deleted file mode 100644 index 6f8b5ff..0000000 --- a/src/templates/sorties_provisoires.tpl +++ /dev/null @@ -1,5 +0,0 @@ -{include file="admin/_head.tpl" title="%s"|args:$plugin.nom current="plugin_%s"|args:$plugin.id} - -{include file="%s_nav.tpl"|args:$plugin_tpl current="sorties_provisoires"} - -{include file="admin/_foot.tpl"} diff --git a/src/www/admin/entrees/definitives/deja_repertorie.php b/src/www/admin/entrees/definitives/deja_repertorie.php deleted file mode 100644 index 1d028d1..0000000 --- a/src/www/admin/entrees/definitives/deja_repertorie.php +++ /dev/null @@ -1,7 +0,0 @@ -display(PLUGIN_ROOT . '/templates/entrees/definitives/deja_repertorie.tpl'); diff --git a/src/www/admin/entrees/deja_repertorie.php b/src/www/admin/entrees/deja_repertorie.php new file mode 100644 index 0000000..dea103d --- /dev/null +++ b/src/www/admin/entrees/deja_repertorie.php @@ -0,0 +1,7 @@ +display(PLUGIN_ROOT . '/templates/entrees/deja_repertorie.tpl'); diff --git a/src/www/admin/entrees/definitives/index.php b/src/www/admin/entrees/index.php similarity index 73% rename from src/www/admin/entrees/definitives/index.php rename to src/www/admin/entrees/index.php index db76ecb..f0b8989 100644 --- a/src/www/admin/entrees/definitives/index.php +++ b/src/www/admin/entrees/index.php @@ -5,7 +5,7 @@ namespace Garradin; use Garradin\Plugin\Materiels\Equipment; use Garradin\Plugin\Materiels\Entry; -require_once __DIR__ . '/../../_inc.php'; +require_once __DIR__ . '/../_inc.php'; $eqmt = new Equipment; $entry = new Entry; @@ -18,4 +18,4 @@ foreach ($entries as $key => $value) { $tpl->assign(compact('entries')); -$tpl->display(PLUGIN_ROOT . '/templates/entrees/definitives/index.tpl'); +$tpl->display(PLUGIN_ROOT . '/templates/entrees/index.tpl'); diff --git a/src/www/admin/entrees/definitives/non_repertorie.php b/src/www/admin/entrees/non_repertorie.php similarity index 85% rename from src/www/admin/entrees/definitives/non_repertorie.php rename to src/www/admin/entrees/non_repertorie.php index bc57deb..beb1969 100644 --- a/src/www/admin/entrees/definitives/non_repertorie.php +++ b/src/www/admin/entrees/non_repertorie.php @@ -7,7 +7,7 @@ use Garradin\Plugin\Materiels\Category; use Garradin\Plugin\Materiels\Equipment; use Garradin\Utils; -require_once __DIR__ . '/../../_inc.php'; +require_once __DIR__ . '/../_inc.php'; $entry = new Entry; $kinds = $entry->listKinds(); @@ -48,7 +48,7 @@ if (f('save')) 'equipment_id' => $eqmt_id, 'date_of_entry' => f('date_entree'), ]); - Utils::redirect(PLUGIN_URL . 'entrees/definitives/index.php'); + Utils::redirect(PLUGIN_URL . 'entrees/index.php'); } catch (\RuntimeException $e) { @@ -63,8 +63,8 @@ if (f('save')) } } -$cancel_link = PLUGIN_URL . 'entrees/definitives/index.php'; +$cancel_link = PLUGIN_URL . 'entrees/index.php'; $tpl->assign(compact('kinds', 'date', 'cats', 'selected_kind', 'default_date', 'default_number', 'selected_cat', 'cancel_link', 'csrf_key')); -$tpl->display(PLUGIN_ROOT . '/templates/entrees/definitives/non_repertorie.tpl'); +$tpl->display(PLUGIN_ROOT . '/templates/entrees/non_repertorie.tpl'); diff --git a/src/www/admin/entrees_provisoires.php b/src/www/admin/entrees_provisoires.php deleted file mode 100644 index a329be4..0000000 --- a/src/www/admin/entrees_provisoires.php +++ /dev/null @@ -1,7 +0,0 @@ -display(PLUGIN_ROOT . '/templates/entrees_provisoires.tpl'); diff --git a/src/www/admin/sorties.php b/src/www/admin/sorties.php new file mode 100644 index 0000000..166bb15 --- /dev/null +++ b/src/www/admin/sorties.php @@ -0,0 +1,7 @@ +display(PLUGIN_ROOT . '/templates/sorties.tpl'); diff --git a/src/www/admin/sorties_definitives.php b/src/www/admin/sorties_definitives.php deleted file mode 100644 index 359f80d..0000000 --- a/src/www/admin/sorties_definitives.php +++ /dev/null @@ -1,7 +0,0 @@ -display(PLUGIN_ROOT . '/templates/sorties_definitives.tpl'); diff --git a/src/www/admin/sorties_provisoires.php b/src/www/admin/sorties_provisoires.php deleted file mode 100644 index 77ba811..0000000 --- a/src/www/admin/sorties_provisoires.php +++ /dev/null @@ -1,7 +0,0 @@ -display(PLUGIN_ROOT . '/templates/sorties_provisoires.tpl');