From a2a4a74964542767d2ee19aa3b9228124935ea87 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 23 Sep 2021 16:18:21 +0200 Subject: [PATCH 1/7] Fix trans --- htdocs/langs/en_US/accountancy.lang | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/langs/en_US/accountancy.lang b/htdocs/langs/en_US/accountancy.lang index fc4b86a2cdb..40c83977076 100644 --- a/htdocs/langs/en_US/accountancy.lang +++ b/htdocs/langs/en_US/accountancy.lang @@ -37,8 +37,8 @@ OtherInfo=Other information DeleteCptCategory=Remove accounting account from group ConfirmDeleteCptCategory=Are you sure you want to remove this accounting account from the accounting account group? JournalizationInLedgerStatus=Status of journalization -AlreadyInGeneralLedger=Already transferred in accounting journals and ledger -NotYetInGeneralLedger=Not yet transferred in accouting journals and ledger +AlreadyInGeneralLedger=Already transferred to accounting journals and ledger +NotYetInGeneralLedger=Not yet transferred to accouting journals and ledger GroupIsEmptyCheckSetup=Group is empty, check setup of the personalized accounting group DetailByAccount=Show detail by account AccountWithNonZeroValues=Accounts with non-zero values @@ -298,7 +298,7 @@ NoNewRecordSaved=No more record to journalize ListOfProductsWithoutAccountingAccount=List of products not bound to any accounting account ChangeBinding=Change the binding Accounted=Accounted in ledger -NotYetAccounted=Not yet accounted in the ledger +NotYetAccounted=Not yet transferred to accounting ShowTutorial=Show Tutorial NotReconciled=Not reconciled WarningRecordWithoutSubledgerAreExcluded=Warning, all operations without subledger account defined are filtered and excluded from this view From 36a902167f66957174d9d42308367c91f3519a0a Mon Sep 17 00:00:00 2001 From: DevIntact Date: Thu, 23 Sep 2021 14:54:38 +0200 Subject: [PATCH 2/7] Translation of event title for incoming email Event title for incoming email is not translated while collected by cronjob. i.e : ActionAC_EMAIL_IN --- htdocs/emailcollector/class/emailcollector.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/emailcollector/class/emailcollector.class.php b/htdocs/emailcollector/class/emailcollector.class.php index 16df7774470..f4341109000 100644 --- a/htdocs/emailcollector/class/emailcollector.class.php +++ b/htdocs/emailcollector/class/emailcollector.class.php @@ -956,7 +956,7 @@ class EmailCollector extends CommonObject dol_syslog("EmailCollector::doCollectOneCollector start for id=".$this->id, LOG_DEBUG); - $langs->loadLangs(array("project", "companies", "mails", "errors", "ticket", "agenda")); + $langs->loadLangs(array("project", "companies", "mails", "errors", "ticket", "agenda", "commercial")); $error = 0; $this->output = ''; From 8fb52862607f9d0d9b94461619a6f8df3ca0fca4 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 24 Sep 2021 02:02:12 +0200 Subject: [PATCH 3/7] FIX #18797 --- htdocs/projet/class/project.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/projet/class/project.class.php b/htdocs/projet/class/project.class.php index 5d394ce3135..b127d3aa686 100644 --- a/htdocs/projet/class/project.class.php +++ b/htdocs/projet/class/project.class.php @@ -813,7 +813,7 @@ class Project extends CommonObject 'propal'=>'fk_projet', 'commande'=>'fk_projet', 'facture'=>'fk_projet', 'supplier_proposal'=>'fk_projet', 'commande_fournisseur'=>'fk_projet', 'facture_fourn'=>'fk_projet', 'expensereport_det'=>'fk_projet', 'contrat'=>'fk_projet', 'fichinter'=>'fk_projet', 'don'=>'fk_projet', - 'actioncomm'=>'fk_project', 'mrp_mo'=>'fk_project' + 'actioncomm'=>'fk_project', 'mrp_mo'=>'fk_project', 'entrepot'=>'fk_project' ); foreach ($listoftables as $key => $value) { $sql = "UPDATE ".MAIN_DB_PREFIX.$key." SET ".$value." = NULL where ".$value." = ".((int) $this->id); From 4c80e0425b1c8e7a7979733bf9bd092a73483e4e Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 24 Sep 2021 02:10:42 +0200 Subject: [PATCH 4/7] Fix date for tasks created during project creation --- ..._modEventOrganization_EventOrganization.class.php | 7 +++++-- htdocs/projet/class/task.class.php | 12 ++++++------ 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/htdocs/core/triggers/interface_50_modEventOrganization_EventOrganization.class.php b/htdocs/core/triggers/interface_50_modEventOrganization_EventOrganization.class.php index 04f9aaa17cc..dd1462ecf5f 100644 --- a/htdocs/core/triggers/interface_50_modEventOrganization_EventOrganization.class.php +++ b/htdocs/core/triggers/interface_50_modEventOrganization_EventOrganization.class.php @@ -101,8 +101,11 @@ class InterfaceEventOrganization extends DolibarrTriggers $defaultref = ''; } $task->ref = $defaultref; - $task->date_start = $object->date_start; - $task->date_end = $object->date_end; + + // TODO Can set offset for start date or endline from setup of task to create when creating event + $task->date_start = null; + $task->date_end = null; + $result = $task->create($user); if ($result < 0) { $this->errors=array_merge($this->errors, $task->errors); diff --git a/htdocs/projet/class/task.class.php b/htdocs/projet/class/task.class.php index 8ea6d0c78a3..87ef51daefd 100644 --- a/htdocs/projet/class/task.class.php +++ b/htdocs/projet/class/task.class.php @@ -173,16 +173,16 @@ class Task extends CommonObject $sql .= ", planned_workload"; $sql .= ", progress"; $sql .= ") VALUES ("; - $sql .= $conf->entity; - $sql .= ", ".$this->fk_project; + $sql .= ((int) $conf->entity); + $sql .= ", ".((int) $this->fk_project); $sql .= ", ".(!empty($this->ref) ? "'".$this->db->escape($this->ref)."'" : 'null'); - $sql .= ", ".$this->fk_task_parent; + $sql .= ", ".((int) $this->fk_task_parent); $sql .= ", '".$this->db->escape($this->label)."'"; $sql .= ", '".$this->db->escape($this->description)."'"; $sql .= ", '".$this->db->idate($now)."'"; - $sql .= ", ".$user->id; - $sql .= ", ".($this->date_start != '' ? "'".$this->db->idate($this->date_start)."'" : 'null'); - $sql .= ", ".($this->date_end != '' ? "'".$this->db->idate($this->date_end)."'" : 'null'); + $sql .= ", ".((int) $user->id); + $sql .= ", ".($this->date_start ? "'".$this->db->idate($this->date_start)."'" : 'null'); + $sql .= ", ".($this->date_end ? "'".$this->db->idate($this->date_end)."'" : 'null'); $sql .= ", ".(($this->planned_workload != '' && $this->planned_workload >= 0) ? $this->planned_workload : 'null'); $sql .= ", ".(($this->progress != '' && $this->progress >= 0) ? $this->progress : 'null'); $sql .= ")"; From 3d22cbe4dac2ca5b2c62fec3138d6dc5d98be33e Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 24 Sep 2021 02:16:40 +0200 Subject: [PATCH 5/7] Fix look and feel --- htdocs/projet/ganttview.php | 52 +++++++++++++++++++++---------------- htdocs/projet/tasks.php | 6 ++--- 2 files changed, 33 insertions(+), 25 deletions(-) diff --git a/htdocs/projet/ganttview.php b/htdocs/projet/ganttview.php index c5e5b20fb88..b5325ca93b2 100644 --- a/htdocs/projet/ganttview.php +++ b/htdocs/projet/ganttview.php @@ -89,6 +89,7 @@ if (!empty($conf->global->MAIN_HTML_TITLE) && preg_match('/projectnameonly/', $c $title = ($object->ref ? $object->ref.' '.$object->name.' - ' : '').$langs->trans("Gantt"); } $help_url = "EN:Module_Projects|FR:Module_Projets|ES:Módulo_Proyectos"; + llxHeader("", $title, $help_url, '', 0, 0, $arrayofjs, $arrayofcss); if (($id > 0 && is_numeric($id)) || !empty($ref)) { @@ -136,29 +137,36 @@ if (($id > 0 && is_numeric($id)) || !empty($ref)) { print ''; // Usage - print ''; - print ''; + print ''; } - if (empty($conf->global->PROJECT_HIDE_TASKS)) { - print 'usage_task ? ' checked="checked"' : '')).'"> '; - $htmltext = $langs->trans("ProjectFollowTasks"); - print $form->textwithpicto($langs->trans("ProjectFollowTasks"), $htmltext); - print '
'; - } - if (!empty($conf->global->PROJECT_BILL_TIME_SPENT)) { - print 'usage_bill_time ? ' checked="checked"' : '')).'"> '; - $htmltext = $langs->trans("ProjectBillTimeDescription"); - print $form->textwithpicto($langs->trans("BillTime"), $htmltext); - print '
'; - } - print ''; // Visibility print '
'; - print $langs->trans("Usage"); - print ''; - if (!empty($conf->global->PROJECT_USE_OPPORTUNITIES)) { - print 'usage_opportunity ? ' checked="checked"' : '')).'"> '; - $htmltext = $langs->trans("ProjectFollowOpportunity"); - print $form->textwithpicto($langs->trans("ProjectFollowOpportunity"), $htmltext); - print '
'; + if (!empty($conf->global->PROJECT_USE_OPPORTUNITIES) || empty($conf->global->PROJECT_HIDE_TASKS) || !empty($conf->eventorganization->enabled)) { + print '
'; + print $langs->trans("Usage"); + print ''; + if (!empty($conf->global->PROJECT_USE_OPPORTUNITIES)) { + print 'usage_opportunity ? ' checked="checked"' : '')).'"> '; + $htmltext = $langs->trans("ProjectFollowOpportunity"); + print $form->textwithpicto($langs->trans("ProjectFollowOpportunity"), $htmltext); + print '
'; + } + if (empty($conf->global->PROJECT_HIDE_TASKS)) { + print 'usage_task ? ' checked="checked"' : '')).'"> '; + $htmltext = $langs->trans("ProjectFollowTasks"); + print $form->textwithpicto($langs->trans("ProjectFollowTasks"), $htmltext); + print '
'; + } + if (empty($conf->global->PROJECT_HIDE_TASKS) && !empty($conf->global->PROJECT_BILL_TIME_SPENT)) { + print 'usage_bill_time ? ' checked="checked"' : '')).'"> '; + $htmltext = $langs->trans("ProjectBillTimeDescription"); + print $form->textwithpicto($langs->trans("BillTime"), $htmltext); + print '
'; + } + if (!empty($conf->eventorganization->enabled)) { + print 'usage_organize_event ? ' checked="checked"' : '')).'"> '; + $htmltext = $langs->trans("EventOrganizationDescriptionLong"); + print $form->textwithpicto($langs->trans("ManageOrganizeEvent"), $htmltext); + } + print '
'.$langs->trans("Visibility").''; diff --git a/htdocs/projet/tasks.php b/htdocs/projet/tasks.php index d4b5bf89bbf..d266d659da7 100644 --- a/htdocs/projet/tasks.php +++ b/htdocs/projet/tasks.php @@ -459,7 +459,7 @@ if ($id > 0 || !empty($ref)) { print '
'; print '
'; - print ''; + print '
'; // Usage if (!empty($conf->global->PROJECT_USE_OPPORTUNITIES) || empty($conf->global->PROJECT_HIDE_TASKS) || !empty($conf->eventorganization->enabled)) { @@ -532,7 +532,7 @@ if ($id > 0 || !empty($ref)) { print '
'; print '
'; - print '
'; + print '
'; // Description print '"; } From b09c4166b30f11de03541011b03fc8a96dc173e7 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 24 Sep 2021 02:24:04 +0200 Subject: [PATCH 6/7] Fix set position of lines in tasks of a project --- htdocs/core/ajax/row.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/htdocs/core/ajax/row.php b/htdocs/core/ajax/row.php index 7b271fafdf2..6047d8d289c 100644 --- a/htdocs/core/ajax/row.php +++ b/htdocs/core/ajax/row.php @@ -99,6 +99,8 @@ if (GETPOST('roworder', 'alpha', 3) && GETPOST('table_element_line', 'aZ09', 3) $perm = 1; } elseif ($table_element_line == 'ecm_files' && $fk_element == 'fk_ticket' && !empty($user->rights->ticket->write)) { $perm = 1; + } elseif ($table_element_line == 'projet_task' && $fk_element == 'fk_projet' && $user->rights->projet->creer) { + $perm = 1; } else { $tmparray = explode('_', $table_element_line); $tmpmodule = $tmparray[0]; $tmpobject = preg_replace('/line$/', '', $tmparray[1]); @@ -111,7 +113,7 @@ if (GETPOST('roworder', 'alpha', 3) && GETPOST('table_element_line', 'aZ09', 3) // We should not be here. If we are not allowed to reorder rows, feature should not be visible on script. // If we are here, it is a hack attempt, so we report a warning. print 'Bad permission to modify position of lines for object in table '.$table_element_line; - dol_syslog('Bad permission to modify position of lines for object in table '.$table_element_line.', fk_element '.$fk_element, LOG_WARNING); + dol_syslog('Bad permission to modify position of lines for object in table='.$table_element_line.', fk_element='.$fk_element, LOG_WARNING); accessforbidden('Bad permission to modify position of lines for object in table '.$table_element_line); } From cd46ccdb669b48c3d505e00b0ae86d1a96b26172 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 24 Sep 2021 02:31:15 +0200 Subject: [PATCH 7/7] Code comment --- htdocs/core/lib/project.lib.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/htdocs/core/lib/project.lib.php b/htdocs/core/lib/project.lib.php index 2467baa034a..c293b7c47ae 100644 --- a/htdocs/core/lib/project.lib.php +++ b/htdocs/core/lib/project.lib.php @@ -977,6 +977,7 @@ function projectLinesa(&$inc, $parent, &$lines, &$level, $var, $showproject, &$t } } + // Computed progress if (count($arrayfields) > 0 && !empty($arrayfields['t.progress_calculated']['checked'])) { print ''; } + + // Declared progress if (count($arrayfields) > 0 && !empty($arrayfields['t.progress']['checked'])) { print '
'.$langs->trans("Description").''; @@ -541,7 +541,7 @@ if ($id > 0 || !empty($ref)) { // Categories if ($conf->categorie->enabled) { - print '
'.$langs->trans("Categories").''; + print '
'.$langs->trans("Categories").''; print $form->showCategories($object->id, Categorie::TYPE_PROJECT, 1); print "
'; if ($total_projectlinesa_planned) { @@ -984,6 +985,8 @@ function projectLinesa(&$inc, $parent, &$lines, &$level, $var, $showproject, &$t } print ''; if ($total_projectlinesa_planned) {