Skip to content
This repository has been archived by the owner on Jun 21, 2019. It is now read-only.

Commit

Permalink
'Yazım hatası düzeltildi'
Browse files Browse the repository at this point in the history
  • Loading branch information
SeriousBug committed Jul 28, 2016
1 parent e431cca commit 9a05bfa
Show file tree
Hide file tree
Showing 2 changed files with 164 additions and 151 deletions.
15 changes: 14 additions & 1 deletion ulakbus/diagrams/sinav_programi_hazirla.bpmn
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<bpmn:definitions xmlns:bpmn="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:camunda="http://camunda.org/schema/1.0/bpmn" id="Definitions_1" targetNamespace="http://bpmn.io/schema/bpmn" exporter="Camunda Modeler" exporterVersion="1.2.1">
<bpmn:definitions xmlns:bpmn="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:camunda="http://camunda.org/schema/1.0/bpmn" id="Definitions_1" targetNamespace="http://bpmn.io/schema/bpmn" exporter="Camunda Modeler" exporterVersion="1.2.0">
<bpmn:collaboration id="Collaboration_0ze4k2q">
<bpmn:participant id="Participant_0nwlcc9" name="Sinav Programi Hazirla" processRef="sinav_programi_hazirla" />
</bpmn:collaboration>
Expand Down Expand Up @@ -39,6 +39,7 @@
<bpmn:incoming>SequenceFlow_0sgvbmo</bpmn:incoming>
<bpmn:outgoing>SequenceFlow_19h9d5y</bpmn:outgoing>
<bpmn:outgoing>SequenceFlow_1uwbt2j</bpmn:outgoing>
<bpmn:outgoing>SequenceFlow_0ie54qj</bpmn:outgoing>
</bpmn:exclusiveGateway>
<bpmn:exclusiveGateway id="ExclusiveGateway_1qdniu3" default="SequenceFlow_1oj9dg6">
<bpmn:incoming>SequenceFlow_009qy3s</bpmn:incoming>
Expand Down Expand Up @@ -98,6 +99,7 @@
<bpmn:incoming>SequenceFlow_1oj9dg6</bpmn:incoming>
<bpmn:incoming>SequenceFlow_0n8p1pn</bpmn:incoming>
<bpmn:incoming>SequenceFlow_1blrly5</bpmn:incoming>
<bpmn:incoming>SequenceFlow_0ie54qj</bpmn:incoming>
<bpmn:outgoing>SequenceFlow_0wpt0ce</bpmn:outgoing>
</bpmn:userTask>
<bpmn:userTask id="hatali" name="Hatalı" camunda:assignee="ders_programi.sinav_programi.SinavProgramiYap.hatali">
Expand Down Expand Up @@ -130,6 +132,9 @@
<bpmn:incoming>SequenceFlow_0lvb9vr</bpmn:incoming>
<bpmn:outgoing>SequenceFlow_1blrly5</bpmn:outgoing>
</bpmn:userTask>
<bpmn:sequenceFlow id="SequenceFlow_0ie54qj" sourceRef="ExclusiveGateway_0sq08m5" targetRef="hatasiz">
<bpmn:conditionExpression xsi:type="bpmn:tFormalExpression"><![CDATA[cmd=='hatasiz_sonuc']]></bpmn:conditionExpression>
</bpmn:sequenceFlow>
</bpmn:process>
<bpmndi:BPMNDiagram id="BPMNDiagram_1">
<bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="Collaboration_0ze4k2q">
Expand Down Expand Up @@ -405,6 +410,14 @@
<bpmndi:BPMNShape id="UserTask_040gcsu_di" bpmnElement="detay_goster">
<dc:Bounds x="931" y="210" width="100" height="80" />
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge id="SequenceFlow_0ie54qj_di" bpmnElement="SequenceFlow_0ie54qj">
<di:waypoint xsi:type="dc:Point" x="379" y="717" />
<di:waypoint xsi:type="dc:Point" x="379" y="594.8376068376069" />
<di:waypoint xsi:type="dc:Point" x="1074" y="595" />
<bpmndi:BPMNLabel>
<dc:Bounds x="349" y="645.9188034188035" width="90" height="20" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
</bpmndi:BPMNPlane>
</bpmndi:BPMNDiagram>
</bpmn:definitions>
300 changes: 150 additions & 150 deletions ulakbus/views/ders_programi/sinav_programi.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,153 +90,153 @@ def servis_bilgi_mesaji(self):
else:
self.current.output['msgbox'] = self.current.task_data['LANE_CHANGE_MSG']

