ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
ilObjTermsOfServiceGUI Class Reference
+ Inheritance diagram for ilObjTermsOfServiceGUI:
+ Collaboration diagram for ilObjTermsOfServiceGUI:

Public Member Functions

 getType ()
 Functions that must be overwritten. More...
 
 executeCommand ()
 execute command More...
 
 getAdminTabs ()
 administration tabs show only permissions and trash folder More...
 
- 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)
 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...
 
 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...
 
 putObjectInTree (ilObject $a_obj, $a_parent_node_id=null)
 Add object to tree at given position. 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 @access public More...
 
 createObject ()
 create new object form More...
 
 cancelCreation ()
 cancel create action and go back to repository parent More...
 
 saveObject ()
 save object 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...
 
 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
 
 $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 ()
 called by prepare output More...
 
 showUpperIcon ()
 
 omitLocator ($a_omit=true)
 
 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...
 
 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...
 
 showPossibleSubObjects ()
 show possible subobjects (pulldown menu) 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...
 
 fillCloneSearchTemplate ($a_tpl_varname, $a_type)
 
 searchCloneSource ()
 
 buildCloneSelect ($existing_objs)
 
 addAdminLocatorItems ($a_do_not_add_object=false)
 should be overwritten to add object specific items (repository items are preloaded) More...
 
 setTabs ()
 create tabs (repository/workspace switch) More...
 
 getReturnLocation ($a_cmd, $a_location="")
 Deprecated functions. More...
 
 setReturnLocation ($a_cmd, $a_location)
 set specific return location for command More...
 
 showActions ()
 
 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...
 
 addLocatorItems ()
 Functions to be overwritten. More...
 
 initCreationForms ($a_new_type)
 Init creation froms. 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 @access public More...
 
 setAdminTabs ()
 set admin tabs @access 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...
 
 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
 $ilErr
 
 $locator
 
 $user
 
 $access
 
 $settings
 
 $rbacreview
 
 $toolbar
 
 $rbacsystem
 
 $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

Author
Michael Jansen mjans.nosp@m.en@d.nosp@m.ataba.nosp@m.y.de
Version
$Id$ @ilCtrl_Calls ilObjTermsOfServiceGUI: ilPermissionGUI @ilCtrl_isCalledBy ilObjTermsOfServiceGUI: ilAdministrationGUI

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

Member Function Documentation

◆ addUserAutoComplete()

ilObjTermsOfServiceGUI::addUserAutoComplete ( )
protected

Show auto complete results.

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

441 {
442 if (
443 !$this->rbacsystem->checkAccess('read', '', $this->object->getRefId()) ||
444 !$this->rbacsystem->checkAccess('read', '', USER_FOLDER_ID)
445 ) {
446 echo json_encode(array());
447 exit();
448 }
449
450 include_once 'Services/User/classes/class.ilUserAutoComplete.php';
451 $auto = new ilUserAutoComplete();
452 $auto->setSearchFields(array('login', 'firstname', 'lastname', 'email'));
453 $auto->enableFieldSearchableCheck(false);
454 $auto->setMoreLinkAvailable(true);
455
456 if (($_REQUEST['fetchall'])) {
457 $auto->setLimit(ilUserAutoComplete::MAX_ENTRIES);
458 }
459
460 echo $auto->getList($_REQUEST['term']);
461 exit();
462 }
const USER_FOLDER_ID
Class ilObjUserFolder.
Auto completion class for user lists.

References exit, ilUserAutoComplete\MAX_ENTRIES, and USER_FOLDER_ID.

◆ applyAcceptanceHistoryFilter()

ilObjTermsOfServiceGUI::applyAcceptanceHistoryFilter ( )
protected

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

468 {
469 $table = new ilTermsOfServiceAcceptanceHistoryTableGUI($this, 'showAcceptanceHistory');
470 $table->resetOffset();
471 $table->writeFilterToSession();
472
473 $this->showAcceptanceHistory();
474 }
if(empty($password)) $table
Definition: pwgen.php:24

References $table, and showAcceptanceHistory().

+ Here is the call graph for this function:

◆ applyAgreementByLanguageFilter()

ilObjTermsOfServiceGUI::applyAgreementByLanguageFilter ( )
protected

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

343 {
344 $table = new ilTermsOfServiceAgreementByLanguageTableGUI($this, 'showAgreementByLanguage');
345 $table->resetOffset();
346 $table->writeFilterToSession();
347
349 }

