/[smecontribs]/rpms/smeserver-freepbx/contribs9/smeserver-freepbx-0.1-Sme9Ast13Fpbx13-4.patch
ViewVC logotype

Annotation of /rpms/smeserver-freepbx/contribs9/smeserver-freepbx-0.1-Sme9Ast13Fpbx13-4.patch

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


Revision 1.2 - (hide annotations) (download)
Mon Jun 13 12:16:45 2016 UTC (7 years, 11 months ago) by unnilennium
Branch: MAIN
CVS Tags: HEAD
Changes since 1.1: +0 -0 lines
FILE REMOVED
bump to version 13

1 unnilennium 1.1 diff -Nur smeserver-freepbx-0.1.old/createlinks smeserver-freepbx-0.1/createlinks
2     --- smeserver-freepbx-0.1.old/createlinks 2016-05-15 12:24:17.702000000 -0400
3     +++ smeserver-freepbx-0.1/createlinks 2016-05-15 12:28:51.366000000 -0400
4     @@ -25,7 +25,7 @@
5     # Panel links
6    
7     panel_link("freepbx", 'manager');
8     -panel_link("fop", 'manager');
9     +#panel_link("fop", 'manager');
10    
11     # Events links
12    
13     @@ -40,7 +40,7 @@
14     templates2events("/etc/e-smith/sql/init/30freepbx_mysql_create_database", qw(freepbx-update bootstrap-console-save));
15    
16     event_link("freepbx-checkinstall", $event, "10");
17     -event_link("freepbx-applypatch", $event, "20");
18     +#event_link("freepbx-applypatch", $event, "20");
19     event_link("freepbx-clean-crontab", $event, "40");
20     event_link("freepbx-dump-astdb", "pre-backup", "30");
21    
22     diff -Nur smeserver-freepbx-0.1.old/root/etc/e-smith/events/actions/freepbx-applypatch smeserver-freepbx-0.1/root/etc/e-smith/events/actions/freepbx-applypatch
23     --- smeserver-freepbx-0.1.old/root/etc/e-smith/events/actions/freepbx-applypatch 2008-08-13 07:17:17.000000000 -0400
24     +++ smeserver-freepbx-0.1/root/etc/e-smith/events/actions/freepbx-applypatch 1969-12-31 19:00:00.000000000 -0500
25     @@ -1,20 +0,0 @@
26     -#!/bin/bash
27     -
28     -# This script will apply some patchs for freepbx on SME server
29     -
30     -# This patch remove the redirection in fop index so it can work with a proxypass directive
31     -if [ -e /usr/share/freepbx/patchs/fop_index_amp.proxypass.patch ]; then
32     - patch -N /opt/freepbx/panel/index_amp.php /usr/share/freepbx/patchs/fop_index_amp.proxypass.patch
33     -fi
34     -
35     -# Same for index.php
36     -if [ -e /usr/share/freepbx/patchs/fop_index.proxypass.patch ]; then
37     - patch -N /opt/freepbx/panel/index.php /usr/share/freepbx/patchs/fop_index.proxypass.patch
38     -fi
39     -
40     -
41     -# Patch to enable FOP Layout module
42     -if [ -e /usr/share/freepbx/patchs/retrieve_op_conf_from_mysql.layout.patch ]; then
43     - patch -N /var/lib/asterisk/bin/retrieve_op_conf_from_mysql.pl /usr/share/freepbx/patchs/retrieve_op_conf_from_mysql.layout.patch
44     -fi
45     -
46     diff -Nur smeserver-freepbx-0.1.old/root/etc/e-smith/web/functions/fop smeserver-freepbx-0.1/root/etc/e-smith/web/functions/fop
47     --- smeserver-freepbx-0.1.old/root/etc/e-smith/web/functions/fop 2008-08-04 09:17:11.000000000 -0400
48     +++ smeserver-freepbx-0.1/root/etc/e-smith/web/functions/fop 1969-12-31 19:00:00.000000000 -0500
49     @@ -1,31 +0,0 @@
50     -#!/usr/bin/perl
51     -#----------------------------------------------------------------------
52     -# heading : Telephony
53     -# description : Flash Operator Panel
54     -# navigation : 4000 4200
55     -#----------------------------------------------------------------------
56     -
57     -use strict;
58     -use CGI':all';
59     -use CGI::Carp qw(fatalsToBrowser);
60     -
61     -
62     -BEGIN
63     -{
64     - $ENV {'PATH'} = '/bin:/usr/bin:/sbin';
65     - $ENV {'SHELL'} = '/bin/bash';
66     - delete $ENV {'ENV'};
67     -}
68     -
69     -
70     -my $q = new CGI;
71     -my $content="0; url=https://".$ENV {'HTTP_X_FORWARDED_HOST'}."/freepbx/panel";
72     -$q->default_dtd('-//W3C//DTD XHTML 1.0 Transitional//EN');
73     -
74     -print $q->header ('text/html');
75     -print $q->start_html (-head=>meta({-http_equiv=>'refresh', -content=>$content}));
76     -
77     -
78     -
79     -print $q->end_html;
80     -
81     diff -Nur smeserver-freepbx-0.1.old/root/usr/share/freepbx/patchs/fop_index_amp.proxypass.patch smeserver-freepbx-0.1/root/usr/share/freepbx/patchs/fop_index_amp.proxypass.patch
82     --- smeserver-freepbx-0.1.old/root/usr/share/freepbx/patchs/fop_index_amp.proxypass.patch 2008-08-04 09:17:11.000000000 -0400
83     +++ smeserver-freepbx-0.1/root/usr/share/freepbx/patchs/fop_index_amp.proxypass.patch 1969-12-31 19:00:00.000000000 -0500
84     @@ -1,19 +0,0 @@
85     ---- /opt/freepbx/panel/index_amp.php.orig 2008-07-23 20:33:40.000000000 +0200
86     -+++ /opt/freepbx/panel/index_amp.php 2008-07-23 22:58:14.000000000 +0200
87     -@@ -16,11 +16,11 @@
88     - $amp_conf["AMPWEBADDRESS"] = $_SERVER["HTTP_HOST"];
89     - }
90     -
91     --if ($_SERVER["HTTP_HOST"] != $amp_conf["AMPWEBADDRESS"]) {
92     -- $proto = ((isset($_SERVER["HTTPS"]) && ($_SERVER["HTTPS"] == "on")) ? "https" : "http");
93     -- header("Location: ".$proto."://".$amp_conf["AMPWEBADDRESS"].$_SERVER["REQUEST_URI"]);
94     -- exit;
95     --}
96     -+//if ($_SERVER["HTTP_HOST"] != $amp_conf["AMPWEBADDRESS"]) {
97     -+// $proto = ((isset($_SERVER["HTTPS"]) && ($_SERVER["HTTPS"] == "on")) ? "https" : "http");
98     -+// header("Location: ".$proto."://".$amp_conf["AMPWEBADDRESS"].$_SERVER["REQUEST_URI"]);
99     -+// exit;
100     -+//}
101     -
102     - ?>
103     - <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
104     diff -Nur smeserver-freepbx-0.1.old/root/usr/share/freepbx/patchs/fop_index.proxypass.patch smeserver-freepbx-0.1/root/usr/share/freepbx/patchs/fop_index.proxypass.patch
105     --- smeserver-freepbx-0.1.old/root/usr/share/freepbx/patchs/fop_index.proxypass.patch 2008-08-04 09:17:11.000000000 -0400
106     +++ smeserver-freepbx-0.1/root/usr/share/freepbx/patchs/fop_index.proxypass.patch 1969-12-31 19:00:00.000000000 -0500
107     @@ -1,19 +0,0 @@
108     ---- /opt/freepbx/panel/index.php.orig 2008-07-23 20:33:40.000000000 +0200
109     -+++ /opt/freepbx/panel/index.php 2008-07-23 23:12:37.000000000 +0200
110     -@@ -15,11 +15,11 @@
111     - if ($amp_conf["AMPWEBADDRESS"] == "")
112     - {$amp_conf["AMPWEBADDRESS"] = $_SERVER["HTTP_HOST"];}
113     -
114     --if ($_SERVER["HTTP_HOST"] != $amp_conf["AMPWEBADDRESS"]) {
115     -- $proto = ((isset($_SERVER["HTTPS"]) && ($_SERVER["HTTPS"] == "on")) ? "https" : "http");
116     -- header("Location: ".$proto."://".$amp_conf["AMPWEBADDRESS"].$_SERVER["REQUEST_URI"]);
117     -- exit;
118     --}
119     -+//if ($_SERVER["HTTP_HOST"] != $amp_conf["AMPWEBADDRESS"]) {
120     -+// $proto = ((isset($_SERVER["HTTPS"]) && ($_SERVER["HTTPS"] == "on")) ? "https" : "http");
121     -+// header("Location: ".$proto."://".$amp_conf["AMPWEBADDRESS"].$_SERVER["REQUEST_URI"]);
122     -+// exit;
123     -+//}
124     -
125     - ?>
126     - <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
127     diff -Nur smeserver-freepbx-0.1.old/root/usr/share/freepbx/patchs/retrieve_op_conf_from_mysql.layout.patch smeserver-freepbx-0.1/root/usr/share/freepbx/patchs/retrieve_op_conf_from_mysql.layout.patch
128     --- smeserver-freepbx-0.1.old/root/usr/share/freepbx/patchs/retrieve_op_conf_from_mysql.layout.patch 2008-08-14 10:51:07.000000000 -0400
129     +++ smeserver-freepbx-0.1/root/usr/share/freepbx/patchs/retrieve_op_conf_from_mysql.layout.patch 1969-12-31 19:00:00.000000000 -0500
130     @@ -1,215 +0,0 @@
131     ---- before/retrieve_op_conf_from_mysql.pl 2008-08-04 08:58:50.000000000 +0100
132     -+++ after/retrieve_op_conf_from_mysql.pl 2008-08-01 10:04:51.000000000 +0100
133     -@@ -28,24 +28,38 @@ if (scalar @ARGV == 2)
134     -
135     - ######## LAYOUT INFO #########
136     -
137     --# This layout info should really be in a "panel" table in the freepbx database
138     -+# NOTE - These values may be overwritten by values in a table in the freepbx database named "panel"
139     -
140     --# structure is - Legend, startpos, stoppos, color1, color2
141     --@rectangle1 = ("Trunks", 53, 80, "10ff10", "009900");
142     --@rectangle2 = ("Extensions", 1, 40, "1010ff", "099cccc");
143     --@rectangle3 = ("Parking lots", 49, 72, "ffff10", "cc9933");
144     --@rectangle4 = ("Conferences", 45, 68, "006666", "a01000");
145     --@rectangle5 = ("Queues", 41, 64, "ff1010", "a01000");
146     -+# structure is - ID, Legend, startpos, stoppos, color1, color2
147     -+@rectangle1 = ("trunk","Trunks", 53, 80, "10ff10", "009900");
148     -+@rectangle2 = ("extension","Extensions", 1, 40, "1010ff", "99cccc");
149     -+@rectangle3 = ("parking","Parking lots", 49, 72, "ffff10", "cc9933");
150     -+@rectangle4 = ("conference","Conferences", 45, 68, "006666", "00a010");
151     -+@rectangle5 = ("queue","Queues", 41, 64, "ff1010", "a01000");
152     - @rectangles = (\@rectangle1,\@rectangle2,\@rectangle3,\@rectangle4,\@rectangle5);
153     -
154     -+$rectmarginx = 1;
155     -+$rectmarginy = 1;
156     -+$legendoffsetx = 3;
157     -+$legendoffsety = 1;
158     -+
159     -+# $layoutbuttonsonly = 0 : allow display of buttons even if no corresponding layout info
160     -+# $layoutbuttonsonly = 1 : suppress display of buttons if no corresponding layout info
161     -+$layoutbuttonsonly = 1;
162     -+
163     - ######## BUTTON INFO #########
164     - $buttonsizex = 246; # 1+244+1 from information in op_style.cfg
165     - $buttonsizey = 28; # 1+26+1 from information in op_style.cfg
166     - $numbuttonsx = 4;
167     - $numbuttonsy = 20;
168     -+$buttonsoriginx = -1;
169     -+$buttonsoriginy = 32;
170     -
171     -
172     - ######## STYLE INFO #########
173     -+
174     -+# NOTE - These values may be overwritten by the syleinfo function with values generated from the layout info
175     -+
176     - $extenpos="2-40";
177     - #$trunkpos="52-60,71-80";
178     - #$confepos="";
179     -@@ -59,13 +73,6 @@ $queuepos="42-44,61-64";
180     -
181     - # End of changes
182     -
183     --#automated generation of style-info
184     --$extenpos=styleinfo("Extensions");
185     --$trunkpos=styleinfo("Trunks");
186     --$parkingpos=styleinfo("Parking lots");
187     --$confepos=styleinfo("Conferences");
188     --$queuepos=styleinfo("Queues");
189     --
190     -
191     - # Remove or add Zap trunks as needed
192     - # Note: ZAP/* will match any ZAP channel that *is not referenced* in another button (ie: extensions)
193     -@@ -233,6 +240,34 @@ elsif ( $db_engine eq "sqlite3" ) {
194     - $dbh = DBI->connect("dbi:SQLite:dbname=$db_file","","");
195     - }
196     -
197     -+# Get layout-info from a "panel" table in the freepbx database
198     -+if (table_exists($dbh,"panel")) {
199     -+ $statement = "SELECT id, legend, startpos, stoppos, color1, color2 from panel";
200     -+ $result = $dbh->selectall_arrayref($statement);
201     -+ @resultSet = @{$result};
202     -+ if ( $#resultSet == -1 ) {
203     -+ print "Notice: no panel defined\n";
204     -+ }
205     -+ push(@panellist, @{ $result });
206     -+ @rectangles = @panellist;
207     -+}
208     -+
209     -+# Automated generation of style-info from layout-info
210     -+$autoextenpos=styleinfo("extension");
211     -+$autotrunkpos=styleinfo("trunk");
212     -+$autoparkingpos=styleinfo("parking");
213     -+$autoconfepos=styleinfo("conference");
214     -+$autoqueuepos=styleinfo("queue");
215     -+
216     -+if ($layoutbuttonsonly == 1) {$extenpos = $trunkpos = $parkingpos = $confepos = $queuepos = ""}
217     -+
218     -+if (defined($autoextenpos)) {$extenpos = $autoextenpos;}
219     -+if (defined($autotrunkpos)) {$trunkpos = $autotrunkpos;}
220     -+if (defined($autoparkingpos)) {$parkingpos = $autoparkingpos;}
221     -+if (defined($autoconfepos)) {$confepos = $autoconfepos;}
222     -+if (defined($autoqueuepos)) {$queuepos = $autoqueuepos;}
223     -+
224     -+
225     - open( EXTEN, ">$op_conf" ) or die "Cannot create/overwrite config file: $op_conf ($!)\n";
226     - print EXTEN $warning_banner;
227     -
228     -@@ -537,35 +572,42 @@ foreach my $pcontext ( @ampusers ) {
229     -
230     - foreach my $rect ( @rectangles ) {
231     - my $comment = @{$rect}[0];
232     -- my $color1 = @{$rect}[3];
233     -- my $color2 = @{$rect}[4];
234     -- my $start = @{$rect}[1];
235     -- my $stop = @{$rect}[2];
236     -+ my $color1 = @{$rect}[4];
237     -+ my $color2 = @{$rect}[5];
238     -+ my $start = @{$rect}[2];
239     -+ my $stop = @{$rect}[3];
240     -
241     -- my $xposition = $buttonsizex * int(($start-1)/$numbuttonsy);
242     -- my $yposition = $buttonsizey * (($start-1)%$numbuttonsy);
243     -+ my $xposition = $buttonsoriginx + $buttonsizex * int(($start-1)/$numbuttonsy);
244     -+ my $yposition = $buttonsoriginy + $buttonsizey * (($start-1)%$numbuttonsy);
245     - my $xsize = $buttonsizex * (1 + int(($stop-1)/$numbuttonsy) - int(($start-1)/$numbuttonsy));
246     - my $ysize = $buttonsizey * (1 + (($stop-1)%$numbuttonsy) - (($start-1)%$numbuttonsy));
247     -+
248     -+ if (($xsize <= 0) || ($ysize <= 0)) {next;}
249     -
250     -- $xsize -= 2;
251     -- $ysize -= 2;
252     -+ $xposition += $rectmarginx;
253     -+ $yposition += $rectmarginy;
254     -+ $xsize -= 2 * $rectmarginx;
255     -+ $ysize -= 2 * $rectmarginy;
256     -
257     -- $yposition += 32;
258     --
259     - 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";
260     - }
261     -
262     - ### Write legends
263     -
264     - foreach my $legend ( @rectangles ) {
265     -- my $text = @{$legend}[0];
266     -- my $start = @{$legend}[1];
267     -+ my $text = @{$legend}[1];
268     -+ my $start = @{$legend}[2];
269     -+ my $stop = @{$legend}[3];
270     -
271     -- my $xposition = $buttonsizex * int(($start-1)/$numbuttonsy);
272     -- my $yposition = $buttonsizey * (($start-1)%$numbuttonsy);
273     -+ my $xposition = $buttonsoriginx + $buttonsizex * int(($start-1)/$numbuttonsy);
274     -+ my $yposition = $buttonsoriginy + $buttonsizey * (($start-1)%$numbuttonsy);
275     -+ my $xsize = $buttonsizex * (1 + int(($stop-1)/$numbuttonsy) - int(($start-1)/$numbuttonsy));
276     -+ my $ysize = $buttonsizey * (1 + (($stop-1)%$numbuttonsy) - (($start-1)%$numbuttonsy));
277     -+
278     -+ if (($xsize <= 0) || ($ysize <= 0)) {next;}
279     -
280     -- $xposition += 3;
281     -- $yposition += 32;
282     -+ $xposition += $legendoffsetx;
283     -+ $yposition += $legendoffsety;
284     -
285     - print EXTEN "\n[LEGEND]\nx=$xposition\ny=$yposition\ntext=$text\nfont_size=18\nfont_family=Arial\nuse_embed_fonts=1\n";
286     - }
287     -@@ -581,7 +623,7 @@ sub get_next_btn {
288     - foreach $range (@rangelist) {
289     - @rangeval=split("-",$range);
290     - return $rangeval[0] if $last < $rangeval[0];
291     -- return $last+1 if $last < $rangeval[1];
292     -+ return $last+1 if defined($rangeval[1]) && ($last < $rangeval[1]);
293     - #Need to try another range def...
294     - }
295     - #If we get here, we ran out of positions :(
296     -@@ -625,36 +667,39 @@ sub by_lastname {
297     -
298     -
299     - sub styleinfo {
300     -- my $legend = shift;
301     -+ my $id = shift;
302     -+ my $retval;
303     - foreach my $rect ( @rectangles ) {
304     -- if ($legend eq @{$rect}[0]) {
305     -+ if ($id eq @{$rect}[0]) {
306     -
307     -- my $start = @{$rect}[1];
308     -- my $stop = @{$rect}[2];
309     -+ my $start = @{$rect}[2];
310     -+ my $stop = @{$rect}[3];
311     -
312     - my $xposition = int(($start-1)/$numbuttonsy);
313     - my $yposition = (($start-1)%$numbuttonsy);
314     -- my $xsize = int(($stop-1)/$numbuttonsy) - int(($start-1)/$numbuttonsy);
315     -- my $ysize = (($stop-1)%$numbuttonsy) - (($start-1)%$numbuttonsy);
316     -+ my $xsize = 1 + int(($stop-1)/$numbuttonsy) - int(($start-1)/$numbuttonsy);
317     -+ my $ysize = 1 + (($stop-1)%$numbuttonsy) - (($start-1)%$numbuttonsy);
318     -
319     -+ if (($xsize <= 0) || ($ysize <= 0)) {print "Warning: rectange '$id' has negative area\n"; last;}
320     - $styleinfo = "";
321     - if ($ysize > 2) {
322     -- $styleinfo .= ($start + 1) . "-" . ($start + $ysize) . ",";
323     -+ $styleinfo .= ($start + 1) . "-" . ($start + $ysize - 1) . ",";
324     - }
325     - elsif ($ysize == 2) {
326     - $styleinfo .= ($start + 1) . ",";
327     - }
328     -
329     -- for (my $i = 1 ; $i <= $xsize ; $i++ ) {
330     -+ for (my $i = 1 ; $i < $xsize ; $i++ ) {
331     - if ($ysize > 1) {
332     -- $styleinfo .= (($i + $xposition) * $numbuttonsy + $yposition + 1) . "-" . (($i + $xposition) * $numbuttonsy + $yposition + $ysize + 1) . ",";
333     -+ $styleinfo .= (($i + $xposition) * $numbuttonsy + $yposition + 1) . "-" . (($i + $xposition) * $numbuttonsy + $yposition + $ysize) . ",";
334     - }
335     - else {
336     - $styleinfo .= (($i + $xposition) * $numbuttonsy + $yposition + 1) . ",";
337     - }
338     - }
339     -+ $retval = $styleinfo;
340     - last;
341     - }
342     - }
343     -- return $styleinfo;
344     -+ return $retval;
345     - }

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