diff --git a/htdocs/admin/security.php b/htdocs/admin/security.php
index 43ccef1e954..adb590ffcd2 100644
--- a/htdocs/admin/security.php
+++ b/htdocs/admin/security.php
@@ -165,6 +165,16 @@ else if ($action == 'disable_MAIN_SECURITY_DISABLEFORGETPASSLINK')
exit;
}
+if ($action == 'maj_pattern')
+{
+ dolibarr_set_const($db, "USER_PASSWORD_PATTERN", GETPOST("pattern"),'chaine',0,'',$conf->entity);
+ header("Location: security.php");
+ exit;
+}
+
+
+
+
@@ -265,6 +275,113 @@ foreach ($arrayhandler as $key => $module)
print '';
print '';
+//if($conf->global->MAIN_SECURITY_DISABLEFORGETPASSLINK == 1)
+// Patter for Password Perso
+if ($conf->global->USER_PASSWORD_GENERATED == "Perso"){
+$var=!$var;
+
+ $tabConf = explode(";",$conf->global->USER_PASSWORD_PATTERN);
+ /*$this->length2 = $tabConf[0];
+ $this->NbMaj = $tabConf[1];
+ $this->NbNum = $tabConf[2];
+ $this->NbSpe = $tabConf[3];
+ $this->NbRepeat = $tabConf[4];
+ $this->WithoutAmbi = $tabConf[5];
+ */
+ print '
';
+
+ print '';
+}
+
+
// Cryptage mot de passe
print '
';
$var=true;
diff --git a/htdocs/comm/propal/list.php b/htdocs/comm/propal/list.php
index 6522a592097..2b8e478d37d 100644
--- a/htdocs/comm/propal/list.php
+++ b/htdocs/comm/propal/list.php
@@ -322,8 +322,11 @@ if ($result)
print '';
$formpropal->selectProposalStatus($viewstatut,1);
print ' | ';
- print '';
- print ' | ';
+ print '';
+ print '';
+ print ' ';
+ print '';
+ print ' | ';
print "\n";
$var=true;
diff --git a/htdocs/comm/prospect/list.php b/htdocs/comm/prospect/list.php
index 94286ee4c53..113618ffae8 100644
--- a/htdocs/comm/prospect/list.php
+++ b/htdocs/comm/prospect/list.php
@@ -48,7 +48,6 @@ $search_state = GETPOST("search_state");
$search_datec = GETPOST("search_datec");
$search_categ = GETPOST("search_categ",'int');
$search_status = GETPOST("search_status",'int');
-if ($search_status=='') $search_status=1; // always display activ customer first
$catid = GETPOST("catid",'int');
$sortfield = GETPOST("sortfield",'alpha');
@@ -154,6 +153,21 @@ $sts = array(-1,0,1,2,3);
// Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array
$hookmanager->initHooks(array('prospectlist'));
+// Do we click on purge search criteria ?
+if (GETPOST("button_removefilter_x"))
+{
+ $socname="";
+ $stcomm="";
+ $search_nom="";
+ $search_zipcode="";
+ $search_town="";
+ $search_state="";
+ $search_datec="";
+ $search_categ="";
+ $search_status="";
+}
+
+if ($search_status=='') $search_status=1; // always display active customer first
/*
* Actions
@@ -361,7 +375,7 @@ if ($resql)
// Print these two select
print $langs->trans("From").' ';
print ' ';
- print $langs->trans("To").' ';
+ print $langs->trans("to").' ';
print '';
@@ -378,9 +392,9 @@ if ($resql)
print '';
// Print the search button
- print '';
- print '';
- print ' | ';
+ print '';
+ print '';
+ print " | \n";
$parameters=array();
$formconfirm=$hookmanager->executeHooks('printFieldListOption',$parameters); // Note that $action and $object may have been modified by hook
diff --git a/htdocs/compta/bank/search.php b/htdocs/compta/bank/search.php
index 25b7d91a3ff..1e8196481e6 100644
--- a/htdocs/compta/bank/search.php
+++ b/htdocs/compta/bank/search.php
@@ -35,6 +35,7 @@ require_once DOL_DOCUMENT_ROOT . '/core/class/html.formother.class.php';
$langs->load("banks");
$langs->load("categories");
$langs->load("companies");
+$langs->load("margins");
// Security check
if ($user->societe_id) $socid=$user->societe_id;
@@ -72,6 +73,15 @@ $limit = $conf->liste_limit;
if (! $sortorder) $sortorder='DESC';
if (! $sortfield) $sortfield='b.dateo';
+if (GETPOST("button_removefilter"))
+{
+ $description="";
+ $type="";
+ $debit="";
+ $credit="";
+ $account="";
+ $bid="";
+}
/*
* View
@@ -198,7 +208,7 @@ if ($resql)
print ' | ';
print ' | ';
print '';
- $form->select_types_paiements(empty($_REQUEST["type"])?'':$_REQUEST["type"], 'type', '', 2, 0, 1, 8);
+ $form->select_types_paiements(empty($type)?'':$type, 'type', '', 2, 0, 1, 8);
print ' | ';
print ' | ';
print '';
@@ -214,9 +224,9 @@ if ($resql)
print ' | ';
print '';
if (! empty($_REQUEST['bid'])) print '';
- print '';
- print ' | ';
- print '';
+ print '';
+ print '';
+ print "\n";
// Loop on each record
$total_debit=0;
diff --git a/htdocs/compta/deplacement/list.php b/htdocs/compta/deplacement/list.php
index bb2c50b42bf..da0e3e21dcd 100644
--- a/htdocs/compta/deplacement/list.php
+++ b/htdocs/compta/deplacement/list.php
@@ -27,6 +27,8 @@
require '../../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/compta/tva/class/tva.class.php';
require_once DOL_DOCUMENT_ROOT.'/compta/deplacement/class/deplacement.class.php';
+require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php';
+require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
$langs->load("companies");
$langs->load("users");
@@ -37,6 +39,10 @@ $socid = GETPOST('socid','int');
if ($user->societe_id) $socid=$user->societe_id;
$result = restrictedArea($user, 'deplacement','','');
+$search_ref=GETPOST('search_ref','int');
+$search_name=GETPOST('search_name','alpha');
+$search_company=GETPOST('search_company','alpha');
+// $search_amount=GETPOST('search_amount','alpha');
$sortfield = GETPOST("sortfield",'alpha');
$sortorder = GETPOST("sortorder",'alpha');
$page = GETPOST("page",'int');
@@ -48,13 +54,24 @@ if (! $sortorder) $sortorder="DESC";
if (! $sortfield) $sortfield="d.dated";
$limit = $conf->liste_limit;
-$search_ref=GETPOST('search_ref','alpha');
+$year=GETPOST("year");
+$month=GETPOST("month");
+if (GETPOST("button_removefilter"))
+{
+ $search_ref="";
+ $search_name="";
+ $search_company="";
+ // $search_amount="";
+ $year="";
+ $month="";
+}
/*
* View
*/
+$formother = new FormOther($db);
$tripandexpense_static=new Deplacement($db);
$userstatic = new User($db);
@@ -76,10 +93,31 @@ $sql.= " AND d.entity = ".$conf->entity;
if (empty($user->rights->deplacement->readall) && empty($user->rights->deplacement->lire_tous)) $sql.=' AND d.fk_user IN ('.join(',',$childids).')';
if (!$user->rights->societe->client->voir && !$socid) $sql.= " AND sc.fk_user = " .$user->id;
if ($socid) $sql.= " AND s.rowid = ".$socid;
-if (trim($search_ref) != '')
+
+if ($search_ref) $sql.=" AND d.rowid=".$search_ref;
+if ($search_name)
{
- $sql.= ' AND d.rowid LIKE \'%'.$db->escape(trim($search_ref)) . '%\'';
+ $sql .= natural_search('u.lastname', $search_name);
}
+if ($search_company)
+{
+ $sql .= natural_search('s.nom', $search_company);
+}
+// if ($search_amount) $sql.=" AND d.km='".$db->escape(price2num(trim($search_amount)))."'";
+if ($month > 0)
+{
+ if ($year > 0 && empty($day))
+ $sql.= " AND d.dated BETWEEN '".$db->idate(dol_get_first_day($year,$month,false))."' AND '".$db->idate(dol_get_last_day($year,$month,false))."'";
+ else if ($year > 0 && ! empty($day))
+ $sql.= " AND d.dated BETWEEN '".$db->idate(dol_mktime(0, 0, 0, $month, $day, $year))."' AND '".$db->idate(dol_mktime(23, 59, 59, $month, $day, $year))."'";
+ else
+ $sql.= " AND date_format(d.dated, '%m') = '".$month."'";
+}
+else if ($year > 0)
+{
+ $sql.= " AND bc.date_bordereau BETWEEN '".$db->idate(dol_get_first_day($year,1,false))."' AND '".$db->idate(dol_get_last_day($year,12,false))."'";
+}
+
$sql.= $db->order($sortfield,$sortorder);
$sql.= $db->plimit($limit + 1, $offset);
@@ -97,7 +135,7 @@ if ($resql)
print "";
print_liste_field_titre($langs->trans("Ref"),$_SERVER["PHP_SELF"],"d.rowid","","&socid=$socid",'',$sortfield,$sortorder);
print_liste_field_titre($langs->trans("Type"),$_SERVER["PHP_SELF"],"d.type","","&socid=$socid",'',$sortfield,$sortorder);
- print_liste_field_titre($langs->trans("Date"),$_SERVER["PHP_SELF"],"d.dated","","&socid=$socid",'',$sortfield,$sortorder);
+ print_liste_field_titre($langs->trans("Date"),$_SERVER["PHP_SELF"],"d.dated","","&socid=$socid",'align="center"',$sortfield,$sortorder);
print_liste_field_titre($langs->trans("Person"),$_SERVER["PHP_SELF"],"u.lastname","","&socid=$socid",'',$sortfield,$sortorder);
print_liste_field_titre($langs->trans("Company"),$_SERVER["PHP_SELF"],"s.nom","","&socid=$socid",'',$sortfield,$sortorder);
print_liste_field_titre($langs->trans("FeesKilometersOrAmout"),$_SERVER["PHP_SELF"],"d.km","","&socid=$socid",'align="right"',$sortfield,$sortorder);
@@ -107,24 +145,27 @@ if ($resql)
// Filters lines
print '
';
print '| ';
- print '';
+ print '';
print ' | ';
print '';
- //print '';
+ print ' ';
+ print ' | ';
+ print '';
+ if (! empty($conf->global->MAIN_LIST_FILTER_ON_DAY)) print '';
+ print '';
+ $formother->select_year($year?$year:-1,'year',1, 20, 5);
print ' | ';
print '';
- //print '';
+ print '';
print ' | ';
- print '';
- print ' ';
+ print ' | ';
+ print '';
print ' | ';
print '';
- print ' ';
- print ' | ';
- print '';
- print ' ';
+ // print '';
print ' | ';
print '';
+ print '';
print " |
\n";
$var=true;
@@ -142,9 +183,9 @@ if ($resql)
// Type
print ''.$langs->trans($obj->type).' | ';
// Date
- print ''.dol_print_date($db->jdate($obj->dd),'day').' | ';
+ print ''.dol_print_date($db->jdate($obj->dd),'day').' | ';
// User
- print '';
+ print ' | ';
$userstatic->id = $obj->rowid;
$userstatic->lastname = $obj->lastname;
$userstatic->firstname = $obj->firstname;
diff --git a/htdocs/compta/dons/list.php b/htdocs/compta/dons/list.php
index badc71c96e2..174b5357bb2 100644
--- a/htdocs/compta/dons/list.php
+++ b/htdocs/compta/dons/list.php
@@ -43,12 +43,20 @@ if (! $sortfield) $sortfield="d.datedon";
$limit = $conf->liste_limit;
$statut=isset($_GET["statut"])?$_GET["statut"]:"-1";
-$search_ref=GETPOST('search_ref');
-$search_company=GETPOST('search_company');
-$search_name=GETPOST('search_name');
+$search_ref=GETPOST('search_ref','alpha');
+$search_company=GETPOST('search_company','alpha');
+$search_name=GETPOST('search_name','alpha');
+$search_amount = GETPOST('search_amount','alpha');
if (!$user->rights->don->lire) accessforbidden();
+if (GETPOST("button_removefilter"))
+{
+ $search_ref="";
+ $search_company="";
+ $search_name="";
+ $search_amount="";
+}
/*
* View
@@ -82,6 +90,8 @@ if (trim($search_name) != '')
{
$sql .= natural_search(array('d.lastname', 'd.firstname'), $search_name);
}
+if ($search_amount) $sql.=" AND d.amount='".$db->escape(price2num(trim($search_amount)))."'";
+
$sql.= $db->order($sortfield,$sortorder);
$sql.= $db->plimit($limit+1, $offset);
@@ -141,11 +151,10 @@ if ($resql)
print ' ';
print ' | ';
}
- print '';
- print ' ';
- print ' | ';
+ print ' | ';
print '';
- print " | \n";
+ print '';
+ print "\n";
$var=True;
while ($i < min($num,$limit))
diff --git a/htdocs/compta/paiement/cheque/list.php b/htdocs/compta/paiement/cheque/list.php
index 1699656acb1..47a6ee8ba74 100644
--- a/htdocs/compta/paiement/cheque/list.php
+++ b/htdocs/compta/paiement/cheque/list.php
@@ -38,6 +38,9 @@ $langs->load("bills");
if ($user->societe_id) $socid=$user->societe_id;
$result = restrictedArea($user, 'banque', '','');
+$search_ref = GETPOST('search_ref','int');
+$search_account = GETPOST('search_account','int');
+$search_amount = GETPOST('search_amount','alpha');
$sortfield = GETPOST("sortfield",'alpha');
$sortorder = GETPOST("sortorder",'alpha');
$page = GETPOST("page",'int');
@@ -57,6 +60,16 @@ $formother = new FormOther($db);
$checkdepositstatic=new RemiseCheque($db);
$accountstatic=new Account($db);
+// If click on purge search criteria ?
+if (GETPOST("button_removefilter_x"))
+{
+ $search_ref='';
+ $search_amount='';
+ $search_account='';
+ $year='';
+ $month='';
+}
+
/*
* View
*/
@@ -72,9 +85,9 @@ $sql.= " WHERE bc.fk_bank_account = ba.rowid";
$sql.= " AND bc.entity = ".$conf->entity;
// Search criteria
-if (GETPOST("search_ref")) $sql.=" AND bc.number=".GETPOST("search_ref",'int');
-if (GETPOST("search_account") > 0) $sql.=" AND bc.fk_bank_account=".GETPOST("search_account",'int');
-if (GETPOST("search_amount")) $sql.=" AND bc.amount=".price2num(GETPOST("search_amount"));
+if ($search_ref) $sql.=" AND bc.number=".$search_ref;
+if ($search_account > 0) $sql.=" AND bc.fk_bank_account=".$search_account;
+if ($search_amount) $sql.=" AND bc.amount='".$db->escape(price2num(trim($search_amount)))."'";
if ($month > 0)
{
if ($year > 0 && empty($day))
@@ -103,7 +116,7 @@ if ($resql)
print_barre_liste($langs->trans("MenuChequeDeposits"), $page, $_SERVER["PHP_SELF"], $params, $sortfield, $sortorder, '', $num);
- print '