#!/bin/bash
. $include_modpatch
for DIR in ${OEMLIST}; do
if [ -d "${1}/usr/www/${DIR}" ]; then
html="html"
DIRI="${1}/usr/www/${DIR}/$html/de/home"
FILE="foncalls.js"
if ! [ -f "$DIRI/$FILE" ]; then
DIRI="${1}/usr/www/${DIR}/$html/de/fon"
fi
if [ -f "$DIRI/$FILE" ]; then
if ! `cat $DIRI/$FILE | grep -q "www.dasoertliche.de"` ; then
echo2 " -- patching file:"
echo2 " /usr/www/${DIR}/$html/de/fon/$FILE"
# fix 16540
if ! grep -q "spanEx(" $DIRI/$FILE ;then
sed -i -e '/function BuchBtn(name, rufnummer) {/i\
function spanEx(str1,str2) {\
return "" + str2 + "<\/span><\/nobr>";\
}' "$DIRI/$FILE"
sed -i -e '/var buchentryinfo = GetBuchEntryInfo(buchname,buchnrtype);/a\
var tooltip=nr;\
if (nr!="")\
tooltip=buchentryinfo+" = "+nr;' "$DIRI/$FILE"
sed -i -e 's| title=.""+buchentryinfo+".">"+buchentryinfo+"";| title=\\""+tooltip+"\\">"+buchentryinfo+"";|' "$DIRI/$FILE"
sed -i -e 's|return span(buchname==""|return spanEx(tooltip,buchname==""|' "$DIRI/$FILE"
sed -i -e 's|mytype = GetNodeData|var mytype = GetNodeData|' \
-e 's|datum = GetNodeData|var datum = GetNodeData|' \
-e 's|rufnummer = GetNodeData|var rufnummer = GetNodeData|' \
-e 's|myname = GetNodeData|var myname = GetNodeData|' \
-e 's|telbooknumbertyp = GetNodeData|var telbooknumbertyp = GetNodeData|' \
-e 's|myport = GetNodeData|var myport = GetNodeData|' \
-e 's|route = GetNodeData|var route = GetNodeData|' \
-e 's|routetype = GetNodeData|var routetype = GetNodeData|' \
-e 's|dauer = GetNodeData|var dauer = GetNodeData|' \
-e 's|PortName = GetNodeData|var PortName = GetNodeData|' "$DIRI/$FILE"
fi
#all versions
sed -i -e 's|Callno.gif\\"|Callno.gif\\" style=\\"vertical-align:text-top\\"|' "$DIRI/$FILE"
#creating actual call
sed -i -e 's|function uiNummerDisplay|function uiRufnummerInfo (nr) {\
return "/images/bearbeiten.gif\\" style=\\"vertical-align:text-top\\">";\n}\
function uiNummerDisplay|' "$DIRI/$FILE"
# function uiNummerDisplay
# line nr 5
sed -i -e 's|return g_txtUnbekannt|return g_sym0 + g_txtUnbekannt|' "$DIRI/$FILE"
# line nr 7
sed -i -e 's|return span(buchname)|return g_sym0 + span(buchname)|' "$DIRI/$FILE"
# line nr 7 neu version
sed -i -e 's|return span(buchtryinfo)|return g_sym0 + span(buchtryinfo)|' "$DIRI/$FILE"
# line nr 3
sed -i -e 's|if (buchname == "") return "" + "" + g_sym0 + "" + "