QT_BEGIN_NAMESPACE_ORGANIZER

/*!
    \class QOrganizerTodoOccurrence
    \brief The QOrganizerTodoOccurrence class provides an occurrence of a task which should be completed
    \inmodule QtOrganizer
    \ingroup organizer-items

    A todo occurrence is a specific instance of a todo item.  An occurrence
    which is retrieved from a manager may not actually be persisted in that
    manager (for example, it may be generated automatically from the
    recurrence rule of the parent todo stored in the manager), in which case
    it will have a zero-id and differ from the parent todo only in its start
    date.  Alternatively, it may be persisted in the manager (that is, the
    client has saved the occurrence previously) where it is stored as an exception
    to its parent todo.
 */

/*!
    Sets the date time at which the task should be started to \a startDateTime.  For all-day tasks,
    the time part can be set to any valid value.
 */
void QOrganizerTodoOccurrence::setStartDateTime(const QDateTime &startDateTime)
{
    QOrganizerTodoTime ttr = detail(QOrganizerItemDetail::TypeTodoTime);
    ttr.setStartDateTime(startDateTime);
    saveDetail(&ttr);
}
Esempio n. 2
0
QTM_USE_NAMESPACE

/*!
  \class QOrganizerEventOccurrence
  \brief The QOrganizerEventOccurrence class provides an occurrence of an event.
  \inmodule QtOrganizer
  \ingroup organizer-items
  \since 1.1

  An event occurrence is where the occurrence differs from the generating
  event in some way.  An occurrence which is retrieved from a manager may not
  actually be persisted in that manager (for example, it may be generated
  automatically from the recurrence rule of the parent event stored in the
  manager), in which case it will have a zero-id and differ from the parent
  event only in its start date. Alternatively, it may be persisted in the
  manager (that is, the client has saved the occurrence previously) where it
  is stored as an exception to its parent event.
 */

/*!
  Sets the start date time of the event occurrence to \a startDateTime.
  instance).  For all-day events, the time part is meaningless.
  \since 1.1
 */
void QOrganizerEventOccurrence::setStartDateTime(const QDateTime& startDateTime)
{
    QOrganizerEventTime etr = detail<QOrganizerEventTime>();
    etr.setStartDateTime(startDateTime);
    saveDetail(&etr);
}
Esempio n. 3
0
void voucher::sDistributeAll()
{
  saveDetail();
  _poitem->selectAll();
  QList<XTreeWidgetItem*> selected = _poitem->selectedItems();
  for (int i = 0; i < selected.size(); i++)
  {
    q.prepare("SELECT distributeVoucherLine(:vohead_id,:poitem_id,:curr_id) "
              "AS result;");
    q.bindValue(":vohead_id", _voheadid);
    q.bindValue(":poitem_id", ((XTreeWidgetItem*)(selected[i]))->id());
    q.bindValue(":curr_id", _amountToDistribute->id());
    q.exec();
    if (q.first())
    {
      int result = q.value("result").toInt();
      if (result < 0)
        systemError(this,
                    storedProcErrorLookup("distributeVoucherLine", result),
                    __FILE__, __LINE__);
    }
    else if (q.lastError().type() != QSqlError::NoError)
    {
      systemError(this, q.lastError().databaseText(), __FILE__, __LINE__);
      return;
    }
  }
  sFillList();
  sPopulateDistributed();
}
/*!
    Sets the percentage of progress completed on the task described
    by the todo occurrence item to \a percentage. Note that the given
    \a percentage must be between 0 and 100, otherwise ignored.
 */
