]> saetta.ns0.it Git - solipa/organigramma/commitdiff
Integrazione con territorio di persona.
authorAndrea Zagli <a.zagli@comune.scandicci.fi.it>
Wed, 28 Nov 2012 09:29:15 +0000 (10:29 +0100)
committerAndrea Zagli <a.zagli@comune.scandicci.fi.it>
Wed, 28 Nov 2012 09:29:15 +0000 (10:29 +0100)
Controllo codice fiscale di persona.
Aggiustamenti vari alle definizioni dei form.

15 files changed:
data/organigramma/form/persona_ufficio.form
data/organigramma/form/profilo_professionale.form
data/organigramma/form/struttura.form
data/organigramma/form/tipo_nodo.form
data/organigramma/form/tipo_prestazione.form
data/organigramma/form/tipo_rapporto_lavoro.form
data/organigramma/form/tipo_recapito.form
data/organigramma/form/titolo.form
data/organigramma/form/ufficio.form
data/organigramma/form/ufficio_orario.form
data/organigramma/form/ufficio_recapito.form
data/organigramma/form/ufficio_stanza.form
src/persona.c
src/struttura.c
src/ufficio.c

index 0dc2831b53baf4336e7fc13fd13e69088d3c13ca..410ed4fc76d31969da31fbefa33d51698110a97e 100644 (file)
@@ -37,6 +37,7 @@
                <field type="datetime" name="da_data">
                        <datetime-type>date</datetime-type>
                        <display-format>%d/%m/%Y</display-format>
+                       <obligatory>t</obligatory>
                </field>
        </widget>
 
index ece44670b672f578f0f1c2f919115e10b593cd25..fbdf9f4324b9a1bee9598f9942cd34f9e82f4e8a 100644 (file)
@@ -11,7 +11,9 @@
        </widget>
 
        <widget type="entry" name="entry42" label="label159">
-               <field type="text" name="nome" />
+               <field type="text" name="nome">
+                       <obligatory>t</obligatory>
+               </field>
        </widget>
 
 </gtkform>
index a3b6523608bbb9bcc1857a6190720bbdcc6bf9d3..b043305c5b232b4f25ccd2560d98b62c832d0704 100644 (file)
@@ -11,7 +11,9 @@
        </widget>
 
        <widget type="entry" name="entry8" label="label27">
-               <field type="text" name="nome" />
+               <field type="text" name="nome">
+                       <obligatory>t</obligatory>
+               </field>
        </widget>
 
        <widget type="textview" name="textview3" label="label28">
index 4aef8b0568635eed6d2dd77b062f47b5767431d9..8ecaae98a127f74b08f02ea4084c63e236d88917 100644 (file)
@@ -11,7 +11,9 @@
        </widget>
 
        <widget type="entry" name="entry3" label="label8">
-               <field type="text" name="nome" />
+               <field type="text" name="nome">
+                       <obligatory>t</obligatory>
+               </field>
        </widget>
 
 </gtkform>
index b1facfec579a350dafc8e27a6d01a42b5447e123..9f07dd648b18699a9502042649be71d3301b1035 100644 (file)
@@ -11,7 +11,9 @@
        </widget>
 
        <widget type="entry" name="entry41" label="label155">
-               <field type="text" name="nome" />
+               <field type="text" name="nome">
+                       <obligatory>t</obligatory>
+               </field>
        </widget>
 
 </gtkform>
index 0f14e9752fd14a3f5b35a512133d6914c122df2e..ceb42dfd75621fc97eaf13e561b3979f019636b3 100644 (file)
@@ -11,7 +11,9 @@
        </widget>
 
        <widget type="entry" name="entry40" label="label147">
-               <field type="text" name="nome" />
+               <field type="text" name="nome">
+                       <obligatory>t</obligatory>
+               </field>
        </widget>
 
 </gtkform>
index e5a3cb51b00e78c17f9b1d62d88a4d330f591208..5d743af15e343d6417424caee601ef3458889ce1 100644 (file)
@@ -11,7 +11,9 @@
        </widget>
 
        <widget type="entry" name="entry4" label="label14">
-               <field type="text" name="nome" />
+               <field type="text" name="nome">
+                       <obligatory>t</obligatory>
+               </field>
        </widget>
 
 </gtkform>
index 186747e98557ef2a7be714b1082507edf7ad6a25..fea144b309eb82cefc5a3e3eacf3bfb143ae8849 100644 (file)
        </widget>
 
        <widget type="entry" name="entry37" label="label138">
-               <field type="text" name="sigla" />
+               <field type="text" name="sigla">
+                       <obligatory>t</obligatory>
+               </field>
        </widget>
 
        <widget type="entry" name="entry38" label="label142">
-               <field type="text" name="descrizione" />
+               <field type="text" name="descrizione">
+                       <obligatory>t</obligatory>
+               </field>
        </widget>
 
 </gtkform>
index ae4d76bde274d437804fbf44a1bce62c0eadb272..d2ab8176c282ca3f55dfba65bc7723a5ea137f35 100644 (file)
                        </sql>
                </on-change>
                <field type="integer" name="id_strutture">
+                       <obligatory>t</obligatory>
                </field>
        </widget>
 
        <widget type="entry" name="entry5" label="label19">
-               <field type="text" name="nome" />
+               <field type="text" name="nome">
+                       <obligatory>t</obligatory>
+               </field>
        </widget>
 
        <widget type="textview" name="textview2" label="label20">
index a02ff04f47fb20ecc29de71f0e84c9b4da0626bb..4291a8e4982abcc43d4d990b00c7780f1e230bdc 100644 (file)
@@ -16,7 +16,9 @@
        </widget>
 
        <widget type="textview" name="textview7" label="label50">
-               <field type="text" name="descrizione" />
+               <field type="text" name="descrizione">
+                       <obligatory>t</obligatory>
+               </field>
        </widget>
 
        <widget type="entry" name="entry15" label="label79">
index 96f41a186a95b4454075e0e20cec9a56b6730467..034a86d17147a90f47be753e3a528a7ea541fd66 100644 (file)
@@ -26,7 +26,9 @@
        </widget>
 
        <widget type="entry" name="entry6" label="label40">
-               <field type="text" name="recapito" />
+               <field type="text" name="recapito">
+                       <obligatory>t</obligatory>
+               </field>
        </widget>
 
        <widget type="textview" name="textview5" label="label34">
index 3dd2736a20c29f22c061f553a13e85a336c860fc..c968435ccfc4c1f354007d76f7939662fb25018c 100644 (file)
 
        <widget type="entry" name="entry44" label="label165">
                <field type="text" name="piano">
+                       <obligatory>t</obligatory>
                </field>
        </widget>
 
        <widget type="entry" name="entry43" label="label161">
                <field type="text" name="da_stanza">
+                       <obligatory>t</obligatory>
                </field>
        </widget>
 
        <widget type="entry" name="entry45" label="label162">
                <field type="text" name="a_stanza">
+                       <obligatory>t</obligatory>
                </field>
        </widget>
 
index ce7baa0a040bfbbfb9c3567232b0284eb5ff4840..f812ee6b0587c219ec292c3b2a2846374d2d06a6 100644 (file)
@@ -19,6 +19,9 @@
 
 #include <libgtkform/form.h>
 #include <libgtkform/fielddatetime.h>
+#include <libsolipa/utils.h>
+
+#include <libterritorio/comuni.h>
 
 #include "persona.h"
 #include "personaincarico.h"
