Some bugfixes for the Native SQL project list

git-svn-id: https://svn.libreccm.org/ccm/trunk@4940 8810af33-2d31-482b-a856-94f89814c4df
master
jensp 2017-08-28 12:53:54 +00:00
parent 5aff1fdc51
commit 2563287d4a
1 changed files with 27 additions and 13 deletions

View File

@ -1,5 +1,6 @@
package com.arsdigita.cms.sciproject.navigation; package com.arsdigita.cms.sciproject.navigation;
import com.arsdigita.globalization.GlobalizationHelper;
import com.arsdigita.navigation.Navigation; import com.arsdigita.navigation.Navigation;
import com.arsdigita.navigation.ui.AbstractComponent; import com.arsdigita.navigation.ui.AbstractComponent;
import com.arsdigita.persistence.SessionManager; import com.arsdigita.persistence.SessionManager;
@ -238,6 +239,12 @@ public class SciProjectList extends AbstractComponent {
.get(Calendar.YEAR))); .get(Calendar.YEAR)));
projectBeginElem.addAttribute("month", Integer.toString(projectBegin projectBeginElem.addAttribute("month", Integer.toString(projectBegin
.get(Calendar.MONTH))); .get(Calendar.MONTH)));
projectBeginElem.addAttribute(
"month-name",
projectBegin.getDisplayName(Calendar.MONTH,
Calendar.LONG,
GlobalizationHelper
.getNegotiatedLocale()));
projectBeginElem.addAttribute("day", Integer.toString(projectBegin projectBeginElem.addAttribute("day", Integer.toString(projectBegin
.get(Calendar.DAY_OF_MONTH))); .get(Calendar.DAY_OF_MONTH)));
@ -252,28 +259,35 @@ public class SciProjectList extends AbstractComponent {
if (resultSet.getDate("projectend") != null) { if (resultSet.getDate("projectend") != null) {
final Element projectBeginElem = projectElem.newChildElement( final Element projectEndElem = projectElem.newChildElement(
"project-begin"); "project-end");
final Calendar projectBegin = Calendar.getInstance(); final Calendar projectEnd = Calendar.getInstance();
projectBegin.setTime(resultSet.getDate("projectend")); projectEnd.setTime(resultSet.getDate("projectend"));
projectBeginElem.addAttribute("year", Integer.toString(projectBegin projectEndElem.addAttribute("year", Integer.toString(projectEnd
.get(Calendar.YEAR))); .get(Calendar.YEAR)));
projectBeginElem.addAttribute("month", Integer.toString(projectBegin projectEndElem.addAttribute("month", Integer.toString(projectEnd
.get(Calendar.MONTH))); .get(Calendar.MONTH)));
projectBeginElem.addAttribute("day", Integer.toString(projectBegin projectEndElem.addAttribute(
.get(Calendar.DAY_OF_MONTH))); "month-name",
projectEnd.getDisplayName(Calendar.MONTH,
Calendar.LONG,
GlobalizationHelper
.getNegotiatedLocale()));
projectEndElem.addAttribute("day", Integer.toString(projectEnd
.get(Calendar.DAY_OF_MONTH)));
projectBeginElem.addAttribute( projectEndElem.addAttribute(
"skip-month", "skip-month",
Boolean Boolean
.toString(resultSet.getBoolean("projectend_skip_month"))); .toString(resultSet.getBoolean("projectend_skip_month")));
projectBeginElem.addAttribute( projectEndElem.addAttribute(
"skip-day", "skip-day",
Boolean.toString(resultSet.getBoolean("projectend_skip_day"))); Boolean.toString(resultSet.getBoolean("projectend_skip_day")));
} }
final Element shortDescElem = projectElem.newChildElement("project-short-desc"); final Element shortDescElem = projectElem.newChildElement(
"project-short-desc");
shortDescElem.setText(resultSet.getString("shortdesc")); shortDescElem.setText(resultSet.getString("shortdesc"));
final Element descriptionElem = projectElem.newChildElement( final Element descriptionElem = projectElem.newChildElement(