Commit 604d6962 authored by Penny Leach's avatar Penny Leach Committed by Nigel McNie
Browse files

- Fixed some bugs in the core_data install handler

- Fixed a bug in the view_layout install.xml definition
- Added view layouts to core_data
parent 5e494786
......@@ -52,7 +52,7 @@ if ($install) {
$fun();
}
catch (SQLException $e) {
json_reply('local', array('key' => $name, 'errormessage' => $e->getMessage()));
json_reply('local', array('error' => true, 'key' => $name, 'errormessage' => $e->getMessage()));
}
}
$data['coredata'] = true;
......
......@@ -88,6 +88,7 @@ $js = <<< EOJS
message += data.newversion;
}
$(data.key).innerHTML = '<img src="{$successicon}" alt=":)" /> ' + message;
processNext();
}
else {
var message = '';
......@@ -99,7 +100,6 @@ $js = <<< EOJS
}
$(data.key).innerHTML = '<img src="{$failureicon}" alt=":(" /> ' + message;
}
processNext();
},
function () {
$(element).innerHTML = '<img src="{$failureicon}" alt=":(" /> ' + {$failurestring};
......
......@@ -364,6 +364,17 @@
<KEY NAME="foreign" TYPE="foreign" FIELDS="usr" REFTABLE="usr" REFFIELDS="id" />
</KEYS>
</TABLE>
<TABLE NAME="view_layout">
<FIELDS>
<FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" SEQUENCE="true"/>
<FIELD NAME="columns" TYPE="int" LENGTH="1" NOTNULL="true"/>
<FIELD NAME="widths" TYPE="char" LENGTH="255" NOTNULL="true"/>
</FIELDS>
<KEYS>
<KEY NAME="primary" TYPE="primary" FIELDS="id"/>
<KEY NAME="columnwidthuk" TYPE="unique" FIELDS="columns,widths"/>
</KEYS>
</TABLE>
<TABLE NAME="view">
<FIELDS>
<FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" SEQUENCE="true" />
......@@ -414,17 +425,6 @@
<KEY NAME="viewcolumnorderuk" TYPE="unique" FIELDS="view,column,order" />
</KEYS>
</TABLE>
<TABLE NAME="view_layout">
<FIELDS>
<FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" SEQUENCE="true"/>
<FIELD NAME="columns" TYPE="int" LENGTH="1" NOTNULL="true"/>
<FIELD NAME="widths" TYPE="char" LENGTH="255" NOTNULL="true"/>
</FIELDS>
<KEYS>
<KEY NAME="primary" TYPE="primary" FIELDS="id"/>
<KEY NAME="columnwidthuk" UNIQUE="true" FIELDS="columns,widths"/>
</KEYS>
</TABLE>
<TABLE NAME="view_artefact">
<FIELDS>
<FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" SEQUENCE="true" />
......
......@@ -657,8 +657,32 @@ function core_install_firstcoredata_defaults() {
insert_record('cron', $cron);
}
// install the blocktype categories
// install the view column widths
$layouts = array(
2 => array(
'50,50',
'67,33',
'33,67',
),
3 => array(
'33,33,33',
'25,50,25',
'15,70,15',
),
4 => array(
'25,25,25,25',
'20,30,30,20',
),
);
$layout = new StdClass;
foreach ($layouts as $column => $widths) {
foreach ($widths as $width) {
$layout->columns = $column;
$layout->widths = $width;
insert_record('view_layout', $layout);
}
}
db_commit();
}
......
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