[dev] Calendar Issue

Jan Schneider jan at horde.org
Tue Jan 22 14:05:31 UTC 2013


Zitat von Ralf Lang <lang at b1-systems.de>:

> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Am 22.01.2013 14:49, schrieb Jan Schneider:
>>
>> Zitat von Roman Geber <geber at b1-systems.de>:
>>
>>> Hi :)
>>>
>>> I'd like to resolve the JavaScript Problem within Horde date
>>> picker. I've already proposed a fix (see GIthub Pull Request 23).
>>> Jan wasn't satisfied with the way this was done and responded
>>> with a, for me, slightly cryptic message.
>>>
>>> Before I get any deeper into that, this is the original problem:
>>>
>>> Whenever a date/time field (or any other field attached to a
>>> date picker) is augmented with an onchange statement, that
>>> onchange is code is not executed if the date_picker changes the
>>> value of that field. The simple solution would be to trigger the
>>> change event manually. Thats what my patch does.
>>>
>>> Example:
>>>
>>> $myDateTime = $this->addVariable("label", "html_field_id",
>>> "datetime", true, false, null);
>>> $myDateTime->setAction(Horde_Form_Action::factory('reload'));
>>>
>>> Ralf Lang and I discussed a strategy and would like to have your
>>> opinion on
>>>
>>> The proposed patch involves nothing but the calendar.js file. The
>>> way I read Jan's reply he'd rather have that additional code
>>> located somewhere else. Our current idea would be to create a new
>>> JavaScript file within '''$HORDE_GIT/framework/Form/js/ '''
>>> listening on the date picker, running the patch code whenever
>>> required.
>>
>> This is the correct place in the long run, but Horde_Form is still
>> a mess, so the event listener should probably go to
>> framework/Core/js/form_helpers.js instead.
>
> Yeah. It's even missing phpdoc in some places. I didn't add it yet
> because I don't understand some parameters myself.
>
> Is there any roadmap/plan I can contribute to or is the general
> solution to add functionality to Horde_View and let Horde_Form as-is?

There is no plan yet, since refactoring or replacing Horde_Form is a  
major undertaking.

>>> While I'd include that JS file whenever a date picker is loaded
>>> through Horde_Form to avoid this problem from happening ever
>>> again, Ralf seems concerned that this would compromise the
>>> libraries standalone capabilities. I wonder, is there a safe way
>>> to find out if Horde_Form is used standalone or within a Horde
>>> Instance?
>>
>> I don't understand the concerns, especially if you originally
>> planned to add the JS file to Horde_Form. But anyway, Horde_Form is
>> not really a stand-alone working library.
>
> My fault. I was too much into this library separation thing. Most
> libraries SHOULD work without horde_core.
>
>>
>>> Are we on the right track here or does anyone have a better
>>> idea?
>>>
>>> On top, I'd like to ask you how I'd listen on the date picker
>>> from an external script. Jan meant something about
>>> "Horde_Calendar:select". Since I'm no longer that well versed in
>>> Prototype these days and just starting out on Horde I need a bit
>>> of help there.
>>
>> Grep for Horde_Calendar:select in the git source you will fine a
>> few use cases that you can use as examples.
>
>
> - --
> Ralf Lang
> Linux Consultant / Developer
> Tel.: +49-170-6381563
> Mail: lang at b1-systems.de
> B1 Systems GmbH
> Osterfeldstra￟e 7 / 85088 Vohburg / http://www.b1-systems.de
> GF: Ralph Dehner / Unternehmenssitz: Vohburg / AG: Ingolstadt,HRB 3537
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v2.0.19 (GNU/Linux)
> Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/
>
> iEYEARECAAYFAlD+mrIACgkQCs1dsHJ/X7BH9ACgges+SWM03zM+m2Zu4JYStBQR
> YuQAoK+It8PYEsQGGCG6Y/uzS5WQfO7/
> =G6oB
> -----END PGP SIGNATURE-----


-- 
Jan Schneider
The Horde Project
http://www.horde.org/



More information about the dev mailing list