mirror of
https://github.com/snipe/snipe-it.git
synced 2025-03-05 20:52:15 -08:00
Added variable to determine if “new” modal button should be displayed
This commit is contained in:
parent
500f6d7baf
commit
ff793f1cb5
|
@ -422,261 +422,275 @@ class ReportsController extends Controller
|
||||||
* @since [v1.0]
|
* @since [v1.0]
|
||||||
* @return \Illuminate\Http\Response
|
* @return \Illuminate\Http\Response
|
||||||
*/
|
*/
|
||||||
public function postCustom()
|
public function postCustom(Request $request)
|
||||||
{
|
{
|
||||||
$assets = Asset::orderBy('created_at', 'DESC')->with('company', 'assignedTo', 'location', 'defaultLoc', 'model', 'supplier', 'assetstatus', 'model.manufacturer')->get();
|
|
||||||
|
\Debugbar::disable();
|
||||||
$customfields = CustomField::get();
|
$customfields = CustomField::get();
|
||||||
|
$response = new StreamedResponse(function () use ($customfields, $request) {
|
||||||
|
|
||||||
$rows = [ ];
|
// Open output stream
|
||||||
$header = [ ];
|
$handle = fopen('php://output', 'w');
|
||||||
|
|
||||||
if (e(Input::get('company')) == '1') {
|
if ($request->has('use_bom')) {
|
||||||
$header[] = 'Company Name';
|
fprintf($handle, chr(0xEF) . chr(0xBB) . chr(0xBF));
|
||||||
}
|
|
||||||
|
|
||||||
if (e(Input::get('asset_name')) == '1') {
|
|
||||||
$header[] = 'Asset Name';
|
|
||||||
}
|
|
||||||
if (e(Input::get('asset_tag')) == '1') {
|
|
||||||
$header[] = 'Asset Tag';
|
|
||||||
}
|
|
||||||
if (e(Input::get('manufacturer')) == '1') {
|
|
||||||
$header[] = 'Manufacturer';
|
|
||||||
}
|
|
||||||
if (e(Input::get('model')) == '1') {
|
|
||||||
$header[] = 'Model';
|
|
||||||
$header[] = 'Model Number';
|
|
||||||
}
|
|
||||||
if (e(Input::get('category')) == '1') {
|
|
||||||
$header[] = 'Category';
|
|
||||||
}
|
|
||||||
if (e(Input::get('serial')) == '1') {
|
|
||||||
$header[] = 'Serial';
|
|
||||||
}
|
|
||||||
if (e(Input::get('purchase_date')) == '1') {
|
|
||||||
$header[] = 'Purchase Date';
|
|
||||||
}
|
|
||||||
if (( e(Input::get('purchase_cost')) == '1' ) && ( e(Input::get('depreciation')) != '1' )) {
|
|
||||||
$header[] = 'Purchase Cost';
|
|
||||||
}
|
|
||||||
if (e(Input::get('eol')) == '1') {
|
|
||||||
$header[] = 'EOL';
|
|
||||||
}
|
|
||||||
if (e(Input::get('order')) == '1') {
|
|
||||||
$header[] = 'Order Number';
|
|
||||||
}
|
|
||||||
if (e(Input::get('supplier')) == '1') {
|
|
||||||
$header[] = 'Supplier';
|
|
||||||
}
|
|
||||||
if (e(Input::get('location')) == '1') {
|
|
||||||
$header[] = 'Location';
|
|
||||||
}
|
|
||||||
if (e(Input::get('assigned_to')) == '1') {
|
|
||||||
$header[] = 'Assigned To';
|
|
||||||
}
|
|
||||||
if (e(Input::get('username')) == '1') {
|
|
||||||
$header[] = 'Username';
|
|
||||||
}
|
|
||||||
if (e(Input::get('employee_num')) == '1') {
|
|
||||||
$header[] = 'Employee No.';
|
|
||||||
}
|
|
||||||
if (e(Input::get('status')) == '1') {
|
|
||||||
$header[] = 'Status';
|
|
||||||
}
|
|
||||||
if (e(Input::get('warranty')) == '1') {
|
|
||||||
$header[] = 'Warranty';
|
|
||||||
$header[] = 'Warranty Expires';
|
|
||||||
}
|
|
||||||
if (e(Input::get('depreciation')) == '1') {
|
|
||||||
$header[] = 'Purchase Cost';
|
|
||||||
$header[] = 'Value';
|
|
||||||
$header[] = 'Diff';
|
|
||||||
}
|
|
||||||
if (e(Input::get('expected_checkin')) == '1') {
|
|
||||||
$header[] = trans('admin/hardware/form.expected_checkin');
|
|
||||||
}
|
|
||||||
|
|
||||||
if (e(Input::get('notes')) == '1') {
|
|
||||||
$header[] = trans('general.notes');
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
foreach ($customfields as $customfield) {
|
|
||||||
if (e(Input::get($customfield->db_column_name())) == '1') {
|
|
||||||
$header[] = $customfield->name;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
$header = array_map('trim', $header);
|
|
||||||
$rows[] = implode($header, ',');
|
|
||||||
|
|
||||||
foreach ($assets as $asset) {
|
|
||||||
$row = [ ];
|
|
||||||
|
|
||||||
if (e(Input::get('company')) == '1') {
|
|
||||||
$row[] = is_null($asset->company) ? '' : '"'.$asset->company->name.'"';
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (e(Input::get('asset_name')) == '1') {
|
$header = [];
|
||||||
$row[] = '"' .e($asset->name) . '"';
|
|
||||||
}
|
if ($request->has('company')) {
|
||||||
if (e(Input::get('asset_tag')) == '1') {
|
$header[] = 'Company Name';
|
||||||
$row[] = e($asset->asset_tag);
|
|
||||||
}
|
|
||||||
if (e(Input::get('manufacturer')) == '1') {
|
|
||||||
if ($asset->model->manufacturer) {
|
|
||||||
$row[] = '"' .e($asset->model->manufacturer->name) . '"';
|
|
||||||
} else {
|
|
||||||
$row[] = '';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (e(Input::get('model')) == '1') {
|
|
||||||
$row[] = '"' . e($asset->model->name) . '"';
|
|
||||||
$row[] = '"' . e($asset->model->model_number) . '"';
|
|
||||||
}
|
|
||||||
if (e(Input::get('category')) == '1') {
|
|
||||||
$row[] = '"' .e($asset->model->category->name) . '"';
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (e(Input::get('serial')) == '1') {
|
if ($request->has('asset_name')) {
|
||||||
$row[] = e($asset->serial);
|
$header[] = 'Asset Name';
|
||||||
}
|
}
|
||||||
if (e(Input::get('purchase_date')) == '1') {
|
if ($request->has('asset_tag')) {
|
||||||
$row[] = e($asset->purchase_date);
|
$header[] = 'Asset Tag';
|
||||||
}
|
}
|
||||||
if (e(Input::get('purchase_cost')) == '1' && ( e(Input::get('depreciation')) != '1' )) {
|
if ($request->has('manufacturer')) {
|
||||||
$row[] = '"' . Helper::formatCurrencyOutput($asset->purchase_cost) . '"';
|
$header[] = 'Manufacturer';
|
||||||
}
|
}
|
||||||
if (e(Input::get('eol')) == '1') {
|
if ($request->has('model')) {
|
||||||
$row[] = '"' .($asset->present()->eol_date()) ? $asset->present()->eol_date() : ''. '"';
|
$header[] = 'Model';
|
||||||
|
$header[] = 'Model Number';
|
||||||
}
|
}
|
||||||
if (e(Input::get('order')) == '1') {
|
if ($request->has('category')) {
|
||||||
if ($asset->order_number) {
|
$header[] = 'Category';
|
||||||
$row[] = e($asset->order_number);
|
|
||||||
} else {
|
|
||||||
$row[] = '';
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
if (e(Input::get('supplier')) == '1') {
|
if ($request->has('serial')) {
|
||||||
if ($asset->supplier) {
|
$header[] = 'Serial';
|
||||||
$row[] = '"' .e($asset->supplier->name) . '"';
|
}
|
||||||
} else {
|
if ($request->has('purchase_date')) {
|
||||||
$row[] = '';
|
$header[] = 'Purchase Date';
|
||||||
}
|
}
|
||||||
|
if ($request->has('purchase_cost')) {
|
||||||
|
$header[] = 'Purchase Cost';
|
||||||
|
}
|
||||||
|
if ($request->has('eol')) {
|
||||||
|
$header[] = 'EOL';
|
||||||
|
}
|
||||||
|
if ($request->has('order')) {
|
||||||
|
$header[] = 'Order Number';
|
||||||
|
}
|
||||||
|
if ($request->has('supplier')) {
|
||||||
|
$header[] = 'Supplier';
|
||||||
|
}
|
||||||
|
if ($request->has('location')) {
|
||||||
|
$header[] = 'Location';
|
||||||
|
}
|
||||||
|
if ($request->has('assigned_to')) {
|
||||||
|
$header[] = 'Assigned To';
|
||||||
|
$header[] = 'Assigned Type';
|
||||||
|
}
|
||||||
|
if ($request->has('username')) {
|
||||||
|
$header[] = 'Username';
|
||||||
|
}
|
||||||
|
if ($request->has('employee_num')) {
|
||||||
|
$header[] = 'Employee No.';
|
||||||
|
}
|
||||||
|
if ($request->has('status')) {
|
||||||
|
$header[] = 'Status';
|
||||||
|
}
|
||||||
|
if ($request->has('warranty')) {
|
||||||
|
$header[] = 'Warranty';
|
||||||
|
$header[] = 'Warranty Expires';
|
||||||
|
}
|
||||||
|
if ($request->has('depreciation')) {
|
||||||
|
$header[] = 'Purchase Cost';
|
||||||
|
$header[] = 'Value';
|
||||||
|
$header[] = 'Diff';
|
||||||
|
}
|
||||||
|
if ($request->has('expected_checkin')) {
|
||||||
|
$header[] = trans('admin/hardware/form.expected_checkin');
|
||||||
}
|
}
|
||||||
|
|
||||||
if (e(Input::get('location')) == '1') {
|
if ($request->has('notes')) {
|
||||||
if($asset->location) {
|
$header[] = trans('general.notes');
|
||||||
$show_loc = $asset->location->present()->name();
|
|
||||||
} else {
|
|
||||||
$show_loc = 'Default location '.$asset->rtd_location_id.' is invalid';
|
|
||||||
}
|
|
||||||
$row[] = $show_loc;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if (e(Input::get('assigned_to')) == '1') {
|
|
||||||
if ($asset->assignedto) {
|
|
||||||
$row[] = '"' .e($asset->assignedto->present()->name()). '"';
|
|
||||||
} else {
|
|
||||||
$row[] = ''; // Empty string if unassigned
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (e(Input::get('username')) == '1') {
|
|
||||||
// Only works if we're checked out to a user, not anything else.
|
|
||||||
if ($asset->checkedOutToUser()) {
|
|
||||||
if ($asset->assignedto) {
|
|
||||||
$row[] = '"' .e($asset->assignedto->username). '"';
|
|
||||||
} else {
|
|
||||||
$row[] = ''; // Empty string if unassigned
|
|
||||||
}
|
|
||||||
|
|
||||||
} else {
|
|
||||||
$row[] = ''; // Empty string if unassigned
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (e(Input::get('employee_num')) == '1') {
|
|
||||||
// Only works if we're checked out to a user, not anything else.
|
|
||||||
if ($asset->checkedOutToUser()) {
|
|
||||||
if ($asset->assignedto) {
|
|
||||||
$row[] = '"' .e($asset->assignedto->employee_num). '"';
|
|
||||||
} else {
|
|
||||||
$row[] = ''; // Empty string if unassigned
|
|
||||||
}
|
|
||||||
|
|
||||||
} else {
|
|
||||||
$row[] = ''; // Empty string if unassigned
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (e(Input::get('status')) == '1') {
|
|
||||||
if (( $asset->status_id == '0' ) && ( $asset->assigned_to == '0' )) {
|
|
||||||
$row[] = trans('general.ready_to_deploy');
|
|
||||||
} elseif (( $asset->status_id == '' ) && ( $asset->assigned_to == '0' )) {
|
|
||||||
$row[] = trans('general.pending');
|
|
||||||
} elseif ($asset->assetstatus) {
|
|
||||||
$row[] = '"' .e($asset->assetstatus->name). '"';
|
|
||||||
} else {
|
|
||||||
$row[] = '';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (e(Input::get('warranty')) == '1') {
|
|
||||||
if ($asset->warranty_months) {
|
|
||||||
$row[] = $asset->warranty_months;
|
|
||||||
$row[] = $asset->present()->warrantee_expires();
|
|
||||||
} else {
|
|
||||||
$row[] = '';
|
|
||||||
$row[] = '';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (e(Input::get('depreciation')) == '1') {
|
|
||||||
$depreciation = $asset->getDepreciatedValue();
|
|
||||||
$row[] = '"' . Helper::formatCurrencyOutput($asset->purchase_cost) . '"';
|
|
||||||
$row[] = '"' . Helper::formatCurrencyOutput($depreciation) . '"';
|
|
||||||
$row[] = '"' . Helper::formatCurrencyOutput($asset->purchase_cost) . '"';
|
|
||||||
}
|
|
||||||
if (e(Input::get('expected_checkin')) == '1') {
|
|
||||||
if ($asset->expected_checkin) {
|
|
||||||
$row[] = '"' .e($asset->expected_checkin). '"';
|
|
||||||
} else {
|
|
||||||
$row[] = ''; // Empty string if blankd
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (e(Input::get('notes')) == '1') {
|
|
||||||
if ($asset->notes) {
|
|
||||||
$row[] = '"' .$asset->notes . '"';
|
|
||||||
} else {
|
|
||||||
$row[] = '';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
foreach ($customfields as $customfield) {
|
foreach ($customfields as $customfield) {
|
||||||
$column_name = $customfield->db_column_name();
|
|
||||||
if (e(Input::get($customfield->db_column_name())) == '1') {
|
if (e(Input::get($customfield->db_column_name())) == '1') {
|
||||||
$row[] = str_replace(",", "\,", $asset->$column_name);
|
$header[] = $customfield->name;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
$rows[] = implode($row, ',');
|
fputcsv($handle, $header);
|
||||||
}
|
|
||||||
|
$assets = Asset::orderBy('created_at', 'DESC')->with('company', 'assignedTo', 'location', 'defaultLoc', 'model', 'supplier', 'assetstatus', 'model.manufacturer');
|
||||||
|
|
||||||
|
if ($request->has('by_location_id')) {
|
||||||
|
$assets->where('assets.location_id', $request->input('by_location_id'));
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($request->has('by_supplier_id')) {
|
||||||
|
$assets->where('assets.supplier_id', $request->input('by_supplier_id'));
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($request->has('by_company_id')) {
|
||||||
|
$assets->where('assets.company_id', $request->input('by_company_id'));
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($request->has('by_model_id')) {
|
||||||
|
$assets->where('assets.model_id', $request->input('by_model_id'));
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($request->has('by_category_id')) {
|
||||||
|
$assets->InCategory($request->input('by_category_id'));
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($request->has('by_order_number')) {
|
||||||
|
$assets->where('assets.order_number', $request->input('by_order_number'));
|
||||||
|
}
|
||||||
|
|
||||||
|
if (($request->has('start')) && ($request->has('end'))) {
|
||||||
|
$assets->whereBetween('assets.purchase_date', [$request->input('start'), $request->input('end')]);
|
||||||
|
}
|
||||||
|
|
||||||
|
$assets->orderBy('assets.created_at', 'DESC')->chunk(500, function($assets) use($handle, $customfields, $request) {
|
||||||
|
|
||||||
|
foreach ($assets as $asset) {
|
||||||
|
$row = [];
|
||||||
|
|
||||||
|
if ($request->has('company')) {
|
||||||
|
$row[] = ($asset->company) ? $asset->company->name : '';
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($request->has('asset_name')) {
|
||||||
|
$row[] = ($asset->name) ? $asset->name : '';
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($request->has('asset_tag')) {
|
||||||
|
$row[] = ($asset->asset_tag) ? $asset->asset_tag : '';
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($request->has('manufacturer')) {
|
||||||
|
$row[] = ($asset->model && $asset->model->manufacturer) ? $asset->model->manufacturer->name : '';
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($request->has('model')) {
|
||||||
|
$row[] = ($asset->model) ? $asset->model->name : '';
|
||||||
|
$row[] = ($asset->model) ? $asset->model->model_number : '';
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($request->has('category')) {
|
||||||
|
$row[] = ($asset->model->category) ? $asset->model->category->name : '';
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($request->has('serial')) {
|
||||||
|
$row[] = ($asset->serial) ? $asset->serial : '';
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($request->has('purchase_date')) {
|
||||||
|
$row[] = ($asset->purchase_date) ? $asset->purchase_date : '';
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($request->has('purchase_cost')) {
|
||||||
|
$row[] = ($asset->purchase_cost) ? Helper::formatCurrencyOutput($asset->purchase_cost) : '';
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($request->has('eol')) {
|
||||||
|
$row[] = ($asset->eol) ? $asset->present()->eol_date() : '';
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($request->has('order')) {
|
||||||
|
$row[] = ($asset->order_number) ? $asset->order_number : '';
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($request->has('supplier')) {
|
||||||
|
$row[] = ($asset->location) ? $asset->supplier->name : '';
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
if ($request->has('location')) {
|
||||||
|
$row[] = ($asset->location) ? $asset->location->present()->name() : '';
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($request->has('assigned_to')) {
|
||||||
|
$row[] = ($asset->checkedOutToUser() && $asset->assigned) ? e($asset->assigned->getFullNameAttribute()) : ($asset->assigned ? e($asset->assigned->display_name) : '');
|
||||||
|
$row[] = ($asset->checkedOutToUser() && $asset->assigned) ? 'user' : e($asset->assignedType());
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($request->has('username')) {
|
||||||
|
// Only works if we're checked out to a user, not anything else.
|
||||||
|
if ($asset->checkedOutToUser()) {
|
||||||
|
$row[] = ($asset->assignedto) ? $asset->assignedto->username : '';
|
||||||
|
} else {
|
||||||
|
$row[] = ''; // Empty string if unassigned
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($request->has('employee_num')) {
|
||||||
|
// Only works if we're checked out to a user, not anything else.
|
||||||
|
if ($asset->checkedOutToUser()) {
|
||||||
|
$row[] = ($asset->assignedto) ? $asset->assignedto->employee_num : '';
|
||||||
|
} else {
|
||||||
|
$row[] = ''; // Empty string if unassigned
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($request->has('status')) {
|
||||||
|
if (( $asset->status_id == '0' ) && ( $asset->assigned_to == '0' )) {
|
||||||
|
$row[] = trans('general.ready_to_deploy');
|
||||||
|
} elseif (( $asset->status_id == '' ) && ( $asset->assigned_to == '0' )) {
|
||||||
|
$row[] = trans('general.pending');
|
||||||
|
} elseif ($asset->assetstatus) {
|
||||||
|
$row[] = $asset->assetstatus->name;
|
||||||
|
} else {
|
||||||
|
$row[] = '';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
if ($request->has('warranty')) {
|
||||||
|
$row[] = ($asset->warranty_months) ? $asset->warranty_months : '';
|
||||||
|
$row[] = $asset->present()->warrantee_expires();
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($request->has('depreciation')) {
|
||||||
|
if ($asset->purchase_cost!='') {
|
||||||
|
$depreciation = $asset->getDepreciatedValue();
|
||||||
|
$diff = ($asset->purchase_cost - $depreciation);
|
||||||
|
$row[] = Helper::formatCurrencyOutput($asset->purchase_cost);
|
||||||
|
$row[] = Helper::formatCurrencyOutput($depreciation);
|
||||||
|
$row[] = Helper::formatCurrencyOutput($diff);
|
||||||
|
} else {
|
||||||
|
$row[] = '';
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($request->has('expected_checkin')) {
|
||||||
|
$row[] = ($asset->expected_checkin) ? $asset->expected_checkin : '';
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($request->has('notes')) {
|
||||||
|
$row[] = ($asset->notes) ? $asset->notes : '';
|
||||||
|
}
|
||||||
|
|
||||||
|
foreach ($customfields as $customfield) {
|
||||||
|
$column_name = $customfield->db_column_name();
|
||||||
|
if ($request->has($customfield->db_column_name())) {
|
||||||
|
$row[] = $asset->$column_name;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
fputcsv($handle, $row);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
// Close the output stream
|
||||||
|
fclose($handle);
|
||||||
|
}, 200, [
|
||||||
|
'Content-Type' => 'text/csv',
|
||||||
|
'Content-Disposition'
|
||||||
|
=> 'attachment; filename="custom-assets-report-'.date('Y-m-d-his').'.csv"',
|
||||||
|
]);
|
||||||
|
|
||||||
|
return $response;
|
||||||
|
|
||||||
// spit out a csv
|
|
||||||
if (array_filter($rows)) {
|
|
||||||
$csv = implode($rows, "\n");
|
|
||||||
$response = Response::make($csv, 200);
|
|
||||||
$response->header('Content-Type', 'text/csv');
|
|
||||||
$response->header('Content-disposition', 'attachment;filename='.date('Y-m-d-His').'-custom-asset-report.csv');
|
|
||||||
|
|
||||||
return $response;
|
|
||||||
} else {
|
|
||||||
return redirect()->to("reports/custom")
|
|
||||||
->with('error', trans('admin/reports/message.error'));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -16,7 +16,9 @@
|
||||||
|
|
||||||
<div class="col-md-1 col-sm-1 text-left">
|
<div class="col-md-1 col-sm-1 text-left">
|
||||||
@can('create', \App\Models\Location::class)
|
@can('create', \App\Models\Location::class)
|
||||||
|
@if ((!isset($hide_new)) || ($hide_new!='true'))
|
||||||
<a href='{{ route('modal.location') }}' data-toggle="modal" data-target="#createModal" data-dependency="location" data-select='{{ $fieldname }}_location_select' class="btn btn-sm btn-default">New</a>
|
<a href='{{ route('modal.location') }}' data-toggle="modal" data-target="#createModal" data-dependency="location" data-select='{{ $fieldname }}_location_select' class="btn btn-sm btn-default">New</a>
|
||||||
|
@endif
|
||||||
@endcan
|
@endcan
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
|
|
||||||
{{ Form::label($fieldname, $translated_name, array('class' => 'col-md-3 control-label')) }}
|
{{ Form::label($fieldname, $translated_name, array('class' => 'col-md-3 control-label')) }}
|
||||||
|
|
||||||
<div class="col-md-7 required">
|
<div class="col-md-7{{ ((isset($required) && ($required =='true'))) ? ' required' : '' }}">
|
||||||
<select class="js-data-ajax" data-endpoint="models" name="{{ $fieldname }}" style="width: 100%" id="model_select_id">
|
<select class="js-data-ajax" data-endpoint="models" name="{{ $fieldname }}" style="width: 100%" id="model_select_id">
|
||||||
@if ($model_id = Input::old($fieldname, (isset($item)) ? $item->{$fieldname} : ''))
|
@if ($model_id = Input::old($fieldname, (isset($item)) ? $item->{$fieldname} : ''))
|
||||||
<option value="{{ $model_id }}" selected="selected">
|
<option value="{{ $model_id }}" selected="selected">
|
||||||
|
@ -17,8 +17,10 @@
|
||||||
</div>
|
</div>
|
||||||
<div class="col-md-1 col-sm-1 text-left">
|
<div class="col-md-1 col-sm-1 text-left">
|
||||||
@can('create', \App\Models\AssetModel::class)
|
@can('create', \App\Models\AssetModel::class)
|
||||||
<a href='{{ route('modal.model') }}' data-toggle="modal" data-target="#createModal" data-dependency="model" data-select='model_select_id' class="btn btn-sm btn-default">New</a>
|
@if ((!isset($hide_new)) || ($hide_new!='true'))
|
||||||
<span class="mac_spinner" style="padding-left: 10px; color: green; display:none; width: 30px;"><i class="fa fa-spinner fa-spin"></i> </span>
|
<a href='{{ route('modal.model') }}' data-toggle="modal" data-target="#createModal" data-dependency="model" data-select='model_select_id' class="btn btn-sm btn-default">New</a>
|
||||||
|
<span class="mac_spinner" style="padding-left: 10px; color: green; display:none; width: 30px;"><i class="fa fa-spinner fa-spin"></i> </span>
|
||||||
|
@endif
|
||||||
@endcan
|
@endcan
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
|
@ -16,7 +16,9 @@
|
||||||
|
|
||||||
<div class="col-md-1 col-sm-1 text-left">
|
<div class="col-md-1 col-sm-1 text-left">
|
||||||
@can('create', \App\Models\Supplier::class)
|
@can('create', \App\Models\Supplier::class)
|
||||||
<a href='{{ route('modal.supplier') }}' data-toggle="modal" data-target="#createModal" data-dependency="supplier" data-select='supplier_select' class="btn btn-sm btn-default">New</a>
|
@if ((!isset($hide_new)) || ($hide_new!='true'))
|
||||||
|
<a href='{{ route('modal.supplier') }}' data-toggle="modal" data-target="#createModal" data-dependency="supplier" data-select='supplier_select' class="btn btn-sm btn-default">New</a>
|
||||||
|
@endif
|
||||||
@endcan
|
@endcan
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
|
@ -16,7 +16,9 @@
|
||||||
|
|
||||||
<div class="col-md-1 col-sm-1 text-left">
|
<div class="col-md-1 col-sm-1 text-left">
|
||||||
@can('create', \App\Models\User::class)
|
@can('create', \App\Models\User::class)
|
||||||
<a href='{{ route('modal.user') }}' data-toggle="modal" data-target="#createModal" data-dependency="user" data-select='assigned_user_select' class="btn btn-sm btn-default">New</a>
|
@if ((!isset($hide_new)) || ($hide_new!='true'))
|
||||||
|
<a href='{{ route('modal.user') }}' data-toggle="modal" data-target="#createModal" data-dependency="user" data-select='assigned_user_select' class="btn btn-sm btn-default">New</a>
|
||||||
|
@endif
|
||||||
@endcan
|
@endcan
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue