11
trabis
Re: Xopps 2.5.2
  • 2011/10/9 20:15

  • trabis

  • Core Developer

  • Posts: 2269

  • Since: 2006/9/1 1


@jjdai,

The calendar js file does not support php date formats. It uses dd-mm-yy and other formats that can not be translated with php strtotime().

This was fixed on XOOPS 2.5.4, calendar js was changed to accept Y,y,m,n,j,d date elements instead.

In extcal/class/event.php you will have to use this:
function _checkDate(&$data)
    {
        
$data['event_start'] = strtotime($data['event_start']['date']) + $data['event_start']['time'];
        
$data['event_end'] = strtotime($data['event_end']['date']) + $data['event_end']['time'];

        if (
$data['have_end'] == || $data['event_start'] > $data['event_end']
        ) {
            
$data['event_end'] = $data['event_start'];
        }

    }


And in getRecurRules() under case Yearly
case 'yearly':

                if (
$parm['rrule_yearly_byday'] == "") {
                    
$time strtotime($parm['event_start']['date']);
                    
$parm['rrule_yearly_byday'] = date("j"mktime(000date("m"$time), date("d"$time), date("Y"$time)));
                }

                
$recurRules 'yearly|';
                
$recurRules .= $parm['rrule_yearly_interval'];
                
$recurRules .= '|' $parm['rrule_yearly_byday'];
                foreach (
                    
$parm['rrule_yearly_bymonths'] as $month
                
) {
                    
$recurRules .= '|' $month;
                }

                break;

        }


The value that comes from post can be used directly on strtotime() without problems.

Don't forget to remove every check for "invalid format date". They wont be necessary. '/' and '-' are valid separators.

12
jjdai
Re: Xopps 2.5.2
  • 2011/10/10 18:20

  • jjdai

  • Just popping in

  • Posts: 25

  • Since: 2006/6/17


@Trabis

Ok but for the many other module which use also this xoopsform., man must make also this hack ?

JJDai

13
trabis
Re: Xopps 2.5.2
  • 2011/10/10 19:09

  • trabis

  • Core Developer

  • Posts: 2269

  • Since: 2006/9/1 1


@Quote:

jjdai wrote:
@Trabis

Ok but for the many other module which use also this xoopsform., man must make also this hack ?

JJDai


I've tested profile, news and publisher module and both work without changes.

I think extCal developer(you or other) have tried to fix the bug with module logic. Now that Xoops core is fixed, those fixes have become bugs.

If you know about any other module that does not work with the fix, let me know and I'll provide a patch.

Thanks.

14
sabahan
Re: Xopps 2.5.2
  • 2011/10/12 9:00

  • sabahan

  • Quite a regular

  • Posts: 317

  • Since: 2006/3/4 5


where can i download this patch in full.. extcal/class/event.php

i have changed event.php based on trabis post but still received the wrong date format error

using 2.5.4 beta/extcal 2.22

no problem b4 using 2.5.4

15
trabis
Re: Xopps 2.5.2
  • 2011/10/12 18:27

  • trabis

  • Core Developer

  • Posts: 2269

  • Since: 2006/9/1 1


Quote:

have changed event.php based on trabis post but still received the wrong date format error

using 2.5.4 beta/extcal 2.22


Quote:

Don't forget to remove every check for "invalid format date". They wont be necessary. '/' and '-' are valid separators.

Sorry if I was not explicit enough.

Search for _MD_EXTCAL_WRONG_DATE_FORMAT in the source code, you should find it in post.php and in admin/event.php:
// If the date format is wrong     
     
if (     
         !
preg_match('`[0-9]{4}-[01][0-9]-[0123][0-9]`'$_POST['event_start']['date'])     
             || !
preg_match('`[0-9]{4}-[01][0-9]-[0123][0-9]`'$_POST['event_end']['date'])     
     ) {     
         
redirect_header(     
             
'index.php'3_MD_EXTCAL_WRONG_DATE_FORMAT ""     
             
implode(''$GLOBALS['xoopsSecurity']->getErrors())     
         );     
         exit;     
     }


Remove this code in both files.

You can use this version(2.30) with this and other bugs corrected:
http://xoops.svn.sourceforge.net/viewvc/xoops/XoopsModules/extcal/branches/mamba/extcal/?sortby=date

16
timgno
Re: Xopps 2.5.2
  • 2011/10/13 15:42

  • timgno

  • Module Developer

  • Posts: 1504

  • Since: 2007/6/21


Quote:

trabis wrote:
...
There were no js or css changes in 2.5.2 related with calendar form, only a language update in languages/english/calendar.php


why don't use jquery ui calendar seen that is already there?

17
sabahan
Re: Xopps 2.5.2
  • 2011/10/14 0:36

  • sabahan

  • Quite a regular

  • Posts: 317

  • Since: 2006/3/4 5


Thank you trabis...

the extcal is working fine on 2.54 now

18
JCash
Re: Xopps 2.5.2
  • 2011/10/19 23:37

  • JCash

  • Just popping in

  • Posts: 66

  • Since: 2011/2/22


extcal seems very interesting but ... I use Xoops 2.5.3 and extcal downloaded here :
http://xoops.svn.sourceforge.net/viewvc/xoops/XoopsModules/extcal/branches/mamba/extcal/?sortby=date

You know what ? I can't enter events because date have "wrong format date" :'(

If I want to use a stable version of Xoops (2.5.3), where can I find a compatible version of extcal ?

19
trabis
Re: Xopps 2.5.2
  • 2011/10/19 23:51

  • trabis

  • Core Developer

  • Posts: 2269

  • Since: 2006/9/1 1


Quote:

JCash wrote:
extcal seems very interesting but ... I use Xoops 2.5.3 and extcal downloaded here :
http://xoops.svn.sourceforge.net/viewvc/xoops/XoopsModules/extcal/branches/mamba/extcal/?sortby=date

You know what ? I can't enter events because date have "wrong format date" :'(

If I want to use a stable version of Xoops (2.5.3), where can I find a compatible version of extcal ?


That version only works on XOOPS 2.5.4 (not released yet)

Try an older revision:
http://xoops.svn.sourceforge.net/viewvc/xoops/XoopsModules/extcal/branches/mamba/extcal/?sortby=date&pathrev=7827

20
JCash
Re: Xopps 2.5.2
  • 2011/10/20 0:08

  • JCash

  • Just popping in

  • Posts: 66

  • Since: 2011/2/22


It seems to work better !

Just :
- a typo to correct into admin/admin_header.php (Error : Undefined variable: pathImageIcon in file /modules/extcal/admin/admin_header.php - line 63)
- and a piece of patience required because calendar begins with 1926

I will use it temporarily. Thanks for the link !

Login

Who's Online

260 user(s) are online (151 user(s) are browsing Support Forums)


Members: 0


Guests: 260


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Nov 30
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits