antoniop
committed
on 27 Jul 18
Fix files__page_contracts automated test for the page
/lib/service-parameters.tcl (+13 -10)
1   #
2   # Service parameters list
3   #
  1 ad_include_contract {
4 2
  3     Service parameters list
  4
  5 } {
  6 } -validate {
  7     swa_p {
5 8         if { ![acs_user::site_wide_admin_p] } {
6       ad_return_forbidden \
7           "Permission Denied" \
8           "<blockquote>You don't have permission to view this page.</blockquote>"
  9             ad_return_forbidden
9 10             ad_script_abort
10 11         }
  12     }
  13 }
11 14
12 15 set user_id [ad_conn user_id]
13 16 set swadmin_p 0
14 17 db_multirow -extend { url admin_url param_url sitewide_admin_url} packages services_select {
15 18     select package_id,
16 19            ap.package_key,
17 20            pretty_name as instance_name,
18 21            (select count(*) from apm_parameters
19 22              where package_key = ap.package_key) as parameter_count
20 23     from apm_packages ap,
21 24          apm_package_types
22 25     where ap.package_key = apm_package_types.package_key
23 26     and package_type = 'apm_service'
24 27     and ap.package_key <> 'acs-subsite'
25 28     order by instance_name
26 29 } {
27 30     set root_dir [acs_package_root_dir $package_key]
28 31     set sitewide_admin_url ""
29 32     if { [file exists $root_dir/www/] } {
30 33         set url [apm_package_url_from_key $package_key]
 
61 64         }
62 65         www {
63 66             label "\#acs-admin.Pages\#"
64 67             link_url_col url
65 68             link_html { title "\#acs-admin.Visit_service_pages\#" }
66 69             display_template {<if @packages.url@ not nil>\#acs-admin.Pages\#</if>}
67 70             html {align left}
68 71         }
69 72         admin {
70 73             label "\#acs-admin.Administration\#"
71 74             link_url_col admin_url
72 75             link_html { title "\#acs-admin.Service_administration\#" }
73 76             display_template {<if @packages.admin_url@ not nil>\#acs-admin.Administration\#</if>}
74 77             html {align left}
75 78         }
76 79         sitewide_admin {
77 80             label "\#acs-admin.Site-Wide_Admin\#"
78 81             link_url_col sitewide_admin_url
79 82             link_html { title "\#acs-admin.Service_administration\#" }
80 83             display_template {<if @packages.sitewide_admin_url@ not nil>\#acs-admin.Administration\#</if>}
81               hide_p {[ad_decode $swadmin_p 1 0 1]}
  84             hide_p {[string is false $swadmin_p]}
82 85             html {align left}
83 86         }
84 87         parameters {
85 88             label "\#acs-admin.Parameters\#"
86 89             link_url_col param_url
87 90             link_html { title "\#acs-admin.Service_parameters\#" }
88 91             display_template {<if @packages.param_url@ not nil>\#acs-admin.Parameters\#</if>}
89 92             html {align left}
90 93         }
91 94     }
92 95
93 96
94 97 # Local variables:
95 98 #    mode: tcl
96 99 #    tcl-indent-level: 4
97 100 #    indent-tabs-mode: nil
98 101 # End: