diff --git a/build/docker-compose.yml b/build/docker-compose.yml
index 8826e34..f8eebaa 100644
--- a/build/docker-compose.yml
+++ b/build/docker-compose.yml
@@ -12,8 +12,7 @@ services:
- ..\..\dolibarr_page_from_SQLtable\page_from_table:/var/www/build
ports:
- 18080:80
- env_file:
- .env
+ env_file: .env
links:
- database
database:
@@ -22,15 +21,14 @@ services:
volumes:
- mysql_data_10:/var/lib/mysql
- ./mount:/docker-entrypoint-initdb.d
-## How to reset database
-# 1 on the host download the right db (ver 9 bellow) because the container doesn't have wget
-#wget https://github.com/Dolibarr/dolibarr/raw/develop/dev/initdemo/mysqldump_dolibarr_9.0.0.sql -o dump.sql
-# 2 uncomment the line - ./dump.sql:/var/www/html/dump.sql
-# 3 Attach shell to db containter and run those two commands
-#mysql -u root -p -e "SELECT concat('DROP TABLE IF EXISTS `', table_name, '`;') FROM information_schema.tables WHERE table_schema = 'dolibarr';"
-#mysql -u root -p dolibarr < /var/www/html/dump.sql
- env_file:
- .env
+ ## How to reset database
+ # 1 on the host download the right db (ver 9 bellow) because the container doesn't have wget
+ #wget https://github.com/Dolibarr/dolibarr/raw/develop/dev/initdemo/mysqldump_dolibarr_9.0.0.sql -o dump.sql
+ # 2 uncomment the line - ./dump.sql:/var/www/html/dump.sql
+ # 3 Attach shell to db containter and run those two commands
+ #mysql -u root -p -e "SELECT concat('DROP TABLE IF EXISTS `', table_name, '`;') FROM information_schema.tables WHERE table_schema = 'dolibarr';"
+ #mysql -u root -p dolibarr < /var/www/html/dump.sql
+ env_file: .env
environment:
MYSQL_ROOT_PASSWORD: ${DOLI_DB_PASSWORD}
MYSQL_DATABASE: ${DOLI_DB_NAME}
@@ -39,5 +37,4 @@ services:
# ports:
# - 3306:3306
volumes:
- mysql_data_10:
- # password admin adminadmin
\ No newline at end of file
+ mysql_data_10: # password admin adminadmin
diff --git a/htdocs/timesheet/AttendanceEventAdmin.php b/htdocs/timesheet/AttendanceEventAdmin.php
index fdbe5dd..ead5310 100644
--- a/htdocs/timesheet/AttendanceEventAdmin.php
+++ b/htdocs/timesheet/AttendanceEventAdmin.php
@@ -505,7 +505,7 @@ function init_myfunc()
$duration = ($obj->date_time_event_start <> "")
?$db->jdate($obj->date_time_event)-$db->jdate($obj->date_time_event_start):'';
print "
".formatTime($duration, 0)." | ";
- print ''
+ print ' | '
.img_delete().' | ';
print "";
}
diff --git a/htdocs/timesheet/Timesheet.php b/htdocs/timesheet/Timesheet.php
index 491bd62..6eb7f0e 100644
--- a/htdocs/timesheet/Timesheet.php
+++ b/htdocs/timesheet/Timesheet.php
@@ -222,7 +222,7 @@
print $task_timesheet->getHTMLGetOtherUserTs($SubordiateIds, $userid, $admin, $token);
}
//$ajax = false;
-$Form = $task_timesheet->getHTMLNavigation($optioncss);
+$Form = $task_timesheet->getHTMLNavigation($optioncss, $token);
$Form .= $task_timesheet->getHTMLFormHeader();
$Form .= $task_timesheet->getHTMLActions();
if (getConf('TIMESHEET_WHITELIST') == 1) {
diff --git a/htdocs/timesheet/TimesheetFavouriteAdmin.php b/htdocs/timesheet/TimesheetFavouriteAdmin.php
index 3f6710f..9cade79 100644
--- a/htdocs/timesheet/TimesheetFavouriteAdmin.php
+++ b/htdocs/timesheet/TimesheetFavouriteAdmin.php
@@ -290,7 +290,7 @@ function init_myfunc()
$edit = 1;
case 'delete';
if ($action == 'delete' && ($id>0 || $ref!="")) {
- $ret = $form->form_confirm($PHP_SELF.'?action=confirm_delete&id='.$id,
+ $ret = $form->form_confirm($PHP_SELF.'?action=confirm_delete&token='.$token.'&id='.$id,
$langs->trans('DeleteTimesheetwhitelist'), $langs->trans('ConfirmDeleteTimesheetwhitelist'),
'confirm_delete', '', 0, 1);
if ($ret == 'html') print '
';
@@ -492,9 +492,9 @@ function init_myfunc()
$userId = (is_object($user)?$user->id:$user);
if (empty($reshook) && ($admin || $userId == $object->user)) {
print '';
}
@@ -502,7 +502,7 @@ function init_myfunc()
break;
case 'delete':
if (($id>0 || $ref!='')) {
- $ret = $form->form_confirm('?action=confirm_delete&id='.$id,
+ $ret = $form->form_confirm('?action=confirm_delete&token='.$token.'&id='.$id,
$langs->trans('DeleteTimesheetwhitelist'),
$langs->trans('ConfirmDeleteTimesheetwhitelist'), 'confirm_delete', '', 0, 1);
if ($ret == 'html') print '
';
@@ -709,7 +709,7 @@ function init_myfunc()
print "".$obj->subtask." | ";
print "".dol_print_date($obj->date_start, 'day')." | ";
print "".dol_print_date($obj->date_end, 'day')." | ";
- print ''.img_delete().' | ';
+ print ''.img_delete().' | ';
print "";
}
$i++;
@@ -721,7 +721,7 @@ function init_myfunc()
print ''."\n";
print ''."\n";
// new button
- print ''.$langs->trans('New');
+ print ''.$langs->trans('New');
print ' '.$langs->trans('Timesheetwhitelist')."\n";
break;
}
@@ -735,15 +735,15 @@ function init_myfunc()
*/
function reloadpage($backtopage = "", $id = "", $ref = "")
{
- if (!empty($backtopage)) {
- header("Location: ".$backtopage);
- } elseif (!empty($ref)) {
- header("Location: ".$_SERVER["PHP_SELF"].'?action=view&ref='.$id);
- } elseif ($id>0) {
- header("Location: ".$_SERVER["PHP_SELF"].'?action=view&id='.$id);
- } else{
- header("Location: ".$_SERVER["PHP_SELF"].'?action=list');
- }
+ if (!empty($backtopage)) {
+ header("Location: ".$backtopage);
+ } elseif (!empty($ref)) {
+ header("Location: ".$_SERVER["PHP_SELF"].'?action=view&ref='.$id);
+ } elseif ($id>0) {
+ header("Location: ".$_SERVER["PHP_SELF"].'?action=view&id='.$id);
+ } else{
+ header("Location: ".$_SERVER["PHP_SELF"].'?action=list');
+ }
ob_end_flush();
exit();
}
diff --git a/htdocs/timesheet/TimesheetOtherApproval.php b/htdocs/timesheet/TimesheetOtherApproval.php
index 040b543..36f4708 100644
--- a/htdocs/timesheet/TimesheetOtherApproval.php
+++ b/htdocs/timesheet/TimesheetOtherApproval.php
@@ -47,8 +47,11 @@
// end find the role
// get other param
$action = GETPOST('action', 'alpha');
+$offset = GETPOST('offset', 'int');
if (!is_numeric($offset))$offset = 0;
-$print = (GETPOST('optioncss', 'alpha') == 'print')?true:false;
+$optioncss = GETPOST('optioncss', 'alpha');
+$print = ($optioncss == 'print')?true:false;
+
$current = GETPOST('target', 'int');
$token = GETPOST('token', 'alpha');
if ($current == null)$current = '0';
@@ -201,19 +204,20 @@ function getHTMLNavigation($role, $optioncss, $selectList,$token, $current = 0)
$form = new Form($db);
$Nav = ''."\n\t".''."\n\t\t".''."\n\t\t\t";
if ($current!=0) {
- $Nav .= 'trans("Previous").' '."\n\t\t";
}
$Nav .= " | \n\t\t\n\t\t\t";
$Nav .= ''."\n\t\t | \n\t\t\n\t\t\t";
+ $Nav .= $langs->trans("GoTo").': '.$htmlSelect."\n\t\t\t";
$Nav .= '';
+ $Nav .= ''."\n\t\t | \n\t\t\n\t\t\t";
+
if ($currenttrans("Next").' >>';
@@ -229,7 +233,7 @@ function getHTMLNavigation($role, $optioncss, $selectList,$token, $current = 0)
function getTStobeApproved($current, $selectList)
{
global $db;
- if ((!is_array($selectList) || !is_array($selectList[$current]['idList'])))return array();
+ if ((!is_array($selectList) || !array_key_exists($current,$selectList) ||!is_array($selectList[$current]['idList'])))return array();
$listTTA = array();
foreach ($selectList[$current]['idList'] as $idTTA) {
$TTA = new TimesheetTask($db);
@@ -340,7 +344,7 @@ function getHTMLRows($objectArray)
{
global $langs, $conf;
$headers = array('Approval', 'Note', 'Tasks', 'User');
- if (!is_array($objectArray) || !is_object($objectArray[0])) return -1;
+ if (!is_array($objectArray) || !array_key_exists(0,$objectArray) || !is_object($objectArray[0])) return -1;
echo '';
echo ''.$langs->trans('Approval').' | ';
echo ''.$langs->trans('Note').' | ';
diff --git a/htdocs/timesheet/TimesheetTeamApproval.php b/htdocs/timesheet/TimesheetTeamApproval.php
index 6f50525..e778551 100644
--- a/htdocs/timesheet/TimesheetTeamApproval.php
+++ b/htdocs/timesheet/TimesheetTeamApproval.php
@@ -245,7 +245,7 @@
}
} else{
- $Form .= ''.$langs->trans('NothingToValidate').'';
+ $Form = ''.$langs->trans('NothingToValidate').'';
$staticTs = new TimesheetUserTasks($db);
$staticTs->token = $token;
$Form .= $staticTs->getHTMLFooterAp($current);
@@ -366,18 +366,18 @@ function getHTMLNavigation($optioncss, $selectList, $token, $current = 0)
$form = new Form($db);
$Nav = ''."\n\t".''."\n\t\t".''."\n\t\t\t";
if ($current!=0) {
- $Nav .= 'trans("Previous").' '."\n\t\t";
}
$Nav .= " | \n\t\t\n\t\t\t";
- $Nav .= ''."\n\t\t | \n\t\t\n\t\t\t";
if ($currenttrans("Next").' >>';
}
diff --git a/htdocs/timesheet/TimesheetUserTasksAdmin.php b/htdocs/timesheet/TimesheetUserTasksAdmin.php
index 4232b2c..a9ef2e2 100644
--- a/htdocs/timesheet/TimesheetUserTasksAdmin.php
+++ b/htdocs/timesheet/TimesheetUserTasksAdmin.php
@@ -295,7 +295,7 @@ function init_myfunc()
$edit = 1;
case 'delete';
if ($action == 'delete' && ($id>0 || $ref!="")) {
- $ret = $form->form_confirm($PHP_SELF.'?action=confirm_delete&id='
+ $ret = $form->form_confirm($PHP_SELF.'?action=confirm_delete&token='.$token.'&id='
.$id, $langs->trans('DeleteTimesheetuser'),
$langs->trans('ConfirmDelete'), 'confirm_delete', '', 0, 1);
if ($ret == 'html') print ' ';
@@ -434,12 +434,12 @@ function init_myfunc()
//if ($user->rights->Timesheetuser->edit)
//{
print ''.$langs->trans('Update').'';
+ .'&action=edit&token='.$token.'" class = "butAction">'.$langs->trans('Update').'';
//}
//if ($user->rights->Timesheetuser->delete)
//{
print ''.$langs->trans('Delete').'';
+ .$id.'&action=delete&token='.$token.'">'.$langs->trans('Delete').'';
//}
//else
//{
@@ -494,7 +494,7 @@ function init_myfunc()
break;
case 'delete':
if (($id>0 || $ref!='')) {
- $ret = $form->form_confirm($PHP_SELF.'?action=confirm_delete&id='.$id, $langs->trans('DeleteTimesheetuser'), $langs->trans('ConfirmDelete'), 'confirm_delete', '', 0, 1);
+ $ret = $form->form_confirm($PHP_SELF.'?action=confirm_delete&token='.$token.'&id='.$id, $langs->trans('DeleteTimesheetuser'), $langs->trans('ConfirmDelete'), 'confirm_delete', '', 0, 1);
if ($ret == 'html') print ' ';
//to have the object to be deleted in the background
}
@@ -630,7 +630,7 @@ function init_myfunc()
print "".print_generic('user', 'rowid', $obj->fk_userid, 'lastname', 'firstname', ' ')." | ";
print "".dol_print_date($obj->date_start, 'day')." | ";
print "".$langs->trans(strtolower($statusA[$obj->status]))." | ";
- print ''.img_delete().' | ';
+ print ''.img_delete().' | ';
print " | ";
}
$i++;
@@ -656,6 +656,7 @@ function init_myfunc()
*/
function reloadpage($backtopage, $id)
{
+ global $token;
if (!empty($backtopage)) {
header("Location: ".$backtopage);
// header("Location: ".$_SERVER["PHP_SELF"].'?action=view&ref='.$ref);
@@ -677,7 +678,7 @@ function reloadpage($backtopage, $id)
*/
function Timesheetuser_prepare_head($object)
{
- global $langs, $conf, $user;
+ global $langs, $conf, $user, $token;
$h = 0;
$head = array();
$head[$h][0] = $_SERVER["PHP_SELF"].'?action=view&id='.$object->id;
diff --git a/htdocs/timesheet/class/AttendanceEvent.class.php b/htdocs/timesheet/class/AttendanceEvent.class.php
index 5e22076..825a3f6 100644
--- a/htdocs/timesheet/class/AttendanceEvent.class.php
+++ b/htdocs/timesheet/class/AttendanceEvent.class.php
@@ -269,7 +269,7 @@ public function update($user, $notrigger = 0)
*/
public function getNomUrl($withpicto = 0, $id = 0, $ref = '' )
{
- global $conf, $langs;
+ global $conf, $langs,$token;
if (! empty($conf->dol_no_mouse_hover)) $notooltip = 1;// Force disable tooltips
$result = '';
if (empty($ref) && $id == 0) {
@@ -750,9 +750,9 @@ public function ajaxHeartbeat($user, $json)
*/
public function getHTMLGetOtherUserTs($idsList, $selected, $admin)
{
- global $langs;
+ global $langs,$token;
$form = new Form($this->db);
- $HTML = ' |