mirror of
https://github.com/Combodo/iTop.git
synced 2026-04-25 11:38:44 +02:00
N°3537 run_query : use panel for OQL error
This commit is contained in:
@@ -700,7 +700,7 @@ Dict::Add('CS CZ', 'Czech', 'Čeština', array(
|
||||
'UI:RunQuery:DevelopedOQLCount' => 'Developed OQL for count~~',
|
||||
'UI:RunQuery:ResultSQLCount' => 'Resulting SQL for count~~',
|
||||
'UI:RunQuery:ResultSQL' => 'Resulting SQL~~',
|
||||
'UI:RunQuery:Error' => 'Nastala chyba při provádění dotazu: %1$s',
|
||||
'UI:RunQuery:Error' => 'Nastala chyba při provádění dotazu',
|
||||
'UI:Query:UrlForExcel' => 'URL pro MS-Excel web queries',
|
||||
'UI:Query:UrlV1' => 'Nebyl specifikován seznam sloupců k exportu. Bez této informace nemůže stránka <em>export-V2.php</em> provést export. Pro export všech polí použijte stránku <em>export.php</em>. Pokud však chcete udržet konzistenci v delším časovém horzontu, použijte stávající stránku a specifikujte paramter "fields".',
|
||||
'UI:Schema:Title' => 'iTop schéma objektů',
|
||||
|
||||
@@ -687,7 +687,7 @@ Dict::Add('DA DA', 'Danish', 'Dansk', array(
|
||||
'UI:RunQuery:DevelopedOQLCount' => 'Developed OQL for count~~',
|
||||
'UI:RunQuery:ResultSQLCount' => 'Resulting SQL for count~~',
|
||||
'UI:RunQuery:ResultSQL' => 'Resulting SQL~~',
|
||||
'UI:RunQuery:Error' => 'Der opstod en fejl under afviklingen af forespøgrslen: %1$s',
|
||||
'UI:RunQuery:Error' => 'Der opstod en fejl under afviklingen af forespøgrslen',
|
||||
'UI:Query:UrlForExcel' => 'URL til brug for MS-Excel web forespøgrsler',
|
||||
'UI:Query:UrlV1' => 'The list of fields has been left unspecified. The page <em>export-V2.php</em> cannot be invoked without this information. Therefore, the URL suggested herebelow points to the legacy page: <em>export.php</em>. This legacy version of the export has the following limitation: the list of exported fields may vary depending on the output format and the data model of iTop. Should you want to garantee that the list of exported columns will remain stable on the long run, then you must specify a value for the attribute "Fields" and use the page <em>export-V2.php</em>.~~',
|
||||
'UI:Schema:Title' => 'iTop objekt skema',
|
||||
|
||||
@@ -686,7 +686,7 @@ Dict::Add('DE DE', 'German', 'Deutsch', array(
|
||||
'UI:RunQuery:DevelopedOQLCount' => 'Generierte OQL für Zählung',
|
||||
'UI:RunQuery:ResultSQLCount' => 'Resultierendes SQL für Zählung',
|
||||
'UI:RunQuery:ResultSQL' => 'Resultierendes SQL',
|
||||
'UI:RunQuery:Error' => 'Ein Fehler trat während der Abfrage auf: %1$s auf.',
|
||||
'UI:RunQuery:Error' => 'Ein Fehler trat während der Abfrage auf',
|
||||
'UI:Query:UrlForExcel' => 'URL für MS Excel Web Queries',
|
||||
'UI:Query:UrlV1' => 'Die Liste der Felder wurde nicht spezifiziert. Die Seite <em>export-V2.php</em> kann ohne diese Angabe nicht verarbeitet werden. Deswegen, zeigt die nachstehende URL zu der Legacy-Page: <em>export.php</em>. Diese Legacy-Version des Exports hat folgende Limitierungen: Die Liste exportierter Felder kann, abhängig vom Output-Format und vom Datenmodell von iTop, variieren. Möchten Sie garantieren, dass die Liste aller exportierten Spalten stabil bleibt, müssen Sie einen Wert für das Attribut Feld angeben und die Seite <em>export-V2.php</em> nutzen.',
|
||||
'UI:Schema:Title' => 'iTop Objekte-Schema',
|
||||
|
||||
@@ -710,7 +710,7 @@ Dict::Add('EN US', 'English', 'English', array(
|
||||
'UI:RunQuery:DevelopedOQLCount' => 'Developed OQL for count',
|
||||
'UI:RunQuery:ResultSQLCount' => 'Resulting SQL for count',
|
||||
'UI:RunQuery:ResultSQL' => 'Resulting SQL',
|
||||
'UI:RunQuery:Error' => 'An error occured while running the query: %1$s',
|
||||
'UI:RunQuery:Error' => 'An error occured while running the query',
|
||||
'UI:Query:UrlForExcel' => 'URL to use for MS-Excel web queries',
|
||||
'UI:Query:UrlV1' => 'The list of fields has been left unspecified. The page <em>export-V2.php</em> cannot be invoked without this information. Therefore, the URL suggested here below points to the legacy page: <em>export.php</em>. This legacy version of the export has the following limitation: the list of exported fields may vary depending on the output format and the data model of '.ITOP_APPLICATION_SHORT.'. <br/>Should you want to guarantee that the list of exported columns will remain stable on the long run, then you must specify a value for the attribute "Fields" and use the page <em>export-V2.php</em>.',
|
||||
'UI:Schema:Title' => ITOP_APPLICATION_SHORT.' objects schema',
|
||||
|
||||
@@ -698,7 +698,7 @@ Dict::Add('ES CR', 'Spanish', 'Español, Castellaño', array(
|
||||
'UI:RunQuery:DevelopedOQLCount' => 'Developed OQL for count~~',
|
||||
'UI:RunQuery:ResultSQLCount' => 'Resulting SQL for count~~',
|
||||
'UI:RunQuery:ResultSQL' => 'Resulting SQL~~',
|
||||
'UI:RunQuery:Error' => 'Ha ocurrido un error al ejecutar la consulta: %1$s',
|
||||
'UI:RunQuery:Error' => 'Ha ocurrido un error al ejecutar la consulta',
|
||||
'UI:Query:UrlForExcel' => 'URL para usarse en consultas web de MS-Excel',
|
||||
'UI:Query:UrlV1' => 'La lista de campos se ha dejado sin especificación. La página <em>export-V2.php</em> no puede ser invocada sin está información. Por lo tanto, el URL sugerido abajo apunta a la página legada: <em>export.php</em>. Esta versión legada de exportación tiene la siguiente limitación: la lista de campos exportados puede variar, dependiendo del formato de salida y el modelo de datos de iTop. Desea garantizar que la lista de columnas exportadas permanenzcan estables durante la ejecución, entonces debe especificar un valor para el atributo "Campos" y utilice la página <em>export-V2.php</em>.',
|
||||
'UI:Schema:Title' => 'Esquema de Objetos en iTop',
|
||||
|
||||
@@ -689,7 +689,7 @@ Dict::Add('FR FR', 'French', 'Français', array(
|
||||
'UI:RunQuery:DevelopedOQLCount' => 'OQL développé pour le compte',
|
||||
'UI:RunQuery:ResultSQLCount' => 'SQL généré pour le compte',
|
||||
'UI:RunQuery:ResultSQL' => 'SQL généré',
|
||||
'UI:RunQuery:Error' => 'Une erreur s\'est produite durant l\'exécution de la requête : %1$s',
|
||||
'UI:RunQuery:Error' => 'Une erreur s\'est produite durant l\'exécution de la requête',
|
||||
'UI:Query:UrlForExcel' => 'Lien à copier-coller dans Excel, pour déclarer une source de données à partir du web',
|
||||
'UI:Query:UrlV1' => 'La liste des champs à exporter n\'a pas été spécifiée. La page <em>export-V2.php</em> ne peut pas fonctionner sans cette information. Par conséquent, le lien fourni ci-dessous pointe sur l\'ancienne page: <em>export.php</em>. Cette ancienne version de l\'export présente la limitation suivante : la liste des champs exportés varie en fonction du format de l\'export et du modèle de données. <br/>Si vous devez garantir la stabilité du format de l\'export (liste des colonnes) sur le long terme, alors vous devrez renseigner l\'attribut "Champs" et utiliser la page <em>export-V2.php</em>.',
|
||||
'UI:Schema:Title' => 'Modèle de données iTop',
|
||||
|
||||
@@ -685,7 +685,7 @@ Dict::Add('HU HU', 'Hungarian', 'Magyar', array(
|
||||
'UI:RunQuery:DevelopedOQLCount' => 'Developed OQL for count~~',
|
||||
'UI:RunQuery:ResultSQLCount' => 'Resulting SQL for count~~',
|
||||
'UI:RunQuery:ResultSQL' => 'Resulting SQL~~',
|
||||
'UI:RunQuery:Error' => 'A lekérdezés futtatása közben a következő hiba jelentkezett: %1$s',
|
||||
'UI:RunQuery:Error' => 'A lekérdezés futtatása közben a következő hiba jelentkezett',
|
||||
'UI:Query:UrlForExcel' => 'URL to use for MS-Excel web queries~~',
|
||||
'UI:Query:UrlV1' => 'The list of fields has been left unspecified. The page <em>export-V2.php</em> cannot be invoked without this information. Therefore, the URL suggested herebelow points to the legacy page: <em>export.php</em>. This legacy version of the export has the following limitation: the list of exported fields may vary depending on the output format and the data model of iTop. Should you want to garantee that the list of exported columns will remain stable on the long run, then you must specify a value for the attribute "Fields" and use the page <em>export-V2.php</em>.~~',
|
||||
'UI:Schema:Title' => 'iTop objektum séma',
|
||||
|
||||
@@ -698,7 +698,7 @@ Dict::Add('IT IT', 'Italian', 'Italiano', array(
|
||||
'UI:RunQuery:DevelopedOQLCount' => 'Developed OQL for count~~',
|
||||
'UI:RunQuery:ResultSQLCount' => 'Resulting SQL for count~~',
|
||||
'UI:RunQuery:ResultSQL' => 'Resulting SQL~~',
|
||||
'UI:RunQuery:Error' => 'Si è verificato un errore durante l\'esecuzione della query: %1$s',
|
||||
'UI:RunQuery:Error' => 'Si è verificato un errore durante l\'esecuzione della query',
|
||||
'UI:Query:UrlForExcel' => 'URL to use for MS-Excel web queries~~',
|
||||
'UI:Query:UrlV1' => 'The list of fields has been left unspecified. The page <em>export-V2.php</em> cannot be invoked without this information. Therefore, the URL suggested herebelow points to the legacy page: <em>export.php</em>. This legacy version of the export has the following limitation: the list of exported fields may vary depending on the output format and the data model of iTop. Should you want to garantee that the list of exported columns will remain stable on the long run, then you must specify a value for the attribute "Fields" and use the page <em>export-V2.php</em>.~~',
|
||||
'UI:Schema:Title' => 'iTop schema degli oggetti',
|
||||
|
||||
@@ -685,7 +685,7 @@ Dict::Add('JA JP', 'Japanese', '日本語', array(
|
||||
'UI:RunQuery:DevelopedOQLCount' => 'Developed OQL for count~~',
|
||||
'UI:RunQuery:ResultSQLCount' => 'Resulting SQL for count~~',
|
||||
'UI:RunQuery:ResultSQL' => 'Resulting SQL~~',
|
||||
'UI:RunQuery:Error' => 'クエリ: %1$s 実行時にエラーが発生しました',
|
||||
'UI:RunQuery:Error' => 'An error occured while running the query~~',
|
||||
'UI:Query:UrlForExcel' => 'MS-Excel Webクエリに使用するURL',
|
||||
'UI:Query:UrlV1' => 'The list of fields has been left unspecified. The page <em>export-V2.php</em> cannot be invoked without this information. Therefore, the URL suggested herebelow points to the legacy page: <em>export.php</em>. This legacy version of the export has the following limitation: the list of exported fields may vary depending on the output format and the data model of iTop. Should you want to garantee that the list of exported columns will remain stable on the long run, then you must specify a value for the attribute "Fields" and use the page <em>export-V2.php</em>.~~',
|
||||
'UI:Schema:Title' => 'iTop オブジェクトスキーマ',
|
||||
|
||||
@@ -704,7 +704,7 @@ Dict::Add('NL NL', 'Dutch', 'Nederlands', array(
|
||||
'UI:RunQuery:DevelopedOQLCount' => 'Ontwikkelde OQL voor aantal',
|
||||
'UI:RunQuery:ResultSQLCount' => 'Resulterende SQL voor aantal',
|
||||
'UI:RunQuery:ResultSQL' => 'Resulterende SQL',
|
||||
'UI:RunQuery:Error' => 'Er trad een fout op tijdens het uitvoeren van deze query: %1$s',
|
||||
'UI:RunQuery:Error' => 'Er trad een fout op tijdens het uitvoeren van deze query',
|
||||
'UI:Query:UrlForExcel' => 'URL om te gebruiken voor MS Excel-webquery\'s',
|
||||
'UI:Query:UrlV1' => 'De lijst van velden is leeg gelaten. De pagina <em>export-V2.php</em> kan niet aangeroepen worden zonder deze informatie.Daarom verwijst de onderstaande link naar de oude export-pagina: <em>export.php</em>. Deze verouderde versie heeft enkele beperkingen: de lijst van geëxporteerde velden kan verschillen afhankelijk van het gekozen export-formaat en het datamodel van iTop. Als je wil dat de lijst van geëxporteerde kolommen hetzelfde blijft over lange tijd, dan moet je een waarde opgeven voor het attribuut "Velden" en de pagina <em>export-V2.php</em> gebruiken.',
|
||||
'UI:Schema:Title' => ITOP_APPLICATION_SHORT.' objecten-schema',
|
||||
|
||||
@@ -698,7 +698,7 @@ Dict::Add('PT BR', 'Brazilian', 'Brazilian', array(
|
||||
'UI:RunQuery:DevelopedOQLCount' => 'Developed OQL for count~~',
|
||||
'UI:RunQuery:ResultSQLCount' => 'Resulting SQL for count~~',
|
||||
'UI:RunQuery:ResultSQL' => 'Resulting SQL~~',
|
||||
'UI:RunQuery:Error' => 'Ocorreu um erro ao executar a consulta: %1$s',
|
||||
'UI:RunQuery:Error' => 'Ocorreu um erro ao executar a consulta',
|
||||
'UI:Query:UrlForExcel' => 'URL a ser usada para consultas web MS-Excel',
|
||||
'UI:Query:UrlV1' => 'A lista de campos não foi especificada. A página <em>export-V2.php</em> não pode ser chamada sem essa informação. Portanto, o URL sugerido abaixo aponta para a página herdada: <em>export.php</em>. Essa versão herdada da exportação tem a seguinte limitação: a lista de campos exportados pode variar dependendo do formato de saída e do modelo de dados do iTop. Se você quiser garantir que a lista de colunas exportadas permaneça estável a longo prazo, então você deve especificar um valor para o atributo "Fields" e usar a página <em>export-V2.php</em>.',
|
||||
'UI:Schema:Title' => 'Esquema de objetos',
|
||||
|
||||
@@ -677,7 +677,7 @@ Dict::Add('RU RU', 'Russian', 'Русский', array(
|
||||
'UI:RunQuery:DevelopedOQLCount' => 'Подготовленный OQL для count: ',
|
||||
'UI:RunQuery:ResultSQLCount' => 'Результирующий SQL для count: ',
|
||||
'UI:RunQuery:ResultSQL' => 'Результирующий SQL: ',
|
||||
'UI:RunQuery:Error' => 'Ошибка при выполнении запроса: %1$s',
|
||||
'UI:RunQuery:Error' => 'Ошибка при выполнении запроса',
|
||||
'UI:Query:UrlForExcel' => 'URL-адрес для использования в веб-запросах MS-Excel',
|
||||
'UI:Query:UrlV1' => 'Список полей был оставлен неопределенным. Страница <em>export-V2.php</em> не может быть вызван без этой информации. Поэтому URL-адрес, предложенный здесь ниже, указывает на устаревшую страницу: <em>export.php</ем>. Эта устаревшая версия экспорта имеет следующее ограничение: список экспортируемых полей может варьироваться в зависимости от формата вывода и модели данных iTop. если вы хотите гарантировать, что список экспортируемых столбцов будет оставаться стабильным в долгосрочной перспективе, то вы должны указать значение атрибута "Экспорт. поля" и использовать страницу <em>export-V2.php</ем>.',
|
||||
'UI:Schema:Title' => 'iTop схема объектов',
|
||||
|
||||
@@ -685,7 +685,7 @@ Dict::Add('SK SK', 'Slovak', 'Slovenčina', array(
|
||||
'UI:RunQuery:DevelopedOQLCount' => 'Developed OQL for count~~',
|
||||
'UI:RunQuery:ResultSQLCount' => 'Resulting SQL for count~~',
|
||||
'UI:RunQuery:ResultSQL' => 'Resulting SQL~~',
|
||||
'UI:RunQuery:Error' => 'Vyskytla sa chyba počas dopytu: %1$s',
|
||||
'UI:RunQuery:Error' => 'Vyskytla sa chyba počas dopytu',
|
||||
'UI:Query:UrlForExcel' => 'URL pre použitie MS-Excel webového dopytu',
|
||||
'UI:Query:UrlV1' => 'The list of fields has been left unspecified. The page <em>export-V2.php</em> cannot be invoked without this information. Therefore, the URL suggested here below points to the legacy page: <em>export.php</em>. This legacy version of the export has the following limitation: the list of exported fields may vary depending on the output format and the data model of iTop. <br/>Should you want to guarantee that the list of exported columns will remain stable on the long run, then you must specify a value for the attribute "Fields" and use the page <em>export-V2.php</em>.~~',
|
||||
'UI:Schema:Title' => 'iTop objektová schéma',
|
||||
|
||||
@@ -699,7 +699,7 @@ Dict::Add('TR TR', 'Turkish', 'Türkçe', array(
|
||||
'UI:RunQuery:DevelopedOQLCount' => 'Developed OQL for count~~',
|
||||
'UI:RunQuery:ResultSQLCount' => 'Resulting SQL for count~~',
|
||||
'UI:RunQuery:ResultSQL' => 'Resulting SQL~~',
|
||||
'UI:RunQuery:Error' => 'Sorgu sırasında hata oluştu: %1$s',
|
||||
'UI:RunQuery:Error' => 'Sorgu sırasında hata oluştu',
|
||||
'UI:Query:UrlForExcel' => 'URL to use for MS-Excel web queries~~',
|
||||
'UI:Query:UrlV1' => 'The list of fields has been left unspecified. The page <em>export-V2.php</em> cannot be invoked without this information. Therefore, the URL suggested herebelow points to the legacy page: <em>export.php</em>. This legacy version of the export has the following limitation: the list of exported fields may vary depending on the output format and the data model of iTop. Should you want to garantee that the list of exported columns will remain stable on the long run, then you must specify a value for the attribute "Fields" and use the page <em>export-V2.php</em>.~~',
|
||||
'UI:Schema:Title' => 'iTop objects schema',
|
||||
|
||||
@@ -698,7 +698,7 @@ Dict::Add('ZH CN', 'Chinese', '简体中文', array(
|
||||
'UI:RunQuery:DevelopedOQLCount' => 'Developed OQL for count~~',
|
||||
'UI:RunQuery:ResultSQLCount' => 'Resulting SQL for count~~',
|
||||
'UI:RunQuery:ResultSQL' => 'Resulting SQL~~',
|
||||
'UI:RunQuery:Error' => '运行该查询时发生了一个错误: %1$s',
|
||||
'UI:RunQuery:Error' => '运行该查询时发生了一个错误',
|
||||
'UI:Query:UrlForExcel' => 'URL to use for MS-Excel web queries',
|
||||
'UI:Query:UrlV1' => 'The list of fields has been left unspecified. The page <em>export-V2.php</em> cannot be invoked without this information. Therefore, the URL suggested here below points to the legacy page: <em>export.php</em>. This legacy version of the export has the following limitation: the list of exported fields may vary depending on the output format and the data model of iTop. <br/>Should you want to garantee that the list of exported columns will remain stable on the long run, then you must specify a value for the attribute "Fields" and use the page <em>export-V2.php</em>.',
|
||||
'UI:Schema:Title' => 'iTop 对象模型',
|
||||
|
||||
@@ -292,37 +292,40 @@ EOF
|
||||
|
||||
$oMoreInfoSection = new CollapsibleSection(Dict::S('UI:RunQuery:MoreInfo'), $aMoreInfoBlocks);
|
||||
$oP->AddUiBlock($oMoreInfoSection);
|
||||
}
|
||||
elseif ($sSyntaxError)
|
||||
{
|
||||
if ($e instanceof OqlException)
|
||||
{
|
||||
} elseif ($sSyntaxError) {
|
||||
if ($e instanceof OqlException) {
|
||||
$sWrongWord = $e->GetWrongWord();
|
||||
$aSuggestedWords = $e->GetSuggestions();
|
||||
if (is_array($aSuggestedWords) && count($aSuggestedWords) > 0)
|
||||
{
|
||||
if (is_array($aSuggestedWords) && count($aSuggestedWords) > 0) {
|
||||
$sSuggestedWord = OqlException::FindClosestString($sWrongWord, $aSuggestedWords);
|
||||
|
||||
if (strlen($sSuggestedWord) > 0)
|
||||
{
|
||||
$oP->p('<b>'.Dict::Format('UI:RunQuery:Error', $e->GetIssue().' <em>'.$sWrongWord).'</em></b>');
|
||||
if (strlen($sSuggestedWord) > 0) {
|
||||
$sSyntaxErrorText = $e->GetIssue().'<br><em>'.$sWrongWord.'</em>';
|
||||
$sBefore = substr($sExpression, 0, $e->GetColumn());
|
||||
$sAfter = substr($sExpression, $e->GetColumn() + strlen($sWrongWord));
|
||||
$sFixedExpression = $sBefore.$sSuggestedWord.$sAfter;
|
||||
$sFixedExpressionHtml = $sBefore.'<span style="background-color:yellow">'.$sSuggestedWord.'</span>'.$sAfter;
|
||||
$oP->p("Suggesting: $sFixedExpressionHtml");
|
||||
$oP->add('<button onClick="$(\'textarea[name=expression]\').val(\''.htmlentities(addslashes($sFixedExpression)).'\');">Use this query</button>');
|
||||
}
|
||||
else
|
||||
{
|
||||
$oP->p('<b>'.Dict::Format('UI:RunQuery:Error', $e->getHtmlDesc()).'</b>');
|
||||
$sSyntaxErrorText .= $oP->GetP("Suggesting: $sFixedExpressionHtml");
|
||||
$sEscapedExpression = utils::HtmlEntities(addslashes($sFixedExpression));
|
||||
$sSyntaxErrorText .= $oP->GetP(<<<HTML
|
||||
<button onClick="$('textarea[name=expression]')
|
||||
.val('$sEscapedExpression')
|
||||
.focus();">Use this query</button>
|
||||
HTML
|
||||
);
|
||||
} else {
|
||||
$sSyntaxErrorText = $oP->GetP($e->getHtmlDesc());
|
||||
}
|
||||
} else {
|
||||
$oP->p('<b>'.Dict::Format('UI:RunQuery:Error', $e->getHtmlDesc()).'</b>');
|
||||
$sSyntaxErrorText = $oP->GetP($e->getHtmlDesc());
|
||||
}
|
||||
} else {
|
||||
$oP->p('<b>'.Dict::Format('UI:RunQuery:Error', $e->getMessage()).'</b>');
|
||||
$sSyntaxErrorText = $oP->GetP($e->getMessage());
|
||||
}
|
||||
|
||||
$oSyntaxErrorPanel = AlertFactory::MakeForFailure(Dict::S('UI:RunQuery:Error'), $sSyntaxErrorText);
|
||||
$oSyntaxErrorPanel->SetOpenedByDefault(true);
|
||||
$oP->AddUiBlock($oSyntaxErrorPanel);
|
||||
}
|
||||
}
|
||||
catch (Exception $e) {
|
||||
|
||||
Reference in New Issue
Block a user