phpScheduleIt
May 26, 2013, 02:13:46 AM *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: phpScheduleIt 2.4.2 has been released!
 
   Home   Help Login Register  
Pages: [1]
  Print  
Author Topic: Additional Field  (Read 10281 times)
chrisgoodrich
Newbie
*

Karma: 0
Posts: 6


« on: January 23, 2007, 05:21:48 PM »

I followed the instructions for adding an additional field to the reservation form.  Everything works fine.

I created a new field for the event title.  Now I am attempting to replace the "resource" display field in the main control panel with the new field.

I have tried everything I can think of to get it to display, however I do not have a great knowledge of PHP.

Any suggestions would be greatly appreciated!
Logged
Nick
Administrator
Hero Member
*****

Karma: 15
Posts: 5419


WWW
« Reply #1 on: January 24, 2007, 09:50:39 AM »

I think all fields are being returned, so you should just be able to change $rs['name'] on line 153 to $rs['whatever your field name is']
Logged
chrisgoodrich
Newbie
*

Karma: 0
Posts: 6


« Reply #2 on: January 25, 2007, 12:39:39 PM »

That is what I thought too and I have done that.  However, the field comes back blank.  No text shows up.
Logged
Nick
Administrator
Hero Member
*****

Karma: 15
Posts: 5419


WWW
« Reply #3 on: January 25, 2007, 06:42:02 PM »

Try adding the field to the query on line 214 of lib/DBEngine.class.php
Logged
chrisgoodrich
Newbie
*

Karma: 0
Posts: 6


« Reply #4 on: January 26, 2007, 02:07:31 PM »

This is what i edited on line 214:

Code:
$query = 'SELECT res.*, resusers.*, rs.name, rs.location, rs.rphone, eventtitle FROM '


I also edited the following in cpanel.template.php:

Code:
. '          <td style="text-align:left;">' . $rs['name'] . '</td>'


to read:

Code:
. '          <td style="text-align:left;">' . $rs['eventtitle'] . '</td>'


I have done this for all of the tables (my invitations, my reservations, etc.)

Still doesn't seem to show up properly.[/quote]
Logged
chrisgoodrich
Newbie
*

Karma: 0
Posts: 6


« Reply #5 on: January 26, 2007, 02:13:16 PM »

I got it to work correctly.  I made the changes described above as well as the following change on line 426 of DBEngine.class.php:

Code:
$query = "SELECT ru.resid, ru.memberid, ru.accept_code, l.fname, l.lname, r.start_date, r.end_date, r.starttime, r.endtime, res.name, eventtitle FROM


where my custom field is titled "eventtitle"

Hope this provides help to anybody else attempting to make these same changes.

Any ideas on where to start to change the display of events within the calendar?  Instead of displaying the reservation owners name I want to display the event title.  Any ideas?
Logged
Nick
Administrator
Hero Member
*****

Karma: 15
Posts: 5419


WWW
« Reply #6 on: January 27, 2007, 11:50:39 AM »

This isn't too bad.  If you want to just hack it in, all you will need to do is change the query that pulls back reservations in Schedule.class.php (get_all_res()).  There is a function called write_reservation() where you can change this line:

Code:
$summary->user_name = "{$rs['fname']} {$rs['lname']}";


to:
Code:

$summary->user_name = "{$rs['eventtitle']}";
Logged
chrisgoodrich
Newbie
*

Karma: 0
Posts: 6


« Reply #7 on: January 31, 2007, 12:52:53 PM »

I made that change, but for some reason it still shows up with the reservation owners name.

Any Ideas?
Logged
Nick
Administrator
Hero Member
*****

Karma: 15
Posts: 5419


WWW
« Reply #8 on: January 31, 2007, 08:54:32 PM »

Are you talking about the main booking schedule, or one of the calendar views?
Logged
chrisgoodrich
Newbie
*

Karma: 0
Posts: 6


« Reply #9 on: February 02, 2007, 04:13:33 PM »

I am eventually going to try to do all of them.  

I have looked on all of the calendars and none have changed.
Logged
barh0002
Jr. Member
**

Karma: 0
Posts: 63


« Reply #10 on: February 27, 2007, 11:58:59 AM »

In his first post he references some instructions for doing this...where would i find those?
Logged
Nick
Administrator
Hero Member
*****

Karma: 15
Posts: 5419


WWW
« Reply #11 on: February 27, 2007, 10:20:43 PM »

The project download page on SourceForge has a pdf on how to add fields.
Logged
durana
Full Member
***

Karma: 1
Posts: 101


« Reply #12 on: May 06, 2008, 02:21:49 PM »

hello guyz,

I have searched for the pfd for adding extra fields, but I can really find it.
Can someone give me the exact link??

thankd durana
Logged
Nick
Administrator
Hero Member
*****

Karma: 15
Posts: 5419


WWW
« Reply #13 on: May 07, 2008, 10:09:35 AM »

Here you go...

https://sourceforge.net/project/showfiles.php?group_id=95547&package_id=169927
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2006-2007, Simple Machines Valid XHTML 1.0! Valid CSS!