]> saetta.ns0.it Git - solipa/organigramma/commitdiff
Integrazione con territorio (closes #105).
authorAndrea Zagli <a.zagli@comune.scandicci.fi.it>
Wed, 28 Nov 2012 08:06:22 +0000 (09:06 +0100)
committerAndrea Zagli <a.zagli@comune.scandicci.fi.it>
Wed, 28 Nov 2012 08:06:22 +0000 (09:06 +0100)
29 files changed:
.cproject
.project
configure.ac
data/organigramma/form/persona.form
data/organigramma/form/struttura_indirizzo.form
docs/organigramma.sql
docs/organigramma/examples/organigramma.conf
liborganigramma.pc.in
libreria/Makefile.am
src/Makefile.am
src/commons.h
src/main.c
src/persona.c
src/personaincarico.c
src/personanodo.c
src/personanodorecapito.c
src/personarecapito.c
src/personaufficio.c
src/personaufficiorecapito.c
src/struttura.c
src/strutturaindirizzo.c
src/tiponodo.c
src/ufficio.c
src/ufficionodo.c
src/ufficioorario.c
src/ufficiorecapito.c
src/ufficiostanza.c
src/vie.c [deleted file]
src/vie.h [deleted file]

index 71d0b5db439e06060c30fb10db0e9524a03cfc7e..f8f50dfa221bbb6f3d46f01c4ab59a2220e31a87 100644 (file)
--- a/.cproject
+++ b/.cproject
                                                        <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="&quot;C:\mingw\include&quot;"/>
                                                                        <listOptionValue builtIn="false" value="&quot;C:\mingw\include\glib-2.0&quot;"/>
                                                                        <listOptionValue builtIn="false" value="&quot;C:\mingw\include\gtk-2.0&quot;"/>
index 9dff314ad9baf6848bd7f4d179f5653cdd5bbdc1..b78b2d7b4699fdb8c3d83822fef26f06dbb3f84a 100644 (file)
--- a/.project
+++ b/.project
@@ -69,7 +69,7 @@
        </natures>
        <filteredResources>
                <filter>
-                       <id>1317140058877</id>
+                       <id>1354028400899</id>
                        <name></name>
                        <type>30</type>
                        <matcher>
@@ -78,7 +78,7 @@
                        </matcher>
                </filter>
                <filter>
-                       <id>1317140058880</id>
+                       <id>1354028400903</id>
                        <name></name>
                        <type>22</type>
                        <matcher>
@@ -87,7 +87,7 @@
                        </matcher>
                </filter>
                <filter>
-                       <id>1317140058883</id>
+                       <id>1354028400914</id>
                        <name></name>
                        <type>22</type>
                        <matcher>
@@ -96,7 +96,7 @@
                        </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>
index 65bd891189a5f539c01ea5f1078d657477b62037..dce3522d128827719768951750cf45a5b8b11c68 100644 (file)
@@ -27,7 +27,8 @@ AC_PROG_RANLIB
 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)
index 548884fbf861d4d0c8e2bdb0ce8928aa8ce15c3b..fcb243b73f76aa8762a29a245147b7bfe96fa2e6 100644 (file)
@@ -51,8 +51,9 @@
        <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">
index 21f60cef55836af2b361626ca901132454046b0e..f57f0fee005e1a488a562377d99fa8510172d10c 100644 (file)
        <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">
index 60a45ff01307600c13180860eca9f0ec81ab848d..25e66647118242177c0977f039ae0fab47c4cb4f 100644 (file)
@@ -2,9 +2,9 @@
 -- 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';
@@ -14,7 +14,7 @@ SET client_min_messages = warning;
 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: -
 --
 
@@ -26,8 +26,7 @@ SET search_path = public, pg_catalog;
 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: -
 --
 
