Merge branch 'master' into project-dashboards

This commit is contained in:
Manuel Rego Casasnovas 2011-11-14 10:17:19 +01:00
commit 16afe6cf3a
111 changed files with 7800 additions and 7079 deletions

44
AUTHORS
View file

@ -1,16 +1,46 @@
Authors
=======
* Cristina Alavariño Pérez <cristina.alvarino@comtecsf.es>
LibrePlan Team
--------------
* Cristina Alavariño Pérez <cristina.alvarino@cafedered.es>
* Jacobo Aragunde Pérez <jaragunde@igalia.com>
* Fernando Bellas Permuy <fbellas@udc.es>
* José María Casanova Crespo <jmcasanova@igalia.com>
* Nacho Barrientos Arias <nacho@igalia.com>
* Xavier Castaño García <xcastanho@igalia.com>
* Ignacio Díaz Teijido <ignacio.diaz@comtecsf.es>
* Óscar González Fernández <ogonzalez@igalia.com>
* Ignacio Díaz Teijido <ignacio.diaz@cafedered.es>
* Susana Montes Pedreira <smontes@wirelessgalicia.com>
* Francisco Javier Morán Rúa <jmoran@igalia.com>
* Diego Pino García <dpino@igalia.com>
* Manuel Rego Casasnovas <mrego@igalia.com>
* Farruco Sanjurjo Arcay <fsanjurjo@igalia.com>
* Manuel Rego Casasnovas <rego@igalia.com>
* Lorenzo Tilve Álvaro <ltilve@igalia.com>
Previous Team Members
---------------------
* Fernando Bellas Permuy <fbellas@udc.es>
* José María Casanova Crespo <jmcasanova@igalia.com>
* Óscar González Fernández <ogonzalez@igalia.com>
* Pablo Fernández de la Cigoña Nóvoa <pcigonha@igalia.com>
* Farruco Sanjurjo Arcay <fsanjurjo@igalia.com>
Translators
-----------
* [es] Manuel Rego Casasnovas <rego@igalia.com>
* [gl] Manuel Rego Casasnovas <rego@igalia.com>
* [ru] Pavel Rudensky <prudensky@gmail.com>
Contributors
------------
* Eloy Calatayud <ecalatayud@wirelessgalicia.com>
* Sergio Carracedo <cto@opsou.com>
* Pedro Figueras <sales@opsou.com>
* Dmytro Melanchenko <melanchenko@gmail.com>
* Adrián Pérez <aperez@igalia.com>

View file

