[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Fmsystem-commits] [17080] more on eventplanner
From: |
sigurdne |
Subject: |
[Fmsystem-commits] [17080] more on eventplanner |
Date: |
Fri, 15 Sep 2017 15:00:44 -0400 (EDT) |
Revision: 17080
http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=17080
Author: sigurdne
Date: 2017-09-15 15:00:43 -0400 (Fri, 15 Sep 2017)
Log Message:
-----------
more on eventplanner
Modified Paths:
--------------
trunk/eventplanner/inc/class.uiapplication.inc.php
trunk/eventplanner/setup/phpgw_no.lang
trunk/eventplanner/templates/base/config.tpl
trunk/phpgwapi/inc/class.jqcal.inc.php
Modified: trunk/eventplanner/inc/class.uiapplication.inc.php
===================================================================
--- trunk/eventplanner/inc/class.uiapplication.inc.php 2017-09-15 14:20:27 UTC
(rev 17079)
+++ trunk/eventplanner/inc/class.uiapplication.inc.php 2017-09-15 19:00:43 UTC
(rev 17080)
@@ -417,8 +417,19 @@
array('order' =>
json_encode(array(1,'asc'))),
)
);
- $GLOBALS['phpgw']->jqcal->add_listener('date_start');
- $GLOBALS['phpgw']->jqcal->add_listener('date_end');
+
+ $config_calendar = array();
+ $active_year = !empty($config['active_year']) ?
$config['active_year'] : null;
+ if($active_year)
+ {
+ $config_calendar = array(
+ 'min_date' => "{$active_year}, 1 -1, 1",
+ 'max_date' => "{$active_year}, 12 -1,
31"
+ );
+ }
+
+ $GLOBALS['phpgw']->jqcal->add_listener('date_start',
'date', '', $config_calendar);
+ $GLOBALS['phpgw']->jqcal->add_listener('date_end',
'date', '', $config_calendar);
$GLOBALS['phpgw']->jqcal2->add_listener('from_',
'datetime', $application->date_start, array(
'min_date' => date('Y/m/d',
$application->date_start),
'max_date' => date('Y/m/d',
$application->date_end)
Modified: trunk/eventplanner/setup/phpgw_no.lang
===================================================================
--- trunk/eventplanner/setup/phpgw_no.lang 2017-09-15 14:20:27 UTC (rev
17079)
+++ trunk/eventplanner/setup/phpgw_no.lang 2017-09-15 19:00:43 UTC (rev
17080)
@@ -165,4 +165,5 @@
default vendor category eventplanner no Default utøverkategori
default application category eventplanner no Default søknadskategori
vendor name eventplanner no Artistnavn/utøver/gruppe
-sum eventplanner no Sum
\ No newline at end of file
+sum eventplanner no Sum
+active application year eventplanner no Aktivt søknadsår
\ No newline at end of file
Modified: trunk/eventplanner/templates/base/config.tpl
===================================================================
--- trunk/eventplanner/templates/base/config.tpl 2017-09-15 14:20:27 UTC
(rev 17079)
+++ trunk/eventplanner/templates/base/config.tpl 2017-09-15 19:00:43 UTC
(rev 17080)
@@ -29,6 +29,10 @@
</td>
</tr>
<tr>
+ <td>{lang_active_application_year}</td>
+ <td><input type="number"
name="newsettings[active_year]" value="{value_active_year}"></td>
+ </tr>
+ <tr>
<td>{lang_receipt_blind_copy}:</td>
<td>
<input type="text"
name="newsettings[receipt_blind_copy]" value="{value_receipt_blind_copy}">
Modified: trunk/phpgwapi/inc/class.jqcal.inc.php
===================================================================
--- trunk/phpgwapi/inc/class.jqcal.inc.php 2017-09-15 14:20:27 UTC (rev
17079)
+++ trunk/phpgwapi/inc/class.jqcal.inc.php 2017-09-15 19:00:43 UTC (rev
17080)
@@ -36,7 +36,7 @@
$this->lang_select_date = lang('select date');
}
- function add_listener($name, $type = 'date', $value = '')
+ function add_listener($name, $type = 'date', $value = '',
$config = array())
{
switch($type)
{
@@ -54,7 +54,7 @@
$_type = 'date';
}
- $this->_input_modern($name, $_type);
+ $this->_input_modern($name, $_type, $config);
return "<input id='{$name}' type='text'
value='{$value}' size='10' name='{$name}'/>";
}
@@ -64,8 +64,26 @@
* @access private
* @param string $name the element ID
*/
- function _input_modern($id, $type)
+ function _input_modern($id, $type, $config = array())
{
+ $date_range_arr = array();
+ $date_range = '';
+
+ if(!empty($config['min_date']))
+ {
+ $date_range_arr[] = "minDate:new
Date({$config['min_date']})";
+ }
+
+ if(!empty($config['max_date']))
+ {
+ $date_range_arr[] = "maxDate:new
Date({$config['max_date']})";
+ }
+
+ if($date_range_arr)
+ {
+ $date_range = ',' . implode(',',
$date_range_arr);
+ }
+
$js = <<<JS
$(function() {
$( "#{$id}" ).{$type}picker({
@@ -78,6 +96,9 @@
buttonImage: "{$this->img_cal}",
buttonText: "{$this->lang_select_date}",
buttonImageOnly: true
+ {$date_range}
+ //new Date(2018, 1 -1, 1),//Date(year,
month, day, hours, minutes, seconds, milliseconds)
+ //new Date(2018, 12 -1, 31)
}).keyup(function(e) {
if(e.keyCode == 8 || e.keyCode == 46) {
$.datepicker._clearDate(this);
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Fmsystem-commits] [17080] more on eventplanner,
sigurdne <=