Commit 2604a7f4 authored by Richard Mansfield's avatar Richard Mansfield
Browse files

Change enddate to stopdate because db field name has changed

parent 73fcb0c4
......@@ -200,7 +200,7 @@ $string['activity'] = 'Recent activity';
// my views
$string['accessstartdate'] = 'Access start date';
$string['accessenddate'] = 'Access end date';
$string['accessstopdate'] = 'Access end date';
$string['artefacts'] = 'Artefacts';
$string['createnewview'] = 'Create New View';
$string['deleteviewfailed'] = 'Delete view failed';
......
......@@ -29,7 +29,7 @@ require(dirname(dirname(__FILE__)) . '/init.php');
$wwwroot = get_config('wwwroot');
$strings = array('accessstartdate', 'accessenddate', 'artefacts', 'delete', 'description',
$strings = array('accessstartdate', 'accessstopdate', 'artefacts', 'delete', 'description',
'editaccess', 'editview', 'editviewinformation', 'submitted',
'submitview', 'submitviewquestion', 'unknownerror');
$getstring = array();
......@@ -41,8 +41,6 @@ foreach ($strings as $string) {
five <tr> elements for each item of data coming from the database.
Maybe I need a repeated-paginated-thing renderer? */
//var assess = SELECT({'name':'community'});
$javascript = <<<JAVASCRIPT
var viewlist = new TableRenderer(
'viewlist',
......@@ -51,7 +49,7 @@ var viewlist = new TableRenderer(
);
viewlist.rowfunction = function(r, n, data) {
return map(partial(TR,null),[title(r,data.communities), startdate(r), enddate(r),
return map(partial(TR,null),[title(r,data.communities), startdate(r), stopdate(r),
description(r), artefacts(r)]);
}
......@@ -97,9 +95,9 @@ function startdate(r) {
TD(r.startdate)];
}
function enddate(r) {
return [TD(null,{$getstring['accessenddate']}),
TD(r.enddate)];
function stopdate(r) {
return [TD(null,{$getstring['accessstopdate']}),
TD(r.stopdate)];
}
function description(r) {
......
......@@ -40,13 +40,13 @@ $count = count_records('view', 'owner', $userid);
/* Do this in one query sometime */
$prefix = get_config('dbprefix');
$viewdata = get_records_sql_array('SELECT v.id,v.title,v.startdate,v.enddate,v.description,c.name
$viewdata = get_records_sql_array('SELECT v.id,v.title,v.startdate,v.stopdate,v.description,c.name
FROM ' . $prefix . 'view v
LEFT OUTER JOIN ' . $prefix . 'community c ON v.submittedto = c.id
WHERE v.owner = ' . $userid, '');
WHERE v.owner = ' . $userid,'');
//'view', 'owner', $userid, '',
// 'id,title,startdate,enddate,description,submittedto', $offset, $limit);
// . '
// ORDER BY v.title', '');
$viewidlist = implode(', ', array_map(create_function('$a', 'return $a->id;'), $viewdata));
......@@ -66,7 +66,7 @@ if ($viewdata) {
$data[$i]['id'] = $viewdata[$i]->id;
$data[$i]['title'] = $viewdata[$i]->title;
$data[$i]['startdate'] = strftime(get_string('strftimedate'),strtotime($viewdata[$i]->startdate));
$data[$i]['enddate'] = strftime(get_string('strftimedate'),strtotime($viewdata[$i]->enddate));
$data[$i]['stopdate'] = strftime(get_string('strftimedate'),strtotime($viewdata[$i]->stopdate));
$data[$i]['description'] = $viewdata[$i]->description;
$data[$i]['submittedto'] = $viewdata[$i]->name;
$data[$i]['artefacts'] = array();
......
Supports Markdown
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