Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
genotoul-bioinfo
ng6
Commits
b779323c
Commit
b779323c
authored
Aug 20, 2012
by
Jerome Mariette
Browse files
editable field: provide table instead of entity
parent
a4cbd5c8
Changes
6
Hide whitespace changes
Inline
Side-by-side
ui/nG6/class.tx_nG6_eid.php
View file @
b779323c
...
...
@@ -247,7 +247,7 @@ class tx_nG6_eid {
}
else
if
(
$type
==
'update_db_field'
)
{
//Retrieve infomation
$
entity
=
trim
(
t3lib_div
::
_GP
(
'
entity
'
));
$
table
=
trim
(
t3lib_div
::
_GP
(
'
table
'
));
$id
=
trim
(
t3lib_div
::
_GP
(
'id'
));
$field
=
trim
(
t3lib_div
::
_GP
(
'field'
));
$value
=
trim
(
t3lib_div
::
_GP
(
'value'
));
...
...
@@ -260,14 +260,13 @@ class tx_nG6_eid {
$timestamp
=
mktime
(
0
,
0
,
1
,
$date
[
1
],
$date
[
0
],
$date
[
2
])
;
//Update the entity
tx_nG6_db
::
update_field
(
$
entity
,
$id
,
$field
,
$timestamp
);
tx_nG6_db
::
update_field
(
$
table
,
$id
,
$field
,
$timestamp
);
}
else
{
//Update the entity
tx_nG6_db
::
update_field
(
$
entity
,
$id
,
$field
,
$value
);
tx_nG6_db
::
update_field
(
$
table
,
$id
,
$field
,
$value
);
}
print
$value
;
// If asked the krona page
...
...
ui/nG6/lib/class.tx_nG6_db.php
View file @
b779323c
...
...
@@ -39,16 +39,16 @@ class tx_nG6_db {
/**
* Update the specified field of the table
*
* @param string $
entity
the entity to change
* @param string $
table
the entity to change
* @param string $id the element id to update
* @param string $field the field to change
* @param string $value the new value
*/
function
update_field
(
$
entity
,
$id
,
$field
,
$value
)
{
function
update_field
(
$
table
,
$id
,
$field
,
$value
)
{
if
(
$field
==
'uid'
)
{
throw
new
Exception
(
"The function 'update_field' cannot change an id."
)
;
}
$GLOBALS
[
'TYPO3_DB'
]
->
exec_UPDATEquery
(
"tx_nG6_
$entity
"
,
'uid='
.
$id
,
array
(
$field
=>
$value
));
$GLOBALS
[
'TYPO3_DB'
]
->
exec_UPDATEquery
(
$table
,
'uid='
.
$id
,
array
(
$field
=>
$value
));
}
...
...
ui/nG6/pi1/project_view.tpl
View file @
b779323c
...
...
@@ -208,9 +208,9 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
{
if
$project_values.hidden
==
0
}
{
assign
var
=
"hidden_attribute"
value
=
""
}
{/
if
}
<td
class=
"
{
$editable
}
field=project=name
{
$hidden_attribute
}
"
>
{
$project_values.href
}
</td>
<td
class=
"
{
$editable
}
field=project=crdate
{
$hidden_attribute
}
"
>
{
$project_values.date
|
date_format
:
"%d-%m-%y"
}
</td>
<td
class=
"
{
$editable
}
field=project=description
{
$hidden_attribute
}
"
>
{
$project_values.description
}
</td>
<td
class=
"
{
$editable
}
field=
tx_nG6_
project=name
{
$hidden_attribute
}
"
>
{
$project_values.href
}
</td>
<td
class=
"
{
$editable
}
field=
tx_nG6_
project=crdate
{
$hidden_attribute
}
"
>
{
$project_values.date
|
date_format
:
"%d-%m-%y"
}
</td>
<td
class=
"
{
$editable
}
field=
tx_nG6_
project=description
{
$hidden_attribute
}
"
>
{
$project_values.description
}
</td>
</tr>
{/
foreach
}
</tbody>
...
...
ui/nG6/pi1/recursive_list_analysis_display.tpl
View file @
b779323c
...
...
@@ -29,7 +29,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
<td><center><input
type=
"checkbox"
id=
"chk_analysis_
{
$new_element.data.id
}
"
value=
"analysis_
{
$new_element.data.id
}
"
></center></td>
{
assign
var
=
"editable"
value
=
"editable"
}
{/
if
}
<td
class=
"
{
$editable
}
field=analyze=name
{
$hidden_attribute
}
"
nowrap
>
<td
class=
"
{
$editable
}
field=
tx_nG6_
analyze=name
{
$hidden_attribute
}
"
nowrap
>
{
assign
var
=
"analyze_tree"
value
=
""
}
{
section
name
=
customer
loop
=
$prof
*
3
}
{
assign
var
=
"analyze_tree"
value
=
"$analyze_tree "
}
...
...
@@ -39,7 +39,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
{/
if
}
{
$analyze_tree
}{
$new_element.data.href
}
</td>
<td
class=
"
{
$editable
}
field=analyze=description
{
$hidden_attribute
}
"
>
{
$new_element.data.description
}
</td>
<td
class=
"
{
$editable
}
field=
tx_nG6_
analyze=description
{
$hidden_attribute
}
"
>
{
$new_element.data.description
}
</td>
<td
{
$hidden_class
}
>
{
$new_element.data.software
}
</td>
<td
{
$hidden_class
}
>
{
$new_element.data.version
}
</td>
</tr>
...
...
ui/nG6/pi1/run_table.tpl
View file @
b779323c
...
...
@@ -32,16 +32,16 @@
{
assign
var
=
"hidden_class"
value
=
""
}
{
assign
var
=
"hidden_attribute"
value
=
""
}
{/
if
}
<td
class=
"
{
$editable
}
field=run=name
{
$hidden_attribute
}
"
>
{
$run_values.href
}
</td>
<td
class=
"
{
$editable
}
field=
tx_nG6_
run=name
{
$hidden_attribute
}
"
>
{
$run_values.href
}
</td>
<td
{
$hidden_class
}
>
{
$run_values.project_name
}
</td>
<td
class=
"
{
$editable
}
field=run=date
{
$hidden_attribute
}
"
>
{
$run_values.date
|
date_format
:
"%d-%m-%y"
}
</td>
<td
class=
"
{
$editable
}
field=run=species
{
$hidden_attribute
}
"
>
{
$run_values.species
}
</td>
<td
class=
"
{
$editable
}
field=run=data_nature
{
$hidden_attribute
}
"
>
{
$run_values.data_nature
}
</td>
<td
class=
"
{
$editable
}
field=run=type
{
$hidden_attribute
}
"
>
{
$run_values.type
}
</td>
<td
class=
"
{
$editable
}
field=
tx_nG6_
run=date
{
$hidden_attribute
}
"
>
{
$run_values.date
|
date_format
:
"%d-%m-%y"
}
</td>
<td
class=
"
{
$editable
}
field=
tx_nG6_
run=species
{
$hidden_attribute
}
"
>
{
$run_values.species
}
</td>
<td
class=
"
{
$editable
}
field=
tx_nG6_
run=data_nature
{
$hidden_attribute
}
"
>
{
$run_values.data_nature
}
</td>
<td
class=
"
{
$editable
}
field=
tx_nG6_
run=type
{
$hidden_attribute
}
"
>
{
$run_values.type
}
</td>
<td
{
$hidden_class
}
>
{
$run_values.nb_sequences
|
number_format
:
0
:
' '
:
' '
}
</td>
<td
{
$hidden_class
}
>
{
$run_values.full_seq_size
|
number_format
:
0
:
' '
:
' '
}
</td>
<td
class=
"
{
$editable
}
field=run=description
{
$hidden_attribute
}
"
>
{
$run_values.description
}
</td>
<td
class=
"
{
$editable
}
field=run=sequencer
{
$hidden_attribute
}
"
>
{
$run_values.sequencer
}
</td>
<td
class=
"
{
$editable
}
field=
tx_nG6_
run=description
{
$hidden_attribute
}
"
>
{
$run_values.description
}
</td>
<td
class=
"
{
$editable
}
field=
tx_nG6_
run=sequencer
{
$hidden_attribute
}
"
>
{
$run_values.sequencer
}
</td>
</tr>
{/
foreach
}
</tbody>
...
...
ui/nG6/res/js/tx_nG6_pi1.js
View file @
b779323c
...
...
@@ -75,7 +75,7 @@ $(function () {
/* Retrieve field and entity */
var
regexp_field
=
new
RegExp
(
"
field=([^=]+)=([^ ]+)
"
);
var
match
=
regexp_field
.
exec
(
this
.
className
)
;
var
entity
=
match
[
1
];
var
table
=
match
[
1
];
var
field
=
match
[
2
];
/* For dates */
...
...
@@ -125,7 +125,7 @@ $(function () {
"
submitdata
"
:
function
(
value
,
settings
)
{
return
{
"
id
"
:
this
.
parentNode
.
getAttribute
(
'
id
'
).
split
(
'
_
'
)[
2
],
"
entity
"
:
entity
,
"
table
"
:
table
,
"
field
"
:
field
,
"
type
"
:
"
update_db_field
"
};
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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