From 91d2d573c315dcfd99afa4e4d3a32520dcff3179 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 2 Jul 2016 11:26:55 +0200 Subject: [PATCH 01/19] Fix NNE has been replaced with ICS --- htdocs/admin/prelevement.php | 43 ++++++++----------- .../class/bonprelevement.class.php | 11 ++--- htdocs/core/lib/prelevement.lib.php | 4 +- 3 files changed, 24 insertions(+), 34 deletions(-) diff --git a/htdocs/admin/prelevement.php b/htdocs/admin/prelevement.php index 410851b640b..b131009ab88 100644 --- a/htdocs/admin/prelevement.php +++ b/htdocs/admin/prelevement.php @@ -45,14 +45,6 @@ $action = GETPOST('action','alpha'); if ($action == "set") { $db->begin(); - for ($i = 0 ; $i < 2 ; $i++) - { - $res = dolibarr_set_const($db, GETPOST("nom$i",'alpha'), GETPOST("value$i",'alpha'),'chaine',0,'',$conf->entity); - if (! $res > 0) $error++; - } - - $res = dolibarr_set_const($db, "PRELEVEMENT_ICS", GETPOST("PRELEVEMENT_ICS"),'chaine',0,'',$conf->entity); - if (! $res > 0) $error++; $id=GETPOST('PRELEVEMENT_ID_BANKACCOUNT','int'); $account = new Account($db); @@ -78,6 +70,15 @@ if ($action == "set") } else $error++; + $res = dolibarr_set_const($db, "PRELEVEMENT_ICS", GETPOST("PRELEVEMENT_ICS"),'chaine',0,'',$conf->entity); + if (! $res > 0) $error++; + + if (GETPOST("PRELEVEMENT_USER") > 0) + { + $res = dolibarr_set_const($db, "PRELEVEMENT_USER", GETPOST("PRELEVEMENT_USER"),'chaine',0,'',$conf->entity); + if (! $res > 0) $error++; + } + if (! $error) { $db->commit(); @@ -131,33 +132,25 @@ print ''.$langs->trans("Parameter").''; print ''.$langs->trans("Value").''; print ""; -//User -print ''.$langs->trans("ResponsibleUser").''; -print ''; -print ''; -print $form->select_dolusers($conf->global->PRELEVEMENT_USER, 'value0', 1, '', 0, '', '', 0, 0, 0, '', 0, '', 'maxwidth300'); -print ''; -print ''; - -//Profid1 of Transmitter -print ''.$langs->trans("NumeroNationalEmetter").' - '.$langs->transcountry('ProfId1',$mysoc->country_code).''; -print ''; -print ''; -print ''; -print ''; - // Bank account (from Banks module) -print ''.$langs->trans("BankToReceiveWithdraw").''; +print ''.$langs->trans("BankToReceiveWithdraw").''; print ''; $form->select_comptes($conf->global->PRELEVEMENT_ID_BANKACCOUNT,'PRELEVEMENT_ID_BANKACCOUNT',0,"courant=1",1); print ''; // ICS -print ''.$langs->trans("ICS").''; +print ''.$langs->trans("ICS").''; print ''; print ''; print ''; +//User +print ''.$langs->trans("ResponsibleUser").''; +print ''; +print $form->select_dolusers($conf->global->PRELEVEMENT_USER, 'PRELEVEMENT_USER', 1, '', 0, '', '', 0, 0, 0, '', 0, '', 'maxwidth300'); +print ''; +print ''; + print ''; print '
'; diff --git a/htdocs/compta/prelevement/class/bonprelevement.class.php b/htdocs/compta/prelevement/class/bonprelevement.class.php index 31d9e4d67c1..a318673e1c8 100644 --- a/htdocs/compta/prelevement/class/bonprelevement.class.php +++ b/htdocs/compta/prelevement/class/bonprelevement.class.php @@ -87,8 +87,6 @@ class BonPrelevement extends CommonObject $this->factures = array(); - $this->numero_national_emetteur = ""; - $this->methodes_trans = array(); $this->methodes_trans[0] = "Internet"; @@ -1018,7 +1016,6 @@ class BonPrelevement extends CommonObject $this->date_echeance = $datetimeprev; $this->reference_remise = $ref; - $this->numero_national_emetteur = $conf->global->PRELEVEMENT_NUMERO_NATIONAL_EMETTEUR; $this->raison_sociale = $conf->global->PRELEVEMENT_RAISON_SOCIALE; $this->emetteur_code_banque = $conf->global->PRELEVEMENT_CODE_BANQUE; @@ -1027,7 +1024,7 @@ class BonPrelevement extends CommonObject $this->emetteur_number_key = $conf->global->PRELEVEMENT_NUMBER_KEY; $this->emetteur_iban = $conf->global->PRELEVEMENT_IBAN; $this->emetteur_bic = $conf->global->PRELEVEMENT_BIC; - $this->emetteur_ics = $conf->global->PRELEVEMENT_ICS; // TODO Add this into setup of admin/prelevement.php. Ex: PRELEVEMENT_ICS = "FR78ZZZ123456"; + $this->emetteur_ics = $conf->global->PRELEVEMENT_ICS; // Ex: PRELEVEMENT_ICS = "FR78ZZZ123456"; $this->factures = $factures_prev_id; @@ -1462,7 +1459,7 @@ class BonPrelevement extends CommonObject fputs($this->file, " "); // Zone Reservee B2 - fputs($this->file, $this->numero_national_emetteur); // Numero National d'emmetteur B3 + fputs($this->file, $this->emetteur_ics); // ICS // Date d'echeance C1 @@ -1611,7 +1608,7 @@ class BonPrelevement extends CommonObject fputs($this->file, " "); // Zone Reservee B2 - fputs($this->file, $this->numero_national_emetteur); // Numero National d'emmetteur B3 + fputs($this->file, $this->emetteur_ics); // ICS // Date d'echeance C1 @@ -1778,7 +1775,7 @@ class BonPrelevement extends CommonObject fputs($this->file, " "); // Zone Reservee B2 - fputs($this->file, $this->numero_national_emetteur); // Numero National d'emmetteur B3 + fputs($this->file, $this->emetteur_ics); // ICS // Reserve C1 diff --git a/htdocs/core/lib/prelevement.lib.php b/htdocs/core/lib/prelevement.lib.php index a575ae51bcc..47bc2cb1974 100644 --- a/htdocs/core/lib/prelevement.lib.php +++ b/htdocs/core/lib/prelevement.lib.php @@ -78,9 +78,9 @@ function prelevement_prepare_head(BonPrelevement $object) function prelevement_check_config() { global $conf; - if(empty($conf->global->PRELEVEMENT_USER)) return -1; if(empty($conf->global->PRELEVEMENT_ID_BANKACCOUNT)) return -1; - if(empty($conf->global->PRELEVEMENT_NUMERO_NATIONAL_EMETTEUR)) return -1; + if(empty($conf->global->PRELEVEMENT_ICS)) return -1; + if(empty($conf->global->PRELEVEMENT_USER)) return -1; return 0; } From 3eaf0bc4bfcb0944bce839c559eea9e6585c9379 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 2 Jul 2016 11:32:06 +0200 Subject: [PATCH 02/19] Fix bad translation --- htdocs/core/modules/modSupplierProposal.class.php | 2 +- htdocs/langs/en_US/supplier_proposal.lang | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/core/modules/modSupplierProposal.class.php b/htdocs/core/modules/modSupplierProposal.class.php index 9c249da4dc6..3ca6b534506 100644 --- a/htdocs/core/modules/modSupplierProposal.class.php +++ b/htdocs/core/modules/modSupplierProposal.class.php @@ -141,7 +141,7 @@ class modSupplierProposal extends DolibarrModules $this->menu[$r]=array( 'fk_menu'=>'fk_mainmenu=commercial', // Use 'fk_mainmenu=xxx' or 'fk_mainmenu=xxx,fk_leftmenu=yyy' where xxx is mainmenucode and yyy is a leftmenucode 'type'=>'left', // This is a Left menu entry - 'titre'=>'SupplierProposalShort', + 'titre'=>'SupplierProposalsShort', 'leftmenu'=>'supplier_proposalsubmenu', 'url'=>'/supplier_proposal/index.php', 'langs'=>'supplier_proposal', // Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory. diff --git a/htdocs/langs/en_US/supplier_proposal.lang b/htdocs/langs/en_US/supplier_proposal.lang index 86127b11a96..909a4d713c1 100644 --- a/htdocs/langs/en_US/supplier_proposal.lang +++ b/htdocs/langs/en_US/supplier_proposal.lang @@ -12,6 +12,7 @@ RequestsOpened=Open price requests SupplierProposalArea=Supplier proposals area SupplierProposalShort=Supplier proposal SupplierProposals=Supplier proposals +SupplierProposalsShort=Supplier proposals NewAskPrice=New price request ShowSupplierProposal=Show price request AddSupplierProposal=Create a price request From 7d9671f6d3c8f0f546bb28efd0e4395a73b1f10d Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 2 Jul 2016 11:44:46 +0200 Subject: [PATCH 03/19] Fix bad separator in url --- htdocs/core/modules/modSupplierProposal.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/modules/modSupplierProposal.class.php b/htdocs/core/modules/modSupplierProposal.class.php index 3ca6b534506..842146597a3 100644 --- a/htdocs/core/modules/modSupplierProposal.class.php +++ b/htdocs/core/modules/modSupplierProposal.class.php @@ -156,7 +156,7 @@ class modSupplierProposal extends DolibarrModules 'fk_menu'=>'fk_mainmenu=commercial,fk_leftmenu=supplier_proposalsubmenu', 'type'=>'left', 'titre'=>'SupplierProposalNew', - 'url'=>'/supplier_proposal/card.php?action=create&leftmenu=supplier_proposals', + 'url'=>'/supplier_proposal/card.php?action=create&leftmenu=supplier_proposals', 'langs'=>'supplier_proposal', 'enabled'=>'$conf->supplier_proposal->enabled', 'perms'=>'$user->rights->supplier_proposal->creer', @@ -182,7 +182,7 @@ class modSupplierProposal extends DolibarrModules 'fk_menu'=>'fk_mainmenu=commercial,fk_leftmenu=supplier_proposalsubmenu', 'type'=>'left', 'titre'=>'Statistics', - 'url'=>'/comm/propal/stats/index.php?leftmenu=supplier_proposals&mode=supplier', + 'url'=>'/comm/propal/stats/index.php?leftmenu=supplier_proposals&mode=supplier', 'langs'=>'supplier_proposal', 'enabled'=>'$conf->supplier_proposal->enabled', 'perms'=>'$user->rights->supplier_proposal->lire', From 525b2cf2971c814d2154dbba676c2974ff3417c5 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 2 Jul 2016 12:02:51 +0200 Subject: [PATCH 04/19] Fix: Edition of contract on intervention failed --- htdocs/core/class/html.formcontract.class.php | 30 ++++++++++++++++++- htdocs/fichinter/card.php | 14 ++------- 2 files changed, 32 insertions(+), 12 deletions(-) diff --git a/htdocs/core/class/html.formcontract.class.php b/htdocs/core/class/html.formcontract.class.php index 0169f5ae811..80b618b8804 100644 --- a/htdocs/core/class/html.formcontract.class.php +++ b/htdocs/core/class/html.formcontract.class.php @@ -50,7 +50,7 @@ class FormContract * @param string $htmlname Nom de la zone html * @param int $maxlength Maximum length of label * @param int $showempty Show empty line - * @return int Nbre of project if OK, <0 if KO + * @return int Nbr of project if OK, <0 if KO */ function select_contract($socid=-1, $selected='', $htmlname='contrattid', $maxlength=16, $showempty=1) { @@ -137,4 +137,32 @@ class FormContract return -1; } } + + /** + * Show a form to select a contract + * + * @param int $page Page + * @param int $socid Id third party (-1=all, 0=only contracts not linked to a third party, id=contracts not linked or linked to third party id) + * @param int $selected Id contract preselected + * @param string $htmlname Nom de la zone html + * @param int $maxlength Maximum length of label + * @param int $showempty Show empty line + * @return int Nbr of project if OK, <0 if KO + */ + function formSelectContract($page, $socid=-1, $selected='', $htmlname='contrattid', $maxlength=16, $showempty=1) + { + global $langs; + + print "\n"; + print '
'; + print ''; + print ''; + print ''; + print ''; + print ''; + print '
'; + $this->select_contract($socid, $selected, $htmlname, $maxlength, $showempty); + print '
'; + } + } diff --git a/htdocs/fichinter/card.php b/htdocs/fichinter/card.php index e05b1cde1a4..2a4ec4337f2 100644 --- a/htdocs/fichinter/card.php +++ b/htdocs/fichinter/card.php @@ -477,7 +477,7 @@ if (empty($reshook)) } // Set into a contract - else if ($action == 'setcontrat' && $user->rights->contrat->creer) + else if ($action == 'setcontract' && $user->rights->contrat->creer) { $result=$object->set_contrat($user,GETPOST('contratid','int')); if ($result < 0) dol_print_error($db,$object->error); @@ -1251,15 +1251,8 @@ else if ($id > 0 || ! empty($ref)) print ''; if ($action == 'contrat') { - print ''; - print ''; - print ''; - print '
'; - $htmlcontract= new Formcontract($db); - //print "$socid,$selected,$htmlname"; - $htmlcontract->select_contract($object->socid,$object->fk_contrat,'contratid'); - - print '
'; + $formcontract= new Formcontract($db); + $formcontract->formSelectContract($_SERVER["PHP_SELF"].'?id='.$object->id, $object->socid, $object->fk_contrat, 'contratid', 0, 1); } else { @@ -1649,7 +1642,6 @@ else if ($id > 0 || ! empty($ref)) } print ''; - print '
'; if ($action != 'presend') { From 9a75d40d56f423f4452bdc3f3b7bd253c9659224 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 2 Jul 2016 12:21:47 +0200 Subject: [PATCH 05/19] Fix switching between web sites --- htdocs/websites/index.php | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/htdocs/websites/index.php b/htdocs/websites/index.php index ae29dab196b..19f72486c3f 100644 --- a/htdocs/websites/index.php +++ b/htdocs/websites/index.php @@ -137,6 +137,8 @@ $urlwithroot=$urlwithouturlroot.DOL_URL_ROOT; // This is to use external domain * Actions */ +if (GETPOST('refreshsite')) $pageid=0; // If we change the site, we reset the pageid. + // Add page if ($action == 'add') { @@ -321,7 +323,7 @@ if ($action == 'updatemeta') $res = $objectpage->fetch($pageid, $object->fk_website); if ($res > 0) { - $objectpage->pageurl = GETPOST('WEBSITE_PAGENAME'); + $objectpage->pageurl = GETPOST('WEBSITE_PAGENAME'); $objectpage->title = GETPOST('WEBSITE_TITLE'); $objectpage->description = GETPOST('WEBSITE_DESCRIPTION'); $objectpage->keywords = GETPOST('WEBSITE_KEYWORDS'); @@ -476,7 +478,7 @@ if (count($object->records) > 0) } $out.=''; print $out; - print ''; + print ''; if ($website) { @@ -529,22 +531,31 @@ if (count($object->records) > 0) $out.=''; print $out; - print ''; + print ''; print ''; //print $form->selectarray('page', $array); From fe86ef57747ec3b61b27c6affae6ab179ca1b2a5 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 2 Jul 2016 17:00:45 +0200 Subject: [PATCH 06/19] Thirdparty into keyword, encoded with convToOutputCharset --- htdocs/core/modules/commande/doc/pdf_einstein.modules.php | 2 +- htdocs/core/modules/contract/doc/pdf_strato.modules.php | 2 +- htdocs/core/modules/facture/doc/pdf_crabe.modules.php | 2 +- htdocs/core/modules/propale/doc/pdf_azur.modules.php | 2 +- .../core/modules/supplier_invoice/pdf/pdf_canelle.modules.php | 2 +- htdocs/core/modules/supplier_order/pdf/pdf_muscadet.modules.php | 2 +- .../core/modules/supplier_proposal/doc/pdf_aurore.modules.php | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/htdocs/core/modules/commande/doc/pdf_einstein.modules.php b/htdocs/core/modules/commande/doc/pdf_einstein.modules.php index aff994a5209..98091a8b727 100644 --- a/htdocs/core/modules/commande/doc/pdf_einstein.modules.php +++ b/htdocs/core/modules/commande/doc/pdf_einstein.modules.php @@ -239,7 +239,7 @@ class pdf_einstein extends ModelePDFCommandes $pdf->SetSubject($outputlangs->transnoentities("Order")); $pdf->SetCreator("Dolibarr ".DOL_VERSION); $pdf->SetAuthor($outputlangs->convToOutputCharset($user->getFullName($outputlangs))); - $pdf->SetKeyWords($outputlangs->convToOutputCharset($object->ref)." ".$outputlangs->transnoentities("Order")); + $pdf->SetKeyWords($outputlangs->convToOutputCharset($object->ref)." ".$outputlangs->transnoentities("Order")." ".$outputlangs->convToOutputCharset($object->thirdparty->name)); if (! empty($conf->global->MAIN_DISABLE_PDF_COMPRESSION)) $pdf->SetCompression(false); $pdf->SetMargins($this->marge_gauche, $this->marge_haute, $this->marge_droite); // Left, Top, Right diff --git a/htdocs/core/modules/contract/doc/pdf_strato.modules.php b/htdocs/core/modules/contract/doc/pdf_strato.modules.php index 1aabe54cbd8..a2828fb466a 100644 --- a/htdocs/core/modules/contract/doc/pdf_strato.modules.php +++ b/htdocs/core/modules/contract/doc/pdf_strato.modules.php @@ -198,7 +198,7 @@ class pdf_strato extends ModelePDFContract $pdf->SetSubject($outputlangs->transnoentities("ContractCard")); $pdf->SetCreator("Dolibarr ".DOL_VERSION); $pdf->SetAuthor($outputlangs->convToOutputCharset($user->getFullName($outputlangs))); - $pdf->SetKeyWords($outputlangs->convToOutputCharset($object->ref)." ".$outputlangs->transnoentities("ContractCard")); + $pdf->SetKeyWords($outputlangs->convToOutputCharset($object->ref)." ".$outputlangs->transnoentities("ContractCard")." ".$outputlangs->convToOutputCharset($object->thirdparty->name)); if (! empty($conf->global->MAIN_DISABLE_PDF_COMPRESSION)) $pdf->SetCompression(false); $pdf->SetMargins($this->marge_gauche, $this->marge_haute, $this->marge_droite); // Left, Top, Right diff --git a/htdocs/core/modules/facture/doc/pdf_crabe.modules.php b/htdocs/core/modules/facture/doc/pdf_crabe.modules.php index 4305f379f44..1b36ef6c92f 100644 --- a/htdocs/core/modules/facture/doc/pdf_crabe.modules.php +++ b/htdocs/core/modules/facture/doc/pdf_crabe.modules.php @@ -282,7 +282,7 @@ class pdf_crabe extends ModelePDFFactures $pdf->SetSubject($outputlangs->transnoentities("Invoice")); $pdf->SetCreator("Dolibarr ".DOL_VERSION); $pdf->SetAuthor($outputlangs->convToOutputCharset($user->getFullName($outputlangs))); - $pdf->SetKeyWords($outputlangs->convToOutputCharset($object->ref)." ".$outputlangs->transnoentities("Invoice")); + $pdf->SetKeyWords($outputlangs->convToOutputCharset($object->ref)." ".$outputlangs->transnoentities("Invoice")." ".$outputlangs->convToOutputCharset($object->thirdparty->name)); if (! empty($conf->global->MAIN_DISABLE_PDF_COMPRESSION)) $pdf->SetCompression(false); $pdf->SetMargins($this->marge_gauche, $this->marge_haute, $this->marge_droite); // Left, Top, Right diff --git a/htdocs/core/modules/propale/doc/pdf_azur.modules.php b/htdocs/core/modules/propale/doc/pdf_azur.modules.php index 81f73b98f29..801d6dc16e4 100644 --- a/htdocs/core/modules/propale/doc/pdf_azur.modules.php +++ b/htdocs/core/modules/propale/doc/pdf_azur.modules.php @@ -296,7 +296,7 @@ class pdf_azur extends ModelePDFPropales $pdf->SetSubject($outputlangs->transnoentities("CommercialProposal")); $pdf->SetCreator("Dolibarr ".DOL_VERSION); $pdf->SetAuthor($outputlangs->convToOutputCharset($user->getFullName($outputlangs))); - $pdf->SetKeyWords($outputlangs->convToOutputCharset($object->ref)." ".$outputlangs->transnoentities("CommercialProposal")); + $pdf->SetKeyWords($outputlangs->convToOutputCharset($object->ref)." ".$outputlangs->transnoentities("CommercialProposal")." ".$outputlangs->convToOutputCharset($object->thirdparty->name)); if (! empty($conf->global->MAIN_DISABLE_PDF_COMPRESSION)) $pdf->SetCompression(false); $pdf->SetMargins($this->marge_gauche, $this->marge_haute, $this->marge_droite); // Left, Top, Right diff --git a/htdocs/core/modules/supplier_invoice/pdf/pdf_canelle.modules.php b/htdocs/core/modules/supplier_invoice/pdf/pdf_canelle.modules.php index 2787f446e4e..ceed17350d0 100644 --- a/htdocs/core/modules/supplier_invoice/pdf/pdf_canelle.modules.php +++ b/htdocs/core/modules/supplier_invoice/pdf/pdf_canelle.modules.php @@ -232,7 +232,7 @@ class pdf_canelle extends ModelePDFSuppliersInvoices $pdf->SetSubject($outputlangs->transnoentities("Invoice")); $pdf->SetCreator("Dolibarr ".DOL_VERSION); $pdf->SetAuthor($outputlangs->convToOutputCharset($user->getFullName($outputlangs))); - $pdf->SetKeyWords($outputlangs->convToOutputCharset($object->ref)." ".$outputlangs->transnoentities("Order")); + $pdf->SetKeyWords($outputlangs->convToOutputCharset($object->ref)." ".$outputlangs->transnoentities("Order")." ".$outputlangs->convToOutputCharset($object->thirdparty->name)); if (! empty($conf->global->MAIN_DISABLE_PDF_COMPRESSION)) $pdf->SetCompression(false); $pdf->SetMargins($this->marge_gauche, $this->marge_haute, $this->marge_droite); // Left, Top, Right diff --git a/htdocs/core/modules/supplier_order/pdf/pdf_muscadet.modules.php b/htdocs/core/modules/supplier_order/pdf/pdf_muscadet.modules.php index 783a0b2d0b6..d8912fa1a42 100644 --- a/htdocs/core/modules/supplier_order/pdf/pdf_muscadet.modules.php +++ b/htdocs/core/modules/supplier_order/pdf/pdf_muscadet.modules.php @@ -243,7 +243,7 @@ class pdf_muscadet extends ModelePDFSuppliersOrders $pdf->SetSubject($outputlangs->transnoentities("Order")); $pdf->SetCreator("Dolibarr ".DOL_VERSION); $pdf->SetAuthor($outputlangs->convToOutputCharset($user->getFullName($outputlangs))); - $pdf->SetKeyWords($outputlangs->convToOutputCharset($object->ref)." ".$outputlangs->transnoentities("Order")); + $pdf->SetKeyWords($outputlangs->convToOutputCharset($object->ref)." ".$outputlangs->transnoentities("Order")." ".$outputlangs->convToOutputCharset($object->thirdparty->name)); if (! empty($conf->global->MAIN_DISABLE_PDF_COMPRESSION)) $pdf->SetCompression(false); $pdf->SetMargins($this->marge_gauche, $this->marge_haute, $this->marge_droite); // Left, Top, Right diff --git a/htdocs/core/modules/supplier_proposal/doc/pdf_aurore.modules.php b/htdocs/core/modules/supplier_proposal/doc/pdf_aurore.modules.php index 797aa81ce4b..2a6a442582c 100644 --- a/htdocs/core/modules/supplier_proposal/doc/pdf_aurore.modules.php +++ b/htdocs/core/modules/supplier_proposal/doc/pdf_aurore.modules.php @@ -252,7 +252,7 @@ class pdf_aurore extends ModelePDFSupplierProposal $pdf->SetSubject($outputlangs->transnoentities("CommercialAsk")); $pdf->SetCreator("Dolibarr ".DOL_VERSION); $pdf->SetAuthor($outputlangs->convToOutputCharset($user->getFullName($outputlangs))); - $pdf->SetKeyWords($outputlangs->convToOutputCharset($object->ref)." ".$outputlangs->transnoentities("CommercialAsk")); + $pdf->SetKeyWords($outputlangs->convToOutputCharset($object->ref)." ".$outputlangs->transnoentities("CommercialAsk")." ".$outputlangs->convToOutputCharset($object->thirdparty->name)); if (! empty($conf->global->MAIN_DISABLE_PDF_COMPRESSION)) $pdf->SetCompression(false); $pdf->SetMargins($this->marge_gauche, $this->marge_haute, $this->marge_droite); // Left, Top, Right From 3d72f788b95883da02ae3bb4b89a6ce10d385109 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 2 Jul 2016 18:02:39 +0200 Subject: [PATCH 07/19] Fix phpcs --- htdocs/core/modules/mailings/advthirdparties.modules.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/htdocs/core/modules/mailings/advthirdparties.modules.php b/htdocs/core/modules/mailings/advthirdparties.modules.php index 1e04fe5459d..24ad5ee4a0b 100644 --- a/htdocs/core/modules/mailings/advthirdparties.modules.php +++ b/htdocs/core/modules/mailings/advthirdparties.modules.php @@ -200,9 +200,10 @@ class mailing_advthirdparties extends MailingTargets * For example if this selector is used to extract 500 different * emails from a text file, this function must return 500. * - * @return int Nb of recipients + * @param string $sql Sql request to use + * @return int Nb of recipients */ - function getNbOfRecipients($sql) + function getNbOfRecipients($sql='') { global $conf; From a8b1699abbec48568720e33ffac79dee44c33865 Mon Sep 17 00:00:00 2001 From: Scrutinizer Auto-Fixer Date: Sat, 2 Jul 2016 18:26:31 +0000 Subject: [PATCH 08/19] Scrutinizer Auto-Fixes This commit consists of patches automatically generated for this project on https://scrutinizer-ci.com --- htdocs/accountancy/class/accountancycategory.class.php | 2 +- htdocs/core/boxes/box_actions.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/accountancy/class/accountancycategory.class.php b/htdocs/accountancy/class/accountancycategory.class.php index 43b9816c5ed..6211f5752b1 100644 --- a/htdocs/accountancy/class/accountancycategory.class.php +++ b/htdocs/accountancy/class/accountancycategory.class.php @@ -297,7 +297,7 @@ class AccountancyCategory * @param string $year Specific year * @param int $sens Sens of the account 0: credit - debit 1: debit - credit * - * @return array Result in table + * @return integer Result in table */ public function getResult($cpt, $month, $year, $sens) { $sql = "SELECT SUM(t.debit) as debit, SUM(t.credit) as credit"; diff --git a/htdocs/core/boxes/box_actions.php b/htdocs/core/boxes/box_actions.php index 82aacf2d8a0..973738fec11 100644 --- a/htdocs/core/boxes/box_actions.php +++ b/htdocs/core/boxes/box_actions.php @@ -168,7 +168,7 @@ class box_actions extends ModeleBoxes * @param array $head Array with properties of box title * @param array $contents Array with properties of box lines * @param int $nooutput No print, only return string - * @return void + * @return string */ function showBox($head = null, $contents = null, $nooutput=0) { From ce3f45c2a270a5319713a12031488baf95ce4797 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 3 Jul 2016 13:14:33 +0200 Subject: [PATCH 09/19] Debug of doliwamp for 4.0 --- build/exe/doliwamp/dolibarr.conf.install | 17 +++++++-- build/exe/doliwamp/doliwamp.iss | 34 ++++------------- build/exe/doliwamp/httpd.conf.install | 38 ++++++++++--------- .../exe/doliwamp/install_services.bat.install | 8 +++- build/exe/doliwamp/phpmyadmin.conf.install | 31 ++++++++++----- .../doliwamp/uninstall_services.bat.install | 11 +++++- dev/security/htaccess.txt | 3 +- 7 files changed, 80 insertions(+), 62 deletions(-) diff --git a/build/exe/doliwamp/dolibarr.conf.install b/build/exe/doliwamp/dolibarr.conf.install index 40b8dea7784..4dbb8c62317 100644 --- a/build/exe/doliwamp/dolibarr.conf.install +++ b/build/exe/doliwamp/dolibarr.conf.install @@ -1,6 +1,6 @@ Alias /dolibarr "WAMPROOT/www/dolibarr/htdocs/" -# NOTE: +# NOTE FOR APACHE 2.2: # To restrict access to dolibarr from outside set lines # # Order Deny,Allow @@ -12,10 +12,21 @@ Alias /dolibarr "WAMPROOT/www/dolibarr/htdocs/" # Order Allow,Deny # Allow from all # +# NOTE FOR APACHE 2.3: +# To restrict access to dolibarr from outside set lines +# +# +# Require ip 127.0.0.1 +# Require host localhost +# +# +# instead of +# +# Require all granted +# Options Indexes FollowSymLinks MultiViews AllowOverride all - Order Allow,Deny - Allow from all + Require all granted \ No newline at end of file diff --git a/build/exe/doliwamp/doliwamp.iss b/build/exe/doliwamp/doliwamp.iss index e4cfc326422..3aaf113e679 100644 --- a/build/exe/doliwamp/doliwamp.iss +++ b/build/exe/doliwamp/doliwamp.iss @@ -101,7 +101,7 @@ Source: "build\exe\doliwamp\UsedPort.exe"; DestDir: "{app}\"; Flags: ignoreversi ; Put here path of Wampserver applications ; Value OK: apache 2.2.6, php 5.2.5 (5.2.11, 5.3.0 and 5.3.1 fails if php_exif, php_pgsql, php_zip is on), mysql 5.0.45 or 5.1.36 ; Value OK: apache 2.2.11, php 5.3.0 (if no php_exif, php_pgsql, php_zip), mysql 5.0.45 or 5.1.36 -; Value ???: apache 2.4.19, php 5.5.12, mysql 5.6.17 +; Value ???: apache 2.4.19, php 5.5.12, mysql 5.6.17 (wampserver2.5-Apache-2.4.9-Mysql-5.6.17-php5.5.12-32b.exe) Source: "C:\Program Files\Wamp\apps\phpmyadmin4.1.14\*.*"; DestDir: "{app}\apps\phpmyadmin4.1.14"; Flags: ignoreversion recursesubdirs; Excludes: "config.inc.php,wampserver.conf,*.log,*_log,darkblue_orange" Source: "C:\Program Files\Wamp\bin\apache\apache2.4.9\*.*"; DestDir: "{app}\bin\apache\apache2.4.9"; Flags: ignoreversion recursesubdirs; Excludes: "php.ini,httpd.conf,wampserver.conf,*.log,*_log" Source: "C:\Program Files\Wamp\bin\php\php5.5.12\*.*"; DestDir: "{app}\bin\php\php5.5.12"; Flags: ignoreversion recursesubdirs; Excludes: "php.ini,phpForApache.ini,wampserver.conf,*.log,*_log" @@ -119,8 +119,8 @@ Source: "build\exe\doliwamp\phpmyadmin.conf.install"; DestDir: "{app}\alias"; Fl Source: "build\exe\doliwamp\dolibarr.conf.install"; DestDir: "{app}\alias"; Flags: ignoreversion; Source: "build\exe\doliwamp\config.inc.php.install"; DestDir: "{app}\apps\phpmyadmin4.1.14"; Flags: ignoreversion; Source: "build\exe\doliwamp\httpd.conf.install"; DestDir: "{app}\bin\apache\apache2.4.9\conf"; Flags: ignoreversion; -Source: "build\exe\doliwamp\my.ini.install"; DestDir: "{app}\bin\mysql\mysql5.5.12"; Flags: ignoreversion; -Source: "build\exe\doliwamp\php.ini.install"; DestDir: "{app}\bin\php\php5.6.17"; Flags: ignoreversion; +Source: "build\exe\doliwamp\my.ini.install"; DestDir: "{app}\bin\mysql\mysql5.6.17"; Flags: ignoreversion; +Source: "build\exe\doliwamp\php.ini.install"; DestDir: "{app}\bin\php\php5.5.12"; Flags: ignoreversion; Source: "build\exe\doliwamp\index.php.install"; DestDir: "{app}\www"; Flags: ignoreversion; Source: "build\exe\doliwamp\install.forced.php.install"; DestDir: "{app}\www\dolibarr\htdocs\install"; Flags: ignoreversion; Source: "build\exe\doliwamp\openssl.conf"; DestDir: "{app}"; Flags: ignoreversion; @@ -338,11 +338,11 @@ begin // Test if VC11Redist has been installed //---------------------------------------------- - if not FileExists ('c:/windows/system32/msvcr70.dll') and not FileExists ('c:/windows/sysWOW64/msvcr70.dll') and not FileExists ('c:/winnt/system32/msvcr70.dll') and not FileExists ('c:/winnt/sysWOW64/msvcr70.dll') then + if not FileExists ('c:/windows/system32/msvcr110.dll') and not FileExists ('c:/windows/sysWOW64/msvcr110.dll') and not FileExists ('c:/winnt/system32/msvcr110.dll') and not FileExists ('c:/winnt/sysWOW64/msvcr110.dll') then begin // TODO Copy file or ask to install package ? //CustomMessage('YouWillInstallDoliWamp')+#13#13 - MsgBox('The package vcredist_x64.exe or vcredist_86.exe must have been installed first. It seems it is not. Please install it first from http://www.microsoft.com/en-us/download/details.aspx?id=30679 then restart DoliWamp installation/upgrade.',mbInformation,MB_OK); + MsgBox('The package vcredist_x86.exe must have been installed first. It seems it is not. Please install it first from http://www.microsoft.com/en-us/download/details.aspx?id=30679 then restart DoliWamp installation/upgrade.',mbInformation,MB_OK); end; @@ -749,6 +749,7 @@ begin LoadStringFromFile (srcFile, srcContents); //version de apache et mysql + StringChangeEx (srcContents, 'WAMPROOT', pathWithSlashes, True); StringChangeEx (srcContents, 'WAMPMYSQLVERSION', mysqlVersion, True); StringChangeEx (srcContents, 'WAMPAPACHEVERSION', apacheVersion, True); @@ -757,27 +758,6 @@ begin - //---------------------------------------------- - // Create file install_services_auto.bat (always) - //---------------------------------------------- - - destFile := pathWithSlashes+'/install_services_auto.bat'; - srcFile := pathWithSlashes+'/install_services_auto.bat.install'; - - if FileExists (srcFile) then - begin - LoadStringFromFile (srcFile, srcContents); - - //version de apache et mysql - StringChangeEx (srcContents, 'WAMPMYSQLVERSION', mysqlVersion, True); - StringChangeEx (srcContents, 'WAMPAPACHEVERSION', apacheVersion, True); - - SaveStringToFile(destFile,srcContents, False); - end - - - - //---------------------------------------------- // Create file uninstall_services.bat (always) //---------------------------------------------- @@ -790,6 +770,7 @@ begin LoadStringFromFile (srcFile, srcContents); //version de apache et mysql + StringChangeEx (srcContents, 'WAMPROOT', pathWithSlashes, True); StringChangeEx (srcContents, 'WAMPMYSQLVERSION', mysqlVersion, True); StringChangeEx (srcContents, 'WAMPAPACHEVERSION', apacheVersion, True); @@ -978,7 +959,6 @@ end; procedure DeinitializeSetup(); begin // DeleteFile(path+'\install_services.bat'); -// DeleteFile(path+'\install_services_auto.bat'); end; diff --git a/build/exe/doliwamp/httpd.conf.install b/build/exe/doliwamp/httpd.conf.install index bfe17b07d42..6519fdd7795 100644 --- a/build/exe/doliwamp/httpd.conf.install +++ b/build/exe/doliwamp/httpd.conf.install @@ -66,19 +66,24 @@ Listen WAMPAPACHEPORT # LoadModule actions_module modules/mod_actions.so LoadModule alias_module modules/mod_alias.so +LoadModule allowmethods_module modules/mod_allowmethods.so LoadModule asis_module modules/mod_asis.so LoadModule auth_basic_module modules/mod_auth_basic.so #LoadModule auth_digest_module modules/mod_auth_digest.so #LoadModule authn_anon_module modules/mod_authn_anon.so #LoadModule authn_dbm_module modules/mod_authn_dbm.so -LoadModule authn_default_module modules/mod_authn_default.so +#LoadModule authn_default_module modules/mod_authn_default.so LoadModule authn_file_module modules/mod_authn_file.so +LoadModule authz_core_module modules/mod_authz_core.so #LoadModule authz_dbm_module modules/mod_authz_dbm.so -LoadModule authz_default_module modules/mod_authz_default.so +#LoadModule authz_default_module modules/mod_authz_default.so LoadModule authz_groupfile_module modules/mod_authz_groupfile.so LoadModule authz_host_module modules/mod_authz_host.so LoadModule authz_user_module modules/mod_authz_user.so LoadModule autoindex_module modules/mod_autoindex.so +LoadModule buffer_module modules/mod_buffer.so +LoadModule cache_module modules/mod_cache.so +LoadModule cache_disk_module modules/mod_cache_disk.so #LoadModule cern_meta_module modules/mod_cern_meta.so LoadModule cgi_module modules/mod_cgi.so #LoadModule dav_module modules/mod_dav.so @@ -96,23 +101,23 @@ LoadModule isapi_module modules/mod_isapi.so LoadModule log_config_module modules/mod_log_config.so LoadModule mime_module modules/mod_mime.so #LoadModule mime_magic_module modules/mod_mime_magic.so +LoadModule negotiation_module modules/mod_negotiation.so #LoadModule proxy_module modules/mod_proxy.so #LoadModule proxy_ajp_module modules/mod_proxy_ajp.so #LoadModule proxy_balancer_module modules/mod_proxy_balancer.so #LoadModule proxy_connect_module modules/mod_proxy_connect.so #LoadModule proxy_http_module modules/mod_proxy_http.so #LoadModule proxy_ftp_module modules/mod_proxy_ftp.so -LoadModule negotiation_module modules/mod_negotiation.so LoadModule rewrite_module modules/mod_rewrite.so LoadModule setenvif_module modules/mod_setenvif.so #LoadModule speling_module modules/mod_speling.so +#LoadModule ssl_module modules/mod_ssl.so LoadModule status_module modules/mod_status.so #LoadModule unique_id_module modules/mod_unique_id.so LoadModule userdir_module modules/mod_userdir.so #LoadModule usertrack_module modules/mod_usertrack.so LoadModule vhost_alias_module modules/mod_vhost_alias.so -#LoadModule ssl_module modules/mod_ssl.so -LoadModule php5_module "WAMPROOT/bin/php/phpWAMPPHPVERSION/php5apache2_2.dll" +LoadModule php5_module "WAMPROOT/bin/php/phpWAMPPHPVERSION/php5apache2_4.dll" # # ExtendedStatus controls whether Apache will generate "full" status @@ -123,9 +128,9 @@ ExtendedStatus On SetHandler server-status -Order Deny,Allow -Deny from all -Allow from localhost, 127.0.0.1 +Require local +#Require ip 1.2.3.4 +#Require host 1.2.3.4 @@ -211,9 +216,7 @@ KeepAliveTimeout 30 Options FollowSymLinks AllowOverride None - Order deny,allow - Deny from all - Satisfy all + Require all denied # @@ -253,9 +256,10 @@ KeepAliveTimeout 30 # Controls who can get stuff from this server. # # onlineoffline tag - don't remove - Order Deny,Allow - Deny from all - Allow from 127.0.0.1 + + Require ip 127.0.0.1 + Require host localhost + @@ -272,8 +276,7 @@ KeepAliveTimeout 30 # viewed by Web clients. # - Order allow,deny - Deny from all + Require all denied # @@ -359,8 +362,7 @@ LogLevel warn AllowOverride None Options None - Order allow,deny - Allow from all + Require all granted # diff --git a/build/exe/doliwamp/install_services.bat.install b/build/exe/doliwamp/install_services.bat.install index 991e6f040aa..536a984e26d 100644 --- a/build/exe/doliwamp/install_services.bat.install +++ b/build/exe/doliwamp/install_services.bat.install @@ -8,14 +8,18 @@ echo ---- Execute install_services.bat >> doliwamp.log 2>>&1 REM NET STOP doliwampapache REM NET STOP doliwampmysqld +cd "WAMPROOT" + REM Apache x.x .\bin\apache\apacheWAMPAPACHEVERSION\bin\httpd.exe -k install -n doliwampapache REM reg add HKLM\SYSTEM\CurrentControlSet\Services\doliwampapache /V Start /t REG_DWORD /d 3 /f REM Mysql 5.0- REM .\bin\mysql\mysqlWAMPMYSQLVERSION\bin\mysqld-nt.exe --install-manual doliwampmysqld -.\bin\mysql\mysqlWAMPMYSQLVERSION\bin\mysqld-nt.exe --install doliwampmysqld +REM .\bin\mysql\mysqlWAMPMYSQLVERSION\bin\mysqld-nt.exe --install doliwampmysqld REM Mysql 5.1+ -REM .\bin\mysql\mysqlWAMPMYSQLVERSION\bin\mysqld.exe --install doliwampmysqld +.\bin\mysql\mysqlWAMPMYSQLVERSION\bin\mysqld.exe --install doliwampmysqld echo ---- End script >> doliwamp.log 2>>&1 + +REM pause diff --git a/build/exe/doliwamp/phpmyadmin.conf.install b/build/exe/doliwamp/phpmyadmin.conf.install index ff7045835fa..533a5289433 100644 --- a/build/exe/doliwamp/phpmyadmin.conf.install +++ b/build/exe/doliwamp/phpmyadmin.conf.install @@ -1,22 +1,35 @@ Alias /phpmyadmin "WAMPROOT/apps/phpmyadminWAMPPHPMYADMINVERSION/" -# to give access to phpmyadmin from outside -# replace the lines +# NOTE FOR APACHE 2.2: +# To grant access to dolibarr from outside set lines # -# Order Deny,Allow +# Order Allow,Deny +# Allow from all +# +# instead of +# +# Order Deny,Allow # Deny from all # Allow from 127.0.0.1 # -# by +# NOTE FOR APACHE 2.3: +# To grant access to dolibarr from outside set lines # -# Order Allow,Deny -# Allow from all +# Require all granted +# +# instead of +# +# +# Require ip 127.0.0.1 +# Require host localhost +# # Options Indexes FollowSymLinks MultiViews AllowOverride all - Order Deny,Allow - Deny from all - Allow from 127.0.0.1 + + Require ip 127.0.0.1 + Require host localhost + \ No newline at end of file diff --git a/build/exe/doliwamp/uninstall_services.bat.install b/build/exe/doliwamp/uninstall_services.bat.install index 52b166c19d4..b8aa5027b01 100644 --- a/build/exe/doliwamp/uninstall_services.bat.install +++ b/build/exe/doliwamp/uninstall_services.bat.install @@ -3,10 +3,19 @@ REM -------------------------------------------------------- REM This script install Apache and Mysql DoliWamp services REM -------------------------------------------------------- +cd "WAMPROOT" + echo ---- Execute uninstall_services.bat >> doliwamp.log 2>>&1 NET STOP doliwampapache .\bin\apache\apacheWAMPAPACHEVERSION\bin\httpd.exe -k uninstall -n doliwampapache + NET STOP doliwampmysqld -.\bin\mysql\mysqlWAMPMYSQLVERSION\bin\mysqld-nt.exe --remove doliwampmysqld +REM Mysql 5.0- +REM .\bin\mysql\mysqlWAMPMYSQLVERSION\bin\mysqld-nt.exe --remove doliwampmysqld +REM Mysql 5.1+ +.\bin\mysql\mysqlWAMPMYSQLVERSION\bin\mysqld.exe --remove doliwampmysqld + REM wampmanager.exe -quit -id={doliwampserver} echo ---- End script >> doliwamp.log 2>>&1 + +REM pause diff --git a/dev/security/htaccess.txt b/dev/security/htaccess.txt index 7d3aaf1a903..a8364c85a0f 100644 --- a/dev/security/htaccess.txt +++ b/dev/security/htaccess.txt @@ -1,2 +1 @@ -Order allow,deny -Deny from all \ No newline at end of file +Require all granted From f3eb564d5f6b79a059299f361d412dd76ba6b0f7 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 3 Jul 2016 15:24:01 +0200 Subject: [PATCH 10/19] Some fix for mysql5.6.17 --- build/exe/doliwamp/doliwamp.iss | 2 +- build/exe/doliwamp/httpd.conf.install | 3 +- build/exe/doliwamp/my.ini.install | 60 ------------------- build/exe/doliwamp/startdoliwamp.bat | 6 +- .../startdoliwamp_manual_donotuse.bat.install | 3 +- build/exe/doliwamp/stopdoliwamp.bat | 4 +- 6 files changed, 11 insertions(+), 67 deletions(-) diff --git a/build/exe/doliwamp/doliwamp.iss b/build/exe/doliwamp/doliwamp.iss index 3aaf113e679..cc5235b58c2 100644 --- a/build/exe/doliwamp/doliwamp.iss +++ b/build/exe/doliwamp/doliwamp.iss @@ -675,7 +675,7 @@ begin //installDir et version de php StringChangeEx (srcContents, 'WAMPROOT', pathWithSlashes, True); StringChangeEx (srcContents, 'WAMPMYSQLPORT', myport, True); - StringChangeEx (srcContents, 'WAMPMYSQLVERSION', myport, True); + StringChangeEx (srcContents, 'WAMPMYSQLVERSION', mysqlVersion, True); SaveStringToFile(destFile,srcContents, False); end diff --git a/build/exe/doliwamp/httpd.conf.install b/build/exe/doliwamp/httpd.conf.install index 6519fdd7795..96bf688b1d5 100644 --- a/build/exe/doliwamp/httpd.conf.install +++ b/build/exe/doliwamp/httpd.conf.install @@ -72,7 +72,6 @@ LoadModule auth_basic_module modules/mod_auth_basic.so #LoadModule auth_digest_module modules/mod_auth_digest.so #LoadModule authn_anon_module modules/mod_authn_anon.so #LoadModule authn_dbm_module modules/mod_authn_dbm.so -#LoadModule authn_default_module modules/mod_authn_default.so LoadModule authn_file_module modules/mod_authn_file.so LoadModule authz_core_module modules/mod_authz_core.so #LoadModule authz_dbm_module modules/mod_authz_dbm.so @@ -412,7 +411,7 @@ LogLevel warn # keep browsers from trying to display binary files as though they are # text. # -DefaultType text/plain +#DefaultType text/plain # diff --git a/build/exe/doliwamp/my.ini.install b/build/exe/doliwamp/my.ini.install index c855cc27a66..885660f648b 100644 --- a/build/exe/doliwamp/my.ini.install +++ b/build/exe/doliwamp/my.ini.install @@ -77,10 +77,6 @@ log-error=WAMPROOT/logs/mysql.log #Path to the database root datadir=WAMPROOT/bin/mysql/data -# The default character set that will be used when a new schema or table is -# created and no character set is defined -default-character-set=latin1 - # The default storage engine that will be used when create new tables when default-storage-engine=INNODB @@ -101,13 +97,6 @@ max_connections=255 # slowdown instead of a performance improvement. query_cache_size=8M -# The number of open tables for all threads. Increasing this value -# increases the number of file descriptors that mysqld requires. -# Therefore you have to make sure to set the amount of open files -# allowed to at least 4096 in the variable "open-files-limit" in -# section [mysqld_safe] -table_cache=510 - # Maximum size for internal (in-memory) temporary tables. If a table # grows larger than this value, it is automatically converted to disk # based table This limitation is for a single table. There can be many @@ -125,18 +114,6 @@ thread_cache_size=12 #*** MyISAM Specific options -# The maximum size of the temporary file MySQL is allowed to use while -# recreating the index (during REPAIR, ALTER TABLE or LOAD DATA INFILE. -# If the file-size would be bigger than this, the index will be created -# through the key cache (which is slower). -myisam_max_sort_file_size=100G - -# If the temporary file used for fast index creation would be bigger -# than using the key cache by the amount specified here, then prefer the -# key cache method. This is mainly used to force long character keys in -# large tables to use the slower key cache method to create the index. -myisam_max_extra_sort_file_size=100G - # If the temporary file used for fast index creation would be bigger # than using the key cache by the amount specified here, then prefer the # key cache method. This is mainly used to force long character keys in @@ -170,13 +147,6 @@ sort_buffer_size=203K # and speed up some things. #skip-innodb -# Additional memory pool that is used by InnoDB to store metadata -# information. If InnoDB requires more memory for this purpose it will -# start to allocate it from the OS. As this is fast enough on most -# recent operating systems, you normally do not need to change this -# value. SHOW INNODB STATUS will display the current amount used. -innodb_additional_mem_pool_size=2M - # If set to 1, InnoDB will flush (fsync) the transaction logs to the # disk at each commit, which offers full ACID behavior. If you are # willing to compromise this safety, and you are running small @@ -234,10 +204,6 @@ log-error=WAMPROOT/logs/mysql.log #Path to the database root datadir=WAMPROOT/bin/mysql/data -# The default character set that will be used when a new schema or table is -# created and no character set is defined -default-character-set=latin1 - # The default storage engine that will be used when create new tables when default-storage-engine=INNODB @@ -258,13 +224,6 @@ max_connections=255 # slowdown instead of a performance improvement. query_cache_size=8M -# The number of open tables for all threads. Increasing this value -# increases the number of file descriptors that mysqld requires. -# Therefore you have to make sure to set the amount of open files -# allowed to at least 4096 in the variable "open-files-limit" in -# section [mysqld_safe] -table_cache=510 - # Maximum size for internal (in-memory) temporary tables. If a table # grows larger than this value, it is automatically converted to disk # based table This limitation is for a single table. There can be many @@ -282,18 +241,6 @@ thread_cache_size=12 #*** MyISAM Specific options -# The maximum size of the temporary file MySQL is allowed to use while -# recreating the index (during REPAIR, ALTER TABLE or LOAD DATA INFILE. -# If the file-size would be bigger than this, the index will be created -# through the key cache (which is slower). -myisam_max_sort_file_size=100G - -# If the temporary file used for fast index creation would be bigger -# than using the key cache by the amount specified here, then prefer the -# key cache method. This is mainly used to force long character keys in -# large tables to use the slower key cache method to create the index. -myisam_max_extra_sort_file_size=100G - # If the temporary file used for fast index creation would be bigger # than using the key cache by the amount specified here, then prefer the # key cache method. This is mainly used to force long character keys in @@ -327,13 +274,6 @@ sort_buffer_size=203K # and speed up some things. #skip-innodb -# Additional memory pool that is used by InnoDB to store metadata -# information. If InnoDB requires more memory for this purpose it will -# start to allocate it from the OS. As this is fast enough on most -# recent operating systems, you normally do not need to change this -# value. SHOW INNODB STATUS will display the current amount used. -innodb_additional_mem_pool_size=2M - # If set to 1, InnoDB will flush (fsync) the transaction logs to the # disk at each commit, which offers full ACID behavior. If you are # willing to compromise this safety, and you are running small diff --git a/build/exe/doliwamp/startdoliwamp.bat b/build/exe/doliwamp/startdoliwamp.bat index d6842c56010..6e1d6f2641d 100644 --- a/build/exe/doliwamp/startdoliwamp.bat +++ b/build/exe/doliwamp/startdoliwamp.bat @@ -10,9 +10,11 @@ NET START doliwampapache >> doliwamp.log 2>>&1 echo NET START doliwampmysqld >> doliwamp.log 2>>&1 NET START doliwampmysqld >> doliwamp.log 2>>&1 +REM You can also check logs into c:/dolibarr/logs if start fails + echo Please wait... echo ---- End script >> doliwamp.log 2>>&1 REM sleep is not a Windows commande -REM sleep 1 -ping 1.1.1.1 -n 1 -w 1000 > nul \ No newline at end of file +REM sleep 2 +ping 127.0.0.1 -n 2 -w 1000 > nul diff --git a/build/exe/doliwamp/startdoliwamp_manual_donotuse.bat.install b/build/exe/doliwamp/startdoliwamp_manual_donotuse.bat.install index 751302c0633..540f8bc9fbc 100644 --- a/build/exe/doliwamp/startdoliwamp_manual_donotuse.bat.install +++ b/build/exe/doliwamp/startdoliwamp_manual_donotuse.bat.install @@ -12,6 +12,7 @@ start WAMPROOT\bin\apache\apacheWAMPAPACHEVERSION\bin\httpd.exe -f conf\httpd.co echo echo Running Mysql as user process (this process does not return so we use "start") -start WAMPROOT\bin\mysql\mysqlWAMPMYSQLVERSION\bin\mysqld-nt.exe --defaults-file=WAMPROOT\bin\mysql\mysqlWAMPMYSQLVERSION\my.ini --console +REM start WAMPROOT\bin\mysql\mysqlWAMPMYSQLVERSION\bin\mysqld-nt.exe --defaults-file=WAMPROOT\bin\mysql\mysqlWAMPMYSQLVERSION\my.ini --console +start WAMPROOT\bin\mysql\mysqlWAMPMYSQLVERSION\bin\mysqld.exe --defaults-file=WAMPROOT\bin\mysql\mysqlWAMPMYSQLVERSION\my.ini --console pause \ No newline at end of file diff --git a/build/exe/doliwamp/stopdoliwamp.bat b/build/exe/doliwamp/stopdoliwamp.bat index e4d2ce07c29..e7f8caefb77 100644 --- a/build/exe/doliwamp/stopdoliwamp.bat +++ b/build/exe/doliwamp/stopdoliwamp.bat @@ -15,4 +15,6 @@ echo ---- End script >> doliwamp.log 2>>&1 REM sleep is not a Windows command REM sleep 1 -ping 1.1.1.1 -n 1 -w 1000 > nul \ No newline at end of file +ping 1.1.1.1 -n 1 -w 1000 > nul + +REM pause From bad758f2483b8076183b9396bc0f0ed04e6b6b31 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 3 Jul 2016 19:10:52 +0200 Subject: [PATCH 11/19] Fix syntax error --- build/exe/doliwamp/phpmyadmin.conf.install | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/exe/doliwamp/phpmyadmin.conf.install b/build/exe/doliwamp/phpmyadmin.conf.install index 533a5289433..7c0c2f8141c 100644 --- a/build/exe/doliwamp/phpmyadmin.conf.install +++ b/build/exe/doliwamp/phpmyadmin.conf.install @@ -31,5 +31,5 @@ Alias /phpmyadmin "WAMPROOT/apps/phpmyadminWAMPPHPMYADMINVERSION/" Require ip 127.0.0.1 Require host localhost - + \ No newline at end of file From de157d90990513c571dc36c7ea81560db0737edc Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 3 Jul 2016 20:15:26 +0200 Subject: [PATCH 12/19] Fix quick search on tasks --- htdocs/core/ajax/selectsearchbox.php | 8 ++++++-- htdocs/langs/en_US/main.lang | 1 + htdocs/projet/tasks/list.php | 6 +++++- 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/htdocs/core/ajax/selectsearchbox.php b/htdocs/core/ajax/selectsearchbox.php index 416975acfdb..161ed89f4e8 100644 --- a/htdocs/core/ajax/selectsearchbox.php +++ b/htdocs/core/ajax/selectsearchbox.php @@ -1,5 +1,5 @@ +/* Copyright (C) 2015-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 @@ -62,13 +62,17 @@ if (! empty($conf->projet->enabled) && empty($conf->global->MAIN_SEARCHFORM_PROJ { $arrayresult['searchintoprojects']=array('text'=>img_picto('','object_projectpub').' '.$langs->trans("SearchIntoProjects", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/projet/list.php?search_all='.urlencode($search_boxvalue)); } +if (! empty($conf->projet->enabled) && empty($conf->global->MAIN_SEARCHFORM_TASK_DISABLED) && $user->rights->projet->lire) +{ + $arrayresult['searchintotasks']=array('text'=>img_picto('','object_task').' '.$langs->trans("SearchIntoTasks", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/projet/tasks/list.php?search_all='.urlencode($search_boxvalue)); +} if (! empty($conf->adherent->enabled) && empty($conf->global->MAIN_SEARCHFORM_ADHERENT_DISABLED) && $user->rights->adherent->lire) { $arrayresult['searchintomember']=array('text'=>img_picto('','object_user').' '.$langs->trans("SearchIntoMembers", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/adherents/list.php?sall='.urlencode($search_boxvalue)); } -if (! empty($conf->user->enabled) && empty($conf->global->MAIN_SEARCHFORM_PROJECT_DISABLED) && $user->rights->user->user->lire) +if (! empty($conf->user->enabled) && empty($conf->global->MAIN_SEARCHFORM_USER_DISABLED) && $user->rights->user->user->lire) { $arrayresult['searchintouser']=array('text'=>img_picto('','object_user').' '.$langs->trans("SearchIntoUsers", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/user/index.php?sall='.urlencode($search_boxvalue)); } diff --git a/htdocs/langs/en_US/main.lang b/htdocs/langs/en_US/main.lang index 329277b9796..b90d02f8f77 100644 --- a/htdocs/langs/en_US/main.lang +++ b/htdocs/langs/en_US/main.lang @@ -744,6 +744,7 @@ SearchIntoMembers=Members SearchIntoUsers=Users SearchIntoProductsOrServices=Products or services SearchIntoProjects=Projects +SearchIntoTasks=Tasks SearchIntoCustomerInvoices=Customer invoices SearchIntoSupplierInvoices=Supplier invoices SearchIntoCustomerOrders=Customer orders diff --git a/htdocs/projet/tasks/list.php b/htdocs/projet/tasks/list.php index 52e01d445a8..cbef511bae7 100644 --- a/htdocs/projet/tasks/list.php +++ b/htdocs/projet/tasks/list.php @@ -38,7 +38,11 @@ $id=GETPOST('id','int'); $search_all=GETPOST('search_all'); $search_project=GETPOST('search_project'); -if (! isset($_GET['search_projectstatus']) && ! isset($_POST['search_projectstatus'])) $search_projectstatus=1; +if (! isset($_GET['search_projectstatus']) && ! isset($_POST['search_projectstatus'])) +{ + if ($search_all != '') $search_projectstatus=-1; + else $search_projectstatus=1; +} else $search_projectstatus=GETPOST('search_projectstatus'); $search_project_ref=GETPOST('search_project_ref'); $search_project_title=GETPOST('search_project_title'); From 9992704398545f57339d217c81d1ec0c38414d5b Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 3 Jul 2016 20:50:28 +0200 Subject: [PATCH 13/19] Fix: viewimage must not check login for resources medias --- htdocs/viewimage.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/viewimage.php b/htdocs/viewimage.php index 585db4c343e..b6d33de99ae 100644 --- a/htdocs/viewimage.php +++ b/htdocs/viewimage.php @@ -34,8 +34,9 @@ if (! defined('NOREQUIREMENU')) define('NOREQUIREMENU','1'); if (! defined('NOREQUIREHTML')) define('NOREQUIREHTML','1'); if (! defined('NOREQUIREAJAX')) define('NOREQUIREAJAX','1'); if (! defined('NOREQUIREHOOK')) define('NOREQUIREHOOK','1'); // Disable "main.inc.php" hooks -// Pour autre que companylogo, on charge environnement + info issus de logon comme le user +// Some value of modulepart can be used to get resources that are public so no login are required. if ((isset($_GET["modulepart"]) && $_GET["modulepart"] == 'companylogo') && ! defined("NOLOGIN")) define("NOLOGIN",'1'); +if ((isset($_GET["modulepart"]) && $_GET["modulepart"] == 'medias') && ! defined("NOLOGIN")) define("NOLOGIN",'1'); /** * Header empty From 0649c41bbfb0a8b94072bdc5011e504c76305c1f Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 3 Jul 2016 21:06:02 +0200 Subject: [PATCH 14/19] Fix: list of fields used for quick search was not visible on expense reports --- htdocs/core/ajax/selectsearchbox.php | 4 +- htdocs/expensereport/list.php | 71 +++++++++++++++++++++------- 2 files changed, 55 insertions(+), 20 deletions(-) diff --git a/htdocs/core/ajax/selectsearchbox.php b/htdocs/core/ajax/selectsearchbox.php index 161ed89f4e8..f9200810bdd 100644 --- a/htdocs/core/ajax/selectsearchbox.php +++ b/htdocs/core/ajax/selectsearchbox.php @@ -118,11 +118,11 @@ if (! empty($conf->ficheinter->enabled) && empty($conf->global->MAIN_SEARCHFORM_ // HR if (! empty($conf->expensereport->enabled) && empty($conf->global->MAIN_SEARCHFORM_EXPENSEREPORT_DISABLED) && $user->rights->expensereport->lire) { - $arrayresult['searchintoexpensereport']=array('text'=>img_picto('','object_trip').' '.$langs->trans("SearchIntoExpenseReports", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/expensereport/list.php?sall='.urlencode($search_boxvalue)); + $arrayresult['searchintoexpensereport']=array('text'=>img_picto('','object_trip').' '.$langs->trans("SearchIntoExpenseReports", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/expensereport/list.php?mainmenu=hrm&sall='.urlencode($search_boxvalue)); } if (! empty($conf->holiday->enabled) && empty($conf->global->MAIN_SEARCHFORM_HOLIDAY_DISABLED) && $user->rights->holiday->read) { - $arrayresult['searchintoleaves']=array('text'=>img_picto('','object_holiday').' '.$langs->trans("SearchIntoLeaves", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/holiday/list.php?sall='.urlencode($search_boxvalue)); + $arrayresult['searchintoleaves']=array('text'=>img_picto('','object_holiday').' '.$langs->trans("SearchIntoLeaves", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/holiday/list.php?mainmenu=hrm&sall='.urlencode($search_boxvalue)); } diff --git a/htdocs/expensereport/list.php b/htdocs/expensereport/list.php index d269757af7e..e09a74e20f3 100644 --- a/htdocs/expensereport/list.php +++ b/htdocs/expensereport/list.php @@ -1,6 +1,6 @@ - * Copyright (C) 2004-2015 Laurent Destailleur + * Copyright (C) 2004-2016 Laurent Destailleur * Copyright (C) 2004 Eric Seigne * Copyright (C) 2005-2009 Regis Houssin * Copyright (C) 2015 Alexandre Spangaro @@ -51,22 +51,21 @@ $month_end = GETPOST("month_end","int"); $year_end = GETPOST("year_end","int"); $optioncss = GETPOST('optioncss','alpha'); -if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter")) // Both test must be present to be compatible with all browsers -{ - $search_ref=""; - $search_user=""; - $search_amount_ht=""; - $search_amount_ttc=""; - $search_status=""; - $month_start=""; - $year_start=""; - $month_end=""; - $year_end=""; -} - if ($search_status == '') $search_status=-1; if ($search_user == '') $search_user=-1; +// Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array +$contextpage='expensereportlist'; + +// Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array +$hookmanager->initHooks(array('expensereportlist')); +$extrafields = new ExtraFields($db); + +// fetch optionals attributes and labels +$extralabels = $extrafields->fetch_name_optionals_label('expensereport'); +$search_array_options=$extrafields->getOptionalsFromPost($extralabels,'','search_'); + + // List of fields to search into when doing a "search in all" $fieldstosearchall = array( 'd.ref'=>'Ref', @@ -75,6 +74,33 @@ $fieldstosearchall = array( ); + +/* + * Actions + */ + +$parameters=array('socid'=>$socid); +$reshook=$hookmanager->executeHooks('doActions',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks +if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); + +include DOL_DOCUMENT_ROOT.'/core/actions_changeselectedfields.inc.php'; + +if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter.x") || GETPOST("button_removefilter")) // Both test must be present to be compatible with all browsers +{ + $search_ref=""; + $search_user=""; + $search_amount_ht=""; + $search_amount_ttc=""; + $search_status=""; + $month_start=""; + $year_start=""; + $month_end=""; + $year_end=""; + $search_array_options=array(); +} + + + /* * View */ @@ -108,7 +134,6 @@ $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"; $sql.= " WHERE d.entity = ".$conf->entity; - // Search all if (!empty($sall)) { @@ -192,13 +217,22 @@ 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; if ($search_ref) $param.="&search_ref=".$search_ref; if ($search_user) $param.="&search_user=".$search_user; if ($search_amount_ht) $param.="&search_amount_ht=".$search_amount_ht; if ($search_amount_ttc) $param.="&search_amount_ttc=".$search_amount_ttc; if ($search_status >= 0) $param.="&search_status=".$search_status; - if ($optioncss != '') $param.='&optioncss='.$optioncss; - + if ($optioncss != '') $param.='&optioncss='.$optioncss; + // 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_barre_liste($langs->trans("ListTripsAndExpenses"), $page, $_SERVER["PHP_SELF"],$param,$sortfield,$sortorder,'',$num,$nbtotalofrecords); print '
'."\n"; if ($optioncss != '') print ''; @@ -210,8 +244,9 @@ if ($resql) if ($sall) { foreach($fieldstosearchall as $key => $val) $fieldstosearchall[$key]=$langs->trans($val); + print $langs->trans("FilterOnInto", $sall) . join(', ',$fieldstosearchall); } - + print ''; print ""; print_liste_field_titre($langs->trans("Ref"),$_SERVER["PHP_SELF"],"d.rowid","",$param,'',$sortfield,$sortorder); From c24d68a0382381b8599d96f5904e449dec660c66 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 3 Jul 2016 21:06:02 +0200 Subject: [PATCH 15/19] Picto for expense report --- htdocs/core/ajax/selectsearchbox.php | 4 +- htdocs/expensereport/list.php | 71 +++++++++++++++++++------- htdocs/theme/eldy/img/object_trip.png | Bin 337 -> 369 bytes 3 files changed, 55 insertions(+), 20 deletions(-) diff --git a/htdocs/core/ajax/selectsearchbox.php b/htdocs/core/ajax/selectsearchbox.php index 161ed89f4e8..f9200810bdd 100644 --- a/htdocs/core/ajax/selectsearchbox.php +++ b/htdocs/core/ajax/selectsearchbox.php @@ -118,11 +118,11 @@ if (! empty($conf->ficheinter->enabled) && empty($conf->global->MAIN_SEARCHFORM_ // HR if (! empty($conf->expensereport->enabled) && empty($conf->global->MAIN_SEARCHFORM_EXPENSEREPORT_DISABLED) && $user->rights->expensereport->lire) { - $arrayresult['searchintoexpensereport']=array('text'=>img_picto('','object_trip').' '.$langs->trans("SearchIntoExpenseReports", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/expensereport/list.php?sall='.urlencode($search_boxvalue)); + $arrayresult['searchintoexpensereport']=array('text'=>img_picto('','object_trip').' '.$langs->trans("SearchIntoExpenseReports", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/expensereport/list.php?mainmenu=hrm&sall='.urlencode($search_boxvalue)); } if (! empty($conf->holiday->enabled) && empty($conf->global->MAIN_SEARCHFORM_HOLIDAY_DISABLED) && $user->rights->holiday->read) { - $arrayresult['searchintoleaves']=array('text'=>img_picto('','object_holiday').' '.$langs->trans("SearchIntoLeaves", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/holiday/list.php?sall='.urlencode($search_boxvalue)); + $arrayresult['searchintoleaves']=array('text'=>img_picto('','object_holiday').' '.$langs->trans("SearchIntoLeaves", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/holiday/list.php?mainmenu=hrm&sall='.urlencode($search_boxvalue)); } diff --git a/htdocs/expensereport/list.php b/htdocs/expensereport/list.php index d269757af7e..e09a74e20f3 100644 --- a/htdocs/expensereport/list.php +++ b/htdocs/expensereport/list.php @@ -1,6 +1,6 @@ - * Copyright (C) 2004-2015 Laurent Destailleur + * Copyright (C) 2004-2016 Laurent Destailleur * Copyright (C) 2004 Eric Seigne * Copyright (C) 2005-2009 Regis Houssin * Copyright (C) 2015 Alexandre Spangaro @@ -51,22 +51,21 @@ $month_end = GETPOST("month_end","int"); $year_end = GETPOST("year_end","int"); $optioncss = GETPOST('optioncss','alpha'); -if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter")) // Both test must be present to be compatible with all browsers -{ - $search_ref=""; - $search_user=""; - $search_amount_ht=""; - $search_amount_ttc=""; - $search_status=""; - $month_start=""; - $year_start=""; - $month_end=""; - $year_end=""; -} - if ($search_status == '') $search_status=-1; if ($search_user == '') $search_user=-1; +// Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array +$contextpage='expensereportlist'; + +// Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array +$hookmanager->initHooks(array('expensereportlist')); +$extrafields = new ExtraFields($db); + +// fetch optionals attributes and labels +$extralabels = $extrafields->fetch_name_optionals_label('expensereport'); +$search_array_options=$extrafields->getOptionalsFromPost($extralabels,'','search_'); + + // List of fields to search into when doing a "search in all" $fieldstosearchall = array( 'd.ref'=>'Ref', @@ -75,6 +74,33 @@ $fieldstosearchall = array( ); + +/* + * Actions + */ + +$parameters=array('socid'=>$socid); +$reshook=$hookmanager->executeHooks('doActions',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks +if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); + +include DOL_DOCUMENT_ROOT.'/core/actions_changeselectedfields.inc.php'; + +if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter.x") || GETPOST("button_removefilter")) // Both test must be present to be compatible with all browsers +{ + $search_ref=""; + $search_user=""; + $search_amount_ht=""; + $search_amount_ttc=""; + $search_status=""; + $month_start=""; + $year_start=""; + $month_end=""; + $year_end=""; + $search_array_options=array(); +} + + + /* * View */ @@ -108,7 +134,6 @@ $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"; $sql.= " WHERE d.entity = ".$conf->entity; - // Search all if (!empty($sall)) { @@ -192,13 +217,22 @@ 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; if ($search_ref) $param.="&search_ref=".$search_ref; if ($search_user) $param.="&search_user=".$search_user; if ($search_amount_ht) $param.="&search_amount_ht=".$search_amount_ht; if ($search_amount_ttc) $param.="&search_amount_ttc=".$search_amount_ttc; if ($search_status >= 0) $param.="&search_status=".$search_status; - if ($optioncss != '') $param.='&optioncss='.$optioncss; - + if ($optioncss != '') $param.='&optioncss='.$optioncss; + // 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_barre_liste($langs->trans("ListTripsAndExpenses"), $page, $_SERVER["PHP_SELF"],$param,$sortfield,$sortorder,'',$num,$nbtotalofrecords); print ''."\n"; if ($optioncss != '') print ''; @@ -210,8 +244,9 @@ if ($resql) if ($sall) { foreach($fieldstosearchall as $key => $val) $fieldstosearchall[$key]=$langs->trans($val); + print $langs->trans("FilterOnInto", $sall) . join(', ',$fieldstosearchall); } - + print '
'; print ""; print_liste_field_titre($langs->trans("Ref"),$_SERVER["PHP_SELF"],"d.rowid","",$param,'',$sortfield,$sortorder); diff --git a/htdocs/theme/eldy/img/object_trip.png b/htdocs/theme/eldy/img/object_trip.png index 95cc4412111f7ec23f1295471416152743455e88..d911bd621ded42003fdbbe193de6cbb849193dc3 100644 GIT binary patch delta 334 zcmV-U0kQtk0`UTn7=H)@0000emfhn3004(jOjJeA# zy_|%`oP^%q-js}coRoW%jB~xEjLxNm=ib(ggmbN&jJ2hd=fs(ft4S8Hx79yC^uD zA|e+P3UucHj2i}=pXVGy7zONSQMYK gs_W*P$QIEF6*CII=e>kh3;+NC07*qoM6N<$g6H6;g#Z8m delta 301 zcmey!bdhO-L>LP*0|Ud`G=oP#O0UE z!N|bC6i8T^8e16{DQFuQ8W`y0_kIKFWH0gbb!ETG!Y3?jx%-n+&BSvO^(^U*zK#qG z8~eHcB(eh47zFr)xZ2vCnslTXBQV2S65e0m@r|%f(2{WuHCwI>)yS4j~zR9 z?%cU+*RDN({`~*{|28Vx4M4pDB|(0{KrS+1c%U3B36%5mba4!+xRv~apOI%rhPb#m zqrltE&%gM5tV;QHX4T^}?+=#juDVmt_TJcfd-jwJrl0A3*XLFrS#WXM-nGX}Iu9N- nIdbLb(e{V_8E5|IC;n&TS>nRJzTtr_&}arvS3j3^P6 Date: Mon, 4 Jul 2016 10:28:11 +0200 Subject: [PATCH 16/19] FIX link to check prof id was hardcoded instead of using dedicated function --- htdocs/admin/company.php | 17 ++++++++-- htdocs/societe/class/societe.class.php | 43 ++++++++++++++++---------- 2 files changed, 41 insertions(+), 19 deletions(-) diff --git a/htdocs/admin/company.php b/htdocs/admin/company.php index 46e83975498..4ebbd2096f9 100644 --- a/htdocs/admin/company.php +++ b/htdocs/admin/company.php @@ -823,7 +823,8 @@ else if (! empty($conf->global->MAIN_INFO_SIREN)) { print $conf->global->MAIN_INFO_SIREN; - if ($mysoc->country_code == 'FR') print '   '.$langs->trans("Check").''; + $s = $mysoc->id_prof_url(1,$mysoc); + if ($s) print ' - '.$s; } else { print ' '; } @@ -838,6 +839,8 @@ else if (! empty($conf->global->MAIN_INFO_SIRET)) { print $conf->global->MAIN_INFO_SIRET; + $s = $mysoc->id_prof_url(2,$mysoc); + if ($s) print ' - '.$s; } else { print ' '; } @@ -852,6 +855,8 @@ else if (! empty($conf->global->MAIN_INFO_APE)) { print $conf->global->MAIN_INFO_APE; + $s = $mysoc->id_prof_url(3,$mysoc); + if ($s) print ' - '.$s; } else { print ' '; } @@ -866,6 +871,8 @@ else if (! empty($conf->global->MAIN_INFO_RCS)) { print $conf->global->MAIN_INFO_RCS; + $s = $mysoc->id_prof_url(4,$mysoc); + if ($s) print ' - '.$s; } else { print ' '; } @@ -880,6 +887,8 @@ else if (! empty($conf->global->MAIN_INFO_PROFID5)) { print $conf->global->MAIN_INFO_PROFID5; + $s = $mysoc->id_prof_url(5,$mysoc); + if ($s) print ' - '.$s; } else { print ' '; } @@ -894,6 +903,8 @@ else if (! empty($conf->global->MAIN_INFO_PROFID6)) { print $conf->global->MAIN_INFO_PROFID6; + $s = $mysoc->id_prof_url(6,$mysoc); + if ($s) print ' - '.$s; } else { print ' '; } @@ -909,9 +920,9 @@ else $s=''; $s.=$conf->global->MAIN_INFO_TVAINTRA; $s.=''; - if (empty($conf->global->MAIN_DISABLEVATCHECK)) + if (empty($conf->global->MAIN_DISABLEVATCHECK) && $mysoc->isInEEC()) { - $s.='   '; + $s.=' - '; if (! empty($conf->use_javascript_ajax)) { print "\n"; diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php index 2dc50975abe..acc4dc75102 100644 --- a/htdocs/societe/class/societe.class.php +++ b/htdocs/societe/class/societe.class.php @@ -2608,7 +2608,7 @@ class Societe extends CommonObject * @param int $idprof 1,2,3,4 (Exemple: 1=siren,2=siret,3=naf,4=rcs/rm) * @param Societe $soc Objet societe * @return int <=0 if KO, >0 if OK - * TODO not in business class + * TODO better to have this in a lib than into a business class */ function id_prof_check($idprof,$soc) { @@ -2720,27 +2720,38 @@ class Societe extends CommonObject } /** - * Renvoi url de verification d'un identifiant professionnal + * Return an url to check online a professional id or empty string * - * @param int $idprof 1,2,3,4 (Exemple: 1=siren,2=siret,3=naf,4=rcs/rm) - * @param Societe $soc Objet societe - * @return string url ou chaine vide si aucune url connue - * TODO not in business class + * @param int $idprof 1,2,3,4 (Example: 1=siren,2=siret,3=naf,4=rcs/rm) + * @param Societe $thirdparty Object thirdparty + * @return string Url or empty string if no URL known + * TODO better in a lib than into business class */ - function id_prof_url($idprof,$soc) + function id_prof_url($idprof,$thirdparty) { - global $conf,$langs; - - if (! empty($conf->global->MAIN_DISABLEPROFIDRULES)) return ''; + global $conf,$langs,$hookmanager; $url=''; + + $hookmanager->initHooks(array('idprofurl')); + $parameters=array('idprof'=>$idprof, 'company'=>$thirdparty); + $reshook=$hookmanager->executeHooks('getIdProfUrl',$parameters,$this,$action); // Note that $action and $object may have been modified by some hooks + if (empty($reshook)) + { + if (! empty($conf->global->MAIN_DISABLEPROFIDRULES)) return ''; - if ($idprof == 1 && $soc->country_code == 'FR') $url='http://www.societe.com/cgi-bin/recherche?rncs='.$soc->idprof1; - if ($idprof == 1 && ($soc->country_code == 'GB' || $soc->country_code == 'UK')) $url='http://www.companieshouse.gov.uk/WebCHeck/findinfolink/'; - if ($idprof == 1 && $soc->country_code == 'ES') $url='http://www.e-informa.es/servlet/app/portal/ENTP/screen/SProducto/prod/ETIQUETA_EMPRESA/nif/'.$soc->idprof1; - if ($idprof == 1 && $soc->country_code == 'IN') $url='http://www.tinxsys.com/TinxsysInternetWeb/dealerControllerServlet?tinNumber='.$soc->idprof1.';&searchBy=TIN&backPage=searchByTin_Inter.jsp'; - - if ($url) return '['.$langs->trans("Check").']'; + if ($idprof == 1 && $thirdparty->country_code == 'FR') $url='http://www.societe.com/cgi-bin/search?champs='.$thirdparty->idprof1; // See also http://avis-situation-sirene.insee.fr/ + if ($idprof == 1 && ($thirdparty->country_code == 'GB' || $thirdparty->country_code == 'UK')) $url='http://www.companieshouse.gov.uk/WebCHeck/findinfolink/'; + if ($idprof == 1 && $thirdparty->country_code == 'ES') $url='http://www.e-informa.es/servlet/app/portal/ENTP/screen/SProducto/prod/ETIQUETA_EMPRESA/nif/'.$thirdparty->idprof1; + if ($idprof == 1 && $thirdparty->country_code == 'IN') $url='http://www.tinxsys.com/TinxsysInternetWeb/dealerControllerServlet?tinNumber='.$thirdparty->idprof1.';&searchBy=TIN&backPage=searchByTin_Inter.jsp'; + + if ($url) return ''.$langs->trans("Check").''; + } + else + { + return $hookmanager->resPrint; + } + return ''; } From b4c8822281adfaa9c3499160abdbce46381ccee1 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 5 Jul 2016 16:27:14 +0200 Subject: [PATCH 17/19] Fix style of text after ref on invoices --- htdocs/compta/facture.php | 6 +++--- htdocs/core/class/html.form.class.php | 11 +++++++---- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/htdocs/compta/facture.php b/htdocs/compta/facture.php index 14f3ea7075f..9b2d39c4487 100644 --- a/htdocs/compta/facture.php +++ b/htdocs/compta/facture.php @@ -2930,16 +2930,16 @@ else if ($id > 0 || ! empty($ref)) // Ref print ''; print ''; // Ref customer diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index d4267eccfb1..507f45a12f8 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -5582,10 +5582,11 @@ class Form * @param string $moreparam More param to add in nav link url. * @param int $nodbprefix Do not include DB prefix to forge table name * @param string $morehtmlleft More html code to show before ref - * @param string $morehtmlright More html code to show before navigation arrows + * @param string $morehtmlstatus More html code to show under navigation arrows (status place) + * @param string $morehtmlright More html code to show after ref * @return string Portion HTML avec ref + boutons nav */ - function showrefnav($object,$paramid,$morehtml='',$shownav=1,$fieldid='rowid',$fieldref='ref',$morehtmlref='',$moreparam='',$nodbprefix=0,$morehtmlleft='',$morehtmlright='') + function showrefnav($object,$paramid,$morehtml='',$shownav=1,$fieldid='rowid',$fieldref='ref',$morehtmlref='',$moreparam='',$nodbprefix=0,$morehtmlleft='',$morehtmlstatus='',$morehtmlright='') { global $langs,$conf; @@ -5604,7 +5605,7 @@ class Form //print "xx".$previous_ref."x".$next_ref; $ret.='
'; - $ret.='
'.$morehtmlleft.'
'; + if ($morehtmlleft) $ret.='
'.$morehtmlleft.'
'; $ret.='
'; @@ -5624,6 +5625,8 @@ class Form } $ret.='
'; + if ($morehtmlright) $ret.='
'.$morehtmlright.'
'; + if ($previous_ref || $next_ref || $morehtml) { $ret.=''; } - if ($morehtmlright) $ret.='
'.$morehtmlright.'
'; + if ($morehtmlstatus) $ret.='
'.$morehtmlstatus.'
'; $ret.='
'; return $ret; From a669b61b69760e6a60b6e82d550a717f1c19f455 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 5 Jul 2016 18:33:13 +0200 Subject: [PATCH 18/19] Code comment --- htdocs/compta/facture/list.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/htdocs/compta/facture/list.php b/htdocs/compta/facture/list.php index 989aa6a6692..0e9c6874103 100644 --- a/htdocs/compta/facture/list.php +++ b/htdocs/compta/facture/list.php @@ -699,7 +699,13 @@ if ($search_company) $sql .= natural_search('s.nom', $search_company); if ($search_montant_ht != '') $sql.= natural_search('f.total', $search_montant_ht, 1); if ($search_montant_vat != '') $sql.= natural_search('f.total_vat', $search_montant_vat, 1); if ($search_montant_ttc != '') $sql.= natural_search('f.total_ttc', $search_montant_ttc, 1); -if ($search_status != '' && $search_status >= 0) $sql.= " AND f.fk_statut = ".$db->escape($search_status); +if ($search_status != '' && $search_status >= 0) +{ + if ($search_status == '0') $sql.=" AND f.fk_statut = 0"; // draft + if ($search_status == '1') $sql.=" AND f.fk_statut = 1"; // unpayed + if ($search_status == '2') $sql.=" AND f.fk_statut = 2"; // payed Not that some correupted data may contains f.fk_statut = 1 AND f.paye = 1 (it means payed too but should not happend. If yes, reopen and reclassify billed) + if ($search_status == '3') $sql.=" AND f.fk_statut = 3"; // abandonned +} if ($search_paymentmode > 0) $sql .= " AND f.fk_mode_reglement = ".$search_paymentmode.""; if ($month > 0) { From 6749e60079deb2dd6d5dddfc1d2d05727513b86a Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 5 Jul 2016 18:36:10 +0200 Subject: [PATCH 19/19] Fix: Test to manage corrupted data --- htdocs/compta/facture.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/compta/facture.php b/htdocs/compta/facture.php index 9b2d39c4487..6535cee7c98 100644 --- a/htdocs/compta/facture.php +++ b/htdocs/compta/facture.php @@ -163,7 +163,7 @@ if (empty($reshook)) // Change status of invoice else if ($action == 'reopen' && $user->rights->facture->creer) { $result = $object->fetch($id); - if ($object->statut == 2 || ($object->statut == 3 && $object->close_code != 'replaced')) { + if ($object->statut == 2 || ($object->statut == 3 && $object->close_code != 'replaced') || ($object->statut == 1 && $object->paye == 1)) { // ($object->statut == 1 && $object->paye == 1) should not happened but can be found when data are corrupted $result = $object->set_unpaid($user); if ($result > 0) { header('Location: ' . $_SERVER["PHP_SELF"] . '?facid=' . $id); @@ -3905,8 +3905,8 @@ else if ($id > 0 || ! empty($ref)) if ((($object->type == Facture::TYPE_STANDARD || $object->type == Facture::TYPE_REPLACEMENT) || ($object->type == Facture::TYPE_CREDIT_NOTE && empty($discount->id)) || ($object->type == Facture::TYPE_DEPOSIT && empty($discount->id))) - && ($object->statut == 2 || $object->statut == 3) - && $user->rights->facture->creer) // A paid invoice (partially or completely) + && ($object->statut == 2 || $object->statut == 3 || ($object->statut == 1 && $object->paye == 1)) // Condition ($object->statut == 1 && $object->paye == 1) should not happened but can be found due to corrupted data + && $user->rights->facture->creer) // A paid invoice (partially or completely) { if (! $objectidnext && $object->close_code != 'replaced') // Not replaced by another invoice {
' . $langs->trans('Ref') . ''; - $morehtmlref = ''; + $morehtmlright = ''; $discount = new DiscountAbsolute($db); $result = $discount->fetch(0, $object->id); if ($result > 0) { - $morehtmlref = ' (' . $langs->trans("CreditNoteConvertedIntoDiscount", $discount->getNomUrl(1, 'discount')) . ')'; + $morehtmlright = '  (' . $langs->trans("CreditNoteConvertedIntoDiscount", $discount->getNomUrl(1, 'discount')) . ')'; } if ($result < 0) { dol_print_error('', $discount->error); } - print $form->showrefnav($object, 'ref', $linkback, 1, 'facnumber', 'ref', $morehtmlref); + print $form->showrefnav($object, 'ref', $linkback, 1, 'facnumber', 'ref', '', '', 0, '', '', $morehtmlright); print '