Skip to content

Commit

Permalink
remove old versoin checks
Browse files Browse the repository at this point in the history
  • Loading branch information
delcroip committed Nov 26, 2023
1 parent fe07bc2 commit bedd940
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 37 deletions.
7 changes: 1 addition & 6 deletions htdocs/timesheet/Timesheet.php
Original file line number Diff line number Diff line change
Expand Up @@ -197,12 +197,7 @@
$ref = dol_sanitizeFileName($object->ref);
$upload_dir = $conf->timesheet->dir_output.'/users/'
.get_exdir($object->id, 2, 0, 0, $object, 'timesheet').$ref;
if (version_compare(DOL_VERSION, "4.0") >= 0) {
include_once DOL_DOCUMENT_ROOT . '/core/actions_linkedfiles.inc.php';
} else{
include_once DOL_DOCUMENT_ROOT . '/core/tpl/document_actions_pre_headers.tpl.php';
//require_once DOL_DOCUMENT_ROOT.'/core/class/html.form.class.php';
}
include_once DOL_DOCUMENT_ROOT . '/core/actions_linkedfiles.inc.php';
}
/***************************************************
* VIEW
Expand Down
6 changes: 1 addition & 5 deletions htdocs/timesheet/TimesheetFavouriteAdmin.php
Original file line number Diff line number Diff line change
Expand Up @@ -245,11 +245,7 @@
case 'create':
default:
//document handling
if (version_compare(DOL_VERSION, "4.0") >= 0) {
include_once DOL_DOCUMENT_ROOT . '/core/actions_linkedfiles.inc.php';
} else{
include_once DOL_DOCUMENT_ROOT . '/core/tpl/document_actions_pre_headers.tpl.php';
}
include_once DOL_DOCUMENT_ROOT . '/core/actions_linkedfiles.inc.php';
if (isset($_GET['urlfile'])) $action = 'viewdoc';
break;
}
Expand Down
15 changes: 5 additions & 10 deletions htdocs/timesheet/TimesheetProjectInvoice.php
Original file line number Diff line number Diff line change
Expand Up @@ -464,7 +464,6 @@

// End of object creation, we show it
if (1) {
if (version_compare(DOL_VERSION, "4.9.9") >= 0) {
foreach ($task_time_array AS $idLine => $task_time_list) {
//dol_syslog("ProjectInvoice::setnvoice".$idLine.' '.$task_time_list, LOG_DEBUG);
Update_task_time_invoice($id, $idLine, $task_time_list);
Expand All @@ -473,7 +472,6 @@
//dol_syslog("ProjectInvoice::setnvoice".$idLine.' '.$task_time_list, LOG_DEBUG);
Update_task_time_invoice(-1, -1, $task_time_list);
}
}
ob_start();
header('Location: ' . $object->getNomUrl(0, '', 0, 1, ''));
ob_end_flush();
Expand Down Expand Up @@ -594,14 +592,11 @@
$Form .= ($ts2Invoice == "all"?"checked":"").'> '
.$langs->trans("All")."</th></tr>";
// not alreqdy invoice
if (version_compare(DOL_VERSION, "4.9.9") >= 0) {
$Form .= '<tr class = "oddeven"><th align = "left" width = "80%">'
.$langs->trans('TimesheetNotInvoiced');
$Form .= '</th><th align = "left">'
.'<input type = "checkbox" name = "tsNotInvoiced" value = "1" ></th></tr>';
} else{
$Form .= '<input type = "hidden" name = "tsNotInvoiced" value = "0">';
}
$Form .= '<tr class = "oddeven"><th align = "left" width = "80%">'
.$langs->trans('TimesheetNotInvoiced');
$Form .= '</th><th align = "left">'
.'<input type = "checkbox" name = "tsNotInvoiced" value = "1" ></th></tr>';

//$invoicabletaskOnly
$Form .= '<tr class = "oddeven"><th align = "left" width = "80%">'.$langs->trans('InvoicableOnly');
$Form .= '</th><th align = "left"><input type = "checkbox" name = "invoicabletaskOnly" value = "1" '
Expand Down
6 changes: 1 addition & 5 deletions htdocs/timesheet/TimesheetUserTasksAdmin.php
Original file line number Diff line number Diff line change
Expand Up @@ -247,11 +247,7 @@
$ref = dol_sanitizeFileName($object->ref);
$upload_dir = $conf->timesheet->dir_output.'/tasks/'
.get_exdir($object->id, 2, 0, 0, $object, 'timesheet').$ref;
if (version_compare(DOL_VERSION, "4.0") >= 0) {
include_once DOL_DOCUMENT_ROOT . '/core/actions_linkedfiles.inc.php';
} else{
include_once DOL_DOCUMENT_ROOT . '/core/tpl/document_actions_pre_headers.tpl.php';
}
include_once DOL_DOCUMENT_ROOT . '/core/actions_linkedfiles.inc.php';
}
//Removing the $token array so the order can't be submitted two times
if (isset($_SESSION['timesheet'][$token])) {
Expand Down
6 changes: 1 addition & 5 deletions htdocs/timesheet/class/TimesheetReport.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -235,11 +235,7 @@ public function getReportArray($forceGroup = false)
$first = true;

$sql = 'SELECT tsk.fk_projet as projectid, ptt.fk_user as userid, tsk.rowid as taskid, ';
if (version_compare(DOL_VERSION, "4.9.9") >= 0) {
$sql .= ' (ptt.invoice_id > 0 or ptt.invoice_line_id>0) AS invoiced,';
}else{
$sql .= ' 0 AS invoiced,';
}
$sql .= ' (ptt.invoice_id > 0 or ptt.invoice_line_id>0) AS invoiced,';
if ($forceGroup == 1){
if ($this->db->type!='pgsql') {
$sql .= " MAX(ptt.rowid) as id, GROUP_CONCAT(ptt.note SEPARATOR '. ') as note, MAX(tske.invoiceable) as invoicable, ";
Expand Down
6 changes: 1 addition & 5 deletions htdocs/timesheet/class/TimesheetTask.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -562,11 +562,7 @@ public function getActuals($timeStart = 0, $timeEnd = 0, $userid = 0)
$dayelapsed = getDayInterval($timeStart, $timeEnd);
if ($dayelapsed<1)return -1;
$sql = "SELECT ptt.rowid, ptt.element_duration, DATE(ptt.element_datehour) AS element_date, ptt.note";
if (version_compare(DOL_VERSION, "4.9.9") >= 0) {
$sql .= ', (ptt.invoice_id > 0 or ptt.invoice_line_id>0) AS invoiced';
}else{
$sql .= ', 0 AS invoiced';
}
$sql .= ', (ptt.invoice_id > 0 or ptt.invoice_line_id>0) AS invoiced';
$sql .= " FROM ".MAIN_DB_PREFIX."element_time AS ptt";
$sql .= " WHERE ";
if ($this->id == -1 && is_array($this->exclusionlist)){
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 @@ -100,7 +100,7 @@ public function __construct($db)
$this->requiredby = array(); // List of modules id to disable if this one is disabled
$this->conflictwith = array(); // List of modules id this module is in conflict with
$this->phpmin = array(5, 0); // Minimum version of PHP required by module
$this->need_dolibarr_version = array(3, 5); // Minimum version of Dolibarr required by module
$this->need_dolibarr_version = array(18, 0); // Minimum version of Dolibarr required by module
$this->langfiles = array("timesheet@timesheet");
// Constants
// List of particular constants to add when module is enabled(key, 'chaine', value, desc, visible, 'current' or 'allentities', deleteonunactive)
Expand Down

0 comments on commit bedd940

Please sign in to comment.