ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
ILIAS\Portfolio\Notification\SharedNotification Class Reference
+ Inheritance diagram for ILIAS\Portfolio\Notification\SharedNotification:
+ Collaboration diagram for ILIAS\Portfolio\Notification\SharedNotification:

Public Member Functions

 __construct ()
 
 setSharedToObjectIds (array $a_val)
 
 send ()
 
- Public Member Functions inherited from ilMailNotification
 __construct (protected bool $is_in_wsp=false)
 
 setType (int $a_type)
 
 getType ()
 
 setSender (int $a_usr_id)
 
 getSender ()
 
 setRecipients (array $a_rcp)
 
 getRecipients ()
 
 setAttachments (array $a_att)
 
 getAttachments ()
 
 setLangModules (array $a_modules)
 
 getUserLanguage (int $a_usr_id)
 
 setRefId (int $a_id)
 
 getRefId ()
 
 getObjId ()
 
 setObjId (int $a_obj_id)
 
 getObjType ()
 
 setAdditionalInformation (array $a_info)
 
 getAdditionalInformation ()
 
 sendMail (array $a_rcp, bool $a_parse_recipients=true)
 
 getBlockBorder ()
 

Protected Member Functions

 appendObjectInformation ()
 
 initLanguage (int $a_usr_id)
 
- Protected Member Functions inherited from ilMailNotification
 setSubject (string $a_subject)
 
 getSubject ()
 
 setBody (string $a_body)
 
 appendBody (string $a_body)
 
 getBody ()
 
 initLanguage (int $a_usr_id)
 
 initLanguageByIso2Code (string $a_code='')
 
 setLanguage (ilLanguage $a_language)
 
 getLanguage ()
 
 getLanguageText (string $a_keyword)
 
 getObjectTitle (bool $a_shorten=false)
 
 initMail ()
 
 getMail ()
 
 createPermanentLink (array $a_params=[], string $a_append='')
 
 userToString (int $a_usr_id)
 
 isRefIdAccessible (int $a_user_id, int $a_ref_id, string $a_permission='read')
 

Protected Attributes

array $shared_to_obj_ids = []
 
ilObjUser $user
 
- Protected Attributes inherited from ilMailNotification
int $type
 
int $sender
 
ilMail $mail = null
 
string $subject = ''
 
string $body = ''
 
array $attachments = []
 
ilLanguage $language
 
array $lang_modules = []
 
array $recipients = []
 
int $ref_id
 
int $obj_id = 0
 
string $obj_type = ''
 
array $additional_info = []
 
ilWorkspaceTree $wsp_tree
 
ilWorkspaceAccessHandler $wsp_access_handler
 

Additional Inherited Members

- Data Fields inherited from ilMailNotification
final const int SUBJECT_TITLE_LENGTH = 60
 

Detailed Description

Definition at line 23 of file SharedNotification.php.

Constructor & Destructor Documentation

◆ __construct()

ILIAS\Portfolio\Notification\SharedNotification::__construct ( )

Definition at line 28 of file SharedNotification.php.

29 {
30 global $DIC;
31 $this->user = $DIC->user();
33 }
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc
global $DIC
Definition: shib_login.php:26

References $DIC, ILIAS\GlobalScreen\Provider\__construct(), and ILIAS\Repository\user().

+ Here is the call graph for this function:

Member Function Documentation

◆ appendObjectInformation()

ILIAS\Portfolio\Notification\SharedNotification::appendObjectInformation ( )
protected

Definition at line 72 of file SharedNotification.php.

