Skip to content

Conversation

@Mary-Clb
Copy link
Contributor

@Mary-Clb Mary-Clb commented Dec 9, 2025

  • I have read the CONTRIBUTING document.
  • I have performed a self-review of my code.
  • I have added tests that prove my fix is effective or that my feature works.
  • This change requires a documentation update.

Description

It fixes !40258
Replace #22265
The project creation via templates workflow had a confusing UX where users could add elements as tasks and teams to templates, thinking they were creating actual projects.

This PR implements a comprehensive read-only preview of the project tabs when it is not registered :

tasks-project-read-only

Copy link
Contributor

@trasher trasher left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, please fix Psalm issues

if ($withtemplate == 2 && $item instanceof Project) {
echo '<div class="alert alert-info mb-3">';
echo '<i class="ti ti-info-circle me-2"></i>';
echo __('You are viewing contracts from the template. Save the project first to be able to add or modify contracts.');
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
echo __('You are viewing contracts from the template. Save the project first to be able to add or modify contracts.');
echo __s('You are viewing contracts from the template. Save the project first to be able to add or modify contracts.');

if ($withtemplate == 2 && $item instanceof Project) {
echo '<div class="alert alert-info mb-3">';
echo '<i class="ti ti-info-circle me-2"></i>';
echo __('You are viewing documents from the template. Save the project first to be able to add or modify documents.');
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
echo __('You are viewing documents from the template. Save the project first to be able to add or modify documents.');
echo __s('You are viewing documents from the template. Save the project first to be able to add or modify documents.');

if ($withtemplate == 2 && $item instanceof Project) {
echo '<div class="alert alert-info mb-3">';
echo '<i class="ti ti-info-circle me-2"></i>';
echo __('You are viewing items from the template. Save the project first to be able to add or modify linked items.');
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
echo __('You are viewing items from the template. Save the project first to be able to add or modify linked items.');
echo __s('You are viewing items from the template. Save the project first to be able to add or modify linked items.');

if ($withtemplate == 2 && $item instanceof Project) {
echo '<div class="alert alert-info mb-3">';
echo '<i class="ti ti-info-circle me-2"></i>';
echo __('You are viewing ITIL objects from the template. Save the project first to be able to add or modify linked tickets, problems or changes.');
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
echo __('You are viewing ITIL objects from the template. Save the project first to be able to add or modify linked tickets, problems or changes.');
echo __s('You are viewing ITIL objects from the template. Save the project first to be able to add or modify linked tickets, problems or changes.');

if ($withtemplate == 2 && $item instanceof Project) {
echo '<div class="alert alert-info mb-3">';
echo '<i class="ti ti-info-circle me-2"></i>';
echo __('You are viewing knowledge base items from the template. Save the project first to be able to add or modify linked articles.');
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
echo __('You are viewing knowledge base items from the template. Save the project first to be able to add or modify linked articles.');
echo __s('You are viewing knowledge base items from the template. Save the project first to be able to add or modify linked articles.');

if ($withtemplate == 2 && $item instanceof Project) {
echo '<div class="alert alert-info mb-3">';
echo '<i class="ti ti-info-circle me-2"></i>';
echo __('You are viewing notes from the template. Save the project first to be able to add or modify notes.');
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
echo __('You are viewing notes from the template. Save the project first to be able to add or modify notes.');
echo __s('You are viewing notes from the template. Save the project first to be able to add or modify notes.');

if ($withtemplate == 2) {
echo '<div class="alert alert-info mb-3">';
echo '<i class="ti ti-info-circle me-2"></i>';
echo __('You are viewing costs from the template. Save the project first to be able to add or modify costs.');
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
echo __('You are viewing costs from the template. Save the project first to be able to add or modify costs.');
echo __s('You are viewing costs from the template. Save the project first to be able to add or modify costs.');

if ($withtemplate == 2) {
echo '<div class="alert alert-info mb-3">';
echo '<i class="ti ti-info-circle me-2"></i>';
echo __('You are viewing tasks from the template. Save the project first to be able to add or modify tasks.');
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
echo __('You are viewing tasks from the template. Save the project first to be able to add or modify tasks.');
echo __s('You are viewing tasks from the template. Save the project first to be able to add or modify tasks.');

if ($withtemplate == 2) {
echo '<div class="alert alert-info mb-3">';
echo '<i class="ti ti-info-circle me-2"></i>';
echo __('You are viewing team members from the template. Save the project first to be able to add or modify team members.');
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
echo __('You are viewing team members from the template. Save the project first to be able to add or modify team members.');
echo __s('You are viewing team members from the template. Save the project first to be able to add or modify team members.');

@cedric-anne cedric-anne added this to the 11.0.5 milestone Dec 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants