part.share.php
3.53 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
<?php
$calid = isset($_['calendar']) ? $_['calendar'] : null;
$eventid = isset($_['eventid']) ? $_['eventid'] : null;
$calsharees = array();
$eventsharees = array();
$sharedwithByCalendar = OCP\Share::getItemShared('calendar', $calid);
$sharedwithByEvent = OCP\Share::getItemShared('event', $eventid);
if(is_array($sharedwithByCalendar)) {
foreach($sharedwithByCalendar as $share) {
if($share['share_type'] == OCP\Share::SHARE_TYPE_USER || $share['share_type'] == OCP\Share::SHARE_TYPE_GROUP) {
$calsharees[] = $share;
}
}
}
if(is_array($sharedwithByEvent)) {
foreach($sharedwithByEvent as $share) {
if($share['share_type'] == OCP\Share::SHARE_TYPE_USER || $share['share_type'] == OCP\Share::SHARE_TYPE_GROUP) {
$eventsharees[] = $share;
}
}
}
?>
<label for="sharewith"><?php p($l->t('Share with:')); ?></label>
<input type="text" id="sharewith" data-item-source="<?php p($eventid); ?>" /><br />
<strong><?php p($l->t('Shared with')); ?></strong>
<ul class="sharedby eventlist">
<?php foreach($eventsharees as $sharee): ?>
<li data-share-with="<?php p($sharee['share_with']); ?>"
data-item="<?php p($eventid); ?>"
data-item-type="event"
data-permissions="<?php p($sharee['permissions']); ?>"
data-share-type="<?php p($sharee['share_type']); ?>">
<?php p($sharee['share_with'] . ' (' . ($sharee['share_type'] == OCP\Share::SHARE_TYPE_USER ? 'user' : 'group'). ')'); ?>
<span class="shareactions">
<input class="update" type="checkbox" <?php p(($sharee['permissions'] & OCP\PERMISSION_UPDATE?'checked="checked"':''))?>
title="<?php p($l->t('Editable')); ?>">
<input class="share" type="checkbox" <?php p(($sharee['permissions'] & OCP\PERMISSION_SHARE?'checked="checked"':''))?>
title="<?php p($l->t('Shareable')); ?>">
<input class="delete" type="checkbox" <?php p(($sharee['permissions'] & OCP\PERMISSION_DELETE?'checked="checked"':''))?>
title="<?php p($l->t('Deletable')); ?>">
<img src="<?php p(OCP\Util::imagePath('core', 'actions/delete.svg')); ?>" class="svg action delete"
title="<?php p($l->t('Unshare')); ?>">
</span>
</li>
<?php endforeach; ?>
</ul>
<?php if(!$eventsharees) {
$nobody = $l->t('Nobody');
print_unescaped('<div id="sharedWithNobody">' . OC_Util::sanitizeHTML($nobody) . '</div>');
} ?>
<br />
<strong><?php p($l->t('Shared via calendar')); ?></strong>
<ul class="sharedby calendarlist">
<?php foreach($calsharees as $sharee): ?>
<li data-share-with="<?php p($sharee['share_with']); ?>"
data-item="<?php p($calid); ?>"
data-item-type="calendar"
data-permissions="<?php p($sharee['permissions']); ?>"
data-share-type="<?php p($sharee['share_type']); ?>">
<?php p($sharee['share_with'] . ' (' . ($sharee['share_type'] == OCP\Share::SHARE_TYPE_USER ? 'user' : 'group'). ')'); ?>
<span class="shareactions">
<input class="update" type="checkbox" <?php p(($sharee['permissions'] & OCP\PERMISSION_UPDATE?'checked="checked"':''))?>
title="<?php p($l->t('Editable')); ?>">
<input class="share" type="checkbox" <?php p(($sharee['permissions'] & OCP\PERMISSION_SHARE?'checked="checked"':''))?>
title="<?php p($l->t('Shareable')); ?>">
<input class="delete" type="checkbox" <?php p(($sharee['permissions'] & OCP\PERMISSION_DELETE?'checked="checked"':''))?>
title="<?php p($l->t('Deletable')); ?>">
<img src="<?php p(OCP\Util::imagePath('core', 'actions/delete.svg')); ?>" class="svg action delete"
title="<?php p($l->t('Unshare')); ?>">
</span>
</li>
<?php endforeach; ?>
</ul>
<br />
<?php p($l->t('NOTE: Actions on events shared via calendar will affect the entire calendar sharing.')); ?>