OSDN Git Service

Many many refactoring.
[open-pdm-light/PartList.git] / PartsList / PartsList / app / controllers / NotifyController.scala
index 87a6a99..2b50406 100644 (file)
@@ -88,7 +88,7 @@ object NotifyController extends Controller{
     }
   }
 
-  def updateState(id: Long, partId: Long, designChangeId: Long, notifyType: Long, state: Long) = Action {
+  def updateState(id: Long, partId: Long, designChangeId: Long, notifyType: Long, state: Long) = Action { implicit request =>
     inTransaction {
       val notify = NotifyManager().getById(id)
       notify.state = 1
@@ -126,7 +126,10 @@ object NotifyController extends Controller{
          var i:Int =0
          notifyBuffer += NotifyBean(i, notify.message, notify.user.head.name, notify.id, Messages("notify.state" + notify.state), notify.atachs)
          for(reply <- notify.replies) {
-           ReplyRecursion().down(reply, notifyBuffer, i)
+//         ReplyRecursion().down(reply, notifyBuffer, i)
+           for(returnNotifyBuffer <- ReplyRecursion().down(reply, i)) {
+             notifyBuffer += returnNotifyBuffer
+           }
          }
        }
       Ok(views.html.notifylist(notifyBuffer.drop(page*row).take(row), notifyBuffer.size, partId, 0, notifyPart.name, page, notifyType, state))
@@ -148,10 +151,13 @@ object NotifyController extends Controller{
         var i:Int =0
         notifyBuffer += NotifyBean(i, notify.message, notify.user.assign(notify.user.head).name, notify.id, Messages("notify.state" + notify.state), notify.atachs)
         for(reply <- notify.replies) {
-          ReplyRecursion().down(reply, notifyBuffer, i)
+         for(returnNotifyBuffer <- ReplyRecursion().down(reply, i)) {
+            notifyBuffer += returnNotifyBuffer 
+          }
         }
       }
       Ok(views.html.notifylist(notifyBuffer.drop(page*row).take(row), notifyBuffer.size, 0, designChange.id, designChange.dcNo, page, notifyType, state))
     }
   }
+  
 }
\ No newline at end of file