Commit bb2d9d96 authored by Frank Bergmann's avatar Frank Bergmann

- Gustaf changes

parent aaa8a3a0
......@@ -91,7 +91,7 @@ ad_proc im_survsimp_component { object_id } {
set som_gif ""
if {"" != $som_note} {set som_gif [im_gif -translate_p 0 help $som_note]}
append survsimp_html "
<tr $bgcolor([expr $ctr % 2])>
<tr $bgcolor([expr {$ctr % 2}])>
<td><a href=\"$survey_url?survey_id=$survey_id\">$short_name</a></td>
<td>$som_name $som_gif</td>
</tr>
......@@ -200,12 +200,12 @@ ad_proc im_survsimp_component { object_id } {
order by sort_key
"
append survsimp_response_html "
<tr $bgcolor([expr $response_ctr % 2])>
<td $bgcolor([expr $response_ctr % 2])>
<tr $bgcolor([expr {$response_ctr % 2}])>
<td $bgcolor([expr {$response_ctr % 2}])>
<a href=[export_vars -base "/intranet/users/view" {{user_id $creation_user_id}}]
>$creation_user_name</a>
</td>
<td $bgcolor([expr $response_ctr % 2])>
<td $bgcolor([expr {$response_ctr % 2}])>
<a href=\"$related_context_url$related_context_id\"
>$related_context_name</a>
</td>
......@@ -213,7 +213,7 @@ ad_proc im_survsimp_component { object_id } {
db_foreach q $questions_sql {
if {[string length $clob_answer] == $max_clob_len} { append clob_answer " ..." }
append survsimp_response_html "
<td $bgcolor([expr $response_ctr % 2])>
<td $bgcolor([expr {$response_ctr % 2}])>
$choice $boolean_answer $clob_answer $number_answer $varchar_answer $date_answer
</td>
"
......
<master>
<property name="context">@context_bar@</property>
<property name="title">@page_title@</property>
<property name="context">@context_bar;literal@</property>
<property name="doc(title)">@page_title;literal@</property>
<property name="admin_navbar_label">admin_dynfield</property>
<h3>Global Survey Permissions</h3>
......
......@@ -17,7 +17,7 @@ ad_page_contract {
# Defaults & Security
# ------------------------------------------------------
set user_id [ad_maybe_redirect_for_registration]
set user_id [auth::require_login]
set user_is_admin_p [im_is_user_site_wide_or_intranet_admin $user_id]
if {!$user_is_admin_p} {
......@@ -147,7 +147,7 @@ set ctr 0
set old_package_name ""
db_foreach survsimp_query $survsimp_sql {
incr ctr
append table "\n<tr$bgcolor([expr $ctr % 2])>\n"
append table "\n<tr$bgcolor([expr {$ctr % 2}])>\n"
append table "
<td>
<A href=[export_vars -base $survsimp_admin_url {survey_id return_url}]>
......@@ -165,11 +165,11 @@ db_foreach survsimp_query $survsimp_sql {
set action "add_readable"
set letter "r"
if {$read_p == "t"} {
set read "<A href=$toggle_url?object_id=$survey_id&action=remove_readable&[export_vars -url { horiz_group_id return_url}]><b>R</b></A>\n"
set read "<A href=$toggle_url?object_id=$survey_id&action=remove_readable&[export_vars { horiz_group_id return_url}]><b>R</b></A>\n"
set action "remove_readable"
set letter "<b>R</b>"
}
set read "<A href=$toggle_url?[export_vars -url { horiz_group_id object_id action return_url}]>$letter</A>\n"
set read "<A href=[export_vars -base $toggle_url { horiz_group_id object_id action return_url}]>$letter</A>\n"
append table "
<td align=center>
......
<master>
<property name="title">@page_title@</property>
<property name="main_navbar_label">@main_navbar_label@</property>
<property name="sub_navbar">@sub_navbar;noquote@</property>
<property name="left_navbar">@left_navbar_html;noquote@</property>
<property name="show_context_help">@show_context_help_p;noquote@</property>
<property name="doc(title)">@page_title;literal@</property>
<property name="main_navbar_label">@main_navbar_label;literal@</property>
<property name="sub_navbar">@sub_navbar;literal@</property>
<property name="left_navbar">@left_navbar_html;literal@</property>
<property name="show_context_help">@show_context_help_p;literal@</property>
@html;noquote@
......@@ -13,7 +13,7 @@ ad_page_contract {
response_id:integer
}
set current_user_id [ad_maybe_redirect_for_registration]
set current_user_id [auth::require_login]
# -----------------------------------------------------------------
# Basic survey information and security
......@@ -47,7 +47,7 @@ if {"" == $related_object_id} {
# This is a survey response not related to a ]po[
# object, so use the standard SurvSimp permissions:
ad_require_permission $survey_id survsimp_admin_survey
permission::require_permission -object_id $survey_id -privilege survsimp_admin_survey
} else {
......
<master>
<property name="title">@page_title@</property>
<property name="main_navbar_label">@main_navbar_label@</property>
<property name="sub_navbar">@sub_navbar;noquote@</property>
<property name="left_navbar">@left_navbar_html;noquote@</property>
<property name="show_context_help">@show_context_help_p;noquote@</property>
<property name="doc(title)">@page_title;literal@</property>
<property name="main_navbar_label">@main_navbar_label;literal@</property>
<property name="sub_navbar">@sub_navbar;literal@</property>
<property name="left_navbar">@left_navbar_html;literal@</property>
<property name="show_context_help">@show_context_help_p;literal@</property>
<table>
<tr valign=top>
<tr valign="top">
<td>
@html;noquote@
</td>
......
......@@ -31,14 +31,14 @@ ad_page_contract {
# ---------------------------------------------------------------
set menu_label "reporting_survsimp_results"
set current_user_id [ad_maybe_redirect_for_registration]
set current_user_id [auth::require_login]
set read_p [db_string report_perms "
select im_object_permission_p(m.menu_id, :current_user_id, 'read')
from im_menus m
where m.label = :menu_label
" -default 'f']
set read_p "t"
if {![string equal "t" $read_p]} {
if {"t" ne $read_p } {
ad_return_complaint 1 "<li>
[lang::message::lookup "" intranet-reporting.You_dont_have_permissions "You don't have the necessary permissions to view this page"]"
return
......@@ -321,7 +321,7 @@ foreach project_tuple $left_dim {
set type_id [lindex $project_tuple 4]
set type [lindex $project_tuple 5]
set row_html "<tr$bgcolor([expr $ctr % 2])><td><a href='$project_url$project_id'>$project_name</a></td>\n"
set row_html "<tr$bgcolor([expr {$ctr % 2}])><td><a href='$project_url$project_id'>$project_name</a></td>\n"
foreach date_tuple $top_dim {
set monday_julian [lindex $date_tuple 0]
......
......@@ -22,13 +22,13 @@ ad_page_contract {
# ------------------------------------------------------------
set menu_label "reporting_survsimp_results"
set current_user_id [ad_maybe_redirect_for_registration]
set current_user_id [auth::require_login]
set read_p [db_string report_perms "
select im_object_permission_p(m.menu_id, :current_user_id, 'read')
from im_menus m
where m.label = :menu_label
" -default 'f']
if {![string equal "t" $read_p]} {
if {"t" ne $read_p } {
ad_return_complaint 1 "<li>
[lang::message::lookup "" intranet-reporting.You_dont_have_permissions "You don't have the necessary permissions to view this page"]"
return
......@@ -102,16 +102,16 @@ if {[info exists evaluee_id] && 0 != $evaluee_id && "" != $evaluee_id} {
lappend criteria "h.user_id = :evaluee_id"
}
if {[exists_and_not_null start_date]} {
if {([info exists start_date] && $start_date ne "")} {
lappend criteria "ro.creation_date >= :start_date::timestamptz"
}
if {[exists_and_not_null end_date]} {
if {([info exists end_date] && $end_date ne "")} {
lappend criteria "ro.creation_date <= :end_date::timestamptz"
}
set where_clause [join $criteria " and\n "]
if { ![empty_string_p $where_clause] } {
if { $where_clause ne "" } {
set where_clause " and $where_clause"
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment