FOP Under 2.5

I have been very happy using the FOP panel under all the versions prior to FreePBX 2.5. I have been able to manipulate the layouts so I can have up to 100 extensions showing, I moved the trunks, queues, and parking lots all the way to the right to make room for my smaller extension buttons. When an update that rewrote framework came out I just updated the op_buttons and op_style, along with the retrieve_op_conf_from_mysql files. Now it seems that all has changed. I see that the op_buttons is commented out and the info is auto generated in op_buttons_additional. I also note an additional set of commands in retrieve_op_conf_from_mysql. My problem is I can no longer manipulate these files. The retrieve_op_conf_from_mysql won’t let me change the rectangle size/locations, and even though I can take the entire op_buttons I designed and put it into op_buttons_custom, every time I make an admin change it rewrites it again. I also cannot move my smaller buttons over to make room for the 100 extensions I show on one page. What’s up? Where can I find these variables that force the change? I do not want to redesign every time I do a change in admin.

Do what I do and copy your modified files with a .bak extension like this:

cp op_style.cfg op_style.cfg.bak … do this for all your modified files and then create a script like this (mine is called restore.sh):

cp op_buttons.cfg.bak op_buttons.cfg
cp op_server.cfg.bak op_server.cfg
cp op_style.cfg.bak op_style.cfg
cp /var/lib/asterisk/bin/retrieve_op_conf_from_mysql.pl.bak /var/lib/asterisk/bin/retrieve_op_conf_from_mysql.pl
/var/lib/asterisk/bin/retrieve_op_conf_from_mysql.pl
amportal restart

Then every time you update FreePBX you can run your script (./restore.sh) and hey presto all fixed.

Colin

the following code is run in retrieve_conf after FOP has been changed:
[php]

<?php // run retrieve_conf_post_custom // If the following file exists, it will be run. This allows customization to be run automatically after the normal // processing. Caution should be taken using this as it is only deisgned for expert usage. Errors in the code will // have bad consequences and can cripple the system. // if (isset($amp_conf['AMPLOCALBIN'])) { $post_custom = $amp_conf['AMPLOCALBIN'].'/retrieve_conf_post_custom'; if (file_exists($post_custom)) { outn(sprintf(_("Found script %s, executing.."), $post_custom)); include($post_custom); out(_("OK")); } } [/php] also notice this after the reload process: [php] <?php if (isset($amp_conf["POST_RELOAD"]) && !empty($amp_conf['POST_RELOAD'])) { exec( $amp_conf["POST_RELOAD"], $output, $exit_val ); [/php] and before retrieve_conf is run: [php] <?php if (isset($amp_conf["PRE_RELOAD"]) && !empty($amp_conf['PRE_RELOAD'])) { exec( $amp_conf["PRE_RELOAD"], $output, $exit_val ); [/php] so there are multiple options. In the meantime, I know there are contributors looking at better ways to auto-generate but allow customization like we do in other parts of FreePBX. Feel free to join the effort and make some proposals that will help everyone and in the mean time, there should be enough hooks for you to automatically keep your system as you desire from the above options.

It seems that now in version 2.6 it is /var/lib/asterisk/bin/retrieve_op_conf_from_mysql.php that is called
by free pbx reload to regenerate fop layout. This file plus some style files need to be modified. If new version of freepbx is installed retrieve_op_conf_from_mysql.php must be modified again or the old version copied back (not elegant solution).

It would be great if someone wrote freepbx module to manage flash panel, the above could easily be converted into a template number 2. (more extensions). Additional templates would be easy to implement.
If anyone was interested, we would be happy to contribute (financially & testing only - we are not developers)

Following are changes to make FOP layout of 60 extensions, more queues and less confence buttons.
We changed button size, fonts, scaled buttons to make them smaller and fit into smaller button size.

  1. Create backup copies of files:
    cd /var/lib/asterisk/bin/
    cp -a retrieve_op_conf_from_mysql.php retrieve_op_conf_from_mysql.php.bak
    cd /var/www/panel # we use debian, on centos it is /var/www/html/panel I think
    cp -a op_lang_en.cfg op_lang_en.cfg.bak
    cp -a op_style.cfg op_style.cfg.bak

  2. Make following changes to files (below is in unified diff format for easy patching)

asterisk2: /var/lib/asterisk/bin

diff -u retrieve_op_conf_from_mysql.php.orig retrieve_op_conf_from_mysql.php

— retrieve_op_conf_from_mysql.php.orig 2009-09-12 05:41:07.000000000 +1000
+++ retrieve_op_conf_from_mysql.php 2009-11-08 05:14:34.877145314 +1100
@@ -25,11 +25,18 @@

TODO - add support in this code and in “panel” database for a layout for each panel context (amp user)

structure is - ID, Legend, startpos, stoppos, color1, color2

-$rectangle1 = array(“trunk”,“Trunks”, 53, 80, “10ff10”, “009900”);
-$rectangle2 = array(“extension”,“Extensions”, 1, 40, “1010ff”, “99cccc”);
-$rectangle3 = array(“parking”,“Parking lots”, 49, 72, “ffff10”, “cc9933”);
-$rectangle4 = array(“conference”,“Conferences”, 45, 68, “006666”, “00a010”);
-$rectangle5 = array(“queue”,“Queues”, 41, 64, “ff1010”, “a01000”);
+#$rectangle1 = array(“trunk”,“Trunks”, 53, 80, “10ff10”, “009900”);
+#$rectangle2 = array(“extension”,“Extensions”, 1, 40, “1010ff”, “99cccc”);
+#$rectangle3 = array(“parking”,“Parking lots”, 49, 72, “ffff10”, “cc9933”);
+#$rectangle4 = array(“conference”,“Conferences”, 45, 68, “006666”, “00a010”);
+#$rectangle5 = array(“queue”,“Queues”, 41, 64, “ff1010”, “a01000”);
+#$rectangles = array($rectangle1,$rectangle2,$rectangle3,$rectangle4,$rectangle5);
+
+$rectangle1 = array(“trunk”,“Trunks”, 73, 120, “10ff10”, “009900”);
+$rectangle2 = array(“extension”,“Extensions”, 1, 60, “1010ff”, “99cccc”);
+$rectangle3 = array(“parking”,“Parking lots”, 70, 112, “ffff10”, “cc9933”);
+$rectangle4 = array(“conference”,“Conferences”, 68, 109, “006666”, “00a010”);
+$rectangle5 = array(“queue”,“Queues”, 61, 107, “ff1010”, “a01000”);
$rectangles = array($rectangle1,$rectangle2,$rectangle3,$rectangle4,$rectangle5);

$rectmarginx = 1;
@@ -42,9 +49,11 @@
$layoutbuttonsonly = 1;

######## BUTTON INFO #########
-$buttonsizex = 246; # 1+244+1 from information in op_style.cfg
+#$buttonsizex = 246; # 1+244+1 from information in op_style.cfg
+$buttonsizex = 164; # 1+244+1 from information in op_style.cfg
$buttonsizey = 28; # 1+26+1 from information in op_style.cfg
-$numbuttonsx = 4;
+#$numbuttonsx = 4;
+$numbuttonsx = 6;
$numbuttonsy = 20;
$buttonsoriginx = -1;
$buttonsoriginy = 32;
@@ -54,11 +63,18 @@

NOTE - These values may be overwritten by the syleinfo function with values generated from the layout info

-$extenpos=“2-40”;
-$trunkpos=“53-60,72-80”;
-$parkingpos=“50-51,69-71”;
-$confepos=“46-48,65-68”;
-$queuepos=“42-44,61-64”;
+#$extenpos=“2-40”;
+#$trunkpos=“53-60,72-80”;
+#$parkingpos=“50-51,69-71”;
+#$confepos=“46-48,65-68”;
+#$queuepos=“42-44,61-64”;
+
+$extenpos=“2-60”;
+$trunkpos=“73-80,92-100,112-120”;
+$parkingpos=“71-72,91-92,111-112”;
+$confepos=“69-69,89-89,109-109”;
+$queuepos=“62-67,81-87,101-107”;
+

asterisk2: /var/www/panel

diff -u op_lang_en.cfg.orig op_lang_en.cfg

— op_lang_en.cfg.orig 2009-09-22 05:17:10.759264000 +1000
+++ op_lang_en.cfg 2009-11-08 13:40:14.079388373 +1100
@@ -9,7 +9,8 @@
unreachable=Not reachable $1
lagged=Lagged $1
newold=New $1, Old $2
-waitingonqueue=$1 user$2 waiting
+waitingonqueue=calls: $1
+;waitingonqueue=$1 user waiting $2
memberonconference=$1 participant$2
version_mismatch=Client/Server version mismatch!
; client side

asterisk2: /var/www/panel

diff -u op_style.cfg.orig op_style.cfg

— op_style.cfg.orig 2009-09-22 05:17:11.027165000 +1000
+++ op_style.cfg 2009-11-08 13:36:58.164143690 +1100
@@ -31,7 +31,8 @@
ledcolor_paused=0x000000

; Settings for the button (rectangle)
-btn_width=244
+;btn_width=244
+btn_width=162
btn_height=26
btn_padding=2
btn_line_width=2
@@ -42,12 +43,13 @@
btn_highlight_color=F79418

; Settings affecting the button label
-label_font_size=11
+label_font_size=10
label_font_family=Verdana ; only valid when use_embed_fonts is disabled
label_font_color=000000
label_shadow_color=dddddd
label_margin_top=0
-label_margin_left=35
+;label_margin_left=35
+label_margin_left=22
label_shadow=1
label_extent_x=40 ; If the label does not fit horizontally, increase this number
label_extent_y=0
@@ -55,58 +57,71 @@

; Settings affecting the button clid
clid_font_color=00dd00
-clid_font_size=11
-clid_centered=1
+clid_font_size=10
+clid_centered=0
+;clid_centered=1
clid_font_family=Verdana
clid_margin_top=11
-clid_margin_left=35
+;clid_margin_left=35
+clid_margin_left=10

; Settings for the timer
timer_font_color=4000ff
-timer_font_size=11
+timer_font_size=9
timer_font_family=Verdana
timer_margin_top=11
-timer_margin_left=160
+timer_margin_left=100

; Settings for the oval led
-led_scale=60
-led_margin_top=10
-led_margin_left=20
+;led_scale=60
+;led_margin_top=10
+;led_margin_left=20
+led_scale=40
+led_margin_top=7
+led_margin_left=15

; Settings for the arrow
-arrow_scale=60
+;arrow_scale=45
+arrow_scale=45
arrow_margin_top=5
arrow_margin_left=5

; Settings for MWI Icon
mail_margin_left=-40
mail_margin_top=13
-mail_scale=4
+;mail_scale=4
+mail_scale=3

; Settings for icons
icon1_margin_top=10
icon1_margin_left=-15
-icon1_scale=6
+;icon1_scale=6
+icon1_scale=4

icon2_margin_top=10
icon2_margin_left=-15
-icon2_scale=6
+;icon2_scale=6
+icon2_scale=4

icon3_margin_top=10
icon3_margin_left=-15
-icon3_scale=6
+;icon3_scale=6
+icon3_scale=4

icon4_margin_top=10
icon4_margin_left=-15
-icon4_scale=6
+;icon4_scale=6
+icon4_scale=4

icon5_margin_top=10
icon5_margin_left=-15
-icon5_scale=6
+;icon5_scale=6
+icon5_scale=4

icon6_margin_top=10
icon6_margin_left=-15
-icon6_scale=6
+;icon6_scale=6
+icon6_scale=4

; Settings for Status Bar at the top
show_security_code=1

  1. Save changes in freebpx administration panel and reload freepbx, then refresh flash panel
    and new layout should now be in effect.