]> saetta.ns0.it Git - solipa/organigramma/commitdiff
Trasformata la tabella uffici in albero.
authorAndrea Zagli <a.zagli@comune.scandicci.fi.it>
Thu, 23 May 2013 13:05:16 +0000 (15:05 +0200)
committerAndrea Zagli <a.zagli@comune.scandicci.fi.it>
Thu, 23 May 2013 13:05:16 +0000 (15:05 +0200)
data/organigramma/form/ufficio.form
data/organigramma/gui/organigramma.gui
src/nodi.c
src/titoli.c
src/uffici.c
src/ufficio.c

index d2ab8176c282ca3f55dfba65bc7723a5ea137f35..04e82ea707ab8b2289df0ee598dd769802a30cbe 100644 (file)
                </field>
        </widget>
 
+       <widget type="entry" name="entry48">
+               <field type="text" name="ufficio_superiore">
+                       <to-load>f</to-load>
+                       <to-save>f</to-save>
+               </field>
+       </widget>
+
+       <widget type="label" name="label169" label="label170">
+               <on-change what="update" when="after">
+                       <widget-name>entry48</widget-name>
+                       <sql>
+                               SELECT nome FROM uffici WHERE id = ##label169::gint
+                       </sql>
+               </on-change>
+               <field type="integer" name="id_uffici">
+               </field>
+       </widget>
+
        <widget type="entry" name="entry7">
                <field type="text" name="struttura">
                        <to-load>f</to-load>
@@ -25,7 +43,6 @@
                        </sql>
                </on-change>
                <field type="integer" name="id_strutture">
-                       <obligatory>t</obligatory>
                </field>
        </widget>
 
index ccf416f0b3fa5338b8008973d841c9b58fe68774..7982b82848d9aaa491f1b7ad297f44f2a90ee8eb 100644 (file)
       <column type="gchararray"/>
     </columns>
   </object>
-  <object class="GtkListStore" id="lstore_uffici">
-    <columns>
-      <!-- column-name id -->
-      <column type="guint"/>
-      <!-- column-name nome -->
-      <column type="gchararray"/>
-    </columns>
-  </object>
   <object class="GtkListStore" id="lstore_ufficio_nodi">
     <columns>
       <!-- column-name tipo -->
       <column type="gchararray"/>
     </columns>
   </object>
+  <object class="GtkTreeStore" id="tstore_uffici">
+    <columns>
+      <!-- column-name id -->
+      <column type="guint"/>
+      <!-- column-name nome -->
+      <column type="gchararray"/>
+    </columns>
+  </object>
   <object class="GtkWindow" id="w_main">
     <property name="can_focus">False</property>
     <property name="title" translatable="yes">Gestione organigramma</property>
               <object class="GtkTreeView" id="treeview4">
                 <property name="visible">True</property>
                 <property name="can_focus">True</property>
-                <property name="model">lstore_uffici</property>
+                <property name="model">tstore_uffici</property>
                 <property name="headers_clickable">False</property>
-                <property name="search_column">0</property>
+                <property name="rules_hint">True</property>
+                <property name="search_column">1</property>
                 <child>
                   <object class="GtkTreeViewColumn" id="treeviewcolumn4">
                     <property name="title">Nome</property>
           <object class="GtkTable" id="table4">
             <property name="visible">True</property>
             <property name="can_focus">False</property>
-            <property name="n_rows">8</property>
+            <property name="n_rows">9</property>
             <property name="n_columns">2</property>
             <property name="column_spacing">5</property>
             <property name="row_spacing">5</property>
                 <property name="label" translatable="yes">Nome</property>
               </object>
               <packing>
-                <property name="top_attach">4</property>
-                <property name="bottom_attach">5</property>
+                <property name="top_attach">5</property>
+                <property name="bottom_attach">6</property>
                 <property name="x_options">GTK_FILL</property>
                 <property name="y_options">GTK_FILL</property>
               </packing>
               <packing>
                 <property name="left_attach">1</property>
                 <property name="right_attach">2</property>
-                <property name="top_attach">4</property>
-                <property name="bottom_attach">5</property>
+                <property name="top_attach">5</property>
+                <property name="bottom_attach">6</property>
                 <property name="y_options">GTK_FILL</property>
               </packing>
             </child>
                 <property name="label" translatable="yes">Descrizione</property>
               </object>
               <packing>
