63        $this->copy_id = $a_copy_id;
 
   80        if (is_array(self::$instances) and isset(self::$instances[$a_copy_id])) {
 
   81            return self::$instances[$a_copy_id];
 
   94        if (is_array($this->options) && array_key_exists(0, $this->options) && is_array($this->options[0])) {
 
   95            $steps += count($this->options[0]);
 
   97        if (is_array($this->options) && array_key_exists(-1, $this->options) && is_array($this->options[-1])) {
 
   98            $steps += count($this->options[-1]);
 
  116        $query = 
"SELECT * FROM copy_wizard_options " .
 
  117            "WHERE copy_id  = " . 
$ilDB->quote($a_copy_id, 
'integer') . 
" ";
 
  119        return $res->numRows() ? false : 
true;
 
  133        $query = 
"SELECT MAX(copy_id) latest FROM copy_wizard_options ";
 
  137        $ilDB->insert(
"copy_wizard_options", array(
 
  138            "copy_id" => array(
"integer", ((
int) 
$row->latest) + 1),
 
  139            "source_id" => array(
"integer", 0)
 
  141        return ((
int) 
$row->latest) + 1;
 
  155        $ilDB->insert(
"copy_wizard_options", array(
 
  156            "copy_id"   => array(
"integer", $this->
getCopyId()),
 
  157            "source_id" => array(
"integer", self::OWNER_KEY),
 
  158            "options"   => array(
'clob',serialize(array($a_user_id)))
 
  175        $ilDB->insert(
"copy_wizard_options", array(
 
  176            "copy_id"   => array(
"integer", $this->
getCopyId()),
 
  177            "source_id" => array(
"integer", self::ROOT_NODE),
 
  178            "options"   => array(
'clob',serialize(array($a_root)))
 
  193        return in_array($a_root, $this->
getOptions(self::ROOT_NODE));
 
  209        $ilDB->insert(
"copy_wizard_options", array(
 
  210            "copy_id"   => array(
"integer", $this->
getCopyId()),
 
  211            "source_id" => array(
"integer", self::DISABLE_SOAP),
 
  212            "options"   => array(
'clob',serialize(array(1)))
 
  227        $ilDB->insert(
"copy_wizard_options", array(
 
  228            "copy_id"   => array(
"integer", $this->
getCopyId()),
 
  229            "source_id" => array(
"integer", self::DISABLE_TREE_COPY),
 
  230            "options"   => array(
'clob',serialize(array(1)))
 
  240        if (isset($this->options[self::DISABLE_TREE_COPY]) and $this->options[self::DISABLE_TREE_COPY]) {
 
  254        if (isset($this->options[self::DISABLE_SOAP]) and $this->options[self::DISABLE_SOAP]) {
 
  271        return in_array($a_user_id, $this->
getOptions(self::OWNER_KEY));
 
  298        $mapping_source = $tree->getParentId($a_source_id);
 
  317        $this->tmp_tree = array();
 
  319        $a_tree_structure = $this->tmp_tree;
 
  321        $ilDB->update(
"copy_wizard_options", array(
 
  322            "options"   => array(
'clob',serialize($a_tree_structure))
 
  324            "copy_id"   => array(
'integer',$this->
getCopyId()),
 
  325            "source_id" => array(
'integer',0
 
  328        $ilDB->insert(
'copy_wizard_options', array(
 
  329            'copy_id'   => array(
'integer',$this->
getCopyId()),
 
  330            'source_id' => array(
'integer',-1),
 
  331            'options'   => array(
'clob',serialize($a_tree_structure))
 
  346        if (isset($tree[0]) and is_array($tree[0])) {
 
  385        if (!isset($this->options[$a_id]) or !is_array($this->options[$a_id])) {
 
  389        $this->options[$a_id] = array_slice($this->options[$a_id], 1);
 
  391        $ilDB->update(
'copy_wizard_options', array(
 
  392            'options'   => array(
'clob',serialize($this->options[$a_id]))
 
  394            'copy_id'   => array(
'integer',$this->
getCopyId()),
 
  395            'source_id' => array(
'integer',$a_id)));
 
  402        if ($node[
'type'] == 
'rolf') {
 
  439        if (isset($this->options[$a_source_id]) and is_array($this->options[$a_source_id])) {
 
  440            return $this->options[$a_source_id];
 
  457        if (!is_array($a_options)) {
 
  461        $query = 
"DELETE FROM copy_wizard_options " .
 
  462            "WHERE copy_id = " . $this->db->quote($this->copy_id, 
'integer') . 
" " .
 
  463            "AND source_id = " . $this->db->quote($a_source_id, 
'integer');
 
  466        $ilDB->insert(
'copy_wizard_options', array(
 
  467            'copy_id'   => array(
'integer',$this->copy_id),
 
  468            'source_id' => array(
'integer',$a_source_id),
 
  469            'options'   => array(
'clob',serialize($a_options))
 
  486        $query = 
"SELECT * FROM copy_wizard_options " .
 
  487            "WHERE copy_id = " . $this->db->quote($this->copy_id, 
'integer') . 
" " .
 
  488            "AND source_id = -2 ";
 
  492            $mappings = unserialize(
$row->options);
 
  494        $mappings[$a_source_id] = $a_target_id;
 
  496        $query = 
"DELETE FROM copy_wizard_options " .
 
  497            "WHERE copy_id = " . 
$ilDB->quote($this->
getCopyId(), 
'integer') . 
" " .
 
  498            "AND source_id = -2 ";
 
  502        $ilDB->insert(
'copy_wizard_options', array(
 
  503            'copy_id'   => array(
'integer',$this->
getCopyId()),
 
  504            'source_id' => array(
'integer',-2),
 
  505            'options'   => array(
'clob',serialize($mappings))
 
  519        if (isset($this->options[-2]) and is_array($this->options[-2])) {
 
  520            return $this->options[-2];
 
  535        $query = 
"DELETE FROM copy_wizard_options " .
 
  536            "WHERE copy_id = " . $this->db->quote($this->copy_id, 
'integer');
 
  551        $query = 
"SELECT * FROM copy_wizard_options " .
 
  552            "WHERE copy_id = " . $this->db->quote($this->copy_id, 
'integer');
 
  555        $this->options = array();
 
  557            $this->options[
$row->source_id] = unserialize(
$row->options);
 
  574        $this->tmp_tree[] = $tree->getNodeData($a_source_id);
 
  577        foreach ($tree->getChilds($a_source_id) as $sub_nodes) {
 
  578            $sub_node_ref_id = $sub_nodes[
'child'];
 
  580            $options = $this->options[$sub_node_ref_id];
 
  581            if (
$options[
'type'] == self::COPY_WIZARD_COPY or
 
  582                $options[
'type'] == self::COPY_WIZARD_LINK) {
 
An exception for terminatinating execution or to throw for unit testing.
getMappings()
Get Mappings.
saveOwner($a_user_id)
Save owner for copy.
disableTreeCopy()
Disable copying of tree.
fetchFirstNode()
Fetch first node for cloneObject.
saveRoot($a_root)
Save root node id.
static _allocateCopyId()
Allocate a copy for further entries.
fetchFirstNodeById($a_id)
Get first node of stored tree.
dropFirstNodeById($a_id)
Drop first node by id.
disableSOAP()
Disable soap calls.
checkOwner($a_user_id)
check owner
readTree($a_source_id)
Purge ommitted node recursively.
dropFirstNode()
Drop first node (for cloneObject())
static _getInstance($a_copy_id)
Get instance of copy wizard options.
appendMapping($a_source_id, $a_target_id)
Add mapping of source -> target.
static _isFinished($a_copy_id)
check if copy is finished
deleteAll()
Delete all entries.
initContainer($a_source_id, $a_target_id)
Init container Add copy entry.
isRootNode($a_root)
Is root node.
fetchFirstDependenciesNode()
Fetch first dependencies node.
addEntry($a_source_id, $a_options)
Add new entry.
dropFirstDependenciesNode()
Drop first node (for cloneDependencies())
getOptions($a_source_id)
Get entry by source.
storeTree($a_source_id)
Save tree Stores two copies of the tree structure: id 0 is used for recursive call of cloneObject() i...
isTreeCopyDisabled()
Check if tree copy is enabled.
isSOAPEnabled()
Check if SOAP calls are disabled.
getRequiredSteps()
Get required steps.
__construct($a_copy_id=0)
Private Constructor (Singleton class)
foreach($_POST as $key=> $value) $res