67        $this->copy_id = $a_copy_id;
 
   84        if (is_array(self::$instances) and isset(self::$instances[$a_copy_id])) {
 
   85            return self::$instances[$a_copy_id];
 
   98        if (is_array($this->options) && array_key_exists(0, $this->options) && is_array($this->options[0])) {
 
   99            $steps += count($this->options[0]);
 
  101        if (is_array($this->options) && array_key_exists(-1, $this->options) && is_array($this->options[-1])) {
 
  102            $steps += count($this->options[-1]);
 
  122        $query = 
"SELECT * FROM copy_wizard_options " .
 
  123            "WHERE copy_id  = " . 
$ilDB->quote($a_copy_id, 
'integer') . 
" ";
 
  125        return $res->numRows() ? false : 
true;
 
  141        $query = 
"SELECT MAX(copy_id) latest FROM copy_wizard_options ";
 
  145        $ilDB->insert(
"copy_wizard_options", array(
 
  146            "copy_id" => array(
"integer", ((
int) $row->latest) + 1),
 
  147            "source_id" => array(
"integer", 0)
 
  149        return ((
int) $row->latest) + 1;
 
  165        $ilDB->insert(
"copy_wizard_options", array(
 
  166            "copy_id" => array(
"integer", $this->
getCopyId()),
 
  167            "source_id" => array(
"integer", self::OWNER_KEY),
 
  168            "options" => array(
'clob',serialize(array($a_user_id)))
 
  187        $ilDB->insert(
"copy_wizard_options", array(
 
  188            "copy_id" => array(
"integer", $this->
getCopyId()),
 
  189            "source_id" => array(
"integer", self::ROOT_NODE),
 
  190            "options" => array(
'clob',serialize(array($a_root)))
 
  205        return in_array($a_root, $this->
getOptions(self::ROOT_NODE));
 
  235        $ilDB->insert(
"copy_wizard_options", array(
 
  236            "copy_id" => array(
"integer", $this->
getCopyId()),
 
  237            "source_id" => array(
"integer", self::DISABLE_SOAP),
 
  238            "options" => array(
'clob',serialize(array(1)))
 
  255        $ilDB->insert(
"copy_wizard_options", array(
 
  256            "copy_id" => array(
"integer", $this->
getCopyId()),
 
  257            "source_id" => array(
"integer", self::DISABLE_TREE_COPY),
 
  258            "options" => array(
'clob',serialize(array(1)))
 
  268        if (isset($this->options[self::DISABLE_TREE_COPY]) and $this->options[self::DISABLE_TREE_COPY]) {
 
  282        if (isset($this->options[self::DISABLE_SOAP]) and $this->options[self::DISABLE_SOAP]) {
 
  299        return in_array($a_user_id, $this->
getOptions(self::OWNER_KEY));
 
  326        $tree = 
$DIC[
'tree'];
 
  328        $mapping_source = $tree->getParentId($a_source_id);
 
  349        $this->tmp_tree = array();
 
  351        $a_tree_structure = $this->tmp_tree;
 
  353        $ilDB->update(
"copy_wizard_options", array(
 
  354            "options" => array(
'clob',serialize($a_tree_structure))
 
  356            "copy_id" => array(
'integer',$this->
getCopyId()),
 
  357            "source_id" => array(
'integer',0
 
  360        $ilDB->insert(
'copy_wizard_options', array(
 
  361            'copy_id' => array(
'integer',$this->
getCopyId()),
 
  362            'source_id' => array(
'integer',-1),
 
  363            'options' => array(
'clob',serialize($a_tree_structure))
 
  378        if (isset($tree[0]) and is_array($tree[0])) {
 
  419        if (!isset($this->options[$a_id]) or !is_array($this->options[$a_id])) {
 
  423        $this->options[$a_id] = array_slice($this->options[$a_id], 1);
 
  425        $ilDB->update(
'copy_wizard_options', array(
 
  426            'options' => array(
'clob',serialize($this->options[$a_id]))
 
  428            'copy_id' => array(
'integer',$this->
getCopyId()),
 
  429            'source_id' => array(
'integer',$a_id)));
 
  436        if ($node[
'type'] == 
'rolf') {
 
  473        if (isset($this->options[$a_source_id]) and is_array($this->options[$a_source_id])) {
 
  474            return $this->options[$a_source_id];
 
  493        if (!is_array($a_options)) {
 
  497        $query = 
"DELETE FROM copy_wizard_options " .
 
  498            "WHERE copy_id = " . $this->db->quote($this->copy_id, 
'integer') . 
" " .
 
  499            "AND source_id = " . $this->db->quote($a_source_id, 
'integer');
 
  502        $ilDB->insert(
'copy_wizard_options', array(
 
  503            'copy_id' => array(
'integer',$this->copy_id),
 
  504            'source_id' => array(
'integer',$a_source_id),
 
  505            'options' => array(
'clob',serialize($a_options))
 
  524        $query = 
"SELECT * FROM copy_wizard_options " .
 
  525            "WHERE copy_id = " . $this->db->quote($this->copy_id, 
'integer') . 
" " .
 
  526            "AND source_id = -2 ";
 
  530            $mappings = unserialize($row->options);
 
  532        $mappings[$a_source_id] = $a_target_id;
 
  534        $query = 
"DELETE FROM copy_wizard_options " .
 
  535            "WHERE copy_id = " . 
$ilDB->quote($this->
getCopyId(), 
'integer') . 
" " .
 
  536            "AND source_id = -2 ";
 
  540        $ilDB->insert(
'copy_wizard_options', array(
 
  541            'copy_id' => array(
'integer',$this->
getCopyId()),
 
  542            'source_id' => array(
'integer',-2),
 
  543            'options' => array(
'clob',serialize($mappings))
 
  557        if (isset($this->options[-2]) and is_array($this->options[-2])) {
 
  558            return $this->options[-2];
 
  575        if (isset(self::$instances[$this->copy_id])) {
 
  576            unset(self::$instances[$this->copy_id]);
 
  579        $query = 
"DELETE FROM copy_wizard_options " .
 
  580            "WHERE copy_id = " . $this->db->quote($this->copy_id, 
'integer');
 
  597        $query = 
"SELECT * FROM copy_wizard_options " .
 
  598            "WHERE copy_id = " . $this->db->quote($this->copy_id, 
'integer');
 
  601        $this->options = array();
 
  603            $this->options[$row->source_id] = unserialize($row->options);
 
  620        $tree = 
$DIC[
'tree'];
 
  622        $this->tmp_tree[] = $tree->getNodeData($a_source_id);
 
  625        foreach ($tree->getChilds($a_source_id) as $sub_nodes) {
 
  626            $sub_node_ref_id = $sub_nodes[
'child'];
 
  628            $options = $this->options[$sub_node_ref_id];
 
  629            if (
$options[
'type'] == self::COPY_WIZARD_COPY or
 
  630                $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())
const COPY_WIZARD_LINK_TO_TARGET
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.
const COPY_WIZARD_UNDEFINED
__construct($a_copy_id=0)
Private Constructor (Singleton class)
foreach($_POST as $key=> $value) $res