-                <property name="top_attach">5</property>
-                <property name="bottom_attach">6</property>
+                <property name="top_attach">6</property>
+                <property name="bottom_attach">7</property>
                 <property name="x_options">GTK_FILL</property>
                 <property name="y_options">GTK_FILL</property>
               </packing>
               <packing>
                 <property name="left_attach">1</property>
                 <property name="right_attach">2</property>
-                <property name="top_attach">5</property>
-                <property name="bottom_attach">6</property>
+                <property name="top_attach">6</property>
+                <property name="bottom_attach">7</property>
               </packing>
             </child>
             <child>
                 <property name="label" translatable="yes">Struttura</property>
               </object>
               <packing>
-                <property name="top_attach">2</property>
-                <property name="bottom_attach">3</property>
+                <property name="top_attach">3</property>
+                <property name="bottom_attach">4</property>
                 <property name="x_options">GTK_FILL</property>
                 <property name="y_options">GTK_FILL</property>
               </packing>
             </child>
-            <child>
-              <object class="GtkHBox" id="hbox3">
-                <property name="visible">True</property>
-                <property name="can_focus">False</property>
-                <property name="spacing">5</property>
-                <child>
-                  <object class="GtkEntry" id="entry7">
-                    <property name="visible">True</property>
-                    <property name="can_focus">True</property>
-                    <property name="editable">False</property>
-                    <property name="invisible_char">●</property>
-                    <property name="primary_icon_activatable">False</property>
-                    <property name="secondary_icon_activatable">False</property>
-                    <property name="primary_icon_sensitive">True</property>
-                    <property name="secondary_icon_sensitive">True</property>
-                  </object>
-                  <packing>
-                    <property name="expand">True</property>
-                    <property name="fill">True</property>
-                    <property name="position">0</property>
-                  </packing>
-                </child>
-                <child>
-                  <object class="GtkButton" id="button31">
-                    <property name="label" translatable="yes">...</property>
-                    <property name="visible">True</property>
-                    <property name="can_focus">True</property>
-                    <property name="receives_default">True</property>
-                  </object>
-                  <packing>
-                    <property name="expand">False</property>
-                    <property name="fill">True</property>
-                    <property name="position">1</property>
-                  </packing>
-                </child>
-                <child>
-                  <object class="GtkLabel" id="label25">
-                    <property name="can_focus">False</property>
-                    <property name="label" translatable="yes">lbl_id_strutture</property>
-                  </object>
-                  <packing>
-                    <property name="expand">False</property>
-                    <property name="fill">True</property>
-                    <property name="position">2</property>
-                  </packing>
-                </child>
-              </object>
-              <packing>
-                <property name="left_attach">1</property>
-                <property name="right_attach">2</property>
-                <property name="top_attach">2</property>
-                <property name="bottom_attach">3</property>
-                <property name="y_options">GTK_FILL</property>
-              </packing>
-            </child>
             <child>
               <object class="GtkFrame" id="frame1">
                 <property name="visible">True</property>
               </object>
               <packing>
                 <property name="right_attach">2</property>
-                <property name="top_attach">6</property>
-                <property name="bottom_attach">7</property>
+                <property name="top_attach">7</property>
+                <property name="bottom_attach">8</property>
               </packing>
             </child>
             <child>
               </object>
               <packing>
                 <property name="right_attach">2</property>
-                <property name="top_attach">7</property>
-                <property name="bottom_attach">8</property>
+                <property name="top_attach">8</property>
+                <property name="bottom_attach">9</property>
               </packing>
             </child>
             <child>
                 </child>
               </object>
               <packing>
