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

index 23abe28903599fb57b848e3bacb6f564ac8858d1..beec7fa77905c88ef4d1e01e141039b03521b50f 100644 (file)
                </field>
        </widget>
 
-       <widget type="combobox" name="combobox11" label="label136">
-               <column-field>0</column-field>
-               <sql with-empty-entry="t">
-                       SELECT id, nome FROM profili_professionali WHERE status &lt;&gt; 'E' ORDER BY nome
-               </sql>
+       <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>
index 36d97d3f3c3b5428bdd798fdcd712b9161f33ebd..f688a49f16b26a05e763c836c0d184b206b8e953 100644 (file)
                 <property name="top_attach">3</property>
               </packing>
             </child>
-            <child>
-              <object class="GtkComboBox" id="combobox11">
-                <property name="visible">True</property>
-                <property name="can_focus">False</property>
-                <property name="hexpand">True</property>
-                <child>
-                  <object class="GtkCellRendererText" id="cellrenderertext35"/>
-                  <attributes>
-                    <attribute name="text">1</attribute>
-                  </attributes>
-                </child>
-              </object>
-              <packing>
-                <property name="left_attach">1</property>
-                <property name="top_attach">4</property>
-              </packing>
-            </child>
             <child>
               <object class="GtkScrolledWindow" id="scrolledwindow34">
                 <property name="visible">True</property>
                 <property name="top_attach">1</property>
               </packing>
             </child>
+            <child>
+              <object class="GtkFormDecoder" id="gtkformdecoder3">
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+              </object>
+              <packing>
+                <property name="left_attach">1</property>
+                <property name="top_attach">4</property>
+              </packing>
+            </child>
           </object>
           <packing>
             <property name="expand">True</property>
index d86db582fd9bae1ee3f3912b6691edb8e09ec0d7..f9980d98af1c7fae997883b8b335216e9cf0791d 100644 (file)
@@ -31,6 +31,7 @@
 #include "personaincarico.h"
 #include "nodi.h"
 #include "tipirapportolavoro.h"
+#include "profiliprofessionali.h"
 
 static void organigramma_persona_incarico_class_init (OrganigrammaPersonaIncaricoClass *klass);
 static void organigramma_persona_incarico_init (OrganigrammaPersonaIncarico *organigramma_persona_incarico);
@@ -54,9 +55,12 @@ 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_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_profilo_professionale_clicked (GtkButton *button,
+                                    gpointer user_data);
 
 static void organigramma_persona_incarico_on_btn_annulla_clicked (GtkButton *button,
                                     gpointer user_data);
@@ -148,7 +152,6 @@ OrganigrammaPersonaIncarico
                                           g_strsplit (
                                           "lstore_posizioni_economiche"
                                           "|lstore_tipi_prestazione"
-                                          "|lstore_profili_professionali"
                                           "|w_persona_incarico", "|", -1),
                                           &error);
        if (error != NULL)
@@ -173,6 +176,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, "gtkformdecoder3"),
+                         "btn-browse-clicked", G_CALLBACK (organigramma_persona_incarico_on_btn_ricerca_profilo_professionale_clicked), (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);
@@ -358,6 +363,17 @@ organigramma_persona_incarico_on_tipo_rapporto_lavoro_selezionato (gpointer inst
                                             g_strdup_printf ("%d", id));
 }
 
+static void
+organigramma_persona_incarico_on_profilo_professionale_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, "gtkformdecoder3"),
+                                            g_strdup_printf ("%d", id));
+}
+
 static void
 organigramma_persona_incarico_on_btn_ricerca_tipo_rapporto_lavoro_clicked (GtkButton *button,
                         gpointer user_data)
@@ -377,6 +393,25 @@ organigramma_persona_incarico_on_btn_ricerca_tipo_rapporto_lavoro_clicked (GtkBu
        gtk_widget_show (w);
 }
 
+static void
+organigramma_persona_incarico_on_btn_ricerca_profilo_professionale_clicked (GtkButton *button,
+                        gpointer user_data)
+{
+       GtkWidget *w;
+
+       OrganigrammaPersonaIncarico *ia = (OrganigrammaPersonaIncarico *)user_data;
+       OrganigrammaPersonaIncaricoPrivate *priv = ORGANIGRAMMA_PERSONA_INCARICO_GET_PRIVATE (ia);
+
+       OrganigrammaProfiliProfessionali *c = organigramma_profili_professionali_new (priv->commons, TRUE);
+
+       g_signal_connect (G_OBJECT (c), "selezionato",
+                         G_CALLBACK (organigramma_persona_incarico_on_profilo_professionale_selezionato), user_data);
+
+       w = organigramma_profili_professionali_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_annulla_clicked (GtkButton *button,
                         gpointer user_data)