# HG changeset patch # User Tomas Zeman # Date 1302628245 -7200 # Node ID e18da39d8ecb7174bf4c34b87eba9847ef46a899 # Parent 397aca5b6f87e1a33b4e8d9b83facedea6411d21 b6ee02e10b8ded72 CDR columns updates - Mobile + Service Option codelist diff -r 397aca5b6f87 -r e18da39d8ecb src/main/scala/radview/model/Cdr.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, diff -r 397aca5b6f87 -r e18da39d8ecb src/main/scala/radview/snippet/SessionSnippet.scala --- 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 {