コード例 #1
0
 /**
  * Update Booking status and redirect to event art 1
  *
  * @return  void  - Redirects to event view
  */
 public function status()
 {
     $uuid = JFactory::getApplication()->input->get('uuid', '');
     $pg_plugin = JFactory::getApplication()->input->get('pg_plugin', '');
     $uid = JFactory::getApplication()->input->getInt('uid', 0);
     $dispatcher = JDispatcher::getInstance();
     // Import the right plugin here!
     JPluginHelper::importPlugin('payment', $pg_plugin);
     $data = $dispatcher->trigger('onTP_Processpayment', array(JRequest::get("post")));
     $model = $this->getModel('PPayment', 'MatukioModel');
     $booking = $model->getBooking($uuid);
     if (empty($booking)) {
         JError::raise(E_ERROR, "500", JText::_("COM_MATUKIO_BOOKING_NOT_FOUND"));
     }
     $event = $model->getEvent($booking->semid);
     $payment_status = $data[0]['status'];
     // Update Payment status
     $db = JFactory::getDbo();
     $query = $db->getQuery(true);
     $query->update("#__matukio_bookings")->where("uuid = " . $db->quote($uuid))->set("payment_status = " . $db->quote($payment_status));
     $db->setQuery($query);
     $db->execute();
     $msg = JText::_("COM_MATUKIO_THANK_YOU");
     // Check if there is an error, if yes
     if ($data[0]['status'] == "E") {
         $status = MatukioHelperUtilsBooking::$PENDING;
         if (MatukioHelperSettings::_("booking_always_active", 0)) {
             // We check if the booking always active setting is set - if yes the booking is always!! active (except waitlist delete etc.)
             $status = MatukioHelperUtilsBooking::$ACTIVE;
         }
         // Update status to not paid
         $query = $db->getQuery(true);
         $query->update("#__matukio_bookings")->where("uuid = " . $db->quote($uuid))->set("paid = 0")->set("status = " . $db->quote($status))->set("payment_plugin_data = " . $db->quote($data[0]['raw_data']));
         $db->setQuery($query);
         $db->execute();
         $view = $this->getView("PPayment", "html");
         $model = $this->getModel('PPayment', 'MatukioModel');
         $view->setModel($model, true);
         $view->data = $data;
         $view->setLayout("error");
         $view->display();
         return;
     } elseif ($data[0]['status'] == "C") {
         $status = MatukioHelperUtilsBooking::$ACTIVE;
         if (MatukioHelperSettings::_("booking_always_inactive", 0)) {
             // We check if the booking always active setting is set - if yes the booking is always!! active (except waitlist delete etc.)
             $status = MatukioHelperUtilsBooking::$PENDING;
         }
         // Update status to paid and set the booking to active
         $query = $db->getQuery(true);
         $query->update("#__matukio_bookings")->where("uuid = " . $db->quote($uuid))->set("paid = 1")->set("status = " . $db->quote($status))->set("payment_plugin_data = " . $db->quote($data[0]['raw_data']));
         $db->setQuery($query);
         $db->execute();
         $msg = JText::_("COM_MATUKIO_PAYMENT_SUCCESSFULL");
     } elseif ($data[0]['status'] == "P") {
         $status = MatukioHelperUtilsBooking::$PENDING;
         // Exclusion for cash plugin
         if ($pg_plugin == "cash") {
             $status = MatukioHelperUtilsBooking::$ACTIVE;
             if (MatukioHelperSettings::_("booking_always_inactive", 0)) {
                 // We check if the booking always active setting is set - if yes the booking is always!! active (except waitlist delete etc.)
                 $status = MatukioHelperUtilsBooking::$PENDING;
             }
         }
         if (MatukioHelperSettings::_("booking_always_active", 0)) {
             // We check if the booking always active setting is set - if yes the booking is always!! active (except waitlist delete etc.)
             $status = MatukioHelperUtilsBooking::$ACTIVE;
         }
         // Update status to not paid
         $query = $db->getQuery(true);
         $query->update("#__matukio_bookings")->where("uuid = " . $db->quote($uuid))->set("paid = 0")->set("status = " . $db->quote($status))->set("payment_plugin_data = " . $db->quote($data[0]['raw_data']));
         $db->setQuery($query);
         $db->execute();
         $msg = JText::_("COM_MATUKIO_PAYMENT_PENDING");
     }
     // We send the booking confirmation here..
     MatukioHelperUtilsEvents::sendBookingConfirmationMail($event, $booking->id, 1);
     // Link to event art = 1
     $eventid_l = $event->id . ':' . JFilterOutput::stringURLSafe($event->title);
     $catid_l = $event->catid . ':' . JFilterOutput::stringURLSafe(MatukioHelperCategories::getCategoryAlias($event->catid));
     // Link back to the form
     if (MatukioHelperSettings::getSettings("oldbooking_redirect_after", "bookingpage") == "bookingpage") {
         $bplink = "index.php?option=com_matukio&view=booking&uuid=" . $booking->uuid;
         $needles = array('category' => 0);
         $item = MatukioHelperRoute::_findItem($needles);
         if ($item) {
             $bplink .= '&Itemid=' . $item->id;
         }
         $link = JRoute::_($bplink);
     } elseif (MatukioHelperSettings::getSettings("oldbooking_redirect_after", "bookingpage") == "eventpage") {
         $link = JRoute::_(MatukioHelperRoute::getEventRoute($eventid_l, $catid_l, 0, $uid, $uuid), false);
     } else {
         // Eventlist overview
         $link = JRoute::_(MatukioHelperRoute::getEventlistRoute(0, 0), false);
     }
     $this->setRedirect($link, $msg);
 }
