Ticket #3236 (new Patches)

Opened 2 months ago

Last modified 4 weeks ago

Missing rectangles configurations for Panel_Context

Reported by: dinhtrung Assigned to: asternic
Priority: minor Milestone: 2.6
Component: Flash Operator Panel Version: SVN-HEAD
Keywords: Cc:
Confirmation: Need Feedback SVN Revision (if applicable):
Backend Engine: All Backend Engine Version:

Description

retrieve_op_conf_from_mysql.pl don't write rectangle information for department.

+++527,557+++
foreach my $row ( @queuerange ) {
		$btn=get_next_btn($queuepos,$btn);
		if ($btn eq 0) {last;}
		$queuename=@{$row}[0];
		$queuedesc=@{$row}[1];
		$icon='5';
		print EXTEN "[QUEUE/$queuename]\nPosition=$btn\nLabel=\"$queuedesc\"\nExtension=-1\nContext=from-internal\nIcon=$icon\nPanel_Context=$panelcontext\n";
	}

	### Write rectangles

	foreach my $rect ( @rectangles ) {
		my $comment = @{$rect}[0];
		my $color1 = @{$rect}[3];
		my $color2 = @{$rect}[4];
		my $start = @{$rect}[1];
		my $stop = @{$rect}[2];
		
		my $xposition = $buttonsizex * int(($start-1)/$numbuttonsy);
		my $yposition = $buttonsizey * (($start-1)%$numbuttonsy);
		my $xsize = $buttonsizex * (1 + int(($stop-1)/$numbuttonsy) - int(($start-1)/$numbuttonsy));
		my $ysize = $buttonsizey * (1 + (($stop-1)%$numbuttonsy) - (($start-1)%$numbuttonsy));
		
		$xsize -= 2;
		$ysize -= 2;
		
		$yposition += 32;
	
		print EXTEN "\n; $comment\n[rectangle]\nx=$xposition\ny=$yposition\nwidth=$xsize\nheight=$ysize\nline_width=0\nline_color=$color1\nfade_color1=$color1\nfade_color2=$color2\nrnd_border=2\nalpha=20\nlayer=bottom\n";
	}

The last print line should be like this:

print EXTEN "\n; $comment\n[rectangle]\nx=$xposition\ny=$yposition\nwidth=$xsize\nheight=$ysize\nline_width=0\nline_color=$color1\nfade_color1=$color1\nfade_color2=$color2\nrnd_border=2\nalpha=20\nlayer=bottom\nPanel_Context=$panelcontext\n";

Regards

Attachments

fop_error.gif (50.2 kB) - added by dinhtrung on 09/27/08 21:16:34.
Missing background rectangles
fop_orig.gif (114.8 kB) - added by dinhtrung on 09/27/08 21:17:29.
Original, with background rectangles - Only when logged in admin/admin

Change History

09/26/08 18:10:35 changed by p_lindheimer

  • confirmation changed from Unreviewed to Need Feedback.

could you please better explain what the problem is. I don't use FOP much so don't understand what you mean. I have applied your change and did not notice any difference but maybe once you explain better there is something subtle that I will notice. For now, waiting for a clarification.

