Skip to content

Commit

Permalink
Merge branch 'develop' of https://github.com/dolibarr/dolibarr into d…
Browse files Browse the repository at this point in the history
…evelop
  • Loading branch information
eldy committed Apr 16, 2019
2 parents 8310e09 + 5c53044 commit 212b058
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 0 deletions.
24 changes: 24 additions & 0 deletions htdocs/comm/action/index.php
Expand Up @@ -1009,6 +1009,11 @@
}
}

// Sort events
foreach($eventarray as $keyDate => &$dateeventarray)
{
usort($dateeventarray, 'sort_events_by_date');
}


$maxnbofchar=0;
Expand Down Expand Up @@ -1701,3 +1706,22 @@ function dol_color_minus($color, $minus, $minusunit = 16)
}
return $newcolor;
}


/**
* Sort events by date
*
* @param object $a Event A
* @param object $b Event B
* @return int < 0 if event A should be before event B, > 0 otherwise, 0 if they have the exact same time slot
*/
function sort_events_by_date($a, $b)
{
if($a->datep != $b->datep)
{
return $a->datep - $b->datep;
}

// If both events have the same start time, longest first
return $b->datef - $a->datef;
}
1 change: 1 addition & 0 deletions htdocs/compta/sociales/list.php
Expand Up @@ -28,6 +28,7 @@
require_once DOL_DOCUMENT_ROOT.'/compta/sociales/class/chargesociales.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formsocialcontrib.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';

// Load translation files required by the page
$langs->loadLangs(array('compta', 'banks', 'bills'));
Expand Down

0 comments on commit 212b058

Please sign in to comment.