Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion datamodel.itop-standard-email-synchro.xml
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,11 @@
<default_value/>
<is_null_allowed>true</is_null_allowed>
</field>
<field id="ticket_updates_log_attcode" xsi:type="AttributeString">
<sql>ticket_updates_log_attcode</sql>
<default_value>public_log</default_value>
<is_null_allowed>false</is_null_allowed>
</field>
<field id="title_pattern" xsi:type="AttributeString">
<sql>title_pattern</sql>
<default_value/>
Expand Down Expand Up @@ -833,7 +838,7 @@ EOF
}

// Determine which field to update
$sAttCode = 'public_log';
$sAttCode = $this->Get('ticket_updates_log_attcode');
$aAttCodes = MetaModel::GetModuleSetting('itop-standard-email-synchro', 'ticket_log', array('UserRequest' => 'public_log', 'Incident' => 'public_log'));
Comment thread
Molkobain marked this conversation as resolved.
Outdated
if (array_key_exists(get_class($oTicket), $aAttCodes))
{
Comment on lines 840 to 844
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

$sAttCode will get overwritten by this default module setting..

Should this setting be obsoleted and ignored maybe?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

You are right, I'll fix it!

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I just changed the conf. param. default value to an empty array; but actually the whole conf. param. should be obsoleted you are right.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

What about existing/upgrading users? They will still have the setting from previous install. Also new users will have this setting as it is still present in module file.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

That's why obsoleting the param. and removing the line from the code is the best way IMHO.

For existing users, we should check the existing conf. param. and apply the corresponding value to existing mail inboxes. I missed that!

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

That could be an action during setup (after database creation) for example..

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Totally

Expand Down Expand Up @@ -1476,6 +1481,9 @@ EOF
<item id="ticket_default_title">
<rank>60</rank>
</item>
<item id="ticket_updates_log_attcode">
<rank>65</rank>
</item>
<item id="title_pattern">
<rank>70</rank>
</item>
Expand Down
2 changes: 2 additions & 0 deletions en.dict.itop-standard-email-synchro.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@

'Class:MailInboxStandard/Attribute:ticket_default_values' => 'Ticket Default Values',
'Class:MailInboxStandard/Attribute:ticket_default_title' => 'Default Title (if subject is empty)',
'Class:MailInboxStandard/Attribute:ticket_updates_log_attcode' => 'Ticket log for new messages',
'Class:MailInboxStandard/Attribute:ticket_updates_log_attcode+' => 'Attribute code of the log (eg. public_log, private_log, ...) in which new messages will be added',
'Class:MailInboxStandard/Attribute:title_pattern+' => 'Pattern to match in the subject',
'Class:MailInboxStandard/Attribute:title_pattern' => 'Title Pattern',
'Class:MailInboxStandard/Attribute:title_pattern?' => 'Use PCRE syntax, including starting and ending delimiters',
Expand Down
2 changes: 2 additions & 0 deletions fr.dict.itop-standard-email-synchro.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@

'Class:MailInboxStandard/Attribute:ticket_default_values' => 'Valeurs par défaut du Ticket',
'Class:MailInboxStandard/Attribute:ticket_default_title' => 'Titre par défaut (en cas de sujet vide)',
'Class:MailInboxStandard/Attribute:ticket_updates_log_attcode' => 'Journal pour nouveaux messages',
'Class:MailInboxStandard/Attribute:ticket_updates_log_attcode+' => 'Code de l\'attribut (ex : public_log, private_log, ...) qui sera utilisé pour ajouter les nouveaux messages',
'Class:MailInboxStandard/Attribute:title_pattern+' => 'Expression régulière à rechercher dans l\'objet de l\'eMail',
'Class:MailInboxStandard/Attribute:title_pattern' => 'Recherche dans l\'objet du mail (RegExp)',
'Class:MailInboxStandard/Attribute:title_pattern?' => 'Utilisez la syntaxe PCRE avec les délimiteurs de début et de fin',
Expand Down