+                <property name="right_attach">2</property>
+                <property name="top_attach">4</property>
+                <property name="bottom_attach">5</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkHBox" id="hbox3">
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+                <property name="spacing">5</property>
+                <child>
+                  <object class="GtkEntry" id="entry7">
+                    <property name="visible">True</property>
+                    <property name="can_focus">True</property>
+                    <property name="editable">False</property>
+                    <property name="invisible_char">●</property>
+                    <property name="invisible_char_set">True</property>
+                    <property name="primary_icon_activatable">False</property>
+                    <property name="secondary_icon_activatable">False</property>
+                    <property name="primary_icon_sensitive">True</property>
+                    <property name="secondary_icon_sensitive">True</property>
+                  </object>
+                  <packing>
+                    <property name="expand">True</property>
+                    <property name="fill">True</property>
+                    <property name="position">0</property>
+                  </packing>
+                </child>
+                <child>
+                  <object class="GtkButton" id="button31">
+                    <property name="label" translatable="yes">...</property>
+                    <property name="visible">True</property>
+                    <property name="can_focus">True</property>
+                    <property name="receives_default">True</property>
+                  </object>
+                  <packing>
+                    <property name="expand">False</property>
+                    <property name="fill">True</property>
+                    <property name="position">1</property>
+                  </packing>
+                </child>
+                <child>
+                  <object class="GtkLabel" id="label25">
+                    <property name="can_focus">False</property>
+                    <property name="label" translatable="yes">lbl_id_strutture</property>
+                  </object>
+                  <packing>
+                    <property name="expand">False</property>
+                    <property name="fill">True</property>
+                    <property name="position">2</property>
+                  </packing>
+                </child>
+              </object>
+              <packing>
+                <property name="left_attach">1</property>
                 <property name="right_attach">2</property>
                 <property name="top_attach">3</property>
                 <property name="bottom_attach">4</property>
+                <property name="y_options">GTK_FILL</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkHBox" id="hbox20">
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+                <property name="spacing">5</property>
+                <child>
+                  <object class="GtkEntry" id="entry48">
+                    <property name="visible">True</property>
+                    <property name="can_focus">True</property>
+                    <property name="editable">False</property>
+                    <property name="invisible_char">●</property>
+                    <property name="invisible_char_set">True</property>
+                    <property name="secondary_icon_stock">gtk-clear</property>
+                    <property name="primary_icon_activatable">False</property>
+                    <property name="secondary_icon_activatable">True</property>
+                    <property name="primary_icon_sensitive">True</property>
+                    <property name="secondary_icon_sensitive">True</property>
+                  </object>
+                  <packing>
+                    <property name="expand">True</property>
+                    <property name="fill">True</property>
+                    <property name="position">0</property>
+                  </packing>
+                </child>
+                <child>
+                  <object class="GtkButton" id="button164">
+                    <property name="label" translatable="yes">...</property>
+                    <property name="visible">True</property>
+                    <property name="can_focus">True</property>
+                    <property name="receives_default">True</property>
+                  </object>
+                  <packing>
+                    <property name="expand">False</property>
+                    <property name="fill">True</property>
+                    <property name="position">1</property>
+                  </packing>
+                </child>
+                <child>
+                  <object class="GtkLabel" id="label169">
+                    <property name="can_focus">False</property>
+                    <property name="label" translatable="yes">lbl_id_uffici</property>
+                  </object>
+                  <packing>
+                    <property name="expand">False</property>
+                    <property name="fill">True</property>
+                    <property name="position">2</property>
+                  </packing>
+                </child>
+              </object>
+              <packing>
+                <property name="left_attach">1</property>
+                <property name="right_attach">2</property>
+                <property name="top_attach">2</property>
+                <property name="bottom_attach">3</property>
+                <property name="y_options">GTK_FILL</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkLabel" id="label170">
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+                <property name="xalign">0</property>
+                <property name="label" translatable="yes">Ufficio</property>
+              </object>
+              <packing>
+                <property name="top_attach">2</property>
+                <property name="bottom_attach">3</property>
+                <property name="x_options">GTK_FILL</property>
+                <property name="y_options">GTK_FILL</property>
               </packing>
             </child>
           </object>
index 44936b90e6d58e6b95e49a48a34ce32d640f58a8..c616d6c0003893085d1443dc9d55493a7b32d2c4 100644 (file)
@@ -1,5 +1,5 @@
 /* 
- * Copyright (C) 2010-2012 Andrea Zagli <azagli@libero.it>
+ * Copyright (C) 2010-2013 Andrea Zagli <azagli@libero.it>
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
  *
  */
 
+#ifdef HAVE_CONFIG_H
+       #include <config.h>
+#endif
+
 #include <libautoz/autoz.h>
 #include <libsolipa/utils.h>
 
