/[dolibarr]/dolibarr/htdocs/comm/action/document.php
ViewVC logotype

Diff of /dolibarr/htdocs/comm/action/document.php

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.2 by eldy, Tue Sep 6 16:34:46 2005 UTC revision 1.3 by eldy, Tue Sep 6 16:39:18 2005 UTC
# Line 41  $langs->load("commercial"); Line 41  $langs->load("commercial");
41  $langs->load("other");  $langs->load("other");
42  $langs->load("bills");  $langs->load("bills");
43    
44    if (isset($_GET["error"])) $error=$_GET["error"];
45    $upload_dir = $conf->actionscomm->dir_output.'/'.$_GET['id'];
46    
47  // Sécurité accés client  // Sécurité accés client
48  if ($user->societe_id > 0)  if ($user->societe_id > 0)
49  {  {
50    $action = '';    $action = '';
51    $socidp = $user->societe_id;    $socidp = $user->societe_id;
52  }  }
 if (isset($_GET["error"])) $error=$_GET["error"];  
53    
 $upload_dir = $conf->actionscomm->dir_output.'/'.$_GET['id'];  
54    
55  /*  /*
56   * Action envoie fichier   * Action envoie fichier
57   */   */
58  if ( $_POST["sendit"] && $conf->upload)  if ( $_POST["sendit"] && $conf->upload )
59  {  {
60      /*      /*
61       * Creation répertoire si n'existe pas       * Creation répertoire si n'existe pas
# Line 77  if ( $_POST["sendit"] && $conf->upload) Line 78  if ( $_POST["sendit"] && $conf->upload)
78      }      }
79  }  }
80    
81    /*
82     * Efface fichier
83     */
84    if ($_GET["action"] == 'delete')
85    {
86            $file = $upload_dir . '/' . urldecode($_GET['urlfile']);
87            dol_delete_file($file);
88    }
89    
90    
91    /*
92     * Affiche onglet
93     */
94    
95  llxHeader();  llxHeader();
96    
# Line 95  if ($_GET["id"] > 0) Line 108  if ($_GET["id"] > 0)
108      $res=$act->author->fetch();     // Le paramètre est le login, hors seul l'id est chargé.      $res=$act->author->fetch();     // Le paramètre est le login, hors seul l'id est chargé.
109      $res=$act->contact->fetch($act->contact->id);      $res=$act->contact->fetch($act->contact->id);
110    
         if ($action=='delete')  
         {  
                 $file = $upload_dir . '/' . urldecode($_GET['urlfile']);  
                 dol_delete_file($file);  
         }  
   
111          $h=0;          $h=0;
112    
113          $head[$h][0] = DOL_URL_ROOT.'/comm/action/fiche.php?id='.$_GET["id"];          $head[$h][0] = DOL_URL_ROOT.'/comm/action/fiche.php?id='.$_GET["id"];
# Line 221  if ($_GET["id"] > 0) Line 228  if ($_GET["id"] > 0)
228                                  print '<td align="right">'.filesize($upload_dir.'/'.$file). ' bytes</td>';                                  print '<td align="right">'.filesize($upload_dir.'/'.$file). ' bytes</td>';
229                                  print '<td align="center">'.strftime('%d %b %Y %H:%M:%S',filemtime($upload_dir.'/'.$file)).'</td>';                                  print '<td align="center">'.strftime('%d %b %Y %H:%M:%S',filemtime($upload_dir.'/'.$file)).'</td>';
230                                  print '<td align="center">';                                  print '<td align="center">';
231                                  if ($file == $propref . '.pdf')                                  print '<a href="'.DOL_URL_ROOT.'/comm/action/document.php?id='.$act->id.'&action=delete&urlfile='.urlencode($file).'">'.img_delete($langs->trans('Delete')).'</a>';
                                 {  
                                         echo '-';  
                                 }  
                                 else  
                                 {  
                                         echo '<a href="'.DOL_URL_ROOT.'/comm/action/document.php?id='.$act->id.'&action=delete&urlfile='.urlencode($file).'">'.img_delete($langs->trans('Delete')).'</a>';  
                                 }  
232                                  print "</td></tr>\n";                                  print "</td></tr>\n";
233                          }                          }
234                  }                  }

Legend:
Removed from v.1.2  
changed lines
  Added in v.1.3

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26