OneBot: Leantime 改造版源码(BOM/Univer 表格/AI 接管/品牌替换等)

This commit is contained in:
wangruiguo
2026-09-03 18:49:20 +08:00
commit d647428529
3501 changed files with 1988906 additions and 0 deletions

View File

@@ -0,0 +1,12 @@
<?php
/**
* Controller / Board Dialog
*/
namespace Leantime\Domain\Logicmodelcanvas\Controllers;
class BoardDialog extends \Leantime\Domain\Canvas\Controllers\BoardDialog
{
protected const CANVAS_NAME = 'logicmodel';
}

View File

@@ -0,0 +1,12 @@
<?php
/**
* Controller / Delete Canvas
*/
namespace Leantime\Domain\Logicmodelcanvas\Controllers;
class DelCanvas extends \Leantime\Domain\Canvas\Controllers\DelCanvas
{
protected const CANVAS_NAME = 'logicmodel';
}

View File

@@ -0,0 +1,12 @@
<?php
/**
* Controller / Delete Canvas Item
*/
namespace Leantime\Domain\Logicmodelcanvas\Controllers;
class DelCanvasItem extends \Leantime\Domain\Canvas\Controllers\DelCanvasItem
{
protected const CANVAS_NAME = 'logicmodel';
}

View File

@@ -0,0 +1,12 @@
<?php
/**
* Controller / Edit Canvas Comment
*/
namespace Leantime\Domain\Logicmodelcanvas\Controllers;
class EditCanvasComment extends \Leantime\Domain\Canvas\Controllers\EditCanvasComment
{
protected const CANVAS_NAME = 'logicmodel';
}

View File

@@ -0,0 +1,71 @@
<?php
/**
* Controller / Edit Canvas Item
*/
namespace Leantime\Domain\Logicmodelcanvas\Controllers;
use Leantime\Core\Auth\Permissions\RequiresPermission;
use Leantime\Domain\Blueprints\Permissions\BlueprintsPermissions;
use Leantime\Domain\Blueprints\Services\Blueprints as BlueprintsService;
class EditCanvasItem extends \Leantime\Domain\Canvas\Controllers\EditCanvasItem
{
protected const CANVAS_NAME = 'logicmodel';
/**
* Persist the Stage (box) and Priority (impact) selects on save.
*
* The shared Canvas save path (parent::post → service::updateCanvasItem) never
* writes `box` and does not forward `impact`, so without this the Stage
* dropdown would be a no-op and saving would reset Priority. Patch both
* after the base save for existing items; new items already receive their
* box on insert via the create path.
*
* The base post() already EDIT-authorizes the item against its real project; the extra
* patch is routed through the same project-authorized service method for consistency.
*
* @param array $params Request parameters
*/
#[RequiresPermission(BlueprintsPermissions::EDIT, entityScoped: true)]
public function post($params)
{
$response = parent::post($params);
$isExistingItemSave = isset($params['changeItem'])
&& ! empty($params['itemId'])
&& ! empty($params['description']);
if ($isExistingItemSave) {
$patch = [];
if (! empty($params['box'])) {
$patch['box'] = $params['box'];
}
if (array_key_exists('impact', $params)) {
$patch['impact'] = $params['impact'];
}
// Authored-meaning fields. Both are stage-gated in the UI
// (Impact only shows starting_picture; Outputs/Outcomes only
// show why_this_matters) — the hidden inputs preserve any
// pre-existing value so a stage change doesn't silently
// erase authored text.
if (array_key_exists('why_this_matters', $params)) {
$patch['why_this_matters'] = (string) $params['why_this_matters'];
}
if (array_key_exists('starting_picture', $params)) {
$patch['starting_picture'] = (string) $params['starting_picture'];
}
if ($patch !== []) {
app()->make(BlueprintsService::class)
->patchCanvasItem((int) $params['itemId'], $patch, static::CANVAS_NAME.'canvas');
}
}
return $response;
}
}

View File

@@ -0,0 +1,12 @@
<?php
/**
* Controller / Export Canvas
*/
namespace Leantime\Domain\Logicmodelcanvas\Controllers;
class Export extends \Leantime\Domain\Canvas\Controllers\Export
{
protected const CANVAS_NAME = 'logicmodel';
}

View File

@@ -0,0 +1,12 @@
<?php
/**
* Controller / Show Canvas
*/
namespace Leantime\Domain\Logicmodelcanvas\Controllers;
class ShowCanvas extends \Leantime\Domain\Canvas\Controllers\ShowCanvas
{
protected const CANVAS_NAME = 'logicmodel';
}