project::project(QWidget* parent, const char* name, bool modal, Qt::WFlags fl) : XDialog(parent, name, modal, fl) { setupUi(this); if(!_privileges->check("EditOwner")) _owner->setEnabled(false); connect(_close, SIGNAL(clicked()), this, SLOT(sClose())); connect(_save, SIGNAL(clicked()), this, SLOT(sSave())); connect(_printTasks, SIGNAL(clicked()), this, SLOT(sPrintTasks())); connect(_newTask, SIGNAL(clicked()), this, SLOT(sNewTask())); connect(_editTask, SIGNAL(clicked()), this, SLOT(sEditTask())); connect(_viewTask, SIGNAL(clicked()), this, SLOT(sViewTask())); connect(_deleteTask, SIGNAL(clicked()), this, SLOT(sDeleteTask())); connect(_number, SIGNAL(lostFocus()), this, SLOT(sNumberChanged())); _prjtask->addColumn( tr("Number"), _itemColumn, Qt::AlignRight, true, "prjtask_number" ); _prjtask->addColumn( tr("Name"), _itemColumn, Qt::AlignLeft, true, "prjtask_name" ); _prjtask->addColumn( tr("Description"), -1, Qt::AlignLeft, true, "prjtask_descrip" ); _owner->setUsername(omfgThis->username()); _assignedTo->setUsername(omfgThis->username()); _owner->setType(UsernameLineEdit::UsersActive); _assignedTo->setType(UsernameLineEdit::UsersActive); _saved=false; populate(); }
project::project(QWidget* parent, const char* name, bool modal, Qt::WFlags fl) : XDialog(parent, name, modal, fl) { setupUi(this); if(!_privileges->check("EditOwner")) _owner->setEnabled(false); connect(_buttonBox, SIGNAL(rejected()), this, SLOT(sClose())); connect(_buttonBox, SIGNAL(accepted()), this, SLOT(sSave())); connect(_printTasks, SIGNAL(clicked()), this, SLOT(sPrintTasks())); connect(_newTask, SIGNAL(clicked()), this, SLOT(sNewTask())); connect(_editTask, SIGNAL(clicked()), this, SLOT(sEditTask())); connect(_viewTask, SIGNAL(clicked()), this, SLOT(sViewTask())); connect(_deleteTask, SIGNAL(clicked()), this, SLOT(sDeleteTask())); connect(_number, SIGNAL(lostFocus()), this, SLOT(sNumberChanged())); connect(_activity, SIGNAL(clicked()), this, SLOT(sActivity())); _prjtask->addColumn( tr("Number"), _itemColumn, Qt::AlignRight, true, "prjtask_number" ); _prjtask->addColumn( tr("Name"), _itemColumn, Qt::AlignLeft, true, "prjtask_name" ); _prjtask->addColumn( tr("Description"), -1, Qt::AlignLeft, true, "prjtask_descrip" ); _prjtask->addColumn( tr("Hours Balance"), _itemColumn, Qt::AlignRight, true, "prjtaskhrbal" ); _prjtask->addColumn( tr("Expense Balance"), _itemColumn, Qt::AlignRight, true, "prjtaskexpbal" ); _owner->setUsername(omfgThis->username()); _assignedTo->setUsername(omfgThis->username()); _owner->setType(UsernameLineEdit::UsersActive); _assignedTo->setType(UsernameLineEdit::UsersActive); _totalHrBud->setPrecision(omfgThis->qtyVal()); _totalHrAct->setPrecision(omfgThis->qtyVal()); _totalHrBal->setPrecision(omfgThis->qtyVal()); _totalExpBud->setPrecision(omfgThis->moneyVal()); _totalExpAct->setPrecision(omfgThis->moneyVal()); _totalExpBal->setPrecision(omfgThis->moneyVal()); _saved=false; populate(); }
project::project(QWidget* parent, const char* name, bool modal, Qt::WFlags fl) : XDialog(parent, name, modal, fl) { setupUi(this); if(!_privileges->check("EditOwner")) _owner->setEnabled(false); connect(_close, SIGNAL(clicked()), this, SLOT(sClose())); connect(_save, SIGNAL(clicked()), this, SLOT(sSave())); connect(_printTasks, SIGNAL(clicked()), this, SLOT(sPrintTasks())); connect(_newTask, SIGNAL(clicked()), this, SLOT(sNewTask())); connect(_editTask, SIGNAL(clicked()), this, SLOT(sEditTask())); connect(_viewTask, SIGNAL(clicked()), this, SLOT(sViewTask())); connect(_deleteTask, SIGNAL(clicked()), this, SLOT(sDeleteTask())); connect(_number, SIGNAL(lostFocus()), this, SLOT(sNumberChanged())); _prjtask->addColumn( tr("Number"), _itemColumn, Qt::AlignRight, true, "prjtask_number" ); _prjtask->addColumn( tr("Name"), _itemColumn, Qt::AlignLeft, true, "prjtask_name" ); _prjtask->addColumn( tr("Description"), -1, Qt::AlignLeft, true, "prjtask_descrip" ); q.prepare("SELECT usr_id " "FROM usr " "WHERE (usr_username=CURRENT_USER);"); q.exec(); if (q.first()) { _owner->setId(q.value("usr_id").toInt()); _assignedTo->setId(q.value("usr_id").toInt()); } else if (q.lastError().type() != QSqlError::NoError) { systemError(this, q.lastError().databaseText(), __FILE__, __LINE__); reject(); } populate(); }
project::project(QWidget* parent, const char* name, bool modal, Qt::WFlags fl) : XDialog(parent, name, modal, fl) { setupUi(this); if(!_privileges->check("EditOwner")) _owner->setEnabled(false); connect(_buttonBox, SIGNAL(rejected()), this, SLOT(sClose())); connect(_buttonBox, SIGNAL(accepted()), this, SLOT(sSave())); connect(_printTasks, SIGNAL(clicked()), this, SLOT(sPrintTasks())); connect(_queryTasks, SIGNAL(clicked()), this, SLOT(sFillTaskList())); connect(_newTask, SIGNAL(clicked()), this, SLOT(sNewTask())); connect(_editTask, SIGNAL(clicked()), this, SLOT(sEditTask())); connect(_viewTask, SIGNAL(clicked()), this, SLOT(sViewTask())); connect(_deleteTask, SIGNAL(clicked()), this, SLOT(sDeleteTask())); connect(_number, SIGNAL(editingFinished()), this, SLOT(sNumberChanged())); connect(_crmacct, SIGNAL(newId(int)), this, SLOT(sCRMAcctChanged(int))); connect(_newCharacteristic, SIGNAL(clicked()), this, SLOT(sNew())); connect(_editCharacteristic, SIGNAL(clicked()), this, SLOT(sEdit())); connect(_deleteCharacteristic, SIGNAL(clicked()), this, SLOT(sDelete())); connect(_prjtask, SIGNAL(populateMenu(QMenu*,QTreeWidgetItem*,int)), this, SLOT(sPopulateMenu(QMenu*, QTreeWidgetItem*))); connect(_showSo, SIGNAL(toggled(bool)), this, SLOT(sFillTaskList())); connect(_showPo, SIGNAL(toggled(bool)), this, SLOT(sFillTaskList())); connect(_showWo, SIGNAL(toggled(bool)), this, SLOT(sFillTaskList())); connect(_showIn, SIGNAL(toggled(bool)), this, SLOT(sFillTaskList())); _charass->addColumn(tr("Characteristic"), _itemColumn, Qt::AlignLeft, true, "char_name" ); _charass->addColumn(tr("Value"), -1, Qt::AlignLeft, true, "charass_value" ); _charass->addColumn(tr("Default"), _ynColumn*2, Qt::AlignCenter, true, "charass_default" ); _prjtask->addColumn(tr("Name"), _itemColumn, Qt::AlignLeft, true, "name" ); _prjtask->addColumn(tr("Status"), _orderColumn, Qt::AlignLeft, true, "status" ); _prjtask->addColumn(tr("Item #"), _itemColumn, Qt::AlignLeft, true, "item" ); _prjtask->addColumn(tr("Description"), -1 , Qt::AlignLeft, true, "descrip" ); _prjtask->addColumn(tr("Account/Customer"), -1 , Qt::AlignLeft, false, "customer" ); _prjtask->addColumn(tr("Contact"), -1 , Qt::AlignLeft, false, "contact" ); _prjtask->addColumn(tr("City"), -1 , Qt::AlignLeft, false, "city" ); _prjtask->addColumn(tr("State"), -1 , Qt::AlignLeft, false, "state" ); _prjtask->addColumn(tr("Qty"), _qtyColumn, Qt::AlignRight, true, "qty" ); _prjtask->addColumn(tr("UOM"), _uomColumn, Qt::AlignLeft, true, "uom" ); _prjtask->addColumn(tr("Value"), _qtyColumn, Qt::AlignRight, true, "value" ); _prjtask->addColumn(tr("Due Date"), _dateColumn, Qt::AlignRight, true, "due" ); _prjtask->addColumn(tr("Assigned"), _dateColumn, Qt::AlignRight, true, "assigned" ); _prjtask->addColumn(tr("Started"), _dateColumn, Qt::AlignRight, true, "started" ); _prjtask->addColumn(tr("Completed"), _dateColumn, Qt::AlignRight, true, "completed" ); _prjtask->addColumn(tr("Hrs. Budget"), _qtyColumn, Qt::AlignRight, true, "hrs_budget" ); _prjtask->addColumn(tr("Hrs. Actual"), _qtyColumn, Qt::AlignRight, true, "hrs_actual" ); _prjtask->addColumn(tr("Hrs. Balance"), _qtyColumn, Qt::AlignRight, true, "hrs_balance" ); _prjtask->addColumn(tr("Exp. Budget"), _priceColumn, Qt::AlignRight, true, "exp_budget" ); _prjtask->addColumn(tr("Exp. Actual"), _priceColumn, Qt::AlignRight, true, "exp_actual" ); _prjtask->addColumn(tr("Exp. Balance"), _priceColumn, Qt::AlignRight, true, "exp_balance" ); _showSo->setChecked(true); _showWo->setChecked(true); _showPo->setChecked(true); _showIn->setChecked(true); _owner->setUsername(omfgThis->username()); _assignedTo->setUsername(omfgThis->username()); _owner->setType(UsernameLineEdit::UsersActive); _assignedTo->setType(UsernameLineEdit::UsersActive); _totalHrBud->setPrecision(omfgThis->qtyVal()); _totalHrAct->setPrecision(omfgThis->qtyVal()); _totalHrBal->setPrecision(omfgThis->qtyVal()); _totalExpBud->setPrecision(omfgThis->moneyVal()); _totalExpAct->setPrecision(omfgThis->moneyVal()); _totalExpBal->setPrecision(omfgThis->moneyVal()); _saved=false; QMenu * newMenu = new QMenu; QAction *menuItem; newMenu->addAction(tr("Task..."), this, SLOT(sNewTask())); newMenu->addSeparator(); menuItem = newMenu->addAction(tr("Quote"), this, SLOT(sNewQuotation())); menuItem->setEnabled(_privileges->check("MaintainQuotes")); menuItem = newMenu->addAction(tr("Sales Order"), this, SLOT(sNewSalesOrder())); menuItem->setEnabled(_privileges->check("MaintainSalesOrders")); menuItem = newMenu->addAction(tr("Purchase Order"), this, SLOT(sNewPurchaseOrder())); menuItem->setEnabled(_privileges->check("MaintainPurchaseOrders")); menuItem = newMenu->addAction(tr("Work Order"), this, SLOT(sNewWorkOrder())); menuItem->setEnabled(_privileges->check("MaintainWorkOrders")); _newTask->setMenu(newMenu); _newTask->setMenu(newMenu); populate(); }
project::project(QWidget* parent, const char* name, bool modal, Qt::WindowFlags fl) : XDialog(parent, name, modal, fl), _prjid(-1) { setupUi(this); XSqlQuery projectType; projectType.prepare("SELECT prjtype_id, prjtype_descr FROM prjtype WHERE prjtype_active;"); projectType.exec(); _projectType->populate(projectType); if (projectType.lastError().type() != QSqlError::NoError) { systemError(this, projectType.lastError().databaseText(), __FILE__, __LINE__); return; } if(!_privileges->check("EditOwner")) _owner->setEnabled(false); connect(_buttonBox, SIGNAL(rejected()), this, SLOT(sClose())); connect(_buttonBox, SIGNAL(accepted()), this, SLOT(sSave())); connect(_queryTasks, SIGNAL(clicked()), this, SLOT(sFillTaskList())); connect(_newTask, SIGNAL(clicked()), this, SLOT(sNewTask())); connect(_editTask, SIGNAL(clicked()), this, SLOT(sEditTask())); connect(_viewTask, SIGNAL(clicked()), this, SLOT(sViewTask())); connect(_deleteTask, SIGNAL(clicked()), this, SLOT(sDeleteTask())); connect(_number, SIGNAL(editingFinished()), this, SLOT(sNumberChanged())); connect(_crmacct, SIGNAL(newId(int)), this, SLOT(sCRMAcctChanged(int))); connect(_prjtask, SIGNAL(populateMenu(QMenu*,QTreeWidgetItem*,int)), this, SLOT(sPopulateMenu(QMenu*, QTreeWidgetItem*))); connect(_showSo, SIGNAL(toggled(bool)), this, SLOT(sFillTaskList())); connect(_showPo, SIGNAL(toggled(bool)), this, SLOT(sFillTaskList())); connect(_showWo, SIGNAL(toggled(bool)), this, SLOT(sFillTaskList())); connect(_showIn, SIGNAL(toggled(bool)), this, SLOT(sFillTaskList())); _charass->setType("PROJ"); _prjtask->addColumn(tr("Name"), _itemColumn, Qt::AlignLeft, true, "name" ); _prjtask->addColumn(tr("Status"), _orderColumn, Qt::AlignLeft, true, "status" ); _prjtask->addColumn(tr("Item #"), _itemColumn, Qt::AlignLeft, true, "item" ); _prjtask->addColumn(tr("Description"), -1 , Qt::AlignLeft, true, "descrip" ); _prjtask->addColumn(tr("Account/Customer"), -1 , Qt::AlignLeft, false, "customer" ); _prjtask->addColumn(tr("Contact"), -1 , Qt::AlignLeft, false, "contact" ); _prjtask->addColumn(tr("City"), -1 , Qt::AlignLeft, false, "city" ); _prjtask->addColumn(tr("State"), -1 , Qt::AlignLeft, false, "state" ); _prjtask->addColumn(tr("Qty"), _qtyColumn, Qt::AlignRight, true, "qty" ); _prjtask->addColumn(tr("UOM"), _uomColumn, Qt::AlignLeft, true, "uom" ); _prjtask->addColumn(tr("Value"), _qtyColumn, Qt::AlignRight, true, "value" ); _prjtask->addColumn(tr("Due Date"), _dateColumn, Qt::AlignRight, true, "due" ); _prjtask->addColumn(tr("Assigned"), _dateColumn, Qt::AlignRight, true, "assigned" ); _prjtask->addColumn(tr("Started"), _dateColumn, Qt::AlignRight, true, "started" ); _prjtask->addColumn(tr("Completed"), _dateColumn, Qt::AlignRight, true, "completed" ); _prjtask->addColumn(tr("Hrs. Budget"), _qtyColumn, Qt::AlignRight, true, "hrs_budget" ); _prjtask->addColumn(tr("Hrs. Actual"), _qtyColumn, Qt::AlignRight, true, "hrs_actual" ); _prjtask->addColumn(tr("Hrs. Balance"), _qtyColumn, Qt::AlignRight, true, "hrs_balance" ); _prjtask->addColumn(tr("Exp. Budget"), _priceColumn, Qt::AlignRight, true, "exp_budget" ); _prjtask->addColumn(tr("Exp. Actual"), _priceColumn, Qt::AlignRight, true, "exp_actual" ); _prjtask->addColumn(tr("Exp. Balance"), _priceColumn, Qt::AlignRight, true, "exp_balance" ); _owner->setUsername(omfgThis->username()); _assignedTo->setUsername(omfgThis->username()); _owner->setType(UsernameLineEdit::UsersActive); _assignedTo->setType(UsernameLineEdit::UsersActive); _totalHrBud->setPrecision(omfgThis->qtyVal()); _totalHrAct->setPrecision(omfgThis->qtyVal()); _totalHrBal->setPrecision(omfgThis->qtyVal()); _totalExpBud->setPrecision(omfgThis->moneyVal()); _totalExpAct->setPrecision(omfgThis->moneyVal()); _totalExpBal->setPrecision(omfgThis->moneyVal()); _saved=false; QMenu * newMenu = new QMenu; QAction *menuItem; newMenu->addAction(tr("Task..."), this, SLOT(sNewTask())); newMenu->addSeparator(); menuItem = newMenu->addAction(tr("Incident"), this, SLOT(sNewIncident())); menuItem->setEnabled(_privileges->check("MaintainPersonalIncidents") || _privileges->check("MaintainAllIncidents")); menuItem = newMenu->addAction(tr("Quote"), this, SLOT(sNewQuotation())); menuItem->setEnabled(_privileges->check("MaintainQuotes")); menuItem = newMenu->addAction(tr("Sales Order"), this, SLOT(sNewSalesOrder())); menuItem->setEnabled(_privileges->check("MaintainSalesOrders")); menuItem = newMenu->addAction(tr("Purchase Order"), this, SLOT(sNewPurchaseOrder())); menuItem->setEnabled(_privileges->check("MaintainPurchaseOrders")); menuItem = newMenu->addAction(tr("Work Order"), this, SLOT(sNewWorkOrder())); menuItem->setEnabled(_privileges->check("MaintainWorkOrders")); _newTask->setMenu(newMenu); QMenu * printMenu = new QMenu; printMenu->addAction(tr("Print Tasks"), this, SLOT(sPrintTasks())); printMenu->addAction(tr("Print Orders"), this, SLOT(sPrintOrders())); _print->setMenu(printMenu); }