- Timestamp:
- May 18, 2014, 12:58:53 PM (11 years ago)
- Location:
- trunk
- Files:
-
- 42 added
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/admin/batch_manager_global.php
r28497 r28500 293 293 else 294 294 { 295 $date_creation = $_POST['date_creation'] .' 00:00:00';295 $date_creation = $_POST['date_creation']; 296 296 } 297 297 … … 566 566 // creation date 567 567 $template->assign('DATE_CREATION', 568 empty($_POST['date_creation']) ? date(' y-n-j'): $_POST['date_creation']568 empty($_POST['date_creation']) ? date('Y-m-d').' 00:00:00' : $_POST['date_creation'] 569 569 ); 570 570 -
trunk/admin/batch_manager_unit.php
r28497 r28500 79 79 if (!empty($_POST['date_creation-'.$row['id']])) 80 80 { 81 if (!empty($row['date_creation'])) 82 { 83 list(, $time) = explode(' ', $row['date_creation']); 84 } 85 else 86 { 87 $time = '00:00:00'; 88 } 89 $data['date_creation'] = $_POST['date_creation-'.$row['id']].' '.$time; 81 $data['date_creation'] = $_POST['date_creation-'.$row['id']]; 90 82 } 91 83 else … … 222 214 223 215 $src_image = new SrcImage($row); 224 225 // creation date226 if (!empty($row['date_creation']))227 {228 list($date) = explode(' ', $row['date_creation']);229 }230 else231 {232 $date = '';233 }234 216 235 217 $query = ' … … 261 243 'LEVEL' => !empty($row['level'])?$row['level']:'0', 262 244 'DESCRIPTION' => htmlspecialchars(@$row['comment']), 263 'DATE_CREATION' => $ date,245 'DATE_CREATION' => $row['date_creation'], 264 246 'TAGS' => $tag_selection, 265 247 ) -
trunk/admin/history.php
r28497 r28500 571 571 // by default, at page load, we want the selected date to be the current 572 572 // date 573 $form['start'] = $form['end'] = date('Y- n-j');573 $form['start'] = $form['end'] = date('Y-m-d'); 574 574 $form['types'] = $types; 575 575 // Hoverbox by default -
trunk/admin/picture_modify.php
r28497 r28500 128 128 if (!empty($_POST['date_creation'])) 129 129 { 130 $data['date_creation'] = $_POST['date_creation'] .' '.$_POST['date_creation_time'];130 $data['date_creation'] = $_POST['date_creation']; 131 131 } 132 132 else … … 255 255 : @$row['author'] 256 256 ), 257 258 'DATE_CREATION' => $row['date_creation'], 257 259 258 260 'DESCRIPTION' => … … 317 319 ); 318 320 319 // creation date 320 unset($day, $month, $year); 321 322 if (!empty($row['date_creation'])) 323 { 324 list($date, $time) = explode(' ', $row['date_creation']); 325 } 326 else 327 { 328 $date = ''; 329 $time = '00:00:00'; 330 } 331 332 $template->assign( 333 array( 334 'DATE_CREATION' => $date, 335 'DATE_CREATION_TIME' => $time, 336 ) 337 ); 338 321 // categories 339 322 $query = ' 340 323 SELECT category_id, uppercats -
trunk/admin/themes/default/js/datepicker.js
r28497 r28500 1 jQuery.timepicker.log = jQuery.noop; // that's ugly, but the timepicker is acting weird and throws parsing errors 2 1 3 jQuery.fn.pwgDatepicker = function(options) { 2 4 options = options || {}; … … 5 7 var $this = jQuery(this), 6 8 $target = jQuery('[name="'+ jQuery(this).data('datepicker') +'"]'), 7 value = $target.val().split('-');9 linked = !!$target.length; 8 10 9 function set(date) { 10 $this.datepicker('setDate', date); 11 if (linked) { // get value before init 12 var value = $target.val().split(' '); 13 } 14 15 // custom setter 16 function set(date, init) { 17 $this.datetimepicker('setDate', date); 11 18 12 19 if ($this.data('datepicker-start')) { 13 $start.date picker('option', 'maxDate', date);20 $start.datetimepicker('option', 'maxDate', date); 14 21 } 15 22 else if ($this.data('datepicker-end')) { 16 $end.datepicker('option', 'minDate', date); 23 if (!init) { // on init, "end" is not initialized yet (assuming "start" is before "end" in the DOM) 24 $end.datetimepicker('option', 'minDate', date); 25 } 26 } 27 28 if (!date && linked) { 29 $target.val(''); 17 30 } 18 31 } 19 32 20 33 // init picker 21 $this.datepicker(jQuery.extend({ 22 dateFormat: 'DD d MM yy', 23 altField: $target, 34 $this.datetimepicker(jQuery.extend({ 35 dateFormat: linked ? 'DD d MM yy' : 'yy-mm-dd', 36 timeFormat: 'HH:mm', 37 38 altField: linked ? $target : null, 24 39 altFormat: 'yy-mm-dd', 40 altTimeFormat: options.showTimepicker ? 'HH:mm:ss' : '', 41 25 42 autoSize: true, 26 43 changeMonth : true, 27 changeYear: true 44 changeYear: true, 45 showTimepicker: false, 46 altFieldTimeOnly: false, 47 showSecond: false, 48 alwaysSetTime: false, 49 stepMinute: 5 28 50 }, options)); 29 51 30 // attach linked picker (for ranges)52 // attach range pickers 31 53 if ($this.data('datepicker-start')) { 32 54 var $start = jQuery('[data-datepicker="'+ jQuery(this).data('datepicker-start') +'"]'); 33 55 34 $this.date picker('option', 'onClose', function(date) {35 $start.date picker('option', 'maxDate', date);56 $this.datetimepicker('option', 'onClose', function(date) { 57 $start.datetimepicker('option', 'maxDate', date); 36 58 }); 59 60 $this.datetimepicker('option', 'minDate', $start.datetimepicker('getDate')); 37 61 } 38 62 else if ($this.data('datepicker-end')) { 39 63 var $end = jQuery('[data-datepicker="'+ jQuery(this).data('datepicker-end') +'"]'); 40 64 41 $this.date picker('option', 'onClose', function(date) {42 $end.date picker('option', 'minDate', date);65 $this.datetimepicker('option', 'onClose', function(date) { 66 $end.datetimepicker('option', 'minDate', date); 43 67 }); 44 68 } … … 48 72 jQuery('#'+ $this.data('datepicker-unset')).on('click', function(e) { 49 73 e.preventDefault(); 50 51 $target.val(''); 52 set(null); 74 set(null, false); 53 75 }); 54 76 } 55 77 56 78 // set value from linked input 57 if (value.length == 3) { 58 set(new Date(value[0], value[1]-1, value[2])); 79 if (linked) { 80 if (value[0].length == 10 && !options.showTimepicker) { 81 set(jQuery.datepicker.parseDate('yy-mm-dd', value[0]), true); 82 } 83 else if (value.length == 2 && options.showTimepicker) { 84 set(jQuery.datepicker.parseDateTime('yy-mm-dd', 'HH:mm:ss', value.join(' ')), true); 85 } 86 else { 87 set(null, true); 88 } 89 } 90 91 // autoSize not handled by timepicker 92 if (options.showTimepicker) { 93 $this.attr('size', parseInt($this.attr('size'))+6); 59 94 } 60 95 }); -
trunk/admin/themes/default/template/batch_manager_global.tpl
r28497 r28500 61 61 {footer_script require='jquery.tokeninput'} 62 62 jQuery(document).ready(function() {ldelim} 63 jQuery('[data-datepicker]').pwgDatepicker( );63 jQuery('[data-datepicker]').pwgDatepicker({ showTimepicker: true }); 64 64 65 65 jQuery("a.preview-box").colorbox(); -
trunk/admin/themes/default/template/batch_manager_unit.tpl
r28497 r28500 52 52 {* <!-- DATEPICKER --> *} 53 53 jQuery(function(){ {* <!-- onLoad needed to wait localization loads --> *} 54 jQuery('[data-datepicker]').pwgDatepicker( );54 jQuery('[data-datepicker]').pwgDatepicker({ showTimepicker: true }); 55 55 }); 56 56 -
trunk/admin/themes/default/template/include/datepicker.inc.tpl
r28497 r28500 1 {combine_script id='datepicker.js' load='footer' require='jquery.ui.datepicker' path='admin/themes/default/js/datepicker.js'} 1 {combine_script id='jquery.ui.timepicker-addon' load='footer' require='jquery.ui.datepicker,jquery.ui.slider' path="themes/default/js/ui/jquery.ui.timepicker-addon.js"} 2 {combine_script id='datepicker.js' load='footer' require='jquery.ui.timepicker-addon' path='admin/themes/default/js/datepicker.js'} 2 3 3 4 {assign var="datepicker_language" value="themes/default/js/ui/i18n/jquery.ui.datepicker-`$lang_info.code`.js"} 4 5 5 {if "PHPWG_ROOT_PATH"|@constant|@cat:$datepicker_language|@file_exists} 6 {combine_script id="jquery.ui.datepicker-$lang_info.code" load='footer' path=$datepicker_language}6 {combine_script id="jquery.ui.datepicker-$lang_info.code" load='footer' require='jquery.ui.datepicker' path=$datepicker_language} 7 7 {/if} 8 8 9 {assign var="timepicker_language" value="themes/default/js/ui/i18n/jquery.ui.timepicker-`$lang_info.code`.js"} 10 {if "PHPWG_ROOT_PATH"|@constant|@cat:$datepicker_language|@file_exists} 11 {combine_script id="jquery.ui.timepicker-$lang_info.code" load='footer' require='jquery.ui.timepicker-addon' path=$timepicker_language} 12 {/if} 13 14 {combine_css path="themes/default/js/ui/theme/jquery.ui.slider.css"} 9 15 {combine_css path="themes/default/js/ui/theme/jquery.ui.datepicker.css"} 16 {combine_css path="themes/default/js/ui/theme/jquery.ui.timepicker-addon.css"} -
trunk/admin/themes/default/template/picture_modify.tpl
r28497 r28500 78 78 {* <!-- DATEPICKER --> *} 79 79 jQuery(function(){ {* <!-- onLoad needed to wait localization loads --> *} 80 jQuery('[data-datepicker]').pwgDatepicker( );80 jQuery('[data-datepicker]').pwgDatepicker({ showTimepicker: true }); 81 81 }); 82 82 }()); … … 141 141 <strong>{'Creation date'|@translate}</strong> 142 142 <br> 143 <input type="hidden" name="date_creation_time" value="{$DATE_CREATION_TIME}">144 143 <input type="hidden" name="date_creation" value="{$DATE_CREATION}"> 145 144 <label>
Note: See TracChangeset
for help on using the changeset viewer.