def show(self):
     CrudView.show(self)
     self.output['object'][
         'Yayınlanmış mı?'] = 'Evet' if self.object.yayinlanmis_mi else 'Hayır'
     form = JsonForm()
     form.tamam = fields.Button(_(u"Tamam"))
     self.form_out(form)
示例#2
0
 def list(self, custom_form=None):
     self.current.task_data.pop('object_id', None)
     custom_form = JsonForm(current=self.current,
                            title=_(u"Gündem Listesi"))
     custom_form.ekle = fields.Button(_(u"Yeni Gündem Oluştur"),
                                      cmd='yeni_gundem')
     CrudView.list(self, custom_form=custom_form)
示例#3
0
 def list(self, custom_form=None):
     if 'form' in self.input and 'proje' in self.input['form']:
         self.current.task_data['bap_proje_id'] = self.input['form'][
             'proje']
     CrudView.list(self)
     proje = BAPProje.objects.get(self.current.task_data['bap_proje_id'])
     if 'GenelBilgiGirForm' in self.current.task_data:
         ad = self.current.task_data['GenelBilgiGirForm']['ad']
     else:
         ad = proje.ad
     toplam = sum(
         BAPButcePlani.objects.all(
             ilgili_proje=proje).values_list('toplam_fiyat'))
     self.output['objects'].append({
         'fields': ['TOPLAM', '', '', '', '',
                    str(toplam), ''],
         'actions':
         ''
     })
     form = JsonForm(title=_(u"%s projesi için Bütçe Planı") % ad)
     form.ekle = fields.Button(_(u"Ekle"), cmd='add_edit_form')
     form.sartname_ekle = fields.Button(_(u"Teknik Şartname Ekle"),
                                        cmd='sartname_ekle')
     form.bitir = fields.Button(_(u"Bitir"), cmd='bitir')
     self.form_out(form)
 def __init__(self, current):
     CrudView.__init__(self, current)
     if 'object_id' in self.current.task_data and self.cmd == 'add_edit_form' and \
             'object_id' not in self.input:
         del self.current.task_data['object_id']
         self.object = BAPSSS()
         self.object_form = SSSAddEditForm(self.object,
                                           current=self.current)
    def __init__(self, current):
        CrudView.__init__(self, current)
        if 'object_id' in self.current.task_data and self.cmd == 'add_edit_form' and \
                'object_id' not in self.input:
            del self.current.task_data['object_id']
            self.object = BAPIsPaketi()

        if 'iptal' in current.task_data['cmd'] and 'IsPaketiHazirlaForm' in self.current.task_data:
            del current.task_data['IsPaketiHazirlaForm']
示例#6
0
 def show(self):
     CrudView.show(self)
     self.output['object']['Muhasebe Kod'] = str(
         self.object.muhasebe_kod_genel)
     self.output['object'][
         'Teknik Şartname'] = self.object.teknik_sartname.aciklama
     form = JsonForm()
     form.tamam = fields.Button(_(u"Tamam"))
     self.form_out(form)
示例#7
0
 def add_edit_form(self):
     if 'kontrol_msg' in self.current.task_data:
         msg = _(u"%s") % self.current.task_data['kontrol_msg']
         self.current.output['msgbox'] = {
             "type": "warning",
             "title": _(u"Hatalı Veri Girişi"),
             "msg": msg
         }
         del self.current.task_data['kontrol_msg']
         self.set_form_data_to_object()
     CrudView.add_edit_form(self)
示例#8
0
    def __init__(self, current):
        CrudView.__init__(self, current)
        if not self.object.key:
            self.object = self.model_class.objects.get(
                self.current.task_data.get('bap_proje_id',
                                           self.input.pop('object_id', '')))
        self.current.output["meta"]["allow_search"] = False

        # Genel form, bu nesneyi extend eden digerleri tarafindan degistirilebilsin
        # bkz: bap_ogrbasvuru_goruntule.py
        self.genel_form = GenelProjeForm
示例#9
0
    def show(self):
        CrudView.show(self)
        form = JsonForm()
        form.tamam = fields.Button(_(u"Tamam"))
        self.form_out(form)
        self.output['object_title'] = _(u"%s / %s") % (
            self.object._proje_adi(), self.object.get_gundem_tipi_display())
        sonuc = _(u"Sonuçlandı") if self.output['object'][u'Kararın Sonuçlandırılması'] == u'True' \
            else _(u"Sonuçlanmadı")

        self.output['object'][u'Kararın Sonuçlandırılması'] = sonuc
        del self.output['object'][u'Gündem Ekstra Bilgileri']
示例#10
0
def get_model_permissions(permission_list=None):
    from pyoko.model import model_registry
    from zengine.views.crud import CrudView
    generic_commands = CrudView().VIEW_METHODS.keys()
    permissions = permission_list or []
    for model in model_registry.get_base_models():
        model_name = model.__name__
        permissions.append((model_name, model_name, ""))
        for cmd in generic_commands:
            if cmd in ['do']:
                continue
            permissions.append(("%s.%s" % (model_name, cmd),
                                "Can %s %s" % (cmd, model_name), ""))

    return permissions
示例#11
0
def _get_model_permissions(permission_list=None):
    from pyoko.model import model_registry
    from zengine.views.crud import CrudView
    generic_commands = CrudView().VIEW_METHODS.keys()
    permissions = permission_list or []
    enabled_models = _get_object_menu_models()
    for model in model_registry.get_base_models():
        model_name = model.__name__
        permissions.append((model_name, model_name, ""))
        if model_name not in enabled_models:
            # no matter if it's available as CRUD or not,
            # we may need a ListBox for any model
            permissions.append(("%s.select_list" % model_name,
                                "Listbox for %s" % model_name, ""))
            continue

        for cmd in generic_commands:
            if cmd in ['do']:
                continue
            permissions.append(("%s.%s" % (model_name, cmd),
                                "Can %s %s" % (cmd, model_name), ""))

    return permissions
示例#12
0
 def __init__(self, current=None):
     CrudView.__init__(self, current)
     self.ListForm.add = fields.Button(__(u"Tekliflerimi Göster"), cmd='tekliflerim')
     self.model_class.Meta.verbose_name_plural = __(u"Teklife Açık Bütçe Kalemi Satın Almaları")
     self.firma = self.current.user.bap_firma_set[0].bap_firma
示例#13
0
 def __init__(self, current=None):
     CrudView.__init__(self, current)
     self.ListForm.add = None
示例#14
0
 def __init__(self, current):
     CrudView.__init__(self, current)
     if 'personel_id' not in self.current.task_data:
         self.current.task_data["personel_id"] = self.current.input["id"]
示例#15
0
 def __init__(self, current):
     self.ObjectForm = SaglikRaporuForm
     CrudView.__init__(self, current)
     if 'personel_id' not in self.current.task_data:
         self.current.task_data["personel_id"] = self.current.input["id"]
 def list(self, custom_form=None):
     CrudView.list(self)
     form = JsonForm(title=_(u"Sıkça Sorulan Sorular"))
     form.ekle = fields.Button(_(u"Ekle"), cmd='add_edit_form')
     self.form_out(form)
示例#17
0
 def __init__(self, current):
     CrudView.__init__(self, current)
     if self.cmd != 'confirm_deletion' and self.cmd != 'delete' \
             and 'object_id' in self.current.task_data:
         del self.current.task_data['object_id']
示例#18
0
 def __init__(self, current):
     CrudView.__init__(self, current)
     if not self.object.key:
         self.object = self.model_class.objects.get(
             self.current.task_data['bap_proje_id'])
示例#19
0
 def __init__(self, current=None):
     CrudView.__init__(self, current)
     self.ListForm.add = None
     self.model_class.Meta.verbose_name_plural = __(
         u"Firma Başvuru Değerlendirmeleri")
示例#20
0
 def save(self):
     CrudView.save(self)
     self.object.ekleyen = self.current.user
     self.object.yayinlanmis_mi = False
     self.object.blocking_save()
示例#21
0
 def delete(self):
     self.object = BAPIsPaketi.objects.get(self.current.task_data['is_paketi_id'])
     CrudView.delete(self)
     del self.current.task_data['is_paketi_id']
示例#22
0
 def __init__(self, current):
     CrudView.__init__(self, current)
     if 'object_id' in self.current.task_data and self.cmd == 'add_edit_form' and \
             'object_id' not in self.input:
         del self.current.task_data['object_id']
         self.object = BAPTakvim()
示例#23
0
 def list(self, custom_form=None):
     custom_form = TakvimListForm()
     CrudView.list(self, custom_form)