Changeset eb21333 for src


Ignore:
Timestamp:
01/28/10 15:06:32 (12 years ago)
Author:
pavelpa <pavelpa@…>
Branches:
master, qt5
Children:
872aeaa
Parents:
ac787b7
Message:

fixed 'conflicts' constrains

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/mvc/event.cpp

    rac787b7 reb21333  
    7474    Event event = Event::getById(aEventId,conferenceId);
    7575    query.prepare(selectQuery() + "WHERE xid_conference = :conf AND ( \
    76            ( start < :start1 AND ( start + duration ) > :start2 ) \
    77         OR ( start > :start3 AND ( start + duration ) < :end1 ) \
    78         OR ( start < :end2  AND ( start + duration ) > :end3 ) ) AND favourite = 1 AND NOT id = :id ORDER BY start");
     76           ( start >= :s1 AND ( start + duration ) < :e1 ) \
     77        OR ( ( start + duration ) > :s2 AND start < :e2 ) ) \
     78        AND favourite = 1 AND NOT id = :id ORDER BY start");
    7979    query.bindValue(":conf", event.conferenceId());
    80     query.bindValue(":start1", convertToDb(event.start(), QVariant::DateTime));
    81     query.bindValue(":start2", convertToDb(event.start(), QVariant::DateTime));
    82     query.bindValue(":start3", convertToDb(event.start(), QVariant::DateTime));
    83     query.bindValue(":end1", convertToDb(event.start().toTime_t()+event.duration(), QVariant::DateTime));
    84     query.bindValue(":end2", convertToDb(event.start().toTime_t()+event.duration(), QVariant::DateTime));
    85     query.bindValue(":end3", convertToDb(event.start().toTime_t()+event.duration(), QVariant::DateTime));
     80    query.bindValue(":s1", convertToDb(event.start(), QVariant::DateTime));
     81    query.bindValue(":e1", convertToDb(event.start().toTime_t()+event.duration(), QVariant::DateTime));
     82    query.bindValue(":s2", convertToDb(event.start(), QVariant::DateTime));
     83    query.bindValue(":e2", convertToDb(event.start().toTime_t()+event.duration(), QVariant::DateTime));
    8684    query.bindValue(":id", event.id());
    8785
Note: See TracChangeset for help on using the changeset viewer.