Fixes bug where 12-hour format was used for hours

This commit is contained in:
snipe 2016-09-26 22:34:09 -07:00
parent 3208522dd1
commit 819ca2921b
3 changed files with 18 additions and 18 deletions

View file

@ -267,7 +267,7 @@ class AssetsController extends Controller
if (Input::get('assigned_to')!='') {
$user = User::find(e(Input::get('assigned_to')));
$asset->checkOutToUser($user, Auth::user(), date('Y-m-d h:i:s'), '', 'Checked out on asset creation', e(Input::get('name')));
$asset->checkOutToUser($user, Auth::user(), date('Y-m-d H:i:s'), '', 'Checked out on asset creation', e(Input::get('name')));
}
// Redirect to the asset listing page
\Session::flash('success', trans('admin/hardware/message.create.success'));
@ -288,7 +288,7 @@ class AssetsController extends Controller
*/
public function getEdit($assetId = null)
{
// Check if the asset exists
if (!$asset = Asset::find($assetId)) {
// Redirect to the asset management page
@ -1423,7 +1423,7 @@ class AssetsController extends Controller
return View::make('hardware/labels')->with('assets', $assets)->with('settings', $settings)->with('count', $count)->with('settings', $settings);
} elseif (Input::get('bulk_actions')=='delete') {
@ -1587,7 +1587,7 @@ class AssetsController extends Controller
foreach ($assets as $asset) {
//echo '<li>'.$asset;
$update_array['deleted_at'] = date('Y-m-d h:i:s');
$update_array['deleted_at'] = date('Y-m-d H:i:s');
$update_array['assigned_to'] = null;
if (DB::table('assets')
@ -1857,12 +1857,12 @@ class AssetsController extends Controller
$users_list = Helper::usersList();
// Filter out assets that are not deployable.
$assets = Asset::RTD()->get();
$assets_list = Company::scopeCompanyables($assets, 'assets.company_id')->lists('detailed_name', 'id')->toArray();
return View::make('hardware/bulk-checkout')->with('users_list', $users_list)->with('assets_list', $assets_list);
}
public function postBulkCheckout(Request $request)
{
@ -1872,31 +1872,31 @@ class AssetsController extends Controller
$user = User::find(e(Input::get('assigned_to')));
$admin = Auth::user();
$asset_ids = array_filter(Input::get('selected_assets'));
if ((Input::has('checkout_at')) && (Input::get('checkout_at')!= date("Y-m-d"))) {
$checkout_at = e(Input::get('checkout_at'));
} else {
$checkout_at = date("Y-m-d H:i:s");
}
if (Input::has('expected_checkin')) {
$expected_checkin = e(Input::get('expected_checkin'));
} else {
$expected_checkin = '';
}
$has_errors = false;
$errors = [];
DB::transaction(function() use ($user, $admin, $checkout_at, $expected_checkin, $errors, $asset_ids)
{
{
foreach($asset_ids as $asset_id)
{
$asset = Asset::find($asset_id);
$error = $asset->checkOutToUser($user, $admin, $checkout_at, $expected_checkin, e(Input::get('note')), null);
if($error)
{
$has_errors = true;
@ -1904,12 +1904,12 @@ class AssetsController extends Controller
}
}
});
if (!$errors) {
// Redirect to the new asset page
return redirect()->to("hardware")->with('success', trans('admin/hardware/message.checkout.success'));
}
// Redirect to the asset management page with error
return redirect()->to("hardware/bulk-checkout")->with('error', trans('admin/hardware/message.checkout.error'))->withErrors($errors);
}

View file

@ -345,7 +345,7 @@ class ComponentsController extends Controller
$component->assets()->attach($component->id, array(
'component_id' => $component->id,
'user_id' => $admin_user->id,
'created_at' => date('Y-m-d h:i:s'),
'created_at' => date('Y-m-d H:i:s'),
'assigned_qty' => e(Input::get('assigned_qty')),
'asset_id' => $asset_id));

View file

@ -861,7 +861,7 @@ class LicensesController extends Controller
$logaction->user_id = Auth::user()->id;
$logaction->note = e(Input::get('notes'));
$logaction->checkedout_to = null;
$logaction->created_at = date("Y-m-d h:i:s");
$logaction->created_at = date("Y-m-d H:i:s");
$logaction->filename = $filename;
$log = $logaction->logaction('uploaded');
} else {