Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create job advert #4

Open
wants to merge 88 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
88 commits
Select commit Hold shift + click to select a range
c445c52
Create job advert
May 30, 2017
89b4486
Job advert main view without actions
mitrevski94 May 31, 2017
cbf1a2d
Add BrowserStack as supporter in Readme
trajchevska May 30, 2017
b451242
Add contributing guide
trajchevska Jun 2, 2017
5950bfb
Edit/Update/Delete JobAdvert
mitrevski94 Jun 7, 2017
12c450f
remove required on gender and birth date, replaced with in clausole f…
APavlov2 Jun 15, 2017
dd5e1d2
Fix UTF encoding issue
APavlov2 Jun 19, 2017
ade0ca8
Merge pull request #9 from APavlov2/dompdf_utf_issue
trajchevska Jun 22, 2017
6b670af
email with temporary password sent when a new employee is created in …
vtozija Jun 27, 2017
ddb4f81
links in admin header fixed
vtozija Jun 27, 2017
f495d6d
resolving conflicts
vtozija Jun 28, 2017
78d7ed1
new contoller added for employee home page
vtozija Jun 28, 2017
064db7f
resolving conflicts
vtozija Jun 28, 2017
4c3a6d4
Merge pull request #7 from APavlov2/admin_profile_adjust_required
trajchevska Jun 28, 2017
8c12341
remove required on gender and birth date, replaced with in clausole f…
APavlov2 Jun 15, 2017
20c8458
email with temporary password sent when a new employee is created in …
vtozija Jun 27, 2017
e32a96e
links in admin header fixed
vtozija Jun 27, 2017
9b64d3f
resolving conflicts
vtozija Jun 28, 2017
1ad2e74
new contoller added for employee home page
vtozija Jun 28, 2017
466105f
resolving conflicts
vtozija Jun 28, 2017
74c8522
Merge branch 'employee_login' of https://github.com/adevait/hrm into …
vtozija Jun 28, 2017
b5a7691
email with temporary password sent when a new employee is created in …
vtozija Jun 27, 2017
6c738b5
links in admin header fixed
vtozija Jun 27, 2017
ce32b10
resolving conflicts
vtozija Jun 28, 2017
6681e52
new contoller added for employee home page
vtozija Jun 28, 2017
4ecb44a
resolving conflicts
vtozija Jun 28, 2017
ba75bd4
email with temporary password sent when a new employee is created in …
vtozija Jun 27, 2017
8d76604
links in admin header fixed
vtozija Jun 27, 2017
40b56c1
resolving conflicts
vtozija Jun 28, 2017
c053176
resolving conflicts
vtozija Jun 28, 2017
2a85bdb
Merge branch 'employee_login' of https://github.com/adevait/hrm into …
vtozija Jun 28, 2017
5d7ba0e
Merge pull request #11 from adevait/employee_login
trajchevska Jun 28, 2017
77d9e3d
routes and breadcrumbs added for leave functionality. leave link adde…
vtozija Jun 28, 2017
75c3b2a
Revert "Employee login"
trajchevska Jun 28, 2017
7bbbec8
Merge pull request #12 from adevait/revert-11-employee_login
trajchevska Jun 28, 2017
b25f4e3
Revert "Revert "Employee login""
trajchevska Jun 28, 2017
1410329
Merge pull request #13 from adevait/revert-12-revert-11-employee_login
trajchevska Jun 28, 2017
6cdb9e8
CRUD functions added for employee leaves
vtozija Jun 29, 2017
fc4da75
fix salary record form request
trajchevska Jul 3, 2017
03a4c6f
add how_did_they_hear field in the candidates form
trajchevska Jul 5, 2017
bd44f4d
Add migration files
trajchevska Jul 6, 2017
60ac48b
Merge branch 'master' into employee_leave
vtozija Jul 13, 2017
5e92641
approve employee leave on admin side
vtozija Jul 13, 2017
dbc57aa
fixes
mitrevski94 Jul 13, 2017
22af7b2
admin approve functionality finished
Jul 14, 2017
c5b2251
routes, breadcrums and CRUD functions added for employee time functio…
Jul 14, 2017
a5eb6ce
route definition in time views, improvements to TimeController.php
vtozija Jul 18, 2017
45c37f1
employee header improvement
vtozija Jul 19, 2017
b7c1cdb
Pushed forgotten changes.
vtozija Jul 21, 2017
191fcc4
download sales reports
Jul 21, 2017
1baa9e8
detailed salary report functionality added
Jul 24, 2017
56cfcbe
Merge branch 'employee-salary' of https://github.com/adevait/hrm into…
Jul 24, 2017
b1ce665
bug fix
vtozija Jul 25, 2017
9919227
dashboard_documents table created, dashboard section in admin panel, …
vtozija Jul 26, 2017
0b49e9c
delete dashboard document fix
vtozija Jul 26, 2017
b6dec8c
delete dashboard document fix
vtozija Jul 26, 2017
d69d0f7
routes, breadcrums and header section added in employee panel
vtozija Jul 27, 2017
dd5c23e
update users table migration
vtozija Jul 27, 2017
c52d60f
Merge branch 'employee_leave' of https://github.com/adevait/hrm into …
vtozija Jul 27, 2017
116719b
employee dashboard section added
vtozija Jul 27, 2017
85b040c
download document added on admin side
vtozija Jul 27, 2017
1057bd8
bug fix
vtozija Jul 27, 2017
8886071
improve employee leave
trajchevska Jul 27, 2017
4814d75
add zip to allowed docs
trajchevska Jul 28, 2017
feea126
add zip to allowed docs
trajchevska Jul 28, 2017
437447c
employee time log improvements
vtozija Jul 31, 2017
6b1d275
employee time log improvements
vtozija Jul 31, 2017
0b1b0f5
employee salary improvements
vtozija Jul 31, 2017
3cf2eaf
Merge pull request #14 from adevait/employee_leave
trajchevska Aug 1, 2017
8427cf8
remove unnecessary repository methods
trajchevska Aug 1, 2017
cd1e0c1
merge master
trajchevska Aug 1, 2017
729053a
replace findby function in repo
trajchevska Aug 1, 2017
86063e5
Merge branch 'master' into employee-time-log
trajchevska Aug 1, 2017
03fa9b8
Merge pull request #15 from adevait/employee-time-log
trajchevska Aug 1, 2017
cf0ac9b
dashboard documents improvements and resolving conflicts
vtozija Aug 1, 2017
622234a
merge master
trajchevska Aug 1, 2017
407ecb2
finalize dashboard
trajchevska Aug 1, 2017
dbb5a87
resolve conflicts
trajchevska Aug 1, 2017
fd1239b
remove double breadcrumb
trajchevska Aug 1, 2017
4c3dad4
Merge pull request #18 from adevait/dashboard-documents
trajchevska Aug 1, 2017
3697a89
resolving conflicts
vtozija Aug 1, 2017
0e811a4
resolving conflicts
vtozija Aug 1, 2017
296299f
employee salary getDatable improvement
vtozija Aug 1, 2017
5dba05f
validate user before showing salary
trajchevska Aug 1, 2017
fc753b4
Merge branch 'employee-salary' of github.com:adevait/hrm into employe…
trajchevska Aug 1, 2017
adb3475
review and improve employee-salary
trajchevska Aug 1, 2017
652262c
Merge pull request #16 from adevait/employee-salary
trajchevska Aug 1, 2017
be78c2f
merge master
trajchevska Aug 15, 2017
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
Binary file modified .DS_Store
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
<?php

