Esempio n. 1
0
File: shot.py Progetto: onetera/sp
	def view2(self, id):
		
		try:
			# 단순히 Get해서 레코드를 가져오기 보다는 MAttr까지 가져와야하니까~~ 좀더 신중하게	  
			viewColStr = "Shot.IDX,Shot.Code,Shot.ViewTemplate,Shot.Name,Shot.TypeCode,Shot.StatCode,Shot.Content," \
						 "Shot.Thumb,Shot.Preview,Shot.CreateDate,Shot.Parent1,Shot.Parent2,Project.Name,Project.Code,Seq.Name,Seq.Code"
			
			row = Archive(self.archiveName).View(id, viewColStr)
			
			if (row["Shot_ViewTemplate"] != None) and (row["Shot_ViewTemplate"] != ""):
				TemplateSkin = row["Shot_ViewTemplate"]
			elif gTable["Shot_Type"][row["Shot_TypeCode"]]["ViewTemplate"] != None:
				TemplateSkin = gTable["Shot_Type"][row["Shot_TypeCode"]]["ViewTemplate"]
			else:
				TemplateSkin = "%s_View.html" % self.archiveName			
			
			for (k,v) in row.items():
				if (type(v) == datetime.datetime) : v = v.strftime("%Y-%m-%d %H:%M")
				if (type(v) in (str, unicode)): v = escape(v)
				setattr(c, k.replace(".","_") , HTML(v) )
			
			c.IDX  = id
			
			return render(TemplateSkin)		   
		
		except Exception as err:		
			traceback.print_exc(file=sys.stdout)			
			return str(err)
Esempio n. 2
0
	def schedules(self):
		
		clist  = "Task.IDX,Task.Name,Task.TypeCode,Task_Type.Name,Task.StatCode,Task_Stat.Name,Task_Stat.Color,Task.EstStart,Task.EstDue,Shot.IDX,Shot.Name"
		sort1  = "Task.EstStart ASC"
		query1 = "Task.StatCode == ACT,Task.AssignUser == " + session["UserID"]
		
		minDate = datetime.datetime.now()
		maxDate = datetime.datetime.now()
		
		#[4, "Ted", "Personal Returns", "2/3/2009 17:00:00", "2/9/2009 18:30:00", 1]
		# 다른걸 이용하세요! outMode="raw"
		RDB = ArchiveJSON(Archive="Task", Columns=clist, Sort=sort1, Query=query1).renderData2()
		outData = []
		for row in RDB[1]:
			rowData = '[%s,"%s","%s","%s","%s",0]'
			
			if minDate > row["Task_EstStart"]:
				minDate = row["Task_EstStart"]
			if maxDate < row["Task_EstDue"]:
				maxDate = row["Task_EstDue"]
			
			outData.append(rowData % (row["Task_IDX"], row["Task_Name"], row["Task_Name"], row["Task_EstStart"].strftime("%m/%d/%Y 00:00:00"), row["Task_EstDue"].strftime("%m/%d/%Y 00:00:00")) )					  
		
		minDate = minDate - datetime.timedelta(1)
		maxDate = maxDate + datetime.timedelta(1)
		
		c.outData = ",".join(outData)
		c.minDate = "%s/%s/%s 00:00:00" % (minDate.month, minDate.day, minDate.year) 
		c.maxDate = "%s/%s/%s 23:59:59" % (maxDate.month, maxDate.day, maxDate.year)
		
		return render("Private_Schedule.html")
Esempio n. 3
0
File: board.py Progetto: onetera/sp
	def main(self):
		""" 포럼 메인에 미니게시판 출력 """
		
		if CheckNotAdmin():
			accLevel = session["UserType"]
			accField = "AdminBoard.AccessView"
		else:
			accLevel = None
			accField = None
		
		rx = Archive("AdminBoard").getRecords("AdminBoard.ViewMode == 2", "BCode,BName,BType,ViewMode", "AdminBoard.SortNumber ASC", accField=accField, accLevel=accLevel )		  
		bList = "";tList = [];cList = []
		 
		for board1 in rx:
			boardtable = board1["BCode"]
			boardaddr  = "/board/list/%s" % boardtable
			boardname  = board1["BName"]
			
			bList = addStr(bList, "[%s]" %(self.mini_list(boardtable, boardname)))
			
			tList.append("'"+boardname+"'")
			cList.append("'"+boardtable+"'")
			
		c.BoardNames  = HTML("var BoardName = [%s];" % (",".join(tList)) )			   
		c.BoardCodes  = HTML("var BoardCode = [%s];" % (",".join(cList)) )
		c.BoardList   = HTML( "var BoardData = [%s];" % (bList) )
		
		return render("Board_Main.html")