index 6d26654f8ab71b0861a32028d4ad5514bf6cac07..a0a375740f95b03ac6335b060d5bb3f156e21180 100644 (file)
@@ -1,5 +1,5 @@
 /* 
- * Copyright (C) 2010-2012 Andrea Zagli <azagli@libero.it>
+ * Copyright (C) 2010-2013 Andrea Zagli <azagli@libero.it>
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
  *
  */
 
+#ifdef HAVE_CONFIG_H
+       #include <config.h>
+#endif
+
 #include <libautoz/autoz.h>
 #include <libsolipa/utils.h>
 
index 658181446f96014cf3ed6c13d0021fe0829bddba..24efa3177b25ae600cec827a0a17dc6be300cbdc 100644 (file)
@@ -1,5 +1,5 @@
 /* 
- * Copyright (C) 2010-2012 Andrea Zagli <azagli@libero.it>
+ * Copyright (C) 2010-2013 Andrea Zagli <azagli@libero.it>
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
  *
  */
 
+#ifdef HAVE_CONFIG_H
+       #include <config.h>
+#endif
+
 #include <libautoz/autoz.h>
 #include <libsolipa/utils.h>
 
@@ -77,7 +81,7 @@ struct _OrganigrammaUfficiPrivate
 
                GtkWidget *widget;
                GtkTreeSelection *selection;
-               GtkListStore *lstore_uffici;
+               GtkTreeStore *tstore_uffici;
 
                gboolean selezione;
                GtkWindow *wtransient;
