Compare commits

..

8 Commits

Author SHA1 Message Date
snipe
141b0b410b Change variable name to be clearer 2019-07-23 18:23:51 -07:00
snipe
d40f06373e DIsable CORS allowed origins by default to replicate existing behavior 2019-07-23 18:23:39 -07:00
snipe
56753fa4cd More clarification 2019-07-23 18:07:45 -07:00
snipe
8a7bafb575 Clarified header comments 2019-07-23 18:05:07 -07:00
snipe
82f91cb944 Fixed typo 2019-07-23 18:03:53 -07:00
snipe
41b226e5fc Added APP_CORS_ALLOWED_ORIGINS env option 2019-07-23 18:02:51 -07:00
snipe
ae6048a6ea Changed order so CORS will still work if throttle hit 2019-07-23 18:02:27 -07:00
snipe
ef41e0060a Added CORS support to API 2019-07-23 17:17:01 -07:00
353 changed files with 1631 additions and 7984 deletions

View File

@@ -1659,15 +1659,6 @@
"contributions": [
"code"
]
},
{
"login": "mskrip",
"name": "Marián Skrip",
"avatar_url": "https://avatars0.githubusercontent.com/u/17459600?v=4",
"profile": "https://github.com/mskrip",
"contributions": [
"code"
]
}
]
}

View File

@@ -7,7 +7,6 @@ APP_KEY=ChangeMe
APP_URL=null
APP_TIMEZONE='UTC'
APP_LOCALE=en
MAX_RESULTS=500
# --------------------------------------------
# REQUIRED: DATABASE SETTINGS
@@ -65,8 +64,6 @@ SECURE_COOKIES=false
# --------------------------------------------
# OPTIONAL: SECURITY HEADER SETTINGS
# --------------------------------------------
APP_TRUSTED_PROXIES=192.168.1.1,10.0.0.1
ALLOW_IFRAMING=false
REFERRER_POLICY=same-origin
ENABLE_CSP=false
CORS_ALLOWED_ORIGINS=null
@@ -113,6 +110,8 @@ APP_LOG=single
APP_LOG_MAX_FILES=10
APP_LOCKED=false
FILESYSTEM_DISK=local
APP_TRUSTED_PROXIES=192.168.1.1,10.0.0.1
ALLOW_IFRAMING=false
APP_CIPHER=AES-256-CBC
GOOGLE_MAPS_API=
BACKUP_ENV=true

View File

