void dspPlannedOrders::sPopulateMenu(QMenu *pMenu, QTreeWidgetItem *pSelected, int) { QAction *menuItem; menuItem = pMenu->addAction(tr("Running Availability..."), this, SLOT(sDspRunningAvailability())); menuItem->setEnabled(_privileges->check("ViewInventoryAvailability")); menuItem = pMenu->addAction(tr("Usage Statistics..."), this, SLOT(sDspUsageStatistics())); menuItem->setEnabled(_privileges->check("ViewInventoryHistory")); pMenu->addSeparator(); if (pSelected->text(10) == "No") { menuItem = pMenu->addAction(tr("Edit Order..."), this, SLOT(sEditOrder())); menuItem->setEnabled(_privileges->check("CreatePlannedOrders")); menuItem = pMenu->addAction(tr("Firm Order..."), this, SLOT(sFirmOrder())); menuItem->setEnabled(_privileges->check("FirmPlannedOrders")); } else { menuItem = pMenu->addAction(tr("Soften Order..."), this, SLOT(sSoftenOrder())); menuItem->setEnabled(_privileges->check("SoftenPlannedOrders")); } menuItem = pMenu->addAction(tr("Release Order..."), this, SLOT(sReleaseOrder())); if ( (!_privileges->check("ReleasePlannedOrders")) || ((pSelected->text(1) == "T/O") && (!_privileges->check("MaintainTransferOrders")) ) || ((pSelected->text(1) == "W/O") && (!_privileges->check("MaintainWorkOrders")) ) || ((pSelected->text(1) == "P/O") && (!_privileges->check("MaintainPurchaseRequests")) ) ) menuItem->setEnabled(false); menuItem = pMenu->addAction(tr("Delete Order..."), this, SLOT(sDeleteOrder())); menuItem->setEnabled(_privileges->check("DeletePlannedOrders")); }
void dspPlannedOrdersByPlannerCode::sPopulateMenu(QMenu *pMenu, QTreeWidgetItem *pSelected) { int menuItem; menuItem = pMenu->insertItem(tr("Running Availability..."), this, SLOT(sDspRunningAvailability()), 0); pMenu->insertSeparator(); if (!_privleges->check("ViewInventoryAvailability")) pMenu->setItemEnabled(menuItem, FALSE); if (pSelected->text(8) == "No") { menuItem = pMenu->insertItem(tr("Firm Order..."), this, SLOT(sFirmOrder()), 0); if (!_privleges->check("FirmPlannedOrders")) pMenu->setItemEnabled(menuItem, FALSE); } else { menuItem = pMenu->insertItem(tr("Soften Order..."), this, SLOT(sSoftenOrder()), 0); if (!_privleges->check("SoftenPlannedOrders")) pMenu->setItemEnabled(menuItem, FALSE); } menuItem = pMenu->insertItem(tr("Release Order..."), this, SLOT(sReleaseOrder()), 0); if ( (!_privleges->check("ReleasePlannedOrders")) || ((pSelected->text(1) == "W/O") && (!_privleges->check("MaintainWorkOrders")) ) || ((pSelected->text(1) == "P/O") && (!_privleges->check("MaintainPurchaseRequests")) ) ) pMenu->setItemEnabled(menuItem, FALSE); menuItem = pMenu->insertItem(tr("Delete Order..."), this, SLOT(sDeleteOrder()), 0); if (!_privleges->check("DeletePlannedOrders")) pMenu->setItemEnabled(menuItem, FALSE); }
void dspRunningAvailability::sPopulateMenu(QMenu *pMenu, QTreeWidgetItem *pSelected, int) { QAction *menuItem; QString ordertype = pSelected->text(list()->column("ordertype")); if (ordertype == tr("Planned W/O (firmed)") || ordertype == tr("Planned W/O") || ordertype == tr("Planned P/O (firmed)") || ordertype == tr("Planned P/O") ) { if (ordertype == tr("Planned W/O (firmed)") || ordertype == tr("Planned P/O (firmed)") ) pMenu->addAction(tr("Soften Order..."), this, SLOT(sSoftenOrder())); else pMenu->addAction(tr("Firm Order..."), this, SLOT(sFirmOrder())); pMenu->addAction(tr("Release Order..."), this, SLOT(sReleaseOrder())); pMenu->addAction(tr("Delete Order..."), this, SLOT(sDeleteOrder())); } else if (ordertype.contains("W/O") && !(ordertype == tr("Planned W/O Req. (firmed)") || ordertype == tr("Planned W/O Req."))) { pMenu->addAction(tr("View Work Order Details..."), this, SLOT(sViewWo())); menuItem = pMenu->addAction(tr("Work Order Schedule by Item..."), this, SLOT(sDspWoScheduleByWorkOrder())); menuItem->setEnabled( _privileges->check("MaintainWorkOrders") || _privileges->check("ViewWorkOrders")); } else if (ordertype == "S/O") { menuItem = pMenu->addAction(tr("View Sales Order..."), this, SLOT(sViewSo())); menuItem->setEnabled(_privileges->check("ViewSalesOrders")); menuItem = pMenu->addAction(tr("Edit Sales Order..."), this, SLOT(sEditSo())); menuItem->setEnabled(_privileges->check("MaintainSalesOrders")); } else if (ordertype == "T/O") { menuItem = pMenu->addAction(tr("View Transfer Order..."), this, SLOT(sViewTo())); menuItem->setEnabled(_privileges->check("ViewTransferOrders")); menuItem = pMenu->addAction(tr("Edit Transfer Order..."), this, SLOT(sEditTo())); menuItem->setEnabled(_privileges->check("MaintainTransferOrders")); } else if (ordertype == "P/O") { menuItem = pMenu->addAction(tr("View Purchase Order..."), this, SLOT(sViewPo())); menuItem->setEnabled(_privileges->check("ViewPurchaseOrders")); menuItem = pMenu->addAction(tr("Edit Purchase Order..."), this, SLOT(sEditPo())); menuItem->setEnabled(_privileges->check("MaintainPurchaseOrders")); } }
void dspRunningAvailability::sPopulateMenu(QMenu *pMenu, QTreeWidgetItem *pSelected) { int menuItem; if (pSelected->text(ORDERTYPE_COL) == tr("Planned W/O (firmed)") || pSelected->text(ORDERTYPE_COL) == tr("Planned W/O") || pSelected->text(ORDERTYPE_COL) == tr("Planned P/O (firmed)") || pSelected->text(ORDERTYPE_COL) == tr("Planned P/O") ) { if (pSelected->text(ORDERTYPE_COL) == tr("Planned W/O (firmed)") || pSelected->text(ORDERTYPE_COL) == tr("Planned P/O (firmed)") ) pMenu->insertItem(tr("Soften Order..."), this, SLOT(sSoftenOrder()), 0); else pMenu->insertItem(tr("Firm Order..."), this, SLOT(sFirmOrder()), 0); pMenu->insertItem(tr("Release Order..."), this, SLOT(sReleaseOrder()), 0); pMenu->insertItem(tr("Delete Order..."), this, SLOT(sDeleteOrder()), 0); } else if (pSelected->text(ORDERTYPE_COL).contains("W/O") && !(pSelected->text(ORDERTYPE_COL) == tr("Planned W/O Req. (firmed)") || pSelected->text(ORDERTYPE_COL) == tr("Planned W/O Req."))) { pMenu->insertItem(tr("View Work Order Details..."), this, SLOT(sViewWo()), 0); menuItem = pMenu->insertItem(tr("Work Order Schedule..."), this, SLOT(sDspWoScheduleByWorkOrder()), 0); pMenu->setItemEnabled(menuItem, _privileges->check("MaintainWorkOrders") || _privileges->check("ViewWorkOrders")); } else if (pSelected->text(ORDERTYPE_COL) == "S/O") { menuItem = pMenu->insertItem(tr("View Sales Order..."), this, SLOT(sViewSo()), 0); pMenu->setItemEnabled(menuItem, _privileges->check("ViewSalesOrders")); } else if (pSelected->text(ORDERTYPE_COL) == "T/O") { menuItem = pMenu->insertItem(tr("View Transfer Order..."), this, SLOT(sViewTo()), 0); pMenu->setItemEnabled(menuItem, _privileges->check("ViewTransferOrders")); } }