ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
class.ilObjectCopyProgressTableGUI.php
Go to the documentation of this file.
1 <?php
2 
3 /* Copyright (c) 1998-2009 ILIAS open source, Extended GPL, see docs/LICENSE */
4 
5 include_once './Services/Table/classes/class.ilTable2GUI.php';
6 
17 {
18  protected $objects = array();
19 
26  public function __construct($a_parent_obj, $a_parent_cmd, $a_id)
27  {
28  $this->setId('obj_copy_progress_table_' . $a_id);
29  parent::__construct($a_parent_obj, $a_parent_cmd, '');
30  }
31 
32  public function setObjectInfo($a_ref_ids)
33  {
34  $this->objects = $a_ref_ids;
35  }
36 
37  public function getObjects()
38  {
39  return $this->objects;
40  }
41 
42  public function setRedirectionUrl($a_url)
43  {
44  $GLOBALS['tpl']->addOnLoadCode('il.CopyRedirection.setRedirectUrl("'.$a_url.'")');
45  }
46 
50  public function init()
51  {
52  $GLOBALS['tpl']->addJavaScript('./Services/CopyWizard/js/ilCopyRedirection.js');
53  $GLOBALS['tpl']->addOnLoadCode('il.CopyRedirection.checkDone()');
54  $this->setExternalSorting(TRUE);
55  $this->setFormAction($GLOBALS['ilCtrl']->getFormAction($this->getParentObject()));
56 
57  $this->setRowTemplate('tpl.object_copy_progress_table_row.html', 'Services/Object');
58 
59  $this->addColumn($this->lng->txt('obj_target_location'), '');
60  $this->addColumn($this->lng->txt('obj_copy_progress'), '');
61  }
62 
67  public function fillRow($set)
68  {
69  $this->tpl->setVariable('VAL_ID', $set['ref_id']);
70  $this->tpl->setVariable('OBJ_TITLE', $set['title']);
71 
72  if (strlen($set['description']))
73  {
74  $this->tpl->setVariable('VAL_DESC', $set['description']);
75  }
76 
77  $this->tpl->setVariable('TYPE_IMG', ilUtil::getTypeIconPath($set['type'], $set['obj_id']));
78  $this->tpl->setVariable('TYPE_STR', $this->lng->txt('obj_' . $set['type']));
79 
80  include_once './Services/UIComponent/ProgressBar/classes/class.ilProgressBar.php';
81  $progress = ilProgressBar::getInstance();
82  $progress->setType(ilProgressBar::TYPE_SUCCESS);
83  $progress->setMin(0);
84  $progress->setMax($set['max_steps']);
85  $progress->setCurrent(0);
86  $progress->setAnimated(TRUE);
87  $progress->setId($set['copy_id']);
88 
89  $GLOBALS['ilCtrl']->setParameter($this->getParentObject(), 'copy_id', $set['copy_id']);
90  $progress->setAsyncStatusUrl(
91  $GLOBALS['ilCtrl']->getLinkTarget(
92  $this->getParentObject(),
93  'updateProgress',
94  '',
95  TRUE
96  )
97  );
98 
99  $progress->setAsynStatusTimeout(1);
100  $this->tpl->setVariable('PROGRESS_BAR', $progress->render());
101  }
102 
106  public function parse()
107  {
108  $counter = 0;
109  $set = array();
110  foreach ($this->getObjects() as $ref_id => $copy_id)
111  {
112  $counter++;
113  $set[$counter]['ref_id'] = $ref_id;
114  $set[$counter]['copy_id'] = $copy_id;
115  $set[$counter]['obj_id'] = ilObject::_lookupObjId($ref_id);
119 
120  include_once './Services/CopyWizard/classes/class.ilCopyWizardOptions.php';
121  $copy_info = ilCopyWizardOptions::_getInstance($copy_id);
122  $copy_info->read();
123  $set[$counter]['max_steps'] = $copy_info->getRequiredSteps();
124  }
125  $this->setData($set);
126  }
127 }
128 ?>
setExternalSorting($a_val)
Set external sorting.
$GLOBALS['loaded']
Global hash that tracks already loaded includes.
static _lookupTitle($a_id)
lookup object title
__construct($a_parent_obj, $a_parent_cmd, $a_id)
Constructor.
static getTypeIconPath($a_type, $a_obj_id, $a_size='small')
Get type icon path path Return image path for icon_xxx.pngs Or (if enabled) path to custom icon Depre...
getParentObject()
Get parent object.
setId($a_val)
Set id.
$counter
static _getInstance($a_copy_id)
Get instance of copy wizard options.
Class ilTable2GUI.
static getInstance()
Factory.
static _lookupDescription($a_id)
lookup object description
static _lookupObjId($a_id)
getFormAction()
Get Form action parameter.
setRowTemplate($a_template, $a_template_dir="")
Set row template.
Create styles array
The data for the language used.
static _lookupType($a_id, $a_reference=false)
lookup object type
setFormAction($a_form_action, $a_multipart=false)
Set Form action parameter.
$ref_id
Definition: sahs_server.php:39
addColumn($a_text, $a_sort_field="", $a_width="", $a_is_checkbox_action_column=false, $a_class="", $a_tooltip="", $a_tooltip_with_html=false)
Add a column to the header.