ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5
ilDAVCronDiskQuota Class Reference

Soft disk quota notifications. More...

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

Public Member Functions

 getId ()
 
 getTitle ()
 
 getDescription ()
 
 getDefaultScheduleType ()
 
 getDefaultScheduleValue ()
 
 hasAutoActivation ()
 
 hasFlexibleSchedule ()
 
 hasCustomSettings ()
 
 run ()
 
 addCustomSettingsToForm (ilPropertyFormGUI $a_form)
 
 saveCustomSettings (ilPropertyFormGUI $a_form)
 
 addToExternalSettingsForm ($a_form_id, array &$a_fields, $a_is_active)
 
 activationWasToggled ($a_currently_active)
 
- 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...
 
 getValidScheduleTypes ()
 Get all available schedule types. 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)

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

158  {
159  // #12221
160  $settings = new ilSetting('disk_quota');
161  $settings->set('enabled', $a_currently_active);
162 
163  /* objDefinition is not available in setup, we cannot use ilObject
164  require_once 'Services/WebDAV/classes/class.ilObjDiskQuotaSettings.php';
165  $disk_quota_obj = ilObjDiskQuotaSettings::getInstance();
166  $disk_quota_obj->setDiskQuotaEnabled((bool)$a_currently_active);
167  $disk_quota_obj->update();
168  */
169  }
ILIAS Setting Class.

◆ addCustomSettingsToForm()

ilDAVCronDiskQuota::addCustomSettingsToForm ( ilPropertyFormGUI  $a_form)

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

References $lng, ilPropertyFormGUI\addItem(), ilObjDiskQuotaSettings\getInstance(), ilTextInputGUI\setValue(), and ilCheckboxInputGUI\setValue().

85  {
86  global $lng;
87 
88  $lng->loadLanguageModule("file");
89 
90  require_once 'Services/WebDAV/classes/class.ilObjDiskQuotaSettings.php';
91  $disk_quota_obj = ilObjDiskQuotaSettings::getInstance();
92 
93  // Enable disk quota reminder mail
94  $cb_prop_reminder = new ilCheckboxInputGUI($lng->txt("enable_disk_quota_reminder_mail"), "enable_disk_quota_reminder_mail");
95  $cb_prop_reminder->setValue('1');
96  $cb_prop_reminder->setChecked($disk_quota_obj->isDiskQuotaReminderMailEnabled());
97  $cb_prop_reminder->setInfo($lng->txt('disk_quota_reminder_mail_desc'));
98  $a_form->addItem($cb_prop_reminder);
99 
100  // Enable summary mail for certain users
101  $cb_prop_summary= new ilCheckboxInputGUI($lng->txt("enable_disk_quota_summary_mail"), "enable_disk_quota_summary_mail");
102  $cb_prop_summary->setValue(1);
103  $cb_prop_summary->setChecked($disk_quota_obj->isDiskQuotaSummaryMailEnabled());
104  $cb_prop_summary->setInfo($lng->txt('enable_disk_quota_summary_mail_desc'));
105  $a_form->addItem($cb_prop_summary);
106 
107  // Edit disk quota recipients
108  $summary_rcpt = new ilTextInputGUI($lng->txt("disk_quota_summary_rctp"), "disk_quota_summary_rctp");
109  $summary_rcpt->setValue($disk_quota_obj->getSummaryRecipients());
110  $summary_rcpt->setInfo($lng->txt('disk_quota_summary_rctp_desc'));
111  $cb_prop_summary->addSubItem($summary_rcpt);
112  }
This class represents a checkbox property in a property form.
addItem($a_item)
Add Item (Property, SectionHeader).
setValue($a_value)
Set Value.
This class represents a text property in a property form.
global $lng
Definition: privfeed.php:40
setValue($a_value)
Set Value.
static getInstance()
Get settings instance.
+ Here is the call graph for this function:

◆ addToExternalSettingsForm()

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

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

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

127  {
128  global $lng;
129 
130  $lng->loadLanguageModule("file");
131 
132  switch($a_form_id)
133  {
136 
137  require_once('Services/WebDAV/classes/class.ilDiskQuotaActivationChecker.php');
138 
139  $subitems = array(
140  "enable_disk_quota_reminder_mail" => array(
143  ),
144  "enable_disk_quota_summary_mail" => array(
147  )
148  );
149  $a_fields["repository_disk_quota"] = array($a_is_active ?
150  $lng->txt("enabled") :
151  $lng->txt("disabled"),
152  null, $subitems);
153  break;
154  }
155  }
global $lng
Definition: privfeed.php:40
+ Here is the call graph for this function:

◆ getDefaultScheduleType()

ilDAVCronDiskQuota::getDefaultScheduleType ( )

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

36  {
37  return self::SCHEDULE_TYPE_DAILY;
38  }

◆ getDefaultScheduleValue()

ilDAVCronDiskQuota::getDefaultScheduleValue ( )

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

41  {
42  return;
43  }

◆ getDescription()

ilDAVCronDiskQuota::getDescription ( )

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

References $lng.

28  {
29  global $lng;
30 
31  $lng->loadLanguageModule("file");
32  return $lng->txt("repository_disk_quota_info");
33  }
global $lng
Definition: privfeed.php:40

◆ getId()

ilDAVCronDiskQuota::getId ( )

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

15  {
16  return "rep_disk_quota";
17  }

◆ getTitle()

ilDAVCronDiskQuota::getTitle ( )

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

References $lng.

20  {
21  global $lng;
22 
23  $lng->loadLanguageModule("file");
24  return $lng->txt("repository_disk_quota");
25  }
global $lng
Definition: privfeed.php:40

◆ hasAutoActivation()

ilDAVCronDiskQuota::hasAutoActivation ( )

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

46  {
47  return false;
48  }

◆ hasCustomSettings()

ilDAVCronDiskQuota::hasCustomSettings ( )

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

56  {
57  return true;
58  }

◆ hasFlexibleSchedule()

ilDAVCronDiskQuota::hasFlexibleSchedule ( )

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

51  {
52  return false;
53  }

◆ run()

ilDAVCronDiskQuota::run ( )

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

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

61  {
62  require_once'./Services/WebDAV/classes/class.ilDiskQuotaActivationChecker.php';
64  {
65  require_once'./Services/WebDAV/classes/class.ilDiskQuotaChecker.php';
67 
69  {
71  }
72 
74  {
76  }
77  }
78 
79  $result = new ilCronJobResult();
81  return $result;
82  }
static _sendReminderMails()
Sends reminder e-mails to all users who have access and who have exceeded their disk quota and who ha...
$result
static _updateDiskUsageReport()
Updates the disk usage info of all user accounts.
Cron job result data container.
+ Here is the call graph for this function:

◆ saveCustomSettings()

ilDAVCronDiskQuota::saveCustomSettings ( ilPropertyFormGUI  $a_form)

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

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

115  {
116  require_once 'Services/WebDAV/classes/class.ilObjDiskQuotaSettings.php';
117  $disk_quota_obj = ilObjDiskQuotaSettings::getInstance();
118  $disk_quota_obj->setDiskQuotaReminderMailEnabled($_POST['enable_disk_quota_reminder_mail'] == '1');
119  $disk_quota_obj->isDiskQuotaSummaryMailEnabled($_POST['enable_disk_quota_summary_mail'] == '1');
120  $disk_quota_obj->setSummaryRecipients(ilUtil::stripSlashes($_POST['disk_quota_summary_rctp']));
121  $disk_quota_obj->update();
122 
123  return true;
124  }
$_POST['username']
Definition: cron.php:12
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
static getInstance()
Get settings instance.
+ Here is the call graph for this function:

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