File tree Expand file tree Collapse file tree 2 files changed +15
-0
lines changed
Expand file tree Collapse file tree 2 files changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -1826,6 +1826,17 @@ public static function is_visible_by_id(
18261826
18271827 // 4. Checking document visibility (i'm repeating the code in order to be more clear when reading ) - jm
18281828 if ($ user_in_course ) {
1829+ if (true === api_get_configuration_value ('document_enable_accessible_from_date ' )) {
1830+ $ extraFieldValue = new ExtraFieldValue ('document ' );
1831+ $ extraValue = $ extraFieldValue ->get_values_by_handler_and_field_variable ($ doc_id , 'accessible_from ' );
1832+ if (!empty ($ extraValue ) && isset ($ extraValue ['value ' ])) {
1833+ $ now = new DateTime ();
1834+ $ accessibleDate = new DateTime ($ extraValue ['value ' ]);
1835+ if ($ now < $ accessibleDate ) {
1836+ return false ;
1837+ }
1838+ }
1839+ }
18291840 // 4.1 Checking document visibility for a Course
18301841 if ($ session_id == 0 ) {
18311842 $ item_info = api_get_item_property_info (
Original file line number Diff line number Diff line change 24412441// Create a document extra field with field label "can_be_downloaded" of type "Checkbox options".
24422442// $_configuration['documents_hide_download_icon'] = false;
24432443
2444+ // It adds option to define the starting date of accessibility for un document.
2445+ // Create a document extra field with field label "accessible_from" of type "Date and time".
2446+ // $_configuration['document_enable_accessible_from_date'] = false;
2447+
24442448// Add the username value to the "subscription to session" confirmation email
24452449//$_configuration['email_template_subscription_to_session_confirmation_username'] = false;
24462450
You can’t perform that action at this time.
0 commit comments