Commit 43e5b660 authored by Marius Cramer's avatar Marius Cramer
Browse files

- replaced date time selects by textbox with datepicker

parent b2f827b0
......@@ -255,9 +255,13 @@ class tform extends tform_base {
if ($display_seconds === true) {
$dselect[] = 'second';
}
$tmp_dt = strtr($this->datetimeformat,array('d' => 'dd', 'm' => 'mm', 'Y' => 'yyyy', 'y' => 'yy', 'H' => 'hh', 'h' => 'HH', 'i' => 'ii')) . ($display_seconds ? ':ss' : '');
$out = '';
return '<input type="text" class="form-control" name="' . $form_element . '" value="' . ($_showdate ? date($this->datetimeformat . ($display_seconds ? ':s' : ''), $_datetime) : '') . '" data-input-element="datetime" data-date-format="' . $tmp_dt . '" />';
/*
foreach ($dselect as $dt_element)
{
$dt_options = array();
......@@ -318,7 +322,7 @@ class tform extends tform_base {
$selected_value = (int)floor(date('s', $_datetime));
break;
}
$out .= "<select name=\"".$form_element."[$dt_element]\" id=\"".$form_element."_$dt_element\" class=\"selectInput\" style=\"width: auto; float: none;\">";
if (!$_showdate) {
$out .= "<option value=\"-\" selected=\"selected\">--</option>" . PHP_EOL;
......@@ -337,7 +341,7 @@ class tform extends tform_base {
$out .= '</select>' . str_repeat('&nbsp;', $dt_space);
}
return $out;
return $out;*/
}
}
......
......@@ -98,6 +98,7 @@ class tform_base {
var $errorMessage = '';
var $dateformat = "d.m.Y";
var $datetimeformat = 'd.m.Y H:i';
var $formDef = array();
var $wordbook;
var $module;
......@@ -153,6 +154,7 @@ class tform_base {
$this->wordbook = $wb;
$this->dateformat = $app->lng('conf_format_dateshort');
$this->datetimeformat = $app->lng('conf_format_datetime');
return true;
}
......@@ -708,13 +710,8 @@ class tform_base {
if($record[$key] != '' && $record[$key] != '0000-00-00') {
if(function_exists('date_parse_from_format')) {
$date_parts = date_parse_from_format($this->dateformat, $record[$key]);
//list($tag,$monat,$jahr) = explode('.',$record[$key]);
$new_record[$key] = $date_parts['year'].'-'.$date_parts['month'].'-'.$date_parts['day'];
//$tmp = strptime($record[$key],$this->dateformat);
//$new_record[$key] = ($tmp['tm_year']+1900).'-'.($tmp['tm_mon']+1).'-'.$tmp['tm_mday'];
} else {
//$tmp = strptime($record[$key],$this->dateformat);
//$new_record[$key] = ($tmp['tm_year']+1900).'-'.($tmp['tm_mon']+1).'-'.$tmp['tm_mday'];
$tmp = strtotime($record[$key]);
$new_record[$key] = date('Y-m-d', $tmp);
}
......@@ -724,8 +721,6 @@ class tform_base {
break;
case 'INTEGER':
$new_record[$key] = (isset($record[$key]))?$app->functions->intval($record[$key]):0;
//if($new_record[$key] != $record[$key]) $new_record[$key] = $field['default'];
//if($key == 'refresh') die($record[$key]);
break;
case 'DOUBLE':
$new_record[$key] = $record[$key];
......@@ -735,7 +730,7 @@ class tform_base {
break;
case 'DATETIME':
if (is_array($record[$key]))
/*if (is_array($record[$key]))
{
$filtered_values = array_map(create_function('$item', 'return (int)$item;'), $record[$key]);
extract($filtered_values, EXTR_PREFIX_ALL, '_dt');
......@@ -743,7 +738,14 @@ class tform_base {
if ($_dt_day != 0 && $_dt_month != 0 && $_dt_year != 0) {
$new_record[$key] = date( 'Y-m-d H:i:s', mktime($_dt_hour, $_dt_minute, $_dt_second, $_dt_month, $_dt_day, $_dt_year) );
}
}
} else {*/
if($record[$key] != '' && $record[$key] != '0000-00-00 00:00:00') {
$tmp = strtotime($record[$key]);
$new_record[$key] = date($this->datetimeformat, $tmp);
} else {
$new_record[$key] = '0000-00-00 00:00:00';
}
/*}*/
break;
}
......
jQuery.fn.uniform = function(settings) {
settings = jQuery.extend({
valid_class : 'valid',
invalid_class : 'invalid',
focused_class : 'focused',
holder_class : 'ctrlHolder',
field_selector : 'input, select, textarea'
}, settings);
return this.each(function() {
var form = jQuery(this);
// Focus specific control holder
var focusControlHolder = function(element) {
var parent = element.parent();
while(typeof(parent) == 'object') {
if(parent) {
if(parent[0] && (parent[0].className.indexOf(settings.holder_class) >= 0)) {
parent.addClass(settings.focused_class);
return;
} // if
} // if
parent = jQuery(parent.parent());
} // while
};
// Select form fields and attach them higlighter functionality
form.find(settings.field_selector).focus(function() {
form.find('.' + settings.focused_class).removeClass(settings.focused_class);
focusControlHolder(jQuery(this));
}).blur(function() {
form.find('.' + settings.focused_class).removeClass(settings.focused_class);
});
});
};
// Auto set on page load...
$(document).ready(function() {
jQuery('form.uniForm').uniform();
});
function AR_ResetDates()
{
if ($("#autoresponder:checked").val() == null) {
$("form.uniForm select").each(
function(){
$(this).val( $("#" + $(this).attr("id") + " option:first").val() );
}
);
}
}
function AR_SetNow()
{
DateTime_SetValues('autoresponder_start_date');
now = new Date();
end_date = new Date(now.getFullYear(), now.getMonth(), now.getDate()+2, 0, 0);
DateTime_SetValues('autoresponder_end_date', end_date);
}
function DateTime_SetValues(datetime_id, date_obj)
{
var selects = ['day', 'month', 'year', 'hour', 'minute', 'second'];
if ( (typeof(date_obj) == 'object') && (typeof(date_obj.getDate()) == 'number') ) {
var now = date_obj;
} else {
var now = new Date();
}
jQuery.each(selects, function() {
var unit_name = this.toString();
var unit_value = '';
switch(unit_name)
{
case 'day':
unit_value = now.getDate();
break;
case 'month':
unit_value = now.getMonth() + 1;
if(unit_value < 10) unit_value = '0'+unit_value;
break;
case 'year':
unit_value = now.getFullYear();
break;
case 'hour':
unit_value = now.getHours();
break;
case 'minute':
unit_value = Math.round(parseInt(now.getMinutes())/5)*5;
break;
case 'second':
unit_value = now.getSeconds();
break;
}
unit_obj = $("#"+ datetime_id + "_" + unit_name);
if (unit_obj.val() !== null) {
unit_obj.val(unit_value);
unit_obj.change();
}
});
}
\ No newline at end of file
......@@ -16,27 +16,27 @@
<div class="col-sm-9"><input type="text" name="dir" id="dir" value="{tmpl_var name='dir'}" class="form-control" /></div></div>
<div class="form-group">
<label for="quota_files" class="col-sm-3 control-label">{tmpl_var name='quota_files_txt'}</label>
<div class="col-sm-9"><input type="text" name="quota_files" id="quota_files" value="{tmpl_var name='quota_files'}" class="form-control" /></div><label class="col-sm-3 control-label">{tmpl_var name='quota_files_unity_txt'}</label>
<div class="col-sm-8"><input type="text" name="quota_files" id="quota_files" value="{tmpl_var name='quota_files'}" class="form-control" /></div><div class="col-sm-1">{tmpl_var name='quota_files_unity_txt'}</div>
</div>
<div class="form-group">
<label for="ul_ratio" class="col-sm-3 control-label">{tmpl_var name='ul_ratio_txt'}</label>
<div class="col-sm-9"><input type="text" name="ul_ratio" id="ul_ratio" value="{tmpl_var name='ul_ratio'}" class="form-control" /></div><label class="col-sm-3 control-label"></label>
<div class="col-sm-8"><input type="text" name="ul_ratio" id="ul_ratio" value="{tmpl_var name='ul_ratio'}" class="form-control" /></div><div class="col-sm-1"></div>
</div>
<div class="form-group">
<label for="dl_ratio" class="col-sm-3 control-label">{tmpl_var name='dl_ratio_txt'}</label>
<div class="col-sm-9"><input type="text" name="dl_ratio" id="dl_ratio" value="{tmpl_var name='dl_ratio'}" class="form-control" /></div><label class="col-sm-3 control-label"></label>
<div class="col-sm-8"><input type="text" name="dl_ratio" id="dl_ratio" value="{tmpl_var name='dl_ratio'}" class="form-control" /></div><div class="col-sm-1"></div>
</div>
<div class="form-group">
<label for="ul_bandwidth" class="col-sm-3 control-label">{tmpl_var name='ul_bandwidth_txt'}</label>
<div class="col-sm-9"><input type="text" name="ul_bandwidth" id="ul_bandwidth" value="{tmpl_var name='ul_bandwidth'}" class="form-control" /></div><label class="col-sm-3 control-label">kb/s</label>
<div class="col-sm-8"><input type="text" name="ul_bandwidth" id="ul_bandwidth" value="{tmpl_var name='ul_bandwidth'}" class="form-control" /></div><div class="col-sm-1">kb/s</div>
</div>
<div class="form-group">
<label for="dl_bandwidth" class="col-sm-3 control-label">{tmpl_var name='dl_bandwidth_txt'}</label>
<div class="col-sm-9"><input type="text" name="dl_bandwidth" id="dl_bandwidth" value="{tmpl_var name='dl_bandwidth'}" class="form-control" /></div><label class="col-sm-3 control-label">kb/s</label>
<div class="col-sm-8"><input type="text" name="dl_bandwidth" id="dl_bandwidth" value="{tmpl_var name='dl_bandwidth'}" class="form-control" /></div><div class="col-sm-1">kb/s</div>
</div>
<div class="form-group">
<label for="expires" class="col-sm-3 control-label">{tmpl_var name='expires_txt'}</label>
{tmpl_var name='expires'}
<div class="col-sm-9">{tmpl_var name='expires'}</div>
</div>
......
......@@ -10,7 +10,7 @@
<div class="col-sm-9"><input type="text" name="dir" id="dir" value="{tmpl_var name='dir'}" class="form-control" /></div></div>
<div class="form-group">
<label for="expires" class="col-sm-3 control-label">{tmpl_var name='expires_txt'}</label>
{tmpl_var name='expires'}
<div class="col-sm-9">{tmpl_var name='expires'}</div>
</div>
......
......@@ -121,6 +121,24 @@ var ISPConfig = {
});
}
$('input[data-input-element="date"]').datetimepicker({
'language': 'en', // TODO
'todayHighlight': true,
'todayBtn': 'linked',
'bootcssVer': 3,
'fontAwesome': true,
'autoclose': true,
'minView': 'month'
});
$('input[data-input-element="datetime"]').datetimepicker({
'language': 'en', // TODO
'todayHighlight': true,
'todayBtn': 'linked',
'bootcssVer': 3,
'fontAwesome': true,
'autoclose': true
});
ISPConfig.callHook('onAfterContentLoad', {'url': url, 'data': data });
},
......
/*!
* Datetimepicker for Bootstrap
*
* Copyright 2012 Stefan Petre
* Improvements by Andrew Rowls
* Licensed under the Apache License v2.0
* http://www.apache.org/licenses/LICENSE-2.0
*
*/.datetimepicker{padding:4px;margin-top:1px;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;direction:ltr}.datetimepicker-inline{width:220px}.datetimepicker.datetimepicker-rtl{direction:rtl}.datetimepicker.datetimepicker-rtl table tr td span{float:right}.datetimepicker-dropdown,.datetimepicker-dropdown-left{top:0;left:0}[class*=" datetimepicker-dropdown"]:before{content:'';display:inline-block;border-left:7px solid transparent;border-right:7px solid transparent;border-bottom:7px solid #ccc;border-bottom-color:rgba(0,0,0,0.2);position:absolute}[class*=" datetimepicker-dropdown"]:after{content:'';display:inline-block;border-left:6px solid transparent;border-right:6px solid transparent;border-bottom:6px solid #fff;position:absolute}[class*=" datetimepicker-dropdown-top"]:before{content:'';display:inline-block;border-left:7px solid transparent;border-right:7px solid transparent;border-top:7px solid #ccc;border-top-color:rgba(0,0,0,0.2);border-bottom:0}[class*=" datetimepicker-dropdown-top"]:after{content:'';display:inline-block;border-left:6px solid transparent;border-right:6px solid transparent;border-top:6px solid #fff;border-bottom:0}.datetimepicker-dropdown-bottom-left:before{top:-7px;right:6px}.datetimepicker-dropdown-bottom-left:after{top:-6px;right:7px}.datetimepicker-dropdown-bottom-right:before{top:-7px;left:6px}.datetimepicker-dropdown-bottom-right:after{top:-6px;left:7px}.datetimepicker-dropdown-top-left:before{bottom:-7px;right:6px}.datetimepicker-dropdown-top-left:after{bottom:-6px;right:7px}.datetimepicker-dropdown-top-right:before{bottom:-7px;left:6px}.datetimepicker-dropdown-top-right:after{bottom:-6px;left:7px}.datetimepicker>div{display:none}.datetimepicker.minutes div.datetimepicker-minutes{display:block}.datetimepicker.hours div.datetimepicker-hours{display:block}.datetimepicker.days div.datetimepicker-days{display:block}.datetimepicker.months div.datetimepicker-months{display:block}.datetimepicker.years div.datetimepicker-years{display:block}.datetimepicker table{margin:0}.datetimepicker td,.datetimepicker th{text-align:center;width:20px;height:20px;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;border:0}.table-striped .datetimepicker table tr td,.table-striped .datetimepicker table tr th{background-color:transparent}.datetimepicker table tr td.minute:hover{background:#eee;cursor:pointer}.datetimepicker table tr td.hour:hover{background:#eee;cursor:pointer}.datetimepicker table tr td.day:hover{background:#eee;cursor:pointer}.datetimepicker table tr td.old,.datetimepicker table tr td.new{color:#999}.datetimepicker table tr td.disabled,.datetimepicker table tr td.disabled:hover{background:0;color:#999;cursor:default}.datetimepicker table tr td.today,.datetimepicker table tr td.today:hover,.datetimepicker table tr td.today.disabled,.datetimepicker table tr td.today.disabled:hover{background-color:#fde19a;background-image:-moz-linear-gradient(top,#fdd49a,#fdf59a);background-image:-ms-linear-gradient(top,#fdd49a,#fdf59a);background-image:-webkit-gradient(linear,0 0,0 100%,from(#fdd49a),to(#fdf59a));background-image:-webkit-linear-gradient(top,#fdd49a,#fdf59a);background-image:-o-linear-gradient(top,#fdd49a,#fdf59a);background-image:linear-gradient(top,#fdd49a,#fdf59a);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fdd49a',endColorstr='#fdf59a',GradientType=0);border-color:#fdf59a #fdf59a #fbed50;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25);filter:progid:DXImageTransform.Microsoft.gradient(enabled=false)}.datetimepicker table tr td.today:hover,.datetimepicker table tr td.today:hover:hover,.datetimepicker table tr td.today.disabled:hover,.datetimepicker table tr td.today.disabled:hover:hover,.datetimepicker table tr td.today:active,.datetimepicker table tr td.today:hover:active,.datetimepicker table tr td.today.disabled:active,.datetimepicker table tr td.today.disabled:hover:active,.datetimepicker table tr td.today.active,.datetimepicker table tr td.today:hover.active,.datetimepicker table tr td.today.disabled.active,.datetimepicker table tr td.today.disabled:hover.active,.datetimepicker table tr td.today.disabled,.datetimepicker table tr td.today:hover.disabled,.datetimepicker table tr td.today.disabled.disabled,.datetimepicker table tr td.today.disabled:hover.disabled,.datetimepicker table tr td.today[disabled],.datetimepicker table tr td.today:hover[disabled],.datetimepicker table tr td.today.disabled[disabled],.datetimepicker table tr td.today.disabled:hover[disabled]{background-color:#fdf59a}.datetimepicker table tr td.today:active,.datetimepicker table tr td.today:hover:active,.datetimepicker table tr td.today.disabled:active,.datetimepicker table tr td.today.disabled:hover:active,.datetimepicker table tr td.today.active,.datetimepicker table tr td.today:hover.active,.datetimepicker table tr td.today.disabled.active,.datetimepicker table tr td.today.disabled:hover.active{background-color:#fbf069}.datetimepicker table tr td.active,.datetimepicker table tr td.active:hover,.datetimepicker table tr td.active.disabled,.datetimepicker table tr td.active.disabled:hover{background-color:#006dcc;background-image:-moz-linear-gradient(top,#08c,#04c);background-image:-ms-linear-gradient(top,#08c,#04c);background-image:-webkit-gradient(linear,0 0,0 100%,from(#08c),to(#04c));background-image:-webkit-linear-gradient(top,#08c,#04c);background-image:-o-linear-gradient(top,#08c,#04c);background-image:linear-gradient(top,#08c,#04c);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#0088cc',endColorstr='#0044cc',GradientType=0);border-color:#04c #04c #002a80;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25);filter:progid:DXImageTransform.Microsoft.gradient(enabled=false);color:#fff;text-shadow:0 -1px 0 rgba(0,0,0,0.25)}.datetimepicker table tr td.active:hover,.datetimepicker table tr td.active:hover:hover,.datetimepicker table tr td.active.disabled:hover,.datetimepicker table tr td.active.disabled:hover:hover,.datetimepicker table tr td.active:active,.datetimepicker table tr td.active:hover:active,.datetimepicker table tr td.active.disabled:active,.datetimepicker table tr td.active.disabled:hover:active,.datetimepicker table tr td.active.active,.datetimepicker table tr td.active:hover.active,.datetimepicker table tr td.active.disabled.active,.datetimepicker table tr td.active.disabled:hover.active,.datetimepicker table tr td.active.disabled,.datetimepicker table tr td.active:hover.disabled,.datetimepicker table tr td.active.disabled.disabled,.datetimepicker table tr td.active.disabled:hover.disabled,.datetimepicker table tr td.active[disabled],.datetimepicker table tr td.active:hover[disabled],.datetimepicker table tr td.active.disabled[disabled],.datetimepicker table tr td.active.disabled:hover[disabled]{background-color:#04c}.datetimepicker table tr td.active:active,.datetimepicker table tr td.active:hover:active,.datetimepicker table tr td.active.disabled:active,.datetimepicker table tr td.active.disabled:hover:active,.datetimepicker table tr td.active.active,.datetimepicker table tr td.active:hover.active,.datetimepicker table tr td.active.disabled.active,.datetimepicker table tr td.active.disabled:hover.active{background-color:#039}.datetimepicker table tr td span{display:block;width:23%;height:54px;line-height:54px;float:left;margin:1%;cursor:pointer;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px}.datetimepicker .datetimepicker-hours span{height:26px;line-height:26px}.datetimepicker .datetimepicker-hours table tr td span.hour_am,.datetimepicker .datetimepicker-hours table tr td span.hour_pm{width:14.6%}.datetimepicker .datetimepicker-hours fieldset legend,.datetimepicker .datetimepicker-minutes fieldset legend{margin-bottom:inherit;line-height:30px}.datetimepicker .datetimepicker-minutes span{height:26px;line-height:26px}.datetimepicker table tr td span:hover{background:#eee}.datetimepicker table tr td span.disabled,.datetimepicker table tr td span.disabled:hover{background:0;color:#999;cursor:default}.datetimepicker table tr td span.active,.datetimepicker table tr td span.active:hover,.datetimepicker table tr td span.active.disabled,.datetimepicker table tr td span.active.disabled:hover{background-color:#006dcc;background-image:-moz-linear-gradient(top,#08c,#04c);background-image:-ms-linear-gradient(top,#08c,#04c);background-image:-webkit-gradient(linear,0 0,0 100%,from(#08c),to(#04c));background-image:-webkit-linear-gradient(top,#08c,#04c);background-image:-o-linear-gradient(top,#08c,#04c);background-image:linear-gradient(top,#08c,#04c);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#0088cc',endColorstr='#0044cc',GradientType=0);border-color:#04c #04c #002a80;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25);filter:progid:DXImageTransform.Microsoft.gradient(enabled=false);color:#fff;text-shadow:0 -1px 0 rgba(0,0,0,0.25)}.datetimepicker table tr td span.active:hover,.datetimepicker table tr td span.active:hover:hover,.datetimepicker table tr td span.active.disabled:hover,.datetimepicker table tr td span.active.disabled:hover:hover,.datetimepicker table tr td span.active:active,.datetimepicker table tr td span.active:hover:active,.datetimepicker table tr td span.active.disabled:active,.datetimepicker table tr td span.active.disabled:hover:active,.datetimepicker table tr td span.active.active,.datetimepicker table tr td span.active:hover.active,.datetimepicker table tr td span.active.disabled.active,.datetimepicker table tr td span.active.disabled:hover.active,.datetimepicker table tr td span.active.disabled,.datetimepicker table tr td span.active:hover.disabled,.datetimepicker table tr td span.active.disabled.disabled,.datetimepicker table tr td span.active.disabled:hover.disabled,.datetimepicker table tr td span.active[disabled],.datetimepicker table tr td span.active:hover[disabled],.datetimepicker table tr td span.active.disabled[disabled],.datetimepicker table tr td span.active.disabled:hover[disabled]{background-color:#04c}.datetimepicker table tr td span.active:active,.datetimepicker table tr td span.active:hover:active,.datetimepicker table tr td span.active.disabled:active,.datetimepicker table tr td span.active.disabled:hover:active,.datetimepicker table tr td span.active.active,.datetimepicker table tr td span.active:hover.active,.datetimepicker table tr td span.active.disabled.active,.datetimepicker table tr td span.active.disabled:hover.active{background-color:#039}.datetimepicker table tr td span.old{color:#999}.datetimepicker th.switch{width:145px}.datetimepicker th span.glyphicon{pointer-events:none}.datetimepicker thead tr:first-child th,.datetimepicker tfoot tr:first-child th{cursor:pointer}.datetimepicker thead tr:first-child th:hover,.datetimepicker tfoot tr:first-child th:hover{background:#eee}.input-append.date .add-on i,.input-prepend.date .add-on i,.input-group.date .input-group-addon span{cursor:pointer;width:14px;height:14px}
\ No newline at end of file
......@@ -14,6 +14,7 @@
<link rel='stylesheet' href='themes/<tmpl_var name='current_theme'>/assets/stylesheets/fonts.min.css' />
<link rel='stylesheet' href='themes/<tmpl_var name='current_theme'>/assets/stylesheets/ispconfig.min.css' />
<link rel='stylesheet' href='themes/<tmpl_var name='current_theme'>/assets/stylesheets/pushy.min.css' />
<link rel='stylesheet' href='themes/<tmpl_var name='current_theme'>/assets/stylesheets/bootstrap-datetimepicker.min.css' />
<link rel='stylesheet' href='themes/<tmpl_var name='current_theme'>/assets/stylesheets/responsive.min.css' />
<link rel='stylesheet' href='themes/<tmpl_var name='current_theme'>/assets/stylesheets/themes/default/theme.min.css' />
<link rel='stylesheet' href='themes/<tmpl_var name='current_theme'>/assets/stylesheets/select2.css' />
......@@ -82,6 +83,7 @@
<script type="text/javascript" src="js/jquery.min.js"></script>
<script src='themes/<tmpl_var name='current_theme'>/assets/javascripts/bootstrap.min.js'></script>
<script src='themes/<tmpl_var name='current_theme'>/assets/javascripts/bootstrap-datetimepicker.min.js'></script>
<script src='themes/<tmpl_var name='current_theme'>/assets/javascripts/ispconfig.min.js'></script>
<script src='themes/<tmpl_var name='current_theme'>/assets/javascripts/modernizr.custom.min.js'></script>
<script src='themes/<tmpl_var name='current_theme'>/assets/javascripts/pushy.min.js'></script>
......
......@@ -193,6 +193,7 @@ class page_action extends tform_actions {
$trans = array("d" => "dd", "m" => "mm", "Y" => "yy");
$date_format = strtr($date_format, $trans);
$app->tpl->setVar("date_format", $date_format);
$app->tpl->setVar("conf_format_datetime_js", strtr($app->lng('conf_format_dateshort'), array('d' => 'dd', 'm' => 'mm', 'Y' => 'yyyy', 'y' => 'yy', 'H' => 'hh', 'h' => 'HH', 'i' => 'ii')));
$app->tpl->setVar("daynamesmin_su", $app->lng('daynamesmin_su'));
$app->tpl->setVar("daynamesmin_mo", $app->lng('daynamesmin_mo'));
......
......@@ -83,7 +83,7 @@
</div>
<div class="form-group">
<label for="active_until_date" class="col-sm-3 control-label">{tmpl_var name='active_until_date_txt'}</label>
<div class="col-sm-9"><input type="text" name="active_until_date" id="active_until_date" value="{tmpl_var name='active_until_date'}" class="form-control" /></div></div>
<div class="col-sm-9"><input type="text" name="active_until_date" id="active_until_date" value="{tmpl_var name='active_until_date'}" class="form-control" data-input-element="date" data-date-format="{tmpl_var name='conf_format_datetime_js'}" /></div></div>
<div class="form-group">
<label for="description" class="col-sm-3 control-label">{tmpl_var name='description_txt'}</label>
<div class="col-sm-9"><textarea class="form-control" name="description" id="description" rows='5' cols='30' style='height:60px;'>{tmpl_var name='description'}</textarea></div>
......@@ -95,7 +95,4 @@
<div class="clear"><div class="right">
<button class="btn btn-default formbutton-success" type="button" value="{tmpl_var name='btn_save_txt'}" data-submit-form="pageForm" data-form-action="vm/openvz_vm_edit.php">{tmpl_var name='btn_save_txt'}</button>
<button class="btn btn-default formbutton-default" type="button" value="{tmpl_var name='btn_cancel_txt'}" data-load-content="vm/openvz_vm_list.php">{tmpl_var name='btn_cancel_txt'}</button>
</div></div>
<script language="JavaScript" type="text/javascript">
jQuery( "#active_until_date" ).datepicker({ dateFormat: '<tmpl_var name="date_format">', changeMonth: true, changeYear: true, yearRange: '-100:+100', dayNamesMin: ['<tmpl_var name="daynamesmin_su">','<tmpl_var name="daynamesmin_mo">','<tmpl_var name="daynamesmin_tu">','<tmpl_var name="daynamesmin_we">','<tmpl_var name="daynamesmin_th">','<tmpl_var name="daynamesmin_fr">','<tmpl_var name="daynamesmin_sa">'], dayNames: ['<tmpl_var name="daynames_sunday">','<tmpl_var name="daynames_monday">','<tmpl_var name="daynames_tuesday">','<tmpl_var name="daynames_wednesday">','<tmpl_var name="daynames_thursday">','<tmpl_var name="daynames_friday">','<tmpl_var name="daynames_saturday">'], monthNamesShort: ['<tmpl_var name="monthnamesshort_jan">','<tmpl_var name="monthnamesshort_feb">','<tmpl_var name="monthnamesshort_mar">','<tmpl_var name="monthnamesshort_apr">','<tmpl_var name="monthnamesshort_may">','<tmpl_var name="monthnamesshort_jun">','<tmpl_var name="monthnamesshort_jul">','<tmpl_var name="monthnamesshort_aug">','<tmpl_var name="monthnamesshort_sep">','<tmpl_var name="monthnamesshort_oct">','<tmpl_var name="monthnamesshort_nov">','<tmpl_var name="monthnamesshort_dec">'], nextText: '<tmpl_var name="datepicker_nextText">', prevText: '<tmpl_var name="datepicker_prevText">', firstDay: 1 });
</script>
\ No newline at end of file
</div></div>
\ No newline at end of file
Markdown is supported
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