diff --git a/messages/uniworx/categories/print/de-de-formal.msg b/messages/uniworx/categories/print/de-de-formal.msg index 1eb9eb034..32fe30556 100644 --- a/messages/uniworx/categories/print/de-de-formal.msg +++ b/messages/uniworx/categories/print/de-de-formal.msg @@ -4,6 +4,7 @@ PJActAcknowledge: Druck und Versand bestätigen PJActReprint: Erneut drucken über APC +PJActReprintIgnoreReroute: Drucken auch bei aktiver Mail-Umleitung erzwingen PrintJobName: Bezeichnung PrintJobFilename: Dateiname PrintJobId !ident-ok: Id diff --git a/messages/uniworx/categories/print/en-eu.msg b/messages/uniworx/categories/print/en-eu.msg index a1090de43..053fd1a7e 100644 --- a/messages/uniworx/categories/print/en-eu.msg +++ b/messages/uniworx/categories/print/en-eu.msg @@ -4,6 +4,7 @@ PJActAcknowledge: Acknowledge printing and mailing PJActReprint: Print again via APC +PJActReprintIgnoreReroute: Force printing to APC, even if mail-reroute-to option is active PrintJobName: Description PrintJobFilename: Filename PrintJobId: Id diff --git a/src/Handler/PrintCenter.hs b/src/Handler/PrintCenter.hs index 90889c63d..0d2455400 100644 --- a/src/Handler/PrintCenter.hs +++ b/src/Handler/PrintCenter.hs @@ -127,7 +127,7 @@ nullaryPathPiece ''PJTableAction $ camelToPathPiece' 2 embedRenderMessage ''UniWorX ''PJTableAction id -- Not yet needed, since there is no additional data for now: -data PJTableActionData = PJActAcknowledgeData | PJActReprintData +data PJTableActionData = PJActAcknowledgeData | PJActReprintData { ignoreReroute :: Maybe Bool } deriving (Eq, Ord, Read, Show, Generic) type PJTableExpr = ( E.SqlExpr (Entity PrintJob) @@ -192,7 +192,7 @@ mkPJTable = do dbtRowKey = queryPrintJob >>> (E.^. PrintJobId) dbtProj = dbtProjId dbtColonnade = mconcat - [ dbSelectIf (applying _2) id (return . view (resultPrintJob . _entityKey)) (\r -> isNothing $ r ^. resultPrintJob . _entityVal . _printJobAcknowledged) + [ dbSelect (applying _2) id (return . view (resultPrintJob . _entityKey)) -- condition for dbSelectIf: (\r -> isNothing $ r ^. resultPrintJob . _entityVal . _printJobAcknowledged) , sortable (Just "created") (i18nCell MsgPrintJobCreated) $ \( view $ resultPrintJob . _entityVal . _printJobCreated -> t) -> dateTimeCell t , sortable (Just "acknowledged") (i18nCell MsgPrintJobAcknowledged) $ \( view $ resultPrintJob . _entityVal . _printJobAcknowledged -> t) -> maybeDateTimeCell t , sortable (Just "filename") (i18nCell MsgPrintPDF) $ \r -> let k = r ^. resultPrintJob . _entityKey @@ -262,7 +262,8 @@ mkPJTable = do = let acts :: Map PJTableAction (AForm Handler PJTableActionData) acts = mconcat [ singletonMap PJActAcknowledge $ pure PJActAcknowledgeData - , singletonMap PJActReprint $ pure PJActReprintData + , singletonMap PJActReprint $ PJActReprintData + <$> aopt checkBoxField (fslI MsgPJActReprintIgnoreReroute) Nothing ] in renderAForm FormStandard $ (, mempty) . First . Just @@ -292,15 +293,23 @@ postPrintCenterR = do num <- runDB $ updateWhereCount [PrintJobAcknowledged ==. Nothing, PrintJobId <-. pjIds] [PrintJobAcknowledged =. Just now] addMessageI Success $ MsgPrintJobAcknowledge num reloadKeepGetParams PrintCenterR - (PJActReprintData, Set.toList -> pjIds) -> do - let countOk = either (const $ Sum 0) (const $ Sum 1) - oks <- runDB $ forM pjIds $ fmap countOk . reprintPDF + (PJActReprintData{ignoreReroute}, Set.toList -> pjIds) -> do + let countOk = either (const $ Sum 0) (const $ Sum 1) + oks <- runDB $ forM pjIds $ fmap countOk . reprintPDF (fromMaybe False ignoreReroute) let nr_oks = getSum $ mconcat oks nr_tot = length pjIds mstat = bool Warning Success $ nr_oks == nr_tot addMessageI mstat $ MsgPrintJobReprint nr_oks nr_tot reloadKeepGetParams PrintCenterR - + siteConf <- getYesod + let lprConf = siteConf ^. _appLprConf + reroute = siteConf ^. _appMailRerouteTo + lprWgt = [whamlet| + LPR Konfiguration ist #{lprQueue lprConf}@#{lprHost lprConf}:#{lprPort lprConf} +
- ^{pjTable}
\ No newline at end of file
+ ^{pjTable}
+
+