diff --git a/Helper/QualKardHelper.php b/Helper/QualKardHelper.php index bdb7717..3cfdb78 100644 --- a/Helper/QualKardHelper.php +++ b/Helper/QualKardHelper.php @@ -120,6 +120,18 @@ class QualKardHelper extends Base return (int) $this->projectMetadataModel->get($project_id, 'qualkard_col_'.$role, 0); } + /** + * Is FinanceBuddy enabled on this board? QualKard refuses to convert a FinanceBuddy board (its + * restructure would wreck the finance columns). + * + * @param int $project_id + * @return bool + */ + public function fbEnabled($project_id) + { + return (int) $this->projectMetadataModel->get($project_id, 'financebuddy_enabled', 0) === 1; + } + /** * Write the inert RecoReco config for a card: move-mode to Study, fire from anywhere but Done, * daily (innocuous -- QualKard sets the due date on each grade), anchor 0 so RecoReco skips it diff --git a/Plugin.php b/Plugin.php index 6d77412..4f9507a 100644 --- a/Plugin.php +++ b/Plugin.php @@ -81,7 +81,7 @@ class Plugin extends Base public function getPluginVersion() { - return '0.5.0'; + return '0.6.0'; } public function getPluginHomepage() diff --git a/Template/project/integration.php b/Template/project/integration.php index 603c6fd..139f105 100644 --- a/Template/project/integration.php +++ b/Template/project/integration.php @@ -1,28 +1,36 @@ +s) +// to post to QualKard's own controller. Set up is destructive; disabling only stops the automation. +$has = $this->QualKardHelper->hasRecoReco(); +$fb = $this->QualKardHelper->fbEnabled($project['id']); +$enabled = $this->QualKardHelper->isEnabled($project['id']); +$blocked = ! $has || $fb; +?>
= t('QualKard needs the RecoReco plugin (its move engine). Install RecoReco to use QualKard.') ?>
- -QualKardHelper->isEnabled($project['id'])): ?> - -= t('Turn this project into a spaced-repetition study board. This restructures the columns to Drafts | Study | Hairy | Hard | Medium | Easy | Done and moves every card to Drafts.') ?>
- += t('QualKard is enabled on this board.') ?>
+= t('"Disable" only stops the QualKard automation -- it does not restructure the board or touch your cards.') ?>
-= t('QualKard is enabled on this board.') ?>
- - ++ + = t('QualKard needs the RecoReco plugin (its move engine).') ?> + + = t('Disabled while FinanceBuddy is enabled here -- QualKard would restructure the columns.') ?> + + = t('Set up turns this project into a study board: columns become Drafts | Study | Hairy | Hard | Medium | Easy | Done and every card moves to Drafts.') ?> + +
+