Arrow Home arrow Forums
larger font smaller font default font Fixed screen resolution Auto adjust screen size

Joomlapolis Forums  


<< Start < Prev 1 2 3 4 5 Next > End >>
Re:manually enter the date
Date: 2006/03/26 16:30 By: mikko Status: User  
Karma: 106  
Platinum Joomlapolitan

Posts: 2230
graphgraph
You can do that by commenting awayt the code that inserts the calendar and disabled attribute to the field. I do not know how the input validation would go though, but you could try the following.

Edit file administrator/components/com_comprofiler/comprofiler.class.php from line 2216 to 2220 parameters are assigned to the calendar. You can find the documentation and available parameters for the calendar script here : http://www.dynarch.com/projects/calendar/

Another option is to edit the same file and comment out the jaascript and attribute disabled.

mikko
Click here to see the profile of this user The topic has been locked.

Re:manually enter the date
Date: 2006/03/27 04:29 By: mangoman Status: User  
Karma: 2  
Junior Joomlapolitan

Posts: 25
graphgraph
I'm a bit confused - excuse my ignorance, but...

I can just delete the code referring to javascript and the "attribute disabled" (whatever that is; now I know - I googled it)??

If I do the first option, then how could I format the birthdate info - that is, correctly get the user's data - in order to properly include/add this info into the database field.

And if I disable the field, it may confuse users - they will see it greyed out and suppose it's not required (which is is). Result: I don't think I'll have users correctly and consistently entering the data. (Option: I can provide a sample instruction such as "yyyy-dd-mm" as part of tthe CB field name).

If there is another way to get this info, then that is what I'm (urgently) seeking ....like another post, my users are incorrectly entering data and I suddenly have a lot of baby users due to birthdates in 2006!

Thanks for the help - let's go further and see how to improve this part of the CB code.

John

Post edited by: mangoman, at: 2006/03/26 21:30

Post edited by: mangoman, at: 2006/03/26 21:31
Click here to see the profile of this user The topic has been locked.

Re:calendar popup
Date: 2006/03/29 01:19 By: walb Status: User  
Karma: 4  
Fresh Joomlapolitan

Posts: 10
graphgraph
I recognize the problem and made the following modification to file administrator/components/com_comprofiler/comprofiler.class.php line 2085
Code:

 $return '<input class="inputbox" mosReq="'.$oReq.'" mosLabel="'.getLangDefinition($oLabel).'" type="text" name="' $oName .'" readonly="readonly" id="' $oName '" value="' $oValue '" />'."\n";


take the readonly out and change it to
Code:

 $return '<input class="inputbox" mosReq="'.$oReq.'" mosLabel="'.getLangDefinition($oLabel).'" type="text" name="' $oName .'" id="' $oName '" value="' $oValue '" />'."\n";


Line 2086
Code:

 if (!$oReadOnly$return .= "<script type=\"text/javascript\">\n"

To create an image button button, change it to
Code:

 if (!$oReadOnly$return .= '<img src="../components/com_comprofiler/images/calendar.png" id="trigger_i" alt="+" title="' _UE_DATE_SELECT '"  />' "<script type=\"text/javascript\">\n"


Insert somewhere between line 2088 - 2092 this line.
Code:

 'button     : "trigger_i",'

To have a trigger on the image button, I inserted it after 2090. EDIT>> JB dropped a leading point ('.') in the last statement for concatenation.

Now you need to insert an image in components/com_comprofiler/images/calendar.png
I took one from phpmyadmin, which has the right size.

Last step to to control the language.
Add this to your language file components/com_comprofiler/plugin/language/default_language/default_language.php
Code:

 DEFINE('_UE_DATE_SELECT','Date select');

and add it to other language files, if needed.

If everything is implemented well, it does the following:
  • The date text field is editable
  • It allows to delete any earlier entered date from the field
  • A small button is displayed on the right for date selection at will


It worked for me.
Success

I hope that this code is properly displayed by JoomlaBoard.

Post edited by: walb, at: 2006/03/28 18:38
Click here to see the profile of this user The topic has been locked.

Re:calendar popup
Date: 2006/04/04 02:06 By: mangoman Status: User  
Karma: 2  
Junior Joomlapolitan

Posts: 25
graphgraph
Thanks so much.

I updated the code, and it should make it easier for user registrations & birthdates, but...

I don't get a popup where the calendar icon appears; you can see it here:

http://www.milk.com.mx/component/option,com_comprofiler/task,registers/

I tried shifting the code around a bit, but still could not get it to work (as a pop up). Any suggestions?
Click here to see the profile of this user The topic has been locked.

Re:calendar popup
Date: 2006/04/04 03:06 By: walb Status: User  
Karma: 4  
Fresh Joomlapolitan

Posts: 10
graphgraph
@mangoman,
I looked at your link. Thanks for that!
Take special care of where to put this:
. 'button : "trigger_i",'
I suggest strongly to insert after line 2090 (original line numbering)
At your script it generates now an javascript error.

Brgds,

Walb

Ps. I got it working and it should work for you too. If necessary, I will attach my coding, which also works for multiple date fields. (Slightly changed coding though, due to IE problems not solving correctly multiple date fields)
But it enables me now to generate a staff holiday list.

EDIT>> I removed this ] from the coding. And I don't know how it got in.

Post edited by: walb, at: 2006/04/03 21:16

Post edited by: walb, at: 2006/04/03 21:17
Click here to see the profile of this user The topic has been locked.

Re:calendar popup
Date: 2006/04/04 03:29 By: mangoman Status: User  
Karma: 2  
Junior Joomlapolitan

Posts: 25
graphgraph
Yep, I moved it up 2 lines and that fixed it - now it works perfectly.

Thanks again....Now, when we upgrade to CB 1 stable, I'll perhaps have to do this all over again!

John
Click here to see the profile of this user The topic has been locked.

<< Start < Prev 1 2 3 4 5 Next > End >>

Documentation

Documentation Subscription Service
(updated for CB 1.2 RC4)

What?

Why?

Where?

Just click here for answers!

Click here for a yearly subscription: subscribe now

Download Latest Release

The latest stable Community Builder Release is version 1.1 for Joomla 1.0 and Mambo.
You need to be a registered member of Joomlapolis to download.

The latest release candidate of Community Builder is version 1.2 RC4, native for Joomla 1.0, 1.5 and Mambo.
It is available as "thank you" to all CB documentation subscribers and now also to all registered joomlapolitans.

CB Login