void dspInventoryAvailabilityByParameterList::sPopulateMenu(QMenu *menu, QTreeWidgetItem *selected) { XTreeWidgetItem * item = (XTreeWidgetItem*)selected; int menuItem; menuItem = menu->insertItem(tr("View Inventory History..."), this, SLOT(sViewHistory()), 0); if (!_privileges->check("ViewInventoryHistory")) menu->setItemEnabled(menuItem, FALSE); menu->insertSeparator(); menuItem = menu->insertItem(tr("View Allocations..."), this, SLOT(sViewAllocations()), 0); if (item->rawValue("allocated").toDouble() == 0.0) menu->setItemEnabled(menuItem, FALSE); menuItem = menu->insertItem(tr("View Orders..."), this, SLOT(sViewOrders()), 0); if (item->rawValue("ordered").toDouble() == 0.0) menu->setItemEnabled(menuItem, FALSE); menuItem = menu->insertItem(tr("Running Availability..."), this, SLOT(sRunningAvailability()), 0); menu->insertSeparator(); if (((XTreeWidgetItem *)selected)->altId() == 1) { menuItem = menu->insertItem(tr("Create P/R..."), this, SLOT(sCreatePR()), 0); if (!_privileges->check("MaintainPurchaseRequests")) menu->setItemEnabled(menuItem, FALSE); menuItem = menu->insertItem(tr("Create P/O..."), this, SLOT(sCreatePO()), 0); if (!_privileges->check("MaintainPurchaseOrders")) menu->setItemEnabled(menuItem, FALSE); menu->insertSeparator(); } else if (((XTreeWidgetItem *)selected)->altId() == 2) { menuItem = menu->insertItem(tr("Create W/O..."), this, SLOT(sCreateWO()), 0); if (!_privileges->check("MaintainWorkOrders")) menu->setItemEnabled(menuItem, FALSE); menuItem = menu->insertItem(tr("Post Misc. Production..."), this, SLOT(sPostMiscProduction()), 0); if (!_privileges->check("PostMiscProduction")) menu->setItemEnabled(menuItem, FALSE); menu->insertSeparator(); } menu->insertItem(tr("View Substitute Availability..."), this, SLOT(sViewSubstituteAvailability()), 0); menu->insertSeparator(); menuItem = menu->insertItem(tr("Issue Count Tag..."), this, SLOT(sIssueCountTag()), 0); if (!_privileges->check("IssueCountTags")) menu->setItemEnabled(menuItem, FALSE); menuItem = menu->insertItem(tr("Enter Misc. Inventory Count..."), this, SLOT(sEnterMiscCount()), 0); if (!_privileges->check("EnterMiscCounts")) menu->setItemEnabled(menuItem, FALSE); }
void dspInventoryAvailabilityBySourceVendor::sPopulateMenu(QMenu *menu, QTreeWidgetItem *selected) { int menuItem; menuItem = menu->insertItem(tr("View Inventory History..."), this, SLOT(sViewHistory()), 0); menu->insertSeparator(); menuItem = menu->insertItem(tr("View Allocations..."), this, SLOT(sViewAllocations()), 0); if (selected->text(6).remove(',').toDouble() == 0.0) menu->setItemEnabled(menuItem, FALSE); menuItem = menu->insertItem(tr("View Orders..."), this, SLOT(sViewOrders()), 0); if (selected->text(8).remove(',').toDouble() == 0.0) menu->setItemEnabled(menuItem, FALSE); menuItem = menu->insertItem(tr("Running Availability..."), this, SLOT(sRunningAvailability()), 0); menu->insertSeparator(); menuItem = menu->insertItem(tr("Create P/R..."), this, SLOT(sCreatePR()), 0); if (!_privileges->check("MaintainPurchaseRequests")) menu->setItemEnabled(menuItem, FALSE); menuItem = menu->insertItem(tr("Create P/O..."), this, SLOT(sCreatePO()), 0); if (!_privileges->check("MaintainPurchaseOrders")) menu->setItemEnabled(menuItem, FALSE); menu->insertSeparator(); menu->insertItem(tr("View Substitute Availability..."), this, SLOT(sViewSubstituteAvailability()), 0); menu->insertSeparator(); menuItem = menu->insertItem(tr("Issue Count Tag..."), this, SLOT(sIssueCountTag()), 0); if (!_privileges->check("IssueCountTags")) menu->setItemEnabled(menuItem, FALSE); menuItem = menu->insertItem(tr("Enter Misc. Inventory Count..."), this, SLOT(sEnterMiscCount()), 0); if (!_privileges->check("EnterMiscCounts")) menu->setItemEnabled(menuItem, FALSE); }
void dspTimePhasedAvailability::sPopulateMenu(QMenu *pMenu, QTreeWidgetItem *pSelected, int pColumn) { QAction *menuItem; _column = pColumn; if (_column > 2) { menuItem = pMenu->addAction(tr("View Availability Detail..."), this, SLOT(sViewAvailability())); menuItem = pMenu->addAction(tr("View Allocations..."), this, SLOT(sViewAllocations())); menuItem = pMenu->addAction(tr("View Orders..."), this, SLOT(sViewOrders())); if (((XTreeWidgetItem *)pSelected)->altId() == 1) { pMenu->addSeparator(); menuItem = pMenu->addAction(tr("Create W/O..."), this, SLOT(sCreateWO())); } else if (((XTreeWidgetItem *)pSelected)->altId() == 2) { pMenu->addSeparator(); menuItem = pMenu->addAction(tr("Create P/R..."), this, SLOT(sCreatePR())); menuItem = pMenu->addAction(tr("Create P/O..."), this, SLOT(sCreatePO())); } } }