Also - if possible, would be great if such changes were patch files for easier and less error prone checking of the patches. (you can just make your change in an svn pull and then generate the patch by typing "svn diff filename" or you can type "diff -ubB original_file modified_file > patch_file"

Thanks

09/27/08 00:35:54 changed by dinhtrung

Thanks, I don't know how to use diff to create svn patch file. :) The problem is, when you create administrators accounts, their FOP won't show those rectangles like in admin/admin account. I create a department named DEV for my development team. And when I log into that account and switch to FOP, the background rectangles are all vanish! That's because the retrieve_op_conf_from_mysql didn't write Panel_Context settings for them. Sorry, my English is no good.

09/27/08 08:00:45 changed by p_lindheimer

I still don't get it. I did the following:

  • create a limited FreePBX user using database authentication
  • log out from admin/admin
  • log in as joe/joe (limited user)
  • click on panel, fop looks fine
  • log out and back in as admin/admin
  • apply your patch
  • press "Apply Configuration Changes"
  • log out and back in as joe/joe
  • go to FOP, everything looks the same?

So apparently I am missing something. Can you comment on what I am not understanding and then also attach a screen shot of what is broken when you don't have that patch?

Can anyone else familiar with FOP add anything to help clarify this? (I'm happy to put the patch in once I understand it - since it doesn't seem to hurt anything either - but really want to see what is up first)

09/27/08 21:16:34 changed by dinhtrung

  • attachment fop_error.gif added.

Missing background rectangles

09/27/08 21:17:29 changed by dinhtrung

  • attachment fop_orig.gif added.

Original, with background rectangles - Only when logged in admin/admin

09/27/08 21:25:41 changed by dinhtrung

I add

[rectangles]
...
Panel_Context=$panelcontext
...

into the line that write rectangles settings, and those rectangles will show up in the background.

When use fop with context=ABC, it will show only components with Panel_Context=ABC in its configuration block. So, if you apply my patch, the rectangles will show up again.

09/27/08 21:32:26 changed by p_lindheimer

well I don't get anything like what you showed, so I must be missing something in my configuration to try and reproduce.

Can you explain very explicitly (step by step) how to configure this other user/context/what ever it is that makes yours do this. Are you referring to a FreePBX user in AUTHTYPE=database mode? Are there different voicemail contexts? Or ??? - I would like to reproduce the same behavior here so I can create the failure and understand what is going on better.

09/27/08 21:51:36 changed by p_lindheimer

another observation - the rectangle boxes from previous releases that were not auto-generated did not have the Panel_Context variable set either. (Not that those were correct either, just trying to see what is up here in my limited knowledge of FOP)

09/28/08 02:02:10 changed by dinhtrung

AUTHTYPE=database is necessary to have multiple administrators, right?

Ok, this is what I do:

1 - Change AUTHTYPE=none -> AUTHTYPE=database in /etc/amportal.conf

2 - Log in FreePBX as admin/admin, point to Administrators, and create an admin with User: test, Pass: 1234, Department: TEST, Extension Range: 200 - 400.

3 - Create some sample extension in this range: 100/100, 200/200, 300/300, 400/400

4 - Log out and Log in back with test/1234 and move to FOP through config.php

You can also query directly from your browser: If you want to show only the TEST department, then the query should like this:

http://localhost/panel/operator_panel.swf?context=TEST

Please re-check this issue.

10/01/08 17:00:15 changed by asternic

The previous version was using "Panel_Context=*" thus making the rectangles available to every context defined, even the GENERAL (default) context.

10/01/08 19:43:55 changed by dinhtrung

Is the rectangles the same for departments? If that's the case, I'll modify Panel_Context=*. After reading the code, the only thing change is the size of button, not the size of rectangles. Then maybe we should put Panel_Context=*?

10/04/08 17:05:45 changed by p_lindheimer

I'm waiting on those of you who know what should be there to make the decision and either put the change in (if you have svn access) or advise what we should do so we can properly address this.

10/18/08 08:49:12 changed by p_lindheimer

asternic, or someone else: what is the correct answer here, do we put it in or leave it out? ping.

10/22/08 00:43:14 changed by dinhtrung

I think this is the best solution: just group those rectangles by Panel_context=*, and move them out of the loop.

=== modified file 'freepbx/amp_conf/bin/retrieve_op_conf_from_mysql.pl'
--- freepbx/amp_conf/bin/retrieve_op_conf_from_mysql.pl	2008-10-06 11:22:17 +0000
+++ freepbx/amp_conf/bin/retrieve_op_conf_from_mysql.pl	2008-10-22 07:40:01 +0000
@@ -548,9 +548,9 @@
 		$queuedesc=@{$row}[1];
 		$icon='5';
 		print EXTEN "[QUEUE/$queuename]\nPosition=$btn\nLabel=\"$queuedesc\"\nExtension=-1\nContext=from-internal\nIcon=$icon\nPanel_Context=$panelcontext\n";
-	}
-
-	### Write rectangles
+	}	
+}
+### Write rectangles
 
 	foreach my $rect ( @rectangles ) {
 		my $comment = @{$rect}[0];
@@ -569,7 +569,7 @@
 		
 		$yposition += 32;
 	
-		print EXTEN "\n; $comment\n[rectangle]\nx=$xposition\ny=$yposition\nwidth=$xsize\nheight=$ysize\nline_width=0\nline_color=$color1\nfade_color1=$color1\nfade_color2=$color2\nrnd_border=2\nalpha=20\nlayer=bottom\nPanel_Context=$panelcontext\n";
+		print EXTEN "\n; $comment\n[rectangle]\nx=$xposition\ny=$yposition\nwidth=$xsize\nheight=$ysize\nline_width=0\nline_color=$color1\nfade_color1=$color1\nfade_color2=$color2\nrnd_border=2\nalpha=20\nlayer=bottom\nPanel_Context=*\n";
 	}
 
 	### Write legends
@@ -584,10 +584,9 @@
 		$xposition += 3;
 		$yposition += 32;
 	
-		print EXTEN "\n[LEGEND]\nx=$xposition\ny=$yposition\ntext=$text\nfont_size=18\nfont_family=Arial\nuse_embed_fonts=1\nPanel_Context=$panelcontext\n";
+		print EXTEN "\n[LEGEND]\nx=$xposition\ny=$yposition\ntext=$text\nfont_size=18\nfont_family=Arial\nuse_embed_fonts=1\nPanel_Context=*\n";
 	}
 	
-}
 
 sub get_next_btn {
 	my $data = shift;

10/25/08 12:35:14 changed by p_lindheimer

  • milestone changed from 2.5 to 2.6.

moving to next milestone since 2.5 is closed - and still waiting until there is consensus with those knowledgeable with FOP on what the right solution is (since I'm not in a position to judge which of these answers are correct.

Donate



Support
Download
Develop
Forums
News
Documentation
Paid Support
About

Paid Ads