@@ -42,8 +41,7 @@ CREATE TABLE nodi (
 
 
 --
--- 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: -
 --
 
@@ -64,8 +62,7 @@ CREATE TABLE persona_incarichi (
 
 
 --
--- 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: -
 --
 
@@ -81,8 +78,7 @@ CREATE TABLE persona_nodi (
 
 
 --
--- 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: -
 --
 
@@ -99,8 +95,7 @@ CREATE TABLE persona_nodo_recapiti (
 
 
 --
--- 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: -
 --
 
@@ -116,8 +111,7 @@ CREATE TABLE persona_recapiti (
 
 
 --
--- 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: -
 --
 
@@ -135,8 +129,7 @@ CREATE TABLE persona_uffici (
 
 
 --
--- 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: -
 --
 
@@ -153,8 +146,7 @@ CREATE TABLE persona_ufficio_recapiti (
 
 
 --
--- 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: -
 --
 
@@ -174,8 +166,7 @@ CREATE TABLE persone (
 
 
 --
--- 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: -
 --
 
@@ -187,8 +178,7 @@ CREATE TABLE posizioni_economiche (
 
 
 --
--- 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: -
 --
 
@@ -200,8 +190,7 @@ CREATE TABLE profili_professionali (
 
 
 --
--- 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: -
 --
 
@@ -216,8 +205,7 @@ CREATE TABLE struttura_indirizzi (
 
 
 --
--- 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: -
 --
 
@@ -232,8 +220,7 @@ CREATE TABLE strutture (
 
 
 --
--- 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: -
 --
 
@@ -245,8 +232,7 @@ CREATE TABLE tipi_nodo (
 
 
 --
--- 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: -
 --
 
@@ -258,8 +244,7 @@ CREATE TABLE tipi_prestazione (
 
 
 --
--- 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: -
 --
 
@@ -271,8 +256,7 @@ CREATE TABLE tipi_rapporto_lavoro (
 
 
 --
--- 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: -
 --
 
@@ -284,8 +268,7 @@ CREATE TABLE tipi_recapito (
 
 
 --
--- 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: -
 --
 
@@ -298,8 +281,7 @@ CREATE TABLE titoli (
 
 
 --
--- 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: -
 --
 
@@ -313,8 +295,7 @@ CREATE TABLE uffici (
 
 
 --
--- 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: -
 --
 
@@ -328,8 +309,7 @@ CREATE TABLE ufficio_nodi (
 
 
 --
--- 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: -
 --
 
@@ -356,8 +336,7 @@ CREATE TABLE ufficio_orari (
 
 
 --
--- 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: -
 --
 
@@ -373,8 +352,7 @@ CREATE TABLE ufficio_recapiti (
 
 
 --
--- 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: -
 --
 
@@ -390,20 +368,7 @@ CREATE TABLE ufficio_stanze (
 
 
 --
--- 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: -
 --
 
@@ -412,8 +377,7 @@ ALTER TABLE ONLY nodi
 
 
 --
--- 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: -
 --
 
@@ -422,8 +386,7 @@ ALTER TABLE ONLY persona_incarichi
 
 
 --
--- 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: -
 --
 
@@ -432,8 +395,7 @@ ALTER TABLE ONLY persona_nodi
 
 
 --
--- 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: -
 --
 
@@ -442,8 +404,7 @@ ALTER TABLE ONLY persona_nodo_recapiti
 
 
 --
--- 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: -
 --
 
@@ -452,8 +413,7 @@ ALTER TABLE ONLY persona_recapiti
 
 
 --
--- 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: -
 --
 
@@ -462,8 +422,7 @@ ALTER TABLE ONLY persona_uffici
 
 
 --
--- 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: -
 --
 
@@ -472,8 +431,7 @@ ALTER TABLE ONLY persona_ufficio_recapiti
 
 
 --
--- 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: -
 --
 
@@ -482,8 +440,7 @@ ALTER TABLE ONLY persone
 
 
 --
--- 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: -
 --
 
@@ -492,8 +449,7 @@ ALTER TABLE ONLY posizioni_economiche
 
 
 --
--- 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: -
 --
 
@@ -502,8 +458,7 @@ ALTER TABLE ONLY profili_professionali
 
 
 --
--- 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: -
 --
 
@@ -512,8 +467,7 @@ ALTER TABLE ONLY struttura_indirizzi
 
 
 --
--- 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: -
 --
 
@@ -522,8 +476,7 @@ ALTER TABLE ONLY strutture
 
 
 --
--- 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: -
 --
 
@@ -532,8 +485,7 @@ ALTER TABLE ONLY tipi_nodo
 
 
 --
--- 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: -
 --
 
@@ -542,8 +494,7 @@ ALTER TABLE ONLY tipi_prestazione
 
 
 --
--- 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: -
 --
 
@@ -552,8 +503,7 @@ ALTER TABLE ONLY tipi_rapporto_lavoro
 
 
 --
--- 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: -
 --
 
@@ -562,8 +512,7 @@ ALTER TABLE ONLY tipi_recapito
 
 
 --
--- 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: -
 --
 
@@ -572,8 +521,7 @@ ALTER TABLE ONLY titoli
 
 
 --
--- 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: -
 --
 
@@ -582,8 +530,7 @@ ALTER TABLE ONLY uffici
 
 
 --
--- 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: -
 --
 
@@ -592,8 +539,7 @@ ALTER TABLE ONLY ufficio_nodi
 
 
 --
--- 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: -
 --
 
@@ -602,8 +548,7 @@ ALTER TABLE ONLY ufficio_orari
 
 
 --
--- 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: -
 --
 
@@ -612,8 +557,7 @@ ALTER TABLE ONLY ufficio_recapiti
 
 
 --
--- 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: -
 --
 
@@ -621,17 +565,7 @@ ALTER TABLE ONLY ufficio_stanze
     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
index 91d9111aa46ec5d0b18f07b29cb17945a4dd0607..5828ab6fe2fe7ba5aff8373abad1ad4d7e6a03b5 100644 (file)
@@ -1,3 +1,9 @@
+[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
index 4da5e93d3b287e65af78f5a9ec88851605516c5b..8f44b5230adbb741fec0f130d58bdd3782aa13a5 100644 (file)
@@ -6,6 +6,6 @@ includedir=@includedir@
 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}
index 5e81ca066a8b4df1b12988dde30731b52b2e1d13..633d9a100fd4fbb89e4517073e015a4dbfc9f559 100644 (file)
@@ -44,8 +44,7 @@ liborganigramma_la_SOURCES = \
                 ../src/ufficionodo.c \
                 ../src/ufficioorario.c \
                 ../src/ufficiorecapito.c \
-                ../src/ufficiostanza.c \
-                ../src/vie.c
+                ../src/ufficiostanza.c
 
 liborganigramma_la_LDFLAGS = -no-undefined
 
@@ -83,7 +82,6 @@ liborganigramma_include_HEADERS = \
                 ../src/ufficionodo.h \
                 ../src/ufficioorario.h \
                 ../src/ufficiorecapito.h \
-                ../src/ufficiostanza.h \
-                ../src/vie.h
+                ../src/ufficiostanza.h
 
 liborganigramma_includedir = $(includedir)/liborganigramma
index a362377801fae5f4d7c784aa91f470f50495cd56..e95a221b6b464596b05ab2f7f08f952bb4693c8b 100644 (file)
@@ -78,6 +78,4 @@ organigramma_SOURCES = \
                 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
index e3db5f1f57f22a4a070c6673e282325c88ae7655..334dc4c5d8f92586c3b7f37c3d67595525ea0553 100644 (file)
@@ -27,6 +27,8 @@
 
 #include <libgdaex/libgdaex.h>
 
+#include <libterritorio/commons.h>
+
 typedef struct
        {
                gchar *guidir;
@@ -37,6 +39,8 @@ typedef struct
                GdaEx *gdaex;
 
                const gchar *guifile;
+
+               TerritorioCommons *territorio_commons;
        } OrganigrammaCommons;
 
 #endif /* __ORGANIGRAMMA_COMMONS_H__ */
index 9970e100c52d217d08bb1e44241640ff7cddf4f2..d025800c7970cf5c373b138c630c44a015564691 100644 (file)
@@ -26,6 +26,8 @@
 
 #include <libaute.h>
 
+#include <libterritorio/commons.h>
+
 #include "commons.h"
 #include "nodi.h"
 #include "persone.h"
@@ -230,6 +232,8 @@ main (int argc, char *argv[])
 {
        GError *error;
 
+       GdaConnection *gdacon;
+
        Aute *aute;
        gchar **aute_params;
        gsize n_aute_params;
@@ -298,7 +302,10 @@ main (int argc, char *argv[])
                }
 
        /* 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
 
@@ -309,29 +316,36 @@ main (int argc, char *argv[])
 
        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;
@@ -354,7 +368,66 @@ main (int argc, char *argv[])
                        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,
index e8215b0f3079e8403dd56a2c31ce13a109380da3..ce7baa0a040bfbbfb9c3567232b0284eb5ff4840 100644 (file)
@@ -281,12 +281,12 @@ OrganigrammaPersona
        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)
@@ -297,18 +297,19 @@ OrganigrammaPersona
 
        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,
@@ -512,7 +513,7 @@ organigramma_persona_carica_incarichi (OrganigrammaPersona *persona)
        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",
@@ -552,7 +553,8 @@ organigramma_persona_carica_nodi (OrganigrammaPersona *persona)
        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'"
@@ -604,7 +606,8 @@ organigramma_persona_carica_nodo_recapiti (OrganigrammaPersona *persona)
                }
 
        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"
@@ -646,7 +649,8 @@ organigramma_persona_carica_uffici (OrganigrammaPersona *persona)
        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'"
@@ -697,7 +701,8 @@ organigramma_persona_carica_ufficio_recapiti (OrganigrammaPersona *persona)
                }
 
        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"
@@ -739,7 +744,8 @@ organigramma_persona_carica_recapiti (OrganigrammaPersona *persona)
        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'"
@@ -1211,7 +1217,7 @@ organigramma_persona_on_btn_incarico_elimina_clicked (GtkButton *button,
                                                            -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));
@@ -1298,7 +1304,7 @@ organigramma_persona_on_btn_nodo_elimina_clicked (GtkButton *button,
                                                            -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));
@@ -1433,7 +1439,7 @@ organigramma_persona_on_btn_nodo_recapito_elimina_clicked (GtkButton *button,
                                                            -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));
@@ -1520,7 +1526,7 @@ organigramma_persona_on_btn_ufficio_elimina_clicked (GtkButton *button,
                                                            -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));
@@ -1655,7 +1661,7 @@ organigramma_persona_on_btn_ufficio_recapito_elimina_clicked (GtkButton *button,
                                                            -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));
@@ -1742,7 +1748,7 @@ organigramma_persona_on_btn_recapito_elimina_clicked (GtkButton *button,
                                                            -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));
index 542b55223b074a70a9e8c47289aa533e8c40511d..ac60ed156b02254d06bc5543a873135d259b1946 100644 (file)
@@ -136,7 +136,7 @@ OrganigrammaPersonaIncarico
                                           "|lstore_posizioni_economiche"
                                           "|lstore_tipi_prestazione"
                                           "|lstore_profili_professionali"
-                                          "|w_organigramma_persona_incarico", "|", -1),
+                                          "|w_persona_incarico", "|", -1),
                                           &error);
        if (error != NULL)
                {
@@ -146,9 +146,9 @@ OrganigrammaPersonaIncarico
 
        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",
index 29a3d7ab3f3f273fbdca1a3f5782c3dc269e4395..609a2258f5b8333a1235bdb57423fd8064e49f5f 100644 (file)
@@ -138,7 +138,7 @@ OrganigrammaPersonaNodo
        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)
                {
@@ -148,9 +148,9 @@ OrganigrammaPersonaNodo
 
        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",
index 51a8efbf3d1860f935e91d9afff317eb13b44819..ee29bc274055369ae67374469096415bf111edd4 100644 (file)
@@ -132,7 +132,7 @@ OrganigrammaPersonaNodoRecapito
        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)
                {
@@ -142,9 +142,9 @@ OrganigrammaPersonaNodoRecapito
 
        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",
index f411f2929f9a3dc047374e9d8572061452116c62..003a17e2b693d08567d07f1608240455e806242d 100644 (file)
@@ -130,7 +130,7 @@ OrganigrammaPersonaRecapito
        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)
                {
@@ -140,9 +140,9 @@ OrganigrammaPersonaRecapito
 
        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",
index ba1996ffac577d17f5b9d5cbe27ebe3458bd86da..5e9129074a5f34c1d3e2c62f67b536fddc05a5b2 100644 (file)
@@ -138,7 +138,7 @@ OrganigrammaPersonaUfficio
        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)
                {
@@ -148,9 +148,9 @@ OrganigrammaPersonaUfficio
 
        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",
index 3e6a77515fe4b3ddacc798efd502cc7c12ac0213..1a5eaa7e3f630cecac494ffb4652fc52e987fc45 100644 (file)
@@ -132,7 +132,7 @@ OrganigrammaPersonaUfficioRecapito
        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)
                {
@@ -142,9 +142,9 @@ OrganigrammaPersonaUfficioRecapito
 
        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",
index e163f04edc978b022f5976e3adcd270c4290c631..de16ed7197e0887c3806d944c0c13404d5aa68d8 100644 (file)
@@ -18,6 +18,7 @@
  */
 
 #include <libgtkform/form.h>
+#include <libterritorio/via.h>
 
 #include "struttura.h"
 #include "strutturaindirizzo.h"
@@ -149,8 +150,9 @@ OrganigrammaStruttura
 
        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)
                {
@@ -166,7 +168,7 @@ OrganigrammaStruttura
 
        priv->objects = gtk_form_get_objects_by_name (priv->form,
                                                      "label31",
-                                                     "lstore_organigramma_struttura_indirizzi",
+                                                     "lstore_struttura_indirizzi",
                                                      NULL);
 
        g_signal_connect (priv->w,
@@ -305,17 +307,19 @@ organigramma_struttura_carica_indirizzi (OrganigrammaStruttura *struttura)
        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;
@@ -323,12 +327,16 @@ organigramma_struttura_carica_indirizzi (OrganigrammaStruttura *struttura)
                        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);
@@ -504,7 +512,7 @@ organigramma_struttura_on_btn_indirizzo_elimina_clicked (GtkButton *button,
                                                            -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));
index c0bd4b1b2e4fd37dfe68178986d3ef445630c435..4c4fac234815052fa7df076ee186868866e5aa55 100644 (file)
 #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);
@@ -150,6 +150,7 @@ OrganigrammaStrutturaIndirizzo
 
        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"));
@@ -285,7 +286,6 @@ static void
 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)
@@ -300,7 +300,6 @@ static void
 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)
@@ -350,19 +349,22 @@ organigramma_struttura_indirizzo_on_w_organigramma_struttura_indirizzo_delete_ev
 
 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);
 }
index 5c2028ad2bfb4d52652376514ac355837a2a2d20..91e4c624c2d7ecad1ccf0eeeec2c0b12821cac95 100644 (file)
@@ -131,7 +131,7 @@ OrganigrammaTipoNodo
                        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);
 
index 61d75d975ee7bbae902b0daa9c7d236868967f90..76e8aaec7ab248fe71543e4c4182a835b1be6dfe 100644 (file)
@@ -229,10 +229,10 @@ OrganigrammaUfficio
 
        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)
@@ -249,10 +249,10 @@ OrganigrammaUfficio
 
        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")));
@@ -432,8 +432,9 @@ organigramma_ufficio_carica_nodi (OrganigrammaUfficio *ufficio)
        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);
@@ -471,7 +472,7 @@ organigramma_ufficio_carica_stanze (OrganigrammaUfficio *ufficio)
        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",
@@ -511,7 +512,8 @@ organigramma_ufficio_carica_recapiti (OrganigrammaUfficio *ufficio)
        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);
@@ -549,7 +551,7 @@ organigramma_ufficio_carica_orari (OrganigrammaUfficio *ufficio)
        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);
@@ -913,7 +915,7 @@ organigramma_ufficio_on_btn_nodo_elimina_clicked (GtkButton *button,
                                                            -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));
@@ -1000,7 +1002,7 @@ organigramma_ufficio_on_btn_stanza_elimina_clicked (GtkButton *button,
                                                            -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));
@@ -1087,7 +1089,7 @@ organigramma_ufficio_on_btn_recapito_elimina_clicked (GtkButton *button,
                                                            -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));
@@ -1174,7 +1176,7 @@ organigramma_ufficio_on_btn_orario_elimina_clicked (GtkButton *button,
                                                            -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));
index 51d8d4049821aa4576b7112fdd8de38b7f69a445..ebd54fa4ba9d60603247c148fc5ff88fc31a2b7e 100644 (file)
@@ -139,7 +139,7 @@ OrganigrammaUfficioNodo
        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)
                {
@@ -149,9 +149,9 @@ OrganigrammaUfficioNodo
 
        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",
index 444960f65acdbb0689be0d7a90ab46ca977769b1..61cd946ba6dc6a2454922877bddcdd67a48f656f 100644 (file)
@@ -130,7 +130,7 @@ OrganigrammaUfficioOrario
        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)
                {
@@ -140,9 +140,9 @@ OrganigrammaUfficioOrario
 
        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",
index 82b41f93f4d35c2e941aa91fbf8443237506f44b..8f064e5e740ecb2b7d72654706544f53e0408eb1 100644 (file)
@@ -130,7 +130,7 @@ OrganigrammaUfficioRecapito
        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)
                {
@@ -140,9 +140,9 @@ OrganigrammaUfficioRecapito
 
        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",
index 278e4ca6bd0c359e0b6fdd63bb08892d4db1dae3..83b62349eddf76344c31376dbe59b42b7fdd2ac7 100644 (file)
@@ -130,7 +130,7 @@ OrganigrammaUfficioStanza
        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)
                {
@@ -140,9 +140,9 @@ OrganigrammaUfficioStanza
 
        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",
diff --git a/src/vie.c b/src/vie.c
deleted file mode 100644 (file)
index 1da36f0..0000000
--- a/src/vie.c
+++ /dev/null
@@ -1,322 +0,0 @@
-/* 
- * 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);
-}
diff --git a/src/vie.h b/src/vie.h
deleted file mode 100644 (file)
index 130f556..0000000
--- a/src/vie.h
+++ /dev/null
@@ -1,65 +0,0 @@
-/* 
- * 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__ */