Hi,
I'm trying to create a form where people can leave phone messages. At the moment we're using joomla for our intranet and the office still uses the old phone message pads to write down messages for everyone! Pieces of paper go missing etc all the time so I want to make it electronic. I need a form where in the 'To' field you can select a registered users ID... automatically have it work out who the message is from... so the logged in persons ID who is typing the message, the current time, message details etc. When you press submit it sends it automatically to the To persons email address. I'd love to also have a messages page where all the messages are displayed... if you could show which ones are complete or not that'd be excellent. I'm not too fussed about the message page where it shows all the data but at least if I could get the form that'd be great.. I've had a quick look and it looks like ChronoForms can do most of it. I'm unsure if selecting the User's ID is possible though. Any ideas?
Pete.
I'm trying to create a form where people can leave phone messages. At the moment we're using joomla for our intranet and the office still uses the old phone message pads to write down messages for everyone! Pieces of paper go missing etc all the time so I want to make it electronic. I need a form where in the 'To' field you can select a registered users ID... automatically have it work out who the message is from... so the logged in persons ID who is typing the message, the current time, message details etc. When you press submit it sends it automatically to the To persons email address. I'd love to also have a messages page where all the messages are displayed... if you could show which ones are complete or not that'd be excellent. I'm not too fussed about the message page where it shows all the data but at least if I could get the form that'd be great.. I've had a quick look and it looks like ChronoForms can do most of it. I'm unsure if selecting the User's ID is possible though. Any ideas?
Pete.
Hi Peter,
There are various bits to this. Some may be more complicated than others. First off, finding the current user's id, name and email are simple. Here's some sample code:
Getting a list of users ought to be fairly straightforward too. I'd have to research how to do it but the code probably exists in the user module.
Saving the message data to a database table is easy with ChronoForms but the results are only available on the back end of Joomla (the Admin pages). You'd need to write some custom code - probably a custom form or two to have this available to the front end. It would be easy enough to manage these forms with ChronoForms but you'd need some custom coding to link into the database.
I can't imagine that someone hasn't already created a Joomla module or a PHP script to do something like this that 'might' be a good basis. I say 'might' because sometimes it's easier to start from scratch than to adapt a badly written script!
Bob<br><br>Post edited by: GreyHead, at: 2007/08/19 16:08
There are various bits to this. Some may be more complicated than others. First off, finding the current user's id, name and email are simple. Here's some sample code:
<?php global $my; ?>
<?php echo $my->id; ?><br />
<input name='name' value='<?php echo $my->name ?>' /><br />
<input name='email' value='<?php echo $my->email ?>' />
You can also do date and time easily using the php date function (you'll just need to watch time-zone settings).
Getting a list of users ought to be fairly straightforward too. I'd have to research how to do it but the code probably exists in the user module.
Saving the message data to a database table is easy with ChronoForms but the results are only available on the back end of Joomla (the Admin pages). You'd need to write some custom code - probably a custom form or two to have this available to the front end. It would be easy enough to manage these forms with ChronoForms but you'd need some custom coding to link into the database.
I can't imagine that someone hasn't already created a Joomla module or a PHP script to do something like this that 'might' be a good basis. I say 'might' because sometimes it's easier to start from scratch than to adapt a badly written script!
Bob<br><br>Post edited by: GreyHead, at: 2007/08/19 16:08
i tried this to get the email and i get blanks. where do you put this code? i put in custom code just before the display html.
This topic is locked and no more replies can be posted.