@@ -66,10 +69,15 @@ static void organigramma_persona_on_ufficio_aggiornato (gpointer instance, gpoin
 static void organigramma_persona_on_ufficio_recapito_aggiornato (gpointer instance, gpointer user_data);
 static void organigramma_persona_on_recapito_aggiornato (gpointer instance, gpointer user_data);
 
+static void organigramma_persona_on_comune_selezionato (gpointer instance, guint id, gpointer user_data);
+
 static gboolean organigramma_persona_on_w_organigramma_persona_delete_event (GtkWidget *widget,
                                GdkEvent *event,
                                gpointer user_data);
 
+static void organigramma_persona_on_btn_ricerca_comune_clicked (GtkButton *button,
+                                    gpointer user_data);
+
 static void organigramma_persona_on_btn_incarico_nuovo_clicked (GtkButton *button,
                                     gpointer user_data);
 static void organigramma_persona_on_btn_incarico_modifica_clicked (GtkButton *button,
@@ -327,64 +335,69 @@ OrganigrammaPersona
        g_signal_connect (priv->sel_uffici,
                          "changed", G_CALLBACK (organigramma_persona_on_uffici_sel_changed), (gpointer)a);
 
+       g_signal_connect (G_OBJECT (gtk_builder_get_object (priv->commons->gtkbuilder, "button89")),
+                         "clicked", G_CALLBACK (organigramma_persona_on_btn_ricerca_comune_clicked), (gpointer)a);
+
        g_signal_connect (G_OBJECT (gtk_builder_get_object (priv->commons->gtkbuilder, "button79")),
-                         "clicked", G_CALLBACK (organigramma_persona_on_btn_incarico_nuovo_clicked), (gpointer *)a);
+                         "clicked", G_CALLBACK (organigramma_persona_on_btn_incarico_nuovo_clicked), (gpointer)a);
        g_signal_connect (G_OBJECT (gtk_builder_get_object (priv->commons->gtkbuilder, "button80")),
-                         "clicked", G_CALLBACK (organigramma_persona_on_btn_incarico_modifica_clicked), (gpointer *)a);
+                         "clicked", G_CALLBACK (organigramma_persona_on_btn_incarico_modifica_clicked), (gpointer)a);
        g_signal_connect (G_OBJECT (gtk_builder_get_object (priv->commons->gtkbuilder, "button81")),
-                         "clicked", G_CALLBACK (organigramma_persona_on_btn_incarico_elimina_clicked), (gpointer *)a);
+                         "clicked", G_CALLBACK (organigramma_persona_on_btn_incarico_elimina_clicked), (gpointer)a);
        g_signal_connect (G_OBJECT (gtk_builder_get_object (priv->commons->gtkbuilder, "treeview16")),
-                         "row-activated", G_CALLBACK (organigramma_persona_on_trv_incarichi_row_activated), (gpointer *)a);
+                         "row-activated", G_CALLBACK (organigramma_persona_on_trv_incarichi_row_activated), (gpointer)a);
 
        g_signal_connect (G_OBJECT (gtk_builder_get_object (priv->commons->gtkbuilder, "button70")),
-                         "clicked", G_CALLBACK (organigramma_persona_on_btn_nodo_nuovo_clicked), (gpointer *)a);
+                         "clicked", G_CALLBACK (organigramma_persona_on_btn_nodo_nuovo_clicked), (gpointer)a);
        g_signal_connect (G_OBJECT (gtk_builder_get_object (priv->commons->gtkbuilder, "button71")),
-                         "clicked", G_CALLBACK (organigramma_persona_on_btn_nodo_modifica_clicked), (gpointer *)a);
+                         "clicked", G_CALLBACK (organigramma_persona_on_btn_nodo_modifica_clicked), (gpointer)a);
        g_signal_connect (G_OBJECT (gtk_builder_get_object (priv->commons->gtkbuilder, "button72")),
-                         "clicked", G_CALLBACK (organigramma_persona_on_btn_nodo_elimina_clicked), (gpointer *)a);
+                         "clicked", G_CALLBACK (organigramma_persona_on_btn_nodo_elimina_clicked), (gpointer)a);
        g_signal_connect (G_OBJECT (gtk_builder_get_object (priv->commons->gtkbuilder, "treeview13")),
-                         "row-activated", G_CALLBACK (organigramma_persona_on_trv_nodi_row_activated), (gpointer *)a);
+                         "row-activated", G_CALLBACK (organigramma_persona_on_trv_nodi_row_activated), (gpointer)a);
 
        g_signal_connect (G_OBJECT (gtk_builder_get_object (priv->commons->gtkbuilder, "button73")),
-                         "clicked", G_CALLBACK (organigramma_persona_on_btn_nodo_recapito_nuovo_clicked), (gpointer *)a);
+                         "clicked", G_CALLBACK (organigramma_persona_on_btn_nodo_recapito_nuovo_clicked), (gpointer)a);
        g_signal_connect (G_OBJECT (gtk_builder_get_object (priv->commons->gtkbuilder, "button74")),
-                         "clicked", G_CALLBACK (organigramma_persona_on_btn_nodo_recapito_modifica_clicked), (gpointer *)a);
+                         "clicked", G_CALLBACK (organigramma_persona_on_btn_nodo_recapito_modifica_clicked), (gpointer)a);
        g_signal_connect (G_OBJECT (gtk_builder_get_object (priv->commons->gtkbuilder, "button75")),
-                         "clicked", G_CALLBACK (organigramma_persona_on_btn_nodo_recapito_elimina_clicked), (gpointer *)a);
+                         "clicked", G_CALLBACK (organigramma_persona_on_btn_nodo_recapito_elimina_clicked), (gpointer)a);
        g_signal_connect (G_OBJECT (gtk_builder_get_object (priv->commons->gtkbuilder, "treeview14")),
-                         "row-activated", G_CALLBACK (organigramma_persona_on_trv_nodo_recapiti_row_activated), (gpointer *)a);
+                         "row-activated", G_CALLBACK (organigramma_persona_on_trv_nodo_recapiti_row_activated), (gpointer)a);
 
        g_signal_connect (G_OBJECT (gtk_builder_get_object (priv->commons->gtkbuilder, "button62")),
-                         "clicked", G_CALLBACK (organigramma_persona_on_btn_ufficio_nuovo_clicked), (gpointer *)a);
+                         "clicked", G_CALLBACK (organigramma_persona_on_btn_ufficio_nuovo_clicked), (gpointer)a);
        g_signal_connect (G_OBJECT (gtk_builder_get_object (priv->commons->gtkbuilder, "button63")),
-                         "clicked", G_CALLBACK (organigramma_persona_on_btn_ufficio_modifica_clicked), (gpointer *)a);
+                         "clicked", G_CALLBACK (organigramma_persona_on_btn_ufficio_modifica_clicked), (gpointer)a);
        g_signal_connect (G_OBJECT (gtk_builder_get_object (priv->commons->gtkbuilder, "button64")),
-                         "clicked", G_CALLBACK (organigramma_persona_on_btn_ufficio_elimina_clicked), (gpointer *)a);
+                         "clicked", G_CALLBACK (organigramma_persona_on_btn_ufficio_elimina_clicked), (gpointer)a);
        g_signal_connect (G_OBJECT (gtk_builder_get_object (priv->commons->gtkbuilder, "treeview11")),
-                         "row-activated", G_CALLBACK (organigramma_persona_on_trv_uffici_row_activated), (gpointer *)a);
+                         "row-activated", G_CALLBACK (organigramma_persona_on_trv_uffici_row_activated), (gpointer)a);
 
        g_signal_connect (G_OBJECT (gtk_builder_get_object (priv->commons->gtkbuilder, "button67")),
-                         "clicked", G_CALLBACK (organigramma_persona_on_btn_ufficio_recapito_nuovo_clicked), (gpointer *)a);
+                         "clicked", G_CALLBACK (organigramma_persona_on_btn_ufficio_recapito_nuovo_clicked), (gpointer)a);
        g_signal_connect (G_OBJECT (gtk_builder_get_object (priv->commons->gtkbuilder, "button68")),
-                         "clicked", G_CALLBACK (organigramma_persona_on_btn_ufficio_recapito_modifica_clicked), (gpointer *)a);
+                         "clicked", G_CALLBACK (organigramma_persona_on_btn_ufficio_recapito_modifica_clicked), (gpointer)a);
        g_signal_connect (G_OBJECT (gtk_builder_get_object (priv->commons->gtkbuilder, "button69")),
-                         "clicked", G_CALLBACK (organigramma_persona_on_btn_ufficio_recapito_elimina_clicked), (gpointer *)a);
+                         "clicked", G_CALLBACK (organigramma_persona_on_btn_ufficio_recapito_elimina_clicked), (gpointer)a);
        g_signal_connect (G_OBJECT (gtk_builder_get_object (priv->commons->gtkbuilder, "treeview12")),
-                         "row-activated", G_CALLBACK (organigramma_persona_on_trv_ufficio_recapiti_row_activated), (gpointer *)a);
+                         "row-activated", G_CALLBACK (organigramma_persona_on_trv_ufficio_recapiti_row_activated), (gpointer)a);
 
        g_signal_connect (G_OBJECT (gtk_builder_get_object (priv->commons->gtkbuilder, "button76")),
-                         "clicked", G_CALLBACK (organigramma_persona_on_btn_recapito_nuovo_clicked), (gpointer *)a);
+                         "clicked", G_CALLBACK (organigramma_persona_on_btn_recapito_nuovo_clicked), (gpointer)a);
        g_signal_connect (G_OBJECT (gtk_builder_get_object (priv->commons->gtkbuilder, "button77")),
-                         "clicked", G_CALLBACK (organigramma_persona_on_btn_recapito_modifica_clicked), (gpointer *)a);
+                         "clicked", G_CALLBACK (organigramma_persona_on_btn_recapito_modifica_clicked), (gpointer)a);
        g_signal_connect (G_OBJECT (gtk_builder_get_object (priv->commons->gtkbuilder, "button78")),
-                         "clicked", G_CALLBACK (organigramma_persona_on_btn_recapito_elimina_clicked), (gpointer *)a);
+                         "clicked", G_CALLBACK (organigramma_persona_on_btn_recapito_elimina_clicked), (gpointer)a);
        g_signal_connect (G_OBJECT (gtk_builder_get_object (priv->commons->gtkbuilder, "treeview15")),
-                         "row-activated", G_CALLBACK (organigramma_persona_on_trv_recapiti_row_activated), (gpointer *)a);
+                         "row-activated", G_CALLBACK (organigramma_persona_on_trv_recapiti_row_activated), (gpointer)a);
 
        g_signal_connect (gtk_builder_get_object (priv->commons->gtkbuilder, "button65"),
-                         "clicked", G_CALLBACK (organigramma_persona_on_btn_annulla_clicked), (gpointer *)a);
+                         "clicked", G_CALLBACK (organigramma_persona_on_btn_annulla_clicked), (gpointer)a);
        g_signal_connect (gtk_builder_get_object (priv->commons->gtkbuilder, "button66"),
-                         "clicked", G_CALLBACK (organigramma_persona_on_btn_salva_clicked), (gpointer *)a);
+                         "clicked", G_CALLBACK (organigramma_persona_on_btn_salva_clicked), (gpointer)a);
+
+       gtk_form_clear (priv->form);
 
        priv->id = id;
 
@@ -438,13 +451,9 @@ organigramma_persona_carica (OrganigrammaPersona *persona)
 static void
 organigramma_persona_salva (OrganigrammaPersona *persona)
 {
-       GError *error = NULL;
        gchar *sql;
        GtkWidget *dialog;
 
-       GDate *da;
-       GDate *a;
-
        OrganigrammaPersonaClass *klass = ORGANIGRAMMA_PERSONA_GET_CLASS (persona);
 
        OrganigrammaPersonaPrivate *priv = ORGANIGRAMMA_PERSONA_GET_PRIVATE (persona);
@@ -454,6 +463,16 @@ organigramma_persona_salva (OrganigrammaPersona *persona)
                        return;
                }
 
+       if (!solipa_chk_codice_fiscale (gtk_entry_get_text (GTK_ENTRY (gtk_builder_get_object (priv->commons->gtkbuilder, "entry28"))), TRUE))
+               {
+                       solipa_message_dialog (priv->w,
+                                              GTK_MESSAGE_WARNING,
+                                              GTK_BUTTONS_OK,
+                                              "Codice fiscale errato.");
+                       gtk_widget_grab_focus (GTK_WIDGET (gtk_builder_get_object (priv->commons->gtkbuilder, "entry28")));
+                       return;
+               }
+
        if (priv->id == 0)
                {
                        sql = gtk_form_get_sql (priv->form, GTK_FORM_SQL_INSERT);
@@ -1152,6 +1171,16 @@ organigramma_persona_on_recapito_aggiornato (gpointer instance, gpointer user_da
        organigramma_persona_carica_recapiti (persona);
 }
 
+static void
+organigramma_persona_on_comune_selezionato (gpointer instance, guint id, gpointer user_data)
+{
+       OrganigrammaPersona *ia = (OrganigrammaPersona *)user_data;
+
+       OrganigrammaPersonaPrivate *priv = ORGANIGRAMMA_PERSONA_GET_PRIVATE (ia);
+
+       gtk_form_widget_set_value_stringify (gtk_form_get_form_widget_from_name (priv->form, "label110"), g_strdup_printf ("%d", id));
+}
+
 static gboolean
 organigramma_persona_on_w_organigramma_persona_delete_event (GtkWidget *widget,
                                GdkEvent *event,
@@ -1160,6 +1189,25 @@ organigramma_persona_on_w_organigramma_persona_delete_event (GtkWidget *widget,
        return !organigramma_persona_conferma_chiusura ((OrganigrammaPersona *)user_data);
 }
 
+static void
+organigramma_persona_on_btn_ricerca_comune_clicked (GtkButton *button,
+                                    gpointer user_data)
+{
+       GtkWidget *w;
+
+       OrganigrammaPersona *ia = (OrganigrammaPersona *)user_data;
+       OrganigrammaPersonaPrivate *priv = ORGANIGRAMMA_PERSONA_GET_PRIVATE (ia);
+
+       TerritorioComuni *v = territorio_comuni_new (priv->commons->territorio_commons, TRUE);
+
+       g_signal_connect (G_OBJECT (v), "selezionato",
+                         G_CALLBACK (organigramma_persona_on_comune_selezionato), user_data);
+
+       w = territorio_comuni_get_widget (v);
+       gtk_window_set_transient_for (GTK_WINDOW (w), GTK_WINDOW (priv->w));
+       gtk_widget_show (w);
+}
+
 static void
 organigramma_persona_on_btn_incarico_nuovo_clicked (GtkButton *button,
                                     gpointer user_data)
@@ -1482,7 +1530,7 @@ organigramma_persona_on_btn_ufficio_nuovo_clicked (GtkButton *button,
        OrganigrammaPersonaUfficio *a = organigramma_persona_ufficio_new (priv->commons, 0, priv->id);
 
        g_signal_connect (G_OBJECT (a), "aggiornato",
-                         G_CALLBACK (organigramma_persona_on_ufficio_aggiornato), (gpointer)persona);
+                         G_CALLBACK (organigramma_persona_on_ufficio_aggiornato), user_data);
 
        w = organigramma_persona_ufficio_get_widget (a);
        gtk_window_set_transient_for (GTK_WINDOW (w), GTK_WINDOW (priv->w));
@@ -1597,7 +1645,7 @@ organigramma_persona_on_btn_ufficio_recapito_nuovo_clicked (GtkButton *button,
        OrganigrammaPersonaUfficioRecapito *a = organigramma_persona_ufficio_recapito_new (priv->commons, 0, priv->id, id_uffici);
 
        g_signal_connect (G_OBJECT (a), "aggiornato",
-                         G_CALLBACK (organigramma_persona_on_ufficio_recapito_aggiornato), (gpointer)persona);
+                         G_CALLBACK (organigramma_persona_on_ufficio_recapito_aggiornato), user_data);
 
        w = organigramma_persona_ufficio_recapito_get_widget (a);
        gtk_window_set_transient_for (GTK_WINDOW (w), GTK_WINDOW (priv->w));
@@ -1704,7 +1752,7 @@ organigramma_persona_on_btn_recapito_nuovo_clicked (GtkButton *button,
        OrganigrammaPersonaRecapito *a = organigramma_persona_recapito_new (priv->commons, 0, priv->id);
 
        g_signal_connect (G_OBJECT (a), "aggiornato",
-                         G_CALLBACK (organigramma_persona_on_recapito_aggiornato), (gpointer)persona);
+                         G_CALLBACK (organigramma_persona_on_recapito_aggiornato), user_data);
 
        w = organigramma_persona_recapito_get_widget (a);
        gtk_window_set_transient_for (GTK_WINDOW (w), GTK_WINDOW (priv->w));
index de16ed7197e0887c3806d944c0c13404d5aa68d8..550013e53300c77b7bc16b2506b8762156e4ea11 100644 (file)
@@ -190,6 +190,8 @@ OrganigrammaStruttura
        g_signal_connect (gtk_builder_get_object (priv->commons->gtkbuilder, "button40"),
                          "clicked", G_CALLBACK (organigramma_struttura_on_btn_salva_clicked), (gpointer *)a);
 
+       gtk_form_clear (priv->form);
+
        priv->id = id;
 
        if (priv->id == 0)
index 76e8aaec7ab248fe71543e4c4182a835b1be6dfe..9952bb43514e115c01aaf1e0fc477088082b812b 100644 (file)
@@ -307,6 +307,8 @@ OrganigrammaUfficio
        g_signal_connect (gtk_builder_get_object (priv->commons->gtkbuilder, "button30"),
                          "clicked", G_CALLBACK (organigramma_ufficio_on_btn_salva_clicked), (gpointer *)a);
 
+       gtk_form_clear (priv->form);
+
        priv->id = id;
 
        if (priv->id == 0)