d-libild.w 8.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298
  1. &ANALYZE-SUSPEND _VERSION-NUMBER AB_v9r12 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. DEF VAR xWhere AS CHAR NO-UNDO.
  30. DEF VAR xSort AS CHAR NO-UNDO.
  31. DEF VAR Firma AS CHAR NO-UNDO.
  32. DEF VAR SAktiv AS LOG NO-UNDO INIT FALSE.
  33. DEF VAR Sprcd AS INT NO-UNDO.
  34. /* _UIB-CODE-BLOCK-END */
  35. &ANALYZE-RESUME
  36. &ANALYZE-SUSPEND _UIB-PREPROCESSOR-BLOCK
  37. /* ******************** Preprocessor Definitions ******************** */
  38. &Scoped-define PROCEDURE-TYPE SmartDataObject
  39. &Scoped-define DB-AWARE yes
  40. &Scoped-define ADM-SUPPORTED-LINKS Data-Source,Data-Target,Navigation-Target,Update-Target,Commit-Target,Filter-Target
  41. /* Db-Required definitions. */
  42. &IF DEFINED(DB-REQUIRED) = 0 &THEN
  43. &GLOBAL-DEFINE DB-REQUIRED TRUE
  44. &ENDIF
  45. &GLOBAL-DEFINE DB-REQUIRED-START &IF {&DB-REQUIRED} &THEN
  46. &GLOBAL-DEFINE DB-REQUIRED-END &ENDIF
  47. &Scoped-define QUERY-NAME Query-Main
  48. /* Internal Tables (found by Frame, Query & Browse Queries) */
  49. &Scoped-define INTERNAL-TABLES LiBild
  50. /* Definitions for QUERY Query-Main */
  51. &Scoped-Define ENABLED-FIELDS Sprcd Prog Tenr Litext
  52. &Scoped-define ENABLED-FIELDS-IN-LiBild Sprcd Prog Tenr Litext
  53. &Scoped-Define DATA-FIELDS Sprcd Prog Tenr Litext
  54. &Scoped-define DATA-FIELDS-IN-LiBild Sprcd Prog Tenr Litext
  55. &Scoped-Define MANDATORY-FIELDS Prog
  56. &Scoped-Define APPLICATION-SERVICE
  57. &Scoped-Define ASSIGN-LIST
  58. &Scoped-Define DATA-FIELD-DEFS "d-libild.i"
  59. {&DB-REQUIRED-START}
  60. &Scoped-define OPEN-QUERY-Query-Main OPEN QUERY Query-Main FOR EACH LiBild NO-LOCK INDEXED-REPOSITION.
  61. {&DB-REQUIRED-END}
  62. &Scoped-define TABLES-IN-QUERY-Query-Main LiBild
  63. &Scoped-define FIRST-TABLE-IN-QUERY-Query-Main LiBild
  64. /* Custom List Definitions */
  65. /* List-1,List-2,List-3,List-4,List-5,List-6 */
  66. /* _UIB-PREPROCESSOR-BLOCK-END */
  67. &ANALYZE-RESUME
  68. /* ************************ Function Prototypes ********************** */
  69. {&DB-REQUIRED-START}
  70. &ANALYZE-SUSPEND _UIB-CODE-BLOCK _FUNCTION-FORWARD openQuery dTables _DB-REQUIRED
  71. FUNCTION openQuery RETURNS LOGICAL
  72. ( /* parameter-definitions */ ) FORWARD.
  73. /* _UIB-CODE-BLOCK-END */
  74. &ANALYZE-RESUME
  75. {&DB-REQUIRED-END}
  76. {&DB-REQUIRED-START}
  77. &ANALYZE-SUSPEND _UIB-CODE-BLOCK _FUNCTION-FORWARD setSprcd dTables _DB-REQUIRED
  78. FUNCTION setSprcd RETURNS LOGICAL
  79. ( ipSprcd AS INT ) FORWARD.
  80. /* _UIB-CODE-BLOCK-END */
  81. &ANALYZE-RESUME
  82. {&DB-REQUIRED-END}
  83. /* *********************** Control Definitions ********************** */
  84. {&DB-REQUIRED-START}
  85. /* Query definitions */
  86. &ANALYZE-SUSPEND
  87. DEFINE QUERY Query-Main FOR
  88. LiBild SCROLLING.
  89. &ANALYZE-RESUME
  90. {&DB-REQUIRED-END}
  91. /* ************************ Frame Definitions *********************** */
  92. /* *********************** Procedure Settings ************************ */
  93. &ANALYZE-SUSPEND _PROCEDURE-SETTINGS
  94. /* Settings for THIS-PROCEDURE
  95. Type: SmartDataObject
  96. Allow: Query
  97. Frames: 0
  98. Add Fields to: Neither
  99. Other Settings: PERSISTENT-ONLY COMPILE APPSERVER DB-AWARE
  100. */
  101. /* This procedure should always be RUN PERSISTENT. Report the error, */
  102. /* then cleanup and return. */
  103. IF NOT THIS-PROCEDURE:PERSISTENT THEN DO:
  104. MESSAGE "{&FILE-NAME} should only be RUN PERSISTENT.":U
  105. VIEW-AS ALERT-BOX ERROR BUTTONS OK.
  106. RETURN.
  107. END.
  108. &ANALYZE-RESUME _END-PROCEDURE-SETTINGS
  109. /* ************************* Create Window ************************** */
  110. &ANALYZE-SUSPEND _CREATE-WINDOW
  111. /* DESIGN Window definition (used by the UIB)
  112. CREATE WINDOW dTables ASSIGN
  113. HEIGHT = 1.62
  114. WIDTH = 46.6.
  115. /* END WINDOW DEFINITION */
  116. */
  117. &ANALYZE-RESUME
  118. &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CUSTOM _INCLUDED-LIB dTables
  119. /* ************************* Included-Libraries *********************** */
  120. {src/adm2/data.i}
  121. /* _UIB-CODE-BLOCK-END */
  122. &ANALYZE-RESUME
  123. /* *********** Runtime Attributes and AppBuilder Settings *********** */
  124. &ANALYZE-SUSPEND _RUN-TIME-ATTRIBUTES
  125. /* SETTINGS FOR WINDOW dTables
  126. VISIBLE,,RUN-PERSISTENT */
  127. /* _RUN-TIME-ATTRIBUTES-END */
  128. &ANALYZE-RESUME
  129. /* Setting information for Queries and Browse Widgets fields */
  130. &ANALYZE-SUSPEND _QUERY-BLOCK QUERY Query-Main
  131. /* Query rebuild information for SmartDataObject Query-Main
  132. _TblList = "AnaDat.LiBild"
  133. _Options = "NO-LOCK INDEXED-REPOSITION"
  134. _FldNameList[1] > AnaDat.LiBild.Sprcd
  135. "Sprcd" "Sprcd" "Sprache" ? "integer" ? ? ? ? ? ? yes ? no 5.6 yes
  136. _FldNameList[2] > AnaDat.LiBild.Prog
  137. "Prog" "Prog" "Programm" "x(25)" "character" ? ? ? ? ? ? yes ? yes 25 yes
  138. _FldNameList[3] > AnaDat.LiBild.Tenr
  139. "Tenr" "Tenr" "Nummer" ? "integer" ? ? ? ? ? ? yes ? no 4.4 yes
  140. _FldNameList[4] > AnaDat.LiBild.Litext
  141. "Litext" "Litext" "Text/INhalt" ? "character" ? ? ? ? ? ? yes ? no 70 yes
  142. _Design-Parent is WINDOW dTables @ ( 1.14 , 2.6 )
  143. */ /* QUERY Query-Main */
  144. &ANALYZE-RESUME
  145. &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CUSTOM _MAIN-BLOCK dTables
  146. /* *************************** Main Block *************************** */
  147. SAktiv = DYNAMIC-FUNCTION('getSuperAktiv':U) NO-ERROR.
  148. IF SAktiv THEN DO:
  149. Firma = DYNAMIC-FUNCTION('GETMANDANT':U) NO-ERROR.
  150. Sprcd = DYNAMIC-FUNCTION('GETSPRCD':U) NO-ERROR.
  151. END.
  152. &IF DEFINED(UIB_IS_RUNNING) <> 0 &THEN
  153. RUN initializeObject.
  154. &ENDIF
  155. /* _UIB-CODE-BLOCK-END */
  156. &ANALYZE-RESUME
  157. /* ********************** Internal Procedures *********************** */
  158. &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE disable_UI dTables _DEFAULT-DISABLE
  159. PROCEDURE disable_UI :
  160. /*------------------------------------------------------------------------------
  161. Purpose: DISABLE the User Interface
  162. Parameters: <none>
  163. Notes: Here we clean-up the user-interface by deleting
  164. dynamic widgets we have created and/or hide
  165. frames. This procedure is usually called when
  166. we are ready to "clean-up" after running.
  167. ------------------------------------------------------------------------------*/
  168. /* Hide all frames. */
  169. IF THIS-PROCEDURE:PERSISTENT THEN DELETE PROCEDURE THIS-PROCEDURE.
  170. END PROCEDURE.
  171. /* _UIB-CODE-BLOCK-END */
  172. &ANALYZE-RESUME
  173. /* ************************ Function Implementations ***************** */
  174. {&DB-REQUIRED-START}
  175. &ANALYZE-SUSPEND _UIB-CODE-BLOCK _FUNCTION openQuery dTables _DB-REQUIRED
  176. FUNCTION openQuery RETURNS LOGICAL
  177. ( /* parameter-definitions */ ) :
  178. /*------------------------------------------------------------------------------
  179. Purpose: Super Override
  180. Notes:
  181. ------------------------------------------------------------------------------*/
  182. xWhere = 'LiBild.Sprcd = ' + STRING(Sprcd).
  183. DYNAMIC-FUNCTION('setQueryWhere':U, INPUT xWhere).
  184. xSort = 'Libild.Prog BY LiBild.TeNr'.
  185. DYNAMIC-FUNCTION('setQuerySort':U, INPUT xSort).
  186. /* xWhere = ''. */
  187. /* DYNAMIC-FUNCTION('setQueryString':U, INPUT xWhere). */
  188. RETURN SUPER( ).
  189. END FUNCTION.
  190. /* _UIB-CODE-BLOCK-END */
  191. &ANALYZE-RESUME
  192. {&DB-REQUIRED-END}
  193. {&DB-REQUIRED-START}
  194. &ANALYZE-SUSPEND _UIB-CODE-BLOCK _FUNCTION setSprcd dTables _DB-REQUIRED
  195. FUNCTION setSprcd RETURNS LOGICAL
  196. ( ipSprcd AS INT ) :
  197. /*------------------------------------------------------------------------------
  198. Purpose:
  199. Notes:
  200. ------------------------------------------------------------------------------*/
  201. IF ipSprcd = Sprcd THEN RETURN TRUE.
  202. Sprcd = ipSprcd.
  203. DYNAMIC-FUNCTION('openQuery':U).
  204. RETURN TRUE.
  205. END FUNCTION.
  206. /* _UIB-CODE-BLOCK-END */
  207. &ANALYZE-RESUME
  208. {&DB-REQUIRED-END}