void QOrganizerTodoOccurrence::setProgressPercentage(int percentage)
{
    if (percentage >= 0 && percentage <= 100) {
        QOrganizerTodoProgress tp = detail(QOrganizerItemDetail::TypeTodoProgress);
        tp.setPercentageComplete(percentage);
        saveDetail(&tp);
    }
}
Esempio n. 5
0
void purchaseOrder::sTaxDetail()
{
  saveDetail();

  ParameterList params;
  params.append("order_id", _poheadid);
  params.append("order_type", "PO");
  // mode => view since there are no fields to hold modified tax data
  if (_mode == cView)
    params.append("mode", "view");

  taxBreakdown newdlg(this, "", TRUE);
  if (newdlg.set(params) == NoError && newdlg.exec() == XDialog::Accepted)
    populate();
}
Esempio n. 6
0
void voucher::sDeleteMiscDistribution()
{
  saveDetail();
  q.prepare( "DELETE FROM voheadtax "
             "WHERE (taxhist_parent_id=:vohead_id) "
			 " AND  (taxhist_taxtype_id=getadjustmenttaxtypeid()) "
			 " AND  (taxhist_tax_id = (SELECT vodist_tax_id FROM vodist WHERE (vodist_id=:vodist_id))); "
	         "DELETE FROM vodist "
             "WHERE (vodist_id=:vodist_id);");

  q.bindValue(":vohead_id", _voheadid);
  q.bindValue(":vodist_id", _miscDistrib->id());
  q.exec();
  sFillMiscList();
  sPopulateDistributed();
}
Esempio n. 7
0
void purchaseOrder::sEdit()
{
  saveDetail();
  
  ParameterList params;
  params.append("pohead_id", _poheadid);
  params.append("poitem_id", _poitem->id());

  if (_mode == cEdit || _mode == cNew)
    params.append("mode", "edit");
  else if (_mode == cView)
    params.append("mode", "view");

  purchaseOrderItem newdlg(this, "", TRUE);
  newdlg.set(params);
  if (newdlg.exec() != XDialog::Rejected)
    sFillList();
}
Esempio n. 8
0
void voucher::sEditMiscDistribution()
{
  saveDetail();
  ParameterList params;
  params.append("mode", "edit");
  params.append("vohead_id", _voheadid);
  params.append("vodist_id", _miscDistrib->id());
  params.append("curr_id", _amountToDistribute->id());
  params.append("curr_effective", _amountToDistribute->effective());
  if (_taxzone->isValid())
    params.append("taxzone_id", _taxzone->id());

  voucherMiscDistrib newdlg(this, "", TRUE);
  newdlg.set(params);
  if (newdlg.exec() != XDialog::Rejected)
  {
    sFillMiscList();
    sPopulateDistributed();
  }
}
Esempio n. 9
0
QTM_USE_NAMESPACE

/*!
  \class QOrganizerJournal
  \brief The QOrganizerJournal class supplies a journal which is associated with a particular point in time
  \inmodule QtOrganizer
  \ingroup organizer-items
  \since 1.1

  A journal consists of personal data which is associated with a particular point in time.
 */

/*!
  Sets the date time which this journal is associated with to \a dateTime
  \since 1.1
 */
void QOrganizerJournal::setDateTime(const QDateTime& dateTime)
{
    QOrganizerJournalTime jtr = detail<QOrganizerJournalTime>();
    jtr.setEntryDateTime(dateTime);
    saveDetail(&jtr);
}
Esempio n. 10
0
QTM_USE_NAMESPACE

/*!
  \class QOrganizerEvent
  \brief The QOrganizerEvent class provides an event in time which may reoccur
  \inmodule QtOrganizer
  \ingroup organizer-items

  A QOrganizerEvent is an item which occurs at a particular point in time
  and may be associated with a location or have other details.  It may have
  a set of recurrence rules or dates on which the event occurs associated
  with it, and also exceptions to those recurrences.
 */

/*! Sets the start date time of the event to \a startDateTime (for recurring events, this applies to
 * the first instance).  For all-day events, the time part can be set to any valid value. */
void QOrganizerEvent::setStartDateTime(const QDateTime& startDateTime)
{
    QOrganizerEventTime etr = detail<QOrganizerEventTime>();
    etr.setStartDateTime(startDateTime);
    saveDetail(&etr);
}
Esempio n. 11
0
void voucher::sDistributions()
{
  saveDetail();
  QList<XTreeWidgetItem*> selected = _poitem->selectedItems();
  for (int i = 0; i < selected.size(); i++)
  {
      ParameterList params;
      params.append("mode", "new");
      params.append("vohead_id", _voheadid);
      params.append("poitem_id",  ((XTreeWidgetItem*)(selected[i]))->id());
      params.append("curr_id", _amountToDistribute->id());
      params.append("effective", _amountToDistribute->effective());

      voucherItem newdlg(this, "", TRUE);
      newdlg.set(params);
      if (newdlg.exec() == XDialog::Rejected)
      {
        // nothing to do:
        // voucherItem wraps itself in a transaction and rolls back on reject
    }
  }
  sFillList();
  sPopulateDistributed();
}
Esempio n. 12
0
/*!
    Sets the date at which this occurrence was originally going to occur,
    to the given \a date.
 */
void QOrganizerTodoOccurrence::setOriginalDate(const QDate &date)
{
    QOrganizerItemParent origin = detail(QOrganizerItemDetail::TypeParent);
    origin.setOriginalDate(date);
    saveDetail(&origin);
}
Esempio n. 13
0
/*!
    Sets the todo occurrence's parent to be the todo identified by the
    given \a parentId.
 */
void QOrganizerTodoOccurrence::setParentId(const QOrganizerItemId &parentId)
{
    QOrganizerItemParent origin = detail(QOrganizerItemDetail::TypeParent);
    origin.setParentId(parentId);
    saveDetail(&origin);
}
Esempio n. 14
0
/*!
  Sets the end date time of the event occurrence to \a endDateTime.
  For all-day events, the time part can be set to any valid value, and the date is to be interpreted
  as the inclusive end date.
  \since 1.1
 */
