Exemple #1
0
modulePM::modulePM(OpenMFGGUIClient *Pparent) :
  QObject(Pparent, "pmModule")
{
  parent = Pparent;
  
  toolBar = new QToolBar(tr("P/M Tools"));
  toolBar->setObjectName("P/M Tools");
  toolBar->setIconSize(QSize(32, 32));
  if (_preferences->boolean("ShowPMToolbar"))
    parent->addToolBar(toolBar);

//  Projects
  projectsMenu = new QMenu();

  parent->actions.append( new Action( parent, "pm.newProject", tr("New Project..."),
                                      this, SLOT(sNewProject()),
                                      projectsMenu, _privleges->check("MaintainProjects") ) );

  parent->actions.append( new Action( parent, "pm.projects", tr("Projects..."),
                                      this, SLOT(sProjects()),
                                      projectsMenu, _privleges->check("ViewProjects"),
									  QPixmap(":/images/projects.png"), toolBar ) );

  //projectsMenu->insertSeparator();
  //
  //parent->actions.append( new Action( parent, "pm.postLaborToProject", tr("Post Labor to Project..."),
  //                                    this, SLOT(sPostLaborToProject()),
  //                                    projectsMenu, TRUE ) );

//  Displays
  displaysMenu = new QMenu();

  parent->actions.append( new Action( parent, "pm.dspOrderActivityByProject", tr("Order Activity by Project..."),
                                      this, SLOT(sDspOrderActivityByProject()),
                                      displaysMenu, _privleges->check("ViewProjects") ) );

  mainMenu = new QMenu();
  mainMenu->insertItem(tr("Projects"), projectsMenu);
  mainMenu->insertItem(tr("Displays"), displaysMenu);
  parent->populateCustomMenu(mainMenu, "P/M");
  parent->menuBar()->insertItem(tr("P/M"), mainMenu);
}
Exemple #2
0
menuCRM::menuCRM(GUIClient *Pparent) :
  QObject(Pparent)
{
  setObjectName("crmModule");
  parent = Pparent;
  
  toolBar = new QToolBar(tr("CRM Tools"));
  toolBar->setObjectName("CRM Tools");
  toolBar->setIconSize(QSize(32, 32));
  parent->addToolBar(toolBar);

  // Menus
  crmMenu           = new QMenu(parent);
  projectsMenu      = new QMenu(parent);
  incidentMenu      = new QMenu(parent);
  todoMenu          = new QMenu(parent);
  reportsMenu       = new QMenu(parent);
  accountsMenu      = new QMenu(parent);
  contactsMenu      = new QMenu(parent);
  addressMenu       = new QMenu(parent);
  utilitiesMenu     = new QMenu(parent);
  masterMenu        = new QMenu(parent);
  masterIncdMenu    = new QMenu(parent);
  opportunityMenu   = new QMenu(parent);
  masterOppMenu     = new QMenu(parent);

  crmMenu->setObjectName("menu.crm");
  projectsMenu->setObjectName("menu.crm.projects");
  incidentMenu->setObjectName("menu.crm.incident");
  todoMenu->setObjectName("menu.crm.todo");
  reportsMenu->setObjectName("menu.crm.reports");
  accountsMenu->setObjectName("menu.crm.accounts");
  contactsMenu->setObjectName("menu.crm.contacts");
  addressMenu->setObjectName("menu.crm.address");
  utilitiesMenu->setObjectName("menu.crm.utilities");
  masterMenu->setObjectName("menu.crm.master");
  masterIncdMenu->setObjectName("menu.crm.masterincd");
  opportunityMenu->setObjectName("menu.crm.opportunity");
  masterOppMenu->setObjectName("menu.crm.masteropp");

  actionProperties acts[] = {
    // CRM | Incident
    { "menu",			tr("&Incident"),	(char*)incidentMenu,		crmMenu,	"true", NULL, NULL, true	, NULL },
    { "crm.incident",		tr("&New..."),		SLOT(sIncident()),		incidentMenu,	"AddIncidents MaintainIncidents", NULL, NULL, true , NULL },
    { "separator",		NULL,				NULL,			incidentMenu,	"true", NULL, NULL, true	, NULL },
    { "crm.incidentWorkbench",	tr("&Workbench..."),	SLOT(sIncidentWorkbench()),	incidentMenu,	"ViewIncidents MaintainIncidents", QPixmap(":/images/incidents.png"), toolBar, true , tr("Incident Workbench") },

    // CRM / To Do
    { "menu",			tr("&To-Do"),	(char*)todoMenu,	crmMenu,	"true", NULL, NULL, true	, NULL },
    { "crm.todoItem",		tr("&New..."),	SLOT(sTodoItem()),	todoMenu,	"MaintainPersonalTodoList", NULL, NULL, true	, NULL },
    { "crm.todoList",		tr("&List..."),		SLOT(sTodoList()),	todoMenu,	"MaintainPersonalTodoList ViewPersonalTodoList", QPixmap(":/images/toDoList.png"), toolBar, true	, tr("To-Do List") },
    { "crm.todoListCalendar",		tr("&Calendar List..."),		SLOT(sTodoListCalendar()),	todoMenu,	"MaintainPersonalTodoList ViewPersonalTodoList", NULL, NULL, true, NULL},

    //  Project
    { "menu", tr("Pro&ject"), (char*)projectsMenu, crmMenu, "true", NULL, NULL, true	, NULL },
    { "pm.newProject", tr("&New..."), SLOT(sNewProject()), projectsMenu, "MaintainProjects", NULL, NULL, true , NULL },
    { "pm.projects", tr("&List..."), SLOT(sProjects()), projectsMenu, "ViewProjects", QPixmap(":/images/projects.png"), toolBar, true , tr("List Projects") },
    
    // Opportunity
    { "menu",		tr("&Opportunity"),	(char*)opportunityMenu,	crmMenu,		"true", NULL, NULL, true	, NULL },
    { "crm.newOpportunity", tr("&New..."), SLOT(sNewOpportunity()), opportunityMenu, "MaintainOpportunities", NULL, NULL, true , NULL },
    { "crm.listOpportunity", tr("&List..."), SLOT(sOpportunities()), opportunityMenu, "MaintainOpportunities ViewOpportunities", NULL, NULL, true , NULL },

    { "separator",		NULL,				NULL,			crmMenu,	"true", NULL, NULL, true	, NULL },

    // Reports
    { "menu",				tr("&Reports"),		(char*)reportsMenu,			crmMenu,	"true", NULL, NULL, true	, NULL },

    { "pm.dspOrderActivityByProject", tr("Order &Activity by Project..."), SLOT(sDspOrderActivityByProject()), reportsMenu, "ViewProjects", NULL, NULL, true , NULL },
    { "separator",		NULL,				NULL,			reportsMenu,	"true", NULL, NULL, true	, NULL },
    { "crm.dspIncidentsByCRMAccount",		tr("&Incidents by CRM Account..."),		SLOT(sDspIncidentsByCRMAccount()),		reportsMenu,	"ViewCRMAccounts+ViewIncidents+ViewOtherTodoLists", NULL, NULL, true	, NULL },
    { "crm.dspTodoByUserAndIncident",		tr("&To-Do List Items by User and Incident..."),		SLOT(sDspTodoByUserAndIncident()),		reportsMenu,	"MaintainOtherTodoLists ViewOtherTodoLists", NULL, NULL, true	, NULL },
    { "separator",		NULL,				NULL,			crmMenu,	"true", NULL, NULL, true	, NULL },
    
    // CRM | Account
    { "menu",		tr("&Account"),		(char*)accountsMenu,	crmMenu,		"true", NULL, NULL, true	, NULL },
    { "crm.crmaccount",		tr("&New..."),	SLOT(sCRMAccount()),	accountsMenu,	"MaintainCRMAccounts", NULL, NULL, true , NULL },
    { "crm.crmaccounts",	tr("&List..."),	SLOT(sCRMAccounts()),	accountsMenu,	"MaintainCRMAccounts ViewCRMAccounts", QPixmap(":/images/accounts.png"), toolBar, true , tr("List Accounts") },
    { "crm.crmaccountsearch",	tr("&Search..."),SLOT(sSearchForCRMAccount()),accountsMenu,	"MaintainCRMAccounts ViewCRMAccounts", NULL, NULL, true , NULL },
      
    // CRM | Contact
    { "menu",		tr("&Contact"),		(char*)contactsMenu,	crmMenu,		"true", NULL, NULL, true	, NULL },
    { "crm.contact",	tr("&New..."),		SLOT(sContact()),	contactsMenu,	"MaintainContacts", NULL, NULL, true	, NULL },
    { "crm.contacts",	tr("&List..."),		SLOT(sContacts()),	contactsMenu,	"MaintainContacts ViewContacts", QPixmap(":/images/contacts.png"), toolBar, true , tr("List Contacts") },
    { "crm.contactsearch",	tr("&Search..."),		SLOT(sSearchForContact()),	contactsMenu,	"MaintainContacts ViewContacts", NULL, NULL, true	, NULL },
    
    // CRM | Address
    { "menu",		tr("A&ddress"),		(char*)addressMenu,	crmMenu,		"true", NULL, NULL, true	, NULL },
    { "crm.address",	tr("&New..."),		SLOT(sAddress()),	addressMenu,	"MaintainAddresses", NULL, NULL, true	, NULL },
    { "crm.addresses",	tr("&List..."),	SLOT(sAddresses()),	addressMenu,	"MaintainAddresses ViewAddresses", NULL, NULL, true , NULL },

    { "separator",		NULL,				NULL,			crmMenu,	"true", NULL, NULL, true	, NULL },

    // Master Information
    { "menu",			tr("&Master Information"),		(char*)masterMenu,		crmMenu,	"true", NULL, NULL, true	, NULL },
    { "crm.honorifics",		tr("&Titles..."),			SLOT(sHonorifics()),		masterMenu,	"MaintainTitles ViewTitles", NULL, NULL, true	, NULL },
   
    { "menu",			tr("&Incident"),		(char*)masterIncdMenu,		masterMenu,	"true", NULL, NULL, true	, NULL },
    { "crm.incidentCategories",	tr("&Categories..."),		SLOT(sIncidentCategories()),	masterIncdMenu,	"MaintainIncidentCategories", NULL, NULL, true , NULL },
    { "crm.incidentSeverities",	tr("&Severities..."),		SLOT(sIncidentSeverities()),	masterIncdMenu,	"MaintainIncidentSeverities", NULL, NULL, true , NULL },
    { "crm.incidentResolutions", tr("&Resolutions..."),		SLOT(sIncidentResolutions()),	masterIncdMenu,	"MaintainIncidentResolutions", NULL, NULL, true , NULL },

    { "menu",			tr("&Opportunity"),		(char*)masterOppMenu,		masterMenu,	"true", NULL, NULL, true	, NULL },
    { "crm.opportunitySources",	tr("&Sources..."),		SLOT(sOpportunitySources()),	masterOppMenu,	"MaintainOpportunitySources", NULL, NULL, true , NULL },
    { "crm.opportunityStages",	tr("St&ages..."),		SLOT(sOpportunityStages()),	masterOppMenu,	"MaintainOpportunityStages", NULL, NULL, true , NULL },
    { "crm.opportunityTypes",	tr("&Types..."),		SLOT(sOpportunityTypes()),	masterOppMenu,	"MaintainOpportunityTypes", NULL, NULL, true , NULL },

    { "crm.incidentPriorities",	tr("&Priorities..."),		SLOT(sIncidentPriorities()),	masterMenu,	"MaintainIncidentPriorities", NULL, NULL, true , NULL },
    { "crm.characteristics",	tr("C&haracteristics..."),		SLOT(sCharacteristics()),	masterMenu,	"MaintainCharacteristics ViewCharacteristics", NULL, NULL, true , NULL },

    //Utilities
    { "menu",			tr("&Utilities"),		(char*)utilitiesMenu,		crmMenu,	"true", NULL, NULL, true	, NULL },
    { "crm.replaceOwner",	tr("Edit O&wners"),		SLOT(sEditOwners()),	utilitiesMenu,	"EditOwner", NULL, NULL, true, NULL },
    { "crm.createRecurringItems",tr("Create &Recurring Items..."), SLOT(sCreateRecurringItems()),utilitiesMenu, "MaintainIncidents MaintainProjects MaintainPersonalTodoList MaintainOthertodoLists", NULL, NULL, true, NULL }

  };

  addActionsToMenu(acts, sizeof(acts) / sizeof(acts[0]));

  parent->populateCustomMenu(crmMenu, "CRM");
  QAction * m = parent->menuBar()->addMenu(crmMenu);
  if(m)
    m->setText(tr("C&RM"));
}
todoList::todoList(QWidget* parent, const char*, Qt::WindowFlags fl)
  : display(parent, "todoList", fl)
{
  _shown = false;
  _run = false;

  setupUi(optionsWidget());
  setWindowTitle(tr("To-Do Items"));
  setReportName("TodoList");
  setMetaSQLOptions("todolist", "detail");
  setUseAltId(true);
  setParameterWidgetVisible(true);
  setNewVisible(true);
  setQueryOnStartEnabled(true);

  parameterWidget()->append(tr("User"), "username", ParameterWidget::User, omfgThis->username());
  parameterWidget()->append(tr("Owner"), "owner_username", ParameterWidget::User);
  parameterWidget()->append(tr("Assigned To"), "assigned_username", ParameterWidget::User);
  parameterWidget()->append(tr("Account"), "crmacct_id", ParameterWidget::Crmacct);
  parameterWidget()->append(tr("Start Date on or Before"), "startStartDate", ParameterWidget::Date);
  parameterWidget()->append(tr("Start Date on or After"), "startEndDate", ParameterWidget::Date);
  parameterWidget()->append(tr("Due Date on or Before"), "dueStartDate", ParameterWidget::Date);
  parameterWidget()->append(tr("Due Date on or After"), "dueEndDate", ParameterWidget::Date);
  parameterWidget()->append(tr("Show Completed"), "completed", ParameterWidget::Exists);
  parameterWidget()->append(tr("Show Completed Only"), "completedonly", ParameterWidget::Exists);

  parameterWidget()->applyDefaultFilterSet();

  connect(_opportunities, SIGNAL(toggled(bool)), this, SLOT(sFillList()));
  connect(_todolist, SIGNAL(toggled(bool)), this,   SLOT(sFillList()));
  connect(_incidents, SIGNAL(toggled(bool)), this, SLOT(sFillList()));
  connect(_projects, SIGNAL(toggled(bool)), this,	SLOT(sFillList()));
  connect(list(), SIGNAL(itemSelected(int)), this, SLOT(sOpen()));

  list()->addColumn(tr("Type"),      _userColumn,  Qt::AlignCenter, true, "type");
  list()->addColumn(tr("Priority"),  _userColumn,  Qt::AlignLeft,   true, "priority");
  list()->addColumn(tr("Owner"),     _userColumn,  Qt::AlignLeft,   false,"owner");
  list()->addColumn(tr("Assigned To"),_userColumn, Qt::AlignLeft,   true, "assigned");
  list()->addColumn(tr("Name"),              100,  Qt::AlignLeft,   true, "name");
  list()->addColumn(tr("Notes"),        -1,  Qt::AlignLeft,   true, "notes");
  list()->addColumn(tr("Stage"),   _statusColumn,  Qt::AlignLeft,   true, "stage");
  list()->addColumn(tr("Start Date"),_dateColumn,  Qt::AlignLeft,   false, "start");
  list()->addColumn(tr("Due Date"),  _dateColumn,  Qt::AlignLeft,   true, "due");
  list()->addColumn(tr("Account#"), _orderColumn,  Qt::AlignLeft,   false, "crmacct_number");
  list()->addColumn(tr("Account Name"),      100,  Qt::AlignLeft,   true, "crmacct_name");
  list()->addColumn(tr("Parent"),            100,  Qt::AlignLeft,   false, "parent");
  list()->addColumn(tr("Customer"),    _ynColumn,  Qt::AlignLeft,   false, "cust");

  QToolButton * newBtn = (QToolButton*)toolBar()->widgetForAction(newAction());
  newBtn->setPopupMode(QToolButton::MenuButtonPopup);
  QAction *menuItem;
  QMenu * todoMenu = new QMenu;
  menuItem = todoMenu->addAction(tr("To-Do Item"),   this, SLOT(sNew()));
  if(_privileges->check("MaintainAllToDoItems") || _privileges->check("MaintainPersonalToDoItems"))
    menuItem->setShortcut(QKeySequence::New);
  menuItem->setEnabled(_privileges->check("MaintainPersonalToDoItems") ||
                       _privileges->check("MaintainAllToDoItems"));
  menuItem = todoMenu->addAction(tr("Opportunity"), this, SLOT(sNewOpportunity()));
  menuItem->setEnabled(_privileges->check("MaintainPersonalOpportunities") ||
                       _privileges->check("MaintainAllOpportunities"));
  menuItem = todoMenu->addAction(tr("Incident"), this, SLOT(sNewIncdt()));
  menuItem->setEnabled(_privileges->check("MaintainPersonalIncidents") ||
                       _privileges->check("MaintainAllIncidents"));
  menuItem = todoMenu->addAction(tr("Project"), this, SLOT(sNewProject()));
  menuItem->setEnabled(_privileges->check("MaintainPersonalProjects") ||
                       _privileges->check("MaintainAllProjects"));
  newBtn->setMenu(todoMenu);
}
Exemple #4
0
menuCRM::menuCRM(GUIClient *Pparent) :
  QObject(Pparent)
{
  setObjectName("crmModule");
  parent = Pparent;
  
  toolBar = new QToolBar(tr("CRM Tools"));
  toolBar->setObjectName("CRM Tools");
  toolBar->setIconSize(QSize(32, 32));
  parent->addToolBar(toolBar);

  // Menus
  crmMenu           = new QMenu(parent);
  projectsMenu      = new QMenu(parent);
  incidentMenu      = new QMenu(parent);
  todoMenu          = new QMenu(parent);
  reportsMenu       = new QMenu(parent);
  accountsMenu      = new QMenu(parent);
  contactsMenu      = new QMenu(parent);
  addressMenu       = new QMenu(parent);
  utilitiesMenu     = new QMenu(parent);
  opportunityMenu   = new QMenu(parent);

  crmMenu->setObjectName("menu.crm");
  projectsMenu->setObjectName("menu.crm.projects");
  incidentMenu->setObjectName("menu.crm.incident");
  todoMenu->setObjectName("menu.crm.todo");
  reportsMenu->setObjectName("menu.crm.reports");
  accountsMenu->setObjectName("menu.crm.accounts");
  contactsMenu->setObjectName("menu.crm.contacts");
  addressMenu->setObjectName("menu.crm.address");
  utilitiesMenu->setObjectName("menu.crm.utilities");
  opportunityMenu->setObjectName("menu.crm.opportunity");

  actionProperties acts[] = {
    // CRM | Incident
    { "menu",			tr("&Incident"),	(char*)incidentMenu,		crmMenu,	"true", NULL, NULL, true	, NULL },
    { "crm.incident",		tr("&New..."),		SLOT(sIncident()),		incidentMenu,	"MaintainPersonalIncidents MaintainAllIncidents", NULL, NULL, true , NULL },
    { "crm.incidentList",	tr("&List..."),	SLOT(sIncidentWorkbench()),	incidentMenu,	"ViewPersonalIncidents MaintainPersonalIncidents ViewAllIncidents MaintainAllIncidents", new QPixmap(":/images/incidents.png"), toolBar, true , tr("Incident List") },

    // CRM / To Do
    { "menu",			tr("&To-Do"),	(char*)todoMenu,	crmMenu,	"true", NULL, NULL, true	, NULL },
    { "crm.todoItem",		tr("&New..."),	SLOT(sTodoItem()),	todoMenu,	"MaintainPersonalToDoItems MaintainAllToDoItems", NULL, NULL, true	, NULL },
    { "crm.todoList",		tr("&List..."),		SLOT(sTodoList()),	todoMenu,	"MaintainPersonalToDoItems ViewPersonalToDoItems MaintainAllToDoItems ViewAllToDoItems", new QPixmap(":/images/toDoList.png"), toolBar, true	, tr("To-Do List") },
    { "crm.todoListCalendar",		tr("&Calendar List..."),		SLOT(sTodoListCalendar()),	todoMenu,	"MaintainPersonalToDoItems ViewPersonalToDoItems MaintainAllToDoItems ViewAllToDoItems", NULL, NULL, true, NULL},

    //  Project
    { "menu", tr("Pro&ject"), (char*)projectsMenu, crmMenu, "true", NULL, NULL, true	, NULL },
    { "pm.newProject", tr("&New..."), SLOT(sNewProject()), projectsMenu, "MaintainPersonalProjects MaintainAllProjects", NULL, NULL, true , NULL },
    { "pm.projects", tr("&List..."), SLOT(sProjects()), projectsMenu, "ViewPersonalProjects MaintainPersonalProjects ViewAllProjects MaintainAllProjects", new QPixmap(":/images/projects.png"), toolBar, true , tr("List Projects") },
    
    // Opportunity
    { "menu",		tr("&Opportunity"),	(char*)opportunityMenu,	crmMenu,		"true", NULL, NULL, true	, NULL },
    { "crm.newOpportunity", tr("&New..."), SLOT(sNewOpportunity()), opportunityMenu, "MaintainPersonalOpportunities MaintainAllOpportunities", NULL, NULL, true , NULL },
    { "crm.listOpportunity", tr("&List..."), SLOT(sOpportunities()), opportunityMenu, "MaintainPersonalOpportunities ViewPersonalOpportunities MaintainAllOpportunities ViewAllOpportunities", NULL, NULL, true , NULL },

    { "separator",		NULL,				NULL,			crmMenu,	"true", NULL, NULL, true	, NULL },

    // Reports
    { "menu",				tr("&Reports"),		(char*)reportsMenu,			crmMenu,	"true", NULL, NULL, true	, NULL },

    { "pm.dspOrderActivityByProject", tr("Order &Activity by Project..."), SLOT(sDspOrderActivityByProject()), reportsMenu, "ViewAllProjects ViewPersonalProjects", NULL, NULL, true , NULL },
    { "separator",		NULL,				NULL,			crmMenu,	"true", NULL, NULL, true	, NULL },
    
    // CRM | Account
    { "menu",		tr("&Account"),		(char*)accountsMenu,	crmMenu,		"true", NULL, NULL, true	, NULL },
    { "crm.crmaccount",		tr("&New..."),	SLOT(sCRMAccount()),	accountsMenu,	"MaintainPersonalCRMAccounts MaintainAllCRMAccounts", NULL, NULL, true , NULL },
    { "crm.crmaccounts",	tr("&List..."),	SLOT(sCRMAccounts()),	accountsMenu,	"MaintainPersonalCRMAccounts ViewPersonalCRMAccounts MaintainAllCRMAccounts ViewAllCRMAccounts", new QPixmap(":/images/accounts.png"), toolBar, true , tr("List Accounts") },
      
    // CRM | Contact
    { "menu",		tr("&Contact"),		(char*)contactsMenu,	crmMenu,		"true", NULL, NULL, true	, NULL },
    { "crm.contact",	tr("&New..."),		SLOT(sContact()),	contactsMenu,	"MaintainPersonalContacts MaintainAllContacts", NULL, NULL, true	, NULL },
    { "crm.contacts",	tr("&List..."),		SLOT(sContacts()),	contactsMenu,	"MaintainPersonalContacts ViewPersonalContacts MaintainAllContacts ViewAllContacts", new QPixmap(":/images/contacts.png"), toolBar, true , tr("List Contacts") },
    
    // CRM | Address
    { "menu",		tr("A&ddress"),		(char*)addressMenu,	crmMenu,		"true", NULL, NULL, true	, NULL },
    { "crm.address",	tr("&New..."),		SLOT(sAddress()),	addressMenu,	"MaintainAddresses", NULL, NULL, true	, NULL },
    { "crm.addresses",	tr("&List..."),	SLOT(sAddresses()),	addressMenu,	"MaintainAddresses ViewAddresses", NULL, NULL, true , NULL },

    { "separator",		NULL,				NULL,			crmMenu,	"true", NULL, NULL, true	, NULL },

    //Utilities
    { "menu",			tr("&Utilities"),		(char*)utilitiesMenu,		crmMenu,	"true", NULL, NULL, true	, NULL },
    { "crm.replaceOwner",	tr("Edit O&wners"),		SLOT(sEditOwners()),	utilitiesMenu,	"EditOwner", NULL, NULL, true, NULL },
    { "crm.createRecurringItems",tr("Create &Recurring Items..."), SLOT(sCreateRecurringItems()),utilitiesMenu, "MaintainPersonalIncidents MaintainPersonalIncidents MaintainAllIncidents MaintainAllProjects MaintainPersonalToDoItems MaintainAllToDoItems", NULL, NULL, true, NULL },
    { "crm.contactMerge",                tr("&Merge Contacts..."), SLOT(sContactMerge()),        utilitiesMenu, "MergeContacts",          NULL, NULL, true, NULL },
    { "crm.crmaccountMerge",         tr("Merge &Accounts..."), SLOT(sCrmaccountMerge()),     utilitiesMenu, "MaintainAllCRMAccounts", NULL, NULL, true, NULL },

    { "crm.setup",	tr("&Setup..."),	SLOT(sSetup()),	crmMenu,	NULL,	NULL,	NULL,	true, NULL}

  };

  addActionsToMenu(acts, sizeof(acts) / sizeof(acts[0]));

  parent->populateCustomMenu(crmMenu, "CRM");
  QAction * m = parent->menuBar()->addMenu(crmMenu);
  if(m)
    m->setText(tr("C&RM"));
}
Exemple #5
0
menuCRM::menuCRM(OpenMFGGUIClient *Pparent) :
    QObject(Pparent, "crmModule")
{
    parent = Pparent;

    toolBar = new QToolBar(tr("CRM Tools"));
    toolBar->setObjectName("CRM Tools");
    toolBar->setIconSize(QSize(32, 32));
    if (_preferences->boolean("ShowCRMToolbar"))
        parent->addToolBar(toolBar);

    // Menus
    crmMenu           = new QMenu();
    projectsMenu      = new QMenu();
    incidentMenu      = new QMenu();
    todoMenu          = new QMenu();
    reportsMenu       = new QMenu();
    accountsMenu      = new QMenu();
    contactsMenu      = new QMenu();
    addressMenu       = new QMenu();
    utilitiesMenu     = new QMenu();
    masterMenu        = new QMenu();
    masterIncdMenu    = new QMenu();
    opportunityMenu   = new QMenu();
    masterOppMenu     = new QMenu();

    actionProperties acts[] = {
        // CRM | Incident
        { "menu",			tr("&Incident"),	(char*)incidentMenu,		crmMenu,	true, NULL, NULL, true	, NULL },
        { "crm.incident",		tr("&New..."),		SLOT(sIncident()),		incidentMenu,	_privleges->check("AddIncidents") || _privleges->check("MaintainIncidents"), NULL, NULL, true , NULL },
        { "separator",		NULL,				NULL,			incidentMenu,	true, NULL, NULL, true	, NULL },
        { "crm.incidentWorkbench",	tr("&Workbench..."),	SLOT(sIncidentWorkbench()),	incidentMenu,	_privleges->check("ViewIncidents") || _privleges->check("MaintainIncidents"), new QPixmap(":/images/incidents.png"), toolBar, true , "Incident Workbench" },

        // CRM / To Do
        { "menu",			tr("&To-Do"),	(char*)todoMenu,	crmMenu,	true, NULL, NULL, true	, NULL },
        { "crm.todoItem",		tr("&New..."),	SLOT(sTodoItem()),	todoMenu,	_privleges->check("MaintainPersonalTodoList"), NULL, NULL, true	, NULL },
        { "crm.todoList",		tr("&List..."),		SLOT(sTodoList()),	todoMenu,	_privleges->check("MaintainPersonalTodoList") || _privleges->check("ViewPersonalTodoList"),new QPixmap(":/images/toDoList.png"), toolBar, true	, "To-Do List"},

        //  Project
        { "menu", tr("Pro&ject"), (char*)projectsMenu, crmMenu,true, NULL, NULL, true	, NULL },
        { "pm.newProject", tr("&New..."), SLOT(sNewProject()), projectsMenu, _privleges->check("MaintainProjects"), NULL, NULL, true , NULL },
        { "pm.projects", tr("&List..."), SLOT(sProjects()), projectsMenu, _privleges->check("ViewProjects"), new QPixmap(":/images/projects.png"), toolBar, true , "List Projects" },

        // Opportunity
        { "menu",		tr("&Opportunity"),	(char*)opportunityMenu,	crmMenu,		true, NULL, NULL, true	, NULL },
        { "crm.newOpportunity", tr("&New..."), SLOT(sNewOpportunity()), opportunityMenu, _privleges->check("MaintainOpportunities"), NULL, NULL, true , NULL },
        { "crm.listOpportunity", tr("&List..."), SLOT(sOpportunities()), opportunityMenu, (_privleges->check("MaintainOpportunities") || _privleges->check("ViewOpportunities")), NULL, NULL, true , NULL },

        { "separator",		NULL,				NULL,			crmMenu,	true, NULL, NULL, true	, NULL },

        // Reports
        { "menu",				tr("&Reports"),		(char*)reportsMenu,			crmMenu,	true, NULL, NULL, true	, NULL },

        { "pm.dspOrderActivityByProject", tr("Order &Activity by Project..."), SLOT(sDspOrderActivityByProject()), reportsMenu, _privleges->check("ViewProjects"), NULL, NULL, true , NULL },
        { "separator",		NULL,				NULL,			reportsMenu,	true, NULL, NULL, true	, NULL },
        { "crm.dspIncidentsByCRMAccount",		tr("&Incidents by CRM Account..."),		SLOT(sDspIncidentsByCRMAccount()),		reportsMenu,	_privleges->check("ViewCRMAccounts") && _privleges->check("ViewIncidents") && _privleges->check("ViewOtherTodoLists"), NULL, NULL, true	, NULL },
        { "crm.dspTodoByUserAndIncident",		tr("&To-Do List Items by User and Incident..."),		SLOT(sDspTodoByUserAndIncident()),		reportsMenu,	_privleges->check("MaintainOtherTodoLists") || _privleges->check("ViewOtherTodoLists"), NULL, NULL, true	, NULL },
        { "separator",		NULL,				NULL,			crmMenu,	true, NULL, NULL, true	, NULL },

        // CRM | Account
        { "menu",		tr("&Account"),		(char*)accountsMenu,	crmMenu,		true, NULL, NULL, true	, NULL },
        { "crm.crmaccount",		tr("&New..."),	SLOT(sCRMAccount()),	accountsMenu,	_privleges->check("MaintainCRMAccounts"), NULL, NULL, true , NULL },
        { "crm.crmaccounts",	tr("&List..."),	SLOT(sCRMAccounts()),	accountsMenu,	_privleges->check("MaintainCRMAccounts") || _privleges->check("ViewCRMAccounts"),new QPixmap(":/images/accounts.png"), toolBar, true , "List Accounts" },
        { "crm.crmaccountsearch",	tr("&Search..."),SLOT(sSearchForCRMAccount()),accountsMenu,	_privleges->check("MaintainCRMAccounts") || _privleges->check("ViewCRMAccounts"), NULL, NULL, true , NULL },

        // CRM | Contact
        { "menu",		tr("&Contact"),		(char*)contactsMenu,	crmMenu,		true, NULL, NULL, true	, NULL },
        { "crm.contact",	tr("&New..."),		SLOT(sContact()),	contactsMenu,	_privleges->check("MaintainContacts"), NULL, NULL, true	, NULL },
        { "crm.contacts",	tr("&List..."),		SLOT(sContacts()),	contactsMenu,	_privleges->check("MaintainContacts") || _privleges->check("ViewContacts"),new QPixmap(":/images/contacts.png"), toolBar, true , "List Contacts" },
        { "crm.contactsearch",	tr("&Search..."),		SLOT(sSearchForContact()),	contactsMenu,	_privleges->check("MaintainContacts") || _privleges->check("ViewContacts"), NULL, NULL, true	, NULL },

        // CRM | Address
        { "menu",		tr("A&ddress"),		(char*)addressMenu,	crmMenu,		true, NULL, NULL, true	, NULL },
        { "crm.address",	tr("&New..."),		SLOT(sAddress()),	addressMenu,	_privleges->check("MaintainAddresses"), NULL, NULL, true	, NULL },
        { "crm.addresses",	tr("&List..."),	SLOT(sAddresses()),	addressMenu,	_privleges->check("MaintainAddresses") || _privleges->check("ViewAddresses"), NULL, NULL, true , NULL },

        { "separator",		NULL,				NULL,			crmMenu,	true, NULL, NULL, true	, NULL },

        // Master Information
        { "menu",			tr("&Master Information"),		(char*)masterMenu,		crmMenu,	true, NULL, NULL, true	, NULL },
        { "crm.honorifics",		tr("&Titles..."),			SLOT(sHonorifics()),		masterMenu,	_privleges->check("MaintainTitles") || _privleges->check("ViewTitles"), NULL, NULL, true	, NULL },

        { "menu",			tr("&Incident"),		(char*)masterIncdMenu,		masterMenu,	true, NULL, NULL, true	, NULL },
        { "crm.incidentCategories",	tr("&Categories..."),		SLOT(sIncidentCategories()),	masterIncdMenu,	_privleges->check("MaintainIncidentCategories"), NULL, NULL, true , NULL },
        { "crm.incidentPriorities",	tr("&Priorities..."),		SLOT(sIncidentPriorities()),	masterIncdMenu,	_privleges->check("MaintainIncidentPriorities"), NULL, NULL, true , NULL },
        { "crm.incidentSeverities",	tr("&Severities..."),		SLOT(sIncidentSeverities()),	masterIncdMenu,	_privleges->check("MaintainIncidentSeverities"), NULL, NULL, true , NULL },
        { "crm.incidentResolutions", tr("&Resolutions..."),		SLOT(sIncidentResolutions()),	masterIncdMenu,	_privleges->check("MaintainIncidentResolutions"), NULL, NULL, true , NULL },

        { "menu",			tr("&Opportunity"),		(char*)masterOppMenu,		masterMenu,	true, NULL, NULL, true	, NULL },
        { "crm.opportunitySources",	tr("&Sources..."),		SLOT(sOpportunitySources()),	masterOppMenu,	_privleges->check("MaintainOpportunitySources"), NULL, NULL, true , NULL },
        { "crm.opportunityStages",	tr("St&ages..."),		SLOT(sOpportunityStages()),	masterOppMenu,	_privleges->check("MaintainOpportunityStages"), NULL, NULL, true , NULL },
        { "crm.opportunityTypes",	tr("&Types..."),		SLOT(sOpportunityTypes()),	masterOppMenu,	_privleges->check("MaintainOpportunityTypes"), NULL, NULL, true , NULL },

        {   "crm.characteristics",	tr("C&haracteristics..."),		SLOT(sCharacteristics()),	masterMenu,	_privleges->check("MaintainCharacteristics") ||
            _privleges->check("ViewCharacteristics"), NULL, NULL, true , NULL
        },
    };

    addActionsToMenu(acts, sizeof(acts) / sizeof(acts[0]));

    parent->populateCustomMenu(crmMenu, "CRM");
    parent->menuBar()->insertItem(tr("&CRM"), crmMenu);
}