[Tiki-devel] Participation to code review (TR: [Tikiwiki-cvs/svn] SF.net SVN: tikiwiki:[62117] branches/17.x)

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[Tiki-devel] Participation to code review (TR: [Tikiwiki-cvs/svn] SF.net SVN: tikiwiki:[62117] branches/17.x)

Cloutier, Philippe (DGARI-Consultant)

Greatings fellow developers,

I no longer have the time to maintain the level of preventive code review I used to do. Since we lack a proper code review system and some might have expectations about others, I just wanted to note that to ensure I can keep doing some high-value reviews, I have decided I would no longer review commits from drsassafras.

 

De : Brendan Ferguson [mailto:[hidden email]]
Envoyé : 4 mai 2017 19:33
Cc : [hidden email]
Objet : Re: [Tikiwiki-cvs/svn] SF.net SVN: tikiwiki:[62117] branches/17.x

 

sorry, see reply just went to you that last time. Including the list here:

 

I don't have any more time to devote to helping your understanding of this. If you have some specific recommendations I’m all ears.


Brendan

 

 

On May 4, 2017, at 5:40 PM, Cloutier, Philippe (RESSOURCE EXTERNE) <[hidden email]> wrote:

 

-----Message d'origine-----
De : Dr. Sassafras [[hidden email]]
Envoyé : 4 mai 2017 17:14
À : Cloutier, Philippe (RESSOURCE EXTERNE) <[hidden email]>
Cc : [hidden email]
Objet : Re: [Tikiwiki-cvs/svn] SF.net SVN: tikiwiki:[62117] branches/17.x



What does "same" mean (what is the same as what?)?


Is this a variable name or a part of a comment?


It is the name you gave to the new parameter.




What does "bypass timeago preferences" mean?


Search through tiki preferences or on the doc site for the time ago preference.


Would you mind specifying? Are you talking about 1 preference or several preferences?




And what does "markup is illegal in date" mean? An example could clarify.


The markup referred to here is HTML markup. One instance where markup would be illegal is in a txt
file. Another would be in an attribute.

[Philippe Cloutier]

I see. In that case, would it not be clearer to name this parameter $rich, $textOnly or $allowHTML?



If $same is a boolean, why use a string?


To match the previously established tiki_long_date


What do you mean? My question is why did you choose to make the $same parameter a string rather than a boolean, considering that the function currently only behaves in 2 ways depending on its value.




-----Message d'origine-----
De : [hidden email] [[hidden email]]
Envoyé : 6 avril 2017 12:45
À : [hidden email]
Objet : [Tikiwiki-cvs/svn] SF.net SVN: tikiwiki:[62117] branches/17.x

Revision: 62117
        http://sourceforge.net/p/tikiwiki/code/62117
Author:   drsassafras
Date:     2017-04-06 16:45:08 +0000 (Thu, 06 Apr 2017)
Log Message:
-----------
[FIX] timeago - remove markup from attributes

Modified Paths:
--------------
  branches/17.x/lib/smarty_tiki/modifier.tiki_short_date.php
  branches/17.x/lib/smarty_tiki/modifier.tiki_short_datetime.php
  branches/17.x/templates/messu-download.tpl
  branches/17.x/templates/modules/mod-articles.tpl
  branches/17.x/templates/modules/mod-blog_last_comments.tpl
  branches/17.x/templates/modules/mod-forums_last_posts.tpl
  branches/17.x/templates/modules/mod-last_actions.tpl
  branches/17.x/templates/modules/mod-last_blog_posts.tpl
  branches/17.x/templates/modules/mod-last_created_blogs.tpl
  branches/17.x/templates/modules/mod-last_modif_events.tpl
  branches/17.x/templates/modules/mod-upcoming_events.tpl
  branches/17.x/templates/modules/mod-wiki_last_comments.tpl
  branches/17.x/templates/tiki-calendar_edit_item.tpl
  branches/17.x/templates/tiki-calendar_listmode.tpl

Modified: branches/17.x/lib/smarty_tiki/modifier.tiki_short_date.php
===================================================================
--- branches/17.x/lib/smarty_tiki/modifier.tiki_short_date.php    2017-04-06 15:40:53 UTC (rev
62116)
+++ branches/17.x/lib/smarty_tiki/modifier.tiki_short_date.php    2017-04-06 16:45:08 UTC (rev
62117)
@@ -11,7 +11,14 @@
 exit;
}

-function smarty_modifier_tiki_short_date($string)
+/**
+ * @param string  $string
+ * @param string $same   if set to 'n' will bypass timeago preferences. Useful when markup is

illegal in

date
+ *
+ * @return string
+ */
+
+function smarty_modifier_tiki_short_date($string, $same='y')
{
  global $prefs;
  $smarty = TikiLib::lib('smarty');
@@ -18,7 +25,7 @@
  $smarty->loadPlugin('smarty_modifier_tiki_date_format');
  $date = smarty_modifier_tiki_date_format($string, $prefs['short_date_format']);

-    if ($prefs['jquery_timeago'] === 'y') {
+    if ($prefs['jquery_timeago'] === 'y' && $same === 'y') {
      TikiLib::lib('header')->add_jq_onready('$("time.timeago").timeago();');
      return '<time class="timeago" datetime="' . TikiLib::date_format('c', $string, false, 5,
false) .  '">' . $date . '</time>';
  } else  {

Modified: branches/17.x/lib/smarty_tiki/modifier.tiki_short_datetime.php
===================================================================
--- branches/17.x/lib/smarty_tiki/modifier.tiki_short_datetime.php    2017-04-06 15:40:53 UTC (rev
62116)
+++ branches/17.x/lib/smarty_tiki/modifier.tiki_short_datetime.php    2017-04-06 16:45:08 UTC

(rev

62117)
@@ -11,6 +11,15 @@
 exit;
}

+/**
+ * @param string $string
+ * @param string $intro
+ * @param string $same if set to 'n' will bypass timeago preferences. Useful when markup is illegal

in

date
+ *
+ * @return string
+ */
+
+
function smarty_modifier_tiki_short_datetime($string, $intro='', $same='y')
{
  global $prefs;

Modified: branches/17.x/templates/messu-download.tpl
===================================================================
--- branches/17.x/templates/messu-download.tpl    2017-04-06 15:40:53 UTC (rev 62116)
+++ branches/17.x/templates/messu-download.tpl    2017-04-06 16:45:08 UTC (rev 62117)
@@ -4,7 +4,7 @@
Cc: {$items[user].user_cc}
Bcc: {$items[user].user_bcc}
Subject: {$items[user].subject}
-Date: {$items[user].date|tiki_short_datetime}
+Date: {$items[user].date|tiki_short_datetime:'':"n"}
Message-ID: <{$items[user].hash}-{$items[user].date}>
X-Priority: {$items[user].priority}
X-Mailer: Tikiwiki

Modified: branches/17.x/templates/modules/mod-articles.tpl
===================================================================
--- branches/17.x/templates/modules/mod-articles.tpl    2017-04-06 15:40:53 UTC (rev 62116)
+++ branches/17.x/templates/modules/mod-articles.tpl    2017-04-06 16:45:08 UTC (rev 62117)
@@ -25,8 +25,8 @@
                      <img src="article_image.php?{if
$modArticles[ix].hasImage eq 'y'}id={$modArticles[ix].articleId}{elseif
$modArticles[ix].topicId}image_type=topic&amp;id={$modArticles[ix].topicId}{/if}"
width="{$module_params.img}">
                  </div>
              {/if}
-                <a class="linkmodule" href="{if $absurl ==
'y'}{$base_url}{/if}{$modArticles[ix].articleId|sefurl:article}"
title="{$modArticles[ix].created|tiki_short_date}, {tr}by{/tr} {$modArticles[ix].author|escape}">
-                    {$modArticles[ix].title|escape}{if $showcreated eq 'y'} <span
class="date">({$modArticles[ix].created|tiki_short_date})</span>{/if}{if $showpubl eq 'y'} <span
class="date">({$modArticles[ix].publishDate|tiki_short_date})</span>{/if}
+                <a class="linkmodule" href="{if $absurl ==
'y'}{$base_url}{/if}{$modArticles[ix].articleId|sefurl:article}"
title="{$modArticles[ix].created|tiki_short_date:'n'}, {tr}by{/tr}

{$modArticles[ix].author|escape}">

+                    {$modArticles[ix].title|escape}{if $showcreated eq 'y'} <span
class="date">({$modArticles[ix].created|tiki_short_date:'n'})</span>{/if}{if $showpubl eq 'y'}

<span

class="date">({$modArticles[ix].publishDate|tiki_short_date})</span>{/if}
              </a>
          </li>
      {/section}

Modified: branches/17.x/templates/modules/mod-blog_last_comments.tpl
===================================================================
--- branches/17.x/templates/modules/mod-blog_last_comments.tpl    2017-04-06 15:40:53 UTC

(rev

62116)
+++ branches/17.x/templates/modules/mod-blog_last_comments.tpl    2017-04-06 16:45:08 UTC
(rev 62117)
@@ -16,9 +16,9 @@
          {else}
              {$comments[ix].userName|userlink}
          {/if}
-            {tr}on{/tr} <a class="linkmodule" href="tiki-

view_blog_post.php?postId={$comments[ix].postId}&amp;comzone=show#threadId={$comments[i

x].threadId}" title="{tr}Published on{/tr}
{$comments[ix].commentData|tiki_short_date}">{$comments[ix].title|escape}{if

$comments[ix].priv

eq 'y'} ({tr}private{/tr}){/if}</a>
+            {tr}on{/tr} <a class="linkmodule" href="tiki-

view_blog_post.php?postId={$comments[ix].postId}&amp;comzone=show#threadId={$comments[i

x].threadId}" title="{tr}Published on{/tr}
{$comments[ix].commentData|tiki_short_date:'n'}">{$comments[ix].title|escape}{if
$comments[ix].priv eq 'y'} ({tr}private{/tr}){/if}</a>
      {else}
-            <a class="linkmodule clearfix" href="tiki-

view_blog_post.php?postId={$comments[ix].postId}&amp;comzone=show#threadId={$comments[i

x].threadId}" title="{tr}Published on{/tr} {$comments[ix].commentDate|tiki_short_datetime},
{tr}by{/tr} {$comments[ix].userName}{if $moretooltips eq 'y'} {tr}on blogpost{/tr}
{$comments[ix].title}{/if}">
+            <a class="linkmodule clearfix" href="tiki-

view_blog_post.php?postId={$comments[ix].postId}&amp;comzone=show#threadId={$comments[i

x].threadId}" title="{tr}Published on{/tr} {$comments[ix].commentDate|tiki_short_datetime:'':'n'},
{tr}by{/tr} {$comments[ix].userName}{if $moretooltips eq 'y'} {tr}on blogpost{/tr}
{$comments[ix].title}{/if}">
              {if $moretooltips ne 'y'}{$comments[ix].title}{if $comments[ix].priv eq
'y'} ({tr}private{/tr}){/if}:{/if}
              {if $comments[ix].commentTitle ne ''}<span
class="commentTitle">{$comments[ix].commentTitle}</span>{else}{tr}Untitled{/tr}{/if}
          </a>

Modified: branches/17.x/templates/modules/mod-forums_last_posts.tpl
===================================================================
--- branches/17.x/templates/modules/mod-forums_last_posts.tpl    2017-04-06 15:40:53 UTC (rev
62116)
+++ branches/17.x/templates/modules/mod-forums_last_posts.tpl    2017-04-06 16:45:08 UTC (rev
62117)
@@ -8,7 +8,7 @@
                              {if empty($module_params.time) or
$module_params.time eq 'y'}

  {$modForumsLastPosts[ix].date|tiki_short_datetime:'':'n'}
                              {else}
-
  {$modForumsLastPosts[ix].date|tiki_short_date:'':'n'}
+
  {$modForumsLastPosts[ix].date|tiki_short_date:'n'}
                              {/if}
                          {/if}
                          {if $author eq 'n'}

Modified: branches/17.x/templates/modules/mod-last_actions.tpl
===================================================================
--- branches/17.x/templates/modules/mod-last_actions.tpl    2017-04-06 15:40:53 UTC (rev 62116)
+++ branches/17.x/templates/modules/mod-last_actions.tpl    2017-04-06 16:45:08 UTC (rev 62117)
@@ -8,9 +8,9 @@
          {if $modLastActions[ix].object ne ''}
              <a class="linkmodule" href="tiki-
