mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2025-02-20 13:46:52 +01:00
Merge pull request #33017 from mdeweerd/phan/2025.2.10.project-2
Qual: Fix phan (project-2)
This commit is contained in:
commit
2cb93fc9f6
|
|
@ -9,15 +9,15 @@
|
|||
*/
|
||||
return [
|
||||
// # Issue statistics:
|
||||
// PhanTypeMismatchArgument : 1900+ occurrences
|
||||
// PhanTypeMismatchArgument : 1840+ occurrences
|
||||
// PhanUndeclaredProperty : 520+ occurrences
|
||||
// PhanTypeMismatchArgumentNullable : 380+ occurrences
|
||||
// PhanPluginUnknownArrayMethodReturnType : 170+ occurrences
|
||||
// PhanUndeclaredGlobalVariable : 170+ occurrences
|
||||
// PhanTypeMismatchProperty : 130+ occurrences
|
||||
// PhanPluginUnknownArrayMethodParamType : 110+ occurrences
|
||||
// PhanPossiblyUndeclaredGlobalVariable : 100+ occurrences
|
||||
// PhanTypeMismatchArgumentProbablyReal : 100+ occurrences
|
||||
// PhanPossiblyUndeclaredGlobalVariable : 95+ occurrences
|
||||
// PhanTypeMismatchArgumentProbablyReal : 90+ occurrences
|
||||
// PhanRedefineFunction : 40+ occurrences
|
||||
// PhanTypeExpectedObjectPropAccess : 40+ occurrences
|
||||
// PhanTypeInvalidDimOffset : 25+ occurrences
|
||||
|
|
@ -32,12 +32,12 @@ return [
|
|||
// PhanPluginUnknownObjectMethodCall : 6 occurrences
|
||||
// PhanTypeArraySuspiciousNull : 6 occurrences
|
||||
// PhanParamTooMany : 5 occurrences
|
||||
// PhanEmptyForeach : 4 occurrences
|
||||
// PhanPluginDuplicateArrayKey : 4 occurrences
|
||||
// PhanPluginEmptyStatementIf : 4 occurrences
|
||||
// PhanEmptyFQSENInClasslike : 3 occurrences
|
||||
// PhanInvalidFQSENInClasslike : 3 occurrences
|
||||
// PhanPluginBothLiteralsBinaryOp : 3 occurrences
|
||||
// PhanEmptyForeach : 2 occurrences
|
||||
// PhanTypeMismatchDimAssignment : 2 occurrences
|
||||
// PhanTypeMismatchDimFetchNullable : 2 occurrences
|
||||
// PhanTypeSuspiciousStringExpression : 2 occurrences
|
||||
|
|
@ -613,15 +613,7 @@ return [
|
|||
'htdocs/projet/admin/project.php' => ['PhanTypeMismatchArgumentProbablyReal'],
|
||||
'htdocs/projet/card.php' => ['PhanTypeMismatchArgumentNullable', 'PhanUndeclaredGlobalVariable'],
|
||||
'htdocs/projet/class/api_tasks.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType', 'PhanTypeMismatchArgument'],
|
||||
'htdocs/projet/stats/index.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgument'],
|
||||
'htdocs/projet/tasks.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentProbablyReal'],
|
||||
'htdocs/projet/tasks/comment.php' => ['PhanTypeMismatchArgumentProbablyReal'],
|
||||
'htdocs/projet/tasks/contact.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentProbablyReal'],
|
||||
'htdocs/projet/tasks/document.php' => ['PhanTypeMismatchArgumentProbablyReal'],
|
||||
'htdocs/projet/tasks/list.php' => ['PhanTypeMismatchArgument'],
|
||||
'htdocs/projet/tasks/note.php' => ['PhanTypeMismatchArgumentProbablyReal'],
|
||||
'htdocs/projet/tasks/task.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentProbablyReal'],
|
||||
'htdocs/projet/tasks/time.php' => ['PhanEmptyForeach', 'PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeInvalidDimOffset', 'PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentNullable', 'PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredProperty'],
|
||||
'htdocs/projet/tasks/time.php' => ['PhanTypeInvalidDimOffset', 'PhanTypeMismatchArgument', 'PhanUndeclaredProperty'],
|
||||
'htdocs/projet/tasks/tpl/linkedobjectblock.tpl.php' => ['PhanUndeclaredProperty'],
|
||||
'htdocs/public/agenda/agendaexport.php' => ['PhanRedefineFunction'],
|
||||
'htdocs/public/bookcal/index.php' => ['PhanRedefineFunction'],
|
||||
|
|
@ -645,7 +637,7 @@ return [
|
|||
'htdocs/public/project/new.php' => ['PhanRedefineFunction'],
|
||||
'htdocs/public/project/suggestbooth.php' => ['PhanRedefineFunction', 'PhanTypeMismatchArgument', 'PhanUndeclaredGlobalVariable', 'PhanUndeclaredProperty'],
|
||||
'htdocs/public/project/suggestconference.php' => ['PhanRedefineFunction', 'PhanTypeMismatchArgument', 'PhanUndeclaredGlobalVariable', 'PhanUndeclaredProperty'],
|
||||
'htdocs/public/project/viewandvote.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgument', 'PhanUndeclaredGlobalVariable'],
|
||||
'htdocs/public/project/viewandvote.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanUndeclaredGlobalVariable'],
|
||||
'htdocs/public/recruitment/view.php' => ['PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredGlobalVariable'],
|
||||
'htdocs/public/stripe/ipn.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredGlobalVariable'],
|
||||
'htdocs/public/test/test_arrays.php' => ['PhanPluginUndeclaredVariableIsset'],
|
||||
|
|
@ -802,7 +794,7 @@ return [
|
|||
'htdocs/webservices/server_order.php' => ['PhanTypeExpectedObjectPropAccess', 'PhanTypeInvalidDimOffset', 'PhanTypeMismatchArgument', 'PhanTypeSuspiciousStringExpression', 'PhanUndeclaredProperty'],
|
||||
'htdocs/webservices/server_payment.php' => ['PhanTypeExpectedObjectPropAccess', 'PhanTypeMismatchArgument', 'PhanUndeclaredProperty'],
|
||||
'htdocs/webservices/server_productorservice.php' => ['PhanTypeMismatchArgument', 'PhanUndeclaredProperty'],
|
||||
'htdocs/webservices/server_project.php' => ['PhanTypeMismatchArgument', 'PhanUndeclaredProperty'],
|
||||
'htdocs/webservices/server_project.php' => ['PhanUndeclaredProperty'],
|
||||
'htdocs/webservices/server_supplier_invoice.php' => ['PhanUndeclaredProperty'],
|
||||
'htdocs/webservices/server_thirdparty.php' => ['PhanTypeMismatchArgument', 'PhanUndeclaredProperty'],
|
||||
'htdocs/webservices/server_user.php' => ['PhanTypeMismatchArgument', 'PhanUndeclaredProperty'],
|
||||
|
|
|
|||
|
|
@ -3835,13 +3835,13 @@ class Facture extends CommonInvoice
|
|||
* @param string $desc Description of line
|
||||
* @param float $pu_ht Unit price without tax (> 0 even for credit note)
|
||||
* @param float $qty Quantity
|
||||
* @param float $txtva Force Vat rate, -1 for auto (Can contain the vat_src_code too with syntax '9.9 (CODE)')
|
||||
* @param float|string $txtva Force Vat rate, -1 for auto (Can contain the vat_src_code too with syntax '9.9 (CODE)')
|
||||
* @param float $txlocaltax1 Local tax 1 rate (deprecated, use instead txtva with code inside)
|
||||
* @param float $txlocaltax2 Local tax 2 rate (deprecated, use instead txtva with code inside)
|
||||
* @param int $fk_product Id of predefined product/service
|
||||
* @param float $remise_percent Percent of discount on line
|
||||
* @param int|string $date_start Date start of service
|
||||
* @param int|string $date_end Date end of service
|
||||
* @param int|'' $date_start Date start of service
|
||||
* @param int|'' $date_end Date end of service
|
||||
* @param int $fk_code_ventilation Code of dispatching into accountancy
|
||||
* @param int $info_bits Bits of type of lines
|
||||
* @param int $fk_remise_except Id discount used
|
||||
|
|
@ -3854,7 +3854,7 @@ class Facture extends CommonInvoice
|
|||
* @param int $origin_id Depend on global conf MAIN_CREATEFROM_KEEP_LINE_ORIGIN_INFORMATION can be Id of origin object (aka line id), else object id
|
||||
* @param int $fk_parent_line Id of parent line
|
||||
* @param int $fk_fournprice Supplier price id (to calculate margin) or ''
|
||||
* @param int $pa_ht Buying price of line (to calculate margin) or ''
|
||||
* @param float|'' $pa_ht Buying price of line (to calculate margin) or ''
|
||||
* @param string $label Label of the line (deprecated, do not use)
|
||||
* @param array<string,mixed> $array_options extrafields array
|
||||
* @param int $situation_percent Situation advance percentage
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@
|
|||
* Copyright (C) 2023 Gauthier VERDOL <gauthier.verdol@atm-consulting.fr>
|
||||
* Copyright (C) 2021 Grégory Blémand <gregory.blemand@atm-consulting.fr>
|
||||
* Copyright (C) 2023 Lenin Rivas <lenin.rivas777@gmail.com>
|
||||
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
|
||||
* Copyright (C) 2024-2025 MDW <mdeweerd@users.noreply.github.com>
|
||||
* Copyright (C) 2024 William Mead <william.mead@manchenumerique.fr>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
|
|
@ -152,7 +152,7 @@ abstract class CommonObject
|
|||
public $array_languages = null; // Value is array() when load already tried
|
||||
|
||||
/**
|
||||
* @var array<int,array{parentId:int,source:string,socid:int,id:int,nom:string,civility:string,lastname:string,firstname:string,email:string,login:string,photo:string,statuscontact:int,rowid:int,code:string,libelle:string,status:string,fk_c_type_contact:int}> To store result of ->liste_contact()
|
||||
* @var array<int,array{parentId:int,source:string,socid:int,id:int,nom:string,civility:string,lastname:string,firstname:string,email:string,login:string,photo:string,statuscontact:int,rowid:int,code:string,libelle:string,status:int,fk_c_type_contact:int}> To store result of ->liste_contact()
|
||||
*/
|
||||
public $contacts_ids;
|
||||
|
||||
|
|
@ -270,13 +270,13 @@ abstract class CommonObject
|
|||
public $user;
|
||||
|
||||
/**
|
||||
* @var string The type of originating object. Combined with $origin_id, it allows to reload $origin_object
|
||||
* @var string The type of originating object. Combined with `$origin_type`, it allows to reload `$origin_object`
|
||||
* @see fetch_origin()
|
||||
*/
|
||||
public $origin_type;
|
||||
|
||||
/**
|
||||
* @var int The id of originating object. Combined with $origin_type, it allows to reload $origin_object
|
||||
* @var int The id of originating object. Combined with `$origin_type`, it allows to reload `$origin_object`
|
||||
* @see fetch_origin()
|
||||
*/
|
||||
public $origin_id;
|
||||
|
|
@ -1489,7 +1489,7 @@ abstract class CommonObject
|
|||
* @param string $code Filter on this code of contact type ('SHIPPING', 'BILLING', ...)
|
||||
* @param int $status Status of user or company
|
||||
* @param int[] $arrayoftcids Array with ID of type of contacts. If we provide this, we can filter on ec.fk_c_type_contact IN ($arrayoftcids) to avoid a link on c_type_contact table (faster).
|
||||
* @return array<int,array{parentId:int,source:string,socid:int,id:int,nom:string,civility:string,lastname:string,firstname:string,email:string,login:string,photo:string,gender:string,statuscontact:int,rowid:int,code:string,libelle:string,status:string,fk_c_type_contact:int}>|int<-1,-1> Array of contacts, -1 if error
|
||||
* @return array<int,array{parentId:int,source:string,socid:int,id:int,nom:string,civility:string,lastname:string,firstname:string,email:string,login:string,photo:string,gender:string,statuscontact:int,rowid:int,code:string,libelle:string,status:int,fk_c_type_contact:int}>|int<-1,-1> Array of contacts, -1 if error
|
||||
*/
|
||||
public function liste_contact($statusoflink = -1, $source = 'external', $list = 0, $code = '', $status = -1, $arrayoftcids = array())
|
||||
{
|
||||
|
|
@ -1580,7 +1580,7 @@ abstract class CommonObject
|
|||
'rowid' => $obj->rowid,
|
||||
'code' => $obj->code,
|
||||
'libelle' => $libelle_type,
|
||||
'status' => $obj->statuslink,
|
||||
'status' => (int) $obj->statuslink,
|
||||
'fk_c_type_contact' => $obj->fk_c_type_contact
|
||||
);
|
||||
} else {
|
||||
|
|
@ -6544,8 +6544,8 @@ abstract class CommonObject
|
|||
}
|
||||
} else {
|
||||
/**
|
||||
We are in a situation where the current object has no values in its extra fields.
|
||||
We want to initialize all the values to null so that the array_option is accessible in other contexts (especially in document generation).
|
||||
* We are in a situation where the current object has no values in its extra fields.
|
||||
* We want to initialize all the values to null so that the array_option is accessible in other contexts (especially in document generation).
|
||||
**/
|
||||
if (is_array($extrafields->attributes[$this->table_element]['label'])) {
|
||||
foreach ($extrafields->attributes[$this->table_element]['label'] as $key => $val) {
|
||||
|
|
|
|||
|
|
@ -1408,11 +1408,11 @@ class Form
|
|||
* @param int<0,3>|string $showempty 0=no empty value, 1=add an empty value, 2=add line 'Internal' (used by user edit), 3=add an empty value only if more than one record into list
|
||||
* @param string $exclude List of contacts id to exclude
|
||||
* @param string $limitto Not used
|
||||
* @param integer $showfunction Add function into label
|
||||
* @param int<0,1> $showfunction Add function into label
|
||||
* @param string $morecss Add more class to class style
|
||||
* @param bool $nokeyifsocid When 1, we force the option "Press a key to show list" to 0 if there is a value for $socid
|
||||
* @param integer $showsoc Add company into label
|
||||
* @param int $forcecombo 1=Force to use combo box (so no ajax beautify effect)
|
||||
* @param int<0,1> $forcecombo 1=Force to use combo box (so no ajax beautify effect)
|
||||
* @param array<array{method:string,url:string,htmlname:string,params:array<string,string>}> $events Event options. Example: array(array('method'=>'getContacts', 'url'=>dol_buildpath('/core/ajax/contacts.php',1), 'htmlname'=>'contactid', 'params'=>array('add-customer-contact'=>'disabled')))
|
||||
* @param string $moreparam Add more parameters onto the select tag. For example 'style="width: 95%"' to avoid select2 component to go over parent container
|
||||
* @param string $htmlid Html id to use instead of htmlname
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
<?php
|
||||
/* Copyright (C) 2012-2013 Charles-Fr BENKE <charles.fr@benke.fr>
|
||||
* Copyright (C) 2025 MDW <mdeweerd@users.noreply.github.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
|
@ -57,11 +58,11 @@ class FormIntervention
|
|||
* @param int $selected Id intervention preselected
|
||||
* @param string $htmlname Nom de la zone html
|
||||
* @param int $maxlength Maximum length of label
|
||||
* @param int $showempty Show empty line ('1' or string to show for empty line)
|
||||
* @param string $showempty Show empty line ('1' or string to show for empty line)
|
||||
* @param bool $draftonly Show only drafts intervention
|
||||
* @return string HTML code for the select list if OK, empty if KO
|
||||
*/
|
||||
public function select_interventions($socid = -1, $selected = 0, $htmlname = 'interventionid', $maxlength = 16, $showempty = 1, $draftonly = false)
|
||||
public function select_interventions($socid = -1, $selected = 0, $htmlname = 'interventionid', $maxlength = 16, $showempty = '1', $draftonly = false)
|
||||
{
|
||||
// phpcs:enable
|
||||
global $user, $conf, $langs;
|
||||
|
|
|
|||
|
|
@ -314,7 +314,7 @@ class ProjectStats extends Stats
|
|||
* @param int $startyear End year
|
||||
* @param int $cachedelay Delay we accept for cache file (0=No read, no save of cache, -1=No read but save)
|
||||
* @param int $wonlostfilter Add a filter on status won/lost
|
||||
* @return int<-1,-1>|array<array<int<0,11>,array{0:int<1,12>,1:int|float}>> Array of values or <0 if error
|
||||
* @return int<-1,-1>|array<int<0,11>,array{0:string,1:int,2?:int,3?:int,4?:int}> Array of values or <0 if error
|
||||
*/
|
||||
public function getWeightedAmountByMonthWithPrevYear($endyear, $startyear, $cachedelay = 0, $wonlostfilter = 1)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -2248,16 +2248,16 @@ class Task extends CommonObjectLine
|
|||
|
||||
/** Load an object from its id and create a new one in database
|
||||
*
|
||||
* @param User $user User making the clone
|
||||
* @param int $fromid Id of object to clone
|
||||
* @param int $project_id Id of project to attach clone task
|
||||
* @param int $parent_task_id Id of task to attach clone task
|
||||
* @param bool $clone_change_dt recalculate date of task regarding new project start date
|
||||
* @param bool $clone_affectation clone affectation of project
|
||||
* @param bool $clone_time clone time of project
|
||||
* @param bool $clone_file clone file of project
|
||||
* @param bool $clone_note clone note of project
|
||||
* @param bool $clone_prog clone progress of project
|
||||
* @param User $user User making the clone
|
||||
* @param int $fromid Id of object to clone
|
||||
* @param int $project_id Id of project to attach clone task
|
||||
* @param int $parent_task_id Id of task to attach clone task
|
||||
* @param bool|int<0,1> $clone_change_dt recalculate date of task regarding new project start date
|
||||
* @param bool|int<0,1> $clone_affectation clone affectation of project
|
||||
* @param bool|int<0,1> $clone_time clone time of project
|
||||
* @param bool|int<0,1> $clone_file clone file of project
|
||||
* @param bool|int<0,1> $clone_note clone note of project
|
||||
* @param bool|int<0,1> $clone_prog clone progress of project
|
||||
* @return int New id of clone
|
||||
*/
|
||||
public function createFromClone(User $user, $fromid, $project_id, $parent_task_id, $clone_change_dt = false, $clone_affectation = false, $clone_time = false, $clone_file = false, $clone_note = false, $clone_prog = false)
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
<?php
|
||||
/* Copyright (C) 2014-2015 Florian HENRY <florian.henry@open-concept.pro>
|
||||
* Copyright (C) 2015-2021 Laurent Destailleur <ldestailleur@users.sourceforge.net>
|
||||
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
|
||||
* Copyright (C) 2024-2025 MDW <mdeweerd@users.noreply.github.com>
|
||||
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
|
|
@ -134,6 +134,7 @@ if (!$mesg) {
|
|||
}
|
||||
|
||||
|
||||
$px2 = null;
|
||||
if (getDolGlobalString('PROJECT_USE_OPPORTUNITIES')) {
|
||||
// Build graphic amount of object
|
||||
$data = $stats_project->getAmountByMonthWithPrevYear($endyear, $startyear);
|
||||
|
|
@ -170,6 +171,7 @@ if (getDolGlobalString('PROJECT_USE_OPPORTUNITIES')) {
|
|||
}
|
||||
}
|
||||
|
||||
$px3 = null;
|
||||
if (getDolGlobalString('PROJECT_USE_OPPORTUNITIES')) {
|
||||
// Build graphic with transformation rate
|
||||
$data = $stats_project->getWeightedAmountByMonthWithPrevYear($endyear, $startyear, 0, 0);
|
||||
|
|
@ -326,7 +328,7 @@ if ($mesg) {
|
|||
} else {
|
||||
$stringtoshow .= $px1->show();
|
||||
$stringtoshow .= "<br>\n";
|
||||
if (getDolGlobalString('PROJECT_USE_OPPORTUNITIES')) {
|
||||
if (getDolGlobalString('PROJECT_USE_OPPORTUNITIES') && $px2 !== null && $px3 !== null) {
|
||||
//$stringtoshow .= $px->show();
|
||||
//$stringtoshow .= "<br>\n";
|
||||
$stringtoshow .= $px2->show();
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
/* Copyright (C) 2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2004-2019 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2005-2017 Regis Houssin <regis.houssin@inodbox.com>
|
||||
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
|
||||
* Copyright (C) 2024-2025 MDW <mdeweerd@users.noreply.github.com>
|
||||
* Copyright (C) 2024-2025 Frédéric France <frederic.france@free.fr>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
|
|
@ -172,25 +172,25 @@ if (GETPOSTISSET('planned_workloadhour') || GETPOSTISSET('planned_workloadmin'))
|
|||
|
||||
// Definition of fields for list
|
||||
$arrayfields = array(
|
||||
't.ref' => array('label' => "RefTask", 'checked' => 1, 'position' => 1),
|
||||
't.label' => array('label' => "LabelTask", 'checked' => 1, 'position' => 2),
|
||||
't.description' => array('label' => "Description", 'checked' => 0, 'position' => 3),
|
||||
't.dateo' => array('label' => "DateStart", 'checked' => 1, 'position' => 4),
|
||||
't.datee' => array('label' => "Deadline", 'checked' => 1, 'position' => 5),
|
||||
't.planned_workload' => array('label' => "PlannedWorkload", 'checked' => 1, 'position' => 6),
|
||||
't.duration_effective' => array('label' => "TimeSpent", 'checked' => 1, 'position' => 7),
|
||||
't.progress_calculated' => array('label' => "ProgressCalculated", 'checked' => 1, 'position' => 8),
|
||||
't.progress' => array('label' => "ProgressDeclared", 'checked' => 1, 'position' => 9),
|
||||
't.progress_summary' => array('label' => "TaskProgressSummary", 'checked' => 1, 'position' => 10),
|
||||
't.fk_statut' => array('label' => "Status", 'checked' => 1, 'position' => 11),
|
||||
't.budget_amount' => array('label' => "Budget", 'checked' => 0, 'position' => 12),
|
||||
'c.assigned' => array('label' => "TaskRessourceLinks", 'checked' => 1, 'position' => 13),
|
||||
't.ref' => array('label' => "RefTask", 'checked' => '1', 'position' => 1),
|
||||
't.label' => array('label' => "LabelTask", 'checked' => '1', 'position' => 2),
|
||||
't.description' => array('label' => "Description", 'checked' => '0', 'position' => 3),
|
||||
't.dateo' => array('label' => "DateStart", 'checked' => '1', 'position' => 4),
|
||||
't.datee' => array('label' => "Deadline", 'checked' => '1', 'position' => 5),
|
||||
't.planned_workload' => array('label' => "PlannedWorkload", 'checked' => '1', 'position' => 6),
|
||||
't.duration_effective' => array('label' => "TimeSpent", 'checked' => '1', 'position' => 7),
|
||||
't.progress_calculated' => array('label' => "ProgressCalculated", 'checked' => '1', 'position' => 8),
|
||||
't.progress' => array('label' => "ProgressDeclared", 'checked' => '1', 'position' => 9),
|
||||
't.progress_summary' => array('label' => "TaskProgressSummary", 'checked' => '1', 'position' => 10),
|
||||
't.fk_statut' => array('label' => "Status", 'checked' => '1', 'position' => 11),
|
||||
't.budget_amount' => array('label' => "Budget", 'checked' => '0', 'position' => 12),
|
||||
'c.assigned' => array('label' => "TaskRessourceLinks", 'checked' => '1', 'position' => 13),
|
||||
|
||||
);
|
||||
if ($object->usage_bill_time) {
|
||||
$arrayfields['t.tobill'] = array('label' => $langs->trans("TimeToBill"), 'checked' => 0, 'position' => 11);
|
||||
$arrayfields['t.billed'] = array('label' => $langs->trans("TimeBilled"), 'checked' => 0, 'position' => 12);
|
||||
$arrayfields['t.billable'] = array('label' => $langs->trans("Billable"), 'checked' => 1, 'position' => 13);
|
||||
$arrayfields['t.tobill'] = array('label' => $langs->trans("TimeToBill"), 'checked' => '0', 'position' => 11);
|
||||
$arrayfields['t.billed'] = array('label' => $langs->trans("TimeBilled"), 'checked' => '0', 'position' => 12);
|
||||
$arrayfields['t.billable'] = array('label' => $langs->trans("Billable"), 'checked' => '1', 'position' => 13);
|
||||
}
|
||||
|
||||
// Extra fields
|
||||
|
|
@ -199,7 +199,7 @@ $extrafieldsobjectprefix = 'efpt.';
|
|||
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_array_fields.tpl.php';
|
||||
|
||||
$arrayfields = dol_sort_array($arrayfields, 'position');
|
||||
'@phan-var-force array<string,array{label:string,checked?:int<0,1>,position?:int,help?:string}> $arrayfields'; // dol_sort_array looses type for Phan
|
||||
// '@phan-var-force array<string,array{label:string,checked?:int<0,1>,position?:int,help?:string}> $arrayfields'; // dol_sort_array looses type for Phan
|
||||
|
||||
$varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage;
|
||||
|
||||
|
|
@ -456,6 +456,7 @@ llxHeader("", $title, $help_url, '', 0, 0, '', '', '', 'mod-project page-card_ta
|
|||
|
||||
$arrayofselected = is_array($toselect) ? $toselect : array();
|
||||
$param = '';
|
||||
$userWrite = 0;
|
||||
|
||||
if ($id > 0 || !empty($ref)) {
|
||||
$result = $object->fetch($id, $ref);
|
||||
|
|
@ -810,9 +811,9 @@ if ($action == 'create' && $user->hasRight('projet', 'creer') && (empty($object-
|
|||
print '<tr><td class="fieldrequired">'.$langs->trans("ChildOfProjectTask").'</td><td>';
|
||||
print img_picto('', 'project', 'class="pictofixedwidth"');
|
||||
if ($projectoktoentertime) {
|
||||
$formother->selectProjectTasks(GETPOST('task_parent'), empty($projectid) ? $object->id : $projectid, 'task_parent', 0, 0, 1, 1, 0, '0,1', 'maxwidth500 widthcentpercentminusxx');
|
||||
$formother->selectProjectTasks(GETPOSTINT('task_parent'), empty($projectid) ? $object->id : $projectid, 'task_parent', 0, 0, 1, 1, 0, '0,1', 'maxwidth500 widthcentpercentminusxx');
|
||||
} else {
|
||||
$formother->selectProjectTasks(GETPOST('task_parent'), empty($projectid) ? $object->id : $projectid, 'task_parent', 0, 0, 1, 1, 0, '', 'maxwidth500 widthcentpercentminusxx');
|
||||
$formother->selectProjectTasks(GETPOSTINT('task_parent'), empty($projectid) ? $object->id : $projectid, 'task_parent', 0, 0, 1, 1, 0, '', 'maxwidth500 widthcentpercentminusxx');
|
||||
}
|
||||
print '</td></tr>';
|
||||
|
||||
|
|
@ -822,12 +823,12 @@ if ($action == 'create' && $user->hasRight('projet', 'creer') && (empty($object-
|
|||
print '<tr><td>'.$langs->trans("AffectedTo").'</td><td>';
|
||||
print img_picto('', 'user', 'class="pictofixedwidth"');
|
||||
if (is_array($contactsofproject) && count($contactsofproject)) {
|
||||
print $form->select_dolusers($user->id, 'userid', 0, '', 0, '', $contactsofproject, 0, 0, 0, '', 0, '', 'maxwidth500 widthcentpercentminusx');
|
||||
print $form->select_dolusers($user->id, 'userid', 0, null, 0, '', $contactsofproject, '0', 0, 0, '', 0, '', 'maxwidth500 widthcentpercentminusx');
|
||||
} else {
|
||||
if ((isset($projectid) && $projectid > 0) || $object->id > 0) {
|
||||
print '<span class="opacitymedium">'.$langs->trans("NoUserAssignedToTheProject").'</span>';
|
||||
} else {
|
||||
print $form->select_dolusers($user->id, 'userid', 0, '', 0, '', '', 0, 0, 0, '', 0, '', 'maxwidth500 widthcentpercentminusx');
|
||||
print $form->select_dolusers($user->id, 'userid', 0, null, 0, '', '', '0', 0, 0, '', 0, '', 'maxwidth500 widthcentpercentminusx');
|
||||
}
|
||||
}
|
||||
print '</td></tr>';
|
||||
|
|
@ -942,7 +943,7 @@ if ($action == 'create' && $user->hasRight('projet', 'creer') && (empty($object-
|
|||
// Get list of tasks in tasksarray and taskarrayfiltered
|
||||
// We need all tasks (even not limited to a user because a task to user can have a parent that is not affected to him).
|
||||
$filteronthirdpartyid = $socid;
|
||||
$tasksarray = $taskstatic->getTasksArray(0, 0, $object->id, $filteronthirdpartyid, 0, '', -1, $morewherefilter, 0, 0, $extrafields, 1, $search_array_options, 1, 1, $sortfield, $sortorder);
|
||||
$tasksarray = $taskstatic->getTasksArray(null, null, $object->id, $filteronthirdpartyid, 0, '', '-1', $morewherefilter, 0, 0, $extrafields, 1, $search_array_options, 1, 1, $sortfield, $sortorder);
|
||||
|
||||
// We load also tasks limited to a particular user
|
||||
$tmpuser = new User($db);
|
||||
|
|
@ -950,7 +951,7 @@ if ($action == 'create' && $user->hasRight('projet', 'creer') && (empty($object-
|
|||
$tmpuser->fetch($search_user_id);
|
||||
}
|
||||
|
||||
$tasksrole = ($tmpuser->id > 0 ? $taskstatic->getUserRolesForProjectsOrTasks(null, $tmpuser, $object->id, 0) : '');
|
||||
$tasksrole = ($tmpuser->id > 0 ? $taskstatic->getUserRolesForProjectsOrTasks(null, $tmpuser, (string) $object->id, 0) : '');
|
||||
//var_dump($tasksarray);
|
||||
//var_dump($tasksrole);
|
||||
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
* Copyright (C) 2006-2017 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2010-2012 Regis Houssin <regis.houssin@inodbox.com>
|
||||
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
|
||||
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
|
||||
* Copyright (C) 2024-2025 MDW <mdeweerd@users.noreply.github.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
|
@ -76,7 +76,7 @@ $socid = 0;
|
|||
// Retrieve First Task ID of Project if withprojet is on to allow project prev next to work
|
||||
if (!empty($project_ref) && !empty($withproject)) {
|
||||
if ($projectstatic->fetch(0, $project_ref) > 0) {
|
||||
$objectsarray = $object->getTasksArray(0, 0, $projectstatic->id, $socid, 0);
|
||||
$objectsarray = $object->getTasksArray(null, null, $projectstatic->id, $socid, 0);
|
||||
if (count($objectsarray) > 0) {
|
||||
$id = $objectsarray[0]->id;
|
||||
} else {
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@
|
|||
* Copyright (C) 2006-2024 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2010-2012 Regis Houssin <regis.houssin@inodbox.com>
|
||||
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
|
||||
* Copyright (C) 2025 MDW <mdeweerd@users.noreply.github.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
|
@ -136,7 +137,7 @@ if ($action == 'deleteline' && $user->hasRight('projet', 'creer')) {
|
|||
// Retrieve First Task ID of Project if withprojet is on to allow project prev next to work
|
||||
if (!empty($project_ref) && !empty($withproject)) {
|
||||
if ($projectstatic->fetch(0, $project_ref) > 0) {
|
||||
$tasksarray = $object->getTasksArray(0, 0, $projectstatic->id, $socid, 0);
|
||||
$tasksarray = $object->getTasksArray(null, null, $projectstatic->id, $socid, 0);
|
||||
if (count($tasksarray) > 0) {
|
||||
$id = $tasksarray[0]->id;
|
||||
} else {
|
||||
|
|
@ -426,7 +427,7 @@ if ($id > 0 || !empty($ref)) {
|
|||
} else {
|
||||
$contactsofproject = $projectstatic->getListContactId('internal');
|
||||
}
|
||||
print $form->select_dolusers((GETPOSTISSET('userid') ? GETPOSTINT('userid') : $user->id), 'userid', 0, '', 0, '', $contactsofproject, 0, 0, 0, '', 1, $langs->trans("ResourceNotAssignedToProject"));
|
||||
print $form->select_dolusers((GETPOSTISSET('userid') ? GETPOSTINT('userid') : $user->id), 'userid', 0, null, 0, '', $contactsofproject, '0', 0, 0, '', 1, $langs->trans("ResourceNotAssignedToProject"));
|
||||
print '</td>';
|
||||
print '<td>';
|
||||
$formcompany->selectTypeContact($object, '', 'type', 'internal', 'position');
|
||||
|
|
@ -451,7 +452,7 @@ if ($id > 0 || !empty($ref)) {
|
|||
print '<td>';
|
||||
$contactofproject = $projectstatic->getListContactId('external');
|
||||
//print $form->selectcontacts($selectedCompany, '', 'contactid', 0, '', $contactofproject, 0, '', false, 0, 0);
|
||||
print $form->select_contact($selectedCompany, '', 'contactid', 0, '', $contactofproject, 0, 'maxwidth300 widthcentpercentminusx', true);
|
||||
print $form->select_contact($selectedCompany, '', 'contactid', 0, '', ''/* arg not used - $contactofproject */, 0, 'maxwidth300 widthcentpercentminusx', true);
|
||||
$nbofcontacts = $form->num;
|
||||
print '</td>';
|
||||
print '<td>';
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@
|
|||
* Copyright (C) 2012 Florian Henry <florian.henry@open-concept.pro>
|
||||
* Copyright (C) 2013 Cédric Salvador <csalvador@gpcsolutions.fr>
|
||||
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
|
||||
* Copyright (C) 2025 MDW <mdeweerd@users.noreply.github.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
|
@ -94,7 +95,7 @@ $permissiontoadd = $user->hasRight('projet', 'creer'); // Used by the include of
|
|||
// Retrieve First Task ID of Project if withprojet is on to allow project prev next to work
|
||||
if (!empty($project_ref) && !empty($withproject)) {
|
||||
if ($projectstatic->fetch(0, $project_ref) > 0) {
|
||||
$tasksarray = $object->getTasksArray(0, 0, $projectstatic->id, $socid, 0);
|
||||
$tasksarray = $object->getTasksArray(null, null, $projectstatic->id, $socid, 0);
|
||||
if (count($tasksarray) > 0) {
|
||||
$id = $tasksarray[0]->id;
|
||||
$object->fetch($id);
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
* Copyright (C) 2018 Ferran Marcet <fmarcet@2byte.es>
|
||||
* Copyright (C) 2021 Alexandre Spangaro <aspangaro@open-dsi.fr>
|
||||
* Copyright (C) 2023 Gauthier VERDOL <gauthier.verdol@atm-consulting.fr>
|
||||
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
|
||||
* Copyright (C) 2024-2025 MDW <mdeweerd@users.noreply.github.com>
|
||||
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
|
|
@ -165,28 +165,28 @@ if (empty($user->socid)) {
|
|||
}
|
||||
|
||||
$arrayfields = array(
|
||||
't.ref' => array('label' => "RefTask", 'checked' => 1, 'position' => 50),
|
||||
't.fk_task_parent' => array('label' => "RefTaskParent", 'checked' => 0, 'position' => 70),
|
||||
't.label' => array('label' => "LabelTask", 'checked' => 1, 'position' => 75),
|
||||
't.description' => array('label' => "Description", 'checked' => 0, 'position' => 80),
|
||||
't.dateo' => array('label' => "DateStart", 'checked' => 1, 'position' => 100),
|
||||
't.datee' => array('label' => "Deadline", 'checked' => 1, 'position' => 101),
|
||||
'p.ref' => array('label' => "ProjectRef", 'checked' => 1, 'position' => 151),
|
||||
'p.title' => array('label' => "ProjectLabel", 'checked' => 0, 'position' => 152),
|
||||
's.nom' => array('label' => "ThirdParty", 'checked' => -1, 'csslist' => 'tdoverflowmax125', 'position' => 200),
|
||||
's.name_alias' => array('label' => "AliasNameShort", 'checked' => 0, 'csslist' => 'tdoverflowmax125', 'position' => 201),
|
||||
'p.fk_statut' => array('label' => "ProjectStatus", 'checked' => 1, 'position' => 205),
|
||||
't.planned_workload' => array('label' => "PlannedWorkload", 'checked' => 1, 'position' => 302),
|
||||
't.duration_effective' => array('label' => "TimeSpent", 'checked' => 1, 'position' => 303),
|
||||
't.progress_calculated' => array('label' => "ProgressCalculated", 'checked' => -1, 'position' => 304),
|
||||
't.progress' => array('label' => "ProgressDeclared", 'checked' => 1, 'position' => 305),
|
||||
't.progress_summary' => array('label' => "TaskProgressSummary", 'checked' => 1, 'position' => 306),
|
||||
't.budget_amount' => array('label' => "Budget", 'checked' => 0, 'position' => 307),
|
||||
't.fk_statut' => array('label' => "TaskStatus", 'checked' => 0, 'position' => 308),
|
||||
't.tobill' => array('label' => "TimeToBill", 'checked' => 0, 'position' => 310),
|
||||
't.billed' => array('label' => "TimeBilled", 'checked' => 0, 'position' => 311),
|
||||
't.datec' => array('label' => "DateCreation", 'checked' => 0, 'position' => 500),
|
||||
't.tms' => array('label' => "DateModificationShort", 'checked' => 0, 'position' => 501),
|
||||
't.ref' => array('label' => "RefTask", 'checked' => '1', 'position' => 50),
|
||||
't.fk_task_parent' => array('label' => "RefTaskParent", 'checked' => '0', 'position' => 70),
|
||||
't.label' => array('label' => "LabelTask", 'checked' => '1', 'position' => 75),
|
||||
't.description' => array('label' => "Description", 'checked' => '0', 'position' => 80),
|
||||
't.dateo' => array('label' => "DateStart", 'checked' => '1', 'position' => 100),
|
||||
't.datee' => array('label' => "Deadline", 'checked' => '1', 'position' => 101),
|
||||
'p.ref' => array('label' => "ProjectRef", 'checked' => '1', 'position' => 151),
|
||||
'p.title' => array('label' => "ProjectLabel", 'checked' => '0', 'position' => 152),
|
||||
's.nom' => array('label' => "ThirdParty", 'checked' => '-1', 'csslist' => 'tdoverflowmax125', 'position' => 200),
|
||||
's.name_alias' => array('label' => "AliasNameShort", 'checked' => '0', 'csslist' => 'tdoverflowmax125', 'position' => 201),
|
||||
'p.fk_statut' => array('label' => "ProjectStatus", 'checked' => '1', 'position' => 205),
|
||||
't.planned_workload' => array('label' => "PlannedWorkload", 'checked' => '1', 'position' => 302),
|
||||
't.duration_effective' => array('label' => "TimeSpent", 'checked' => '1', 'position' => 303),
|
||||
't.progress_calculated' => array('label' => "ProgressCalculated", 'checked' => '-1', 'position' => 304),
|
||||
't.progress' => array('label' => "ProgressDeclared", 'checked' => '1', 'position' => 305),
|
||||
't.progress_summary' => array('label' => "TaskProgressSummary", 'checked' => '1', 'position' => 306),
|
||||
't.budget_amount' => array('label' => "Budget", 'checked' => '0', 'position' => 307),
|
||||
't.fk_statut' => array('label' => "TaskStatus", 'checked' => '0', 'position' => 308),
|
||||
't.tobill' => array('label' => "TimeToBill", 'checked' => '0', 'position' => 310),
|
||||
't.billed' => array('label' => "TimeBilled", 'checked' => '0', 'position' => 311),
|
||||
't.datec' => array('label' => "DateCreation", 'checked' => '0', 'position' => 500),
|
||||
't.tms' => array('label' => "DateModificationShort", 'checked' => '0', 'position' => 501),
|
||||
//'t.fk_statut'=>array('label'=>"Status", 'checked'=>1, 'position'=>1000),
|
||||
);
|
||||
// Extra fields
|
||||
|
|
@ -194,7 +194,7 @@ include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_array_fields.tpl.php';
|
|||
|
||||
$object->fields = dol_sort_array($object->fields, 'position');
|
||||
$arrayfields = dol_sort_array($arrayfields, 'position');
|
||||
'@phan-var-force array<string,array{label:string,checked?:int<0,1>,position?:int,help?:string}> $arrayfields'; // dol_sort_array looses type for Phan
|
||||
// '@phan-var-force array<string,array{label:string,checked?:int<0,1>,position?:int,help?:string}> $arrayfields'; // dol_sort_array looses type for Phan
|
||||
|
||||
$permissiontoread = $user->hasRight('projet', 'lire');
|
||||
$permissiontocreate = $user->hasRight('projet', 'creer');
|
||||
|
|
@ -296,10 +296,10 @@ $morejs = array();
|
|||
$morecss = array();
|
||||
|
||||
if ($search_project_user > 0) {
|
||||
$puser->fetch($search_project_user);
|
||||
$puser->fetch((int) $search_project_user);
|
||||
}
|
||||
if ($search_task_user > 0) {
|
||||
$tuser->fetch($search_task_user);
|
||||
$tuser->fetch((int) $search_task_user);
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -802,7 +802,7 @@ if (isModEnabled('category') && $user->hasRight('categorie', 'lire')) {
|
|||
require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
|
||||
$moreforfilter .= '<div class="divsearchfield">';
|
||||
$tmptitle = $langs->trans('ProjectCategories');
|
||||
$moreforfilter .= img_picto($tmptitle, 'category', 'class="pictofixedwidth"').$formother->select_categories('project', $search_categ, 'search_categ', 1, $tmptitle, 'maxwidth300');
|
||||
$moreforfilter .= img_picto($tmptitle, 'category', 'class="pictofixedwidth"').$formother->select_categories('project', (int) $search_categ, 'search_categ', 1, $tmptitle, 'maxwidth300');
|
||||
$moreforfilter .= '</div>';
|
||||
}
|
||||
|
||||
|
|
@ -813,7 +813,7 @@ $includeonly = '';
|
|||
if (!$user->hasRight('user', 'user', 'lire')) {
|
||||
$includeonly = array($user->id);
|
||||
}
|
||||
$moreforfilter .= img_picto($tmptitle, 'user', 'class="pictofixedwidth"').$form->select_dolusers($search_project_user ? $search_project_user : '', 'search_project_user', $tmptitle, '', 0, $includeonly, '', 0, 0, 0, '', 0, '', 'maxwidth250');
|
||||
$moreforfilter .= img_picto($tmptitle, 'user', 'class="pictofixedwidth"').$form->select_dolusers($search_project_user ? $search_project_user : '', 'search_project_user', $tmptitle, null, 0, $includeonly, '', '0', 0, 0, '', 0, '', 'maxwidth250');
|
||||
$moreforfilter .= '</div>';
|
||||
|
||||
// If the user can view users
|
||||
|
|
@ -823,7 +823,7 @@ $includeonly = '';
|
|||
if (!$user->hasRight('user', 'user', 'lire')) {
|
||||
$includeonly = array($user->id);
|
||||
}
|
||||
$moreforfilter .= img_picto($tmptitle, 'user', 'class="pictofixedwidth"').$form->select_dolusers($search_task_user, 'search_task_user', $tmptitle, '', 0, $includeonly, '', 0, 0, 0, '', 0, '', 'maxwidth250');
|
||||
$moreforfilter .= img_picto($tmptitle, 'user', 'class="pictofixedwidth"').$form->select_dolusers($search_task_user, 'search_task_user', $tmptitle, null, 0, $includeonly, '', '0', 0, 0, '', 0, '', 'maxwidth250');
|
||||
$moreforfilter .= '</div>';
|
||||
|
||||
// Filter on customer categories
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
<?php
|
||||
/* Copyright (C) 2010-2012 Regis Houssin <regis.houssin@inodbox.com>
|
||||
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
|
||||
* Copyright (C) 2025 MDW <mdeweerd@users.noreply.github.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
|
@ -83,7 +84,7 @@ if ($id > 0 || !empty($ref)) {
|
|||
// Retrieve First Task ID of Project if withprojet is on to allow project prev next to work
|
||||
if (!empty($project_ref) && !empty($withproject)) {
|
||||
if ($projectstatic->fetch(0, $project_ref) > 0) {
|
||||
$tasksarray = $object->getTasksArray(0, 0, $projectstatic->id, $socid, 0);
|
||||
$tasksarray = $object->getTasksArray(null, null, $projectstatic->id, $socid, 0);
|
||||
if (count($tasksarray) > 0) {
|
||||
$id = $tasksarray[0]->id;
|
||||
$object->fetch($id);
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
* Copyright (C) 2006-2017 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2010-2012 Regis Houssin <regis.houssin@inodbox.com>
|
||||
* Copyright (C) 2018-2024 Frédéric France <frederic.france@free.fr>
|
||||
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
|
||||
* Copyright (C) 2024-2025 MDW <mdeweerd@users.noreply.github.com>
|
||||
* Copyright (C) 2024 Vincent de Grandpré <vincent@de-grandpre.quebec>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
|
|
@ -633,7 +633,7 @@ if ($id > 0 || !empty($ref)) {
|
|||
'name' => 'task_origin',
|
||||
'label' => $langs->trans('MergeOriginTask'),
|
||||
'type' => 'other',
|
||||
'value' => $formproject->selectTasks(-1, '', 'task_origin', 24, 0, $langs->trans('SelectTask'), 0, 0, 0, 'maxwidth500 minwidth200', '', '', null, 1)
|
||||
'value' => $formproject->selectTasks(-1, 0, 'task_origin', 24, 0, $langs->trans('SelectTask'), 0, 0, 0, 'maxwidth500 minwidth200', '', '', null, 1)
|
||||
)
|
||||
);
|
||||
print $form->formconfirm($_SERVER["PHP_SELF"]."?id=".$object->id.(GETPOST('withproject') ? "&withproject=1" : ""), $langs->trans("MergeTasks"), $langs->trans("ConfirmMergeTasks"), "confirm_merge", $formquestion, 'yes', 1, 250);
|
||||
|
|
@ -830,7 +830,7 @@ if ($id > 0 || !empty($ref)) {
|
|||
$htmltoenteralink = $tmparray['htmltoenteralink'];
|
||||
print $htmltoenteralink;
|
||||
|
||||
$compatibleImportElementsList = false;
|
||||
$compatibleImportElementsList = array();
|
||||
$somethingshown = $form->showLinkedObjectBlock($object, $linktoelem, $compatibleImportElementsList);
|
||||
|
||||
print '</div><div class="fichehalfright">';
|
||||
|
|
|
|||
|
|
@ -378,10 +378,10 @@ if ($action == 'confirm_deleteline' && $confirm == "yes" && ($user->hasRight('pr
|
|||
}
|
||||
}
|
||||
|
||||
// Retrieve First Task ID of Project if withprojet is on to allow project prev next to work
|
||||
// Retrieve First Task ID of Project if withproject is on to allow project prev next to work
|
||||
if (!empty($project_ref) && !empty($withproject)) {
|
||||
if ($projectstatic->fetch(0, $project_ref) > 0) {
|
||||
$tasksarray = $object->getTasksArray(0, 0, $projectstatic->id, $socid, 0);
|
||||
$tasksarray = $object->getTasksArray(null, null, $projectstatic->id, $socid, 0);
|
||||
if (count($tasksarray) > 0) {
|
||||
$id = $tasksarray[0]->id;
|
||||
} else {
|
||||
|
|
@ -410,6 +410,7 @@ if (GETPOSTINT('projectid') > 0) {
|
|||
$result = $projectstatic->fetch($object->fk_project);
|
||||
}
|
||||
// If not task selected and no project selected
|
||||
$allprojectforuser = 0;
|
||||
if ($id <= 0 && $projectidforalltimes == 0) {
|
||||
$allprojectforuser = $user->id;
|
||||
}
|
||||
|
|
@ -495,7 +496,7 @@ if ($action == 'confirm_generateinvoice') {
|
|||
$arrayoftasks[$object->timespent_fk_user][(int) $object->timespent_fk_product]['totalvaluetodivideby3600'] += ($object->timespent_duration * $object->timespent_thm);
|
||||
}
|
||||
|
||||
foreach ($arrayoftasks as $userid => $data) {
|
||||
foreach ($arrayoftasks as $userid => $data) { // @phan-suppress-current-line PhanEmptyForeach
|
||||
$fuser->fetch($userid);
|
||||
$username = $fuser->getFullName($langs);
|
||||
|
||||
|
|
@ -563,7 +564,7 @@ if ($action == 'confirm_generateinvoice') {
|
|||
}
|
||||
|
||||
// Add lines
|
||||
$lineid = $tmpinvoice->addline($langs->trans("TimeSpentForInvoice", $username) . ' : ' . $qtyhourtext, $pu_htline, round($qtyhour / $prodDurationHours, 2), $txtvaline, $localtax1line, $localtax2line, ($idprodline > 0 ? $idprodline : 0), $remiseproject);
|
||||
$lineid = $tmpinvoice->addline($langs->trans("TimeSpentForInvoice", $username) . ' : ' . $qtyhourtext, $pu_htline, round($qtyhour / $prodDurationHours, 2), $txtvaline, $localtax1line, $localtax2line, ($idprodline > 0 ? $idprodline : 0), (float) $remiseproject);
|
||||
if ($lineid < 0) {
|
||||
$error++;
|
||||
setEventMessages(null, $tmpinvoice->errors, 'errors');
|
||||
|
|
@ -662,7 +663,7 @@ if ($action == 'confirm_generateinvoice') {
|
|||
}
|
||||
$idprodline = $value['fk_product'];
|
||||
}
|
||||
$lineid = $tmpinvoice->addline($value['note'], $pu_htline, round($qtyhour / $prodDurationHours, 2), $txtvaline, $localtax1line, $localtax2line, ($idprodline > 0 ? $idprodline : 0), $remiseproject);
|
||||
$lineid = $tmpinvoice->addline($value['note'], $pu_htline, round($qtyhour / $prodDurationHours, 2), $txtvaline, $localtax1line, $localtax2line, ($idprodline > 0 ? $idprodline : 0), (float) $remiseproject);
|
||||
if ($lineid < 0) {
|
||||
$error++;
|
||||
setEventMessages(null, $tmpinvoice->errors, 'errors');
|
||||
|
|
@ -683,13 +684,13 @@ if ($action == 'confirm_generateinvoice') {
|
|||
$arrayoftasks = array();
|
||||
foreach ($toselect as $key => $value) {
|
||||
// Get userid, timepent
|
||||
$object->fetchTimeSpent($value); // Call method to get list of timespent for a timespent line id (We use the utiliy method found into Task object)
|
||||
$object->fetchTimeSpent($value); // Call method to get list of timespent for a timespent line id (We use the utility method found into Task object)
|
||||
// $object->id is now the task id
|
||||
$arrayoftasks[$object->id][(int) $object->timespent_fk_product]['timespent'] += $object->timespent_duration;
|
||||
$arrayoftasks[$object->id][(int) $object->timespent_fk_product]['totalvaluetodivideby3600'] += ($object->timespent_duration * $object->timespent_thm);
|
||||
}
|
||||
|
||||
foreach ($arrayoftasks as $task_id => $data) {
|
||||
foreach ($arrayoftasks as $task_id => $data) { // @phan-suppress-current-line PhanEmptyForeach
|
||||
$ftask = new Task($db);
|
||||
$ftask->fetch($task_id);
|
||||
|
||||
|
|
@ -760,7 +761,7 @@ if ($action == 'confirm_generateinvoice') {
|
|||
$date_start = '';
|
||||
$date_end = '';
|
||||
$lineName = $ftask->ref . ' - ' . $ftask->label;
|
||||
$lineid = $tmpinvoice->addline($lineName, $pu_ht_for_task, price2num($qtyhour / $prodDurationHours, 'MS'), $txtvaline, $localtax1line, $localtax2line, ($idprodline > 0 ? $idprodline : 0), $remiseproject, $date_start, $date_end, 0, 0, '', 'HT', 0, 1, -1, 0, '', 0, 0, null, $pa_ht);
|
||||
$lineid = $tmpinvoice->addline($lineName, (float) $pu_ht_for_task, (float) price2num($qtyhour / $prodDurationHours, 'MS'), $txtvaline, $localtax1line, $localtax2line, ($idprodline > 0 ? $idprodline : 0), (float) $remiseproject, $date_start, $date_end, 0, 0, 0, 'HT', 0, 1, -1, 0, '', 0, 0, 0, $pa_ht);
|
||||
if ($lineid < 0) {
|
||||
$error++;
|
||||
setEventMessages($tmpinvoice->error, $tmpinvoice->errors, 'errors');
|
||||
|
|
@ -1281,30 +1282,30 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0 || $allprojectforuser
|
|||
|
||||
// Definition of fields for list
|
||||
$arrayfields = array();
|
||||
$arrayfields['t.element_date'] = array('label' => $langs->trans("Date"), 'checked' => 1);
|
||||
$arrayfields['p.fk_soc'] = array('label' => $langs->trans("ThirdParty"), 'type' => 'integer:Societe:/societe/class/societe.class.php:1','checked' => 1);
|
||||
$arrayfields['t.element_date'] = array('label' => $langs->trans("Date"), 'checked' => '1');
|
||||
$arrayfields['p.fk_soc'] = array('label' => $langs->trans("ThirdParty"), 'type' => 'integer:Societe:/societe/class/societe.class.php:1','checked' => '1');
|
||||
$arrayfields['s.name_alias'] = array('label' => $langs->trans("AliasNameShort"), 'type' => 'integer:Societe:/societe/class/societe.class.php:1');
|
||||
if ((empty($id) && empty($ref)) || !empty($projectidforalltimes)) { // Not a dedicated task
|
||||
if (! empty($allprojectforuser)) {
|
||||
$arrayfields['p.project_ref'] = ['label' => $langs->trans('RefProject'), 'checked' => 1];
|
||||
$arrayfields['p.project_label'] = ['label' => $langs->trans('ProjectLabel'), 'checked' => 1];
|
||||
$arrayfields['p.project_ref'] = ['label' => $langs->trans('RefProject'), 'checked' => '1'];
|
||||
$arrayfields['p.project_label'] = ['label' => $langs->trans('ProjectLabel'), 'checked' => '1'];
|
||||
}
|
||||
$arrayfields['t.element_ref'] = array('label' => $langs->trans("RefTask"), 'checked' => 1);
|
||||
$arrayfields['t.element_label'] = array('label' => $langs->trans("LabelTask"), 'checked' => 1);
|
||||
$arrayfields['t.element_ref'] = array('label' => $langs->trans("RefTask"), 'checked' => '1');
|
||||
$arrayfields['t.element_label'] = array('label' => $langs->trans("LabelTask"), 'checked' => '1');
|
||||
}
|
||||
$arrayfields['author'] = array('label' => $langs->trans("By"), 'checked' => 1);
|
||||
$arrayfields['t.note'] = array('label' => $langs->trans("Note"), 'checked' => 1);
|
||||
$arrayfields['author'] = array('label' => $langs->trans("By"), 'checked' => '1');
|
||||
$arrayfields['t.note'] = array('label' => $langs->trans("Note"), 'checked' => '1');
|
||||
if (isModEnabled('service') && !empty($projectstatic->thirdparty) && $projectstatic->thirdparty->id > 0 && $projectstatic->usage_bill_time) {
|
||||
$arrayfields['t.fk_product'] = array('label' => $langs->trans("Product"), 'checked' => 1);
|
||||
$arrayfields['t.fk_product'] = array('label' => $langs->trans("Product"), 'checked' => '1');
|
||||
}
|
||||
$arrayfields['t.element_duration'] = array('label' => $langs->trans("Duration"), 'checked' => 1);
|
||||
$arrayfields['value'] = array('label' => $langs->trans("Value"), 'checked' => 1, 'enabled' => isModEnabled("salaries"));
|
||||
$arrayfields['valuebilled'] = array('label' => $langs->trans("Billed"), 'checked' => 1, 'enabled' => (((getDolGlobalInt('PROJECT_HIDE_TASKS') || !getDolGlobalInt('PROJECT_BILL_TIME_SPENT')) ? 0 : 1) && $projectstatic->usage_bill_time));
|
||||
$arrayfields['t.element_duration'] = array('label' => $langs->trans("Duration"), 'checked' => '1');
|
||||
$arrayfields['value'] = array('label' => $langs->trans("Value"), 'checked' => '1', 'enabled' => (string) (int) isModEnabled("salaries"));
|
||||
$arrayfields['valuebilled'] = array('label' => $langs->trans("Billed"), 'checked' => '1', 'enabled' => (string) (int) (((getDolGlobalInt('PROJECT_HIDE_TASKS') || !getDolGlobalInt('PROJECT_BILL_TIME_SPENT')) ? 0 : 1) && $projectstatic->usage_bill_time));
|
||||
// Extra fields
|
||||
include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_list_array_fields.tpl.php';
|
||||
|
||||
$arrayfields = dol_sort_array($arrayfields, 'position');
|
||||
'@phan-var-force array<string,array{label:string,checked?:int<0,1>,position?:int,help?:string}> $arrayfields'; // dol_sort_array looses type for Phan
|
||||
// '@phan-var-force array<string,array{label:string,checked?:int<0,1>,position?:int,help?:string}> $arrayfields'; // dol_sort_array looses type for Phan
|
||||
|
||||
$param = '';
|
||||
if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) {
|
||||
|
|
@ -1478,7 +1479,7 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0 || $allprojectforuser
|
|||
print $langs->trans('ServiceToUseOnLines');
|
||||
print '</td>';
|
||||
print '<td>';
|
||||
$form->select_produits('', 'productid', '1', 0, $projectstatic->thirdparty->price_level, 1, 2, '', 0, array(), $projectstatic->thirdparty->id, 'None', 0, 'maxwidth500');
|
||||
$form->select_produits(0, 'productid', '1', 0, $projectstatic->thirdparty->price_level, 1, 2, '', 0, array(), $projectstatic->thirdparty->id, 'None', 0, 'maxwidth500');
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
}
|
||||
|
|
@ -1625,7 +1626,7 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0 || $allprojectforuser
|
|||
$sql .= " AND t.fk_element =".((int) $object->id);
|
||||
} elseif (!empty($projectidforalltimes)) {
|
||||
// Limit on one project
|
||||
$sql .= " AND pt.fk_projet IN (" . $db->sanitize($projectidforalltimes) . ")";
|
||||
$sql .= " AND pt.fk_projet IN (" . $db->sanitize((string) $projectidforalltimes) . ")";
|
||||
} elseif (!empty($allprojectforuser)) {
|
||||
// Limit on on user
|
||||
if (empty($search_user)) {
|
||||
|
|
@ -1819,7 +1820,7 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0 || $allprojectforuser
|
|||
$nboftasks = 0;
|
||||
if (empty($id)) {
|
||||
print '<td class="maxwidthonsmartphone">';
|
||||
$nboftasks = $formproject->selectTasks(-1, GETPOSTINT('taskid'), 'taskid', 0, 0, 1, 1, 0, 0, 'maxwidth300', $projectstatic->id, 'progress');
|
||||
$nboftasks = $formproject->selectTasks(-1, GETPOSTINT('taskid'), 'taskid', 0, 0, '1', 1, 0, 0, 'maxwidth300', (string) $projectstatic->id, 'progress');
|
||||
print '</td>';
|
||||
}
|
||||
|
||||
|
|
@ -1837,7 +1838,7 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0 || $allprojectforuser
|
|||
if ($projectstatic->public) {
|
||||
$contactsofproject = array();
|
||||
}
|
||||
print $form->select_dolusers((GETPOSTINT('userid') ? GETPOSTINT('userid') : $userid), 'userid', 0, '', 0, '', $contactsofproject, 0, 0, 0, '', 0, $langs->trans("ResourceNotAssignedToProject"), 'minwidth150imp maxwidth200');
|
||||
print $form->select_dolusers((GETPOSTINT('userid') ? GETPOSTINT('userid') : $userid), 'userid', 0, null, 0, '', $contactsofproject, '0', 0, 0, '', 0, $langs->trans("ResourceNotAssignedToProject"), 'minwidth150imp maxwidth200');
|
||||
} else {
|
||||
if ($nboftasks) {
|
||||
print img_error($langs->trans('FirstAddRessourceToAllocateTime')) . ' ' . $langs->trans('FirstAddRessourceToAllocateTime');
|
||||
|
|
@ -1967,7 +1968,7 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0 || $allprojectforuser
|
|||
}
|
||||
// Author
|
||||
if (!empty($arrayfields['author']['checked'])) {
|
||||
print '<td class="liste_titre">'.$form->select_dolusers(($search_user > 0 ? $search_user : -1), 'search_user', 1, null, 0, '', '', 0, 0, 0, '', 0, '', 'maxwidth125').'</td>';
|
||||
print '<td class="liste_titre">'.$form->select_dolusers(($search_user > 0 ? $search_user : -1), 'search_user', 1, null, 0, '', '', '0', 0, 0, '', 0, '', 'maxwidth125').'</td>';
|
||||
}
|
||||
// Note
|
||||
if (!empty($arrayfields['t.note']['checked'])) {
|
||||
|
|
@ -2228,6 +2229,7 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0 || $allprojectforuser
|
|||
|
||||
// Thirdparty alias
|
||||
if (!empty($arrayfields['s.name_alias']['checked'])) {
|
||||
$valtoshow = '';
|
||||
if ($task_time->fk_soc > 0) {
|
||||
if (empty($conf->cache['thirdparty'][$task_time->fk_soc])) {
|
||||
$tmpsociete = new Societe($db);
|
||||
|
|
@ -2285,7 +2287,7 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0 || $allprojectforuser
|
|||
if ((empty($id) && empty($ref)) || !empty($projectidforalltimes)) { // Not a dedicated task
|
||||
print '<td class="nowrap">';
|
||||
if ($action == 'editline' && GETPOSTINT('lineid') == $task_time->rowid) {
|
||||
$formproject->selectTasks(-1, GETPOSTINT('taskid') ? GETPOSTINT('taskid') : $task_time->fk_element, 'taskid', 0, 0, 1, 1, 0, 0, 'maxwidth250', $projectstatic->id, '');
|
||||
$formproject->selectTasks(-1, GETPOSTINT('taskid') ? GETPOSTINT('taskid') : $task_time->fk_element, 'taskid', 0, 0, '1', 1, 0, 0, 'maxwidth250', (string) $projectstatic->id, '');
|
||||
} else {
|
||||
$tasktmp->id = $task_time->fk_element;
|
||||
$tasktmp->ref = $task_time->ref;
|
||||
|
|
@ -2633,7 +2635,7 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0 || $allprojectforuser
|
|||
}
|
||||
if (count($contactsoftask) > 0) {
|
||||
print img_object('', 'user', 'class="hideonsmartphone"');
|
||||
print $form->select_dolusers($task_time->fk_user, 'userid_line', 0, '', 0, '', $contactsoftask);
|
||||
print $form->select_dolusers($task_time->fk_user, 'userid_line', 0, null, 0, '', $contactsoftask);
|
||||
} else {
|
||||
print img_error($langs->trans('FirstAddRessourceToAllocateTime')) . $langs->trans('FirstAddRessourceToAllocateTime');
|
||||
}
|
||||
|
|
@ -2798,7 +2800,7 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0 || $allprojectforuser
|
|||
}
|
||||
if (count($contactsoftask) > 0) {
|
||||
print img_object('', 'user', 'class="hideonsmartphone"');
|
||||
print $form->select_dolusers($task_time->fk_user, 'userid_line_2', 0, '', 0, '', $contactsoftask);
|
||||
print $form->select_dolusers($task_time->fk_user, 'userid_line_2', 0, null, 0, '', $contactsoftask);
|
||||
} else {
|
||||
print img_error($langs->trans('FirstAddRessourceToAllocateTime')) . $langs->trans('FirstAddRessourceToAllocateTime');
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
<?php
|
||||
/* Copyright (C) 2021 Dorian Vabre <dorian.vabre@gmail.com>
|
||||
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
|
||||
* Copyright (C) 2024-2025 MDW <mdeweerd@users.noreply.github.com>
|
||||
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
|
|
@ -86,7 +86,7 @@ $dateend = dol_mktime(23, 59, 59, GETPOSTINT('dateendmonth'), GETPOSTINT('dateen
|
|||
$id = GETPOST('id');
|
||||
|
||||
$project = new Project($db);
|
||||
$resultproject = $project->fetch($id);
|
||||
$resultproject = $project->fetch((int) $id);
|
||||
if ($resultproject < 0) {
|
||||
$error++;
|
||||
$errmsg .= $project->error;
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
<?php
|
||||
/* Copyright (C) 2021 Dorian Vabre <dorian.vabre@gmail.com>
|
||||
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
|
||||
* Copyright (C) 2024-2025 MDW <mdeweerd@users.noreply.github.com>
|
||||
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
|
|
@ -86,7 +86,7 @@ $dateend = dol_mktime(23, 59, 59, GETPOSTINT('dateendmonth'), GETPOSTINT('dateen
|
|||
$id = GETPOST('id');
|
||||
|
||||
$project = new Project($db);
|
||||
$resultproject = $project->fetch($id);
|
||||
$resultproject = $project->fetch((int) $id);
|
||||
if ($resultproject < 0) {
|
||||
$error++;
|
||||
$errmsg .= $project->error;
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
<?php
|
||||
/* Copyright (C) 2021 Dorian Vabre <dorian.vabre@gmail.com>
|
||||
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
|
||||
* Copyright (C) 2025 MDW <mdeweerd@users.noreply.github.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
|
@ -97,7 +98,7 @@ $listofvotes = explode(',', $_SESSION["savevotes"]);
|
|||
$urlwithroot = DOL_MAIN_URL_ROOT; // This is to use same domain name than current. For Paypal payment, we can use internal URL like localhost.
|
||||
|
||||
$project = new Project($db);
|
||||
$resultproject = $project->fetch($id);
|
||||
$resultproject = $project->fetch((int) $id);
|
||||
if ($resultproject < 0) {
|
||||
$error++;
|
||||
$errmsg .= $project->error;
|
||||
|
|
|
|||
|
|
@ -888,7 +888,7 @@ if ($action == 'create') {
|
|||
print '<tr>';
|
||||
print '<td>'.$langs->trans("Project").'</td><td colspan="2">';
|
||||
print img_picto('', 'project', 'class="paddingright"');
|
||||
print $formproject->select_projects((!getDolGlobalString('PROJECT_CAN_ALWAYS_LINK_TO_ALL_SUPPLIERS') ? $soc->id : -1), $projectid, 'projectid', 0, 0, 1, 0, 1, 0, 0, '', 1, 0, 'maxwidth500');
|
||||
print $formproject->select_projects((!getDolGlobalString('PROJECT_CAN_ALWAYS_LINK_TO_ALL_SUPPLIERS') ? $soc->id : -1), (string) $projectid, 'projectid', 0, 0, 1, 0, 1, 0, 0, '', 1, 0, 'maxwidth500');
|
||||
print ' <a href="'.DOL_URL_ROOT.'/projet/card.php?socid='.$soc->id.'&action=create&status=1&backtopage='.urlencode($_SERVER["PHP_SELF"].'?action=create&socid='.$soc->id).'"><span class="fa fa-plus-circle valignmiddle" title="'.$langs->trans("AddProject").'"></span></a>';
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
<?php
|
||||
/* Copyright (C) 2017 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
|
||||
* Copyright (C) 2024-2025 MDW <mdeweerd@users.noreply.github.com>
|
||||
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
|
|
@ -245,7 +245,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
|||
$morehtmlref .= '<form method="post" action="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'">';
|
||||
$morehtmlref .= '<input type="hidden" name="action" value="classin">';
|
||||
$morehtmlref .= '<input type="hidden" name="token" value="'.newToken().'">';
|
||||
$morehtmlref .= $formproject->select_projects($object->socid, $object->fk_project, 'projectid', $maxlength, 0, 1, 0, 1, 0, 0, '', 1);
|
||||
$morehtmlref .= $formproject->select_projects($object->socid, (string) $object->fk_project, 'projectid', $maxlength, 0, 1, 0, 1, 0, 0, '', 1);
|
||||
$morehtmlref .= '<input type="submit" class="button valignmiddle" value="'.$langs->trans("Modify").'">';
|
||||
$morehtmlref .= '</form>';
|
||||
} else {
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
<?php
|
||||
/* Copyright (C) 2017 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
|
||||
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
|
||||
* Copyright (C) 2024-2025 MDW <mdeweerd@users.noreply.github.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
|
@ -345,7 +345,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
|||
$morehtmlref .= '<form method="post" action="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'">';
|
||||
$morehtmlref .= '<input type="hidden" name="action" value="classin">';
|
||||
$morehtmlref .= '<input type="hidden" name="token" value="'.newToken().'">';
|
||||
$morehtmlref .= $formproject->select_projects($object->socid, $object->fk_project, 'projectid', $maxlength, 0, 1, 0, 1, 0, 0, '', 1);
|
||||
$morehtmlref .= $formproject->select_projects($object->socid, (string) $object->fk_project, 'projectid', $maxlength, 0, 1, 0, 1, 0, 0, '', 1);
|
||||
$morehtmlref .= '<input type="submit" class="button valignmiddle" value="'.$langs->trans("Modify").'">';
|
||||
$morehtmlref .= '</form>';
|
||||
} else {
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@
|
|||
* Copyright (C) 2021 Gauthier VERDOL <gauthier.verdol@atm-consulting.fr>
|
||||
* Copyright (C) 2023 Maxime Nicolas <maxime@oarces.com>
|
||||
* Copyright (C) 2023 Benjamin GREMBI <benjamin@oarces.com>
|
||||
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
|
||||
* Copyright (C) 2024-2025 MDW <mdeweerd@users.noreply.github.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
|
@ -615,7 +615,7 @@ if ($action == 'create' && $permissiontoadd) {
|
|||
|
||||
print '<tr><td>'.$langs->trans("Project").'</td><td>';
|
||||
print img_picto('', 'project', 'class="pictofixedwidth"');
|
||||
print $formproject->select_projects(-1, $projectid, 'fk_project', 0, 0, 1, 1, 0, 0, 0, '', 1);
|
||||
print $formproject->select_projects(-1, (string) $projectid, 'fk_project', 0, 0, 1, 1, 0, 0, 0, '', 1);
|
||||
print '</td></tr>';
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@
|
|||
* Copyright (C) 2021 Thibault FOUCART <support@ptibogxiv.net>
|
||||
* Copyright (C) 2022 Alexandre Spangaro <aspangaro@open-dsi.fr>
|
||||
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
|
||||
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
|
||||
* Copyright (C) 2024-2025 MDW <mdeweerd@users.noreply.github.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
|
@ -364,7 +364,7 @@ if (isModEnabled('project')) {
|
|||
print img_picto('', 'project', 'class="pictofixedwidth"');
|
||||
// select_projects($socid = -1, $selected = '', $htmlname = 'projectid', $maxlength = 16, $option_only = 0, $show_empty = 1, $discard_closed = 0, $forcefocus = 0, $disabled = 0, $mode = 0, $filterkey = '', $nooutput = 0, $forceaddid = 0, $morecss = '', $htmlid = '', $morefilter = '')
|
||||
$projectid = getDolGlobalInt('CASHDESK_ID_PROJECT'.$terminaltouse);
|
||||
print $formproject->select_projects(-1, $projectid, 'projectid', 0, 0, 1, 1, 0, 0, 0, '', 1, 1, 'maxwidth500 widthcentpercentminusxx');
|
||||
print $formproject->select_projects(-1, (string) $projectid, 'projectid', 0, 0, 1, 1, 0, 0, 0, '', 1, 1, 'maxwidth500 widthcentpercentminusxx');
|
||||
print '</td></tr>';
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
/* Copyright (C) 2006-2016 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2016 Ion Agorria <ion@agorria.com>
|
||||
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
|
||||
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
|
||||
* Copyright (C) 2024-2025 MDW <mdeweerd@users.noreply.github.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
|
@ -385,7 +385,7 @@ function getProject($authentication, $id = '', $ref = '')
|
|||
|
||||
if ($fuser->hasRight('projet', 'lire')) {
|
||||
$project = new Project($db);
|
||||
$result = $project->fetch($id, $ref);
|
||||
$result = $project->fetch((int) $id, $ref);
|
||||
if ($result > 0) {
|
||||
$project_result_fields = array(
|
||||
'id' => $project->id,
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user