namespace App\Http\Controllers;
namespace App\Http\Controllers\Admin;

use App\Modules\Time\Repositories\Interfaces\TimeLogRepositoryInterface as TimeLogRepository;
use App\Http\Controllers\Controller;

class HomeController extends Controller
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
<?php

namespace App\Http\Controllers;
namespace App\Http\Controllers\Admin;

use Illuminate\Http\Request;
use App\Http\Controllers\Controller;
use App\Http\Requests\ProfileRequest;
use App\Modules\Pim\Repositories\Interfaces\EmployeeRepositoryInterface as EmployeeRepository;

Expand Down Expand Up @@ -30,6 +31,7 @@ public function index(Request $request)
public function store(ProfileRequest $request, EmployeeRepository $employeeRepository)
{
$employeeData = $employeeRepository->update($request->user()->id, $request->all());

$request->session()->flash('success', trans('app.profile.update_success'));
return redirect()->route('profile.index');
}
Expand Down
4 changes: 4 additions & 0 deletions app/Http/Controllers/Auth/LoginController.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,11 @@
namespace App\Http\Controllers\Auth;

use App\Http\Controllers\Controller;
use App\User;
use Illuminate\Foundation\Auth\AuthenticatesUsers;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Auth;
use Illuminate\Support\Facades\Input;

