33 include_once
'./webservice/soap/classes/class.ilSoapAdministration.php';
49 $this->soap_check =
false;
52 function sendMail($sid,$to,$cc,$bcc,$sender,$subject,$message,$attach)
65 include_once
'Services/Mail/classes/class.ilMimeMail.php';
68 $mmail->autoCheck(
false);
69 $mmail->From($sender);
70 $mmail->To(explode(
',',$to));
71 $mmail->Subject($subject);
72 $mmail->Body($message);
76 $mmail->Cc(explode(
',',$cc));
81 $mmail->Bcc(explode(
',',$bcc));
88 if(strpos($attach,
'#:#') === 0)
90 $attach = substr($attach, strlen(
'#:#'));
91 $attachments = explode(
'#:#', $attach);
95 $attachments = explode(
',', $attach);
97 foreach ($attachments as $attachment)
99 $mmail->Attach($attachment);
104 $ilLog->write(
'SOAP: sendMail(): '.$to.
', '.$cc.
', '.$bcc);
119 include_once
"./Services/MediaObjects/classes/class.ilObjMediaObject.php";
133 include_once
"./Services/MediaObjects/classes/class.ilObjMediaObject.php";
156 include_once(
'Services/CopyWizard/classes/class.ilCopyWizardOptions.php');
160 if(!$cp_options->checkOwner($ilUser->getId()))
162 $ilLog->write(__METHOD__.
': Permission check failed for user id: '.$ilUser->getId().
', copy id: '.$copy_identifier);
167 if(($node = $cp_options->fetchFirstDependenciesNode()) ===
false)
169 $cp_options->deleteAll();
170 $ilLog->write(__METHOD__.
': Finished copy step 2. Copy completed');
176 $options = $cp_options->getOptions($node[
'child']);
178 switch($options[
'type'])
181 $ilLog->write(__METHOD__.
': Omitting node: '.$node[
'obj_id'].
', '.$node[
'title'].
', '.$node[
'type']);
186 $ilLog->write(__METHOD__.
': Nothing to do for node: '.$node[
'obj_id'].
', '.$node[
'title'].
', '.$node[
'type']);
191 $ilLog->write(__METHOD__.
': Start cloning dependencies: '.$node[
'obj_id'].
', '.$node[
'title'].
', '.$node[
'type']);
197 $ilLog->write(__METHOD__.
': No valid action type given for node: '.$node[
'obj_id'].
', '.$node[
'title'].
', '.$node[
'type']);
212 public function ilClone($sid,$copy_identifier)
224 include_once(
'Services/CopyWizard/classes/class.ilCopyWizardOptions.php');
228 if(!$cp_options->checkOwner($ilUser->getId()))
230 $ilLog->write(__METHOD__.
': Permission check failed for user id: '.$ilUser->getId().
', copy id: '.$copy_identifier);
236 if(($node = $cp_options->fetchFirstNode()) ===
false)
238 $ilLog->write(__METHOD__.
': Finished copy step 1. Starting copying of object dependencies...');
243 $options = $cp_options->getOptions($node[
'child']);
246 switch($options[
'type'])
249 $ilLog->write(__METHOD__.
': Omitting node: '.$node[
'obj_id'].
', '.$node[
'title'].
', '.$node[
'type']);
251 $cp_options->appendMapping($node[
'child'],0);
256 $ilLog->write(__METHOD__.
': Start cloning node: '.$node[
'obj_id'].
', '.$node[
'title'].
', '.$node[
'type']);
257 $new_ref_id = $this->
cloneNode($node,$cp_options);
262 $ilLog->write(__METHOD__.
': Start linking node: '.$node[
'obj_id'].
', '.$node[
'title'].
', '.$node[
'type']);
263 $new_ref_id = $this->
linkNode($node,$cp_options);
268 $ilLog->write(__METHOD__.
': No valid action type given for node: '.$node[
'obj_id'].
', '.$node[
'title'].
', '.$node[
'type']);
286 $cp_options->dropFirstNode();
288 if($cp_options->isSOAPEnabled())
291 include_once
'Services/WebServices/SOAP/classes/class.ilSoapClient.php';
292 $soap_client =
new ilSoapClient();
293 $soap_client->setTimeout(1);
294 $soap_client->setResponseTimeout(1);
295 $soap_client->enableWSDL(
true);
296 $soap_client->init();
297 $soap_client->call(
'ilClone',array($sid,$cp_options->getCopyId()));
301 $ilLog->write(__METHOD__.
': Cannot call SOAP server');
303 include_once(
'./webservice/soap/include/inc.soap_functions.php');
313 $cp_options->dropFirstDependenciesNode();
315 if($cp_options->isSOAPEnabled())
318 include_once
'Services/WebServices/SOAP/classes/class.ilSoapClient.php';
319 $soap_client =
new ilSoapClient();
320 $soap_client->setTimeout(1);
321 $soap_client->setResponseTimeout(1);
322 $soap_client->enableWSDL(
true);
323 $soap_client->init();
324 $soap_client->call(
'ilCloneDependencies',array($sid,$cp_options->getCopyId()));
328 $ilLog->write(__METHOD__.
': Cannot call SOAP server');
330 include_once(
'./webservice/soap/include/inc.soap_functions.php');
345 global
$ilLog,$tree,$ilAccess;
349 $source_id = $node[
'child'];
350 $parent_id = $node[
'parent'];
351 $options = $cp_options->getOptions($node[
'child']);
352 $mappings = $cp_options->getMappings();
354 if(!$ilAccess->checkAccess(
'copy',
'',$node[
'child']))
356 $ilLog->write(__METHOD__.
': No copy permission granted: '.$source_id.
', '.$node[
'title'].
', '.$node[
'type']);
360 if(!isset($mappings[$parent_id]))
362 $ilLog->write(__METHOD__.
': Omitting node '.$source_id.
', '.$node[
'title'].
', '.$node[
'type'].
'. No target found.');
369 $ilLog->write(__METHOD__.
': Omitting node '.$source_id.
', '.$node[
'title'].
', '.$node[
'type'].
'. Object has been deleted.');
374 $new_obj = $orig->cloneObject((
int)
$target_id,$cp_options->getCopyId());
376 if(!is_object($new_obj))
378 $ilLog->write(__METHOD__.
': Error copying '.$source_id.
', '.$node[
'title'].
', '.$node[
'type'].
'. No target found.');
383 $cp_options->appendMapping($source_id,$new_obj->getRefId());
384 return $new_obj->getRefId();
398 $source_id = $node[
'child'];
399 $mappings = $cp_options->getMappings();
401 if(!isset($mappings[$source_id]))
403 $ilLog->write(__METHOD__.
': Omitting node '.$source_id.
', '.$node[
'title'].
', '.$node[
'type'].
'. No mapping found.');
409 $orig->cloneDependencies(
$target_id,$cp_options->getCopyId());
424 $source_id = $node[
'child'];
425 $parent_id = $node[
'parent'];
426 $options = $cp_options->getOptions($node[
'child']);
427 $mappings = $cp_options->getMappings();
429 if(!$ilAccess->checkAccess(
'delete',
'',$node[
'child']))
431 $ilLog->write(__METHOD__.
': No delete permission granted: '.$source_id.
', '.$node[
'title'].
', '.$node[
'type']);
435 if(!isset($mappings[$parent_id]))
437 $ilLog->write(__METHOD__.
': Omitting node '.$source_id.
', '.$node[
'title'].
', '.$node[
'type'].
'. No target found.');
443 $new_ref_id = $orig->createReference();
446 $orig->setRefId($new_ref_id);
447 $orig->initDefaultRoles();
452 $ilLog->write(__METHOD__.
': Error linking '.$source_id.
', '.$node[
'title'].
', '.$node[
'type'].
'. No target found.');
457 $cp_options->appendMapping($source_id,$new_ref_id);
476 $msg []=
"(".$err[
"line"].
",".$err[
"col"].
"): ".$err[
"errormessage"];
483 $msg = join(
"\n",$msg);
499 include_once(
'./Services/WebServices/ECS/classes/class.ilECSTaskScheduler.php');
504 $ilLog->write(__METHOD__.
': Starting task execution...');
505 $scheduler->startTaskExecution();