# def sinav_programi_sonucu(self):
# sınav_etkinligi_count, solved_count, published_count = self.sinav_etkinligi_sayisi()
# if solved_count != sınav_etkinligi_count:
# msg = {"type": 'warning',
# "title": 'Hatalı Sonuçlar Var!',
# "msg": 'Oluşturulan sınav programınızda hatalı sonuçlar bulunmaktadır.'
# 'Lütfen tekrardan sınav programı oluşturunuz.'}
# self.current.task_data['LANE_CHANGE_MSG'] = msg
#
# self.current.task_data['cmd'] = 'hata'
# else:
# msg = {"type": 'info',
# "title": 'Sına Programı Başarıyla Oluşturuldu!',
# "msg": 'Yayınlanmayan sınav programını inceleyip yayınlayabilirsiniz.'}
# self.current.task_data['LANE_CHANGE_MSG'] = msg
#
# def hatasiz(self):
# _form = JsonForm(title="Derslik veya Öğretim Elemanı İncele")
# _form.incele = fields.Button("İncele", cmd='incele')
# _form.yayinla = fields.Button("Yayınla", cmd='bitir')
# self.form_out(_form)
# self.current.output['msgbox'] = self.current.task_data['LANE_CHANGE_MSG']
#
# def derslik_og_elemani_ara(self):
#
# self.form_out(AramaForm(self.object, current=self.current))
#
# def arama(self):
# text = str(self.input['form']['arama_text'])
# try:
# if self.input['form']['arama_sec'] == 1:
# room_search = [r for r in Room.objects.filter(code=text) if
# self.current.role.unit in r.RoomDepartments]
# if room_search:
# self.current.task_data['data_key'] = room_search[0].key
# self.current.task_data['cmd'] = 'tekli'
# else:
# raise
# else:
# ad = text.split()[0]
# soyad = text.split()[1]
# okutman_search = Okutman.objects.filter(birim_no=self.current.role.unit.yoksis_no, ad=ad, soyad=soyad)
# if len(okutman_search) > 1:
# self.current.search = okutman_search
# self.current.task_data['cmd'] = 'coklu'
# elif len(okutman_search) == 1:
# self.current.task_data['data_key'] = okutman_search[0].key
# self.current.task_data['cmd'] = 'tekli'
# else:
# raise
# except:
# msg = {
# 'type': 'warning', "title": 'Kayıt Bulunamadı',
# "msg": 'İlgili kayıt bulunamadı.'
# }
# self.current.task_data["LANE_CHANGE_MSG"] = msg
#
# def coklu_sonuc(self):
#
# self.output['objects'] = [['Ad', 'Soyad']]
# for data in self.current.search:
# data_list = OrderedDict({})
# data_list['Ad'] = data.ad
# data_list['Soyad'] = data.soyad
# item = {
# 'type': "table-multiRow",
# 'fields': data_list,
# 'actions': [
# {'name': 'Goster', 'cmd': 'tek_sonuc', 'show_as': 'button',
# 'object_key': 'ogretim_elemani'}
# ],
# 'key': data.key
# }
# self.output['objects'].append(item)
#
# def detay_goster(self):
#
# if "LANE_CHANGE_MSG" in self.current.task_data and \
# 'title' in self.current.task_data["LANE_CHANGE_MSG"] and \
# self.current.task_data["LANE_CHANGE_MSG"]['title'] == "Kayıt Bulunamadı":
#
# self.current.output['msgbox'] = self.current.task_data["LANE_CHANGE_MSG"]
# self.current.task_data["LANE_CHANGE_MSG"] = ''
# else:
# obj_key = self.current.task_data['data_key']
# if self.input['form']['arama_sec'] == 1:
# ders_etkinligi = SinavEtkinligi.objects.filter(room_id=obj_key)
# obj = Room.objects.get(obj_key)
#
# else:
# ders_etkinligi = SinavEtkinligi.objects.filter(okutman_id=obj_key)
# obj = Okutman.objects.get(obj_key)
#
# days = ["Pazartesi", "Salı", "Çarşamba", "Perşembe", "Cuma", "Cumartesi", "Pazar"]
#
# self.output['objects'] = [days]
#
# def etkinlik(de):
# """
# Ders etkinligi formatlar ve dondurur.
#
# :param de: ders etkinligi
# :return: ders adi ve zamani
# """
# aralik = "%s:%s - %s:%s" % (de.baslangic_saat,
# de.baslangic_dakika,
# de.bitis_saat,
# de.bitis_dakika)
# return "\n\n**%s**\n%s\n\n" % (aralik, de.ders.ad)
#
# data_list = []
# for day in days:
# data_list.append(
# ''.join(["%s" % etkinlik(de) for de in ders_etkinligi.filter(gun=days.index(day) + 1)]))
#
# item = {
# "title": "%s - Detaylı Zaman Tablosu" % obj.__unicode__(),
# 'type': "table-multiRow",
# 'fields': data_list,
# "actions": False,
# }
# self.output['objects'].append(item)
# _json = JsonForm(title="Detaylı Zaman Tablosu")
# _json.tamamla = fields.Button("Bitir")
# self.form_out(_json)
#
# def hatali(self):
# msg = {"type": 'info',
# "title": 'Yayınlanmamış Sınav Programı Var!',
# "msg": 'Yayınlanmayan sınav programını inceleyip yayınlayabilirsiniz.'}
# self.current.task_data['LANE_CHANGE_MSG'] = msg
#
# def yayinla(self):
# des = SinavEtkinligi.objects.filter(bolum=self.current.role.unit, donem=Donem.guncel_donem())
# try:
# for de in des:
# de.published = True
# de.save()
# msg = {"type": 'info',
# "title": 'Sınav Programı Yayınlandı!',
# "msg": 'Oluşturulan Sınav Programı Başarıyla Yayınlandı'}
# self.current.task_data['LANE_CHANGE_MSG'] = msg
# except:
# msg = {"type": 'warning',
# "title": '!!HATA!!',
# "msg": 'Sınav Programı yayınlanırken hata oluştu lütfen tekrar yayınlayınç'}
# self.current.task_data['LANE_CHANGE_MSG'] = msg
#
# def bilgilendirme(self):
# self.current.output['msgbox'] = self.current.task_data['LANE_CHANGE_MSG']
def sinav_programi_sonucu(self):
sinav_etkinligi_count, solved_count, published_count = self.sinav_etkinligi_sayisi()
if solved_count != sinav_etkinligi_count:
msg = {"type": 'warning',
"title": 'Hatalı Sonuçlar Var!',
"msg": 'Oluşturulan sınav programınızda hatalı sonuçlar bulunmaktadır.'
'Lütfen tekrardan sınav programı oluşturunuz.'}
self.current.task_data['LANE_CHANGE_MSG'] = msg