References $table, and showAgreementByLanguage().

+ Here is the call graph for this function:

◆ confirmReset()

ilObjTermsOfServiceGUI::confirmReset ( )
protected

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

246 {
247 if (!$this->rbacsystem->checkAccess('write', $this->object->getRefId())) {
248 $this->error->raiseError($this->lng->txt('permission_denied'), $this->error->MESSAGE);
249 }
250
251 $confirmation = new ilConfirmationGUI();
252 $confirmation->setFormAction($this->ctrl->getFormAction($this, 'confirmReset'));
253 $confirmation->setConfirm($this->lng->txt('confirm'), 'reset');
254 $confirmation->setCancel($this->lng->txt('cancel'), 'showAgreementByLanguage');
255 $confirmation->setHeaderText($this->lng->txt('tos_sure_reset_tos'));
256
257 $this->tpl->setContent($confirmation->getHTML());
258 }
error($a_errmsg)
set error message @access public
Confirmation screen class.

References error().

+ Here is the call graph for this function:

◆ executeCommand()

ilObjTermsOfServiceGUI::executeCommand ( )

execute command

Reimplemented from ilObject2GUI.

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

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

References ilObject2GUI\prepareOutput().

+ Here is the call graph for this function:

◆ getAcceptedContentAsynch()

ilObjTermsOfServiceGUI::getAcceptedContentAsynch ( )
protected

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

422 {
423 require_once 'Services/TermsOfService/classes/class.ilTermsOfServiceJsonResponse.php';
425
426 if (!isset($_GET['tosv_id'])) {
428 echo $response;
429 }
430
432 $response->setBody($entity->getText());
433
434 echo $response;
435 }
$_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
$response

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

+ Here is the call graph for this function:

◆ getAdminTabs()

ilObjTermsOfServiceGUI::getAdminTabs ( )

administration tabs show only permissions and trash folder

Reimplemented from ilObjectGUI.

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

141 {
142 if ($this->rbacsystem->checkAccess('read', $this->object->getRefId())) {
143 $this->tabs_gui->addTarget('settings', $this->ctrl->getLinkTarget($this, 'settings'), array('saveSettings', 'settings', '', 'view'), '', '');
144 }
145
146 if ($this->rbacsystem->checkAccess('read', $this->object->getRefId())) {
147 $this->tabs_gui->addTarget('tos_agreement_by_lng', $this->ctrl->getLinkTarget($this, 'showAgreementByLanguage'), array('reset', 'confirmReset', 'showAgreementByLanguage', 'resetAgreementByLanguageFilter', 'applyAgreementByLanguageFilter'), '', '');
148 }
149
150 if ($this->rbacsystem->checkAccess('read', $this->object->getRefId()) &&
151 $this->rbacsystem->checkAccess('read', USER_FOLDER_ID)
152 ) {
153 $this->tabs_gui->addTarget('tos_acceptance_history', $this->ctrl->getLinkTarget($this, 'showAcceptanceHistory'), array('showAcceptanceHistory', 'resetAcceptanceHistoryFilter', 'applyAcceptanceHistoryFilter'), '', '');
154 }
155
156 if ($this->rbacsystem->checkAccess('edit_permission', $this->object->getRefId())) {
157 $this->tabs_gui->addTarget('perm_settings', $this->ctrl->getLinkTargetByClass(array(get_class($this), 'ilpermissiongui'), 'perm'), array('perm', 'info', 'owner'), 'ilpermissiongui');
158 }
159 }

References USER_FOLDER_ID.

◆ getAgreementTextByFilenameAsynch()

ilObjTermsOfServiceGUI::getAgreementTextByFilenameAsynch ( )
protected

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

367 {
368 require_once 'Services/TermsOfService/classes/class.ilTermsOfServiceJsonResponse.php';
370
371 if (
372 !isset($_GET['agreement_document']) ||
373 !strlen($_GET['agreement_document']) ||
374 !$this->rbacsystem->checkAccess('read', $this->object->getRefId())) {
376 echo $response;
377 }
378
379 $file = realpath(strip_tags(rawurldecode(ilUtil::stripOnlySlashes($_GET['agreement_document']))));
380 if (preg_match('/Customizing[\/\\\](global[\/\\\]agreement|clients[\/\\\]' . CLIENT_ID . '[\/\\\]agreement)[\/\\\]agreement_([a-z]{2})\.html$/', $file)) {
381 $content = file_get_contents($file);
382 if (strip_tags($content) === $content) {
383 $content = '';
384 $lines = file($file);
385 foreach ($lines as $line) {
386 $content .= nl2br(trim($line));
387 }
388 }
389 $response->setBody($content);
390 } else {
392 }
393
394 echo $response;
395 }
static stripOnlySlashes($a_str)
strip slashes if magic qoutes is enabled
if(!file_exists("$old.txt")) if( $old===$new) if(file_exists("$new.txt")) $file

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

