Skip to Content.
Sympa Menu

devel - [Patrick <patrick@alliance21.org>] Bug#146502: wwsympa shared documents : do not display useless columns (fix included)

Subject: Developers of Sympa

List archive

Chronological Thread  
  • From: address@concealed (Jérôme Marant)
  • To: address@concealed
  • Subject: [Patrick <address@concealed>] Bug#146502: wwsympa shared documents : do not display useless columns (fix included)
  • Date: Tue, 28 May 2002 21:57:33 +0200


Hi,

I think you've never been sent this bug report.

Cheers,


--- Begin Message ---
  • From: Patrick <address@concealed>
  • To: address@concealed
  • Subject: Bug#146502: wwsympa shared documents : do not display useless columns (fix included)
  • Date: Fri, 10 May 2002 16:28:15 +0200
  • Resent-cc: Jerome Marant <address@concealed>, address@concealed
  • Resent-date: Fri, 10 May 2002 14:33:06 GMT
  • Resent-from: Patrick <address@concealed>
  • Resent-to: address@concealed
Package: wwsympa
Version: 3.3.3-2
Severity: wishlist

Debian GNU/Linux testing

In the shared section, when listing files/dirs in a given directory,
there are always at right 3 columns (Edit,Delete,Access) even if
currently loged in user has none of these rights for none of these
files/dirs.
Columns are of course all empty, but it takes up a lot of space.

The 2 following patches fix that : the columns appear only if the
user has at least enough privilege for one of the files/dirs
displayed.

It was tested and appears to be ok.
(it was used at the same time with the other bugfixe sent
previously with the Description column)

Patch for wwsympa:
--- wwsympa.fcgi.orig Fri May 10 16:00:42 2002
+++ wwsympa.fcgi Fri May 10 16:23:47 2002
@@ -6157,6 +6157,7 @@
my $may, my $def_desc;
my $user = $param->{'user'}{'email'} || 'nobody';

+ my ($any_edit,$any_control)=(0,0);
foreach my $d (@dir) {

# current document
@@ -6229,6 +6230,8 @@
}
if ($may_control) {$subdirs{$d}{'control'} = 1;}
}
+ $any_edit||=($subdirs{$d}{'edit'} || 0);
+ $any_control||=($subdirs{$d}{'control'} || 0);

}else {
# case file
@@ -6344,11 +6347,17 @@
# size
$files{$d}{'size'} = (-s $path_doc)/1000;
}
+
+ $any_edit||=($files{$d}{'edit'} || 0);
+ $any_control||=($files{$d}{'control'} || 0);
}
}

closedir DIR;

+ $param->{any_edit}=$any_edit;
+ $param->{any_control}=$any_control;
+ $param->{nbcols}=5+2*($any_edit)+$any_control;

### Exception : index.html
if ($indexhtml) {



Patch for d_read.fr.tpl (same should be done for other template files)
--- d_read.fr.tpl.orig Fri May 10 16:27:22 2002
+++ d_read.fr.tpl Fri May 10 16:16:17 2002
@@ -84,13 +84,17 @@
</th>

<TD ALIGN="center"><font color="[bg_color]">Description</font></TD>
+ [IF any_edit]
<TD ALIGN="center"><font color="[bg_color]">Editer</font></TD>
<TD ALIGN="center"><font color="[bg_color]">Supprimer</font></TD>
+ [ENDIF]
+ [IF any_control]
<TD ALIGN="center"><font color="[bg_color]">Accès</font></TD></TR>
+ [ENDIF]

[IF empty]
<TR BGCOLOR="[light_color]">
- <TD COLSPAN=8 ALIGN="center"> Dossier vide </TD>
+ <TD COLSPAN=[nbcols] ALIGN="center"> Dossier vide </TD>
</TR>
[ELSE]
[IF sort_subdirs]
@@ -121,8 +125,10 @@
</FONT>
</center></TD>
[ELSE]
+ [IF any_edit]
<TD>&nbsp; </TD>
<TD>&nbsp; </TD>
+ [ENDIF]
[ENDIF]

[IF s->control]
@@ -134,7 +140,9 @@
</center>
</TD>
[ELSE]
+ [IF any_control]
<TD>&nbsp; </TD>
+ [ENDIF]
[ENDIF]
</TR>
[END]
@@ -189,7 +197,9 @@
</center>
</TD>
[ELSE]
+ [IF any_edit]
<TD>&nbsp; </TD> <TD>&nbsp; </TD>
+ [ENDIF]
[ENDIF]

[IF f->control]
@@ -199,7 +209,9 @@
</font>
</center></TD>
[ELSE]
+ [IF any_control]
<TD>&nbsp; </TD>
+ [ENDIF]
[ENDIF]
</TD>
</TR>



Patrick.


--- End Message ---


--
Jérôme Marant

http://marant.org



  • [Patrick <address@concealed>] Bug#146502: wwsympa shared documents : do not display useless columns (fix included), Jérôme Marant, 05/28/2002

Archive powered by MHonArc 2.6.19+.

Top of Page