Esempio n. 4
0
File: statis.py Progetto: onetera/sp
	def index(self):			
		autoFrameData(c, __name__)
		
		c.firstLoadPage  = "/statis/proj_list/"
		c.firstLoadTitle = u"프로젝트 현황"
		c.leftAccordPanels = """[{title:"Statistics",url:"/statis/menu/",rootText:"All Takes",iconCls:"icon-workspace",disableEdit:true}]"""
		
		return render("frame.html")
Esempio n. 5
0
File: take.py Progetto: onetera/sp
	def index(self):
		autoFrameData(c, __name__ )
		
		c.firstLoadPage  = "/lister/list2/take2ready/"
		c.firstLoadTitle = u"승인대기중 작업물"
		c.leftAccordPanels = """[{title:"Navigation",url:"/take/menu/",rootText:"All Takes",iconCls:"icon-workspace",disableEdit:true}]"""
		
		return render("frame.html")
Esempio n. 6
0
File: test.py Progetto: onetera/sp
	def index(self):		
		
		autoFrameData(c, "/test/")		 
		c.firstLoadPage  = "/test/main/"
		c.firstLoadTitle = "My Pages"
		c.leftAccordPanels = """[{title:"Navigation",url:"/private/menu/",rootText:"My Pages2",iconCls:"icon-workspace",disableEdit:true},{title:"Settings",url:"/private/menu2/",rootText:"settings",iconCls:"icon-folder-wrench",disableEdit:true}]"""
		
		return render("frame.html")
Esempio n. 7
0
File: help.py Progetto: onetera/sp
	def index(self):
		
		autoFrameData(c, __name__)
		c.firstLoadPage  = "/help/main/"
		c.firstLoadTitle = "Help Main"
		c.leftAccordPanels	= """[{title:"Navigation", iconCls:"icon-workspace", url:"/help/menu/", place:"HELP" }]"""				   
		# 헬프 아이콘
		return render("frame.html")
Esempio n. 8
0
File: board.py Progetto: onetera/sp
	def index(self):
		autoFrameData(c, __name__)
		
		c.firstLoadPage  = "/board/main/"
		c.firstLoadTitle = "Forum"
		c.leftAccordPanels	= """[{title:"Navigation",url:"/board/menu/", rootText:"Boards", iconCls:"icon-workspace",disableEdit:true}]""" 
		
		return render("frame.html")
Esempio n. 9
0
	def view_shots_need_confirm_for_project(self):
		#컨펌할 샷 데이터를 로드하는 주소
		c.url_shot_list_need_extern_confirm = url(controller=MODULE_NAME, action="get_shots_that_need_confirm_for_project", id=75);
		
		#한페이지에 표시할 샷의 수
		c.shot_count_per_page = 20;
		
		return render("view_shots_need_confirm_for_project.html");		
Esempio n. 10
0
	def index(self):
		#스파르타 상단의 사용자 정보에 사용자 아이디와 메일 수신 아이콘 처리 및 로그인 검사하는 함수
		autoFrameData(c, "/"+MODULE_NAME);
		
		c.firstLoadPage  = url(controller=MODULE_NAME, action="view_shots_need_confirm_for_project")
		c.firstLoadTitle = u"[우샤] 감독 리뷰"
		c.leftAccordPanels = u"""[{title:"Navigation",url:"/%s/menu",rootText:"All Tasks",iconCls:"icon-folder-go"}]"""%(MODULE_NAME)
		return render("frame_for_external_confirm.html");
Esempio n. 11
0
File: login.py Progetto: onetera/sp
	def index(self, msg=None):
		
		c.MSG = msg 
		
		if "preurl" in request.params:
			c.preurl = request.params["preurl"]
		else:
			c.preurl = ""
		return render("login.html")
Esempio n. 12
0
	def index(self):
		#스파르타 상단의 사용자 정보에 사용자 아이디와 메일 수신 아이콘 처리 및 로그인 검사하는 함수
		autoFrameData(c, "/"+MODULE_NAME);

		#c.firstLoadPage = MODULE_NAME+"/view_all_resource_schedule_overview/"
		c.firstLoadPage = url(controller=MODULE_NAME, action="view_resource_role")
		c.firstLoadTitle = u"전체 인력 현황"
		c.leftAccordPanels = u"""[{title:"Navigation",url:"/%s/menu",rootText:"All Tasks",iconCls:"icon-folder-go"}]"""%(MODULE_NAME)
		return render("frame.html");
Esempio n. 13
0
File: admin.py Progetto: onetera/sp
	def index(self):
		autoFrameData(c, __name__)
		if CheckNotAdmin(): return "<script>alert('관리자만 접근할수 있습니다.');history.go(-1)</script>"
		
		c.firstLoadPage  = "/admin/main/"
		c.firstLoadTitle = "Admin"
		c.leftAccordPanels	= """[{title:"Navigation",url:"/admin/menu/",rootText:"Boards",iconCls:"icon-workspace", disableEdit:true}]"""
		
		return render("frame.html")
Esempio n. 14
0
	def sp1opt(self):
		#[TODO] 관리자만 접근하게				 
		c.topTitle1 = gTable["Config"]["SPARTA_TOPTITLE"][1]
		c.topTitle2 = gTable["Config"]["SPARTA_TOPTITLE"][2]
		c.brwTitle = gTable["Config"]["SPARTA_BRWTITLE"][1]
		
		c.ownComNameKr = gTable["Config"]["OWNCOMNAMEKR"][1]		
		c.ownComNameEng = gTable["Config"]["OWNCOMNAMEENG"][1]
		c.ownComPhone = gTable["Config"]["OWNCOMPHONE"][1]
		c.ownComFax = gTable["Config"]["OWNCOMFAX"][1]
		c.ownComAddr = gTable["Config"]["OWNCOMADDR"][1]
		
		return render("AdminSparta_Options1.html")
Esempio n. 15
0
	def view_resource_role(self, id=None):
	
		#인력별 데이터를 제공하는 주소
		c.data_url = u"/%s/get_resource_role_data_as_json" % (MODULE_NAME);
		if (id is not None):
			c.data_url += u"/%s" % (id);
			
		c.role_columns, c.role_data_fields = self.get_resource_column_data_as_string();
		if (request.params.has_key("project_id_list")):
			c.project_id_list = request.params["project_id_list"];
		else:
			c.project_id_list = "[]";
		
		return render("view_resource_role.html");
Esempio n. 16
0
File: take.py Progetto: onetera/sp
	def view2(self, id):
		
		try:
			# 단순히 Get해서 레코드를 가져오기 보다는 MAttr까지 가져와야하니까~~ 좀더 신중하게
			
			viewColStr = "Take.IDX,Take.Name,Take.Code,Take_Stat.Color,Take_Stat.Name,Take_Type.Name," \
				 "Take.Confirmer,Take.Content,Take.Version,Take.Preview,Take.SceneFile,Take.Files,Take.CreateBy,Take.CreateDate," \
				 "Seq.Name,Shot.Name,Task.Name,Shot.IDX,Task.IDX,Seq.IDX"
				   
			row = Archive(self.archiveName).View(id, viewColStr)
			
			for (k,v) in row.items():
				if (type(v) == datetime.datetime) : v = v.strftime("%Y-%m-%d %H:%M")
				
				if k == "Take_Files" and v:
					fList = json.loads( v, "utf8" )
					textOut = ""
					
					for nFile in fList:
						tempPath = seqstyle.convertSequenceStyle(nFile["Name"], "DJV")
						pPath = sv.Convert.FixPath(nFile["Path"]+"/"+tempPath)
						
						textOut += """<a href="%s">%s</a><br/>""" % (pPath, nFile["Name"])
						
					c.Take_Files = HTML( textOut )
			
				elif k == "Take_SceneFile" and v:
					scenePath = os.path.split(v)
					sceneFile = scenePath[1]
					scenePath = sv.Convert.FixPath(scenePath[0])
					
					c.Take_SceneFile = HTML( """<a target="_new" href="%s">%s</a>""" % (scenePath,sceneFile) )
					
				elif k == "Take_Preview" and v:
					movFile = os.path.split(v)[1]
					movPath = v #sv.Convert.FixPath(v)	#임시픽스
					
					c.Take_Preview = HTML( """<a target="_new" href="%s" rexxl="lightbox">%s</a>""" % (movPath,movFile) )
					
				else:
					setattr(c, k.replace(".","_") , HTML(v) )
			 
			c.PNID = "PN_%s_%s" % (self.archiveName, id)	# 다른 페이지에서 아직 쓴다.
			c.IDX  = id
			return render("%s_View.html" % self.archiveName)
		
		except Exception as err:
			traceback.print_exc(file=sys.stdout)
			return str(err)
