Qual: Use a so much simpler way to have ajax confirmation boxes

This commit is contained in:
Laurent Destailleur 2009-05-06 13:39:43 +00:00
parent db61b68e9e
commit 7c6016b355
46 changed files with 1160 additions and 1328 deletions

View File

@ -851,8 +851,8 @@ if ($rowid && $action != 'edit')
$formquestion=array( $formquestion=array(
array('label' => $langs->trans("LoginToCreate"), 'type' => 'text', 'name' => 'login', 'value' => $login)); array('label' => $langs->trans("LoginToCreate"), 'type' => 'text', 'name' => 'login', 'value' => $login));
$html->form_confirm($_SERVER["PHP_SELF"]."?rowid=".$adh->id,$langs->trans("CreateDolibarrLogin"),$langs->trans("ConfirmCreateLogin"),"confirm_create_user",$formquestion); $ret=$html->form_confirm($_SERVER["PHP_SELF"]."?rowid=".$adh->id,$langs->trans("CreateDolibarrLogin"),$langs->trans("ConfirmCreateLogin"),"confirm_create_user",$formquestion);
print '<br>'; if ($ret == 'html') print '<br>';
} }
// Confirm create third party // Confirm create third party
@ -874,15 +874,15 @@ if ($rowid && $action != 'edit')
$formquestion=array( $formquestion=array(
array('label' => $langs->trans("NameToCreate"), 'type' => 'text', 'name' => 'companyname', 'value' => $name)); array('label' => $langs->trans("NameToCreate"), 'type' => 'text', 'name' => 'companyname', 'value' => $name));
$html->form_confirm($_SERVER["PHP_SELF"]."?rowid=".$adh->id,$langs->trans("CreateDolibarrThirdParty"),$langs->trans("ConfirmCreateThirdParty"),"confirm_create_thirdparty",$formquestion); $ret=$html->form_confirm($_SERVER["PHP_SELF"]."?rowid=".$adh->id,$langs->trans("CreateDolibarrThirdParty"),$langs->trans("ConfirmCreateThirdParty"),"confirm_create_thirdparty",$formquestion);
print '<br>'; if ($ret == 'html') print '<br>';
} }
// Confirm remove member // Confirm remove member
if ($action == 'delete') if ($action == 'delete')
{ {
$html->form_confirm("fiche.php?rowid=$rowid",$langs->trans("DeleteMember"),$langs->trans("ConfirmDeleteMember"),"confirm_delete"); $ret=$html->form_confirm("fiche.php?rowid=$rowid",$langs->trans("DeleteMember"),$langs->trans("ConfirmDeleteMember"),"confirm_delete");
print '<br>'; if ($ret == 'html') print '<br>';
} }
// Confirm validate member // Confirm validate member
@ -892,15 +892,15 @@ if ($rowid && $action != 'edit')
$formquestion=array(); $formquestion=array();
if ($adh->email) $formquestion[0]=array('type' => 'checkbox', 'name' => 'send_mail', 'label' => $langs->trans("SendAnEMailToMember",$adh->email), 'value' => 'true'); if ($adh->email) $formquestion[0]=array('type' => 'checkbox', 'name' => 'send_mail', 'label' => $langs->trans("SendAnEMailToMember",$adh->email), 'value' => 'true');
$html->form_confirm("fiche.php?rowid=$rowid",$langs->trans("ValidateMember"),$langs->trans("ConfirmValidateMember"),"confirm_valid",$formquestion); $ret=$html->form_confirm("fiche.php?rowid=$rowid",$langs->trans("ValidateMember"),$langs->trans("ConfirmValidateMember"),"confirm_valid",$formquestion);
print '<br>'; if ($ret == 'html') print '<br>';
} }
// Confirm send card by mail // Confirm send card by mail
if ($action == 'sendinfo') if ($action == 'sendinfo')
{ {
$html->form_confirm("fiche.php?rowid=$rowid",$langs->trans("SendCardByMail"),$langs->trans("ConfirmSendCardByMail"),"confirm_sendinfo"); $ret=$html->form_confirm("fiche.php?rowid=$rowid",$langs->trans("SendCardByMail"),$langs->trans("ConfirmSendCardByMail"),"confirm_sendinfo");
print '<br>'; if ($ret == 'html') print '<br>';
} }
// Confirm resiliate // Confirm resiliate
@ -915,8 +915,8 @@ if ($rowid && $action != 'edit')
$label.=')'; $label.=')';
if ($adh->email) $formquestion[0]=array('type' => 'checkbox', 'name' => 'send_mail', 'label' => $label, 'value' => ($conf->global->ADHERENT_DEFAULT_SENDINFOBYMAIL?'true':'false')); if ($adh->email) $formquestion[0]=array('type' => 'checkbox', 'name' => 'send_mail', 'label' => $label, 'value' => ($conf->global->ADHERENT_DEFAULT_SENDINFOBYMAIL?'true':'false'));
$html->form_confirm("fiche.php?rowid=$rowid",$langs->trans("ResiliateMember"),$langs->trans("ConfirmResiliateMember"),"confirm_resign",$formquestion); $ret=$html->form_confirm("fiche.php?rowid=$rowid",$langs->trans("ResiliateMember"),$langs->trans("ConfirmResiliateMember"),"confirm_resign",$formquestion);
print '<br>'; if ($ret == 'html') print '<br>';
} }
/* /*
@ -924,8 +924,8 @@ if ($rowid && $action != 'edit')
*/ */
if ($action == 'add_spip') if ($action == 'add_spip')
{ {
$html->form_confirm("fiche.php?rowid=$rowid","Ajouter dans spip","Etes-vous sur de vouloir ajouter cet adherent dans spip ? (serveur : ".ADHERENT_SPIP_SERVEUR.")","confirm_add_spip"); $ret=$html->form_confirm("fiche.php?rowid=$rowid","Ajouter dans spip","Etes-vous sur de vouloir ajouter cet adherent dans spip ? (serveur : ".ADHERENT_SPIP_SERVEUR.")","confirm_add_spip");
print '<br>'; if ($ret == 'html') print '<br>';
} }
/* /*
@ -933,8 +933,8 @@ if ($rowid && $action != 'edit')
*/ */
if ($action == 'del_spip') if ($action == 'del_spip')
{ {
$html->form_confirm("fiche.php?rowid=$rowid","Supprimer dans spip","Etes-vous sur de vouloir effacer cet adherent dans spip ? (serveur : ".ADHERENT_SPIP_SERVEUR.")","confirm_del_spip"); $ret=$html->form_confirm("fiche.php?rowid=$rowid","Supprimer dans spip","Etes-vous sur de vouloir effacer cet adherent dans spip ? (serveur : ".ADHERENT_SPIP_SERVEUR.")","confirm_del_spip");
print '<br>'; if ($ret == 'html') print '<br>';
} }

View File

@ -297,8 +297,8 @@ if ($rowid && $action != 'edit')
//$formquestion['text']='<b>'.$langs->trans("ThisWillAlsoDeleteBankRecord").'</b>'; //$formquestion['text']='<b>'.$langs->trans("ThisWillAlsoDeleteBankRecord").'</b>';
$text=$langs->trans("ConfirmDeleteSubscription"); $text=$langs->trans("ConfirmDeleteSubscription");
if ($conf->banque->enabled && $conf->global->ADHERENT_BANK_USE) $text.='<br>'.img_warning().' '.$langs->trans("ThisWillAlsoDeleteBankRecord"); if ($conf->banque->enabled && $conf->global->ADHERENT_BANK_USE) $text.='<br>'.img_warning().' '.$langs->trans("ThisWillAlsoDeleteBankRecord");
$form->form_confirm($_SERVER["PHP_SELF"]."?rowid=".$subscription->id,$langs->trans("DeleteSubscription"),$text,"confirm_delete",$formquestion); $ret=$form->form_confirm($_SERVER["PHP_SELF"]."?rowid=".$subscription->id,$langs->trans("DeleteSubscription"),$text,"confirm_delete",$formquestion);
print '<br>'; if ($ret == 'html') print '<br>';
} }
print '<form action="'.$_SERVER["PHP_SELF"].'" method="post">'; print '<form action="'.$_SERVER["PHP_SELF"].'" method="post">';

View File

