Author: solomax
Date: Thu Oct 16 04:34:38 2014
New Revision: 1632207

URL: http://svn.apache.org/r1632207
Log:
[OPENMEETINGS-1104] first day in calendar is configurable

Modified:
    
openmeetings/branches/3.0.x/src/install/java/org/apache/openmeetings/installation/ImportInitvalues.java
    
openmeetings/branches/3.0.x/src/util/java/org/apache/openmeetings/util/OpenmeetingsVariables.java
    
openmeetings/branches/3.0.x/src/web/java/org/apache/openmeetings/web/user/calendar/CalendarPanel.java
    
openmeetings/trunk/singlewebapp/openmeetings-install/src/main/java/org/apache/openmeetings/installation/ImportInitvalues.java
    
openmeetings/trunk/singlewebapp/openmeetings-server/src/site/xdoc/GeneralConfiguration.xml
    
openmeetings/trunk/singlewebapp/openmeetings-util/src/main/java/org/apache/openmeetings/util/OpenmeetingsVariables.java
    
openmeetings/trunk/singlewebapp/openmeetings-web/src/main/java/org/apache/openmeetings/web/user/calendar/CalendarPanel.java

Modified: 
openmeetings/branches/3.0.x/src/install/java/org/apache/openmeetings/installation/ImportInitvalues.java
URL: 
http://svn.apache.org/viewvc/openmeetings/branches/3.0.x/src/install/java/org/apache/openmeetings/installation/ImportInitvalues.java?rev=1632207&r1=1632206&r2=1632207&view=diff
==============================================================================
--- 
openmeetings/branches/3.0.x/src/install/java/org/apache/openmeetings/installation/ImportInitvalues.java
 (original)
+++ 
openmeetings/branches/3.0.x/src/install/java/org/apache/openmeetings/installation/ImportInitvalues.java
 Thu Oct 16 04:34:38 2014
@@ -21,6 +21,7 @@ package org.apache.openmeetings.installa
 import static 
org.apache.openmeetings.db.dao.basic.ConfigurationDao.DEFAULT_MAX_UPLOAD_SIZE;
 import static 
org.apache.openmeetings.util.OpenmeetingsVariables.CONFIG_APPLICATION_BASE_URL;
 import static 
org.apache.openmeetings.util.OpenmeetingsVariables.CONFIG_APPOINTMENT_REMINDER_MINUTES;
+import static 
org.apache.openmeetings.util.OpenmeetingsVariables.CONFIG_CALENDAR_FIRST_DAY;
 import static 
org.apache.openmeetings.util.OpenmeetingsVariables.CONFIG_CRYPT_KEY;
 import static 
org.apache.openmeetings.util.OpenmeetingsVariables.CONFIG_DASHBOARD_SHOW_MYROOMS_KEY;
 import static 
org.apache.openmeetings.util.OpenmeetingsVariables.CONFIG_DASHBOARD_SHOW_RSS_KEY;
@@ -536,6 +537,7 @@ public class ImportInitvalues {
 
                configurationDao.add(CONFIG_REDIRECT_URL_FOR_EXTERNAL_KEY, "", 
null,
                                "Users entered the room via invitationHash or 
secureHash will be redirected to this URL on connection lost");
+               configurationDao.add(CONFIG_CALENDAR_FIRST_DAY, "0", null, "The 
day that each week begins. The value must be a number that represents the day 
of the week. Sunday=0, Monday=1, Tuesday=2, etc.");
                
                log.debug("Configurations ADDED");
        }

Modified: 
openmeetings/branches/3.0.x/src/util/java/org/apache/openmeetings/util/OpenmeetingsVariables.java
URL: 
http://svn.apache.org/viewvc/openmeetings/branches/3.0.x/src/util/java/org/apache/openmeetings/util/OpenmeetingsVariables.java?rev=1632207&r1=1632206&r2=1632207&view=diff
==============================================================================
--- 
openmeetings/branches/3.0.x/src/util/java/org/apache/openmeetings/util/OpenmeetingsVariables.java
 (original)
+++ 
openmeetings/branches/3.0.x/src/util/java/org/apache/openmeetings/util/OpenmeetingsVariables.java
 Thu Oct 16 04:34:38 2014
@@ -40,6 +40,7 @@ public class OpenmeetingsVariables {
        public static final String CONFIG_SCREENSHARING_FPS = 
"default.fps.screensharing";
        public static final String CONFIG_SCREENSHARING_FPS_SHOW = 
"screensharing.fps.show";
        public static final String CONFIG_SCREENSHARING_ALLOW_REMOTE = 
"screensharing.allow.remote";
+       public static final String CONFIG_CALENDAR_FIRST_DAY = 
"calendar.firstday";
 
        public static int DEFAULT_MINUTES_REMINDER_SEND = 15;
        public static String DEFAULT_BASE_URL = 
"http://localhost:5080/openmeetings/";;

Modified: 
openmeetings/branches/3.0.x/src/web/java/org/apache/openmeetings/web/user/calendar/CalendarPanel.java
URL: 
http://svn.apache.org/viewvc/openmeetings/branches/3.0.x/src/web/java/org/apache/openmeetings/web/user/calendar/CalendarPanel.java?rev=1632207&r1=1632206&r2=1632207&view=diff
==============================================================================
--- 
openmeetings/branches/3.0.x/src/web/java/org/apache/openmeetings/web/user/calendar/CalendarPanel.java
 (original)
+++ 
openmeetings/branches/3.0.x/src/web/java/org/apache/openmeetings/web/user/calendar/CalendarPanel.java
 Thu Oct 16 04:34:38 2014
@@ -18,6 +18,7 @@
  */
 package org.apache.openmeetings.web.user.calendar;
 
+import static 
org.apache.openmeetings.util.OpenmeetingsVariables.CONFIG_CALENDAR_FIRST_DAY;
 import static org.apache.openmeetings.util.OpenmeetingsVariables.webAppRootKey;
 import static org.apache.openmeetings.web.app.Application.getBean;
 import static org.apache.openmeetings.web.app.WebSession.getClientTimeZone;
@@ -26,6 +27,7 @@ import static org.apache.openmeetings.we
 import java.text.SimpleDateFormat;
 import java.util.Date;
 
+import org.apache.openmeetings.db.dao.basic.ConfigurationDao;
 import org.apache.openmeetings.db.dao.calendar.AppointmentDao;
 import org.apache.openmeetings.db.dao.calendar.AppointmentReminderTypDao;
 import org.apache.openmeetings.db.dao.user.UserDao;
@@ -130,12 +132,12 @@ public class CalendarPanel extends UserP
                        // first week day must be Sunday
                        days.put(0, WebSession.getString(466));
                        shortDays.put(0, WebSession.getString(459));
-                       for (int i=0; i < 12; i++){
+                       for (int i = 0; i < 12; i++) {
                                monthes.put(i, WebSession.getString(469 + i));
                                shortMonthes.put(i, WebSession.getString(1556 + 
i));
-                               if (i+1 < 7){
-                                       days.put(i+1, WebSession.getString(460 
+ i));
-                                       shortDays.put(i+1, 
WebSession.getString(453 + i));                                      
+                               if (i + 1 < 7) {
+                                       days.put(i + 1, 
WebSession.getString(460 + i));
+                                       shortDays.put(i + 1, 
WebSession.getString(453 + i));
                                }
                        }
                } catch (JSONException e) {
@@ -145,6 +147,7 @@ public class CalendarPanel extends UserP
                options.set("monthNamesShort", shortMonthes.toString());
                options.set("dayNames", days.toString());
                options.set("dayNamesShort", shortDays.toString());
+               options.set("firstDay", 
getBean(ConfigurationDao.class).getConfValue(CONFIG_CALENDAR_FIRST_DAY, 
String.class, "0"));
                
                calendar = new Calendar("calendar", new AppointmentModel(), 
options) {
                        private static final long serialVersionUID = 1L;

Modified: 
openmeetings/trunk/singlewebapp/openmeetings-install/src/main/java/org/apache/openmeetings/installation/ImportInitvalues.java
URL: 
http://svn.apache.org/viewvc/openmeetings/trunk/singlewebapp/openmeetings-install/src/main/java/org/apache/openmeetings/installation/ImportInitvalues.java?rev=1632207&r1=1632206&r2=1632207&view=diff
==============================================================================
--- 
openmeetings/trunk/singlewebapp/openmeetings-install/src/main/java/org/apache/openmeetings/installation/ImportInitvalues.java
 (original)
+++ 
openmeetings/trunk/singlewebapp/openmeetings-install/src/main/java/org/apache/openmeetings/installation/ImportInitvalues.java
 Thu Oct 16 04:34:38 2014
@@ -22,6 +22,7 @@ import static org.apache.openmeetings.db
 import static 
org.apache.openmeetings.util.OpenmeetingsVariables.CONFIG_APPLICATION_BASE_URL;
 import static 
org.apache.openmeetings.util.OpenmeetingsVariables.CONFIG_APPLICATION_NAME;
 import static 
org.apache.openmeetings.util.OpenmeetingsVariables.CONFIG_APPOINTMENT_REMINDER_MINUTES;
+import static 
org.apache.openmeetings.util.OpenmeetingsVariables.CONFIG_CALENDAR_FIRST_DAY;
 import static 
org.apache.openmeetings.util.OpenmeetingsVariables.CONFIG_CRYPT_KEY;
 import static 
org.apache.openmeetings.util.OpenmeetingsVariables.CONFIG_DASHBOARD_SHOW_MYROOMS_KEY;
 import static 
org.apache.openmeetings.util.OpenmeetingsVariables.CONFIG_DASHBOARD_SHOW_RSS_KEY;
@@ -465,6 +466,7 @@ public class ImportInitvalues {
                cfgDao.add(CONFIG_FLASH_PROTOCOL, "rtmp", null, "Protocol for 
flash connections, can be rtmp, rtmpt, rtmpe, rtmps");
                
                cfgDao.add(CONFIG_FLASH_PORT, "1935", null, "Port for flash 
connections");
+               cfgDao.add(CONFIG_CALENDAR_FIRST_DAY, "0", null, "The day that 
each week begins. The value must be a number that represents the day of the 
week. Sunday=0, Monday=1, Tuesday=2, etc.");
                
                log.debug("Configurations ADDED");
        }

Modified: 
openmeetings/trunk/singlewebapp/openmeetings-server/src/site/xdoc/GeneralConfiguration.xml
URL: 
http://svn.apache.org/viewvc/openmeetings/trunk/singlewebapp/openmeetings-server/src/site/xdoc/GeneralConfiguration.xml?rev=1632207&r1=1632206&r2=1632207&view=diff
==============================================================================
--- 
openmeetings/trunk/singlewebapp/openmeetings-server/src/site/xdoc/GeneralConfiguration.xml
 (original)
+++ 
openmeetings/trunk/singlewebapp/openmeetings-server/src/site/xdoc/GeneralConfiguration.xml
 Thu Oct 16 04:34:38 2014
@@ -207,6 +207,12 @@
                                        <td> Is remote control will be enabled 
while screensharing. Allowing remote control will be not possible in case it is 
set to 'false' (true/false). </td>
                                        <td> 3.0.4 </td>
                                </tr>
+                               <tr>
+                                       <td> calendar.firstday </td>
+                                       <td> 0 </td>
+                                       <td> The day that each week begins. The 
value must be a number that represents the day of the week. Sunday=0, Monday=1, 
Tuesday=2, etc. </td>
+                                       <td> 3.0.4 </td>
+                               </tr>
                        </table>
                </section>
 

Modified: 
openmeetings/trunk/singlewebapp/openmeetings-util/src/main/java/org/apache/openmeetings/util/OpenmeetingsVariables.java
URL: 
http://svn.apache.org/viewvc/openmeetings/trunk/singlewebapp/openmeetings-util/src/main/java/org/apache/openmeetings/util/OpenmeetingsVariables.java?rev=1632207&r1=1632206&r2=1632207&view=diff
==============================================================================
--- 
openmeetings/trunk/singlewebapp/openmeetings-util/src/main/java/org/apache/openmeetings/util/OpenmeetingsVariables.java
 (original)
+++ 
openmeetings/trunk/singlewebapp/openmeetings-util/src/main/java/org/apache/openmeetings/util/OpenmeetingsVariables.java
 Thu Oct 16 04:34:38 2014
@@ -43,6 +43,7 @@ public class OpenmeetingsVariables {
        public static final String CONFIG_SCREENSHARING_FPS = 
"default.fps.screensharing";
        public static final String CONFIG_SCREENSHARING_FPS_SHOW = 
"screensharing.fps.show";
        public static final String CONFIG_SCREENSHARING_ALLOW_REMOTE = 
"screensharing.allow.remote";
+       public static final String CONFIG_CALENDAR_FIRST_DAY = 
"calendar.firstday";
 
        public static int DEFAULT_MINUTES_REMINDER_SEND = 15;
        public static String DEFAULT_BASE_URL = 
"http://localhost:5080/openmeetings/";;

Modified: 
openmeetings/trunk/singlewebapp/openmeetings-web/src/main/java/org/apache/openmeetings/web/user/calendar/CalendarPanel.java
URL: 
http://svn.apache.org/viewvc/openmeetings/trunk/singlewebapp/openmeetings-web/src/main/java/org/apache/openmeetings/web/user/calendar/CalendarPanel.java?rev=1632207&r1=1632206&r2=1632207&view=diff
==============================================================================
--- 
openmeetings/trunk/singlewebapp/openmeetings-web/src/main/java/org/apache/openmeetings/web/user/calendar/CalendarPanel.java
 (original)
+++ 
openmeetings/trunk/singlewebapp/openmeetings-web/src/main/java/org/apache/openmeetings/web/user/calendar/CalendarPanel.java
 Thu Oct 16 04:34:38 2014
@@ -18,6 +18,7 @@
  */
 package org.apache.openmeetings.web.user.calendar;
 
+import static 
org.apache.openmeetings.util.OpenmeetingsVariables.CONFIG_CALENDAR_FIRST_DAY;
 import static org.apache.openmeetings.util.OpenmeetingsVariables.webAppRootKey;
 import static org.apache.openmeetings.web.app.Application.getBean;
 import static org.apache.openmeetings.web.app.WebSession.getClientTimeZone;
@@ -26,6 +27,7 @@ import static org.apache.openmeetings.we
 import java.text.SimpleDateFormat;
 import java.util.Date;
 
+import org.apache.openmeetings.db.dao.basic.ConfigurationDao;
 import org.apache.openmeetings.db.dao.calendar.AppointmentDao;
 import org.apache.openmeetings.db.dao.calendar.AppointmentReminderTypDao;
 import org.apache.openmeetings.db.dao.user.UserDao;
@@ -131,12 +133,12 @@ public class CalendarPanel extends UserP
                        // first week day must be Sunday
                        days.put(0, WebSession.getString(466));
                        shortDays.put(0, WebSession.getString(459));
-                       for (int i=0; i < 12; i++){
+                       for (int i = 0; i < 12; i++) {
                                monthes.put(i, WebSession.getString(469 + i));
                                shortMonthes.put(i, WebSession.getString(1556 + 
i));
-                               if (i+1 < 7){
-                                       days.put(i+1, WebSession.getString(460 
+ i));
-                                       shortDays.put(i+1, 
WebSession.getString(453 + i));                                      
+                               if (i + 1 < 7) {
+                                       days.put(i + 1, 
WebSession.getString(460 + i));
+                                       shortDays.put(i + 1, 
WebSession.getString(453 + i));
                                }
                        }
                } catch (JSONException e) {
@@ -146,6 +148,7 @@ public class CalendarPanel extends UserP
                options.set("monthNamesShort", shortMonthes.toString());
                options.set("dayNames", days.toString());
                options.set("dayNamesShort", shortDays.toString());
+               options.set("firstDay", 
getBean(ConfigurationDao.class).getConfValue(CONFIG_CALENDAR_FIRST_DAY, 
String.class, "0"));
                
                calendar = new Calendar("calendar", new AppointmentModel(), 
options) {
                        private static final long serialVersionUID = 1L;


Reply via email to