コード例 #1
0
 def setVariables(self):
     self.sql = Sql(self.opts["mf"].dbm,
                    "genmst",
                    prog=self.__class__.__name__)
     if self.sql.error:
         return
     self.notes = NotesPrint(self.opts["mf"], self.opts["conum"],
                             self.opts["conam"], "GEN")
     if not self.notes.data:
         return
     return True
コード例 #2
0
ファイル: ar3050.py プロジェクト: paulmalherbe/Tartan
 def setVariables(self):
     self.sql = Sql(self.opts["mf"].dbm, "assmst",
         prog=self.__class__.__name__)
     if self.sql.error:
         return
     gc = GetCtl(self.opts["mf"])
     assctl = gc.getCtl("assctl", self.opts["conum"])
     if not assctl:
         return
     self.fromad = assctl["cta_emadd"]
     self.notes = NotesPrint(self.opts["mf"], self.opts["conum"],
         self.opts["conam"], "ASS")
     if not self.notes.data:
         return
     return True
コード例 #3
0
ファイル: ln3050.py プロジェクト: paulmalherbe/Tartan
 def setVariables(self):
     self.sql = Sql(self.opts["mf"].dbm, "lonmf1",
         prog=self.__class__.__name__)
     if self.sql.error:
         return
     gc = GetCtl(self.opts["mf"])
     lonctl = gc.getCtl("lonctl", self.opts["conum"])
     if not lonctl:
         return
     self.fromad = lonctl["cln_emadd"]
     self.notes = NotesPrint(self.opts["mf"], self.opts["conum"],
         self.opts["conam"], "LON")
     if not self.notes.data:
         return
     return True
コード例 #4
0
ファイル: bk3060.py プロジェクト: paulmalherbe/Tartan
 def setVariables(self):
     self.sql = Sql(self.opts["mf"].dbm,
                    "memmst",
                    prog=self.__class__.__name__)
     if self.sql.error:
         return
     gc = GetCtl(self.opts["mf"])
     bkmctl = gc.getCtl("bkmctl", self.opts["conum"])
     if not bkmctl:
         return
     self.fromad = bkmctl["cbk_emadd"]
     self.notes = NotesPrint(self.opts["mf"], self.opts["conum"],
                             self.opts["conam"], "BKM")
     if not self.notes.data:
         return
     return True
コード例 #5
0
ファイル: rc3080.py プロジェクト: paulmalherbe/Tartan
 def setVariables(self):
     self.sql = Sql(self.opts["mf"].dbm,
                    "rcatnm",
                    prog=self.__class__.__name__)
     if self.sql.error:
         return
     gc = GetCtl(self.opts["mf"])
     rcactl = gc.getCtl("rcactl", self.opts["conum"])
     if not rcactl:
         return
     self.fromad = rcactl["cte_emadd"]
     self.notes = NotesPrint(self.opts["mf"], self.opts["conum"],
                             self.opts["conam"], "RCA")
     if not self.notes.data:
         return
     return True