class LoginController extends Controller
{
Expand Down
2 changes: 1 addition & 1 deletion app/Http/Controllers/Auth/ResetPasswordController.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class ResetPasswordController extends Controller
*
* @var string
*/
protected $redirectTo = '/home';
protected $redirectTo = '/';

/**
* Create a new controller instance.
Expand Down
18 changes: 18 additions & 0 deletions app/Http/Controllers/Employee/HomeController.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?php

namespace App\Http\Controllers\Employee;

use App\Http\Controllers\Controller;

class HomeController extends Controller
{
/**
* Show the profile config page.
*
* @return \Illuminate\Http\Response
*/
public function index()
{
return view('welcome-employee');
}
}
1 change: 1 addition & 0 deletions app/Http/Kernel.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,5 +54,6 @@ class Kernel extends HttpKernel
'throttle' => \Illuminate\Routing\Middleware\ThrottleRequests::class,
'admin' => \App\Http\Middleware\RedirectIfNotAdmin::class,
'app_setup' => \App\Http\Middleware\AppSetupRegister::class,
'employee' => \App\Http\Middleware\RedirectIfNotEmployee::class,
];
}
7 changes: 6 additions & 1 deletion app/Http/Middleware/RedirectIfAuthenticated.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

namespace App\Http\Middleware;

use App\User;
use Closure;
use Illuminate\Support\Facades\Auth;