+ Here is the call graph for this function:

◆ getType()

ilObjTermsOfServiceGUI::getType ( )

Functions that must be overwritten.

Reimplemented from ilObject2GUI.

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

107 {
108 return 'tos';
109 }

◆ initSettingsForm()

ilObjTermsOfServiceGUI::initSettingsForm ( )
protected

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

165 {
166 if (null == $this->form) {
167 $this->form = new ilPropertyFormGUI();
168 $this->form->setTitle($this->lng->txt('tos_tos_settings'));
169 $this->form->setFormAction($this->ctrl->getFormAction($this, 'saveSettings'));
170
171 $status = new ilCheckboxInputGUI($this->lng->txt('tos_status_enable'), 'tos_status');
172 $status->setInfo($this->lng->txt('tos_status_desc'));
173 $this->form->addItem($status);
174
175 $this->form->addCommandButton('saveSettings', $this->lng->txt('save'));
176 }
177 }
This class represents a checkbox property in a property form.
This class represents a property form user interface.

Referenced by saveSettings(), and settings().

+ Here is the caller graph for this function:

◆ reset()

ilObjTermsOfServiceGUI::reset ( )
protected

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

264 {
265 if (!$this->rbacsystem->checkAccess('write', $this->object->getRefId())) {
266 $this->error->raiseError($this->lng->txt('permission_denied'), $this->error->MESSAGE);
267 }
268
269 $this->object->resetAll();
270 $this->log->write(__METHOD__ . ': Terms of service reset by ' . $this->user->getId() . ' [' . $this->user->getLogin() . ']');
271 ilUtil::sendSuccess($this->lng->txt('tos_reset_successfull'));
272
274 }
user()
Definition: user.php:4
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.

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

+ Here is the call graph for this function:

◆ resetAcceptanceHistoryFilter()

ilObjTermsOfServiceGUI::resetAcceptanceHistoryFilter ( )
protected

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

480 {
481 $table = new ilTermsOfServiceAcceptanceHistoryTableGUI($this, 'showAcceptanceHistory');
482 $table->resetOffset();
483 $table->resetFilter();
484
485 $this->showAcceptanceHistory();
486 }

References $table, and showAcceptanceHistory().

+ Here is the call graph for this function:

◆ resetAgreementByLanguageFilter()

ilObjTermsOfServiceGUI::resetAgreementByLanguageFilter ( )
protected

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

355 {
356 $table = new ilTermsOfServiceAgreementByLanguageTableGUI($this, 'showAgreementByLanguage');
357 $table->resetOffset();
358 $table->resetFilter();
359
361 }

References $table, and showAgreementByLanguage().

+ Here is the call graph for this function:

◆ saveSettings()

ilObjTermsOfServiceGUI::saveSettings ( )
protected

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

183 {
184 if (!$this->rbacsystem->checkAccess('write', $this->object->getRefId())) {
185 $this->error->raiseError($this->lng->txt('permission_denied'), $this->error->MESSAGE);
186 }
187
189 $list = $provider->getList(array(), array());
190
191 $has_documents = false;
192 foreach ($list['items'] as $item) {
193 if ($item['agreement_document']) {
194 $has_documents = true;
195 break;
196 }
197 }
198
199 $this->initSettingsForm();
200 if ($this->form->checkInput()) {
201 if ($has_documents || !(int) $this->form->getInput('tos_status')) {
202 $this->object->saveStatus((int) $this->form->getInput('tos_status'));
203 ilUtil::sendSuccess($this->lng->txt('saved_successfully'));
204 }
205 }
206
207 if (
208 !$has_documents &&
209 (int) $this->form->getInput('tos_status') &&
210 !$this->object->getStatus()
211 ) {
212 $_POST['tos_status'] = 0;
213 ilUtil::sendFailure($this->lng->txt('tos_no_documents_exist_cant_save'));
214 }
215
216 $this->settings(false);
217 }
$_POST["username"]
settings($init_from_database=true)
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
if(isset($_REQUEST['delete'])) $list
Definition: registry.php:41

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

