ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
ilObjTermsOfServiceGUI Class Reference
+ Inheritance diagram for ilObjTermsOfServiceGUI:
+ Collaboration diagram for ilObjTermsOfServiceGUI:

Public Member Functions

 getType ()
 Functions that must be overwritten. More...
 
 executeCommand ()
 
 getAdminTabs ()
 
- Public Member Functions inherited from ilObject2GUI
 __construct ($a_id=0, $a_id_type=self::REPOSITORY_NODE_ID, $a_parent_node_id=0)
 Constructor. More...
 
 executeCommand ()
 execute command More...
 
 delete ()
 Display delete confirmation form (repository/workspace switch) More...
 
 confirmedDelete ()
 Delete objects (repository/workspace switch) More...
 
 getHTML ()
 
 withReferences ()
 Final/Private declaration of unchanged parent methods. More...
 
 setCreationMode ($a_mode=true)
 
 getCreationMode ()
 
 prepareOutput ($a_show_subobjects=true)
 
 isVisible ($a_ref_id, $a_type)
 
 trash ()
 
 undelete ()
 
 cancelDelete ()
 
 removeFromSystem ()
 
 cloneAll ()
 
 view ()
 view object content (repository/workspace switch) More...
 
 getType ()
 Functions that must be overwritten. More...
 
 create ()
 Deleted in ilObject. More...
 
 save ()
 
 edit ()
 
 update ()
 
 cancel ()
 
 importFile ()
 Import. More...
 
