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


PHP AssetModel::LoadAllIntoArray方法代码示例

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


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

示例1: lstModel_Create

 protected function lstModel_Create()
 {
     $this->lstModel = new QListBox($this, 'Model');
     $this->lstModel->Name = 'Model';
     $this->lstModel->AddItem('- Select One -', null);
     $assetModelArray = AssetModel::LoadAllIntoArray();
     if ($assetModelArray) {
         foreach ($assetModelArray as $assetModel) {
             $objListItem = new QListItem($assetModel['short_description'], $assetModel['asset_model_id']);
             $this->lstModel->AddItem($objListItem);
         }
     }
     $this->lstModel->Enabled = false;
 }
开发者ID:proxymoron,项目名称:tracmor,代码行数:14,代码来源:AssetMassEditPanel.class.php

示例2: lstAssetModel_Create

 protected function lstAssetModel_Create()
 {
     $this->lstAssetModel = new QListBox($this);
     $this->lstAssetModel->Name = 'Asset Model';
     $this->lstAssetModel->Required = true;
     if (!$this->blnEditMode) {
         $this->lstAssetModel->AddItem('- Select One -', null);
     }
     $assetModelArray = AssetModel::LoadAllIntoArray();
     if ($assetModelArray) {
         foreach ($assetModelArray as $assetModel) {
             $objListItem = new QListItem($assetModel['short_description'], $assetModel['asset_model_id']);
             $this->lstAssetModel->AddItem($objListItem);
             if ($this->objAsset->AssetModelId && $this->objAsset->AssetModelId == $assetModel['asset_model_id']) {
                 $objListItem->Selected = true;
             }
         }
     }
     $this->lstAssetModel->AddAction(new QChangeEvent(), new QAjaxControlAction($this, 'lstAssetModel_Select'));
     QApplication::ExecuteJavaScript(sprintf("document.getElementById('%s').focus()", $this->lstAssetModel->ControlId));
     $this->lstAssetModel->TabIndex = 1;
     $this->intNextTabIndex++;
 }
开发者ID:brustj,项目名称:tracmor,代码行数:23,代码来源:QAssetEditComposite.class.php

示例3: btnNext_Click


