Skip to content

Commit

Permalink
Fix: problem for delete an attach file
Browse files Browse the repository at this point in the history
  • Loading branch information
hregis committed Mar 25, 2011
1 parent 2af2280 commit f298f30
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions htdocs/comm/mailing/fiche.php
Expand Up @@ -301,7 +301,7 @@
{
$mil = new Mailing($db);
$result=$mil->fetch($_POST["mailid"]);

$error=0;

$upload_dir = $conf->mailing->dir_output . "/" . get_exdir($mil->id,2,0,1);
Expand All @@ -312,7 +312,7 @@
$message='<div class="error">'.$langs->trans("ErrorFieldRequired",$langs->trans("MailTo")).'</div>';
$error++;
}

if (! $error)
{
// Ajout CSS
Expand Down Expand Up @@ -428,7 +428,7 @@
}

// Action update emailing
if (! empty($_POST["removedfile"]))
if (! empty($_POST["removedfileid"]))
{
$mil = new Mailing($db);
$mil->fetch($_POST["id"]);
Expand All @@ -438,7 +438,7 @@
$listofpaths=dol_dir_list($upload_dir,'all',0,'','','name',SORT_ASC,0);

// Remove file
$filenb=($_POST["removedfile"]-1);
$filenb=($_POST["removedfileid"]-1);
if (isset($listofpaths[$filenb]))
{
$result=dol_delete_file($listofpaths[$filenb]['fullname'],1);
Expand Down Expand Up @@ -653,7 +653,7 @@
$head = emailing_prepare_head($mil);

dol_fiche_head($head, 'card', $langs->trans("Mailing"), 0, 'email');

if ($message) print $message."<br>";

// Confirmation de la validation du mailing
Expand Down Expand Up @@ -757,7 +757,7 @@
$text=$langs->trans('NotEnoughPermissions');
print $html->textwithpicto($nbemail,$text,1,'warning');
}

}
else
{
Expand Down Expand Up @@ -915,7 +915,6 @@
foreach($listofpaths as $key => $val)
{
print img_mime($listofpaths[$key]['name']).' '.$listofpaths[$key]['name'];
//print ' <input type="image" style="border: 0px;" src="'.DOL_URL_ROOT.'/theme/'.$conf->theme.'/img/delete.png" value="'.($key+1).'" name="removedfile">';
print '<br>';
}
}
Expand Down Expand Up @@ -1002,7 +1001,8 @@
foreach($listofpaths as $key => $val)
{
print img_mime($listofpaths[$key]['name']).' '.$listofpaths[$key]['name'];
print ' <input type="image" style="border: 0px;" src="'.DOL_URL_ROOT.'/theme/'.$conf->theme.'/img/delete.png" value="'.($key+1).'" name="removedfile">';
print ' <input type="image" style="border: 0px;" src="'.DOL_URL_ROOT.'/theme/'.$conf->theme.'/img/delete.png" value="removedfile" name="removedfile" />';
print '<input type="hidden" name="removedfileid" value="'.($key+1).'" />';
print '<br>';
}
}
Expand Down

0 comments on commit f298f30

Please sign in to comment.