From 0dfc9af72aaa7d807383c9a24c4a80592848e8a7 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 6 Mar 2018 19:56:08 +0100 Subject: [PATCH 1/2] FIX multicompany compatibility and fix reports --- htdocs/accountancy/admin/journals_list.php | 24 ++++++++++--------- htdocs/accountancy/journal/bankjournal.php | 5 ++-- .../journal/expensereportsjournal.php | 3 +++ .../accountancy/journal/purchasesjournal.php | 4 ++++ htdocs/accountancy/journal/sellsjournal.php | 4 ++++ htdocs/compta/resultat/clientfourn.php | 2 +- htdocs/compta/resultat/index.php | 1 - htdocs/compta/stats/index.php | 24 +++++++++---------- htdocs/langs/en_US/compta.lang | 1 + 9 files changed, 41 insertions(+), 27 deletions(-) diff --git a/htdocs/accountancy/admin/journals_list.php b/htdocs/accountancy/admin/journals_list.php index 620a7786310..7612e7b261a 100644 --- a/htdocs/accountancy/admin/journals_list.php +++ b/htdocs/accountancy/admin/journals_list.php @@ -177,6 +177,11 @@ if (GETPOST('actionadd') || GETPOST('actionmodify')) $msg .= $langs->transnoentities('ErrorFieldFormat', $langs->transnoentities('Code')).'
'; }*/ } + if (! GETPOST('label','alpha')) + { + setEventMessages($langs->transnoentities("ErrorFieldRequired", $langs->transnoentitiesnoconv("Label")), null, 'errors'); + $ok=0; + } // Clean some parameters if ($_POST["accountancy_code"] <= 0) $_POST["accountancy_code"]=''; // If empty, we force to null @@ -208,7 +213,7 @@ if (GETPOST('actionadd') || GETPOST('actionmodify')) if ($tabrowid[$id] && ! in_array($tabrowid[$id],$listfieldinsert)) $sql.= $tabrowid[$id].","; $sql.= $tabfieldinsert[$id]; - $sql.=",active)"; + $sql.=",active,entity)"; $sql.= " VALUES("; // List of values @@ -221,11 +226,11 @@ if (GETPOST('actionadd') || GETPOST('actionmodify')) $_POST[$listfieldvalue[$i]] = $conf->entity; } if ($i) $sql.=","; - if ($_POST[$listfieldvalue[$i]] == '' && ! ($listfieldvalue[$i] == 'code' && $id == 10)) $sql.="null"; // For vat, we want/accept code = '' + if ($_POST[$listfieldvalue[$i]] == '') $sql.="null"; // For vat, we want/accept code = '' else $sql.="'".$db->escape($_POST[$listfieldvalue[$i]])."'"; $i++; } - $sql.=",1)"; + $sql.=",1,".$conf->entity.")"; dol_syslog("actionadd", LOG_DEBUG); $result = $db->query($sql); @@ -275,6 +280,7 @@ if (GETPOST('actionadd') || GETPOST('actionmodify')) $i++; } $sql.= " WHERE ".$rowidcol." = '".$rowid."'"; + $sql.=" AND entity = ".$conf->entity; dol_syslog("actionmodify", LOG_DEBUG); //print $sql; @@ -298,6 +304,7 @@ if ($action == 'confirm_delete' && $confirm == 'yes') // delete else { $rowidcol="rowid"; } $sql = "DELETE from ".$tabname[$id]." WHERE ".$rowidcol."='".$rowid."'"; + $sql.=" AND entity = ".$conf->entity; dol_syslog("delete", LOG_DEBUG); $result = $db->query($sql); @@ -326,6 +333,7 @@ if ($action == $acts[0]) elseif ($code) { $sql = "UPDATE ".$tabname[$id]." SET active = 1 WHERE code='".$code."'"; } + $sql.=" AND entity = ".$conf->entity; $result = $db->query($sql); if (!$result) @@ -346,6 +354,7 @@ if ($action == $acts[1]) elseif ($code) { $sql = "UPDATE ".$tabname[$id]." SET active = 0 WHERE code='".$code."'"; } + $sql.=" AND entity = ".$conf->entity; $result = $db->query($sql); if (!$result) @@ -389,13 +398,7 @@ if ($id) { // Complete requete recherche valeurs avec critere de tri $sql=$tabsql[$id]; - - if ($search_country_id > 0) - { - if (preg_match('/ WHERE /',$sql)) $sql.= " AND "; - else $sql.=" WHERE "; - $sql.= " c.rowid = ".$search_country_id; - } + $sql.= " WHERE a.entity = ".$conf->entity; if ($sortfield) { @@ -416,7 +419,6 @@ if ($id) } $sql.=$tabsqlsort[$id]; $sql.=$db->plimit($listlimit+1,$offset); - //print $sql; $fieldlist=explode(',',$tabfield[$id]); diff --git a/htdocs/accountancy/journal/bankjournal.php b/htdocs/accountancy/journal/bankjournal.php index f67956c1a74..3bbbaa5faca 100644 --- a/htdocs/accountancy/journal/bankjournal.php +++ b/htdocs/accountancy/journal/bankjournal.php @@ -455,6 +455,7 @@ if (! $error && $action == 'writebookkeeping') { // No subledger_account value for the bank line but add a specific label_operation $bookkeeping->subledger_account = ''; $bookkeeping->label_operation = $reflabel; + $bookkeeping->entity = $conf->entity; $totaldebit += $bookkeeping->debit; $totalcredit += $bookkeeping->credit; @@ -561,8 +562,8 @@ if (! $error && $action == 'writebookkeeping') { $bookkeeping->label_compte = ''; } } - $bookkeeping->label_operation = $reflabel; + $bookkeeping->entity = $conf->entity; $totaldebit += $bookkeeping->debit; $totalcredit += $bookkeeping->credit; @@ -608,8 +609,8 @@ if (! $error && $action == 'writebookkeeping') { $bookkeeping->fk_user_author = $user->id; $bookkeeping->date_create = $now; $bookkeeping->label_compte = ''; - $bookkeeping->label_operation = $reflabel; + $bookkeeping->entity = $conf->entity; $totaldebit += $bookkeeping->debit; $totalcredit += $bookkeeping->credit; diff --git a/htdocs/accountancy/journal/expensereportsjournal.php b/htdocs/accountancy/journal/expensereportsjournal.php index 2b5aa063887..265628eb35a 100644 --- a/htdocs/accountancy/journal/expensereportsjournal.php +++ b/htdocs/accountancy/journal/expensereportsjournal.php @@ -216,6 +216,7 @@ if ($action == 'writebookkeeping') { $bookkeeping->code_journal = $journal; $bookkeeping->journal_label = $journal_label; $bookkeeping->fk_user_author = $user->id; + $bookkeeping->entity = $conf->entity; $totaldebit += $bookkeeping->debit; $totalcredit += $bookkeeping->credit; @@ -265,6 +266,7 @@ if ($action == 'writebookkeeping') { $bookkeeping->code_journal = $journal; $bookkeeping->journal_label = $journal_label; $bookkeeping->fk_user_author = $user->id; + $bookkeeping->entity = $conf->entity; $totaldebit += $bookkeeping->debit; $totalcredit += $bookkeeping->credit; @@ -320,6 +322,7 @@ if ($action == 'writebookkeeping') { $bookkeeping->code_journal = $journal; $bookkeeping->journal_label = $journal_label; $bookkeeping->fk_user_author = $user->id; + $bookkeeping->entity = $conf->entity; $totaldebit += $bookkeeping->debit; $totalcredit += $bookkeeping->credit; diff --git a/htdocs/accountancy/journal/purchasesjournal.php b/htdocs/accountancy/journal/purchasesjournal.php index ec21937c8ff..27f4521de4b 100644 --- a/htdocs/accountancy/journal/purchasesjournal.php +++ b/htdocs/accountancy/journal/purchasesjournal.php @@ -318,6 +318,7 @@ if ($action == 'writebookkeeping') { $bookkeeping->code_journal = $journal; $bookkeeping->journal_label = $journal_label; $bookkeeping->fk_user_author = $user->id; + $bookkeeping->entity = $conf->entity; $totaldebit += $bookkeeping->debit; $totalcredit += $bookkeeping->credit; @@ -371,6 +372,7 @@ if ($action == 'writebookkeeping') { $bookkeeping->code_journal = $journal; $bookkeeping->journal_label = $journal_label; $bookkeeping->fk_user_author = $user->id; + $bookkeeping->entity = $conf->entity; $totaldebit += $bookkeeping->debit; $totalcredit += $bookkeeping->credit; @@ -430,6 +432,7 @@ if ($action == 'writebookkeeping') { $bookkeeping->code_journal = $journal; $bookkeeping->journal_label = $journal_label; $bookkeeping->fk_user_author = $user->id; + $bookkeeping->entity = $conf->entity; $totaldebit += $bookkeeping->debit; $totalcredit += $bookkeeping->credit; @@ -482,6 +485,7 @@ if ($action == 'writebookkeeping') { $bookkeeping->code_journal = $journal; $bookkeeping->journal_label = $journal_label; $bookkeeping->fk_user_author = $user->id; + $bookkeeping->entity = $conf->entity; $totaldebit += $bookkeeping->debit; $totalcredit += $bookkeeping->credit; diff --git a/htdocs/accountancy/journal/sellsjournal.php b/htdocs/accountancy/journal/sellsjournal.php index 5088841b3d1..c10cc2b311f 100644 --- a/htdocs/accountancy/journal/sellsjournal.php +++ b/htdocs/accountancy/journal/sellsjournal.php @@ -121,6 +121,7 @@ if ($in_bookkeeping == 'notyet') // $sql .= " AND fd.rowid NOT IN (SELECT fk_docdet FROM " . MAIN_DB_PREFIX . "accounting_bookkeeping as ab WHERE ab.doc_type='customer_invoice')"; // Useless, we save one line for all products with same account } $sql .= " ORDER BY f.datef"; +//print $sql; dol_syslog('accountancy/journal/sellsjournal.php', LOG_DEBUG); $result = $db->query($sql); @@ -319,6 +320,7 @@ if ($action == 'writebookkeeping') { $bookkeeping->code_journal = $journal; $bookkeeping->journal_label = $journal_label; $bookkeeping->fk_user_author = $user->id; + $bookkeeping->entity = $conf->entity; $totaldebit += $bookkeeping->debit; $totalcredit += $bookkeeping->credit; @@ -372,6 +374,7 @@ if ($action == 'writebookkeeping') { $bookkeeping->code_journal = $journal; $bookkeeping->journal_label = $journal_label; $bookkeeping->fk_user_author = $user->id; + $bookkeeping->entity = $conf->entity; $totaldebit += $bookkeeping->debit; $totalcredit += $bookkeeping->credit; @@ -430,6 +433,7 @@ if ($action == 'writebookkeeping') { $bookkeeping->code_journal = $journal; $bookkeeping->journal_label = $journal_label; $bookkeeping->fk_user_author = $user->id; + $bookkeeping->entity = $conf->entity; $totaldebit += $bookkeeping->debit; $totalcredit += $bookkeeping->credit; diff --git a/htdocs/compta/resultat/clientfourn.php b/htdocs/compta/resultat/clientfourn.php index fe7d927b6df..1bbeb9f2f29 100644 --- a/htdocs/compta/resultat/clientfourn.php +++ b/htdocs/compta/resultat/clientfourn.php @@ -255,7 +255,7 @@ if ($modecompta == 'BOOKKEEPING') $sql.= " WHERE f.numero_compte = aa.account_number"; //$sql.= " AND fk_statut in (1,2)"; $sql.= " AND ".$predefinedgroupwhere; - $sql.= " AND aa.fk_pcg_version = '".$charofaccountstring."'"; + $sql.= " AND f.entity = ".$conf->entity; if (! empty($date_start) && ! empty($date_end)) $sql.= " AND f.doc_date >= '".$db->idate($date_start)."' AND f.doc_date <= '".$db->idate($date_end)."'"; $sql.= " GROUP BY pcg_type, pcg_subtype, name, socid"; diff --git a/htdocs/compta/resultat/index.php b/htdocs/compta/resultat/index.php index 156576fa4bc..26f12e3f7c5 100644 --- a/htdocs/compta/resultat/index.php +++ b/htdocs/compta/resultat/index.php @@ -828,7 +828,6 @@ if (! empty($conf->accounting->enabled) && ($modecompta == 'BOOKKEEPING')) if (! empty($date_start) && ! empty($date_end)) $sql.= " AND b.doc_date >= '".$db->idate($date_start)."' AND b.doc_date <= '".$db->idate($date_end)."'"; $sql.= " GROUP BY b.doc_ref, b.numero_compte, b.subledger_account, b.subledger_label, pcg_type, dm"; - //print $sql; dol_syslog("get bookkeeping record"); diff --git a/htdocs/compta/stats/index.php b/htdocs/compta/stats/index.php index 335cf581740..598de2ba490 100644 --- a/htdocs/compta/stats/index.php +++ b/htdocs/compta/stats/index.php @@ -142,9 +142,7 @@ else if ($modecompta=="BOOKKEEPING") $calcmode.='
('.$langs->trans("SeeReportInInputOutputMode",'','').')'; $period=$form->select_date($date_start,'date_start',0,0,0,'',1,0,1).' - '.$form->select_date($date_end,'date_end',0,0,0,'',1,0,1); $periodlink=($year_start?"".img_previous()." ".img_next()."":""); - $description=$langs->trans("RulesCADue"); - if (! empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) $description.= $langs->trans("DepositsAreNotIncluded"); - else $description.= $langs->trans("DepositsAreIncluded"); + $description=$langs->trans("RulesCATotalSaleJournal"); $builddate=dol_now(); //$exportlink=$langs->trans("NotYetAvailable"); } @@ -187,15 +185,14 @@ if ($socid) $sql.= " AND f.fk_soc = ".$socid; else if ($modecompta=="BOOKKEEPING") { $sql = "SELECT date_format(b.doc_date,'%Y-%m') as dm, sum(b.credit) as amount_ttc"; - $sql.= " FROM ".MAIN_DB_PREFIX."accounting_bookkeeping as b"; - $sql.= " WHERE b.numero_compte IN (SELECT a.account_number" ; - $sql.= " FROM ".MAIN_DB_PREFIX."accounting_account as a"; - $sql.= " WHERE a.fk_accounting_category = 1 ) " ; // todo sql with accounting category, but we need to define category in turnover + $sql.= " FROM ".MAIN_DB_PREFIX."accounting_bookkeeping as b, ".MAIN_DB_PREFIX."accounting_journal as aj"; + $sql.= " WHERE b.entity = ".$conf->entity; + $sql.= " AND b.code_journal = aj.code AND aj.nature = 2" ; // @TODO currently count amount in sale journal, but we need to define a category group for turnover } - $sql.= " GROUP BY dm"; $sql.= " ORDER BY dm"; +//print $sql; $result = $db->query($sql); if ($result) @@ -221,7 +218,7 @@ else { } // On ajoute les paiements anciennes version, non lies par paiement_facture (very old versions) -if ($modecompta != 'CREANCES-DETTES') +if ($modecompta == 'RECETTES-DEPENSES') { $sql = "SELECT date_format(p.datep,'%Y-%m') as dm, sum(p.amount) as amount_ttc"; $sql.= " FROM ".MAIN_DB_PREFIX."bank as b"; @@ -269,10 +266,11 @@ for ($annee = $year_start ; $annee <= $year_end ; $annee++) { if ($modecompta == 'CREANCES-DETTES') print ''; else print ''; - print ''; + if ($modecompta != 'BOOKKEEPING') print ''; print $annee; if ($conf->global->SOCIETE_FISCAL_MONTH_START > 1) print '-'.($annee+1); - print ''; + if ($modecompta != 'BOOKKEEPING') print ''; + print ''; if ($annee != $year_end) print ' '; } print ''; @@ -336,7 +334,9 @@ for ($mois = 1+$nb_mois_decalage ; $mois <= 12+$nb_mois_decalage ; $mois++) if ($cum[$case]) { $now_show_delta=1; // On a trouve le premier mois de la premiere annee generant du chiffre. - print ''.price($cum[$case],1).''; + if ($modecompta != 'BOOKKEEPING') print ''; + print price($cum[$case], 1); + if ($modecompta != 'BOOKKEEPING') print ''; } else { diff --git a/htdocs/langs/en_US/compta.lang b/htdocs/langs/en_US/compta.lang index 632ef67feb9..d1413fb0454 100644 --- a/htdocs/langs/en_US/compta.lang +++ b/htdocs/langs/en_US/compta.lang @@ -157,6 +157,7 @@ RulesResultDue=- It includes outstanding invoices, expenses, VAT, donations whet RulesResultInOut=- It includes the real payments made on invoices, expenses, VAT and salaries.
- It is based on the payment dates of the invoices, expenses, VAT and salaries. The donation date for donation. RulesCADue=- It includes the client's due invoices whether they are paid or not.
- It is based on the validation date of these invoices.
RulesCAIn=- It includes all the effective payments of invoices received from clients.
- It is based on the payment date of these invoices
+RulesCATotalSaleJournal=It includes all credit lines from the Sale journal. RulesAmountOnInOutBookkeepingRecord=It includes record in your Ledger with accounting accounts that has the group "EXPENSE" or "INCOME" RulesResultBookkeepingPredefined=It includes record in your Ledger with accounting accounts that has the group "EXPENSE" or "INCOME" RulesResultBookkeepingPersonalized=It show record in your Ledger with accounting accounts grouped by personalized groups From 23a4a609704b594a837acc05ee8414cd3372c415 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 6 Mar 2018 21:51:43 +0100 Subject: [PATCH 2/2] Fix status of task --- htdocs/core/lib/functions.lib.php | 26 ++++++++++++------ htdocs/langs/en_US/main.lang | 3 +++ htdocs/projet/class/task.class.php | 42 ++++++++++++++++-------------- htdocs/projet/tasks/contact.php | 2 +- htdocs/projet/tasks/document.php | 2 +- htdocs/projet/tasks/note.php | 2 +- htdocs/projet/tasks/task.php | 6 ++--- htdocs/projet/tasks/time.php | 8 ++++-- 8 files changed, 56 insertions(+), 35 deletions(-) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 99aa4ccc84f..9d824b98abe 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -1077,11 +1077,12 @@ function dol_syslog($message, $level = LOG_INFO, $ident = 0, $suffixinfilename=' * @param string $picto Add a picto on tab title * @param int $pictoisfullpath If 1, image path is a full path. If you set this to 1, you can use url returned by dol_buildpath('/mymodyle/img/myimg.png',1) for $picto. * @param string $morehtmlright Add more html content on right of tabs title + * @param string $morecss More Css * @return void */ -function dol_fiche_head($links=array(), $active='0', $title='', $notab=0, $picto='', $pictoisfullpath=0, $morehtmlright='') +function dol_fiche_head($links=array(), $active='0', $title='', $notab=0, $picto='', $pictoisfullpath=0, $morehtmlright='', $morecss='') { - print dol_get_fiche_head($links, $active, $title, $notab, $picto, $pictoisfullpath, $morehtmlright); + print dol_get_fiche_head($links, $active, $title, $notab, $picto, $pictoisfullpath, $morehtmlright, $morecss); } /** @@ -1094,9 +1095,10 @@ function dol_fiche_head($links=array(), $active='0', $title='', $notab=0, $picto * @param string $picto Add a picto on tab title * @param int $pictoisfullpath If 1, image path is a full path. If you set this to 1, you can use url returned by dol_buildpath('/mymodyle/img/myimg.png',1) for $picto. * @param string $morehtmlright Add more html content on right of tabs title + * @param string $morecss More Css * @return string */ -function dol_get_fiche_head($links=array(), $active='', $title='', $notab=0, $picto='', $pictoisfullpath=0, $morehtmlright='') +function dol_get_fiche_head($links=array(), $active='', $title='', $notab=0, $picto='', $pictoisfullpath=0, $morehtmlright='', $morecss='') { global $conf, $langs, $hookmanager; @@ -1161,7 +1163,7 @@ function dol_get_fiche_head($links=array(), $active='', $title='', $notab=0, $pi { if (!empty($links[$i][0])) { - $out.=''.$links[$i][1].''."\n"; + $out.=''.$links[$i][1].''."\n"; } else { @@ -1173,13 +1175,13 @@ function dol_get_fiche_head($links=array(), $active='', $title='', $notab=0, $pi //print "x $i $active ".$links[$i][2]." z"; if ($isactive) { - $out.=''; + $out.=''; $out.=$links[$i][1]; $out.=''."\n"; } else { - $out.=''; + $out.=''; $out.=$links[$i][1]; $out.=''."\n"; } @@ -1198,14 +1200,14 @@ function dol_get_fiche_head($links=array(), $active='', $title='', $notab=0, $pi if (isset($links[$i][2]) && $links[$i][2] == 'image') { if (!empty($links[$i][0])) - $outmore.=''.$links[$i][1].''."\n"; + $outmore.=''.$links[$i][1].''."\n"; else $outmore.=''.$links[$i][1].''."\n"; } else if (! empty($links[$i][1])) { - $outmore.=''; + $outmore.=''; $outmore.=preg_replace('/([a-z])\/([a-z])/i', '\\1 / \\2', $links[$i][1]); // Replace x/y with x / y to allow wrap on long composed texts. $outmore.=''."\n"; } @@ -1489,6 +1491,14 @@ function dol_banner_tab($object, $paramid, $morehtml='', $shownav=1, $fieldid='r if ($object->frequency == 0) $morehtmlstatus.=$object->getLibStatut(2); else $morehtmlstatus.=$object->getLibStatut(5); } + elseif ($object->element == 'project_task') + { + $object->fk_statut = 1; + if ($object->progress > 0) $object->fk_statut = 2; + if ($object->progress >= 100) $object->fk_statut = 3; + $tmptxt=$object->getLibStatut(5); + $morehtmlstatus.=$tmptxt; // No status on task + } else { // Generic case $tmptxt=$object->getLibStatut(6); if (empty($tmptxt) || $tmptxt == $object->getLibStatut(3) || $conf->browser->layout=='phone') $tmptxt=$object->getLibStatut(5); diff --git a/htdocs/langs/en_US/main.lang b/htdocs/langs/en_US/main.lang index 19c7967e43a..6806e648823 100644 --- a/htdocs/langs/en_US/main.lang +++ b/htdocs/langs/en_US/main.lang @@ -429,6 +429,9 @@ ActionsOnCompany=Events about this third party ActionsOnMember=Events about this member ActionsOnProduct=Events about this product NActionsLate=%s late +ToDo=To do +Completed=Completed +Running=In progress RequestAlreadyDone=Request already recorded Filter=Filter FilterOnInto=Search criteria '%s' into fields %s diff --git a/htdocs/projet/class/task.class.php b/htdocs/projet/class/task.class.php index e694b3c7bfd..83de25b21ad 100644 --- a/htdocs/projet/class/task.class.php +++ b/htdocs/projet/class/task.class.php @@ -1695,7 +1695,7 @@ class Task extends CommonObject */ function getLibStatut($mode=0) { - return $this->LibStatut($this->fk_statut,$mode); + return $this->LibStatut($this->fk_statut, $mode); } /** @@ -1705,18 +1705,18 @@ class Task extends CommonObject * @param integer $mode 0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=Short label + Picto * @return string Label */ - function LibStatut($statut,$mode=0) + function LibStatut($statut, $mode=0) { // list of Statut of the task $this->statuts[0]='Draft'; - $this->statuts[1]='Validated'; + $this->statuts[1]='ToDo'; $this->statuts[2]='Running'; $this->statuts[3]='Finish'; $this->statuts[4]='Transfered'; $this->statuts_short[0]='Draft'; - $this->statuts_short[1]='Validated'; + $this->statuts_short[1]='ToDo'; $this->statuts_short[2]='Running'; - $this->statuts_short[3]='Finish'; + $this->statuts_short[3]='Completed'; $this->statuts_short[4]='Transfered'; global $langs; @@ -1734,7 +1734,7 @@ class Task extends CommonObject if ($statut==0) return img_picto($langs->trans($this->statuts_short[$statut]),'statut0').' '.$langs->trans($this->statuts_short[$statut]); if ($statut==1) return img_picto($langs->trans($this->statuts_short[$statut]),'statut1').' '.$langs->trans($this->statuts_short[$statut]); if ($statut==2) return img_picto($langs->trans($this->statuts_short[$statut]),'statut3').' '.$langs->trans($this->statuts_short[$statut]); - if ($statut==3) return img_picto($langs->trans($this->statuts_short[$statut]),'statut4').' '.$langs->trans($this->statuts_short[$statut]); + if ($statut==3) return img_picto($langs->trans($this->statuts_short[$statut]),'statut6').' '.$langs->trans($this->statuts_short[$statut]); if ($statut==4) return img_picto($langs->trans($this->statuts_short[$statut]),'statut6').' '.$langs->trans($this->statuts_short[$statut]); if ($statut==5) return img_picto($langs->trans($this->statuts_short[$statut]),'statut5').' '.$langs->trans($this->statuts_short[$statut]); } @@ -1743,7 +1743,7 @@ class Task extends CommonObject if ($statut==0) return img_picto($langs->trans($this->statuts_short[$statut]),'statut0'); if ($statut==1) return img_picto($langs->trans($this->statuts_short[$statut]),'statut1'); if ($statut==2) return img_picto($langs->trans($this->statuts_short[$statut]),'statut3'); - if ($statut==3) return img_picto($langs->trans($this->statuts_short[$statut]),'statut4'); + if ($statut==3) return img_picto($langs->trans($this->statuts_short[$statut]),'statut6'); if ($statut==4) return img_picto($langs->trans($this->statuts_short[$statut]),'statut6'); if ($statut==5) return img_picto($langs->trans($this->statuts_short[$statut]),'statut5'); } @@ -1752,27 +1752,31 @@ class Task extends CommonObject if ($statut==0) return img_picto($langs->trans($this->statuts_short[$statut]),'statut0').' '.$langs->trans($this->statuts[$statut]); if ($statut==1) return img_picto($langs->trans($this->statuts_short[$statut]),'statut1').' '.$langs->trans($this->statuts[$statut]); if ($statut==2) return img_picto($langs->trans($this->statuts_short[$statut]),'statut3').' '.$langs->trans($this->statuts[$statut]); - if ($statut==3) return img_picto($langs->trans($this->statuts_short[$statut]),'statut4').' '.$langs->trans($this->statuts[$statut]); + if ($statut==3) return img_picto($langs->trans($this->statuts_short[$statut]),'statut6').' '.$langs->trans($this->statuts[$statut]); if ($statut==4) return img_picto($langs->trans($this->statuts_short[$statut]),'statut6').' '.$langs->trans($this->statuts[$statut]); if ($statut==5) return img_picto($langs->trans($this->statuts_short[$statut]),'statut5').' '.$langs->trans($this->statuts[$statut]); } if ($mode == 5) - { - if ($statut==0) return $langs->trans($this->statuts_short[$statut]).' '.img_picto($langs->trans($this->statuts_short[$statut]),'statut0'); - if ($statut==1) return $langs->trans($this->statuts_short[$statut]).' '.img_picto($langs->trans($this->statuts_short[$statut]),'statut1'); - if ($statut==2) return $langs->trans($this->statuts_short[$statut]).' '.img_picto($langs->trans($this->statuts_short[$statut]),'statut3'); - if ($statut==3) return $langs->trans($this->statuts_short[$statut]).' '.img_picto($langs->trans($this->statuts_short[$statut]),'statut4'); - if ($statut==4) return $langs->trans($this->statuts_short[$statut]).' '.img_picto($langs->trans($this->statuts_short[$statut]),'statut6'); - if ($statut==5) return $langs->trans($this->statuts_short[$statut]).' '.img_picto($langs->trans($this->statuts_short[$statut]),'statut5'); - } - if ($mode == 6) { /*if ($statut==0) return $langs->trans($this->statuts_short[$statut]).' '.img_picto($langs->trans($this->statuts_short[$statut]),'statut0'); if ($statut==1) return $langs->trans($this->statuts_short[$statut]).' '.img_picto($langs->trans($this->statuts_short[$statut]),'statut1'); if ($statut==2) return $langs->trans($this->statuts_short[$statut]).' '.img_picto($langs->trans($this->statuts_short[$statut]),'statut3'); - if ($statut==3) return $langs->trans($this->statuts_short[$statut]).' '.img_picto($langs->trans($this->statuts_short[$statut]),'statut4'); + if ($statut==3) return $langs->trans($this->statuts_short[$statut]).' '.img_picto($langs->trans($this->statuts_short[$statut]),'statut6'); if ($statut==4) return $langs->trans($this->statuts_short[$statut]).' '.img_picto($langs->trans($this->statuts_short[$statut]),'statut6'); - if ($statut==5) return $langs->trans($this->statuts_short[$statut]).' '.img_picto($langs->trans($this->statuts_short[$statut]),'statut5');*/ + if ($statut==5) return $langs->trans($this->statuts_short[$statut]).' '.img_picto($langs->trans($this->statuts_short[$statut]),'statut5'); + */ + //return $this->progress.' %'; + return ' '; + } + if ($mode == 6) + { + /*if ($statut==0) return $langs->trans($this->statuts[$statut]).' '.img_picto($langs->trans($this->statuts_short[$statut]),'statut0'); + if ($statut==1) return $langs->trans($this->statuts[$statut]).' '.img_picto($langs->trans($this->statuts_short[$statut]),'statut1'); + if ($statut==2) return $langs->trans($this->statuts[$statut]).' '.img_picto($langs->trans($this->statuts_short[$statut]),'statut3'); + if ($statut==3) return $langs->trans($this->statuts[$statut]).' '.img_picto($langs->trans($this->statuts_short[$statut]),'statut6'); + if ($statut==4) return $langs->trans($this->statuts[$statut]).' '.img_picto($langs->trans($this->statuts_short[$statut]),'statut6'); + if ($statut==5) return $langs->trans($this->statuts[$statut]).' '.img_picto($langs->trans($this->statuts_short[$statut]),'statut5'); + */ //return $this->progress.' %'; return ' '; } diff --git a/htdocs/projet/tasks/contact.php b/htdocs/projet/tasks/contact.php index a2bb784c062..a2db82fc0ed 100644 --- a/htdocs/projet/tasks/contact.php +++ b/htdocs/projet/tasks/contact.php @@ -285,7 +285,7 @@ if ($id > 0 || ! empty($ref)) //$arrayofuseridoftask=$object->getListContactId('internal'); $head = task_prepare_head($object); - dol_fiche_head($head, 'task_contact', $langs->trans("Task"), -1, 'projecttask'); + dol_fiche_head($head, 'task_contact', $langs->trans("Task"), -1, 'projecttask', 0, '', 'reposition'); $param=(GETPOST('withproject')?'&withproject=1':''); diff --git a/htdocs/projet/tasks/document.php b/htdocs/projet/tasks/document.php index 7fc0b981902..1cb5acb73b5 100644 --- a/htdocs/projet/tasks/document.php +++ b/htdocs/projet/tasks/document.php @@ -224,7 +224,7 @@ if ($object->id > 0) } $head = task_prepare_head($object); - dol_fiche_head($head, 'task_document', $langs->trans("Task"), -1, 'projecttask'); + dol_fiche_head($head, 'task_document', $langs->trans("Task"), -1, 'projecttask', 0, '', 'reposition'); // Files list constructor $filearray=dol_dir_list($upload_dir,"files",0,'','(\.meta|_preview.*\.png)$',$sortfield,(strtolower($sortorder)=='desc'?SORT_DESC:SORT_ASC),1); diff --git a/htdocs/projet/tasks/note.php b/htdocs/projet/tasks/note.php index da33b8b7607..f915aaf836a 100644 --- a/htdocs/projet/tasks/note.php +++ b/htdocs/projet/tasks/note.php @@ -202,7 +202,7 @@ if ($object->id > 0) } $head = task_prepare_head($object); - dol_fiche_head($head, 'task_notes', $langs->trans('Task'), -1, 'projecttask'); + dol_fiche_head($head, 'task_notes', $langs->trans('Task'), -1, 'projecttask', 0, '', 'reposition'); $param=(GETPOST('withproject')?'&withproject=1':''); diff --git a/htdocs/projet/tasks/task.php b/htdocs/projet/tasks/task.php index e115c51d635..10b7c35ea41 100644 --- a/htdocs/projet/tasks/task.php +++ b/htdocs/projet/tasks/task.php @@ -221,7 +221,7 @@ if ($id > 0 || ! empty($ref)) // Tabs for project $tab='tasks'; $head=project_prepare_head($projectstatic); - dol_fiche_head($head, $tab, $langs->trans("Project"), -1, ($projectstatic->public?'projectpub':'project')); + dol_fiche_head($head, $tab, $langs->trans("Project"), -1, ($projectstatic->public?'projectpub':'project'), 0, '', ''); $param=($mode=='mine'?'&mode=mine':''); @@ -352,7 +352,7 @@ if ($id > 0 || ! empty($ref)) print ''; print ''; - dol_fiche_head($head, 'task_task', $langs->trans("Task"),0,'projecttask'); + dol_fiche_head($head, 'task_task', $langs->trans("Task"), 0, 'projecttask', 0, '', ''); print ''; @@ -437,7 +437,7 @@ if ($id > 0 || ! empty($ref)) $param=($withproject?'&withproject=1':''); $linkback=$withproject?''.$langs->trans("BackToList").'':''; - dol_fiche_head($head, 'task_task', $langs->trans("Task"), -1, 'projecttask'); + dol_fiche_head($head, 'task_task', $langs->trans("Task"), -1, 'projecttask', 0, '', 'reposition'); if ($action == 'delete') { diff --git a/htdocs/projet/tasks/time.php b/htdocs/projet/tasks/time.php index 73e9f5ec311..cbfdc48eae9 100644 --- a/htdocs/projet/tasks/time.php +++ b/htdocs/projet/tasks/time.php @@ -434,7 +434,7 @@ if (($id > 0 || ! empty($ref)) || $projectidforalltimes > 0) if (empty($projectidforalltimes)) { $head=task_prepare_head($object); - dol_fiche_head($head, 'task_time', $langs->trans("Task"), -1, 'projecttask'); + dol_fiche_head($head, 'task_time', $langs->trans("Task"), -1, 'projecttask', 0, '', 'reposition'); if ($action == 'deleteline') { @@ -541,6 +541,7 @@ if (($id > 0 || ! empty($ref)) || $projectidforalltimes > 0) print ''; print ''; + print '
'; print '
'; print ''; @@ -595,7 +596,10 @@ if (($id > 0 || ! empty($ref)) || $projectidforalltimes > 0) print ''; print ''; - print '
'; + print ''; + print ''; + + print ''; print '
'; }