Skip to content

Commit

Permalink
날짜가 작동되지 않는 부분 수정됨.
Browse files Browse the repository at this point in the history
  • Loading branch information
woong committed Oct 30, 2023
1 parent e61aadc commit e6345a0
Show file tree
Hide file tree
Showing 5 changed files with 40 additions and 158 deletions.
35 changes: 8 additions & 27 deletions assets/js/input.js
Original file line number Diff line number Diff line change
Expand Up @@ -394,8 +394,9 @@ function initModalPipelinestep() {
}
initModalPipelinestep() // 페이지가 로딩되면 먼저 실행한다.

// setEditTaskModal 함수는 project, name, task 정보를 가지고 와서 Edit Task Modal에 값을 채운다.
// setEditTaskModal 함수는 item id, task 정보를 가지고 와서 Edit Task Modal에 값을 채운다.
function setEditTaskModal(id, task) {
console.log(id,task)
document.getElementById("modal-edittask-id").value = id;
document.getElementById("modal-edittask-title").innerHTML = "Edit Task" + multiInputTitle(id);
$.ajax({
Expand Down Expand Up @@ -3033,9 +3034,8 @@ function setTaskStatusV2(id, task, status) {
}
}

function setTaskDate(project, id, task, date) {
function setTaskDate(id, task, date) {
let token = document.getElementById("token").value;
let userid = document.getElementById("userid").value;
if (isMultiInput()) {
let cboxes = document.getElementsByName('selectID');
for (var i = 0; i < cboxes.length; ++i) {
Expand All @@ -3046,13 +3046,11 @@ function setTaskDate(project, id, task, date) {
let id = cboxes[i].getAttribute("id")
$.ajax({
url: "/api/settaskdate",
type: "post",
type: "POST",
data: {
project: project,
id: id,
task: task,
date: date,
userid: userid,
},
headers: {
"Authorization": "Basic "+ token
Expand All @@ -3069,13 +3067,11 @@ function setTaskDate(project, id, task, date) {
} else {
$.ajax({
url: "/api/settaskdate",
type: "post",
type: "POST",
data: {
project: project,
id: id,
task: task,
date: date,
userid: userid,
},
headers: {
"Authorization": "Basic "+ token
Expand All @@ -3091,9 +3087,8 @@ function setTaskDate(project, id, task, date) {
}
}

function setTaskStartdate(project, id, task, date) {
function setTaskStartdate(id, task, date) {
let token = document.getElementById("token").value;
let userid = document.getElementById("userid").value;
if (isMultiInput()) {
let cboxes = document.getElementsByName('selectID');
for (var i = 0; i < cboxes.length; ++i) {
Expand All @@ -3106,11 +3101,9 @@ function setTaskStartdate(project, id, task, date) {
url: "/api/settaskstartdate",
type: "POST",
data: {
project: project,
id: id,
task: task,
date: date,
userid: userid,
},
headers: {
"Authorization": "Basic "+ token
Expand All @@ -3129,11 +3122,9 @@ function setTaskStartdate(project, id, task, date) {
url: "/api/settaskstartdate",
type: "post",
data: {
project: project,
id: id,
task: task,
date: date,
userid: userid,
},
headers: {
"Authorization": "Basic "+ token
Expand All @@ -3149,9 +3140,8 @@ function setTaskStartdate(project, id, task, date) {
}
}

function setTaskStartdate2nd(project, id, task, date) {
function setTaskStartdate2nd(id, task, date) {
let token = document.getElementById("token").value;
let userid = document.getElementById("userid").value;
if (isMultiInput()) {
let cboxes = document.getElementsByName('selectID');
for (var i = 0; i < cboxes.length; ++i) {
Expand All @@ -3164,11 +3154,9 @@ function setTaskStartdate2nd(project, id, task, date) {
url: "/api/settaskstartdate2nd",
type: "post",
data: {
project: project,
id: id,
task: task,
date: date,
userid: userid,
},
headers: {
"Authorization": "Basic "+ token
Expand All @@ -3187,11 +3175,9 @@ function setTaskStartdate2nd(project, id, task, date) {
url: "/api/settaskstartdate2nd",
type: "post",
data: {
project: project,
id: id,
task: task,
date: date,
userid: userid,
},
headers: {
"Authorization": "Basic "+ token
Expand Down Expand Up @@ -3267,9 +3253,8 @@ function setTaskUserNote(project, id, task, usernote) {



function setTaskPredate(project, id, task, date) {
function setTaskPredate(id, task, date) {
let token = document.getElementById("token").value;
let userid = document.getElementById("userid").value;
if (isMultiInput()) {
let cboxes = document.getElementsByName('selectID');
for (let i = 0; i < cboxes.length; ++i) {
Expand All @@ -3282,11 +3267,9 @@ function setTaskPredate(project, id, task, date) {
url: "/api/settaskpredate",
type: "post",
data: {
project: project,
id: id,
task: task,
date: date,
userid: userid,
},
headers: {
"Authorization": "Basic "+ token
Expand All @@ -3309,11 +3292,9 @@ function setTaskPredate(project, id, task, date) {
url: "/api/settaskpredate",
type: "post",
data: {
project: project,
id: id,
task: task,
date: date,
userid: userid,
},
headers: {
"Authorization": "Basic "+ token
Expand Down
32 changes: 9 additions & 23 deletions db_item_mgo.go
Original file line number Diff line number Diff line change
Expand Up @@ -1461,12 +1461,8 @@ func SetTaskUserID(session *mgo.Session, id, task, userid string) error {
}

// SetTaskDate 함수는 item에 task에 마감일을 셋팅한다.
func SetTaskDate(session *mgo.Session, project, id, task, date string) error {
func SetTaskDate(session *mgo.Session, id, task, date string) error {
session.SetMode(mgo.Monotonic, true)
err := HasProject(session, project)
if err != nil {
return err
}
c := session.DB(*flagDBName).C("items")
fullTime, err := ditime.ToFullTime(19, date)
if err != nil {
Expand Down Expand Up @@ -1593,14 +1589,10 @@ func SetDeadline3D(session *mgo.Session, project, id, date string) error {
}

// SetTaskStartdate 함수는 item에 task의 startdate 값을 셋팅한다.
func SetTaskStartdate(session *mgo.Session, project, id, task, date string) error {
func SetTaskStartdate(session *mgo.Session, id, task, date string) error {
session.SetMode(mgo.Monotonic, true)
err := HasProject(session, project)
if err != nil {
return err
}
c := session.DB(*flagDBName).C("items")
err = HasTask(session, id, task)
err := HasTask(session, id, task)
if err != nil {
return err
}
Expand All @@ -1616,14 +1608,11 @@ func SetTaskStartdate(session *mgo.Session, project, id, task, date string) erro
}

// SetTaskStartdate2nd 함수는 item에 task의 2차 startdate 값을 셋팅한다.
func SetTaskStartdate2nd(session *mgo.Session, project, id, task, date string) error {
func SetTaskStartdate2nd(session *mgo.Session, id, task, date string) error {
session.SetMode(mgo.Monotonic, true)
err := HasProject(session, project)
if err != nil {
return err
}

c := session.DB(*flagDBName).C("items")
err = HasTask(session, id, task)
err := HasTask(session, id, task)
if err != nil {
return err
}
Expand Down Expand Up @@ -1663,14 +1652,11 @@ func SetTaskUserNote(session *mgo.Session, project, name, task, usernote string)
}

// SetTaskPredate 함수는 item에 task의 predate 값을 셋팅한다.
func SetTaskPredate(session *mgo.Session, project, id, task, date string) (string, error) {
func SetTaskPredate(session *mgo.Session, id, task, date string) (string, error) {
session.SetMode(mgo.Monotonic, true)
err := HasProject(session, project)
if err != nil {
return "", err
}

c := session.DB(*flagDBName).C("items")
err = HasTask(session, id, task)
err := HasTask(session, id, task)
if err != nil {
return id, err
}
Expand Down
6 changes: 3 additions & 3 deletions documents/rest_item.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@ restAPI의 장점은 웹서비스의 URI를 이용하기 때문에 네트워크
| /api2/settaskstatus | 상태수정 | project, name, task, status | `$ curl -X POST -H "Authorization: Basic <Token>" -d "id=project_SS_0010_org&task=comp&status=wip" https://openpipeline.io/api2/settaskstatus` |
| /api/settaskuser | 사용자설정 | project, id, task, user | `$ curl -X POST -H "Authorization: Basic <Token>" -d "project=TEMP&id=SS_0010_org&task=comp&user=d10191(김한웅,개발팀)" https://openpipeline.io/api/settaskuser` |
| /api/settaskstartdate | 1차시작일 | project, name, task, date | `$ curl -X POST -H "Authorization: Basic <Token>" -d "project=TEMP&name=SS_0010&task=comp&date=0506" https://openpipeline.io/api/settaskstartdate` |
| /api/settaskstartdate2nd | 2차시작일 | project, name, task, date | `$ curl -X POST -H "Authorization: Basic <Token>" -d "project=TEMP&name=SS_0010&task=comp&date=1127" https://openpipeline.io/api/settaskstartdate2nd` |
| /api/settaskpredate | 1차마감일 | project, name, task, date | `$ curl -X POST -H "Authorization: Basic <Token>" -d "project=TEMP&name=RR_0010&task=comp&date=0506" https://openpipeline.io/api/settaskpredate` |
| /api/settaskdate | 2차마감일 | project, name, task, date | `$ curl -X POST -H "Authorization: Basic <Token>" -d "project=TEMP&name=RR_0010&task=comp&date=0506" https://openpipeline.io/api/settaskdate` |
| /api/settaskstartdate2nd | 2차시작일 | id, task, date | `$ curl -X POST -H "Authorization: Basic <Token>" -d "id=project_SS_0010_org&task=comp&date=1127" https://openpipeline.io/api/settaskstartdate2nd` |
| /api/settaskpredate | 1차마감일 | id, task, date | `$ curl -X POST -H "Authorization: Basic <Token>" -d "id=TEMP_RR_0010_org&task=comp&date=0506" https://openpipeline.io/api/settaskpredate` |
| /api/settaskdate | 2차마감일 | id, task, date | `$ curl -X POST -H "Authorization: Basic <Token>" -d "id=TEMP_RR_0010_org&task=comp&date=0506" https://openpipeline.io/api/settaskdate` |
| /api2/settaskmov | mov등록 | project, name, task, mov | `$ curl -X POST -H "Authorization: Basic <Token>" -d "project=TEMP&name=RR_0010&task=comp&mov=/show/test/test.mov" https://openpipeline.io/api2/settaskmov` |
| /api/setshottype | shottype 변경 | project, name, type | `$ curl -X POST -H "Authorization: Basic <Token>" -d "project=TEMP&name=SS_0030&shottype=3d" https://openpipeline.io/api/setshottype` |
| /api/setusetype | usetype 변경 | project, id, type | `$ curl -X POST -H "Authorization: Basic <Token>" -d "project=TEMP&id=SS_0030_org&type=org1" https://openpipeline.io/api/setusetype` |
Expand Down
2 changes: 1 addition & 1 deletion handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -534,7 +534,7 @@ func webserver(port string) {
r.HandleFunc("/api/taskduration", handleAPISetTaskDuration).Methods("POST")
r.HandleFunc("/api/settaskexpectday", handleAPISetTaskExpectDay)
r.HandleFunc("/api/settaskresultday", handleAPISetTaskResultDay)
r.HandleFunc("/api/settaskpredate", handleAPISetTaskPredate)
r.HandleFunc("/api/settaskpredate", handleAPISetTaskPredate).Methods("POST")
r.HandleFunc("/api/settaskstartdate", handleAPISetTaskStartdate).Methods("POST")
r.HandleFunc("/api/settaskstartdate2nd", handleAPISetTaskStartdate2nd).Methods("POST")
r.HandleFunc("/api/task", handleAPITask).Methods("POST")
Expand Down
Loading

0 comments on commit e6345a0

Please sign in to comment.