Expand All @@ -18,7 +19,11 @@ class RedirectIfAuthenticated
public function handle($request, Closure $next, $guard = null)
{
if (Auth::guard($guard)->check()) {
return redirect('/');
if (Auth::user()->role == User::USER_ROLE_EMPLOYEE) {
return redirect()->to('/employee');
} else if (Auth::user()->role == User::USER_ROLE_ADMIN) {
return redirect()->to('/admin');
}
}

return $next($request);
Expand Down
2 changes: 1 addition & 1 deletion app/Http/Middleware/RedirectIfNotAdmin.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class RedirectIfNotAdmin
public function handle($request, Closure $next, $guard = null)
{
if ($request->user()->role != User::USER_ROLE_ADMIN) {
return redirect('/');
return redirect()->back();
}

return $next($request);
Expand Down
26 changes: 26 additions & 0 deletions app/Http/Middleware/RedirectIfNotEmployee.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<?php

namespace App\Http\Middleware;

use App\User;
use Illuminate\Support\Facades\Auth;
use Closure;

class RedirectIfNotEmployee
{
/**
* Handle an incoming request.
*
* @param \Illuminate\Http\Request $request
* @param \Closure $next
* @return mixed
*/
public function handle($request, Closure $next)
{
if ($request->user()->role != User::USER_ROLE_EMPLOYEE) {
return redirect()->back();
}

return $next($request);
}
}
5 changes: 3 additions & 2 deletions app/Http/Requests/ProfileRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,10 @@ public function rules()
$rules = [
'first_name' => ['required'],
'last_name' => ['required'],
'gender' => ['required'],
'birth_date' => ['required']
'gender' => ['in:m,f'],
'birth_date' => ['date']
];

$rules['email'] = [
'required',
'email',
Expand Down
7 changes: 7 additions & 0 deletions app/Http/helpers.php
Original file line number Diff line number Diff line change
Expand Up @@ -169,4 +169,11 @@ function get_user_role($role)
function get_current_date()
{
return Carbon\Carbon::now()->format('Y-m-d');
}

function checkValidity($id)
{
if($id != Auth::user()->id) {
abort(403, 'Unauthorized action.');
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
<?php

namespace App\Modules\Dashboard\Http\Controllers;

use App\Http\Controllers\Controller;
use App\Modules\Dashboard\Repositories\Interfaces\DashboardDocumentsRepositoryInterface as DashboardDocumentsRepository;
use App\Modules\Dashboard\Http\Requests\DashboardDocumentRequest;
use Illuminate\Http\Request;
use Illuminate\Http\Response;
use Datatables;

class DashboardDocumentsController extends Controller
{
private $dashboardDocumentsRepository;

function __construct(DashboardDocumentsRepository $dashboardDocumentsRepository)
{
$this->dashboardDocumentsRepository = $dashboardDocumentsRepository;
}

public function index()
{
return view('dashboard::documents.index');
}

/**
* Returns data for the resource list
*
* @return \Illuminate\Http\Response
*/
public function getDatatable()
{
return Datatables::of($this->dashboardDocumentsRepository->getCollection([], ['id', 'name']))
->addColumn('actions', function($document){
return view('includes._datatable_actions', [
'editUrl' => route('dashboard.documents.edit', $document->id),
'deleteUrl' => route('dashboard.documents.destroy', $document->id),
'downloadUrl' => route('dashboard.documents.download', $document->id)
]);
})
->make();
}

public function create()
{
return view('dashboard::documents.create');
}

public function edit($id)
{
$document = $this->dashboardDocumentsRepository->getById($id);
$breadcrumb = [
'id' => $document->id,
'title' => $document->name
];
return view('dashboard::documents.edit', compact('document', 'breadcrumb'));
}

public function store(DashboardDocumentRequest $request) {
$documentData = $request->all();
$attachment = $request->attachment->store('uploads/documents');
$documentData['attachment'] = $attachment;
$documentData = $this->dashboardDocumentsRepository->create($documentData);
$request->session()->flash('success', trans('app.dashboard.documents.store_success'));

return redirect()->route('dashboard.documents.edit', [$documentData->id]);
}

public function update($id, DashboardDocumentRequest $request)
{
$documentData = $request->all();
if($request->hasFile('attachment')) {
$attachment = $request->attachment->store('uploads/documents');
$documentData['attachment'] = $attachment;
}
$documentData = $this->dashboardDocumentsRepository->update($id, $documentData);
$request->session()->flash('success', trans('app.dashboard.documents.update_success'));

return redirect()->route('dashboard.documents.edit', [$documentData->id]);
}

public function destroy($id, Request $request) {
$this->dashboardDocumentsRepository->delete($id);
$request->session()->flash('success', trans('app.dashboard.documents.delete_success'));

return redirect()->route('dashboard.documents.index');
}

public function download($id)
{
$document = $this->dashboardDocumentsRepository->getById($id);
return response()->download(base_path('storage/app/' . $document->attachment));
}

}
38 changes: 38 additions & 0 deletions app/Modules/Dashboard/Http/Requests/DashboardDocumentRequest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
<?php

namespace App\Modules\Dashboard\Http\Requests;

use Illuminate\Foundation\Http\FormRequest;
use Route;

class DashboardDocumentRequest extends FormRequest
{
/**
* Determine if the user is authorized to make this request.
*
* @return bool
*/
public function authorize()
{
return true;
}

/**
* Get the validation rules that apply to the request.
*
* @return array
*/
public function rules()
{
$rules = [
'name' => ['required'],
// 'attachment' => ['mimes:png,jpg,pdf,xls,xlsx,csv,txt,doc,docx']
];

if(!preg_match('/update/', Route::currentRouteName())) {
$rules['attachment'][] = 'required';
}

return $rules;
}
}
12 changes: 12 additions & 0 deletions app/Modules/Dashboard/Models/DashboardDocument.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?php

namespace App\Modules\Dashboard\Models;

use Illuminate\Database\Eloquent\Model;
use App\User;

class DashboardDocument extends Model
{
protected $table = 'dashboard_documents';
protected $guarded = ['id'];
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?php

namespace App\Modules\Dashboard\Repositories;

use App\Repositories\EloquentRepository;
use App\Modules\Dashboard\Models\DashboardDocument;
use App\Modules\Dashboard\Repositories\Interfaces\DashboardDocumentsRepositoryInterface;

class DashboardDocumentsRepository extends EloquentRepository implements DashboardDocumentsRepositoryInterface
{
public function __construct(DashboardDocument $model)
{
$this->model = $model;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?php

namespace App\Modules\Dashboard\Repositories\Interfaces;

interface DashboardDocumentsRepositoryInterface
{
}
33 changes: 33 additions & 0 deletions app/Modules/Dashboard/resources/views/documents/_form.blade.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<div class="form-group">
{!! Form::label('name', trans('app.dashboard.documents.name').':', ['class' => 'col-sm-3']) !!}
<div class="col-sm-6">
{!! Form::text('name', null, ['class' => 'form-control']) !!}
</div>
</div>
<div class="form-group">
{!! Form::label('description', trans('app.dashboard.documents.description').':', ['class' => 'col-sm-3']) !!}
<div class="col-sm-6">
{!! Form::textarea('description', null, ['class' => 'form-control']) !!}
</div>
</div>
<div class="form-group">
{!! Form::label('attachment', trans('app.dashboard.documents.attachment').':', ['class' => 'col-sm-3']) !!}
<div class="col-sm-6">
{!! Form::input('file', 'attachment', null, ['class' => 'form-control']) !!}
</div>
</div>
@if(@$document->attachment)
<div class="form-group">
<div class="col-sm-6 col-sm-offset-3">
<a href="{{route('storage',$document->attachment)}}">{{trans('app.dashboard.documents.attachment')}}</a>
</div>
</div>
@endif
@include('errors._form-errors')
<hr>
<div class="form-group">
<div class="col-sm-6 col-sm-offset-3">
<a href="{{route('dashboard.documents.index')}}" class="btn btn-default">{{trans('app.cancel')}}</a>
{!! Form::submit($submitName, ['class' => 'btn btn-primary']) !!}
</div>
</div>
13 changes: 13 additions & 0 deletions app/Modules/Dashboard/resources/views/documents/create.blade.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
@extends('layouts.main')
@section('content')
<div class="row">
<div class="col-sm-12">
<div class="custom-panel">
<div class="custom-panel-heading">{{trans('app.dashboard.documents.add_new')}}</div>
{!! Form::open(['route' => 'dashboard.documents.store', 'files' => true, 'class' => 'form-horizontal']) !!}
@include('dashboard::documents._form', ['submitName' => trans('app.submit')])
{!! Form::close() !!}
</div>
</div>
</div>
@endsection
13 changes: 13 additions & 0 deletions app/Modules/Dashboard/resources/views/documents/edit.blade.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
@extends('layouts.main')
@section('content')
<div class="row">
<div class="col-sm-12">
<div class="custom-panel">
<div class="custom-panel-heading">{{trans('app.dashboard.documents.edit_details')}}</div>
{!! Form::model($document, ['method' => 'PUT', 'route' => ['dashboard.documents.update', $document->id], 'class' => 'form-horizontal', 'files' => true]) !!}
@include('dashboard::documents._form', ['submitName' => trans('app.submit')])
{!! Form::close() !!}
</div>
</div>
</div>
@endsection
Loading