Esempio n. 17
0
	def view_all_resource_schedule_overview(self, id=None):

		#모든 인력의 목록을 JSON 으로 리턴해주는 주소
		c.resource_list_data_url = u"/%s/get_resource_data_as_json"%(MODULE_NAME);

		#모든 인력의 작업 일정 정보를 JSON 으로 리턴해주는 주소
		c.resource_schedule_data_url = u"/%s/get_resource_schedule_data_as_json"%(MODULE_NAME);
		
		#특정 프로젝트에 대한 정보만 얻고자할 경
		if (id is not None):
			c.resource_schedule_data_url += u"/%s" % (id);
			c.resource_list_data_url += u"/%s" % (id);
			
		#작업에 관한 정보를 변경시킬때 사용할 주소
		c.move_task_url = u"/%s/move_task"%(MODULE_NAME);

		return render("view_all_resource_schedule_overview.html");
Esempio n. 18
0
	def index(self):
		
		#b = sv.Login.Check()
		c.UserID   = session["UserID"]
		c.UserName = session["UserName"]
			
		c.firstLoadPage  = "/schedule/schedules/"
		c.firstLoadTitle = u"진행중 작업 스케쥴"
		c.leftAccordPanels = """[{title:"Navigation",url:"/schedule/menu/",rootText:"All Tasks",iconCls:"icon-folder-go"}]"""
	
		# 메일 아이콘 처리		  
		CntNonRead = Archive.RunQuery("select count(IDX) from Message where SendTo = :id and IsRead =0", id=session["UserID"])[0][0]
		if CntNonRead > 0:
			c.MailIcon = "zzok_on.gif"
		else:
			c.MailIcon = "zzok_off.gif"  
		
		return render("frame.html")    
Esempio n. 19
0
    def view2(self, id, id2=None):
        from genshi.core import escape  # [SH] Added

        try:
            row = Archive(self.archiveName).View(id, self.viewColStr)
            for (k, v) in row.items():
                if type(v) == datetime.datetime:
                    v = v.strftime("%Y-%m-%d %H:%M")
                if type(v) in (str, unicode):
                    v = escape(v)  # [SH] Added
                setattr(c, k.replace(".", "_"), HTML(v))

            c.PNID = "PN_%s_%s" % (self.archiveName, id)  # 다른 페이지에서 아직 쓴다.
            c.IDX = id

            return render("%s_View.html" % self.archiveName)

        except Exception as err:
            traceback.print_exc(file=sys.stdout)
            return str(err)
Esempio n. 20
0
File: task.py Progetto: onetera/sp
	def view2(self, id=None):
		
		try:
			# 단순히 Get해서 레코드를 가져오기 보다는 MAttr까지 가져와야하니까~~ 좀더 신중하게
			viewColStr = "Task.IDX,Task.Name,Task.Code,Task.Parent1,Task.Parent2,Task.Parent3,Task.StatCode,Task.TypeCode," \
						 "Project.Name,Project.Code,Seq.Name,Seq.Code,Shot.Name,Shot.Code,Task.Thumb"
			
			row = Archive(self.archiveName).View(id, viewColStr)
						
			for (k,v) in row.items():
				if (type(v) == datetime.datetime) : v = v.strftime("%Y-%m-%d %H:%M")
				setattr(c, k.replace(".","_") , HTML(v) )
			
			c.IDX  = id
			
			return render("%s_View.html" % self.archiveName)
		
		except Exception as err:
			traceback.print_exc(file=sys.stdout)
			return str(err)