self.current.task_data['cmd'] = 'hata'
else:
msg = {"type": 'info',
"title": 'Sına Programı Başarıyla Oluşturuldu!',
"msg": 'Yayınlanmayan sınav programını inceleyip yayınlayabilirsiniz.'}
self.current.task_data['LANE_CHANGE_MSG'] = msg

def hatasiz(self):
_form = JsonForm(title="Derslik veya Öğretim Elemanı İncele")
_form.incele = fields.Button("İncele", cmd='incele')
_form.yayinla = fields.Button("Yayınla", cmd='bitir')
self.form_out(_form)
self.current.output['msgbox'] = self.current.task_data['LANE_CHANGE_MSG']

def derslik_ogretim_elemani_ara(self):

self.form_out(AramaForm(self.object, current=self.current))

def arama(self):
text = str(self.input['form']['arama_text'])
try:
if self.input['form']['arama_sec'] == 1:
room_search = [r for r in Room.objects.filter(code=text) if
self.current.role.unit in r.RoomDepartments]
if room_search:
self.current.task_data['data_key'] = room_search[0].key
self.current.task_data['cmd'] = 'tekli'
else:
raise
else:
ad = text.split()[0]
soyad = text.split()[1]
okutman_search = Okutman.objects.filter(birim_no=self.current.role.unit.yoksis_no, ad=ad, soyad=soyad)
if len(okutman_search) > 1:
self.current.search = okutman_search
self.current.task_data['cmd'] = 'coklu'
elif len(okutman_search) == 1:
self.current.task_data['data_key'] = okutman_search[0].key
self.current.task_data['cmd'] = 'tekli'
else:
raise
except:
msg = {
'type': 'warning', "title": 'Kayıt Bulunamadı',
"msg": 'İlgili kayıt bulunamadı.'
}
self.current.task_data["LANE_CHANGE_MSG"] = msg

