/** * Returns the HTML needed for the shipment asset transaction datagrid to show icons marking transactions with scheduled returns or exchanges * It will return an empty string if it does not meet any of the specifications above. * * @param QDatagrid Object $objControl * @return string */ public function ToStringHoverTips($objControl) { if ($this->blnScheduleReceiptFlag && $this->blnNewAssetFlag) { $lblExchangeImage = new QLabelExt($objControl); $lblExchangeImage->HtmlEntities = false; $lblExchangeImage->Text = sprintf('<img src="%s/icons/receipt_datagrid.png" style="vertical-align:middle;">', __IMAGE_ASSETS__); if ($this->NewAsset instanceof Asset && $this->NewAsset->AssetCode) { $strAssetCode = $this->NewAsset->AssetCode; } else { $strAssetCode = 'Auto Generated'; } $objHoverTip = new QHoverTip($lblExchangeImage); $objHoverTip->Text = sprintf('Exchange Scheduled: %s', $strAssetCode); $lblExchangeImage->HoverTip = $objHoverTip; $strToReturn = $lblExchangeImage->Render(false); } elseif ($this->blnScheduleReceiptFlag && !$this->blnNewAssetFlag) { $lblReturnImage = new QLabelExt($objControl); $lblReturnImage->HtmlEntities = false; $lblReturnImage->Text = sprintf('<img src="%s/icons/receipt_datagrid.png" style="vertical-align:middle;">', __IMAGE_ASSETS__); $objHoverTip = new QHoverTip($lblReturnImage); $objHoverTip->Text = 'Return Scheduled'; $lblReturnImage->HoverTip = $objHoverTip; $strToReturn = $lblReturnImage->Render(false); } else { $strToReturn = ''; } return $strToReturn; }
/** * Returns the HTML needed for a shipment datagrid to show asset and inventory icons, with hovertips. * * @param QDatagrid Object $objControl * @return string */ public function __toStringHoverTips($objControl) { // Create the Asset Image label, with corresponding assets hovertip if ($this->Transaction->EntityQtypeId == EntityQtype::AssetInventory || $this->Transaction->EntityQtypeId == EntityQtype::Asset) { $lblAssetImage = new QLabelExt($objControl); $lblAssetImage->HtmlEntities = false; $lblAssetImage->Text = sprintf('<img src="%s/icons/asset_datagrid.png" style="vertical-align:middle;">', __IMAGE_ASSETS__); // create $objHoverTip = new QHoverTip($lblAssetImage); $objHoverTip->Template = __DOCROOT__ . __SUBDIRECTORY__ . '/shipping/hovertip_assets.tpl.php'; $lblAssetImage->HoverTip = $objHoverTip; // Load the AssetTransaction Array on the form so that it can be used by the hovertip panel /*$objClauses = array(); if ($objClause = QQ::LimitInfo(11, 0)) array_push($objClauses, $objClause); if ($objClause = QQ::Expand(QQN::AssetTransaction()->Asset->AssetModel)) array_push($objClauses, $objClause); if ($objClause = QQ::Expand(QQN::AssetTransaction()->SourceLocation)); array_push($objClauses, $objClause); $objControl->Form->objAssetTransactionArray = AssetTransaction::LoadArrayByTransactionId($this->TransactionId, $objClauses); $objClauses = null;*/ $strQuery = sprintf("\n\t\t\t\t\tSELECT\n\t\t\t\t\t`asset_transaction__asset_id`.`asset_code` AS `asset_transaction__asset_id__asset_code`,\n\t\t\t\t\t`asset_transaction__asset_id__asset_model_id`.`short_description` AS `asset_transaction__asset_id__asset_model_id__short_description`,\n\t\t\t\t\t`asset_transaction__source_location_id`.`short_description` AS `asset_transaction__source_location_id__short_description`\n\t\t\t\t\tFROM\n\t\t\t\t\t\t`asset_transaction` AS `asset_transaction`\n\t\t\t\t\t\tLEFT JOIN `asset` AS `asset_transaction__asset_id` ON `asset_transaction`.`asset_id` = `asset_transaction__asset_id`.`asset_id`\n\t\t\t\t\t\tLEFT JOIN `asset_model` AS `asset_transaction__asset_id__asset_model_id` ON `asset_transaction__asset_id`.`asset_model_id` = `asset_transaction__asset_id__asset_model_id`.`asset_model_id`\n\t\t\t\t\t\tLEFT JOIN `location` AS `asset_transaction__source_location_id` ON `asset_transaction`.`source_location_id` = `asset_transaction__source_location_id`.`location_id`\n\t\t\t\t\tWHERE\n\t\t\t\t\t\t`asset_transaction`.`transaction_id` = %s\n\t\t\t\t\tLIMIT 11\n\t\t\t\t", $this->TransactionId); $objDatabase = QApplication::$Database[1]; // Perform the Query $objDbResult = $objDatabase->Query($strQuery); while ($mixRow = $objDbResult->FetchArray()) { $objControl->Form->objAssetTransactionArray[] = $mixRow; } } // Create the Inventory Image label with corresponding inventory hovertip if ($this->Transaction->EntityQtypeId == EntityQtype::AssetInventory || $this->Transaction->EntityQtypeId == EntityQtype::Inventory) { $lblInventoryImage = new QLabelExt($objControl); $lblInventoryImage->HtmlEntities = false; $lblInventoryImage->Text = sprintf('<img src="%s/icons/inventory_datagrid.png" style="vertical-align:middle;"', __IMAGE_ASSETS__); // Create the inventory hovertip $objHoverTip = new QHoverTip($lblInventoryImage); $objHoverTip->Template = __DOCROOT__ . __SUBDIRECTORY__ . '/shipping/hovertip_inventory.tpl.php'; $lblInventoryImage->HoverTip = $objHoverTip; // Load the InventoryTransaction Array on the form so that it can be used by the hovertip panel /*$objClauses = array(); if ($objClause = QQ::LimitInfo(11, 0)) array_push($objClauses, $objClause); if ($objClause = QQ::Expand(QQN::InventoryTransaction()->InventoryLocation->InventoryModel)); array_push($objClauses, $objClause); $objControl->Form->objInventoryTransactionArray = InventoryTransaction::LoadArrayByTransactionId($this->TransactionId, $objClauses); $objClauses = null;*/ $strQuery = sprintf("\n\t\t\t\tSELECT \n\t\t\t\t\t`inventory_transaction`.`quantity` AS `quantity`,\n\t\t\t\t\t`inventory_transaction__inventory_location_id__location_id`.`short_description` AS `inventory_transaction__inventory_location_id__location_id__short_description`,\n\t\t\t\t\t`inventory_transaction__inventory_location_id__inventory_model_id`.`inventory_model_code` AS `inventory_transaction__inventory_location_id__inventory_model_id__inventory_model_code`,\n\t\t\t\t\t`inventory_transaction__inventory_location_id__inventory_model_id`.`short_description` AS `inventory_transaction__inventory_location_id__inventory_model_id__short_description`\n\t\t\t\tFROM\n\t\t\t\t\t`inventory_transaction` AS `inventory_transaction`\n\t\t\t\t\tLEFT JOIN `inventory_location` AS `inventory_transaction__inventory_location_id` ON `inventory_transaction`.`inventory_location_id` = `inventory_transaction__inventory_location_id`.`inventory_location_id`\n\t\t\t\t\tLEFT JOIN `location` AS `inventory_transaction__inventory_location_id__location_id` ON `inventory_transaction`.`source_location_id` = `inventory_transaction__inventory_location_id__location_id`.`location_id`\n\t\t\t\t\tLEFT JOIN `inventory_model` AS `inventory_transaction__inventory_location_id__inventory_model_id` ON `inventory_transaction__inventory_location_id`.`inventory_model_id` = `inventory_transaction__inventory_location_id__inventory_model_id`.`inventory_model_id`\n\t\t\t\tWHERE\n\t\t\t\t\t`inventory_transaction`.`transaction_id` = %s\n\t\t\t\tLIMIT 11\n\t\t\t\t", $this->TransactionId); $objDatabase = QApplication::$Database[1]; // Perform the Query $objDbResult = $objDatabase->Query($strQuery); while ($mixRow = $objDbResult->FetchArray()) { $objControl->Form->objInventoryTransactionArray[] = $mixRow; } } // Display the appropriate images if ($this->Transaction->EntityQtypeId == EntityQtype::AssetInventory) { $strToReturn = $lblAssetImage->Render(false) . ' ' . $lblInventoryImage->Render(false); } elseif ($this->Transaction->EntityQtypeId == EntityQtype::Asset) { $strToReturn = $lblAssetImage->Render(false); } elseif ($this->Transaction->EntityQtypeId == EntityQtype::Inventory) { $strToReturn = $lblInventoryImage->Render(false); } return $strToReturn; }
/** * Returns the HTML needed for the asset list datagrid to show reserved and checked out by icons, with hovertips with the username. * If the asset is neither reserved nor checked out, it returns an empty string. * * @param QDatagrid Object $objControl * @return string */ public function ToStringHoverTips($objControl) { if ($this->blnReservedFlag) { $lblReservedImage = new QLabelExt($objControl); $lblReservedImage->HtmlEntities = false; $lblReservedImage->Text = sprintf('<img src="%s/icons/reserved_datagrid.png" style="vertical-align:middle;">', __IMAGE_ASSETS__); $objHoverTip = new QHoverTip($lblReservedImage); $objHoverTip->Text = 'Reserved by ' . $this->GetLastTransactionUser()->__toString(); $lblReservedImage->HoverTip = $objHoverTip; $strToReturn = $lblReservedImage->Render(false); } elseif ($this->blnCheckedOutFlag) { $lblCheckedOutImage = new QLabelExt($objControl); $lblCheckedOutImage->HtmlEntities = false; $lblCheckedOutImage->Text = sprintf('<img src="%s/icons/checked_out_datagrid.png" style="vertical-align:middle;">', __IMAGE_ASSETS__); $objHoverTip = new QHoverTip($lblCheckedOutImage); //$objHoverTip->Text = 'Checked Out by ' . $this->GetLastTransactionUser()->__toString(); $arrObjects = $this->GetLastTransactionCheckoutObjectArray(); $objAccount = $arrObjects['objAccount']; $objAssetTransactionCheckout = $arrObjects['objAssetTransactionCheckout']; $strReason = $arrObjects['strNote']; if (!$objAssetTransactionCheckout) { $objHoverTip->Text = 'Checked Out by ' . $objAccount->__toString(); } else { $objHoverTip->Text = 'Checked Out to '; if ($objAssetTransactionCheckout->ToContactId) { $objHoverTip->Text .= $objAssetTransactionCheckout->ToContact->__toString(); } else { $objHoverTip->Text .= $objAssetTransactionCheckout->ToUser->__toString(); } $objHoverTip->Text .= ' by ' . $objAccount->__toString(); if (QApplication::$TracmorSettings->ReasonRequired == "1" || $strReason) { $objHoverTip->Text .= "<br />Reason: " . $strReason; } if (QApplication::$TracmorSettings->DueDateRequired == "1" || $objAssetTransactionCheckout->DueDate) { $objHoverTip->Text .= sprintf("<br />Due Date: %s", $objAssetTransactionCheckout->DueDate ? $objAssetTransactionCheckout->DueDate->format('m/d/Y g:i A') : ""); } } $lblCheckedOutImage->HoverTip = $objHoverTip; $strToReturn = $lblCheckedOutImage->Render(false); } elseif ($this->blnArchivedFlag) { $lblArchivedImage = new QLabelExt($objControl); $lblArchivedImage->HtmlEntities = false; $lblArchivedImage->Text = sprintf('<img src="%s/icons/archived_datagrid.png" style="vertical-align:middle;">', __IMAGE_ASSETS__); $objHoverTip = new QHoverTip($lblArchivedImage); $objHoverTip->Text = 'Archived by ' . $this->GetLastTransactionUser()->__toString(); $lblArchivedImage->HoverTip = $objHoverTip; $strToReturn = $lblArchivedImage->Render(false); } elseif ($objPendingShipment = AssetTransaction::PendingShipment($this->AssetId)) { $lblShipmentImage = new QLabelExt($objControl); $lblShipmentImage->HtmlEntities = false; $lblShipmentImage->Text = sprintf('<img src="%s/icons/shipment_datagrid.png" style="Vertical-align:middle;">', __IMAGE_ASSETS__); $objHoverTip = new QHoverTip($lblShipmentImage); $objHoverTip->Text = 'Scheduled for Shipment by ' . $this->GetLastTransactionUser()->__toString(); $lblShipmentImage->HoverTip = $objHoverTip; $strToReturn = $lblShipmentImage->Render(false); } elseif ($objPendingReceipt = AssetTransaction::PendingReceipt($this->AssetId)) { $lblReceiptImage = new QLabelExt($objControl); $lblReceiptImage->HtmlEntities = false; $lblReceiptImage->Text = sprintf('<img src="%s/icons/receipt_datagrid.png" style="Vertical-align:middle;">', __IMAGE_ASSETS__); $objHoverTip = new QHoverTip($lblReceiptImage); $objHoverTip->Text = 'Scheduled for Receipt by ' . $this->GetLastTransactionUser()->__toString(); $lblReceiptImage->HoverTip = $objHoverTip; $strToReturn = $lblReceiptImage->Render(false); } else { $strToReturn = ''; } return $strToReturn; }
/** * Returns the HTML needed for a receipt datagrid to show asset and inventory icons, with hovertips. * * @param QDatagrid Object $objControl * @return string */ public function __toStringHoverTips($objControl) { // Create the Asset Image label, with corresponding assets hovertip if ($this->Transaction->EntityQtypeId == EntityQtype::AssetInventory || $this->Transaction->EntityQtypeId == EntityQtype::Asset) { $lblAssetImage = new QLabelExt($objControl); $lblAssetImage->HtmlEntities = false; $lblAssetImage->Text = sprintf('<img src="%s/icons/asset_datagrid.png" style="vertical-align:middle;">', __IMAGE_ASSETS__); // create $objHoverTip = new QHoverTip($lblAssetImage); $objHoverTip->Template = __DOCROOT__ . __SUBDIRECTORY__ . '/receiving/hovertip_assets.tpl.php'; $lblAssetImage->HoverTip = $objHoverTip; // Load the AssetTransaction Array on the form so that it can be used by the hovertip panel $objClauses = array(); if ($objClause = QQ::LimitInfo(11, 0)) { array_push($objClauses, $objClause); } if ($objClause = QQ::Expand(QQN::AssetTransaction()->Asset->AssetModel)) { array_push($objClauses, $objClause); } if ($objClause = QQ::Expand(QQN::AssetTransaction()->SourceLocation)) { } array_push($objClauses, $objClause); $objControl->Form->objAssetTransactionArray = AssetTransaction::LoadArrayByTransactionId($this->TransactionId, $objClauses); $objClauses = null; } // Create the Inventory Image label with corresponding inventory hovertip if ($this->Transaction->EntityQtypeId == EntityQtype::AssetInventory || $this->Transaction->EntityQtypeId == EntityQtype::Inventory) { $lblInventoryImage = new QLabelExt($objControl); $lblInventoryImage->HtmlEntities = false; $lblInventoryImage->Text = sprintf('<img src="%s/icons/inventory_datagrid.png" style="vertical-align:middle;"', __IMAGE_ASSETS__); // Create the inventory hovertip $objHoverTip = new QHoverTip($lblInventoryImage); $objHoverTip->Template = __DOCROOT__ . __SUBDIRECTORY__ . '/receiving/hovertip_inventory.tpl.php'; $lblInventoryImage->HoverTip = $objHoverTip; // Load the InventoryTransaction Array on the form so that it can be used by the hovertip panel $objClauses = array(); if ($objClause = QQ::LimitInfo(11, 0)) { array_push($objClauses, $objClause); } if ($objClause = QQ::Expand(QQN::InventoryTransaction()->InventoryLocation->InventoryModel)) { } array_push($objClauses, $objClause); $objControl->Form->objInventoryTransactionArray = InventoryTransaction::LoadArrayByTransactionId($this->TransactionId, $objClauses); $objClauses = null; } // Display the appropriate images if ($this->Transaction->EntityQtypeId == EntityQtype::AssetInventory) { $strToReturn = $lblAssetImage->Render(false) . ' ' . $lblInventoryImage->Render(false); } elseif ($this->Transaction->EntityQtypeId == EntityQtype::Asset) { $strToReturn = $lblAssetImage->Render(false); } elseif ($this->Transaction->EntityQtypeId == EntityQtype::Inventory) { $strToReturn = $lblInventoryImage->Render(false); } return $strToReturn; }