Esempio n. 21
0
    def attr_ctrl(self, id=None, id2=None):

        arName = self.archiveName

        mattrData = gTable[arName + "_MAttr"][id]
        c.DataType = mattrData["DataType"]
        c.DataValue = mattrData["DefaultValue"]

        if mattrData["Items"] != None:
            mItemData = mattrData["Items"].replace(",", "'],['")
        else:
            mItemData = ""
        c.Items = "['" + mItemData + "']"

        shotData = Archive(arName).getValues(id2, arName + ".MainCols," + arName + "." + id)

        # 메인 컬런인지 여부를 샷데이터에서 조회해서 채크해둠 :
        if shotData["MainCols"] == None:
            mainCols = ""
        else:
            mainCols = shotData["MainCols"]

        if (arName + "." + id) in mainCols.split(","):
            c.IsMain = "true"
        else:
            c.IsMain = "false"

        if shotData[id]:
            c.DataValue = shotData[id]
        else:
            c.DataValue = ""

        if c.DataType == "datefield":
            if type(shotData[id]) == datetime:
                c.DataValue = shotData[id].strftime("%m/%d/%y")

        if "\r\n" in c.DataValue:
            c.DataValue = c.DataValue.replace("\r\n", "\\n\\\r\n")

        return render("Control_Attr_View.html")
Esempio n. 22
0
File: lister.py Progetto: onetera/sp
	def list(self, id, id2=None):
		
		autoFrameData(c, __name__)
		ListerTbl = gTable["Lister"][id]
		
		if not ListerTbl:
			return u"리스트 코드가 DB내에 존재하지 않습니다."
			#[TODO] 에러메세지 성의있게..  걍 문자열 말고 간지나게
		
		# ProjectIDX가 Null이면 입력되는 파라메타에 따라서 변형되는 리스트임 
		if ListerTbl["ProjectIDX"]:
			pidx = str(ListerTbl["ProjectIDX"])
		else:
			pidx = str(id2)
		
		leftm = "/" + ListerTbl["Place"].lower() + "/menu/"+pidx
		
		c.firstLoadPage  = "/lister/list2/%s/%s" % ( str(id), pidx )
		c.firstLoadTitle = ListerTbl["Title"]
		c.leftAccordPanels = """[{title:"Navigation",url:"%s",rootText:"Boards",iconCls:"icon-folder-go"}]""" % leftm
		
		return render("frame.html") 
Esempio n. 23
0
    def view(self, id):

        hereURL = "/%s/view/%s" % (self.archiveName.lower(), str(id))
        autoFrameData(c, hereURL)

        if self.archiveName != "Project":
            pidx = Archive(self.archiveName).getValue(id, "Parent1")
        else:
            pidx = id

        if pidx == None:
            return "삭제된 데이터 입니다"

        c.IDX = id
        c.firstLoadPage = "/%s/view2/%s" % (self.archiveName.lower(), str(id))
        c.firstLoadTitle = u"%s %s" % (self.archiveName, str(id))
        c.leftAccordPanels = (
            """[{title:"Navigation", iconCls:"icon-workspace", url:"/project/menu/%s", projectIDX:%s, place:"PROJECT" }]"""
            % (pidx, pidx)
        )

        return render("frame.html")
Esempio n. 24
0
File: board.py Progetto: onetera/sp
	def list(self, id, id2=None):
		boardID = str(id)
		tName	= None
		
		rx = Archive("AdminBoard").getRecords("", "BCode,BName,DisplayCate,DisplayStat,DisplayReply", "AdminBoard.SortNumber ASC" )

		for board1 in rx:
			if boardID == board1["BCode"]:
				tName = board1["BName"] 
				DsCate = board1["DisplayCate"]
				DsStat = board1["DisplayStat"]
				DsReply = board1["DisplayReply"]
		
		# 게시판 출력
		if tName:
			c.BoardCode = boardID
			c.BoardName = tName
			c.DisplayCate = DsCate
			c.DisplayStat = DsStat
			c.DisplayReply = DsReply
		else:
			return u"잘못된 게시판 ID 이거나 권한이 없습니다."
		
		return render("Board_List.html")
Esempio n. 25
0
File: user.py Progetto: onetera/sp
	def list2(self):
		return render("User_Artist2_List.html")
Esempio n. 26
0
	def list(self):
		return render("AdminProject_List.html")
Esempio n. 27
0
File: user.py Progetto: onetera/sp
	def list(self):
		return render("User_List.html")
