GdaConnection *gdacon;
ZakAuthe *aute;
- gchar **aute_params;
- gsize n_aute_params;
GSList *sl_aute_params;
gchar *utente;
gchar *cnc_string;
- gint i;
-
ZakAuthoIResource *ires1;
#ifdef G_OS_WIN32
/* inizializzazione commons */
commons = g_new0 (Commons, 1);
- commons->territorio_commons = g_new0 (TerritorioCommons, 1);
- commons->organigramma_commons = g_new0 (OrganigrammaCommons, 1);
+ commons->territorio_commons = territorio_init (confi, "TERRITORIO_");
+ commons->organigramma_commons = organigramma_init (confi, "ORGANIGRAMMA_");
commons->utente = utente;
commons->territorio_commons->utente = utente;
commons->organigramma_commons->utente = utente;
- commons->organigramma_commons->territorio_commons = commons->territorio_commons;
-
if (argc == 3)
{
commons->pr_cod_prat = strtol (argv[2], NULL, 10);
{
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);
- commons->organigramma_commons->guidir = g_build_filename ("/mingw", "share", "organigramma", "gui", NULL);
- commons->organigramma_commons->formdir = g_build_filename ("/mingw", "share", "organigramma", "form", NULL);
}
else
{
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);
- commons->organigramma_commons->guidir = g_build_filename (moddir, "share", "organigramma", "gui", NULL);
- commons->organigramma_commons->formdir = g_build_filename (moddir, "share", "organigramma", "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);
- commons->organigramma_commons->guidir = g_build_filename ("/usr", "local", "share", "organigramma", "gui", NULL);
- commons->organigramma_commons->formdir = g_build_filename ("/usr", "local", "share", "organigramma", "form", NULL);
#endif
commons->guifile = g_build_filename (commons->guidir, "albonline.gui", NULL);
- commons->territorio_commons->guifile = g_build_filename (commons->territorio_commons->guidir, "territorio.gui", NULL);
- commons->organigramma_commons->guifile = g_build_filename (commons->organigramma_commons->guidir, "organigramma.gui", NULL);
/* leggo la stringa di connessione al db */
cnc_string = zak_confi_path_get_value (confi, "DB/cnc_string");
/* inizializzo solipa */
commons->solipa = solipa_new ();
- /* leggo la stringa di connessione al db territorio */
- cnc_string = zak_confi_path_get_value (confi, "DB_TERRITORIO/cnc_string");
- if (cnc_string == NULL)
- {
- 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 libzakautho di territorio */
- cnc_string = zak_confi_path_get_value (confi, "ZAKAUTHO_TERRITORIO/cnc_string");
- if (cnc_string == NULL)
- {
- g_warning ("Impossibile leggere la stringa di connessione per libzakautho dal file di configurazione.");
- 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 libzakautho di territorio: %s.\n", error != NULL && error->message != NULL ? error->message : "nessun dettaglio");
- return 0;
- }
-
- commons->territorio_commons->autoz = zak_autho_new ();
- if (commons->territorio_commons->autoz == NULL)
- {
- g_warning ("Impossibile creare l'oggetto per libzakautho.");
- return 0;
- }
- if (!zak_autho_load_from_db (commons->territorio_commons->autoz, gdacon, NULL, TRUE))
- {
- g_warning ("Impossibile caricare la configurazione per libzakauto dal db.");
- return 0;
- }
-
commons->territorio_commons->role_utente = zak_autho_get_role_from_id (commons->territorio_commons->autoz, commons->territorio_commons->utente);
if (commons->territorio_commons->role_utente == NULL)
{
return 0;
}
- /* leggo la stringa di connessione al db organigramma */
- cnc_string = zak_confi_path_get_value (confi, "DB_ORGANIGRAMMA/cnc_string");
- if (cnc_string == NULL)
- {
- g_error ("Impossibile leggere la stringa di connessione dal file di configurazione.");
- }
-
- commons->organigramma_commons->gdaex = gdaex_new_from_string (cnc_string);
- if (commons->organigramma_commons->gdaex == NULL)
- {
- g_error ("Errore nella connessione al database: %s", cnc_string);
- }
-
- /* leggo i parametri per libzakautho di organigramma */
- cnc_string = zak_confi_path_get_value (confi, "ZAKAUTHO_ORGANIGRAMMA/cnc_string");
- if (cnc_string == NULL)
- {
- g_warning ("Impossibile leggere la stringa di connessione per libzakautho dal file di configurazione.");
- 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 libzakautho di organigramma: %s.\n", error != NULL && error->message != NULL ? error->message : "nessun dettaglio");
- return 0;
- }
-
- commons->organigramma_commons->autoz = zak_autho_new ();
- if (commons->organigramma_commons->autoz == NULL)
- {
- g_warning ("Impossibile creare l'oggetto per libzakautho.");
- return 0;
- }
- if (!zak_autho_load_from_db (commons->organigramma_commons->autoz, gdacon, NULL, TRUE))
- {
- g_warning ("Impossibile caricare la configurazione per libzakautho dal db.");
- return 0;
- }
-
commons->organigramma_commons->role_utente = zak_autho_get_role_from_id (commons->organigramma_commons->autoz, commons->organigramma_commons->utente);
if (commons->organigramma_commons->role_utente == NULL)
{
/* gtkbuilder */
commons->gtkbuilder = gtk_builder_new ();
- commons->territorio_commons->gtkbuilder = gtk_builder_new ();
- commons->organigramma_commons->gtkbuilder = gtk_builder_new ();
error = NULL;
gtk_builder_add_objects_from_file (commons->gtkbuilder, commons->guifile,