Merge from branch 1.3

This commit is contained in:
Michael RICOIS 2012-10-27 13:53:24 +00:00
commit 2301e706fb
2 changed files with 38 additions and 28 deletions

View File

@ -57,12 +57,14 @@ class FieldsController extends Zend_Controller_Action
$where = '';
$i = 0;
foreach ($queries as $item) {
if (strlen($item)>2) {
$where = 'LIKE "%'.strtolower($item).'%"';
}
$i++;
if (count($queries) < $i){
$where.= ' OR ';
if (empty($where)) {
$op = 'LIKE ';
} elseif ($i < count($queries)) {
$op = ' OR ';
}
if (strlen($item)>2) {
$where.= $op.'"%'.strtolower($item).'%"';
}
}
$sql->where("LOWER(lib) ".$where);
@ -97,12 +99,14 @@ class FieldsController extends Zend_Controller_Action
$where = '';
$i = 0;
foreach ($queries as $item) {
if (strlen($item)>2) {
$where.= 'LIKE "%'.strtolower($item).'%"';
}
$i++;
if (count($queries) < $i){
$where.= ' OR ';
if (empty($where)) {
$op = 'LIKE ';
} else {
$op = ' OR ';
}
if (strlen($item)>2) {
$where.= $op.'"%'.strtolower($item).'%"';
}
}
$sql->where("LOWER(NC) ".$where);
@ -122,12 +126,14 @@ class FieldsController extends Zend_Controller_Action
$where = '';
$i = 0;
foreach ($queries as $item) {
if (strlen($item)>2) {
$where.= 'LIKE "%'.strtolower($item).'%"';
}
$i++;
if (count($queries) < $i){
$where.= ' OR ';
if (empty($where)) {
$op = 'LIKE ';
} else {
$op = ' OR ';
}
if (strlen($item)>2) {
$where.= $op.'"%'.strtolower($item).'%"';
}
}
$sql->where("LOWER(libdep) ".$where);
@ -147,12 +153,14 @@ class FieldsController extends Zend_Controller_Action
$where = '';
$i = 0;
foreach ($queries as $item) {
if (strlen($item)>2) {
$where.= 'LIKE "%'.strtolower($item).'%"';
}
$i++;
if (count($queries) < $i){
$where.= ' OR ';
if (empty($where)) {
$op = 'LIKE ';
} else {
$op = ' OR ';
}
if (strlen($item)>2) {
$where.= $op.'"%'.strtolower($item).'%"';
}
}
$sql->where("LOWER(Commune) ".$where);
@ -191,13 +199,15 @@ class FieldsController extends Zend_Controller_Action
$where = '';
$i = 0;
foreach ($queries as $item) {
if (strlen($item)>3) {
$where = 'LIKE "%'.$item.'%"';
}
$i++;
if (count($queries) < $i){
$where.= ' OR ';
}
if (empty($where)) {
$op = 'LIKE ';
} else {
$op = ' OR ';
}
if (strlen($item)>3) {
$where.= $op.'"%'.strtolower($item).'%"';
}
}
$sql->where('LOWER(fjLibelle) '.$where);
}

View File

@ -68,6 +68,6 @@ elseif(isset($opts->install))
//Modification des permissions
passthru('chown -R www-data: '.APPLICATION_PATH.'/../');
passthru('chmod -x '.APPLICATION_PATH.'/../batch/cron.php');
passthru('chmod -x '.APPLICATION_PATH.'/../batch/enrichissement.php');
passthru('chmod +x '.APPLICATION_PATH.'/../batch/cron.php');
passthru('chmod +x '.APPLICATION_PATH.'/../batch/enrichissement.php');
}