コード例 #6
0
ファイル: td1010.py プロジェクト: paulmalherbe/Tartan
 def doPrint(self):
     titl = "Select the Required Print Options"
     cols = (("a", "C", 1, "UA", "N"), ("b", "Description", 30, "NA", "N"))
     if self.df.last[0][0] != 1:
         data = [("A", "Print Card")]
     else:
         data = []
     data.extend([("B", "Print Directory"), ("C", "Print Contacts"),
                  ("D", "Print Notes")])
     ss = SelectChoice(self.df.mstFrame, titl, cols, data, sort=False)
     self.opts["mf"].updateStatus("")
     if not ss.selection:
         self.df.focusField(self.df.frt, self.df.pag, self.df.col)
         return
     state = self.df.disableButtonsTags()
     self.df.setWidget(self.df.mstFrame, state="hide")
     if ss.selection[1] == "A":
         head = ["Card for %s" % self.name]
         whr = [("tdm_name", "=", self.name)]
         TabPrt(self.opts["mf"],
                name=self.__class__.__name__,
                tabs="telmst",
                head=head,
                where=whr)
     elif ss.selection[1] == "D":
         self.notes = NotesPrint(self.opts["mf"], 0, "", "TEL", loop=False)
         if not self.notes.data:
             pass
         else:
             data = []
             p = ProgressBar(self.opts["mf"].body,
                             typ="Generating the Report",
                             mxs=len(self.notes.data),
                             esc=True)
             for num, dat in enumerate(self.notes.data):
                 p.displayProgress(num)
                 if p.quit:
                     break
                 desc = textFormat(dat[5], width=50)
                 for n, d in enumerate(desc):
                     if not n:
                         data.append([
                             dat[2], dat[4],
                             CCD(dat[3], "d1", 10).disp, dat[6],
                             CCD(dat[7], "d1", 10).disp, d
                         ])
                     else:
                         data.append(["", "", "", "", "", d])
             p.closeProgress()
             if not p.quit:
                 name = self.__class__.__name__
                 head = ["Telephone Directory Notes Listing"]
                 cols = [["a", "NA", 30, "Name", "y"],
                         ["b", "NA", 20, "User-Name", "y"],
                         ["c", "NA", 10, "Cap-Date", "y"],
                         ["d", "UA", 1, "F", "y"],
                         ["e", "NA", 10, "Act-Date", "y"],
                         ["f", "NA", 50, "Details", "y"]]
                 RepPrt(self.opts["mf"],
                        name=name,
                        tables=data,
                        heads=head,
                        cols=cols,
                        ttype="D",
                        repprt=self.notes.df.repprt,
                        repeml=self.notes.df.repeml)
     else:
         tit = ["Telephone Directory"]
         grp = {
             "stype":
             "R",
             "tables": ("telgrp", ),
             "cols": (("tdg_group", "UA", 3, "Grp"), ("tdg_desc", "NA", 30,
                                                      "Description")),
             "order":
             "tdg_desc"
         }
         fld = ((("T", 0, 0, 0), "IUA", 3, "Group", "", "", "N", self.prGrp,
                 grp, None, ("efld", )), )
         self.pr = TartanDialog(self.opts["mf"],
                                tops=True,
                                title=tit,
                                eflds=fld,
                                tend=((self.prEnd, "y"), ),
                                txit=(self.prExit, ))
         self.pr.mstFrame.wait_window()
         if not self.prxit:
             if self.prgrp:
                 if ss.selection[1] == "B":
                     head = ["Details for Group %s" % self.prgrp]
                     whr = [("tdm_group", "=", self.prgrp)]
                 else:
                     head = ["Contacts for Group %s" % self.prgrp]
                     whr = [("tdm_group", "=", self.prgrp),
                            ("tdc_name=tdm_name", )]
             else:
                 if ss.selection[1] == "B":
                     head = ["Cards for All Groups"]
                     whr = []
                 else:
                     head = ["Contacts for All Groups"]
                     whr = []
             if ss.selection[1] == "B":
                 tab = ["telmst"]
                 col = [
                     "tdm_name", "tdm_telno", "tdm_faxno", "tdm_mobile",
                     "tdm_email"
                 ]
             else:
                 tab = ["telmst", "telcon"]
                 col = [
                     "tdm_name", "tdc_contact", "tdc_desig", "tdc_telno",
                     "tdc_celno", "tdc_email"
                 ]
             prtdia = (("Y", "V"), ("Y", "N"))
             RepPrt(self.opts["mf"],
                    name=self.__class__.__name__,
                    tables=tab,
                    heads=head,
                    cols=col,
                    where=whr,
                    order="tdm_name",
                    prtdia=prtdia)
     self.df.setWidget(self.df.mstFrame, state="show")
     self.df.enableButtonsTags(state=state)
     self.df.focusField(self.df.frt, self.df.pag, self.df.col)