Skip to content

Commit

Permalink
Merge pull request #6 from jp112sdl/master
Browse files Browse the repository at this point in the history
Changes made for CCU3 FW 3.53.26
  • Loading branch information
jens-maus committed Nov 3, 2020
2 parents 9169ecb + 01f1344 commit b7b8670
Show file tree
Hide file tree
Showing 6 changed files with 6,715 additions and 19 deletions.
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.2a
2.1
16 changes: 12 additions & 4 deletions generate_img.sh
Original file line number Diff line number Diff line change
@@ -1,12 +1,20 @@
#!/bin/sh
mkdir -p tmp
cp -a programmedrucken tmp/
COPYFILE_DISABLE=1; export COPYFILE_DISABLE
rm -f *.tar.gz

mkdir -p tmp/addon/
cp -a update_script tmp/
cp -a addon tmp/
cp -a rc.d tmp/
cp -a www tmp/
cp -a VERSION tmp/addon/
cd tmp
tar --owner=root --group=root --exclude=.DS_Store -czvf ../hm-print-$(cat ../VERSION).tar.gz *
chmod +x update_script

find . -name ".DS_Store" -exec rm -rf {} \;
find . -name "._*" -exec rm -rf {} \;
dot_clean .

tar -zcf ../hm-print-$(cat ../VERSION).tar.gz *

cd ..
rm -rf tmp
49 changes: 47 additions & 2 deletions rc.d/programmedrucken
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,48 @@ ADDON_DIR=/usr/local/etc/config/addons/${ADDONNAME}
WWW_DIR=/usr/local/etc/config/addons/www/${ADDONNAME}
RCD_DIR=/usr/local/etc/config/rc.d

model=`grep VERSION /boot/VERSION | awk -F'[=.]' {'print $2'}`
version=`grep VERSION /boot/VERSION | awk -F'[=.]' {'print $3'}`
build=`grep VERSION /boot/VERSION | awk -F'[=.]' {'print $4'}`

echo "Found firmware version $model.$version.$build"

if [ $model -ge 2 ] && [ $version -ge 53 ]; then

### FOR CCU FW >= x.53

# String to include the functions.js for DV/Overview & Deviceparamter
SCGISTRING="setFooter(s);"
RCGISTRING="setFooter(s); var scriptpp = document.createElement(\\\\\"script\\\\\"); scriptpp.type = \\\\\"text/javascript\\\\\"; scriptpp.src = \\\\\"/addons/print/functions.js\\\\\"; \\\\\$(\\\\\"body\\\\\").appendChild(scriptpp);"

# String to include the functions.js for Programm/s
SSTRINGZWO="setFooter(s);"
RSTRINGZWO="setFooter(s); var scriptpp = document.createElement(\"script\"); scriptpp.type = \"text/javascript\"; scriptpp.src = \"/addons/print/functions.js\"; \$(\"body\").appendChild(scriptpp);"

# String to include the print button for single "Direkte Verknüpfung"
SCGISTRINGZWO="<td style='text-align:center; vertical-align:middle;'><div class='FooterButton' onclick='CollectData_SaveProfileSettings(0);'>\\\\\${footerBtnOk}</div></td>\\\\\";"
RCGISTRINGZWO="<td style='text-align:center; vertical-align:middle;'><div class='FooterButton' onclick='CollectData_SaveProfileSettings(0);'>\\\\\${footerBtnOk}</div></td><td style='text-align:center; vertical-align:middle;'><div class='FooterButton' onclick='PrintPage();'>Drucken</div></td>\\\\\";"

# String to include the overview print button in "Direkte Verknüpfungen"
SOVERDVCGI="<td style='text-align:center; vertical-align:middle;'><div class='FooterButton CLASS22100' onclick='loadNewLinkPage();' >\\\\\"+ translateKey('footerBtnNewLink') +\\\\\"</div></td>\\\\\";"
ROVERDVCGI="<td style='text-align:center; vertical-align:middle;'><div class='FooterButton CLASS22100' onclick='loadNewLinkPage();' >\\\\\"+ translateKey('footerBtnNewLink') +\\\\\"</div></td></td><td style='text-align:center; vertical-align:middle;'><div class='FooterButton CLASS04906' onclick='PrintAllDV();'>\&Uuml;bersicht Drucken</div></td>\\\\\";"

