Skip to content

Commit

Permalink
Merge branch '3.8' of git@github.com:Dolibarr/dolibarr.git into 3.9
Browse files Browse the repository at this point in the history
Conflicts:
	htdocs/core/class/html.formprojet.class.php
  • Loading branch information
eldy committed Jan 24, 2017
2 parents a47f3cb + f49552f commit 84fec7c
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions htdocs/core/class/html.formprojet.class.php
Expand Up @@ -135,13 +135,15 @@ function select_projects_list($socid=-1, $selected='', $htmlname='projectid', $m
// Search all projects
$sql = 'SELECT p.rowid, p.ref, p.title, p.fk_soc, p.fk_statut, p.public';
$sql.= ' FROM '.MAIN_DB_PREFIX .'projet as p';
$sql.= " WHERE p.entity = ".$conf->entity;
$sql.= " WHERE p.entity IN (".getEntity('project',1).")";
if ($projectsListId !== false) $sql.= " AND p.rowid IN (".$projectsListId.")";
if ($socid == 0) $sql.= " AND (p.fk_soc=0 OR p.fk_soc IS NULL)";
if ($socid > 0) $sql.= " AND (p.fk_soc=".$socid." OR p.fk_soc IS NULL)";
if (!empty($filterkey)) {
$sql .= " AND p.title LIKE '%".$this->db->escape($filterkey)."%'";
$sql .= " OR p.ref LIKE '%".$this->db->escape($filterkey)."%'";
$sql .= ' AND (';
$sql .= ' p.title LIKE "%'.$this->db->escape($filterkey).'%"';
$sql .= ' OR p.ref LIKE "%'.$this->db->escape($filterkey).'%"';
$sql .= ')';
}
$sql.= " ORDER BY p.ref ASC";

Expand Down

0 comments on commit 84fec7c

Please sign in to comment.