From b52c441c6493c313d7a17b408e5050d43eff8fd4 Mon Sep 17 00:00:00 2001 From: novalore Date: Sun, 5 Jun 2016 02:26:10 +0200 Subject: [PATCH 01/50] english fix in accountancy for currency --- htdocs/langs/en_US/accountancy.lang | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/langs/en_US/accountancy.lang b/htdocs/langs/en_US/accountancy.lang index 20640733cd4..993570f4790 100644 --- a/htdocs/langs/en_US/accountancy.lang +++ b/htdocs/langs/en_US/accountancy.lang @@ -3,9 +3,9 @@ ACCOUNTING_EXPORT_SEPARATORCSV=Column separator for export file ACCOUNTING_EXPORT_DATE=Date format for export file ACCOUNTING_EXPORT_PIECE=Export the number of piece ACCOUNTING_EXPORT_GLOBAL_ACCOUNT=Export with global account -ACCOUNTING_EXPORT_LABEL=Export the label -ACCOUNTING_EXPORT_AMOUNT=Export the amount -ACCOUNTING_EXPORT_DEVISE=Export the devise +ACCOUNTING_EXPORT_LABEL=Export label +ACCOUNTING_EXPORT_AMOUNT=Export amount +ACCOUNTING_EXPORT_DEVISE=Export currency Selectformat=Select the format for the file ACCOUNTING_EXPORT_PREFIX_SPEC=Specify the prefix for the file name @@ -183,4 +183,4 @@ Formula=Formula ## Error ErrorNoAccountingCategoryForThisCountry=No accounting category are available for this country -ExportNotSupported=The export format setuped is not supported into this page \ No newline at end of file +ExportNotSupported=The export format setuped is not supported into this page From caaffdb0c3b7553536fe8978571c78b023b3ea77 Mon Sep 17 00:00:00 2001 From: Maxime Kohlhaas Date: Sun, 5 Jun 2016 02:54:25 +0200 Subject: [PATCH 02/50] FIX #5044 --- htdocs/core/modules/expedition/doc/pdf_rouget.modules.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/core/modules/expedition/doc/pdf_rouget.modules.php b/htdocs/core/modules/expedition/doc/pdf_rouget.modules.php index c0e8512b06f..ae9a4300544 100644 --- a/htdocs/core/modules/expedition/doc/pdf_rouget.modules.php +++ b/htdocs/core/modules/expedition/doc/pdf_rouget.modules.php @@ -119,6 +119,7 @@ class pdf_rouget extends ModelePdfExpedition $outputlangs->load("propal"); $outputlangs->load("deliveries"); $outputlangs->load("sendings"); + $outputlangs->load("productbatch"); $nblignes = count($object->lines); From 466010a4121317736e41e51d06dcc52bc617a0f2 Mon Sep 17 00:00:00 2001 From: aspangaro Date: Sun, 5 Jun 2016 14:14:20 +0200 Subject: [PATCH 03/50] Fix: Accountancy 4.0 - Right to access to fiscal year --- htdocs/accountancy/admin/fiscalyear.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/htdocs/accountancy/admin/fiscalyear.php b/htdocs/accountancy/admin/fiscalyear.php index 00cf70b9e73..e84c079a7e5 100644 --- a/htdocs/accountancy/admin/fiscalyear.php +++ b/htdocs/accountancy/admin/fiscalyear.php @@ -42,7 +42,10 @@ if (! $sortorder) $sortorder="ASC"; $langs->load("admin"); $langs->load("compta"); -if (! $user->admin) +// Security check +if ($user->societe_id > 0) + accessforbidden(); +if (! $user->rights->accounting->fiscalyear) accessforbidden(); $error = 0; From 1d5dd0d16ed49b2f31fcc03971e96accff3fd4eb Mon Sep 17 00:00:00 2001 From: aspangaro Date: Sun, 5 Jun 2016 15:21:11 +0200 Subject: [PATCH 04/50] New: Loan - Add accountancy account list --- htdocs/loan/card.php | 68 +++++++++++++++++++++++++++++++------------- 1 file changed, 49 insertions(+), 19 deletions(-) diff --git a/htdocs/loan/card.php b/htdocs/loan/card.php index 116de7c561d..88bf17d5e57 100644 --- a/htdocs/loan/card.php +++ b/htdocs/loan/card.php @@ -26,6 +26,8 @@ require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/loan/class/loan.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/loan.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; +if (! empty($conf->accounting->enabled)) require_once DOL_DOCUMENT_ROOT.'/core/lib/accounting.lib.php'; +if (! empty($conf->accounting->enabled)) require_once DOL_DOCUMENT_ROOT.'/accountancy/class/html.formventilation.class.php'; $langs->load("compta"); $langs->load("bills"); @@ -104,19 +106,23 @@ if ($action == 'add' && $user->rights->loan->write) } else { - $object->label = $_POST["label"]; - $object->fk_bank = $_POST["accountid"]; - $object->capital = $_POST["capital"]; - $object->datestart = $datestart; - $object->dateend = $dateend; - $object->nbterm = $_POST["nbterm"]; - $object->rate = $_POST["rate"]; - $object->note_private = GETPOST('note_private'); - $object->note_public = GETPOST('note_public'); + $object->label = $_POST["label"]; + $object->fk_bank = $_POST["accountid"]; + $object->capital = $_POST["capital"]; + $object->datestart = $datestart; + $object->dateend = $dateend; + $object->nbterm = $_POST["nbterm"]; + $object->rate = $_POST["rate"]; + $object->note_private = GETPOST('note_private'); + $object->note_public = GETPOST('note_public'); - $object->account_capital = $_POST["accountancy_account_capital"]; - $object->account_insurance = $_POST["accountancy_account_insurance"]; - $object->account_interest = $_POST["accountancy_account_interest"]; + $accountancy_account_capital = GETPOST('accountancy_account_capital'); + $accountancy_account_insurance = GETPOST('accountancy_account_insurance'); + $accountancy_account_interest = GETPOST('accountancy_account_interest'); + + if ($accountancy_account_capital <= 0) { $object->account_capital = ''; } else { $object->account_capital = $accountancy_account_capital; } + if ($accountancy_account_insurance <= 0) { $object->account_insurance = ''; } else { $object->account_insurance = $accountancy_account_insurance; } + if ($accountancy_account_interest <= 0) { $object->account_interest = ''; } else { $object->account_interest = $accountancy_account_interest; } $id=$object->create($user); if ($id <= 0) @@ -172,6 +178,7 @@ else if ($action == 'update' && $user->rights->loan->write) */ $form = new Form($db); +if (! empty($conf->accounting->enabled)) $formaccountancy = New FormVentilation($db); $help_url='EN:Module_Loan|FR:Module_Emprunt'; llxHeader("",$langs->trans("Loan"),$help_url); @@ -253,27 +260,50 @@ if ($action == 'create') print ''; + print '
'; + + print ''; // Accountancy - if ($conf->accounting->enabled) + if (! empty($conf->accounting->enabled)) { - print '
'; - - print '
'; - + // Accountancy_account_capital + print ''; + print ''; + + // Accountancy_account_insurance + print ''; + print ''; + + // Accountancy_account_interest + print ''; + print ''; + } + else // For external software + { + // Accountancy_account_capital print ''; print ''; - + + // Accountancy_account_insurance print ''; print ''; - + + // Accountancy_account_interest print ''; print ''; print '
'.$langs->trans("LoanAccountancyCapitalCode").''; + print $formaccountancy->select_account($object->accountancy_account_capital, 'accountancy_account_capital', 1, '', 0, 1); + print '
'.$langs->trans("LoanAccountancyInsuranceCode").''; + print $formaccountancy->select_account($object->accountancy_account_insurance, 'accountancy_account_insurance', 1, '', 0, 1); + print '
'.$langs->trans("LoanAccountancyInterestCode").''; + print $formaccountancy->select_account($object->accountancy_account_interest, 'accountancy_account_interest', 1, '', 0, 1); + print '
'.$langs->trans("LoanAccountancyCapitalCode").''; print '
'.$langs->trans("LoanAccountancyInsuranceCode").''; print '
'.$langs->trans("LoanAccountancyInterestCode").''; print '
'; } + print ''; dol_fiche_end(); From fda07997d2b7e016821631f699e03af223fdb5c9 Mon Sep 17 00:00:00 2001 From: aspangaro Date: Sun, 5 Jun 2016 15:25:21 +0200 Subject: [PATCH 05/50] Fix: Loan - Remove page note, already present in card --- htdocs/core/lib/loan.lib.php | 10 ---- htdocs/loan/note.php | 101 ----------------------------------- 2 files changed, 111 deletions(-) delete mode 100644 htdocs/loan/note.php diff --git a/htdocs/core/lib/loan.lib.php b/htdocs/core/lib/loan.lib.php index 9dbb2a9664b..ad578c2e7d3 100644 --- a/htdocs/core/lib/loan.lib.php +++ b/htdocs/core/lib/loan.lib.php @@ -41,16 +41,6 @@ function loan_prepare_head($object) $head[$tab][2] = 'card'; $tab++; - if (empty($conf->global->MAIN_DISABLE_NOTES_TAB)) - { - $nbNote = (empty($object->note_private)?0:1)+(empty($object->note_public)?0:1); - $head[$tab][0] = DOL_URL_ROOT."/loan/note.php?id=".$object->id; - $head[$tab][1] = $langs->trans("Notes"); - if($nbNote > 0) $head[$tab][1].= ' '.$nbNote.''; - $head[$tab][2] = 'note'; - $tab++; - } - // Show more tabs from modules // Entries must be declared in modules descriptor with line // $this->tabs = array('entity:+tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to add new tab diff --git a/htdocs/loan/note.php b/htdocs/loan/note.php deleted file mode 100644 index 969d5ecb436..00000000000 --- a/htdocs/loan/note.php +++ /dev/null @@ -1,101 +0,0 @@ - - * Copyright (C) 2004-2007 Laurent Destailleur - * Copyright (C) 2005-2012 Regis Houssin - * Copyright (C) 2013 Florian Henry - * Copyright (C) 2015 Frederic France - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -/** - * \file htdocs/loan/note.php - * \brief Tab for notes on loan - * \ingroup loan - */ - -require '../main.inc.php'; -require_once(DOL_DOCUMENT_ROOT.'/loan/class/loan.class.php'); -require_once DOL_DOCUMENT_ROOT.'/core/lib/loan.lib.php'; - -$action = GETPOST('action'); - -$langs->load('loan'); - -// Security check -$id = GETPOST('id','int'); -$result = restrictedArea($user, 'loan', $id, '&loan'); - -$object = new Loan($db); -if ($id > 0) $object->fetch($id); - -$permissionnote=$user->rights->loan->write; // Used by the include of actions_setnotes.inc.php - - -/* - * Actions - */ - -include DOL_DOCUMENT_ROOT.'/core/actions_setnotes.inc.php'; // Must be include, not include_once - - -/* - * View - */ - -$form = new Form($db); - -llxHeader('',$langs->trans("LoanArea"),''); - -if ($id > 0) -{ - /* - * Affichage onglets - */ - - $head = loan_prepare_head($object); - - dol_fiche_head($head, 'note', $langs->trans("Loan"), 0, 'bill'); - - - print '
'; - print ''; - - print ''; - - // Ref - print ''; - print ''; - // Name - print ''; - print ''; - - print "
'.$langs->trans('Ref').''; - print $form->showrefnav($object,'id','',1,'rowid','ref'); - print '
'.$langs->trans("Name").''.$object->label.'
"; - - print '
'; - - //$colwidth='25'; - $cssclass='titlefield'; - $permission = $user->rights->loan->write; // Used by the include of notes.tpl.php - include DOL_DOCUMENT_ROOT.'/core/tpl/notes.tpl.php'; - - - dol_fiche_end(); -} - -llxFooter(); -$db->close(); - From bc92818c1a491a7105313cfbc1fec36dbb591b20 Mon Sep 17 00:00:00 2001 From: aspangaro Date: Sun, 5 Jun 2016 15:39:41 +0200 Subject: [PATCH 06/50] New: Loan - Show accounting account in card in view mode --- htdocs/loan/card.php | 33 ++++++++++++++++++++++++++++++++ htdocs/loan/class/loan.class.php | 29 ++++++++++++++++------------ 2 files changed, 50 insertions(+), 12 deletions(-) diff --git a/htdocs/loan/card.php b/htdocs/loan/card.php index 88bf17d5e57..ef1022da306 100644 --- a/htdocs/loan/card.php +++ b/htdocs/loan/card.php @@ -405,6 +405,39 @@ if ($id > 0) // Note Public print ''.$langs->trans('NotePublic').''.nl2br($object->note_public).''; + // Accountancy account capital + print ''; + print $langs->trans("LoanAccountancyCapitalCode"); + print ''; + if (! empty($conf->accounting->enabled)) { + print length_accountg($object->account_capital); + } else { + print $object->account_capital; + } + print ''; + + // Accountancy account insurance + print ''; + print $langs->trans("LoanAccountancyInsuranceCode"); + print ''; + if (! empty($conf->accounting->enabled)) { + print length_accountg($object->account_insurance); + } else { + print $object->account_insurance; + } + print ''; + + // Accountancy account interest + print ''; + print $langs->trans("LoanAccountancyInterestCode"); + print ''; + if (! empty($conf->accounting->enabled)) { + print length_accountg($object->account_interest); + } else { + print $object->account_interest; + } + print ''; + // Status print ''.$langs->trans("Status").''.$object->getLibStatut(4, $totalpaye).''; diff --git a/htdocs/loan/class/loan.class.php b/htdocs/loan/class/loan.class.php index 66809b60720..60d4050148a 100644 --- a/htdocs/loan/class/loan.class.php +++ b/htdocs/loan/class/loan.class.php @@ -72,7 +72,7 @@ class Loan extends CommonObject function fetch($id) { $sql = "SELECT l.rowid, l.label, l.capital, l.datestart, l.dateend, l.nbterm, l.rate, l.note_private, l.note_public,"; - $sql.= " l.paid"; + $sql.= " l.paid, l.accountancy_account_capital, l.accountancy_account_insurance, l.accountancy_account_interest"; $sql.= " FROM ".MAIN_DB_PREFIX."loan as l"; $sql.= " WHERE l.rowid = ".$id; @@ -84,17 +84,22 @@ class Loan extends CommonObject { $obj = $this->db->fetch_object($resql); - $this->id = $obj->rowid; - $this->ref = $obj->rowid; - $this->datestart = $this->db->jdate($obj->datestart); - $this->dateend = $this->db->jdate($obj->dateend); - $this->label = $obj->label; - $this->capital = $obj->capital; - $this->nbterm = $obj->nbterm; - $this->rate = $obj->rate; - $this->note_private = $obj->note_private; - $this->note_public = $obj->note_public; - $this->paid = $obj->paid; + $this->id = $obj->rowid; + $this->ref = $obj->rowid; + $this->datestart = $this->db->jdate($obj->datestart); + $this->dateend = $this->db->jdate($obj->dateend); + $this->label = $obj->label; + $this->capital = $obj->capital; + $this->nbterm = $obj->nbterm; + $this->rate = $obj->rate; + $this->note_private = $obj->note_private; + $this->note_public = $obj->note_public; + $this->paid = $obj->paid; + + $this->account_capital = $obj->accountancy_account_capital; + $this->account_insurance = $obj->accountancy_account_insurance; + $this->account_interest = $obj->accountancy_account_interest; + return 1; } From 3b3567a71810242f35b8da0f11bde1e59c05fdf8 Mon Sep 17 00:00:00 2001 From: aspangaro Date: Sun, 5 Jun 2016 15:50:32 +0200 Subject: [PATCH 07/50] Fix: colspan --- htdocs/compta/tva/reglement.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/compta/tva/reglement.php b/htdocs/compta/tva/reglement.php index f6dd0be53c2..81fc72f33ef 100644 --- a/htdocs/compta/tva/reglement.php +++ b/htdocs/compta/tva/reglement.php @@ -211,7 +211,7 @@ if ($result) $i++; } - print ''.$langs->trans("Total").''; + print ''.$langs->trans("Total").''; print "".price($total).""; print " "; From bfb212f61a9e98b4144ce0d12ba3f0be8c119444 Mon Sep 17 00:00:00 2001 From: aspangaro Date: Sun, 5 Jun 2016 16:08:40 +0200 Subject: [PATCH 08/50] Fix: Loan - Add dol_fiche --- htdocs/loan/card.php | 2 +- htdocs/loan/index.php | 2 +- htdocs/loan/payment/payment.php | 16 ++++++++-------- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/htdocs/loan/card.php b/htdocs/loan/card.php index ef1022da306..57d03556bd4 100644 --- a/htdocs/loan/card.php +++ b/htdocs/loan/card.php @@ -1,5 +1,5 @@ +/* Copyright (C) 2014-2016 Alexandre Spangaro * Copyright (C) 2015 Frederic France * * This program is free software; you can redistribute it and/or modify diff --git a/htdocs/loan/index.php b/htdocs/loan/index.php index 51f4e74e119..655372516b9 100644 --- a/htdocs/loan/index.php +++ b/htdocs/loan/index.php @@ -2,7 +2,7 @@ /* Copyright (C) 2014 Alexandre Spangaro * Copyright (C) 2015 Frederic France * Copyright (C) 2015 Juanjo Menent - * Copyright (C) 2016 Laurent Destailleur + * Copyright (C) 2016 Laurent Destailleur * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/htdocs/loan/payment/payment.php b/htdocs/loan/payment/payment.php index 06061da5c22..8c9f850ebcc 100644 --- a/htdocs/loan/payment/payment.php +++ b/htdocs/loan/payment/payment.php @@ -1,5 +1,5 @@ +/* Copyright (C) 2014-2016 Alexandre Spangaro * Copyright (C) 2015 Frederic France * * This program is free software; you can redistribute it and/or modify @@ -152,12 +152,11 @@ $form=new Form($db); // Form to create loan's payment -if ($_GET["action"] == 'create') +if ($action == 'create') { $total = $loan->capital; print load_fiche_titre($langs->trans("DoPayment")); - print "
\n"; print ''; print ''; @@ -165,6 +164,8 @@ if ($_GET["action"] == 'create') print ''; print ''; + dol_fiche_head(); + print ''; print ''; @@ -230,9 +231,10 @@ if ($_GET["action"] == 'create') print ''; print ''; print ''; + print '
'.$langs->trans("Loan").''.$langs->trans("NotePublic").'
'; - print '
'; + dol_fiche_end(); print ''; print ''; @@ -296,13 +298,11 @@ if ($_GET["action"] == 'create') print '
'; - print '
'; - + print '
'; print ''; print '   '; print ''; - - print '
'; + print ''; print "\n"; } From e911b32b838ab93d40c226c2d21f543cffad8350 Mon Sep 17 00:00:00 2001 From: aspangaro Date: Sun, 5 Jun 2016 16:15:04 +0200 Subject: [PATCH 09/50] Fix: Loan - Totalpaid (Only the capital is deducted from the amount of loan to be paid off) --- htdocs/loan/card.php | 10 ++++------ htdocs/loan/payment/payment.php | 2 +- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/htdocs/loan/card.php b/htdocs/loan/card.php index 57d03556bd4..31de81d8b9b 100644 --- a/htdocs/loan/card.php +++ b/htdocs/loan/card.php @@ -116,9 +116,9 @@ if ($action == 'add' && $user->rights->loan->write) $object->note_private = GETPOST('note_private'); $object->note_public = GETPOST('note_public'); - $accountancy_account_capital = GETPOST('accountancy_account_capital'); - $accountancy_account_insurance = GETPOST('accountancy_account_insurance'); - $accountancy_account_interest = GETPOST('accountancy_account_interest'); + $accountancy_account_capital = GETPOST('accountancy_account_capital'); + $accountancy_account_insurance = GETPOST('accountancy_account_insurance'); + $accountancy_account_interest = GETPOST('accountancy_account_interest'); if ($accountancy_account_capital <= 0) { $object->account_capital = ''; } else { $object->account_capital = $accountancy_account_capital; } if ($accountancy_account_insurance <= 0) { $object->account_insurance = ''; } else { $object->account_insurance = $accountancy_account_insurance; } @@ -507,13 +507,11 @@ if ($id > 0) print ''.price($objp->amount_interest, 0, $langs, 0, 0, -1, $conf->currency)."\n"; print ''.price($objp->amount_capital, 0, $langs, 0, 0, -1, $conf->currency)."\n"; print ""; - $total_insurance += $objp->amount_insurance; - $total_interest += $objp->amount_interest; $total_capital += $objp->amount_capital; $i++; } - $totalpaid = $total_insurance + $total_interest + $total_capital; + $totalpaid = $total_capital; if ($object->paid == 0) { diff --git a/htdocs/loan/payment/payment.php b/htdocs/loan/payment/payment.php index 8c9f850ebcc..e735480e414 100644 --- a/htdocs/loan/payment/payment.php +++ b/htdocs/loan/payment/payment.php @@ -138,7 +138,7 @@ if ($action == 'add_payment') } } - $_GET["action"]='create'; + $action = 'create'; } From ff23c825aec2e6cce5373499a3dfcff95e9eaea7 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 6 Jun 2016 10:58:23 +0200 Subject: [PATCH 10/50] Code comment --- htdocs/core/lib/functions.lib.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 34e52b3c205..5864cbfa0da 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -4128,8 +4128,7 @@ function yn($yesno, $case=1, $color=0) /** * Return a path to have a directory according to object. * New usage: $conf->product->multidir_output[$object->entity].'/'.get_exdir(0, 0, 0, 1, $object, 'modulepart') - * Old usage: '001' with level 3->"0/0/1/", '015' with level 3->"0/1/5/" - * Old usage: 'ABC-1' with level 3 ->"0/0/1/", '015' with level 1->"5/" + * Old usage: '015' with level 3->"0/1/5/", '015' with level 1->"5/", 'ABC-1' with level 3 ->"0/0/1/" * * @param string $num Id of object (deprecated, $object will be used in future) * @param int $level Level of subdirs to return (1, 2 or 3 levels). (deprecated, global option will be used in future) From 9eee61e6b7c1702c97981c4535e446c45aa4ee6a Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 6 Jun 2016 11:13:19 +0200 Subject: [PATCH 11/50] Fix trans --- htdocs/comm/mailing/cibles.php | 2 +- htdocs/langs/en_US/main.lang | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/comm/mailing/cibles.php b/htdocs/comm/mailing/cibles.php index 2ce7d5c110d..56dfd753911 100644 --- a/htdocs/comm/mailing/cibles.php +++ b/htdocs/comm/mailing/cibles.php @@ -558,7 +558,7 @@ if ($object->fetch($id) >= 0) { if ($object->statut < 2) { - print ''; + print ''; print $langs->trans("NoTargetYet"); print ''; } diff --git a/htdocs/langs/en_US/main.lang b/htdocs/langs/en_US/main.lang index fef4e55ad21..1ee858aa23d 100644 --- a/htdocs/langs/en_US/main.lang +++ b/htdocs/langs/en_US/main.lang @@ -142,7 +142,7 @@ Update=Update AddActionToDo=Add event to do AddActionDone=Add event done Close=Close -CloseBox=Remove box from your dashboard +CloseBox=Remove widget from your dashboard Confirm=Confirm ConfirmSendCardByMail=Do you really want to send content of this card by mail to %s ? Delete=Delete @@ -611,7 +611,7 @@ RecordsModified=%s records modified AutomaticCode=Automatic code NotManaged=Not managed FeatureDisabled=Feature disabled -MoveBox=Move box %s +MoveBox=Move widget Offered=Offered NotEnoughPermissions=You don't have permission for this action SessionName=Session name From a0458be943b027bf8a41c1f734b748b5391e84d5 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 6 Jun 2016 11:25:54 +0200 Subject: [PATCH 12/50] Fix object not defined --- htdocs/compta/facture/class/facture-rec.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/compta/facture/class/facture-rec.class.php b/htdocs/compta/facture/class/facture-rec.class.php index f1cae70fec5..2bcd227827e 100644 --- a/htdocs/compta/facture/class/facture-rec.class.php +++ b/htdocs/compta/facture/class/facture-rec.class.php @@ -962,7 +962,7 @@ class FactureRec extends CommonInvoice if ($this->db->query($sql)) { $this->date_when = $date; - if ($increment_nb_gen_done>0) $_facrec->nb_gen_done++; + if ($increment_nb_gen_done>0) $this->nb_gen_done++; return 1; } else From 9c88eadbe45efbeb7a821425ad1e28825d179918 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 6 Jun 2016 11:48:39 +0200 Subject: [PATCH 13/50] Fix: button to generate invoice manually must be disabled if we reach max number of generation. --- htdocs/compta/facture/fiche-rec.php | 25 ++++++++++++++++--------- 1 file changed, 16 insertions(+), 9 deletions(-) diff --git a/htdocs/compta/facture/fiche-rec.php b/htdocs/compta/facture/fiche-rec.php index 8118cbea1ac..0e0bc1d474b 100644 --- a/htdocs/compta/facture/fiche-rec.php +++ b/htdocs/compta/facture/fiche-rec.php @@ -1269,7 +1269,7 @@ else // Nb of generation already done print ''.$langs->trans("NbOfGenerationDone").''; print ''; - print $object->nb_gen_done?$object->nb_gen_done:''; + print $object->nb_gen_done?$object->nb_gen_done:'0'; print ''; print ''; @@ -1338,14 +1338,21 @@ else //{ if ($user->rights->facture->creer) { - if (empty($object->frequency) || $object->date_when <= $today) - { - print ''; - } - else - { - print ''; - } + if (! empty($object->frequency) && $object->nb_gen_max > 0 && ($object->nb_gen_done >= $object->nb_gen_max)) + { + print ''; + } + else + { + if (empty($object->frequency) || $object->date_when <= $today) + { + print ''; + } + else + { + print ''; + } + } } else { From 68fa27ec03388cb41bcdf1ecd710fd663e59f0d8 Mon Sep 17 00:00:00 2001 From: Your Name Date: Mon, 6 Jun 2016 12:00:24 +0200 Subject: [PATCH 14/50] Fix: Missing userid on query --- htdocs/compta/resultat/clientfourn.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/compta/resultat/clientfourn.php b/htdocs/compta/resultat/clientfourn.php index 9b4d37d6335..df9cf03a30c 100644 --- a/htdocs/compta/resultat/clientfourn.php +++ b/htdocs/compta/resultat/clientfourn.php @@ -629,7 +629,7 @@ if (! empty($conf->expensereport->enabled)) { $langs->load('trips'); if ($modecompta == 'CREANCES-DETTES') { - $sql = "SELECT p.rowid, p.ref, u.firstname, u.lastname, date_format(date_valid,'%Y-%m') as dm, sum(p.total_ht) as amount_ht,sum(p.total_ttc) as amount_ttc"; + $sql = "SELECT p.rowid, p.ref, u.rowid as userid, u.firstname, u.lastname, date_format(date_valid,'%Y-%m') as dm, sum(p.total_ht) as amount_ht,sum(p.total_ttc) as amount_ttc"; $sql.= " FROM ".MAIN_DB_PREFIX."expensereport as p"; $sql.= " INNER JOIN ".MAIN_DB_PREFIX."user as u ON u.rowid=p.fk_user_author"; $sql.= " WHERE p.entity = ".getEntity('expensereport',1); From 681249de8a735ca0c36dba078810545bcc3742df Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 6 Jun 2016 12:29:15 +0200 Subject: [PATCH 15/50] Debug module resource --- htdocs/core/lib/resource.lib.php | 6 ++++-- htdocs/core/lib/sendings.lib.php | 15 ++++++++++----- htdocs/install/mysql/data/llx_c_type_contact.sql | 13 ++++++++----- htdocs/install/mysql/migration/3.9.0-4.0.0.sql | 3 +++ htdocs/resource/card.php | 8 ++++---- htdocs/resource/contact.php | 2 +- htdocs/resource/document.php | 4 ++-- htdocs/resource/note.php | 4 +++- 8 files changed, 35 insertions(+), 20 deletions(-) diff --git a/htdocs/core/lib/resource.lib.php b/htdocs/core/lib/resource.lib.php index 621cf800d99..58fffbae5b7 100644 --- a/htdocs/core/lib/resource.lib.php +++ b/htdocs/core/lib/resource.lib.php @@ -42,8 +42,10 @@ function resource_prepare_head($object) if (empty($conf->global->MAIN_DISABLE_CONTACTS_TAB)) { - $head[$h][0] = DOL_URL_ROOT.'/resource/contact.php?id='.$object->id; - $head[$h][1] = $langs->trans('Contact'); + $nbContact = count($object->liste_contact(-1,'internal')) + count($object->liste_contact(-1,'external')); + $head[$h][0] = DOL_URL_ROOT.'/resource/contact.php?id='.$object->id; + $head[$h][1] = $langs->trans('ContactsAddresses'); + if ($nbContact > 0) $head[$h][1].= ' '.$nbContact.''; $head[$h][2] = 'contact'; $h++; } diff --git a/htdocs/core/lib/sendings.lib.php b/htdocs/core/lib/sendings.lib.php index 52e0b9b9e96..2c362a42c2c 100644 --- a/htdocs/core/lib/sendings.lib.php +++ b/htdocs/core/lib/sendings.lib.php @@ -62,11 +62,16 @@ function shipping_prepare_head($object) } } - $head[$h][0] = DOL_URL_ROOT."/expedition/contact.php?id=".$object->id; - $head[$h][1] = $langs->trans("ContactsAddresses"); - $head[$h][2] = 'contact'; - $h++; - + if (empty($conf->global->MAIN_DISABLE_CONTACTS_TAB)) + { + $nbContact = count($object->liste_contact(-1,'internal')) + count($object->liste_contact(-1,'external')); + $head[$h][0] = DOL_URL_ROOT."/expedition/contact.php?id=".$object->id; + $head[$h][1] = $langs->trans("ContactsAddresses"); + if ($nbContact > 0) $head[$h][1].= ' '.$nbContact.''; + $head[$h][2] = 'contact'; + $h++; + } + $nbNote = 0; if (!empty($object->note_private)) $nbNote++; if (!empty($object->note_public)) $nbNote++; diff --git a/htdocs/install/mysql/data/llx_c_type_contact.sql b/htdocs/install/mysql/data/llx_c_type_contact.sql index 4acc8e467c5..a0b36634ce1 100644 --- a/htdocs/install/mysql/data/llx_c_type_contact.sql +++ b/htdocs/install/mysql/data/llx_c_type_contact.sql @@ -64,11 +64,14 @@ insert into llx_c_type_contact(rowid, element, source, code, libelle, active ) v insert into llx_c_type_contact(rowid, element, source, code, libelle, active ) values (130, 'fichinter','external', 'BILLING', 'Contact client facturation intervention', 1); insert into llx_c_type_contact(rowid, element, source, code, libelle, active ) values (131, 'fichinter','external', 'CUSTOMER', 'Contact client suivi de l''intervention', 1); -insert into llx_c_type_contact(rowid, element, source, code, libelle, active ) values (140,'order_supplier','internal', 'SALESREPFOLL', 'Responsable suivi de la commande', 1); -insert into llx_c_type_contact(rowid, element, source, code, libelle, active ) values (141,'order_supplier','internal', 'SHIPPING', 'Responsable réception de la commande', 1); -insert into llx_c_type_contact(rowid, element, source, code, libelle, active ) values (142,'order_supplier','external', 'BILLING', 'Contact fournisseur facturation commande', 1); -insert into llx_c_type_contact(rowid, element, source, code, libelle, active ) values (143,'order_supplier','external', 'CUSTOMER', 'Contact fournisseur suivi commande', 1); -insert into llx_c_type_contact(rowid, element, source, code, libelle, active ) values (145,'order_supplier','external', 'SHIPPING', 'Contact fournisseur livraison commande', 1); +insert into llx_c_type_contact(rowid, element, source, code, libelle, active ) values (140, 'order_supplier','internal', 'SALESREPFOLL', 'Responsable suivi de la commande', 1); +insert into llx_c_type_contact(rowid, element, source, code, libelle, active ) values (141, 'order_supplier','internal', 'SHIPPING', 'Responsable réception de la commande', 1); +insert into llx_c_type_contact(rowid, element, source, code, libelle, active ) values (142, 'order_supplier','external', 'BILLING', 'Contact fournisseur facturation commande', 1); +insert into llx_c_type_contact(rowid, element, source, code, libelle, active ) values (143, 'order_supplier','external', 'CUSTOMER', 'Contact fournisseur suivi commande', 1); +insert into llx_c_type_contact(rowid, element, source, code, libelle, active ) values (145, 'order_supplier','external', 'SHIPPING', 'Contact fournisseur livraison commande', 1); + +insert into llx_c_type_contact(rowid, element, source, code, libelle, active ) values (150, 'dolresource','internal', 'USERINCHARGE', 'In charge of resource', 1); +insert into llx_c_type_contact(rowid, element, source, code, libelle, active ) values (151, 'dolresource','external', 'THIRDINCHARGE', 'In charge of resource', 1); -- All project code must start with 'PROJECT' insert into llx_c_type_contact(rowid, element, source, code, libelle, active ) values (160, 'project', 'internal', 'PROJECTLEADER', 'Chef de Projet', 1); diff --git a/htdocs/install/mysql/migration/3.9.0-4.0.0.sql b/htdocs/install/mysql/migration/3.9.0-4.0.0.sql index 4aae6de71e6..1ddc7479bcb 100644 --- a/htdocs/install/mysql/migration/3.9.0-4.0.0.sql +++ b/htdocs/install/mysql/migration/3.9.0-4.0.0.sql @@ -39,6 +39,9 @@ ALTER TABLE llx_opensurvey_sondage ADD COLUMN status integer DEFAULT 1 after dat ALTER TABLE llx_expedition ADD COLUMN billed smallint DEFAULT 0; +insert into llx_c_type_contact(rowid, element, source, code, libelle, active ) values (150, 'dolresource','internal', 'USERINCHARGE', 'In charge of resource', 1); +insert into llx_c_type_contact(rowid, element, source, code, libelle, active ) values (151, 'dolresource','external', 'THIRDINCHARGE', 'In charge of resource', 1); + -- DROP TABLE llx_product_lot; CREATE TABLE llx_product_lot ( rowid integer AUTO_INCREMENT PRIMARY KEY, diff --git a/htdocs/resource/card.php b/htdocs/resource/card.php index 163eeab13ce..d803ec774fd 100644 --- a/htdocs/resource/card.php +++ b/htdocs/resource/card.php @@ -173,17 +173,17 @@ if ( $object->fetch($id) > 0 ) print ''; // Ref - print ''; + print ''; print ''; // Type - print ''; + print ''; print ''; // Description - print ''; + print ''; print ''; @@ -215,7 +215,7 @@ if ( $object->fetch($id) > 0 ) */ print '
'.$langs->trans("ResourceFormLabel_ref").'
'.$langs->trans("ResourceFormLabel_ref").'
'.$langs->trans("ResourceType").'
'.$langs->trans("ResourceType").''; $ret = $formresource->select_types_resource($object->fk_code_type_resource,'fk_code_type_resource','',2); print '
'.$langs->trans("Description").'
'.$langs->trans("Description").''; print ''; print '
'; - print ''; diff --git a/htdocs/resource/contact.php b/htdocs/resource/contact.php index d635ee2e1e6..cadde67eba3 100644 --- a/htdocs/resource/contact.php +++ b/htdocs/resource/contact.php @@ -127,7 +127,7 @@ if ($id > 0 || ! empty($ref)) */ print '
'.$langs->trans("ResourceFormLabel_ref").''; + print '
'.$langs->trans("ResourceFormLabel_ref").''; $linkback = $objet->ref.' '.$langs->trans("BackToList").''; print $form->showrefnav($object, 'id', $linkback,1,"rowid"); print '
'; - print ''; diff --git a/htdocs/resource/document.php b/htdocs/resource/document.php index a21bc88c319..8e39c64e2c9 100644 --- a/htdocs/resource/document.php +++ b/htdocs/resource/document.php @@ -89,7 +89,7 @@ if ($object->id) $head=resource_prepare_head($object); - dol_fiche_head($head, 'documents', $langs->trans("ResourceSingular"), 0, 'resource'); + dol_fiche_head($head, 'documents', $langs->trans("ResourceSingular"), 0, 'resource@resource'); // Construit liste des fichiers @@ -104,7 +104,7 @@ if ($object->id) print '
'.$langs->trans("ResourceFormLabel_ref").''; + print '
'.$langs->trans("ResourceFormLabel_ref").''; $linkback = $objet->ref.' '.$langs->trans("BackToList").''; print $form->showrefnav($object, 'id', $linkback,1,"rowid"); print '
'; - print ''; diff --git a/htdocs/resource/note.php b/htdocs/resource/note.php index e404a3bdef8..1f277688957 100644 --- a/htdocs/resource/note.php +++ b/htdocs/resource/note.php @@ -1,8 +1,9 @@ * Copyright (C) 2011-2012 Juanjo Menent + * Copyright (C) 2016 Laurent Destailleur * Copyright (C) 2013 Florian Henry - * Copyright (C) 2016 Gilles Poirier + * Copyright (C) 2016 Gilles Poirier * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -44,6 +45,7 @@ $object->fetch($id,$ref); $permissionnote=$user->rights->resource->write; // Used by the include of actions_setnotes.inc.php + /* * Actions */ From 9b6e5196ea32cdfac734b6298613a537122f44d8 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 6 Jun 2016 13:05:36 +0200 Subject: [PATCH 16/50] Debug module resource. Filter on agenda. --- htdocs/comm/action/index.php | 8 +++++-- htdocs/comm/action/listactions.php | 8 ++++++- htdocs/comm/action/pertype.php | 9 ++++++-- htdocs/comm/action/peruser.php | 9 ++++++-- htdocs/core/lib/agenda.lib.php | 21 ++++++++++++++++--- .../class/html.formresource.class.php | 5 +++-- 6 files changed, 48 insertions(+), 12 deletions(-) diff --git a/htdocs/comm/action/index.php b/htdocs/comm/action/index.php index d9990ef7525..addcb26fe17 100644 --- a/htdocs/comm/action/index.php +++ b/htdocs/comm/action/index.php @@ -78,7 +78,7 @@ if (! $user->rights->agenda->allactions->read || $filter =='mine') // If no per } $action=GETPOST('action','alpha'); -//$year=GETPOST("year"); +$resourceid=GETPOST("resourceid","int"); $year=GETPOST("year","int")?GETPOST("year","int"):date("Y"); $month=GETPOST("month","int")?GETPOST("month","int"):date("m"); $week=GETPOST("week","int")?GETPOST("week","int"):date("W"); @@ -292,6 +292,7 @@ if ($status == 'todo') $title=$langs->trans("ToDoActions"); $param=''; if ($actioncode || isset($_GET['actioncode']) || isset($_POST['actioncode'])) $param.="&actioncode=".$actioncode; +if ($resourceid > 0) $param.="&resourceid=".$resourceid; if ($status || isset($_GET['status']) || isset($_POST['status'])) $param.="&status=".$status; if ($filter) $param.="&filter=".$filter; if ($filtert) $param.="&filtert=".$filtert; @@ -349,7 +350,7 @@ $paramnoaction=preg_replace('/action=[a-z_]+/','',$param); $head = calendars_prepare_head($paramnoaction); dol_fiche_head($head, $tabactive, $langs->trans('Agenda'), 0, 'action'); -print_actions_filter($form,$canedit,$status,$year,$month,$day,$showbirthday,0,$filtert,0,$pid,$socid,$action,$listofextcals,$actioncode,$usergroup); +print_actions_filter($form,$canedit,$status,$year,$month,$day,$showbirthday,0,$filtert,0,$pid,$socid,$action,$listofextcals,$actioncode,$usergroup,'', $resourceid); dol_fiche_end(); @@ -442,12 +443,15 @@ $sql.= ' a.fk_soc, a.fk_contact,'; $sql.= ' ca.code as type_code, ca.libelle as type_label'; $sql.= ' FROM '.MAIN_DB_PREFIX.'c_actioncomm as ca, '.MAIN_DB_PREFIX."actioncomm as a"; if (! $user->rights->societe->client->voir && ! $socid) $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe_commerciaux as sc ON a.fk_soc = sc.fk_soc"; +// We must filter on resource table +if ($resourceid > 0) $sql.=", ".MAIN_DB_PREFIX."element_resources as r"; // We must filter on assignement table if ($filtert > 0 || $usergroup > 0) $sql.=", ".MAIN_DB_PREFIX."actioncomm_resources as ar"; if ($usergroup > 0) $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."usergroup_user as ugu ON ugu.fk_user = ar.fk_element"; $sql.= ' WHERE a.fk_action = ca.id'; $sql.= ' AND a.entity IN ('.getEntity('agenda', 1).')'; if ($actioncode) $sql.=" AND ca.code IN ('".implode("','", explode(',',$actioncode))."')"; +if ($resourceid > 0) $sql.=" AND r.element_type = 'action' AND r.element_id = a.id AND r.resource_id = ".$db->escape($resourceid); if ($pid) $sql.=" AND a.fk_project=".$db->escape($pid); if (! $user->rights->societe->client->voir && ! $socid) $sql.= " AND (a.fk_soc IS NULL OR sc.fk_user = " .$user->id . ")"; if ($socid > 0) $sql.= ' AND a.fk_soc = '.$socid; diff --git a/htdocs/comm/action/listactions.php b/htdocs/comm/action/listactions.php index 4cae6d5c4d0..e6ad597192a 100644 --- a/htdocs/comm/action/listactions.php +++ b/htdocs/comm/action/listactions.php @@ -36,6 +36,7 @@ $langs->load("agenda"); $langs->load("commercial"); $action=GETPOST('action','alpha'); +$resourceid=GETPOST("resourceid","int"); $year=GETPOST("year",'int'); $month=GETPOST("month",'int'); $day=GETPOST("day",'int'); @@ -156,6 +157,7 @@ $listofextcals=array(); $param=''; if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.$limit; if ($actioncode != '') $param.="&actioncode=".$actioncode; +if ($resourceid > 0) $param.="&resourceid=".$resourceid; if ($status || isset($_GET['status']) || isset($_POST['status'])) $param.="&status=".$status; if ($filter) $param.="&filter=".$filter; if ($filtert) $param.="&filtert=".$filtert; @@ -178,12 +180,15 @@ $sql.= " FROM ".MAIN_DB_PREFIX."c_actioncomm as c, ".MAIN_DB_PREFIX."actioncomm if (! $user->rights->societe->client->voir && ! $socid) $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe_commerciaux as sc ON a.fk_soc = sc.fk_soc"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON a.fk_soc = s.rowid"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."socpeople as sp ON a.fk_contact = sp.rowid"; +// We must filter on resource table +if ($resourceid > 0) $sql.=", ".MAIN_DB_PREFIX."element_resources as r"; // We must filter on assignement table if ($filtert > 0 || $usergroup > 0) $sql.=", ".MAIN_DB_PREFIX."actioncomm_resources as ar"; if ($usergroup > 0) $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."usergroup_user as ugu ON ugu.fk_user = ar.fk_element"; $sql.= " WHERE c.id = a.fk_action"; $sql.= ' AND a.entity IN ('.getEntity('agenda', 1).')'; if ($actioncode) $sql.=" AND c.code IN ('".$db->escape($actioncode)."')"; +if ($resourceid > 0) $sql.=" AND r.element_type = 'action' AND r.element_id = a.id AND r.resource_id = ".$db->escape($resourceid); if ($pid) $sql.=" AND a.fk_project=".$db->escape($pid); if (! $user->rights->societe->client->voir && ! $socid) $sql.= " AND (a.fk_soc IS NULL OR sc.fk_user = " .$user->id . ")"; if ($socid > 0) $sql.= " AND s.rowid = ".$socid; @@ -242,7 +247,7 @@ if ($resql) $head = calendars_prepare_head($param); dol_fiche_head($head, $tabactive, $langs->trans('Agenda'), 0, 'action'); - print_actions_filter($form,$canedit,$status,$year,$month,$day,$showbirthday,0,$filtert,0,$pid,$socid,$action,-1,$actioncode,$usergroup); + print_actions_filter($form,$canedit,$status,$year,$month,$day,$showbirthday,0,$filtert,0,$pid,$socid,$action,-1,$actioncode,$usergroup,'',$resourceid); dol_fiche_end(); // Add link to show birthdays @@ -288,6 +293,7 @@ if ($resql) $nav=''; if ($optioncss != '') $nav.= ''; if ($actioncode) $nav.=''; + if ($resourceid) $nav.=''; if ($status || isset($_GET['status']) || isset($_POST['status'])) $nav.=''; if ($filter) $nav.=''; if ($filtert) $nav.=''; diff --git a/htdocs/comm/action/pertype.php b/htdocs/comm/action/pertype.php index 28a531c6b28..6138e79cafd 100644 --- a/htdocs/comm/action/pertype.php +++ b/htdocs/comm/action/pertype.php @@ -76,7 +76,7 @@ if (! $user->rights->agenda->allactions->read || $filter =='mine') // If no per //$action=GETPOST('action','alpha'); $action='show_pertype'; -//$year=GETPOST("year"); +$resourceid=GETPOST("resourceid","int"); $year=GETPOST("year","int")?GETPOST("year","int"):date("Y"); $month=GETPOST("month","int")?GETPOST("month","int"):date("m"); $week=GETPOST("week","int")?GETPOST("week","int"):date("W"); @@ -202,6 +202,7 @@ if ($status == 'todo') $title=$langs->trans("ToDoActions"); $param=''; if ($actioncode || isset($_GET['actioncode']) || isset($_POST['actioncode'])) $param.="&actioncode=".$actioncode; +if ($resourceid > 0) $param.="&resourceid=".$resourceid; if ($status || isset($_GET['status']) || isset($_POST['status'])) $param.="&status=".$status; if ($filter) $param.="&filter=".$filter; if ($filtert) $param.="&filtert=".$filtert; @@ -252,6 +253,7 @@ $nav.=''; $nav.=''; $nav.=''; $nav.=''; +$nav.=''; $nav.=''; $nav.=''; $nav.=''; @@ -279,7 +281,7 @@ $paramnoaction=preg_replace('/action=[a-z_]+/','',$param); $head = calendars_prepare_head($paramnoaction); dol_fiche_head($head, $tabactive, $langs->trans('Agenda'), 0, 'action'); -print_actions_filter($form, $canedit, $status, $year, $month, $day, $showbirthday, 0, $filtert, 0, $pid, $socid, $action, $listofextcals, $actioncode, $usergroup); +print_actions_filter($form, $canedit, $status, $year, $month, $day, $showbirthday, 0, $filtert, 0, $pid, $socid, $action, $listofextcals, $actioncode, $usergroup, '', $resourceid); dol_fiche_end(); $showextcals=$listofextcals; @@ -356,12 +358,15 @@ $sql.= ' a.fk_soc, a.fk_contact, a.fk_element, a.elementtype,'; $sql.= ' ca.code, ca.color'; $sql.= ' FROM '.MAIN_DB_PREFIX.'c_actioncomm as ca, '.MAIN_DB_PREFIX."actioncomm as a"; if (! $user->rights->societe->client->voir && ! $socid) $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe_commerciaux as sc ON a.fk_soc = sc.fk_soc"; +// We must filter on resource table +if ($resourceid > 0) $sql.=", ".MAIN_DB_PREFIX."element_resources as r"; // We must filter on assignement table if ($filtert > 0 || $usergroup > 0) $sql.=", ".MAIN_DB_PREFIX."actioncomm_resources as ar"; if ($usergroup > 0) $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."usergroup_user as ugu ON ugu.fk_user = ar.fk_element"; $sql.= ' WHERE a.fk_action = ca.id'; $sql.= ' AND a.entity IN ('.getEntity('agenda', 1).')'; if ($actioncode) $sql.=" AND ca.code='".$db->escape($actioncode)."'"; +if ($resourceid > 0) $sql.=" AND r.element_type = 'action' AND r.element_id = a.id AND r.resource_id = ".$db->escape($resourceid); if ($pid) $sql.=" AND a.fk_project=".$db->escape($pid); if (! $user->rights->societe->client->voir && ! $socid) $sql.= " AND (a.fk_soc IS NULL OR sc.fk_user = " .$user->id . ")"; if ($socid > 0) $sql.= ' AND a.fk_soc = '.$socid; diff --git a/htdocs/comm/action/peruser.php b/htdocs/comm/action/peruser.php index 033c67839f0..cd5f7d10fa7 100644 --- a/htdocs/comm/action/peruser.php +++ b/htdocs/comm/action/peruser.php @@ -76,7 +76,7 @@ if (! $user->rights->agenda->allactions->read || $filter =='mine') // If no per //$action=GETPOST('action','alpha'); $action='show_peruser'; //We use 'show_week' mode -//$year=GETPOST("year"); +$resourceid=GETPOST("resourceid","int"); $year=GETPOST("year","int")?GETPOST("year","int"):date("Y"); $month=GETPOST("month","int")?GETPOST("month","int"):date("m"); $week=GETPOST("week","int")?GETPOST("week","int"):date("W"); @@ -202,6 +202,7 @@ if ($status == 'todo') $title=$langs->trans("ToDoActions"); $param=''; if ($actioncode || isset($_GET['actioncode']) || isset($_POST['actioncode'])) $param.="&actioncode=".$actioncode; +if ($resourceid > 0) $param.="&resourceid=".$resourceid; if ($status || isset($_GET['status']) || isset($_POST['status'])) $param.="&status=".$status; if ($filter) $param.="&filter=".$filter; if ($filtert) $param.="&filtert=".$filtert; @@ -255,6 +256,7 @@ $nav.=''; $nav.=''; $nav.=''; $nav.=''; +$nav.=''; $nav.=''; $nav.=''; $nav.=''; @@ -287,7 +289,7 @@ $paramnoaction=preg_replace('/action=[a-z_]+/','',$param); $head = calendars_prepare_head($paramnoaction); dol_fiche_head($head, $tabactive, $langs->trans('Agenda'), 0, 'action'); -print_actions_filter($form, $canedit, $status, $year, $month, $day, $showbirthday, 0, $filtert, 0, $pid, $socid, $action, $listofextcals, $actioncode, $usergroup); +print_actions_filter($form, $canedit, $status, $year, $month, $day, $showbirthday, 0, $filtert, 0, $pid, $socid, $action, $listofextcals, $actioncode, $usergroup, '', $resourceid); dol_fiche_end(); $showextcals=$listofextcals; @@ -364,12 +366,15 @@ $sql.= ' a.fk_soc, a.fk_contact, a.fk_element, a.elementtype,'; $sql.= ' ca.code, ca.color'; $sql.= ' FROM '.MAIN_DB_PREFIX.'c_actioncomm as ca, '.MAIN_DB_PREFIX."actioncomm as a"; if (! $user->rights->societe->client->voir && ! $socid) $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe_commerciaux as sc ON a.fk_soc = sc.fk_soc"; +// We must filter on resource table +if ($resourceid > 0) $sql.=", ".MAIN_DB_PREFIX."element_resources as r"; // We must filter on assignement table if ($filtert > 0 || $usergroup > 0) $sql.=", ".MAIN_DB_PREFIX."actioncomm_resources as ar"; if ($usergroup > 0) $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."usergroup_user as ugu ON ugu.fk_user = ar.fk_element"; $sql.= ' WHERE a.fk_action = ca.id'; $sql.= ' AND a.entity IN ('.getEntity('agenda', 1).')'; if ($actioncode) $sql.=" AND ca.code='".$db->escape($actioncode)."'"; +if ($resourceid > 0) $sql.=" AND r.element_type = 'action' AND r.element_id = a.id AND r.resource_id = ".$db->escape($resourceid); if ($pid) $sql.=" AND a.fk_project=".$db->escape($pid); if (! $user->rights->societe->client->voir && ! $socid) $sql.= " AND (a.fk_soc IS NULL OR sc.fk_user = " .$user->id . ")"; if ($socid > 0) $sql.= ' AND a.fk_soc = '.$socid; diff --git a/htdocs/core/lib/agenda.lib.php b/htdocs/core/lib/agenda.lib.php index ad40ba84938..cdc45de825e 100644 --- a/htdocs/core/lib/agenda.lib.php +++ b/htdocs/core/lib/agenda.lib.php @@ -41,12 +41,13 @@ * @param int $socid Third party id * @param string $action Action string * @param array $showextcals Array with list of external calendars (used to show links to select calendar), or -1 to show no legend - * @param string|array $actioncode Preselected value(s) of actioncode for filter on type + * @param string|array $actioncode Preselected value(s) of actioncode for filter on event type * @param int $usergroupid Id of group to filter on users - * @param string $excludetype A type to exclude ('systemauto', 'system', '') + * @param string $excludetype A type to exclude ('systemauto', 'system', '') + * @param int $resourceid Preselected value of resource for filter on resource * @return void */ -function print_actions_filter($form, $canedit, $status, $year, $month, $day, $showbirthday, $filtera, $filtert, $filterd, $pid, $socid, $action, $showextcals=array(), $actioncode='', $usergroupid='', $excludetype='') +function print_actions_filter($form, $canedit, $status, $year, $month, $day, $showbirthday, $filtera, $filtert, $filterd, $pid, $socid, $action, $showextcals=array(), $actioncode='', $usergroupid='', $excludetype='', $resourceid=0) { global $conf, $user, $langs, $db, $hookmanager; global $begin_h, $end_h, $begin_d, $end_d; @@ -80,6 +81,20 @@ function print_actions_filter($form, $canedit, $status, $year, $month, $day, $sh print $form->select_dolgroups($usergroupid, 'usergroup', 1, '', ! $canedit); print ''; + if ($conf->resource->enabled) + { + include_once DOL_DOCUMENT_ROOT . '/resource/class/html.formresource.class.php'; + $formresource=new FormResource($db); + + // Resource + print ''; + print ''; + } + include_once DOL_DOCUMENT_ROOT . '/core/class/html.formactions.class.php'; $formactions=new FormActions($db); diff --git a/htdocs/resource/class/html.formresource.class.php b/htdocs/resource/class/html.formresource.class.php index 891ed33d1e5..b094aacd1ea 100644 --- a/htdocs/resource/class/html.formresource.class.php +++ b/htdocs/resource/class/html.formresource.class.php @@ -17,11 +17,12 @@ */ /** - * \file place/class/html.formresource.class.php + * \file resource/class/html.formresource.class.php * \ingroup core * \brief Class file to manage forms into resource module */ require_once(DOL_DOCUMENT_ROOT ."/core/class/html.form.class.php"); +require_once(DOL_DOCUMENT_ROOT ."/resource/class/dolresource.class.php"); /** @@ -56,7 +57,7 @@ class FormResource /** * Output html form to select a resource * - * @param string $selected Preselected type + * @param int $selected Preselected resource id * @param string $htmlname Name of field in form * @param string $filter Optionnal filters criteras (example: 's.rowid <> x') * @param int $showempty Add an empty field From 52fefc2d025dd3a81dfa906c6db34474c6433a92 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 6 Jun 2016 13:14:05 +0200 Subject: [PATCH 17/50] Debug module resource --- htdocs/core/modules/modResource.class.php | 2 +- htdocs/resource/card.php | 4 ++-- htdocs/resource/class/dolresource.class.php | 2 +- htdocs/resource/contact.php | 2 +- htdocs/resource/document.php | 2 +- htdocs/resource/img/index.html | 0 htdocs/resource/img/object_resource.png | Bin 1232 -> 0 bytes htdocs/resource/img/resource.png | Bin 2473 -> 0 bytes htdocs/resource/list.php | 12 ++++-------- htdocs/resource/note.php | 2 +- 10 files changed, 11 insertions(+), 15 deletions(-) delete mode 100644 htdocs/resource/img/index.html delete mode 100644 htdocs/resource/img/object_resource.png delete mode 100644 htdocs/resource/img/resource.png diff --git a/htdocs/core/modules/modResource.class.php b/htdocs/core/modules/modResource.class.php index 82d57514623..90ff3280fee 100644 --- a/htdocs/core/modules/modResource.class.php +++ b/htdocs/core/modules/modResource.class.php @@ -119,7 +119,7 @@ class modResource extends DolibarrModules // Minimum version of PHP required by module $this->phpmin = array(5, 3); - $this->langfiles = array("resource@resource"); // langfiles@resource + $this->langfiles = array("resource"); // langfiles@resource // Constants // List of particular constants to add when module is enabled // (key, 'chaine', value, desc, visible, 'current' or 'allentities', deleteonunactive) diff --git a/htdocs/resource/card.php b/htdocs/resource/card.php index d803ec774fd..95f5cf0574b 100644 --- a/htdocs/resource/card.php +++ b/htdocs/resource/card.php @@ -168,7 +168,7 @@ if ( $object->fetch($id) > 0 ) print ''; print ''; - dol_fiche_head($head, 'resource', $langs->trans("ResourceSingular"),0,'resource@resource'); + dol_fiche_head($head, 'resource', $langs->trans("ResourceSingular"),0,'resource'); print '
'.$langs->trans("ResourceFormLabel_ref").''; + print '
'.$langs->trans("ResourceFormLabel_ref").''; $linkback = $objet->ref.' '.$langs->trans("BackToList").''; print $form->showrefnav($object, 'id', $linkback,1,"rowid"); print '
'; + print $langs->trans("Resource"); + print '  '; + print $formresource->select_resource_list($resourceid, "resourceid", '', 1, 0, 0, null, '', 2); + print '
'; @@ -201,7 +201,7 @@ if ( $object->fetch($id) > 0 ) } else { - dol_fiche_head($head, 'resource', $langs->trans("ResourceSingular"),0,'resource@resource'); + dol_fiche_head($head, 'resource', $langs->trans("ResourceSingular"),0,'resource'); // Confirm deleting resource line if ($action == 'delete') diff --git a/htdocs/resource/class/dolresource.class.php b/htdocs/resource/class/dolresource.class.php index 87794b92392..4f08e6f4209 100644 --- a/htdocs/resource/class/dolresource.class.php +++ b/htdocs/resource/class/dolresource.class.php @@ -875,7 +875,7 @@ class Dolresource extends CommonObject if ($option == '') { $link = ''; - $picto='resource@resource'; + $picto='resource'; $label=$langs->trans("ShowResource").': '.$this->ref; } diff --git a/htdocs/resource/contact.php b/htdocs/resource/contact.php index cadde67eba3..97dbb0de1be 100644 --- a/htdocs/resource/contact.php +++ b/htdocs/resource/contact.php @@ -119,7 +119,7 @@ if ($id > 0 || ! empty($ref)) $head = resource_prepare_head($object); - dol_fiche_head($head, 'contact', $langs->trans("ResourceSingular"), 0, 'resource@resource'); + dol_fiche_head($head, 'contact', $langs->trans("ResourceSingular"), 0, 'resource'); /* diff --git a/htdocs/resource/document.php b/htdocs/resource/document.php index 8e39c64e2c9..099fb4f7d2b 100644 --- a/htdocs/resource/document.php +++ b/htdocs/resource/document.php @@ -89,7 +89,7 @@ if ($object->id) $head=resource_prepare_head($object); - dol_fiche_head($head, 'documents', $langs->trans("ResourceSingular"), 0, 'resource@resource'); + dol_fiche_head($head, 'documents', $langs->trans("ResourceSingular"), 0, 'resource'); // Construit liste des fichiers diff --git a/htdocs/resource/img/index.html b/htdocs/resource/img/index.html deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/htdocs/resource/img/object_resource.png b/htdocs/resource/img/object_resource.png deleted file mode 100644 index 55f2e1bf9375acb1ca746b1fffa7ad56f7d5bf97..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1232 zcmV;>1TXuEP)PDYS?V-f(k2&U@$OV3a*03(Htar<3@zJ|5t6=Y7;Y3;(O(ylM%+H%ML(hG~-*$*CRNaJfbv7ezTw zJ|jm=UXXm}>WarNE*CuhblJ>imH~f|EERfK>0wbcOXLVST+*web07Clf@*nfm2;}y z7BWa64hagX*oF=pQO+_m``s67`%PU#T$ z6#xJL32;bRa{vGf5&!@T5&_cPe*6Fc03&)-Sae}^bZBpK004N}^GZ$3({(FK%zK`n zS*+leT2xdC07*gzje6?f?f?J++DSw~R5;6ZQcXw{VHkd9c6Qd;-I;ZN+%>l(lq`#+ z6zkNfOHp`^0*N4qphI-%P|zXp5CqXB3J*bn5NL&kmmt$_5f!qgW~&>nKfAN){?E=g zKYjC=QCcs&%*XqE^Stl#JTHeWvACFt1Ojp|$8o%E+XlB09@DgBjzff=8)?SrT|+YY zzt{ zB1F**It2*Pt!)4+D_Kt0345UH1`NZZX@F9|`g#$5zl4^SCid2;Z37ToqE)Tx;J`yC z4uHwhG)8-xL8*hGV5WXz#E&G=CWjB($1NMO{N6;A0MmqVrrp zI-P+m*UvG{fCIvn`wt(-W8Uuh*)gx`djvhNp*?m4^&uaKK~OAK7=Sa0W9`byD$3=G zn~mLd>1KPZx#dhKzPl}xisZ(hq!P_bJ!sk43R#g549ZXxAMGwO?whU<;n{`*D-Q9 z6cGhUae2~Y5_8rEB(yPn%8w%MYP0Hi*(_J8L{;h^eIfwr>*QrXlhTiL$4V+m(Q1k`T69)+FE+ymxy#FRlduY z^&lKjsAmPN76{U-tC&?YnEPBxzPsIbF&K()!CPDYS?V-f(k2&U@$OV3a*03(Htar<3@zJ|5t6=Y7;Y3;(O(ylM%+H%ML(hG~-*$*CRNaJfbv7ezTw zJ|jm=UXXm}>WarNE*CuhblJ>imH~f|EERfK>0wbcOXLVST+*web07Clf@*nfm2;}y z7BWa64hagX*oF=pQO+_m``s67`%PU#T$ z6#xJL32;bRa{vGf5&!@T5&_cPe*6Fc03&)-Sae}^bZBpK004N}^GZ$3({(FK%zK`n zS*+leT2xdC07*gzje6?f?f?J>vq?ljR9M5ES6gfxXBGbDK0CW>du?y**sd?RIK&Xr z0tP9KTA`{!LTQnTkl=xb7EuXRC=xFqK_7WRJfKqXK&1$U2r85SQIPV0P}Hhbt3pU< zl(b3gHi=_9zU)OAfw-r2dz z<=oHc@bz8*NS0;%NZ0kxSF1M20umWyO=LaG!;}a@$w2ShkUkJ17-G=905G?qiYscB0UTlE#LR~p!5PjJ$v@=((&UjV03hl;vGhoQ5;Fw z!VsRvoB7);WDvTpB9+o3z&lqMMy`>10U&?y!Gct+)-f=UZM&6{i!6@zh(N^mB-%J^ zxm}>q@CaNJeSPT&(9ZB6PMZIn1N1rzn$3Wu8KGxId}J@g=gD>0-kd?RV#ClQPjrW* z<$+!SNbR_>f^J2LVm|tQ=N@CYcdrg0qpcfw;~43M^zPVFC_2CJ?IyNTrdY* zyLPMX3Er?JW}-d8Gp;u`~gj zlx^!9`4dBsJBHLZzWda#hx$fm!}9u}f0Rz5JYnPaH!t8@2VTT*dJLfmT8d)j9Y7sE z=l}>JQB^H^{^5shLJfIDX z_CM*XHleSPa-vpA$C`5&nk%p?JAutYndm7bdLD|(i(?=2emb5 zvIvBuUHxM9N);vZ7LLppU@3zr1-GD96zu6cjC9t7ByaC*uG=K>sRJrxrP^k_cxI5v zQ)|?evecYB=>Y&t_ zm1=+eqvF4AoW{AMUpVspXP$m`@7(O?&^KsNHmlnvo4WS(XOh3vtK$EwuiN&@%>J_-XwyO@Hp7-wd)j&&9#}x}sYfl>PQq8)-8G&6Kxo9s%I7 z%y)?~J8d@s8F$k#>ZCj&t*op%J99uT+<5cfDN%b%N-qqB`~LHp+YL*~YW+|sUsM_! zHwi$MlJK44pP}kfL`<9jQZ$YU=yD2&^H0DsQthE7o}QEl2+xegVlg;#<}cSSTsZq? zcL;nII#lb;(6*g`h{q=u^vdPBd;a|S;_1_`{+zyggJgrhPCUTzSO*4*xv$js zYDQD?MFSrJt1698QyJ^D?>L^#M(tFph-cw6cm1f`y z8bpQbdLeN`&}3I2nhUo`&t;By#8f+(@R4KglsXtZ%KSm&JuF?rpgxR@YDGK{$~Jt- ziIi8u0@nRyta^9Rpx?97it1m#c)O&RFWOedP<7pqD1Rg-Bu!I@vTc23WqG}&Jh(3j zdFf-pY+7J=z{w)3_aUd|v5V{#>sG!EfL#*S%1wd#U=98KHfq^56w+5= zaMCGMO4L4VTTnwGsR&fcf;t=>=~}t1a$NsL#(80AtM$6A)a&a!$+BoIt1I09@B8aX zPHH#8J4#AA=jq5)bRl#@ko&miMUs^Np n9^qSmxu0gSRVytEKlS=Ai}9picY;X*00000NkvXXu0mjfhf1ri diff --git a/htdocs/resource/list.php b/htdocs/resource/list.php index b33bbec259e..777bcb374d6 100644 --- a/htdocs/resource/list.php +++ b/htdocs/resource/list.php @@ -106,10 +106,9 @@ else print '
'."\n"; print ''; - print_liste_field_titre($langs->trans('Id'),$_SERVER['PHP_SELF'],'t.rowid','',$param,'',$sortfield,$sortorder); print_liste_field_titre($langs->trans('Ref'),$_SERVER['PHP_SELF'],'t.ref','',$param,'',$sortfield,$sortorder); print_liste_field_titre($langs->trans('ResourceType'),$_SERVER['PHP_SELF'],'ty.code','',$param,'',$sortfield,$sortorder); - print_liste_field_titre($langs->trans('Action'),"","","","",'width="60" align="center"',"",""); + print_liste_field_titre('',"","","","",'width="60" align="center"',"",""); print "\n"; foreach ($object->lines as $resource) @@ -117,15 +116,12 @@ else $var=!$var; $style=''; - if($resource->id == GETPOST('lineid')) - $style='style="background: orange;"'; + if ($resource->id == GETPOST('lineid')) $style='style="background: orange;"'; - print ''; + print ''; print ''; print '
'; - print ''.$resource->id.''; - print '
'; - print $resource->ref; + print $resource->getNomUrl(5); print ''; diff --git a/htdocs/resource/note.php b/htdocs/resource/note.php index 1f277688957..30e37eba77f 100644 --- a/htdocs/resource/note.php +++ b/htdocs/resource/note.php @@ -64,7 +64,7 @@ $form = new Form($db); if ($id > 0 || ! empty($ref)) { $head = resource_prepare_head($object); - dol_fiche_head($head, 'note', $langs->trans('ResourceSingular'), 0, 'resource@resource'); + dol_fiche_head($head, 'note', $langs->trans('ResourceSingular'), 0, 'resource'); print ''; print ''; - print ''; } // Title From b153ae8c6b08c2bf446c1287ae972164d8761f53 Mon Sep 17 00:00:00 2001 From: gauthier Date: Mon, 6 Jun 2016 16:12:27 +0200 Subject: [PATCH 21/50] FIX : wrong id user deplacement links --- htdocs/compta/deplacement/list.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/compta/deplacement/list.php b/htdocs/compta/deplacement/list.php index 497de98fa72..a292c0509b4 100644 --- a/htdocs/compta/deplacement/list.php +++ b/htdocs/compta/deplacement/list.php @@ -80,7 +80,7 @@ $childids[]=$user->id; llxHeader(); -$sql = "SELECT s.nom, s.rowid as socid,"; // Ou +$sql = "SELECT s.nom, d.fk_user, s.rowid as socid,"; // Ou $sql.= " d.rowid, d.type, d.dated as dd, d.km,"; // Comment $sql.= " d.fk_statut,"; $sql.= " u.lastname, u.firstname"; // Qui @@ -188,7 +188,7 @@ if ($resql) print ''; // User print ''; - print ''; + print ''; print ''; print ''; print ''; } diff --git a/htdocs/expensereport/card.php b/htdocs/expensereport/card.php index ff6434154c6..f046b4ea61f 100644 --- a/htdocs/expensereport/card.php +++ b/htdocs/expensereport/card.php @@ -1401,6 +1401,7 @@ else print ''; print ''; print ''; + // Amount print ''; print ''; print ''; @@ -1412,9 +1413,8 @@ else if($object->fk_statut==6) $rowspan+=2; print ''; + // Validation date print ''; print ''; - print ''; + print ''; print ''; // User to inform @@ -1515,7 +1519,11 @@ else $userfee=new User($db); $userfee->fetch($object->fk_user_validator); print $userfee->getNomUrl(1); - if (empty($userfee->email) || ! isValidEmail($userfee->email)) print img_warning($langs->trans("EmailNotValid")); + if (empty($userfee->email) || ! isValidEmail($userfee->email)) + { + $langs->load("errors"); + print img_warning($langs->trans("ErrorBadEMail", $userfee->email)); + } } print ''; } diff --git a/htdocs/expensereport/class/expensereport.class.php b/htdocs/expensereport/class/expensereport.class.php index 6394b977908..f0467648af8 100644 --- a/htdocs/expensereport/class/expensereport.class.php +++ b/htdocs/expensereport/class/expensereport.class.php @@ -1613,6 +1613,28 @@ class ExpenseReport extends CommonObject return -1; } } + + /** + * Return if an expense report is late or not + * + * @param string $option 'topay' or 'toapprove' + * @return boolean True if late, False if not late + */ + public function hasDelay($option) + { + global $conf; + + //Only valid members + if ($option == 'toapprove' && $this->status != 2) return false; + if ($option == 'topay' && $this->status != 5) return false; + + $now = dol_now(); + + if ($option == 'toapprove') + return $this->datevalid < ($now - $conf->expensereport->approve->warning_delay); + else + return $this->datevalid < ($now - $conf->expensereport->payment->warning_delay); + } } diff --git a/htdocs/expensereport/list.php b/htdocs/expensereport/list.php index b7f5be64455..8175c130ef6 100644 --- a/htdocs/expensereport/list.php +++ b/htdocs/expensereport/list.php @@ -81,7 +81,6 @@ $fieldstosearchall = array( $form = new Form($db); $formother = new FormOther($db); -$expensereporttmp=new ExpenseReport($db); llxHeader('', $langs->trans("ListOfTrips")); @@ -104,7 +103,7 @@ $pageprev = $page - 1; $pagenext = $page + 1; $sql = "SELECT d.rowid, d.ref, d.fk_user_author, d.total_ht, d.total_tva, d.total_ttc, d.fk_statut as status,"; -$sql.= " d.date_debut, d.date_fin,"; +$sql.= " d.date_debut, d.date_fin, d.date_valid,"; $sql.= " u.rowid as id_user, u.firstname, u.lastname"; $sql.= " FROM ".MAIN_DB_PREFIX."expensereport as d"; $sql.= " INNER JOIN ".MAIN_DB_PREFIX."user as u ON d.fk_user_author = u.rowid"; @@ -244,7 +243,8 @@ if ($resql) print ''; // User - if ($user->rights->expensereport->readall || $user->rights->expensereport->lire_tous){ + if ($user->rights->expensereport->readall || $user->rights->expensereport->lire_tous) + { print ''; @@ -280,7 +280,7 @@ if ($resql) $expensereportstatic=new ExpenseReport($db); - if($num > 0) + if ($num > 0) { while ($i < min($num,$limit)) { @@ -288,21 +288,27 @@ if ($resql) $expensereportstatic->id=$objp->rowid; $expensereportstatic->ref=$objp->ref; + $expensereportstatic->status=$objp->status; + $expensereportstatic->valid=$objp->date_valid; + $expensereportstatic->date_debut=$objp->date_debut; + $expensereportstatic->date_fin=$objp->date_fin; $var=!$var; print ""; - print ''; + print ''; print ''; print ''; print ''; print ''; print ''; print ''; - - $expensereporttmp->status=$objp->status; print ''; print ''; diff --git a/htdocs/index.php b/htdocs/index.php index b28038e63c9..2a524d56078 100644 --- a/htdocs/index.php +++ b/htdocs/index.php @@ -473,7 +473,7 @@ if (! empty($conf->banque->enabled) && $user->rights->banque->lire && ! $user->s { include_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; $board=new Account($db); - $nb = $board::countAccountToReconcile(); + $nb = $board::countAccountToReconcile(); // Get nb of account to reconciliate if ($nb > 0) { $dashboardlines[] = $board->load_board($user); diff --git a/htdocs/projet/list.php b/htdocs/projet/list.php index 2ad8d972638..2e78ea94bbf 100644 --- a/htdocs/projet/list.php +++ b/htdocs/projet/list.php @@ -558,6 +558,9 @@ if ($resql) $projectstatic->user_author_id = $obj->fk_user_creat; $projectstatic->public = $obj->public; $projectstatic->ref = $obj->ref; + $projectstatic->datee = $obj->date_end; + $projectstatic->statut = $obj->fk_statut; + $projectstatic->opp_status = $obj->fk_opp_status; $userAccess = $projectstatic->restrictedProjectArea($user); // why this ? if ($userAccess >= 0) @@ -570,6 +573,7 @@ if ($resql) { print ''; } // Title diff --git a/htdocs/projet/tasks/list.php b/htdocs/projet/tasks/list.php index c37812a511f..a1c7693b4b7 100644 --- a/htdocs/projet/tasks/list.php +++ b/htdocs/projet/tasks/list.php @@ -213,7 +213,7 @@ else dol_print_error($db); if (count($listoftaskcontacttype) == 0) $listoftaskcontacttype[0]='0'; // To avoid sql syntax error if not found $distinct='DISTINCT'; // We add distinct until we are added a protection to be sure a contact of a project and task is only once. -$sql = "SELECT ".$distinct." p.rowid as projectid, p.ref as projectref, p.title as projecttitle, p.fk_statut as projectstatus, p.fk_opp_status, p.public, p.fk_user_creat as projectusercreate"; +$sql = "SELECT ".$distinct." p.rowid as projectid, p.ref as projectref, p.title as projecttitle, p.fk_statut as projectstatus, p.datee as projectdatee, p.fk_opp_status, p.public, p.fk_user_creat as projectusercreate"; $sql.= ", s.nom as name, s.rowid as socid"; $sql.= ", t.datec as date_creation, t.dateo as date_start, t.datee as date_end, t.tms as date_update"; $sql.= ", t.rowid as id, t.ref, t.label, t.planned_workload, t.duration_effective, t.progress, t.fk_statut"; @@ -550,13 +550,14 @@ if ($resql) $projectstatic->title = $obj->projecttitle; $projectstatic->public = $obj->public; $projectstatic->statut = $obj->projectstatus; - $projectstatic->datee = $obj->date_end; + $projectstatic->datee = $obj->projectdatee; $taskstatic->id = $obj->id; $taskstatic->ref = $obj->ref; $taskstatic->label = $obj->label; $taskstatic->fk_statut = $obj->fk_statut; $taskstatic->progress = $obj->progress; + $taskstatic->datee = $obj->date_end; $userAccess = $projectstatic->restrictedProjectArea($user); // why this ? if ($userAccess >= 0) @@ -607,6 +608,7 @@ if ($resql) { print ''; } // Label From 559c1aa01029c73b3f51894d732ba900b1c23a51 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 6 Jun 2016 16:37:18 +0200 Subject: [PATCH 24/50] Fix alignetment of title in some arrays --- htdocs/comm/propal/stats/index.php | 12 ++++++------ htdocs/compta/facture/stats/index.php | 12 ++++++------ htdocs/expensereport/stats/index.php | 6 +++--- 3 files changed, 15 insertions(+), 15 deletions(-) diff --git a/htdocs/comm/propal/stats/index.php b/htdocs/comm/propal/stats/index.php index 33895c2ac54..aa5a865dbf2 100644 --- a/htdocs/comm/propal/stats/index.php +++ b/htdocs/comm/propal/stats/index.php @@ -283,12 +283,12 @@ print '
'; print '
'.$langs->trans("ResourceFormLabel_ref").''; From 47308d27c317cbdcb76a663ce4f3476bf4458b21 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 6 Jun 2016 14:37:06 +0200 Subject: [PATCH 18/50] Missing column import_key and import for vat payments --- .../compta/paiement/class/cpaiement.class.php | 463 ++++++++++++++++++ .../compta/paiement/class/paiement.class.php | 3 +- htdocs/core/modules/modTax.class.php | 23 +- .../install/mysql/migration/3.9.0-4.0.0.sql | 1 + htdocs/install/mysql/tables/llx_tva.sql | 13 +- htdocs/langs/en_US/compta.lang | 3 +- 6 files changed, 492 insertions(+), 14 deletions(-) create mode 100644 htdocs/compta/paiement/class/cpaiement.class.php diff --git a/htdocs/compta/paiement/class/cpaiement.class.php b/htdocs/compta/paiement/class/cpaiement.class.php new file mode 100644 index 00000000000..5428f4abdbf --- /dev/null +++ b/htdocs/compta/paiement/class/cpaiement.class.php @@ -0,0 +1,463 @@ + + * Copyright (C) 2014 Juanjo Menent + * Copyright (C) 2015 Florian Henry + * Copyright (C) 2015 Raphaël Doursenaud + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +/** + * \file htdocs/compat/paiement/class/cpaiement.class.php + * \ingroup facture + * \brief This file is to manage CRUD function of type of payments + */ + + +/** + * Class Cpaiement + */ +class Cpaiement +{ + /** + * @var string Id to identify managed objects + */ + public $element = 'cpaiement'; + /** + * @var string Name of table without prefix where object is stored + */ + public $table_element = 'c_paiement'; + + /** + * @var CpaiementLine[] Lines + */ + public $lines = array(); + + /** + */ + + public $code; + public $libelle; + public $type; + public $active; + public $accountancy_code; + public $module; + + /** + */ + + + /** + * Constructor + * + * @param DoliDb $db Database handler + */ + public function __construct(DoliDB $db) + { + $this->db = $db; + } + + /** + * Create object into database + * + * @param User $user User that creates + * @param bool $notrigger false=launch triggers after, true=disable triggers + * + * @return int <0 if KO, Id of created object if OK + */ + public function create(User $user, $notrigger = false) + { + dol_syslog(__METHOD__, LOG_DEBUG); + + $error = 0; + + // Clean parameters + + if (isset($this->code)) { + $this->code = trim($this->code); + } + if (isset($this->libelle)) { + $this->libelle = trim($this->libelle); + } + if (isset($this->type)) { + $this->type = trim($this->type); + } + if (isset($this->active)) { + $this->active = trim($this->active); + } + if (isset($this->accountancy_code)) { + $this->accountancy_code = trim($this->accountancy_code); + } + if (isset($this->module)) { + $this->module = trim($this->module); + } + + + + // Check parameters + // Put here code to add control on parameters values + + // Insert request + $sql = 'INSERT INTO ' . MAIN_DB_PREFIX . $this->table_element . '('; + + $sql.= 'id,'; + $sql.= 'code,'; + $sql.= 'libelle,'; + $sql.= 'type,'; + $sql.= 'active,'; + $sql.= 'accountancy_code,'; + $sql.= 'module'; + + + $sql .= ') VALUES ('; + + $sql .= ' '.(! isset($this->id)?'NULL':$this->id).','; + $sql .= ' '.(! isset($this->code)?'NULL':"'".$this->db->escape($this->code)."'").','; + $sql .= ' '.(! isset($this->libelle)?'NULL':"'".$this->db->escape($this->libelle)."'").','; + $sql .= ' '.(! isset($this->type)?'NULL':$this->type).','; + $sql .= ' '.(! isset($this->active)?'NULL':$this->active).','; + $sql .= ' '.(! isset($this->accountancy_code)?'NULL':"'".$this->db->escape($this->accountancy_code)."'").','; + $sql .= ' '.(! isset($this->module)?'NULL':"'".$this->db->escape($this->module)."'"); + + + $sql .= ')'; + + $this->db->begin(); + + $resql = $this->db->query($sql); + if (!$resql) { + $error ++; + $this->errors[] = 'Error ' . $this->db->lasterror(); + dol_syslog(__METHOD__ . ' ' . join(',', $this->errors), LOG_ERR); + } + + if (!$error) { + $this->id = $this->db->last_insert_id(MAIN_DB_PREFIX . $this->table_element); + + if (!$notrigger) { + // Uncomment this and change MYOBJECT to your own tag if you + // want this action to call a trigger. + + //// Call triggers + //$result=$this->call_trigger('MYOBJECT_CREATE',$user); + //if ($result < 0) $error++; + //// End call triggers + } + } + + // Commit or rollback + if ($error) { + $this->db->rollback(); + + return - 1 * $error; + } else { + $this->db->commit(); + + return $this->id; + } + } + + /** + * Load object in memory from the database + * + * @param int $id Id object + * @param string $ref Ref + * + * @return int <0 if KO, 0 if not found, >0 if OK + */ + public function fetch($id, $ref = null) + { + dol_syslog(__METHOD__, LOG_DEBUG); + + $sql = 'SELECT'; + $sql .= ' t.id,'; + $sql .= " t.code,"; + $sql .= " t.libelle,"; + $sql .= " t.type,"; + $sql .= " t.active,"; + $sql .= " t.accountancy_code,"; + $sql .= " t.module"; + $sql .= ' FROM ' . MAIN_DB_PREFIX . $this->table_element . ' as t'; + if (null !== $ref) { + $sql .= ' WHERE t.code = ' . '\'' . $ref . '\''; + } else { + $sql .= ' WHERE t.id = ' . $id; + } + + $resql = $this->db->query($sql); + if ($resql) { + $numrows = $this->db->num_rows($resql); + if ($numrows) { + $obj = $this->db->fetch_object($resql); + + $this->id = $obj->id; + + $this->code = $obj->code; + $this->libelle = $obj->libelle; + $this->type = $obj->type; + $this->active = $obj->active; + $this->accountancy_code = $obj->accountancy_code; + $this->module = $obj->module; + + + } + $this->db->free($resql); + + if ($numrows) { + return 1; + } else { + return 0; + } + } else { + $this->errors[] = 'Error ' . $this->db->lasterror(); + dol_syslog(__METHOD__ . ' ' . join(',', $this->errors), LOG_ERR); + + return - 1; + } + } + + /** + * Load object in memory from the database + * + * @param string $sortorder Sort Order + * @param string $sortfield Sort field + * @param int $limit offset limit + * @param int $offset offset limit + * @param array $filter filter array + * @param string $filtermode filter mode (AND or OR) + * + * @return int <0 if KO, >0 if OK + */ + public function fetchAll($sortorder='', $sortfield='', $limit=0, $offset=0, array $filter = array(), $filtermode='AND') + { + dol_syslog(__METHOD__, LOG_DEBUG); + + $sql = 'SELECT'; + $sql .= ' t.id,'; + $sql .= " t.code,"; + $sql .= " t.libelle,"; + $sql .= " t.type,"; + $sql .= " t.active,"; + $sql .= " t.accountancy_code,"; + $sql .= " t.module"; + + + $sql .= ' FROM ' . MAIN_DB_PREFIX . $this->table_element. ' as t'; + + // Manage filter + $sqlwhere = array(); + if (count($filter) > 0) { + foreach ($filter as $key => $value) { + $sqlwhere [] = $key . ' LIKE \'%' . $this->db->escape($value) . '%\''; + } + } + if (count($sqlwhere) > 0) { + $sql .= ' WHERE ' . implode(' '.$filtermode.' ', $sqlwhere); + } + + if (!empty($sortfield)) { + $sql .= $this->db->order($sortfield,$sortorder); + } + if (!empty($limit)) { + $sql .= ' ' . $this->db->plimit($limit + 1, $offset); + } + $this->lines = array(); + + $resql = $this->db->query($sql); + if ($resql) { + $num = $this->db->num_rows($resql); + + while ($obj = $this->db->fetch_object($resql)) { + $line = new CpaiementLine(); + + $line->id = $obj->id; + + $line->code = $obj->code; + $line->libelle = $obj->libelle; + $line->type = $obj->type; + $line->active = $obj->active; + $line->accountancy_code = $obj->accountancy_code; + $line->module = $obj->module; + + + + $this->lines[$line->id] = $line; + } + $this->db->free($resql); + + return $num; + } else { + $this->errors[] = 'Error ' . $this->db->lasterror(); + dol_syslog(__METHOD__ . ' ' . join(',', $this->errors), LOG_ERR); + + return - 1; + } + } + + /** + * Update object into database + * + * @param User $user User that modifies + * @param bool $notrigger false=launch triggers after, true=disable triggers + * + * @return int <0 if KO, >0 if OK + */ + public function update(User $user, $notrigger = false) + { + $error = 0; + + dol_syslog(__METHOD__, LOG_DEBUG); + + // Clean parameters + + if (isset($this->code)) { + $this->code = trim($this->code); + } + if (isset($this->libelle)) { + $this->libelle = trim($this->libelle); + } + if (isset($this->type)) { + $this->type = trim($this->type); + } + if (isset($this->active)) { + $this->active = trim($this->active); + } + if (isset($this->accountancy_code)) { + $this->accountancy_code = trim($this->accountancy_code); + } + if (isset($this->module)) { + $this->module = trim($this->module); + } + + + + // Check parameters + // Put here code to add a control on parameters values + + // Update request + $sql = 'UPDATE ' . MAIN_DB_PREFIX . $this->table_element . ' SET'; + $sql .= ' id = '.(isset($this->id)?$this->id:"null").','; + $sql .= ' code = '.(isset($this->code)?"'".$this->db->escape($this->code)."'":"null").','; + $sql .= ' libelle = '.(isset($this->libelle)?"'".$this->db->escape($this->libelle)."'":"null").','; + $sql .= ' type = '.(isset($this->type)?$this->type:"null").','; + $sql .= ' active = '.(isset($this->active)?$this->active:"null").','; + $sql .= ' accountancy_code = '.(isset($this->accountancy_code)?"'".$this->db->escape($this->accountancy_code)."'":"null").','; + $sql .= ' module = '.(isset($this->module)?"'".$this->db->escape($this->module)."'":"null"); + $sql .= ' WHERE id=' . $this->id; + + $this->db->begin(); + + $resql = $this->db->query($sql); + if (!$resql) { + $error ++; + $this->errors[] = 'Error ' . $this->db->lasterror(); + dol_syslog(__METHOD__ . ' ' . join(',', $this->errors), LOG_ERR); + } + + if (!$error && !$notrigger) { + // Uncomment this and change MYOBJECT to your own tag if you + // want this action calls a trigger. + + //// Call triggers + //$result=$this->call_trigger('MYOBJECT_MODIFY',$user); + //if ($result < 0) { $error++; //Do also what you must do to rollback action if trigger fail} + //// End call triggers + } + + // Commit or rollback + if ($error) { + $this->db->rollback(); + + return - 1 * $error; + } else { + $this->db->commit(); + + return 1; + } + } + + /** + * Delete object in database + * + * @param User $user User that deletes + * @param bool $notrigger false=launch triggers after, true=disable triggers + * + * @return int <0 if KO, >0 if OK + */ + public function delete(User $user, $notrigger = false) + { + dol_syslog(__METHOD__, LOG_DEBUG); + + $error = 0; + + $this->db->begin(); + + if (!$error) { + if (!$notrigger) { + // Uncomment this and change MYOBJECT to your own tag if you + // want this action calls a trigger. + + //// Call triggers + //$result=$this->call_trigger('MYOBJECT_DELETE',$user); + //if ($result < 0) { $error++; //Do also what you must do to rollback action if trigger fail} + //// End call triggers + } + } + + if (!$error) { + $sql = 'DELETE FROM ' . MAIN_DB_PREFIX . $this->table_element; + $sql .= ' WHERE id=' . $this->id; + + $resql = $this->db->query($sql); + if (!$resql) { + $error ++; + $this->errors[] = 'Error ' . $this->db->lasterror(); + dol_syslog(__METHOD__ . ' ' . join(',', $this->errors), LOG_ERR); + } + } + + // Commit or rollback + if ($error) { + $this->db->rollback(); + + return - 1 * $error; + } else { + $this->db->commit(); + + return 1; + } + } + + + /** + * Initialise object with example values + * Id must be 0 if object instance is a specimen + * + * @return void + */ + public function initAsSpecimen() + { + $this->id = 0; + + $this->code = ''; + $this->libelle = ''; + $this->type = ''; + $this->active = ''; + $this->accountancy_code = ''; + $this->module = ''; + + + } + +} diff --git a/htdocs/compta/paiement/class/paiement.class.php b/htdocs/compta/paiement/class/paiement.class.php index 62f8c1b6717..099d05cfa84 100644 --- a/htdocs/compta/paiement/class/paiement.class.php +++ b/htdocs/compta/paiement/class/paiement.class.php @@ -62,8 +62,9 @@ class Paiement extends CommonObject var $bank_line; // Id de la ligne d'ecriture bancaire // fk_paiement dans llx_paiement est l'id du type de paiement (7 pour CHQ, ...) // fk_paiement dans llx_paiement_facture est le rowid du paiement + var $fk_paiement; // Type of paiment - + /** * Constructor * diff --git a/htdocs/core/modules/modTax.class.php b/htdocs/core/modules/modTax.class.php index 5c2beab5dfa..293384b49a8 100644 --- a/htdocs/core/modules/modTax.class.php +++ b/htdocs/core/modules/modTax.class.php @@ -135,10 +135,10 @@ class modTax extends DolibarrModules $this->export_sql_end[$r] .=' WHERE c.fk_type = cc.id'; $this->export_sql_end[$r] .=' AND c.entity IN ('.getEntity('tax',1).')'; - // Import Taxes + // Import social contributions $r++; $this->import_code[$r]=$this->rights_class.'_'.$r; - $this->import_label[$r]="ImportDataset_tax_1"; // Translation key + $this->import_label[$r]="ImportDataset_tax_contrib"; // Translation key $this->import_icon[$r]='tax'; $this->import_entities_array[$r]=array(); // We define here only fields that use another icon that the one defined into import_icon $this->import_tables_array[$r]=array('t'=>MAIN_DB_PREFIX.'chargesociales'); @@ -152,6 +152,25 @@ class modTax extends DolibarrModules $this->import_examplevalues_array[$r]=array('t.libelle'=>"Social/fiscal contribution",'t.fk_type'=>"TAXPRO (must be id or code found into dictionary)", 't.date_ech'=>"2016-01-01", 't.periode'=>"2016-01-01" ); + + // Import Taxes + $r++; + $this->import_code[$r]=$this->rights_class.'_'.$r; + $this->import_label[$r]="ImportDataset_tax_vat"; // Translation key + $this->import_icon[$r]='tax'; + $this->import_entities_array[$r]=array(); // We define here only fields that use another icon that the one defined into import_icon + $this->import_tables_array[$r]=array('t'=>MAIN_DB_PREFIX.'tva'); + $this->import_fields_array[$r]=array('t.datep'=>"DatePayment*",'t.datev'=>"DateValue*",'t.label'=>"Label*",'t.fk_typepayment'=>"PaymentMode*", + 't.amount'=>"Amount*",'t.num_payment'=>'Numero' + ); + + $this->import_convertvalue_array[$r]=array( + 't.fk_typepayment'=>array('rule'=>'fetchidfromref','classfile'=>'/compta/paiement/class/cpaiement.class.php','class'=>'Cpaiement','method'=>'fetch','element'=>'Cpaiement') + ); + $this->import_examplevalues_array[$r]=array('t.label'=>"VAT Payment 1st quarter 2016",'t.fk_typepayment'=>"CHQ (must be id or code found into dictionary)", + 't.datep'=>"2016-04-02", 't.datev'=>"2016-03-31", 't.amount'=>1000, 't.num_payment'=>'123456' + ); + } diff --git a/htdocs/install/mysql/migration/3.9.0-4.0.0.sql b/htdocs/install/mysql/migration/3.9.0-4.0.0.sql index 1ddc7479bcb..c20ef305c39 100644 --- a/htdocs/install/mysql/migration/3.9.0-4.0.0.sql +++ b/htdocs/install/mysql/migration/3.9.0-4.0.0.sql @@ -119,6 +119,7 @@ ALTER TABLE llx_facturedet ADD COLUMN fk_contract_line integer NULL AFTER rang; ALTER TABLE llx_facturedet_rec ADD COLUMN import_key varchar(14); ALTER TABLE llx_chargesociales ADD COLUMN import_key varchar(14); +ALTER TABLE llx_tva ADD COLUMN import_key varchar(14); --DROP TABLE llx_website_page; --DROP TABLE llx_website; diff --git a/htdocs/install/mysql/tables/llx_tva.sql b/htdocs/install/mysql/tables/llx_tva.sql index c5b1542198c..f33280ff511 100644 --- a/htdocs/install/mysql/tables/llx_tva.sql +++ b/htdocs/install/mysql/tables/llx_tva.sql @@ -30,14 +30,7 @@ create table llx_tva entity integer DEFAULT 1 NOT NULL, -- multi company id note text, fk_bank integer, - fk_user_creat integer, -- utilisateur qui a cree l'info - fk_user_modif integer -- utilisateur qui a modifi� l'info + fk_user_creat integer, -- utilisateur who create record + fk_user_modif integer, -- utilisateur who modify record + import_key varchar(14) )ENGINE=innodb; - --- --- List of codes for the field entity --- --- 1 : first company vat --- 2 : second company vat --- 3 : etc... --- \ No newline at end of file diff --git a/htdocs/langs/en_US/compta.lang b/htdocs/langs/en_US/compta.lang index f8942c406a9..c2893c0dbcc 100644 --- a/htdocs/langs/en_US/compta.lang +++ b/htdocs/langs/en_US/compta.lang @@ -225,5 +225,6 @@ BasedOnTwoFirstLettersOfVATNumberBeingDifferentFromYourCompanyCountry=Based on t SameCountryCustomersWithVAT=National customers report BasedOnTwoFirstLettersOfVATNumberBeingTheSameAsYourCompanyCountry=Based on the two first letters of the VAT number being the same as your own company's country code LinkedFichinter=Link to an intervention -ImportDataset_tax_1=Import social/fiscal taxes +ImportDataset_tax_contrib=Import social/fiscal taxes +ImportDataset_tax_vat=Import vat payments ErrorBankAccountNotFound=Error: Bank account not found From 0e06f116a2d0f27a2021786d312f8f127774ba4a Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 6 Jun 2016 15:13:55 +0200 Subject: [PATCH 19/50] Fix truncation of event conente in agenda view --- htdocs/comm/action/index.php | 41 ++++++++++++++++++------------------ 1 file changed, 20 insertions(+), 21 deletions(-) diff --git a/htdocs/comm/action/index.php b/htdocs/comm/action/index.php index addcb26fe17..02a949c7218 100644 --- a/htdocs/comm/action/index.php +++ b/htdocs/comm/action/index.php @@ -937,7 +937,7 @@ if (! empty($hookmanager->resArray['eventarray'])) $eventarray=array_merge($even -$maxnbofchar=18; +$maxnbofchar=0; $cachethirdparties=array(); $cachecontacts=array(); $cacheusers=array(); @@ -1242,20 +1242,20 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa } else { - $numother++; - $color=($event->icalcolor?$event->icalcolor:-1); - $cssclass=(! empty($event->icalname)?'family_ext'.md5($event->icalname):'family_other'); - - if (empty($cacheusers[$event->userownerid])) - { - $newuser=new User($db); - $newuser->fetch($event->userownerid); - $cacheusers[$event->userownerid]=$newuser; - } - //var_dump($cacheusers[$event->userownerid]->color); - - // We decide to choose color of owner of event (event->userownerid is user id of owner, event->userassigned contains all users assigned to event) - if (! empty($cacheusers[$event->userownerid]->color)) $color=$cacheusers[$event->userownerid]->color; + $numother++; + $color=($event->icalcolor?$event->icalcolor:-1); + $cssclass=(! empty($event->icalname)?'family_ext'.md5($event->icalname):'family_other'); + + if (empty($cacheusers[$event->userownerid])) + { + $newuser=new User($db); + $newuser->fetch($event->userownerid); + $cacheusers[$event->userownerid]=$newuser; + } + //var_dump($cacheusers[$event->userownerid]->color); + + // We decide to choose color of owner of event (event->userownerid is user id of owner, event->userassigned contains all users assigned to event) + if (! empty($cacheusers[$event->userownerid]->color)) $color=$cacheusers[$event->userownerid]->color; } if ($color == -1) // Color was not forced. Set color according to color index. { @@ -1272,7 +1272,7 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa if (! empty($theme_datacolor[$nextindextouse+1])) $nextindextouse++; // Prepare to use next color } //print '|'.($color).'='.($idusertouse?$idusertouse:0).'='.$colorindex.'
'; - // Define color + // Define color $color=sprintf("%02x%02x%02x",$theme_datacolor[$colorindex][0],$theme_datacolor[$colorindex][1],$theme_datacolor[$colorindex][2]); } $cssclass=$cssclass.' '.$cssclass.'_day_'.$ymd; @@ -1316,7 +1316,7 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa //if (! empty($event->transparency)) print 'background: #'.$color.'; background: -webkit-gradient(linear, left top, left bottom, from(#'.$color.'), to(#'.dol_color_minus($color,1).'));'; //else print 'background-color: transparent !important; background: none; border: 1px solid #bbb;'; print ' -moz-border-radius:4px;" width="100%">
'; + print ''; if ($event->type_code == 'BIRTHDAY') // It's a birthday { print $event->getNomUrl(1,$maxnbofchar,'cal_event','birthday','contact'); @@ -1397,8 +1397,7 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa if ($event->type_code == 'ICALEVENT') print '
('.dol_trunc($event->icalname,$maxnbofchar).')'; // If action related to company / contact - $linerelatedto='';$length=16; - if (! empty($event->societe->id) && ! empty($event->contact->id)) $length=round($length/2); + $linerelatedto=''; if (! empty($event->societe->id) && $event->societe->id > 0) { if (! isset($cachethirdparties[$event->societe->id]) || ! is_object($cachethirdparties[$event->societe->id])) @@ -1408,7 +1407,7 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa $cachethirdparties[$event->societe->id]=$thirdparty; } else $thirdparty=$cachethirdparties[$event->societe->id]; - if (! empty($thirdparty->id)) $linerelatedto.=$thirdparty->getNomUrl(1,'',$length); + if (! empty($thirdparty->id)) $linerelatedto.=$thirdparty->getNomUrl(1,'',0); } if (! empty($event->contact->id) && $event->contact->id > 0) { @@ -1420,7 +1419,7 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa } else $contact=$cachecontacts[$event->contact->id]; if ($linerelatedto) $linerelatedto.=' / '; - if (! empty($contact->id)) $linerelatedto.=$contact->getNomUrl(1,'',$length); + if (! empty($contact->id)) $linerelatedto.=$contact->getNomUrl(1,'',0); } if ($linerelatedto) print '
'.$linerelatedto; } From 473ab1830600637bc41f3008877247882806e460 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 6 Jun 2016 15:48:41 +0200 Subject: [PATCH 20/50] Fix link on workboard Fix warning picto is missing on task list --- htdocs/comm/action/class/actioncomm.class.php | 1 + htdocs/projet/class/project.class.php | 9 ++++----- htdocs/projet/tasks/list.php | 4 +++- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/htdocs/comm/action/class/actioncomm.class.php b/htdocs/comm/action/class/actioncomm.class.php index c0e1f11579c..6b77e2414da 100644 --- a/htdocs/comm/action/class/actioncomm.class.php +++ b/htdocs/comm/action/class/actioncomm.class.php @@ -932,6 +932,7 @@ class ActionComm extends CommonObject $response->warning_delay = $conf->agenda->warning_delay/60/60/24; $response->label = $langs->trans("ActionsToDo"); $response->url = DOL_URL_ROOT.'/comm/action/listactions.php?status=todo&mainmenu=agenda'; + if ($user->rights->agenda->allactions->read) $response->url.='&filtert=-1'; $response->img = img_object($langs->trans("Actions"),"action"); // This assignment in condition is not a bug. It allows walking the results. diff --git a/htdocs/projet/class/project.class.php b/htdocs/projet/class/project.class.php index 1de8027dd0e..43b738021ee 100644 --- a/htdocs/projet/class/project.class.php +++ b/htdocs/projet/class/project.class.php @@ -1627,8 +1627,8 @@ class Project extends CommonObject $response = new WorkboardResponse(); $response->warning_delay = $conf->projet->warning_delay/60/60/24; $response->label = $langs->trans("OpenedProjects"); - if ($user->rights->projet->all->lire) $response->url = DOL_URL_ROOT.'/projet/index.php?search_status=1&mainmenu=project'; - else $response->url = DOL_URL_ROOT.'/projet/index.php?mode=mine&search_status=1&mainmenu=project'; + if ($user->rights->projet->all->lire) $response->url = DOL_URL_ROOT.'/projet/list.php?search_status=1&mainmenu=project'; + else $response->url = DOL_URL_ROOT.'/projet/list.php?mode=mine&search_status=1&mainmenu=project'; $response->img = img_object($langs->trans("Projects"),"project"); // This assignment in condition is not a bug. It allows walking the results. @@ -1719,9 +1719,8 @@ class Project extends CommonObject { global $conf; - if (! ($this->statut == 1)) { - return false; - } + if (! ($this->statut == 1)) return false; + if (! $this->datee) return false; $now = dol_now(); diff --git a/htdocs/projet/tasks/list.php b/htdocs/projet/tasks/list.php index 8ec4eeffedb..c37812a511f 100644 --- a/htdocs/projet/tasks/list.php +++ b/htdocs/projet/tasks/list.php @@ -1,6 +1,6 @@ - * Copyright (C) 2006-2015 Laurent Destailleur + * Copyright (C) 2006-2016 Laurent Destailleur * Copyright (C) 2006-2010 Regis Houssin * * This program is free software; you can redistribute it and/or modify @@ -550,6 +550,7 @@ if ($resql) $projectstatic->title = $obj->projecttitle; $projectstatic->public = $obj->public; $projectstatic->statut = $obj->projectstatus; + $projectstatic->datee = $obj->date_end; $taskstatic->id = $obj->id; $taskstatic->ref = $obj->ref; @@ -568,6 +569,7 @@ if ($resql) { print '
'; print $projectstatic->getNomUrl(1, 'task'); + if ($projectstatic->hasDelay()) print img_warning("Late"); print ''.dol_print_date($db->jdate($obj->dd),'day').''; - $userstatic->id = $obj->rowid; + $userstatic->id = $obj->fk_user; $userstatic->lastname = $obj->lastname; $userstatic->firstname = $obj->firstname; print $userstatic->getNomUrl(1); From 07d07d522af3e09660866f29f847a39c5124c915 Mon Sep 17 00:00:00 2001 From: gauthier Date: Mon, 6 Jun 2016 16:31:42 +0200 Subject: [PATCH 22/50] FIX : if user is only allowed to see his companies, he must be allowed to see deplacement which are not linked to a company --- htdocs/compta/deplacement/list.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/compta/deplacement/list.php b/htdocs/compta/deplacement/list.php index 497de98fa72..eacc77ad136 100644 --- a/htdocs/compta/deplacement/list.php +++ b/htdocs/compta/deplacement/list.php @@ -91,7 +91,7 @@ if (!$user->rights->societe->client->voir && !$socid) $sql.= " LEFT JOIN ".MAIN_ $sql.= " WHERE d.fk_user = u.rowid"; $sql.= " AND d.entity = ".$conf->entity; if (empty($user->rights->deplacement->readall) && empty($user->rights->deplacement->lire_tous)) $sql.=' AND d.fk_user IN ('.join(',',$childids).')'; -if (!$user->rights->societe->client->voir && !$socid) $sql.= " AND sc.fk_user = " .$user->id; +if (!$user->rights->societe->client->voir && !$socid) $sql.= " AND (sc.fk_user = " .$user->id." OR d.fk_soc IS NULL) "; if ($socid) $sql.= " AND s.rowid = ".$socid; if ($search_ref) $sql.=" AND d.rowid=".$search_ref; From fb1322517381f4617c6cc7e88c461b99e7696f13 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 6 Jun 2016 16:31:50 +0200 Subject: [PATCH 23/50] Fix links on list from warnings dashboard --- htdocs/adherents/class/adherent.class.php | 12 ++++++---- htdocs/compta/bank/class/account.class.php | 1 + htdocs/compta/bank/index.php | 4 ++-- htdocs/contrat/services.php | 4 ++-- htdocs/expensereport/card.php | 18 ++++++++++---- .../class/expensereport.class.php | 22 +++++++++++++++++ htdocs/expensereport/list.php | 24 ++++++++++++------- htdocs/index.php | 2 +- htdocs/projet/list.php | 4 ++++ htdocs/projet/tasks/list.php | 6 +++-- 10 files changed, 72 insertions(+), 25 deletions(-) diff --git a/htdocs/adherents/class/adherent.class.php b/htdocs/adherents/class/adherent.class.php index 93b013cd29f..87ceb66f9d1 100644 --- a/htdocs/adherents/class/adherent.class.php +++ b/htdocs/adherents/class/adherent.class.php @@ -1737,7 +1737,7 @@ class Adherent extends CommonObject $response = new WorkboardResponse(); $response->warning_delay=$conf->adherent->cotisation->warning_delay/60/60/24; $response->label=$langs->trans("MembersWithSubscriptionToReceive"); - $response->url=DOL_URL_ROOT.'/adherents/list.php?mainmenu=members&statut=1'; + $response->url=DOL_URL_ROOT.'/adherents/list.php?mainmenu=members&statut=1&filter=outofdate'; $response->img=img_object($langs->trans("Members"),"user"); $adherentstatic = new Adherent($this->db); @@ -2006,14 +2006,18 @@ class Adherent extends CommonObject return CommonObject::commonReplaceThirdparty($db, $origin_id, $dest_id, $tables); } + /** + * Return if a member is late (subscription late) or not + * + * @return boolean True if late, False if not late + */ public function hasDelay() { global $conf; //Only valid members - if ($this->statut <= 0) { - return false; - } + if ($this->statut <= 0) return false; + if (! $this->datefin) return false; $now = dol_now(); diff --git a/htdocs/compta/bank/class/account.class.php b/htdocs/compta/bank/class/account.class.php index 92c21742baa..f072a066ec0 100644 --- a/htdocs/compta/bank/class/account.class.php +++ b/htdocs/compta/bank/class/account.class.php @@ -1102,6 +1102,7 @@ class Account extends CommonObject $sql.= " AND b.fk_account = ba.rowid"; $sql.= " AND ba.entity IN (".getEntity('bank_account', 1).")"; $sql.= " AND (ba.rappro = 1 AND ba.courant != 2)"; // Compte rapprochable + $sql.= " AND clos = 0"; if ($filteraccountid) $sql.=" AND ba.rowid = ".$filteraccountid; $resql=$this->db->query($sql); diff --git a/htdocs/compta/bank/index.php b/htdocs/compta/bank/index.php index 7ea3bf1be5a..380b8cff3e8 100644 --- a/htdocs/compta/bank/index.php +++ b/htdocs/compta/bank/index.php @@ -105,7 +105,7 @@ foreach ($accounts as $key=>$type) $solde = $acc->solde(1); print '
'.$acc->getNomUrl(1).''.$acc->getNomUrl(1).''.$acc->bank.''.$acc->number.''; @@ -116,7 +116,7 @@ foreach ($accounts as $key=>$type) setEventMessages($acc->error, $acc->errors, 'errors'); } else { print $result->nbtodo; - if ($result->nbtodolate) print ' ('.$result->nbtodolate.img_warning($langs->trans("Late")).')'; + if ($result->nbtodolate) print '   ('.$result->nbtodolate.img_warning($langs->trans("Late")).')'; } } else print $langs->trans("FeatureDisabled"); diff --git a/htdocs/contrat/services.php b/htdocs/contrat/services.php index 2f1c3697058..e1616026cbc 100644 --- a/htdocs/contrat/services.php +++ b/htdocs/contrat/services.php @@ -1,6 +1,6 @@ - * Copyright (C) 2004-2015 Laurent Destailleur + * Copyright (C) 2004-2016 Laurent Destailleur * Copyright (C) 2005-2012 Regis Houssin * Copyright (C) 2015 Jean-François Ferry * @@ -291,7 +291,7 @@ if ($resql) print ''; print ($obj->date_ouverture_prevue?dol_print_date($db->jdate($obj->date_ouverture_prevue)):' '); if ($db->jdate($obj->date_ouverture_prevue) && ($db->jdate($obj->date_ouverture_prevue) < ($now - $conf->contrat->services->inactifs->warning_delay))) - print img_picto($langs->trans("Late"),"warning"); + print ' '.img_picto($langs->trans("Late"),"warning"); else print '    '; print ''.$langs->trans("NotePrivate").''.$object->note_private.'
'.$langs->trans("AmountHT").''.price($object->total_ht).''; - /* - * Payments - */ + + // List of payments $sql = "SELECT p.rowid, p.num_payment, p.datep as dp, p.amount,"; $sql.= "c.code as type_code,c.libelle as payment_type"; $sql.= " FROM ".MAIN_DB_PREFIX."payment_expensereport as p"; @@ -1499,9 +1499,13 @@ else } print '
'.$langs->trans("DATE_SAVE").''.dol_print_date($object->date_create,'dayhour').'
'.dol_print_date($object->date_create,'dayhour'); + if ($object->status == 2 && $object->hasDelay('toapprove')) print ' '.img_warning($langs->trans("Late")); + if ($object->status == 5 && $object->hasDelay('topay')) print ' '.img_warning($langs->trans("Late")); + print '
'; print $form->select_dolusers($search_user, 'search_user', 1, '', 0, '', '', 0, 0, 0, '', 0, '', 'maxwidth300'); print '
'.$expensereportstatic->getNomUrl(1).''; + print $expensereportstatic->getNomUrl(1); + print $expensereportstatic->status; + if ($expensereportstatic->status == 2 && $expensereportstatic->hasDelay('toappove')) print img_warning($langs->trans("Late")); + if ($expensereportstatic->status == 5 && $expensereportstatic->hasDelay('topay')) print img_warning($langs->trans("Late")); + print ''.($objp->date_debut > 0 ? dol_print_date($objp->date_debut, 'day') : '').''.($objp->date_fin > 0 ? dol_print_date($objp->date_fin, 'day') : '').''.img_object($langs->trans("ShowUser"),"user").' '.dolGetFirstLastname($objp->firstname, $objp->lastname).''.price($objp->total_ht).''.price($objp->total_tva).''.price($objp->total_ttc).''; - //print $objp->status; - print $expensereporttmp->getLibStatut(5); + print $expensereportstatic->getLibStatut(5); print ''; print $projectstatic->getNomUrl(1); + if ($projectstatic->hasDelay()) print img_warning($langs->trans('Late')); print ''; print $taskstatic->getNomUrl(1,'withproject'); + if ($taskstatic->hasDelay()) print img_warning("Late"); print '
'; print ''; print ''; -print ''; -print ''; -print ''; -print ''; -print ''; -print ''; +print ''; +print ''; +print ''; +print ''; +print ''; +print ''; print ''; $oldyear=0; diff --git a/htdocs/compta/facture/stats/index.php b/htdocs/compta/facture/stats/index.php index 14f8c8d18f6..9ca0c2f7718 100644 --- a/htdocs/compta/facture/stats/index.php +++ b/htdocs/compta/facture/stats/index.php @@ -262,12 +262,12 @@ print '
'; print '
'.$langs->trans("Year").''.$langs->trans("NbOfProposals").'%'.$langs->trans("AmountTotal").'%'.$langs->trans("AmountAverage").'%'.$langs->trans("NbOfProposals").'%'.$langs->trans("AmountTotal").'%'.$langs->trans("AmountAverage").'%
'; print ''; print ''; -print ''; -print ''; -print ''; -print ''; -print ''; -print ''; +print ''; +print ''; +print ''; +print ''; +print ''; +print ''; print ''; $oldyear=0; diff --git a/htdocs/expensereport/stats/index.php b/htdocs/expensereport/stats/index.php index 6c515192f78..675d800145b 100644 --- a/htdocs/expensereport/stats/index.php +++ b/htdocs/expensereport/stats/index.php @@ -241,9 +241,9 @@ print '

'; print '
'.$langs->trans("Year").''.$langs->trans("NumberOfBills").'%'.$langs->trans("AmountTotal").'%'.$langs->trans("AmountAverage").'%'.$langs->trans("NumberOfBills").'%'.$langs->trans("AmountTotal").'%'.$langs->trans("AmountAverage").'%
'; print ''; print ''; -print ''; -print ''; -print ''; +print ''; +print ''; +print ''; print ''; $oldyear=0; From 29fab5457813b6b500f4d1091dad4d52cea27f00 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 6 Jun 2016 17:18:31 +0200 Subject: [PATCH 25/50] Fix box of last contracted contract (contract ref was not visible, label was wrong). --- htdocs/contrat/class/contrat.class.php | 25 +++++--- htdocs/core/boxes/box_contracts.php | 41 +++++------- htdocs/core/boxes/box_services_contracts.php | 66 ++++++++++++-------- 3 files changed, 73 insertions(+), 59 deletions(-) diff --git a/htdocs/contrat/class/contrat.class.php b/htdocs/contrat/class/contrat.class.php index d2c094fb025..47cde8e3f40 100644 --- a/htdocs/contrat/class/contrat.class.php +++ b/htdocs/contrat/class/contrat.class.php @@ -2220,18 +2220,18 @@ class Contrat extends CommonObject */ class ContratLigne extends CommonObjectLine { - + public $element='contratdet'; + public $table_element='contratdet'; + var $id; var $ref; var $tms; + var $fk_contrat; var $fk_product; var $statut; // 0 inactive, 4 active, 5 closed + var $type; // 0 for product, 1 for service var $label; - - public $element='contratdet'; - public $table_element='contratdet'; - /** * @var string * @deprecated Use $label instead @@ -2240,6 +2240,10 @@ class ContratLigne extends CommonObjectLine public $libelle; var $description; + + var $product_ref; + var $product_label; + var $date_commande; var $date_ouverture_prevue; // date start planned var $date_ouverture; // date start real @@ -2379,16 +2383,17 @@ class ContratLigne extends CommonObjectLine $result=''; $label=$langs->trans("ShowContractOfService").': '.$this->label; - + if (empty($label)) $label=$this->description; + $link = ''; $linkend=''; - $picto='contract'; - + $picto='service'; + if ($this->type == 0) $picto='product'; if ($withpicto) $result.=($link.img_object($label, $picto, 'class="classfortooltip"').$linkend); if ($withpicto && $withpicto != 2) $result.=' '; - if ($withpicto != 2) $result.=$link.$this->label.$linkend; + if ($withpicto != 2) $result.=$link.($this->product_ref?$this->product_ref.' ':'').($this->label?$this->label:$this->description).$linkend; return $result; } @@ -2417,6 +2422,7 @@ class ContratLigne extends CommonObjectLine $sql.= " p.ref as product_ref,"; $sql.= " p.label as product_label,"; $sql.= " p.description as product_desc,"; + $sql.= " p.type as product_type,"; $sql.= " t.description,"; $sql.= " t.date_commande,"; $sql.= " t.date_ouverture_prevue as date_ouverture_prevue,"; @@ -2467,6 +2473,7 @@ class ContratLigne extends CommonObjectLine $this->product_ref = $obj->product_ref; $this->product_label = $obj->product_label; $this->product_description = $obj->product_description; + $this->product_type = $obj->product_type; $this->label = $obj->label; // deprecated. We do not use this field. Only ref and label of product, and description of contract line $this->description = $obj->description; $this->date_commande = $this->db->jdate($obj->date_commande); diff --git a/htdocs/core/boxes/box_contracts.php b/htdocs/core/boxes/box_contracts.php index 58b5dc7f1fa..665bff4c6da 100644 --- a/htdocs/core/boxes/box_contracts.php +++ b/htdocs/core/boxes/box_contracts.php @@ -55,13 +55,15 @@ class box_contracts extends ModeleBoxes $this->max=$max; include_once DOL_DOCUMENT_ROOT.'/contrat/class/contrat.class.php'; - $contractstatic=new Contrat($db); - + $this->info_box_head = array('text' => $langs->trans("BoxTitleLastContracts",$max)); if ($user->rights->contrat->lire) { - $sql = "SELECT s.nom as name, s.rowid as socid,"; + $contractstatic=new Contrat($db); + $thirdpartytmp=new Societe($db); + + $sql = "SELECT s.nom as name, s.rowid as socid,"; $sql.= " c.rowid, c.ref, c.statut as fk_statut, c.date_contrat, c.datec, c.fin_validite, c.date_cloture"; $sql.= " FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."contrat as c"; if (!$user->rights->societe->client->voir && !$user->societe_id) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; @@ -80,7 +82,10 @@ class box_contracts extends ModeleBoxes $line = 0; - while ($line < $num) { + $langs->load("contracts"); + + while ($line < $num) + { $objp = $db->fetch_object($resql); $datec=$db->jdate($objp->datec); $dateterm=$db->jdate($objp->fin_validite); @@ -89,38 +94,26 @@ class box_contracts extends ModeleBoxes $contractstatic->statut=$objp->fk_statut; $contractstatic->id=$objp->rowid; + $contractstatic->ref=$objp->ref; $result=$contractstatic->fetch_lines(); + $thirdpartytmp->name = $objp->name; + $thirdpartytmp->id = $objp->socid; + // fin_validite is no more on contract but on services // if ($objp->fk_statut == 1 && $dateterm < ($now - $conf->contrat->cloture->warning_delay)) { $late = img_warning($langs->trans("Late")); } - $this->info_box_contents[$line][] = array( - 'td' => 'align="left" width="16"', - 'logo' => $this->boximg, - 'tooltip' => $langs->trans('Contract').': '.($objp->ref?$objp->ref:$objp->rowid), - 'url' => DOL_URL_ROOT."/contrat/card.php?id=".$objp->rowid, - ); - $this->info_box_contents[$line][] = array( 'td' => 'align="left"', - 'text' => ($objp->ref?$objp->ref:$objp->rowid), // Some contracts have no ref - 'tooltip' => $langs->trans('Contract').': '.($objp->ref?$objp->ref:$objp->rowid), + 'text' => $contractstatic->getNomUrl(1), 'text2'=> $late, - 'url' => DOL_URL_ROOT."/contrat/card.php?id=".$objp->rowid, - ); - - $this->info_box_contents[$line][] = array( - 'td' => 'align="left" width="16"', - 'logo' => 'company', - 'tooltip' => $langs->trans('Customer').': '.$objp->name, - 'url' => DOL_URL_ROOT."/comm/card.php?socid=".$objp->socid, + 'asis'=>1 ); $this->info_box_contents[$line][] = array( 'td' => 'align="left"', - 'text' => dol_trunc($objp->name,40), - 'tooltip' => $langs->trans('Customer').': '.$objp->name, - 'url' => DOL_URL_ROOT."/comm/card.php?socid=".$objp->socid, + 'text' => $thirdpartytmp->getNomUrl(1), + 'asis'=>1 ); $this->info_box_contents[$line][] = array( diff --git a/htdocs/core/boxes/box_services_contracts.php b/htdocs/core/boxes/box_services_contracts.php index eb48fc83d2b..c38b99263ba 100644 --- a/htdocs/core/boxes/box_services_contracts.php +++ b/htdocs/core/boxes/box_services_contracts.php @@ -56,26 +56,28 @@ class box_services_contracts extends ModeleBoxes $this->max=$max; include_once DOL_DOCUMENT_ROOT.'/contrat/class/contrat.class.php'; - $contratlignestatic=new ContratLigne($db); $this->info_box_head = array('text' => $langs->trans("BoxLastProductsInContract",$max)); if ($user->rights->service->lire && $user->rights->contrat->lire) { + $contractstatic=new Contrat($db); + $contratlignestatic=new ContratLigne($db); + $thirdpartytmp = new Societe($db); + $sql = "SELECT s.nom as name, s.rowid as socid,"; - $sql.= " c.rowid,"; - $sql.= " cd.rowid as cdid, cd.tms as datem, cd.statut,"; - $sql.= " p.rowid as pid, p.label, p.fk_product_type"; + $sql.= " c.rowid, c.ref, c.statut as contract_status,"; + $sql.= " cd.rowid as cdid, cd.tms as datem, cd.statut, cd.label, cd.description, cd.product_type as type,"; + $sql.= " p.rowid as product_id, p.ref as product_ref"; $sql.= " FROM (".MAIN_DB_PREFIX."societe as s"; $sql.= ", ".MAIN_DB_PREFIX."contrat as c"; $sql.= ", ".MAIN_DB_PREFIX."contratdet as cd"; - $sql.= ", ".MAIN_DB_PREFIX."product as p"; + $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."product as p ON cd.fk_product = p.rowid"; if (!$user->rights->societe->client->voir && !$user->societe_id) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; $sql.= ")"; $sql.= " WHERE c.entity = ".$conf->entity; $sql.= " AND s.rowid = c.fk_soc"; $sql.= " AND c.rowid = cd.fk_contrat"; - $sql.= " AND cd.fk_product = p.rowid"; if (!$user->rights->societe->client->voir && !$user->societe_id) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id; if($user->societe_id) $sql.= " AND s.rowid = ".$user->societe_id; $sql.= $db->order("c.tms","DESC"); @@ -94,12 +96,27 @@ class box_services_contracts extends ModeleBoxes $objp = $db->fetch_object($result); $datem=$db->jdate($objp->datem); + $contratlignestatic->id=$objp->cdid; + $contratlignestatic->fk_contrat=$objp->rowid; + $contratlignestatic->label=$objp->label; + $contratlignestatic->description=$objp->description; + $contratlignestatic->type=$objp->type; + $contratlignestatic->product_id=$objp->product_id; + $contratlignestatic->product_ref=$objp->product_ref; + + $contractstatic->statut=$objp->contract_status; + $contractstatic->id=$objp->rowid; + $contractstatic->ref=$objp->ref; + + $thirdpartytmp->name = $objp->name; + $thirdpartytmp->id = $objp->socid; + // Multilangs if (! empty($conf->global->MAIN_MULTILANGS)) // si l'option est active { $sqld = "SELECT label"; $sqld.= " FROM ".MAIN_DB_PREFIX."product_lang"; - $sqld.= " WHERE fk_product=".$objp->pid; + $sqld.= " WHERE fk_product=".$objp->product_id; $sqld.= " AND lang='". $langs->getDefaultLang() ."'"; $sqld.= " LIMIT 1"; @@ -107,32 +124,29 @@ class box_services_contracts extends ModeleBoxes if ($resultd) { $objtp = $db->fetch_object($resultd); - if ($objtp->label != '') $objp->label = $objtp->label; + if ($objtp->label != '') $contratlignestatic->label = $objtp->label; } } - $this->info_box_contents[$i][0] = array('td' => 'align="left" width="16"', - 'logo' => ($objp->fk_product_type==1?'object_service':'object_product'), - 'url' => DOL_URL_ROOT."/contrat/card.php?id=".$objp->rowid); + $this->info_box_contents[$i][] = array('td' => 'align="left"', + 'text' => $contratlignestatic->getNomUrl(1), + 'asis' => 1 + ); + + $this->info_box_contents[$i][] = array('td' => 'align="left"', + 'text' => $contractstatic->getNomUrl(1), + 'asis' => 1 + ); - $this->info_box_contents[$i][1] = array('td' => 'align="left"', - 'text' => $objp->label, - 'maxlength' => 16, - 'url' => DOL_URL_ROOT."/contrat/card.php?id=".$objp->rowid); + $this->info_box_contents[$i][] = array('td' => 'align="left"', + 'text' => $thirdpartytmp->getNomUrl(1), + 'asis' => 1 + ); - $this->info_box_contents[$i][2] = array('td' => 'align="left" width="16"', - 'logo' => 'company', - 'url' => DOL_URL_ROOT."/comm/card.php?socid=".$objp->socid); - - $this->info_box_contents[$i][3] = array('td' => 'align="left"', - 'text' => $objp->name, - 'maxlength' => 28, - 'url' => DOL_URL_ROOT."/comm/card.php?socid=".$objp->socid); - - $this->info_box_contents[$i][4] = array('td' => 'align="right"', + $this->info_box_contents[$i][] = array('td' => 'align="right"', 'text' => dol_print_date($datem,'day')); - $this->info_box_contents[$i][5] = array('td' => 'align="right" width="18"', + $this->info_box_contents[$i][] = array('td' => 'align="right" width="18"', 'text' => $contratlignestatic->LibStatut($objp->statut,3) ); From 92da0cfe38348bfa97c5684505ac751370bf8562 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 6 Jun 2016 17:21:18 +0200 Subject: [PATCH 26/50] Fix text sticked on picto. --- htdocs/contrat/services.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/contrat/services.php b/htdocs/contrat/services.php index e1616026cbc..d0962ad757e 100644 --- a/htdocs/contrat/services.php +++ b/htdocs/contrat/services.php @@ -267,14 +267,14 @@ if ($resql) $productstatic->type=$obj->ptype; $productstatic->ref=$obj->pref; $productstatic->entity=$obj->pentity; - print $productstatic->getNomUrl(1,'',20); + print $productstatic->getNomUrl(1,'',24); print $obj->label?' - '.dol_trunc($obj->label,16):''; if (! empty($obj->description) && ! empty($conf->global->PRODUCT_DESC_IN_LIST)) print '
'.dol_nl2br($obj->description); } else { - if ($obj->type == 0) print img_object($obj->description,'product').dol_trunc($obj->description,20); - if ($obj->type == 1) print img_object($obj->description,'service').dol_trunc($obj->description,20); + if ($obj->type == 0) print img_object($obj->description,'product').' '.dol_trunc($obj->description,24); + if ($obj->type == 1) print img_object($obj->description,'service').' '.dol_trunc($obj->description,24); } print ''; From 2918dcfde44e45ca67e91302e0e99589023a7378 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 6 Jun 2016 17:25:44 +0200 Subject: [PATCH 27/50] Fix missing include --- htdocs/fourn/commande/list.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/fourn/commande/list.php b/htdocs/fourn/commande/list.php index 5febca7cf15..5196c6b973b 100644 --- a/htdocs/fourn/commande/list.php +++ b/htdocs/fourn/commande/list.php @@ -29,6 +29,7 @@ require '../../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.class.php'; require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.commande.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; From e47ca0b4c38b6d8363929c23e026f8b25af61f50 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 6 Jun 2016 19:17:15 +0200 Subject: [PATCH 28/50] Enable new modules --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 37c04fecd7a..8655b27d4ed 100644 --- a/.travis.yml +++ b/.travis.yml @@ -285,7 +285,7 @@ script: php upgrade2.php 3.8.0 3.9.0 > $TRAVIS_BUILD_DIR/upgrade380390-2.log php step5.php 3.8.0 3.9.0 > $TRAVIS_BUILD_DIR/upgrade380390-3.log php upgrade.php 3.9.0 4.0.0 ignoredbversion > $TRAVIS_BUILD_DIR/upgrade390400.log - php upgrade2.php 3.9.0 4.0.0 MAIN_MODULE_API > $TRAVIS_BUILD_DIR/upgrade390400-2.log + php upgrade2.php 3.9.0 4.0.0 MAIN_MODULE_API,MAIN_MODULE_SUPPLIERPROPOSAL > $TRAVIS_BUILD_DIR/upgrade390400-2.log php step5.php 3.9.0 4.0.0 > $TRAVIS_BUILD_DIR/upgrade390400-3.log cd - set +e From a6a96c710d91295c9a787e30d1a7fb70ca4f0f08 Mon Sep 17 00:00:00 2001 From: aspangaro Date: Mon, 6 Jun 2016 20:36:04 +0200 Subject: [PATCH 29/50] Restore note page --- htdocs/core/lib/loan.lib.php | 10 ++++ htdocs/loan/note.php | 101 +++++++++++++++++++++++++++++++++++ 2 files changed, 111 insertions(+) create mode 100644 htdocs/loan/note.php diff --git a/htdocs/core/lib/loan.lib.php b/htdocs/core/lib/loan.lib.php index ad578c2e7d3..fa80fe31a2b 100644 --- a/htdocs/core/lib/loan.lib.php +++ b/htdocs/core/lib/loan.lib.php @@ -41,6 +41,16 @@ function loan_prepare_head($object) $head[$tab][2] = 'card'; $tab++; + if (empty($conf->global->MAIN_DISABLE_NOTES_TAB)) + { + $nbNote = (empty($object->note_private)?0:1)+(empty($object->note_public)?0:1); + $head[$tab][0] = DOL_URL_ROOT."/loan/note.php?id=".$object->id; + $head[$tab][1] = $langs->trans("Notes"); + if($nbNote > 0) $head[$tab][1].= ' '.$nbNote.''; + $head[$tab][2] = 'note'; + $tab++; + } + // Show more tabs from modules // Entries must be declared in modules descriptor with line // $this->tabs = array('entity:+tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to add new tab diff --git a/htdocs/loan/note.php b/htdocs/loan/note.php new file mode 100644 index 00000000000..155dacf460b --- /dev/null +++ b/htdocs/loan/note.php @@ -0,0 +1,101 @@ + + * Copyright (C) 2004-2007 Laurent Destailleur + * Copyright (C) 2005-2012 Regis Houssin + * Copyright (C) 2013 Florian Henry + * Copyright (C) 2015 Frederic France + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +/** + * \file htdocs/loan/note.php + * \brief Tab for notes on loan + * \ingroup loan + */ + +require '../main.inc.php'; +require_once(DOL_DOCUMENT_ROOT.'/loan/class/loan.class.php'); +require_once DOL_DOCUMENT_ROOT.'/core/lib/loan.lib.php'; + +$action = GETPOST('action'); + +$langs->load('loan'); + +// Security check +$id = GETPOST('id','int'); +$result = restrictedArea($user, 'loan', $id, '&loan'); + +$object = new Loan($db); +if ($id > 0) $object->fetch($id); + +$permissionnote=$user->rights->loan->write; // Used by the include of actions_setnotes.inc.php + + +/* + * Actions + */ + +include DOL_DOCUMENT_ROOT.'/core/actions_setnotes.inc.php'; // Must be include, not include_once + + +/* + * View + */ + +$form = new Form($db); + +llxHeader('',$langs->trans("Loan"),''); + +if ($id > 0) +{ + /* + * Affichage onglets + */ + + $head = loan_prepare_head($object); + + dol_fiche_head($head, 'note', $langs->trans("Loan"), 0, 'bill'); + + + print '
'; + print ''; + + print '
'.$langs->trans("Year").''.$langs->trans("Number").''.$langs->trans("AmountTotal").''.$langs->trans("AmountAverage").''.$langs->trans("Number").''.$langs->trans("AmountTotal").''.$langs->trans("AmountAverage").'
'; + + // Ref + print ''; + print ''; + // Name + print ''; + print ''; + + print "
'.$langs->trans('Ref').''; + print $form->showrefnav($object,'id','',1,'rowid','ref'); + print '
'.$langs->trans("Name").''.$object->label.'
"; + + print '
'; + + //$colwidth='25'; + $cssclass='titlefield'; + $permission = $user->rights->loan->write; // Used by the include of notes.tpl.php + include DOL_DOCUMENT_ROOT.'/core/tpl/notes.tpl.php'; + + + dol_fiche_end(); +} + +llxFooter(); +$db->close(); + From cc8db0d0df54a769033e8f35d9fc7f6cb6531acb Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 6 Jun 2016 21:26:31 +0200 Subject: [PATCH 30/50] FIX #2605 Request 4 - Missing last supplier proposal on thirdparty card. --- htdocs/fourn/card.php | 74 ++++++++++++++++++++++- htdocs/langs/en_US/supplier_proposal.lang | 2 + htdocs/theme/eldy/style.css.php | 7 ++- htdocs/theme/md/style.css.php | 18 +++++- 4 files changed, 96 insertions(+), 5 deletions(-) diff --git a/htdocs/fourn/card.php b/htdocs/fourn/card.php index 8c533f0f547..3c8ad35e141 100644 --- a/htdocs/fourn/card.php +++ b/htdocs/fourn/card.php @@ -31,6 +31,7 @@ require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.class.php'; require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.facture.class.php'; +require_once DOL_DOCUMENT_ROOT.'/supplier_proposal/class/supplier_proposal.class.php'; require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php'; @@ -343,6 +344,78 @@ if ($object->id > 0) print '
'; } + + /* + * Last supplier proposal + */ + $proposalstatic = new SupplierProposal($db); + + if ($user->rights->supplier_proposal->lire) + { + $sql = "SELECT p.rowid, p.ref, p.date_valid as dc, p.fk_statut, p.total_ht, p.tva as total_tva, p.total as total_ttc"; + $sql.= " FROM ".MAIN_DB_PREFIX."supplier_proposal as p "; + $sql.= " WHERE p.fk_soc =".$object->id; + $sql.= " AND p.entity =".$conf->entity; + $sql.= " ORDER BY p.date_valid DESC"; + $sql.= " ".$db->plimit($MAXLIST); + + $resql=$db->query($sql); + if ($resql) + { + $i = 0 ; + $num = $db->num_rows($resql); + + if ($num > 0) + { + print ''; + + print ''; + print ''; + } + + $var = True; + while ($i < $num && $i <= $MAXLIST) + { + $obj = $db->fetch_object($resql); + $var=!$var; + + print ""; + print ''; + print ''; + print ''; + print ''; + $i++; + } + $db->free($resql); + + if ($num >0) print "
'; + print ''; + print ''; + print ''; + print '
'.$langs->trans("LastSupplierProposals",($num<$MAXLIST?"":$MAXLIST)).''.$langs->trans("AllPriceRequests").' '.$num.''.img_picto($langs->trans("Statistics"),'stats').'
'; + print '
'; + $proposalstatic->id = $obj->rowid; + $proposalstatic->ref = $obj->ref; + $proposalstatic->total_ht = $obj->total_ht; + $proposalstatic->total_tva = $obj->total_tva; + $proposalstatic->total_ttc = $obj->total_ttc; + print $proposalstatic->getNomUrl(1); + print ''; + if ($obj->dc) + { + print dol_print_date($db->jdate($obj->dc),'day'); + } + else + { + print "-"; + } + print ''.$proposalstatic->LibStatut($obj->fk_statut,5).'
"; + } + else + { + dol_print_error($db); + } + } /* * Last supplier orders @@ -441,7 +514,6 @@ if ($object->id > 0) /* * Last supplier invoices */ - $MAXLIST=5; $langs->load('bills'); $facturestatic = new FactureFournisseur($db); diff --git a/htdocs/langs/en_US/supplier_proposal.lang b/htdocs/langs/en_US/supplier_proposal.lang index 988e377d4df..394d4cabe01 100644 --- a/htdocs/langs/en_US/supplier_proposal.lang +++ b/htdocs/langs/en_US/supplier_proposal.lang @@ -59,3 +59,5 @@ DefaultModelSupplierProposalClosed=Default template when closing a price request ListOfSupplierProposal=List of supplier proposal requests SupplierProposalsToClose=Supplier proposals to close SupplierProposalsToProcess=Supplier proposals to process +LastSupplierProposals=Last price requests +AllPriceRequests=All requests \ No newline at end of file diff --git a/htdocs/theme/eldy/style.css.php b/htdocs/theme/eldy/style.css.php index a75c808b69d..733c190fba6 100644 --- a/htdocs/theme/eldy/style.css.php +++ b/htdocs/theme/eldy/style.css.php @@ -730,6 +730,11 @@ div.ficheaddleft { } } +/* For table into table into card */ +div.ficheaddleft tr.liste_titre:first-child td table.nobordernopadding td { + padding: 0 0 0 0; +} + .containercenter { display : table; margin : 0px auto; @@ -2235,7 +2240,7 @@ table.liste tr, table.noborder tr, div.noborder form { min-height: 20px; } table.liste th, table.noborder th, table.noborder tr.liste_titre td, table.noborder tr.box_titre td { - padding: 10px 2px 10px 3px; /* t r b l */ + padding: 8px 2px 8px 3px; /* t r b l */ } tr.box_titre .nobordernopadding td { padding: 0px ! important; } table.liste td, table.noborder td, div.noborder form, div.noborder form div { diff --git a/htdocs/theme/md/style.css.php b/htdocs/theme/md/style.css.php index 68fd5d25e5f..3454c20ff09 100644 --- a/htdocs/theme/md/style.css.php +++ b/htdocs/theme/md/style.css.php @@ -785,6 +785,15 @@ div.ficheaddleft { } } +/* For table into table into card */ +div.ficheaddleft tr.liste_titre:first-child td table.nobordernopadding td { + padding: 0 0 0 0; +} + +table.noborder tr.liste_titre td { + padding: 3px !important; +} + .containercenter { display : table; margin : 0px auto; @@ -844,7 +853,7 @@ img.photoref { .underrefbanner { } .underbanner { - border-bottom: 2px solid rgb();; + border-bottom: 1px solid rgb();; } @@ -1874,7 +1883,10 @@ span.tabspan { /* Boutons actions */ /* ============================================================================== */ -div.divButAction { margin-bottom: 1.4em; } +div.divButAction { + margin-bottom: 1.4em; + vertical-align: top; +} span.butAction, span.butActionDelete { cursor: pointer; @@ -2129,7 +2141,7 @@ table.noborder tr, div.noborder form { } table.liste th, table.noborder th, table.noborder tr.liste_titre td { - padding: 12px 2px 12px 3px; /* t r b l */ + padding: 8px 2px 8px 3px; /* t r b l */ } table.noborder td, div.noborder form, div.noborder form div { padding: 4px 2px 4px 3px; /* t r b l */ From 645412517d44acbbeedea32d8b0ca0dc600a0ebf Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 6 Jun 2016 22:07:35 +0200 Subject: [PATCH 31/50] css enhancement --- htdocs/comm/action/index.php | 4 ++-- htdocs/core/lib/functions.lib.php | 5 +++-- htdocs/theme/eldy/style.css.php | 3 +++ htdocs/theme/md/style.css.php | 12 ++++++++---- 4 files changed, 16 insertions(+), 8 deletions(-) diff --git a/htdocs/comm/action/index.php b/htdocs/comm/action/index.php index 02a949c7218..5306300e7b1 100644 --- a/htdocs/comm/action/index.php +++ b/htdocs/comm/action/index.php @@ -1,7 +1,7 @@ * Copyright (C) 2003 Eric Seigne - * Copyright (C) 2004-2015 Laurent Destailleur + * Copyright (C) 2004-2016 Laurent Destailleur * Copyright (C) 2005-2012 Regis Houssin * Copyright (C) 2011 Juanjo Menent * Copyright (C) 2014 Cedric GROSS @@ -425,7 +425,7 @@ else // If javascript off $link.='
'; } -print load_fiche_titre($s, $link.'     '.$nav, ''); +print load_fiche_titre($s, $link.'     '.$nav, '', 0, 0, 'tablelistofcalendars'); // Load events from database into $eventarray diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index f48b615c3fa..e07ca6cc6c4 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -2981,10 +2981,11 @@ function print_fiche_titre($title, $mesg='', $picto='title_generic.png', $pictoi * @param string $picto Icon to use before title (should be a 32x32 transparent png file) * @param int $pictoisfullpath 1=Icon name is a full absolute url of image * @param int $id To force an id on html objects + * @param string $morecssontable More css on table * @return string * @see print_barre_liste */ -function load_fiche_titre($titre, $mesg='', $picto='title_generic.png', $pictoisfullpath=0, $id=0) +function load_fiche_titre($titre, $mesg='', $picto='title_generic.png', $pictoisfullpath=0, $id=0, $morecssontable='') { global $conf; @@ -2994,7 +2995,7 @@ function load_fiche_titre($titre, $mesg='', $picto='title_generic.png', $pictois if (($conf->browser->name == 'ie') && $picto=='title.png') $picto='title.gif'; $return.= "\n"; - $return.= ''; + $return.= '
'; if ($picto) $return.= ''; $return.= ''; + print ''; print ''; print ''; print ''; diff --git a/htdocs/core/tpl/resource_view.tpl.php b/htdocs/core/tpl/resource_view.tpl.php index dd775662db6..7b2a6f43f4d 100644 --- a/htdocs/core/tpl/resource_view.tpl.php +++ b/htdocs/core/tpl/resource_view.tpl.php @@ -5,34 +5,33 @@ $form= new Form($db); +print '
'; + +if($mode == 'edit' ) +{ + print '
'; + print '
'.$langs->trans('Resource').'
'; + print '
'.$langs->trans('Type').'
'; + print '
'.$langs->trans('Busy').'
'; + print '
'.$langs->trans('Mandatory').'
'; + print '
'; + print ''; +} +else +{ + print '
'; + print '
'.$langs->trans('Resource').'
'; + print '
'.$langs->trans('Type').'
'; + print '
'.$langs->trans('Busy').'
'; + print '
'.$langs->trans('Mandatory').'
'; + print '
'; + print ''; +} + if( (array) $linked_resources && count($linked_resources) > 0) { $var=true; - print '
'; - - if($mode == 'edit' ) - { - print '
'; - print '
'.$langs->trans('Resource').'
'; - print '
'.$langs->trans('Type').'
'; - print '
'.$langs->trans('Busy').'
'; - print '
'.$langs->trans('Mandatory').'
'; - print '
'; - print ''; - } - else - { - print '
'; - print '
'.$langs->trans('Resource').'
'; - print '
'.$langs->trans('Type').'
'; - print '
'.$langs->trans('Busy').'
'; - print '
'.$langs->trans('Mandatory').'
'; - print '
'; - print ''; - } - - foreach ($linked_resources as $linked_resource) { $var=!$var; @@ -56,7 +55,6 @@ if( (array) $linked_resources && count($linked_resources) > 0) print '
'.$form->selectyesno('mandatory',$linked_resource['mandatory']?1:0,1).'
'; print '
'; print ''; - } else { @@ -96,11 +94,13 @@ if( (array) $linked_resources && count($linked_resources) > 0) } } - print '
'; } else { - print '
'.$langs->trans('NoResourceLinked').'
'; + print '
'.$langs->trans('NoResourceLinked').'
'; } + +print '
'; + ?> diff --git a/htdocs/projet/list.php b/htdocs/projet/list.php index 2e78ea94bbf..2f45d2b782b 100644 --- a/htdocs/projet/list.php +++ b/htdocs/projet/list.php @@ -425,7 +425,7 @@ if ($resql) print $hookmanager->resPrint; if (! empty($arrayfields['p.datec']['checked'])) print_liste_field_titre($arrayfields['p.datec']['label'],$_SERVER["PHP_SELF"],"p.datec","",$param,'align="center" class="nowrap"',$sortfield,$sortorder); if (! empty($arrayfields['p.tms']['checked'])) print_liste_field_titre($arrayfields['p.tms']['label'],$_SERVER["PHP_SELF"],"p.tms","",$param,'align="center" class="nowrap"',$sortfield,$sortorder); - if (! empty($arrayfields['p.fk_statut']['checked'])) print_liste_field_titre($arrayfields['p.fk_statut']['label'],$_SERVER["PHP_SELF"],"p.fk_statut","",$param,'align="center"',$sortfield,$sortorder); + if (! empty($arrayfields['p.fk_statut']['checked'])) print_liste_field_titre($arrayfields['p.fk_statut']['label'],$_SERVER["PHP_SELF"],"p.fk_statut","",$param,'align="right"',$sortfield,$sortorder); print_liste_field_titre($selectedfields, $_SERVER["PHP_SELF"],"",'','','align="right"',$sortfield,$sortorder,'maxwidthsearch '); print "\n"; diff --git a/htdocs/resource/element_resource.php b/htdocs/resource/element_resource.php index 59a95f6f57a..7cb5b74fac3 100644 --- a/htdocs/resource/element_resource.php +++ b/htdocs/resource/element_resource.php @@ -168,7 +168,7 @@ if($ret == -1) { dol_print_error($db,$object->error); exit; } -if(!$ret) { +if (!$ret) { print '
'.$langs->trans('NoResourceInDatabase').'
'; } else @@ -304,6 +304,7 @@ else //print load_fiche_titre($langs->trans('ResourcesLinkedToElement'),'',''); + // Show list of resource links foreach ($object->available_resources as $modresources => $resources) { diff --git a/htdocs/theme/eldy/img/object_calendargantt.png b/htdocs/theme/eldy/img/object_calendargantt.png new file mode 100644 index 0000000000000000000000000000000000000000..4d727dd6f2428dc349cbdba254e041b1709d9a63 GIT binary patch literal 242 zcmeAS@N?(olHy`uVBq!ia0vp^JV4CN!2~3a2>s>&Qfx`y?k+$Y2!1;6t_M<_1s;*b z3=CW!K$y{KjmZq4AbW|YuPgflHg+xx>tvQSMnIu@PZ!4!iOb1z%wDrHI~wF(>;4Y` zudc3+kUTw2H#spOAz*(Q@2bbQw$6@)IqwFr*vY zS>qnM#V&;V>WOTFbO+Iux8t2nAKg0J9QESbU7HoHISjKN&yeU~&^b}|IB5gNhc~+` cCN_97gjf657rkZ>2Renp)78&qol`;+00TQ!egFUf literal 0 HcmV?d00001 diff --git a/htdocs/theme/eldy/img/object_calendarpertype.png b/htdocs/theme/eldy/img/object_calendarpertype.png new file mode 100644 index 0000000000000000000000000000000000000000..ba16a4ab6c0dfe3a033f2739a587e8c4b567d181 GIT binary patch literal 198 zcmeAS@N?(olHy`uVBq!ia0vp^JV4CN!VDyL#uerODaPU;cPEB*=VV?2IYI$GA+Gbw zw*3G9f7!BS(`LQ6di5%hZTl)U5Tvvu$S;_|;n|He5GTpo-G!lpRn`N@;VkfoEM{Qf z`T)X=PHRkN00r4gJbhi+?{RXltFf1CoSO_3Qt)(f4B@z*Y{16McKJcT^$7|RsTw>Y i#!7AiYi@TiGBMOF<2MpC+~@;T%i!ti=d#Wzp$PyHSUGC| literal 0 HcmV?d00001 diff --git a/htdocs/theme/eldy/img/object_resource.png b/htdocs/theme/eldy/img/object_resource.png index 8cda1f3f2202f020c2aa7f0438b72e06f559c83e..2d93019b62f353d5e43b2e617f940ab5b178071b 100644 GIT binary patch delta 101 zcmX@kc$9I1%0xrA=m%`<+I)z)Ukz$zQl$f3c(vMhj?LGuXzW!;$Bu|Pu@JYD@<);T3K F0RZR@7*7BI delta 101 zcmX@gc${&93KwH>kh>GZx^prwCn|ad+-71DV3S`w;mQ&Q1_nJ(7sn8e>&XF3%xt3U z;$rOX5~5seJc{S^ba>VoXx)(D@R4+K@QO(k2@zPt$RHHScXhfFt2j_6gQu&X%Q~lo FCIFu^8fO3i diff --git a/htdocs/theme/eldy/style.css.php b/htdocs/theme/eldy/style.css.php index 20ee581f318..d7b0aeb1bb6 100644 --- a/htdocs/theme/eldy/style.css.php +++ b/htdocs/theme/eldy/style.css.php @@ -100,6 +100,7 @@ $fontsizesmaller='11'; $usegradienttop=(isset($conf->global->THEME_ELDY_TOPMENU_BACK1)?0:1); $usegradienttitle=(isset($conf->global->THEME_ELDY_BACKTITLE1)?0:1); $useboldtitle=(isset($conf->global->THEME_ELDY_USEBOLDTITLE)?$conf->global->THEME_ELDY_USEBOLDTITLE:1); +$borderwith=2; // Case of option always editable if (! isset($conf->global->THEME_ELDY_BACKBODY)) $conf->global->THEME_ELDY_BACKBODY=$colorbackbody; @@ -800,7 +801,7 @@ img.photoref { .underrefbanner { } .underbanner { - border-bottom: 2px solid rgb(); + border-bottom: px solid rgb(); } @@ -2199,7 +2200,7 @@ table.liste, table.noborder, table.formdoc, div.noborder { border-collapse: separate !important; border-spacing: 0px; - border-top-width: 2px; + border-top-width: px; border-top-color: rgb(); border-top-style: solid; @@ -2566,7 +2567,7 @@ div.liste_titre { border-top-style: solid; } div.liste_titre_bydiv { - border-top-width: 2px; + border-top-width: px; border-top-color: rgb(); border-top-style: solid; @@ -2654,6 +2655,12 @@ form.liste_total div { border-bottom: none; } +.margintable { + border-top-width: px !important; + border-top-color: rgb() !important; + border-top-style: solid !important; +} + .margintable td { border: 0px !important; } diff --git a/htdocs/theme/md/img/object_calendargantt.png b/htdocs/theme/md/img/object_calendargantt.png new file mode 100644 index 0000000000000000000000000000000000000000..b49fe7b2bfb4cab99e1c5a8835c35e7c12b0c690 GIT binary patch literal 219 zcmeAS@N?(olHy`uVBq!ia0vp^LLkh+0wn(&ce?|mn3BBRT^L+$+br7+4nJ za0`PlBg3pY5H=O_6Kb2+{|VQM?)KcLOGr;jv*T7*G_cgYB1noQNOf#{imCj z-GBS!SFi_59laoS$0^Zyh7PCC$^fPP3=`G{+}Zt?Q6VkKQ?+!9Py4m+`Cp$%-Q4w< zi94nJ za0`PlBg3pY5H=O_6Kb2T-KJ$)aTs=3gvmaIEHAPUpwIv%H6o%q>%y zlP7{69bc$)uTyQ>`f1*m#q1O(>bzs@i1aurypLgrPtK0JD;vYz7j6kXb!U#syNZ^) zE9*@Vv#F= PHZyp-`njxgN@xNA4pvVi literal 0 HcmV?d00001 diff --git a/htdocs/theme/md/img/object_calendarperuser.png b/htdocs/theme/md/img/object_calendarperuser.png index 98a013a40148fb41b2ab42dcdd6d609ee7d4016f..244da5bedd05d02e58217b515d48708bc4052b1c 100644 GIT binary patch delta 192 zcmV;x06+g~-2sp!e*$7lM??Tb+dQVb00009a7bBm000XU000XU0RWnu7ytkO2XskI zMF-#p2MRkmrYD}=0001PNklV#P-iaobua-;G z7Cs@7Ebak_SxChbz5uvPY`ER2fmcVNv{lO7oFwjegl^QYI&`m`$^^ZZ=}hIH+KJP| u%BmH)W*X@5gj#O|5A`PY;?ew{`4t;x87xBz7FnnO0000Cg>D`$S*0q6Qmxj}hvpx solid rgb();; + border-bottom: px solid rgb(); } From 5db6bcd4a8c3268e3f5c0c06a4190c4cb7d38e6a Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 7 Jun 2016 14:06:00 +0200 Subject: [PATCH 34/50] Fix contextpage lost on submitting form or sorting --- htdocs/adherents/cotisations.php | 3 ++- htdocs/comm/action/listactions.php | 1 + htdocs/comm/propal/list.php | 3 ++- htdocs/commande/list.php | 3 ++- htdocs/compta/charges/index.php | 1 + htdocs/compta/facture/fiche-rec.php | 1 + htdocs/compta/facture/list.php | 1 + htdocs/compta/paiement/cheque/list.php | 1 + htdocs/compta/paiement/list.php | 1 + htdocs/compta/salaries/index.php | 3 ++- htdocs/compta/sociales/index.php | 3 ++- htdocs/compta/tva/clients.php | 2 +- htdocs/compta/tva/quadri_detail.php | 2 +- htdocs/compta/tva/reglement.php | 3 ++- htdocs/contact/list.php | 1 + htdocs/contrat/list.php | 1 + htdocs/expedition/list.php | 3 ++- htdocs/fichinter/list.php | 3 ++- htdocs/fourn/commande/list.php | 1 + htdocs/loan/index.php | 1 + htdocs/product/list.php | 6 ++++-- htdocs/product/stock/list.php | 3 ++- htdocs/product/stock/productlot_list.php | 16 +++++++--------- htdocs/projet/list.php | 10 ++++++---- htdocs/projet/tasks/list.php | 5 +++-- htdocs/societe/consumption.php | 3 ++- htdocs/societe/list.php | 3 ++- htdocs/supplier_proposal/list.php | 3 ++- htdocs/theme/eldy/style.css.php | 12 +++++------- htdocs/theme/md/style.css.php | 5 +++++ 30 files changed, 66 insertions(+), 38 deletions(-) diff --git a/htdocs/adherents/cotisations.php b/htdocs/adherents/cotisations.php index d0f8206f269..2e4f4b1994f 100644 --- a/htdocs/adherents/cotisations.php +++ b/htdocs/adherents/cotisations.php @@ -128,9 +128,10 @@ if ($result) if (! empty($date_select)) $title.=' ('.$langs->trans("Year").' '.$date_select.')'; $param=''; + if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.$contextpage; + if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.$limit; if ($statut != '') $param.="&statut=".$statut; if ($date_select) $param.="&date_select=".$date_select; - if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.$limit; if ($search_lastname) $param.="&search_lastname=".$search_lastname; if ($search_login) $param.="&search_login=".$search_login; if ($search_acount) $param.="&search_account=".$search_account; diff --git a/htdocs/comm/action/listactions.php b/htdocs/comm/action/listactions.php index e6ad597192a..b927244821e 100644 --- a/htdocs/comm/action/listactions.php +++ b/htdocs/comm/action/listactions.php @@ -155,6 +155,7 @@ llxHeader('',$langs->trans("Agenda"),$help_url); $listofextcals=array(); $param=''; +if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.$contextpage; if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.$limit; if ($actioncode != '') $param.="&actioncode=".$actioncode; if ($resourceid > 0) $param.="&resourceid=".$resourceid; diff --git a/htdocs/comm/propal/list.php b/htdocs/comm/propal/list.php index ac22565ff15..af73bf3e45f 100644 --- a/htdocs/comm/propal/list.php +++ b/htdocs/comm/propal/list.php @@ -354,7 +354,8 @@ if ($result) } $param='&socid='.$socid.'&viewstatut='.$viewstatut; - if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.$limit; + if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.$contextpage; + if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.$limit; if ($month) $param.='&month='.$month; if ($year) $param.='&year='.$year; if ($search_ref) $param.='&search_ref=' .$search_ref; diff --git a/htdocs/commande/list.php b/htdocs/commande/list.php index 46ae367b887..f19a431ec10 100644 --- a/htdocs/commande/list.php +++ b/htdocs/commande/list.php @@ -381,7 +381,8 @@ if ($resql) $num = $db->num_rows($resql); $param=''; - if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.$limit; + if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.$contextpage; + if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.$limit; if ($socid > 0) $param.='&socid='.$socid; if ($viewstatut != '') $param.='&viewstatut='.$viewstatut; if ($orderday) $param.='&orderday='.$orderday; diff --git a/htdocs/compta/charges/index.php b/htdocs/compta/charges/index.php index b90e7cac3cb..3f794491566 100644 --- a/htdocs/compta/charges/index.php +++ b/htdocs/compta/charges/index.php @@ -72,6 +72,7 @@ $title=$langs->trans("SpecialExpensesArea"); if ($mode == 'sconly') $title=$langs->trans("SocialContributionsPayments"); $param=''; +if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.$contextpage; if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.$limit; if ($mode == 'sconly') $param='&mode=sconly'; if ($sortfield) $param.='&sortfield='.$sortfield; diff --git a/htdocs/compta/facture/fiche-rec.php b/htdocs/compta/facture/fiche-rec.php index 0e0bc1d474b..7b2d7076aca 100644 --- a/htdocs/compta/facture/fiche-rec.php +++ b/htdocs/compta/facture/fiche-rec.php @@ -1438,6 +1438,7 @@ else $num = $db->num_rows($resql); $param='&socid='.$socid; + if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.$contextpage; if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.$limit; if ($day) $param.='&day='.$day; if ($month) $param.='&month='.$month; diff --git a/htdocs/compta/facture/list.php b/htdocs/compta/facture/list.php index c6651b4810d..2bd9ce1d8a4 100644 --- a/htdocs/compta/facture/list.php +++ b/htdocs/compta/facture/list.php @@ -792,6 +792,7 @@ if ($resql) } $param='&socid='.$socid; + if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.$contextpage; if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.$limit; if ($day) $param.='&day='.$day; if ($month) $param.='&month='.$month; diff --git a/htdocs/compta/paiement/cheque/list.php b/htdocs/compta/paiement/cheque/list.php index 1493ba1b99a..02515bb0886 100644 --- a/htdocs/compta/paiement/cheque/list.php +++ b/htdocs/compta/paiement/cheque/list.php @@ -121,6 +121,7 @@ if ($resql) $num = $db->num_rows($resql); $i = 0; $param=''; + if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.$contextpage; if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.$limit; print '
'; diff --git a/htdocs/compta/paiement/list.php b/htdocs/compta/paiement/list.php index bd72fcc17f7..b4fd8a51d9d 100644 --- a/htdocs/compta/paiement/list.php +++ b/htdocs/compta/paiement/list.php @@ -203,6 +203,7 @@ if ($resql) $i = 0; $param=''; + if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.$contextpage; if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.$limit; $param.=(GETPOST("orphelins")?"&orphelins=1":""); $param.=($search_ref?"&search_ref=".urlencode($search_ref):""); diff --git a/htdocs/compta/salaries/index.php b/htdocs/compta/salaries/index.php index b0584d62850..98278ad374c 100644 --- a/htdocs/compta/salaries/index.php +++ b/htdocs/compta/salaries/index.php @@ -127,7 +127,8 @@ if ($result) $var=true; $param=''; - if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.$limit; + if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.$contextpage; + if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.$limit; if ($typeid) $param.='&typeid='.$typeid; if ($optioncss != '') $param.='&optioncss='.$optioncss; diff --git a/htdocs/compta/sociales/index.php b/htdocs/compta/sociales/index.php index 3133022b9e6..584d4ecfc7d 100644 --- a/htdocs/compta/sociales/index.php +++ b/htdocs/compta/sociales/index.php @@ -138,7 +138,8 @@ if ($resql) $var=true; $param=''; - if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.$limit; + if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.$contextpage; + if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.$limit; if ($year) $param.='&year='.$year; if ($typeid) $param.='&typeid='.$typeid; diff --git a/htdocs/compta/tva/clients.php b/htdocs/compta/tva/clients.php index a22ca9abd3a..b13ea2d4166 100644 --- a/htdocs/compta/tva/clients.php +++ b/htdocs/compta/tva/clients.php @@ -322,7 +322,7 @@ if (is_array($coll_list)) { //print load_fiche_titre($vatsup); //print "
'.img_picto('',$picto, 'id="pictotitle"', $pictoisfullpath).''; $return.= '
'.$titre.'
'; diff --git a/htdocs/theme/eldy/style.css.php b/htdocs/theme/eldy/style.css.php index 733c190fba6..20ee581f318 100644 --- a/htdocs/theme/eldy/style.css.php +++ b/htdocs/theme/eldy/style.css.php @@ -564,6 +564,9 @@ div.myavailability { max-width: 0; overflow: auto; } +.tablelistofcalendars { + margin-top: 25px !important; +} /* ============================================================================== */ diff --git a/htdocs/theme/md/style.css.php b/htdocs/theme/md/style.css.php index 3454c20ff09..87b5b13fa6d 100644 --- a/htdocs/theme/md/style.css.php +++ b/htdocs/theme/md/style.css.php @@ -100,6 +100,7 @@ $fontsize='13'; $fontsizesmaller='11'; $usegradient=0; $useboldtitle=(isset($conf->global->THEME_ELDY_USEBOLDTITLE)?$conf->global->THEME_ELDY_USEBOLDTITLE:1); +$borderwith=2; // Case of option always editable if (! isset($conf->global->THEME_ELDY_BACKBODY)) $conf->global->THEME_ELDY_BACKBODY=$colorbackbody; @@ -169,7 +170,7 @@ else { $colortextbackvmenu='000000'; } $tmppart=explode(',',$colorbacktitle1); $tmpval=(! empty($tmppart[1]) ? $tmppart[1] : '')+(! empty($tmppart[2]) ? $tmppart[2] : '')+(! empty($tmppart[3]) ? $tmppart[3] : ''); if ($tmpval <= 260) { $colortexttitle='FFFFFF'; $colorshadowtitle='888888'; } -else { $colortexttitle='404040'; $colorshadowtitle='FFFFFF'; } +else { $colortexttitle='101010'; $colorshadowtitle='FFFFFF'; } $tmppart=explode(',',$colorbacktabcard1); $tmpval=(! empty($tmppart[1]) ? $tmppart[1] : '')+(! empty($tmppart[2]) ? $tmppart[2] : '')+(! empty($tmppart[3]) ? $tmppart[3] : ''); if ($tmpval <= 340) { $colortextbacktab='FFFFFF'; } @@ -563,6 +564,9 @@ div.myavailability { max-width: 0; overflow: auto; } +.tablelistofcalendars { + margin-top: 25px !important; +} /* ============================================================================== */ @@ -853,7 +857,7 @@ img.photoref { .underrefbanner { } .underbanner { - border-bottom: 1px solid rgb();; + border-bottom: px solid rgb();; } @@ -2094,7 +2098,7 @@ table.liste, table.noborder, table.formdoc, div.noborder { border-collapse: separate !important; border-spacing: 0px; - border-top-width: 1px; + border-top-width: px; border-top-color: rgb(); border-top-style: solid; @@ -2430,7 +2434,7 @@ div.liste_titre { border-top-style: solid; } div.liste_titre_bydiv { - border-top-width: 1px; + border-top-width: px; border-top-color: rgb(); border-top-style: solid; From 404847ed32ef1ffb37ef056c9424d2ddd31f5535 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 7 Jun 2016 11:10:09 +0200 Subject: [PATCH 32/50] Fix sql files not included into the fixdosfiles.sh --- dev/fixdosfiles.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/dev/fixdosfiles.sh b/dev/fixdosfiles.sh index ae04977d624..d6b9555efa6 100755 --- a/dev/fixdosfiles.sh +++ b/dev/fixdosfiles.sh @@ -17,14 +17,14 @@ fi # To detec if [ "x$1" = "xlist" ] then - find . \( -iname "functions" -o -iname "*.md" -o -iname "*.html" -o -iname "*.htm" -o -iname "*.php" -o -iname "*.sh" -o -iname "*.cml" -o -iname "*.css" -o -iname "*.js" -o -iname "*.lang" -o -iname "*.pl" -o -iname "*.txt" -o -iname "*.xml" \) -exec file "{}" + | grep CRLF -# find . \( -iname "*.md" -o -iname "*.html" -o -iname "*.htm" -o -iname "*.php" -o -iname "*.sh" -o -iname "*.cml" -o -iname "*.css" -o -iname "*.js" -o -iname "*.lang" -o -iname "*.pl" -o -iname "*.txt" -o -iname "*.xml" \) -exec file "{}" + | grep -v 'htdocs\/includes' | grep CRLF + find . \( -iname "functions" -o -iname "*.md" -o -iname "*.html" -o -iname "*.htm" -o -iname "*.php" -o -iname "*.sh" -o -iname "*.cml" -o -iname "*.css" -o -iname "*.js" -o -iname "*.lang" -o -iname "*.pl" -o -iname "*.sql" -o -iname "*.txt" -o -iname "*.xml" \) -exec file "{}" + | grep CRLF +# find . \( -iname "*.md" -o -iname "*.html" -o -iname "*.htm" -o -iname "*.php" -o -iname "*.sh" -o -iname "*.cml" -o -iname "*.css" -o -iname "*.js" -o -iname "*.lang" -o -iname "*.pl" -o -iname "*.sql" -o -iname "*.txt" -o -iname "*.xml" \) -exec file "{}" + | grep -v 'htdocs\/includes' | grep CRLF fi # To convert if [ "x$1" = "xfix" ] then - for fic in `find . \( -iname "functions" -o -iname "*.md" -o -iname "*.html" -o -iname "*.htm" -o -iname "*.php" -o -iname "*.sh" -o -iname "*.cml" -o -iname "*.css" -o -iname "*.js" -o -iname "*.lang" -o -iname "*.pl" -o -iname "*.txt" -o -iname "*.xml" \) -exec file "{}" + | grep CRLF | awk -F':' '{ print $1 }' ` + for fic in `find . \( -iname "functions" -o -iname "*.md" -o -iname "*.html" -o -iname "*.htm" -o -iname "*.php" -o -iname "*.sh" -o -iname "*.cml" -o -iname "*.css" -o -iname "*.js" -o -iname "*.lang" -o -iname "*.pl" -o -iname "*.sql" -o -iname "*.txt" -o -iname "*.xml" \) -exec file "{}" + | grep CRLF | awk -F':' '{ print $1 }' ` do echo "Fix file $fic" dos2unix "$fic" From c7065cc3b806e30d32cb50b58e45568d4c0a8de7 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 7 Jun 2016 13:15:38 +0200 Subject: [PATCH 33/50] Minor esthetic fixes --- htdocs/comm/action/card.php | 6 +- htdocs/core/class/html.formmargin.class.php | 2 +- htdocs/core/tpl/resource_view.tpl.php | 54 +++++++++--------- htdocs/projet/list.php | 2 +- htdocs/resource/element_resource.php | 3 +- .../theme/eldy/img/object_calendargantt.png | Bin 0 -> 242 bytes .../theme/eldy/img/object_calendarpertype.png | Bin 0 -> 198 bytes htdocs/theme/eldy/img/object_resource.png | Bin 199 -> 197 bytes htdocs/theme/eldy/style.css.php | 13 ++++- htdocs/theme/md/img/object_calendargantt.png | Bin 0 -> 219 bytes .../theme/md/img/object_calendarpertype.png | Bin 0 -> 221 bytes .../theme/md/img/object_calendarperuser.png | Bin 106 -> 221 bytes htdocs/theme/md/style.css.php | 2 +- 13 files changed, 45 insertions(+), 37 deletions(-) create mode 100644 htdocs/theme/eldy/img/object_calendargantt.png create mode 100644 htdocs/theme/eldy/img/object_calendarpertype.png create mode 100644 htdocs/theme/md/img/object_calendargantt.png create mode 100644 htdocs/theme/md/img/object_calendarpertype.png diff --git a/htdocs/comm/action/card.php b/htdocs/comm/action/card.php index 7a2f231879d..4df296d19da 100644 --- a/htdocs/comm/action/card.php +++ b/htdocs/comm/action/card.php @@ -1445,7 +1445,7 @@ if ($id > 0) print ''; print ''; //print ''; - print img_picto($langs->trans("ViewCal"),'object_calendarweek','class="hideonsmartphone pictoactionview"').' '; + print img_picto($langs->trans("ViewWeek"),'object_calendarweek','class="hideonsmartphone pictoactionview"').' '; print ''."\n"; print '
'; print ''; @@ -1454,7 +1454,7 @@ if ($id > 0) print ''; print ''; //print ''; - print img_picto($langs->trans("ViewCal"),'object_calendarday','class="hideonsmartphone pictoactionview"').' '; + print img_picto($langs->trans("ViewDay"),'object_calendarday','class="hideonsmartphone pictoactionview"').' '; print '
'."\n"; print '
'; print ''; @@ -1463,7 +1463,7 @@ if ($id > 0) print ''; print ''; //print ''; - print img_picto($langs->trans("ViewCal"),'object_calendarperuser','class="hideonsmartphone pictoactionview"').' '; + print img_picto($langs->trans("ViewPerUser"),'object_calendarperuser','class="hideonsmartphone pictoactionview"').' '; print '
'."\n"; print ''; diff --git a/htdocs/core/class/html.formmargin.class.php b/htdocs/core/class/html.formmargin.class.php index a52238be1b9..6678d87ca60 100644 --- a/htdocs/core/class/html.formmargin.class.php +++ b/htdocs/core/class/html.formmargin.class.php @@ -255,7 +255,7 @@ class FormMargin if (! empty($conf->product->enabled) && ! empty($conf->service->enabled)) { - print '
'.$langs->trans('TotalMargin').''.price($marginInfo['pv_total'], null, null, null, null, $rounding).''.price($marginInfo['pa_total'], null, null, null, null, $rounding).'
"; -print ""; +print ""; print '"; print '"; print ""; diff --git a/htdocs/compta/tva/quadri_detail.php b/htdocs/compta/tva/quadri_detail.php index 28ce4e50e24..6ebaee8ecd5 100644 --- a/htdocs/compta/tva/quadri_detail.php +++ b/htdocs/compta/tva/quadri_detail.php @@ -479,7 +479,7 @@ else //print table headers for this quadri - expenses now //imprime les en-tete de tables pour ce quadri - maintenant les d�penses - print ''; + print ''; print ''; print ''; if ($modetax == 0) diff --git a/htdocs/compta/tva/reglement.php b/htdocs/compta/tva/reglement.php index 81fc72f33ef..5484be65a32 100644 --- a/htdocs/compta/tva/reglement.php +++ b/htdocs/compta/tva/reglement.php @@ -134,7 +134,8 @@ if ($result) $var=true; $param=''; - if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.$limit; + if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.$contextpage; + if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.$limit; if ($typeid) $param.='&typeid='.$typeid; diff --git a/htdocs/contact/list.php b/htdocs/contact/list.php index ac54e1aaa5f..a66c1dab946 100644 --- a/htdocs/contact/list.php +++ b/htdocs/contact/list.php @@ -369,6 +369,7 @@ if ($result) $i = 0; $param=''; + if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.$contextpage; if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.$limit; $param.='&begin='.urlencode($begin).'&view='.urlencode($view).'&userid='.urlencode($userid).'&contactname='.urlencode($sall); $param.='&type='.urlencode($type).'&view='.urlencode($view); diff --git a/htdocs/contrat/list.php b/htdocs/contrat/list.php index 4c181d5c147..350a0435d38 100644 --- a/htdocs/contrat/list.php +++ b/htdocs/contrat/list.php @@ -170,6 +170,7 @@ if ($resql) $i = 0; $param=''; + if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.$contextpage; if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.$limit; $param.='&search_contract='.$search_contract; $param.='&search_name='.$search_name; diff --git a/htdocs/expedition/list.php b/htdocs/expedition/list.php index 32481d0bfdd..40e9c516ea8 100644 --- a/htdocs/expedition/list.php +++ b/htdocs/expedition/list.php @@ -256,7 +256,8 @@ if ($resql) $expedition = new Expedition($db); $param=''; - if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.$limit; + if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.$contextpage; + if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.$limit; if ($search_ref_exp) $param.= "&search_ref_exp=".$search_ref_exp; if ($search_ref_liv) $param.= "&search_ref_liv=".$search_ref_liv; if ($search_company) $param.= "&search_company=".$search_company; diff --git a/htdocs/fichinter/list.php b/htdocs/fichinter/list.php index 88224a487cf..81121f3b4bf 100644 --- a/htdocs/fichinter/list.php +++ b/htdocs/fichinter/list.php @@ -141,7 +141,8 @@ if ($result) $num = $db->num_rows($result); $param=''; - if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.$limit; + if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.$contextpage; + if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.$limit; if ($socid) $param.="&socid=".$socid; if ($search_ref) $param.="&search_ref=".urlencode($search_ref); if ($search_company) $param.="&search_company=".urlencode($search_company); diff --git a/htdocs/fourn/commande/list.php b/htdocs/fourn/commande/list.php index 5196c6b973b..8b56e12d8cc 100644 --- a/htdocs/fourn/commande/list.php +++ b/htdocs/fourn/commande/list.php @@ -397,6 +397,7 @@ if ($resql) $param=''; if ($socid > 0) $param.='&socid='.$socid; + if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.$contextpage; if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.$limit; if ($orderday) $param.='&orderday='.$orderday; if ($ordermonth) $param.='&ordermonth='.$ordermonth; diff --git a/htdocs/loan/index.php b/htdocs/loan/index.php index 51f4e74e119..e1aa6139678 100644 --- a/htdocs/loan/index.php +++ b/htdocs/loan/index.php @@ -104,6 +104,7 @@ if ($resql) $var=true; $param=''; + if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.$contextpage; if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.$limit; if ($search_ref) $param.="&search_ref=".$search_ref; if ($search_label) $param.="&search_label=".$search_user; diff --git a/htdocs/product/list.php b/htdocs/product/list.php index 0fdafd64ae5..c95156b4393 100644 --- a/htdocs/product/list.php +++ b/htdocs/product/list.php @@ -73,7 +73,8 @@ $pagenext = $page + 1; if (! $sortfield) $sortfield="p.ref"; if (! $sortorder) $sortorder="ASC"; -$contextpage='productservicelist'; +// Initialize context for list +$contextpage=GETPOST('contextpage','aZ')?GETPOST('contextpage','aZ'):'productservicelist'; if ($type === '1') { $contextpage='servicelist'; if ($search_type=='') $search_type='1'; } if ($type === '0') { $contextpage='productlist'; if ($search_type=='') $search_type='0'; } @@ -334,7 +335,8 @@ else } $param=''; - if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.$limit; + if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.$contextpage; + if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.$limit; if ($search_categ > 0) $param.="&search_categ=".$search_categ; if ($sref) $param="&sref=".$sref; if ($search_ref_supplier) $param="&search_ref_supplier=".$search_ref_supplier; diff --git a/htdocs/product/stock/list.php b/htdocs/product/stock/list.php index 58f95625d94..a1f19958cc9 100644 --- a/htdocs/product/stock/list.php +++ b/htdocs/product/stock/list.php @@ -108,7 +108,8 @@ if ($result) llxHeader("",$langs->trans("ListOfWarehouses"),$help_url); $param=''; - if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.$limit; + if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.$contextpage; + if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.$limit; print ''; print ''; diff --git a/htdocs/product/stock/productlot_list.php b/htdocs/product/stock/productlot_list.php index a8fd68f6a34..65bd340fa85 100644 --- a/htdocs/product/stock/productlot_list.php +++ b/htdocs/product/stock/productlot_list.php @@ -305,16 +305,14 @@ if ($resql) $num = $db->num_rows($resql); $params=''; + if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.$contextpage; if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.$limit; - -if ($search_entity != '') $params.= '&search_entity='.urlencode($search_entity); -if ($search_fk_product != '') $params.= '&search_fk_product='.urlencode($search_fk_product); -if ($search_batch != '') $params.= '&search_batch='.urlencode($search_batch); -if ($search_fk_user_creat != '') $params.= '&search_fk_user_creat='.urlencode($search_fk_user_creat); -if ($search_fk_user_modif != '') $params.= '&search_fk_user_modif='.urlencode($search_fk_user_modif); -if ($search_import_key != '') $params.= '&search_import_key='.urlencode($search_import_key); - - + if ($search_entity != '') $params.= '&search_entity='.urlencode($search_entity); + if ($search_fk_product != '') $params.= '&search_fk_product='.urlencode($search_fk_product); + if ($search_batch != '') $params.= '&search_batch='.urlencode($search_batch); + if ($search_fk_user_creat != '') $params.= '&search_fk_user_creat='.urlencode($search_fk_user_creat); + if ($search_fk_user_modif != '') $params.= '&search_fk_user_modif='.urlencode($search_fk_user_modif); + if ($search_import_key != '') $params.= '&search_import_key='.urlencode($search_import_key); if ($optioncss != '') $param.='&optioncss='.$optioncss; // Add $param from extra fields foreach ($search_array_options as $key => $val) diff --git a/htdocs/projet/list.php b/htdocs/projet/list.php index 2f45d2b782b..4584c8b8a2f 100644 --- a/htdocs/projet/list.php +++ b/htdocs/projet/list.php @@ -90,8 +90,8 @@ $year = GETPOST('year','int'); if ($search_status == '') $search_status=-1; // -1 or 1 -// Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array -$contextpage='projectlist'; +// Initialize context for list +$contextpage=GETPOST('contextpage','aZ')?GETPOST('contextpage','aZ'):'projectlist'; // Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array $hookmanager->initHooks(array($contextpage)); @@ -308,7 +308,8 @@ if ($resql) $num = $db->num_rows($resql); $param=''; - if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.$limit; + if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.$contextpage; + if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.$limit; if ($sday) $param.='&sday='.$day; if ($smonth) $param.='&smonth='.$smonth; if ($syear) $param.='&syear=' .$syear; @@ -346,7 +347,8 @@ if ($resql) print ''; print ''; print ''; - + print ''; + print_barre_liste($text, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, "", $num, $nbtotalofrecords, 'title_project', 0, '', '', $limit); // Show description of content diff --git a/htdocs/projet/tasks/list.php b/htdocs/projet/tasks/list.php index a1c7693b4b7..e5c807371c2 100644 --- a/htdocs/projet/tasks/list.php +++ b/htdocs/projet/tasks/list.php @@ -58,8 +58,8 @@ $day = GETPOST('day','int'); $month = GETPOST('month','int'); $year = GETPOST('year','int'); -// Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array -$contextpage='tasklist'; +// Initialize context for list +$contextpage=GETPOST('contextpage','aZ')?GETPOST('contextpage','aZ'):'tasklist'; // Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array $hookmanager->initHooks(array($contextpage)); @@ -314,6 +314,7 @@ if ($resql) $num = $db->num_rows($resql); $param=''; + if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.$contextpage; if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.$limit; if ($sday) $param.='&sday='.$day; if ($smonth) $param.='&smonth='.$smonth; diff --git a/htdocs/societe/consumption.php b/htdocs/societe/consumption.php index b7ea7a93041..70dee1ab8eb 100644 --- a/htdocs/societe/consumption.php +++ b/htdocs/societe/consumption.php @@ -333,7 +333,8 @@ if ($sql_select) $num = $db->num_rows($resql); $param="&socid=".$socid."&type_element=".$type_element; - if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.$limit; + if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.$contextpage; + if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.$limit; if ($sprod_fulldescr) $param.= "&sprod_fulldescr=".urlencode($sprod_fulldescr); if ($sref) $param.= "&sref=".urlencode($sref); if ($month) $param.= "&month=".$month; diff --git a/htdocs/societe/list.php b/htdocs/societe/list.php index 7ad8ac8362d..019542810e8 100644 --- a/htdocs/societe/list.php +++ b/htdocs/societe/list.php @@ -438,7 +438,8 @@ if ($resql) $i = 0; $param=''; - if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.$limit; + if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.$contextpage; + if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.$limit; if ($sall != '') $param .= "&sall=".urlencode($sall); if ($search_categ > 0) $param.='&search_categ='.urlencode($search_categ); if ($search_sale > 0) $param.='&search_sale='.urlencode($search_sale); diff --git a/htdocs/supplier_proposal/list.php b/htdocs/supplier_proposal/list.php index ea9b68d30be..967a510d714 100644 --- a/htdocs/supplier_proposal/list.php +++ b/htdocs/supplier_proposal/list.php @@ -277,7 +277,8 @@ if ($result) } $param='&socid='.$socid.'&viewstatut='.$viewstatut; - if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.$limit; + if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.$contextpage; + if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.$limit; if ($month) $param.='&month='.$month; if ($year) $param.='&year='.$year; if ($search_ref) $param.='&search_ref=' .$search_ref; diff --git a/htdocs/theme/eldy/style.css.php b/htdocs/theme/eldy/style.css.php index d7b0aeb1bb6..fb8f993ccf2 100644 --- a/htdocs/theme/eldy/style.css.php +++ b/htdocs/theme/eldy/style.css.php @@ -2226,13 +2226,6 @@ table.liste, table.noborder, table.formdoc, div.noborder { -webkit-border-radius: 0.2em; border-radius: 0.2em;*/ } -/* -#tablelines tr.liste_titre:first-child td, form.formnoborder div, tr.liste_titre.trnoborder td { - border-top-width: 1px; - border-top-color: rgb(); - border-top-style: solid; -} -*/ .liste_titre_add td, .liste_titre_add .tagtd { border-top-width: 1px; @@ -2617,6 +2610,11 @@ tr.liste_titre th, th.liste_titre, tr.liste_titre td, td.liste_titre, form.liste tr.liste_titre th a, th.liste_titre a, tr.liste_titre td a, td.liste_titre a, form.liste_titre div a, div.liste_titre a { text-shadow: none !important; } +tr.liste_titre_topborder td { + border-top-width: px; + border-top-color: rgb(); + border-top-style: solid; +} .liste_titre td a { text-shadow: none !important; color: rgb(); diff --git a/htdocs/theme/md/style.css.php b/htdocs/theme/md/style.css.php index fd8dfff0c44..90733fb6670 100644 --- a/htdocs/theme/md/style.css.php +++ b/htdocs/theme/md/style.css.php @@ -2483,6 +2483,11 @@ tr.liste_titre th, th.liste_titre, tr.liste_titre td, td.liste_titre, form.liste tr.liste_titre th a, th.liste_titre a, tr.liste_titre td a, td.liste_titre a, form.liste_titre div a, div.liste_titre a { text-shadow: none !important; } +tr.liste_titre_topborder td { + border-top-width: px; + border-top-color: rgb(); + border-top-style: solid; +} .liste_titre td a { text-shadow: none !important; color: rgb(); From 90195763942c5945cb1e5cfed869df3a7dd557ed Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 7 Jun 2016 15:58:02 +0200 Subject: [PATCH 35/50] Fix css class opacitymedium was not used everywhere. --- htdocs/accountancy/admin/fiscalyear.php | 2 +- htdocs/admin/system/filecheck.php | 4 ++-- htdocs/comm/index.php | 4 ++-- htdocs/comm/mailing/index.php | 2 +- htdocs/compta/bank/index.php | 6 +++--- htdocs/compta/deplacement/index.php | 2 +- htdocs/compta/facture.php | 2 +- htdocs/compta/index.php | 4 ++-- htdocs/compta/paiement/cheque/list.php | 2 +- htdocs/compta/prelevement/create.php | 2 +- htdocs/compta/resultat/clientfourn.php | 14 +++++++------- htdocs/core/class/html.formfile.class.php | 2 +- htdocs/core/lib/company.lib.php | 4 ++-- htdocs/core/modules/printing/printgcp.modules.php | 2 +- htdocs/expensereport/index.php | 2 +- htdocs/fourn/facture/card.php | 2 +- htdocs/hrm/admin/admin_establishment.php | 2 +- htdocs/hrm/hrm.php | 6 +++--- htdocs/product/composition/card.php | 4 ++-- htdocs/user/card.php | 2 +- htdocs/user/group/card.php | 2 +- 21 files changed, 36 insertions(+), 36 deletions(-) diff --git a/htdocs/accountancy/admin/fiscalyear.php b/htdocs/accountancy/admin/fiscalyear.php index e84c079a7e5..8dacb956dd4 100644 --- a/htdocs/accountancy/admin/fiscalyear.php +++ b/htdocs/accountancy/admin/fiscalyear.php @@ -135,7 +135,7 @@ if ($result) { $i ++; } } else { - print ''; + print ''; } print '
'.$langs->trans("Num")."'.$langs->trans("Supplier")."".$langs->trans("VATIntra")."
'.$elementsup.''.$productsup.'
' . $langs->trans("None") . '
' . $langs->trans("None") . '
'; diff --git a/htdocs/admin/system/filecheck.php b/htdocs/admin/system/filecheck.php index 9b7dfb76689..48eddfec155 100644 --- a/htdocs/admin/system/filecheck.php +++ b/htdocs/admin/system/filecheck.php @@ -104,7 +104,7 @@ if (file_exists($xmlfile)) } else { - print ''.$langs->trans("None").''; + print ''.$langs->trans("None").''; } print ''; @@ -136,7 +136,7 @@ if (file_exists($xmlfile)) } else { - print ''.$langs->trans("None").''; + print ''.$langs->trans("None").''; } print ''; } diff --git a/htdocs/comm/index.php b/htdocs/comm/index.php index 59aa71b5595..6a06aad080f 100644 --- a/htdocs/comm/index.php +++ b/htdocs/comm/index.php @@ -517,7 +517,7 @@ if (! empty($conf->societe->enabled) && $user->rights->societe->lire) } else { - print ''.$langs->trans("None").''; + print ''.$langs->trans("None").''; } print "
"; } @@ -571,7 +571,7 @@ if (! empty($conf->fournisseur->enabled) && $user->rights->societe->lire) } else { - print ''.$langs->trans("None").''; + print ''.$langs->trans("None").''; } print '
'; } diff --git a/htdocs/comm/mailing/index.php b/htdocs/comm/mailing/index.php index 5904bec0009..bf7c4624c1e 100644 --- a/htdocs/comm/mailing/index.php +++ b/htdocs/comm/mailing/index.php @@ -189,7 +189,7 @@ if ($result) } else { - print ''.$langs->trans("None").''; + print ''.$langs->trans("None").''; } print "
"; $db->free($result); diff --git a/htdocs/compta/bank/index.php b/htdocs/compta/bank/index.php index 380b8cff3e8..34cec22fb54 100644 --- a/htdocs/compta/bank/index.php +++ b/htdocs/compta/bank/index.php @@ -130,7 +130,7 @@ foreach ($accounts as $key=>$type) $total[$acc->currency_code] += $solde; } } -if (! $found) print ''.$langs->trans("None").''; +if (! $found) print ''.$langs->trans("None").''; // Total foreach ($total as $key=>$solde) { @@ -182,7 +182,7 @@ foreach ($accounts as $key=>$type) if (! $found) { $var = !$var; - print ''.$langs->trans("None").''; + print ''.$langs->trans("None").''; } // Total foreach ($total as $key=>$solde) @@ -249,7 +249,7 @@ foreach ($accounts as $key=>$type) if (! $found) { $var = !$var; - print ''.$langs->trans("None").''; + print ''.$langs->trans("None").''; } // Total foreach ($total as $key=>$solde) diff --git a/htdocs/compta/deplacement/index.php b/htdocs/compta/deplacement/index.php index b83cdde2db9..63556eeaee6 100644 --- a/htdocs/compta/deplacement/index.php +++ b/htdocs/compta/deplacement/index.php @@ -187,7 +187,7 @@ if ($result) } else { - print ''.$langs->trans("None").''; + print ''.$langs->trans("None").''; } print '
'; } diff --git a/htdocs/compta/facture.php b/htdocs/compta/facture.php index 9dd01b7162c..42f9a440929 100644 --- a/htdocs/compta/facture.php +++ b/htdocs/compta/facture.php @@ -3353,7 +3353,7 @@ else if ($id > 0 || ! empty($ref)) $i ++; } } else { - print '' . $langs->trans("None") . ''; + print '' . $langs->trans("None") . ''; } // } $db->free($result); diff --git a/htdocs/compta/index.php b/htdocs/compta/index.php index 719953204f9..ffb3b3631f1 100644 --- a/htdocs/compta/index.php +++ b/htdocs/compta/index.php @@ -543,7 +543,7 @@ if (! empty($conf->don->enabled) && $user->rights->societe->lire) } else { - print ''.$langs->trans("None").''; + print ''.$langs->trans("None").''; } print '
'; } @@ -614,7 +614,7 @@ if (! empty($conf->tax->enabled) && $user->rights->tax->charges->lire) } else { - print ''.$langs->trans("None").''; + print ''.$langs->trans("None").''; } print "
"; $db->free($resql); diff --git a/htdocs/compta/paiement/cheque/list.php b/htdocs/compta/paiement/cheque/list.php index 02515bb0886..ebfd598ee0b 100644 --- a/htdocs/compta/paiement/cheque/list.php +++ b/htdocs/compta/paiement/cheque/list.php @@ -215,7 +215,7 @@ if ($resql) else { print ""; - print ''.$langs->trans("None").""; + print ''.$langs->trans("None").""; print ''; } print ""; diff --git a/htdocs/compta/prelevement/create.php b/htdocs/compta/prelevement/create.php index c2607d5b83d..3350f5c34a3 100644 --- a/htdocs/compta/prelevement/create.php +++ b/htdocs/compta/prelevement/create.php @@ -235,7 +235,7 @@ if ($resql) $i++; } } - else print ''.$langs->trans("None").''; + else print ''.$langs->trans("None").''; print ""; print "
\n"; } diff --git a/htdocs/compta/resultat/clientfourn.php b/htdocs/compta/resultat/clientfourn.php index df9cf03a30c..95ea2bfe46c 100644 --- a/htdocs/compta/resultat/clientfourn.php +++ b/htdocs/compta/resultat/clientfourn.php @@ -279,7 +279,7 @@ if ($total_ttc == 0) { $var=!$var; print " "; - print ''.$langs->trans("None").''; + print ''.$langs->trans("None").''; print ''; } @@ -362,7 +362,7 @@ if ($result) { { $var=!$var; print " "; - print ''.$langs->trans("None").''; + print ''.$langs->trans("None").''; print ''; } @@ -439,7 +439,7 @@ if ($result) { else { $var = !$var; print " "; - print ''.$langs->trans("None").''; + print ''.$langs->trans("None").''; print ''; } } else { @@ -517,7 +517,7 @@ if ($result) { else { $var = !$var; print " "; - print ''.$langs->trans("None").''; + print ''.$langs->trans("None").''; print ''; } } else { @@ -606,7 +606,7 @@ if (! empty($conf->salaries->enabled)) { $var = !$var; print " "; - print ''.$langs->trans("None").''; + print ''.$langs->trans("None").''; print ''; } } @@ -688,7 +688,7 @@ if (! empty($conf->expensereport->enabled)) { $var = !$var; print " "; - print ''.$langs->trans("None").''; + print ''.$langs->trans("None").''; print ''; } } @@ -757,7 +757,7 @@ if (! empty($conf->don->enabled)) { $var = !$var; print " "; - print ''.$langs->trans("None").''; + print ''.$langs->trans("None").''; print ''; } } diff --git a/htdocs/core/class/html.formfile.class.php b/htdocs/core/class/html.formfile.class.php index 205bd1df4e5..40275c5c794 100644 --- a/htdocs/core/class/html.formfile.class.php +++ b/htdocs/core/class/html.formfile.class.php @@ -661,7 +661,7 @@ class FormFile if (count($file_list) == 0 && $headershown) { - $out.=''.$langs->trans("None").''; + $out.=''.$langs->trans("None").''; } $this->numoffiles++; diff --git a/htdocs/core/lib/company.lib.php b/htdocs/core/lib/company.lib.php index 4d51b703ef0..5b8bd70a566 100644 --- a/htdocs/core/lib/company.lib.php +++ b/htdocs/core/lib/company.lib.php @@ -551,7 +551,7 @@ function show_projects($conf, $langs, $db, $object, $backtopage='', $nocreatelin else { $var = false; - print ''.$langs->trans("None").''; + print ''.$langs->trans("None").''; } $db->free($result); } @@ -766,7 +766,7 @@ function show_contacts($conf,$langs,$db,$object,$backtopage='') else { print ""; - print ''.$langs->trans("None").''; + print ''.$langs->trans("None").''; print "\n"; } print "\n\n"; diff --git a/htdocs/core/modules/printing/printgcp.modules.php b/htdocs/core/modules/printing/printgcp.modules.php index ca4ca787a94..27b0e0f779c 100644 --- a/htdocs/core/modules/printing/printgcp.modules.php +++ b/htdocs/core/modules/printing/printgcp.modules.php @@ -458,7 +458,7 @@ class printing_printgcp extends PrintingDriver else { $html .= ''; - $html .= ''.$langs->trans("None").''; + $html .= ''.$langs->trans("None").''; $html .= ''; } $html .= ''; diff --git a/htdocs/expensereport/index.php b/htdocs/expensereport/index.php index b980199c800..117ecc5e3c4 100644 --- a/htdocs/expensereport/index.php +++ b/htdocs/expensereport/index.php @@ -201,7 +201,7 @@ if ($result) } else { - print ''.$langs->trans("None").''; + print ''.$langs->trans("None").''; } print '
'; } diff --git a/htdocs/fourn/facture/card.php b/htdocs/fourn/facture/card.php index 43e5786cbc3..f078c714416 100644 --- a/htdocs/fourn/facture/card.php +++ b/htdocs/fourn/facture/card.php @@ -1957,7 +1957,7 @@ else } else { - print ''.$langs->trans("None").''; + print ''.$langs->trans("None").''; } if ($object->paye == 0) diff --git a/htdocs/hrm/admin/admin_establishment.php b/htdocs/hrm/admin/admin_establishment.php index 5d29468090e..5f004f15e09 100644 --- a/htdocs/hrm/admin/admin_establishment.php +++ b/htdocs/hrm/admin/admin_establishment.php @@ -129,7 +129,7 @@ if ($result) } else { - print ''.$langs->trans("None").''; + print ''.$langs->trans("None").''; } print ''; diff --git a/htdocs/hrm/hrm.php b/htdocs/hrm/hrm.php index bce42359453..cc2366d7e4c 100644 --- a/htdocs/hrm/hrm.php +++ b/htdocs/hrm/hrm.php @@ -207,7 +207,7 @@ if (! empty($conf->holiday->enabled) && $user->rights->holiday->read) } else { - print ''.$langs->trans("None").''; + print ''.$langs->trans("None").''; } print '
'; } @@ -272,7 +272,7 @@ if (! empty($conf->deplacement->enabled) && $user->rights->deplacement->lire) } else { - print ''.$langs->trans("None").''; + print ''.$langs->trans("None").''; } print '
'; } @@ -336,7 +336,7 @@ if (! empty($conf->expensereport->enabled) && $user->rights->expensereport->lire } else { - print ''.$langs->trans("None").''; + print ''.$langs->trans("None").''; } print '
'; } diff --git a/htdocs/product/composition/card.php b/htdocs/product/composition/card.php index d0d26292251..913fc40e40b 100644 --- a/htdocs/product/composition/card.php +++ b/htdocs/product/composition/card.php @@ -282,7 +282,7 @@ if ($id > 0 || ! empty($ref)) else { print ''; - print ''.$langs->trans("None").''; + print ''.$langs->trans("None").''; print ''; } print ''; @@ -453,7 +453,7 @@ if ($id > 0 || ! empty($ref)) if (! empty($conf->stock->enabled)) $colspan++; print ''; - print ''.$langs->trans("None").''; + print ''.$langs->trans("None").''; print ''; } diff --git a/htdocs/user/card.php b/htdocs/user/card.php index dc10819ba84..c0ac112d51f 100644 --- a/htdocs/user/card.php +++ b/htdocs/user/card.php @@ -1738,7 +1738,7 @@ else } else { - print ''.$langs->trans("None").''; + print ''.$langs->trans("None").''; } print ""; diff --git a/htdocs/user/group/card.php b/htdocs/user/group/card.php index 716db97b911..1da40878a62 100644 --- a/htdocs/user/group/card.php +++ b/htdocs/user/group/card.php @@ -491,7 +491,7 @@ else } else { - print ''.$langs->trans("None").''; + print ''.$langs->trans("None").''; } print ""; print "
"; From 544b123bdd29028b21a680a76d3ac3ad10b12760 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 7 Jun 2016 20:25:45 +0200 Subject: [PATCH 36/50] Fix can edit condition and mode of payment even if not draft. --- htdocs/commande/card.php | 4 ++-- htdocs/theme/eldy/style.css.php | 2 +- htdocs/theme/md/style.css.php | 6 ++++++ 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/htdocs/commande/card.php b/htdocs/commande/card.php index 36b87d680d4..cf51092a4de 100644 --- a/htdocs/commande/card.php +++ b/htdocs/commande/card.php @@ -2147,7 +2147,7 @@ if ($action == 'create' && $user->rights->commande->creer) print ''; - if ($action != 'editconditions' && $object->brouillon) + if ($action != 'editconditions') print ''; print '
'; print $langs->trans('PaymentConditionsShort'); print 'id . '">' . img_edit($langs->trans('SetConditions'), 1) . '
'; print ''; @@ -2165,7 +2165,7 @@ if ($action == 'create' && $user->rights->commande->creer) print ''; - if ($action != 'editmode' && $object->brouillon) + if ($action != 'editmode') print ''; print '
'; print $langs->trans('PaymentMode'); print 'id . '">' . img_edit($langs->trans('SetMode'), 1) . '
'; print ''; diff --git a/htdocs/theme/eldy/style.css.php b/htdocs/theme/eldy/style.css.php index fb8f993ccf2..52ee642719c 100644 --- a/htdocs/theme/eldy/style.css.php +++ b/htdocs/theme/eldy/style.css.php @@ -2653,7 +2653,7 @@ form.liste_total div { border-bottom: none; } -.margintable { +.paymenttable, .margintable { border-top-width: px !important; border-top-color: rgb() !important; border-top-style: solid !important; diff --git a/htdocs/theme/md/style.css.php b/htdocs/theme/md/style.css.php index 90733fb6670..559f464a6df 100644 --- a/htdocs/theme/md/style.css.php +++ b/htdocs/theme/md/style.css.php @@ -2527,6 +2527,12 @@ input.liste_titre { border-bottom: none; } +.paymenttable, .margintable { + border-top-width: px !important; + border-top-color: rgb() !important; + border-top-style: solid !important; +} + .margintable td { border: 0px !important; } From f552f3a7d5868546e0757d9408a363d016ee42e6 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 7 Jun 2016 20:51:06 +0200 Subject: [PATCH 37/50] Fix missing $notrigger on product delete --- htdocs/product/class/product.class.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php index 5a90bbf3650..36e5d7e6b26 100644 --- a/htdocs/product/class/product.class.php +++ b/htdocs/product/class/product.class.php @@ -879,9 +879,10 @@ class Product extends CommonObject * Delete a product from database (if not used) * * @param int $id Product id (usage of this is deprecated, delete should be called without parameters on a fetched object) + * @param int $notrigger Do not execute trigger * @return int < 0 if KO, 0 = Not possible, > 0 if OK */ - function delete($id=0) + function delete($id=0, $notrigger=0) { // Deprecation warning if ($id > 0) { @@ -914,7 +915,7 @@ class Product extends CommonObject { $this->db->begin(); - if (! $error) + if (! $error && empty($notrigger)) { // Call trigger $result=$this->call_trigger('PRODUCT_DELETE',$user); From 9dade02dba701930e6876b1cdae908eaa8d3770f Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 7 Jun 2016 20:52:43 +0200 Subject: [PATCH 38/50] Fix missing test on $error --- htdocs/societe/class/societe.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php index cb1d783497c..c7f92b2ca1b 100644 --- a/htdocs/societe/class/societe.class.php +++ b/htdocs/societe/class/societe.class.php @@ -1347,7 +1347,7 @@ class Societe extends CommonObject $this->db->begin(); // User is mandatory for trigger call - if ($call_trigger) + if (! $error && $call_trigger) { // Call trigger $result=$this->call_trigger('COMPANY_DELETE',$fuser); From f5d7c6fda5ccc65e09cf0850b595d025a3b962e7 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 8 Jun 2016 09:57:03 +0200 Subject: [PATCH 39/50] Fix translation of desired stock (this is more clear) --- htdocs/langs/en_US/stocks.lang | 3 ++- htdocs/product/stock/product.php | 5 +++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/htdocs/langs/en_US/stocks.lang b/htdocs/langs/en_US/stocks.lang index c1ba6f73159..c0f304bce35 100644 --- a/htdocs/langs/en_US/stocks.lang +++ b/htdocs/langs/en_US/stocks.lang @@ -97,7 +97,8 @@ SelectWarehouseForStockDecrease=Choose warehouse to use for stock decrease SelectWarehouseForStockIncrease=Choose warehouse to use for stock increase NoStockAction=No stock action LastWaitingSupplierOrders=Orders waiting for receptions -DesiredStock=Desired minimum stock +DesiredStock=Desired optimal stock +DesiredStockDesc=This stock amount will be the value used to fill the stock by replenishment feature. DesiredMaxStock=Desired maximum stock StockToBuy=To order Replenishment=Replenishment diff --git a/htdocs/product/stock/product.php b/htdocs/product/stock/product.php index 56504432840..e49da226727 100644 --- a/htdocs/product/stock/product.php +++ b/htdocs/product/stock/product.php @@ -490,7 +490,8 @@ if ($id > 0 || $ref) print ''; // Desired stock - print ''.$form->editfieldkey("DesiredStock",'desiredstock',$object->desiredstock,$object,$user->rights->produit->creer).''; + print ''.$form->editfieldkey($form->textwithpicto($langs->trans("DesiredStock"), $langs->trans("DesiredStockDesc"), 1),'desiredstock',$object->desiredstock,$object,$user->rights->produit->creer); + print ''; print $form->editfieldval("DesiredStock",'desiredstock',$object->desiredstock,$object,$user->rights->produit->creer); print ''; @@ -503,7 +504,7 @@ if ($id > 0 || $ref) $text_stock_options.= (! empty($conf->global->STOCK_CALCULATE_ON_SUPPLIER_VALIDATE_ORDER)?$langs->trans("ReStockOnValidateOrder").'
':''); $text_stock_options.= (! empty($conf->global->STOCK_CALCULATE_ON_SUPPLIER_DISPATCH_ORDER)?$langs->trans("ReStockOnDispatchOrder").'
':''); print ''; - print $form->textwithtooltip($langs->trans("PhysicalStock"), $text_stock_options, 2, 1, img_picto('', 'info'), '', 2); + print $form->textwithpicto($langs->trans("PhysicalStock"), $text_stock_options, 1); print ''; print ''.$object->stock_reel; if ($object->seuil_stock_alerte != '' && ($object->stock_reel < $object->seuil_stock_alerte)) print ' '.img_warning($langs->trans("StockLowerThanLimit")); From 240c4baba868a12dd3f7233543961ec4aed53e4d Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 8 Jun 2016 11:29:48 +0200 Subject: [PATCH 40/50] FIX filter on stock movement --- htdocs/product/stock/mouvement.php | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/htdocs/product/stock/mouvement.php b/htdocs/product/stock/mouvement.php index 0012db23d3d..7ab0ff72492 100644 --- a/htdocs/product/stock/mouvement.php +++ b/htdocs/product/stock/mouvement.php @@ -344,10 +344,7 @@ $sql.= " WHERE m.fk_product = p.rowid"; $sql.= " AND m.fk_entrepot = e.rowid"; $sql.= " AND e.entity IN (".getEntity('stock', 1).")"; if (empty($conf->global->STOCK_SUPPORTS_SERVICES)) $sql.= " AND p.fk_product_type = 0"; -if ($id) -{ - $sql.= " AND e.rowid ='".$id."'"; -} +if ($id > 0) $sql.= " AND e.rowid ='".$id."'"; if ($month > 0) { if ($year > 0) @@ -359,15 +356,12 @@ else if ($year > 0) { $sql.= " AND m.datem BETWEEN '".$db->idate(dol_get_first_day($year,1,false))."' AND '".$db->idate(dol_get_last_day($year,12,false))."'"; } -if ($idproduct > 0) -{ - $sql.= " AND p.rowid = '".$idproduct."'"; -} -if (! empty($search_movement)) $sql.= " AND m.label LIKE '%".$db->escape($search_movement)."%'"; +if ($idproduct > 0) $sql.= " AND p.rowid = '".$idproduct."'"; +if (! empty($search_movement)) $sql.= natural_search('m.label', $search_movement); if (! empty($search_inventorycode)) $sql.= " AND m.inventorycode LIKE '%".$db->escape($search_inventorycode)."%'"; if (! empty($search_product_ref)) $sql.= " AND p.ref LIKE '%".$db->escape($search_product_ref)."%'"; if (! empty($search_product)) $sql.= " AND p.label LIKE '%".$db->escape($search_product)."%'"; -if (! empty($search_warehouse)) $sql.= " AND e.rowid = '".$db->escape($search_warehouse)."'"; +if ($search_warehouse > 0) $sql.= " AND e.rowid = '".$db->escape($search_warehouse)."'"; if (! empty($search_user)) $sql.= " AND u.login LIKE '%".$db->escape($search_user)."%'"; if (! empty($search_batch)) $sql.= " AND m.batch LIKE '%".$db->escape($search_batch)."%'"; From 59c6c9020093e1b8eaf6cb1cf08d3245a89142b7 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 8 Jun 2016 11:40:50 +0200 Subject: [PATCH 41/50] Remove a FIXME. --- htdocs/product/class/product.class.php | 2 +- htdocs/product/stock/class/mouvementstock.class.php | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php index 36e5d7e6b26..982b109da99 100644 --- a/htdocs/product/class/product.class.php +++ b/htdocs/product/class/product.class.php @@ -131,7 +131,7 @@ class Product extends CommonObject var $status_buy; // Statut indique si le produit est un produit fini '1' ou une matiere premiere '0' var $finished; - // We must manage batch number, sell-by date and so on : '1':yes '0':no + // We must manage lot/batch number, sell-by date and so on : '1':yes '0':no var $status_batch; var $customcode; // Customs code diff --git a/htdocs/product/stock/class/mouvementstock.class.php b/htdocs/product/stock/class/mouvementstock.class.php index b9859f9ec9b..a19a39beb45 100644 --- a/htdocs/product/stock/class/mouvementstock.class.php +++ b/htdocs/product/stock/class/mouvementstock.class.php @@ -126,7 +126,6 @@ class MouvementStock extends CommonObject return -2; } - // FIXME Code not complete to implement this // Check table llx_product_lot from batchnumber for same product // If found and eatby/sellby defined into table and provided and differs, return error // If found and eatby/sellby defined into table and not provided, we take value from table @@ -218,7 +217,7 @@ class MouvementStock extends CommonObject $i++; } } - else + else // If not found, we add record { $productlot = new Productlot($this->db); $productlot->fk_product = $fk_product; From 73d465a8e82856439564c9ee0cb2e23298bde750 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 8 Jun 2016 11:44:00 +0200 Subject: [PATCH 42/50] Fix missing use of natural_search --- htdocs/product/stock/mouvement.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/htdocs/product/stock/mouvement.php b/htdocs/product/stock/mouvement.php index 7ab0ff72492..82b0d2f97a1 100644 --- a/htdocs/product/stock/mouvement.php +++ b/htdocs/product/stock/mouvement.php @@ -358,12 +358,12 @@ else if ($year > 0) } if ($idproduct > 0) $sql.= " AND p.rowid = '".$idproduct."'"; if (! empty($search_movement)) $sql.= natural_search('m.label', $search_movement); -if (! empty($search_inventorycode)) $sql.= " AND m.inventorycode LIKE '%".$db->escape($search_inventorycode)."%'"; -if (! empty($search_product_ref)) $sql.= " AND p.ref LIKE '%".$db->escape($search_product_ref)."%'"; -if (! empty($search_product)) $sql.= " AND p.label LIKE '%".$db->escape($search_product)."%'"; +if (! empty($search_inventorycode)) $sql.= natural_search('m.inventorycode', $search_inventorycode); +if (! empty($search_product_ref)) $sql.= natural_search('p.ref', $search_product_ref); +if (! empty($search_product)) $sql.= natural_search('p.label', $search_product); if ($search_warehouse > 0) $sql.= " AND e.rowid = '".$db->escape($search_warehouse)."'"; -if (! empty($search_user)) $sql.= " AND u.login LIKE '%".$db->escape($search_user)."%'"; -if (! empty($search_batch)) $sql.= " AND m.batch LIKE '%".$db->escape($search_batch)."%'"; +if (! empty($search_user)) $sql.= natural_search('u.login', $search_user); +if (! empty($search_batch)) $sql.= natural_search('m.batch', $search_batch); $nbtotalofrecords = 0; if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) From 653387ba9508bfa8d0b15397b1ec558be9011bb4 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 8 Jun 2016 11:58:37 +0200 Subject: [PATCH 43/50] Fix pagination on movement list --- htdocs/product/stock/mouvement.php | 96 +++++++++++++++++++++--------- 1 file changed, 69 insertions(+), 27 deletions(-) diff --git a/htdocs/product/stock/mouvement.php b/htdocs/product/stock/mouvement.php index 82b0d2f97a1..9a0059317fa 100644 --- a/htdocs/product/stock/mouvement.php +++ b/htdocs/product/stock/mouvement.php @@ -66,7 +66,29 @@ if (! $sortorder) $sortorder="DESC"; $pdluoid=GETPOST('pdluoid','int'); -if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter")) // Both test are required to be compatible with all browsers +// Initialize context for list +$contextpage=GETPOST('contextpage','aZ')?GETPOST('contextpage','aZ'):'movementlist'; + +// Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array +$hookmanager->initHooks(array($contextpage)); +$extrafields = new ExtraFields($db); + +// fetch optionals attributes and labels +$extralabels = $extrafields->fetch_name_optionals_label('movement'); +$search_array_options=$extrafields->getOptionalsFromPost($extralabels,'','search_'); + + + +/* + * Actions + */ + +if ($cancel) $action=''; // Protection to avoid action for all cancel buttons + +include DOL_DOCUMENT_ROOT.'/core/actions_changeselectedfields.inc.php'; + +// Do we click on purge search criteria ? +if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter.x") || GETPOST("button_removefilter")) // Both test are required to be compatible with all browsers { $year=''; $month=''; @@ -77,15 +99,9 @@ if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter")) // Both $search_user=""; $search_batch=""; $sall=""; + $search_array_options=array(); } - -/* - * Actions - */ - -if ($cancel) $action=''; // Protection to avoid action for all cancel buttons - // Correct stock if ($action == "correct_stock") { @@ -547,22 +563,40 @@ if ($resql) $param=''; - if ($id > 0) $param.='&id='.$id; - if ($search_movement) $param.='&search_movement='.urlencode($search_movement); + if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.$contextpage; + if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.$limit; + if ($id > 0) $param.='&id='.$id; + if ($search_movement) $param.='&search_movement='.urlencode($search_movement); if ($search_inventorycode) $param.='&search_inventorycode='.urlencode($search_inventorycode); - if ($search_product_ref) $param.='&search_product_ref='.urlencode($search_product_ref); - if ($search_product) $param.='&search_product='.urlencode($search_product); - if ($search_warehouse) $param.='&search_warehouse='.urlencode($search_warehouse); - if (!empty($sref)) $param.='&sref='.urlencode($sref); // FIXME $sref is not defined - if (!empty($snom)) $param.='&snom='.urlencode($snom); // FIXME $snom is not defined - if ($search_user) $param.='&search_user='.urlencode($search_user); - if ($idproduct > 0) $param.='&idproduct='.$idproduct; - if ($id > 0) print_barre_liste($texte, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder,'',$num, $nbtotalofrecords,''); - else print_barre_liste($texte, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder,'',$num, $nbtotalofrecords); - - print ''; + if ($search_product_ref) $param.='&search_product_ref='.urlencode($search_product_ref); + if ($search_product) $param.='&search_product='.urlencode($search_product); + if ($search_warehouse > 0) $param.='&search_warehouse='.urlencode($search_warehouse); + if (!empty($sref)) $param.='&sref='.urlencode($sref); // FIXME $sref is not defined + if (!empty($snom)) $param.='&snom='.urlencode($snom); // FIXME $snom is not defined + if ($search_user) $param.='&search_user='.urlencode($search_user); + if ($idproduct > 0) $param.='&idproduct='.$idproduct; + // Add $param from extra fields + foreach ($search_array_options as $key => $val) + { + $crit=$val; + $tmpkey=preg_replace('/search_options_/','',$key); + if ($val != '') $param.='&search_options_'.$tmpkey.'='.urlencode($val); + } + + print ''; + if ($optioncss != '') print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; if ($id > 0) print ''; - + + if ($id > 0) print_barre_liste($texte, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder,'',$num, $nbtotalofrecords, '', 0, '', '', $limit); + else print_barre_liste($texte, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder,'',$num, $nbtotalofrecords, 'title_generic', 0, '', '', $limit); + print ''; print ""; //print_liste_field_titre($langs->trans("Id"),$_SERVER["PHP_SELF"], "m.rowid","",$param,"",$sortfield,$sortorder); @@ -581,7 +615,8 @@ if ($resql) print_liste_field_titre($langs->trans("InventoryCodeShort"),$_SERVER["PHP_SELF"], "m.inventorycode","",$param,"",$sortfield,$sortorder); print_liste_field_titre($langs->trans("LabelMovement"),$_SERVER["PHP_SELF"], "m.label","",$param,"",$sortfield,$sortorder); print_liste_field_titre($langs->trans("Source"),$_SERVER["PHP_SELF"], "m.label","",$param,"",$sortfield,$sortorder); - print_liste_field_titre($langs->trans("Units"),$_SERVER["PHP_SELF"], "m.value","",$param,'align="right"',$sortfield,$sortorder); + print_liste_field_titre($langs->trans("Qty"),$_SERVER["PHP_SELF"], "m.value","",$param,'align="right"',$sortfield,$sortorder); + print_liste_field_titre(""); print "\n"; // Lignes des champs de filtre @@ -633,17 +668,21 @@ if ($resql) print ''; - + // Qty + print ''; + // Actions print ''; print "\n"; $arrayofuniqueproduct=array(); $var=True; - while ($i < min($num,$conf->liste_limit)) + while ($i < min($num,$limit)) { $objp = $db->fetch_object($resql); @@ -710,6 +749,9 @@ if ($resql) print ''; + + print ''; + print "\n"; $i++; } From 8b446faa53955d3fc4973fc0084180398dc0c552 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 8 Jun 2016 11:59:48 +0200 Subject: [PATCH 44/50] Fix field not sortable --- htdocs/product/stock/mouvement.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/product/stock/mouvement.php b/htdocs/product/stock/mouvement.php index 9a0059317fa..8c5f55fb8af 100644 --- a/htdocs/product/stock/mouvement.php +++ b/htdocs/product/stock/mouvement.php @@ -614,7 +614,7 @@ if ($resql) print_liste_field_titre($langs->trans("Author"),$_SERVER["PHP_SELF"], "m.fk_user_author","",$param,"",$sortfield,$sortorder); print_liste_field_titre($langs->trans("InventoryCodeShort"),$_SERVER["PHP_SELF"], "m.inventorycode","",$param,"",$sortfield,$sortorder); print_liste_field_titre($langs->trans("LabelMovement"),$_SERVER["PHP_SELF"], "m.label","",$param,"",$sortfield,$sortorder); - print_liste_field_titre($langs->trans("Source"),$_SERVER["PHP_SELF"], "m.label","",$param,"",$sortfield,$sortorder); + print_liste_field_titre($langs->trans("Source"),$_SERVER["PHP_SELF"], "","",$param,"",$sortfield,$sortorder); print_liste_field_titre($langs->trans("Qty"),$_SERVER["PHP_SELF"], "m.value","",$param,'align="right"',$sortfield,$sortorder); print_liste_field_titre(""); print "\n"; From e5aa79364a8bf9fa748217220ea12dd5dc7bc7aa Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 8 Jun 2016 18:21:05 +0200 Subject: [PATCH 45/50] Update cache example --- build/debian/apache/.htaccess | 15 ++++++++++++++- build/exe/doliwamp/httpd.conf.install | 2 +- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/build/debian/apache/.htaccess b/build/debian/apache/.htaccess index a59829d970b..50f56abaf0e 100644 --- a/build/debian/apache/.htaccess +++ b/build/debian/apache/.htaccess @@ -5,4 +5,17 @@ Require all denied Order deny, allow Denied from all - \ No newline at end of file + + + +# OPTIMIZE: To use cache on static pages (A259200 = 1 month, A7200 = 2 hours). +# Note that you must also enable the module mod_expires. +#ExpiresActive On +#ExpiresByType image/x-icon A2592000 +#ExpiresByType image/gif A2592000 +#ExpiresByType image/png A2592000 +#ExpiresByType image/jpeg A2592000 +#ExpiresByType text/css A2592000 +#ExpiresByType text/javascript A2592000 +#ExpiresByType application/x-javascript A2592000 +#ExpiresByType application/javascript A2592000 diff --git a/build/exe/doliwamp/httpd.conf.install b/build/exe/doliwamp/httpd.conf.install index 64aff6d42a2..980f80f5622 100644 --- a/build/exe/doliwamp/httpd.conf.install +++ b/build/exe/doliwamp/httpd.conf.install @@ -745,7 +745,7 @@ SSLCertificateKeyFile "WAMPROOT/myserver.key" # You can also set this with constant MAIN_OPTIMIZE_SPEED and bit 2 set. #TODO -# OPTIMIZE: To use cache on static pages (A259200 = 1 month). +# OPTIMIZE: To use cache on static pages (A259200 = 1 month, A7200 = 2 hours). # Note that you must also enable the module mod_expires. #ExpiresActive On #ExpiresByType image/x-icon A2592000 From f9190b0940b6498da0528408874e336d0fc639e0 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 8 Jun 2016 18:32:42 +0200 Subject: [PATCH 46/50] Update doc --- build/debian/apache/.htaccess | 2 +- build/exe/doliwamp/httpd.conf.install | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/build/debian/apache/.htaccess b/build/debian/apache/.htaccess index 50f56abaf0e..3c3d2e02683 100644 --- a/build/debian/apache/.htaccess +++ b/build/debian/apache/.htaccess @@ -8,7 +8,7 @@ Denied from all -# OPTIMIZE: To use cache on static pages (A259200 = 1 month, A7200 = 2 hours). +# OPTIMIZE: To use cache on static pages (A259200 = 1 month, A7200 = 2 hours, A691600 = 8 days = recommanded for static resources). # Note that you must also enable the module mod_expires. #ExpiresActive On #ExpiresByType image/x-icon A2592000 diff --git a/build/exe/doliwamp/httpd.conf.install b/build/exe/doliwamp/httpd.conf.install index 980f80f5622..bfe17b07d42 100644 --- a/build/exe/doliwamp/httpd.conf.install +++ b/build/exe/doliwamp/httpd.conf.install @@ -745,7 +745,7 @@ SSLCertificateKeyFile "WAMPROOT/myserver.key" # You can also set this with constant MAIN_OPTIMIZE_SPEED and bit 2 set. #TODO -# OPTIMIZE: To use cache on static pages (A259200 = 1 month, A7200 = 2 hours). +# OPTIMIZE: To use cache on static pages (A259200 = 1 month, A7200 = 2 hours, A691600 = 8 days = recommanded for static resources). # Note that you must also enable the module mod_expires. #ExpiresActive On #ExpiresByType image/x-icon A2592000 From 8ffe7097a45cea7195d4701b72bffc804c75515c Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 9 Jun 2016 01:33:26 +0200 Subject: [PATCH 47/50] Prepare responsive fixes --- htdocs/public/test/test_arrays.php | 40 +++++++++++++++++++++++++----- htdocs/theme/eldy/style.css.php | 15 ++++++++--- htdocs/theme/md/style.css.php | 8 ++++++ 3 files changed, 53 insertions(+), 10 deletions(-) diff --git a/htdocs/public/test/test_arrays.php b/htdocs/public/test/test_arrays.php index 44911b8fa9b..28ff4bdb743 100644 --- a/htdocs/public/test/test_arrays.php +++ b/htdocs/public/test/test_arrays.php @@ -30,7 +30,7 @@ if (empty($usedolheader)) Test page - + @@ -40,6 +40,7 @@ if (empty($usedolheader)) + @@ -87,8 +88,9 @@ This page is a sample of page using tables. It is designed to make test with
- tablednd
-


Example 0a : Table with div+div+div containg a select that should be overflowed and truncated => Use this to align text or form
+ +


Example 0a : Table with div+div+div containg a select that should be overflowed and truncated => Use this to align text or form
@@ -127,12 +129,31 @@ This page is a sample of page using tables. It is designed to make test with
'; print '  '; print ''; + print '  '; + print ''; - print ''; - print ''; + $searchpitco=$form->showFilterAndCheckAddButtons(0); + print $searchpitco; print '
'; if ($objp->value > 0) print '+'; print $objp->value.'
- +


Example 1 : Standard table/thead/tbody/tr/th-td (no class pair/impair on td) => Use this if you need the drag and drop for lines or for long result tables
+ + + + -" id="tablelines3"> + +
" id="tablelines3"> +trans('title1'),0,$_SERVER["PHP_SELF"],'aaa','','','align="left"',$sortfield,$sortorder); ?> trans('title2'),0,$_SERVER["PHP_SELF"],'bbb','','','align="right"',$sortfield,$sortorder); ?> trans('title3'),0,$_SERVER["PHP_SELF"],'ccc','','','align="center"',$sortfield,$sortorder); ?> + + - + +
getNomUrl(1); ?>b1c1
a2b2c2
a2 a2 a2 a2 a2 a2 a2 a2 a2 a2 a2 a2 a2 a2 a2 a2 a2 a2 a2 a2 a2 a2 a2 a2 a2 a2 a2 a2 a2 a2 a2 a2 a2 a2 a2 a2 a2 a2 a2 a2 a2 a2 a2 a2 a2 a2 a2 a2 a2 a2 a2 a2 a2 a2 a2 a2 a2 a2 a2 a2b2c2
a3b3c3
+ +
@@ -323,7 +351,7 @@ $('xxxth').replaceWith( line2 dfsdf - xxx + xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx line3 diff --git a/htdocs/theme/eldy/style.css.php b/htdocs/theme/eldy/style.css.php index 52ee642719c..ca73d3d8bbc 100644 --- a/htdocs/theme/eldy/style.css.php +++ b/htdocs/theme/eldy/style.css.php @@ -569,6 +569,15 @@ div.myavailability { margin-top: 25px !important; } +/* DOL_XXX for future usage (when left menu has been removed). If we do not use datatable */ +.table-responsive { + width: calc(100% - 330px); + margin-bottom: 15px; + overflow-y: hidden; + -ms-overflow-style: -ms-autohiding-scrollbar; +} + + /* ============================================================================== */ /* Styles to hide objects */ @@ -638,16 +647,14 @@ td.showDragHandle { /* ============================================================================== */ #id-container { - /* margin-top: 12px; - margin-bottom: 8px; */ - display: table; + display: table; /* DOL_XXX Empeche fonctionnement correct du scroll horizontal sur tableau, avec datatable ou CSS */ table-layout: fixed; } #id-right, #id-left { padding-top: 12px; padding-bottom: 8px; - display: table-cell; + display: table-cell; /* DOL_XXX Empeche fonctionnement correct du scroll horizontal sur tableau, avec datatable ou CSS */ float: none; vertical-align: top; } diff --git a/htdocs/theme/md/style.css.php b/htdocs/theme/md/style.css.php index 559f464a6df..b42927e3ba8 100644 --- a/htdocs/theme/md/style.css.php +++ b/htdocs/theme/md/style.css.php @@ -568,6 +568,14 @@ div.myavailability { margin-top: 25px !important; } +/* for future usage (when left menu has been removed) */ +.table-responsive { + width: calc(100% - 330px); + margin-bottom: 15px; + overflow-y: hidden; + -ms-overflow-style: -ms-autohiding-scrollbar; +} + /* ============================================================================== */ /* Styles to hide objects */ From 20932a49ca16baf6aad2c0c2710a38c9a123b3bc Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 10 Jun 2016 16:59:42 +0200 Subject: [PATCH 48/50] Fix css problem. When width not enough and top menu is wrapped, background on menu is still full of top menu color --- htdocs/theme/eldy/style.css.php | 33 ++++++++++++++++++++++++++++----- htdocs/theme/md/style.css.php | 12 +++--------- 2 files changed, 31 insertions(+), 14 deletions(-) diff --git a/htdocs/theme/eldy/style.css.php b/htdocs/theme/eldy/style.css.php index ca73d3d8bbc..0d0c97bb474 100644 --- a/htdocs/theme/eldy/style.css.php +++ b/htdocs/theme/eldy/style.css.php @@ -667,6 +667,29 @@ td.showDragHandle { height: calc(100% - 50px);*/ } +/* For desktop */ +global->MAIN_OPTIMIZEFORTEXTBROWSER)) { ?> +.side-nav { + border-right: 1px solid #BBB; + border-bottom: 1px solid #BBB; + background: #FFF; +} +.side-nav { + position: absolute; + z-index: 200; +} +div.blockvmenupair, div.blockvmenuimpair, div.blockvmenubookmarks, div.blockvmenuend { + border-top: none !important; + border-left: none !important; + border-right: none !important; + border-bottom: 1px solid #e0e0e0; +} +div.vmenu, td.vmenu { + padding-right: 6px !important; +} + + + div.fiche { margin-: px; @@ -838,11 +861,11 @@ div#id-top { background-image: -ms-linear-gradient(top, rgba(255,255,255,.1) 0%, rgba(0,0,0,.4) 100%); background-image: -webkit-gradient( linear, left top, left bottom, color-stop(0, rgba(255,255,255,.1)), color-stop(1, rgba(0,0,0,.4)) ); - + /* height: 34px; height: px; - + */ } @@ -912,9 +935,10 @@ ul.tmenu { /* t r b l */ padding: 0px 0px 0px 0px; margin: 0px 0px 0px 0px; list-style: none; + display: table; } ul.tmenu li { /* We need this to have background color when menu entry wraps on new lines */ - background: rgb(); +/* background: rgb(); background-image: linear-gradient(top, rgba(255,255,255,.1) 0%, rgba(0,0,0,.4) 100%); background-image: -o-linear-gradient(top, rgba(255,255,255,.1) 0%, rgba(0,0,0,.4) 100%); @@ -922,7 +946,7 @@ ul.tmenu li { /* We need this to have background color when menu entry wraps on background-image: -webkit-linear-gradient(top, rgba(255,255,255,.1) 0%, rgba(0,0,0,.4) 100%); background-image: -ms-linear-gradient(top, rgba(255,255,255,.1) 0%, rgba(0,0,0,.4) 100%); background-image: -webkit-gradient( linear, left top, left bottom, color-stop(0, rgba(255,255,255,.1)), color-stop(1, rgba(0,0,0,.4)) ); - + */ } li.tmenu, li.tmenusel { @@ -930,7 +954,6 @@ li.tmenu, li.tmenusel { vertical-align: bottom; global->MAIN_MENU_INVERT)) { ?> float: ; - /* height: px; */ position:relative; display: block; diff --git a/htdocs/theme/md/style.css.php b/htdocs/theme/md/style.css.php index b42927e3ba8..01e844146ff 100644 --- a/htdocs/theme/md/style.css.php +++ b/htdocs/theme/md/style.css.php @@ -657,10 +657,6 @@ td.showDragHandle { vertical-align: top; } #id-top { -/* min-width: 100%; - position: relative; - heigth: 52px; - background: #f00;*/ } #id-left { min-height: 100%; @@ -964,7 +960,7 @@ ul.tmenu { /* t r b l */ padding: 0px 0px 0px 0px; margin: 0px 0px 0px 0px; list-style: none; - /* box-shadow: 0 0 6px rgba(0, 0, 0, .4) !important; */ + display: table; } ul.tmenu li { background: rgb(); @@ -1009,10 +1005,8 @@ li.tmenusel, li.tmenu:hover { opacity: .50; /* show only a slight shadow */ } .tmenuend .tmenuleft { width: 0px; } -/* .tmenuend { display: none; } We keep tmenuend it to show background for rest of line */ -.tmenuend .tmenucenter { - width: 1px; -} +.tmenuend { display: none; } + div.tmenuleft { float: ; From 74e59a1bc4ad28143048297cb52ddd96f3e11815 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 10 Jun 2016 18:41:10 +0200 Subject: [PATCH 49/50] Debug prototype feature "testmenuhider" --- htdocs/core/lib/functions.lib.php | 5 +++++ htdocs/core/menus/standard/eldy.lib.php | 11 ++++++++--- htdocs/theme/eldy/style.css.php | 15 +++++++++++++++ htdocs/theme/md/style.css.php | 5 +++++ 4 files changed, 33 insertions(+), 3 deletions(-) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index e07ca6cc6c4..7ab372153dd 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -5342,6 +5342,11 @@ function printCommonFooter($zone='private') });'."\n"; print '});'."\n"; + print ''."\n"; + print 'jQuery(".menuhider").click(function() {'; + print " $('.side-nav').toggle(); "; + print '});'."\n"; + print ''."\n"; } diff --git a/htdocs/core/menus/standard/eldy.lib.php b/htdocs/core/menus/standard/eldy.lib.php index 6f91bfe4325..d44e1f50775 100644 --- a/htdocs/core/menus/standard/eldy.lib.php +++ b/htdocs/core/menus/standard/eldy.lib.php @@ -54,7 +54,7 @@ function print_eldy_menu($db,$atarget,$type_user,&$tabMenu,&$menu,$noout=0) if (GETPOST('testmenuhider') && empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) { $showmode=1; - $classname = 'class="tmenu"'; + $classname = 'class="tmenu menuhider"'; $idsel='menu'; if (empty($noout)) print_start_menu_entry($idsel,$classname,$showmode); @@ -1425,13 +1425,18 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu { $altok++; $blockvmenuopened=true; + $lastopened=true; + for($j = ($i + 1); $j < $num; $j++) + { + if (empty($menu_array[$j]['level'])) $lastopened=false; + } if ($altok % 2 == 0) { - print '
'."\n"; + print '
'."\n"; } else { - print '
'."\n"; + print '
'."\n"; } } diff --git a/htdocs/theme/eldy/style.css.php b/htdocs/theme/eldy/style.css.php index 0d0c97bb474..383fc2f9abe 100644 --- a/htdocs/theme/eldy/style.css.php +++ b/htdocs/theme/eldy/style.css.php @@ -669,6 +669,9 @@ td.showDragHandle { /* For desktop */ global->MAIN_OPTIMIZEFORTEXTBROWSER)) { ?> +#id-container { + width: 100%; +} .side-nav { border-right: 1px solid #BBB; border-bottom: 1px solid #BBB; @@ -678,15 +681,27 @@ td.showDragHandle { position: absolute; z-index: 200; } +div.blockvmenulogo +{ + border-bottom: 0 !important; +} +div.blockvmenusearch { + border-bottom: 1px solid #e0e0e0; + padding-bottom: 10px !important; +} div.blockvmenupair, div.blockvmenuimpair, div.blockvmenubookmarks, div.blockvmenuend { border-top: none !important; border-left: none !important; border-right: none !important; border-bottom: 1px solid #e0e0e0; + padding-left: 0 !important; } div.vmenu, td.vmenu { padding-right: 6px !important; } +div.blockvmenulast { + border-bottom: 0; +} diff --git a/htdocs/theme/md/style.css.php b/htdocs/theme/md/style.css.php index 01e844146ff..7f3e5d5040f 100644 --- a/htdocs/theme/md/style.css.php +++ b/htdocs/theme/md/style.css.php @@ -1444,6 +1444,11 @@ div.blockvmenusearch padding-bottom: 10px; border-bottom: 1px solid #f4f4f4; } +div.blockvmenusearchphone +{ + border-bottom: none; + margin-bottom: 0px; +} div.blockvmenuhelp { From aed2c5cb30169927a253bd250d031a335c40de81 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 10 Jun 2016 18:41:18 +0200 Subject: [PATCH 50/50] Clean css --- htdocs/core/class/html.form.class.php | 2 +- htdocs/core/class/html.formmail.class.php | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 175bc8873e1..159708de61f 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -5948,7 +5948,7 @@ class Form { console.log("We uncheck all"); $(".'.$cssclass.'").prop(\'checked\', false); - }'; + }'."\n"; if ($calljsfunction) $out.='if (typeof initCheckForSelect == \'function\') { initCheckForSelect(); } else { console.log("No function initCheckForSelect found. Call won\'t done."); }'; $out.=' }); }); diff --git a/htdocs/core/class/html.formmail.class.php b/htdocs/core/class/html.formmail.class.php index 23b0fc5d6e2..a0afc8bcc94 100644 --- a/htdocs/core/class/html.formmail.class.php +++ b/htdocs/core/class/html.formmail.class.php @@ -715,9 +715,11 @@ class FormMail extends Form $out.= "\n"; } + $out.= ''."\n"; + if ($this->withform == 1 || $this->withform == -1) { - $out.= '
'; + $out.= '
'; $out.= 'withfile == 2 && $conf->use_javascript_ajax) @@ -730,11 +732,9 @@ class FormMail extends Form $out.= '     '; $out.= ''; } - $out.= '
'."\n"; + $out.= '
'."\n"; } - $out.= ''."\n"; - if ($this->withform == 1) $out.= ''."\n"; // Disable enter key if option MAIN_MAILFORM_DISABLE_ENTERKEY is set