Skip to content

Commit

Permalink
#17 [Hook] add: use limit conf before print project list
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolas-eoxia committed Mar 17, 2023
1 parent 5d5672e commit e6c52b6
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions class/actions_easycrm.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -136,8 +136,9 @@ public function addMoreRecentObjects(array $parameters, CommonObject $object, st

$projects = saturne_fetch_all_object_type('Project', 'DESC', 'datec', 0, 0, ['customsql' => 't.fk_soc = ' . $object->id]);
if (is_array($projects) && !empty($projects)) {
$nbProjects = count($projects);
$maxList = $conf->global->MAIN_SIZE_SHORTLIST_LIMIT;
$countProjects = 0;
$nbProjects = count($projects);
$maxList = $conf->global->MAIN_SIZE_SHORTLIST_LIMIT;

$out = '<div class="div-table-responsive-no-min">';
$out .= '<table class="noborder centpercent lastrecordtable">';
Expand All @@ -151,6 +152,11 @@ public function addMoreRecentObjects(array $parameters, CommonObject $object, st
$out .= '</tr>';

foreach ($projects as $project) {
if ($countProjects == $maxList) {
break;
} else {
$countProjects++;
}
$out .= '<tr class="oddeven">';
$out .= '<td class="nowraponall">';
$out .= $project->getNomUrl(1);
Expand Down

0 comments on commit e6c52b6

Please sign in to comment.