ILIAS  Release_5_0_x_branch Revision 61816
 All Data Structures Namespaces Files Functions Variables Groups Pages
class.ilPaymentCronNotification.php
Go to the documentation of this file.
1 <?php
2 
3 /* Copyright (c) 1998-2009 ILIAS open source, Extended GPL, see docs/LICENSE */
4 
5 include_once "Services/Cron/classes/class.ilCronJob.php";
6 
13 {
14  public function getId()
15  {
16  return "pay_notification";
17  }
18 
19  public function getTitle()
20  {
21  global $lng;
22 
23  return $lng->txt("payment_notification");
24  }
25 
26  public function getDescription()
27  {
28  global $lng;
29 
30  return $lng->txt("payment_notification_desc");
31  }
32 
33  public function getDefaultScheduleType()
34  {
36  }
37 
38  public function getDefaultScheduleValue()
39  {
40  return;
41  }
42 
43  public function hasAutoActivation()
44  {
45  return false;
46  }
47 
48  public function hasFlexibleSchedule()
49  {
50  return false;
51  }
52 
53  public function hasCustomSettings()
54  {
55  return true;
56  }
57 
58  public function run()
59  {
60  require_once 'Services/Payment/classes/class.ilPaymentNotification.php';
61  $msn = new ilPaymentNotification();
62  $msn->send();
63 
64  include_once './Services/Payment/classes/class.ilUserDefinedInvoiceNumber.php';
66  {
67  $msn = new ilUserDefinedInvoiceNumber();
68  $msn->cronCheck();
69  }
70 
71  $result = new ilCronJobResult();
73  return $result;
74  }
75 
76  public function addCustomSettingsToForm(ilPropertyFormGUI $a_form)
77  {
78  global $lng, $ilSetting;
79 
80  $num_days = new ilNumberInputGUI($lng->txt('payment_notification_days'),'payment_notification_days');
81  $num_days->setSize(3);
82  $num_days->setMinValue(0);
83  $num_days->setMaxValue(120);
84  $num_days->setRequired(true);
85  $num_days->setValue($ilSetting->get('payment_notification_days'));
86  $num_days->setInfo($lng->txt('payment_notification_days_desc'));
87  $a_form->addItem($num_days);
88  }
89 
90  public function saveCustomSettings(ilPropertyFormGUI $a_form)
91  {
92  global $ilSetting;
93 
94  $ilSetting->set('payment_notification_days', $_POST['payment_notification_days']);
95 
96  // invoice_number_reset_period is not saved ?!
97  // see: ilObjSystemFolderGUI::saveCronJobsObject() [<= 4.3.x]
98 
99  // see also
100  // - ilObjPaymentSettings::generalSettingsObject()
101  // - ilObjPaymentSettings::saveInvoiceNumberObject()
102 
103  return true;
104  }
105 
106  public function activationWasToggled($a_currently_active)
107  {
108  global $ilSetting;
109 
110  // propagate cron-job setting to object setting
111  $ilSetting->set('payment_notification', (bool)$a_currently_active);
112  }
113 }