[tuxdroid-svn] r4958 - in software_suite_v3/smart-core/smart-server/trunk: data/web_interface/deve
Status: Beta
Brought to you by:
ks156
Author: remi
Date: 2009-07-01 12:03:54 +0200 (Wed, 01 Jul 2009)
New Revision: 4958
Modified:
software_suite_v3/smart-core/smart-server/trunk/data/web_interface/devel/xsl/alert.xsl
software_suite_v3/smart-core/smart-server/trunk/data/web_interface/devel/xsl/plugin_gadget_common.xsl
software_suite_v3/smart-core/smart-server/trunk/data/web_interface/user_01/xsl/alert.xsl
software_suite_v3/smart-core/smart-server/trunk/data/web_interface/user_01/xsl/gadget_configuration.xsl
software_suite_v3/smart-core/smart-server/trunk/translation/wi_user/default.pot
software_suite_v3/smart-core/smart-server/trunk/translation/wi_user/en.po
software_suite_v3/smart-core/smart-server/trunk/translation/wi_user/fr.po
software_suite_v3/smart-core/smart-server/trunk/util/applicationserver/gadget/Gadget.py
software_suite_v3/smart-core/smart-server/trunk/util/applicationserver/gadget/GadgetGenerator.py
software_suite_v3/smart-core/smart-server/trunk/util/applicationserver/plugin/Plugin.py
software_suite_v3/smart-core/smart-server/trunk/util/applicationserver/plugin/PluginTask.py
software_suite_v3/smart-core/smart-server/trunk/util/applicationserver/ugc/Ugc.py
Log:
* Added support of 2 new delay types for task/alerts ("Quart hours/Half hours/Full hours" and "Crazy/Often/Normal/Rarely")
* Added translations for these types
Modified: software_suite_v3/smart-core/smart-server/trunk/data/web_interface/devel/xsl/alert.xsl
===================================================================
--- software_suite_v3/smart-core/smart-server/trunk/data/web_interface/devel/xsl/alert.xsl 2009-07-01 09:46:35 UTC (rev 4957)
+++ software_suite_v3/smart-core/smart-server/trunk/data/web_interface/devel/xsl/alert.xsl 2009-07-01 10:03:54 UTC (rev 4958)
@@ -79,6 +79,70 @@
</xsl:if>
</xsl:template>
+ <!-- QUARTERS (15/30/60) SELECTER -->
+ <xsl:template name="quartersSelecter">
+ <xsl:param name="time"/>
+ <xsl:element name="select">
+ <xsl:attribute name="class">select</xsl:attribute>
+ <xsl:attribute name="id">req_task_<xsl:value-of select="name"/>_<xsl:value-of select="name($time)"/>_minute</xsl:attribute>
+ <xsl:element name="option">
+ <xsl:attribute name="value">15</xsl:attribute>
+ <xsl:if test="$time/minute = '15'">
+ <xsl:attribute name="selected">true</xsl:attribute>
+ </xsl:if>Quart hours
+ </xsl:element>
+ <xsl:element name="option">
+ <xsl:attribute name="value">30</xsl:attribute>
+ <xsl:if test="$time/minute = '30'">
+ <xsl:attribute name="selected">true</xsl:attribute>
+ </xsl:if>Half hours
+ </xsl:element>
+ <xsl:element name="option">
+ <xsl:attribute name="value">60</xsl:attribute>
+ <xsl:if test="$time/minute = '0'">
+ <xsl:if test="$time/hour = '1'">
+ <xsl:attribute name="selected">true</xsl:attribute>
+ </xsl:if>
+ </xsl:if>Full hours
+ </xsl:element>
+ </xsl:element>
+ </xsl:template>
+
+ <!-- FREQUENCY (CRAZY/OFTEN/NORMAL/RARELY) SELECTER -->
+ <xsl:template name="frequencySelecter">
+ <xsl:param name="time"/>
+ <xsl:element name="select">
+ <xsl:attribute name="class">select</xsl:attribute>
+ <xsl:attribute name="id">req_task_<xsl:value-of select="name"/>_<xsl:value-of select="name($time)"/>_minute</xsl:attribute>
+ <xsl:element name="option">
+ <xsl:attribute name="value">1</xsl:attribute>
+ <xsl:if test="$time/minute = '1'">
+ <xsl:attribute name="selected">true</xsl:attribute>
+ </xsl:if>Crazy
+ </xsl:element>
+ <xsl:element name="option">
+ <xsl:attribute name="value">5</xsl:attribute>
+ <xsl:if test="$time/minute = '5'">
+ <xsl:attribute name="selected">true</xsl:attribute>
+ </xsl:if>Often
+ </xsl:element>
+ <xsl:element name="option">
+ <xsl:attribute name="value">15</xsl:attribute>
+ <xsl:if test="$time/minute = '15'">
+ <xsl:attribute name="selected">true</xsl:attribute>
+ </xsl:if>Normal
+ </xsl:element>
+ <xsl:element name="option">
+ <xsl:attribute name="value">60</xsl:attribute>
+ <xsl:if test="$time/minute = '0'">
+ <xsl:if test="$time/hour = '1'">
+ <xsl:attribute name="selected">true</xsl:attribute>
+ </xsl:if>
+ </xsl:if>Rarely
+ </xsl:element>
+ </xsl:element>
+ </xsl:template>
+
<!-- TIME SELECTER -->
<xsl:template name="timeSelecter">
<xsl:param name="time"/>
@@ -248,7 +312,7 @@
<xsl:attribute name="id">req_task_<xsl:value-of select="name"/>_weekMask_weekpart</xsl:attribute>
<xsl:attribute name="name">week</xsl:attribute>
<xsl:attribute name="value">1</xsl:attribute>
- </xsl:element> Only weeks
+ </xsl:element> Working days
<xsl:element name="br"></xsl:element>
<xsl:element name="input">
<xsl:attribute name="type">radio</xsl:attribute>
@@ -256,7 +320,7 @@
<xsl:attribute name="id">req_task_<xsl:value-of select="name"/>_weekMask_weekpart</xsl:attribute>
<xsl:attribute name="name">week</xsl:attribute>
<xsl:attribute name="value">2</xsl:attribute>
- </xsl:element> Only week-end
+ </xsl:element> Weekend
</xsl:if>
<!-- Week mask type is 'exclusive' show selecter -->
<xsl:if test="$type = 'exclusive'">
Modified: software_suite_v3/smart-core/smart-server/trunk/data/web_interface/devel/xsl/plugin_gadget_common.xsl
===================================================================
--- software_suite_v3/smart-core/smart-server/trunk/data/web_interface/devel/xsl/plugin_gadget_common.xsl 2009-07-01 09:46:35 UTC (rev 4957)
+++ software_suite_v3/smart-core/smart-server/trunk/data/web_interface/devel/xsl/plugin_gadget_common.xsl 2009-07-01 10:03:54 UTC (rev 4958)
@@ -416,7 +416,7 @@
<xsl:for-each select="tasks/*">
<div class="sectionElementDescBox">
<xsl:if test="$onlyShow = 'false'">
-
+
<xsl:if test="$selectVisible = 'true'">
<xsl:element name="input">
<xsl:attribute name="class">checkbox</xsl:attribute>
@@ -473,7 +473,7 @@
<xsl:attribute name="id">req_param_<xsl:value-of select="name"/>_visible</xsl:attribute>
<xsl:attribute name="value">true</xsl:attribute>
</xsl:element>
-
+
<div class="sectionContentCol12">
<span class="sectionContentPName">
<xsl:value-of select="description"/>
@@ -541,15 +541,27 @@
<div class="sectionContentRowBox">
<div class="sectionContentCol12">
<span class="sectionContentPName">
- Delay
+ Frequency
</span>
</div>
<div class="sectionContentCol22">
<span class="sectionContentPName">
- <xsl:call-template name="timeSelecter">
- <xsl:with-param name="time" select='delay' />
- <xsl:with-param name="mask" select='delayMask' />
- </xsl:call-template>
+ <xsl:if test="delayType = 'hms'">
+ <xsl:call-template name="timeSelecter">
+ <xsl:with-param name="time" select='delay' />
+ <xsl:with-param name="mask" select='delayMask' />
+ </xsl:call-template>
+ </xsl:if>
+ <xsl:if test="delayType = 'quarters'">
+ <xsl:call-template name="quartersSelecter">
+ <xsl:with-param name="time" select='delay' />
+ </xsl:call-template>
+ </xsl:if>
+ <xsl:if test="delayType = 'frequency'">
+ <xsl:call-template name="frequencySelecter">
+ <xsl:with-param name="time" select='delay' />
+ </xsl:call-template>
+ </xsl:if>
</span>
</div>
</div>
Modified: software_suite_v3/smart-core/smart-server/trunk/data/web_interface/user_01/xsl/alert.xsl
===================================================================
--- software_suite_v3/smart-core/smart-server/trunk/data/web_interface/user_01/xsl/alert.xsl 2009-07-01 09:46:35 UTC (rev 4957)
+++ software_suite_v3/smart-core/smart-server/trunk/data/web_interface/user_01/xsl/alert.xsl 2009-07-01 10:03:54 UTC (rev 4958)
@@ -79,6 +79,70 @@
</xsl:if>
</xsl:template>
+ <!-- QUARTERS (15/30/60) SELECTER -->
+ <xsl:template name="quartersSelecter">
+ <xsl:param name="time"/>
+ <xsl:element name="select">
+ <xsl:attribute name="class">select</xsl:attribute>
+ <xsl:attribute name="id">req_task_<xsl:value-of select="name"/>_<xsl:value-of select="name($time)"/>_minute</xsl:attribute>
+ <xsl:element name="option">
+ <xsl:attribute name="value">15</xsl:attribute>
+ <xsl:if test="$time/minute = '15'">
+ <xsl:attribute name="selected">true</xsl:attribute>
+ </xsl:if><xsl:value-of select="../../../translations/quart_hours"/>
+ </xsl:element>
+ <xsl:element name="option">
+ <xsl:attribute name="value">30</xsl:attribute>
+ <xsl:if test="$time/minute = '30'">
+ <xsl:attribute name="selected">true</xsl:attribute>
+ </xsl:if><xsl:value-of select="../../../translations/half_hours"/>
+ </xsl:element>
+ <xsl:element name="option">
+ <xsl:attribute name="value">60</xsl:attribute>
+ <xsl:if test="$time/minute = '0'">
+ <xsl:if test="$time/hour = '1'">
+ <xsl:attribute name="selected">true</xsl:attribute>
+ </xsl:if>
+ </xsl:if><xsl:value-of select="../../../translations/full_hours"/>
+ </xsl:element>
+ </xsl:element>
+ </xsl:template>
+
+ <!-- FREQUENCY (CRAZY/OFTEN/NORMAL/RARELY) SELECTER -->
+ <xsl:template name="quartersSelecter">
+ <xsl:param name="time"/>
+ <xsl:element name="select">
+ <xsl:attribute name="class">select</xsl:attribute>
+ <xsl:attribute name="id">req_task_<xsl:value-of select="name"/>_<xsl:value-of select="name($time)"/>_minute</xsl:attribute>
+ <xsl:element name="option">
+ <xsl:attribute name="value">1</xsl:attribute>
+ <xsl:if test="$time/minute = '1'">
+ <xsl:attribute name="selected">true</xsl:attribute>
+ </xsl:if><xsl:value-of select="../../../translations/crazy"/>
+ </xsl:element>
+ <xsl:element name="option">
+ <xsl:attribute name="value">5</xsl:attribute>
+ <xsl:if test="$time/minute = '5'">
+ <xsl:attribute name="selected">true</xsl:attribute>
+ </xsl:if><xsl:value-of select="../../../translations/often"/>
+ </xsl:element>
+ <xsl:element name="option">
+ <xsl:attribute name="value">15</xsl:attribute>
+ <xsl:if test="$time/minute = '15'">
+ <xsl:attribute name="selected">true</xsl:attribute>
+ </xsl:if><xsl:value-of select="../../../translations/normal"/>
+ </xsl:element>
+ <xsl:element name="option">
+ <xsl:attribute name="value">60</xsl:attribute>
+ <xsl:if test="$time/minute = '0'">
+ <xsl:if test="$time/hour = '1'">
+ <xsl:attribute name="selected">true</xsl:attribute>
+ </xsl:if>
+ </xsl:if><xsl:value-of select="../../../translations/rarely"/>
+ </xsl:element>
+ </xsl:element>
+ </xsl:template>
+
<!-- TIME SELECTER -->
<xsl:template name="timeSelecter">
<xsl:param name="time"/>
Modified: software_suite_v3/smart-core/smart-server/trunk/data/web_interface/user_01/xsl/gadget_configuration.xsl
===================================================================
--- software_suite_v3/smart-core/smart-server/trunk/data/web_interface/user_01/xsl/gadget_configuration.xsl 2009-07-01 09:46:35 UTC (rev 4957)
+++ software_suite_v3/smart-core/smart-server/trunk/data/web_interface/user_01/xsl/gadget_configuration.xsl 2009-07-01 10:03:54 UTC (rev 4958)
@@ -234,10 +234,22 @@
<xsl:value-of select="../../../translations/delay"/>
</span>
<span class="gadgetConfParamValue">
- <xsl:call-template name="timeSelecter">
- <xsl:with-param name="time" select='delay' />
- <xsl:with-param name="mask" select='delayMask' />
- </xsl:call-template>
+ <xsl:if test="delayType = 'hms'">
+ <xsl:call-template name="timeSelecter">
+ <xsl:with-param name="time" select='delay' />
+ <xsl:with-param name="mask" select='delayMask' />
+ </xsl:call-template>
+ </xsl:if>
+ <xsl:if test="delayType = 'quarters'">
+ <xsl:call-template name="quartersSelecter">
+ <xsl:with-param name="time" select='delay' />
+ </xsl:call-template>
+ </xsl:if>
+ <xsl:if test="delayType = 'frequency'">
+ <xsl:call-template name="frequencySelecter">
+ <xsl:with-param name="time" select='delay' />
+ </xsl:call-template>
+ </xsl:if>
</span>
<xsl:if test="weekMaskVisible='True'">
<div class="gadgetConfContentFrameSep"></div>
Modified: software_suite_v3/smart-core/smart-server/trunk/translation/wi_user/default.pot
===================================================================
--- software_suite_v3/smart-core/smart-server/trunk/translation/wi_user/default.pot 2009-07-01 09:46:35 UTC (rev 4957)
+++ software_suite_v3/smart-core/smart-server/trunk/translation/wi_user/default.pot 2009-07-01 10:03:54 UTC (rev 4958)
@@ -117,3 +117,25 @@
msgid "sunday"
msgstr ""
+
+msgid "quart_hours"
+msgstr ""
+
+msgid "half_hours"
+msgstr ""
+
+msgid "full_hours"
+msgstr ""
+
+msgid "crazy"
+msgstr ""
+
+msgid "often"
+msgstr ""
+
+msgid "normal"
+msgstr ""
+
+msgid "rarely"
+msgstr ""
+
Modified: software_suite_v3/smart-core/smart-server/trunk/translation/wi_user/en.po
===================================================================
--- software_suite_v3/smart-core/smart-server/trunk/translation/wi_user/en.po 2009-07-01 09:46:35 UTC (rev 4957)
+++ software_suite_v3/smart-core/smart-server/trunk/translation/wi_user/en.po 2009-07-01 10:03:54 UTC (rev 4958)
@@ -83,7 +83,7 @@
msgstr "Stopping at"
msgid "delay"
-msgstr "Delay"
+msgstr "Frequency"
msgid "my_week"
msgstr "My week"
@@ -117,3 +117,24 @@
msgid "sunday"
msgstr "Sunday"
+
+msgid "quart_hours"
+msgstr "Quart hours"
+
+msgid "half_hours"
+msgstr "Half hours"
+
+msgid "full_hours"
+msgstr "Full hours"
+
+msgid "crazy"
+msgstr "Crazy"
+
+msgid "often"
+msgstr "Often"
+
+msgid "normal"
+msgstr "Normal"
+
+msgid "rarely"
+msgstr "Rarely"
Modified: software_suite_v3/smart-core/smart-server/trunk/translation/wi_user/fr.po
===================================================================
--- software_suite_v3/smart-core/smart-server/trunk/translation/wi_user/fr.po 2009-07-01 09:46:35 UTC (rev 4957)
+++ software_suite_v3/smart-core/smart-server/trunk/translation/wi_user/fr.po 2009-07-01 10:03:54 UTC (rev 4958)
@@ -83,7 +83,7 @@
msgstr "Stopper à"
msgid "delay"
-msgstr "Délai"
+msgstr "Fréquence"
msgid "my_week"
msgstr "Ma semaine"
@@ -117,3 +117,24 @@
msgid "sunday"
msgstr "Dimanche"
+
+msgid "quart_hours"
+msgstr "Quart d'heures"
+
+msgid "half_hours"
+msgstr "Demi-heures"
+
+msgid "full_hours"
+msgstr "Heures pleines"
+
+msgid "crazy"
+msgstr "Fou"
+
+msgid "often"
+msgstr "Souvent"
+
+msgid "normal"
+msgstr "Normal"
+
+msgid "rarely"
+msgstr "Rarement"
Modified: software_suite_v3/smart-core/smart-server/trunk/util/applicationserver/gadget/Gadget.py
===================================================================
--- software_suite_v3/smart-core/smart-server/trunk/util/applicationserver/gadget/Gadget.py 2009-07-01 09:46:35 UTC (rev 4957)
+++ software_suite_v3/smart-core/smart-server/trunk/util/applicationserver/gadget/Gadget.py 2009-07-01 10:03:54 UTC (rev 4958)
@@ -212,6 +212,7 @@
data['tasks'][nodeName]['hoursEndMask'] = task.getTimeMaskDict(task.getHoursEndMask())
data['tasks'][nodeName]['hoursEndVisible'] = task.getHoursEndIsVisible()
data['tasks'][nodeName]['delay'] = task.getTimeDict(task.getDelay())
+ data['tasks'][nodeName]['delayType'] = task.getDelayType()
data['tasks'][nodeName]['delayMask'] = task.getTimeMaskDict(task.getDelayMask())
data['tasks'][nodeName]['delayVisible'] = task.getDelayIsVisible()
data['tasks'][nodeName]['parameters'] = {}
Modified: software_suite_v3/smart-core/smart-server/trunk/util/applicationserver/gadget/GadgetGenerator.py
===================================================================
--- software_suite_v3/smart-core/smart-server/trunk/util/applicationserver/gadget/GadgetGenerator.py 2009-07-01 09:46:35 UTC (rev 4957)
+++ software_suite_v3/smart-core/smart-server/trunk/util/applicationserver/gadget/GadgetGenerator.py 2009-07-01 10:03:54 UTC (rev 4958)
@@ -266,7 +266,12 @@
else:
delay['hour'] = originalDelay['hour']
if taskData['delay'].has_key('minute'):
- delay['minute'] = taskData['delay']['minute']
+ minutesInt = int(taskData['delay']['minute'])
+ if minutesInt >= 60:
+ delay['hour'] = "%.2d" % int(minutesInt / 60)
+ delay['minute'] = "%.2d" % int(minutesInt % 60)
+ else:
+ delay['minute'] = taskData['delay']['minute']
else:
delay['minute'] = originalDelay['minute']
if taskData['delay'].has_key('second'):
Modified: software_suite_v3/smart-core/smart-server/trunk/util/applicationserver/plugin/Plugin.py
===================================================================
--- software_suite_v3/smart-core/smart-server/trunk/util/applicationserver/plugin/Plugin.py 2009-07-01 09:46:35 UTC (rev 4957)
+++ software_suite_v3/smart-core/smart-server/trunk/util/applicationserver/plugin/Plugin.py 2009-07-01 10:03:54 UTC (rev 4958)
@@ -281,6 +281,7 @@
data['tasks'][nodeName]['hoursEndMask'] = task.getTimeMaskDict(task.getHoursEndMask())
data['tasks'][nodeName]['hoursEndVisible'] = task.getHoursEndIsVisible()
data['tasks'][nodeName]['delay'] = task.getTimeDict(task.getDelay())
+ data['tasks'][nodeName]['delayType'] = task.getDelayType()
data['tasks'][nodeName]['delayMask'] = task.getTimeMaskDict(task.getDelayMask())
data['tasks'][nodeName]['delayVisible'] = task.getDelayIsVisible()
data['tasks'][nodeName]['parameters'] = {}
Modified: software_suite_v3/smart-core/smart-server/trunk/util/applicationserver/plugin/PluginTask.py
===================================================================
--- software_suite_v3/smart-core/smart-server/trunk/util/applicationserver/plugin/PluginTask.py 2009-07-01 09:46:35 UTC (rev 4957)
+++ software_suite_v3/smart-core/smart-server/trunk/util/applicationserver/plugin/PluginTask.py 2009-07-01 10:03:54 UTC (rev 4958)
@@ -37,6 +37,7 @@
self.__hoursEndMask = None
self.__hoursEndVisible = None
self.__delay = None
+ self.__delayType = None
self.__delayMask = None
self.__delayVisible = None
self.__update(dictionary)
@@ -102,6 +103,9 @@
self.__delay = "00:01:00"
if dictionary.has_key('delay'):
self.__delay = dictionary['delay']
+ self.__delayType = "hms"
+ if dictionary.has_key('delayType'):
+ self.__delayType = dictionary['delayType']
self.__delayMask = "false,false,false"
if dictionary.has_key('delayMask'):
self.__delayMask = dictionary['delayMask'].lower()
@@ -398,6 +402,15 @@
return self.__delay
# --------------------------------------------------------------------------
+ # Get the delay type.
+ # --------------------------------------------------------------------------
+ def getDelayType(self):
+ """Get the delay type.
+ @return: A string "hms|quarters|frequency".
+ """
+ return self.__delayType
+
+ # --------------------------------------------------------------------------
# Get the delay mask.
# --------------------------------------------------------------------------
def getDelayMask(self):
Modified: software_suite_v3/smart-core/smart-server/trunk/util/applicationserver/ugc/Ugc.py
===================================================================
--- software_suite_v3/smart-core/smart-server/trunk/util/applicationserver/ugc/Ugc.py 2009-07-01 09:46:35 UTC (rev 4957)
+++ software_suite_v3/smart-core/smart-server/trunk/util/applicationserver/ugc/Ugc.py 2009-07-01 10:03:54 UTC (rev 4958)
@@ -189,6 +189,7 @@
data['tasks'][nodeName]['delay'] = task.getTimeDict(task.getDelay())
else:
data['tasks'][nodeName]['delay'] = parentTask.getTimeDict(parentTask.getDelay())
+ data['tasks'][nodeName]['delayType'] = parentTask.getDelayType()
data['tasks'][nodeName]['delayMask'] = parentTask.getTimeMaskDict(parentTask.getDelayMask())
data['tasks'][nodeName]['delayVisible'] = parentTask.getDelayIsVisible()
data['tasks'][nodeName]['parameters'] = {}
|