示例#1
0
contact::contact(QWidget* parent, const char* name, bool modal, Qt::WFlags fl)
    : XDialog(parent, name, modal, fl)
{
  setupUi(this);

  connect(_close,		  SIGNAL(clicked()), this, SLOT(sClose()));
  connect(_deleteCharacteristic,  SIGNAL(clicked()), this, SLOT(sDeleteCharass()));
  connect(_detachUse,		  SIGNAL(clicked()), this, SLOT(sDetachUse()));
  connect(_editCharacteristic,    SIGNAL(clicked()), this, SLOT(sEditCharass()));
  connect(_editUse,  		  SIGNAL(clicked()), this, SLOT(sEditUse()));
  connect(_newCharacteristic,     SIGNAL(clicked()), this, SLOT(sNewCharass()));
  connect(_save,	          SIGNAL(clicked()), this, SLOT(sSave()));
  connect(_uses, SIGNAL(populateMenu(QMenu*,QTreeWidgetItem*)), this, SLOT(sPopulateUsesMenu(QMenu*)));
  connect(_uses, SIGNAL(valid(bool)), this, SLOT(sHandleValidUse(bool)));
  connect(_viewUse,	          SIGNAL(clicked()), this, SLOT(sViewUse()));
  connect(omfgThis,        SIGNAL(vendorsUpdated()), this, SLOT(sFillList()));
  connect(omfgThis,      SIGNAL(prospectsUpdated()), this, SLOT(sFillList()));
  connect(omfgThis,     SIGNAL(warehousesUpdated()), this, SLOT(sFillList()));
  connect(omfgThis, SIGNAL(crmAccountsUpdated(int)), this, SLOT(sFillList()));
  connect(omfgThis, SIGNAL(customersUpdated(int,bool)), this, SLOT(sFillList()));

  _charass->addColumn(tr("Characteristic"), _itemColumn, Qt::AlignLeft );
  _charass->addColumn(tr("Value"),          -1,          Qt::AlignLeft );

  _uses->addColumn(tr("Used by"),         100, Qt::AlignLeft  );
  _uses->addColumn(tr("Number"), _orderColumn, Qt::AlignLeft  );
  _uses->addColumn(tr("Name"),	           -1, Qt::AlignLeft  );
  _uses->addColumn(tr("Role"),	           -1, Qt::AlignLeft  );
  _uses->addColumn(tr("Active"),    _ynColumn, Qt::AlignCenter);

  _activeCache = false;
}
示例#2
0
contact::contact(QWidget* parent, const char* name, bool modal, Qt::WFlags fl)
    : XDialog(parent, name, modal, fl)
{
  setupUi(this);

  connect(_close,		  SIGNAL(clicked()), this, SLOT(sClose()));
  connect(_deleteCharacteristic,  SIGNAL(clicked()), this, SLOT(sDeleteCharass()));
  connect(_detachUse,		  SIGNAL(clicked()), this, SLOT(sDetachUse()));
  connect(_editCharacteristic,    SIGNAL(clicked()), this, SLOT(sEditCharass()));
  connect(_editUse,  		  SIGNAL(clicked()), this, SLOT(sEditUse()));
  connect(_newCharacteristic,     SIGNAL(clicked()), this, SLOT(sNewCharass()));
  connect(_save,	          SIGNAL(clicked()), this, SLOT(sSave()));
  connect(_uses, SIGNAL(populateMenu(QMenu*,QTreeWidgetItem*)), this, SLOT(sPopulateUsesMenu(QMenu*)));
  connect(_uses, SIGNAL(valid(bool)), this, SLOT(sHandleValidUse(bool)));
  connect(_viewUse,	          SIGNAL(clicked()), this, SLOT(sViewUse()));
  connect(omfgThis,        SIGNAL(vendorsUpdated()), this, SLOT(sFillList()));
  connect(omfgThis,      SIGNAL(prospectsUpdated()), this, SLOT(sFillList()));
  connect(omfgThis,     SIGNAL(warehousesUpdated()), this, SLOT(sFillList()));
  connect(omfgThis, SIGNAL(crmAccountsUpdated(int)), this, SLOT(sFillList()));
  connect(omfgThis, SIGNAL(customersUpdated(int,bool)), this, SLOT(sFillList())); 
  connect(_crmAccount, SIGNAL(newId(int)), _contact, SLOT(setSearchAcct(int)));

  _charass->addColumn(tr("Characteristic"), _itemColumn, Qt::AlignLeft, true, "char_name");
  _charass->addColumn(tr("Value"),          -1,          Qt::AlignLeft, true, "charass_value");

  _uses->addColumn(tr("Used by"),         100, Qt::AlignLeft, true, "type");
  _uses->addColumn(tr("Number"), _orderColumn, Qt::AlignLeft, true, "number");
  _uses->addColumn(tr("Name"),	           -1, Qt::AlignLeft, true, "name");
  _uses->addColumn(tr("Role"),	           -1, Qt::AlignLeft, true, "role");
  _uses->addColumn(tr("Active"),    _ynColumn, Qt::AlignCenter,true, "active");

  _activeCache = false;

  _contact->setMinimalLayout(false);
  _contact->setAccountVisible(false);
  _contact->setInitialsVisible(false);
  _contact->setActiveVisible(false);
  _contact->setOwnerVisible(false);
  _contact->setListVisible(false);

  if(!_privileges->check("EditOwner")) _owner->setEnabled(false);
}
示例#3
0
prospects::prospects(QWidget* parent, const char* name, Qt::WFlags fl)
    : QMainWindow(parent, name, fl)
{
    setupUi(this);

    (void)statusBar();

    connect(_delete,	SIGNAL(clicked()),	this, SLOT(sDelete()));
    connect(_edit,	SIGNAL(clicked()),	this, SLOT(sEdit()));
    connect(_new,	SIGNAL(clicked()),	this, SLOT(sNew()));
    connect(_prospect,	SIGNAL(populateMenu(QMenu *, QTreeWidgetItem *)),
						this, SLOT(sPopulateMenu(QMenu*)));
    connect(_view,	SIGNAL(clicked()),	this, SLOT(sView()));

    statusBar()->hide();
    
    if (_privleges->check("MaintainProspectMasters"))
    {
      connect(_prospect, SIGNAL(itemSelected(int)), _edit, SLOT(animateClick()));
      connect(_prospect, SIGNAL(valid(bool)), _edit, SLOT(setEnabled(bool)));
      connect(_prospect, SIGNAL(valid(bool)), _delete, SLOT(setEnabled(bool)));
    }
    else
    {
      _new->setEnabled(FALSE);
      connect(_prospect, SIGNAL(itemSelected(int)), _view, SLOT(animateClick()));
    }

    _prospect->addColumn(tr("Number"),  _orderColumn, Qt::AlignCenter );
    _prospect->addColumn(tr("Name"),    -1,           Qt::AlignLeft   );
    _prospect->addColumn(tr("Address"), 175,          Qt::AlignLeft   );
    _prospect->addColumn(tr("Phone #"), 100,          Qt::AlignLeft   );

    connect(omfgThis, SIGNAL(prospectsUpdated()), SLOT(sFillList()));

    sFillList();
}
示例#4
0
SetResponse searchForCRMAccount::set(const ParameterList& pParams)
{
  QVariant	param;
  bool		valid;

  param = pParams.value("crmaccnt_subtype", &valid);
  if (valid)
  {
    if (param == "crmacct")
    {
      _subtype = CRMACCT;
    }
    else if (param == "competitor")	// for now just use crmacct
    {
      _subtype = COMPETITOR;
      setWindowTitle(tr("Search For Competitor CRM Accoun"));
    }
    else if (param == "partner")	// for now just use crmacct
    {
      _subtype = PARTNER;
      setWindowTitle(tr("Search For Partner CRM Accoun"));
    }
    else
    {
      disconnect(omfgThis, SIGNAL(crmAccountsUpdated(int)), this, SLOT(sFillList()));
      disconnect(_crmacct, SIGNAL(valid(bool)),	        _edit, SLOT(setEnabled(bool)));
      disconnect(_crmacct, SIGNAL(itemSelected(int)),   _edit, SLOT(animateClick()));
      disconnect(_crmacct, SIGNAL(itemSelected(int)),   _view, SLOT(animateClick()));
      const char* updateSignal = 0;

      if (param == "cust")
      {
	_subtype = CUST;
	_editpriv = _privleges->check("MaintainCustomerMasters");
	_viewpriv = _privleges->check("ViewCustomerMasters");
	setWindowTitle(tr("Search For Customer"));
	_searchNumber->setText(tr("Customer Number"));
	_searchName->setText(tr("Customer Name"));
	_searchContact->setText(tr("Billing Contact Name"));
	_searchPhone->setText(tr("Billing Contact Phone #"));
	_addressLit->setText(tr("Billing Contact Address:"));
	_showInactive->setText(tr("Show Inactive Customers"));
	updateSignal = SIGNAL(customersUpdated(int, bool));
      }
      else if (param == "prospect")
      {
	_subtype = PROSPECT;
	_editpriv = _privleges->check("MaintainProspects");
	_viewpriv = _privleges->check("ViewProspects");
	setWindowTitle(tr("Search For Prospect"));
	_searchNumber->setText(tr("Prospect Number"));
	_searchName->setText(tr("Prospect Name"));
	_showInactive->setText(tr("Show Inactive Prospects"));
	updateSignal = SIGNAL(prospectsUpdated());
      }
      else if (param == "taxauth")
      {
	_subtype = TAXAUTH;
	_editpriv = _privleges->check("MaintainTaxAuthorities");
	_viewpriv = _privleges->check("ViewTaxAuthorities");
	setWindowTitle(tr("Search For Tax Authority"));
	_searchNumber->setText(tr("Tax Authority Code"));
	_searchName->setText(tr("Tax Authority Name"));
	_searchContact->setVisible(false);
	_searchPhone->setVisible(false);
	_addressLit->setText(tr("Tax Authority Address:"));
	_showInactive->setText(tr("Show Inactive Tax Authorities"));
	_crmacct->hideColumn(2);
	_crmacct->hideColumn(3);
	_crmacct->hideColumn(4);
	_showInactive->setVisible(false);
	updateSignal = SIGNAL(taxAuthsUpdated(int));
      }
示例#5
0
crmaccount::crmaccount(QWidget* parent, const char* name, Qt::WFlags fl)
    : XWidget(parent, name, fl)
{
  setupUi(this);

  _todoList = new todoList(this, "todoList", Qt::Widget);
  _todoListTab->layout()->addWidget(_todoList);
  _todoList->setCloseVisible(false);
  _todoList->list()->hideColumn("crmacct_number");
  _todoList->list()->hideColumn("crmacct_name");
  _todoList->parameterWidget()->setDefault(tr("Assigned"), QVariant(), true);
  _todoList->setParameterWidgetVisible(false);
  _todoList->setQueryOnStartEnabled(false);
  
  _contacts = new contacts(this, "contacts", Qt::Widget);
  _allPage->layout()->addWidget(_contacts);
  _contacts->setCloseVisible(false);
  _contacts->list()->hideColumn("crmacct_number");
  _contacts->list()->hideColumn("crmacct_name");
  _contacts->setParameterWidgetVisible(false);
  _contacts->setQueryOnStartEnabled(false);
  
  _oplist = new opportunityList(this, "opportunityList", Qt::Widget);
  _oplistTab->layout()->addWidget(_oplist);
  _oplist->setCloseVisible(false);
  _oplist->list()->hideColumn("crmacct_number");
  _oplist->parameterWidget()->setDefault(tr("User"), QVariant(), true);
  _oplist->setParameterWidgetVisible(false);
  _oplist->setQueryOnStartEnabled(false);
    
  if(!_privileges->check("EditOwner")) _owner->setEnabled(false);

  _owner->setUsername(omfgThis->username());
  _owner->setType(UsernameLineEdit::UsersActive);
    
  connect(_close,		SIGNAL(clicked()), this, SLOT(sClose()));
  connect(_competitor,		SIGNAL(clicked()), this, SLOT(sCompetitor()));
  connect(_deleteCharacteristic,SIGNAL(clicked()), this, SLOT(sDeleteCharacteristic()));
  connect(_deleteReg,		SIGNAL(clicked()), this, SLOT(sDeleteReg()));
  connect(_editCharacteristic,	SIGNAL(clicked()), this, SLOT(sEditCharacteristic()));
  connect(_editReg,		SIGNAL(clicked()), this, SLOT(sEditReg()));
  connect(_newCharacteristic,	SIGNAL(clicked()), this, SLOT(sNewCharacteristic()));
  connect(_newReg,		SIGNAL(clicked()), this, SLOT(sNewReg()));
  connect(_partner,		SIGNAL(clicked()), this, SLOT(sPartner()));
  connect(_prospectButton,	SIGNAL(clicked()), this, SLOT(sProspect()));
  connect(_save,		SIGNAL(clicked()), this, SLOT(sSave()));
  connect(_taxauthButton,	SIGNAL(clicked()), this, SLOT(sTaxAuth()));
  connect(omfgThis, SIGNAL(customersUpdated(int, bool)), this, SLOT(sUpdateRelationships()));
  connect(omfgThis, SIGNAL(prospectsUpdated()),  this, SLOT(sUpdateRelationships()));
  connect(omfgThis, SIGNAL(taxAuthsUpdated(int)),this, SLOT(sUpdateRelationships()));
  connect(omfgThis, SIGNAL(vendorsUpdated()),    this, SLOT(sUpdateRelationships()));
  connect(_customer, SIGNAL(toggled(bool)), this, SLOT(sCustomerToggled()));
  connect(_prospect, SIGNAL(toggled(bool)), this, SLOT(sProspectToggled()));
  connect(_number, SIGNAL(lostFocus()), this, SLOT(sCheckNumber()));
  connect(_primaryButton, SIGNAL(toggled(bool)), this, SLOT(sHandleButtons())); 	 
  connect(_secondaryButton, SIGNAL(toggled(bool)), this, SLOT(sHandleButtons())); 	 
  connect(_allButton, SIGNAL(toggled(bool)), this, SLOT(sHandleButtons()));
  connect(_customerButton, SIGNAL(clicked()), this, SLOT(sCustomer()));
  connect(_vendorButton, SIGNAL(clicked()), this, SLOT(sEditVendor()));
  connect(_contacts, SIGNAL(cntctDetached(int)), this, SLOT(sHandleCntctDetach(int)));

  _charass->addColumn(tr("Characteristic"), _itemColumn, Qt::AlignLeft, true, "char_name");
  _charass->addColumn(tr("Value"),          -1,          Qt::AlignLeft, true, "charass_value");
  
  _reg->addColumn(tr("Lot/Serial")  ,  _itemColumn,  Qt::AlignLeft, true, "ls_number" );
  _reg->addColumn(tr("Item")        ,  _itemColumn,  Qt::AlignLeft, true, "item_number" );
  _reg->addColumn(tr("Description") ,  -1,  	     Qt::AlignLeft, true, "item_descrip1" );
  _reg->addColumn(tr("Qty"       )  ,  _qtyColumn,   Qt::AlignLeft, true, "lsreg_qty" );
  _reg->addColumn(tr("Sold"        ),  _dateColumn,  Qt::AlignLeft, true, "lsreg_solddate" );
  _reg->addColumn(tr("Registered"  ),  _dateColumn,  Qt::AlignLeft, true, "lsreg_regdate" );
  _reg->addColumn(tr("Expires"   )  ,  _dateColumn,  Qt::AlignLeft, true, "lsreg_expiredate" );

  if (_preferences->boolean("XCheckBox/forgetful"))
    _active->setChecked(true);

  _NumberGen    = -1;
  _mode		= cNew;
  _crmacctId    = -1;
  _competitorId	= -1;
  _custId       = -1;
  _partnerId    = -1;
  _prospectId   = -1;
  _taxauthId    = -1;
  _vendId       = -1;
  _comments->setId(-1);
  _documents->setId(-1);
  _modal        = false;
  
  if (!_metrics->boolean("LotSerialControl"))
    _tab->removeTab(_tab->indexOf(_registrationsTab));

}