Commit 87e5ddbb authored by Côme Chilliet's avatar Côme Chilliet
Browse files

:sparkles: feat(argonaut): Using new TimeHiAttribute with UTC autoconversion

Time attributes were moved to core, and the new TimeHiAttribute is used.
Localtime should be entered in timeframes field.

issue #5700
Showing with 6 additions and 57 deletions
+6 -57
...@@ -18,51 +18,6 @@ ...@@ -18,51 +18,6 @@
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
*/ */
class TimeHisAttribute extends CompositeAttribute
{
function __construct($label, $description, $ldapName, $required, $acl = '')
{
$attributes = array(
new IntAttribute (
'', _('Hours'),
$ldapName.'_hours', TRUE,
0, 23, 1
),
new IntAttribute (
':', _('Minutes'),
$ldapName.'_minutes', TRUE,
0, 59, 0
),
new IntAttribute (
':', _('Seconds'),
$ldapName.'_seconds', TRUE,
0, 59, 0
)
);
parent::__construct($description, $ldapName, $attributes, '/^(\d\d)(\d\d)(\d\d)$/', '%02d%02d%02d', $acl, $label);
$this->setLinearRendering(TRUE);
}
}
class DateTimeAttribute extends CompositeAttribute
{
function __construct($label, $description, $ldapName, $required, $acl = '')
{
$attributes = array(
new DateAttribute(
_('Date'), '',
$ldapName.'_date', $required,
'Ymd'
),
new TimeHisAttribute(
_('Time'), '',
$ldapName.'_time', $required
)
);
parent::__construct($description, $ldapName, $attributes, '/^(\d{8})(\d{6})$/', '%s%s', $acl, $label);
}
}
class MacsAttribute extends GenericDialogAttribute class MacsAttribute extends GenericDialogAttribute
{ {
protected $dialogClass = 'SystemSelectDialog'; protected $dialogClass = 'SystemSelectDialog';
......
...@@ -48,19 +48,13 @@ class deploymentTimeframe extends simplePlugin ...@@ -48,19 +48,13 @@ class deploymentTimeframe extends simplePlugin
_('Time frames in which deployment is authorized'), _('Time frames in which deployment is authorized'),
'argonautDeploymentTimeframe', 'argonautDeploymentTimeframe',
array( array(
new StringAttribute ( new TimeHiAttribute (
_('Begin'), _('Opening time for this frame as HH:MM'), '', _('Opening time for this frame as HH:MM'),
'begin', TRUE, 'begin', TRUE
'', '',
'/^\d\d:\d\d$/',
'10:00'
), ),
new StringAttribute ( new TimeHiAttribute (
_('End'), _('Closing time for this frame as HH:MM'), _('->'), _('Closing time for this frame as HH:MM'),
'end', TRUE, 'end', TRUE
'', '',
'/^\d\d:\d\d$/',
'11:00'
) )
), ),
'-', '-',
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment