Description
Marcel de Rooy
2013-04-15 08:57:12 UTC
Created attachment 17441 [details] [review] Bug 10052: Make intranetstylesheet and intranetcolorstylesheet behave exactly like their opac counterparts Allow a relative path (within theme/css) in intranetstylesheet too. Allow a full path, local or remote with http(s), in intranetcolorstylesheet. This restores consistency between opac and staff. Test plan: First: the patch with the db revision should have been applied. And also the updatestructure step from the web installer should have been run. Clear intranetstylesheet. Check included stylesheet with page source in browser. Enter a full path with http or / in intranetstylesheet. Check again. Enter a relative path (such as staff-global.css). Check again. Clear intranetcolorstylesheet. Check if there is no reference with page source. Enter a full path with http or / in intranetcolorstylesheet. Check reference. Enter a relative path (such as blue.css). Check again. Created attachment 17442 [details] [review] Bug 10052: Db revision for intranetstylesheet Report 10052 makes the intranetstylesheet prefs behave like the opac ones. This patch contains an optional db revision: If the pref intranetstylesheet is not blank, and does not start with http, https or /, then prefix it with a slash to make it an absolute path. Test plan: Before applying this patch: 1) Put intranet-tmpl/prog/en/css/staff-global.css into intranetstylesheet. This works in the current staff client, but will be interpreted as relative as soon as both patches for this report have been applied. Apply the patch. And run: /cgi-bin/koha/installer/install.pl?step=3&op=updatestructure Check the webinstaller message and the pref value. There should be a slash in front now. The css should still work. Continue after applying this patch with: 2) Clear the intranetstylesheet pref. Run updatestructure again. No message: OK 3) Put /intranet-tmpl/prog/en/css/staff-global.css in intranetstylesheet. Run updatestructure again. No message: OK 4) Prefix intranetstylesheet with http://[your-server-here]. Test again. Created attachment 17443 [details] [review] Bug 10052: Make intranetstylesheet and intranetcolorstylesheet behave exactly like their opac counterparts Allow a relative path (within theme/css) in intranetstylesheet too. Allow a full path, local or remote with http(s), in intranetcolorstylesheet. This restores consistency between opac and staff. Test plan: First: the patch with the db revision should have been applied. And also the updatestructure step from the web installer should have been run. Clear intranetstylesheet. Check included stylesheet with page source in browser. Enter a full path with http or / in intranetstylesheet. Check again. Enter a relative path (such as staff-global.css). Check again. Clear intranetcolorstylesheet. Check if there is no reference with page source. Enter a full path with http or / in intranetcolorstylesheet. Check reference. Enter a relative path (such as blue.css). Check again. Wait: I will move the Print Version statement of the dbrev outside the if. Created attachment 17444 [details] [review] Bug 10052: Db revision for intranetstylesheet Report 10052 makes the intranetstylesheet prefs behave like the opac ones. This patch contains an optional db revision: If the pref intranetstylesheet is not blank, and does not start with http, https or /, then prefix it with a slash to make it an absolute path. Test plan: Before applying this patch: 1) Put intranet-tmpl/prog/en/css/staff-global.css into intranetstylesheet. This works in the current staff client, but will be interpreted as relative as soon as both patches for this report have been applied. Apply the patch. And run: /cgi-bin/koha/installer/install.pl?step=3&op=updatestructure Check the webinstaller warning and the pref value. There should be a slash in front now. The css should still work. Continue after applying this patch with: 2) Clear the intranetstylesheet pref. Run updatestructure again. No message: OK 3) Put /intranet-tmpl/prog/en/css/staff-global.css in intranetstylesheet. Run updatestructure again. No message: OK 4) Prefix intranetstylesheet with http://[your-server-here]. Test again. Created attachment 17445 [details] [review] Bug 10052: Make intranetstylesheet and intranetcolorstylesheet behave exactly like their opac counterparts Allow a relative path (within theme/css) in intranetstylesheet too. Allow a full path, local or remote with http(s), in intranetcolorstylesheet. This restores consistency between opac and staff. Test plan: First: the patch with the db revision should have been applied. And also the updatestructure step from the web installer should have been run. Clear intranetstylesheet. Check included stylesheet with page source in browser. Enter a full path with http or / in intranetstylesheet. Check again. Enter a relative path (such as staff-global.css). Check again. Clear intranetcolorstylesheet. Check if there is no reference with page source. Enter a full path with http or / in intranetcolorstylesheet. Check reference. Enter a relative path (such as blue.css). Check again. Still some work to do: koha-tmpl/intranet-tmpl/prog/en/modules/help/edithelp.tt koha-tmpl/intranet-tmpl/prog/en/includes/help-top.inc Will move the code to an include? Created attachment 17446 [details] [review] Bug 10052 Followup for edithelp.tt and help-top.inc A grep on the stylesheet names revealed that similar code was used in those template files. This patch moves the code from doc-head-close.inc to a new include file. Now, doc-head-close and the help templates refer to that one file. Test plan: If you tested the preceding two patches, now you only need to: 1) Check included css via page source in browser from staff main page. 2) Check it also from some other location. 3) Check again from Help: e.g. /cgi-bin/koha/help.pl 4) Check again from Edit Help: /cgi-bin/koha/edithelp.pl Created attachment 17465 [details] [review] Bug 10052 Followup for edithelp.tt and help-top.inc A grep on the stylesheet names revealed that similar code was used in those template files. This patch moves the code from doc-head-close.inc to a new include file. Now, doc-head-close and the help templates refer to that one file. Test plan: If you tested the preceding two patches, now you only need to: 1) Check included css via page source in browser from staff main page. 2) Check it also from some other location. 3) Check again from Help: e.g. /cgi-bin/koha/help.pl 4) Check again from Edit Help: /cgi-bin/koha/edithelp.pl Created attachment 17918 [details] [review] Bug 10052: Db revision for intranetstylesheet Report 10052 makes the intranetstylesheet prefs behave like the opac ones. This patch contains an optional db revision: If the pref intranetstylesheet is not blank, and does not start with http, https or /, then prefix it with a slash to make it an absolute path. Test plan: Before applying this patch: 1) Put intranet-tmpl/prog/en/css/staff-global.css into intranetstylesheet. This works in the current staff client, but will be interpreted as relative as soon as both patches for this report have been applied. Apply the patch. And run: /cgi-bin/koha/installer/install.pl?step=3&op=updatestructure Check the webinstaller warning and the pref value. There should be a slash in front now. The css should still work. Continue after applying this patch with: 2) Clear the intranetstylesheet pref. Run updatestructure again. No message: OK 3) Put /intranet-tmpl/prog/en/css/staff-global.css in intranetstylesheet. Run updatestructure again. No message: OK 4) Prefix intranetstylesheet with http://[your-server-here]. Test again. Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz> Created attachment 17919 [details] [review] Bug 10052: Make intranetstylesheet and intranetcolorstylesheet behave exactly like their opac counterparts Allow a relative path (within theme/css) in intranetstylesheet too. Allow a full path, local or remote with http(s), in intranetcolorstylesheet. This restores consistency between opac and staff. Test plan: First: the patch with the db revision should have been applied. And also the updatestructure step from the web installer should have been run. Clear intranetstylesheet. Check included stylesheet with page source in browser. Enter a full path with http or / in intranetstylesheet. Check again. Enter a relative path (such as staff-global.css). Check again. Clear intranetcolorstylesheet. Check if there is no reference with page source. Enter a full path with http or / in intranetcolorstylesheet. Check reference. Enter a relative path (such as blue.css). Check again. Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz> Created attachment 17920 [details] [review] Bug 10052 Followup for edithelp.tt and help-top.inc A grep on the stylesheet names revealed that similar code was used in those template files. This patch moves the code from doc-head-close.inc to a new include file. Now, doc-head-close and the help templates refer to that one file. Test plan: If you tested the preceding two patches, now you only need to: 1) Check included css via page source in browser from staff main page. 2) Check it also from some other location. 3) Check again from Help: e.g. /cgi-bin/koha/help.pl 4) Check again from Edit Help: /cgi-bin/koha/edithelp.pl Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz> Hi Marcel, I am trying to figure out how this works and entered a http://... into my intranetstylesheet preference. I can see that it works for the staff pages, but the help files (http://localhost:8080/cgi-bin/koha/help.pl) still refer to staff-global.css. Can you take a look please? All 3 patches were applied and the databaes update left my http:// URL alone. <title>Online Help</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <link rel="shortcut icon" href="/intranet-tmpl/prog/en/includes/favicon.ico" type="image/x-icon" /> <link rel="stylesheet" type="text/css" href="/intranet-tmpl/lib/jquery/jquery-ui.css" /> <link rel="stylesheet" type="text/css" media="print" href="/intranet-tmpl/prog/en/css/print.css" /> <link rel="stylesheet" type="text/css" href="/intranet-tmpl/prog/en/css/staff-global.css" /> <!-- local colors --> Created attachment 18109 [details] [review] Bug 10052: Db revision for intranetstylesheet Report 10052 makes the intranetstylesheet prefs behave like the opac ones. This patch contains an optional db revision: If the pref intranetstylesheet is not blank, and does not start with http, https or /, then prefix it with a slash to make it an absolute path. Test plan: Before applying this patch: 1) Put intranet-tmpl/prog/en/css/staff-global.css into intranetstylesheet. This works in the current staff client, but will be interpreted as relative as soon as both patches for this report have been applied. Apply the patch. And run: /cgi-bin/koha/installer/install.pl?step=3&op=updatestructure Check the webinstaller warning and the pref value. There should be a slash in front now. The css should still work. Continue after applying this patch with: 2) Clear the intranetstylesheet pref. Run updatestructure again. No message: OK 3) Put /intranet-tmpl/prog/en/css/staff-global.css in intranetstylesheet. Run updatestructure again. No message: OK 4) Prefix intranetstylesheet with http://[your-server-here]. Test again. Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz> Created attachment 18110 [details] [review] Bug 10052: Make intranetstylesheet and intranetcolorstylesheet behave exactly like their opac counterparts Allow a relative path (within theme/css) in intranetstylesheet too. Allow a full path, local or remote with http(s), in intranetcolorstylesheet. This restores consistency between opac and staff. Test plan: First: the patch with the db revision should have been applied. And also the updatestructure step from the web installer should have been run. Clear intranetstylesheet. Check included stylesheet with page source in browser. Enter a full path with http or / in intranetstylesheet. Check again. Enter a relative path (such as staff-global.css). Check again. Clear intranetcolorstylesheet. Check if there is no reference with page source. Enter a full path with http or / in intranetcolorstylesheet. Check reference. Enter a relative path (such as blue.css). Check again. Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz> Created attachment 18111 [details] [review] Bug 10052 Followup for edithelp.tt and help-top.inc A grep on the stylesheet names revealed that similar code was used in those template files. This patch moves the code from doc-head-close.inc to a new include file. Now, doc-head-close and the help templates refer to that one file. Test plan: If you tested the preceding two patches, now you only need to: 1) Check included css via page source in browser from staff main page. 2) Check it also from some other location. 3) Check again from Help: e.g. /cgi-bin/koha/help.pl 4) Check again from Edit Help: /cgi-bin/koha/edithelp.pl Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz> Created attachment 18112 [details] [review] Bug 10052: QA Followup As Katrin pointed out, the intranetstylesheet setting was not respected in the help pages. The script help.pl does not use get_template_and_user which sets these variables via Auth.pm but calls gettemplate. This makes it necessary to 'manually' set them. This patch does that. Evidently, this could be the case for some other templates vars too.. Test plan: Apply all patches for 10052. Change intranetstylesheet. Check a help page. Change intranetcolorstylesheet. Check a help page. (In reply to comment #13) > I am trying to figure out how this works and entered a http://... into my > intranetstylesheet preference. I can see that it works for the staff pages, > but the help files (http://localhost:8080/cgi-bin/koha/help.pl) still refer > to staff-global.css. Can you take a look please? All 3 patches were applied > and the databaes update left my http:// URL alone. Good testing, Katrin! Gründlich :) Thanks. You found something that must have been there for some time already.. The template var was not filled because it is not loaded via get_template_and_user but just gettemplate. Added a QA followup to fill them now. Resolved merge conflict on updatedb. Created attachment 18124 [details] [review] [PASSED QA] Bug 10052: Db revision for intranetstylesheet Report 10052 makes the intranetstylesheet prefs behave like the opac ones. This patch contains an optional db revision: If the pref intranetstylesheet is not blank, and does not start with http, https or /, then prefix it with a slash to make it an absolute path. Test plan: Before applying this patch: 1) Put intranet-tmpl/prog/en/css/staff-global.css into intranetstylesheet. This works in the current staff client, but will be interpreted as relative as soon as both patches for this report have been applied. Apply the patch. And run: /cgi-bin/koha/installer/install.pl?step=3&op=updatestructure Check the webinstaller warning and the pref value. There should be a slash in front now. The css should still work. Continue after applying this patch with: 2) Clear the intranetstylesheet pref. Run updatestructure again. No message: OK 3) Put /intranet-tmpl/prog/en/css/staff-global.css in intranetstylesheet. Run updatestructure again. No message: OK 4) Prefix intranetstylesheet with http://[your-server-here]. Test again. Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz> Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de> Comments on last patch. Created attachment 18125 [details] [review] [PASSED QA] Bug 10052: Make intranetstylesheet and intranetcolorstylesheet behave exactly like their opac counterparts Allow a relative path (within theme/css) in intranetstylesheet too. Allow a full path, local or remote with http(s), in intranetcolorstylesheet. This restores consistency between opac and staff. Test plan: First: the patch with the db revision should have been applied. And also the updatestructure step from the web installer should have been run. Clear intranetstylesheet. Check included stylesheet with page source in browser. Enter a full path with http or / in intranetstylesheet. Check again. Enter a relative path (such as staff-global.css). Check again. Clear intranetcolorstylesheet. Check if there is no reference with page source. Enter a full path with http or / in intranetcolorstylesheet. Check reference. Enter a relative path (such as blue.css). Check again. Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz> Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de> Created attachment 18126 [details] [review] [PASSED QA] Bug 10052 Followup for edithelp.tt and help-top.inc A grep on the stylesheet names revealed that similar code was used in those template files. This patch moves the code from doc-head-close.inc to a new include file. Now, doc-head-close and the help templates refer to that one file. Test plan: If you tested the preceding two patches, now you only need to: 1) Check included css via page source in browser from staff main page. 2) Check it also from some other location. 3) Check again from Help: e.g. /cgi-bin/koha/help.pl 4) Check again from Edit Help: /cgi-bin/koha/edithelp.pl Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz> Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de> Template only, no string changes. Tested according to test plan. Created attachment 18127 [details] [review] [PASSED QA] Bug 10052: QA Followup As Katrin pointed out, the intranetstylesheet setting was not respected in the help pages. The script help.pl does not use get_template_and_user which sets these variables via Auth.pm but calls gettemplate. This makes it necessary to 'manually' set them. This patch does that. Evidently, this could be the case for some other templates vars too.. Test plan: Apply all patches for 10052. Change intranetstylesheet. Check a help page. Change intranetcolorstylesheet. Check a help page. Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de> Looks all good to me now. Passes tests and still no string changes. String changes on the patch "Bug 10052: Make intranetstylesheet and intranetcolorstylesheet behave exactly like their opac counterparts." Holding for 3.14. Oh sorry, missed that :( Version back to master. Pushed to master. Thanks, Marcel! |