This commit is contained in:
guanxiying
2021-07-05 14:47:15 +08:00
parent 98f7e592ad
commit bc3bd8316c
3 changed files with 10 additions and 1 deletions
+1
View File
@@ -37,6 +37,7 @@ function loadList(type, id)
if(data.length != 0)
{
$(divClass).html(data).find('select').chosen();
if(config.currentMethod == 'edit') $(divClass).html(data).find('select').val(idvalue).trigger('chosen:updated');
}
else
{
+8 -1
View File
@@ -206,7 +206,6 @@ class todoModel extends model
public function update($todoID)
{
$oldTodo = $this->dao->findById((int)$todoID)->from(TABLE_TODO)->fetch();
if(in_array($oldTodo->type, $this->config->todo->moduleList)) $oldTodo->name = '';
$objectType = $this->post->type;
$hasObject = in_array($objectType, $this->config->todo->moduleList);
@@ -224,6 +223,14 @@ class todoModel extends model
->remove(implode(',', $this->config->todo->moduleList) . ',uid')
->get();
if($todo->type != 'custom')
{
$type = $todo->type;
$object = $this->loadModel($type)->getByID($objectType);
if(isset($object->name)) $todo->name = $object->name;
if(isset($object->title)) $todo->name = $object->title;
}
if($todo->end < $todo->begin)
{
dao::$errors[] = sprintf($this->lang->error->gt, $this->lang->todo->end, $this->lang->todo->begin);
+1
View File
@@ -15,6 +15,7 @@
<?php include '../../common/view/kindeditor.html.php';?>
<?php js::set('moduleList', $config->todo->moduleList)?>
<?php js::set('objectsMethod', $config->todo->getUserObjectsMethod)?>
<?php js::set('idvalue', $todo->idvalue);?>
<?php if(common::checkNotCN()):?>
<style> label.col-sm-1{width:100px;} </style>
<?php endif;?>