当前位置: 首页>>代码示例>>PHP>>正文


PHP Helper::suppliersList方法代码示例

本文整理汇总了PHP中app\helpers\Helper::suppliersList方法的典型用法代码示例。如果您正苦于以下问题:PHP Helper::suppliersList方法的具体用法?PHP Helper::suppliersList怎么用?PHP Helper::suppliersList使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在app\helpers\Helper的用法示例。


在下文中一共展示了Helper::suppliersList方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: postBulkEdit

 /**
  * Display the bulk edit page.
  *
  * @author [A. Gianotto] [<snipe@snipe.net>]
  * @param  int  $assetId
  * @since [v2.0]
  * @return View
  */
 public function postBulkEdit($assets = null)
 {
     if (!Company::isCurrentUserAuthorized()) {
         return redirect()->to('hardware')->with('error', trans('general.insufficient_permissions'));
     } elseif (!Input::has('edit_asset')) {
         return redirect()->back()->with('error', 'No assets selected');
     } else {
         $asset_raw_array = Input::get('edit_asset');
         foreach ($asset_raw_array as $asset_id => $value) {
             $asset_ids[] = $asset_id;
         }
     }
     if (Input::has('bulk_actions')) {
         // Create labels
         if (Input::get('bulk_actions') == 'labels') {
             $settings = Setting::getSettings();
             $assets = Asset::find($asset_ids);
             $count = 0;
             return View::make('hardware/labels')->with('assets', $assets)->with('settings', $settings)->with('count', $count)->with('settings', $settings);
         } elseif (Input::get('bulk_actions') == 'delete') {
             $assets = Asset::with('assigneduser', 'assetloc')->find($asset_ids);
             return View::make('hardware/bulk-delete')->with('assets', $assets);
             // Bulk edit
         } elseif (Input::get('bulk_actions') == 'edit') {
             $assets = Input::get('edit_asset');
             $supplier_list = Helper::suppliersList();
             $statuslabel_list = Helper::statusLabelList();
             $location_list = Helper::locationsList();
             $models_list = Helper::modelList();
             $companies_list = array('' => '') + array('clear' => trans('general.remove_company')) + Helper::companyList();
             return View::make('hardware/bulk')->with('assets', $assets)->with('supplier_list', $supplier_list)->with('statuslabel_list', $statuslabel_list)->with('location_list', $location_list)->with('models_list', $models_list)->with('companies_list', $companies_list);
         }
     } else {
         return redirect()->back()->with('error', 'No action selected');
     }
 }
开发者ID:stijni,项目名称:snipe-it,代码行数:44,代码来源:AssetsController.php

示例2: getEdit

 /**
  *  Returns a form view to edit a selected asset maintenance.
  *
  * @see AssetMaintenancesController::postEdit() method that stores the data
  * @author  Vincent Sposato <vincent.sposato@gmail.com>
  * @param int $assetMaintenanceId
  * @version v1.0
  * @since [v1.8]
  * @return mixed
  */
 public function getEdit($assetMaintenanceId = null)
 {
     // Check if the asset maintenance exists
     if (is_null($assetMaintenance = AssetMaintenance::find($assetMaintenanceId))) {
         // Redirect to the improvement management page
         return redirect()->to('admin/asset_maintenances')->with('error', trans('admin/asset_maintenances/message.not_found'));
     } elseif (!Company::isCurrentUserHasAccess($assetMaintenance->asset)) {
         return static::getInsufficientPermissionsRedirect();
     }
     if ($assetMaintenance->completion_date == '0000-00-00') {
         $assetMaintenance->completion_date = null;
     }
     if ($assetMaintenance->start_date == '0000-00-00') {
         $assetMaintenance->start_date = null;
     }
     if ($assetMaintenance->cost == '0.00') {
         $assetMaintenance->cost = null;
     }
     // Prepare Improvement Type List
     $assetMaintenanceType = ['' => 'Select an improvement type'] + AssetMaintenance::getImprovementOptions();
     $assets = Company::scopeCompanyables(Asset::with('model', 'assignedUser')->get(), 'assets.company_id')->lists('detailed_name', 'id');
     // Get Supplier List
     $supplier_list = Helper::suppliersList();
     // Render the view
     return View::make('asset_maintenances/edit')->with('asset_list', $assets)->with('selectedAsset', null)->with('supplier_list', $supplier_list)->with('assetMaintenanceType', $assetMaintenanceType)->with('assetMaintenance', $assetMaintenance);
 }
开发者ID:jbirdkerr,项目名称:snipe-it,代码行数:36,代码来源:AssetMaintenancesController.php

示例3: getClone

 public function getClone($licenseId = null)
 {
     // Check if the license exists
     if (is_null($license_to_clone = License::find($licenseId))) {
         // Redirect to the blogs management page
         return redirect()->to('admin/licenses')->with('error', trans('admin/licenses/message.does_not_exist'));
     } elseif (!Company::isCurrentUserHasAccess($license_to_clone)) {
         return redirect()->to('admin/licenses')->with('error', trans('general.insufficient_permissions'));
     }
     // Show the page
     $license_options = array('0' => 'Top Level') + License::pluck('name', 'id')->toArray();
     $maintained_list = array('' => 'Maintained', '1' => 'Yes', '0' => 'No');
     $company_list = Helper::companyList();
     //clone the orig
     $license = clone $license_to_clone;
     $license->id = null;
     $license->serial = null;
     // Show the page
     $depreciation_list = Helper::depreciationList();
     $supplier_list = Helper::suppliersList();
     return View::make('licenses/edit')->with('license_options', $license_options)->with('depreciation_list', $depreciation_list)->with('supplier_list', $supplier_list)->with('license', $license)->with('maintained_list', $maintained_list)->with('company_list', $company_list);
 }
开发者ID:jbirdkerr,项目名称:snipe-it,代码行数:22,代码来源:LicensesController.php


注:本文中的app\helpers\Helper::suppliersList方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。