本文整理汇总了PHP中AssetModel类的典型用法代码示例。如果您正苦于以下问题:PHP AssetModel类的具体用法?PHP AssetModel怎么用?PHP AssetModel使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了AssetModel类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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;
}
示例2: SetupAssetModel
protected function SetupAssetModel()
{
// Lookup Object PK information from Query String (if applicable)
// Set mode to Edit or New depending on what's found
$intAssetModelId = QApplication::QueryString('intAssetModelId');
if ($intAssetModelId) {
$this->objAssetModel = AssetModel::Load($intAssetModelId);
if (!$this->objAssetModel) {
throw new Exception('Could not find a AssetModel object with PK arguments: ' . $intAssetModelId);
}
$this->strTitleVerb = QApplication::Translate('Edit');
$this->blnEditMode = true;
} else {
$this->objAssetModel = new AssetModel();
$this->strTitleVerb = QApplication::Translate('Create');
$this->blnEditMode = false;
}
}
示例3: 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;
}
}
示例4: 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);
}
示例5: renderMaster
/**
*
*/
public function renderMaster()
{
// Build the master view if necessary
if (in_array($this->_DeliveryType, array(DELIVERY_TYPE_ALL))) {
$this->MasterView = $this->masterView();
// Only get css & ui components if this is NOT a syndication request
if ($this->SyndicationMethod == SYNDICATION_NONE && is_object($this->Head)) {
$CssAnchors = AssetModel::getAnchors();
$this->EventArguments['CssFiles'] =& $this->_CssFiles;
$this->fireEvent('BeforeAddCss');
$ETag = AssetModel::eTag();
$CombineAssets = c('Garden.CombineAssets');
$ThemeType = isMobile() ? 'mobile' : 'desktop';
// And now search for/add all css files.
foreach ($this->_CssFiles as $CssInfo) {
$CssFile = $CssInfo['FileName'];
if (!array_key_exists('Options', $CssInfo) || !is_array($CssInfo['Options'])) {
$CssInfo['Options'] = array();
}
$Options =& $CssInfo['Options'];
// style.css and admin.css deserve some custom processing.
if (in_array($CssFile, $CssAnchors)) {
if (!$CombineAssets) {
// Grab all of the css files from the asset model.
$AssetModel = new AssetModel();
$CssFiles = $AssetModel->getCssFiles($ThemeType, ucfirst(substr($CssFile, 0, -4)), $ETag);
foreach ($CssFiles as $Info) {
$this->Head->addCss($Info[1], 'all', true, $CssInfo);
}
} else {
$Basename = substr($CssFile, 0, -4);
$this->Head->addCss(url("/asset/css/{$ThemeType}/{$Basename}-{$ETag}.css", '//'), 'all', false, $CssInfo['Options']);
}
continue;
}
$AppFolder = $CssInfo['AppFolder'];
$LookupFolder = !empty($AppFolder) ? $AppFolder : $this->ApplicationFolder;
$Search = AssetModel::CssPath($CssFile, $LookupFolder, $ThemeType);
if (!$Search) {
continue;
}
list($Path, $UrlPath) = $Search;
if (isUrl($Path)) {
$this->Head->AddCss($Path, 'all', val('AddVersion', $Options, true), $Options);
continue;
} else {
// Check to see if there is a CSS cacher.
$CssCacher = Gdn::factory('CssCacher');
if (!is_null($CssCacher)) {
$Path = $CssCacher->get($Path, $AppFolder);
}
if ($Path !== false) {
$Path = substr($Path, strlen(PATH_ROOT));
$Path = str_replace(DS, '/', $Path);
$this->Head->addCss($Path, 'all', true, $Options);
}
}
}
// Add a custom js file.
if (arrayHasValue($this->_CssFiles, 'style.css')) {
$this->addJsFile('custom.js');
// only to non-admin pages.
}
$Cdns = array();
if (!c('Garden.Cdns.Disable', false)) {
$Cdns = array('jquery.js' => "//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js");
}
// And now search for/add all JS files.
$this->EventArguments['Cdns'] =& $Cdns;
$this->fireEvent('AfterJsCdns');
$this->Head->addScript('', 'text/javascript', false, array('content' => $this->definitionList(false)));
foreach ($this->_JsFiles as $Index => $JsInfo) {
$JsFile = $JsInfo['FileName'];
if (!is_array($JsInfo['Options'])) {
$JsInfo['Options'] = array();
}
$Options =& $JsInfo['Options'];
if (isset($Cdns[$JsFile])) {
$JsFile = $Cdns[$JsFile];
}
$AppFolder = $JsInfo['AppFolder'];
$LookupFolder = !empty($AppFolder) ? $AppFolder : $this->ApplicationFolder;
$Search = AssetModel::JsPath($JsFile, $LookupFolder, $ThemeType);
if (!$Search) {
continue;
}
list($Path, $UrlPath) = $Search;
if ($Path !== false) {
$AddVersion = true;
if (!isUrl($Path)) {
$Path = substr($Path, strlen(PATH_ROOT));
$Path = str_replace(DS, '/', $Path);
$AddVersion = val('AddVersion', $Options, true);
}
$this->Head->addScript($Path, 'text/javascript', $AddVersion, $Options);
continue;
}
//.........这里部分代码省略.........
示例6: Css
/**
* Gather all of the global styles together.
* @param string ThemeType Either `desktop` or `mobile`.
* @param string $Filename The basename of the file to
* @since 2.1
*/
public function Css($ThemeType, $Filename)
{
$AssetModel = new AssetModel();
$AssetModel->ServeCss($ThemeType, $Filename);
}
示例7: assetModel_styleCss_handler
/**
* Add our CSS.
*
* @param AssetModel $sender
*/
public function assetModel_styleCss_handler($sender)
{
$sender->addCssFile('fileupload.css', 'plugins/FileUpload');
}
示例8: btnNext_Click
//.........这里部分代码省略.........
$this->txtMapDefaultValueArray[] = $txtDefaultValue;
$lstDefaultValue = new QListBox($this);
$lstDefaultValue->Width = 200;
$lstDefaultValue->Display = false;
$this->lstMapDefaultValueArray[] = $lstDefaultValue;
$dtpDate = new QDateTimePicker($this);
$dtpDate->DateTimePickerType = QDateTimePickerType::Date;
$dtpDate->DateTimePickerFormat = QDateTimePickerFormat::MonthDayYear;
$dtpDate->Display = false;
$this->dtpDateArray[] = $dtpDate;
if (array_key_exists($i, $this->lstMapHeaderArray)) {
$this->lstTramorField_Change(null, $this->lstMapHeaderArray[$i]->ControlId, null);
}
}
$this->arrMapFields[$i]['row1'] = $strFirstRowArray[$i];
}
$this->btnNext->Text = "Import Now";
fclose($file_skipped);
// Create Add Field button
$btnAddField = new QButton($this);
$btnAddField->Text = "Add Field";
$btnAddField->AddAction(new QClickEvent(), new QServerAction('btnAddField_Click'));
$btnAddField->AddAction(new QEnterKeyEvent(), new QServerAction('btnAddField_Click'));
$btnAddField->AddAction(new QEnterKeyEvent(), new QTerminateAction());
$this->lstMapHeaderArray[] = $btnAddField;
}
}
}
} elseif ($this->intStep == 2) {
// Step 2 complete
$blnError = false;
$blnAssetCode = false;
$blnLocation = false;
$blnAssetModelCode = false;
$blnAssetModelShortDescription = false;
$blnCategory = false;
$blnManufacturer = false;
// Checking errors (Location, Asset Code, Model Short Description, Model Code, Category and Manufacturer must be selected)
for ($i = 0; $i < count($this->lstMapHeaderArray) - 1; $i++) {
$lstMapHeader = $this->lstMapHeaderArray[$i];
$strSelectedValue = strtolower($lstMapHeader->SelectedValue);
if ($strSelectedValue == "location") {
$blnLocation = true;
} elseif ($strSelectedValue == "asset code") {
$blnAssetCode = true;
} elseif ($strSelectedValue == "asset model short description") {
$blnAssetModelShortDescription = true;
} elseif ($strSelectedValue == "asset model code") {
$blnAssetModelCode = true;
} elseif ($strSelectedValue == "category") {
$blnCategory = true;
} elseif ($strSelectedValue == "manufacturer") {
$blnManufacturer = true;
}
}
if ($this->lstMapDefaultValueArray) {
// Checking errors for required Default Value text fields
foreach ($this->lstMapDefaultValueArray as $lstDefault) {
if ($lstDefault->Display && $lstDefault->Required && !$lstDefault->SelectedValue) {
$lstDefault->Warning = "You must select one default value.";
$blnError = true;
break;
} else {
$blnError = false;
$lstDefault->Warning = "";
}
示例9: switch
`%s` AS `%s`
%s
WHERE
1=1
', $strTableName, $strTableName, $strTableName, $arrCustomFieldSql['strSelect'], $strTableName, $strTableName, $arrCustomFieldSql['strFrom']);
$objDatabase = QApplication::$Database[1];
$objDbResult = $objDatabase->Query($strQuery);
switch ($intEntityQtypeId) {
case 1:
$objArray = Asset::InstantiateDbResult($objDbResult);
break;
case 2:
$objArray = InventoryModel::InstantiateDbResult($objDbResult);
break;
case 4:
$objArray = AssetModel::InstantiateDbResult($objDbResult);
break;
case 5:
$objArray = Manufacturer::InstantiateDbResult($objDbResult);
break;
case 6:
$objArray = Category::InstantiateDbResult($objDbResult);
break;
case 7:
$objArray = Company::InstantiateDbResult($objDbResult);
break;
case 8:
$objArray = Contact::InstantiateDbResult($objDbResult);
break;
case 9:
$objArray = Address::InstantiateDbResult($objDbResult);
示例10: assetModel_adminCss_handler
/**
* Add the tag admin page CSS.
*
* @param AssetModel $sender
*/
public function assetModel_adminCss_handler($sender)
{
$sender->addCssFile('tagadmin.css', 'plugins/Tagging');
}
示例11: CountAssetModels
/**
* Counts all associated AssetModels
* @return int
*/
public function CountAssetModels()
{
if (is_null($this->intManufacturerId)) {
return 0;
}
return AssetModel::CountByManufacturerId($this->intManufacturerId);
}
示例12: btnAssetModelSearchToolAdd_Click
public function btnAssetModelSearchToolAdd_Click()
{
$this->ctlAssetModelSearchTool->lblWarning->Text = "";
$intSelectedAssetModelId = $this->ctlAssetModelSearchTool->ctlAssetModelSearch->dtgAssetModel->GetSelected("AssetModelId");
if (count($intSelectedAssetModelId) < 1) {
$this->ctlAssetModelSearchTool->lblWarning->Text = "No selected models.";
} else {
$lblNewWarning = "";
foreach (AssetModel::QueryArray(QQ::In(QQN::AssetModel()->AssetModelId, $intSelectedAssetModelId)) as $objNewAssetModel) {
$blnExists = false;
foreach ($this->arrAssetModels as $objAssetModel) {
if ($objAssetModel->AssetModelId == $objNewAssetModel->AssetModelId) {
$blnExists = true;
}
}
if ($blnExists) {
$lblNewWarning .= sprintf("<br />%s - already in list", $objNewAssetModel->AssetModelCode);
} else {
$objAssetModelToAdd = new AssetCustomFieldAssetModel();
$objAssetModelToAdd->AssetModelId = $objNewAssetModel->AssetModelId;
$objAssetModelToAdd->CustomFieldId = $this->objCustomField->CustomFieldId;
array_push($this->arrAssetModels, $objAssetModelToAdd);
}
}
$this->lstAddAssetModel->Warning = $lblNewWarning;
$this->ctlAssetModelSearchTool->dlgAssetModelSearchTool->HideDialogBox();
}
// Uncheck all items but SelectAll checkbox
$this->UncheckAllItems();
$this->dtgAssetModels->Refresh();
}
示例13: dtgAssetModel_Bind
protected function dtgAssetModel_Bind()
{
if ($this->blnSearch) {
$this->assignSearchValues();
}
$intCategoryId = $this->intCategoryId;
$intManufacturerId = $this->intManufacturerId;
$strDescription = $this->strDescription;
$strAssetModelCode = $this->strAssetModelCode;
$arrCustomFields = $this->arrCustomFields;
$strDateModifiedFirst = $this->strDateModifiedFirst;
$strDateModifiedLast = $this->strDateModifiedLast;
$strDateModified = $this->strDateModified;
$blnAttachment = $this->blnAttachment;
$objExpansionMap[AssetModel::ExpandCategory] = true;
$objExpansionMap[AssetModel::ExpandManufacturer] = true;
// If the search form has been posted
// if ($intCategoryId || $intManufacturerId || $strDescription || $strAssetModelCode) {
$this->dtgAssetModel->TotalItemCount = AssetModel::CountBySearch($intCategoryId, $intManufacturerId, $strDescription, $strAssetModelCode, $arrCustomFields, $strDateModified, $strDateModifiedFirst, $strDateModifiedLast, $blnAttachment, $objExpansionMap);
$this->dtgAssetModel->DataSource = AssetModel::LoadArrayBySearch($intCategoryId, $intManufacturerId, $strDescription, $strAssetModelCode, $arrCustomFields, $strDateModified, $strDateModifiedFirst, $strDateModifiedLast, $blnAttachment, $this->dtgAssetModel->SortInfo, $this->dtgAssetModel->LimitInfo, $objExpansionMap);
$this->blnSearch = false;
}
示例14: 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;
}
}
示例15: Css
/**
* Gather all of the global styles together.
* @param string $Filename
* @since 2.1
*/
public function Css($Basename, $Revision)
{
$AssetModel = new AssetModel();
$AssetModel->ServeCss($Basename, $Revision);
}