Add the basic files for a garradin extension
This commit is contained in:
parent
cf4c1e2dd1
commit
c757583136
15
README.md
15
README.md
@ -1,3 +1,14 @@
|
|||||||
# garradin-plugin-materiels
|
# Plugin Materiels pour Garradin
|
||||||
|
|
||||||
Plugin de gestion des matériels pour le logiciel de gestion d'association Garradin ( https://garradin.eu/ ).
|
Cette extension permet de gérer les matériels de l'association: stock, entrées, sorties, valorisation.
|
||||||
|
|
||||||
|
# Installation
|
||||||
|
|
||||||
|
- Télécharger le fichier materiels.tar.gz et l'ajouter dans le répertoire garradin/plugins.
|
||||||
|
- Installer le plugin via le menu "Configuration > Extensions" de Garradin.
|
||||||
|
|
||||||
|
# Utilisation - Fonctionnalités
|
||||||
|
|
||||||
|
# Droits d'accès
|
||||||
|
|
||||||
|
L'écran est accessible uniquement pour les membres ayant au moins le droit d'écriture en gestion des membres.
|
||||||
|
9
garradin_plugin.ini
Normal file
9
garradin_plugin.ini
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
nom="Gestion des matériels"
|
||||||
|
description="Gestion des matériels: stock, entrées, sorties, valorisation."
|
||||||
|
auteur="JBthePenguin"
|
||||||
|
url="https://gitlab.com/JBthePenguin"
|
||||||
|
version="1.1"
|
||||||
|
menu=1
|
||||||
|
menu_condition="{$user.perm_users} >= {ACCESS_WRITE}"
|
||||||
|
config=0
|
||||||
|
min_version="1.1.6"
|
0
install.php
Normal file
0
install.php
Normal file
20
templates/config.tpl
Normal file
20
templates/config.tpl
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
{include file="admin/_head.tpl" title="Configuration — %s"|args:$plugin.nom current="plugin_%s"|args:$plugin.id}
|
||||||
|
|
||||||
|
{form_errors}
|
||||||
|
|
||||||
|
<form method="post" action="{$self_url}">
|
||||||
|
|
||||||
|
<fieldset>
|
||||||
|
<legend>Configuration</legend>
|
||||||
|
<dl>
|
||||||
|
{input type="checkbox" name="display_hello" value="1" default=$plugin.config label="Afficher un message de coucou"}
|
||||||
|
</dl>
|
||||||
|
</fieldset>
|
||||||
|
|
||||||
|
<p class="submit">
|
||||||
|
{csrf_field key="config_plugin_%s"|args:$plugin.id}
|
||||||
|
{button type="submit" class="main" name="save" label="Enregistrer" shape="right"}
|
||||||
|
</p>
|
||||||
|
</form>
|
||||||
|
|
||||||
|
{include file="admin/_foot.tpl"}
|
12
templates/index.tpl
Normal file
12
templates/index.tpl
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
{include file="admin/_head.tpl" title="Extension — %s"|args:$plugin.nom current="plugin_%s"|args:$plugin.id}
|
||||||
|
|
||||||
|
<p class="alert block">Gestion du materiel de l'association</p>
|
||||||
|
|
||||||
|
{if $plugin.config.display_hello}
|
||||||
|
<h3>L'affichage du message de bienvenue est activé</h3>
|
||||||
|
{else}
|
||||||
|
<h3>L'affichage du message de bienvenue est désactivé !</h3>
|
||||||
|
{/if}
|
||||||
|
|
||||||
|
|
||||||
|
{include file="admin/_foot.tpl"}
|
0
uninstall.php
Normal file
0
uninstall.php
Normal file
26
www/admin/config.php
Normal file
26
www/admin/config.php
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace Garradin;
|
||||||
|
|
||||||
|
$session->requireAccess($session::SECTION_CONFIG, $session::ACCESS_ADMIN);
|
||||||
|
|
||||||
|
if (f('save'))
|
||||||
|
{
|
||||||
|
$form->check('config_plugin_' . $plugin->id(), [
|
||||||
|
'display_hello' => 'boolean',
|
||||||
|
]);
|
||||||
|
|
||||||
|
if (!$form->hasErrors())
|
||||||
|
{
|
||||||
|
try {
|
||||||
|
$plugin->setConfig('display_hello', (bool) f('display_hello'));
|
||||||
|
utils::redirect(utils::plugin_url());
|
||||||
|
}
|
||||||
|
catch (UserException $e)
|
||||||
|
{
|
||||||
|
$form->addError($e->getMessage());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$tpl->display(PLUGIN_ROOT . '/templates/config.tpl');
|
5
www/admin/index.php
Normal file
5
www/admin/index.php
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace Garradin;
|
||||||
|
|
||||||
|
$tpl->display(PLUGIN_ROOT . '/templates/index.tpl');
|
Loading…
Reference in New Issue
Block a user