X Tutup
Skip to content

Commit c11edc3

Browse files
author
JanAckermann
committed
enhancement
1 parent 9dcc284 commit c11edc3

File tree

3 files changed

+74
-0
lines changed

3 files changed

+74
-0
lines changed

apps/files/lib/Activity.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,8 @@ protected function translateLong($text, IL10N $l, array $params) {
185185
return (string) $l->t('You deleted %1$s', $params);
186186
case 'deleted_by':
187187
return (string) $l->t('%2$s deleted %1$s', $params);
188+
case 'deleted_by_automation':
189+
return (string) $l->t('%1$s was deleted due to automation rule', $params);
188190
case 'restored_self':
189191
return (string) $l->t('You restored %1$s', $params);
190192
case 'restored_by':
@@ -207,6 +209,8 @@ protected function translateShort($text, IL10N $l, array $params) {
207209
return (string) $l->t('Changed by %2$s', $params);
208210
case 'deleted_by':
209211
return (string) $l->t('Deleted by %2$s', $params);
212+
case 'deleted_by_automation':
213+
return (string) $l->t('%1$s was deleted due to automation rule', $params);
210214
case 'restored_by':
211215
return (string) $l->t('Restored by %2$s', $params);
212216

@@ -236,6 +240,7 @@ public function getSpecialParameterList($app, $text) {
236240
case 'changed_by':
237241
case 'deleted_self':
238242
case 'deleted_by':
243+
case 'deleted_by_automation':
239244
case 'restored_self':
240245
case 'restored_by':
241246
return [

apps/systemtags/lib/Activity/Extension.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ class Extension implements IExtension {
4141
const DELETE_TAG = 'delete_tag';
4242

4343
const ASSIGN_TAG = 'assign_tag';
44+
const ASSIGN_TAG_BY_AUTOMATION = 'assign_tag_by_automation';
4445
const UNASSIGN_TAG = 'unassign_tag';
4546

4647
/** @var IFactory */
@@ -147,6 +148,9 @@ protected function translateShort($text, IL10N $l, array $params) {
147148
return (string) $l->t('You assigned system tag %3$s', $params);
148149
}
149150
return (string) $l->t('%1$s assigned system tag %3$s', $params);
151+
case self::ASSIGN_TAG_BY_AUTOMATION:
152+
$params[2] = $this->convertParameterToTag($params[2], $l);
153+
return (string) $l->t('System tag %3$s was assigned to %2$s due to automation rule', $params);
150154
case self::UNASSIGN_TAG:
151155
$params[2] = $this->convertParameterToTag($params[2], $l);
152156
if ($this->actorIsCurrentUser($params[0])) {
@@ -191,6 +195,9 @@ protected function translateLong($text, IL10N $l, array $params) {
191195
return (string) $l->t('You assigned system tag %3$s to %2$s', $params);
192196
}
193197
return (string) $l->t('%1$s assigned system tag %3$s to %2$s', $params);
198+
case self::ASSIGN_TAG_BY_AUTOMATION:
199+
$params[2] = $this->convertParameterToTag($params[2], $l);
200+
return (string) $l->t('System tag %3$s was assigned to %2$s due to automation rule', $params);
194201
case self::UNASSIGN_TAG:
195202
$params[2] = $this->convertParameterToTag($params[2], $l);
196203
if ($this->actorIsCurrentUser($params[0])) {
@@ -244,6 +251,7 @@ public function getSpecialParameterList($app, $text) {
244251
];
245252

246253
case self::ASSIGN_TAG:
254+
case self::ASSIGN_TAG_BY_AUTOMATION:
247255
case self::UNASSIGN_TAG:
248256
return [
249257
0 => 'username',
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
<?php
2+
/**
3+
* @author Jan Ackermann <jackermann@owncloud.com>
4+
* @author Jannik Stehle <jstehle@owncloud.com>
5+
*
6+
* @copyright Copyright (c) 2021, ownCloud GmbH
7+
* @license AGPL-3.0
8+
*
9+
* This code is free software: you can redistribute it and/or modify
10+
* it under the terms of the GNU Affero General Public License, version 3,
11+
* as published by the Free Software Foundation.
12+
*
13+
* This program is distributed in the hope that it will be useful,
14+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
15+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16+
* GNU Affero General Public License for more details.
17+
*
18+
* You should have received a copy of the GNU Affero General Public License, version 3,
19+
* along with this program. If not, see <http://www.gnu.org/licenses/>
20+
*
21+
*/
22+
23+
namespace OCP\Activity;
24+
25+
/**
26+
* Class Constants
27+
*
28+
* @package OCP
29+
* @since 10.8.0
30+
*/
31+
32+
class DataProvider {
33+
/** @var string */
34+
private static $issuerApp = '';
35+
36+
/**
37+
* Get the issuer app
38+
*
39+
* @return string
40+
*/
41+
public static function getIssuerApp() {
42+
return self::$issuerApp;
43+
}
44+
45+
/**
46+
* Set the issuer app
47+
*
48+
* @param $issuerApp string
49+
*/
50+
public static function setIssuerApp(string $issuerApp) {
51+
self::$issuerApp = $issuerApp;
52+
}
53+
54+
/**
55+
* Clear the data
56+
*
57+
*/
58+
public static function expunge() {
59+
self::$issuerApp = '';
60+
}
61+
}

0 commit comments

Comments
 (0)
X Tutup