@ -35,7 +35,7 @@ $langs->load("admin");
$langs->load("companies"); $langs->load("companies");
if (!$user->admin) if (!$user->admin)
accessforbidden(); accessforbidden();
$acts[0] = "activate"; $acts[0] = "activate";
$acts[1] = "disable"; $acts[1] = "disable";
@ -241,114 +241,114 @@ $sortorder=$_GET["sortorder"];
*/ */
if ($_POST["actionadd"] || $_POST["actionmodify"]) if ($_POST["actionadd"] || $_POST["actionmodify"])
{ {
$listfield=split(',',$tabfield[$_POST["id"]]); $listfield=split(',',$tabfield[$_POST["id"]]);
$listfieldinsert=split(',',$tabfieldinsert[$_POST["id"]]); $listfieldinsert=split(',',$tabfieldinsert[$_POST["id"]]);
$listfieldmodify=split(',',$tabfieldinsert[$_POST["id"]]); $listfieldmodify=split(',',$tabfieldinsert[$_POST["id"]]);
$listfieldvalue=split(',',$tabfieldvalue[$_POST["id"]]); $listfieldvalue=split(',',$tabfieldvalue[$_POST["id"]]);
// Verifie que tous les champs sont renseign<67>s // Verifie que tous les champs sont renseign<67>s
$ok=1; $ok=1;
foreach ($listfield as $f => $value) { foreach ($listfield as $f => $value) {
if (! isset($_POST[$value]) || $_POST[$value]=='') { if (! isset($_POST[$value]) || $_POST[$value]=='') {
$ok=0; $ok=0;
$msg.=$langs->trans("ErrorFieldRequired",$listfield[$f]).'<br>'; $msg.=$langs->trans("ErrorFieldRequired",$listfield[$f]).'<br>';
} }
} }
// Autres verif // Autres verif
if (isset($_POST["code"]) && $_POST["code"]=='0') { if (isset($_POST["code"]) && $_POST["code"]=='0') {
$ok=0; $ok=0;
$msg.="Le Code ne peut avoir la valeur 0<br>"; $msg.="Le Code ne peut avoir la valeur 0<br>";
} }
if (isset($_POST["pays"]) && $_POST["pays"]=='0') { if (isset($_POST["pays"]) && $_POST["pays"]=='0') {
$ok=0; $ok=0;
$msg.=$langs->trans("ErrorFieldRequired",$langs->trans("Country")).'<br>'; $msg.=$langs->trans("ErrorFieldRequired",$langs->trans("Country")).'<br>';
} }
// Si verif ok et action add, on ajoute la ligne // Si verif ok et action add, on ajoute la ligne
if ($ok && $_POST["actionadd"]) { if ($ok && $_POST["actionadd"]) {
if ($tabrowid[$_POST["id"]]) { if ($tabrowid[$_POST["id"]]) {
// Recupere id libre pour insertion // Recupere id libre pour insertion
$newid=0; $newid=0;
$sql = "SELECT max(".$tabrowid[$_POST["id"]].") newid from ".$tabname[$_POST["id"]]; $sql = "SELECT max(".$tabrowid[$_POST["id"]].") newid from ".$tabname[$_POST["id"]];
$result = $db->query($sql); $result = $db->query($sql);
if ($result) if ($result)
{ {
$obj = $db->fetch_object($result); $obj = $db->fetch_object($result);
$newid=($obj->newid + 1); $newid=($obj->newid + 1);
} else { } else {
dol_print_error($db); dol_print_error($db);
} }
} }
// Add new entry // Add new entry
$sql = "INSERT INTO ".$tabname[$_POST["id"]]." ("; $sql = "INSERT INTO ".$tabname[$_POST["id"]]." (";
// List of fields // List of fields
if ($tabrowid[$_POST["id"]] && if ($tabrowid[$_POST["id"]] &&
! in_array($tabrowid[$_POST["id"]],$listfieldinsert)) $sql.= $tabrowid[$_POST["id"]].","; ! in_array($tabrowid[$_POST["id"]],$listfieldinsert)) $sql.= $tabrowid[$_POST["id"]].",";
$sql.= $tabfieldinsert[$_POST["id"]]; $sql.= $tabfieldinsert[$_POST["id"]];
$sql.=",active)"; $sql.=",active)";
$sql.= " VALUES("; $sql.= " VALUES(";
// List of values // List of values
if ($tabrowid[$_POST["id"]] && if ($tabrowid[$_POST["id"]] &&
! in_array($tabrowid[$_POST["id"]],$listfieldinsert)) $sql.= $newid.","; ! in_array($tabrowid[$_POST["id"]],$listfieldinsert)) $sql.= $newid.",";
$i=0; $i=0;
foreach ($listfieldinsert as $f => $value) foreach ($listfieldinsert as $f => $value)
{ {
if ($value == 'price') { $_POST[$listfieldvalue[$i]] = price2num($_POST[$listfieldvalue[$i]],'MU'); } if ($value == 'price') { $_POST[$listfieldvalue[$i]] = price2num($_POST[$listfieldvalue[$i]],'MU'); }
if ($i) $sql.=","; if ($i) $sql.=",";
$sql.="'".addslashes($_POST[$listfieldvalue[$i]])."'"; $sql.="'".addslashes($_POST[$listfieldvalue[$i]])."'";
$i++; $i++;
} }
$sql.=",1)"; $sql.=",1)";
dol_syslog("dict actionadd sql=".$sql); dol_syslog("dict actionadd sql=".$sql);
$result = $db->query($sql); $result = $db->query($sql);
if (!$result) if (!$result)
{ {
if ($db->errno() == 'DB_ERROR_RECORD_ALREADY_EXISTS') { if ($db->errno() == 'DB_ERROR_RECORD_ALREADY_EXISTS') {
$msg=$langs->trans("ErrorRecordAlreadyExists").'<br>'; $msg=$langs->trans("ErrorRecordAlreadyExists").'<br>';
} }
else { else {
dol_print_error($db); dol_print_error($db);
} }
} }
} }
// Si verif ok et action modify, on modifie la ligne // Si verif ok et action modify, on modifie la ligne
if ($ok && $_POST["actionmodify"]) { if ($ok && $_POST["actionmodify"]) {
if ($tabrowid[$_POST["id"]]) { $rowidcol=$tabrowid[$_POST["id"]]; } if ($tabrowid[$_POST["id"]]) { $rowidcol=$tabrowid[$_POST["id"]]; }
else { $rowidcol="rowid"; } else { $rowidcol="rowid"; }
// Modify entry // Modify entry
$sql = "UPDATE ".$tabname[$_POST["id"]]." SET "; $sql = "UPDATE ".$tabname[$_POST["id"]]." SET ";
// Modifie valeur des champs // Modifie valeur des champs
if ($tabrowid[$_POST["id"]] && !in_array($tabrowid[$_POST["id"]],$listfieldmodify)) if ($tabrowid[$_POST["id"]] && !in_array($tabrowid[$_POST["id"]],$listfieldmodify))
{ {
$sql.= $tabrowid[$_POST["id"]]."="; $sql.= $tabrowid[$_POST["id"]]."=";
$sql.= "'".addslashes($_POST["rowid"])."', "; $sql.= "'".addslashes($_POST["rowid"])."', ";
} }
$i = 0; $i = 0;
foreach ($listfieldmodify as $field) { foreach ($listfieldmodify as $field) {
if ($field == 'price') { $_POST[$listfieldvalue[$i]] = price2num($_POST[$listfieldvalue[$i]],'MU'); } if ($field == 'price') { $_POST[$listfieldvalue[$i]] = price2num($_POST[$listfieldvalue[$i]],'MU'); }
if ($i) $sql.=","; if ($i) $sql.=",";
$sql.= $field."="; $sql.= $field."=";
$sql.= "'".addslashes($_POST[$listfieldvalue[$i]])."'"; $sql.= "'".addslashes($_POST[$listfieldvalue[$i]])."'";
$i++; $i++;
} }
$sql.= " WHERE ".$rowidcol." = '".$_POST["rowid"]."'"; $sql.= " WHERE ".$rowidcol." = '".$_POST["rowid"]."'";
dol_syslog("dict actionmodify sql=".$sql); dol_syslog("dict actionmodify sql=".$sql);
//print $sql; //print $sql;
$resql = $db->query($sql); $resql = $db->query($sql);
if (! $resql) if (! $resql)
{ {
$msg=$db->error(); $msg=$db->error();
} }
} }
if ($msg) $msg='<div class="error">'.$msg.'</div>'; if ($msg) $msg='<div class="error">'.$msg.'</div>';
$_GET["id"]=$_POST["id"]; // Force affichage dictionnaire en cours d'edition $_GET["id"]=$_POST["id"]; // Force affichage dictionnaire en cours d'edition
} }
if ($_POST["actioncancel"]) if ($_POST["actioncancel"])
@ -358,62 +358,62 @@ if ($_POST["actioncancel"])
if ($_POST['action'] == 'confirm_delete' && $_POST['confirm'] == 'yes') // delete if ($_POST['action'] == 'confirm_delete' && $_POST['confirm'] == 'yes') // delete
{ {
if ($tabrowid[$_GET["id"]]) { $rowidcol=$tabrowid[$_GET["id"]]; } if ($tabrowid[$_GET["id"]]) { $rowidcol=$tabrowid[$_GET["id"]]; }
else { $rowidcol="rowid"; } else { $rowidcol="rowid"; }
$sql = "DELETE from ".$tabname[$_GET["id"]]." WHERE ".$rowidcol."='".$_GET["rowid"]."'"; $sql = "DELETE from ".$tabname[$_GET["id"]]." WHERE ".$rowidcol."='".$_GET["rowid"]."'";
dol_syslog("dict delete sql=".$sql); dol_syslog("dict delete sql=".$sql);
$result = $db->query($sql); $result = $db->query($sql);
if (! $result) if (! $result)
{ {
if ($db->errno() == 'DB_ERROR_CHILD_EXISTS') if ($db->errno() == 'DB_ERROR_CHILD_EXISTS')
{ {
$msg='<div class="error">'.$langs->trans("ErrorRecordIsUsedByChild").'</div>'; $msg='<div class="error">'.$langs->trans("ErrorRecordIsUsedByChild").'</div>';
} }
else else
{ {
dol_print_error($db); dol_print_error($db);
} }
} }
} }
if ($_GET["action"] == $acts[0]) // activate if ($_GET["action"] == $acts[0]) // activate
{ {
if ($tabrowid[$_GET["id"]]) { $rowidcol=$tabrowid[$_GET["id"]]; } if ($tabrowid[$_GET["id"]]) { $rowidcol=$tabrowid[$_GET["id"]]; }
else { $rowidcol="rowid"; } else { $rowidcol="rowid"; }
if ($_GET["rowid"]) { if ($_GET["rowid"]) {
$sql = "UPDATE ".$tabname[$_GET["id"]]." SET active = 1 WHERE ".$rowidcol."='".$_GET["rowid"]."'"; $sql = "UPDATE ".$tabname[$_GET["id"]]." SET active = 1 WHERE ".$rowidcol."='".$_GET["rowid"]."'";
} }
elseif ($_GET["code"]) { elseif ($_GET["code"]) {
$sql = "UPDATE ".$tabname[$_GET["id"]]." SET active = 1 WHERE code='".$_GET["code"]."'"; $sql = "UPDATE ".$tabname[$_GET["id"]]." SET active = 1 WHERE code='".$_GET["code"]."'";
} }
$result = $db->query($sql); $result = $db->query($sql);
if (!$result) if (!$result)
{ {
dol_print_error($db); dol_print_error($db);
} }
} }
if ($_GET["action"] == $acts[1]) // disable if ($_GET["action"] == $acts[1]) // disable
{ {
if ($tabrowid[$_GET["id"]]) { $rowidcol=$tabrowid[$_GET["id"]]; } if ($tabrowid[$_GET["id"]]) { $rowidcol=$tabrowid[$_GET["id"]]; }
else { $rowidcol="rowid"; } else { $rowidcol="rowid"; }
if ($_GET["rowid"]) { if ($_GET["rowid"]) {
$sql = "UPDATE ".$tabname[$_GET["id"]]." SET active = 0 WHERE ".$rowidcol."='".$_GET["rowid"]."'"; $sql = "UPDATE ".$tabname[$_GET["id"]]." SET active = 0 WHERE ".$rowidcol."='".$_GET["rowid"]."'";
} }
elseif ($_GET["code"]) { elseif ($_GET["code"]) {
$sql = "UPDATE ".$tabname[$_GET["id"]]." SET active = 0 WHERE code='".$_GET["code"]."'"; $sql = "UPDATE ".$tabname[$_GET["id"]]." SET active = 0 WHERE code='".$_GET["code"]."'";
} }
$result = $db->query($sql); $result = $db->query($sql);
if (!$result) if (!$result)
{ {
dol_print_error($db); dol_print_error($db);
} }
} }
@ -440,180 +440,180 @@ if (empty($_GET["id"]))
print $langs->trans("DictionnaryDesc"); print $langs->trans("DictionnaryDesc");
print " ".$langs->trans("OnlyActiveElementsAreShown")."<br>\n"; print " ".$langs->trans("OnlyActiveElementsAreShown")."<br>\n";
} }
print "<br>\n"; print "<br>\n";
/* /*
* Confirmation de la suppression de la ligne * Confirmation de la suppression de la ligne
*/ */
if ($_GET['action'] == 'delete') if ($_GET['action'] == 'delete')
{ {
$html = new Form($db); $ret=$html->form_confirm($_SERVER["PHP_SELF"].'?sortfield='.$sortfield.'&sortorder='.$sortorder.'&rowid='.$_GET["rowid"].'&amp;code='.$_GET["code"].'&amp;id='.$_GET["id"], $langs->trans('DeleteLine'), $langs->trans('ConfirmDeleteLine'), 'confirm_delete');
$html->form_confirm($_SERVER["PHP_SELF"].'?sortfield='.$sortfield.'&sortorder='.$sortorder.'&rowid='.$_GET["rowid"].'&amp;code='.$_GET["code"].'&amp;id='.$_GET["id"], $langs->trans('DeleteLine'), $langs->trans('ConfirmDeleteLine'), 'confirm_delete'); if ($ret == 'html') print '<br>';
print '<br>'; }
}
/* /*
* Affichage d'un dictionnaire particulier * Affichage d'un dictionnaire particulier
*/ */
if ($_GET["id"]) if ($_GET["id"])
{ {
if ($msg) if ($msg)
{ {
print $msg.'<br>'; print $msg.'<br>';
} }
// Complete requete recherche valeurs avec critere de tri // Complete requete recherche valeurs avec critere de tri
$sql=$tabsql[$_GET["id"]]; $sql=$tabsql[$_GET["id"]];
if ($_GET["sortfield"]) if ($_GET["sortfield"])
{ {
$sql.= " ORDER BY ".$_GET["sortfield"]; $sql.= " ORDER BY ".$_GET["sortfield"];
if ($_GET["sortorder"]) if ($_GET["sortorder"])
{ {
$sql.=" ".strtoupper($_GET["sortorder"]); $sql.=" ".strtoupper($_GET["sortorder"]);
} }
$sql.=", "; $sql.=", ";
// Remove from default sort order the choosed order // Remove from default sort order the choosed order
$tabsqlsort[$_GET["id"]]=eregi_replace($_GET["sortfield"].' '.$_GET["sortorder"].',','',$tabsqlsort[$_GET["id"]]); $tabsqlsort[$_GET["id"]]=eregi_replace($_GET["sortfield"].' '.$_GET["sortorder"].',','',$tabsqlsort[$_GET["id"]]);
$tabsqlsort[$_GET["id"]]=eregi_replace($_GET["sortfield"].',','',$tabsqlsort[$_GET["id"]]); $tabsqlsort[$_GET["id"]]=eregi_replace($_GET["sortfield"].',','',$tabsqlsort[$_GET["id"]]);
} }
else { else {
$sql.=" ORDER BY "; $sql.=" ORDER BY ";
} }
$sql.=$tabsqlsort[$_GET["id"]]; $sql.=$tabsqlsort[$_GET["id"]];
//print $sql; //print $sql;
$fieldlist=split(',',$tabfield[$_GET["id"]]);
print '<form action="dict.php" method="post">'; $fieldlist=split(',',$tabfield[$_GET["id"]]);
print '<table class="noborder" width="100%">';
// Ligne d'ajout print '<form action="dict.php" method="post">';
if ($tabname[$_GET["id"]]) print '<table class="noborder" width="100%">';
{
$alabelisused=0;
$var=false;
$fieldlist=split(',',$tabfield[$_GET["id"]]);
// print '<table class="noborder" width="100%">';
// Ligne de titre d'ajout // Ligne d'ajout
print '<tr class="liste_titre">'; if ($tabname[$_GET["id"]])
foreach ($fieldlist as $field => $value) {
{ $alabelisused=0;
// Determine le nom du champ par rapport aux noms possibles $var=false;
// dans les dictionnaires de donnees
$valuetoshow=ucfirst($fieldlist[$field]); // Par defaut
if ($fieldlist[$field]=='source') { $valuetoshow=$langs->trans("Contact"); }
if ($fieldlist[$field]=='price') { $valuetoshow=$langs->trans("PriceUHT"); }
if ($fieldlist[$field]=='organization') { $valuetoshow=$langs->trans("Organization"); }
if ($fieldlist[$field]=='lang') { $valuetoshow=$langs->trans("Language"); }
if ($fieldlist[$field]=='type') { $valuetoshow=$langs->trans("Type"); }
if ($fieldlist[$field]=='code') { $valuetoshow=$langs->trans("Code"); }
if ($fieldlist[$field]=='libelle' || $fieldlist[$field]=='label') { $valuetoshow=$langs->trans("Label")."*"; }
if ($fieldlist[$field]=='libelle_facture') { $valuetoshow=$langs->trans("LabelOnDocuments")."*"; }
if ($fieldlist[$field]=='pays') { $valuetoshow=$langs->trans("Country"); }
if ($fieldlist[$field]=='recuperableonly') { $valuetoshow=MAIN_LABEL_MENTION_NPR; }
if ($fieldlist[$field]=='nbjour') { $valuetoshow=$langs->trans("NbOfDays"); }
if ($fieldlist[$field]=='fdm') { $valuetoshow=$langs->trans("AtEndOfMonth"); }
if ($fieldlist[$field]=='decalage') { $valuetoshow=$langs->trans("Offset"); }
if ($fieldlist[$field]=='width') { $valuetoshow=$langs->trans("Width"); }
if ($fieldlist[$field]=='height') { $valuetoshow=$langs->trans("Height"); }
if ($fieldlist[$field]=='unit') { $valuetoshow=$langs->trans("MeasuringUnit"); }
if ($fieldlist[$field]=='region_id' || $fieldlist[$field]=='pays_id') { $valuetoshow=''; }
if ($valuetoshow != '') $fieldlist=split(',',$tabfield[$_GET["id"]]);
{ // print '<table class="noborder" width="100%">';
print '<td>';
print $valuetoshow;
print '</td>';
}
if ($fieldlist[$field]=='libelle') $alabelisused=1; // Ligne de titre d'ajout
} print '<tr class="liste_titre">';
print '<td colspan="3">&nbsp;</td>'; foreach ($fieldlist as $field => $value)
print '<input type="hidden" name="id" value="'.$_GET["id"].'">'; {
print '</tr>'; // Determine le nom du champ par rapport aux noms possibles
// dans les dictionnaires de donnees
$valuetoshow=ucfirst($fieldlist[$field]); // Par defaut
if ($fieldlist[$field]=='source') { $valuetoshow=$langs->trans("Contact"); }
if ($fieldlist[$field]=='price') { $valuetoshow=$langs->trans("PriceUHT"); }
if ($fieldlist[$field]=='organization') { $valuetoshow=$langs->trans("Organization"); }
if ($fieldlist[$field]=='lang') { $valuetoshow=$langs->trans("Language"); }
if ($fieldlist[$field]=='type') { $valuetoshow=$langs->trans("Type"); }
if ($fieldlist[$field]=='code') { $valuetoshow=$langs->trans("Code"); }
if ($fieldlist[$field]=='libelle' || $fieldlist[$field]=='label') { $valuetoshow=$langs->trans("Label")."*"; }
if ($fieldlist[$field]=='libelle_facture') { $valuetoshow=$langs->trans("LabelOnDocuments")."*"; }
if ($fieldlist[$field]=='pays') { $valuetoshow=$langs->trans("Country"); }
if ($fieldlist[$field]=='recuperableonly') { $valuetoshow=MAIN_LABEL_MENTION_NPR; }
if ($fieldlist[$field]=='nbjour') { $valuetoshow=$langs->trans("NbOfDays"); }
if ($fieldlist[$field]=='fdm') { $valuetoshow=$langs->trans("AtEndOfMonth"); }
if ($fieldlist[$field]=='decalage') { $valuetoshow=$langs->trans("Offset"); }
if ($fieldlist[$field]=='width') { $valuetoshow=$langs->trans("Width"); }
if ($fieldlist[$field]=='height') { $valuetoshow=$langs->trans("Height"); }
if ($fieldlist[$field]=='unit') { $valuetoshow=$langs->trans("MeasuringUnit"); }
if ($fieldlist[$field]=='region_id' || $fieldlist[$field]=='pays_id') { $valuetoshow=''; }
// Ligne d'ajout if ($valuetoshow != '')
print "<tr ".$bc[$var].">";
fieldList($fieldlist);
print '<td colspan="3"><input type="submit" class="button" name="actionadd" value="'.$langs->trans("Add").'"></td>';
print "</tr>";
if ($alabelisused) // Si un des champs est un libelle
{
print '<tr><td colspan="'.(count($fieldlist)+2).'">* '.$langs->trans("LabelUsedByDefault").'.</td></tr>';
}
print '<tr><td colspan="'.(count($fieldlist)+2).'">&nbsp;</td></tr>';
}
// Affiche table des valeurs
dol_syslog("htdocs/admin/dict sql=".$sql, LOG_DEBUG);
$resql=$db->query($sql);
if ($resql)
{
$num = $db->num_rows($resql);
$i = 0;
$var=true;
if ($num)
{
// Ligne de titre
print '<tr class="liste_titre">';
foreach ($fieldlist as $field => $value)
{ {
// Determine le nom du champ par rapport aux noms possibles print '<td>';
// dans les dictionnaires de donnees print $valuetoshow;
$showfield=1; // Par defaut print '</td>';
$valuetoshow=ucfirst($fieldlist[$field]); // Par defaut }
if ($fieldlist[$field]=='source') { $valuetoshow=$langs->trans("Contact"); }
if ($fieldlist[$field]=='price') { $valuetoshow=$langs->trans("PriceUHT"); }
if ($fieldlist[$field]=='organization') { $valuetoshow=$langs->trans("Organization"); }
if ($fieldlist[$field]=='lang') { $valuetoshow=$langs->trans("Language"); }
if ($fieldlist[$field]=='type') { $valuetoshow=$langs->trans("Type"); }
if ($fieldlist[$field]=='code') { $valuetoshow=$langs->trans("Code"); }
if ($fieldlist[$field]=='libelle' || $fieldlist[$field]=='label') { $valuetoshow=$langs->trans("Label")."*"; }
if ($fieldlist[$field]=='libelle_facture') { $valuetoshow=$langs->trans("LabelOnDocuments")."*"; }
if ($fieldlist[$field]=='pays') { $valuetoshow=$langs->trans("Country"); }
if ($fieldlist[$field]=='recuperableonly') { $valuetoshow=MAIN_LABEL_MENTION_NPR; }
if ($fieldlist[$field]=='nbjour') { $valuetoshow=$langs->trans("NbOfDays"); }
if ($fieldlist[$field]=='fdm') { $valuetoshow=$langs->trans("AtEndOfMonth"); }
if ($fieldlist[$field]=='decalage') { $valuetoshow=$langs->trans("Offset"); }
if ($fieldlist[$field]=='width') { $valuetoshow=$langs->trans("Width"); }
if ($fieldlist[$field]=='height') { $valuetoshow=$langs->trans("Height"); }
if ($fieldlist[$field]=='unit') { $valuetoshow=$langs->trans("MeasuringUnit"); }
if ($fieldlist[$field]=='region_id' || $fieldlist[$field]=='pays_id') { $showfield=0; }
// Affiche nom du champ
if ($showfield)
{
print_liste_field_titre($valuetoshow,"dict.php",$fieldlist[$field],"&id=".$_GET["id"],"","",$sortfield,$sortorder);
}
}
print_liste_field_titre($langs->trans("Action"),"dict.php","active","&id=".$_GET["id"],"",'align="center"',$sortfield,$sortorder);
print '<td colspan="2">&nbsp;</td>';
print '</tr>';
// Lignes de valeurs if ($fieldlist[$field]=='libelle') $alabelisused=1;
while ($i < $num) }
{ print '<td colspan="3">';
$obj = $db->fetch_object($resql); print '<input type="hidden" name="id" value="'.$_GET["id"].'">';
$var=!$var; print '&nbsp;</td>';
print '</tr>';
// Ligne d'ajout
print "<tr ".$bc[$var].">";
fieldList($fieldlist);
print '<td colspan="3"><input type="submit" class="button" name="actionadd" value="'.$langs->trans("Add").'"></td>';
print "</tr>";
if ($alabelisused) // Si un des champs est un libelle
{
print '<tr><td colspan="'.(count($fieldlist)+2).'">* '.$langs->trans("LabelUsedByDefault").'.</td></tr>';
}
print '<tr><td colspan="'.(count($fieldlist)+2).'">&nbsp;</td></tr>';
}
// Affiche table des valeurs
dol_syslog("htdocs/admin/dict sql=".$sql, LOG_DEBUG);
$resql=$db->query($sql);
if ($resql)
{
$num = $db->num_rows($resql);
$i = 0;
$var=true;
if ($num)
{
// Ligne de titre
print '<tr class="liste_titre">';
foreach ($fieldlist as $field => $value)
{
// Determine le nom du champ par rapport aux noms possibles
// dans les dictionnaires de donnees
$showfield=1; // Par defaut
$valuetoshow=ucfirst($fieldlist[$field]); // Par defaut
if ($fieldlist[$field]=='source') { $valuetoshow=$langs->trans("Contact"); }
if ($fieldlist[$field]=='price') { $valuetoshow=$langs->trans("PriceUHT"); }
if ($fieldlist[$field]=='organization') { $valuetoshow=$langs->trans("Organization"); }
if ($fieldlist[$field]=='lang') { $valuetoshow=$langs->trans("Language"); }
if ($fieldlist[$field]=='type') { $valuetoshow=$langs->trans("Type"); }
if ($fieldlist[$field]=='code') { $valuetoshow=$langs->trans("Code"); }
if ($fieldlist[$field]=='libelle' || $fieldlist[$field]=='label') { $valuetoshow=$langs->trans("Label")."*"; }
if ($fieldlist[$field]=='libelle_facture') { $valuetoshow=$langs->trans("LabelOnDocuments")."*"; }
if ($fieldlist[$field]=='pays') { $valuetoshow=$langs->trans("Country"); }
if ($fieldlist[$field]=='recuperableonly') { $valuetoshow=MAIN_LABEL_MENTION_NPR; }
if ($fieldlist[$field]=='nbjour') { $valuetoshow=$langs->trans("NbOfDays"); }
if ($fieldlist[$field]=='fdm') { $valuetoshow=$langs->trans("AtEndOfMonth"); }
if ($fieldlist[$field]=='decalage') { $valuetoshow=$langs->trans("Offset"); }
if ($fieldlist[$field]=='width') { $valuetoshow=$langs->trans("Width"); }
if ($fieldlist[$field]=='height') { $valuetoshow=$langs->trans("Height"); }
if ($fieldlist[$field]=='unit') { $valuetoshow=$langs->trans("MeasuringUnit"); }
if ($fieldlist[$field]=='region_id' || $fieldlist[$field]=='pays_id') { $showfield=0; }
// Affiche nom du champ
if ($showfield)
{
print_liste_field_titre($valuetoshow,"dict.php",$fieldlist[$field],"&id=".$_GET["id"],"","",$sortfield,$sortorder);
}
}
print_liste_field_titre($langs->trans("Action"),"dict.php","active","&id=".$_GET["id"],"",'align="center"',$sortfield,$sortorder);
print '<td colspan="2">&nbsp;</td>';
print '</tr>';
// Lignes de valeurs
while ($i < $num)
{
$obj = $db->fetch_object($resql);
$var=!$var;
//print_r($obj); //print_r($obj);
print "<tr $bc[$var]>"; print "<tr $bc[$var]>";
if ($_GET["action"] == 'modify' && ($_GET["rowid"] == ($obj->rowid?$obj->rowid:$obj->code))) if ($_GET["action"] == 'modify' && ($_GET["rowid"] == ($obj->rowid?$obj->rowid:$obj->code)))
{ {
print '<form action="dict.php" method="post">'; print '<form action="dict.php" method="post">';
print '<input type="hidden" name="id" value="'.$_GET["id"].'">'; print '<input type="hidden" name="id" value="'.$_GET["id"].'">';
print '<input type="hidden" name="rowid" value="'.$_GET["rowid"].'">'; print '<input type="hidden" name="rowid" value="'.$_GET["rowid"].'">';
fieldList($fieldlist,$obj); fieldList($fieldlist,$obj);
print '<td colspan="3" align="right"><a name="'.($obj->rowid?$obj->rowid:$obj->code).'">&nbsp;</a><input type="submit" class="button" name="actionmodify" value="'.$langs->trans("Modify").'">'; print '<td colspan="3" align="right"><a name="'.($obj->rowid?$obj->rowid:$obj->code).'">&nbsp;</a><input type="submit" class="button" name="actionmodify" value="'.$langs->trans("Modify").'">';
print '&nbsp;<input type="submit" class="button" name="actioncancel" value="'.$langs->trans("Cancel").'"></td>'; print '&nbsp;<input type="submit" class="button" name="actioncancel" value="'.$langs->trans("Cancel").'"></td>';
} }
else else
{ {
foreach ($fieldlist as $field => $value) foreach ($fieldlist as $field => $value)
{ {
$showfield=1; $showfield=1;
@ -646,68 +646,68 @@ if ($_GET["id"])
print $langs->trans("AlwaysActive"); print $langs->trans("AlwaysActive");
} }
print "</td>"; print "</td>";
if ($iserasable) { if ($iserasable) {
print '<td align="center"><a href="dict.php?sortfield='.$sortfield.'&sortorder='.$sortorder.'&rowid='.($obj->rowid?$obj->rowid:$obj->code).'&amp;code='.$obj->code.'&amp;id='.$_GET["id"].'&amp;action=modify#'.($obj->rowid?$obj->rowid:$obj->code).'">'.img_edit().'</a></td>'; print '<td align="center"><a href="dict.php?sortfield='.$sortfield.'&sortorder='.$sortorder.'&rowid='.($obj->rowid?$obj->rowid:$obj->code).'&amp;code='.$obj->code.'&amp;id='.$_GET["id"].'&amp;action=modify#'.($obj->rowid?$obj->rowid:$obj->code).'">'.img_edit().'</a></td>';
} else { } else {
print '<td>&nbsp;</td>'; print '<td>&nbsp;</td>';
} }
if ($iserasable) { if ($iserasable) {
print '<td align="center"><a href="dict.php?sortfield='.$sortfield.'&sortorder='.$sortorder.'&rowid='.($obj->rowid?$obj->rowid:$obj->code).'&amp;code='.$obj->code.'&amp;id='.$_GET["id"].'&amp;action=delete">'.img_delete().'</a></td>'; print '<td align="center"><a href="dict.php?sortfield='.$sortfield.'&sortorder='.$sortorder.'&rowid='.($obj->rowid?$obj->rowid:$obj->code).'&amp;code='.$obj->code.'&amp;id='.$_GET["id"].'&amp;action=delete">'.img_delete().'</a></td>';
} else { } else {
print '<td>&nbsp;</td>'; print '<td>&nbsp;</td>';
} }
print "</tr>\n"; print "</tr>\n";
} }
$i++; $i++;
} }
} }
} }
else { else {
dol_print_error($db); dol_print_error($db);
} }
print '</table>'; print '</table>';
print '</form>'; print '</form>';
} }
else else
{ {
/* /*
* Affichage de la liste des dictionnaires * Affichage de la liste des dictionnaires
*/ */
$var=true; $var=true;
$lastlineisempty=false; $lastlineisempty=false;
print '<table class="noborder" width="100%">'; print '<table class="noborder" width="100%">';
print '<tr class="liste_titre">'; print '<tr class="liste_titre">';
//print '<td>'.$langs->trans("Module").'</td>'; //print '<td>'.$langs->trans("Module").'</td>';
print '<td>'.$langs->trans("Dictionnary").'</td>'; print '<td>'.$langs->trans("Dictionnary").'</td>';
print '<td>'.$langs->trans("Table").'</td>'; print '<td>'.$langs->trans("Table").'</td>';
print '</tr>'; print '</tr>';
foreach ($taborder as $i) foreach ($taborder as $i)
{ {
if ($tabname[$i] && ! $tabcond[$i]) continue; // If dictionnary and condition not true if ($tabname[$i] && ! $tabcond[$i]) continue; // If dictionnary and condition not true
if ($i) if ($i)
{ {
$var=!$var; $var=!$var;
$value=$tabname[$i]; $value=$tabname[$i];
print '<tr '.$bc[$var].'><td width="30%"><a href="dict.php?id='.$i.'">'.$tablib[$i].'</a></td><td>'.$tabname[$i].'</td></tr>'; print '<tr '.$bc[$var].'><td width="30%"><a href="dict.php?id='.$i.'">'.$tablib[$i].'</a></td><td>'.$tabname[$i].'</td></tr>';
$lastlineisempty=false; $lastlineisempty=false;
} }
else else
{ {
if (! $lastlineisempty) if (! $lastlineisempty)
{ {
$var=!$var; $var=!$var;
print '<tr '.$bc[$var].'><td width="30%">&nbsp;</td><td>&nbsp;</td></tr>'; print '<tr '.$bc[$var].'><td width="30%">&nbsp;</td><td>&nbsp;</td></tr>';
$lastlineisempty=true; $lastlineisempty=true;
} }
} }
} }
print '</table>'; print '</table>';
} }
print '<br>'; print '<br>';
@ -717,8 +717,8 @@ $db->close();
llxFooter('$Date$ - $Revision$'); llxFooter('$Date$ - $Revision$');
/** /**
\brief Affiche les champs \brief Affiche les champs
*/ */
function fieldList($fieldlist,$obj='') function fieldList($fieldlist,$obj='')
{ {
global $conf,$langs,$db; global $conf,$langs,$db;
@ -727,7 +727,7 @@ function fieldList($fieldlist,$obj='')
$html = new Form($db); $html = new Form($db);
$formadmin = new FormAdmin($db); $formadmin = new FormAdmin($db);
$formcompany = new FormCompany($db); $formcompany = new FormCompany($db);
foreach ($fieldlist as $field => $value) foreach ($fieldlist as $field => $value)
{ {
if ($fieldlist[$field] == 'pays') { if ($fieldlist[$field] == 'pays') {

View File

@ -242,9 +242,8 @@ if ($_GET["action"] == 'delete')
$result = $db->query($sql); $result = $db->query($sql);
$obj = $db->fetch_object($result); $obj = $db->fetch_object($result);
$html = new Form($db); $ret=$html->form_confirm("index.php?menu_handler=".$menu_handler."&menuId=".$_GET['menuId'],$langs->trans("DeleteMenu"),$langs->trans("ConfirmDeleteMenu",$obj->titre),"confirm_delete");
$html->form_confirm("index.php?menu_handler=".$menu_handler."&menuId=".$_GET['menuId'],$langs->trans("DeleteMenu"),$langs->trans("ConfirmDeleteMenu",$obj->titre),"confirm_delete"); if ($ret == 'html') print '<br>';
print "<br>\n";
} }

View File

@ -102,8 +102,8 @@ if ($result)
if ($_GET["action"] == 'purge') if ($_GET["action"] == 'purge')
{ {
$form->form_confirm($_SERVER["PHP_SELF"], $langs->trans('PurgeAuditEvents'), $langs->trans('ConfirmPurgeAuditEvents'), 'confirm_purge'); $ret=$form->form_confirm($_SERVER["PHP_SELF"], $langs->trans('PurgeAuditEvents'), $langs->trans('ConfirmPurgeAuditEvents'), 'confirm_purge');
print '<br>'; if ($ret == 'html') print '<br>';
} }
print '<table class="liste" width="100%">'; print '<table class="liste" width="100%">';

View File

@ -100,8 +100,8 @@ dol_fiche_head($head, 'card', $title);
*/ */
if ($_GET['action'] == 'delete') if ($_GET['action'] == 'delete')
{ {
$html->form_confirm($_SERVER["PHP_SELF"].'?id='.$c->id.'&amp;type='.$type,$langs->trans('DeleteCategory'),$langs->trans('ConfirmDeleteCategory'),'confirm_delete'); $ret=$html->form_confirm($_SERVER["PHP_SELF"].'?id='.$c->id.'&amp;type='.$type,$langs->trans('DeleteCategory'),$langs->trans('ConfirmDeleteCategory'),'confirm_delete');
print '<br />'; if ($ret == 'html') print '<br>';
} }
print '<table border="0" width="100%" class="border">'; print '<table border="0" width="100%" class="border">';

View File

@ -643,8 +643,8 @@ if ($_GET["id"])
// Confirmation suppression action // Confirmation suppression action
if ($_GET["action"] == 'delete') if ($_GET["action"] == 'delete')
{ {
$html->form_confirm("fiche.php?id=".$_GET["id"],$langs->trans("DeleteAction"),$langs->trans("ConfirmDeleteAction"),"confirm_delete"); $ret=$html->form_confirm("fiche.php?id=".$_GET["id"],$langs->trans("DeleteAction"),$langs->trans("ConfirmDeleteAction"),"confirm_delete");
print '<br>'; if ($ret == 'html') print '<br>';
} }
if ($_REQUEST["action"] == 'edit') if ($_REQUEST["action"] == 'edit')

View File

@ -60,14 +60,14 @@ if ($_POST["action"] == 'add' || $_POST["action"] == 'update')
$livraison->tel = $_POST["tel"]; $livraison->tel = $_POST["tel"];
$livraison->fax = $_POST["fax"]; $livraison->fax = $_POST["fax"];
$livraison->note = $_POST["note"]; $livraison->note = $_POST["note"];
if ($_POST["action"] == 'add') if ($_POST["action"] == 'add')
{ {
$socid = $_POST["socid"]; $socid = $_POST["socid"];
$origin = $_POST["origin"]; $origin = $_POST["origin"];
$originid = $_POST["originid"]; $originid = $_POST["originid"];
$result = $livraison->create($socid, $user); $result = $livraison->create($socid, $user);
if ($result >= 0) if ($result >= 0)
{ {
if ($origin == commande) if ($origin == commande)
@ -92,14 +92,14 @@ if ($_POST["action"] == 'add' || $_POST["action"] == 'update')
$_GET["action"]='create'; $_GET["action"]='create';
} }
} }
if ($_POST["action"] == 'update') if ($_POST["action"] == 'update')
{ {
$socid = $_POST["socid"]; $socid = $_POST["socid"];
$origin = $_POST["origin"]; $origin = $_POST["origin"];
$originid = $_POST["originid"]; $originid = $_POST["originid"];
$result = $livraison->update($_POST["idl"], $socid, $user); $result = $livraison->update($_POST["idl"], $socid, $user);
if ($result >= 0) if ($result >= 0)
{ {
if ($origin == commande) if ($origin == commande)
@ -132,7 +132,7 @@ if ($_POST["action"] == 'confirm_delete' && $_POST["confirm"] == 'yes' && $user-
{ {
$livraison = new AdresseLivraison($db); $livraison = new AdresseLivraison($db);
$result = $livraison->delete($_GET["idl"], $socid); $result = $livraison->delete($_GET["idl"], $socid);
if ($result == 0) if ($result == 0)
{ {
Header("Location: adresse_livraison.php?socid=".$socid); Header("Location: adresse_livraison.php?socid=".$socid);
@ -165,11 +165,11 @@ if ($_GET["action"] == 'create' || $_POST["action"] == 'create')
*/ */
$livraison = new AdresseLivraison($db); $livraison = new AdresseLivraison($db);
$societe=new Societe($db); $societe=new Societe($db);
$societe->fetch($_GET["socid"]); $societe->fetch($_GET["socid"]);
$head = societe_prepare_head($societe); $head = societe_prepare_head($societe);
dol_fiche_head($head, 'customer', $societe->nom); dol_fiche_head($head, 'customer', $societe->nom);
if ($_POST["label"] && $_POST["nom"]) if ($_POST["label"] && $_POST["nom"])
@ -202,23 +202,23 @@ if ($_GET["action"] == 'create' || $_POST["action"] == 'create')
$livraison->pays_code=$obj->code; $livraison->pays_code=$obj->code;
$livraison->pays=$obj->libelle; $livraison->pays=$obj->libelle;
} }
print_titre($langs->trans("NewDeliveryAddress")); print_titre($langs->trans("NewDeliveryAddress"));
print "<br>\n"; print "<br>\n";
if ($livraison->error) if ($livraison->error)
{ {
print '<div class="error">'; print '<div class="error">';
print nl2br($livraison->error); print nl2br($livraison->error);
print '</div>'; print '</div>';
} }
print '<form action="adresse_livraison.php" method="post" name="formsoc">'; print '<form action="adresse_livraison.php" method="post" name="formsoc">';
print '<input type="hidden" name="socid" value="'.$socid.'">'; print '<input type="hidden" name="socid" value="'.$socid.'">';
print '<input type="hidden" name="origin" value="'.$origin.'">'; print '<input type="hidden" name="origin" value="'.$origin.'">';
print '<input type="hidden" name="originid" value="'.$originid.'">'; print '<input type="hidden" name="originid" value="'.$originid.'">';
print '<input type="hidden" name="action" value="add">'; print '<input type="hidden" name="action" value="add">';
print '<table class="border" width="100%">'; print '<table class="border" width="100%">';
print '<tr><td>'.$langs->trans('DeliveryAddressLabel').'</td><td><input type="text" size="30" name="label" value="'.$livraison->label.'"></td></tr>'; print '<tr><td>'.$langs->trans('DeliveryAddressLabel').'</td><td><input type="text" size="30" name="label" value="'.$livraison->label.'"></td></tr>';
@ -238,21 +238,21 @@ if ($_GET["action"] == 'create' || $_POST["action"] == 'create')
print '<tr><td width="25%">'.$langs->trans('Country').'</td><td colspan="3">'; print '<tr><td width="25%">'.$langs->trans('Country').'</td><td colspan="3">';
$form->select_pays($livraison->pays_id,'pays_id'); $form->select_pays($livraison->pays_id,'pays_id');
print '</td></tr>'; print '</td></tr>';
print '<tr><td>'.$langs->trans('Phone').'</td><td><input type="text" name="tel" value="'.$livraison->tel.'"></td></tr>'; print '<tr><td>'.$langs->trans('Phone').'</td><td><input type="text" name="tel" value="'.$livraison->tel.'"></td></tr>';
print '<tr><td>'.$langs->trans('Fax').'</td><td><input type="text" name="fax" value="'.$livraison->fax.'"></td></tr>'; print '<tr><td>'.$langs->trans('Fax').'</td><td><input type="text" name="fax" value="'.$livraison->fax.'"></td></tr>';
print '<tr><td>'.$langs->trans('Note').'</td><td colspan="3"><textarea name="note" cols="40" rows="6" wrap="soft">'; print '<tr><td>'.$langs->trans('Note').'</td><td colspan="3"><textarea name="note" cols="40" rows="6" wrap="soft">';
print $livraison->note; print $livraison->note;
print '</textarea></td></tr>'; print '</textarea></td></tr>';
print '<tr><td colspan="4" align="center">'; print '<tr><td colspan="4" align="center">';
print '<input type="submit" class="button" value="'.$langs->trans('AddDeliveryAddress').'"></td></tr>'."\n"; print '<input type="submit" class="button" value="'.$langs->trans('AddDeliveryAddress').'"></td></tr>'."\n";
print '</table>'."\n"; print '</table>'."\n";
print '</form>'."\n"; print '</form>'."\n";
} }
} }
elseif ($_GET["action"] == 'edit' || $_POST["action"] == 'edit') elseif ($_GET["action"] == 'edit' || $_POST["action"] == 'edit')
@ -261,11 +261,11 @@ elseif ($_GET["action"] == 'edit' || $_POST["action"] == 'edit')
* Fiche societe en mode edition * Fiche societe en mode edition
*/ */
$livraison = new AdresseLivraison($db); $livraison = new AdresseLivraison($db);
$societe=new Societe($db); $societe=new Societe($db);
$societe->fetch($_GET["socid"]); $societe->fetch($_GET["socid"]);
$head = societe_prepare_head($societe); $head = societe_prepare_head($societe);
dol_fiche_head($head, 'customer', $societe->nom); dol_fiche_head($head, 'customer', $societe->nom);
print_titre($langs->trans("EditDeliveryAddress")); print_titre($langs->trans("EditDeliveryAddress"));
@ -344,11 +344,11 @@ elseif ($_GET["action"] == 'edit' || $_POST["action"] == 'edit')
print '<tr><td>'.$langs->trans('Country').'</td><td colspan="3">'; print '<tr><td>'.$langs->trans('Country').'</td><td colspan="3">';
$form->select_pays($livraison->pays_id,'pays_id'); $form->select_pays($livraison->pays_id,'pays_id');
print '</td></tr>'; print '</td></tr>';
print '<tr><td>'.$langs->trans('Phone').'</td><td><input type="text" name="tel" value="'.$livraison->tel.'"></td></tr>'; print '<tr><td>'.$langs->trans('Phone').'</td><td><input type="text" name="tel" value="'.$livraison->tel.'"></td></tr>';
print '<tr><td>'.$langs->trans('Fax').'</td><td><input type="text" name="fax" value="'.$livraison->fax.'"></td></tr>'; print '<tr><td>'.$langs->trans('Fax').'</td><td><input type="text" name="fax" value="'.$livraison->fax.'"></td></tr>';
print '<tr><td>'.$langs->trans('Note').'</td><td colspan="3"><textarea name="note" cols="40" rows="6" wrap="soft">'; print '<tr><td>'.$langs->trans('Note').'</td><td colspan="3"><textarea name="note" cols="40" rows="6" wrap="soft">';
print $livraison->note; print $livraison->note;
print '</textarea></td></tr>'; print '</textarea></td></tr>';
@ -375,7 +375,7 @@ else
$societe=new Societe($db); $societe=new Societe($db);
$societe->fetch($livraison->socid); $societe->fetch($livraison->socid);
$head = societe_prepare_head($societe); $head = societe_prepare_head($societe);
dol_fiche_head($head, 'customer', $societe->nom); dol_fiche_head($head, 'customer', $societe->nom);
@ -383,8 +383,8 @@ else
if ($_GET["action"] == 'delete') if ($_GET["action"] == 'delete')
{ {
$html = new Form($db); $html = new Form($db);
$html->form_confirm("adresse_livraison.php?socid=".$livraison->socid."&amp;idl=".$_GET["idl"],$langs->trans("DeleteDeliveryAddress"),$langs->trans("ConfirmDeleteDeliveryAdress"),"confirm_delete"); $ret=$html->form_confirm("adresse_livraison.php?socid=".$livraison->socid."&amp;idl=".$_GET["idl"],$langs->trans("DeleteDeliveryAddress"),$langs->trans("ConfirmDeleteDeliveryAdress"),"confirm_delete");
print "<br />\n"; if ($ret == 'html') print '<br>';
} }
if ($livraison->error) if ($livraison->error)
@ -399,53 +399,53 @@ else
{ {
for ($i = 0 ; $i < $nblignes ; $i++) for ($i = 0 ; $i < $nblignes ; $i++)
{ {
print '<table class="border" width="100%">'; print '<table class="border" width="100%">';
print '<tr><td width="20%">'.$langs->trans('DeliveryAddressLabel').'</td><td colspan="3">'.$livraison->lignes[$i]->label.'</td>'; print '<tr><td width="20%">'.$langs->trans('DeliveryAddressLabel').'</td><td colspan="3">'.$livraison->lignes[$i]->label.'</td>';
print '<td valign="top" colspan="2" width="50%" rowspan="6">'.$langs->trans('Note').' :<br>'.nl2br($livraison->lignes[$i]->note).'</td></tr>'; print '<td valign="top" colspan="2" width="50%" rowspan="6">'.$langs->trans('Note').' :<br>'.nl2br($livraison->lignes[$i]->note).'</td></tr>';
print '<tr><td width="20%">'.$langs->trans('Name').'</td><td colspan="3">'.$livraison->lignes[$i]->nom.'</td></tr>'; print '<tr><td width="20%">'.$langs->trans('Name').'</td><td colspan="3">'.$livraison->lignes[$i]->nom.'</td></tr>';
print "<tr><td valign=\"top\">".$langs->trans('Address')."</td><td colspan=\"3\">".nl2br($livraison->lignes[$i]->adresse)."</td></tr>"; print "<tr><td valign=\"top\">".$langs->trans('Address')."</td><td colspan=\"3\">".nl2br($livraison->lignes[$i]->adresse)."</td></tr>";
print '<tr><td width="25%">'.$langs->trans('Zip').'</td><td width="25%">'.$livraison->lignes[$i]->cp."</td></tr>"; print '<tr><td width="25%">'.$langs->trans('Zip').'</td><td width="25%">'.$livraison->lignes[$i]->cp."</td></tr>";
print '<tr><td width="25%">'.$langs->trans('Town').'</td><td width="25%">'.$livraison->lignes[$i]->ville."</td></tr>"; print '<tr><td width="25%">'.$langs->trans('Town').'</td><td width="25%">'.$livraison->lignes[$i]->ville."</td></tr>";
print '<tr><td>'.$langs->trans('Country').'</td><td colspan="3">'.$livraison->lignes[$i]->pays.'</td>'; print '<tr><td>'.$langs->trans('Country').'</td><td colspan="3">'.$livraison->lignes[$i]->pays.'</td>';
print '<tr><td>'.$langs->trans('Phone').'</td><td>'.dol_print_phone($livraison->lignes[$i]->tel,$livraison->lignes[$i]->pays_code,0,$livraison->socid,'AC_TEL').'</td></tr>'; print '<tr><td>'.$langs->trans('Phone').'</td><td>'.dol_print_phone($livraison->lignes[$i]->tel,$livraison->lignes[$i]->pays_code,0,$livraison->socid,'AC_TEL').'</td></tr>';
print '<tr><td>'.$langs->trans('Fax').'</td><td>'.dol_print_phone($livraison->lignes[$i]->fax,$livraison->lignes[$i]->pays_code,0,$livraison->socid,'AC_FAX').'</td></tr>'; print '<tr><td>'.$langs->trans('Fax').'</td><td>'.dol_print_phone($livraison->lignes[$i]->fax,$livraison->lignes[$i]->pays_code,0,$livraison->socid,'AC_FAX').'</td></tr>';
print '</td></tr>'; print '</td></tr>';
print '</table>'; print '</table>';
/* /*
* *
*/ */
print '<div class="tabsAction">'; print '<div class="tabsAction">';
if ($user->rights->societe->creer) if ($user->rights->societe->creer)
{ {
print '<a class="butAction" href="'.DOL_URL_ROOT.'/comm/adresse_livraison.php?socid='.$livraison->socid.'&amp;idl='.$livraison->lignes[$i]->idl.'&amp;action=edit">'.$langs->trans("Modify").'</a>'; print '<a class="butAction" href="'.DOL_URL_ROOT.'/comm/adresse_livraison.php?socid='.$livraison->socid.'&amp;idl='.$livraison->lignes[$i]->idl.'&amp;action=edit">'.$langs->trans("Modify").'</a>';
} }
if ($user->rights->societe->supprimer) if ($user->rights->societe->supprimer)
{ {
print '<a class="butActionDelete" href="'.DOL_URL_ROOT.'/comm/adresse_livraison.php?socid='.$livraison->socid.'&amp;idl='.$livraison->lignes[$i]->idl.'&amp;action=delete">'.$langs->trans("Delete").'</a>'; print '<a class="butActionDelete" href="'.DOL_URL_ROOT.'/comm/adresse_livraison.php?socid='.$livraison->socid.'&amp;idl='.$livraison->lignes[$i]->idl.'&amp;action=delete">'.$langs->trans("Delete").'</a>';
} }
print '</div>'; print '</div>';
print '<br>'; print '<br>';
} }
} }
else else
{ {
print $langs->trans("None"); print $langs->trans("None");
} }
print '</div>'; print '</div>';
@ -453,7 +453,7 @@ else
/* /*
* Bouton actions * Bouton actions
*/ */
if ($_GET["action"] == '') if ($_GET["action"] == '')
{ {
print '<div class="tabsAction">'; print '<div class="tabsAction">';

View File

@ -31,7 +31,7 @@ require_once DOL_DOCUMENT_ROOT.'/comm/mailing/mailing.class.php';
$langs->load("mails"); $langs->load("mails");
if (! $user->rights->mailing->lire || $user->societe_id > 0) if (! $user->rights->mailing->lire || $user->societe_id > 0)
accessforbidden(); accessforbidden();
$message = ''; $message = '';
@ -89,14 +89,14 @@ if ($_POST["action"] == 'confirm_clone' && $_POST['confirm'] == 'yes')
// Action envoi mailing pour tous // Action envoi mailing pour tous
if ($_POST["action"] == 'sendallconfirmed' && $_POST['confirm'] == 'yes') if ($_POST["action"] == 'sendallconfirmed' && $_POST['confirm'] == 'yes')
{ {
if (empty($conf->global->MAILING_LIMIT_SENDBYWEB)) if (empty($conf->global->MAILING_LIMIT_SENDBYWEB))
{ {
// Pour des raisons de securite, on ne permet pas cette fonction via l'IHM, // Pour des raisons de securite, on ne permet pas cette fonction via l'IHM,
// on affiche donc juste un message // on affiche donc juste un message
$message='<div class="warning">'.$langs->trans("MailingNeedCommand").'</div>'; $message='<div class="warning">'.$langs->trans("MailingNeedCommand").'</div>';
$message.='<br><textarea cols="70" rows="'.ROWS_2.'" wrap="soft">php ./scripts/mailing/mailing-send.php '.$_GET["id"].'</textarea>'; $message.='<br><textarea cols="70" rows="'.ROWS_2.'" wrap="soft">php ./scripts/mailing/mailing-send.php '.$_GET["id"].'</textarea>';
$message.='<br><br><div class="warning">'.$langs->trans("MailingNeedCommand2").'</div>'; $message.='<br><br><div class="warning">'.$langs->trans("MailingNeedCommand2").'</div>';
$_GET["action"]=''; $_GET["action"]='';
} }
else else
{ {
@ -133,32 +133,32 @@ if ($_POST["action"] == 'sendallconfirmed' && $_POST['confirm'] == 'yes')
$resql=$db->query($sql); $resql=$db->query($sql);
if ($resql) if ($resql)
{ {
$num = $db->num_rows($resql); // nb of possible recipients $num = $db->num_rows($resql); // nb of possible recipients
if ($num) if ($num)
{ {
dol_syslog("fiche.php: nb of targets = ".$num, LOG_DEBUG); dol_syslog("fiche.php: nb of targets = ".$num, LOG_DEBUG);
// Positionne date debut envoi // Positionne date debut envoi
$sql="UPDATE ".MAIN_DB_PREFIX."mailing SET date_envoi=".$db->idate(gmmktime())." WHERE rowid=".$id; $sql="UPDATE ".MAIN_DB_PREFIX."mailing SET date_envoi=".$db->idate(gmmktime())." WHERE rowid=".$id;
$resql2=$db->query($sql); $resql2=$db->query($sql);
if (! $resql2) if (! $resql2)
{ {
dol_print_error($db); dol_print_error($db);
} }
// Boucle sur chaque adresse et envoie le mail // Boucle sur chaque adresse et envoie le mail
$i = 0; $i = 0;
while ($i < $num && $i < $conf->global->MAILING_LIMIT_SENDBYWEB) while ($i < $num && $i < $conf->global->MAILING_LIMIT_SENDBYWEB)
{ {
$res=1; $res=1;
$obj = $db->fetch_object($resql); $obj = $db->fetch_object($resql);
// sendto en RFC2822 // sendto en RFC2822
$sendto = eregi_replace(',',' ',$obj->prenom." ".$obj->nom)." <".$obj->email.">"; $sendto = eregi_replace(',',' ',$obj->prenom." ".$obj->nom)." <".$obj->email.">";
// Make subtsitutions on topic and body // Make subtsitutions on topic and body
$other=split(';',$obj->other); $other=split(';',$obj->other);
@ -183,11 +183,11 @@ if ($_POST["action"] == 'sendallconfirmed' && $_POST['confirm'] == 'yes')
$newsubject=make_substitutions($subject,$substitutionarray); $newsubject=make_substitutions($subject,$substitutionarray);
$newmessage=make_substitutions($message,$substitutionarray); $newmessage=make_substitutions($message,$substitutionarray);
// Fabrication du mail // Fabrication du mail
$mail = new CMailFile($newsubject, $sendto, $from, $newmessage, $mail = new CMailFile($newsubject, $sendto, $from, $newmessage,
array(), array(), array(), array(), array(), array(),
'', '', 0, $msgishtml); '', '', 0, $msgishtml);
$mail->errors_to = $errorsto; $mail->errors_to = $errorsto;
if ($mail->error) if ($mail->error)
@ -200,70 +200,70 @@ if ($_POST["action"] == 'sendallconfirmed' && $_POST['confirm'] == 'yes')
$res=0; $res=0;
} }
// Envoi du mail // Envoi du mail
if ($res) if ($res)
{ {
$res=$mail->sendfile(); $res=$mail->sendfile();
} }
if ($res) if ($res)
{ {
// Mail envoye avec succes // Mail envoye avec succes
$nbok++; $nbok++;
dol_syslog("mailing-send: ok for #".$i.($mail->error?' - '.$mail->error:''), LOG_DEBUG); dol_syslog("mailing-send: ok for #".$i.($mail->error?' - '.$mail->error:''), LOG_DEBUG);
$sql="UPDATE ".MAIN_DB_PREFIX."mailing_cibles"; $sql="UPDATE ".MAIN_DB_PREFIX."mailing_cibles";
$sql.=" SET statut=1, date_envoi=".$db->idate(gmmktime())." WHERE rowid=".$obj->rowid; $sql.=" SET statut=1, date_envoi=".$db->idate(gmmktime())." WHERE rowid=".$obj->rowid;
$resql2=$db->query($sql); $resql2=$db->query($sql);
if (! $resql2) if (! $resql2)
{ {
dol_print_error($db); dol_print_error($db);
} }
} }
else else
{ {
// Mail en echec // Mail en echec
$nbko++; $nbko++;
dol_syslog("mailing-send: error for #".$i.($mail->error?' - '.$mail->error:''), LOG_DEBUG); dol_syslog("mailing-send: error for #".$i.($mail->error?' - '.$mail->error:''), LOG_DEBUG);
$sql="UPDATE ".MAIN_DB_PREFIX."mailing_cibles"; $sql="UPDATE ".MAIN_DB_PREFIX."mailing_cibles";
$sql.=" SET statut=-1, date_envoi=".$db->idate(gmmktime())." WHERE rowid=".$obj->rowid; $sql.=" SET statut=-1, date_envoi=".$db->idate(gmmktime())." WHERE rowid=".$obj->rowid;
$resql2=$db->query($sql); $resql2=$db->query($sql);
if (! $resql2) if (! $resql2)
{ {
dol_print_error($db); dol_print_error($db);
} }
} }
$i++; $i++;
} }
} }
// Loop finished, set global statut of mail // Loop finished, set global statut of mail
if ($nbko > 0) if ($nbko > 0)
{ {
$statut=2; // Status 'sent partially' (because at least one error) $statut=2; // Status 'sent partially' (because at least one error)
}
else
{
if ($nbok >= $num) $statut=3; // Send to everybody
else $statut=2; // Status 'sent partially' (because not send to everybody)
} }
else
{
if ($nbok >= $num) $statut=3; // Send to everybody
else $statut=2; // Status 'sent partially' (because not send to everybody)
}
$sql="UPDATE ".MAIN_DB_PREFIX."mailing SET statut=".$statut." WHERE rowid=".$id; $sql="UPDATE ".MAIN_DB_PREFIX."mailing SET statut=".$statut." WHERE rowid=".$id;
dol_syslog("mailing-send: update global status sql=".$sql, LOG_DEBUG); dol_syslog("mailing-send: update global status sql=".$sql, LOG_DEBUG);
$resql2=$db->query($sql); $resql2=$db->query($sql);
if (! $resql2) if (! $resql2)
{ {
dol_print_error($db); dol_print_error($db);
} }
} }
else else
{ {
dol_syslog($db->error()); dol_syslog($db->error());
dol_print_error($db); dol_print_error($db);
} }
$message=''; $message='';
$_GET["action"] = ''; $_GET["action"] = '';
@ -274,91 +274,91 @@ if ($_POST["action"] == 'sendallconfirmed' && $_POST['confirm'] == 'yes')
// Action envoi test mailing // Action envoi test mailing
if ($_POST["action"] == 'send' && ! $_POST["cancel"]) if ($_POST["action"] == 'send' && ! $_POST["cancel"])
{ {
$mil = new Mailing($db); $mil = new Mailing($db);
$result=$mil->fetch($_POST["mailid"]); $result=$mil->fetch($_POST["mailid"]);
$mil->sendto = $_POST["sendto"]; $mil->sendto = $_POST["sendto"];
if (! $mil->sendto) if (! $mil->sendto)
{ {
$message='<div class="error">'.$langs->trans("ErrorFieldRequired",$langs->trans("MailTo")).'</div>'; $message='<div class="error">'.$langs->trans("ErrorFieldRequired",$langs->trans("MailTo")).'</div>';
} }
if ($mil->sendto) if ($mil->sendto)
{ {
$arr_file = array(); $arr_file = array();
$arr_mime = array(); $arr_mime = array();
$arr_name = array(); $arr_name = array();
// Le message est-il en html // Le message est-il en html
$msgishtml=-1; // Inconnu par defaut $msgishtml=-1; // Inconnu par defaut
if (eregi('[ \t]*<html>',$message)) $msgishtml=1; if (eregi('[ \t]*<html>',$message)) $msgishtml=1;
// Pratique les substitutions sur le sujet et message // Pratique les substitutions sur le sujet et message
$mil->sujet=make_substitutions($mil->sujet,$substitutionarrayfortest); $mil->sujet=make_substitutions($mil->sujet,$substitutionarrayfortest);
$mil->body=make_substitutions($mil->body,$substitutionarrayfortest); $mil->body=make_substitutions($mil->body,$substitutionarrayfortest);
$mailfile = new CMailFile($mil->sujet,$mil->sendto,$mil->email_from,$mil->body, $mailfile = new CMailFile($mil->sujet,$mil->sendto,$mil->email_from,$mil->body,
$arr_file,$arr_mime,$arr_name, $arr_file,$arr_mime,$arr_name,
'', '', 0, $msgishtml); '', '', 0, $msgishtml);
$result=$mailfile->sendfile(); $result=$mailfile->sendfile();
if ($result) if ($result)
{ {
$message='<div class="ok">'.$langs->trans("MailSuccessfulySent",$mil->email_from,$mil->sendto).'</div>'; $message='<div class="ok">'.$langs->trans("MailSuccessfulySent",$mil->email_from,$mil->sendto).'</div>';
} }
else else
{ {
$message='<div class="error">'.$langs->trans("ResultKo").'<br>'.$mailfile->error.' '.$result.'</div>'; $message='<div class="error">'.$langs->trans("ResultKo").'<br>'.$mailfile->error.' '.$result.'</div>';
} }
$_GET["action"]=''; $_GET["action"]='';
$_GET["id"]=$mil->id; $_GET["id"]=$mil->id;
} }
} }
// Action ajout mailing // Action ajout mailing
if ($_POST["action"] == 'add') if ($_POST["action"] == 'add')
{ {
$message=''; $message='';
$mil = new Mailing($db); $mil = new Mailing($db);
$mil->email_from = trim($_POST["from"]); $mil->email_from = trim($_POST["from"]);
$mil->titre = trim($_POST["titre"]); $mil->titre = trim($_POST["titre"]);
$mil->sujet = trim($_POST["sujet"]); $mil->sujet = trim($_POST["sujet"]);
$mil->body = trim($_POST["body"]); $mil->body = trim($_POST["body"]);
if (! $mil->titre) $message.=($message?'<br>':'').$langs->trans("ErrorFieldRequired",$langs->trans("MailTitle")); if (! $mil->titre) $message.=($message?'<br>':'').$langs->trans("ErrorFieldRequired",$langs->trans("MailTitle"));
if (! $mil->sujet) $message.=($message?'<br>':'').$langs->trans("ErrorFieldRequired",$langs->trans("MailTopic")); if (! $mil->sujet) $message.=($message?'<br>':'').$langs->trans("ErrorFieldRequired",$langs->trans("MailTopic"));
if (! $message) if (! $message)
{ {
if ($mil->create($user) >= 0) if ($mil->create($user) >= 0)
{ {
Header("Location: fiche.php?id=".$mil->id); Header("Location: fiche.php?id=".$mil->id);
exit; exit;
} }
$message=$mil->error; $message=$mil->error;
} }
$message='<div class="error">'.$message.'</div>'; $message='<div class="error">'.$message.'</div>';
$_GET["action"]="create"; $_GET["action"]="create";
} }
// Action mise a jour mailing // Action mise a jour mailing
if ($_POST["action"] == 'update') if ($_POST["action"] == 'update')
{ {
$mil = new Mailing($db); $mil = new Mailing($db);
$mil->id = $_POST["id"]; $mil->id = $_POST["id"];
$mil->email_from = $_POST["from"]; $mil->email_from = $_POST["from"];
$mil->titre = $_POST["titre"]; $mil->titre = $_POST["titre"];
$mil->sujet = $_POST["sujet"]; $mil->sujet = $_POST["sujet"];
$mil->body = $_POST["body"]; $mil->body = $_POST["body"];
if ($mil->update()) if ($mil->update())
{ {
Header("Location: fiche.php?id=".$mil->id); Header("Location: fiche.php?id=".$mil->id);
} }
} }
// Action confirmation validation // Action confirmation validation
@ -432,21 +432,21 @@ if ($_POST["action"] == 'confirm_reset')
// Action confirmation suppression // Action confirmation suppression
if ($_POST["action"] == 'confirm_delete') if ($_POST["action"] == 'confirm_delete')
{ {
if ($_POST["confirm"] == 'yes') if ($_POST["confirm"] == 'yes')
{ {
$mil = new Mailing($db); $mil = new Mailing($db);
$mil->id = $_GET["id"]; $mil->id = $_GET["id"];
if ($mil->delete($mil->id)) if ($mil->delete($mil->id))
{ {
Header("Location: index.php"); Header("Location: index.php");
} }
} }
} }
if ($_POST["cancel"] == $langs->trans("Cancel")) if ($_POST["cancel"] == $langs->trans("Cancel"))
{ {
$action = ''; $action = '';
} }
@ -466,167 +466,167 @@ if ($_GET["action"] == 'create')
{ {
// EMailing in creation mode // EMailing in creation mode
print '<form action="fiche.php" method="post">'."\n"; print '<form action="fiche.php" method="post">'."\n";
print '<input type="hidden" name="action" value="add">'; print '<input type="hidden" name="action" value="add">';
print_fiche_titre($langs->trans("NewMailing")); print_fiche_titre($langs->trans("NewMailing"));
if ($message) print "$message<br>"; if ($message) print "$message<br>";
print '<table class="border" width="100%">'; print '<table class="border" width="100%">';
print '<tr><td width="25%">'.$langs->trans("MailTitle").'</td><td><input class="flat" name="titre" size="40" value=""></td></tr>'; print '<tr><td width="25%">'.$langs->trans("MailTitle").'</td><td><input class="flat" name="titre" size="40" value=""></td></tr>';
print '<tr><td colspan="2">&nbsp;</td></tr>'; print '<tr><td colspan="2">&nbsp;</td></tr>';
print '<tr><td width="25%">'.$langs->trans("MailFrom").'</td><td><input class="flat" name="from" size="40" value="'.$conf->global->MAILING_EMAIL_FROM.'"></td></tr>'; print '<tr><td width="25%">'.$langs->trans("MailFrom").'</td><td><input class="flat" name="from" size="40" value="'.$conf->global->MAILING_EMAIL_FROM.'"></td></tr>';
print '<tr><td width="25%">'.$langs->trans("MailTopic").'</td><td><input class="flat" name="sujet" size="60" value=""></td></tr>'; print '<tr><td width="25%">'.$langs->trans("MailTopic").'</td><td><input class="flat" name="sujet" size="60" value=""></td></tr>';
print '<tr><td width="25%" valign="top">'.$langs->trans("MailMessage").'<br>'; print '<tr><td width="25%" valign="top">'.$langs->trans("MailMessage").'<br>';
print '<br><i>'.$langs->trans("CommonSubstitutions").':<br>'; print '<br><i>'.$langs->trans("CommonSubstitutions").':<br>';
foreach($substitutionarray as $key => $val) foreach($substitutionarray as $key => $val)
{ {
print $key.' = '.$langs->trans($val).'<br>'; print $key.' = '.$langs->trans($val).'<br>';
} }
print '</i></td>'; print '</i></td>';
print '<td>'; print '<td>';
// Editeur wysiwyg // Editeur wysiwyg
if ($conf->fckeditor->enabled && $conf->global->FCKEDITOR_ENABLE_MAILING) if ($conf->fckeditor->enabled && $conf->global->FCKEDITOR_ENABLE_MAILING)
{ {
require_once(DOL_DOCUMENT_ROOT."/lib/doleditor.class.php"); require_once(DOL_DOCUMENT_ROOT."/lib/doleditor.class.php");
$doleditor=new DolEditor('body','',320,'dolibarr_mailings','',true,false); $doleditor=new DolEditor('body','',320,'dolibarr_mailings','',true,false);
$doleditor->Create(); $doleditor->Create();
} }
else else
{ {
print '<textarea cols="70" rows="20" name="body"></textarea>'; print '<textarea cols="70" rows="20" name="body"></textarea>';
} }
print '</td></tr>'; print '</td></tr>';
print '<tr><td colspan="2" align="center"><input type="submit" class="button" value="'.$langs->trans("CreateMailing").'"></td></tr>'; print '<tr><td colspan="2" align="center"><input type="submit" class="button" value="'.$langs->trans("CreateMailing").'"></td></tr>';
print '</table>'; print '</table>';
print '</form>'; print '</form>';
} }
else else
{ {
if ($mil->fetch($_GET["id"]) >= 0) if ($mil->fetch($_GET["id"]) >= 0)
{ {
$h=0; $h=0;
$head[$h][0] = DOL_URL_ROOT."/comm/mailing/fiche.php?id=".$mil->id; $head[$h][0] = DOL_URL_ROOT."/comm/mailing/fiche.php?id=".$mil->id;
$head[$h][1] = $langs->trans("MailCard"); $head[$h][1] = $langs->trans("MailCard");
$hselected = $h; $hselected = $h;
$h++; $h++;
$head[$h][0] = DOL_URL_ROOT."/comm/mailing/cibles.php?id=".$mil->id; $head[$h][0] = DOL_URL_ROOT."/comm/mailing/cibles.php?id=".$mil->id;
$head[$h][1] = $langs->trans('MailRecipients'); $head[$h][1] = $langs->trans('MailRecipients');
$h++; $h++;
/* /*
$head[$h][0] = DOL_URL_ROOT."/comm/mailing/info.php?id=".$mil->id; $head[$h][0] = DOL_URL_ROOT."/comm/mailing/info.php?id=".$mil->id;
$head[$h][1] = $langs->trans("MailHistory"); $head[$h][1] = $langs->trans("MailHistory");
$h++; $h++;
*/ */
dol_fiche_head($head, $hselected, $langs->trans("Mailing")); dol_fiche_head($head, $hselected, $langs->trans("Mailing"));
// Confirmation de la validation du mailing // Confirmation de la validation du mailing
if ($_GET["action"] == 'valide') if ($_GET["action"] == 'valide')
{ {
$html->form_confirm("fiche.php?id=".$mil->id,$langs->trans("ValidMailing"),$langs->trans("ConfirmValidMailing"),"confirm_valide"); $ret=$html->form_confirm("fiche.php?id=".$mil->id,$langs->trans("ValidMailing"),$langs->trans("ConfirmValidMailing"),"confirm_valide");
print '<br>'; if ($ret == 'html') print '<br>';
} }
// Confirm reset // Confirm reset
if ($_GET["action"] == 'reset') if ($_GET["action"] == 'reset')
{ {
$html->form_confirm("fiche.php?id=".$mil->id,$langs->trans("ResetMailing"),$langs->trans("ConfirmResetMailing",$mil->ref),"confirm_reset"); $ret=$html->form_confirm("fiche.php?id=".$mil->id,$langs->trans("ResetMailing"),$langs->trans("ConfirmResetMailing",$mil->ref),"confirm_reset");
print '<br>'; if ($ret == 'html') print '<br>';
} }
// Confirm delete // Confirm delete
if ($_GET["action"] == 'delete') if ($_GET["action"] == 'delete')
{ {
$html->form_confirm("fiche.php?id=".$mil->id,$langs->trans("DeleteAMailing"),$langs->trans("ConfirmDeleteMailing"),"confirm_delete"); $ret=$html->form_confirm("fiche.php?id=".$mil->id,$langs->trans("DeleteAMailing"),$langs->trans("ConfirmDeleteMailing"),"confirm_delete");
print '<br>'; if ($ret == 'html') print '<br>';
} }
if ($_GET["action"] != 'edit') if ($_GET["action"] != 'edit')
{ {
/* /*
* Mailing en mode visu * Mailing en mode visu
* *
*/ */
if ($_GET["action"] == 'sendall') if ($_GET["action"] == 'sendall')
{ {
if (empty($conf->global->MAILING_LIMIT_SENDBYWEB)) if (empty($conf->global->MAILING_LIMIT_SENDBYWEB))
{ {
// Pour des raisons de securite, on ne permet pas cette fonction via l'IHM, // Pour des raisons de securite, on ne permet pas cette fonction via l'IHM,
// on affiche donc juste un message // on affiche donc juste un message
$message='<div class="warning">'.$langs->trans("MailingNeedCommand").'</div>'; $message='<div class="warning">'.$langs->trans("MailingNeedCommand").'</div>';
$message.='<br><textarea cols="50" rows="'.ROWS_2.'" wrap="soft">php ./scripts/mailing/mailing-send.php '.$_GET["id"].'</textarea>'; $message.='<br><textarea cols="50" rows="'.ROWS_2.'" wrap="soft">php ./scripts/mailing/mailing-send.php '.$_GET["id"].'</textarea>';
$message.='<br><br><div class="warning">'.$langs->trans("MailingNeedCommand2").'</div>'; $message.='<br><br><div class="warning">'.$langs->trans("MailingNeedCommand2").'</div>';
$_GET["action"]=''; $_GET["action"]='';
} }
else else
{ {
$text=$langs->trans('ConfirmSendingEmailing',$conf->global->MAILING_LIMIT_SENDBYWEB); $text=$langs->trans('ConfirmSendingEmailing',$conf->global->MAILING_LIMIT_SENDBYWEB);
$html->form_confirm($_SERVER['PHP_SELF'].'?id='.$_REQUEST['id'],$langs->trans('SendMailing'),$text,'sendallconfirmed'); $ret=$html->form_confirm($_SERVER['PHP_SELF'].'?id='.$_REQUEST['id'],$langs->trans('SendMailing'),$text,'sendallconfirmed');
print '<br />'; if ($ret == 'html') print '<br>';
} }
} }
print '<table class="border" width="100%">'; print '<table class="border" width="100%">';
print '<tr><td width="25%">'.$langs->trans("Ref").'</td>'; print '<tr><td width="25%">'.$langs->trans("Ref").'</td>';
print '<td colspan="3">'; print '<td colspan="3">';
print $html->showrefnav($mil,'id'); print $html->showrefnav($mil,'id');
print '</td></tr>'; print '</td></tr>';
print '<tr><td width="25%">'.$langs->trans("MailTitle").'</td><td colspan="3">'.$mil->titre.'</td></tr>'; print '<tr><td width="25%">'.$langs->trans("MailTitle").'</td><td colspan="3">'.$mil->titre.'</td></tr>';
print '<tr><td width="25%">'.$langs->trans("MailFrom").'</td><td colspan="3">'.htmlentities($mil->email_from).'</td></tr>'; print '<tr><td width="25%">'.$langs->trans("MailFrom").'</td><td colspan="3">'.htmlentities($mil->email_from).'</td></tr>';
print '<tr><td width="25%">'.$langs->trans("Status").'</td><td colspan="3">'.$mil->getLibStatut(4).'</td></tr>'; print '<tr><td width="25%">'.$langs->trans("Status").'</td><td colspan="3">'.$mil->getLibStatut(4).'</td></tr>';
print '<tr><td width="25%">'.$langs->trans("TotalNbOfDistinctRecipients").'</td><td colspan="3">'.($mil->nbemail?$mil->nbemail:'<font class="error">'.$langs->trans("NoTargetYet").'</font>').'</td></tr>'; print '<tr><td width="25%">'.$langs->trans("TotalNbOfDistinctRecipients").'</td><td colspan="3">'.($mil->nbemail?$mil->nbemail:'<font class="error">'.$langs->trans("NoTargetYet").'</font>').'</td></tr>';
$uc = new User($db, $mil->user_creat); $uc = new User($db, $mil->user_creat);
$uc->fetch(); $uc->fetch();
print '<tr><td>'.$langs->trans("CreatedBy").'</td><td>'.$uc->getNomUrl(1).'</td>'; print '<tr><td>'.$langs->trans("CreatedBy").'</td><td>'.$uc->getNomUrl(1).'</td>';
print '<td>'.$langs->trans("Date").'</td>'; print '<td>'.$langs->trans("Date").'</td>';
print '<td>'.dol_print_date($mil->date_creat,"dayhour").'</td></tr>'; print '<td>'.dol_print_date($mil->date_creat,"dayhour").'</td></tr>';
if ($mil->statut > 0) if ($mil->statut > 0)
{ {
$uv = new User($db, $mil->user_valid); $uv = new User($db, $mil->user_valid);
$uv->fetch(); $uv->fetch();
print '<tr><td>'.$langs->trans("ValidatedBy").'</td><td>'.$uv->getNomUrl(1).'</td>'; print '<tr><td>'.$langs->trans("ValidatedBy").'</td><td>'.$uv->getNomUrl(1).'</td>';
print '<td>'.$langs->trans("Date").'</td>'; print '<td>'.$langs->trans("Date").'</td>';
print '<td>'.dol_print_date($mil->date_valid,"dayhour").'</td></tr>'; print '<td>'.dol_print_date($mil->date_valid,"dayhour").'</td></tr>';
} }
if ($mil->statut > 1) if ($mil->statut > 1)
{ {
print '<tr><td>'.$langs->trans("SentBy").'</td><td>'.$langs->trans("Unknown").'</td>'; print '<tr><td>'.$langs->trans("SentBy").'</td><td>'.$langs->trans("Unknown").'</td>';
print '<td>'.$langs->trans("Date").'</td>'; print '<td>'.$langs->trans("Date").'</td>';
print '<td>'.dol_print_date($mil->date_envoi,"dayhour").'</td></tr>'; print '<td>'.dol_print_date($mil->date_envoi,"dayhour").'</td></tr>';
} }
// Sujet // Sujet
print '<tr><td>'.$langs->trans("MailTopic").'</td><td colspan="3">'.$mil->sujet.'</td></tr>'; print '<tr><td>'.$langs->trans("MailTopic").'</td><td colspan="3">'.$mil->sujet.'</td></tr>';
// Message // Message
print '<tr><td valign="top">'.$langs->trans("MailMessage").'</td>'; print '<tr><td valign="top">'.$langs->trans("MailMessage").'</td>';
print '<td colspan="3">'; print '<td colspan="3">';
print dol_htmlentitiesbr($mil->body); print dol_htmlentitiesbr($mil->body);
print '</td>'; print '</td>';
print '</tr>'; print '</tr>';
print '</table>'; print '</table>';
print "</div>"; print "</div>";
// Clone confirmation // Clone confirmation
if ($_GET["action"] == 'clone') if ($_GET["action"] == 'clone')
{ {
// Create an array for form // Create an array for form
$formquestion=array( $formquestion=array(
'text' => $langs->trans("ConfirmClone"), 'text' => $langs->trans("ConfirmClone"),
array('type' => 'checkbox', 'name' => 'clone_content', 'label' => $langs->trans("CloneContent"), 'value' => 1), array('type' => 'checkbox', 'name' => 'clone_content', 'label' => $langs->trans("CloneContent"), 'value' => 1),
array('type' => 'checkbox', 'name' => 'clone_receviers', 'label' => $langs->trans("CloneReceivers").' ('.$langs->trans("FeatureNotYetAvailable").')', 'value' => 0, 'disabled' => true) array('type' => 'checkbox', 'name' => 'clone_receviers', 'label' => $langs->trans("CloneReceivers").' ('.$langs->trans("FeatureNotYetAvailable").')', 'value' => 0, 'disabled' => true)
); );
// Paiement incomplet. On demande si motif = escompte ou autre // Paiement incomplet. On demande si motif = escompte ou autre
$html->form_confirm($_SERVER["PHP_SELF"].'?id='.$mil->id,$langs->trans('CloneEMailing'),$langs->trans('ConfirmCloneEMailing',$mil->ref),'confirm_clone',$formquestion,'yes'); $html->form_confirm($_SERVER["PHP_SELF"].'?id='.$mil->id,$langs->trans('CloneEMailing'),$langs->trans('ConfirmCloneEMailing',$mil->ref),'confirm_clone',$formquestion,'yes');
@ -636,7 +636,7 @@ else
if ($mesg) print $mesg; if ($mesg) print $mesg;
if ($_GET["action"] == 'sendall') if ($_GET["action"] == 'sendall')
{ {
// Pour des raisons de securite, on ne permet pas cette fonction via l'IHM, // Pour des raisons de securite, on ne permet pas cette fonction via l'IHM,
// on affiche donc juste un message // on affiche donc juste un message
@ -644,141 +644,141 @@ else
$message.='<br><textarea cols="70" rows="'.ROWS_2.'" wrap="soft">php ./scripts/mailing/mailing-send.php '.$_GET["id"].'</textarea>'; $message.='<br><textarea cols="70" rows="'.ROWS_2.'" wrap="soft">php ./scripts/mailing/mailing-send.php '.$_GET["id"].'</textarea>';
} }
if ($message) print "$message<br>"; if ($message) print "$message<br>";
/* /*
* Boutons d'action * Boutons d'action
*/ */
if ($_GET["action"] == '') if ($_GET["action"] == '')
{ {
print "\n\n<div class=\"tabsAction\">\n"; print "\n\n<div class=\"tabsAction\">\n";
if ($mil->statut == 0 && $user->rights->mailing->creer) if ($mil->statut == 0 && $user->rights->mailing->creer)
{ {
print '<a class="butAction" href="'.$_SERVER['PHP_SELF'].'?action=edit&amp;id='.$mil->id.'">'.$langs->trans("EditMailing").'</a>'; print '<a class="butAction" href="'.$_SERVER['PHP_SELF'].'?action=edit&amp;id='.$mil->id.'">'.$langs->trans("EditMailing").'</a>';
} }
//print '<a class="butAction" href="fiche.php?action=test&amp;id='.$mil->id.'">'.$langs->trans("PreviewMailing").'</a>'; //print '<a class="butAction" href="fiche.php?action=test&amp;id='.$mil->id.'">'.$langs->trans("PreviewMailing").'</a>';
print '<a class="butAction" href="'.$_SERVER['PHP_SELF'].'?action=test&amp;id='.$mil->id.'">'.$langs->trans("TestMailing").'</a>'; print '<a class="butAction" href="'.$_SERVER['PHP_SELF'].'?action=test&amp;id='.$mil->id.'">'.$langs->trans("TestMailing").'</a>';
if ($mil->statut == 0 && $mil->nbemail > 0 && $user->rights->mailing->valider) if ($mil->statut == 0 && $mil->nbemail > 0 && $user->rights->mailing->valider)
{ {
print '<a class="butAction" href="'.$_SERVER['PHP_SELF'].'?action=valide&amp;id='.$mil->id.'">'.$langs->trans("ValidMailing").'</a>'; print '<a class="butAction" href="'.$_SERVER['PHP_SELF'].'?action=valide&amp;id='.$mil->id.'">'.$langs->trans("ValidMailing").'</a>';
} }
if (($mil->statut == 1 || $mil->statut == 2) && $mil->nbemail > 0 && $user->rights->mailing->valider) if (($mil->statut == 1 || $mil->statut == 2) && $mil->nbemail > 0 && $user->rights->mailing->valider)
{ {
print '<a class="butAction" href="'.$_SERVER['PHP_SELF'].'?action=sendall&amp;id='.$mil->id.'">'.$langs->trans("SendMailing").'</a>'; print '<a class="butAction" href="'.$_SERVER['PHP_SELF'].'?action=sendall&amp;id='.$mil->id.'">'.$langs->trans("SendMailing").'</a>';
} }
if ($user->rights->mailing->creer) if ($user->rights->mailing->creer)
{ {
print '<a class="butAction" href="'.$_SERVER['PHP_SELF'].'?action=clone&amp;object=emailing&amp;id='.$mil->id.'">'.$langs->trans("ToClone").'</a>'; print '<a class="butAction" href="'.$_SERVER['PHP_SELF'].'?action=clone&amp;object=emailing&amp;id='.$mil->id.'">'.$langs->trans("ToClone").'</a>';
} }
if (($mil->statut == 2 || $mil->statut == 3) && $user->rights->mailing->valider) if (($mil->statut == 2 || $mil->statut == 3) && $user->rights->mailing->valider)
{ {
print '<a class="butAction" href="'.$_SERVER['PHP_SELF'].'?action=reset&amp;id='.$mil->id.'">'.$langs->trans("ResetMailing").'</a>'; print '<a class="butAction" href="'.$_SERVER['PHP_SELF'].'?action=reset&amp;id='.$mil->id.'">'.$langs->trans("ResetMailing").'</a>';
} }
if (($mil->statut <= 1 && $user->rights->mailing->creer) || $user->rights->mailing->supprimer) if (($mil->statut <= 1 && $user->rights->mailing->creer) || $user->rights->mailing->supprimer)
{ {
print '<a class="butActionDelete" href="'.$_SERVER['PHP_SELF'].'?action=delete&amp;id='.$mil->id.'">'.$langs->trans("DeleteMailing").'</a>'; print '<a class="butActionDelete" href="'.$_SERVER['PHP_SELF'].'?action=delete&amp;id='.$mil->id.'">'.$langs->trans("DeleteMailing").'</a>';
} }
print '<br /><br /></div>'; print '<br /><br /></div>';
} }
// Affichage formulaire de TEST // Affichage formulaire de TEST
if ($_GET["action"] == 'test') if ($_GET["action"] == 'test')
{ {
print_titre($langs->trans("TestMailing")); print_titre($langs->trans("TestMailing"));
// Create l'objet formulaire mail // Create l'objet formulaire mail
include_once("../../html.formmail.class.php"); include_once("../../html.formmail.class.php");
$formmail = new FormMail($db); $formmail = new FormMail($db);
$formmail->fromname = $mil->email_from; $formmail->fromname = $mil->email_from;
$formmail->frommail = $mil->email_from; $formmail->frommail = $mil->email_from;
$formmail->withsubstit=1; $formmail->withsubstit=1;
$formmail->withfrom=0; $formmail->withfrom=0;
$formmail->withto=$user->email?$user->email:1; $formmail->withto=$user->email?$user->email:1;
$formmail->withtocc=0; $formmail->withtocc=0;
$formmail->withtopic=0; $formmail->withtopic=0;
$formmail->withtopicreadonly=1; $formmail->withtopicreadonly=1;
$formmail->withfile=0; $formmail->withfile=0;
$formmail->withbody=0; $formmail->withbody=0;
$formmail->withbodyreadonly=1; $formmail->withbodyreadonly=1;
$formmail->withcancel=1; $formmail->withcancel=1;
$formmail->withdeliveryreceipt=0; $formmail->withdeliveryreceipt=0;
// Tableau des substitutions // Tableau des substitutions
$formmail->substit=$substitutionarrayfortest; $formmail->substit=$substitutionarrayfortest;
// Tableau des parametres complementaires du post // Tableau des parametres complementaires du post
$formmail->param["action"]="send"; $formmail->param["action"]="send";
$formmail->param["models"]="body"; $formmail->param["models"]="body";
$formmail->param["mailid"]=$mil->id; $formmail->param["mailid"]=$mil->id;
$formmail->param["returnurl"]=DOL_URL_ROOT."/comm/mailing/fiche.php?id=".$mil->id; $formmail->param["returnurl"]=DOL_URL_ROOT."/comm/mailing/fiche.php?id=".$mil->id;
// Init list of files // Init list of files
if (! empty($_REQUEST["mode"]) && $_REQUEST["mode"]=='init') if (! empty($_REQUEST["mode"]) && $_REQUEST["mode"]=='init')
{ {
$formmail->clear_attached_files(); $formmail->clear_attached_files();
} }
$formmail->show_form(); $formmail->show_form();
print '<br>'; print '<br>';
} }
} }
else else
{ {
/* /*
* Mailing en mode edition * Mailing en mode edition
*/ */
print '<form action="fiche.php" method="post">'."\n"; print '<form action="fiche.php" method="post">'."\n";
print '<input type="hidden" name="action" value="update">'; print '<input type="hidden" name="action" value="update">';
print '<input type="hidden" name="id" value="'.$mil->id.'">'; print '<input type="hidden" name="id" value="'.$mil->id.'">';
print '<table class="border" width="100%">'; print '<table class="border" width="100%">';
print '<tr><td width="25%">'.$langs->trans("Ref").'</td><td colspan="3">'.$mil->id.'</td></tr>'; print '<tr><td width="25%">'.$langs->trans("Ref").'</td><td colspan="3">'.$mil->id.'</td></tr>';
print '<tr><td width="25%">'.$langs->trans("MailTitle").'</td><td colspan="3"><input class="flat" type="text" size=40 name="titre" value="'.$mil->titre.'"></td></tr>'; print '<tr><td width="25%">'.$langs->trans("MailTitle").'</td><td colspan="3"><input class="flat" type="text" size=40 name="titre" value="'.$mil->titre.'"></td></tr>';
print '<tr><td width="25%">'.$langs->trans("MailFrom").'</td><td colspan="3"><input class="flat" type="text" size=40 name="from" value="'.$mil->email_from.'"></td></tr>'; print '<tr><td width="25%">'.$langs->trans("MailFrom").'</td><td colspan="3"><input class="flat" type="text" size=40 name="from" value="'.$mil->email_from.'"></td></tr>';
print '<tr><td width="25%">'.$langs->trans("MailTopic").'</td><td colspan="3"><input class="flat" type="text" size=60 name="sujet" value="'.$mil->sujet.'"></td></tr>'; print '<tr><td width="25%">'.$langs->trans("MailTopic").'</td><td colspan="3"><input class="flat" type="text" size=60 name="sujet" value="'.$mil->sujet.'"></td></tr>';
print '<tr><td width="25%" valign="top">'.$langs->trans("MailMessage").'<br>'; print '<tr><td width="25%" valign="top">'.$langs->trans("MailMessage").'<br>';
print '<br><i>'.$langs->trans("CommonSubstitutions").':<br>'; print '<br><i>'.$langs->trans("CommonSubstitutions").':<br>';
print '__ID__ = '.$langs->trans("IdRecord").'<br>'; print '__ID__ = '.$langs->trans("IdRecord").'<br>';
print '__EMAIL__ = '.$langs->trans("EMail").'<br>'; print '__EMAIL__ = '.$langs->trans("EMail").'<br>';
print '__LASTNAME__ = '.$langs->trans("Lastname").'<br>'; print '__LASTNAME__ = '.$langs->trans("Lastname").'<br>';
print '__FIRSTNAME__ = '.$langs->trans("Firstname").'<br>'; print '__FIRSTNAME__ = '.$langs->trans("Firstname").'<br>';
print '__OTHER1__ = '.$langs->trans("Other").'1<br>'; print '__OTHER1__ = '.$langs->trans("Other").'1<br>';
print '__OTHER2__ = '.$langs->trans("Other").'2<br>'; print '__OTHER2__ = '.$langs->trans("Other").'2<br>';
print '__OTHER3__ = '.$langs->trans("Other").'3<br>'; print '__OTHER3__ = '.$langs->trans("Other").'3<br>';
print '__OTHER4__ = '.$langs->trans("Other").'4<br>'; print '__OTHER4__ = '.$langs->trans("Other").'4<br>';
print '__OTHER5__ = '.$langs->trans("Other").'5<br>'; print '__OTHER5__ = '.$langs->trans("Other").'5<br>';
print '</i></td>'; print '</i></td>';
print '<td colspan="3">'; print '<td colspan="3">';
// Editeur wysiwyg // Editeur wysiwyg
if ($conf->fckeditor->enabled && $conf->global->FCKEDITOR_ENABLE_MAILING) if ($conf->fckeditor->enabled && $conf->global->FCKEDITOR_ENABLE_MAILING)
{ {
require_once(DOL_DOCUMENT_ROOT."/lib/doleditor.class.php"); require_once(DOL_DOCUMENT_ROOT."/lib/doleditor.class.php");
$doleditor=new DolEditor('body',$mil->body,320,'dolibarr_mailings','',true,false); $doleditor=new DolEditor('body',$mil->body,320,'dolibarr_mailings','',true,false);
$doleditor->Create(); $doleditor->Create();
} }
else else
{ {
print '<textarea class="flat" name="body" cols="70" rows="20">'; print '<textarea class="flat" name="body" cols="70" rows="20">';
print dol_htmlentitiesbr_decode($mil->body).'</textarea>'; print dol_htmlentitiesbr_decode($mil->body).'</textarea>';
} }
print '</td></tr>'; print '</td></tr>';
print '<tr><td colspan="4" align="center"><input type="submit" class="button" value="'.$langs->trans("Save").'"></td></tr>'; print '<tr><td colspan="4" align="center"><input type="submit" class="button" value="'.$langs->trans("Save").'"></td></tr>';
print '</table>'; print '</table>';
print '</form>'; print '</form>';
print "</div>"; print "</div>";
} }
} }
} }

View File

@ -916,8 +916,8 @@ if ($id > 0 || ! empty($ref))
//array('type' => 'checkbox', 'name' => 'clone_content', 'label' => $langs->trans("CloneMainAttributes"), 'value' => 1) //array('type' => 'checkbox', 'name' => 'clone_content', 'label' => $langs->trans("CloneMainAttributes"), 'value' => 1)
); );
// Paiement incomplet. On demande si motif = escompte ou autre // Paiement incomplet. On demande si motif = escompte ou autre
$html->form_confirm($_SERVER["PHP_SELF"].'?propalid='.$propal->id,$langs->trans('ClonePropal'),$langs->trans('ConfirmClonePropal',$propal->ref),'confirm_clone',$formquestion,'yes'); $ret=$html->form_confirm($_SERVER["PHP_SELF"].'?propalid='.$propal->id,$langs->trans('ClonePropal'),$langs->trans('ConfirmClonePropal',$propal->ref),'confirm_clone',$formquestion,'yes');
print '<br>'; if ($ret == 'html') print '<br>';
} }
/* /*
@ -925,8 +925,8 @@ if ($id > 0 || ! empty($ref))
*/ */
if ($_GET['action'] == 'delete') if ($_GET['action'] == 'delete')
{ {
$html->form_confirm($_SERVER["PHP_SELF"].'?propalid='.$propal->id, $langs->trans('DeleteProp'), $langs->trans('ConfirmDeleteProp'), 'confirm_delete'); $ret=$html->form_confirm($_SERVER["PHP_SELF"].'?propalid='.$propal->id, $langs->trans('DeleteProp'), $langs->trans('ConfirmDeleteProp'), 'confirm_delete');
print '<br>'; if ($ret == 'html') print '<br>';
} }
/* /*
@ -934,8 +934,8 @@ if ($id > 0 || ! empty($ref))
*/ */
if ($_GET['action'] == 'ask_deleteline' && $conf->global->PRODUIT_CONFIRM_DELETE_LINE) if ($_GET['action'] == 'ask_deleteline' && $conf->global->PRODUIT_CONFIRM_DELETE_LINE)
{ {
$html->form_confirm($_SERVER["PHP_SELF"].'?propalid='.$propal->id.'&amp;lineid='.$_GET["lineid"], $langs->trans('DeleteProductLine'), $langs->trans('ConfirmDeleteProductLine'), 'confirm_deleteline'); $ret=$html->form_confirm($_SERVER["PHP_SELF"].'?propalid='.$propal->id.'&amp;lineid='.$_GET["lineid"], $langs->trans('DeleteProductLine'), $langs->trans('ConfirmDeleteProductLine'), 'confirm_deleteline');
print '<br>'; if ($ret == 'html') print '<br>';
} }
/* /*
@ -943,8 +943,8 @@ if ($id > 0 || ! empty($ref))
*/ */
if ($_GET['action'] == 'validate') if ($_GET['action'] == 'validate')
{ {
$html->form_confirm($_SERVER["PHP_SELF"].'?propalid='.$propal->id, $langs->trans('ValidateProp'), $langs->trans('ConfirmValidateProp'), 'confirm_validate'); $ret=$html->form_confirm($_SERVER["PHP_SELF"].'?propalid='.$propal->id, $langs->trans('ValidateProp'), $langs->trans('ConfirmValidateProp'), 'confirm_validate');
print '<br>'; if ($ret == 'html') print '<br>';
} }
@ -1460,15 +1460,7 @@ if ($id > 0 || ! empty($ref))
print '<td align="center">'; print '<td align="center">';
if ($conf->global->PRODUIT_CONFIRM_DELETE_LINE) if ($conf->global->PRODUIT_CONFIRM_DELETE_LINE)
{ {
if ($conf->use_javascript_ajax && $conf->global->MAIN_CONFIRM_AJAX) print '<a href="'.$_SERVER["PHP_SELF"].'?propalid='.$propal->id.'&amp;action=ask_deleteline&amp;lineid='.$objp->rowid.'">';
{
$url = $_SERVER["PHP_SELF"].'?propalid='.$propal->id.'&lineid='.$objp->rowid.'&action=confirm_deleteline&confirm=yes';
print '<a href="#" onClick="dialogConfirm(\''.$url.'\',\''.$langs->trans('ConfirmDeleteProductLine').'\',\''.$langs->trans("Yes").'\',\''.$langs->trans("No").'\',\'deleteline'.$i.'\')">';
}
else
{
print '<a href="'.$_SERVER["PHP_SELF"].'?propalid='.$propal->id.'&amp;action=ask_deleteline&amp;lineid='.$objp->rowid.'">';
}
} }
else else
{ {
@ -1763,16 +1755,7 @@ if ($id > 0 || ! empty($ref))
// Valid // Valid
if ($propal->statut == 0 && $user->rights->propale->valider) if ($propal->statut == 0 && $user->rights->propale->valider)
{ {
print '<a class="butAction" '; print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?propalid='.$propal->id.'&amp;action=validate"';
if ($conf->use_javascript_ajax && $conf->global->MAIN_CONFIRM_AJAX)
{
$url = $_SERVER["PHP_SELF"].'?propalid='.$propal->id.'&action=confirm_validate&confirm=yes';
print 'href="#" onClick="dialogConfirm(\''.$url.'\',\''.dol_escape_js($langs->trans('ConfirmValidateProp')).'\',\''.$langs->trans("Yes").'\',\''.$langs->trans("No").'\',\'validate\')"';
}
else
{
print 'href="'.$_SERVER["PHP_SELF"].'?propalid='.$propal->id.'&amp;action=validate"';
}
print '>'.$langs->trans('Validate').'</a>'; print '>'.$langs->trans('Validate').'</a>';
} }
@ -1821,16 +1804,7 @@ if ($id > 0 || ! empty($ref))
// Delete // Delete
if ($user->rights->propale->supprimer) if ($user->rights->propale->supprimer)
{ {
print '<a class="butActionDelete" '; print '<a class="butActionDelete" href="'.$_SERVER["PHP_SELF"].'?propalid='.$propal->id.'&amp;action=delete"';
if ($conf->use_javascript_ajax && $conf->global->MAIN_CONFIRM_AJAX)
{
$url = $_SERVER["PHP_SELF"].'?propalid='.$propal->id.'&action=confirm_delete&confirm=yes';
print 'href="#" onClick="dialogConfirm(\''.$url.'\',\''.$langs->trans('ConfirmDeleteProp').'\',\''.$langs->trans("Yes").'\',\''.$langs->trans("No").'\',\'delete\')"';
}
else
{
print 'href="'.$_SERVER["PHP_SELF"].'?propalid='.$propal->id.'&amp;action=delete"';
}
print '>'.$langs->trans('Delete').'</a>'; print '>'.$langs->trans('Delete').'</a>';
} }

View File

@ -1203,8 +1203,8 @@ else
*/ */
if ($_GET['action'] == 'delete') if ($_GET['action'] == 'delete')
{ {
$html->form_confirm($_SERVER["PHP_SELF"].'?id='.$id, $langs->trans('DeleteOrder'), $langs->trans('ConfirmDeleteOrder'), 'confirm_delete'); $ret=$html->form_confirm($_SERVER["PHP_SELF"].'?id='.$id, $langs->trans('DeleteOrder'), $langs->trans('ConfirmDeleteOrder'), 'confirm_delete');
print '<br />'; if ($ret == 'html') print '<br>';
} }
/* /*
@ -1225,7 +1225,7 @@ else
$text=$langs->trans('ConfirmValidateOrder',$num); $text=$langs->trans('ConfirmValidateOrder',$num);
$html->form_confirm($_SERVER["PHP_SELF"].'?id='.$id, $langs->trans('ValidateOrder'), $text, 'confirm_validate'); $html->form_confirm($_SERVER["PHP_SELF"].'?id='.$id, $langs->trans('ValidateOrder'), $text, 'confirm_validate');
print '<br />'; if ($ret == 'html') print '<br>';
} }
/* /*
@ -1233,8 +1233,8 @@ else
*/ */
if ($_GET['action'] == 'close') if ($_GET['action'] == 'close')
{ {
$html->form_confirm($_SERVER["PHP_SELF"].'?id='.$id, $langs->trans('CloseOrder'), $langs->trans('ConfirmCloseOrder'), 'confirm_close'); $ret=$html->form_confirm($_SERVER["PHP_SELF"].'?id='.$id, $langs->trans('CloseOrder'), $langs->trans('ConfirmCloseOrder'), 'confirm_close');
print '<br />'; if ($ret == 'html') print '<br>';
} }
/* /*
@ -1242,8 +1242,8 @@ else
*/ */
if ($_GET['action'] == 'cancel') if ($_GET['action'] == 'cancel')
{ {
$html->form_confirm($_SERVER["PHP_SELF"].'?id='.$id, $langs->trans('Cancel'), $langs->trans('ConfirmCancelOrder'), 'confirm_cancel'); $ret=$html->form_confirm($_SERVER["PHP_SELF"].'?id='.$id, $langs->trans('Cancel'), $langs->trans('ConfirmCancelOrder'), 'confirm_cancel');
print '<br />'; if ($ret == 'html') print '<br>';
} }
/* /*
@ -1251,8 +1251,8 @@ else
*/ */
if ($_GET['action'] == 'ask_deleteline' && $conf->global->PRODUIT_CONFIRM_DELETE_LINE) if ($_GET['action'] == 'ask_deleteline' && $conf->global->PRODUIT_CONFIRM_DELETE_LINE)
{ {
$html->form_confirm($_SERVER["PHP_SELF"].'?id='.$id.'&amp;lineid='.$_GET["lineid"], $langs->trans('DeleteProductLine'), $langs->trans('ConfirmDeleteProductLine'), 'confirm_deleteline'); $ret=$html->form_confirm($_SERVER["PHP_SELF"].'?id='.$id.'&amp;lineid='.$_GET["lineid"], $langs->trans('DeleteProductLine'), $langs->trans('ConfirmDeleteProductLine'), 'confirm_deleteline');
print '<br>'; if ($ret == 'html') print '<br>';
} }
// Clone confirmation // Clone confirmation
@ -1264,8 +1264,8 @@ else
//array('type' => 'checkbox', 'name' => 'clone_content', 'label' => $langs->trans("CloneMainAttributes"), 'value' => 1) //array('type' => 'checkbox', 'name' => 'clone_content', 'label' => $langs->trans("CloneMainAttributes"), 'value' => 1)
); );
// Paiement incomplet. On demande si motif = escompte ou autre // Paiement incomplet. On demande si motif = escompte ou autre
$html->form_confirm($_SERVER["PHP_SELF"].'?id='.$commande->id,$langs->trans('CloneOrder'),$langs->trans('ConfirmCloneOrder',$commande->ref),'confirm_clone',$formquestion,'yes'); $ret=$html->form_confirm($_SERVER["PHP_SELF"].'?id='.$commande->id,$langs->trans('CloneOrder'),$langs->trans('ConfirmCloneOrder',$commande->ref),'confirm_clone',$formquestion,'yes');
print '<br>'; if ($ret == 'html') print '<br>';
} }
/* /*
@ -1638,15 +1638,7 @@ else
print '<td align="center">'; print '<td align="center">';
if ($conf->global->PRODUIT_CONFIRM_DELETE_LINE) if ($conf->global->PRODUIT_CONFIRM_DELETE_LINE)
{ {
if ($conf->use_javascript_ajax && $conf->global->MAIN_CONFIRM_AJAX) print '<a href="'.$_SERVER["PHP_SELF"].'?id='.$id.'&amp;action=ask_deleteline&amp;lineid='.$objp->rowid.'">';
{
$url = $_SERVER["PHP_SELF"].'?id='.$id.'&lineid='.$objp->rowid.'&action=confirm_deleteline&confirm=yes';
print '<a href="#" onClick="dialogConfirm(\''.$url.'\',\''.dol_escape_js($langs->trans('ConfirmDeleteProductLine')).'\',\''.dol_escape_js($langs->trans("Yes")).'\',\''.dol_escape_js($langs->trans("No")).'\',\'deleteline'.$i.'\')">';
}
else
{
print '<a href="'.$_SERVER["PHP_SELF"].'?id='.$id.'&amp;action=ask_deleteline&amp;lineid='.$objp->rowid.'">';
}
} }
else else
{ {
@ -1929,26 +1921,7 @@ else
// Valid // Valid
if ($commande->statut == 0 && $commande->total_ttc >= 0 && $numlines > 0 && $user->rights->commande->valider) if ($commande->statut == 0 && $commande->total_ttc >= 0 && $numlines > 0 && $user->rights->commande->valider)
{ {
print '<a class="butAction" '; print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$commande->id.'&amp;action=validate"';
if ($conf->use_javascript_ajax && $conf->global->MAIN_CONFIRM_AJAX)
{
// on verifie si la commande est en numerotation provisoire
$ref = substr($commande->ref, 1, 4);
if ($ref == 'PROV')
{
$num = $commande->getNextNumRef($soc);
}
else
{
$num = $commande->ref;
}
$url = $_SERVER["PHP_SELF"].'?id='.$commande->id.'&action=confirm_validate&confirm=yes';
print 'href="#" onClick="dialogConfirm(\''.$url.'\',\''.dol_escape_js($langs->trans('ConfirmValidateOrder',$num)).'\',\''.dol_escape_js($langs->trans("Yes")).'\',\''.dol_escape_js($langs->trans("No")).'\',\'validate\')"';
}
else
{
print 'href="'.$_SERVER["PHP_SELF"].'?id='.$commande->id.'&amp;action=validate"';
}
print '>'.$langs->trans('Validate').'</a>'; print '>'.$langs->trans('Validate').'</a>';
} }
@ -2004,16 +1977,7 @@ else
{ {
if ($user->rights->commande->cloturer) if ($user->rights->commande->cloturer)
{ {
print '<a class="butAction" '; print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$commande->id.'&amp;action=close"';
if ($conf->use_javascript_ajax && $conf->global->MAIN_CONFIRM_AJAX)
{
$url = $_SERVER["PHP_SELF"].'?id='.$commande->id.'&action=confirm_close&confirm=yes';
print 'href="#" onClick="dialogConfirm(\''.$url.'\',\''.dol_escape_js($langs->trans('ConfirmCloseOrder')).'\',\''.dol_escape_js($langs->trans("Yes")).'\',\''.dol_escape_js($langs->trans("No")).'\',\'close\')"';
}
else
{
print 'href="'.$_SERVER["PHP_SELF"].'?id='.$commande->id.'&amp;action=close"';
}
print '>'.$langs->trans('Close').'</a>'; print '>'.$langs->trans('Close').'</a>';
} }
} }
@ -2024,16 +1988,7 @@ else
$nb_expedition = $commande->nb_expedition(); $nb_expedition = $commande->nb_expedition();
if ($user->rights->commande->annuler && $nb_expedition == 0) if ($user->rights->commande->annuler && $nb_expedition == 0)
{ {
print '<a class="butActionDelete" '; print '<a class="butActionDelete" href="'.$_SERVER["PHP_SELF"].'?id='.$commande->id.'&amp;action=cancel"';
if ($conf->use_javascript_ajax && $conf->global->MAIN_CONFIRM_AJAX)
{
$url = $_SERVER["PHP_SELF"].'?id='.$commande->id.'&action=confirm_cancel&confirm=yes';
print 'href="#" onClick="dialogConfirm(\''.$url.'\',\''.dol_escape_js($langs->trans('ConfirmCancelOrder')).'\',\''.dol_escape_js($langs->trans("Yes")).'\',\''.dol_escape_js($langs->trans("No")).'\',\'cancel\')"';
}
else
{
print 'href="'.$_SERVER["PHP_SELF"].'?id='.$commande->id.'&amp;action=cancel"';
}
print '>'.$langs->trans('CancelOrder').'</a>'; print '>'.$langs->trans('CancelOrder').'</a>';
} }
} }
@ -2047,16 +2002,7 @@ else
// Delete order // Delete order
if ($user->rights->commande->supprimer) if ($user->rights->commande->supprimer)
{ {
print '<a class="butActionDelete" '; print '<a class="butActionDelete" href="'.$_SERVER["PHP_SELF"].'?id='.$commande->id.'&amp;action=delete"';
if ($conf->use_javascript_ajax && $conf->global->MAIN_CONFIRM_AJAX)
{
$url = $_SERVER["PHP_SELF"].'?id='.$commande->id.'&action=confirm_delete&confirm=yes';
print 'href="#" onClick="dialogConfirm(\''.$url.'\',\''.dol_escape_js($langs->trans('ConfirmDeleteOrder')).'\',\''.dol_escape_js($langs->trans("Yes")).'\',\''.dol_escape_js($langs->trans("No")).'\',\'delete\')"';
}
else
{
print 'href="'.$_SERVER["PHP_SELF"].'?id='.$commande->id.'&amp;action=delete"';
}
print '>'.$langs->trans('Delete').'</a>'; print '>'.$langs->trans('Delete').'</a>';
} }

View File

@ -154,12 +154,12 @@ if ($account || $_GET["ref"])
// Chargement des categories bancaires dans $options // Chargement des categories bancaires dans $options
$nbcategories=0; $nbcategories=0;
$sql = "SELECT rowid, label"; $sql = "SELECT rowid, label";
$sql.= " FROM ".MAIN_DB_PREFIX."bank_categ"; $sql.= " FROM ".MAIN_DB_PREFIX."bank_categ";
$sql.= " WHERE entity = ".$conf->entity; $sql.= " WHERE entity = ".$conf->entity;
$sql.= " ORDER BY label"; $sql.= " ORDER BY label";
$result = $db->query($sql); $result = $db->query($sql);
if ($result) if ($result)
{ {
@ -313,8 +313,8 @@ if ($account || $_GET["ref"])
if ($_GET["action"]=='delete') if ($_GET["action"]=='delete')
{ {
$text=$langs->trans('ConfirmDeleteTransaction'); $text=$langs->trans('ConfirmDeleteTransaction');
$html->form_confirm($_SERVER['PHP_SELF'].'?account='.$acct->id.'&amp;rowid='.$_GET["rowid"],$langs->trans('DeleteTransaction'),$text,'confirm_delete'); $ret=$html->form_confirm($_SERVER['PHP_SELF'].'?account='.$acct->id.'&amp;rowid='.$_GET["rowid"],$langs->trans('DeleteTransaction'),$text,'confirm_delete');
print '<br />'; if ($ret == 'html') print '<br>';
} }

View File

@ -56,7 +56,7 @@ if ($_POST["action"] == 'update' && ! $_POST["cancel"])
$account->number = trim($_POST["number"]); $account->number = trim($_POST["number"]);
$account->cle_rib = trim($_POST["cle_rib"]); $account->cle_rib = trim($_POST["cle_rib"]);
$account->bic = trim($_POST["bic"]); $account->bic = trim($_POST["bic"]);
$account->iban = trim($_POST["iban_prefix"]); $account->iban = trim($_POST["iban_prefix"]);
$account->iban_prefix = trim($_POST["iban_prefix"]); // deprecated $account->iban_prefix = trim($_POST["iban_prefix"]); // deprecated
$account->domiciliation = trim($_POST["domiciliation"]); $account->domiciliation = trim($_POST["domiciliation"]);
$account->proprio = trim($_POST["proprio"]); $account->proprio = trim($_POST["proprio"]);
@ -127,17 +127,17 @@ if (($_GET["id"] || $_GET["ref"]) && $_GET["action"] != 'edit')
*/ */
if ($_GET["action"] == 'delete') if ($_GET["action"] == 'delete')
{ {
$form->form_confirm($_SERVER["PHP_SELF"].'?id='.$account->id,$langs->trans("DeleteAccount"),$langs->trans("ConfirmDeleteAccount"),"confirm_delete"); $ret=$form->form_confirm($_SERVER["PHP_SELF"].'?id='.$account->id,$langs->trans("DeleteAccount"),$langs->trans("ConfirmDeleteAccount"),"confirm_delete");
print '<br />'; if ($ret == 'html') print '<br>';
} }
// Check BBAN // Check BBAN
if (! checkBanForAccount($account)) if (! checkBanForAccount($account))
{ {
print '<div class="warning">'.$langs->trans("RIBControlError").'</div><br>'; print '<div class="warning">'.$langs->trans("RIBControlError").'</div><br>';
} }
print '<table class="border" width="100%">'; print '<table class="border" width="100%">';
// Ref // Ref
@ -165,23 +165,23 @@ if (($_GET["id"] || $_GET["ref"]) && $_GET["action"] != 'edit')
print '<tr><td>'.$langs->trans("BankCode").'</td>'; print '<tr><td>'.$langs->trans("BankCode").'</td>';
print '<td colspan="3">'.$account->code_banque.'</td>'; print '<td colspan="3">'.$account->code_banque.'</td>';
print '</tr>'; print '</tr>';
print '<tr><td>'.$langs->trans("DeskCode").'</td>'; print '<tr><td>'.$langs->trans("DeskCode").'</td>';
print '<td colspan="3">'.$account->code_guichet.'</td>'; print '<td colspan="3">'.$account->code_guichet.'</td>';
print '</tr>'; print '</tr>';
} }
print '<tr><td>'.$langs->trans("BankAccountNumber").'</td>'; print '<tr><td>'.$langs->trans("BankAccountNumber").'</td>';
print '<td colspan="3">'.$account->number.'</td>'; print '<td colspan="3">'.$account->number.'</td>';
print '</tr>'; print '</tr>';
if ($account->useDetailedBBAN()) if ($account->useDetailedBBAN())
{ {
print '<tr><td>'.$langs->trans("BankAccountNumberKey").'</td>'; print '<tr><td>'.$langs->trans("BankAccountNumberKey").'</td>';
print '<td colspan="3">'.$account->cle_rib.'</td>'; print '<td colspan="3">'.$account->cle_rib.'</td>';
print '</tr>'; print '</tr>';
} }
print '<tr><td valign="top">'.$langs->trans("IBAN").'</td>'; print '<tr><td valign="top">'.$langs->trans("IBAN").'</td>';
print '<td colspan="3">'.$account->iban_prefix.'</td></tr>'; print '<td colspan="3">'.$account->iban_prefix.'</td></tr>';
@ -273,12 +273,12 @@ if ($_GET["id"] && $_GET["action"] == 'edit' && $user->rights->banque->configure
print '<tr><td>'.$langs->trans("BankCode").'</td>'; print '<tr><td>'.$langs->trans("BankCode").'</td>';
print '<td><input size="8" type="text" class="flat" name="code_banque" value="'.$account->code_banque.'"></td>'; print '<td><input size="8" type="text" class="flat" name="code_banque" value="'.$account->code_banque.'"></td>';
print '</tr>'; print '</tr>';
print '<tr><td>'.$langs->trans("DeskCode").'</td>'; print '<tr><td>'.$langs->trans("DeskCode").'</td>';
print '<td><input size="8" type="text" class="flat" name="code_guichet" value="'.$account->code_guichet.'"></td>'; print '<td><input size="8" type="text" class="flat" name="code_guichet" value="'.$account->code_guichet.'"></td>';
print '</tr>'; print '</tr>';
} }
print '<td>'.$langs->trans("BankAccountNumber").'</td>'; print '<td>'.$langs->trans("BankAccountNumber").'</td>';
print '<td><input size="18" type="text" class="flat" name="number" value="'.$account->number.'"></td>'; print '<td><input size="18" type="text" class="flat" name="number" value="'.$account->number.'"></td>';
print '</tr>'; print '</tr>';

View File

@ -289,8 +289,8 @@ else
*/ */
if ($_GET["action"] == 'delete') if ($_GET["action"] == 'delete')
{ {
$form->form_confirm($_SERVER["PHP_SELF"].'?id='.$account->id,$langs->trans("DeleteAccount"),$langs->trans("ConfirmDeleteAccount"),"confirm_delete"); $ret=$form->form_confirm($_SERVER["PHP_SELF"].'?id='.$account->id,$langs->trans("DeleteAccount"),$langs->trans("ConfirmDeleteAccount"),"confirm_delete");
print '<br />'; if ($ret == 'html') print '<br>';
} }
print '<table class="border" width="100%">'; print '<table class="border" width="100%">';

View File

@ -219,8 +219,8 @@ if ($result)
// Confirmations // Confirmations
if ($_GET["action"] == 'delete_categ') if ($_GET["action"] == 'delete_categ')
{ {
$html->form_confirm("ligne.php?rowid=".$_GET["rowid"]."&amp;cat1=".$_GET["fk_categ"]."&amp;orig_account=".$orig_account,$langs->trans("RemoveFromRubrique"),$langs->trans("RemoveFromRubriqueConfirm"),"confirm_delete_categ"); $ret=$html->form_confirm("ligne.php?rowid=".$_GET["rowid"]."&amp;cat1=".$_GET["fk_categ"]."&amp;orig_account=".$orig_account,$langs->trans("RemoveFromRubrique"),$langs->trans("RemoveFromRubriqueConfirm"),"confirm_delete_categ");
print '<br>'; if ($ret == 'html') print '<br>';
} }
print '<table class="border" width="100%">'; print '<table class="border" width="100%">';
@ -238,7 +238,7 @@ if ($result)
print '<tr><td width="20%">'.$langs->trans("Ref")."</td>"; print '<tr><td width="20%">'.$langs->trans("Ref")."</td>";
print '<td colspan="4">'.$objp->rowid.'</td>'; print '<td colspan="4">'.$objp->rowid.'</td>';
print '</tr>'; print '</tr>';
// Author // Author
print '<tr><td width="20%">'.$langs->trans("Author")."</td>"; print '<tr><td width="20%">'.$langs->trans("Author")."</td>";
if ($objp->fk_user_author) if ($objp->fk_user_author)

View File

@ -237,11 +237,8 @@ else
*/ */
if ($_GET["action"] == 'delete') if ($_GET["action"] == 'delete')
{ {
$ret=$html->form_confirm("fiche.php?id=".$id,$langs->trans("DeleteTrip"),$langs->trans("ConfirmDeleteTrip"),"confirm_delete");
$html = new Form($db); if ($ret == 'html') print '<br>';
$html->form_confirm("fiche.php?id=".$id,$langs->trans("DeleteTrip"),$langs->trans("ConfirmDeleteTrip"),"confirm_delete");
print '<br>';
} }
$soc = new Societe($db); $soc = new Societe($db);
@ -253,9 +250,9 @@ else
print '<td width="20%">'.$langs->trans("Ref").'</td><td>'; print '<td width="20%">'.$langs->trans("Ref").'</td><td>';
print $deplacement->ref; print $deplacement->ref;
print '</td></tr>'; print '</td></tr>';
print '<tr><td>'.$langs->trans("Type").'</td><td>'.$langs->trans($deplacement->type).'</td></tr>'; print '<tr><td>'.$langs->trans("Type").'</td><td>'.$langs->trans($deplacement->type).'</td></tr>';
print '<tr><td width="20%">'.$langs->trans("CompanyVisited").'</td>'; print '<tr><td width="20%">'.$langs->trans("CompanyVisited").'</td>';
print '<td>'; print '<td>';
if ($soc->id) print $soc->getNomUrl(1); if ($soc->id) print $soc->getNomUrl(1);
@ -266,13 +263,13 @@ else
$userfee->fetch(); $userfee->fetch();
print $userfee->getNomUrl(1); print $userfee->getNomUrl(1);
print '</td></tr>'; print '</td></tr>';
print '<tr><td>'.$langs->trans("Date").'</td><td>'; print '<tr><td>'.$langs->trans("Date").'</td><td>';
print dol_print_date($deplacement->date); print dol_print_date($deplacement->date);
print '</td></tr>'; print '</td></tr>';
print '<tr><td>'.$langs->trans("FeesKilometersOrAmout").'</td><td>'.$deplacement->km.'</td></tr>'; print '<tr><td>'.$langs->trans("FeesKilometersOrAmout").'</td><td>'.$deplacement->km.'</td></tr>';
print "</table>"; print "</table>";
print '</div>'; print '</div>';

View File

@ -2004,16 +2004,16 @@ else
if ($_GET['action'] == 'converttoreduc') if ($_GET['action'] == 'converttoreduc')
{ {
$text=$langs->trans('ConfirmConvertToReduc'); $text=$langs->trans('ConfirmConvertToReduc');
$html->form_confirm($_SERVER['PHP_SELF'].'?facid='.$fac->id,$langs->trans('ConvertToReduc'),$text,'confirm_converttoreduc'); $ret=$html->form_confirm($_SERVER['PHP_SELF'].'?facid='.$fac->id,$langs->trans('ConvertToReduc'),$text,'confirm_converttoreduc');
print '<br />'; if ($ret == 'html') print '<br>';
} }
// Confirmation de la suppression de la facture // Confirmation de la suppression de la facture
if ($_GET['action'] == 'delete') if ($_GET['action'] == 'delete')
{ {
$text=$langs->trans('ConfirmDeleteBill'); $text=$langs->trans('ConfirmDeleteBill');
$html->form_confirm($_SERVER['PHP_SELF'].'?facid='.$fac->id,$langs->trans('DeleteBill'),$text,'confirm_delete'); $ret=$html->form_confirm($_SERVER['PHP_SELF'].'?facid='.$fac->id,$langs->trans('DeleteBill'),$text,'confirm_delete');
print '<br />'; if ($ret == 'html') print '<br>';
} }
// Confirmation de la validation // Confirmation de la validation
@ -2046,15 +2046,15 @@ else
$text.=$notify->confirmMessage(2,$fac->socid); $text.=$notify->confirmMessage(2,$fac->socid);
} }
$html->form_confirm($_SERVER["PHP_SELF"].'?facid='.$fac->id,$langs->trans('ValidateBill'),$text,'confirm_valid'); $ret=$html->form_confirm($_SERVER["PHP_SELF"].'?facid='.$fac->id,$langs->trans('ValidateBill'),$text,'confirm_valid');
print '<br />'; if ($ret == 'html') print '<br>';
} }
// Confirmation du classement payé // Confirmation du classement payé
if ($_GET['action'] == 'payed' && $resteapayer <= 0) if ($_GET['action'] == 'payed' && $resteapayer <= 0)
{ {
$html->form_confirm($_SERVER["PHP_SELF"].'?facid='.$fac->id,$langs->trans('ClassifyPayed'),$langs->trans('ConfirmClassifyPayedBill',$fac->ref),'confirm_payed'); $ret=$html->form_confirm($_SERVER["PHP_SELF"].'?facid='.$fac->id,$langs->trans('ClassifyPayed'),$langs->trans('ConfirmClassifyPayedBill',$fac->ref),'confirm_payed');
print '<br />'; if ($ret == 'html') print '<br>';
} }
if ($_GET['action'] == 'payed' && $resteapayer > 0) if ($_GET['action'] == 'payed' && $resteapayer > 0)
{ {
@ -2083,8 +2083,8 @@ else
array('type' => 'text', 'name' => 'close_note', 'label' => $langs->trans("Comment"), 'value' => '', 'size' => '100') array('type' => 'text', 'name' => 'close_note', 'label' => $langs->trans("Comment"), 'value' => '', 'size' => '100')
); );
// Paiement incomplet. On demande si motif = escompte ou autre // Paiement incomplet. On demande si motif = escompte ou autre
$html->form_confirm($_SERVER["PHP_SELF"].'?facid='.$fac->id,$langs->trans('ClassifyPayed'),$langs->trans('ConfirmClassifyPayedPartially',$fac->ref),'confirm_payed_partially',$formquestion); $ret=$html->form_confirm($_SERVER["PHP_SELF"].'?facid='.$fac->id,$langs->trans('ClassifyPayed'),$langs->trans('ConfirmClassifyPayedPartially',$fac->ref),'confirm_payed_partially',$formquestion);
print '<br>'; if ($ret == 'html') print '<br>';
} }
// Confirmation du classement abandonne // Confirmation du classement abandonne
@ -2124,16 +2124,16 @@ else
array('type' => 'text', 'name' => 'close_note', 'label' => $langs->trans("Comment"), 'value' => '', 'size' => '100') array('type' => 'text', 'name' => 'close_note', 'label' => $langs->trans("Comment"), 'value' => '', 'size' => '100')
); );
$html->form_confirm($_SERVER['PHP_SELF'].'?facid='.$fac->id,$langs->trans('CancelBill'),$langs->trans('ConfirmCancelBill',$fac->ref),'confirm_canceled',$formquestion); $ret=$html->form_confirm($_SERVER['PHP_SELF'].'?facid='.$fac->id,$langs->trans('CancelBill'),$langs->trans('ConfirmCancelBill',$fac->ref),'confirm_canceled',$formquestion);
print '<br>'; if ($ret == 'html') print '<br>';
} }
} }
// Confirmation de la suppression d'une ligne produit // Confirmation de la suppression d'une ligne produit
if ($_GET['action'] == 'delete_product_line' && $conf->global->PRODUIT_CONFIRM_DELETE_LINE) if ($_GET['action'] == 'delete_product_line' && $conf->global->PRODUIT_CONFIRM_DELETE_LINE)
{ {
$html->form_confirm($_SERVER["PHP_SELF"].'?facid='.$fac->id.'&amp;rowid='.$_GET["rowid"], $langs->trans('DeleteProductLine'), $langs->trans('ConfirmDeleteProductLine'), 'confirm_deleteproductline', '', 'no'); $ret=$html->form_confirm($_SERVER["PHP_SELF"].'?facid='.$fac->id.'&amp;rowid='.$_GET["rowid"], $langs->trans('DeleteProductLine'), $langs->trans('ConfirmDeleteProductLine'), 'confirm_deleteproductline', '', 'no');
print '<br>'; if ($ret == 'html') print '<br>';
} }
// Clone confirmation // Clone confirmation
@ -2145,8 +2145,8 @@ else
//array('type' => 'checkbox', 'name' => 'clone_content', 'label' => $langs->trans("CloneMainAttributes"), 'value' => 1) //array('type' => 'checkbox', 'name' => 'clone_content', 'label' => $langs->trans("CloneMainAttributes"), 'value' => 1)
); );
// Paiement incomplet. On demande si motif = escompte ou autre // Paiement incomplet. On demande si motif = escompte ou autre
$html->form_confirm($_SERVER["PHP_SELF"].'?facid='.$fac->id,$langs->trans('CloneInvoice'),$langs->trans('ConfirmCloneInvoice',$fac->ref),'confirm_clone',$formquestion,'yes'); $ret=$html->form_confirm($_SERVER["PHP_SELF"].'?facid='.$fac->id,$langs->trans('CloneInvoice'),$langs->trans('ConfirmCloneInvoice',$fac->ref),'confirm_clone',$formquestion,'yes');
print '<br>'; if ($ret == 'html') print '<br>';
} }
@ -3182,19 +3182,7 @@ else
{ {
if ($user->rights->facture->valider) if ($user->rights->facture->valider)
{ {
print '<a class="butAction" '; print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?facid='.$fac->id.'&amp;action=valid"';
if ($conf->use_javascript_ajax && $conf->global->MAIN_CONFIRM_AJAX)
{
// We check if number is temporary number
if (eregi('^\(PROV',$fac->ref)) $num = $fac->getNextNumRef($soc);
else $num = $fac->ref;
$url = $_SERVER["PHP_SELF"].'?facid='.$fac->id.'&amp;action=confirm_valid&confirm=yes';
print 'href="#" onClick="dialogConfirm(\''.$url.'\',\''.dol_escape_js($langs->trans('ConfirmValidateBill',$num)).'\',\''.$langs->trans("Yes").'\',\''.$langs->trans("No").'\',\'validate\')"';
}
else
{
print 'href="'.$_SERVER["PHP_SELF"].'?facid='.$fac->id.'&amp;action=valid"';
}
print '>'.$langs->trans('Validate').'</a>'; print '>'.$langs->trans('Validate').'</a>';
} }
} }

