Skip to content

Commit

Permalink
Feature RM#90819:Project: Move isActivateProjectChangeShortcut in sho…
Browse files Browse the repository at this point in the history
…rtcutMultiSelect (#13972)
  • Loading branch information
vva-axelor authored Feb 17, 2025
1 parent 64edf94 commit 2eb3ac8
Show file tree
Hide file tree
Showing 9 changed files with 25 additions and 16 deletions.
2 changes: 1 addition & 1 deletion axelor-base/src/main/resources/domains/AppBase.xml
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@
help="This configuration allows quick access to the type of environment and the configured date and time"/>
<string name="shortcutMultiSelect" title="Activate changes shortcut for"
selection="base.change.shortcut.select"
help="This configuration allows to display a shortcut to switch active company/trading name of the current user."/>
help="This configuration allows to display a shortcut to switch active company/trading name/project of the current user."/>

<integer name="defaultBatchFetchLimit" title="Default batch fetch limit"
help="Default fetch limit for batches. 0 will not be taken into account. In this case, the default value (10) will be used."
Expand Down
2 changes: 1 addition & 1 deletion axelor-base/src/main/resources/i18n/messages.csv
Original file line number Diff line number Diff line change
Expand Up @@ -2273,7 +2273,7 @@
"This certificate makes pdf files intangible when they are generated by the software (only used for Expense Notes and Invoices for the moment). It must be delivered by a certification authority.",,,
"This code is already use by another batch.",,,
"This configuration allows quick access to the type of environment and the configured date and time",,,
"This configuration allows to display a shortcut to switch active company/trading name of the current user.",,,
"This configuration allows to display a shortcut to switch active company/trading name/project of the current user.",,,
"This field %s doesn't exist.",,,
"This field allows to filter files and download only those that respect specified naming without sensitive case. Example : 'ABCD' will filter on files that contain 'ABCD' in their name.",,,
"This field is used to enter the name of the data file used in the XML binding file. This will be used to temporaly rename all the data files imported from the FTP server in order to use them with a binding file.",,,
Expand Down
2 changes: 1 addition & 1 deletion axelor-base/src/main/resources/i18n/messages_en.csv
Original file line number Diff line number Diff line change
Expand Up @@ -2273,7 +2273,7 @@
"This certificate makes pdf files intangible when they are generated by the software (only used for Expense Notes and Invoices for the moment). It must be delivered by a certification authority.",,,
"This code is already use by another batch.",,,
"This configuration allows quick access to the type of environment and the configured date and time",,,
"This configuration allows to display a shortcut to switch active company/trading name of the current user.",,,
"This configuration allows to display a shortcut to switch active company/trading name/project of the current user.",,,
"This field %s doesn't exist.",,,
"This field allows to filter files and download only those that respect specified naming without sensitive case. Example : 'ABCD' will filter on files that contain 'ABCD' in their name.",,,
"This field is used to enter the name of the data file used in the XML binding file. This will be used to temporaly rename all the data files imported from the FTP server in order to use them with a binding file.",,,
Expand Down
2 changes: 1 addition & 1 deletion axelor-base/src/main/resources/i18n/messages_fr.csv
Original file line number Diff line number Diff line change
Expand Up @@ -2273,7 +2273,7 @@
"This certificate makes pdf files intangible when they are generated by the software (only used for Expense Notes and Invoices for the moment). It must be delivered by a certification authority.","Ce certificat permet de rendre les fichiers pdf intangibles lorsqu'ils sont générés par l'outil (attention utilisé uniquement pour les Notes de frais et Factures pour le moment). Pour cela, il doit être délivré par une autorité de certification.",,
"This code is already use by another batch.","Ce code est déjà utilisé par un autre batch.",,
"This configuration allows quick access to the type of environment and the configured date and time","Cette configuration permet l'accès rapide au type d’environnement et aux date et heure configurées",,
"This configuration allows to display a shortcut to switch active company/trading name of the current user.","Cette configuration permet l'affichage d'un raccourci pour sélectionner la société/enseigne active de l'utilisateur connecté.",,
"This configuration allows to display a shortcut to switch active company/trading name/project of the current user.","Cette configuration permet l'affichage d'un raccourci pour sélectionner la société/enseigne/projet active de l'utilisateur connecté.",,
"This field %s doesn't exist.","Ce champ %s n'existe pas.",,
"This field allows to filter files and download only those that respect specified naming without sensitive case. Example : 'ABCD' will filter on files that contain 'ABCD' in their name.","Ce champ permet de filtrer les fichiers à télécharger en suivant une règle de nommage sans respect de la casse. Exemple : 'ABCD' permettra de télécharger les fichiers contenant dans leurs noms 'ABCD'",,
"This field is used to enter the name of the data file used in the XML binding file. This will be used to temporaly rename all the data files imported from the FTP server in order to use them with a binding file.","Ce champ permet de renseigner le nom du fichier de données utilisé dans le fichier de configuration XML. Celui-ci servira à renommer temporairement les fichiers de données importés depuis le serveur FTP afin de les importer avec le fichier de liaison",,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,17 @@
*/
package com.axelor.apps.project.quickmenu;

import com.axelor.apps.base.service.app.AppBaseService;
import com.axelor.apps.project.db.Project;
import com.axelor.apps.project.service.app.AppProjectService;
import com.axelor.apps.project.web.UserController;
import com.axelor.auth.AuthUtils;
import com.axelor.auth.db.User;
import com.axelor.common.ObjectUtils;
import com.axelor.common.StringUtils;
import com.axelor.i18n.I18n;
import com.axelor.rpc.Context;
import com.axelor.studio.db.AppProject;
import com.axelor.studio.db.AppBase;
import com.axelor.studio.db.repo.AppBaseRepository;
import com.axelor.ui.QuickMenu;
import com.axelor.ui.QuickMenuCreator;
import com.axelor.ui.QuickMenuItem;
Expand All @@ -40,11 +42,11 @@

public class ActiveProjectQuickMenuCreator implements QuickMenuCreator {

protected AppProjectService appProjectService;
protected AppBaseService appBaseService;

@Inject
public ActiveProjectQuickMenuCreator(AppProjectService appProjectService) {
this.appProjectService = appProjectService;
public ActiveProjectQuickMenuCreator(AppBaseService appBaseService) {
this.appBaseService = appBaseService;
}

@Override
Expand All @@ -65,8 +67,9 @@ public QuickMenu create() {
}

protected boolean hasConfigEnabled() {
AppProject appProject = appProjectService.getAppProject();
return !appProject.getIsActivateProjectChangeShortcut();
AppBase appBase = appBaseService.getAppBase();
return StringUtils.isBlank(appBase.getShortcutMultiSelect())
|| !appBase.getShortcutMultiSelect().contains(AppBaseRepository.SHORTCUT_ACTIVE_PROJECT);
}

protected List<QuickMenuItem> getItems() {
Expand Down
6 changes: 6 additions & 0 deletions axelor-project/src/main/resources/domains/AppBase.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,12 @@
<many-to-many name="defaultSitesSet" title="Default sites"
ref="com.axelor.apps.base.db.Site"/>

<extra-code>
<![CDATA[
public static final String SHORTCUT_ACTIVE_PROJECT = "2";
]]>
</extra-code>

</entity>

</domain-models>
4 changes: 0 additions & 4 deletions axelor-project/src/main/resources/domains/AppProject.xml
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,6 @@
<boolean name="enableStatusManagementByTaskCategory"
title="Enable status management by task category"/>

<boolean name="isActivateProjectChangeShortcut" default="false"
title="Activate the project change shortcut"
help="This configuration allows quick access to the active project change"/>

<track>
<field name="projectLabel" on="UPDATE"/>
<field name="resourceManagement" on="UPDATE"/>
Expand Down
1 change: 0 additions & 1 deletion axelor-project/src/main/resources/views/AppProject.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
<field name="isEnablePerProjectTaskSequence" widget="boolean-switch"/>
<field name="defaultPrioritySet" widget="TagSelect" canEdit="false"/>
<field name="selectAutoProgressOnProjectTask"/>
<field name="isActivateProjectChangeShortcut"/>
<field name="fullNameGroovyFormula"/>
<panel title="Custom fields" name="customFieldConfigPanel" colSpan="12" showIf="id">
<panel-related field="taskCustomFieldsList" colSpan="6"
Expand Down
5 changes: 5 additions & 0 deletions axelor-project/src/main/resources/views/Selects.xml
Original file line number Diff line number Diff line change
Expand Up @@ -90,4 +90,9 @@
<option value="project">Project</option>
<option value="version">Version</option>
</selection>

<selection id="projct.base.change.shortcut.select" name="base.change.shortcut.select">
<option value="2">Active project</option>
</selection>

</object-views>

0 comments on commit 2eb3ac8

Please sign in to comment.