maj de la bdd et debut de form

This commit is contained in:
Christophe 2020-03-30 17:32:01 +02:00
parent 19664bc61d
commit 6949141e7e
7 changed files with 93 additions and 20 deletions

View file

@ -47,6 +47,7 @@ function gamuform_declarer_tables_objets_sql($tables) {
'principale' => 'oui',
'field'=> array(
'id_gamuform' => 'bigint(21) NOT NULL',
'objet' => 'VARCHAR(25) DEFAULT "" NOT NULL',
'titre' => 'varchar(255) NOT NULL DEFAULT ""',
'label' => 'varchar(255) NOT NULL DEFAULT ""',
'type' => 'varchar(255) NOT NULL DEFAULT ""',
@ -61,6 +62,7 @@ function gamuform_declarer_tables_objets_sql($tables) {
),
'key' => array(
'PRIMARY KEY' => 'id_gamuform',
'KEY objet' => 'objet',
'KEY statut' => 'statut',
),
'titre' => 'titre AS titre, "" AS lang',
@ -68,7 +70,7 @@ function gamuform_declarer_tables_objets_sql($tables) {
//'champs_editables' => array('titre'),
//'champs_versionnes' => array('titre'),
//'rechercher_champs' => array(),
'tables_jointures' => array('spip_gamuforms_liens'),
'tables_jointures' => array('spip_gamuforms_valeurs'),
'statut_textes_instituer' => array(
'prepa' => 'texte_statut_en_cours_redaction',
'publie' => 'texte_statut_publie',
@ -101,16 +103,15 @@ function gamuform_declarer_tables_objets_sql($tables) {
*/
function gamuform_declarer_tables_auxiliaires($tables) {
$tables['spip_gamuforms_liens'] = array(
$tables['spip_gamuforms_valeurs'] = array(
'field' => array(
'id_gamuform' => 'bigint(21) DEFAULT "0" NOT NULL',
'id_objet' => 'bigint(21) DEFAULT "0" NOT NULL',
'objet' => 'VARCHAR(25) DEFAULT "" NOT NULL',
'type' => 'VARCHAR(6) DEFAULT "form" NOT NULL',
'valeur' => "text NOT NULL",
),
'key' => array(
'PRIMARY KEY' => 'id_gamuform,id_objet,objet,type',
'PRIMARY KEY' => 'id_gamuform,id_objet,objet',
'KEY id_gamuform' => 'id_gamuform',
)
);

View file

@ -0,0 +1,6 @@
<div class="inner">
<h1>creer formulaire pour les clients</h1>
<INCLURE{fond=inclure/creer_gamuform,objet=app_client,env}>
</div>

View file

@ -9,6 +9,9 @@
<div class="editer-groupe">
</div>
<INCLURE{fond=inclure/gamuform,env,ajax}>
[(#REM) ajouter les saisies supplementaires : extra et autre, a cet endroit ]
<!--extra-->
<p class="boutons"><input type="submit" class="submit" value="<:bouton_enregistrer:>" /></p>

View file

@ -26,7 +26,7 @@ if (!defined('_ECRIRE_INC_VERSION')) {
function gamuform_upgrade($nom_meta_base_version, $version_cible) {
$maj = array();
$maj['create'] = array(array('maj_tables', array('spip_gamuforms', 'spip_gamuforms_liens')));
$maj['create'] = array(array('maj_tables', array('spip_gamuforms', 'spip_gamuforms_valeurs')));
include_spip('base/upgrade');
maj_plugin($nom_meta_base_version, $version_cible, $maj);
@ -43,7 +43,7 @@ function gamuform_upgrade($nom_meta_base_version, $version_cible) {
function gamuform_vider_tables($nom_meta_base_version) {
sql_drop_table('spip_gamuforms');
sql_drop_table('spip_gamuforms_liens');
sql_drop_table('spip_gamuforms_valeurs');
# Nettoyer les liens courants (le génie optimiser_base_disparus se chargera de nettoyer toutes les tables de liens)
sql_delete('spip_documents_liens', sql_in('objet', array('gamuform')));

25
img/add.svg Normal file
View file

@ -0,0 +1,25 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
height="73.199997"
width="73.199997"
id="add"
xml:space="preserve"
viewBox="0 0 73.199997 73.199997"
y="0px"
x="0px"
version="1.1"><metadata
id="metadata18"><rdf:RDF><cc:Work
rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" /><dc:title></dc:title></cc:Work></rdf:RDF></metadata><defs
id="defs16" /><g
transform="translate(-13.4,-13.4)"
id="g6"><path
id="path2"
d="M 50,86.6 C 70.2,86.6 86.6,70.2 86.6,50 86.6,29.8 70.2,13.4 50,13.4 29.8,13.4 13.4,29.8 13.4,50 13.4,70.2 29.8,86.6 50,86.6 Z M 50,19.4 C 66.9,19.4 80.6,33.1 80.6,50 80.6,66.9 66.9,80.6 50,80.6 33.1,80.6 19.4,66.9 19.4,50 19.4,33.1 33.1,19.4 50,19.4 Z" /><path
id="path4"
d="m 33.4,53 h 14 v 14 c 0,1.7 1.3,3 3,3 1.7,0 3,-1.3 3,-3 V 53 h 14 c 1.7,0 3,-1.3 3,-3 0,-1.7 -1.3,-3 -3,-3 h -14 V 33 c 0,-1.7 -1.3,-3 -3,-3 -1.7,0 -3,1.3 -3,3 v 14 h -14 c -1.7,0 -3,1.3 -3,3 0,1.7 1.4,3 3,3 z" /></g></svg>

After

Width:  |  Height:  |  Size: 1.3 KiB

View file

@ -0,0 +1,36 @@
<style type="text/css" media="screen">
#INCLURE{css/icons.css}
.icone {
width: 30px;
}
</style>
objet = #ENV{objet}
<div class="creer_gamuform[ (#ENV{objet})]">
<table>
<thead>
<tr>
<th class="icone">
<a class="ajax nohistory nocache" href="[(#URL_ACTION_AUTEUR{creer_gamuform,#ENV{objet},#SELF})]">
#ICON{plus,icon-lg}
</a>
</th>
<th></th>
<th class="icone">
#ICON{move,icon-lg,Rechercher}
</th>
</tr>
</thead>
<tbody>
<BOUCLE_gamuform(GAMUFORMS){id_objet}{objet}{tout}>
</BOUCLE_gamuform>
</tbody>
<tr>
<td></td>
<td></td>
<td></td>
</tr>
</table>
</div>

2
inclure/gamuform.html Normal file
View file

@ -0,0 +1,2 @@
[<pre>(#ENV**|unserialize|print_r{1})</pre>]