本文整理汇总了PHP中QQN::AssetModel方法的典型用法代码示例。如果您正苦于以下问题:PHP QQN::AssetModel方法的具体用法?PHP QQN::AssetModel怎么用?PHP QQN::AssetModel使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QQN
的用法示例。
在下文中一共展示了QQN::AssetModel方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: Form_Create
protected function Form_Create()
{
$this->ctlHeaderMenu_Create();
$this->ctlShortcutMenu_Create();
$this->dtgAssetModel = new QDataGrid($this);
$this->dtgAssetModel->Name = 'asset_model_list';
$this->dtgAssetModel->CellPadding = 5;
$this->dtgAssetModel->CellSpacing = 0;
$this->dtgAssetModel->CssClass = "datagrid";
// Disable AJAX for the datagrid
$this->dtgAssetModel->UseAjax = false;
// Allow for column toggling
$this->dtgAssetModel->ShowColumnToggle = true;
// Allow for CSV Export
$this->dtgAssetModel->ShowExportCsv = true;
// Enable Pagination
$objPaginator = new QPaginator($this->dtgAssetModel);
$this->dtgAssetModel->Paginator = $objPaginator;
$this->dtgAssetModel->ItemsPerPage = QApplication::$TracmorSettings->SearchResultsPerPage;
$this->dtgAssetModel->AddColumn(new QDataGridColumnExt('ID', '<?= $_ITEM->AssetModelId ?>', array('OrderByClause' => QQ::OrderBy(QQN::AssetModel()->AssetModelId), 'ReverseOrderByClause' => QQ::OrderBy(QQN::AssetModel()->AssetModelId, false), 'CssClass' => "dtg_column", 'HtmlEntities' => false)));
$this->dtgAssetModel->AddColumn(new QDataGridColumnExt('<img src=../images/icons/attachment.gif border=0 title=Attachments alt=Attachments>', '<?= Attachment::toStringIcon($_ITEM->GetVirtualAttribute(\'attachment_count\')); ?>', 'SortByCommand="__attachment_count ASC"', 'ReverseSortByCommand="__attachment_count DESC"', 'CssClass="dtg_column"', 'HtmlEntities="false"'));
$this->dtgAssetModel->AddColumn(new QDataGridColumnExt('Assets', '<?= $_ITEM->__toStringWithAssetCountLink($_ITEM,"bluelink"); ?>', 'SortByCommand="asset_count ASC"', 'ReverseSortByCommand="asset_count DESC"', 'CssClass="dtg_column"', 'HtmlEntities=false'));
$this->dtgAssetModel->AddColumn(new QDataGridColumnExt('Name', '<?= $_ITEM->__toStringWithLink($_ITEM,"bluelink"); ?>', 'SortByCommand="short_description ASC"', 'ReverseSortByCommand="short_description DESC"', 'CssClass="dtg_column"', 'HtmlEntities="false"'));
$this->dtgAssetModel->AddColumn(new QDataGridColumnExt('Category', '<?= $_FORM->dtgAssetModel_Category_Render($_ITEM); ?>', 'SortByCommand="asset_model__category_id__short_description ASC"', 'ReverseSortByCommand="asset_model__category_id__short_description DESC"', 'CssClass="dtg_column"'));
$this->dtgAssetModel->AddColumn(new QDataGridColumnExt('Manufacturer', '<?= $_FORM->dtgAssetModel_Manufacturer_Render($_ITEM); ?>', 'SortByCommand="asset_model__manufacturer_id__short_description ASC"', 'ReverseSortByCommand="asset_model__manufacturer_id__short_description DESC"', 'CssClass="dtg_column"'));
$this->dtgAssetModel->AddColumn(new QDataGridColumnExt('Asset Model Code', '<?= htmlentities(QString::Truncate($_ITEM->AssetModelCode, 200)); ?>', 'FontBold=true', 'SortByCommand="asset_model_code ASC"', 'ReverseSortByCommand="asset_model_code DESC"', 'CssClass="dtg_column"'));
// Add the custom field columns with Display set to false. These can be shown by using the column toggle menu.
$objCustomFieldArray = CustomField::LoadObjCustomFieldArray(EntityQtype::AssetModel, false);
if ($objCustomFieldArray) {
foreach ($objCustomFieldArray as $objCustomField) {
//Only add the custom field column if the role has authorization to view it.
if ($objCustomField->objRoleAuthView && $objCustomField->objRoleAuthView->AuthorizedFlag) {
$this->dtgAssetModel->AddColumn(new QDataGridColumnExt($objCustomField->ShortDescription, '<?= $_ITEM->GetVirtualAttribute(\'' . $objCustomField->CustomFieldId . '\') ?>', 'SortByCommand="__' . $objCustomField->CustomFieldId . ' ASC"', 'ReverseSortByCommand="__' . $objCustomField->CustomFieldId . ' DESC"', 'HtmlEntities="false"', 'CssClass="dtg_column"', 'Display="false"'));
}
}
}
$this->dtgAssetModel->SortColumnIndex = 2;
$this->dtgAssetModel->SortDirection = 0;
$objStyle = $this->dtgAssetModel->RowStyle;
$objStyle->ForeColor = '#000000';
$objStyle->BackColor = '#FFFFFF';
$objStyle->FontSize = 12;
$objStyle = $this->dtgAssetModel->AlternateRowStyle;
$objStyle->BackColor = '#EFEFEF';
$objStyle = $this->dtgAssetModel->HeaderRowStyle;
$objStyle->ForeColor = '#000000';
$objStyle->BackColor = '#EFEFEF';
$objStyle->CssClass = 'dtg_header';
$this->dtgAssetModel->SetDataBinder('dtgAssetModel_Bind');
$this->lstCategory_Create();
$this->lstManufacturer_Create();
$this->txtDescription_Create();
$this->txtAssetModelCode_Create();
$this->btnSearch_Create();
$this->btnClear_Create();
$this->ctlAdvanced_Create();
$this->lblAdvanced_Create();
}
示例2: __construct
public function __construct($objParentObject, $strSetEditPanelMethod, $strCloseEditPanelMethod, $strControlId = null)
{
// Call the Parent
try {
parent::__construct($objParentObject, $strControlId);
} catch (QCallerException $objExc) {
$objExc->IncrementOffset();
throw $objExc;
}
// Record Method Callbacks
$this->strSetEditPanelMethod = $strSetEditPanelMethod;
$this->strCloseEditPanelMethod = $strCloseEditPanelMethod;
// Setup DataGrid Columns
$this->colEditLinkColumn = new QDataGridColumn(QApplication::Translate('Edit'), '<?= $_CONTROL->ParentControl->dtgAssetModel_EditLinkColumn_Render($_ITEM) ?>');
$this->colEditLinkColumn->HtmlEntities = false;
$this->colAssetModelId = new QDataGridColumn(QApplication::Translate('Asset Model Id'), '<?= $_ITEM->AssetModelId; ?>', array('OrderByClause' => QQ::OrderBy(QQN::AssetModel()->AssetModelId), 'ReverseOrderByClause' => QQ::OrderBy(QQN::AssetModel()->AssetModelId, false)));
$this->colCategoryId = new QDataGridColumn(QApplication::Translate('Category Id'), '<?= $_CONTROL->ParentControl->dtgAssetModel_Category_Render($_ITEM); ?>');
$this->colManufacturerId = new QDataGridColumn(QApplication::Translate('Manufacturer Id'), '<?= $_CONTROL->ParentControl->dtgAssetModel_Manufacturer_Render($_ITEM); ?>');
$this->colAssetModelCode = new QDataGridColumn(QApplication::Translate('Asset Model Code'), '<?= QString::Truncate($_ITEM->AssetModelCode, 200); ?>', array('OrderByClause' => QQ::OrderBy(QQN::AssetModel()->AssetModelCode), 'ReverseOrderByClause' => QQ::OrderBy(QQN::AssetModel()->AssetModelCode, false)));
$this->colShortDescription = new QDataGridColumn(QApplication::Translate('Short Description'), '<?= QString::Truncate($_ITEM->ShortDescription, 200); ?>', array('OrderByClause' => QQ::OrderBy(QQN::AssetModel()->ShortDescription), 'ReverseOrderByClause' => QQ::OrderBy(QQN::AssetModel()->ShortDescription, false)));
$this->colLongDescription = new QDataGridColumn(QApplication::Translate('Long Description'), '<?= QString::Truncate($_ITEM->LongDescription, 200); ?>', array('OrderByClause' => QQ::OrderBy(QQN::AssetModel()->LongDescription), 'ReverseOrderByClause' => QQ::OrderBy(QQN::AssetModel()->LongDescription, false)));
$this->colImagePath = new QDataGridColumn(QApplication::Translate('Image Path'), '<?= QString::Truncate($_ITEM->ImagePath, 200); ?>', array('OrderByClause' => QQ::OrderBy(QQN::AssetModel()->ImagePath), 'ReverseOrderByClause' => QQ::OrderBy(QQN::AssetModel()->ImagePath, false)));
$this->colCreatedBy = new QDataGridColumn(QApplication::Translate('Created By'), '<?= $_CONTROL->ParentControl->dtgAssetModel_CreatedByObject_Render($_ITEM); ?>');
$this->colCreationDate = new QDataGridColumn(QApplication::Translate('Creation Date'), '<?= $_CONTROL->ParentControl->dtgAssetModel_CreationDate_Render($_ITEM); ?>', array('OrderByClause' => QQ::OrderBy(QQN::AssetModel()->CreationDate), 'ReverseOrderByClause' => QQ::OrderBy(QQN::AssetModel()->CreationDate, false)));
$this->colModifiedBy = new QDataGridColumn(QApplication::Translate('Modified By'), '<?= $_CONTROL->ParentControl->dtgAssetModel_ModifiedByObject_Render($_ITEM); ?>');
$this->colModifiedDate = new QDataGridColumn(QApplication::Translate('Modified Date'), '<?= QString::Truncate($_ITEM->ModifiedDate, 200); ?>', array('OrderByClause' => QQ::OrderBy(QQN::AssetModel()->ModifiedDate), 'ReverseOrderByClause' => QQ::OrderBy(QQN::AssetModel()->ModifiedDate, false)));
// Setup DataGrid
$this->dtgAssetModel = new QDataGrid($this);
$this->dtgAssetModel->CellSpacing = 0;
$this->dtgAssetModel->CellPadding = 4;
$this->dtgAssetModel->BorderStyle = QBorderStyle::Solid;
$this->dtgAssetModel->BorderWidth = 1;
$this->dtgAssetModel->GridLines = QGridLines::Both;
// Datagrid Paginator
$this->dtgAssetModel->Paginator = new QPaginator($this->dtgAssetModel);
$this->dtgAssetModel->ItemsPerPage = 10;
// Specify Whether or Not to Refresh using Ajax
$this->dtgAssetModel->UseAjax = true;
// Specify the local databind method this datagrid will use
$this->dtgAssetModel->SetDataBinder('dtgAssetModel_Bind', $this);
$this->dtgAssetModel->AddColumn($this->colEditLinkColumn);
$this->dtgAssetModel->AddColumn($this->colAssetModelId);
$this->dtgAssetModel->AddColumn($this->colCategoryId);
$this->dtgAssetModel->AddColumn($this->colManufacturerId);
$this->dtgAssetModel->AddColumn($this->colAssetModelCode);
$this->dtgAssetModel->AddColumn($this->colShortDescription);
$this->dtgAssetModel->AddColumn($this->colLongDescription);
$this->dtgAssetModel->AddColumn($this->colImagePath);
$this->dtgAssetModel->AddColumn($this->colCreatedBy);
$this->dtgAssetModel->AddColumn($this->colCreationDate);
$this->dtgAssetModel->AddColumn($this->colModifiedBy);
$this->dtgAssetModel->AddColumn($this->colModifiedDate);
// Setup the Create New button
$this->btnCreateNew = new QButton($this);
$this->btnCreateNew->Text = QApplication::Translate('Create a New') . ' ' . QApplication::Translate('AssetModel');
$this->btnCreateNew->AddAction(new QClickEvent(), new QAjaxControlAction($this, 'btnCreateNew_Click'));
}
示例3: Form_Create
protected function Form_Create()
{
// Setup DataGrid Columns
$this->colEditLinkColumn = new QDataGridColumn(QApplication::Translate('Edit'), '<?= $_FORM->dtgAssetModel_EditLinkColumn_Render($_ITEM) ?>');
$this->colEditLinkColumn->HtmlEntities = false;
$this->colAssetModelId = new QDataGridColumn(QApplication::Translate('Asset Model Id'), '<?= $_ITEM->AssetModelId; ?>', array('OrderByClause' => QQ::OrderBy(QQN::AssetModel()->AssetModelId), 'ReverseOrderByClause' => QQ::OrderBy(QQN::AssetModel()->AssetModelId, false)));
$this->colCategoryId = new QDataGridColumn(QApplication::Translate('Category Id'), '<?= $_FORM->dtgAssetModel_Category_Render($_ITEM); ?>');
$this->colManufacturerId = new QDataGridColumn(QApplication::Translate('Manufacturer Id'), '<?= $_FORM->dtgAssetModel_Manufacturer_Render($_ITEM); ?>');
$this->colAssetModelCode = new QDataGridColumn(QApplication::Translate('Model Number'), '<?= QString::Truncate($_ITEM->AssetModelCode, 200); ?>', array('OrderByClause' => QQ::OrderBy(QQN::AssetModel()->AssetModelCode), 'ReverseOrderByClause' => QQ::OrderBy(QQN::AssetModel()->AssetModelCode, false)));
$this->colShortDescription = new QDataGridColumn(QApplication::Translate('Short Description'), '<?= QString::Truncate($_ITEM->ShortDescription, 200); ?>', array('OrderByClause' => QQ::OrderBy(QQN::AssetModel()->ShortDescription), 'ReverseOrderByClause' => QQ::OrderBy(QQN::AssetModel()->ShortDescription, false)));
$this->colLongDescription = new QDataGridColumn(QApplication::Translate('Long Description'), '<?= QString::Truncate($_ITEM->LongDescription, 200); ?>', array('OrderByClause' => QQ::OrderBy(QQN::AssetModel()->LongDescription), 'ReverseOrderByClause' => QQ::OrderBy(QQN::AssetModel()->LongDescription, false)));
$this->colImagePath = new QDataGridColumn(QApplication::Translate('Image Path'), '<?= QString::Truncate($_ITEM->ImagePath, 200); ?>', array('OrderByClause' => QQ::OrderBy(QQN::AssetModel()->ImagePath), 'ReverseOrderByClause' => QQ::OrderBy(QQN::AssetModel()->ImagePath, false)));
$this->colCreatedBy = new QDataGridColumn(QApplication::Translate('Created By'), '<?= $_FORM->dtgAssetModel_CreatedByObject_Render($_ITEM); ?>');
$this->colCreationDate = new QDataGridColumn(QApplication::Translate('Creation Date'), '<?= $_FORM->dtgAssetModel_CreationDate_Render($_ITEM); ?>', array('OrderByClause' => QQ::OrderBy(QQN::AssetModel()->CreationDate), 'ReverseOrderByClause' => QQ::OrderBy(QQN::AssetModel()->CreationDate, false)));
$this->colModifiedBy = new QDataGridColumn(QApplication::Translate('Modified By'), '<?= $_FORM->dtgAssetModel_ModifiedByObject_Render($_ITEM); ?>');
$this->colModifiedDate = new QDataGridColumn(QApplication::Translate('Modified Date'), '<?= QString::Truncate($_ITEM->ModifiedDate, 200); ?>', array('OrderByClause' => QQ::OrderBy(QQN::AssetModel()->ModifiedDate), 'ReverseOrderByClause' => QQ::OrderBy(QQN::AssetModel()->ModifiedDate, false)));
$this->colAssetModelCustomFieldHelper = new QDataGridColumn(QApplication::Translate('Asset Model Custom Field Helper'), '<?= $_FORM->dtgAssetModel_AssetModelCustomFieldHelper_Render($_ITEM); ?>');
// Setup DataGrid
$this->dtgAssetModel = new QDataGrid($this);
$this->dtgAssetModel->CellSpacing = 0;
$this->dtgAssetModel->CellPadding = 4;
$this->dtgAssetModel->BorderStyle = QBorderStyle::Solid;
$this->dtgAssetModel->BorderWidth = 1;
$this->dtgAssetModel->GridLines = QGridLines::Both;
// Datagrid Paginator
$this->dtgAssetModel->Paginator = new QPaginator($this->dtgAssetModel);
$this->dtgAssetModel->ItemsPerPage = 10;
// Specify Whether or Not to Refresh using Ajax
$this->dtgAssetModel->UseAjax = false;
// Specify the local databind method this datagrid will use
$this->dtgAssetModel->SetDataBinder('dtgAssetModel_Bind');
$this->dtgAssetModel->AddColumn($this->colEditLinkColumn);
$this->dtgAssetModel->AddColumn($this->colAssetModelId);
$this->dtgAssetModel->AddColumn($this->colCategoryId);
$this->dtgAssetModel->AddColumn($this->colManufacturerId);
$this->dtgAssetModel->AddColumn($this->colAssetModelCode);
$this->dtgAssetModel->AddColumn($this->colShortDescription);
$this->dtgAssetModel->AddColumn($this->colLongDescription);
$this->dtgAssetModel->AddColumn($this->colImagePath);
$this->dtgAssetModel->AddColumn($this->colCreatedBy);
$this->dtgAssetModel->AddColumn($this->colCreationDate);
$this->dtgAssetModel->AddColumn($this->colModifiedBy);
$this->dtgAssetModel->AddColumn($this->colModifiedDate);
$this->dtgAssetModel->AddColumn($this->colAssetModelCustomFieldHelper);
}
示例4: 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;
}
}
示例5: ResolveContentItem
/**
* Used internally by the Meta-based Add Column tools.
*
* Given a QQNode or a Text String, this will return a AssetModel-based QQNode.
* It will also verify that it is a proper AssetModel-based QQNode, and will throw an exception otherwise.
*
* @param mixed $mixContent
* @return QQNode
*/
protected function ResolveContentItem($mixContent)
{
if ($mixContent instanceof QQNode) {
if (!$mixContent->_ParentNode) {
throw new QCallerException('Content QQNode cannot be a Top Level Node');
}
if ($mixContent->_RootTableName == 'asset_model') {
if ($mixContent instanceof QQReverseReferenceNode && !$mixContent->_PropertyName) {
throw new QCallerException('Content QQNode cannot go through any "To Many" association nodes.');
}
$objCurrentNode = $mixContent;
while ($objCurrentNode = $objCurrentNode->_ParentNode) {
if (!$objCurrentNode instanceof QQNode) {
throw new QCallerException('Content QQNode cannot go through any "To Many" association nodes.');
}
if ($objCurrentNode instanceof QQReverseReferenceNode && !$objCurrentNode->_PropertyName) {
throw new QCallerException('Content QQNode cannot go through any "To Many" association nodes.');
}
}
return $mixContent;
} else {
throw new QCallerException('Content QQNode has a root table of "' . $mixContent->_RootTableName . '". Must be a root of "asset_model".');
}
} else {
if (is_string($mixContent)) {
switch ($mixContent) {
case 'AssetModelId':
return QQN::AssetModel()->AssetModelId;
case 'CategoryId':
return QQN::AssetModel()->CategoryId;
case 'Category':
return QQN::AssetModel()->Category;
case 'ManufacturerId':
return QQN::AssetModel()->ManufacturerId;
case 'Manufacturer':
return QQN::AssetModel()->Manufacturer;
case 'AssetModelCode':
return QQN::AssetModel()->AssetModelCode;
case 'ShortDescription':
return QQN::AssetModel()->ShortDescription;
case 'LongDescription':
return QQN::AssetModel()->LongDescription;
case 'ImagePath':
return QQN::AssetModel()->ImagePath;
case 'CreatedBy':
return QQN::AssetModel()->CreatedBy;
case 'CreatedByObject':
return QQN::AssetModel()->CreatedByObject;
case 'CreationDate':
return QQN::AssetModel()->CreationDate;
case 'ModifiedBy':
return QQN::AssetModel()->ModifiedBy;
case 'ModifiedByObject':
return QQN::AssetModel()->ModifiedByObject;
case 'ModifiedDate':
return QQN::AssetModel()->ModifiedDate;
case 'DepreciationClassId':
return QQN::AssetModel()->DepreciationClassId;
case 'DepreciationClass':
return QQN::AssetModel()->DepreciationClass;
case 'AssetModelCustomFieldHelper':
return QQN::AssetModel()->AssetModelCustomFieldHelper;
default:
throw new QCallerException('Simple Property not found in AssetModelDataGrid content: ' . $mixContent);
}
} else {
if ($mixContent instanceof QQAssociationNode) {
throw new QCallerException('Content QQNode cannot go through any "To Many" association nodes.');
} else {
throw new QCallerException('Invalid Content type');
}
}
}
}
示例6: 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();
}
示例7: __construct
public function __construct($objParentObject, $strControlId = null, $blnShowCheckboxes = false, $blnUseAjax = false, $blnRemoveAllLinks = false)
{
// First, call the parent to do most of the basic setup
try {
parent::__construct($objParentObject, $strControlId);
} catch (QCallerException $objExc) {
$objExc->IncrementOffset();
throw $objExc;
}
$this->objParentObject = $objParentObject;
$this->blnUseAjax = $blnUseAjax;
$this->blnRemoveAllLinks = $blnRemoveAllLinks;
$this->dtgAssetModel = new QDataGrid($this);
$this->dtgAssetModel->Name = 'asset_model_list';
$this->dtgAssetModel->CellPadding = 5;
$this->dtgAssetModel->CellSpacing = 0;
$this->dtgAssetModel->CssClass = "datagrid";
// Enable/Disable AJAX for the datagrid
$this->dtgAssetModel->UseAjax = $this->blnUseAjax;
$this->dtgAssetModel->ShowColumnToggle = true;
$this->dtgAssetModel->ShowExportCsv = true;
// Add a 'Select All' checkbox
$this->dtgAssetModel->ShowCheckboxes = false;
// Enable Pagination
$objPaginator = new QPaginator($this->dtgAssetModel);
$this->dtgAssetModel->Paginator = $objPaginator;
$this->dtgAssetModel->ItemsPerPage = QApplication::$TracmorSettings->SearchResultsPerPage;
// If the user wants the checkboxes column
if ($blnShowCheckboxes) {
// This will render all of the necessary controls and actions. chkSelected_Render expects a unique ID for each row of the database.
$this->dtgAssetModel->AddColumn(new QDataGridColumnExt('<?= $_CONTROL->chkSelectAll_Render() ?>', '<?=$_CONTROL->chkSelected_Render($_ITEM->AssetModelId) ?>', 'CssClass="dtg_column"', 'HtmlEntities=false'));
}
$this->dtgAssetModel->AddColumn(new QDataGridColumnExt('ID', '<?= $_ITEM->AssetModelId ?>', array('OrderByClause' => QQ::OrderBy(QQN::AssetModel()->AssetModelId), 'ReverseOrderByClause' => QQ::OrderBy(QQN::AssetModel()->AssetModelId, false), 'CssClass' => "dtg_column", 'HtmlEntities' => false)));
$this->dtgAssetModel->AddColumn(new QDataGridColumnExt('<img src=../images/icons/attachment.gif border=0 title=Attachments alt=Attachments>', '<?= Attachment::toStringIcon($_ITEM->GetVirtualAttribute(\'attachment_count\')); ?>', 'SortByCommand="__attachment_count ASC"', 'ReverseSortByCommand="__attachment_count DESC"', 'CssClass="dtg_column"', 'HtmlEntities="false"'));
// Removing any links in the column data
if ($this->blnRemoveAllLinks) {
$this->dtgAssetModel->AddColumn(new QDataGridColumnExt('Assets', '<?= $_ITEM->__toStringAssetCount(); ?>', 'SortByCommand="asset_count ASC"', 'ReverseSortByCommand="asset_count DESC"', 'CssClass="dtg_column"', 'HtmlEntities=false'));
$this->dtgAssetModel->AddColumn(new QDataGridColumnExt('NAME', '<?= $_ITEM->ShortDescription ?>', 'SortByCommand="short_description ASC"', 'ReverseSortByCommand="short_description DESC"', 'CssClass="dtg_column"', 'HtmlEntities="false"'));
} else {
$this->dtgAssetModel->AddColumn(new QDataGridColumnExt('Assets', '<?= $_ITEM->__toStringWithAssetCountLink($_ITEM,"bluelink"); ?>', 'SortByCommand="asset_count ASC"', 'ReverseSortByCommand="asset_count DESC"', 'CssClass="dtg_column"', 'HtmlEntities=false'));
$this->dtgAssetModel->AddColumn(new QDataGridColumnExt('NAME', '<?= $_ITEM->__toStringWithLink($_ITEM,"bluelink"); ?>', 'SortByCommand="short_description ASC"', 'ReverseSortByCommand="short_description DESC"', 'CssClass="dtg_column"', 'HtmlEntities="false"'));
}
$this->dtgAssetModel->AddColumn(new QDataGridColumnExt('Category', '<?= $_ITEM->Category->__toString(); ?>', 'SortByCommand="asset_model__category_id__short_description ASC"', 'ReverseSortByCommand="asset_model__category_id__short_description DESC"', 'CssClass="dtg_column"'));
$this->dtgAssetModel->AddColumn(new QDataGridColumnExt('Manufacturer', '<?= $_ITEM->Manufacturer->__toString(); ?>', 'SortByCommand="asset_model__manufacturer_id__short_description ASC"', 'ReverseSortByCommand="asset_model__manufacturer_id__short_description DESC"', 'CssClass="dtg_column"'));
$this->dtgAssetModel->AddColumn(new QDataGridColumnExt('Model Number', '<?= htmlentities(QString::Truncate($_ITEM->AssetModelCode, 200)); ?>', 'FontBold=true', 'SortByCommand="asset_model_code ASC"', 'ReverseSortByCommand="asset_model_code DESC"', 'CssClass="dtg_column"'));
// Add the custom field columns with Display set to false. These can be shown by using the column toggle menu.
$objCustomFieldArray = CustomField::LoadObjCustomFieldArray(EntityQtype::AssetModel, false);
if ($objCustomFieldArray) {
foreach ($objCustomFieldArray as $objCustomField) {
//Only add the custom field column if the role has authorization to view it.
if ($objCustomField->objRoleAuthView && $objCustomField->objRoleAuthView->AuthorizedFlag) {
$this->dtgAssetModel->AddColumn(new QDataGridColumnExt($objCustomField->ShortDescription, '<?= $_ITEM->GetVirtualAttribute(\'' . $objCustomField->CustomFieldId . '\') ?>', 'SortByCommand="__' . $objCustomField->CustomFieldId . ' ASC"', 'ReverseSortByCommand="__' . $objCustomField->CustomFieldId . ' DESC"', 'HtmlEntities="false"', 'CssClass="dtg_column"', 'Display="false"'));
}
}
}
$this->dtgAssetModel->SortColumnIndex = 2;
$this->dtgAssetModel->SortDirection = 0;
$objStyle = $this->dtgAssetModel->RowStyle;
$objStyle->ForeColor = '#000000';
$objStyle->BackColor = '#FFFFFF';
$objStyle->FontSize = 12;
$objStyle = $this->dtgAssetModel->AlternateRowStyle;
$objStyle->BackColor = '#EFEFEF';
$objStyle = $this->dtgAssetModel->HeaderRowStyle;
$objStyle->ForeColor = '#000000';
$objStyle->BackColor = '#EFEFEF';
$objStyle->CssClass = 'dtg_header';
$this->dtgAssetModel->SetDataBinder('dtgAssetModel_Bind', $this);
$this->lstCategory_Create();
$this->lstManufacturer_Create();
$this->txtDescription_Create();
$this->txtAssetModelCode_Create();
$this->btnSearch_Create();
$this->btnClear_Create();
$this->ctlAdvanced_Create();
$this->lblAdvanced_Create();
}
示例8: CountByModifiedBy
/**
* Count AssetModels
* by ModifiedBy Index(es)
* @param integer $intModifiedBy
* @return int
*/
public static function CountByModifiedBy($intModifiedBy)
{
// Call AssetModel::QueryCount to perform the CountByModifiedBy query
return AssetModel::QueryCount(QQ::Equal(QQN::AssetModel()->ModifiedBy, $intModifiedBy));
}
示例9: CountByDepreciationClassId
/**
* Count AssetModels
* by DepreciationClassId Index(es)
* @param integer $intDepreciationClassId
* @return int
*/
public static function CountByDepreciationClassId($intDepreciationClassId, $objOptionalClauses = null)
{
// Call AssetModel::QueryCount to perform the CountByDepreciationClassId query
return AssetModel::QueryCount(QQ::Equal(QQN::AssetModel()->DepreciationClassId, $intDepreciationClassId), $objOptionalClauses);
}