Compare commits

...

40 Commits

Author SHA1 Message Date
snipe a5b2dbfaf0 Merge remote-tracking branch 'origin/develop' 2015-07-23 12:33:26 -07:00
snipe e455b2af6e Only update email if password locking isn't set to true 2015-07-23 12:30:44 -07:00
snipe d26c40b26e Fixed issue where email not saved on edit 2015-07-23 12:28:26 -07:00
snipe abb970fe39 Merge remote-tracking branch 'origin/develop' 2015-07-17 16:25:55 -07:00
snipe f8ecbed829 Added purchase date to importer 2015-07-17 16:25:20 -07:00
snipe 9ac093e0be Merge remote-tracking branch 'origin/develop' 2015-07-17 14:18:20 -07:00
snipe 38c9d8d6ca Added notes/order number to asset view 2015-07-17 14:18:08 -07:00
snipe 4557502b1d Added notes/order number to controller 2015-07-17 14:15:08 -07:00
snipe b85d972488 Added mod rewrite to force SSL 2015-07-16 20:32:10 -07:00
snipe 61e16a4668 Merge remote-tracking branch 'origin/develop' 2015-07-16 16:25:15 -07:00
snipe e447159d4a Added checks for missing fields, added email column, asset notes 2015-07-16 16:23:35 -07:00
snipe b191406a0c Ignore couscous 2015-07-16 14:58:22 -07:00
snipe dacbdd9aa5 Delete book.json 2015-07-10 19:46:17 -07:00
snipe e1eb2da5f3 Create book.json 2015-07-09 13:32:26 -07:00
snipe f5d4eb5842 Merge pull request #897 from madd15/patch-2
Fix #896 - Only show Checkout/Checkin if deployable
2015-07-09 01:19:57 -07:00
snipe 9936cf4a43 Better production default for #903 2015-07-09 00:53:58 -07:00
snipe e9443a244c Small fix to config value 2015-07-09 00:52:05 -07:00
snipe f8be47dfbf Fixes #903 - adds config variable for multi_login, overrides Sentry method 2015-07-09 00:41:46 -07:00
snipe c2d63915c3 Fixed insecure font call 2015-07-08 17:48:59 -07:00
snipe fd59ca0802 Fixed spacing 2015-07-08 17:33:51 -07:00
snipe de23ec5785 Fixes #544 - disable checking an asset out to a user if it is not a deployable status 2015-07-08 17:18:46 -07:00
snipe 05f0b94bf6 Fixed language string 2015-07-08 13:05:17 -07:00
snipe f54c86db87 Command line asset importer 2015-07-08 13:05:05 -07:00
madd15 a22687abc5 Fix #896 - Only show Checkout/Checkin if deployable 2015-07-07 14:38:28 +09:30
snipe 82892a38b8 Merge pull request #891 from madd15/patch-3
Fix #873 - Remove serial, assigned_to & macaddress when cloning asset
2015-07-06 16:50:58 -07:00
madd15 61836f20c5 Clear Mac Address on Clone 2015-07-07 08:23:51 +09:30
madd15 62d382d704 Remove serial and assigned_to when cloning asset 2015-07-07 08:19:58 +09:30
snipe 3746bc333b Better checking for model name and category name 2015-07-06 14:12:49 -07:00
snipe ccde517c88 Use showAssetName to get asset name 2015-07-06 14:10:24 -07:00
snipe f855bfd4ef Better error checking for eol data 2015-07-06 14:09:48 -07:00
snipe 1601bdd4eb Added rtd_location_id back into selected columns 2015-07-02 16:52:08 -07:00
snipe 552bdfdc2d Switched defaultLoc to belongsTo relationship 2015-07-02 16:51:52 -07:00
snipe 1d4cfcfd58 Only save uploaded logo if not in demo mode 2015-06-30 22:38:40 -07:00
snipe 6915987239 Added demo language string 2015-06-30 22:38:19 -07:00
snipe 3a44a7e8bb Disable logo upload for demo 2015-06-30 22:38:12 -07:00
snipe f2abbd0e8f Deny editing users on demo 2015-06-30 22:10:23 -07:00
snipe 62f8d002e3 Temp commented out some stuff 2015-06-30 22:05:21 -07:00
snipe 0766ae2d17 Disallow group edit for demo 2015-06-30 22:04:48 -07:00
snipe 95920be8ea Fixed weird commenting 2015-06-30 22:04:05 -07:00
snipe 588ff742fe Add manufacturer to models listing for clarity 2015-06-30 19:15:43 -07:00
25 changed files with 1077 additions and 152 deletions
+2
View File
@@ -22,3 +22,5 @@ public/uploads/logo.gif
public/uploads/logo.png
.siteflow
public/assets/.siteflow
app/config/local/session.php
.couscous
+364
View File
@@ -0,0 +1,364 @@
<?php
use Illuminate\Console\Command;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Input\InputArgument;
use League\Csv\Reader;
class ImportCommand extends Command {
/**
* The console command name.
*
* @var string
*/
protected $name = 'import:csv';
/**
* The console command description.
*
* @var string
*/
protected $description = 'Import from CSV';
/**
* Create a new command instance.
*
* @return void
*/
public function __construct()
{
parent::__construct();
}
/**
* Execute the console command.
*
* @return mixed
*/
public function fire()
{
$filename = $this->argument('filename');
if (!$this->option('testrun')=='true') {
$this->comment('======= Importing '.$filename.' =========');
} else {
$this->comment('====== TEST ONLY Import for '.$filename.' ====');
$this->comment('============== NO DATA WILL BE WRITTEN ==============');
}
if (! ini_get("auto_detect_line_endings")) {
ini_set("auto_detect_line_endings", '1');
}
$csv = Reader::createFromPath($this->argument('filename'));
$csv->setNewline("\r\n");
$csv->setOffset(1);
$duplicates = '';
// Loop through the records
$nbInsert = $csv->each(function ($row) use ($duplicates) {
$status_id = 1;
// Let's just map some of these entries to more user friendly words
if (array_key_exists('0',$row)) {
$user_name = $row[0];
} else {
$user_name = '';
}
if (array_key_exists('1',$row)) {
$user_email = $row[1];
} else {
$user_email = '';
}
if (array_key_exists('2',$row)) {
$user_asset_category = $row[2];
} else {
$user_asset_category = '';
}
if (array_key_exists('3',$row)) {
$user_asset_name = $row[3];
} else {
$user_asset_name = '';
}
if (array_key_exists('4',$row)) {
$user_asset_mfgr = $row[4];
} else {
$user_asset_mfgr = '';
}
if (array_key_exists('5',$row)) {
$user_asset_modelno = $row[5];
} else {
$user_asset_modelno = '';
}
if (array_key_exists('6',$row)) {
$user_asset_serial = $row[6];
} else {
$user_asset_serial = '';
}
if (array_key_exists('7',$row)) {
$user_asset_tag = $row[7];
} else {
$user_asset_tag = '';
}
if (array_key_exists('8',$row)) {
$user_asset_location = $row[8];
} else {
$user_asset_location = '';
}
if (array_key_exists('9',$row)) {
$user_asset_notes = $row[9];
} else {
$user_asset_notes = '';
}
if (array_key_exists('9',$row)) {
$user_asset_purchase_date = date("Y-m-d 00:00:01", strtotime($row[10]));
} else {
$user_asset_purchase_date = '';
}
// A number was given instead of a name
if (is_numeric($user_name)) {
$this->comment('User '.$user_name.' is not a name - assume this user already exists');
// No name was given
} elseif ($user_name=='') {
$this->comment('No user data provided - skipping user creation, just adding asset');
$first_name = '';
$last_name = '';
} else {
$name = explode(" ", $user_name);
$first_name = $name[0];
$email_last_name = '';
if (!array_key_exists(1, $name)) {
$last_name='';
$email_last_name = $last_name;
$email_prefix = $first_name;
} else {
$last_name = str_replace($first_name,'',$user_name);
if ($this->option('email_format')=='filastname') {
$email_last_name.=str_replace(' ','',$last_name);
$email_prefix = $first_name[0].$email_last_name;
} elseif ($this->option('email_format')=='firstname.lastname') {
$email_last_name.=str_replace(' ','',$last_name);
$email_prefix = $first_name.'.'.$email_last_name;
} elseif ($this->option('email_format')=='firstname') {
$email_last_name.=str_replace(' ','',$last_name);
$email_prefix = $first_name;
}
}
// Generate an email based on their name if no email address is given
if ($user_email=='') {
if ($first_name=='Unknown') {
$status_id = 7;
}
$email = strtolower($email_prefix).'@'.$this->option('domain');
$user_email = str_replace("'",'',$email);
}
}
$this->comment('Full Name: '.$user_name);
$this->comment('First Name: '.$first_name);
$this->comment('Last Name: '.$last_name);
$this->comment('Email: '.$user_email);
$this->comment('Category Name: '.$user_asset_category);
$this->comment('Item: '.$user_asset_name);
$this->comment('Manufacturer ID: '.$user_asset_mfgr);
$this->comment('Model No: '.$user_asset_modelno);
$this->comment('Serial No: '.$user_asset_serial);
$this->comment('Asset Tag: '.$user_asset_tag);
$this->comment('Location: '.$user_asset_location);
$this->comment('Purchase Date: '.$user_asset_purchase_date);
$this->comment('Notes: '.$user_asset_notes);
$this->comment('------------- Action Summary ----------------');
if ($user_email!='') {
if ($user = User::where('email', $user_email)->first()) {
$this->comment('User '.$user_email.' already exists');
} else {
// Create the user
$user = Sentry::createUser(array(
'first_name' => $first_name,
'last_name' => $last_name,
'email' => $user_email,
'password' => substr(str_shuffle("0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"), 0, 10),
'activated' => true,
'permissions' => array(
'admin' => 0,
'user' => 1,
),
'notes' => 'Imported user'
));
// Find the group using the group id
$userGroup = Sentry::findGroupById(3);
// Assign the group to the user
$user->addGroup($userGroup);
$this->comment('User '.$first_name.' created');
}
} else {
$user = new User;
}
// Check for the location match and create it if it doesn't exist
if ($location = Location::where('name', $user_asset_location)->first()) {
$this->comment('Location '.$user_asset_location.' already exists');
} else {
$location = new Location();
$location->name = e($user_asset_location);
$location->address = '';
$location->city = '';
$location->state = '';
$location->country = '';
$location->user_id = 1;
if (!$this->option('testrun')=='true') {
if ($location->save()) {
$this->comment('Location '.$user_asset_location.' was created');
} else {
$this->comment('Something went wrong! Location '.$user_asset_location.' was NOT created');
}
} else {
$this->comment('Location '.$user_asset_location.' was (not) created - test run only');
}
}
// Check for the category match and create it if it doesn't exist
if ($category = Category::where('name', $user_asset_category)->where('category_type', 'asset')->first()) {
$this->comment('Category '.$user_asset_category.' already exists');
} else {
$category = new Category();
$category->name = e($user_asset_category);
$category->category_type = 'asset';
$category->user_id = 1;
if ($category->save()) {
$this->comment('Category '.$user_asset_category.' was created');
} else {
$this->comment('Something went wrong! Category '.$user_asset_category.' was NOT created');
}
}
// Check for the manufacturer match and create it if it doesn't exist
if ($manufacturer = Manufacturer::where('name', $user_asset_mfgr)->first()) {
$this->comment('Manufacturer '.$user_asset_mfgr.' already exists');
} else {
$manufacturer = new Manufacturer();
$manufacturer->name = e($user_asset_mfgr);
$manufacturer->user_id = 1;
if ($manufacturer->save()) {
$this->comment('Manufacturer '.$user_asset_mfgr.' was created');
} else {
$this->comment('Something went wrong! Manufacturer '.$user_asset_mfgr.' was NOT created');
}
}
// Check for the asset model match and create it if it doesn't exist
if ($asset_model = Model::where('name', $user_asset_name)->where('modelno', $user_asset_modelno)->where('category_id', $category->id)->where('manufacturer_id', $manufacturer->id)->first()) {
$this->comment('The Asset Model '.$user_asset_name.' with model number '.$user_asset_modelno.' already exists');
} else {
$asset_model = new Model();
$asset_model->name = e($user_asset_name);
$asset_model->manufacturer_id = $manufacturer->id;
$asset_model->modelno = e($user_asset_modelno);
$asset_model->category_id = $category->id;
$asset_model->user_id = 1;
if ($asset_model->save()) {
$this->comment('Asset Model '.$user_asset_name.' with model number '.$user_asset_modelno.' was created');
} else {
$this->comment('Something went wrong! Asset Model '.$user_asset_name.' was NOT created');
}
}
// Check for the asset match and create it if it doesn't exist
$asset = new Asset();
$asset->name = e($user_asset_name);
$asset->serial = e($user_asset_serial);
$asset->asset_tag = e($user_asset_tag);
$asset->model_id = $asset_model->id;
$asset->assigned_to = $user->id;
$asset->rtd_location_id = $location->id;
$asset->user_id = 1;
$asset->status_id = $status_id;
$asset->purchase_date = $user_asset_purchase_date;
$asset->notes = e($user_asset_notes);
if ($asset->save()) {
$this->comment('Asset '.$user_asset_name.' with serial number '.$user_asset_serial.' was created');
} else {
$this->comment('Something went wrong! Asset '.$user_asset_name.' was NOT created');
}
$this->comment('=====================================');
return true;
});
}
/**
* Get the console command arguments.
*
* @return array
*/
protected function getArguments()
{
return array(
array('filename', InputArgument::REQUIRED, 'File for the CSV import.'),
);
}
/**
* Get the console command options.
*
* @return array
*/
protected function getOptions()
{
return array(
array('domain', null, InputOption::VALUE_REQUIRED, 'Email domain for generated email addresses.', null),
array('email_format', null, InputOption::VALUE_REQUIRED, 'The format of the email addresses that should be generated. Options are firstname.lastname, firstname, filastname', null),
array('testrun', null, InputOption::VALUE_REQUIRED, 'Test the output without writing to the database or not.', null),
);
}
}
+140
View File
@@ -0,0 +1,140 @@
<?php
return array(
/*
|--------------------------------------------------------------------------
| Default Session Driver
|--------------------------------------------------------------------------
|
| This option controls the default session "driver" that will be used on
| requests. By default, we will use the lightweight native driver but
| you may specify any of the other wonderful drivers provided here.
|
| Supported: "file", "cookie", "database", "apc",
| "memcached", "redis", "array"
|
*/
'driver' => 'file',
/*
|--------------------------------------------------------------------------
| Session Lifetime
|--------------------------------------------------------------------------
|
| Here you may specify the number of minutes that you wish the session
| to be allowed to remain idle before it expires. If you want them
| to immediately expire on the browser closing, set that option.
|
*/
'lifetime' => 12000,
'expire_on_close' => false,
/*
|--------------------------------------------------------------------------
| Session File Location
|--------------------------------------------------------------------------
|
| When using the native session driver, we need a location where session
| files may be stored. A default has been set for you but a different
| location may be specified. This is only needed for file sessions.
|
*/
'files' => storage_path().'/sessions',
/*
|--------------------------------------------------------------------------
| Session Database Connection
|--------------------------------------------------------------------------
|
| When using the "database" or "redis" session drivers, you may specify a
| connection that should be used to manage these sessions. This should
| correspond to a connection in your database configuration options.
|
*/
'connection' => null,
/*
|--------------------------------------------------------------------------
| Session Database Table
|--------------------------------------------------------------------------
|
| When using the "database" session driver, you may specify the table we
| should use to manage the sessions. Of course, a sensible default is
| provided for you; however, you are free to change this as needed.
|
*/
'table' => 'sessions',
/*
|--------------------------------------------------------------------------
| Session Sweeping Lottery
|--------------------------------------------------------------------------
|
| Some session drivers must manually sweep their storage location to get
| rid of old sessions from storage. Here are the chances that it will
| happen on a given request. By default, the odds are 2 out of 100.
|
*/
'lottery' => array(2, 100),
/*
|--------------------------------------------------------------------------
| Session Cookie Name
|--------------------------------------------------------------------------
|
| Here you may change the name of the cookie used to identify a session
| instance by ID. The name specified here will get used every time a
| new session cookie is created by the framework for every driver.
|
*/
'cookie' => 'snipeit_session',
/*
|--------------------------------------------------------------------------
| Session Cookie Path
|--------------------------------------------------------------------------
|
| The session cookie path determines the path for which the cookie will
| be regarded as available. Typically, this will be the root path of
| your application but you are free to change this when necessary.
|
*/
'path' => '/',
/*
|--------------------------------------------------------------------------
| Session Cookie Domain
|--------------------------------------------------------------------------
|
| Here you may change the domain of the cookie used to identify a session
| in your application. This will determine which domains the cookie is
| available to in your application. A sensible default has been set.
|
*/
'domain' => null,
/*
|--------------------------------------------------------------------------
| HTTPS Only Cookies
|--------------------------------------------------------------------------
|
| By setting this option to true, session cookies will only be sent back
| to the server if the browser has a HTTPS connection. This will keep
| the cookie from being sent to you if it can not be done securely.
|
*/
'secure' => false,
);
+154
View File
@@ -0,0 +1,154 @@
<?php
return array(
/*
|--------------------------------------------------------------------------
| Default Session Driver
|--------------------------------------------------------------------------
|
| This option controls the default session "driver" that will be used on
| requests. By default, we will use the lightweight native driver but
| you may specify any of the other wonderful drivers provided here.
|
| Supported: "file", "cookie", "database", "apc",
| "memcached", "redis", "array"
|
*/
'driver' => 'file',
/*
|--------------------------------------------------------------------------
| Session Lifetime
|--------------------------------------------------------------------------
|
| Here you may specify the number of minutes that you wish the session
| to be allowed to remain idle before it expires. If you want them
| to immediately expire on the browser closing, set that option.
|
*/
'lifetime' => 12000,
'expire_on_close' => false,
/*
|--------------------------------------------------------------------------
| Session File Location
|--------------------------------------------------------------------------
|
| When using the native session driver, we need a location where session
| files may be stored. A default has been set for you but a different
| location may be specified. This is only needed for file sessions.
|
*/
'files' => storage_path().'/sessions',
/*
|--------------------------------------------------------------------------
| Session Database Connection
|--------------------------------------------------------------------------
|
| When using the "database" or "redis" session drivers, you may specify a
| connection that should be used to manage these sessions. This should
| correspond to a connection in your database configuration options.
|
*/
'connection' => null,
/*
|--------------------------------------------------------------------------
| Session Database Table
|--------------------------------------------------------------------------
|
| When using the "database" session driver, you may specify the table we
| should use to manage the sessions. Of course, a sensible default is
| provided for you; however, you are free to change this as needed.
|
*/
'table' => 'sessions',
/*
|--------------------------------------------------------------------------
| Session Sweeping Lottery
|--------------------------------------------------------------------------
|
| Some session drivers must manually sweep their storage location to get
| rid of old sessions from storage. Here are the chances that it will
| happen on a given request. By default, the odds are 2 out of 100.
|
*/
'lottery' => array(2, 100),
/*
|--------------------------------------------------------------------------
| Session Cookie Name
|--------------------------------------------------------------------------
|
| Here you may change the name of the cookie used to identify a session
| instance by ID. The name specified here will get used every time a
| new session cookie is created by the framework for every driver.
|
*/
'cookie' => 'snipeit_session',
/*
|--------------------------------------------------------------------------
| Session Cookie Path
|--------------------------------------------------------------------------
|
| The session cookie path determines the path for which the cookie will
| be regarded as available. Typically, this will be the root path of
| your application but you are free to change this when necessary.
|
*/
'path' => '/',
/*
|--------------------------------------------------------------------------
| Session Cookie Domain
|--------------------------------------------------------------------------
|
| Here you may change the domain of the cookie used to identify a session
| in your application. This will determine which domains the cookie is
| available to in your application. A sensible default has been set.
|
*/
'domain' => null,
/*
|--------------------------------------------------------------------------
| HTTPS Only Cookies
|--------------------------------------------------------------------------
|
| By setting this option to true, session cookies will only be sent back
| to the server if the browser has a HTTPS connection. This will keep
| the cookie from being sent to you if it can not be done securely.
|
*/
'secure' => false,
/*
|--------------------------------------------------------------------------
| Allow multiple logins from different devices at the same time
|--------------------------------------------------------------------------
|
| By default, if a user logs into an account where someone is already
| logged in, the previous user will be logged out. We recommend leaving
| this set to false for security reasons.
|
*/
'multi_login' => false,
);
+154
View File
@@ -0,0 +1,154 @@
<?php
return array(
/*
|--------------------------------------------------------------------------
| Default Session Driver
|--------------------------------------------------------------------------
|
| This option controls the default session "driver" that will be used on
| requests. By default, we will use the lightweight native driver but
| you may specify any of the other wonderful drivers provided here.
|
| Supported: "file", "cookie", "database", "apc",
| "memcached", "redis", "array"
|
*/
'driver' => 'file',
/*
|--------------------------------------------------------------------------
| Session Lifetime
|--------------------------------------------------------------------------
|
| Here you may specify the number of minutes that you wish the session
| to be allowed to remain idle before it expires. If you want them
| to immediately expire on the browser closing, set that option.
|
*/
'lifetime' => 12000,
'expire_on_close' => false,
/*
|--------------------------------------------------------------------------
| Session File Location
|--------------------------------------------------------------------------
|
| When using the native session driver, we need a location where session
| files may be stored. A default has been set for you but a different
| location may be specified. This is only needed for file sessions.
|
*/
'files' => storage_path().'/sessions',
/*
|--------------------------------------------------------------------------
| Session Database Connection
|--------------------------------------------------------------------------
|
| When using the "database" or "redis" session drivers, you may specify a
| connection that should be used to manage these sessions. This should
| correspond to a connection in your database configuration options.
|
*/
'connection' => null,
/*
|--------------------------------------------------------------------------
| Session Database Table
|--------------------------------------------------------------------------
|
| When using the "database" session driver, you may specify the table we
| should use to manage the sessions. Of course, a sensible default is
| provided for you; however, you are free to change this as needed.
|
*/
'table' => 'sessions',
/*
|--------------------------------------------------------------------------
| Session Sweeping Lottery
|--------------------------------------------------------------------------
|
| Some session drivers must manually sweep their storage location to get
| rid of old sessions from storage. Here are the chances that it will
| happen on a given request. By default, the odds are 2 out of 100.
|
*/
'lottery' => array(2, 100),
/*
|--------------------------------------------------------------------------
| Session Cookie Name
|--------------------------------------------------------------------------
|
| Here you may change the name of the cookie used to identify a session
| instance by ID. The name specified here will get used every time a
| new session cookie is created by the framework for every driver.
|
*/
'cookie' => 'snipeit_session',
/*
|--------------------------------------------------------------------------
| Session Cookie Path
|--------------------------------------------------------------------------
|
| The session cookie path determines the path for which the cookie will
| be regarded as available. Typically, this will be the root path of
| your application but you are free to change this when necessary.
|
*/
'path' => '/',
/*
|--------------------------------------------------------------------------
| Session Cookie Domain
|--------------------------------------------------------------------------
|
| Here you may change the domain of the cookie used to identify a session
| in your application. This will determine which domains the cookie is
| available to in your application. A sensible default has been set.
|
*/
'domain' => null,
/*
|--------------------------------------------------------------------------
| HTTPS Only Cookies
|--------------------------------------------------------------------------
|
| By setting this option to true, session cookies will only be sent back
| to the server if the browser has a HTTPS connection. This will keep
| the cookie from being sent to you if it can not be done securely.
|
*/
'secure' => true,
/*
|--------------------------------------------------------------------------
| Allow multiple logins from different devices at the same time
|--------------------------------------------------------------------------
|
| By default, if a user logs into an account where someone is already
| logged in, the previous user will be logged out. We recommend leaving
| this set to false for security reasons.
|
*/
'multi_login' => true,
);
+2 -2
View File
@@ -1,5 +1,5 @@
<?php
return array (
'app_version' => 'v1.2.7-master',
'hash_version' => 'v1.2.7-master',
'app_version' => 'v1.2.8-26',
'hash_version' => 'v1.2.8-26-gf5d4eb5',
);
+42 -16
View File
@@ -54,9 +54,14 @@ class AssetsController extends AdminController
public function getCreate($model_id = null)
{
/*
// Grab the dropdown list of models
//$model_list = array('' => 'Select a Model') + Model::orderBy('name', 'asc')->lists('name'.' '. 'modelno', 'id');
$model_list = Model::select(DB::raw('concat(manufacturers.name," ",name) as name, id'))->orderBy('name', 'asc')->with('manufacturer')->lists('name', 'id');
//$model_list = array('' => Lang::get('general.select_model'));
*/
$model_list = array('' => Lang::get('general.select_model')) + DB::table('models')
->select(DB::raw('concat(name," / ",modelno) as name, id'))->orderBy('name', 'asc')
->orderBy('modelno', 'asc')
@@ -70,7 +75,7 @@ class AssetsController extends AdminController
// Grab the dropdown list of status
$statuslabel_list = Statuslabel::orderBy('name', 'asc')->lists('name', 'id');
$statuslabel_list = array('' => Lang::get('general.select_statuslabel')) + Statuslabel::orderBy('name', 'asc')->lists('name', 'id');
$view = View::make('backend/hardware/edit');
$view->with('supplier_list',$supplier_list);
@@ -703,6 +708,9 @@ class AssetsController extends AdminController
$asset = clone $asset_to_clone;
$asset->id = null;
$asset->asset_tag = '';
$asset->serial = '';
$asset->assigned_to = '';
$asset->mac_address = '';
return View::make('backend/hardware/edit')->with('supplier_list',$supplier_list)->with('model_list',$model_list)->with('statuslabel_list',$statuslabel_list)->with('assigned_to',$assigned_to)->with('asset',$asset)->with('location_list',$location_list);
}
@@ -990,7 +998,7 @@ class AssetsController extends AdminController
public function getDatatable($status = null)
{
$assets = Asset::with('model','assigneduser','assigneduser.userloc','assetstatus','defaultLoc','assetlog','model','model.category')->Hardware()->select(array('id', 'name','model_id','assigned_to','asset_tag','serial','status_id','purchase_date','deleted_at'));
$assets = Asset::with('model','assigneduser','assigneduser.userloc','assetstatus','defaultLoc','assetlog','model','model.category')->Hardware()->select(array('id', 'name','model_id','assigned_to','asset_tag','serial','status_id','purchase_date','deleted_at','rtd_location_id','notes','order_number'));
switch ($status) {
@@ -1031,15 +1039,16 @@ class AssetsController extends AdminController
});
$inout = new \Chumper\Datatable\Columns\FunctionColumn('inout', function ($assets)
{
if (($assets->assigned_to !='') && ($assets->assigned_to > 0)) {
return '<a href="'.route('checkin/hardware', $assets->id).'" class="btn btn-primary btn-sm">'.Lang::get('general.checkin').'</a>';
} else {
return '<a href="'.route('checkout/hardware', $assets->id).'" class="btn btn-info btn-sm">'.Lang::get('general.checkout').'</a>';
}
});
$inout = new \Chumper\Datatable\Columns\FunctionColumn('inout', function ($assets)
{
if ($assets->assetstatus->deployable != 0) {
if (($assets->assigned_to !='') && ($assets->assigned_to > 0)) {
return '<a href="'.route('checkin/hardware', $assets->id).'" class="btn btn-primary btn-sm">'.Lang::get('general.checkin').'</a>';
} else {
return '<a href="'.route('checkout/hardware', $assets->id).'" class="btn btn-info btn-sm">'.Lang::get('general.checkout').'</a>';
}
}
});
return Datatable::collection($assets)
@@ -1060,7 +1069,11 @@ class AssetsController extends AdminController
->addColumn('model',function($assets)
{
return $assets->model->name;
if ($assets->model) {
return $assets->model->name;
} else {
return 'No model';
}
})
->addColumn('status',function($assets)
@@ -1074,7 +1087,7 @@ class AssetsController extends AdminController
})
->addColumn('location',function($assets)
{
if ($assets->assigned_to && $assets->assigneduser->userloc) {
if ($assets->assigned_to && ($assets->assigneduser->userloc!='')) {
return link_to('admin/settings/locations/'.$assets->assigneduser->userloc->id.'/edit', $assets->assigneduser->userloc->name);
} elseif ($assets->defaultLoc){
return link_to('admin/settings/locations/'.$assets->defaultLoc->id.'/edit', $assets->defaultLoc->name);
@@ -1082,7 +1095,11 @@ class AssetsController extends AdminController
})
->addColumn('category',function($assets)
{
return $assets->model->category->name;
if (isset($assets->model->category)) {
return $assets->model->category->name;
} else {
return 'No category';
}
})
@@ -1091,6 +1108,15 @@ class AssetsController extends AdminController
return $assets->eol_date();
})
->addColumn('notes',function($assets)
{
return $assets->notes;
})
->addColumn('order_number',function($assets)
{
return $assets->order_number;
})
->addColumn('checkout_date',function($assets)
{
@@ -1101,8 +1127,8 @@ class AssetsController extends AdminController
})
->addColumn($inout)
->addColumn($actions)
->searchColumns('name', 'asset_tag', 'serial', 'model', 'status','location','eol','checkout_date', 'inout','category')
->orderColumns('name', 'asset_tag', 'serial', 'model', 'status','location','eol','checkout_date', 'inout')
->searchColumns('name', 'asset_tag', 'serial', 'model', 'status','location','eol','checkout_date', 'inout','category','notes','order_number')
->orderColumns('name', 'asset_tag', 'serial', 'model', 'status','location','eol','checkout_date', 'inout','notes','order_number')
->make();
}
+19 -13
View File
@@ -161,21 +161,27 @@ class GroupsController extends AdminController
return Redirect::back()->withInput()->withErrors($validator);
}
try {
// Update the group data
$group->name = Input::get('name');
$group->permissions = Input::get('permissions');
if (!Config::get('app.lock_passwords')) {
// Was the group updated?
if ($group->save()) {
// Redirect to the group page
return Redirect::route('update/group', $id)->with('success', Lang::get('admin/groups/message.success.update'));
} else {
// Redirect to the group page
return Redirect::route('update/group', $id)->with('error', Lang::get('admin/groups/message.error.update'));
try {
// Update the group data
$group->name = Input::get('name');
$group->permissions = Input::get('permissions');
// Was the group updated?
if ($group->save()) {
// Redirect to the group page
return Redirect::route('update/group', $id)->with('success', Lang::get('admin/groups/message.success.update'));
} else {
// Redirect to the group page
return Redirect::route('update/group', $id)->with('error', Lang::get('admin/groups/message.error.update'));
}
} catch (NameRequiredException $e) {
$error = Lang::get('admin/group/message.group_name_required');
}
} catch (NameRequiredException $e) {
$error = Lang::get('admin/group/message.group_name_required');
} else {
return Redirect::route('update/group', $id)->withInput()->with('error', 'Denied! Editing groups is not allowed in the demo.');
}
// Redirect to the group page
+11 -7
View File
@@ -236,7 +236,7 @@ class ModelsController extends AdminController
return Redirect::to('hardware/models')->with('success', Lang::get('admin/models/message.delete.success'));
}
}
public function getRestore($modelId = null)
{
@@ -308,7 +308,7 @@ class ModelsController extends AdminController
return $view;
}
public function getDatatable($status = null)
{
$models = Model::orderBy('created_at', 'DESC')->with('category','assets','depreciation');
@@ -324,6 +324,9 @@ class ModelsController extends AdminController
});
return Datatable::collection($models)
->addColumn('manufacturer', function($models) {
return $models->manufacturer->name;
})
->addColumn('name', function ($models) {
return link_to('/hardware/models/'.$models->id.'/view', $models->name);
})
@@ -345,15 +348,15 @@ class ModelsController extends AdminController
->orderColumns('name','modelno','asset_count','depreciation','category','eol','actions')
->make();
}
public function getDataView($modelID)
{
$model = Model::withTrashed()->find($modelID);
$modelassets = $model->assets;
$actions = new \Chumper\Datatable\Columns\FunctionColumn('actions', function ($modelassets)
{
$actions = new \Chumper\Datatable\Columns\FunctionColumn('actions', function ($modelassets)
{
if (($modelassets->assigned_to !='') && ($modelassets->assigned_to > 0)) {
return '<a href="'.route('checkin/hardware', $modelassets->id).'" class="btn btn-primary btn-sm">'.Lang::get('general.checkin').'</a>';
} else {
@@ -363,7 +366,8 @@ class ModelsController extends AdminController
return Datatable::collection($modelassets)
->addColumn('name', function ($modelassets) {
return link_to('/hardware/'.$modelassets->id.'/view', $modelassets->name);
return link_to('/hardware/'.$modelassets->id.'/view', $modelassets->showAssetName());
// return $modelassets->name;
})
->addColumn('asset_tag', function ($modelassets) {
return link_to('/hardware/'.$modelassets->id.'/view', $modelassets->asset_tag);
+9 -7
View File
@@ -64,7 +64,7 @@ class SettingsController extends AdminController
// Declare the rules for the form validation
$rules = array(
"per_page" => 'required|min:1|numeric',
"qr_text" => 'min:1|max:31',
@@ -74,12 +74,12 @@ class SettingsController extends AdminController
"slack_channel" => 'regex:/(?<!\w)#\w+/',
"slack_botname" => 'alpha_dash',
);
if (Config::get('app.lock_passwords')==false) {
$rules['site_name'] = 'required|min:3';
}
}
// Create a new validator instance from our validation rules
$validator = Validator::make(Input::all(), $rules);
@@ -93,6 +93,7 @@ class SettingsController extends AdminController
if (Input::get('clear_logo')=='1') {
$setting->logo = NULL;
} elseif (Input::file('logo')) {
if (!Config::get('app.lock_passwords')) {
$image = Input::file('logo');
$file_name = "logo.".$image->getClientOriginalExtension();
$path = public_path('uploads/'.$file_name);
@@ -101,16 +102,17 @@ class SettingsController extends AdminController
$constraint->upsize();
})->save($path);
$setting->logo = $file_name;
}
}
// Update the asset data
$setting->id = '1';
if (Config::get('app.lock_passwords')==false) {
$setting->site_name = e(Input::get('site_name'));
}
}
$setting->per_page = e(Input::get('per_page'));
$setting->qr_code = e(Input::get('qr_code', '0'));
$setting->barcode_type = e(Input::get('barcode_type'));
+10 -6
View File
@@ -245,6 +245,11 @@ class UsersController extends AdminController
$this->decodePermissions($permissions);
app('request')->request->set('permissions', $permissions);
// Only update the email address if locking is set to false
if (Config::get('app.lock_passwords')) {
return Redirect::route('users')->with('error', 'Denied! You cannot update user information on the demo.');
}
try {
// Get the user information
$user = Sentry::getUserProvider()->findById($id);
@@ -277,11 +282,6 @@ class UsersController extends AdminController
return Redirect::back()->withInput()->withErrors($validator);
}
// Only update the email address if locking is set to false
if (!Config::get('app.lock_passwords')) {
$user->email = Input::get('email');
}
try {
// Update the user
$user->first_name = Input::get('first_name');
@@ -309,6 +309,11 @@ class UsersController extends AdminController
$user->password = $password;
}
// Do we want to update the user email?
if (!Config::get('app.lock_passwords')) {
$user->email = Input::get('email');
}
// Get the current user groups
$userGroups = $user->groups()->lists('group_id', 'group_id');
@@ -325,7 +330,6 @@ class UsersController extends AdminController
// Assign the user to groups
foreach ($groupsToAdd as $groupId) {
$group = Sentry::getGroupProvider()->findById($groupId);
$user->addGroup($group);
}
+2 -2
View File
@@ -5,7 +5,7 @@ return array(
'about_accessories_text' => 'Accessories are anything you issue to users but that do not have a serial number (or you do not care about tracking them uniquely). For example, computer mice or keyboards.',
'accessory_category' => 'Accessory Category',
'accessory_name' => 'Accessory Name',
'create' => 'Create Category',
'create' => 'Create Accessory',
'eula_text' => 'Category EULA',
'eula_text_help' => 'This field allows you to customize your EULAs for specific types of assets. If you only have one EULA for all of your assets, you can check the box below to use the primary default.',
'require_acceptance' => 'Require users to confirm acceptance of assets in this category.',
@@ -13,7 +13,7 @@ return array(
'qty' => 'QTY',
'total' => 'Total',
'remaining' => 'Avail',
'update' => 'Update Category',
'update' => 'Update Accessory',
'use_default_eula' => 'Use the <a href="#" data-toggle="modal" data-target="#eulaModal">primary default EULA</a> instead.',
'use_default_eula_disabled' => '<del>Use the primary default EULA instead.</del> No primary default EULA is set. Please add one in Settings.',
+1 -1
View File
@@ -19,7 +19,7 @@ return array(
'eol_rate' => 'EOL Rate',
'expires' => 'Expires',
'fully_depreciated' => 'Fully Depreciated',
'help_checkout' => 'If you wish to assign this asset immediately, you should select "Ready to Deploy" from the status list above, or unexpected things may happen. ',
'help_checkout' => 'If you wish to assign this asset immediately, select "Ready to Deploy" from the status list above. ',
'mac_address' => 'MAC Address',
'manufacturer' => 'Manufacturer',
'model' => 'Model',
+4 -2
View File
@@ -21,8 +21,8 @@ return array(
'avatar_upload' => 'Upload Avatar',
'back' => 'Back',
'cancel' => 'Cancel',
'categories' => 'Asset Categories',
'category' => 'Asset Category',
'categories' => 'Asset/Accessory Categories',
'category' => 'Category',
'changeemail' => 'Change Email Address',
'changepassword' => 'Change Password',
'checkin' => 'Checkin',
@@ -66,6 +66,7 @@ return array(
'licenses' => 'Licenses',
'list_all' => 'List All',
'loading' => 'Loading',
'lock_passwords' => 'This field cannot be edited in this installation.',
'location' => 'Location',
'locations' => 'Locations',
'logout' => 'Logout',
@@ -101,6 +102,7 @@ return array(
'select_supplier' => 'Select a Supplier',
'select_user' => 'Select a User',
'select_date' => 'Select Date',
'select_statuslabel' => 'Select Status',
'settings' => 'Settings',
'sign_in' => 'Sign in',
'site_name' => 'Site Name',
+14 -10
View File
@@ -10,6 +10,7 @@ class Asset extends Depreciable
protected $rules = array(
'name' => 'alpha_space|min:2|max:255',
'model_id' => 'required',
'status_id' => 'required',
'warranty_months' => 'integer|min:0|max:240',
'note' => 'alpha_space',
'notes' => 'alpha_space',
@@ -58,11 +59,11 @@ class Asset extends Depreciable
/**
* Get the asset's location based on the assigned user
* Get the asset's location based on default RTD location
**/
public function defaultLoc()
{
return $this->hasOne('Location', 'id', 'rtd_location_id');
return $this->belongsTo('Location', 'rtd_location_id');
}
@@ -119,9 +120,9 @@ class Asset extends Depreciable
{
return $this->belongsTo('Statuslabel','status_id');
}
/**
* Get name for EULA
/**
* Get name for EULA
**/
public function showAssetName()
{
@@ -131,7 +132,7 @@ class Asset extends Depreciable
return $this->name;
}
}
public function warrantee_expires()
{
$date = date_create($this->purchase_date);
@@ -175,7 +176,7 @@ class Asset extends Depreciable
{
return $this->belongsTo('Supplier','supplier_id');
}
public function months_until_eol()
{
@@ -194,9 +195,12 @@ class Asset extends Depreciable
public function eol_date()
{
$date = date_create($this->purchase_date);
date_add($date, date_interval_create_from_date_string($this->model->eol.' months'));
return date_format($date, 'Y-m-d');
if (($this->purchase_date) && ($this->model)) {
$date = date_create($this->purchase_date);
date_add($date, date_interval_create_from_date_string($this->model->eol.' months'));
return date_format($date, 'Y-m-d');
}
}
+5 -5
View File
@@ -40,13 +40,13 @@ class Model extends Elegant
{
return $this->belongsTo('Manufacturer','manufacturer_id');
}
/**
-----------------------------------------------
BEGIN QUERY SCOPES
-----------------------------------------------
* -----------------------------------------------
* BEGIN QUERY SCOPES
* -----------------------------------------------
**/
/**
* Query builder scope for Deleted assets
*
+31 -12
View File
@@ -23,7 +23,7 @@ class User extends SentryUserModel
{
return "{$this->first_name} {$this->last_name}";
}
/**
* Returns the user Gravatar image url.
@@ -43,7 +43,7 @@ class User extends SentryUserModel
{
return $this->hasMany('Asset', 'assigned_to')->withTrashed();
}
public function accessories()
{
return $this->belongsToMany('Accessory', 'accessories_users', 'assigned_to','accessory_id')->withPivot('id')->withTrashed();
@@ -77,36 +77,55 @@ class User extends SentryUserModel
{
return $this->belongsTo('User','manager_id')->withTrashed();
}
public function accountStatus()
{
if ($this->sentryThrottle) {
if ($this->sentryThrottle->suspended==1) {
return 'suspended';
return 'suspended';
} elseif ($this->sentryThrottle->banned==1) {
return 'banned';
} else {
return 'banned';
} else {
return false;
}
} else {
return false;
}
}
public function sentryThrottle() {
return $this->hasOne('Throttle');
public function sentryThrottle() {
return $this->hasOne('Throttle');
}
public function scopeGetDeleted($query)
{
return $query->withTrashed()->whereNotNull('deleted_at');
}
public function scopeGetNotDeleted($query)
{
return $query->whereNull('deleted_at');
}
/**
* Override the SentryUser getPersistCode method for
* multiple logins at one time
**/
public function getPersistCode()
{
if (!Config::get('session.multi_login') || (!$this->persist_code))
{
$this->persist_code = $this->getRandomString();
// Our code got hashed
$persistCode = $this->persist_code;
$this->save();
return $persistCode;
}
return $this->persist_code;
}
}
+15 -7
View File
@@ -10,6 +10,17 @@ Route::group(array('prefix' => 'api', 'namespace' => 'Controllers\Admin', 'befor
Route::resource('/', 'AssetsController');
Route::get('list/{status?}', array('as'=>'api.hardware.list', 'uses'=>'AssetsController@getDatatable'));
});
/*---Status Label API---*/
Route::group(array('prefix'=>'statuslabels'), function() {
Route::get('{statuslabelId}/deployable', function ($statuslabelId) {
$statuslabel = Statuslabel::find($statuslabelId);
if (($statuslabel->deployable=='1') && ($statuslabel->pending!='1') && ($statuslabel->archived!='1')) {
return $statuslabel->deployable;
}
});
});
/*---Accessories API---*/
Route::group(array('prefix'=>'accessories'), function () {
Route::resource('/', 'AccessoriesController');
@@ -29,7 +40,7 @@ Route::group(array('prefix' => 'api', 'namespace' => 'Controllers\Admin', 'befor
/*---Models API---*/
Route::group(array('prefix'=>'models'), function() {
Route::resource('/', 'ModelsController');
Route::get('list/{status?}', array('as'=>'api.models.list', 'uses'=>'ModelsController@getDatatable'));
Route::get('list/{status?}', array('as'=>'api.models.list', 'uses'=>'ModelsController@getDatatable'));
Route::get('{modelId}/check', function ($modelId) {
$model = Model::find($modelId);
return $model->show_mac_address;
@@ -255,7 +266,7 @@ Route::group(array('prefix' => 'admin', 'before' => 'admin-auth', 'namespace' =>
# User Management
Route::group(array('prefix' => 'users'), function () {
Route::get('create', array('as' => 'create/user', 'uses' => 'UsersController@getCreate'));
Route::post('create', 'UsersController@postCreate');
Route::get('import', array('as' => 'import/user', 'uses' => 'UsersController@getImport'));
@@ -269,7 +280,7 @@ Route::group(array('prefix' => 'admin', 'before' => 'admin-auth', 'namespace' =>
Route::get('{userId}/view', array('as' => 'view/user', 'uses' => 'UsersController@getView'));
Route::get('{userId}/unsuspend', array('as' => 'unsuspend/user', 'uses' => 'UsersController@getUnsuspend'));
Route::get('/', array('as' => 'users', 'uses' => 'UsersController@getIndex'));
});
# Group Management
@@ -387,13 +398,10 @@ Route::group(array('before' => 'reporting-auth', 'namespace' => 'Controllers\Adm
Route::get('reports/custom', array('as' => 'reports/custom', 'uses' => 'ReportsController@getCustomReport'));
Route::post('reports/custom', 'ReportsController@postCustom');
Route::get('reports/activity', array('as' => 'reports/activity', 'uses' => 'ReportsController@getActivityReport'));
});
Route::get('/', array('as' => 'home', 'before' => 'admin-auth', 'uses' => 'Controllers\Admin\DashboardController@getIndex'));
+1
View File
@@ -14,3 +14,4 @@
Artisan::add(new AppCommand);
Artisan::add(new SendExpirationAlerts);
Artisan::add(new Versioning);
Artisan::add(new ImportCommand);
+40 -18
View File
@@ -154,11 +154,24 @@
<div class="form-group {{ $errors->has('status_id') ? ' has-error' : '' }}">
<label for="status_id" class="col-md-2 control-label">@lang('admin/hardware/form.status') <i class='fa fa-asterisk'></i></label>
<div class="col-md-7">
{{ Form::select('status_id', $statuslabel_list , Input::old('status_id', $asset->status_id), array('class'=>'select2', 'style'=>'width:350px')) }}
{{ Form::select('status_id', $statuslabel_list , Input::old('status_id', $asset->status_id), array('class'=>'select2 status_id', 'style'=>'width:350px')) }}
<p class="help-block">@lang('admin/hardware/form.help_checkout')</p>
{{ $errors->first('status_id', '<br><span class="alert-msg"><i class="fa fa-times"></i> :message</span>') }}
</div>
</div>
@if (!$asset->id)
<!-- Assigned To -->
<div id="assigned_to" style="display: none;" class="form-group {{ $errors->has('assigned_to') ? ' has-error' : '' }}">
<label for="parent" class="col-md-2 control-label">@lang('admin/hardware/form.checkout_to')
</label>
<div class="col-md-7">
{{ Form::select('assigned_to', $assigned_to , Input::old('assigned_to', $asset->assigned_to), array('class'=>'select2', 'style'=>'min-width:350px')) }}
{{ $errors->first('assigned_to', '<br><span class="alert-msg"><i class="fa fa-times"></i> :message</span>') }}
</div>
</div>
@endif
<!-- Notes -->
<div class="form-group {{ $errors->has('notes') ? ' has-error' : '' }}">
<label for="notes" class="col-md-2 control-label">@lang('admin/hardware/form.notes')</label>
@@ -169,28 +182,14 @@
</div>
<!-- Default Location -->
<div class="form-group {{ $errors->has('status_id') ? ' has-error' : '' }}">
<label for="status_id" class="col-md-2 control-label">@lang('admin/hardware/form.default_location')</label>
<div class="form-group {{ $errors->has('rtd_location_id') ? ' has-error' : '' }}">
<label for="rtd_location_id" class="col-md-2 control-label">@lang('admin/hardware/form.default_location')</label>
<div class="col-md-7">
{{ Form::select('rtd_location_id', $location_list , Input::old('rtd_location_id', $asset->rtd_location_id), array('class'=>'select2', 'style'=>'width:350px')) }}
{{ $errors->first('status_id', '<br><span class="alert-msg"><i class="fa fa-times"></i> :message</span>') }}
{{ $errors->first('rtd_location_id', '<br><span class="alert-msg"><i class="fa fa-times"></i> :message</span>') }}
</div>
</div>
@if (!$asset->id)
<!-- Assigned To -->
<div class="form-group {{ $errors->has('assigned_to') ? ' has-error' : '' }}">
<label for="parent" class="col-md-2 control-label">@lang('admin/hardware/form.checkout_to')
</label>
<div class="col-md-7">
{{ Form::select('assigned_to', $assigned_to , Input::old('assigned_to', $asset->assigned_to), array('class'=>'select2', 'style'=>'min-width:350px')) }}
<p class="help-block">@lang('admin/hardware/form.help_checkout')</p>
{{ $errors->first('assigned_to', '<br><span class="alert-msg"><i class="fa fa-times"></i> :message</span>') }}
</div>
</div>
@endif
<!-- Requestable -->
<div class="form-group">
<div class="col-sm-offset-2 col-sm-10">
@@ -237,6 +236,29 @@
}
});
};
var $eventSelect = $(".status_id");
$eventSelect.on("change", function () { user_add($eventSelect.val()); });
$(function() {
var deployable = $(".status_id option:selected").val();
if(deployable!=''){
user_add(deployable);
}
});
function user_add(id) {
$.ajax({
url: "{{Config::get('app.url')}}/api/statuslabels/"+id+"/deployable",
success: function(data) {
if(data == true){
$("#assigned_to").css("display", "block");
} else {
$("#assigned_to").css("display", "none");
}
}
});
};
</script>
@stop
+16 -14
View File
@@ -1,7 +1,7 @@
@extends('backend/layouts/default')
@section('title0')
@if (Input::get('status'))
@if (Input::get('status')=='Pending')
@lang('general.pending')
@@ -57,16 +57,18 @@
{{ Datatable::table()
->addColumn('<input type="checkbox" id="checkAll" style="padding-left: 0px;">',Lang::get('admin/hardware/form.name'),
Lang::get('admin/hardware/table.asset_tag'),
->addColumn('<div class="text-center"><input type="checkbox" id="checkAll" style="padding-left: 0px;"></div>',Lang::get('admin/hardware/form.name'),
Lang::get('admin/hardware/table.asset_tag'),
Lang::get('admin/hardware/table.serial'),
Lang::get('admin/hardware/form.model'),
Lang::get('admin/hardware/table.status'),
Lang::get('admin/hardware/table.location'),
Lang::get('general.category'),
Lang::get('admin/hardware/table.eol'),
Lang::get('admin/hardware/table.checkout_date'),
Lang::get('admin/hardware/table.change'),
Lang::get('general.notes'),
Lang::get('admin/hardware/form.order'),
Lang::get('admin/hardware/table.checkout_date'),
Lang::get('admin/hardware/table.change'),
Lang::get('table.actions'))
->setOptions(
array(
@@ -75,8 +77,8 @@
'lengthMenu' => Lang::get('general.page_menu'),
'loadingRecords' => Lang::get('general.loading'),
'zeroRecords' => Lang::get('general.no_results'),
'info' => Lang::get('general.pagination_info'),
'processing' => Lang::get('general.processing'),
'info' => Lang::get('general.pagination_info'),
'processing' => '<i class="fa fa-spinner fa-spin"></i> '.Lang::get('general.processing'),
'paginate'=> array(
'first'=>Lang::get('general.first'),
'previous'=>Lang::get('general.previous'),
@@ -84,10 +86,10 @@
'last'=>Lang::get('general.last'),
),
),
'sAjaxSource'=> route('api.hardware.list', Input::get('status')),
'sAjaxSource'=> route('api.hardware.list', array(''=>Input::get('status'),'order_number'=>Input::get('order_number'))),
'dom' =>'CT<"clear">lfrtip',
'colVis'=> array('showAll'=>'Show All','restore'=>'Restore','exclude'=>array(0,10,11),'activate'=>'mouseover'),
'columnDefs'=> array(array('visible'=>false,'targets'=>array(7,8,9)),array('orderable'=>false,'targets'=>array(0,10,11))),
'colVis'=> array('showAll'=>'Show All','restore'=>'Restore','exclude'=>array(0,12,13),'activate'=>'mouseover'),
'columnDefs'=> array(array('visible'=>false,'targets'=>array(7,8,9)),array('orderable'=>false,'targets'=>array(0,12,13))),
'order'=>array(array(1,'asc')),
)
)
@@ -112,17 +114,17 @@
$('#bulkEdit').attr('disabled', 'disabled');
}
}
$('table').on('change','input.one_required',checkForChecked);
$("#checkAll").change(function () {
$("input:checkbox").prop('checked', $(this).prop("checked"));
checkForChecked();
});
});
</script>
+1 -1
View File
@@ -43,7 +43,7 @@
<!-- open sans font -->
<link href='http://fonts.googleapis.com/css?family=Open+Sans:300italic,400italic,600italic,700italic,800italic,400,300,600,700,800' rel='stylesheet' type='text/css'>
<link href='//fonts.googleapis.com/css?family=Open+Sans:300italic,400italic,600italic,700italic,800italic,400,300,600,700,800' rel='stylesheet' type='text/css'>
<!-- global header javascripts -->
<script src="{{ asset('assets/js/jquery-latest.js') }}"></script>
+4 -3
View File
@@ -23,12 +23,13 @@
<div class="row form-wrapper">
{{ Datatable::table()
->addColumn(Lang::get('admin/models/table.title'),
->addColumn(Lang::get('general.manufacturer'),
Lang::get('admin/models/table.title'),
Lang::get('admin/models/table.modelnumber'),
Lang::get('admin/models/table.numassets'),
Lang::get('general.depreciation'),
Lang::get('general.category'),
Lang::get('general.eol'),
Lang::get('general.eol'),
Lang::get('table.actions'))
->setOptions(
array(
@@ -37,7 +38,7 @@
'lengthMenu' => Lang::get('general.page_menu'),
'loadingRecords' => Lang::get('general.loading'),
'zeroRecords' => Lang::get('general.no_results'),
'info' => Lang::get('general.pagination_info'),
'info' => Lang::get('general.pagination_info'),
'processing' => Lang::get('general.processing'),
'paginate'=> array(
'first'=>Lang::get('general.first'),
+31 -25
View File
@@ -19,7 +19,7 @@ padding: 0px 20px;
</style>
<div id="pad-wrapper" class="user-profile">
<!-- header -->
<div class="pull-right">
@@ -31,9 +31,9 @@ padding: 0px 20px;
<div class="profile">
<!-- bio, new note & orders column -->
<div class="col-md-9 bio">
<div class="profile-box">
<br>
@@ -42,11 +42,11 @@ padding: 0px 20px;
<!-- CSRF Token -->
{{ Form::hidden('_token', csrf_token()) }}
@foreach ($settings as $setting)
<h4>@lang('admin/settings/general.general_settings')</h4>
<div class="form-group {{ $errors->has('site_name') ? 'error' : '' }}">
<div class="col-md-3">
{{ Form::label('site_name', Lang::get('admin/settings/general.site_name')) }}
@@ -54,11 +54,11 @@ padding: 0px 20px;
<div class="col-md-9">
@if (Config::get('app.lock_passwords')===true)
{{ Form::text('site_name', Input::old('site_name', $setting->site_name), array('class' => 'form-control', 'disabled'=>'disabled','placeholder' => 'Snipe-IT Asset Management')) }}
@else
@else
{{ Form::text('site_name', Input::old('site_name', $setting->site_name), array('class' => 'form-control','placeholder' => 'Snipe-IT Asset Management')) }}
@endif
{{ $errors->first('site_name', '<br><span class="alert-msg">:message</span>') }}
</div>
</div>
@@ -69,9 +69,15 @@ padding: 0px 20px;
{{ Form::label('logo', Lang::get('admin/settings/general.logo')) }}
</div>
<div class="col-md-9">
{{ Form::file('logo') }}
{{ $errors->first('logo', '<br><span class="alert-msg">:message</span>') }}
{{ Form::checkbox('clear_logo', '1', Input::old('clear_logo')) }} Remove
@if (Config::get('app.lock_passwords'))
<p class="help-block">@lang('general.lock_passwords')</p>
@else
{{ Form::file('logo') }}
{{ $errors->first('logo', '<br><span class="alert-msg">:message</span>') }}
{{ Form::checkbox('clear_logo', '1', Input::old('clear_logo')) }} Remove
@endif
</div>
</div>
@@ -115,7 +121,7 @@ padding: 0px 20px;
</div>
</div>
<div class="checkbox col-md-offset-3">
<label>
@@ -220,7 +226,7 @@ padding: 0px 20px;
</div>
<hr>
<h4>@lang('admin/settings/general.slack_integration') (@lang('admin/settings/general.optional'))</h4>
<p class="help-inline">@lang('admin/settings/general.slack_integration_help',array('slack_link' => 'https://my.slack.com/services/new/incoming-webhook'))</p>
@@ -229,17 +235,17 @@ padding: 0px 20px;
{{ Form::label('slack_endpoint', Lang::get('admin/settings/general.slack_endpoint')) }}
</div>
<div class="col-md-9">
@if (Config::get('app.lock_passwords')===true)
{{ Form::text('slack_endpoint', Input::old('slack_endpoint', $setting->slack_endpoint), array('class' => 'form-control','disabled'=>'disabled','placeholder' => 'https://hooks.slack.com/services/XXXXXXXXXXXXXXXXXXXXX')) }}
@else
@else
{{ Form::text('slack_endpoint', Input::old('slack_endpoint', $setting->slack_endpoint), array('class' => 'form-control','placeholder' => 'https://hooks.slack.com/services/XXXXXXXXXXXXXXXXXXXXX')) }}
@endif
{{ $errors->first('slack_endpoint', '<br><span class="alert-msg">:message</span>') }}
</div>
</div>
<div class="form-group {{ $errors->has('slack_channel') ? 'error' : '' }}">
<div class="col-md-3">
{{ Form::label('slack_channel', Lang::get('admin/settings/general.slack_channel')) }}
@@ -247,13 +253,13 @@ padding: 0px 20px;
<div class="col-md-9">
@if (Config::get('app.lock_passwords')===true)
{{ Form::text('slack_channel', Input::old('slack_channel', $setting->slack_channel), array('class' => 'form-control','disabled'=>'disabled','placeholder' => '#IT-Ops')) }}
@else
@else
{{ Form::text('slack_channel', Input::old('slack_channel', $setting->slack_channel), array('class' => 'form-control','placeholder' => '#IT-Ops')) }}
@endif
@endif
{{ $errors->first('slack_channel', '<br><span class="alert-msg">:message</span>') }}
</div>
</div>
<div class="form-group {{ $errors->has('slack_botname') ? 'error' : '' }}">
<div class="col-md-3">
{{ Form::label('slack_botname', Lang::get('admin/settings/general.slack_botname')) }}
@@ -261,9 +267,9 @@ padding: 0px 20px;
<div class="col-md-9">
@if (Config::get('app.lock_passwords')===true)
{{ Form::text('slack_botname', Input::old('slack_botname', $setting->slack_botname), array('class' => 'form-control','disabled'=>'disabled','placeholder' => 'Snipe-IT Bot')) }}
@else
@else
{{ Form::text('slack_botname', Input::old('slack_botname', $setting->slack_botname), array('class' => 'form-control','placeholder' => 'Snipe-IT Bot')) }}
@endif
@endif
{{ $errors->first('slack_botname', '<br><span class="alert-msg">:message</span>') }}
</div>
</div>
@@ -280,10 +286,10 @@ padding: 0px 20px;
<button type="submit" class="btn-flat success"><i class="fa fa-check icon-white"></i> @lang('general.save')</button>
</div>
</div>
</form>
</form>
</div>
</div>
<!-- side address column -->
+5 -1
View File
@@ -5,6 +5,10 @@
RewriteEngine On
# Uncomment these two lines to force SSL redirect
# RewriteCond %{HTTPS} off
# RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
# Redirect Trailing Slashes...
RewriteRule ^(.*)/$ /$1 [L,R=301]
@@ -12,4 +16,4 @@
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [L]
</IfModule>
</IfModule>