Index: branches/LCSv2/controllers/default.py.bak
===================================================================
--- branches/LCSv2/controllers/default.py.bak	(revision 621)
+++ branches/LCSv2/controllers/default.py.bak	(revision 622)
@@ -220,10 +220,12 @@
     existingclosures.append("")
     for row in db().select(db.closures.ALL, orderby=db.closures.closureid):
-        existingclosures.append(row.closureid)
+        # Omit duplicate ID's (with different lognumbers)
+        if row.closureid not in existingclosures:
+            existingclosures.append(row.closureid)
         
     form = FORM(
                 LABEL('*Route',_for='route'), SELECT(hwys,_name='route', _id='routecombo', _onchange='routechanged()', requires=IS_LENGTH(minsize=1,error_message='route cannot be empty')), XML('&nbsp;&nbsp;&nbsp;'), 
            LABEL('*Direction',_for='direction'), SELECT(hwyDirections,_name='direction', requires=IS_LENGTH(minsize=1,error_message='direction cannot be empty')), XML('&nbsp;&nbsp;&nbsp;'), 
-           LABEL('*Facility',_for='facility'), SELECT(facilities,_name='facility', requires=IS_LENGTH(minsize=1,error_message='facility cannot be empty')), BR(),BR(), 
+           LABEL('*Facility',_for='facility'), SELECT(facilities,_name='facility', _id='facilitycombo', requires=IS_LENGTH(minsize=1,error_message='facility cannot be empty')), BR(),BR(), 
            TABLE(TR(TD(),TD(LABEL('*County')),TD(LABEL('*Location'))),
                 TR(TD(LABEL('BEGIN=')),TD(SELECT('ORA',_name='startcounty')),
@@ -241,9 +243,13 @@
                     TD(LABEL('Estimated Delay')),
                     TD(LABEL('TMP Details'))), 
-                 TR(TD(SELECT(closuretypes,_name='closuretype',requires=IS_LENGTH(minsize=1,error_message='type of closure cannot be empty'))), 
+                 TR(TD(SELECT(closuretypes,_name='closuretype',_id='closuretype', _onchange='closuretypechanged()',requires=IS_LENGTH(minsize=1,error_message='type of closure cannot be empty'))), 
                     TD(SELECT(worktypes,_name='worktype', requires=IS_LENGTH(minsize=1,error_message='type of work cannot be empty'))), 
                     TD(INPUT(_name='estdelay',_size='4'),'minutes'),  
                     TD(INPUT(_type='checkbox',_name='cozeep'),'CoZeep MaZeep/CHP',BR(), 
-                       INPUT(_type='checkbox', _name='detour'),'Detour Available')), 
+                       INPUT(_type='checkbox', _name='detour'),'Detour Available')),
+                 TR(TD(DIV(LABEL("Lanes closed"),DIV(_id='boxes'),_id='lanechooser',_style='display:none')),
+                    TD(INPUT(_type='hidden', _name='lanecount', _id='lanecount', _value='4')),
+                    TD(),
+                    TD()),
                  _width='100%' ),
     TABLE(TR(TD(LABEL('*Supervisor')),
@@ -278,5 +284,5 @@
         # Insert the record into the database
         newrec = db.closures.insert(closureid=newID, lognum=newLognum, route=form.vars.route, direction=form.vars.direction, facility=form.vars.facility, startcounty=form.vars.startcounty, endcounty=form.vars.endcounty, startlocation=form.vars.startlocation, endlocation=form.vars.endlocation, startdate=form.vars.startdate, enddate=form.vars.enddate, starttime=form.vars.starttime+form.vars.starttimemin, endtime=form.vars.endtime+form.vars.endtimemin, closuretype=form.vars.closuretype, worktype=form.vars.worktype, estdelay=form.vars.estdelay, tmpcozeep=getCheckbox(form.vars.cozeep), tmpdetour=getCheckbox(form.vars.detour), supervisor=supervisor_name, fieldrep=fieldrep_name, s1097date='', s1098date='', s1022date='' )
-        session.flash = 'New lane closure added: ' + newID + ' ' + newLognum
+        session.flash = 'New lane closure added: ' + newID + ' ' + newLognum + ', ' + buildLanesClosedString(form.vars.lanes) + ':' + form.vars.lanecount
         redirect(URL('search.html'))
     return dict(form=form)
@@ -318,2 +324,13 @@
     else:
         return "NO"
+
+# Convert the lanes closed checkboxes into a human readable string
+# E.g.  #1 #3 of 4
+# Note: ckBoxGroup parameter contains only checked items
+def buildLanesClosedString(ckBoxGroup):
+    result = ">"
+    if ckBoxGroup is not None:
+        # Append each checked value to a string
+        for item in ckBoxGroup:
+            result = result + item + " "
+    return result
