Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
I
intranet-dynfield
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
project-open
intranet-dynfield
Commits
67564f22
Commit
67564f22
authored
May 24, 2007
by
Frank Bergmann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
- BaselKB changes
parent
bf75455e
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
52 deletions
+8
-52
intranet-dynfield-procs.tcl
tcl/intranet-dynfield-procs.tcl
+7
-52
widget-new.tcl
www/widget-new.tcl
+1
-0
No files found.
tcl/intranet-dynfield-procs.tcl
View file @
67564f22
...
...
@@ -1257,6 +1257,7 @@ ad_proc -public im_dynfield::search_sql_criteria_from_form {
ad_proc -public im_dynfield::create_clone_update_sql
{
-object_type:required
-object_id:required
}
{
Returns an SQL update statement that can be executed in
the context of an object clone
()
procedure in order to
...
...
@@ -1302,66 +1303,20 @@ ad_proc -public im_dynfield::create_clone_update_sql {
"
set sql
"update
$main
_table_name set
\n
"
set ext_tables
[
list
]
set ext_table_join_where
""
db_foreach ext_tables
$ext
_table_sql
{
if
{
$ext
_table_name ==
""
}
{
continue
}
if
{
$ext
_table_name ==
$main
_table_name
}
{
continue
}
lappend ext_tables
$ext
_table_name
append ext_table_join_where
"
\t
and
$main
_table_name.
$main
_id_column =
$ext
_table_name.
$ext
_id_column
\n
"
}
set bind_vars
[
ns_set create
]
set criteria
[
list
]
set komma_required 0
db_foreach attributes
$attributes
_sql
{
# Check whether the attribute is part of the form
if
{[
lsearch
$form
_elements
$attribute
_name
]
>= 0
}
{
set value
[
template::element::get_value
$form
_id
$attribute
_name
]
if
{
""
==
$value
}
{
continue
}
ns_set put
$bind
_vars
$attribute
_name
$value
lappend criteria
"
$attribute
_table_name.
$attribute
_name = :
$attribute
_name"
}
if
{
$komma
_required
}
{
append sql
","
}
append sql
"
\t
$attribute
_name = :
$attribute
_name
\n
"
set komma_required 1
}
set where_clause
[
join
$criteria
" and
\n
"
]
if
{
!
[
empty_string_p
$where
_clause
]
}
{
set where_clause
" and
$where
_clause"
}
append sql
"where
$main
_id_column =
$object
_id
\n
"
set sql
"
(select
$main
_id_column as object_id
from
[
join
[
concat
[
list
$main
_table_name
]
$ext
_tables
]
",
\n\t
"
]
where 1 = 1
$ext
_table_join_where
$where
_clause
)
"
# Skip empty where clause
if
{
""
==
$where
_clause
}
{
set sql
""
}
set extra
(
where
)
$sql
set extra
(
bind_vars
)
[
util_ns_set_to_list -set
$bind
_vars
]
ns_set free
$bind
_vars
return
[
array
get extra
]
return
$sql
}
ad_proc -public im_dynfield::set_form_values_from_http
{
-form_id:required
}
{
...
...
www/widget-new.tcl
View file @
67564f22
...
...
@@ -75,6 +75,7 @@ set widget_options [list \
set
deref_options
[
list
\
[
list
"Generic Default (im_name_from_id)"
"im_name_from_id"
]
\
[
list
"Integer (im_integer_from_id)"
"im_integer_from_id"
]
\
[
list
"User Name (im_name_from_user_id)"
"im_name_from_user_id"
]
\
[
list
"User Email (im_email_from_user_id)"
"im_email_from_user_id"
]
\
[
list
"Cost Center Name (im_cost_center_name_from_id)"
"im_cost_center_name_from_id"
]
\
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment