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
15a3a6a2
Commit
15a3a6a2
authored
Mar 09, 2007
by
Frank Bergmann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
- added dynfield debugging for VAW case of date field that didn't save data
parent
0d657ca7
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
81 additions
and
122 deletions
+81
-122
object-type-postgresql.xql
www/object-type-postgresql.xql
+9
-17
object-type.adp
www/object-type.adp
+9
-32
object-type.tcl
www/object-type.tcl
+63
-73
No files found.
www/object-type-postgresql.xql
View file @
15a3a6a2
...
...
@@ -15,6 +15,8 @@
aa.pretty_plural,
aa.table_name,
aa.attribute_id as acs_attribute_id,
lower(aa.datatype) as attribute_data_type,
lower(c.data_type) as table_data_type,
fa.attribute_id as im_dynfield_attribute_id,
fa.widget_name,
w.widget_id,
...
...
@@ -25,12 +27,15 @@
la.label_style
from
acs_attributes aa
right outer
join
RIGHT OUTER
join
im_dynfield_attributes fa
on
(aa.attribute_id = fa.acs_attribute_id)
left outer
join
ON
(aa.attribute_id = fa.acs_attribute_id)
LEFT OUTER
join
(select * from im_dynfield_layout where page_url = '') la
on (fa.attribute_id = la.attribute_id),
ON (fa.attribute_id = la.attribute_id)
LEFT OUTER join
user_tab_columns c
ON (c.table_name = upper(aa.table_name) and c.column_name = upper(aa.attribute_name)),
im_dynfield_widgets w
where
aa.object_type = :object_type
...
...
@@ -41,17 +46,4 @@
</querytext>
</fullquery>
<fullquery
name=
"objects_query"
>
<querytext>
select
$id_column as object_id,
acs_object__name($id_column) as object_name
from
$table_name
</querytext>
</fullquery>
</queryset>
www/object-type.adp
View file @
15a3a6a2
...
...
@@ -14,7 +14,9 @@
<th class="list-narrow">#intranet-dynfield.Attribute_Name#</th>
<th class="list-narrow">#intranet-dynfield.Pretty_Name#</th>
<th class="list-narrow">#intranet-dynfield.Located# <br>#intranet-dynfield.in_Table#</th>
<th class="list-narrow">#intranet-dynfield.Widget_Name#</th>
<th class="list-narrow">Widget<br>Name</th>
<th class="list-narrow">Attrib<br>Type</th>
<th class="list-narrow">Table<br>Type</th>
<th class="list-narrow">#intranet-dynfield.Del#</th>
</tr>
...
...
@@ -41,7 +43,12 @@
@attributes.widget_name@
</a>
</td>
<td class="list-narrow">
@attributes.attribute_data_type@
</td>
<td class="list-narrow">
@attributes.table_data_type@
</td>
<td class="list-narrow">
<input type=checkbox name=attribute_ids value="@attributes.im_dynfield_attribute_id@">
</td>
...
...
@@ -109,36 +116,6 @@
<p>
<h1>#intranet-dynfield.lt_Instances_of_object_t#</h1>
<table class="list">
<tr class="list-header">
<th class="list-narrow">#intranet-dynfield.Object_ID#</th>
<th class="list-narrow">#intranet-dynfield.Object_Name#</th>
</tr>
<multiple name=objects>
<if @objects.rownum@ odd>
<tr class="list-odd">
</if> <else>
<tr class="list-even">
</else>
<td class="list-narrow">
@objects.object_id@
</td>
<td class="list-narrow">
<a href=object-new?object_type=@object_type@&object_id=@objects.object_id@>
@objects.object_name@
</a>
</td>
</tr>
</multiple>
</table>
<if @generate_interfaces@ eq "1" and @attributes:rowcount@ gt "0">
<if @show_interfaces_p@ eq "1">
<br/>
...
...
www/object-type.tcl
View file @
15a3a6a2
...
...
@@ -60,91 +60,87 @@ set generate_interfaces 1
if
{[
catch
{
db_1row
"get interfaces info"
"select interface_type_key, join_column
from qt_im_dynfield_interfaces
where object_type = :object_type"
}
errmsg
]}
{
set generate_interfaces 0
ns_log notice
"******************* error
$errmsg
*************************"
set generate_interfaces 0
}
else
{
if
{
!$show_interfaces_p
}
{
set show_hidde_link
"<a href=
\"
?
[
export_vars -base
{}
-url -override
{{
show_interfaces_p 1
}}
{
object_type orderby show_interfaces_p
}]
\"
>
[
_ intranet-dynfield.Show_interfaces
]
</a>"
}
else
{
set show_hidde_link
"<a href=
\"
?
[
export_vars -base
{}
-url -override
{{
show_interfaces_p 0
}}
{
object_type orderby show_interfaces_p
}]
\"
>
[
_ intranet-dynfield.Hide_interfaces
]
</a>"
}
if
{
!$show_interfaces_p
}
{
set show_hidde_link
"<a href=
\"
?
[
export_vars -base
{}
-url -override
{{
show_interfaces_p 1
}}
{
object_type orderby show_interfaces_p
}]
\"
>
[
_ intranet-dynfield.Show_interfaces
]
</a>"
}
else
{
set show_hidde_link
"<a href=
\"
?
[
export_vars -base
{}
-url -override
{{
show_interfaces_p 0
}}
{
object_type orderby show_interfaces_p
}]
\"
>
[
_ intranet-dynfield.Hide_interfaces
]
</a>"
}
}
db_multirow attributes attributes_query
{}
{
if
{[
empty_string_p
$table
_name
]}
{
set table_name
$main
_table_name
set id_column
$main
_id_column
}
else
{
db_1row
"get id_column"
"select id_column
if
{[
empty_string_p
$table
_name
]}
{
set table_name
$main
_table_name
set id_column
$main
_id_column
}
else
{
db_1row
"get id_column"
"select id_column
from acs_object_type_tables
where object_type = :object_type
and table_name = :table_name"
}
}
if
{
$generate
_interfaces
}
{
set proc_name
"
$object
_type
\_
$attribute
_name"
if
{
$generate
_interfaces
}
{
set proc_name
"
$object
_type
\_
$attribute
_name"
append dbi_inserts
"insert into dbi_interfaces (interface_key,pretty_name,status,interface_type_key)
append dbi_inserts
"insert into dbi_interfaces (interface_key,pretty_name,status,interface_type_key)
values
('
$proc
_name','
$pretty
_name (
$object
_type)','enabled',''); <br/>"
set get_proc_name
"dbi::
$proc
_name
\:
:get_value"
append dbi_interfaces
"
$get
_proc_name <br/>"
set get_proc_name
"dbi::
$proc
_name
\:
:get_value"
append dbi_interfaces
"
$get
_proc_name <br/>"
# ------------------------------------------
# get pretty value for request attribute
# ------------------------------------------
# ------------------------------------------
# get pretty value for request attribute
# ------------------------------------------
switch
$widget
{
"category_tree"
{
set get_column_text
"category.name(t.
$attribute
_name) as
$attribute
_name"
set set_column_text
"
$attribute
_name = :value"
}
"generic_sql"
{
# -------------------------------------------
# return default value
# -------------------------------------------
set generic_sql_return
"t.
$attribute
_name as
$attribute
_name"
set generic_sql_set
"
$attribute
_name = :value"
# -------------------------------------------
# try to return pretty name of key
# -------------------------------------------
set custom_pos
[
lsearch
$parameters
"custom"
]
if
{
$custom
_pos > -1
}
{
set custom_value
[
lindex
$parameters
[
expr
$custom
_pos + 1
]]
set sql_query
[
lindex
$custom
_value 1
]
#ns_log notice
"sql_query
$sql
_query"
set result
[
regexp
-nocase
{
select
([
^ ,
\"
\"
]
+
)
,
([
^
\"
\"
]
+
)
from
([
^
\"
\"
]
+
)}
$sql
_query match key key_name table_key
]
if
{
$result
}
{
# -------------------------------------------
# create query to return pretty key name
# -------------------------------------------
set generic_sql_return
" (SELECT
$key
_name
FROM
$table
_key
WHERE
$key
= t.
$attribute
_name) as
$attribute
_name "
set generic_sql_set
"
$attribute
_name = (SELECT
$key
FROM
$table
_name WHERE
$key
_name = :value)"
}
}
set get_column_text
$generic
_sql_return
set set_column_text
$generic
_sql_set
}
default
{
set get_column_text
"t.
$attribute
_name as
$attribute
_name"
set set_column_text
"
$attribute
_name = :value"
}
}
switch
$widget
{
"category_tree"
{
set get_column_text
"category.name(t.
$attribute
_name) as
$attribute
_name"
set set_column_text
"
$attribute
_name = :value"
}
"generic_sql"
{
# -------------------------------------------
# return default value
# -------------------------------------------
set generic_sql_return
"t.
$attribute
_name as
$attribute
_name"
set generic_sql_set
"
$attribute
_name = :value"
# -------------------------------------------
# try to return pretty name of key
# -------------------------------------------
set custom_pos
[
lsearch
$parameters
"custom"
]
if
{
$custom
_pos > -1
}
{
set custom_value
[
lindex
$parameters
[
expr
$custom
_pos + 1
]]
set sql_query
[
lindex
$custom
_value 1
]
#ns_log notice
"sql_query
$sql
_query"
set result
[
regexp
-nocase
{
select
([
^ ,
\"
\"
]
+
)
,
([
^
\"
\"
]
+
)
from
([
^
\"
\"
]
+
)}
$sql
_query match key key_name table_key
]
if
{
$result
}
{
# -------------------------------------------
# create query to return pretty key name
# -------------------------------------------
set generic_sql_return
" (SELECT
$key
_name
FROM
$table
_key
WHERE
$key
= t.
$attribute
_name) as
$attribute
_name "
set generic_sql_set
"
$attribute
_name = (SELECT
$key
FROM
$table
_name WHERE
$key
_name = :value)"
}
}
set get_column_text
$generic
_sql_return
set set_column_text
$generic
_sql_set
}
default
{
set get_column_text
"t.
$attribute
_name as
$attribute
_name"
set set_column_text
"
$attribute
_name = :value"
}
}
set get_proc_bloc
"
set get_proc_bloc
"
#############################################################################
ad_proc -public
$get
_proc_name {
...
...
@@ -240,10 +236,4 @@ set extension_tables_query "
db_multirow extension_tables extension_tables_query
$extension
_tables_query
# ******************************************************
# Create the list of all objects of the current type
# ******************************************************
db_multirow objects objects_query
{}
ad_return_template
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