Compare commits

..

9 Commits

Author SHA1 Message Date
snipe 67e0e14a12 License importer, small fixes for asset imporer 2015-08-14 14:18:51 -07:00
snipe 85a64f9dfd Merge remote-tracking branch 'origin/develop' 2015-08-06 04:00:46 -07:00
snipe a28481cd8f Merge remote-tracking branch 'origin/develop' 2015-07-27 23:10:40 -07:00
snipe a5b2dbfaf0 Merge remote-tracking branch 'origin/develop' 2015-07-23 12:33:26 -07:00
snipe abb970fe39 Merge remote-tracking branch 'origin/develop' 2015-07-17 16:25:55 -07:00
snipe 9ac093e0be Merge remote-tracking branch 'origin/develop' 2015-07-17 14:18:20 -07:00
snipe 61e16a4668 Merge remote-tracking branch 'origin/develop' 2015-07-16 16:25:15 -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
686 changed files with 4901 additions and 16463 deletions
-7
View File
@@ -7,7 +7,6 @@ composer.phar
/app/database/*.sqlite
/app/storage/meta/services.json
/app/config/*/mail.php
/app/config/*/session.php
/app/config/*/database.php
/app/config/*/app.php
public/packages/*
@@ -25,9 +24,3 @@ public/uploads/logo.png
public/assets/.siteflow
app/config/local/session.php
.couscous
tests/_support/_generated/*
tests/_data/scenarios
nbproject/*
app/config/local/ldap.php
app/storage/dumps/*
app/config/packages/schickling/backup/config.php
+3 -12
View File
@@ -1,7 +1,6 @@
addons:
hosts:
- snipe-it.dev
sudo: false
hosts:
- AlisonMBP
# see http://about.travis-ci.org/docs/user/languages/php/ for more hints
language: php
@@ -18,7 +17,7 @@ env:
# execute any number of scripts before the test run, custom env's are available as variables
before_script:
- if [[ "$DB" == "mysql" ]]; then mysql -e "create database IF NOT EXISTS snipeit_unit;" -utravis; fi
- if [[ "$DB" == "mysql" ]]; then mysql -e "create database IF NOT EXISTS snipeit_laravel;" -utravis; fi
- curl -s http://getcomposer.org/installer | php
- cp app/config/testing/app.example.php app/config/testing/app.php
- cp app/config/testing/database.example.php app/config/testing/database.php
@@ -33,17 +32,9 @@ before_script:
# omitting "script:" will default to phpunit
# use the $DB env variable to determine the phpunit.xml to use
# script: ./vendor/bin/codecept run
script: phpunit
# configure notifications (email, IRC, campfire etc)
notifications:
email: false
slack:
secure: vv9we1RxB9RsrMbomSdq6D7vz/okobw87pEkgIZjB+hj1QpQ2by90gsPsOa+NgsJEFaEP7e4KlT6SH8kK+zhbmuKaUd3d1//XdcancE22LZXi6tkiB5yuR/Jhhb1LLDqyGJTB4D92hMnnCPiUjpxNA3r437ttNeYRdYIEEP3drA=
webhooks:
urls:
- https://webhooks.gitter.im/e/5e136eb0c1965f3918d0
on_success: change # options: [always|never|change] default: always
on_failure: change # options: [always|never|change] default: always
on_start: false # default: false
+325 -886
View File
File diff suppressed because it is too large Load Diff
+10 -38
View File
@@ -18,7 +18,7 @@ class AppCommand extends Command
*
* @var string
*/
protected $description = 'This command kicks off your database table creation and migration, and creates your first admin user.';
protected $description = '';
/**
* Holds the user information.
@@ -28,7 +28,7 @@ class AppCommand extends Command
protected $userData = array(
'first_name' => null,
'last_name' => null,
'username' => null,
'email' => null,
'password' => null
);
@@ -66,7 +66,6 @@ class AppCommand extends Command
// Let's ask the user some questions, shall we?
$this->askUserFirstName();
$this->askUserLastName();
$this->askUserUsername();
$this->askUserEmail();
$this->askUserPassword();
@@ -90,10 +89,10 @@ class AppCommand extends Command
$this->call('migrate:install');
// Run the Sentry Migrations
$this->call('migrate', array('--package' => 'cartalyst/sentry','--force'=>true));
$this->call('migrate', array('--package' => 'cartalyst/sentry'));
// Run the Migrations
$this->call('migrate', array('--force'=>true));
$this->call('migrate');
// Create the default user and default groups.
$this->sentryRunner();
@@ -163,7 +162,7 @@ class AppCommand extends Command
}
/**
* Asks the user for the username address.
* Asks the user for the user email address.
*
* @return void
* @todo Use the Laravel Validator
@@ -172,7 +171,7 @@ class AppCommand extends Command
{
do {
// Ask the user to input the email address
$email = $this->ask('Please enter your email: ');
$email = $this->ask('Please enter your user email: ');
// Check if email is valid
if ($email == '') {
@@ -186,32 +185,6 @@ class AppCommand extends Command
while ( ! $email);
}
/**
* Asks the user for the username address.
*
* @return void
* @todo Use the Laravel Validator
*/
protected function askUserUsername()
{
do {
// Ask the user to input the username
$username = $this->ask('Please enter your username: ');
// Check if username is valid
if ($username == '') {
// Return an error message
$this->error('Username is invalid. Please try again.');
}
// Store the username address
$this->userData['username'] = $username;
}
while ( ! $username);
}
/**
* Asks the user for the user password.
*
@@ -224,7 +197,7 @@ class AppCommand extends Command
// Ask the user to input the user password
$password = $this->ask('Please enter your user password (at least 8 characters): ');
// Check if password is valid
// Check if email is valid
if ($password == '') {
// Return an error message
$this->error('Password is invalid. Please try again.');
@@ -244,9 +217,9 @@ class AppCommand extends Command
protected function askUserDummyData()
{
// Ask the user to input the user password
$dummydata = $this->ask('Do you want to seed your database with dummy data? Y/n (default is yes): ');
$dummydata = $this->ask('Do you want to seed your database with dummy data? y/n (default is yes): ');
$this->dummyData = ( strstr($dummydata, 'Y' ) || empty($dummydata) ) ? true : false;
$this->dummyData = ( strstr($dummydata, 'y' ) || empty($dummydata) ) ? true : false;
}
/**
@@ -356,7 +329,7 @@ class AppCommand extends Command
$user = Sentry::getUserProvider()->create($data);
// Associate the Admin group to this user
$group = Sentry::findGroupByName('Admin');
$group = Sentry::getGroupProvider()->findById(1);
$user->addGroup($group);
// Show the success message
@@ -377,7 +350,6 @@ class AppCommand extends Command
'first_name' => 'John',
'last_name' => 'Doe',
'email' => 'john.doe@example.com',
'username' => 'john.doe@example.com',
'password' => substr(str_shuffle(str_repeat('0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ', mt_rand(1,10))),1,10),
'notes' => 'Generated on install',
'activated' => 1,
+1 -8
View File
@@ -315,14 +315,7 @@ class LicenseImportCommand extends Command {
// Create the license seat entries
$license_seat = new LicenseSeat();
$license_seat->license_id = $license->id;
// Only assign the first seat to the user
if ($x==0) {
$license_seat->assigned_to = $user->id;
} else {
$license_seat->assigned_to = NULL;
}
$license_seat->assigned_to = $user->id;
if ($license_seat->save()) {
$license_seat_created++;
}
+28 -64
View File
@@ -37,94 +37,58 @@ class SendExpirationAlerts extends Command {
*/
public function fire()
{
// Expiring Assets
$expiring_assets = Asset::getExpiringWarrantee(60);
$this->info(count($expiring_assets).' expiring assets');
$asset_data['count'] = count($expiring_assets);
$asset_data['email_content'] ='';
$now = date("Y-m-d");
$data['count'] = count($expiring_assets);
$data['email_content'] ='';
foreach ($expiring_assets as $asset) {
$now = date("Y-m-d");
$expires = $asset->warrantee_expires();
$difference = round(abs(strtotime($expires) - strtotime($now))/86400);
if ($difference > 30) {
$asset_data['email_content'] .= '<tr style="background-color: #fcffa3;">';
$data['email_content'] .= '<tr style="background-color: #fcffa3;">';
} else {
$asset_data['email_content'] .= '<tr style="background-color:#d9534f;">';
$data['email_content'] .= '<tr style="background-color:#d9534f;">';
}
$asset_data['email_content'] .= '<td><a href="'.Config::get('app.url').'/hardware/'.$asset->id.'/view">';
$asset_data['email_content'] .= $asset->showAssetName().'</a></td><td>'.$asset->asset_tag.'</td>';
$asset_data['email_content'] .= '<td>'.$asset->warrantee_expires().'</td>';
$asset_data['email_content'] .= '<td>'.$difference.' days</td>';
$asset_data['email_content'] .= '</tr>';
$data['email_content'] .= '<td><a href="'.Config::get('app.url').'/hardware/'.$asset->id.'/view">';
$data['email_content'] .= $asset->name.'</a></td><td>'.$asset->asset_tag.'</td>';
$data['email_content'] .= '<td>'.$asset->warrantee_expires().'</td>';
$data['email_content'] .= '<td>'.$difference.' days</td>';
$data['email_content'] .= '</tr>';
}
// Expiring licenses
$expiring_licenses = License::getExpiringLicenses(60);
$this->info(count($expiring_licenses).' expiring licenses');
$license_data['count'] = count($expiring_licenses);
$license_data['email_content'] = '';
foreach ($expiring_licenses as $license) {
$expires = $license->expiration_date;
$difference = round(abs(strtotime($expires) - strtotime($now))/86400);
if ($difference > 30) {
$license_data['email_content'] .= '<tr style="background-color: #fcffa3;">';
} else {
$license_data['email_content'] .= '<tr style="background-color:#d9534f;">';
}
$license_data['email_content'] .= '<td><a href="'.Config::get('app.url').'/admin/licenses/'.$license->id.'/view">';
$license_data['email_content'] .= $license->name.'</a></td>';
$license_data['email_content'] .= '<td>'.$license->expiration_date.'</td>';
$license_data['email_content'] .= '<td>'.$difference.' days</td>';
$license_data['email_content'] .= '</tr>';
}
if ((Setting::getSettings()->alert_email!='') && (Setting::getSettings()->alerts_enabled==1)) {
if ((Setting::getSettings()->alert_email!='') && (Setting::getSettings()->alerts_enabled==1)){
if (count($expiring_assets) > 0) {
Mail::send('emails.expiring-assets-report', $asset_data, function ($m) {
Mail::send('emails.expiring-report', $data, function ($m) {
$m->to(Setting::getSettings()->alert_email, Setting::getSettings()->site_name);
$m->subject('Expiring Assets Report');
});
});
}
if (count($expiring_licenses) > 0) {
Mail::send('emails.expiring-licenses-report', $license_data, function ($m) {
$m->to(Setting::getSettings()->alert_email, Setting::getSettings()->site_name);
$m->subject('Expiring Licenses Report');
});
}
} else {
if (Setting::getSettings()->alert_email=='') {
echo "Could not send email. No alert email configured in settings. \n";
} elseif (Setting::getSettings()->alerts_enabled!=1) {
echo "Alerts are disabled in the settings. No mail will be sent. \n";
}
}
}
}
-65
View File
@@ -1,65 +0,0 @@
<?php
use Illuminate\Console\Command;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Input\InputArgument;
class SystemBackup extends Command {
/**
* The console command name.
*
* @var string
*/
protected $name = 'snipeit:backup';
/**
* The console command description.
*
* @var string
*/
protected $description = 'This command creates a database dump and zips up all of the uploaded files in the upload directories.';
/**
* Create a new command instance.
*
* @return void
*/
public function __construct()
{
parent::__construct();
}
/**
* Execute the console command.
*
* @return mixed
*/
public function fire()
{
//
$files['avatars'] = glob(public_path().'/uploads/avatars/*');
$files['models'] = glob(public_path().'/uploads/models/*');
$files['suppliers'] = glob(public_path().'/uploads/suppliers/*');
$files['private_uploads'] = glob(app_path().'/private_uploads/*');
$base_filename = date('Ymdgis');
$zip_file = app_path().'/storage/dumps/'.$base_filename.'-backup.zip';
$db_dump = Config::get('backup::path').$base_filename.'-db.sql';
$this->call('db:backup', array('filename' => $db_dump));
Zipper::make($zip_file)
->folder('avatars')->add($files['avatars'])
->folder('models')->add($files['models'])
->folder('suppliers')->add($files['suppliers'])
->folder('private_uploads')->add($files['private_uploads'])
->folder('database')->add($db_dump)->close();
$this->info('Backup file created at '.$zip_file);
$this->info('Removing SQL dump at '.$db_dump);
unlink($db_dump);
}
}
+1 -4
View File
@@ -43,7 +43,7 @@ return array(
*/
'cipher' => MCRYPT_RIJNDAEL_256,
/*
|--------------------------------------------------------------------------
| Prevent Password changes
@@ -103,8 +103,6 @@ return array(
'Chumper\Datatable\DatatableServiceProvider',
'Dinesh\Barcode\BarcodeServiceProvider',
'Maknz\Slack\SlackServiceProvider',
'Schickling\Backup\BackupServiceProvider',
'Chumper\Zipper\ZipperServiceProvider',
),
@@ -179,7 +177,6 @@ return array(
'DNS1D' => 'Dinesh\Barcode\Facades\DNS1DFacade',
'DNS2D' => 'Dinesh\Barcode\Facades\DNS2DFacade',
'Slack' => 'Maknz\Slack\Facades\Slack',
'Zipper' => 'Chumper\Zipper\Zipper',
),
-112
View File
@@ -1,112 +0,0 @@
<?php
return array(
/*
|--------------------------------------------------------------------------
| URL
|--------------------------------------------------------------------------
|
| URL for the LDAP server. This should start with ldap://, for example:
| ldap://ldap.yourserver.com
|
*/
'url' => "",
/*
|--------------------------------------------------------------------------
| Username
|--------------------------------------------------------------------------
|
| Username to use to connect authenticate to LDAP, for example:
| cn=read-only-admin,dc=example,dc=com
|
*/
'username' => "",
/*
|--------------------------------------------------------------------------
| Password
|--------------------------------------------------------------------------
|
| Password to use when authenticating to LDAP.
|
*/
'password' => "",
/*
|--------------------------------------------------------------------------
| Basedn
|--------------------------------------------------------------------------
|
| The base where the search for users will be executed, for example:
| dc=example,dc=com
|
*/
'basedn' => "",
/*
|--------------------------------------------------------------------------
| Filter
|--------------------------------------------------------------------------
|
| The search filter for the LDAP query. This probably does not have to be
| changed.
|
*/
'filter' => "&(cn=*)",
/*
|--------------------------------------------------------------------------
| LDAP field names that will be retrieved to create a user.
|
| Using the username as an example:
| If I set 'result.username' => 'my-org-username', the code will connect to
| LDAP as follows (where $results[$i] represents a row in the LDAP query:
| $username-to-insert-in-snipe-it = $results[$i]["my-org-username"][0]
|
| Note: all these fields are required.
|--------------------------------------------------------------------------
|
| The search filter for the LDAP query.
|
*/
'result.username' => "",
'result.last.name' => "",
'result.first.name' => "",
/*
| These fields are optional as not all LDAP directories will have it. If yours
| does not have them, just leave these blank and the extra check will
| be omitted.
*/
'result.active.flag' => "",
'result.emp.num' => "",
'result.email' => "",
/*
|--------------------------------------------------------------------------
| LDAP filter query for authentication
|--------------------------------------------------------------------------
|
| The LDAP query that we want to execute when authenticating a user. This
| should not have to be changed.
|
*/
'authentication.filter.query' => "uid=",
/*
|--------------------------------------------------------------------------
| LDAP Version
|--------------------------------------------------------------------------
|
| Version of LDAP you are using.
|
*/
'version' => 3,
);
@@ -46,7 +46,7 @@ return array(
|
*/
'hasher' => 'bcrypt',
'hasher' => 'native',
/*
|--------------------------------------------------------------------------
@@ -134,7 +134,7 @@ return array(
|
*/
'login_attribute' => 'username',
'login_attribute' => 'email',
),
@@ -1,31 +0,0 @@
<?php
return array(
/*
|--------------------------------------------------------------------------
| Trusted Proxies
|--------------------------------------------------------------------------
|
| Set an array of trusted proxies, so Laravel knows to grab the client's
| information via the X-Forwarded-* headers.
|
| To trust all proxies, use the value '*':
|
| 'proxies' => '*'
|
|
| To trust only specific proxies (recommended), set an array of those
| proxies' IP addresses:
|
| 'proxies' => array('192.168.1.1', '192.168.1.2')
|
|
| Or use CIDR notation:
|
| 'proxies' => array('192.168.12.0/23')
|
*/
'proxies' => '*',
);
@@ -1,15 +0,0 @@
<?php
return array(
'path' => 'app/storage/dumps/',
'mysql' => array(
'dump_command_path' => '',
'restore_command_path' => '',
),
's3' => array(
'path' => ''
),
'compress' => false,
);
-1
View File
@@ -1,4 +1,3 @@
app.php
mail.php
database.php
ldap.php
+1 -1
View File
@@ -26,7 +26,7 @@ return array(
|
*/
'url' => 'https://production.yourserver.com',
'url' => 'http://production.yourserver.com',
/*
|--------------------------------------------------------------------------
-112
View File
@@ -1,112 +0,0 @@
<?php
return array(
/*
|--------------------------------------------------------------------------
| URL
|--------------------------------------------------------------------------
|
| URL for the LDAP server. This should start with ldap://, for example:
| ldap://ldap.yourserver.com
|
*/
'url' => "",
/*
|--------------------------------------------------------------------------
| Username
|--------------------------------------------------------------------------
|
| Username to use to connect authenticate to LDAP, for example:
| cn=read-only-admin,dc=example,dc=com
|
*/
'username' => "",
/*
|--------------------------------------------------------------------------
| Password
|--------------------------------------------------------------------------
|
| Password to use when authenticating to LDAP.
|
*/
'password' => "",
/*
|--------------------------------------------------------------------------
| Basedn
|--------------------------------------------------------------------------
|
| The base where the search for users will be executed, for example:
| dc=example,dc=com
|
*/
'basedn' => "",
/*
|--------------------------------------------------------------------------
| Filter
|--------------------------------------------------------------------------
|
| The search filter for the LDAP query. This probably does not have to be
| changed.
|
*/
'filter' => "&(cn=*)",
/*
|--------------------------------------------------------------------------
| LDAP field names that will be retrieved to create a user.
|
| Using the username as an example:
| If I set 'result.username' => 'my-org-username', the code will connect to
| LDAP as follows (where $results[$i] represents a row in the LDAP query:
| $username-to-insert-in-snipe-it = $results[$i]["my-org-username"][0]
|
| Note: all these fields are required.
|--------------------------------------------------------------------------
|
| The search filter for the LDAP query.
|
*/
'result.username' => "",
'result.last.name' => "",
'result.first.name' => "",
/*
| These fields are optional as not all LDAP directories will have it. If yours
| does not have them, just leave these blank and the extra check will
| be omitted.
*/
'result.active.flag' => "",
'result.emp.num' => "",
'result.email' => "",
/*
|--------------------------------------------------------------------------
| LDAP filter query for authentication
|--------------------------------------------------------------------------
|
| The LDAP query that we want to execute when authenticating a user. This
| should not have to be changed.
|
*/
'authentication.filter.query' => "uid=",
/*
|--------------------------------------------------------------------------
| LDAP Version
|--------------------------------------------------------------------------
|
| Version of LDAP you are using.
|
*/
'version' => 3,
);
-112
View File
@@ -1,112 +0,0 @@
<?php
return array(
/*
|--------------------------------------------------------------------------
| URL
|--------------------------------------------------------------------------
|
| URL for the LDAP server. This should start with ldap://, for example:
| ldap://ldap.yourserver.com
|
*/
'url' => "",
/*
|--------------------------------------------------------------------------
| Username
|--------------------------------------------------------------------------
|
| Username to use to connect authenticate to LDAP, for example:
| cn=read-only-admin,dc=example,dc=com
|
*/
'username' => "",
/*
|--------------------------------------------------------------------------
| Password
|--------------------------------------------------------------------------
|
| Password to use when authenticating to LDAP.
|
*/
'password' => "",
/*
|--------------------------------------------------------------------------
| Basedn
|--------------------------------------------------------------------------
|
| The base where the search for users will be executed, for example:
| dc=example,dc=com
|
*/
'basedn' => "",
/*
|--------------------------------------------------------------------------
| Filter
|--------------------------------------------------------------------------
|
| The search filter for the LDAP query. This probably does not have to be
| changed.
|
*/
'filter' => "&(cn=*)",
/*
|--------------------------------------------------------------------------
| LDAP field names that will be retrieved to create a user.
|
| Using the username as an example:
| If I set 'result.username' => 'my-org-username', the code will connect to
| LDAP as follows (where $results[$i] represents a row in the LDAP query:
| $username-to-insert-in-snipe-it = $results[$i]["my-org-username"][0]
|
| Note: all these fields are required.
|--------------------------------------------------------------------------
|
| The search filter for the LDAP query.
|
*/
'result.username' => "",
'result.last.name' => "",
'result.first.name' => "",
/*
| These fields are optional as not all LDAP directories will have it. If yours
| does not have them, just leave these blank and the extra check will
| be omitted.
*/
'result.active.flag' => "",
'result.emp.num' => "",
'result.email' => "",
/*
|--------------------------------------------------------------------------
| LDAP filter query for authentication
|--------------------------------------------------------------------------
|
| The LDAP query that we want to execute when authenticating a user. This
| should not have to be changed.
|
*/
'authentication.filter.query' => "uid=",
/*
|--------------------------------------------------------------------------
| LDAP Version
|--------------------------------------------------------------------------
|
| Version of LDAP you are using.
|
*/
'version' => 3,
);
+2 -2
View File
@@ -26,7 +26,7 @@ return array(
|
*/
'url' => 'http://snipe-it.dev',
'url' => 'http://staging.yourserver.com',
/*
|--------------------------------------------------------------------------
@@ -40,6 +40,6 @@ return array(
| Run a php artisan key:generate --env=staging to create a random one
*/
'key' => '8YHfiO4EyWBewqrpGHDA4Iuom2ZIahXQ',
'key' => 'Change_this_key_or_snipe_will_get_ya',
);
+1 -1
View File
@@ -54,7 +54,7 @@ return array(
'mysql' => array(
'driver' => 'mysql',
'host' => 'localhost',
'database' => 'snipeit_unit',
'database' => 'snipeit_laravel',
'username' => 'travis',
'password' => '',
'charset' => 'utf8',
-112
View File
@@ -1,112 +0,0 @@
<?php
return array(
/*
|--------------------------------------------------------------------------
| URL
|--------------------------------------------------------------------------
|
| URL for the LDAP server. This should start with ldap://, for example:
| ldap://ldap.yourserver.com
|
*/
'url' => "",
/*
|--------------------------------------------------------------------------
| Username
|--------------------------------------------------------------------------
|
| Username to use to connect authenticate to LDAP, for example:
| cn=read-only-admin,dc=example,dc=com
|
*/
'username' => "",
/*
|--------------------------------------------------------------------------
| Password
|--------------------------------------------------------------------------
|
| Password to use when authenticating to LDAP.
|
*/
'password' => "",
/*
|--------------------------------------------------------------------------
| Basedn
|--------------------------------------------------------------------------
|
| The base where the search for users will be executed, for example:
| dc=example,dc=com
|
*/
'basedn' => "",
/*
|--------------------------------------------------------------------------
| Filter
|--------------------------------------------------------------------------
|
| The search filter for the LDAP query. This probably does not have to be
| changed.
|
*/
'filter' => "&(cn=*)",
/*
|--------------------------------------------------------------------------
| LDAP field names that will be retrieved to create a user.
|
| Using the username as an example:
| If I set 'result.username' => 'my-org-username', the code will connect to
| LDAP as follows (where $results[$i] represents a row in the LDAP query:
| $username-to-insert-in-snipe-it = $results[$i]["my-org-username"][0]
|
| Note: all these fields are required.
|--------------------------------------------------------------------------
|
| The search filter for the LDAP query.
|
*/
'result.username' => "",
'result.last.name' => "",
'result.first.name' => "",
/*
| These fields are optional as not all LDAP directories will have it. If yours
| does not have them, just leave these blank and the extra check will
| be omitted.
*/
'result.active.flag' => "",
'result.emp.num' => "",
'result.email' => "",
/*
|--------------------------------------------------------------------------
| LDAP filter query for authentication
|--------------------------------------------------------------------------
|
| The LDAP query that we want to execute when authenticating a user. This
| should not have to be changed.
|
*/
'authentication.filter.query' => "uid=",
/*
|--------------------------------------------------------------------------
| LDAP Version
|--------------------------------------------------------------------------
|
| Version of LDAP you are using.
|
*/
'version' => 3,
);
+3 -3
View File
@@ -1,5 +1,5 @@
<?php
return array (
'app_version' => 'v2.0',
'hash_version' => 'v2.0-RC-1-11-gda6770c',
);
'app_version' => 'v1.2.8-26',
'hash_version' => 'v1.2.8-26-gf5d4eb5',
);
+88 -96
View File
@@ -18,48 +18,6 @@ class AuthController extends BaseController
return View::make('frontend.auth.signin');
}
/**
* Authenticates a user to LDAP
*
* @return true if the username and/or password provided are valid
* false if the username and/or password provided are invalid
*
*/
function ldap($username, $password) {
$ldaphost = Config::get('ldap.url');
$ldaprdn = Config::get('ldap.username');
$ldappass = Config::get('ldap.password');
$baseDn = Config::get('ldap.basedn');
$filterQuery = Config::get('ldap.authentication.filter.query') . $username;
// Connecting to LDAP
$connection = ldap_connect($ldaphost) or die("Could not connect to {$ldaphost}");
// Needed for AD
ldap_set_option($connection, LDAP_OPT_REFERRALS, 0);
try {
if ($connection) {
// binding to ldap server
$ldapbind = ldap_bind($connection, $ldaprdn, $ldappass);
if ( ($results = @ldap_search($connection, $baseDn, $filterQuery)) !==false ) {
$entry = ldap_first_entry($connection, $results);
if ( ($userDn = @ldap_get_dn($connection, $entry)) !== false ) {
if( ($isBound = ldap_bind($connection, $userDn, $password)) == "true") {
return true;
}
}
}
}
} catch (Exception $e) {
LOG::error($e->getMessage());
}
ldap_close($connection);
return false;
}
/**
* Account sign in form processing.
*
@@ -69,7 +27,7 @@ class AuthController extends BaseController
{
// Declare the rules for the form validation
$rules = array(
'username' => 'required',
'email' => 'required|email',
'password' => 'required',
);
@@ -83,39 +41,8 @@ class AuthController extends BaseController
}
try {
/**
* =================================================================
* Hack in LDAP authentication
*/
// Try to get the user from the database.
$user = (array) DB::table('users')->where('username', Input::get('username'))->first();
if ($user && strpos($user["notes"],'LDAP') !== false) {
LOG::debug("Authenticating user against LDAP.");
if( $this->ldap(Input::get('username'), Input::get('password')) ) {
LOG::debug("valid login");
$pass = substr(str_shuffle("0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"), 0, 10);
$user = Sentry::findUserByLogin( Input::get('username') );
$user->password = $pass;
$user->save();
$credentials = array(
'username' => Input::get('username'),
'password' => $pass,
);
Sentry::authenticate($credentials, Input::get('remember-me', 0));
}
else {
throw new Cartalyst\Sentry\Users\UserNotFoundException();
}
}
/* ============================================================== */
else {
LOG::debug("Authenticating user against database.");
// Try to log the user in
Sentry::authenticate(Input::only('username', 'password'), Input::get('remember-me', 0));
}
// Try to log the user in
Sentry::authenticate(Input::only('email', 'password'), Input::get('remember-me', 0));
// Get the page we were before
$redirect = Session::get('loginRedirect', 'account');
@@ -126,19 +53,91 @@ class AuthController extends BaseController
// Redirect to the users page
return Redirect::to($redirect)->with('success', Lang::get('auth/message.signin.success'));
} catch (Cartalyst\Sentry\Users\UserNotFoundException $e) {
$this->messageBag->add('username', Lang::get('auth/message.account_not_found'));
$this->messageBag->add('email', Lang::get('auth/message.account_not_found'));
} catch (Cartalyst\Sentry\Users\UserNotActivatedException $e) {
$this->messageBag->add('username', Lang::get('auth/message.account_not_activated'));
$this->messageBag->add('email', Lang::get('auth/message.account_not_activated'));
} catch (Cartalyst\Sentry\Throttling\UserSuspendedException $e) {
$this->messageBag->add('username', Lang::get('auth/message.account_suspended'));
$this->messageBag->add('email', Lang::get('auth/message.account_suspended'));
} catch (Cartalyst\Sentry\Throttling\UserBannedException $e) {
$this->messageBag->add('username', Lang::get('auth/message.account_banned'));
$this->messageBag->add('email', Lang::get('auth/message.account_banned'));
}
// Ooops.. something went wrong
return Redirect::back()->withInput()->withErrors($this->messageBag);
}
/**
* Account sign up.
*
* @return View
*/
public function getSignup()
{
// Is the user logged in?
if (Sentry::check()) {
return Redirect::route('account');
}
// Show the page
return View::make('frontend.auth.signup');
}
/**
* Account sign up form processing.
*
* @return Redirect
*/
public function postSignup()
{
// Declare the rules for the form validation
$rules = array(
'first_name' => 'required|min:2',
'last_name' => 'required|min:2',
'email' => 'required|email|unique:users',
'email_confirm' => 'required|email|same:email',
'password' => 'required|between:10,32',
'password_confirm' => 'required|same:password',
);
// Create a new validator instance from our validation rules
$validator = Validator::make(Input::all(), $rules);
// If validation fails, we'll exit the operation now.
if ($validator->fails()) {
// Ooops.. something went wrong
return Redirect::back()->withInput()->withErrors($validator);
}
try {
// Register the user
$user = Sentry::register(array(
'first_name' => Input::get('first_name'),
'last_name' => Input::get('last_name'),
'email' => Input::get('email'),
'password' => Input::get('password'),
));
// Data to be used on the email view
$data = array(
'user' => $user,
'activationUrl' => URL::route('activate', $user->getActivationCode()),
);
// Send the activation code through email
Mail::send('emails.register-activate', $data, function ($m) use ($user) {
$m->to($user->email, $user->first_name . ' ' . $user->last_name);
$m->subject('Welcome ' . $user->first_name);
});
// Redirect to the register page
return Redirect::back()->with('success', Lang::get('auth/message.signup.success'));
} catch (Cartalyst\Sentry\Users\UserExistsException $e) {
$this->messageBag->add('email', Lang::get('auth/message.account_already_exists'));
}
// Ooops.. something went wrong
return Redirect::back()->withInput()->withErrors($this->messageBag);
}
/**
* User account activation page.
@@ -193,7 +192,7 @@ class AuthController extends BaseController
{
// Declare the rules for the validator
$rules = array(
'username' => 'required',
'email' => 'required|email',
);
// Create a new validator instance from our dynamic rules
@@ -207,28 +206,22 @@ class AuthController extends BaseController
try {
// Get the user password recovery code
$user = Sentry::getUserProvider()->findByLogin(Input::get('username'));
$user = Sentry::getUserProvider()->findByLogin(Input::get('email'));
$reset = $user->getResetPasswordCode();
// Data to be used on the username view
// Data to be used on the email view
$data = array(
'user' => $user,
'forgotPasswordUrl' => URL::route('forgot-password-confirm', $reset),
'forgotPasswordUrl' => URL::route('forgot-password-confirm', $user->getResetPasswordCode()),
);
$user->reset_password_code = $reset;
$user->save();
// Send the activation code through username
// Send the activation code through email
Mail::send('emails.forgot-password', $data, function ($m) use ($user) {
$m->to($user->username, $user->first_name . ' ' . $user->last_name);
$m->to($user->email, $user->first_name . ' ' . $user->last_name);
$m->subject('Account Password Recovery');
});
} catch (Cartalyst\Sentry\Users\UserNotFoundException $e) {
// Even though the username was not found, we will pretend
// we have sent the password reset code through username,
// Even though the email was not found, we will pretend
// we have sent the password reset code through email,
// this is a security measure against hackers.
}
@@ -244,13 +237,12 @@ class AuthController extends BaseController
*/
public function getForgotPasswordConfirm($passwordResetCode = null)
{
try {
// Find the user using the password reset code
$user = Sentry::getUserProvider()->findByResetPasswordCode($passwordResetCode);
} catch(Cartalyst\Sentry\Users\UserNotFoundException $e) {
// Redirect to the forgot password page
//return Redirect::route('forgot-password')->with('error', Lang::get('auth/message.account_not_found'));
return Redirect::route('forgot-password')->with('error', Lang::get('auth/message.account_not_found'));
}
// Show the page
+45 -114
View File
@@ -12,9 +12,6 @@ use Actionlog;
use Lang;
use Accessory;
use DB;
use Slack;
use Setting;
use Config;
class ViewAssetsController extends AuthorizedController
{
@@ -50,183 +47,117 @@ class ViewAssetsController extends AuthorizedController
public function getRequestAsset($assetId = null) {
$user = Sentry::getUser();
// Check if the asset exists and is requestable
if (is_null($asset = Asset::RequestableAssets()->find($assetId))) {
// Check if the asset exists
if (is_null($asset = Asset::find($assetId))) {
// Redirect to the asset management page
return Redirect::route('requestable-assets')->with('error', Lang::get('admin/hardware/message.does_not_exist_or_not_requestable'));
return Redirect::to('frontend/account/view-assets')->with('error', Lang::get('admin/hardware/message.does_not_exist'));
} else {
$logaction = new Actionlog();
$logaction->asset_id = $asset->id;
$logaction->asset_type = 'hardware';
$logaction->created_at = date("Y-m-d h:i:s");
if ($user->location_id) {
$logaction->location_id = $user->location_id;
}
$logaction->user_id = Sentry::getUser()->id;
$log = $logaction->logaction('requested');
$settings = Setting::getSettings();
if ($settings->slack_endpoint) {
$slack_settings = [
'username' => $settings->botname,
'channel' => $settings->slack_channel,
'link_names' => true
];
$client = new \Maknz\Slack\Client($settings->slack_endpoint,$slack_settings);
try {
$client->attach([
'color' => 'good',
'fields' => [
[
'title' => 'REQUESTED:',
'value' => strtoupper($logaction->asset_type).' asset <'.Config::get('app.url').'/hardware/'.$asset->id.'/view'.'|'.$asset->showAssetName().'> requested by <'.Config::get('app.url').'/hardware/'.$asset->id.'/view'.'|'.Sentry::getUser()->fullName().'>.'
]
]
])->send('Asset Requested');
} catch (Exception $e) {
}
}
return Redirect::route('requestable-assets')->with('success')->with('success', Lang::get('admin/hardware/message.requests.success'));
return View::make('frontend/account/view-assets', compact('asset'));
}
}
// Get the acceptance screen
public function getAcceptAsset($logID = null) {
if (is_null($findlog = Actionlog::find($logID))) {
// Redirect to the asset management page
return Redirect::to('account')->with('error', Lang::get('admin/hardware/message.does_not_exist'));
}
// Asset
if (($findlog->asset_id!='') && ($findlog->asset_type=='hardware')) {
$item = Asset::find($findlog->asset_id);
// software
} elseif (($findlog->asset_id!='') && ($findlog->asset_type=='software')) {
// software
} elseif (($findlog->asset_id!='') && ($findlog->asset_type=='software')) {
$item = License::find($findlog->asset_id);
// accessories
// accessories
} elseif ($findlog->accessory_id!='') {
$item = Accessory::find($findlog->accessory_id);
$item = Accessory::find($findlog->accessory_id);
}
// Check if the asset exists
if (is_null($item)) {
// Redirect to the asset management page
return Redirect::to('account')->with('error', Lang::get('admin/hardware/message.does_not_exist'));
}
return View::make('frontend/account/accept-asset', compact('item'))->with('findlog', $findlog);
}
// Save the acceptance
public function postAcceptAsset($logID = null) {
// Check if the asset exists
if (is_null($findlog = Actionlog::find($logID))) {
// Redirect to the asset management page
return Redirect::to('account/view-assets')->with('error', Lang::get('admin/hardware/message.does_not_exist'));
}
if ($findlog->accepted_id!='') {
// Redirect to the asset management page
return Redirect::to('account/view-assets')->with('error', Lang::get('admin/users/message.error.asset_already_accepted'));
}
if (!Input::has('asset_acceptance')) {
return Redirect::to('account/view-assets')->with('error', Lang::get('admin/users/message.error.accept_or_decline'));
}
$user = Sentry::getUser();
$logaction = new Actionlog();
if (Input::get('asset_acceptance')=='accepted') {
$logaction_msg = 'accepted';
$accepted="accepted";
$return_msg = Lang::get('admin/users/message.accepted');
} else {
$logaction_msg = 'declined';
$accepted="rejected";
$return_msg = Lang::get('admin/users/message.declined');
}
// Asset
if (($findlog->asset_id!='') && ($findlog->asset_type=='hardware')) {
$logaction->asset_id = $findlog->asset_id;
$logaction->accessory_id = NULL;
$logaction->asset_type = 'hardware';
if (Input::get('asset_acceptance')!='accepted') {
DB::table('assets')
->where('id', $findlog->asset_id)
->update(array('assigned_to' => null));
}
// software
} elseif (($findlog->asset_id!='') && ($findlog->asset_type=='software')) {
// software
} elseif (($findlog->asset_id!='') && ($findlog->asset_type=='software')) {
$logaction->asset_id = $findlog->asset_id;
$logaction->accessory_id = NULL;
$logaction->asset_type = 'software';
// accessories
// accessories
} elseif ($findlog->accessory_id!='') {
$logaction->asset_id = NULL;
$logaction->accessory_id = $findlog->accessory_id;
$logaction->asset_type = 'accessory';
$logaction->asset_type = 'accessory';
}
$logaction->checkedout_to = $findlog->checkedout_to;
$logaction->note = e(Input::get('note'));
$logaction->user_id = $user->id;
$logaction->accepted_at = date("Y-m-d h:i:s");
$log = $logaction->logaction($logaction_msg);
$log = $logaction->logaction('accepted');
$update_checkout = DB::table('asset_logs')
->where('id',$findlog->id)
->update(array('accepted_id' => $logaction->id));
$affected_asset=$logaction->assetlog;
$affected_asset->accepted=$accepted;
$affected_asset->save();
if ($update_checkout ) {
return Redirect::to('account/view-assets')->with('success', $return_msg);
return Redirect::to('account/view-assets')->with('success', 'You have successfully accept this asset.');
} else {
return Redirect::to('account/view-assets')->with('error', 'Something went wrong ');
}
}
+21 -44
View File
@@ -218,7 +218,7 @@ class AccessoriesController extends AdminController
}
// Get the dropdown of users and then pass it to the checkout view
$users_list = array('' => 'Select a User') + DB::table('users')->select(DB::raw('concat(last_name,", ",first_name," (",username,")") as full_name, id'))->whereNull('deleted_at')->orderBy('last_name', 'asc')->orderBy('first_name', 'asc')->lists('full_name', 'id');
$users_list = array('' => 'Select a User') + DB::table('users')->select(DB::raw('concat(last_name,", ",first_name) as full_name, id'))->whereNull('deleted_at')->orderBy('last_name', 'asc')->orderBy('first_name', 'asc')->lists('full_name', 'id');
return View::make('backend/accessories/checkout', compact('accessory'))->with('users_list',$users_list);
@@ -274,20 +274,20 @@ class AccessoriesController extends AdminController
$logaction->location_id = $user->location_id;
$logaction->user_id = Sentry::getUser()->id;
$logaction->note = e(Input::get('note'));
$settings = Setting::getSettings();
if ($settings->slack_endpoint) {
$slack_settings = [
'username' => $settings->botname,
'channel' => $settings->slack_channel,
'link_names' => true
];
$client = new \Maknz\Slack\Client($settings->slack_endpoint,$slack_settings);
try {
$client->attach([
'color' => 'good',
@@ -301,13 +301,13 @@ class AccessoriesController extends AdminController
'value' => e($logaction->note)
],
]
])->send('Accessory Checked Out');
} catch (Exception $e) {
}
}
@@ -322,10 +322,6 @@ class AccessoriesController extends AdminController
$data['eula'] = $accessory->getEula();
$data['first_name'] = $user->first_name;
$data['item_name'] = $accessory->name;
$data['checkout_date'] = $logaction->created_at;
$data['item_tag'] = '';
$data['expected_checkin'] = '';
$data['note'] = $logaction->note;
$data['require_acceptance'] = $accessory->requireAcceptance();
@@ -394,20 +390,20 @@ class AccessoriesController extends AdminController
$logaction->asset_type = 'accessory';
$logaction->user_id = $admin_user->id;
$logaction->note = e(Input::get('note'));
$settings = Setting::getSettings();
if ($settings->slack_endpoint) {
$slack_settings = [
'username' => $settings->botname,
'channel' => $settings->slack_channel,
'link_names' => true
];
$client = new \Maknz\Slack\Client($settings->slack_endpoint,$slack_settings);
try {
$client->attach([
'color' => 'good',
@@ -420,37 +416,18 @@ class AccessoriesController extends AdminController
'title' => 'Note:',
'value' => e($logaction->note)
],
]
])->send('Accessory Checked In');
} catch (Exception $e) {
}
}
$log = $logaction->logaction('checkin from');
if(!is_null($accessory_user->assigned_to)) {
$user = User::find($accessory_user->assigned_to);
}
$data['log_id'] = $logaction->id;
$data['first_name'] = $user->first_name;
$data['item_name'] = $accessory->name;
$data['checkin_date'] = $logaction->created_at;
$data['item_tag'] = '';
$data['note'] = $logaction->note;
if (($accessory->checkin_email()=='1')) {
Mail::send('emails.checkin-asset', $data, function ($m) use ($user) {
$m->to($user->email, $user->first_name . ' ' . $user->last_name);
$m->subject('Confirm Accessory Checkin');
});
}
if ($backto=='user') {
return Redirect::to("admin/users/".$return_to.'/view')->with('success', Lang::get('admin/accessories/message.checkin.success'));
@@ -1,464 +0,0 @@
<?php
namespace Controllers\Admin;
use AdminController;
use AssetMaintenance;
use Carbon\Carbon;
use Datatable;
use DB;
use Input;
use Lang;
use Log;
use Mail;
use Redirect;
use Response;
use Sentry;
use Slack;
use Str;
use Supplier;
use TCPDF;
use Validator;
use View;
class AssetMaintenancesController extends AdminController
{
/**
* getIndex
*
* @return mixed
* @author Vincent Sposato <vincent.sposato@gmail.com>
* @version v1.0
*/
public function getIndex()
{
return View::make( 'backend/asset_maintenances/index' );
}
/**
* getDatatable
* Gets the datatable for the index page
*
* @return mixed
* @author Vincent Sposato <vincent.sposato@gmail.com>
* @version v1.0
*/
public function getDatatable()
{
$assetMaintenances = AssetMaintenance::orderBy( 'created_at', 'DESC' )
->get();
$actions = new \Chumper\Datatable\Columns\FunctionColumn( 'actions', function ( $assetMaintenances ) {
return '<a href="' . route( 'update/asset_maintenance', $assetMaintenances->id )
. '" class="btn btn-warning btn-sm" style="margin-right:5px;"><i class="fa fa-pencil icon-white"></i></a><a data-html="false" class="btn delete-asset btn-danger btn-sm" data-toggle="modal" href="'
. route( 'delete/asset_maintenance', $assetMaintenances->id ) . '" data-content="'
. Lang::get( 'admin/asset_maintenances/message.delete.confirm' ) . '" data-title="'
. Lang::get( 'general.delete' ) . ' ' . htmlspecialchars( $assetMaintenances->title )
. '?" onClick="return false;"><i class="fa fa-trash icon-white"></i></a>';
} );
return Datatable::collection( $assetMaintenances )
->addColumn( 'asset', function ( $assetMaintenances ) {
return link_to( '/hardware/' . $assetMaintenances->asset_id . '/view',
mb_strimwidth( $assetMaintenances->asset->name, 0, 50, "..." ) );
} )
->addColumn( 'supplier', function ( $assetMaintenances ) {
return link_to( '/admin/settings/suppliers/' . $assetMaintenances->supplier_id
. '/view',
mb_strimwidth( $assetMaintenances->supplier->name, 0, 50, "..." ) );
} )
->addColumn( 'asset_maintenance_type', function ( $assetMaintenances ) {
return $assetMaintenances->asset_maintenance_type;
} )
->addColumn( 'title', function ( $assetMaintenances ) {
return link_to( '/admin/asset_maintenances/' . $assetMaintenances->id . '/view',
mb_strimwidth( $assetMaintenances->title, 0, 50, "..." ) );
} )
->addColumn( 'start_date', function ( $assetMaintenances ) {
return $assetMaintenances->start_date;
} )
->addColumn( 'completion_date', function ( $assetMaintenances ) {
return $assetMaintenances->completion_date;
} )
->addColumn( 'asset_maintenance_time', function ( $assetMaintenances ) {
if (is_null( $assetMaintenances->asset_maintenance_time )) {
$assetMaintenances->asset_maintenance_time = Carbon::now()
->diffInDays( Carbon::parse( $assetMaintenances->start_date ) );
}
return intval( $assetMaintenances->asset_maintenance_time );
} )
->addColumn( 'cost', function ( $assetMaintenances ) {
return sprintf( Lang::get( 'general.currency' ) . '%01.2f', $assetMaintenances->cost );
} )
->addColumn( $actions )
->searchColumns( 'asset', 'supplier', 'asset_maintenance_type', 'title', 'start_date',
'completion_date', 'asset_maintenance_time', 'cost', 'actions' )
->orderColumns( 'asset', 'supplier', 'asset_maintenance_type', 'title', 'start_date',
'completion_date', 'asset_maintenance_time', 'cost', 'actions' )
->make();
}
/**
* getCreate
*
* @param null $assetId
*
* @return mixed
* @author Vincent Sposato <vincent.sposato@gmail.com>
* @version v1.0
*/
public function getCreate( $assetId = null )
{
// Prepare Asset Maintenance Type List
$assetMaintenanceType = [
'' => 'Select an asset maintenance type',
] + AssetMaintenance::getImprovementOptions();
// Mark the selected asset, if it came in
$selectedAsset = $assetId;
// Get the possible assets using a left join to get a list of assets and some other helpful info
$asset = DB::table( 'assets' )
->leftJoin( 'users', 'users.id', '=', 'assets.assigned_to' )
->leftJoin( 'models', 'assets.model_id', '=', 'models.id' )
->select( 'assets.id', 'assets.name', 'first_name', 'last_name', 'asset_tag',
DB::raw( 'concat(first_name," ",last_name) as full_name, assets.id as id, models.name as modelname' ) )
->whereNull( 'assets.deleted_at' )
->get();
$asset_array = json_decode( json_encode( $asset ), true );
$asset_element[ '' ] = 'Please select an asset';
// Build a list out of the data results
for ($x = 0; $x < count( $asset_array ); $x++) {
if ($asset_array[ $x ][ 'full_name' ] != '') {
$full_name = ' (' . $asset_array[ $x ][ 'full_name' ] . ') ' . $asset_array[ $x ][ 'modelname' ];
} else {
$full_name = ' (Unassigned) ' . $asset_array[ $x ][ 'modelname' ];
}
$asset_element[ $asset_array[ $x ][ 'id' ] ] =
$asset_array[ $x ][ 'asset_tag' ] . ' - ' . $asset_array[ $x ][ 'name' ] . $full_name;
}
// Get Supplier List
$supplier_list = [ '' => 'Select Supplier' ] + Supplier::orderBy( 'name', 'asc' )
->lists( 'name', 'id' );
// Render the view
return View::make( 'backend/asset_maintenances/edit' )
->with( 'asset_list', $asset_element )
->with( 'selectedAsset', $selectedAsset )
->with( 'supplier_list', $supplier_list )
->with( 'assetMaintenanceType', $assetMaintenanceType )
->with( 'assetMaintenance', new AssetMaintenance );
}
/**
* postCreate
*
* @return mixed
* @author Vincent Sposato <vincent.sposato@gmail.com>
* @version v1.0
*/
public function postCreate()
{
// get the POST data
$new = Input::all();
// create a new model instance
$assetMaintenance = new AssetMaintenance();
// attempt validation
if ($assetMaintenance->validate( $new )) {
if (e( Input::get( 'supplier_id' ) ) == '') {
$assetMaintenance->supplier_id = null;
} else {
$assetMaintenance->supplier_id = e( Input::get( 'supplier_id' ) );
}
if (e( Input::get( 'is_warranty' ) ) == '') {
$assetMaintenance->is_warranty = 0;
} else {
$assetMaintenance->is_warranty = e( Input::get( 'is_warranty' ) );
}
if (e( Input::get( 'cost' ) ) == '') {
$assetMaintenance->cost = '';
} else {
$assetMaintenance->cost = ParseFloat( e( Input::get( 'cost' ) ) );
}
if (e( Input::get( 'notes' ) ) == '') {
$assetMaintenance->notes = null;
} else {
$assetMaintenance->notes = e( Input::get( 'notes' ) );
}
// Save the asset maintenance data
$assetMaintenance->asset_id = e( Input::get( 'asset_id' ) );
$assetMaintenance->asset_maintenance_type = e( Input::get( 'asset_maintenance_type' ) );
$assetMaintenance->title = e( Input::get( 'title' ) );
$assetMaintenance->start_date = e( Input::get( 'start_date' ) );
$assetMaintenance->completion_date = e( Input::get( 'completion_date' ) );
if (( $assetMaintenance->completion_date == "" )
|| ( $assetMaintenance->completion_date == "0000-00-00" )
) {
$assetMaintenance->completion_date = null;
}
// Was the asset maintenance created?
if ($assetMaintenance->save()) {
// Redirect to the new asset maintenance page
return Redirect::to( "admin/asset_maintenances" )
->with( 'success', Lang::get( 'admin/asset_maintenances/message.create.success' ) );
}
} else {
// failure
$errors = $assetMaintenance->errors();
return Redirect::back()
->withInput()
->withErrors( $errors );
}
// Redirect to the asset maintenance create page
return Redirect::to( 'admin/asset_maintenances/edit' )
->with( 'error', Lang::get( 'admin/asset_maintenances/message.create.error' ) )
->with( 'assetMaintenance', new AssetMaintenance );
}
/**
* getEdit
*
* @param null $assetMaintenanceId
*
* @return mixed
* @author Vincent Sposato <vincent.sposato@gmail.com>
* @version v1.0
*/
public function getEdit( $assetMaintenanceId = null )
{
// Check if the asset maintenance exists
if (is_null( $assetMaintenance = AssetMaintenance::find( $assetMaintenanceId ) )) {
// Redirect to the improvement management page
return Redirect::to( 'admin/asset_maintenances' )
->with( 'error', Lang::get( 'admin/asset_maintenances/message.not_found' ) );
}
if ($assetMaintenance->completion_date == '0000-00-00') {
$assetMaintenance->completion_date = null;
}
if ($assetMaintenance->start_date == '0000-00-00') {
$assetMaintenance->start_date = null;
}
if ($assetMaintenance->cost == '0.00') {
$assetMaintenance->cost = null;
}
// Prepare Improvement Type List
$assetMaintenanceType = [
'' => 'Select an improvement type',
] + AssetMaintenance::getImprovementOptions();
// Get the possible assets using a left join to get a list of assets and some other helpful info
$asset = DB::table( 'assets' )
->leftJoin( 'users', 'users.id', '=', 'assets.assigned_to' )
->leftJoin( 'models', 'assets.model_id', '=', 'models.id' )
->select( 'assets.id', 'assets.name', 'first_name', 'last_name', 'asset_tag',
DB::raw( 'concat(first_name," ",last_name) as full_name, assets.id as id, models.name as modelname' ) )
->whereNull( 'assets.deleted_at' )
->get();
$asset_array = json_decode( json_encode( $asset ), true );
$asset_element[ '' ] = 'Please select an asset';
// Build a list out of the data results
for ($x = 0; $x < count( $asset_array ); $x++) {
if ($asset_array[ $x ][ 'full_name' ] != '') {
$full_name = ' (' . $asset_array[ $x ][ 'full_name' ] . ') ' . $asset_array[ $x ][ 'modelname' ];
} else {
$full_name = ' (Unassigned) ' . $asset_array[ $x ][ 'modelname' ];
}
$asset_element[ $asset_array[ $x ][ 'id' ] ] =
$asset_array[ $x ][ 'asset_tag' ] . ' - ' . $asset_array[ $x ][ 'name' ] . $full_name;
}
// Get Supplier List
$supplier_list = [ '' => 'Select Supplier' ] + Supplier::orderBy( 'name', 'asc' )
->lists( 'name', 'id' );
// Render the view
return View::make( 'backend/asset_maintenances/edit' )
->with( 'asset_list', $asset_element )
->with( 'selectedAsset', null )
->with( 'supplier_list', $supplier_list )
->with( 'assetMaintenanceType', $assetMaintenanceType )
->with( 'assetMaintenance', $assetMaintenance );
}
/**
* postEdit
*
* @param null $assetMaintenanceId
*
* @return mixed
* @author Vincent Sposato <vincent.sposato@gmail.com>
* @version v1.0
*/
public function postEdit( $assetMaintenanceId = null )
{
// get the POST data
$new = Input::all();
// Check if the asset maintenance exists
if (is_null( $assetMaintenance = AssetMaintenance::find( $assetMaintenanceId ) )) {
// Redirect to the asset maintenance management page
return Redirect::to( 'admin/asset_maintenances' )
->with( 'error', Lang::get( 'admin/asset_maintenances/message.not_found' ) );
}
// attempt validation
if ($assetMaintenance->validate( $new )) {
if (e( Input::get( 'supplier_id' ) ) == '') {
$assetMaintenance->supplier_id = null;
} else {
$assetMaintenance->supplier_id = e( Input::get( 'supplier_id' ) );
}
if (e( Input::get( 'is_warranty' ) ) == '') {
$assetMaintenance->is_warranty = 0;
} else {
$assetMaintenance->is_warranty = e( Input::get( 'is_warranty' ) );
}
if (e( Input::get( 'cost' ) ) == '') {
$assetMaintenance->cost = '';
} else {
$assetMaintenance->cost = ParseFloat( e( Input::get( 'cost' ) ) );
}
if (e( Input::get( 'notes' ) ) == '') {
$assetMaintenance->notes = null;
} else {
$assetMaintenance->notes = e( Input::get( 'notes' ) );
}
// Save the asset maintenance data
$assetMaintenance->asset_id = e( Input::get( 'asset_id' ) );
$assetMaintenance->asset_maintenance_type = e( Input::get( 'asset_maintenance_type' ) );
$assetMaintenance->title = e( Input::get( 'title' ) );
$assetMaintenance->start_date = e( Input::get( 'start_date' ) );
$assetMaintenance->completion_date = e( Input::get( 'completion_date' ) );
if (( $assetMaintenance->completion_date == "" )
|| ( $assetMaintenance->completion_date == "0000-00-00" )
) {
$assetMaintenance->completion_date = null;
if (( $assetMaintenance->asset_maintenance_time !== 0 )
|| ( !is_null( $assetMaintenance->asset_maintenance_time ) )
) {
$assetMaintenance->asset_maintenance_time = null;
}
}
if (( $assetMaintenance->completion_date !== "" )
&& ( $assetMaintenance->completion_date !== "0000-00-00" )
&& ( $assetMaintenance->start_date !== "" )
&& ( $assetMaintenance->start_date !== "0000-00-00" )
) {
$startDate = Carbon::parse( $assetMaintenance->start_date );
$completionDate = Carbon::parse( $assetMaintenance->completion_date );
$assetMaintenance->asset_maintenance_time = $completionDate->diffInDays( $startDate );
}
// Was the asset maintenance created?
if ($assetMaintenance->save()) {
// Redirect to the new asset maintenance page
return Redirect::to( "admin/asset_maintenances" )
->with( 'success', Lang::get( 'admin/asset_maintenances/message.create.success' ) );
}
} else {
// failure
$errors = $assetMaintenance->errors();
return Redirect::back()
->withInput()
->withErrors( $errors );
}
// Redirect to the improvement create page
return Redirect::to( 'admin/asset_maintenances/edit' )
->with( 'error', Lang::get( 'admin/asset_maintenances/message.create.error' ) )
->with( 'assetMaintenance', $assetMaintenance );
}
/**
* getDelete
*
* @param $assetMaintenanceId
*
* @return mixed
* @author Vincent Sposato <vincent.sposato@gmail.com>
* @version v1.0
*/
public function getDelete( $assetMaintenanceId )
{
// Check if the asset maintenance exists
if (is_null( $assetMaintenance = AssetMaintenance::find( $assetMaintenanceId ) )) {
// Redirect to the asset maintenance management page
return Redirect::to( 'admin/asset_maintenances' )
->with( 'error', Lang::get( 'admin/asset_maintenances/message.not_found' ) );
}
// Delete the asset maintenance
$assetMaintenance->delete();
// Redirect to the asset_maintenance management page
return Redirect::to( 'admin/asset_maintenances' )
->with( 'success', Lang::get( 'admin/asset_maintenances/message.delete.success' ) );
}
/**
* getView
*
* @param $assetMaintenanceId
*
* @return mixed
* @author Vincent Sposato <vincent.sposato@gmail.com>
* @version v1.0
*/
public function getView( $assetMaintenanceId )
{
// Check if the asset maintenance exists
if (is_null( $assetMaintenance = AssetMaintenance::find( $assetMaintenanceId ) )) {
// Redirect to the asset maintenance management page
return Redirect::to( 'admin/asset_maintenances' )
->with( 'error', Lang::get( 'admin/asset_maintenances/message.not_found' ) );
}
return View::make( 'backend/asset_maintenances/view')->with('assetMaintenance', $assetMaintenance);
}
}
+210 -211
View File
@@ -5,7 +5,6 @@ use Input;
use Lang;
use Asset;
use Supplier;
use AssetMaintenance;
use Statuslabel;
use User;
use Setting;
@@ -22,18 +21,15 @@ use Response;
use Config;
use Location;
use Log;
use DNS1D;
use DNS2D;
use Mail;
use Datatable;
use TCPDF;
use Slack;
use Manufacturer; //for embedded-create
class AssetsController extends AdminController
{
protected $qrCodeDimensions = array( 'height' => 3.5, 'width' => 3.5);
protected $barCodeDimensions = array( 'height' => 2, 'width' => 22);
/**
* Show a list of all the assets.
@@ -46,6 +42,8 @@ class AssetsController extends AdminController
return View::make('backend/hardware/index');
}
/**
* Asset create.
*
@@ -55,15 +53,29 @@ class AssetsController extends AdminController
*/
public function getCreate($model_id = null)
{
// Grab the dropdown lists
$model_list = modelList();
$statuslabel_list = statusLabelList();
$location_list = locationsList();
$manufacturer_list = manufacturerList();
$category_list = categoryList();
$supplier_list = suppliersList();
$assigned_to = usersList();
$statuslabel_types = statusTypeList();
/*
// 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')
->whereNull('deleted_at')
->lists('name', 'id');
$supplier_list = array('' => Lang::get('general.select_supplier')) + Supplier::orderBy('name', 'asc')->lists('name', 'id');
$assigned_to = array('' => Lang::get('general.select_user')) + DB::table('users')->select(DB::raw('concat(first_name," ",last_name) as full_name, id'))->whereNull('deleted_at')->lists('full_name', 'id');
$location_list = array('' => Lang::get('general.select_location')) + Location::orderBy('name', 'asc')->lists('name', 'id');
// Grab the dropdown list of status
$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);
@@ -72,9 +84,6 @@ class AssetsController extends AdminController
$view->with('assigned_to',$assigned_to);
$view->with('location_list',$location_list);
$view->with('asset',new Asset);
$view->with('manufacturer',$manufacturer_list);
$view->with('category',$category_list);
$view->with('statuslabel_types',$statuslabel_types);
if (!is_null($model_id)) {
$selected_model = Model::find($model_id);
@@ -206,25 +215,19 @@ class AssetsController extends AdminController
return Redirect::to('hardware')->with('error', Lang::get('admin/hardware/message.does_not_exist'));
}
// Grab the dropdown lists
$model_list = modelList();
$statuslabel_list = statusLabelList();
$location_list = locationsList();
$manufacturer_list = manufacturerList();
$category_list = categoryList();
$supplier_list = suppliersList();
$assigned_to = usersList();
$statuslabel_types = statusTypeList();
return View::make('backend/hardware/edit', compact('asset'))
->with('model_list',$model_list)
->with('supplier_list',$supplier_list)
->with('location_list',$location_list)
->with('statuslabel_list',$statuslabel_list)
->with('assigned_to',$assigned_to)
->with('manufacturer',$manufacturer_list)
->with('statuslabel_types',$statuslabel_types)
->with('category',$category_list);
// Grab the dropdown list of models
$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')
->lists('name', 'id');
$supplier_list = array('' => Lang::get('general.select_supplier')) + Supplier::orderBy('name', 'asc')->lists('name', 'id');
$location_list = array('' => Lang::get('general.select_location')) + Location::orderBy('name', 'asc')->lists('name', 'id');
// Grab the dropdown list of status
$statuslabel_list = Statuslabel::orderBy('name', 'asc')->lists('name', 'id');
return View::make('backend/hardware/edit', compact('asset'))->with('model_list',$model_list)->with('supplier_list',$supplier_list)->with('location_list',$location_list)->with('statuslabel_list',$statuslabel_list);
}
@@ -372,7 +375,7 @@ class AssetsController extends AdminController
}
// Get the dropdown of users and then pass it to the checkout view
$users_list = usersList();
$users_list = array('' => Lang::get('general.select_user')) + DB::table('users')->select(DB::raw('concat(last_name,", ",first_name) as full_name, id'))->whereNull('deleted_at')->orderBy('last_name', 'asc')->orderBy('first_name', 'asc')->lists('full_name', 'id');
return View::make('backend/hardware/checkout', compact('asset'))->with('users_list',$users_list);
@@ -383,51 +386,113 @@ class AssetsController extends AdminController
**/
public function postCheckout($assetId)
{
// Check if the asset exists
if (!$asset = Asset::find($assetId)) {
if (is_null($asset = Asset::find($assetId))) {
// Redirect to the asset management page with error
return Redirect::to('hardware')->with('error', Lang::get('admin/hardware/message.not_found'));
}
$assigned_to = e(Input::get('assigned_to'));
// Declare the rules for the form validation
$rules = array(
'assigned_to' => 'required|min:1',
'checkout_at' => 'required|date',
'note' => 'alpha_space',
);
// Create a new validator instance from our validation rules
$validator = Validator::make(Input::all(), $rules);
// If validation fails, we'll exit the operation now.
if ($validator->fails()) {
// Ooops.. something went wrong
return Redirect::back()->withInput()->withErrors($validator);
}
if (!$user = User::find(e(Input::get('assigned_to')))) {
// Check if the user exists
if (is_null($user = User::find($assigned_to))) {
// Redirect to the asset management page with error
return Redirect::to('hardware')->with('error', Lang::get('admin/hardware/message.user_does_not_exist'));
}
if (!$admin = Sentry::getUser()) {
return Redirect::to('hardware')->with('error', Lang::get('admin/hardware/message.admin_user_does_not_exist'));
}
// Update the asset data
$asset->assigned_to = e(Input::get('assigned_to'));
// Was the asset updated?
if($asset->save()) {
$logaction = new Actionlog();
if (Input::has('checkout_at')) {
if (Input::get('checkout_at')!= date("Y-m-d")){
$logaction->created_at = e(Input::get('checkout_at')).' 00:00:00';
}
}
if (Input::get('checkout_at')!= date("Y-m-d")){
$checkout_at = e(Input::get('checkout_at')).' 00:00:00';
} else {
$checkout_at = date("Y-m-d h:i:s");
}
if (Input::has('expected_checkin')) {
if (Input::get('expected_checkin')!= date("Y-m-d")){
$expected_checkin = e(Input::get('expected_checkin')).' 00:00:00';
$logaction->asset_id = $asset->id;
$logaction->checkedout_to = $asset->assigned_to;
$logaction->asset_type = 'hardware';
$logaction->location_id = $user->location_id;
$logaction->user_id = Sentry::getUser()->id;
$logaction->note = e(Input::get('note'));
$log = $logaction->logaction('checkout');
$data['log_id'] = $logaction->id;
$data['eula'] = $asset->getEula();
$data['first_name'] = $user->first_name;
$data['item_name'] = $asset->showAssetName();
$data['require_acceptance'] = $asset->requireAcceptance();
$settings = Setting::getSettings();
if ($settings->slack_endpoint) {
$slack_settings = [
'username' => $settings->botname,
'channel' => $settings->slack_channel,
'link_names' => true
];
$client = new \Maknz\Slack\Client($settings->slack_endpoint,$slack_settings);
try {
$client->attach([
'color' => 'good',
'fields' => [
[
'title' => 'Checked Out:',
'value' => strtoupper($logaction->asset_type).' asset <'.Config::get('app.url').'/hardware/'.$asset->id.'/view'.'|'.$asset->showAssetName().'> checked out to <'.Config::get('app.url').'/admin/users/'.$user->id.'/view|'.$user->fullName().'> by <'.Config::get('app.url').'/hardware/'.$asset->id.'/view'.'|'.Sentry::getUser()->fullName().'>.'
],
[
'title' => 'Note:',
'value' => e($logaction->note)
],
]
])->send('Asset Checked Out');
} catch (Exception $e) {
}
}
} else {
$expected_checkin = null;
}
if ($asset->checkOutToUser($user, $admin, $checkout_at, $expected_checkin, e(Input::get('note')), e(Input::get('name')))) {
if (($asset->requireAcceptance()=='1') || ($asset->getEula())) {
Mail::send('emails.accept-asset', $data, function ($m) use ($user) {
$m->to($user->email, $user->first_name . ' ' . $user->last_name);
$m->subject('Confirm asset delivery');
});
}
// Redirect to the new asset page
return Redirect::to("hardware")->with('success', Lang::get('admin/hardware/message.checkout.success'));
}
@@ -481,7 +546,6 @@ class AssetsController extends AdminController
// Update the asset data to null, since it's being checked in
$asset->assigned_to = NULL;
$asset->accepted = NULL;
// Was the asset updated?
@@ -538,20 +602,6 @@ class AssetsController extends AdminController
}
$data['log_id'] = $logaction->id;
$data['first_name'] = $user->first_name;
$data['item_name'] = $asset->showAssetName();
$data['checkin_date'] = $logaction->created_at;
$data['item_tag'] = $asset->asset_tag;
$data['note'] = $logaction->note;
if ((($asset->checkin_email()=='1')) && (!Config::get('app.lock_passwords'))) {
Mail::send('emails.checkin-asset', $data, function ($m) use ($user) {
$m->to($user->email, $user->first_name . ' ' . $user->last_name);
$m->subject('Confirm Asset Checkin');
});
}
if ($backto=='user') {
return Redirect::to("admin/users/".$return_to.'/view')->with('success', Lang::get('admin/hardware/message.checkin.success'));
} else {
@@ -610,14 +660,9 @@ class AssetsController extends AdminController
if (isset($asset->id,$asset->asset_tag)) {
if ($settings->barcode_type == 'C128'){
$content = DNS1D::getBarcodePNG(route('view/hardware', $asset->id), $settings->barcode_type,
$this->barCodeDimensions['height'],$this->barCodeDimensions['width']);
}
else{
$content = DNS2D::getBarcodePNG(route('view/hardware', $asset->id), $settings->barcode_type,
$this->qrCodeDimensions['height'],$this->qrCodeDimensions['width']);
}
$img = imagecreatefromstring(base64_decode($content));
imagepng($img);
imagedestroy($img);
@@ -648,15 +693,17 @@ class AssetsController extends AdminController
return Redirect::to('hardware')->with('error', Lang::get('admin/hardware/message.does_not_exist'));
}
// Grab the dropdown lists
$model_list = modelList();
$statuslabel_list = statusLabelList();
$location_list = locationsList();
$manufacturer_list = manufacturerList();
$category_list = categoryList();
$supplier_list = suppliersList();
$assigned_to = usersList();
$statuslabel_types = statusTypeList();
// Grab the dropdown list of models
$model_list = array('' => Lang::get('general.select_model')) + Model::lists('name', 'id');
// Grab the dropdown list of status
$statuslabel_list = Statuslabel::lists('name', 'id');
$location_list = array('' => Lang::get('general.select_location')) + Location::lists('name', 'id');
// get depreciation list
$supplier_list = array('' => Lang::get('general.select_supplier')) + Supplier::orderBy('name', 'asc')->lists('name', 'id');
$assigned_to = array('' => Lang::get('general.select_user')) + DB::table('users')->select(DB::raw('concat(first_name," ",last_name) as full_name, id'))->whereNull('deleted_at')->lists('full_name', 'id');
$asset = clone $asset_to_clone;
$asset->id = null;
@@ -664,16 +711,7 @@ class AssetsController extends AdminController
$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('statuslabel_types',$statuslabel_types)
->with('assigned_to',$assigned_to)
->with('asset',$asset)
->with('location_list',$location_list)
->with('manufacturer',$manufacturer_list)
->with('category',$category_list);
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);
}
@@ -757,7 +795,7 @@ class AssetsController extends AdminController
}
} else {
return Redirect::back()->with('error', Lang::get('admin/hardware/message.upload.nofiles'));
return Redirect::back()->with('success', Lang::get('admin/hardware/message.upload.nofiles'));
}
@@ -873,10 +911,10 @@ class AssetsController extends AdminController
$assets = Input::get('edit_asset');
$supplier_list = array('' => '') + Supplier::orderBy('name', 'asc')->lists('name', 'id');
$statuslabel_list = array('' => '') + Statuslabel::lists('name', 'id');
$location_list = array('' => '') + Location::lists('name', 'id');
$statuslabel_list = array('' => '') + Statuslabel::lists('name', 'id');
$location_list = array('' => '') + Location::lists('name', 'id');
return View::make('backend/hardware/bulk')->with('assets',$assets)->with('supplier_list',$supplier_list)->with('statuslabel_list',$statuslabel_list)->with('location_list',$location_list);
return View::make('backend/hardware/bulk')->with('assets',$assets)->with('supplier_list',$supplier_list)->with('statuslabel_list',$statuslabel_list)->with('location_list',$location_list);
}
@@ -903,7 +941,7 @@ class AssetsController extends AdminController
$assets = Input::get('bulk_edit');
if ( (Input::has('purchase_date')) || (Input::has('purchase_cost')) || (Input::has('supplier_id')) || (Input::has('order_number')) || (Input::has('warranty_months')) || (Input::has('rtd_location_id')) || (Input::has('requestable')) || (Input::has('status_id')) ) {
if ( (Input::has('purchase_date')) || (Input::has('rtd_location_id')) || (Input::has('status_id')) ) {
foreach ($assets as $key => $value) {
@@ -913,22 +951,6 @@ class AssetsController extends AdminController
$update_array['purchase_date'] = e(Input::get('purchase_date'));
}
if (Input::has('purchase_cost')) {
$update_array['purchase_cost'] = e(Input::get('purchase_cost'));
}
if (Input::has('supplier_id')) {
$update_array['supplier_id'] = e(Input::get('supplier_id'));
}
if (Input::has('order_number')) {
$update_array['order_number'] = e(Input::get('order_number'));
}
if (Input::has('warranty_months')) {
$update_array['warranty_months'] = e(Input::get('warranty_months'));
}
if (Input::has('rtd_location_id')) {
$update_array['rtd_location_id'] = e(Input::get('rtd_location_id'));
}
@@ -937,12 +959,6 @@ class AssetsController extends AdminController
$update_array['status_id'] = e(Input::get('status_id'));
}
if (Input::get('requestable')=='1') {
$update_array['requestable'] = 1;
} else {
$update_array['requestable'] = 0;
}
if (DB::table('assets')
->where('id', $key)
@@ -982,72 +998,63 @@ 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','rtd_location_id','notes','order_number','mac_address'));
$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) {
case 'Deleted':
$assets->withTrashed()->Deleted();
break;
case 'Pending':
$assets->Pending();
break;
case 'RTD':
$assets->RTD();
break;
case 'Undeployable':
$assets->Undeployable();
break;
case 'Archived':
$assets->Archived();
break;
case 'Requestable':
$assets->RequestableAssets();
break;
case 'Deployed':
$assets->Deployed();
break;
}
if (Input::has('order_number')) {
$assets->where('order_number','=',e(Input::get('order_number')));
}
$assets = $assets->orderBy('asset_tag', 'ASC')->get();
switch ($status) {
case 'Pending':
$assets->Pending();
break;
case 'RTD':
$assets->RTD();
break;
case 'Undeployable':
$assets->Undeployable();
break;
case 'Archived':
$assets->Archived();
break;
case 'Requestable':
$assets->RequestableAssets();
break;
case 'Deployed':
$assets->Deployed();
break;
case 'Deleted':
$assets->withTrashed()->Deleted();
break;
}
$actions = new \Chumper\Datatable\Columns\FunctionColumn('actions', function ($assets)
{
if ($assets->deleted_at=='') {
return '<div style=" white-space: nowrap;"><a href="'.route('clone/hardware', $assets->id).'" class="btn btn-info btn-sm" title="Clone asset"><i class="fa fa-files-o"></i></a> <a href="'.route('update/hardware', $assets->id).'" class="btn btn-warning btn-sm"><i class="fa fa-pencil icon-white"></i></a> <a data-html="false" class="btn delete-asset btn-danger btn-sm" data-toggle="modal" href="'.route('delete/hardware', $assets->id).'" data-content="'.Lang::get('admin/hardware/message.delete.confirm').'" data-title="'.Lang::get('general.delete').' '.htmlspecialchars($assets->asset_tag).'?" onClick="return false;"><i class="fa fa-trash icon-white"></i></a></div>';
} elseif ($assets->deleted_at!='') {
return '<a href="'.route('restore/hardware', $assets->id).'" class="btn btn-warning btn-sm"><i class="fa fa-recycle icon-white"></i></a>';
}
$assets = $assets->orderBy('asset_tag', 'ASC')->get();
});
$actions = new \Chumper\Datatable\Columns\FunctionColumn('actions', function ($assets)
{
if ($assets->deleted_at=='') {
return '<a href="'.route('update/hardware', $assets->id).'" class="btn btn-warning btn-sm"><i class="fa fa-pencil icon-white"></i></a> <a data-html="false" class="btn delete-asset btn-danger btn-sm" data-toggle="modal" href="'.route('delete/hardware', $assets->id).'" data-content="'.Lang::get('admin/hardware/message.delete.confirm').'" data-title="'.Lang::get('general.delete').' '.htmlspecialchars($assets->asset_tag).'?" onClick="return false;"><i class="fa fa-trash icon-white"></i></a>';
} elseif ($assets->model->deleted_at=='') {
return '<a href="'.route('restore/hardware', $assets->id).'" class="btn btn-warning btn-sm"><i class="fa fa-recycle icon-white"></i></a>';
}
});
$inout = new \Chumper\Datatable\Columns\FunctionColumn('inout', function ($assets)
{
if ($assets->assetstatus) {
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>';
}
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)
->addColumn('',function($assets)
{
return '<div class="text-center"><input type="checkbox" name="edit_asset['.$assets->id.']" class="one_required"></div>';
return '<input type="checkbox" name="edit_asset['.$assets->id.']" class="one_required">';
})
->addColumn('name',function($assets)
{
@@ -1058,7 +1065,7 @@ class AssetsController extends AdminController
return '<a title="'.$assets->asset_tag.'" href="hardware/'.$assets->id.'/view">'.$assets->asset_tag.'</a>';
})
->showColumns('serial')
->showColumns('serial')
->addColumn('model',function($assets)
{
@@ -1069,16 +1076,13 @@ class AssetsController extends AdminController
}
})
->addColumn('status',function($assets)
{
if ($assets->assigned_to!='') {
return link_to(Config::get('app.url').'/admin/users/'.$assets->assigned_to.'/view', $assets->assigneduser->fullName());
} else {
if ($assets->assetstatus) {
return $assets->assetstatus->name;
}
}
->addColumn('status',function($assets)
{
if ($assets->assigned_to!='') {
return link_to('../admin/users/'.$assets->assigned_to.'/view', $assets->assigneduser->fullName());
} else {
return $assets->assetstatus->name;
}
})
->addColumn('location',function($assets)
@@ -1097,40 +1101,35 @@ class AssetsController extends AdminController
return 'No category';
}
})
})
->addColumn('eol',function($assets)
{
return $assets->eol_date();
})
->addColumn('eol',function($assets)
{
return $assets->eol_date();
})
->addColumn('notes',function($assets)
{
return $assets->notes;
})
->addColumn('mac_address',function($assets)
{
return $assets->mac_address;
})
->addColumn('notes',function($assets)
{
return $assets->notes;
})
->addColumn('order_number',function($assets)
{
return '<a href="../hardware/?order_number='.$assets->order_number.'">'.$assets->order_number.'';
})
->addColumn('order_number',function($assets)
{
return $assets->order_number;
})
->addColumn('checkout_date',function($assets)
{
if (($assets->assigned_to!='') && ($assets->assetlog->first())) {
return $assets->assetlog->first()->created_at->format('Y-m-d');
}
->addColumn('checkout_date',function($assets)
{
if (($assets->assigned_to!='') && ($assets->assetlog->first())) {
return $assets->assetlog->first()->created_at->format('Y-m-d');
}
})
->addColumn($inout)
->addColumn($actions)
->searchColumns('name', 'asset_tag', 'serial', 'model', 'status','location','eol','checkout_date', 'inout','category','notes','order_number','mac_address')
->orderColumns('name', 'asset_tag', 'serial', 'model', 'status','location','eol','notes','order_number','checkout_date', 'inout','mac_address')
->make();
})
->addColumn($inout)
->addColumn($actions)
->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();
}
}
+10 -12
View File
@@ -36,7 +36,7 @@ class CategoriesController extends AdminController
public function getCreate()
{
// Show the page
$category_types= categoryTypeList();
$category_types= array('' => '', 'asset' => 'Asset', 'accessory' => 'Accessory');
return View::make('backend/categories/edit')->with('category',new Category)
->with('category_types',$category_types);
}
@@ -66,9 +66,8 @@ class CategoriesController extends AdminController
$category->name = e(Input::get('name'));
$category->category_type = e(Input::get('category_type'));
$category->eula_text = e(Input::get('eula_text'));
$category->use_default_eula = e(Input::get('use_default_eula', '0'));
$category->require_acceptance = e(Input::get('require_acceptance', '0'));
$category->checkin_email = e(Input::get('checkin_email', '0'));
$category->use_default_eula = e(Input::get('use_default_eula', '0'));
$category->require_acceptance = e(Input::get('require_acceptance', '0'));
$category->user_id = Sentry::getId();
// Was the asset created?
@@ -102,8 +101,8 @@ class CategoriesController extends AdminController
//$category_options = array('' => 'Top Level') + Category::lists('name', 'id');
$category_options = array('' => 'Top Level') + DB::table('categories')->where('id', '!=', $categoryId)->lists('name', 'id');
$category_types= array('' => '', 'asset' => 'Asset', 'accessory' => 'Accessory', 'consumable' => 'Consumable');
$category_types= array('' => '', 'asset' => 'Asset', 'accessory' => 'Accessory');
return View::make('backend/categories/edit', compact('category'))
->with('category_options',$category_options)
->with('category_types',$category_types);
@@ -144,9 +143,8 @@ class CategoriesController extends AdminController
$category->name = e(Input::get('name'));
$category->category_type = e(Input::get('category_type'));
$category->eula_text = e(Input::get('eula_text'));
$category->use_default_eula = e(Input::get('use_default_eula', '0'));
$category->require_acceptance = e(Input::get('require_acceptance', '0'));
$category->checkin_email = e(Input::get('checkin_email', '0'));
$category->use_default_eula = e(Input::get('use_default_eula', '0'));
$category->require_acceptance = e(Input::get('require_acceptance', '0'));
// Was the asset created?
if($category->save()) {
@@ -243,13 +241,13 @@ class CategoriesController extends AdminController
->orderColumns('name','category_type','count','acceptance','eula','actions')
->make();
}
public function getDataView($categoryID) {
$category = Category::find($categoryID);
$categoryassets = $category->assets;
$actions = new \Chumper\Datatable\Columns\FunctionColumn('actions', function ($categoryassets)
{
$actions = new \Chumper\Datatable\Columns\FunctionColumn('actions', function ($categoryassets)
{
if (($categoryassets->assigned_to !='') && ($categoryassets->assigned_to > 0)) {
return '<a href="'.route('checkin/hardware', $categoryassets->id).'" class="btn btn-primary btn-sm">'.Lang::get('general.checkin').'</a>';
} else {
@@ -1,394 +0,0 @@
<?php namespace Controllers\Admin;
use AdminController;
use Input;
use Lang;
use Redirect;
use Setting;
use DB;
use Sentry;
use Consumable;
use Str;
use Validator;
use View;
use User;
use Actionlog;
use Mail;
use Datatable;
use Slack;
use Config;
class ConsumablesController extends AdminController
{
/**
* Show a list of all the consumables.
*
* @return View
*/
public function getIndex()
{
return View::make('backend/consumables/index');
}
/**
* Consumable create.
*
* @return View
*/
public function getCreate()
{
// Show the page
$category_list = array('' => '') + DB::table('categories')->where('category_type','=','consumable')->whereNull('deleted_at')->orderBy('name','ASC')->lists('name', 'id');
return View::make('backend/consumables/edit')->with('consumable',new Consumable)->with('category_list',$category_list);
}
/**
* Consumable create form processing.
*
* @return Redirect
*/
public function postCreate()
{
// create a new model instance
$consumable = new Consumable();
$validator = Validator::make(Input::all(), $consumable->rules);
if ($validator->fails())
{
// The given data did not pass validation
return Redirect::back()->withInput()->withErrors($validator->messages());
}
else{
// Update the consumable data
$consumable->name = e(Input::get('name'));
$consumable->category_id = e(Input::get('category_id'));
$consumable->qty = e(Input::get('qty'));
$consumable->user_id = Sentry::getId();
// Was the consumable created?
if($consumable->save()) {
// Redirect to the new consumable page
return Redirect::to("admin/consumables")->with('success', Lang::get('admin/consumables/message.create.success'));
}
}
// Redirect to the consumable create page
return Redirect::to('admin/consumables/create')->with('error', Lang::get('admin/consumables/message.create.error'));
}
/**
* Consumable update.
*
* @param int $consumableId
* @return View
*/
public function getEdit($consumableId = null)
{
// Check if the consumable exists
if (is_null($consumable = Consumable::find($consumableId))) {
// Redirect to the blogs management page
return Redirect::to('admin/consumables')->with('error', Lang::get('admin/consumables/message.does_not_exist'));
}
$category_list = array('' => '') + DB::table('categories')->where('category_type','=','consumable')->whereNull('deleted_at')->orderBy('name','ASC')->lists('name', 'id');
return View::make('backend/consumables/edit', compact('consumable'))->with('category_list',$category_list);
}
/**
* Consumable update form processing page.
*
* @param int $consumableId
* @return Redirect
*/
public function postEdit($consumableId = null)
{
// Check if the blog post exists
if (is_null($consumable = Consumable::find($consumableId))) {
// Redirect to the blogs management page
return Redirect::to('admin/consumables')->with('error', Lang::get('admin/consumables/message.does_not_exist'));
}
// get the POST data
$new = Input::all();
// attempt validation
$validator = Validator::make(Input::all(), $consumable->validationRules($consumableId));
if ($validator->fails())
{
// The given data did not pass validation
return Redirect::back()->withInput()->withErrors($validator->messages());
}
// attempt validation
else {
// Update the consumable data
$consumable->name = e(Input::get('name'));
$consumable->category_id = e(Input::get('category_id'));
$consumable->qty = e(Input::get('qty'));
// Was the consumable created?
if($consumable->save()) {
// Redirect to the new consumable page
return Redirect::to("admin/consumables")->with('success', Lang::get('admin/consumables/message.update.success'));
}
}
// Redirect to the consumable management page
return Redirect::to("admin/consumables/$consumableID/edit")->with('error', Lang::get('admin/consumables/message.update.error'));
}
/**
* Delete the given consumable.
*
* @param int $consumableId
* @return Redirect
*/
public function getDelete($consumableId)
{
// Check if the blog post exists
if (is_null($consumable = Consumable::find($consumableId))) {
// Redirect to the blogs management page
return Redirect::to('admin/consumables')->with('error', Lang::get('admin/consumables/message.not_found'));
}
if ($consumable->hasUsers() > 0) {
return Redirect::to('admin/consumables')->with('error', Lang::get('admin/consumables/message.assoc_users', array('count'=> $consumable->hasUsers())));
} else {
$consumable->delete();
// Redirect to the locations management page
return Redirect::to('admin/consumables')->with('success', Lang::get('admin/consumables/message.delete.success'));
}
}
/**
* Get the consumable information to present to the consumable view page
*
* @param int $consumableId
* @return View
**/
public function getView($consumableID = null)
{
$consumable = Consumable::find($consumableID);
if (isset($consumable->id)) {
return View::make('backend/consumables/view', compact('consumable'));
} else {
// Prepare the error message
$error = Lang::get('admin/consumables/message.does_not_exist', compact('id'));
// Redirect to the user management page
return Redirect::route('consumables')->with('error', $error);
}
}
/**
* Check out the consumable to a person
**/
public function getCheckout($consumableId)
{
// Check if the consumable exists
if (is_null($consumable = Consumable::find($consumableId))) {
// Redirect to the consumable management page with error
return Redirect::to('consumables')->with('error', Lang::get('admin/consumables/message.not_found'));
}
// Get the dropdown of users and then pass it to the checkout view
$users_list = array('' => 'Select a User') + DB::table('users')->select(DB::raw('concat(last_name,", ",first_name," (",username,")") as full_name, id'))->whereNull('deleted_at')->orderBy('last_name', 'asc')->orderBy('first_name', 'asc')->lists('full_name', 'id');
return View::make('backend/consumables/checkout', compact('consumable'))->with('users_list',$users_list);
}
/**
* Check out the consumable to a person
**/
public function postCheckout($consumableId)
{
// Check if the consumable exists
if (is_null($consumable = Consumable::find($consumableId))) {
// Redirect to the consumable management page with error
return Redirect::to('consumables')->with('error', Lang::get('admin/consumables/message.not_found'));
}
$admin_user = Sentry::getUser();
$assigned_to = e(Input::get('assigned_to'));
// Declare the rules for the form validation
$rules = array(
'assigned_to' => 'required|min:1'
);
// Create a new validator instance from our validation rules
$validator = Validator::make(Input::all(), $rules);
// If validation fails, we'll exit the operation now.
if ($validator->fails()) {
// Ooops.. something went wrong
return Redirect::back()->withInput()->withErrors($validator);
}
// Check if the user exists
if (is_null($user = User::find($assigned_to))) {
// Redirect to the consumable management page with error
return Redirect::to('admin/consumables')->with('error', Lang::get('admin/consumables/message.user_does_not_exist'));
}
// Update the consumable data
$consumable->assigned_to = e(Input::get('assigned_to'));
$consumable->users()->attach($consumable->id, array(
'consumable_id' => $consumable->id,
'assigned_to' => e(Input::get('assigned_to'))));
$logaction = new Actionlog();
$logaction->consumable_id = $consumable->id;
$logaction->checkedout_to = $consumable->assigned_to;
$logaction->asset_type = 'consumable';
$logaction->location_id = $user->location_id;
$logaction->user_id = Sentry::getUser()->id;
$logaction->note = e(Input::get('note'));
$settings = Setting::getSettings();
if ($settings->slack_endpoint) {
$slack_settings = [
'username' => $settings->botname,
'channel' => $settings->slack_channel,
'link_names' => true
];
$client = new \Maknz\Slack\Client($settings->slack_endpoint,$slack_settings);
try {
$client->attach([
'color' => 'good',
'fields' => [
[
'title' => 'Checked Out:',
'value' => strtoupper($logaction->asset_type).' <'.Config::get('app.url').'/admin/consumables/'.$consumable->id.'/view'.'|'.$consumable->name.'> checked out to <'.Config::get('app.url').'/admin/users/'.$user->id.'/view|'.$user->fullName().'> by <'.Config::get('app.url').'/admin/users/'.$admin_user->id.'/view'.'|'.$admin_user->fullName().'>.'
],
[
'title' => 'Note:',
'value' => e($logaction->note)
],
]
])->send('Consumable Checked Out');
} catch (Exception $e) {
}
}
$log = $logaction->logaction('checkout');
$consumable_user = DB::table('consumables_users')->where('assigned_to','=',$consumable->assigned_to)->where('consumable_id','=',$consumable->id)->first();
$data['log_id'] = $logaction->id;
$data['eula'] = $consumable->getEula();
$data['first_name'] = $user->first_name;
$data['item_name'] = $consumable->name;
$data['checkout_date'] = $logaction->created_at;
$data['item_tag'] = '';
$data['expected_checkin'] = '';
$data['note'] = $logaction->note;
$data['require_acceptance'] = $consumable->requireAcceptance();
if (($consumable->requireAcceptance()=='1') || ($consumable->getEula())) {
Mail::send('emails.accept-asset', $data, function ($m) use ($user) {
$m->to($user->email, $user->first_name . ' ' . $user->last_name);
$m->subject('Confirm consumable delivery');
});
}
// Redirect to the new consumable page
return Redirect::to("admin/consumables")->with('success', Lang::get('admin/consumables/message.checkout.success'));
}
public function getDatatable()
{
$consumables = Consumable::select(array('id','name','qty'))
->whereNull('deleted_at')
->orderBy('created_at', 'DESC');
$consumables = $consumables->get();
$actions = new \Chumper\Datatable\Columns\FunctionColumn('actions',function($consumables)
{
return '<a href="'.route('checkout/consumable', $consumables->id).'" style="margin-right:5px;" class="btn btn-info btn-sm" '.(($consumables->numRemaining() > 0 ) ? '' : ' disabled').'>'.Lang::get('general.checkout').'</a><a href="'.route('update/consumable', $consumables->id).'" class="btn btn-warning btn-sm" style="margin-right:5px;"><i class="fa fa-pencil icon-white"></i></a><a data-html="false" class="btn delete-asset btn-danger btn-sm" data-toggle="modal" href="'.route('delete/consumable', $consumables->id).'" data-content="'.Lang::get('admin/consumables/message.delete.confirm').'" data-title="'.Lang::get('general.delete').' '.htmlspecialchars($consumables->name).'?" onClick="return false;"><i class="fa fa-trash icon-white"></i></a>';
});
return Datatable::collection($consumables)
->addColumn('name',function($consumables)
{
return link_to('admin/consumables/'.$consumables->id.'/view', $consumables->name);
})
->addColumn('qty',function($consumables)
{
return $consumables->qty;
})
->addColumn('numRemaining',function($consumables)
{
return $consumables->numRemaining();
})
->addColumn($actions)
->searchColumns('name','qty','numRemaining','actions')
->orderColumns('name','qty','numRemaining','actions')
->make();
}
public function getDataView($consumableID)
{
$consumable = Consumable::find($consumableID);
$consumable_users = $consumable->users;
return Datatable::collection($consumable_users)
->addColumn('name',function($consumable_users)
{
return link_to('/admin/users/'.$consumable_users->id.'/view', $consumable_users->fullName());
})
->make();
}
}
+18 -18
View File
@@ -15,56 +15,56 @@ class DashboardController extends AdminController
public function getIndex()
{
// Show the page
$recent_activity = Actionlog::orderBy('created_at','DESC')->take(7)->get();
$recent_activity = Actionlog::orderBy('created_at','DESC')->with('accessorylog','consumablelog','licenselog','assetlog','adminlog','userlog')->take(7)->get();
$asset_stats['total'] = Asset::Hardware()->count();
$asset_stats['rtd']['total'] = Asset::Hardware()->RTD()->count();
if ($asset_stats['rtd']['total'] > 0) {
$asset_stats['rtd']['percent'] = round(($asset_stats['rtd']['total']/$asset_stats['total']) * 100);
} else {
$asset_stats['rtd']['percent'] = 0;
}
$asset_stats['pending']['total'] = Asset::Hardware()->Pending()->count();
if ($asset_stats['pending']['total'] > 0) {
$asset_stats['pending']['percent'] = round(($asset_stats['pending']['total']/$asset_stats['total']) * 100);
} else {
$asset_stats['pending']['percent'] = 0;
}
$asset_stats['deployed']['total'] = Asset::Hardware()->Deployed()->count();
if ($asset_stats['deployed']['total'] > 0) {
$asset_stats['deployed']['percent'] = round(($asset_stats['deployed']['total']/$asset_stats['total']) * 100);
} else {
$asset_stats['deployed']['percent'] = 0;
}
$asset_stats['undeployable']['total'] = Asset::Hardware()->Undeployable()->count();
if ($asset_stats['undeployable']['total'] > 0) {
$asset_stats['undeployable']['percent'] = round(($asset_stats['undeployable']['total']/$asset_stats['total']) * 100);
} else {
$asset_stats['undeployable']['percent'] = 0;
}
$asset_stats['archived']['total'] = Asset::Hardware()->Archived()->count();
if ($asset_stats['archived']['total'] > 0) {
$asset_stats['archived']['percent'] = round(($asset_stats['archived']['total']/$asset_stats['total']) * 100);
} else {
$asset_stats['archived']['percent'] = 0;
}
return View::make('backend/dashboard')->with('asset_stats',$asset_stats)->with('recent_activity',$recent_activity);
}
+1 -1
View File
@@ -81,7 +81,7 @@ class GroupsController extends AdminController
// Was the group created?
if ($group = Sentry::getGroupProvider()->create($inputs)) {
// Redirect to the new group page
return Redirect::route('groups')->with('success', Lang::get('admin/groups/message.success.create'));
return Redirect::route('update/group', $group->id)->with('success', Lang::get('admin/groups/message.success.create'));
}
// Redirect to the new group page
+33 -52
View File
@@ -101,12 +101,6 @@ class LicensesController extends AdminController
$license->maintained = e(Input::get('maintained'));
}
if ( e(Input::get('reassignable')) == '') {
$license->reassignable = 0;
} else {
$license->reassignable = e(Input::get('reassignable'));
}
if ( e(Input::get('purchase_order')) == '') {
$license->purchase_order = '';
} else {
@@ -141,7 +135,7 @@ class LicensesController extends AdminController
// Was the license created?
if($license->save()) {
$insertedId = $license->id;
// Save the license seat data
for ($x=0; $x<$license->seats; $x++) {
@@ -414,7 +408,7 @@ class LicensesController extends AdminController
}
// Get the dropdown of users and then pass it to the checkout view
$users_list = array('' => 'Select a User') + DB::table('users')->select(DB::raw('concat(last_name,", ",first_name," (",username,")") as full_name, id'))->whereNull('deleted_at')->orderBy('last_name', 'asc')->orderBy('first_name', 'asc')->lists('full_name', 'id');
$users_list = array('' => 'Select a User') + DB::table('users')->select(DB::raw('concat(last_name,", ",first_name) as full_name, id'))->whereNull('deleted_at')->orderBy('last_name', 'asc')->orderBy('first_name', 'asc')->lists('full_name', 'id');
// Left join to get a list of assets and some other helpful info
@@ -530,7 +524,7 @@ class LicensesController extends AdminController
$logaction->asset_id = $licenseseat->license_id;
$license = License::find($licenseseat->license_id);
$license = License::find($licenseseat->license_id);
$settings = Setting::getSettings();
@@ -539,23 +533,23 @@ class LicensesController extends AdminController
$logaction->checkedout_to = NULL;
$slack_msg = strtoupper($logaction->asset_type).' license <'.Config::get('app.url').'/admin/licenses/'.$license->id.'/view'.'|'.$license->name.'> checked out to <'.Config::get('app.url').'/hardware/'.$is_asset_id->id.'/view|'.$is_asset_id->showAssetName().'> by <'.Config::get('app.url').'/admin/users/'.$user->id.'/view'.'|'.$user->fullName().'>.';
} else {
$logaction->checkedout_to = e(Input::get('assigned_to'));
$logaction->checkedout_to = e(Input::get('assigned_to'));
$slack_msg = strtoupper($logaction->asset_type).' license <'.Config::get('app.url').'/admin/licenses/'.$license->id.'/view'.'|'.$license->name.'> checked out to <'.Config::get('app.url').'/admin/users/'.$is_assigned_to->id.'/view|'.$is_assigned_to->fullName().'> by <'.Config::get('app.url').'/admin/users/'.$user->id.'/view'.'|'.$user->fullName().'>.';
}
if ($settings->slack_endpoint) {
$slack_settings = [
'username' => $settings->botname,
'channel' => $settings->slack_channel,
'link_names' => true
];
$client = new \Maknz\Slack\Client($settings->slack_endpoint,$slack_settings);
try {
$client->attach([
'color' => 'good',
@@ -569,13 +563,13 @@ class LicensesController extends AdminController
'value' => e($logaction->note)
],
]
])->send('License Checked Out');
} catch (Exception $e) {
}
}
@@ -618,7 +612,7 @@ class LicensesController extends AdminController
// Redirect to the asset management page with error
return Redirect::to('admin/licenses')->with('error', Lang::get('admin/licenses/message.not_found'));
}
$license = License::find($licenseseat->license_id);
if(!$license->reassignable) {
@@ -626,7 +620,7 @@ class LicensesController extends AdminController
Session::flash('error', 'License not reassignable.');
return Redirect::back()->withInput();
}
// Declare the rules for the form validation
$rules = array(
'note' => 'alpha_space',
@@ -648,7 +642,7 @@ class LicensesController extends AdminController
// Update the asset data
$licenseseat->assigned_to = NULL;
$licenseseat->asset_id = NULL;
$user = Sentry::getUser();
// Was the asset updated?
@@ -658,20 +652,20 @@ class LicensesController extends AdminController
$logaction->asset_type = 'software';
$logaction->note = e(Input::get('note'));
$logaction->user_id = $user->id;
$settings = Setting::getSettings();
if ($settings->slack_endpoint) {
$slack_settings = [
'username' => $settings->botname,
'channel' => $settings->slack_channel,
'link_names' => true
];
$client = new \Maknz\Slack\Client($settings->slack_endpoint,$slack_settings);
try {
$client->attach([
'color' => 'good',
@@ -684,20 +678,20 @@ class LicensesController extends AdminController
'title' => 'Note:',
'value' => e($logaction->note)
],
]
])->send('License Checked In');
} catch (Exception $e) {
}
}
$log = $logaction->logaction('checkin from');
if ($backto=='user') {
return Redirect::to("admin/users/".$return_to.'/view')->with('success', Lang::get('admin/licenses/message.checkin.success'));
@@ -811,7 +805,7 @@ class LicensesController extends AdminController
}
} else {
return Redirect::back()->with('error', Lang::get('admin/licenses/message.upload.nofiles'));
return Redirect::back()->with('success', Lang::get('admin/licenses/message.upload.nofiles'));
}
@@ -890,7 +884,7 @@ class LicensesController extends AdminController
$licenses = License::orderBy('created_at', 'DESC')->get();
$actions = new \Chumper\Datatable\Columns\FunctionColumn('actions', function($licenses) {
return '<span style="white-space: nowrap;"><a href="'.route('freecheckout/license', $licenses->id).'" class="btn btn-primary btn-sm" style="margin-right:5px;" '.(($licenses->remaincount() > 0) ? '' : 'disabled').'>'.Lang::get('general.checkout').'</a> <a href="'.route('clone/license', $licenses->id).'" class="btn btn-info btn-sm" style="margin-right:5px;" title="Clone asset"><i class="fa fa-files-o"></i></a><a href="'.route('update/license', $licenses->id).'" class="btn btn-warning btn-sm" style="margin-right:5px;"><i class="fa fa-pencil icon-white"></i></a><a data-html="false" class="btn delete-asset btn-danger btn-sm" data-toggle="modal" href="'.route('delete/license', $licenses->id).'" data-content="'.Lang::get('admin/licenses/message.delete.confirm').'" data-title="'.Lang::get('general.delete').' '.htmlspecialchars($licenses->name).'?" onClick="return false;"><i class="fa fa-trash icon-white"></i></a></span>';
return '<a href="'.route('update/license', $licenses->id).'" class="btn btn-warning btn-sm" style="margin-right:5px;"><i class="fa fa-pencil icon-white"></i></a><a data-html="false" class="btn delete-asset btn-danger btn-sm" data-toggle="modal" href="'.route('delete/license', $licenses->id).'" data-content="'.Lang::get('admin/licenses/message.delete.confirm').'" data-title="'.Lang::get('general.delete').' '.htmlspecialchars($licenses->name).'?" onClick="return false;"><i class="fa fa-trash icon-white"></i></a>';
});
return Datatable::collection($licenses)
@@ -909,22 +903,9 @@ class LicensesController extends AdminController
->addColumn('purchase_date', function($licenses) {
return $licenses->purchase_date;
})
->addColumn('notes', function($licenses) {
return $licenses->notes;
})
->addColumn($actions)
->searchColumns('name','serial','totalSeats','remaining','purchase_date','actions','notes')
->orderColumns('name','serial','totalSeats','remaining','purchase_date','actions','notes')
->searchColumns('name','serial','totalSeats','remaining','purchase_date','actions')
->orderColumns('name','serial','totalSeats','remaining','purchase_date','actions')
->make();
}
public function getFreeLicense($licenseId) {
// Check if the asset exists
if (is_null($license = License::find($licenseId))) {
// Redirect to the asset management page with error
return Redirect::to('admin/licenses')->with('error', Lang::get('admin/licenses/message.not_found'));
}
$seatId = $license->freeSeat($licenseId);
return Redirect::to('admin/licenses/'.$seatId.'/checkout');
}
}
+19 -87
View File
@@ -12,8 +12,6 @@ use Str;
use Validator;
use View;
use Symfony\Component\HttpFoundation\JsonResponse;
class LocationsController extends AdminController
{
/**
@@ -25,7 +23,7 @@ class LocationsController extends AdminController
public function getIndex()
{
// Grab all the locations
$locations = Location::orderBy('created_at', 'DESC')->with('parent','assets','assignedassets')->get();
$locations = Location::orderBy('created_at', 'DESC')->get();
// Show the page
return View::make('backend/locations/index', compact('locations'));
@@ -39,15 +37,9 @@ class LocationsController extends AdminController
*/
public function getCreate()
{
$locations = Location::orderBy('name','ASC')->get();
$location_options_array = Location::getLocationHierarchy($locations);
$location_options = Location::flattenLocationsArray($location_options_array);
$location_options = array('' => 'Top Level') + $location_options;
return View::make('backend/locations/edit')
->with('location_options',$location_options)
->with('location',new Location);
// Show the page
$location_options = array('0' => 'Top Level') + Location::lists('name', 'id');
return View::make('backend/locations/edit')->with('location_options',$location_options)->with('location',new Location);
}
@@ -70,18 +62,12 @@ class LocationsController extends AdminController
// Save the location data
$location->name = e(Input::get('name'));
if (Input::get('parent_id')=='') {
$location->parent_id = null;
} else {
$location->parent_id = e(Input::get('parent_id'));
}
$location->currency = Input::get('currency','$');
$location->address = e(Input::get('address'));
$location->address2 = e(Input::get('address2'));
$location->city = e(Input::get('city'));
$location->state = e(Input::get('state'));
$location->country = e(Input::get('country'));
$location->zip = e(Input::get('zip'));
$location->zip = e(Input::get('zip'));
$location->user_id = Sentry::getId();
// Was the asset created?
@@ -100,52 +86,6 @@ class LocationsController extends AdminController
}
public function store()
{
$new = Input::all();
$new['currency']=Setting::first()->default_currency;
// create a new location instance
$location = new Location();
// attempt validation
if ($location->validate($new)) {
// Save the location data
$location->name = e(Input::get('name'));
// if (Input::get('parent_id')=='') {
// $location->parent_id = null;
// } else {
// $location->parent_id = e(Input::get('parent_id'));
// }
$location->currency = Setting::first()->default_currency; //e(Input::get('currency'));
$location->address = ''; //e(Input::get('address'));
// $location->address2 = e(Input::get('address2'));
$location->city = e(Input::get('city'));
$location->state = '';//e(Input::get('state'));
$location->country = e(Input::get('country'));
// $location->zip = e(Input::get('zip'));
$location->user_id = Sentry::getId();
// Was the asset created?
if($location->save()) {
// Redirect to the new location page
return JsonResponse::create($location);
//return Redirect::to("admin/settings/locations")->with('success', Lang::get('admin/locations/message.create.success'));
} else {
return JsonResponse::create(["error" => "Couldn't save Location"],500);
}
} else {
// failure
$errors = $location->errors();
return JsonResponse::create(["error" => "Failed validation: ".print_r($errors->all('<li>:message</li>'),true)],500);
}
// Redirect to the location create page
return Redirect::to('admin/settings/locations/create')->with('error', Lang::get('admin/locations/message.create.error'));
}
/**
* Location update.
@@ -157,15 +97,14 @@ class LocationsController extends AdminController
{
// Check if the location exists
if (is_null($location = Location::find($locationId))) {
// Redirect to the blogs management page
return Redirect::to('admin/settings/locations')->with('error', Lang::get('admin/locations/message.does_not_exist'));
}
// Show the page
$locations = Location::orderBy('name','ASC')->get();
$location_options_array = Location::getLocationHierarchy($locations);
$location_options = Location::flattenLocationsArray($location_options_array);
$location_options = array('' => 'Top Level') + $location_options;
//$location_options = array('' => 'Top Level') + Location::lists('name', 'id');
$location_options = array('' => 'Top Level') + DB::table('locations')->where('id', '!=', $locationId)->lists('name', 'id');
return View::make('backend/locations/edit', compact('location'))->with('location_options',$location_options);
}
@@ -189,33 +128,27 @@ class LocationsController extends AdminController
if ($validator->fails())
{
// The given data did not pass validation
// The given data did not pass validation
return Redirect::back()->withInput()->withErrors($validator->messages());
}
// attempt validation
else {
// Update the location data
$location->name = e(Input::get('name'));
if (Input::get('parent_id')=='') {
$location->parent_id = null;
} else {
$location->parent_id = e(Input::get('parent_id',''));
}
$location->currency = Input::get('currency','$');
$location->name = e(Input::get('name'));
$location->address = e(Input::get('address'));
$location->address2 = e(Input::get('address2'));
$location->city = e(Input::get('city'));
$location->state = e(Input::get('state'));
$location->country = e(Input::get('country'));
$location->zip = e(Input::get('zip'));
$location->country = e(Input::get('country'));
$location->zip = e(Input::get('zip'));
// Was the asset created?
if($location->save()) {
// Redirect to the saved location page
return Redirect::to("admin/settings/locations/")->with('success', Lang::get('admin/locations/message.update.success'));
}
}
}
// Redirect to the location management page
return Redirect::to("admin/settings/locations/$locationId/edit")->with('error', Lang::get('admin/locations/message.update.error'));
@@ -237,16 +170,15 @@ class LocationsController extends AdminController
}
if ($location->users->count() > 0) {
if ($location->has_users() > 0) {
// Redirect to the asset management page
return Redirect::to('admin/settings/locations')->with('error', Lang::get('admin/locations/message.assoc_users'));
} elseif ($location->childLocations->count() > 0) {
return Redirect::to('admin/settings/locations')->with('error', Lang::get('admin/locations/message.assoc_child_loc'));
} elseif ($location->assets->count() > 0) {
return Redirect::to('admin/settings/locations')->with('error', Lang::get('admin/locations/message.assoc_assets'));
} elseif ($location->assignedassets->count() > 0) {
return Redirect::to('admin/settings/locations')->with('error', Lang::get('admin/locations/message.assoc_assets'));
} else {
$location->delete();
// Redirect to the locations management page
return Redirect::to('admin/settings/locations')->with('success', Lang::get('admin/locations/message.delete.success'));
}
+13 -68
View File
@@ -16,9 +16,6 @@ use Validator;
use View;
use Datatable;
//use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\HttpFoundation\JsonResponse;
class ModelsController extends AdminController
{
/**
@@ -40,9 +37,9 @@ class ModelsController extends AdminController
public function getCreate()
{
// Show the page
$depreciation_list = depreciationList();
$manufacturer_list = manufacturerList();
$category_list = categoryList();
$depreciation_list = array('' => 'Do Not Depreciate') + Depreciation::lists('name', 'id');
$manufacturer_list = array('' => 'Select One') + Manufacturer::lists('name', 'id');
$category_list = array('' => '') + DB::table('categories')->whereNull('deleted_at')->lists('name', 'id');
$view = View::make('backend/models/edit');
$view->with('category_list',$category_list);
$view->with('depreciation_list',$depreciation_list);
@@ -60,40 +57,14 @@ class ModelsController extends AdminController
public function postCreate()
{
// get the POST data
$new = Input::all();
// Create a new manufacturer
$model = new Model;
$validator = Validator::make(
// Validator data goes here
array(
'unique_fields' => array(Input::get('name'), Input::get('modelno'), Input::get('manufacturer_id'))
),
// Validator rules go here
array(
'unique_fields' => 'unique_multiple:models,name,modelno,manufacturer_id'
)
);
// attempt validation
if ($validator->fails())
{
// The given data did not pass validation
return Redirect::back()->withInput()->with('error', Lang::get('admin/models/message.create.duplicate_set'));;
}
$validator = Validator::make(Input::all(), $model->validationRules());
// attempt validation
if ($validator->fails())
{
// The given data did not pass validation
return Redirect::back()->withInput()->withErrors($validator->messages());
}
// attempt validation
else {
if ($model->validate($new)) {
if ( e(Input::get('depreciation_id')) == '') {
$model->depreciation_id = 0;
@@ -101,7 +72,7 @@ class ModelsController extends AdminController
$model->depreciation_id = e(Input::get('depreciation_id'));
}
if ( e(Input::get('eol')) == '') {
if ( e(Input::get('eol')) == '') {
$model->eol = 0;
} else {
$model->eol = e(Input::get('eol'));
@@ -132,6 +103,10 @@ class ModelsController extends AdminController
// Redirect to the new model page
return Redirect::to("hardware/models")->with('success', Lang::get('admin/models/message.create.success'));
}
} else {
// failure
$errors = $model->errors();
return Redirect::back()->withInput()->withErrors($errors);
}
// Redirect to the model create page
@@ -139,36 +114,6 @@ class ModelsController extends AdminController
}
public function store()
{
//COPYPASTA!!!! FIXME
$model = new Model;
$settings=Input::all();
$settings['eol']=0;
//
$validator = Validator::make($settings, $model->validationRules());
if ($validator->fails())
{
// The given data did not pass validation
return JsonResponse::create(["error" => "Failed validation: ".print_r($validator->messages()->all('<li>:message</li>'),true)],500);
} else {
$model->name=e(Input::get('name'));
$model->manufacturer_id = e(Input::get('manufacturer_id'));
$model->category_id = e(Input::get('category_id'));
$model->modelno = e(Input::get('modelno'));
$model->user_id = Sentry::getUser()->id;
$model->eol=0;
if($model->save()) {
return JsonResponse::create($model);
} else {
return JsonResponse::create(["error" => "Couldn't save Model"],500);
}
}
}
/**
* Model update.
*
@@ -185,7 +130,7 @@ class ModelsController extends AdminController
$depreciation_list = array('' => 'Do Not Depreciate') + Depreciation::lists('name', 'id');
$manufacturer_list = array('' => 'Select One') + Manufacturer::lists('name', 'id');
$category_list = array('' => '') + DB::table('categories')->whereNull('deleted_at')->lists('name', 'id');
$category_list = array('' => '') + DB::table('categories')->lists('name', 'id');
$view = View::make('backend/models/edit', compact('model'));
$view->with('category_list',$category_list);
$view->with('depreciation_list',$depreciation_list);
+186 -484
View File
@@ -1,76 +1,19 @@
<?php namespace Controllers\Admin;
use Accessory;
use Actionlog;
use AdminController;
use Asset;
use AssetMaintenance;
use Carbon\Carbon;
use Category;
use Illuminate\Support\Facades\Lang;
use Illuminate\Support\Facades\Log;
use Illuminate\Support\Facades\Response;
use Illuminate\Support\Facades\View;
use Input;
use League\Csv\Reader;
use Lang;
use License;
use Location;
use Model;
use Redirect;
use Setting;
use Asset;
use User;
use View;
use Location;
use Redirect;
use Response;
use Actionlog;
class ReportsController extends AdminController
{
/**
* Show Report for Accessories
*
* @return View
*/
public function getAccessoryReport()
{
$accessories = Accessory::orderBy('created_at', 'DESC')->get();
return View::make('backend/reports/accessories', compact('accessories'));
}
/**
* Export Accessories Report as CSV
*
* @return file download
*/
public function exportAccessoryReport()
{
$accessories = Accessory::orderBy('created_at', 'DESC')->get();
$rows = array();
$header = array(
Lang::get('admin/accessories/table.title'),
Lang::get('admin/accessories/general.accessory_category'),
Lang::get('admin/accessories/general.total'),
Lang::get('admin/accessories/general.remaining')
);
$header = array_map('trim', $header);
$rows[] = implode($header, ', ');
// Row per accessory
foreach ($accessories as $accessory) {
$row = array();
$row[] = $accessory->accessory_name;
$row[] = $accessory->accessory_category;
$row[] = $accessory->total;
$row[] = $accessory->remaining;
$rows[] = implode($row, ',');
}
$csv = implode($rows, "\n");
$response = Response::make($csv, 200);
$response->header('Content-Type', 'text/csv');
$response->header('Content-disposition', 'attachment;filename=report.csv');
return $response;
}
/**
* Show Asset Report
*
@@ -78,14 +21,9 @@ class ReportsController extends AdminController
*/
public function getAssetsReport()
{
// Grab all the assets
$assets = Asset::with( 'model', 'assigneduser.userLoc', 'assetstatus', 'defaultLoc', 'assetlog', 'supplier',
'model.manufacturer' )
->orderBy( 'created_at', 'DESC' )
->get();
return View::make( 'backend/reports/asset', compact( 'assets' ) );
$assets = Asset::with('model','assigneduser.userLoc','assetstatus','defaultLoc','assetlog','supplier','model.manufacturer')->orderBy('created_at', 'DESC')->get();
return View::make('backend/reports/asset', compact('assets'));
}
/**
@@ -95,44 +33,41 @@ class ReportsController extends AdminController
*/
public function exportAssetReport()
{
// Grab all the assets
$assets = Asset::orderBy( 'created_at', 'DESC' )
->get();
$assets = Asset::orderBy('created_at', 'DESC')->get();
$rows = [ ];
$rows = array();
// Create the header row
$header = [
Lang::get( 'admin/hardware/table.asset_tag' ),
Lang::get( 'admin/hardware/form.manufacturer' ),
Lang::get( 'admin/hardware/form.model' ),
Lang::get( 'general.model_no' ),
Lang::get( 'general.name' ),
Lang::get( 'admin/hardware/table.serial' ),
Lang::get( 'general.status' ),
Lang::get( 'admin/hardware/table.purchase_date' ),
Lang::get( 'admin/hardware/table.purchase_cost' ),
Lang::get( 'admin/hardware/form.order' ),
Lang::get( 'admin/hardware/form.supplier' ),
Lang::get( 'admin/hardware/table.checkoutto' ),
Lang::get( 'admin/hardware/table.location' ),
Lang::get( 'general.notes' ),
];
$header = array_map( 'trim', $header );
$rows[] = implode( $header, ',' );
$header = array(
Lang::get('admin/hardware/table.asset_tag'),
Lang::get('admin/hardware/form.manufacturer'),
Lang::get('admin/hardware/form.model'),
Lang::get('general.model_no'),
Lang::get('general.name'),
Lang::get('admin/hardware/table.serial'),
Lang::get('general.status'),
Lang::get('admin/hardware/table.purchase_date'),
Lang::get('admin/hardware/table.purchase_cost'),
Lang::get('admin/hardware/form.order'),
Lang::get('admin/hardware/form.supplier'),
Lang::get('admin/hardware/table.checkoutto'),
Lang::get('admin/hardware/table.location')
);
$header = array_map('trim', $header);
$rows[] = implode($header, ',');
// Create a row per asset
foreach ($assets as $asset) {
$row = [ ];
$row = array();
$row[] = $asset->asset_tag;
if ($asset->model->manufacturer) {
$row[] = $asset->model->manufacturer->name;
} else {
$row[] = '';
}
$row[] = '"' . $asset->model->name . '"';
$row[] = '"' . $asset->model->modelno . '"';
$row[] = '"'.$asset->model->name.'"';
$row[] = '"'.$asset->model->modelno.'"';
$row[] = $asset->name;
$row[] = $asset->serial;
if ($asset->assetstatus) {
@@ -141,7 +76,7 @@ class ReportsController extends AdminController
$row[] = '';
}
$row[] = $asset->purchase_date;
$row[] = '"' . number_format( $asset->purchase_cost ) . '"';
$row[] = '"'.number_format($asset->purchase_cost).'"';
if ($asset->order_number) {
$row[] = $asset->order_number;
} else {
@@ -154,21 +89,21 @@ class ReportsController extends AdminController
}
if ($asset->assigned_to > 0) {
$user = User::find( $asset->assigned_to );
$user = User::find($asset->assigned_to);
$row[] = $user->fullName();
} else {
$row[] = ''; // Empty string if unassigned
}
if (( $asset->assigned_to > 0 ) && ( $asset->assigneduser->location_id > 0 )) {
$location = Location::find( $asset->assigneduser->location_id );
if (($asset->assigned_to > 0) && ($asset->assigneduser->location_id > 0)) {
$location = Location::find($asset->assigneduser->location_id);
if ($location->name) {
$row[] = $location->name;
} else {
$row[] = '';
}
} elseif ($asset->rtd_location_id) {
$location = Location::find( $asset->rtd_location_id );
$location = Location::find($asset->rtd_location_id);
if ($location->name) {
$row[] = $location->name;
} else {
@@ -178,20 +113,14 @@ class ReportsController extends AdminController
$row[] = ''; // Empty string if location is not set
}
if ($asset->notes) {
$row[] = '"' . $asset->notes . '"';
} else {
$row[] = '';
}
$rows[] = implode( $row, ',' );
$rows[] = implode($row, ',');
}
// spit out a csv
$csv = implode( $rows, "\n" );
$response = Response::make( $csv, 200 );
$response->header( 'Content-Type', 'text/csv' );
$response->header( 'Content-disposition', 'attachment;filename=report.csv' );
$csv = implode($rows, "\n");
$response = Response::make($csv, 200);
$response->header('Content-Type', 'text/csv');
$response->header('Content-disposition', 'attachment;filename=report.csv');
return $response;
}
@@ -203,13 +132,9 @@ class ReportsController extends AdminController
*/
public function getDeprecationReport()
{
// Grab all the assets
$assets = Asset::with( 'model', 'assigneduser', 'assetstatus', 'defaultLoc', 'assetlog' )
->orderBy( 'created_at', 'DESC' )
->get();
return View::make( 'backend/reports/depreciation', compact( 'assets' ) );
$assets = Asset::with('model','assigneduser','assetstatus','defaultLoc','assetlog')->orderBy('created_at', 'DESC')->get();
return View::make('backend/reports/depreciation', compact('assets'));
}
/**
@@ -219,51 +144,45 @@ class ReportsController extends AdminController
*/
public function exportDeprecationReport()
{
// Grab all the assets
$assets = Asset::with( 'model', 'assigneduser', 'assetstatus', 'defaultLoc', 'assetlog' )
->orderBy( 'created_at', 'DESC' )
->get();
$assets = Asset::with('model','assigneduser','assetstatus','defaultLoc','assetlog')->orderBy('created_at', 'DESC')->get();
$csv = \League\Csv\Writer::createFromFileObject( new \SplTempFileObject() );
$csv->setOutputBOM( Reader::BOM_UTF16_BE );
$rows = [ ];
$rows = array();
// Create the header row
$header = [
Lang::get( 'admin/hardware/table.asset_tag' ),
Lang::get( 'admin/hardware/table.title' ),
Lang::get( 'admin/hardware/table.serial' ),
Lang::get( 'admin/hardware/table.checkoutto' ),
Lang::get( 'admin/hardware/table.location' ),
Lang::get( 'admin/hardware/table.purchase_date' ),
Lang::get( 'admin/hardware/table.purchase_cost' ),
Lang::get( 'admin/hardware/table.book_value' ),
Lang::get( 'admin/hardware/table.diff' )
];
//we insert the CSV header
$csv->insertOne( $header );
$header = array(
Lang::get('admin/hardware/table.asset_tag'),
Lang::get('admin/hardware/table.title'),
Lang::get('admin/hardware/table.serial'),
Lang::get('admin/hardware/table.checkoutto'),
Lang::get('admin/hardware/table.location'),
Lang::get('admin/hardware/table.purchase_date'),
Lang::get('admin/hardware/table.purchase_cost'),
Lang::get('admin/hardware/table.book_value'),
Lang::get('admin/hardware/table.diff')
);
$header = array_map('trim', $header);
$rows[] = implode($header, ',');
// Create a row per asset
foreach ($assets as $asset) {
$row = [ ];
$row = array();
$row[] = $asset->asset_tag;
$row[] = $asset->name;
$row[] = $asset->serial;
if ($asset->assigned_to > 0) {
$user = User::find( $asset->assigned_to );
$row[] = $user->fullName();
} else {
$user = User::find($asset->assigned_to);
$row[] = $user->fullName();
} else {
$row[] = ''; // Empty string if unassigned
}
if (( $asset->assigned_to > 0 ) && ( $asset->assigneduser->location_id > 0 )) {
$location = Location::find( $asset->assigneduser->location_id );
if (($asset->assigned_to > 0) && ($asset->assigneduser->location_id > 0)) {
$location = Location::find($asset->assigneduser->location_id);
if ($location->city) {
$row[] = $location->city . ', ' . $location->state;
$row[] = '"'.$location->city . ', ' . $location->state.'"';
} elseif ($location->name) {
$row[] = $location->name;
} else {
@@ -273,45 +192,47 @@ class ReportsController extends AdminController
$row[] = ''; // Empty string if location is not set
}
if ($asset->assetloc) {
$currency = $asset->assetloc->currency;
} else {
$currency = Setting::first()->default_currency;
}
$row[] = $asset->purchase_date;
$row[] = $currency . number_format( $asset->purchase_cost );
$row[] = $currency . number_format( $asset->getDepreciatedValue() );
$row[] = $currency . number_format( ( $asset->purchase_cost - $asset->getDepreciatedValue() ) );
$csv->insertOne( $row );
$row[] = '"'.Lang::get('general.currency').number_format($asset->purchase_cost).'"';
$row[] = '"'.Lang::get('general.currency').number_format($asset->getDepreciatedValue()).'"';
$row[] = '"-'.Lang::get('general.currency').number_format(($asset->purchase_cost - $asset->getDepreciatedValue())).'"';
$rows[] = implode($row, ',');
}
$csv->output( 'depreciation-report-' . date( 'Y-m-d' ) . '.csv' );
die;
// spit out a csv
$csv = implode($rows, "\n");
$response = Response::make($csv, 200);
$response->header('Content-Type', 'text/csv');
$response->header('Content-disposition', 'attachment;filename=report.csv');
return $response;
}
/**
/**
* Show Report for Activity
*
* @return View
*/
public function getActivityReport()
public function getActivityReport()
{
$log_actions = Actionlog::orderBy( 'created_at', 'DESC' )
->with( 'adminlog' )
->with( 'accessorylog' )
->with( 'assetlog' )
->with( 'licenselog' )
->with( 'userlog' )
->orderBy( 'created_at', 'DESC' )
->get();
return View::make( 'backend/reports/activity', compact( 'log_actions' ) );
$log_actions = Actionlog::orderBy('created_at', 'DESC')
->with('adminlog')
->with('accessorylog')
->with('assetlog')
->with('licenselog')
->with('userlog')
->orderBy('created_at','DESC')
->get();
return View::make('backend/reports/activity', compact('log_actions'));
}
/**
* Show Report for Licenses
*
@@ -319,11 +240,8 @@ class ReportsController extends AdminController
*/
public function getLicenseReport()
{
$licenses = License::orderBy( 'created_at', 'DESC' )
->get();
return View::make( 'backend/reports/licenses', compact( 'licenses' ) );
$licenses = License::orderBy('created_at', 'DESC')->get();
return View::make('backend/reports/licenses', compact('licenses'));
}
/**
@@ -333,161 +251,170 @@ class ReportsController extends AdminController
*/
public function exportLicenseReport()
{
$licenses = License::orderBy('created_at', 'DESC')->get();
$rows = array();
$header = array(
Lang::get('admin/licenses/table.title'),
Lang::get('admin/licenses/table.serial'),
Lang::get('admin/licenses/form.seats'),
Lang::get('admin/licenses/form.remaining_seats'),
Lang::get('admin/licenses/form.expiration'),
Lang::get('admin/licenses/form.date'),
Lang::get('admin/licenses/form.cost')
);
$licenses = License::orderBy( 'created_at', 'DESC' )
->get();
$rows = [ ];
$header = [
Lang::get( 'admin/licenses/table.title' ),
Lang::get( 'admin/licenses/table.serial' ),
Lang::get( 'admin/licenses/form.seats' ),
Lang::get( 'admin/licenses/form.remaining_seats' ),
Lang::get( 'admin/licenses/form.expiration' ),
Lang::get( 'admin/licenses/form.date' ),
Lang::get( 'admin/licenses/form.cost' )
];
$header = array_map( 'trim', $header );
$rows[] = implode( $header, ', ' );
$header = array_map('trim', $header);
$rows[] = implode($header, ', ');
// Row per license
foreach ($licenses as $license) {
$row = [ ];
$row = array();
$row[] = $license->name;
$row[] = $license->serial;
$row[] = $license->seats;
$row[] = $license->remaincount();
$row[] = $license->expiration_date;
$row[] = $license->purchase_date;
$row[] = '"' . number_format( $license->purchase_cost ) . '"';
$row[] = '"'.number_format($license->purchase_cost).'"';
$rows[] = implode( $row, ',' );
$rows[] = implode($row, ',');
}
$csv = implode( $rows, "\n" );
$response = Response::make( $csv, 200 );
$response->header( 'Content-Type', 'text/csv' );
$response->header( 'Content-disposition', 'attachment;filename=report.csv' );
$csv = implode($rows, "\n");
$response = Response::make($csv, 200);
$response->header('Content-Type', 'text/csv');
$response->header('Content-disposition', 'attachment;filename=report.csv');
return $response;
}
public function getCustomReport()
{
return View::make( 'backend/reports/custom' );
return View::make('backend/reports/custom');
}
public function postCustom()
{
$assets = Asset::orderBy('created_at', 'DESC')->get();
$rows = array();
$header = array();
$assets = Asset::orderBy( 'created_at', 'DESC' )
->get();
$rows = [ ];
$header = [ ];
if (e( Input::get( 'asset_name' ) ) == '1') {
if (e(Input::get('asset_name')) == '1')
{
$header[] = 'Asset Name';
}
if (e( Input::get( 'asset_tag' ) ) == '1') {
if (e(Input::get('asset_tag')) == '1')
{
$header[] = 'Asset Tag';
}
if (e( Input::get( 'manufacturer' ) ) == '1') {
if (e(Input::get('manufacturer')) == '1')
{
$header[] = 'Manufacturer';
}
if (e( Input::get( 'model' ) ) == '1') {
if (e(Input::get('model')) == '1')
{
$header[] = 'Model';
$header[] = 'Model Number';
}
if (e( Input::get( 'serial' ) ) == '1') {
if (e(Input::get('serial')) == '1')
{
$header[] = 'Serial';
}
if (e( Input::get( 'purchase_date' ) ) == '1') {
if (e(Input::get('purchase_date')) == '1')
{
$header[] = 'Purchase Date';
}
if (( e( Input::get( 'purchase_cost' ) ) == '1' ) && ( e( Input::get( 'depreciation' ) ) == '0' )) {
if ((e(Input::get('purchase_cost')) == '1') && (e(Input::get('depreciation')) == '0'))
{
$header[] = 'Purchase Cost';
}
if (e( Input::get( 'order' ) ) == '1') {
if (e(Input::get('order')) == '1')
{
$header[] = 'Order Number';
}
if (e( Input::get( 'supplier' ) ) == '1') {
if (e(Input::get('supplier')) == '1')
{
$header[] = 'Supplier';
}
if (e( Input::get( 'location' ) ) == '1') {
if (e(Input::get('location')) == '1')
{
$header[] = 'Location';
}
if (e( Input::get( 'assigned_to' ) ) == '1') {
if (e(Input::get('assigned_to')) == '1')
{
$header[] = 'Assigned To';
}
if (e( Input::get( 'status' ) ) == '1') {
if (e(Input::get('status')) == '1')
{
$header[] = 'Status';
}
if (e( Input::get( 'warranty' ) ) == '1') {
if (e(Input::get('warranty')) == '1')
{
$header[] = 'Warranty';
$header[] = 'Warranty Expires';
}
if (e( Input::get( 'depreciation' ) ) == '1') {
if (e(Input::get('depreciation')) == '1')
{
$header[] = 'Purchase Cost';
$header[] = 'Value';
$header[] = 'Diff';
}
$header = array_map( 'trim', $header );
$rows[] = implode( $header, ',' );
$header = array_map('trim', $header);
$rows[] = implode($header, ',');
foreach ($assets as $asset) {
$row = [ ];
if (e( Input::get( 'asset_name' ) ) == '1') {
foreach($assets as $asset) {
$row = array();
if (e(Input::get('asset_name')) == '1') {
$row[] = $asset->name;
}
if (e( Input::get( 'asset_tag' ) ) == '1') {
if (e(Input::get('asset_tag')) == '1') {
$row[] = $asset->asset_tag;
}
if (e( Input::get( 'manufacturer' ) ) == '1') {
if (e(Input::get('manufacturer')) == '1') {
if ($asset->model->manufacturer) {
$row[] = $asset->model->manufacturer->name;
} else {
$row[] = '';
}
}
if (e( Input::get( 'model' ) ) == '1') {
$row[] = '"' . $asset->model->name . '"';
$row[] = '"' . $asset->model->modelno . '"';
if (e(Input::get('model')) == '1') {
$row[] = '"'.$asset->model->name.'"';
$row[] = '"'.$asset->model->modelno.'"';
}
if (e( Input::get( 'serial' ) ) == '1') {
if (e(Input::get('serial')) == '1') {
$row[] = $asset->serial;
}
if (e( Input::get( 'purchase_date' ) ) == '1') {
if (e(Input::get('purchase_date')) == '1') {
$row[] = $asset->purchase_date;
}
if (e( Input::get( 'purchase_cost' ) ) == '1') {
$row[] = '"' . number_format( $asset->purchase_cost ) . '"';
if (e(Input::get('purchase_cost')) == '1') {
$row[] = '"'.number_format($asset->purchase_cost).'"';
}
if (e( Input::get( 'order' ) ) == '1') {
if (e(Input::get('order')) == '1') {
if ($asset->order_number) {
$row[] = $asset->order_number;
} else {
$row[] = '';
}
}
if (e( Input::get( 'supplier' ) ) == '1') {
if (e(Input::get('supplier')) == '1') {
if ($asset->supplier_id) {
$row[] = $asset->supplier->name;
} else {
$row[] = '';
}
}
if (e( Input::get( 'location' ) ) == '1') {
if (( $asset->assigned_to > 0 ) && ( $asset->assigneduser->location_id > 0 )) {
$location = Location::find( $asset->assigneduser->location_id );
if (e(Input::get('location')) == '1') {
if (($asset->assigned_to > 0) && ($asset->assigneduser->location_id > 0)) {
$location = Location::find($asset->assigneduser->location_id);
if ($location->name) {
$row[] = $location->name;
} else {
$row[] = '';
}
} elseif ($asset->rtd_location_id) {
$location = Location::find( $asset->rtd_location_id );
$location = Location::find($asset->rtd_location_id);
if ($location->name) {
$row[] = $location->name;
} else {
@@ -497,26 +424,26 @@ class ReportsController extends AdminController
$row[] = ''; // Empty string if location is not set
}
}
if (e( Input::get( 'assigned_to' ) ) == '1') {
if (e(Input::get('assigned_to')) == '1') {
if ($asset->assigned_to > 0) {
$user = User::find( $asset->assigned_to );
$user = User::find($asset->assigned_to);
$row[] = $user->fullName();
} else {
$row[] = ''; // Empty string if unassigned
}
}
if (e( Input::get( 'status' ) ) == '1') {
if (( $asset->status_id == '0' ) && ( $asset->assigned_to == '0' )) {
$row[] = Lang::get( 'general.ready_to_deploy' );
} elseif (( $asset->status_id == '' ) && ( $asset->assigned_to == '0' )) {
$row[] = Lang::get( 'general.pending' );
if (e(Input::get('status')) == '1') {
if (($asset->status_id == '0') && ($asset->assigned_to == '0')) {
$row[] = Lang::get('general.ready_to_deploy');
} elseif (($asset->status_id == '') && ($asset->assigned_to == '0')) {
$row[] = Lang::get('general.pending');
} elseif ($asset->assetstatus) {
$row[] = $asset->assetstatus->name;
} else {
$row[] = '';
}
}
if (e( Input::get( 'warranty' ) ) == '1') {
if (e(Input::get('warranty')) == '1') {
if ($asset->warranty_months) {
$row[] = $asset->warranty_months;
$row[] = $asset->warrantee_expires();
@@ -525,249 +452,24 @@ class ReportsController extends AdminController
$row[] = '';
}
}
if (e( Input::get( 'depreciation' ) ) == '1') {
if (e(Input::get('depreciation')) == '1') {
$depreciation = $asset->getDepreciatedValue();
$row[] = '"' . number_format( $asset->purchase_cost ) . '"';
$row[] = '"' . number_format( $depreciation ) . '"';
$row[] = '"' . number_format( $asset->purchase_cost - $depreciation ) . '"';
$row[] = '"'.number_format($asset->purchase_cost).'"';
$row[] = '"'.number_format($depreciation).'"';
$row[] = '"'.number_format($asset->purchase_cost - $depreciation).'"';
}
$rows[] = implode( $row, ',' );
$rows[] = implode($row, ',');
}
// spit out a csv
if (array_filter( $rows )) {
$csv = implode( $rows, "\n" );
$response = Response::make( $csv, 200 );
$response->header( 'Content-Type', 'text/csv' );
$response->header( 'Content-disposition', 'attachment;filename=report.csv' );
if (array_filter($rows)) {
$csv = implode($rows, "\n");
$response = Response::make($csv, 200);
$response->header('Content-Type', 'text/csv');
$response->header('Content-disposition', 'attachment;filename=report.csv');
return $response;
} else {
return Redirect::to( "reports/custom" )
->with( 'error', Lang::get( 'admin/reports/message.error' ) );
return Redirect::to("reports/custom")->with('error', Lang::get('admin/reports/message.error'));
}
}
/**
* getImprovementsReport
*
* @return mixed
* @author Vincent Sposato <vincent.sposato@gmail.com>
* @version v1.0
*/
public function getAssetMaintenancesReport()
{
// Grab all the improvements
$assetMaintenances = \AssetMaintenance::with( 'asset', 'supplier' )
->orderBy( 'created_at', 'DESC' )
->get();
return View::make( 'backend/reports/asset_maintenances', compact( 'assetMaintenances' ) );
}
/**
* exportImprovementsReport
*
* @return \Illuminate\Http\Response
* @author Vincent Sposato <vincent.sposato@gmail.com>
* @version v1.0
*/
public function exportAssetMaintenancesReport()
{
// Grab all the improvements
$assetMaintenances = AssetMaintenance::with( 'asset', 'supplier' )
->orderBy( 'created_at', 'DESC' )
->get();
$rows = [ ];
$header = [
Lang::get( 'admin/asset_maintenances/table.asset_name' ),
Lang::get( 'admin/asset_maintenances/table.supplier_name' ),
Lang::get( 'admin/asset_maintenances/form.asset_maintenance_type' ),
Lang::get( 'admin/asset_maintenances/form.title' ),
Lang::get( 'admin/asset_maintenances/form.start_date' ),
Lang::get( 'admin/asset_maintenances/form.completion_date' ),
Lang::get( 'admin/asset_maintenances/form.asset_maintenance_time' ),
Lang::get( 'admin/asset_maintenances/form.cost' )
];
$header = array_map( 'trim', $header );
$rows[] = implode( $header, ',' );
foreach ($assetMaintenances as $assetMaintenance) {
$row = [ ];
$row[] = str_replace( ',', '', $assetMaintenance->asset->name );
$row[] = str_replace( ',', '', $assetMaintenance->supplier->name );
$row[] = $assetMaintenance->improvement_type;
$row[] = $assetMaintenance->title;
$row[] = $assetMaintenance->start_date;
$row[] = $assetMaintenance->completion_date;
if (is_null( $assetMaintenance->asset_maintenance_time )) {
$improvementTime = intval( Carbon::now()
->diffInDays( Carbon::parse( $assetMaintenance->start_date ) ) );
} else {
$improvementTime = intval( $assetMaintenance->asset_maintenance_time );
}
$row[] = $improvementTime;
$row[] = Lang::get( 'general.currency' ) . number_format( $assetMaintenance->cost, 2 );
$rows[] = implode( $row, ',' );
}
// spit out a csv
$csv = implode( $rows, "\n" );
$response = Response::make( $csv, 200 );
$response->header( 'Content-Type', 'text/csv' );
$response->header( 'Content-disposition', 'attachment;filename=report.csv' );
return $response;
}
/**
* getAssetAcceptanceReport
*
* @return mixed
* @author Vincent Sposato <vincent.sposato@gmail.com>
* @version v1.0
*/
public function getAssetAcceptanceReport()
{
$assetsForReport = Asset::notYetAccepted()
->get();
return View::make( 'backend/reports/unaccepted_assets', compact( 'assetsForReport' ) );
}
/**
* exportAssetAcceptanceReport
*
* @return \Illuminate\Http\Response
* @author Vincent Sposato <vincent.sposato@gmail.com>
* @version v1.0
*/
public function exportAssetAcceptanceReport()
{
// Grab all the improvements
$assetsForReport = Actionlog::whereIn( 'id', $this->getAssetsNotAcceptedYet() )
->get();
$rows = [ ];
$header = [
Lang::get( 'general.category' ),
Lang::get( 'admin/hardware/form.model' ),
Lang::get( 'admin/hardware/form.name' ),
Lang::get( 'admin/hardware/table.asset_tag' ),
Lang::get( 'admin/hardware/table.checkoutto' ),
];
$header = array_map( 'trim', $header );
$rows[] = implode( $header, ',' );
foreach ($assetsForReport as $assetItem) {
$row = [ ];
$row[] = str_replace( ',', '', $assetItem->assetlog->model->category->name );
$row[] = str_replace( ',', '', $assetItem->assetlog->model->name );
$row[] = str_replace( ',', '', $assetItem->assetlog->showAssetName() );
$row[] = str_replace( ',', '', $assetItem->assetlog->asset_tag );
$row[] = str_replace( ',', '', $assetItem->assetlog->assigneduser->fullName() );
$rows[] = implode( $row, ',' );
}
// spit out a csv
$csv = implode( $rows, "\n" );
$response = Response::make( $csv, 200 );
$response->header( 'Content-Type', 'text/csv' );
$response->header( 'Content-disposition', 'attachment;filename=report.csv' );
return $response;
}
/**
* getCheckedOutAssetsRequiringAcceptance
*
* @param $modelsInCategoriesThatRequireAcceptance
*
* @return array
* @author Vincent Sposato <vincent.sposato@gmail.com>
* @version v1.0
*/
protected function getCheckedOutAssetsRequiringAcceptance( $modelsInCategoriesThatRequireAcceptance )
{
return array_pluck( Asset::deployed()
->inModelList( $modelsInCategoriesThatRequireAcceptance )
->select( 'id' )
->get()
->toArray(), 'id' );
}
/**
* getModelsInCategoriesThatRequireAcceptance
*
* @param $assetCategoriesRequiringAcceptance
*
* @return array
* @author Vincent Sposato <vincent.sposato@gmail.com>
* @version v1.0
*/
protected function getModelsInCategoriesThatRequireAcceptance( $assetCategoriesRequiringAcceptance )
{
return array_pluck( Model::inCategory( $assetCategoriesRequiringAcceptance )
->select( 'id' )
->get()
->toArray(), 'id' );
}
/**
* getCategoriesThatRequireAcceptance
*
* @return array
* @author Vincent Sposato <vincent.sposato@gmail.com>
* @version v1.0
*/
protected function getCategoriesThatRequireAcceptance()
{
return array_pluck( Category::requiresAcceptance()
->select( 'id' )
->get()
->toArray(), 'id' );
}
/**
* getAssetsCheckedOutRequiringAcceptance
*
* @return array
* @author Vincent Sposato <vincent.sposato@gmail.com>
* @version v1.0
*/
protected function getAssetsCheckedOutRequiringAcceptance()
{
return $this->getCheckedOutAssetsRequiringAcceptance(
$this->getModelsInCategoriesThatRequireAcceptance( $this->getCategoriesThatRequireAcceptance() )
);
}
/**
* getAssetsNotAcceptedYet
*
* @return array
* @author Vincent Sposato <vincent.sposato@gmail.com>
* @version v1.0
*/
protected function getAssetsNotAcceptedYet()
{
return Asset::unaccepted();
}
}
@@ -12,7 +12,6 @@ use Validator;
use View;
use Image;
use Config;
use Response;
class SettingsController extends AdminController
{
@@ -72,7 +71,6 @@ class SettingsController extends AdminController
"logo" => 'mimes:jpeg,bmp,png,gif',
"alert_email" => 'email',
"slack_endpoint" => 'url',
"default_currency" => 'required',
"slack_channel" => 'regex:/(?<!\w)#\w+/',
"slack_botname" => 'alpha_dash',
);
@@ -119,7 +117,6 @@ class SettingsController extends AdminController
$setting->qr_code = e(Input::get('qr_code', '0'));
$setting->barcode_type = e(Input::get('barcode_type'));
$setting->load_remote = e(Input::get('load_remote', '0'));
$setting->default_currency = Input::get('default_currency', '$');
$setting->qr_text = e(Input::get('qr_text'));
$setting->auto_increment_prefix = e(Input::get('auto_increment_prefix'));
$setting->auto_increment_assets = e(Input::get('auto_increment_assets', '0'));
@@ -144,63 +141,6 @@ class SettingsController extends AdminController
}
/**
* Generate the backup page
*
* @return View
**/
public function getBackups()
{
$path = Config::get('backup::path');
$files = array();
if ($handle = opendir($path)) {
/* This is the correct way to loop over the directory. */
while (false !== ($entry = readdir($handle))) {
clearstatcache();
if (substr(strrchr($entry,'.'),1)=='zip') {
$files[] = array(
'filename' => $entry,
'filesize' => Setting::fileSizeConvert(filesize(Config::get('backup::path').$entry)),
'modified' => filemtime(Config::get('backup::path').$entry)
);
}
}
closedir($handle);
}
return View::make('backend/settings/backups', compact('path','files'));
}
/**
* Download the dump file
*
* @param int $assetId
* @return View
**/
public function downloadFile($filename = null)
{
$file = Config::get('backup::path').'/'.$filename;
// the license is valid
if (file_exists($file)) {
return Response::download($file);
} else {
// Prepare the error message
$error = Lang::get('admin/settings/message.does_not_exist');
// Redirect to the licence management page
return Redirect::route('settings/backups')->with('error', $error);
}
}
}
@@ -12,8 +12,6 @@ use Str;
use Validator;
use View;
use Symfony\Component\HttpFoundation\JsonResponse;
class StatuslabelsController extends AdminController
{
/**
@@ -42,7 +40,8 @@ class StatuslabelsController extends AdminController
// Show the page
$statuslabel = new Statuslabel;
$use_statuslabel_type = $statuslabel->getStatuslabelType();
$statuslabel_types = statusTypeList();
$statuslabel_types = array('' => Lang::get('admin/hardware/form.select_statustype')) + array('undeployable' => Lang::get('admin/hardware/general.undeployable')) + array('pending' => Lang::get('admin/hardware/general.pending')) + array('archived' => Lang::get('admin/hardware/general.archived')) + array('deployable' => Lang::get('admin/hardware/general.deployable'));
return View::make('backend/statuslabels/edit', compact('statuslabel_types','statuslabel'))->with('use_statuslabel_type',$use_statuslabel_type);
}
@@ -91,44 +90,6 @@ class StatuslabelsController extends AdminController
}
public function store()
{
// get the POST data
$new = Input::all();
$new['statuslabel_types']="deployable";
// create a new model instance
$statuslabel = new Statuslabel();
$statustype = Statuslabel::getStatuslabelTypesForDB(Input::get('statuslabel_types'));
// attempt validation
if ($statuslabel->validate($new)) {
//$statustype = Statuslabel::getStatuslabelTypesForDB(Input::get('statuslabel_types'));
// Save the Statuslabel data
$statuslabel->name = e(Input::get('name'));
$statuslabel->user_id = Sentry::getId();
$statuslabel->notes = '';
$statuslabel->deployable = $statustype['deployable'];
$statuslabel->pending = $statustype['pending'];
$statuslabel->archived = $statustype['archived'];
// Was the asset created?
if($statuslabel->save()) {
// Redirect to the new Statuslabel page
return JsonResponse::create($statuslabel);
} else {
return JsonResponse::create(["error" => "Couldn't save Statuslabel"],500);
}
} else {
// failure
$errors = $statuslabel->errors();
return JsonResponse::create(["error" => "Failed validation: ".print_r($errors->all('<li>:message</li>'),true)],500);
}
}
/**
* Statuslabel update.
@@ -2,7 +2,6 @@
use AdminController;
use Image;
use AssetMaintenance;
use Input;
use Lang;
use Supplier;
@@ -13,9 +12,6 @@ use Str;
use Validator;
use View;
use Symfony\Component\HttpFoundation\JsonResponse;
class SuppliersController extends AdminController
{
/**
@@ -103,26 +99,6 @@ class SuppliersController extends AdminController
return Redirect::to('admin/settings/suppliers/create')->with('error', Lang::get('admin/suppliers/message.create.error'));
}
public function store()
{
$supplier=new Supplier;
$new=Input::all();
$validator = Validator::make($new, $supplier->validationRules());
if($validator->fails()) {
return JsonResponse::create(["error" => "Failed validation: ".print_r($validator->messages()->all('<li>:message</li>'),true)],500);
} else {
//$supplier->fill($new);
$supplier->name=$new['name'];
$supplier->user_id = Sentry::getId();
if($supplier->save()) {
return JsonResponse::create($supplier);
} else {
return JsonResponse::create(["error" => "Couldn't save Supplier"]);
}
}
}
/**
* Supplier update.
File diff suppressed because it is too large Load Diff
@@ -17,13 +17,13 @@ class AddAccessoriesTable extends Migration {
$table->increments('id');
$table->string('name')->nullable()->default(NULL);
$table->integer('category_id')->nullable()->default(NULL);
$table->integer('user_id')->nullable()->default(NULL);
$table->integer('qty')->default(0);
$table->boolean('requestable')->default(0);
$table->integer('user_id')->nullable()->default(NULL);
$table->integer('qty')->default(0);
$table->boolean('requestable')->default(0);
$table->timestamps();
$table->softDeletes();
});
Schema::table('asset_logs', function ($table) {
$table->integer('accessory_id')->nullable()->default(NULL);
});
@@ -39,7 +39,7 @@ class AddAccessoriesTable extends Migration {
{
//
Schema::drop('accessories');
Schema::table('asset_logs', function ($table) {
$table->dropColumn('accessory_id');
});
@@ -13,18 +13,18 @@ class UpdateAcceptedAtToAcceptanceId extends Migration {
public function up()
{
//
Schema::table('asset_logs', function ($table) {
$table->integer('accepted_id')->nullable()->default(NULL);
});
$results = DB::select('select invitation.id AS invitation_id, acceptance.id AS acceptance_id FROM asset_logs invitation INNER JOIN asset_logs acceptance ON (invitation.checkedout_to=acceptance.checkedout_to AND invitation.asset_id=acceptance.asset_id) WHERE invitation.action_type="checkout" AND acceptance.action_type="accepted"');
foreach ($results as $result) {
$update = DB::update('update asset_logs set accepted_id=? where id=?', [$result->acceptance_id, $result->invitation_id]);
$update = DB::update('update asset_logs set accepted_id=? where id=?', [$result->acceptance_id, $result->invitation_id]);
}
}
/**
@@ -38,7 +38,7 @@ class UpdateAcceptedAtToAcceptanceId extends Migration {
Schema::table('asset_logs', function ($table) {
$table->dropColumn('accepted_id');
});
}
}
@@ -1,36 +0,0 @@
<?php
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class AddParentIdToLocationsTable extends Migration {
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('locations', function(Blueprint $table)
{
//
$table->integer('parent_id')->nullable()->default(NULL);
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('locations', function(Blueprint $table)
{
//
$table->dropColumn('parent_id');
});
}
}
@@ -1,29 +0,0 @@
<?php
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class FixDefaultForUserNotes extends Migration {
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
DB::statement('ALTER TABLE `'.DB::getTablePrefix().'users` MODIFY `notes` varchar(255) DEFAULT NULL;');
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
//
DB::statement('ALTER TABLE `'.DB::getTablePrefix().'users` MODIFY `notes` varchar(255);');
}
}
@@ -1,63 +0,0 @@
<?php
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateConsumables extends Migration {
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
//
Schema::create('consumables', function ($table) {
$table->increments('id');
$table->string('name')->nullable()->default(NULL);
$table->integer('category_id')->nullable()->default(NULL);
$table->integer('location_id')->nullable()->default(NULL);
$table->integer('user_id')->nullable()->default(NULL);
$table->integer('qty')->default(0);
$table->boolean('requestable')->default(0);
$table->timestamps();
$table->softDeletes();
});
Schema::table('asset_logs', function ($table) {
$table->integer('consumable_id')->nullable()->default(NULL);
});
Schema::create('consumables_users', function ($table) {
$table->increments('id');
$table->integer('user_id')->nullable()->default(NULL);
$table->integer('consumable_id')->nullable()->default(NULL);
$table->integer('assigned_to')->nullable()->default(NULL);
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
//
Schema::drop('consumables');
Schema::table('asset_logs', function ($table) {
$table->dropColumn('consumable_id');
});
Schema::drop('consumables_users');
}
}
@@ -1,30 +0,0 @@
<?php
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class MoveEmailToUsername extends Migration {
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
//
DB::update('UPDATE `'.DB::getTablePrefix().'users` SET `username`=`email`');
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
//
//DB::statement('ALTER TABLE `users` MODIFY `notes` varchar(255);');
}
}
@@ -1,31 +0,0 @@
<?php
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class MakeEmailNullable extends Migration {
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
DB::statement('ALTER TABLE `'.DB::getTablePrefix().'users` MODIFY `email` varchar(255) DEFAULT NULL;');
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
//
DB::statement('ALTER TABLE `'.DB::getTablePrefix().'users` MODIFY `email` varchar(255) NOT NULL;');
}
}
@@ -1,65 +0,0 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Lang;
class CreateAssetMaintenancesTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create( 'asset_maintenances', function ( Blueprint $table ) {
$table->increments( 'id' );
$table->integer( 'asset_id' )
->unsigned();
$table->integer( 'supplier_id' )
->unsigned();
$table->enum( 'asset_maintenance_type', $this->getEnumFields() );
$table->string( 'title', 100 );
$table->boolean( 'is_warranty' );
$table->date( 'start_date' );
$table->date( 'completion_date' )
->nullable();
$table->integer( 'asset_maintenance_time' )
->nullable();
$table->longText( 'notes' )
->nullable();
$table->decimal( 'cost', 10, 2 )
->nullable();
$table->dateTime( 'deleted_at' )
->nullable();
$table->timestamps();
} );
}
protected function getEnumFields()
{
return [
Lang::get( 'admin/asset_maintenances/general.maintenance' ),
Lang::get( 'admin/asset_maintenances/general.repair' ),
Lang::get( 'admin/asset_maintenances/general.upgrade' )
];
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists( 'asset_maintenances' );
}
}
@@ -1,56 +0,0 @@
<?php
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class AddCurrencyToSettingsAndLocations extends Migration {
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('settings', function(Blueprint $table)
{
$table->string('default_currency',10)->nullable()->default(NULL);
});
DB::update('UPDATE `'.DB::getTablePrefix().'settings` SET `default_currency`="'. Lang::get('general.currency').'"');
Schema::table('locations', function(Blueprint $table)
{
$table->string('currency',10)->nullable()->default(NULL);
});
DB::update('UPDATE `'.DB::getTablePrefix().'locations` SET `currency`="'. Lang::get('general.currency').'"');
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
//
Schema::table('settings', function(Blueprint $table)
{
//
$table->dropColumn('default_currency');
});
Schema::table('locations', function(Blueprint $table)
{
//
$table->dropColumn('currency');
});
}
}
@@ -1,37 +0,0 @@
<?php
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class AddExpectedCheckinDateToAssetLogs extends Migration {
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('asset_logs', function ($table) {
$table->date('expected_checkin')->nullable()->default(NULL);
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('asset_logs', function(Blueprint $table)
{
$table->dropColumn('expected_checkin');
});
}
}
@@ -1,32 +0,0 @@
<?php
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class AddCheckinEmailToCategoryTable extends Migration {
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('categories', function ($table) {
$table->boolean('checkin_email')->default(0);
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('categories', function ($table) {
$table->dropColumn('checkin_email');
});
}
}
@@ -1,31 +0,0 @@
<?php
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class RemoveEmailUniqueConstraint extends Migration {
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('users', function(Blueprint $table)
{
$table->dropUnique('users_email_unique');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
//
}
}
@@ -1,210 +0,0 @@
<?php
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class AddThreadIdToAssetLogsTable extends Migration
{
/**
* currentAssetId
*
* @var int
*/
protected $currentAssetId = null;
/**
* currentAssetLogId
*
* @var int
*/
protected $currentAssetLogId = null;
/**
* assetLogs
*
* @var array
*/
protected $assetLogs = null;
/**
* startOfCurrentThread
*
* @var bool
*/
protected $startOfCurrentThread = true;
/**
* threadStartingActionTypes
*
* @var array
*/
protected $threadStartingActionTypes = [ 'checkout', 'requested' ];
/**
* threadFinalActionTypes
*
* @var array
*/
protected $threadFinalActionTypes = [ 'checkin from' ];
/**
* actionlog
*
* @var \Actionlog
*/
private $actionlog;
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table( 'asset_logs', function ( Blueprint $table ) {
$table->integer( 'thread_id' )
->nullable()
->default( null );
$table->index( 'thread_id' );
} );
$this->actionlog = new Actionlog();
$this->assetLogs = $this->actionlog->getListingOfActionLogsChronologicalOrder();
foreach ($this->assetLogs as $assetLog) {
if ($this->hasAssetChanged( $assetLog )) {
$this->resetCurrentAssetInformation( $assetLog );
}
if ($this->hasBegunNewChain( $assetLog )) {
$this->startOfCurrentThread = false;
continue;
}
$this->updateAssetLogWithThreadInformation( $assetLog );
if ($this->hasReachedEndOfChain( $assetLog )
) {
$this->clearCurrentAssetInformation();
}
}
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table( 'asset_logs', function ( Blueprint $table ) {
$table->dropIndex( 'thread_id' );
$table->dropColumn( 'thread_id' );
} );
}
/**
* hasAssetChanged
*
* @param $assetLog
*
* @return bool
* @author Vincent Sposato <vincent.sposato@gmail.com>
* @version v1.0
*/
protected function hasAssetChanged( $assetLog )
{
return $assetLog->asset_id !== $this->currentAssetId;
}
/**
* resetCurrentAssetInformation
*
* @param $assetLog
*
* @author Vincent Sposato <vincent.sposato@gmail.com>
* @version v1.0
*/
protected function resetCurrentAssetInformation( $assetLog )
{
$this->currentAssetId = $assetLog->asset_id;
$this->currentAssetLogId = $assetLog->id;
$this->startOfCurrentThread = true;
}
/**
* hasReachedEndOfChain
*
* @param $assetLog
*
* @return bool
* @author Vincent Sposato <vincent.sposato@gmail.com>
* @version v1.0
*/
protected function hasReachedEndOfChain( $assetLog )
{
return in_array( $assetLog->action_type, $this->threadFinalActionTypes )
&& $this->startOfCurrentThread == false;
}
/**
* clearCurrentAssetInformation
* @author Vincent Sposato <vincent.sposato@gmail.com>
* @version v1.0
*/
protected function clearCurrentAssetInformation()
{
$this->startOfCurrentThread = true;
$this->currentAssetLogId = null;
$this->currentAssetId = null;
}
/**
* updateAssetLogWithThreadInformation
*
* @param $assetLog
*
* @author Vincent Sposato <vincent.sposato@gmail.com>
* @version v1.0
*/
protected function updateAssetLogWithThreadInformation( $assetLog )
{
$loadedAssetLog = Actionlog::find( $assetLog->id );
$loadedAssetLog->thread_id = $this->currentAssetLogId;
$loadedAssetLog->update();
unset( $loadedAssetLog );
}
/**
* hasBegunNewChain
*
* @param $assetLog
*
* @return bool
* @author Vincent Sposato <vincent.sposato@gmail.com>
* @version v1.0
*/
protected function hasBegunNewChain( $assetLog )
{
return in_array( $assetLog->action_type, $this->threadStartingActionTypes )
&& $this->startOfCurrentThread == true;
}
}
@@ -1,34 +0,0 @@
<?php
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class AddAcceptedToAssets extends Migration {
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('assets', function(Blueprint $table)
{
$table->enum('accepted',["pending","accepted","rejected"])->nullable();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('assets', function(Blueprint $table)
{
$table->dropColumn('accepted');
});
}
}
+7 -7
View File
@@ -72,7 +72,7 @@ class AssetsSeeder extends Seeder
'assigned_to' => NULL,
'physical' => 1,
'archived' => 0,
'status_id' => 2,
'status_id' => 2,
'notes' => '',
'deleted_at' => NULL,
'archived' => '0',
@@ -139,7 +139,7 @@ class AssetsSeeder extends Seeder
'created_at' => $date->modify('-10 day'),
'updated_at' => $date->modify('-3 day'),
'user_id' => 2,
'assigned_to' => 1,
'assigned_to' => 2,
'physical' => 1,
'archived' => 0,
'status_id' => 1,
@@ -162,10 +162,10 @@ class AssetsSeeder extends Seeder
'created_at' => $date->modify('-10 day'),
'updated_at' => $date->modify('-3 day'),
'user_id' => 2,
'assigned_to' => 1,
'assigned_to' => 2,
'physical' => 1,
'archived' => 0,
'status_id' => 1,
'status_id' => 1,
'notes' => '',
'deleted_at' => NULL,
'archived' => '0',
@@ -211,7 +211,7 @@ class AssetsSeeder extends Seeder
'assigned_to' => NULL,
'physical' => 1,
'archived' => 0,
'status_id' => '2',
'status_id' => '2',
'notes' => '',
'deleted_at' => NULL,
'archived' => '0',
@@ -234,7 +234,7 @@ class AssetsSeeder extends Seeder
'assigned_to' => NULL,
'physical' => 1,
'archived' => 1,
'status_id' => '2',
'status_id' => '4',
'notes' => '',
'deleted_at' => NULL,
'archived' => '0',
@@ -257,7 +257,7 @@ class AssetsSeeder extends Seeder
'assigned_to' => NULL,
'physical' => 1,
'archived' => 1,
'status_id' => '2',
'status_id' => '3',
'notes' => '',
'deleted_at' => NULL,
'archived' => '0',
+10 -79
View File
@@ -1,87 +1,18 @@
<?php
/*
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
function ParseFloat($floatString){
function ParseFloat($floatString){
// use comma for thousands until local info is property used
$LocaleInfo = localeconv();
$floatString = str_replace("," , "", $floatString);
$floatString = str_replace($LocaleInfo["decimal_point"] , ".", $floatString);
return floatval($floatString);
}
function modelList() {
$model_list = array('' => Lang::get('general.select_model')) + DB::table('models')
->select(DB::raw('IF (modelno="" OR modelno IS NULL,name,concat(name, " / ",modelno)) as name, id'))
->orderBy('name', 'asc')
->whereNull('deleted_at')
->lists('name', 'id');
return $model_list;
}
function categoryList() {
$category_list = array('' => '') + DB::table('categories')
->whereNull('deleted_at')
->orderBy('name', 'asc')
->lists('name', 'id');
return $category_list;
}
function suppliersList() {
$supplier_list = array('' => Lang::get('general.select_supplier')) + Supplier::orderBy('name', 'asc')
->orderBy('name', 'asc')
->lists('name', 'id');
return $supplier_list;
}
function statusLabelList() {
$statuslabel_list = Statuslabel::orderBy('name', 'asc')
->lists('name', 'id');
return $statuslabel_list;
}
function locationsList() {
$location_list = array('' => Lang::get('general.select_location')) + Location::orderBy('name', 'asc')
->lists('name', 'id');
return $location_list;
}
function manufacturerList() {
$manufacturer_list = array('' => 'Select One') + Manufacturer::orderBy('name', 'asc')
->lists('name', 'id');
return $manufacturer_list;
}
function statusTypeList() {
$statuslabel_types = array('' => Lang::get('admin/hardware/form.select_statustype')) + array('undeployable' => Lang::get('admin/hardware/general.undeployable')) + array('pending' => Lang::get('admin/hardware/general.pending')) + array('archived' => Lang::get('admin/hardware/general.archived')) + array('deployable' => Lang::get('admin/hardware/general.deployable'));
return $statuslabel_types;
}
function managerList() {
$manager_list = array('' => '') + DB::table('users')
->select(DB::raw('concat(last_name,", ",first_name," (",username,")") as full_name, id'))
->whereNull('deleted_at', 'and')
->orderBy('last_name', 'asc')
->orderBy('first_name', 'asc')
->lists('full_name', 'id');
return $manager_list;
}
function depreciationList() {
$depreciation_list = array('' => 'Do Not Depreciate') + Depreciation::orderBy('name', 'asc')->lists('name', 'id');
return $depreciation_list;
}
function categoryTypeList() {
$category_types= array('' => '','accessory' => 'Accessory', 'asset' => 'Asset', 'consumable' => 'Consumable');
return $category_types;
}
function usersList() {
$users_list = array('' => Lang::get('general.select_user')) + DB::table('users')->select(DB::raw('concat(last_name,", ",first_name," (",username,")") as full_name, id'))->whereNull('deleted_at')->orderBy('last_name', 'asc')->orderBy('first_name', 'asc')->lists('full_name', 'id');
return $users_list;
}
//$thousands = isset($LocaleInfo["mon_thousands_sep"]) ? $LocaleInfo["mon_thousands_sep"] : ",";
//$floatString = str_replace($LocaleInfo["mon_thousands_sep"] , "", $floatString);
//$floatString = str_replace($LocaleInfo["decimal_point"] , ".", $floatString);
$floatString = str_replace("," , "", $floatString);
$floatString = str_replace($LocaleInfo["decimal_point"] , ".", $floatString);
return floatval($floatString);
}
+2 -3
View File
@@ -5,7 +5,6 @@ return array(
'undeployable' => '<strong>Warning: </strong> This asset has been marked as currently undeployable.
If this status has changed, please update the asset status.',
'does_not_exist' => 'Asset does not exist.',
'does_not_exist_or_not_requestable' => 'Nice try. That asset does not exist or is not requestable.',
'assoc_users' => 'This asset is currently checked out to a user and cannot be deleted. Please check the asset in first, and then try deleting again. ',
'create' => array(
@@ -23,7 +22,7 @@ return array(
'error' => 'Asset was not restored, please try again',
'success' => 'Asset restored successfully.'
),
'deletefile' => array(
'error' => 'File not deleted. Please try again.',
'success' => 'File successfully deleted.',
@@ -32,7 +31,7 @@ return array(
'upload' => array(
'error' => 'File(s) not uploaded. Please try again.',
'success' => 'File(s) successfully uploaded.',
'nofiles' => 'You did not select any files for upload, or the file you are trying to upload is too large',
'nofiles' => 'You did not select any files for upload',
'invalidfiles' => 'One or more of your files is too large or is a filetype that is not allowed. Allowed filetypes are png, gif, jpg, doc, docx, pdf, and txt.',
),
-1
View File
@@ -18,6 +18,5 @@ return array(
'serial' => 'Serial',
'status' => 'Status',
'title' => 'Asset ',
'days_without_acceptance' => 'Days Without Acceptance'
);
+1 -1
View File
@@ -22,7 +22,7 @@ return array(
'upload' => array(
'error' => 'File(s) not uploaded. Please try again.',
'success' => 'File(s) successfully uploaded.',
'nofiles' => 'You did not select any files for upload, or the file you are trying to upload is too large',
'nofiles' => 'You did not select any files for upload',
'invalidfiles' => 'One or more of your files is too large or is a filetype that is not allowed. Allowed filetypes are png, gif, jpg, doc, docx, pdf, and txt.',
),
-2
View File
@@ -4,8 +4,6 @@ return array(
'does_not_exist' => 'Location does not exist.',
'assoc_users' => 'This location is currently associated with at least one user and cannot be deleted. Please update your users to no longer reference this location and try again. ',
'assoc_assets' => 'This location is currently associated with at least one asset and cannot be deleted. Please update your assets to no longer reference this location and try again. ',
'assoc_child_loc' => 'This location is currently the parent of at least one child location and cannot be deleted. Please update your locations to no longer reference this location and try again. ',
'create' => array(
+2 -3
View File
@@ -8,8 +8,7 @@ return array(
'create' => array(
'error' => 'Model was not created, please try again.',
'success' => 'Model created successfully.',
'duplicate_set' => 'An asset model with that name, manufacturer and model number already exists.',
'success' => 'Model created successfully.'
),
'update' => array(
@@ -22,7 +21,7 @@ return array(
'error' => 'There was an issue deleting the model. Please try again.',
'success' => 'The model was deleted successfully.'
),
'restore' => array(
'error' => 'Model was not restored, please try again',
'success' => 'Model restored successfully.'
-2
View File
@@ -10,8 +10,6 @@ return array(
'filetype_info' => 'Allowed filetypes are png, gif, jpg, jpeg, doc, docx, pdf, txt, zip, and rar.',
'history_user' => 'الأرشيف الخاص بـ :name',
'last_login' => 'آخر دخول للمستخدم',
'ldap_config_text' => 'LDAP configuration settings can be found in the app/config folder in a file called ldap.php',
'ldap_text' => 'Connect to LDAP and create users. Passwords will be auto-generated.',
'software_user' => 'البرامج المسجلة لـ :name',
'view_user' => 'عرض المستخدم :name',
'usercsv' => 'ملف CSV',
-5
View File
@@ -10,7 +10,6 @@ return array(
'user_password_required' => 'كلمة السر مطلوبة.',
'insufficient_permissions' => 'صلاحيات غير كافية.',
'user_deleted_warning' => 'تم حذف المستخدم. سيكون عليك استعادة هذا المستخدم للتعديل عليه او تسليمه اجهزة جديدة.',
'ldap_not_configured' => 'LDAP integration has not been configured for this installation.',
'success' => array(
@@ -33,10 +32,6 @@ return array(
'import' => 'حدث خطأ أثناء استيراد المستخدمين. حاول مرة أخرى.',
'asset_already_accepted' => 'هذا الجهاز تم قبوله مسبقاً.',
'accept_or_decline' => 'You must either accept or decline this asset.',
'ldap_could_not_connect' => 'Could not connect to the LDAP server. Please check your LDAP server configuration in the LDAP config file. <br>Error from LDAP Server:',
'ldap_could_not_bind' => 'Could not bind to the LDAP server. Please check your LDAP server configuration in the LDAP config file. <br>Error from LDAP Server: ',
'ldap_could_not_search' => 'Could not search the LDAP server. Please check your LDAP server configuration in the LDAP config file. <br>Error from LDAP Server:',
'ldap_could_not_get_entries' => 'Could not get entries from the LDAP server. Please check your LDAP server configuration in the LDAP config file. <br>Error from LDAP Server:',
),
'deletefile' => array(
-1
View File
@@ -8,7 +8,6 @@ return array(
'delete' => 'حذف',
'edit' => 'تعديل',
'restore' => 'إستعادة',
'request' => 'Request',
'submit' => 'إرسال',
'upload' => 'Upload',
-4
View File
@@ -3,7 +3,6 @@
return [
'accessories' => 'Accessories',
'accessory' => 'Accessory',
'accessory_report' => 'Accessory Report',
'action' => 'Action',
'activity_report' => 'Activity Report',
'address' => 'العنوان',
@@ -60,7 +59,6 @@
'id' => 'الرقم',
'image_delete' => 'حذف الصورة',
'image_upload' => 'رفع صورة',
'import' => 'Import',
'asset_maintenance' => 'Asset Maintenance',
'asset_maintenance_report' => 'Asset Maintenance Report',
'asset_maintenances' => 'Asset Maintenances',
@@ -102,7 +100,6 @@
'ready_to_deploy' => 'جاهزة للتوزيع',
'recent_activity' => 'Recent Activity',
'reports' => 'التقارير',
'requested' => 'Requested',
'save' => 'حفظ',
'select' => 'Select',
'search' => 'Search',
@@ -131,7 +128,6 @@
'user' => 'المستخدم',
'accepted' => 'accepted',
'declined' => 'declined',
'unaccepted_asset_report' => 'Unaccepted Assets',
'users' => 'Users',
'viewassets' => 'عرض الأصول المسجلة',
'website' => 'الموقع',
@@ -6,6 +6,6 @@
'delete' => 'Delete Asset Maintenance',
'view' => 'View Asset Maintenance Details',
'repair' => 'Oprava',
'maintenance' => 'Údržba',
'maintenance' => 'Maintenance',
'upgrade' => 'Upgradovat'
];
+3 -4
View File
@@ -5,7 +5,6 @@ return array(
'undeployable' => '<strong>Warning: </strong> This asset has been marked as currently undeployable.
If this status has changed, please update the asset status.',
'does_not_exist' => 'Asset does not exist.',
'does_not_exist_or_not_requestable' => 'Nice try. That asset does not exist or is not requestable.',
'assoc_users' => 'This asset is currently checked out to a user and cannot be deleted. Please check the asset in first, and then try deleting again. ',
'create' => array(
@@ -15,7 +14,7 @@ return array(
'update' => array(
'error' => 'Asset was not updated, please try again',
'success' => 'Majetek úspěšně aktualizován.',
'success' => 'Asset updated successfully.',
'nothing_updated' => 'No fields were selected, so nothing was updated.',
),
@@ -23,7 +22,7 @@ return array(
'error' => 'Asset was not restored, please try again',
'success' => 'Asset restored successfully.'
),
'deletefile' => array(
'error' => 'File not deleted. Please try again.',
'success' => 'Soubor byl úspěšně smazán.',
@@ -32,7 +31,7 @@ return array(
'upload' => array(
'error' => 'File(s) not uploaded. Please try again.',
'success' => 'File(s) successfully uploaded.',
'nofiles' => 'You did not select any files for upload, or the file you are trying to upload is too large',
'nofiles' => 'You did not select any files for upload',
'invalidfiles' => 'One or more of your files is too large or is a filetype that is not allowed. Allowed filetypes are png, gif, jpg, doc, docx, pdf, and txt.',
),
-1
View File
@@ -18,6 +18,5 @@ return array(
'serial' => 'Sériové číslo',
'status' => 'Stav',
'title' => 'Majetek ',
'days_without_acceptance' => 'Days Without Acceptance'
);
+3 -3
View File
@@ -3,11 +3,11 @@
return array(
'asset' => 'Majetek',
'checkin' => 'Příjem',
'checkin' => 'Checkin',
'cost' => 'Pořizovací cena',
'create' => 'Založ licenci',
'date' => 'Datum pořízení',
'depreciation' => 'Amortizace',
'depreciation' => 'Depreciation',
'expiration' => 'Expirace',
'maintained' => 'Údržba',
'name' => 'Software',
@@ -23,6 +23,6 @@ return array(
'termination_date' => 'Platná do',
'to_email' => 'Registrováno na Email',
'to_name' => 'Registrace na jméno',
'update' => 'Úprava licence',
'update' => 'Update License',
'checkout_help' => 'You must check a license out to a hardware asset or a person. You can select both, but the owner of the asset must match the person you\'re checking the asset out to.'
);
+4 -4
View File
@@ -3,18 +3,18 @@
return array(
'checkin' => 'Checkin License Seat',
'checkout_history' => 'Historie',
'checkout_history' => 'Checkout History',
'checkout' => 'Checkout License Seat',
'edit' => 'Uprav licenci',
'filetype_info' => 'Allowed filetypes are png, gif, jpg, jpeg, doc, docx, pdf, txt, zip, and rar.',
'clone' => 'Duplikovat licenci',
'history_for' => 'Historie uživatele ',
'in_out' => 'Stav',
'in_out' => 'In/Out',
'info' => 'Informace o licenci',
'license_seats' => 'License Seats',
'seat' => 'Seat',
'seats' => 'Počet licencí',
'seats' => 'Seats',
'software_licenses' => 'Softwarové licence',
'user' => 'Uživatel',
'user' => 'User',
'view' => 'Ukaž licenci',
);
+7 -7
View File
@@ -2,7 +2,7 @@
return array(
'does_not_exist' => 'Licence neexistuje.',
'does_not_exist' => 'License does not exist.',
'user_does_not_exist' => 'Uživatel neexistuje.',
'asset_does_not_exist' => 'The asset you are trying to associate with this license does not exist.',
'owner_doesnt_match_asset' => 'The asset you are trying to associate with this license is owned by somene other than the person selected in the assigned to dropdown.',
@@ -10,19 +10,19 @@ return array(
'create' => array(
'error' => 'Licence nebyla vytvořena, zkuste to prosím znovu.',
'success' => 'Licence byla úspěšně vytvořena.'
'error' => 'License was not created, please try again.',
'success' => 'License created successfully.'
),
'deletefile' => array(
'error' => 'Soubor se nepodařilo smazat. Prosím zkuste to znovu.',
'error' => 'File not deleted. Please try again.',
'success' => 'Soubor byl úspěšně smazán.',
),
'upload' => array(
'error' => 'Soubor(y) se nepodařilo nahrát. Prosím zkuste to znovu.',
'error' => 'File(s) not uploaded. Please try again.',
'success' => 'File(s) successfully uploaded.',
'nofiles' => 'You did not select any files for upload, or the file you are trying to upload is too large',
'nofiles' => 'You did not select any files for upload',
'invalidfiles' => 'One or more of your files is too large or is a filetype that is not allowed. Allowed filetypes are png, gif, jpg, doc, docx, pdf, and txt.',
),
@@ -44,7 +44,7 @@ return array(
'checkin' => array(
'error' => 'There was an issue checking in the license. Please try again.',
'success' => 'Licence byla úspěšně zkontrolována'
'success' => 'The license was checked in successfully'
),
);
+3 -3
View File
@@ -2,11 +2,11 @@
return array(
'assigned_to' => 'Přiděleno',
'checkout' => 'Stav',
'assigned_to' => 'Assigned To',
'checkout' => 'In/Out',
'id' => 'ID',
'license_email' => 'License Email',
'license_name' => 'Registrováno na',
'license_name' => 'Licensed To',
'purchase_date' => 'Pořízeno',
'purchased' => 'Zakoupeno',
'seats' => 'Seats',
-2
View File
@@ -4,8 +4,6 @@ return array(
'does_not_exist' => 'Místo neexistuje.',
'assoc_users' => 'This location is currently associated with at least one user and cannot be deleted. Please update your users to no longer reference this location and try again. ',
'assoc_assets' => 'This location is currently associated with at least one asset and cannot be deleted. Please update your assets to no longer reference this location and try again. ',
'assoc_child_loc' => 'This location is currently the parent of at least one child location and cannot be deleted. Please update your locations to no longer reference this location and try again. ',
'create' => array(
+2 -3
View File
@@ -8,8 +8,7 @@ return array(
'create' => array(
'error' => 'Model was not created, please try again.',
'success' => 'Model created successfully.',
'duplicate_set' => 'An asset model with that name, manufacturer and model number already exists.',
'success' => 'Model created successfully.'
),
'update' => array(
@@ -22,7 +21,7 @@ return array(
'error' => 'There was an issue deleting the model. Please try again.',
'success' => 'The model was deleted successfully.'
),
'restore' => array(
'error' => 'Model was not restored, please try again',
'success' => 'Model restored successfully.'
+2 -2
View File
@@ -4,11 +4,11 @@ return array(
'create' => 'Create Asset Model',
'created_at' => 'Vytvořeno',
'eol' => '',
'eol' => 'EOL',
'modelnumber' => 'Modelová řada',
'name' => 'Asset Model Name',
'numassets' => 'Počet',
'title' => 'Model',
'title' => 'Asset Models',
'update' => 'Update Asset Model',
'view' => 'View Asset Model',
'update' => 'Update Asset Model',
+2 -2
View File
@@ -2,7 +2,7 @@
return array(
'does_not_exist' => 'Dodavatel neexistuje.',
'does_not_exist' => 'Supplier does not exist.',
'assoc_users' => 'This supplier is currently associated with at least one model and cannot be deleted. Please update your models to no longer reference this supplier and try again. ',
'create' => array(
@@ -12,7 +12,7 @@ return array(
'update' => array(
'error' => 'Supplier was not updated, please try again',
'success' => 'Dodavatel úspěšně aktualizován.'
'success' => 'Supplier updated successfully.'
),
'delete' => array(
+1 -1
View File
@@ -1,7 +1,7 @@
<?php
return array(
'address' => 'Adresa dodavatele',
'address' => 'Supplier Address',
'assets' => 'Assets',
'city' => 'Město',
'contact' => 'Kontaktní osoba',
+1 -3
View File
@@ -10,9 +10,7 @@ return array(
'filetype_info' => 'Povolené přílohy: png, gif, jpg, jpeg, doc, docx, pdf, txt, zip, and rar.',
'history_user' => 'Historie:',
'last_login' => 'Poslední přihlášení',
'ldap_config_text' => 'LDAP configuration settings can be found in the app/config folder in a file called ldap.php',
'ldap_text' => 'Connect to LDAP and create users. Passwords will be auto-generated.',
'software_user' => 'Software vydaný pro :name',
'software_user' => 'Software Checked out to :name',
'view_user' => 'Zobraz uživatele',
'usercsv' => 'CSV soubor',
);
+6 -11
View File
@@ -8,21 +8,20 @@ return array(
'user_not_found' => 'Uživatel [:id] neexistuje.',
'user_login_required' => 'The login field is required',
'user_password_required' => 'Je vyžadováno heslo.',
'insufficient_permissions' => 'Nedostatečná oprávnění.',
'insufficient_permissions' => 'Insufficient Permissions.',
'user_deleted_warning' => 'This user has been deleted. You will have to restore this user to edit them or assign them new assets.',
'ldap_not_configured' => 'LDAP integration has not been configured for this installation.',
'success' => array(
'create' => 'Uživatel byl úspěšně vytvořen.',
'update' => 'Uživatel byl úspěšně aktualizován.',
'update' => 'User was successfully updated.',
'delete' => 'User was successfully deleted.',
'ban' => 'Uživatel byl úspěšně zakázán.',
'ban' => 'User was successfully banned.',
'unban' => 'Uživatel byl úspěšně povolen.',
'suspend' => 'User was successfully suspended.',
'unsuspend' => 'User was successfully unsuspended.',
'restored' => 'User was successfully restored.',
'import' => 'Uživatelé úspěšně naimportování.',
'import' => 'Users imported successfully.',
),
'error' => array(
@@ -33,19 +32,15 @@ return array(
'import' => 'There was an issue importing users. Please try again.',
'asset_already_accepted' => 'This asset has already been accepted.',
'accept_or_decline' => 'You must either accept or decline this asset.',
'ldap_could_not_connect' => 'Could not connect to the LDAP server. Please check your LDAP server configuration in the LDAP config file. <br>Error from LDAP Server:',
'ldap_could_not_bind' => 'Could not bind to the LDAP server. Please check your LDAP server configuration in the LDAP config file. <br>Error from LDAP Server: ',
'ldap_could_not_search' => 'Could not search the LDAP server. Please check your LDAP server configuration in the LDAP config file. <br>Error from LDAP Server:',
'ldap_could_not_get_entries' => 'Could not get entries from the LDAP server. Please check your LDAP server configuration in the LDAP config file. <br>Error from LDAP Server:',
),
'deletefile' => array(
'error' => 'Soubor se nepodařilo smazat. Prosím zkuste to znovu.',
'error' => 'Soubor nebyl smazán. Prosím zkuste to znovu.',
'success' => 'Soubor byl úspěšně smazán.',
),
'upload' => array(
'error' => 'Soubor(y) se nepodařilo nahrát. Prosím zkuste to znovu.',
'error' => 'File(s) not uploaded. Please try again.',
'success' => 'File(s) successfully uploaded.',
'nofiles' => 'You did not select any files for upload',
'invalidfiles' => 'One or more of your files is too large or is a filetype that is not allowed. Allowed filetypes are png, gif, jpg, doc, docx, pdf, and txt.',
+3 -3
View File
@@ -7,14 +7,14 @@ return array(
'checkedout' => 'Assets',
'created_at' => 'Vytvořeno',
'createuser' => 'Nový uživatel',
'deny' => 'Zakázat',
'deny' => 'Deny',
'email' => 'Email',
'employee_num' => 'Osobní číslo',
'first_name' => 'Jméno',
'groupnotes' => 'Select a group to assign to the user, remember that a user takes on the permissions of the group they are assigned.',
'id' => 'ID',
'inherit' => 'Převzít',
'job' => 'Pracovní pozice',
'inherit' => 'Inherit',
'job' => 'Job Title',
'last_login' => 'Poslední přihlášení',
'last_name' => 'Příjmení',
'location' => 'Umístění',
-1
View File
@@ -8,7 +8,6 @@ return array(
'delete' => 'Smazat',
'edit' => 'Upravit',
'restore' => 'Obnovit',
'request' => 'Request',
'submit' => 'Odeslat',
'upload' => 'Nahrát',
-4
View File
@@ -3,7 +3,6 @@
return [
'accessories' => 'Příslušenství',
'accessory' => 'Příslušenství',
'accessory_report' => 'Accessory Report',
'action' => 'Akce',
'activity_report' => 'Report aktivity',
'address' => 'Adresa',
@@ -60,7 +59,6 @@
'id' => 'ID',
'image_delete' => 'Smazat obrázek',
'image_upload' => 'Nahrát obrázek',
'import' => 'Import',
'asset_maintenance' => 'Asset Maintenance',
'asset_maintenance_report' => 'Asset Maintenance Report',
'asset_maintenances' => 'Asset Maintenances',
@@ -102,7 +100,6 @@
'ready_to_deploy' => 'Připraveno k přidělení',
'recent_activity' => 'Nedávná aktivita',
'reports' => 'Reporty',
'requested' => 'Requested',
'save' => 'Uložit',
'select' => 'Zvolit',
'search' => 'Hledat',
@@ -131,7 +128,6 @@
'user' => 'Uživatel',
'accepted' => 'přijato',
'declined' => 'zamítnuto',
'unaccepted_asset_report' => 'Unaccepted Assets',
'users' => 'Uživatelé',
'viewassets' => 'Zobrazit přiřazený majetek',
'website' => 'Webová stránka',
+2 -3
View File
@@ -5,7 +5,6 @@ return array(
'undeployable' => '<strong>Warning: </strong> This asset has been marked as currently undeployable.
If this status has changed, please update the asset status.',
'does_not_exist' => 'Asset does not exist.',
'does_not_exist_or_not_requestable' => 'Nice try. That asset does not exist or is not requestable.',
'assoc_users' => 'This asset is currently checked out to a user and cannot be deleted. Please check the asset in first, and then try deleting again. ',
'create' => array(
@@ -23,7 +22,7 @@ return array(
'error' => 'Asset was not restored, please try again',
'success' => 'Asset restored successfully.'
),
'deletefile' => array(
'error' => 'File not deleted. Please try again.',
'success' => 'File successfully deleted.',
@@ -32,7 +31,7 @@ return array(
'upload' => array(
'error' => 'File(s) not uploaded. Please try again.',
'success' => 'File(s) successfully uploaded.',
'nofiles' => 'You did not select any files for upload, or the file you are trying to upload is too large',
'nofiles' => 'You did not select any files for upload',
'invalidfiles' => 'One or more of your files is too large or is a filetype that is not allowed. Allowed filetypes are png, gif, jpg, doc, docx, pdf, and txt.',
),
-1
View File
@@ -18,6 +18,5 @@ return array(
'serial' => 'Serial',
'status' => 'Status',
'title' => 'Asset ',
'days_without_acceptance' => 'Days Without Acceptance'
);
+1 -1
View File
@@ -22,7 +22,7 @@ return array(
'upload' => array(
'error' => 'File(s) not uploaded. Please try again.',
'success' => 'File(s) successfully uploaded.',
'nofiles' => 'You did not select any files for upload, or the file you are trying to upload is too large',
'nofiles' => 'You did not select any files for upload',
'invalidfiles' => 'One or more of your files is too large or is a filetype that is not allowed. Allowed filetypes are png, gif, jpg, doc, docx, pdf, and txt.',
),
-2
View File
@@ -4,8 +4,6 @@ return array(
'does_not_exist' => 'Location does not exist.',
'assoc_users' => 'This location is currently associated with at least one user and cannot be deleted. Please update your users to no longer reference this location and try again. ',
'assoc_assets' => 'This location is currently associated with at least one asset and cannot be deleted. Please update your assets to no longer reference this location and try again. ',
'assoc_child_loc' => 'This location is currently the parent of at least one child location and cannot be deleted. Please update your locations to no longer reference this location and try again. ',
'create' => array(
+2 -3
View File
@@ -8,8 +8,7 @@ return array(
'create' => array(
'error' => 'Model was not created, please try again.',
'success' => 'Model created successfully.',
'duplicate_set' => 'An asset model with that name, manufacturer and model number already exists.',
'success' => 'Model created successfully.'
),
'update' => array(
@@ -22,7 +21,7 @@ return array(
'error' => 'There was an issue deleting the model. Please try again.',
'success' => 'The model was deleted successfully.'
),
'restore' => array(
'error' => 'Model was not restored, please try again',
'success' => 'Model restored successfully.'
-2
View File
@@ -10,8 +10,6 @@ return array(
'filetype_info' => 'Allowed filetypes are png, gif, jpg, jpeg, doc, docx, pdf, txt, zip, and rar.',
'history_user' => 'History for :name',
'last_login' => 'Last Login',
'ldap_config_text' => 'LDAP configuration settings can be found in the app/config folder in a file called ldap.php',
'ldap_text' => 'Connect to LDAP and create users. Passwords will be auto-generated.',
'software_user' => 'Software Checked out to :name',
'view_user' => 'View User :name',
'usercsv' => 'CSV file',
-5
View File
@@ -10,7 +10,6 @@ return array(
'user_password_required' => 'The password is required.',
'insufficient_permissions' => 'Insufficient Permissions.',
'user_deleted_warning' => 'This user has been deleted. You will have to restore this user to edit them or assign them new assets.',
'ldap_not_configured' => 'LDAP integration has not been configured for this installation.',
'success' => array(
@@ -33,10 +32,6 @@ return array(
'import' => 'There was an issue importing users. Please try again.',
'asset_already_accepted' => 'This asset has already been accepted.',
'accept_or_decline' => 'You must either accept or decline this asset.',
'ldap_could_not_connect' => 'Could not connect to the LDAP server. Please check your LDAP server configuration in the LDAP config file. <br>Error from LDAP Server:',
'ldap_could_not_bind' => 'Could not bind to the LDAP server. Please check your LDAP server configuration in the LDAP config file. <br>Error from LDAP Server: ',
'ldap_could_not_search' => 'Could not search the LDAP server. Please check your LDAP server configuration in the LDAP config file. <br>Error from LDAP Server:',
'ldap_could_not_get_entries' => 'Could not get entries from the LDAP server. Please check your LDAP server configuration in the LDAP config file. <br>Error from LDAP Server:',
),
'deletefile' => array(
-1
View File
@@ -8,7 +8,6 @@ return array(
'delete' => 'Slet',
'edit' => 'Rediger',
'restore' => 'Gendan',
'request' => 'Request',
'submit' => 'Send',
'upload' => 'Upload',
-4
View File
@@ -3,7 +3,6 @@
return [
'accessories' => 'Tilbehør',
'accessory' => 'Tilbehør',
'accessory_report' => 'Accessory Report',
'action' => 'Action',
'activity_report' => 'Activity Report',
'address' => 'Addresse',
@@ -60,7 +59,6 @@
'id' => 'ID',
'image_delete' => 'Slet billede',
'image_upload' => 'Upload billede',
'import' => 'Import',
'asset_maintenance' => 'Asset Maintenance',
'asset_maintenance_report' => 'Asset Maintenance Report',
'asset_maintenances' => 'Asset Maintenances',
@@ -102,7 +100,6 @@
'ready_to_deploy' => 'Klar til Implementering',
'recent_activity' => 'Recent Activity',
'reports' => 'Rapporter',
'requested' => 'Requested',
'save' => 'Gem',
'select' => 'Select',
'search' => 'Search',
@@ -131,7 +128,6 @@
'user' => 'Bruger',
'accepted' => 'accepted',
'declined' => 'declined',
'unaccepted_asset_report' => 'Unaccepted Assets',
'users' => 'Brugere',
'viewassets' => 'Se Tildelte Aktiver',
'website' => 'Hjemmeside',
+2 -2
View File
@@ -5,7 +5,7 @@ return array(
'about_accessories_text' => 'Ein Zubehör ist alles was Sie an einem Benutzer ausgeben können, jedoch keine Seriennummer besitzt (oder wo es keinen Sinn macht eben diese zu verwalten). Zum Beispiel: Computer Mäuse und Tastaturen.',
'accessory_category' => 'Züberhor Kategorie',
'accessory_name' => 'Zubehör Name',
'create' => 'Zubehör neu erstellen',
'create' => 'Create Accessory',
'eula_text' => 'Kategorie EULA',
'eula_text_help' => 'Dieses Feld erlaubt Ihnen die EULA Ihren Bedürfnissen nach Asset Typ anzupassen.Wenn Sie nur eine EULA für alle Assets haben, aktivieren Sie die Checkbox unterhalb um die Standard EULA zu verwenden.',
'require_acceptance' => 'Erfordert die Zustimmung der Assets in dieser Kategorie durch den Benutzer.',
@@ -13,7 +13,7 @@ return array(
'qty' => 'Anzahl',
'total' => 'Gesamt',
'remaining' => 'Verfügbar',
'update' => 'Zubehör überarbeiten',
'update' => 'Update Accessory',
'use_default_eula' => 'Die <a href="#" data-toggle="modal" data-target="#eulaModal">Standard EULA</a> statt dessen verwenden.',
'use_default_eula_disabled' => '<del>Die Standard EULA statt dessen verwenden.</del>Keine Standard EULA definiert. Bitte fügen Sie eine in den Einstellungen hinzu.',
+10 -10
View File
@@ -1,14 +1,14 @@
<?php
return [
'asset_maintenance_type' => 'Typ des Wartungsvertrages',
'title' => 'Artikelbezeichnung',
'start_date' => 'Startdatum',
'completion_date' => 'Fertigstellungstermin',
'cost' => 'Kosten (Netto wenn keine Steuer)',
'is_warranty' => 'Nachbesserungsarbeiten',
'asset_maintenance_time' => 'Wartungsvertrag (in Tagen)',
'notes' => 'Anmerkungen',
'update' => 'Wartungsvertrag überarbeiten',
'create' => 'Wartungsvertrag erstellen'
'asset_maintenance_type' => 'Asset Maintenance Type',
'title' => 'Title',
'start_date' => 'Start Date',
'completion_date' => 'Completion Date',
'cost' => 'Cost',
'is_warranty' => 'Warranty Improvement',
'asset_maintenance_time' => 'Asset Maintenance Time (in days)',
'notes' => 'Notes',
'update' => 'Update Asset Maintenance',
'create' => 'Create Asset Maintenance'
];
@@ -1,11 +1,11 @@
<?php
return [
'asset_maintenances' => 'Wartungsverträge',
'edit' => 'Wartungsvertrag bearbeiten',
'delete' => 'Wartungsvertrag löschen',
'view' => 'Details des Wartungsvertrages anzeigen',
'repair' => 'Reparatur',
'maintenance' => 'Wartung',
'asset_maintenances' => 'Asset Maintenances',
'edit' => 'Edit Asset Maintenance',
'delete' => 'Delete Asset Maintenance',
'view' => 'View Asset Maintenance Details',
'repair' => 'Repair',
'maintenance' => 'Maintenance',
'upgrade' => 'Upgrade'
];
@@ -1,17 +1,17 @@
<?php
return [
'not_found' => 'Wartungsvertrag wurde nicht gefunden!',
'not_found' => 'Asset Maintenance you were looking for was not found!',
'delete' => [
'confirm' => 'Wartungsvertrag wirklich löschen?',
'error' => 'Es gab Probleme beim Löschen des Wartungsvertrages. Bitte versuchen Sie es noch einmal.',
'success' => 'Wartungsvertrag erfolgreich gelöscht.'
'confirm' => 'Are you sure you wish to delete this asset maintenance?',
'error' => 'There was an issue deleting the asset maintenance. Please try again.',
'success' => 'The asset maintenance was deleted successfully.'
],
'create' => [
'error' => 'Wartungsvertrag wurde nicht erstellt. Bitte versuchen Sie es erneut.',
'success' => 'Wartungsvertrag erfolgreich erstellt.'
'error' => 'Asset Maintenance was not created, please try again.',
'success' => 'Asset Maintenance created successfully.'
],
'asset_maintenance_incomplete' => 'Wartungsvertrag noch nicht komplett ausgefüllt',
'warranty' => 'Garantie',
'not_warranty' => 'keine Garantie',
'asset_maintenance_incomplete' => 'Not Completed Yet',
'warranty' => 'Warranty',
'not_warranty' => 'Not Warranty',
];
@@ -1,9 +1,9 @@
<?php
return [
'title' => 'Wartungsverträge',
'asset_name' => 'Name des Gegenstandes',
'supplier_name' => 'Hersteller',
'is_warranty' => 'Garantie',
'dl_csv' => 'Als CSV herunterladen'
'title' => 'Asset Maintenance',
'asset_name' => 'Asset Name',
'supplier_name' => 'Supplier Name',
'is_warranty' => 'Warranty',
'dl_csv' => 'Download CSV'
];
+1 -1
View File
@@ -5,7 +5,7 @@ return array(
'about_categories' => 'Kategorien helfen Ihnen dabei, Ihre Assets zu organisieren. Beispielkategorien sind "Schreibtische", "Laptops", "Handys", "Tablets" usw., jedoch können Sie Kategorien nutzen, wie es für Sie sinnvoll erscheint.',
'asset_categories' => 'Asset-Kategorien',
'category_name' => 'Kategoriename',
'checkin_email' => 'Dem Nutzer eine E-Mail beim Anmelden zusenden.',
'checkin_email' => 'Send email to user on checkin.',
'clone' => 'Kategorie duplizieren',
'create' => 'Kategorie erstellen',
'edit' => 'Kategorie bearbeiten',
+3 -3
View File
@@ -3,9 +3,9 @@
return array(
'about_consumables_title' => 'Details Verbrauchsmaterialien',
'about_consumables_text' => 'Verbrauchsmaterialien sind alle Dinge, die gekauft und mit der Zeit aufgebraucht werden, wie z.B. Druckerpatronen oder Kopierpapier.',
'consumable_name' => 'Name des Verbrauchsmaterials',
'create' => 'Verbrauchsmaterial erstellen',
'consumable_name' => 'Consumable Name',
'create' => 'Create Consumable',
'remaining' => 'übrig',
'total' => 'Gesamt',
'update' => 'Verbrauchsmaterial überarbeiten',
'update' => 'Update Consumable',
);
+2 -2
View File
@@ -17,10 +17,10 @@ return array(
'default_location' => 'Standard Lagerort',
'eol_date' => 'End of Live Datum (Ende der Nutzungsdauer)',
'eol_rate' => 'EOL Rate',
'expected_checkin' => 'Erwartetes Liederdatum',
'expected_checkin' => 'Expected Checkin Date',
'expires' => 'Gültig bis',
'fully_depreciated' => 'Komplett Abgeschrieben',
'help_checkout' => 'Um das Asset sofort zu zuweisen, "bereit zum Aufstellen" in der Status-Liste unten auswählen. ',
'help_checkout' => 'If you wish to assign this asset immediately, select "Ready to Deploy" from the status list above. ',
'mac_address' => 'MAC Adresse',
'manufacturer' => 'Hersteller',
'model' => 'Modell',
+2 -3
View File
@@ -5,7 +5,6 @@ return array(
'undeployable' => '<strong>Achtung:</strong>Dieses Asset wurde kürzlich als nicht verteilbar markiert.
Falls sich dieser Status verändert hat, aktualisieren Sie bitte den Asset Status.',
'does_not_exist' => 'Asset existiert nicht.',
'does_not_exist_or_not_requestable' => 'Netter Versuch. Das Asset existiert nicht oder ist nicht abrufbar.',
'assoc_users' => 'Dieses Asset ist im Moment an einen Benutzer herausgegeben und kann nicht entfernt werden. Bitte buchen sie das Asset wieder ein und versuchen Sie dann erneut es zu entfernen. ',
'create' => array(
@@ -23,7 +22,7 @@ return array(
'error' => 'Asset wurde nicht wiederhergestellt, bitte versuchen Sie es noch einmal',
'success' => 'Asset erfolgreich wiederhergestellt.'
),
'deletefile' => array(
'error' => 'Datei wurde nicht gelöscht. Bitte noch einmal Probieren.',
'success' => 'Datei erfolgreich gelöscht.',
@@ -32,7 +31,7 @@ return array(
'upload' => array(
'error' => 'Datei(en) wurde nicht hochgeladen. Bitte noch einmal Probieren.',
'success' => 'Datei(en) erfolgreich hochgeladen.',
'nofiles' => 'Es wurde keine Datei für den Upload ausgewählt, oder die Datei ist zu groß',
'nofiles' => 'Sie haben keine Datei zum hochladen ausgewählt',
'invalidfiles' => 'Eine oder mehrere Ihrer Dateien ist zu groß oder deren Dateityp ist nicht zugelassen. Zugelassene Dateitypen sind png, gif, jpg, doc, docx, pdf, und txt.',
),
-1
View File
@@ -18,6 +18,5 @@ return array(
'serial' => 'Seriennummer',
'status' => 'Status',
'title' => 'Asset ',
'days_without_acceptance' => 'Tage ohne Akzeptierung'
);
+1 -1
View File
@@ -6,7 +6,7 @@ return array(
'checkout_history' => 'Zuweisungsverlauf',
'checkout' => 'Lizenzaktivierung herausgeben',
'edit' => 'Edit User',
'filetype_info' => 'Erlaubte Dateitypen sind png, gif, jpg, jpeg, doc, docx, pdf, txt, zip, und rar.',
'filetype_info' => 'Allowed filetypes are png, gif, jpg, jpeg, doc, docx, pdf, txt, zip, and rar.',
'clone' => 'Clone User',
'history_for' => 'Verlauf für ',
'in_out' => 'Zurücknehmen/Herausgeben',
+1 -1
View File
@@ -22,7 +22,7 @@ return array(
'upload' => array(
'error' => 'Datei(en) wurden nicht hochgeladen. Bitte versuchen Sie es noch einmal.',
'success' => 'Datei(en) erfolgreich hochgeladen.',
'nofiles' => 'Es wurde keine Datei für den Upload ausgewählt, oder die Datei ist zu groß',
'nofiles' => 'Sie haben keine Datei(en) zum Hochladen ausgewählt',
'invalidfiles' => 'Eine oder mehrere Ihrer Datei(en) sind zu groß oder ein Dateityp ist nicht erlaubt. Erlaubte Dateitypen sind png, gif, jpg, doc, docx, pdf, and txt.',
),

Some files were not shown because too many files have changed in this diff Show More