ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
ilDAVCronDiskQuota Class Reference

Soft disk quota notifications. More...

+ Inheritance diagram for ilDAVCronDiskQuota:
+ Collaboration diagram for ilDAVCronDiskQuota:

Public Member Functions

 getId ()
 Get id. More...
 
 getTitle ()
 Get title. More...
 
 getDescription ()
 Get description. More...
 
 getDefaultScheduleType ()
 Get schedule type. More...
 
 getDefaultScheduleValue ()
 Get schedule value. More...
 
 hasAutoActivation ()
 Is to be activated on "installation". More...
 
 hasFlexibleSchedule ()
 Can the schedule be configured? More...
 
 hasCustomSettings ()
 Has cron job any custom setting which can be edited? More...
 
 run ()
 Run job. More...
 
 addCustomSettingsToForm (ilPropertyFormGUI $a_form)
 Add custom settings to form. More...
 
 saveCustomSettings (ilPropertyFormGUI $a_form)
 Save custom settings. More...
 
 addToExternalSettingsForm ($a_form_id, array &$a_fields, $a_is_active)
 Add external settings to form. More...
 
 activationWasToggled ($a_currently_active)
 Cron job status was changed. More...
 
- Public Member Functions inherited from ilCronJob
 isActive ($a_ts_last_run, $a_schedule_type, $a_schedule_value, $a_manual=false)
 Is job currently active? More...
 
 getScheduleType ()
 Get current schedule type (if flexible) More...
 
 getScheduleValue ()
 Get current schedule value (if flexible) More...
 
 setSchedule ($a_type, $a_value)
 Update current schedule (if flexible) More...
 
 getAllScheduleTypes ()
 Get all available schedule types. More...
 
 getScheduleTypesWithValues ()
 
 getValidScheduleTypes ()
 Returns a collection of all valid schedule types for a specific job. More...
 
 getTitle ()
 Get title. More...
 
 getDescription ()
 Get description. More...
 
 isManuallyExecutable ()
 Defines whether or not a cron job can be started manually. More...
 
 hasCustomSettings ()
 Has cron job any custom setting which can be edited? More...
 
 addCustomSettingsToForm (ilPropertyFormGUI $a_form)
 Add custom settings to form. More...
 
 saveCustomSettings (ilPropertyFormGUI $a_form)
 Save custom settings. More...
 
 addToExternalSettingsForm ($a_form_id, array &$a_fields, $a_is_active)
 Add external settings to form. More...
 
 activationWasToggled ($a_currently_active)
 Cron job status was changed. More...
 
 getId ()
 Get id. More...
 
 hasAutoActivation ()
 Is to be activated on "installation". More...
 
 hasFlexibleSchedule ()
 Can the schedule be configured? More...
 
 getDefaultScheduleType ()
 Get schedule type. More...
 
 getDefaultScheduleValue ()
 Get schedule value. More...
 
 run ()
 Run job. More...
 

Additional Inherited Members

- Data Fields inherited from ilCronJob
const SCHEDULE_TYPE_DAILY = 1
 
const SCHEDULE_TYPE_IN_MINUTES = 2
 
const SCHEDULE_TYPE_IN_HOURS = 3
 
const SCHEDULE_TYPE_IN_DAYS = 4
 
const SCHEDULE_TYPE_WEEKLY = 5
 
const SCHEDULE_TYPE_MONTHLY = 6
 
const SCHEDULE_TYPE_QUARTERLY = 7
 
const SCHEDULE_TYPE_YEARLY = 8
 
- Protected Member Functions inherited from ilCronJob
 checkSchedule ($a_ts_last_run, $a_schedule_type, $a_schedule_value)
 

Detailed Description

Soft disk quota notifications.

Author
Jörg Lützenkirchen luetz.nosp@m.enki.nosp@m.rchen.nosp@m.@lei.nosp@m.fos.c.nosp@m.om

Definition at line 12 of file class.ilDAVCronDiskQuota.php.

Member Function Documentation

◆ activationWasToggled()

ilDAVCronDiskQuota::activationWasToggled (   $a_currently_active)

Cron job status was changed.

Parameters
bool$a_currently_active

Reimplemented from ilCronJob.

Definition at line 152 of file class.ilDAVCronDiskQuota.php.

