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',
181 include_once
'./Services/Object/classes/class.ilPasteIntoMultipleItemsExplorer.php';
184 'ilias.php?baseClass=ilRepositoryGUI&cmd=goto',
'paste_copy_repexpand');
187 $required_perm =
'visible';
188 $create_perm =
'create_'.ilObject::_lookupType($this->
getSource(),
true);
191 $required_perm .= (
','.$create_perm);
193 $exp->setRequiredFormItemPermission($required_perm);
194 $exp->setExpandTarget($ilCtrl->getLinkTarget($this,
'showTargetSelectionTree'));
195 $exp->setTargetGet(
'ref_id');
196 $exp->setPostVar(
'target');
197 $exp->highlightNode(
$_GET[
'ref_id']);
198 $exp->setCheckedItems(array((
int)
$_POST[
'target']));
201 foreach(array(
'cat',
'root',
'crs',
'grp',
'fold') as $container)
209 $sub = $objDefinition->getSubObjects($container);
210 if(!isset($sub[$this->
getType()]))
212 $exp->removeFormItemForType($container);
216 if(
$_GET[
'paste_copy_repexpand'] ==
'')
218 $expanded = $tree->readRootId();
222 $expanded =
$_GET[
'paste_copy_repexpand'];
225 $this->tpl->setVariable(
'FORM_TARGET',
'_self');
226 $this->tpl->setVariable(
'FORM_ACTION', $ilCtrl->getFormAction($this,
'copySelection'));
228 $exp->setExpand($expanded);
231 $output = $exp->getOutput();
233 $this->tpl->setVariable(
'OBJECT_TREE', $output);
235 $this->tpl->setVariable(
'CMD_SUBMIT',
'saveTarget');
237 if($objDefinition->isContainer($this->getType()))
239 $this->tpl->setVariable(
'TXT_SUBMIT',$this->lng->txt(
'btn_next'));
243 if(!$objDefinition->isPlugin($this->getType()))
245 $submit = $this->lng->txt(
'obj_'.$this->
getType().
'_duplicate');
250 include_once
"Services/Component/classes/class.ilPlugin.php";
253 $submit = $plugin->txt(
'obj_'.$this->
getType().
'_duplicate');
255 $this->tpl->setVariable(
'TXT_SUBMIT', $submit);
258 $ilToolbar->addButton($this->lng->txt(
'cancel'), $ilCtrl->getLinkTarget($this,
'cancel'));
267 global $ilTabs, $ilToolbar,
$ilCtrl, $tree,
$tpl, $objDefinition;
270 $this->tpl->addBlockfile(
'ADM_CONTENT',
'adm_content',
'tpl.paste_into_multiple_objects.html',
275 include_once
'./Services/Object/classes/class.ilPasteIntoMultipleItemsExplorer.php';
278 'ilias.php?baseClass=ilRepositoryGUI&cmd=goto',
'paste_copy_repexpand');
279 $exp->setRequiredFormItemPermission(
'visible,read,copy');
281 $ilCtrl->setParameter($this,
'selectMode', self::SOURCE_SELECTION);
282 $exp->setExpandTarget($ilCtrl->getLinkTarget($this,
'showSourceSelectionTree'));
283 $exp->setTargetGet(
'ref_id');
284 $exp->setPostVar(
'source');
285 $exp->setCheckedItems(array($this->
getSource()));
286 #$exp->setNotSelectableItems(array($this->getTarget()));
289 foreach(array(
'cat',
'root',
'grp',
'fold') as $container)
291 $exp->removeFormItemForType($container);
295 if(
$_GET[
'paste_copy_repexpand'] ==
'')
297 $expanded = $tree->readRootId();
301 $expanded =
$_GET[
'paste_copy_repexpand'];
304 $this->tpl->setVariable(
'FORM_TARGET',
'_self');
305 $this->tpl->setVariable(
'FORM_ACTION', $ilCtrl->getFormAction($this,
'copySelection'));
307 $exp->setExpand($expanded);
310 $output = $exp->getOutput();
312 $this->tpl->setVariable(
'OBJECT_TREE', $output);
314 $this->tpl->setVariable(
'CMD_SUBMIT',
'saveSource');
315 $this->tpl->setVariable(
'TXT_SUBMIT', $this->lng->txt(
'btn_next'));
317 $ilToolbar->addButton($this->lng->txt(
'cancel'), $ilCtrl->getLinkTarget($this,
'cancel'));
326 global $objDefinition;
328 if(isset(
$_POST[
'target']))
339 if($objDefinition->isContainer($this->getType()))
356 $this->mode = $a_mode;
443 $ilCtrl->returnToParent($this);
465 $this->form->setValuesByPost();
467 if(!$this->form->checkInput())
470 $ilCtrl->returnToParent($this);
474 include_once
'./Services/Search/classes/class.ilQueryParser.php';
475 $query_parser =
new ilQueryParser($this->form->getInput(
'tit'));
478 $query_parser->parse();
479 if(!$query_parser->validate())
482 $ilCtrl->returnToParent($this);
486 include_once
'Services/Search/classes/Like/class.ilLikeObjectSearch.php';
488 $object_search->setFilter(array(
$_REQUEST[
'new_type']));
489 $res = $object_search->performSearch();
490 $res->setRequiredPermission(
'copy');
491 $res->filter(ROOT_FOLDER_ID,
true);
496 $ilCtrl->returnToParent($this);
499 include_once
'./Services/Object/classes/class.ilObjectCopySearchResultTableGUI.php';
501 $table->setSelectedReference($this->
getSource());
502 $table->parseSearchResults(
$results);
503 $tpl->setContent($table->getHTML());
512 global $objDefinition;
514 if(isset(
$_POST[
'source']))
525 if($objDefinition->isContainer($this->getType()))
553 include_once
'./Services/Object/classes/class.ilObjectCopySelectionTableGUI.php';
555 $tpl->addJavaScript(
'./Services/CopyWizard/js/ilContainer.js');
556 $tpl->setVariable(
'BODY_ATTRIBUTES',
'onload="ilDisableChilds(\'cmd\');"');
560 case self::SOURCE_SELECTION:
561 $back_cmd =
'showSourceSelectionTree';
564 case self::TARGET_SELECTION:
565 $back_cmd =
'showTargetSelectionTree';
568 case self::SEARCH_SOURCE:
569 $back_cmd =
'searchSource';
576 $tpl->setContent($table->getHTML());
585 include_once(
'./Services/Link/classes/class.ilLink.php');
586 include_once(
'Services/CopyWizard/classes/class.ilCopyWizardOptions.php');
591 if(!$rbacsystem->checkAccess(
'create', $this->getTarget(), $this->
getType()))
594 $ilCtrl->returnToParent($this);
600 $ilCtrl->returnToParent($this);
603 if(!$ilAccess->checkAccess(
'copy',
'',$this->getSource()))
606 $ilCtrl->returnToParent($this);
612 $wizard_options->saveOwner($ilUser->getId());
613 $wizard_options->saveRoot((
int) $this->
getSource());
623 $wizard_options->read();
626 $new_obj = $orig->cloneObject($this->
getTarget(),$copy_id);
629 $wizard_options->deleteAll();
632 include_once
"Services/AccessControl/classes/class.ilRbacLog.php";
635 $rbac_log_roles = $rbacreview->getParentRoleIds($new_obj->getRefId(),
false);
652 include_once(
'./Services/Link/classes/class.ilLink.php');
653 include_once(
'Services/CopyWizard/classes/class.ilCopyWizardOptions.php');
664 if(!$rbacsystem->checkAccess(
'create', $this->getTarget(),$this->
getType()))
667 $ilCtrl->returnToParent($this);
673 $ilCtrl->returnToParent($this);
677 $options =
$_POST[
'cp_options'] ?
$_POST[
'cp_options'] : array();
685 $ilCtrl->setParameterByClass(
"ilrepositorygui",
"ref_id",
687 $ilCtrl->redirectByClass(
"ilrepositorygui",
"");
692 $ilCtrl->setParameterByClass(
"ilrepositorygui",
"ref_id",
694 $ilCtrl->redirectByClass(
"ilrepositorygui",
"");
721 $tpl->setVariable($a_tplvar,$this->form->getHTML());
749 include_once
'./Services/Form/classes/class.ilPropertyFormGUI.php';
751 $this->form->setTableWidth(
'600px');
752 $ilCtrl->setParameter($this,
'new_type',$this->
getType());
753 #$ilCtrl->setParameter($this, 'cp_mode', self::SOURCE_SELECTION);
754 $this->form->setFormAction($ilCtrl->getFormAction($this));
755 $this->form->setTitle($lng->txt($this->getType().
'_copy'));
757 $this->form->addCommandButton(
'searchSource', $lng->txt(
'btn_next'));
761 $tit->setMaxLength(70);
762 $tit->setRequired(
true);
763 $tit->setInfo($lng->txt(
'wizard_title_info'));
764 $this->form->addItem($tit);