Commit b532c70c authored by Peter Achten's avatar Peter Achten

Merge branch 'master' into SVG_with_Int_spans

parents 59a071ff a2379d5f
......@@ -9,3 +9,4 @@
.sass-cache
BasicAPIExamples.icl
.ctest-results.json
*-junit.xml
......@@ -6,3 +6,9 @@ test:
- apt-get install -y -qq build-essential libsqlite3-dev libmariadbclient-dev-compat
script:
- bash ci-tests.bash
artifacts:
when: always
paths:
- Tests/Unit/*-junit.xml
reports:
junit: Tests/Unit/*-junit.xml
......@@ -13,8 +13,7 @@ Version: 1.0
Path: {Application}/Development/iTasks-SDK/Libraries
EnvironmentCompiler: lib/exe/cocl::-dynamics -d
EnvironmentCodeGen: lib/exe/cg
EnvironmentLinker: /usr/bin/gcc::-g|lib/exe/itasks-web-collector
EnvironmentDynLink: lib/exe/cclinker
EnvironmentLinker: /usr/bin/gcc::-g -Wl,--gc-sections|lib/exe/itasks-web-collector
EnvironmentABCOptimise: lib/exe/abcopt
EnvironmentByteCodeGen: lib/exe/bcgen
EnvironmentByteCodeLink: lib/exe/bclink
......
......@@ -14,8 +14,7 @@ Environments
Path: {Application}/Development/iTasks-SDK/Libraries
EnvironmentCompiler: lib/exe/cocl:-dynamics
EnvironmentCodeGen: lib/exe/cg
EnvironmentLinker: lib/exe/linker|lib/exe/itasks-web-collector
EnvironmentDynLink: lib/exe/linker
EnvironmentLinker: /usr/bin/gcc::-Wl,--gc-sections|lib/exe/itasks-web-collector
EnvironmentABCOptimise: lib/exe/abcopt
EnvironmentByteCodeGen: lib/exe/bcgen
EnvironmentByteCodeLink: lib/exe/bclink
......
......@@ -14,8 +14,7 @@ Environments
Path: {Application}/lib/iTasks
EnvironmentCompiler: lib/exe/cocl-tonic:-dynamics -tonic
EnvironmentCodeGen: lib/exe/cg
EnvironmentLinker: lib/exe/linker|lib/exe/itasks-web-collector
EnvironmentDynLink: lib/exe/linker
EnvironmentLinker: /usr/bin/gcc::-Wl,--gc-sections|lib/exe/itasks-web-collector
EnvironmentABCOptimise: lib/exe/abcopt
EnvironmentByteCodeGen: lib/exe/bcgen
EnvironmentByteCodeLink: lib/exe/bclink
......
......@@ -14,8 +14,7 @@ Environments
Path: {Application}/lib/iTasks
EnvironmentCompiler: lib/exe/cocl::-dynamics
EnvironmentCodeGen: lib/exe/cg
EnvironmentLinker: lib/exe/linker|lib/exe/itasks-web-collector
EnvironmentDynLink: lib/exe/linker
EnvironmentLinker: /usr/bin/gcc::-Wl,--gc-sections|lib/exe/itasks-web-collector
EnvironmentABCOptimise: lib/exe/abcopt
EnvironmentByteCodeGen: lib/exe/bcgen
EnvironmentByteCodeLink: lib/exe/bclink
......
......@@ -13,8 +13,7 @@ Version: 1.0
Path: {Application}/lib/iTasks
EnvironmentCompiler: lib/exe/cocl:-dynamics -desc -exl -d
EnvironmentCodeGen: lib/exe/cg
EnvironmentLinker: lib/exe/cclinker|lib/exe/itasks-web-collector
EnvironmentDynLink: lib/exe/cclinker
EnvironmentLinker: /usr/bin/gcc|lib/exe/itasks-web-collector
EnvironmentABCOptimise: lib/exe/abcopt
EnvironmentByteCodeGen: lib/exe/bcgen
EnvironmentByteCodeLink: lib/exe/bclink
......
......@@ -15,7 +15,6 @@ Environments
EnvironmentCompiler: lib/exe/cocl::-dynamics
EnvironmentCodeGen: lib/exe/cg
EnvironmentLinker: /usr/bin/gcc|lib/exe/itasks-web-collector
EnvironmentDynLink: /usr/bin/gcc
EnvironmentABCOptimise: lib/exe/abcopt
EnvironmentByteCodeGen: lib/exe/bcgen
EnvironmentByteCodeLink: lib/exe/bclink
......
......@@ -15,7 +15,6 @@ Environments
EnvironmentCompiler: lib/exe/cocl-tonic::-dynamics -tonic
EnvironmentCodeGen: lib/exe/cg
EnvironmentLinker: /usr/bin/gcc|lib/exe/itasks-web-collector
EnvironmentDynLink: /usr/bin/gcc
EnvironmentABCOptimise: lib/exe/abcopt
EnvironmentByteCodeGen: lib/exe/bcgen
EnvironmentByteCodeLink: lib/exe/bclink
......
......@@ -15,7 +15,6 @@ Environments
EnvironmentCompiler: lib/exe/cocl::-dynamics
EnvironmentCodeGen: lib/exe/cg
EnvironmentLinker: /usr/bin/gcc|lib/exe/itasks-web-collector
EnvironmentDynLink: /usr/bin/gcc
EnvironmentABCOptimise: lib/exe/abcopt
EnvironmentByteCodeGen: lib/exe/bcgen
EnvironmentByteCodeLink: lib/exe/bclink
......
......@@ -193,7 +193,7 @@ configurableListItem :: String ItemMeta (Task c) (c -> ActionPlan)
* @param Group by incidents
* @param Use 'my actions' group for current user
*/
chooseActionItem :: d Bool Bool (sds () [(InstanceNo,InstanceNo,ActionStatus)] ()) -> Task InstanceNo | toPrompt d & RWShared sds
chooseActionItem :: Bool Bool (sds () [(InstanceNo,InstanceNo,ActionStatus)] ()) -> Task InstanceNo | RWShared sds
workOnActionItem :: InstanceNo -> Task ()
editActionItem :: InstanceNo -> Task (Maybe ActionStatus)
deleteActionItem :: InstanceNo -> Task (Maybe ActionStatus)
......
......@@ -11,13 +11,13 @@ selectVideoWallContent
@! ()
where
header
= viewInformation () [] ("REMOTE CONTROL") //<<@ (AfterLayout (uiDefSetHalign AlignRight o uiDefSetBaseCls "wall-header")) //FIXME
= viewInformation [] ("REMOTE CONTROL") //<<@ (AfterLayout (uiDefSetHalign AlignRight o uiDefSetBaseCls "wall-header")) //FIXME
mapContacts = mapRead (\(x,y) -> x++y) (contactsOfOpenIncidentsGeo |*| contactsProvidingHelpGeo)
selectContent
= (switchContent >&> withSelection viewNoSelection configureContent) <<@ (ArrangeWithSideBar 0 LeftSide False)
switchContent = enterChoice (Title "Choose Content") [ChooseFromList bigLabel] contentOptions
switchContent = (Title "Choose Content") @>> enterChoice [ChooseFromList bigLabel] contentOptions
contentOptions
= ["Overview","Incident","Contact","Clock","Countdown"]
......@@ -30,7 +30,7 @@ where
= get (standardMapLayers |*| standardPerspective)
>>- \(baseLayers,perspective) ->
withShared perspective
\p -> updateSharedInformation (Title title) [UpdateAs (toMap baseLayers) fromMap] (p >*| mapContacts) @ fst
\p -> Title title @>> updateSharedInformation [UpdateSharedAs (toMap baseLayers) fromMap (const o Just)] (p >*| mapContacts) @ fst
//<<@ AfterLayout (tweakUI fill) //FIXME
@ WallOverview
where
......@@ -39,18 +39,19 @@ where
fromMap _ {LeafletMap|perspective}
= fromLeafletPerspective perspective
configure "Incident"
= enterChoiceWithSharedAs (Title title) [ChooseFromList bigLabel] allIncidentsShort (\{IncidentShort|incidentNo} -> WallIncidentSummary (Just incidentNo))
= Title title @>> enterChoiceWithSharedAs [ChooseFromList bigLabel] allIncidentsShort (\{IncidentShort|incidentNo} -> WallIncidentSummary (Just incidentNo))
configure "Contact"
= enterChoiceWithSharedAs (Title title) [ChooseFromList bigLabel] allContactsShort (\{ContactShort|contactNo} -> WallContactSummary (Just contactNo))
= Title title @>> enterChoiceWithSharedAs [ChooseFromList bigLabel] allContactsShort (\{ContactShort|contactNo} -> WallContactSummary (Just contactNo))
configure "Clock"
= viewInformation (Title title) [] "No configuration is needed for the clock."
= Title title @>> viewInformation [] "No configuration is needed for the clock."
//<<@ AfterLayout (tweakUI fill) //FIXME
@! WallClock
configure "Countdown"
= get currentDateTime
>>- updateInformation (title,"Set the countdown date and time") []
>>- \datetime ->
Title title @>> Hint "Set the countdown date and time" @>> updateInformation [] datetime
@ WallCountDown
configure _
= viewInformation (title,"This option is not available yet...") [] () @? const NoValue
= Title title @>> Hint "This option is not available yet..." @>> viewInformation [] () @? const NoValue
bigLabel l = SpanTag [StyleAttr "font-size: 24px; font-weight: bold; margin-bottom: 5px;"] [Text (toSingleLineText l)]
......@@ -7,6 +7,8 @@ import Text, Text.HTML, Data.List, iTasks.Internal.HtmlUtil
derive class iTask WallContent
derive gDefault ContactMap, ContactMapLayer, ContactMapLayerDefinition, ContactMapMarker, ContactMapRegion, ContactTrack, ContactMapMarkerType, DateTime
wallContent :: SimpleSDSLens WallContent
wallContent = sharedStore "WallContent" (WallOverview defaultValue)
......@@ -15,18 +17,18 @@ viewVideoWallContent
= (header ||- content) <<@ (ArrangeWithHeader 0) //<<@ AfterLayout plainLayoutFinal //FIXME
where
header
= viewSharedInformation () [ViewAs view] (currentTime |*| currentUTCTime) //<<@ (AfterLayout (uiDefSetHalign AlignRight o uiDefSetBaseCls "wall-header")) //FIXME
= viewSharedInformation [ViewAs view] (currentTime |*| currentUTCTime) //<<@ (AfterLayout (uiDefSetHalign AlignRight o uiDefSetBaseCls "wall-header")) //FIXME
where
view (local,utc) = "LOCAL: " + lpad (toString local.Time.hour) 2 '0' + ":" + lpad (toString local.Time.min) 2 '0' + " "
+ "UTC: " + lpad (toString utc.Time.hour) 2 '0' + ":" + lpad (toString utc.Time.min) 2 '0'
content
= whileUnchanged wallContent \content -> case content of
WallClock = (viewSharedInformation (Title "Local Time") [ViewAs formatTime] currentTime @! content)
WallClock = (Title "Local Time" @>> viewSharedInformation [ViewAs formatTime] currentTime @! content)
// WallCountDown until = (viewSharedInformation (Title "Countdown") [ViewAs (\t -> formatDateTime (until - t))] currentDateTime @! content)
WallOverview perspective = viewWallOverview perspective @! content
WallContactSummary (Just contactNo) = viewWallContactSummary contactNo @! content
WallIncidentSummary (Just incidentNo) = viewWallIncidentSummary incidentNo @! content
_ = viewInformation "Nothing selected..." [] () @! content
_ = Hint "Nothing selected..." @>> viewInformation [] () @! content
formatTime time = DivTag [StyleAttr "font-size: 80pt; text-align: center; padding-top: 200px;"] [Text (toString time)]
formatDateTime time = DivTag [StyleAttr "font-size: 80pt; text-align: center; padding-top: 200px;"] [Text (toString time)]
......@@ -34,11 +36,11 @@ formatDateTime time = DivTag [StyleAttr "font-size: 80pt; text-align: center; pa
mapContacts = mapRead (\(x,y) -> x++y) (contactsOfOpenIncidentsGeo |*| contactsProvidingHelpGeo)
viewWallOverview perspective
= ((viewSharedInformation (Title "Open Incidents") [ViewAs formatIncidents] openIncidentsDetails)
= (((Title "Open Incidents") @>> viewSharedInformation [ViewAs formatIncidents] openIncidentsDetails)
-&&-
(get standardMapLayers
>>- \baseLayers ->
viewSharedInformation () [ViewAs (toMap perspective baseLayers)] mapContacts /* <<@ AfterLayout (tweakUI (setMargins 0 0 0 0 o fill))*/ ) //FIXME
viewSharedInformation [ViewAs (toMap perspective baseLayers)] mapContacts /* <<@ AfterLayout (tweakUI (setMargins 0 0 0 0 o fill))*/ ) //FIXME
) <<@ ArrangeWithSideBar 0 LeftSide False
where
toMap perspective baseLayers contacts
......@@ -61,11 +63,11 @@ where
contact = sdsFocus contactNo contactByNo
viewContactTitle
= viewSharedInformation () [] (mapRead contactTitle contact) /* <<@ AfterLayout (uiDefSetBaseCls "wall-contact-title") */ //FIXME
= viewSharedInformation [] (mapRead contactTitle contact) /* <<@ AfterLayout (uiDefSetBaseCls "wall-contact-title") */ //FIXME
viewDetails
= (viewPhoto -&&- viewTypeDetails) <<@ (Title "Details")
viewPhoto
= viewSharedInformation () [ViewAs formatPhoto] contact
= viewSharedInformation [ViewAs formatPhoto] contact
where
formatPhoto {Contact|photos,type,notes}
= ImgTag [ClassAttr "wall-contact-details",WidthAttr "200",HeightAttr "200",SrcAttr (photoSrc photos)]
......@@ -75,14 +77,14 @@ where
viewTypeDetails = whileUnchanged contact
\{Contact|type} -> case type of
Just Vessel = viewSharedInformation () [] (sdsFocus contactNo vesselDetailsByNo) @! ()
Just Person = viewSharedInformation () [] (sdsFocus contactNo personDetailsByNo) @! ()
_ = viewInformation () [] ()
Just Vessel = viewSharedInformation [] (sdsFocus contactNo vesselDetailsByNo) @! ()
Just Person = viewSharedInformation [] (sdsFocus contactNo personDetailsByNo) @! ()
_ = viewInformation [] ()
viewPosition
= ((viewSharedInformation (Title "Position") [ViewAs formatPosition] contact /* <<@ AfterLayout (uiDefSetBaseCls "wall-contact-position") */) //FIXME
= (((Title "Position") @>> viewSharedInformation [ViewAs formatPosition] contact /* <<@ AfterLayout (uiDefSetBaseCls "wall-contact-position") */) //FIXME
-&&-
(viewSharedInformation (Title "Map") [ViewAs contactMap] contact /*<<@ AfterLayout (tweakUI (setMargins 0 0 0 0 o fill)) */) //FIXME
((Title "Map") @>> viewSharedInformation [ViewAs contactMap] contact /*<<@ AfterLayout (tweakUI (setMargins 0 0 0 0 o fill)) */) //FIXME
)
where
formatPosition {Contact|position=Just pos} = toSingleLineText pos
......@@ -99,7 +101,7 @@ where
markers c _ = []
viewCommunication
= viewSharedInformation (Title "Last communication") [ViewAs (formatComms o take 5)] (sdsFocus contactNo contactCommunications)
= (Title "Last communication") @>> viewSharedInformation [ViewAs (formatComms o take 5)] (sdsFocus contactNo contactCommunications)
where
formatComms items
= DivTag []
......@@ -116,9 +118,9 @@ where
incident = sdsFocus incidentNo incidentByNo
viewIncidentTitle
= viewSharedInformation () [] (sdsFocus incidentNo incidentTitleByNo) //<<@ AfterLayout (uiDefSetBaseCls "wall-contact-title") //FIXME
= viewSharedInformation [] (sdsFocus incidentNo incidentTitleByNo) //<<@ AfterLayout (uiDefSetBaseCls "wall-contact-title") //FIXME
viewIncidentContacts
= viewSharedInformation (Title "Involved Contacts") [ViewAs toView] (sdsFocus incidentNo contactsByIncident)
= (Title "Involved Contacts") @>> viewSharedInformation [ViewAs toView] (sdsFocus incidentNo contactsByIncident)
where
toView contacts = DivTag [ClassAttr "wall-incident-contacts"] (map formatContact contacts)
......@@ -132,14 +134,14 @@ where
photoSrc _ = "/no-photo.jpg"
viewIncidentActions
= viewSharedInformation (Title "Open Actions") [ViewAs toView] (sdsFocus incidentNo actionStatusesByIncident) /* <<@ AfterLayout (tweakUI fill) */ //FIXME
= (Title "Open Actions") @>> viewSharedInformation [ViewAs toView] (sdsFocus incidentNo actionStatusesByIncident) /* <<@ AfterLayout (tweakUI fill) */ //FIXME
where
toView actions = DivTag [] [vizAction a \\ (_,_,a) <- actions]
vizAction {ActionStatus|title}
= DivTag [ClassAttr "wall-action"] [H2Tag [ClassAttr "wall-action-title"] [Text title]]
viewIncidentLog
= viewSharedInformation (Title "Last Log Messages") [ViewAs (toView o take 5)] (sdsFocus incidentNo incidentLog)
= Title "Last Log Messages" @>> viewSharedInformation [ViewAs (toView o take 5)] (sdsFocus incidentNo incidentLog)
where
toView log = DivTag [] (flatten [[vizDate date:map vizEntry entries] \\ (date,entries) <- groupByDate log])
......
......@@ -19,7 +19,7 @@ crewAliasListsStore = indexedStore "crewAliasLists" []
//Manage the crew information for a specific contact
manageContactCrew :: ContactNo -> Task ()
manageContactCrew contactNo
= updateSharedContactRefList "Manage crew" (sdsFocus contactNo crewListsStore)
= Hint "Manage crew" @>> updateSharedContactRefList (sdsFocus contactNo crewListsStore)
//Optional Improvements
// -|| forever (addStandardCrewMembers contactNo)
-|| forever (quickAddStandardCrewMembers contactNo)
......@@ -38,7 +38,7 @@ where
quickAddStandardCrewMembers contactNo
= get (sdsFocus contactNo crewAliasListsStore)
-&&-
(enterInformation "Enter the numbers of the crew numbers you want to set (comma separated)" [] @ (map (toInt o trim) o (split ",")))
(Hint "Enter the numbers of the crew numbers you want to set (comma separated)" @>> enterInformation [] @ (map (toInt o trim) o (split ",")))
>>* [OnAction (Action "Set members") (hasValue (\(aliasList,enteredNos) ->
setCrewMembers contactNo (flatten [[cNo \\ (aNo,cNo) <- aliasList | aNo == eNo] \\ eNo <- enteredNos])))]
......@@ -55,14 +55,14 @@ where
refs = sdsFocus contactNo crewAliasListsStore
manageCurrentItems
= updateSharedInformation "Manage crew list" [UpdateAs toPrj fromPrj] items
= Hint "Manage crew list" @>> updateSharedInformation [UpdateSharedAs toPrj fromPrj (const o Just)] items
where
items = sdsDeref refs snd contactsByNosShort derefAliasList
toPrj l = [(contactIdentity c, aNo, contactTitle c)\\(aNo,c) <-l]
fromPrj _ items = [(aNo,cNo) \\ (cNo,aNo,_) <- items]
addItem
= (enterInformation "Enter a number to use when refering to this contact" []
= (Hint "Enter a number to use when refering to this contact" @>> enterInformation []
-&&-
selectKnownOrDefineNewContact)
>>? (\(aliasNo,def) -> createContactIfNew def >>- \contactNo -> upd (\r -> r++[(aliasNo,contactNo)]) refs)
......
......@@ -7,6 +7,8 @@ import Incidone.Util.TaskPatterns
import qualified Data.Map as DM
import Data.Functor
derive gDefault AISContact, DateTime, ContactTrack, Degrees, AIVDM5, AIVDMCNB
syncAISStream :: Task ()
syncAISStream = withShared ([],False,[],False) (\channel -> (sync channel -&&- consume channel) @! ())
where
......
......@@ -28,7 +28,7 @@ updateCommunication communicationNo
(EmailMessage,Out) = composeEmailMessage communicationNo
(P2000Message,Out) = composeP2000Message communicationNo
_
= viewSharedInformation (Title "Communication details:") [] (sdsFocus communicationNo communicationDetailsByNo)
= (Title "Communication details:") @>> viewSharedInformation [] (sdsFocus communicationNo communicationDetailsByNo)
>>| return communicationNo
//Answer an incoming call
......@@ -121,11 +121,11 @@ composeAndSendMessage communicationNo share sendTask = forever
)
where
composeMessage
= updateSharedInformation (Title "Message") [] share // <<@ FillNotes //FIXME
= (Title "Message") @>> updateSharedInformation [] share // <<@ FillNotes //FIXME
>>* [OnAction ActionSend (hasValue (\_ -> sendTask communicationNo))]
viewMessage
= viewSharedInformation (Title "Message") [] share
= (Title "Message") @>> viewSharedInformation [] share
@! ()
relateMessageToIncidents :: CommunicationNo -> Task ()
......@@ -156,42 +156,42 @@ connectOutboundPhoneCall communicationNo
>^* [OnAction ActionDial (ifValue isNothing (\_ -> initiateAsteriskChannel communicationNo))
,OnAction ActionCancel (ifValue (maybe False ((===) Pending)) (\_ -> destroyAsteriskChannel communicationNo))
,OnAction ActionHangup (ifValue (maybe False ((===) Connected)) (\_ -> destroyAsteriskChannel communicationNo))
]) <<@ ApplyAttribute "buttonPosition" "right"
]) <<@ ("buttonPosition",JSONString "right")
@! ()
updatePhoneCallMeta :: CommunicationNo -> Task CommunicationStatus
updatePhoneCallMeta communicationNo
= ((Label "External number" @>> updateSharedInformation () [] (sdsFocus communicationNo phoneCallExternalNo))
= ((Label "External number" @>> updateSharedInformation [] (sdsFocus communicationNo phoneCallExternalNo))
-&&-
(Label "Time" @>> updateSharedInformation () [] (sdsFocus communicationNo communicationTime))
(Label "Time" @>> updateSharedInformation [] (sdsFocus communicationNo communicationTime))
)
-&&-
((Label "Status" @>> editSharedChoice () [] [Pending,Ringing,Connected,Missed,Answered] (sdsFocus communicationNo communicationStatus))
((Label "Status" @>> editSharedChoice [] [Pending,Ringing,Connected,Missed,Answered] (sdsFocus communicationNo communicationStatus))
-&&-
(Label "Handled by" @>> editSharedChoiceWithSharedAs () [] watchOfficers contactIdentity (sdsFocus communicationNo communicationHandledBy))
(Label "Handled by" @>> editSharedChoiceWithSharedAs [] watchOfficers contactIdentity (sdsFocus communicationNo communicationHandledBy))
) <<@ ArrangeSplit Horizontal False
@ \(_,(status,_)) -> status
updateRadioCallMeta :: CommunicationNo -> Task CommunicationStatus
updateRadioCallMeta communicationNo
= ((Label "Channel" @>> updateSharedInformation () [] (sdsFocus communicationNo radioCallChannel))
= ((Label "Channel" @>> updateSharedInformation [] (sdsFocus communicationNo radioCallChannel))
-&&-
(Label "Time" @>> updateSharedInformation () [] (sdsFocus communicationNo communicationTime))
(Label "Time" @>> updateSharedInformation [] (sdsFocus communicationNo communicationTime))
)
-&&-
((Label "Status" @>> editSharedChoice () [] [Missed,Answered] (sdsFocus communicationNo communicationStatus))
((Label "Status" @>> editSharedChoice [] [Missed,Answered] (sdsFocus communicationNo communicationStatus))
-&&-
(Label "Handled by" @>> editSharedChoiceWithSharedAs () [] watchOfficers contactIdentity (sdsFocus communicationNo communicationHandledBy))
(Label "Handled by" @>> editSharedChoiceWithSharedAs [] watchOfficers contactIdentity (sdsFocus communicationNo communicationHandledBy))
) <<@ ArrangeSplit Horizontal False
@ \(_,(status,_)) -> status
updateMessageMeta :: CommunicationNo -> Task CommunicationStatus
updateMessageMeta communicationNo
= ((Label "Time" @>> updateSharedInformation () [] (sdsFocus communicationNo communicationTime)))
= ((Label "Time" @>> updateSharedInformation [] (sdsFocus communicationNo communicationTime)))
-&&-
((Label "Status" @>> editSharedChoice () [] [Pending,Sent] (sdsFocus communicationNo communicationStatus))
((Label "Status" @>> editSharedChoice [] [Pending,Sent] (sdsFocus communicationNo communicationStatus))
-&&-
(Label "Handled by" @>> editSharedChoiceWithSharedAs () [] watchOfficers contactIdentity (sdsFocus communicationNo communicationHandledBy))
(Label "Handled by" @>> editSharedChoiceWithSharedAs [] watchOfficers contactIdentity (sdsFocus communicationNo communicationHandledBy))
) <<@ ArrangeSplit Horizontal False
@ \(_,(status,_)) -> status
......@@ -256,12 +256,12 @@ determineContact mbPrevious
<<@ ArrangeVertical
where
createNewContact filter
= enterInformation (Title "Contact") [] // @> (mapToFilter,filter)
= Title "Contact" @>> enterInformation [] // @> (mapToFilter,filter)
>>* [OnAction ActionCreate (hasValue (createContact))]
selectExistingContact filter
= whileUnchanged filter
\curFilter ->
enterChoiceWithSharedAs (Title "Select contact") [ChooseFromList contactTitle] (sdsFocus curFilter filteredContactsShort) contactIdentity
(Title "Select contact") @>> enterChoiceWithSharedAs [ChooseFromList contactTitle] (sdsFocus curFilter filteredContactsShort) contactIdentity
>>* [OnValue (hasValue return)
:maybe [] (\contactNo -> [OnAction ActionCancel (always (return contactNo))]) mbPrevious]
......@@ -293,7 +293,7 @@ manageVoiceCallContent type communicationNo
= updateCallNotes -|| relateMessageToIncidents communicationNo <<@ ArrangeWithTabs True
where
updateCallNotes
= updateSharedInformation (Title "Notes") [] (callNotes type) //<<@ FillNotes //FIXME
= (Title "Notes") @>> updateSharedInformation [] (callNotes type) //<<@ FillNotes //FIXME
@! ()
callNotes PhoneCall = sdsFocus communicationNo (mapReadWrite (toPrj,fromPrj) Nothing phoneCallByNo)
......
......@@ -21,5 +21,4 @@ derive JSONEncode Temperature, Meters, Feet, Miles, Knots, Degrees, Contac
derive JSONDecode Temperature, Meters, Feet, Miles, Knots, Degrees, ContactShort, IncidentShort
derive gText Temperature, Meters, Feet, Miles, Knots, Degrees, ContactShort, IncidentShort
derive gEditor Temperature, Meters, Feet, Miles, Knots, Degrees, ContactShort, IncidentShort
derive gDefault Temperature, Meters, Feet, Miles, Knots, Degrees, ContactShort, IncidentShort
derive gEq Temperature, Meters, Feet, Miles, Knots, Degrees, ContactShort, IncidentShort
......@@ -29,6 +29,4 @@ gText{|IncidentShort|} _ i = [maybe "" incidentTitle i]
derive JSONEncode Temperature, Meters, Feet, Miles, Knots, Degrees, ContactShort, IncidentShort
derive JSONDecode Temperature, Meters, Feet, Miles, Knots, Degrees, ContactShort, IncidentShort
derive gEditor Temperature, Meters, Feet, Miles, Knots, Degrees, ContactShort, IncidentShort
derive gDefault Temperature, Meters, Feet, Miles, Knots, Degrees, ContactShort, IncidentShort
derive gEq Temperature, Meters, Feet, Miles, Knots, Degrees, ContactShort, IncidentShort
......@@ -27,7 +27,7 @@ viewContactCommunicationMeans :: ContactNo -> Task [CommunicationMean]
updateContactPosition :: ContactNo -> Task (Maybe (Maybe ContactPosition))
updateContactStatus :: ContactNo -> Task (Maybe (Maybe ContactStatus))
updateSharedContactRefList :: d (Shared sds [ContactNo]) -> Task [ContactNo] | toPrompt d & RWShared sds
updateSharedContactRefList :: (Shared sds [ContactNo]) -> Task [ContactNo] | RWShared sds
selectKnownOrDefineNewContact :: Task (Either ContactNo NewContact)
createContactIfNew :: (Either ContactNo NewContact) -> Task ContactNo
......
......@@ -4,6 +4,9 @@ import Incidone.OP.Concepts
import Text, Text.HTML
import iTasks.Extensions.DateTime
derive gDefault ContactGeo, CommunicationMean, NewCommunicationMean, ContactStatus, ContactAccessLevel, Credentials, ContactPhoto, ContactTrack, ContactType
derive gDefault DateTime, Contact, Degrees, CommunicationMeanType, Document
class contactTitle a :: a -> String
instance contactTitle Contact
where
......
......@@ -5,6 +5,8 @@ import Incidone.OP.IncidentManagementTasks
import Incidone.OP.ContactManagementTasks
import Incidone.OP.CommunicationManagementTasks
derive gDefault NewContact, IncidentShort, ContactType
generateTestIncident :: Bool -> Task IncidentNo
generateTestIncident closed
= randomChoice [YachtEngineProblems,YachtAground,Medevac]
......
......@@ -12,7 +12,7 @@ manageIncidentLog :: IncidentNo -> Task ()
viewIncidentDetails :: IncidentNo -> Task ()
//Reusable task fragments
updateSharedIncidentRefList :: d Bool (Shared sds [IncidentNo]) -> </