From 2c5d8abc457670f7a4c88c9d044a4f8899e517f4 Mon Sep 17 00:00:00 2001 From: liyuchun Date: Tue, 4 Jan 2022 16:15:17 +0800 Subject: [PATCH] * Fix bug #18150. --- module/mr/model.php | 14 ++++++++++++++ module/mr/view/browse.html.php | 2 +- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/module/mr/model.php b/module/mr/model.php index d441f29db3..90651b9513 100644 --- a/module/mr/model.php +++ b/module/mr/model.php @@ -1504,4 +1504,18 @@ class mrModel extends model } return isset($errorMessage) ? $errorMessage : $message; } + + /** + * Adjust the action clickable. + * + * @param object $MR + * @param string $action + * @access public + * @return void + */ + public static function isClickable($MR, $action) + { + if($action == 'edit' and !$MR->synced) return false; + return true; + } } diff --git a/module/mr/view/browse.html.php b/module/mr/view/browse.html.php index 439498705f..4a27fcd709 100644 --- a/module/mr/view/browse.html.php +++ b/module/mr/view/browse.html.php @@ -85,7 +85,7 @@ id}", '', '', "title='{$lang->mr->view}' class='btn btn-info'"); - common::printLink('mr', 'edit', "mr={$MR->id}", '', '', "title='{$lang->mr->edit}' class='btn btn-info'"); + common::printIcon('mr', 'edit', "mr={$MR->id}", $MR, 'list'); common::printLink('mr', 'diff', "mr={$MR->id}", '', '', "title='{$lang->mr->viewDiff}' class='btn btn-info'"); common::printLink('mr', 'link', "mr={$MR->id}", '', '', "title='{$lang->mr->link}' class='btn btn-info'" . ($MR->linkButton == false ? 'disabled' : '')); common::printLink('mr', 'delete', "mr={$MR->id}", '', 'hiddenwin', "title='{$lang->mr->delete}' class='btn btn-info'");