d-dokudrucker.w 11 KB

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