View File

@ -470,10 +470,9 @@ if ($_GET['action'] == 'create' || $_POST['action'] == 'confirm_paiement' || $_P
if ($_POST["action"] == 'add_paiement') if ($_POST["action"] == 'add_paiement')
{ {
// print '<tr><td colspan="3">'; // print '<tr><td colspan="3">';
print '<br />'; print '<br>';
$text=$langs->trans('ConfirmCustomerPayment',$totalpaiement,$langs->trans("Currency".$conf->monnaie)); $text=$langs->trans('ConfirmCustomerPayment',$totalpaiement,$langs->trans("Currency".$conf->monnaie));
$html->form_confirm($_SERVER['PHP_SELF'].'?facid='.$facture->id.'&socid='.$facture->socid.'&type='.$facture->type,$langs->trans('ReceivedCustomersPayments'),$text,'confirm_paiement',$formquestion); $html->form_confirm($_SERVER['PHP_SELF'].'?facid='.$facture->id.'&socid='.$facture->socid.'&type='.$facture->type,$langs->trans('ReceivedCustomersPayments'),$text,'confirm_paiement',$formquestion);
// print '</td></tr>';
} }
print "</form>\n"; print "</form>\n";

View File

@ -133,7 +133,7 @@ if ($_POST['action'] == 'builddoc' && $user->rights->banque)
$outputlangs = new Translate("",$conf); $outputlangs = new Translate("",$conf);
$outputlangs->setDefaultLang($_REQUEST['lang_id']); $outputlangs->setDefaultLang($_REQUEST['lang_id']);
} }
$result = $remisecheque->GeneratePdf($_POST["model"], $outputlangs); $result = $remisecheque->GeneratePdf($_POST["model"], $outputlangs);
if ($result <= 0) if ($result <= 0)
{ {
@ -197,8 +197,8 @@ else
*/ */
if ($_GET['action'] == 'delete') if ($_GET['action'] == 'delete')
{ {
$html->form_confirm('fiche.php?id='.$remisecheque->id, $langs->trans("DeleteCheckReceipt"), $langs->trans("ConfirmDeleteCheckReceipt"), 'confirm_delete'); $ret=$html->form_confirm('fiche.php?id='.$remisecheque->id, $langs->trans("DeleteCheckReceipt"), $langs->trans("ConfirmDeleteCheckReceipt"), 'confirm_delete');
print '<br>'; if ($ret == 'html') print '<br>';
} }
/* /*
@ -207,8 +207,8 @@ else
if ($_GET['action'] == 'valide') if ($_GET['action'] == 'valide')
{ {
$facid = $_GET['facid']; $facid = $_GET['facid'];
$html->form_confirm('fiche.php?id='.$remisecheque->id, $langs->trans("ValidateCheckReceipt"), $langs->trans("ConfirmValidateCheckReceipt"), 'confirm_valide'); $ret=$html->form_confirm('fiche.php?id='.$remisecheque->id, $langs->trans("ValidateCheckReceipt"), $langs->trans("ConfirmValidateCheckReceipt"), 'confirm_valide');
print '<br>'; if ($ret == 'html') print '<br>';
} }
} }

View File

@ -143,8 +143,8 @@ dol_fiche_head($head, $hselected, $langs->trans("PaymentCustomerInvoice"));
*/ */
if ($_GET['action'] == 'delete') if ($_GET['action'] == 'delete')
{ {
$html->form_confirm('fiche.php?id='.$paiement->id, $langs->trans("DeletePayment"), $langs->trans("ConfirmDeletePayment"), 'confirm_delete'); $ret=$html->form_confirm('fiche.php?id='.$paiement->id, $langs->trans("DeletePayment"), $langs->trans("ConfirmDeletePayment"), 'confirm_delete');
print '<br>'; if ($ret == 'html') print '<br>';
} }
/* /*
@ -153,8 +153,8 @@ if ($_GET['action'] == 'delete')
if ($_GET['action'] == 'valide') if ($_GET['action'] == 'valide')
{ {
$facid = $_GET['facid']; $facid = $_GET['facid'];
$html->form_confirm('fiche.php?id='.$paiement->id.'&amp;facid='.$facid, $langs->trans("ValidatePayment"), $langs->trans("ConfirmValidatePayment"), 'confirm_valide'); $ret=$html->form_confirm('fiche.php?id='.$paiement->id.'&amp;facid='.$facid, $langs->trans("ValidatePayment"), $langs->trans("ConfirmValidatePayment"), 'confirm_valide');
print '<br>'; if ($ret == 'html') print '<br>';
} }

View File

@ -150,8 +150,8 @@ if ($_GET["id"])
if ($_GET["action"] == 'credite') if ($_GET["action"] == 'credite')
{ {
$html->form_confirm("fiche.php?id=".$bon->id,$langs->trans("ClassCredited"),$langs->trans("ClassCreditedConfirm"),"confirm_credite"); $ret=$html->form_confirm("fiche.php?id=".$bon->id,$langs->trans("ClassCredited"),$langs->trans("ClassCreditedConfirm"),"confirm_credite");
print '<br />'; if ($ret == 'html') print '<br>';
} }
print '<table class="border" width="100%">'; print '<table class="border" width="100%">';

View File

@ -262,15 +262,15 @@ if ($chid > 0)
if ($_GET["action"] == 'payed') if ($_GET["action"] == 'payed')
{ {
$text=$langs->trans('ConfirmPaySocialContribution'); $text=$langs->trans('ConfirmPaySocialContribution');
$html->form_confirm($_SERVER["PHP_SELF"]."?id=$cha->id&amp;action=confirm_payed",$langs->trans('PaySocialContribution'),$text,"confirm_payed"); $ret=$html->form_confirm($_SERVER["PHP_SELF"]."?id=$cha->id&amp;action=confirm_payed",$langs->trans('PaySocialContribution'),$text,"confirm_payed");
print '<br>'; if ($ret == 'html') print '<br>';
} }
if ($_GET['action'] == 'delete') if ($_GET['action'] == 'delete')
{ {
$text=$langs->trans('ConfirmDeleteSocialContribution'); $text=$langs->trans('ConfirmDeleteSocialContribution');
$html->form_confirm($_SERVER['PHP_SELF'].'?id='.$cha->id,$langs->trans('DeleteSocialContribution'),$text,'confirm_delete'); $ret=$html->form_confirm($_SERVER['PHP_SELF'].'?id='.$cha->id,$langs->trans('DeleteSocialContribution'),$text,'confirm_delete');
print '<br />'; if ($ret == 'html') print '<br>';
} }
if ($_GET['action'] == 'edit') print "<form name=\"charge\" action=\"charges.php?id=$cha->id&amp;action=update\" method=\"post\">"; if ($_GET['action'] == 'edit') print "<form name=\"charge\" action=\"charges.php?id=$cha->id&amp;action=update\" method=\"post\">";

View File

@ -223,8 +223,8 @@ if ($user->rights->societe->contact->supprimer)
{ {
if ($_GET["action"] == 'delete') if ($_GET["action"] == 'delete')
{ {
$form->form_confirm($_SERVER["PHP_SELF"]."?id=".$_GET["id"],$langs->trans("DeleteContact"),$langs->trans("ConfirmDeleteContact"),"confirm_delete"); $ret=$form->form_confirm($_SERVER["PHP_SELF"]."?id=".$_GET["id"],$langs->trans("DeleteContact"),$langs->trans("ConfirmDeleteContact"),"confirm_delete");
print '<br>'; if ($ret == 'html') print '<br>';
} }
} }
@ -487,8 +487,8 @@ if ($_GET["id"] && $_GET["action"] != 'edit')
$formquestion=array( $formquestion=array(
array('label' => $langs->trans("LoginToCreate"), 'type' => 'text', 'name' => 'login', 'value' => $login)); array('label' => $langs->trans("LoginToCreate"), 'type' => 'text', 'name' => 'login', 'value' => $login));
$form->form_confirm($_SERVER["PHP_SELF"]."?id=".$contact->id,$langs->trans("CreateDolibarrLogin"),$langs->trans("ConfirmCreateContact"),"confirm_create_user",$formquestion); $ret=$form->form_confirm($_SERVER["PHP_SELF"]."?id=".$contact->id,$langs->trans("CreateDolibarrLogin"),$langs->trans("ConfirmCreateContact"),"confirm_create_user",$formquestion);
print '<br>'; if ($ret == 'html') print '<br>';
} }
print '<table class="border" width="100%">'; print '<table class="border" width="100%">';

View File

@ -68,7 +68,7 @@ if ($_POST["action"] == 'confirm_active' && $_POST["confirm"] == 'yes' && $user-
} }
} }
if ($_POST["action"] == 'confirm_closeline' && $_POST["confirm"] == 'yes' && $user->rights->contrat->activer) if ($_REQUEST["action"] == 'confirm_closeline' && $_REQUEST["confirm"] == 'yes' && $user->rights->contrat->activer)
{ {
$contrat = new Contrat($db); $contrat = new Contrat($db);
$contrat->fetch($_GET["id"]); $contrat->fetch($_GET["id"]);
@ -654,8 +654,8 @@ else
*/ */
if ($_GET["action"] == 'delete') if ($_GET["action"] == 'delete')
{ {
$form->form_confirm("fiche.php?id=$id",$langs->trans("DeleteAContract"),$langs->trans("ConfirmDeleteAContract"),"confirm_delete"); $ret=$form->form_confirm("fiche.php?id=$id",$langs->trans("DeleteAContract"),$langs->trans("ConfirmDeleteAContract"),"confirm_delete");
print '<br>'; if ($ret == 'html') print '<br>';
} }
/* /*
@ -664,8 +664,8 @@ else
if ($_GET["action"] == 'valid') if ($_GET["action"] == 'valid')
{ {
//$numfa = contrat_get_num($soc); //$numfa = contrat_get_num($soc);
$form->form_confirm("fiche.php?id=$id",$langs->trans("ValidateAContract"),$langs->trans("ConfirmValidateContract"),"confirm_valid"); $ret=$form->form_confirm("fiche.php?id=$id",$langs->trans("ValidateAContract"),$langs->trans("ConfirmValidateContract"),"confirm_valid");
print '<br>'; if ($ret == 'html') print '<br>';
} }
/* /*
@ -673,8 +673,8 @@ else
*/ */
if ($_GET["action"] == 'close') if ($_GET["action"] == 'close')
{ {
$form->form_confirm("fiche.php?id=$id",$langs->trans("CloseAContract"),$langs->trans("ConfirmCloseContract"),"confirm_close"); $ret=$form->form_confirm("fiche.php?id=$id",$langs->trans("CloseAContract"),$langs->trans("ConfirmCloseContract"),"confirm_close");
print '<br>'; if ($ret == 'html') print '<br>';
} }
/* /*
@ -991,7 +991,11 @@ else
//print '<br />'; //print '<br />';
$dateactstart = dol_mktime(12, 0 , 0, $_POST["remonth"], $_POST["reday"], $_POST["reyear"]); $dateactstart = dol_mktime(12, 0 , 0, $_POST["remonth"], $_POST["reday"], $_POST["reyear"]);
$dateactend = dol_mktime(12, 0 , 0, $_POST["endmonth"], $_POST["endday"], $_POST["endyear"]); $dateactend = dol_mktime(12, 0 , 0, $_POST["endmonth"], $_POST["endday"], $_POST["endyear"]);
$html->form_confirm($_SERVER["PHP_SELF"]."?id=".$contrat->id."&amp;ligne=".$_GET["ligne"]."&amp;date=".$dateactstart."&amp;dateend=".$dateactend,$langs->trans("CloseService"),$langs->trans("ConfirmCloseService",dol_print_date($dateactend,"%A %d %B %Y")),"confirm_closeline"); $page=$_SERVER["PHP_SELF"]."?id=".$contrat->id."&ligne=".$_GET["ligne"]."&date=".$dateactstart."&dateend=".$dateactend;
$title=$langs->trans("CloseService");
$question=$langs->trans("ConfirmCloseService",dol_print_date($dateactend,"%A %d %B %Y"));
$action="confirm_closeline";
$html->form_confirm($page,$title,$question,$action,'','');
print '<table class="noborder" width="100%"><tr '.$bc[false].' height="6"><td></td></tr></table>'; print '<table class="noborder" width="100%"><tr '.$bc[false].' height="6"><td></td></tr></table>';
} }

View File

@ -94,18 +94,18 @@ if ($_POST["action"] == 'add' && $user->rights->ecm->setup)
$ecmdir->fk_parent = $_POST["catParent"]; $ecmdir->fk_parent = $_POST["catParent"];
$ok=true; $ok=true;
if (! $ecmdir->label) if (! $ecmdir->label)
{ {
$mesg='<div class="error">'.$langs->trans("ErrorFieldRequired",$langs->transnoentities("Label")).'</div>'; $mesg='<div class="error">'.$langs->trans("ErrorFieldRequired",$langs->transnoentities("Label")).'</div>';
$_GET["action"] = "create"; $_GET["action"] = "create";
$ok=false; $ok=false;
} }
if ($ok) if ($ok)
{ {
$id = $ecmdir->create($user); $id = $ecmdir->create($user);
if ($id > 0) if ($id > 0)
{ {
Header("Location: ".DOL_URL_ROOT.'/ecm/index.php?action=file_manager'); Header("Location: ".DOL_URL_ROOT.'/ecm/index.php?action=file_manager');
@ -196,17 +196,17 @@ if (! $_GET["action"] || $_GET["action"] == 'delete_section')
//print ' -> <b>'.$ecmdir->getNomUrl(1).'</b><br>'; //print ' -> <b>'.$ecmdir->getNomUrl(1).'</b><br>';
print "<br><br>"; print "<br><br>";
*/ */
// Confirmation de la suppression d'une ligne categorie // Confirmation de la suppression d'une ligne categorie
if ($_GET['action'] == 'delete_section') if ($_GET['action'] == 'delete_section')
{ {
$form->form_confirm($_SERVER["PHP_SELF"].'?section='.urldecode($_GET["section"]), $langs->trans('DeleteSection'), $langs->trans('ConfirmDeleteSection',$ecmdir->label), 'confirm_deletesection'); $ret=$form->form_confirm($_SERVER["PHP_SELF"].'?section='.urldecode($_GET["section"]), $langs->trans('DeleteSection'), $langs->trans('ConfirmDeleteSection',$ecmdir->label), 'confirm_deletesection');
print '<br>'; if ($ret == 'html') print '<br>';
} }
if ($mesg) { print $mesg."<br>"; } if ($mesg) { print $mesg."<br>"; }
// Construit fiche rubrique // Construit fiche rubrique

View File

@ -119,8 +119,8 @@ dol_fiche_head($head, 'card', $langs->trans("ECMSectionManual"));
if ($_GET["action"] == 'edit') if ($_GET["action"] == 'edit')
{ {
print '<form name="update" action="'.$_SERVER["PHP_SELF"].'" method="POST">'; print '<form name="update" action="'.$_SERVER["PHP_SELF"].'" method="POST">';
print '<input type="hidden" name="fileid" value="'.$fileid.'">'; print '<input type="hidden" name="fileid" value="'.$fileid.'">';
print '<input type="hidden" name="action" value="update">'; print '<input type="hidden" name="action" value="update">';
} }
print '<table class="border" width="100%">'; print '<table class="border" width="100%">';
@ -202,13 +202,13 @@ if (! $_GET["action"] || $_GET["action"] == 'delete_section')
// Confirmation de la suppression d'une ligne categorie // Confirmation de la suppression d'une ligne categorie
if ($_GET['action'] == 'delete_section') if ($_GET['action'] == 'delete_section')
{ {
$form->form_confirm($_SERVER["PHP_SELF"].'?section='.urldecode($_GET["section"]), $langs->trans('DeleteSection'), $langs->trans('ConfirmDeleteSection',$ecmdir->label), 'confirm_deletesection'); $ret=$form->form_confirm($_SERVER["PHP_SELF"].'?section='.urldecode($_GET["section"]), $langs->trans('DeleteSection'), $langs->trans('ConfirmDeleteSection',$ecmdir->label), 'confirm_deletesection');
print '<br>'; if ($ret == 'html') print '<br>';
} }
if ($mesg) { print $mesg."<br>"; } if ($mesg) { print $mesg."<br>"; }
// Construit fiche rubrique // Construit fiche rubrique

View File

@ -66,7 +66,7 @@ if (! $section)
// Load ecm object // Load ecm object
$ecmdir = new ECMDirectory($db); $ecmdir = new ECMDirectory($db);
if (empty($_REQUEST["section"])) if (empty($_REQUEST["section"]))
{ {
dol_print_error('','Error, section parameter missing'); dol_print_error('','Error, section parameter missing');
exit; exit;
@ -91,11 +91,11 @@ $upload_dir = $conf->ecm->dir_output.'/'.$relativepath;
// Envoie fichier // Envoie fichier
if ( $_POST["sendit"] && ! empty($conf->global->MAIN_UPLOAD_DOC)) if ( $_POST["sendit"] && ! empty($conf->global->MAIN_UPLOAD_DOC))
{ {
if (! is_dir($upload_dir)) if (! is_dir($upload_dir))
{ {
$result=create_exdir($upload_dir); $result=create_exdir($upload_dir);
} }
if (is_dir($upload_dir)) if (is_dir($upload_dir))
{ {
$result = dol_move_uploaded_file($_FILES['userfile']['tmp_name'], $upload_dir . "/" . $_FILES['userfile']['name'],0); $result = dol_move_uploaded_file($_FILES['userfile']['tmp_name'], $upload_dir . "/" . $_FILES['userfile']['name'],0);
@ -132,7 +132,7 @@ if ($_POST['action'] == 'confirm_deletefile' && $_POST['confirm'] == 'yes')
{ {
$file = $upload_dir . "/" . urldecode($_GET["urlfile"]); $file = $upload_dir . "/" . urldecode($_GET["urlfile"]);
$result=dol_delete_file($file); $result=dol_delete_file($file);
$mesg = '<div class="ok">'.$langs->trans("FileWasRemoved").'</div>'; $mesg = '<div class="ok">'.$langs->trans("FileWasRemoved").'</div>';
$result=$ecmdir->changeNbOfFiles('-'); $result=$ecmdir->changeNbOfFiles('-');
@ -152,11 +152,11 @@ if ($_POST['action'] == 'confirm_deletedir' && $_POST['confirm'] == 'yes')
if ($_POST['action'] == 'update' && ! $_POST['cancel']) if ($_POST['action'] == 'update' && ! $_POST['cancel'])
{ {
$db->begin(); $db->begin();
$oldlabel=$ecmdir->label; $oldlabel=$ecmdir->label;
$olddir=$ecmdir->getRelativePath(0); $olddir=$ecmdir->getRelativePath(0);
$olddir=$conf->ecm->dir_output.'/'.$olddir; $olddir=$conf->ecm->dir_output.'/'.$olddir;
// Fetch was already done // Fetch was already done
$ecmdir->label = $_POST["label"]; $ecmdir->label = $_POST["label"];
$ecmdir->description = $_POST["description"]; $ecmdir->description = $_POST["description"];
@ -164,7 +164,7 @@ if ($_POST['action'] == 'update' && ! $_POST['cancel'])
if ($result > 0) if ($result > 0)
{ {
$error=0; $error=0;
// Try to rename file if changed // Try to rename file if changed
if ($oldlabel != $ecmdir->label if ($oldlabel != $ecmdir->label
&& file_exists($olddir)) && file_exists($olddir))
@ -180,18 +180,18 @@ if ($_POST['action'] == 'update' && ! $_POST['cancel'])
$error++; $error++;
} }
} }
if (! $error) if (! $error)
{ {
$db->commit(); $db->commit();
$relativepath=$ecmdir->getRelativePath(); $relativepath=$ecmdir->getRelativePath();
$upload_dir = $conf->ecm->dir_output.'/'.$relativepath; $upload_dir = $conf->ecm->dir_output.'/'.$relativepath;
} }
else else
{ {
$db->rollback(); $db->rollback();
} }
} }
else else
{ {
@ -228,8 +228,8 @@ dol_fiche_head($head, 'card', $langs->trans("ECMSectionManual"));
if ($_GET["action"] == 'edit') if ($_GET["action"] == 'edit')
{ {
print '<form name="update" action="'.$_SERVER["PHP_SELF"].'" method="POST">'; print '<form name="update" action="'.$_SERVER["PHP_SELF"].'" method="POST">';
print '<input type="hidden" name="section" value="'.$section.'">'; print '<input type="hidden" name="section" value="'.$section.'">';
print '<input type="hidden" name="action" value="update">'; print '<input type="hidden" name="action" value="update">';
} }
print '<table class="border" width="100%">'; print '<table class="border" width="100%">';
@ -310,12 +310,12 @@ print '</div>';
if ($_GET["action"] != 'edit' && $_GET['action'] != 'delete_dir' && $_GET['action'] != 'delete') if ($_GET["action"] != 'edit' && $_GET['action'] != 'delete_dir' && $_GET['action'] != 'delete')
{ {
print '<div class="tabsAction">'; print '<div class="tabsAction">';
if ($user->rights->ecm->setup) if ($user->rights->ecm->setup)
{ {
print '<a class="butAction" href="'.$_SERVER['PHP_SELF'].'?action=edit&section='.$section.'">'.$langs->trans('Edit').'</a>'; print '<a class="butAction" href="'.$_SERVER['PHP_SELF'].'?action=edit&section='.$section.'">'.$langs->trans('Edit').'</a>';
} }
if (sizeof($filearray) == 0) if (sizeof($filearray) == 0)
{ {
if ($user->rights->ecm->setup) if ($user->rights->ecm->setup)
@ -340,15 +340,15 @@ if ($mesg) { print '<br>'.$mesg.'<br>'; }
// Confirm remove file // Confirm remove file
if ($_GET['action'] == 'delete') if ($_GET['action'] == 'delete')
{ {
$form->form_confirm($_SERVER["PHP_SELF"].'?section='.$_REQUEST["section"].'&amp;urlfile='.urldecode($_GET["urlfile"]), $langs->trans('DeleteFile'), $langs->trans('ConfirmDeleteFile'), 'confirm_deletefile'); $ret=$form->form_confirm($_SERVER["PHP_SELF"].'?section='.$_REQUEST["section"].'&amp;urlfile='.urldecode($_GET["urlfile"]), $langs->trans('DeleteFile'), $langs->trans('ConfirmDeleteFile'), 'confirm_deletefile');
print '<br>'; if ($ret == 'html') print '<br>';
} }
// Confirm remove file // Confirm remove file
if ($_GET['action'] == 'delete_dir') if ($_GET['action'] == 'delete_dir')
{ {
$form->form_confirm($_SERVER["PHP_SELF"].'?section='.$_REQUEST["section"], $langs->trans('DeleteSection'), $langs->trans('ConfirmDeleteSection'), 'confirm_deletedir'); $ret=$form->form_confirm($_SERVER["PHP_SELF"].'?section='.$_REQUEST["section"], $langs->trans('DeleteSection'), $langs->trans('ConfirmDeleteSection'), 'confirm_deletedir');
print '<br>'; if ($ret == 'html') print '<br>';
} }
$formfile=new FormFile($db); $formfile=new FormFile($db);

View File

@ -3,12 +3,12 @@
*/ */
/** /**
\file htdocs/ecm/docother.php \file htdocs/ecm/docother.php
\ingroup ecm \ingroup ecm
\brief Main ecm page \brief Main ecm page
\version $Id$ \version $Id$
\author Laurent Destailleur \author Laurent Destailleur
*/ */
require("./pre.inc.php"); require("./pre.inc.php");
require_once(DOL_DOCUMENT_ROOT."/html.formfile.class.php"); require_once(DOL_DOCUMENT_ROOT."/html.formfile.class.php");
@ -27,8 +27,8 @@ $socid = isset($_GET["socid"])?$_GET["socid"]:'';
// Permissions // Permissions
if ($user->societe_id > 0) if ($user->societe_id > 0)
{ {
$action = ''; $action = '';
$socid = $user->societe_id; $socid = $user->societe_id;
} }
$section=$_GET["section"]; $section=$_GET["section"];
@ -38,44 +38,44 @@ $upload_dir = $conf->ecm->dir_output.'/'.$section;
/******************************************************************* /*******************************************************************
* ACTIONS * ACTIONS
* *
* Put here all code to do according to value of "action" parameter * Put here all code to do according to value of "action" parameter
********************************************************************/ ********************************************************************/
// Envoie fichier // Envoie fichier
if ( $_POST["sendit"] && ! empty($conf->global->MAIN_UPLOAD_DOC)) if ( $_POST["sendit"] && ! empty($conf->global->MAIN_UPLOAD_DOC))
{ {
if (! is_dir($upload_dir)) create_exdir($upload_dir); if (! is_dir($upload_dir)) create_exdir($upload_dir);
if (is_dir($upload_dir)) if (is_dir($upload_dir))
{ {
$result = dol_move_uploaded_file($_FILES['userfile']['tmp_name'], $upload_dir . "/" . $_FILES['userfile']['name'],0); $result = dol_move_uploaded_file($_FILES['userfile']['tmp_name'], $upload_dir . "/" . $_FILES['userfile']['name'],0);
if ($result > 0) if ($result > 0)
{ {
$mesg = '<div class="ok">'.$langs->trans("FileTransferComplete").'</div>'; $mesg = '<div class="ok">'.$langs->trans("FileTransferComplete").'</div>';
//print_r($_FILES); //print_r($_FILES);
} }
else if ($result < 0) else if ($result < 0)
{ {
// Echec transfert (fichier d?passant la limite ?) // Echec transfert (fichier d?passant la limite ?)
$mesg = '<div class="error">'.$langs->trans("ErrorFileNotUploaded").'</div>'; $mesg = '<div class="error">'.$langs->trans("ErrorFileNotUploaded").'</div>';
// print_r($_FILES); // print_r($_FILES);
} }
else else
{ {
// Fichier infect? par un virus // Fichier infect? par un virus
$mesg = '<div class="error">'.$langs->trans("ErrorFileIsInfectedWith",$result).'</div>'; $mesg = '<div class="error">'.$langs->trans("ErrorFileIsInfectedWith",$result).'</div>';
} }
} }
} }
// Suppression fichier // Suppression fichier
if ($_POST['action'] == 'confirm_deletefile' && $_POST['confirm'] == 'yes') if ($_POST['action'] == 'confirm_deletefile' && $_POST['confirm'] == 'yes')
{ {
$file = $upload_dir . "/" . urldecode($_GET["urlfile"]); $file = $upload_dir . "/" . urldecode($_GET["urlfile"]);
dol_delete_file($file); dol_delete_file($file);
$mesg = '<div class="ok">'.$langs->trans("FileWasRemoved").'</div>'; $mesg = '<div class="ok">'.$langs->trans("FileWasRemoved").'</div>';
} }
@ -83,10 +83,10 @@ if ($_POST['action'] == 'confirm_deletefile' && $_POST['confirm'] == 'yes')
/******************************************************************* /*******************************************************************
* PAGE * PAGE
* *
* Put here all code to do according to value of "action" parameter * Put here all code to do according to value of "action" parameter
********************************************************************/ ********************************************************************/
llxHeader(); llxHeader();
@ -101,12 +101,12 @@ print_fiche_titre($langs->trans("ECMAutoOrg"));
/* /*
* Confirmation de la suppression d'une ligne produit * Confirmation de la suppression d'une ligne produit
*/ */
if ($_GET['action'] == 'delete_file') if ($_GET['action'] == 'delete_file')
{ {
$html->form_confirm($_SERVER["PHP_SELF"].'?socid='.$socid.'&amp;urlfile='.urldecode($_GET["urlfile"]), $langs->trans('DeleteFile'), $langs->trans('ConfirmDeleteFile'), 'confirm_deletefile'); $ret=$html->form_confirm($_SERVER["PHP_SELF"].'?socid='.$socid.'&amp;urlfile='.urldecode($_GET["urlfile"]), $langs->trans('DeleteFile'), $langs->trans('ConfirmDeleteFile'), 'confirm_deletefile');
print '<br>'; if ($ret == 'html') print '<br>';
} }
// Construit liste des fichiers // Construit liste des fichiers

View File

@ -221,8 +221,8 @@ print "<br>\n";
// Confirm remove file // Confirm remove file
if ($_GET['action'] == 'delete') if ($_GET['action'] == 'delete')
{ {
$form->form_confirm($_SERVER["PHP_SELF"].'?section='.$_REQUEST["section"].'&amp;urlfile='.urldecode($_GET["urlfile"]), $langs->trans('DeleteFile'), $langs->trans('ConfirmDeleteFile'), 'confirm_deletefile'); $ret=$form->form_confirm($_SERVER["PHP_SELF"].'?section='.$_REQUEST["section"].'&amp;urlfile='.urldecode($_GET["urlfile"]), $langs->trans('DeleteFile'), $langs->trans('ConfirmDeleteFile'), 'confirm_deletefile');
print '<br>'; if ($ret == 'html') print '<br>';
} }
if ($mesg) { print $mesg."<br>"; } if ($mesg) { print $mesg."<br>"; }
@ -246,8 +246,8 @@ if (empty($action) || $action == 'file_manager' || eregi('refresh',$action) || $
// Confirmation de la suppression d'une ligne categorie // Confirmation de la suppression d'une ligne categorie
if ($_GET['action'] == 'delete_section') if ($_GET['action'] == 'delete_section')
{ {
$form->form_confirm($_SERVER["PHP_SELF"].'?section='.urldecode($_GET["section"]), $langs->trans('DeleteSection'), $langs->trans('ConfirmDeleteSection',$ecmdir->label), 'confirm_deletesection'); $ret=$form->form_confirm($_SERVER["PHP_SELF"].'?section='.urldecode($_GET["section"]), $langs->trans('DeleteSection'), $langs->trans('ConfirmDeleteSection',$ecmdir->label), 'confirm_deletesection');
print '<br>'; if ($ret == 'html') print '<br>';
} }
// Construit liste des repertoires // Construit liste des repertoires

View File

@ -150,8 +150,8 @@ if ($id > 0 || ! empty($ref))
*/ */
if ($_GET["action"] == 'cloture') if ($_GET["action"] == 'cloture')
{ {
$html->form_confirm("commande.php?id=".$_GET["id"],"Cl<EFBFBD>turer la commande","Etes-vous s<>r de vouloir cl<63>turer cette commande ?","confirm_cloture"); $ret=$html->form_confirm("commande.php?id=".$_GET["id"],"Cl<EFBFBD>turer la commande","Etes-vous s<>r de vouloir cl<63>turer cette commande ?","confirm_cloture");
print "<br />"; if ($ret == 'html') print '<br>';
} }
// Onglet commande // Onglet commande

View File

@ -554,8 +554,8 @@ else
*/ */
if ($_GET["action"] == 'delete') if ($_GET["action"] == 'delete')
{ {
$html->form_confirm($_SERVER['PHP_SELF'].'?id='.$expedition->id,$langs->trans('DeleteSending'),$langs->trans("ConfirmDeleteSending",$expedition->ref),'confirm_delete'); $ret=$html->form_confirm($_SERVER['PHP_SELF'].'?id='.$expedition->id,$langs->trans('DeleteSending'),$langs->trans("ConfirmDeleteSending",$expedition->ref),'confirm_delete');
print '<br>'; if ($ret == 'html') print '<br>';
} }
/* /*
@ -564,8 +564,8 @@ else
*/ */
if ($_GET["action"] == 'valid') if ($_GET["action"] == 'valid')
{ {
$html->form_confirm($_SERVER['PHP_SELF'].'?id='.$expedition->id,$langs->trans('ValidateSending'),$langs->trans("ConfirmValidateSending",$expedition->ref),'confirm_valid'); $ret=$html->form_confirm($_SERVER['PHP_SELF'].'?id='.$expedition->id,$langs->trans('ValidateSending'),$langs->trans("ConfirmValidateSending",$expedition->ref),'confirm_valid');
print '<br>'; if ($ret == 'html') print '<br>';
} }
/* /*
* Confirmation de l'annulation * Confirmation de l'annulation
@ -573,8 +573,8 @@ else
*/ */
if ($_GET["action"] == 'annuler') if ($_GET["action"] == 'annuler')
{ {
$html->form_confirm($_SERVER['PHP_SELF'].'?id='.$expedition->id,$langs->trans('CancelSending'),$langs->trans("ConfirmCancelSending",$expedition->ref),'confirm_cancel'); $ret=$html->form_confirm($_SERVER['PHP_SELF'].'?id='.$expedition->id,$langs->trans('CancelSending'),$langs->trans("ConfirmCancelSending",$expedition->ref),'confirm_cancel');
print '<br>'; if ($ret == 'html') print '<br>';
} }
// Calcul du poids total et du volume total des produits // Calcul du poids total et du volume total des produits

View File

@ -522,29 +522,29 @@ elseif ($_GET["id"] > 0)
// Confirmation de la suppression de la fiche d'intervention // Confirmation de la suppression de la fiche d'intervention
if ($_GET['action'] == 'delete') if ($_GET['action'] == 'delete')
{ {
$html->form_confirm($_SERVER["PHP_SELF"].'?id='.$fichinter->id, $langs->trans('DeleteIntervention'), $langs->trans('ConfirmDeleteIntervention'), 'confirm_delete'); $ret=$html->form_confirm($_SERVER["PHP_SELF"].'?id='.$fichinter->id, $langs->trans('DeleteIntervention'), $langs->trans('ConfirmDeleteIntervention'), 'confirm_delete');
print '<br>'; if ($ret == 'html') print '<br>';
} }
// Confirmation de la validation de la fiche d'intervention // Confirmation de la validation de la fiche d'intervention
if ($_GET['action'] == 'validate') if ($_GET['action'] == 'validate')
{ {
$html->form_confirm($_SERVER["PHP_SELF"].'?id='.$fichinter->id, $langs->trans('ValidateIntervention'), $langs->trans('ConfirmValidateIntervention'), 'confirm_validate'); $ret=$html->form_confirm($_SERVER["PHP_SELF"].'?id='.$fichinter->id, $langs->trans('ValidateIntervention'), $langs->trans('ConfirmValidateIntervention'), 'confirm_validate');
print '<br>'; if ($ret == 'html') print '<br>';
} }
// Confirmation de la validation de la fiche d'intervention // Confirmation de la validation de la fiche d'intervention
if ($_GET['action'] == 'modify') if ($_GET['action'] == 'modify')
{ {
$html->form_confirm($_SERVER["PHP_SELF"].'?id='.$fichinter->id, $langs->trans('ModifyIntervention'), $langs->trans('ConfirmModifyIntervention'), 'confirm_modify'); $ret=$html->form_confirm($_SERVER["PHP_SELF"].'?id='.$fichinter->id, $langs->trans('ModifyIntervention'), $langs->trans('ConfirmModifyIntervention'), 'confirm_modify');
print '<br>'; if ($ret == 'html') print '<br>';
} }
// Confirmation de la suppression d'une ligne d'intervention // Confirmation de la suppression d'une ligne d'intervention
if ($_GET['action'] == 'ask_deleteline' && $conf->global->PRODUIT_CONFIRM_DELETE_LINE) if ($_GET['action'] == 'ask_deleteline' && $conf->global->PRODUIT_CONFIRM_DELETE_LINE)
{ {
$html->form_confirm($_SERVER["PHP_SELF"].'?id='.$fichinter->id.'&amp;ligne='.$_GET["ligne"], $langs->trans('DeleteInterventionLine'), $langs->trans('ConfirmDeleteInterventionLine'), 'confirm_deleteline'); $ret=$html->form_confirm($_SERVER["PHP_SELF"].'?id='.$fichinter->id.'&amp;ligne='.$_GET["ligne"], $langs->trans('DeleteInterventionLine'), $langs->trans('ConfirmDeleteInterventionLine'), 'confirm_deleteline');
print '<br>'; if ($ret == 'html') print '<br>';
} }
print '<table class="border" width="100%">'; print '<table class="border" width="100%">';
@ -676,17 +676,8 @@ elseif ($_GET["id"] > 0)
print '<td align="center">'; print '<td align="center">';
if ($conf->global->PRODUIT_CONFIRM_DELETE_LINE) if ($conf->global->PRODUIT_CONFIRM_DELETE_LINE)
{ {
if ($conf->use_javascript_ajax && $conf->global->MAIN_CONFIRM_AJAX) print '<a href="'.$_SERVER["PHP_SELF"].'?id='.$fichinter->id.'&amp;action=ask_deleteline&amp;ligne='.$objp->rowid.'">';
{ print img_delete();
$url = $_SERVER["PHP_SELF"].'?id='.$fichinter->id.'&ligne='.$objp->rowid.'&action=confirm_deleteline&confirm=yes';
print '<a href="#" onClick="dialogConfirm(\''.$url.'\',\''.$langs->trans('ConfirmDeleteInterventionLine').'\',\''.$langs->trans("Yes").'\',\''.$langs->trans("No").'\',\'deleteline'.$i.'\')">';
print img_delete();
}
else
{
print '<a href="'.$_SERVER["PHP_SELF"].'?id='.$fichinter->id.'&amp;action=ask_deleteline&amp;ligne='.$objp->rowid.'">';
print img_delete();
}
} }
else else
{ {
@ -849,48 +840,21 @@ elseif ($_GET["id"] > 0)
// Validate // Validate
if ($fichinter->statut == 0 && $user->rights->ficheinter->creer) if ($fichinter->statut == 0 && $user->rights->ficheinter->creer)
{ {
print '<a class="butAction" '; print '<a class="butAction" href="fiche.php?id='.$_GET["id"].'&action=validate"';
if ($conf->use_javascript_ajax && $conf->global->MAIN_CONFIRM_AJAX)
{
$url = $_SERVER["PHP_SELF"].'?id='.$fichinter->id.'&action=confirm_validate&confirm=yes';
print 'href="#" onClick="dialogConfirm(\''.$url.'\',\''.dol_escape_js($langs->trans('ConfirmValidateIntervention')).'\',\''.$langs->trans("Yes").'\',\''.$langs->trans("No").'\',\'validate\')"';
}
else
{
print 'href="fiche.php?id='.$_GET["id"].'&action=validate"';
}
print '>'.$langs->trans("Valid").'</a>'; print '>'.$langs->trans("Valid").'</a>';
} }
// Modify // Modify
if ($fichinter->statut == 1 && $user->rights->ficheinter->creer) if ($fichinter->statut == 1 && $user->rights->ficheinter->creer)
{ {
print '<a class="butAction" '; print '<a class="butAction" href="fiche.php?id='.$_GET["id"].'&action=modify"';
if ($conf->use_javascript_ajax && $conf->global->MAIN_CONFIRM_AJAX)
{
$url = $_SERVER["PHP_SELF"].'?id='.$fichinter->id.'&action=confirm_modify&confirm=yes';
print 'href="#" onClick="dialogConfirm(\''.$url.'\',\''.dol_escape_js($langs->trans('ConfirmModifyIntervention')).'\',\''.$langs->trans("Yes").'\',\''.$langs->trans("No").'\',\'validate\')"';
}
else
{
print 'href="fiche.php?id='.$_GET["id"].'&action=modify"';
}
print '>'.$langs->trans("Modify").'</a>'; print '>'.$langs->trans("Modify").'</a>';
} }
// Delete // Delete
if (($fichinter->statut == 0 && $user->rights->ficheinter->creer) || $user->rights->ficheinter->supprimer) if (($fichinter->statut == 0 && $user->rights->ficheinter->creer) || $user->rights->ficheinter->supprimer)
{ {
print '<a class="butActionDelete" '; print '<a class="butActionDelete" href="'.$_SERVER["PHP_SELF"].'?id='.$fichinter->id.'&amp;action=delete"';
if ($conf->use_javascript_ajax && $conf->global->MAIN_CONFIRM_AJAX)
{
$url = $_SERVER["PHP_SELF"].'?id='.$fichinter->id.'&action=confirm_delete&confirm=yes';
print 'href="#" onClick="dialogConfirm(\''.$url.'\',\''.dol_escape_js($langs->trans("ConfirmDeleteIntervention",$fichinter->ref)).'\',\''.$langs->trans("Yes").'\',\''.$langs->trans("No").'\',\'delete\')"';
}
else
{
print 'href="'.$_SERVER["PHP_SELF"].'?id='.$fichinter->id.'&amp;action=delete"';
}
print '>'.$langs->trans('Delete').'</a>'; print '>'.$langs->trans('Delete').'</a>';
} }
} }

View File

@ -501,8 +501,8 @@ if ($id > 0 || ! empty($ref))
*/ */
if ($_GET['action'] == 'delete') if ($_GET['action'] == 'delete')
{ {
$html->form_confirm($_SERVER["PHP_SELF"].'?id='.$id, $langs->trans('DeleteOrder'), $langs->trans('ConfirmDeleteOrder'), 'confirm_delete'); $ret=$html->form_confirm($_SERVER["PHP_SELF"].'?id='.$id, $langs->trans('DeleteOrder'), $langs->trans('ConfirmDeleteOrder'), 'confirm_delete');
print '<br />'; if ($ret == 'html') print '<br>';
} }
/* /*
@ -525,8 +525,8 @@ if ($id > 0 || ! empty($ref))
$text.=$notify->confirmMessage(3,$commande->socid); $text.=$notify->confirmMessage(3,$commande->socid);
} }
$html->form_confirm($_SERVER["PHP_SELF"].'?id='.$id, $langs->trans('ValidateOrder'), $text, 'confirm_valid'); $ret=$html->form_confirm($_SERVER["PHP_SELF"].'?id='.$id, $langs->trans('ValidateOrder'), $text, 'confirm_valid');
print '<br />'; if ($ret == 'html') print '<br>';
} }
/* /*
* Confirmation de l'approbation * Confirmation de l'approbation
@ -534,8 +534,8 @@ if ($id > 0 || ! empty($ref))
*/ */
if ($_GET['action'] == 'approve') if ($_GET['action'] == 'approve')
{ {
$html->form_confirm("fiche.php?id=$commande->id",$langs->trans("ApproveThisOrder"),$langs->trans("ConfirmApproveThisOrder"),"confirm_approve"); $ret=$html->form_confirm("fiche.php?id=$commande->id",$langs->trans("ApproveThisOrder"),$langs->trans("ConfirmApproveThisOrder"),"confirm_approve");
print '<br />'; if ($ret == 'html') print '<br>';
} }
/* /*
* Confirmation de la desapprobation * Confirmation de la desapprobation
@ -543,16 +543,16 @@ if ($id > 0 || ! empty($ref))
*/ */
if ($_GET['action'] == 'refuse') if ($_GET['action'] == 'refuse')
{ {
$html->form_confirm("fiche.php?id=$commande->id",$langs->trans("DenyingThisOrder"),$langs->trans("ConfirmDenyingThisOrder"),"confirm_refuse"); $ret=$html->form_confirm("fiche.php?id=$commande->id",$langs->trans("DenyingThisOrder"),$langs->trans("ConfirmDenyingThisOrder"),"confirm_refuse");
print '<br />'; if ($ret == 'html') print '<br>';
} }
/* /*
* Confirmation de l'annulation * Confirmation de l'annulation
*/ */
if ($_GET['action'] == 'cancel') if ($_GET['action'] == 'cancel')
{ {
$html->form_confirm("fiche.php?id=$commande->id",$langs->trans("Cancel"),$langs->trans("ConfirmCancelThisOrder"),"confirm_cancel"); $ret=$html->form_confirm("fiche.php?id=$commande->id",$langs->trans("Cancel"),$langs->trans("ConfirmCancelThisOrder"),"confirm_cancel");
print '<br />'; if ($ret == 'html') print '<br>';
} }
/* /*
@ -561,9 +561,9 @@ if ($id > 0 || ! empty($ref))
if ($_GET["action"] == 'commande') if ($_GET["action"] == 'commande')
{ {
$date_com = dol_mktime(0,0,0,$_POST["remonth"],$_POST["reday"],$_POST["reyear"]); $date_com = dol_mktime(0,0,0,$_POST["remonth"],$_POST["reday"],$_POST["reyear"]);
$html->form_confirm("fiche.php?id=".$commande->id."&amp;datecommande=".$date_com."&amp;methode=".$_POST["methodecommande"]."&amp;comment=".urlencode($_POST["comment"]), $ret=$html->form_confirm("fiche.php?id=".$commande->id."&amp;datecommande=".$date_com."&amp;methode=".$_POST["methodecommande"]."&amp;comment=".urlencode($_POST["comment"]),
$langs->trans("MakeOrder"),$langs->trans("ConfirmMakeOrder",dol_print_date($date_com,'day')),"confirm_commande"); $langs->trans("MakeOrder"),$langs->trans("ConfirmMakeOrder",dol_print_date($date_com,'day')),"confirm_commande");
print '<br />'; if ($ret == 'html') print '<br>';
} }
/* /*
@ -571,8 +571,8 @@ if ($id > 0 || ! empty($ref))
*/ */
if ($_GET['action'] == 'delete_product_line' && ! empty($conf->global->PRODUIT_CONFIRM_DELETE_LINE)) if ($_GET['action'] == 'delete_product_line' && ! empty($conf->global->PRODUIT_CONFIRM_DELETE_LINE))
{ {
$html->form_confirm($_SERVER["PHP_SELF"].'?id='.$commande->id.'&amp;lineid='.$_GET["lineid"], $langs->trans('DeleteProductLine'), $langs->trans('ConfirmDeleteProductLine'), 'confirm_deleteproductline'); $ret=$html->form_confirm($_SERVER["PHP_SELF"].'?id='.$commande->id.'&amp;lineid='.$_GET["lineid"], $langs->trans('DeleteProductLine'), $langs->trans('ConfirmDeleteProductLine'), 'confirm_deleteproductline');
print '<br>'; if ($ret == 'html') print '<br>';
} }
/* /*
@ -939,19 +939,7 @@ if ($id > 0 || ! empty($ref))
{ {
if ($user->rights->fournisseur->commande->valider) if ($user->rights->fournisseur->commande->valider)
{ {
print '<a class="butAction" '; print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$commande->id.'&amp;action=valid"';
if ($conf->use_javascript_ajax && $conf->global->MAIN_CONFIRM_AJAX)
{
// We check if number is temporary number
if (eregi('^\(PROV',$commande->ref)) $num = $commande->getNextNumRef($soc);
else $num = $commande->ref;
$url = $_SERVER["PHP_SELF"].'?id='.$commande->id.'&amp;action=confirm_valid&confirm=yes';
print 'href="#" onClick="dialogConfirm(\''.$url.'\',\''.dol_escape_js($langs->trans('ConfirmValidateOrder',$num)).'\',\''.dol_escape_js($langs->trans("Yes")).'\',\''.dol_escape_js($langs->trans("No")).'\',\'validate\')"';
}
else
{
print 'href="'.$_SERVER["PHP_SELF"].'?id='.$commande->id.'&amp;action=valid"';
}
print '>'.$langs->trans('Validate').'</a>'; print '>'.$langs->trans('Validate').'</a>';
} }
} }

View File

@ -577,8 +577,8 @@ else
// Confirmation de la suppression d'une ligne produit // Confirmation de la suppression d'une ligne produit
if ($_GET['action'] == 'confirm_delete_line') if ($_GET['action'] == 'confirm_delete_line')
{ {
$html->form_confirm($_SERVER["PHP_SELF"].'?facid='.$fac->id.'&amp;ligne_id='.$_GET["ligne_id"], $langs->trans('DeleteProductLine'), $langs->trans('ConfirmDeleteProductLine'), 'confirm_deleteproductline'); $ret=$html->form_confirm($_SERVER["PHP_SELF"].'?facid='.$fac->id.'&amp;ligne_id='.$_GET["ligne_id"], $langs->trans('DeleteProductLine'), $langs->trans('ConfirmDeleteProductLine'), 'confirm_deleteproductline');
print '<br>'; if ($ret == 'html') print '<br>';
} }
// Clone confirmation // Clone confirmation
@ -590,22 +590,22 @@ else
//array('type' => 'checkbox', 'name' => 'clone_content', 'label' => $langs->trans("CloneMainAttributes"), 'value' => 1) //array('type' => 'checkbox', 'name' => 'clone_content', 'label' => $langs->trans("CloneMainAttributes"), 'value' => 1)
); );
// Paiement incomplet. On demande si motif = escompte ou autre // Paiement incomplet. On demande si motif = escompte ou autre
$html->form_confirm($_SERVER["PHP_SELF"].'?facid='.$fac->id,$langs->trans('CloneInvoice'),$langs->trans('ConfirmCloneInvoice',$fac->ref),'confirm_clone',$formquestion,'yes'); $ret=$html->form_confirm($_SERVER["PHP_SELF"].'?facid='.$fac->id,$langs->trans('CloneInvoice'),$langs->trans('ConfirmCloneInvoice',$fac->ref),'confirm_clone',$formquestion,'yes');
print '<br>'; if ($ret == 'html') print '<br>';
} }
// Confirmation de la validation // Confirmation de la validation
if ($_GET['action'] == 'valid') if ($_GET['action'] == 'valid')
{ {
$html->form_confirm('fiche.php?facid='.$fac->id, $langs->trans('ValidateBill'), $langs->trans('ConfirmValidateBill', $fac->ref), 'confirm_valid'); $ret=$html->form_confirm('fiche.php?facid='.$fac->id, $langs->trans('ValidateBill'), $langs->trans('ConfirmValidateBill', $fac->ref), 'confirm_valid');
print '<br />'; if ($ret == 'html') print '<br>';
} }
// Confirmation de la validation // Confirmation de la validation
if ($_GET['action'] == 'payed') if ($_GET['action'] == 'payed')
{ {
$html->form_confirm('fiche.php?facid='.$fac->id, $langs->trans('ClassifyPayed'), $langs->trans('ConfirmClassifyPayedBill', $fac->ref), 'confirm_payed'); $ret=$html->form_confirm('fiche.php?facid='.$fac->id, $langs->trans('ClassifyPayed'), $langs->trans('ConfirmClassifyPayedBill', $fac->ref), 'confirm_payed');
print '<br />'; if ($ret == 'html') print '<br>';
} }
/* /*
@ -613,8 +613,8 @@ else
*/ */
if ($_GET['action'] == 'delete') if ($_GET['action'] == 'delete')
{ {
$html->form_confirm('fiche.php?facid='.$fac->id, $langs->trans('DeleteBill'), $langs->trans('ConfirmDeleteBill'), 'confirm_delete'); $ret=$html->form_confirm('fiche.php?facid='.$fac->id, $langs->trans('DeleteBill'), $langs->trans('ConfirmDeleteBill'), 'confirm_delete');
print '<br />'; if ($ret == 'html') print '<br>';
} }
print '<table width="100%" class="notopnoleftnoright">'; print '<table width="100%" class="notopnoleftnoright">';
@ -1059,17 +1059,7 @@ else
if ($_GET['action'] != 'edit' && $fac->statut == 1 && $fac->paye == 0 && $user->societe_id == 0) if ($_GET['action'] != 'edit' && $fac->statut == 1 && $fac->paye == 0 && $user->societe_id == 0)
{ {
print '<a class="butAction" '; print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?facid='.$fac->id.'&amp;action=payed"';
if ($conf->use_javascript_ajax && $conf->global->MAIN_CONFIRM_AJAX)
{
$num = $fac->ref;
$url = $_SERVER["PHP_SELF"].'?facid='.$fac->id.'&amp;action=confirm_payed&confirm=yes';
print 'href="#" onClick="dialogConfirm(\''.$url.'\',\''.dol_escape_js($langs->trans('ConfirmClassifPayed',$num)).'\',\''.dol_escape_js($langs->trans("Yes")).'\',\''.dol_escape_js($langs->trans("No")).'\',\'validate\')"';
}
else
{
print 'href="'.$_SERVER["PHP_SELF"].'?facid='.$fac->id.'&amp;action=payed"';
}
print '>'.$langs->trans('ClassifyPayed').'</a>'; print '>'.$langs->trans('ClassifyPayed').'</a>';
//print '<a class="butAction" href="fiche.php?facid='.$fac->id.'&amp;action=payed">'.$langs->trans('ClassifyPayed').'</a>'; //print '<a class="butAction" href="fiche.php?facid='.$fac->id.'&amp;action=payed">'.$langs->trans('ClassifyPayed').'</a>';
@ -1079,19 +1069,7 @@ else
{ {
if (sizeof($fac->lignes)) if (sizeof($fac->lignes))
{ {
print '<a class="butAction" '; print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?facid='.$fac->id.'&amp;action=valid"';
if ($conf->use_javascript_ajax && $conf->global->MAIN_CONFIRM_AJAX)
{
// We check if number is temporary number
if (eregi('^\(PROV',$fac->ref)) $num = $fac->getNextNumRef($soc);
else $num = $fac->ref;
$url = $_SERVER["PHP_SELF"].'?facid='.$fac->id.'&amp;action=confirm_valid&confirm=yes';
print 'href="#" onClick="dialogConfirm(\''.$url.'\',\''.dol_escape_js($langs->trans('ConfirmValidateBill',$num)).'\',\''.dol_escape_js($langs->trans("Yes")).'\',\''.dol_escape_js($langs->trans("No")).'\',\'validate\')"';
}
else
{
print 'href="'.$_SERVER["PHP_SELF"].'?facid='.$fac->id.'&amp;action=valid"';
}
print '>'.$langs->trans('Validate').'</a>'; print '>'.$langs->trans('Validate').'</a>';
} }
} }

View File

@ -114,8 +114,8 @@ dol_fiche_head($head, $hselected, $langs->trans('SupplierPayment'));
*/ */
if ($_GET['action'] == 'delete') if ($_GET['action'] == 'delete')
{ {
$html->form_confirm('fiche.php?id='.$paiement->id, $langs->trans("DeletePayment"), $langs->trans("ConfirmDeletePayment"), 'confirm_delete'); $ret=$html->form_confirm('fiche.php?id='.$paiement->id, $langs->trans("DeletePayment"), $langs->trans("ConfirmDeletePayment"), 'confirm_delete');
print '<br>'; if ($ret == 'html') print '<br>';
} }
/* /*
@ -123,8 +123,8 @@ if ($_GET['action'] == 'delete')
*/ */
if ($_GET['action'] == 'valide') if ($_GET['action'] == 'valide')
{ {
$html->form_confirm('fiche.php?id='.$paiement->id, $langs->trans("ValidatePayment"), $langs->trans("ConfirmValidatePayment"), 'confirm_valide'); $ret=$html->form_confirm('fiche.php?id='.$paiement->id, $langs->trans("ValidatePayment"), $langs->trans("ConfirmValidatePayment"), 'confirm_valide');
print '<br>'; if ($ret == 'html') print '<br>';
} }
if (!empty($_POST['action']) && $_POST['action'] == 'update_num' && !empty($_POST['new_num'])) if (!empty($_POST['action']) && $_POST['action'] == 'update_num' && !empty($_POST['new_num']))
@ -278,7 +278,7 @@ if ($resql)
$var=True; $var=True;
$facturestatic=new FactureFournisseur($db); $facturestatic=new FactureFournisseur($db);
while ($i < $num) while ($i < $num)
{ {
$objp = $db->fetch_object($resql); $objp = $db->fetch_object($resql);

View File

@ -1534,104 +1534,120 @@ class Form
/** /**
* \brief Affiche formulaire de demande de confirmation * \brief Show a confirmation HTML form or AJAX popup
* \param page page * \param page page Url of page to call if confirmation is OK
* \param title title * \param title title
* \param question question * \param question question
* \param action action * \param action action
* \param formquestion an array with forms complementary inputs * \param formquestion an array with forms complementary inputs
* \param selectedchoice "" or "no" or "yes" * \param selectedchoice "" or "no" or "yes"
* \param allowajax 0=No, 1=Yes (Yes works only if option activated)
* \param string 'ajax' if a confirm ajax popup is shown, 'html' if it's an html form
*/ */
function form_confirm($page, $title, $question, $action, $formquestion='', $selectedchoice="") function form_confirm($page, $title, $question, $action, $formquestion='', $selectedchoice="", $allowajax=0)
{ {
global $langs; global $langs,$conf;
print "\n<!-- begin form_confirm -->\n"; print "\n<!-- begin form_confirm -->\n";
print '<form method="post" action="'.$page.'" class="notoptoleftroright">';
print '<input type="hidden" name="action" value="'.$action.'">';
print '<table width="100%" class="valid">'; if ($allowajax && $conf->use_javascript_ajax && $conf->global->MAIN_CONFIRM_AJAX)
// Ligne titre
print '<tr class="validtitre"><td class="validtitre" colspan="3">'.img_picto('','recent').' '.$title.'</td></tr>';
// Ligne formulaire
if ($formquestion)
{ {
print '<tr class="valid"><td class="valid" colspan="3">'; $pageyes=$page.'&action='.$action.'&confirm=yes';
print '<table class="notopnoleftnoright" width="100%">'; $pageno=$page.'&confirm=no';
print '<tr><td colspan="3" valign="top">'.$formquestion['text'].'</td></tr>'; print '<script type="text/javascript">dialogConfirm(\''.$pageyes.'\',\''.$pageno.'\',\''.dol_escape_js($question).'\',\''.$langs->trans("Yes").'\',\''.$langs->trans("No").'\',\'validate\')</script>';
foreach ($formquestion as $key => $input) print "\n";
$ret='ajax';
}
else
{
print '<form method="post" action="'.$page.'" class="notoptoleftroright">';
print '<input type="hidden" name="action" value="'.$action.'">';
print '<table width="100%" class="valid">';
// Ligne titre
print '<tr class="validtitre"><td class="validtitre" colspan="3">'.img_picto('','recent').' '.$title.'</td></tr>';
// Ligne formulaire
if ($formquestion)
{ {
if ($input['type'] == 'text') print '<tr class="valid"><td class="valid" colspan="3">';
print '<table class="notopnoleftnoright" width="100%">';
print '<tr><td colspan="3" valign="top">'.$formquestion['text'].'</td></tr>';
foreach ($formquestion as $key => $input)
{ {
print '<tr><td valign="top">'.$input['label'].'</td><td colspan="2"><input type="text" class="flat" name="'.$input['name'].'" size="'.$input['size'].'" value="'.$input['value'].'"></td></tr>'; if ($input['type'] == 'text')
} {
if ($input['type'] == 'select') print '<tr><td valign="top">'.$input['label'].'</td><td colspan="2"><input type="text" class="flat" name="'.$input['name'].'" size="'.$input['size'].'" value="'.$input['value'].'"></td></tr>';
{ }
print '<tr><td valign="top">'; if ($input['type'] == 'select')
print $this->select_array($input['name'],$input['values'],'',1); {
print '</td></tr>'; print '<tr><td valign="top">';
} print $this->select_array($input['name'],$input['values'],'',1);
if ($input['type'] == 'checkbox') print '</td></tr>';
{ }
print '<tr>'; if ($input['type'] == 'checkbox')
print '<td valign="top">'.$input['label'].' &nbsp;';
print '<input type="checkbox" class="flat" name="'.$input['name'].'"';
if ($input['value'] != 'false') print ' checked="true"';
if ($input['disabled']) print ' disabled="true"';
print '></td>';
print '<td valign="top" align="left">&nbsp;</td>';
print '<td valign="top" align="left">&nbsp;</td>';
print '</tr>';
}
if ($input['type'] == 'radio')
{
$i=0;
foreach($input['values'] as $selkey => $selval)
{ {
print '<tr>'; print '<tr>';
if ($i==0) print '<td valign="top">'.$input['label'].'</td>'; print '<td valign="top">'.$input['label'].' &nbsp;';
else print '<td>&nbsp;</td>'; print '<input type="checkbox" class="flat" name="'.$input['name'].'"';
print '<td valign="top" width="20"><input type="radio" class="flat" name="'.$input['name'].'" value="'.$selkey.'"'; if ($input['value'] != 'false') print ' checked="true"';
if ($input['disabled']) print ' disabled="true"'; if ($input['disabled']) print ' disabled="true"';
print '></td>'; print '></td>';
print '<td valign="top" align="left">'; print '<td valign="top" align="left">&nbsp;</td>';
print $selval; print '<td valign="top" align="left">&nbsp;</td>';
print '</td></tr>'; print '</tr>';
$i++; }
if ($input['type'] == 'radio')
{
$i=0;
foreach($input['values'] as $selkey => $selval)
{
print '<tr>';
if ($i==0) print '<td valign="top">'.$input['label'].'</td>';
else print '<td>&nbsp;</td>';
print '<td valign="top" width="20"><input type="radio" class="flat" name="'.$input['name'].'" value="'.$selkey.'"';
if ($input['disabled']) print ' disabled="true"';
print '></td>';
print '<td valign="top" align="left">';
print $selval;
print '</td></tr>';
$i++;
}
} }
} }
print '</table>';
print '</td></tr>';
//print '<tr class="valid"><td class="valid" colspan="3"><hr></td></tr>';
} }
// Ligne message
print '<tr class="valid">';
print '<td class="valid">'.$question.'</td>';
print '<td class="valid">';
$newselectedchoice=empty($selectedchoice)?"no":$selectedchoice;
print $this->selectyesno("confirm",$newselectedchoice);
print '</td>';
print '<td class="valid" align="center"><input class="button" type="submit" value="'.$langs->trans("Validate").'"></td>';
print '</tr>';
print '</table>'; print '</table>';
print '</td></tr>';
//print '<tr class="valid"><td class="valid" colspan="3"><hr></td></tr>'; if (is_array($formquestion))
}
// Ligne message
print '<tr class="valid">';
print '<td class="valid">'.$question.'</td>';
print '<td class="valid">';
$newselectedchoice=empty($selectedchoice)?"no":$selectedchoice;
print $this->selectyesno("confirm",$newselectedchoice);
print '</td>';
print '<td class="valid" align="center"><input class="button" type="submit" value="'.$langs->trans("Validate").'"></td>';
print '</tr>';
print '</table>';
if (is_array($formquestion))
{
foreach ($formquestion as $key => $input)
{ {
if ($input['type'] == 'hidden') print '<input type="hidden" name="'.$input['name'].'" value="'.$input['value'].'">'; foreach ($formquestion as $key => $input)
{
if ($input['type'] == 'hidden') print '<input type="hidden" name="'.$input['name'].'" value="'.$input['value'].'">';
}
} }
print "</form>\n";
$ret='html';
} }
print "</form>\n"; print "<!-- end form_confirm -->\n";
return $ret;
print "\n<!-- end form_confirm -->\n";
} }

View File

@ -677,7 +677,7 @@ function cleanSerialize(expr) {
Author: Regis Houssin Author: Regis Houssin
Licence: GPL Licence: GPL
==================================================================*/ ==================================================================*/
function dialogConfirm(linkurl,message,ok,cancel,objectID) { function dialogConfirm(linkurlyes,linkurlno,message,ok,cancel,objectID) {
Dialog.confirm(message, { Dialog.confirm(message, {
width:560, width:560,
okLabel: ok, okLabel: ok,
@ -685,8 +685,8 @@ function dialogConfirm(linkurl,message,ok,cancel,objectID) {
buttonClass: "buttonajax", buttonClass: "buttonajax",
id: objectID, id: objectID,
destroyOnClose: true, destroyOnClose: true,
cancel:function(win){}, ok:function(win) {window.location.href=linkurlyes; return true;},
ok:function(win) {window.location.href=linkurl; return true;} cancel:function(win) { if (linkurlno!='') { window.location.href=linkurlno; return true; } }
}); });
} }

View File

@ -395,8 +395,8 @@ else
if ($_GET["action"] == 'delete') if ($_GET["action"] == 'delete')
{ {
$expedition_id = $_GET["expid"]; $expedition_id = $_GET["expid"];
$html->form_confirm($_SERVER['PHP_SELF'].'?id='.$livraison->id.'&amp;expid='.$expedition_id,$langs->trans("DeleteDeliveryReceipt"),$langs->trans("DeleteDeliveryReceiptConfirm"),'confirm_delete'); $ret=$html->form_confirm($_SERVER['PHP_SELF'].'?id='.$livraison->id.'&amp;expid='.$expedition_id,$langs->trans("DeleteDeliveryReceipt"),$langs->trans("DeleteDeliveryReceiptConfirm"),'confirm_delete');
print '<br>'; if ($ret == 'html') print '<br>';
} }
/* /*
@ -405,8 +405,8 @@ else
*/ */
if ($_GET["action"] == 'valid') if ($_GET["action"] == 'valid')
{ {
$html->form_confirm($_SERVER['PHP_SELF'].'?id='.$livraison->id,$langs->trans("ValidateDeliveryReceipt"),$langs->trans("ValidateDeliveryReceiptConfirm"),'confirm_valid'); $ret=$html->form_confirm($_SERVER['PHP_SELF'].'?id='.$livraison->id,$langs->trans("ValidateDeliveryReceipt"),$langs->trans("ValidateDeliveryReceiptConfirm"),'confirm_valid');
print '<br>'; if ($ret == 'html') print '<br>';
} }

View File

@ -806,9 +806,8 @@ if ($_GET["id"] || $_GET["ref"])
// Confirmation de la suppression de la facture // Confirmation de la suppression de la facture
if ($_GET["action"] == 'delete') if ($_GET["action"] == 'delete')
{ {
$html = new Form($db); $ret=$html->form_confirm("fiche.php?id=".$product->id,$langs->trans("DeleteProduct"),$langs->trans("ConfirmDeleteProduct"),"confirm_delete");
$html->form_confirm("fiche.php?id=".$product->id,$langs->trans("DeleteProduct"),$langs->trans("ConfirmDeleteProduct"),"confirm_delete"); if ($ret == 'html') print '<br>';
print "<br />\n";
} }
print($mesg); print($mesg);

View File

@ -74,7 +74,7 @@ if ($_REQUEST["action"] == 'confirm_delete' && $_GET["file"] && $_REQUEST['confi
} }
} }
if ($_GET["action"] == 'addthumb' && $_GET["file"]) if ($_GET["action"] == 'addthumb' && $_GET["file"])
{ {
$product = new Product($db); $product = new Product($db);
$product->add_thumb($conf->produit->dir_output."/".$_GET["file"]); $product->add_thumb($conf->produit->dir_output."/".$_GET["file"]);
@ -93,7 +93,7 @@ if ($_GET["id"] || $_GET["ref"])
$product = new Product($db); $product = new Product($db);
if ($_GET["ref"]) $result = $product->fetch('',$_GET["ref"]); if ($_GET["ref"]) $result = $product->fetch('',$_GET["ref"]);
if ($_GET["id"]) $result = $product->fetch($_GET["id"]); if ($_GET["id"]) $result = $product->fetch($_GET["id"]);
llxHeader("","",$langs->trans("CardProduct".$product->type)); llxHeader("","",$langs->trans("CardProduct".$product->type));
if ($result) if ($result)
@ -104,14 +104,14 @@ if ($_GET["id"] || $_GET["ref"])
$head=product_prepare_head($product, $user); $head=product_prepare_head($product, $user);
$titre=$langs->trans("CardProduct".$product->type); $titre=$langs->trans("CardProduct".$product->type);
dol_fiche_head($head, 'photos', $titre); dol_fiche_head($head, 'photos', $titre);
/* /*
* Confirmation de la suppression de photo * Confirmation de la suppression de photo
*/ */
if ($_GET['action'] == 'delete') if ($_GET['action'] == 'delete')
{ {
$html->form_confirm($_SERVER["PHP_SELF"].'?id='.$product->id.'&amp;file='.$_GET["file"], $langs->trans('DeletePicture'), $langs->trans('ConfirmDeletePicture'), 'confirm_delete'); $ret=$html->form_confirm($_SERVER["PHP_SELF"].'?id='.$product->id.'&amp;file='.$_GET["file"], $langs->trans('DeletePicture'), $langs->trans('ConfirmDeletePicture'), 'confirm_delete');
print '<br>'; if ($ret == 'html') print '<br>';
} }
print($mesg); print($mesg);
@ -191,10 +191,10 @@ if ($_GET["id"] || $_GET["ref"])
{ {
$nbphoto=0; $nbphoto=0;
$nbbyrow=5; $nbbyrow=5;
$maxWidth = 160; $maxWidth = 160;
$maxHeight = 120; $maxHeight = 120;
$pdir = get_exdir($product->id,2) . $product->id ."/photos/"; $pdir = get_exdir($product->id,2) . $product->id ."/photos/";
$dir = $conf->produit->dir_output . '/'. $pdir; $dir = $conf->produit->dir_output . '/'. $pdir;
@ -209,7 +209,7 @@ if ($_GET["id"] || $_GET["ref"])
if ($nbbyrow && ($nbphoto % $nbbyrow == 1)) print '<tr align=center valign=middle border=1>'; if ($nbbyrow && ($nbphoto % $nbbyrow == 1)) print '<tr align=center valign=middle border=1>';
if ($nbbyrow) print '<td width="'.ceil(100/$nbbyrow).'%" class="photo">'; if ($nbbyrow) print '<td width="'.ceil(100/$nbbyrow).'%" class="photo">';
print '<a href="'.DOL_URL_ROOT.'/viewimage.php?modulepart=product&file='.urlencode($pdir.$obj['photo']).'" alt="Taille origine" target="_blank">'; print '<a href="'.DOL_URL_ROOT.'/viewimage.php?modulepart=product&file='.urlencode($pdir.$obj['photo']).'" alt="Taille origine" target="_blank">';
// Si fichier vignette disponible, on l'utilise, sinon on utilise photo origine // Si fichier vignette disponible, on l'utilise, sinon on utilise photo origine
@ -221,10 +221,10 @@ if ($_GET["id"] || $_GET["ref"])
{ {
$filename=$obj['photo']; $filename=$obj['photo'];
} }
// Nom affiché // Nom affiché
$viewfilename=$obj['photo']; $viewfilename=$obj['photo'];
// Taille de l'image // Taille de l'image
$product->get_image_size($dir.$filename); $product->get_image_size($dir.$filename);
$imgWidth = ($product->imgWidth < $maxWidth) ? $product->imgWidth : $maxWidth; $imgWidth = ($product->imgWidth < $maxWidth) ? $product->imgWidth : $maxWidth;
@ -243,28 +243,20 @@ if ($_GET["id"] || $_GET["ref"])
} }
if ($user->rights->produit->creer) if ($user->rights->produit->creer)
{ {
if ($conf->use_javascript_ajax && $conf->global->MAIN_CONFIRM_AJAX) print '<a href="'.$_SERVER["PHP_SELF"].'?id='.$_GET["id"].'&amp;action=delete&amp;file='.urlencode($pdir.$viewfilename).'">';
{
$url = $_SERVER["PHP_SELF"].'?id='.$product->id.'&file='.urlencode($pdir.$viewfilename).'&action=confirm_delete&confirm=yes';
print '<a href="#" onClick="dialogConfirm(\''.$url.'\',\''.$langs->trans('ConfirmDeletePicture').'\',\''.$langs->trans("Yes").'\',\''.$langs->trans("No").'\',\'delete\')">';
}
else
{
print '<a href="'.$_SERVER["PHP_SELF"].'?id='.$_GET["id"].'&amp;action=delete&amp;file='.urlencode($pdir.$viewfilename).'">';
}
print img_delete().'</a>'; print img_delete().'</a>';
} }
if ($nbbyrow) print '</td>'; if ($nbbyrow) print '</td>';
if ($nbbyrow && ($nbphoto % $nbbyrow == 0)) print '</tr>'; if ($nbbyrow && ($nbphoto % $nbbyrow == 0)) print '</tr>';
} }
// Ferme tableau // Ferme tableau
while ($nbphoto % $nbbyrow) while ($nbphoto % $nbbyrow)
{ {
print '<td width="'.ceil(100/$nbbyrow).'%">&nbsp;</td>'; print '<td width="'.ceil(100/$nbbyrow).'%">&nbsp;</td>';
$nbphoto++; $nbphoto++;
} }
if ($nbphoto < 1) if ($nbphoto < 1)
{ {
print '<tr align=center valign=middle border=1><td class="photo">'; print '<tr align=center valign=middle border=1><td class="photo">';

View File

@ -200,8 +200,8 @@ else
if ($_GET["action"] == 'delete') if ($_GET["action"] == 'delete')
{ {
$html->form_confirm($_SERVER["PHP_SELF"]."?id=".$_GET["id"],$langs->trans("DeleteAProject"),$langs->trans("ConfirmDeleteAProject"),"confirm_delete"); $ret=$html->form_confirm($_SERVER["PHP_SELF"]."?id=".$_GET["id"],$langs->trans("DeleteAProject"),$langs->trans("ConfirmDeleteAProject"),"confirm_delete");
print "<br>"; if ($ret == 'html') print '<br>';
} }
if ($_GET["action"] == 'edit') if ($_GET["action"] == 'edit')

View File

@ -92,8 +92,8 @@ if ($_GET["id"] > 0)
if ($_GET["action"] == 'delete') if ($_GET["action"] == 'delete')
{ {
$html->form_confirm($_SERVER["PHP_SELF"]."?id=".$_GET["id"],$langs->trans("DeleteATask"),$langs->trans("ConfirmDeleteATask"),"confirm_delete"); $ret=$html->form_confirm($_SERVER["PHP_SELF"]."?id=".$_GET["id"],$langs->trans("DeleteATask"),$langs->trans("ConfirmDeleteATask"),"confirm_delete");
print "<br>"; if ($ret == 'html') print '<br>';
} }
print '<form method="POST" action="fiche.php?id='.$projet->id.'">'; print '<form method="POST" action="fiche.php?id='.$projet->id.'">';
@ -170,7 +170,7 @@ if ($_GET["id"] > 0)
{ {
$var=!$var; $var=!$var;
print "<tr ".$bc[$var].">"; print "<tr ".$bc[$var].">";
// Date // Date
print '<td>'.dol_print_date($db->jdate($task_time->task_date),'day').' '.dol_print_date($db->jdate($task_time->task_date),'%A').'</td>'; print '<td>'.dol_print_date($db->jdate($task_time->task_date),'day').' '.dol_print_date($db->jdate($task_time->task_date),'%A').'</td>';
@ -179,7 +179,7 @@ if ($_GET["id"] > 0)
$minutes = round((($task_time->task_duration - $heure) * 60),0); $minutes = round((($task_time->task_duration - $heure) * 60),0);
$minutes = substr("00"."$minutes", -2); $minutes = substr("00"."$minutes", -2);
print '<td align="right">'.$heure."&nbsp;h&nbsp;".$minutes."</td>\n"; print '<td align="right">'.$heure."&nbsp;h&nbsp;".$minutes."</td>\n";
// User // User
$user->id=$task_time->rowid; $user->id=$task_time->rowid;
$user->nom=$task_time->login; $user->nom=$task_time->login;

View File

@ -959,8 +959,8 @@ else
if ($_GET["action"] == 'delete') if ($_GET["action"] == 'delete')
{ {
$html = new Form($db); $html = new Form($db);
$html->form_confirm("soc.php?socid=".$soc->id,$langs->trans("DeleteACompany"),$langs->trans("ConfirmDeleteCompany"),"confirm_delete"); $ret=$html->form_confirm("soc.php?socid=".$soc->id,$langs->trans("DeleteACompany"),$langs->trans("ConfirmDeleteCompany"),"confirm_delete",'',0,1);
print "<br />\n"; if ($ret == 'html') print '<br>';
} }
if ($mesg) if ($mesg)
@ -1244,17 +1244,7 @@ else
if ($user->rights->societe->supprimer) if ($user->rights->societe->supprimer)
{ {
print '<a class="butActionDelete" '; print '<a class="butActionDelete" href="'.$_SERVER["PHP_SELF"].'?socid='.$soc->id.'&amp;action=delete">'.$langs->trans('Delete').'</a>';
if ($conf->use_javascript_ajax && $conf->global->MAIN_CONFIRM_AJAX)
{
$url = $_SERVER["PHP_SELF"].'?socid='.$soc->id.'&action=confirm_delete&confirm=yes';
print 'href="#" onClick="dialogConfirm(\''.$url.'\',\''.$langs->trans('ConfirmDeleteCompany').'\',\''.$langs->trans("Yes").'\',\''.$langs->trans("No").'\',\'delete\')"';
}
else
{
print 'href="'.$_SERVER["PHP_SELF"].'?socid='.$soc->id.'&amp;action=delete"';
}
print '>'.$langs->trans('Delete').'</a>';
} }
print '</div>'; print '</div>';

View File

@ -23,7 +23,7 @@
* \brief Tab for documents linked to third party * \brief Tab for documents linked to third party
* \ingroup societe * \ingroup societe
* \version $Id$ * \version $Id$
*/ */
require("./pre.inc.php"); require("./pre.inc.php");
require_once(DOL_DOCUMENT_ROOT."/lib/company.lib.php"); require_once(DOL_DOCUMENT_ROOT."/lib/company.lib.php");
@ -73,42 +73,42 @@ $courrier_dir = $conf->societe->dir_output . "/courrier/" . get_exdir($socid) ;
// Envoie fichier // Envoie fichier
if ( $_POST["sendit"] && ! empty($conf->global->MAIN_UPLOAD_DOC)) if ( $_POST["sendit"] && ! empty($conf->global->MAIN_UPLOAD_DOC))
{ {
if (! is_dir($upload_dir)) create_exdir($upload_dir); if (! is_dir($upload_dir)) create_exdir($upload_dir);
if (is_dir($upload_dir)) if (is_dir($upload_dir))
{ {
$result = dol_move_uploaded_file($_FILES['userfile']['tmp_name'], $upload_dir . "/" . $_FILES['userfile']['name'],0); $result = dol_move_uploaded_file($_FILES['userfile']['tmp_name'], $upload_dir . "/" . $_FILES['userfile']['name'],0);
if ($result > 0) if ($result > 0)
{ {
$mesg = '<div class="ok">'.$langs->trans("FileTransferComplete").'</div>'; $mesg = '<div class="ok">'.$langs->trans("FileTransferComplete").'</div>';
//print_r($_FILES); //print_r($_FILES);
} }
else if ($result < 0) else if ($result < 0)
{ {
// Echec transfert (fichier depassant la limite ?) // Echec transfert (fichier depassant la limite ?)
$mesg = '<div class="error">'.$langs->trans("ErrorFileNotUploaded").'</div>'; $mesg = '<div class="error">'.$langs->trans("ErrorFileNotUploaded").'</div>';
// print_r($_FILES); // print_r($_FILES);
} }
else else
{ {
// Fichier infecte par un virus // Fichier infecte par un virus
$mesg = '<div class="error">'.$langs->trans("ErrorFileIsInfectedWith",$result).'</div>'; $mesg = '<div class="error">'.$langs->trans("ErrorFileIsInfectedWith",$result).'</div>';
} }
} }
} }
// Suppression fichier // Suppression fichier
if ($_POST['action'] == 'confirm_deletefile' && $_POST['confirm'] == 'yes') if ($_POST['action'] == 'confirm_deletefile' && $_POST['confirm'] == 'yes')
{ {
$file = $upload_dir . "/" . urldecode($_GET["urlfile"]); $file = $upload_dir . "/" . urldecode($_GET["urlfile"]);
dol_delete_file($file); dol_delete_file($file);
$mesg = '<div class="ok">'.$langs->trans("FileWasRemoved").'</div>'; $mesg = '<div class="ok">'.$langs->trans("FileWasRemoved").'</div>';
} }
/* /*
* View * View
*/ */
llxHeader(); llxHeader();
@ -118,8 +118,8 @@ if ($socid > 0)
if ($societe->fetch($socid)) if ($societe->fetch($socid))
{ {
/* /*
* Affichage onglets * Affichage onglets
*/ */
$head = societe_prepare_head($societe); $head = societe_prepare_head($societe);
$html=new Form($db); $html=new Form($db);
@ -156,18 +156,18 @@ if ($socid > 0)
if ($mesg) { print "$mesg<br>"; } if ($mesg) { print "$mesg<br>"; }
/* /*
* Confirmation de la suppression d'une ligne produit * Confirmation de la suppression d'une ligne produit
*/ */
if ($_GET['action'] == 'delete') if ($_GET['action'] == 'delete')
{ {
$html->form_confirm($_SERVER["PHP_SELF"].'?socid='.$_GET["id"].'&amp;urlfile='.urldecode($_GET["urlfile"]), $langs->trans('DeleteFile'), $langs->trans('ConfirmDeleteFile'), 'confirm_deletefile'); $ret=$html->form_confirm($_SERVER["PHP_SELF"].'?socid='.$_GET["id"].'&amp;urlfile='.urldecode($_GET["urlfile"]), $langs->trans('DeleteFile'), $langs->trans('ConfirmDeleteFile'), 'confirm_deletefile');
print '<br>'; if ($ret == 'html') print '<br>';
} }
// Affiche formulaire upload // Affiche formulaire upload
$formfile=new FormFile($db); $formfile=new FormFile($db);
$formfile->form_attach_new_file(DOL_URL_ROOT.'/societe/document.php?socid='.$socid,'',0,0,$user->rights->societe->creer); $formfile->form_attach_new_file(DOL_URL_ROOT.'/societe/document.php?socid='.$socid,'',0,0,$user->rights->societe->creer);

View File

@ -764,8 +764,8 @@ else
*/ */
if ($action == 'password') if ($action == 'password')
{ {
$html->form_confirm("fiche.php?id=$fuser->id",$langs->trans("ReinitPassword"),$langs->trans("ConfirmReinitPassword",$fuser->login),"confirm_password"); $ret=$html->form_confirm("fiche.php?id=$fuser->id",$langs->trans("ReinitPassword"),$langs->trans("ConfirmReinitPassword",$fuser->login),"confirm_password");
print '<br>'; if ($ret == 'html') print '<br>';
} }
/* /*
@ -773,8 +773,8 @@ else
*/ */
if ($action == 'passwordsend') if ($action == 'passwordsend')
{ {
$html->form_confirm("fiche.php?id=$fuser->id",$langs->trans("SendNewPassword"),$langs->trans("ConfirmSendNewPassword",$fuser->login),"confirm_passwordsend"); $ret=$html->form_confirm("fiche.php?id=$fuser->id",$langs->trans("SendNewPassword"),$langs->trans("ConfirmSendNewPassword",$fuser->login),"confirm_passwordsend");
print '<br>'; if ($ret == 'html') print '<br>';
} }
/* /*
@ -782,8 +782,8 @@ else
*/ */
if ($action == 'disable') if ($action == 'disable')
{ {
$html->form_confirm("fiche.php?id=$fuser->id",$langs->trans("DisableAUser"),$langs->trans("ConfirmDisableUser",$fuser->login),"confirm_disable"); $ret=$html->form_confirm("fiche.php?id=$fuser->id",$langs->trans("DisableAUser"),$langs->trans("ConfirmDisableUser",$fuser->login),"confirm_disable");
print '<br>'; if ($ret == 'html') print '<br>';
} }
/* /*
@ -791,8 +791,8 @@ else
*/ */
if ($action == 'enable') if ($action == 'enable')
{ {
$html->form_confirm("fiche.php?id=$fuser->id",$langs->trans("EnableAUser"),$langs->trans("ConfirmEnableUser",$fuser->login),"confirm_enable"); $ret=$html->form_confirm("fiche.php?id=$fuser->id",$langs->trans("EnableAUser"),$langs->trans("ConfirmEnableUser",$fuser->login),"confirm_enable");
print '<br>'; if ($ret == 'html') print '<br>';
} }
/* /*
@ -800,8 +800,8 @@ else
*/ */
if ($action == 'delete') if ($action == 'delete')
{ {
$html->form_confirm("fiche.php?id=$fuser->id",$langs->trans("DeleteAUser"),$langs->trans("ConfirmDeleteUser",$fuser->login),"confirm_delete"); $ret=$html->form_confirm("fiche.php?id=$fuser->id",$langs->trans("DeleteAUser"),$langs->trans("ConfirmDeleteUser",$fuser->login),"confirm_delete");
print '<br>'; if ($ret == 'html') print '<br>';
} }

View File

@ -221,17 +221,15 @@ else
$title = $langs->trans("Group"); $title = $langs->trans("Group");
dol_fiche_head($head, 'group', $title); dol_fiche_head($head, 'group', $title);
/* /*
* Confirmation suppression * Confirmation suppression
*/ */
if ($action == 'delete') if ($action == 'delete')
{ {
$html = new Form($db); $ret=$html->form_confirm("fiche.php?id=$group->id",$langs->trans("DeleteAGroup"),$langs->trans("ConfirmDeleteGroup",$group->name),"confirm_delete");
$html->form_confirm("fiche.php?id=$group->id",$langs->trans("DeleteAGroup"),$langs->trans("ConfirmDeleteGroup",$group->name),"confirm_delete"); if ($ret == 'html') print '<br>';
} }
/* /*
* Fiche en mode visu * Fiche en mode visu
*/ */