72 : void
73 {
74 $users = [];
75 foreach ($this->shared_to_obj_ids as $obj_id) {
77 switch ($type) {
78 case "crs":
79 case "grp":
80 $this->appendBody("\n\n" . $this->getLanguage()->txt("obj_" . $type) . ": " .
82 break;
83 case "usr":
85 break;
86 }
87 }
88 if (count($users) > 1) {
89 $this->appendBody("\n\n" . $this->getLanguage()->txt("users") . ": ");
90 $this->appendBody("\n" . implode("\n", $users));
91 }
92 if (count($users) === 1) {
93 $this->appendBody("\n\n" . $this->getLanguage()->txt("user") . ": " . current($users));
94 }
95 if (in_array(\ilWorkspaceAccessGUI::PERMISSION_REGISTERED, $this->shared_to_obj_ids, true)) {
96 $this->appendBody("\n\n" . $this->getLanguage()->txt("wsp_set_permission_registered"));
97 }
98 if (in_array(\ilWorkspaceAccessGUI::PERMISSION_ALL, $this->shared_to_obj_ids, true)) {
99 $this->appendBody("\n\n" . $this->getLanguage()->txt("wsp_set_permission_all"));
100 }
101 if (in_array(\ilWorkspaceAccessGUI::PERMISSION_ALL_PASSWORD, $this->shared_to_obj_ids, true)) {
102 $this->appendBody("\n\n" . $this->getLanguage()->txt("wsp_set_permission_all_password"));
103 }
104 }
static _lookupType(int $id, bool $reference=false)
static _lookupTitle(int $obj_id)
static getNamePresentation( $a_user_id, bool $a_user_image=false, bool $a_profile_link=false, string $a_profile_back_link='', bool $a_force_first_lastname=false, bool $a_omit_login=false, bool $a_sortable=true, bool $a_return_data_array=false, $a_ctrl_path=null)
Default behaviour is:

References ilMailNotification\$obj_id, ilMailNotification\$type, ilObject\_lookupTitle(), ilObject\_lookupType(), ilMailNotification\appendBody(), ilMailNotification\getLanguage(), ilUserUtil\getNamePresentation(), ilWorkspaceAccessGUI\PERMISSION_ALL, ilWorkspaceAccessGUI\PERMISSION_ALL_PASSWORD, and ilWorkspaceAccessGUI\PERMISSION_REGISTERED.

Referenced by ILIAS\Portfolio\Notification\SharedNotification\send().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ initLanguage()

ILIAS\Portfolio\Notification\SharedNotification::initLanguage ( int  $a_usr_id)
protected

Reimplemented from ilMailNotification.

Definition at line 106 of file SharedNotification.php.

106 : void
107 {
108 parent::initLanguage($a_usr_id);
109 $this->getLanguage()->loadLanguageModule('prtf');
110 $this->getLanguage()->loadLanguageModule('wsp');
111 }

References ilMailNotification\getLanguage().

Referenced by ILIAS\Portfolio\Notification\SharedNotification\send().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ send()

ILIAS\Portfolio\Notification\SharedNotification::send ( )

Definition at line 40 of file SharedNotification.php.

40 : bool
41 {
42 $rcp = $this->user->getId();
43
44 $this->initLanguage($rcp);
45 $this->initMail();
46 $this->setSubject(
47 sprintf(
48 $this->getLanguageText('prtf_successfully_shared_prtf'),
49 $this->getObjectTitle(true)
50 )
51 );
52 $this->setBody(\ilMail::getSalutation($rcp, $this->getLanguage()));
53 $this->appendBody("\n\n");
54 $this->appendBody(
55 sprintf(
56 $this->getLanguageText('prtf_successfully_shared_prtf_body'),
57 $this->getObjectTitle(false)
58 )
59 );
61 $this->appendBody("\n\n");
62 $this->appendBody($this->getLanguageText('prtf_permanent_link'));
63 $this->appendBody("\n");
64 $this->appendBody(\ilLink::_getStaticLink($this->getObjId(), "prtf"));
65 $this->getMail()->appendInstallationSignature(true);
66
67 $this->sendMail(array($rcp));
68
69 return true;
70 }
getObjectTitle(bool $a_shorten=false)
sendMail(array $a_rcp, bool $a_parse_recipients=true)
getLanguageText(string $a_keyword)
setSubject(string $a_subject)
static getSalutation(int $a_usr_id, ?ilLanguage $a_language=null)

References ilLink\_getStaticLink(), ilMailNotification\appendBody(), ILIAS\Portfolio\Notification\SharedNotification\appendObjectInformation(), ilMailNotification\getLanguage(), ilMailNotification\getLanguageText(), ilMailNotification\getMail(), ilMailNotification\getObjectTitle(), ilMailNotification\getObjId(), ilMail\getSalutation(), ILIAS\Portfolio\Notification\SharedNotification\initLanguage(), ilMailNotification\initMail(), ilMailNotification\sendMail(), ilMailNotification\setBody(), ilMailNotification\setSubject(), and ILIAS\Repository\user().

+ Here is the call graph for this function:

◆ setSharedToObjectIds()

ILIAS\Portfolio\Notification\SharedNotification::setSharedToObjectIds ( array  $a_val)

Definition at line 35 of file SharedNotification.php.

35 : void
36 {
37 $this->shared_to_obj_ids = $a_val;
38 }

Field Documentation

◆ $shared_to_obj_ids

array ILIAS\Portfolio\Notification\SharedNotification::$shared_to_obj_ids = []
protected

Definition at line 25 of file SharedNotification.php.

◆ $user

ilObjUser ILIAS\Portfolio\Notification\SharedNotification::$user
protected

Definition at line 26 of file SharedNotification.php.


The documentation for this class was generated from the following file: