~rowinggolfer/openmolar/openmolar1

« back to all changes in this revision

Viewing changes to src/openmolar/qt4gui/diary_widget.py

  • Committer: rowinggolfer
  • Date: 2016-12-28 10:45:28 UTC
  • mfrom: (1401.1.1)
  • Revision ID: git-v1:e6eb4d49ce9cfafbdbc7ea27670435e1a65df469
Merge branch 'master' of /home/neil/openmolar/openmolar1 into webview

Show diffs side-by-side

added added

removed removed

Lines of Context:
26
26
'''
27
27
 
28
28
import datetime
 
29
import gettext
29
30
import logging
30
31
import time
31
32
 
42
43
 
43
44
from openmolar.qt4gui.dialogs import alterAday
44
45
from openmolar.qt4gui.dialogs import finalise_appt_time
45
 
from openmolar.qt4gui.dialogs import permissions
46
46
from openmolar.qt4gui.dialogs.choose_clinicians import ChooseCliniciansDialog
47
47
from openmolar.qt4gui.dialogs.find_patient_dialog import FinalChoiceDialog
48
48
from openmolar.qt4gui.dialogs.appointments_insert_blocks_dialog \
97
97
 
98
98
    message_alert = None
99
99
    laid_out = False
 
100
    current_weekViewClinicians = set()
100
101
 
101
102
    def __init__(self, parent=None):
102
103
        Advisor.__init__(self, parent)
144
145
                     self.ui.day4_frame,
145
146
                     self.ui.day5_frame,
146
147
                     self.ui.day6_frame,
147
 
                     self.ui.day7_frame
148
 
                     ):
 
148
                     self.ui.day7_frame):
149
149
            hlayout = QtWidgets.QHBoxLayout(widg)
150
150
            hlayout.setContentsMargins(0, 0, 0, 0)
151
151
            control = aptOVcontrol.control()
342
342
        '''
343
343
        radiobutton toggling who's book to show on the appointment
344
344
        '''
345
 
        self.dl = ChooseCliniciansDialog(self.monthClinicianSelector, self)
346
 
        self.dl.exec_()
 
345
        dl = ChooseCliniciansDialog(self.monthClinicianSelector, self)
 
346
        dl.exec_()
347
347
        val = self.monthClinicianSelector.allChecked()
348
348
        self.ui.monthClinicians_checkBox.setChecked(val)
349
349
        self.ui.yearClinicians_checkBox.setChecked(val)
497
497
 
498
498
            # - make appointment
499
499
            if appointments.make_appt(
500
 
                slot.date(), selectedDent, selectedtime, endtime,
501
 
                appt.name[:30], appt.serialno, appt.trt1,
 
500
                    slot.date(), selectedDent, selectedtime, endtime,
 
501
                    appt.name[:30], appt.serialno, appt.trt1,
502
502
                    appt.trt2, appt.trt3, appt.memo, appt.flag, cst, 0, 0):
503
503
                LOGGER.info("Appointment made in aslot")
504
504
 
505
505
                if appt.serialno != 0:
506
506
                    if not appointments.pt_appt_made(
507
 
                        appt.serialno, appt.aprix, slot.date(),
 
507
                            appt.serialno, appt.aprix, slot.date(),
508
508
                            selectedtime, selectedDent):
509
509
                        self.advise(
510
510
                            _("Error putting appointment back "
1072
1072
        if triggered and chosen_slot:
1073
1073
            sync_date = QtCore.QDate(chosen_slot.date())
1074
1074
 
1075
 
            LOGGER.debug("chosen_slot changed %s" % chosen_slot)
 
1075
            LOGGER.debug("chosen_slot changed %s", chosen_slot)
1076
1076
            self.signals_calendar(False)
1077
1077
            self.ui.weekCalendar.setSelectedDate(sync_date)
1078
1078
            self.set_date(sync_date)
1272
1272
            self.selected_date().toPyDate(),
1273
1273
            droptime)
1274
1274
 
1275
 
        LOGGER.debug("appt dropped %s %s %s" % (date_time, dent, appt.length))
 
1275
        LOGGER.debug("appt dropped %s %s %s", date_time, dent, appt.length)
1276
1276
        slot = appointments.FreeSlot(date_time, dent, appt.length)
1277
1277
        self.makeAppt(appt, slot)
1278
1278
 
1288
1288
        self.begin_makeAppt(custom)
1289
1289
 
1290
1290
    def find_appt(self, appt):
1291
 
        LOGGER.debug("DiaryWidgetfind_appt %s" % appt)
 
1291
        LOGGER.debug("DiaryWidgetfind_appt %s", appt)
1292
1292
        pt = BriefPatient(appt.serialno)
1293
1293
        self.load_patient(pt)
1294
1294
        self.set_appt_mode(self.VIEW_MODE)
1590
1590
 
1591
1591
if __name__ == "__main__":
1592
1592
    LOGGER.setLevel(logging.DEBUG)
1593
 
    import gettext
1594
1593
    gettext.install("openmolar")
1595
1594
 
1596
1595
    localsettings.initiate()
1597
1596
 
1598
 
    app = QtWidgets.QApplication([])
 
1597
    q_app = QtWidgets.QApplication([])
1599
1598
    mw = _testDiary()
1600
1599
    mw.show()
1601
1600
 
1602
 
    app.exec_()
 
1601
    q_app.exec_()