Esempio n. 28
0
File: board.py Progetto: onetera/sp
	def view(self, id, id2):
		""" 게시물 읽기. 템플릿에 직접 값을 넣는 다 """
		boardID = str( id )		#[NOTE] unicode to string
		tName = None
		
		# 게시판 형태를 맞추기 위한 게시판 설정을 읽어온다.
		rx = Archive("AdminBoard").getRecords("AdminBoard.BCode == " + boardID, "BName,DisplayCate,DisplayStat,DisplayReply,AccessReply", "AdminBoard.SortNumber ASC" )
		
		for board1 in rx:
			tName	= board1["BName"]
			DsCate	= board1["DisplayCate"]
			DsStat	= board1["DisplayStat"]
			DsReply = board1["DisplayReply"]
			AlReply = board1["AccessReply"]
				
		# 게시물 레코드 읽기 
		colStr = "CreateBy,CreateByName,Title,BoardID,Content,ViewCount,CreateDate,UploadName1,UploadLink1"		   
		row = Archive("Board").getValues("Board.IDX == " + id2, colStr )
		
		if not tName: return HTML(u'<font color="red">잘못된 게시판 코드 입니다.</font>')
		if not row: return HTML(u'<font color="red">존재하지 않는 게시물입니다</font>')
		if boardID != row["BoardID"]:  return HTML(u'<font color="red">잘못된 접근 입니다.</font>')
		
		#[TODO] 아래주석 확인
		# 권한 채킹 if CheckLevel("AdminBoard", "AccessRead", "AdminBoard.BCode == " + boardID):
		# else:c.Content = HTML(u'<font color="red">볼수 있는 권한이 없습니다.</font>')
		
		# 여기서부터 게시물 출력
		c.IDX = id2
		c.PNID = "PN_Board_%s" % id2
		c.BoardCode = boardID
		c.BoardName = tName
		c.DisplayCate = DsCate
		c.DisplayStat = DsStat
		c.DisplayReply = DsReply
		c.AllowReply = AlReply
		
		# 첨부파일 개수 가져오기 [SH]
		attach_q = Session.query(BoardAttach)
		c.attach_cnt = attach_q.filter_by(article_idx=id2).count()
		
		if c.attach_cnt > 0:
			c.article_list = self.getArticleAttach(id2)
		else:
			c.article_list = "[]"
		# --------------------------------

		c.WriterName = u"%s (%s)" % ( unicode(row["CreateByName"]), unicode(row["CreateBy"]) )
		c.WriterID = row["CreateBy"] # 삭제할때 사용됨
		
		# Template Pasting
		for cname in colStr.split(","):
			if str( type( row[cname] ) ) == "<type 'datetime.datetime'>":
				setattr( c, cname, row[cname].strftime("%Y-%m-%d %H:%M") )
			else:
				setattr( c, cname, HTML(row[cname]) )
		
		# 첨부 파일 표시, Jpg, png 파일인 경우, 컨텐츠에 직접 디스플레이
		if row["UploadName1"]:
		#	 c.UploadFile1 = HTML('<a href="%s">%s</a>' %( row["UploadLink1"], row["UploadName1"]) )
			if row["UploadName1"][-4:].lower() in (".jpg", ".png"):
				c.Content = HTML('<a href="%s" rel="lightbox"  title="%s"><img src="%s" width="400" /></a><br/><br/>%s' %( row["UploadLink1"], row["UploadName1"], row["UploadLink1"], row["Content"]) )
		#else:
		#	 c.UploadFile1 = u"첨부없음"
			
		# 보기 카운트 증가 ( [TODO] 나중에 이벤트로 처리해야할 부분 )
		if row["CreateBy"] != session["UserID"]:
			# Pass 0은 Archive의 추가이벤트를 발생하지않는 단순 변경하라는 플래그
			newVC = int(row["ViewCount"]) + 1
			dSave = {"IDX": id2, "ViewCount":  newVC,  "_pass_": 0 }
			Archive("Board").New( **dSave )
			c.ViewCount = newVC
			
		return render("Board_View.html")
Esempio n. 29
0
	def list(self):
		return render("AdminSeq_List.html")
Esempio n. 30
0
File: user.py Progetto: onetera/sp
	def list3(self):
		return render("User_Client_List.html")