- Created an attendize config file and remove the constants

- Bumped the version of Laravel to 5.1.20
This commit is contained in:
Dave 2016-03-04 23:27:13 +00:00
parent e7a2dadf78
commit 4598b8e8ed
36 changed files with 4660 additions and 129 deletions

View File

@ -1,57 +0,0 @@
<?php
define('OUTGOING_EMAIL_NOREPLY', env('MAIL_FROM_ADDRESS'));
define('OUTGOING_EMAIL', env('MAIL_FROM_ADDRESS'));
define('OUTGOING_EMAIL_NAME', 'Attendize Event Ticketing');
define('INCOMING_EMAIL', env('MAIL_FROM_ADDRESS'));
define('APP_URL', env('APP_URL'));
define('APP_NAME', 'Attendize Event Ticketing');
define('EVENT_DEFAULT_BG_COLOR', '#B23333');
/* paths */
define('EVENT_IMAGES_PATH', 'user_content/event_images/');
define('ORGANISER_IMAGES_PATH', 'user_content/organiser_images/');
define('EVENT_PDF_TICKETS_PATH', 'user_content/pdf_tickets/');
define('EVENT_BG_IMAGES', 'assets/images/public/EventPage/backgrounds');
/*
*
*/
define('FALLBACK_ORGANISER_LOGO_URL', '/assets/images/logo-100x100-lightBg.png');
define('CDN_URL', '');
define('MAX_TICKETS_PER_PERSON', 50);
/* Time in minutes which a user can reserve tickets */
define('CHECKOUT_TIMEOUT_AFTER', 8);
define('TICKET_STATUS_SOLD_OUT', 1);
define('TICKET_STATUS_AFTER_SALE_DATE', 2);
define('TICKET_STATUS_BEFORE_SALE_DATE', 3);
define('TICKET_STATUS_ON_SALE', 4);
define('TICKET_STATUS_OFF_SALE', 5);
/* The fee which we charge users for buying tikets. Fixed fee + % of ticket sale. */
define('TICKET_BOOKING_FEE_FIXED', .0);
define('TICKET_BOOKING_FEE_PERCENTAGE', .0);
define('ORDER_COMPLETE', 1);
define('ORDER_REFUNDED', 2);
define('ORDER_PARTIALLY_REFUNDED', 3);
define('ORDER_CANCELLED', 4);
define('DEFAULT_TIMEZONE', 30); // Europe/Dublin
define('DEFAULT_CURRENCY', 2); // Euro
define('DEFAULT_DATE_FORMAT', 'j M, Y');
define('DEFAULT_DATE_PICKER_FORMAT', 'd M, yyyy');
define('DEFAULT_DATETIME_FORMAT', 'F j, Y, g:i a');
define('DEFAULT_QUERY_CACHE', 120); // minutes
define('DEFAULT_LOCALE', 'en');
define('CDN_URL_USER_ASSETS', '');
define('CDN_URL_STATIC_ASSETS', '');

View File

