Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Show only open projects on short list #32644

Open
wants to merge 4 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion htdocs/core/lib/security.lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -245,10 +245,10 @@
* Use 'md5' if hash is not needed for security purpose. For security need, prefer 'auto'.
* @param int $nosalt Do not include any salt
* @param int $mode 0=Return encoded password, 1=Return array with encoding password + encoding algorithm
* @return string|array<pass_encrypted:string,pass_encoding:string> Hash of string or array with pass_encrypted and pass_encoding
* @return string|array(pass_encrypted:string,pass_encoding:string) Hash of string or array with pass_encrypted and pass_encoding

Check failure on line 248 in htdocs/core/lib/security.lib.php

View workflow job for this annotation

GitHub Actions / phpstan / php-stan (8.2)

PHPDoc tag @return has invalid value (string|array(pass_encrypted:string,pass_encoding:string) Hash of string or array with pass_encrypted and pass_encoding): Unexpected token "(", expected TOKEN_HORIZONTAL_WS at offset 1211 on line 18

Check warning on line 248 in htdocs/core/lib/security.lib.php

View workflow job for this annotation

GitHub Actions / phan / Run phan

security.lib.php: PhanUnextractableAnnotationSuffix: Saw a token Phan may have failed to parse after '* @return string|array(pass_encrypted:string,pass_encoding:string) Hash of string or array with pass_encrypted and pass_encoding': after string|array, saw '('
* @see getRandomPassword(), dol_verifyHash()
*/
function dol_hash($chain, $type = '0', $nosalt = 0, $mode = 0)

Check failure on line 251 in htdocs/core/lib/security.lib.php

View workflow job for this annotation

GitHub Actions / phpstan / php-stan (8.2)

Function dol_hash() has no return type specified.
{
// No need to add salt for password_hash
if (($type == '0' || $type == 'auto') && getDolGlobalString('MAIN_SECURITY_HASH_ALGO') == 'password_hash' && function_exists('password_hash')) {
Expand Down
3 changes: 3 additions & 0 deletions htdocs/langs/en_US/projects.lang
Original file line number Diff line number Diff line change
Expand Up @@ -312,3 +312,6 @@ TaskMergeSuccess=Tasks have been merged
ErrorTaskIdIsMandatory=Error: Task id is mandatory
ErrorsTaskMerge=An error occurred while merging tasks
Billable = Billable
PROJECT_SHOW_ONLY_VALIDATED_ON_LATEST_UPDATE_help=By default dolibarr displays all projects (draft, closed, open) on project index page ("latest projects short list"). With that option dolibarr will display only validated projects to make a more concise list.
PROJECT_SHOW_ONLY_VALIDATED_ON_LATEST_UPDATE=Display only validated projects on short list

10 changes: 10 additions & 0 deletions htdocs/projet/admin/project.php
Original file line number Diff line number Diff line change
Expand Up @@ -872,6 +872,16 @@
print '</td>';
print '</tr>';


print '<tr class="oddeven">';
print '<td class="left">';
print $form->textwithpicto($langs->transnoentities('PROJECT_SHOW_ONLY_VALIDATED_ON_LATEST_UPDATE'), $langs->transnoentities('PROJECT_SHOW_ONLY_VALIDATED_ON_LATEST_UPDATE_help'));
print '</td>';
print '<td class="right" colspan="2">';
print ajax_constantonoff('PROJECT_SHOW_ONLY_VALIDATED_ON_LATEST_UPDATE');
print '</td>';
print '</tr>';

print '</table>';
print '</div>';

Expand Down
4 changes: 4 additions & 0 deletions htdocs/projet/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,10 @@
if ($socid) {
$sql .= " AND (p.fk_soc IS NULL OR p.fk_soc = 0 OR p.fk_soc = ".((int) $socid).")";
}
if (getDolGlobalInt('PROJECT_SHOW_ONLY_VALIDATED_ON_LATEST_UPDATE', 0) == 1) {
$sql .= " AND p.fk_statut=" . (int) Project::STATUS_VALIDATED;
}

$sql .= " ORDER BY p.tms DESC";
$sql .= $db->plimit($max, 0);

Expand Down
Loading