]> saetta.ns0.it Git - solipa/organigramma/commitdiff
Tolta la combobox tipo prestazione in persona incarico (refs #645 #646).
authorAndrea Zagli <azagli@libero.it>
Sun, 13 Nov 2016 10:57:56 +0000 (11:57 +0100)
committerAndrea Zagli <azagli@libero.it>
Sun, 13 Nov 2016 10:57:56 +0000 (11:57 +0100)
data/organigramma/form/persona_incarico.form
data/organigramma/gui/organigramma.gui
src/personaincarico.c

index beec7fa77905c88ef4d1e01e141039b03521b50f..158f3369599c3845893ce539d54966c94ea88f53 100644 (file)
                </field>
        </widget>
 
-       <widget type="combobox" name="combobox10" label="label135">
-               <column-field>0</column-field>
-               <sql with-empty-entry="t">
-                       SELECT id, nome FROM tipi_prestazione WHERE status &lt;&gt; 'E' ORDER BY nome
-               </sql>
+       <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>
index f688a49f16b26a05e763c836c0d184b206b8e953..5fc9e889bcac09984408237abbe70f8a74a01f5c 100644 (file)
                 <property name="top_attach">2</property>
               </packing>
             </child>
-            <child>
-              <object class="GtkComboBox" id="combobox10">
-                <property name="visible">True</property>
-                <property name="can_focus">False</property>
-                <property name="hexpand">True</property>
-                <child>
-                  <object class="GtkCellRendererText" id="cellrenderertext34"/>
-                  <attributes>
-                    <attribute name="text">1</attribute>
-                  </attributes>
-                </child>
-              </object>
-              <packing>
-                <property name="left_attach">1</property>
-                <property name="top_attach">3</property>
-              </packing>
-            </child>
             <child>
               <object class="GtkScrolledWindow" id="scrolledwindow34">
                 <property name="visible">True</property>
                 <property name="top_attach">4</property>
               </packing>
             </child>
+            <child>
+              <object class="GtkFormDecoder" id="gtkformdecoder4">
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+              </object>
+              <packing>
+                <property name="left_attach">1</property>
+                <property name="top_attach">3</property>
+              </packing>
+            </child>
           </object>
           <packing>
             <property name="expand">True</property>
index f9980d98af1c7fae997883b8b335216e9cf0791d..a6bf201415f42cbc811d0aa96262ab79e4aa09ec 100644 (file)
@@ -30,6 +30,7 @@
 
 #include "personaincarico.h"
 #include "nodi.h"
+#include "tipiprestazione.h"
 #include "tipirapportolavoro.h"
 #include "profiliprofessionali.h"
 
@@ -55,10 +56,13 @@ static gboolean organigramma_persona_incarico_on_w_organigramma_persona_incarico
                                gpointer user_data);
 
 static void organigramma_persona_incarico_on_tipo_rapporto_lavoro_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 void organigramma_persona_incarico_on_btn_ricerca_tipo_rapporto_lavoro_clicked (GtkButton *button,
                                     gpointer user_data);
+static void organigramma_persona_incarico_on_btn_ricerca_tipo_prestazione_clicked (GtkButton *button,
+                                    gpointer user_data);
 static void organigramma_persona_incarico_on_btn_ricerca_profilo_professionale_clicked (GtkButton *button,
                                     gpointer user_data);
 
@@ -151,7 +155,6 @@ OrganigrammaPersonaIncarico
        gtk_builder_add_objects_from_file (priv->commons->gtkbuilder, priv->commons->guifile,
                                           g_strsplit (
                                           "lstore_posizioni_economiche"
-                                          "|lstore_tipi_prestazione"
                                           "|w_persona_incarico", "|", -1),
                                           &error);
        if (error != NULL)
@@ -176,6 +179,8 @@ OrganigrammaPersonaIncarico
 
        g_signal_connect (gtk_builder_get_object (priv->commons->gtkbuilder, "gtkformdecoder2"),
                          "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, "gtkformdecoder4"),
+                         "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"),
                          "btn-browse-clicked", G_CALLBACK (organigramma_persona_incarico_on_btn_ricerca_profilo_professionale_clicked), (gpointer)a);
 
@@ -363,6 +368,17 @@ organigramma_persona_incarico_on_tipo_rapporto_lavoro_selezionato (gpointer inst
                                             g_strdup_printf ("%d", id));
 }
 
+static void
+organigramma_persona_incarico_on_tipo_prestazione_selezionato (gpointer instance, guint id, gpointer user_data)
+{
+       OrganigrammaPersonaIncarico *ia = (OrganigrammaPersonaIncarico *)user_data;
+
+       OrganigrammaPersonaIncaricoPrivate *priv = ORGANIGRAMMA_PERSONA_INCARICO_GET_PRIVATE (ia);
+
+       gtk_form_widget_set_value_stringify (gtk_form_get_form_widget_from_name (priv->form, "gtkformdecoder4"),
+                                            g_strdup_printf ("%d", id));
+}
+
 static void
 organigramma_persona_incarico_on_profilo_professionale_selezionato (gpointer instance, guint id, gpointer user_data)
 {
@@ -393,6 +409,25 @@ organigramma_persona_incarico_on_btn_ricerca_tipo_rapporto_lavoro_clicked (GtkBu
        gtk_widget_show (w);
 }
 
+static void
+organigramma_persona_incarico_on_btn_ricerca_tipo_prestazione_clicked (GtkButton *button,
+                        gpointer user_data)
+{
+       GtkWidget *w;
+
+       OrganigrammaPersonaIncarico *ia = (OrganigrammaPersonaIncarico *)user_data;
+       OrganigrammaPersonaIncaricoPrivate *priv = ORGANIGRAMMA_PERSONA_INCARICO_GET_PRIVATE (ia);
+
+       OrganigrammaTipiPrestazione *c = organigramma_tipi_prestazione_new (priv->commons, TRUE);
+
+       g_signal_connect (G_OBJECT (c), "selezionato",
+                         G_CALLBACK (organigramma_persona_incarico_on_tipo_prestazione_selezionato), user_data);
+
+       w = organigramma_tipi_prestazione_get_widget (c);
+       gtk_window_set_transient_for (GTK_WINDOW (w), GTK_WINDOW (priv->w));
+       gtk_widget_show (w);
+}
+
 static void
 organigramma_persona_incarico_on_btn_ricerca_profilo_professionale_clicked (GtkButton *button,
                         gpointer user_data)