Skip to content

Commit

Permalink
Merge pull request #121 from delcroip/develop
Browse files Browse the repository at this point in the history
rev 4.3.1
  • Loading branch information
delcroip authored Aug 1, 2020
2 parents 8d04b82 + 0a4644e commit c2a1b56
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 7 deletions.
5 changes: 5 additions & 0 deletions htdocs/timesheet/ChangeLog.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
# dolibarr_project_timesheet changelog
4.3.1
- fix: show only active user in unserreport (admin)
- fix: missing SQL quotes
- fix: wrong task in reports

4.3.0
- new: possibility to ungroup reports
- fix: remove closed project (without end date) task
Expand Down
2 changes: 1 addition & 1 deletion htdocs/timesheet/TimesheetReportUser.php
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@
$sql .= 'JOIN '.MAIN_DB_PREFIX.'element_contact as ec '
.' ON ec.fk_socpeople = usr.rowid '
.' LEFT JOIN '.MAIN_DB_PREFIX.'c_type_contact as ctc ON ctc.rowid = ec.fk_c_type_contact'
.' WHERE ctc.element in (\'project_task\', \'project\') AND ctc.active = \'1\' ';
.' WHERE ctc.element in (\'project_task\', \'project\') AND ctc.active = \'1\' AND usr.statut = \'1\' ';
if(!$user->admin) {
$list = getSubordinates($db, $userid, 3);
$list[] = $userid;
Expand Down
4 changes: 2 additions & 2 deletions htdocs/timesheet/class/AttendanceEvent.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -789,9 +789,9 @@ public function fetchTasks($userid = '', $date = '')
$sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'projet as prj ON prj.rowid = tsk.fk_projet ';
$sql .= " WHERE ec.fk_socpeople = '".$userid."' AND ctc.element = 'project_task' ";
if($conf->global->TIMESHEET_HIDE_DRAFT == '1') {
$sql .= ' AND prj.fk_statut = 1)';
$sql .= ' AND prj.fk_statut = \'1\')';
}else{
$sql .= ' AND prj.fk_statut in (0, 1)';
$sql .= ' AND prj.fk_statut in (\'0\', \'1\')';
}
$sql .= ' AND (prj.datee >= \''.$this->db->idate($datestart).'\' OR prj.datee IS NULL)';
$sql .= ' AND (prj.dateo <= \''.$this->db->idate($datestop).'\' OR prj.dateo IS NULL)';
Expand Down
2 changes: 1 addition & 1 deletion htdocs/timesheet/class/TimesheetReport.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ public function getReportArray($forceGroup = false)
$resArray = array();
$first = true;

$sql = 'SELECT tsk.fk_projet as projectid, ptt.fk_user as userid, tsk.fk_projet as taskid, ptt.rowid as id,';
$sql = 'SELECT tsk.fk_projet as projectid, ptt.fk_user as userid, tsk.rowid as taskid, ptt.rowid as id,';
if(version_compare(DOL_VERSION, "4.9.9") >= 0) {
$sql .= ' (ptt.invoice_id > 0 or ptt.invoice_line_id>0) AS invoiced,';
}else{
Expand Down
4 changes: 2 additions & 2 deletions htdocs/timesheet/class/TimesheetUserTasks.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -527,9 +527,9 @@ public function fetchTaskTimesheet($userid = '')
//end approval
$sql .= " WHERE ec.fk_socpeople = '".$userid."' AND ctc.element = 'project_task' ";
if($conf->global->TIMESHEET_HIDE_DRAFT == '1') {
$sql .= ' AND prj.fk_statut = 1)';
$sql .= ' AND prj.fk_statut = \'1\')';
}else{
$sql .= ' AND prj.fk_statut in (0, 1)';
$sql .= ' AND prj.fk_statut in (\'0\',\'1\')';
}
$sql .= ' AND (prj.datee >= \''.$this->db->idate($datestart).'\' OR prj.datee IS NULL)';
$sql .= ' AND (prj.dateo <= \''.$this->db->idate($datestop).'\' OR prj.dateo IS NULL)';
Expand Down
2 changes: 1 addition & 1 deletion htdocs/timesheet/core/modules/modtimesheet.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public function __construct($db)
// Module description, used if translation string 'ModuleXXXDesc' not found(where XXX is value of numeric property 'numero' of module)
$this->description = "TimesheetView";
// Possible values for version are: 'development', 'experimental', 'dolibarr' or version
$this->version = '4.3.0';
$this->version = '4.3.1';
// Key used in llx_cons table to save module status enabled/disabled(where timesheet is value of property name of module in uppercase)
$this->const_name = 'MAIN_MODULE_'.strtoupper($this->name);
// Where to store the module in setup page(0=common, 1=interface, 2=others, 3=very specific)
Expand Down

0 comments on commit c2a1b56

Please sign in to comment.