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

index 158f3369599c3845893ce539d54966c94ea88f53..10bd4d4dd57ca773dfdd1f772781a7cb22440735 100644 (file)
                </field>
        </widget>
 
-       <widget type="combobox" name="combobox9" label="label134">
-               <column-field>0</column-field>
-               <sql with-empty-entry="t">
-                       SELECT id, nome FROM posizioni_economiche WHERE status &lt;&gt; 'E' ORDER BY nome
-               </sql>
+       <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>
index 5fc9e889bcac09984408237abbe70f8a74a01f5c..b707f158818844c7243b2b1960ff4ae71e2385cc 100644 (file)
                 <property name="top_attach">9</property>
               </packing>
             </child>
-            <child>
-              <object class="GtkComboBox" id="combobox9">
-                <property name="visible">True</property>
-                <property name="can_focus">False</property>
-                <property name="hexpand">True</property>
-                <child>
-                  <object class="GtkCellRendererText" id="cellrenderertext33"/>
-                  <attributes>
-                    <attribute name="text">1</attribute>
-                  </attributes>
-                </child>
-              </object>
-              <packing>
-                <property name="left_attach">1</property>
-                <property name="top_attach">2</property>
-              </packing>
-            </child>
             <child>
               <object class="GtkScrolledWindow" id="scrolledwindow34">
                 <property name="visible">True</property>
                 <property name="top_attach">3</property>
               </packing>
             </child>
+            <child>
+              <object class="GtkFormDecoder" id="gtkformdecoder5">
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+              </object>
+              <packing>
+                <property name="left_attach">1</property>
+                <property name="top_attach">2</property>
+              </packing>
+            </child>
           </object>
           <packing>
             <property name="expand">True</property>
index a6bf201415f42cbc811d0aa96262ab79e4aa09ec..f3568781e5c07f2df829d7d67e57968196bf05d8 100644 (file)
@@ -30,6 +30,7 @@
 
 #include "personaincarico.h"
 #include "nodi.h"
+#include "posizionieconomiche.h"
 #include "tipiprestazione.h"
 #include "tipirapportolavoro.h"
 #include "profiliprofessionali.h"
@@ -56,11 +57,14 @@ 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_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 void organigramma_persona_incarico_on_btn_ricerca_tipo_rapporto_lavoro_clicked (GtkButton *button,
                                     gpointer user_data);
+static void organigramma_persona_incarico_on_btn_ricerca_posizione_economica_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,
@@ -153,9 +157,7 @@ OrganigrammaPersonaIncarico
        error = NULL;
 
        gtk_builder_add_objects_from_file (priv->commons->gtkbuilder, priv->commons->guifile,
-                                          g_strsplit (
-                                          "lstore_posizioni_economiche"
-                                          "|w_persona_incarico", "|", -1),
+                                          g_strsplit ("w_persona_incarico", "|", -1),
                                           &error);
        if (error != NULL)
                {
@@ -179,6 +181,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, "gtkformdecoder5"),
+                         "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"),
                          "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"),
@@ -368,6 +372,17 @@ organigramma_persona_incarico_on_tipo_rapporto_lavoro_selezionato (gpointer inst
                                             g_strdup_printf ("%d", id));
 }
 
+static void
+organigramma_persona_incarico_on_posizione_economica_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, "gtkformdecoder5"),
+                                            g_strdup_printf ("%d", id));
+}
+
 static void
 organigramma_persona_incarico_on_tipo_prestazione_selezionato (gpointer instance, guint id, gpointer user_data)
 {
@@ -409,6 +424,25 @@ organigramma_persona_incarico_on_btn_ricerca_tipo_rapporto_lavoro_clicked (GtkBu
        gtk_widget_show (w);
 }
 
+static void
+organigramma_persona_incarico_on_btn_ricerca_posizione_economica_clicked (GtkButton *button,
+                        gpointer user_data)
+{
+       GtkWidget *w;
+
+       OrganigrammaPersonaIncarico *ia = (OrganigrammaPersonaIncarico *)user_data;
+       OrganigrammaPersonaIncaricoPrivate *priv = ORGANIGRAMMA_PERSONA_INCARICO_GET_PRIVATE (ia);
+
+       OrganigrammaPosizioniEconomiche *c = organigramma_posizioni_economiche_new (priv->commons, TRUE);
+
+       g_signal_connect (G_OBJECT (c), "selezionato",
+                         G_CALLBACK (organigramma_persona_incarico_on_posizione_economica_selezionato), user_data);
+
+       w = organigramma_posizioni_economiche_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_tipo_prestazione_clicked (GtkButton *button,
                         gpointer user_data)