本文整理汇总了PHP中QApplication::AuthorizeControl方法的典型用法代码示例。如果您正苦于以下问题:PHP QApplication::AuthorizeControl方法的具体用法?PHP QApplication::AuthorizeControl怎么用?PHP QApplication::AuthorizeControl使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QApplication
的用法示例。
在下文中一共展示了QApplication::AuthorizeControl方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
public function __construct($objParentObject, $strControlId = null, $intEntityQtypeId = null, $intEntityId = null)
{
parent::__construct($objParentObject, $strControlId);
$this->intAttachmentCount = Attachment::CountByEntityQtypeIdEntityId($intEntityQtypeId, $intEntityId);
if ($this->intAttachmentCount > 0) {
$this->strTemplate = __DOCROOT__ . __SUBDIRECTORY__ . '/common/QAttachments.tpl.php';
$this->lblAttachments_Create();
$this->pnlAttachments = new QPanel($this);
$this->pnlAttachments->strTemplate = __DOCROOT__ . __SUBDIRECTORY__ . '/common/attachments.tpl.php';
$this->pnlAttachments->Display = false;
$this->objAttachmentArray = Attachment::LoadArrayByEntityQtypeIdEntityId($intEntityQtypeId, $intEntityId);
$this->arrAttachments = array();
foreach ($this->objAttachmentArray as $key => $objAttachment) {
$strAttachment = sprintf('<strong><a href="' . __PHP_ASSETS__ . '/download.php?tmp_filename=%s&attachment_id=%s" target="_blank" style="color:blue;">%s</a></strong> (%s bytes) %s by %s ', $objAttachment->TmpFilename, $objAttachment->AttachmentId, $objAttachment->Filename, $objAttachment->Size, $objAttachment->CreationDate, $objAttachment->CreatedByObject->__toStringFullName());
$lblDelete = new QLabel($this->pnlAttachments);
$lblDelete->Text = 'Delete<br/>';
$lblDelete->ForeColor = '#555555';
$lblDelete->FontUnderline = true;
$lblDelete->SetCustomStyle('cursor', 'pointer');
$lblDelete->HtmlEntities = false;
$lblDelete->ActionParameter = $objAttachment->AttachmentId;
$lblDelete->AddAction(new QClickEvent(), new QConfirmAction('Are you sure you want to delete this attachment?'));
$lblDelete->AddAction(new QClickEvent(), new QServerControlAction($this, 'lblDelete_Click'));
QApplication::AuthorizeControl($objAttachment, $lblDelete, 3);
$this->arrAttachments[$key]['strAttachment'] = $strAttachment;
$this->arrAttachments[$key]['lblDelete'] = $lblDelete;
}
} else {
$this->Display = false;
}
}
示例2: lstLocationInventoryReceived_Render
public function lstLocationInventoryReceived_Render(InventoryTransaction $objInventoryTransaction)
{
if (!$objInventoryTransaction->blnReturnReceivedStatus()) {
$strControlId = 'lstLocationInventoryReceived' . $objInventoryTransaction->InventoryTransactionId;
$lstLocationInventoryReceived = $this->GetControl($strControlId);
if (!$lstLocationInventoryReceived) {
// Create the drop down list for this row in the datagrid
// Use ActionParameter to specify the Id of the AssetTransaction
$lstLocationInventoryReceived = new QListBox($this->dtgInventoryTransact, $strControlId);
$lstLocationInventoryReceived->Name = 'Location To Receive';
$lstLocationInventoryReceived->ActionParameter = $objInventoryTransaction->InventoryTransactionId;
$lstLocationInventoryReceived->AddItem('- Select One -', null);
$objLocationArray = Location::LoadAllLocations(false, false, 'short_description', null, null, false, false, false, true);
if ($objLocationArray) {
foreach ($objLocationArray as $objLocation) {
$lstLocationInventoryReceived->AddItem($objLocation->__toString(), $objLocation->LocationId);
}
}
$lstLocationInventoryReceived->AddAction(new QEnterKeyEvent(), new QAjaxAction('btnReceiveInventoryTransaction'));
$lstLocationInventoryReceived->AddAction(new QEnterKeyEvent(), new QTerminateAction());
}
QApplication::AuthorizeControl($this->objReceipt, $lstLocationInventoryReceived, 2);
return $lstLocationInventoryReceived->Render(false);
}
}
示例3: atcAttach_Create
protected function atcAttach_Create()
{
$this->atcAttach = new QAttach($this, null, EntityQtype::Address, $this->objAddress->AddressId);
QApplication::AuthorizeControl($this->objAddress, $this->atcAttach, 2);
}
示例4: btnReceive_Create
protected function btnReceive_Create()
{
$this->btnReceive = new QButton($this);
$this->btnReceive->Text = 'Receive';
$this->btnReceive->AddAction(new QClickEvent(), new QServerControlAction($this, 'btnReceive_Click'));
$this->btnReceive->AddAction(new QEnterKeyEvent(), new QServerControlAction($this, 'btnReceive_Click'));
$this->btnReceive->AddAction(new QEnterKeyEvent(), new QTerminateAction());
$this->btnReceive->CausesValidation = false;
// Asset must be Shipped or To Be Received to display the Receive Button
if ($this->objAsset->LocationId != 2 && $this->objAsset->LocationId != 5) {
$this->btnReceive->Display = false;
}
QApplication::AuthorizeControl($this->objAsset, $this->btnReceive, 2);
if ($this->btnReceive->Visible) {
// Check if they have the ability to create a new shipment
QApplication::AuthorizeControl(null, $this->btnReceive, 2, 6);
}
}
示例5: btnCreateContact_Create
protected function btnCreateContact_Create()
{
$this->btnCreateContact = new QButton($this);
$this->btnCreateContact->Text = QApplication::Translate('Create New Contact');
$this->btnCreateContact->AddAction(new QClickEvent(), new QServerAction('btnCreateContact_Click'));
$this->btnCreateContact->AddAction(new QEnterKeyEvent(), new QServerAction('btnCreateContact_Click'));
$this->btnCreateContact->AddAction(new QEnterKeyEvent(), new QTerminateAction());
$this->btnCreateContact->CausesValidation = false;
QApplication::AuthorizeControl($this->objCompany, $this->btnCreateContact, 2);
}
示例6: atcAttach_Create
protected function atcAttach_Create()
{
$this->atcAttach = new QAttach($this, null, EntityQtype::AssetModel, $this->objAssetModel->AssetModelId);
QApplication::AuthorizeControl($this->objAssetModel, $this->atcAttach, 2);
}
示例7: atcAttach_Create
protected function atcAttach_Create()
{
$this->atcAttach = new QAttach($this, null, EntityQtype::Shipment, $this->objShipment->ShipmentId);
QApplication::AuthorizeControl($this->objShipment, $this->atcAttach, 2);
}
示例8: btnReceive_Create
protected function btnReceive_Create()
{
$this->btnReceive = new QButton($this);
$this->btnReceive->Text = 'Receive';
$this->btnReceive->AddAction(new QClickEvent(), new QServerControlAction($this, 'btnReceive_Click'));
$this->btnReceive->AddAction(new QEnterKeyEvent(), new QServerControlAction($this, 'btnReceive_Click'));
$this->btnReceive->AddAction(new QEnterKeyEvent(), new QTerminateAction());
$this->btnReceive->CausesValidation = false;
QApplication::AuthorizeControl($this->objInventoryModel, $this->btnReceive, 2);
}