@@ -156,7 +160,7 @@ OrganigrammaUffici
 
        error = NULL;
        gtk_builder_add_objects_from_file (priv->commons->gtkbuilder, priv->commons->guifile,
-                                          g_strsplit (g_strconcat ("lstore_uffici|", 
+                                          g_strsplit (g_strconcat ("tstore_uffici|",
                                                                    (selezione ? "w_uffici" : "vbx_uffici"),
                                                                    NULL),
                                                       "|", -1),
@@ -169,7 +173,7 @@ OrganigrammaUffici
 
        priv->widget = GTK_WIDGET (gtk_builder_get_object (priv->commons->gtkbuilder, (selezione ? "w_uffici" : "vbx_uffici")));
        priv->selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (gtk_builder_get_object (priv->commons->gtkbuilder, "treeview4")));
-       priv->lstore_uffici = GTK_LIST_STORE (gtk_builder_get_object (priv->commons->gtkbuilder, "lstore_uffici"));
+       priv->tstore_uffici = GTK_TREE_STORE (gtk_builder_get_object (priv->commons->gtkbuilder, "tstore_uffici"));
 
        if (priv->selezione)
                {
@@ -233,7 +237,7 @@ GtkWidget
 
 /* PRIVATE */
 static void
-organigramma_uffici_carica (OrganigrammaUffici *uffici)
+organigramma_uffici_carica_figli (OrganigrammaUffici *uffici, GtkTreeIter *iter_parent, guint id_uffici)
 {
        GtkTreeIter iter;
 
@@ -249,12 +253,12 @@ organigramma_uffici_carica (OrganigrammaUffici *uffici)
        OrganigrammaUfficiClass *klass = ORGANIGRAMMA_UFFICI_GET_CLASS (uffici);
        OrganigrammaUfficiPrivate *priv = ORGANIGRAMMA_UFFICI_GET_PRIVATE (uffici);
 
-       gtk_list_store_clear (priv->lstore_uffici);
-
        sql = g_strdup_printf ("SELECT c.id, c.nome"
                               " FROM uffici AS c"
                               " WHERE c.status <> 'E'"
-                              " ORDER BY c.nome");
+                              " AND id_uffici = %d"
+                              " ORDER BY c.nome",
+                              id_uffici);
        dm = gdaex_query (priv->commons->gdaex, sql);
        g_free (sql);
        if (dm != NULL)
@@ -274,11 +278,13 @@ organigramma_uffici_carica (OrganigrammaUffici *uffici)
 
                                        if (toshow)
                                                {
-                                                       gtk_list_store_append (priv->lstore_uffici, &iter);
-                                                       gtk_list_store_set (priv->lstore_uffici, &iter,
+                                                       gtk_tree_store_append (priv->tstore_uffici, &iter, iter_parent);
+                                                       gtk_tree_store_set (priv->tstore_uffici, &iter,
                                                                            COL_ID, id,
                                                                            COL_NOME, gdaex_data_model_get_field_value_stringify_at (dm, row, "nome"),
                                                                            -1);
+
+                                                       organigramma_uffici_carica_figli (uffici, &iter, id);
                                                }
                                }
 
@@ -286,6 +292,17 @@ organigramma_uffici_carica (OrganigrammaUffici *uffici)
                }
 }
 
+static void
+organigramma_uffici_carica (OrganigrammaUffici *uffici)
+{
+       OrganigrammaUfficiClass *klass = ORGANIGRAMMA_UFFICI_GET_CLASS (uffici);
+       OrganigrammaUfficiPrivate *priv = ORGANIGRAMMA_UFFICI_GET_PRIVATE (uffici);
+
+       gtk_tree_store_clear (priv->tstore_uffici);
+
+       organigramma_uffici_carica_figli (uffici, NULL, 0);
+}
+
 static void
 organigramma_uffici_modifica (OrganigrammaUffici *uffici)
 {
@@ -298,7 +315,7 @@ organigramma_uffici_modifica (OrganigrammaUffici *uffici)
                {
                        GtkWidget *w;
 
-                       gtk_tree_model_get (GTK_TREE_MODEL (priv->lstore_uffici), &iter,
+                       gtk_tree_model_get (GTK_TREE_MODEL (priv->tstore_uffici), &iter,
                                            COL_ID, &id,
                                            -1);
 
@@ -331,7 +348,7 @@ organigramma_uffici_selezionato (OrganigrammaUffici *uffici)
 
        if (gtk_tree_selection_get_selected (priv->selection, NULL, &iter))
                {
-                       gtk_tree_model_get (GTK_TREE_MODEL (priv->lstore_uffici), &iter,
+                       gtk_tree_model_get (GTK_TREE_MODEL (priv->tstore_uffici), &iter,
                                            COL_ID, &id,
                                            -1);
 
@@ -435,7 +452,7 @@ organigramma_uffici_on_btn_elimina_clicked (GtkButton *button,
                                                   GTK_BUTTONS_YES_NO,
                                                   "Sicuro di voler eliminare l'ufficio selezionato?") == GTK_RESPONSE_YES)
                                {
-                                       gtk_tree_model_get (GTK_TREE_MODEL (priv->lstore_uffici), &iter,
+                                       gtk_tree_model_get (GTK_TREE_MODEL (priv->tstore_uffici), &iter,
                                                            COL_ID, &id,
                                                            -1);
 
index d6cdf42401a6d1a84342044be5e691895e21c6a2..c297a62554d573b5aaa7836a61f7d6f64f197bfb 100644 (file)
@@ -26,6 +26,7 @@
 #include <libsolipa/utils.h>
 
 #include "ufficio.h"
+#include "uffici.h"
 #include "strutture.h"
 #include "ufficionodo.h"
 #include "ufficioorario.h"
@@ -64,13 +65,22 @@ static void organigramma_ufficio_on_stanza_aggiornato (gpointer instance, gpoint
 static void organigramma_ufficio_on_recapito_aggiornato (gpointer instance, gpointer user_data);
 static void organigramma_ufficio_on_orario_aggiornato (gpointer instance, gpointer user_data);
 
+static void organigramma_ufficio_on_organigramma_ufficio_selezionato (gpointer instance, guint id, gpointer user_data);
+
+static void organigramma_ufficio_on_organigramma_ufficio_pulisci (GtkEntry *entry,
+                          GtkEntryIconPosition icon_pos,
+                          GdkEvent *event,
+                          gpointer user_data);
+static void organigramma_ufficio_on_btn_organigramma_ufficio_clicked (GtkButton *button,
+                      gpointer user_data);
+
 static void organigramma_ufficio_on_struttura_selezionato (gpointer instance, guint id, gpointer user_data);
 
 static gboolean organigramma_ufficio_on_w_organigramma_ufficio_delete_event (GtkWidget *widget,
                                GdkEvent *event,
                                gpointer user_data);
 
-static void organigramma_ufficio_on_btn_organigramma_ufficio_clicked (GtkButton *button,
+static void organigramma_ufficio_on_btn_organigramma_struttura_clicked (GtkButton *button,
                       gpointer user_data);
 
 static void organigramma_ufficio_on_btn_nodo_nuovo_clicked (GtkButton *button,
@@ -272,9 +282,14 @@ OrganigrammaUfficio
        g_signal_connect (priv->w,
                          "delete-event", G_CALLBACK (organigramma_ufficio_on_w_organigramma_ufficio_delete_event), (gpointer)a);
 
-       g_signal_connect (gtk_builder_get_object (priv->commons->gtkbuilder, "button31"),
+       g_signal_connect (gtk_builder_get_object (priv->commons->gtkbuilder, "entry48"),
+                         "icon-press", G_CALLBACK (organigramma_ufficio_on_organigramma_ufficio_pulisci), (gpointer)a);
+       g_signal_connect (gtk_builder_get_object (priv->commons->gtkbuilder, "button164"),
                          "clicked", G_CALLBACK (organigramma_ufficio_on_btn_organigramma_ufficio_clicked), (gpointer)a);
 
+       g_signal_connect (gtk_builder_get_object (priv->commons->gtkbuilder, "button31"),
+                         "clicked", G_CALLBACK (organigramma_ufficio_on_btn_organigramma_struttura_clicked), (gpointer)a);
+
        g_signal_connect (G_OBJECT (gtk_builder_get_object (priv->commons->gtkbuilder, "button28")),
                          "clicked", G_CALLBACK (organigramma_ufficio_on_btn_nodo_nuovo_clicked), (gpointer)a);
        g_signal_connect (G_OBJECT (gtk_builder_get_object (priv->commons->gtkbuilder, "button42")),
@@ -805,6 +820,28 @@ organigramma_ufficio_conferma_chiusura (OrganigrammaUfficio *ufficio)
 }
 
 /* CALLBACK */
+static void
+organigramma_ufficio_on_organigramma_ufficio_selezionato (gpointer instance, guint id, gpointer user_data)
+{
+       OrganigrammaUfficio *f = (OrganigrammaUfficio *)user_data;
+       OrganigrammaUfficioPrivate *priv = ORGANIGRAMMA_UFFICIO_GET_PRIVATE (f);
+
+       gtk_form_widget_set_value_stringify (gtk_form_get_form_widget_from_name (priv->form, "label169"), g_strdup_printf ("%d", id));
+}
+
+static void
+organigramma_ufficio_on_organigramma_ufficio_pulisci (GtkEntry *entry,
+                          GtkEntryIconPosition icon_pos,
+                          GdkEvent *event,
+                          gpointer user_data)
+{
+       OrganigrammaUfficio *f = (OrganigrammaUfficio *)user_data;
+       OrganigrammaUfficioPrivate *priv = ORGANIGRAMMA_UFFICIO_GET_PRIVATE (f);
+
+       gtk_label_set_text (GTK_LABEL (gtk_builder_get_object (priv->commons->gtkbuilder, "label169")), "");
+       gtk_entry_set_text (GTK_ENTRY (gtk_builder_get_object (priv->commons->gtkbuilder, "entry48")), "");
+}
+
 static void
 organigramma_ufficio_on_struttura_selezionato (gpointer instance, guint id, gpointer user_data)
 {
@@ -868,6 +905,26 @@ organigramma_ufficio_on_btn_organigramma_ufficio_clicked (GtkButton *button,
 
        OrganigrammaUfficioPrivate *priv = ORGANIGRAMMA_UFFICIO_GET_PRIVATE (rf);
 
+       OrganigrammaUffici *c = organigramma_uffici_new (priv->commons, TRUE);
+
+       g_signal_connect (G_OBJECT (c), "selezionato",
+                         G_CALLBACK (organigramma_ufficio_on_organigramma_ufficio_selezionato), user_data);
+
+       w = organigramma_uffici_get_widget (c);
+       gtk_window_set_transient_for (GTK_WINDOW (w), GTK_WINDOW (priv->w));
+       gtk_widget_show (w);
+}
+
+static void
+organigramma_ufficio_on_btn_organigramma_struttura_clicked (GtkButton *button,
+                      gpointer user_data)
+{
+       GtkWidget *w;
+
+       OrganigrammaUfficio *rf = (OrganigrammaUfficio *)user_data;
+
+       OrganigrammaUfficioPrivate *priv = ORGANIGRAMMA_UFFICIO_GET_PRIVATE (rf);
+
        OrganigrammaStrutture *c = organigramma_strutture_new (priv->commons, TRUE);
 
        g_signal_connect (G_OBJECT (c), "selezionato",