diff --git a/module/kanban/js/view.js b/module/kanban/js/view.js index 42b129b672..7f0c97137f 100644 --- a/module/kanban/js/view.js +++ b/module/kanban/js/view.js @@ -1139,10 +1139,10 @@ function createCardMenu(options) var moveCard = privs.includes('moveCard'); var setCardColor = privs.includes('setCardColor'); - var basicOperation = (editCard || deleteCard || archiveCard) ? true : false; - var otherOperation = (moveCard || setCardColor) ? true : false; + var basicActions = (editCard || deleteCard || archiveCard) ? true : false; + var otherActions = (moveCard || setCardColor) ? true : false; - if((performable || basicOperation) && otherOperation) + if((performable || basicActions) && otherActions) { items.push({type: 'divider'}); } @@ -1200,10 +1200,10 @@ function createColumnMenu(options) if(privs.includes('setColumn')) items.push({label: kanbanLang.editColumn, icon: 'edit', url: createLink('kanban', 'setColumn', 'columnID=' + column.id, '', 'true'), className: 'iframe', attrs: {'data-toggle': 'modal'}}); if(privs.includes('setWIP')) items.push({label: kanbanLang.setWIP, icon: 'alert', url: createLink('kanban', 'setWIP', 'columnID=' + column.id), className: 'iframe', attrs: {'data-toggle': 'modal', 'data-width' : '500px'}}); - var basicOperation = (privs.includes('setColumn') || privs.includes('setWIP')) ? true : false; - var columnOperation = (privs.includes('splitColumn') || privs.includes('createColumn') || privs.includes('copyColumn')) ? true : false; + var basicActions = (privs.includes('setColumn') || privs.includes('setWIP')) ? true : false; + var columnActions = (privs.includes('splitColumn') || privs.includes('createColumn') || privs.includes('copyColumn')) ? true : false; - if(basicOperation && columnOperation) + if(basicActions && columnActions) { items.push({type: 'divider'}); } @@ -1216,8 +1216,8 @@ function createColumnMenu(options) } if(privs.includes('copyColumn')) items.push({label: kanbanLang.copyColumn, icon: 'copy', url: createLink('kanban', 'copyColumn', 'columnID=' + column.id), className: 'iframe', attrs: {'data-toggle': 'modal'}}); - var otherOperation = ((privs.includes('archiveColumn') && kanban.archived == '1') || privs.includes('deleteColumn')) ? true : false; - if(columnOperation && otherOperation) + var otherActions = ((privs.includes('archiveColumn') && kanban.archived == '1') || privs.includes('deleteColumn')) ? true : false; + if(columnActions && otherActions) { items.push({type: 'divider'}); } diff --git a/module/kanban/model.php b/module/kanban/model.php index 1caca23df5..a5f5bee77b 100644 --- a/module/kanban/model.php +++ b/module/kanban/model.php @@ -3065,18 +3065,18 @@ class kanbanModel extends model } $actions .= $columnActions; - $oftenActions = ''; - if(common::hasPriv('kanban', 'createRegion') and $CRKanban) $oftenActions .= '
  • ' . html::a(helper::createLink('kanban', 'createRegion', "kanbanID=$kanban->id", '', true), '' . $this->lang->kanban->createRegion, '', "class='iframe btn btn-link'") . '
  • '; + $commonActions = ''; + if(common::hasPriv('kanban', 'createRegion') and $CRKanban) $commonActions .= '
  • ' . html::a(helper::createLink('kanban', 'createRegion', "kanbanID=$kanban->id", '', true), '' . $this->lang->kanban->createRegion, '', "class='iframe btn btn-link'") . '
  • '; $importWidth = $this->app->getClientLang() == 'en' ? '700' : '550'; - if(common::hasPriv('kanban', 'import') and $CRKanban) $oftenActions .= '
  • ' . html::a(helper::createLink('kanban', 'import', "kanbanID=$kanban->id", '', true), '' . $this->lang->kanban->import, '', "class='iframe btn btn-link' data-width=$importWidth") . '
  • '; - if(common::hasPriv('kanban', 'enableArchived') and $CRKanban) $oftenActions .= '
  • ' . html::a(helper::createLink('kanban', 'enableArchived', "kanbanID=$kanban->id", '', true), '' . $this->lang->kanban->archived, '', "class='iframe btn btn-link' data-width=400") . '
  • '; - if(common::hasPriv('kanban', 'performable') and $CRKanban) $oftenActions .= '
  • ' . html::a(helper::createLink('kanban', 'performable', "kanbanID=$kanban->id", '', true), '' . $this->lang->kanban->manageProgress, '', "class='iframe btn btn-link' data-width=40%") . '
  • '; + if(common::hasPriv('kanban', 'import') and $CRKanban) $commonActions .= '
  • ' . html::a(helper::createLink('kanban', 'import', "kanbanID=$kanban->id", '', true), '' . $this->lang->kanban->import, '', "class='iframe btn btn-link' data-width=$importWidth") . '
  • '; + if(common::hasPriv('kanban', 'enableArchived') and $CRKanban) $commonActions .= '
  • ' . html::a(helper::createLink('kanban', 'enableArchived', "kanbanID=$kanban->id", '', true), '' . $this->lang->kanban->archived, '', "class='iframe btn btn-link' data-width=400") . '
  • '; + if(common::hasPriv('kanban', 'performable') and $CRKanban) $commonActions .= '
  • ' . html::a(helper::createLink('kanban', 'performable', "kanbanID=$kanban->id", '', true), '' . $this->lang->kanban->manageProgress, '', "class='iframe btn btn-link' data-width=40%") . '
  • '; - if($columnActions and $oftenActions) + if($columnActions and $commonActions) { $actions .= "
  • "; } - $actions .= $oftenActions; + $actions .= $commonActions; $kanbanActions = ''; if(common::hasPriv('kanban', 'edit')) $kanbanActions .= '
  • ' . html::a(helper::createLink('kanban', 'edit', "kanbanID=$kanban->id", '', true), '' . $this->lang->kanban->edit, '', "class='iframe btn btn-link' data-width='75%'") . '
  • '; @@ -3084,7 +3084,7 @@ class kanbanModel extends model if(common::hasPriv('kanban', 'activate') and $kanban->status == 'closed') $kanbanActions .= '
  • ' . html::a(helper::createLink('kanban', 'activate', "kanbanID=$kanban->id", '', true), '' . $this->lang->kanban->activate, '', "class='iframe btn btn-link'") . '
  • '; if(common::hasPriv('kanban', 'delete')) $kanbanActions .= '
  • ' . html::a(helper::createLink('kanban', 'delete', "kanbanID=$kanban->id"), '' . $this->lang->kanban->delete, 'hiddenwin', "class='btn btn-link'") . '
  • '; - if($oftenActions and $kanbanActions) + if($commonActions and $kanbanActions) { $actions .= "
  • "; }