Compare commits
30 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 16014945b6 | |||
| 44821b9667 | |||
| c5d7a1fdd6 | |||
| 29c4189419 | |||
| 7ef4f23d0f | |||
| 8232cefbba | |||
| a852c624d3 | |||
| 7edf1db101 | |||
| 5e9740e0b4 | |||
| 41a20d8f66 | |||
| 7a0843e954 | |||
| 4a9f3fd6ff | |||
| 9ae1841fc4 | |||
| ba5a2edd54 | |||
| c73cbccffc | |||
| 24d2726c86 | |||
| 06fcf3e07d | |||
| cc15a4f018 | |||
| 18e576e5fd | |||
| 4c787891e4 | |||
| dbd96a4c10 | |||
| d314f85b93 | |||
| 3a81b7e612 | |||
| 7992258b46 | |||
| 869da1da78 | |||
| a6a6aa78b0 | |||
| 4ffea7ceaa | |||
| 1d3255a00b | |||
| 29eadb10ae | |||
| 1ca5f8bee5 |
@@ -429,4 +429,42 @@ class Helper
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Check to see if the given key exists in the array, and trim excess white space before returning it
|
||||
*
|
||||
* @author Daniel Melzter
|
||||
* @since 3.0
|
||||
* @param $array array
|
||||
* @param $key string
|
||||
* @param $default string
|
||||
* @return string
|
||||
*/
|
||||
public static function array_smart_fetch(array $array, $key, $default = '')
|
||||
{
|
||||
array_change_key_case($array, CASE_LOWER);
|
||||
return array_key_exists(strtolower($key), array_change_key_case($array)) ? e(trim($array[ $key ])) : $default;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check to see if the given key exists in the array, and trim excess white space before returning it
|
||||
*
|
||||
* @author A. Gianotto
|
||||
* @since 3.2
|
||||
* @param $array array
|
||||
* @return string
|
||||
*/
|
||||
public static function getLastDateFromHistoryArray(array $array)
|
||||
{
|
||||
foreach ($array as $key => $value) {
|
||||
// echo '<pre>';
|
||||
// echo 'last:'.$key;
|
||||
// print_r($array);
|
||||
// echo '</pre>';
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -309,7 +309,7 @@ class AssetMaintenancesController extends Controller
|
||||
'' => 'Select an improvement type',
|
||||
] + AssetMaintenance::getImprovementOptions();
|
||||
|
||||
$assets = Company::scopeCompanyables(Asset::all(), 'assets.company_id')->lists('detailed_name', 'id');
|
||||
$assets = Company::scopeCompanyables(Asset::with('model','assignedUser')->get(), 'assets.company_id')->lists('detailed_name', 'id');
|
||||
// Get Supplier List
|
||||
$supplier_list = Helper::suppliersList();
|
||||
|
||||
|
||||
@@ -23,6 +23,7 @@ use Validator;
|
||||
use Artisan;
|
||||
use Auth;
|
||||
use Config;
|
||||
use League\Csv\Reader;
|
||||
use DB;
|
||||
use Image;
|
||||
use Input;
|
||||
@@ -239,7 +240,7 @@ class AssetsController extends Controller
|
||||
$constraint->upsize();
|
||||
})->save($path);
|
||||
$asset->image = $file_name;
|
||||
} catch(\Exception $e) {
|
||||
} catch (\Exception $e) {
|
||||
\Input::flash();
|
||||
$messageBag = new \Illuminate\Support\MessageBag();
|
||||
$messageBag->add('image', $e->getMessage());
|
||||
@@ -417,7 +418,7 @@ class AssetsController extends Controller
|
||||
$constraint->upsize();
|
||||
})->save($path);
|
||||
$asset->image = $file_name;
|
||||
} catch(\Exception $e) {
|
||||
} catch (\Exception $e) {
|
||||
\Input::flash();
|
||||
$messageBag = new \Illuminate\Support\MessageBag();
|
||||
$messageBag->add('image', $e->getMessage());
|
||||
@@ -529,6 +530,8 @@ class AssetsController extends Controller
|
||||
return redirect()->to('hardware')->with('error', trans('admin/hardware/message.does_not_exist'));
|
||||
} elseif (!Company::isCurrentUserHasAccess($asset)) {
|
||||
return redirect()->to('hardware')->with('error', trans('general.insufficient_permissions'));
|
||||
} elseif (!$asset->availableForCheckout()) {
|
||||
return redirect()->to('hardware')->with('error', trans('admin/hardware/message.checkout.not_available'));
|
||||
}
|
||||
|
||||
$user = User::find(e(Input::get('assigned_to')));
|
||||
@@ -767,7 +770,7 @@ class AssetsController extends Controller
|
||||
} else {
|
||||
$barcode = new \Com\Tecnick\Barcode\Barcode();
|
||||
$barcode_obj = $barcode->getBarcodeObj($settings->barcode_type, route('view/hardware', $asset->id), $size['height'], $size['width'], 'black', array(-2, -2, -2, -2));
|
||||
file_put_contents($qr_file,$barcode_obj->getPngData());
|
||||
file_put_contents($qr_file, $barcode_obj->getPngData());
|
||||
return response($barcode_obj->getPngData())->header('Content-type', 'image/png');
|
||||
}
|
||||
|
||||
@@ -801,7 +804,7 @@ class AssetsController extends Controller
|
||||
} else {
|
||||
$barcode = new \Com\Tecnick\Barcode\Barcode();
|
||||
$barcode_obj = $barcode->getBarcodeObj($settings->alt_barcode, $asset->asset_tag, 250, 20);
|
||||
file_put_contents($barcode_file,$barcode_obj->getPngData());
|
||||
file_put_contents($barcode_file, $barcode_obj->getPngData());
|
||||
return response($barcode_obj->getPngData())->header('Content-type', 'image/png');
|
||||
}
|
||||
}
|
||||
@@ -889,11 +892,11 @@ class AssetsController extends Controller
|
||||
try {
|
||||
$file->move($path, $date.'-'.$fixed_filename);
|
||||
} catch (\Symfony\Component\HttpFoundation\File\Exception\FileException $exception) {
|
||||
$results['error']=trans('admin/hardware/message.upload.error');
|
||||
if( config('app.debug')) {
|
||||
$results['error'].= ' ' . $exception->getMessage();
|
||||
}
|
||||
return $results;
|
||||
$results['error']=trans('admin/hardware/message.upload.error');
|
||||
if (config('app.debug')) {
|
||||
$results['error'].= ' ' . $exception->getMessage();
|
||||
}
|
||||
return $results;
|
||||
}
|
||||
$name = date('Y-m-d-his').'-'.$fixed_filename;
|
||||
$filesize = Setting::fileSizeConvert(filesize($path.'/'.$name));
|
||||
@@ -1004,6 +1007,171 @@ class AssetsController extends Controller
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Return history import view
|
||||
*
|
||||
* @author [A. Gianotto] [<snipe@snipe.net>]
|
||||
* @since [v1.0]
|
||||
* @return View
|
||||
*/
|
||||
public function getImportHistory()
|
||||
{
|
||||
|
||||
return View::make('hardware/history');
|
||||
}
|
||||
|
||||
/**
|
||||
* Import history
|
||||
*
|
||||
* This needs a LOT of love. It's done very inelegantly right now, and there are
|
||||
* a ton of optimizations that could (and should) be done.
|
||||
*
|
||||
* @author [A. Gianotto] [<snipe@snipe.net>]
|
||||
* @since [v3.3]
|
||||
* @return View
|
||||
*/
|
||||
public function postImportHistory(Request $request)
|
||||
{
|
||||
|
||||
if (!ini_get("auto_detect_line_endings")) {
|
||||
ini_set("auto_detect_line_endings", '1');
|
||||
}
|
||||
|
||||
$assets = Asset::all(['asset_tag']);
|
||||
|
||||
$csv = Reader::createFromPath(Input::file('user_import_csv'));
|
||||
$csv->setNewline("\r\n");
|
||||
//get the first row, usually the CSV header
|
||||
//$headers = $csv->fetchOne();
|
||||
|
||||
$results = $csv->fetchAssoc();
|
||||
$item = array();
|
||||
$status = array();
|
||||
|
||||
|
||||
foreach($results as $row) {
|
||||
|
||||
if (is_array($row)) {
|
||||
|
||||
$row = array_change_key_case($row, CASE_LOWER);
|
||||
$asset_tag = Helper::array_smart_fetch($row, "asset tag");
|
||||
if (!array_key_exists($asset_tag, $item)) {
|
||||
$item[$asset_tag] = array();
|
||||
}
|
||||
$batch_counter = count($item[$asset_tag]);
|
||||
|
||||
$item[$asset_tag][$batch_counter]['checkout_date'] = Carbon::parse(Helper::array_smart_fetch($row, "date"))->format('Y-m-d H:i:s');
|
||||
|
||||
$item[$asset_tag][$batch_counter]['asset_tag'] = Helper::array_smart_fetch($row, "asset tag");
|
||||
$item[$asset_tag][$batch_counter]['name'] = Helper::array_smart_fetch($row, "name");
|
||||
$item[$asset_tag][$batch_counter]['email'] = Helper::array_smart_fetch($row, "email");
|
||||
|
||||
$asset = Asset::where('asset_tag','=',$asset_tag)->first();
|
||||
$item[$asset_tag][$batch_counter]['asset_id'] = $asset->id;
|
||||
|
||||
$base_username = User::generateFormattedNameFromFullName(Setting::getSettings()->username_format,$item[$asset_tag][$batch_counter]['name']);
|
||||
$user = User::where('username','=',$base_username['username']);
|
||||
$user_query = ' on username '.$base_username['username'];
|
||||
|
||||
if ($request->input('match_firstnamelastname')=='1') {
|
||||
$firstnamedotlastname = User::generateFormattedNameFromFullName('firstname.lastname',$item[$asset_tag][$batch_counter]['name']);
|
||||
$item[$asset_tag][$batch_counter]['username'][] = $firstnamedotlastname['username'];
|
||||
$user->orWhere('username','=',$firstnamedotlastname['username']);
|
||||
$user_query .= ', or on username '.$firstnamedotlastname['username'];
|
||||
}
|
||||
|
||||
if ($request->input('match_flastname')=='1') {
|
||||
$flastname = User::generateFormattedNameFromFullName('filastname',$item[$asset_tag][$batch_counter]['name']);
|
||||
$item[$asset_tag][$batch_counter]['username'][] = $flastname['username'];
|
||||
$user->orWhere('username','=',$flastname['username']);
|
||||
$user_query .= ', or on username '.$flastname['username'];
|
||||
}
|
||||
if ($request->input('match_firstname')=='1') {
|
||||
$firstname = User::generateFormattedNameFromFullName('firstname',$item[$asset_tag][$batch_counter]['name']);
|
||||
$item[$asset_tag][$batch_counter]['username'][] = $firstname['username'];
|
||||
$user->orWhere('username','=',$firstname['username']);
|
||||
$user_query .= ', or on username '.$firstname['username'];
|
||||
}
|
||||
if ($request->input('match_email')=='1') {
|
||||
if ($item[$asset_tag][$batch_counter]['email']=='') {
|
||||
$item[$asset_tag][$batch_counter]['username'][] = $user_email = User::generateEmailFromFullName($item[$asset_tag][$batch_counter]['name']);
|
||||
$user->orWhere('username','=',$user_email);
|
||||
$user_query .= ', or on username '.$user_email;
|
||||
}
|
||||
}
|
||||
|
||||
// A matching user was found
|
||||
if ($user = $user->first()) {
|
||||
$item[$asset_tag][$batch_counter]['checkedout_to'] = $user->id;
|
||||
|
||||
$status['success'][] = 'Found user '.Helper::array_smart_fetch($row, "name").$user_query;
|
||||
|
||||
if ($asset) {
|
||||
|
||||
$item[$asset_tag][$batch_counter]['user_id'] = $user->id;
|
||||
|
||||
Actionlog::firstOrCreate(array(
|
||||
'asset_id' => $asset->id,
|
||||
'asset_type' => 'hardware',
|
||||
'user_id' => Auth::user()->id,
|
||||
'note' => 'Checkout imported by '.Auth::user()->fullName().' from history importer',
|
||||
'checkedout_to' => $item[$asset_tag][$batch_counter]['user_id'],
|
||||
'created_at' => $item[$asset_tag][$batch_counter]['checkout_date'],
|
||||
'action_type' => 'checkout'
|
||||
)
|
||||
);
|
||||
|
||||
$asset->assigned_to = $user->id;
|
||||
$asset->save();
|
||||
|
||||
} else {
|
||||
$status['error'][] = 'Asset does not exist so no checkin log was created.';
|
||||
}
|
||||
|
||||
|
||||
} else {
|
||||
$item[$asset_tag][$batch_counter]['checkedout_to'] = null;
|
||||
$status['error'][] = 'No matching user for '.Helper::array_smart_fetch($row, "name");
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
// Loop through and backfill the checkins
|
||||
foreach ($item as $key => $asset_batch) {
|
||||
$total_in_batch = count($asset_batch);
|
||||
for($x = 0; $x < $total_in_batch; $x++) {
|
||||
$next = $x + 1;
|
||||
|
||||
// Only do this if a matching user was found
|
||||
if ($asset_batch[$x]['checkedout_to']!='') {
|
||||
|
||||
if (($total_in_batch > 1) && ($x < $total_in_batch) && (array_key_exists($next,$asset_batch))) {
|
||||
$checkin_date = Carbon::parse($asset_batch[$next]['checkout_date'])->subDay(1)->format('Y-m-d H:i:s');
|
||||
$asset_batch[$x]['real_checkin'] = $checkin_date;
|
||||
|
||||
Actionlog::firstOrCreate(array(
|
||||
'asset_id' => $asset_batch[$x]['asset_id'],
|
||||
'asset_type' => 'hardware',
|
||||
'user_id' => Auth::user()->id,
|
||||
'note' => 'Checkin imported by ' . Auth::user()->fullName() . ' from history importer',
|
||||
'checkedout_to' => null,
|
||||
'created_at' => $checkin_date,
|
||||
'action_type' => 'checkin'
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return View::make('hardware/history')->with('status',$status);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Retore a deleted asset.
|
||||
*
|
||||
@@ -1559,20 +1727,24 @@ class AssetsController extends Controller
|
||||
$actions = '<a href="'.route('restore/hardware', $asset->id).'" title="Restore asset" data-toggle="tooltip" class="btn btn-warning btn-sm"><i class="fa fa-recycle icon-white"></i></a>';
|
||||
}
|
||||
|
||||
if ($asset->assetstatus) {
|
||||
if (($asset->assetstatus->deployable != 0) && ($asset->deleted_at=='')) {
|
||||
if (($asset->assigned_to !='') && ($asset->assigned_to > 0)) {
|
||||
if (Gate::allows('assets.checkin')) {
|
||||
$inout = '<a href="' . route('checkin/hardware',
|
||||
$asset->id) . '" class="btn btn-primary btn-sm" title="Checkin this asset" data-toggle="tooltip">' . trans('general.checkin') . '</a>';
|
||||
}
|
||||
} else {
|
||||
if (Gate::allows('assets.checkout')) {
|
||||
$inout = '<a href="' . route('checkout/hardware',
|
||||
$asset->id) . '" class="btn btn-info btn-sm" title="Checkout this asset to a user" data-toggle="tooltip">' . trans('general.checkout') . '</a>';
|
||||
}
|
||||
}
|
||||
if (($asset->availableForCheckout()))
|
||||
{
|
||||
if (Gate::allows('assets.checkout')) {
|
||||
$inout = '<a href="' . route('checkout/hardware',
|
||||
$asset->id) . '" class="btn btn-info btn-sm" title="Checkout this asset to a user" data-toggle="tooltip">' . trans('general.checkout') . '</a>';
|
||||
}
|
||||
|
||||
} else {
|
||||
if (Gate::allows('assets.checkin')) {
|
||||
$inout = '<a href="' . route('checkin/hardware',
|
||||
$asset->id) . '" class="btn btn-primary btn-sm" title="Checkin this asset" data-toggle="tooltip">' . trans('general.checkin') . '</a>';
|
||||
}
|
||||
}
|
||||
|
||||
// Lots going on here. Importer has parsed numbers before importing, so we need to check and see if it's a number before trying to parse.
|
||||
$purchase_cost = $asset->purchase_cost ?: '';
|
||||
if (is_numeric($purchase_cost)) {
|
||||
$purchase_cost = number_format($purchase_cost, 2);
|
||||
}
|
||||
|
||||
$row = array(
|
||||
@@ -1590,7 +1762,7 @@ class AssetsController extends Controller
|
||||
'category' => (($asset->model) && ($asset->model->category)) ?(string)link_to('/admin/settings/categories/'.$asset->model->category->id.'/view', e($asset->model->category->name)) : '',
|
||||
'manufacturer' => (($asset->model) && ($asset->model->manufacturer)) ? (string)link_to('/admin/settings/manufacturers/'.$asset->model->manufacturer->id.'/view', e($asset->model->manufacturer->name)) : '',
|
||||
'eol' => ($asset->eol_date()) ? $asset->eol_date() : '',
|
||||
'purchase_cost' => ($asset->purchase_cost) ? number_format($asset->purchase_cost, 2) : '',
|
||||
'purchase_cost' => $purchase_cost,
|
||||
'purchase_date' => ($asset->purchase_date) ? $asset->purchase_date : '',
|
||||
'notes' => e($asset->notes),
|
||||
'order_number' => ($asset->order_number!='') ? '<a href="'.config('app.url').'/hardware?order_number='.e($asset->order_number).'">'.e($asset->order_number).'</a>' : '',
|
||||
|
||||
@@ -108,7 +108,7 @@ class AuthController extends Controller
|
||||
LOG::debug("Creating local user ".Input::get('username'));
|
||||
|
||||
if ($newuser = Ldap::createUserFromLdap($userattr)) {
|
||||
LOG::debug("Local user created..");
|
||||
LOG::debug("Local user created.");
|
||||
} else {
|
||||
LOG::debug("Could not create local user.");
|
||||
}
|
||||
@@ -131,12 +131,21 @@ class AuthController extends Controller
|
||||
|
||||
LOG::debug("Valid LDAP login. Updating the local data.");
|
||||
|
||||
$user->password = bcrypt($request->input('password'));
|
||||
if (Setting::getSettings()->ldap_pw_sync=='1') {
|
||||
$user->password = bcrypt($request->input('password'));
|
||||
}
|
||||
|
||||
$user->email = $ldap_attr['email'];
|
||||
$user->first_name = $ldap_attr['firstname'];
|
||||
$user->last_name = $ldap_attr['lastname'];
|
||||
$user->save();
|
||||
|
||||
if (Setting::getSettings()->ldap_pw_sync!='1') {
|
||||
Auth::login($user, true);
|
||||
// Redirect to the users page
|
||||
return redirect()->to('/home')->with('success', trans('auth/message.signin.success'));
|
||||
}
|
||||
|
||||
} else {
|
||||
LOG::debug("User ".Input::get('username')." did not authenticate correctly against LDAP. Local user was not updated.");
|
||||
}// End LDAP auth
|
||||
@@ -146,14 +155,17 @@ class AuthController extends Controller
|
||||
// NO LDAP enabled - just try to login the user normally
|
||||
}
|
||||
|
||||
|
||||
LOG::debug("Authenticating user against database.");
|
||||
// Try to log the user in
|
||||
if (!Auth::attempt(Input::only('username', 'password'), Input::get('remember-me', 0))) {
|
||||
LOG::debug("Local authentication failed.");
|
||||
// throw new Cartalyst\Sentry\Users\UserNotFoundException();
|
||||
// throw new Cartalyst\Sentry\Users\UserNotFoundException();
|
||||
return redirect()->back()->withInput()->with('error', trans('auth/message.account_not_found'));
|
||||
}
|
||||
|
||||
|
||||
|
||||
// Get the page we were before
|
||||
$redirect = \Session::get('loginRedirect', 'home');
|
||||
|
||||
|
||||
@@ -1,13 +1,14 @@
|
||||
<?php
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use Illuminate\Http\Request;
|
||||
use App\Helpers\Helper;
|
||||
use App\Models\Category as Category;
|
||||
use App\Models\Company;
|
||||
use App\Models\Setting;
|
||||
use Auth;
|
||||
use DB;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\Gate;
|
||||
use Input;
|
||||
use Lang;
|
||||
use Redirect;
|
||||
@@ -344,13 +345,13 @@ class CategoriesController extends Controller
|
||||
$actions = '<a href="'.route('restore/hardware', $asset->id).'" class="btn btn-warning btn-sm"><i class="fa fa-recycle icon-white"></i></a>';
|
||||
}
|
||||
|
||||
if ($asset->assetstatus) {
|
||||
if ($asset->assetstatus->deployable != 0) {
|
||||
if (($asset->assigned_to !='') && ($asset->assigned_to > 0)) {
|
||||
$inout = '<a href="'.route('checkin/hardware', $asset->id).'" class="btn btn-primary btn-sm">'.trans('general.checkin').'</a>';
|
||||
} else {
|
||||
$inout = '<a href="'.route('checkout/hardware', $asset->id).'" class="btn btn-info btn-sm">'.trans('general.checkout').'</a>';
|
||||
}
|
||||
if ($asset->availableForCheckout()) {
|
||||
if (Gate::allows('assets.checkout')) {
|
||||
$inout = '<a href="'.route('checkout/hardware', $asset->id).'" class="btn btn-info btn-sm">'.trans('general.checkout').'</a>';
|
||||
}
|
||||
} else {
|
||||
if (Gate::allows('assets.checkin')) {
|
||||
$inout = '<a href="'.route('checkin/hardware', $asset->id).'" class="btn btn-primary btn-sm">'.trans('general.checkin').'</a>';
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -2,14 +2,15 @@
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use App\Models\Company;
|
||||
use App\Models\Manufacturer;
|
||||
use App\Models\Setting;
|
||||
use Auth;
|
||||
use Illuminate\Support\Facades\Gate;
|
||||
use Input;
|
||||
use Lang;
|
||||
use App\Models\Manufacturer;
|
||||
use Redirect;
|
||||
use App\Models\Setting;
|
||||
use Str;
|
||||
use View;
|
||||
use Auth;
|
||||
|
||||
/**
|
||||
* This controller handles all actions related to Manufacturers for
|
||||
@@ -293,13 +294,13 @@ class ManufacturersController extends Controller
|
||||
$actions = '<a href="'.route('restore/hardware', $asset->id).'" class="btn btn-warning btn-sm"><i class="fa fa-recycle icon-white"></i></a>';
|
||||
}
|
||||
|
||||
if ($asset->assetstatus) {
|
||||
if ($asset->assetstatus->deployable != 0) {
|
||||
if (($asset->assigned_to !='') && ($asset->assigned_to > 0)) {
|
||||
$inout = '<a href="'.route('checkin/hardware', $asset->id).'" class="btn btn-primary btn-sm">'.trans('general.checkin').'</a>';
|
||||
} else {
|
||||
$inout = '<a href="'.route('checkout/hardware', $asset->id).'" class="btn btn-info btn-sm">'.trans('general.checkout').'</a>';
|
||||
}
|
||||
if ($asset->availableForCheckout()) {
|
||||
if (Gate::allows('assets.checkout')) {
|
||||
$inout = '<a href="'.route('checkout/hardware', $asset->id).'" class="btn btn-info btn-sm">'.trans('general.checkout').'</a>';
|
||||
}
|
||||
} else {
|
||||
if (Gate::allows('assets.checkin')) {
|
||||
$inout = '<a href="'.route('checkin/hardware', $asset->id).'" class="btn btn-primary btn-sm">'.trans('general.checkin').'</a>';
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -417,6 +417,7 @@ class SettingsController extends Controller
|
||||
$setting->ad_domain = e(Input::get('ad_domain'));
|
||||
$setting->is_ad = e(Input::get('is_ad', '0'));
|
||||
$setting->ldap_tls = e(Input::get('ldap_tls', '0'));
|
||||
$setting->ldap_pw_sync = e(Input::get('ldap_pw_sync', '0'));
|
||||
|
||||
// If validation fails, we'll exit the operation now.
|
||||
if ($setting->save()) {
|
||||
|
||||
+1
-1
@@ -14,7 +14,7 @@ class Kernel extends HttpKernel
|
||||
* @var array
|
||||
*/
|
||||
protected $middleware = [
|
||||
\Illuminate\Foundation\Http\Middleware\CheckForMaintenanceMode::class,
|
||||
\MisterPhilip\MaintenanceMode\Http\Middleware\CheckForMaintenanceMode::class,
|
||||
\Illuminate\Session\Middleware\StartSession::class,
|
||||
\Illuminate\View\Middleware\ShareErrorsFromSession::class,
|
||||
\App\Http\Middleware\FrameGuard::class,
|
||||
|
||||
@@ -37,6 +37,7 @@ class AssetRequest extends Request
|
||||
'supplier_id' => 'integer',
|
||||
'status' => 'integer',
|
||||
'asset_tag' => 'required',
|
||||
'purchase_cost' => 'numeric',
|
||||
|
||||
];
|
||||
|
||||
|
||||
@@ -187,6 +187,19 @@ Route::group(
|
||||
'auth']],
|
||||
function () {
|
||||
|
||||
Route::get('history', [
|
||||
'as' => 'asset.import-history',
|
||||
'middleware' => 'authorize:assets.checkout',
|
||||
'uses' => 'AssetsController@getImportHistory'
|
||||
]);
|
||||
|
||||
Route::post('history', [
|
||||
'as' => 'asset.process-import-history',
|
||||
'middleware' => 'authorize:assets.checkout',
|
||||
'uses' => 'AssetsController@postImportHistory'
|
||||
]);
|
||||
|
||||
|
||||
Route::get('create/{model?}', [
|
||||
'as' => 'create/hardware',
|
||||
'middleware' => 'authorize:assets.create',
|
||||
|
||||
@@ -22,11 +22,12 @@ class Accessory extends Model
|
||||
* Accessory validation rules
|
||||
*/
|
||||
public $rules = array(
|
||||
'name' => 'required|min:3|max:255',
|
||||
'qty' => 'required|integer|min:1',
|
||||
'category_id' => 'required|integer',
|
||||
'company_id' => 'integer',
|
||||
'min_amt' => 'integer|min:1',
|
||||
'name' => 'required|min:3|max:255',
|
||||
'qty' => 'required|integer|min:1',
|
||||
'category_id' => 'required|integer',
|
||||
'company_id' => 'integer',
|
||||
'min_amt' => 'integer|min:1',
|
||||
'purchase_cost' => 'numeric',
|
||||
);
|
||||
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@ class Actionlog extends Model implements ICompanyableChild
|
||||
|
||||
protected $table = 'asset_logs';
|
||||
public $timestamps = true;
|
||||
protected $fillable = [ 'created_at', 'asset_type' ];
|
||||
protected $fillable = [ 'created_at', 'asset_type','user_id','asset_id','action_type','note','checkedout_to' ];
|
||||
|
||||
public function getCompanyableParents()
|
||||
{
|
||||
|
||||
+19
-6
@@ -55,6 +55,7 @@ class Asset extends Depreciable
|
||||
'supplier_id' => 'integer',
|
||||
'asset_tag' => 'required|min:1|max:255|unique_undeleted',
|
||||
'status' => 'integer',
|
||||
'purchase_cost' => 'numeric',
|
||||
];
|
||||
|
||||
|
||||
@@ -72,22 +73,36 @@ class Asset extends Depreciable
|
||||
}
|
||||
|
||||
|
||||
|
||||
public function availableForCheckout()
|
||||
{
|
||||
return (
|
||||
empty($this->assigned_to) &&
|
||||
$this->assetstatus->deployable == 1 &&
|
||||
empty($this->deleted_at)
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Checkout asset
|
||||
*/
|
||||
public function checkOutToUser($user, $admin, $checkout_at = null, $expected_checkin = null, $note = null, $name = null)
|
||||
{
|
||||
if (!$user) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if ($expected_checkin) {
|
||||
$this->expected_checkin = $expected_checkin ;
|
||||
$this->expected_checkin = $expected_checkin;
|
||||
}
|
||||
|
||||
$this->last_checkout = $checkout_at;
|
||||
|
||||
$this->assigneduser()->associate($user);
|
||||
$this->name = $name;
|
||||
|
||||
if($name != null)
|
||||
{
|
||||
$this->name = $name;
|
||||
}
|
||||
|
||||
$settings = Setting::getSettings();
|
||||
|
||||
@@ -95,9 +110,7 @@ class Asset extends Depreciable
|
||||
$this->accepted="pending";
|
||||
}
|
||||
|
||||
if (!$user) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
if ($this->save()) {
|
||||
|
||||
|
||||
@@ -34,6 +34,7 @@ class Component extends Model
|
||||
'category_id' => 'required|integer',
|
||||
'company_id' => 'integer',
|
||||
'purchase_date' => 'date',
|
||||
'purchase_cost' => 'numeric',
|
||||
);
|
||||
|
||||
/**
|
||||
|
||||
@@ -29,6 +29,7 @@ class Consumable extends Model
|
||||
'category_id' => 'required|integer',
|
||||
'company_id' => 'integer',
|
||||
'min_amt' => 'integer|min:1',
|
||||
'purchase_cost' => 'numeric',
|
||||
);
|
||||
|
||||
/**
|
||||
|
||||
+9
-1
@@ -191,6 +191,7 @@ class Ldap extends Model
|
||||
{
|
||||
$item = Ldap::parseAndMapLdapAttributes($ldapatttibutes);
|
||||
|
||||
|
||||
// Create user from LDAP data
|
||||
if (!empty($item["username"])) {
|
||||
$user = new User;
|
||||
@@ -198,7 +199,14 @@ class Ldap extends Model
|
||||
$user->last_name = $item["lastname"];
|
||||
$user->username = $item["username"];
|
||||
$user->email = $item["email"];
|
||||
$user->password = bcrypt(Input::get("password"));
|
||||
|
||||
if (Setting::getSettings()->ldap_pw_sync=='1') {
|
||||
$user->password = bcrypt(Input::get("password"));
|
||||
} else {
|
||||
$pass = substr(str_shuffle("0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"), 0, 25);
|
||||
$user->password = bcrypt($pass);
|
||||
}
|
||||
|
||||
$user->activated = 1;
|
||||
$user->ldap_import = 1;
|
||||
$user->notes = 'Imported on first login from LDAP';
|
||||
|
||||
+6
-1
@@ -302,6 +302,10 @@ class User extends Model implements AuthenticatableContract, CanResetPasswordCon
|
||||
->orWhere('username', '=', $user_email);
|
||||
}
|
||||
|
||||
public static function generateEmailFromFullName($name) {
|
||||
$username = User::generateFormattedNameFromFullName(Setting::getSettings()->email_format, $name);
|
||||
return $username['username'].'@'.Setting::getSettings()->email_domain;
|
||||
}
|
||||
|
||||
public static function generateFormattedNameFromFullName($format = 'filastname', $users_name)
|
||||
{
|
||||
@@ -333,8 +337,9 @@ class User extends Model implements AuthenticatableContract, CanResetPasswordCon
|
||||
} elseif ($format=='firstname') {
|
||||
$email_last_name.=str_replace(' ', '', $last_name);
|
||||
$email_prefix = $first_name;
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
$user_username = $email_prefix;
|
||||
|
||||
@@ -91,6 +91,12 @@ class AuthServiceProvider extends ServiceProvider
|
||||
}
|
||||
});
|
||||
|
||||
$gate->define('assets.edit', function ($user) {
|
||||
if (($user->hasAccess('assets.edit')) || ($user->hasAccess('admin'))) {
|
||||
return true;
|
||||
}
|
||||
});
|
||||
|
||||
// Checks for some level of management
|
||||
$gate->define('assets.manage', function ($user) {
|
||||
if (($user->hasAccess('assets.checkin')) || ($user->hasAccess('assets.edit')) || ($user->hasAccess('assets.delete')) || ($user->hasAccess('assets.checkout')) || ($user->hasAccess('admin'))) {
|
||||
|
||||
+2
-1
@@ -21,7 +21,8 @@
|
||||
"doctrine/common": "v2.5.3",
|
||||
"doctrine/dbal": "v2.4.2",
|
||||
"barryvdh/laravel-debugbar": "^2.1",
|
||||
"spatie/laravel-backup": "3.8.1"
|
||||
"spatie/laravel-backup": "3.8.1",
|
||||
"misterphilip/maintenance-mode": "1.0.*"
|
||||
},
|
||||
"require-dev": {
|
||||
"fzaninotto/faker": "~1.4",
|
||||
|
||||
Generated
+157
-109
@@ -4,21 +4,21 @@
|
||||
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
|
||||
"This file is @generated automatically"
|
||||
],
|
||||
"hash": "bf63c53f99a010e882f5c4b797e9f098",
|
||||
"content-hash": "47c6ecb6331ff36a3e58ca8ddac195f8",
|
||||
"hash": "a770010d0ebb93a2e1b5f4acadd5a7f3",
|
||||
"content-hash": "59772418a4612685eea10dde38ca77b7",
|
||||
"packages": [
|
||||
{
|
||||
"name": "aws/aws-sdk-php",
|
||||
"version": "3.18.30",
|
||||
"version": "3.18.39",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/aws/aws-sdk-php.git",
|
||||
"reference": "fbce85229b913a9e1aded54e464a9bbff0787bf1"
|
||||
"reference": "85f1fddaeb40b95106b2a2764268e9c89fc258ce"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/aws/aws-sdk-php/zipball/fbce85229b913a9e1aded54e464a9bbff0787bf1",
|
||||
"reference": "fbce85229b913a9e1aded54e464a9bbff0787bf1",
|
||||
"url": "https://api.github.com/repos/aws/aws-sdk-php/zipball/85f1fddaeb40b95106b2a2764268e9c89fc258ce",
|
||||
"reference": "85f1fddaeb40b95106b2a2764268e9c89fc258ce",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@@ -85,7 +85,7 @@
|
||||
"s3",
|
||||
"sdk"
|
||||
],
|
||||
"time": "2016-07-18 16:15:53"
|
||||
"time": "2016-08-11 16:40:35"
|
||||
},
|
||||
{
|
||||
"name": "aws/aws-sdk-php-laravel",
|
||||
@@ -754,12 +754,12 @@
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/erusev/parsedown.git",
|
||||
"reference": "490a8f35a4163f59230f53c34f1fbb22a864c01e"
|
||||
"reference": "f671ae73647b6666c1442cbaac98e5d60208e409"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/erusev/parsedown/zipball/490a8f35a4163f59230f53c34f1fbb22a864c01e",
|
||||
"reference": "490a8f35a4163f59230f53c34f1fbb22a864c01e",
|
||||
"url": "https://api.github.com/repos/erusev/parsedown/zipball/f671ae73647b6666c1442cbaac98e5d60208e409",
|
||||
"reference": "f671ae73647b6666c1442cbaac98e5d60208e409",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@@ -788,7 +788,7 @@
|
||||
"markdown",
|
||||
"parser"
|
||||
],
|
||||
"time": "2016-03-09 17:02:39"
|
||||
"time": "2016-07-27 08:05:24"
|
||||
},
|
||||
{
|
||||
"name": "fideloper/proxy",
|
||||
@@ -1221,16 +1221,16 @@
|
||||
},
|
||||
{
|
||||
"name": "laravel/framework",
|
||||
"version": "v5.2.39",
|
||||
"version": "v5.2.43",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/laravel/framework.git",
|
||||
"reference": "c2a77050269b4e03bd9a735a9f24e573a7598b8a"
|
||||
"reference": "5490b8f00564bb60839002f86828e27edd1e5610"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/laravel/framework/zipball/c2a77050269b4e03bd9a735a9f24e573a7598b8a",
|
||||
"reference": "c2a77050269b4e03bd9a735a9f24e573a7598b8a",
|
||||
"url": "https://api.github.com/repos/laravel/framework/zipball/5490b8f00564bb60839002f86828e27edd1e5610",
|
||||
"reference": "5490b8f00564bb60839002f86828e27edd1e5610",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@@ -1287,7 +1287,8 @@
|
||||
"illuminate/support": "self.version",
|
||||
"illuminate/translation": "self.version",
|
||||
"illuminate/validation": "self.version",
|
||||
"illuminate/view": "self.version"
|
||||
"illuminate/view": "self.version",
|
||||
"tightenco/collect": "self.version"
|
||||
},
|
||||
"require-dev": {
|
||||
"aws/aws-sdk-php": "~3.0",
|
||||
@@ -1346,7 +1347,7 @@
|
||||
"framework",
|
||||
"laravel"
|
||||
],
|
||||
"time": "2016-06-17 19:25:12"
|
||||
"time": "2016-08-10 12:23:59"
|
||||
},
|
||||
{
|
||||
"name": "laravelcollective/html",
|
||||
@@ -1461,16 +1462,16 @@
|
||||
},
|
||||
{
|
||||
"name": "league/flysystem",
|
||||
"version": "1.0.25",
|
||||
"version": "1.0.27",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/thephpleague/flysystem.git",
|
||||
"reference": "a76afa4035931be0c78ca8efc6abf3902362f437"
|
||||
"reference": "50e2045ed70a7e75a5e30bc3662904f3b67af8a9"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/thephpleague/flysystem/zipball/a76afa4035931be0c78ca8efc6abf3902362f437",
|
||||
"reference": "a76afa4035931be0c78ca8efc6abf3902362f437",
|
||||
"url": "https://api.github.com/repos/thephpleague/flysystem/zipball/50e2045ed70a7e75a5e30bc3662904f3b67af8a9",
|
||||
"reference": "50e2045ed70a7e75a5e30bc3662904f3b67af8a9",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@@ -1540,7 +1541,7 @@
|
||||
"sftp",
|
||||
"storage"
|
||||
],
|
||||
"time": "2016-07-18 12:22:57"
|
||||
"time": "2016-08-10 08:55:11"
|
||||
},
|
||||
{
|
||||
"name": "maknz/slack",
|
||||
@@ -1548,12 +1549,12 @@
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/maknz/slack.git",
|
||||
"reference": "e44a4685743c2286466ce5f0dbc025cf23248333"
|
||||
"reference": "e9bab77eb7344f4697756ca55386576b05dc8e5a"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/maknz/slack/zipball/e44a4685743c2286466ce5f0dbc025cf23248333",
|
||||
"reference": "e44a4685743c2286466ce5f0dbc025cf23248333",
|
||||
"url": "https://api.github.com/repos/maknz/slack/zipball/e9bab77eb7344f4697756ca55386576b05dc8e5a",
|
||||
"reference": "e9bab77eb7344f4697756ca55386576b05dc8e5a",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@@ -1590,7 +1591,7 @@
|
||||
"laravel",
|
||||
"slack"
|
||||
],
|
||||
"time": "2016-06-26 05:15:48"
|
||||
"time": "2016-07-27 23:17:40"
|
||||
},
|
||||
{
|
||||
"name": "maximebf/debugbar",
|
||||
@@ -1654,17 +1655,62 @@
|
||||
"time": "2016-01-22 12:22:23"
|
||||
},
|
||||
{
|
||||
"name": "monolog/monolog",
|
||||
"version": "1.20.0",
|
||||
"name": "misterphilip/maintenance-mode",
|
||||
"version": "1.0.2",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/Seldaek/monolog.git",
|
||||
"reference": "55841909e2bcde01b5318c35f2b74f8ecc86e037"
|
||||
"url": "https://github.com/MisterPhilip/maintenance-mode.git",
|
||||
"reference": "35e061703edb3c0703baea677335c03085f2b179"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/Seldaek/monolog/zipball/55841909e2bcde01b5318c35f2b74f8ecc86e037",
|
||||
"reference": "55841909e2bcde01b5318c35f2b74f8ecc86e037",
|
||||
"url": "https://api.github.com/repos/MisterPhilip/maintenance-mode/zipball/35e061703edb3c0703baea677335c03085f2b179",
|
||||
"reference": "35e061703edb3c0703baea677335c03085f2b179",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"illuminate/support": "5.0 - 5.2",
|
||||
"nesbot/carbon": "~1.19",
|
||||
"php": ">=5.4.0"
|
||||
},
|
||||
"type": "library",
|
||||
"autoload": {
|
||||
"psr-0": {
|
||||
"MisterPhilip\\MaintenanceMode": "src/"
|
||||
}
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
"MIT"
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "Philip Lawrence",
|
||||
"email": "philip@misterphilip.com",
|
||||
"homepage": "http://misterphilip.com"
|
||||
}
|
||||
],
|
||||
"description": "An enhanced drop-in replacement for Laravel 5's maintenance mode",
|
||||
"keywords": [
|
||||
"l5",
|
||||
"laravel",
|
||||
"laravel5",
|
||||
"maintenance"
|
||||
],
|
||||
"time": "2015-12-23 07:24:42"
|
||||
},
|
||||
{
|
||||
"name": "monolog/monolog",
|
||||
"version": "1.21.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/Seldaek/monolog.git",
|
||||
"reference": "f42fbdfd53e306bda545845e4dbfd3e72edb4952"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/Seldaek/monolog/zipball/f42fbdfd53e306bda545845e4dbfd3e72edb4952",
|
||||
"reference": "f42fbdfd53e306bda545845e4dbfd3e72edb4952",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@@ -1729,7 +1775,7 @@
|
||||
"logging",
|
||||
"psr-3"
|
||||
],
|
||||
"time": "2016-07-02 14:02:10"
|
||||
"time": "2016-07-29 03:23:52"
|
||||
},
|
||||
{
|
||||
"name": "mtdowling/cron-expression",
|
||||
@@ -1978,16 +2024,16 @@
|
||||
},
|
||||
{
|
||||
"name": "psr/http-message",
|
||||
"version": "1.0",
|
||||
"version": "1.0.1",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/php-fig/http-message.git",
|
||||
"reference": "85d63699f0dbedb190bbd4b0d2b9dc707ea4c298"
|
||||
"reference": "f6561bf28d520154e4b0ec72be95418abe6d9363"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/php-fig/http-message/zipball/85d63699f0dbedb190bbd4b0d2b9dc707ea4c298",
|
||||
"reference": "85d63699f0dbedb190bbd4b0d2b9dc707ea4c298",
|
||||
"url": "https://api.github.com/repos/php-fig/http-message/zipball/f6561bf28d520154e4b0ec72be95418abe6d9363",
|
||||
"reference": "f6561bf28d520154e4b0ec72be95418abe6d9363",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@@ -2015,6 +2061,7 @@
|
||||
}
|
||||
],
|
||||
"description": "Common interface for HTTP messages",
|
||||
"homepage": "https://github.com/php-fig/http-message",
|
||||
"keywords": [
|
||||
"http",
|
||||
"http-message",
|
||||
@@ -2023,7 +2070,7 @@
|
||||
"request",
|
||||
"response"
|
||||
],
|
||||
"time": "2015-05-04 20:22:00"
|
||||
"time": "2016-08-06 14:39:51"
|
||||
},
|
||||
{
|
||||
"name": "psr/log",
|
||||
@@ -2302,16 +2349,16 @@
|
||||
},
|
||||
{
|
||||
"name": "symfony/console",
|
||||
"version": "v3.0.8",
|
||||
"version": "v3.0.9",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/symfony/console.git",
|
||||
"reference": "a7abb7153f6d1da47f87ec50274844e246b09d9f"
|
||||
"reference": "926061e74229e935d3c5b4e9ba87237316c6693f"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/symfony/console/zipball/a7abb7153f6d1da47f87ec50274844e246b09d9f",
|
||||
"reference": "a7abb7153f6d1da47f87ec50274844e246b09d9f",
|
||||
"url": "https://api.github.com/repos/symfony/console/zipball/926061e74229e935d3c5b4e9ba87237316c6693f",
|
||||
"reference": "926061e74229e935d3c5b4e9ba87237316c6693f",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@@ -2358,20 +2405,20 @@
|
||||
],
|
||||
"description": "Symfony Console Component",
|
||||
"homepage": "https://symfony.com",
|
||||
"time": "2016-06-29 07:02:21"
|
||||
"time": "2016-07-30 07:22:48"
|
||||
},
|
||||
{
|
||||
"name": "symfony/debug",
|
||||
"version": "v3.0.8",
|
||||
"version": "v3.0.9",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/symfony/debug.git",
|
||||
"reference": "c54bc3539c3b87e86799533801e8ae0e971d78c2"
|
||||
"reference": "697c527acd9ea1b2d3efac34d9806bf255278b0a"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/symfony/debug/zipball/c54bc3539c3b87e86799533801e8ae0e971d78c2",
|
||||
"reference": "c54bc3539c3b87e86799533801e8ae0e971d78c2",
|
||||
"url": "https://api.github.com/repos/symfony/debug/zipball/697c527acd9ea1b2d3efac34d9806bf255278b0a",
|
||||
"reference": "697c527acd9ea1b2d3efac34d9806bf255278b0a",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@@ -2415,20 +2462,20 @@
|
||||
],
|
||||
"description": "Symfony Debug Component",
|
||||
"homepage": "https://symfony.com",
|
||||
"time": "2016-06-29 05:40:00"
|
||||
"time": "2016-07-30 07:22:48"
|
||||
},
|
||||
{
|
||||
"name": "symfony/event-dispatcher",
|
||||
"version": "v3.1.2",
|
||||
"version": "v3.1.3",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/symfony/event-dispatcher.git",
|
||||
"reference": "7f9839ede2070f53e7e2f0849b9bd14748c434c5"
|
||||
"reference": "c0c00c80b3a69132c4e55c3e7db32b4a387615e5"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/7f9839ede2070f53e7e2f0849b9bd14748c434c5",
|
||||
"reference": "7f9839ede2070f53e7e2f0849b9bd14748c434c5",
|
||||
"url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/c0c00c80b3a69132c4e55c3e7db32b4a387615e5",
|
||||
"reference": "c0c00c80b3a69132c4e55c3e7db32b4a387615e5",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@@ -2475,11 +2522,11 @@
|
||||
],
|
||||
"description": "Symfony EventDispatcher Component",
|
||||
"homepage": "https://symfony.com",
|
||||
"time": "2016-06-29 05:41:56"
|
||||
"time": "2016-07-19 10:45:57"
|
||||
},
|
||||
{
|
||||
"name": "symfony/finder",
|
||||
"version": "v3.0.8",
|
||||
"version": "v3.0.9",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/symfony/finder.git",
|
||||
@@ -2528,16 +2575,16 @@
|
||||
},
|
||||
{
|
||||
"name": "symfony/http-foundation",
|
||||
"version": "v3.0.8",
|
||||
"version": "v3.0.9",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/symfony/http-foundation.git",
|
||||
"reference": "1341139f906d295baa4f4abd55293d07e25a065a"
|
||||
"reference": "49ba00f8ede742169cb6b70abe33243f4d673f82"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/symfony/http-foundation/zipball/1341139f906d295baa4f4abd55293d07e25a065a",
|
||||
"reference": "1341139f906d295baa4f4abd55293d07e25a065a",
|
||||
"url": "https://api.github.com/repos/symfony/http-foundation/zipball/49ba00f8ede742169cb6b70abe33243f4d673f82",
|
||||
"reference": "49ba00f8ede742169cb6b70abe33243f4d673f82",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@@ -2577,20 +2624,20 @@
|
||||
],
|
||||
"description": "Symfony HttpFoundation Component",
|
||||
"homepage": "https://symfony.com",
|
||||
"time": "2016-06-29 07:02:21"
|
||||
"time": "2016-07-17 13:54:30"
|
||||
},
|
||||
{
|
||||
"name": "symfony/http-kernel",
|
||||
"version": "v3.0.8",
|
||||
"version": "v3.0.9",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/symfony/http-kernel.git",
|
||||
"reference": "177b63b2d50b63fa6d82ea41359ed9928cc7a1fb"
|
||||
"reference": "d97ba4425e36e79c794e7d14ff36f00f081b37b3"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/symfony/http-kernel/zipball/177b63b2d50b63fa6d82ea41359ed9928cc7a1fb",
|
||||
"reference": "177b63b2d50b63fa6d82ea41359ed9928cc7a1fb",
|
||||
"url": "https://api.github.com/repos/symfony/http-kernel/zipball/d97ba4425e36e79c794e7d14ff36f00f081b37b3",
|
||||
"reference": "d97ba4425e36e79c794e7d14ff36f00f081b37b3",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@@ -2659,7 +2706,7 @@
|
||||
],
|
||||
"description": "Symfony HttpKernel Component",
|
||||
"homepage": "https://symfony.com",
|
||||
"time": "2016-06-30 16:30:17"
|
||||
"time": "2016-07-30 09:10:37"
|
||||
},
|
||||
{
|
||||
"name": "symfony/polyfill-mbstring",
|
||||
@@ -2830,16 +2877,16 @@
|
||||
},
|
||||
{
|
||||
"name": "symfony/process",
|
||||
"version": "v3.0.8",
|
||||
"version": "v3.0.9",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/symfony/process.git",
|
||||
"reference": "d7cde1f9d94d87060204f863779389b61c382eeb"
|
||||
"reference": "768debc5996f599c4372b322d9061dba2a4bf505"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/symfony/process/zipball/d7cde1f9d94d87060204f863779389b61c382eeb",
|
||||
"reference": "d7cde1f9d94d87060204f863779389b61c382eeb",
|
||||
"url": "https://api.github.com/repos/symfony/process/zipball/768debc5996f599c4372b322d9061dba2a4bf505",
|
||||
"reference": "768debc5996f599c4372b322d9061dba2a4bf505",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@@ -2875,11 +2922,11 @@
|
||||
],
|
||||
"description": "Symfony Process Component",
|
||||
"homepage": "https://symfony.com",
|
||||
"time": "2016-06-29 05:40:00"
|
||||
"time": "2016-07-28 11:13:34"
|
||||
},
|
||||
{
|
||||
"name": "symfony/routing",
|
||||
"version": "v3.0.8",
|
||||
"version": "v3.0.9",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/symfony/routing.git",
|
||||
@@ -2954,16 +3001,16 @@
|
||||
},
|
||||
{
|
||||
"name": "symfony/translation",
|
||||
"version": "v3.0.8",
|
||||
"version": "v3.0.9",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/symfony/translation.git",
|
||||
"reference": "6bf844e1ee3c820c012386c10427a5c67bbefec8"
|
||||
"reference": "eee6c664853fd0576f21ae25725cfffeafe83f26"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/symfony/translation/zipball/6bf844e1ee3c820c012386c10427a5c67bbefec8",
|
||||
"reference": "6bf844e1ee3c820c012386c10427a5c67bbefec8",
|
||||
"url": "https://api.github.com/repos/symfony/translation/zipball/eee6c664853fd0576f21ae25725cfffeafe83f26",
|
||||
"reference": "eee6c664853fd0576f21ae25725cfffeafe83f26",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@@ -3014,20 +3061,20 @@
|
||||
],
|
||||
"description": "Symfony Translation Component",
|
||||
"homepage": "https://symfony.com",
|
||||
"time": "2016-06-29 05:40:00"
|
||||
"time": "2016-07-30 07:22:48"
|
||||
},
|
||||
{
|
||||
"name": "symfony/var-dumper",
|
||||
"version": "v3.0.8",
|
||||
"version": "v3.0.9",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/symfony/var-dumper.git",
|
||||
"reference": "2f046e9a9d571f22cc8b26783564876713b06579"
|
||||
"reference": "1f7e071aafc6676fcb6e3f0497f87c2397247377"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/symfony/var-dumper/zipball/2f046e9a9d571f22cc8b26783564876713b06579",
|
||||
"reference": "2f046e9a9d571f22cc8b26783564876713b06579",
|
||||
"url": "https://api.github.com/repos/symfony/var-dumper/zipball/1f7e071aafc6676fcb6e3f0497f87c2397247377",
|
||||
"reference": "1f7e071aafc6676fcb6e3f0497f87c2397247377",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@@ -3077,7 +3124,7 @@
|
||||
"debug",
|
||||
"dump"
|
||||
],
|
||||
"time": "2016-06-29 05:40:00"
|
||||
"time": "2016-07-26 08:03:56"
|
||||
},
|
||||
{
|
||||
"name": "tecnickcom/tc-lib-barcode",
|
||||
@@ -4289,16 +4336,16 @@
|
||||
},
|
||||
{
|
||||
"name": "phpunit/phpunit",
|
||||
"version": "4.8.26",
|
||||
"version": "4.8.27",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/sebastianbergmann/phpunit.git",
|
||||
"reference": "fc1d8cd5b5de11625979125c5639347896ac2c74"
|
||||
"reference": "c062dddcb68e44b563f66ee319ddae2b5a322a90"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/fc1d8cd5b5de11625979125c5639347896ac2c74",
|
||||
"reference": "fc1d8cd5b5de11625979125c5639347896ac2c74",
|
||||
"url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/c062dddcb68e44b563f66ee319ddae2b5a322a90",
|
||||
"reference": "c062dddcb68e44b563f66ee319ddae2b5a322a90",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@@ -4357,7 +4404,7 @@
|
||||
"testing",
|
||||
"xunit"
|
||||
],
|
||||
"time": "2016-05-17 03:09:28"
|
||||
"time": "2016-07-21 06:48:14"
|
||||
},
|
||||
{
|
||||
"name": "phpunit/phpunit-mock-objects",
|
||||
@@ -4867,16 +4914,16 @@
|
||||
},
|
||||
{
|
||||
"name": "symfony/browser-kit",
|
||||
"version": "v3.1.2",
|
||||
"version": "v3.1.3",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/symfony/browser-kit.git",
|
||||
"reference": "dcf41ed026b0499254385b5c88f03247b2ba010b"
|
||||
"reference": "d2a07cc11c5fa94820240b1e67592ffb18e347b9"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/symfony/browser-kit/zipball/dcf41ed026b0499254385b5c88f03247b2ba010b",
|
||||
"reference": "dcf41ed026b0499254385b5c88f03247b2ba010b",
|
||||
"url": "https://api.github.com/repos/symfony/browser-kit/zipball/d2a07cc11c5fa94820240b1e67592ffb18e347b9",
|
||||
"reference": "d2a07cc11c5fa94820240b1e67592ffb18e347b9",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@@ -4920,11 +4967,11 @@
|
||||
],
|
||||
"description": "Symfony BrowserKit Component",
|
||||
"homepage": "https://symfony.com",
|
||||
"time": "2016-06-29 05:41:56"
|
||||
"time": "2016-07-26 08:04:17"
|
||||
},
|
||||
{
|
||||
"name": "symfony/css-selector",
|
||||
"version": "v3.1.2",
|
||||
"version": "v3.1.3",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/symfony/css-selector.git",
|
||||
@@ -4977,16 +5024,16 @@
|
||||
},
|
||||
{
|
||||
"name": "symfony/dom-crawler",
|
||||
"version": "v3.1.2",
|
||||
"version": "v3.1.3",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/symfony/dom-crawler.git",
|
||||
"reference": "99ec4a23330fcd0c8667095f3ef7aa204ffd9dc0"
|
||||
"reference": "c7b9b8db3a6f2bac76dcd9a9db5446f2591897f9"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/symfony/dom-crawler/zipball/99ec4a23330fcd0c8667095f3ef7aa204ffd9dc0",
|
||||
"reference": "99ec4a23330fcd0c8667095f3ef7aa204ffd9dc0",
|
||||
"url": "https://api.github.com/repos/symfony/dom-crawler/zipball/c7b9b8db3a6f2bac76dcd9a9db5446f2591897f9",
|
||||
"reference": "c7b9b8db3a6f2bac76dcd9a9db5446f2591897f9",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@@ -5029,20 +5076,20 @@
|
||||
],
|
||||
"description": "Symfony DomCrawler Component",
|
||||
"homepage": "https://symfony.com",
|
||||
"time": "2016-06-29 05:41:56"
|
||||
"time": "2016-07-26 08:04:17"
|
||||
},
|
||||
{
|
||||
"name": "symfony/yaml",
|
||||
"version": "v3.1.2",
|
||||
"version": "v3.1.3",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/symfony/yaml.git",
|
||||
"reference": "2884c26ce4c1d61aebf423a8b912950fe7c764de"
|
||||
"reference": "1819adf2066880c7967df7180f4f662b6f0567ac"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/symfony/yaml/zipball/2884c26ce4c1d61aebf423a8b912950fe7c764de",
|
||||
"reference": "2884c26ce4c1d61aebf423a8b912950fe7c764de",
|
||||
"url": "https://api.github.com/repos/symfony/yaml/zipball/1819adf2066880c7967df7180f4f662b6f0567ac",
|
||||
"reference": "1819adf2066880c7967df7180f4f662b6f0567ac",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@@ -5078,32 +5125,33 @@
|
||||
],
|
||||
"description": "Symfony Yaml Component",
|
||||
"homepage": "https://symfony.com",
|
||||
"time": "2016-06-29 05:41:56"
|
||||
"time": "2016-07-17 14:02:08"
|
||||
},
|
||||
{
|
||||
"name": "webmozart/assert",
|
||||
"version": "1.0.2",
|
||||
"version": "1.1.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/webmozart/assert.git",
|
||||
"reference": "30eed06dd6bc88410a4ff7f77b6d22f3ce13dbde"
|
||||
"reference": "bb2d123231c095735130cc8f6d31385a44c7b308"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/webmozart/assert/zipball/30eed06dd6bc88410a4ff7f77b6d22f3ce13dbde",
|
||||
"reference": "30eed06dd6bc88410a4ff7f77b6d22f3ce13dbde",
|
||||
"url": "https://api.github.com/repos/webmozart/assert/zipball/bb2d123231c095735130cc8f6d31385a44c7b308",
|
||||
"reference": "bb2d123231c095735130cc8f6d31385a44c7b308",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"php": ">=5.3.3"
|
||||
"php": "^5.3.3|^7.0"
|
||||
},
|
||||
"require-dev": {
|
||||
"phpunit/phpunit": "^4.6"
|
||||
"phpunit/phpunit": "^4.6",
|
||||
"sebastian/version": "^1.0.1"
|
||||
},
|
||||
"type": "library",
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
"dev-master": "1.0-dev"
|
||||
"dev-master": "1.2-dev"
|
||||
}
|
||||
},
|
||||
"autoload": {
|
||||
@@ -5127,7 +5175,7 @@
|
||||
"check",
|
||||
"validate"
|
||||
],
|
||||
"time": "2015-08-24 13:29:44"
|
||||
"time": "2016-08-09 15:02:57"
|
||||
}
|
||||
],
|
||||
"aliases": [],
|
||||
|
||||
@@ -197,6 +197,8 @@ return [
|
||||
Collective\Html\HtmlServiceProvider::class,
|
||||
Spatie\Backup\BackupServiceProvider::class,
|
||||
Fideloper\Proxy\TrustedProxyServiceProvider::class,
|
||||
MisterPhilip\MaintenanceMode\MaintenanceModeServiceProvider::class,
|
||||
MisterPhilip\MaintenanceMode\MaintenanceCommandServiceProvider::class,
|
||||
|
||||
/*
|
||||
* Custom service provider
|
||||
|
||||
+2
-2
@@ -1,5 +1,5 @@
|
||||
<?php
|
||||
return array (
|
||||
'app_version' => 'v3.2.0',
|
||||
'hash_version' => 'v3.2.0-53-gfff2bce',
|
||||
'app_version' => 'v3.3.0',
|
||||
'hash_version' => 'v3.3.0-3-g7ef4f23',
|
||||
);
|
||||
|
||||
@@ -0,0 +1,31 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
|
||||
class AddDisallowLdapPwSyncToSettings extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::table('settings', function (Blueprint $table) {
|
||||
$table->boolean('ldap_pw_sync')->default(1);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::table('settings', function ($table) {
|
||||
$table->dropColumn('ldap_pw_sync');
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -50,7 +50,7 @@
|
||||
# when the CA certificates are directly appended to the server
|
||||
# certificate for convinience.
|
||||
#SSLCertificateChainFile /etc/apache2/ssl.crt/server-ca.crt
|
||||
SSLCertificateChainFile /etc/ssl/private/snipeit-ssl.crt
|
||||
SSLCertificateChainFile /var/lib/snipeit/ssl/snipeit-ssl.crt
|
||||
|
||||
# Certificate Authority (CA):
|
||||
# Set the CA certificate verification path where to find CA
|
||||
|
||||
@@ -52,7 +52,8 @@ return array(
|
||||
'checkout' => array(
|
||||
'error' => 'Asset was not checked out, please try again',
|
||||
'success' => 'Asset checked out successfully.',
|
||||
'user_does_not_exist' => 'That user is invalid. Please try again.'
|
||||
'user_does_not_exist' => 'That user is invalid. Please try again.',
|
||||
'not_available' => 'That asset is not available for checkout!'
|
||||
),
|
||||
|
||||
'checkin' => array(
|
||||
|
||||
@@ -51,6 +51,8 @@ return array(
|
||||
'ldap_pword' => 'LDAP Bind Password',
|
||||
'ldap_basedn' => 'Base Bind DN',
|
||||
'ldap_filter' => 'LDAP Filter',
|
||||
'ldap_pw_sync' => 'LDAP Password Sync',
|
||||
'ldap_pw_sync_help' => 'Uncheck this box if you do not wish to keep LDAP passwords synced with local passwords. Disabling this means that your users may not be able to login if your LDAP server is unreachable for some reason.',
|
||||
'ldap_username_field' => 'Username Field',
|
||||
'ldap_lname_field' => 'Last Name',
|
||||
'ldap_fname_field' => 'LDAP First Name',
|
||||
|
||||
@@ -76,6 +76,7 @@
|
||||
'image_delete' => 'Delete Image',
|
||||
'image_upload' => 'Upload Image',
|
||||
'import' => 'Import',
|
||||
'import-history' => 'Import History',
|
||||
'asset_maintenance' => 'Asset Maintenance',
|
||||
'asset_maintenance_report' => 'Asset Maintenance Report',
|
||||
'asset_maintenances' => 'Asset Maintenances',
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
<div class="col-md-12">
|
||||
|
||||
<h3>
|
||||
Accept {{ $item->name }}</h3>
|
||||
Accept {{ $item->showAssetName() }}</h3>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -42,8 +42,8 @@
|
||||
<!-- Asset -->
|
||||
<div class="form-group {{ $errors->has('asset_id') ? ' has-error' : '' }}">
|
||||
<label for="asset_id" class="col-md-3 control-label">{{ trans('admin/asset_maintenances/table.asset_name') }}
|
||||
<i class='fa fa-asterisk'></i></label>
|
||||
<div class="col-md-7">
|
||||
</label>
|
||||
<div class="col-md-7{{ (\App\Helpers\Helper::checkIfRequired($assetMaintenance, 'asset_id')) ? ' required' : '' }}">
|
||||
@if ($selectedAsset == null)
|
||||
{{ Form::select('asset_id', $asset_list , Input::old('asset_id', $assetMaintenance->asset_id), ['class'=>'select2', 'style'=>'min-width:350px']) }}
|
||||
@else
|
||||
@@ -56,8 +56,8 @@
|
||||
<!-- Supplier -->
|
||||
<div class="form-group {{ $errors->has('supplier_id') ? ' has-error' : '' }}">
|
||||
<label for="supplier_id" class="col-md-3 control-label">{{ trans('admin/asset_maintenances/table.supplier_name') }}
|
||||
<i class='fa fa-asterisk'></i></label>
|
||||
<div class="col-md-7">
|
||||
</label>
|
||||
<div class="col-md-7{{ (\App\Helpers\Helper::checkIfRequired($assetMaintenance, 'supplier_id')) ? ' required' : '' }}">
|
||||
{{ Form::select('supplier_id', $supplier_list , Input::old('supplier_id', $assetMaintenance->supplier_id), ['class'=>'select2', 'style'=>'min-width:350px']) }}
|
||||
{!! $errors->first('supplier_id', '<span class="alert-msg"><i class="fa fa-times"></i> :message</span>') !!}
|
||||
</div>
|
||||
@@ -66,8 +66,8 @@
|
||||
<!-- Improvement Type -->
|
||||
<div class="form-group {{ $errors->has('asset_maintenance_type') ? ' has-error' : '' }}">
|
||||
<label for="asset_maintenance_type" class="col-md-3 control-label">{{ trans('admin/asset_maintenances/form.asset_maintenance_type') }}
|
||||
<i class='fa fa-asterisk'></i></label>
|
||||
<div class="col-md-7">
|
||||
</label>
|
||||
<div class="col-md-7{{ (\App\Helpers\Helper::checkIfRequired($assetMaintenance, 'asset_maintenance_type')) ? ' required' : '' }}">
|
||||
{{ Form::select('asset_maintenance_type', $assetMaintenanceType , Input::old('asset_maintenance_type', $assetMaintenance->asset_maintenance_type), ['class'=>'select2', 'style'=>'min-width:350px']) }}
|
||||
{!! $errors->first('asset_maintenance_type', '<span class="alert-msg"><i class="fa fa-times"></i> :message</span>') !!}
|
||||
</div>
|
||||
@@ -76,9 +76,9 @@
|
||||
<!-- Title -->
|
||||
<div class="form-group {{ $errors->has('title') ? ' has-error' : '' }}">
|
||||
<label for="title" class="col-md-3 control-label">{{ trans('admin/asset_maintenances/form.title') }}
|
||||
<i class='fa fa-asterisk'></i></label>
|
||||
</label>
|
||||
</label>
|
||||
<div class="col-md-7">
|
||||
<div class="col-md-7{{ (\App\Helpers\Helper::checkIfRequired($assetMaintenance, 'title')) ? ' required' : '' }}">
|
||||
<input class="form-control" type="text" name="title" id="title" value="{{ Input::old('title', $assetMaintenance->title) }}" />
|
||||
{!! $errors->first('title', '<span class="alert-msg"><i class="fa fa-times"></i> :message</span>') !!}
|
||||
</div>
|
||||
@@ -87,8 +87,8 @@
|
||||
<!-- Start Date -->
|
||||
<div class="form-group {{ $errors->has('start_date') ? ' has-error' : '' }}">
|
||||
<label for="start_date" class="col-md-3 control-label">{{ trans('admin/asset_maintenances/form.start_date') }}
|
||||
<i class='fa fa-asterisk'></i></label>
|
||||
<div class="input-group col-md-2">
|
||||
</label>
|
||||
<div class="input-group col-md-2{{ (\App\Helpers\Helper::checkIfRequired($assetMaintenance, 'start_date')) ? ' required' : '' }}">
|
||||
<input type="date" class="datepicker form-control" data-date-format="yyyy-mm-dd" placeholder="Select Date" name="start_date" id="start_date" value="{{ Input::old('start_date', $assetMaintenance->start_date) }}">
|
||||
<span class="input-group-addon"><i class="fa fa-calendar"></i></span>
|
||||
{!! $errors->first('start_date', '<span class="alert-msg"><i class="fa fa-times"></i> :message</span>') !!}
|
||||
|
||||
@@ -0,0 +1,138 @@
|
||||
@extends('layouts/default')
|
||||
|
||||
{{-- Page title --}}
|
||||
@section('title')
|
||||
Import History
|
||||
@parent
|
||||
@stop
|
||||
|
||||
@section('header_right')
|
||||
<a href="{{ route('hardware') }}" class="btn btn-default"> {{ trans('general.back') }}</a>
|
||||
@stop
|
||||
|
||||
{{-- Page content --}}
|
||||
@section('content')
|
||||
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-8 col-md-offset-2">
|
||||
<div class="box box-default">
|
||||
<div class="box-body">
|
||||
<div class="col-md-12">
|
||||
<form class="form-horizontal" role="form" method="post" enctype="multipart/form-data" action="">
|
||||
<!-- CSRF Token -->
|
||||
<input type="hidden" name="_token" value="{{ csrf_token() }}" />
|
||||
|
||||
@if (Session::get('message'))
|
||||
<p class="alert-danger">
|
||||
You have an error in your CSV file:<br />
|
||||
{{ Session::get('message') }}
|
||||
</p>
|
||||
@endif
|
||||
|
||||
<p>
|
||||
Upload a CSV that contains asset history. The assets and users MUST already exist in the system, or they will be skipped. Matching assets for history import happens against the asset tag. We will try to find a matching user based on the user's name you provide, and the criteria you select below. If you do not select any criteria below, it will simply try to match on the username format you configured in the Admin < Settings.
|
||||
</p>
|
||||
|
||||
<p>Fields included in the CSV must match the headers: <strong>Date, Tag, Name</strong>. Any additional fields will be ignored. </p>
|
||||
|
||||
<p><strong>Date</strong> should be the checkout date. <strong>Tag</strong> should be the asset tag. <strong>Name</strong> should be the user's name (firstname lastname).</p>
|
||||
|
||||
<p><strong>History should be ordered by date in ascending order.</strong></p>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="first_name" class="col-sm-3 control-label">{{ trans('admin/users/general.usercsv') }}</label>
|
||||
<div class="col-sm-9">
|
||||
<input type="file" name="user_import_csv" id="user_import_csv">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
<!-- Match firstname.lastname -->
|
||||
<div class="form-group">
|
||||
<div class="col-sm-2">
|
||||
</div>
|
||||
<div class="col-sm-10">
|
||||
{{ Form::checkbox('match_firstnamelastname', '1', Input::old('match_firstnamelastname')) }} Try to match users by firstname.lastname (jane.smith) format
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Match flastname -->
|
||||
<div class="form-group">
|
||||
<div class="col-sm-2">
|
||||
</div>
|
||||
<div class="col-sm-10">
|
||||
{{ Form::checkbox('match_flastname', '1', Input::old('match_flastname')) }} Try to match users by first initial last name (jsmith) format
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Match firstname -->
|
||||
<div class="form-group">
|
||||
<div class="col-sm-2">
|
||||
</div>
|
||||
<div class="col-sm-10">
|
||||
{{ Form::checkbox('match_firstname', '1', Input::old('match_firstname')) }} Try to match users by first name (jane) format
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Match email -->
|
||||
<div class="form-group">
|
||||
<div class="col-sm-2">
|
||||
</div>
|
||||
<div class="col-sm-10">
|
||||
{{ Form::checkbox('match_email', '1', Input::old('match_email')) }} Try to match users by email as username
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<!-- Form Actions -->
|
||||
<div class="box-footer text-right">
|
||||
<button type="submit" class="btn btn-default">{{ trans('button.submit') }}</button>
|
||||
</div>
|
||||
|
||||
</form>
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
@if (isset($status))
|
||||
<table class="table">
|
||||
@foreach($status['error'] as $type => $msg)
|
||||
<tr class="danger"><td>{{ $msg }}</td></tr>
|
||||
@endforeach
|
||||
|
||||
@foreach($status['success'] as $type => $msg)
|
||||
<tr class="success"><td>{{ $msg }}</td></tr>
|
||||
@endforeach
|
||||
</table>
|
||||
@endif
|
||||
|
||||
</div></div></div>
|
||||
<script>
|
||||
$(document).ready(function(){
|
||||
|
||||
$('#generate-password').pGenerator({
|
||||
'bind': 'click',
|
||||
'passwordElement': '#password',
|
||||
'displayElement': '#password-display',
|
||||
'passwordLength': 10,
|
||||
'uppercase': true,
|
||||
'lowercase': true,
|
||||
'numbers': true,
|
||||
'specialChars': false,
|
||||
|
||||
});
|
||||
});
|
||||
|
||||
</script>
|
||||
@stop
|
||||
@@ -298,24 +298,32 @@
|
||||
@if (isset($asset->userloc))
|
||||
<li>{{ $asset->userloc->name }}
|
||||
<li>{{ $asset->userloc->address }}
|
||||
@if (isset($asset->userloc->address2))
|
||||
@if ($asset->userloc->address2!='')
|
||||
{{ $asset->userloc->address2 }}
|
||||
@endif
|
||||
</li>
|
||||
@if (isset($asset->assetloc->city))
|
||||
<li>{{ $asset->assetloc->city }}, {{ $asset->assetloc->state }} {{ $asset->assetloc->zip }}</li>
|
||||
@endif
|
||||
|
||||
<li>{{ $asset->userloc->city }}
|
||||
@if (($asset->userloc->city!='') && ($asset->userloc->state!=''))
|
||||
,
|
||||
@endif
|
||||
{{ $asset->userloc->state }} {{ $asset->userloc->zip }}</li>
|
||||
|
||||
|
||||
@elseif (isset($asset->assetloc))
|
||||
<li>{{ $asset->assetloc->name }}
|
||||
<li>{{ $asset->assetloc->address }}
|
||||
@if (isset($asset->assetloc->address2))
|
||||
@if ($asset->assetloc->address2!='')
|
||||
{{ $asset->assetloc->address2 }}
|
||||
@endif
|
||||
</li>
|
||||
@if (isset($asset->assetloc->city))
|
||||
<li>{{ $asset->assetloc->city }}, {{ $asset->assetloc->state }} {{ $asset->assetloc->zip }}</li>
|
||||
@endif
|
||||
|
||||
<li>{{ $asset->assetloc->city }}
|
||||
@if (($asset->assetloc->city!='') && ($asset->assetloc->state!=''))
|
||||
,
|
||||
@endif
|
||||
{{ $asset->assetloc->state }} {{ $asset->assetloc->zip }}</li>
|
||||
|
||||
|
||||
@endif
|
||||
</ul>
|
||||
@@ -405,6 +413,7 @@
|
||||
<th>{{ trans('admin/asset_maintenances/form.asset_maintenance_type') }}</th>
|
||||
<th>{{ trans('admin/asset_maintenances/form.start_date') }}</th>
|
||||
<th>{{ trans('admin/asset_maintenances/form.completion_date') }}</th>
|
||||
<th>{{ trans('admin/asset_maintenances/form.notes') }}</th>
|
||||
<th>{{ trans('admin/asset_maintenances/table.is_warranty') }}</th>
|
||||
<th>{{ trans('admin/asset_maintenances/form.cost') }}</th>
|
||||
<th>{{ trans('general.admin') }}</th>
|
||||
@@ -422,6 +431,7 @@
|
||||
<td>{{ $assetMaintenance->asset_maintenance_type }}</td>
|
||||
<td>{{ $assetMaintenance->start_date }}</td>
|
||||
<td>{{ $assetMaintenance->completion_date }}</td>
|
||||
<td>{{ $assetMaintenance->notes }}</td>
|
||||
<td>{{ $assetMaintenance->is_warranty ? trans('admin/asset_maintenances/message.warranty') : trans('admin/asset_maintenances/message.not_warranty') }}</td>
|
||||
<td class="text-right"><nobr>{{ $use_currency.$assetMaintenance->cost }}</nobr></td>
|
||||
<td>
|
||||
@@ -440,7 +450,7 @@
|
||||
</tbody>
|
||||
<tfoot>
|
||||
<tr>
|
||||
<td colspan="7" class="text-right">{{ $use_currency.number_format($totalCost, 2) }}</td>
|
||||
<td colspan="8" class="text-right">{{ $use_currency.number_format($totalCost, 2) }}</td>
|
||||
</tr>
|
||||
</tfoot>
|
||||
</table>
|
||||
|
||||
@@ -420,7 +420,6 @@
|
||||
|
||||
<li class="divider"> </li>
|
||||
<li{!! (Request::is('hardware/bulkcheckout') ? ' class="active>"' : '') !!}>
|
||||
<small class="label pull-right bg-orange">{{ trans('general.new') }}</small>
|
||||
<a href="{{ route('hardware/bulkcheckout') }}">
|
||||
{{ trans('general.bulk_checkout') }}</a>
|
||||
</li>
|
||||
@@ -428,7 +427,8 @@
|
||||
<li><a href="{{ URL::to('admin/settings/categories') }}" {!! (Request::is('admin/settings/categories*') ? ' class="active"' : '') !!} >@lang('general.categories')</a></li>
|
||||
<li{!! (Request::query('Deleted') ? ' class="active"' : '') !!}><a href="{{ URL::to('hardware?status=Deleted') }}">@lang('general.deleted')</a></li>
|
||||
<li><a href="{{ URL::to('admin/asset_maintenances') }}" >@lang('general.asset_maintenances') </a></li>
|
||||
<li><a href="{{ URL::to('hardware/import') }}" >@lang('general.import') </a></li>
|
||||
<li><a href="{{ URL::to('hardware/import') }}">@lang('general.import') </a></li>
|
||||
<li><small class="label pull-right bg-orange">{{ trans('general.new') }}</small><a href="{{ URL::to('hardware/history') }}">@lang('general.import-history') </a></li>
|
||||
</ul>
|
||||
</li>
|
||||
@endcan
|
||||
|
||||
@@ -43,7 +43,7 @@
|
||||
<div class="form-group {{ $errors->has('name') ? ' has-error' : '' }}">
|
||||
<label for="name" class="col-md-3 control-label">{{ trans('admin/locations/table.name') }}
|
||||
</label>
|
||||
<div class="col-md-8 required">
|
||||
<div class="col-md-8{{ (\App\Helpers\Helper::checkIfRequired($location, 'name')) ? ' required' : '' }}">
|
||||
<input class="form-control" type="text" name="name" id="name" value="{{ Input::old('name', $location->name) }}" />
|
||||
{!! $errors->first('name', '<span class="alert-msg"><i class="fa fa-times"></i> :message</span>') !!}
|
||||
</div>
|
||||
@@ -55,7 +55,7 @@
|
||||
<label for="parent_id" class="col-md-3 control-label">
|
||||
{{ trans('admin/locations/table.parent') }}
|
||||
</label>
|
||||
<div class="col-md-9">
|
||||
<div class="col-md-9{{ (\App\Helpers\Helper::checkIfRequired($location, 'parent_id')) ? ' required' : '' }}">
|
||||
{!! Form::select('parent_id', $location_options , Input::old('parent_id', $location->parent_id), array('class'=>'select2 parent', 'style'=>'width:350px')) !!}
|
||||
{!! $errors->first('parent_id', '<span class="alert-msg"><i class="fa fa-times"></i> :message</span>') !!}
|
||||
</div>
|
||||
@@ -66,7 +66,7 @@
|
||||
<label for="currency" class="col-md-3 control-label">
|
||||
{{ trans('admin/locations/table.currency') }}
|
||||
</label>
|
||||
<div class="col-md-9">
|
||||
<div class="col-md-9{{ (\App\Helpers\Helper::checkIfRequired($location, 'currency')) ? ' required' : '' }}">
|
||||
{{ Form::text('currency', Input::old('currency', $location->currency), array('class' => 'form-control','placeholder' => 'USD', 'maxlength'=>'3', 'style'=>'width: 60px;')) }}
|
||||
{!! $errors->first('currency', '<span class="alert-msg">:message</span>') !!}
|
||||
</div>
|
||||
@@ -77,7 +77,7 @@
|
||||
<label for="address" class="col-md-3 control-label">
|
||||
{{ trans('admin/locations/table.address') }}
|
||||
</label>
|
||||
<div class="col-md-9">
|
||||
<div class="col-md-9{{ (\App\Helpers\Helper::checkIfRequired($location, 'address')) ? ' required' : '' }}">
|
||||
<input class="form-control" type="text" name="address" id="address" value="{{ Input::old('address', $location->address) }}" />
|
||||
{!! $errors->first('address', '<span class="alert-msg"><i class="fa fa-times"></i> :message</span>') !!}
|
||||
</div>
|
||||
@@ -94,10 +94,9 @@
|
||||
|
||||
<!-- City -->
|
||||
<div class="form-group {{ $errors->has('city') ? ' has-error' : '' }}">
|
||||
<label for="city" class="col-md-3 control-label">{{ trans('admin/locations/table.city') }}
|
||||
<i class='fa fa-asterisk'></i></label>
|
||||
<label for="city" class="col-md-3 control-label">{{ trans('admin/locations/table.city') }}</label>
|
||||
</label>
|
||||
<div class="col-md-9">
|
||||
<div class="col-md-9{{ (\App\Helpers\Helper::checkIfRequired($location, 'city')) ? ' required' : '' }}">
|
||||
<input class="form-control" type="text" name="city" id="city" value="{{ Input::old('city', $location->city) }}" />
|
||||
{!! $errors->first('city', '<span class="alert-msg"><i class="fa fa-times"></i> :message</span>') !!}
|
||||
</div>
|
||||
@@ -115,7 +114,7 @@
|
||||
<!-- Zip -->
|
||||
<div class="form-group {{ $errors->has('zip') ? ' has-error' : '' }}">
|
||||
<label for="zip" class="col-md-3 control-label">{{ trans('admin/locations/table.zip') }}</label>
|
||||
<div class="col-md-9">
|
||||
<div class="col-md-9{{ (\App\Helpers\Helper::checkIfRequired($location, 'zip')) ? ' required' : '' }}">
|
||||
<input class="form-control" type="text" name="zip" id="zip" value="{{ Input::old('zip', $location->zip) }}" />
|
||||
{!! $errors->first('zip', '<span class="alert-msg"><i class="fa fa-times"></i> :message</span>') !!}
|
||||
</div>
|
||||
@@ -123,10 +122,9 @@
|
||||
|
||||
<!-- Country -->
|
||||
<div class="form-group {{ $errors->has('country') ? ' has-error' : '' }}">
|
||||
<label for="country" class="col-md-3 control-label">{{ trans('admin/locations/table.country') }}
|
||||
<i class='fa fa-asterisk'></i></label>
|
||||
<label for="country" class="col-md-3 control-label">{{ trans('admin/locations/table.country') }}</label>
|
||||
</label>
|
||||
<div class="col-md-9">
|
||||
<div class="col-md-9{{ (\App\Helpers\Helper::checkIfRequired($location, 'country')) ? ' required' : '' }}">
|
||||
{!! Form::countries('country', Input::old('country', $location->country), 'select2 country') !!}
|
||||
{!! $errors->first('country', '<span class="alert-msg"><i class="fa fa-times"></i> :message</span>') !!}
|
||||
</div>
|
||||
|
||||
@@ -705,6 +705,21 @@
|
||||
</div>
|
||||
<!-- /.form-group -->
|
||||
|
||||
<!-- LDAP Password Sync -->
|
||||
<div class="form-group">
|
||||
<div class="col-md-3">
|
||||
{{ Form::label('is_ad', trans('admin/settings/general.ldap_pw_sync')) }}
|
||||
</div>
|
||||
<div class="col-md-9">
|
||||
{{ Form::checkbox('ldap_pw_sync', '1', Input::old('ldap_pw_sync', $setting->ldap_pw_sync),array('class' => 'minimal')) }}
|
||||
{{ trans('general.yes') }}
|
||||
<p class="help-block">{{ trans('admin/settings/general.ldap_pw_sync_help') }}</p>
|
||||
{!! $errors->first('ldap_pw_sync', '<span class="alert-msg">:message</span>') !!}
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.form-group -->
|
||||
|
||||
<!-- AD Domain -->
|
||||
<div class="form-group {{ $errors->has('ad_domain') ? 'error' : '' }}">
|
||||
<div class="col-md-3">
|
||||
|
||||
@@ -0,0 +1,46 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<meta name="robots" content="noindex,nofollow">
|
||||
<link href='http://fonts.googleapis.com/css?family=Open+Sans' rel='stylesheet' type='text/css'>
|
||||
<title>{{ Lang::get(Config::get('maintenancemode.language-path', 'maintenancemode::defaults.') . '.title') }}</title>
|
||||
<style>
|
||||
html, body {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
background-color: #333;
|
||||
-webkit-transform-style: preserve-3d;
|
||||
-moz-transform-style: preserve-3d;
|
||||
transform-style: preserve-3d;
|
||||
font-family: 'Open Sans', sans-serif;
|
||||
}
|
||||
header {
|
||||
width: 80%;
|
||||
color: #fff;
|
||||
position: relative;
|
||||
top: 50%;
|
||||
transform: translateY(-50%);
|
||||
text-align: center;
|
||||
margin: 0 auto;
|
||||
}
|
||||
header h1, header p {
|
||||
margin: 0;
|
||||
padding: .25em 0;
|
||||
}
|
||||
header p {
|
||||
color: #999;
|
||||
font-size: .8em;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<header>
|
||||
<h1>{{ ${Config::get('maintenancemode.inject.prefix').'Message'} }}</h1>
|
||||
<p>{{ Lang::get(Config::get('maintenancemode.language-path', 'maintenancemode::defaults.') . '.last-updated', ['timestamp' => ${Config::get('maintenancemode.inject.prefix').'Timestamp'}->diffForHumans()]) }}</p>
|
||||
</header>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,51 @@
|
||||
{{--
|
||||
This is a simple notification bar to users who are exempt from the maintenance page, telling them that a
|
||||
maintenance period is going on. You should place this within your main template(s) via a call to:
|
||||
|
||||
@include('maintenancemode::notification')
|
||||
--}}
|
||||
|
||||
@if(isset(${Config::get('maintenancemode.inject.prefix').'Enabled'}) &&
|
||||
${Config::get('maintenancemode.inject.prefix').'Enabled'} == true)
|
||||
|
||||
@if(Config::get('maintenancemode.notification-styles', true))
|
||||
<style>
|
||||
.maintenance-mode-alert {
|
||||
width: 100%;
|
||||
padding: .5em;
|
||||
background-color: #FF130F;
|
||||
color: #fff;
|
||||
}
|
||||
.maintenance-mode-alert strong {
|
||||
font-weight: bold;
|
||||
}
|
||||
.maintenance-mode-alert time {
|
||||
opacity: 0.7;
|
||||
font-size: .8em;
|
||||
padding-top: .1em;
|
||||
float: right;
|
||||
}
|
||||
</style>
|
||||
@endif
|
||||
|
||||
<div class="maintenance-mode-alert" id="maintenance-mode-alert" role="alert">
|
||||
|
||||
<strong>Maintenance Mode</strong>
|
||||
|
||||
{{-- Show the truncated message (so it doesn't overflow) --}}
|
||||
@if(isset(${Config::get('maintenancemode.inject.prefix').'Message'}))
|
||||
{{ str_limit(${Config::get('maintenancemode.inject.prefix').'Message'}, 100, "…") }}
|
||||
@endif
|
||||
|
||||
{{-- And show a human-friendly timestamp --}}
|
||||
@if(isset(${Config::get('maintenancemode.inject.prefix').'Timestamp'}) &&
|
||||
${Config::get('maintenancemode.inject.prefix').'Timestamp'} instanceof DateTime)
|
||||
|
||||
<time datetime="{{ ${Config::get('maintenancemode.inject.prefix').'Timestamp'} }}" title="{{ ${Config::get('maintenancemode.inject.prefix').'Timestamp'} }}">
|
||||
{{ ${Config::get('maintenancemode.inject.prefix').'Timestamp'}->diffForHumans() }}
|
||||
</time>
|
||||
|
||||
@endif
|
||||
</div>
|
||||
|
||||
@endif
|
||||
+4
-4
@@ -161,7 +161,7 @@ case $distro in
|
||||
# Get files and extract to web dir
|
||||
echo ""
|
||||
echo "## Downloading snipeit and extract to web directory."
|
||||
wget -P $tmp/ https://github.com/snipe/snipe-it/archive/$file >> /var/log/snipeit-install.log 2>&1
|
||||
wget -P $tmp/ https://github.com/snipe/snipe-it/archive/$file
|
||||
unzip -qo $tmp/$file -d $tmp/
|
||||
cp -R $tmp/$fileName $webdir/$name
|
||||
|
||||
@@ -170,8 +170,8 @@ case $distro in
|
||||
#Enable mcrypt and rewrite
|
||||
echo "## Enabling mcrypt and rewrite"
|
||||
|
||||
sudo php5enmod mcrypt >> /var/log/snipeit-install.log 2>&1
|
||||
sudo a2enmod rewrite >> /var/log/snipeit-install.log 2>&1
|
||||
sudo php5enmod mcrypt
|
||||
sudo a2enmod rewrite
|
||||
|
||||
#Create a new virtual host for Apache.
|
||||
echo "## Create Virtual host for apache."
|
||||
@@ -204,7 +204,7 @@ case $distro in
|
||||
|
||||
echo "## Setting up hosts file."
|
||||
echo >> $hosts "127.0.0.1 $hostname $fqdn"
|
||||
a2ensite $name.conf >> /var/log/snipeit-install.log 2>&1
|
||||
a2ensite $name.conf
|
||||
|
||||
#Modify the Snipe-It files necessary for a production environment.
|
||||
echo "## Modify the Snipe-It files necessary for a production environment."
|
||||
|
||||
Reference in New Issue
Block a user