feature #1664: Fix for vectorial templates

This commit is contained in:
Tino Vazquez committed 2013-03-13 17:22:47 +01:00
1 parent 1cb428fdc8
commit 4e39e36838
2 files changed
+102 -72

No files matched your search

+36 -39
View File
@@ -824,45 +824,42 @@ function updateTemplateInfo(request,template){
var info_tab = {
title: tr("Information"),
content:
'<table id="info_template_table" class="info_table" style="width:80%">\
<thead>\
<tr><th colspan="2">'+tr("Template")+' \"'+template_info.NAME+'\" '+
tr("information")+'</th></tr>\
</thead>\
<tr>\
<td class="key_td">'+tr("ID")+'</td>\
<td class="value_td">'+template_info.ID+'</td>\
</tr>\
<tr>\
<td class="key_td">'+tr("Name")+'</td>\
<td class="value_td">'+template_info.NAME+'</td>\
</tr>\
<tr>\
<td class="key_td">'+tr("Owner")+'</td>\
<td class="value_td">'+template_info.UNAME+'</td>\
</tr>\
<tr>\
<td class="key_td">'+tr("Group")+'</td>\
<td class="value_td">'+template_info.GNAME+'</td>\
</tr>\
<tr>\
<td class="key_td">'+tr("Register time")+'</td>\
<td class="value_td">'+pretty_time(template_info.REGTIME)+'</td>\
</tr>\
<tr><td class="key_td">'+tr("Permissions")+'</td><td></td></tr>\
<tr>\
<td class="key_td">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'+tr("Owner")+'</td>\
<td class="value_td" style="font-family:monospace;">'+ownerPermStr(template_info)+'</td>\
</tr>\
<tr>\
<td class="key_td">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'+tr("Group")+'</td>\
<td class="value_td" style="font-family:monospace;">'+groupPermStr(template_info)+'</td>\
</tr>\
<tr>\
<td class="key_td"> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'+tr("Other")+'</td>\
<td class="value_td" style="font-family:monospace;">'+otherPermStr(template_info)+'</td>\
</tr>\
</table>'
'<div class="six columns">\
<table id="info_template_table" class="info_table" style="width:80%">\
<thead>\
<tr><th colspan="2">'+tr("Template")+' \"'+template_info.NAME+'\" '+
tr("information")+'</th></tr>\
</thead>\
<tr>\
<td class="key_td">'+tr("ID")+'</td>\
<td class="value_td">'+template_info.ID+'</td>\
</tr>\
<tr>\
<td class="key_td">'+tr("Name")+'</td>\
<td class="value_td">'+template_info.NAME+'</td>\
</tr>\
<tr>\
<td class="key_td">'+tr("Owner")+'</td>\
<td class="value_td">'+template_info.UNAME+'</td>\
</tr>\
<tr>\
<td class="key_td">'+tr("Group")+'</td>\
<td class="value_td">'+template_info.GNAME+'</td>\
</tr>\
<tr>\
<td class="key_td">'+tr("Register time")+'</td>\
<td class="value_td">'+pretty_time(template_info.REGTIME)+'</td>\
</tr>\
</table>\
</div>\
<div class="six columns">' + insert_permissions_table("Template",
template_info.ID,
template_info.UNAME,
template_info.GNAME,
template_info.UID,
template_info.GID) +
'</div>\
</div>'
};
var template_tab = {
title: tr("Template"),
+66 -33
View File
@@ -1500,9 +1500,12 @@ function insert_extended_template_table(template_json,resource_type,resource_id,
var ocurrence=null;
if (list_of_classes.length!=1)
for (var current_class in list_of_classes)
if (list_of_classes[current_class].match(/^ocurrence_/))
ocurrence=list_of_classes[current_class].substring(10,list_of_classes[current_class].length);
{
$.each(list_of_classes, function(index, value) {
if (value.match(/^ocurrence_/))
ocurrence=value.substring(10,value.length);;
});
}
// Erase the value from the template
if(ocurrence!=null)
@@ -1550,14 +1553,20 @@ function insert_extended_template_table(template_json,resource_type,resource_id,
var vectorial_key = null;
if (list_of_classes.length!=1)
for (var current_class in list_of_classes)
if (list_of_classes[current_class].match(/^ocurrence_/))
ocurrence+=list_of_classes[current_class]+" ";
{
$.each(list_of_classes, function(index, value) {
if (value.match(/^ocurrence_/))
ocurrence+=value+" ";
});
}
if (list_of_classes.length!=1)
for (var current_class in list_of_classes)
if (list_of_classes[current_class].match(/^vectorial_key_/))
vectorial_key=list_of_classes[current_class];
{
$.each(list_of_classes, function(index, value) {
if (value.match(/^vectorial_key_/))
vectorial_key=value;
});
}
if (ocurrence!=" ")
@@ -1584,14 +1593,20 @@ function insert_extended_template_table(template_json,resource_type,resource_id,
var vectorial_key = null;
if (list_of_classes.length!=1)
for (var current_class in list_of_classes)
if (list_of_classes[current_class].match(/^ocurrence_/))
ocurrence=list_of_classes[current_class].substring(10,list_of_classes[current_class].length);
{
$.each(list_of_classes, function(index, value) {
if (value.match(/^ocurrence_/))
ocurrence=value.substring(10,value.length);
});
}
if (list_of_classes.length!=1)
for (var current_class in list_of_classes)
if (list_of_classes[current_class].match(/^vectorial_key_/))
vectorial_key=list_of_classes[current_class].substring(14,list_of_classes[current_class].length);
{
$.each(list_of_classes, function(index, value) {
if (value.match(/^vectorial_key_/))
vectorial_key=value.substring(14,value.length);
});
}
if (ocurrence!=null)
template_json[vectorial_key][ocurrence][key_str]=value_str;
@@ -1615,14 +1630,20 @@ function insert_extended_template_table(template_json,resource_type,resource_id,
var vectorial_key = null;
if (list_of_classes.length!=1)
for (var current_class in list_of_classes)
if (list_of_classes[current_class].match(/^ocurrence_/))
ocurrence=list_of_classes[current_class].substring(10,list_of_classes[current_class].length);
{
$.each(list_of_classes, function(index, value) {
if (value.match(/^ocurrence_/))
ocurrence=value.substring(10,value.length);
});
}
if (list_of_classes.length!=1)
for (var current_class in list_of_classes)
if (list_of_classes[current_class].match(/^vectorial_key_/))
vectorial_key=list_of_classes[current_class].substring(14,list_of_classes[current_class].length);
{
$.each(list_of_classes, function(index, value) {
if (value.match(/^vectorial_key_/))
vectorial_key=value.substring(14,value.length);
});
}
// Erase the value from the template
if(ocurrence!=null)
@@ -1646,14 +1667,20 @@ function insert_extended_template_table(template_json,resource_type,resource_id,
var vectorial_key = null;
if (list_of_classes.length!=1)
for (var current_class in list_of_classes)
if (list_of_classes[current_class].match(/^ocurrence_/))
ocurrence=list_of_classes[current_class];
{
$.each(list_of_classes, function(index, value) {
if (value.match(/^ocurrence_/))
ocurrence=value;
});
}
if (list_of_classes.length!=1)
for (var current_class in list_of_classes)
if (list_of_classes[current_class].match(/^vectorial_key_/))
vectorial_key=list_of_classes[current_class];
{
$.each(list_of_classes, function(index, value) {
if (value.match(/^vectorial_key_/))
vectorial_key=value;
});
}
$(this).parent().parent().after('<tr>\
@@ -1674,14 +1701,20 @@ function insert_extended_template_table(template_json,resource_type,resource_id,
var template_json_bk = $.extend({}, template_json);
if (list_of_classes.length!=1)
for (var current_class in list_of_classes)
if (list_of_classes[current_class].match(/^vectorial_key_/))
vectorial_key=list_of_classes[current_class];
{
$.each(list_of_classes, function(index, value) {
if (value.match(/^vectorial_key_/))
vectorial_key=value;
});
}
if (list_of_classes.length!=1)
for (var current_class in list_of_classes)
if (list_of_classes[current_class].match(/^ocurrence_/))
ocurrence=list_of_classes[current_class];
{
$.each(list_of_classes, function(index, value) {
if (value.match(/^ocurrence_/))
ocurrence=value;
});
}
vectorial_key=vectorial_key.substring(14,vectorial_key.length);