diff --git a/module/todo/config.php b/module/todo/config.php index 1ef513ff19..40e7c418b6 100644 --- a/module/todo/config.php +++ b/module/todo/config.php @@ -21,7 +21,7 @@ $config->todo->editor->edit = array('id' => 'desc', 'tools' => 'simpleTools'); $config->todo->editor->view = array('id' => 'comment,lastComment', 'tools' => 'simpleTools'); $config->todo->list = new stdclass(); -$config->todo->list->exportFields = 'id, account, date, begin, end, type, idvalue, pri, name, desc, status, private'; +$config->todo->list->exportFields = 'id, account, date, begin, end, type, objectID, pri, name, desc, status, private'; $config->todo->list->customBatchCreateFields = 'type,pri,desc,beginAndEnd'; $config->todo->list->customBatchEditFields = 'pri,beginAndEnd,status'; diff --git a/module/todo/control.php b/module/todo/control.php index 13c88ad46d..6b51ee5017 100755 --- a/module/todo/control.php +++ b/module/todo/control.php @@ -217,7 +217,7 @@ class todo extends control if($todo->type != 'custom') { if(!isset($objectIDList[$todo->type])) $objectIDList[$todo->type] = array(); - $objectIDList[$todo->type][$todo->idvalue] = $todo->idvalue; + $objectIDList[$todo->type][$todo->objectID] = $todo->objectID; } } } @@ -489,13 +489,13 @@ class todo extends control { $confirmNote = 'confirm' . ucfirst($todo->type); $okTarget = isonlybody() ? 'parent' : 'window.parent.$.apps.open'; - $confirmURL = $this->createLink($todo->type, 'view', "id=$todo->idvalue"); + $confirmURL = $this->createLink($todo->type, 'view', "id=$todo->objectID"); if($todo->type == 'bug') $app = 'qa'; if($todo->type == 'task') $app = 'execution'; if($todo->type == 'story') $app = 'product'; $cancelURL = $this->server->HTTP_REFERER; - if(defined('RUN_MODE') && RUN_MODE == 'api') return $this->send(array('status' => 'success', 'message' => sprintf($this->lang->todo->$confirmNote, $todo->idvalue), 'locate' => $confirmURL)); - return print(strpos($cancelURL, 'calendar') ? json_encode(array(sprintf($this->lang->todo->$confirmNote, $todo->idvalue), $confirmURL)) : js::confirm(sprintf($this->lang->todo->$confirmNote, $todo->idvalue), $confirmURL, $cancelURL, $okTarget, 'parent', $app)); + if(defined('RUN_MODE') && RUN_MODE == 'api') return $this->send(array('status' => 'success', 'message' => sprintf($this->lang->todo->$confirmNote, $todo->objectID), 'locate' => $confirmURL)); + return print(strpos($cancelURL, 'calendar') ? json_encode(array(sprintf($this->lang->todo->$confirmNote, $todo->objectID), $confirmURL)) : js::confirm(sprintf($this->lang->todo->$confirmNote, $todo->objectID), $confirmURL, $cancelURL, $okTarget, 'parent', $app)); } if(defined('RUN_MODE') && RUN_MODE == 'api') return $this->send(array('status' => 'success')); if(isonlybody()) return print(js::reload('parent.parent')); @@ -581,7 +581,7 @@ class todo extends control $fields[$fieldName] = isset($todoLang->$fieldName) ? $todoLang->$fieldName : $fieldName; unset($fields[$key]); } - unset($fields['idvalue']); + unset($fields['objectID']); unset($fields['private']); /* Get bugs. */ @@ -612,18 +612,18 @@ class todo extends control $type = $todo->type; if(isset($users[$todo->account])) $todo->account = $users[$todo->account]; - if($type == 'bug') $todo->name = isset($bugs[$todo->idvalue]) ? $bugs[$todo->idvalue] . "(#$todo->idvalue)" : ''; - if($type == 'story') $todo->name = isset($stories[$todo->idvalue]) ? $stories[$todo->idvalue] . "(#$todo->idvalue)" : ''; - if($type == 'task') $todo->name = isset($tasks[$todo->idvalue]) ? $tasks[$todo->idvalue] . "(#$todo->idvalue)" : ''; + if($type == 'bug') $todo->name = isset($bugs[$todo->objectID]) ? $bugs[$todo->objectID] . "(#$todo->objectID)" : ''; + if($type == 'story') $todo->name = isset($stories[$todo->objectID]) ? $stories[$todo->objectID] . "(#$todo->objectID)" : ''; + if($type == 'task') $todo->name = isset($tasks[$todo->objectID]) ? $tasks[$todo->objectID] . "(#$todo->objectID)" : ''; if($this->config->edition == 'max') { - if($type == 'issue') $todo->name = isset($issues[$todo->idvalue]) ? $issues[$todo->idvalue] . "(#$todo->idvalue)" : ''; - if($type == 'risk') $todo->name = isset($risks[$todo->idvalue]) ? $risks[$todo->idvalue] . "(#$todo->idvalue)" : ''; - if($type == 'opportunity') $todo->name = isset($opportunities[$todo->idvalue]) ? $opportunities[$todo->idvalue] . "(#$todo->idvalue)" : ''; + if($type == 'issue') $todo->name = isset($issues[$todo->objectID]) ? $issues[$todo->objectID] . "(#$todo->objectID)" : ''; + if($type == 'risk') $todo->name = isset($risks[$todo->objectID]) ? $risks[$todo->objectID] . "(#$todo->objectID)" : ''; + if($type == 'opportunity') $todo->name = isset($opportunities[$todo->objectID]) ? $opportunities[$todo->objectID] . "(#$todo->objectID)" : ''; } - if($type == 'testtask') $todo->name = isset($testTasks[$todo->idvalue]) ? $testTasks[$todo->idvalue] . "(#$todo->idvalue)" : ''; - if($type == 'review' && isset($this->config->qcVersion)) $todo->name = isset($reviews[$todo->idvalue]) ? $reviews[$todo->idvalue] . "(#$todo->idvalue)" : ''; + if($type == 'testtask') $todo->name = isset($testTasks[$todo->objectID]) ? $testTasks[$todo->objectID] . "(#$todo->objectID)" : ''; + if($type == 'review' && isset($this->config->qcVersion)) $todo->name = isset($reviews[$todo->objectID]) ? $reviews[$todo->objectID] . "(#$todo->objectID)" : ''; if(isset($todoLang->typeList[$type])) $todo->type = $todoLang->typeList[$type]; if(isset($todoLang->priList[$todo->pri])) $todo->pri = $todoLang->priList[$todo->pri]; @@ -631,7 +631,7 @@ class todo extends control if($todo->private == 1) $todo->desc = $this->lang->todo->thisIsPrivate; /* drop some field that is not needed. */ - unset($todo->idvalue); + unset($todo->objectID); unset($todo->private); } if($this->config->edition != 'open') list($fields, $todos) = $this->loadModel('workflowfield')->appendDataFromFlow($fields, $todos); diff --git a/module/todo/js/common.js b/module/todo/js/common.js index 8668ff14f4..745713bbd5 100644 --- a/module/todo/js/common.js +++ b/module/todo/js/common.js @@ -14,11 +14,11 @@ function switchDateTodo(switcher) * @param type $type Type of selected todo. * @param id $id ID of selected todo. * @param defaultType $defaultType Default type of selected todo. - * @param idvalue $idvalue ID of the closed todo type. + * @param objectID $objectID ID of the closed todo type. * @access public * @return void */ -function loadList(type, id, defaultType, idvalue) +function loadList(type, id, defaultType, objectID) { if(id) { @@ -34,7 +34,7 @@ function loadList(type, id, defaultType, idvalue) id = id ? id : ''; var param = 'userID=' + userID + '&id=' + id; if(type == "task") param += '&status=wait,doing'; - if(type == defaultType && idvalue != 0) param += '&idvalue=' + idvalue; + if(type == defaultType && objectID != 0) param += '&objectID=' + objectID; if(moduleList.indexOf(type) !== -1) { @@ -45,7 +45,7 @@ function loadList(type, id, defaultType, idvalue) if(data.length != 0) { $(divClass).html(data).find('select').chosen(); - if(config.currentMethod == 'edit' || type == 'feedback') $(divClass).find('select').val(idvalue).trigger('chosen:updated'); + if(config.currentMethod == 'edit' || type == 'feedback') $(divClass).find('select').val(objectID).trigger('chosen:updated'); if($(divClass + " select").val() == null) $(divClass + " select").attr("data-placeholder", noOptions.replace("%s", chosenType[type])).trigger('chosen:updated'); } else @@ -68,7 +68,7 @@ function loadList(type, id, defaultType, idvalue) } else { - $('#nameBoxLabel').text(nameBoxLabel.idvalue); + $('#nameBoxLabel').text(nameBoxLabel.objectID); } } } diff --git a/module/todo/js/edit.js b/module/todo/js/edit.js index cea11ab97d..bfdba4bcd1 100644 --- a/module/todo/js/edit.js +++ b/module/todo/js/edit.js @@ -1,6 +1,6 @@ $(function() { - loadList($('#type').val(), '', defaultType, idvalue); + loadList($('#type').val(), '', defaultType, objectID); $('#pri').on('change', function() { diff --git a/module/todo/lang/de.php b/module/todo/lang/de.php index 9dff94babf..f995516fe2 100644 --- a/module/todo/lang/de.php +++ b/module/todo/lang/de.php @@ -51,7 +51,7 @@ $lang->todo->end = 'Ende'; $lang->todo->beginAB = 'Start'; $lang->todo->endAB = 'Ende'; $lang->todo->beginAndEnd = 'Dauer'; -$lang->todo->idvalue = 'Link ID'; +$lang->todo->objectID = 'Link ID'; $lang->todo->type = 'Typ'; $lang->todo->pri = 'Priorität'; $lang->todo->name = 'Titel'; diff --git a/module/todo/lang/en.php b/module/todo/lang/en.php index 2ef3a1f8a2..444ebb20a2 100644 --- a/module/todo/lang/en.php +++ b/module/todo/lang/en.php @@ -51,7 +51,7 @@ $lang->todo->end = 'End'; $lang->todo->beginAB = 'Begin'; $lang->todo->endAB = 'End'; $lang->todo->beginAndEnd = 'Begin and End'; -$lang->todo->idvalue = 'Link ID'; +$lang->todo->objectID = 'Link ID'; $lang->todo->type = 'Type'; $lang->todo->pri = 'Priority'; $lang->todo->name = 'Title'; diff --git a/module/todo/lang/fr.php b/module/todo/lang/fr.php index f55595253e..1f3ade4735 100644 --- a/module/todo/lang/fr.php +++ b/module/todo/lang/fr.php @@ -51,7 +51,7 @@ $lang->todo->end = 'Fin'; $lang->todo->beginAB = 'Début'; $lang->todo->endAB = 'Fin'; $lang->todo->beginAndEnd = 'Début et Fin'; -$lang->todo->idvalue = 'Link ID'; +$lang->todo->objectID = 'Link ID'; $lang->todo->type = 'Type'; $lang->todo->pri = 'Priorité'; $lang->todo->name = 'Titre'; diff --git a/module/todo/lang/vi.php b/module/todo/lang/vi.php index 0b33c3ff18..88664a6b91 100644 --- a/module/todo/lang/vi.php +++ b/module/todo/lang/vi.php @@ -49,7 +49,7 @@ $lang->todo->end = 'Kết thúc'; $lang->todo->beginAB = 'Bắt đầu'; $lang->todo->endAB = 'Kết thúc'; $lang->todo->beginAndEnd = 'Thời gian'; -$lang->todo->idvalue = 'Liên kết ID'; +$lang->todo->objectID = 'Liên kết ID'; $lang->todo->type = 'Loại'; $lang->todo->pri = 'Ưu tiên'; $lang->todo->name = 'Tiêu đề'; diff --git a/module/todo/lang/zh-cn.php b/module/todo/lang/zh-cn.php index 5870fffa1b..9d90d8b8ae 100644 --- a/module/todo/lang/zh-cn.php +++ b/module/todo/lang/zh-cn.php @@ -51,7 +51,7 @@ $lang->todo->end = '结束'; $lang->todo->beginAB = '开始'; $lang->todo->endAB = '结束'; $lang->todo->beginAndEnd = '起止时间'; -$lang->todo->idvalue = '关联编号'; +$lang->todo->objectID = '关联编号'; $lang->todo->type = '类型'; $lang->todo->pri = '优先级'; $lang->todo->name = '待办名称'; diff --git a/module/todo/lang/zh-tw.php b/module/todo/lang/zh-tw.php index cef237c46f..87df6d1204 100644 --- a/module/todo/lang/zh-tw.php +++ b/module/todo/lang/zh-tw.php @@ -50,7 +50,7 @@ $lang->todo->end = '結束'; $lang->todo->beginAB = '開始'; $lang->todo->endAB = '結束'; $lang->todo->beginAndEnd = '起止時間'; -$lang->todo->idvalue = '關聯編號'; +$lang->todo->objectID = '關聯編號'; $lang->todo->type = '類型'; $lang->todo->pri = '優先順序'; $lang->todo->name = '待辦名稱'; diff --git a/module/todo/model.php b/module/todo/model.php index 8ef21adb05..25f9ade3ea 100755 --- a/module/todo/model.php +++ b/module/todo/model.php @@ -78,18 +78,18 @@ class todoModel extends model $todo->end = isset($todos->ends[$i]) ? $todos->ends[$i] : 2400; $todo->status = "wait"; $todo->private = 0; - $todo->idvalue = 0; + $todo->objectID = 0; $todo->assignedTo = $assignedTo; $todo->assignedBy = $this->app->user->account; $todo->assignedDate = $now; $todo->vision = $this->config->vision; - if(in_array($todo->type, $this->config->todo->moduleList)) $todo->idvalue = isset($todos->{$this->config->todo->objectList[$todo->type]}[$i + 1]) ? $todos->{$this->config->todo->objectList[$todo->type]}[$i + 1] : 0; + if(in_array($todo->type, $this->config->todo->moduleList)) $todo->objectID = isset($todos->{$this->config->todo->objectList[$todo->type]}[$i + 1]) ? $todos->{$this->config->todo->objectList[$todo->type]}[$i + 1] : 0; - if($todo->type != 'custom' and $todo->idvalue) + if($todo->type != 'custom' and $todo->objectID) { $type = $todo->type; - $object = $this->loadModel($type)->getByID($todo->idvalue); + $object = $this->loadModel($type)->getByID($todo->objectID); if(isset($object->name)) $todo->name = $object->name; if(isset($object->title)) $todo->name = $object->title; } @@ -144,7 +144,7 @@ class todoModel extends model $this->loadModel('file')->updateObjectID($todo->uid, $todoID, 'todo'); if(!empty($oldTodo->cycle)) $this->createByCycle(array($todoID => $todo)); - if(($this->config->edition == 'biz' || $this->config->edition == 'max') && $todo->type == 'feedback' && $todo->idvalue) $this->loadModel('feedback')->updateStatus('todo', $todo->idvalue, $todo->status); + if(($this->config->edition == 'biz' || $this->config->edition == 'max') && $todo->type == 'feedback' && $todo->objectID) $this->loadModel('feedback')->updateStatus('todo', $todo->objectID, $todo->status); return common::createChanges($oldTodo, (array)$todo); } @@ -181,7 +181,7 @@ class todoModel extends model if(in_array($todo->type, $this->config->todo->moduleList)) { - $todo->idvalue = isset($data->{$this->config->todo->objectList[$todo->type]}[$todoID]) ? $data->{$this->config->todo->objectList[$todo->type]}[$todoID] : 0; + $todo->objectID = isset($data->{$this->config->todo->objectList[$todo->type]}[$todoID]) ? $data->{$this->config->todo->objectList[$todo->type]}[$todoID] : 0; } if($todo->end < $todo->begin) return print(js::alert(sprintf($this->lang->error->gt, $this->lang->todo->end, $this->lang->todo->begin))); @@ -195,15 +195,15 @@ class todoModel extends model $this->dao->update(TABLE_TODO)->data($todo) ->autoCheck() ->checkIF(!in_array($todo->type, $this->config->todo->moduleList), $this->config->todo->edit->requiredFields, 'notempty') - ->checkIF($todo->type == 'bug' and $todo->idvalue == 0, 'idvalue', 'notempty') - ->checkIF($todo->type == 'task' and $todo->idvalue == 0, 'idvalue', 'notempty') - ->checkIF($todo->type == 'story' and $todo->idvalue == 0, 'idvalue', 'notempty') - ->checkIF($todo->type == 'issue' and $todo->idvalue == 0, 'idvalue', 'notempty') - ->checkIF($todo->type == 'risk' and $todo->idvalue == 0, 'idvalue', 'notempty') - ->checkIF($todo->type == 'opportunity' and $todo->idvalue == 0, 'idvalue', 'notempty') - ->checkIF($todo->type == 'review' and $todo->idvalue == 0, 'idvalue', 'notempty') - ->checkIF($todo->type == 'testtask' and $todo->idvalue == 0, 'idvalue', 'notempty') - ->checkIF($todo->type == 'feedback' and $todo->idvalue == 0, 'idvalue', 'notempty') + ->checkIF($todo->type == 'bug' and $todo->objectID == 0, 'objectID', 'notempty') + ->checkIF($todo->type == 'task' and $todo->objectID == 0, 'objectID', 'notempty') + ->checkIF($todo->type == 'story' and $todo->objectID == 0, 'objectID', 'notempty') + ->checkIF($todo->type == 'issue' and $todo->objectID == 0, 'objectID', 'notempty') + ->checkIF($todo->type == 'risk' and $todo->objectID == 0, 'objectID', 'notempty') + ->checkIF($todo->type == 'opportunity' and $todo->objectID == 0, 'objectID', 'notempty') + ->checkIF($todo->type == 'review' and $todo->objectID == 0, 'objectID', 'notempty') + ->checkIF($todo->type == 'testtask' and $todo->objectID == 0, 'objectID', 'notempty') + ->checkIF($todo->type == 'feedback' and $todo->objectID == 0, 'objectID', 'notempty') ->where('id')->eq($todoID) ->exec(); @@ -211,10 +211,10 @@ class todoModel extends model if(!dao::isError()) { - if(($this->config->edition == 'biz' || $this->config->edition == 'max') && $todo->type == 'feedback' && $todo->idvalue && !isset($feedbacks[$todo->idvalue])) + if(($this->config->edition == 'biz' || $this->config->edition == 'max') && $todo->type == 'feedback' && $todo->objectID && !isset($feedbacks[$todo->objectID])) { - $feedbacks[$todo->idvalue] = $todo->idvalue; - $this->loadModel('feedback')->updateStatus('todo', $todo->idvalue, $todo->status); + $feedbacks[$todo->objectID] = $todo->objectID; + $this->loadModel('feedback')->updateStatus('todo', $todo->objectID, $todo->status); } $allChanges[$todoID] = common::createChanges($oldTodo, $todo); @@ -268,7 +268,7 @@ class todoModel extends model if(($this->config->edition == 'biz' || $this->config->edition == 'max')) { - $feedbackID = $this->dao->select('idvalue')->from(TABLE_TODO)->where('id')->eq($todoID)->andWhere('type')->eq('feedback')->fetch('idvalue'); + $feedbackID = $this->dao->select('objectID')->from(TABLE_TODO)->where('id')->eq($todoID)->andWhere('type')->eq('feedback')->fetch('objectID'); if($feedbackID) $this->loadModel('feedback')->updateStatus('todo', $feedbackID, 'done'); } return true; @@ -290,15 +290,15 @@ class todoModel extends model if(!$todo) return false; $todo = $this->loadModel('file')->replaceImgURL($todo, 'desc'); if($setImgSize) $todo->desc = $this->file->setImgSize($todo->desc); - if($todo->type == 'story') $todo->name = $this->dao->findById($todo->idvalue)->from(TABLE_STORY)->fetch('title'); - if($todo->type == 'task') $todo->name = $this->dao->findById($todo->idvalue)->from(TABLE_TASK)->fetch('name'); - if($todo->type == 'bug') $todo->name = $this->dao->findById($todo->idvalue)->from(TABLE_BUG)->fetch('title'); - if($todo->type == 'issue' and $this->config->edition == 'max') $todo->name = $this->dao->findById($todo->idvalue)->from(TABLE_ISSUE)->fetch('title'); - if($todo->type == 'risk' and $this->config->edition == 'max') $todo->name = $this->dao->findById($todo->idvalue)->from(TABLE_RISK)->fetch('name'); - if($todo->type == 'opportunity' and $this->config->edition == 'max') $todo->name = $this->dao->findById($todo->idvalue)->from(TABLE_OPPORTUNITY)->fetch('name'); - if($todo->type == 'review' and $this->config->edition == 'max') $todo->name = $this->dao->findById($todo->idvalue)->from(TABLE_REVIEW)->fetch('title'); - if($todo->type == 'testtask') $todo->name = $this->dao->findById($todo->idvalue)->from(TABLE_TESTTASK)->fetch('name'); - if($todo->type == 'feedback') $todo->name = $this->dao->findById($todo->idvalue)->from(TABLE_FEEDBACK)->fetch('title'); + if($todo->type == 'story') $todo->name = $this->dao->findById($todo->objectID)->from(TABLE_STORY)->fetch('title'); + if($todo->type == 'task') $todo->name = $this->dao->findById($todo->objectID)->from(TABLE_TASK)->fetch('name'); + if($todo->type == 'bug') $todo->name = $this->dao->findById($todo->objectID)->from(TABLE_BUG)->fetch('title'); + if($todo->type == 'issue' and $this->config->edition == 'max') $todo->name = $this->dao->findById($todo->objectID)->from(TABLE_ISSUE)->fetch('title'); + if($todo->type == 'risk' and $this->config->edition == 'max') $todo->name = $this->dao->findById($todo->objectID)->from(TABLE_RISK)->fetch('name'); + if($todo->type == 'opportunity' and $this->config->edition == 'max') $todo->name = $this->dao->findById($todo->objectID)->from(TABLE_OPPORTUNITY)->fetch('name'); + if($todo->type == 'review' and $this->config->edition == 'max') $todo->name = $this->dao->findById($todo->objectID)->from(TABLE_REVIEW)->fetch('title'); + if($todo->type == 'testtask') $todo->name = $this->dao->findById($todo->objectID)->from(TABLE_TESTTASK)->fetch('name'); + if($todo->type == 'feedback') $todo->name = $this->dao->findById($todo->objectID)->from(TABLE_FEEDBACK)->fetch('title'); $todo->date = str_replace('-', '', $todo->date); return $todo; } @@ -408,15 +408,15 @@ class todoModel extends model while($todo = $stmt->fetch()) { - if($todo->type == 'story') $todo->name = $this->dao->findById($todo->idvalue)->from(TABLE_STORY)->fetch('title'); - if($todo->type == 'task') $todo->name = $this->dao->findById($todo->idvalue)->from(TABLE_TASK)->fetch('name'); - if($todo->type == 'bug') $todo->name = $this->dao->findById($todo->idvalue)->from(TABLE_BUG)->fetch('title'); - if($todo->type == 'testtask') $todo->name = $this->dao->findById($todo->idvalue)->from(TABLE_TESTTASK)->fetch('name'); - if($todo->type == 'issue' && $this->config->edition == 'max') $todo->name = $this->dao->findById($todo->idvalue)->from(TABLE_ISSUE)->fetch('title'); - if($todo->type == 'risk' && $this->config->edition == 'max') $todo->name = $this->dao->findById($todo->idvalue)->from(TABLE_RISK)->fetch('name'); - if($todo->type == 'opportunity' && $this->config->edition == 'max') $todo->name = $this->dao->findById($todo->idvalue)->from(TABLE_OPPORTUNITY)->fetch('name'); - if($todo->type == 'review' && $this->config->edition == 'max') $todo->name = $this->dao->findById($todo->idvalue)->from(TABLE_REVIEW)->fetch('title'); - if($todo->type == 'feedback' and $this->config->edition != 'open') $todo->name = $this->dao->findById($todo->idvalue)->from(TABLE_FEEDBACK)->fetch('title'); + if($todo->type == 'story') $todo->name = $this->dao->findById($todo->objectID)->from(TABLE_STORY)->fetch('title'); + if($todo->type == 'task') $todo->name = $this->dao->findById($todo->objectID)->from(TABLE_TASK)->fetch('name'); + if($todo->type == 'bug') $todo->name = $this->dao->findById($todo->objectID)->from(TABLE_BUG)->fetch('title'); + if($todo->type == 'testtask') $todo->name = $this->dao->findById($todo->objectID)->from(TABLE_TESTTASK)->fetch('name'); + if($todo->type == 'issue' && $this->config->edition == 'max') $todo->name = $this->dao->findById($todo->objectID)->from(TABLE_ISSUE)->fetch('title'); + if($todo->type == 'risk' && $this->config->edition == 'max') $todo->name = $this->dao->findById($todo->objectID)->from(TABLE_RISK)->fetch('name'); + if($todo->type == 'opportunity' && $this->config->edition == 'max') $todo->name = $this->dao->findById($todo->objectID)->from(TABLE_OPPORTUNITY)->fetch('name'); + if($todo->type == 'review' && $this->config->edition == 'max') $todo->name = $this->dao->findById($todo->objectID)->from(TABLE_REVIEW)->fetch('title'); + if($todo->type == 'feedback' and $this->config->edition != 'open') $todo->name = $this->dao->findById($todo->objectID)->from(TABLE_FEEDBACK)->fetch('title'); $todo->begin = date::formatTime($todo->begin); $todo->end = date::formatTime($todo->end); @@ -557,7 +557,7 @@ class todoModel extends model if(($this->config->edition == 'biz' || $this->config->edition == 'max')) { - $feedbackID = $this->dao->select('idvalue')->from(TABLE_TODO)->where('id')->eq($todoID)->andWhere('type')->eq('feedback')->fetch('idvalue'); + $feedbackID = $this->dao->select('objectID')->from(TABLE_TODO)->where('id')->eq($todoID)->andWhere('type')->eq('feedback')->fetch('objectID'); if($feedbackID) $this->loadModel('feedback')->updateStatus('todo', $feedbackID, 'closed'); } return true; diff --git a/module/todo/tao.php b/module/todo/tao.php index c0e0bcd4cf..49994674b1 100644 --- a/module/todo/tao.php +++ b/module/todo/tao.php @@ -15,7 +15,7 @@ class todoTao extends todoModel $this->dao->insert(TABLE_TODO)->data($todo) ->autoCheck() ->checkIF(!in_array($todo->type, $this->config->todo->moduleList), $this->config->todo->create->requiredFields, 'notempty') - ->checkIF(in_array($todo->type, $this->config->todo->moduleList) && $todo->idvalue == 0, 'idvalue', 'notempty') + ->checkIF(in_array($todo->type, $this->config->todo->moduleList) && $todo->objectID == 0, 'objectID', 'notempty') ->exec(); return (int)$this->dao->lastInsertID(); @@ -34,7 +34,7 @@ class todoTao extends todoModel $this->dao->update(TABLE_TODO)->data($todo) ->autoCheck() ->checkIF(in_array($todo->type, array('custom', 'feedback')), $this->config->todo->edit->requiredFields, 'notempty') - ->checkIF(in_array($todo->type, $this->config->todo->moduleList) && $todo->idvalue == 0, 'idvalue', 'notempty') + ->checkIF(in_array($todo->type, $this->config->todo->moduleList) && $todo->objectID == 0, 'objectID', 'notempty') ->where('id')->eq($todoID) ->exec(); diff --git a/module/todo/test/model/batchcreate.php b/module/todo/test/model/batchcreate.php index a37465d8a3..360624b005 100755 --- a/module/todo/test/model/batchcreate.php +++ b/module/todo/test/model/batchcreate.php @@ -36,5 +36,5 @@ $except_create = array('types' => $types, 'pris' => $pris, 'names' => $names, 'd $todo = new todoTest(); -r($todo->batchCreateTest($noname_create)) && p('2006:name,desc,pri,type,idvalue;2007:name,desc,pri,type,idvalue;2008:name,desc,pri,type,idvalue') && e('批量创建待办1,desc1,1,custom,0;批量创建待办2,desc2,2,custom,0;批量创建待办3,desc4,4,custom,0'); // 批量创建有个没有名字的待办 -r($todo->batchCreateTest($except_create)) && p('2009:name,desc,pri,type,idvalue;2010:name,desc,pri,type,idvalue;2011:name,desc,pri,type,idvalue;2012:name,desc,pri,type,idvalue') && e('测试单转Bug13,desc1,1,bug,313;软件需求版本一551,desc2,2,story,1;开发任务11,desc3,3,task,1;测试单1,desc4,4,testtask,1'); // 批量创建的待办 +r($todo->batchCreateTest($noname_create)) && p('2006:name,desc,pri,type,objectID;2007:name,desc,pri,type,objectID;2008:name,desc,pri,type,objectID') && e('批量创建待办1,desc1,1,custom,0;批量创建待办2,desc2,2,custom,0;批量创建待办3,desc4,4,custom,0'); // 批量创建有个没有名字的待办 +r($todo->batchCreateTest($except_create)) && p('2009:name,desc,pri,type,objectID;2010:name,desc,pri,type,objectID;2011:name,desc,pri,type,objectID;2012:name,desc,pri,type,objectID') && e('测试单转Bug13,desc1,1,bug,313;软件需求版本一551,desc2,2,story,1;开发任务11,desc3,3,task,1;测试单1,desc4,4,testtask,1'); // 批量创建的待办 diff --git a/module/todo/test/model/update.php b/module/todo/test/model/update.php index 796cff850f..b736beb59f 100755 --- a/module/todo/test/model/update.php +++ b/module/todo/test/model/update.php @@ -46,7 +46,7 @@ $tester->loadModel('todo'); initData(); $t_upname = array('name' => 'john'); -$t_uptype = array('type' => 'bug', 'idvalue' => '1'); +$t_uptype = array('type' => 'bug', 'objectID' => '1'); $t_unname = array('name' => 'john'); $todo = new todoTest(); diff --git a/module/todo/test/todo.class.php b/module/todo/test/todo.class.php index b045396b3e..7fa531a84b 100755 --- a/module/todo/test/todo.class.php +++ b/module/todo/test/todo.class.php @@ -270,7 +270,7 @@ class todoTest $todo->begin = '0830'; $todo->end = '0900'; $todo->account = 'admin'; - $todo->idvalue = '0'; + $todo->objectID = '0'; $todo->vision = 'rnd'; $todo->assignedTo = 'admin'; $todo->assignedBy = 'admin'; @@ -285,7 +285,7 @@ class todoTest $this->objectModel->createByCycle(array($todoID => $todo)); - $objects = $tester->dao->select('id')->from(TABLE_TODO)->where('idvalue')->eq($todoID)->andWhere('deleted')->eq('0')->fetchAll(); + $objects = $tester->dao->select('id')->from(TABLE_TODO)->where('objectID')->eq($todoID)->andWhere('deleted')->eq('0')->fetchAll(); if(dao::isError()) return dao::getError(); diff --git a/module/todo/view/batchedit.html.php b/module/todo/view/batchedit.html.php index 014b07e5fb..345a82eadf 100644 --- a/module/todo/view/batchedit.html.php +++ b/module/todo/view/batchedit.html.php @@ -62,7 +62,7 @@ } else { - echo html::select("types[$todo->id]", $lang->todo->typeList, $todo->type, "onchange='loadList(this.value, {$todo->id}, \"{$todo->type}\", {$todo->idvalue})' class='form-control'"); + echo html::select("types[$todo->id]", $lang->todo->typeList, $todo->type, "onchange='loadList(this.value, {$todo->id}, \"{$todo->type}\", {$todo->objectID})' class='form-control'"); } ?> @@ -77,39 +77,39 @@ } elseif($todo->type == 'task') { - echo html::select("tasks[$todo->id]", $tasks, $todo->idvalue, 'class="form-control chosen"'); + echo html::select("tasks[$todo->id]", $tasks, $todo->objectID, 'class="form-control chosen"'); } elseif($todo->type == 'bug') { - echo html::select("bugs[$todo->id]", $bugs, $todo->idvalue, 'class="form-control chosen"'); + echo html::select("bugs[$todo->id]", $bugs, $todo->objectID, 'class="form-control chosen"'); } elseif($todo->type == 'story') { - echo html::select("stories[$todo->id]", $storys, $todo->idvalue, 'class="form-control chosen"'); + echo html::select("stories[$todo->id]", $storys, $todo->objectID, 'class="form-control chosen"'); } elseif($todo->type == 'issue') { - echo html::select("issues[$todo->id]", $issues, $todo->idvalue, 'class="form-control chosen"'); + echo html::select("issues[$todo->id]", $issues, $todo->objectID, 'class="form-control chosen"'); } elseif($todo->type == 'risk') { - echo html::select("risks[$todo->id]", $risks, $todo->idvalue, 'class="form-control chosen"'); + echo html::select("risks[$todo->id]", $risks, $todo->objectID, 'class="form-control chosen"'); } elseif($todo->type == 'review') { - echo html::select("reviews[$todo->id]", $reviews, $todo->idvalue, 'class="form-control chosen"'); + echo html::select("reviews[$todo->id]", $reviews, $todo->objectID, 'class="form-control chosen"'); } elseif($todo->type == 'testtask') { - echo html::select("testtasks[$todo->id]", $testtasks, $todo->idvalue, 'class="form-control chosen"'); + echo html::select("testtasks[$todo->id]", $testtasks, $todo->objectID, 'class="form-control chosen"'); } elseif($todo->type == 'opportunity') { - echo html::select("opportunities[$todo->id]", $opportunities, $todo->idvalue, 'class="form-control chosen"'); + echo html::select("opportunities[$todo->id]", $opportunities, $todo->objectID, 'class="form-control chosen"'); } elseif($todo->type == 'feedback') { - echo html::select("feedbacks[$todo->id]", $feedbacks, $todo->idvalue, 'class="form-control chosen"'); + echo html::select("feedbacks[$todo->id]", $feedbacks, $todo->objectID, 'class="form-control chosen"'); } ?> diff --git a/module/todo/view/create.html.php b/module/todo/view/create.html.php index 6073880b77..8c40c9c2e2 100644 --- a/module/todo/view/create.html.php +++ b/module/todo/view/create.html.php @@ -16,7 +16,7 @@ todo->noTodo);?> todo->moduleList)?> todo->getUserObjectsMethod)?> - $lang->todo->name, 'idvalue' => $lang->todo->idvalue));?> + $lang->todo->name, 'objectID' => $lang->todo->objectID));?> vision);?> todo->noOptions);?> todo->typeList);?> diff --git a/module/todo/view/edit.html.php b/module/todo/view/edit.html.php index 46fb2d597c..184e32b2bc 100644 --- a/module/todo/view/edit.html.php +++ b/module/todo/view/edit.html.php @@ -15,9 +15,9 @@ todo->moduleList)?> todo->getUserObjectsMethod)?> -idvalue);?> +objectID);?> type);?> - $lang->todo->name, 'idvalue' => $lang->todo->idvalue));?> + $lang->todo->name, 'objectID' => $lang->todo->objectID));?> vision);?> todo->noOptions);?> todo->typeList);?> @@ -127,7 +127,7 @@