update to files
This commit is contained in:
@@ -0,0 +1,54 @@
|
|||||||
|
Message-ID: <987b46cf-2d8b-4a27-acb3-c50f61d3d85d@ph-freiburg.de>
|
||||||
|
Date: Tue, 31 Oct 2023 11:38:34 +0100
|
||||||
|
MIME-Version: 1.0
|
||||||
|
User-Agent: Mozilla Thunderbird
|
||||||
|
From: Alexander Kirchner <alexander.kirchner@ph-freiburg.de>
|
||||||
|
Subject: =?UTF-8?Q?Information_bez=C3=BCglich_der_Aufl=C3=B6sung_des_Semeste?=
|
||||||
|
=?UTF-8?Q?rapparates_=7BAppNr=7D?=
|
||||||
|
Content-Language: de-DE
|
||||||
|
X-Mozilla-Draft-Info: internal/draft; vcard=0; receipt=0; DSN=0; uuencode=0;
|
||||||
|
attachmentreminder=0; deliveryformat=0
|
||||||
|
X-Identity-Key: id1
|
||||||
|
Fcc: imap://aky547@imap.ph-freiburg.de/INBOX/Sent
|
||||||
|
Content-Type: text/html; charset=UTF-8
|
||||||
|
Content-Transfer-Encoding: 8bit
|
||||||
|
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<p>Sehr geehrte/r {Profname}, <br>
|
||||||
|
</p>
|
||||||
|
<p><br>
|
||||||
|
</p>
|
||||||
|
auf die E-Mail bezüglich der Auflösung oder Verlängerung der
|
||||||
|
Semesterapparate haben wir von Ihnen keine Rückmeldung erhalten.
|
||||||
|
Deshalb gehen wir davon aus, dass der Apparat aufgelöst werden kann.
|
||||||
|
Die Medien, die im Apparat aufgestellt waren, werden nun wieder
|
||||||
|
regulär ausleihbar und sind dann an ihren Standorten bei den Fächern
|
||||||
|
zu finden. <br>
|
||||||
|
<br>
|
||||||
|
Falls Sie den Apparat erneut, oder einen neuen Apparat anlegen
|
||||||
|
wollen, können Sie mir das ausgefüllte Formular zur Einrichtung des
|
||||||
|
Apparates (<a class="moz-txt-link-freetext"
|
||||||
|
href="https://www.ph-freiburg.de/bibliothek/lernen/semesterapparate/info-lehrende-sem.html">https://www.ph-freiburg.de/bibliothek/lernen/semesterapparate/info-lehrende-sem.html</a>)
|
||||||
|
zukommen lassen. Im Falle einer Verlängerung des Apparates reicht
|
||||||
|
eine Antwort auf diese Mail.
|
||||||
|
<p><br>
|
||||||
|
</p>
|
||||||
|
<p>Bei Fragen können Sie sich jederzeit an mich wenden.<br>
|
||||||
|
</p>
|
||||||
|
<p><br>
|
||||||
|
</p>
|
||||||
|
<pre class="moz-signature" cols="72">--
|
||||||
|
Freundliche Grüße
|
||||||
|
|
||||||
|
Alexander Kirchner
|
||||||
|
|
||||||
|
|
||||||
|
Bibliothek der Pädagogischen Hochschule Freiburg
|
||||||
|
Tel. 0761/682-778</pre>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
@@ -0,0 +1,54 @@
|
|||||||
|
Message-ID: <b44248a9-025e-e86c-85d7-5949534f0ac4@ph-freiburg.de>
|
||||||
|
Date: Mon, 17 Jul 2023 12:59:04 +0200
|
||||||
|
MIME-Version: 1.0
|
||||||
|
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
|
||||||
|
Thunderbird/102.13.0
|
||||||
|
Content-Language: de-DE
|
||||||
|
From: {user_name} <{user_mail}>
|
||||||
|
Subject: =?UTF-8?Q?Information_bez=c3=bcglich_der_Aufl=c3=b6sung_des_Semeste?=
|
||||||
|
=?UTF-8?Q?rapparates_=7bAppNr=7d?=
|
||||||
|
X-Mozilla-Draft-Info: internal/draft; vcard=0; receipt=0; DSN=0; uuencode=0;
|
||||||
|
attachmentreminder=0; deliveryformat=0
|
||||||
|
X-Identity-Key: id1
|
||||||
|
Fcc: imap://aky547@imap.ph-freiburg.de/INBOX/Sent
|
||||||
|
Content-Type: text/html; charset=UTF-8
|
||||||
|
Content-Transfer-Encoding: 8bit
|
||||||
|
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
|
||||||
|
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<p>Sehr geehrte/r Herr/Frau {Profname}, <br>
|
||||||
|
</p>
|
||||||
|
<p><br>
|
||||||
|
</p>
|
||||||
|
<p>da Sie nicht auf die Mail bezüglich der Apparatsverlängerung
|
||||||
|
reagiert haben, wird Ihr Semesterapparat nun gelöscht.</p>
|
||||||
|
<p>Dies bedeutet, dass alle Medien, welche im Apparat verzeichnet
|
||||||
|
waren, nun wieder regulär ausleihbar und in den entsprechenden
|
||||||
|
Stockwerken sind.</p>
|
||||||
|
<p><br>
|
||||||
|
</p>
|
||||||
|
<p>Falls Sie den Apparat erneut, oder einen neuen Apparat anlege
|
||||||
|
wollen, können Sie mir das ausgefüllte Formular zur Einrichtung
|
||||||
|
des Apparates
|
||||||
|
(<a class="moz-txt-link-freetext" href="https://www.ph-freiburg.de/bibliothek/lernen/semesterapparate/info-lehrende-sem.html">https://www.ph-freiburg.de/bibliothek/lernen/semesterapparate/info-lehrende-sem.html</a>)
|
||||||
|
zukommen lassen.</p>
|
||||||
|
<p><br>
|
||||||
|
</p>
|
||||||
|
<p>Bei Fragen können Sie sich jederzeit an mich wenden.<br>
|
||||||
|
</p>
|
||||||
|
<p><br>
|
||||||
|
</p>
|
||||||
|
<pre class="moz-signature" cols="72">--
|
||||||
|
Freundliche Grüße
|
||||||
|
|
||||||
|
Alexander Kirchner
|
||||||
|
|
||||||
|
|
||||||
|
Bibliothek der Pädagogischen Hochschule Freiburg
|
||||||
|
Tel. 0761/682-778</pre>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
@@ -0,0 +1,46 @@
|
|||||||
|
Message-ID: <db617c48-29d6-d3d8-a67c-e9a6cf9b5bdb@ph-freiburg.de>
|
||||||
|
Date: Tue, 12 Sep 2023 13:01:35 +0200
|
||||||
|
MIME-Version: 1.0
|
||||||
|
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
|
||||||
|
Thunderbird/102.15.0
|
||||||
|
From: Alexander Kirchner <alexander.kirchner@ph-freiburg.de>
|
||||||
|
Subject: Information zum Semesterapparat {AppNr} - {Appname}
|
||||||
|
Content-Language: de-DE
|
||||||
|
X-Mozilla-Draft-Info: internal/draft; vcard=0; receipt=0; DSN=0; uuencode=0;
|
||||||
|
attachmentreminder=0; deliveryformat=0
|
||||||
|
X-Identity-Key: id1
|
||||||
|
Fcc: imap://aky547@imap.ph-freiburg.de/INBOX/Sent
|
||||||
|
Content-Type: text/html; charset=UTF-8
|
||||||
|
Content-Transfer-Encoding: 8bit
|
||||||
|
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<p>{greeting} {Profname}, <br>
|
||||||
|
</p>
|
||||||
|
<p><br>
|
||||||
|
</p>
|
||||||
|
<p>Ihr Semesterapparat {Appname} wurde angelegt.</p>
|
||||||
|
<p>Unter folgendem Link können Sie die Apparate einsehen:</p>
|
||||||
|
<p><a class="moz-txt-link-freetext"
|
||||||
|
href="https://bsz.ibs-bw.de/aDISWeb/app?service=direct/0/Home/$DirectLink&sp=SOPAC42&sp=SWI00000002&noRedir">https://bsz.ibs-bw.de/aDISWeb/app?service=direct/0/Home/$DirectLink&sp=SOPAC42&sp=SWI00000002&noRedir</a></p>
|
||||||
|
<p>Ihr Apparat ist unter {AppSubject} > {Profname} > {AppNr} {Appname}.<br>
|
||||||
|
</p>
|
||||||
|
<p><br>
|
||||||
|
</p>
|
||||||
|
<p>Noch nicht vorhandene Medien wurden vorgemerkt und werden nach
|
||||||
|
Rückkehr in die Bibliothek eingearbeitet.</p>
|
||||||
|
<p>Bei Fragen können Sie sich per Mail bei mir melden.<br>
|
||||||
|
</p>
|
||||||
|
<pre class="moz-signature" cols="72">--
|
||||||
|
Freundliche Grüße
|
||||||
|
|
||||||
|
Alexander Kirchner
|
||||||
|
|
||||||
|
|
||||||
|
Bibliothek der Pädagogischen Hochschule Freiburg
|
||||||
|
Tel. 0761/682-778</pre>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
@@ -161,8 +161,6 @@ class Ui(Ui_Semesterapparat):
|
|||||||
self.calendarWidget.setObjectName("MessageCalendar")
|
self.calendarWidget.setObjectName("MessageCalendar")
|
||||||
self.calendarWidget.clicked.connect(self.open_reminder)
|
self.calendarWidget.clicked.connect(self.open_reminder)
|
||||||
# assign a context menu to the calendar
|
# assign a context menu to the calendar
|
||||||
self.calendarWidget.setContextMenuPolicy(QtCore.Qt.ContextMenuPolicy.CustomContextMenu)
|
|
||||||
self.calendarWidget.customContextMenuRequested.connect(self.calendar_context_menu)
|
|
||||||
|
|
||||||
self.tableWidget_apparat_media.horizontalHeader().setSectionResizeMode(
|
self.tableWidget_apparat_media.horizontalHeader().setSectionResizeMode(
|
||||||
QtWidgets.QHeaderView.ResizeMode.Stretch
|
QtWidgets.QHeaderView.ResizeMode.Stretch
|
||||||
@@ -839,7 +837,7 @@ class Ui(Ui_Semesterapparat):
|
|||||||
appdata = ApparatData()
|
appdata = ApparatData()
|
||||||
appdata.app_fach = self.app_fach.currentText()
|
appdata.app_fach = self.app_fach.currentText()
|
||||||
appdata.appname = self.app_name.text()
|
appdata.appname = self.app_name.text()
|
||||||
appdata.appnr = self.active_apparat()
|
appdata.appnr = self.active_apparat
|
||||||
appdata.dauerapp = self.check_eternal_app.isChecked()
|
appdata.dauerapp = self.check_eternal_app.isChecked()
|
||||||
appdata.prof_mail = self.prof_mail.text()
|
appdata.prof_mail = self.prof_mail.text()
|
||||||
appdata.prof_tel = self.prof_tel_nr.text()
|
appdata.prof_tel = self.prof_tel_nr.text()
|
||||||
@@ -1037,7 +1035,7 @@ class Ui(Ui_Semesterapparat):
|
|||||||
self.update_documemt_list()
|
self.update_documemt_list()
|
||||||
|
|
||||||
def update_documemt_list(self):
|
def update_documemt_list(self):
|
||||||
app_id = self.active_apparat()
|
app_id = self.active_apparat
|
||||||
prof_id = self.db.getProfId(
|
prof_id = self.db.getProfId(
|
||||||
self.drpdwn_prof_name.currentText().replace(", ", " ")
|
self.drpdwn_prof_name.currentText().replace(", ", " ")
|
||||||
)
|
)
|
||||||
@@ -1129,7 +1127,7 @@ class Ui(Ui_Semesterapparat):
|
|||||||
if data == []:
|
if data == []:
|
||||||
self.confirm_popup("Bitte mindestens ein Medium hinzufügen!")
|
self.confirm_popup("Bitte mindestens ein Medium hinzufügen!")
|
||||||
|
|
||||||
app_id = self.active_apparat()
|
app_id = self.active_apparat
|
||||||
prof_id = self.db.getProfId(self.drpdwn_prof_name.currentText())
|
prof_id = self.db.getProfId(self.drpdwn_prof_name.currentText())
|
||||||
# check if app_id is in database
|
# check if app_id is in database
|
||||||
if not self.db.checkApparatExists(app_id):
|
if not self.db.checkApparatExists(app_id):
|
||||||
@@ -1195,13 +1193,13 @@ class Ui(Ui_Semesterapparat):
|
|||||||
self.avail_status.setText(f"0/{items}")
|
self.avail_status.setText(f"0/{items}")
|
||||||
self.avail_status.show()
|
self.avail_status.show()
|
||||||
books = self.db.getBooks(
|
books = self.db.getBooks(
|
||||||
self.active_apparat(),
|
self.active_apparat,
|
||||||
self.db.getProfId(self.drpdwn_prof_name.currentText()),
|
self.db.getProfId(self.drpdwn_prof_name.currentText()),
|
||||||
deleted=0,
|
deleted=0,
|
||||||
)
|
)
|
||||||
|
|
||||||
# thread = QThread()
|
# thread = QThread()
|
||||||
appnumber = self.active_apparat()
|
appnumber = self.active_apparat
|
||||||
print(links)
|
print(links)
|
||||||
availcheck = AvailChecker(links, appnumber, books=books)
|
availcheck = AvailChecker(links, appnumber, books=books)
|
||||||
# availcheck.moveToThread(thread)
|
# availcheck.moveToThread(thread)
|
||||||
@@ -1227,7 +1225,7 @@ class Ui(Ui_Semesterapparat):
|
|||||||
|
|
||||||
def update_app_media_list(self):
|
def update_app_media_list(self):
|
||||||
deleted = 0 if not self.chkbx_show_del_media.isChecked() else 1
|
deleted = 0 if not self.chkbx_show_del_media.isChecked() else 1
|
||||||
app_id = self.active_apparat()
|
app_id = self.active_apparat
|
||||||
prof_id = self.db.getProfId(self.drpdwn_prof_name.currentText())
|
prof_id = self.db.getProfId(self.drpdwn_prof_name.currentText())
|
||||||
books: list[dict[int, BookData, int]] = self.db.getBooks(
|
books: list[dict[int, BookData, int]] = self.db.getBooks(
|
||||||
app_id, prof_id, deleted
|
app_id, prof_id, deleted
|
||||||
@@ -1315,7 +1313,7 @@ class Ui(Ui_Semesterapparat):
|
|||||||
pass
|
pass
|
||||||
|
|
||||||
def text_to_clipboard(self):
|
def text_to_clipboard(self):
|
||||||
app_id = self.active_apparat()
|
app_id = self.active_apparat
|
||||||
text = f"SQ=select distinct akkey from aupr01 where aufst='{app_id}' union select pr_isn from aks4pd where akruf ='{app_id}'"
|
text = f"SQ=select distinct akkey from aupr01 where aufst='{app_id}' union select pr_isn from aks4pd where akruf ='{app_id}'"
|
||||||
clipboard = QtWidgets.QApplication.clipboard()
|
clipboard = QtWidgets.QApplication.clipboard()
|
||||||
clipboard.setText(text)
|
clipboard.setText(text)
|
||||||
@@ -1344,7 +1342,7 @@ class Ui(Ui_Semesterapparat):
|
|||||||
# set tooltip of row 3 to the file path for each row
|
# set tooltip of row 3 to the file path for each row
|
||||||
self.dokument_list.item(0, 3).setToolTip(file)
|
self.dokument_list.item(0, 3).setToolTip(file)
|
||||||
|
|
||||||
# self.db.insert_file(files, self.active_apparat(), self.db.get_prof_id(self.drpdwn_prof_name.currentText()))
|
# self.db.insert_file(files, self.active_apparat, self.db.get_prof_id(self.drpdwn_prof_name.currentText()))
|
||||||
|
|
||||||
def open_document(self):
|
def open_document(self):
|
||||||
_selected_doc_name = ""
|
_selected_doc_name = ""
|
||||||
@@ -1372,7 +1370,7 @@ class Ui(Ui_Semesterapparat):
|
|||||||
path = path.resolve()
|
path = path.resolve()
|
||||||
os.system(f"open {path}")
|
os.system(f"open {path}")
|
||||||
else:
|
else:
|
||||||
recreateFile(_selected_doc_name,self.active_apparat() ,filetype=_selected_doc_filetype)
|
recreateFile(_selected_doc_name,self.active_apparat ,filetype=_selected_doc_filetype)
|
||||||
# # if ~ in path, replace it with the home directory
|
# # if ~ in path, replace it with the home directory
|
||||||
# if "~" in path:
|
# if "~" in path:
|
||||||
# path = path.replace("~", str(Path.home()))
|
# path = path.replace("~", str(Path.home()))
|
||||||
@@ -1424,7 +1422,7 @@ class Ui(Ui_Semesterapparat):
|
|||||||
delete=False, suffix="." + file_type
|
delete=False, suffix="." + file_type
|
||||||
)
|
)
|
||||||
temp_file.write(
|
temp_file.write(
|
||||||
self.db.getBlob(file_name, int(self.active_apparat()))
|
self.db.getBlob(file_name, int(self.active_apparat))
|
||||||
)
|
)
|
||||||
temp_file.close()
|
temp_file.close()
|
||||||
file = temp_file.name
|
file = temp_file.name
|
||||||
@@ -1437,7 +1435,7 @@ class Ui(Ui_Semesterapparat):
|
|||||||
signatures = csv_to_list(file)
|
signatures = csv_to_list(file)
|
||||||
data = __open_dialog(signatures)
|
data = __open_dialog(signatures)
|
||||||
# get the app_id and prof_id
|
# get the app_id and prof_id
|
||||||
app_id = self.active_apparat()
|
app_id = self.active_apparat
|
||||||
prof_id = self.db.getProfId(self.drpdwn_prof_name.currentText())
|
prof_id = self.db.getProfId(self.drpdwn_prof_name.currentText())
|
||||||
# add the data to the database
|
# add the data to the database
|
||||||
for book in data:
|
for book in data:
|
||||||
@@ -1458,7 +1456,7 @@ class Ui(Ui_Semesterapparat):
|
|||||||
if data == []:
|
if data == []:
|
||||||
return
|
return
|
||||||
# get the app_id and prof_id
|
# get the app_id and prof_id
|
||||||
app_id = self.active_apparat()
|
app_id = self.active_apparat
|
||||||
prof_id = self.db.getProfId(self.drpdwn_prof_name.currentText())
|
prof_id = self.db.getProfId(self.drpdwn_prof_name.currentText())
|
||||||
# add the data to the database
|
# add the data to the database
|
||||||
for book in data:
|
for book in data:
|
||||||
@@ -1477,7 +1475,7 @@ class Ui(Ui_Semesterapparat):
|
|||||||
self.tableWidget_apparate.setToolTip(
|
self.tableWidget_apparate.setToolTip(
|
||||||
"Bitte warten, bis alle Medien hinzugefügt wurden"
|
"Bitte warten, bis alle Medien hinzugefügt wurden"
|
||||||
)
|
)
|
||||||
app_id = self.active_apparat()
|
app_id = self.active_apparat
|
||||||
prof_id = self.db.getProfId(self.drpdwn_prof_name.currentText())
|
prof_id = self.db.getProfId(self.drpdwn_prof_name.currentText())
|
||||||
# check if apparat in database
|
# check if apparat in database
|
||||||
|
|
||||||
@@ -1583,7 +1581,7 @@ class Ui(Ui_Semesterapparat):
|
|||||||
self.confirm_popup("Bitte alle Pflichtfelder ausfüllen!")
|
self.confirm_popup("Bitte alle Pflichtfelder ausfüllen!")
|
||||||
return
|
return
|
||||||
appd = ApparatData()
|
appd = ApparatData()
|
||||||
appd.appnr = self.active_apparat()
|
appd.appnr = self.active_apparat
|
||||||
appd.prof_title = (
|
appd.prof_title = (
|
||||||
None
|
None
|
||||||
if self.prof_title.text() == ""
|
if self.prof_title.text() == ""
|
||||||
@@ -1616,7 +1614,12 @@ class Ui(Ui_Semesterapparat):
|
|||||||
# self.btn_load_apparat()
|
# self.btn_load_apparat()
|
||||||
|
|
||||||
__clear_fields()
|
__clear_fields()
|
||||||
|
if self.check_send_mail.isChecked():
|
||||||
|
self.contact_prof()
|
||||||
|
|
||||||
|
def send_mail_preview(self):
|
||||||
|
pass
|
||||||
|
@property
|
||||||
def active_apparat(self):
|
def active_apparat(self):
|
||||||
return self.drpdwn_app_nr.currentText()
|
return self.drpdwn_app_nr.currentText()
|
||||||
|
|
||||||
@@ -1632,7 +1635,7 @@ class Ui(Ui_Semesterapparat):
|
|||||||
}
|
}
|
||||||
)
|
)
|
||||||
self.dokument_list.item(i, 2).setText("")
|
self.dokument_list.item(i, 2).setText("")
|
||||||
self.db.insertFile(files, self.active_apparat(), self.db.getProfId(self.drpdwn_prof_name.currentText()))
|
self.db.insertFile(files, self.active_apparat, self.db.getProfId(self.drpdwn_prof_name.currentText()))
|
||||||
|
|
||||||
def update_apparat_list(self):
|
def update_apparat_list(self):
|
||||||
# get a list of new apparats based on self.apparats and self.old_apparats
|
# get a list of new apparats based on self.apparats and self.old_apparats
|
||||||
@@ -1681,14 +1684,7 @@ class Ui(Ui_Semesterapparat):
|
|||||||
)
|
)
|
||||||
self.logger.log_info(f"Inserted apparat {apparat[4]}")
|
self.logger.log_info(f"Inserted apparat {apparat[4]}")
|
||||||
|
|
||||||
def calendar_context_menu(self):
|
|
||||||
# create a context menu for the calendar
|
|
||||||
menu = QtWidgets.QMenu()
|
|
||||||
create_reminder = menu.addAction("Erinnerung erstellen")
|
|
||||||
create_reminder.triggered.connect(self.reminder(date=self.calendarWidget.selectedDate().toString("yyyy-MM-dd")))
|
|
||||||
menu.exec(QtGui.QCursor.pos())
|
|
||||||
return menu
|
|
||||||
|
|
||||||
def open_context_menu(self, position):
|
def open_context_menu(self, position):
|
||||||
menu = QtWidgets.QMenu()
|
menu = QtWidgets.QMenu()
|
||||||
extend_action = menu.addAction("Verlängern")
|
extend_action = menu.addAction("Verlängern")
|
||||||
@@ -1715,7 +1711,7 @@ class Ui(Ui_Semesterapparat):
|
|||||||
self.db.addMessage(
|
self.db.addMessage(
|
||||||
data,
|
data,
|
||||||
self.active_user,
|
self.active_user,
|
||||||
self.active_apparat if self.active_apparat() != "" else None,
|
self.active_apparat if self.active_apparat != "" else None,
|
||||||
)
|
)
|
||||||
self.calendarWidget.setMessages([data])
|
self.calendarWidget.setMessages([data])
|
||||||
self.calendarWidget.updateCells()
|
self.calendarWidget.updateCells()
|
||||||
@@ -1739,8 +1735,10 @@ class Ui(Ui_Semesterapparat):
|
|||||||
self.message_frame.hide()
|
self.message_frame.hide()
|
||||||
return
|
return
|
||||||
self.message_box.setText(message["message"])
|
self.message_box.setText(message["message"])
|
||||||
|
appnr = message["appnr"]
|
||||||
|
appnr = "/" if appnr is None else str(appnr)
|
||||||
self.line_app_info.setText(
|
self.line_app_info.setText(
|
||||||
message["appnr"] if message["appnr"] != None else "/"
|
appnr
|
||||||
)
|
)
|
||||||
|
|
||||||
def __delete_message():
|
def __delete_message():
|
||||||
@@ -1751,6 +1749,7 @@ class Ui(Ui_Semesterapparat):
|
|||||||
self.spin_select_message.setMaximum(len(messages))
|
self.spin_select_message.setMaximum(len(messages))
|
||||||
self.spin_select_message.setValue(1)
|
self.spin_select_message.setValue(1)
|
||||||
self.label_total_day_messages.setText("/ " + str(len(messages)))
|
self.label_total_day_messages.setText("/ " + str(len(messages)))
|
||||||
|
|
||||||
|
|
||||||
selected_date = self.calendarWidget.selectedDate().toString("yyyy-MM-dd")
|
selected_date = self.calendarWidget.selectedDate().toString("yyyy-MM-dd")
|
||||||
print(selected_date)
|
print(selected_date)
|
||||||
@@ -1812,11 +1811,11 @@ class Ui(Ui_Semesterapparat):
|
|||||||
self.tableWidget_apparat_media.currentRow(), 1
|
self.tableWidget_apparat_media.currentRow(), 1
|
||||||
).text()
|
).text()
|
||||||
data = self.db.getBookBasedOnSignature(
|
data = self.db.getBookBasedOnSignature(
|
||||||
app_id=self.active_apparat(),
|
app_id=self.active_apparat,
|
||||||
signature=book,
|
signature=book,
|
||||||
prof_id=self.db.getProfId(self.drpdwn_prof_name.currentText()),
|
prof_id=self.db.getProfId(self.drpdwn_prof_name.currentText()),
|
||||||
)
|
)
|
||||||
book_id = self.db.getBookIdBasedOnSignature(self.active_apparat(),self.db.getProfId(self.drpdwn_prof_name.currentText()),book)
|
book_id = self.db.getBookIdBasedOnSignature(self.active_apparat,self.db.getProfId(self.drpdwn_prof_name.currentText()),book)
|
||||||
widget = QtWidgets.QDialog()
|
widget = QtWidgets.QDialog()
|
||||||
bookedit = edit_bookdata_ui()
|
bookedit = edit_bookdata_ui()
|
||||||
bookedit.setupUi(widget)
|
bookedit.setupUi(widget)
|
||||||
@@ -1907,34 +1906,36 @@ class Ui(Ui_Semesterapparat):
|
|||||||
return
|
return
|
||||||
|
|
||||||
def contact_prof(self):
|
def contact_prof(self):
|
||||||
|
if self.active_apparat == "":
|
||||||
|
self.confirm_popup("Bitte erst einen Apparat auswählen!")
|
||||||
|
return
|
||||||
dialog = QtWidgets.QDialog()
|
dialog = QtWidgets.QDialog()
|
||||||
mail_prev = Mail_Dialog()
|
|
||||||
mail_prev.setupUi(dialog)
|
|
||||||
mail_prevs = os.listdir("mail_vorlagen")
|
mail_prevs = os.listdir("mail_vorlagen")
|
||||||
if self.app_name.text() == "":
|
if self.app_name.text() == "":
|
||||||
mail_prevs.remove("Information zum Semesterapparat.eml")
|
mail_prevs.remove("Information zum Semesterapparat.eml")
|
||||||
mail_prev.comboBox.addItems(mail_prevs)
|
|
||||||
active_apparat_id = self.tableWidget_apparate.item(
|
active_apparat_id = self.tableWidget_apparate.item(
|
||||||
self.tableWidget_apparate.currentRow(), 0
|
self.tableWidget_apparate.currentRow(), 0
|
||||||
).text()
|
).text()
|
||||||
general_data = {
|
general_data = {
|
||||||
"Appname": self.app_name.text(),
|
"AppName": self.app_name.text(),
|
||||||
"AppSubject": self.app_fach.currentText(),
|
"AppSubject": self.app_fach.currentText(),
|
||||||
"appnr": active_apparat_id,
|
"AppNr": active_apparat_id,
|
||||||
}
|
}
|
||||||
print(active_apparat_id)
|
print(active_apparat_id)
|
||||||
mail_prev.appid = active_apparat_id
|
profname = self.drpdwn_prof_name.currentText().replace(",", "")
|
||||||
base_data = self.db.getProfData(id=active_apparat_id)
|
|
||||||
profname = self.db.getProfNameById(base_data["id"])
|
|
||||||
profname = profname.split(" ")
|
profname = profname.split(" ")
|
||||||
profname = f"{profname[1]} {profname[0]}"
|
profname = f"{profname[1]} {profname[0]}"
|
||||||
|
prof_id = self.db.getProfId(self.drpdwn_prof_name.currentText())
|
||||||
|
mail = self.db.getSpecificProfData(prof_id, ["mail"])
|
||||||
pass_data = {
|
pass_data = {
|
||||||
"prof_name": profname,
|
"prof_name": profname,
|
||||||
"mail_name": base_data["prof_mail"],
|
"mail_name": mail,
|
||||||
"general": general_data,
|
"general": general_data,
|
||||||
}
|
}
|
||||||
|
|
||||||
mail_prev.set_data(pass_data)
|
mail_prev = Mail_Dialog(app_id = self.active_apparat,data = pass_data,app_name = self.app_name.text(),app_subject = self.app_fach.currentText())
|
||||||
|
mail_prev.setupUi(dialog)
|
||||||
|
mail_prev.comboBox.addItems(mail_prevs)
|
||||||
mail_prev.set_mail()
|
mail_prev.set_mail()
|
||||||
dialog.exec()
|
dialog.exec()
|
||||||
|
|
||||||
@@ -1987,7 +1988,7 @@ def launch_gui():
|
|||||||
|
|
||||||
print(aui.active_user)
|
print(aui.active_user)
|
||||||
MainWindow.show()
|
MainWindow.show()
|
||||||
atexit.register()
|
# atexit.register()
|
||||||
atexit.register(delete_temp_contents)
|
atexit.register(delete_temp_contents)
|
||||||
atexit.register(aui.validate_thread.quit)
|
atexit.register(aui.validate_thread.quit)
|
||||||
sys.exit(app.exec())
|
sys.exit(app.exec())
|
||||||
|
|||||||
@@ -1201,7 +1201,7 @@ class Ui_MainWindow(object):
|
|||||||
self.spin_select_message.setMinimum(1)
|
self.spin_select_message.setMinimum(1)
|
||||||
self.spin_select_message.setObjectName("spin_select_message")
|
self.spin_select_message.setObjectName("spin_select_message")
|
||||||
self.label_total_day_messages = QtWidgets.QLabel(self.message_frame)
|
self.label_total_day_messages = QtWidgets.QLabel(self.message_frame)
|
||||||
self.label_total_day_messages.setGeometry(QtCore.QRect(260, 10, 21, 22))
|
self.label_total_day_messages.setGeometry(QtCore.QRect(240, 10, 21, 22))
|
||||||
self.label_total_day_messages.setObjectName("label_total_day_messages")
|
self.label_total_day_messages.setObjectName("label_total_day_messages")
|
||||||
MainWindow.setCentralWidget(self.centralwidget)
|
MainWindow.setCentralWidget(self.centralwidget)
|
||||||
self.menubar = QtWidgets.QMenuBar(MainWindow)
|
self.menubar = QtWidgets.QMenuBar(MainWindow)
|
||||||
@@ -1345,6 +1345,7 @@ class Ui_MainWindow(object):
|
|||||||
self.tableWidget_apparat_media.setSortingEnabled(True)
|
self.tableWidget_apparat_media.setSortingEnabled(True)
|
||||||
item = self.tableWidget_apparat_media.horizontalHeaderItem(0)
|
item = self.tableWidget_apparat_media.horizontalHeaderItem(0)
|
||||||
item.setText(_translate("MainWindow", "Buchtitel"))
|
item.setText(_translate("MainWindow", "Buchtitel"))
|
||||||
|
item.setToolTip(_translate("MainWindow", "Es kann sein, dass der Buchtitel leer ist, dies kommt vor, wenn der Titel nicht passend formatiert ist"))
|
||||||
item = self.tableWidget_apparat_media.horizontalHeaderItem(1)
|
item = self.tableWidget_apparat_media.horizontalHeaderItem(1)
|
||||||
item.setText(_translate("MainWindow", "Signatur"))
|
item.setText(_translate("MainWindow", "Signatur"))
|
||||||
item = self.tableWidget_apparat_media.horizontalHeaderItem(2)
|
item = self.tableWidget_apparat_media.horizontalHeaderItem(2)
|
||||||
|
|||||||
92
src/ui/dialogs/Ui_mail_preview.py
Normal file
92
src/ui/dialogs/Ui_mail_preview.py
Normal file
@@ -0,0 +1,92 @@
|
|||||||
|
# Form implementation generated from reading ui file 'c:\Users\aky547\GitHub\SemesterapparatsManager\src\ui\dialogs\mail_preview.ui'
|
||||||
|
#
|
||||||
|
# Created by: PyQt6 UI code generator 6.3.1
|
||||||
|
#
|
||||||
|
# WARNING: Any manual changes made to this file will be lost when pyuic6 is
|
||||||
|
# run again. Do not edit this file unless you know what you are doing.
|
||||||
|
|
||||||
|
|
||||||
|
from PyQt6 import QtCore, QtGui, QtWidgets
|
||||||
|
|
||||||
|
|
||||||
|
class Ui_eMailPreview(object):
|
||||||
|
def setupUi(self, eMailPreview):
|
||||||
|
eMailPreview.setObjectName("eMailPreview")
|
||||||
|
eMailPreview.resize(676, 676)
|
||||||
|
self.buttonBox = QtWidgets.QDialogButtonBox(eMailPreview)
|
||||||
|
self.buttonBox.setGeometry(QtCore.QRect(310, 630, 341, 32))
|
||||||
|
self.buttonBox.setOrientation(QtCore.Qt.Orientation.Horizontal)
|
||||||
|
self.buttonBox.setStandardButtons(QtWidgets.QDialogButtonBox.StandardButton.Cancel|QtWidgets.QDialogButtonBox.StandardButton.Ok)
|
||||||
|
self.buttonBox.setObjectName("buttonBox")
|
||||||
|
self.gridLayoutWidget = QtWidgets.QWidget(eMailPreview)
|
||||||
|
self.gridLayoutWidget.setGeometry(QtCore.QRect(10, 10, 661, 621))
|
||||||
|
self.gridLayoutWidget.setObjectName("gridLayoutWidget")
|
||||||
|
self.gridLayout = QtWidgets.QGridLayout(self.gridLayoutWidget)
|
||||||
|
self.gridLayout.setContentsMargins(0, 0, 0, 0)
|
||||||
|
self.gridLayout.setObjectName("gridLayout")
|
||||||
|
self.label_5 = QtWidgets.QLabel(self.gridLayoutWidget)
|
||||||
|
self.label_5.setObjectName("label_5")
|
||||||
|
self.gridLayout.addWidget(self.label_5, 0, 0, 1, 1)
|
||||||
|
self.prof_name = QtWidgets.QLineEdit(self.gridLayoutWidget)
|
||||||
|
self.prof_name.setObjectName("prof_name")
|
||||||
|
self.gridLayout.addWidget(self.prof_name, 2, 2, 1, 1)
|
||||||
|
self.label_3 = QtWidgets.QLabel(self.gridLayoutWidget)
|
||||||
|
self.label_3.setAlignment(QtCore.Qt.AlignmentFlag.AlignLeading|QtCore.Qt.AlignmentFlag.AlignLeft|QtCore.Qt.AlignmentFlag.AlignTop)
|
||||||
|
self.label_3.setObjectName("label_3")
|
||||||
|
self.gridLayout.addWidget(self.label_3, 5, 0, 1, 1)
|
||||||
|
self.mail_name = QtWidgets.QLineEdit(self.gridLayoutWidget)
|
||||||
|
self.mail_name.setObjectName("mail_name")
|
||||||
|
self.gridLayout.addWidget(self.mail_name, 1, 2, 1, 1)
|
||||||
|
self.label_2 = QtWidgets.QLabel(self.gridLayoutWidget)
|
||||||
|
self.label_2.setObjectName("label_2")
|
||||||
|
self.gridLayout.addWidget(self.label_2, 2, 0, 1, 1)
|
||||||
|
self.label_4 = QtWidgets.QLabel(self.gridLayoutWidget)
|
||||||
|
self.label_4.setObjectName("label_4")
|
||||||
|
self.gridLayout.addWidget(self.label_4, 3, 0, 1, 1)
|
||||||
|
self.mail_header = QtWidgets.QLineEdit(self.gridLayoutWidget)
|
||||||
|
self.mail_header.setObjectName("mail_header")
|
||||||
|
self.gridLayout.addWidget(self.mail_header, 3, 2, 1, 1)
|
||||||
|
self.label = QtWidgets.QLabel(self.gridLayoutWidget)
|
||||||
|
self.label.setObjectName("label")
|
||||||
|
self.gridLayout.addWidget(self.label, 1, 0, 1, 1)
|
||||||
|
self.comboBox = QtWidgets.QComboBox(self.gridLayoutWidget)
|
||||||
|
self.comboBox.setObjectName("comboBox")
|
||||||
|
self.gridLayout.addWidget(self.comboBox, 0, 2, 1, 1)
|
||||||
|
self.mail_body = QtWidgets.QTextEdit(self.gridLayoutWidget)
|
||||||
|
self.mail_body.setObjectName("mail_body")
|
||||||
|
self.gridLayout.addWidget(self.mail_body, 5, 2, 1, 1)
|
||||||
|
self.horizontalLayout_3 = QtWidgets.QHBoxLayout()
|
||||||
|
self.horizontalLayout_3.setObjectName("horizontalLayout_3")
|
||||||
|
self.gender_male = QtWidgets.QRadioButton(self.gridLayoutWidget)
|
||||||
|
self.gender_male.setObjectName("gender_male")
|
||||||
|
self.horizontalLayout_3.addWidget(self.gender_male)
|
||||||
|
self.gender_female = QtWidgets.QRadioButton(self.gridLayoutWidget)
|
||||||
|
self.gender_female.setObjectName("gender_female")
|
||||||
|
self.horizontalLayout_3.addWidget(self.gender_female)
|
||||||
|
self.gender_non = QtWidgets.QRadioButton(self.gridLayoutWidget)
|
||||||
|
self.gender_non.setObjectName("gender_non")
|
||||||
|
self.horizontalLayout_3.addWidget(self.gender_non)
|
||||||
|
spacerItem = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Policy.Expanding, QtWidgets.QSizePolicy.Policy.Minimum)
|
||||||
|
self.horizontalLayout_3.addItem(spacerItem)
|
||||||
|
self.gridLayout.addLayout(self.horizontalLayout_3, 4, 2, 1, 1)
|
||||||
|
self.label_6 = QtWidgets.QLabel(self.gridLayoutWidget)
|
||||||
|
self.label_6.setObjectName("label_6")
|
||||||
|
self.gridLayout.addWidget(self.label_6, 4, 0, 1, 1)
|
||||||
|
|
||||||
|
self.retranslateUi(eMailPreview)
|
||||||
|
self.buttonBox.accepted.connect(eMailPreview.accept) # type: ignore
|
||||||
|
self.buttonBox.rejected.connect(eMailPreview.reject) # type: ignore
|
||||||
|
QtCore.QMetaObject.connectSlotsByName(eMailPreview)
|
||||||
|
|
||||||
|
def retranslateUi(self, eMailPreview):
|
||||||
|
_translate = QtCore.QCoreApplication.translate
|
||||||
|
eMailPreview.setWindowTitle(_translate("eMailPreview", "Dialog"))
|
||||||
|
self.label_5.setText(_translate("eMailPreview", "Art"))
|
||||||
|
self.label_3.setText(_translate("eMailPreview", "Mail"))
|
||||||
|
self.label_2.setText(_translate("eMailPreview", "Prof"))
|
||||||
|
self.label_4.setText(_translate("eMailPreview", "Betreff"))
|
||||||
|
self.label.setText(_translate("eMailPreview", "eMail"))
|
||||||
|
self.gender_male.setText(_translate("eMailPreview", "M"))
|
||||||
|
self.gender_female.setText(_translate("eMailPreview", "W"))
|
||||||
|
self.gender_non.setText(_translate("eMailPreview", "Divers"))
|
||||||
|
self.label_6.setText(_translate("eMailPreview", "Geschlecht"))
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
# Form implementation generated from reading ui file 'c:\Users\aky547\GitHub\Semesterapparate\ui\dialogs\reminder.ui'
|
# Form implementation generated from reading ui file 'c:\Users\aky547\GitHub\SemesterapparatsManager\src\ui\dialogs\reminder.ui'
|
||||||
#
|
#
|
||||||
# Created by: PyQt6 UI code generator 6.3.1
|
# Created by: PyQt6 UI code generator 6.3.1
|
||||||
#
|
#
|
||||||
@@ -6,14 +6,14 @@
|
|||||||
# run again. Do not edit this file unless you know what you are doing.
|
# run again. Do not edit this file unless you know what you are doing.
|
||||||
|
|
||||||
|
|
||||||
from PyQt6 import QtCore, QtWidgets
|
from PyQt6 import QtCore, QtGui, QtWidgets
|
||||||
|
|
||||||
|
|
||||||
class Ui_Dialog(object):
|
class Ui_Dialog(object):
|
||||||
def setupUi(self, Dialog):
|
def setupUi(self, Erinnerung):
|
||||||
Dialog.setObjectName("Dialog")
|
Erinnerung.setObjectName("Erinnerung")
|
||||||
Dialog.resize(369, 308)
|
Erinnerung.resize(369, 308)
|
||||||
self.buttonBox = QtWidgets.QDialogButtonBox(Dialog)
|
self.buttonBox = QtWidgets.QDialogButtonBox(Erinnerung)
|
||||||
self.buttonBox.setGeometry(QtCore.QRect(190, 270, 161, 32))
|
self.buttonBox.setGeometry(QtCore.QRect(190, 270, 161, 32))
|
||||||
self.buttonBox.setOrientation(QtCore.Qt.Orientation.Horizontal)
|
self.buttonBox.setOrientation(QtCore.Qt.Orientation.Horizontal)
|
||||||
self.buttonBox.setStandardButtons(
|
self.buttonBox.setStandardButtons(
|
||||||
@@ -21,29 +21,29 @@ class Ui_Dialog(object):
|
|||||||
| QtWidgets.QDialogButtonBox.StandardButton.Ok
|
| QtWidgets.QDialogButtonBox.StandardButton.Ok
|
||||||
)
|
)
|
||||||
self.buttonBox.setObjectName("buttonBox")
|
self.buttonBox.setObjectName("buttonBox")
|
||||||
self.message_box = QtWidgets.QTextEdit(Dialog)
|
self.message_box = QtWidgets.QTextEdit(Erinnerung)
|
||||||
self.message_box.setGeometry(QtCore.QRect(10, 60, 341, 201))
|
self.message_box.setGeometry(QtCore.QRect(10, 60, 341, 201))
|
||||||
self.message_box.setObjectName("message_box")
|
self.message_box.setObjectName("message_box")
|
||||||
self.label = QtWidgets.QLabel(Dialog)
|
self.label = QtWidgets.QLabel(Erinnerung)
|
||||||
self.label.setGeometry(QtCore.QRect(10, 30, 61, 21))
|
self.label.setGeometry(QtCore.QRect(10, 30, 61, 21))
|
||||||
self.label.setObjectName("label")
|
self.label.setObjectName("label")
|
||||||
self.label_2 = QtWidgets.QLabel(Dialog)
|
self.label_2 = QtWidgets.QLabel(Erinnerung)
|
||||||
self.label_2.setGeometry(QtCore.QRect(150, 30, 81, 21))
|
self.label_2.setGeometry(QtCore.QRect(150, 30, 81, 21))
|
||||||
self.label_2.setObjectName("label_2")
|
self.label_2.setObjectName("label_2")
|
||||||
self.dateEdit = QtWidgets.QDateEdit(Dialog)
|
self.dateEdit = QtWidgets.QDateEdit(Erinnerung)
|
||||||
self.dateEdit.setGeometry(QtCore.QRect(240, 30, 110, 22))
|
self.dateEdit.setGeometry(QtCore.QRect(240, 30, 110, 22))
|
||||||
self.dateEdit.setObjectName("dateEdit")
|
self.dateEdit.setObjectName("dateEdit")
|
||||||
self.dateEdit.setDateTime(QtCore.QDateTime.currentDateTime())
|
self.dateEdit.setDate(QtCore.QDate.currentDate())
|
||||||
self.retranslateUi(Dialog)
|
self.retranslateUi(Erinnerung)
|
||||||
self.buttonBox.accepted.connect(Dialog.accept) # type: ignore
|
self.buttonBox.accepted.connect(Erinnerung.accept) # type: ignore
|
||||||
self.buttonBox.rejected.connect(Dialog.reject) # type: ignore
|
self.buttonBox.rejected.connect(Erinnerung.reject) # type: ignore
|
||||||
QtCore.QMetaObject.connectSlotsByName(Dialog)
|
QtCore.QMetaObject.connectSlotsByName(Erinnerung)
|
||||||
|
|
||||||
def retranslateUi(self, Dialog):
|
def retranslateUi(self, Erinnerung):
|
||||||
_translate = QtCore.QCoreApplication.translate
|
_translate = QtCore.QCoreApplication.translate
|
||||||
Dialog.setWindowTitle(_translate("Dialog", "Dialog"))
|
Erinnerung.setWindowTitle(_translate("Erinnerung", "Dialog"))
|
||||||
self.label.setText(_translate("Dialog", "Nachricht:"))
|
self.label.setText(_translate("Erinnerung", "Nachricht:"))
|
||||||
self.label_2.setText(_translate("Dialog", "Erinnerung am:"))
|
self.label_2.setText(_translate("Erinnerung", "Erinnerung am:"))
|
||||||
|
|
||||||
def return_message(self) -> dict:
|
def return_message(self) -> dict:
|
||||||
return {
|
return {
|
||||||
|
|||||||
@@ -7,7 +7,7 @@
|
|||||||
|
|
||||||
|
|
||||||
from PyQt6 import QtCore, QtGui, QtWidgets
|
from PyQt6 import QtCore, QtGui, QtWidgets
|
||||||
|
from src.backend.semester import generateSemesterByDate
|
||||||
|
|
||||||
class Ui_Dialog(object):
|
class Ui_Dialog(object):
|
||||||
def setupUi(self, Dialog):
|
def setupUi(self, Dialog):
|
||||||
|
|||||||
@@ -1,25 +1,40 @@
|
|||||||
import subprocess
|
import subprocess
|
||||||
import tempfile
|
import tempfile
|
||||||
|
import os
|
||||||
from PyQt6 import QtCore, QtGui, QtWidgets
|
from PyQt6 import QtCore, QtGui, QtWidgets
|
||||||
|
|
||||||
from src.ui.dialogs.mail_preview import Ui_Dialog
|
from src.ui.dialogs.Ui_mail_preview import Ui_eMailPreview as Ui_Dialog
|
||||||
|
from omegaconf import OmegaConf
|
||||||
|
config = OmegaConf.load("config.yaml")
|
||||||
|
|
||||||
class Mail_Dialog(QtWidgets.QDialog, Ui_Dialog):
|
class Mail_Dialog(QtWidgets.QDialog, Ui_Dialog):
|
||||||
def __init__(self, parent=None):
|
def __init__(self, parent=None, app_id="", app_name="", app_subject="", prof_name="", data = None):
|
||||||
super().__init__(parent)
|
super().__init__(parent)
|
||||||
self.setupUi(self)
|
self.setupUi(self)
|
||||||
self.appid = ""
|
self.appid = app_id
|
||||||
|
self.appname = app_name
|
||||||
|
self.subject = app_subject
|
||||||
|
self.profname = prof_name
|
||||||
self.mail_data = ""
|
self.mail_data = ""
|
||||||
self.data = None
|
self.data = data
|
||||||
self.buttonBox.accepted.connect(self.save_mail)
|
self.buttonBox.accepted.connect(self.save_mail)
|
||||||
|
self.comboBox.selec
|
||||||
|
|
||||||
def set_data(self, data: dict):
|
# def set_data(self, data: dict):
|
||||||
self.prof_name.setText(data["prof_name"])
|
# print(data)
|
||||||
self.mail_name.setText(data["mail_name"])
|
# self.prof_name.setText(data["prof_name"])
|
||||||
# assign data["general"] to self.data
|
# self.mail_name.setText(data["mail_name"])
|
||||||
self.data = data["general"]
|
# # assign data["general"] to self.data
|
||||||
|
# self.data = data["general"]
|
||||||
|
|
||||||
|
def get_greeting(self):
|
||||||
|
if self.gender_male.isChecked():
|
||||||
|
return "Sehr geehrter Herr"
|
||||||
|
elif self.gender_female.isChecked():
|
||||||
|
return "Sehr geehrte Frau"
|
||||||
|
elif self.gender_non.isChecked():
|
||||||
|
return "Guten Tag"
|
||||||
|
|
||||||
|
|
||||||
def set_mail(self):
|
def set_mail(self):
|
||||||
email_template = self.comboBox.currentText()
|
email_template = self.comboBox.currentText()
|
||||||
@@ -27,15 +42,14 @@ class Mail_Dialog(QtWidgets.QDialog, Ui_Dialog):
|
|||||||
mail_template = f.read()
|
mail_template = f.read()
|
||||||
email_header = email_template.split(".eml")[0]
|
email_header = email_template.split(".eml")[0]
|
||||||
if "{AppNr}" in email_template:
|
if "{AppNr}" in email_template:
|
||||||
email_header = email_template.split(".eml")[0].format(AppNr=self.appid)
|
email_header = email_template.split(".eml")[0]
|
||||||
self.mail_header.setText(email_header)
|
self.mail_header.setText(email_header)
|
||||||
self.mail_data = mail_template.split("<html>")[0]
|
self.mail_data = mail_template.split("<html>")[0]
|
||||||
mail_html = mail_template.split("<html>")[1]
|
mail_html = mail_template.split("<html>")[1]
|
||||||
mail_html = "<html>" + mail_html
|
mail_html = "<html>" + mail_html
|
||||||
print(self.data)
|
Appname = self.appname
|
||||||
Appname = self.data["Appname"]
|
|
||||||
mail_html = mail_html.format(
|
mail_html = mail_html.format(
|
||||||
Profname=self.prof_name.text().split(" ")[-1], Appname=Appname
|
Profname=self.prof_name.text().split(" ")[-1], Appname=Appname, AppNr=self.appid, AppSubject = self.subject,greeting = self.get_greeting()
|
||||||
)
|
)
|
||||||
|
|
||||||
self.mail_body.setHtml(mail_html)
|
self.mail_body.setHtml(mail_html)
|
||||||
@@ -46,14 +60,16 @@ class Mail_Dialog(QtWidgets.QDialog, Ui_Dialog):
|
|||||||
mail_body = self.mail_body.toHtml()
|
mail_body = self.mail_body.toHtml()
|
||||||
mail = self.mail_data + mail_body
|
mail = self.mail_data + mail_body
|
||||||
mail = mail.replace("Subject:", f"Subject: {mail_header}")
|
mail = mail.replace("Subject:", f"Subject: {mail_header}")
|
||||||
|
directory = config["database"]["tempdir"]
|
||||||
|
directory = directory.replace("~", str(os.path.expanduser("~")))
|
||||||
with tempfile.NamedTemporaryFile(
|
with tempfile.NamedTemporaryFile(
|
||||||
mode="w", delete=False, suffix=".eml", encoding="utf-8", dir="mails"
|
mode="w", delete=False, suffix=".eml", encoding="utf-8", dir=directory
|
||||||
) as f:
|
) as f:
|
||||||
f.write(mail)
|
f.write(mail)
|
||||||
self.mail_path = f.name
|
self.mail_path = f.name
|
||||||
print(self.mail_path)
|
print(self.mail_path)
|
||||||
# open the file using thunderbird
|
# open the file using thunderbird
|
||||||
subprocess.Popen(["thunderbird", f"{self.mail_path}"])
|
subprocess.Popen([f"{self.mail_path}"])
|
||||||
# delete the file
|
# delete the file
|
||||||
# os.remove(self.mail_path)
|
# os.remove(self.mail_path)
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<ui version="4.0">
|
<ui version="4.0">
|
||||||
<class>Dialog</class>
|
<class>eMailPreview</class>
|
||||||
<widget class="QDialog" name="Dialog">
|
<widget class="QDialog" name="eMailPreview">
|
||||||
<property name="geometry">
|
<property name="geometry">
|
||||||
<rect>
|
<rect>
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
@@ -39,10 +39,17 @@
|
|||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<layout class="QGridLayout" name="gridLayout">
|
<layout class="QGridLayout" name="gridLayout">
|
||||||
|
<item row="0" column="0">
|
||||||
|
<widget class="QLabel" name="label_5">
|
||||||
|
<property name="text">
|
||||||
|
<string>Art</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
<item row="2" column="2">
|
<item row="2" column="2">
|
||||||
<widget class="QLineEdit" name="prof_name"/>
|
<widget class="QLineEdit" name="prof_name"/>
|
||||||
</item>
|
</item>
|
||||||
<item row="4" column="0">
|
<item row="5" column="0">
|
||||||
<widget class="QLabel" name="label_3">
|
<widget class="QLabel" name="label_3">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Mail</string>
|
<string>Mail</string>
|
||||||
@@ -52,6 +59,9 @@
|
|||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
<item row="1" column="2">
|
||||||
|
<widget class="QLineEdit" name="mail_name"/>
|
||||||
|
</item>
|
||||||
<item row="2" column="0">
|
<item row="2" column="0">
|
||||||
<widget class="QLabel" name="label_2">
|
<widget class="QLabel" name="label_2">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
@@ -69,12 +79,6 @@
|
|||||||
<item row="3" column="2">
|
<item row="3" column="2">
|
||||||
<widget class="QLineEdit" name="mail_header"/>
|
<widget class="QLineEdit" name="mail_header"/>
|
||||||
</item>
|
</item>
|
||||||
<item row="1" column="2">
|
|
||||||
<widget class="QLineEdit" name="mail_name"/>
|
|
||||||
</item>
|
|
||||||
<item row="4" column="2">
|
|
||||||
<widget class="QTextEdit" name="mail_body"/>
|
|
||||||
</item>
|
|
||||||
<item row="1" column="0">
|
<item row="1" column="0">
|
||||||
<widget class="QLabel" name="label">
|
<widget class="QLabel" name="label">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
@@ -85,10 +89,51 @@
|
|||||||
<item row="0" column="2">
|
<item row="0" column="2">
|
||||||
<widget class="QComboBox" name="comboBox"/>
|
<widget class="QComboBox" name="comboBox"/>
|
||||||
</item>
|
</item>
|
||||||
<item row="0" column="0">
|
<item row="5" column="2">
|
||||||
<widget class="QLabel" name="label_5">
|
<widget class="QTextEdit" name="mail_body"/>
|
||||||
|
</item>
|
||||||
|
<item row="4" column="2">
|
||||||
|
<layout class="QHBoxLayout" name="horizontalLayout_3">
|
||||||
|
<item>
|
||||||
|
<widget class="QRadioButton" name="gender_male">
|
||||||
|
<property name="text">
|
||||||
|
<string>M</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QRadioButton" name="gender_female">
|
||||||
|
<property name="text">
|
||||||
|
<string>W</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QRadioButton" name="gender_non">
|
||||||
|
<property name="text">
|
||||||
|
<string>Divers</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<spacer name="horizontalSpacer">
|
||||||
|
<property name="orientation">
|
||||||
|
<enum>Qt::Horizontal</enum>
|
||||||
|
</property>
|
||||||
|
<property name="sizeHint" stdset="0">
|
||||||
|
<size>
|
||||||
|
<width>40</width>
|
||||||
|
<height>20</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
</spacer>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</item>
|
||||||
|
<item row="4" column="0">
|
||||||
|
<widget class="QLabel" name="label_6">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Art</string>
|
<string>Geschlecht</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
@@ -100,7 +145,7 @@
|
|||||||
<connection>
|
<connection>
|
||||||
<sender>buttonBox</sender>
|
<sender>buttonBox</sender>
|
||||||
<signal>accepted()</signal>
|
<signal>accepted()</signal>
|
||||||
<receiver>Dialog</receiver>
|
<receiver>eMailPreview</receiver>
|
||||||
<slot>accept()</slot>
|
<slot>accept()</slot>
|
||||||
<hints>
|
<hints>
|
||||||
<hint type="sourcelabel">
|
<hint type="sourcelabel">
|
||||||
@@ -116,7 +161,7 @@
|
|||||||
<connection>
|
<connection>
|
||||||
<sender>buttonBox</sender>
|
<sender>buttonBox</sender>
|
||||||
<signal>rejected()</signal>
|
<signal>rejected()</signal>
|
||||||
<receiver>Dialog</receiver>
|
<receiver>eMailPreview</receiver>
|
||||||
<slot>reject()</slot>
|
<slot>reject()</slot>
|
||||||
<hints>
|
<hints>
|
||||||
<hint type="sourcelabel">
|
<hint type="sourcelabel">
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<ui version="4.0">
|
<ui version="4.0">
|
||||||
<class>Dialog</class>
|
<class>Erinnerung</class>
|
||||||
<widget class="QDialog" name="Dialog">
|
<widget class="QDialog" name="Erinnerung">
|
||||||
<property name="geometry">
|
<property name="geometry">
|
||||||
<rect>
|
<rect>
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
@@ -81,7 +81,7 @@
|
|||||||
<connection>
|
<connection>
|
||||||
<sender>buttonBox</sender>
|
<sender>buttonBox</sender>
|
||||||
<signal>accepted()</signal>
|
<signal>accepted()</signal>
|
||||||
<receiver>Dialog</receiver>
|
<receiver>Erinnerung</receiver>
|
||||||
<slot>accept()</slot>
|
<slot>accept()</slot>
|
||||||
<hints>
|
<hints>
|
||||||
<hint type="sourcelabel">
|
<hint type="sourcelabel">
|
||||||
@@ -97,7 +97,7 @@
|
|||||||
<connection>
|
<connection>
|
||||||
<sender>buttonBox</sender>
|
<sender>buttonBox</sender>
|
||||||
<signal>rejected()</signal>
|
<signal>rejected()</signal>
|
||||||
<receiver>Dialog</receiver>
|
<receiver>Erinnerung</receiver>
|
||||||
<slot>reject()</slot>
|
<slot>reject()</slot>
|
||||||
<hints>
|
<hints>
|
||||||
<hint type="sourcelabel">
|
<hint type="sourcelabel">
|
||||||
|
|||||||
@@ -1216,6 +1216,9 @@
|
|||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Buchtitel</string>
|
<string>Buchtitel</string>
|
||||||
</property>
|
</property>
|
||||||
|
<property name="toolTip">
|
||||||
|
<string>Es kann sein, dass der Buchtitel leer ist, dies kommt vor, wenn der Titel nicht passend formatiert ist</string>
|
||||||
|
</property>
|
||||||
</column>
|
</column>
|
||||||
<column>
|
<column>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
@@ -2796,7 +2799,7 @@
|
|||||||
<widget class="QLabel" name="label_total_day_messages">
|
<widget class="QLabel" name="label_total_day_messages">
|
||||||
<property name="geometry">
|
<property name="geometry">
|
||||||
<rect>
|
<rect>
|
||||||
<x>260</x>
|
<x>240</x>
|
||||||
<y>10</y>
|
<y>10</y>
|
||||||
<width>21</width>
|
<width>21</width>
|
||||||
<height>22</height>
|
<height>22</height>
|
||||||
|
|||||||
Reference in New Issue
Block a user