From 4201e8b0326f290698631da883719b2f5f65d141 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 1 Oct 2015 14:38:31 +0200 Subject: [PATCH 01/11] FIX #3630 - Wrong balance report when module salaries and donation disabled --- htdocs/compta/resultat/clientfourn.php | 9 +- htdocs/compta/resultat/index.php | 156 +++++++++++++------------ htdocs/langs/en_US/compta.lang | 6 +- htdocs/langs/fr_FR/compta.lang | 4 +- 4 files changed, 93 insertions(+), 82 deletions(-) diff --git a/htdocs/compta/resultat/clientfourn.php b/htdocs/compta/resultat/clientfourn.php index b5aab7090d6..f5c197a9c48 100644 --- a/htdocs/compta/resultat/clientfourn.php +++ b/htdocs/compta/resultat/clientfourn.php @@ -547,7 +547,7 @@ if ($mysoc->tva_assuj == 'franchise') // Non assujeti * Salaries */ -if ($conf->salaries->enabled) +if (! empty($conf->salaries->enabled)) { if ($modecompta == 'CREANCES-DETTES') { $column = 'p.datev'; @@ -621,13 +621,16 @@ if ($conf->salaries->enabled) * Donation */ -if ($conf->donation->enabled) +if (! empty($conf->don->enabled)) { print ''.$langs->trans("Donation").''; $sql = "SELECT p.societe as name, p.firstname, p.lastname, date_format(p.datedon,'%Y-%m') as dm, sum(p.amount) as amount"; $sql.= " FROM ".MAIN_DB_PREFIX."don as p"; $sql.= " WHERE p.entity = ".$conf->entity; - $sql.= " AND fk_statut=2"; + if ($modecompta == 'CREANCES-DETTES') + $sql.= " AND fk_statut in (1,2)"; + else + $sql.= " AND fk_statut=2"; if (! empty($date_start) && ! empty($date_end)) $sql.= " AND p.datedon >= '".$db->idate($date_start)."' AND p.datedon <= '".$db->idate($date_end)."'"; $sql.= " GROUP BY p.societe, p.firstname, p.lastname, dm"; diff --git a/htdocs/compta/resultat/index.php b/htdocs/compta/resultat/index.php index 7b008ca49b4..870ba001466 100644 --- a/htdocs/compta/resultat/index.php +++ b/htdocs/compta/resultat/index.php @@ -474,85 +474,93 @@ $reshook=$hookmanager->executeHooks('addStatisticLine',$parameters,$object,$acti /* * Salaries */ - -if ($modecompta == 'CREANCES-DETTES') { - $column = 'p.datev'; -} else { - $column = 'p.datep'; -} - -$subtotal_ht = 0; -$subtotal_ttc = 0; -$sql = "SELECT p.label as nom, date_format($column,'%Y-%m') as dm, sum(p.amount) as amount"; -$sql.= " FROM ".MAIN_DB_PREFIX."payment_salary as p"; -$sql.= " WHERE p.entity = ".$conf->entity; -$sql.= " GROUP BY p.label, dm"; - -dol_syslog("get social salaries payments"); -$result=$db->query($sql); -if ($result) +if (! empty($conf->salaries->enabled)) { - $num = $db->num_rows($result); - $var=false; - $i = 0; - if ($num) - { - while ($i < $num) - { - $obj = $db->fetch_object($result); - - if (! isset($decaiss[$obj->dm])) $decaiss[$obj->dm]=0; - $decaiss[$obj->dm] += $obj->amount; - - if (! isset($decaiss_ttc[$obj->dm])) $decaiss_ttc[$obj->dm]=0; - $decaiss_ttc[$obj->dm] += $obj->amount; - - $i++; - } - } -} -else -{ - dol_print_error($db); + if ($modecompta == 'CREANCES-DETTES') { + $column = 'p.datev'; + } else { + $column = 'p.datep'; + } + + $subtotal_ht = 0; + $subtotal_ttc = 0; + $sql = "SELECT p.label as nom, date_format($column,'%Y-%m') as dm, sum(p.amount) as amount"; + $sql.= " FROM ".MAIN_DB_PREFIX."payment_salary as p"; + $sql.= " WHERE p.entity = ".$conf->entity; + $sql.= " GROUP BY p.label, dm"; + + dol_syslog("get social salaries payments"); + $result=$db->query($sql); + if ($result) + { + $num = $db->num_rows($result); + $var=false; + $i = 0; + if ($num) + { + while ($i < $num) + { + $obj = $db->fetch_object($result); + + if (! isset($decaiss[$obj->dm])) $decaiss[$obj->dm]=0; + $decaiss[$obj->dm] += $obj->amount; + + if (! isset($decaiss_ttc[$obj->dm])) $decaiss_ttc[$obj->dm]=0; + $decaiss_ttc[$obj->dm] += $obj->amount; + + $i++; + } + } + } + else + { + dol_print_error($db); + } } /* - * get dunning paiement -*/ -$subtotal_ht = 0; -$subtotal_ttc = 0; -$sql = "SELECT p.societe as nom, p.firstname, p.lastname, date_format(p.datedon,'%Y-%m') as dm, sum(p.amount) as amount"; -$sql.= " FROM ".MAIN_DB_PREFIX."don as p"; -$sql.= " WHERE p.entity = ".$conf->entity; -$sql.= " AND fk_statut=2"; -$sql.= " GROUP BY p.societe, p.firstname, p.lastname, dm"; - -dol_syslog("get social salaries payments"); -$result=$db->query($sql); -if ($result) + * Donation get dunning paiement + */ +if (! empty($conf->don->enabled)) { - $num = $db->num_rows($result); - $var=false; - $i = 0; - if ($num) - { - while ($i < $num) - { - $obj = $db->fetch_object($result); - - if (! isset($encaiss[$obj->dm])) $encaiss[$obj->dm]=0; - $encaiss[$obj->dm] += $obj->amount; - - if (! isset($encaiss_ttc[$obj->dm])) $encaiss_ttc[$obj->dm]=0; - $encaiss_ttc[$obj->dm] += $obj->amount; - - $i++; - } - } -} -else -{ - dol_print_error($db); + $subtotal_ht = 0; + $subtotal_ttc = 0; + $sql = "SELECT p.societe as nom, p.firstname, p.lastname, date_format(p.datedon,'%Y-%m') as dm, sum(p.amount) as amount"; + $sql.= " FROM ".MAIN_DB_PREFIX."don as p"; + $sql.= " WHERE p.entity = ".$conf->entity; + if ($modecompta == 'CREANCES-DETTES') + $sql.= " AND fk_statut in (1,2)"; + else + $sql.= " AND fk_statut=2"; + $sql.= " GROUP BY p.societe, p.firstname, p.lastname, dm"; + + dol_syslog("get donation payments"); + $result=$db->query($sql); + if ($result) + { + $num = $db->num_rows($result); + $var=false; + $i = 0; + if ($num) + { + while ($i < $num) + { + $obj = $db->fetch_object($result); + + if (! isset($encaiss[$obj->dm])) $encaiss[$obj->dm]=0; + $encaiss[$obj->dm] += $obj->amount; + + if (! isset($encaiss_ttc[$obj->dm])) $encaiss_ttc[$obj->dm]=0; + $encaiss_ttc[$obj->dm] += $obj->amount; + + $i++; + } + } + } + else + { + dol_print_error($db); + } } /* diff --git a/htdocs/langs/en_US/compta.lang b/htdocs/langs/en_US/compta.lang index 116b2c52fa8..3ae1c35562d 100644 --- a/htdocs/langs/en_US/compta.lang +++ b/htdocs/langs/en_US/compta.lang @@ -138,9 +138,9 @@ AnnualByCompaniesInputOutputMode=Balance of income and expenses, detail by third SeeReportInInputOutputMode=See report %sIncomes-Expenses%s said cash accounting for a calculation on actual payments made SeeReportInDueDebtMode=See report %sClaims-Debts%s said commitment accounting for a calculation on issued invoices RulesAmountWithTaxIncluded=- Amounts shown are with all taxes included -RulesResultDue=- It includes outstanding invoices, expenses and VAT whether they are paid or not.
- It is based on the validation date of invoices and VAT and on the due date for expenses. -RulesResultInOut=- It includes the real payments made on invoices, expenses and VAT.
- It is based on the payment dates of the invoices, expenses and VAT. -RulesCADue=- It includes the client's due invoices whether they are paid or not.
- It is based on the validation date of these invoices.
+RulesResultDue=- It includes outstanding invoices, expenses, VAT, donations whether they are paid or not. Is also includes paid salaries.
- It is based on the validation date of invoices and VAT and on the due date for expenses. For salaries defined with Salary module, the value date of payment is used. +RulesResultInOut=- It includes the real payments made on invoices, expenses, VAT and salaries.
- It is based on the payment dates of the invoices, expenses, VAT and salaries. The donation date for donation. +RulesCADue=- It includes the client's due invoices whether they are paid or not.
- It is based on the validation date of these invoices.
RulesCAIn=- It includes all the effective payments of invoices received from clients.
- It is based on the payment date of these invoices
DepositsAreNotIncluded=- Deposit invoices are nor included DepositsAreIncluded=- Deposit invoices are included diff --git a/htdocs/langs/fr_FR/compta.lang b/htdocs/langs/fr_FR/compta.lang index 544cf775e70..caf1f1135b3 100644 --- a/htdocs/langs/fr_FR/compta.lang +++ b/htdocs/langs/fr_FR/compta.lang @@ -138,8 +138,8 @@ AnnualByCompaniesInputOutputMode=Bilan des recettes et dépenses, détail par ti SeeReportInInputOutputMode=Cliquer sur %sRecettes-Dépenses%s dit comptabilité de caisse pour un calcul sur les paiements effectivement réalisés SeeReportInDueDebtMode=Cliquer sur %sCréances-Dettes%s dit comptabilité d'engagement pour un calcul sur les factures émises RulesAmountWithTaxIncluded=- Les montants affichés sont les montants taxe incluse -RulesResultDue=- Il inclut les factures, charges et tva dues, qu'elles soient payées ou non.
- Il se base sur la date de validation pour les factures et la tva et sur la date d'échéance pour les charges. -RulesResultInOut=- Il inclut les règlements effectivement réalisés pour les factures, les charges et la TVA.
- Il se base sur la date de règlement de ces factures, charges et TVA. +RulesResultDue=- Il inclut les factures, charges, tva dues, et dons qu'ils soient payées ou non.
- Il se base sur la date de validation pour les factures et la tva et sur la date d'échéance pour les charges. Pour les salaires saisis depuis le module Salaires, la date de valeur du paiement est utilisée. +RulesResultInOut=- Il inclut les règlements effectivement réalisés pour les factures, les charges, TVA et salaires.
- Il se base sur la date de règlement de ces factures, charges, TVA ou salaires. La date de don pour les dons. RulesCADue=- Il inclut les factures clients dues, qu'elles soient payées ou non.
- Il se base sur la date de validation de ces factures.
RulesCAIn=- Il inclut les règlements effectivement reçus des factures clients.
- Il se base sur la date de règlement de ces factures
DepositsAreNotIncluded=- Les factures d'acomptes ne sont pas incluses From fd29bb34be9645f2c71cd0453730005c11fe31a3 Mon Sep 17 00:00:00 2001 From: Florian HENRY Date: Thu, 1 Oct 2015 16:09:04 +0200 Subject: [PATCH 02/11] FIX : Mass Mailing activity don't display all status --- htdocs/comm/mailing/list.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/htdocs/comm/mailing/list.php b/htdocs/comm/mailing/list.php index ef2e2c48bf8..093efbd6a23 100644 --- a/htdocs/comm/mailing/list.php +++ b/htdocs/comm/mailing/list.php @@ -166,8 +166,7 @@ if ($result) print ''; if ($filteremail) { - if ($obj->sendstatut==-1) print $langs->trans("MailingStatusError").' '.img_error(); - if ($obj->sendstatut==1) print $langs->trans("MailingStatusSent").' '.img_picto($langs->trans("MailingStatusSent"),'statut6'); + print $email::libStatutDest($obj->sendstatut,2); } else { From 322a2a54b830b3c492439090843d22ce1e6d3841 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sat, 3 Oct 2015 11:34:14 +0200 Subject: [PATCH 03/11] Update printing.php --- htdocs/printing/admin/printing.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/printing/admin/printing.php b/htdocs/printing/admin/printing.php index d848b0befce..16916cad7e5 100644 --- a/htdocs/printing/admin/printing.php +++ b/htdocs/printing/admin/printing.php @@ -229,7 +229,7 @@ if ($mode == 'test' && $user->admin) $langs->load($driver); $printer = new $classname($db); //print '
'.print_r($printer, true).'
'; - if (count($printer->getlist_available_printers)) { + if (count($printer->getlist_available_printers())) { print $printer->listAvailablePrinters(); } else { From 4e5ca151b54c8ce685e79b4a668e491573103e67 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 3 Oct 2015 20:39:15 +0200 Subject: [PATCH 04/11] Make process to update launchpad easier. --- build/launchpad/README | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/launchpad/README b/build/launchpad/README index b2db1d18894..7ab1b15b81c 100644 --- a/build/launchpad/README +++ b/build/launchpad/README @@ -99,7 +99,7 @@ If you want to build/test package locally: bzr branch lp:~yourlogin/+junk/debian-[dev|stable] cd debian-[dev|stable] bzr status - -- Update files here -- + -- Update files here: Remove all (except .bzr dir) and overwrite. Restore version into the file changelog -- bzr commit -m "Description of change" bzr push lp:~yourlogin/+junk/debian-[dev|stable] From 9eab5206d4e6baf8a65b61c08c47bbbf22597ac4 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 4 Oct 2015 14:08:32 +0200 Subject: [PATCH 05/11] Fix typo --- build/pad/DoliWamp.pml | 2 +- build/pad/pad_doliwamp.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/build/pad/DoliWamp.pml b/build/pad/DoliWamp.pml index 9209bdbe061..401cff6d7a5 100644 --- a/build/pad/DoliWamp.pml +++ b/build/pad/DoliWamp.pml @@ -41,7 +41,7 @@ DoliWamp, Dolibarr ERP/CRM for Windows DoliWamp, the easy to use Dolibarr for Windows to manage your company,foundation DoliWamp is the Dolibarr ERP/CRM for Windows, the easy to use open source software to manage your activity (invoices, customers, suppliers, contracts, agenda, emailings...) and any other things a small or mid-sized business or a foundation needs. - DoliWamp is the Dolibarr ERP/CRM autoinstaller for Windows users with no technical knowledge to install Dolibarr and all its prerequisites (Apache, Mysql, PHP) with just one auto-exe file. Dolibarr ERP/CRM is a software built by modules addition (you enable only features you need), to manage small or mid-sized businesses, freelancers or foundations. + DoliWamp is the Dolibarr ERP/CRM autoinstaller for Windows users with no technical knowledge to install Dolibarr and all its prerequisites (Apache, Mysql, PHP) with just one auto-exe file. Dolibarr ERP/CRM is a software package built by modules addition (you enable only features you need), to manage small or mid-sized businesses, freelancers or foundations. DoliWamp is the Dolibarr ERP/CRM for Windows. Dolibarr ERP & CRM is a software built by modules addition (you enable only features you need), to manage small or mid-sized businesses, freelancers or foundations (You can manage or follow contacts, invoices, orders, commercial proposals, products, stock management, agenda, mass emailings, members of a foundation, bank accounts...). Based on a WAMP, MAMP or LAMP server (Apache, Mysql, PHP for all Operating Systems), you can install it as a standalone program or use it from anywhere with any web browser. Dolibarr is an OpenSource project. It differs from other ERP or CRM softwares (like OpenAguila, OpenBravo, OpenERP, Neogia, Compiere, etc) because everything was made to be more simple: Simple to install, Simple to use, Simple to develop. DoliWamp is the auto-installer for Windows users with no technical knowledge to install Dolibarr ERP/CRM and all its prerequisites (Apache, Mysql, PHP) with just one auto-exe file. diff --git a/build/pad/pad_doliwamp.xml b/build/pad/pad_doliwamp.xml index 0da0b189113..c59a3695e5d 100644 --- a/build/pad/pad_doliwamp.xml +++ b/build/pad/pad_doliwamp.xml @@ -71,7 +71,7 @@ DoliWamp, Dolibarr ERP/CRM for Windows DoliWamp, the easy to use Dolibarr for Windows to manage your company,foundation DoliWamp is the Dolibarr ERP/CRM for Windows, the easy to use open source software to manage your activity (invoices, customers, suppliers, contracts, agenda, emailings...) and any other things a small or mid-sized business or a foundation needs. - DoliWamp is the Dolibarr ERP/CRM autoinstaller for Windows users with no technical knowledge to install Dolibarr and all its prerequisites (Apache, Mysql, PHP) with just one auto-exe file. Dolibarr ERP/CRM is a software built by modules addition (you enable only features you need), to manage small or mid-sized businesses, freelancers or foundations. + DoliWamp is the Dolibarr ERP/CRM autoinstaller for Windows users with no technical knowledge to install Dolibarr and all its prerequisites (Apache, Mysql, PHP) with just one auto-exe file. Dolibarr ERP/CRM is a software package built by modules addition (you enable only features you need), to manage small or mid-sized businesses, freelancers or foundations. DoliWamp is the Dolibarr ERP/CRM for Windows. Dolibarr ERP & CRM is a software built by modules addition (you enable only features you need), to manage small or mid-sized businesses, freelancers or foundations (You can manage or follow contacts, invoices, orders, commercial proposals, products, stock management, agenda, mass emailings, members of a foundation, bank accounts...). Based on a WAMP, MAMP or LAMP server (Apache, Mysql, PHP for all Operating Systems), you can install it as a standalone program or use it from anywhere with any web browser. Dolibarr is an OpenSource project. It differs from other ERP or CRM softwares (like OpenAguila, OpenBravo, OpenERP, Neogia, Compiere, etc) because everything was made to be more simple: Simple to install, Simple to use, Simple to develop. DoliWamp is the auto-installer for Windows users with no technical knowledge to install Dolibarr ERP/CRM and all its prerequisites (Apache, Mysql, PHP) with just one auto-exe file. From 36a6a77d828071887e434de928df054439ccab63 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 4 Oct 2015 15:01:17 +0200 Subject: [PATCH 06/11] Fix missing picto for launchpad --- doc/images/dolibarr_192x192.png | Bin 0 -> 3822 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 doc/images/dolibarr_192x192.png diff --git a/doc/images/dolibarr_192x192.png b/doc/images/dolibarr_192x192.png new file mode 100644 index 0000000000000000000000000000000000000000..c5935d60147e275dd171e3fd2392fe0cdd57b5a4 GIT binary patch literal 3822 zcmVbZ&;G?4 z1OV3yL!8510Ipv^ARnM75V!>Z2nYZV1b_zuAcXzT%G<1mZ*w#CgBmVE;Zr+esR- zIkzm^=E$;a-L!PmN*PwluwqF)Wmp&?j4>gYV2m-Q1Y-;WljMO+%brs@{E_(+QikQI zd%^j|$jA}5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O&Ks76wTS=#hzrn*e}`2EYRWE=^$&g8+y?00;?VO z06Y)?5eNVe1OO0$0D%z*LJ$BE2#_}mg8&3T1OmVV0T6)zFM1%j2SATf7`SKvQWyXN k0zg237fm#HAfN~Q2mZQ@_8qA2cmMzZ07*qoM6N<$g4Q`1pa1{> literal 0 HcmV?d00001 From 75e337e8d96a203d4b055f72e48970a67e30daf6 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 4 Oct 2015 16:02:50 +0200 Subject: [PATCH 07/11] FIX select of project using ajax autocomplete option --- htdocs/core/class/html.formprojet.class.php | 31 +++++++++++---------- htdocs/projet/ajax/projects.php | 7 +++-- 2 files changed, 21 insertions(+), 17 deletions(-) diff --git a/htdocs/core/class/html.formprojet.class.php b/htdocs/core/class/html.formprojet.class.php index 25d65cc591a..5486d19858b 100644 --- a/htdocs/core/class/html.formprojet.class.php +++ b/htdocs/core/class/html.formprojet.class.php @@ -90,29 +90,30 @@ class FormProjets } /** - * Returns an array with projects qualified for a third party + * Returns an array with projects qualified for a third party * - * @param int $socid Id third party (-1=all, 0=only projects not linked to a third party, id=projects not linked or linked to third party id) - * @param int $selected Id project preselected - * @param string $htmlname Nom de la zone html - * @param int $maxlength Maximum length of label - * @param int $option_only Return only html options lines without the select tag - * @param int $show_empty Add an empty line - * @param int $discard_closed Discard closed projects (0=Keep,1=hide completely,2=Disable) - * @param int $forcefocus Force focus on field (works with javascript only) - * @param int $disabled Disabled - * @param int $mode 0 for HTML mode and 1 for JSON mode - * @param string $filterkey Key to filter - * @return int Nber of project if OK, <0 if KO + * @param int $socid Id third party (-1=all, 0=only projects not linked to a third party, id=projects not linked or linked to third party id) + * @param int $selected Id project preselected + * @param string $htmlname Nom de la zone html + * @param int $maxlength Maximum length of label + * @param int $option_only Return only html options lines without the select tag + * @param int $show_empty Add an empty line + * @param int $discard_closed Discard closed projects (0=Keep,1=hide completely,2=Disable) + * @param int $forcefocus Force focus on field (works with javascript only) + * @param int $disabled Disabled + * @param int $mode 0 for HTML mode and 1 for array return (to be used by json_encode for example) + * @param string $filterkey Key to filter + * @return int Nb of project if OK, <0 if KO */ - function select_projects_list($socid=-1, $selected='', $htmlname='projectid', $maxlength=24, $option_only=0, $show_empty=1, $discard_closed=0, $forcefocus=0, $disabled=0, $mode = 0, $filterkey = '') + function select_projects_list($socid=-1, $selected='', $htmlname='projectid', $maxlength=24, $option_only=0, $show_empty=1, $discard_closed=0, $forcefocus=0, $disabled=0, $mode=0, $filterkey = '') { global $user,$conf,$langs; require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; $out=''; - + $outarray=array(); + $hideunselectables = false; if (! empty($conf->global->PROJECT_HIDE_UNSELECTABLES)) $hideunselectables = true; diff --git a/htdocs/projet/ajax/projects.php b/htdocs/projet/ajax/projects.php index f7fbfbaddab..55a4597dc08 100644 --- a/htdocs/projet/ajax/projects.php +++ b/htdocs/projet/ajax/projects.php @@ -38,6 +38,7 @@ $socid=GETPOST('socid','int'); $action=GETPOST('action', 'alpha'); $id=GETPOST('id', 'int'); + /* * View */ @@ -60,9 +61,11 @@ if (! GETPOST($htmlname) && ! GETPOST($idprod)) return; // When used from jQuery, the search term is added as GET param "term". $searchkey=(GETPOST($idprod)?GETPOST($idprod):(GETPOST($htmlname)?GETPOST($htmlname):'')); + $form = new FormProjets($db); -$arrayresult=$form->select_projects_list($socid, '', $htmlname, '', 0, 0, array(), 0, 1, $searchkey); +$arrayresult=$form->select_projects_list($socid, '', $htmlname, 0, 0, 1, 0, 0, 0, 1, $searchkey); $db->close(); -print json_encode($arrayresult); \ No newline at end of file +print json_encode($arrayresult); + From d54650905bd6c880b17c7c7448253fac37e736be Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 4 Oct 2015 19:08:10 +0200 Subject: [PATCH 08/11] FIX debian install when module mysqli is not installed. --- build/debian/dolibarr.postinst | 24 +++++++++++++++++++----- 1 file changed, 19 insertions(+), 5 deletions(-) diff --git a/build/debian/dolibarr.postinst b/build/debian/dolibarr.postinst index 8a6078af377..5f61ffe2083 100644 --- a/build/debian/dolibarr.postinst +++ b/build/debian/dolibarr.postinst @@ -40,10 +40,28 @@ enable_install_upgrade_wizard() { rm -f /var/lib/dolibarr/documents/install.lock } + +php_install() { + if which php5enmod >/dev/null 2>&1 ;then + # php5endmod exists for ubuntu only + echo "Enable php module mysqli with php5enmod" + php5enmod mysqli + fi +} + apache_install() { webserver=$1 + + # Enable Apache 2 alias module + if which a2enmod >/dev/null 2>&1 ;then + echo "Enable apache module alias with a2enmod" + a2enmod alias + fi + + # Enable dolibarr conf if which a2enconf >/dev/null 2>&1 ;then # a2enconf exists for ubuntu only + echo "Enable link for Apache config file with a3enconf" a2enconf dolibarr else if [ -d /etc/$webserver/conf.d ] && [ ! -e /etc/$webserver/conf.d/dolibarr.conf ]; then @@ -88,11 +106,7 @@ case "$1" in echo This is not a first install fi - # Apache 2 setup - if which a2enmod >/dev/null 2>&1 ;then - a2enmod alias - fi - + php_install apache_install lighttpd_install From 0df42bc5eacefb3673ec80230e01942636d6d5af Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 4 Oct 2015 19:37:49 +0200 Subject: [PATCH 09/11] FIX Filter on status of thirdparty list and bad encoding of url --- htdocs/comm/prospect/list.php | 1 + htdocs/societe/list.php | 24 ++++++++++++++++-------- 2 files changed, 17 insertions(+), 8 deletions(-) diff --git a/htdocs/comm/prospect/list.php b/htdocs/comm/prospect/list.php index 5d795775eb4..7259cff218e 100644 --- a/htdocs/comm/prospect/list.php +++ b/htdocs/comm/prospect/list.php @@ -468,6 +468,7 @@ if ($resql) $reshook=$hookmanager->executeHooks('printFieldListSearch',$parameters); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; + // Status print ''; print $form->selectarray('search_status', array('0'=>$langs->trans('ActivityCeased'),'1'=>$langs->trans('InActivity')),$search_status); print ''; diff --git a/htdocs/societe/list.php b/htdocs/societe/list.php index 281746fe824..b97fd8397d4 100644 --- a/htdocs/societe/list.php +++ b/htdocs/societe/list.php @@ -55,6 +55,7 @@ $search_categ=trim(GETPOST("search_categ")); $mode=GETPOST("mode"); $modesearch=GETPOST("mode_search"); $search_type=trim(GETPOST('search_type')); +$search_status=GETPOST("search_status",'int'); $sortfield=GETPOST("sortfield",'alpha'); $sortorder=GETPOST("sortorder",'alpha'); @@ -172,8 +173,11 @@ if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter")) // Both $search_idprof3=''; $search_idprof4=''; $search_type=''; + $search_status=''; } +if ($search_status=='') $search_status=1; // always display active thirdparty first + if ($socname) { $search_nom=$socname; @@ -234,6 +238,7 @@ if ($search_idprof6) $sql .= " AND s.idprof6 LIKE '%".$db->escape($search_idpro if ($search_type > 0 && in_array($search_type,array('1,3','2,3'))) $sql .= " AND s.client IN (".$db->escape($search_type).")"; if ($search_type > 0 && in_array($search_type,array('4'))) $sql .= " AND s.fournisseur = 1"; if ($search_type == '0') $sql .= " AND s.client = 0 AND s.fournisseur = 0"; +if ($search_status!='') $sql .= " AND s.status = ".$db->escape($search_status); if (!empty($conf->barcode->enabled) && $sbarcode) $sql.= " AND s.barcode LIKE '%".$db->escape($sbarcode)."%'"; // Add where from hooks $parameters=array(); @@ -257,13 +262,14 @@ if ($resql) $num = $db->num_rows($resql); $i = 0; - $params = "&socname=".htmlspecialchars($socname)."&search_nom=".htmlspecialchars($search_nom)."&search_town=".htmlspecialchars($search_town); - $params.= ($sbarcode?"&sbarcode=".htmlspecialchars($sbarcode):""); - $params.= '&search_idprof1='.htmlspecialchars($search_idprof1); - $params.= '&search_idprof2='.htmlspecialchars($search_idprof2); - $params.= '&search_idprof3='.htmlspecialchars($search_idprof3); - $params.= '&search_idprof4='.htmlspecialchars($search_idprof4); - + $params = "&socname=".urlencode($socname)."&search_nom=".urlencode($search_nom)."&search_town=".urlencode($search_town); + $params.= ($sbarcode?"&sbarcode=".urlencode($sbarcode):""); + $params.= '&search_idprof1='.urlencode($search_idprof1); + $params.= '&search_idprof2='.urlencode($search_idprof2); + $params.= '&search_idprof3='.urlencode($search_idprof3); + $params.= '&search_idprof4='.urlencode($search_idprof4); + if ($search_status != '') $params.='&search_status='.urlencode($search_status); + print_barre_liste($title, $page, $_SERVER["PHP_SELF"],$params,$sortfield,$sortorder,'',$num,$nbtotalofrecords,'title_companies'); // Show delete result message @@ -391,7 +397,9 @@ if ($resql) print $hookmanager->resPrint; // Status - print ''; + print ''; + print $form->selectarray('search_status', array('0'=>$langs->trans('ActivityCeased'),'1'=>$langs->trans('InActivity')),$search_status); + print ''; print ''; print ''; From 780a5a199650b9b6cc1c646686f7120c910bcdf7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Fri, 2 Oct 2015 13:12:35 +0200 Subject: [PATCH 10/11] Update files.lib.php --- htdocs/core/lib/files.lib.php | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/htdocs/core/lib/files.lib.php b/htdocs/core/lib/files.lib.php index e49661be26f..505e8b8e665 100644 --- a/htdocs/core/lib/files.lib.php +++ b/htdocs/core/lib/files.lib.php @@ -1603,6 +1603,16 @@ function dol_check_secure_access_document($modulepart,$original_file,$entity,$fu $sqlprotectagainstexternals = "SELECT rowid as fk_soc FROM ".MAIN_DB_PREFIX."societe WHERE rowid='".$db->escape($refname)."' AND entity IN (".getEntity('societe', 1).")"; } + // Wrapping for contact + else if ($modulepart == 'contact') + { + if ($fuser->rights->societe->lire) + { + $accessallowed=1; + } + $original_file=$conf->societe->multidir_output[$entity].'/contact/'.$original_file; + } + // Wrapping for invoices else if ($modulepart == 'facture' || $modulepart == 'invoice') { From c2cc9711f76fa61d44120c3fea8673151209d96b Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 4 Oct 2015 20:01:08 +0200 Subject: [PATCH 11/11] FIX Thirdparty is missing on card --- htdocs/contact/document.php | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/htdocs/contact/document.php b/htdocs/contact/document.php index 239b1d9a6fd..81f9b2a29be 100644 --- a/htdocs/contact/document.php +++ b/htdocs/contact/document.php @@ -104,6 +104,25 @@ if ($object->id) print ''.$langs->trans("Lastname").' / '.$langs->trans("Label").''.$object->lastname.''; print ''.$langs->trans("Firstname").''.$object->firstname.''; + // Company + if (empty($conf->global->SOCIETE_DISABLE_CONTACTS)) + { + if ($object->socid > 0) + { + $objsoc = new Societe($db); + $objsoc->fetch($object->socid); + + print ''.$langs->trans("ThirdParty").''.$objsoc->getNomUrl(1).''; + } + + else + { + print ''.$langs->trans("ThirdParty").''; + print $langs->trans("ContactNotLinkedToCompany"); + print ''; + } + } + print ''.$langs->trans("NbOfAttachedFiles").''.count($filearray).''; print ''.$langs->trans("TotalSizeOfAttachedFiles").''.$totalsize.' '.$langs->trans("bytes").''; print '';