153 {
154 // #12221
155 $settings = new ilSetting('disk_quota');
156 $settings->set('enabled', $a_currently_active);
157
158 /* objDefinition is not available in setup, we cannot use ilObject
159 $disk_quota_obj = ilObjDiskQuotaSettings::getInstance();
160 $disk_quota_obj->setDiskQuotaEnabled((bool)$a_currently_active);
161 $disk_quota_obj->update();
162 */
163 }
ILIAS Setting Class.

◆ addCustomSettingsToForm()

ilDAVCronDiskQuota::addCustomSettingsToForm ( ilPropertyFormGUI  $a_form)

Add custom settings to form.

Parameters
ilPropertyFormGUI$a_form

Reimplemented from ilCronJob.

Definition at line 81 of file class.ilDAVCronDiskQuota.php.

82 {
83 global $DIC;
84 $lng = $DIC['lng'];
85
86 $lng->loadLanguageModule("file");
87
88 $disk_quota_obj = ilObjDiskQuotaSettings::getInstance();
89
90 // Enable disk quota reminder mail
91 $cb_prop_reminder = new ilCheckboxInputGUI($lng->txt("enable_disk_quota_reminder_mail"), "enable_disk_quota_reminder_mail");
92 $cb_prop_reminder->setValue('1');
93 $cb_prop_reminder->setChecked($disk_quota_obj->isDiskQuotaReminderMailEnabled());
94 $cb_prop_reminder->setInfo($lng->txt('disk_quota_reminder_mail_desc'));
95 $a_form->addItem($cb_prop_reminder);
96
97 // Enable summary mail for certain users
98 $cb_prop_summary = new ilCheckboxInputGUI($lng->txt("enable_disk_quota_summary_mail"), "enable_disk_quota_summary_mail");
99 $cb_prop_summary->setValue(1);
100 $cb_prop_summary->setChecked($disk_quota_obj->isDiskQuotaSummaryMailEnabled());
101 $cb_prop_summary->setInfo($lng->txt('enable_disk_quota_summary_mail_desc'));
102 $a_form->addItem($cb_prop_summary);
103
104 // Edit disk quota recipients
105 $summary_rcpt = new ilTextInputGUI($lng->txt("disk_quota_summary_rctp"), "disk_quota_summary_rctp");
106 $summary_rcpt->setValue($disk_quota_obj->getSummaryRecipients());
107 $summary_rcpt->setInfo($lng->txt('disk_quota_summary_rctp_desc'));
108 $cb_prop_summary->addSubItem($summary_rcpt);
109 }
This class represents a checkbox property in a property form.
static getInstance()
Get settings instance.
addItem($a_item)
Add Item (Property, SectionHeader).
This class represents a text property in a property form.
$lng
$DIC
Definition: xapitoken.php:46

References $DIC, $lng, ilPropertyFormGUI\addItem(), and ilObjDiskQuotaSettings\getInstance().

+ Here is the call graph for this function:

◆ addToExternalSettingsForm()

ilDAVCronDiskQuota::addToExternalSettingsForm (   $a_form_id,
array &  $a_fields,
  $a_is_active 
)

Add external settings to form.

Parameters
int$a_form_id
array$a_fields
bool$a_is_active

Reimplemented from ilCronJob.

Definition at line 122 of file class.ilDAVCronDiskQuota.php.

123 {
124 global $DIC;
125 $lng = $DIC['lng'];
126
127 $lng->loadLanguageModule("file");
128
129 switch ($a_form_id) {
132
133
134 $subitems = array(
135 "enable_disk_quota_reminder_mail" => array(
138 ),
139 "enable_disk_quota_summary_mail" => array(
142 )
143 );
144 $a_fields["repository_disk_quota"] = array($a_is_active ?
145 $lng->txt("enabled") :
146 $lng->txt("disabled"),
147 null, $subitems);
148 break;
149 }
150 }

References $DIC, $lng, ilDiskQuotaActivationChecker\_isReminderMailActive(), ilDiskQuotaActivationChecker\_isSummaryMailActive(), ilAdministrationSettingsFormHandler\FORM_FILES_QUOTA, ilAdministrationSettingsFormHandler\FORM_REPOSITORY, and ilAdministrationSettingsFormHandler\VALUE_BOOL.

+ Here is the call graph for this function:

◆ getDefaultScheduleType()

ilDAVCronDiskQuota::getDefaultScheduleType ( )

Get schedule type.

Returns
int

Reimplemented from ilCronJob.

Definition at line 37 of file class.ilDAVCronDiskQuota.php.

38 {
40 }
const SCHEDULE_TYPE_DAILY

References ilCronJob\SCHEDULE_TYPE_DAILY.

