Skip to content

Commit

Permalink
Merge pull request Evarisk#385 from nicolas-eoxia/add_rework_timespen…
Browse files Browse the repository at this point in the history
…t_view

Evarisk#73 [TimeSpent] add: rework timespent view with range instead of 3 views
  • Loading branch information
nicolas-eoxia authored Jul 13, 2023
2 parents 5d557e5 + 52d27d2 commit cf506b9
Show file tree
Hide file tree
Showing 10 changed files with 839 additions and 2,494 deletions.
2 changes: 1 addition & 1 deletion admin/setup.php
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@
$bookmark = new Bookmark($db);

$bookmark->title = $langs->transnoentities('TimeSpent');
$bookmark->url = DOL_URL_ROOT . '/custom/dolisirh/view/timespent_month.php';
$bookmark->url = DOL_URL_ROOT . '/custom/dolisirh/view/timespent_range.php?view_mode=month';
$bookmark->target = 0;
$bookmark->position = 10;
$bookmark->create();
Expand Down
8 changes: 4 additions & 4 deletions core/modules/modDoliSIRH.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ public function __construct($db)
$i++ => ['DOLISIRH_SHOW_PATCH_NOTE', 'integer', 1, '', 0, 'current'],
$i++ => ['DOLISIRH_DB_VERSION', 'chaine', $this->version, '', 0, 'current'],
$i++ => ['DOLISIRH_VERSION','chaine', $this->version, '', 0, 'current'],

// CONST DOLISIRH DOCUMENTS.
$i++ => ['DOLISIRH_AUTOMATIC_PDF_GENERATION', 'integer', 0, '', 0, 'current'],
$i++ => ['DOLISIRH_MANUAL_PDF_GENERATION', 'integer', 0, '', 0, 'current'],
Expand Down Expand Up @@ -421,7 +421,7 @@ public function __construct($db)
'prefix' => '<i class="far fa-clock pictofixedwidth"></i>',
'mainmenu' => 'dolisirh',
'leftmenu' => 'timespent',
'url' => '/dolisirh/view/timespent_month.php',
'url' => '/dolisirh/view/timespent_range.php?view_mode=month',
'langs' => 'dolisirh@dolisirh',
'position' => 1000 + $r,
'enabled' => '$conf->dolisirh->enabled && $conf->projet->enabled',
Expand Down Expand Up @@ -468,7 +468,7 @@ public function __construct($db)
'titre' => '<i class="fas fa-id-card pictofixedwidth" style="padding-right: 4px;"></i>' . $langs->transnoentities('TimeSpending'),
'mainmenu' => 'project',
'leftmenu' => 'timespent',
'url' => '/dolisirh/view/timespent_day.php',
'url' => '/dolisirh/view/timespent_range.php?view_mode=month',
'langs' => 'dolisirh@dolisirh',
'position' => 1000 + $r,
'enabled' => '$conf->dolisirh->enabled && $conf->projet->enabled',
Expand Down Expand Up @@ -499,7 +499,7 @@ public function __construct($db)
'titre' => '<i class="fas fa-id-card pictofixedwidth" style="padding-right: 4px;"></i>' . $langs->transnoentities('TimeSpending'),
'mainmenu' => 'hrm',
'leftmenu' => 'timespent',
'url' => '/dolisirh/view/timespent_day.php',
'url' => '/dolisirh/view/timespent_range.php?view_mode=month',
'langs' => 'dolisirh@dolisirh',
'position' => 1000 + $r,
'enabled' => '$conf->dolisirh->enabled && $conf->salaries->enabled',
Expand Down
2 changes: 1 addition & 1 deletion js/dolisirh.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions js/modules/task.js
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ window.dolisirh.task.showOnlyFavoriteTasks = function() {
}

$.ajax({
url: document.URL + querySeparator + "action=showOnlyFavoriteTasks&token=" + token,
url: document.URL + querySeparator + "action=show_only_favorite_tasks&token=" + token,
type: "POST",
processData: false,
data: JSON.stringify({
Expand Down Expand Up @@ -183,7 +183,7 @@ window.dolisirh.task.showOnlyTasksWithTimeSpent = function() {
}

$.ajax({
url: document.URL + querySeparator + "action=showOnlyTasksWithTimeSpent&token=" + token,
url: document.URL + querySeparator + "action=show_only_tasks_with_timespent&token=" + token,
type: "POST",
processData: false,
data: JSON.stringify({
Expand Down Expand Up @@ -226,7 +226,7 @@ window.dolisirh.task.createTimeSpent = function() {
document.URL.match(/\?/) ? querySeparator = '&' : 1;

$.ajax({
url: document.URL + querySeparator + 'action=addTimeSpent&token=' + token,
url: document.URL + querySeparator + 'action=add_timespent&token=' + token,
data: JSON.stringify({
taskID: taskID,
timestamp: timestamp,
Expand Down
Loading

0 comments on commit cf506b9

Please sign in to comment.