コード例 #2
0
                    // Link
                    $eventid_l = $row->id . ':' . JFilterOutput::stringURLSafe($row->title);
                    $catid_l = $row->catid . ':' . JFilterOutput::stringURLSafe($row->category);
                    $link = JRoute::_(MatukioHelperRoute::getEventRoute($eventid_l, $catid_l), false);
                    $events .= "<a class=\"editlinktip hasTip\" title=\"" . htmlspecialchars($row->title) . "::" . sem_m003($row, $params) . "\" style=\"text-decoration: none;\" href='" . $link . "'><img src=\"modules/mod_matukio/images/" . $grafik . ".png\" border=\"0\"></a>";
                }
            }
            if ($events != "") {
                $stil = "style=\"" . $params->get('sem_m086', '') . $heutestil . "\"";
            }
            $html .= "<td " . $stil . ">" . $i . "<br />" . $events . "</td>";
            $spalten++;
        }
        if ($spalten < 7) {
            $leertage = 7 - $spalten;
            for ($i = 1; $i <= $leertage; $i++) {
                $html .= "<td style=\"" . $params->get('sem_m085', '') . "\">&nbsp;</td>";
            }
        }
        $html .= "</tr></table></center>";
        break;
}
if ($params->get('sem_m074', 0) > 0) {
    $html .= "</marquee>";
}
if ($params->get('sem_m075', 0) > 0 and $params->get('sem_m039', 0) > 0) {
    $needles = array('event' => (int) 1, 'category' => (int) 0);
    $item = MatukioHelperRoute::_findItem($needles);
    $html .= "<hr style='height:1px;color:#808080;background-color:#808080;border:0px;'><a href='" . JROUTE::_('index.php?option=com_matukio&view=eventlist' . $index . '&Itemid=' . $item->id, 1, 0) . "'><b>" . JText::_('MOD_MATUKIO_MORE') . "</b></a>";
}
echo $html;
コード例 #3
0
 /**
  * Gets the replacements for the event & (booking)
  *
  * @param   object  $event    - The event data
  * @param   object  $booking  - The booking data
  * @param   int     $nr       - the number
  *
  * @return mixed
  */
 public static function getReplaces($event, $booking = null, $nr = null)
 {
     $needles = array('event' => (int) $event->id, 'category' => 0);
     $itemId = MatukioHelperRoute::_findItem($needles)->id;
     if ($nr != null) {
         $replaces["MAT_NR"] = $nr;
     }
     // Current date
     $replaces["MAT_DATE"] = JHTML::_('date', '', MatukioHelperSettings::getSettings('date_format_without_time', 'd-m-Y'));
     // Signature
     $replaces["MAT_SIGNATURE"] = MatukioHelperSettings::getSettings('mat_signature', 'Please do not answer this E-Mail.');
     // Event data
     $replaces["MAT_EVENT_SEMNUM"] = $event->semnum;
     // Alias
     $replaces["MAT_EVENT_NUMBER"] = $event->semnum;
     $replaces["MAT_EVENT_CATID"] = $event->catid;
     $replaces["MAT_EVENT_CATEGORY"] = JText::_($event->category);
     $replaces["MAT_EVENT_TITLE"] = JText::_($event->title);
     $replaces["MAT_EVENT_TARGET"] = JText::_($event->target);
     $replaces["MAT_EVENT_SHORTDESC"] = JText::_($event->shortdesc);
     // TODO change image path
     $replaces["MAT_EVENT_DESCRIPTION"] = JHTML::_('content.prepare', $event->description);
     $location = $event->place;
     // Locations
     if ($event->place_id > 0) {
         $locobj = MatukioHelperUtilsEvents::getLocation($event->place_id);
         $location = $locobj->location;
     }
     $replaces["MAT_EVENT_PLACE"] = $location;
     $replaces["MAT_EVENT_LOCATION"] = $location;
     $replaces["MAT_EVENT_TEACHER"] = $event->teacher;
     // Alias
     $replaces["MAT_EVENT_TUTOR"] = $event->teacher;
     if ($event->fees > 0) {
         $replaces["MAT_EVENT_FEES"] = MatukioHelperUtilsEvents::getFormatedCurrency($event->fees, MatukioHelperSettings::_('currency_symbol', '$'));
     } else {
         $replaces["MAT_EVENT_FEES"] = JText::_("COM_MATUKIO_FREE");
     }
     $replaces["MAT_EVENT_ORGANIZER_ID"] = $event->publisher;
     $replaces["MAT_EVENT_ORGANIZER"] = JFactory::getUser($event->publisher)->name;
     $replaces["MAT_EVENT_MAXPUPIL"] = $event->maxpupil;
     $replaces["MAT_EVENT_BOOKEDPUPIL"] = $event->bookedpupil;
     $replaces["MAT_EVENT_BEGIN"] = JHTML::_('date', $event->begin, MatukioHelperSettings::getSettings('date_format', 'd-m-Y, H:i'));
     $replaces["MAT_EVENT_END"] = JHTML::_('date', $event->end, MatukioHelperSettings::getSettings('date_format', 'd-m-Y, H:i'));
     $replaces["MAT_EVENT_BOOKED"] = JHTML::_('date', $event->booked, MatukioHelperSettings::getSettings('date_format', 'd-m-Y, H:i'));
     $replaces["MAT_EVENT_GMAPLOC"] = $event->gmaploc;
     $replaces["MAT_EVENT_NRBOOKED"] = $event->nrbooked;
     /* Alias */
     $custom10 = explode("|", $event->zusatz10);
     $custom11 = explode("|", $event->zusatz11);
     $custom12 = explode("|", $event->zusatz12);
     $custom13 = explode("|", $event->zusatz13);
     $custom14 = explode("|", $event->zusatz14);
     $custom15 = explode("|", $event->zusatz15);
     $custom16 = explode("|", $event->zusatz16);
     $custom17 = explode("|", $event->zusatz17);
     $custom18 = explode("|", $event->zusatz18);
     $custom19 = explode("|", $event->zusatz19);
     $custom20 = explode("|", $event->zusatz20);
     $custom1 = explode("|", $event->zusatz1);
     $custom2 = explode("|", $event->zusatz2);
     $custom3 = explode("|", $event->zusatz3);
     $custom4 = explode("|", $event->zusatz4);
     $custom5 = explode("|", $event->zusatz5);
     $custom6 = explode("|", $event->zusatz6);
     $custom7 = explode("|", $event->zusatz7);
     $custom8 = explode("|", $event->zusatz8);
     $custom9 = explode("|", $event->zusatz9);
     $replaces["MAT_EVENT_CUSTOM10"] = $custom10[0];
     $replaces["MAT_EVENT_CUSTOM11"] = $custom11[0];
     $replaces["MAT_EVENT_CUSTOM12"] = $custom12[0];
     $replaces["MAT_EVENT_CUSTOM13"] = $custom13[0];
     $replaces["MAT_EVENT_CUSTOM14"] = $custom14[0];
     $replaces["MAT_EVENT_CUSTOM15"] = $custom15[0];
     $replaces["MAT_EVENT_CUSTOM16"] = $custom16[0];
     $replaces["MAT_EVENT_CUSTOM17"] = $custom17[0];
     $replaces["MAT_EVENT_CUSTOM18"] = $custom18[0];
     $replaces["MAT_EVENT_CUSTOM19"] = $custom19[0];
     $replaces["MAT_EVENT_CUSTOM20"] = $custom20[0];
     $replaces["MAT_EVENT_CUSTOM1"] = $custom1[0];
     $replaces["MAT_EVENT_CUSTOM2"] = $custom2[0];
     $replaces["MAT_EVENT_CUSTOM3"] = $custom3[0];
     $replaces["MAT_EVENT_CUSTOM4"] = $custom4[0];
     $replaces["MAT_EVENT_CUSTOM5"] = $custom5[0];
     $replaces["MAT_EVENT_CUSTOM6"] = $custom6[0];
     $replaces["MAT_EVENT_CUSTOM7"] = $custom7[0];
     $replaces["MAT_EVENT_CUSTOM8"] = $custom8[0];
     $replaces["MAT_EVENT_CUSTOM9"] = $custom9[0];
     $replaces["MAT_EVENT_ZUSATZ10"] = $replaces["MAT_EVENT_CUSTOM10"];
     $replaces["MAT_EVENT_ZUSATZ11"] = $replaces["MAT_EVENT_CUSTOM11"];
     $replaces["MAT_EVENT_ZUSATZ12"] = $replaces["MAT_EVENT_CUSTOM12"];
     $replaces["MAT_EVENT_ZUSATZ13"] = $replaces["MAT_EVENT_CUSTOM13"];
     $replaces["MAT_EVENT_ZUSATZ14"] = $replaces["MAT_EVENT_CUSTOM14"];
     $replaces["MAT_EVENT_ZUSATZ15"] = $replaces["MAT_EVENT_CUSTOM15"];
     $replaces["MAT_EVENT_ZUSATZ16"] = $replaces["MAT_EVENT_CUSTOM16"];
     $replaces["MAT_EVENT_ZUSATZ17"] = $replaces["MAT_EVENT_CUSTOM17"];
     $replaces["MAT_EVENT_ZUSATZ18"] = $replaces["MAT_EVENT_CUSTOM18"];
     $replaces["MAT_EVENT_ZUSATZ19"] = $replaces["MAT_EVENT_CUSTOM19"];
     $replaces["MAT_EVENT_ZUSATZ20"] = $replaces["MAT_EVENT_CUSTOM20"];
     $replaces["MAT_EVENT_ZUSATZ1"] = $replaces["MAT_EVENT_CUSTOM1"];
     $replaces["MAT_EVENT_ZUSATZ2"] = $replaces["MAT_EVENT_CUSTOM2"];
     $replaces["MAT_EVENT_ZUSATZ3"] = $replaces["MAT_EVENT_CUSTOM3"];
     $replaces["MAT_EVENT_ZUSATZ4"] = $replaces["MAT_EVENT_CUSTOM4"];
     $replaces["MAT_EVENT_ZUSATZ5"] = $replaces["MAT_EVENT_CUSTOM5"];
     $replaces["MAT_EVENT_ZUSATZ6"] = $replaces["MAT_EVENT_CUSTOM6"];
     $replaces["MAT_EVENT_ZUSATZ7"] = $replaces["MAT_EVENT_CUSTOM7"];
     $replaces["MAT_EVENT_ZUSATZ8"] = $replaces["MAT_EVENT_CUSTOM8"];
     $replaces["MAT_EVENT_ZUSATZ9"] = $replaces["MAT_EVENT_CUSTOM9"];
     $replaces["MAT_EVENT_ZUSATZ10HINT"] = $event->zusatz10hint;
     $replaces["MAT_EVENT_ZUSATZ11HINT"] = $event->zusatz11hint;
     $replaces["MAT_EVENT_ZUSATZ12HINT"] = $event->zusatz12hint;
     $replaces["MAT_EVENT_ZUSATZ13HINT"] = $event->zusatz13hint;
     $replaces["MAT_EVENT_ZUSATZ14HINT"] = $event->zusatz14hint;
     $replaces["MAT_EVENT_ZUSATZ15HINT"] = $event->zusatz15hint;
     $replaces["MAT_EVENT_ZUSATZ16HINT"] = $event->zusatz16hint;
     $replaces["MAT_EVENT_ZUSATZ17HINT"] = $event->zusatz17hint;
     $replaces["MAT_EVENT_ZUSATZ18HINT"] = $event->zusatz18hint;
     $replaces["MAT_EVENT_ZUSATZ19HINT"] = $event->zusatz19hint;
     $replaces["MAT_EVENT_ZUSATZ20HINT"] = $event->zusatz20hint;
     $replaces["MAT_EVENT_ZUSATZ1HINT"] = $event->zusatz1hint;
     $replaces["MAT_EVENT_ZUSATZ2HINT"] = $event->zusatz2hint;
     $replaces["MAT_EVENT_ZUSATZ3HINT"] = $event->zusatz3hint;
     $replaces["MAT_EVENT_ZUSATZ4HINT"] = $event->zusatz4hint;
     $replaces["MAT_EVENT_ZUSATZ5HINT"] = $event->zusatz5hint;
     $replaces["MAT_EVENT_ZUSATZ6HINT"] = $event->zusatz6hint;
     $replaces["MAT_EVENT_ZUSATZ7HINT"] = $event->zusatz7hint;
     $replaces["MAT_EVENT_ZUSATZ8HINT"] = $event->zusatz8hint;
     $replaces["MAT_EVENT_ZUSATZ9HINT"] = $event->zusatz9hint;
     /* ALIAS */
     $replaces["MAT_EVENT_CUSTOM10HINT"] = $event->zusatz10hint;
     $replaces["MAT_EVENT_CUSTOM11HINT"] = $event->zusatz11hint;
     $replaces["MAT_EVENT_CUSTOM12HINT"] = $event->zusatz12hint;
     $replaces["MAT_EVENT_CUSTOM13HINT"] = $event->zusatz13hint;
     $replaces["MAT_EVENT_CUSTOM14HINT"] = $event->zusatz14hint;
     $replaces["MAT_EVENT_CUSTOM15HINT"] = $event->zusatz15hint;
     $replaces["MAT_EVENT_CUSTOM16HINT"] = $event->zusatz16hint;
     $replaces["MAT_EVENT_CUSTOM17HINT"] = $event->zusatz17hint;
     $replaces["MAT_EVENT_CUSTOM18HINT"] = $event->zusatz18hint;
     $replaces["MAT_EVENT_CUSTOM19HINT"] = $event->zusatz19hint;
     $replaces["MAT_EVENT_CUSTOM20HINT"] = $event->zusatz20hint;
     $replaces["MAT_EVENT_CUSTOM1HINT"] = $event->zusatz1hint;
     $replaces["MAT_EVENT_CUSTOM2HINT"] = $event->zusatz2hint;
     $replaces["MAT_EVENT_CUSTOM3HINT"] = $event->zusatz3hint;
     $replaces["MAT_EVENT_CUSTOM4HINT"] = $event->zusatz4hint;
     $replaces["MAT_EVENT_CUSTOM5HINT"] = $event->zusatz5hint;
     $replaces["MAT_EVENT_CUSTOM6HINT"] = $event->zusatz6hint;
     $replaces["MAT_EVENT_CUSTOM7HINT"] = $event->zusatz7hint;
     $replaces["MAT_EVENT_CUSTOM8HINT"] = $event->zusatz8hint;
     $replaces["MAT_EVENT_CUSTOM9HINT"] = $event->zusatz9hint;
     $replaces["MAT_EVENT_CREATED_BY"] = $event->created_by;
     $replaces["MAT_EVENT_MODIFIED_BY"] = $event->modified_by;
     $replaces["MAT_EVENT_CREATED"] = JHTML::_('date', $event->created, MatukioHelperSettings::getSettings('date_format', 'd-m-Y, H:i'));
     $replaces["MAT_EVENT_WEBINAR"] = $event->webinar;
     if ($booking != null) {
         if (empty($booking->sid)) {
             $booking->sid = $booking->id;
         }
         // Booking data
         $replaces["MAT_BOOKING_ID"] = $booking->sid;
         $replaces["MAT_BOOKING_NUMBER"] = MatukioHelperUtilsBooking::getBookingId($booking->sid);
         $replaces["MAT_SIGN"] = "<span> </span>";
         $user = JFactory::getUser($booking->userid);
         $replaces["MAT_BOOKING_USERNAME"] = "";
         if ($booking->userid > 0) {
             $replaces["MAT_BOOKING_USERNAME"] = $user->username;
         }
         if (isset($booking->aname)) {
             $booking->aname = trim($booking->aname);
         }
         if (isset($booking->name)) {
             $booking->name = trim($booking->name);
         }
         // Old form
         if (isset($booking->aname) && !empty($booking->aname)) {
             $replaces["MAT_BOOKING_NAME"] = $booking->aname;
         } elseif (isset($booking->name) && !empty($booking->name)) {
             $replaces["MAT_BOOKING_NAME"] = $booking->name;
         }
         if (isset($booking->aemail) && !empty($booking->aemail)) {
             $replaces["MAT_BOOKING_EMAIL"] = $booking->aemail;
         } elseif (isset($booking->email) && !empty($booking->email)) {
             $replaces["MAT_BOOKING_EMAIL"] = $booking->email;
         }
         // Fix for empty E-Mail
         if (empty($replaces["MAT_BOOKING_EMAIL"])) {
             $replaces["MAT_BOOKING_EMAIL"] = $booking->email;
         }
         $replaces["MAT_BOOKING_SID"] = $booking->sid;
         $replaces["MAT_BOOKING_SEMID"] = $booking->semid;
         $replaces["MAT_BOOKING_USERID"] = $booking->userid;
         $replaces["MAT_BOOKING_CERTIFICATED"] = $booking->certificated;
         $replaces["MAT_EVENT_BOOKINGDATE"] = JHTML::_('date', $booking->bookingdate, MatukioHelperSettings::getSettings('date_format', 'd-m-Y, H:i'));
         $replaces["MAT_EVENT_UPDATED"] = JHTML::_('date', $booking->updated, MatukioHelperSettings::getSettings('date_format', 'd-m-Y, H:i'));
         $replaces["MAT_INVOICE_DATE"] = JHTML::_('date', $booking->bookingdate, MatukioHelperSettings::getSettings('date_format_without_time', 'd-m-Y'));
         if ($booking->payment_brutto > 0) {
             $replaces["MAT_INVOICE_NUMBER"] = MatukioHelperInvoice::getInvoiceNumber($booking->id, JHTML::_('date', $booking->bookingdate, 'Y'));
         } else {
             $replaces["MAT_INVOICE_NUMBER"] = "";
         }
         $replaces["MAT_BOOKING_PAID"] = MatukioHelperUtilsBooking::getBookingPaidName($booking->paid);
         $replaces["MAT_BOOKING_PAID_NUM"] = $booking->paid;
         $replaces["MAT_BOOKING_PAYMENT_STATUS"] = $booking->payment_status;
         $replaces["MAT_BOOKING_PAYMENT_PLUGIN_DATA"] = $booking->payment_plugin_data;
         $replaces["MAT_BOOKING_NRBOOKED"] = $booking->nrbooked;
         // Alias
         $replaces["MAT_BOOKING_BOOKEDNR"] = $booking->nrbooked;
         $replaces["MAT_BOOKING_ZUSATZ10"] = $booking->zusatz10;
         $replaces["MAT_BOOKING_ZUSATZ11"] = $booking->zusatz11;
         $replaces["MAT_BOOKING_ZUSATZ12"] = $booking->zusatz12;
         $replaces["MAT_BOOKING_ZUSATZ13"] = $booking->zusatz13;
         $replaces["MAT_BOOKING_ZUSATZ14"] = $booking->zusatz14;
         $replaces["MAT_BOOKING_ZUSATZ15"] = $booking->zusatz15;
         $replaces["MAT_BOOKING_ZUSATZ16"] = $booking->zusatz16;
         $replaces["MAT_BOOKING_ZUSATZ17"] = $booking->zusatz17;
         $replaces["MAT_BOOKING_ZUSATZ18"] = $booking->zusatz18;
         $replaces["MAT_BOOKING_ZUSATZ19"] = $booking->zusatz19;
         $replaces["MAT_BOOKING_ZUSATZ20"] = $booking->zusatz20;
         $replaces["MAT_BOOKING_ZUSATZ1"] = $booking->zusatz1;
         $replaces["MAT_BOOKING_ZUSATZ2"] = $booking->zusatz2;
         $replaces["MAT_BOOKING_ZUSATZ3"] = $booking->zusatz3;
         $replaces["MAT_BOOKING_ZUSATZ4"] = $booking->zusatz4;
         $replaces["MAT_BOOKING_ZUSATZ5"] = $booking->zusatz5;
         $replaces["MAT_BOOKING_ZUSATZ6"] = $booking->zusatz6;
         $replaces["MAT_BOOKING_ZUSATZ7"] = $booking->zusatz7;
         $replaces["MAT_BOOKING_ZUSATZ8"] = $booking->zusatz8;
         $replaces["MAT_BOOKING_ZUSATZ9"] = $booking->zusatz9;
         /* Alias */
         $replaces["MAT_BOOKING_CUSTOM10"] = $booking->zusatz10;
         $replaces["MAT_BOOKING_CUSTOM11"] = $booking->zusatz11;
         $replaces["MAT_BOOKING_CUSTOM12"] = $booking->zusatz12;
         $replaces["MAT_BOOKING_CUSTOM13"] = $booking->zusatz13;
         $replaces["MAT_BOOKING_CUSTOM14"] = $booking->zusatz14;
         $replaces["MAT_BOOKING_CUSTOM15"] = $booking->zusatz15;
         $replaces["MAT_BOOKING_CUSTOM16"] = $booking->zusatz16;
         $replaces["MAT_BOOKING_CUSTOM17"] = $booking->zusatz17;
         $replaces["MAT_BOOKING_CUSTOM18"] = $booking->zusatz18;
         $replaces["MAT_BOOKING_CUSTOM19"] = $booking->zusatz19;
         $replaces["MAT_BOOKING_CUSTOM20"] = $booking->zusatz20;
         $replaces["MAT_BOOKING_CUSTOM1"] = $booking->zusatz1;
         $replaces["MAT_BOOKING_CUSTOM2"] = $booking->zusatz2;
         $replaces["MAT_BOOKING_CUSTOM3"] = $booking->zusatz3;
         $replaces["MAT_BOOKING_CUSTOM4"] = $booking->zusatz4;
         $replaces["MAT_BOOKING_CUSTOM5"] = $booking->zusatz5;
         $replaces["MAT_BOOKING_CUSTOM6"] = $booking->zusatz6;
         $replaces["MAT_BOOKING_CUSTOM7"] = $booking->zusatz7;
         $replaces["MAT_BOOKING_CUSTOM8"] = $booking->zusatz8;
         $replaces["MAT_BOOKING_CUSTOM9"] = $booking->zusatz9;
         $replaces["MAT_BOOKING_UUID"] = $booking->uuid;
         if (!empty($booking->payment_method)) {
             $replaces["MAT_BOOKING_PAYMENT_METHOD"] = self::getPaymentMethodTitle($booking->payment_method);
         } else {
             $replaces["MAT_BOOKING_PAYMENT_METHOD"] = "";
         }
         $replaces["MAT_BOOKING_PAYMENT_METHOD_RAW"] = $booking->payment_method;
         $replaces["MAT_BOOKING_PAYMENT_NUMBER"] = $booking->payment_number;
         $replaces["MAT_BOOKING_PAYMENT_NETTO"] = MatukioHelperUtilsEvents::getFormatedCurrency($booking->payment_netto, MatukioHelperSettings::_('currency_symbol', '$'));
         $replaces["MAT_BOOKING_PAYMENT_NET"] = $replaces["MAT_BOOKING_PAYMENT_NETTO"];
         $replaces["MAT_BOOKING_PAYMENT_TAX"] = MatukioHelperUtilsEvents::getFormatedCurrency($booking->payment_tax, MatukioHelperSettings::_('currency_symbol', '$'));
         $replaces["MAT_BOOKING_PAYMENT_BRUTTO"] = MatukioHelperUtilsEvents::getFormatedCurrency($booking->payment_brutto, MatukioHelperSettings::_('currency_symbol', '$'));
         $replaces["MAT_BOOKING_PAYMENT_GROSS"] = $replaces["MAT_BOOKING_PAYMENT_BRUTTO"];
         $replaces["MAT_BOOKING_COUPON_CODE"] = $booking->coupon_code;
         $replaces["MAT_BOOKING_STATUS"] = MatukioHelperUtilsBooking::getBookingStatusName($booking->status);
         /* Mark since 4.5 */
         $replaces["MAT_BOOKING_MARK"] = $booking->mark;
         /* QR Codes */
         $replaces["MAT_BOOKING_QRCODE_ID"] = MatukioHelperUtilsBooking::getBookingIdQRCode($booking->sid);
         $replaces["MAT_BOOKING_QRCODE"] = $replaces["MAT_BOOKING_QRCODE_ID"];
         $replaces["MAT_BOOKING_BARCODE"] = MatukioHelperUtilsBooking::getBookingIdBarcode($booking->sid);
         // Checkin URLs and QR-Codes since 4.5
         $checkinurl = JRoute::_("index.php?option=com_matukio&view=booking&task=checkin&uuid=" . $booking->uuid . "&Itemid=" . $itemId, true, -1);
         $replaces["MAT_BOOKING_CHECKIN_URL"] = $checkinurl;
         $replaces["MAT_BOOKING_CHECKIN_LINK"] = '<a href="' . $checkinurl . '">' . JText::_("COM_MATUKIO_CHECKIN_BOOKING") . "</a>";
         $replaces["MAT_BOOKING_CHECKIN_QRCODE"] = MatukioHelperUtilsBooking::getBookingCheckinQRCode($checkinurl, $booking->sid);
         if ($event->fees > 0) {
             $replaces["MAT_BOOKING_FEES_STATUS"] = MatukioHelperUtilsEvents::getFormatedCurrency($booking->payment_brutto, MatukioHelperSettings::_('currency_symbol', '$')) . " (" . MatukioHelperUtilsBooking::getBookingPaidName($booking->paid) . ")";
         } else {
             $replaces["MAT_BOOKING_FEES_STATUS"] = JText::_("COM_MATUKIO_FREE_EVENT");
         }
         // Booking detail page @since 4.1.1
         $replaces["MAT_BOOKING_DETAILPAGE_URL"] = JRoute::_("index.php?option=com_matukio&view=booking&uuid=" . $booking->uuid . "&Itemid=" . $itemId, true, -1);
         $replaces["MAT_BOOKING_DETAILPAGE"] = '<a href="' . JRoute::_("index.php?option=com_matukio&view=booking&uuid=" . $booking->uuid . "&Itemid=" . $itemId, true, -1) . '">' . JText::_("COM_MATUKIO_BOOKING_DETAILS") . "</a>";
         $editbookinglink = JRoute::_("index.php?option=com_matukio&view=bookevent&cid=" . $booking->semid . "&uuid=" . $booking->uuid . "&Itemid=" . $itemId, true, -1);
         if (MatukioHelperSettings::getSettings('oldbookingform', 0) == 1) {
             $editbookinglink = JRoute::_(MatukioHelperRoute::getEventRoute($event->id, $event->catid, 1, $booking->id, $booking->uuid), true, -1);
         }
         $replaces["MAT_BOOKING_EDIT_URL"] = $editbookinglink;
         $replaces["MAT_BOOKING_EDIT"] = '<a href="' . $editbookinglink . '">' . JText::_("COM_MATUKIO_EDIT_YOUR_BOOKING") . "</a>";
         // TODO Different fees
     }
     // Event info complete no booking here
     $replaces["MAT_EVENT_ALL_DETAILS_HTML"] = self::getEmailEventInfoHTML($event);
     $replaces["MAT_EVENT_ALL_DETAILS_TEXT"] = self::getEmailEventInfoTEXT($event);
     /* Other things */
     $replaces["MAT_BANK_TRANSFER_INFORMATIONS"] = MatukioHelperPayment::getBanktransferInfo(MatukioHelperSettings::getSettings("banktransfer_account", ''), MatukioHelperSettings::getSettings("banktransfer_blz", ''), MatukioHelperSettings::getSettings("banktransfer_bank", ''), MatukioHelperSettings::getSettings("banktransfer_accountholder", ''), MatukioHelperSettings::getSettings("banktransfer_iban", ''), MatukioHelperSettings::getSettings("banktransfer_bic", ''));
     // CSV
     $bookingnewname = "";
     if ($booking != null) {
         $replaces["MAT_CSV_BOOKING_DETAILS"] = self::getExportCSVBookingDetails($booking, $event, MatukioHelperSettings::getSettings('export_csv_separator', ';'));
         if (MatukioHelperSettings::getSettings('oldbookingform', 0) == 1) {
             // Old booking form
             if ($booking->userid > 0) {
                 $user = JFactory::getUser($booking->userid);
                 $replaces["MAT_BOOKING_NAME"] = $user->name;
                 $replaces["MAT_BOOKING_EMAIL"] = $user->email;
             }
         } else {
             // New booking form fields
             $fields = MatukioHelperUtilsBooking::getBookingFields();
             $fieldvals = explode(";", $booking->newfields);
             $value = array();
             foreach ($fieldvals as $val) {
                 $tmp = explode("::", $val);
                 if (count($tmp) > 1) {
                     $value[$tmp[0]] = $tmp[1];
                 } else {
                     $value[$tmp[0]] = "";
                 }
             }
             foreach ($fields as $field) {
                 if (!empty($value[$field->id])) {
                     // Not use the Spacer fields
                     if ($field->type != "spacer" && $field->type != "spacertext") {
                         $replaces["MAT_BOOKING_" . strtoupper($field->field_name)] = $value[$field->id];
                     }
                     if ($field->field_name == "firstname") {
                         $bookingnewname .= $value[$field->id];
                     }
                     if ($field->field_name == "lastname") {
                         $bookingnewname .= " " . $value[$field->id];
                     }
                 } else {
                     // Not use the Spacer fields
                     if ($field->type != "spacer" && $field->type != "spacertext") {
                         $replaces["MAT_BOOKING_" . strtoupper($field->field_name)] = "";
                     }
                 }
             }
             $bookingnewname = trim($bookingnewname);
             $replaces["MAT_BOOKING_COMMENT"] = $booking->comment;
             if (empty($replaces["MAT_BOOKING_NAME"])) {
                 if (!empty($bookingnewname)) {
                     $replaces["MAT_BOOKING_NAME"] = $bookingnewname;
                 } else {
                     if ($booking->userid > 0) {
                         $user = JFactory::getUser($booking->userid);
                         $replaces["MAT_BOOKING_NAME"] = $user->name;
                     }
                 }
             }
         }
         if (empty($replaces["MAT_BOOKING_EMAIL"])) {
             if ($booking->userid > 0) {
                 $user = JFactory::getUser($booking->userid);
                 $replaces["MAT_BOOKING_EMAIL"] = $user->email;
             }
         }
         // Booking complete
         $replaces["MAT_BOOKING_ALL_DETAILS_HTML"] = self::getEmailBookingInfoHTML($event, $booking, $bookingnewname);
         $replaces["MAT_BOOKING_ALL_DETAILS_TEXT"] = self::getEmailBookingInfoTEXT($event, $booking, $bookingnewname);
     }
     return $replaces;
 }