◆ getDefaultScheduleValue()

ilDAVCronDiskQuota::getDefaultScheduleValue ( )

Get schedule value.

Returns
int|array

Reimplemented from ilCronJob.

Definition at line 42 of file class.ilDAVCronDiskQuota.php.

43 {
44 return;
45 }

◆ getDescription()

ilDAVCronDiskQuota::getDescription ( )

Get description.

Returns
string

Reimplemented from ilCronJob.

Definition at line 28 of file class.ilDAVCronDiskQuota.php.

29 {
30 global $DIC;
31 $lng = $DIC['lng'];
32
33 $lng->loadLanguageModule("file");
34 return $lng->txt("repository_disk_quota_info");
35 }

References $DIC, and $lng.

◆ getId()

ilDAVCronDiskQuota::getId ( )

Get id.

Returns
string

Reimplemented from ilCronJob.

Definition at line 14 of file class.ilDAVCronDiskQuota.php.

15 {
16 return "rep_disk_quota";
17 }

◆ getTitle()

ilDAVCronDiskQuota::getTitle ( )

Get title.

Returns
string

Reimplemented from ilCronJob.

Definition at line 19 of file class.ilDAVCronDiskQuota.php.

20 {
21 global $DIC;
22 $lng = $DIC['lng'];
23
24 $lng->loadLanguageModule("file");
25 return $lng->txt("repository_disk_quota");
26 }

References $DIC, and $lng.

◆ hasAutoActivation()

ilDAVCronDiskQuota::hasAutoActivation ( )

Is to be activated on "installation".

Returns
boolean

Reimplemented from ilCronJob.

Definition at line 47 of file class.ilDAVCronDiskQuota.php.

48 {
49 return false;
50 }

◆ hasCustomSettings()

ilDAVCronDiskQuota::hasCustomSettings ( )

Has cron job any custom setting which can be edited?

Returns
boolean

Reimplemented from ilCronJob.

Definition at line 57 of file class.ilDAVCronDiskQuota.php.

58 {
59 return true;
60 }

◆ hasFlexibleSchedule()

ilDAVCronDiskQuota::hasFlexibleSchedule ( )

Can the schedule be configured?

Returns
boolean

Reimplemented from ilCronJob.

Definition at line 52 of file class.ilDAVCronDiskQuota.php.

53 {
54 return false;
55 }

◆ run()

ilDAVCronDiskQuota::run ( )

Run job.

Returns
ilCronJobResult

Reimplemented from ilCronJob.

Definition at line 62 of file class.ilDAVCronDiskQuota.php.

63 {
66
69 }
70
73 }
74 }
75
78 return $result;
79 }
$result
Cron job result data container.
static _updateDiskUsageReport()
Updates the disk usage info of all user accounts.
static _sendReminderMails()
Sends reminder e-mails to all users who have access and who have exceeded their disk quota and who ha...

References $result, ilDiskQuotaActivationChecker\_isActive(), ilDiskQuotaActivationChecker\_isReminderMailActive(), ilDiskQuotaActivationChecker\_isSummaryMailActive(), ilDiskQuotaChecker\_sendReminderMails(), ilDiskQuotaChecker\_sendSummaryMails(), ilDiskQuotaChecker\_updateDiskUsageReport(), and ilCronJobResult\STATUS_OK.

+ Here is the call graph for this function:

◆ saveCustomSettings()

ilDAVCronDiskQuota::saveCustomSettings ( ilPropertyFormGUI  $a_form)

Save custom settings.

Parameters
ilPropertyFormGUI$a_form
Returns
boolean

Reimplemented from ilCronJob.

Definition at line 111 of file class.ilDAVCronDiskQuota.php.

112 {
113 $disk_quota_obj = ilObjDiskQuotaSettings::getInstance();
114 $disk_quota_obj->setDiskQuotaReminderMailEnabled($_POST['enable_disk_quota_reminder_mail'] == '1');
115 $disk_quota_obj->isDiskQuotaSummaryMailEnabled($_POST['enable_disk_quota_summary_mail'] == '1');
116 $disk_quota_obj->setSummaryRecipients(ilUtil::stripSlashes($_POST['disk_quota_summary_rctp']));
117 $disk_quota_obj->update();
118
119 return true;
120 }
$_POST["username"]
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled

References $_POST, ilObjDiskQuotaSettings\getInstance(), and ilUtil\stripSlashes().

+ Here is the call graph for this function:

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