ILIAS  Release_4_4_x_branch Revision 61816
 All Data Structures Namespaces Files Functions Variables Groups Pages
ilMailCronAddressbookSync Class Reference

Address book sync. More...

+ Inheritance diagram for ilMailCronAddressbookSync:
+ Collaboration diagram for ilMailCronAddressbookSync:

Public Member Functions

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

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

Address book sync.

Author
Nadia Ahmad nahma.nosp@m.d@da.nosp@m.tabay.nosp@m..de

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

Member Function Documentation

ilMailCronAddressbookSync::activationWasToggled (   $a_currently_active)

Cron job status was changed.

Parameters
bool$a_currently_active

Reimplemented from ilCronJob.

Definition at line 116 of file class.ilMailCronAddressbookSync.php.

References $ilSetting.

{
global $ilSetting;
// propagate cron-job setting to object setting
$ilSetting->set('cron_upd_adrbook', (bool)$a_currently_active);
}
ilMailCronAddressbookSync::getDefaultScheduleType ( )

Get schedule type.

Returns
int

Reimplemented from ilCronJob.

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

References ilCronJob\SCHEDULE_TYPE_DAILY.

ilMailCronAddressbookSync::getDefaultScheduleValue ( )

Get schedule value.

Returns
int|array

Reimplemented from ilCronJob.

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

{
return;
}
ilMailCronAddressbookSync::getDescription ( )

Get description.

Returns
string

Reimplemented from ilCronJob.

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

References $lng.

{
global $lng;
$lng->loadLanguageModule("mail");
return $lng->txt("cron_update_addressbook_desc");
}
ilMailCronAddressbookSync::getId ( )

Get id.

Returns
string

Reimplemented from ilCronJob.

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

{
return "mail_address_sync";
}
ilMailCronAddressbookSync::getTitle ( )

Get title.

Returns
string

Reimplemented from ilCronJob.

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

References $lng.

{
global $lng;
$lng->loadLanguageModule("mail");
return $lng->txt("cron_update_addressbook");
}
ilMailCronAddressbookSync::hasAutoActivation ( )

Is to be activated on "installation".

Returns
boolean

Reimplemented from ilCronJob.

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

{
return false;
}
ilMailCronAddressbookSync::hasCustomSettings ( )

Has cron job any custom setting which can be edited?

Returns
boolean

Reimplemented from ilCronJob.

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

{
return false;
}
ilMailCronAddressbookSync::hasFlexibleSchedule ( )

Can the schedule be configured?

Returns
boolean

Reimplemented from ilCronJob.

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

{
return false;
}
ilMailCronAddressbookSync::run ( )

Run job.

Returns
ilCronJobResult

Reimplemented from ilCronJob.

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

References $result, $row, and ilCronJobResult\STATUS_OK.

{
global $ilDB;
if($ilDB->getDBType() == 'oracle')
{
$res1 = $ilDB->queryF('
SELECT addressbook.addr_id,
usr_data.firstname,
usr_data.lastname,
(CASE WHEN epref.value = %s THEN usr_data.email ELSE addressbook.email END) email
FROM addressbook
INNER JOIN usr_data ON usr_data.login = addressbook.login
INNER JOIN usr_pref ppref ON ppref.usr_id = usr_data.usr_id AND ppref.keyword = %s AND ppref.value != %s
LEFT JOIN usr_pref epref ON epref.usr_id = usr_data.usr_id AND epref.keyword = %s
WHERE addressbook.auto_update = %s',
array('text', 'text', 'text', 'text', 'integer'),
array('y', 'public_profile', 'n', 'public_email', 1)
);
$stmt = $ilDB->prepare('
UPDATE addressbook
SET firstname = ?,
lastname = ?,
email = ?
WHERE addr_id = ?',
array('text','text','text', 'integer')
);
while($row = $ilDB->fetchAssoc($res1))
{
$ilDB->execute($stmt, array($row['firstname'], $row['lastname'], $row['email'], $row['addr_id']));
}
}
else
{
$ilDB->queryF('
UPDATE addressbook
INNER JOIN usr_data ON usr_data.login = addressbook.login
INNER JOIN usr_pref ppref ON ppref.usr_id = usr_data.usr_id AND ppref.keyword = %s AND ppref.value != %s
LEFT JOIN usr_pref epref ON epref.usr_id = usr_data.usr_id AND epref.keyword = %s
SET
addressbook.firstname = usr_data.firstname,
addressbook.lastname = usr_data.lastname,
addressbook.email = (CASE WHEN epref.value = %s THEN usr_data.email ELSE addressbook.email END)
WHERE addressbook.auto_update = %s',
array('text', 'text', 'text', 'text', 'integer'),
array('public_profile', 'n', 'public_email', 'y', 1)
);
}
return $result;
}

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