- Public Member Functions inherited from ilObjectGUI
 executeCommand ()
 execute command More...
 
 withReferences ()
 determines wether objects are referenced or not (got ref ids or not) More...
 
 setCreationMode ($a_mode=true)
 if true, a creation screen is displayed the current $_GET[ref_id] don't belong to the current class! the mode is determined in ilrepositorygui More...
 
 getCreationMode ()
 get creation mode More...
 
 prepareOutput ($a_show_subobjects=true)
 prepare output More...
 
 getAdminTabs ()
 administration tabs show only permissions and trash folder More...
 
 getHTML ()
 
 confirmedDeleteObject ()
 confirmed deletion of object -> objects are moved to trash or deleted immediately, if trash is disabled More...
 
 cancelDeleteObject ()
 cancel deletion of object More...
 
 cancelObject ()
 cancel action and go back to previous page public More...
 
 createObject ()
 create new object form More...
 
 cancelCreation ()
 cancel create action and go back to repository parent More...
 
 saveObject ()
 save object More...
 
 editObject ()
 edit object More...
 
 addExternalEditFormCustom (ilPropertyFormGUI $a_form)
 
 updateObject ()
 updates object entry in object_data More...
 
 getFormAction ($a_cmd, $a_formaction="")
 get form action for command (command is method name without "Object", e.g. More...
 
 isVisible ($a_ref_id, $a_type)
 
 viewObject ()
 list childs of current object More...
 
 deleteObject ($a_error=false)
 Display deletion confirmation screen. More...
 
 cloneAllObject ()
 Clone single (not container object) Method is overwritten in ilContainerGUI. More...
 

Data Fields

 $lng
 
 $ctrl
 
 $object
 
 $tabs_gui
 
 $factory
 
- Data Fields inherited from ilObject2GUI
 $tree
 
const OBJECT_ID = 0
 
const REPOSITORY_NODE_ID = 1
 
const WORKSPACE_NODE_ID = 2
 
const REPOSITORY_OBJECT_ID = 3
 
const WORKSPACE_OBJECT_ID = 4
 
const PORTFOLIO_OBJECT_ID = 5
 
- Data Fields inherited from ilObjectGUI
const COPY_WIZARD_NEEDS_PAGE = 1
 
 $ilias
 
 $objDefinition
 
 $tpl
 
 $tree
 
 $lng
 
 $data
 
 $object
 
 $ref_id
 
 $obj_id
 
 $maxcount
 
 $formaction
 
 $return_location
 
 $target_frame
 
 $tab_target_script
 
 $actions
 
 $sub_objects
 
 $omit_locator = false
 
const CFORM_NEW = 1
 
const CFORM_IMPORT = 2
 
const CFORM_CLONE = 3
 

Protected Member Functions

 initSettingsForm ()
 
 saveSettings ()
 
 settings ($init_from_database=true)
 
 confirmReset ()
 
 reset ()
 
 showAgreementByLanguage ()
 
 showLastResetDate ()
 
 showMissingDocuments ()
 
 applyAgreementByLanguageFilter ()
 
 resetAgreementByLanguageFilter ()
 
 getAgreementTextByFilenameAsynch ()
 
 showAcceptanceHistory ()
 
 getAcceptedContentAsynch ()
 
 addUserAutoComplete ()
 Show auto complete results. More...
 
 applyAcceptanceHistoryFilter ()
 
 resetAcceptanceHistoryFilter ()
 
- Protected Member Functions inherited from ilObject2GUI
 afterConstructor ()
 Do anything that should be done after constructor in here. More...
 
 assignObject ()
 create object instance as internal property (repository/workspace switch) More...
 
 getAccessHandler ()
 Get access handler. More...
 
 setLocator ()
 set Locator More...
 
 deleteConfirmation ()
 Display delete confirmation form (workspace specific) More...
 
 deleteConfirmedObjects ()
 Delete objects (workspace specific) More...
 
 setTitleAndDescription ()
 
 showUpperIcon ()
 
 omitLocator ($a_omit=true)
 
 getTargetFrame ($a_cmd, $a_target_frame="")
 
 setTargetFrame ($a_cmd, $a_target_frame)
 
 getCenterColumnHTML ()
 
 getRightColumnHTML ()
 
 setColumnSettings (ilColumnGUI $column_gui)
 
 checkPermission ($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
 
 showPossibleSubObjects ()
 
 redirectToRefId ($a_ref_id, $a_cmd="")
 
 fillCloneTemplate ($a_tpl_varname, $a_type)
 
 fillCloneSearchTemplate ($a_tpl_varname, $a_type)
 
 searchCloneSource ()
 
 buildCloneSelect ($existing_objs)
 
 addAdminLocatorItems ($a_do_not_add_object=false)
 
 setTabs ()
 create tabs (repository/workspace switch) More...
 
 getReturnLocation ($a_cmd, $a_location="")
 Deprecated functions. More...
 
 setReturnLocation ($a_cmd, $a_location)
 
 showActions ()
 
 getTabs ()
 
 __showButton ($a_cmd, $a_text, $a_target='')
 
 hitsperpageObject ()
 
__initTableGUI ()
 
 __setTableGUIBasicData (&$tbl, &$result_set, $a_from="")
 
 addLocatorItems ()
 Functions to be overwritten. More...
 
 initCreationForms ($a_new_type)
 Init creation froms. More...
 
 putObjectInTree (ilObject $a_obj, $a_parent_node_id=null)
 Add object to tree at given position. More...
 
 checkPermissionBool ($a_perm, $a_cmd="", $a_type="", $a_node_id=null)
 Check permission. More...
 
 initHeaderAction ($a_sub_type=null, $a_sub_id=null)
 Add header action menu. More...
 
 redrawHeaderAction ()
 Updating icons after ajax call. More...
 
 getPermanentLinkWidget ($a_append=null, $a_center=false)
 
 handleAutoRating (ilObject $a_new_obj)
 
- Protected Member Functions inherited from ilObjectGUI
 assignObject ()
 
 setTitleAndDescription ()
 called by prepare output More...
 
 initHeaderAction ($a_sub_type=null, $a_sub_id=null)
 Add header action menu. More...
 
 insertHeaderAction ($a_list_gui)
 Insert header action into main template. More...
 
 addHeaderAction ()
 Add header action menu. More...
 
 redrawHeaderActionObject ()
 Ajax call: redraw action header only. More...
 
 showMountWebfolderIcon ()
 
 setTabs ()
 set admin tabs public More...
 
 setAdminTabs ()
 set admin tabs public More...
 
 setLocator ()
 set Locator More...
 
 addLocatorItems ()
 should be overwritten to add object specific items (repository items are preloaded) More...
 
 omitLocator ($a_omit=true)
 
 addAdminLocatorItems ($a_do_not_add_object=false)
 should be overwritten to add object specific items (repository items are preloaded) More...
 
 initCreationForms ($a_new_type)
 Init creation froms. More...
 
 getCreationFormsHTML (array $a_forms)
 Get HTML for creation forms (accordion) More...
 
 initCreateForm ($a_new_type)
 Init object creation form. More...
 
 initDidacticTemplate (ilPropertyFormGUI $form)
 Show didactic template types. More...
 
 addDidacticTemplateOptions (array &$a_options)
 Add custom templates. More...
 
 getDidacticTemplateVar ($a_type)
 Get didactic template setting from creation screen. More...
 
 putObjectInTree (ilObject $a_obj, $a_parent_node_id=null)
 Add object to tree at given position. More...
 
 afterSave (ilObject $a_new_object)
 Post (successful) object creation hook. More...
 
 initEditForm ()
 Init object edit form. More...
 
 initEditCustomForm (ilPropertyFormGUI $a_form)
 Add custom fields to update form. More...
 
 getEditFormValues ()
 Get values for edit form. More...
 
 getEditFormCustomValues (array &$a_values)
 Add values to custom edit fields. More...
 
 validateCustom (ilPropertyFormGUI $a_form)
 Validate custom values (if not possible with checkInput()) More...
 
 updateCustom (ilPropertyFormGUI $a_form)
 Insert custom update form values into object. More...
 
 afterUpdate ()
 Post (successful) object update hook. More...
 
 initImportForm ($a_new_type)
 Init object import form. More...
 
 importFileObject ($parent_id=null, $a_catch_errors=true)
 Import. More...
 
 afterImport (ilObject $a_new_object)
 Post (successful) object import hook. More...
 
 setFormAction ($a_cmd, $a_formaction)
 set specific form action for command More...
 
 getReturnLocation ($a_cmd, $a_location="")
 get return location for command (command is method name without "Object", e.g. More...
 
 setReturnLocation ($a_cmd, $a_location)
 set specific return location for command More...
 
 getTargetFrame ($a_cmd, $a_target_frame="")
 get target frame for command (command is method name without "Object", e.g. More...
 
 setTargetFrame ($a_cmd, $a_target_frame)
 set specific target frame for command More...
 
 showPossibleSubObjects ()
 show possible subobjects (pulldown menu) More...
 
 getTemplateFile ($a_cmd, $a_type="")
 get a template blockfile format: tpl. More...
 
 getTabs ()
 get tabs abstract method. More...
 
 __showButton ($a_cmd, $a_text, $a_target='')
 
 hitsperpageObject ()
 
__initTableGUI ()
 
 __setTableGUIBasicData (&$tbl, &$result_set, $a_from="")
 standard implementation for tables use 'from' variable use different initial setting of table More...
 
 redirectToRefId ($a_ref_id, $a_cmd="")
 redirects to (repository) view per ref id usually to a container and usually used at the end of a save/import method where the object gui type (of the new object) doesn't match with the type of the current $_GET["ref_id"] value More...
 
 fillCloneTemplate ($a_tpl_varname, $a_type)
 Fill object clone template This method can be called from any object GUI class that wants to offer object cloning. More...
 
 getCenterColumnHTML ()
 Get center column. More...
 
 getRightColumnHTML ()
 Display right column. More...
 
 setColumnSettings (ilColumnGUI $column_gui)
 May be overwritten in subclasses. More...
 
 checkPermission ($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
 Check permission and redirect on error. More...
 
 checkPermissionBool ($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
 Check permission. More...
 
 enableDragDropFileUpload ()
 Enables the file upload into this object by dropping files. More...
 
 handleAutoRating (ilObject $a_new_obj)
 Activate rating automatically if parent container setting. More...
 

Protected Attributes

 $form
 
 $rbacsystem
 
 $error
 
 $toolbar
 
 $user
 
 $log
 
- Protected Attributes inherited from ilObject2GUI
 $object_id
 
 $node_id
 
 $creation_forms = array()
 
 $id_type = array()
 
 $parent_id
 
 $access_handler
 
- Protected Attributes inherited from ilObjectGUI
 $tmp_import_dir
 
 $tabs_gui = null
 
 $ctrl
 

Additional Inherited Members

- Static Public Member Functions inherited from ilObject2GUI
static handleAfterSaveCallback (ilObject $a_obj, $a_callback_ref_id)
 After creation callback. More...
 
- Static Public Member Functions inherited from ilObjectGUI
static _gotoRepositoryRoot ($a_raise_error=false)
 Goto repository root. More...
 
static _gotoRepositoryNode ($a_ref_id, $a_cmd="frameset")
 Goto repository root. More...
 

Detailed Description

Member Function Documentation

◆ addUserAutoComplete()

ilObjTermsOfServiceGUI::addUserAutoComplete ( )
protected

Show auto complete results.

Definition at line 474 of file class.ilObjTermsOfServiceGUI.php.

References array, exit, ilUserAutoComplete\MAX_ENTRIES, and USER_FOLDER_ID.

475  {
476  if(
477  !$this->rbacsystem->checkAccess('read', '', $this->object->getRefId()) ||
478  !$this->rbacsystem->checkAccess('read', '', USER_FOLDER_ID)
479  )
480  {
481  echo json_encode(array());
482  exit();
483  }
484 
485  include_once 'Services/User/classes/class.ilUserAutoComplete.php';
486  $auto = new ilUserAutoComplete();
487  $auto->setSearchFields(array('login', 'firstname', 'lastname', 'email'));
488  $auto->enableFieldSearchableCheck(false);
489  $auto->setMoreLinkAvailable(true);
490 
491  if(($_REQUEST['fetchall']))
492  {
493  $auto->setLimit(ilUserAutoComplete::MAX_ENTRIES);
494  }
495 
496  echo $auto->getList($_REQUEST['term']);
497  exit();
498  }
Auto completion class for user lists.
Create styles array
The data for the language used.
const USER_FOLDER_ID
Class ilObjUserFolder.

◆ applyAcceptanceHistoryFilter()

ilObjTermsOfServiceGUI::applyAcceptanceHistoryFilter ( )
protected

Definition at line 503 of file class.ilObjTermsOfServiceGUI.php.

References showAcceptanceHistory().

504  {
505  $table = new ilTermsOfServiceAcceptanceHistoryTableGUI($this, 'showAcceptanceHistory');
506  $table->resetOffset();
507  $table->writeFilterToSession();
508 
509  $this->showAcceptanceHistory();
510  }
+ Here is the call graph for this function:

◆ applyAgreementByLanguageFilter()

ilObjTermsOfServiceGUI::applyAgreementByLanguageFilter ( )
protected

Definition at line 368 of file class.ilObjTermsOfServiceGUI.php.

References showAgreementByLanguage().

369  {
370  $table = new ilTermsOfServiceAgreementByLanguageTableGUI($this, 'showAgreementByLanguage');
371  $table->resetOffset();
372  $table->writeFilterToSession();
373 
374  $this->showAgreementByLanguage();
375  }
+ Here is the call graph for this function:

◆ confirmReset()

ilObjTermsOfServiceGUI::confirmReset ( )
protected

Definition at line 262 of file class.ilObjTermsOfServiceGUI.php.

263  {
264  if(!$this->rbacsystem->checkAccess('write', $this->object->getRefId()))
265  {
266  $this->error->raiseError($this->lng->txt('permission_denied'), $this->error->MESSAGE);
267  }
268 
269  $confirmation = new ilConfirmationGUI();
270  $confirmation->setFormAction($this->ctrl->getFormAction($this, 'confirmReset'));
271  $confirmation->setConfirm($this->lng->txt('confirm'), 'reset');
272  $confirmation->setCancel($this->lng->txt('cancel'), 'showAgreementByLanguage');
273  $confirmation->setHeaderText($this->lng->txt('tos_sure_reset_tos'));
274 
275  $this->tpl->setContent($confirmation->getHTML());
276  }
Confirmation screen class.

◆ executeCommand()

ilObjTermsOfServiceGUI::executeCommand ( )

Definition at line 114 of file class.ilObjTermsOfServiceGUI.php.

References $cmd, and ilObject2GUI\prepareOutput().

115  {
116  $next_class = $this->ctrl->getNextClass($this);
117  $cmd = $this->ctrl->getCmd();
118  $this->prepareOutput();
119 
120  switch($next_class)
121  {
122  case 'ilpermissiongui':
123  $this->tabs_gui->setTabActive('perm_settings');
124  require_once 'Services/AccessControl/classes/class.ilPermissionGUI.php';
125  $perm_gui = new ilPermissionGUI($this);
126  $this->ctrl->forwardCommand($perm_gui);
127  break;
128 
129  default:
130  if($cmd == '' || $cmd == 'view')
131  {
132  $cmd = 'settings';
133  }
134  $this->$cmd();
135  break;
136  }
137  }
$cmd
Definition: sahs_server.php:35
prepareOutput($a_show_subobjects=true)
New PermissionGUI (extends from old ilPermission2GUI) RBAC related output.
+ Here is the call graph for this function:

◆ getAcceptedContentAsynch()

ilObjTermsOfServiceGUI::getAcceptedContentAsynch ( )
protected

Definition at line 454 of file class.ilObjTermsOfServiceGUI.php.

References $_GET, ilTermsOfServiceHelper\getById(), ilTermsOfServiceJsonResponse\STATUS_FAILURE, and ilUtil\stripSlashes().

455  {
456  require_once 'Services/TermsOfService/classes/class.ilTermsOfServiceJsonResponse.php';
457  $response = new ilTermsOfServiceJsonResponse();
458 
459  if(!isset($_GET['tosv_id']))
460  {
461  $response->setStatus(ilTermsOfServiceJsonResponse::STATUS_FAILURE);
462  echo $response;
463  }
464 
466  $response->setBody($entity->getText());
467 
468  echo $response;
469  }
$_GET["client_id"]
Let this class derive from a real http response class in future.
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
+ Here is the call graph for this function:

◆ getAdminTabs()

ilObjTermsOfServiceGUI::getAdminTabs ( )

Definition at line 142 of file class.ilObjTermsOfServiceGUI.php.

References array, and USER_FOLDER_ID.

143  {
144  if($this->rbacsystem->checkAccess('read', $this->object->getRefId()))
145  {
146  $this->tabs_gui->addTarget('settings', $this->ctrl->getLinkTarget($this, 'settings'), array('saveSettings', 'settings', '', 'view'), '', '');
147  }
148 
149  if($this->rbacsystem->checkAccess('read', $this->object->getRefId()))
150  {
151  $this->tabs_gui->addTarget('tos_agreement_by_lng', $this->ctrl->getLinkTarget($this, 'showAgreementByLanguage'), array('reset', 'confirmReset', 'showAgreementByLanguage', 'resetAgreementByLanguageFilter', 'applyAgreementByLanguageFilter'), '', '');
152  }
153 
154  if($this->rbacsystem->checkAccess('read', $this->object->getRefId()) &&
155  $this->rbacsystem->checkAccess('read', USER_FOLDER_ID)
156  )
157  {
158  $this->tabs_gui->addTarget('tos_acceptance_history', $this->ctrl->getLinkTarget($this, 'showAcceptanceHistory'), array('showAcceptanceHistory', 'resetAcceptanceHistoryFilter', 'applyAcceptanceHistoryFilter'), '', '');
159  }
160 
161  if($this->rbacsystem->checkAccess('edit_permission', $this->object->getRefId()))
162  {
163  $this->tabs_gui->addTarget('perm_settings', $this->ctrl->getLinkTargetByClass(array(get_class($this), 'ilpermissiongui'), 'perm'), array('perm', 'info', 'owner'), 'ilpermissiongui');
164  }
165  }
Create styles array
The data for the language used.
const USER_FOLDER_ID
Class ilObjUserFolder.

◆ getAgreementTextByFilenameAsynch()

ilObjTermsOfServiceGUI::getAgreementTextByFilenameAsynch ( )
protected

Definition at line 392 of file class.ilObjTermsOfServiceGUI.php.

References $_GET, $file, file, ilTermsOfServiceJsonResponse\STATUS_FAILURE, and ilUtil\stripOnlySlashes().

393  {
394  require_once 'Services/TermsOfService/classes/class.ilTermsOfServiceJsonResponse.php';
395  $response = new ilTermsOfServiceJsonResponse();
396 
397  if(
398  !isset($_GET['agreement_document']) ||
399  !strlen($_GET['agreement_document']) ||
400  !$this->rbacsystem->checkAccess('read', $this->object->getRefId()))
401  {
402  $response->setStatus(ilTermsOfServiceJsonResponse::STATUS_FAILURE);
403  echo $response;
404  }
405 
406  $file = realpath(strip_tags(rawurldecode(ilUtil::stripOnlySlashes($_GET['agreement_document']))));
407  if(preg_match('/Customizing[\/\\\](global[\/\\\]agreement|clients[\/\\\]' . CLIENT_ID . '[\/\\\]agreement)[\/\\\]agreement_([a-z]{2})\.html$/', $file))
408  {
409  $content = file_get_contents($file);
410  if(strip_tags($content) === $content)
411  {
412  $content = '';
413  $lines = file($file);
414  foreach($lines as $line)
415  {
416  $content .= nl2br(trim($line));
417  }
418  }
419  $response->setBody($content);
420  }
421  else
422  {
423  $response->setStatus(ilTermsOfServiceJsonResponse::STATUS_FAILURE);
424  }
425 
426  echo $response;
427  }
$_GET["client_id"]
Let this class derive from a real http response class in future.
static stripOnlySlashes($a_str)
strip slashes if magic qoutes is enabled
Reload workbook from saved file
if(!file_exists("$old.txt")) if($old===$new) if(file_exists("$new.txt")) $file
+ Here is the call graph for this function:

◆ getType()

ilObjTermsOfServiceGUI::getType ( )

Functions that must be overwritten.

Definition at line 106 of file class.ilObjTermsOfServiceGUI.php.

107  {
108  return 'tos';
109  }

◆ initSettingsForm()

ilObjTermsOfServiceGUI::initSettingsForm ( )
protected

Definition at line 170 of file class.ilObjTermsOfServiceGUI.php.

References ilFormPropertyGUI\setInfo().

Referenced by saveSettings(), and settings().

171  {
172  if(null == $this->form)
173  {
174  $this->form = new ilPropertyFormGUI();
175  $this->form->setTitle($this->lng->txt('tos_tos_settings'));
176  $this->form->setFormAction($this->ctrl->getFormAction($this, 'saveSettings'));
177 
178  $status = new ilCheckboxInputGUI($this->lng->txt('tos_status_enable'), 'tos_status');
179  $status->setInfo($this->lng->txt('tos_status_desc'));
180  $this->form->addItem($status);
181 
182  $this->form->addCommandButton('saveSettings', $this->lng->txt('save'));
183  }
184  }
This class represents a property form user interface.
This class represents a checkbox property in a property form.
setInfo($a_info)
Set Information Text.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ reset()

ilObjTermsOfServiceGUI::reset ( )
protected

Definition at line 281 of file class.ilObjTermsOfServiceGUI.php.

References ilUtil\sendSuccess(), showAgreementByLanguage(), and user().

282  {
283  if(!$this->rbacsystem->checkAccess('write', $this->object->getRefId()))
284  {
285  $this->error->raiseError($this->lng->txt('permission_denied'), $this->error->MESSAGE);
286  }
287 
288  $this->object->resetAll();
289  $this->log->write(__METHOD__ . ': Terms of service reset by ' . $this->user->getId() . ' [' . $this->user->getLogin() . ']');
290  ilUtil::sendSuccess($this->lng->txt('tos_reset_successfull'));
291 
292  $this->showAgreementByLanguage();
293  }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
user()
Definition: user.php:4
+ Here is the call graph for this function:

◆ resetAcceptanceHistoryFilter()

ilObjTermsOfServiceGUI::resetAcceptanceHistoryFilter ( )
protected

Definition at line 515 of file class.ilObjTermsOfServiceGUI.php.

References showAcceptanceHistory().

516  {
517  $table = new ilTermsOfServiceAcceptanceHistoryTableGUI($this, 'showAcceptanceHistory');
518  $table->resetOffset();
519  $table->resetFilter();
520 
521  $this->showAcceptanceHistory();
522  }
+ Here is the call graph for this function:

◆ resetAgreementByLanguageFilter()

ilObjTermsOfServiceGUI::resetAgreementByLanguageFilter ( )
protected

Definition at line 380 of file class.ilObjTermsOfServiceGUI.php.

References showAgreementByLanguage().

381  {
382  $table = new ilTermsOfServiceAgreementByLanguageTableGUI($this, 'showAgreementByLanguage');
383  $table->resetOffset();
384  $table->resetFilter();
385 
386  $this->showAgreementByLanguage();
387  }
+ Here is the call graph for this function:

◆ saveSettings()

ilObjTermsOfServiceGUI::saveSettings ( )
protected

Definition at line 189 of file class.ilObjTermsOfServiceGUI.php.

References $_POST, League\OAuth2\Client\Provider\$provider, array, ilTermsOfServiceTableDataProviderFactory\CONTEXT_AGRREMENT_BY_LANGUAGE, initSettingsForm(), ilUtil\sendFailure(), ilUtil\sendSuccess(), and settings().

190  {
191  if(!$this->rbacsystem->checkAccess('write', $this->object->getRefId()))
192  {
193  $this->error->raiseError($this->lng->txt('permission_denied'), $this->error->MESSAGE);
194  }
195 
197  $list = $provider->getList(array(), array());
198 
199  $has_documents = false;
200  foreach($list['items'] as $item)
201  {
202  if($item['agreement_document'])
203  {
204  $has_documents = true;
205  break;
206  }
207  }
208 
209  $this->initSettingsForm();
210  if($this->form->checkInput())
211  {
212  if($has_documents || !(int)$this->form->getInput('tos_status'))
213  {
214  $this->object->saveStatus((int)$this->form->getInput('tos_status'));
215  ilUtil::sendSuccess($this->lng->txt('saved_successfully'));
216  }
217  }
218 
219  if(
220  !$has_documents &&
221  (int)$this->form->getInput('tos_status') &&
222  !$this->object->getStatus()
223  )
224  {
225  $_POST['tos_status'] = 0;
226  ilUtil::sendFailure($this->lng->txt('tos_no_documents_exist_cant_save'));
227  }
228 
229  $this->settings(false);
230  }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
settings($init_from_database=true)
Create styles array
The data for the language used.
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
$_POST["username"]
+ Here is the call graph for this function:

◆ settings()

ilObjTermsOfServiceGUI::settings (   $init_from_database = true)
protected
Parameters
bool$init_from_database

Definition at line 235 of file class.ilObjTermsOfServiceGUI.php.

References array, initSettingsForm(), object, and showMissingDocuments().

Referenced by saveSettings().

236  {
237  if(!$this->rbacsystem->checkAccess('read', $this->object->getRefId()))
238  {
239  $this->error->raiseError($this->lng->txt('permission_denied'), $this->error->MESSAGE);
240  }
241 
242  $this->showMissingDocuments();
243 
244  $this->initSettingsForm();
245  if($init_from_database)
246  {
247  $this->form->setValuesByArray(array(
248  'tos_status' => $this->object->getStatus()
249  ));
250  }
251  else
252  {
253  $this->form->setValuesByPost();
254  }
255 
256  $this->tpl->setContent($this->form->getHTML());
257  }
Create styles array
The data for the language used.
Create new PHPExcel object
obj_idprivate
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ showAcceptanceHistory()

ilObjTermsOfServiceGUI::showAcceptanceHistory ( )
protected

Definition at line 432 of file class.ilObjTermsOfServiceGUI.php.

References ilTermsOfServiceTableDataProviderFactory\CONTEXT_ACCEPTANCE_HISTORY, and USER_FOLDER_ID.

Referenced by applyAcceptanceHistoryFilter(), and resetAcceptanceHistoryFilter().

433  {
434  if(
435  !$this->rbacsystem->checkAccess('read', '', $this->object->getRefId()) ||
436  !$this->rbacsystem->checkAccess('read', '', USER_FOLDER_ID)
437  )
438  {
439  $this->error->raiseError($this->lng->txt('permission_denied'), $this->error->MESSAGE);
440  }
441 
442  $this->lng->loadLanguageModule('meta');
443 
444  $table = new ilTermsOfServiceAcceptanceHistoryTableGUI($this, 'showAcceptanceHistory');
445  $table->setProvider($this->factory->getByContext(ilTermsOfServiceTableDataProviderFactory::CONTEXT_ACCEPTANCE_HISTORY));
446  $table->populate();
447 
448  $this->tpl->setContent($table->getHTML());
449  }
const USER_FOLDER_ID
Class ilObjUserFolder.
+ Here is the caller graph for this function:

◆ showAgreementByLanguage()

ilObjTermsOfServiceGUI::showAgreementByLanguage ( )
protected

Definition at line 298 of file class.ilObjTermsOfServiceGUI.php.

References ilTermsOfServiceTableDataProviderFactory\CONTEXT_AGRREMENT_BY_LANGUAGE, and showLastResetDate().

Referenced by applyAgreementByLanguageFilter(), reset(), and resetAgreementByLanguageFilter().

299  {
300  if(!$this->rbacsystem->checkAccess('read', $this->object->getRefId()))
301  {
302  $this->error->raiseError($this->lng->txt('permission_denied'), $this->error->MESSAGE);
303  }
304 
305  $this->lng->loadLanguageModule('meta');
306 
307  if($this->rbacsystem->checkAccess('write', $this->object->getRefId()))
308  {
309  $this->toolbar->setFormAction($this->ctrl->getFormAction($this, 'settings'));
310  $this->toolbar->addFormButton($this->lng->txt('tos_reset_tos_for_all_users'), 'confirmReset');
311  }
312 
313  $this->showLastResetDate();
314 
315  $table = new ilTermsOfServiceAgreementByLanguageTableGUI($this, 'showAgreementByLanguage');
316  $table->setProvider($this->factory->getByContext(ilTermsOfServiceTableDataProviderFactory::CONTEXT_AGRREMENT_BY_LANGUAGE));
317  $table->populate();
318 
319  $this->tpl->setContent($table->getHTML());
320  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ showLastResetDate()

ilObjTermsOfServiceGUI::showLastResetDate ( )
protected

Definition at line 325 of file class.ilObjTermsOfServiceGUI.php.

References ilDatePresentation\formatDate(), IL_CAL_UNIX, object, ilDatePresentation\setUseRelativeDates(), and ilDatePresentation\useRelativeDates().

Referenced by showAgreementByLanguage().

326  {
327  if($this->object->getLastResetDate() && $this->object->getLastResetDate()->get(IL_CAL_UNIX) != 0)
328  {
331  $this->toolbar->addText(sprintf($this->lng->txt('tos_last_reset_date'), ilDatePresentation::formatDate($this->object->getLastResetDate())));
333  }
334  }
static setUseRelativeDates($a_status)
set use relative dates
const IL_CAL_UNIX
static useRelativeDates()
check if relative dates are used
static formatDate(ilDateTime $date)
Format a date public.
Create new PHPExcel object
obj_idprivate
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ showMissingDocuments()

ilObjTermsOfServiceGUI::showMissingDocuments ( )
protected

Definition at line 339 of file class.ilObjTermsOfServiceGUI.php.

References League\OAuth2\Client\Provider\$provider, array, ilTermsOfServiceTableDataProviderFactory\CONTEXT_AGRREMENT_BY_LANGUAGE, object, and ilUtil\sendInfo().

Referenced by settings().

340  {
341  if(!$this->object->getStatus())
342  {
343  return;
344  }
345 
347  $list = $provider->getList(array(), array());
348 
349  $has_documents = false;
350  foreach($list['items'] as $item)
351  {
352  if($item['agreement_document'])
353  {
354  $has_documents = true;
355  break;
356  }
357  }
358 
359  if(!$has_documents)
360  {
361  ilUtil::sendInfo($this->lng->txt('tos_no_documents_exist'));
362  }
363  }
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
Create styles array
The data for the language used.
Create new PHPExcel object
obj_idprivate
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Field Documentation

◆ $ctrl

ilObjTermsOfServiceGUI::$ctrl

Definition at line 32 of file class.ilObjTermsOfServiceGUI.php.

◆ $error

ilObjTermsOfServiceGUI::$error
protected

Definition at line 57 of file class.ilObjTermsOfServiceGUI.php.

◆ $factory

ilObjTermsOfServiceGUI::$factory

Definition at line 47 of file class.ilObjTermsOfServiceGUI.php.

◆ $form

ilObjTermsOfServiceGUI::$form
protected

Definition at line 22 of file class.ilObjTermsOfServiceGUI.php.

◆ $lng

ilObjTermsOfServiceGUI::$lng

Definition at line 27 of file class.ilObjTermsOfServiceGUI.php.

◆ $log

ilObjTermsOfServiceGUI::$log
protected

Definition at line 72 of file class.ilObjTermsOfServiceGUI.php.

◆ $object

ilObjTermsOfServiceGUI::$object

Definition at line 37 of file class.ilObjTermsOfServiceGUI.php.

◆ $rbacsystem

ilObjTermsOfServiceGUI::$rbacsystem
protected

Definition at line 52 of file class.ilObjTermsOfServiceGUI.php.

◆ $tabs_gui

ilObjTermsOfServiceGUI::$tabs_gui

Definition at line 42 of file class.ilObjTermsOfServiceGUI.php.

◆ $toolbar

ilObjTermsOfServiceGUI::$toolbar
protected

Definition at line 62 of file class.ilObjTermsOfServiceGUI.php.

◆ $user

ilObjTermsOfServiceGUI::$user
protected

Definition at line 67 of file class.ilObjTermsOfServiceGUI.php.


The documentation for this class was generated from the following file: