Topic: attachments file view
the attach file view options it's not complete. If you attach 2 or more files the function will only output the last one from the array, and will only display that you have one file attached to your order/invoice/dispatch.... etc
so here my add
in attachment_db.inc i added this function:
 
 
function get_attachment_string($type, $id)
{
global $path_to_root;
    $str_return = "";    
    $sql = "SELECT * FROM ".TB_PREF."attachments WHERE type_no=".db_escape($type)." AND trans_no=".db_escape($id)." ORDER BY trans_no";
    $return = db_query($sql, "Could not retrieve attachments");
    while ($attachment = db_fetch($return))
    {
        if (strlen($str_return))
            $str_return = $str_return . " \n";    
            $str_return .= "<br/>";
        $str_return = $str_return . " - Attached File: <a href='$path_to_root/admin/attachments.php?vw=".$attachment["id"]." ' target='blanc_'>ID: ". $attachment["id"] . " Description ". $attachment["description"]. " - ". $attachment["filename"]."</a>";
    }
    return $str_return;
}in ui_controls.inc line 179 just after $id = has_attachment($type_no, $trans_no); add
 
    $attach = get_attachment_string($type_no, $trans_no);
    echo $attach;FA team: the above function needs a bit styling but for now this will do the job.