index.php?page={$modLastActions[ix].object|escape:"url"}" title="
              {if (strlen($smarty.capture.label) > $maxlen) && ($maxlen > 0)}
-                    {$modLastActions[ix].user|username}:
{$modLastActions[ix].action} {$modLastActions[ix].objectType}

{$modLastActions[ix].object|escape}

{tr}at{/tr} {$modLastActions[ix].lastModif|tiki_short_datetime}
+                    {$modLastActions[ix].user|username}:
{$modLastActions[ix].action} {$modLastActions[ix].objectType}

{$modLastActions[ix].object|escape}

{tr}at{/tr} {$modLastActions[ix].lastModif|tiki_short_datetime:'':'n'}
              {else}
-                    {if $showdate eq
'n'}{$modLastActions[ix].lastModif|tiki_short_datetime}{/if}{if $showuser eq 'n'}{if $showdate eq

'n'},

{tr}by{/tr} {/if}{$modLastActions[ix].user|username}{/if}
+                    {if $showdate eq
'n'}{$modLastActions[ix].lastModif|tiki_short_datetime:'':'n'}{/if}{if $showuser eq 'n'}{if $showdate

eq

'n'}, {tr}by{/tr} {/if}{$modLastActions[ix].user|username}{/if}
              {/if}
          ">
          {/if}

Modified: branches/17.x/templates/modules/mod-last_blog_posts.tpl
===================================================================
--- branches/17.x/templates/modules/mod-last_blog_posts.tpl    2017-04-06 15:40:53 UTC (rev
62116)
+++ branches/17.x/templates/modules/mod-last_blog_posts.tpl    2017-04-06 16:45:08 UTC (rev
62117)
@@ -3,7 +3,7 @@
{modules_list list=$modLastBlogPosts nonums=$nonums}
  {section name=ix loop=$modLastBlogPosts}
      <li>
-            <a class="linkmodule" href="{$modLastBlogPosts[ix].postId|sefurl:blogpost}"
title="{$modLastBlogPosts[ix].created|tiki_short_datetime}, {tr}by{/tr} {if

$modLastBlogPosts[ix].user

ne ''}{$modLastBlogPosts[ix].user|username}{else}{tr}Anonymous{/tr}{/if}">
+            <a class="linkmodule" href="{$modLastBlogPosts[ix].postId|sefurl:blogpost}"
title="{$modLastBlogPosts[ix].created|tiki_short_datetime:'':'n'}, {tr}by{/tr} {if
$modLastBlogPosts[ix].user ne
''}{$modLastBlogPosts[ix].user|username}{else}{tr}Anonymous{/tr}{/if}">
              {if $blogid eq '-1'}{$modLastBlogPosts[ix].blogTitle|escape}: {/if}
                  {$modLastBlogPosts[ix].title|escape}{if
$modLastBlogPosts[ix].priv eq 'y'} ({tr}private{/tr}){/if}
          </a>

Modified: branches/17.x/templates/modules/mod-last_created_blogs.tpl
===================================================================
--- branches/17.x/templates/modules/mod-last_created_blogs.tpl    2017-04-06 15:40:53 UTC (rev
62116)
+++ branches/17.x/templates/modules/mod-last_created_blogs.tpl    2017-04-06 16:45:08 UTC (rev
62117)
@@ -4,7 +4,7 @@
  {modules_list list=$modLastCreatedBlogs nonums=$nonums}
      {section name=ix loop=$modLastCreatedBlogs}
          <li>
-                <a class="linkmodule" href="tiki-
view_blog.php?blogId={$modLastCreatedBlogs[ix].blogId}"
title="{$modLastCreatedBlogs[ix].created|tiki_short_datetime}, {tr}by{/tr} {if
$modLastCreatedBlogs[ix].user ne
''}{$modLastCreatedBlogs[ix].user|escape}{else}{tr}Anonymous{/tr}{/if}">
+                <a class="linkmodule" href="tiki-
view_blog.php?blogId={$modLastCreatedBlogs[ix].blogId}"
title="{$modLastCreatedBlogs[ix].created|tiki_short_datetime:'':'n'}, {tr}by{/tr} {if
$modLastCreatedBlogs[ix].user ne
''}{$modLastCreatedBlogs[ix].user|escape}{else}{tr}Anonymous{/tr}{/if}">
                  {$modLastCreatedBlogs[ix].title|escape}
              </a>
          </li>

Modified: branches/17.x/templates/modules/mod-last_modif_events.tpl
===================================================================
--- branches/17.x/templates/modules/mod-last_modif_events.tpl    2017-04-06 15:40:53 UTC (rev
62116)
+++ branches/17.x/templates/modules/mod-last_modif_events.tpl    2017-04-06 16:45:08 UTC (rev
62117)
@@ -4,7 +4,7 @@
  {modules_list list=$modLastEvents nonums=$nonums}
      {section name=ix loop=$modLastEvents}
          <li>
-                <a class="linkmodule" href="tiki-
calendar.php?todate={$modLastEvents[ix].start}"
title="{$modLastEvents[ix].lastModif|tiki_short_datetime}, {tr}by{/tr} {if $modLastEvents[ix].user

ne

''}{$modLastEvents[ix].user|username}{else}{tr}Anonymous{/tr}{/if}">
+                <a class="linkmodule" href="tiki-
calendar.php?todate={$modLastEvents[ix].start}"
title="{$modLastEvents[ix].lastModif|tiki_short_datetime:'':'n'}, {tr}by{/tr} {if
$modLastEvents[ix].user ne

''}{$modLastEvents[ix].user|username}{else}{tr}Anonymous{/tr}{/if}">

                  {if $maxlen > 0}{* 0 is default value for maxlen eq to 'no
truncate' *}

  {$modLastEvents[ix].name|truncate:$maxlen:"...":true|escape}
                  {else}

Modified: branches/17.x/templates/modules/mod-upcoming_events.tpl
===================================================================
--- branches/17.x/templates/modules/mod-upcoming_events.tpl    2017-04-06 15:40:53 UTC (rev
62116)
+++ branches/17.x/templates/modules/mod-upcoming_events.tpl    2017-04-06 16:45:08 UTC (rev
62117)
@@ -38,7 +38,7 @@

          <a class="linkmodule summary"
              href="{if $prefs.feature_sefurl eq
'y'}event{$modUpcomingEvents[ix].calitemId}{else}tiki-
calendar_edit_item.php?viewcalitemId={$modUpcomingEvents[ix].calitemId}{/if}"
-                title="{if $tooltip_infos neq
'n'}{$modUpcomingEvents[ix].lastModif|tiki_short_datetime}, {tr}by{/tr} {if
$modUpcomingEvents[ix].user ne
''}{$modUpcomingEvents[ix].user|username}{else}{tr}Anonymous{/tr}{/if}{else}{tr}click to
view{/tr}{/if}"
+                title="{if $tooltip_infos neq
'n'}{$modUpcomingEvents[ix].lastModif|tiki_short_datetime:'':'n'}, {tr}by{/tr} {if
$modUpcomingEvents[ix].user ne
''}{$modUpcomingEvents[ix].user|username}{else}{tr}Anonymous{/tr}{/if}{else}{tr}click to
view{/tr}{/if}"
              {if $modUpcomingEvents[ix].status eq '2'}style="text-decoration: line-
through;"{/if}

 

              {if $maxlen > 0}{* 0 is default value for maxlen eq to 'no truncate' *}

Modified: branches/17.x/templates/modules/mod-wiki_last_comments.tpl
===================================================================
--- branches/17.x/templates/modules/mod-wiki_last_comments.tpl    2017-04-06 15:40:53 UTC (rev
62116)
+++ branches/17.x/templates/modules/mod-wiki_last_comments.tpl    2017-04-06 16:45:08 UTC
(rev 62117)
@@ -10,7 +10,7 @@
              {if $module_params.avatars eq 'y'}
                  {$comments[ix].userName|avatarize:'right'}
              {/if}
-                <a class="linkmodule tips"

href="{$comments[ix].object|sefurl:$type:with_next}comzone=show#threadId={$comments[ix].thr

