diff --git a/application/itopwebpage.class.inc.php b/application/itopwebpage.class.inc.php index 56126c734..730376a87 100644 --- a/application/itopwebpage.class.inc.php +++ b/application/itopwebpage.class.inc.php @@ -548,6 +548,7 @@ EOF } $sHtml .= "\n"; } + $this->output_dict_entries(); } if (count($this->a_styles)>0) diff --git a/application/webpage.class.inc.php b/application/webpage.class.inc.php index 6aaf9f632..8828cc266 100644 --- a/application/webpage.class.inc.php +++ b/application/webpage.class.inc.php @@ -57,6 +57,7 @@ class WebPage implements Page protected $s_content; protected $s_deferred_content; protected $a_scripts; + protected $a_dict_entries; protected $a_styles; protected $a_include_scripts; protected $a_include_stylesheets; @@ -76,6 +77,7 @@ class WebPage implements Page $this->s_content = ""; $this->s_deferred_content = ''; $this->a_scripts = array(); + $this->a_dict_entries = array(); $this->a_styles = array(); $this->a_linked_scripts = array(); $this->a_linked_stylesheets = array(); @@ -231,6 +233,16 @@ class WebPage implements Page { // Do nothing silently... this is not supported by this type of page... } + + /** + * Add a dictionary entry for the Javascript side + */ + public function add_dict_entry($s_entryId) + { + $this->a_dict_entries[$s_entryId] = Dict::S($s_entryId); + } + + /** * Add some CSS definitions to the header of the page */ @@ -438,6 +450,7 @@ class WebPage implements Page } echo "\n"; } + $this->output_dict_entries(); foreach($this->a_linked_stylesheets as $a_stylesheet) { if ($a_stylesheet['condition'] != "") @@ -655,5 +668,30 @@ class WebPage implements Page return $sHtml; } + + protected function output_dict_entries() + { + if (count($this->a_dict_entries)>0) + { + echo "\n"; + } + } } ?> \ No newline at end of file diff --git a/core/action.class.inc.php b/core/action.class.inc.php index 5148659cc..6da8620c2 100644 --- a/core/action.class.inc.php +++ b/core/action.class.inc.php @@ -359,10 +359,13 @@ class ActionEmail extends ActionNotification if (isset($aContextArgs['attachments'])) { + $aAttachmentReport = array(); foreach($aContextArgs['attachments'] as $oDocument) { $oEmail->AddAttachment($oDocument->GetData(), $oDocument->GetFileName(), $oDocument->GetMimeType()); + $aAttachmentReport[] = array($oDocument->GetFileName(), $oDocument->GetMimeType(), strlen($oDocument->GetData())); } + $oLog->Set('attachments', $aAttachmentReport); } if (empty($this->m_aMailErrors)) diff --git a/core/attributedef.class.inc.php b/core/attributedef.class.inc.php index f579b9f48..95e87d1ff 100644 --- a/core/attributedef.class.inc.php +++ b/core/attributedef.class.inc.php @@ -4186,7 +4186,11 @@ class AttributeTable extends AttributeDBField // Facilitate things: allow the user to Set the value from a string public function MakeRealValue($proposedValue, $oHostObj) { - if (!is_array($proposedValue)) + if (is_null($proposedValue)) + { + return array(); + } + else if (!is_array($proposedValue)) { return array(0 => array(0 => $proposedValue)); } diff --git a/core/event.class.inc.php b/core/event.class.inc.php index 30a26255d..b022b1b44 100644 --- a/core/event.class.inc.php +++ b/core/event.class.inc.php @@ -176,10 +176,11 @@ class EventNotificationEmail extends EventNotification MetaModel::Init_AddAttribute(new AttributeText("from", array("allowed_values"=>null, "sql"=>"from", "default_value"=>null, "is_null_allowed"=>true, "depends_on"=>array()))); MetaModel::Init_AddAttribute(new AttributeText("subject", array("allowed_values"=>null, "sql"=>"subject", "default_value"=>null, "is_null_allowed"=>true, "depends_on"=>array()))); MetaModel::Init_AddAttribute(new AttributeHTML("body", array("allowed_values"=>null, "sql"=>"body", "default_value"=>null, "is_null_allowed"=>true, "depends_on"=>array()))); + MetaModel::Init_AddAttribute(new AttributeTable("attachments", array("allowed_values"=>null, "sql"=>"attachments", "default_value"=>null, "is_null_allowed"=>true, "depends_on"=>array()))); // Display lists - MetaModel::Init_SetZListItems('details', array('date', 'userinfo', 'message', 'trigger_id', 'action_id', 'object_id', 'to', 'cc', 'bcc', 'from', 'subject', 'body')); // Attributes to be displayed for the complete details - MetaModel::Init_SetZListItems('list', array('date', 'message', 'to', 'subject')); // Attributes to be displayed for a list + MetaModel::Init_SetZListItems('details', array('date', 'userinfo', 'message', 'trigger_id', 'action_id', 'object_id', 'to', 'cc', 'bcc', 'from', 'subject', 'body', 'attachments')); // Attributes to be displayed for the complete details + MetaModel::Init_SetZListItems('list', array('date', 'message', 'to', 'subject', 'attachments')); // Attributes to be displayed for a list // Search criteria // MetaModel::Init_SetZListItems('standard_search', array('name')); // Criteria of the std search form diff --git a/dictionaries/dictionary.itop.core.php b/dictionaries/dictionary.itop.core.php index 1d707cdc7..d538783a7 100644 --- a/dictionaries/dictionary.itop.core.php +++ b/dictionaries/dictionary.itop.core.php @@ -325,6 +325,8 @@ Dict::Add('EN US', 'English', 'English', array( 'Class:EventNotificationEmail/Attribute:subject+' => 'Subject', 'Class:EventNotificationEmail/Attribute:body' => 'Body', 'Class:EventNotificationEmail/Attribute:body+' => 'Body', + 'Class:EventNotificationEmail/Attribute:attachments' => 'Attachments', + 'Class:EventNotificationEmail/Attribute:attachments+' => '', )); // diff --git a/dictionaries/fr.dictionary.itop.core.php b/dictionaries/fr.dictionary.itop.core.php index b829c16da..4bf783398 100644 --- a/dictionaries/fr.dictionary.itop.core.php +++ b/dictionaries/fr.dictionary.itop.core.php @@ -169,6 +169,8 @@ Dict::Add('FR FR', 'French', 'Français', array( 'Class:EventNotificationEmail/Attribute:subject+' => '', 'Class:EventNotificationEmail/Attribute:body' => 'Message', 'Class:EventNotificationEmail/Attribute:body+' => '', + 'Class:EventNotificationEmail/Attribute:attachments' => 'Pièces jointes', + 'Class:EventNotificationEmail/Attribute:attachments+' => '', 'Class:EventIssue' => 'Erreur', 'Class:EventIssue+' => '', 'Class:EventIssue/Attribute:issue' => 'Erreur',