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 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] 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. diff --git a/doc/images/dolibarr_192x192.png b/doc/images/dolibarr_192x192.png new file mode 100644 index 00000000000..c5935d60147 Binary files /dev/null and b/doc/images/dolibarr_192x192.png differ diff --git a/htdocs/comm/mailing/list.php b/htdocs/comm/mailing/list.php index 8ca6b889310..cc7bafa9f5d 100644 --- a/htdocs/comm/mailing/list.php +++ b/htdocs/comm/mailing/list.php @@ -164,8 +164,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 { diff --git a/htdocs/comm/prospect/list.php b/htdocs/comm/prospect/list.php index b7a48331dd9..f629aafef29 100644 --- a/htdocs/comm/prospect/list.php +++ b/htdocs/comm/prospect/list.php @@ -494,6 +494,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/compta/resultat/clientfourn.php b/htdocs/compta/resultat/clientfourn.php index bd3b8cd2753..c881b263dff 100644 --- a/htdocs/compta/resultat/clientfourn.php +++ b/htdocs/compta/resultat/clientfourn.php @@ -552,7 +552,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'; @@ -626,13 +626,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 6c768821cc7..96400da23c1 100644 --- a/htdocs/compta/resultat/index.php +++ b/htdocs/compta/resultat/index.php @@ -477,85 +477,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/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 ''; 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/langs/en_US/compta.lang b/htdocs/langs/en_US/compta.lang index cbbcd239004..ad8858a4255 100644 --- a/htdocs/langs/en_US/compta.lang +++ b/htdocs/langs/en_US/compta.lang @@ -140,9 +140,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 e56a9e959ff..a7e7cc5ac3e 100644 --- a/htdocs/langs/fr_FR/compta.lang +++ b/htdocs/langs/fr_FR/compta.lang @@ -140,8 +140,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 diff --git a/htdocs/printing/admin/printing.php b/htdocs/printing/admin/printing.php index cc97b7cc9f7..872ddd9f5dd 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 { 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); + diff --git a/htdocs/societe/list.php b/htdocs/societe/list.php index 06a29082f50..39b625547b9 100644 --- a/htdocs/societe/list.php +++ b/htdocs/societe/list.php @@ -55,12 +55,14 @@ $search_idprof5=trim(GETPOST('search_idprof5')); $search_idprof6=trim(GETPOST('search_idprof6')); $search_sale=trim(GETPOST("search_sale")); $search_categ=trim(GETPOST("search_categ")); +$search_type=trim(GETPOST('search_type')); +$search_country=GETPOST("search_country",'int'); +$search_type_thirdparty=GETPOST("search_type_thirdparty",'int'); +$search_status=GETPOST("search_status",'int'); + +$optioncss=GETPOST('optioncss','alpha'); $mode=GETPOST("mode"); $modesearch=GETPOST("mode_search"); -$search_type=trim(GETPOST('search_type')); -$search_country = GETPOST("search_country",'int'); -$search_type_thirdparty = GETPOST("search_type_thirdparty",'int'); -$optioncss = GETPOST('optioncss','alpha'); $sortfield=GETPOST("sortfield",'alpha'); $sortorder=GETPOST("sortorder",'alpha'); @@ -181,8 +183,11 @@ if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter")) // Both $search_type=''; $search_country=''; $search_type_thirdparty=''; + $search_status=''; } +if ($search_status=='') $search_status=1; // always display active thirdparty first + if ($socname) { $search_nom=$socname; @@ -247,6 +252,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)."%'"; if ($search_country) $sql .= " AND s.fk_pays IN (".$search_country.')'; if ($search_type_thirdparty) $sql .= " AND s.fk_typent IN (".$search_type_thirdparty.')'; @@ -272,18 +278,19 @@ if ($resql) $num = $db->num_rows($resql); $i = 0; - $param = "&socname=".htmlspecialchars($socname); - $param.= "&search_nom=".htmlspecialchars($search_nom); - $param.= "&search_town=".htmlspecialchars($search_town); - $param.= ($sbarcode?"&sbarcode=".htmlspecialchars($sbarcode):""); - $param.= '&search_idprof1='.htmlspecialchars($search_idprof1); - $param.= '&search_idprof2='.htmlspecialchars($search_idprof2); - $param.= '&search_idprof3='.htmlspecialchars($search_idprof3); - $param.= '&search_idprof4='.htmlspecialchars($search_idprof4); - if ($search_country != '') $param.='&search_country='.htmlspecialchars($search_country); - if ($search_type_thirdparty != '') $param.='&search_type_thirdparty='.htmlspecialchars($search_type_thirdparty); - if ($optioncss != '') $param.='&optioncss='.$optioncss; - + $param = "&socname=".urlencode($socname); + $param.= "&search_nom=".urlencode($search_nom); + $param.= "&search_town=".urlencode($search_town); + $param.= ($sbarcode?"&sbarcode=".urlencode($sbarcode):""); + $param.= '&search_idprof1='.urlencode($search_idprof1); + $param.= '&search_idprof2='.urlencode($search_idprof2); + $param.= '&search_idprof3='.urlencode($search_idprof3); + $param.= '&search_idprof4='.urlencode($search_idprof4); + if ($search_country != '') $param.='&search_country='.urlencode($search_country); + if ($search_type_thirdparty != '') $param.='&search_type_thirdparty='.urlencode($search_type_thirdparty); + if ($optioncss != '') $param.='&optioncss='.urlencode($optioncss); + if ($search_status != '') $params.='&search_status='.urlencode($search_status); + print_barre_liste($title, $page, $_SERVER["PHP_SELF"],$param,$sortfield,$sortorder,'',$num,$nbtotalofrecords,'title_companies'); // Show delete result message @@ -422,7 +429,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 '';