<targetPlatform id="org.eclipse.linuxtools.cdt.autotools.core.toolchain.targetPlatform.1521462816" isAbstract="false" name="GNU Autotools Target Platform" superClass="org.eclipse.linuxtools.cdt.autotools.core.toolchain.targetPlatform"/>
<builder id="org.eclipse.linuxtools.cdt.autotools.core.toolchain.builder.2121159532" keepEnvironmentInBuildfile="false" managedBuildOn="false" superClass="org.eclipse.linuxtools.cdt.autotools.core.toolchain.builder"/>
<tool id="org.eclipse.linuxtools.cdt.autotools.core.gnu.toolchain.tool.configure.1676069924" name="configure" superClass="org.eclipse.linuxtools.cdt.autotools.core.gnu.toolchain.tool.configure">
- <option id="org.eclipse.linuxtools.cdt.autotools.core.option.configure.name.1070104063" superClass="org.eclipse.linuxtools.cdt.autotools.core.option.configure.name" value="org.eclipse.linuxtools.cdt.autotools.core.toolChain.590174213" valueType="string"/>
+ <option id="org.eclipse.linuxtools.cdt.autotools.core.option.configure.name.1070104063" name="Name" superClass="org.eclipse.linuxtools.cdt.autotools.core.option.configure.name" value="org.eclipse.linuxtools.cdt.autotools.core.toolChain.590174213" valueType="string"/>
</tool>
<tool id="org.eclipse.linuxtools.cdt.autotools.core.toolchain.tool.autogen.153546674" name="autogen.sh" superClass="org.eclipse.linuxtools.cdt.autotools.core.toolchain.tool.autogen"/>
<tool id="org.eclipse.linuxtools.cdt.autotools.core.toolchain.tool.gcc.1556295077" name="GCC C Compiler" superClass="org.eclipse.linuxtools.cdt.autotools.core.toolchain.tool.gcc">
- <option id="gnu.c.compiler.option.include.paths.325591640" superClass="gnu.c.compiler.option.include.paths" valueType="includePath">
+ <option id="gnu.c.compiler.option.include.paths.325591640" name="Include paths (-I)" superClass="gnu.c.compiler.option.include.paths" valueType="includePath">
<listOptionValue builtIn="false" value=""C:\mingw\include""/>
<listOptionValue builtIn="false" value=""C:\mingw\include\glib-2.0""/>
<listOptionValue builtIn="false" value=""C:\mingw\include\gtk-2.0""/>
</natures>
<filteredResources>
<filter>
- <id>1317140058877</id>
+ <id>1354028400899</id>
<name></name>
<type>30</type>
<matcher>
</matcher>
</filter>
<filter>
- <id>1317140058880</id>
+ <id>1354028400903</id>
<name></name>
<type>22</type>
<matcher>
</matcher>
</filter>
<filter>
- <id>1317140058883</id>
+ <id>1354028400914</id>
<name></name>
<type>22</type>
<matcher>
</matcher>
</filter>
<filter>
- <id>1317140058885</id>
+ <id>1354028400924</id>
<name></name>
<type>22</type>
<matcher>
</matcher>
</filter>
<filter>
- <id>1317140058888</id>
+ <id>1354028400927</id>
<name></name>
<type>22</type>
<matcher>
</matcher>
</filter>
<filter>
- <id>1317140058891</id>
+ <id>1354028400933</id>
<name></name>
<type>22</type>
<matcher>
</matcher>
</filter>
<filter>
- <id>1317140058894</id>
+ <id>1354028400939</id>
<name></name>
<type>22</type>
<matcher>
</matcher>
</filter>
<filter>
- <id>1317140058897</id>
+ <id>1354028400943</id>
<name></name>
<type>22</type>
<matcher>
</matcher>
</filter>
<filter>
- <id>1317140058900</id>
+ <id>1354028400947</id>
<name></name>
<type>22</type>
<matcher>
</matcher>
</filter>
<filter>
- <id>1317140058902</id>
+ <id>1354028400951</id>
<name></name>
<type>22</type>
<matcher>
</matcher>
</filter>
<filter>
- <id>1317140058905</id>
+ <id>1354028400954</id>
<name></name>
<type>22</type>
<matcher>
</matcher>
</filter>
<filter>
- <id>1317140058908</id>
+ <id>1354028400961</id>
<name></name>
<type>22</type>
<matcher>
</matcher>
</filter>
<filter>
- <id>1317140058922</id>
+ <id>1354028400966</id>
<name></name>
<type>22</type>
<matcher>
</matcher>
</filter>
<filter>
- <id>1317140058925</id>
+ <id>1354028400969</id>
<name></name>
<type>22</type>
<matcher>
</matcher>
</filter>
<filter>
- <id>1317140058928</id>
+ <id>1354028400974</id>
<name></name>
<type>22</type>
<matcher>
</matcher>
</filter>
<filter>
- <id>1317140058931</id>
+ <id>1354028400978</id>
<name></name>
<type>22</type>
<matcher>
</matcher>
</filter>
<filter>
- <id>1317140058934</id>
+ <id>1354028400983</id>
<name></name>
<type>22</type>
<matcher>
<arguments>1.0-name-matches-false-false-*.exe</arguments>
</matcher>
</filter>
+ <filter>
+ <id>1354028400987</id>
+ <name></name>
+ <type>30</type>
+ <matcher>
+ <id>org.eclipse.ui.ide.multiFilter</id>
+ <arguments>1.0-name-matches-false-false-*.lo</arguments>
+ </matcher>
+ </filter>
+ <filter>
+ <id>1354028400991</id>
+ <name></name>
+ <type>30</type>
+ <matcher>
+ <id>org.eclipse.ui.ide.multiFilter</id>
+ <arguments>1.0-name-matches-false-false-*.la</arguments>
+ </matcher>
+ </filter>
+ <filter>
+ <id>1354028400995</id>
+ <name></name>
+ <type>30</type>
+ <matcher>
+ <id>org.eclipse.ui.ide.multiFilter</id>
+ <arguments>1.0-name-matches-false-false-liborganigramma.pc</arguments>
+ </matcher>
+ </filter>
+ <filter>
+ <id>1354028400998</id>
+ <name></name>
+ <type>30</type>
+ <matcher>
+ <id>org.eclipse.ui.ide.multiFilter</id>
+ <arguments>1.0-name-matches-false-false-*~</arguments>
+ </matcher>
+ </filter>
</filteredResources>
</projectDescription>
PKG_CHECK_MODULES(ORGANIGRAMMA, [gio-2.0 >= 2.20
gtk+-2.0 >= 2.16
libgtkform >= 0.3.0
- libaute >= 0.0.2])
+ libaute >= 0.0.2
+ libterritorio >= 0.0.1])
AC_SUBST(ORGANIGRAMMA_CFLAGS)
AC_SUBST(ORGANIGRAMMA_LIBS)
<widget type="label" name="label110" label="label109">
<on-change what="update" when="after">
<widget-name>entry27</widget-name>
+ <connection-name>territorio</connection-name>
<sql>
- SELECT nome FROM citta WHERE id = ##label110::gint
+ SELECT c.nome FROM comuni AS c WHERE c.id = ##label110::gint
</sql>
</on-change>
<field type="integer" name="id_citta">
<widget type="label" name="label46" label="label45">
<on-change what="update" when="after">
<widget-name>entry12</widget-name>
+ <connection-name>territorio</connection-name>
<sql>
- SELECT nome FROM vie WHERE id = ##label46::gint
+ SELECT v.nome
+ FROM vie AS v
+ WHERE v.id = ##label46::gint
</sql>
</on-change>
<field type="integer" name="id_vie">
-- PostgreSQL database dump
--
--- Dumped from database version 8.4.4
--- Dumped by pg_dump version 9.0.1
--- Started on 2010-10-19 11:52:58
+-- Dumped from database version 8.4.14
+-- Dumped by pg_dump version 9.2.0
+-- Started on 2012-11-27 17:43:02
SET statement_timeout = 0;
SET client_encoding = 'UTF8';
SET escape_string_warning = off;
--
--- TOC entry 363 (class 2612 OID 16386)
+-- TOC entry 538 (class 2612 OID 16386)
-- Name: plpgsql; Type: PROCEDURAL LANGUAGE; Schema: -; Owner: -
--
SET default_with_oids = false;
--
--- TOC entry 1550 (class 1259 OID 59279)
--- Dependencies: 1850 1851 1852 3
+-- TOC entry 140 (class 1259 OID 59279)
-- Name: nodi; Type: TABLE; Schema: public; Owner: -
--
--
--- TOC entry 1571 (class 1259 OID 61344)
--- Dependencies: 1924 1925 1926 1927 1928 1929 1930 1931 1932 3
+-- TOC entry 160 (class 1259 OID 61344)
-- Name: persona_incarichi; Type: TABLE; Schema: public; Owner: -
--
--
--- TOC entry 1566 (class 1259 OID 61295)
--- Dependencies: 1907 1908 1909 1910 3
+-- TOC entry 155 (class 1259 OID 61295)
-- Name: persona_nodi; Type: TABLE; Schema: public; Owner: -
--
--
--- TOC entry 1567 (class 1259 OID 61307)
--- Dependencies: 1911 1912 1913 1914 1915 1916 1917 3
+-- TOC entry 156 (class 1259 OID 61307)
-- Name: persona_nodo_recapiti; Type: TABLE; Schema: public; Owner: -
--
--
--- TOC entry 1564 (class 1259 OID 61266)
--- Dependencies: 1894 1895 1896 1897 1898 1899 3
+-- TOC entry 153 (class 1259 OID 61266)
-- Name: persona_recapiti; Type: TABLE; Schema: public; Owner: -
--
--
--- TOC entry 1563 (class 1259 OID 61243)
--- Dependencies: 1890 1891 1892 1893 3
+-- TOC entry 152 (class 1259 OID 61243)
-- Name: persona_uffici; Type: TABLE; Schema: public; Owner: -
--
--
--- TOC entry 1565 (class 1259 OID 61280)
--- Dependencies: 1900 1901 1902 1903 1904 1905 1906 3
+-- TOC entry 154 (class 1259 OID 61280)
-- Name: persona_ufficio_recapiti; Type: TABLE; Schema: public; Owner: -
--
--
--- TOC entry 1561 (class 1259 OID 61227)
--- Dependencies: 1879 1880 1881 1882 1883 1884 1885 1886 1887 3
+-- TOC entry 150 (class 1259 OID 61227)
-- Name: persone; Type: TABLE; Schema: public; Owner: -
--
--
--- TOC entry 1568 (class 1259 OID 61322)
--- Dependencies: 1918 1919 3
+-- TOC entry 157 (class 1259 OID 61322)
-- Name: posizioni_economiche; Type: TABLE; Schema: public; Owner: -
--
--
--- TOC entry 1570 (class 1259 OID 61336)
--- Dependencies: 1922 1923 3
+-- TOC entry 159 (class 1259 OID 61336)
-- Name: profili_professionali; Type: TABLE; Schema: public; Owner: -
--
--
--- TOC entry 1556 (class 1259 OID 59346)
--- Dependencies: 1866 1867 1868 3
+-- TOC entry 145 (class 1259 OID 59346)
-- Name: struttura_indirizzi; Type: TABLE; Schema: public; Owner: -
--
--
--- TOC entry 1554 (class 1259 OID 59327)
--- Dependencies: 1860 1861 1862 1863 1864 3
+-- TOC entry 144 (class 1259 OID 59327)
-- Name: strutture; Type: TABLE; Schema: public; Owner: -
--
--
--- TOC entry 1551 (class 1259 OID 59290)
--- Dependencies: 1853 1854 3
+-- TOC entry 141 (class 1259 OID 59290)
-- Name: tipi_nodo; Type: TABLE; Schema: public; Owner: -
--
--
--- TOC entry 1569 (class 1259 OID 61329)
--- Dependencies: 1920 1921 3
+-- TOC entry 158 (class 1259 OID 61329)
-- Name: tipi_prestazione; Type: TABLE; Schema: public; Owner: -
--
--
--- TOC entry 1562 (class 1259 OID 61236)
--- Dependencies: 1888 1889 3
+-- TOC entry 151 (class 1259 OID 61236)
-- Name: tipi_rapporto_lavoro; Type: TABLE; Schema: public; Owner: -
--
--
--- TOC entry 1552 (class 1259 OID 59297)
--- Dependencies: 1855 1856 3
+-- TOC entry 142 (class 1259 OID 59297)
-- Name: tipi_recapito; Type: TABLE; Schema: public; Owner: -
--
--
--- TOC entry 1560 (class 1259 OID 61219)
--- Dependencies: 1876 1877 1878 3
+-- TOC entry 149 (class 1259 OID 61219)
-- Name: titoli; Type: TABLE; Schema: public; Owner: -
--
--
--- TOC entry 1553 (class 1259 OID 59311)
--- Dependencies: 1857 1858 1859 3
+-- TOC entry 143 (class 1259 OID 59311)
-- Name: uffici; Type: TABLE; Schema: public; Owner: -
--
--
--- TOC entry 1557 (class 1259 OID 59357)
--- Dependencies: 1869 1870 3
+-- TOC entry 146 (class 1259 OID 59357)
-- Name: ufficio_nodi; Type: TABLE; Schema: public; Owner: -
--
--
--- TOC entry 1558 (class 1259 OID 59399)
--- Dependencies: 1871 1872 3
+-- TOC entry 147 (class 1259 OID 59399)
-- Name: ufficio_orari; Type: TABLE; Schema: public; Owner: -
--
--
--- TOC entry 1559 (class 1259 OID 59409)
--- Dependencies: 1873 1874 1875 3
+-- TOC entry 148 (class 1259 OID 59409)
-- Name: ufficio_recapiti; Type: TABLE; Schema: public; Owner: -
--
--
--- TOC entry 1572 (class 1259 OID 61417)
--- Dependencies: 1933 1934 1935 1936 1937 1938 3
+-- TOC entry 161 (class 1259 OID 61417)
-- Name: ufficio_stanze; Type: TABLE; Schema: public; Owner: -
--
--
--- TOC entry 1555 (class 1259 OID 59340)
--- Dependencies: 1865 3
--- Name: vie; Type: TABLE; Schema: public; Owner: -
---
-
-CREATE TABLE vie (
- id integer NOT NULL,
- nome character varying(100) DEFAULT ''::character varying
-);
-
-
---
--- TOC entry 1940 (class 2606 OID 59289)
--- Dependencies: 1550 1550
+-- TOC entry 1958 (class 2606 OID 59289)
-- Name: nodi_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--
--
--- TOC entry 1982 (class 2606 OID 61360)
--- Dependencies: 1571 1571
+-- TOC entry 1998 (class 2606 OID 61360)
-- Name: persona_incarichi_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--
--
--- TOC entry 1972 (class 2606 OID 61305)
--- Dependencies: 1566 1566
+-- TOC entry 1988 (class 2606 OID 61305)
-- Name: persona_nodi_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--
--
--- TOC entry 1974 (class 2606 OID 61321)
--- Dependencies: 1567 1567
+-- TOC entry 1990 (class 2606 OID 61321)
-- Name: persona_nodo_recapiti_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--
--
--- TOC entry 1968 (class 2606 OID 61279)
--- Dependencies: 1564 1564
+-- TOC entry 1984 (class 2606 OID 61279)
-- Name: persona_recapiti_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--
--
--- TOC entry 1966 (class 2606 OID 61252)
--- Dependencies: 1563 1563
+-- TOC entry 1982 (class 2606 OID 61252)
-- Name: persona_uffici_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--
--
--- TOC entry 1970 (class 2606 OID 61294)
--- Dependencies: 1565 1565
+-- TOC entry 1986 (class 2606 OID 61294)
-- Name: persona_ufficio_recapiti_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--
--
--- TOC entry 1962 (class 2606 OID 61235)
--- Dependencies: 1561 1561
+-- TOC entry 1978 (class 2606 OID 61235)
-- Name: persone_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--
--
--- TOC entry 1976 (class 2606 OID 61328)
--- Dependencies: 1568 1568
+-- TOC entry 1992 (class 2606 OID 61328)
-- Name: posizioni_economiche_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--
--
--- TOC entry 1980 (class 2606 OID 61342)
--- Dependencies: 1570 1570
+-- TOC entry 1996 (class 2606 OID 61342)
-- Name: profili_professionali_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--
--
--- TOC entry 1952 (class 2606 OID 59356)
--- Dependencies: 1556 1556
+-- TOC entry 1968 (class 2606 OID 59356)
-- Name: struttura_indirizzi_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--
--
--- TOC entry 1948 (class 2606 OID 59339)
--- Dependencies: 1554 1554
+-- TOC entry 1966 (class 2606 OID 59339)
-- Name: strutture_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--
--
--- TOC entry 1942 (class 2606 OID 59296)
--- Dependencies: 1551 1551
+-- TOC entry 1960 (class 2606 OID 59296)
-- Name: tipi_nodo_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--
--
--- TOC entry 1978 (class 2606 OID 61335)
--- Dependencies: 1569 1569
+-- TOC entry 1994 (class 2606 OID 61335)
-- Name: tipi_prestazione_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--
--
--- TOC entry 1964 (class 2606 OID 61242)
--- Dependencies: 1562 1562
+-- TOC entry 1980 (class 2606 OID 61242)
-- Name: tipi_rapporto_lavoro_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--
--
--- TOC entry 1944 (class 2606 OID 59303)
--- Dependencies: 1552 1552
+-- TOC entry 1962 (class 2606 OID 59303)
-- Name: tipi_recapito_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--
--
--- TOC entry 1960 (class 2606 OID 61226)
--- Dependencies: 1560 1560
+-- TOC entry 1976 (class 2606 OID 61226)
-- Name: titoli_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--
--
--- TOC entry 1946 (class 2606 OID 59321)
--- Dependencies: 1553 1553
+-- TOC entry 1964 (class 2606 OID 59321)
-- Name: uffici_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--
--
--- TOC entry 1954 (class 2606 OID 59366)
--- Dependencies: 1557 1557
+-- TOC entry 1970 (class 2606 OID 59366)
-- Name: ufficio_nodi_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--
--
--- TOC entry 1956 (class 2606 OID 59408)
--- Dependencies: 1558 1558
+-- TOC entry 1972 (class 2606 OID 59408)
-- Name: ufficio_orari_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--
--
--- TOC entry 1958 (class 2606 OID 59419)
--- Dependencies: 1559 1559
+-- TOC entry 1974 (class 2606 OID 59419)
-- Name: ufficio_recapiti_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--
--
--- TOC entry 1984 (class 2606 OID 61430)
--- Dependencies: 1572 1572
+-- TOC entry 2000 (class 2606 OID 61430)
-- Name: ufficio_stanze_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--
ADD CONSTRAINT ufficio_stanze_pkey PRIMARY KEY (id);
---
--- TOC entry 1950 (class 2606 OID 59345)
--- Dependencies: 1555 1555
--- Name: vie_pkey; Type: CONSTRAINT; Schema: public; Owner: -
---
-
-ALTER TABLE ONLY vie
- ADD CONSTRAINT vie_pkey PRIMARY KEY (id);
-
-
--- Completed on 2010-10-19 11:52:58
+-- Completed on 2012-11-27 17:43:02
--
-- PostgreSQL database dump complete
+[DB_TERRITORIO]
+cnc_string=PostgreSQL://postgres:postgres@HOST=localhost;PORT=5432;DB_NAME=territorio
+
+[AUTOZ_TERRITORIO]
+cnc_string=PostgreSQL://postgres:postgres@HOST=localhost;PORT=5432;DB_NAME=autoz
+
[AUTE]
plugin=/usr/local/lib/libaute/plugins/libaute-db
cnc_string=PostgreSQL://postgres:postgres@HOST=localhost;PORT=5432;DB_NAME=autedb
Name: @PACKAGE_NAME@
Description: Libreria con l'interfaccia per la gestione dell'organigramma.
Version: @PACKAGE_VERSION@
-Requires: glib-2.0 gtk+-2.0 libgda-ui-4.0 libgdaex libgtkform libgtkformui libaute libautoz libsolipa
+Requires: glib-2.0 gtk+-2.0 libgda-ui-4.0 libgdaex libgtkform libgtkformui libaute libautoz libsolipa libterritorio
Libs: -L${libdir} -lorganigramma
Cflags: -I${includedir}
../src/ufficionodo.c \
../src/ufficioorario.c \
../src/ufficiorecapito.c \
- ../src/ufficiostanza.c \
- ../src/vie.c
+ ../src/ufficiostanza.c
liborganigramma_la_LDFLAGS = -no-undefined
../src/ufficionodo.h \
../src/ufficioorario.h \
../src/ufficiorecapito.h \
- ../src/ufficiostanza.h \
- ../src/vie.h
+ ../src/ufficiostanza.h
liborganigramma_includedir = $(includedir)/liborganigramma
ufficiorecapito.c \
ufficiorecapito.h \
ufficiostanza.c \
- ufficiostanza.h \
- vie.c \
- vie.h
\ No newline at end of file
+ ufficiostanza.h
\ No newline at end of file
#include <libgdaex/libgdaex.h>
+#include <libterritorio/commons.h>
+
typedef struct
{
gchar *guidir;
GdaEx *gdaex;
const gchar *guifile;
+
+ TerritorioCommons *territorio_commons;
} OrganigrammaCommons;
#endif /* __ORGANIGRAMMA_COMMONS_H__ */
#include <libaute.h>
+#include <libterritorio/commons.h>
+
#include "commons.h"
#include "nodi.h"
#include "persone.h"
{
GError *error;
+ GdaConnection *gdacon;
+
Aute *aute;
gchar **aute_params;
gsize n_aute_params;
}
/* inizializzazione commons */
- commons = g_malloc (sizeof (OrganigrammaCommons));
+ commons = g_new0 (OrganigrammaCommons, 1);
+
+ commons->territorio_commons = g_new0 (TerritorioCommons, 1);
+ commons->territorio_commons->utente = utente;
#ifdef G_OS_WIN32
p = strrchr (moddir, G_DIR_SEPARATOR);
if (p != NULL
- && g_ascii_strcasecmp (p + 1, "src") == 0)
+ && (g_ascii_strcasecmp (p + 1, "src") == 0
+ || g_ascii_strcasecmp (p + 1, ".libs") == 0))
{
- /*
- *p = '\0';
- commons->guidir = g_build_filename (moddir, "data", PACKAGE, "gui", NULL);
- commons->formdir = g_build_filename (moddir, "data", PACKAGE, "form", NULL);*/
commons->guidir = g_strdup (GUIDIR);
commons->formdir = g_strdup (FORMDIR);
+ commons->territorio_commons->guidir = g_build_filename ("/mingw", "share", "territorio", "gui", NULL);
+ commons->territorio_commons->formdir = g_build_filename ("/mingw", "share", "territorio", "form", NULL);
}
else
{
+#undef GUIDIR
+#undef FORMDIR
+
commons->guidir = g_build_filename (moddir, "share", PACKAGE, "gui", NULL);
commons->formdir = g_build_filename (moddir, "share", PACKAGE, "form", NULL);
+ commons->territorio_commons->guidir = g_build_filename (moddir, "share", "territorio", "gui", NULL);
+ commons->territorio_commons->formdir = g_build_filename (moddir, "share", "territorio", "form", NULL);
}
#else
commons->guidir = g_strdup (GUIDIR);
commons->formdir = g_strdup (FORMDIR);
+ commons->territorio_commons->guidir = g_build_filename ("/usr", "local", "share", "territorio", "gui", NULL);
+ commons->territorio_commons->formdir = g_build_filename ("/usr", "local", "share", "territorio", "form", NULL);
#endif
commons->guifile = g_build_filename (commons->guidir, "organigramma.gui", NULL);
+ commons->territorio_commons->guifile = g_build_filename (commons->territorio_commons->guidir, "territorio.gui", NULL);
/* leggo la stringa di connessione al db */
error = NULL;
g_error ("Errore nella connessione al database: %s", cnc_string);
}
+ /* leggo la stringa di connessione al db territorio */
+ error = NULL;
+ cnc_string = g_key_file_get_value (config, "DB_TERRITORIO", "cnc_string", &error);
+ if (cnc_string == NULL)
+ {
+ if (error != NULL)
+ {
+ g_error ("Impossibile leggere la stringa di connessione dal file di configurazione: %s", error->message);
+ }
+ else
+ {
+ g_error ("Impossibile leggere la stringa di connessione dal file di configurazione.");
+ }
+ }
+
+ commons->territorio_commons->gdaex = gdaex_new_from_string (cnc_string);
+ if (commons->territorio_commons->gdaex == NULL)
+ {
+ g_error ("Errore nella connessione al database: %s", cnc_string);
+ }
+
+ /* leggo i parametri per libautoz di territorio */
+ error = NULL;
+ cnc_string = g_key_file_get_value (config, "AUTOZ_TERRITORIO", "cnc_string", &error);
+ if (cnc_string == NULL)
+ {
+ g_warning ("Impossibile leggere la stringa di connessione per libautoz dal file di configurazione: %s.\n", error != NULL && error->message != NULL ? error->message : "nessun dettaglio");
+ return 0;
+ }
+
+ error = NULL;
+ gdacon = gda_connection_open_from_string (NULL, cnc_string, NULL, 0, &error);
+ if (gdacon == NULL)
+ {
+ g_warning ("Impossibile creare la connessione al db per libautoz di territorio: %s.\n", error != NULL && error->message != NULL ? error->message : "nessun dettaglio");
+ return 0;
+ }
+
+ commons->territorio_commons->autoz = autoz_new ();
+ if (commons->territorio_commons->autoz == NULL)
+ {
+ g_warning ("Impossibile creare l'oggetto per libautoz.");
+ return 0;
+ }
+ if (!autoz_load_from_db (commons->territorio_commons->autoz, gdacon, NULL, TRUE))
+ {
+ g_warning ("Impossibile caricare la configurazione per libautoz dal db.");
+ return 0;
+ }
+
+ commons->territorio_commons->role_utente = autoz_get_role_from_id (commons->territorio_commons->autoz, commons->territorio_commons->utente);
+ if (commons->territorio_commons->role_utente == NULL)
+ {
+ g_warning ("Utente \"%s\" non trovato nell configurazione di libautoz.", commons->territorio_commons->utente);
+ return 0;
+ }
+
+ /* gtkbuilder */
commons->gtkbuilder = gtk_builder_new ();
+ commons->territorio_commons->gtkbuilder = gtk_builder_new ();
error = NULL;
gtk_builder_add_objects_from_file (commons->gtkbuilder, commons->guifile,
gtk_builder_add_objects_from_file (priv->commons->gtkbuilder, priv->commons->guifile,
g_strsplit (g_strconcat (
"lstore_titoli"
- "|lstore_organigramma_persona_incarichi"
- "|lstore_organigramma_persona_nodi"
- "|lstore_organigramma_persona_nodo_recapiti"
- "|lstore_organigramma_persona_uffici"
- "|lstore_organigramma_persona_ufficio_recapiti"
- "|lstore_organigramma_persona_recapiti"
+ "|lstore_persona_incarichi"
+ "|lstore_persona_nodi"
+ "|lstore_persona_nodo_recapiti"
+ "|lstore_persona_uffici"
+ "|lstore_persona_ufficio_recapiti"
+ "|lstore_persona_recapiti"
"|w_persona", NULL), "|", -1),
&error);
if (error != NULL)
priv->form = gtk_form_new ();
g_object_set (G_OBJECT (priv->form), "gdaex", priv->commons->gdaex, NULL);
+ gtk_form_add_db_connection_gdaex (priv->form, "territorio", commons->territorio_commons->gdaex);
gtk_form_load_from_file (priv->form, g_build_filename (priv->commons->formdir, "persona.form", NULL), priv->commons->gtkbuilder);
priv->w = GTK_WIDGET (gtk_builder_get_object (priv->commons->gtkbuilder, "w_persona"));
priv->objects = gtk_form_get_objects_by_name (priv->form,
"label67",
- "lstore_organigramma_persona_incarichi",
- "lstore_organigramma_persona_nodi",
- "lstore_organigramma_persona_nodo_recapiti",
- "lstore_organigramma_persona_uffici",
- "lstore_organigramma_persona_ufficio_recapiti",
- "lstore_organigramma_persona_recapiti",
+ "lstore_persona_incarichi",
+ "lstore_persona_nodi",
+ "lstore_persona_nodo_recapiti",
+ "lstore_persona_uffici",
+ "lstore_persona_ufficio_recapiti",
+ "lstore_persona_recapiti",
NULL);
g_signal_connect (priv->w,
gtk_list_store_clear (GTK_LIST_STORE (priv->objects[LSTORE_INCARICHI]));
sql = g_strdup_printf ("SELECT pi.id, pi.da_data, pi.a_data, pi.descrizione"
- " FROM organigramma_persona_incarichi AS pi"
+ " FROM persona_incarichi AS pi"
" WHERE pi.id_persone = %d"
" AND pi.status <> 'E'"
" ORDER BY pi.da_data, pi.a_data, pi.descrizione",
gtk_list_store_clear (GTK_LIST_STORE (priv->objects[LSTORE_NODI]));
sql = g_strdup_printf ("SELECT pu.id, tn.nome AS tipo_nodo, u.nome, pu.da_data, pu.a_data"
- " FROM organigramma_persona_nodi AS pu INNER JOIN nodi AS u ON pu.id_nodi = u.id"
+ " FROM persona_nodi AS pu"
+ " INNER JOIN nodi AS u ON pu.id_nodi = u.id"
" INNER JOIN tipi_nodo AS tn ON u.id_tipi_nodo = tn.id"
" WHERE pu.id_persone = %d"
" AND pu.status <> 'E'"
}
sql = g_strdup_printf ("SELECT pur.id, tr.nome, pur.recapito"
- " FROM organigramma_persona_nodo_recapiti AS pur INNER JOIN tipi_recapito AS tr ON"
+ " FROM persona_nodo_recapiti AS pur"
+ " INNER JOIN tipi_recapito AS tr ON"
" pur.id_tipi_recapito = tr.id"
" WHERE pur.id_persone = %d"
" AND pur.id_nodi = %d"
gtk_list_store_clear (GTK_LIST_STORE (priv->objects[LSTORE_UFFICI]));
sql = g_strdup_printf ("SELECT pu.id, u.nome, pu.da_data, pu.a_data"
- " FROM organigramma_persona_uffici AS pu INNER JOIN uffici AS u ON"
+ " FROM persona_uffici AS pu"
+ " INNER JOIN uffici AS u ON"
" pu.id_uffici = u.id"
" WHERE pu.id_persone = %d"
" AND pu.status <> 'E'"
}
sql = g_strdup_printf ("SELECT pur.id, tr.nome, pur.recapito"
- " FROM organigramma_persona_ufficio_recapiti AS pur INNER JOIN tipi_recapito AS tr ON"
+ " FROM persona_ufficio_recapiti AS pur"
+ " INNER JOIN tipi_recapito AS tr ON"
" pur.id_tipi_recapito = tr.id"
" WHERE pur.id_persone = %d"
" AND pur.id_uffici = %d"
gtk_list_store_clear (GTK_LIST_STORE (priv->objects[LSTORE_RECAPITI]));
sql = g_strdup_printf ("SELECT pr.id, tr.nome, pr.recapito"
- " FROM organigramma_persona_recapiti AS pr INNER JOIN tipi_recapito AS tr ON"
+ " FROM persona_recapiti AS pr"
+ " INNER JOIN tipi_recapito AS tr ON"
" pr.id_tipi_recapito = tr.id"
" WHERE pr.id_persone = %d"
" AND pr.status <> 'E'"
-1);
gdaex_execute (priv->commons->gdaex,
- g_strdup_printf ("UPDATE organigramma_persona_incarichi"
+ g_strdup_printf ("UPDATE persona_incarichi"
" SET status = 'E'"
" WHERE id = %d",
id));
-1);
gdaex_execute (priv->commons->gdaex,
- g_strdup_printf ("UPDATE organigramma_persona_nodi"
+ g_strdup_printf ("UPDATE persona_nodi"
" SET status = 'E'"
" WHERE id = %d",
id));
-1);
gdaex_execute (priv->commons->gdaex,
- g_strdup_printf ("UPDATE organigramma_persona_nodo_recapiti"
+ g_strdup_printf ("UPDATE persona_nodo_recapiti"
" SET status = 'E'"
" WHERE id = %d",
id));
-1);
gdaex_execute (priv->commons->gdaex,
- g_strdup_printf ("UPDATE organigramma_persona_uffici"
+ g_strdup_printf ("UPDATE persona_uffici"
" SET status = 'E'"
" WHERE id = %d",
id));
-1);
gdaex_execute (priv->commons->gdaex,
- g_strdup_printf ("UPDATE organigramma_persona_ufficio_recapiti"
+ g_strdup_printf ("UPDATE persona_ufficio_recapiti"
" SET status = 'E'"
" WHERE id = %d",
id));
-1);
gdaex_execute (priv->commons->gdaex,
- g_strdup_printf ("UPDATE organigramma_persona_recapiti"
+ g_strdup_printf ("UPDATE persona_recapiti"
" SET status = 'E'"
" WHERE id = %d",
id));
"|lstore_posizioni_economiche"
"|lstore_tipi_prestazione"
"|lstore_profili_professionali"
- "|w_organigramma_persona_incarico", "|", -1),
+ "|w_persona_incarico", "|", -1),
&error);
if (error != 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, "organigramma_persona_incarico.form", NULL), priv->commons->gtkbuilder);
+ gtk_form_load_from_file (priv->form, g_build_filename (priv->commons->formdir, "persona_incarico.form", NULL), priv->commons->gtkbuilder);
- priv->w = GTK_WIDGET (gtk_builder_get_object (priv->commons->gtkbuilder, "w_organigramma_persona_incarico"));
+ priv->w = GTK_WIDGET (gtk_builder_get_object (priv->commons->gtkbuilder, "w_persona_incarico"));
priv->objects = gtk_form_get_objects_by_name (priv->form,
"label129",
error = NULL;
gtk_builder_add_objects_from_file (priv->commons->gtkbuilder, priv->commons->guifile,
- g_strsplit ("w_organigramma_persona_nodo", "|", -1),
+ g_strsplit ("w_persona_nodo", "|", -1),
&error);
if (error != 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, "organigramma_persona_nodo.form", NULL), priv->commons->gtkbuilder);
+ gtk_form_load_from_file (priv->form, g_build_filename (priv->commons->formdir, "persona_nodo.form", NULL), priv->commons->gtkbuilder);
- priv->w = GTK_WIDGET (gtk_builder_get_object (priv->commons->gtkbuilder, "w_organigramma_persona_nodo"));
+ priv->w = GTK_WIDGET (gtk_builder_get_object (priv->commons->gtkbuilder, "w_persona_nodo"));
priv->objects = gtk_form_get_objects_by_name (priv->form,
"label116",
error = NULL;
gtk_builder_add_objects_from_file (priv->commons->gtkbuilder, priv->commons->guifile,
- g_strsplit ("lstore_tipi_recapito|w_organigramma_persona_nodo_recapito", "|", -1),
+ g_strsplit ("lstore_tipi_recapito|w_persona_nodo_recapito", "|", -1),
&error);
if (error != 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, "organigramma_persona_nodo_recapito.form", NULL), priv->commons->gtkbuilder);
+ gtk_form_load_from_file (priv->form, g_build_filename (priv->commons->formdir, "persona_nodo_recapito.form", NULL), priv->commons->gtkbuilder);
- priv->w = GTK_WIDGET (gtk_builder_get_object (priv->commons->gtkbuilder, "w_organigramma_persona_nodo_recapito"));
+ priv->w = GTK_WIDGET (gtk_builder_get_object (priv->commons->gtkbuilder, "w_persona_nodo_recapito"));
priv->objects = gtk_form_get_objects_by_name (priv->form,
"label122",
error = NULL;
gtk_builder_add_objects_from_file (priv->commons->gtkbuilder, priv->commons->guifile,
- g_strsplit ("lstore_tipi_recapito|w_organigramma_persona_recapito", "|", -1),
+ g_strsplit ("lstore_tipi_recapito|w_persona_recapito", "|", -1),
&error);
if (error != 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, "organigramma_persona_recapito.form", NULL), priv->commons->gtkbuilder);
+ gtk_form_load_from_file (priv->form, g_build_filename (priv->commons->formdir, "persona_recapito.form", NULL), priv->commons->gtkbuilder);
- priv->w = GTK_WIDGET (gtk_builder_get_object (priv->commons->gtkbuilder, "w_organigramma_persona_recapito"));
+ priv->w = GTK_WIDGET (gtk_builder_get_object (priv->commons->gtkbuilder, "w_persona_recapito"));
priv->objects = gtk_form_get_objects_by_name (priv->form,
"label103",
error = NULL;
gtk_builder_add_objects_from_file (priv->commons->gtkbuilder, priv->commons->guifile,
- g_strsplit ("w_organigramma_persona_ufficio", "|", -1),
+ g_strsplit ("w_persona_ufficio", "|", -1),
&error);
if (error != 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, "organigramma_persona_ufficio.form", NULL), priv->commons->gtkbuilder);
+ gtk_form_load_from_file (priv->form, g_build_filename (priv->commons->formdir, "persona_ufficio.form", NULL), priv->commons->gtkbuilder);
- priv->w = GTK_WIDGET (gtk_builder_get_object (priv->commons->gtkbuilder, "w_organigramma_persona_ufficio"));
+ priv->w = GTK_WIDGET (gtk_builder_get_object (priv->commons->gtkbuilder, "w_persona_ufficio"));
priv->objects = gtk_form_get_objects_by_name (priv->form,
"label90",
error = NULL;
gtk_builder_add_objects_from_file (priv->commons->gtkbuilder, priv->commons->guifile,
- g_strsplit ("lstore_tipi_recapito|w_organigramma_persona_ufficio_recapito", "|", -1),
+ g_strsplit ("lstore_tipi_recapito|w_persona_ufficio_recapito", "|", -1),
&error);
if (error != 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, "organigramma_persona_ufficio_recapito.form", NULL), priv->commons->gtkbuilder);
+ gtk_form_load_from_file (priv->form, g_build_filename (priv->commons->formdir, "persona_ufficio_recapito.form", NULL), priv->commons->gtkbuilder);
- priv->w = GTK_WIDGET (gtk_builder_get_object (priv->commons->gtkbuilder, "w_organigramma_persona_ufficio_recapito"));
+ priv->w = GTK_WIDGET (gtk_builder_get_object (priv->commons->gtkbuilder, "w_persona_ufficio_recapito"));
priv->objects = gtk_form_get_objects_by_name (priv->form,
"label96",
*/
#include <libgtkform/form.h>
+#include <libterritorio/via.h>
#include "struttura.h"
#include "strutturaindirizzo.h"
error = NULL;
gtk_builder_add_objects_from_file (priv->commons->gtkbuilder, priv->commons->guifile,
- g_strsplit (g_strconcat ("lstore_organigramma_struttura_indirizzi",
- "|w_struttura", NULL), "|", -1),
+ g_strsplit ("lstore_struttura_indirizzi"
+ "|w_struttura",
+ "|", -1),
&error);
if (error != NULL)
{
priv->objects = gtk_form_get_objects_by_name (priv->form,
"label31",
- "lstore_organigramma_struttura_indirizzi",
+ "lstore_struttura_indirizzi",
NULL);
g_signal_connect (priv->w,
guint row;
guint rows;
+ GHashTable *ht_via;
+
OrganigrammaStrutturaPrivate *priv = ORGANIGRAMMA_STRUTTURA_GET_PRIVATE (struttura);
gtk_list_store_clear (GTK_LIST_STORE (priv->objects[LSTORE_INDIRIZZI]));
- sql = g_strdup_printf ("SELECT si.id, v.nome, si.civico"
- " FROM organigramma_struttura_indirizzi si INNER JOIN vie v ON"
- " si.id_vie = v.id"
+ sql = g_strdup_printf ("SELECT si.id, si.id_vie, si.civico"
+ " FROM struttura_indirizzi AS si"
" WHERE si.id_strutture = %d"
- " AND status <> 'E'",
+ " AND si.status <> 'E'",
priv->id);
dm = gdaex_query (priv->commons->gdaex, sql);
+ g_free (sql);
if (dm != NULL)
{
GtkTreeIter iter;
rows = gda_data_model_get_n_rows (dm);
for (row = 0; row < rows; row++)
{
+ ht_via = territorio_via_get_by_id (priv->commons->territorio_commons, gdaex_data_model_get_field_value_integer_at (dm, row, "id_vie"));
+
gtk_list_store_append (GTK_LIST_STORE (priv->objects[LSTORE_INDIRIZZI]), &iter);
gtk_list_store_set (GTK_LIST_STORE (priv->objects[LSTORE_INDIRIZZI]), &iter,
- INDIRIZZI_COL_ID, gdaex_data_model_get_value_integer_at (dm, row, 0),
- INDIRIZZI_COL_INDIRIZZO, g_strconcat (gdaex_data_model_get_value_stringify_at (dm, row, 1),
- (g_strcmp0 (gdaex_data_model_get_value_stringify_at (dm, row, 2), "") != 0 ? g_strdup_printf (", %s", gdaex_data_model_get_value_stringify_at (dm, row, 2)) : ""), NULL),
+ INDIRIZZI_COL_ID, gdaex_data_model_get_field_value_integer_at (dm, row, "id"),
+ INDIRIZZI_COL_INDIRIZZO, g_strconcat (gda_value_stringify (g_hash_table_lookup (ht_via, "nome")),
+ (g_strcmp0 (gdaex_data_model_get_field_value_stringify_at (dm, row, "civico"), "") != 0 ? g_strdup_printf (", %s", gdaex_data_model_get_field_value_stringify_at (dm, row, "civico")) : ""), NULL),
-1);
+
+ g_hash_table_destroy (ht_via);
}
g_object_unref (dm);
-1);
gdaex_execute (priv->commons->gdaex,
- g_strdup_printf ("UPDATE organigramma_struttura_indirizzi"
+ g_strdup_printf ("UPDATE struttura_indirizzi"
" SET status = 'E'"
" WHERE id = %d",
id));
#endif
#include <libgtkform/form.h>
+#include <libterritorio/vie.h>
#include "strutturaindirizzo.h"
-#include "vie.h"
static void organigramma_struttura_indirizzo_class_init (OrganigrammaStrutturaIndirizzoClass *klass);
static void organigramma_struttura_indirizzo_init (OrganigrammaStrutturaIndirizzo *struttura_indirizzo);
priv->form = gtk_form_new ();
g_object_set (G_OBJECT (priv->form), "gdaex", priv->commons->gdaex, NULL);
+ gtk_form_add_db_connection_gdaex (priv->form, "territorio", commons->territorio_commons->gdaex);
gtk_form_load_from_file (priv->form, g_build_filename (priv->commons->formdir, "struttura_indirizzo.form", NULL), priv->commons->gtkbuilder);
priv->w = GTK_WIDGET (gtk_builder_get_object (priv->commons->gtkbuilder, "w_struttura_indirizzo"));
organigramma_struttura_indirizzo_set_property (GObject *object, guint property_id, const GValue *value, GParamSpec *pspec)
{
OrganigrammaStrutturaIndirizzo *struttura_indirizzo = ORGANIGRAMMA_STRUTTURA_INDIRIZZO (object);
-
OrganigrammaStrutturaIndirizzoPrivate *priv = ORGANIGRAMMA_STRUTTURA_INDIRIZZO_GET_PRIVATE (struttura_indirizzo);
switch (property_id)
organigramma_struttura_indirizzo_get_property (GObject *object, guint property_id, GValue *value, GParamSpec *pspec)
{
OrganigrammaStrutturaIndirizzo *struttura_indirizzo = ORGANIGRAMMA_STRUTTURA_INDIRIZZO (object);
-
OrganigrammaStrutturaIndirizzoPrivate *priv = ORGANIGRAMMA_STRUTTURA_INDIRIZZO_GET_PRIVATE (struttura_indirizzo);
switch (property_id)
static void
organigramma_struttura_indirizzo_on_btn_ricerca_via_clicked (GtkButton *button,
- gpointer user_data)
+ gpointer user_data)
{
GtkWidget *w;
OrganigrammaStrutturaIndirizzo *ia = (OrganigrammaStrutturaIndirizzo *)user_data;
OrganigrammaStrutturaIndirizzoPrivate *priv = ORGANIGRAMMA_STRUTTURA_INDIRIZZO_GET_PRIVATE (ia);
- Vie *v = vie_new (priv->commons);
+ TerritorioVie *v = territorio_vie_new (priv->commons->territorio_commons, TRUE);
+
+ /* da parametrizzare */
+ g_object_set (G_OBJECT (v), "comune", 4408, NULL);
g_signal_connect (G_OBJECT (v), "selezionato",
- G_CALLBACK (organigramma_struttura_indirizzo_on_vie_selezionato), (gpointer)ia);
+ G_CALLBACK (organigramma_struttura_indirizzo_on_vie_selezionato), user_data);
- w = vie_get_widget (v);
+ w = territorio_vie_get_widget (v);
gtk_window_set_transient_for (GTK_WINDOW (w), GTK_WINDOW (priv->w));
gtk_widget_show (w);
}
return NULL;
}
- priv->form = gtk_form_new_from_file (g_build_filename (priv->commons->formdir, "organigramma_tipo_nodo.form", NULL), priv->commons->gtkbuilder);
+ priv->form = gtk_form_new_from_file (g_build_filename (priv->commons->formdir, "tipo_nodo.form", NULL), priv->commons->gtkbuilder);
g_object_set (priv->form, "gdaex", priv->commons->gdaex, NULL);
error = NULL;
gtk_builder_add_objects_from_file (priv->commons->gtkbuilder, priv->commons->guifile,
- g_strsplit ("lstore_organigramma_ufficio_nodi"
- "|lstore_organigramma_ufficio_stanze"
- "|lstore_organigramma_ufficio_recapiti"
- "|lstore_organigramma_ufficio_orari"
+ g_strsplit ("lstore_ufficio_nodi"
+ "|lstore_ufficio_stanze"
+ "|lstore_ufficio_recapiti"
+ "|lstore_ufficio_orari"
"|w_ufficio", "|", -1),
&error);
if (error != NULL)
priv->objects = gtk_form_get_objects_by_name (priv->form,
"label23",
- "lstore_organigramma_ufficio_nodi",
- "lstore_organigramma_ufficio_stanze",
- "lstore_organigramma_ufficio_recapiti",
- "lstore_organigramma_ufficio_orari",
+ "lstore_ufficio_nodi",
+ "lstore_ufficio_stanze",
+ "lstore_ufficio_recapiti",
+ "lstore_ufficio_orari",
NULL);
priv->sel_nodi = gtk_tree_view_get_selection (GTK_TREE_VIEW (gtk_builder_get_object (priv->commons->gtkbuilder, "treeview7")));
gtk_list_store_clear (GTK_LIST_STORE (priv->objects[LSTORE_NODI]));
sql = g_strdup_printf ("SELECT tn.nome AS tipo, si.id, v.nome AS nome"
- " FROM organigramma_ufficio_nodi si INNER JOIN nodi v ON si.id_nodi = v.id"
- " INNER JOIN tipi_nodo tn ON v.id_tipi_nodo = tn.id"
+ " FROM ufficio_nodi AS si"
+ " INNER JOIN nodi AS v ON si.id_nodi = v.id"
+ " INNER JOIN tipi_nodo AS tn ON v.id_tipi_nodo = tn.id"
" WHERE si.id_uffici = %d"
" AND si.status <> 'E'",
priv->id);
gtk_list_store_clear (GTK_LIST_STORE (priv->objects[LSTORE_STANZE]));
sql = g_strdup_printf ("SELECT us.id, us.piano, us.da_stanza, us.a_stanza"
- " FROM organigramma_ufficio_stanze AS us"
+ " FROM ufficio_stanze AS us"
" WHERE us.id_uffici = %d"
" AND us.status <> 'E'"
" ORDER BY us.piano, us.da_stanza, us.a_stanza",
gtk_list_store_clear (GTK_LIST_STORE (priv->objects[LSTORE_RECAPITI]));
sql = g_strdup_printf ("SELECT v.nome AS tipo, si.id, si.recapito"
- " FROM organigramma_ufficio_recapiti si INNER JOIN tipi_recapito v ON si.id_tipi_recapito = v.id"
+ " FROM ufficio_recapiti AS si"
+ " INNER JOIN tipi_recapito AS v ON si.id_tipi_recapito = v.id"
" WHERE si.id_uffici = %d"
" AND si.status <> 'E'",
priv->id);
gtk_list_store_clear (GTK_LIST_STORE (priv->objects[LSTORE_ORARI]));
sql = g_strdup_printf ("SELECT *"
- " FROM organigramma_ufficio_orari si"
+ " FROM ufficio_orari AS si"
" WHERE si.id_uffici = %d"
" AND si.status <> 'E'",
priv->id);
-1);
gdaex_execute (priv->commons->gdaex,
- g_strdup_printf ("UPDATE organigramma_ufficio_nodi"
+ g_strdup_printf ("UPDATE ufficio_nodi"
" SET status = 'E'"
" WHERE id = %d",
id));
-1);
gdaex_execute (priv->commons->gdaex,
- g_strdup_printf ("UPDATE organigramma_ufficio_stanze"
+ g_strdup_printf ("UPDATE ufficio_stanze"
" SET status = 'E'"
" WHERE id = %d",
id));
-1);
gdaex_execute (priv->commons->gdaex,
- g_strdup_printf ("UPDATE organigramma_ufficio_recapiti"
+ g_strdup_printf ("UPDATE ufficio_recapiti"
" SET status = 'E'"
" WHERE id = %d",
id));
-1);
gdaex_execute (priv->commons->gdaex,
- g_strdup_printf ("UPDATE organigramma_ufficio_orari"
+ g_strdup_printf ("UPDATE ufficio_orari"
" SET status = 'E'"
" WHERE id = %d",
id));
error = NULL;
gtk_builder_add_objects_from_file (priv->commons->gtkbuilder, priv->commons->guifile,
- g_strsplit ("w_organigramma_ufficio_nodo", "|", -1),
+ g_strsplit ("w_ufficio_nodo", "|", -1),
&error);
if (error != 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, "organigramma_ufficio_nodo.form", NULL), priv->commons->gtkbuilder);
+ gtk_form_load_from_file (priv->form, g_build_filename (priv->commons->formdir, "ufficio_nodo.form", NULL), priv->commons->gtkbuilder);
- priv->w = GTK_WIDGET (gtk_builder_get_object (priv->commons->gtkbuilder, "w_organigramma_ufficio_nodo"));
+ priv->w = GTK_WIDGET (gtk_builder_get_object (priv->commons->gtkbuilder, "w_ufficio_nodo"));
priv->objects = gtk_form_get_objects_by_name (priv->form,
"label38",
error = NULL;
gtk_builder_add_objects_from_file (priv->commons->gtkbuilder, priv->commons->guifile,
- g_strsplit ("adj_week|adj_dmon|lstore_mesi|w_organigramma_ufficio_orario", "|", -1),
+ g_strsplit ("adj_week|adj_dmon|lstore_mesi|w_ufficio_orario", "|", -1),
&error);
if (error != 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, "organigramma_ufficio_orario.form", NULL), priv->commons->gtkbuilder);
+ gtk_form_load_from_file (priv->form, g_build_filename (priv->commons->formdir, "ufficio_orario.form", NULL), priv->commons->gtkbuilder);
- priv->w = GTK_WIDGET (gtk_builder_get_object (priv->commons->gtkbuilder, "w_organigramma_ufficio_orario"));
+ priv->w = GTK_WIDGET (gtk_builder_get_object (priv->commons->gtkbuilder, "w_ufficio_orario"));
priv->objects = gtk_form_get_objects_by_name (priv->form,
"label52",
error = NULL;
gtk_builder_add_objects_from_file (priv->commons->gtkbuilder, priv->commons->guifile,
- g_strsplit ("lstore_tipi_recapito|w_organigramma_ufficio_recapito", "|", -1),
+ g_strsplit ("lstore_tipi_recapito|w_ufficio_recapito", "|", -1),
&error);
if (error != 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, "organigramma_ufficio_recapito.form", NULL), priv->commons->gtkbuilder);
+ gtk_form_load_from_file (priv->form, g_build_filename (priv->commons->formdir, "ufficio_recapito.form", NULL), priv->commons->gtkbuilder);
- priv->w = GTK_WIDGET (gtk_builder_get_object (priv->commons->gtkbuilder, "w_organigramma_ufficio_recapito"));
+ priv->w = GTK_WIDGET (gtk_builder_get_object (priv->commons->gtkbuilder, "w_ufficio_recapito"));
priv->objects = gtk_form_get_objects_by_name (priv->form,
"label41",
error = NULL;
gtk_builder_add_objects_from_file (priv->commons->gtkbuilder, priv->commons->guifile,
- g_strsplit ("w_organigramma_ufficio_stanza", "|", -1),
+ g_strsplit ("w_ufficio_stanza", "|", -1),
&error);
if (error != 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, "organigramma_ufficio_stanza.form", NULL), priv->commons->gtkbuilder);
+ gtk_form_load_from_file (priv->form, g_build_filename (priv->commons->formdir, "ufficio_stanza.form", NULL), priv->commons->gtkbuilder);
- priv->w = GTK_WIDGET (gtk_builder_get_object (priv->commons->gtkbuilder, "w_organigramma_ufficio_stanza"));
+ priv->w = GTK_WIDGET (gtk_builder_get_object (priv->commons->gtkbuilder, "w_ufficio_stanza"));
priv->objects = gtk_form_get_objects_by_name (priv->form,
"label163",
+++ /dev/null
-/*
- * Copyright (C) 2010 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
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- */
-
-#ifdef HAVE_CONFIG_H
- #include <config.h>
-#endif
-
-#include <string.h>
-
-#include "vie.h"
-
-static void vie_class_init (VieClass *klass);
-static void vie_init (Vie *vie);
-
-static void vie_carica (Vie *vie);
-
-static void vie_set_property (GObject *object,
- guint property_id,
- const GValue *value,
- GParamSpec *pspec);
-static void vie_get_property (GObject *object,
- guint property_id,
- GValue *value,
- GParamSpec *pspec);
-
-#define VIE_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE ((obj), TYPE_VIE, ViePrivate))
-
-
-static void vie_on_btn_annulla_clicked (GtkButton *button,
- gpointer user_data);
-static void vie_on_btn_seleziona_clicked (GtkButton *button,
- gpointer user_data);
-static void vie_on_trv_vie_row_activated (GtkTreeView *tree_view,
- GtkTreePath *tree_path,
- GtkTreeViewColumn *column,
- gpointer user_data);
-
-static gboolean search_func (GtkTreeModel *model,
- gint column,
- const gchar *key,
- GtkTreeIter *iter,
- gpointer search_data);
-
-enum
-{
- COL_ID,
- COL_NOME,
- COLS
-};
-
-typedef struct _ViePrivate ViePrivate;
-struct _ViePrivate
- {
- OrganigrammaCommons *commons;
-
- GtkWidget *w;
- GtkWidget *trv_vie;
-
- GtkListStore *lstore_vie;
- GtkTreeSelection *selection;
- };
-
-G_DEFINE_TYPE (Vie, vie, G_TYPE_OBJECT)
-
-static void
-vie_class_init (VieClass *klass)
-{
- GObjectClass *object_class = G_OBJECT_CLASS (klass);
-
- g_type_class_add_private (object_class, sizeof (ViePrivate));
-
- object_class->set_property = vie_set_property;
- object_class->get_property = vie_get_property;
-
- /**
- * Vie::selezionato:
- * @vie:
- *
- */
- klass->selezionato_signal_id = g_signal_new ("selezionato",
- G_TYPE_FROM_CLASS (object_class),
- G_SIGNAL_RUN_LAST,
- 0,
- NULL,
- NULL,
- g_cclosure_marshal_VOID__UINT,
- G_TYPE_NONE,
- 1, G_TYPE_UINT);
-}
-
-static void
-vie_init (Vie *vie)
-{
- ViePrivate *priv = VIE_GET_PRIVATE (vie);
-}
-
-/**
- * vie_new:
- * @commons:
- *
- * Returns: the newly created #Vie object.
- */
-Vie
-*vie_new (OrganigrammaCommons *commons)
-{
- GError *error;
-
- Vie *a = VIE (g_object_new (vie_get_type (), NULL));
-
- ViePrivate *priv = VIE_GET_PRIVATE (a);
-
- priv->commons = commons;
-
- error = NULL;
-
- gtk_builder_add_objects_from_file (priv->commons->gtkbuilder, priv->commons->guifile,
- g_strsplit (g_strconcat ("lstore_vie|w_vie",
- NULL), "|", -1),
- &error);
- if (error != NULL)
- {
- g_fprintf (stderr, "Errore: %s\n", error->message);
- return NULL;
- }
-
- priv->w = GTK_WIDGET (gtk_builder_get_object (priv->commons->gtkbuilder, "w_vie"));
- priv->trv_vie = GTK_WIDGET (gtk_builder_get_object (priv->commons->gtkbuilder, "treeview8"));
- priv->lstore_vie = GTK_LIST_STORE (gtk_builder_get_object (priv->commons->gtkbuilder, "lstore_vie"));
- priv->selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (priv->trv_vie));
-
- g_signal_connect (G_OBJECT (gtk_builder_get_object (priv->commons->gtkbuilder, "button52")),
- "clicked", G_CALLBACK (vie_on_btn_annulla_clicked), (gpointer)a);
- g_signal_connect (G_OBJECT (gtk_builder_get_object (priv->commons->gtkbuilder, "button53")),
- "clicked", G_CALLBACK (vie_on_btn_seleziona_clicked), (gpointer)a);
- g_signal_connect (G_OBJECT (priv->trv_vie),
- "row-activated", G_CALLBACK (vie_on_trv_vie_row_activated), (gpointer)a);
-
- gtk_tree_view_set_search_equal_func (GTK_TREE_VIEW (priv->trv_vie), search_func, NULL, NULL);
-
- vie_carica (a);
-
- return a;
-}
-
-/**
- * vie_get_widget:
- * @vie:
- *
- */
-GtkWidget
-*vie_get_widget (Vie *vie)
-{
- ViePrivate *priv = VIE_GET_PRIVATE (vie);
-
- return priv->w;
-}
-
-/**
- * vie_carica:
- * @vie:
- *
- */
-static void
-vie_carica (Vie *vie)
-{
- GError *error;
- GtkTreeIter iter;
- GdaDataModel *dm;
-
- gchar *sql;
- gint rows;
- gint row;
-
- ViePrivate *priv = VIE_GET_PRIVATE (vie);
-
- gtk_list_store_clear (priv->lstore_vie);
-
- error = NULL;
- sql = g_strdup_printf ("SELECT v.id, v.nome FROM vie v"
- " ORDER BY v.nome");
- dm = gdaex_query (priv->commons->gdaex, sql);
-
- if (dm != NULL)
- {
- rows = gda_data_model_get_n_rows (dm);
- for (row = 0; row < rows; row++)
- {
- gtk_list_store_append (priv->lstore_vie, &iter);
-
- gtk_list_store_set (priv->lstore_vie, &iter,
- COL_ID, gdaex_data_model_get_value_integer_at (dm, row, 0),
- COL_NOME, gdaex_data_model_get_value_stringify_at (dm, row, 1),
- -1);
- }
-
- g_object_unref (dm);
- }
-}
-
-/* PRIVATE */
-static void
-vie_seleziona (Vie *vie)
-{
- GtkTreeIter iter;
- guint id;
-
- VieClass *klass = VIE_GET_CLASS (vie);
- ViePrivate *priv = VIE_GET_PRIVATE (vie);
-
- if (gtk_tree_selection_get_selected (priv->selection, NULL, &iter))
- {
- gtk_tree_model_get (GTK_TREE_MODEL (priv->lstore_vie), &iter,
- 0, &id,
- -1);
-
- g_signal_emit (vie, klass->selezionato_signal_id, 0, id);
-
- gtk_widget_destroy (priv->w);
- g_object_unref (vie);
- }
- else
- {
- GtkWidget *dialog = gtk_message_dialog_new (GTK_WINDOW (priv->w),
- GTK_DIALOG_DESTROY_WITH_PARENT,
- GTK_MESSAGE_WARNING,
- GTK_BUTTONS_OK,
- "Occorre prima selezionare una via");
- gtk_dialog_run (GTK_DIALOG (dialog));
- gtk_widget_destroy (dialog);
- }
-}
-
-static void
-vie_set_property (GObject *object, guint property_id, const GValue *value, GParamSpec *pspec)
-{
- Vie *vie = VIE (object);
-
- ViePrivate *priv = VIE_GET_PRIVATE (vie);
-
- switch (property_id)
- {
- default:
- G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
- break;
- }
-}
-
-static void
-vie_get_property (GObject *object, guint property_id, GValue *value, GParamSpec *pspec)
-{
- Vie *vie = VIE (object);
-
- ViePrivate *priv = VIE_GET_PRIVATE (vie);
-
- switch (property_id)
- {
- default:
- G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
- break;
- }
-}
-
-/* CALLBACK */
-static void
-vie_on_btn_annulla_clicked (GtkButton *button,
- gpointer user_data)
-{
- ViePrivate *priv = VIE_GET_PRIVATE ((Vie *)user_data);
-
- gtk_widget_destroy (priv->w);
- g_object_unref (user_data);
-}
-
-static void
-vie_on_btn_seleziona_clicked (GtkButton *button,
- gpointer user_data)
-{
- vie_seleziona ((Vie *)user_data);
-}
-
-static void
-vie_on_trv_vie_row_activated (GtkTreeView *tree_view,
- GtkTreePath *tree_path,
- GtkTreeViewColumn *column,
- gpointer user_data)
-{
- vie_seleziona ((Vie *)user_data);
-}
-
-static gboolean
-search_func (GtkTreeModel *model,
- gint column,
- const gchar *key,
- GtkTreeIter *iter,
- gpointer search_data)
-{
- gchar *str;
- char *ret;
-
- ret = NULL;
-
- gtk_tree_model_get (model, iter, column, &str, -1);
- ret = strstr ((const char *)g_utf8_strdown (str, -1), (const char *)g_utf8_strdown (key, -1));
-
- return (ret == NULL);
-}
+++ /dev/null
-/*
- * Copyright (C) 2009 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
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- */
-
-#ifndef __VIE_H__
-#define __VIE_H__
-
-#include <glib.h>
-#include <glib-object.h>
-
-#include <gtk/gtk.h>
-
-#include "commons.h"
-
-G_BEGIN_DECLS
-
-
-#define TYPE_VIE (vie_get_type ())
-#define VIE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_VIE, Vie))
-#define VIE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_VIE, VieClass))
-#define IS_VIE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_VIE))
-#define IS_VIE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_VIE))
-#define VIE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_VIE, VieClass))
-
-
-typedef struct _Vie Vie;
-typedef struct _VieClass VieClass;
-
-struct _Vie
- {
- GObject parent;
- };
-
-struct _VieClass
- {
- GObjectClass parent_class;
-
- guint selezionato_signal_id;
- };
-
-GType vie_get_type (void) G_GNUC_CONST;
-
-Vie *vie_new (OrganigrammaCommons *commons);
-
-GtkWidget *vie_get_widget (Vie *vie);
-
-
-G_END_DECLS
-
-#endif /* __VIE_H__ */