mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2026-02-07 16:41:48 +01:00
Debug v23
This commit is contained in:
@@ -2107,7 +2107,8 @@ class Task extends CommonObjectLine
|
||||
|
||||
$timespent->element_date = $this->timespent_date;
|
||||
$timespent->element_datehour = $this->timespent_datehour;
|
||||
$timespent->element_date_withhour = $this->timespent_withhour;
|
||||
|
||||
$timespent->element_date_withhour = $this->timespent_withhour; // 0 or 1
|
||||
$timespent->element_duration = $this->timespent_duration;
|
||||
if ($this->timespent_fk_user > 0) {
|
||||
$timespent->fk_user = $this->timespent_fk_user;
|
||||
@@ -2118,7 +2119,9 @@ class Task extends CommonObjectLine
|
||||
$timespent->invoice_line_id = $this->timespent_invoicelineid;
|
||||
|
||||
dol_syslog(get_class($this)."::updateTimeSpent", LOG_DEBUG);
|
||||
if ($timespent->update($user) > 0) {
|
||||
|
||||
$resupdate = $timespent->update($user);
|
||||
if ($resupdate > 0) {
|
||||
if (!$notrigger) {
|
||||
// Call trigger
|
||||
$result = $this->call_trigger('TASK_TIMESPENT_MODIFY', $user);
|
||||
|
||||
@@ -33,15 +33,6 @@
|
||||
|
||||
// Load Dolibarr environment
|
||||
require '../../main.inc.php';
|
||||
require_once DOL_DOCUMENT_ROOT . '/projet/class/project.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT . '/projet/class/task.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT . '/compta/facture/class/facture.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT . '/core/lib/project.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT . '/core/lib/date.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT . '/core/class/html.formother.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT . '/core/class/html.formprojet.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT . '/core/class/html.formintervention.class.php';
|
||||
|
||||
/**
|
||||
* @var Conf $conf
|
||||
* @var DoliDB $db
|
||||
@@ -53,6 +44,14 @@ require_once DOL_DOCUMENT_ROOT . '/core/class/html.formintervention.class.php';
|
||||
'
|
||||
@phan-var-force ?string $uploaddir
|
||||
';
|
||||
require_once DOL_DOCUMENT_ROOT . '/projet/class/project.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT . '/projet/class/task.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT . '/compta/facture/class/facture.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT . '/core/lib/project.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT . '/core/lib/date.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT . '/core/class/html.formother.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT . '/core/class/html.formprojet.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT . '/core/class/html.formintervention.class.php';
|
||||
|
||||
// Load translation files required by the page
|
||||
$langsLoad = array('projects', 'bills', 'orders', 'companies');
|
||||
@@ -72,8 +71,9 @@ $backtopage = GETPOST('backtopage', 'alpha'); // Go back to a dedicated page
|
||||
$optioncss = GETPOST('optioncss', 'alpha');
|
||||
$mode = GETPOST('mode', 'alpha');
|
||||
|
||||
$id = GETPOSTINT('id');
|
||||
$projectid = GETPOSTINT('projectid');
|
||||
$id = GETPOSTINT('id'); // Id of task
|
||||
$projectid = GETPOSTINT('projectid'); // Id of project
|
||||
$lineid = GETPOSTINT('lineid'); // Id of time spent line
|
||||
$ref = GETPOST('ref', 'alpha');
|
||||
$withproject = GETPOSTINT('withproject');
|
||||
$project_ref = GETPOST('project_ref', 'alpha');
|
||||
@@ -164,6 +164,7 @@ if ($object->fk_project > 0) {
|
||||
/*
|
||||
* Actions
|
||||
*/
|
||||
|
||||
$error = 0;
|
||||
|
||||
if (GETPOST('cancel', 'alpha')) {
|
||||
@@ -289,11 +290,10 @@ if (($action == 'updateline' || $action == 'updatesplitline') && !$cancel && $us
|
||||
$timespent_date = dol_mktime(12, 0, 0, GETPOSTINT("timelinemonth"), GETPOSTINT("timelineday"), GETPOSTINT("timelineyear"));
|
||||
|
||||
if (!$error) {
|
||||
if (GETPOSTINT('taskid') != $id) { // GETPOST('taskid') is id of new task
|
||||
$id_temp = GETPOSTINT('taskid'); // should not overwrite $id
|
||||
if (GETPOSTINT('taskid') != $id) { // GETPOSTINT('taskid') is the id of new task
|
||||
$id_temp = GETPOSTINT('taskid'); // should not overwrite $id
|
||||
|
||||
|
||||
$object->fetchTimeSpent(GETPOSTINT('lineid'));
|
||||
$object->fetchTimeSpent($lineid);
|
||||
|
||||
$result = 0;
|
||||
|
||||
@@ -326,7 +326,7 @@ if (($action == 'updateline' || $action == 'updatesplitline') && !$cancel && $us
|
||||
}
|
||||
}
|
||||
} else {
|
||||
$object->fetch($id, $ref);
|
||||
$object->fetch($id, $ref); // $object is Task
|
||||
|
||||
$object->fetchTimeSpent(GETPOSTINT('lineid'));
|
||||
|
||||
@@ -334,17 +334,21 @@ if (($action == 'updateline' || $action == 'updatesplitline') && !$cancel && $us
|
||||
$object->timespent_old_duration = GETPOSTINT("old_duration");
|
||||
$object->timespent_duration = GETPOSTINT("new_durationhour") * 60 * 60; // We store duration in seconds
|
||||
$object->timespent_duration += (GETPOSTINT("new_durationmin") ? GETPOSTINT('new_durationmin') : 0) * 60; // We store duration in seconds
|
||||
|
||||
if (GETPOST("timelinehour") != '' && GETPOST("timelinehour") >= 0) { // If hour was entered
|
||||
$object->timespent_date = dol_mktime(GETPOSTINT("timelinehour"), GETPOSTINT("timelinemin"), 0, GETPOSTINT("timelinemonth"), GETPOSTINT("timelineday"), GETPOSTINT("timelineyear"));
|
||||
$object->timespent_withhour = 1;
|
||||
} elseif (!empty($timespent_date)) {
|
||||
$object->timespent_date = $timespent_date;
|
||||
$object->timespent_datehour = $timespent_date;
|
||||
$object->timespent_withhour = 0;
|
||||
}
|
||||
|
||||
$object->timespent_fk_user = GETPOSTINT("userid_line");
|
||||
$object->timespent_fk_product = GETPOSTINT("fk_product");
|
||||
$object->timespent_invoiceid = GETPOSTINT("invoiceid");
|
||||
$object->timespent_invoicelineid = GETPOSTINT("invoicelineid");
|
||||
|
||||
$result = 0;
|
||||
|
||||
if (in_array($object->timespent_fk_user, $childids) || $user->hasRight('projet', 'all', 'creer')) {
|
||||
@@ -1398,9 +1402,6 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0 || $allprojectforuser
|
||||
// Add $param from extra fields
|
||||
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_param.tpl.php';
|
||||
*/
|
||||
if ($id) {
|
||||
$param .= '&id=' . urlencode((string) ($id));
|
||||
}
|
||||
if ($projectid) {
|
||||
$param .= '&projectid=' . urlencode((string) ($projectid));
|
||||
}
|
||||
@@ -1434,7 +1435,6 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0 || $allprojectforuser
|
||||
print '<input type="hidden" name="sortfield" value="' . $sortfield . '">';
|
||||
print '<input type="hidden" name="sortorder" value="' . $sortorder . '">';
|
||||
|
||||
print '<input type="hidden" name="id" value="' . $id . '">';
|
||||
print '<input type="hidden" name="projectid" value="' . $projectidforalltimes . '">';
|
||||
print '<input type="hidden" name="withproject" value="' . $withproject . '">';
|
||||
print '<input type="hidden" name="tab" value="' . $tab . '">';
|
||||
@@ -1598,7 +1598,7 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0 || $allprojectforuser
|
||||
|
||||
$sql = "SELECT t.rowid, t.fk_element, t.element_date, t.element_datehour, t.element_date_withhour, t.element_duration, t.fk_user, t.note, t.thm,";
|
||||
$sql .= " t.fk_product,";
|
||||
$sql .= " pt.ref, pt.label, pt.fk_projet,";
|
||||
$sql .= " pt.rowid as taskid, pt.ref, pt.label, pt.fk_projet,";
|
||||
$sql .= " u.lastname, u.firstname, u.login, u.photo, u.gender, u.statut as user_status,";
|
||||
$sql .= " il.fk_facture as invoice_id, inv.fk_statut,";
|
||||
$sql .= " p.fk_soc,s.name_alias,";
|
||||
@@ -1769,7 +1769,9 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0 || $allprojectforuser
|
||||
$i = 0;
|
||||
while ($i < $num) {
|
||||
$row = $db->fetch_object($resql);
|
||||
|
||||
$tasks[$i] = $row;
|
||||
|
||||
$i++;
|
||||
}
|
||||
$db->free($resql);
|
||||
@@ -2158,6 +2160,7 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0 || $allprojectforuser
|
||||
print '<td class="center nowraponall">';
|
||||
if (($action == 'editline' || $action == 'splitline') && GETPOSTINT('lineid') == $task_time->rowid) {
|
||||
print '<input type="hidden" name="lineid" value="' . GETPOSTINT('lineid') . '">';
|
||||
print '<input type="hidden" name="id" value="' . $task_time->taskid . '">';
|
||||
print '<input type="submit" class="button buttongen reposition smallpaddingimp margintoponlyshort marginbottomonlyshort button-save" name="save" value="'.$langs->trans("Save").'">';
|
||||
print '<br>';
|
||||
print '<input type="submit" class="button buttongen reposition smallpaddingimp margintoponlyshort marginbottomonlyshort button-cancel" name="cancel" value="'.$langs->trans("Cancel").'">';
|
||||
|
||||
Reference in New Issue
Block a user