diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 43b23c17bb0..2070fe85bf5 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -10328,9 +10328,9 @@ abstract class CommonObject /** * Create object in the database * - * @param User $user User that creates - * @param int<0,1> $notrigger 0=launch triggers after, 1=disable triggers - * @return int<-1,max> Return integer <0 if KO, Id of created object if OK + * @param User $user User that creates + * @param int<0,1> $notrigger 0=launch triggers after, 1=disable triggers + * @return int<-1,max> Return integer <0 if KO, Id of created object if OK */ public function createCommon(User $user, $notrigger = 0) { @@ -10350,6 +10350,7 @@ abstract class CommonObject $fieldvalues['date_creation'] = $this->db->idate($now); $this->date_creation = $this->db->idate($now); } + // For backward compatibility, if a property ->fk_user_creat exists and not filled. if (array_key_exists('fk_user_creat', $fieldvalues) && !($fieldvalues['fk_user_creat'] > 0)) { $fieldvalues['fk_user_creat'] = $user->id; $this->fk_user_creat = $user->id; diff --git a/htdocs/core/modules/modAdherent.class.php b/htdocs/core/modules/modAdherent.class.php index 51dd74cc117..2445000cee1 100644 --- a/htdocs/core/modules/modAdherent.class.php +++ b/htdocs/core/modules/modAdherent.class.php @@ -182,7 +182,7 @@ class modAdherent extends DolibarrModules $this->const[$r][0] = "MEMBER_ADDON_PDF_ODT_PATH"; $this->const[$r][1] = "chaine"; - $this->const[$r][2] = "DOL_DATA_ROOT/doctemplates/members"; + $this->const[$r][2] = "DOL_DATA_ROOT".($conf->entity > 1 ? '/'.$conf->entity : '')."/doctemplates/members"; $this->const[$r][3] = ""; $this->const[$r][4] = 0; $r++; @@ -438,8 +438,8 @@ class modAdherent extends DolibarrModules // ODT template /* - $src=DOL_DOCUMENT_ROOT.'/install/doctemplates/orders/template_order.odt'; - $dirodt=DOL_DATA_ROOT.'/doctemplates/orders'; + $src=DOL_DOCUMENT_ROOT.'/install/doctemplates/members/template_member.odt'; + $dirodt=DOL_DATA_ROOT.($conf->entity > 1 ? '/'.$conf->entity : '').'/doctemplates/members'; $dest=$dirodt.'/template_order.odt'; if (file_exists($src) && ! file_exists($dest)) { diff --git a/htdocs/core/modules/modBom.class.php b/htdocs/core/modules/modBom.class.php index 30117285934..3d5aee1e29f 100644 --- a/htdocs/core/modules/modBom.class.php +++ b/htdocs/core/modules/modBom.class.php @@ -128,7 +128,7 @@ class modBom extends DolibarrModules $this->const = array( 1 => array('BOM_ADDON_PDF', 'chaine', 'generic_bom_odt', 'Name of PDF model of BOM', 0), 2 => array('BOM_ADDON', 'chaine', 'mod_bom_standard', 'Name of numbering rules of BOM', 0), - 3 => array('BOM_ADDON_PDF_ODT_PATH', 'chaine', 'DOL_DATA_ROOT/doctemplates/boms', '', 0) + 3 => array('BOM_ADDON_PDF_ODT_PATH', 'chaine', 'DOL_DATA_ROOT'.($conf->entity > 1 ? '/'.$conf->entity : '').'/doctemplates/boms', '', 0) ); // Some keys to add into the overwriting translation tables @@ -480,7 +480,7 @@ class modBom extends DolibarrModules // ODT template $src = DOL_DOCUMENT_ROOT.'/install/doctemplates/boms/template_bom.odt'; - $dirodt = DOL_DATA_ROOT.'/doctemplates/boms'; + $dirodt = DOL_DATA_ROOT.($conf->entity > 1 ? '/'.$conf->entity : '').'/doctemplates/boms'; $dest = $dirodt.'/template_bom.odt'; if (file_exists($src) && !file_exists($dest)) { diff --git a/htdocs/core/modules/modContrat.class.php b/htdocs/core/modules/modContrat.class.php index 87178b9a902..6b062b63398 100644 --- a/htdocs/core/modules/modContrat.class.php +++ b/htdocs/core/modules/modContrat.class.php @@ -88,7 +88,7 @@ class modContrat extends DolibarrModules $this->const[$r][0] = "CONTRACT_ADDON_PDF_ODT_PATH"; $this->const[$r][1] = "chaine"; - $this->const[$r][2] = "DOL_DATA_ROOT/doctemplates/contracts"; + $this->const[$r][2] = "DOL_DATA_ROOT".($conf->entity > 1 ? '/'.$conf->entity : '')."/doctemplates/contracts"; $this->const[$r][3] = ""; $this->const[$r][4] = 0; $r++; @@ -231,7 +231,7 @@ class modContrat extends DolibarrModules //ODT template $src = DOL_DOCUMENT_ROOT.'/install/doctemplates/contracts/template_contract.odt'; - $dirodt = DOL_DATA_ROOT.'/doctemplates/contracts'; + $dirodt = DOL_DATA_ROOT.($conf->entity > 1 ? '/'.$conf->entity : '').'/doctemplates/contracts'; $dest = $dirodt.'/template_contract.odt'; if (file_exists($src) && !file_exists($dest)) { diff --git a/htdocs/core/modules/modExpedition.class.php b/htdocs/core/modules/modExpedition.class.php index cfe141b56eb..1a8e97cd9a7 100644 --- a/htdocs/core/modules/modExpedition.class.php +++ b/htdocs/core/modules/modExpedition.class.php @@ -100,7 +100,7 @@ class modExpedition extends DolibarrModules $this->const[$r][0] = "EXPEDITION_ADDON_PDF_ODT_PATH"; $this->const[$r][1] = "chaine"; - $this->const[$r][2] = "DOL_DATA_ROOT/doctemplates/shipments"; + $this->const[$r][2] = "DOL_DATA_ROOT".($conf->entity > 1 ? '/'.$conf->entity : '')."/doctemplates/shipments"; $this->const[$r][3] = ""; $this->const[$r][4] = 0; $r++; @@ -121,7 +121,7 @@ class modExpedition extends DolibarrModules $this->const[$r][0] = "DELIVERY_ADDON_PDF_ODT_PATH"; $this->const[$r][1] = "chaine"; - $this->const[$r][2] = "DOL_DATA_ROOT/doctemplates/deliveries"; + $this->const[$r][2] = "DOL_DATA_ROOT".($conf->entity > 1 ? '/'.$conf->entity : '')."/doctemplates/deliveries"; $this->const[$r][3] = ""; $this->const[$r][4] = 0; $r++; @@ -344,7 +344,7 @@ class modExpedition extends DolibarrModules //ODT template $src = DOL_DOCUMENT_ROOT.'/install/doctemplates/shipments/template_shipment.odt'; - $dirodt = DOL_DATA_ROOT.'/doctemplates/shipments'; + $dirodt = DOL_DATA_ROOT.($conf->entity > 1 ? '/'.$conf->entity : '').'/doctemplates/shipments'; $dest = $dirodt.'/template_shipment.odt'; if (file_exists($src) && !file_exists($dest)) { diff --git a/htdocs/core/modules/modFournisseur.class.php b/htdocs/core/modules/modFournisseur.class.php index 107f99dd743..b29a3c0b7fb 100644 --- a/htdocs/core/modules/modFournisseur.class.php +++ b/htdocs/core/modules/modFournisseur.class.php @@ -118,7 +118,7 @@ class modFournisseur extends DolibarrModules // Add ability ODT for Supplier orders $this->const[$r][0] = "SUPPLIER_ORDER_ADDON_PDF_ODT_PATH"; $this->const[$r][1] = "chaine"; - $this->const[$r][2] = "DOL_DATA_ROOT/doctemplates/supplier_orders"; + $this->const[$r][2] = "DOL_DATA_ROOT".($conf->entity > 1 ? '/'.$conf->entity : '')."/doctemplates/supplier_orders"; $this->const[$r][3] = ''; $this->const[$r][4] = 0; $r++; @@ -126,7 +126,7 @@ class modFournisseur extends DolibarrModules // Add ability ODT for Supplier Invoices $this->const[$r][0] = "SUPPLIER_INVOICE_ADDON_PDF_ODT_PATH"; $this->const[$r][1] = "chaine"; - $this->const[$r][2] = ""; + $this->const[$r][2] = "DOL_DATA_ROOT".($conf->entity > 1 ? '/'.$conf->entity : '')."/doctemplates/supplier_invoices"; $this->const[$r][3] = ""; $this->const[$r][4] = 0; $r++; @@ -973,7 +973,7 @@ class modFournisseur extends DolibarrModules //ODT template for Supplier Orders $src = DOL_DOCUMENT_ROOT.'/install/doctemplates/supplier_orders/template_supplier_order.odt'; - $dirodt = DOL_DATA_ROOT.'/doctemplates/supplier_orders'; + $dirodt = DOL_DATA_ROOT.($conf->entity > 1 ? '/'.$conf->entity : '').'/doctemplates/supplier_orders'; $dest = $dirodt.'/template_supplier_order.odt'; if (file_exists($src) && !file_exists($dest)) { @@ -994,7 +994,7 @@ class modFournisseur extends DolibarrModules //ODT template for Supplier Invoice $src = DOL_DOCUMENT_ROOT.'/install/doctemplates/supplier_invoices/template_supplier_invoices.odt'; - $dirodt = DOL_DATA_ROOT.'/doctemplates/supplier_invoices'; + $dirodt = DOL_DATA_ROOT.($conf->entity > 1 ? '/'.$conf->entity : '').'/doctemplates/supplier_invoices'; $dest = $dirodt.'/template_supplier_invoices.odt'; if (file_exists($src) && !file_exists($dest)) { diff --git a/htdocs/core/modules/modHoliday.class.php b/htdocs/core/modules/modHoliday.class.php index 5e4002b26a4..453bb966a06 100644 --- a/htdocs/core/modules/modHoliday.class.php +++ b/htdocs/core/modules/modHoliday.class.php @@ -111,7 +111,7 @@ class modHoliday extends DolibarrModules $this->const[$r][0] = "HOLIDAY_ADDON_PDF_ODT_PATH"; $this->const[$r][1] = "chaine"; - $this->const[$r][2] = "DOL_DATA_ROOT/doctemplates/holiday"; + $this->const[$r][2] = "DOL_DATA_ROOT".($conf->entity > 1 ? '/'.$conf->entity : '')."/doctemplates/holiday"; $this->const[$r][3] = ""; $this->const[$r][4] = 0; $r++; @@ -308,7 +308,7 @@ class modHoliday extends DolibarrModules //ODT template /*$src=DOL_DOCUMENT_ROOT.'/install/doctemplates/holiday/template_holiday.odt'; - $dirodt=DOL_DATA_ROOT.'/doctemplates/holiday'; + $dirodt=DOL_DATA_ROOT.($conf->entity > 1 ? '/'.$conf->entity : '').'/doctemplates/holiday'; $dest=$dirodt.'/template_order.odt'; if (file_exists($src) && ! file_exists($dest)) diff --git a/htdocs/core/modules/modMrp.class.php b/htdocs/core/modules/modMrp.class.php index acf4dbd737a..7f081c42c91 100644 --- a/htdocs/core/modules/modMrp.class.php +++ b/htdocs/core/modules/modMrp.class.php @@ -138,7 +138,7 @@ class modMrp extends DolibarrModules $this->const = array( //1=>array('MRP_MO_ADDON_PDF', 'chaine', 'vinci', 'Name of default PDF model of MO', 0), 2=>array('MRP_MO_ADDON', 'chaine', 'mod_mo_standard', 'Name of numbering rules of MO', 0), - 3=>array('MRP_MO_ADDON_PDF_ODT_PATH', 'chaine', 'DOL_DATA_ROOT/doctemplates/mrps', '', 0) + 3=>array('MRP_MO_ADDON_PDF_ODT_PATH', 'chaine', 'DOL_DATA_ROOT'.($conf->entity > 1 ? '/'.$conf->entity : '').'/doctemplates/mrps', '', 0) ); // Some keys to add into the overwriting translation tables @@ -534,7 +534,7 @@ class modMrp extends DolibarrModules // ODT template $src = DOL_DOCUMENT_ROOT.'/install/doctemplates/mrps/template_mo.odt'; - $dirodt = DOL_DATA_ROOT.'/doctemplates/mrps'; + $dirodt = DOL_DATA_ROOT.($conf->entity > 1 ? '/'.$conf->entity : '').'/doctemplates/mrps'; $dest = $dirodt.'/template_mo.odt'; if (file_exists($src) && !file_exists($dest)) { diff --git a/htdocs/core/modules/modProjet.class.php b/htdocs/core/modules/modProjet.class.php index 0af63709d2b..6e8856da688 100644 --- a/htdocs/core/modules/modProjet.class.php +++ b/htdocs/core/modules/modProjet.class.php @@ -93,7 +93,7 @@ class modProjet extends DolibarrModules $this->const[$r][0] = "PROJECT_ADDON_PDF_ODT_PATH"; $this->const[$r][1] = "chaine"; - $this->const[$r][2] = "DOL_DATA_ROOT/doctemplates/projects"; + $this->const[$r][2] = "DOL_DATA_ROOT".($conf->entity > 1 ? '/'.$conf->entity : '')."/doctemplates/projects"; $this->const[$r][3] = ""; $this->const[$r][4] = 0; $r++; @@ -114,7 +114,7 @@ class modProjet extends DolibarrModules $this->const[$r][0] = "PROJECT_TASK_ADDON_PDF_ODT_PATH"; $this->const[$r][1] = "chaine"; - $this->const[$r][2] = "DOL_DATA_ROOT/doctemplates/tasks"; + $this->const[$r][2] = "DOL_DATA_ROOT".($conf->entity > 1 ? '/'.$conf->entity : '')."/doctemplates/tasks"; $this->const[$r][3] = ""; $this->const[$r][4] = 0; $r++; @@ -380,7 +380,7 @@ class modProjet extends DolibarrModules //ODT template for project $src = DOL_DOCUMENT_ROOT.'/install/doctemplates/projects/template_project.odt'; - $dirodt = DOL_DATA_ROOT.'/doctemplates/projects'; + $dirodt = DOL_DATA_ROOT.($conf->entity > 1 ? '/'.$conf->entity : '').'/doctemplates/projects'; $dest = $dirodt.'/template_project.odt'; if (file_exists($src) && !file_exists($dest)) { @@ -396,7 +396,7 @@ class modProjet extends DolibarrModules //ODT template for tasks $src = DOL_DOCUMENT_ROOT.'/install/doctemplates/tasks/template_task_summary.odt'; - $dirodt = DOL_DATA_ROOT.'/doctemplates/tasks'; + $dirodt = DOL_DATA_ROOT.($conf->entity > 1 ? '/'.$conf->entity : '').'/doctemplates/tasks'; $dest = $dirodt.'/template_task_summary.odt'; if (file_exists($src) && !file_exists($dest)) { diff --git a/htdocs/core/modules/modReception.class.php b/htdocs/core/modules/modReception.class.php index 7c6b4f62cc2..560ab4383f7 100644 --- a/htdocs/core/modules/modReception.class.php +++ b/htdocs/core/modules/modReception.class.php @@ -92,7 +92,7 @@ class modReception extends DolibarrModules $this->const[$r][0] = "RECEPTION_ADDON_PDF_ODT_PATH"; $this->const[$r][1] = "chaine"; - $this->const[$r][2] = "DOL_DATA_ROOT/doctemplates/receptions"; + $this->const[$r][2] = "DOL_DATA_ROOT".($conf->entity > 1 ? '/'.$conf->entity : '')."/doctemplates/receptions"; $this->const[$r][3] = ""; $this->const[$r][4] = 0; $r++; @@ -267,7 +267,7 @@ class modReception extends DolibarrModules //ODT template $src = DOL_DOCUMENT_ROOT.'/install/doctemplates/reception/template_reception.odt'; - $dirodt = DOL_DATA_ROOT.'/doctemplates/reception'; + $dirodt = DOL_DATA_ROOT.($conf->entity > 1 ? '/'.$conf->entity : '').'/doctemplates/reception'; $dest = $dirodt.'/template_reception.odt'; if (file_exists($src) && !file_exists($dest)) { diff --git a/htdocs/core/modules/modSociete.class.php b/htdocs/core/modules/modSociete.class.php index 3af5d8edd79..fdfb7f17111 100644 --- a/htdocs/core/modules/modSociete.class.php +++ b/htdocs/core/modules/modSociete.class.php @@ -102,7 +102,7 @@ class modSociete extends DolibarrModules $this->const[$r][0] = "COMPANY_ADDON_PDF_ODT_PATH"; $this->const[$r][1] = "chaine"; - $this->const[$r][2] = "DOL_DATA_ROOT/doctemplates/thirdparties"; + $this->const[$r][2] = "DOL_DATA_ROOT".($conf->entity > 1 ? '/'.$conf->entity : '')."/doctemplates/thirdparties"; $this->const[$r][3] = ""; $this->const[$r][4] = 0; $r++; @@ -1034,7 +1034,7 @@ class modSociete extends DolibarrModules //ODT template $src = DOL_DOCUMENT_ROOT.'/install/doctemplates/thirdparties/template_thirdparty.odt'; - $dirodt = DOL_DATA_ROOT.'/doctemplates/thirdparties'; + $dirodt = DOL_DATA_ROOT.($conf->entity > 1 ? '/'.$conf->entity : '').'/doctemplates/thirdparties'; $dest = $dirodt.'/template_thirdparty.odt'; if (file_exists($src) && !file_exists($dest)) { diff --git a/htdocs/core/modules/modStock.class.php b/htdocs/core/modules/modStock.class.php index 2a49109cece..6f7aef10ebb 100644 --- a/htdocs/core/modules/modStock.class.php +++ b/htdocs/core/modules/modStock.class.php @@ -97,14 +97,14 @@ class modStock extends DolibarrModules $r++; $this->const[$r][0] = "STOCK_ADDON_PDF_ODT_PATH"; $this->const[$r][1] = "chaine"; - $this->const[$r][2] = "DOL_DATA_ROOT/doctemplates/stocks"; + $this->const[$r][2] = "DOL_DATA_ROOT".($conf->entity > 1 ? '/'.$conf->entity : '')."/doctemplates/stocks"; $this->const[$r][3] = ""; $this->const[$r][4] = 0; $r++; $this->const[$r][0] = "MOUVEMENT_ADDON_PDF_ODT_PATH"; $this->const[$r][1] = "chaine"; - $this->const[$r][2] = "DOL_DATA_ROOT/doctemplates/stocks/movements"; + $this->const[$r][2] = "DOL_DATA_ROOT".($conf->entity > 1 ? '/'.$conf->entity : '')."/doctemplates/stocks/movements"; $this->const[$r][3] = ""; $this->const[$r][4] = 0; @@ -554,7 +554,7 @@ class modStock extends DolibarrModules //ODT template $src = DOL_DOCUMENT_ROOT.'/install/doctemplates/stocks/template_warehouse.odt'; - $dirodt = DOL_DATA_ROOT.'/doctemplates/stocks'; + $dirodt = DOL_DATA_ROOT.($conf->entity > 1 ? '/'.$conf->entity : '').'/doctemplates/stocks'; $dest = $dirodt.'/template_warehouse.odt'; if (file_exists($src) && !file_exists($dest)) { diff --git a/htdocs/core/modules/modSupplierProposal.class.php b/htdocs/core/modules/modSupplierProposal.class.php index 52d0dd1f546..7a379c29665 100644 --- a/htdocs/core/modules/modSupplierProposal.class.php +++ b/htdocs/core/modules/modSupplierProposal.class.php @@ -93,7 +93,7 @@ class modSupplierProposal extends DolibarrModules $this->const[$r][0] = "SUPPLIER_PROPOSAL_ADDON_PDF_ODT_PATH"; $this->const[$r][1] = "chaine"; - $this->const[$r][2] = "DOL_DATA_ROOT/doctemplates/supplier_proposals"; + $this->const[$r][2] = "DOL_DATA_ROOT".($conf->entity > 1 ? '/'.$conf->entity : '')."/doctemplates/supplier_proposals"; $this->const[$r][3] = ""; $this->const[$r][4] = 0; @@ -164,7 +164,7 @@ class modSupplierProposal extends DolibarrModules //ODT template $src = DOL_DOCUMENT_ROOT.'/install/doctemplates/supplier_proposals/template_supplier_proposal.odt'; - $dirodt = DOL_DATA_ROOT.'/doctemplates/supplier_proposals'; + $dirodt = DOL_DATA_ROOT.($conf->entity > 1 ? '/'.$conf->entity : '').'/doctemplates/supplier_proposals'; $dest = $dirodt.'/template_supplier_proposal.odt'; if (file_exists($src) && !file_exists($dest)) { diff --git a/htdocs/core/modules/modTicket.class.php b/htdocs/core/modules/modTicket.class.php index a4a57221eb3..f97418018c5 100644 --- a/htdocs/core/modules/modTicket.class.php +++ b/htdocs/core/modules/modTicket.class.php @@ -110,7 +110,7 @@ class modTicket extends DolibarrModules $this->const = array( 1 => array('TICKET_ENABLE_PUBLIC_INTERFACE', 'chaine', '0', 'Enable ticket public interface', 0), 2 => array('TICKET_ADDON', 'chaine', 'mod_ticket_simple', 'Ticket ref module', 0), - 3 => array('TICKET_ADDON_PDF_ODT_PATH', 'chaine', 'DOL_DATA_ROOT/doctemplates/tickets', 'Ticket templates ODT/ODS directory for templates', 0), + 3 => array('TICKET_ADDON_PDF_ODT_PATH', 'chaine', 'DOL_DATA_ROOT'.($conf->entity > 1 ? '/'.$conf->entity : '').'/doctemplates/tickets', 'Ticket templates ODT/ODS directory for templates', 0), 4 => array('TICKET_AUTO_READ_WHEN_CREATED_FROM_BACKEND', 'chaine', 0, 'Automatically mark ticket as read when created from backend', 0), 5 => array('TICKET_DELAY_BEFORE_FIRST_RESPONSE', 'chaine', '0', 'Maximum wanted elapsed time before a first answer to a ticket (in hours). Display a warning in tickets list if not respected.', 0), 6 => array('TICKET_DELAY_SINCE_LAST_RESPONSE', 'chaine', '0', 'Maximum wanted elapsed time between two answers on the same ticket (in hours). Display a warning in tickets list if not respected.', 0), @@ -414,7 +414,7 @@ class modTicket extends DolibarrModules //ODT template $src = DOL_DOCUMENT_ROOT.'/install/doctemplates/tickets/template_ticket.odt'; - $dirodt = DOL_DATA_ROOT.'/doctemplates/tickets'; + $dirodt = DOL_DATA_ROOT.($conf->entity > 1 ? '/'.$conf->entity : '').'/doctemplates/tickets'; $dest = $dirodt.'/template_ticket.odt'; if (file_exists($src) && !file_exists($dest)) { diff --git a/htdocs/modulebuilder/template/core/modules/modMyModule.class.php b/htdocs/modulebuilder/template/core/modules/modMyModule.class.php index 9a0e0829972..78740b564d1 100644 --- a/htdocs/modulebuilder/template/core/modules/modMyModule.class.php +++ b/htdocs/modulebuilder/template/core/modules/modMyModule.class.php @@ -497,7 +497,7 @@ class modMyModule extends DolibarrModules foreach ($myTmpObjects as $myTmpObjectKey => $myTmpObjectArray) { if ($myTmpObjectArray['includerefgeneration']) { $src = DOL_DOCUMENT_ROOT.'/install/doctemplates/'.$moduledir.'/template_myobjects.odt'; - $dirodt = DOL_DATA_ROOT.'/doctemplates/'.$moduledir; + $dirodt = DOL_DATA_ROOT.($conf->entity > 1 ? '/'.$conf->entity : '').'/doctemplates/'.$moduledir; $dest = $dirodt.'/template_myobjects.odt'; if (file_exists($src) && !file_exists($dest)) { diff --git a/htdocs/projet/class/task.class.php b/htdocs/projet/class/task.class.php index 86c4b333018..e5cebe933a3 100644 --- a/htdocs/projet/class/task.class.php +++ b/htdocs/projet/class/task.class.php @@ -208,13 +208,15 @@ class Task extends CommonObjectLine * @var int|string */ public $timespent_datehour; // More accurate start date (same than timespent_date but includes hours, minutes and seconds) + /** * @var int */ - public $timespent_withhour; // 1 = we entered also start hours for timesheet line + public $timespent_withhour; // 0 or 1 = we have entered also start hours for timesheet line /** * @var int */ + public $timespent_fk_user; /** * @var float @@ -1635,10 +1637,9 @@ class Task extends CommonObjectLine $timespent->fk_user = $this->timespent_fk_user; $timespent->fk_product = $this->timespent_fk_product; $timespent->note = $this->timespent_note; - $timespent->datec = $this->db->idate($now); + $timespent->datec = $now; $result = $timespent->create($user); - if ($result > 0) { $ret = $result; $this->timespent_id = $result; diff --git a/htdocs/projet/tasks/time.php b/htdocs/projet/tasks/time.php index 568cf922cd5..d930908c3e2 100644 --- a/htdocs/projet/tasks/time.php +++ b/htdocs/projet/tasks/time.php @@ -185,7 +185,6 @@ if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x' $search_year = ''; $search_note = ''; $search_duration = ''; - $search_value = ''; $search_date_startday = ''; $search_date_startmonth = ''; $search_date_startyear = ''; @@ -257,6 +256,7 @@ if ($action == 'addtimespent' && $user->hasRight('projet', 'time')) { $object->timespent_withhour = 1; } else { $object->timespent_date = dol_mktime(12, 0, 0, GETPOSTINT("timemonth"), GETPOSTINT("timeday"), GETPOSTINT("timeyear")); + $object->timespent_withhour = 0; } $object->timespent_fk_user = GETPOSTINT("userid"); $object->timespent_fk_product = GETPOSTINT("fk_product"); @@ -305,6 +305,7 @@ if (($action == 'updateline' || $action == 'updatesplitline') && !$cancel && $us $object->timespent_withhour = 1; } else { $object->timespent_date = dol_mktime(12, 0, 0, GETPOSTINT("timelinemonth"), GETPOSTINT("timelineday"), GETPOSTINT("timelineyear")); + $object->timespent_withhour = 0; } $object->timespent_fk_user = GETPOSTINT("userid_line"); $object->timespent_fk_product = GETPOSTINT("fk_product"); @@ -334,6 +335,7 @@ if (($action == 'updateline' || $action == 'updatesplitline') && !$cancel && $us $object->timespent_withhour = 1; } else { $object->timespent_date = dol_mktime(12, 0, 0, GETPOSTINT("timelinemonth"), GETPOSTINT("timelineday"), GETPOSTINT("timelineyear")); + $object->timespent_withhour = 0; } $object->timespent_fk_user = GETPOSTINT("userid_line"); $object->timespent_fk_product = GETPOSTINT("fk_product");