void dspUsageStatistics::sPopulateMenu(QMenu *pMenu, QTreeWidgetItem *, int pColumn)
{
  QAction *menuItem;

  menuItem = pMenu->addAction("View All Transactions...", this, SLOT(sViewAll()));
  if (!_privileges->check("ViewInventoryHistory"))
    menuItem->setEnabled(false);

  switch (pColumn)
  {
    case 3:
      menuItem = pMenu->addAction("View Receipt Transactions...", this, SLOT(sViewReceipt()));
      if (!_privileges->check("ViewInventoryHistory"))
        menuItem->setEnabled(false);
      break;

    case 4:
      menuItem = pMenu->addAction("View Issue Transactions...", this, SLOT(sViewIssue()));
      if (!_privileges->check("ViewInventoryHistory"))
        menuItem->setEnabled(false);
      break;

    case 5:
      menuItem = pMenu->addAction("View Sold Transactions...", this, SLOT(sViewSold()));
      if (!_privileges->check("ViewInventoryHistory"))
        menuItem->setEnabled(false);
      break;

    case 6:
      menuItem = pMenu->addAction("View Scrap Transactions...", this, SLOT(sViewScrap()));
      if (!_privileges->check("ViewInventoryHistory"))
        menuItem->setEnabled(false);
      break;

    case 7:
      menuItem = pMenu->addAction("View Adjustment Transactions...", this, SLOT(sViewAdjustment()));
      if (!_privileges->check("ViewInventoryHistory"))
        menuItem->setEnabled(false);
      break;

    case 8:
      menuItem = pMenu->addAction("View Transfer Transactions...", this, SLOT(sViewTransfer()));
      if (!_privileges->check("ViewInventoryHistory"))
        menuItem->setEnabled(false);
      break;
  }
}
예제 #2
0
void dspUsageStatisticsByClassCode::sPopulateMenu(QMenu *pMenu, QTreeWidgetItem *, int pColumn)
{
  int menuItem;

  menuItem = pMenu->insertItem("View All Transactions...", this, SLOT(sViewAll()), 0);
  if (!_privileges->check("ViewInventoryHistory"))
    pMenu->setItemEnabled(menuItem, FALSE);

  switch (pColumn)
  {
    case 3:
      menuItem = pMenu->insertItem("View Receipt Transactions...", this, SLOT(sViewReceipt()), 0);
      if (!_privileges->check("ViewInventoryHistory"))
        pMenu->setItemEnabled(menuItem, FALSE);
      break;

    case 4:
      menuItem = pMenu->insertItem("View Issue Transactions...", this, SLOT(sViewIssue()), 0);
      if (!_privileges->check("ViewInventoryHistory"))
        pMenu->setItemEnabled(menuItem, FALSE);
      break;

    case 5:
      menuItem = pMenu->insertItem("View Sold Transactions...", this, SLOT(sViewSold()), 0);
      if (!_privileges->check("ViewInventoryHistory"))
        pMenu->setItemEnabled(menuItem, FALSE);
      break;

    case 6:
      menuItem = pMenu->insertItem("View Scrap Transactions...", this, SLOT(sViewScrap()), 0);
      if (!_privileges->check("ViewInventoryHistory"))
        pMenu->setItemEnabled(menuItem, FALSE);
      break;

    case 7:
      menuItem = pMenu->insertItem("View Adjustment Transactions...", this, SLOT(sViewAdjustment()), 0);
      if (!_privileges->check("ViewInventoryHistory"))
        pMenu->setItemEnabled(menuItem, FALSE);
      break;
  }
}