//.........这里部分代码省略.........
                 $arrAssetCustomField = array();
                 // Setup keys
                 foreach ($this->arrTracmorField as $key => $value) {
                     if ($value == 'asset tag') {
                         $intAssetCodeKey = $key;
                     } elseif ($value == 'model') {
                         $intAssetModelDescriptionKey = $key;
                     } elseif ($value == 'location') {
                         $intLocationKey = $key;
                     } elseif ($value == 'parent asset') {
                         $intParentAssetKey = $key;
                     } elseif ($value == 'locked to parent') {
                         $intLinkedKey = $key;
                     } elseif (substr($value, 0, 6) == 'asset_') {
                         $intAssetCustomFieldKeyArray[substr($value, 6)] = $key;
                         if (array_key_exists(substr($value, 6), $this->arrAssetCustomField)) {
                             $arrAssetCustomField[substr($value, 6)] = $this->arrAssetCustomField[substr($value, 6)];
                         }
                     } elseif (QApplication::$TracmorSettings->DepreciationFlag == '1' && $value == "depreciate asset") {
                         $this->intDepreciationFlagKey = $key;
                     } elseif (QApplication::$TracmorSettings->DepreciationFlag == '1' && $value == "purchase cost") {
                         $this->intPurchaseCostKey = $key;
                     } elseif (QApplication::$TracmorSettings->DepreciationFlag == '1' && $value == "purchase date") {
                         $this->intPurchaseDateKey = $key;
                     }
                 }
                 $intAssetModelArray = array();
                 $strItemCFVArray = array();
                 $strUpdatedItemCFVArray = array();
                 $strUpdatedValuesArray = array();
                 $this->arrOldItemArray = array();
                 $this->objUpdatedItemArray = array();
                 // Load all asset models
                 foreach (AssetModel::LoadAllIntoArray() as $arrAssetModel) {
                     //$strAssetModelArray[] = strtolower(sprintf("%s_%s_%s_%s", addslashes($arrAssetModel['model_code']),  addslashes($arrAssetModel['short_description']),  $arrAssetModel['category_id'], $arrAssetModel['manufacturer_id']));
                     $intAssetModelArray[$arrAssetModel['asset_model_id']] = strtolower($arrAssetModel['short_description']);
                 }
                 $intLocationArray = array();
                 // Load all locations with keys=location_id
                 foreach (Location::LoadAll() as $objLocation) {
                     $intLocationArray[$objLocation->LocationId] = strtolower($objLocation->ShortDescription);
                 }
                 // Depreciation
                 /*if(QApplication::$TracmorSettings->DepreciationFlag == '1'){
                 			foreach (DepreciationClass::LoadAll() as $objDepreciationClass){
                 				$this->intDepreciationClassArray[$objDepreciationClass->DepreciationClassId] = strtolower($objDepreciationClass->ShortDescription);
                 			}
                 		}*/
                 $strAssetArray = array();
                 // Load all assets
                 // Loads array of AssetModelId
                 $arrAssetArray = Asset::LoadAllIntoArray();
                 $arrAssetId = array();
                 if (count($arrAssetArray)) {
                     foreach ($arrAssetArray as $arrAsset) {
                         $arrAssetId[$arrAsset['asset_id']] = addslashes(strtolower($arrAsset['asset_code']));
                         $strAssetArray[] = addslashes(strtolower($arrAsset['asset_code']));
                     }
                 }
             }
             for ($j = $this->intCurrentFile; $j < count($this->strFilePathArray); $j++) {
                 $this->FileCsvData->load($this->strFilePathArray[$j]);
                 if (!$j) {
                     //$this->FileCsvData->appendRow($this->FileCsvData->getHeaders());
                 }
                 if ($this->intImportStep == 2) {
开发者ID:proxymoron,项目名称:tracmor,代码行数:67,代码来源:asset_import.php

示例4: btnNext_Click


//.........这里部分代码省略.........
                         foreach ($this->arrTracmorField as $key => $value) {
                           if ($value == 'asset model short description') {
                             $intModelShortDescriptionKey = $key;
                           }
                           elseif ($value == 'asset model code') {
                             $intModelCodeKey = $key;
                           }
                           elseif ($value == 'asset code') {
                             $intAssetCode = $key;
                           }
                           elseif (substr($value, 0, 6) == 'asset_') {
                             $intAssetCustomFieldKeyArray[substr($value, 6)] = $key;
                             if (array_key_exists(substr($value, 6), $this->arrAssetCustomField)) {
                             	$arrAssetCustomField[substr($value, 6)] = $this->arrAssetCustomField[substr($value, 6)];
                             }
                           }
                         }
                         $intLocationArray = array();
                         // Load all locations with keys=location_id
                         foreach (Location::LoadAll() as $objLocation) {
                           //$intLocationArray["'" . strtolower($objLocation->ShortDescription) . "'"] = $objLocation->LocationId;
                           $intLocationArray[$objLocation->LocationId] = strtolower($objLocation->ShortDescription);
                         }
             
                         $strAssetArray = array();
                         $strUpdatedAssetArray = array();
                         // Load all assets
                         foreach (Asset::LoadAll() as $objAsset) {
                           $strAssetArray[] = strtolower($objAsset->AssetCode);
                         }
                         $this->btnNext->Warning = sprintf("Please wait... Asset import complete: %s%s", ceil(($this->intCurrentFile+1)*200/$this->intTotalCount*100), "%");
                       }*/
             // Loads array of AssetModelId
             $arrAssetModelArray = AssetModel::LoadAllIntoArray();
             $arrAssetModelId = array();
             if (count($arrAssetModelArray)) {
                 foreach ($arrAssetModelArray as $arrAssetModel) {
                     $arrAssetModelId[$arrAssetModel['asset_model_id']] = true;
                 }
             }
             for ($j = $this->intCurrentFile; $j < count($this->strFilePathArray); $j++) {
                 $this->FileCsvData->load($this->strFilePathArray[$j]);
                 if (!$j) {
                     //$this->FileCsvData->appendRow($this->FileCsvData->getHeaders());
                 }
                 if ($this->intImportStep == 2) {
                     $objNewAssetModelArray = array();
                     for ($i = 0; $i < $this->FileCsvData->countRows(); $i++) {
                         $strRowArray = $this->FileCsvData->getRow($i);
                         if (isset($strRowArray[$intModelShortDescriptionKey])) {
                             $strShortDescription = trim($strRowArray[$intModelShortDescriptionKey]) ? addslashes(trim($strRowArray[$intModelShortDescriptionKey])) : false;
                         } elseif (isset($this->txtMapDefaultValueArray[$intModelShortDescriptionKey])) {
                             $strShortDescription = $this->txtMapDefaultValueArray[$intModelShortDescriptionKey]->Text;
                         } else {
                             $strShortDescription = false;
                         }
                         //$strShortDescription = (trim($strRowArray[$intModelShortDescriptionKey])) ? trim($strRowArray[$intModelShortDescriptionKey]) : false;
                         $strAssetModelCode = trim($strRowArray[$intModelCodeKey]) ? addslashes(trim($strRowArray[$intModelCodeKey])) : addslashes(trim($this->txtMapDefaultValueArray[$intModelCodeKey]->Text));
                         //$strAssetModelCode = trim($strRowArray[$intModelCodeKey]) ? trim($strRowArray[$intModelCodeKey]) : trim($this->txtMapDefaultValueArray[$intModelCodeKey]->Text);
                         $strKeyArray = array_keys($intCategoryArray, isset($strRowArray[$this->intCategoryKey]) ? strtolower(trim($strRowArray[$this->intCategoryKey])) : array());
                         if (count($strKeyArray)) {
                             $intCategoryId = $strKeyArray[0];
                         } else {
                             $strKeyArray = array_keys($intCategoryArray, strtolower(trim($this->txtMapDefaultValueArray[$this->intCategoryKey]->Text)));
                             if (count($strKeyArray)) {
                                 $intCategoryId = $strKeyArray[0];
开发者ID:proxymoron,项目名称:tracmor,代码行数:67,代码来源:asset_model_import.php


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