mirror of
https://github.com/Combodo/iTop.git
synced 2026-05-18 23:08:46 +02:00
N°1964 - Add informative message on dashboard when its container (eg. an object) is currently in edition
This commit is contained in:
@@ -510,11 +510,15 @@ HTML
|
|||||||
*/
|
*/
|
||||||
public function DisplayDashboard($oPage, $sAttCode)
|
public function DisplayDashboard($oPage, $sAttCode)
|
||||||
{
|
{
|
||||||
|
// Retrieve parameters
|
||||||
|
/** @var bool $bIsContainerInEdition True if the container of the dashboard is currently in edition; meaning that the dashboard could not be up-to-date with data changed in the container (eg. when editing an object and adding linkedset items) */
|
||||||
|
$bIsContainerInEdition = (utils::ReadParam('host_container_in_edition', 'false') === 'true');
|
||||||
|
|
||||||
$sClass = get_class($this);
|
$sClass = get_class($this);
|
||||||
$oAttDef = MetaModel::GetAttributeDef($sClass, $sAttCode);
|
$oAttDef = MetaModel::GetAttributeDef($sClass, $sAttCode);
|
||||||
|
|
||||||
if (!$oAttDef instanceof AttributeDashboard)
|
// Consistency checks
|
||||||
{
|
if (!$oAttDef instanceof AttributeDashboard) {
|
||||||
throw new CoreException(Dict::S('UI:Error:InvalidDashboard'));
|
throw new CoreException(Dict::S('UI:Error:InvalidDashboard'));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -526,6 +530,10 @@ HTML
|
|||||||
|
|
||||||
$bCanEdit = UserRights::IsAdministrator() || $oAttDef->IsUserEditable();
|
$bCanEdit = UserRights::IsAdministrator() || $oAttDef->IsUserEditable();
|
||||||
$sDivId = $oDashboard->GetId();
|
$sDivId = $oDashboard->GetId();
|
||||||
|
|
||||||
|
if ($bIsContainerInEdition) {
|
||||||
|
$oPage->AddUiBlock(AlertUIBlockFactory::MakeForInformation(Dict::S('UI:Dashboard:NotUpToDateUntilContainerSaved')));
|
||||||
|
}
|
||||||
$oPage->add('<div id="'.$sDivId.'" class="ibo-dashboard" data-role="ibo-dashboard">');
|
$oPage->add('<div id="'.$sDivId.'" class="ibo-dashboard" data-role="ibo-dashboard">');
|
||||||
$aExtraParams = array(
|
$aExtraParams = array(
|
||||||
'query_params' => $this->ToArgsForQuery(),
|
'query_params' => $this->ToArgsForQuery(),
|
||||||
@@ -561,17 +569,12 @@ HTML
|
|||||||
$aList = array_keys(MetaModel::ListAttributeDefs(get_class($this)));
|
$aList = array_keys(MetaModel::ListAttributeDefs(get_class($this)));
|
||||||
}
|
}
|
||||||
$sClass = get_class($this);
|
$sClass = get_class($this);
|
||||||
foreach($aList as $sAttCode)
|
foreach($aList as $sAttCode) {
|
||||||
{
|
|
||||||
$oAttDef = MetaModel::GetAttributeDef(get_class($this), $sAttCode);
|
$oAttDef = MetaModel::GetAttributeDef(get_class($this), $sAttCode);
|
||||||
if ($oAttDef instanceof AttributeDashboard)
|
if ($oAttDef instanceof AttributeDashboard) {
|
||||||
{
|
$sHostContainerInEditionUrlParam = ($bEditMode) ? '&host_container_in_edition=true' : '';
|
||||||
if ($bEditMode)
|
|
||||||
{
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
$oPage->AddAjaxTab($oAttDef->GetLabel(),
|
$oPage->AddAjaxTab($oAttDef->GetLabel(),
|
||||||
utils::GetAbsoluteUrlAppRoot().'pages/ajax.render.php?operation=dashboard&class='.get_class($this).'&id='.$this->GetKey().'&attcode='.$oAttDef->GetCode(),
|
utils::GetAbsoluteUrlAppRoot().'pages/ajax.render.php?operation=dashboard&class='.get_class($this).'&id='.$this->GetKey().'&attcode='.$oAttDef->GetCode().$sHostContainerInEditionUrlParam,
|
||||||
true,
|
true,
|
||||||
'Class:'.$sClass.'/Attribute:'.$sAttCode,
|
'Class:'.$sClass.'/Attribute:'.$sAttCode,
|
||||||
AjaxTab::ENUM_TAB_PLACEHOLDER_DASHBOARD);
|
AjaxTab::ENUM_TAB_PLACEHOLDER_DASHBOARD);
|
||||||
|
|||||||
@@ -1204,6 +1204,7 @@ Dict::Add('CS CZ', 'Czech', 'Čeština', array(
|
|||||||
'UI:ImportDashboardTitle' => 'Import ze souboru',
|
'UI:ImportDashboardTitle' => 'Import ze souboru',
|
||||||
'UI:ImportDashboardText' => 'Vyberte šablonu dashboardu k importu:',
|
'UI:ImportDashboardText' => 'Vyberte šablonu dashboardu k importu:',
|
||||||
'UI:Dashboard:Actions' => 'Dashboard actions~~',
|
'UI:Dashboard:Actions' => 'Dashboard actions~~',
|
||||||
|
'UI:Dashboard:NotUpToDateUntilContainerSaved' => 'This dashboard displays information that does not include the on-going changes.~~',
|
||||||
|
|
||||||
|
|
||||||
'UI:DashletCreation:Title' => 'Vytvořit nový dashlet',
|
'UI:DashletCreation:Title' => 'Vytvořit nový dashlet',
|
||||||
|
|||||||
@@ -1195,6 +1195,7 @@ Ved tilknytningen til en trigger, bliver hver handling tildelt et "rækkefølge"
|
|||||||
'UI:ImportDashboardTitle' => 'Importer Fra Fil',
|
'UI:ImportDashboardTitle' => 'Importer Fra Fil',
|
||||||
'UI:ImportDashboardText' => 'Vælg en dashboard fil til import:',
|
'UI:ImportDashboardText' => 'Vælg en dashboard fil til import:',
|
||||||
'UI:Dashboard:Actions' => 'Dashboard actions~~',
|
'UI:Dashboard:Actions' => 'Dashboard actions~~',
|
||||||
|
'UI:Dashboard:NotUpToDateUntilContainerSaved' => 'This dashboard displays information that does not include the on-going changes.~~',
|
||||||
|
|
||||||
|
|
||||||
'UI:DashletCreation:Title' => 'Opret en ny Dashlet',
|
'UI:DashletCreation:Title' => 'Opret en ny Dashlet',
|
||||||
|
|||||||
@@ -1194,6 +1194,7 @@ Wenn Aktionen mit Trigger verknüpft sind, bekommt jede Aktion eine Auftragsnumm
|
|||||||
'UI:ImportDashboardTitle' => 'Import aus einer Datei',
|
'UI:ImportDashboardTitle' => 'Import aus einer Datei',
|
||||||
'UI:ImportDashboardText' => 'Wählen Sie eine Dashboard-Datei zum Import:',
|
'UI:ImportDashboardText' => 'Wählen Sie eine Dashboard-Datei zum Import:',
|
||||||
'UI:Dashboard:Actions' => 'Dashboard actions~~',
|
'UI:Dashboard:Actions' => 'Dashboard actions~~',
|
||||||
|
'UI:Dashboard:NotUpToDateUntilContainerSaved' => 'This dashboard displays information that does not include the on-going changes.~~',
|
||||||
|
|
||||||
|
|
||||||
'UI:DashletCreation:Title' => 'Neues ashlet erzeugen',
|
'UI:DashletCreation:Title' => 'Neues ashlet erzeugen',
|
||||||
|
|||||||
@@ -1219,6 +1219,7 @@ When associated with a trigger, each action is given an "order" number, specifyi
|
|||||||
'UI:ImportDashboardTitle' => 'Import From a File',
|
'UI:ImportDashboardTitle' => 'Import From a File',
|
||||||
'UI:ImportDashboardText' => 'Select a dashboard file to import:',
|
'UI:ImportDashboardText' => 'Select a dashboard file to import:',
|
||||||
'UI:Dashboard:Actions' => 'Dashboard actions',
|
'UI:Dashboard:Actions' => 'Dashboard actions',
|
||||||
|
'UI:Dashboard:NotUpToDateUntilContainerSaved' => 'This dashboard displays information that does not include the on-going changes.',
|
||||||
|
|
||||||
|
|
||||||
'UI:DashletCreation:Title' => 'Create a new Dashlet',
|
'UI:DashletCreation:Title' => 'Create a new Dashlet',
|
||||||
|
|||||||
@@ -1208,6 +1208,7 @@ Cuando se asocien con un disparador, cada acción recibe un número de "orden",
|
|||||||
'UI:ImportDashboardTitle' => 'Importar de un Archivo',
|
'UI:ImportDashboardTitle' => 'Importar de un Archivo',
|
||||||
'UI:ImportDashboardText' => 'Seleccione el Archivo de Panel de Control a Importar:',
|
'UI:ImportDashboardText' => 'Seleccione el Archivo de Panel de Control a Importar:',
|
||||||
'UI:Dashboard:Actions' => 'Dashboard actions~~',
|
'UI:Dashboard:Actions' => 'Dashboard actions~~',
|
||||||
|
'UI:Dashboard:NotUpToDateUntilContainerSaved' => 'This dashboard displays information that does not include the on-going changes.~~',
|
||||||
|
|
||||||
|
|
||||||
'UI:DashletCreation:Title' => 'Crear Dashlet',
|
'UI:DashletCreation:Title' => 'Crear Dashlet',
|
||||||
|
|||||||
@@ -1201,6 +1201,7 @@ Lors de l\'association à un déclencheur, on attribue à chaque action un numé
|
|||||||
'UI:ImportDashboardTitle' => 'Importation depuis un fichier',
|
'UI:ImportDashboardTitle' => 'Importation depuis un fichier',
|
||||||
'UI:ImportDashboardText' => 'Choisissez un fichier de définition de tableau de bord :',
|
'UI:ImportDashboardText' => 'Choisissez un fichier de définition de tableau de bord :',
|
||||||
'UI:Dashboard:Actions' => 'Actions du tableau de bord',
|
'UI:Dashboard:Actions' => 'Actions du tableau de bord',
|
||||||
|
'UI:Dashboard:NotUpToDateUntilContainerSaved' => 'Ce tableau de bord affiche des informations qui ne reflète pas les modifications en cours.',
|
||||||
|
|
||||||
|
|
||||||
'UI:DashletCreation:Title' => 'Créer un Indicateur',
|
'UI:DashletCreation:Title' => 'Créer un Indicateur',
|
||||||
|
|||||||
@@ -1194,6 +1194,7 @@ Akció kiváltó okhoz rendelésekor kap egy sorszámot , amely meghatározza az
|
|||||||
'UI:ImportDashboardTitle' => 'Import From a File~~',
|
'UI:ImportDashboardTitle' => 'Import From a File~~',
|
||||||
'UI:ImportDashboardText' => 'Select a dashboard file to import:~~',
|
'UI:ImportDashboardText' => 'Select a dashboard file to import:~~',
|
||||||
'UI:Dashboard:Actions' => 'Dashboard actions~~',
|
'UI:Dashboard:Actions' => 'Dashboard actions~~',
|
||||||
|
'UI:Dashboard:NotUpToDateUntilContainerSaved' => 'This dashboard displays information that does not include the on-going changes.~~',
|
||||||
|
|
||||||
|
|
||||||
'UI:DashletCreation:Title' => 'Create a new Dashlet~~',
|
'UI:DashletCreation:Title' => 'Create a new Dashlet~~',
|
||||||
|
|||||||
@@ -1207,6 +1207,7 @@ Quando è associata a un trigger, ad ogni azione è assegnato un numero "ordine"
|
|||||||
'UI:ImportDashboardTitle' => 'Import From a File~~',
|
'UI:ImportDashboardTitle' => 'Import From a File~~',
|
||||||
'UI:ImportDashboardText' => 'Select a dashboard file to import:~~',
|
'UI:ImportDashboardText' => 'Select a dashboard file to import:~~',
|
||||||
'UI:Dashboard:Actions' => 'Dashboard actions~~',
|
'UI:Dashboard:Actions' => 'Dashboard actions~~',
|
||||||
|
'UI:Dashboard:NotUpToDateUntilContainerSaved' => 'This dashboard displays information that does not include the on-going changes.~~',
|
||||||
|
|
||||||
|
|
||||||
'UI:DashletCreation:Title' => 'Create a new Dashlet~~',
|
'UI:DashletCreation:Title' => 'Create a new Dashlet~~',
|
||||||
|
|||||||
@@ -1195,6 +1195,7 @@ Dict::Add('JA JP', 'Japanese', '日本語', array(
|
|||||||
'UI:ImportDashboardTitle' => 'ファイルからインポート',
|
'UI:ImportDashboardTitle' => 'ファイルからインポート',
|
||||||
'UI:ImportDashboardText' => 'インポートするダッシュボードファイルを選択ください。:',
|
'UI:ImportDashboardText' => 'インポートするダッシュボードファイルを選択ください。:',
|
||||||
'UI:Dashboard:Actions' => 'Dashboard actions~~',
|
'UI:Dashboard:Actions' => 'Dashboard actions~~',
|
||||||
|
'UI:Dashboard:NotUpToDateUntilContainerSaved' => 'This dashboard displays information that does not include the on-going changes.~~',
|
||||||
|
|
||||||
|
|
||||||
'UI:DashletCreation:Title' => '新しいダッシュレットを作成',
|
'UI:DashletCreation:Title' => '新しいダッシュレットを作成',
|
||||||
|
|||||||
@@ -1209,6 +1209,7 @@ Bij die koppeling wordt aan elke actie een volgorde-nummer gegeven. Dit bepaalt
|
|||||||
'UI:ImportDashboardTitle' => 'Importeer vanuit een bestand',
|
'UI:ImportDashboardTitle' => 'Importeer vanuit een bestand',
|
||||||
'UI:ImportDashboardText' => 'Selecteer een bestand van het dashboard om te importeren:',
|
'UI:ImportDashboardText' => 'Selecteer een bestand van het dashboard om te importeren:',
|
||||||
'UI:Dashboard:Actions' => 'Dashboard actions~~',
|
'UI:Dashboard:Actions' => 'Dashboard actions~~',
|
||||||
|
'UI:Dashboard:NotUpToDateUntilContainerSaved' => 'This dashboard displays information that does not include the on-going changes.~~',
|
||||||
|
|
||||||
|
|
||||||
'UI:DashletCreation:Title' => 'Maak een nieuwe Dashlet aan',
|
'UI:DashletCreation:Title' => 'Maak een nieuwe Dashlet aan',
|
||||||
|
|||||||
@@ -1206,6 +1206,7 @@ When associated with a trigger, each action is given an "order" number, specifyi
|
|||||||
'UI:ImportDashboardTitle' => 'Importar por um arquivo',
|
'UI:ImportDashboardTitle' => 'Importar por um arquivo',
|
||||||
'UI:ImportDashboardText' => 'Selecione um arquivo do painel para importar:',
|
'UI:ImportDashboardText' => 'Selecione um arquivo do painel para importar:',
|
||||||
'UI:Dashboard:Actions' => 'Dashboard actions~~',
|
'UI:Dashboard:Actions' => 'Dashboard actions~~',
|
||||||
|
'UI:Dashboard:NotUpToDateUntilContainerSaved' => 'This dashboard displays information that does not include the on-going changes.~~',
|
||||||
|
|
||||||
|
|
||||||
'UI:DashletCreation:Title' => 'Criar um novo Painel',
|
'UI:DashletCreation:Title' => 'Criar um novo Painel',
|
||||||
|
|||||||
@@ -1206,6 +1206,7 @@ Dict::Add('RU RU', 'Russian', 'Русский', array(
|
|||||||
'UI:ImportDashboardTitle' => 'Импорт из файла',
|
'UI:ImportDashboardTitle' => 'Импорт из файла',
|
||||||
'UI:ImportDashboardText' => 'Выберите файл дашборда для импорта:',
|
'UI:ImportDashboardText' => 'Выберите файл дашборда для импорта:',
|
||||||
'UI:Dashboard:Actions' => 'Dashboard actions~~',
|
'UI:Dashboard:Actions' => 'Dashboard actions~~',
|
||||||
|
'UI:Dashboard:NotUpToDateUntilContainerSaved' => 'This dashboard displays information that does not include the on-going changes.~~',
|
||||||
|
|
||||||
|
|
||||||
'UI:DashletCreation:Title' => 'Создать новый дашлет',
|
'UI:DashletCreation:Title' => 'Создать новый дашлет',
|
||||||
|
|||||||
@@ -1197,6 +1197,7 @@ Keď sú priradené spúštačom, každej akcii je dané číslo "príkazu", šp
|
|||||||
'UI:ImportDashboardTitle' => 'Importovať zo súboru',
|
'UI:ImportDashboardTitle' => 'Importovať zo súboru',
|
||||||
'UI:ImportDashboardText' => 'Zvoľte panel súboru na importovanie:',
|
'UI:ImportDashboardText' => 'Zvoľte panel súboru na importovanie:',
|
||||||
'UI:Dashboard:Actions' => 'Dashboard actions~~',
|
'UI:Dashboard:Actions' => 'Dashboard actions~~',
|
||||||
|
'UI:Dashboard:NotUpToDateUntilContainerSaved' => 'This dashboard displays information that does not include the on-going changes.~~',
|
||||||
|
|
||||||
|
|
||||||
'UI:DashletCreation:Title' => 'Vytvoriť a nový Dashlet',
|
'UI:DashletCreation:Title' => 'Vytvoriť a nový Dashlet',
|
||||||
|
|||||||
@@ -1206,6 +1206,7 @@ Tetikleme gerçekleştiriğinde işlemler tanımlanan sıra numarası ile gerçe
|
|||||||
'UI:ImportDashboardTitle' => 'Import From a File~~',
|
'UI:ImportDashboardTitle' => 'Import From a File~~',
|
||||||
'UI:ImportDashboardText' => 'Select a dashboard file to import:~~',
|
'UI:ImportDashboardText' => 'Select a dashboard file to import:~~',
|
||||||
'UI:Dashboard:Actions' => 'Dashboard actions~~',
|
'UI:Dashboard:Actions' => 'Dashboard actions~~',
|
||||||
|
'UI:Dashboard:NotUpToDateUntilContainerSaved' => 'This dashboard displays information that does not include the on-going changes.~~',
|
||||||
|
|
||||||
|
|
||||||
'UI:DashletCreation:Title' => 'Create a new Dashlet~~',
|
'UI:DashletCreation:Title' => 'Create a new Dashlet~~',
|
||||||
|
|||||||
@@ -1205,6 +1205,7 @@ Dict::Add('ZH CN', 'Chinese', '简体中文', array(
|
|||||||
'UI:ImportDashboardTitle' => '从文件导入',
|
'UI:ImportDashboardTitle' => '从文件导入',
|
||||||
'UI:ImportDashboardText' => '选择要导入的仪表盘文件:',
|
'UI:ImportDashboardText' => '选择要导入的仪表盘文件:',
|
||||||
'UI:Dashboard:Actions' => 'Dashboard actions~~',
|
'UI:Dashboard:Actions' => 'Dashboard actions~~',
|
||||||
|
'UI:Dashboard:NotUpToDateUntilContainerSaved' => 'This dashboard displays information that does not include the on-going changes.~~',
|
||||||
|
|
||||||
|
|
||||||
'UI:DashletCreation:Title' => '创建新组件',
|
'UI:DashletCreation:Title' => '创建新组件',
|
||||||
|
|||||||
Reference in New Issue
Block a user