@ -482,7 +482,9 @@ public class Planner extends HtmlMacroComponent {
private void insertGlobalCommands() {
Component commontoolbar = getCommonCommandsInsertionPoint();
Component plannerToolbar = getSpecificCommandsInsertionPoint();
commontoolbar.getChildren().removeAll(commontoolbar.getChildren());
if (!contextualizedGlobalCommands.isEmpty()) {
commontoolbar.getChildren().removeAll(commontoolbar.getChildren());
}
for (CommandContextualized<?> c : contextualizedGlobalCommands) {
// Comparison through icon as name is internationalized
if (c.getCommand().getImage()

View file

@ -96,7 +96,6 @@ public abstract class Task implements ITaskFundamentalProperties {
fundamentalPropertiesListeners.firePropertyChange("beginDate",
previousStart, fundamentalProperties.getBeginDate());
fireEndDate(previousEnd);
reloadResourcesTextIfChange(newStart, previousStart);
}
@Override
@ -204,13 +203,6 @@ public abstract class Task implements ITaskFundamentalProperties {
newStart);
}
private void reloadResourcesTextIfChange(GanttDate newDate,
GanttDate previousDate) {
if (!ObjectUtils.equals(newDate, previousDate)) {
reloadResourcesText();
}
}
public void fireChangesForPreviousValues(GanttDate previousStart,
GanttDate previousEnd) {
dependenciesEnforcerHook.setStartDate(previousStart, previousStart,

View file

@ -36,7 +36,7 @@ import org.joda.time.Years;
public class DetailOneTimeTrackerState extends
TimeTrackerStateWithSubintervalsFitting {
public static final Period MINIMUN_PERIOD = PeriodType.YEARS.amount(4);
public static final Period MINIMUN_PERIOD = PeriodType.YEARS.amount(6);
private static final int FIRST_LEVEL_ITEM_SIZE = 200;
private static final int SECOND_LEVEL_ITEM_SIZE = 100;

View file

@ -35,7 +35,7 @@ import org.zkoss.util.Locales;
public class DetailThreeTimeTrackerState extends
TimeTrackerStateWithSubintervalsFitting {
private static final int NUMBER_OF_MONTHS_MINIMUM = 20;
private static final int NUMBER_OF_MONTHS_MINIMUM = 30;
DetailThreeTimeTrackerState(IDetailItemModificator firstLevelModificator,
IDetailItemModificator secondLevelModificator) {
@ -125,4 +125,4 @@ public class DetailThreeTimeTrackerState extends
return SECOND_LEVEL_SIZE;
}
}
}

View file

@ -1,5 +1,5 @@
# Spanish translations for LibrePlan package
# Traducciones al español para el paquete LibrePlan.
# Spanish translations for LibrePlan - GanttZK module
# Traducciones al español para LibrePlan - módulo GanttZK
# Copyright (C) 2009-2010 Fundación para o Fomento da Calidade Industrial e
# Desenvolvemento Tecnolóxico de Galicia
# Copyright (C) 2010-2011 Igalia, S.L.
@ -10,11 +10,11 @@
#
msgid ""
msgstr ""
"Project-Id-Version: 1.1.0\n"
"Project-Id-Version: 1.2.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2011-08-09 16:17+0200\n"
"PO-Revision-Date: 2011-08-09 16:29+0200\n"
"Last-Translator: Manuel Rego Casasnovas <mrego@igalia.com>\n"
"POT-Creation-Date: 2011-11-10 20:11+0100\n"
"PO-Revision-Date: 2011-11-10 20:18+0100\n"
"Last-Translator: Manuel Rego Casasnovas <rego@igalia.com>\n"
"Language-Team: Spanish <>\n"
"Language: es\n"
"MIME-Version: 1.0\n"
@ -27,7 +27,7 @@ msgstr ""
msgid "Erase"
msgstr "Borrar"
#: ganttzk/src/main/java/org/zkoss/ganttz/TaskList.java:319
#: ganttzk/src/main/java/org/zkoss/ganttz/TaskList.java:299
msgid "Add Dependency"
msgstr "Añadir dependencia"
@ -39,20 +39,20 @@ msgstr "Trabajador"
msgid "Start"
msgstr "Inicio"
#: ganttzk/src/main/java/org/zkoss/ganttz/Planner.java:592
#: ganttzk/src/main/java/org/zkoss/ganttz/Planner.java:629
msgid "Show reported hours"
msgstr "Mostrar horas reportadas"
#: ganttzk/src/main/java/org/zkoss/ganttz/resourceload/ResourcesLoadPanel.java:92
#: ganttzk/src/main/java/org/zkoss/ganttz/resourceload/ResourcesLoadPanel.java:90
msgid "by criteria"
msgstr "por criterios"
#: ganttzk/src/main/resources/web/ganttz/zul/plannerLayout.zul:72
#: ganttzk/src/main/resources/web/ganttz/zul/plannerLayout.zul:85
msgid "Show/Hide reported hours"
msgstr "Mostrar/Ocultar horas reportardas"
#: ganttzk/src/main/resources/web/ganttz/zul/resourcesLoadLayout.zul:35
#: ganttzk/src/main/resources/web/ganttz/zul/plannerLayout.zul:46
#: ganttzk/src/main/resources/web/ganttz/zul/plannerLayout.zul:49
msgid "Zoom"
msgstr "Zoom"
@ -60,7 +60,7 @@ msgstr "Zoom"
msgid "Limiting resources"
msgstr "Recursos limitantes"
#: ganttzk/src/main/java/org/zkoss/ganttz/DependencyList.java:68
#: ganttzk/src/main/java/org/zkoss/ganttz/DependencyList.java:67
msgid "The specified dependency is not allowed"
msgstr "La dependencia especificada no está permitida"
@ -68,15 +68,15 @@ msgstr "La dependencia especificada no está permitida"
msgid "Set End-End"
msgstr "Definir Fin-Fin"
#: ganttzk/src/main/resources/web/ganttz/zul/plannerLayout.zul:80
#: ganttzk/src/main/resources/web/ganttz/zul/plannerLayout.zul:78
msgid "Show/Hide progress"
msgstr "Mostrar/Ocultar progreso"
#: ganttzk/src/main/java/org/zkoss/ganttz/resourceload/ResourceLoadComponent.java:188
#: ganttzk/src/main/java/org/zkoss/ganttz/resourceload/ResourceLoadComponent.java:199
msgid "available effort: {0}, assigned effort: {1}"
msgstr "esfuerzo disponible: {0}, esfuerzo asignado: {1}"
#: ganttzk/src/main/java/org/zkoss/ganttz/resourceload/ResourcesLoadPanel.java:91
#: ganttzk/src/main/java/org/zkoss/ganttz/resourceload/ResourcesLoadPanel.java:89
msgid "by resources"
msgstr "por recursos"
@ -88,7 +88,7 @@ msgstr "Tarea"
msgid "Criterion"
msgstr "Criterio"
#: ganttzk/src/main/resources/web/ganttz/zul/plannerLayout.zul:41
#: ganttzk/src/main/resources/web/ganttz/zul/plannerLayout.zul:44
msgid "Print"
msgstr "Imprimir"
@ -96,7 +96,7 @@ msgstr "Imprimir"
msgid "Week"
msgstr "Semana"
#: ganttzk/src/main/java/org/zkoss/ganttz/resourceload/ResourcesLoadPanel.java:489
#: ganttzk/src/main/java/org/zkoss/ganttz/resourceload/ResourcesLoadPanel.java:501
msgid "filtering by name"
msgstr "filtrando por nombre"
@ -108,10 +108,6 @@ msgstr "Ver planificación"
msgid "End"
msgstr "Fin"
#: ganttzk/src/main/resources/web/ganttz/zul/plannerLayout.zul:37
msgid "Choosing Template"
msgstr "Selección de plantilla"
#: ganttzk/src/main/java/org/zkoss/ganttz/timetracker/TimeTracker.java:243
msgid "changing zoom"
msgstr "cambiando zoom"
@ -124,7 +120,7 @@ msgstr "Trimestre"
msgid "None"
msgstr "Ninguno"
#: ganttzk/src/main/resources/web/ganttz/zul/plannerLayout.zul:69
#: ganttzk/src/main/resources/web/ganttz/zul/plannerLayout.zul:71
msgid "Flatten/Unflatten tree"
msgstr "Aplanar/Expandir árbol"
@ -136,7 +132,7 @@ msgstr "Filtro"
msgid "Project"
msgstr "Proyecto"
#: ganttzk/src/main/resources/web/ganttz/zul/resourcesLoadLayout.zul:68
#: ganttzk/src/main/resources/web/ganttz/zul/resourcesLoadLayout.zul:67
#: ganttzk/src/main/resources/web/ganttz/zul/leftTasksTree.zul:28
msgid "Name"
msgstr "Nombre"
@ -145,27 +141,23 @@ msgstr "Nombre"
msgid "Name filter"
msgstr "Filtro por nombres"
#: ganttzk/src/main/java/org/zkoss/ganttz/Planner.java:572
#: ganttzk/src/main/java/org/zkoss/ganttz/Planner.java:609
msgid "Show progress"
msgstr "Mostrar progreso"
#: ganttzk/src/main/resources/web/ganttz/zul/plannerLayout.zul:66
#: ganttzk/src/main/resources/web/ganttz/zul/plannerLayout.zul:67
msgid "Expand/Collapse all"
msgstr "Expandir/Plegar todo"
#: ganttzk/src/main/resources/web/ganttz/zul/plannerLayout.zul:56
#: ganttzk/src/main/resources/web/ganttz/zul/plannerLayout.zul:58
msgid "Show/Hide critical path"
msgstr "Mostrar/Ocultar camino crítico"
#: ganttzk/src/main/resources/web/ganttz/zul/plannerLayout.zul:36
msgid "Create Project"
msgstr "Crear proyecto"
#: ganttzk/src/main/java/org/zkoss/ganttz/timetracker/zoom/ZoomLevel.java:32
msgid "Year"
msgstr "Año"
#: ganttzk/src/main/java/org/zkoss/ganttz/resourceload/ResourcesLoadPanel.java:145
#: ganttzk/src/main/java/org/zkoss/ganttz/resourceload/ResourcesLoadPanel.java:150
msgid "showing criteria"
msgstr "mostrando criterios"
@ -173,7 +165,7 @@ msgstr "mostrando criterios"
msgid "Month"
msgstr "Mes"
#: ganttzk/src/main/resources/web/ganttz/zul/plannerLayout.zul:63
#: ganttzk/src/main/resources/web/ganttz/zul/plannerLayout.zul:64
msgid "Show/Hide resources"
msgstr "Mostrar/Ocultar recursos"
@ -181,11 +173,11 @@ msgstr "Mostrar/Ocultar recursos"
msgid "Set End-Start"
msgstr "Definir Fin-Inicio"
#: ganttzk/src/main/java/org/zkoss/ganttz/Planner.java:302
#: ganttzk/src/main/java/org/zkoss/ganttz/Planner.java:298
msgid "decreasing zoom"
msgstr "reduciendo zoom"
#: ganttzk/src/main/java/org/zkoss/ganttz/Planner.java:559
#: ganttzk/src/main/java/org/zkoss/ganttz/Planner.java:590
msgid "Hide critical path"
msgstr "Ocultar camino crítico"
@ -193,19 +185,19 @@ msgstr "Ocultar camino crítico"
msgid "Day"
msgstr "Día"
#: ganttzk/src/main/java/org/zkoss/ganttz/Planner.java:599
#: ganttzk/src/main/java/org/zkoss/ganttz/Planner.java:636
msgid "Hide reported hours"
msgstr "Ocultar horas reportadas"
#: ganttzk/src/main/java/org/zkoss/ganttz/resourceload/ResourceLoadComponent.java:182
#: ganttzk/src/main/java/org/zkoss/ganttz/resourceload/ResourceLoadComponent.java:193
msgid "Load: {0}%"
msgstr "Carga: {0}%"
#: ganttzk/src/main/java/org/zkoss/ganttz/resourceload/ResourcesLoadPanel.java:142
#: ganttzk/src/main/java/org/zkoss/ganttz/resourceload/ResourcesLoadPanel.java:147
msgid "showing resources"
msgstr "mostrando recursos"
#: ganttzk/src/main/resources/web/ganttz/zul/plannerLayout.zul:60
#: ganttzk/src/main/resources/web/ganttz/zul/plannerLayout.zul:61
msgid "Show/Hide labels"
msgstr "Mostrar/Ocultar etiquetas"
@ -213,8 +205,8 @@ msgstr "Mostrar/Ocultar etiquetas"
msgid "Hour"
msgstr "Hora"
#: ganttzk/src/main/resources/web/ganttz/zul/resourcesLoadLayout.zul:91
#: ganttzk/src/main/resources/web/ganttz/zul/plannerLayout.zul:116
#: ganttzk/src/main/resources/web/ganttz/zul/resourcesLoadLayout.zul:90
#: ganttzk/src/main/resources/web/ganttz/zul/plannerLayout.zul:114
msgid "Graphics"
msgstr "Gráficas"
@ -222,30 +214,30 @@ msgstr "Gráficas"
msgid "Set Start-Start"
msgstr "Definir Inicio-Inicio"
#: ganttzk/src/main/java/org/zkoss/ganttz/resourceload/ResourceLoadComponent.java:141
#: ganttzk/src/main/java/org/zkoss/ganttz/resourceload/ResourceLoadComponent.java:152
msgid "See resource allocation"
msgstr "Ver asignación de recursos"
#: ganttzk/src/main/java/org/zkoss/ganttz/Planner.java:285
#: ganttzk/src/main/java/org/zkoss/ganttz/Planner.java:281
msgid "increasing zoom"
msgstr "aumentando zoom"
#: ganttzk/src/main/java/org/zkoss/ganttz/resourceload/ResourcesLoadPanel.java:455
#: ganttzk/src/main/java/org/zkoss/ganttz/resourceload/ResourcesLoadPanel.java:467
msgid "Show all elements"
msgstr "Mostrar todos los elementos"
#: ganttzk/src/main/java/org/zkoss/ganttz/resourceload/ResourcesLoadPanel.java:454
#: ganttzk/src/main/java/org/zkoss/ganttz/resourceload/ResourcesLoadPanel.java:466
msgid "All"
msgstr "Todos"
#: ganttzk/src/main/resources/web/ganttz/zul/plannerLayout.zul:39
#: ganttzk/src/main/resources/web/ganttz/zul/plannerLayout.zul:38
msgid "Refresh"
msgstr "Actualizar"
#: ganttzk/src/main/java/org/zkoss/ganttz/Planner.java:554
#: ganttzk/src/main/java/org/zkoss/ganttz/Planner.java:585
msgid "Show critical path"
msgstr "Mostrar camino crítico"
#: ganttzk/src/main/java/org/zkoss/ganttz/Planner.java:577
#: ganttzk/src/main/java/org/zkoss/ganttz/Planner.java:614
msgid "Hide progress"
msgstr "Ocultar progreso"

View file

@ -1,20 +1,20 @@
# Galician translations for LibrePlan package
# Traducciones al español para el paquete LibrePlan.
# Galician translations for LibrePlan - GanttZK module
# Traducciones al español para LibrePlan - módulo GanttZK
# Copyright (C) 2009-2010 Fundación para o Fomento da Calidade Industrial e
# Desenvolvemento Tecnolóxico de Galicia
# Copyright (C) 2010-2011 Igalia, S.L.
# This file is distributed under the same license as the LibrePlan package.
# Igalia <dpino@igalia.com>, 2009.
# Jacobo Aragunde Pérez <jaragunde@igalia.com>, 2010.
# Manuel Rego Casasnovas <mrego@igalia.com>, 2010, 2011.
# Manuel Rego Casasnovas <rego@igalia.com>, 2010, 2011.
#
msgid ""
msgstr ""
"Project-Id-Version: 1.1.0\n"
"Project-Id-Version: 1.2.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2011-08-09 16:17+0200\n"
"PO-Revision-Date: 2011-08-09 16:30+0200\n"
"Last-Translator: Manuel Rego Casasnovas <mrego@igalia.com>\n"
"POT-Creation-Date: 2011-11-10 20:11+0100\n"
"PO-Revision-Date: 2011-11-10 20:20+0100\n"
"Last-Translator: Manuel Rego Casasnovas <rego@igalia.com>\n"
"Language-Team: Galician <>\n"
"Language: gl\n"
"MIME-Version: 1.0\n"
@ -27,7 +27,7 @@ msgstr ""
msgid "Erase"
msgstr "Borrar"
#: ganttzk/src/main/java/org/zkoss/ganttz/TaskList.java:319
#: ganttzk/src/main/java/org/zkoss/ganttz/TaskList.java:299
msgid "Add Dependency"
msgstr "Engadir dependencia"
@ -39,20 +39,20 @@ msgstr "Traballador"
msgid "Start"
msgstr "Inicio"
#: ganttzk/src/main/java/org/zkoss/ganttz/Planner.java:592
#: ganttzk/src/main/java/org/zkoss/ganttz/Planner.java:629
msgid "Show reported hours"
msgstr "Mostrar horas reportadas"
#: ganttzk/src/main/java/org/zkoss/ganttz/resourceload/ResourcesLoadPanel.java:92
#: ganttzk/src/main/java/org/zkoss/ganttz/resourceload/ResourcesLoadPanel.java:90
msgid "by criteria"
msgstr "por criterios"
#: ganttzk/src/main/resources/web/ganttz/zul/plannerLayout.zul:72
#: ganttzk/src/main/resources/web/ganttz/zul/plannerLayout.zul:85
msgid "Show/Hide reported hours"
msgstr "Mostrar/Ocultar horas reportadas"
#: ganttzk/src/main/resources/web/ganttz/zul/resourcesLoadLayout.zul:35
#: ganttzk/src/main/resources/web/ganttz/zul/plannerLayout.zul:46
#: ganttzk/src/main/resources/web/ganttz/zul/plannerLayout.zul:49
msgid "Zoom"
msgstr "Zoom"
@ -60,7 +60,7 @@ msgstr "Zoom"
msgid "Limiting resources"
msgstr "Recursos limitantes"
#: ganttzk/src/main/java/org/zkoss/ganttz/DependencyList.java:68
#: ganttzk/src/main/java/org/zkoss/ganttz/DependencyList.java:67
msgid "The specified dependency is not allowed"
msgstr "A dependencia especificada non está permitida"
@ -68,15 +68,15 @@ msgstr "A dependencia especificada non está permitida"
msgid "Set End-End"
msgstr "Definir Fin-Fin"
#: ganttzk/src/main/resources/web/ganttz/zul/plannerLayout.zul:80
#: ganttzk/src/main/resources/web/ganttz/zul/plannerLayout.zul:78
msgid "Show/Hide progress"
msgstr "Mostrar/Ocultar progreso"
#: ganttzk/src/main/java/org/zkoss/ganttz/resourceload/ResourceLoadComponent.java:188
#: ganttzk/src/main/java/org/zkoss/ganttz/resourceload/ResourceLoadComponent.java:199
msgid "available effort: {0}, assigned effort: {1}"
msgstr "esforzo dispoñible: {0}, esforzo asignado: {1}"
#: ganttzk/src/main/java/org/zkoss/ganttz/resourceload/ResourcesLoadPanel.java:91
#: ganttzk/src/main/java/org/zkoss/ganttz/resourceload/ResourcesLoadPanel.java:89
msgid "by resources"
msgstr "por recursos"
@ -88,7 +88,7 @@ msgstr "Tarefa"
msgid "Criterion"
msgstr "Criterio"
#: ganttzk/src/main/resources/web/ganttz/zul/plannerLayout.zul:41
#: ganttzk/src/main/resources/web/ganttz/zul/plannerLayout.zul:44
msgid "Print"
msgstr "Imprimir"
@ -96,7 +96,7 @@ msgstr "Imprimir"
msgid "Week"
msgstr "Semana"
#: ganttzk/src/main/java/org/zkoss/ganttz/resourceload/ResourcesLoadPanel.java:489
#: ganttzk/src/main/java/org/zkoss/ganttz/resourceload/ResourcesLoadPanel.java:501
msgid "filtering by name"
msgstr "filtrando por nome"
@ -108,10 +108,6 @@ msgstr "Ver planificación"
msgid "End"
msgstr "Fin"
#: ganttzk/src/main/resources/web/ganttz/zul/plannerLayout.zul:37
msgid "Choosing Template"
msgstr "Selección de modelo"
#: ganttzk/src/main/java/org/zkoss/ganttz/timetracker/TimeTracker.java:243
msgid "changing zoom"
msgstr "cambiando zoom"
@ -124,7 +120,7 @@ msgstr "Trimestre"
msgid "None"
msgstr "Ningún"
#: ganttzk/src/main/resources/web/ganttz/zul/plannerLayout.zul:69
#: ganttzk/src/main/resources/web/ganttz/zul/plannerLayout.zul:71
msgid "Flatten/Unflatten tree"
msgstr "Aplanar/Expandir árbore"
@ -136,7 +132,7 @@ msgstr "Filtro"
msgid "Project"
msgstr "Proxecto"
#: ganttzk/src/main/resources/web/ganttz/zul/resourcesLoadLayout.zul:68
#: ganttzk/src/main/resources/web/ganttz/zul/resourcesLoadLayout.zul:67
#: ganttzk/src/main/resources/web/ganttz/zul/leftTasksTree.zul:28
msgid "Name"
msgstr "Nome"
@ -145,27 +141,23 @@ msgstr "Nome"
msgid "Name filter"
msgstr "Filtro por nomes"
#: ganttzk/src/main/java/org/zkoss/ganttz/Planner.java:572
#: ganttzk/src/main/java/org/zkoss/ganttz/Planner.java:609
msgid "Show progress"
msgstr "Mostrar progreso"
#: ganttzk/src/main/resources/web/ganttz/zul/plannerLayout.zul:66
#: ganttzk/src/main/resources/web/ganttz/zul/plannerLayout.zul:67
msgid "Expand/Collapse all"
msgstr "Expandir/Pregar todo"
#: ganttzk/src/main/resources/web/ganttz/zul/plannerLayout.zul:56
#: ganttzk/src/main/resources/web/ganttz/zul/plannerLayout.zul:58
msgid "Show/Hide critical path"
msgstr "Mostrar/Ocultar camiño crítico"
#: ganttzk/src/main/resources/web/ganttz/zul/plannerLayout.zul:36
msgid "Create Project"
msgstr "Crear proxecto"
#: ganttzk/src/main/java/org/zkoss/ganttz/timetracker/zoom/ZoomLevel.java:32
msgid "Year"
msgstr "Ano"
#: ganttzk/src/main/java/org/zkoss/ganttz/resourceload/ResourcesLoadPanel.java:145
#: ganttzk/src/main/java/org/zkoss/ganttz/resourceload/ResourcesLoadPanel.java:150
msgid "showing criteria"
msgstr "mostrando criterios"
@ -173,7 +165,7 @@ msgstr "mostrando criterios"
msgid "Month"
msgstr "Mes"
#: ganttzk/src/main/resources/web/ganttz/zul/plannerLayout.zul:63
#: ganttzk/src/main/resources/web/ganttz/zul/plannerLayout.zul:64
msgid "Show/Hide resources"
msgstr "Mostrar/Ocultar recursos"
@ -181,11 +173,11 @@ msgstr "Mostrar/Ocultar recursos"
msgid "Set End-Start"
msgstr "Definir Fin-Inicio"
#: ganttzk/src/main/java/org/zkoss/ganttz/Planner.java:302
#: ganttzk/src/main/java/org/zkoss/ganttz/Planner.java:298
msgid "decreasing zoom"
msgstr "reducindo zoom"
#: ganttzk/src/main/java/org/zkoss/ganttz/Planner.java:559
#: ganttzk/src/main/java/org/zkoss/ganttz/Planner.java:590
msgid "Hide critical path"
msgstr "Ocultar camiño crítico"
@ -193,19 +185,19 @@ msgstr "Ocultar camiño crítico"
msgid "Day"
msgstr "Día"
#: ganttzk/src/main/java/org/zkoss/ganttz/Planner.java:599
#: ganttzk/src/main/java/org/zkoss/ganttz/Planner.java:636
msgid "Hide reported hours"
msgstr "Ocultar horas reportadas"
#: ganttzk/src/main/java/org/zkoss/ganttz/resourceload/ResourceLoadComponent.java:182
#: ganttzk/src/main/java/org/zkoss/ganttz/resourceload/ResourceLoadComponent.java:193
msgid "Load: {0}%"
msgstr "Carga: {0}%"
#: ganttzk/src/main/java/org/zkoss/ganttz/resourceload/ResourcesLoadPanel.java:142
#: ganttzk/src/main/java/org/zkoss/ganttz/resourceload/ResourcesLoadPanel.java:147
msgid "showing resources"
msgstr "mostrando recursos"
#: ganttzk/src/main/resources/web/ganttz/zul/plannerLayout.zul:60
#: ganttzk/src/main/resources/web/ganttz/zul/plannerLayout.zul:61
msgid "Show/Hide labels"
msgstr "Mostrar/Ocultar etiquetas"
@ -213,8 +205,8 @@ msgstr "Mostrar/Ocultar etiquetas"
msgid "Hour"
msgstr "Hora"
#: ganttzk/src/main/resources/web/ganttz/zul/resourcesLoadLayout.zul:91
#: ganttzk/src/main/resources/web/ganttz/zul/plannerLayout.zul:116
#: ganttzk/src/main/resources/web/ganttz/zul/resourcesLoadLayout.zul:90
#: ganttzk/src/main/resources/web/ganttz/zul/plannerLayout.zul:114
msgid "Graphics"
msgstr "Gráficas"
@ -222,30 +214,30 @@ msgstr "Gráficas"
msgid "Set Start-Start"
msgstr "Definir Inicio-Inicio"
#: ganttzk/src/main/java/org/zkoss/ganttz/resourceload/ResourceLoadComponent.java:141
#: ganttzk/src/main/java/org/zkoss/ganttz/resourceload/ResourceLoadComponent.java:152
msgid "See resource allocation"
msgstr "Ver asignación de recursoss"
#: ganttzk/src/main/java/org/zkoss/ganttz/Planner.java:285
#: ganttzk/src/main/java/org/zkoss/ganttz/Planner.java:281
msgid "increasing zoom"
msgstr "aumentando zoom"
#: ganttzk/src/main/java/org/zkoss/ganttz/resourceload/ResourcesLoadPanel.java:455
#: ganttzk/src/main/java/org/zkoss/ganttz/resourceload/ResourcesLoadPanel.java:467
msgid "Show all elements"
msgstr "Mostrar tódolos elementos"
#: ganttzk/src/main/java/org/zkoss/ganttz/resourceload/ResourcesLoadPanel.java:454
#: ganttzk/src/main/java/org/zkoss/ganttz/resourceload/ResourcesLoadPanel.java:466
msgid "All"
msgstr "Todos"
#: ganttzk/src/main/resources/web/ganttz/zul/plannerLayout.zul:39
#: ganttzk/src/main/resources/web/ganttz/zul/plannerLayout.zul:38
msgid "Refresh"
msgstr "Actualizar"
#: ganttzk/src/main/java/org/zkoss/ganttz/Planner.java:554
#: ganttzk/src/main/java/org/zkoss/ganttz/Planner.java:585
msgid "Show critical path"
msgstr "Mostrar camiño crítico"
#: ganttzk/src/main/java/org/zkoss/ganttz/Planner.java:577
#: ganttzk/src/main/java/org/zkoss/ganttz/Planner.java:614
msgid "Hide progress"
msgstr "Ocultar progreso"

View file

@ -5,14 +5,14 @@
# This file is distributed under the same license as the LibrePlan package.
# Diego Pino García <dpino@igalia.com>, 2009.
# Jacobo Aragunde Pérez <jaragunde@igalia.com>, 2009, 2010.
# Manuel Rego Casasnovas <mrego@igalia.com>, 2010, 2011.
# Manuel Rego Casasnovas <rego@igalia.com>, 2010, 2011.
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: 1.1.3\n"
"Project-Id-Version: 1.2.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2011-08-09 16:17+0200\n"
"POT-Creation-Date: 2011-11-10 20:11+0100\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
@ -26,7 +26,7 @@ msgstr ""
msgid "Erase"
msgstr ""
#: ganttzk/src/main/java/org/zkoss/ganttz/TaskList.java:319
#: ganttzk/src/main/java/org/zkoss/ganttz/TaskList.java:299
msgid "Add Dependency"
msgstr ""
@ -38,20 +38,20 @@ msgstr ""
msgid "Start"
msgstr ""
#: ganttzk/src/main/java/org/zkoss/ganttz/Planner.java:592
#: ganttzk/src/main/java/org/zkoss/ganttz/Planner.java:629
msgid "Show reported hours"
msgstr ""
#: ganttzk/src/main/java/org/zkoss/ganttz/resourceload/ResourcesLoadPanel.java:92
#: ganttzk/src/main/java/org/zkoss/ganttz/resourceload/ResourcesLoadPanel.java:90
msgid "by criteria"
msgstr ""
#: ganttzk/src/main/resources/web/ganttz/zul/plannerLayout.zul:72
#: ganttzk/src/main/resources/web/ganttz/zul/plannerLayout.zul:85
msgid "Show/Hide reported hours"
msgstr ""
#: ganttzk/src/main/resources/web/ganttz/zul/resourcesLoadLayout.zul:35
#: ganttzk/src/main/resources/web/ganttz/zul/plannerLayout.zul:46
#: ganttzk/src/main/resources/web/ganttz/zul/plannerLayout.zul:49
msgid "Zoom"
msgstr ""
@ -59,7 +59,7 @@ msgstr ""
msgid "Limiting resources"
msgstr ""
#: ganttzk/src/main/java/org/zkoss/ganttz/DependencyList.java:68
#: ganttzk/src/main/java/org/zkoss/ganttz/DependencyList.java:67
msgid "The specified dependency is not allowed"
msgstr ""
@ -67,15 +67,15 @@ msgstr ""
msgid "Set End-End"
msgstr ""
#: ganttzk/src/main/resources/web/ganttz/zul/plannerLayout.zul:80
#: ganttzk/src/main/resources/web/ganttz/zul/plannerLayout.zul:78
msgid "Show/Hide progress"
msgstr ""
#: ganttzk/src/main/java/org/zkoss/ganttz/resourceload/ResourceLoadComponent.java:188
#: ganttzk/src/main/java/org/zkoss/ganttz/resourceload/ResourceLoadComponent.java:199
msgid "available effort: {0}, assigned effort: {1}"
msgstr ""
#: ganttzk/src/main/java/org/zkoss/ganttz/resourceload/ResourcesLoadPanel.java:91
#: ganttzk/src/main/java/org/zkoss/ganttz/resourceload/ResourcesLoadPanel.java:89
msgid "by resources"
msgstr ""
@ -87,7 +87,7 @@ msgstr ""
msgid "Criterion"
msgstr ""
#: ganttzk/src/main/resources/web/ganttz/zul/plannerLayout.zul:41
#: ganttzk/src/main/resources/web/ganttz/zul/plannerLayout.zul:44
msgid "Print"
msgstr ""
@ -95,7 +95,7 @@ msgstr ""
msgid "Week"
msgstr ""
#: ganttzk/src/main/java/org/zkoss/ganttz/resourceload/ResourcesLoadPanel.java:489
#: ganttzk/src/main/java/org/zkoss/ganttz/resourceload/ResourcesLoadPanel.java:501
msgid "filtering by name"
msgstr ""
@ -107,10 +107,6 @@ msgstr ""
msgid "End"
msgstr ""
#: ganttzk/src/main/resources/web/ganttz/zul/plannerLayout.zul:37
msgid "Choosing Template"
msgstr ""
#: ganttzk/src/main/java/org/zkoss/ganttz/timetracker/TimeTracker.java:243
msgid "changing zoom"
msgstr ""
@ -123,7 +119,7 @@ msgstr ""
msgid "None"
msgstr ""
#: ganttzk/src/main/resources/web/ganttz/zul/plannerLayout.zul:69
#: ganttzk/src/main/resources/web/ganttz/zul/plannerLayout.zul:71
msgid "Flatten/Unflatten tree"
msgstr ""
@ -135,7 +131,7 @@ msgstr ""
msgid "Project"
msgstr ""
#: ganttzk/src/main/resources/web/ganttz/zul/resourcesLoadLayout.zul:68
#: ganttzk/src/main/resources/web/ganttz/zul/resourcesLoadLayout.zul:67
#: ganttzk/src/main/resources/web/ganttz/zul/leftTasksTree.zul:28
msgid "Name"
msgstr ""
@ -144,27 +140,23 @@ msgstr ""
msgid "Name filter"
msgstr ""
#: ganttzk/src/main/java/org/zkoss/ganttz/Planner.java:572
#: ganttzk/src/main/java/org/zkoss/ganttz/Planner.java:609
msgid "Show progress"
msgstr ""
#: ganttzk/src/main/resources/web/ganttz/zul/plannerLayout.zul:66
#: ganttzk/src/main/resources/web/ganttz/zul/plannerLayout.zul:67
msgid "Expand/Collapse all"
msgstr ""
#: ganttzk/src/main/resources/web/ganttz/zul/plannerLayout.zul:56
#: ganttzk/src/main/resources/web/ganttz/zul/plannerLayout.zul:58
msgid "Show/Hide critical path"
msgstr ""
#: ganttzk/src/main/resources/web/ganttz/zul/plannerLayout.zul:36
msgid "Create Project"
msgstr ""
#: ganttzk/src/main/java/org/zkoss/ganttz/timetracker/zoom/ZoomLevel.java:32
msgid "Year"
msgstr ""
#: ganttzk/src/main/java/org/zkoss/ganttz/resourceload/ResourcesLoadPanel.java:145
#: ganttzk/src/main/java/org/zkoss/ganttz/resourceload/ResourcesLoadPanel.java:150
msgid "showing criteria"
msgstr ""
@ -172,7 +164,7 @@ msgstr ""
msgid "Month"
msgstr ""
#: ganttzk/src/main/resources/web/ganttz/zul/plannerLayout.zul:63
#: ganttzk/src/main/resources/web/ganttz/zul/plannerLayout.zul:64
msgid "Show/Hide resources"
msgstr ""
@ -180,11 +172,11 @@ msgstr ""
msgid "Set End-Start"
msgstr ""
#: ganttzk/src/main/java/org/zkoss/ganttz/Planner.java:302
#: ganttzk/src/main/java/org/zkoss/ganttz/Planner.java:298
msgid "decreasing zoom"
msgstr ""
#: ganttzk/src/main/java/org/zkoss/ganttz/Planner.java:559
#: ganttzk/src/main/java/org/zkoss/ganttz/Planner.java:590
msgid "Hide critical path"
msgstr ""
@ -192,19 +184,19 @@ msgstr ""
msgid "Day"
msgstr ""
#: ganttzk/src/main/java/org/zkoss/ganttz/Planner.java:599
#: ganttzk/src/main/java/org/zkoss/ganttz/Planner.java:636
msgid "Hide reported hours"
msgstr ""
#: ganttzk/src/main/java/org/zkoss/ganttz/resourceload/ResourceLoadComponent.java:182
#: ganttzk/src/main/java/org/zkoss/ganttz/resourceload/ResourceLoadComponent.java:193
msgid "Load: {0}%"
msgstr ""
#: ganttzk/src/main/java/org/zkoss/ganttz/resourceload/ResourcesLoadPanel.java:142
#: ganttzk/src/main/java/org/zkoss/ganttz/resourceload/ResourcesLoadPanel.java:147
msgid "showing resources"
msgstr ""
#: ganttzk/src/main/resources/web/ganttz/zul/plannerLayout.zul:60
#: ganttzk/src/main/resources/web/ganttz/zul/plannerLayout.zul:61
msgid "Show/Hide labels"
msgstr ""
@ -212,8 +204,8 @@ msgstr ""
msgid "Hour"
msgstr ""
#: ganttzk/src/main/resources/web/ganttz/zul/resourcesLoadLayout.zul:91
#: ganttzk/src/main/resources/web/ganttz/zul/plannerLayout.zul:116
#: ganttzk/src/main/resources/web/ganttz/zul/resourcesLoadLayout.zul:90
#: ganttzk/src/main/resources/web/ganttz/zul/plannerLayout.zul:114
msgid "Graphics"
msgstr ""
@ -221,30 +213,30 @@ msgstr ""
msgid "Set Start-Start"
msgstr ""
#: ganttzk/src/main/java/org/zkoss/ganttz/resourceload/ResourceLoadComponent.java:141
#: ganttzk/src/main/java/org/zkoss/ganttz/resourceload/ResourceLoadComponent.java:152
msgid "See resource allocation"
msgstr ""
#: ganttzk/src/main/java/org/zkoss/ganttz/Planner.java:285
#: ganttzk/src/main/java/org/zkoss/ganttz/Planner.java:281
msgid "increasing zoom"
msgstr ""
#: ganttzk/src/main/java/org/zkoss/ganttz/resourceload/ResourcesLoadPanel.java:455
#: ganttzk/src/main/java/org/zkoss/ganttz/resourceload/ResourcesLoadPanel.java:467
msgid "Show all elements"
msgstr ""
#: ganttzk/src/main/java/org/zkoss/ganttz/resourceload/ResourcesLoadPanel.java:454
#: ganttzk/src/main/java/org/zkoss/ganttz/resourceload/ResourcesLoadPanel.java:466
msgid "All"
msgstr ""
#: ganttzk/src/main/resources/web/ganttz/zul/plannerLayout.zul:39
#: ganttzk/src/main/resources/web/ganttz/zul/plannerLayout.zul:38
msgid "Refresh"
msgstr ""
#: ganttzk/src/main/java/org/zkoss/ganttz/Planner.java:554
#: ganttzk/src/main/java/org/zkoss/ganttz/Planner.java:585
msgid "Show critical path"
msgstr ""
#: ganttzk/src/main/java/org/zkoss/ganttz/Planner.java:577
#: ganttzk/src/main/java/org/zkoss/ganttz/Planner.java:614
msgid "Hide progress"
msgstr ""

View file

@ -32,7 +32,6 @@ planner = self;
<separator/>
<!-- Commands -->
<templateFinderPopup id="templateFinderPopup" acceptButtonLabel="${ganttzk_i18n:_('Create Project')}" caption="${i18n:_('Choosing Template')}" />
<button onClick="planner.invalidate()"
image="/common/img/ico_refresh.png"

View file

@ -60,7 +60,13 @@ ganttz.TaskComponent = zk.$extends(zul.Widget, {
$define :{
resourcesText : null,
labelsText : null,
tooltipText : null
tooltipText : null,
left: function() {
this.$supers('setLeft', arguments);
this._getRelatedDependencies().forEach(function(dependency) {
dependency.draw();
});
}
},
$init : function(){
this.$supers('$init', arguments);
@ -114,6 +120,14 @@ ganttz.TaskComponent = zk.$extends(zul.Widget, {
consolidateNewDependency : function(task){
zAu.send(new zk.Event(this, 'onAddDependency', {dependencyId : task.id}));
},
_getRelatedDependencies: function() {
return jq('.dependency[idtaskorig='+ this.uuid + ']')
.add('.dependency[idtaskend='+ this.uuid + ']')
.get()
.map(function(dep) {
return ganttz.DependencyComponentBase.$(dep);
});
},
_addDragDrop : function(){
var dragdropregion = this._getDragDropRegion();
var thisTaskId = this.$n().id;

View file

@ -29,12 +29,11 @@ package org.libreplan.business.calendars.entities;
*/
public enum PredefinedCalendarExceptionTypes {
HOLIDAY("HOLIDAY", CalendarExceptionTypeColor.DEFAULT, true),
SICK_LEAVE("SICK_LEAVE", CalendarExceptionTypeColor.DEFAULT, true),
LEAVE("LEAVE", CalendarExceptionTypeColor.DEFAULT, true),
STRIKE("STRIKE", CalendarExceptionTypeColor.DEFAULT, true),
RESOURCE_HOLIDAY("RESOURCE_HOLIDAY", CalendarExceptionTypeColor.YELLOW, true),
LEAVE("LEAVE", CalendarExceptionTypeColor.MAGENTA, true),
STRIKE("STRIKE", CalendarExceptionTypeColor.PURPLE, true),
BANK_HOLIDAY("BANK_HOLIDAY", CalendarExceptionTypeColor.DEFAULT, true),
WORKABLE_BANK_HOLIDAY("WORKABLE_BANK_HOLIDAY", CalendarExceptionTypeColor.DEFAULT, false);
HALF_DAY_HOLIDAY("HALF_DAY_HOLIDAY", CalendarExceptionTypeColor.ORANGE, false);
private CalendarExceptionType calendarExceptionType;

View file

@ -46,6 +46,8 @@ public interface ITypeOfWorkHoursDAO extends
boolean existsByCode(TypeOfWorkHours typeOfWorkHours);
boolean existsByName(TypeOfWorkHours typeOfWorkHours);
boolean existsTypeWithCodeInAnotherTransaction(String code);
List<TypeOfWorkHours> findActive();

View file

@ -167,4 +167,11 @@ public class TypeOfWorkHoursDAO extends IntegrationEntityDAO<TypeOfWorkHours>
}
}
@Override
public boolean existsByName(TypeOfWorkHours typeOfWorkHours) {
Criteria c = getSession().createCriteria(TypeOfWorkHours.class).add(
Restrictions.eq("name", typeOfWorkHours.getName()));
return c.uniqueResult() != null;
}
}

View file

@ -0,0 +1,32 @@
/*
* This file is part of LibrePlan
*
* Copyright (C) 2011 CafédeRed Solutions, S.L.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program 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 Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package org.libreplan.business.costcategories.entities;
import org.libreplan.business.IDataBootstrap;
/**
* Interface for {@link TypeOfWorkHoursBootstrap}.
*
* @author Ignacio Díaz Teijido <ignacio.diaz@cafedered.com>
*/
public interface ITypeOfWorkHoursBootstrap extends IDataBootstrap {
void loadRequiredData();
}

View file

@ -0,0 +1,56 @@
/*
* This file is part of LibrePlan
*
* Copyright (C) 2011 CafédeRed Solutions, S.L.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program 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 Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package org.libreplan.business.costcategories.entities;
import java.math.BigDecimal;
/**
* Defines the default {@link TypeOfWorkHours}.
*
* @author Ignacio Díaz Teijido <ignacio.diaz@cafedered.com>
*/
public enum PredefinedTypeOfWorkHours {
DEFAULT("Default", 30), OVERTIME("Overtime", 50);
private TypeOfWorkHours typeOfWorkHours;
private PredefinedTypeOfWorkHours(String name, double price) {
typeOfWorkHours = TypeOfWorkHours.create();
typeOfWorkHours.setName(name);
typeOfWorkHours.setDefaultPrice(new BigDecimal(price).setScale(2));
}
public TypeOfWorkHours getTypeOfWorkHours() {
return typeOfWorkHours;
}
public static boolean contains(TypeOfWorkHours typeOfWorkHours) {
PredefinedTypeOfWorkHours[] types = PredefinedTypeOfWorkHours.values();
for (PredefinedTypeOfWorkHours each : types) {
if (each.getTypeOfWorkHours().getName()
.equals(typeOfWorkHours.getName())) {
return true;
}
}
return false;
}
}

View file

@ -0,0 +1,62 @@
/*
* This file is part of LibrePlan
*
* Copyright (C) 2011 CafédeRed Solutions, S.L.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program 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 Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package org.libreplan.business.costcategories.entities;
import org.libreplan.business.common.daos.IEntitySequenceDAO;
import org.libreplan.business.common.entities.EntityNameEnum;
import org.libreplan.business.costcategories.daos.ITypeOfWorkHoursDAO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;
/**
* Creates the default {@link TypeOfWorkHours}.
*
* @author Ignacio Díaz Teijido <ignacio.diaz@cafedered.com>
*/
@Component
@Scope("singleton")
public class TypeOfWorkHoursBootstrap implements ITypeOfWorkHoursBootstrap {
@Autowired
private ITypeOfWorkHoursDAO typeOfWorkHoursDAO;
@Autowired
private IEntitySequenceDAO entitySequenceDAO;
@Override
@Transactional
public void loadRequiredData() {
for (PredefinedTypeOfWorkHours predefinedTypeOfWorkHours : PredefinedTypeOfWorkHours
.values()) {
TypeOfWorkHours typeOfWorkHours = predefinedTypeOfWorkHours
.getTypeOfWorkHours();
if (!typeOfWorkHoursDAO.existsByName(typeOfWorkHours)) {
typeOfWorkHours.setCodeAutogenerated(true);
typeOfWorkHours
.setCode(entitySequenceDAO
.getNextEntityCodeWithoutTransaction(EntityNameEnum.WORK_HOURS_TYPE));
typeOfWorkHoursDAO.save(typeOfWorkHours);
}
}
}
}

View file

@ -37,4 +37,6 @@ public interface ILabelDAO extends IIntegrationEntityDAO<Label> {
Label findByNameAndType(String labelName, LabelType labelType);
List<Label> findByType(LabelType labelType);
boolean existsByName(String labelName);
}

View file

@ -59,4 +59,13 @@ public class LabelDAO extends IntegrationEntityDAO<Label> implements ILabelDAO {
Restrictions.eq("type", labelType));
return ((List<Label>) c.list());
}
@Override
public boolean existsByName(String labelName) {
Criteria c = getSession().createCriteria(Label.class).add(
Restrictions.eq("name", labelName));
if (c.uniqueResult() != null)
return true;
return false;
}
}

View file

@ -0,0 +1,32 @@
/*
* This file is part of LibrePlan
*
* Copyright (C) 2011 CafédeRed Solutions, S.L.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program 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 Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package org.libreplan.business.labels.entities;
import org.libreplan.business.IDataBootstrap;
/**
* Interface for {@link LabelBootstrap}.
*
* @author Ignacio Díaz Teijido <ignacio.diaz@cafedered.com>
*/
public interface ILabelBootstrap extends IDataBootstrap {
void loadRequiredData();
}

View file

@ -0,0 +1,64 @@
/*
* This file is part of LibrePlan
*
* Copyright (C) 2011 CafédeRed Solutions, S.L.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program 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 Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package org.libreplan.business.labels.entities;
import org.libreplan.business.common.daos.IEntitySequenceDAO;
import org.libreplan.business.common.entities.EntityNameEnum;
import org.libreplan.business.labels.daos.ILabelTypeDAO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;
/**
* Creates the default {@link Label}.
*
* @author Ignacio Díaz Teijido <ignacio.diaz@cafedered.com>
*/
@Component
@Scope("singleton")
public class LabelBootstrap implements ILabelBootstrap {
@Autowired
private ILabelTypeDAO labelTypeDAO;
@Autowired
private IEntitySequenceDAO entitySequenceDAO;
@Override
@Transactional
public void loadRequiredData() {
LabelType priorityType = LabelType.create("Priority");
if (!labelTypeDAO.existsByName(priorityType)) {
priorityType.setCodeAutogenerated(true);
priorityType.setCode(entitySequenceDAO
.getNextEntityCodeWithoutTransaction(EntityNameEnum.LABEL));
for (PredefinedLabels predefinedLabel : PredefinedLabels.values()) {
Label label = predefinedLabel.getLabel();
priorityType.addLabel(label);
}
priorityType.generateLabelCodes(entitySequenceDAO
.getNumberOfDigitsCode(EntityNameEnum.LABEL));
labelTypeDAO.save(priorityType);
}
}
}

View file

@ -0,0 +1,42 @@
/*
* This file is part of LibrePlan
*
* Copyright (C) 2011 CafédeRed Solutions, S.L.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program 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 Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package org.libreplan.business.labels.entities;
/**
* Defines the default {@link Label}.
*
* @author Ignacio Díaz Teijido <ignacio.diaz@cafedered.com>
*/
public enum PredefinedLabels {
HIGH_URGENCY("High urgency"), MEDIUM_URGENCY("Medium urgency"), LOW_URGENCY(
"Low urgency");
private Label label;
private PredefinedLabels(String name) {
label = Label.create(name);
}
public Label getLabel() {
return label;
}
}

View file

@ -28,7 +28,6 @@ import java.util.List;
import org.apache.commons.lang.StringUtils;
import org.hibernate.Query;
import org.hibernate.criterion.MatchMode;
import org.hibernate.criterion.Restrictions;
import org.joda.time.LocalDate;
import org.libreplan.business.common.IAdHocTransactionService;
@ -290,9 +289,7 @@ public class OrderDAO extends IntegrationEntityDAO<Order> implements
}
Order order = (Order) getSession().createCriteria(getEntityClass())
.add(
Restrictions.ilike("infoComponent.name", name,
MatchMode.EXACT))
.add(Restrictions.eq("infoComponent.name", name).ignoreCase())
.uniqueResult();
if (order == null) {
@ -409,7 +406,7 @@ public class OrderDAO extends IntegrationEntityDAO<Order> implements
public boolean existsByNameAnotherTransaction(String name) {
try {
Order order = findByName(name);
return order.getName().equals(name);
return order != null;
} catch (InstanceNotFoundException e) {
return false;
}

View file

@ -395,6 +395,13 @@ public abstract class OrderElement extends IntegrationEntity implements
removeChildrenTaskSource(result);
if (getOnDBTaskSource() != null) {
result.add(taskSourceRemoval());
} else {
TaskSource taskSource = getTaskSource();
if (taskSource != null) {
taskSource.getTask().detachFromDependencies();
taskSource.getTask().detachFromParent();
getCurrentSchedulingData().taskSourceRemovalRequested();
}
}
}
@ -1448,4 +1455,8 @@ public abstract class OrderElement extends IntegrationEntity implements
return new ArrayList<OrderVersion>(schedulingDatasForVersion.keySet());
}
public String toString() {
return super.toString() + " :: " + getName();
}
}

View file

@ -20,21 +20,40 @@
*/
package org.libreplan.business.planner.daos;
import java.util.List;
import org.hibernate.Criteria;
import org.hibernate.criterion.Restrictions;
import org.libreplan.business.common.daos.GenericDAOHibernate;
import org.libreplan.business.common.exceptions.InstanceNotFoundException;
import org.libreplan.business.planner.entities.Dependency;
import org.springframework.beans.factory.config.BeanDefinition;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Repository;
import org.springframework.transaction.annotation.Transactional;
/**
* DAO for entity @{link Dedenpency}
*
* @author Javier Moran Rua <jmoran@igalia.com>
*
*/
@Repository
@Scope(BeanDefinition.SCOPE_SINGLETON)
public class DependencyDAO extends GenericDAOHibernate<Dependency,Long>
implements IDependencyDAO {
public class DependencyDAO extends GenericDAOHibernate<Dependency, Long>
implements IDependencyDAO {
@Override
@Transactional
public void deleteUnattachedDependencies() throws InstanceNotFoundException {
Criteria c = getSession().createCriteria(Dependency.class);
c.add(Restrictions.or(Restrictions.isNull("origin"),
Restrictions.isNull("destination")));
List<Dependency> results = c.list();
for (Dependency each : results) {
remove(each.getId());
}
}
}

View file

@ -21,6 +21,7 @@
package org.libreplan.business.planner.daos;
import org.libreplan.business.common.daos.IGenericDAO;
import org.libreplan.business.common.exceptions.InstanceNotFoundException;
import org.libreplan.business.planner.entities.Dependency;
/**
@ -28,8 +29,9 @@ import org.libreplan.business.planner.entities.Dependency;
* entity
*
* @author Javier Moran Rua <jmoran@igalia.com>
*
*/
public interface IDependencyDAO extends IGenericDAO<Dependency,Long> {
public interface IDependencyDAO extends IGenericDAO<Dependency, Long> {
void deleteUnattachedDependencies() throws InstanceNotFoundException;
}

View file

@ -1,9 +1,7 @@
/*
* This file is part of LibrePlan
*
* Copyright (C) 2009-2010 Fundación para o Fomento da Calidade Industrial e
* Desenvolvemento Tecnolóxico de Galicia
* Copyright (C) 2010-2011 Igalia, S.L.
* Copyright (C) 2011 CafédeRed Solutions, S.L.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
@ -25,18 +23,18 @@ import java.util.ArrayList;
import java.util.List;
/**
* Predefined leave criterions<br />
* @author Lorenzo Tilve <ltilve@igalia.com>
* @author Diego Pino García <dpino@igalia.com>
* Predefined categories<br />
*
* @author Ignacio Díaz Teijido <ignacio.diaz@cafedered.com>
*/
public enum LeaveCriterions {
MEDICAL_LEAVE("medicalLeave"),
PATERNITY_LEAVE("paternityLeave");
public enum CategoryCriteria {
MANAGER("Manager"), SENIOR_WORKER("Senior worker"), JUNIOR_WORKER(
"Junior worker");
public static List<String> getCriterionNames() {
ArrayList<String> result = new ArrayList<String>();
for (LeaveCriterions leaveCriterions: values()) {
result.add(leaveCriterions.criterionName);
for (CategoryCriteria category : values()) {
result.add(category.criterionName);
}
return result;
}
@ -44,10 +42,11 @@ public enum LeaveCriterions {
private final String criterionName;
public Criterion criterion() {
return Criterion.create(criterionName, CriterionType.asCriterionType(PredefinedCriterionTypes.LEAVE));
return Criterion.create(criterionName, CriterionType
.asCriterionType(PredefinedCriterionTypes.CATEGORY));
}
private LeaveCriterions(String name) {
private CategoryCriteria(String name) {
this.criterionName = name;
}
}

View file

@ -1,9 +1,7 @@
/*
* This file is part of LibrePlan
*
* Copyright (C) 2009-2010 Fundación para o Fomento da Calidade Industrial e
* Desenvolvemento Tecnolóxico de Galicia
* Copyright (C) 2010-2011 Igalia, S.L.
* Copyright (C) 2011 CafédeRed Solutions, S.L.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
@ -25,18 +23,18 @@ import java.util.ArrayList;
import java.util.List;
/**
* Predefined working relationships<br />
* @author Óscar González Fernández <ogonzalez@igalia.com>
* @author Diego Pino García <dpino@igalia.com>
* Predefined location criterions<br />
*
* @author Ignacio Díaz Teijido <ignacio.diaz@cafedered.com>
*/
public enum WorkingRelationship {
HIRED("hiredResourceWorkingRelationship"),
FIRED("firedResourceWorkingRelationship");
public enum LocationCriteria {
AFRICA("Africa"), AMERICA("America"), ASIA("Asia"), AUSTRALIA("Australia"), EUROPE(
"Europe");
public static List<String> getCriterionNames() {
ArrayList<String> result = new ArrayList<String>();
for (WorkingRelationship workingRelationship : values()) {
result.add(workingRelationship.criterionName);
for (LocationCriteria locationCriterions : values()) {
result.add(locationCriterions.criterionName);
}
return result;
}
@ -44,14 +42,11 @@ public enum WorkingRelationship {
private final String criterionName;
public Criterion criterion() {
return Criterion.create(criterionName, CriterionType.asCriterionType(PredefinedCriterionTypes.WORK_RELATIONSHIP));
return Criterion.create(criterionName, CriterionType
.asCriterionType(PredefinedCriterionTypes.LOCATION));
}
public String getCriterionName() {
return criterionName;
}
private WorkingRelationship(String name) {
private LocationCriteria(String name) {
this.criterionName = name;
}
}

View file

@ -29,51 +29,29 @@ import org.libreplan.business.common.Registry;
/**
* This class defines some criterion types known a priori<br />
*
* @author Óscar González Fernández <ogonzalez@igalia.com>
* @author Diego Pino García <dpino@igalia.com>
* @author Ignacio Díaz Teijido <ignacio.diaz@cafedered.com>
*/
public enum PredefinedCriterionTypes implements ICriterionType<Criterion> {
WORK_RELATIONSHIP(_("WORK_RELATIONSHIP"), "Relationship of the resource with the enterprise ",false, false,true, ResourceEnum.WORKER) {
@Override
public List<String> getPredefined() {
return WorkingRelationship.getCriterionNames();
}
},
LOCATION_GROUP(_("LOCATION_GROUP"), "Location where the workers work",
LOCATION(_("LOCATION"), "Worker location",
false, true, true, ResourceEnum.WORKER) {
@Override
public List<String> getPredefined() {
return Arrays.asList();
return LocationCriteria.getCriterionNames();
}
},
MACHINE_LOCATION_GROUP(_("MACHINE LOCATION_GROUP"),
"Location where there are machines", false, true, true,
ResourceEnum.MACHINE) {
CATEGORY(_("CATEGORY"), "Professional category", true, true, true,
ResourceEnum.WORKER) {
@Override
public List<String> getPredefined() {
return Arrays.asList();
return CategoryCriteria.getCriterionNames();
}
},
LEAVE(_("LEAVE"), "Leave",false, false, true, ResourceEnum.WORKER) {
@Override
public List<String> getPredefined() {
return LeaveCriterions.getCriterionNames();
}
},
TRAINING(_("TRAINING"), "Training courses and labor training",true, true, true, ResourceEnum.WORKER) {
@Override
public List<String> getPredefined() {
return Arrays.asList();
}
},
JOB(_("JOB"),"Job",true, true, true, ResourceEnum.WORKER) {
@Override
public List<String> getPredefined() {
return Arrays.asList();
}
},
CATEGORY(_("CATEGORY"),"Professional category",true, true, true, ResourceEnum.WORKER) {
SKILL(_("SKILL"), "Worker skill", true, true, true,
ResourceEnum.WORKER) {
@Override
public List<String> getPredefined() {
return Arrays.asList();

View file

@ -0,0 +1,32 @@
/*
* This file is part of LibrePlan
*
* Copyright (C) 2011 CafédeRed Solutions, S.L.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program 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 Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package org.libreplan.business.workreports.entities;
import org.libreplan.business.IDataBootstrap;
/**
* Interface for {@link WorkReportTypeBootstrap}.
*
* @author Ignacio Díaz Teijido <ignacio.diaz@cafedered.com>
*/
public interface IWorkReportTypeBootstrap extends IDataBootstrap {
void loadRequiredData();
}

View file

@ -0,0 +1,44 @@
/*
* This file is part of LibrePlan
*
* Copyright (C) 2011 CafédeRed Solutions, S.L.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program 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 Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package org.libreplan.business.workreports.entities;
/**
* Defines the default {@link WorkReportType}.
*
* @author Ignacio Díaz Teijido <ignacio.diaz@cafedered.com>
*/
public enum PredefinedWorkReportTypes {
DEFAULT("Default", false, false, false);
private WorkReportType workReportType;
private PredefinedWorkReportTypes(String name, boolean dateIsSharedByLines,
boolean resourceIsSharedInLines, boolean orderElementIsSharedInLines) {
workReportType = WorkReportType.create();
workReportType.setName(name);
workReportType.setDateIsSharedByLines(dateIsSharedByLines);
workReportType.setResourceIsSharedInLines(resourceIsSharedInLines);
workReportType
.setOrderElementIsSharedInLines(orderElementIsSharedInLines);
}
public WorkReportType getWorkReportType() {
return workReportType;
}
}

View file

@ -0,0 +1,63 @@
/*
* This file is part of LibrePlan
*
* Copyright (C) 2011 CafédeRed Solutions, S.L.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program 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 Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package org.libreplan.business.workreports.entities;
import org.libreplan.business.common.daos.IEntitySequenceDAO;
import org.libreplan.business.common.entities.EntityNameEnum;
import org.libreplan.business.workreports.daos.IWorkReportTypeDAO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;
/**
* Creates the default {@link WorkReportType}.
*
* @author Ignacio Díaz Teijido <ignacio.diaz@cafedered.com>
*/
@Component
@Scope("singleton")
public class WorkReportTypeBootstrap implements IWorkReportTypeBootstrap {
@Autowired
private IWorkReportTypeDAO workReportTypeDAO;
@Autowired
private IEntitySequenceDAO entitySequenceDAO;
@Override
@Transactional
public void loadRequiredData() {
for (PredefinedWorkReportTypes predefinedWorkReportType : PredefinedWorkReportTypes
.values()) {
WorkReportType workReportType = predefinedWorkReportType
.getWorkReportType();
if (!workReportTypeDAO
.existsOtherWorkReportTypeByName(workReportType)) {
workReportType.setCodeAutogenerated(true);
workReportType
.setCode(entitySequenceDAO
.getNextEntityCodeWithoutTransaction(EntityNameEnum.WORKREPORTTYPE));
workReportTypeDAO.save(workReportType);
}
}
}
}

View file

@ -36,13 +36,13 @@
<one-to-one name="taskSource" cascade="delete" />
<!-- Indexed on the other side -->
<set name="dependenciesWithThisOrigin" cascade="all-delete-orphan">
<set name="dependenciesWithThisOrigin" cascade="all">
<key column="origin"></key>
<one-to-many class="Dependency" />
</set>
<!-- Not indexed -->
<set name="dependenciesWithThisDestination" cascade="all-delete-orphan">
<set name="dependenciesWithThisDestination" cascade="all">
<key column="destination"></key>
<one-to-many class="Dependency" />
</set>

View file

@ -32,8 +32,8 @@ import org.junit.Test;
import org.junit.runner.RunWith;
import org.libreplan.business.resources.bootstrap.ICriterionsBootstrap;
import org.libreplan.business.resources.daos.ICriterionDAO;
import org.libreplan.business.resources.entities.CategoryCriteria;
import org.libreplan.business.resources.entities.Criterion;
import org.libreplan.business.resources.entities.WorkingRelationship;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
@ -59,8 +59,8 @@ public class CriterionsBootstrapTest {
private List<Criterion> getSomePredefinedCriterions() {
List<Criterion> result = new ArrayList<Criterion>();
for (WorkingRelationship workingRelationship : WorkingRelationship.values()) {
result.add(workingRelationship.criterion());
for (CategoryCriteria category : CategoryCriteria.values()) {
result.add(category.criterion());
}
return result;
}

View file

@ -48,10 +48,9 @@ import org.libreplan.business.resources.entities.Worker;
public class CriterionTest {
@Test
public void testCreateWithAType() {
Criterion firedCriterion = PredefinedCriterionTypes.WORK_RELATIONSHIP
.createCriterion("fired");
assertTrue(PredefinedCriterionTypes.WORK_RELATIONSHIP
.contains(firedCriterion));
Criterion managerCriterion = PredefinedCriterionTypes.CATEGORY
.createCriterion("Manager");
assertTrue(PredefinedCriterionTypes.CATEGORY.contains(managerCriterion));
}
@Test
@ -190,9 +189,9 @@ public class CriterionTest {
@Test
public void testCanBeRelatedTo() {
assertTrue(PredefinedCriterionTypes.LOCATION_GROUP
assertTrue(PredefinedCriterionTypes.LOCATION
.criterionCanBeRelatedTo(Worker.class));
assertTrue(PredefinedCriterionTypes.WORK_RELATIONSHIP
assertTrue(PredefinedCriterionTypes.CATEGORY
.criterionCanBeRelatedTo(Worker.class));
}

View file

@ -79,7 +79,7 @@ public abstract class TemplateFinder<T extends OrderElementTemplate> extends
}
protected String extractStringFor(T template) {
return template.getCode() + " :: " + template.getName();
return template.getName() + " (" + template.getCode() + ")";
}
@Override

View file

@ -20,8 +20,6 @@
*/
package org.libreplan.web.materials;
import static org.libreplan.web.I18nHelper._;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
@ -96,8 +94,8 @@ public class UnitTypeModel extends IntegrationEntityModel implements
try {
return unitTypeDAO.find(unitType.getId());
} catch (InstanceNotFoundException e) {
LOG.error(_("It was not possible load entity. Not found. Id: " +
unitType.getId()), e);
LOG.error("It was not possible load entity. Not found. Id: "
+ unitType.getId(), e);
throw new RuntimeException(e);
}
}

View file

@ -341,7 +341,7 @@ public class ManageOrderElementAdvancesController extends
return _("Progress measurements");
}
return _("Progress measurements: ") + infoAdvanceAssignment;
return _("Progress measurements") + ": " + infoAdvanceAssignment;
}
public boolean isReadOnlyAdvanceMeasurements() {

View file

@ -53,8 +53,6 @@ import org.libreplan.web.common.Util;
import org.libreplan.web.common.components.bandboxsearch.BandboxMultipleSearch;
import org.libreplan.web.common.components.bandboxsearch.BandboxSearch;
import org.libreplan.web.common.components.finders.FilterPair;
import org.libreplan.web.orders.assigntemplates.TemplateFinderPopup;
import org.libreplan.web.orders.assigntemplates.TemplateFinderPopup.IOnResult;
import org.libreplan.web.orders.criterionrequirements.AssignedCriterionRequirementToOrderElementController;
import org.libreplan.web.orders.labels.AssignedLabelsToOrderElementController;
import org.libreplan.web.orders.labels.LabelsAssignmentToOrderElementComponent;
@ -105,7 +103,9 @@ import org.zkoss.zul.api.Window;
/**
* Controller for CRUD actions <br />
*
* @author Óscar González Fernández <ogonzalez@igalia.com>
* @author Lorenzo Tilve Álvaro <ltilve@igalia.com>
*/
@org.springframework.stereotype.Component
@Scope(BeanDefinition.SCOPE_PROTOTYPE)
@ -164,19 +164,6 @@ public class OrderCRUDController extends GenericForwardComposer {
private Component messagesContainer;
private TemplateFinderPopup templateFinderPopup;
public void createOrderFromTemplate() {
templateFinderPopup.openForOrderCreation(createOrderFromTemplateButton,
"after_start", new IOnResult<OrderTemplate>() {
@Override
public void found(OrderTemplate template) {
showCreateFormFromTemplate(template);
}
});
}
public void showCreateFormFromTemplate(OrderTemplate template) {
showOrderElementFilter();
showCreateButtons(false);
@ -205,7 +192,6 @@ public class OrderCRUDController extends GenericForwardComposer {
private Vbox orderElementFilter;
private Button createOrderButton;
private Button createOrderFromTemplateButton;
private Button saveOrderAndContinueButton;
private Button cancelEditionButton;
@ -259,28 +245,7 @@ public class OrderCRUDController extends GenericForwardComposer {
private void setupGlobalButtons() {
Hbox perspectiveButtonsInsertionPoint = (Hbox) page
.getFellow("perspectiveButtonsInsertionPoint");
perspectiveButtonsInsertionPoint.getChildren().clear();
createOrderButton.setParent(perspectiveButtonsInsertionPoint);
createOrderButton.addEventListener(Events.ON_CLICK,
new EventListener() {
@Override
public void onEvent(Event event) throws Exception {
goToCreateForm();
}
});
createOrderFromTemplateButton
.setParent(perspectiveButtonsInsertionPoint);
createOrderFromTemplateButton.addEventListener(Events.ON_CLICK,
new EventListener() {
@Override
public void onEvent(Event event) throws Exception {
createOrderFromTemplate();
}
});
saveOrderAndContinueButton.setParent(perspectiveButtonsInsertionPoint);
saveOrderAndContinueButton.addEventListener(Events.ON_CLICK,
new EventListener() {
@Override
@ -289,7 +254,6 @@ public class OrderCRUDController extends GenericForwardComposer {
}
});
cancelEditionButton.setParent(perspectiveButtonsInsertionPoint);
cancelEditionButton.addEventListener(Events.ON_CLICK,
new EventListener() {
@Override
@ -944,6 +908,10 @@ public class OrderCRUDController extends GenericForwardComposer {
orderTemplates.goToCreateTemplateFrom(order);
}
public void createFromTemplate(OrderTemplate template) {
orderModel.prepareCreationFrom(template, getDesktop());
}
private Runnable onUp;
public void goToEditForm(Order order) {
@ -1088,18 +1056,14 @@ public class OrderCRUDController extends GenericForwardComposer {
orderModel.prepareForCreate(desktop);
}
private void editNewCreatedOrder() {
public void editNewCreatedOrder(Window detailsWindow) {
showOrderElementFilter();
hideCreateButtons();
prepareEditWindow();
showEditWindow(_("Create project"));
}
public void editNewCreatedOrder(Window detailsWindow) {
editNewCreatedOrder();
// close project details window
detailsWindow.setVisible(false);
setupOrderAuthorizationController();
detailsWindow.getAttributes();
saveAndContinue(false);
}
@ -1416,10 +1380,24 @@ public class OrderCRUDController extends GenericForwardComposer {
}
public void showCreateButtons(boolean showCreate) {
createOrderButton.setVisible(showCreate);
createOrderFromTemplateButton.setVisible(showCreate);
saveOrderAndContinueButton.setVisible(!showCreate);
cancelEditionButton.setVisible(!showCreate);
if (!showCreate) {
Hbox perspectiveButtonsInsertionPoint = (Hbox) page
.getFellow("perspectiveButtonsInsertionPoint");
perspectiveButtonsInsertionPoint.getChildren().clear();
saveOrderAndContinueButton
.setParent(perspectiveButtonsInsertionPoint);
cancelEditionButton.setParent(perspectiveButtonsInsertionPoint);
}
if (createOrderButton != null) {
createOrderButton.setVisible(showCreate);
}
if (saveOrderAndContinueButton != null) {
saveOrderAndContinueButton.setVisible(!showCreate);
}
if (cancelEditionButton != null) {
cancelEditionButton.setVisible(!showCreate);
}
}
public void highLight(final OrderElement orderElement) {
@ -1455,7 +1433,6 @@ public class OrderCRUDController extends GenericForwardComposer {
private void checkCreationPermissions() {
if (!SecurityUtils.isUserInRole(UserRole.ROLE_CREATE_ORDER)) {
createOrderButton.setDisabled(true);
createOrderFromTemplateButton.setDisabled(true);
}
}

View file

@ -2,7 +2,8 @@
* This file is part of LibrePlan
*
* Copyright (C) 2009-2010 Fundación para o Fomento da Calidade Industrial e
* Desenvolvemento Tecnolóxico de Galicia
* Desenvolvemento Tecnolóxico de Galicia
* Copyright (C) 2011 Igalia, S.L.
*
* This program is free software: you can redistribute it and/or modify it under
* the terms of the GNU Affero General Public License as published by the Free
@ -396,9 +397,20 @@ public class OrderModel extends IntegrationEntityModel implements IOrderModel {
@Transactional(readOnly = true)
public void prepareCreationFrom(OrderTemplate template, Desktop desktop) {
loadNeededDataForConversation();
Order order = createOrderFrom((OrderTemplate) templateDAO
Order newOrder = createOrderFrom((OrderTemplate) templateDAO
.findExistingEntity(template.getId()));
planningState = planningStateCreator.createOn(desktop, order);
newOrder.setName(getOrder().getName());
if (!getOrder().isCodeAutogenerated()) {
newOrder.setCodeAutogenerated();
newOrder.setCode(getOrder().getCode());
}
if (getOrder().getDeadline() != null) {
newOrder.setDeadline(getOrder().getDeadline());
}
newOrder.setCustomer(((Order) getOrder()).getCustomer());
newOrder.setCalendar(getCalendar());
planningState = planningStateCreator.createOn(desktop, newOrder);
forceLoadAdvanceAssignmentsAndMeasurements(planningState.getOrder());
initializeOrder();
}
@ -455,7 +467,7 @@ public class OrderModel extends IntegrationEntityModel implements IOrderModel {
this.planningState.getSaveCommand().save(beforeSaveActions, null);
}
}
private void reattachCalendar() {
if (planningState.getOrder().getCalendar() == null) {
return;

View file

@ -2,6 +2,8 @@
* This file is part of LibrePlan
*
* Copyright (C) 2010-2011 Wireless Galicia, S.L.
* Copyright (C) 2011 Igalia, S.L.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
@ -27,14 +29,18 @@ import java.util.List;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.joda.time.LocalDate;
import org.libreplan.business.calendars.entities.BaseCalendar;
import org.libreplan.business.externalcompanies.entities.ExternalCompany;
import org.libreplan.business.orders.daos.IOrderDAO;
import org.libreplan.business.orders.entities.Order;
import org.libreplan.business.templates.entities.OrderTemplate;
import org.libreplan.web.common.ConstraintChecker;
import org.libreplan.web.common.Util;
import org.libreplan.web.common.components.bandboxsearch.BandboxSearch;
import org.libreplan.web.planner.consolidations.AdvanceConsolidationController;
import org.libreplan.web.planner.tabs.MultipleTabsPlannerController;
import org.springframework.beans.factory.annotation.Autowired;
import org.zkoss.zk.ui.Component;
import org.zkoss.zk.ui.Executions;
import org.zkoss.zk.ui.SuspendNotAllowedException;
@ -53,7 +59,9 @@ import org.zkoss.zul.Window;
/**
* Controller for the creation of an {@link order} with its principal
* properties.
*
* @author Susana Montes Pedreira <smontes@wirelessgailicia.com>
* @author Lorenzo Tilve Álvaro <ltilve@igalia.com>
*/
public class ProjectDetailsController extends GenericForwardComposer {
@ -67,8 +75,6 @@ public class ProjectDetailsController extends GenericForwardComposer {
private BaseCalendar defaultCalendar;
private String oldCode;
private boolean isCodeAutogeneratedInit;
private MultipleTabsPlannerController tabs;
@ -79,10 +85,15 @@ public class ProjectDetailsController extends GenericForwardComposer {
private BandboxSearch bdExternalCompanies;
private BandboxSearch bdProjectTemplate;
private Textbox txtName;
private Datebox deadline;
@Autowired
private IOrderDAO orderDAO;
public ProjectDetailsController() {
Window window = (Window) Executions.createComponents(
"/orders/_projectDetails.zul", null,
@ -131,6 +142,11 @@ public class ProjectDetailsController extends GenericForwardComposer {
if (tabs != null) {
tabs.goToOrdersList();
}
if (bdProjectTemplate.getSelectedElement() != null) {
OrderTemplate template = (OrderTemplate) bdProjectTemplate
.getSelectedElement();
orderController.createFromTemplate(template);
}
orderController.editNewCreatedOrder(window);
}
}
@ -141,6 +157,10 @@ public class ProjectDetailsController extends GenericForwardComposer {
showWrongValue();
return false;
}
if (orderDAO.existsByNameAnotherTransaction(txtName.getValue())) {
showWrongName();
return false;
}
return true;
}
@ -148,6 +168,11 @@ public class ProjectDetailsController extends GenericForwardComposer {
throw new WrongValueException(initDate, _("cannot be null or empty"));
}
private void showWrongName() {
throw new WrongValueException(txtName,
_("project name already being used"));
}
private void close() {
window.setVisible(false);
}
@ -252,12 +277,23 @@ public class ProjectDetailsController extends GenericForwardComposer {
bdExternalCompanies.close();
}
});
txtName.addEventListener(Events.ON_OK, new EventListener() {
@Override
public void onEvent(Event event) {
accept();
}
});
bdProjectTemplate.setListboxEventListener(Events.ON_SELECT,
new EventListener() {
@Override
public void onEvent(Event event) {
calculateDeadlineDate();
}
});
}
public void calculateDeadlineDate() {
if ((bdProjectTemplate.getSelectedElement() == null)
|| (((OrderTemplate) bdProjectTemplate.getSelectedElement())
.getDeadlineAsDaysFromBeginning() == null)
|| (initDate.getValue() == null)) {
return;
}
int days = ((OrderTemplate) bdProjectTemplate.getSelectedElement()).getDeadlineAsDaysFromBeginning();
deadline.setValue( new LocalDate(initDate.getValue()).plusDays(days).toDateTimeAtStartOfDay().toDate());
}
}

View file

@ -638,10 +638,21 @@ public class TaskElementAdapter {
if (daysBetween == 0) {
return calculateLimitDateWhenDaysBetweenAreZero(advancePercentage);
}
int daysAdvance = advancePercentage.multiply(
new BigDecimal(daysBetween)).intValue();
return GanttDate.createFrom(taskElement.getIntraDayStartDate()
.getDate().plusDays(daysAdvance));
BigDecimal daysAdvance = advancePercentage
.multiply(new BigDecimal(daysBetween));
int days = daysAdvance.intValue();
LocalDate advanceDate = taskElement.getStartAsLocalDate()
.plusDays(days);
EffortDuration capacity = calendar.getCapacityOn(PartialDay
.wholeDay(advanceDate));
int seconds = daysAdvance.subtract(new BigDecimal(days))
.multiply(new BigDecimal(capacity.getSeconds()))
.intValue();
return toGantt(IntraDayDate.create(advanceDate,
EffortDuration.seconds(seconds)));
}
private GanttDate calculateLimitDateWhenDaysBetweenAreZero(

View file

@ -61,13 +61,9 @@ import org.libreplan.business.planner.entities.TaskGroup;
import org.libreplan.business.planner.entities.TaskMilestone;
import org.libreplan.business.scenarios.IScenarioManager;
import org.libreplan.business.scenarios.entities.Scenario;
import org.libreplan.business.templates.entities.OrderTemplate;
import org.libreplan.business.users.daos.IUserDAO;
import org.libreplan.business.users.entities.User;
import org.libreplan.business.users.entities.UserRole;
import org.libreplan.business.workreports.entities.WorkReportLine;
import org.libreplan.web.orders.assigntemplates.TemplateFinderPopup;
import org.libreplan.web.orders.assigntemplates.TemplateFinderPopup.IOnResult;
import org.libreplan.web.planner.TaskElementAdapter;
import org.libreplan.web.planner.chart.Chart;
import org.libreplan.web.planner.chart.EarnedValueChartFiller;
@ -92,9 +88,7 @@ import org.zkoss.ganttz.Planner;
import org.zkoss.ganttz.adapters.IStructureNavigator;
import org.zkoss.ganttz.adapters.PlannerConfiguration;
import org.zkoss.ganttz.adapters.PlannerConfiguration.IPrintAction;
import org.zkoss.ganttz.extensions.ICommand;
import org.zkoss.ganttz.extensions.ICommandOnTask;
import org.zkoss.ganttz.extensions.IContext;
import org.zkoss.ganttz.timetracker.TimeTracker;
import org.zkoss.ganttz.timetracker.zoom.IZoomLevelChangedListener;
import org.zkoss.ganttz.timetracker.zoom.ZoomLevel;
@ -108,7 +102,6 @@ import org.zkoss.zk.ui.event.Event;
import org.zkoss.zk.ui.event.EventListener;
import org.zkoss.zk.ui.event.Events;
import org.zkoss.zk.ui.util.Clients;
import org.zkoss.zul.Button;
import org.zkoss.zul.Checkbox;
import org.zkoss.zul.Datebox;
import org.zkoss.zul.Div;
@ -126,6 +119,7 @@ import org.zkoss.zul.Vbox;
* Model for company planning view.
*
* @author Manuel Rego Casasnovas <mrego@igalia.com>
* @author Lorenzo Tilve Álvaro <ltilve@igalia.com>
*/
@Component
@Scope(BeanDefinition.SCOPE_PROTOTYPE)
@ -231,63 +225,6 @@ public class CompanyPlanningModel implements ICompanyPlanningModel {
configuration.setDoubleClickCommand(doubleClickCommand);
}
if (SecurityUtils.isUserInRole(UserRole.ROLE_CREATE_ORDER)) {
ICommand<TaskElement> createNewOrderCommand = new ICommand<TaskElement>() {
@Override
public String getName() {
return _("Create new project");
}
@Override
public String getImage() {
return "/common/img/ico_add.png";
}
@Override
public void doAction(IContext<TaskElement> context) {
tabs.goToCreateForm();
}
};
configuration.addGlobalCommand(createNewOrderCommand);
ICommand<TaskElement> createNewOrderFromTemplateCommand = new ICommand<TaskElement>() {
@Override
public String getName() {
return _("Create new project from template");
}
@Override
public String getImage() {
return "/common/img/ico_copy.png";
}
@Override
public void doAction(IContext<TaskElement> context) {
TemplateFinderPopup templateFinderPopup = (TemplateFinderPopup) planner
.getFellowIfAny("templateFinderPopup");
Button createOrderFromTemplateButton = planner
.findCommandComponent(getName());
if (templateFinderPopup != null) {
templateFinderPopup.openForOrderCreation(
createOrderFromTemplateButton, "after_start",
new IOnResult<OrderTemplate>() {
@Override
public void found(OrderTemplate template) {
goToCreateOtherOrderFromTemplate(template);
}
});
}
}
};
configuration.addGlobalCommand(createNewOrderFromTemplateCommand);
}
addAdditionalCommands(additional, configuration);
addPrintSupport(configuration);
disableSomeFeatures(configuration);
@ -480,7 +417,7 @@ public class CompanyPlanningModel implements ICompanyPlanningModel {
vbox.setPack("center");
Hbox dateHbox = new Hbox();
dateHbox.appendChild(new Label(_("Select date:")));
dateHbox.appendChild(new Label(_("Select date")));
LocalDate initialDate = earnedValueChartFiller
.initialDateForIndicatorValues();
@ -935,10 +872,6 @@ public class CompanyPlanningModel implements ICompanyPlanningModel {
}
}
public void goToCreateOtherOrderFromTemplate(OrderTemplate template) {
tabs.goToCreateotherOrderFromTemplate(template);
}
@Transactional(readOnly=true)
public ProgressType getProgressTypeFromConfiguration() {
return configurationDAO.getConfiguration().getProgressType();

View file

@ -49,8 +49,6 @@ public interface ICompanyPlanningModel {
LocalDate getFilterFinishDate();
void goToCreateOtherOrderFromTemplate(OrderTemplate template);
ProgressType getProgressTypeFromConfiguration();
}

View file

@ -107,7 +107,7 @@ public class AdvanceConsolidationController extends GenericForwardComposer {
return _("Progress measurements");
}
return _("Progress measurements: ") + infoAdvanceAssignment;
return _("Progress measurements") + ": " + infoAdvanceAssignment;
}
public List<AdvanceConsolidationDTO> getAdvances() {

View file

@ -495,7 +495,7 @@ public class OrderPlanningModel implements IOrderPlanningModel {
vbox.setPack("center");
Hbox dateHbox = new Hbox();
dateHbox.appendChild(new Label(_("Select date:")));
dateHbox.appendChild(new Label(_("Select date")));
LocalDate initialDateForIndicatorValues = earnedValueChartFiller.initialDateForIndicatorValues();
Datebox datebox = new Datebox(initialDateForIndicatorValues
@ -1020,8 +1020,8 @@ public class OrderPlanningModel implements IOrderPlanningModel {
try {
Messagebox
.show("Are you sure to want to leave? Unsaved changes will be lost.",
"Confirm exit dialog", Messagebox.OK
.show(_("Unsaved changes will be lost. Are you sure?"),
_("Confirm exit dialog"), Messagebox.OK
| Messagebox.CANCEL,
Messagebox.QUESTION,
new org.zkoss.zk.ui.event.EventListener() {

View file

@ -21,6 +21,7 @@ package org.libreplan.web.planner.order;
import static org.libreplan.business.planner.entities.TaskElement.justTasks;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.HashSet;
@ -94,6 +95,7 @@ import org.zkoss.zk.ui.Desktop;
* yet, it creates and initializes a new PlanningState.
*
* @author Óscar González Fernández <ogonzalez@igalia.com>
* @author Lorenzo Tilve Álvaro <ltilve@igalia.com>
*/
@Component
@Scope(BeanDefinition.SCOPE_SINGLETON)
@ -259,6 +261,7 @@ public class PlanningStateCreator {
forceLoadOf(rootTask);
forceLoadDayAssignments(orderReloaded.getResources());
forceLoadOfDepedenciesCollections(rootTask);
forceLoadOfLabels(Arrays.asList((TaskElement) rootTask));
}
if (orderReloaded.getCalendar() != null) {
@ -270,7 +273,6 @@ public class PlanningStateCreator {
currentScenario);
forceLoadOfWorkingHours(result.getInitial());
forceLoadOfLabels(result.getInitial());
return result;
}
@ -694,6 +696,9 @@ public class PlanningStateCreator {
}
private List<OrderAuthorization> loadOrderAuthorizations() {
if (order.isNewObject()) {
return new ArrayList<OrderAuthorization>();
}
List<OrderAuthorization> orderAuthorizations = orderAuthorizationDAO
.listByOrder(order);
for (OrderAuthorization each : orderAuthorizations) {

View file

@ -57,6 +57,7 @@ import org.libreplan.business.orders.entities.Order;
import org.libreplan.business.orders.entities.OrderElement;
import org.libreplan.business.orders.entities.OrderLineGroup;
import org.libreplan.business.planner.daos.IConsolidationDAO;
import org.libreplan.business.planner.daos.IDependencyDAO;
import org.libreplan.business.planner.daos.ISubcontractedTaskDataDAO;
import org.libreplan.business.planner.daos.ITaskElementDAO;
import org.libreplan.business.planner.daos.ITaskSourceDAO;
@ -125,7 +126,7 @@ public class SaveCommandBuilder {
"/planner/index.zul;company_scheduling", ISaveCommand.class,
result);
}
public static void dontPoseAsTransientAndChildrenObjects(
Collection<? extends ResourceAllocation<?>> resourceAllocations) {
for (ResourceAllocation<?> each : resourceAllocations) {
@ -134,8 +135,7 @@ public class SaveCommandBuilder {
for (DayAssignment eachAssignment : each.getAssignments()) {
eachAssignment.dontPoseAsTransientObjectAnymore();
}
for (DerivedAllocation eachDerived : each
.getDerivedAllocations()) {
for (DerivedAllocation eachDerived : each.getDerivedAllocations()) {
eachDerived.dontPoseAsTransientObjectAnymore();
Collection<DerivedDayAssignmentsContainer> containers = eachDerived
.getContainers();
@ -151,8 +151,7 @@ public class SaveCommandBuilder {
}
}
private static void dontPoseAsTransient(
LimitingResourceQueueElement element) {
private static void dontPoseAsTransient(LimitingResourceQueueElement element) {
if (element != null) {
for (LimitingResourceQueueDependency d : element
.getDependenciesAsOrigin()) {
@ -199,6 +198,9 @@ public class SaveCommandBuilder {
@Autowired
private IOrderAuthorizationDAO orderAuthorizationDAO;
@Autowired
private IDependencyDAO dependencyDAO;
private class SaveCommand implements ISaveCommand {
private PlanningState state;
@ -209,7 +211,7 @@ public class SaveCommandBuilder {
private IAdapterToTaskFundamentalProperties<TaskElement> adapter;
private List<IAfterSaveListener> listeners = new ArrayList<IAfterSaveListener>();
private final List<IAfterSaveListener> listeners = new ArrayList<IAfterSaveListener>();
public SaveCommand(PlanningState planningState,
PlannerConfiguration<TaskElement> configuration) {
@ -270,7 +272,7 @@ public class SaveCommandBuilder {
}
doTheSaving();
return null;
}
}
});
dontPoseAsTransientObjectAnymore(state.getOrder());
state.getScenarioInfo().afterCommit();
@ -286,7 +288,8 @@ public class SaveCommandBuilder {
try {
String message = validationException.getMessage();
for (InvalidValue invalidValue : validationException.getInvalidValues()) {
for (InvalidValue invalidValue : validationException
.getInvalidValues()) {
message += "\n" + invalidValue.getPropertyName() + ": "
+ invalidValue.getMessage();
}
@ -329,6 +332,7 @@ public class SaveCommandBuilder {
checkConstraintOrderUniqueCode(order);
checkConstraintHoursGroupUniqueCode(order);
state.synchronizeTrees();
TaskGroup rootTask = state.getRootTask();
if (rootTask != null) {
// This reattachment is needed to ensure that the root task in
@ -339,8 +343,10 @@ public class SaveCommandBuilder {
taskElementDAO.reattach(rootTask);
}
orderDAO.save(order);
saveDerivedScenarios(order);
deleteOrderElementWithoutParent(order);
deleteUnboundedDependencies();
updateTasksRelatedData();
removeTasksToRemove();
@ -492,6 +498,14 @@ public class SaveCommandBuilder {
}
}
private void deleteUnboundedDependencies() {
try {
dependencyDAO.deleteUnattachedDependencies();
} catch (InstanceNotFoundException e) {
throw new RuntimeException(e);
}
}
private void tryToRemove(OrderElement orderElement) {
// checking no work reports for that orderElement
if (orderElementDAO
@ -843,7 +857,6 @@ public class SaveCommandBuilder {
}
}
private void dontPoseAsTransientObjectAnymore(OrderElement orderElement) {
orderElement.dontPoseAsTransientObjectAnymore();
dontPoseAsTransientObjectAnymore(orderElement.getOrderVersions());

View file

@ -28,7 +28,9 @@ import org.libreplan.web.common.entrypoints.EntryPoints;
/**
* Entry points for {@link MultipleTabsPlannerController} <br />
*
* @author Óscar González Fernández <ogonzalez@igalia.com>
* @author Lorenzo Tilve Álvaro <ltilve@igalia.com>
*/
@EntryPoints(page = "/planner/index.zul", registerAs = "globalView")
public interface IGlobalViewEntryPoints {
@ -63,6 +65,4 @@ public interface IGlobalViewEntryPoints {
@EntryPoint("order_advanced_allocation")
void goToAdvancedAllocation(Order order);
@EntryPoint("create_order_from_template")
void goToCreateotherOrderFromTemplate(OrderTemplate template);
}

View file

@ -33,11 +33,14 @@ import org.libreplan.business.orders.entities.OrderElement;
import org.libreplan.business.planner.entities.TaskElement;
import org.libreplan.business.resources.daos.IResourcesSearcher;
import org.libreplan.business.templates.entities.OrderTemplate;
import org.libreplan.business.users.entities.UserRole;
import org.libreplan.web.common.entrypoints.EntryPointsHandler;
import org.libreplan.web.common.entrypoints.URLHandlerRegistry;
import org.libreplan.web.limitingresources.LimitingResourcesController;
import org.libreplan.web.montecarlo.MonteCarloController;
import org.libreplan.web.orders.OrderCRUDController;
import org.libreplan.web.orders.assigntemplates.TemplateFinderPopup;
import org.libreplan.web.orders.assigntemplates.TemplateFinderPopup.IOnResult;
import org.libreplan.web.planner.allocation.AdvancedAllocationController.IBack;
import org.libreplan.web.planner.company.CompanyPlanningController;
import org.libreplan.web.planner.order.IOrderPlanningGate;
@ -45,6 +48,7 @@ import org.libreplan.web.planner.order.OrderPlanningController;
import org.libreplan.web.planner.order.PlanningStateCreator;
import org.libreplan.web.planner.tabs.Mode.ModeTypeChangedListener;
import org.libreplan.web.resourceload.ResourceLoadController;
import org.libreplan.web.security.SecurityUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.config.BeanDefinition;
import org.springframework.context.annotation.Scope;
@ -66,10 +70,13 @@ import org.zkoss.zk.ui.event.Event;
import org.zkoss.zk.ui.event.EventListener;
import org.zkoss.zk.ui.event.Events;
import org.zkoss.zk.ui.util.Composer;
import org.zkoss.zul.Button;
/**
* Creates and handles several tabs
*
* @author Óscar González Fernández <ogonzalez@igalia.com>
* @author Lorenzo Tilve Álvaro <ltilve@igalia.com>
*/
@Component
@Scope(BeanDefinition.SCOPE_PROTOTYPE)
@ -365,6 +372,19 @@ public class MultipleTabsPlannerController implements Composer,
planningTab.toggleToFeedback();
}
handler.registerBookmarkListener(this, comp.getPage());
if (SecurityUtils.isUserInRole(UserRole.ROLE_CREATE_ORDER)) {
org.zkoss.zk.ui.Component createOrderButton = comp.getPage().getFellow(
"createOrderButton");
createOrderButton.addEventListener(Events.ON_CLICK,
new EventListener() {
@Override
public void onEvent(Event event) throws Exception {
goToCreateForm();
}
});
}
}
private TabsRegistry getTabsRegistry() {
@ -432,12 +452,6 @@ public class MultipleTabsPlannerController implements Composer,
getTabsRegistry().show(advancedAllocationTab, changeModeTo(order));
}
@Override
public void goToCreateotherOrderFromTemplate(OrderTemplate template) {
getTabsRegistry().show(ordersTab);
orderCRUDController.showCreateFormFromTemplate(template);
}
private IBeforeShowAction changeModeTo(final Order order) {
return new IBeforeShowAction() {
@Override

View file

@ -156,6 +156,7 @@ public class OrderCostsPerResourceModel implements IOrderCostsPerResourceModel {
private void loadAllOrders() {
this.allOrders = orderDAO.getOrders();
Collections.sort(this.allOrders);
}
@Override

View file

@ -23,6 +23,7 @@ package org.libreplan.web.reports;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.Date;
import java.util.List;
@ -106,6 +107,7 @@ public class TimeLineRequiredMaterialModel implements
private void loadAllOrders() {
allOrders = orderDAO.getOrdersByScenario(scenarioManager.getCurrent());
Collections.sort(allOrders);
}
@Override

View file

@ -22,6 +22,7 @@
package org.libreplan.web.reports;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Date;
import java.util.HashSet;
import java.util.Iterator;
@ -105,6 +106,7 @@ public class WorkingProgressPerTaskModel implements IWorkingProgressPerTaskModel
public List<Order> getOrders() {
List<Order> result = orderDAO.getOrdersByScenario(scenarioManager
.getCurrent());
Collections.sort(result);
return result;
}

View file

@ -211,9 +211,7 @@ public class CriterionAdminController extends BaseCRUDController<CriterionType>
try {
setupCriterionTreeController(editWindow);
} catch (Exception e) {
LOG.error(
_("Error setting up creationg form for Criterion Type with id}"),
e);
LOG.error("Error setting up creationg form for Criterion Type", e);
}
setResourceComboboxValue((Combobox) editWindow
.getFellowIfAny("resourceCombobox"));
@ -226,8 +224,8 @@ public class CriterionAdminController extends BaseCRUDController<CriterionType>
setupCriterionTreeController(editWindow);
} catch (Exception e) {
LOG.error(
_("Error setting up edition form for Criterion Type with id: {0}",
criterionType.getId()), e);
"Error setting up edition form for Criterion Type with id: "
+ criterionType.getId(), e);
}
setResourceComboboxValue((Combobox) editWindow
.getFellowIfAny("resourceCombobox"));

View file

@ -92,8 +92,8 @@ public class WorkerModel extends IntegrationEntityModel implements IWorkerModel
private IBaseCalendarDAO baseCalendarDAO;
private final ICriterionType<?>[] laboralRelatedTypes = {
PredefinedCriterionTypes.LEAVE,
PredefinedCriterionTypes.WORK_RELATIONSHIP };
PredefinedCriterionTypes.LOCATION,
PredefinedCriterionTypes.CATEGORY, PredefinedCriterionTypes.SKILL };
private Worker worker;
@ -214,8 +214,7 @@ public class WorkerModel extends IntegrationEntityModel implements IWorkerModel
setDefaultCode();
}
localizationsAssigner = new MultipleCriterionActiveAssigner(
criterionDAO, worker,
PredefinedCriterionTypes.LOCATION_GROUP);
criterionDAO, worker, PredefinedCriterionTypes.LOCATION);
}
@Override
@ -228,7 +227,7 @@ public class WorkerModel extends IntegrationEntityModel implements IWorkerModel
forceLoadCalendar(this.worker);
localizationsAssigner = new MultipleCriterionActiveAssigner(
criterionDAO, this.worker,
PredefinedCriterionTypes.LOCATION_GROUP);
PredefinedCriterionTypes.LOCATION);
initOldCodes();
} catch (InstanceNotFoundException e) {
throw new RuntimeException(e);

View file

@ -290,7 +290,9 @@ public abstract class EntitiesTree<T extends ITreeNode<T>> {
return true;
}
for (T each : children) {
return find(child, getChildren(each));
if (find(child, getChildren(each))) {
return true;
}
}
return false;
}

View file

@ -33,7 +33,9 @@ import org.zkoss.zul.Treeitem;
/**
* macro component for order elements tree and similar pages<br />
*
* @author Óscar González Fernández <ogonzalez@igalia.com>
* @author Lorenzo Tilve Álvaro <ltilve@igalia.com>
*/
public abstract class TreeComponent extends HtmlMacroComponent {
@ -71,6 +73,10 @@ public abstract class TreeComponent extends HtmlMacroComponent {
return tooltip;
}
public String getHflex() {
return cssClass.equals("name") ? "1" : "min";
}
public abstract <T extends ITreeNode<T>> void doCell(
TreeController<T>.Renderer renderer,
Treeitem item, T currentElement);
@ -95,8 +101,8 @@ public abstract class TreeComponent extends HtmlMacroComponent {
renderer.addDescriptionCell(currentElement);
}
};
protected final Column operationsColumn = new Column(_("Operations"),
"operations") {
protected final Column operationsColumn = new Column(_("Op."),
"operations", _("Operations")) {
@Override
public <T extends ITreeNode<T>> void doCell(

View file

@ -72,6 +72,14 @@ import org.zkoss.zul.TreeitemRenderer;
import org.zkoss.zul.Treerow;
import org.zkoss.zul.impl.api.InputElement;
/**
* Tree controller for project WBS structures
*
* @author Óscar González Fernández <ogonzalez@igalia.com>
* @author Lorenzo Tilve Álvaro <ltilve@igalia.com>
* @author Manuel Rego Casasnovas <mrego@igalia.com>
* @author Diego Pino García <dpino@igalia.com>
*/
public abstract class TreeController<T extends ITreeNode<T>> extends
GenericForwardComposer {
@ -647,7 +655,6 @@ public abstract class TreeController<T extends ITreeNode<T>> extends
private Treerow getTreeRowWithoutChildrenFor(final Treeitem item) {
Treerow result = createOrRetrieveFor(item);
// Attach treecells to treerow
result.setDraggable("true");
result.setDroppable("true");
result.getChildren().clear();
return result;
@ -680,7 +687,7 @@ public abstract class TreeController<T extends ITreeNode<T>> extends
public void onEvent(org.zkoss.zk.ui.event.Event event) {
DropEvent dropEvent = (DropEvent) event;
move((Component) dropEvent.getTarget(),
(Component) dropEvent.getDragged());
(Component) dropEvent.getDragged().getParent());
}
});
}
@ -719,6 +726,7 @@ public abstract class TreeController<T extends ITreeNode<T>> extends
}
});
schedulingStateToggler.afterCompose();
cell.setDraggable("true");
}
protected abstract SchedulingState getSchedulingStateFrom(

View file

@ -27,6 +27,7 @@ import java.util.ConcurrentModificationException;
import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.regex.Pattern;
import org.apache.commons.logging.LogFactory;
import org.hibernate.validator.InvalidValue;
@ -45,6 +46,7 @@ import org.libreplan.business.workreports.entities.WorkReportLine;
import org.libreplan.business.workreports.entities.WorkReportType;
import org.libreplan.business.workreports.valueobjects.DescriptionField;
import org.libreplan.business.workreports.valueobjects.DescriptionValue;
import org.libreplan.web.common.ConstraintChecker;
import org.libreplan.web.common.IMessagesForUser;
import org.libreplan.web.common.Level;
import org.libreplan.web.common.MessagesForUser;
@ -248,6 +250,7 @@ public class WorkReportCRUDController extends GenericForwardComposer implements
}
public boolean save() {
ConstraintChecker.isValid(createWindow);
workReportModel.generateWorkReportLinesIfIsNecessary();
try {
workReportModel.confirmSave();
@ -1102,6 +1105,17 @@ public class WorkReportCRUDController extends GenericForwardComposer implements
private void appendEffortDuration(Row row) {
WorkReportLine workReportLine = (WorkReportLine) row.getValue();
Textbox effort = new Textbox();
effort.setConstraint(new Constraint() {
@Override
public void validate(Component comp, Object value)
throws WrongValueException {
if (!Pattern.matches("(\\d+)(\\s*:\\s*\\d+\\s*)*",
(String) value))
throw new WrongValueException(comp,
_("Please, enter a valid effort"));
}
});
bindEffort(effort, workReportLine);
if (getWorkReportType().getHoursManagement().equals(

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -25,7 +25,6 @@
<?init class="org.zkoss.zk.ui.util.Composition" arg0="/common/layout/template.zul"?>
<?link rel="stylesheet" type="text/css" href="/common/css/libreplan.css"?>
<?link rel="stylesheet" type="text/css" href="/common/css/libreplan_zk.css"?>
<?link rel="stylesheet" type="text/css" href="/resources/css/resources.css"?>
<?variable-resolver class="org.zkoss.zkplus.spring.DelegatingVariableResolver"?>
<?component name="list" inline="true" macroURI="_listAdvanceTypes.zul"?>
<?component name="edition" inline="true" macroURI="_editAdvanceTypes.zul"?>

View file

@ -148,7 +148,7 @@
<hbox align="middle">
<label value="${i18n:_('Normal Effort')}:" />
<hbox id="exceptionDayNormalEffortRow" />
<label value="${i18n:_('Extra Effort')}:" />
<label value="${i18n:_('Overtime Effort')}:" />
<hbox id="exceptionDayExtraEffortBox"
sclass="exceptionDayExtraEffortBox" />
</hbox>

View file

@ -25,7 +25,6 @@
<?link rel="stylesheet" type="text/css" href="/common/css/libreplan.css"?>
<?link rel="stylesheet" type="text/css" href="/common/css/libreplan_zk.css"?>
<?link rel="stylesheet" type="text/css" href="/resources/css/resources.css"?>
<?variable-resolver class="org.zkoss.zkplus.spring.DelegatingVariableResolver"?>

View file

@ -27,7 +27,6 @@
<?init class="org.zkoss.zk.ui.util.Composition" arg0="/common/layout/template.zul"?>
<?link rel="stylesheet" type="text/css" href="/common/css/libreplan.css"?>
<?link rel="stylesheet" type="text/css" href="/common/css/libreplan_zk.css"?>
<?link rel="stylesheet" type="text/css" href="/resources/css/resources.css"?>
<?variable-resolver class="org.zkoss.zkplus.spring.DelegatingVariableResolver"?>
<zk>
@ -193,7 +192,7 @@
<panelchildren id="panelEntitySequence">
<vbox>
<hbox pack="center">
<label value="${i18n:_('Select entity:')}" />
<label value="${i18n:_('Select entity')}" />
<combobox id="entityCombo"
model="@{configurationController.entityNames}">
<comboitem
@ -202,10 +201,10 @@
value="@{entityName}" />
</combobox>
<label value="${i18n:_('Prefix:')}" />
<label value="${i18n:_('Prefix')}" />
<textbox id="prefixBox" />
<label
value="${i18n:_('Number of digits:')}" />
value="${i18n:_('Number of digits')}" />
<intbox id="numDigitBox" value="5" />
<button label="${i18n:_('add')}"
onClick="configurationController.addNewEntitySequence()" />
@ -254,35 +253,35 @@
</columns>
<rows>
<row>
<label value="${i18n:_('Host:')}" />
<label value="${i18n:_('Host')}" />
<hbox>
<textbox id="ldapHost" value="@{configurationController.ldapConfiguration.ldapHost}" width="300px"/>
<label value="${i18n:__('Example: {0}', 'ldap://localhost')}" />
</hbox>
</row>
<row>
<label value="${i18n:_('Port:')}" />
<label value="${i18n:_('Port')}" />
<hbox>
<textbox id="ldapPort" value="@{configurationController.ldapConfiguration.ldapPort}" width="300px"/>
<label value="${i18n:__('Example: {0}', '389')}" />
</hbox>
</row>
<row>
<label value="${i18n:_('Base:')}" />
<label value="${i18n:_('Base')}" />
<hbox>
<textbox id="ldapBase" value="@{configurationController.ldapConfiguration.ldapBase}" width="300px"/>
<label value="${i18n:__('Example: {0}', 'dc=example,dc=org')}" />
</hbox>
</row>
<row>
<label value="${i18n:_('UserDn:')}" />
<label value="${i18n:_('UserDn')}" />
<hbox>
<textbox id="ldapUserDn" value="@{configurationController.ldapConfiguration.ldapUserDn}" width="300px"/>
<label value="${i18n:__('Example: {0}', 'cn=admin,dc=example,dc=org')}" />
</hbox>
</row>
<row>
<label value="${i18n:_('Password:')}" />
<label value="${i18n:_('Password')}" />
<textbox id="ldapPassword" value="@{configurationController.ldapConfiguration.ldapPassword}" type="password" width="300px"/>
</row>
</rows>
@ -303,7 +302,7 @@
</columns>
<rows>
<row>
<label value="${i18n:_('UserId:')}" />
<label value="${i18n:_('UserId')}" />
<hbox>
<textbox id="ldapUserId" value="@{configurationController.ldapConfiguration.ldapUserId}" width="300px"/>
<label value="${i18n:__('Example: {0}', 'uid')}" />
@ -334,21 +333,21 @@
<checkbox id="ldapSaveRolesDB" checked="@{configurationController.ldapConfiguration.ldapSaveRolesDB}" onCheck="configurationController.showLdapRoles()"/>
</row>
<row>
<label value="${i18n:_('Group path:')}" />
<label value="${i18n:_('Group path')}" />
<hbox>
<textbox id="ldapGroupPath" value="@{configurationController.ldapConfiguration.ldapGroupPath}" width="300px"/>
<label value="${i18n:__('Example: {0}', 'ou=groups (If it is empty, a node strategy is used.)')}" />
<label value="${i18n:__('Example: {0}', 'ou=groups')}" /><label value="${i18n:_('(If it is empty, a node strategy is used)')}" />
</hbox>
</row>
<row>
<label value="${i18n:_('Role property:')}" />
<label value="${i18n:_('Role property')}" />
<hbox>
<textbox id="ldapRoleProperty" value="@{configurationController.ldapConfiguration.ldapRoleProperty}" width="300px"/>
<label value="${i18n:__('Example: {0}', 'member')}" />
</hbox>
</row>
<row>
<label value="${i18n:_('Role search query:')}" />
<label value="${i18n:_('Role search query')}" />
<hbox>
<textbox id="ldapSearchQuery" value="@{configurationController.ldapConfiguration.ldapSearchQuery}" width="300px"/>
<label value="${i18n:__('Example: {0}', 'uid=[USER_ID],ou=people,dc=example,dc=org')}" />

View file

@ -565,8 +565,8 @@ div.z-grid {
.orderTree .z-textbox,.orderTree .z-decimalbox,
.orderTree .z-intbox,.orderTree .z-longbox,
.orderTree .z-doublebox {
height: 23px;
.orderTree .z-doublebox, .orderTree .z-datebox {
height: 21px;
width: 100%;
}
@ -583,19 +583,20 @@ div.z-grid {
height:25px;
}
.orderTree .operations {
width:80px;
width: 50px;
}
.orderTree .name {
min-width:120px;
min-width: 120px;
}
.orderTree .hours {
width:40px;
width: 50px;
}
.orderTree .code {
min-width:100px;
min-width: 100px;
}
.orderTree .scheduling_state {
min-width:160px;
min-width:140px;
}
.orderTree .estimated_init,
.orderTree .estimated_end {
@ -614,6 +615,10 @@ div.z-grid {
border-bottom: 1px dotted #7EAAC6;
}
.orderTree td td {
border-bottom: 0;
}
.orderTree .icono td {
border:none;
}
@ -823,6 +828,12 @@ div.z-listbox-pgi-b {
float:left;
}
.orderTree .not-scheduled span.z-button,
.orderTree .partially-scheduled span.z-button,
.orderTree .completely-scheduled span.z-button {
margin: 4px 1px 0 0;
}
.orderTree .not-scheduled span.scheduling-state,
.orderTree .partially-scheduled span.scheduling-state,
.orderTree .completely-scheduled span.scheduling-state {
@ -859,7 +870,7 @@ span.completely-scheduled {
span.z-dottree-tee-open,
span.z-dottree-tee-close,
span.z-dottree-line {
min-height: 28px;
min-height: 25px;
}
@ -1119,10 +1130,15 @@ span.perspective, span.perspective-active {
tr.z-tree-row-seld, tr.z-list-item-seld,
.z-combobox-pp .z-combo-item-seld,
tr.z-treerow-seld {
background-color: #fdd772;
background-color: #fdd772; /* Dark orange */
color: #000000;
}
tr.z-treerow-seld input {
background-color: #fdf3da; /* Soft orange */
background-image: none;
}
.timeplot-canvas {
position:relative;
overflow:hidden;

View file

@ -37,15 +37,15 @@
</columns>
<rows>
<row>
<label value="${i18n:_('Exception type:')}" />
<label value="${i18n:_('Exception type')}" />
<label value="${requestScope['javax.servlet.error.exception_type']}" />
</row>
<row>
<label value="${i18n:_('Status code:')}" />
<label value="${i18n:_('Status code')}" />
<label value="${requestScope['javax.servlet.error.status_code']}" />
</row>
<row>
<label value="${i18n:_('Stacktrace:')}" />
<label value="${i18n:_('Stacktrace')}" />
<textbox id="stacktrace" rows="20" width="600px" readonly="true" />
</row>
</rows>

View file

@ -32,15 +32,15 @@
</columns>
<rows>
<row>
<label value="${i18n:_('Exception type:')}" />
<label value="${i18n:_('Exception type')}" />
<label value="${requestScope['javax.servlet.error.exception_type']}" />
</row>
<row>
<label value="${i18n:_('Status code:')}" />
<label value="${i18n:_('Status code')}" />
<label value="${requestScope['javax.servlet.error.status_code']}" />
</row>
<row>
<label value="${i18n:_('Stacktrace:')}" />
<label value="${i18n:_('Stacktrace')}" />
<textbox id="stacktrace" rows="20" width="600px" readonly="true" />
</row>
</rows>

View file

@ -114,7 +114,10 @@ signature="java.lang.Boolean isDefaultPasswordsControl()"?>
<!-- borderlayout class="main-layout" height="2000px" width="2000px"-->
<west class="perspectives-column" width="90px">
<vbox>
<hbox id="perspectiveButtonsInsertionPoint" sclass="toolbar-box global-commands" height="30px" width="100%" />
<hbox id="perspectiveButtonsInsertionPoint" sclass="toolbar-box global-commands" height="30px" width="100%">
<button id="createOrderButton" image="/common/img/ico_add.png" sclass="planner-icon"
tooltiptext="${i18n:_('Create New Project')}" />
</hbox>
<vbox id="registeredItemsInsertionPoint" width="90px"/>
</vbox>
</west>

View file

@ -24,7 +24,6 @@
<?init class="org.zkoss.zk.ui.util.Composition" arg0="/common/layout/template.zul"?>
<?link rel="stylesheet" type="text/css" href="/common/css/libreplan.css"?>
<?link rel="stylesheet" type="text/css" href="/common/css/libreplan_zk.css"?>
<?link rel="stylesheet" type="text/css" href="/resources/css/resources.css"?>
<?variable-resolver class="org.zkoss.zkplus.spring.DelegatingVariableResolver"?>
<?component name="list" inline="true" macroURI="_listCostCategories.zul"?>
<?component name="edition" inline="true" macroURI="_editCostCategory.zul"?>

View file

@ -24,7 +24,6 @@
<?init class="org.zkoss.zk.ui.util.Composition" arg0="/common/layout/template.zul"?>
<?link rel="stylesheet" type="text/css" href="/common/css/libreplan.css"?>
<?link rel="stylesheet" type="text/css" href="/common/css/libreplan_zk.css"?>
<?link rel="stylesheet" type="text/css" href="/resources/css/resources.css"?>
<?variable-resolver class="org.zkoss.zkplus.spring.DelegatingVariableResolver"?>
<?component name="list" inline="true" macroURI="_listTypesOfWorkHours.zul"?>
<?component name="edition" inline="true" macroURI="_editTypeOfWorkHours.zul"?>

View file

@ -32,7 +32,7 @@
<newdatasortablecolumn label="${i18n:_('Color')}"/>
<newdatasortablecolumn label="${i18n:_('Over assignable')}" />
<newdatasortablecolumn label="${i18n:_('Standard Effort')}" />
<newdatasortablecolumn label="${i18n:_('Extra Effort')}" />
<newdatasortablecolumn label="${i18n:_('Overtime Effort')}" />
<newdatasortablecolumn label="${i18n:_('Operations')}" />
</columns>
</newdatasortablegrid>
@ -40,4 +40,4 @@
<button label="${i18n:_('Create')}" onClick="controller.goToCreateForm()"
sclass="create-button global-action"/>
</window>
</window>

View file

@ -24,7 +24,6 @@
<?init class="org.zkoss.zk.ui.util.Composition" arg0="/common/layout/template.zul"?>
<?link rel="stylesheet" type="text/css" href="/common/css/libreplan.css"?>
<?link rel="stylesheet" type="text/css" href="/common/css/libreplan_zk.css"?>
<?link rel="stylesheet" type="text/css" href="/resources/css/resources.css"?>
<?variable-resolver class="org.zkoss.zkplus.spring.DelegatingVariableResolver"?>
<?component name="list" inline="true" macroURI="_listExternalCompanies.zul"?>
<?component name="edition" inline="true" macroURI="_editExternalCompany.zul"?>

View file

@ -40,7 +40,7 @@
closable="true"
onClose="orderElementController.close(event)" >
<tabbox height="620px" id="tabboxOrderElement">
<tabbox height="560px" id="tabboxOrderElement">
<tabs>
<tab id="tabDetails" label="${i18n:_('Details')}" selected="true"
onSelect="orderElementController.clearAll();"/>

View file

@ -20,6 +20,7 @@
-->
<vbox id="${arg.id}"
apply="org.libreplan.web.orders.ManageOrderElementAdvancesController" width="100%">
<groupbox sclass="progress-assignments" closable="false">
<caption label="${i18n:_('Progress assignments')}" />
<vbox id="messagesContainerAdvances" />
@ -32,7 +33,7 @@
</vbox>
<vbox>
<radiogroup>
<listbox id="editAdvances" height="170px"
<listbox id="editAdvances"
model="@{manageOrderElementAdvancesController.advanceAssignments}"
itemRenderer="@{manageOrderElementAdvancesController.advancesRenderer}" mold="paging"
onSelect="manageOrderElementAdvancesController.selectAdvanceLine(self.selectedItem);"
@ -52,14 +53,15 @@
</radiogroup>
</vbox>
</groupbox>
<groupbox sclass="advance-measurement" width="100%" closable="false">
<caption label="@{manageOrderElementAdvancesController.getInfoAdvance}" />
<hbox>
<vbox>
<listbox id="editAdvancesMeasurement" width="390px" height="200px"
<hbox>
<listbox id="editAdvancesMeasurement" width="390px" style="min-height:200px;background-color: #FFFFFF"
model="@{manageOrderElementAdvancesController.advanceMeasurements}"
itemRenderer="@{manageOrderElementAdvancesController.advanceMeasurementRenderer}"
mold="paging" pageSize="5" sclass="advance-measurement"
mold="paging" pageSize="10" sclass="advance-measurement"
onPaging="manageOrderElementAdvancesController.onPagingMeasurement();">
<listhead>
<listheader label="${i18n:_('Value')}" width="100px" align="center"/>
@ -68,8 +70,8 @@
<listheader label="${i18n:_('Operations')}" width="90px" align="center"/>
</listhead>
</listbox>
</vbox>
<vbox width="20px" />
</hbox>
<hbox width="20px"/>
<zscript>
import java.awt.Font;
String fontname = "Verdana";

View file

@ -28,14 +28,6 @@
<borderlayout sclass="orderslayout" width="auto" apply="${orderController}">
<north height="30px" border="0" sclass="toolbar-box">
<hbox align="center" id="toolbar">
<templateFinderPopup id="templateFinderPopup" acceptButtonLabel="${i18n:_('Create Project')}"
caption="${i18n:_('Choosing Template')}" />
<button id="createOrderButton" image="/common/img/ico_add.png" sclass="planner-icon"
tooltiptext="${i18n:_('Create New Project')}" visible="false" />
<button id="createOrderFromTemplateButton" image="/common/img/ico_copy.png" sclass="planner-icon"
tooltiptext="${i18n:_('Create From Template')}" visible="false" />
<button id="saveOrderAndContinueButton" image="/common/img/ico_save.png" sclass="planner-icon"
tooltiptext="${i18n:_('Save Project')}" />

View file

@ -20,7 +20,7 @@
<?taglib uri="/WEB-INF/tld/i18n.tld" prefix="i18n" ?>
<window id="projectCreationWindow"
title="${i18n:_('Create project')}"
title="${i18n:_('Create new project')}"
width="650px"
closable="true"
onClose="self.visible = false; event.stopPropagation();">
@ -34,7 +34,8 @@
<row>
<label value="${i18n:_('Name')}" />
<textbox id="txtName" value="@{projectController.order.name}" width="500px"
constraint="no empty:${i18n:_('cannot be null or empty')}"/>
constraint="no empty:${i18n:_('cannot be null or empty')}"
onOK="projectController.accept();"/>
</row>
<row>
<label value="${i18n:_('Code')}" />
@ -46,6 +47,11 @@
checked="@{projectController.codeAutogenerated}"/>
</hbox>
</row>
<row>
<label value="${i18n:_('Template')}" />
<bandboxSearch id="bdProjectTemplate" finder="templatesEligibleForOrder"
widthBandbox="400px" widthListbox="500px" />
</row>
<row>
<label value="${i18n:_('Starting date')}" />
<datebox id="initDate"
@ -71,6 +77,7 @@
itemRenderer="@{projectController.baseCalendarsComboitemRenderer}"
onSelect="projectController.setBaseCalendar(self.selectedItem.value);" />
</row>
</rows>
</grid>

View file

@ -30,10 +30,10 @@
<hbox pack="center">
<templateFinderPopup id="templateFinderPopupAtTree" acceptButtonLabel="${i18n:_('Create Task')}" caption="${i18n:_('Choosing Template')}" />
<label value="${i18n:_('New task:')}" />
<label value="${i18n:_('New task')}" />
<textbox value="" id="newOrderElementName" width="150px"
onOK="treeController.addElement(self.parent);" disabled="true" />
<label value="${i18n:_('Hours:')}" />
<label value="${i18n:_('Hours')}" />
<intbox value="0" id="newOrderElementHours" width="40px"
onOK="treeController.addElement(self.parent);"
constraint="no negative" disabled="true" />
@ -45,7 +45,7 @@
</hbox>
<hbox width="100%" style="float:right" hflex="1" align="right" pack="right">
<label value="${i18n:_('Selected node:')}" />
<label value="${i18n:_('Selected node')}:" />
<button id="editOrderElementButton" sclass="icono" image="/common/img/ico_editar1.png"
tooltiptext="${i18n:_('Edit selected task')}"
onClick="treeController.editSelectedElement();" />
@ -87,7 +87,7 @@
zclass="z-dottree">
<treecols sizable="true">
<treecol label="${each.label}" class="${each.cssClass}" tooltiptext="${each.tooltip}"
forEach="${treeComponent.columns}"/>
forEach="${treeComponent.columns}" hflex="${each.hflex}" />
</treecols>
</tree>
</vbox>

View file

@ -28,17 +28,17 @@
<hbox>
<!-- Planned Task Start -->
<label style="font-weight: bold" value="${i18n:_('Planned start :')}" />
<label style="font-weight: bold" value="${i18n:_('Planned start')}:" />
<label id="lbTaskStart" />
<!-- Planned Task End -->
<label style="font-weight: bold" value="${i18n:_('Planned end :')}" />
<label style="font-weight: bold" value="${i18n:_('Planned end')}:" />
<label id="lbTaskEnd" />
</hbox>
<hbox>
<!-- Planned Workable Days -->
<label style="font-weight: bold" value="${i18n:_('Planned workable days :')}" />
<label style="font-weight: bold" value="${i18n:_('Planned workable days')}:" />
<intbox id="taskWorkableDays" width="90px" />
</hbox>

View file

@ -23,7 +23,7 @@
<div align="right">
<hbox align="end">
<!-- Filter by name -->
<label value="${i18n:_('Filter quality forms by :')}"/>
<label value="${i18n:_('Filter quality forms by')}:"/>
<label value="${i18n:_('name')}"/>
<textbox value="" id="txtFilter"/>
<button label="${i18n:_('Filter')}" onClick="controller.onApplyFilter(event)"/>

View file

@ -48,7 +48,7 @@
</columns>
<rows>
<row>
<label value="${i18n:_('Reference date:')}" />
<label value="${i18n:_('Reference date')}" />
<datebox id="referenceDate" />
</row>
</rows>
@ -164,7 +164,7 @@
</columns>
<rows>
<row>
<label value="${i18n:_('Output format:')}" />
<label value="${i18n:_('Output format')}" />
<combobox_output_format id="outputFormat" />
</row>
</rows>

View file

@ -71,7 +71,7 @@
</columns>
<rows>
<row>
<label value="${i18n:_('Output format:')}" />
<label value="${i18n:_('Output format')}" />
<combobox_output_format id="outputFormat" />
</row>
</rows>

View file

@ -48,11 +48,11 @@
</columns>
<rows>
<row>
<label value="${i18n:_('Start date:')}" />
<label value="${i18n:_('Start date')}" />
<datebox id="startingDate" />
</row>
<row>
<label value="${i18n:_('End date:')}" />
<label value="${i18n:_('End date')}" />
<datebox id="endingDate" />
</row>
</rows>
@ -108,9 +108,9 @@
</hbox>
<hbox>
<radiogroup>
<label value="${i18n:_('Apply filter to: ') }"/>
<label value="${i18n:_('Apply filter to')}:"/>
<radio id="filterByWorkReports" label="${i18n:_('Work reports')}" />
<radio id="filterByOrderElements" label="${i18n:_('Order elements')}" />
<radio id="filterByOrderElements" label="${i18n:_('Tasks')}" />
<radio id="filterByBoth" label="${i18n:_('Both')}" checked="true" />
</radiogroup>
</hbox>
@ -194,7 +194,7 @@
</columns>
<rows>
<row>
<label value="${i18n:_('Output format:')}" />
<label value="${i18n:_('Output format')}" />
<combobox_output_format id="outputFormat" />
</row>
</rows>

View file

@ -55,11 +55,11 @@
</columns>
<rows>
<row>
<label value="${i18n:_('Work done from starting date:')}" />
<label value="${i18n:_('Work done from starting date')}" />
<datebox id="startingDate" width="200px" constraint = "@{controller.checkConstraintStartingDate}"/>
</row>
<row>
<label value="${i18n:_('Work done until ending date:')}" />
<label value="${i18n:_('Work done until ending date')}" />
<datebox id="endingDate" width="200px" constraint = "@{controller.checkConstraintEndingDate}"/>
</row>
</rows>
@ -201,7 +201,7 @@
</columns>
<rows>
<row>
<label value="${i18n:_('Output format:')}" />
<label value="${i18n:_('Output format')}" />
<combobox_output_format id="outputFormat" />
</row>
</rows>

View file

@ -70,7 +70,7 @@
</columns>
<rows>
<row>
<label value="${i18n:_('Show dependencies:')}" />
<label value="${i18n:_('Show dependencies')}" />
<checkbox id="cbShowDependencies" />
</row>
</rows>
@ -171,7 +171,7 @@
</columns>
<rows>
<row>
<label value="${i18n:_('Output format:')}" />
<label value="${i18n:_('Output format')}" />
<combobox_output_format id="outputFormat" />
</row>
</rows>

View file

@ -48,7 +48,7 @@
</columns>
<rows>
<row>
<label value="${i18n:_('Reference date:')}" />
<label value="${i18n:_('Reference date')}" />
<datebox id="referenceDate" onCreate="self.value = new Date()"/>
</row>
</rows>
@ -163,7 +163,7 @@
</columns>
<rows>
<row>
<label value="${i18n:_('Output format:')}" />
<label value="${i18n:_('Output format')}" />
<combobox_output_format id="outputFormat" />
</row>
</rows>

View file

@ -26,7 +26,6 @@
<?init class="org.zkoss.zk.ui.util.Composition" arg0="/common/layout/template.zul"?>
<?link rel="stylesheet" type="text/css" href="/common/css/libreplan.css"?>
<?link rel="stylesheet" type="text/css" href="/common/css/libreplan_zk.css"?>
<?link rel="stylesheet" type="text/css" href="/resources/css/resources.css"?>
<?variable-resolver class="org.zkoss.zkplus.spring.DelegatingVariableResolver"?>

View file

@ -24,7 +24,6 @@
<?init class="org.zkoss.zk.ui.util.Composition" arg0="/common/layout/template.zul"?>
<?link rel="stylesheet" type="text/css" href="/common/css/libreplan.css"?>
<?link rel="stylesheet" type="text/css" href="/common/css/libreplan_zk.css"?>
<?link rel="stylesheet" type="text/css" href="/resources/css/resources.css"?>
<?variable-resolver class="org.zkoss.zkplus.spring.DelegatingVariableResolver"?>
<?component name="list" inline="true" macroURI="_list.zul"?>
<?component name="edition" inline="true" macroURI="_edition.zul"?>

View file

@ -24,7 +24,6 @@
<?init class="org.zkoss.zk.ui.util.Composition" arg0="/common/layout/template.zul"?>
<?link rel="stylesheet" type="text/css" href="/common/css/libreplan.css"?>
<?link rel="stylesheet" type="text/css" href="/common/css/libreplan_zk.css"?>
<?link rel="stylesheet" type="text/css" href="/resources/css/resources.css"?>
<?variable-resolver class="org.zkoss.zkplus.spring.DelegatingVariableResolver"?>
<zk>

View file

@ -25,7 +25,6 @@
<?init class="org.zkoss.zk.ui.util.Composition" arg0="/common/layout/template.zul"?>
<?link rel="stylesheet" type="text/css" href="/common/css/libreplan.css"?>
<?link rel="stylesheet" type="text/css" href="/common/css/libreplan_zk.css"?>
<?link rel="stylesheet" type="text/css" href="/resources/css/resources.css"?>
<?variable-resolver class="org.zkoss.zkplus.spring.DelegatingVariableResolver"?>
<zk xmlns:n="http://www.zkoss.org/2005/zk/native">
@ -52,19 +51,19 @@
</columns>
<rows>
<row>
<label value="${i18n:_('Current password')}:" />
<label value="${i18n:_('Current password')}" />
<textbox id="currentPassword" type="password"
constraint="@{passwordController.validateCurrentPassword}"
width="300px"/>
</row>
<row>
<label value="${i18n:_('New password')}:" />
<label value="${i18n:_('New password')}" />
<textbox id="password" type="password"
onChange="passwordController.setPassword(self.value);"
width="300px"/>
</row>
<row>
<label value="${i18n:_('Password confirmation')}:" />
<label value="${i18n:_('Password confirmation')}" />
<textbox id="passwordConfirmation" type="password"
constraint="@{passwordController.validatePasswordConfirmation}"
width="300px"/>

View file

@ -25,7 +25,6 @@
<?init class="org.zkoss.zk.ui.util.Composition" arg0="/common/layout/template.zul"?>
<?link rel="stylesheet" type="text/css" href="/common/css/libreplan.css"?>
<?link rel="stylesheet" type="text/css" href="/common/css/libreplan_zk.css"?>
<?link rel="stylesheet" type="text/css" href="/resources/css/resources.css"?>
<?variable-resolver class="org.zkoss.zkplus.spring.DelegatingVariableResolver"?>
<zk>
<window id="settingsWindow" self="@{define(content)}"

View file

@ -25,8 +25,8 @@
<columns sizable="true">
<newdatasortablecolumn label="${i18n:_('User login name')}" sort="auto(loginName)" />
<newdatasortablecolumn label="${i18n:_('Disabled')}" />
<newdatasortablecolumn label="${i18n:_('Is administrator')}" />
<newdatasortablecolumn label="${i18n:_('Is a libreplan user')}" />
<newdatasortablecolumn label="${i18n:_('Administrator')}" />
<newdatasortablecolumn label="${i18n:_('LibrePlan user')}" />
<newdatasortablecolumn label="${i18n:_('Actions')}" />
</columns>
<rows>

View file

@ -24,7 +24,6 @@
<?init class="org.zkoss.zk.ui.util.Composition" arg0="/common/layout/template.zul"?>
<?link rel="stylesheet" type="text/css" href="/common/css/libreplan.css"?>
<?link rel="stylesheet" type="text/css" href="/common/css/libreplan_zk.css"?>
<?link rel="stylesheet" type="text/css" href="/resources/css/resources.css"?>
<?variable-resolver class="org.zkoss.zkplus.spring.DelegatingVariableResolver"?>
<?component name="list" inline="true" macroURI="_listProfiles.zul"?>
<?component name="edition" inline="true" macroURI="_editProfile.zul"?>

View file

@ -24,7 +24,6 @@
<?init class="org.zkoss.zk.ui.util.Composition" arg0="/common/layout/template.zul"?>
<?link rel="stylesheet" type="text/css" href="/common/css/libreplan.css"?>
<?link rel="stylesheet" type="text/css" href="/common/css/libreplan_zk.css"?>
<?link rel="stylesheet" type="text/css" href="/resources/css/resources.css"?>
<?variable-resolver class="org.zkoss.zkplus.spring.DelegatingVariableResolver"?>
<?component name="list" inline="true" macroURI="_listUsers.zul"?>
<?component name="edition" inline="true" macroURI="_editUser.zul"?>

View file

@ -38,7 +38,7 @@
<vbox align="right">
<hbox id="hboxFilter" align="center">
<!-- Filter by type, start date and finish date -->
<label value="${i18n:_('Filter work report by :')}"/>
<label value="${i18n:_('Filter work report by')}:"/>
<label value="${i18n:_('Type')}"/>
<listbox id="listType" mold="select" rows="1"
model="@{controller.filterWorkReportTypes}" width="150px">
@ -92,7 +92,7 @@
<div align="left">
<hbox align="center">
<!-- Create new Work Report -->
<label value="${i18n:_('Select type :')}"/>
<label value="${i18n:_('Select type')}:"/>
<listbox id="listTypeToAssign" mold="select" rows="1"
model="@{controller.workReportTypes}" width="150px"
selectedItem="@{controller.firstType}">

View file

@ -24,7 +24,6 @@
<?init class="org.zkoss.zk.ui.util.Composition" arg0="/common/layout/template.zul"?>
<?link rel="stylesheet" type="text/css" href="/common/css/libreplan.css"?>
<?link rel="stylesheet" type="text/css" href="/common/css/libreplan_zk.css"?>
<?link rel="stylesheet" type="text/css" href="/resources/css/resources.css"?>
<?variable-resolver class="org.zkoss.zkplus.spring.DelegatingVariableResolver"?>
<zk>
<window self="@{define(content)}"
@ -32,24 +31,24 @@
<vbox id="messagesContainer"></vbox>
<window id="listQueryWindow" title="${i18n:_('Work Report Lines List')}">
<panel title="${i18n:_('Filter work report by :')}" border="normal"
<panel title="${i18n:_('Filter work report by')}" border="normal"
style="overflow:auto">
<panelchildren>
<separator bar="false" spacing="5px" orient="horizontal"/>
<div align="center">
<hbox id="hboxFilter" align="end">
<!-- Filter work report lines -->
<label value="${i18n:_('Resource :')}"/>
<label value="${i18n:_('Resource')}"/>
<autocomplete id="filterResource" buttonVisible="true"
finder="ResourceFinder"/>
<label value="${i18n:_('task :')}"/>
<label value="${i18n:_('task')}"/>
<bandboxSearch id="bandboxFilterOrderElement" widthBandbox="285px" widthListbox="700px"
finder="OrderElementBandboxFinder" model="@{controller.orderElements}"/>
<label value="${i18n:_('from')}"/>
<datebox id="filterStartDateLine" constraint = "@{controller.checkConstraintStartDateLine}"/>
<label value="${i18n:_('to')}"/>
<datebox id="filterFinishDateLine" constraint = "@{controller.checkConstraintFinishDateLine}"/>
<label value="${i18n:_('hours type :')}"/>
<label value="${i18n:_('hours type')}"/>
<autocomplete id="filterHoursType" buttonVisible="true"
finder="TypeOfWorkHoursFinder" width="100px"/>
<button label="${i18n:_('Filter')}" style="margin-top: -4px"

View file

@ -24,7 +24,6 @@
<?init class="org.zkoss.zk.ui.util.Composition" arg0="/common/layout/template.zul"?>
<?link rel="stylesheet" type="text/css" href="/common/css/libreplan.css"?>
<?link rel="stylesheet" type="text/css" href="/common/css/libreplan_zk.css"?>
<?link rel="stylesheet" type="text/css" href="/resources/css/resources.css"?>
<?variable-resolver class="org.zkoss.zkplus.spring.DelegatingVariableResolver"?>
<?component name="list" inline="true" macroURI="_listWorkReportTypes.zul"?>
<?component name="edition" inline="true" macroURI="_editWorkReportType.zul"?>

View file

@ -150,7 +150,7 @@ public class OrderElementTreeModelTest {
}
private void addCriterionRequirement(OrderElement orderElement) {
criterion = criterionDAO.findByNameAndType("medicalLeave", "LEAVE")
criterion = criterionDAO.findByNameAndType("Europe", "LOCATION")
.get(0);
DirectCriterionRequirement directCriterionRequirement = DirectCriterionRequirement
.create(criterion);
@ -158,8 +158,8 @@ public class OrderElementTreeModelTest {
}
private void addAnotherCriterionRequirement(OrderElement orderElement) {
criterion2 = criterionDAO.findByNameAndType(
"hiredResourceWorkingRelationship", "WORK_RELATIONSHIP").get(0);
criterion2 = criterionDAO.findByNameAndType("Manager", "CATEGORY").get(
0);
DirectCriterionRequirement directCriterionRequirement = DirectCriterionRequirement
.create(criterion2);
orderElement.addCriterionRequirement(directCriterionRequirement);
@ -167,7 +167,7 @@ public class OrderElementTreeModelTest {
private void addAnotherDifferentCriterionRequirement(
OrderElement orderElement) {
criterion3 = criterionDAO.findByNameAndType("paternityLeave", "LEAVE")
criterion3 = criterionDAO.findByNameAndType("Asia", "LOCATION")
.get(0);
DirectCriterionRequirement directCriterionRequirement = DirectCriterionRequirement
.create(criterion3);

View file

@ -112,12 +112,11 @@ public class CriterionModelTest {
@Test
public void savingCriterionIncreasesTheNumberOfCriterions()
{
givenValidCriterionFor(PredefinedCriterionTypes.WORK_RELATIONSHIP);
int initial = getCriterionsNumber(PredefinedCriterionTypes.WORK_RELATIONSHIP);
givenValidCriterionFor(PredefinedCriterionTypes.CATEGORY);
int initial = getCriterionsNumber(PredefinedCriterionTypes.CATEGORY);
criterionDAO.save(criterion);
criterionDAO.flush();
assertThat(
getCriterionsNumber(PredefinedCriterionTypes.WORK_RELATIONSHIP),
assertThat(getCriterionsNumber(PredefinedCriterionTypes.CATEGORY),
equalTo(initial + 1));
}
@ -175,13 +174,12 @@ public class CriterionModelTest {
@Test
public void modifyingDontAlterTheNumberOfCriterions() {
givenCreatedCriterionFor(PredefinedCriterionTypes.WORK_RELATIONSHIP);
int initial = getCriterionsNumber(PredefinedCriterionTypes.WORK_RELATIONSHIP);
givenCreatedCriterionFor(PredefinedCriterionTypes.CATEGORY);
int initial = getCriterionsNumber(PredefinedCriterionTypes.CATEGORY);
String newName = UUID.randomUUID().toString() + "random";
criterion.setName(newName);
criterionDAO.save(criterion);
assertThat(
getCriterionsNumber(PredefinedCriterionTypes.WORK_RELATIONSHIP),
assertThat(getCriterionsNumber(PredefinedCriterionTypes.CATEGORY),
equalTo(initial));
}
@ -221,7 +219,7 @@ public class CriterionModelTest {
@Override
public Void execute() {
Criterion criterion = givenValidCriterionFor(
PredefinedCriterionTypes.WORK_RELATIONSHIP, unique);
PredefinedCriterionTypes.CATEGORY, unique);
try {
criterionDAO.save(criterion);
} catch (ValidationException e) {
@ -236,7 +234,7 @@ public class CriterionModelTest {
public Void execute() {
try {
Criterion criterion2 = givenValidCriterionFor(
PredefinedCriterionTypes.WORK_RELATIONSHIP, unique);
PredefinedCriterionTypes.CATEGORY, unique);
criterionDAO.save(criterion2);
fail("must send "
+ ValidationException.class.getSimpleName());

View file

@ -82,7 +82,7 @@ public class WorkerModelTest {
List<Criterion> criterions = new ArrayList<Criterion>();
expect(
criterionServiceMock
.findByType(PredefinedCriterionTypes.LOCATION_GROUP))
.findByType(PredefinedCriterionTypes.LOCATION))
.andReturn(criterions).anyTimes();
expect(resourceDAOMock.find(workerToReturn.getId()))
.andReturn(workerToReturn);
@ -109,7 +109,7 @@ public class WorkerModelTest {
List<Criterion> criterions = new ArrayList<Criterion>();
expect(
criterionServiceMock
.findByType(PredefinedCriterionTypes.LOCATION_GROUP))
.findByType(PredefinedCriterionTypes.LOCATION))
.andReturn(criterions).anyTimes();
expect(resourceDAOMock.find(workerToReturn.getId())).andReturn(
workerToReturn);

Some files were not shown because too many files have changed in this diff Show more