16 |
17 | Llevas días sin entrar en Nabú. Ahora eres un usuario inactivo. Recuerda que el grupo te necesita para tomar decisiones que representen a todos.
18 | Vuelve a entrar para reactivar tu estado.
19 | Mantente informado sobre lo que piensa tu grupo.
20 | %1
21 |
22 | Nabú es una herramienta diseñada para facilitar, descentralizar y optimizar la toma de decisiones por consentimiento y su gestión, en todo tipo de organizaciones.
23 |
24 | http://nabu.pt
25 | Gracias por tu participación
26 |
27 |
28 |
29 |
--------------------------------------------------------------------------------
/mails/modelos/ES/nuevoConsenso.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Nabú
6 |
13 |
14 |
15 | Nueva decisión en Nabú
16 |
17 | Se ha generado un nueva decisión SI:%1 y NO:%2
18 |
19 | Mantente informado sobre lo que piensa tu grupo.
20 | %4
21 | %5
22 |
23 | Nabú es una herramienta diseñada para facilitar, descentralizar y optimizar la toma de decisiones por consentimiento y su gestión, en todo tipo de organizaciones.
24 |
25 | http://nabu.pt
26 | Gracias por tu participación
27 |
28 |
--------------------------------------------------------------------------------
/mails/modelos/ES/welcome.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Nabú
6 |
13 |
14 |
15 | Bienvenid@ a Nabú
16 |
17 | Nabú es una herramienta diseñada para facilitar, descentralizar y optimizar la toma de decisiones por consentimiento y su gestión, en todo tipo de organizaciones.
18 | El objetivo es escribir de forma cooperativa documentos de comunes y evitar enfrentamientos personales.
19 |
20 | Tus datos de acceso son:
26 |
27 | Una vez dentro picando sobre tu nombre puedes cambiar la contraseña.
28 |
29 | En el pie de página verás una opción de "ayuda" donde encontrarás una descripción general de la herramienta y su uso.
30 |
31 | También encontrarás una opción de "ver simulación" donde podrás ver una simulación dinámica del árbol de decisiones para que puedas comprender como funciona y el efecto esperado a gran escala. Variando la probabilidad de cooperación podrás ver como se generan ejemplos de documentos de consenso (sin contenido en la simulación).
32 |
33 | La herramienta es aún versión beta, cualquier opinión o fallo encontrado es bienvenido.
34 |
35 | Mejor probado en google chrome
36 |
37 |
38 |
39 | http://nabu.pt
40 | Gracias por tu participación
41 |
42 |
--------------------------------------------------------------------------------
/mails/modelos/ct/alta.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Nabú
6 |
13 |
14 |
15 | Petició d'alta a Nabú
16 |
17 | Una persona sl·licita la seva alta com a usuària.
18 | Comprova la seva pertinença al grup i respon.
19 |
20 |
21 | Les seves dades personals són:
16 |
17 | Portes 15 dies sense entrar al teu grup.
18 |
19 | Les teves flors han caigut de l'arbre per a evitar el bloqueig de possibles consensos i garantir el reciclatge de l'arbre.
20 |
21 | En aquest moment no participes en la presa de decisions del grup.
22 |
23 | Entra setmanalment per a recuperar la teva participació.
24 |
25 | El teu grup et necessita per a crear unitat i resultats d'acord als interessos de totes.
26 |
27 | Grup: %1
28 | %2
29 |
30 | Contacta amb el coordinador [%2] si tens algun dubte.
31 | http://nabu.pt
32 | Gràcies per la teva participació
33 | Nabú
34 |
35 |
36 |
--------------------------------------------------------------------------------
/mails/modelos/ct/inactivo.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Nabú
6 |
13 |
14 |
15 | Inactiva a Nabú
16 |
17 | Portes dies sense entrar a Nabú.
18 |
19 | Ara ets una usuèria inactiva.
20 |
21 | Recorda que el grup et necessita per a prendre decisions que representin a totes.
22 |
23 | Torna a entrar per a reactivar el teu estat.
24 |
25 | Mantén-te informada sobre el que pensa el teu grup.
26 | %1
27 | La Nabú és una eina dissenyada per a facilitar, descentralitzar i accelerar el mètode assembleari a grans grups cooperatius.
28 |
29 | http://nabu.pt
30 | Gràcies per la teva participació
31 |
32 |
33 |
--------------------------------------------------------------------------------
/mails/modelos/ct/nuevoConsenso.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Nabú
6 |
13 |
14 |
15 | Nou consens a Nabú
16 |
17 | S'ha generat un nou consens amb SÍ:%1 i NO:%2
18 |
19 | Mantén-te informada sobre el que pensa el teu grup.
20 |
21 | %4
22 | %5
23 | La Nabú és una eina dissenyada per a facilitar, descentralitzar i accelerar el métode assembleari a grans grups cooperatius.
24 |
25 | http://nabu.pt
26 | Gràcies per la teva participació
27 |
28 |
29 |
--------------------------------------------------------------------------------
/mails/modelos/ct/welcome.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Nabú
6 |
13 |
14 |
15 | Benvinguda a la Nabú
16 |
17 | La Nabú é una eina dissenyada per a facilitar, descentralitzar i accelerar el métode assembleari a grans grups cooperatius.
18 |
19 | L'objectiu és escriure de forma cooperativa documents de consens i evitar enfrontaments personals.
20 |
21 | Les teves dades d'accés són:
27 |
28 | Un cop dins, picant sobre el teu nom pots canviar la contrasenya.
29 |
30 | Al peu de pàgina veuràs una opció d'"ajuda" on trobarès una descripció general de l'eina i el seu ús.
31 |
32 | També trobaràs una opció de "veure simulació" on podràs veure una simulació dinàmica de l'arbre de decisions per a que puguis comprendre com funciona i l'efecte esperat a gran escala. Variant la probabilitat de cooperació podràs veure com es generen exemples de consens (sense contingut a la simulació).
33 |
34 | L'eina és una versió beta, qualsevol opinió o avís de fallada trobada és benvinguda.
35 |
36 | Funciona millor a google chrome
37 |
38 | http://nabu.pt
39 | Gràcies per la teva participació
40 |
41 |
42 |
--------------------------------------------------------------------------------
/mails/modelos/en/alta.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Nabú
6 |
13 |
14 |
15 | Petición de alta en Nabú
16 |
17 | Una persona solicita su alta como usuario.
18 | Comprobar su pertenencia al grupo y responder.
19 |
20 |
21 | Sus datos personales son:
16 |
17 | Llevas 15 dias entrar en tu grupo. Tus flores han caido del árbol para evitar el bloqueo de posibles consensos y garantizar el reciclaje del árbol.
18 | En este momento no participas en la toma de deciones del grupo. Entra semanalmente para recuperar tu participación.
19 | Tu grupo te necesita para crear unidad y resultados acordes a los intereses de todos.
20 |
21 | Grupo: %1
22 | %2
23 |
24 | Contacta con el coordinador [%2] si tienes alguna duda.
25 | http://nabu.pt
26 | Gracias por tu participación
27 | Nabú
28 |
29 |
--------------------------------------------------------------------------------
/mails/modelos/en/inactivo.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Nabú
6 |
13 |
14 |
15 | Inactivo en Nabú
16 |
17 | Llevas días sin entrar en Nabú. Ahora eres un usuario inactivo. Recuerda que el grupo te necesita para tomar decisiones que representen a todos.
18 | Vuelve a entrar para reactivar tu estado.
19 | Mantente informado sobre lo que piensa tu grupo.
20 | %1
21 | Nabú es una herramienta diseñada para facilitar, descentralizar y acelerar el método asambleario en grandes grupos cooperativos.
22 |
23 | http://nabu.pt
24 | Gracias por tu participación
25 |
26 |
--------------------------------------------------------------------------------
/mails/modelos/en/nuevoConsenso.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Nabú
6 |
13 |
14 |
15 | Nuevo consenso en Nabú
16 |
17 | Se ha generado un nuevo consenso con SI:%1 y NO:%2
18 |
19 | Mantente informado sobre lo que piensa tu grupo.
20 | %4
21 | %5
22 | Nabú es una herramienta diseñada para facilitar, descentralizar y acelerar el método asambleario en grandes grupos cooperativos.
23 |
24 | http://nabu.pt
25 | Gracias por tu participación
26 |
27 |
--------------------------------------------------------------------------------
/mails/modelos/en/welcome.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Nabú
6 |
13 |
14 |
15 | Bienvenid@ a Nabú
16 |
17 | Nabú es una herramienta diseñada para facilitar, descentralizar y acelerar el método asambleario en grandes grupos cooperativos.
18 | El objetivo es escribir de forma cooperativa documentos de consenso y evitar enfrentamientos personales.
19 |
20 | Tus datos de acceso son:
26 |
27 | Una vez dentro picando sobre tu nombre puedes cambiar la contraseña.
28 |
29 | En el pie de página verás una opción de "ayuda" donde encontrarás una descripción general de la herramienta y su uso.
30 |
31 | También encontrarás una opción de "ver simulación" donde podrás ver una simulación dinámica del árbol de decisiones para que puedas comprender como funciona y el efecto esperado a gran escala. Variando la probabilidad de cooperación podrás ver como se generan ejemplos de documentos de consenso (sin contenido en la simulación).
32 |
33 | La herramienta es aún versión beta, cualquier opinión o fallo encontrado es bienvenido.
34 |
35 | Mejor probado en google chrome
36 |
37 | http://nabu.pt
38 | Gracias por tu participación
39 |
40 |
--------------------------------------------------------------------------------
/mails/modelos/es/caido.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Nabú
6 |
13 |
14 |
15 | Nabú
16 |
17 | Llevas 15 dias entrar en tu grupo. Tus flores han caido del árbol para evitar el bloqueo de posibles consensos y garantizar el reciclaje del árbol.
18 | En este momento no participas en la toma de deciones del grupo. Entra semanalmente para recuperar tu participación.
19 | Tu grupo te necesita para crear unidad y resultados acordes a los intereses de todos.
20 |
21 | Grupo: %1
22 | %2
23 |
24 | Contacta con el coordinador [%2] si tienes alguna duda.
25 | http://nabu.pt
26 | Gracias por tu participación
27 | Nabú
28 |
29 |
--------------------------------------------------------------------------------
/mails/modelos/fr/alta.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Nabú
6 |
13 |
14 |
15 | Petición de alta en Nabú
16 |
17 | Una persona solicita su alta como usuario.
18 | Comprobar su pertenencia al grupo y responder.
19 |
20 |
21 | Sus datos personales son:
16 |
17 | Llevas 15 dias entrar en tu grupo. Tus flores han caido del árbol para evitar el bloqueo de posibles consensos y garantizar el reciclaje del árbol.
18 | En este momento no participas en la toma de deciones del grupo. Entra semanalmente para recuperar tu participación.
19 | Tu grupo te necesita para crear unidad y resultados acordes a los intereses de todos.
20 |
21 | Grupo: %1
22 | %2
23 |
24 | Contacta con el coordinador [%2] si tienes alguna duda.
25 | http://nabu.pt
26 | Gracias por tu participación
27 | Nabú
28 |
29 |
--------------------------------------------------------------------------------
/mails/modelos/fr/inactivo.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Nabú
6 |
13 |
14 |
15 | Inactivo en Nabú
16 |
17 | Llevas días sin entrar en Nabú. Ahora eres un usuario inactivo. Recuerda que el grupo te necesita para tomar decisiones que representen a todos.
18 | Vuelve a entrar para reactivar tu estado.
19 | Mantente informado sobre lo que piensa tu grupo.
20 | %1
21 | Nabú es una herramienta diseñada para facilitar, descentralizar y acelerar el método asambleario en grandes grupos cooperativos.
22 |
23 | http://nabu.pt
24 | Gracias por tu participación
25 |
26 |
--------------------------------------------------------------------------------
/mails/modelos/fr/nuevoConsenso.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Nabú
6 |
13 |
14 |
15 | Nuevo consenso en Nabú
16 |
17 | Se ha generado un nuevo consenso con SI:%1 y NO:%2
18 |
19 | Mantente informado sobre lo que piensa tu grupo.
20 | %4
21 | %5
22 | Nabú es una herramienta diseñada para facilitar, descentralizar y acelerar el método asambleario en grandes grupos cooperativos.
23 |
24 | http://nabu.pt
25 | Gracias por tu participación
26 |
27 |
--------------------------------------------------------------------------------
/mails/modelos/fr/welcome.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Nabú
6 |
13 |
14 |
15 | Bienvenid@ a Nabú
16 |
17 | Nabú es una herramienta diseñada para facilitar, descentralizar y acelerar el método asambleario en grandes grupos cooperativos.
18 | El objetivo es escribir de forma cooperativa documentos de consenso y evitar enfrentamientos personales.
19 |
20 | Tus datos de acceso son:
26 |
27 | Una vez dentro picando sobre tu nombre puedes cambiar la contraseña.
28 |
29 | En el pie de página verás una opción de "ayuda" donde encontrarás una descripción general de la herramienta y su uso.
30 |
31 | También encontrarás una opción de "ver simulación" donde podrás ver una simulación dinámica del árbol de decisiones para que puedas comprender como funciona y el efecto esperado a gran escala. Variando la probabilidad de cooperación podrás ver como se generan ejemplos de documentos de consenso (sin contenido en la simulación).
32 |
33 | La herramienta es aún versión beta, cualquier opinión o fallo encontrado es bienvenido.
34 |
35 | Mejor probado en google chrome
36 |
37 | http://nabu.pt
38 | Gracias por tu participación
39 |
40 |
--------------------------------------------------------------------------------
/model/Config.cs:
--------------------------------------------------------------------------------
1 | ///////////////////////////////////////////////////////////////////////////
2 | // Copyright 2015 - 2020 Sabrina Prestigiacomo nabu@nabu.pt
3 | //
4 | // This program is free software: you can redistribute it and/or modify
5 | // it under the terms of the GNU General Public License as published by
6 | // the Free Software Foundation, either version 3 of the License, or
7 | // any later version.
8 | //
9 | // This program is distributed in the hope that it will be useful,
10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | // GNU General Public License for more details.
13 | //
14 | // You should have received a copy of the GNU General Public License
15 | // along with this program. If not, see .
16 | //
17 | ///////////////////////////////////////////////////////////////////////////
18 |
19 |
20 | using System;
21 | using System.Collections.Generic;
22 | using System.Linq;
23 | using System.Web;
24 |
25 | namespace nabu
26 | {
27 | public class Config
28 | {
29 | public List grupos = new List();
30 | public string browser = ""; //tipo de navegador
31 | public string type = "";
32 | public string version = "";
33 | public int width;
34 | public int height;
35 | }
36 | }
--------------------------------------------------------------------------------
/model/Grupo/Alerta.cs:
--------------------------------------------------------------------------------
1 | ///////////////////////////////////////////////////////////////////////////
2 | // Copyright 2015 - 2020 Sabrina Prestigiacomo nabu@nabu.pt
3 | //
4 | // This program is free software: you can redistribute it and/or modify
5 | // it under the terms of the GNU General Public License as published by
6 | // the Free Software Foundation, either version 3 of the License, or
7 | // any later version.
8 | //
9 | // This program is distributed in the hope that it will be useful,
10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | // GNU General Public License for more details.
13 | //
14 | // You should have received a copy of the GNU General Public License
15 | // along with this program. If not, see .
16 | //
17 | ///////////////////////////////////////////////////////////////////////////
18 |
19 | using System;
20 | using System.Collections.Generic;
21 | using System.Linq;
22 | using System.Web;
23 |
24 | namespace nabu
25 | {
26 | public class Alerta
27 | {
28 | public DateTime ts = DateTime.Now;
29 | public string msg = "";
30 |
31 | public Alerta() { }
32 |
33 | public Alerta(string msg)
34 | {
35 | this.msg = msg;
36 | }
37 | }
38 | }
--------------------------------------------------------------------------------
/model/Grupo/GrupoPersonal.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Web;
5 |
6 | namespace nabu
7 | {
8 | public class GrupoPersonal
9 | {
10 | public string nombre = "";
11 | public string objetivo = "";
12 | public List alertas = new List();
13 | }
14 | }
--------------------------------------------------------------------------------
/model/Grupo/Usuario.cs:
--------------------------------------------------------------------------------
1 | ///////////////////////////////////////////////////////////////////////////
2 | // Copyright 2015 - 2020 Sabrina Prestigiacomo nabu@nabu.pt
3 | //
4 | // This program is free software: you can redistribute it and/or modify
5 | // it under the terms of the GNU General Public License as published by
6 | // the Free Software Foundation, either version 3 of the License, or
7 | // any later version.
8 | //
9 | // This program is distributed in the hope that it will be useful,
10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | // GNU General Public License for more details.
13 | //
14 | // You should have received a copy of the GNU General Public License
15 | // along with this program. If not, see .
16 | //
17 | ///////////////////////////////////////////////////////////////////////////
18 |
19 |
20 | //colores
21 | //coordinador 0x0066CC
22 | //secretaria 0xFF66CC
23 | //representante 0x00CC99
24 | //facilitador 0xFF9900
25 |
26 | using System;
27 | using System.Collections.Generic;
28 | using System.Linq;
29 | using System.Web;
30 |
31 | namespace nabu
32 | {
33 | public class Usuario: IComparable
34 | {
35 | public class AlfaComparer: Comparer
36 | {
37 | public override int Compare(Usuario x, Usuario y)
38 | {
39 | return x.nombre.CompareTo(y.nombre);
40 | }
41 | }
42 |
43 | public class RolComparer : Comparer
44 | {
45 | public override int Compare(Usuario x, Usuario y)
46 | {
47 | if (x.isAdmin && !y.isAdmin) return -1;
48 | else if (!x.isAdmin && y.isAdmin) return 1;
49 | else if (x.isAdmin && y.isAdmin) return x.nombre.CompareTo(y.nombre);
50 |
51 | else if (x.isRepresentante && !y.isRepresentante) return -1;
52 | else if (!x.isRepresentante && y.isRepresentante) return 1;
53 | else if (x.isRepresentante && y.isRepresentante) return x.nombre.CompareTo(y.nombre);
54 |
55 | else if (x.isFacilitador && !y.isFacilitador) return -1;
56 | else if (!x.isFacilitador && y.isFacilitador) return 1;
57 | else if (x.isFacilitador && y.isFacilitador) return x.nombre.CompareTo(y.nombre);
58 |
59 | else if (x.isSecretaria && !y.isSecretaria) return -1;
60 | else if (!x.isSecretaria && y.isSecretaria) return 1;
61 | else if (x.isSecretaria && y.isSecretaria) return x.nombre.CompareTo(y.nombre);
62 |
63 | else if (x.isActive && !y.isActive) return -1;
64 | else if (!x.isActive && y.isActive) return 1;
65 | else if (x.isActive && y.isActive) return x.nombre.CompareTo(y.nombre);
66 |
67 | else return x.nombre.CompareTo(y.nombre);
68 | }
69 | }
70 |
71 | public string nombre = "";
72 | public string funcion = "";
73 | public string email = "";
74 | public string clave = "";
75 | public List flores = new List();
76 | public DateTime lastLogin = DateTime.Now.AddDays(-15); //inactivo
77 | public DateTime born = DateTime.Now;
78 | public bool isAdmin = false;
79 | public bool isSecretaria = false;
80 | public bool isFacilitador = false;
81 | public bool isRepresentante = false;
82 | public int apoyos = 0; //cantidad de apoyos por parte de otros usuarios
83 | public DateTime notificado = DateTime.Now;
84 | public Prevista prevista = null;
85 | public bool readOnly = false;
86 | public bool habilitado = true;
87 | public string grupoDesde = "";
88 | public List alertas = new List();
89 | public bool reactivado = true; //default para nuevos usuarios
90 |
91 | //perfil
92 | public string mision = "";
93 | public string capacidades = "";
94 | public string expectativas = "";
95 | public string participacion = "";
96 | public string address = "";
97 | public double lat;
98 | public double lng;
99 |
100 | public Usuario()
101 | {
102 | //constructor default para el deserializador json
103 | }
104 |
105 | public Usuario(int cantidadFlores)
106 | {
107 | for (int q = 0; q < cantidadFlores; q++)
108 | {
109 | flores.Add(new Flor());
110 | }
111 | }
112 |
113 | int IComparable.CompareTo(Object x)
114 | {
115 | Usuario dos = (Usuario)x;
116 | return (int)this.lastLogin.Subtract(dos.lastLogin).TotalSeconds;
117 | }
118 |
119 | public bool isActive
120 | {
121 | get
122 | {
123 | return DateTime.Now.Subtract(lastLogin).TotalDays < 7;
124 | }
125 | set
126 | {
127 | }
128 | }
129 |
130 | public string sLastLogin
131 | {
132 | get
133 | {
134 | return lastLogin.ToString("dd/MM/yy");
135 | }
136 | set
137 | {
138 | }
139 | }
140 |
141 | public Flor getFlor(int id)
142 | {
143 | foreach (Flor f in flores)
144 | if (f.id == id)
145 | return f;
146 | return null;
147 | }
148 |
149 | public List floresDisponibles()
150 | {
151 | List ret = new List();
152 | foreach (Flor f in flores)
153 | if (f.id == 0)
154 | ret.Add(f);
155 | return ret;
156 | }
157 | }
158 | }
--------------------------------------------------------------------------------
/model/Grupo/hijo.cs:
--------------------------------------------------------------------------------
1 | ///////////////////////////////////////////////////////////////////////////
2 | // Copyright 2015 - 2020 Sabrina Prestigiacomo nabu@nabu.pt
3 | //
4 | // This program is free software: you can redistribute it and/or modify
5 | // it under the terms of the GNU General Public License as published by
6 | // the Free Software Foundation, either version 3 of the License, or
7 | // any later version.
8 | //
9 | // This program is distributed in the hope that it will be useful,
10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | // GNU General Public License for more details.
13 | //
14 | // You should have received a copy of the GNU General Public License
15 | // along with this program. If not, see .
16 | //
17 | ///////////////////////////////////////////////////////////////////////////
18 |
19 |
20 | public class Hijo
21 | {
22 | public string URL = "";
23 | public string nombre = "";
24 |
25 | public Hijo() { }
26 | public Hijo(string URL, string nombre)
27 | {
28 | this.URL = URL;
29 | this.nombre = nombre;
30 | }
31 | }
--------------------------------------------------------------------------------
/model/appException.cs:
--------------------------------------------------------------------------------
1 | ///////////////////////////////////////////////////////////////////////////
2 | // Copyright 2015 - 2020 Sabrina Prestigiacomo nabu@nabu.pt
3 | //
4 | // This program is free software: you can redistribute it and/or modify
5 | // it under the terms of the GNU General Public License as published by
6 | // the Free Software Foundation, either version 3 of the License, or
7 | // any later version.
8 | //
9 | // This program is distributed in the hope that it will be useful,
10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | // GNU General Public License for more details.
13 | //
14 | // You should have received a copy of the GNU General Public License
15 | // along with this program. If not, see .
16 | //
17 | ///////////////////////////////////////////////////////////////////////////
18 |
19 |
20 | using System;
21 | using System.Collections.Generic;
22 | using System.Linq;
23 | using System.Web;
24 |
25 | namespace nabu
26 | {
27 | public class appException : Exception
28 | {
29 | public appException(string message):base(message)
30 | {
31 | }
32 | }
33 | }
--------------------------------------------------------------------------------
/model/arbol/ArbolPersonal.cs:
--------------------------------------------------------------------------------
1 | ///////////////////////////////////////////////////////////////////////////
2 | // Copyright 2015 - 2020 Sabrina Prestigiacomo nabu@nabu.pt
3 | //
4 | // This program is free software: you can redistribute it and/or modify
5 | // it under the terms of the GNU General Public License as published by
6 | // the Free Software Foundation, either version 3 of the License, or
7 | // any later version.
8 | //
9 | // This program is distributed in the hope that it will be useful,
10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | // GNU General Public License for more details.
13 | //
14 | // You should have received a copy of the GNU General Public License
15 | // along with this program. If not, see .
16 | //
17 | ///////////////////////////////////////////////////////////////////////////
18 |
19 | using System;
20 | using System.Collections.Generic;
21 | using System.Linq;
22 | using System.Web;
23 |
24 | namespace nabu
25 | {
26 | public class ArbolPersonal
27 | {
28 | public string nombre = "";
29 | public string objetivo = "";
30 | public string URLEstatuto = "";
31 | public Usuario usuario;
32 | public Nodo raiz;
33 | public int cantidadFlores = 5;
34 | public bool simulacion = false;
35 | public int nuevoNodoID = 0;
36 | public DateTime born = DateTime.Now;
37 | public int documentos;
38 | public string idioma = "ES";
39 | public string organizacion = "";
40 | public string padreURL = "";
41 | public string padreNombre = "";
42 | public string tipoGrupo = "";
43 | public List hijos = new List();
44 | public string msgBox = "";
45 |
46 | //log de consensos alcanzados
47 | public List logDecisiones = new List();
48 |
49 | //log de resultados alcanzados
50 | public List logResultados = new List();
51 |
52 | //condicion de consenso
53 | public int usuarios = 0; //cantidad de usuarios
54 | public int activos = 0; //cantidad de usuarios activos
55 | public float minSiPc = 80; //porcentaje minimo de usuarios implicados en el debate (en una rama) para alcanzar consenso
56 | public float maxNoPc = 10; //porcentaje maximo de usuarios en otras ramas del mismo debate (en una rama) para alcanzar consenso
57 |
58 | public float minSiValue = 0;
59 | public float maxNoValue = 0;
60 |
61 | }
62 | }
--------------------------------------------------------------------------------
/model/arbol/Flor.cs:
--------------------------------------------------------------------------------
1 | ///////////////////////////////////////////////////////////////////////////
2 | // Copyright 2015 - 2020 Sabrina Prestigiacomo nabu@nabu.pt
3 | //
4 | // This program is free software: you can redistribute it and/or modify
5 | // it under the terms of the GNU General Public License as published by
6 | // the Free Software Foundation, either version 3 of the License, or
7 | // any later version.
8 | //
9 | // This program is distributed in the hope that it will be useful,
10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | // GNU General Public License for more details.
13 | //
14 | // You should have received a copy of the GNU General Public License
15 | // along with this program. If not, see .
16 | //
17 | ///////////////////////////////////////////////////////////////////////////
18 |
19 | using System;
20 | using System.Collections.Generic;
21 | using System.Linq;
22 | using System.Web;
23 |
24 | namespace nabu
25 | {
26 | public class Flor
27 | {
28 | public int id = 0;
29 | public DateTime born = DateTime.Now;
30 | }
31 | }
--------------------------------------------------------------------------------
/model/arbol/Nodo.cs:
--------------------------------------------------------------------------------
1 | ///////////////////////////////////////////////////////////////////////////
2 | // Copyright 2015 - 2020 Sabrina Prestigiacomo nabu@nabu.pt
3 | //
4 | // This program is free software: you can redistribute it and/or modify
5 | // it under the terms of the GNU General Public License as published by
6 | // the Free Software Foundation, either version 3 of the License, or
7 | // any later version.
8 | //
9 | // This program is distributed in the hope that it will be useful,
10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | // GNU General Public License for more details.
13 | //
14 | // You should have received a copy of the GNU General Public License
15 | // along with this program. If not, see .
16 | //
17 | ///////////////////////////////////////////////////////////////////////////
18 |
19 | using System;
20 | using System.Collections.Generic;
21 | using System.Linq;
22 | using System.Web;
23 |
24 | namespace nabu
25 | {
26 | public class Nodo
27 | {
28 | public string nombre = "";
29 | public int id = 1;
30 | public List children = new List(); //debe mantenerse con este nombre o falla el cliente
31 | public int flores = 0;
32 | public string modeloID = "";
33 | public DateTime born = DateTime.Now;
34 | public bool consensoAlcanzado = false;
35 | public float x = 0; //posicion x en el cliente
36 | public int negados = 0; //votos en contra
37 | public int nivel = 0;
38 | public string email = ""; //creador
39 | public int niveles = 0; //niveles del modelo en el momento de crear el nodo
40 | public bool objecion = false;
41 | public bool comentario = false;
42 | public int lastEtiquetaID = 1;
43 | public DateTime consensoFecha = Tools.minValue;
44 |
45 |
46 | public int getFloresTotales() {
47 | int ret=0;
48 | foreach (Nodo hijo in children)
49 | {
50 | ret += hijo.getFloresTotales();
51 | }
52 | return ret + flores;
53 | }
54 | }
55 |
56 | public class NodoComparerMayor : IComparer
57 | {
58 | public int Compare(Nodo a, Nodo b)
59 | {
60 | return b.flores - a.flores;
61 | }
62 | }
63 |
64 | public class NodoComparerMenor : IComparer
65 | {
66 | public int Compare(Nodo a, Nodo b)
67 | {
68 | return a.flores - b.flores;
69 | }
70 | }
71 | }
--------------------------------------------------------------------------------
/model/documento/Comentario.cs:
--------------------------------------------------------------------------------
1 | ///////////////////////////////////////////////////////////////////////////
2 | // Copyright 2015 - 2020 Sabrina Prestigiacomo nabu@nabu.pt
3 | //
4 | // This program is free software: you can redistribute it and/or modify
5 | // it under the terms of the GNU General Public License as published by
6 | // the Free Software Foundation, either version 3 of the License, or
7 | // any later version.
8 | //
9 | // This program is distributed in the hope that it will be useful,
10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | // GNU General Public License for more details.
13 | //
14 | // You should have received a copy of the GNU General Public License
15 | // along with this program. If not, see .
16 | //
17 | ///////////////////////////////////////////////////////////////////////////
18 |
19 |
20 | using System;
21 | using System.Collections.Generic;
22 | using System.Linq;
23 | using System.Web;
24 |
25 | namespace nabu
26 | {
27 | public class Comentario
28 | {
29 | public string email = "";
30 | public DateTime fecha = DateTime.Now;
31 | public string texto = "";
32 | public bool objecion = false;
33 |
34 | }
35 | }
--------------------------------------------------------------------------------
/model/documento/Comparador.cs:
--------------------------------------------------------------------------------
1 | ///////////////////////////////////////////////////////////////////////////
2 | // Copyright 2015 - 2020 Sabrina Prestigiacomo nabu@nabu.pt
3 | //
4 | // This program is free software: you can redistribute it and/or modify
5 | // it under the terms of the GNU General Public License as published by
6 | // the Free Software Foundation, either version 3 of the License, or
7 | // any later version.
8 | //
9 | // This program is distributed in the hope that it will be useful,
10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | // GNU General Public License for more details.
13 | //
14 | // You should have received a copy of the GNU General Public License
15 | // along with this program. If not, see .
16 | //
17 | ///////////////////////////////////////////////////////////////////////////
18 |
19 |
20 | using System;
21 | using System.Collections.Generic;
22 | using System.Linq;
23 | using System.Text;
24 | using System.Threading.Tasks;
25 |
26 | namespace nabu
27 | {
28 | class Comparador
29 | {
30 | static string[] separadores = { " ", "\r\n", ".", "\t", ",", "(", ")", "=", "{", "}", ":", "<", ">" };
31 |
32 | public static string comparar(string master, List vals)
33 | {
34 | //resalto las palabras menos aparecidas de master en vals
35 | if (vals.Count == 0)
36 | //return HTMLEncode(master);
37 | return master;
38 | else
39 | {
40 | //creo listas de palabras
41 | List masterPals = getPalabras(master);
42 | List> valsPals = new List>();
43 | foreach (string val in vals)
44 | valsPals.Add(getPalabras(val));
45 |
46 | //master = HTMLEncode(master);
47 |
48 | //analizo repeticiones y reemplazo en master
49 | foreach (string pal in masterPals) //para cada palabra de Master
50 | {
51 | float aparicion = getAparicion(pal, valsPals);
52 | if (aparicion < 0.5)
53 | master = replace(master, pal, HTMLResaltar(pal, aparicion));
54 | }
55 |
56 | return master;
57 | }
58 | }
59 |
60 | static string replace(string master, string pal, string newPal)
61 | {
62 | //reemplazo palabras que acaban o empienza con un separador
63 | foreach (string sep1 in separadores)
64 | foreach (string sep2 in separadores)
65 | {
66 | master = master.Replace(sep1 + pal + sep2, sep1 + newPal + sep2);
67 | }
68 |
69 | //casos especiales de inicio y fin
70 | if (master.StartsWith(pal))
71 | {
72 | master = newPal + master.Substring(pal.Length);
73 | }
74 |
75 | if (master.EndsWith(pal))
76 | {
77 | master = master.Substring(0, master.Length - pal.Length) + newPal;
78 | }
79 |
80 | return master;
81 | }
82 |
83 | static string HTMLResaltar(string palabra, float veces)
84 | {
85 | //menos veces mas resalto
86 | if (veces == 1)
87 | return palabra;
88 | else
89 | {
90 | int rojo = 155 + (int)Math.Truncate(100 * veces);
91 | string hex = rojo.ToString("x");
92 | if (hex.Length == 1) hex = "0" + hex;
93 | string color = "#" + hex + "FFFF";
94 | return "" + palabra + "";
95 | }
96 | }
97 |
98 | static float getAparicion(string palabra, List> valsPals)
99 | {
100 | //veces=1 -> aparece en todos los vals
101 | //veces=0 -> no aparece en ninguno
102 | float veces = 0;
103 | foreach (List valPals in valsPals)
104 | {
105 | if (valPals.Count == 0)
106 | veces++; //como si apareciera
107 | else
108 | foreach (string pal in valPals)
109 | {
110 | if (palabra.ToLower() == pal.ToLower()) veces++;
111 | }
112 | }
113 | return veces / valsPals.Count;
114 | }
115 |
116 | static List getPalabras(string val)
117 | {
118 | List ret = new List();
119 | string palabra = "";
120 | string sep = "";
121 |
122 | while (val != "")
123 | {
124 | if (startsWithSep(val, ref sep))
125 | {
126 | //guardo palabra actual
127 | if (palabra.Length > 3 && !ret.Contains(palabra))
128 | ret.Add(palabra);
129 | palabra = "";
130 | val = val.Substring(sep.Length); //me como el separador
131 | }
132 | else
133 | {
134 | //acumulo palabra
135 | palabra += val[0];
136 | val = val.Substring(1); //me como el caracter
137 | }
138 | }
139 | //agrego lo que queda
140 | if (palabra.Length > 3 && !ret.Contains(palabra))
141 | ret.Add(palabra);
142 |
143 | return ret;
144 | }
145 |
146 | static bool startsWithSep(string val, ref string sepFound)
147 | {
148 | foreach (string sep in separadores)
149 | if (val.StartsWith(sep))
150 | {
151 | sepFound = sep;
152 | return true;
153 | }
154 | return false;
155 | }
156 |
157 | static string HTMLEncode(string s)
158 | {
159 | s = s.Replace("\r\n", " ");
160 | //s = s.Replace(" ", " ");
161 | return s;
162 | }
163 |
164 | }
165 | }
166 |
--------------------------------------------------------------------------------
/model/documento/Documento.cs:
--------------------------------------------------------------------------------
1 | ///////////////////////////////////////////////////////////////////////////
2 | // Copyright 2015 - 2020 Sabrina Prestigiacomo nabu@nabu.pt
3 | //
4 | // This program is free software: you can redistribute it and/or modify
5 | // it under the terms of the GNU General Public License as published by
6 | // the Free Software Foundation, either version 3 of the License, or
7 | // any later version.
8 | //
9 | // This program is distributed in the hope that it will be useful,
10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | // GNU General Public License for more details.
13 | //
14 | // You should have received a copy of the GNU General Public License
15 | // along with this program. If not, see .
16 | //
17 | ///////////////////////////////////////////////////////////////////////////
18 |
19 |
20 | using System;
21 | using System.Collections.Generic;
22 | using System.Linq;
23 | using System.Web;
24 |
25 | namespace nabu
26 | {
27 | public class Documento
28 | {
29 | public class Log
30 | {
31 | public DateTime fecha = DateTime.Now;
32 | public string msg = "";
33 | }
34 |
35 | public DateTime fecha;
36 | public string nombre = "";
37 | public string titulo = "";
38 | public string fname = "";
39 | public string path = "";
40 | public string URLPath = "";
41 | public string modeloID = "";
42 | public Grupo grupo;
43 | public List propuestas = new List();
44 | public List logs = new List();
45 | public int version = 1;
46 |
47 | //anulacion
48 | public DateTime anuladoTs = Tools.minValue; //no anulado
49 | public string anuladoNombre = "";
50 | public string anuladoTitulo = "";
51 | public string anuladoFname = "";
52 | public string anuladoPath = "";
53 | public string anuladoURLPath = "";
54 |
55 | public static Documento load(string path)
56 | {
57 | System.IO.StreamReader fs = System.IO.File.OpenText(path);
58 | string json = fs.ReadToEnd();
59 | fs.Close();
60 |
61 | Documento ret = Tools.fromJson(json);
62 | return ret;
63 | }
64 |
65 | public string getText(string id)
66 | {
67 | string ret = "";
68 | try
69 | {
70 | ret = (string)getValor(id);
71 | }
72 | catch (Exception ex)
73 | {
74 | ret = "";
75 | }
76 | return ret;
77 | }
78 |
79 | public bool contains(string id)
80 | {
81 | foreach (Propuesta p in propuestas)
82 | if (p.bag.ContainsKey(id))
83 | return true;
84 | return false;
85 | }
86 |
87 | public Object getValor(string id)
88 | {
89 | foreach(Propuesta p in propuestas)
90 | if (p.bag.ContainsKey(id))
91 | return p.bag[id];
92 | throw new Exception("Variable [" + id + "] no existe");
93 | }
94 |
95 | public void addLog(string msg)
96 | {
97 | Log l = new Log();
98 | l.msg = msg;
99 | logs.Add(l);
100 | }
101 |
102 | public void EjecutarConsenso()
103 | {
104 | try
105 | {
106 | Modelo m = grupo.organizacion.getModeloDocumento(modeloID);
107 | m.ejecutarConsenso(this);
108 | addLog("Consenso procesado");
109 | }
110 | catch (Exception ex)
111 | {
112 | addLog("EjecutarConsenso(): " + ex.Message + "");
113 | }
114 | }
115 |
116 | public string toHTMLSeguimiento()
117 | {
118 | string ret = "";
119 | ret += "
";
126 | foreach (Log l in logs)
127 | {
128 | ret += "
";
129 | ret += "
" + l.fecha.ToString("dd/MM/yy") + "
" + l.msg + "
";
130 | ret += "
";
131 | }
132 | ret += "
";
133 |
134 | ret += "
";
135 | return ret;
136 | }
137 |
138 | public void save()
139 | {
140 | //guardo
141 | Grupo g = grupo;
142 | grupo = null; //referencia ciclica
143 | System.IO.StreamWriter fs = new System.IO.StreamWriter(g.path + "\\" + path, false, System.Text.Encoding.UTF8);
144 | //System.IO.StreamWriter fs = System.IO.File.CreateText(path);
145 | fs.Write(Tools.toJson(this));
146 | fs.Close();
147 |
148 | grupo = g;
149 | }
150 | }
151 | }
--------------------------------------------------------------------------------
/model/documento/LogDocumento.cs:
--------------------------------------------------------------------------------
1 | ///////////////////////////////////////////////////////////////////////////
2 | // Copyright 2015 - 2020 Sabrina Prestigiacomo nabu@nabu.pt
3 | //
4 | // This program is free software: you can redistribute it and/or modify
5 | // it under the terms of the GNU General Public License as published by
6 | // the Free Software Foundation, either version 3 of the License, or
7 | // any later version.
8 | //
9 | // This program is distributed in the hope that it will be useful,
10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | // GNU General Public License for more details.
13 | //
14 | // You should have received a copy of the GNU General Public License
15 | // along with this program. If not, see .
16 | //
17 | ///////////////////////////////////////////////////////////////////////////
18 |
19 |
20 | using System;
21 | using System.Collections.Generic;
22 | using System.Linq;
23 | using System.Web;
24 |
25 | namespace nabu
26 | {
27 | public class LogDocumento
28 | {
29 | public DateTime fecha = DateTime.Now;
30 | public string modeloNombre;
31 | public string icono = "res/doc.png";
32 | public string modeloID = "";
33 | public string documentoNombre = "";
34 | public string titulo = "";
35 | public float x;
36 | public string fname = ""; //nombre del archivo del documento
37 | public int docID = 0;
38 | public string arbol = "";
39 | public string objetivo = "";
40 | public string URL = "";
41 | public int flores = 0;
42 | public int negados = 0;
43 | public string carpeta = "";
44 | public string autor = "";
45 | public int revisionDias = 0; //por si el documento tiene revision periodica
46 | public int version = 0;
47 | public string path = "";
48 |
49 |
50 | public string sFecha
51 | {
52 | get
53 | {
54 | return fecha.ToString("dd/MM/yy");
55 | }
56 | set
57 | {
58 | }
59 | }
60 |
61 | public float dias
62 | {
63 | get
64 | {
65 | return (float)DateTime.Now.Subtract(fecha).TotalMinutes / (24 * 60);
66 | }
67 | set
68 | {
69 | }
70 | }
71 |
72 | public float minutos
73 | {
74 | get
75 | {
76 | return (float)DateTime.Now.Subtract(fecha).TotalMinutes;
77 | }
78 | set
79 | {
80 | }
81 | }
82 | }
83 | }
--------------------------------------------------------------------------------
/model/documento/Prevista.cs:
--------------------------------------------------------------------------------
1 | ///////////////////////////////////////////////////////////////////////////
2 | // Copyright 2015 - 2020 Sabrina Prestigiacomo nabu@nabu.pt
3 | //
4 | // This program is free software: you can redistribute it and/or modify
5 | // it under the terms of the GNU General Public License as published by
6 | // the Free Software Foundation, either version 3 of the License, or
7 | // any later version.
8 | //
9 | // This program is distributed in the hope that it will be useful,
10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | // GNU General Public License for more details.
13 | //
14 | // You should have received a copy of the GNU General Public License
15 | // along with this program. If not, see .
16 | //
17 | ///////////////////////////////////////////////////////////////////////////
18 |
19 |
20 | using System;
21 | using System.Collections.Generic;
22 | using System.Linq;
23 | using System.Web;
24 |
25 | namespace nabu
26 | {
27 | public class Prevista
28 | {
29 | public List propuestas = new List();
30 | public string etiqueta = "";
31 | public string titulo = "";
32 | }
33 | }
--------------------------------------------------------------------------------
/model/documento/Propuesta.cs:
--------------------------------------------------------------------------------
1 | ///////////////////////////////////////////////////////////////////////////
2 | // Copyright 2015 - 2020 Sabrina Prestigiacomo nabu@nabu.pt
3 | //
4 | // This program is free software: you can redistribute it and/or modify
5 | // it under the terms of the GNU General Public License as published by
6 | // the Free Software Foundation, either version 3 of the License, or
7 | // any later version.
8 | //
9 | // This program is distributed in the hope that it will be useful,
10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | // GNU General Public License for more details.
13 | //
14 | // You should have received a copy of the GNU General Public License
15 | // along with this program. If not, see .
16 | //
17 | ///////////////////////////////////////////////////////////////////////////
18 |
19 |
20 | using System;
21 | using System.Collections.Generic;
22 | using System.Linq;
23 | using System.Web;
24 |
25 | namespace nabu
26 | {
27 | public class Propuesta: IComparable
28 | {
29 | public DateTime born = DateTime.Now;
30 | public string titulo = ""; //titulo del documento
31 | public string etiqueta = "";
32 | public string email = "";
33 | public int nodoID = 0;
34 | public string modeloID = "";
35 | public int nivel = 0;
36 | public int niveles = 0; //niveles en el momento de crear la propuesta
37 | public DateTime ts = DateTime.Now;
38 | public Dictionary bag = new Dictionary();
39 | public List comentarios = new List();
40 | public bool consensoAlcanzado = false;
41 |
42 | public Propuesta clone()
43 | {
44 | Propuesta ret = new Propuesta();
45 | ret.titulo = titulo;
46 | ret.etiqueta = etiqueta;
47 | ret.nodoID = nodoID;
48 | ret.nivel = nivel;
49 | ret.email = email;
50 | ret.modeloID = modeloID;
51 | ret.niveles = niveles;
52 |
53 | foreach (KeyValuePair var in bag)
54 | ret.bag.Add(var.Key, var.Value);
55 |
56 | //no clono comentarios
57 |
58 | return ret;
59 | }
60 |
61 | int IComparable.CompareTo(Object x)
62 | {
63 | Propuesta dos = (Propuesta)x;
64 | return this.nivel - dos.nivel;
65 | }
66 |
67 | public bool esPrevista()
68 | {
69 | return nodoID == 0;
70 | }
71 | }
72 | }
--------------------------------------------------------------------------------
/model/documento/Variable.cs:
--------------------------------------------------------------------------------
1 | ///////////////////////////////////////////////////////////////////////////
2 | // Copyright 2015 - 2020 Sabrina Prestigiacomo nabu@nabu.pt
3 | //
4 | // This program is free software: you can redistribute it and/or modify
5 | // it under the terms of the GNU General Public License as published by
6 | // the Free Software Foundation, either version 3 of the License, or
7 | // any later version.
8 | //
9 | // This program is distributed in the hope that it will be useful,
10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | // GNU General Public License for more details.
13 | //
14 | // You should have received a copy of the GNU General Public License
15 | // along with this program. If not, see .
16 | //
17 | ///////////////////////////////////////////////////////////////////////////
18 |
19 |
20 | using System;
21 | using System.Collections.Generic;
22 | using System.Linq;
23 | using System.Web;
24 |
25 | //representa una variable dentro de un documento
26 |
27 | namespace nabu
28 | {
29 | public class Variable
30 | {
31 | public Variable()
32 | {
33 | //default para serializar
34 | }
35 |
36 | public Variable(string id, int len)
37 | {
38 | this.id = id;
39 | this.len = len;
40 | this.nivel = 0;
41 | }
42 |
43 | public Variable(string id, int len, int nivel)
44 | {
45 | this.id = id;
46 | this.len = len;
47 | this.nivel = nivel;
48 | }
49 |
50 | public string id = "";
51 | public int len = 10;
52 | public int width = 100;
53 | public int height = 100;
54 | public string format = "0.00";
55 | public int nivel = 0;
56 | public string className = "texto";
57 | public string editClassName = "editar";
58 | }
59 | }
--------------------------------------------------------------------------------
/model/organizacion/Organizacion.cs:
--------------------------------------------------------------------------------
1 | ///////////////////////////////////////////////////////////////////////////
2 | // Copyright 2015 - 2020 Sabrina Prestigiacomo nabu@nabu.pt
3 | //
4 | // This program is free software: you can redistribute it and/or modify
5 | // it under the terms of the GNU General Public License as published by
6 | // the Free Software Foundation, either version 3 of the License, or
7 | // any later version.
8 | //
9 | // This program is distributed in the hope that it will be useful,
10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | // GNU General Public License for more details.
13 | //
14 | // You should have received a copy of the GNU General Public License
15 | // along with this program. If not, see .
16 | //
17 | ///////////////////////////////////////////////////////////////////////////
18 |
19 |
20 | using System;
21 | using System.Collections.Generic;
22 | using System.Web;
23 |
24 | namespace nabu
25 | {
26 | public abstract class Organizacion
27 | {
28 | //datos de arbol si es que tiene
29 | public string grupoURL = "";
30 | public string grupoNombre = "";
31 | public string grupoOrganizacion = "";
32 | public string grupoIdioma = "";
33 |
34 | public DateTime born = DateTime.Now;
35 |
36 | public Organizacion()
37 | {
38 | }
39 |
40 | public Modelo getModeloDocumento(string id)
41 | {
42 | foreach (Modelo m in getModelosDocumento(grupoIdioma))
43 | {
44 | if (m.id == id)
45 | return m;
46 | }
47 | throw new Exception("Modelo [" + id + "] no existe");
48 | }
49 |
50 | public ModeloEvaluacion getModeloEvaluacion(string id)
51 | {
52 | foreach (ModeloEvaluacion m in getModelosEvaluacion())
53 | {
54 | if (m.id == id)
55 | return m;
56 | }
57 | throw new Exception("Modelo [" + id + "] no existe");
58 | }
59 |
60 | public abstract List getModelosDocumento(string idioma);
61 | public abstract List getModelosEvaluacion();
62 | public abstract List