/[smecontribs]/rpms/phpki/contribs9/phpki-0.82-fix-dates-3.patch
ViewVC logotype

Annotation of /rpms/phpki/contribs9/phpki-0.82-fix-dates-3.patch

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.1 - (hide annotations) (download)
Thu Apr 2 12:39:02 2020 UTC (4 years, 7 months ago) by jcrisp
Branch: MAIN
CVS Tags: phpki-0_82-23_el6_sme, HEAD
* Thu Apr 02 2020 John Crisp <jcrisp@safeandsoundit.co.uk> 0.82-23.sme
- Add secondary date sort after Status sort

1 jcrisp 1.1 diff -ruN phpki.old/phpki-0.82/include/my_functions.php phpki/phpki-0.82/include/my_functions.php
2     --- phpki.old/phpki-0.82/include/my_functions.php 2020-04-02 14:27:14.041463385 +0200
3     +++ phpki/phpki-0.82/include/my_functions.php 2020-04-02 14:28:41.770684362 +0200
4     @@ -73,17 +73,25 @@
5     #
6     # Sort a two multidimensional array by one of it's columns
7     #
8     -function csort($array, $column, $ascdec=SORT_ASC){
9     - if (sizeof($array) == 0) return $array;
10     +function csort($array, $column, $ascdec=SORT_ASC){
11    
12     - // Sort by digital date rather than text date
13     - if ($column == 'issued') $column = "issuedSort";
14     - if ($column == 'expires') $column = 'expiresSort';
15     + if (sizeof($array) == 0) return $array;
16    
17     - foreach($array as $x) $sortarr[]=$x[$column];
18     - array_multisort($sortarr, $ascdec, $array);
19     -
20     - return $array;
21     + // Sort by digital date rather than text date
22     + if ($column == 'issued') $column = "issuedSort";
23     + if ($column == 'expires') $column = 'expiresSort';
24     +
25     + if ($column == 'status') {
26     + foreach($array as $x) {
27     + $sortarr[]=$x[$column];
28     + $sortdate[] = $x['expiresSort'];
29     + }
30     + array_multisort($sortarr, $ascdec, $sortdate, SORT_ASC, $array);
31     + } else {
32     + foreach($array as $x) $sortarr[]=$x[$column];
33     + array_multisort($sortarr, $ascdec, $array);
34     + }
35     + return $array;
36     }
37    
38    

admin@koozali.org
ViewVC Help
Powered by ViewVC 1.2.1 RSS 2.0 feed