eadId}" title="{$comments[ix].commentDate|tiki_short_datetime}| {tr}by{/tr}
{$comments[ix].userName|username}{if $moretooltips eq 'y'} {tr}on{/tr}
{$comments[ix].name|escape}{/if}">
+                <a class="linkmodule tips"

href="{$comments[ix].object|sefurl:$type:with_next}comzone=show#threadId={$comments[ix].thr

eadId}" title="{$comments[ix].commentDate|tiki_short_datetime:'':'n'}| {tr}by{/tr}
{$comments[ix].userName|username}{if $moretooltips eq 'y'} {tr}on{/tr}
{$comments[ix].name|escape}{/if}">
                  {if $moretooltips ne 'y'}
                      <strong>{$comments[ix].name|escape}</strong>:
                  {/if}

Modified: branches/17.x/templates/tiki-calendar_edit_item.tpl
===================================================================
--- branches/17.x/templates/tiki-calendar_edit_item.tpl    2017-04-06 15:40:53 UTC (rev 62116)
+++ branches/17.x/templates/tiki-calendar_edit_item.tpl    2017-04-06 16:45:08 UTC (rev 62117)
@@ -427,7 +427,7 @@
              {else}
                  <div class="col-md-9">
                      {if $calitem.allday}
-                            <abbr class="dtstart"
title="{$calitem.start|tiki_short_date}">
+                            <abbr class="dtstart"
title="{$calitem.start|tiki_short_date:'n'}">
                              {$calitem.start|tiki_long_date}
                          </abbr>
                      {else}
@@ -464,7 +464,7 @@
                  <div class="col-md-9">
                      {if $calitem.allday}
                          {if $calitem.end}
-                                <abbr class="dtend"
title="{$calitem.end|tiki_short_date}">
+                                <abbr class="dtend"
title="{$calitem.end|tiki_short_date:'n'}">
                          {/if}
                          {$calitem.end|tiki_long_date}
                          {if $calitem.end}

Modified: branches/17.x/templates/tiki-calendar_listmode.tpl
===================================================================
--- branches/17.x/templates/tiki-calendar_listmode.tpl    2017-04-06 15:40:53 UTC (rev 62116)
+++ branches/17.x/templates/tiki-calendar_listmode.tpl    2017-04-06 16:45:08 UTC (rev 62117)
@@ -22,13 +22,13 @@
      {assign var=calendarId value=$event.calendarId}
      <tr class="{cycle}{if $event.start <= $smarty.now and $event.end >= $smarty.now}
selected{/if} vevent">
          <td class="date">
-                <abbr class="dtstart" title="{$event.start|tiki_short_date}">
+                <abbr class="dtstart" title="{$event.start|tiki_short_date:'n'}">
                  <a href="{$myurl}?todate={$event.start}" title="{tr}Change
Focus{/tr}">{$event.start|tiki_short_date}</a>
              </abbr><br>
              {if $event.allday} {tr}All day{/tr} {else} {$event.start|tiki_short_time}
{/if}
          </td>
          <td class="date">
-                {if $event.start|tiki_short_date ne $event.end|tiki_short_date}<abbr
class="dtend" title="{$event.end|tiki_short_date}"><a href="{$myurl}?todate={$event.end}"
title="{tr}Change Focus{/tr}">{$event.end|tiki_short_date}</a></abbr> {/if}<br>
+                {if $event.start|tiki_short_date ne $event.end|tiki_short_date}<abbr
class="dtend" title="{$event.end|tiki_short_date:'n'}"><a href="{$myurl}?todate={$event.end}"
title="{tr}Change Focus{/tr}">{$event.end|tiki_short_date}</a></abbr> {/if}<br>
{if $event.start ne $event.end and $event.allday ne 1}{$event.end|tiki_short_time}{/if}
          </td>
          <td style="word-wrap:break-word; {if $infocals.$calendarId.custombgcolor ne
''}background-color:#{$infocals.$calendarId.custombgcolor};{/if}">

This was sent by the SourceForge.net collaborative development platform, the world's largest

Open

Source development site.


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Tikiwiki-cvs mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/tikiwiki-cvs

 


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
TikiWiki-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/tikiwiki-devel

ATT00001.txt (280 bytes) Download Attachment
ATT00002.txt (234 bytes) Download Attachment