d-artbez.w 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321
  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. 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 Sprcd AS INT NO-UNDO.
  33. DEF VAR SAktiv AS LOG 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 Artbez
  50. /* Definitions for QUERY Query-Main */
  51. &Scoped-Define ENABLED-FIELDS Firma Artnr Inhalt Jahr Sprcd Bez1 Bez2 Bez2_Druck Zustext1 Zustext2~
  52. Zustext3 Zustext4 Zustext5 Zustext6 Zustext7 Zustext8 Zustext9 Zustext10~
  53. Zustext_Druck Beschreibung
  54. &Scoped-define ENABLED-FIELDS-IN-Artbez Firma Artnr Inhalt Jahr Sprcd Bez1 ~
  55. Bez2 Bez2_Druck Zustext1 Zustext2 Zustext3 Zustext4 Zustext5 Zustext6 ~
  56. Zustext7 Zustext8 Zustext9 Zustext10 Zustext_Druck Beschreibung
  57. &Scoped-Define DATA-FIELDS Firma Artnr Inhalt Jahr Sprcd Bez1 Bez2 Bez2_Druck Zustext1 Zustext2~
  58. Zustext3 Zustext4 Zustext5 Zustext6 Zustext7 Zustext8 Zustext9 Zustext10~
  59. Zustext_Druck Beschreibung
  60. &Scoped-define DATA-FIELDS-IN-Artbez Firma Artnr Inhalt Jahr Sprcd Bez1 ~
  61. Bez2 Bez2_Druck Zustext1 Zustext2 Zustext3 Zustext4 Zustext5 Zustext6 ~
  62. Zustext7 Zustext8 Zustext9 Zustext10 Zustext_Druck Beschreibung
  63. &Scoped-Define MANDATORY-FIELDS Firma
  64. &Scoped-Define APPLICATION-SERVICE
  65. &Scoped-Define ASSIGN-LIST rowObject.Zustext1 = Artbez.Zustext[1]~
  66. rowObject.Zustext2 = Artbez.Zustext[2]~
  67. rowObject.Zustext3 = Artbez.Zustext[3]~
  68. rowObject.Zustext4 = Artbez.Zustext[4]~
  69. rowObject.Zustext5 = Artbez.Zustext[5]~
  70. rowObject.Zustext6 = Artbez.Zustext[6]~
  71. rowObject.Zustext7 = Artbez.Zustext[7]~
  72. rowObject.Zustext8 = Artbez.Zustext[8]~
  73. rowObject.Zustext9 = Artbez.Zustext[9]~
  74. rowObject.Zustext10 = Artbez.Zustext[10]
  75. &Scoped-Define DATA-FIELD-DEFS "d-artbez.i"
  76. &Scoped-define QUERY-STRING-Query-Main FOR EACH Artbez NO-LOCK INDEXED-REPOSITION
  77. {&DB-REQUIRED-START}
  78. &Scoped-define OPEN-QUERY-Query-Main OPEN QUERY Query-Main FOR EACH Artbez NO-LOCK INDEXED-REPOSITION.
  79. {&DB-REQUIRED-END}
  80. &Scoped-define TABLES-IN-QUERY-Query-Main Artbez
  81. &Scoped-define FIRST-TABLE-IN-QUERY-Query-Main Artbez
  82. /* Custom List Definitions */
  83. /* List-1,List-2,List-3,List-4,List-5,List-6 */
  84. /* _UIB-PREPROCESSOR-BLOCK-END */
  85. &ANALYZE-RESUME
  86. /* ************************ Function Prototypes ********************** */
  87. {&DB-REQUIRED-START}
  88. &ANALYZE-SUSPEND _UIB-CODE-BLOCK _FUNCTION-FORWARD openQuery dTables _DB-REQUIRED
  89. FUNCTION openQuery RETURNS LOGICAL
  90. ( /* parameter-definitions */ ) FORWARD.
  91. /* _UIB-CODE-BLOCK-END */
  92. &ANALYZE-RESUME
  93. {&DB-REQUIRED-END}
  94. /* *********************** Control Definitions ********************** */
  95. {&DB-REQUIRED-START}
  96. /* Query definitions */
  97. &ANALYZE-SUSPEND
  98. DEFINE QUERY Query-Main FOR
  99. Artbez SCROLLING.
  100. &ANALYZE-RESUME
  101. {&DB-REQUIRED-END}
  102. /* ************************ Frame Definitions *********************** */
  103. /* *********************** Procedure Settings ************************ */
  104. &ANALYZE-SUSPEND _PROCEDURE-SETTINGS
  105. /* Settings for THIS-PROCEDURE
  106. Type: SmartDataObject
  107. Allow: Query
  108. Frames: 0
  109. Add Fields to: Neither
  110. Other Settings: PERSISTENT-ONLY COMPILE APPSERVER DB-AWARE
  111. */
  112. /* This procedure should always be RUN PERSISTENT. Report the error, */
  113. /* then cleanup and return. */
  114. IF NOT THIS-PROCEDURE:PERSISTENT THEN DO:
  115. MESSAGE "{&FILE-NAME} should only be RUN PERSISTENT.":U
  116. VIEW-AS ALERT-BOX ERROR BUTTONS OK.
  117. RETURN.
  118. END.
  119. &ANALYZE-RESUME _END-PROCEDURE-SETTINGS
  120. /* ************************* Create Window ************************** */
  121. &ANALYZE-SUSPEND _CREATE-WINDOW
  122. /* DESIGN Window definition (used by the UIB)
  123. CREATE WINDOW dTables ASSIGN
  124. HEIGHT = 1.62
  125. WIDTH = 46.6.
  126. /* END WINDOW DEFINITION */
  127. */
  128. &ANALYZE-RESUME
  129. &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CUSTOM _INCLUDED-LIB dTables
  130. /* ************************* Included-Libraries *********************** */
  131. {src/adm2/data.i}
  132. /* _UIB-CODE-BLOCK-END */
  133. &ANALYZE-RESUME
  134. /* *********** Runtime Attributes and AppBuilder Settings *********** */
  135. &ANALYZE-SUSPEND _RUN-TIME-ATTRIBUTES
  136. /* SETTINGS FOR WINDOW dTables
  137. VISIBLE,,RUN-PERSISTENT */
  138. /* _RUN-TIME-ATTRIBUTES-END */
  139. &ANALYZE-RESUME
  140. /* Setting information for Queries and Browse Widgets fields */
  141. &ANALYZE-SUSPEND _QUERY-BLOCK QUERY Query-Main
  142. /* Query rebuild information for SmartDataObject Query-Main
  143. _TblList = "AnaDat.Artbez"
  144. _Options = "NO-LOCK INDEXED-REPOSITION"
  145. _FldNameList[1] > AnaDat.Artbez.Firma
  146. "Firma" "Firma" ? ? "character" ? ? ? ? ? ? yes ? yes 8 yes ""
  147. _FldNameList[2] > AnaDat.Artbez.Artnr
  148. "Artnr" "Artnr" ? ? "integer" ? ? ? ? ? ? yes ? no 7.2 yes ""
  149. _FldNameList[3] > AnaDat.Artbez.Inhalt
  150. "Inhalt" "Inhalt" ? ? "integer" ? ? ? ? ? ? yes ? no 5.2 yes ""
  151. _FldNameList[4] > AnaDat.Artbez.Jahr
  152. "Jahr" "Jahr" ? ? "integer" ? ? ? ? ? ? yes ? no 4.8 yes ""
  153. _FldNameList[5] > AnaDat.Artbez.Sprcd
  154. "Sprcd" "Sprcd" ? ? "integer" ? ? ? ? ? ? yes ? no 5.6 yes ""
  155. _FldNameList[6] > AnaDat.Artbez.Bez1
  156. "Bez1" "Bez1" ? ? "character" ? ? ? ? ? ? yes ? no 30 yes ""
  157. _FldNameList[7] > AnaDat.Artbez.Bez2
  158. "Bez2" "Bez2" ? ? "character" ? ? ? ? ? ? yes ? no 30 yes ""
  159. _FldNameList[8] > AnaDat.Artbez.Bez2_Druck
  160. "Bez2_Druck" "Bez2_Druck" ? ? "logical" ? ? ? ? ? ? yes ? no 11.8 yes ""
  161. _FldNameList[9] > AnaDat.Artbez.Zustext[1]
  162. "Zustext[1]" "Zustext1" ? ? "character" ? ? ? ? ? ? yes ? no 30 yes ""
  163. _FldNameList[10] > AnaDat.Artbez.Zustext[2]
  164. "Zustext[2]" "Zustext2" ? ? "character" ? ? ? ? ? ? yes ? no 30 yes ""
  165. _FldNameList[11] > AnaDat.Artbez.Zustext[3]
  166. "Zustext[3]" "Zustext3" ? ? "character" ? ? ? ? ? ? yes ? no 30 yes ""
  167. _FldNameList[12] > AnaDat.Artbez.Zustext[4]
  168. "Zustext[4]" "Zustext4" ? ? "character" ? ? ? ? ? ? yes ? no 30 yes ""
  169. _FldNameList[13] > AnaDat.Artbez.Zustext[5]
  170. "Zustext[5]" "Zustext5" ? ? "character" ? ? ? ? ? ? yes ? no 30 yes ""
  171. _FldNameList[14] > AnaDat.Artbez.Zustext[6]
  172. "Zustext[6]" "Zustext6" ? ? "character" ? ? ? ? ? ? yes ? no 30 yes ""
  173. _FldNameList[15] > AnaDat.Artbez.Zustext[7]
  174. "Zustext[7]" "Zustext7" ? ? "character" ? ? ? ? ? ? yes ? no 30 yes ""
  175. _FldNameList[16] > AnaDat.Artbez.Zustext[8]
  176. "Zustext[8]" "Zustext8" ? ? "character" ? ? ? ? ? ? yes ? no 30 yes ""
  177. _FldNameList[17] > AnaDat.Artbez.Zustext[9]
  178. "Zustext[9]" "Zustext9" ? ? "character" ? ? ? ? ? ? yes ? no 30 yes ""
  179. _FldNameList[18] > AnaDat.Artbez.Zustext[10]
  180. "Zustext[10]" "Zustext10" ? ? "character" ? ? ? ? ? ? yes ? no 30 yes ""
  181. _FldNameList[19] > AnaDat.Artbez.Zustext_Druck
  182. "Zustext_Druck" "Zustext_Druck" ? ? "logical" ? ? ? ? ? ? yes ? no 14 yes ""
  183. _FldNameList[20] > AnaDat.Artbez.Beschreibung
  184. "Beschreibung" "Beschreibung" ? ? "character" ? ? ? ? ? ? yes ? no 2000 yes ?
  185. _Design-Parent is WINDOW dTables @ ( 1.14 , 2.6 )
  186. */ /* QUERY Query-Main */
  187. &ANALYZE-RESUME
  188. &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CUSTOM _MAIN-BLOCK dTables
  189. /* *************************** Main Block *************************** */
  190. SAktiv = DYNAMIC-FUNCTION('getSuperAktiv':U) NO-ERROR.
  191. IF SAktiv THEN DO:
  192. Firma = DYNAMIC-FUNCTION('GETMANDANT':U) NO-ERROR.
  193. Sprcd = DYNAMIC-FUNCTION('GETBENUTZERSPRCD':U) NO-ERROR.
  194. END.
  195. xWhere = 'FOR EACH ArtBez USE-INDEX ArtBez-k1 '
  196. + 'WHERE ArtBez.Firma = "' + Firma + '" '
  197. + 'AND ArtBez.Sprcd = ' + STRING(Sprcd) + ' '
  198. + 'NO-LOCK '.
  199. &IF DEFINED(UIB_IS_RUNNING) <> 0 &THEN
  200. RUN initializeObject.
  201. &ENDIF
  202. /* _UIB-CODE-BLOCK-END */
  203. &ANALYZE-RESUME
  204. /* ********************** Internal Procedures *********************** */
  205. &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE disable_UI dTables _DEFAULT-DISABLE
  206. PROCEDURE disable_UI :
  207. /*------------------------------------------------------------------------------
  208. Purpose: DISABLE the User Interface
  209. Parameters: <none>
  210. Notes: Here we clean-up the user-interface by deleting
  211. dynamic widgets we have created and/or hide
  212. frames. This procedure is usually called when
  213. we are ready to "clean-up" after running.
  214. ------------------------------------------------------------------------------*/
  215. /* Hide all frames. */
  216. IF THIS-PROCEDURE:PERSISTENT THEN DELETE PROCEDURE THIS-PROCEDURE.
  217. END PROCEDURE.
  218. /* _UIB-CODE-BLOCK-END */
  219. &ANALYZE-RESUME
  220. /* ************************ Function Implementations ***************** */
  221. {&DB-REQUIRED-START}
  222. &ANALYZE-SUSPEND _UIB-CODE-BLOCK _FUNCTION openQuery dTables _DB-REQUIRED
  223. FUNCTION openQuery RETURNS LOGICAL
  224. ( /* parameter-definitions */ ) :
  225. /*------------------------------------------------------------------------------
  226. Purpose: Super Override
  227. Notes:
  228. ------------------------------------------------------------------------------*/
  229. /* xWhere = ''. */
  230. /* DYNAMIC-FUNCTION('setQueryWhere':U, INPUT xWhere). */
  231. /* xSort = ''. */
  232. /* DYNAMIC-FUNCTION('setQuerySort':U, INPUT xSort). */
  233. DYNAMIC-FUNCTION('setQueryString':U, INPUT xWhere).
  234. MESSAGE DYNAMIC-FUNCTION('getQueryString':U).
  235. RETURN SUPER( ).
  236. END FUNCTION.
  237. /* _UIB-CODE-BLOCK-END */
  238. &ANALYZE-RESUME
  239. {&DB-REQUIRED-END}