]> saetta.ns0.it Git - solipa/organigramma/commitdiff
Migrazione a libzakform di persona incarico.
authorAndrea Zagli <azagli@libero.it>
Wed, 14 Dec 2016 14:49:08 +0000 (15:49 +0100)
committerAndrea Zagli <azagli@libero.it>
Wed, 14 Dec 2016 14:49:08 +0000 (15:49 +0100)
data/organigramma/form/persona_incarico.form
data/organigramma/gui/organigramma.gui
src/personaincarico.c

index 10bd4d4dd57ca773dfdd1f772781a7cb22440735..b5dc16adb6158ee346cdd193579c07a789667536 100644 (file)
@@ -1,96 +1,75 @@
 <?xml version="1.0"?>
-<gtkform>
-
-       <table>persona_incarichi</table>
-
-       <widget type="label" name="label129">
-               <field type="integer" name="id">
-                       <is-key>t</is-key>
-                       <auto-increment>t</auto-increment>
-               </field>
-       </widget>
-
-       <widget type="label" name="label130">
-               <field type="integer" name="id_persone">
-               </field>
-       </widget>
-
-       <widget type="entry" name="entry34" label="label127">
-               <field type="text" name="matricola">
-               </field>
-       </widget>
-
-       <widget type="decoder" name="gtkformdecoder2" label="label133">
-               <decoder>
-                       <sql>
-                               SELECT a.nome
-                               FROM tipi_rapporto_lavoro AS a
-                               WHERE a.id = ##key0::gint
-                       </sql>
-               </decoder>
-               <field type="integer" name="id_tipi_rapporto_lavoro">
-               </field>
-       </widget>
-
-       <widget type="decoder" name="gtkformdecoder5" label="label134">
-               <decoder>
-                       <sql>
-                               SELECT a.nome
-                               FROM posizioni_economiche AS a
-                               WHERE a.id = ##key0::gint
-                       </sql>
-               </decoder>
-               <field type="integer" name="id_posizioni_economiche">
-               </field>
-       </widget>
-
-       <widget type="decoder" name="gtkformdecoder4" label="label135">
-               <decoder>
-                       <sql>
-                               SELECT a.nome
-                               FROM tipi_prestazione AS a
-                               WHERE a.id = ##key0::gint
-                       </sql>
-               </decoder>
-               <field type="integer" name="id_tipi_prestazione">
-               </field>
-       </widget>
-
-       <widget type="decoder" name="gtkformdecoder3" label="label136">
-               <decoder>
-                       <sql>
-                               SELECT a.nome
-                               FROM profili_professionali AS a
-                               WHERE a.id = ##key0::gint
-                       </sql>
-               </decoder>
-               <field type="integer" name="id_profili_professionali">
-               </field>
-       </widget>
-
-       <widget type="entry" name="entry35" label="label131">
-               <field type="datetime" name="da_data">
-                       <datetime-type>date</datetime-type>
-                       <display-format>%d/%m/%Y</display-format>
-                       <obligatory>t</obligatory>
-               </field>
-       </widget>
-
-       <widget type="entry" name="entry36" label="label132">
-               <field type="datetime" name="a_data">
-                       <datetime-type>date</datetime-type>
-                       <display-format>%d/%m/%Y</display-format>
-               </field>
-       </widget>
-
-       <widget type="textview" name="textview15" label="label144">
-               <field type="text" name="descrizione">
-                       <obligatory>t</obligatory>
-               </field>
-       </widget>
-
-       <widget type="textview" name="textview14" label="label128">
-               <field type="text" name="note" />
-       </widget>
-
-</gtkform>
+<zakform>
+  <element type="zak_form_gtk_form_element_label">
+    <name>id</name>
+    <type>integer</type>
+    <is-key>TRUE</is-key>
+    <widget>label129</widget>
+  </element>
+  <element type="zak_form_gtk_form_element_label">
+    <name>id_persone</name>
+    <type>integer</type>
+    <widget>label130</widget>
+  </element>
+  <element type="zak_form_gtk_form_element_entry">
+    <name>matricola</name>
+    <type>string</type>
+    <label>label127</label>
+    <widget>entry34</widget>
+  </element>
+  <element type="zak_form_gtk_form_element_decoder">
+    <name>id_tipi_rapporto_lavoro</name>
+    <type>integer</type>
+    <label>label133</label>
+    <widget>zakgtkdecoder11</widget>
+  </element>
+  <element type="zak_form_gtk_form_element_decoder">
+    <name>id_posizioni_economiche</name>
+    <type>integer</type>
+    <label>label134</label>
+    <widget>zakgtkdecoder12</widget>
+  </element>
+  <element type="zak_form_gtk_form_element_decoder">
+    <name>id_tipi_prestazione</name>
+    <type>integer</type>
+    <label>label135</label>
+    <widget>zakgtkdecoder13</widget>
+  </element>
+  <element type="zak_form_gtk_form_element_decoder">
+    <name>id_profili_professionali</name>
+    <type>integer</type>
+    <label>label136</label>
+    <widget>zakgtkdecoder14</widget>
+  </element>
+  <element type="zak_form_gtk_form_element_entry">
+    <name>da_data</name>
+    <type>datetime</type>
+    <label>label131</label>
+    <widget>entry35</widget>
+    <format>%d/%m/%Y</format>
+    <validator type="zak_form_element_validator_notempty"/>
+    <validator type="zak_form_element_validator_date">%d/%m/%Y</validator>
+  </element>
+  <element type="zak_form_gtk_form_element_entry">
+    <name>a_data</name>
+    <type>datetime</type>
+    <label>label132</label>
+    <widget>entry36</widget>
+    <format>%d/%m/%Y</format>
+    <validator type="zak_form_element_validator_date">%d/%m/%Y</validator>
+  </element>
+  <element type="zak_form_gtk_form_element_textview">
+    <name>descrizione</name>
+    <type>string</type>
+    <label>label144</label>
+    <widget>textview15</widget>
+    <validator type="zak_form_element_validator_notempty"/>
+  </element>
+  <element type="zak_form_gtk_form_element_textview">
+    <name>note</name>
+    <type>string</type>
+    <label>label128</label>
+    <widget>textview14</widget>
+  </element>
+  <validator type="zak_form_validator_compare_date" type_comp="lt" element1="da_data" format1="%d/%m/%Y" element2="a_data" format2="%d/%m/%Y"></validator>
+</zakform>
index d9e9d50671c82175667f65eff9853e7e0b955d0f..1f30c99950b3c244145eeb181e95a4cb86f491ee 100644 (file)
               </packing>
             </child>
             <child>
