コード例 #1
0
def ajax_reject_report_submission(request):
    if request.method == 'POST':
        report_submission_id = request.POST['id']
        
        report_submission = ReportSubmission.objects.get(pk=report_submission_id)
        report_submission.state = REJECTED_ACTIVITY
        report_submission.approval_on = datetime.now()
        report_submission.save()
        
        return HttpResponse(simplejson.dumps({'timestamp':format_abbr_datetime(report_submission.approval_on)}))
        
    else:
        raise Http404
コード例 #2
0
def display_report_sending_notice(submission):
    if submission.this_is == 'overdue':
        return unicode('<div class="notice overdue">เลขกำหนดส่งมาแล้ว ',
                       'utf-8') + utilities.week_elapse_text(
                           submission.schedule_date) + '</div>'
    elif submission.this_is == 'waiting':
        return unicode(
            '<div class="notice waiting">กำลังรอการอนุมัติรายงาน</div>',
            'utf-8')
    elif submission.this_is == 'rejected':
        return unicode(
            '<div class="notice rejected">รายงานถูกตีกลับเมื่อวันที่ ',
            'utf-8') + utilities.format_abbr_datetime(
                submission.approval_date) + '</div>'
    return ''
コード例 #3
0
def ajax_reject_report_submission(request):
    if request.method == 'POST':
        report_submission_id = request.POST['id']

        report_submission = ReportSubmission.objects.get(
            pk=report_submission_id)
        report_submission.state = REJECTED_ACTIVITY
        report_submission.approval_on = datetime.now()
        report_submission.save()

        return HttpResponse(
            simplejson.dumps({
                'timestamp':
                format_abbr_datetime(report_submission.approval_on)
            }))

    else:
        raise Http404
コード例 #4
0
def display_report_sending_notice(submission):
    if submission.this_is == 'overdue':
        return unicode('<div class="notice overdue">เลขกำหนดส่งมาแล้ว ', 'utf-8') + utilities.week_elapse_text(submission.schedule_date) + '</div>'
    elif submission.this_is == 'waiting':
        return unicode('<div class="notice waiting">กำลังรอการอนุมัติรายงาน</div>', 'utf-8')
    elif submission.this_is == 'rejected':
        return unicode('<div class="notice rejected">รายงานถูกตีกลับเมื่อวันที่ ', 'utf-8') + utilities.format_abbr_datetime(submission.approval_date) + '</div>'
    return ''
コード例 #5
0
def abbr_datetime(datetime):
    return utilities.format_abbr_datetime(datetime)
コード例 #6
0
def abbr_datetime(datetime):
    return utilities.format_abbr_datetime(datetime)