Ejemplo n.º 1
0
 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;
     }
 }
Ejemplo n.º 2
0
 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);
     }
 }
Ejemplo n.º 3
0
 protected function atcAttach_Create()
 {
     $this->atcAttach = new QAttach($this, null, EntityQtype::Address, $this->objAddress->AddressId);
     QApplication::AuthorizeControl($this->objAddress, $this->atcAttach, 2);
 }
Ejemplo n.º 4
0
 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);
     }
 }
Ejemplo n.º 5
0
 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);
 }
Ejemplo n.º 6
0
 protected function atcAttach_Create()
 {
     $this->atcAttach = new QAttach($this, null, EntityQtype::AssetModel, $this->objAssetModel->AssetModelId);
     QApplication::AuthorizeControl($this->objAssetModel, $this->atcAttach, 2);
 }
Ejemplo n.º 7
0
 protected function atcAttach_Create()
 {
     $this->atcAttach = new QAttach($this, null, EntityQtype::Shipment, $this->objShipment->ShipmentId);
     QApplication::AuthorizeControl($this->objShipment, $this->atcAttach, 2);
 }
 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);
 }