1
Mkjones
APCal problem with javascript date
  • 2013/1/26 11:20

  • Mkjones

  • Just popping in

  • Posts: 24

  • Since: 2009/7/29


- PHP version = 5.3.3
- XOOPS Version = 2.5.4
- module version = 2.11
site url: apet4life

When I attempt to add a new event the javascript date finder and form filler doesn't seem to work as the only output from it is this: 13-mm-dd. If I could find the template for the page I would remove it I think but I can't. Its using the calendar.js file found in the Xoops include directory which must be faulty I think.

I have added a test user if anyone needs to see what is happening.

user name: test
password: test

You need to login and then attempt to add an event to be able to see the problem page and script.

2
Mkjones
Re: APCal problem with javascript date
  • 2013/1/26 12:23

  • Mkjones

  • Just popping in

  • Posts: 24

  • Since: 2009/7/29


Can't edit the above post?

Please visit the forum to login.

3
goffy
Re: APCal problem with javascript date
  • 2013/1/26 14:44

  • goffy

  • Just can't stay away

  • Posts: 554

  • Since: 2010/12/27


hi

it seems to be a problem of newer xoops versions.
In index.php there is a check, which calendar should be taken, the settings in APCal.php
le="color: #000000"><?php var $jscalendar = 'jscalendar' ;

will be ignored
The check in index.php is
le="color: #000000"><?php if( is_file( XOOPS_ROOT_PATH . '/include/calendarjs.php' ) ) { // older jscalendar in XOOPS 2.0.x core

, but the same file exist in xoops 2.3 and newer, and I think, actual version is not fully compatible in all languages.

I solved the problem with deleting the first if-condition, because the last else means the same.

In my index.php it looks like this
le="color: #000000"><?php if( $action == 'Edit' ) { //goffy deleted first if condition in order to use recommended jscalendar /* if( is_file( XOOPS_ROOT_PATH . '/include/calendarjs.php' ) ) { // older jscalendar in XOOPS 2.0.x core include XOOPS_ROOT_PATH.'/include/calendarjs.php' ; $cal->jscalendar = 'xoops' ; } else */if( is_dir( XOOPS_ROOT_PATH . '/common/jscalendar' ) ) { // jscalendar in common (recommend) $jscalurl = XOOPS_URL . '/common/jscalendar' ; $xoopsTpl->assign( 'xoops_module_header' , ' <link rel="stylesheet" type="text/css" media="all" href="'.$jscalurl.'/calendar-system.css" /> <script type="text/javascript" src="'.$jscalurl.'/calendar.js"></script> <script type="text/javascript" src="'.$jscalurl.'/lang/'.$cal->jscalendar_lang_file.'"></script> <script type="text/javascript" src="'.$jscalurl.'/calendar-setup.js"></script> ' . $xoopsTpl->get_template_vars( "xoops_module_header" ) ) ; $cal->jscalendar = 'jscalendar' ; } elseif( is_dir( XOOPS_ROOT_PATH . '/class/calendar' ) ) { // jscalendar in XOOPS 2.2 core $jscalurl = XOOPS_URL . '/class/calendar' ; $xoopsTpl->assign( 'xoops_module_header' , ' <link rel="stylesheet" type="text/css" media="all" href="'.$jscalurl.'/CSS/calendar-blue.css" title="system" /> <script type="text/javascript" src="'.$jscalurl.'/calendar.js"></script> <script type="text/javascript" src="'.$jscalurl.'/lang/'.$cal->jscalendar_lang_file.'"></script> <script type="text/javascript" src="'.$jscalurl.'/calendar-setup.js"></script> ' . $xoopsTpl->get_template_vars( "xoops_module_header" ) ) ; $cal->jscalendar = 'jscalendar' ; } else { // older jscalendar in XOOPS 2.0.x core include XOOPS_ROOT_PATH.'/include/calendarjs.php' ; $cal->jscalendar = 'xoops' ; }

The jscalendar in folder common must be available, then it works in german version.

4
Mkjones
Re: APCal problem with javascript date
  • 2013/1/26 17:49

  • Mkjones

  • Just popping in

  • Posts: 24

  • Since: 2009/7/29


Thanks. Worked, well partially. I also didn't have the necessary files in the common folder. I must have installed it wrong in the first place. Sorted now and working fine .