2
0
forked from Wavyzz/dolibarr

Fix PhanPluginRedundantAssignment

This commit is contained in:
MDW
2024-03-13 00:32:24 +01:00
parent accbf347d1
commit ce85da498c

View File

@@ -149,18 +149,18 @@ class doc_generic_task_odt extends ModelePDFTask
}
$resarray = array(
$array_key.'_id'=>$object->id,
$array_key.'_ref'=>$object->ref,
$array_key.'_title'=>$object->title,
$array_key.'_description'=>$object->description,
$array_key.'_date_creation'=>dol_print_date($object->date_c, 'day'),
$array_key.'_date_modification'=>dol_print_date($object->date_m, 'day'),
$array_key.'_date_start'=>dol_print_date($object->date_start, 'day'),
$array_key.'_date_end'=>dol_print_date($object->date_end, 'day'),
$array_key.'_note_private'=>$object->note_private,
$array_key.'_note_public'=>$object->note_public,
$array_key.'_public'=>$object->public,
$array_key.'_statut'=>$object->getLibStatut()
$array_key.'_id' => $object->id,
$array_key.'_ref' => $object->ref,
$array_key.'_title' => $object->title,
$array_key.'_description' => $object->description,
$array_key.'_date_creation' => dol_print_date($object->date_c, 'day'),
$array_key.'_date_modification' => dol_print_date($object->date_m, 'day'),
$array_key.'_date_start' => dol_print_date($object->date_start, 'day'),
$array_key.'_date_end' => dol_print_date($object->date_end, 'day'),
$array_key.'_note_private' => $object->note_private,
$array_key.'_note_public' => $object->note_public,
$array_key.'_public' => $object->public,
$array_key.'_statut' => $object->getLibStatut()
);
// Retrieve extrafields
@@ -188,23 +188,23 @@ class doc_generic_task_odt extends ModelePDFTask
global $extrafields;
$resarray = array(
'task_ref'=>$task->ref,
'task_fk_project'=>$task->fk_project,
'task_projectref'=>$task->projectref,
'task_projectlabel'=>$task->projectlabel,
'task_label'=>$task->label,
'task_description'=>$task->description,
'task_fk_parent'=>$task->fk_task_parent,
'task_duration'=>$task->duration_effective,
'task_duration_formated'=>convertSecondToTime($task->duration_effective, 'allhourmin'),
'task_planned_workload'=>$task->planned_workload,
'task_planned_workload_formated'=>convertSecondToTime($task->planned_workload, 'allhourmin'),
'task_progress'=>$task->progress,
'task_public'=>$task->public,
'task_date_start'=>dol_print_date($task->date_start, 'day'),
'task_date_end'=>dol_print_date($task->date_end, 'day'),
'task_note_private'=>$task->note_private,
'task_note_public'=>$task->note_public
'task_ref' => $task->ref,
'task_fk_project' => $task->fk_project,
'task_projectref' => $task->projectref,
'task_projectlabel' => $task->projectlabel,
'task_label' => $task->label,
'task_description' => $task->description,
'task_fk_parent' => $task->fk_task_parent,
'task_duration' => $task->duration_effective,
'task_duration_formated' => convertSecondToTime($task->duration_effective, 'allhourmin'),
'task_planned_workload' => $task->planned_workload,
'task_planned_workload_formated' => convertSecondToTime($task->planned_workload, 'allhourmin'),
'task_progress' => $task->progress,
'task_public' => $task->public,
'task_date_start' => dol_print_date($task->date_start, 'day'),
'task_date_end' => dol_print_date($task->date_end, 'day'),
'task_note_private' => $task->note_private,
'task_note_public' => $task->note_public
);
// Retrieve extrafields
@@ -229,14 +229,14 @@ class doc_generic_task_odt extends ModelePDFTask
{
// phpcs:enable
return array(
'projcontacts_id'=>$contact['id'],
'projcontacts_rowid'=>$contact['rowid'],
'projcontacts_role'=>$contact['libelle'],
'projcontacts_lastname'=>$contact['lastname'],
'projcontacts_firstname'=>$contact['firstname'],
'projcontacts_fullcivname'=>$contact['fullname'],
'projcontacts_socname'=>$contact['socname'],
'projcontacts_email'=>$contact['email']
'projcontacts_id' => $contact['id'],
'projcontacts_rowid' => $contact['rowid'],
'projcontacts_role' => $contact['libelle'],
'projcontacts_lastname' => $contact['lastname'],
'projcontacts_firstname' => $contact['firstname'],
'projcontacts_fullcivname' => $contact['fullname'],
'projcontacts_socname' => $contact['socname'],
'projcontacts_email' => $contact['email']
);
}
@@ -252,9 +252,9 @@ class doc_generic_task_odt extends ModelePDFTask
{
// phpcs:enable
return array(
'projfile_name'=>$file['name'],
'projfile_date'=>dol_print_date($file['date'], 'day'),
'projfile_size'=>$file['size']
'projfile_name' => $file['name'],
'projfile_date' => dol_print_date($file['date'], 'day'),
'projfile_size' => $file['size']
);
}
@@ -270,13 +270,13 @@ class doc_generic_task_odt extends ModelePDFTask
{
// phpcs:enable
return array(
'projref_type'=>$refdetail['type'],
'projref_ref'=>$refdetail['ref'],
'projref_date'=>dol_print_date($refdetail['date'], 'day'),
'projref_socname'=>$refdetail['socname'],
'projref_amountht'=>price($refdetail['amountht'], 0, $outputlangs),
'projref_amountttc'=>price($refdetail['amountttc'], 0, $outputlangs),
'projref_status'=>$refdetail['status']
'projref_type' => $refdetail['type'],
'projref_ref' => $refdetail['ref'],
'projref_date' => dol_print_date($refdetail['date'], 'day'),
'projref_socname' => $refdetail['socname'],
'projref_amountht' => price($refdetail['amountht'], 0, $outputlangs),
'projref_amountttc' => price($refdetail['amountttc'], 0, $outputlangs),
'projref_status' => $refdetail['status']
);
}
@@ -318,14 +318,14 @@ class doc_generic_task_odt extends ModelePDFTask
global $conf;
return array(
'tasktime_rowid'=>$tasktime['rowid'],
'tasktime_task_date'=>dol_print_date($tasktime['task_date'], 'day'),
'tasktime_task_duration'=>convertSecondToTime($tasktime['task_duration'], 'all'),
'tasktime_note'=>$tasktime['note'],
'tasktime_fk_user'=>$tasktime['fk_user'],
'tasktime_user_name'=>$tasktime['name'],
'tasktime_user_first'=>$tasktime['firstname'],
'tasktime_fullcivname'=>$tasktime['fullcivname']
'tasktime_rowid' => $tasktime['rowid'],
'tasktime_task_date' => dol_print_date($tasktime['task_date'], 'day'),
'tasktime_task_duration' => convertSecondToTime($tasktime['task_duration'], 'all'),
'tasktime_note' => $tasktime['note'],
'tasktime_fk_user' => $tasktime['fk_user'],
'tasktime_user_name' => $tasktime['name'],
'tasktime_user_first' => $tasktime['firstname'],
'tasktime_fullcivname' => $tasktime['fullcivname']
);
}
@@ -341,9 +341,9 @@ class doc_generic_task_odt extends ModelePDFTask
{
// phpcs:enable
return array(
'tasksfile_name'=>$file['name'],
'tasksfile_date'=>dol_print_date($file['date'], 'day'),
'tasksfile_size'=>$file['size']
'tasksfile_name' => $file['name'],
'tasksfile_date' => dol_print_date($file['date'], 'day'),
'tasksfile_size' => $file['size']
);
}
@@ -538,7 +538,7 @@ class doc_generic_task_odt extends ModelePDFTask
// Call the ODTSubstitution hook
$tmparray = array();
$action = '';
$parameters = array('file'=>$file, 'object'=>$object, 'outputlangs'=>$outputlangs, 'substitutionarray'=>&$tmparray);
$parameters = array('file' => $file, 'object' => $object, 'outputlangs' => $outputlangs, 'substitutionarray' => &$tmparray);
$reshook = $hookmanager->executeHooks('ODTSubstitution', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks
// Open and load template
@@ -765,7 +765,7 @@ class doc_generic_task_odt extends ModelePDFTask
}
// Replace tags of lines for contacts
$sourcearray = array('internal', 'external');
$sourcearray = array('internal', 'external'); // @phan-suppress-current-line PhanPluginRedundantAssignment
$contact_arrray = array();
foreach ($sourcearray as $source) {
$contact_temp = $project->liste_contact(-1, $source);
@@ -815,7 +815,7 @@ class doc_generic_task_odt extends ModelePDFTask
// Call the beforeODTSave hook
$parameters = array('odfHandler'=>&$odfHandler, 'file'=>$file, 'object'=>$object, 'outputlangs'=>$outputlangs, 'substitutionarray'=>&$tmparray);
$parameters = array('odfHandler' => &$odfHandler, 'file' => $file, 'object' => $object, 'outputlangs' => $outputlangs, 'substitutionarray' => &$tmparray);
$reshook = $hookmanager->executeHooks('beforeODTSave', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks
@@ -837,14 +837,14 @@ class doc_generic_task_odt extends ModelePDFTask
return -1;
}
}
$parameters = array('odfHandler'=>&$odfHandler, 'file'=>$file, 'object'=>$object, 'outputlangs'=>$outputlangs, 'substitutionarray'=>&$tmparray);
$parameters = array('odfHandler' => &$odfHandler, 'file' => $file, 'object' => $object, 'outputlangs' => $outputlangs, 'substitutionarray' => &$tmparray);
$reshook = $hookmanager->executeHooks('afterODTCreation', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks
dolChmod($file);
$odfHandler = null; // Destroy object
$this->result = array('fullpath'=>$file);
$this->result = array('fullpath' => $file);
return 1; // Success
} else {