* Fix bug.

This commit is contained in:
leiyong
2020-07-14 20:14:24 -07:00
parent 37f057475d
commit 936de54183
2 changed files with 9 additions and 4 deletions
+4 -1
View File
@@ -66,6 +66,7 @@ class webhookModel extends model
$this->loadModel('action');
$actions = $this->dao->select('*')->from(TABLE_ACTION)->where('id')->in($actions)->fetchAll('id');
$users = $this->loadModel('user')->getPairs('noletter');
foreach($logs as $log)
{
@@ -80,7 +81,7 @@ class webhookModel extends model
$object = $this->dao->select('*')->from($this->config->objectTables[$action->objectType])->where('id')->eq($action->objectID)->fetch();
$field = zget($this->config->action->objectNameFields, $action->objectType, $action->objectType);
if(!is_object($object))
if(!is_object($object))
{
$object = new stdclass;
$object->$field = '';
@@ -102,6 +103,8 @@ class webhookModel extends model
$log->action = $text;
$log->actionURL = $this->getViewLink($action->objectType, $action->objectID);
$log->module = $action->objectType;
$log->dialog = $action->objectType == 'todo' ? 1 : 0;
}
return $logs;
}
+5 -3
View File
@@ -43,9 +43,11 @@
<tr>
<td class='text-center'><?php echo $id;?></td>
<td><?php echo $log->date;?></td>
<td class='text' title='<?php echo $log->url;?>'><?php echo $log->url;?></td>
<td class='text' title='<?php echo $log->action;?>'><?php echo html::a($log->actionURL, $log->action);?></td>
<td class='text-center'><?php echo $log->contentType;?></td>
<td title='<?php echo $log->url;?>'><?php echo $log->url;?></td>
<?php $iframe = $log->dialog == 1 ? 'data-toggle="modal" data-type="iframe"' : '';?>
<?php if($log->dialog == 1) $log->actionURL = $this->createLink($log->module, 'view', "id=$log->objectID", '' , true)?>
<td title='<?php echo $log->action;?>'><?php echo html::a($log->actionURL, $log->action, '', $iframe);?></td>
<td title='<?php echo $log->contentType;?>'><?php echo $log->contentType;?></td>
<td title='<?php echo $log->result;?>'><?php echo $log->result;?></td>
</tr>
<?php endforeach;?>