本文整理汇总了PHP中app\helpers\Helper::usersList方法的典型用法代码示例。如果您正苦于以下问题:PHP Helper::usersList方法的具体用法?PHP Helper::usersList怎么用?PHP Helper::usersList使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类app\helpers\Helper
的用法示例。
在下文中一共展示了Helper::usersList方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getBulkCheckout
public function getBulkCheckout()
{
// Get the dropdown of users and then pass it to the checkout view
$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);
}
示例2: getCheckout
/**
* Provides the form view for checking out a license to a user.
* Here we pass the license seat ID instead of the license ID,
* because licenses themselves are never checked out to anyone,
* only the seats associated with them.
*
* @author [A. Gianotto] [<snipe@snipe.net>]
* @since [v1.0]
* @param int $seatId
* @return View
*/
public function getCheckout($seatId)
{
// Check if the license seat exists
if (is_null($licenseseat = LicenseSeat::find($seatId))) {
// Redirect to the asset management page with error
return redirect()->to('admin/licenses')->with('error', trans('admin/licenses/message.not_found'));
} elseif (!Company::isCurrentUserHasAccess($licenseseat->license)) {
return redirect()->to('admin/licenses')->with('error', trans('general.insufficient_permissions'));
}
// Get the dropdown of users and then pass it to the checkout view
$users_list = Helper::usersList();
$assets = Helper::detailedAssetList();
return View::make('licenses/checkout', compact('licenseseat'))->with('users_list', $users_list)->with('asset_list', $assets);
}
示例3: getCheckout
/**
* Return a view to checkout a consumable to a user.
*
* @author [A. Gianotto] [<snipe@snipe.net>]
* @see ConsumablesController::postCheckout() method that stores the data.
* @since [v1.0]
* @param int $consumableId
* @return View
*/
public function getCheckout($consumableId)
{
// Check if the consumable exists
if (is_null($consumable = Consumable::find($consumableId))) {
// Redirect to the consumable management page with error
return redirect()->to('consumables')->with('error', trans('admin/consumables/message.not_found'));
} elseif (!Company::isCurrentUserHasAccess($consumable)) {
return redirect()->to('admin/consumables')->with('error', trans('general.insufficient_permissions'));
}
// Get the dropdown of users and then pass it to the checkout view
$users_list = Helper::usersList();
return View::make('consumables/checkout', compact('consumable'))->with('users_list', $users_list);
}
示例4: getClone
/**
* Returns a view that presents a form to clone an asset.
*
* @author [A. Gianotto] [<snipe@snipe.net>]
* @param int $assetId
* @since [v1.0]
* @return View
*/
public function getClone($assetId = null)
{
// Check if the asset exists
if (is_null($asset_to_clone = Asset::find($assetId))) {
// Redirect to the asset management page
return redirect()->to('hardware')->with('error', trans('admin/hardware/message.does_not_exist'));
} elseif (!Company::isCurrentUserHasAccess($asset_to_clone)) {
return redirect()->to('hardware')->with('error', trans('general.insufficient_permissions'));
}
// Grab the dropdown lists
$model_list = Helper::modelList();
$statuslabel_list = Helper::statusLabelList();
$location_list = Helper::locationsList();
$manufacturer_list = Helper::manufacturerList();
$category_list = Helper::categoryList('asset');
$supplier_list = Helper::suppliersList();
$assigned_to = Helper::usersList();
$statuslabel_types = Helper::statusTypeList();
$company_list = Helper::companyList();
$asset = clone $asset_to_clone;
$asset->id = null;
$asset->asset_tag = '';
$asset->serial = '';
$asset->assigned_to = '';
return View::make('hardware/edit')->with('supplier_list', $supplier_list)->with('model_list', $model_list)->with('statuslabel_list', $statuslabel_list)->with('statuslabel_types', $statuslabel_types)->with('assigned_to', $assigned_to)->with('asset', $asset)->with('location_list', $location_list)->with('manufacturer', $manufacturer_list)->with('category', $category_list)->with('company_list', $company_list);
}