From 4028b5d5686ca78a32b88e4acea39b65340bd309 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 29 Apr 2023 13:04:45 +0200 Subject: [PATCH] Clean code --- htdocs/adherents/class/adherent.class.php | 2 +- .../adherents/class/adherent_type.class.php | 3 +- htdocs/adherents/list.php | 2 +- htdocs/adherents/subscription/list.php | 2 +- htdocs/adherents/type.php | 2 +- htdocs/admin/emailcollector_list.php | 2 +- htdocs/bom/bom_list.php | 2 +- htdocs/bookcal/availabilities_list.php | 2 +- htdocs/bookcal/booking_list.php | 2 +- htdocs/bookmarks/list.php | 2 +- htdocs/comm/propal/class/propal.class.php | 1 - htdocs/comm/propal/list.php | 2 +- htdocs/commande/list.php | 2 +- htdocs/compta/bank/list.php | 2 +- htdocs/compta/bank/various_payment/list.php | 2 +- .../compta/cashcontrol/cashcontrol_list.php | 1 - htdocs/compta/facture/list.php | 5 +- htdocs/compta/localtax/list.php | 2 +- htdocs/compta/paiement/cheque/list.php | 2 +- htdocs/compta/prelevement/list.php | 2 +- htdocs/compta/prelevement/orders_list.php | 2 +- htdocs/compta/sociales/list.php | 3 +- htdocs/compta/tva/list.php | 2 +- htdocs/contact/list.php | 2 +- htdocs/contrat/class/contrat.class.php | 1 - htdocs/contrat/list.php | 1 + htdocs/core/class/timespent.class.php | 5 + htdocs/don/list.php | 2 +- .../conferenceorbooth_list.php | 2 +- .../conferenceorboothattendee_list.php | 2 +- htdocs/expedition/list.php | 3 +- htdocs/expensereport/list.php | 4 +- htdocs/expensereport/payment/list.php | 2 +- htdocs/fichinter/class/fichinter.class.php | 1 - .../class/fournisseur.commande.class.php | 1 - htdocs/fourn/commande/list.php | 2 +- htdocs/holiday/list.php | 2 +- htdocs/hrm/evaluation_list.php | 6 +- htdocs/hrm/job_list.php | 2 +- htdocs/hrm/position_list.php | 3 +- htdocs/hrm/skill_list.php | 2 +- .../class/knowledgerecord.class.php | 2 - .../knowledgerecord_list.php | 2 +- htdocs/loan/class/loan.class.php | 3 +- htdocs/loan/list.php | 2 +- .../modulebuilder/template/myobject_list.php | 2 +- htdocs/mrp/mo_list.php | 7 +- htdocs/partnership/partnership_list.php | 2 +- htdocs/product/inventory/list.php | 2 +- htdocs/product/list.php | 3 +- htdocs/product/stock/list.php | 2 +- htdocs/product/stock/movement_list.php | 2 +- htdocs/projet/class/project.class.php | 22 +++-- htdocs/projet/class/task.class.php | 2 - htdocs/projet/list.php | 99 ++++++++++--------- htdocs/projet/tasks/list.php | 2 + .../class/recruitmentjobposition.class.php | 6 +- .../recruitmentcandidature_list.php | 9 +- .../recruitmentjobposition_list.php | 2 +- htdocs/salaries/list.php | 2 +- htdocs/salaries/payments.php | 2 +- htdocs/societe/list.php | 2 +- htdocs/supplier_proposal/list.php | 5 +- htdocs/ticket/list.php | 9 +- htdocs/user/group/list.php | 2 +- htdocs/user/list.php | 2 +- htdocs/variants/list.php | 2 +- htdocs/webhook/target_list.php | 2 +- htdocs/workstation/workstation_list.php | 2 +- 69 files changed, 154 insertions(+), 139 deletions(-) diff --git a/htdocs/adherents/class/adherent.class.php b/htdocs/adherents/class/adherent.class.php index a4a4c0c71bb..2a92ff52bcc 100644 --- a/htdocs/adherents/class/adherent.class.php +++ b/htdocs/adherents/class/adherent.class.php @@ -3303,7 +3303,7 @@ class Adherent extends CommonObject */ public function getKanbanView($option = '', $arraydata = null) { - global $selected; + $selected = (empty($arraydata['selected']) ? 0 : $arraydata['selected']); $return = '
'; $return .= '
'; diff --git a/htdocs/adherents/class/adherent_type.class.php b/htdocs/adherents/class/adherent_type.class.php index ea7c68bbff8..cdb7f5a3086 100644 --- a/htdocs/adherents/class/adherent_type.class.php +++ b/htdocs/adherents/class/adherent_type.class.php @@ -996,6 +996,8 @@ class AdherentType extends CommonObject { global $langs, $user; + //$selected = (empty($arraydata['selected']) ? 0 : $arraydata['selected']); + $return = '
'; $return .= '
'; $return .= ''; @@ -1004,7 +1006,6 @@ class AdherentType extends CommonObject $return .= '
'; $return .= ''.(method_exists($this, 'getNomUrl') ? $this->getNomUrl() : $this->ref).''; - //$selected = (empty($arraydata['selected']) ? 0 : $arraydata['selected']); //$return .= ''; if ($user->rights->adherent->configurer) { diff --git a/htdocs/adherents/list.php b/htdocs/adherents/list.php index 0013db9ffa9..c3c9f1b7863 100644 --- a/htdocs/adherents/list.php +++ b/htdocs/adherents/list.php @@ -1068,7 +1068,7 @@ while ($i < $imaxinloop) { $memberstatic->type = $membertypestatic->label; $memberstatic->photo = $obj->photo; // Output Kanban - print $memberstatic->getKanbanView(''); + print $memberstatic->getKanbanView('', array('selected' => in_array($object->id, $arrayofselected))); if ($i == (min($num, $limit) - 1)) { print '
'; print ''; diff --git a/htdocs/adherents/subscription/list.php b/htdocs/adherents/subscription/list.php index c843992ed3b..833c0518d9a 100644 --- a/htdocs/adherents/subscription/list.php +++ b/htdocs/adherents/subscription/list.php @@ -647,7 +647,7 @@ while ($i < $imaxinloop) { $subscription->fk_bank = $accountstatic->getNomUrl(1); } // Output Kanban - print $subscription->getKanbanView(''); + print $subscription->getKanbanView('', array('selected' => in_array($object->id, $arrayofselected))); if ($i == ($imaxinloop - 1)) { print '
'; print ''; diff --git a/htdocs/adherents/type.php b/htdocs/adherents/type.php index bd2b63f6f7d..ce16ba2db88 100644 --- a/htdocs/adherents/type.php +++ b/htdocs/adherents/type.php @@ -342,7 +342,7 @@ if (!$rowid && $action != 'create' && $action != 'edit') { } //output kanban $membertype->label = $objp->label; - print $membertype->getKanbanView(''); + print $membertype->getKanbanView('', array('selected' => in_array($object->id, $arrayofselected))); if ($i == ($imaxinloop - 1)) { print '
'; print ''; diff --git a/htdocs/admin/emailcollector_list.php b/htdocs/admin/emailcollector_list.php index f7cb09e50be..6c916dff3db 100644 --- a/htdocs/admin/emailcollector_list.php +++ b/htdocs/admin/emailcollector_list.php @@ -555,7 +555,7 @@ while ($i < $imaxinloop) { print '
'; } // Output Kanban - print $object->getKanbanView(''); + print $object->getKanbanView('', array('selected' => in_array($object->id, $arrayofselected))); if ($i == ($imaxinloop - 1)) { print '
'; print ''; diff --git a/htdocs/bom/bom_list.php b/htdocs/bom/bom_list.php index 043d64ecedf..e8b648d94cd 100644 --- a/htdocs/bom/bom_list.php +++ b/htdocs/bom/bom_list.php @@ -688,7 +688,7 @@ while ($i < $imaxinloop) { print '
'; } // Output kanban - print $object->getKanbanView(''); + print $object->getKanbanView('', array('selected' => in_array($object->id, $arrayofselected))); if ($i == ($imaxinloop - 1)) { print '
'; print ''; diff --git a/htdocs/bookcal/availabilities_list.php b/htdocs/bookcal/availabilities_list.php index 8fe736c4b29..1be9db2df49 100644 --- a/htdocs/bookcal/availabilities_list.php +++ b/htdocs/bookcal/availabilities_list.php @@ -641,7 +641,7 @@ while ($i < $imaxinloop) { print '
'; } // Output Kanban - print $object->getKanbanView(''); + print $object->getKanbanView('', array('selected' => in_array($object->id, $arrayofselected))); if ($i == ($imaxinloop - 1)) { print '
'; print ''; diff --git a/htdocs/bookcal/booking_list.php b/htdocs/bookcal/booking_list.php index 1c074acf7a9..4bd9dbe116f 100644 --- a/htdocs/bookcal/booking_list.php +++ b/htdocs/bookcal/booking_list.php @@ -641,7 +641,7 @@ while ($i < $imaxinloop) { print '
'; } // Output Kanban - print $object->getKanbanView(''); + print $object->getKanbanView('', array('selected' => in_array($object->id, $arrayofselected))); if ($i == ($imaxinloop - 1)) { print '
'; print ''; diff --git a/htdocs/bookmarks/list.php b/htdocs/bookmarks/list.php index 88904357ab3..a299da1c3ee 100644 --- a/htdocs/bookmarks/list.php +++ b/htdocs/bookmarks/list.php @@ -350,7 +350,7 @@ while ($i < $imaxinloop) { print '
'; } // Output Kanban - print $object->getKanbanView(''); + print $object->getKanbanView('', array('selected' => in_array($object->id, $arrayofselected))); if ($i == ($imaxinloop - 1)) { print '
'; print ''; diff --git a/htdocs/comm/propal/class/propal.class.php b/htdocs/comm/propal/class/propal.class.php index 9c826a4bb61..f49fa4974c6 100644 --- a/htdocs/comm/propal/class/propal.class.php +++ b/htdocs/comm/propal/class/propal.class.php @@ -4000,7 +4000,6 @@ class Propal extends CommonObject $return .= '
'; $return .= ''; $return .= img_picto('', $this->picto); - //$return .= ''; // Can be image $return .= ''; $return .= '
'; $return .= ''.(method_exists($this, 'getNomUrl') ? $this->getNomUrl() : $this->ref).''; diff --git a/htdocs/comm/propal/list.php b/htdocs/comm/propal/list.php index da95eb1425b..11278a3dbaa 100644 --- a/htdocs/comm/propal/list.php +++ b/htdocs/comm/propal/list.php @@ -1722,7 +1722,7 @@ if ($resql) { $userstatic->fetch($obj->fk_user_author); $objectstatic->author = $userstatic->getNomUrl(1); $objectstatic->fk_project = $projectstatic->getNomUrl(1); - print $objectstatic->getKanbanView(''); + print $objectstatic->getKanbanView('', array('selected' => in_array($object->id, $arrayofselected))); if ($i == ($imaxinloop - 1)) { print '
'; print ''; diff --git a/htdocs/commande/list.php b/htdocs/commande/list.php index 8fff0f25e86..91d556c2822 100644 --- a/htdocs/commande/list.php +++ b/htdocs/commande/list.php @@ -2002,7 +2002,7 @@ if ($resql) { print '
'; } - print $generic_commande->getKanbanView(''); + print $generic_commande->getKanbanView('', array('selected' => in_array($object->id, $arrayofselected))); if ($i == ($imaxinloop - 1)) { print '
'; diff --git a/htdocs/compta/bank/list.php b/htdocs/compta/bank/list.php index e65cff2ae2c..301838c9a46 100644 --- a/htdocs/compta/bank/list.php +++ b/htdocs/compta/bank/list.php @@ -600,7 +600,7 @@ foreach ($accounts as $key => $type) { print '
'; } // Output Kanban - print $objecttmp->getKanbanView(''); + print $objecttmp->getKanbanView('', array('selected' => in_array($object->id, $arrayofselected))); if ($i == ($imaxinloop - 1)) { print '
'; print ''; diff --git a/htdocs/compta/bank/various_payment/list.php b/htdocs/compta/bank/various_payment/list.php index df96a920f18..e0a7fb39a5e 100644 --- a/htdocs/compta/bank/various_payment/list.php +++ b/htdocs/compta/bank/various_payment/list.php @@ -639,7 +639,7 @@ while ($i < $imaxinloop) { print '
'; } // Output Kanban - print $variousstatic->getKanbanView(''); + print $variousstatic->getKanbanView('', array('selected' => in_array($object->id, $arrayofselected))); if ($i == ($imaxinloop) - 1) { print '
'; print ''; diff --git a/htdocs/compta/cashcontrol/cashcontrol_list.php b/htdocs/compta/cashcontrol/cashcontrol_list.php index 1e79b09cc37..f4b3253b783 100644 --- a/htdocs/compta/cashcontrol/cashcontrol_list.php +++ b/htdocs/compta/cashcontrol/cashcontrol_list.php @@ -578,7 +578,6 @@ while ($i < ($limit ? min($num, $limit) : $num)) { $object->year_close = $obj->year_close; $object->cheque = $obj->cheque; - print $object->getKanbanView('', array('selected' => in_array($object->id, $arrayofselected))); if ($i == (min($num, $limit) - 1)) { print '
'; diff --git a/htdocs/compta/facture/list.php b/htdocs/compta/facture/list.php index abc43c402ba..e28b40d8b35 100644 --- a/htdocs/compta/facture/list.php +++ b/htdocs/compta/facture/list.php @@ -1929,10 +1929,7 @@ if ($resql) { print '
'; } // Output Kanban - $facturestatic->socid = $companystatic->getNomUrl(1, 'company', 15); - $userstatic->fetch($obj->fk_user_author); - $facturestatic->fk_user_author = $userstatic->getNomUrl(1); - print $facturestatic->getKanbanView(''); + print $facturestatic->getKanbanView('', array('thirdparty'=>$companystatic->getNomUrl(1, 'company', 15), 'userauthor'=>$userstatic->getNomUrl(1), 'selected' => in_array($object->id, $arrayofselected))); if ($i == ($imaxinloop - 1)) { print '
'; print ''; diff --git a/htdocs/compta/localtax/list.php b/htdocs/compta/localtax/list.php index dbd3bdafdbf..d97dd6cc709 100644 --- a/htdocs/compta/localtax/list.php +++ b/htdocs/compta/localtax/list.php @@ -104,7 +104,7 @@ if ($result) { print '
'; } // Output Kanban - print $localtax_static->getKanbanView(''); + print $localtax_static->getKanbanView('', array('selected' => in_array($object->id, $arrayofselected))); if ($i == ($imaxinloop - 1)) { print '
'; print ''; diff --git a/htdocs/compta/paiement/cheque/list.php b/htdocs/compta/paiement/cheque/list.php index 08c6096706a..04f2d325aba 100644 --- a/htdocs/compta/paiement/cheque/list.php +++ b/htdocs/compta/paiement/cheque/list.php @@ -262,7 +262,7 @@ if ($resql) { print '
'; } // Output Kanban - print $checkdepositstatic->getKanbanView(''); + print $checkdepositstatic->getKanbanView('', array('selected' => in_array($checkdepositstatic->id, $arrayofselected))); if ($i == ($imaxinloop - 1)) { print '
'; print ''; diff --git a/htdocs/compta/prelevement/list.php b/htdocs/compta/prelevement/list.php index e258fbe1e09..893a71fad3f 100644 --- a/htdocs/compta/prelevement/list.php +++ b/htdocs/compta/prelevement/list.php @@ -286,7 +286,7 @@ if ($result) { print '
'; } // Output Kanban - print $bon->getKanbanView(''); + print $bon->getKanbanView('', array('selected' => in_array($bon->id, $arrayofselected))); if ($i == ($imaxinloop - 1)) { print '
'; print ''; diff --git a/htdocs/compta/prelevement/orders_list.php b/htdocs/compta/prelevement/orders_list.php index 3b5325d2b30..699dcf587ff 100644 --- a/htdocs/compta/prelevement/orders_list.php +++ b/htdocs/compta/prelevement/orders_list.php @@ -239,7 +239,7 @@ if ($result) { print '
'; } // Output Kanban - print $directdebitorder->getKanbanView(''); + print $directdebitorder->getKanbanView('', array('selected' => in_array($obj->id, $arrayofselected))); if ($i == (min($num, $limit) - 1)) { print '
'; print ''; diff --git a/htdocs/compta/sociales/list.php b/htdocs/compta/sociales/list.php index ad552adacc3..ea415784943 100644 --- a/htdocs/compta/sociales/list.php +++ b/htdocs/compta/sociales/list.php @@ -640,8 +640,7 @@ while ($i < $imaxinloop) { print '
'; } // Output Kanban - $chargesociale_static->fk_project = $projectstatic->getNomUrl(); - print $chargesociale_static->getKanbanView('', array('selected' => in_array($chargesociale_static->id, $arrayofselected))); + print $chargesociale_static->getKanbanView('', array('projectlink'=> $projectstatic->getNomUrl(1), 'selected' => in_array($chargesociale_static->id, $arrayofselected))); if ($i == ($imaxinloop - 1)) { print '
'; print ''; diff --git a/htdocs/compta/tva/list.php b/htdocs/compta/tva/list.php index bf0c7bbc6e3..22ac6310efc 100644 --- a/htdocs/compta/tva/list.php +++ b/htdocs/compta/tva/list.php @@ -599,7 +599,7 @@ while ($i < $imaxinloop) { $selected = 1; } } - print $object->getKanbanView(''); + print $object->getKanbanView('', array('selected' => in_array($object->id, $arrayofselected))); if ($i == ($imaxinloop - 1)) { print '
'; print ''; diff --git a/htdocs/contact/list.php b/htdocs/contact/list.php index 426eb756ec7..2d64c5b8921 100644 --- a/htdocs/contact/list.php +++ b/htdocs/contact/list.php @@ -1308,7 +1308,7 @@ while ($i < $imaxinloop) { if ($obj->socid > 0) { $contactstatic->fetch_thirdparty($obj->socid); } - print $contactstatic->getKanbanView(''); + print $contactstatic->getKanbanView('', array('selected' => in_array($contactstatic->id, $arrayofselected))); if ($i == ($imaxinloop - 1)) { print '
'; print ''; diff --git a/htdocs/contrat/class/contrat.class.php b/htdocs/contrat/class/contrat.class.php index 9a8339e862f..27a28b3f1dc 100644 --- a/htdocs/contrat/class/contrat.class.php +++ b/htdocs/contrat/class/contrat.class.php @@ -2854,7 +2854,6 @@ class Contrat extends CommonObject $return .= '
'; $return .= ''; $return .= img_picto('', $this->picto); - //$return .= ''; // Can be image $return .= ''; $return .= '
'; $return .= ''.(method_exists($this, 'getNomUrl') ? $this->getNomUrl() : $this->ref).''; diff --git a/htdocs/contrat/list.php b/htdocs/contrat/list.php index e8a259b2989..d3ab453b484 100644 --- a/htdocs/contrat/list.php +++ b/htdocs/contrat/list.php @@ -995,6 +995,7 @@ while ($i < $imaxinloop) { } // Output Kanban $arraydata['thirdparty'] = $socstatic; + $arraydata['selected'] = in_array($obj->rowid, $arrayofselected); $contracttmp->date_contrat = $obj->date_contrat; print $contracttmp->getKanbanView('', $arraydata); if ($i == ($imaxinloop - 1)) { diff --git a/htdocs/core/class/timespent.class.php b/htdocs/core/class/timespent.class.php index 0f91b53e26a..840cb49d359 100755 --- a/htdocs/core/class/timespent.class.php +++ b/htdocs/core/class/timespent.class.php @@ -856,6 +856,9 @@ class TimeSpent extends CommonObject public function getKanbanView($option = '', $arraydata = null) { global $conf, $langs; + + //$selected = (empty($arraydata['selected']) ? 0 : $arraydata['selected']); + $return = '
'; $return .= '
'; $return .= ''; @@ -863,6 +866,8 @@ class TimeSpent extends CommonObject $return .= ''; $return .= '
'; $return .= ''.(method_exists($this, 'getNomUrl') ? $this->getNomUrl() : $this->ref).''; + //$return .= ''; + if (property_exists($this, 'label')) { $return .= '
'.$this->label.'
'; } diff --git a/htdocs/don/list.php b/htdocs/don/list.php index a2f81fe093e..df950a5e349 100644 --- a/htdocs/don/list.php +++ b/htdocs/don/list.php @@ -314,7 +314,7 @@ if ($resql) { $donationstatic->societe = $objp->societe; } - print $donationstatic->getKanbanView(''); + print $donationstatic->getKanbanView('', array('selected' => in_array($donationstatic->id, $arrayofselected))); if ($i == ($imaxinloop - 1)) { print '
'; print ''; diff --git a/htdocs/eventorganization/conferenceorbooth_list.php b/htdocs/eventorganization/conferenceorbooth_list.php index b65b11639ab..d764f006264 100644 --- a/htdocs/eventorganization/conferenceorbooth_list.php +++ b/htdocs/eventorganization/conferenceorbooth_list.php @@ -901,7 +901,7 @@ while ($i < $imaxinloop) { $selected = 1; } } - print $object->getKanbanView(''); + print $object->getKanbanView('', array('selected' => in_array($object->id, $arrayofselected))); if ($i == ($imaxinloop - 1)) { print '
'; print ''; diff --git a/htdocs/eventorganization/conferenceorboothattendee_list.php b/htdocs/eventorganization/conferenceorboothattendee_list.php index 9a66fdb3a61..0a67866ce62 100644 --- a/htdocs/eventorganization/conferenceorboothattendee_list.php +++ b/htdocs/eventorganization/conferenceorboothattendee_list.php @@ -948,7 +948,7 @@ while ($i < $imaxinloop) { $selected = 1; } } - print $object->getKanbanView(''); + print $object->getKanbanView('', array('selected' => in_array($object->id, $arrayofselected))); if ($i == ($imaxinloop - 1)) { print '
'; print ''; diff --git a/htdocs/expedition/list.php b/htdocs/expedition/list.php index 2bd8e44522f..76651b5cff4 100644 --- a/htdocs/expedition/list.php +++ b/htdocs/expedition/list.php @@ -905,10 +905,9 @@ while ($i < min($num, $limit)) { print ''; print '
'; } - $object->socid = $companystatic->getNomUrl(1); $object->date_delivery = $obj->delivery_date; $object->town = $obj->town; - print $object->getKanbanView(''); + print $object->getKanbanView('', array('thirdparty' => $companystatic->getNomUrl(1), 'selected' => in_array($obj->id, $arrayofselected))); if ($i == min($num, $limit) - 1) { print '
'; print ''; diff --git a/htdocs/expensereport/list.php b/htdocs/expensereport/list.php index 96437f3c855..bb188c3fafc 100644 --- a/htdocs/expensereport/list.php +++ b/htdocs/expensereport/list.php @@ -754,14 +754,14 @@ if ($resql) { print ''; print '
'; } + // TODO Use a cache on user $usertmp->fetch($obj->id_user); - $expensereportstatic->fk_user_author = $usertmp->getNomUrl(1); // Output Kanban if ($massactionbutton || $massaction) { $selected = 0; - print $expensereportstatic->getKanbanView(''); + print $expensereportstatic->getKanbanView('', array('userauthor' => $usertmp->getNomUrl(1), 'selected' => in_array($expensereportstatic->id, $arrayofselected))); } if ($i == ($imaxinloop - 1)) { print '
'; diff --git a/htdocs/expensereport/payment/list.php b/htdocs/expensereport/payment/list.php index a0e45c65e8b..426d5268d92 100644 --- a/htdocs/expensereport/payment/list.php +++ b/htdocs/expensereport/payment/list.php @@ -504,7 +504,7 @@ while ($i < $imaxinloop) { print '
'; } // Output Kanban - print $paymentexpensereportstatic->getKanbanView(''); + print $paymentexpensereportstatic->getKanbanView('', array('selected' => in_array($objp->id, $arrayofselected))); if ($i == ($imaxinloop - 1)) { print '
'; print ''; diff --git a/htdocs/fichinter/class/fichinter.class.php b/htdocs/fichinter/class/fichinter.class.php index 130ac03c758..c01ad5f2eec 100644 --- a/htdocs/fichinter/class/fichinter.class.php +++ b/htdocs/fichinter/class/fichinter.class.php @@ -1496,7 +1496,6 @@ class Fichinter extends CommonObject $return .= '
'; $return .= ''; $return .= img_picto('', $this->picto); - //$return .= ''; // Can be image $return .= ''; $return .= '
'; $return .= ''.(method_exists($this, 'getNomUrl') ? $this->getNomUrl() : $this->ref).''; diff --git a/htdocs/fourn/class/fournisseur.commande.class.php b/htdocs/fourn/class/fournisseur.commande.class.php index 51946f6f278..be0d27f83f4 100644 --- a/htdocs/fourn/class/fournisseur.commande.class.php +++ b/htdocs/fourn/class/fournisseur.commande.class.php @@ -3652,7 +3652,6 @@ class CommandeFournisseur extends CommonOrder $return .= '
'; $return .= ''; $return .= img_picto('', $this->picto); - //$return .= ''; // Can be image $return .= ''; $return .= '
'; $return .= ''.(method_exists($this, 'getNomUrl') ? $this->getNomUrl() : $this->ref).''; diff --git a/htdocs/fourn/commande/list.php b/htdocs/fourn/commande/list.php index 0f981d464e4..776c1e62fe2 100644 --- a/htdocs/fourn/commande/list.php +++ b/htdocs/fourn/commande/list.php @@ -1694,7 +1694,7 @@ if ($resql) { $thirdpartytmp->fournisseur = $obj->fournisseur; $objectstatic->socid = $thirdpartytmp->getNomUrl('supplier', 0, 0, -1); // Output Kanban - print $objectstatic->getKanbanView(''); + print $objectstatic->getKanbanView('', array('selected' => in_array($objectstatic->id, $arrayofselected))); if ($i == ($imaxinloop - 1)) { print '
'; print ''; diff --git a/htdocs/holiday/list.php b/htdocs/holiday/list.php index 6a810880501..4ce0476f90f 100644 --- a/htdocs/holiday/list.php +++ b/htdocs/holiday/list.php @@ -895,7 +895,7 @@ if ($id && empty($user->rights->holiday->readall) && !in_array($id, $childids)) $labeltypeleavetoshow = ($langs->trans($typeleaves[$obj->fk_type]['code']) != $typeleaves[$obj->fk_type]['code'] ? $langs->trans($typeleaves[$obj->fk_type]['code']) : $typeleaves[$obj->fk_type]['label']); } - $arraydata = array('user'=>$userstatic, 'labeltype'=>$labeltypeleavetoshow); + $arraydata = array('user'=>$userstatic, 'labeltype'=>$labeltypeleavetoshow, 'selected'=>$selected); } print $holidaystatic->getKanbanView('', $arraydata); if ($i == ($imaxinloop - 1)) { diff --git a/htdocs/hrm/evaluation_list.php b/htdocs/hrm/evaluation_list.php index 9e911f7bc19..6055d3153cd 100644 --- a/htdocs/hrm/evaluation_list.php +++ b/htdocs/hrm/evaluation_list.php @@ -585,20 +585,20 @@ while ($i < $imaxinloop) { // Output Kanban $object->date_eval = $obj->date_eval; + // TODO Use a cache on job $job = new job($db); $job->fetch($obj->fk_job); - $object->fk_job = $job->getNomUrl(); + // TODO Use a cache on user $userstatic = new User($db); $userstatic->fetch($obj->fk_user); - $object->fk_user = $userstatic->getNomUrl(1); if ($massactionbutton || $massaction) { // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined $selected = 0; if (in_array($object->id, $arrayofselected)) { $selected = 1; } - print $object->getKanbanView(''); + print $object->getKanbanView('', array('user'=>$userstatic->getNomUrl(1), 'job'=>$job->getNomUrl(1), 'selected' => in_array($object->id, $arrayofselected))); } if ($i == ($imaxinloop - 1)) { print '
'; diff --git a/htdocs/hrm/job_list.php b/htdocs/hrm/job_list.php index da67eb18729..675f2c77cf2 100644 --- a/htdocs/hrm/job_list.php +++ b/htdocs/hrm/job_list.php @@ -609,7 +609,7 @@ while ($i < $imaxinloop) { print '
'; } // Output Kanban - print $object->getKanbanView(''); + print $object->getKanbanView('', array('selected' => in_array($object->id, $arrayofselected))); if ($i == ($imaxinloop - 1)) { print '
'; print ''; diff --git a/htdocs/hrm/position_list.php b/htdocs/hrm/position_list.php index 7892bbd5952..866645a9571 100644 --- a/htdocs/hrm/position_list.php +++ b/htdocs/hrm/position_list.php @@ -629,14 +629,13 @@ while ($i < $imaxinloop) { $userstatic->email = $obj->email; $userstatic->statut = $obj->statut; - $object->fk_user = $userstatic->getNomUrl(1); // output kanban if ($massactionbutton || $massaction) { // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined $selected = 0; if (in_array($object->id, $arrayofselected)) { $selected = 1; } - print $object->getKanbanView(''); + print $object->getKanbanView('', array('user' => $userstatic->getNomUrl(1), 'selected' => in_array($object->id, $arrayofselected))); } if ($i == ($imaxinloop - 1)) { print '
'; diff --git a/htdocs/hrm/skill_list.php b/htdocs/hrm/skill_list.php index 28685480acb..7d6042c9ca2 100644 --- a/htdocs/hrm/skill_list.php +++ b/htdocs/hrm/skill_list.php @@ -628,7 +628,7 @@ while ($i < $imaxinloop) { $selected = 1; } } - print $object->getKanbanView(''); + print $object->getKanbanView('', array('selected' => in_array($obj->id, $arrayofselected))); if ($i == ($imaxinloop - 1)) { print '
'; print ''; diff --git a/htdocs/knowledgemanagement/class/knowledgerecord.class.php b/htdocs/knowledgemanagement/class/knowledgerecord.class.php index 08df6d37f0f..7ae4ba4ce1b 100644 --- a/htdocs/knowledgemanagement/class/knowledgerecord.class.php +++ b/htdocs/knowledgemanagement/class/knowledgerecord.class.php @@ -1127,8 +1127,6 @@ class KnowledgeRecord extends CommonObject */ public function getKanbanView($option = '', $arraydata = null) { - global $langs; - $selected = (empty($arraydata['selected']) ? 0 : $arraydata['selected']); $return = '
'; diff --git a/htdocs/knowledgemanagement/knowledgerecord_list.php b/htdocs/knowledgemanagement/knowledgerecord_list.php index 75abceb309b..f81f842bea8 100644 --- a/htdocs/knowledgemanagement/knowledgerecord_list.php +++ b/htdocs/knowledgemanagement/knowledgerecord_list.php @@ -667,7 +667,7 @@ while ($i < $imaxinloop) { print '
'; } // Output Kanban - print $object->getKanbanView(''); + print $object->getKanbanView('', array('selected' => in_array($object->id, $arrayofselected))); if ($i == ($imaxinloop - 1)) { print '
'; print ''; diff --git a/htdocs/loan/class/loan.class.php b/htdocs/loan/class/loan.class.php index 5b807779634..cd70c383c59 100644 --- a/htdocs/loan/class/loan.class.php +++ b/htdocs/loan/class/loan.class.php @@ -728,9 +728,10 @@ class Loan extends CommonObject * Return clicable link of object (with eventually picto) * * @param string $option Where point the link (0=> main card, 1,2 => shipment, 'nolink'=>No link) + * @param array $arraydata Array of data * @return string HTML Code for Kanban thumb. */ - public function getKanbanView($option = '') + public function getKanbanView($option = '', $arraydata = null) { global $langs; diff --git a/htdocs/loan/list.php b/htdocs/loan/list.php index 44329cc7daa..a6d28396c8b 100644 --- a/htdocs/loan/list.php +++ b/htdocs/loan/list.php @@ -294,7 +294,7 @@ if ($resql) { $loan_static->capital = $obj->capital; $loan_static->totalpaid = $obj->paid; - print $loan_static->getKanbanView(''); + print $loan_static->getKanbanView('', array('selected' => in_array($loan_static->id, $arrayofselected))); if ($i == ($imaxinloop - 1)) { print '
'; print ''; diff --git a/htdocs/modulebuilder/template/myobject_list.php b/htdocs/modulebuilder/template/myobject_list.php index 02c5a1b33bb..bb97a4c1c09 100644 --- a/htdocs/modulebuilder/template/myobject_list.php +++ b/htdocs/modulebuilder/template/myobject_list.php @@ -708,7 +708,7 @@ while ($i < $imaxinloop) { $selected = 1; } } - print $object->getKanbanView(''); + print $object->getKanbanView('', array('selected' => in_array($object->id, $arrayofselected))); if ($i == ($imaxinloop - 1)) { print '
'; print ''; diff --git a/htdocs/mrp/mo_list.php b/htdocs/mrp/mo_list.php index aadb4a3a7b1..5f94232d374 100644 --- a/htdocs/mrp/mo_list.php +++ b/htdocs/mrp/mo_list.php @@ -613,13 +613,12 @@ while ($i < $imaxinloop) { print '
'; } $object->id = $obj->type_id; - $bom->id = $obj->fk_bom; + + // TODO Use a cache on BOM $objectBom = $bom->fetch($obj->fk_bom); - //var_dump($bom);exit; - $object->fk_bom = $bom->getNomUrl(); // Output Kanban - print $object->getKanbanView(''); + print $object->getKanbanView('', array('bom'=>$objectBom->getNomUrl(1), 'selected' => in_array($object->id, $arrayofselected))); if ($i == ($imaxinloop - 1)) { print '
'; print ''; diff --git a/htdocs/partnership/partnership_list.php b/htdocs/partnership/partnership_list.php index a57211cff06..01dbe7c399a 100644 --- a/htdocs/partnership/partnership_list.php +++ b/htdocs/partnership/partnership_list.php @@ -869,7 +869,7 @@ while ($i < $imaxinloop) { print '
'; } // Output Kanban - print $object->getKanbanView(''); + print $object->getKanbanView('', array('selected' => in_array($object->id, $arrayofselected))); if ($i == ($imaxinloop - 1)) { print '
'; print ''; diff --git a/htdocs/product/inventory/list.php b/htdocs/product/inventory/list.php index 217d6b76141..3d07b00446e 100644 --- a/htdocs/product/inventory/list.php +++ b/htdocs/product/inventory/list.php @@ -654,7 +654,7 @@ while ($i < $imaxinloop) { $selected = 1; } } - print $object->getKanbanView(''); + print $object->getKanbanView('', array('selected' => in_array($object->id, $arrayofselected))); if ($i == ($imaxinloop - 1)) { print '
'; print ''; diff --git a/htdocs/product/list.php b/htdocs/product/list.php index 338b1420842..1cb3385b2ed 100644 --- a/htdocs/product/list.php +++ b/htdocs/product/list.php @@ -1457,8 +1457,9 @@ while ($i < $imaxinloop) { print '
'; } $product_static->price = $obj->price; + // Output Kanban - print $product_static->getKanbanView(''); + print $product_static->getKanbanView('', array('selected' => in_array($product_static->id, $arrayofselected))); if ($i == ($imaxinloop - 1)) { print '
'; print ''; diff --git a/htdocs/product/stock/list.php b/htdocs/product/stock/list.php index 5c113eeca45..03e718b2c0b 100644 --- a/htdocs/product/stock/list.php +++ b/htdocs/product/stock/list.php @@ -638,7 +638,7 @@ while ($i < $imaxinloop) { print '
'; } // Output Kanban - print $warehouse->getKanbanView(''); + print $warehouse->getKanbanView('', array('selected' => in_array($warehouse->id, $arrayofselected))); if ($i == ($imaxinloop - 1)) { print '
'; diff --git a/htdocs/product/stock/movement_list.php b/htdocs/product/stock/movement_list.php index 25c16ba7394..92bf74fa104 100644 --- a/htdocs/product/stock/movement_list.php +++ b/htdocs/product/stock/movement_list.php @@ -1405,7 +1405,7 @@ while ($i < $imaxinloop) { $selected = 1; } } - print $object->getKanbanView(''); + print $object->getKanbanView('', array('selected' => in_array($warehousestatic->id, $arrayofselected))); if ($i == ($imaxinloop - 1)) { print ''; print ''; diff --git a/htdocs/projet/class/project.class.php b/htdocs/projet/class/project.class.php index c3ef972d52c..6f36b03f5b4 100644 --- a/htdocs/projet/class/project.class.php +++ b/htdocs/projet/class/project.class.php @@ -2386,18 +2386,19 @@ class Project extends CommonObject * Return clicable link of object (with eventually picto) * * @param string $option Where point the link (0=> main card, 1,2 => shipment, 'nolink'=>No link) + * @param array $arraydata Array of data * @return string HTML Code for Kanban thumb. */ - public function getKanbanView($option = '') + public function getKanbanView($option = '', $arraydata = null) { - global $langs, $user; + global $langs; $selected = (empty($arraydata['selected']) ? 0 : $arraydata['selected']); $return = '
'; $return .= '
'; $return .= ''; - $return .= img_picto('', $this->picto); + $return .= img_picto('', $this->public ? 'projectpub' : $this->picto); //$return .= ''; // Can be image $return .= ''; $return .= '
'; @@ -2407,6 +2408,8 @@ class Project extends CommonObject } $return .= ''; $return .= ''; + // Date + /* if (property_exists($this, 'date_start') && $this->date_start) { $return .= '
'.dol_print_date($this->date_start, 'day').''; } @@ -2416,7 +2419,10 @@ class Project extends CommonObject } else { $return .= '
'; } - $return .= ''.dol_print_date($this->date_end, 'day').''; + $return .= ''.dol_print_date($this->date_end, 'day').''; + }*/ + if (!empty($arraydata['assignedusers'])) { + $return .= '
'.$arraydata['assignedusers'].''; } /*if (property_exists($this, 'user_author_id')) { $return .= '
'.$langs->trans("Author").''; @@ -2424,12 +2430,12 @@ class Project extends CommonObject }*/ if ($this->usage_opportunity && $this->opp_status_code) { //$return .= '
'.$langs->trans("OpportunityStatusShort").''; - $return .= '
'. $langs->trans("OppStatus".$this->opp_status_code); - $return .= ' ('.round($this->opp_percent).'%)'; - $return .= '
'.price($this->opp_amount).''; + $return .= '
'.$langs->trans("OppStatus".$this->opp_status_code).''; + $return .= ' ('.round($this->opp_percent).'%)'; + $return .= '
'.price($this->opp_amount).''; } if (method_exists($this, 'getLibStatut')) { - $return .= '
'.$this->getLibStatut(3).'
'; + $return .= '
'.$this->getLibStatut(3).'
'; } $return .= '
'; $return .= '
'; diff --git a/htdocs/projet/class/task.class.php b/htdocs/projet/class/task.class.php index 65de5cf22c3..84383e63b14 100644 --- a/htdocs/projet/class/task.class.php +++ b/htdocs/projet/class/task.class.php @@ -2359,8 +2359,6 @@ class Task extends CommonObjectLine */ public function getKanbanView($option = '', $arraydata = null) { - global $langs, $conf; - $selected = (empty($arraydata['selected']) ? 0 : $arraydata['selected']); $return = '
'; diff --git a/htdocs/projet/list.php b/htdocs/projet/list.php index 64cc1bf6327..a4a39f0c2f4 100644 --- a/htdocs/projet/list.php +++ b/htdocs/projet/list.php @@ -1421,19 +1421,54 @@ while ($i < $imaxinloop) { //$userAccess = $object->restrictedProjectArea($user); // disabled, permission on project must be done by the select - //if ($userAccess >= 0) { - // Thirdparty - $companystatic->id = $obj->socid; - $companystatic->name = $obj->name; - $companystatic->name_alias = $obj->alias; - $companystatic->client = $obj->client; - $companystatic->code_client = $obj->code_client; - $companystatic->email = $obj->email; - $companystatic->phone = $obj->phone; - $companystatic->address = $obj->address; - $companystatic->zip = $obj->zip; - $companystatic->town = $obj->town; - $companystatic->country_code = $obj->country_code; + + // Thirdparty + $companystatic->id = $obj->socid; + $companystatic->name = $obj->name; + $companystatic->name_alias = $obj->alias; + $companystatic->client = $obj->client; + $companystatic->code_client = $obj->code_client; + $companystatic->email = $obj->email; + $companystatic->phone = $obj->phone; + $companystatic->address = $obj->address; + $companystatic->zip = $obj->zip; + $companystatic->town = $obj->town; + $companystatic->country_code = $obj->country_code; + + $stringassignedusers = ''; + + if (!empty($arrayfields['c.assigned']['checked'])) { + $ifisrt = 1; + foreach (array('internal', 'external') as $source) { + $tab = $object->liste_contact(-1, $source, 0, '', 1); + $numcontact = count($tab); + if (!empty($numcontact)) { + foreach ($tab as $contactproject) { + //var_dump($contacttask); + if ($source == 'internal') { + $c = new User($db); + } else { + $c = new Contact($db); + } + $c->fetch($contactproject['id']); + if (!empty($c->photo)) { + if (get_class($c) == 'User') { + $stringassignedusers .= $c->getNomUrl(-2, '', 0, 0, 24, 1, '', ($ifisrt ? '' : 'notfirst')); + } else { + $stringassignedusers .= $c->getNomUrl(-2, '', 0, '', -1, 0, ($ifisrt ? '' : 'notfirst')); + } + } else { + if (get_class($c) == 'User') { + $stringassignedusers .= $c->getNomUrl(2, '', 0, 0, 24, 1, '', ($ifisrt ? '' : 'notfirst')); + } else { + $stringassignedusers .= $c->getNomUrl(2, '', 0, '', -1, 0, ($ifisrt ? '' : 'notfirst')); + } + } + $ifisrt = 0; + } + } + } + } if ($mode == 'kanban') { if ($i == 0) { @@ -1441,7 +1476,10 @@ while ($i < $imaxinloop) { print '
'; } - print $object->getKanbanView(''); + $selected = in_array($object->id, $arrayofselected); + $arrayofdata = array('assignedusers' => $stringassignedusers, 'selected' => $selected); + + print $object->getKanbanView('', $arrayofdata); if ($i == ($imaxinloop - 1)) { print '
'; @@ -1592,39 +1630,10 @@ while ($i < $imaxinloop) { $totalarray['nbfield']++; } } - // Contacts of project + // Assigned contacts of project if (!empty($arrayfields['c.assigned']['checked'])) { print ''; - $ifisrt = 1; - foreach (array('internal', 'external') as $source) { - $tab = $object->liste_contact(-1, $source, 0, '', 1); - $numcontact = count($tab); - if (!empty($numcontact)) { - foreach ($tab as $contactproject) { - //var_dump($contacttask); - if ($source == 'internal') { - $c = new User($db); - } else { - $c = new Contact($db); - } - $c->fetch($contactproject['id']); - if (!empty($c->photo)) { - if (get_class($c) == 'User') { - print $c->getNomUrl(-2, '', 0, 0, 24, 1, '', ($ifisrt ? '' : 'notfirst')); - } else { - print $c->getNomUrl(-2, '', 0, '', -1, 0, ($ifisrt ? '' : 'notfirst')); - } - } else { - if (get_class($c) == 'User') { - print $c->getNomUrl(2, '', 0, 0, 24, 1, '', ($ifisrt ? '' : 'notfirst')); - } else { - print $c->getNomUrl(2, '', 0, '', -1, 0, ($ifisrt ? '' : 'notfirst')); - } - } - $ifisrt = 0; - } - } - } + print $stringassignedusers; print ''; if (!$i) { $totalarray['nbfield']++; diff --git a/htdocs/projet/tasks/list.php b/htdocs/projet/tasks/list.php index e54d35bdf96..b0e080a6607 100644 --- a/htdocs/projet/tasks/list.php +++ b/htdocs/projet/tasks/list.php @@ -1168,6 +1168,8 @@ while ($i < $imaxinloop) { $arraydata = array(); $arraydata['projectlink'] = $projectstatic->getNomUrl(1); + $arraydata['selected'] = in_array($object->id, $arrayofselected); + print $object->getKanbanView('', $arraydata); if ($i == ($imaxinloop - 1)) { print '
'; diff --git a/htdocs/recruitment/class/recruitmentjobposition.class.php b/htdocs/recruitment/class/recruitmentjobposition.class.php index d44294ac9bd..065d56d8857 100644 --- a/htdocs/recruitment/class/recruitmentjobposition.class.php +++ b/htdocs/recruitment/class/recruitmentjobposition.class.php @@ -1116,7 +1116,7 @@ class RecruitmentJobPosition extends CommonObject */ public function getKanbanView($option = '', $arraydata = null) { - global $langs, $obj; + global $langs; $selected = (empty($arraydata['selected']) ? 0 : $arraydata['selected']); @@ -1138,7 +1138,9 @@ class RecruitmentJobPosition extends CommonObject $return .= ' | '.$langs->trans("Remuneration").' : '.$this->remuneration_suggested.''; } if (method_exists($this, 'getLibStatut')) { - $return .= '
'.$this->getLibStatut(3).' | '.$langs->trans("RecruitmentCandidatures", '', '', '', '', 5).' : '.$obj->nbapplications.'
'; + $return .= '
'.$this->getLibStatut(3).' | '.$langs->trans("RecruitmentCandidatures", '', '', '', '', 5).' : '; + $return .= $arraydata['nbapplications']; + $return .= '
'; } $return .= '
'; $return .= ''; diff --git a/htdocs/recruitment/recruitmentcandidature_list.php b/htdocs/recruitment/recruitmentcandidature_list.php index 8e564c23ee3..a878aab0c22 100644 --- a/htdocs/recruitment/recruitmentcandidature_list.php +++ b/htdocs/recruitment/recruitmentcandidature_list.php @@ -747,15 +747,16 @@ while ($i < $imaxinloop) { print ''; print '
'; } - $recuitment = new RecruitmentJobPosition($db); - $recuitment->fetch($obj->fk_recruitmentjobposition); - $object->fk_recruitmentjobposition = $recuitment->getNomUrl(); + // TODO Use a cache for $recruitment + $recruitment = new RecruitmentJobPosition($db); + $recruitment->fetch($obj->fk_recruitmentjobposition); + $object->phone = $obj->phone; if ($massactionbutton || $massaction) { $selected = 0; } // Output Kanban - print $object->getKanbanView(''); + print $object->getKanbanView('', array('jobpositionlink'=>$recruitment->getNomUrl(1), 'selected' => in_array($object->id, $arrayofselected))); if ($i == ($imaxinloop - 1)) { print '
'; print ''; diff --git a/htdocs/recruitment/recruitmentjobposition_list.php b/htdocs/recruitment/recruitmentjobposition_list.php index 5757e0d9c67..5a759250ae6 100644 --- a/htdocs/recruitment/recruitmentjobposition_list.php +++ b/htdocs/recruitment/recruitmentjobposition_list.php @@ -597,7 +597,7 @@ while ($i < $imaxinloop) { $selected = 0; } // Output Kanban - print $object->getKanbanView(''); + print $object->getKanbanView('', array('nbapplications'=>$obj->nbapplications, 'selected' => in_array($object->id, $arrayofselected))); if ($i == ($imaxinloop - 1)) { print ''; print ''; diff --git a/htdocs/salaries/list.php b/htdocs/salaries/list.php index 3dbdb75e803..5a908a4d58e 100644 --- a/htdocs/salaries/list.php +++ b/htdocs/salaries/list.php @@ -663,7 +663,7 @@ while ($i < $imaxinloop) { $selected = 1; } } - print $salstatic->getKanbanView('', array('user' => $userstatic)); + print $salstatic->getKanbanView('', array('user' => $userstatic, 'selected' => $selected)); if ($i == ($imaxinloop - 1)) { print ''; print ''; diff --git a/htdocs/salaries/payments.php b/htdocs/salaries/payments.php index d1acd5849d3..710a7b88c35 100644 --- a/htdocs/salaries/payments.php +++ b/htdocs/salaries/payments.php @@ -574,7 +574,7 @@ while ($i < $imaxinloop) { print '
'; } // Output Kanban - print $paymentsalstatic->getKanbanView(''); + print $paymentsalstatic->getKanbanView('', array('selected' => in_array($object->id, $arrayofselected))); if ($i == ($imaxinloop - 1)) { print '
'; print ''; diff --git a/htdocs/societe/list.php b/htdocs/societe/list.php index c143dd6cbfb..d0f20cd5296 100644 --- a/htdocs/societe/list.php +++ b/htdocs/societe/list.php @@ -1564,7 +1564,7 @@ while ($i < $imaxinloop) { print '
'; } // Output Kanban - print $companystatic->getKanbanView(''); + print $companystatic->getKanbanView('', array('selected' => in_array($obj->rowid, $arrayofselected))); if ($i == ($imaxinloop - 1)) { print '
'; print ''; diff --git a/htdocs/supplier_proposal/list.php b/htdocs/supplier_proposal/list.php index 9498674956f..91a28a6110a 100644 --- a/htdocs/supplier_proposal/list.php +++ b/htdocs/supplier_proposal/list.php @@ -989,11 +989,10 @@ if ($resql) { print '
'; } // Output Kanban + // TODO Use a cahe on user $userstatic->fetch($obj->fk_user_author); - $objectstatic->socid = $companystatic->getNomUrl(1); - $objectstatic->user_author_id = $userstatic->getNomUrl(1); $objectstatic->delivery_date = $obj->dp; - print $objectstatic->getKanbanView(''); + print $objectstatic->getKanbanView('', array('thirdparty'=>$companystatic, 'userauthor'=>$userstatic, 'selected' => in_array($obj->id, $arrayofselected))); if ($i == ($imaxinloop - 1)) { print '
'; print ''; diff --git a/htdocs/ticket/list.php b/htdocs/ticket/list.php index cfaf0d6ff51..e986a09b0fe 100644 --- a/htdocs/ticket/list.php +++ b/htdocs/ticket/list.php @@ -1016,13 +1016,16 @@ while ($i < $imaxinloop) { } // get infos needed from object - $data = array(); + // TODO Create a cache on users + $arraydata = array(); if ($obj->fk_user_assign > 0) { $user_temp->fetch($obj->fk_user_assign); - $data['user_assignment'] = $user_temp->getNomUrl(-3); + $arraydata['user_assignment'] = $user_temp->getNomUrl(-3); } + $arraydata['selected'] = in_array($object->id, $arrayofselected); + // Output Kanban - print $object->getKanbanView('', $data); + print $object->getKanbanView('', $arraydata); if ($i == ($imaxinloop - 1)) { print ''; print ''; diff --git a/htdocs/user/group/list.php b/htdocs/user/group/list.php index 85df729d00f..532602ca617 100644 --- a/htdocs/user/group/list.php +++ b/htdocs/user/group/list.php @@ -415,7 +415,7 @@ while ($i < $imaxinloop) { $selected = 1; } } - print $object->getKanbanView(''); + print $object->getKanbanView('', array('selected' => in_array($object->id, $arrayofselected))); if ($i == ($imaxinloop - 1)) { print ''; print ''; diff --git a/htdocs/user/list.php b/htdocs/user/list.php index 39b72c958a1..becf136c127 100644 --- a/htdocs/user/list.php +++ b/htdocs/user/list.php @@ -1014,7 +1014,7 @@ while ($i < $imaxinloop) { } // Output Kanban - print $object->getKanbanView(''); + print $object->getKanbanView('', array('selected' => in_array($object->id, $arrayofselected))); if ($i == ($imaxinloop - 1)) { print ''; print ''; diff --git a/htdocs/variants/list.php b/htdocs/variants/list.php index a9ec17b65a4..47a2087e3bf 100644 --- a/htdocs/variants/list.php +++ b/htdocs/variants/list.php @@ -677,7 +677,7 @@ while ($i < $imaxinloop) { $selected = 1; } } - print $object->getKanbanView(''); + print $object->getKanbanView('', array('selected' => in_array($object->id, $arrayofselected))); if ($i == ($imaxinloop - 1)) { print ''; print ''; diff --git a/htdocs/webhook/target_list.php b/htdocs/webhook/target_list.php index a6b590b55d5..029a194269f 100644 --- a/htdocs/webhook/target_list.php +++ b/htdocs/webhook/target_list.php @@ -638,7 +638,7 @@ while ($i < $imaxinloop) { print '
'; } // Output Kanban - print $object->getKanbanView(''); + print $object->getKanbanView('', array('selected' => in_array($object->id, $arrayofselected))); if ($i == ($imaxinloop - 1)) { print '
'; print ''; diff --git a/htdocs/workstation/workstation_list.php b/htdocs/workstation/workstation_list.php index 186f3772e40..95de830dcbe 100644 --- a/htdocs/workstation/workstation_list.php +++ b/htdocs/workstation/workstation_list.php @@ -632,7 +632,7 @@ while ($i < $imaxinloop) { print '
'; } // Output Kanban - print $object->getKanbanView(''); + print $object->getKanbanView('', array('selected' => in_array($object->id, $arrayofselected))); if ($i == ($imaxinloop - 1)) { print '
'; print '';