Beispiel #1
0
employees::employees(QWidget* parent, const char*, Qt::WFlags fl)
  : display(parent, "employees", fl)
{
  setWindowTitle(tr("Employees"));
  setReportName("EmployeeList");
  setMetaSQLOptions("employees", "detail");
  setParameterWidgetVisible(true);
  setNewVisible(true);
  setSearchVisible(true);
  setQueryOnStartEnabled(true);

  parameterWidget()->append(tr("Show Inactive"), "showInactive", ParameterWidget::Exists);
  if (_metrics->boolean("MultiWhs"))
    parameterWidget()->append(tr("Site"), "warehous_id", ParameterWidget::Site);
  parameterWidget()->applyDefaultFilterSet();

  connect(omfgThis, SIGNAL(employeesUpdated(int)),     this, SLOT(sFillList()));

  list()->addColumn(tr("Site"),   _whsColumn,  Qt::AlignLeft, true, "warehous_code");
  list()->addColumn(tr("Active"), _ynColumn,   Qt::AlignLeft, true, "emp_active");
  list()->addColumn(tr("Code"),   _itemColumn, Qt::AlignLeft, true, "emp_code");
  list()->addColumn(tr("Number"), -1,          Qt::AlignLeft, true, "emp_number");
  list()->addColumn(tr("First"),  _itemColumn, Qt::AlignLeft, true, "cntct_first_name");
  list()->addColumn(tr("Last"),   _itemColumn, Qt::AlignLeft, true, "cntct_last_name");

  setupCharacteristics(characteristic::Employees);
  parameterWidget()->applyDefaultFilterSet();

  connect(list(), SIGNAL(itemSelected(int)), this, SLOT(sOpen()));

  if (!_privileges->check("MaintainEmployees"))
    newAction()->setEnabled(FALSE);
}
Beispiel #2
0
projects::projects(QWidget* parent, const char*, Qt::WFlags fl)
  : display(parent, "projects", fl)
{
  setupUi(optionsWidget());
  setWindowTitle(tr("Projects"));
  setMetaSQLOptions("projects", "detail");
  setReportName("ProjectsList");
  setParameterWidgetVisible(true);
  setNewVisible(true);
  setSearchVisible(true);
  setQueryOnStartEnabled(true);
  setUseAltId(true);

  connect(list(), SIGNAL(itemSelected(int)), this, SLOT(sOpen()));

  if (!_privileges->check("MaintainAllProjects") && !_privileges->check("MaintainPersonalProjects"))
    newAction()->setEnabled(FALSE);

  _salesOrders->setChecked(false);
  _workOrders->setChecked(false);
  _purchaseOrders->setChecked(false);
  _incidents->setChecked(false);
  _showHierarchy->setChecked(false);

  connect(omfgThis, SIGNAL(projectsUpdated(int)), this, SLOT(sFillList()));
  connect(_showComplete, SIGNAL(toggled(bool)), this, SLOT(sFillList()));
  connect(_salesOrders, SIGNAL(toggled(bool)), this, SLOT(sFillList()));
  connect(_workOrders, SIGNAL(toggled(bool)), this, SLOT(sFillList()));
  connect(_purchaseOrders, SIGNAL(toggled(bool)), this, SLOT(sFillList()));
  connect(_incidents, SIGNAL(toggled(bool)), this, SLOT(sFillList()));
  connect(_showHierarchy, SIGNAL(toggled(bool)), this, SLOT(sBuildList()));

  QString qryType = QString( "SELECT prjtype_id, prjtype_descr FROM prjtype " );

  parameterWidget()->append(tr("Owner"), "owner_username", ParameterWidget::User);
  parameterWidget()->append(tr("AssignedTo"), "assigned_username", ParameterWidget::User);
  parameterWidget()->append(tr("Account"), "crmacct_id", ParameterWidget::Crmacct);
  parameterWidget()->append(tr("Contact"), "cntct_id", ParameterWidget::Contact);
  parameterWidget()->appendComboBox(tr("Project Type"), "prjtype_id", qryType);
  parameterWidget()->append(tr("Project"), "prj_id", ParameterWidget::Project);
  parameterWidget()->append(tr("Project Task"), "project_task", ParameterWidget::Text);
  parameterWidget()->append(tr("Sales Order"), "cohead_id", ParameterWidget::SalesOrder);
  parameterWidget()->append(tr("Work Order"), "wo_id", ParameterWidget::WorkOrder);
  parameterWidget()->append(tr("Purchase Order"), "pohead_id", ParameterWidget::PurchaseOrder);
  parameterWidget()->append(tr("Start Start Date"), "startStartDate", ParameterWidget::Date, QDate::currentDate());
  parameterWidget()->append(tr("Start End Date"), "startEndDate", ParameterWidget::Date, QDate::currentDate());
  parameterWidget()->append(tr("Due Start Date"), "dueStartDate", ParameterWidget::Date, QDate::currentDate());
  parameterWidget()->append(tr("Due End Date"), "dueEndDate", ParameterWidget::Date, QDate::currentDate());
  parameterWidget()->append(tr("Assigned Start Date"), "assignedStartDate", ParameterWidget::Date, QDate::currentDate());
  parameterWidget()->append(tr("Assigned End Date"), "assignedEndDate", ParameterWidget::Date, QDate::currentDate());
  parameterWidget()->append(tr("Completed Start Date"), "completedStartDate", ParameterWidget::Date, QDate::currentDate());
  parameterWidget()->append(tr("Completed End Date"), "completedEndDate", ParameterWidget::Date, QDate::currentDate());

  sBuildList();
}
Beispiel #3
0
projects::projects(QWidget* parent, const char*, Qt::WFlags fl)
  : display(parent, "projects", fl)
{
  setupUi(optionsWidget());
  setWindowTitle(tr("Projects"));
  setMetaSQLOptions("projects", "detail");
  setParameterWidgetVisible(true);
  setNewVisible(true);
  setSearchVisible(true);
  setQueryOnStartEnabled(true);

  connect(list(), SIGNAL(itemSelected(int)), this, SLOT(sOpen()));

  if (!_privileges->check("MaintainAllProjects") && !_privileges->check("MaintainPersonalProjects"))
    newAction()->setEnabled(FALSE);

  list()->addColumn(tr("Number"),       _orderColumn,  Qt::AlignLeft,   true,  "prj_number");
  list()->addColumn(tr("Name"),                   -1,  Qt::AlignLeft,   true,  "prj_name");
  list()->addColumn(tr("Description"),            -1,  Qt::AlignLeft,   true,  "prj_descrip");
  list()->addColumn(tr("Status"),        _itemColumn,  Qt::AlignCenter, true,  "prj_status" );
  list()->addColumn(tr("Owner"),         _userColumn,  Qt::AlignLeft,   false, "prj_owner_username");
  list()->addColumn(tr("Assigned To"),   _userColumn,  Qt::AlignLeft,   true,  "prj_username");
  list()->addColumn(tr("CRM Account"),   _userColumn,  Qt::AlignLeft,   true,  "crmacct_number");
  list()->addColumn(tr("Contact"),       _userColumn,  Qt::AlignLeft,   true,  "contact_name");
  list()->addColumn(tr("Due"),           _dateColumn,  Qt::AlignCenter, true,  "prj_due_date");
  list()->addColumn(tr("Assigned"),      _dateColumn,  Qt::AlignCenter, true,  "prj_assigned_date");
  list()->addColumn(tr("Started"),       _dateColumn,  Qt::AlignCenter, true,  "prj_start_date");
  list()->addColumn(tr("Completed"),     _dateColumn,  Qt::AlignCenter, true,  "prj_completed_date");
  list()->addColumn(tr("Budget Hrs."),   _costColumn,  Qt::AlignRight,  true,  "budget_hrs");
  list()->addColumn(tr("Actual Hrs."),   _costColumn,  Qt::AlignRight,  true,  "actual_hrs");
  list()->addColumn(tr("Balance Hrs."),  _costColumn,  Qt::AlignRight,  true,  "balance_hrs");

  connect(omfgThis, SIGNAL(projectsUpdated(int)), this, SLOT(sFillList()));
  connect(_showComplete, SIGNAL(toggled(bool)), this, SLOT(sFillList()));

  parameterWidget()->append(tr("Owner"), "owner_username", ParameterWidget::User);
  parameterWidget()->append(tr("AssignedTo"), "assigned_username", ParameterWidget::User);
  parameterWidget()->append(tr("CRM Account"), "crmacct_id", ParameterWidget::Crmacct);
  parameterWidget()->append(tr("Contact"), "cntct_id", ParameterWidget::Contact);
  parameterWidget()->append(tr("Start Start Date"), "startStartDate", ParameterWidget::Date, QDate::currentDate());
  parameterWidget()->append(tr("Start End Date"), "startEndDate", ParameterWidget::Date, QDate::currentDate());
  parameterWidget()->append(tr("Due Start Date"), "dueStartDate", ParameterWidget::Date, QDate::currentDate());
  parameterWidget()->append(tr("Due End Date"), "dueEndDate", ParameterWidget::Date, QDate::currentDate());
  parameterWidget()->append(tr("Assigned Start Date"), "assignedStartDate", ParameterWidget::Date, QDate::currentDate());
  parameterWidget()->append(tr("Assigned End Date"), "assignedEndDate", ParameterWidget::Date, QDate::currentDate());
  parameterWidget()->append(tr("Completed Start Date"), "completedStartDate", ParameterWidget::Date, QDate::currentDate());
  parameterWidget()->append(tr("Completed End Date"), "completedEndDate", ParameterWidget::Date, QDate::currentDate());

  sFillList();
}
Beispiel #4
0
opportunityList::opportunityList(QWidget* parent, const char*, Qt::WFlags fl)
  : display(parent, "opportunityList", fl)
{
  setupUi(optionsWidget());
  setWindowTitle(tr("Opportunities"));
  setReportName("OpportunityList");
  setMetaSQLOptions("opportunities", "detail");
  setUseAltId(true);
  setParameterWidgetVisible(true);
  setNewVisible(true);
  setSearchVisible(true);
  setQueryOnStartEnabled(true);

  list()->addColumn(tr("Number"),      _orderColumn,    Qt::AlignLeft,   false, "ophead_number" );
  list()->addColumn(tr("Active"),      _orderColumn,    Qt::AlignLeft,   false, "ophead_active" );
  list()->addColumn(tr("Name"),        -1,              Qt::AlignLeft,   true, "ophead_name"  );
  list()->addColumn(tr("CRM Acct."),   _userColumn,     Qt::AlignLeft,   true, "crmacct_number" );
  list()->addColumn(tr("Owner"),       _userColumn,     Qt::AlignLeft,   true, "ophead_owner_username" );
  list()->addColumn(tr("Assigned"),    _userColumn,     Qt::AlignLeft,   false, "ophead_username" );
  list()->addColumn(tr("Stage"),       _orderColumn,    Qt::AlignLeft,   true, "opstage_name" );
  list()->addColumn(tr("Priority"),    _orderColumn,    Qt::AlignLeft,   true, "incdtpriority_name" );
  list()->addColumn(tr("Source"),      _orderColumn,    Qt::AlignLeft,   true, "opsource_name" );
  list()->addColumn(tr("Type"),        _orderColumn,    Qt::AlignLeft,   true, "optype_name" );
  list()->addColumn(tr("Prob.%"),      _prcntColumn,    Qt::AlignCenter, true, "ophead_probability_prcnt" );
  list()->addColumn(tr("Amount"),      _moneyColumn,    Qt::AlignRight,  true, "ophead_amount" );
  list()->addColumn(tr("Currency"),    _currencyColumn, Qt::AlignLeft,   false, "f_currency" );
  list()->addColumn(tr("Target Date"), _dateColumn,     Qt::AlignLeft,   true, "ophead_target_date" );
  list()->addColumn(tr("Actual Date"), _dateColumn,     Qt::AlignLeft,   false, "ophead_actual_date" );

  connect(list(),       SIGNAL(itemSelected(int)), this, SLOT(sEdit()));

  bool canEditUsers = _privileges->check("MaintainOtherTodoLists") || _privileges->check("ViewOtherTodoLists");
  parameterWidget()->append(tr("User"), "username", ParameterWidget::User, omfgThis->username(), !canEditUsers);
  if (canEditUsers)
    parameterWidget()->append(tr("User Pattern"), "usr_pattern",    ParameterWidget::Text);
  else
    parameterWidget()->setEnabled(tr("User"), false);
  parameterWidget()->append(tr("Start Date"), "startDate", ParameterWidget::Date);
  parameterWidget()->append(tr("End Date"),   "endDate",   ParameterWidget::Date);
  parameterWidget()->append(tr("CRM Account"), "crmacct_id",  ParameterWidget::Crmacct);
  parameterWidget()->appendComboBox(tr("Type"), "optype_id", XComboBox::OpportunityTypes);
  parameterWidget()->append(tr("Type Pattern"), "optype_pattern",    ParameterWidget::Text);
  parameterWidget()->appendComboBox(tr("Source"), "opsource_id", XComboBox::OpportunitySources);
  parameterWidget()->append(tr("Source Pattern"), "source_pattern",    ParameterWidget::Text);
  parameterWidget()->appendComboBox(tr("Stage"), "opstage_id", XComboBox::OpportunityStages);
  parameterWidget()->append(tr("Stage Pattern"), "opstage_pattern",    ParameterWidget::Text);

  setupCharacteristics(characteristic::Opportunities);
  parameterWidget()->applyDefaultFilterSet();
}
Beispiel #5
0
dspPlannedOrders::dspPlannedOrders(QWidget* parent, const char* name, Qt::WFlags fl)
  : display(parent, "dspPlannedOrders", fl)
{
  setWindowTitle(tr("Planned Orders"));
  setReportName("PlannedOrders");
  setMetaSQLOptions("schedule", "plannedorders");
  setUseAltId(true);
  setParameterWidgetVisible(true);
  setSearchVisible(true);
  setQueryOnStartEnabled(true);

  QString qryType = QString( "SELECT  'P', '%1' UNION "
                             "SELECT  'W', '%2'")
      .arg(tr("Purchase"))
      .arg(tr("Manufacture"));

  if (_metrics->boolean("MultiWhs"))
    qryType.append(QString( " UNION "
                            "SELECT  'T', '%1'")
                   .arg(tr("Transfers")));

  parameterWidget()->append(tr("Item"), "item_id", ParameterWidget::Item);
  parameterWidget()->append(tr("Order Types"), "type_list", ParameterWidget::Multiselect, QVariant(), false, qryType );
  parameterWidget()->appendComboBox(tr("Planner Code"), "plancode_id", XComboBox::PlannerCodes);
  parameterWidget()->append(tr("Planner Code Pattern"), "plancode_pattern", ParameterWidget::Text);
  parameterWidget()->append(tr("Show Inactive"), "showInactive", ParameterWidget::Exists);
  if (_metrics->boolean("MultiWhs"))
    parameterWidget()->append(tr("Site"), "warehous_id", ParameterWidget::Site);

  list()->addColumn(tr("Order #"),     _orderColumn, Qt::AlignLeft,  true, "ordernum");
  list()->addColumn(tr("Type"),        _uomColumn,   Qt::AlignCenter,true, "ordtype");
  list()->addColumn(tr("Site"),        _whsColumn,   Qt::AlignCenter,true, "warehous_code");
  list()->addColumn(tr("From Site"),   _whsColumn,   Qt::AlignCenter,true, "supply_warehous_code");
  list()->addColumn(tr("Item Number"), _itemColumn,  Qt::AlignLeft,  true, "item_number");
  list()->addColumn(tr("Description"), -1,           Qt::AlignLeft,  true, "item_descrip");
  list()->addColumn(tr("UOM"),          _uomColumn,  Qt::AlignCenter,true, "uom_name");
  list()->addColumn(tr("Start Date"),  _dateColumn,  Qt::AlignCenter,true, "planord_startdate");
  list()->addColumn(tr("Due Date"),    _dateColumn,  Qt::AlignCenter,true, "planord_duedate");
  list()->addColumn(tr("Qty"),         _qtyColumn,   Qt::AlignRight, true, "planord_qty");
  list()->addColumn(tr("Firm"),        _ynColumn,    Qt::AlignCenter,true, "planord_firm");

  connect(omfgThis, SIGNAL(workOrdersUpdated(int, bool)), this, SLOT(sFillList()));
}
incidentWorkbench::incidentWorkbench(QWidget* parent, const char*, Qt::WindowFlags fl)
  : display(parent, "incidentWorkbench", fl)
{
  setWindowTitle(tr("Incidents"));
  setListLabel(tr("Incidents"));
  setReportName("IncidentWorkbenchList");
  setMetaSQLOptions("incidents", "detail");
  setParameterWidgetVisible(true);
  setNewVisible(_privileges->check("MaintainAllIncidents") || _privileges->check("MaintainPersonalIncidents"));
  setSearchVisible(true);
  setQueryOnStartEnabled(true);
  setAutoUpdateEnabled(true);

  QString qryStatus = QString("SELECT status_seq, "
                              " CASE WHEN status_code = 'N' THEN '%1' "
                              " WHEN status_code = 'F' THEN '%2' "
                              " WHEN status_code = 'C' THEN '%3' "
                              " WHEN status_code = 'A' THEN '%4' "
                              " WHEN status_code = 'R' THEN '%5' "
                              " WHEN status_code = 'L' THEN '%6' "
                              " END AS name, status_code AS code "
                              "FROM status; ")
      .arg(tr("New"))
      .arg(tr("Feedback"))
      .arg(tr("Confirmed"))
      .arg(tr("Assigned"))
      .arg(tr("Resolved"))
      .arg(tr("Closed"));

  QString qryPriority = "SELECT incdtpriority_id, incdtpriority_name "
                        "FROM incdtpriority "
                        "ORDER BY incdtpriority_order, incdtpriority_name ";

  parameterWidget()->append(tr("Account"), "crmAccountId", ParameterWidget::Crmacct);
  parameterWidget()->append(tr("Contact"),"cntct_id", ParameterWidget::Contact);
  parameterWidget()->append(tr("Category"), "categorylist",
                           ParameterWidget::Multiselect, QVariant(), false,
                           "SELECT incdtcat_id, incdtcat_name"
                           "  FROM incdtcat"
                           " ORDER BY incdtcat_name;");
  parameterWidget()->appendComboBox(tr("Status Above"), "status_above", qryStatus, 4);
  parameterWidget()->append(tr("Status"), "statuslist",
                           ParameterWidget::Multiselect, QVariant(), false,
                           qryStatus);
  parameterWidget()->appendComboBox(tr("Severity"), "severity_id", XComboBox::IncidentSeverity);
  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("Start Date"), "startDate", ParameterWidget::Date);
  parameterWidget()->append(tr("End Date"), "endDate", ParameterWidget::Date);
  parameterWidget()->append(tr("Priority"), "incdtpriority_id_list", ParameterWidget::Multiselect, QVariant(), false, qryPriority);
  parameterWidget()->append(tr("Project"), "prj_id", ParameterWidget::Project);
  if(_metrics->boolean("IncidentsPublicPrivate"))
    parameterWidget()->append(tr("Public"), "public", ParameterWidget::CheckBox);
  parameterWidget()->append(tr("Item"), "item_id", ParameterWidget::Item);
  if (_metrics->boolean("LotSerialControl"))
    parameterWidget()->append(tr("Lot/Serial Pattern"), "lspattern", ParameterWidget::Text);
  parameterWidget()->applyDefaultFilterSet();

  connect(list(), SIGNAL(itemSelected(int)), this, SLOT(sOpen()));

  if (!_privileges->check("MaintainAllIncidents") && !_privileges->check("MaintainPersonalIncidents"))
    newAction()->setEnabled(false);

  list()->addColumn(tr("Number"),      _orderColumn,Qt::AlignLeft, true, "incdt_number" );
  list()->addColumn(tr("Created"),     _dateColumn, Qt::AlignLeft, true, "incdt_timestamp" );
  list()->addColumn(tr("Account"),     _itemColumn, Qt::AlignLeft, true, "crmacct_name" );
  list()->addColumn(tr("Status"),      _itemColumn, Qt::AlignLeft, true, "incdt_status" );
  list()->addColumn(tr("Updated"),     _dateColumn, Qt::AlignLeft, true, "incdt_updated" );
  list()->addColumn(tr("Assigned To"), _userColumn, Qt::AlignLeft, true, "incdt_assigned_username" );
  list()->addColumn(tr("Owner"),       _userColumn, Qt::AlignLeft, true, "incdt_owner_username" );
  list()->addColumn(tr("Summary"),     -1,          Qt::AlignLeft, true, "incdt_summary" );
  list()->addColumn(tr("Category"),    _userColumn, Qt::AlignLeft, false, "incdtcat_name");
  list()->addColumn(tr("Severity"),    _userColumn, Qt::AlignLeft, false, "incdtseverity_name");
  list()->addColumn(tr("Priority"),    _userColumn, Qt::AlignLeft, false, "incdtpriority_name");
  list()->addColumn(tr("Contact"),     _userColumn, Qt::AlignLeft, false, "cntct_name");
  list()->addColumn(tr("Project"),     _userColumn, Qt::AlignLeft, false, "prj_number");
  if(_metrics->boolean("IncidentsPublicPrivate"))
    list()->addColumn(tr("Public"),     _userColumn, Qt::AlignLeft, false, "incdt_public");
  list()->addColumn(tr("Item Number"),  _itemColumn, Qt::AlignLeft, false, "item_number");
  list()->addColumn(tr("Lot/Serial"),   _itemColumn, Qt::AlignLeft, false, "ls_number");

  setupCharacteristics("INCDT");
  parameterWidget()->applyDefaultFilterSet();
}
Beispiel #7
0
contacts::contacts(QWidget* parent, const char*, Qt::WFlags fl)
  : display(parent, "contacts", fl)
{
  setupUi(optionsWidget());
  setWindowTitle(tr("Contacts"));
  setReportName("ContactsMasterList");
  setMetaSQLOptions("contacts", "detail");
  setParameterWidgetVisible(true);
  setNewVisible(true);
  setSearchVisible(true);
  setQueryOnStartEnabled(true);

  _crmacctid = -1;
  _attachAct = 0;
  _detachAct = 0;

  if (_privileges->check("MaintainAllContacts") || _privileges->check("ViewAllContacts"))
  {
    parameterWidget()->append(tr("Owner"), "owner_username", ParameterWidget::User);
    parameterWidget()->append(tr("Owner Pattern"), "owner_usr_pattern", ParameterWidget::Text);
  }
  parameterWidget()->append(tr("CRM Account"), "crmacct_id", ParameterWidget::Crmacct);
  parameterWidget()->append(tr("Name Pattern"), "cntct_name_pattern", ParameterWidget::Text);
  parameterWidget()->append(tr("Phone Pattern"), "cntct_phone_pattern", ParameterWidget::Text);
  parameterWidget()->append(tr("Email Pattern"), "cntct_email_pattern", ParameterWidget::Text);
  parameterWidget()->append(tr("Street Pattern"), "addr_street_pattern", ParameterWidget::Text);
  parameterWidget()->append(tr("City Pattern"), "addr_city_pattern", ParameterWidget::Text);
  parameterWidget()->append(tr("State Pattern"), "addr_state_pattern", ParameterWidget::Text);
  parameterWidget()->append(tr("Postal Code Pattern"), "addr_postalcode_pattern", ParameterWidget::Text);
  parameterWidget()->append(tr("Country Pattern"), "addr_country_pattern", ParameterWidget::Text);
  parameterWidget()->applyDefaultFilterSet();

  list()->addColumn(tr("First Name"),          80, Qt::AlignLeft,  true, "cntct_first_name");
  list()->addColumn(tr("Last Name"),          100, Qt::AlignLeft,  true, "cntct_last_name");
  list()->addColumn(tr("Owner"),      _userColumn, Qt::AlignLeft, false, "cntct_owner_username");
  list()->addColumn(tr("Account #"),           80, Qt::AlignLeft,  true, "crmacct_number");
  list()->addColumn(tr("Account Name"),        -1, Qt::AlignLeft,  true, "crmacct_name");
  list()->addColumn(tr("Title"),               -1, Qt::AlignLeft,  true, "cntct_title");
  list()->addColumn(tr("Phone"),	      100, Qt::AlignLeft,  true, "cntct_phone");
  list()->addColumn(tr("Alternate"),          100, Qt::AlignLeft,  true, "cntct_phone2");
  list()->addColumn(tr("Fax"),                100, Qt::AlignLeft, false, "cntct_fax");
  list()->addColumn(tr("E-Mail"),             100, Qt::AlignLeft,  true, "cntct_email");
  list()->addColumn(tr("Web Address"),        100, Qt::AlignLeft, false, "cntct_webaddr");
  list()->addColumn(tr("Address"),             -1, Qt::AlignLeft, false, "addr_line1");
  list()->addColumn(tr("City"),                75, Qt::AlignLeft, false, "addr_city");
  list()->addColumn(tr("State"),               50, Qt::AlignLeft, false, "addr_state");
  list()->addColumn(tr("Country"),            100, Qt::AlignLeft, false, "addr_country");
  list()->addColumn(tr("Postal Code"),         75, Qt::AlignLeft, false, "addr_postalcode");

  list()->setSelectionMode(QAbstractItemView::ExtendedSelection);

  setupCharacteristics(characteristic::Contacts);
  parameterWidget()->applyDefaultFilterSet();

  QToolButton * attachBtn = new QToolButton(this);
  attachBtn->setText(tr("Attach"));
  _attachAct = toolBar()->insertWidget(filterSeparator(), attachBtn);
  _attachAct->setEnabled(false);
  _attachAct->setVisible(false);

  QToolButton * detachBtn = new QToolButton(this);
  detachBtn->setText(tr("Detach"));
  _detachAct = toolBar()->insertWidget(filterSeparator(), detachBtn);
  _detachAct->setEnabled(false);
  _detachAct->setVisible(false);

  connect(attachBtn, SIGNAL(clicked()),      this, SLOT(sAttach()));
  connect(detachBtn, SIGNAL(clicked()),      this, SLOT(sDetach()));

  connect(list(), SIGNAL(itemSelected(int)), this, SLOT(sOpen()));

  if (_privileges->check("MaintainAllContacts") || _privileges->check("MaintainPersonalContacts"))
  {
    _attachAct->setEnabled(true);
    connect(list(), SIGNAL(valid(bool)), _detachAct, SLOT(setEnabled(bool)));
  }
  else
  {
    newAction()->setEnabled(false);
  }
}
Beispiel #8
0
projects::projects(QWidget* parent, const char*, Qt::WindowFlags fl)
  : display(parent, "projects", fl)
{
  setupUi(optionsWidget());
  setWindowTitle(tr("Projects"));
  setMetaSQLOptions("projects", "detail_nohierarchy");
  setReportName("ProjectsList");
  setParameterWidgetVisible(true);
  setNewVisible(true);
  setSearchVisible(true);
  setQueryOnStartEnabled(true);
  setUseAltId(true);

  //  Project Details
  list()->addColumn(tr("Project"),                        _orderColumn, Qt::AlignLeft,   true,  "prj_number");
  list()->addColumn(tr("Project Name"),                   -1,           Qt::AlignLeft,   true,  "prj_name");
  list()->addColumn(tr("Project Description"),            -1,           Qt::AlignLeft,   true,  "prj_descrip");
  list()->addColumn(tr("Status"),                         _itemColumn,  Qt::AlignCenter, true,  "project_status" );
  list()->addColumn(tr("Project Type"),                   _itemColumn,  Qt::AlignCenter, true,  "project_type" );
  list()->addColumn(tr("Owner"),                          _userColumn,  Qt::AlignLeft,   true,  "prj_owner_username");
  list()->addColumn(tr("Assigned To"),                    _userColumn,  Qt::AlignLeft,   true,  "prj_username");
  list()->addColumn(tr("Account"),                        _userColumn,  Qt::AlignLeft,   true,  "crmacct_name");
  list()->addColumn(tr("Contact"),                        _userColumn,  Qt::AlignLeft,   true,  "cntct_name");
  list()->addColumn(tr("City"),                           -1,           Qt::AlignLeft,   true,  "addr_city");
  list()->addColumn(tr("State"),                          -1,           Qt::AlignLeft,   true,  "addr_state");
  list()->addColumn(tr("Project Due"),                    _dateColumn,  Qt::AlignCenter, true,  "prj_due_date");
  list()->addColumn(tr("Project Assigned"),               _dateColumn,  Qt::AlignCenter, true,  "prj_assigned_date");
  list()->addColumn(tr("Project Started"),                _dateColumn,  Qt::AlignCenter, true,  "prj_start_date");
  list()->addColumn(tr("Project Completed"),              _dateColumn,  Qt::AlignCenter, true,  "prj_completed_date");

  connect(list(), SIGNAL(itemSelected(int)), this, SLOT(sOpen()));

  if (!_privileges->check("MaintainAllProjects") && !_privileges->check("MaintainPersonalProjects"))
    newAction()->setEnabled(false);

  _salesOrders->setChecked(false);
  _workOrders->setChecked(false);
  _purchaseOrders->setChecked(false);
  _incidents->setChecked(false);
  _showHierarchy->setChecked(false);

  connect(omfgThis, SIGNAL(projectsUpdated(int)), this, SLOT(sFillList()));
  connect(_showComplete, SIGNAL(toggled(bool)), this, SLOT(sFillList()));
//  connect(_salesOrders, SIGNAL(toggled(bool)), this, SLOT(sFillList()));
//  connect(_workOrders, SIGNAL(toggled(bool)), this, SLOT(sFillList()));
//  connect(_purchaseOrders, SIGNAL(toggled(bool)), this, SLOT(sFillList()));
//  connect(_incidents, SIGNAL(toggled(bool)), this, SLOT(sFillList()));
//  connect(_showHierarchy, SIGNAL(toggled(bool)), this, SLOT(sBuildList()));
  _ordersGroup->hide();

  QString qryType = QString( "SELECT prjtype_id, prjtype_descr FROM prjtype " );

  QString qryStatus = QString( "SELECT  1, '%1' UNION "
                               "SELECT  2, '%2' UNION "
                               "SELECT  3, '%3'")
  .arg(tr("Complete"))
  .arg(tr("Concept"))
  .arg(tr("In-Process"));
  
  parameterWidget()->append(tr("Owner"), "owner_username", ParameterWidget::User);
  parameterWidget()->append(tr("AssignedTo"), "assigned_username", ParameterWidget::User);
  parameterWidget()->append(tr("Account"), "crmacct_id", ParameterWidget::Crmacct);
  parameterWidget()->append(tr("Contact"), "cntct_id", ParameterWidget::Contact);
  parameterWidget()->appendComboBox(tr("Project Type"), "prjtype_id", qryType);
  parameterWidget()->appendComboBox(tr("Project Status"), "prjstatus_id", qryStatus);
  parameterWidget()->append(tr("Project"), "prj_id", ParameterWidget::Project);
  parameterWidget()->append(tr("Project Task"), "project_task", ParameterWidget::Text);
  parameterWidget()->append(tr("Sales Order"), "cohead_id", ParameterWidget::SalesOrder);
  parameterWidget()->append(tr("Work Order"), "wo_id", ParameterWidget::WorkOrder);
  parameterWidget()->append(tr("Purchase Order"), "pohead_id", ParameterWidget::PurchaseOrder);
  parameterWidget()->append(tr("Start Start Date"), "startStartDate", ParameterWidget::Date, QDate::currentDate());
  parameterWidget()->append(tr("Start End Date"), "startEndDate", ParameterWidget::Date, QDate::currentDate());
  parameterWidget()->append(tr("Due Start Date"), "dueStartDate", ParameterWidget::Date, QDate::currentDate());
  parameterWidget()->append(tr("Due End Date"), "dueEndDate", ParameterWidget::Date, QDate::currentDate());
  parameterWidget()->append(tr("Assigned Start Date"), "assignedStartDate", ParameterWidget::Date, QDate::currentDate());
  parameterWidget()->append(tr("Assigned End Date"), "assignedEndDate", ParameterWidget::Date, QDate::currentDate());
  parameterWidget()->append(tr("Completed Start Date"), "completedStartDate", ParameterWidget::Date, QDate::currentDate());
  parameterWidget()->append(tr("Completed End Date"), "completedEndDate", ParameterWidget::Date, QDate::currentDate());

  setupCharacteristics("PROJ");
          
  _statuses << "None" << "C" << "P" << "O";

//  sBuildList();
}