5 if ( !@$_GET[
'history__id'] ){
8 $historyid = $_GET[
'history__id'];
9 $query =&
$app->getQuery();
11 $r =
$app->getRecord();
13 import(
'Dataface/HistoryTool.php');
15 if ( @$_GET[
'-fromcurrent'] ){
16 $record = $ht->getDiffs(
$table, $historyid);
17 $record->escapeOutput =
false;
19 }
else if ( @$_GET[
'-show_changes'] ){
20 $thisVersion = $ht->getRecordById(
$table, $historyid);
23 }
else if ( !$thisVersion ){
26 $mdate = $thisVersion->strval(
"history__modified");
28 $prevDate = date(
'Y-m-d H:i:s', strtotime(
'-1 second', strtotime($mdate)));
30 $prevVersionId = $ht->getPreviousVersion($r, $prevDate, $thisVersion->val(
'history__language'), null,
true);
32 if ( !$prevVersionId ){
35 $record = $ht->getDiffs(
$table, $prevVersionId, $historyid);
38 $record->escapeOutput =
false;
40 $record = $ht->getRecordById(
$table, $historyid);
45 $record->secureDisplay =
false;
46 $context = array(
'history_record'=>&$record);
47 $context[
'source_record'] =
$app->getRecord();
51 $numfields = count($t->fields());
58 if ( $r->checkPermission(
'view', array(
'field'=>$k)) ){
67 if ( $t->isText($field[
'name']) ){
69 $ppf[$field[
'name']] = $pts;
72 $ppf[$field[
'name']] = $pts;
77 $threshold = floatval(floatval($pts)/floatval(2));
79 if ( $ppf[$field[
'name']] >= $threshold ){
80 $firstField = $field[
'name'];
85 $context[
'first_field_second_col'] = $firstField;
86 $context[
'changes'] = @$_GET[
'-show_changes'];
87 $context[
'table'] =& $t;
88 df_display($context,
'Dataface_HistoryRecordDetails.html');