';
$placeholder = '';
@@ -2253,7 +2291,7 @@ function projectLinesPerMonth(&$inc, $firstdaytoshow, $fuser, $parent, $lines, &
//$tableCell.='+';
}
- $tableCell .= '';
diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang
index b7618f64739..0273e4762e1 100644
--- a/htdocs/langs/en_US/admin.lang
+++ b/htdocs/langs/en_US/admin.lang
@@ -84,6 +84,7 @@ NumberOfBytes=Number of Bytes
SearchString=Search string
NotAvailableWhenAjaxDisabled=Not available when Ajax disabled
AllowToSelectProjectFromOtherCompany=On document of a third party, can choose a project linked to another third party
+TimesheetPreventAfterFollowingMonths=Prevent recording time spent after the following number of months
JavascriptDisabled=JavaScript disabled
UsePreviewTabs=Use preview tabs
ShowPreview=Show preview
diff --git a/htdocs/langs/en_US/projects.lang b/htdocs/langs/en_US/projects.lang
index 2fda7e1df0e..c5679cf5774 100644
--- a/htdocs/langs/en_US/projects.lang
+++ b/htdocs/langs/en_US/projects.lang
@@ -140,6 +140,7 @@ NoTasks=No tasks for this project
LinkedToAnotherCompany=Linked to other third party
TaskIsNotAssignedToUser=Task not assigned to user. Use button '%s' to assign task now.
ErrorTimeSpentIsEmpty=Time spent is empty
+TimeRecordingRestrictedToNMonthsBack=Time recording is restricted to %s months back
ThisWillAlsoRemoveTasks=This action will also delete all tasks of project (%s tasks at the moment) and all inputs of time spent.
IfNeedToUseOtherObjectKeepEmpty=If some objects (invoice, order, ...), belonging to another third party, must be linked to the project to create, keep this empty to have the project being multi third parties.
CloneTasks=Clone tasks
diff --git a/htdocs/projet/admin/project.php b/htdocs/projet/admin/project.php
index 288e2282a40..eaea44dd22b 100644
--- a/htdocs/projet/admin/project.php
+++ b/htdocs/projet/admin/project.php
@@ -219,6 +219,10 @@ if ($action == 'updateMaskTask') {
$projectToSelect = GETPOST('projectToSelect', 'alpha');
dolibarr_set_const($db, 'PROJECT_ALLOW_TO_LINK_FROM_OTHER_COMPANY', $projectToSelect, 'chaine', 0, '', $conf->entity); //Allow to disable this configuration if empty value
}
+ if (GETPOST('PROJECT_TIMESHEET_PREVENT_AFTER_MONTHS')) {
+ $timesheetFreezeDuration = GETPOST('timesheetFreezeDuration', 'alpha');
+ dolibarr_set_const($db, 'PROJECT_TIMESHEET_PREVENT_AFTER_MONTHS', intval($timesheetFreezeDuration), 'chaine', 0, '', $conf->entity); //Allow to disable this configuration if empty value
+ }
} elseif (preg_match('/^(set|del)_?([A-Z_]+)$/', $action, $reg)) {
// Set boolean (on/off) constants
if (!dolibarr_set_const($db, $reg[2], ($reg[1] === 'set' ? '1' : '0'), 'chaine', 0, '', $conf->entity) > 0) {
@@ -797,6 +801,7 @@ print '';
print '