-              <object class="GtkFormDecoder" id="gtkformdecoder2">
+              <object class="ZakGtkDecoder" id="zakgtkdecoder11">
                 <property name="visible">True</property>
                 <property name="can_focus">False</property>
+                <property name="show_btn_clean">True</property>
               </object>
               <packing>
                 <property name="left_attach">1</property>
               </packing>
             </child>
             <child>
-              <object class="GtkFormDecoder" id="gtkformdecoder3">
+              <object class="ZakGtkDecoder" id="zakgtkdecoder12">
                 <property name="visible">True</property>
                 <property name="can_focus">False</property>
+                <property name="show_btn_clean">True</property>
               </object>
               <packing>
                 <property name="left_attach">1</property>
-                <property name="top_attach">4</property>
+                <property name="top_attach">2</property>
               </packing>
             </child>
             <child>
-              <object class="GtkFormDecoder" id="gtkformdecoder4">
+              <object class="ZakGtkDecoder" id="zakgtkdecoder13">
                 <property name="visible">True</property>
                 <property name="can_focus">False</property>
+                <property name="show_btn_clean">True</property>
               </object>
               <packing>
                 <property name="left_attach">1</property>
               </packing>
             </child>
             <child>
-              <object class="GtkFormDecoder" id="gtkformdecoder5">
+              <object class="ZakGtkDecoder" id="zakgtkdecoder14">
                 <property name="visible">True</property>
                 <property name="can_focus">False</property>
+                <property name="show_btn_clean">True</property>
               </object>
               <packing>
                 <property name="left_attach">1</property>
-                <property name="top_attach">2</property>
+                <property name="top_attach">4</property>
               </packing>
             </child>
           </object>
index f3568781e5c07f2df829d7d67e57968196bf05d8..de16efea547f8409fca3ca414ac9859bc6f6aa70 100644 (file)
 #include <glib/gprintf.h>
 
 #include <libzakautho/autoz.h>
-#include <libgtkform/form.h>
-#include <libgtkformui/gtkformdecoder.h>
+#include <libzakgtkdecoder/libzakgtkdecoder.h>
+#include <libzakform/libzakform.h>
+#include <libzakformgtk/libzakformgtk.h>
+#include <libzakformgdaex/libzakformgdaex.h>
+#include <libzakformgtkdecoder/libzakformgtkdecoder.h>
 #include <libsolipa/utils.h>
 
 #include "personaincarico.h"
@@ -60,6 +63,10 @@ static void organigramma_persona_incarico_on_tipo_rapporto_lavoro_selezionato (g
 static void organigramma_persona_incarico_on_posizione_economica_selezionato (gpointer instance, guint id, gpointer user_data);
 static void organigramma_persona_incarico_on_tipo_prestazione_selezionato (gpointer instance, guint id, gpointer user_data);
 static void organigramma_persona_incarico_on_profilo_professionale_selezionato (gpointer instance, guint id, gpointer user_data);
+static gchar *organigramma_persona_incarico_on_tipo_rapporto_lavoro_decode (gpointer instance, gchar *key, gpointer user_data);
+static gchar *organigramma_persona_incarico_on_posizione_economica_decode (gpointer instance, gchar *key, gpointer user_data);
+static gchar *organigramma_persona_incarico_on_tipo_prestazione_decode (gpointer instance, gchar *key, gpointer user_data);
+static gchar *organigramma_persona_incarico_on_profilo_professionale_decode (gpointer instance, gchar *key, gpointer user_data);
 
 static void organigramma_persona_incarico_on_btn_ricerca_tipo_rapporto_lavoro_clicked (GtkButton *button,
                                     gpointer user_data);
@@ -91,7 +98,8 @@ struct _OrganigrammaPersonaIncaricoPrivate
        {
                OrganigrammaCommons *commons;
 
-               GtkForm *form;
+               ZakFormGtkForm *form;
+               ZakFormGdaexProvider *form_provider;
 
                GtkWidget *w;
 
@@ -165,13 +173,15 @@ OrganigrammaPersonaIncarico
                        return NULL;
                }
 
-       priv->form = gtk_form_new ();
-       g_object_set (G_OBJECT (priv->form), "gdaex", priv->commons->gdaex, NULL);
-       gtk_form_load_from_file (priv->form, g_build_filename (priv->commons->formdir, "persona_incarico.form", NULL), priv->commons->gtkbuilder);
+       priv->form = zak_form_gtk_form_new ();
+       zak_form_gtk_form_set_gtkbuilder (priv->form, priv->commons->gtkbuilder);
+       zak_form_form_load_from_file (ZAK_FORM_FORM (priv->form), g_build_filename (priv->commons->formdir, "persona_incarico.form", NULL));
+
+       priv->form_provider = zak_form_gdaex_provider_new (priv->commons->gdaex, "persona_incarichi");
 
        priv->w = GTK_WIDGET (gtk_builder_get_object (priv->commons->gtkbuilder, "w_persona_incarico"));
 
-       priv->objects = gtk_form_get_objects_by_name (priv->form,
+       priv->objects = zak_form_gtk_form_get_gobjects_by_name (priv->form,
                                                      "label129",
                                                      "label130",
                                                      NULL);
@@ -179,14 +189,22 @@ OrganigrammaPersonaIncarico
        g_signal_connect (priv->w,
                          "delete-event", G_CALLBACK (organigramma_persona_incarico_on_w_organigramma_persona_incarico_delete_event), (gpointer)a);
 
-       g_signal_connect (gtk_builder_get_object (priv->commons->gtkbuilder, "gtkformdecoder2"),
+       g_signal_connect (gtk_builder_get_object (priv->commons->gtkbuilder, "zakgtkdecoder11"),
                          "btn-browse-clicked", G_CALLBACK (organigramma_persona_incarico_on_btn_ricerca_tipo_rapporto_lavoro_clicked), (gpointer)a);
-       g_signal_connect (gtk_builder_get_object (priv->commons->gtkbuilder, "gtkformdecoder5"),
+       g_signal_connect (gtk_builder_get_object (priv->commons->gtkbuilder, "zakgtkdecoder12"),
                          "btn-browse-clicked", G_CALLBACK (organigramma_persona_incarico_on_btn_ricerca_posizione_economica_clicked), (gpointer)a);
-       g_signal_connect (gtk_builder_get_object (priv->commons->gtkbuilder, "gtkformdecoder4"),
+       g_signal_connect (gtk_builder_get_object (priv->commons->gtkbuilder, "zakgtkdecoder13"),
                          "btn-browse-clicked", G_CALLBACK (organigramma_persona_incarico_on_btn_ricerca_tipo_prestazione_clicked), (gpointer)a);
-       g_signal_connect (gtk_builder_get_object (priv->commons->gtkbuilder, "gtkformdecoder3"),
+       g_signal_connect (gtk_builder_get_object (priv->commons->gtkbuilder, "zakgtkdecoder14"),
                          "btn-browse-clicked", G_CALLBACK (organigramma_persona_incarico_on_btn_ricerca_profilo_professionale_clicked), (gpointer)a);
+       g_signal_connect (gtk_builder_get_object (priv->commons->gtkbuilder, "zakgtkdecoder11"),
+                         "decode", G_CALLBACK (organigramma_persona_incarico_on_tipo_rapporto_lavoro_decode), (gpointer)a);
+       g_signal_connect (gtk_builder_get_object (priv->commons->gtkbuilder, "zakgtkdecoder12"),
+                         "decode", G_CALLBACK (organigramma_persona_incarico_on_posizione_economica_decode), (gpointer)a);
+       g_signal_connect (gtk_builder_get_object (priv->commons->gtkbuilder, "zakgtkdecoder13"),
+                         "decode", G_CALLBACK (organigramma_persona_incarico_on_tipo_prestazione_decode), (gpointer)a);
+       g_signal_connect (gtk_builder_get_object (priv->commons->gtkbuilder, "zakgtkdecoder14"),
+                         "decode", G_CALLBACK (organigramma_persona_incarico_on_profilo_professionale_decode), (gpointer)a);
 
        g_signal_connect (G_OBJECT (gtk_builder_get_object (priv->commons->gtkbuilder, "button98")),
                          "clicked", G_CALLBACK (organigramma_persona_incarico_on_btn_annulla_clicked), (gpointer)a);
@@ -195,13 +213,15 @@ OrganigrammaPersonaIncarico
        g_signal_connect (G_OBJECT (gtk_builder_get_object (priv->commons->gtkbuilder, "button158")),
                          "clicked", G_CALLBACK (organigramma_persona_incarico_on_btn_salvaechiudi_clicked), (gpointer)a);
 
+       zak_form_form_clear (ZAK_FORM_FORM (priv->form));
+
        priv->id = id;
        if (priv->id == 0)
                {
                        gtk_label_set_text (GTK_LABEL (priv->objects[LBL_ID]), "");
                        gtk_label_set_text (GTK_LABEL (priv->objects[LBL_ID_PERSONE]), g_strdup_printf ("%d", id_persone));
 
-                       gtk_form_set_as_origin (priv->form);
+                       zak_form_form_set_as_original (ZAK_FORM_FORM (priv->form));
                }
        else
                {
@@ -237,12 +257,9 @@ GtkWidget
 static void
 organigramma_persona_incarico_carica (OrganigrammaPersonaIncarico *organigramma_persona_incarico)
 {
-       gchar *sql;
-       GdaDataModel *dm;
-
        OrganigrammaPersonaIncaricoPrivate *priv = ORGANIGRAMMA_PERSONA_INCARICO_GET_PRIVATE (organigramma_persona_incarico);
 
-       if (gtk_form_fill_from_table (priv->form))
+       if (zak_form_form_load (ZAK_FORM_FORM (priv->form), ZAK_FORM_IPROVIDER (priv->form_provider)))
                {
                }
 }
@@ -250,27 +267,38 @@ organigramma_persona_incarico_carica (OrganigrammaPersonaIncarico *organigramma_
 static void
 organigramma_persona_incarico_salva (OrganigrammaPersonaIncarico *organigramma_persona_incarico, gboolean chiudi)
 {
-       gchar *sql;
+       gboolean success;
 
        OrganigrammaPersonaIncaricoClass *klass = ORGANIGRAMMA_PERSONA_INCARICO_GET_CLASS (organigramma_persona_incarico);
 
        OrganigrammaPersonaIncaricoPrivate *priv = ORGANIGRAMMA_PERSONA_INCARICO_GET_PRIVATE (organigramma_persona_incarico);
 
-       if (!gtk_form_check (priv->form, FALSE, NULL, TRUE, priv->w, TRUE))
+       if (!zak_form_gtk_form_is_valid (priv->form, priv->w))
                {
                        return;
                }
 
+       success = FALSE;
+
        if (priv->id == 0)
                {
-                       sql = gtk_form_get_sql (priv->form, GTK_FORM_SQL_INSERT);
+                       guint new_id;
+
+                       new_id = gdaex_get_new_id (priv->commons->gdaex,
+                                                                          "persona_incarichi",
+                                                                          "id",
+                                                                          NULL);
+
+                       gtk_label_set_text (GTK_LABEL (priv->objects[LBL_ID]), g_strdup_printf ("%d", new_id));
+
+                       success = zak_form_form_insert (ZAK_FORM_FORM (priv->form), ZAK_FORM_IPROVIDER (priv->form_provider));
                }
        else
                {
-                       sql = gtk_form_get_sql (priv->form, GTK_FORM_SQL_UPDATE);
+                       success = zak_form_form_update (ZAK_FORM_FORM (priv->form), ZAK_FORM_IPROVIDER (priv->form_provider));
                }
 
-       if (gdaex_execute (priv->commons->gdaex, sql) == 1)
+       if (success)
                {
                        g_signal_emit (organigramma_persona_incarico, klass->aggiornato_signal_id, 0);
 
@@ -279,7 +307,7 @@ organigramma_persona_incarico_salva (OrganigrammaPersonaIncarico *organigramma_p
                                        priv->id = strtol (gtk_label_get_text (GTK_LABEL (priv->objects[LBL_ID])), NULL, 10);
                                }
 
-                       gtk_form_set_as_origin (priv->form);
+                       zak_form_form_set_as_original (ZAK_FORM_FORM (priv->form));
 
                        solipa_message_dialog (priv->w,
                                               GTK_MESSAGE_INFO,
@@ -338,7 +366,7 @@ organigramma_persona_incarico_conferma_chiusura (OrganigrammaPersonaIncarico *or
 
        ret = TRUE;
 
-       if (gtk_form_is_changed (priv->form))
+       if (zak_form_form_is_changed (ZAK_FORM_FORM (priv->form)))
                {
                        if (solipa_message_dialog (priv->w,
                                                   GTK_MESSAGE_QUESTION,
@@ -368,7 +396,7 @@ organigramma_persona_incarico_on_tipo_rapporto_lavoro_selezionato (gpointer inst
 
        OrganigrammaPersonaIncaricoPrivate *priv = ORGANIGRAMMA_PERSONA_INCARICO_GET_PRIVATE (ia);
 
-       gtk_form_widget_set_value_stringify (gtk_form_get_form_widget_from_name (priv->form, "gtkformdecoder2"),
+       zak_gtk_decoder_set_key (ZAK_GTK_DECODER (gtk_builder_get_object (priv->commons->gtkbuilder, "zakgtkdecoder11")),
                                             g_strdup_printf ("%d", id));
 }
 
@@ -379,7 +407,7 @@ organigramma_persona_incarico_on_posizione_economica_selezionato (gpointer insta
 
        OrganigrammaPersonaIncaricoPrivate *priv = ORGANIGRAMMA_PERSONA_INCARICO_GET_PRIVATE (ia);
 
-       gtk_form_widget_set_value_stringify (gtk_form_get_form_widget_from_name (priv->form, "gtkformdecoder5"),
+       zak_gtk_decoder_set_key (ZAK_GTK_DECODER (gtk_builder_get_object (priv->commons->gtkbuilder, "zakgtkdecoder12")),
                                             g_strdup_printf ("%d", id));
 }
 
@@ -390,7 +418,7 @@ organigramma_persona_incarico_on_tipo_prestazione_selezionato (gpointer instance
 
        OrganigrammaPersonaIncaricoPrivate *priv = ORGANIGRAMMA_PERSONA_INCARICO_GET_PRIVATE (ia);
 
-       gtk_form_widget_set_value_stringify (gtk_form_get_form_widget_from_name (priv->form, "gtkformdecoder4"),
+       zak_gtk_decoder_set_key (ZAK_GTK_DECODER (gtk_builder_get_object (priv->commons->gtkbuilder, "zakgtkdecoder13")),
                                             g_strdup_printf ("%d", id));
 }
 
@@ -401,10 +429,114 @@ organigramma_persona_incarico_on_profilo_professionale_selezionato (gpointer ins
 
        OrganigrammaPersonaIncaricoPrivate *priv = ORGANIGRAMMA_PERSONA_INCARICO_GET_PRIVATE (ia);
 
-       gtk_form_widget_set_value_stringify (gtk_form_get_form_widget_from_name (priv->form, "gtkformdecoder3"),
+       zak_gtk_decoder_set_key (ZAK_GTK_DECODER (gtk_builder_get_object (priv->commons->gtkbuilder, "zakgtkdecoder14")),
                                             g_strdup_printf ("%d", id));
 }
 
+static gchar
+*organigramma_persona_incarico_on_tipo_rapporto_lavoro_decode (gpointer instance, gchar *key, gpointer user_data)
+{
+       GString *ret;
+       gchar *sql;
+       GdaDataModel *dm;
+
+       OrganigrammaPersonaIncarico *f = (OrganigrammaPersonaIncarico *)user_data;
+       OrganigrammaPersonaIncaricoPrivate *priv = ORGANIGRAMMA_PERSONA_INCARICO_GET_PRIVATE (f);
+
+       ret = g_string_new ("");
+
+       sql = g_strdup_printf ("SELECT nome"
+                                                  " FROM tipi_rapporto_lavoro"
+                                                  " WHERE id = %d",
+                                                  strtol (key, NULL, 10));
+       dm = gdaex_query (priv->commons->gdaex, sql);
+       g_free (sql);
+       if (!gdaex_data_model_is_empty (dm))
+               {
+                       g_string_append (ret, gdaex_data_model_get_value_stringify_at (dm, 0, 0));
+               }
+
+       return ret->str;
+}
+
+static gchar
+*organigramma_persona_incarico_on_posizione_economica_decode (gpointer instance, gchar *key, gpointer user_data)
+{
+       GString *ret;
+       gchar *sql;
+       GdaDataModel *dm;
+
+       OrganigrammaPersonaIncarico *f = (OrganigrammaPersonaIncarico *)user_data;
+       OrganigrammaPersonaIncaricoPrivate *priv = ORGANIGRAMMA_PERSONA_INCARICO_GET_PRIVATE (f);
+
+       ret = g_string_new ("");
+
+       sql = g_strdup_printf ("SELECT nome"
+                                                  " FROM posizioni_economiche"
+                                                  " WHERE id = %d",
+                                                  strtol (key, NULL, 10));
+       dm = gdaex_query (priv->commons->gdaex, sql);
+       g_free (sql);
+       if (!gdaex_data_model_is_empty (dm))
+               {
+                       g_string_append (ret, gdaex_data_model_get_value_stringify_at (dm, 0, 0));
+               }
+
+       return ret->str;
+}
+
+static gchar
+*organigramma_persona_incarico_on_tipo_prestazione_decode (gpointer instance, gchar *key, gpointer user_data)
+{
+       GString *ret;
+       gchar *sql;
+       GdaDataModel *dm;
+
+       OrganigrammaPersonaIncarico *f = (OrganigrammaPersonaIncarico *)user_data;
+       OrganigrammaPersonaIncaricoPrivate *priv = ORGANIGRAMMA_PERSONA_INCARICO_GET_PRIVATE (f);
+
+       ret = g_string_new ("");
+
+       sql = g_strdup_printf ("SELECT nome"
+                                                  " FROM tipi_prestazione"
+                                                  " WHERE id = %d",
+                                                  strtol (key, NULL, 10));
+       dm = gdaex_query (priv->commons->gdaex, sql);
+       g_free (sql);
+       if (!gdaex_data_model_is_empty (dm))
+               {
+                       g_string_append (ret, gdaex_data_model_get_value_stringify_at (dm, 0, 0));
+               }
+
+       return ret->str;
+}
+
+static gchar
+*organigramma_persona_incarico_on_profilo_professionale_decode (gpointer instance, gchar *key, gpointer user_data)
+{
+       GString *ret;
+       gchar *sql;
+       GdaDataModel *dm;
+
+       OrganigrammaPersonaIncarico *f = (OrganigrammaPersonaIncarico *)user_data;
+       OrganigrammaPersonaIncaricoPrivate *priv = ORGANIGRAMMA_PERSONA_INCARICO_GET_PRIVATE (f);
+
+       ret = g_string_new ("");
+
+       sql = g_strdup_printf ("SELECT nome"
+                                                  " FROM profili_professionali"
+                                                  " WHERE id = %d",
+                                                  strtol (key, NULL, 10));
+       dm = gdaex_query (priv->commons->gdaex, sql);
+       g_free (sql);
+       if (!gdaex_data_model_is_empty (dm))
+               {
+                       g_string_append (ret, gdaex_data_model_get_value_stringify_at (dm, 0, 0));
+               }
+
+       return ret->str;
+}
+
 static void
 organigramma_persona_incarico_on_btn_ricerca_tipo_rapporto_lavoro_clicked (GtkButton *button,
                         gpointer user_data)