b6ee02e10b8ded72 CDR columns updates - Mobile + Service Option codelist
authorTomas Zeman <tzeman@volny.cz>
Tue, 12 Apr 2011 19:10:45 +0200
changeset 11 e18da39d8ecb
parent 10 397aca5b6f87
child 12 8bde6024d735
b6ee02e10b8ded72 CDR columns updates - Mobile + Service Option codelist
src/main/scala/radview/model/Cdr.scala
src/main/scala/radview/snippet/SessionSnippet.scala
--- a/src/main/scala/radview/model/Cdr.scala	Tue Apr 12 19:10:43 2011 +0200
+++ b/src/main/scala/radview/model/Cdr.scala	Tue Apr 12 19:10:45 2011 +0200
@@ -19,6 +19,7 @@
 import net.liftweb.common._
 import net.liftweb.mapper._
 import radview.snippet.SessionSnippet
+import scala.xml.Text
 
 /*
   Table: v_radacct
@@ -178,7 +179,13 @@
     "3GPP2 Active Time")
 
   object serviceOption extends MappedIntColName(this, "3GPP2_Service_Option",
-    "3GPP2 Service Option")
+    "3GPP2 Service Option") {
+    override def asHtml = Text(is match {
+      case 59 => "EVDO"
+      case 33 => "1X"
+      case x => x.toString
+    })
+  }
 }
 
 case class CdrSession(sid: String, start: Date, end: Date, inBytes: Long,
--- a/src/main/scala/radview/snippet/SessionSnippet.scala	Tue Apr 12 19:10:43 2011 +0200
+++ b/src/main/scala/radview/snippet/SessionSnippet.scala	Tue Apr 12 19:10:45 2011 +0200
@@ -23,7 +23,7 @@
 import net.liftweb.sitemap.Loc._
 import net.liftweb.util._
 import net.liftweb.util.{Cell => _}
-import net.liftweb.util.Helpers.urlEncode
+import net.liftweb.util.Helpers.{boolean2, urlEncode}
 import net.tz.lift.snippet._
 import net.tz.lift.util._
 import radview.model.{Cdr, CdrSession, Cell}
@@ -136,7 +136,13 @@
       (Cell.findAll(ByList(Cell.idpk, cdr.map { _.cell.is }.toList.distinct)).
       map { c => (c.idpk.is, c) })
 
-    val cdrCols = fieldsForList.map { f =>
+    val cdrFields =
+      List(sid, ts, inBytes, outBytes, statusType, acctuniqueid, username,
+        nasipaddress, nasporttype, acctsessiontime) ++
+      (isAdsl ? List(serviceType, framedProto) | List(serviceOption)) ++
+      List(framedIp, statusType)
+
+    val cdrCols = cdrFields.map { f =>
       new Column[Cdr](Text(f.displayName), valF(f) _, cssF(f) _) }
 
     val cellCols = List(Cell.btsDesc, Cell.btsSysIdHex, Cell.bssIntDesc).
@@ -148,7 +154,7 @@
         } getOrElse NodeSeq.Empty })
     }
 
-    val cdr2Cols = List(serviceOption, releaseInd).map { f =>
+    val cdr2Cols = List(releaseInd).map { f =>
       new Column[Cdr](Text(f.displayName), valF(f) _, cssF(f) _) }
 
     val cols = cdrCols ++ (isAdsl match {