def coklu_sonuc(self):

self.output['objects'] = [['Ad', 'Soyad']]
for data in self.current.search:
data_list = OrderedDict({})
data_list['Ad'] = data.ad
data_list['Soyad'] = data.soyad
item = {
'type': "table-multiRow",
'fields': data_list,
'actions': [
{'name': 'Goster', 'cmd': 'tek_sonuc', 'show_as': 'button',
'object_key': 'ogretim_elemani'}
],
'key': data.key
}
self.output['objects'].append(item)

def detay_goster(self):

if "LANE_CHANGE_MSG" in self.current.task_data and \
'title' in self.current.task_data["LANE_CHANGE_MSG"] and \
self.current.task_data["LANE_CHANGE_MSG"]['title'] == "Kayıt Bulunamadı":

self.current.output['msgbox'] = self.current.task_data["LANE_CHANGE_MSG"]
self.current.task_data["LANE_CHANGE_MSG"] = ''
else:
obj_key = self.current.task_data['data_key']
if self.input['form']['arama_sec'] == 1:
ders_etkinligi = SinavEtkinligi.objects.filter(room_id=obj_key)
obj = Room.objects.get(obj_key)

else:
ders_etkinligi = SinavEtkinligi.objects.filter(okutman_id=obj_key)
obj = Okutman.objects.get(obj_key)

days = ["Pazartesi", "Salı", "Çarşamba", "Perşembe", "Cuma", "Cumartesi", "Pazar"]

self.output['objects'] = [days]

def etkinlik(de):
"""
Ders etkinligi formatlar ve dondurur.
:param de: ders etkinligi
:return: ders adi ve zamani
"""
aralik = "%s:%s - %s:%s" % (de.baslangic_saat,
de.baslangic_dakika,
de.bitis_saat,
de.bitis_dakika)
return "\n\n**%s**\n%s\n\n" % (aralik, de.ders.ad)

data_list = []
for day in days:
data_list.append(
''.join(["%s" % etkinlik(de) for de in ders_etkinligi.filter(gun=days.index(day) + 1)]))

item = {
"title": "%s - Detaylı Zaman Tablosu" % obj.__unicode__(),
'type': "table-multiRow",
'fields': data_list,
"actions": False,
}
self.output['objects'].append(item)
_json = JsonForm(title="Detaylı Zaman Tablosu")
_json.tamamla = fields.Button("Bitir")
self.form_out(_json)

def hatali(self):
msg = {"type": 'info',
"title": 'Yayınlanmamış Sınav Programı Var!',
"msg": 'Yayınlanmayan sınav programını inceleyip yayınlayabilirsiniz.'}
self.current.task_data['LANE_CHANGE_MSG'] = msg

def yayinla(self):
des = SinavEtkinligi.objects.filter(bolum=self.current.role.unit, donem=Donem.guncel_donem())
try:
for de in des:
de.published = True
de.save()
msg = {"type": 'info',
"title": 'Sınav Programı Yayınlandı!',
"msg": 'Oluşturulan Sınav Programı Başarıyla Yayınlandı'}
self.current.task_data['LANE_CHANGE_MSG'] = msg
except:
msg = {"type": 'warning',
"title": '!!HATA!!',
"msg": 'Sınav Programı yayınlanırken hata oluştu lütfen tekrar yayınlayınç'}
self.current.task_data['LANE_CHANGE_MSG'] = msg

def bilgilendirme(self):
self.current.output['msgbox'] = self.current.task_data['LANE_CHANGE_MSG']

0 comments on commit 9a05bfa

Please sign in to comment.