# String to include the print button in "Geräteparameter"
SDEVPARACGI="<td style='text-align:center; vertical-align:middle;'><div class='FooterButton' onclick='CloseDeviceParameters();'>\\\\\"+translateKey('footerBtnCancel')+\\\\\"</div></td>\\\\\";"
RDEVPARACGI="<td style='text-align:center; vertical-align:middle;'><div class='FooterButton' onclick='CloseDeviceParameters();'>\\\\\"+translateKey('footerBtnCancel')+\\\\\"</div></td><td style='text-align:center; vertical-align:middle;'><div class='FooterButton' onclick='PrintDevPara();'>Drucken</div></td>\\\\\";"

# String to include the print buttons for "Programme"
SPROGLISTSTRING="<td style='text-align:center; vertical-align: middle;'><div class='FooterButton CLASS04906' onclick='new HMScriptExecutor();' >\"+translateKey('footerBtnTestScript')+ \"</div></td>"
RPROGLISTSTRING="<td style='text-align:center; vertical-align: middle;'><div class='FooterButton CLASS04906' onclick='new HMScriptExecutor();' >\"+translateKey('footerBtnTestScript')+ \"</div></td><td style='text-align:center; vertical-align:middle;'><div class='FooterButton CLASS04906' onclick='PrintAllPrograms();'>Drucken</div></td><td align='center' valign='middle'><div class='FooterButton CLASS04906' onclick='PrintAllSysPrograms();'>Drucken inkl. Interne</div></td>"

# String to include the print button in single "Programm"
SSTRING="<td style='text-align:center; vertical-align:middle;'><div class='FooterButton CLASS04801' onclick='new HMScriptExecutor();'>\${footerBtnTestScript}</div></td>"
RSTRING="<td style='text-align:center; vertical-align:middle;'><div class='FooterButton CLASS04801' onclick='new HMScriptExecutor();'>\${footerBtnTestScript}</div></td><td style='text-align:center; vertical-align:middle;'><div class='FooterButton' onclick='PrintPage();'>Drucken</div></td>"

else

### FOR CCU FW < x.53

# String to include the functions.js for DV/Overview & Deviceparamter
SCGISTRING="setFooter(s);"
RCGISTRING="setFooter(s); var scriptpp = document.createElement(\\\\\"script\\\\\"); scriptpp.type = \\\\\"text/javascript\\\\\"; scriptpp.src = \\\\\"/addons/print/functions.js\\\\\"; \\\\\$(\\\\\"body\\\\\").appendChild(scriptpp);"
Expand Down Expand Up @@ -33,6 +75,8 @@ RPROGLISTSTRING="<td align='center' valign='middle'><div class='FooterButton CLA
SSTRING="<td align='center' valign='middle'><div class='FooterButton CLASS04801' onclick='new HMScriptExecutor();'>\${footerBtnTestScript}</div></td>"
RSTRING="<td align='center' valign='middle'><div class='FooterButton CLASS04801' onclick='new HMScriptExecutor();'>\${footerBtnTestScript}</div></td><td align='center' valign='middle'><div class='FooterButton' onclick='PrintPage();'>Drucken</div></td>"

fi

case "$1" in
""|start)

Expand Down Expand Up @@ -157,8 +201,9 @@ case "$1" in
info)
echo "Info: <b>Programmedrucken</b><br>"
echo "Info: <b>CCU2 & RaspberryMatic</b><br>"
echo "Info: (c) 2010-2017 HMside, anli<br>"
echo "Info: <a href='https://github.com/litti/hm-print'>Projekt on Github</a>"
echo "Info: (c) 2010-2017 HMside, anli<br><br>"
echo "Info: (c) 2020 modified by jp112sdl for 3.53.xx<br>"
echo "Info: <a href='https://github.com/jp112sdl/hm-print'>Fork on Github</a>"
echo "Version: $(cat ${ADDON_DIR}/VERSION)"
echo "Name: Programmedrucken"
echo "Operations: uninstall"
Expand Down
11 changes: 3 additions & 8 deletions update_script
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,6 @@ ln -sf ${ADDON_DIR} ${WWW_DIR}/addon
# sync filesystem to make sure all changes are written to disk
sync

# OLD
#mkdir /mnt
#mount -t ubifs ubi1:user /mnt

#cp -R script /mnt/etc/config/addons/www/
#cp -p programmedrucken /mnt/etc/config/rc.d/

#umount /mnt
if [ "$1" = "HM-RASPBERRYMATIC" ]; then
/etc/config/rc.d/programmedrucken start
fi
Loading

0 comments on commit b7b8670

Please sign in to comment.