@@ -1,5 +1,5 @@
[![Build Status](https://travis-ci.org/snipe/snipe-it.svg?branch=master)](https://travis-ci.org/snipe/snipe-it) [![Crowdin](https://d322cqt584bo4o.cloudfront.net/snipe-it/localized.svg)](https://crowdin.com/project/snipe-it) [![Gitter](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/snipe/snipe-it?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) [![Docker Pulls](https://img.shields.io/docker/pulls/snipe/snipe-it.svg)](https://hub.docker.com/r/snipe/snipe-it/) [![Twitter Follow](https://img.shields.io/twitter/follow/snipeitapp.svg?style=social)](https://twitter.com/snipeitapp) [![Codacy Badge](https://api.codacy.com/project/badge/Grade/553ce52037fc43ea99149785afcfe641)](https://www.codacy.com/app/snipe/snipe-it?utm_source=github.com&utm_medium=referral&utm_content=snipe/snipe-it&utm_campaign=Badge_Grade)
[![All Contributors](https://img.shields.io/badge/all_contributors-182-orange.svg?style=flat-square)](#contributors) [![Open Source Helpers](https://www.codetriage.com/snipe/snipe-it/badges/users.svg)](https://www.codetriage.com/snipe/snipe-it)
[![All Contributors](https://img.shields.io/badge/all_contributors-181-orange.svg?style=flat-square)](#contributors) [![Open Source Helpers](https://www.codetriage.com/snipe/snipe-it/badges/users.svg)](https://www.codetriage.com/snipe/snipe-it)
## Snipe-IT - Open Source Asset Management System
@@ -61,8 +61,6 @@ Since the release of the JSON REST API, several third-party developers have been
- [jamf2snipe](https://github.com/ParadoxGuitarist/jamf2snipe) by [@ParadoxGuitarist](https://github.com/ParadoxGuitarist) - Python script to sync assets between a JAMFPro instance and a Snipe-IT instance
- [Marksman](https://github.com/Scope-IT/marksman) - A Windows agent for Snipe-IT
- [Snipe-IT plugin for Jira Service Desk (beta)](https://marketplace.atlassian.com/apps/1220379/snipe-it-for-jira-service-desk-beta?hosting=cloud&tab=overview) - for the upcoming Snipe-IT v5 only
- [Python 3 CSV importer](https://github.com/gastamper/snipeit-csvimporter) - allows importing assets into Snipe-IT based on Item Name rather than Asset Tag.
- [Snipe-IT Kubernetes Helm Chart](https://github.com/t3n/helm-charts/tree/master/snipeit) - For more information, [click here](https://hub.helm.sh/charts/t3n/snipeit).
As these were created by third-parties, Snipe-IT cannot provide support for these project, and you should contact the developers directly if you need assistance. Additionally, Snipe-IT makes no guarantees as to the reliability, accuracy or maintainability of these libraries. Use at your own risk. :)
@@ -105,7 +103,7 @@ Thanks goes to all of these wonderful people ([emoji key](https://github.com/ken
| [<img src="https://avatars2.githubusercontent.com/u/982885?v=4" width="110px;"/><br /><sub>Martin Stub</sub>](http://martinstub.dk)<br />[🌍](#translation-stubben "Translation") | [<img src="https://avatars2.githubusercontent.com/u/28959963?v=4" width="110px;"/><br /><sub>Meyer Flavio</sub>](https://github.com/meyerf99)<br />[🌍](#translation-meyerf99 "Translation") | [<img src="https://avatars3.githubusercontent.com/u/796443?v=4" width="110px;"/><br /><sub>Micael Rodrigues</sub>](https://github.com/MicaelRodrigues)<br />[🌍](#translation-MicaelRodrigues "Translation") | [<img src="https://avatars0.githubusercontent.com/u/10481331?v=4" width="110px;"/><br /><sub>Mikael Rasmussen</sub>](http://rubixy.com/)<br />[🌍](#translation-mikaelssen "Translation") | [<img src="https://avatars1.githubusercontent.com/u/1544552?v=4" width="110px;"/><br /><sub>IxFail</sub>](https://github.com/IxFail)<br />[🌍](#translation-IxFail "Translation") | [<img src="https://avatars3.githubusercontent.com/u/18483118?v=4" width="110px;"/><br /><sub>Mohammed Fota</sub>](http://www.mohammedfota.com)<br />[🌍](#translation-MohammedFota "Translation") | [<img src="https://avatars0.githubusercontent.com/u/227080?v=4" width="110px;"/><br /><sub>Moayad Alserihi</sub>](https://github.com/omego)<br />[🌍](#translation-omego "Translation") |
| [<img src="https://avatars0.githubusercontent.com/u/1680266?v=4" width="110px;"/><br /><sub>saymd</sub>](https://github.com/saymd)<br />[🌍](#translation-saymd "Translation") | [<img src="https://avatars0.githubusercontent.com/u/1826808?v=4" width="110px;"/><br /><sub>Patrik Larsson</sub>](https://nordsken.se)<br />[🌍](#translation-pooot "Translation") | [<img src="https://avatars1.githubusercontent.com/u/20584746?v=4" width="110px;"/><br /><sub>drcryo</sub>](https://github.com/drcryo)<br />[🌍](#translation-drcryo "Translation") | [<img src="https://avatars1.githubusercontent.com/u/19408004?v=4" width="110px;"/><br /><sub>pawel1615</sub>](https://github.com/pawel1615)<br />[🌍](#translation-pawel1615 "Translation") | [<img src="https://avatars2.githubusercontent.com/u/23340468?v=4" width="110px;"/><br /><sub>bodrovics</sub>](https://github.com/bodrovics)<br />[🌍](#translation-bodrovics "Translation") | [<img src="https://avatars0.githubusercontent.com/u/3257654?v=4" width="110px;"/><br /><sub>priatna</sub>](https://github.com/priatna)<br />[🌍](#translation-priatna "Translation") | [<img src="https://avatars1.githubusercontent.com/u/5358374?v=4" width="110px;"/><br /><sub>Fan Jiang</sub>](https://amayume.net)<br />[🌍](#translation-ProfFan "Translation") |
| [<img src="https://avatars1.githubusercontent.com/u/22555451?v=4" width="110px;"/><br /><sub>ragnarcx</sub>](https://github.com/ragnarcx)<br />[🌍](#translation-ragnarcx "Translation") | [<img src="https://avatars2.githubusercontent.com/u/18654582?v=4" width="110px;"/><br /><sub>Rein van Haaren</sub>](http://www.reinvanhaaren.nl/)<br />[🌍](#translation-reinvanhaaren "Translation") | [<img src="https://avatars1.githubusercontent.com/u/386672?v=4" width="110px;"/><br /><sub>Teguh Dwicaksana</sub>](http://dheche.songolimo.net)<br />[🌍](#translation-dheche "Translation") | [<img src="https://avatars2.githubusercontent.com/u/2572552?v=4" width="110px;"/><br /><sub>fraccie</sub>](https://github.com/FRaccie)<br />[🌍](#translation-FRaccie "Translation") | [<img src="https://avatars0.githubusercontent.com/u/35182720?v=4" width="110px;"/><br /><sub>vinzruzell</sub>](https://github.com/vinzruzell)<br />[🌍](#translation-vinzruzell "Translation") | [<img src="https://avatars1.githubusercontent.com/u/7883603?v=4" width="110px;"/><br /><sub>Kevin Austin</sub>](http://kevinaustin.com)<br />[🌍](#translation-vipsystem "Translation") | [<img src="https://avatars3.githubusercontent.com/u/3861828?v=4" width="110px;"/><br /><sub>Wira Sandy</sub>](http://azuraweb.xyz)<br />[🌍](#translation-wira-sandy "Translation") |
| [<img src="https://avatars2.githubusercontent.com/u/8663789?v=4" width="110px;"/><br /><sub>Илья</sub>](https://github.com/GrayHoax)<br />[🌍](#translation-GrayHoax "Translation") | [<img src="https://avatars3.githubusercontent.com/u/30119111?v=4" width="110px;"/><br /><sub>GodUseVPN</sub>](https://github.com/godusevpn)<br />[🌍](#translation-godusevpn "Translation") | [<img src="https://avatars1.githubusercontent.com/u/745576?v=4" width="110px;"/><br /><sub>周周</sub>](https://github.com/EngrZhou)<br />[🌍](#translation-EngrZhou "Translation") | [<img src="https://avatars3.githubusercontent.com/u/1631095?v=4" width="110px;"/><br /><sub>Sam</sub>](https://github.com/takuy)<br />[💻](https://github.com/snipe/snipe-it/commits?author=takuy "Code") | [<img src="https://avatars1.githubusercontent.com/u/264022?v=4" width="110px;"/><br /><sub>Azerothian</sub>](https://www.illisian.com.au)<br />[💻](https://github.com/snipe/snipe-it/commits?author=Azerothian "Code") | [<img src="https://avatars1.githubusercontent.com/u/7632599?v=4" width="110px;"/><br /><sub>Tim Farmer</sub>](https://github.com/timothyfarmer)<br />[💻](https://github.com/snipe/snipe-it/commits?author=timothyfarmer "Code") | [<img src="https://avatars0.githubusercontent.com/u/17459600?v=4" width="110px;"/><br /><sub>Marián Skrip</sub>](https://github.com/mskrip)<br />[💻](https://github.com/snipe/snipe-it/commits?author=mskrip "Code") |
| [<img src="https://avatars2.githubusercontent.com/u/8663789?v=4" width="110px;"/><br /><sub>Илья</sub>](https://github.com/GrayHoax)<br />[🌍](#translation-GrayHoax "Translation") | [<img src="https://avatars3.githubusercontent.com/u/30119111?v=4" width="110px;"/><br /><sub>GodUseVPN</sub>](https://github.com/godusevpn)<br />[🌍](#translation-godusevpn "Translation") | [<img src="https://avatars1.githubusercontent.com/u/745576?v=4" width="110px;"/><br /><sub>周周</sub>](https://github.com/EngrZhou)<br />[🌍](#translation-EngrZhou "Translation") | [<img src="https://avatars3.githubusercontent.com/u/1631095?v=4" width="110px;"/><br /><sub>Sam</sub>](https://github.com/takuy)<br />[💻](https://github.com/snipe/snipe-it/commits?author=takuy "Code") | [<img src="https://avatars1.githubusercontent.com/u/264022?v=4" width="110px;"/><br /><sub>Azerothian</sub>](https://www.illisian.com.au)<br />[💻](https://github.com/snipe/snipe-it/commits?author=Azerothian "Code") | [<img src="https://avatars1.githubusercontent.com/u/7632599?v=4" width="110px;"/><br /><sub>Tim Farmer</sub>](https://github.com/timothyfarmer)<br />[💻](https://github.com/snipe/snipe-it/commits?author=timothyfarmer "Code") |
<!-- ALL-CONTRIBUTORS-LIST:END -->
This project follows the [all-contributors](https://github.com/kentcdodds/all-contributors) specification. Contributions of any kind welcome!

View File

View File

@@ -189,7 +189,7 @@ class LdapSync extends Command
// Sync activated state for Active Directory.
if ( array_key_exists('useraccountcontrol', $results[$i]) ) {
$enabled_accounts = [
'512', '544', '66048', '66080', '262656', '262688', '328192', '328224', '4260352'
'512', '544', '66048', '66080', '262656', '262688', '328192', '328224'
];
$user->activated = ( in_array($results[$i]['useraccountcontrol'][0], $enabled_accounts) ) ? 1 : 0;
}

View File

@@ -1,135 +0,0 @@
<?php
namespace App\Console\Commands;
use Illuminate\Console\Command;
use Artisan;
use App\Models\CustomField;
use App\Models\Asset;
use App\Models\Setting;
use \Illuminate\Encryption\Encrypter;
class RotateAppKey extends Command
{
/**
* The name and signature of the console command.
*
* @var string
*/
protected $signature = 'snipeit:rotate-key';
/**
* The console command description.
*
* @var string
*/
protected $description = 'Command description';
/**
* Create a new command instance.
*
* @return void
*/
public function __construct()
{
parent::__construct();
}
/**
* Execute the console command.
*
* @return mixed
*/
public function handle()
{
if ($this->confirm("\n****************************************************\nTHIS WILL MODIFY YOUR APP_KEY AND DE-CRYPT YOUR ENCRYPTED CUSTOM FIELDS AND \nRE-ENCRYPT THEM WITH A NEWLY GENERATED KEY. \n\nThere is NO undo. \n\nMake SURE you have a database backup and a backup of your .env generated BEFORE running this command. \n\nIf you do not save the newly generated APP_KEY to your .env in this process, \nyour encrypted data will no longer be decryptable. \n\nAre you SURE you wish to continue, and have confirmed you have a database backup and an .env backup? ")) {
// Get the existing app_key and ciphers
// We put them in a variable since we clear the cache partway through here.
$old_app_key = config('app.key');
$cipher = config('app.cipher');
// Generate a new one
Artisan::call('key:generate', ['--show' => true]);
$new_app_key = Artisan::output();
// Clear the config cache
Artisan::call('config:clear');
$this->warn('Your app cipher is: '.$cipher);
$this->warn('Your old APP_KEY is: '.$old_app_key);
$this->warn('Your new APP_KEY is: '.$new_app_key);
// Write the new app key to the .env file
$this->writeNewEnvironmentFileWith($new_app_key);
// Manually create an old encrypter instance using the old app key
// and also create a new encrypter instance so we can re-crypt the field
// using the newly generated app key
$oldEncrypter = new Encrypter(base64_decode(substr($old_app_key, 7)), $cipher);
$newEncrypter = new Encrypter(base64_decode(substr($new_app_key, 7)), $cipher);
$fields = CustomField::where('field_encrypted', '1')->get();
foreach ($fields as $field) {
$assets = Asset::whereNotNull($field->db_column)->get();
foreach ($assets as $asset) {
$asset->{$field->db_column} = $oldEncrypter->decrypt($asset->{$field->db_column});
$this->line('DECRYPTED: '. $field->db_column);
$asset->{$field->db_column} = $newEncrypter->encrypt($asset->{$field->db_column});
$this->line('ENCRYPTED: '.$field->db_column);
$asset->save();
}
}
// Handle the LDAP password if one is provided
$setting = Setting::first();
if ($setting->ldap_pword!='') {
$setting->ldap_pword = $oldEncrypter->decrypt($setting->ldap_pword);
$setting->ldap_pword = $newEncrypter->encrypt($setting->ldap_pword);
$setting->save();
$this->warn('LDAP password has been re-encrypted.');
}
} else {
$this->info('This operation has been canceled. No changes have been made.');
}
}
/**
* Write a new environment file with the given key.
*
* @param string $key
* @return void
*/
protected function writeNewEnvironmentFileWith($key)
{
file_put_contents($this->laravel->environmentFilePath(), preg_replace(
$this->keyReplacementPattern(),
'APP_KEY='.$key,
file_get_contents($this->laravel->environmentFilePath())
));
}
/**
* Get a regex pattern that will match env APP_KEY with any random key.
*
* @return string
*/
protected function keyReplacementPattern()
{
$escaped = preg_quote('='.$this->laravel['config']['app.key'], '/');
return "/^APP_KEY{$escaped}/m";
}
}

View File

@@ -3,13 +3,40 @@
namespace App\Console;
use App\Console\Commands\ImportLocations;
use App\Console\Commands\ReEncodeCustomFieldNames;
use App\Console\Commands\RestoreDeletedUsers;
use Illuminate\Console\Scheduling\Schedule;
use Illuminate\Foundation\Console\Kernel as ConsoleKernel;
class Kernel extends ConsoleKernel
{
/**
* The Artisan commands provided by your application.
*
* @var array
*/
protected $commands = [
Commands\PaveIt::class,
Commands\CreateAdmin::class,
Commands\SendExpirationAlerts::class,
Commands\SendInventoryAlerts::class,
Commands\SendExpectedCheckinAlerts::class,
Commands\ObjectImportCommand::class,
Commands\Version::class,
Commands\SystemBackup::class,
Commands\DisableLDAP::class,
Commands\Purge::class,
Commands\LdapSync::class,
Commands\FixDoubleEscape::class,
Commands\RecryptFromMcrypt::class,
Commands\ResetDemoSettings::class,
Commands\SyncAssetLocations::class,
Commands\RegenerateAssetTags::class,
Commands\SyncAssetCounters::class,
Commands\RestoreDeletedUsers::class,
Commands\SendUpcomingAuditReport::class,
Commands\ImportLocations::class,
Commands\ReEncodeCustomFieldNames::class,
];
/**
* Define the application's command schedule.

View File

@@ -85,7 +85,26 @@ class AccessoriesController extends Controller
$accessory->qty = request('qty');
$accessory->user_id = Auth::user()->id;
$accessory->supplier_id = request('supplier_id');
$accessory = $request->handleImages($accessory,600, public_path().'/uploads/accessories');
if ($request->hasFile('image')) {
if (!config('app.lock_passwords')) {
$image = $request->file('image');
$ext = $image->getClientOriginalExtension();
$file_name = "accessory-".str_random(18).'.'.$ext;
$path = public_path('/uploads/accessories');
if ($image->getClientOriginalExtension()!='svg') {
Image::make($image->getRealPath())->resize(null, 800, function ($constraint) {
$constraint->aspectRatio();
$constraint->upsize();
})->save($path.'/'.$file_name);
} else {
$image->move($path, $file_name);
}
$accessory->image = $file_name;
}
}
// Was the accessory created?
@@ -146,7 +165,28 @@ class AccessoriesController extends Controller
$accessory->qty = request('qty');
$accessory->supplier_id = request('supplier_id');
$accessory = $request->handleImages($accessory,600, public_path().'/uploads/accessories');
if ($request->hasFile('image')) {
if (!config('app.lock_passwords')) {
$image = $request->file('image');
$ext = $image->getClientOriginalExtension();
$file_name = "accessory-".str_random(18).'.'.$ext;
$path = public_path('/uploads/accessories');
if ($image->getClientOriginalExtension()!='svg') {
Image::make($image->getRealPath())->resize(null, 800, function ($constraint) {
$constraint->aspectRatio();
$constraint->upsize();
})->save($path.'/'.$file_name);
} else {
$image->move($path, $file_name);
}
if (($accessory->image) && (file_exists($path.'/'.$accessory->image))) {
unlink($path.'/'.$accessory->image);
}
$accessory->image = $file_name;
}
}
// Was the accessory updated?

View File

@@ -8,10 +8,7 @@ use App\Helpers\Helper;
use App\Models\Accessory;
use App\Http\Transformers\AccessoriesTransformer;
use App\Models\Company;
use App\Models\User;
use Carbon\Carbon;
use Auth;
use DB;
class AccessoriesController extends Controller
{
@@ -50,11 +47,7 @@ class AccessoriesController extends Controller
}
$offset = (($accessories) && (request('offset') > $accessories->count())) ? 0 : request('offset', 0);
// Check to make sure the limit is not higher than the max allowed
((config('app.max_results') >= $request->input('limit')) && ($request->filled('limit'))) ? $limit = $request->input('limit') : $limit = config('app.max_results');
$limit = $request->input('limit', 50);
$order = $request->input('order') === 'asc' ? 'asc' : 'desc';
$sort = in_array($request->input('sort'), $allowed_columns) ? $request->input('sort') : 'created_at';
@@ -198,94 +191,4 @@ class AccessoriesController extends Controller
return response()->json(Helper::formatStandardApiResponse('success', null, trans('admin/accessories/message.delete.success')));
}
/**
* Save the Accessory checkout information.
*
* If Slack is enabled and/or asset acceptance is enabled, it will also
* trigger a Slack message and send an email.
*
* @author [A. Gianotto] [<snipe@snipe.net>]
* @param int $accessoryId
* @return Redirect
*/
public function checkout(Request $request, $accessoryId)
{
// Check if the accessory exists
if (is_null($accessory = Accessory::find($accessoryId))) {
return response()->json(Helper::formatStandardApiResponse('error', null, trans('admin/accessories/message.does_not_exist')));
}
$this->authorize('checkout', $accessory);
if ($accessory->numRemaining() > 0) {
if (!$user = User::find($request->input('assigned_to'))) {
return response()->json(Helper::formatStandardApiResponse('error', null, trans('admin/accessories/message.checkout.user_does_not_exist')));
}
// Update the accessory data
$accessory->assigned_to = $request->input('assigned_to');
$accessory->users()->attach($accessory->id, [
'accessory_id' => $accessory->id,
'created_at' => Carbon::now(),
'user_id' => Auth::id(),
'assigned_to' => $request->get('assigned_to')
]);
$accessory->logCheckout($request->input('note'), $user);
return response()->json(Helper::formatStandardApiResponse('success', null, trans('admin/accessories/message.checkout.success')));
}
return response()->json(Helper::formatStandardApiResponse('error', null, 'No accessories remaining'));
}
/**
* Check in the item so that it can be checked out again to someone else
*
* @uses Accessory::checkin_email() to determine if an email can and should be sent
* @author [A. Gianotto] [<snipe@snipe.net>]
* @param Request $request
* @param integer $accessoryUserId
* @param string $backto
* @return Redirect
* @internal param int $accessoryId
*/
public function checkin(Request $request, $accessoryUserId = null)
{
if (is_null($accessory_user = DB::table('accessories_users')->find($accessoryUserId))) {
return response()->json(Helper::formatStandardApiResponse('error', null, trans('admin/accessories/message.does_not_exist')));
}
$accessory = Accessory::find($accessory_user->accessory_id);
$this->authorize('checkin', $accessory);
$logaction = $accessory->logCheckin(User::find($accessoryUserId), $request->input('note'));
// Was the accessory updated?
if (DB::table('accessories_users')->where('id', '=', $accessory_user->id)->delete()) {
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['last_name'] = $user->last_name;
$data['item_name'] = $accessory->name;
$data['checkin_date'] = $logaction->created_at;
$data['item_tag'] = '';
$data['note'] = $logaction->note;
return response()->json(Helper::formatStandardApiResponse('success', null, trans('admin/accessories/message.checkin.success')));
}
return response()->json(Helper::formatStandardApiResponse('error', null, trans('admin/accessories/message.checkin.error')));
}
}

View File

@@ -45,10 +45,7 @@ class AssetMaintenancesController extends Controller
}
$offset = (($maintenances) && (request('offset') > $maintenances->count())) ? 0 : request('offset', 0);
// Check to make sure the limit is not higher than the max allowed
((config('app.max_results') >= $request->input('limit')) && ($request->filled('limit'))) ? $limit = $request->input('limit') : $limit = config('app.max_results');
$limit = request('limit', 50);
$allowed_columns = [
'id',

View File

@@ -61,10 +61,7 @@ class AssetModelsController extends Controller
}
$offset = (($assetmodels) && (request('offset') > $assetmodels->count())) ? 0 : request('offset', 0);
// Check to make sure the limit is not higher than the max allowed
((config('app.max_results') >= $request->input('limit')) && ($request->filled('limit'))) ? $limit = $request->input('limit') : $limit = config('app.max_results');
$limit = $request->input('limit', 50);
$order = $request->input('order') === 'asc' ? 'asc' : 'desc';
$sort = in_array($request->input('sort'), $allowed_columns) ? $request->input('sort') : 'models.created_at';

View File

@@ -145,10 +145,7 @@ class AssetsController extends Controller
$request->filled('order_number') ? $assets = $assets->where('assets.order_number', '=', e($request->get('order_number'))) : '';
$offset = (($assets) && (request('offset') > $assets->count())) ? 0 : request('offset', 0);
// Check to make sure the limit is not higher than the max allowed
((config('app.max_results') >= $request->input('limit')) && ($request->filled('limit'))) ? $limit = $request->input('limit') : $limit = config('app.max_results');
$limit = $request->input('limit', 50);
$order = $request->input('order') === 'asc' ? 'asc' : 'desc';
// This is used by the audit reporting routes
@@ -525,10 +522,6 @@ class AssetsController extends Controller
$location = $target->location_id;
} elseif (($request->filled('assigned_asset')) && ($target = Asset::find($request->get('assigned_asset')))) {
$location = $target->location_id;
Asset::where('assigned_type', '\\App\\Models\\Asset')->where('assigned_to', $id)
->update(['location_id' => $target->location_id]);
} elseif (($request->filled('assigned_location')) && ($target = Location::find($request->get('assigned_location')))) {
$location = $target->id;
}
@@ -652,7 +645,7 @@ class AssetsController extends Controller
return response()->json(Helper::formatStandardApiResponse('success', ['asset'=> e($asset->asset_tag)], trans('admin/hardware/message.checkout.success')));
}
return response()->json(Helper::formatStandardApiResponse('error', ['asset'=> e($asset->asset_tag)], trans('admin/hardware/message.checkout.error')));
return response()->json(Helper::formatStandardApiResponse('error', ['asset'=> e($asset->asset_tag)], trans('admin/hardware/message.checkout.error')))->withErrors($asset->getErrors());
}
@@ -681,11 +674,7 @@ class AssetsController extends Controller
$asset->assigned_to = null;
$asset->assignedTo()->disassociate($asset);
$asset->accepted = null;
if ($request->filled('name')) {
$asset->name = $request->input('name');
}
$asset->name = Input::get('name');
$asset->location_id = $asset->rtd_location_id;
if ($request->filled('location_id')) {

View File

@@ -31,10 +31,7 @@ class CategoriesController extends Controller
}
$offset = (($categories) && (request('offset') > $categories->count())) ? 0 : request('offset', 0);
// Check to make sure the limit is not higher than the max allowed
((config('app.max_results') >= $request->input('limit')) && ($request->filled('limit'))) ? $limit = $request->input('limit') : $limit = config('app.max_results');
$limit = $request->input('limit', 50);
$order = $request->input('order') === 'asc' ? 'asc' : 'desc';
$sort = in_array($request->input('sort'), $allowed_columns) ? $request->input('sort') : 'assets_count';
$categories->orderBy($sort, $order);

View File

@@ -42,10 +42,7 @@ class CompaniesController extends Controller
}
$offset = (($companies) && (request('offset') > $companies->count())) ? 0 : request('offset', 0);
// Check to make sure the limit is not higher than the max allowed
((config('app.max_results') >= $request->input('limit')) && ($request->filled('limit'))) ? $limit = $request->input('limit') : $limit = config('app.max_results');
$limit = $request->input('limit', 50);
$order = $request->input('order') === 'asc' ? 'asc' : 'desc';
$sort = in_array($request->input('sort'), $allowed_columns) ? $request->input('sort') : 'created_at';
$companies->orderBy($sort, $order);

View File

@@ -44,9 +44,7 @@ class ComponentsController extends Controller
}
$offset = (($components) && (request('offset') > $components->count())) ? 0 : request('offset', 0);
// Check to make sure the limit is not higher than the max allowed
((config('app.max_results') >= $request->input('limit')) && ($request->filled('limit'))) ? $limit = $request->input('limit') : $limit = config('app.max_results');
$limit = request('limit', 50);
$allowed_columns = ['id','name','min_amt','order_number','serial','purchase_date','purchase_cost','company','category','qty','location','image'];
$order = $request->input('order') === 'asc' ? 'asc' : 'desc';

View File

@@ -45,10 +45,7 @@ class ConsumablesController extends Controller
$offset = (($consumables) && (request('offset') > $consumables->count())) ? 0 : request('offset', 0);
// Check to make sure the limit is not higher than the max allowed
((config('app.max_results') >= $request->input('limit')) && ($request->filled('limit'))) ? $limit = $request->input('limit') : $limit = config('app.max_results');
$limit = request('limit', 50);
$allowed_columns = ['id','name','order_number','min_amt','purchase_date','purchase_cost','company','category','model_number', 'item_no', 'manufacturer','location','qty','image'];
$order = $request->input('order') === 'asc' ? 'asc' : 'desc';
$sort = in_array($request->input('sort'), $allowed_columns) ? $request->input('sort') : 'created_at';

View File

@@ -24,7 +24,7 @@ class CustomFieldsController extends Controller
public function index()
{
$this->authorize('index', CustomField::class);
$this->authorize('index', CustomFields::class);
$fields = CustomField::get();
return (new CustomFieldsTransformer)->transformCustomFields($fields, $fields->count());
}
@@ -38,7 +38,7 @@ class CustomFieldsController extends Controller
*/
public function show($id)
{
$this->authorize('view', CustomField::class);
$this->authorize('show', CustomField::class);
if ($field = CustomField::find($id)) {
return (new CustomFieldsTransformer)->transformCustomField($field);
}

View File

@@ -58,7 +58,7 @@ class CustomFieldsetsController extends Controller
*/
public function show($id)
{
$this->authorize('view', CustomFieldset::class);
$this->authorize('show', CustomFieldset::class);
if ($fieldset = CustomFieldset::find($id)) {
return (new CustomFieldsetsTransformer)->transformCustomFieldset($fieldset);
}

View File

@@ -40,10 +40,7 @@ class DepartmentsController extends Controller
}
$offset = (($departments) && (request('offset') > $departments->count())) ? 0 : request('offset', 0);
// Check to make sure the limit is not higher than the max allowed
((config('app.max_results') >= $request->input('limit')) && ($request->filled('limit'))) ? $limit = $request->input('limit') : $limit = config('app.max_results');
$limit = $request->input('limit', 50);
$order = $request->input('order') === 'asc' ? 'asc' : 'desc';
$sort = in_array($request->input('sort'), $allowed_columns) ? $request->input('sort') : 'created_at';

View File

@@ -29,10 +29,7 @@ class DepreciationsController extends Controller
}
$offset = (($depreciations) && (request('offset') > $depreciations->count())) ? 0 : request('offset', 0);
// Check to make sure the limit is not higher than the max allowed
((config('app.max_results') >= $request->input('limit')) && ($request->filled('limit'))) ? $limit = $request->input('limit') : $limit = config('app.max_results');
$limit = $request->input('limit', 50);
$order = $request->input('order') === 'asc' ? 'asc' : 'desc';
$sort = in_array($request->input('sort'), $allowed_columns) ? $request->input('sort') : 'created_at';
$depreciations->orderBy($sort, $order);

View File

@@ -29,10 +29,7 @@ class GroupsController extends Controller
}
$offset = (($groups) && (request('offset') > $groups->count())) ? 0 : request('offset', 0);
// Check to make sure the limit is not higher than the max allowed
((config('app.max_results') >= $request->input('limit')) && ($request->filled('limit'))) ? $limit = $request->input('limit') : $limit = config('app.max_results');
$limit = $request->input('limit', 50);
$order = $request->input('order') === 'asc' ? 'asc' : 'desc';
$sort = in_array($request->input('sort'), $allowed_columns) ? $request->input('sort') : 'created_at';
$groups->orderBy($sort, $order);

View File

@@ -83,10 +83,7 @@ class LicensesController extends Controller
$offset = (($licenses) && (request('offset') > $licenses->count())) ? 0 : request('offset', 0);
// Check to make sure the limit is not higher than the max allowed
((config('app.max_results') >= $request->input('limit')) && ($request->filled('limit'))) ? $limit = $request->input('limit') : $limit = config('app.max_results');
$limit = request('limit', 50);
$order = $request->input('order') === 'asc' ? 'asc' : 'desc';
@@ -228,21 +225,14 @@ class LicensesController extends Controller
$this->authorize('view', $license);
$seats = LicenseSeat::where('license_seats.license_id', $licenseId)
->with('license', 'user', 'asset', 'user.department');
$seats = LicenseSeat::where('license_id', $licenseId)->with('license', 'user', 'asset');
$offset = (($seats) && (request('offset') > $seats->count())) ? 0 : request('offset', 0);
$limit = request('limit', 50);
$order = $request->input('order') === 'asc' ? 'asc' : 'desc';
if ($request->input('sort')=='department') {
$seats->OrderDepartments($order);
} else {
$seats->orderBy('id', $order);
}
$total = $seats->count();
$offset = (($seats) && (request('offset') > $total)) ? 0 : request('offset', 0);
$limit = request('limit', 50);
$seats = $seats->skip($offset)->take($limit)->get();
if ($seats) {

View File

@@ -8,8 +8,6 @@ use App\Helpers\Helper;
use App\Models\Location;
use App\Http\Transformers\LocationsTransformer;
use App\Http\Transformers\SelectlistTransformer;
use Illuminate\Pagination\LengthAwarePaginator;
use Illuminate\Support\Collection;
class LocationsController extends Controller
{
@@ -28,7 +26,7 @@ class LocationsController extends Controller
'updated_at','manager_id','image',
'assigned_assets_count','users_count','assets_count','currency'];
$locations = Location::with('parent', 'manager', 'children')->select([
$locations = Location::with('parent', 'manager', 'childLocations')->select([
'locations.id',
'locations.name',
'locations.address',
@@ -54,10 +52,7 @@ class LocationsController extends Controller
$offset = (($locations) && (request('offset') > $locations->count())) ? 0 : request('offset', 0);
// Check to make sure the limit is not higher than the max allowed
((config('app.max_results') >= $request->input('limit')) && ($request->filled('limit'))) ? $limit = $request->input('limit') : $limit = config('app.max_results');
$limit = $request->input('limit', 50);
$order = $request->input('order') === 'asc' ? 'asc' : 'desc';
$sort = in_array($request->input('sort'), $allowed_columns) ? $request->input('sort') : 'created_at';
@@ -111,7 +106,7 @@ class LocationsController extends Controller
public function show($id)
{
$this->authorize('view', Location::class);
$location = Location::with('parent', 'manager', 'children')
$location = Location::with('parent', 'manager', 'childLocations')
->select([
'locations.id',
'locations.name',
@@ -148,13 +143,6 @@ class LocationsController extends Controller
{
$this->authorize('update', Location::class);
$location = Location::findOrFail($id);
if ($request->input('parent_id') == $id) {
return response()->json(Helper::formatStandardApiResponse('error', null, 'A location cannot be its own parent. Please select a different parent ID.'));
}
$location->fill($request->all());
if ($location->save()) {
@@ -190,27 +178,6 @@ class LocationsController extends Controller
/**
* Gets a paginated collection for the select2 menus
*
* This is handled slightly differently as of ~4.7.8-pre, as
* we have to do some recursive magic to get the hierarchy to display
* properly when looking at the parent/child relationship in the
* rich menus.
*
* This means we can't use the normal pagination that we use elsewhere
* in our selectlists, since we have to get the full set before we can
* determine which location is parent/child/grandchild, etc.
*
* This also means that hierarchy display gets a little funky when people
* use the Select2 search functionality, but there's not much we can do about
* that right now.
*
* As a result, instead of paginating as part of the query, we have to grab
* the entire data set, and then invoke a paginator manually and pass that
* through to the SelectListTransformer.
*
* Many thanks to @uberbrady for the help getting this working better.
* Recursion still sucks, but I guess he doesn't have to get in the
* sea... this time.
*
* @author [A. Gianotto] [<snipe@snipe.net>]
* @since [v4.0.16]
* @see \App\Http\Transformers\SelectlistTransformer
@@ -222,44 +189,25 @@ class LocationsController extends Controller
$locations = Location::select([
'locations.id',
'locations.name',
'locations.parent_id',
'locations.image',
]);
$page = 1;
if ($request->filled('page')) {
$page = $request->input('page');
}
if ($request->filled('search')) {
$locations = $locations->where('locations.name', 'LIKE', '%'.$request->input('search').'%');
$locations = $locations->where('locations.name', 'LIKE', '%'.$request->get('search').'%');
}
$locations = $locations->orderBy('name', 'ASC')->get();
$locations_with_children = [];
$locations = $locations->orderBy('name', 'ASC')->paginate(50);
// Loop through and set some custom properties for the transformer to use.
// This lets us have more flexibility in special cases like assets, where
// they may not have a ->name value but we want to display something anyway
foreach ($locations as $location) {
if (!array_key_exists($location->parent_id, $locations_with_children)) {
$locations_with_children[$location->parent_id] = [];
}
$locations_with_children[$location->parent_id][] = $location;
$location->use_text = $location->name;
$location->use_image = ($location->image) ? url('/').'/uploads/locations/'.$location->image : null;
}
if ($request->filled('search')) {
$locations_formatted = $locations;
} else {
$location_options = Location::indenter($locations_with_children);
$locations_formatted = new Collection($location_options);
}
$paginated_results = new LengthAwarePaginator($locations_formatted->forPage($page, 500), $locations_formatted->count(), 500, $page, []);
//return [];
return (new SelectlistTransformer)->transformSelectlist($paginated_results);
return (new SelectlistTransformer)->transformSelectlist($locations);
}
}

View File

@@ -40,10 +40,7 @@ class ManufacturersController extends Controller
$offset = (($manufacturers) && (request('offset') > $manufacturers->count())) ? 0 : request('offset', 0);
// Check to make sure the limit is not higher than the max allowed
((config('app.max_results') >= $request->input('limit')) && ($request->filled('limit'))) ? $limit = $request->input('limit') : $limit = config('app.max_results');
$limit = $request->input('limit', 50);
$order = $request->input('order') === 'asc' ? 'asc' : 'desc';
$sort = in_array($request->input('sort'), $allowed_columns) ? $request->input('sort') : 'created_at';
$manufacturers->orderBy($sort, $order);

View File

@@ -31,10 +31,7 @@ class StatuslabelsController extends Controller
}
$offset = (($statuslabels) && (request('offset') > $statuslabels->count())) ? 0 : request('offset', 0);
// Check to make sure the limit is not higher than the max allowed
((config('app.max_results') >= $request->input('limit')) && ($request->filled('limit'))) ? $limit = $request->input('limit') : $limit = config('app.max_results');
$limit = $request->input('limit', 50);
$order = $request->input('order') === 'asc' ? 'asc' : 'desc';
$sort = in_array($request->input('sort'), $allowed_columns) ? $request->input('sort') : 'created_at';
$statuslabels->orderBy($sort, $order);

View File

@@ -34,10 +34,7 @@ class SuppliersController extends Controller
}
$offset = (($suppliers) && (request('offset') > $suppliers->count())) ? 0 : request('offset', 0);
// Check to make sure the limit is not higher than the max allowed
((config('app.max_results') >= $request->input('limit')) && ($request->filled('limit'))) ? $limit = $request->input('limit') : $limit = config('app.max_results');
$limit = $request->input('limit', 50);
$order = $request->input('order') === 'asc' ? 'asc' : 'desc';
$sort = in_array($request->input('sort'), $allowed_columns) ? $request->input('sort') : 'created_at';
$suppliers->orderBy($sort, $order);

View File

@@ -88,10 +88,7 @@ class UsersController extends Controller
$order = $request->input('order') === 'asc' ? 'asc' : 'desc';
$offset = (($users) && (request('offset') > $users->count())) ? 0 : request('offset', 0);
// Check to make sure the limit is not higher than the max allowed
((config('app.max_results') >= $request->input('limit')) && ($request->filled('limit'))) ? $limit = $request->input('limit') : $limit = config('app.max_results');
$limit = request('limit', 20);
switch ($request->input('sort')) {
case 'manager':

View File

@@ -90,7 +90,23 @@ class AssetModelsController extends Controller
$model->fieldset_id = e($request->input('custom_fieldset'));
}
$model = $request->handleImages($model,600, public_path().'/uploads/models');
if (Input::file('image')) {
$image = Input::file('image');
$file_name = str_slug($image->getClientOriginalName()) . "." . $image->getClientOriginalExtension();
$path = app('models_upload_path');
if ($image->getClientOriginalExtension()!='svg') {
Image::make($image->getRealPath())->resize(800, null, function ($constraint) {
$constraint->aspectRatio();
$constraint->upsize();
})->save($path.'/'.$file_name);
} else {
$image->move($path, $file_name);
}
$model->image = $file_name;
}
// Was it created?
if ($model->save()) {
@@ -166,7 +182,37 @@ class AssetModelsController extends Controller
}
}
$model = $request->handleImages($model,600, public_path().'/uploads/models');
$old_image = $model->image;
// Set the model's image property to null if the image is being deleted
if ($request->input('image_delete') == 1) {
$model->image = null;
}
if ($request->file('image')) {
$image = $request->file('image');
$file_name = $model->id.'-'.str_slug($image->getClientOriginalName()) . "." . $image->getClientOriginalExtension();
if ($image->getClientOriginalExtension()!='svg') {
Image::make($image->getRealPath())->resize(800, null, function ($constraint) {
$constraint->aspectRatio();
$constraint->upsize();
})->save(app('models_upload_path').$file_name);
} else {
$image->move(app('models_upload_path'), $file_name);
}
$model->image = $file_name;
}
if ((($request->file('image')) && (isset($old_image)) && ($old_image!='')) || ($request->input('image_delete') == 1)) {
try {
unlink(app('models_upload_path').$old_image);
} catch (\Exception $e) {
\Log::info($e);
}
}
if ($model->save()) {
return redirect()->route("models.index")->with('success', trans('admin/models/message.update.success'));

View File

@@ -394,12 +394,6 @@ class AssetsController extends Controller
if ($asset->save()) {
// Update any assigned assets with the new location_id from the parent asset
Asset::where('assigned_type', '\\App\\Models\\Asset')->where('assigned_to', $asset->id)
->update(['location_id' => $asset->location_id]);
// Redirect to the new asset page
\Session::flash('success', trans('admin/hardware/message.update.success'));
return response()->json(['redirect_url' => route("hardware.show", $assetId)]);
@@ -576,17 +570,15 @@ class AssetsController extends Controller
*/
public function postImportHistory(Request $request)
{
if (!$request->hasFile('user_import_csv')) {
return back()->with('error', 'No file provided. Please select a file for import and try again. ');
}
if (!ini_get("auto_detect_line_endings")) {
ini_set("auto_detect_line_endings", '1');
}
$csv = Reader::createFromPath(Input::file('user_import_csv'));
$csv->setHeaderOffset(0);
$csv->setNewline("\r\n");
//get the first row, usually the CSV header
//$headers = $csv->fetchOne();
$results = $csv->getRecords();
$item = array();
$status = array();
@@ -603,9 +595,7 @@ class AssetsController extends Controller
}
$batch_counter = count($item[$asset_tag]);
$item[$asset_tag][$batch_counter]['checkout_date'] = Carbon::parse(Helper::array_smart_fetch($row, "checkout date"))->format('Y-m-d H:i:s');
$item[$asset_tag][$batch_counter]['checkin_date'] = Carbon::parse(Helper::array_smart_fetch($row, "checkin date"))->format('Y-m-d H:i:s');
\Log::debug($item[$asset_tag][$batch_counter]['checkin_date']);
$item[$asset_tag][$batch_counter]['checkout_date'] = Carbon::parse(Helper::array_smart_fetch($row, "date"))->format('Y-m-d H:i:s');
$item[$asset_tag][$batch_counter]['asset_tag'] = Helper::array_smart_fetch($row, "asset tag");
$item[$asset_tag][$batch_counter]['name'] = Helper::array_smart_fetch($row, "name");
@@ -688,11 +678,9 @@ class AssetsController extends Controller
// Only do this if a matching user was found
if ((array_key_exists('checkedout_to', $asset_batch[$x])) && ($asset_batch[$x]['checkedout_to']!='')) {
if (($total_in_batch > 1) && ($x < $total_in_batch) && (array_key_exists($next, $asset_batch))) {
$checkin_date = Carbon::parse($asset_batch[$next]['checkin_date'])->format('Y-m-d H:i:s');
$checkin_date = Carbon::parse($asset_batch[$next]['checkout_date'])->subDay(1)->format('Y-m-d H:i:s');
$asset_batch[$x]['real_checkin'] = $checkin_date;
\Log::debug($asset_batch[$next]['checkin_date']);
\Log::debug($checkin_date);
Actionlog::firstOrCreate(array(
'item_id' => $asset_batch[$x]['asset_id'],
'item_type' => Asset::class,

View File

@@ -83,7 +83,17 @@ class CategoriesController extends Controller
$category->checkin_email = $request->input('checkin_email', '0');
$category->user_id = Auth::id();
$category = $request->handleImages($category,600, public_path().'/uploads/categories');
if ($request->file('image')) {
$image = $request->file('image');
$file_name = str_random(25).".".$image->getClientOriginalExtension();
$path = public_path('uploads/categories/'.$file_name);
Image::make($image->getRealPath())->resize(800, null, function ($constraint) {
$constraint->aspectRatio();
$constraint->upsize();
})->save($path);
$category->image = $file_name;
}
if ($category->save()) {
return redirect()->route('categories.index')->with('success', trans('admin/categories/message.create.success'));
@@ -142,12 +152,37 @@ class CategoriesController extends Controller
$category->require_acceptance = $request->input('require_acceptance', '0');
$category->checkin_email = $request->input('checkin_email', '0');
$old_image = $category->image;
// Set the model's image property to null if the image is being deleted
if ($request->input('image_delete') == 1) {
$category->image = null;
}
$category = $request->handleImages($category,600, public_path().'/uploads/categories');
if ($request->file('image')) {
$image = $request->file('image');
$file_name = $category->id.'-'.str_slug($image->getClientOriginalName()) . "." . $image->getClientOriginalExtension();
if ($image->getClientOriginalExtension()!='svg') {
Image::make($image->getRealPath())->resize(800, null, function ($constraint) {
$constraint->aspectRatio();
$constraint->upsize();
})->save(app('categories_upload_path').$file_name);
} else {
$image->move(app('categories_upload_path'), $file_name);
}
$category->image = $file_name;
}
if ((($request->file('image')) && (isset($old_image)) && ($old_image!='')) || ($request->input('image_delete') == 1)) {
try {
unlink(app('categories_upload_path').$old_image);
} catch (\Exception $e) {
\Log::info($e);
}
}
if ($category->save()) {
// Redirect to the new category page

View File

@@ -63,7 +63,16 @@ final class CompaniesController extends Controller
$company = new Company;
$company->name = $request->input('name');
$company = $request->handleImages($company,600, public_path().'/uploads/companies');
if ($request->file('image')) {
$image = $request->file('image');
$file_name = str_random(25).".".$image->getClientOriginalExtension();
$path = public_path('uploads/companies/'.$file_name);
Image::make($image->getRealPath())->resize(800, null, function ($constraint) {
$constraint->aspectRatio();
$constraint->upsize();
})->save($path);
$company->image = $file_name;
}
if ($company->save()) {
return redirect()->route('companies.index')
@@ -112,12 +121,36 @@ final class CompaniesController extends Controller
$company->name = $request->input('name');
$old_image = $company->image;
// Set the model's image property to null if the image is being deleted
if ($request->input('image_delete') == 1) {
$company->image = null;
}
$company = $request->handleImages($company,600, public_path().'/uploads/companies');
if ($request->file('image')) {
$image = $request->file('image');
$file_name = $company->id.'-'.str_slug($image->getClientOriginalName()) . "." . $image->getClientOriginalExtension();
if ($image->getClientOriginalExtension()!='svg') {
Image::make($image->getRealPath())->resize(800, null, function ($constraint) {
$constraint->aspectRatio();
$constraint->upsize();
})->save(app('companies_upload_path').$file_name);
} else {
$image->move(app('companies_upload_path'), $file_name);
}
$company->image = $file_name;
}
if ((($request->file('image')) && (isset($old_image)) && ($old_image!='')) || ($request->input('image_delete') == 1)) {
try {
unlink(app('companies_upload_path').$old_image);
} catch (\Exception $e) {
\Log::info($e);
}
}
if ($company->save()) {

View File

@@ -91,7 +91,16 @@ class ComponentsController extends Controller
$component->user_id = Auth::id();
$component = $request->handleImages($component,600, public_path().'/uploads/components');
if ($request->file('image')) {
$image = $request->file('image');
$file_name = str_random(25).".".$image->getClientOriginalExtension();
$path = public_path('uploads/components/'.$file_name);
Image::make($image->getRealPath())->resize(800, null, function ($constraint) {
$constraint->aspectRatio();
$constraint->upsize();
})->save($path);
$component->image = $file_name;
}
if ($component->save()) {
return redirect()->route('components.index')->with('success', trans('admin/components/message.create.success'));
@@ -155,7 +164,18 @@ class ComponentsController extends Controller
$component->purchase_cost = request('purchase_cost');
$component->qty = Input::get('qty');
$component = $request->handleImages($component,600, public_path().'/uploads/components');
if ($request->file('image')) {
$image = $request->file('image');
$file_name = str_random(25).".".$image->getClientOriginalExtension();
$path = public_path('uploads/components/'.$file_name);
Image::make($image->getRealPath())->resize(800, null, function ($constraint) {
$constraint->aspectRatio();
$constraint->upsize();
})->save($path);
$component->image = $file_name;
} elseif ($request->input('image_delete')=='1') {
$component->image = null;
}
if ($component->save()) {
return redirect()->route('components.index')->with('success', trans('admin/components/message.update.success'));

View File

@@ -87,8 +87,16 @@ class ConsumablesController extends Controller
$consumable->user_id = Auth::id();
$consumable = $request->handleImages($consumable,600, public_path().'/uploads/components');
if ($request->file('image')) {
$image = $request->file('image');
$file_name = str_random(25).".".$image->getClientOriginalExtension();
$path = public_path('uploads/consumables/'.$file_name);
Image::make($image->getRealPath())->resize(800, null, function ($constraint) {
$constraint->aspectRatio();
$constraint->upsize();
})->save($path);
$consumable->image = $file_name;
}
if ($consumable->save()) {
return redirect()->route('consumables.index')->with('success', trans('admin/consumables/message.create.success'));

View File

@@ -53,7 +53,16 @@ class DepartmentsController extends Controller
$department->user_id = Auth::user()->id;
$department->manager_id = ($request->filled('manager_id' ) ? $request->input('manager_id') : null);
$department = $request->handleImages($department,600, public_path().'/uploads/departments');
if ($request->file('image')) {
$image = $request->file('image');
$file_name = str_random(25).".".$image->getClientOriginalExtension();
$path = public_path('uploads/departments/'.$file_name);
Image::make($image->getRealPath())->resize(800, null, function ($constraint) {
$constraint->aspectRatio();
$constraint->upsize();
})->save($path);
$department->image = $file_name;
}
if ($department->save()) {
return redirect()->route("departments.index")->with('success', trans('admin/departments/message.create.success'));
@@ -155,7 +164,36 @@ class DepartmentsController extends Controller
$department->fill($request->all());
$department->manager_id = ($request->filled('manager_id' ) ? $request->input('manager_id') : null);
$department = $request->handleImages($department,600, public_path().'/uploads/departments');
$old_image = $department->image;
// Set the model's image property to null if the image is being deleted
if ($request->input('image_delete') == 1) {
$department->image = null;
}
if ($request->file('image')) {
$image = $request->file('image');
$file_name = $department->id.'-'.str_slug($image->getClientOriginalName()) . "." . $image->getClientOriginalExtension();
if ($image->getClientOriginalExtension()!='svg') {
Image::make($image->getRealPath())->resize(800, null, function ($constraint) {
$constraint->aspectRatio();
$constraint->upsize();
})->save(app('departments_upload_path').$file_name);
} else {
$image->move(app('departments_upload_path'), $file_name);
}
$department->image = $file_name;
}
if ((($request->file('image')) && (isset($old_image)) && ($old_image!='')) || ($request->input('image_delete') == 1)) {
try {
unlink(app('departments_upload_path').$old_image);
} catch (\Exception $e) {
\Log::info($e);
}
}
if ($department->save()) {
return redirect()->route("departments.index")->with('success', trans('admin/departments/message.update.success'));

View File

@@ -41,6 +41,8 @@ class LocationsController extends Controller
{
// Grab all the locations
$this->authorize('view', Location::class);
$locations = Location::orderBy('created_at', 'DESC')->with('parent', 'assets', 'assignedassets')->get();
// Show the page
return view('locations/index');
}
@@ -57,7 +59,14 @@ class LocationsController extends Controller
public function create()
{
$this->authorize('create', Location::class);
$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('locations/edit')
->with('location_options', $location_options)
->with('item', new Location);
}
@@ -88,7 +97,16 @@ class LocationsController extends Controller
$location->manager_id = $request->input('manager_id');
$location->user_id = Auth::id();
$location = $request->handleImages($location,600, public_path().'/uploads/locations');
if ($request->file('image')) {
$image = $request->file('image');
$file_name = str_random(25).".".$image->getClientOriginalExtension();
$path = public_path('uploads/locations/'.$file_name);
Image::make($image->getRealPath())->resize(800, null, function ($constraint) {
$constraint->aspectRatio();
$constraint->upsize();
})->save($path);
$location->image = $file_name;
}
if ($location->save()) {
return redirect()->route("locations.index")->with('success', trans('admin/locations/message.create.success'));
@@ -114,8 +132,14 @@ class LocationsController extends Controller
return redirect()->route('locations.index')->with('error', trans('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;
return view('locations/edit', compact('item'));
return view('locations/edit', compact('item'))
->with('location_options', $location_options);
}
@@ -136,11 +160,6 @@ class LocationsController extends Controller
return redirect()->route('locations.index')->with('error', trans('admin/locations/message.does_not_exist'));
}
if ($request->input('parent_id') == $locationId) {
return redirect()->back()->withInput()->with('error', 'A location cannot be its own parent. Please select a different parent location.');
}
// Update the location data
$location->name = $request->input('name');
$location->parent_id = $request->input('parent_id', null);
@@ -153,7 +172,37 @@ class LocationsController extends Controller
$location->zip = $request->input('zip');
$location->ldap_ou = $request->input('ldap_ou');
$location->manager_id = $request->input('manager_id');
$location = $request->handleImages($location,600, public_path().'/uploads/locations');
$old_image = $location->image;
// Set the model's image property to null if the image is being deleted
if ($request->input('image_delete') == 1) {
$location->image = null;
}
if ($request->file('image')) {
$image = $request->file('image');
$file_name = $location->id.'-'.str_slug($image->getClientOriginalName()) . "." . $image->getClientOriginalExtension();
if ($image->getClientOriginalExtension()!='svg') {
Image::make($image->getRealPath())->resize(800, null, function ($constraint) {
$constraint->aspectRatio();
$constraint->upsize();
})->save(app('locations_upload_path').$file_name);
} else {
$image->move(app('locations_upload_path'), $file_name);
}
$location->image = $file_name;
}
if ((($request->file('image')) && (isset($old_image)) && ($old_image!='')) || ($request->input('image_delete') == 1)) {
try {
unlink(app('locations_upload_path').$old_image);
} catch (\Exception $e) {
\Log::info($e);
}
}
if ($location->save()) {
@@ -180,7 +229,7 @@ class LocationsController extends Controller
if ($location->users->count() > 0) {
return redirect()->to(route('locations.index'))->with('error', trans('admin/locations/message.assoc_users'));
} elseif ($location->children->count() > 0) {
} elseif ($location->childLocations->count() > 0) {
return redirect()->to(route('locations.index'))->with('error', trans('admin/locations/message.assoc_child_loc'));
} elseif ($location->assets->count() > 0) {

View File

@@ -75,7 +75,18 @@ class ManufacturersController extends Controller
$manufacturer->support_url = $request->input('support_url');
$manufacturer->support_phone = $request->input('support_phone');
$manufacturer->support_email = $request->input('support_email');
$manufacturer = $request->handleImages($manufacturer,600, public_path().'/uploads/manufacturers');
if ($request->file('image')) {
$image = $request->file('image');
$file_name = str_slug($image->getClientOriginalName()).".".$image->getClientOriginalExtension();
$path = public_path('uploads/manufacturers/'.$file_name);
Image::make($image->getRealPath())->resize(800, null, function ($constraint) {
$constraint->aspectRatio();
$constraint->upsize();
})->save($path);
$manufacturer->image = $file_name;
}
@@ -131,14 +142,37 @@ class ManufacturersController extends Controller
$manufacturer->support_url = $request->input('support_url');
$manufacturer->support_phone = $request->input('support_phone');
$manufacturer->support_email = $request->input('support_email');
$old_image = $manufacturer->image;
// Set the model's image property to null if the image is being deleted
if ($request->input('image_delete') == 1) {
$manufacturer->image = null;
}
$manufacturer = $request->handleImages($manufacturer,600, public_path().'/uploads/manufacturers');
if ($request->file('image')) {
$image = $request->file('image');
$file_name = $manufacturer->id.'-'.str_slug($image->getClientOriginalName()) . "." . $image->getClientOriginalExtension();
if ($image->getClientOriginalExtension()!='svg') {
Image::make($image->getRealPath())->resize(800, null, function ($constraint) {
$constraint->aspectRatio();
$constraint->upsize();
})->save(app('manufacturers_upload_path').$file_name);
} else {
$image->move(app('manufacturers_upload_path'), $file_name);
}
$manufacturer->image = $file_name;
}
if ((($request->file('image')) && (isset($old_image)) && ($old_image!='')) || ($request->input('image_delete') == 1)) {
try {
unlink(app('manufacturers_upload_path').$old_image);
} catch (\Exception $e) {
\Log::info($e);
}
}
if ($manufacturer->save()) {

View File

@@ -307,18 +307,12 @@ class ReportsController extends Controller
public function postCustom(Request $request)
{
ini_set('max_execution_time', 12000);
\Debugbar::disable();
$customfields = CustomField::get();
$response = new StreamedResponse(function () use ($customfields, $request) {
\Log::debug('Starting streamed response');
// Open output stream
$handle = fopen('php://output', 'w');
stream_set_timeout($handle, 2000);
if ($request->filled('use_bom')) {
fprintf($handle, chr(0xEF) . chr(0xBB) . chr(0xBF));
@@ -470,12 +464,8 @@ class ReportsController extends Controller
}
}
$executionTime = microtime(true) - $_SERVER["REQUEST_TIME_FLOAT"];
\Log::debug('Starting headers: '.$executionTime);
fputcsv($handle, $header);
$executionTime = microtime(true) - $_SERVER["REQUEST_TIME_FLOAT"];
\Log::debug('Added headers: '.$executionTime);
fputcsv($handle, $header);
$assets = \App\Models\Company::scopeCompanyables(Asset::select('assets.*'))->with(
'location', 'assetstatus', 'assetlog', 'company', 'defaultLoc','assignedTo',
@@ -530,13 +520,9 @@ class ReportsController extends Controller
$assets->whereBetween('assets.expected_checkin', [$request->input('expected_checkin_start'), $request->input('expected_checkin_end')]);
}
$assets->orderBy('assets.created_at', 'ASC')->chunk(20, function($assets) use($handle, $customfields, $request) {
$assets->orderBy('assets.created_at', 'ASC')->chunk(500, function($assets) use($handle, $customfields, $request) {
$executionTime = microtime(true) - $_SERVER["REQUEST_TIME_FLOAT"];
\Log::debug('Walking results: '.$executionTime);
$count = 0;
foreach ($assets as $asset) {
$count++;
$row = [];
if ($request->filled('company')) {
@@ -709,24 +695,17 @@ class ReportsController extends Controller
}
}
fputcsv($handle, $row);
$executionTime = microtime(true) - $_SERVER["REQUEST_TIME_FLOAT"];
\Log::debug('-- Record '.$count.' Asset ID:' .$asset->id. ' in '. $executionTime);
}
});
// Close the output stream
fclose($handle);
$executionTime = microtime(true) - $_SERVER["REQUEST_TIME_FLOAT"];
\Log::debug('-- SCRIPT COMPLETED IN '. $executionTime);
}, 200, [
'Content-Type' => 'text/csv',
'Content-Disposition'
=> 'attachment; filename="custom-assets-report-'.date('Y-m-d-his').'.csv"',
]);
return $response;

View File

@@ -1,7 +1,6 @@
<?php
namespace App\Http\Controllers;
use enshrined\svgSanitize\Sanitizer;
use Input;
use Lang;
use Illuminate\Http\Request;
@@ -427,23 +426,12 @@ class SettingsController extends Controller
$file_name = "logo.".$image->getClientOriginalExtension();
$path = public_path('uploads');
if ($image->getClientOriginalExtension()!='svg') {
Image::make($image->getRealPath())->resize(null, 150, function ($constraint) {
$constraint->aspectRatio();
$constraint->upsize();
})->save($path.'/'.$file_name);
} else {
// This is kinda copypasta from the ImageUploadRequest - should refactor the ImageUploadRequest to better handle maybe
$sanitizer = new Sanitizer();
$dirtySVG = file_get_contents($image->getRealPath());
$cleanSVG = $sanitizer->sanitize($dirtySVG);
try {
file_put_contents($path.'/'.$file_name, $cleanSVG);
} catch (\Exception $e) {
\Log::debug($e);
}
$image->move($path, $file_name);
}
$setting->logo = $file_name;
}

View File

@@ -78,8 +78,17 @@ class SuppliersController extends Controller
$supplier->notes = request('notes');
$supplier->url = $supplier->addhttp(request('url'));
$supplier->user_id = Auth::id();
$supplier = $request->handleImages($supplier,600, public_path().'/uploads/suppliers');
if ($request->file('image')) {
$image = $request->file('image');
$file_name = str_random(25).".".$image->getClientOriginalExtension();
$path = public_path('uploads/suppliers/'.$file_name);
Image::make($image->getRealPath())->resize(800, null, function ($constraint) {
$constraint->aspectRatio();
$constraint->upsize();
})->save($path);
$supplier->image = $file_name;
}
if ($supplier->save()) {
return redirect()->route('suppliers.index')->with('success', trans('admin/suppliers/message.create.success'));
@@ -136,7 +145,39 @@ class SuppliersController extends Controller
$supplier->email = request('email');
$supplier->url = $supplier->addhttp(request('url'));
$supplier->notes = request('notes');
$supplier = $request->handleImages($supplier,600, public_path().'/uploads/suppliers');
$old_image = $supplier->image;
// Set the model's image property to null if the image is being deleted
if ($request->input('image_delete') == 1) {
$supplier->image = null;
}
if ($request->file('image')) {
$image = $request->file('image');
$file_name = $supplier->id.'-'.str_slug($image->getClientOriginalName()) . "." . $image->getClientOriginalExtension();
if ($image->getClientOriginalExtension()!='svg') {
Image::make($image->getRealPath())->resize(800, null, function ($constraint) {
$constraint->aspectRatio();
$constraint->upsize();
})->save(app('suppliers_upload_path').$file_name);
} else {
$image->move(app('suppliers_upload_path'), $file_name);
}
$supplier->image = $file_name;
}
if ((($request->file('image')) && (isset($old_image)) && ($old_image!='')) || ($request->input('image_delete') == 1)) {
try {
unlink(app('suppliers_upload_path').$old_image);
} catch (\Exception $e) {
\Log::info($e);
}
}
if ($supplier->save()) {
return redirect()->route('suppliers.index')->with('success', trans('admin/suppliers/message.update.success'));

View File

@@ -2,9 +2,7 @@
namespace App\Http\Requests;
use App\Models\SnipeModel;
use Intervention\Image\Facades\Image;
use enshrined\svgSanitize\Sanitizer;
use App\Http\Requests\Request;
class ImageUploadRequest extends Request
{
@@ -35,83 +33,4 @@ class ImageUploadRequest extends Request
{
return $this->redirector->back()->withInput()->withErrors($errors, $this->errorBag);
}
/**
* Handle and store any images attached to request
* @param SnipeModel $item Item the image is associated with
* @param String $path location for uploaded images, defaults to uploads/plural of item type.
* @return SnipeModel Target asset is being checked out to.
*/
public function handleImages($item, $w = 600, $path = null)
{
$type = strtolower(class_basename(get_class($item)));
if (is_null($path)) {
$path = str_plural($type);
}
\Log::debug('Trying to upload to '. $path);
if ($this->hasFile('image')) {
if (!config('app.lock_passwords')) {
if (!is_dir($path)) {
\Log::debug($path.' does not exist');
mkdir($path);
}
$image = $this->file('image');
$ext = $image->getClientOriginalExtension();
$file_name = $type.'-'.str_random(18).'.'.$ext;
\Log::debug('File name will be: '.$file_name);
if ($image->getClientOriginalExtension()!=='svg') {
\Log::debug('Not an SVG - resize');
\Log::debug('Trying to upload to: '.$path.'/'.$file_name);
$upload = Image::make($image->getRealPath())->resize(null, $w, function ($constraint) {
$constraint->aspectRatio();
$constraint->upsize();
})->save($path.'/'.$file_name);
} else {
\Log::debug('This is an SVG');
$sanitizer = new Sanitizer();
$dirtySVG = file_get_contents($image->getRealPath());
$cleanSVG = $sanitizer->sanitize($dirtySVG);
try {
\Log::debug('Trying to upload to: '.$path.'/'.$file_name);
file_put_contents($path.'/'.$file_name, $cleanSVG);
} catch (\Exception $e) {
\Log::debug($e);
}
}
// Remove Current image if exists
if (($item->image) && (file_exists($path.'/'.$item->image))) {
try {
unlink($path.'/'.$item->image);
} catch (\Exception $e) {
\Log::debug($e);
}
}
$item->image = $file_name;
}
} elseif ($this->input('image_delete')=='1') {
try {
unlink($path.'/'.$item->image);
} catch (\Exception $e) {
\Log::debug($e);
}
$item->image = null;
}
return $item;
}
}
}

View File

@@ -32,15 +32,7 @@ class ActionlogsTransformer
$meta_array = json_decode($actionlog->log_meta);
foreach ($meta_array as $key => $value) {
foreach ($value as $meta_key => $meta_value) {
if (is_array($meta_value)) {
foreach ($meta_value as $meta_value_key => $meta_value_value) {
$clean_meta[$key][$meta_value_key] = e($meta_value_value);
}
} else {
$clean_meta[$key][$meta_key] = e($meta_value);
}
$clean_meta[$key][$meta_key] = e($meta_value);
}
}
}

View File

@@ -5,7 +5,6 @@ use App\Models\AssetMaintenance;
use Gate;
use Illuminate\Database\Eloquent\Collection;
use App\Helpers\Helper;
use App\Models\Asset;
class AssetMaintenancesTransformer
{

View File

@@ -29,14 +29,7 @@ class LicenseSeatsTransformer
'name' => 'Seat '.$seat_count,
'assigned_user' => ($seat->user) ? [
'id' => (int) $seat->user->id,
'name'=> e($seat->user->present()->fullName),
'department'=>
($seat->user->department) ?
[
"id" => (int) $seat->user->department->id,
"name" => e($seat->user->department->name)
] : null
'name'=> e($seat->user->present()->fullName)
] : null,
'assigned_asset' => ($seat->asset) ? [
'id' => (int) $seat->asset->id,

View File

@@ -23,7 +23,7 @@ class LocationsTransformer
if ($location) {
$children_arr = [];
foreach($location->children as $child) {
foreach($location->childLocations as $child) {
$children_arr[] = [
'id' => (int) $child->id,
'name' => $child->name

View File

@@ -27,17 +27,9 @@ class AssetImporter extends ItemImporter
foreach ($this->customFields as $customField) {
$customFieldValue = $this->array_smart_custom_field_fetch($row, $customField);
if ($customFieldValue) {
if ($customField->field_encrypted == 1) {
$this->item['custom_fields'][$customField->db_column_name()] = \Crypt::encrypt($customFieldValue);
$this->log('Custom Field '. $customField->name.': '.\Crypt::encrypt($customFieldValue));
} else {
$this->item['custom_fields'][$customField->db_column_name()] = $customFieldValue;
$this->log('Custom Field '. $customField->name.': '.$customFieldValue);
}
$this->item['custom_fields'][$customField->db_column_name()] = $customFieldValue;
$this->log('Custom Field '. $customField->name.': '.$customFieldValue);
} else {
// Clear out previous data.
$this->item['custom_fields'][$customField->db_column_name()] = null;

View File

@@ -821,11 +821,9 @@ class Asset extends Depreciable
public function scopeDueForAudit($query, $settings)
{
$interval = $settings->audit_warning_days ?? 0;
return $query->whereNotNull('assets.next_audit_date')
->where('assets.next_audit_date', '>=', Carbon::now())
->whereRaw("DATE_SUB(assets.next_audit_date, INTERVAL $interval DAY) <= '".Carbon::now()."'")
->whereRaw("DATE_SUB(assets.next_audit_date, INTERVAL $settings->audit_warning_days DAY) <= '".Carbon::now()."'")
->where('assets.archived', '=', 0)
->NotArchived();
}
@@ -1169,29 +1167,7 @@ class Asset extends Depreciable
}
}
/**
* THIS CLUNKY BIT IS VERY IMPORTANT
*
* Although inelegant, this section matters a lot when querying against fields that do not
* exist on the asset table. There's probably a better way to do this moving forward, for
* example using the Schema:: methods to determine whether or not a column actually exists,
* or even just using the $searchableRelations variable earlier in this file.
*
* In short, this set of statements tells the query builder to ONLY query against an
* actual field that's being passed if it doesn't meet known relational fields. This
* allows us to query custom fields directly in the assetsv table
* (regardless of their name) and *skip* any fields that we already know can only be
* searched through relational searches that we do earlier in this method.
*
* For example, we do not store "location" as a field on the assets table, we store
* that relationship through location_id on the assets table, therefore querying
* assets.location would fail, as that field doesn't exist -- plus we're already searching
* against those relationships earlier in this method.
*
* - snipe
*
*/
if (($fieldname!='category') && ($fieldname!='model_number') && ($fieldname!='rtd_location') && ($fieldname!='location') && ($fieldname!='supplier')
if (($fieldname!='category') && ($fieldname!='model_number') && ($fieldname!='location') && ($fieldname!='supplier')
&& ($fieldname!='status_label') && ($fieldname!='model') && ($fieldname!='company') && ($fieldname!='manufacturer')) {
$query->orWhere('assets.'.$fieldname, 'LIKE', '%' . $search_val . '%');
}
@@ -1391,7 +1367,8 @@ class Asset extends Depreciable
/**
* Query builder scope to search on depreciation name
* Query builder scope to search on location ID
*
* @param \Illuminate\Database\Query\Builder $query Query builder instance
* @param text $search Search term
*

View File

@@ -73,8 +73,7 @@ class AssetMaintenance extends Model implements ICompanyableChild
trans('admin/asset_maintenances/general.upgrade') => trans('admin/asset_maintenances/general.upgrade'),
'PAT test' => 'PAT test',
trans('admin/asset_maintenances/general.calibration') => trans('admin/asset_maintenances/general.calibration'),
'Software Support' => trans('admin/asset_maintenances/general.software_support'),
'Hardware Support' => trans('admin/asset_maintenances/general.hardware_support'),
'PAT test' => 'PAT test',
];
}

View File

@@ -48,7 +48,7 @@ class License extends Depreciable
protected $table = 'licenses';
protected $rules = array(
'name' => 'required|string|min:3|max:255',
'seats' => 'required|min:1|max:999|integer',
'seats' => 'required|min:1|max:1000000|integer',
'license_email' => 'email|nullable|max:120',
'license_name' => 'string|nullable|max:100',
'notes' => 'string|nullable',

View File

@@ -55,23 +55,4 @@ class LicenseSeat extends Model implements ICompanyableChild
return false;
}
/**
* Query builder scope to order on department
*
* @param \Illuminate\Database\Query\Builder $query Query builder instance
* @param text $order Order
*
* @return \Illuminate\Database\Query\Builder Modified query builder
*/
public function scopeOrderDepartments($query, $order)
{
return $query->leftJoin('users as license_seat_users', 'license_seats.assigned_to', '=', 'license_seat_users.id')
->leftJoin('departments as license_user_dept', 'license_user_dept.id', '=', 'license_seat_users.department_id')
->orderBy('license_user_dept.name', $order);
}
}

View File

@@ -113,8 +113,7 @@ class Location extends SnipeModel
public function parent()
{
return $this->belongsTo('\App\Models\Location', 'parent_id','id')
->with('parent');
return $this->belongsTo('\App\Models\Location', 'parent_id','id');
}
public function manager()
@@ -122,9 +121,9 @@ class Location extends SnipeModel
return $this->belongsTo('\App\Models\User', 'manager_id');
}
public function children() {
return $this->hasMany('\App\Models\Location','parent_id')
->with('children');
public function childLocations()
{
return $this->hasMany('\App\Models\Location', 'parent_id');
}
// I don't think we need this anymore since we de-normed location_id in assets?
@@ -138,39 +137,59 @@ class Location extends SnipeModel
return $this->attributes['ldap_ou'] = empty($ldap_ou) ? null : $ldap_ou;
}
/**
* Query builder scope to order on parent
*
* @param Illuminate\Database\Query\Builder $query Query builder instance
* @param text $order Order
*
* @return Illuminate\Database\Query\Builder Modified query builder
*/
public static function indenter($locations_with_children, $parent_id = null, $prefix = '') {
$results = Array();
if (!array_key_exists($parent_id, $locations_with_children)) {
return [];
}
public static function getLocationHierarchy($locations, $parent_id = null)
{
foreach ($locations_with_children[$parent_id] as $location) {
$location->use_text = $prefix.' '.$location->name;
$location->use_image = ($location->image) ? url('/').'/uploads/locations/'.$location->image : null;
$results[] = $location;
//now append the children. (if we have any)
if (array_key_exists($location->id, $locations_with_children)) {
$results = array_merge($results, Location::indenter($locations_with_children, $location->id,$prefix.'--'));
$op = array();
foreach ($locations as $location) {
if ($location['parent_id'] == $parent_id) {
$op[$location['id']] =
array(
'name' => $location['name'],
'parent_id' => $location['parent_id']
);
// Using recursion
$children = Location::getLocationHierarchy($locations, $location['id']);
if ($children) {
$op[$location['id']]['children'] = $children;
}
}
}
return $results;
return $op;
}
public static function flattenLocationsArray($location_options_array = null)
{
$location_options = array();
foreach ($location_options_array as $id => $value) {
// get the top level key value
$location_options[$id] = $value['name'];
// If there is a key named children, it has child locations and we have to walk it
if (array_key_exists('children', $value)) {
foreach ($value['children'] as $child_id => $child_location_array) {
$child_location_options = Location::flattenLocationsArray($value['children']);
foreach ($child_location_options as $child_id => $child_name) {
$location_options[$child_id] = '--'.$child_name;
}
}
}
}
return $location_options;
}
/**
* Query builder scope to order on parent

View File

@@ -258,17 +258,13 @@ class AssetPresenter extends Presenter
$query->whereHas('models');
})->get();
// Note: We do not need to e() escape the field names here, as they are already escaped when
// they are presented in the blade view. If we escape them here, custom fields with quotes in their
// name can break the listings page. - snipe
foreach ($fields as $field) {
$layout[] = [
"field" => 'custom_fields.'.$field->convertUnicodeDbSlug(),
"searchable" => true,
"sortable" => true,
"switchable" => true,
"title" => ($field->field_encrypted=='1') ?'<i class="fa fa-lock"></i> '.$field->name : $field->name,
"title" => ($field->field_encrypted=='1') ?'<i class="fa fa-lock"></i> '.e($field->name) : e($field->name),
"formatter" => "customFieldsFormatter"
];

View File

@@ -176,15 +176,6 @@ class LicensePresenter extends Presenter
"visible" => true,
"formatter" => "usersLinkObjFormatter"
], [
"field" => "department",
"searchable" => false,
"sortable" => true,
"switchable" => true,
"title" => trans('general.department'),
"visible" => false,
"formatter" => "departmentNameLinkFormatter"
],
[
"field" => "assigned_asset",
"searchable" => false,
"sortable" => false,
@@ -200,8 +191,7 @@ class LicensePresenter extends Presenter
"title" => trans('general.location'),
"visible" => true,
"formatter" => "locationsLinkObjFormatter"
],
[
], [
"field" => "checkincheckout",
"searchable" => false,
"sortable" => false,

View File

@@ -14,7 +14,6 @@
"doctrine/inflector": "^1.3",
"doctrine/instantiator": "^1.2",
"eduardokum/laravel-mail-auto-embed": "^1.0",
"enshrined/svg-sanitize": "^0.13.0",
"erusev/parsedown": "^1.7",
"fideloper/proxy": "^4.1",
"guzzlehttp/guzzle": "^6.3",
@@ -28,7 +27,7 @@
"maknz/slack": "^1.7",
"neitanod/forceutf8": "^2.0",
"patchwork/utf8": "^1.3",
"phpdocumentor/reflection-docblock": "^4.0",
"phpdocumentor/reflection-docblock": "3.2.2",
"phpspec/prophecy": "^1.8",
"pragmarx/google2fa": "^5.0",
"pragmarx/google2fa-laravel": "^1.0",

1278
composer.lock generated

File diff suppressed because it is too large Load Diff

View File

@@ -36,19 +36,6 @@ return [
'env' => env('APP_ENV', 'production'),
/*
|--------------------------------------------------------------------------
| Result Limit
|--------------------------------------------------------------------------
|
| This value determines the max number of results to return, even if a higher limit
| is passed in the API request. This is done to prevent server timeouts when
| custom scripts are requesting 100k assets at a time.
|
*/
'max_results' => env('MAX_RESULTS', 500),
/*
|--------------------------------------------------------------------------
| Application Debug Mode

View File

@@ -1,10 +1,10 @@
<?php
return array (
'app_version' => 'v4.8.0',
'full_app_version' => 'v4.8.0 - build 4186-g893454dca',
'build_version' => '4186',
'app_version' => 'v4.7.5',
'full_app_version' => 'v4.7.5 - build 4137-g55ee90b25',
'build_version' => '4137',
'prerelease_version' => '',
'hash_version' => 'g893454dca',
'full_hash' => 'v4.8.0-g893454dca',
'hash_version' => 'g55ee90b25',
'full_hash' => 'v4.7.5-18-g55ee90b25',
'branch' => 'master',
);
);

View File

@@ -10,7 +10,7 @@
"production": "cross-env NODE_ENV=production node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js "
},
"devDependencies": {
"axios": ">=0.18.1",
"axios": "^0.16.2",
"babel-preset-latest": "^6.24.1",
"cross-env": "^5.0.5",
"jquery": "^3.1.1",

View File

@@ -1,22 +0,0 @@
<?php
return array(
'about_accessories_title' => 'Amdan Ategolion',
'about_accessories_text' => 'Mae ategolion yn unrhyw offer sydd yn cael eu ddosbarthu i defnyddwyr ond ddim hefo rhif cofrestru. (Neu nid oes angen tracio). Er enghraifft, llygod, ategolion.',
'accessory_category' => 'Categori Ategolyn',
'accessory_name' => 'Enw Ategolyn',
'checkout' => 'Cofnodi ategolyn allan',
'checkin' => 'Cofnodi ategolyn i fewn',
'create' => 'Creu Ategolyn',
'edit' => 'Golygu Ategolyn',
'eula_text' => 'Categori CTDT',
'eula_text_help' => 'Mae\'r blwch yma yn caniatau i chi addasu eich CTDTs ar gyfer mathau penodol o asedau. Os ydych yn defnyddio un CTDT ar gyfer eich asedau yna cewch ticio\'r blwch isod i defnyddio\'r fersiwn diofyn.',
'require_acceptance' => 'Gorfodi defnyddwyr i cadarnhau derbyn asedau yn y categori yma.',
'no_default_eula' => 'Wedi methu darganfod CTDT, Ychwanegwch un yn gosodiadau.',
'total' => 'Cyfanswm',
'remaining' => 'Yn weddill',
'update' => 'Diweddaru Ategolyn',
'use_default_eula' => 'Defnyddio\'r <a href="#" data-toggle="modal" data-target="#eulaModal">prif CTDT diofyn</a> yn lle.',
'use_default_eula_disabled' => '<del>Defnyddio\'r CTDT diofn yn lle\'r un presennol.</del>Nid oes prif CTDT diofyn wedi gosod. Ychwanegwch un yn gosodiadau os gwelwch yn dda.',
);

View File

@@ -1,37 +0,0 @@
<?php
return array(
'does_not_exist' => 'Nid yw\'r ategolyn yn bodoli.',
'assoc_users' => 'Mae\'r ategolyn yma hefo :count eitem wedi nodi allan i defnyddwyr. Nodwch yr ategolion yn ol i fewn ac yna ceisiwch eto. ',
'create' => array(
'error' => 'Ni crewyd yr ategolyn, ceisiwch eto o.g.y.dd.',
'success' => 'Ategolyn wedi creu yn llwyddiannus.'
),
'update' => array(
'error' => 'Ni diweddarwyd yr ategolyn, ceisiwch eto o.g.y.dd',
'success' => 'Diweddarwyd yr ategolyn yn llwyddiannus.'
),
'delete' => array(
'confirm' => 'Ydych chi\'n sicr eich bod eisiau dileu\'r eitem hwn?',
'error' => 'Nid oedd yn bosib dileu\'r eitem. Ceisiwch eto o.g.y.dd.',
'success' => 'Ategolyn wedi dileu yn llwyddiannus.'
),
'checkout' => array(
'error' => 'Ategolyn heb ei nodi allan, ceisiwch eto o. g. y. dd',
'success' => 'Ategolyn wedi nodi allan yn llwyddiannus.',
'user_does_not_exist' => 'Nid yw\'r defnyddiwr yna yn ddilys. Ceisiwch eto o.g.y.dd.'
),
'checkin' => array(
'error' => 'Nid oedd yn bosib nodi\'r ategolyn i fewn, ceisiwch eto o.g.y.dd',
'success' => 'Ategolyn wedi nodi i fewn yn llwyddiannus.',
'user_does_not_exist' => 'Nid yw\'r defnyddiwr yna yn ddilys. Ceisiwch eto o.g.y.dd.'
)
);

View File

@@ -1,11 +0,0 @@
<?php
return array(
'dl_csv' => 'Lawrlwytho CSV',
'eula_text' => 'CTDT',
'id' => 'Rhif Unigryw',
'require_acceptance' => 'Derbyn',
'title' => 'Enw Ategolyn',
);

View File

@@ -1,14 +0,0 @@
<?php
return [
'asset_maintenance_type' => 'Manylion Cynnal a Chadw',
'title' => 'Teitl',
'start_date' => 'Wedi cychwyn',
'completion_date' => 'Wedi cwbwlhau',
'cost' => 'Cost',
'is_warranty' => 'Gwelliant Gwarant',
'asset_maintenance_time' => 'Dyddiau',
'notes' => 'Nodiadau',
'update' => 'Diweddaru',
'create' => 'Creu'
];

View File

@@ -1,11 +0,0 @@
<?php
return [
'asset_maintenances' => 'Cynnal a chadw Ased',
'edit' => 'Golygu Cynnal a Chadw Ased',
'delete' => 'Dileu Cynnal a Chadw Ased',
'view' => 'Gweld manylder Cynnal a Chadw Ased',
'repair' => 'Trwsio',
'maintenance' => 'Cynnal a Chadw',
'upgrade' => 'Uwchraddio'
];

View File

@@ -1,21 +0,0 @@
<?php
return [
'not_found' => 'Ni ddarganfuwyd cofnod Cynnal a Chadw Ased yr oeddech yn edrych amdan!',
'delete' => [
'confirm' => 'Ydych chi\'n sicr eich bod eisiau dileu\'r cofnod cynnal a chadw yma?',
'error' => 'Nid oedd yn bosib dileu\'r nodyn cynnal a chadw. Ceisiwch eto o.g.y.dd.',
'success' => 'Nodyn cynnal a chadw wedi\'i dileu\'n llwyddiannus.'
],
'create' => [
'error' => 'Ni crewyd y cofnod cynnal a chadw, ceisiwch eto o.g.y.dd.',
'success' => 'Nodyn cynnal a chadw wedi\'i greu\'n llwyddiannus.'
],
'edit' => [
'error' => 'Wedi methu newid y cofnod cynnal a chadw, ceisiwch eto o.g.y.dd.',
'success' => 'Nodyn cynnal a chadw wedi\'i diweddaru\'n llwyddiannus.'
],
'asset_maintenance_incomplete' => 'Heb cwbwlhau eto',
'warranty' => 'Warant',
'not_warranty' => 'Dim Warant',
];

View File

@@ -1,8 +0,0 @@
<?php
return [
'title' => 'Cynnal a chadw Ased',
'asset_name' => 'Enw Ased',
'is_warranty' => 'Warant',
'dl_csv' => 'Lawrlwytho CSV'
];

View File

@@ -1,24 +0,0 @@
<?php
return array(
'about_categories_title' => 'Amdan Categoriau',
'about_categories' => 'Mae categoriau yn cynorthwyo chi i cadw trefn ar eich eitemau. Enghreifftiau o categoriau yw &quot;Cyfrifiadur pen-bwrdd&quot;, &quot;Gliniadur&quot;, &quot;Ffôn Symudol&quot;, &quot;Tabledi&quot;, ac yn y blaen, ond cewch gosod rhain yn ol eich angen.',
'asset_categories' => 'Categoriau Asedau',
'category_name' => 'Enw categori',
'checkin_email' => 'Gyrru ebost i defnyddiwr wrth nodi fewn/allan.',
'checkin_email_notification' => 'Fe geith y defnyddiwr yma ebost wrth nodi i fewn/allan.',
'clone' => 'Dyblygu Categori',
'create' => 'Creu Categori Newydd',
'edit' => 'Golygu Categori',
'eula_text' => 'CTDT Categori',
'eula_text_help' => 'Mae\'r blwch yma yn caniatau i chi addasu eich CTDTs ar gyfer mathau penodol o asedau. Os ydych yn defnyddio un CTDT ar gyfer eich asedau yna cewch ticio\'r blwch isod i defnyddio\'r fersiwn diofyn.',
'name' => 'Enw\'r categori',
'require_acceptance' => 'Gorfodi defnyddwyr i cadarnhau derbyn asedau yn y categori yma.',
'required_acceptance' => 'Fe geith y defnyddiwr yma ebost hefo linc i cofnodi derbyn yr eitem yma.',
'required_eula' => 'Fe geith y defnyddiwr yma copi o\'r CTDT trwy ebost',
'no_default_eula' => 'Wedi methu darganfod CTDT, Ychwanegwch un yn gosodiadau.',
'update' => 'Diweddaru Categori',
'use_default_eula' => 'Defnyddio\'r <a href="#" data-toggle="modal" data-target="#eulaModal">prif CTDT diofyn</a> yn lle.',
'use_default_eula_disabled' => '<del>Defnyddio\'r CTDT diofyn yn lle\'r un presennol.</del>Nid oes prif CTDT diofyn wedi gosod. Ychwanegwch yn ynj gosodiadau os gwelwch yn dda.',
);

View File

@@ -1,25 +0,0 @@
<?php
return array(
'does_not_exist' => 'Categori ddim yn bodoli.',
'assoc_models' => 'Mae\'r categori yma wedi perthnasu i oleiaf un model a nid yw\'n bosib dileu. Diweddarwch eich modelau i beidio cyfeirio at y categori yma ac yna ceisiwch eto. ',
'assoc_items' => 'Mae\'r categori yma wedi perthnasu i :asset_type a nid yw\'n bosib dileu. Diweddarwch eich :asset_type i beidio cyfeirio at y categori yma ac yna ceisiwch eto. ',
'create' => array(
'error' => 'Ni crewyd y categori, ceisiwch eto o. g. y. dd.',
'success' => 'Categori wedi creu\'n llwyddiannus.'
),
'update' => array(
'error' => 'Ni diweddarwyd y categori, ceisiwch eto o. g. y. dd',
'success' => 'Categori wedi diweddaru\'n llwyddiannus.'
),
'delete' => array(
'confirm' => 'Ydych chi\'n siwr eich bod eisiau dileu\'r categori yma?',
'error' => 'Nid oedd yn bosib dileu\'r categori. Ceisiwch eto o.g.y.dd.',
'success' => 'Categori wedi dileu\'n llwyddiannus.'
)
);

View File

@@ -1,10 +0,0 @@
<?php
return array(
'eula_text' => 'CTDT',
'id' => 'Rhif Unigryw',
'parent' => 'Rhiant',
'require_acceptance' => 'Derbyn',
'title' => 'Enw Categori Ased',
);

View File

@@ -1,6 +0,0 @@
<?php
return [
'about_companies_title' => 'Amdan Cwmniau',
'about_companies_text' => 'Defnyddir cwmniau fel maes syml, neu i rheoli mynediad at grwpiau o offer, defnyddwyr os ydi cefnogaeth cwmniau wedi alluogi.',
'select_company' => 'Dewis Cwmni',
];

View File

@@ -1,18 +0,0 @@
<?php
return array(
'does_not_exist' => 'Nid ywr cwmni\'n bodoli.',
'assoc_users' => 'Mae\'r cwmni yma wedi perthnasu i oleiaf un model a nid yw\'n bosib dileu. Diweddarwch eich modelau i beidio cyfeirio at y cwmni yma ac yna ceisiwch eto. ',
'create' => array(
'error' => 'Ni crewyd y cwmni, ceisiwch eto o. g. y. dd.',
'success' => 'Cwmni wedi creu yn llwyddiannus.'
),
'update' => array(
'error' => 'Ni diweddarwyd y cwmni, ceisiwch eto o. g. y. dd',
'success' => 'Cwmni wedi diweddaru\'n llwyddiannus.'
),
'delete' => array(
'confirm' => 'Ydych chi\'n siwr eich bod eisiau dileu\'r cwmni yma?',
'error' => 'Nid oedd yn bosib dileu\'r cwmni. Ceisiwch eto o. g. y. dd.',
'success' => 'Cwmni wedi dileu\'n llwyddiannus.'
)
);

View File

@@ -1,9 +0,0 @@
<?php
return array(
'companies' => 'Cwmniau',
'create' => 'Creu Cwmni',
'title' => 'Cwmni',
'update' => 'Diweddaru Cwmni',
'name' => 'Enw Cwmni',
'id' => 'Rhif Unigryw',
);

View File

@@ -1,17 +0,0 @@
<?php
return array(
'about_components_title' => 'Amdan Cydranau',
'about_components_text' => 'Mae cydrannau yn darnau sydd yn rhan o ased, er enghraifft cof, disg caled, ayyb.',
'component_name' => 'Enw Cydran',
'checkin' => 'Nodi\'r gydran allan',
'checkout' => 'Nodi\'r gydran allan',
'cost' => 'Cost pwrcasu',
'create' => 'Creu Cydran',
'edit' => 'Addasu Cydran',
'date' => 'Dyddiad Pwrcasu',
'order' => 'Rhif Archeb',
'remaining' => 'Yn weddill',
'total' => 'Cyfanswm',
'update' => 'Diweddaru Cydran',
);

View File

@@ -1,36 +0,0 @@
<?php
return array(
'does_not_exist' => 'Nid ywr cydran yn bodoli.',
'create' => array(
'error' => 'Ni crewyd y cydran, ceisiwch eto o. g. y. dd.',
'success' => 'Cydran wedi creu yn llwyddiannus.'
),
'update' => array(
'error' => 'Ni ddiweddarwyd y cydran, ceisiwch eto o. g. y. dd',
'success' => 'Diweddarwyd y gydran yn llwyddiannus.'
),
'delete' => array(
'confirm' => 'Ydych chi\'n siwr eich bod eisiau dileu\'r cydran yma?',
'error' => 'Nid oedd yn bosib dileu\'r cydran. Ceisiwch eto o. g. y. dd.',
'success' => 'Cydran wedi dileu\'n llwyddiannus.'
),
'checkout' => array(
'error' => 'Cydran heb ei nodi allan, ceisiwch eto o. g. y. dd',
'success' => 'Cydran wedi nodi allan yn llwyddiannus.',
'user_does_not_exist' => 'Nid yw\'r defnyddiwr yna yn ddilys. Ceisiwch eto o. g. y. dd.'
),
'checkin' => array(
'error' => 'Cydran heb ei nodi i fewn, ceisiwch eto o. g. y. dd',
'success' => 'Cydran wedi nodi i fewn yn llwyddiannus.',
'user_does_not_exist' => 'Nid yw\'r defnyddiwr yna yn ddilys. Ceisiwch eto o. g. y. dd.'
)
);

View File

@@ -1,5 +0,0 @@
<?php
return array(
'title' => 'Enw Cydran',
);

View File

@@ -1,13 +0,0 @@
<?php
return array(
'about_consumables_title' => 'Amdan Nwyddau Traul',
'about_consumables_text' => 'Mae unrhwy eitem sydd yn cael eu defnyddio i fyny dros amser yn nwydd traul. Er enghraifft, inc neu paper argraffydd.',
'checkout' => 'Nodi nwydd traul allan i defnyddiwr',
'consumable_name' => 'Enw nwydd traul',
'create' => 'Creu nwydd traul',
'item_no' => 'Rhif eitem.',
'remaining' => 'Yn weddill',
'total' => 'Cyfanswm',
'update' => 'Diweddaru nwydd traul',
);

View File

@@ -1,36 +0,0 @@
<?php
return array(
'does_not_exist' => 'Nid yw\'r nwydd traul yn bodoli.',
'create' => array(
'error' => 'Ni crewyd y nwydd traul, ceisiwch eto o. g. y. dd.',
'success' => 'Nwydd traul wedi creu yn llwyddiannus.'
),
'update' => array(
'error' => 'Ni diweddarwyd y nwydd traul, ceisiwch eto o. g. y. dd',
'success' => 'Nwydd traul wedi diweddaru\'n llwyddiannus.'
),
'delete' => array(
'confirm' => 'Ydych chi\'n siwr eich bod eisiau dileu\'r nwydd traul yma?',
'error' => 'Nid oedd yn bosib dileu\'r nwydd traul. Ceisiwch eto o. g. y. dd.',
'success' => 'Nwydd traul wedi dileu\'n llwyddiannus.'
),
'checkout' => array(
'error' => 'Nwydd traul heb ei nodi allan, ceisiwch eto o. g. y. dd',
'success' => 'Nwydd traul wedi nodi allan yn llwyddiannus.',
'user_does_not_exist' => 'Nid yw\'r defnyddiwr yna yn ddilys. Ceisiwch eto o. g. y. dd.'
),
'checkin' => array(
'error' => 'Nwydd traul heb ei nodi i fewn, ceisiwch eto o. g. y. dd',
'success' => 'Nwydd traul wedi nodi i fewn yn llwyddiannus.',
'user_does_not_exist' => 'Nid yw\'r defnyddiwr yna yn ddilys. Ceisiwch eto o. g. y. dd.'
)
);

View File

@@ -1,5 +0,0 @@
<?php
return array(
'title' => 'Enw nwydd traul',
);

View File

@@ -1,32 +0,0 @@
<?php
return array(
'custom_fields' => 'Meysydd addasedig',
'field' => 'Meysydd',
'about_fieldsets_title' => 'Amdan grwpiau meysydd',
'about_fieldsets_text' => 'Mae grwpiau meysydd yn caniatau i chi creu grwpiau o meysydd addasedig sydd yn cael ei defnyddio yn amal ar gyfer mathau penodol o asedau.',
'custom_format' => 'Fformat Regex addasedig...',
'encrypt_field' => 'Hamcryptio gwerth y maes yma yn y basdata',
'encrypt_field_help' => 'RHYBUDD: Mae hamcryptio maes yn feddwl nid oes modd chwilio amdano.',
'encrypted' => 'Wedi hamcryptio',
'fieldset' => 'Setiau maes',
'qty_fields' => 'Nifer o meysydd',
'fieldsets' => 'Setiau maes',
'fieldset_name' => 'Enw set maes',
'field_name' => 'Enw maes',
'field_values' => 'Gwerthoedd maes',
'field_values_help' => 'Ychwanegwch opsiynau selectable, un fesul llinell. Anwybyddir llinellau gwag heblaw\'r llinell gyntaf.',
'field_element' => 'Ffurf Elfen',
'field_element_short' => 'Elfen',
'field_format' => 'Fformat',
'field_custom_format' => 'Fformat Regex addasedig',
'field_custom_format_help' => 'Mae\'r maes hwn yn caniatáu ichi ddefnyddio mynegiad regex i\'w ddilysu. Dylai ddechrau gyda "regex:" - er enghraifft, i ddilysu bod gwerth maes arferiad yn cynnwys IMEI dilys (15 digid rhifol), byddech chi\'n defnyddio <code>regex:/^[0-9]{15}$/</code>.',
'required' => 'Gofynnol',
'req' => 'Angen.',
'used_by_models' => 'Defnyddir gan modelau',
'order' => 'Trefn',
'create_fieldset' => 'Set maes newydd',
'create_field' => 'Maes Addasedig newydd',
'value_encrypted' => 'Mae gwerth y maes hwn wedi\'i amgryptio yn y gronfa ddata. Dim ond defnyddwyr gweinyddol fydd yn gallu gweld y gwerth wedi\'i ddadgryptio',
'show_in_email' => 'Cynnwys gwerth y maes hwn mewn e-byst talu a anfonir at y defnyddiwr? Ni ellir cynnwys meysydd wedi\'u hamgryptio mewn e-byst.',
);

View File

@@ -1,57 +0,0 @@
<?php
return array(
'field' => array(
'invalid' => 'Nid yw\'r maes yn bodoli.',
'already_added' => 'Maes eisoes yn bodoli',
'create' => array(
'error' => 'Ni crewyd y maes, ceisiwch eto o. g. y. dd.',
'success' => 'Maes wedi creu yn llwyddiannus.',
'assoc_success' => 'Maes wedi ychwanegu\'n llwyddiannus ir set maes.'
),
'update' => array(
'error' => 'Ni diweddarwyd y maes, ceisiwch eto o. g. y. dd',
'success' => 'Maes wedi diweddaru\'n llwyddiannus.'
),
'delete' => array(
'confirm' => 'Ydych chi\'n siwr eich bod eisiau dileu\'r maes yma?',
'error' => 'Nid oedd yn bosib dileu\'r maes. Ceisiwch eto o. g. y. dd.',
'success' => 'Maes wedi dileu\'n llwyddiannus.',
'in_use' => 'Maes mewn defnydd.',
)
),
'fieldset' => array(
'does_not_exist' => 'Nid yw\'r set maes yn bodoli',
'create' => array(
'error' => 'Ni crewyd y set maes, ceisiwch eto o. g. y. dd.',
'success' => 'Set maes wedi creu yn llwyddiannus.'
),
'update' => array(
'error' => 'Ni diweddarwyd y set maes, ceisiwch eto o. g. y. dd',
'success' => 'Set maes wedi diweddaru\'n llwyddiannus.'
),
'delete' => array(
'confirm' => 'Ydych chi\'n siwr eich bod eisiau dileu\'r set maes yma?',
'error' => 'Nid oedd yn bosib dileu\'r set maes. Ceisiwch eto o. g. y. dd.',
'success' => 'Set maes wedi dileu\'n llwyddiannus.',
'in_use' => 'Set maes mewn defnydd.',
)
),
);

View File

@@ -1,21 +0,0 @@
<?php
return array(
'does_not_exist' => 'Nid yw\'r adran yn bodoli.',
'assoc_users' => 'Mae\'r adran yma wedi perthnasu i oleiaf un defnyddiwr a nid yw\'n bosib dileu. Diweddarwch eich defnyddwyr i beidio cyfeirio at yr adran yma ac yna ceisiwch eto. ',
'create' => array(
'error' => 'Ni crewyd yr adran, ceisiwch eto o. g. y. dd.',
'success' => 'Adran wedi creu yn llwyddiannus.'
),
'update' => array(
'error' => 'Ni diweddarwyd yr adran, ceisiwch eto o. g. y. dd',
'success' => 'Adran wedi diweddaru\'n llwyddiannus.'
),
'delete' => array(
'confirm' => 'Ydych chi\'n sicr eich bod eisiau dileu\'r adran yma?',
'error' => 'Nid oedd yn bosib dileu\'r adran. Ceisiwch eto o. g. y. dd.',
'success' => 'Adran wedi dileu\'n llwyddiannus.'
)
);

View File

@@ -1,11 +0,0 @@
<?php
return array(
'id' => 'Rhif Unigryw',
'name' => 'Enw Adran',
'manager' => 'Rheolwr',
'location' => 'Lleoliad',
'create' => 'Creu Adran',
'update' => 'Diweddaru Adran',
);

View File

@@ -1,12 +0,0 @@
<?php
return array(
'about_asset_depreciations' => 'Amdan Dibrisiant Asedau',
'about_depreciations' => 'Cewch creu mathau o dibrisiant i dibrisio asedau yn seiliedig ar dibrisiant llinell syth.',
'asset_depreciations' => 'Dibrisiant Asedau',
'create' => 'Creu Dibrisiant',
'depreciation_name' => 'Enw Dibrisiant',
'number_of_months' => 'Nifer o Fisoedd',
'update' => 'Diweddaru Dibrisiant',
);

View File

@@ -1,25 +0,0 @@
<?php
return array(
'does_not_exist' => 'Nid yw\'r dosbarth yma o dibrsiant yn bodoli.',
'assoc_users' => 'Mae\'r dibrisiantyma wedi perthnasu hefo un neu mwy o modelau a nid oes modd i\'w dileu. Fydd rhaid dileu\'r modelau ac yna trio eto. ',
'create' => array(
'error' => 'Ni crewyd y dosbarth dibrisiant, ceisiwch eto o. g. y. dd. :(',
'success' => 'Dosbarth dibrisiant wedi\'i creu yn llwyddiannus. :)'
),
'update' => array(
'error' => 'Ni diweddarwyd y dosbarth dibrisiant, ceisiwch eto o. g. y. dd',
'success' => 'Dosbarth dibrisiant wedi\'i diweddaru yn llwyddiannus.'
),
'delete' => array(
'confirm' => 'Ydych chi\'n siwr eich bod eisiau dileu\'r dosbarth dibrisiant yma?',
'error' => 'Nid oedd yn bosib dileu\'r dosbarth dibrisiant. Ceisiwch eto o. g. y. dd.',
'success' => 'Dosbarth dibrisiant wedi\'i dileu yn llwyddiannus.'
)
);

View File

@@ -1,10 +0,0 @@
<?php
return array(
'id' => 'Rhif Unigryw',
'months' => 'Misoedd',
'term' => 'Cyfnod',
'title' => 'Enw ',
);

View File

@@ -1,22 +0,0 @@
<?php
return array(
'group_exists' => 'Grwp yn bodoli yn barod!',
'group_not_found' => 'Nid yw grwp [:id] yn bodoli.',
'group_name_required' => 'Mae angen llenwi\'r maes enw',
'success' => array(
'create' => 'Wedi llwyddo i creu\'r grwp.',
'update' => 'Wedi llwyddo i diweddaru\'r grwp.',
'delete' => 'Wedi llwyddo i dileu\'r grwp.',
),
'delete' => array(
'confirm' => 'Ydych chi\'n sicr eich bod eisiau dileu\'r grwp yma?',
'create' => 'Roedd problem wrth ceisio creu\'r grwp. Ceisiwch eto o. g. y. dd.',
'update' => 'Roedd problem wrth ceisio diweddaru\'r grwp. Ceisiwch eto o. g. y. dd.',
'delete' => 'Roedd problem wrth ceisio dileu\'r grwp. Ceisiwch eto o. g. y. dd.',
),
);

View File

@@ -1,9 +0,0 @@
<?php
return array(
'id' => 'Rhif Unigryw',
'name' => 'Enw',
'users' => '# o defnyddwyr',
);

View File

@@ -1,14 +0,0 @@
<?php
return array(
'about_groups_title' => 'Amdan Grwpiau',
'about_groups' => 'Defnyddir grwpiau i gosod hawliau defnyddwyr.',
'group_management' => 'Rheoli Grwpiau',
'create' => 'Creu Grwp Newydd',
'update' => 'Addasu Grwp',
'group_name' => 'Enw Grwp',
'group_admin' => 'Gweinyddwr Grwp',
'allow' => 'Caniatau',
'deny' => 'Gwrthod',
);

View File

@@ -1,44 +0,0 @@
<?php
return array(
'bulk_delete' => 'Cadarnahu Dileu Nifer o Asedau',
'bulk_delete_help' => 'Adolygwch yr asedau ar gyfer dileu isod. Ar ôl eu dileu, gellir adfer yr asedau hyn, ond ni fyddant yn gysylltiedig mwyach ag unrhyw ddefnyddwyr y maent wedi\'u neilltuo iddynt ar hyn o bryd.',
'bulk_delete_warn' => 'Rydych am dileu :asset_count assets.',
'bulk_update' => 'Diweddaru Nifer o Asedau',
'bulk_update_help' => 'Mae\'r ffurflen hon yn caniatáu ichi ddiweddaru nifer o asedau ar unwaith. Llenwch y meysydd sydd angen i chi eu newid yn unig. Bydd unrhyw bwlch a adewir yn wag yn aros yr un fath. ',
'bulk_update_warn' => 'Rydych am newid manylder am :asset_count o asedau.',
'checkedout_to' => 'Wedi aseinio i',
'checkout_date' => 'Dyddiad allan',
'checkin_date' => 'Dyddian i mewn',
'checkout_to' => 'Dynodi i',
'cost' => 'Cost pwrcasu',
'create' => 'Creu Ased',
'date' => 'Dyddiad Pwrcasu',
'depreciation' => 'Dibrisiant',
'depreciates_on' => 'Dibrisio Ar',
'default_location' => 'Lleoliad diofyn',
'eol_date' => 'Dyddiad DB',
'eol_rate' => 'Cyfradd DB',
'expected_checkin' => 'Dyddiad disgwl i mewn',
'expires' => 'Dod i ben',
'fully_depreciated' => 'Dibrisiant Llwyr',
'help_checkout' => 'Os ydych chi am aseinio\'r ased hwn ar unwaith, dewiswch "Barod i\'w Ddefnyddio" o\'r rhestr statws uchod. ',
'mac_address' => 'Cyfeiriad MAC',
'manufacturer' => 'Gwneuthyrwr',
'model' => 'Model',
'months' => 'misoedd',
'name' => 'Enw Ased',
'notes' => 'Nodiadau',
'order' => 'Rhif Archeb',
'qr' => 'Côd QR',
'requestable' => 'Gellir ddefnyddwyr gwneud cais am yr ased yma',
'select_statustype' => 'Dewis Math o Statws',
'serial' => 'Serial',
'status' => 'Statws',
'tag' => 'Tag Ased',
'update' => 'Diweddaru Ased',
'warranty' => 'Warant',
'warranty_expires' => 'Warrant yn dod I ben',
'years' => 'blynyddoedd',
)
;

View File

@@ -1,22 +0,0 @@
<?php
return array(
'about_assets_title' => 'Amdan Asedau',
'about_assets_text' => 'Mae asedau wedi tracio trwy rhif cofrestru neu rhif ased. Maen yn tueddu fod yn eitemau gwerthfawr lle mae adnabod offer penodol yn bwysig.',
'archived' => 'Archifwyd',
'asset' => 'Ased',
'bulk_checkout' => 'Nodi Asedau Allan',
'checkin' => 'Nodi Asedau I Mewn',
'checkout' => 'Nodi Asedau Allan',
'clone' => 'Dyblygu Ased',
'deployable' => 'Gellir ei ddefnyddio',
'deleted' => 'Mae\'r ased yma wedi dileu. <a href="/hardware/:asset_id/restore">Cliciwch yma i\'w adfer</a>.',
'edit' => 'Addasu Ased',
'model_deleted' => 'Mae\'r model yma o ased wedi\'i dileu. Rhaid i chi adfer y model cyn fedrwch chi adfer y\'r ased. <br/> <a href="/hardware/models/:model_id/restore">Cliciwch yma i adfer yr ased</a>.',
'requestable' => 'Ar gael',
'requested' => 'Gofynnwyd amdano',
'restore' => 'Adfer Ased',
'pending' => 'Yn disgwl',
'undeployable' => 'Dim ar gael',
'view' => 'Gweld Ased',
);

View File

@@ -1,83 +0,0 @@
<?php
return array(
'undeployable' => '<strong> Rhybudd: </strong> Mae\'r ased hwn wedi\'i nodi fel un na ellir ei ddefnyddio ar hyn o bryd.
Os yw\'r statws hwn wedi newid, diweddarwch statws yr ased.',
'does_not_exist' => 'Nid yw\'r ased yn bodoli.',
'does_not_exist_or_not_requestable' => 'Ymdrech da. Nid yw\'r ased yma yn bodoli neu ar gael.',
'assoc_users' => 'Ar hyn o bryd mae\'r ased yma allan gan ddefnyddiwr ac ni ellir ei ddileu. Cofnodwch yr ased yn ol i fewn yn gyntaf, ac yna ceisiwch ei ddileu eto. ',
'create' => array(
'error' => 'Ni crewyd yr ased, ceisiwch eto o. g. y. dd. :(',
'success' => 'Ased wedi creu yn llwyddiannus. :)'
),
'update' => array(
'error' => 'Ni diweddarwyd yr assed, ceisiwch eto o. g. y. dd',
'success' => 'Ased wedi diweddaru\'n llwyddiannus.',
'nothing_updated' => 'Dim newid mewn manylder, felly dim byd wedi\'i diweddaru.',
),
'restore' => array(
'error' => 'Nid oedd yn bosib adfer yr ased, ceisiwch eto o. g. y. dd',
'success' => 'Ased wedi adfer yn llwyddiannus.'
),
'audit' => array(
'error' => 'Roedd archwiliad asedau yn aflwyddiannus. Ceisiwch eto o. g. y. dd.',
'success' => 'Cofnodwyd archwiliad asedau yn llwyddiannus.'
),
'deletefile' => array(
'error' => 'Ffeil heb ei ddileu. Ceisiwch eto o.g.y.dd.',
'success' => 'Ffeil wedi dileu yn llwyddiannus.',
),
'upload' => array(
'error' => 'Ffeil(iau) heb ei uwchlwytho. Ceisiwch eto o. g. y. dd.',
'success' => 'Ffeil(iau) wedi uwchlwytho yn llwyddiannus.',
'nofiles' => 'Ni wnaethoch chi ddewis unrhyw ffeiliau i\'w uwchlwytho, neu mae\'r ffeil rydych chi\'n ceisio ei huwchlwytho yn rhy fawr',
'invalidfiles' => 'Mae un neu mwy o\'r ffeiliau unai yn rhy fawr neu ddim y math cywir. Derbynir png, gif, fjp, doc, docx, pdf a txt.',
),
'import' => array(
'error' => 'Rhai eitemau heb ei mewnforio\'n gywir.',
'errorDetail' => 'Ni fewnforiwyd yr eitemau canlynol oherwydd gwallau.',
'success' => "Mae'ch ffeil wedi'i mewnforio",
'file_delete_success' => "Mae eich ffeil wedi'i dileu yn llwyddiannus",
'file_delete_error' => "Nid oedd yn bosib dileu'r ffeil",
),
'delete' => array(
'confirm' => 'Ydych chi\'n sicr eich bod eisiau dileu\'r ased yma?',
'error' => 'Roedd problem wrth ceisio dileu\'r ased. Ceisiwch eto o. g. y. dd.',
'nothing_updated' => 'Dim asedau wedi dewis, felly dim byd wedi\'i dileu.',
'success' => 'Ased wedi dileu\'n llwyddiannus.'
),
'checkout' => array(
'error' => 'Ased heb ei nodi fel allan, ceisiwch eto o. g. y. dd',
'success' => 'Ased wedi nodi fel allan yn llwyddiannus.',
'user_does_not_exist' => 'Nid yw\'r defnyddiwr yna yn ddilys. Ceisiwch eto o.g.y.dd.',
'not_available' => 'Nid yw\'r ased yma ar gael i\'w defnyddio!',
'no_assets_selected' => 'Rhaid i chi ddewis o leiaf un ased o\'r rhestr'
),
'checkin' => array(
'error' => 'Ased heb ei nodi i mewn, ceisiwch eto o. g. y. dd',
'success' => 'Ased wedi nodi i mewn yn llwyddiannus.',
'user_does_not_exist' => 'Nid yw\'r defnyddiwr yna yn ddilys. Ceisiwch eto o. g. y. dd.',
'already_checked_in' => 'Ased wedi nodi i mewn yn gywir.',
),
'requests' => array(
'error' => 'Nid oedd cais am yr ased, ceisiwch eto o. g. y. dd',
'success' => 'Cais am ased yn llwyddiannus.',
'canceled' => 'Wedi llwydo i canslo cais am ased'
)
);

View File

@@ -1,24 +0,0 @@
<?php
return array(
'asset_tag' => 'Rhif Ased (tag)',
'asset_model' => 'Model',
'book_value' => 'Gwerth',
'change' => 'Mewn/Allan',
'checkout_date' => 'Dyddiad Allan',
'checkoutto' => 'Allan',
'diff' => 'Gwahaniaeth',
'dl_csv' => 'Lawrlwytho CSV',
'eol' => 'DB',
'id' => 'Rhif Unigryw',
'location' => 'Lleoliad',
'purchase_cost' => 'Cost',
'purchase_date' => 'Dyddiad Pwrcasu',
'serial' => 'Serial',
'status' => 'Statws',
'title' => 'Ased ',
'image' => 'Delwedd Dyfais',
'days_without_acceptance' => 'Diwrnodau Heb Derbyn'
);

View File

@@ -1,22 +0,0 @@
<?php
return array(
'asset' => 'Ased',
'checkin' => 'Nodi i mewn',
'create' => 'Creu Trwydded',
'expiration' => 'Dyddiad Terfynu',
'license_key' => 'Goriad',
'maintained' => 'Cynnal a chadw',
'name' => 'Enw Meddalwedd',
'no_depreciation' => 'Peidio dibrisio',
'purchase_order' => 'Rhif Archeb',
'reassignable' => 'Posib ail dynodi',
'remaining_seats' => 'Seddi yn weddill',
'seats' => 'Seddi',
'termination_date' => 'Dyddiad Terfynu',
'to_email' => 'Ebost wedi trwyddedu',
'to_name' => 'Enw wedi trwyddedu',
'update' => 'Diweddaru Trwydded',
'checkout_help' => 'Fedrwch nodi trwydded allan yn erbyn ased neu person. Fedrwch dewis y ddau ond rhaid i\'r person cydfynd hefo perchenog yr ased.'
);

View File

@@ -1,21 +0,0 @@
<?php
return array(
'about_licenses_title' => 'Amdan trwyddedau',
'about_licenses' => 'Mae trwyddedau yn tracio feddalwedd. May yna nifer o seddi fedrwch nodi yn erbyn unigolion',
'checkin' => 'Nodi sedd trwydded i fewn',
'checkout_history' => 'Hanes nodi allan',
'checkout' => 'Nodi sedd trwydded allan',
'edit' => 'Golygu Trwydded',
'filetype_info' => 'Math o ffeiliau a caniateir yw png, gif, jpg, jpeg, doc, docx, pdf, txt, zip, a rar.',
'clone' => 'Dyblygu Trwydded',
'history_for' => 'Hanes ar gyfer ',
'in_out' => 'Mewn/Allan',
'info' => 'Gwybodaeth Trwydded',
'license_seats' => 'Seddi Trwydded',
'seat' => 'Sedd',
'seats' => 'Seddi',
'software_licenses' => 'Trwyddedau Meddalwedd',
'user' => 'Defnyddiwr',
'view' => 'Gweld Trwydded',
);

View File

@@ -1,51 +0,0 @@
<?php
return array(
'does_not_exist' => 'Nid yw\'r trwydded yn bodoli.',
'user_does_not_exist' => 'Nid yw\'r defnyddiwr yn bodoli.',
'asset_does_not_exist' => 'Nid yw\'r ased rydych yn ceisio perthnasu i\'r trwydded yma yn bodoli.',
'owner_doesnt_match_asset' => 'Nid y defnyddiwr sydd wedi nodi yw perchenog yr ased rydych yn ceisio perthnasu ir trwydded yma.',
'assoc_users' => 'Ar hyn o bryd mae\'r trwydded yma allan gan ddefnyddiwr ac ni ellir ei ddileu. Cofnodwch yr trwyddedyn ol i fewn yn gyntaf, ac yna ceisiwch ei ddileu eto. ',
'select_asset_or_person' => 'Rhaid i chi ddewis ased neu defnyddiwr ond nid y ddau.',
'create' => array(
'error' => 'Ni crewyd y trwydded, ceisiwch eto o. g. y. dd.',
'success' => 'Trwydded wedi creu yn llwyddiannus.'
),
'deletefile' => array(
'error' => 'Ffeil heb ei ddileu. Ceisiwch eto o. g. y. dd.',
'success' => 'Ffeil wedi dileu yn llwyddiannus.',
),
'upload' => array(
'error' => 'Ffeil(iau) heb ei uwchlwytho. Ceisiwch eto o. g. y. dd.',
'success' => 'Ffeil(iau) wedi uwchlwytho yn llwyddiannus.',
'nofiles' => 'Ni wnaethoch chi ddewis unrhyw ffeiliau i\'w uwchlwytho, neu mae\'r ffeil rydych chi\'n ceisio ei huwchlwytho yn rhy fawr',
'invalidfiles' => 'Mae un neu mwy o\'r ffeiliau unai yn rhy fawr neu ddim y math cywir. Derbynir png, gif, fjp, doc, docx, pdf a txt.',
),
'update' => array(
'error' => 'Ni diweddarwyd y trwydded, ceisiwch eto o. g. y. dd',
'success' => 'Trwydded wedi diweddaru\'n llwyddiannus.'
),
'delete' => array(
'confirm' => 'Ydych chi\'n siwr eich bod eisiau dileu\'r trwydded yma?',
'error' => 'Nid oedd yn bosib dileu\'r trwydded. Ceisiwch eto o. g. y. dd.',
'success' => 'Trwydded wedi dileu yn llwyddiannus.'
),
'checkout' => array(
'error' => 'Nid oedd yn bosib nodi\'r trwydded allan. Ceisiwch eto o. g. y. dd.',
'success' => 'Trwydded wedi nodi allan yn llwyddiannus'
),
'checkin' => array(
'error' => 'Nid oedd yn bosib nodi\'r trwydded i mewn. Ceisiwch eto o. g. y. dd.',
'success' => 'Trwydded wedi nodi i fewn yn llwyddiannus'
),
);

View File

@@ -1,17 +0,0 @@
<?php
return array(
'assigned_to' => 'Wedi Neilltuo i',
'checkout' => 'Mewn/Allan',
'id' => 'Rhif Unigryw',
'license_email' => 'Ebost wedi trwyddedu',
'license_name' => 'Wedi Trwyddedi',
'purchase_date' => 'Dyddiad Pwrcasu',
'purchased' => 'Prynwyd',
'seats' => 'Seddi',
'hardware' => 'Caledwedd',
'serial' => 'Serial',
'title' => 'Trwydded',
);

View File

@@ -1,27 +0,0 @@
<?php
return array(
'does_not_exist' => 'Nid yw\'r lleoliad yn bodoli.',
'assoc_users' => 'Mae\'r lleoliad yma wedi perthnasu i oleiaf un defnyddiwr a nid yw\'n bosib dileu. Diweddarwch eich defnyddwyr i beidio cyfeirio at y lleoliad yma ac yna ceisiwch eto. ',
'assoc_assets' => 'Mae\'r lleoliad yma wedi perthnasu i oleiaf un ased a nid yw\'n bosib dileu. Diweddarwch eich asedau i beidio cyfeirio at y lleoliad yma ac yna ceisiwch eto. ',
'assoc_child_loc' => 'Mae\'r lleoliad yma yn rhiant i oleiaf un lleoliad a nid yw\'n bosib dileu. Diweddarwch eich lleoliadau i beidio cyfeirio at y lleoliad yma ac yna ceisiwch eto. ',
'create' => array(
'error' => 'Ni crewyd y lleoliad, ceisiwch eto o.g.y.dd.',
'success' => 'Lleoliad wedi creu yn llwyddiannus.'
),
'update' => array(
'error' => 'Ni diweddarwyd y lleoliad, ceisiwch eto o.g.y.dd',
'success' => 'Lleoliad wedi diweddaru\'n llwyddiannus.'
),
'delete' => array(
'confirm' => 'Ydych chi\'n siwr eich bod eisiau dileu\'r lleoliad yma?',
'error' => 'Nid oedd yn bosib dileu\'r lleoliad. Ceisiwch eto o.g.y.dd.',
'success' => 'Lleoliad wedi dileu\'n llwyddiannus.'
)
);

View File

@@ -1,21 +0,0 @@
<?php
return array(
'about_locations_title' => 'Amdan Lleoliadau',
'about_locations' => 'Defnyddir lleoliadau i cofnodi manylder lleoliad ar gyfer defnyddwyr, asedau a eitemau eraill',
'assets_rtd' => 'Asedau', // This has NEVER meant Assets Retired. I don't know how it keeps getting reverted.
'assets_checkedout' => 'Asedau Wedi clustnodi',
'id' => 'Rhif Unigryw',
'city' => 'Dinas',
'state' => 'Talaith',
'country' => 'Gwlad',
'create' => 'Creu Lleoliad',
'update' => 'Diweddaru Lleoliad',
'name' => 'Enw Lleoliad',
'address' => 'Cyfeiriad',
'zip' => 'Côd Post',
'locations' => 'Lleoliadau',
'parent' => 'Rhiant',
'currency' => 'Arian y Lleoliad',
'ldap_ou' => 'OU a denyddir wrth chwilio LDAP',
);

View File

@@ -1,29 +0,0 @@
<?php
return array(
'does_not_exist' => 'Nid yw\'r gwneuthyrwr yn bodoli.',
'assoc_users' => 'Mae\'r gwneuthyrwr yma wedi perthnasu i oleiaf un model a nid yw\'n bosib dileu. Diweddarwch eich modelau i beidio cyfeirio at y gwneuthyrwr yma ac yna ceisiwch eto. ',
'create' => array(
'error' => 'Ni crewyd ygwneuthyrwr, ceisiwch eto o. g. y. dd.',
'success' => 'Gwneuthyrwr wedi creu yn llwyddiannus.'
),
'update' => array(
'error' => 'Ni diweddarwyd y gwneuthyrwr, ceisiwch eto o. g. y. dd',
'success' => 'Gwneuthyrwr wedi diweddaru yn llwyddiannus.'
),
'restore' => array(
'error' => 'Nid oedd yn bosib adfer y gwneuthyrwr, ceisiwch eto o. g. y. dd',
'success' => 'Gwneuthyrwr wedi adfer yn llwyddiannus.'
),
'delete' => array(
'confirm' => 'Ydych chi\'n sicr eich bod eisiau dileu\'r gwneuthyrwr yma?',
'error' => 'Roedd problem wrth ceisio dileu\'r gwneuthyrwr. Ceisiwch eto o. g. y. dd.',
'success' => 'Gwneuthyrwr wedi dileu\'n llwyddiannus.'
)
);

View File

@@ -1,16 +0,0 @@
<?php
return array(
'about_manufacturers_title' => 'Amdan Gwneuthyrwyr',
'about_manufacturers_text' => 'Gwneuthurwyr yw\'r cwmnïau sy\'n creu eich asedau. Gallwch ddod o hyd i wybodaeth bwysig amdanynt yma, a fydd yn cael ei harddangos ar eich tudalennau manylion asedau.',
'asset_manufacturers' => 'Gwneuthyrwyr Asedau',
'create' => 'Creu Gwneuthyrwr',
'id' => 'Rhif Unigryw',
'name' => 'Enw',
'support_email' => 'Ebost Cefnogaeth',
'support_phone' => 'Rhif ffôn cefnogaeth',
'support_url' => 'Wefan cefnogaeth',
'update' => 'Diweddaru Gwneuthyrwr',
'url' => 'URL',
);

View File

@@ -1,18 +0,0 @@
<?php
return array(
'about_models_title' => 'Amdan Modelau',
'about_models_text' => 'Mae modelau o asedau yn ffordd o creu grwp o asedau. "iPhone 7, Samsung TAB 4, ayyb.',
'deleted' => 'Mae\'r model yma wedi dileu. <a href="/hardware/models/:model_id/restore">Cliciwch yma i\'w adfer</a>.',
'bulk_delete' => 'Dileu Nifer o Modelau',
'bulk_delete_help' => 'Rhowch tic yn y bocsys isod i cadarnhau dileu y model. Nid oes modd dileu modelau sydd hefo asedau yn ei erbyn.',
'bulk_delete_warn' => 'Rydych am dileu :model_count o asedau.',
'restore' => 'Adfer Model',
'requestable' => 'Gellir defnyddwyr gwneud cais am yr ased yma',
'show_mac_address' => 'Dangos cyfeiriad MAC yn asedau o\'r model yma',
'view_deleted' => 'Wedi Dileu',
'view_models' => 'Gweld Modelau',
'fieldset' => 'Fieldset',
'no_custom_field' => 'Defnyddio meysydd addasedig',
'add_default_values' => 'Ychwanegu gwerthoedd diofyn',
);

View File

@@ -1,42 +0,0 @@
<?php
return array(
'does_not_exist' => 'Nid yw\'r model yn bodoli.',
'assoc_users' => 'Mae\'r model yma wedi perthnasu hefo un neu mwy o asedau. Fydd rhaid dileu\'r asedau ac yna trio eto. ',
'create' => array(
'error' => 'Ni crewyd y model, ceisiwch eto o.g.y.dd.',
'success' => 'Model wedi creu yn llwyddiannus.',
'duplicate_set' => 'Mae model ased hefo\'r enw, gwneuthyrwr a rhif model yn bodoli yn barod.',
),
'update' => array(
'error' => 'Ni diweddarwyd y model, ceisiwch eto o.g.y.dd',
'success' => 'Model wedi diweddaru\'n llwyddiannus.'
),
'delete' => array(
'confirm' => 'Ydych chi\'n sicr eich bod eisiau dileu\'r model ased yma?',
'error' => 'Nid oedd yn bosib dileu\'r model. Ceisiwch eto o.g.y.dd.',
'success' => 'Model wedi dileu\'n llwyddiannus.'
),
'restore' => array(
'error' => 'Nid oedd yn bosib adfer y model, ceisiwch eto o.g.y.dd',
'success' => 'Model wedi adfer yn llwyddiannus.'
),
'bulkedit' => array(
'error' => 'Dim newid mewn manylder, felly dim byd i diweddaru.',
'success' => 'Modelau wedi diweddaru.'
),
'bulkdelete' => array(
'error' => 'Dim modelau wedi dewis, felly dim byd i\'w ddileu.',
'success' => ':success_count model(au) wedi dileu!',
'success_partial' => ':success_count model(au) wedi\'i dileu, :fail_count heb eu ddileu gan bod asedau wedi perthnasu iddo.'
),
);

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