+ Here is the call graph for this function:

◆ settings()

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

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

223 {
224 if (!$this->rbacsystem->checkAccess('read', $this->object->getRefId())) {
225 $this->error->raiseError($this->lng->txt('permission_denied'), $this->error->MESSAGE);
226 }
227
228 $this->showMissingDocuments();
229
230 $this->initSettingsForm();
231 if ($init_from_database) {
232 $this->form->setValuesByArray(array(
233 'tos_status' => $this->object->getStatus()
234 ));
235 } else {
236 $this->form->setValuesByPost();
237 }
238
239 $this->tpl->setContent($this->form->getHTML());
240 }

References error(), initSettingsForm(), and showMissingDocuments().

Referenced by saveSettings().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ showAcceptanceHistory()

ilObjTermsOfServiceGUI::showAcceptanceHistory ( )
protected

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

401 {
402 if (
403 !$this->rbacsystem->checkAccess('read', '', $this->object->getRefId()) ||
404 !$this->rbacsystem->checkAccess('read', '', USER_FOLDER_ID)
405 ) {
406 $this->error->raiseError($this->lng->txt('permission_denied'), $this->error->MESSAGE);
407 }
408
409 $this->lng->loadLanguageModule('meta');
410
411 $table = new ilTermsOfServiceAcceptanceHistoryTableGUI($this, 'showAcceptanceHistory');
412 $table->setProvider($this->factory->getByContext(ilTermsOfServiceTableDataProviderFactory::CONTEXT_ACCEPTANCE_HISTORY));
413 $table->populate();
414
415 $this->tpl->setContent($table->getHTML());
416 }

References $table, ilTermsOfServiceTableDataProviderFactory\CONTEXT_ACCEPTANCE_HISTORY, error(), and USER_FOLDER_ID.

Referenced by applyAcceptanceHistoryFilter(), and resetAcceptanceHistoryFilter().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ showAgreementByLanguage()

ilObjTermsOfServiceGUI::showAgreementByLanguage ( )
protected

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

280 {
281 if (!$this->rbacsystem->checkAccess('read', $this->object->getRefId())) {
282 $this->error->raiseError($this->lng->txt('permission_denied'), $this->error->MESSAGE);
283 }
284
285 $this->lng->loadLanguageModule('meta');
286
287 if ($this->rbacsystem->checkAccess('write', $this->object->getRefId())) {
288 $this->toolbar->setFormAction($this->ctrl->getFormAction($this, 'settings'));
289 $this->toolbar->addFormButton($this->lng->txt('tos_reset_tos_for_all_users'), 'confirmReset');
290 }
291
292 $this->showLastResetDate();
293
294 $table = new ilTermsOfServiceAgreementByLanguageTableGUI($this, 'showAgreementByLanguage');
296 $table->populate();
297
298 $this->tpl->setContent($table->getHTML());
299 }

References $table, ilTermsOfServiceTableDataProviderFactory\CONTEXT_AGRREMENT_BY_LANGUAGE, error(), and showLastResetDate().

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

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ showLastResetDate()

ilObjTermsOfServiceGUI::showLastResetDate ( )
protected

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

305 {
306 if ($this->object->getLastResetDate() && $this->object->getLastResetDate()->get(IL_CAL_UNIX) != 0) {
309 $this->toolbar->addText(sprintf($this->lng->txt('tos_last_reset_date'), ilDatePresentation::formatDate($this->object->getLastResetDate())));
311 }
312 }
sprintf('%.4f', $callTime)
const IL_CAL_UNIX
static formatDate(ilDateTime $date, $a_skip_day=false, $a_include_wd=false)
Format a date @access public.
static setUseRelativeDates($a_status)
set use relative dates
static useRelativeDates()
check if relative dates are used

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

Referenced by showAgreementByLanguage().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ showMissingDocuments()

ilObjTermsOfServiceGUI::showMissingDocuments ( )
protected

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

318 {
319 if (!$this->object->getStatus()) {
320 return;
321 }
322
324 $list = $provider->getList(array(), array());
325
326 $has_documents = false;
327 foreach ($list['items'] as $item) {
328 if ($item['agreement_document']) {
329 $has_documents = true;
330 break;
331 }
332 }
333
334 if (!$has_documents) {
335 ilUtil::sendInfo($this->lng->txt('tos_no_documents_exist'));
336 }
337 }
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.

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

Referenced by settings().

+ 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: