Example #1
0
void dspIncidentsByCRMAccount::sPopulateMenu(QMenu *pMenu)
{
  int menuItem;

  if (_list->altId() == 1)
  {
    menuItem = pMenu->insertItem(tr("Edit CRM Account..."), this, SLOT(sEditCRMAccount()), 0);
    pMenu->setItemEnabled(menuItem, _privileges->check("MaintainCRMAccounts"));
    menuItem = pMenu->insertItem(tr("View CRM Account..."), this, SLOT(sViewCRMAccount()), 0);
    pMenu->setItemEnabled(menuItem, _privileges->check("ViewCRMAccounts") ||
				    _privileges->check("MaintainCRMAccounts"));
  }
  else if (_list->altId() == 2)
  {
    menuItem = pMenu->insertItem(tr("Edit Incident..."), this, SLOT(sEditIncident()), 0);
    pMenu->setItemEnabled(menuItem, _privileges->check("MaintainIncidents"));
    menuItem = pMenu->insertItem(tr("View Incident..."), this, SLOT(sViewIncident()), 0);
    pMenu->setItemEnabled(menuItem, _privileges->check("ViewIncidents") ||
				    _privileges->check("MaintainIncidents"));
  }
  else if (_list->altId() == 3)
  {
    menuItem = pMenu->insertItem(tr("Edit To-Do Item..."), this, SLOT(sEditTodoItem()), 0);
    pMenu->setItemEnabled(menuItem, _privileges->check("MaintainOtherTodoLists"));

    menuItem = pMenu->insertItem(tr("View To-Do Item..."), this, SLOT(sViewTodoItem()), 0);
    pMenu->setItemEnabled(menuItem, _privileges->check("ViewOtherTodoLists"));
  }
}
Example #2
0
void dspIncidentsByCRMAccount::sPopulateMenu(QMenu *pMenu, QTreeWidgetItem*, int)
{
  QAction *menuItem;

  if (list()->altId() == 1)
  {
    menuItem = pMenu->addAction(tr("Edit CRM Account..."), this, SLOT(sEditCRMAccount()));
    menuItem->setEnabled(_privileges->check("MaintainCRMAccounts"));
    menuItem = pMenu->addAction(tr("View CRM Account..."), this, SLOT(sViewCRMAccount()));
    menuItem->setEnabled( _privileges->check("ViewCRMAccounts") ||
				    _privileges->check("MaintainCRMAccounts"));
  }
  else if (list()->altId() == 2)
  {
    menuItem = pMenu->addAction(tr("Edit Incident..."), this, SLOT(sEditIncident()));
    menuItem->setEnabled(_privileges->check("MaintainIncidents"));
    menuItem = pMenu->addAction(tr("View Incident..."), this, SLOT(sViewIncident()));
    menuItem->setEnabled( _privileges->check("ViewIncidents") ||
				    _privileges->check("MaintainIncidents"));
  }
  else if (list()->altId() == 3)
  {
    menuItem = pMenu->addAction(tr("Edit To-Do Item..."), this, SLOT(sEditTodoItem()));
    menuItem->setEnabled(_privileges->check("MaintainOtherTodoLists"));

    menuItem = pMenu->addAction(tr("View To-Do Item..."), this, SLOT(sViewTodoItem()));
    menuItem->setEnabled(_privileges->check("ViewOtherTodoLists"));
  }
}
Example #3
0
void todoList::sPopulateMenu(QMenu *pMenu)
{
  int menuItem;

  if (_todoList->currentItem()->text(0) == "T")
  {
    bool editPriv =
	(_myUsrId == _todoList->altId() && _privileges->check("MaintainPersonalTodoList")) ||
	(_myUsrId != _todoList->altId() && _privileges->check("MaintainOtherTodoLists"));

    bool viewPriv =
	(_myUsrId == _todoList->altId() && _privileges->check("ViewPersonalTodoList")) ||
	(_myUsrId != _todoList->altId() && _privileges->check("ViewOtherTodoLists"));

    menuItem = pMenu->insertItem(tr("New..."), this, SLOT(sNew()), 0);
    pMenu->setItemEnabled(menuItem, editPriv);

    menuItem = pMenu->insertItem(tr("Edit..."), this, SLOT(sEdit()), 0);
    pMenu->setItemEnabled(menuItem, editPriv);

    menuItem = pMenu->insertItem(tr("View..."), this, SLOT(sView()), 0);
    pMenu->setItemEnabled(menuItem, viewPriv);

    menuItem = pMenu->insertItem(tr("Delete"), this, SLOT(sDelete()), 0);
    pMenu->setItemEnabled(menuItem, editPriv);
  }

  if (! _todoList->currentItem()->text(8).isEmpty())
  {
    menuItem = pMenu->insertItem(tr("Edit Incident"), this, SLOT(sEditIncident()), 0);
    pMenu->setItemEnabled(menuItem, _privileges->check("MaintainIncidents"));
    menuItem = pMenu->insertItem(tr("View Incident"), this, SLOT(sViewIncident()), 0);
    pMenu->setItemEnabled(menuItem, _privileges->check("ViewIncidents") ||
				    _privileges->check("MaintainIncidents"));
  }

  if (! _todoList->currentItem()->text(9).isEmpty())
  {
    menuItem = pMenu->insertItem(tr("Customer Workbench"), this, SLOT(sCustomerInfo()), 0);
    pMenu->setItemEnabled(menuItem, _privileges->check("MaintainCustomerMasters"));
  }
}
Example #4
0
void dspTodoByUserAndIncident::sPopulateMenu(QMenu *pMenu)
{
  int menuItem;

  menuItem = pMenu->insertItem(tr("Edit..."), this, SLOT(sEditTodoItem()), 0);
  pMenu->setItemEnabled(menuItem, _privileges->check("MaintainOtherTodoLists"));

  menuItem = pMenu->insertItem(tr("View..."), this, SLOT(sViewTodoItem()), 0);
  pMenu->setItemEnabled(menuItem, _privileges->check("ViewOtherTodoLists"));

  if (_todoitem->altId() > 0)
  {
    pMenu->insertSeparator();
    menuItem = pMenu->insertItem(tr("Edit Incident"), this, SLOT(sEditIncident()), 0);
    pMenu->setItemEnabled(menuItem, _privileges->check("MaintainIncidents"));
    menuItem = pMenu->insertItem(tr("View Incident"), this, SLOT(sViewIncident()), 0);
    pMenu->setItemEnabled(menuItem, _privileges->check("ViewIncidents") ||
				    _privileges->check("MaintainIncidents"));
  }
}
Example #5
0
void todoList::sEdit()
{
  if (_todoList->altId() ==2)
    sEditIncident();
  else if (_todoList->altId() == 3)
    sEditTask();
  else if (_todoList->altId() == 4)
    sEditProject();
  else
  {
    ParameterList params;
    params.append("mode", "edit");
    params.append("todoitem_id", _todoList->id());

    todoItem newdlg(this, "", TRUE);
    newdlg.set(params);

    if (newdlg.exec() != XDialog::Rejected)
      sFillList();
  }
}
Example #6
0
void dspTodoByUserAndIncident::sPopulateMenu(QMenu *pMenu, QTreeWidgetItem*, int)
{
  QAction *menuItem;

  menuItem = pMenu->addAction(tr("Edit..."), this, SLOT(sEditTodoItem()));
  menuItem->setEnabled(_privileges->check("MaintainOtherTodoLists"));

  menuItem = pMenu->addAction(tr("View..."), this, SLOT(sViewTodoItem()));
  menuItem->setEnabled(_privileges->check("ViewOtherTodoLists"));

  if (list()->altId() > 0)
  {
    pMenu->addSeparator();
    menuItem = pMenu->addAction(tr("Edit Incident"), this, SLOT(sEditIncident()));
    menuItem->setEnabled(_privileges->check("MaintainIncidents"));

    menuItem = pMenu->addAction(tr("View Incident"), this, SLOT(sViewIncident()));
    menuItem->setEnabled(_privileges->check("ViewIncidents") ||
                         _privileges->check("MaintainIncidents"));
  }
}
Example #7
0
void dspAROpenItems::sPopulateMenu(QMenu *pMenu, QTreeWidgetItem *pItem)
{
  int menuItem;

  if (((XTreeWidgetItem *)pItem)->id() != -1)
  {
    menuItem = pMenu->insertItem(tr("Edit..."), this, SLOT(sEdit()), 0);
    if (!_privileges->check("EditAROpenItem"))
      pMenu->setItemEnabled(menuItem, FALSE);

    pMenu->insertItem(tr("View..."), this, SLOT(sView()), 0);
    
    XTreeWidgetItem* item = (XTreeWidgetItem*)pItem;
    {
      if (item->text(0) == "Invoice")
      {
        pMenu->insertItem(tr("View Invoice..."), this, SLOT(sViewInvoice()), 0);
        pMenu->insertItem(tr("View Invoice Details..."), this, SLOT(sViewInvoiceDetails()), 0);
      }
    }

    menuItem = pMenu->insertItem(tr("Create Incident..."), this, SLOT(sIncident()), 0);
    if (!_privileges->check("AddIncidents"))
      pMenu->setItemEnabled(menuItem, FALSE);
  }
  else
  {
    menuItem = pMenu->insertItem(tr("Edit..."), this, SLOT(sEditIncident()), 0);
    if (!_privileges->check("MaintainIncidents"))
      pMenu->setItemEnabled(menuItem, FALSE);

    pMenu->insertItem(tr("View..."), this, SLOT(sViewIncident()), 0);
    if (!_privileges->check("ViewIncidents"))
      pMenu->setItemEnabled(menuItem, FALSE);
  }
}
Example #8
0
void todoList::sPopulateMenu(QMenu *pMenu)
{
  int menuItem;

  bool editPriv =
      (omfgThis->username() == _todoList->currentItem()->text(3) && _privileges->check("MaintainPersonalTodoList")) ||
      (omfgThis->username() != _todoList->currentItem()->text(3) && _privileges->check("MaintainOtherTodoLists"));

  bool viewPriv =
      (omfgThis->username() == _todoList->currentItem()->text(3) && _privileges->check("ViewPersonalTodoList")) ||
      (omfgThis->username() != _todoList->currentItem()->text(3) && _privileges->check("ViewOtherTodoLists"));

  menuItem = pMenu->insertItem(tr("New To-Do..."), this, SLOT(sNew()), 0);
  pMenu->setItemEnabled(menuItem, editPriv);

  if (_todoList->currentItem()->altId() == 1)
  {
    menuItem = pMenu->insertItem(tr("Edit To-Do..."), this, SLOT(sEdit()), 0);
    pMenu->setItemEnabled(menuItem, editPriv);

    menuItem = pMenu->insertItem(tr("View To-Do..."), this, SLOT(sView()), 0);
    pMenu->setItemEnabled(menuItem, viewPriv);

    menuItem = pMenu->insertItem(tr("Delete To-Do"), this, SLOT(sDelete()), 0);
    pMenu->setItemEnabled(menuItem, editPriv);
  }

  pMenu->addSeparator();

  menuItem = pMenu->insertItem(tr("New Incident..."), this, SLOT(sNewIncdt()), 0);
  pMenu->setItemEnabled(menuItem,  _privileges->check("MaintainIncidents"));

  if ((_todoList->altId() == 1 && !_todoList->currentItem()->text(9).isEmpty()) ||
       _todoList->altId() == 2)
  {
    menuItem = pMenu->insertItem(tr("Edit Incident"), this, SLOT(sEditIncident()), 0);
    pMenu->setItemEnabled(menuItem, _privileges->check("MaintainIncidents"));
    menuItem = pMenu->insertItem(tr("View Incident"), this, SLOT(sViewIncident()), 0);
    pMenu->setItemEnabled(menuItem, _privileges->check("ViewIncidents") ||
				    _privileges->check("MaintainIncidents"));
  }
  pMenu->addSeparator();

  if (_todoList->altId() == 3)
  {
    menuItem = pMenu->insertItem(tr("Edit Task"), this, SLOT(sEditTask()), 0);
    pMenu->setItemEnabled(menuItem, _privileges->check("MaintainProjects"));
    menuItem = pMenu->insertItem(tr("View Task"), this, SLOT(sViewTask()), 0);
    pMenu->setItemEnabled(menuItem, _privileges->check("ViewProjects") ||
      _privileges->check("MaintainProjects"));
    pMenu->addSeparator();
  }

  if (_todoList->altId() >= 3)
  {
    menuItem = pMenu->insertItem(tr("Edit Project"), this, SLOT(sEditProject()), 0);
    pMenu->setItemEnabled(menuItem, _privileges->check("MaintainProjects"));
    menuItem = pMenu->insertItem(tr("View Project"), this, SLOT(sViewProject()), 0);
    pMenu->setItemEnabled(menuItem, _privileges->check("ViewProjects") ||
      _privileges->check("MaintainProjects"));
  }

  if (!_todoList->currentItem()->text(10).isEmpty())
  {
    pMenu->addSeparator();
    menuItem = pMenu->insertItem(tr("Edit Customer"), this, SLOT(sEditCustomer()), 0);
    pMenu->setItemEnabled(menuItem, _privileges->check("MaintainCustomerMasters") || _privileges->check("ViewCustomerMasters"));
    menuItem = pMenu->insertItem(tr("View Customer"), this, SLOT(sViewCustomer()), 0);
    pMenu->setItemEnabled(menuItem, _privileges->check("ViewCustomerMasters"));
  }
}
void todoList::sPopulateMenu(QMenu *pMenu, QTreeWidgetItem *, int)
{
  QAction *menuItem;

  bool editPriv = false;
  bool viewPriv = false;

  if (list()->currentItem()->altId() == 1)
  {
    editPriv =
        (omfgThis->username() == list()->currentItem()->rawValue("owner") && _privileges->check("MaintainPersonalToDoItems")) ||
        (omfgThis->username() == list()->currentItem()->rawValue("assigned") && _privileges->check("MaintainPersonalToDoItems")) ||
        (_privileges->check("MaintainAllToDoItems"));

    viewPriv =
        (omfgThis->username() == list()->currentItem()->rawValue("owner") && _privileges->check("ViewPersonalToDoItems")) ||
        (omfgThis->username() == list()->currentItem()->rawValue("assigned") && _privileges->check("ViewPersonalToDoItems")) ||
        (_privileges->check("ViewAllToDoItems"));

    menuItem = pMenu->addAction(tr("Edit To-Do..."), this, SLOT(sEdit()));
    menuItem->setEnabled(editPriv);

    menuItem = pMenu->addAction(tr("View To-Do..."), this, SLOT(sView()));
    menuItem->setEnabled(viewPriv);

    menuItem = pMenu->addAction(tr("Delete To-Do"), this, SLOT(sDelete()));
    menuItem->setEnabled(editPriv);
  }

  pMenu->addSeparator();

  if (list()->altId() == 2 ||
      (list()->currentItem()->altId() == 1 &&
       list()->currentItem()->rawValue("parent") == "INCDT"))
  {
    editPriv =
        (omfgThis->username() == list()->currentItem()->rawValue("owner") && _privileges->check("MaintainPersonalIncidents")) ||
        (omfgThis->username() == list()->currentItem()->rawValue("assigned") && _privileges->check("MaintainPersonalIncidents")) ||
        (_privileges->check("MaintainAllIncidents"));

    viewPriv =
        (omfgThis->username() == list()->currentItem()->rawValue("owner") && _privileges->check("ViewPersonalIncidents")) ||
        (omfgThis->username() == list()->currentItem()->rawValue("assigned") && _privileges->check("ViewPersonalIncidents")) ||
        (_privileges->check("ViewAllIncidents"));

    menuItem = pMenu->addAction(tr("Edit Incident"), this, SLOT(sEditIncident()));
    menuItem->setEnabled(editPriv);
    menuItem = pMenu->addAction(tr("View Incident"), this, SLOT(sViewIncident()));
    menuItem->setEnabled(viewPriv);
  }
  pMenu->addSeparator();

  if (list()->altId() == 3)
  {
    editPriv =
        (omfgThis->username() == list()->currentItem()->rawValue("owner") && _privileges->check("MaintainPersonalProjects")) ||
        (omfgThis->username() == list()->currentItem()->rawValue("assigned") && _privileges->check("MaintainPersonalProjects")) ||
        (_privileges->check("MaintainAllProjects"));

    viewPriv =
        (omfgThis->username() == list()->currentItem()->rawValue("owner") && _privileges->check("ViewPersonalProjects")) ||
        (omfgThis->username() == list()->currentItem()->rawValue("assigned") && _privileges->check("ViewPersonalProjects")) ||
        (_privileges->check("ViewAllProjects"));

    menuItem = pMenu->addAction(tr("Edit Task"), this, SLOT(sEditTask()));
    menuItem->setEnabled(editPriv);
    menuItem = pMenu->addAction(tr("View Task"), this, SLOT(sViewTask()));
    menuItem->setEnabled(viewPriv);
    pMenu->addSeparator();
  }

  if (list()->altId() == 3 || list()->altId() == 4)
  {
    editPriv =
        (omfgThis->username() == list()->currentItem()->rawValue("owner") && _privileges->check("MaintainPersonalProjects")) ||
        (omfgThis->username() == list()->currentItem()->rawValue("assigned") && _privileges->check("MaintainPersonalProjects")) ||
        (_privileges->check("MaintainAllProjects"));

    viewPriv =
        (omfgThis->username() == list()->currentItem()->rawValue("owner") && _privileges->check("ViewPersonalProjects")) ||
        (omfgThis->username() == list()->currentItem()->rawValue("assigned") && _privileges->check("ViewPersonalProjects")) ||
        (_privileges->check("ViewAllProjects"));

    menuItem = pMenu->addAction(tr("Edit Project"), this, SLOT(sEditProject()));
    menuItem->setEnabled(editPriv);
    menuItem = pMenu->addAction(tr("View Project"), this, SLOT(sViewProject()));
    menuItem->setEnabled(viewPriv);
  }

  if (list()->altId() == 5  ||
      (list()->currentItem()->altId() == 1 &&
       list()->currentItem()->rawValue("parent") == "OPP"))
  {
    editPriv =
        (omfgThis->username() == list()->currentItem()->rawValue("owner") && _privileges->check("MaintainPersonalOpportunities")) ||
        (omfgThis->username() == list()->currentItem()->rawValue("assigned") && _privileges->check("MaintainPersonalOpportunities")) ||
        (_privileges->check("MaintainAllOpportunities"));

    viewPriv =
        (omfgThis->username() == list()->currentItem()->rawValue("owner") && _privileges->check("ViewPersonalOpportunities")) ||
        (omfgThis->username() == list()->currentItem()->rawValue("assigned") && _privileges->check("ViewPersonalOpportunities")) ||
        (_privileges->check("ViewAllOpportunities"));

    menuItem = pMenu->addAction(tr("Edit Opportunity"), this, SLOT(sEditOpportunity()));
    menuItem->setEnabled(editPriv);
    menuItem = pMenu->addAction(tr("View Opportunity"), this, SLOT(sViewOpportunity()));
    menuItem->setEnabled(viewPriv);
  }

  if (list()->currentItem()->rawValue("cust").toInt() > 0)
  {
    pMenu->addSeparator();
    menuItem = pMenu->addAction(tr("Edit Customer"), this, SLOT(sEditCustomer()));
    menuItem->setEnabled(_privileges->check("MaintainCustomerMasters") || _privileges->check("ViewCustomerMasters"));
    menuItem = pMenu->addAction(tr("View Customer"), this, SLOT(sViewCustomer()));
    menuItem->setEnabled(_privileges->check("ViewCustomerMasters"));
  }
}
Example #10
0
void todoList::sPopulateMenu(QMenu *pMenu, QTreeWidgetItem *, int)
{
  QAction *menuItem;

  bool editPriv =
      (omfgThis->username() == list()->currentItem()->text(3) && _privileges->check("MaintainPersonalTodoList")) ||
      (omfgThis->username() != list()->currentItem()->text(3) && _privileges->check("MaintainOtherTodoLists"));

  bool viewPriv =
      (omfgThis->username() == list()->currentItem()->text(3) && _privileges->check("ViewPersonalTodoList")) ||
      (omfgThis->username() != list()->currentItem()->text(3) && _privileges->check("ViewOtherTodoLists"));

  menuItem = pMenu->addAction(tr("New To-Do..."), this, SLOT(sNew()));
  menuItem->setEnabled(editPriv);

  if (list()->currentItem()->altId() == 1)
  {
    menuItem = pMenu->addAction(tr("Edit To-Do..."), this, SLOT(sEdit()));
    menuItem->setEnabled(editPriv);

    menuItem = pMenu->addAction(tr("View To-Do..."), this, SLOT(sView()));
    menuItem->setEnabled(viewPriv);

    menuItem = pMenu->addAction(tr("Delete To-Do"), this, SLOT(sDelete()));
    menuItem->setEnabled(editPriv);
  }

  pMenu->addSeparator();

  menuItem = pMenu->addAction(tr("New Incident..."), this, SLOT(sNewIncdt()));
  menuItem->setEnabled( _privileges->check("MaintainIncidents"));

  if ((list()->altId() == 1 && !list()->currentItem()->text(9).isEmpty()) ||
       list()->altId() == 2)
  {
    menuItem = pMenu->addAction(tr("Edit Incident"), this, SLOT(sEditIncident()));
    menuItem->setEnabled(_privileges->check("MaintainIncidents"));
    menuItem = pMenu->addAction(tr("View Incident"), this, SLOT(sViewIncident()));
    menuItem->setEnabled(_privileges->check("ViewIncidents") ||
                         _privileges->check("MaintainIncidents"));
  }
  pMenu->addSeparator();

  if (list()->altId() == 3)
  {
    menuItem = pMenu->addAction(tr("Edit Task"), this, SLOT(sEditTask()));
    menuItem->setEnabled(_privileges->check("MaintainProjects"));
    menuItem = pMenu->addAction(tr("View Task"), this, SLOT(sViewTask()));
    menuItem->setEnabled(_privileges->check("ViewProjects") ||
                         _privileges->check("MaintainProjects"));
    pMenu->addSeparator();
  }

  if (list()->altId() >= 3)
  {
    menuItem = pMenu->addAction(tr("Edit Project"), this, SLOT(sEditProject()));
    menuItem->setEnabled(_privileges->check("MaintainProjects"));
    menuItem = pMenu->addAction(tr("View Project"), this, SLOT(sViewProject()));
    menuItem->setEnabled(_privileges->check("ViewProjects") ||
                         _privileges->check("MaintainProjects"));
  }

  if (!list()->currentItem()->text(10).isEmpty())
  {
    pMenu->addSeparator();
    menuItem = pMenu->addAction(tr("Edit Customer"), this, SLOT(sEditCustomer()));
    menuItem->setEnabled(_privileges->check("MaintainCustomerMasters") || _privileges->check("ViewCustomerMasters"));
    menuItem = pMenu->addAction(tr("View Customer"), this, SLOT(sViewCustomer()));
    menuItem->setEnabled(_privileges->check("ViewCustomerMasters"));
  }
}