PDA

View Full Version : add title to dialog boxes; add 'date' type for custom fields


giunta.gaetano@sea-aeropo
27-09-06, 08:57 PM
Hi there

I posted a new patch (http://sourceforge.net/tracker/index.php?func=detail&aid=1565748&group_id=21656&atid=372485) on sf.net, that (imho) is quite interesting for general purpose consumption:

+ the date picker popup window has acquired the capability of showing a custom title, which can be passed to it as 'title' param in the URL. This is in fact applicable to all dialogs that can be opened up by dp.

+ a new 'date' type is available for user added custom fields, complete with calendar component for editing mode. The same calendar component is used as is found in dp right now.

The new date editing components have some different requirements from the existing date editing components, which have 'hard-coded' js functions in the 'addedit' views (at least as of 2.04).
I think it would be a good idea if we built a framework of 'general' js functions that could be used by any field component that has to allow editing, and only make use of specialized js functions when there is some extra constraint (e.g. if we have start+end dates the extra constraint would be verifying that start <= end)

Feedback appreciated.
Bye Gaetano

pedroa
28-09-06, 08:23 PM
Why are you using the intvalue field instead of the charvalue field?
intvalue is used as connection to the select options not to store direct costum field data.
Besides, invalue is of INT mysql type, therefore shouldn't be able to store date datatypes or representations only integers, so probably you'll get integer representations of the dates.
Are you sure this works?

The rest of the code looks good, so keep it up.

Pedro A.

giunta.gaetano@sea-aeropo
29-09-06, 06:00 PM
Why are you using the intvalue field instead of the charvalue field?

The original line of reasoning was something like: "this is a datetime value, and every db has different string semntics for that. using a number otoh nails the value down".

Turned out that it was not a datetime value but date value only, and it got stored in the db as 20070101, which is indeed an int, but makes very little sense anyway (no db or lib that i know of takes advantage of this strange format).

Using mysql it works right now, but I might try out using the stringval instead as soon as I have a little time...

The rest of the code looks good, so keep it up

Thanks, I sure will.

BTW: did you notice that the patch I made makes usage of 'general purpose' js functions that could be used instead of all the 'custom' js functions that are currently embedded in every addedit.php page?
What do you think of the possibility of removing every possible custom js function in favour of calls to the generic ones?

pedroa
29-09-06, 08:17 PM
It is impossible not to know that because you already said that half a dozen times (yeah I read everything, though my count may be exagerated due to exponential annoyance of each message that is duplicated by the users and that I have to read again).

There is a very old mantis issue that materialized means there will be no pop up window for calendar selection in the future, and also those fields should be user editable isntead of disabled and that leads to other JS challenges due to format aspect of it.
Knowing that, I also know that all those JS you see in each file will go down the toilet.
If they go down the toilet to get into one of the central JS files, most probably, but not this code.
I believe a JSCalendar integration would be a better option, I have already done some on my own things also with user direct edition but I have not thought of a wide solution yet, mainly because we are talking about various files and each one may need special attention and time investment, and time is something I just do not have ATM.

Pedro A.

giunta.gaetano@sea-aeropo
29-09-06, 08:51 PM
Ok, I'll tone down a little bit ;)

Just one information: it is not very clear to me what is planned.
The public dp site looks like guest/guest is not valid anymore.

What cvs branch shall I base my patches against? 2.0.4? 2.04 + cvs fixes (for 2.0.5), head (for 3.0? how far away is that?)

bye
Gaetano

pedroa
29-09-06, 11:44 PM
Like I said it was discussed on Mantis, and also on some threads here on the forums either from members and developers, I am not sure if it is on any roadmap but is on the Mantis (very) long finger.
Bottom line is, as is is not ideal though is working so we have a stable situation.

About the dp site it sometimes gets its credentials hacked by wise guys that either don't read the login page or do it just for the fun of it.

About branches, dP3 HEAD is considered unstable with no forseen release date, stable_2 is no longer dP204 for all files so you should inform people about against what file versions are you patching.

Pedro A.

Karen
02-10-06, 09:57 AM
About the dp site it sometimes gets its credentials hacked by wise guys that either don't read the login page or do it just for the fun of it.



On the internet nobody knows it's you when you're behaving like a prat. I've reset the password - and YES I KNOW we could make a special version of the product that doesn't have a password reset in it, but we could also devote precious volunteer hours to doing some real work... decisions decisions decisions...

giunta.gaetano@sea-aeropo
02-10-06, 07:31 PM
I've reset the password
Thanks!
and YES I KNOW we could make a special version of the product that doesn't have a password reset in it, but we could also devote precious volunteer hours to doing some real work... decisions decisions decisions...
You actually must be reading my mind: I did not even ask for that and already got an answer!
BTW: instead of a "special version", I was thinking more about something like "user permissions": since there is such an advanecd permission system buil tin into dp, how hard do you think it would be to create a privilege "change password" that can be revoked from users?
Imho it would help not only the public version, but also on corporate intranets...

caseydk
03-10-06, 09:30 AM
There are *very* few scenarios where you wouldn't want to allow a user to change their password. Most organizations want you to change your password regularly.

giunta.gaetano@sea-aeropo
03-10-06, 06:40 PM
a guest account used by many different contracting companies / company departments / prospective clients ?

caseydk
03-10-06, 11:43 PM
Maybe your organization doesn't need information assurance/security, but once you get into a lot of people sharing a single account, you're going to have problems. If there's a priviledge escalation bug, you don't want everyone and their grandma to have access to the same account. You want to be able to track it to a single person.

giunta.gaetano@sea-aeropo
03-10-06, 11:55 PM
Sure enough, but sysadmin time is quite precious too.
So what happens is that the product security is trusted, and group accounts are used.
Maybe the lowly it tech guy will warn the pointy haired boss about the dangers of this situation, but his words of wisdom will not be heard until it is too late.

I guess we could go on indefinitely here...

It surely is not on the list of top priorities for anybody, but I still maintain it could be useful in some situations

giunta.gaetano@sea-aeropo
30-11-06, 11:38 PM
Hello all.

Thanks to a note from Alina, I found a bug in the existing code, and released a new version on sf.net (using the links to switch month in the calendar popup would prevent it from setting the correct date to the parent editbox)