List:Eventum General Discussion« Previous MessageNext Message »
From:Harri Porten Date:February 3 2006 12:15am
Subject:More relative URL fixes
View as plain text  
Hi,

colleagues of mine ran into more issues with absolute URLs being hardcoded
in Eventum pages. One was using an ssh tunnel, another one is accessing
our server through another hostname from the local network.

The attached patch removes the dependancy on absolute URLs in favor of
relative ones. Patch is against 1.6.1 and was created relative to the
templates/en directory.

Harri.

Index: mail_queue.tpl.html
===================================================================
RCS file: /home/cvs/root/eventum/templates/en/mail_queue.tpl.html,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -3 -p -w -r1.1 -r1.2
--- mail_queue.tpl.html	17 Nov 2005 23:55:46 -0000	1.1
+++ mail_queue.tpl.html	3 Feb 2006 00:02:29 -0000	1.2
@@ -43,7 +43,7 @@
           {/section}

           <tr>

             <td colspan="5" bgcolor="{$cell_color}">

-              <input class="button" type="button" value="&lt;&lt; Back" onClick="javascript:location.href='{$app_base_url}view.php?id={$issue_id}';">

+              <input class="button" type="button" value="&lt;&lt; Back" onClick="javascript:location.href='{$rel_url}view.php?id={$issue_id}';">

             </td>

           </tr>

         </table>

Index: expandable_cell/buttons.tpl.html
===================================================================
RCS file: /home/cvs/root/eventum/templates/en/expandable_cell/buttons.tpl.html,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -3 -p -w -r1.1 -r1.2
--- expandable_cell/buttons.tpl.html	17 Nov 2005 23:55:47 -0000	1.1
+++ expandable_cell/buttons.tpl.html	3 Feb 2006 00:02:29 -0000	1.2
@@ -3,12 +3,12 @@
     <script>setRemoteFunction('{$ec_id}', '{$remote_func}');</script>

 {/if}

 {if $list_id == ''}

-    {assign var="js_expand_func" value="expandAll('$app_base_url', '$ec_id')"}

+    {assign var="js_expand_func" value="expandAll('$rel_url', '$ec_id')"}

     {assign var="expand_tip" value="Expand all collapsed cells"}

     {assign var="js_collapse_func" value="collapseAll('$ec_id')"}

     {assign var="collapse_tip" value="Collapse all expanded cells"}

 {else}

-    {assign var="js_expand_func" value="expand('$app_base_url', '$ec_id', '$list_id')"}

+    {assign var="js_expand_func" value="expand('$rel_url', '$ec_id', '$list_id')"}

     {assign var="expand_tip" value="Expand collapsed cell"}

     {assign var="js_collapse_func" value="collapse('$ec_id', '$list_id')"}

     {assign var="collapse_tip" value="Collapse expanded cell"}

Index: reports/recent_activity.tpl.html
===================================================================
RCS file: /home/cvs/root/eventum/templates/en/reports/recent_activity.tpl.html,v
retrieving revision 1.1
retrieving revision 1.3
diff -u -3 -p -w -r1.1 -r1.3
--- reports/recent_activity.tpl.html	17 Nov 2005 23:55:47 -0000	1.1
+++ reports/recent_activity.tpl.html	2 Feb 2006 23:59:18 -0000	1.3
@@ -143,7 +144,7 @@ changeType('{$smarty.request.report_type
         <tr>

           <td class="default" bgcolor="{$row_color}" NOWRAP>{include file="expandable_cell/buttons.tpl.html" ec_id="phone" list_id=$row.phs_id}</td>

           <td class="default" bgcolor="{$row.sta_color}" align="right">

-            <a href="{$app_base_url}view.php?id={$row.phs_iss_id}" class="link">{$row.phs_iss_id}</a>

+            <a href="{$rel_url}view.php?id={$row.phs_iss_id}" class="link">{$row.phs_iss_id}</a>

           </td>

           {if $has_customer_integration}

           <td class="default" bgcolor="{$row_color}">{$row.customer}</td>

@@ -192,7 +193,7 @@ changeType('{$smarty.request.report_type
         <tr>

           <td class="default" bgcolor="{$row_color}" NOWRAP>{include file="expandable_cell/buttons.tpl.html" ec_id="note" list_id=$row.not_id}</td>

           <td class="default" bgcolor="{$row.sta_color}" align="right">

-            <a href="{$app_base_url}view.php?id={$row.not_iss_id}" class="link">{$row.not_iss_id}</a>

+            <a href="{$rel_url}view.php?id={$row.not_iss_id}" class="link">{$row.not_iss_id}</a>

           </td>

           {if $has_customer_integration}

           <td class="default" bgcolor="{$row_color}">{$row.customer}</td>

@@ -242,7 +243,7 @@ changeType('{$smarty.request.report_type
             {include file="expandable_cell/buttons.tpl.html" ec_id="email" list_id=$row.composite_id}

           </td>

           <td class="default" bgcolor="{$row.sta_color}" align="right">

-            <a href="{$app_base_url}view.php?id={$row.sup_iss_id}" class="link">{$row.sup_iss_id}</a>

+            <a href="{$rel_url}view.php?id={$row.sup_iss_id}" class="link">{$row.sup_iss_id}</a>

           </td>

           {if $has_customer_integration}

           <td class="default" bgcolor="{$row_color}">{$row.customer}</td>

@@ -298,7 +299,7 @@ changeType('{$smarty.request.report_type
         <tr {if $row.emd_status != 'pending'}style="text-decoration: line-through;"{/if}>

           <td class="default" NOWRAP bgcolor="{$row_color}">{include file="expandable_cell/buttons.tpl.html" ec_id="draft" list_id=$row.emd_id}</td>

           <td class="default" bgcolor="{$row.sta_color}" align="right">

-            <a href="{$app_base_url}view.php?id={$row.emd_iss_id}" class="link">{$row.emd_iss_id}</a>

+            <a href="{$rel_url}view.php?id={$row.emd_iss_id}" class="link">{$row.emd_iss_id}</a>

           </td>

           {if $has_customer_integration}

           <td class="default" bgcolor="{$row_color}">{$row.customer}</td>

@@ -348,7 +349,7 @@ changeType('{$smarty.request.report_type
         {cycle values=$cycle assign="row_color"}

         <tr>

           <td class="default" bgcolor="{$row.sta_color}" align="right">

-            <a href="{$app_base_url}view.php?id={$row.ttr_iss_id}" class="link">{$row.ttr_iss_id}</a>

+            <a href="{$rel_url}view.php?id={$row.ttr_iss_id}" class="link">{$row.ttr_iss_id}</a>

           </td>

           {if $has_customer_integration}

           <td class="default" bgcolor="{$row_color}">{$row.customer}</td>

@@ -393,7 +394,7 @@ changeType('{$smarty.request.report_type
         {cycle values=$cycle assign="row_color"}

         <tr>

           <td class="default" bgcolor="{$row.sta_color}" align="right">

-            <a href="{$app_base_url}view.php?id={$row.rmh_iss_id}" class="link">{$row.rmh_iss_id}</a>

+            <a href="{$rel_url}view.php?id={$row.rmh_iss_id}" class="link">{$row.rmh_iss_id}</a>

           </td>

           {if $has_customer_integration}

           <td class="default" bgcolor="{$row_color}">{$row.customer}</td>

Thread
More relative URL fixesHarri Porten3 Feb