40 $this->lng->loadLanguageModule(
'search');
42 $this->parent_obj = $a_parent_gui;
55 $next_class = $ilCtrl->getNextClass($this);
56 $cmd = $ilCtrl->getCmd();
77 $this->
setMode(self::SEARCH_SOURCE);
79 $ilCtrl->setParameter($this,
'new_type',$this->
getType());
80 $ilCtrl->setParameterByClass(get_class($this->parent_obj),
'new_type', $this->
getType());
81 $ilCtrl->setParameterByClass(get_class($this->parent_obj),
'cpfl', 1);
82 $ilCtrl->setReturnByClass(get_class($this->parent_obj),
'create');
84 elseif(
$_REQUEST[
'selectMode'] == self::SOURCE_SELECTION)
86 $this->
setMode(self::SOURCE_SELECTION);
88 $ilCtrl->setParameterByClass(get_class($this->parent_obj),
'selectMode', self::SOURCE_SELECTION);
90 $ilCtrl->setReturnByClass(get_class($this->parent_obj),
'');
94 $this->
setMode(self::TARGET_SELECTION);
95 $ilCtrl->setReturnByClass(get_class($this->parent_obj),
'');
112 $_SESSION[
'paste_copy_repexpand'] = array();
118 $path = $tree->getPathId((
int)
$_GET[
'source_id']);
119 foreach((array)
$path as $node_id)
121 if(!in_array($node_id,
$_SESSION[
'paste_copy_repexpand']))
122 $_SESSION[
'paste_copy_repexpand'][] = $node_id;
125 $this->
setMode(self::TARGET_SELECTION);
126 $this->
setSource((
int) $_GET[
'source_id']);
132 $ilCtrl->setReturnByClass(get_class($this->parent_obj),
'');
146 $_SESSION[
'paste_copy_repexpand'] = array();
151 $this->
setMode(self::SOURCE_SELECTION);
157 foreach((array)
$path as $node_id)
159 if(!in_array($node_id,
$_SESSION[
'paste_copy_repexpand']))
160 $_SESSION[
'paste_copy_repexpand'][] = $node_id;
163 $ilCtrl->setReturnByClass(get_class($this->parent_obj),
'');
173 global $ilTabs, $ilToolbar,
$ilCtrl, $tree,
$tpl, $objDefinition;
176 $this->tpl->addBlockfile(
'ADM_CONTENT',
'adm_content',
'tpl.paste_into_multiple_objects.html');
180 include_once
'classes/class.ilPasteIntoMultipleItemsExplorer.php';
183 'repository.php?cmd=goto',
'paste_copy_repexpand');
184 $exp->setExpandTarget($ilCtrl->getLinkTarget($this,
'showTargetSelectionTree'));
185 $exp->setTargetGet(
'ref_id');
186 $exp->setPostVar(
'target');
187 $exp->setCheckedItems(array((
int)
$_POST[
'target']));
190 foreach(array(
'cat',
'root',
'crs',
'grp',
'fold') as $container)
198 $sub = $objDefinition->getSubObjects($container);
199 if(!isset($sub[$this->
getType()]))
201 $exp->removeFormItemForType($container);
205 if(
$_GET[
'paste_copy_repexpand'] ==
'')
207 $expanded = $tree->readRootId();
211 $expanded =
$_GET[
'paste_copy_repexpand'];
214 $this->tpl->setVariable(
'FORM_TARGET',
'_self');
215 $this->tpl->setVariable(
'FORM_ACTION', $ilCtrl->getFormAction($this,
'copySelection'));
217 $exp->setExpand($expanded);
220 $output = $exp->getOutput();
222 $this->tpl->setVariable(
'OBJECT_TREE', $output);
224 $this->tpl->setVariable(
'CMD_SUBMIT',
'saveTarget');
226 if($objDefinition->isContainer($this->getType()))
228 $this->tpl->setVariable(
'TXT_SUBMIT',$this->lng->txt(
'btn_next'));
232 if(!$objDefinition->isPlugin($this->getType()))
234 $submit = $this->lng->txt(
'obj_'.$this->
getType().
'_duplicate');
239 include_once
"Services/Component/classes/class.ilPlugin.php";
242 $submit = $plugin->txt(
'obj_'.$this->
getType().
'_duplicate');
244 $this->tpl->setVariable(
'TXT_SUBMIT', $submit);
247 $ilToolbar->addButton($this->lng->txt(
'cancel'), $ilCtrl->getLinkTarget($this,
'cancel'));
256 global $ilTabs, $ilToolbar,
$ilCtrl, $tree,
$tpl, $objDefinition;
259 $this->tpl->addBlockfile(
'ADM_CONTENT',
'adm_content',
'tpl.paste_into_multiple_objects.html');
263 include_once
'classes/class.ilPasteIntoMultipleItemsExplorer.php';
266 'repository.php?cmd=goto',
'paste_copy_repexpand');
268 $ilCtrl->setParameter($this,
'selectMode', self::SOURCE_SELECTION);
269 $exp->setExpandTarget($ilCtrl->getLinkTarget($this,
'showSourceSelectionTree'));
270 $exp->setTargetGet(
'ref_id');
271 $exp->setPostVar(
'source');
272 $exp->setCheckedItems(array($this->
getSource()));
273 #$exp->setNotSelectableItems(array($this->getTarget()));
276 foreach(array(
'cat',
'root',
'grp',
'fold') as $container)
278 $exp->removeFormItemForType($container);
282 if(
$_GET[
'paste_copy_repexpand'] ==
'')
284 $expanded = $tree->readRootId();
288 $expanded =
$_GET[
'paste_copy_repexpand'];
291 $this->tpl->setVariable(
'FORM_TARGET',
'_self');
292 $this->tpl->setVariable(
'FORM_ACTION', $ilCtrl->getFormAction($this,
'copySelection'));
294 $exp->setExpand($expanded);
297 $output = $exp->getOutput();
299 $this->tpl->setVariable(
'OBJECT_TREE', $output);
301 $this->tpl->setVariable(
'CMD_SUBMIT',
'saveSource');
302 $this->tpl->setVariable(
'TXT_SUBMIT', $this->lng->txt(
'btn_next'));
304 $ilToolbar->addButton($this->lng->txt(
'cancel'), $ilCtrl->getLinkTarget($this,
'cancel'));
313 global $objDefinition;
315 if(isset(
$_POST[
'target']))
326 if($objDefinition->isContainer($this->getType()))
343 $this->mode = $a_mode;
430 $ilCtrl->returnToParent($this);
452 $this->form->setValuesByPost();
454 if(!$this->form->checkInput())
457 $ilCtrl->returnToParent($this);
461 include_once
'./Services/Search/classes/class.ilQueryParser.php';
462 $query_parser =
new ilQueryParser($this->form->getInput(
'tit'));
465 $query_parser->parse();
466 if(!$query_parser->validate())
469 $ilCtrl->returnToParent($this);
473 include_once
'Services/Search/classes/Like/class.ilLikeObjectSearch.php';
475 $object_search->setFilter(array(
$_REQUEST[
'new_type']));
476 $res = $object_search->performSearch();
477 $res->setRequiredPermission(
'copy');
478 $res->filter(ROOT_FOLDER_ID,
true);
483 $ilCtrl->returnToParent($this);
486 include_once
'./Services/Object/classes/class.ilObjectCopySearchResultTableGUI.php';
488 $table->setSelectedReference($this->
getSource());
489 $table->parseSearchResults(
$results);
490 $tpl->setContent($table->getHTML());
499 global $objDefinition;
501 if(isset(
$_POST[
'source']))
512 if($objDefinition->isContainer($this->getType()))
540 include_once
'./Services/Object/classes/class.ilObjectCopySelectionTableGUI.php';
542 $tpl->addJavaScript(
'./Services/CopyWizard/js/ilContainer.js');
543 $tpl->setVariable(
'BODY_ATTRIBUTES',
'onload="ilDisableChilds(\'cmd\');"');
547 case self::SOURCE_SELECTION:
548 $back_cmd =
'showSourceSelectionTree';
551 case self::TARGET_SELECTION:
552 $back_cmd =
'showTargetSelectionTree';
555 case self::SEARCH_SOURCE:
556 $back_cmd =
'searchSource';
563 $tpl->setContent($table->getHTML());
572 include_once(
'classes/class.ilLink.php');
573 include_once(
'Services/CopyWizard/classes/class.ilCopyWizardOptions.php');
575 global $ilAccess,
$ilErr,$rbacsystem,$ilUser,
$ilCtrl,$rbacreview;
578 if(!$rbacsystem->checkAccess(
'create', $this->getTarget(), $this->
getType()))
581 $ilCtrl->returnToParent($this);
587 $ilCtrl->returnToParent($this);
590 if(!$ilAccess->checkAccess(
'copy',
'',$this->getSource()))
593 $ilCtrl->returnToParent($this);
599 $wizard_options->saveOwner($ilUser->getId());
600 $wizard_options->saveRoot((
int) $this->
getSource());
610 $wizard_options->read();
613 $new_obj = $orig->cloneObject($this->
getTarget(),$copy_id);
616 $wizard_options->deleteAll();
619 include_once
"Services/AccessControl/classes/class.ilRbacLog.php";
622 $rbac_log_roles = $rbacreview->getParentRoleIds($new_obj->getRefId(),
false);
639 include_once(
'classes/class.ilLink.php');
640 include_once(
'Services/CopyWizard/classes/class.ilCopyWizardOptions.php');
651 if(!$rbacsystem->checkAccess(
'create', $this->getTarget(),$this->
getType()))
654 $ilCtrl->returnToParent($this);
660 $ilCtrl->returnToParent($this);
664 $options =
$_POST[
'cp_options'] ?
$_POST[
'cp_options'] : array();
704 $tpl->setVariable($a_tplvar,$this->form->getHTML());
732 include_once
'./Services/Form/classes/class.ilPropertyFormGUI.php';
734 $this->form->setTableWidth(
'600px');
735 $ilCtrl->setParameter($this,
'new_type',$this->
getType());
736 #$ilCtrl->setParameter($this, 'cp_mode', self::SOURCE_SELECTION);
737 $this->form->setFormAction($ilCtrl->getFormAction($this));
738 $this->form->setTitle($lng->txt($this->getType().
'_copy'));
740 $this->form->addCommandButton(
'searchSource', $lng->txt(
'btn_next'));
744 $tit->setMaxLength(70);
745 $tit->setRequired(
true);
746 $tit->setInfo($lng->txt(
'wizard_title_info'));
747 $this->form->addItem($tit);