Compare commits

...

6 Commits

26 changed files with 90 additions and 76 deletions

View File

@@ -1886,7 +1886,7 @@ SQL;
CURLOPT_HEADER => false, // don't return the headers in the output
CURLOPT_FOLLOWLOCATION => true, // follow redirects
CURLOPT_ENCODING => "", // handle all encodings
CURLOPT_USERAGENT => "spider", // who am i
CURLOPT_USERAGENT => static::GetConfig()->Get('http.request.user_agent'), // who am i
CURLOPT_AUTOREFERER => true, // set referer on redirect
CURLOPT_CONNECTTIMEOUT => 120, // timeout on connect
CURLOPT_TIMEOUT => 120, // timeout on response
@@ -3040,10 +3040,34 @@ TXT
$aMentionMatches = [];
$sText = html_entity_decode($sText);
preg_match_all('/<a\s*([^>]*)data-object-class="([^"]*)"\s.*data-object-key="([^"]*)"/Ui', $sText, $aMentionMatches);
$aMentionAllowedClasses = MetaModel::GetConfig()->Get('mentions.allowed_classes');
preg_match_all('/<a\s*([^>]*)data-object-class="([^"]*)"\s.*data-object-key="([^"]*)"\s*([^>]*)>(.*)<\/a>/Ui', $sText, $aMentionMatches);
foreach ($aMentionMatches[0] as $iMatchIdx => $sCompleteMatch) {
$sMatchedClass = $aMentionMatches[2][$iMatchIdx];
$sMatchedId = $aMentionMatches[3][$iMatchIdx];
$sMatchedName = $aMentionMatches[5][$iMatchIdx];
// Ensure that what we found is actually configured as a mention
$sMentionPrefix = array_search($sMatchedClass, $aMentionAllowedClasses);
// - No direct configuration for the matched class, let's look for a configuration on parent classes
if (false === $sMentionPrefix) {
$bHasMentionConfigurationForParentClass = false;
foreach (MetaModel::EnumParentClasses($sMatchedClass, ENUM_PARENT_CLASSES_EXCLUDELEAF, false) as $aMatchedParentClass) {
$sMentionPrefix = array_search($aMatchedParentClass, $aMentionAllowedClasses);
if (false !== $sMentionPrefix) {
$bHasMentionConfigurationForParentClass = true;
break;
}
}
if (false === $bHasMentionConfigurationForParentClass) {
continue;
}
}
// - Test if the name starts with $sMentionPrefix (e.g. '@' for 'Contact' class)
if (false === str_starts_with($sMatchedName, $sMentionPrefix)) {
continue;
}
// Prepare array for matched class if not already present
if (!array_key_exists($sMatchedClass, $aMentionedObjects)) {

View File

@@ -1,11 +1,24 @@
<?xml version="1.0" encoding="UTF-8"?>
<itop_design xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="3.3">
<classes>
<class id="ResourceDataFeatureRemoval" _delta="define">
<parent>AbstractResource</parent>
<properties>
<comment>/* Extension management access control. */</comment>
<abstract>true</abstract>
<category>grant_by_profile</category>
</properties>
<presentation/>
<methods/>
</class>
</classes>
<menus>
<menu id="DataFeatureRemovalMenu" xsi:type="WebPageMenuNode" _delta="define">
<rank>30</rank>
<parent>SystemTools</parent>
<url>$pages/exec.php?exec_module=combodo-data-feature-removal&amp;exec_page=index.php&amp;c[menu]=DataFeatureRemovalMenu</url>
<enable_admin_only>1</enable_admin_only>
<enable_class>ResourceDataFeatureRemoval</enable_class>
<enable_action>UR_ACTION_MODIFY</enable_action>
</menu>
</menus>
<module_parameters>

View File

@@ -22,29 +22,7 @@
* @since 2.7.0
*/
const CombodoPortalToolbox = {
/**
* Close all opened modals on the page
* @deprecated 3.1.0 Use CombodoModal.CloseAllModals() instead
*/
CloseAllModals: function() {
CombodoModal.CloseAllModals();
},
/**
* @deprecated 3.1.0 Use CombodoModal.OpenUrlInModal() instead
*/
OpenUrlInModal: function(sTargetUrl, bCloseOtherModals) {
CombodoModal.OpenUrlInModal(sTargetUrl, bCloseOtherModals);
},
/**
* @deprecated 3.1.0 Use CombodoModal.OpenModal() instead
*/
OpenModal: function(oOptions) {
// Default value fallback for calls prior to 3.1.0
if (oOptions.size === undefined) {
oOptions.size = 'lg';
}
return CombodoModal.OpenModal(oOptions);
},
/**
* Generic function to call a specific endpoint with callbacks
*

View File

@@ -216,9 +216,6 @@ class ObjectFormHandlerHelper
$aNavigationRules = $this->oNavigationRuleHelper->PrepareRulesForForm($aFormProperties, $oObject, $bModal);
$aFormData['submit_rule'] = $aNavigationRules['submit'];
$aFormData['cancel_rule'] = $aNavigationRules['cancel'];
/** @deprecated We keep the "xxx_callback" name to keep compatibility with extensions using the portal_form_handler.js widget but they will be removed in a future version. */
$aFormData['submit_callback'] = $aNavigationRules['submit']['url'];
$aFormData['cancel_callback'] = $aNavigationRules['cancel']['url'];
// Preparing renderer
// Note : We might need to distinguish form & renderer endpoints

View File

@@ -286,18 +286,6 @@
};
// user preferences object
const oUserPreferences = new UserPreferences('{{ app['url_generator'].generate('p_preferences_set_preference')|raw }}');
/**
* @param sUrl {string} The URL to append the new param to
* @param sParamName {string} Name of the parameter
* @param sParamValue {string} Value of the param, needs to be already URL encoded
* @return {string} The sUrl parameters with the sParamName / sParamValue append at the right place
* @deprecated 3.0.0 N°4176
*/
var AddParameterToUrl = function(sUrl, sParamName, sParamValue)
{
sUrl += (sUrl.split('?')[1] ? '&':'?') + sParamName + '=' + sParamValue;
return sUrl;
};
// Test is sString is a valid JSON string
// TODO 3.0.0: Move to CombodoGlobalToolbox and deprecate this one
var IsJSONString = function(sString)

View File

@@ -203,6 +203,7 @@
<class id="ResourceDesignerConnectorMenu"/>
<class id="ResourceSystemMenu"/>
<class id="RessourceHybridAuthMenu"/>
<class id="ResourceDataFeatureRemoval"/>
</classes>
</group>
<group id="Event" _delta="define">

View File

@@ -549,6 +549,13 @@
<count_min>0</count_min>
<count_max>0</count_max>
</field>
<field id="related_incident_list" xsi:type="AttributeLinkedSet">
<linked_class>Incident</linked_class>
<ext_key_to_me>parent_request_id</ext_key_to_me>
<edit_mode>add_remove</edit_mode>
<count_min>0</count_min>
<count_max>0</count_max>
</field>
<field id="public_log" xsi:type="AttributeCaseLog">
<sql>public_log</sql>
<default_value/>
@@ -1512,12 +1519,15 @@
<item id="contacts_list">
<rank>20</rank>
</item>
<item id="related_request_list">
<item id="workorders_list">
<rank>30</rank>
</item>
<item id="workorders_list">
<item id="related_request_list">
<rank>40</rank>
</item>
<item id="related_incident_list">
<rank>45</rank>
</item>
<item id="col:col1">
<rank>50</rank>
<items>

View File

@@ -217,6 +217,8 @@ Dict::Add('CS CZ', 'Czech', 'Čeština', [
'Class:UserRequest/Attribute:parent_change_ref+' => '',
'Class:UserRequest/Attribute:parent_incident_ref' => 'Parent incident ref~~',
'Class:UserRequest/Attribute:parent_incident_ref+' => '~~',
'Class:UserRequest/Attribute:related_incident_list' => 'Child Incidents~~',
'Class:UserRequest/Attribute:related_incident_list+' => 'All the incidents that are linked to this parent request~~',
'Class:UserRequest/Attribute:related_request_list' => 'Podřízené požadavky',
'Class:UserRequest/Attribute:related_request_list+' => 'Všechny požadavky spojené s tímto nadřízeným požadavkem',
'Class:UserRequest/Attribute:public_log' => 'Veřejný záznam',

View File

@@ -216,6 +216,8 @@ Dict::Add('DA DA', 'Danish', 'Dansk', [
'Class:UserRequest/Attribute:parent_change_ref+' => '',
'Class:UserRequest/Attribute:parent_incident_ref' => 'Parent incident ref~~',
'Class:UserRequest/Attribute:parent_incident_ref+' => '~~',
'Class:UserRequest/Attribute:related_incident_list' => 'Child Incidents~~',
'Class:UserRequest/Attribute:related_incident_list+' => 'All the incidents that are linked to this parent request~~',
'Class:UserRequest/Attribute:related_request_list' => 'Afledte Anmodninger',
'Class:UserRequest/Attribute:related_request_list+' => 'All the requests that are linked to this parent request~~',
'Class:UserRequest/Attribute:public_log' => 'Offentlig Log',

View File

@@ -216,6 +216,8 @@ Dict::Add('DE DE', 'German', 'Deutsch', [
'Class:UserRequest/Attribute:parent_change_ref+' => '',
'Class:UserRequest/Attribute:parent_incident_ref' => 'Parent-Incident-Referenz',
'Class:UserRequest/Attribute:parent_incident_ref+' => '',
'Class:UserRequest/Attribute:related_incident_list' => 'Abgeleitete Incidents',
'Class:UserRequest/Attribute:related_incident_list+' => 'Alle Incidents, die mit dieser Benutzeranfrage verknüpft sind',
'Class:UserRequest/Attribute:related_request_list' => 'Abgeleitete Requests',
'Class:UserRequest/Attribute:related_request_list+' => 'Alle abgeleitete Anfragen, die mit dieser Benutzeranfrage verknüpft sind',
'Class:UserRequest/Attribute:public_log' => 'Öffentliches Log',

View File

@@ -212,6 +212,8 @@ Dict::Add('EN US', 'English', 'English', [
'Class:UserRequest/Attribute:parent_change_ref+' => '',
'Class:UserRequest/Attribute:parent_incident_ref' => 'Parent incident ref',
'Class:UserRequest/Attribute:parent_incident_ref+' => '',
'Class:UserRequest/Attribute:related_incident_list' => 'Child Incidents',
'Class:UserRequest/Attribute:related_incident_list+' => 'All the incidents that are linked to this parent request',
'Class:UserRequest/Attribute:related_request_list' => 'Child Requests',
'Class:UserRequest/Attribute:related_request_list+' => 'All the requests that are linked to this parent request',
'Class:UserRequest/Attribute:public_log' => 'Public log',

View File

@@ -210,6 +210,8 @@ Dict::Add('EN GB', 'British English', 'British English', [
'Class:UserRequest/Attribute:parent_change_ref+' => '',
'Class:UserRequest/Attribute:parent_incident_ref' => 'Parent incident ref',
'Class:UserRequest/Attribute:parent_incident_ref+' => '',
'Class:UserRequest/Attribute:related_incident_list' => 'Child Incidents~~',
'Class:UserRequest/Attribute:related_incident_list+' => 'All the incidents that are linked to this parent request~~',
'Class:UserRequest/Attribute:related_request_list' => 'Child Requests',
'Class:UserRequest/Attribute:related_request_list+' => 'All the requests that are linked to this parent request',
'Class:UserRequest/Attribute:public_log' => 'Public log',

View File

@@ -213,8 +213,10 @@ Dict::Add('ES CR', 'Spanish', 'Español, Castellano', [
'Class:UserRequest/Attribute:parent_change_ref+' => 'Ref. Cambio',
'Class:UserRequest/Attribute:parent_incident_ref' => 'Ref. Inciente Padre',
'Class:UserRequest/Attribute:parent_incident_ref+' => 'Ref. Inciente Padre',
'Class:UserRequest/Attribute:related_incident_list' => 'Incidentes Relacionados',
'Class:UserRequest/Attribute:related_incident_list+' => 'Todos los incidentes que están vinculados a este requerimiento padre',
'Class:UserRequest/Attribute:related_request_list' => 'Requerimientos Hijo',
'Class:UserRequest/Attribute:related_request_list+' => 'Requerimientos Hijo',
'Class:UserRequest/Attribute:related_request_list+' => 'Todos los requerimientos que están vinculados a este requerimiento padre',
'Class:UserRequest/Attribute:public_log' => 'Bitácora Pública',
'Class:UserRequest/Attribute:public_log+' => 'Bitácora Pública',
'Class:UserRequest/Attribute:user_satisfaction' => 'Satisfacción del Usuario',

View File

@@ -217,6 +217,8 @@ Dict::Add('FR FR', 'French', 'Français', [
'Class:UserRequest/Attribute:parent_change_ref+' => '',
'Class:UserRequest/Attribute:parent_incident_ref' => 'Référence Incident parent',
'Class:UserRequest/Attribute:parent_incident_ref+' => '',
'Class:UserRequest/Attribute:related_incident_list' => 'Incidents fils',
'Class:UserRequest/Attribute:related_incident_list+' => 'Tous les incidents liés à cette requête parente',
'Class:UserRequest/Attribute:related_request_list' => 'Requêtes filles',
'Class:UserRequest/Attribute:related_request_list+' => 'Toutes les requêtes liées à cette requête parente',
'Class:UserRequest/Attribute:related_request_list/UI:Links:Create:Button+' => 'Créer une %4$s',

View File

@@ -215,6 +215,8 @@ Dict::Add('HU HU', 'Hungarian', 'Magyar', [
'Class:UserRequest/Attribute:parent_change_ref+' => '~~',
'Class:UserRequest/Attribute:parent_incident_ref' => 'Referenciaszám.',
'Class:UserRequest/Attribute:parent_incident_ref+' => '~~',
'Class:UserRequest/Attribute:related_incident_list' => 'Child Incidents~~',
'Class:UserRequest/Attribute:related_incident_list+' => 'All the incidents that are linked to this parent request~~',
'Class:UserRequest/Attribute:related_request_list' => 'Kapcsolódó kérelmek',
'Class:UserRequest/Attribute:related_request_list+' => 'Ehhez a kérelemhez kapcsolódó kérelmek',
'Class:UserRequest/Attribute:public_log' => 'Nyilvános napló',

View File

@@ -215,6 +215,8 @@ Dict::Add('IT IT', 'Italian', 'Italiano', [
'Class:UserRequest/Attribute:parent_change_ref+' => '~~',
'Class:UserRequest/Attribute:parent_incident_ref' => 'Riferimento incidente padre',
'Class:UserRequest/Attribute:parent_incident_ref+' => '~~',
'Class:UserRequest/Attribute:related_incident_list' => 'Child Incidents~~',
'Class:UserRequest/Attribute:related_incident_list+' => 'All the incidents that are linked to this parent request~~',
'Class:UserRequest/Attribute:related_request_list' => 'Richiesta figlia',
'Class:UserRequest/Attribute:related_request_list+' => 'Tutte le richieste legate a questa richiesta padre',
'Class:UserRequest/Attribute:public_log' => 'Log pubblico',

View File

@@ -215,6 +215,8 @@ Dict::Add('JA JP', 'Japanese', '日本語', [
'Class:UserRequest/Attribute:parent_change_ref+' => '',
'Class:UserRequest/Attribute:parent_incident_ref' => 'Parent incident ref~~',
'Class:UserRequest/Attribute:parent_incident_ref+' => '~~',
'Class:UserRequest/Attribute:related_incident_list' => 'Child Incidents~~',
'Class:UserRequest/Attribute:related_incident_list+' => 'All the incidents that are linked to this parent request~~',
'Class:UserRequest/Attribute:related_request_list' => '子要求',
'Class:UserRequest/Attribute:related_request_list+' => 'All the requests that are linked to this parent request~~',
'Class:UserRequest/Attribute:public_log' => '公開ログ',

View File

@@ -216,6 +216,8 @@ Dict::Add('NL NL', 'Dutch', 'Nederlands', [
'Class:UserRequest/Attribute:parent_change_ref+' => '',
'Class:UserRequest/Attribute:parent_incident_ref' => 'Ref. hoofdincident',
'Class:UserRequest/Attribute:parent_incident_ref+' => '',
'Class:UserRequest/Attribute:related_incident_list' => 'Child Incidents~~',
'Class:UserRequest/Attribute:related_incident_list+' => 'All the incidents that are linked to this parent request~~',
'Class:UserRequest/Attribute:related_request_list' => 'Subverzoeken',
'Class:UserRequest/Attribute:related_request_list+' => 'Alle verzoeken die gerelateerd zijn aan dit hoofdverzoek',
'Class:UserRequest/Attribute:public_log' => 'Publieke log',

View File

@@ -215,6 +215,8 @@ Dict::Add('PL PL', 'Polish', 'Polski', [
'Class:UserRequest/Attribute:parent_change_ref+' => '',
'Class:UserRequest/Attribute:parent_incident_ref' => 'Powiązany źródłowy incydent',
'Class:UserRequest/Attribute:parent_incident_ref+' => '',
'Class:UserRequest/Attribute:related_incident_list' => 'Child Incidents~~',
'Class:UserRequest/Attribute:related_incident_list+' => 'All the incidents that are linked to this parent request~~',
'Class:UserRequest/Attribute:related_request_list' => 'Zależne zgłoszenia',
'Class:UserRequest/Attribute:related_request_list+' => 'Wszystkie zgłoszenia powiązane ze zgłoszeniem nadrzędnym',
'Class:UserRequest/Attribute:public_log' => 'Dziennik publiczny',

View File

@@ -215,6 +215,8 @@ Dict::Add('PT BR', 'Brazilian', 'Brazilian', [
'Class:UserRequest/Attribute:parent_change_ref+' => '',
'Class:UserRequest/Attribute:parent_incident_ref' => 'Ref. incidente pai',
'Class:UserRequest/Attribute:parent_incident_ref+' => '',
'Class:UserRequest/Attribute:related_incident_list' => 'Child Incidents~~',
'Class:UserRequest/Attribute:related_incident_list+' => 'All the incidents that are linked to this parent request~~',
'Class:UserRequest/Attribute:related_request_list' => 'Subsolicitações',
'Class:UserRequest/Attribute:related_request_list+' => 'Todas as solicitações associadas à esta solicitação pai',
'Class:UserRequest/Attribute:public_log' => 'Log público',

View File

@@ -216,6 +216,8 @@ Dict::Add('RU RU', 'Russian', 'Русский', [
'Class:UserRequest/Attribute:parent_change_ref+' => '',
'Class:UserRequest/Attribute:parent_incident_ref' => 'Родительский инцидент',
'Class:UserRequest/Attribute:parent_incident_ref+' => '',
'Class:UserRequest/Attribute:related_incident_list' => 'Child Incidents~~',
'Class:UserRequest/Attribute:related_incident_list+' => 'All the incidents that are linked to this parent request~~',
'Class:UserRequest/Attribute:related_request_list' => 'Дочерние запросы',
'Class:UserRequest/Attribute:related_request_list+' => 'Дочерние запросы',
'Class:UserRequest/Attribute:public_log' => 'Общий журнал',

View File

@@ -215,6 +215,8 @@ Dict::Add('SK SK', 'Slovak', 'Slovenčina', [
'Class:UserRequest/Attribute:parent_change_ref+' => '~~',
'Class:UserRequest/Attribute:parent_incident_ref' => 'Parent incident ref~~',
'Class:UserRequest/Attribute:parent_incident_ref+' => '~~',
'Class:UserRequest/Attribute:related_incident_list' => 'Child Incidents~~',
'Class:UserRequest/Attribute:related_incident_list+' => 'All the incidents that are linked to this parent request~~',
'Class:UserRequest/Attribute:related_request_list' => 'Podriadené požiadavky',
'Class:UserRequest/Attribute:related_request_list+' => 'All the requests that are linked to this parent request~~',
'Class:UserRequest/Attribute:public_log' => 'Verejný záznam',

View File

@@ -215,6 +215,8 @@ Dict::Add('TR TR', 'Turkish', 'Türkçe', [
'Class:UserRequest/Attribute:parent_change_ref+' => '~~',
'Class:UserRequest/Attribute:parent_incident_ref' => 'Parent incident ref~~',
'Class:UserRequest/Attribute:parent_incident_ref+' => '~~',
'Class:UserRequest/Attribute:related_incident_list' => 'Child Incidents~~',
'Class:UserRequest/Attribute:related_incident_list+' => 'All the incidents that are linked to this parent request~~',
'Class:UserRequest/Attribute:related_request_list' => 'Child Requests~~',
'Class:UserRequest/Attribute:related_request_list+' => 'All the requests that are linked to this parent request~~',
'Class:UserRequest/Attribute:public_log' => 'Public log~~',

View File

@@ -212,6 +212,8 @@ Dict::Add('ZH CN', 'Chinese', '简体中文', [
'Class:UserRequest/Attribute:parent_change_ref+' => '',
'Class:UserRequest/Attribute:parent_incident_ref' => '父级事件编号',
'Class:UserRequest/Attribute:parent_incident_ref+' => '~~',
'Class:UserRequest/Attribute:related_incident_list' => 'Child Incidents~~',
'Class:UserRequest/Attribute:related_incident_list+' => 'All the incidents that are linked to this parent request~~',
'Class:UserRequest/Attribute:related_request_list' => '子需求',
'Class:UserRequest/Attribute:related_request_list+' => '此父级需求相关的所有衍生需求',
'Class:UserRequest/Attribute:public_log' => '公共日志',

View File

@@ -304,37 +304,6 @@ if ($bInstall) {
if (!$bRes) {
echo "\nencountered installation issues!";
$bFoundIssues = true;
} else {
try {
$sDeltaFile = APPROOT.'data/'.$sTargetEnvironment.'.delta.xml';
if (is_readable($sDeltaFile)) {
$oMysqli = CMDBSource::GetMysqliInstance($sDBServer, $sDBUser, $sDBPwd, null, $bDBTlsEnabled, $sDBTlsCa, true);
if ($oMysqli->select_db($sDBName)) {
// Check the presence of a table to record information about the MTP (from the Designer)
$sDesignerUpdatesTable = $sDBPrefix.'priv_designer_update';
$sSQL = "SELECT id FROM `$sDesignerUpdatesTable`";
if ($oMysqli->query($sSQL) !== false) {
// Record the Designer Udpates in the priv_designer_update table
// Retrieve the revision
$oDoc = new DOMDocument();
$oDoc->load($sDeltaFile);
$iRevision = 0;
$iRevision = $oDoc->firstChild->getAttribute('revision_id');
if ($iRevision > 0) { // Safety net, just in case...
$sDate = date('Y-m-d H:i:s');
$sSQL = "INSERT INTO `$sDesignerUpdatesTable` (revision_id, compilation_date, comment) VALUES ($iRevision, '$sDate', 'Deployed using unattended.php.')";
if ($oMysqli->query($sSQL) !== false) {
echo "\nDesigner update (MTP at revision $iRevision) successfully recorded.\n";
} else {
echo "\nFailed to record designer updates(".$oMysqli->error.").\n";
}
}
}
}
}
} catch (MySQLException $e) {
// Continue anyway
}
}
} else {
echo "No installation requested.\n";

View File

@@ -25,7 +25,7 @@ class Form extends UIContentBlock
/** @var string */
protected $sAction;
/** @var string */
protected $sEncType = "multipart/form-data";
protected $sEncType = "application/x-www-form-urlencoded";
public function __construct(?string $sId = null)
{