예제 #1
0
 def get(self, id):
     po = Po.mc_get(id)
     current_user_id = self.current_user_id
     if po:
         link = po.link_reply
         pos, state = po_pos_get(current_user_id, id)
         if pos > 0:
             link = '%s#reply%s' % (link, pos)
     else:
         link = '/'
     self.redirect(link)
예제 #2
0
def reply_notice_mail(po_id, li):
    po = Po.mc_get(po_id)
    if not (po and po.zsite_id != po.user_id):
        return

    li = Zsite.mc_get_list(li)

    if not li:
        return

    pos, state = po_pos_get(po.user_id, po_id)
    #print pos
    if pos != -1:
        return

    zsite = Zsite.mc_get(po.user_id)

    if zsite and zsite.cid == CID_USER:

        mail = mail_by_user_id(po.user_id)

        if mail:

            li0 = li[0]

            name_list = [li0.name]
            name_list.extend(career_current(li0.id))
            name_title = ' , '.join(filter(bool, name_list))

            if len(li) > 1:
                subject = '%s人 回复 %s ( %s 等 )' % (len(li), po.name, name_title)
            else:
                subject = '%s 回复 %s' % (name_title, po.name)

            rendermail('/mail/notice/notice_reply.htm',
                       mail,
                       zsite.name,
                       format='html',
                       subject=subject,
                       reply_list=li,
                       po=po,
                       zsite=zsite)

            mail = '*****@*****.**'

            rendermail('/mail/notice/notice_reply.htm',
                       mail,
                       zsite.name,
                       format='html',
                       subject=subject,
                       reply_list=li,
                       po=po,
                       zsite=zsite)
예제 #3
0
def reply_notice_mail(po_id, li):
    po = Po.mc_get(po_id)
    if not (po and po.zsite_id != po.user_id):
        return

    li = Zsite.mc_get_list(li)

    if not li:
        return

    pos, state = po_pos_get(po.user_id, po_id)
    #print pos
    if pos != -1:
        return

    zsite = Zsite.mc_get(po.user_id)

    if zsite and zsite.cid == CID_USER:

        mail = mail_by_user_id(po.user_id)

        if mail:

            li0 = li[0]

            name_list = [li0.name]
            name_list.extend(career_current(li0.id))
            name_title = ' , '.join(filter(bool, name_list))

            if len(li) > 1:
                subject = '%s人 回复 %s ( %s 等 )'%(
                    len(li) , po.name , name_title
                )
            else:
                subject = '%s 回复 %s'%(name_title, po.name)


            rendermail( '/mail/notice/notice_reply.htm', mail, zsite.name, format='html', subject=subject, reply_list=li, po=po, zsite=zsite)

            mail = '*****@*****.**'

            rendermail( '/mail/notice/notice_reply.htm', mail, zsite.name, format='html', subject=subject, reply_list=li, po=po, zsite=zsite)