@ -74,7 +74,7 @@ class QueueHandler {
Mail::send('Emails.messageAttendees', $data, function($message) use ($toFields, $event, $message_object) { Mail::send('Emails.messageAttendees', $data, function($message) use ($toFields, $event, $message_object) {
$message->to($toFields) $message->to($toFields)
->from(OUTGOING_EMAIL_NOREPLY, $event->organiser->name) ->from(config('attendize.outgoing_email_noreply'), $event->organiser->name)
->replyTo($event->organiser->email, $event->organiser->name) ->replyTo($event->organiser->email, $event->organiser->name)
->subject($message_object->subject); ->subject($message_object->subject);
}); });

View File

@ -33,7 +33,7 @@ class AttendeeMailer extends Mailer {
*/ */
Mail::send('Emails.messageAttendees', $data, function($message) use ($toFields, $event, $message_object) { Mail::send('Emails.messageAttendees', $data, function($message) use ($toFields, $event, $message_object) {
$message->to($toFields) $message->to($toFields)
->from(OUTGOING_EMAIL_NOREPLY, $event->organiser->name) ->from(config('attendize.outgoing_email_noreply'), $event->organiser->name)
->replyTo($event->organiser->email, $event->organiser->name) ->replyTo($event->organiser->email, $event->organiser->name)
->subject($message_object->subject); ->subject($message_object->subject);
}); });

View File

@ -9,7 +9,7 @@ class Mailer
{ {
Mail::send($view, $data, function ($message) use ($toEmail, $fromEmail, $fromName, $subject, $attachment) { Mail::send($view, $data, function ($message) use ($toEmail, $fromEmail, $fromName, $subject, $attachment) {
$replyEmail = $fromEmail; $replyEmail = $fromEmail;
$fromEmail = OUTGOING_EMAIL; $fromEmail = config('attendize.outgoing_email');
if ($attachment) { if ($attachment) {
$message->attach($attachment); $message->attach($attachment);

View File

@ -6,7 +6,7 @@ class OrderMailer extends Mailer {
public function sendOrderNotification(Order $order) { public function sendOrderNotification(Order $order) {
$this->sendTo($order->account->email, OUTGOING_EMAIL, OUTGOING_EMAIL_NAME, 'New order received on the event '. $order->event->title .' ['. $order->order_reference .']', 'Emails.OrderNotification', [ $this->sendTo($order->account->email, config('attendize.outgoing_email'), config('attendize.outgoing_email_name'), 'New order received on the event '. $order->event->title .' ['. $order->order_reference .']', 'Emails.OrderNotification', [
'order' => $order 'order' => $order
]); ]);
} }
@ -19,14 +19,14 @@ class OrderMailer extends Mailer {
$ticket_pdf = FALSE; $ticket_pdf = FALSE;
} }
$this->sendTo($order->email, OUTGOING_EMAIL, $order->event->organiser->name, 'Your tickets & order confirmation for the event '. $order->event->title .' ['. $order->order_reference .']', 'Emails.OrderConfirmation', [ $this->sendTo($order->email, config('attendize.outgoing_email'), $order->event->organiser->name, 'Your tickets & order confirmation for the event '. $order->event->title .' ['. $order->order_reference .']', 'Emails.OrderConfirmation', [
'order' => $order, 'order' => $order,
'email_logo' => $order->event->organiser->full_logo_path 'email_logo' => $order->event->organiser->full_logo_path
], $ticket_pdf); ], $ticket_pdf);
} }
public function sendTickets(Order $order) { public function sendTickets(Order $order) {
// $this->sendTo($order->account->email, OUTGOING_EMAIL, OUTGOING_EMAIL_NAME, 'New order received on the event '. $order->event->title .' ['. $order->order_reference .']', 'Emails.OrderNotification', [ // $this->sendTo($order->account->email, config('attendize.outgoing_email'), config('attendize.outgoing_email_name'), 'New order received on the event '. $order->event->title .' ['. $order->order_reference .']', 'Emails.OrderNotification', [
// 'order' => $order // 'order' => $order
// ]); // ]);
} }

View File

@ -129,7 +129,7 @@ class EventAttendeesController extends MyBaseController {
$order->first_name = $attendee_first_name; $order->first_name = $attendee_first_name;
$order->last_name = $attendee_last_name; $order->last_name = $attendee_last_name;
$order->email = $attendee_email; $order->email = $attendee_email;
$order->order_status_id = ORDER_COMPLETE; $order->order_status_id = config('attendize.order_complete');
$order->amount = $ticket_price; $order->amount = $ticket_price;
$order->account_id = Auth::user()->account_id; $order->account_id = Auth::user()->account_id;
$order->event_id = $event_id; $order->event_id = $event_id;
@ -241,7 +241,7 @@ class EventAttendeesController extends MyBaseController {
Mail::send('Emails.messageAttendees', $data, function($message) use ($attendee, $data) { Mail::send('Emails.messageAttendees', $data, function($message) use ($attendee, $data) {
$message->to($attendee->email, $attendee->full_name) $message->to($attendee->email, $attendee->full_name)
->from(OUTGOING_EMAIL_NOREPLY, $attendee->event->organiser->name) ->from(config('attendize.outgoing_email_noreply'), $attendee->event->organiser->name)
->replyTo($attendee->event->organiser->email, $attendee->event->organiser->name) ->replyTo($attendee->event->organiser->email, $attendee->event->organiser->name)
->subject($data['subject']); ->subject($data['subject']);
}); });
@ -250,7 +250,7 @@ class EventAttendeesController extends MyBaseController {
if (Input::get('send_copy') == '1') { if (Input::get('send_copy') == '1') {
Mail::send('Emails.messageAttendees', $data, function($message) use ($attendee, $data) { Mail::send('Emails.messageAttendees', $data, function($message) use ($attendee, $data) {
$message->to($attendee->event->organiser->email, $attendee->event->organiser->name) $message->to($attendee->event->organiser->email, $attendee->event->organiser->name)
->from(OUTGOING_EMAIL_NOREPLY, $attendee->event->organiser->name) ->from(config('attendize.outgoing_email_noreply'), $attendee->event->organiser->name)
->replyTo($attendee->event->organiser->email, $attendee->event->organiser->name) ->replyTo($attendee->event->organiser->email, $attendee->event->organiser->name)
->subject($data['subject'] . '[ORGANISER COPY]'); ->subject($data['subject'] . '[ORGANISER COPY]');
}); });
@ -318,8 +318,8 @@ class EventAttendeesController extends MyBaseController {
$excel->setTitle('Attendees List'); $excel->setTitle('Attendees List');
// Chain the setters // Chain the setters
$excel->setCreator(APP_NAME) $excel->setCreator(config('attendize.app_name'))
->setCompany(APP_NAME); ->setCompany(config('attendize.app_name'));
$excel->sheet('attendees_sheet_1', function($sheet) use ($event_id) { $excel->sheet('attendees_sheet_1', function($sheet) use ($event_id) {
@ -433,7 +433,7 @@ class EventAttendeesController extends MyBaseController {
if (Input::get('notify_attendee') == '1') { if (Input::get('notify_attendee') == '1') {
Mail::send('Emails.notifyCancelledAttendee', $data, function($message) use ($attendee) { Mail::send('Emails.notifyCancelledAttendee', $data, function($message) use ($attendee) {
$message->to($attendee->email, $attendee->full_name) $message->to($attendee->email, $attendee->full_name)
->from(OUTGOING_EMAIL_NOREPLY, $attendee->event->organiser->name) ->from(config('attendize.outgoing_email_noreply'), $attendee->event->organiser->name)
->replyTo($attendee->event->organiser->email, $attendee->event->organiser->name) ->replyTo($attendee->event->organiser->email, $attendee->event->organiser->name)
->subject('You\'re ticket has been cancelled'); ->subject('You\'re ticket has been cancelled');
}); });

View File

@ -47,7 +47,7 @@ class EventCheckoutController extends Controller
/* /*
* Order expires after X min * Order expires after X min
*/ */
$order_expires_time = Carbon::now()->addMinutes(CHECKOUT_TIMEOUT_AFTER); $order_expires_time = Carbon::now()->addMinutes(config('attendize.checkout_timeout_after'));
$event = Event::findOrFail($event_id); $event = Event::findOrFail($event_id);
@ -326,7 +326,7 @@ class EventCheckoutController extends Controller
$order->first_name = Input::get('order_first_name'); $order->first_name = Input::get('order_first_name');
$order->last_name = Input::get('order_last_name'); $order->last_name = Input::get('order_last_name');
$order->email = Input::get('order_email'); $order->email = Input::get('order_email');
$order->order_status_id = ORDER_COMPLETE; $order->order_status_id = config('attendize.order_complete');
$order->amount = $ticket_order['order_total']; $order->amount = $ticket_order['order_total'];
$order->booking_fee = $ticket_order['booking_fee']; $order->booking_fee = $ticket_order['booking_fee'];
$order->organiser_booking_fee = $ticket_order['organiser_booking_fee']; $order->organiser_booking_fee = $ticket_order['organiser_booking_fee'];

View File

@ -112,7 +112,7 @@ class EventController extends MyBaseController {
if (Input::hasFile('event_image')) { if (Input::hasFile('event_image')) {
$path = public_path() . '/' . EVENT_IMAGES_PATH; $path = public_path() . '/' . config('attendize.event_images_path');
$filename = 'event_image-' . md5(time() . $event->id) . '.' . strtolower(Input::file('event_image')->getClientOriginalExtension()); $filename = 'event_image-' . md5(time() . $event->id) . '.' . strtolower(Input::file('event_image')->getClientOriginalExtension());
$file_full_path = $path . '/' . $filename; $file_full_path = $path . '/' . $filename;
@ -130,11 +130,11 @@ class EventController extends MyBaseController {
$img->save($file_full_path); $img->save($file_full_path);
/* Upload to s3 */ /* Upload to s3 */
\Storage::put(EVENT_IMAGES_PATH.'/'.$filename, file_get_contents($file_full_path)); \Storage::put(config('attendize.event_images_path').'/'.$filename, file_get_contents($file_full_path));
$eventImage = EventImage::createNew(); $eventImage = EventImage::createNew();
$eventImage->image_path = EVENT_IMAGES_PATH . '/' . $filename; $eventImage->image_path = config('attendize.event_images_path') . '/' . $filename;
$eventImage->event_id = $event->id; $eventImage->event_id = $event->id;
$eventImage->save(); $eventImage->save();
} }
@ -217,7 +217,7 @@ class EventController extends MyBaseController {
if (Input::hasFile('event_image')) { if (Input::hasFile('event_image')) {
$path = public_path() . '/' . EVENT_IMAGES_PATH; $path = public_path() . '/' . config('attendize.event_images_path');
$filename = 'event_image-' . md5(time() . $event->id) . '.' . strtolower(Input::file('event_image')->getClientOriginalExtension()); $filename = 'event_image-' . md5(time() . $event->id) . '.' . strtolower(Input::file('event_image')->getClientOriginalExtension());
$file_full_path = $path . '/' . $filename; $file_full_path = $path . '/' . $filename;
@ -234,12 +234,12 @@ class EventController extends MyBaseController {
$img->save($file_full_path); $img->save($file_full_path);
\Storage::put(EVENT_IMAGES_PATH.'/'.$filename, file_get_contents($file_full_path)); \Storage::put(config('attendize.event_images_path').'/'.$filename, file_get_contents($file_full_path));
EventImage::where('event_id', '=', $event->id)->delete(); EventImage::where('event_id', '=', $event->id)->delete();
$eventImage = EventImage::createNew(); $eventImage = EventImage::createNew();
$eventImage->image_path = EVENT_IMAGES_PATH . '/' . $filename; $eventImage->image_path = config('attendize.event_images_path') . '/' . $filename;
$eventImage->event_id = $event->id; $eventImage->event_id = $event->id;
$eventImage->save(); $eventImage->save();
} }
@ -259,7 +259,7 @@ class EventController extends MyBaseController {
$the_file = \File::get(Input::file('event_image')->getRealPath()); $the_file = \File::get(Input::file('event_image')->getRealPath());
$file_name = 'event_details_image-' . md5(microtime()) . '.' . strtolower(Input::file('event_image')->getClientOriginalExtension()); $file_name = 'event_details_image-' . md5(microtime()) . '.' . strtolower(Input::file('event_image')->getClientOriginalExtension());
$relative_path_to_file = EVENT_IMAGES_PATH . '/' . $file_name; $relative_path_to_file = config('attendize.event_images_path') . '/' . $file_name;
$full_path_to_file = public_path().'/'.$relative_path_to_file; $full_path_to_file = public_path().'/'.$relative_path_to_file;
$img = Image::make($the_file); $img = Image::make($the_file);

View File

@ -18,7 +18,7 @@ class EventCustomizeController extends MyBaseController {
$images = []; $images = [];
$files = File::files(public_path() . '/' . EVENT_BG_IMAGES); $files = File::files(public_path() . '/' . config('attendize.event_bg_images'));
foreach ($files as $image) { foreach ($files as $image) {
$images[] = str_replace(public_path(), '', $image); $images[] = str_replace(public_path(), '', $image);
@ -31,7 +31,7 @@ class EventCustomizeController extends MyBaseController {
$images = []; $images = [];
$files = File::files(public_path() . '/' . EVENT_BG_IMAGES.'/thumbs'); $files = File::files(public_path() . '/' . config('attendize.event_bg_images').'/thumbs');
foreach ($files as $image) { foreach ($files as $image) {
$images[] = str_replace(public_path(), '', $image); $images[] = str_replace(public_path(), '', $image);
@ -174,7 +174,7 @@ class EventCustomizeController extends MyBaseController {
*/ */
if (Input::hasFile('bg_image_path') && Input::get('bg_type') == 'custom_image') { if (Input::hasFile('bg_image_path') && Input::get('bg_type') == 'custom_image') {
$path = public_path() . '/' . EVENT_IMAGES_PATH; $path = public_path() . '/' . config('attendize.event_images_path');
$filename = 'event_bg-'. md5($event->id) . '.' . strtolower(Input::file('bg_image_path')->getClientOriginalExtension()); $filename = 'event_bg-'. md5($event->id) . '.' . strtolower(Input::file('bg_image_path')->getClientOriginalExtension());
$file_full_path = $path . '/' . $filename; $file_full_path = $path . '/' . $filename;
@ -192,10 +192,10 @@ class EventCustomizeController extends MyBaseController {
$img->save($file_full_path, 75); $img->save($file_full_path, 75);
$event->bg_image_path = EVENT_IMAGES_PATH . '/' . $filename; $event->bg_image_path = config('attendize.event_images_path') . '/' . $filename;
$event->bg_type = 'custom_image'; $event->bg_type = 'custom_image';
\Storage::put(EVENT_IMAGES_PATH.'/'.$filename, file_get_contents($file_full_path)); \Storage::put(config('attendize.event_images_path').'/'.$filename, file_get_contents($file_full_path));
} }
$event->save(); $event->save();

View File

@ -154,7 +154,7 @@ class EventOrdersController extends MyBaseController
$order->is_refunded = 1; $order->is_refunded = 1;
$order->amount_refunded = $order->organiser_amount; $order->amount_refunded = $order->organiser_amount;
$order->order_status_id = ORDER_REFUNDED; $order->order_status_id = config('attendize.order_refunded');
@ -168,11 +168,11 @@ class EventOrdersController extends MyBaseController
/* Update the event sales volume*/ /* Update the event sales volume*/
$order->event->decrement('sales_volume', $refund_amount); $order->event->decrement('sales_volume', $refund_amount);
$order->order_status_id = ORDER_PARTIALLY_REFUNDED; $order->order_status_id = config('attendize.order_partially_refunded');
if (($order->organiser_amount - $order->amount_refunded) == 0) { if (($order->organiser_amount - $order->amount_refunded) == 0) {
$order->is_refunded = 1; $order->is_refunded = 1;
$order->order_status_id = ORDER_REFUNDED; $order->order_status_id = config('attendize.order_refunded');
} }
$order->is_partially_refunded = 1; $order->is_partially_refunded = 1;
@ -241,8 +241,8 @@ class EventOrdersController extends MyBaseController
$excel->setTitle('Orders For Event: ' . $event->title); $excel->setTitle('Orders For Event: ' . $event->title);
// Chain the setters // Chain the setters
$excel->setCreator(APP_NAME) $excel->setCreator(config('attendize.app_name'))
->setCompany(APP_NAME); ->setCompany(config('attendize.app_name'));
$excel->sheet('orders_sheet_1', function ($sheet) use ($event) { $excel->sheet('orders_sheet_1', function ($sheet) use ($event) {
@ -320,7 +320,7 @@ class EventOrdersController extends MyBaseController
Mail::send('Emails.messageOrder', $data, function ($message) use ($order, $data) { Mail::send('Emails.messageOrder', $data, function ($message) use ($order, $data) {
$message->to($order->email, $order->full_name) $message->to($order->email, $order->full_name)
->from(OUTGOING_EMAIL_NOREPLY, $order->event->organiser->name) ->from(config('attendize.outgoing_email_noreply'), $order->event->organiser->name)
->replyTo($order->event->organiser->email, $order->event->organiser->name) ->replyTo($order->event->organiser->email, $order->event->organiser->name)
->subject($data['subject']); ->subject($data['subject']);
}); });
@ -329,7 +329,7 @@ class EventOrdersController extends MyBaseController
if (Input::get('send_copy') == '1') { if (Input::get('send_copy') == '1') {
Mail::send('Emails.messageOrder', $data, function ($message) use ($order, $data) { Mail::send('Emails.messageOrder', $data, function ($message) use ($order, $data) {
$message->to($order->event->organiser->email) $message->to($order->event->organiser->email)
->from(OUTGOING_EMAIL_NOREPLY, $order->event->organiser->name) ->from(config('attendize.outgoing_email_noreply'), $order->event->organiser->name)
->replyTo($order->event->organiser->email, $order->event->organiser->name) ->replyTo($order->event->organiser->email, $order->event->organiser->name)
->subject($data['subject'] . ' [Organiser copy]'); ->subject($data['subject'] . ' [Organiser copy]');
}); });

View File

@ -93,7 +93,7 @@ class EventViewController extends Controller
Mail::send('Emails.messageOrganiser', $data, function ($message) use ($event, $data) { Mail::send('Emails.messageOrganiser', $data, function ($message) use ($event, $data) {
$message->to($event->organiser->email, $event->organiser->name) $message->to($event->organiser->email, $event->organiser->name)
->from(OUTGOING_EMAIL_NOREPLY, $data['sender_name']) ->from(config('attendize.outgoing_email_noreply'), $data['sender_name'])
->replyTo($data['sender_email'], $data['sender_name']) ->replyTo($data['sender_email'], $data['sender_name'])
->subject('Message Regarding: ' . $event->title); ->subject('Message Regarding: ' . $event->title);
}); });

View File

@ -87,7 +87,7 @@ class OrganiserController extends MyBaseController {
if (Input::hasFile('organiser_logo')) { if (Input::hasFile('organiser_logo')) {
$path = public_path() . '/' . ORGANISER_IMAGES_PATH; $path = public_path() . '/' . config('attendize.organiser_images_path');
$filename = 'organiser_logo-' . $organiser->id . '.' . strtolower(Input::file('organiser_logo')->getClientOriginalExtension()); $filename = 'organiser_logo-' . $organiser->id . '.' . strtolower(Input::file('organiser_logo')->getClientOriginalExtension());
$file_full_path = $path . '/' . $filename; $file_full_path = $path . '/' . $filename;
@ -104,7 +104,7 @@ class OrganiserController extends MyBaseController {
$img->save($file_full_path); $img->save($file_full_path);
if(file_exists($file_full_path)) { if(file_exists($file_full_path)) {
$organiser->logo_path = ORGANISER_IMAGES_PATH . '/' . $filename; $organiser->logo_path = config('attendize.organiser_images_path') . '/' . $filename;
} }
} }

View File

@ -54,7 +54,7 @@ class OrganiserCustomizeController extends MyBaseController
$the_file = \File::get(Input::file('organiser_logo')->getRealPath()); $the_file = \File::get(Input::file('organiser_logo')->getRealPath());
$file_name = str_slug($organiser->name).'-logo-' . $organiser->id . '.' . strtolower(Input::file('organiser_logo')->getClientOriginalExtension()); $file_name = str_slug($organiser->name).'-logo-' . $organiser->id . '.' . strtolower(Input::file('organiser_logo')->getClientOriginalExtension());
$relative_path_to_file = ORGANISER_IMAGES_PATH . '/' . $file_name; $relative_path_to_file = config('attendize.organiser_images_path') . '/' . $file_name;
$full_path_to_file = public_path().'/'.$relative_path_to_file; $full_path_to_file = public_path().'/'.$relative_path_to_file;
$img = Image::make($the_file); $img = Image::make($the_file);

View File

@ -66,8 +66,8 @@ class UserSignupController extends Controller {
$account->email = Input::get('email'); $account->email = Input::get('email');
$account->first_name = Input::get('first_name'); $account->first_name = Input::get('first_name');
$account->last_name = Input::get('last_name'); $account->last_name = Input::get('last_name');
$account->currency_id = DEFAULT_CURRENCY; $account->currency_id = config('attendize.default_currency');
$account->timezone_id = DEFAULT_TIMEZONE; $account->timezone_id = config('attendize.default_timezone');
$account->save(); $account->save();
$user = new User; $user = new User;

View File

@ -79,10 +79,10 @@ class Event extends MyBaseModel {
} }
public function getFixedFeeAttribute() { public function getFixedFeeAttribute() {
return TICKET_BOOKING_FEE_FIXED + $this->organiser_fee_fixed; return config('attendize.ticket_booking_fee_fixed') + $this->organiser_fee_fixed;
} }
public function getPercentageFeeAttribute() { public function getPercentageFeeAttribute() {
return TICKET_BOOKING_FEE_PERCENTAGE + $this->organiser_fee_percentage; return config('attendize.ticket_booking_fee_percentage') + $this->organiser_fee_percentage;
} }
public function getHappeningNowAttribute() { public function getHappeningNowAttribute() {

View File

@ -72,7 +72,7 @@ class Order extends MyBaseModel {
'attendees' => $this->attendees 'attendees' => $this->attendees
]; ];
$pdf_file_path = public_path(EVENT_PDF_TICKETS_PATH) . '/' . $this->order_reference; $pdf_file_path = public_path(config('attendize.event_pdf_tickets_path')) . '/' . $this->order_reference;
$pdf_file = $pdf_file_path.'.pdf'; $pdf_file = $pdf_file_path.'.pdf';
if (file_exists($pdf_file)) { if (file_exists($pdf_file)) {
@ -86,7 +86,7 @@ class Order extends MyBaseModel {
PDF::setOutputMode('F'); // force to file PDF::setOutputMode('F'); // force to file
PDF::html('Public.ViewEvent.Partials.PDFTicket', $data, $pdf_file_path); PDF::html('Public.ViewEvent.Partials.PDFTicket', $data, $pdf_file_path);
$this->ticket_pdf_path = EVENT_PDF_TICKETS_PATH.'/'.$this->order_reference.'.pdf'; $this->ticket_pdf_path = config('attendize.event_pdf_tickets_path').'/'.$this->order_reference.'.pdf';
$this->save(); $this->save();
return file_exists($pdf_file); return file_exists($pdf_file);

View File

@ -25,11 +25,11 @@ class Organiser extends MyBaseModel {
} }
public function getFullLogoPathAttribute() { public function getFullLogoPathAttribute() {
if($this->logo_path && (file_exists(CDN_URL_USER_ASSETS.'/'.$this->logo_path) || file_exists(public_path($this->logo_path)))) { if($this->logo_path && (file_exists(config('attendize.cdn_url_user_assets').'/'.$this->logo_path) || file_exists(public_path($this->logo_path)))) {
return CDN_URL_USER_ASSETS.'/'.$this->logo_path; return config('attendize.cdn_url_user_assets').'/'.$this->logo_path;
} }
return FALLBACK_ORGANISER_LOGO_URL; return config('attendize.fallback_organiser_logo_url');
} }
public function getOrganiserUrlAttribute() { public function getOrganiserUrlAttribute() {

View File

@ -69,7 +69,7 @@ class Ticket extends MyBaseModel {
public function getBookingFeeAttribute () { public function getBookingFeeAttribute () {
return (int)ceil($this->price) === 0 ? 0 : round(($this->price * (TICKET_BOOKING_FEE_PERCENTAGE / 100)) + (TICKET_BOOKING_FEE_FIXED), 2); return (int)ceil($this->price) === 0 ? 0 : round(($this->price * (config('attendize.ticket_booking_fee_percentage') / 100)) + (config('attendize.ticket_booking_fee_fixed')), 2);
} }
public function getOrganiserBookingFeeAttribute() { public function getOrganiserBookingFeeAttribute() {
@ -105,14 +105,14 @@ class Ticket extends MyBaseModel {
* @return int * @return int
public function getMaxPerPersonMaxValueAttribute() { public function getMaxPerPersonMaxValueAttribute() {
return $this->max_per_person === -1 ? MAX_TICKETS_PER_PERSON : $this->max_per_person; return $this->max_per_person === -1 ? config('attendize.max_tickets_per_person') : $this->max_per_person;
} }
*/ */
public function getSaleStatusAttribute() { public function getSaleStatusAttribute() {
if ($this->start_sale_date !== NULL) { if ($this->start_sale_date !== NULL) {
if ($this->start_sale_date->isFuture()) { if ($this->start_sale_date->isFuture()) {
return TICKET_STATUS_BEFORE_SALE_DATE; return config('attendize.ticket_status_before_sale_date');
} }
} }
@ -120,21 +120,21 @@ class Ticket extends MyBaseModel {
if ($this->end_sale_date !== NULL) { if ($this->end_sale_date !== NULL) {
if ($this->end_sale_date->isPast()) { if ($this->end_sale_date->isPast()) {
return TICKET_STATUS_AFTER_SALE_DATE; return config('attendize.ticket_status_after_sale_date');
} }
} }
if ((int)$this->quantity_available > 0) { if ((int)$this->quantity_available > 0) {
if ((int)$this->quantity_remaining <= 0) { if ((int)$this->quantity_remaining <= 0) {
return TICKET_STATUS_SOLD_OUT; return config('attendize.ticket_status_sold_out');
} }
} }
if($this->event->start_date->lte(\Carbon::now())) { if($this->event->start_date->lte(\Carbon::now())) {
return TICKET_STATUS_OFF_SALE; return config('attendize.ticket_status_off_sale');
} }
return TICKET_STATUS_ON_SALE; return config('attendize.ticket_status_on_sale');
} }

View File

@ -6,7 +6,7 @@
"type": "project", "type": "project",
"homepage" : "https://www.attendize.com", "homepage" : "https://www.attendize.com",
"require": { "require": {
"laravel/framework": "5.1.0", "laravel/framework": "5.1.20",
"illuminate/html": "~5.0", "illuminate/html": "~5.0",
"milon/barcode": "dev-master", "milon/barcode": "dev-master",
"stripe/stripe-php": "1.*", "stripe/stripe-php": "1.*",

4520
composer.lock generated Normal file

File diff suppressed because it is too large Load Diff

47
config/attendize.php Normal file
View File

@ -0,0 +1,47 @@
<?php
return [
'outgoing_email_noreply' => env('MAIL_FROM_ADDRESS'),
'outgoing_email' => env('MAIL_FROM_ADDRESS'),
'outgoing_email_name' => env('Attendize Event Ticketing'),
'incoming_email' => env('MAIL_FROM_ADDRESS'),
'app_name' => 'Attendize Event Ticketing',
'event_default_bg_color' => '#B23333',
'event_images_path' => 'user_content/event_images/',
'organiser_images_path' => 'user_content/organiser_images/',
'event_pdf_tickets_path' => 'user_content/pdf_tickets/',
'event_bg_images' => 'assets/images/public/EventPage/backgrounds',
'fallback_organiser_logo_url' => '/assets/images/logo-100x100-lightBg.png',
'cdn_url' => '',
'max_tickets_per_person' => 30, #Depreciated
'checkout_timeout_after' => 8, #mintutes
'ticket_status_sold_out' => 1,
'ticket_status_after_sale_date' => 2,
'ticket_status_before_sale_date' => 3,
'ticket_status_on_sale' => 4,
'ticket_status_off_sale' => 5,
'ticket_booking_fee_fixed' => 0,
'ticket_booking_fee_percentage' => 0,
'order_complete' => 1,
'order_refunded' => 2,
'order_partially_refunded' => 3,
'order_cancelled' => 4,
'default_timezone' => 30, #Europe/Dublin
'default_currency' => 2, #Euro
'default_date_format' => 'j M, Y',
'default_date_picker_format' => 'd M, yyyy',
'default_datetime_format' => 'F j, Y, g:i a',
'default_query_cache' => 120, #Minutes
'default_locale' => 'en',
'cdn_url_user_assets' => '',
'cdn_url_static_assets' => ''
];

View File

@ -174,7 +174,7 @@ class CreateUsersTable extends Migration {
$t->string('title'); $t->string('title');
$t->string('location'); $t->string('location');
$t->string('bg_type', 15)->default('color'); $t->string('bg_type', 15)->default('color');
$t->string('bg_color')->default(EVENT_DEFAULT_BG_COLOR); $t->string('bg_color')->default(config('attendize.event_default_bg_color'));
$t->string('bg_image_path'); $t->string('bg_image_path');
$t->text('description'); $t->text('description');

View File

@ -20,7 +20,7 @@
</p> </p>
<br> <br>
<p style="color:#999;"> <p style="color:#999;">
If you have any questions, simply contact us at <a href='mailto:{{INCOMING_EMAIL}}'>{{INCOMING_EMAIL}}</a> and we'll be happy to help. If you have any questions, simply contact us at <a href='mailto:{{config('attendize.incoming_email')}}'>{{config('attendize.incoming_email')}}</a> and we'll be happy to help.
</p> </p>
@stop @stop

View File

@ -20,7 +20,7 @@
</p> </p>
<br> <br>
<p style="color:#999;"> <p style="color:#999;">
If you have any questions, simply contact us at <a href='mailto:{{INCOMING_EMAIL}}'>{{INCOMING_EMAIL}}</a> and we'll be happy to help. If you have any questions, simply contact us at <a href='mailto:{{config('attendize.incoming_email')}}'>{{config('attendize.incoming_email')}}</a> and we'll be happy to help.
</p> </p>
@stop @stop

View File

@ -20,7 +20,7 @@
</p> </p>
<br> <br>
<p style="color:#999;"> <p style="color:#999;">
If you have any questions, simply contact us at <a href='mailto:{{INCOMING_EMAIL}}'>{{INCOMING_EMAIL}}</a> and we'll be happy to help. If you have any questions, simply contact us at <a href='mailto:{{config('attendize.incoming_email')}}'>{{config('attendize.incoming_email')}}</a> and we'll be happy to help.
</p> </p>
@stop @stop

View File

@ -19,7 +19,7 @@
</p> </p>
<br> <br>
<p style="color:#999;"> <p style="color:#999;">
If you have any questions, simply contact us at <a href='mailto:{{INCOMING_EMAIL}}'>{{INCOMING_EMAIL}}</a> and we'll be happy to help. If you have any questions, simply contact us at <a href='mailto:{{config('attendize.incoming_email')}}'>{{config('attendize.incoming_email')}}</a> and we'll be happy to help.
</p> </p>
@stop @stop

View File

@ -594,7 +594,7 @@
</p> </p>
<p> <p>
Feel free to <a href="mailto:{{INCOMING_EMAIL}}?subject=HTML Embed Code Help">contact Feel free to <a href="mailto:{{config('attendize.incoming_email')}}?subject=HTML Embed Code Help">contact
us</a> if you require any further information regarding using the HTML embed code. us</a> if you require any further information regarding using the HTML embed code.
</p> </p>

View File

@ -154,7 +154,7 @@ Event Tickets
<a href="#"> <a href="#">
@if($ticket->sale_status === TICKET_STATUS_ON_SALE) @if($ticket->sale_status === config('attendize.ticket_status_on_sale'))
@if($ticket->is_paused) @if($ticket->is_paused)
Ticket Sales Paused &nbsp; Ticket Sales Paused &nbsp;

View File

@ -24,7 +24,7 @@
<meta property="og:type" content="article" /> <meta property="og:type" content="article" />
<meta property="og:url" content="{{$event->event_url}}?utm_source=fb" /> <meta property="og:url" content="{{$event->event_url}}?utm_source=fb" />
@if($event->images->count()) @if($event->images->count())
<meta property="og:image" content="{{CDN_URL_USER_ASSETS.'/'.$event->images->first()['image_path']}}" /> <meta property="og:image" content="{{config('attendize.cdn_url_user_assets').'/'.$event->images->first()['image_path']}}" />
@endif @endif
<meta property="og:description" content="{{{Str::words(strip_tags($event->description)), 20}}}" /> <meta property="og:description" content="{{{Str::words(strip_tags($event->description)), 20}}}" />
<meta property="og:site_name" content="Attendize.com" /> <meta property="og:site_name" content="Attendize.com" />
@ -34,7 +34,7 @@
<![endif]--> <![endif]-->
@yield('head') @yield('head')
{!!HTML::style(CDN_URL_STATIC_ASSETS.'/assets/stylesheet/frontend.css')!!} {!!HTML::style(config('attendize.cdn_url_static_assets').'/assets/stylesheet/frontend.css')!!}
<!--Bootstrap placeholder fix--> <!--Bootstrap placeholder fix-->
<style> <style>
@ -76,12 +76,12 @@
<style>body {background-color: {{(Input::get('bg_color_preview') ? '#'.Input::get('bg_color_preview') : $event->bg_color)}} !important; }</style> <style>body {background-color: {{(Input::get('bg_color_preview') ? '#'.Input::get('bg_color_preview') : $event->bg_color)}} !important; }</style>
@endif @endif
{!!HTML::script(CDN_URL_STATIC_ASSETS.'/assets/javascript/frontend.js')!!} {!!HTML::script(config('attendize.cdn_url_static_assets').'/assets/javascript/frontend.js')!!}
@if (($event->bg_type == 'image' || $event->bg_type == 'custom_image' || Input::get('bg_img_preview')) && !Input::get('bg_color_preview')) @if (($event->bg_type == 'image' || $event->bg_type == 'custom_image' || Input::get('bg_img_preview')) && !Input::get('bg_color_preview'))
<script> <script>
$(function() { $(function() {
$.backstretch('{{(Input::get('bg_img_preview') ? '/'.Input::get('bg_img_preview') : CDN_URL_STATIC_ASSETS.'/'.$event->bg_image_path)}}'); $.backstretch('{{(Input::get('bg_img_preview') ? '/'.Input::get('bg_img_preview') : config('attendize.cdn_url_static_assets').'/'.$event->bg_image_path)}}');
}); });
</script> </script>
@endif @endif

View File

@ -14,7 +14,7 @@
</div> </div>
<div class="col-md-5"> <div class="col-md-5">
<div class="content event_poster"> <div class="content event_poster">
<img alt="{{$event->title}}" src="{{CDN_URL_USER_ASSETS.'/'.$event->images->first()['image_path']}}" /> <img alt="{{$event->title}}" src="{{config('attendize.cdn_url_user_assets').'/'.$event->images->first()['image_path']}}" />
</div> </div>
</div> </div>
@else @else

View File

@ -50,15 +50,15 @@
@else @else
@if($ticket->sale_status === TICKET_STATUS_SOLD_OUT) @if($ticket->sale_status === config('attendize.ticket_status_sold_out'))
<span class="text-danger"> <span class="text-danger">
Sold Out Sold Out
</span> </span>
@elseif($ticket->sale_status === TICKET_STATUS_BEFORE_SALE_DATE) @elseif($ticket->sale_status === config('attendize.ticket_status_before_sale_date'))
<span class="text-danger"> <span class="text-danger">
Sales Have Not Started Sales Have Not Started
</span> </span>
@elseif($ticket->sale_status === TICKET_STATUS_AFTER_SALE_DATE) @elseif($ticket->sale_status === config('attendize.ticket_status_after_sale_date'))
<span class="text-danger"> <span class="text-danger">
Sales Have Ended Sales Have Ended
</span> </span>

View File

@ -139,7 +139,7 @@
<div class='logo'> <div class='logo'>
<!-- <img src="http://dev.attendize.com/assets/images/logo-100x100-lightBg.png" />--> <!-- <img src="http://dev.attendize.com/assets/images/logo-100x100-lightBg.png" />-->
<img src="{{empty(CDN_URL_USER_ASSETS) ? url('/'.$event->organiser->logo_path) : CDN_URL_USER_ASSETS.'/'.$event->organiser->logo_path}}" /> <img src="{{empty(config('attendize.cdn_url_user_assets')) ? url('/'.$event->organiser->logo_path) : config('attendize.cdn_url_user_assets').'/'.$event->organiser->logo_path}}" />
</div> </div>
<div class="event_details"> <div class="event_details">

View File

@ -21,11 +21,11 @@
<!--/Meta--> <!--/Meta-->
<!--JS--> <!--JS-->
{!! HTML::script(CDN_URL_STATIC_ASSETS.'/vendor/jquery/jquery.js') !!} {!! HTML::script(config('attendize.cdn_url_static_assets').'/vendor/jquery/jquery.js') !!}
<!--/JS--> <!--/JS-->
<!--Style--> <!--Style-->
{!! HTML::style(CDN_URL_STATIC_ASSETS.'/assets/stylesheet/application.css') !!} {!! HTML::style(config('attendize.cdn_url_static_assets').'/assets/stylesheet/application.css') !!}
<!--/Style--> <!--/Style-->
@yield('head') @yield('head')

View File

@ -12,6 +12,7 @@ class ExampleTest extends TestCase {
$response = $this->call('GET', '/'); $response = $this->call('GET', '/');
$this->assertEquals(200, $response->getStatusCode()); $this->assertEquals(200, $response->getStatusCode());
$this->assertFalse(4);
} }
} }

View File

@ -2,6 +2,8 @@
class TestCase extends Illuminate\Foundation\Testing\TestCase { class TestCase extends Illuminate\Foundation\Testing\TestCase {
protected $baseUrl = 'http://dev.attendize.com';
/** /**
* Creates the application. * Creates the application.
* *

18
tests/UserTest.php Normal file
View File

@ -0,0 +1,18 @@
<?php
use Illuminate\Foundation\Testing\WithoutMiddleware;
use Illuminate\Foundation\Testing\DatabaseMigrations;
use Illuminate\Foundation\Testing\DatabaseTransactions;
class UserTest extends TestCase
{
/**
* A basic test example.
*
* @return void
*/
public function testExample()
{
$this->assertTrue(true);
}
}