d-viperdoc.w 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523
  1. &ANALYZE-SUSPEND _VERSION-NUMBER AB_v10r12 GUI ADM2
  2. &ANALYZE-RESUME
  3. /* Connected Databases
  4. anadat PROGRESS
  5. */
  6. &Scoped-define WINDOW-NAME CURRENT-WINDOW
  7. {adecomm/appserv.i}
  8. &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CUSTOM _DEFINITIONS dTables
  9. /*------------------------------------------------------------------------
  10. File:
  11. Description: from DATA.W - Template For SmartData objects in the ADM
  12. Input Parameters:
  13. <none>
  14. Output Parameters:
  15. <none>
  16. Modified: February 24, 1999
  17. ------------------------------------------------------------------------*/
  18. /* This .W file was created with the Progress AppBuilder. */
  19. /*----------------------------------------------------------------------*/
  20. /* Create an unnamed pool to store all the widgets created
  21. by this procedure. This is a good default which assures
  22. that this procedure's triggers and internal procedures
  23. will execute in this procedure's storage, and that proper
  24. cleanup will occur on deletion of the procedure. */
  25. CREATE WIDGET-POOL.
  26. /* *************************** Definitions ************************** */
  27. /* Parameters Definitions --- */
  28. /* Local Variable Definitions --- */
  29. &SCOPED-DEFINE Tabelle ViperDoc
  30. &SCOPED-DEFINE TabWhere /* USE-INDEX Benutzer-k1 ~
  31. WHERE {&Tabelle}.Benutzer = tRowObject.Benutzer
  32. */
  33. { incl/datdefinition.i }
  34. /* _UIB-CODE-BLOCK-END */
  35. &ANALYZE-RESUME
  36. &ANALYZE-SUSPEND _UIB-PREPROCESSOR-BLOCK
  37. /* ******************** Preprocessor Definitions ******************** */
  38. &Global-define DATA-LOGIC-PROCEDURE .p
  39. &Scoped-define PROCEDURE-TYPE SmartDataObject
  40. &Scoped-define DB-AWARE yes
  41. &Scoped-define ADM-SUPPORTED-LINKS Data-Source,Data-Target,Navigation-Target,Update-Target,Commit-Target,Filter-Target
  42. /* Db-Required definitions. */
  43. &IF DEFINED(DB-REQUIRED) = 0 &THEN
  44. &GLOBAL-DEFINE DB-REQUIRED TRUE
  45. &ENDIF
  46. &GLOBAL-DEFINE DB-REQUIRED-START &IF {&DB-REQUIRED} &THEN
  47. &GLOBAL-DEFINE DB-REQUIRED-END &ENDIF
  48. &Scoped-define QUERY-NAME Query-Main
  49. /* Internal Tables (found by Frame, Query & Browse Queries) */
  50. &Scoped-define INTERNAL-TABLES ViperDoc
  51. /* Definitions for QUERY Query-Main */
  52. &Scoped-Define ENABLED-FIELDS Firma Benutzer Formular DokArt Drucker Template Schacht_Original~
  53. Schacht_Kopie Schacht_Besr DruckKopie Anzahl lcreatePDF lDokDruck lopenPDF~
  54. Programm Kontakt_Ind
  55. &Scoped-define ENABLED-FIELDS-IN-ViperDoc Firma Benutzer Formular DokArt ~
  56. Drucker Template Schacht_Original Schacht_Kopie Schacht_Besr DruckKopie ~
  57. Anzahl lcreatePDF lDokDruck lopenPDF Programm Kontakt_Ind
  58. &Scoped-Define DATA-FIELDS Firma Benutzer Formular DokArt Drucker Template Schacht_Original~
  59. Schacht_Kopie Schacht_Besr DruckKopie Anzahl lcreatePDF lDokDruck lopenPDF~
  60. Programm Kontakt_Ind
  61. &Scoped-define DATA-FIELDS-IN-ViperDoc Firma Benutzer Formular DokArt ~
  62. Drucker Template Schacht_Original Schacht_Kopie Schacht_Besr DruckKopie ~
  63. Anzahl lcreatePDF lDokDruck lopenPDF Programm Kontakt_Ind
  64. &Scoped-Define MANDATORY-FIELDS
  65. &Scoped-Define APPLICATION-SERVICE
  66. &Scoped-Define ASSIGN-LIST
  67. &Scoped-Define DATA-FIELD-DEFS "d-viperdoc.i"
  68. &Scoped-Define DATA-TABLE-NO-UNDO NO-UNDO
  69. &Scoped-define QUERY-STRING-Query-Main FOR EACH ViperDoc NO-LOCK
  70. {&DB-REQUIRED-START}
  71. &Scoped-define OPEN-QUERY-Query-Main OPEN QUERY Query-Main FOR EACH ViperDoc NO-LOCK.
  72. {&DB-REQUIRED-END}
  73. &Scoped-define TABLES-IN-QUERY-Query-Main ViperDoc
  74. &Scoped-define FIRST-TABLE-IN-QUERY-Query-Main ViperDoc
  75. /* Custom List Definitions */
  76. /* List-1,List-2,List-3,List-4,List-5,List-6 */
  77. /* _UIB-PREPROCESSOR-BLOCK-END */
  78. &ANALYZE-RESUME
  79. /* ************************ Function Prototypes ********************** */
  80. {&DB-REQUIRED-START}
  81. &ANALYZE-SUSPEND _UIB-CODE-BLOCK _FUNCTION-FORWARD getCurrentRecid dTables _DB-REQUIRED
  82. FUNCTION getCurrentRecid RETURNS RECID
  83. ( /* parameter-definitions */ ) FORWARD.
  84. /* _UIB-CODE-BLOCK-END */
  85. &ANALYZE-RESUME
  86. {&DB-REQUIRED-END}
  87. {&DB-REQUIRED-START}
  88. &ANALYZE-SUSPEND _UIB-CODE-BLOCK _FUNCTION-FORWARD getQueryBuffer dTables _DB-REQUIRED
  89. FUNCTION getQueryBuffer RETURNS HANDLE
  90. ( /* parameter-definitions */ ) FORWARD.
  91. /* _UIB-CODE-BLOCK-END */
  92. &ANALYZE-RESUME
  93. {&DB-REQUIRED-END}
  94. {&DB-REQUIRED-START}
  95. &ANALYZE-SUSPEND _UIB-CODE-BLOCK _FUNCTION-FORWARD openQuery dTables _DB-REQUIRED
  96. FUNCTION openQuery RETURNS LOGICAL
  97. ( /* parameter-definitions */ ) FORWARD.
  98. /* _UIB-CODE-BLOCK-END */
  99. &ANALYZE-RESUME
  100. {&DB-REQUIRED-END}
  101. /* *********************** Control Definitions ********************** */
  102. {&DB-REQUIRED-START}
  103. /* Query definitions */
  104. &ANALYZE-SUSPEND
  105. DEFINE QUERY Query-Main FOR
  106. ViperDoc SCROLLING.
  107. &ANALYZE-RESUME
  108. {&DB-REQUIRED-END}
  109. /* ************************ Frame Definitions *********************** */
  110. /* *********************** Procedure Settings ************************ */
  111. &ANALYZE-SUSPEND _PROCEDURE-SETTINGS
  112. /* Settings for THIS-PROCEDURE
  113. Type: SmartDataObject
  114. Allow: Query
  115. Frames: 0
  116. Add Fields to: Neither
  117. Other Settings: PERSISTENT-ONLY COMPILE APPSERVER DB-AWARE
  118. */
  119. /* This procedure should always be RUN PERSISTENT. Report the error, */
  120. /* then cleanup and return. */
  121. IF NOT THIS-PROCEDURE:PERSISTENT THEN DO:
  122. MESSAGE "{&FILE-NAME} should only be RUN PERSISTENT.":U
  123. VIEW-AS ALERT-BOX ERROR BUTTONS OK.
  124. RETURN.
  125. END.
  126. &ANALYZE-RESUME _END-PROCEDURE-SETTINGS
  127. /* ************************* Create Window ************************** */
  128. &ANALYZE-SUSPEND _CREATE-WINDOW
  129. /* DESIGN Window definition (used by the UIB)
  130. CREATE WINDOW dTables ASSIGN
  131. HEIGHT = 1.62
  132. WIDTH = 65.6.
  133. /* END WINDOW DEFINITION */
  134. */
  135. &ANALYZE-RESUME
  136. &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CUSTOM _INCLUDED-LIB dTables
  137. /* ************************* Included-Libraries *********************** */
  138. {src/adm2/data.i}
  139. /* _UIB-CODE-BLOCK-END */
  140. &ANALYZE-RESUME
  141. /* *********** Runtime Attributes and AppBuilder Settings *********** */
  142. &ANALYZE-SUSPEND _RUN-TIME-ATTRIBUTES
  143. /* SETTINGS FOR WINDOW dTables
  144. VISIBLE,,RUN-PERSISTENT */
  145. /* _RUN-TIME-ATTRIBUTES-END */
  146. &ANALYZE-RESUME
  147. /* Setting information for Queries and Browse Widgets fields */
  148. &ANALYZE-SUSPEND _QUERY-BLOCK QUERY Query-Main
  149. /* Query rebuild information for SmartDataObject Query-Main
  150. _TblList = "AnaDat.ViperDoc"
  151. _Options = "NO-LOCK"
  152. _FldNameList[1] > AnaDat.ViperDoc.Firma
  153. "Firma" "Firma" ? ? "character" ? ? ? ? ? ? yes ? no 8 yes ?
  154. _FldNameList[2] > AnaDat.ViperDoc.Benutzer
  155. "Benutzer" "Benutzer" ? ? "character" ? ? ? ? ? ? yes ? no 40 yes ?
  156. _FldNameList[3] > AnaDat.ViperDoc.Formular
  157. "Formular" "Formular" ? ? "character" ? ? ? ? ? ? yes ? no 40 yes ?
  158. _FldNameList[4] > AnaDat.ViperDoc.DokArt
  159. "DokArt" "DokArt" ? ? "integer" ? ? ? ? ? ? yes ? no 6.6 yes ?
  160. _FldNameList[5] > AnaDat.ViperDoc.Drucker
  161. "Drucker" "Drucker" ? ? "character" ? ? ? ? ? ? yes ? no 60 yes ?
  162. _FldNameList[6] > AnaDat.ViperDoc.Template
  163. "Template" "Template" ? ? "character" ? ? ? ? ? ? yes ? no 40 yes ?
  164. _FldNameList[7] > AnaDat.ViperDoc.Schacht_Original
  165. "Schacht_Original" "Schacht_Original" ? ? "integer" ? ? ? ? ? ? yes ? no 16.2 yes ?
  166. _FldNameList[8] > AnaDat.ViperDoc.Schacht_Kopie
  167. "Schacht_Kopie" "Schacht_Kopie" ? ? "integer" ? ? ? ? ? ? yes ? no 14.6 yes ?
  168. _FldNameList[9] > AnaDat.ViperDoc.Schacht_Besr
  169. "Schacht_Besr" "Schacht_Besr" ? ? "integer" ? ? ? ? ? ? yes ? no 13.4 yes ?
  170. _FldNameList[10] > AnaDat.ViperDoc.DruckKopie
  171. "DruckKopie" "DruckKopie" ? ? "logical" ? ? ? ? ? ? yes ? no 11.2 yes ?
  172. _FldNameList[11] > AnaDat.ViperDoc.Anzahl
  173. "Anzahl" "Anzahl" ? ? "integer" ? ? ? ? ? ? yes ? no 6.4 yes ?
  174. _FldNameList[12] > AnaDat.ViperDoc.lcreatePDF
  175. "lcreatePDF" "lcreatePDF" ? ? "logical" ? ? ? ? ? ? yes ? no 10.6 yes ?
  176. _FldNameList[13] > AnaDat.ViperDoc.lDokDruck
  177. "lDokDruck" "lDokDruck" ? ? "logical" ? ? ? ? ? ? yes ? no 10.2 yes ?
  178. _FldNameList[14] > AnaDat.ViperDoc.lopenPDF
  179. "lopenPDF" "lopenPDF" ? ? "logical" ? ? ? ? ? ? yes ? no 9.4 yes ?
  180. _FldNameList[15] > AnaDat.ViperDoc.Programm
  181. "Programm" "Programm" ? ? "character" ? ? ? ? ? ? yes ? no 20 yes ?
  182. _FldNameList[16] > AnaDat.ViperDoc.Kontakt_Ind
  183. "Kontakt_Ind" "Kontakt_Ind" ? ? "integer" ? ? ? ? ? ? yes ? no 11.6 yes ?
  184. _Design-Parent is WINDOW dTables @ ( 1.14 , 2.6 )
  185. */ /* QUERY Query-Main */
  186. &ANALYZE-RESUME
  187. &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CUSTOM _MAIN-BLOCK dTables
  188. /* *************************** Main Block *************************** */
  189. { incl/datmainblock.i }
  190. &IF DEFINED(UIB_IS_RUNNING) <> 0 &THEN
  191. RUN initializeObject.
  192. &ENDIF
  193. /* _UIB-CODE-BLOCK-END */
  194. &ANALYZE-RESUME
  195. /* ********************** Internal Procedures *********************** */
  196. {&DB-REQUIRED-START}
  197. &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE dataAvailable dTables _DB-REQUIRED
  198. PROCEDURE dataAvailable :
  199. /*------------------------------------------------------------------------------
  200. Purpose: Super Override
  201. Parameters:
  202. Notes:
  203. ------------------------------------------------------------------------------*/
  204. { incl/datdataavailable.i }
  205. END PROCEDURE.
  206. /* _UIB-CODE-BLOCK-END */
  207. &ANALYZE-RESUME
  208. {&DB-REQUIRED-END}
  209. &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE disable_UI dTables _DEFAULT-DISABLE
  210. PROCEDURE disable_UI :
  211. /*------------------------------------------------------------------------------
  212. Purpose: DISABLE the User Interface
  213. Parameters: <none>
  214. Notes: Here we clean-up the user-interface by deleting
  215. dynamic widgets we have created and/or hide
  216. frames. This procedure is usually called when
  217. we are ready to "clean-up" after running.
  218. ------------------------------------------------------------------------------*/
  219. /* Hide all frames. */
  220. IF THIS-PROCEDURE:PERSISTENT THEN DELETE PROCEDURE THIS-PROCEDURE.
  221. END PROCEDURE.
  222. /* _UIB-CODE-BLOCK-END */
  223. &ANALYZE-RESUME
  224. {&DB-REQUIRED-START}
  225. &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE INAKTIVIEREN dTables _DB-REQUIRED
  226. PROCEDURE INAKTIVIEREN :
  227. /*------------------------------------------------------------------------------
  228. Purpose:
  229. Parameters: <none>
  230. Notes:
  231. ------------------------------------------------------------------------------*/
  232. { incl/datinaktivieren.i }
  233. END PROCEDURE.
  234. /* _UIB-CODE-BLOCK-END */
  235. &ANALYZE-RESUME
  236. {&DB-REQUIRED-END}
  237. {&DB-REQUIRED-START}
  238. &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE initializeObject dTables _DB-REQUIRED
  239. PROCEDURE initializeObject :
  240. /*------------------------------------------------------------------------------
  241. Purpose: Super Override
  242. Parameters:
  243. Notes:
  244. ------------------------------------------------------------------------------*/
  245. { incl/datinitialize.i }
  246. END PROCEDURE.
  247. /* _UIB-CODE-BLOCK-END */
  248. &ANALYZE-RESUME
  249. {&DB-REQUIRED-END}
  250. {&DB-REQUIRED-START}
  251. &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE REAKTIVIEREN dTables _DB-REQUIRED
  252. PROCEDURE REAKTIVIEREN :
  253. /*------------------------------------------------------------------------------
  254. Purpose:
  255. Parameters: <none>
  256. Notes:
  257. ------------------------------------------------------------------------------*/
  258. { incl/datreaktivieren.i }
  259. END PROCEDURE.
  260. /* _UIB-CODE-BLOCK-END */
  261. &ANALYZE-RESUME
  262. {&DB-REQUIRED-END}
  263. {&DB-REQUIRED-START}
  264. &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE REPOS_TABELLE dTables _DB-REQUIRED
  265. PROCEDURE REPOS_TABELLE :
  266. /*------------------------------------------------------------------------------
  267. Purpose:
  268. Parameters: <none>
  269. Notes:
  270. ------------------------------------------------------------------------------*/
  271. { incl/datrepos.i }
  272. END PROCEDURE.
  273. /* _UIB-CODE-BLOCK-END */
  274. &ANALYZE-RESUME
  275. {&DB-REQUIRED-END}
  276. {&DB-REQUIRED-START}
  277. &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE SET_FILTER dTables _DB-REQUIRED
  278. PROCEDURE SET_FILTER :
  279. /*------------------------------------------------------------------------------
  280. Purpose:
  281. Parameters: <none>
  282. Notes:
  283. ------------------------------------------------------------------------------*/
  284. { incl/datsetfilter.i }
  285. END PROCEDURE.
  286. /* _UIB-CODE-BLOCK-END */
  287. &ANALYZE-RESUME
  288. {&DB-REQUIRED-END}
  289. {&DB-REQUIRED-START}
  290. &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE SET_OPENFLAG dTables _DB-REQUIRED
  291. PROCEDURE SET_OPENFLAG :
  292. /*------------------------------------------------------------------------------
  293. Purpose:
  294. Parameters: <none>
  295. Notes:
  296. ------------------------------------------------------------------------------*/
  297. { incl/datsetopenflag.i }
  298. END PROCEDURE.
  299. /* _UIB-CODE-BLOCK-END */
  300. &ANALYZE-RESUME
  301. {&DB-REQUIRED-END}
  302. {&DB-REQUIRED-START}
  303. &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE SET_SORT dTables _DB-REQUIRED
  304. PROCEDURE SET_SORT :
  305. /*------------------------------------------------------------------------------
  306. Purpose:
  307. Parameters: <none>
  308. Notes:
  309. ------------------------------------------------------------------------------*/
  310. { incl/datsetsort.i }
  311. END PROCEDURE.
  312. /* _UIB-CODE-BLOCK-END */
  313. &ANALYZE-RESUME
  314. {&DB-REQUIRED-END}
  315. /* ************************ Function Implementations ***************** */
  316. {&DB-REQUIRED-START}
  317. &ANALYZE-SUSPEND _UIB-CODE-BLOCK _FUNCTION getCurrentRecid dTables _DB-REQUIRED
  318. FUNCTION getCurrentRecid RETURNS RECID
  319. ( /* parameter-definitions */ ) :
  320. /*------------------------------------------------------------------------------
  321. Purpose:
  322. Notes:
  323. ------------------------------------------------------------------------------*/
  324. { incl/datgetcurrentrecid.i }
  325. END FUNCTION.
  326. /* _UIB-CODE-BLOCK-END */
  327. &ANALYZE-RESUME
  328. {&DB-REQUIRED-END}
  329. {&DB-REQUIRED-START}
  330. &ANALYZE-SUSPEND _UIB-CODE-BLOCK _FUNCTION getQueryBuffer dTables _DB-REQUIRED
  331. FUNCTION getQueryBuffer RETURNS HANDLE
  332. ( /* parameter-definitions */ ) :
  333. /*------------------------------------------------------------------------------
  334. Purpose:
  335. Notes:
  336. ------------------------------------------------------------------------------*/
  337. RETURN BUFFER rowObject:HANDLE.
  338. END FUNCTION.
  339. /* _UIB-CODE-BLOCK-END */
  340. &ANALYZE-RESUME
  341. {&DB-REQUIRED-END}
  342. {&DB-REQUIRED-START}
  343. &ANALYZE-SUSPEND _UIB-CODE-BLOCK _FUNCTION openQuery dTables _DB-REQUIRED
  344. FUNCTION openQuery RETURNS LOGICAL
  345. ( /* parameter-definitions */ ) :
  346. /*------------------------------------------------------------------------------
  347. Purpose: Super Override
  348. Notes:
  349. ------------------------------------------------------------------------------*/
  350. DEF VAR Felder AS CHAR NO-UNDO.
  351. DEF VAR Inhalt AS CHAR NO-UNDO.
  352. DEF VAR ix AS INT NO-UNDO.
  353. DEF VAR cFeld AS CHAR NO-UNDO.
  354. /* IF NOT fOpen THEN RETURN FALSE. */
  355. xWhere = ''.
  356. xSort = ''.
  357. xString = ''.
  358. Felder = DYNAMIC-FUNCTION('getForeignFields':U) NO-ERROR.
  359. Inhalt = DYNAMIC-FUNCTION('getForeignValues':U) NO-ERROR.
  360. xWhere = SUBSTITUTE('ViperDoc.Firma = "&1" ', Firma).
  361. { incl/datopenquery.i }
  362. IF xWhere <> '' THEN DYNAMIC-FUNCTION('setQueryWhere':U , INPUT xWhere ).
  363. IF xSort <> '' THEN DYNAMIC-FUNCTION('setQuerySort':U , INPUT xSort ).
  364. IF xString <> '' THEN DYNAMIC-FUNCTION('setQueryString':U, INPUT xString).
  365. RETURN SUPER( ).
  366. END FUNCTION.
  367. /* _UIB-CODE-BLOCK-END */
  368. &ANALYZE-RESUME
  369. {&DB-REQUIRED-END}