void QOrganizerEventOccurrence::setEndDateTime(const QDateTime& endDateTime)
{
    QOrganizerEventTime etr = detail<QOrganizerEventTime>();
    etr.setEndDateTime(endDateTime);
    saveDetail(&etr);
}
Esempio n. 15
0
/*! Sets the given list of recurrence rules \a exrules to be the rules which define when
    the event does not occur.  Any previously specified exception rules will be cleared
    when this function is called. */
void QOrganizerEvent::setExceptionRules(const QSet<QOrganizerRecurrenceRule>& exrules)
{
    QOrganizerItemRecurrence rec = detail<QOrganizerItemRecurrence>();
    rec.setExceptionRules(exrules);
    saveDetail(&rec);
}
Esempio n. 16
0
/*!
  Sets the label of the location at which the event occurrence is held to \a location
  \since 1.1
 */
void QOrganizerEventOccurrence::setLocation(const QString& location)
{
    QOrganizerItemLocation ld = detail<QOrganizerItemLocation>();
    ld.setLabel(location);
    saveDetail(&ld);
}
Esempio n. 17
0
/*! Sets the list of dates \a rdates to be dates on which the event occurs */
void QOrganizerEvent::setRecurrenceDates(const QSet<QDate>& rdates)
{
    QOrganizerItemRecurrence rec = detail<QOrganizerItemRecurrence>();
    rec.setRecurrenceDates(rdates);
    saveDetail(&rec);
}
Esempio n. 18
0
/*!
    Sets the progress status of the todo occurrence to \a status.
 */
void QOrganizerTodoOccurrence::setStatus(QOrganizerTodoProgress::Status status)
{
    QOrganizerTodoProgress tp = detail(QOrganizerItemDetail::TypeTodoProgress);
    tp.setStatus(status);
    saveDetail(&tp);
}
Esempio n. 19
0
/*!
    Sets the priority of the todo occurrence to \a priority.
 */
void QOrganizerTodoOccurrence::setPriority(QOrganizerItemPriority::Priority priority)
{
    QOrganizerItemPriority pd = detail(QOrganizerItemDetail::TypePriority);
    pd.setPriority(priority);
    saveDetail(&pd);
}
Esempio n. 20
0
/*!
    Sets the label of the location at which the event occurrence is held to \a label.
 */
void QOrganizerEventOccurrence::setLocation(const QString &label)
{
    QOrganizerItemLocation ld = detail(QOrganizerItemDetail::TypeLocation);
    ld.setLabel(label);
    saveDetail(&ld);
}
Esempio n. 21
0
/*!
  Sets the event occurrence's parent to be the event identified by the
  given \a parentId
  \since 1.1
 */
void QOrganizerEventOccurrence::setParentId(const QOrganizerItemId& parentId)
{
    QOrganizerItemParent origin = detail<QOrganizerItemParent>();
    origin.setParentId(parentId);
    saveDetail(&origin);
}
Esempio n. 22
0
/*!
  Sets the date at which this occurrence was originally going to occur,
  to the given \a date.
  \since 1.1
 */
void QOrganizerEventOccurrence::setOriginalDate(const QDate& date)
{
    QOrganizerItemParent origin = detail<QOrganizerItemParent>();
    origin.setOriginalDate(date);
    saveDetail(&origin);
}
Esempio n. 23
0
/*!
    Sets the date and time at which the task described by the todo occurrence was completed to \a finishedDateTime.
 */
void QOrganizerTodoOccurrence::setFinishedDateTime(const QDateTime &finishedDateTime)
{
    QOrganizerTodoProgress tp = detail(QOrganizerItemDetail::TypeTodoProgress);
    tp.setFinishedDateTime(finishedDateTime);
    saveDetail(&tp);
}
Esempio n. 24
0
/*!
  Sets the priority of the event occurrence to \a priority
  \since 1.1
 */
void QOrganizerEventOccurrence::setPriority(QOrganizerItemPriority::Priority priority)
{
    QOrganizerItemPriority pd = detail<QOrganizerItemPriority>();
    pd.setPriority(priority);
    saveDetail(&pd);
}
Esempio n. 25
0
/*!
    Sets the date time by which the task should be completed to \a dueDateTime.  For all-day tasks,
    the time part can be set to any valid value.
 */
void QOrganizerTodoOccurrence::setDueDateTime(const QDateTime &dueDateTime)
{
    QOrganizerTodoTime ttr = detail(QOrganizerItemDetail::TypeTodoTime);
    ttr.setDueDateTime(dueDateTime);
    saveDetail(&ttr);
}
Esempio n. 26
0
/*!
  Sets whether the time-of-day component of the event's start date-time or end date-time is
  insignificant (eg. this is generally set to true for a birthday).  If \a isAllDay is true,
  the time-of-day component is considered insignificant, and the event will be an all-day
  item.
 */
void QOrganizerEvent::setAllDay(bool isAllDay)
{
    QOrganizerEventTime etr = detail<QOrganizerEventTime>();
    etr.setAllDay(isAllDay);
    saveDetail(&etr);
}