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 ''; + print ''; + print ''; +} // Project ref if (!empty($arrayfields['p.ref']['checked'])) { print ''; - print ''; + print ''; print ''; } // Project label @@ -1546,6 +1560,10 @@ if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) { print getTitleFieldOfList($selectedfields, 0, $_SERVER["PHP_SELF"], '', '', '', '', $sortfield, $sortorder, 'center maxwidthsearch ')."\n"; $totalarray['nbfield']++; } +if (!empty($arrayfields['p.rowid']['checked'])) { + print_liste_field_titre($arrayfields['p.rowid']['label'], $_SERVER["PHP_SELF"], "p.rowid", "", $param, "", $sortfield, $sortorder); + $totalarray['nbfield']++; +} if (!empty($arrayfields['p.ref']['checked'])) { print_liste_field_titre($arrayfields['p.ref']['label'], $_SERVER["PHP_SELF"], "p.ref", "", $param, "", $sortfield, $sortorder); $totalarray['nbfield']++; @@ -1958,7 +1976,16 @@ while ($i < $imaxinloop) { $totalarray['nbfield']++; } } - // Project url + // Project ID + if (!empty($arrayfields['p.rowid']['checked'])) { + print ''; + print $object->id; + print ''; + if (!$i) { + $totalarray['nbfield']++; + } + } + // Project ref url if (!empty($arrayfields['p.ref']['checked'])) { print ''; print $object->getNomUrl(1, (!empty(GETPOSTINT('search_usage_event_organization')) ? 'eventorganization' : ''));