Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion app/Models/Account.php → app/Account.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace App\Models;

use App\Attendize\Utils;
use App\App\Utils;
use DB;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\SoftDeletes;
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion app/Http/Controllers/EventCheckoutController.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace App\Http\Controllers;

use App\Attendize\PaymentUtils;
use App\App\PaymentUtils;
use App\Jobs\SendOrderAttendeeTicketJob;
use App\Jobs\SendOrderConfirmationJob;
use App\Jobs\SendOrderNotificationJob;
Expand Down
51 changes: 19 additions & 32 deletions app/Http/Controllers/EventController.php
Original file line number Diff line number Diff line change
Expand Up @@ -385,28 +385,23 @@ public function CreateCloneEvent($event_id = '')
/* Set values for the new Event */
$cloned_event->is_live = 0;
$cloned_event->id = null;
$cloned_event->title = $event->title . '(New)';
$cloned_event->title = $event->title.'(New)';
$cloned_event->start_date = $fechaini;
$cloned_event->end_date = $fechafin;
$cloned_event->exists = false; //very important so IsDirty returns correctly


try
{
try {
$cloned_event->save();
}
catch(\Exception $e)
{
} catch (\Exception $e) {
Log::error($e);
return response()->json(['status' => $e, 'messages' => trans("Controllers.event_create_exception") , ]);

return response()->json(['status' => $e, 'messages' => trans('Controllers.event_create_exception')]);
}

// now get images and duplicate them (thanks for a better code from @emergingdzns )
$images = EventImage::where('event_id', $event->id)->get();
if (count($images) > 0)
{
foreach ($images as $image)
{
if (count($images) > 0) {
foreach ($images as $image) {
$newImage = new EventImage();
$newImage->image_path = $image->image_path;
$newImage->created_at = date('Y-m-d H:i:s');
Expand All @@ -420,23 +415,17 @@ public function CreateCloneEvent($event_id = '')

// now get survey question for the event and associate them
$eventquestions = $event->questions()->get();
if (count($eventquestions) > 0)
{
foreach ($eventquestions as $question)
{
if (count($eventquestions) > 0) {
foreach ($eventquestions as $question) {
$cloned_event->questions()
->attach($question->id);
}
}

// now get tickets for the event and duplicate them
$tickets = Ticket::where('event_id', $event->id)->get();
if (count($tickets) > 0)
{

foreach ($tickets as $ticket)
{

if (count($tickets) > 0) {
foreach ($tickets as $ticket) {
$ticketa = $ticket->toArray();
unset($ticketa['id']);
$ticketa['event_id'] = $cloned_event->id;
Expand All @@ -448,36 +437,34 @@ public function CreateCloneEvent($event_id = '')
$newTicket->fill($ticketa);
$newTicket->save();

if (count($eventquestions) > 0)
{
foreach ($eventquestions as $question)
{
if (in_array($ticket->id, $question->tickets->pluck('id')->toArray()))
{
if (count($eventquestions) > 0) {
foreach ($eventquestions as $question) {
if (in_array($ticket->id, $question->tickets->pluck('id')->toArray())) {
$question->tickets()->sync($newTicket->id);
}
}
}

}

}
/* redirect to wherever you want */
return redirect(route('showOrganiserEvents', array('organiser_id' => $cloned_event->organiser_id)));

return redirect(route('showOrganiserEvents', ['organiser_id' => $cloned_event->organiser_id]));
}

public function archiveEvent($event_id = '')
{
$event = Event::scope()->findOrFail($event_id);
$event->delete();

return redirect()->route('showOrganiserEvents', $event->organiser->id);
}

public function restoreEvent($event_id = '')
{
$event = Event::withTrashed()->scope()
->findOrFail($event_id);
$event->deleted_at = null;
$event->save();

return redirect()->route('showOrganiserEvents', $event->organiser->id);
}
}
2 changes: 1 addition & 1 deletion app/Http/Controllers/EventViewController.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace App\Http\Controllers;

use App\Attendize\Utils;
use App\App\Utils;
use App\Models\Affiliate;
use App\Models\Event;
use App\Models\EventAccessCodes;
Expand Down
12 changes: 6 additions & 6 deletions app/Http/Controllers/OrganiserEventsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,26 +24,26 @@ public function showEvents(Request $request, $organiser_id)
$searchQuery = $request->get('q');
$sort_by = (in_array($request->get('sort_by'), $allowed_sorts) ? $request->get('sort_by') : 'start_date');

if ($request->has('archived')) {
$events = $searchQuery
? Event::withTrashed()->scope()->with(['organiser', 'currency'])->where('title', 'like', '%' . $searchQuery . '%')->orderBy($sort_by,
if ($request->has('archived')) {
$events = $searchQuery
? Event::withTrashed()->scope()->with(['organiser', 'currency'])->where('title', 'like', '%'.$searchQuery.'%')->orderBy($sort_by,
'desc')->where('organiser_id', '=', $organiser_id)->paginate(12)
: Event::withTrashed()->scope()->with(['organiser', 'currency'])->where('organiser_id', '=', $organiser_id)->orderBy($sort_by, 'desc')->paginate(12);
} else {
$events = $searchQuery
? Event::scope()->with(['organiser', 'currency'])->where('title', 'like', '%' . $searchQuery . '%')->orderBy($sort_by,
? Event::scope()->with(['organiser', 'currency'])->where('title', 'like', '%'.$searchQuery.'%')->orderBy($sort_by,
'desc')->where('organiser_id', '=', $organiser_id)->paginate(12)
: Event::scope()->with(['organiser', 'currency'])->where('organiser_id', '=', $organiser_id)->orderBy($sort_by, 'desc')->paginate(12);
}

$data = [
'events' => $events,
'organiser' => $organiser,
'search' => [
'q' => $searchQuery ? $searchQuery : '',
'sort_by' => $request->get('sort_by') ? $request->get('sort_by') : '',
'showPast' => $request->get('past'),
'archived' => $request->get('archived'),
'archived' => $request->get('archived'),
],
];

Expand Down
2 changes: 1 addition & 1 deletion app/Http/Controllers/OrganiserViewController.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace App\Http\Controllers;

use App\Attendize\Utils;
use App\App\Utils;
use App\Models\Organiser;
use Auth;
use Illuminate\Contracts\View\View;
Expand Down
2 changes: 1 addition & 1 deletion app/Http/Controllers/UserSignupController.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace App\Http\Controllers;

use App\Attendize\Utils;
use App\App\Utils;
use App\Models\Account;
use App\Models\User;
use Hash;
Expand Down
2 changes: 1 addition & 1 deletion app/Http/Middleware/CheckInstalled.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace App\Http\Middleware;

use App\Attendize\Utils;
use App\App\Utils;
use App\Models\Account;
use Closure;
use Illuminate\Http\Request;
Expand Down
2 changes: 1 addition & 1 deletion app/Http/Middleware/SetViewVariables.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace App\Http\Middleware;

use App\Attendize\Utils;
use App\App\Utils;
use App\Models\Organiser;
use Closure;
use Illuminate\Support\Facades\Auth;
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion app/Providers/HelpersServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace App\Providers;

use App\Attendize\PaymentUtils;
use App\App\PaymentUtils;
use Illuminate\Support\Facades\Blade;
use Illuminate\Support\ServiceProvider;

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
51 changes: 25 additions & 26 deletions app/Models/Ticket.php → app/Ticket.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace App\Models;

use App\Attendize\PaymentUtils;
use App\App\PaymentUtils;
use Carbon\Carbon;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Relations\BelongsToMany;
Expand All @@ -23,33 +23,32 @@ class Ticket extends MyBaseModel
protected $quantity_reserved_cache = null;

/**
* @var array $fillable
* @var array
*/
protected $fillable = [
'created_at',
'created_at',
'updated_at',
'deleted_at',
'edited_by_user_id',
'account_id',
'order_id',
'event_id',
'title',
'description',
'price',
'max_per_person',
'min_per_person',
'quantity_available',
'quantity_sold',
'sales_volume',
'organiser_fees_volume',
'is_paused',
'public_id',
'user_id',
'sort_order',
'is_hidden'
];

'created_at',
'created_at',
'updated_at',
'deleted_at',
'edited_by_user_id',
'account_id',
'order_id',
'event_id',
'title',
'description',
'price',
'max_per_person',
'min_per_person',
'quantity_available',
'quantity_sold',
'sales_volume',
'organiser_fees_volume',
'is_paused',
'public_id',
'user_id',
'sort_order',
'is_hidden',
];

/**
* The rules to validate the model.
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
1 change: 0 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,6 @@
],
"psr-4": {
"App\\": "app/",
"Attendize\\": "app/Models",
"Database\\Factories\\": "database/factories/",
"Database\\Seeders\\": "database/seeders/"
}
Expand Down
2 changes: 1 addition & 1 deletion config/app.php
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@
// Attendize Class Alias
'Markdown' => GrahamCampbell\Markdown\Facades\Markdown::class,
'PDF' => Nitmedia\Wkhtml2pdf\Facades\Wkhtml2pdf::class,
'Utils' => App\Attendize\Utils::class,
'Utils' => App\App\Utils::class,
'Excel' => Maatwebsite\Excel\Facades\Excel::class,
],

Expand Down
Loading