本文整理汇总了PHP中AssetModel::LoadAll方法的典型用法代码示例。如果您正苦于以下问题:PHP AssetModel::LoadAll方法的具体用法?PHP AssetModel::LoadAll怎么用?PHP AssetModel::LoadAll使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AssetModel
的用法示例。
在下文中一共展示了AssetModel::LoadAll方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: rblAssetType_Change
protected function rblAssetType_Change($strFormId, $strControlId, $strParameter)
{
$this->txtNewAssetCode->Text = '';
// If adding an existing asset to the receipt
if ($this->rblAssetType->SelectedValue == 'existing') {
$this->lstAssetModel->Display = false;
$this->chkAutoGenerateAssetCode->Checked = false;
$this->chkAutoGenerateAssetCode->Display = false;
$this->txtNewAssetCode->Enabled = true;
$this->lblAddAsset->Display = true;
} elseif ($this->rblAssetType->SelectedValue == 'new') {
$objAssetModelArray = AssetModel::LoadAll(QQ::Clause(QQ::OrderBy(QQN::AssetModel()->ShortDescription)));
if ($objAssetModelArray) {
foreach ($objAssetModelArray as $objAssetModel) {
$objListItem = new QListItem($objAssetModel->__toString(), $objAssetModel->AssetModelId);
$this->lstAssetModel->AddItem($objListItem);
}
}
// Display the list of possible asset models
$this->lstAssetModel->Display = true;
// Display the Auto Generate Asset Code checkbox if a minimum value exists
if (QApplication::$TracmorSettings->MinAssetCode) {
$this->chkAutoGenerateAssetCode->Display = true;
}
$this->lblAddAsset->Display = false;
}
}
示例2: btnNext_Click
//.........这里部分代码省略.........
if ($txtDefault->Display && $txtDefault->Required && !$txtDefault->Text) {
$txtDefault->Warning = "You must enter default value.";
break;
} else {
$blnError = false;
$txtDefault->Warning = "";
}
}
}
// If all required fields have no errors
if (!$blnError && $blnAssetCode && $blnAssetModelCode && $blnAssetModelShortDescription && $blnLocation && $blnCategory && $blnManufacturer) {
$this->btnNext->Warning = "";
// Setup keys for main required fields
foreach ($this->arrTracmorField as $key => $value) {
if ($value == 'location') {
$this->intLocationKey = $key;
} elseif ($value == 'category') {
$this->intCategoryKey = $key;
} elseif ($value == 'manufacturer') {
$this->intManufacturerKey = $key;
} elseif ($value == 'created by') {
$this->intCreatedByKey = $key;
} elseif ($value == 'created date') {
$this->intCreatedDateKey = $key;
} elseif ($value == 'modified by') {
$this->intModifiedByKey = $key;
} elseif ($value == 'modified date') {
$this->intModifiedDateKey = $key;
}
}
$strLocationArray = array();
$strNewLocationArray = array();
// Load all locations
foreach (Location::LoadAll() as $objLocation) {
$strLocationArray[] = stripslashes($objLocation->ShortDescription);
}
$txtDefaultValue = trim($this->txtMapDefaultValueArray[$this->intLocationKey]->Text);
// Add default value in database if it is not exist
if ($txtDefaultValue && !$this->in_array_nocase($txtDefaultValue, $strLocationArray)) {
$strLocationArray[] = $txtDefaultValue;
$objNewLocation = new Location();
$objNewLocation->ShortDescription = addslashes($txtDefaultValue);
$objNewLocation->EnabledFlag = 1;
$objNewLocation->Save();
$this->objNewLocationArray[$objNewLocation->LocationId] = $objNewLocation->ShortDescription;
}
$this->objNewLocationArray = array();
$this->objNewCategoryArray = array();
$this->objNewManufacturerArray = array();
$this->objNewAssetModelArray = array();
$this->strModelValuesArray = array();
$this->blnImportEnd = false;
$j = 1;
$strLocationValuesArray = array();
// Add all unique locations in database
foreach ($this->strFilePathArray as $strFilePath) {
$this->FileCsvData->load($strFilePath);
if ($j != 1) {
//$this->FileCsvData->appendRow($this->FileCsvData->getHeaders());
}
// Location Import
for ($i = 0; $i < $this->FileCsvData->countRows(); $i++) {
$strRowArray = $this->FileCsvData->getRow($i);
if (trim($strRowArray[$this->intLocationKey]) && !$this->in_array_nocase(trim($strRowArray[$this->intLocationKey]), $strLocationArray)) {
$strLocationArray[] = trim($strRowArray[$this->intLocationKey]);
/*$objNewLocation = new Location();
示例3: dtgAssetModel_Bind
protected function dtgAssetModel_Bind()
{
// Because we want to enable pagination AND sorting, we need to setup the $objClauses array to send to LoadAll()
// Remember! We need to first set the TotalItemCount, which will affect the calcuation of LimitClause below
$this->dtgAssetModel->TotalItemCount = AssetModel::CountAll();
// Setup the $objClauses Array
$objClauses = array();
// If a column is selected to be sorted, and if that column has a OrderByClause set on it, then let's add
// the OrderByClause to the $objClauses array
if ($objClause = $this->dtgAssetModel->OrderByClause) {
array_push($objClauses, $objClause);
}
// Add the LimitClause information, as well
if ($objClause = $this->dtgAssetModel->LimitClause) {
array_push($objClauses, $objClause);
}
// Set the DataSource to be the array of all AssetModel objects, given the clauses above
$this->dtgAssetModel->DataSource = AssetModel::LoadAll($objClauses);
}
示例4: lstAssetModel_Create
protected function lstAssetModel_Create()
{
$this->lstAssetModel = new QListBox($this);
$this->lstAssetModel->Name = QApplication::Translate('Asset Model');
$this->lstAssetModel->Required = true;
if (!$this->blnEditMode) {
$this->lstAssetModel->AddItem(QApplication::Translate('- Select One -'), null);
}
$objAssetModelArray = AssetModel::LoadAll();
if ($objAssetModelArray) {
foreach ($objAssetModelArray as $objAssetModel) {
$objListItem = new QListItem($objAssetModel->__toString(), $objAssetModel->AssetModelId);
if ($this->objAsset->AssetModel && $this->objAsset->AssetModel->AssetModelId == $objAssetModel->AssetModelId) {
$objListItem->Selected = true;
}
$this->lstAssetModel->AddItem($objListItem);
}
}
}
示例5: lstAddAssetModel_Create
protected function lstAddAssetModel_Create()
{
$this->lstAddAssetModel = new QListBox($this);
$this->lstAddAssetModel->Name = QApplication::Translate('Add Model');
$this->lstAddAssetModel->CausesValidation = false;
$arrAssetModels = AssetModel::LoadAll();
$this->lstAddAssetModel->AddItem(new QListItem('-Select One-', null));
foreach ($arrAssetModels as $objAssetModel) {
$this->lstAddAssetModel->AddItem(new QListItem(sprintf('%s - %s', $objAssetModel->AssetModelCode, $objAssetModel->ShortDescription), $objAssetModel->AssetModelId));
}
if (!$this->blnAssetEntityType || $this->rblAllAssetModels->SelectedValue == 1) {
$this->lstAddAssetModel->Visible = false;
}
}
示例6: Refresh
/**
* Refresh this MetaControl with Data from the local AssetModelCustomFieldHelper object.
* @param boolean $blnReload reload AssetModelCustomFieldHelper from the database
* @return void
*/
public function Refresh($blnReload = false)
{
if ($blnReload) {
$this->objAssetModelCustomFieldHelper->Reload();
}
if ($this->lstAssetModel) {
$this->lstAssetModel->RemoveAllItems();
if (!$this->blnEditMode) {
$this->lstAssetModel->AddItem(QApplication::Translate('- Select One -'), null);
}
$objAssetModelArray = AssetModel::LoadAll();
if ($objAssetModelArray) {
foreach ($objAssetModelArray as $objAssetModel) {
$objListItem = new QListItem($objAssetModel->__toString(), $objAssetModel->AssetModelId);
if ($this->objAssetModelCustomFieldHelper->AssetModel && $this->objAssetModelCustomFieldHelper->AssetModel->AssetModelId == $objAssetModel->AssetModelId) {
$objListItem->Selected = true;
}
$this->lstAssetModel->AddItem($objListItem);
}
}
}
if ($this->lblAssetModelId) {
$this->lblAssetModelId->Text = $this->objAssetModelCustomFieldHelper->AssetModel ? $this->objAssetModelCustomFieldHelper->AssetModel->__toString() : null;
}
}
示例7: Refresh
/**
* Refresh this MetaControl with Data from the local Asset object.
* @param boolean $blnReload reload Asset from the database
* @return void
*/
public function Refresh($blnReload = false)
{
if ($blnReload) {
$this->objAsset->Reload();
}
if ($this->lblAssetId) {
if ($this->blnEditMode) {
$this->lblAssetId->Text = $this->objAsset->AssetId;
}
}
if ($this->lstParentAsset) {
$this->lstParentAsset->RemoveAllItems();
$this->lstParentAsset->AddItem(QApplication::Translate('- Select One -'), null);
$objParentAssetArray = Asset::LoadAll();
if ($objParentAssetArray) {
foreach ($objParentAssetArray as $objParentAsset) {
$objListItem = new QListItem($objParentAsset->__toString(), $objParentAsset->AssetId);
if ($this->objAsset->ParentAsset && $this->objAsset->ParentAsset->AssetId == $objParentAsset->AssetId) {
$objListItem->Selected = true;
}
$this->lstParentAsset->AddItem($objListItem);
}
}
}
if ($this->lblParentAssetId) {
$this->lblParentAssetId->Text = $this->objAsset->ParentAsset ? $this->objAsset->ParentAsset->__toString() : null;
}
if ($this->lstAssetModel) {
$this->lstAssetModel->RemoveAllItems();
if (!$this->blnEditMode) {
$this->lstAssetModel->AddItem(QApplication::Translate('- Select One -'), null);
}
$objAssetModelArray = AssetModel::LoadAll();
if ($objAssetModelArray) {
foreach ($objAssetModelArray as $objAssetModel) {
$objListItem = new QListItem($objAssetModel->__toString(), $objAssetModel->AssetModelId);
if ($this->objAsset->AssetModel && $this->objAsset->AssetModel->AssetModelId == $objAssetModel->AssetModelId) {
$objListItem->Selected = true;
}
$this->lstAssetModel->AddItem($objListItem);
}
}
}
if ($this->lblAssetModelId) {
$this->lblAssetModelId->Text = $this->objAsset->AssetModel ? $this->objAsset->AssetModel->__toString() : null;
}
if ($this->lstLocation) {
$this->lstLocation->RemoveAllItems();
$this->lstLocation->AddItem(QApplication::Translate('- Select One -'), null);
$objLocationArray = Location::LoadAll();
if ($objLocationArray) {
foreach ($objLocationArray as $objLocation) {
$objListItem = new QListItem($objLocation->__toString(), $objLocation->LocationId);
if ($this->objAsset->Location && $this->objAsset->Location->LocationId == $objLocation->LocationId) {
$objListItem->Selected = true;
}
$this->lstLocation->AddItem($objListItem);
}
}
}
if ($this->lblLocationId) {
$this->lblLocationId->Text = $this->objAsset->Location ? $this->objAsset->Location->__toString() : null;
}
if ($this->txtAssetCode) {
$this->txtAssetCode->Text = $this->objAsset->AssetCode;
}
if ($this->lblAssetCode) {
$this->lblAssetCode->Text = $this->objAsset->AssetCode;
}
if ($this->txtImagePath) {
$this->txtImagePath->Text = $this->objAsset->ImagePath;
}
if ($this->lblImagePath) {
$this->lblImagePath->Text = $this->objAsset->ImagePath;
}
if ($this->chkCheckedOutFlag) {
$this->chkCheckedOutFlag->Checked = $this->objAsset->CheckedOutFlag;
}
if ($this->lblCheckedOutFlag) {
$this->lblCheckedOutFlag->Text = $this->objAsset->CheckedOutFlag ? QApplication::Translate('Yes') : QApplication::Translate('No');
}
if ($this->chkReservedFlag) {
$this->chkReservedFlag->Checked = $this->objAsset->ReservedFlag;
}
if ($this->lblReservedFlag) {
$this->lblReservedFlag->Text = $this->objAsset->ReservedFlag ? QApplication::Translate('Yes') : QApplication::Translate('No');
}
if ($this->chkLinkedFlag) {
$this->chkLinkedFlag->Checked = $this->objAsset->LinkedFlag;
}
if ($this->lblLinkedFlag) {
$this->lblLinkedFlag->Text = $this->objAsset->LinkedFlag ? QApplication::Translate('Yes') : QApplication::Translate('No');
}
if ($this->chkArchivedFlag) {
$this->chkArchivedFlag->Checked = $this->objAsset->ArchivedFlag;
//.........这里部分代码省略.........
示例8: dtgAssetModel_Bind
public function dtgAssetModel_Bind()
{
// Get Total Count b/c of Pagination
$this->dtgAssetModel->TotalItemCount = AssetModel::CountAll();
$objClauses = array();
if ($objClause = $this->dtgAssetModel->OrderByClause) {
array_push($objClauses, $objClause);
}
if ($objClause = $this->dtgAssetModel->LimitClause) {
array_push($objClauses, $objClause);
}
$this->dtgAssetModel->DataSource = AssetModel::LoadAll($objClauses);
}