diff --git a/htdocs/product/stock/class/mouvementstock.class.php b/htdocs/product/stock/class/mouvementstock.class.php index c2621298833..33041df8645 100644 --- a/htdocs/product/stock/class/mouvementstock.class.php +++ b/htdocs/product/stock/class/mouvementstock.class.php @@ -1352,6 +1352,8 @@ class MouvementStock extends CommonObject $newtype = 3; } elseif ($this->type == 3) { $newtype = 2; + } else { + return -1; } $newqty = - $this->qty; diff --git a/htdocs/projet/list.php b/htdocs/projet/list.php index 6292e634a76..b45f81fe2e8 100644 --- a/htdocs/projet/list.php +++ b/htdocs/projet/list.php @@ -106,6 +106,7 @@ $pagenext = $page + 1; $search_all = GETPOST('search_all', 'alphanohtml'); $search_entity = GETPOSTINT('search_entity'); +$search_id = GETPOST("search_id", 'alpha'); $search_ref = GETPOST("search_ref", 'alpha'); $search_label = GETPOST("search_label", 'alpha'); $search_societe = GETPOST("search_societe", 'alpha'); @@ -396,6 +397,7 @@ if (empty($reshook)) { // Purge search criteria if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x', 'alpha') || GETPOST('button_removefilter', 'alpha')) { // All tests are required to be compatible with all browsers $search_all = ''; + $search_id = ""; $search_ref = ""; $search_label = ""; $search_societe = ""; @@ -635,6 +637,9 @@ if (!$user->hasRight('projet', 'all', 'lire')) { if ($socid > 0) { $sql .= " AND (p.fk_soc = ".((int) $socid).")"; // This filter if when we use a hard coded filter on company on url (not related to filter for external users) } +if ($search_id) { + $sql .= natural_search('p.rowid', $search_id, 1); +} if ($search_ref) { $sql .= natural_search('p.ref', $search_ref); } @@ -1066,6 +1071,9 @@ if (!empty($search_category_array)) { $param .= '&search_categegory_project_list[]='.urlencode($tmpval); } } +if ($search_id != '') { + $param .= '&search_id='.urlencode($search_id); +} if ($search_ref != '') { $param .= '&search_ref='.urlencode($search_ref); } @@ -1318,10 +1326,16 @@ if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) { print $searchpicto; print ''; } +// Project ID +if (!empty($arrayfields['p.rowid']['checked'])) { + print '