48 return View::make(
'licenses/index');
65 $maintained_list = array(
'' =>
'Maintained',
'1' =>
'Yes',
'0' =>
'No');
68 return View::make(
'licenses/edit')
70 ->with(
'depreciation_list', $depreciation_list)
71 ->with(
'supplier_list', $supplier_list)
72 ->with(
'maintained_list', $maintained_list)
73 ->with(
'company_list', $company_list)
97 if (e(Input::get(
'purchase_cost')) ==
'') {
98 $license->purchase_cost = null;
100 $license->purchase_cost = e(Input::get(
'purchase_cost'));
103 if (e(Input::get(
'supplier_id')) ==
'') {
104 $license->supplier_id = null;
106 $license->supplier_id = e(Input::get(
'supplier_id'));
109 if (e(Input::get(
'maintained')) ==
'') {
110 $license->maintained = 0;
112 $license->maintained = e(Input::get(
'maintained'));
115 if (e(Input::get(
'reassignable')) ==
'') {
116 $license->reassignable = 0;
118 $license->reassignable = e(Input::get(
'reassignable'));
121 if (e(Input::get(
'purchase_order')) ==
'') {
122 $license->purchase_order =
'';
124 $license->purchase_order = e(Input::get(
'purchase_order'));
128 $license->name = e(Input::get(
'name'));
129 $license->serial = e(Input::get(
'serial'));
130 $license->license_email = e(Input::get(
'license_email'));
131 $license->license_name = e(Input::get(
'license_name'));
132 $license->notes = e(Input::get(
'notes'));
133 $license->order_number = e(Input::get(
'order_number'));
134 $license->seats = e(Input::get(
'seats'));
135 $license->purchase_date = e(Input::get(
'purchase_date'));
136 $license->purchase_order = e(Input::get(
'purchase_order'));
137 $license->depreciation_id = e(Input::get(
'depreciation_id'));
139 $license->expiration_date = e(Input::get(
'expiration_date'));
140 $license->user_id = Auth::user()->id;
142 if (($license->purchase_date ==
"") || ($license->purchase_date ==
"0000-00-00")) {
143 $license->purchase_date = null;
146 if (($license->expiration_date ==
"") || ($license->expiration_date ==
"0000-00-00")) {
147 $license->expiration_date = null;
150 if (($license->purchase_cost ==
"") || ($license->purchase_cost ==
"0.00")) {
151 $license->purchase_cost = null;
155 if ($license->save()) {
157 $insertedId = $license->id;
159 for ($x=0; $x<$license->seats; $x++) {
161 $license_seat->license_id = $insertedId;
162 $license_seat->user_id = Auth::user()->id;
163 $license_seat->assigned_to = null;
164 $license_seat->notes = null;
165 $license_seat->save();
170 return Redirect::to(
"admin/licenses")->with(
'success', trans(
'admin/licenses/message.create.success'));
173 return Redirect::back()->withInput()->withErrors($license->getErrors());
189 if (is_null($license = License::find($licenseId))) {
191 return Redirect::to(
'admin/licenses')->with(
'error', trans(
'admin/licenses/message.does_not_exist'));
193 return Redirect::to(
'admin/licenses')->with(
'error', trans(
'general.insufficient_permissions'));
196 if ($license->purchase_date ==
"0000-00-00") {
197 $license->purchase_date = null;
200 if ($license->purchase_cost ==
"0.00") {
201 $license->purchase_cost = null;
205 $license_options = array(
'' =>
'Top Level') + DB::table(
'assets')->where(
'id',
'!=', $licenseId)->pluck(
'name',
'id');
206 $depreciation_list = array(
'0' => trans(
'admin/licenses/form.no_depreciation')) + Depreciation::pluck(
'name',
'id')->toArray();
207 $supplier_list = array(
'' =>
'Select Supplier') + Supplier::orderBy(
'name',
'asc')->pluck(
'name',
'id')->toArray();
208 $maintained_list = array(
'' =>
'Maintained',
'1' =>
'Yes',
'0' =>
'No');
211 return View::make(
'licenses/edit', compact(
'license'))
212 ->with(
'license_options', $license_options)
213 ->with(
'depreciation_list', $depreciation_list)
214 ->with(
'supplier_list', $supplier_list)
215 ->with(
'company_list', $company_list)
216 ->with(
'maintained_list', $maintained_list);
233 if (is_null($license = License::find($licenseId))) {
235 return Redirect::to(
'admin/licenses')->with(
'error', trans(
'admin/licenses/message.does_not_exist'));
237 return Redirect::to(
'admin/licenses')->with(
'error', trans(
'general.insufficient_permissions'));
241 $license->name = e(Input::get(
'name'));
242 $license->serial = e(Input::get(
'serial'));
243 $license->license_email = e(Input::get(
'license_email'));
244 $license->license_name = e(Input::get(
'license_name'));
245 $license->notes = e(Input::get(
'notes'));
246 $license->order_number = e(Input::get(
'order_number'));
247 $license->depreciation_id = e(Input::get(
'depreciation_id'));
249 $license->purchase_order = e(Input::get(
'purchase_order'));
250 $license->maintained = e(Input::get(
'maintained'));
251 $license->reassignable = e(Input::get(
'reassignable'));
253 if (e(Input::get(
'supplier_id')) ==
'') {
254 $license->supplier_id = null;
256 $license->supplier_id = e(Input::get(
'supplier_id'));
260 if (e(Input::get(
'purchase_date')) ==
'') {
261 $license->purchase_date = null;
263 $license->purchase_date = e(Input::get(
'purchase_date'));
266 if (e(Input::get(
'expiration_date')) ==
'') {
267 $license->expiration_date = null;
269 $license->expiration_date = e(Input::get(
'expiration_date'));
272 if (e(Input::get(
'termination_date')) ==
'') {
273 $license->termination_date = null;
275 $license->termination_date = e(Input::get(
'termination_date'));
278 if (e(Input::get(
'purchase_cost')) ==
'') {
279 $license->purchase_cost = null;
281 $license->purchase_cost = e(Input::get(
'purchase_cost'));
285 if (e(Input::get(
'maintained')) ==
'') {
286 $license->maintained = 0;
288 $license->maintained = e(Input::get(
'maintained'));
291 if (e(Input::get(
'reassignable')) ==
'') {
292 $license->reassignable = 0;
294 $license->reassignable = e(Input::get(
'reassignable'));
297 if (e(Input::get(
'purchase_order')) ==
'') {
298 $license->purchase_order =
'';
300 $license->purchase_order = e(Input::get(
'purchase_order'));
304 if ($license->seats != e(Input::get(
'seats'))) {
306 $difference = e(Input::get(
'seats')) - $license->licenseseats()->count();
308 if ($difference < 0) {
310 $seats = $license->licenseseats->filter(
function ($seat) {
311 return is_null($seat->user);
316 if ($seats->count() >= abs($difference)) {
317 for ($i=1; $i <= abs($difference); $i++) {
319 $seats->pop()->delete();
324 $logaction->asset_id = $license->id;
325 $logaction->asset_type =
'software';
326 $logaction->user_id = Auth::user()->id;
327 $logaction->note = abs($difference).
" seats";
328 $logaction->checkedout_to = null;
329 $log = $logaction->logaction(
'delete seats');
333 return Redirect::to(
"admin/licenses/$licenseId/edit")->with(
'error', trans(
'admin/licenses/message.assoc_users'));
337 for ($i=1; $i <= $difference; $i++) {
340 $license_seat->license_id = $license->id;
341 $license_seat->user_id = Auth::user()->id;
342 $license_seat->assigned_to = null;
343 $license_seat->notes = null;
344 $license_seat->save();
349 $logaction->asset_id = $license->id;
350 $logaction->asset_type =
'software';
351 $logaction->user_id = Auth::user()->id;
352 $logaction->note = abs($difference).
" seats";
353 $log = $logaction->logaction(
'add seats');
355 $license->seats = e(Input::get(
'seats'));
359 if ($license->save()) {
361 return Redirect::to(
"admin/licenses/$licenseId/view")->with(
'success', trans(
'admin/licenses/message.update.success'));
366 return Redirect::to(
"admin/licenses/$licenseId/edit")->with(
'error', trans(
'admin/licenses/message.update.error'));
382 if (is_null($license = License::find($licenseId))) {
384 return Redirect::to(
'admin/licenses')->with(
'error', trans(
'admin/licenses/message.not_found'));
386 return Redirect::to(
'admin/licenses')->with(
'error', trans(
'general.insufficient_permissions'));
389 if (($license->assignedcount()) && ($license->assignedcount() > 0)) {
392 return Redirect::to(
'admin/licenses')->with(
'error', trans(
'admin/licenses/message.assoc_users'));
397 DB::table(
'license_seats')
398 ->where(
'id', $license->id)
399 ->update(array(
'assigned_to' => null,
'asset_id' => null));
401 $licenseseats = $license->licenseseats();
402 $licenseseats->delete();
409 return Redirect::to(
'admin/licenses')->with(
'success', trans(
'admin/licenses/message.delete.success'));
430 if (is_null($licenseseat = LicenseSeat::find($seatId))) {
432 return Redirect::to(
'admin/licenses')->with(
'error', trans(
'admin/licenses/message.not_found'));
434 return Redirect::to(
'admin/licenses')->with(
'error', trans(
'general.insufficient_permissions'));
438 $users_list = array(
'' =>
'Select a User') + DB::table(
'users')->select(DB::raw(
'concat(last_name,", ",first_name," (",username,")") as full_name, id'))->whereNull(
'deleted_at')->orderBy(
'last_name',
'asc')->orderBy(
'first_name',
'asc')->lists(
'full_name',
'id');
442 $asset = DB::table(
'assets')
443 ->leftJoin(
'users',
'users.id',
'=',
'assets.assigned_to')
444 ->leftJoin(
'models',
'assets.model_id',
'=',
'models.id')
451 DB::raw(
'concat(first_name," ",last_name) as full_name, assets.id as id, models.name as modelname')
453 ->whereNull(
'assets.deleted_at')
456 $asset_array = json_decode(json_encode($asset),
true);
457 $asset_element[
''] =
'Please select an asset';
460 for ($x=0; $x<count($asset_array); $x++) {
462 if ($asset_array[$x][
'full_name']!=
'') {
463 $full_name =
' ('.$asset_array[$x][
'full_name'].
') '.$asset_array[$x][
'modelname'];
465 $full_name =
' (Unassigned) '.$asset_array[$x][
'modelname'];
467 $asset_element[$asset_array[$x][
'id']] = $asset_array[$x][
'asset_tag'].
' - '.$asset_array[$x][
'name'].$full_name;
471 return View::make(
'licenses/checkout', compact(
'licenseseat'))->with(
'users_list', $users_list)->with(
'asset_list', $asset_element);
489 $licenseseat = LicenseSeat::find($seatId);
490 $assigned_to = e(Input::get(
'assigned_to'));
491 $asset_id = e(Input::get(
'asset_id'));
492 $user = Auth::user();
495 return Redirect::to(
'admin/licenses')->with(
'error', trans(
'general.insufficient_permissions'));
502 'asset_id' =>
'required_without:assigned_to',
506 $validator = Validator::make(Input::all(), $rules);
509 if ($validator->fails()) {
511 return Redirect::back()->withInput()->withErrors($validator);
514 if ($assigned_to!=
'') {
516 if (is_null($is_assigned_to = User::find($assigned_to))) {
518 return Redirect::to(
'admin/licenses')->with(
'error', trans(
'admin/licenses/message.user_does_not_exist'));
524 if (is_null($is_asset_id = Asset::find($asset_id))) {
526 return Redirect::to(
'admin/licenses')->with(
'error', trans(
'admin/licenses/message.asset_does_not_exist'));
529 if (($is_asset_id->assigned_to!=$assigned_to) && ($assigned_to!=
'')) {
531 return Redirect::to(
'admin/licenses')->with(
'error', trans(
'admin/licenses/message.owner_doesnt_match_asset'));
539 if (is_null($licenseseat)) {
541 return Redirect::to(
'admin/licenses')->with(
'error', trans(
'admin/licenses/message.not_found'));
544 if (Input::get(
'asset_id') ==
'') {
545 $licenseseat->asset_id = null;
547 $licenseseat->asset_id = e(Input::get(
'asset_id'));
551 if (e(Input::get(
'assigned_to')) ==
'') {
552 $licenseseat->assigned_to = null;
555 $licenseseat->assigned_to = e(Input::get(
'assigned_to'));
559 if ($licenseseat->save()) {
564 $logaction->asset_type =
'software';
565 $logaction->user_id = Auth::user()->id;
566 $logaction->note = e(Input::get(
'note'));
567 $logaction->asset_id = $licenseseat->license_id;
570 $license = License::find($licenseseat->license_id);
575 if (e(Input::get(
'assigned_to')) ==
'') {
576 $logaction->checkedout_to = null;
577 $slack_msg = strtoupper($logaction->asset_type).
' license <'.config(
'app.url').
'/admin/licenses/'.$license->id.
'/view'.
'|'.$license->name.
'> checked out to <'.config(
'app.url').
'/hardware/'.$is_asset_id->id.
'/view|'.$is_asset_id->showAssetName().
'> by <'.config(
'app.url').
'/admin/users/'.$user->id.
'/view'.
'|'.$user->fullName().
'>.';
579 $logaction->checkedout_to = e(Input::get(
'assigned_to'));
580 $slack_msg = strtoupper($logaction->asset_type).
' license <'.config(
'app.url').
'/admin/licenses/'.$license->id.
'/view'.
'|'.$license->name.
'> checked out to <'.config(
'app.url').
'/admin/users/'.$is_assigned_to->id.
'/view|'.$is_assigned_to->fullName().
'> by <'.config(
'app.url').
'/admin/users/'.$user->id.
'/view'.
'|'.$user->fullName().
'>.';
585 if ($settings->slack_endpoint) {
589 'username' => $settings->botname,
590 'channel' => $settings->slack_channel,
594 $client = new \Maknz\Slack\Client($settings->slack_endpoint, $slack_settings);
601 'title' =>
'Checked Out:',
602 'value' => $slack_msg
606 'value' => e($logaction->note)
612 ])->send(
'License Checked Out');
620 $log = $logaction->logaction(
'checkout');
624 return Redirect::to(
"admin/licenses")->with(
'success', trans(
'admin/licenses/message.checkout.success'));
628 return Redirect::to(
'admin/licenses/$assetId/checkout')->with(
'error', trans(
'admin/licenses/message.create.error'))->with(
'license',
new License);
644 if (is_null($licenseseat = LicenseSeat::find($seatId))) {
646 return Redirect::to(
'admin/licenses')->with(
'error', trans(
'admin/licenses/message.not_found'));
648 return Redirect::to(
'admin/licenses')->with(
'error', trans(
'general.insufficient_permissions'));
650 return View::make(
'licenses/checkin', compact(
'licenseseat'))->with(
'backto', $backto);
669 if (is_null($licenseseat = LicenseSeat::find($seatId))) {
671 return Redirect::to(
'admin/licenses')->with(
'error', trans(
'admin/licenses/message.not_found'));
674 $license = License::find($licenseseat->license_id);
677 return Redirect::to(
'admin/licenses')->with(
'error', trans(
'general.insufficient_permissions'));
680 if (!$license->reassignable) {
682 Session::flash(
'error',
'License not reassignable.');
683 return Redirect::back()->withInput();
693 $validator = Validator::make(Input::all(), $rules);
696 if ($validator->fails()) {
698 return Redirect::back()->withInput()->withErrors($validator);
700 $return_to = $licenseseat->assigned_to;
702 $logaction->checkedout_to = $licenseseat->assigned_to;
705 $licenseseat->assigned_to = null;
706 $licenseseat->asset_id = null;
708 $user = Auth::user();
711 if ($licenseseat->save()) {
712 $logaction->asset_id = $licenseseat->license_id;
713 $logaction->location_id = null;
714 $logaction->asset_type =
'software';
715 $logaction->note = e(Input::get(
'note'));
716 $logaction->user_id = $user->id;
720 if ($settings->slack_endpoint) {
724 'username' => $settings->botname,
725 'channel' => $settings->slack_channel,
729 $client = new \Maknz\Slack\Client($settings->slack_endpoint, $slack_settings);
736 'title' =>
'Checked In:',
737 'value' => strtoupper($logaction->asset_type).
' <'.config(
'app.url').
'/admin/licenses/'.$license->id.
'/view'.
'|'.$license->name.
'> checked in by <'.config(
'app.url').
'/admin/users/'.$user->id.
'/view'.
'|'.$user->fullName().
'>.' 741 'value' => e($logaction->note)
745 ])->send(
'License Checked In');
754 $log = $logaction->logaction(
'checkin from');
758 if ($backto==
'user') {
759 return Redirect::to(
"admin/users/".$return_to.
'/view')->with(
'success', trans(
'admin/licenses/message.checkin.success'));
761 return Redirect::to(
"admin/licenses/".$licenseseat->license_id.
"/view")->with(
'success', trans(
'admin/licenses/message.checkin.success'));
767 return Redirect::to(
"admin/licenses")->with(
'error', trans(
'admin/licenses/message.checkin.error'));
781 $license = License::find($licenseId);
783 if (isset($license->id)) {
786 return Redirect::to(
'admin/licenses')->with(
'error', trans(
'general.insufficient_permissions'));
788 return View::make(
'licenses/view', compact(
'license'));
792 $error = trans(
'admin/licenses/message.does_not_exist', compact(
'id'));
795 return Redirect::route(
'licenses')->with(
'error', $error);
802 if (is_null($license_to_clone = License::find($licenseId))) {
804 return Redirect::to(
'admin/licenses')->with(
'error', trans(
'admin/licenses/message.does_not_exist'));
806 return Redirect::to(
'admin/licenses')->with(
'error', trans(
'general.insufficient_permissions'));
810 $license_options = array(
'0' =>
'Top Level') + License::pluck(
'name',
'id')->toArray();
811 $maintained_list = array(
'' =>
'Maintained',
'1' =>
'Yes',
'0' =>
'No');
814 $license = clone $license_to_clone;
816 $license->serial = null;
821 return View::make(
'licenses/edit')
822 ->with(
'license_options', $license_options)
823 ->with(
'depreciation_list', $depreciation_list)
824 ->with(
'supplier_list', $supplier_list)
825 ->with(
'license', $license)
826 ->with(
'maintained_list', $maintained_list)
827 ->with(
'company_list', $company_list);
843 $license = License::find($licenseId);
846 $destinationPath = config(
'app.private_uploads').
'/licenses';
848 if (isset($license->id)) {
852 return Redirect::to(
'admin/licenses')->with(
'error', trans(
'general.insufficient_permissions'));
855 if (Input::hasFile(
'licensefile')) {
857 foreach (Input::file(
'licensefile') as $file) {
860 'licensefile' =>
'required|mimes:png,gif,jpg,jpeg,doc,docx,pdf,txt,zip,rar|max:2000' 862 $validator = Validator::make(array(
'licensefile'=> $file), $rules);
864 if ($validator->passes()) {
866 $extension = $file->getClientOriginalExtension();
867 $filename =
'license-'.$license->id.
'-'.str_random(8);
868 $filename .=
'-'.str_slug($file->getClientOriginalName()).
'.'.$extension;
869 $upload_success = $file->move($destinationPath, $filename);
873 $logaction->asset_id = $license->id;
874 $logaction->asset_type =
'software';
875 $logaction->user_id = Auth::user()->id;
876 $logaction->note = e(Input::get(
'notes'));
877 $logaction->checkedout_to = null;
878 $logaction->created_at = date(
"Y-m-d h:i:s");
879 $logaction->filename = $filename;
880 $log = $logaction->logaction(
'uploaded');
882 return Redirect::back()->with(
'error', trans(
'admin/licenses/message.upload.invalidfiles'));
888 if ($upload_success) {
889 return Redirect::back()->with(
'success', trans(
'admin/licenses/message.upload.success'));
891 return Redirect::back()->with(
'success', trans(
'admin/licenses/message.upload.error'));
895 return Redirect::back()->with(
'error', trans(
'admin/licenses/message.upload.nofiles'));
901 $error = trans(
'admin/licenses/message.does_not_exist', compact(
'id'));
904 return Redirect::route(
'licenses')->with(
'error', $error);
920 $license = License::find($licenseId);
921 $destinationPath = config(
'app.private_uploads').
'/licenses';
924 if (isset($license->id)) {
928 return Redirect::to(
'admin/licenses')->with(
'error', trans(
'general.insufficient_permissions'));
931 $log = Actionlog::find($fileId);
932 $full_filename = $destinationPath.
'/'.$log->filename;
933 if (file_exists($full_filename)) {
934 unlink($destinationPath.
'/'.$log->filename);
937 return Redirect::back()->with(
'success', trans(
'admin/licenses/message.deletefile.success'));
941 $error = trans(
'admin/licenses/message.does_not_exist', compact(
'id'));
944 return Redirect::route(
'licenses')->with(
'error', $error);
962 $license = License::find($licenseId);
965 if (isset($license->id)) {
968 return Redirect::to(
'admin/licenses')->with(
'error', trans(
'general.insufficient_permissions'));
971 $log = Actionlog::find($fileId);
972 $file = $log->get_src(
'licenses');
973 return Response::download($file);
976 $error = trans(
'admin/licenses/message.does_not_exist', compact(
'id'));
979 return Redirect::route(
'licenses')->with(
'error', $error);
994 $licenses = License::with(
'company');
996 if (Input::has(
'search')) {
997 $licenses = $licenses->TextSearch(Input::get(
'search'));
1000 $allowed_columns = [
'id',
'name',
'purchase_cost',
'expiration_date',
'purchase_order',
'order_number',
'notes',
'purchase_date',
'serial'];
1001 $order = Input::get(
'order') ===
'asc' ?
'asc' :
'desc';
1002 $sort = in_array(Input::get(
'sort'), $allowed_columns) ? e(Input::get(
'sort')) :
'created_at';
1004 $licenses = $licenses->orderBy($sort, $order);
1006 $licenseCount = $licenses->count();
1007 $licenses = $licenses->skip(Input::get(
'offset'))->take(Input::get(
'limit'))->get();
1011 foreach ($licenses as $license) {
1012 $actions =
'<span style="white-space: nowrap;"><a href="'.route(
'freecheckout/license', $license->id).
'" class="btn btn-primary btn-sm" style="margin-right:5px;" '.(($license->remaincount() > 0) ?
'' :
'disabled').
'>'.trans(
'general.checkout').
'</a> <a href="'.route(
'clone/license', $license->id).
'" class="btn btn-info btn-sm" style="margin-right:5px;" title="Clone asset"><i class="fa fa-files-o"></i></a><a href="'.route(
'update/license', $license->id).
'" class="btn btn-warning btn-sm" style="margin-right:5px;"><i class="fa fa-pencil icon-white"></i></a><a data-html="false" class="btn delete-asset btn-danger btn-sm" data-toggle="modal" href="'.route(
'delete/license', $license->id).
'" data-content="'.trans(
'admin/licenses/message.delete.confirm').
'" data-title="'.trans(
'general.delete').
' '.htmlspecialchars($license->name).
'?" onClick="return false;"><i class="fa fa-trash icon-white"></i></a></span>';
1015 'id' => $license->id,
1016 'name' => (
string) link_to(
'/admin/licenses/'.$license->id.
'/view', $license->name),
1017 'serial' => (
string) link_to(
'/admin/licenses/'.$license->id.
'/view', mb_strimwidth($license->serial, 0, 50,
"...")),
1018 'totalSeats' => $license->totalSeatsByLicenseID(),
1019 'remaining' => $license->remaincount(),
1020 'license_name' => e($license->license_name),
1021 'license_email' => e($license->license_email),
1022 'purchase_date' => ($license->purchase_date) ? $license->purchase_date :
'',
1023 'expiration_date' => ($license->expiration_date) ? $license->expiration_date :
'',
1024 'purchase_cost' => ($license->purchase_cost) ? $license->purchase_cost :
'',
1025 'purchase_order' => ($license->purchase_order) ? e($license->purchase_order) :
'',
1026 'order_number' => ($license->order_number) ? e($license->order_number) :
'',
1027 'notes' => ($license->notes) ? e($license->notes) :
'',
1028 'actions' => $actions,
1029 'companyName' => is_null($license->company) ?
'' : e($license->company->name)
1033 $data = array(
'total' => $licenseCount,
'rows' => $rows);
1054 if (is_null($license = License::find($licenseId))) {
1056 return Redirect::to(
'admin/licenses')->with(
'error', trans(
'admin/licenses/message.not_found'));
1058 $seatId = $license->freeSeat($licenseId);
1059 return Redirect::to(
'admin/licenses/'.$seatId.
'/checkout');
postUpload($licenseId=null)
Validates and stores files associated with a license.
postCheckout($seatId)
Validates and stores the license checkout action.
Model for the Actionlog (the table that keeps a historical log of checkouts, checkins, and updates).
getCreate()
Returns a form view that allows an admin to create a new licence.
static getIdForCurrentUser($unescaped_input)
getCheckin($seatId=null, $backto=null)
Makes the form view to check a license seat back into inventory.
getView($licenseId=null)
Makes the license detail page.
displayFile($licenseId=null, $fileId=null)
Allows the selected file to be viewed.
getDelete($licenseId)
Checks to see whether the selected license can be deleted, and if it can, marks it as deleted...
getCheckout($seatId)
Provides the form view for checking out a license to a user.
static isCurrentUserHasAccess($companyable)
getClone($licenseId=null)
getIndex()
Returns a view that invokes the ajax tables which actually contains the content for the licenses list...
getDeleteFile($licenseId=null, $fileId=null)
Deletes the selected license file.
This controller handles all actions related to Licenses for the Snipe-IT Asset Management application...
postCreate()
Validates and stores the license form data submitted from the new license form.
getFreeLicense($licenseId)
Generates the next free seat ID for checkout.
static depreciationList()
postCheckin($seatId=null, $backto=null)
Validates and stores the license checkin action.
getEdit($licenseId=null)
Returns a form with existing license data to allow an admin to update license information.
postEdit($licenseId=null)
Validates and stores the license form data submitted from the edit license form.
getDatatable()
Generates a JSON response to populate the licence index datatables.