phpScheduleIt
May 25, 2013, 09:36:28 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: Reservations resources in e-mail notification?  (Read 979 times)
thermskin
Newbie
*

Karma: 0
Posts: 41


« on: October 12, 2009, 08:27:32 AM »

Hi Nick,

How can I include additional resources from additional_resources table into e-mail notification?

Best regards,
T.
Logged

---
Don't drink and drive, take a joint and fly.
Nick
Administrator
Hero Member
*****

Karma: 15
Posts: 5419


WWW
« Reply #1 on: October 12, 2009, 02:21:08 PM »

The short answer is that you'll need to change/add something to the localization file(s) for your supported language(s), then change send_email() in lib/Reservation.class.php to somehow append the accessories that are being booked with the resource.

This is fairly difficult since only the accessory IDs are provided when adding/modifying reservations.  The easiest way to get the accessory names for the email would be to pull all of the accessory info for this reservation from the database when sending the email.

The other option would be to change how add/modify works to accept a dictionary of accessoryId => accessoryName and use that from the send_email() function.

Either way, this is a pretty complicated change.
Logged
thermskin
Newbie
*

Karma: 0
Posts: 41


« Reply #2 on: October 13, 2009, 04:17:53 AM »

Hi Nick,

Thanx for tip:-)

I have managed to do that in RSS. Now I'm going to do it for e-mail.
I'll post here how-to, when I finish it.

Best regads,
T.
Logged

---
Don't drink and drive, take a joint and fly.
thermskin
Newbie
*

Karma: 0
Posts: 41


« Reply #3 on: October 14, 2009, 09:30:39 AM »

Hi all,

This is a small how-to for getting additional resources in e-mail.

Everything is done inside Reservation.class.php.

In function send_email you have to add :
Code:
$this->ar = $this->db->get_sup_resources($this->id); // return array

$arCount = count($this->ar);
$arArray = $this->ar;
$txtAR = "";

for ($i=0;$i < $arCount; $i++) {
  $txtAR = $txtAR . $arArray[$i]['name'].", "; // concenate string
}

then depending on layout of your table (message)
you have to put this

Code:
  <tr class="values">
    <td>Additional resources</td>
    <td>$txtAR</td>
    <td colspan="6">&nbsp;</td>
  </tr>


That's it.

« Last Edit: October 14, 2009, 09:32:48 AM by thermskin » Logged

---
Don't drink and drive, take a joint and fly.
Nick
Administrator
Hero Member
*****

Karma: 15
Posts: 5419


WWW
« Reply #4 on: October 19, 2009, 01:23:53 PM »

Nice.  Thanks for the contribution!
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!