N°3649 - Activity panel: Remove entry form from the activity tab, only case log tabs will have one

This commit is contained in:
Molkobain
2021-01-20 17:10:39 +01:00
parent 16ca856996
commit cebc51e045
5 changed files with 19 additions and 117 deletions

View File

@@ -63,8 +63,6 @@ class ActivityPanel extends UIBlock
protected $bAreEntriesSorted;
/** @var bool $bHasLifecycle True if the host object has a lifecycle */
protected $bHasLifecycle;
/** @var \Combodo\iTop\Application\UI\Base\Layout\ActivityPanel\CaseLogEntryForm\CaseLogEntryForm $oActivityTabEntryForm New entry form for the activity tab which is different from the case log tabs */
protected $oActivityTabEntryForm;
/** @var \Combodo\iTop\Application\UI\Base\Layout\ActivityPanel\CaseLogEntryForm\CaseLogEntryForm[] $aCaseLogTabsEntryForms */
protected $aCaseLogTabsEntryForms;
@@ -532,6 +530,23 @@ class ActivityPanel extends UIBlock
return !empty($this->aCaseLogTabsEntryForms[$sCaseLogId]);
}
/**
* Whether the submission of the case logs present in the activity panel is autonomous or will be handled by another form
*
* @return bool
*/
public function IsCaseLogsSubmitAutonomous(): bool
{
$bIsAutonomous = true;
foreach ($this->GetCaseLogTabsEntryForms() as $oCaseLogEntryForm) {
$bIsAutonomous = $oCaseLogEntryForm->IsSubmitAutonomous();
break;
}
return $bIsAutonomous;
}
/**
* Return true if the host object has a lifecycle
*
@@ -554,42 +569,6 @@ class ActivityPanel extends UIBlock
return $oDateTimeFormat->ToMomentJS();
}
/**
* Return the entry form for the activity tab
*
* @see $oActivityTabEntryForm
* @return \Combodo\iTop\Application\UI\Base\Layout\ActivityPanel\CaseLogEntryForm\CaseLogEntryForm
*/
public function GetActivityTabEntryForm(): CaseLogEntryForm
{
return $this->oActivityTabEntryForm;
}
/**
* Set the entry form for the activity tab
*
* @param \Combodo\iTop\Application\UI\Base\Layout\ActivityPanel\CaseLogEntryForm\CaseLogEntryForm $oCaseLogEntryForm
* @see $oActivityTabEntryForm
*
* @return $this
*
*/
public function SetActivityTabEntryForm(CaseLogEntryForm $oCaseLogEntryForm)
{
$this->oActivityTabEntryForm = $oCaseLogEntryForm;
return $this;
}
/**
* Return true is there is an entry form for the activity tab
*
* @return bool
*/
public function HasActivityTabEntryForm()
{
return $this->oActivityTabEntryForm !== null;
}
/**
* @inheritdoc
*/
@@ -601,11 +580,6 @@ class ActivityPanel extends UIBlock
$aSubBlocks[$oCaseLogEntryForm->GetId()] = $oCaseLogEntryForm;
}
if ($this->HasActivityTabEntryForm()) {
$oNewEntryForm = $this->GetActivityTabEntryForm();
$aSubBlocks[$oNewEntryForm->GetId()] = $oNewEntryForm;
}
return $aSubBlocks;
}
}