Merge branch 'develop' of git@github.com:Dolibarr/dolibarr.git into develop

This commit is contained in:
Laurent Destailleur 2013-09-07 19:51:00 +02:00
commit 74a50d8d6c
88 changed files with 368 additions and 426 deletions

View File

@ -102,6 +102,8 @@ if ($action == 'unset')
* View * View
*/ */
$form = new Form($db);
$help_url='EN:Module_Foundations|FR:Module_Adhérents|ES:Módulo_Miembros'; $help_url='EN:Module_Foundations|FR:Module_Adhérents|ES:Módulo_Miembros';
llxHeader('',$langs->trans("MembersSetup"),$help_url); llxHeader('',$langs->trans("MembersSetup"),$help_url);
@ -127,7 +129,6 @@ print '<td>'.$langs->trans("Value").'</td>';
print '<td align="center">'.$langs->trans("Action").'</td>'; print '<td align="center">'.$langs->trans("Action").'</td>';
print "</tr>\n"; print "</tr>\n";
$var=true; $var=true;
$form = new Form($db);
// Login/Pass required for members // Login/Pass required for members
$var=!$var; $var=!$var;

View File

@ -823,8 +823,7 @@ if ($rowid)
// Create a form array // Create a form array
$formquestion=array(array('label' => $langs->trans("NameToCreate"), 'type' => 'text', 'name' => 'companyname', 'value' => $name)); $formquestion=array(array('label' => $langs->trans("NameToCreate"), 'type' => 'text', 'name' => 'companyname', 'value' => $name));
$ret=$form->form_confirm($_SERVER["PHP_SELF"]."?rowid=".$object->id,$langs->trans("CreateDolibarrThirdParty"),$langs->trans("ConfirmCreateThirdParty"),"confirm_create_thirdparty",$formquestion,1); print $form->formconfirm($_SERVER["PHP_SELF"]."?rowid=".$object->id,$langs->trans("CreateDolibarrThirdParty"),$langs->trans("ConfirmCreateThirdParty"),"confirm_create_thirdparty",$formquestion,1);
if ($ret == 'html') print '<br>';
} }

View File

@ -171,7 +171,6 @@ if ($result)
{ {
print '<input type="hidden" name="action" value="2bank">'; print '<input type="hidden" name="action" value="2bank">';
print '<input type="hidden" name="rowid" value="'.$objp->crowid.'">'; print '<input type="hidden" name="rowid" value="'.$objp->crowid.'">';
$form = new Form($db);
$form->select_comptes('','accountid',0,'',1); $form->select_comptes('','accountid',0,'',1);
print '<br>'; print '<br>';
$form->select_types_paiements('','paymenttypeid'); $form->select_types_paiements('','paymenttypeid');

View File

@ -185,8 +185,7 @@ if ($id > 0)
*/ */
if ($action == 'delete') if ($action == 'delete')
{ {
$ret=$form->form_confirm($_SERVER["PHP_SELF"].'?id='.$object->id.'&urlfile='.urlencode(GETPOST("urlfile")), $langs->trans('DeleteFile'), $langs->trans('ConfirmDeleteFile'), 'confirm_deletefile', '', 0, 1); print $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id.'&urlfile='.urlencode(GETPOST("urlfile")), $langs->trans('DeleteFile'), $langs->trans('ConfirmDeleteFile'), 'confirm_deletefile', '', 0, 1);
if ($ret == 'html') print '<br>';
} }

View File

@ -653,7 +653,7 @@ if ($user->rights->adherent->creer && $action == 'confirm_add_spip' && $confirm
/* /*
* View * View
*/ */
$form = new Form($db); $form = new Form($db);
$formcompany = new FormCompany($db); $formcompany = new FormCompany($db);
@ -1192,8 +1192,7 @@ else
if ($object->fk_soc > 0) $text.=$langs->trans("UserWillBeExternalUser"); if ($object->fk_soc > 0) $text.=$langs->trans("UserWillBeExternalUser");
else $text.=$langs->trans("UserWillBeInternalUser"); else $text.=$langs->trans("UserWillBeInternalUser");
} }
$ret=$form->form_confirm($_SERVER["PHP_SELF"]."?rowid=".$object->id,$langs->trans("CreateDolibarrLogin"),$text,"confirm_create_user",$formquestion,'yes'); print $form->formconfirm($_SERVER["PHP_SELF"]."?rowid=".$object->id,$langs->trans("CreateDolibarrLogin"),$text,"confirm_create_user",$formquestion,'yes');
if ($ret == 'html') print '<br>';
} }
// Confirm create third party // Confirm create third party
@ -1212,8 +1211,7 @@ else
// Create a form array // Create a form array
$formquestion=array( array('label' => $langs->trans("NameToCreate"), 'type' => 'text', 'name' => 'companyname', 'value' => $name)); $formquestion=array( array('label' => $langs->trans("NameToCreate"), 'type' => 'text', 'name' => 'companyname', 'value' => $name));
$ret=$form->form_confirm($_SERVER["PHP_SELF"]."?rowid=".$object->id,$langs->trans("CreateDolibarrThirdParty"),$langs->trans("ConfirmCreateThirdParty"),"confirm_create_thirdparty",$formquestion,1); print $form->formconfirm($_SERVER["PHP_SELF"]."?rowid=".$object->id,$langs->trans("CreateDolibarrThirdParty"),$langs->trans("ConfirmCreateThirdParty"),"confirm_create_thirdparty",$formquestion,1);
if ($ret == 'html') print '<br>';
} }
// Confirm validate member // Confirm validate member
@ -1286,8 +1284,7 @@ else
$formquestion=array(); $formquestion=array();
if ($object->email) $formquestion[]=array('type' => 'checkbox', 'name' => 'send_mail', 'label' => $label, 'value' => (! empty($conf->global->ADHERENT_DEFAULT_SENDINFOBYMAIL)?'true':'false')); if ($object->email) $formquestion[]=array('type' => 'checkbox', 'name' => 'send_mail', 'label' => $label, 'value' => (! empty($conf->global->ADHERENT_DEFAULT_SENDINFOBYMAIL)?'true':'false'));
if ($backtopage) $formquestion[]=array('type' => 'hidden', 'name' => 'backtopage', 'value' => ($backtopage != '1' ? $backtopage : $_SERVER["HTTP_REFERER"])); if ($backtopage) $formquestion[]=array('type' => 'hidden', 'name' => 'backtopage', 'value' => ($backtopage != '1' ? $backtopage : $_SERVER["HTTP_REFERER"]));
$ret=$form->form_confirm("fiche.php?rowid=".$rowid,$langs->trans("ResiliateMember"),$langs->trans("ConfirmResiliateMember"),"confirm_resign",$formquestion); print $form->formconfirm("fiche.php?rowid=".$rowid,$langs->trans("ResiliateMember"),$langs->trans("ConfirmResiliateMember"),"confirm_resign",$formquestion);
if ($ret == 'html') print '<br>';
} }
// Confirm remove member // Confirm remove member
@ -1295,8 +1292,7 @@ else
{ {
$formquestion=array(); $formquestion=array();
if ($backtopage) $formquestion[]=array('type' => 'hidden', 'name' => 'backtopage', 'value' => ($backtopage != '1' ? $backtopage : $_SERVER["HTTP_REFERER"])); if ($backtopage) $formquestion[]=array('type' => 'hidden', 'name' => 'backtopage', 'value' => ($backtopage != '1' ? $backtopage : $_SERVER["HTTP_REFERER"]));
$ret=$form->form_confirm("fiche.php?rowid=".$rowid,$langs->trans("DeleteMember"),$langs->trans("ConfirmDeleteMember"),"confirm_delete",$formquestion,0,1); print $form->formconfirm("fiche.php?rowid=".$rowid,$langs->trans("DeleteMember"),$langs->trans("ConfirmDeleteMember"),"confirm_delete",$formquestion,0,1);
if ($ret == 'html') print '<br>';
} }
/* /*
@ -1304,8 +1300,7 @@ else
*/ */
if ($action == 'add_spip') if ($action == 'add_spip')
{ {
$ret=$form->form_confirm("fiche.php?rowid=".$rowid, $langs->trans('AddIntoSpip'), $langs->trans('AddIntoSpipConfirmation'), 'confirm_add_spip'); print $form->formconfirm("fiche.php?rowid=".$rowid, $langs->trans('AddIntoSpip'), $langs->trans('AddIntoSpipConfirmation'), 'confirm_add_spip');
if ($ret == 'html') print '<br>';
} }
/* /*
@ -1313,8 +1308,7 @@ else
*/ */
if ($action == 'del_spip') if ($action == 'del_spip')
{ {
$ret=$form->form_confirm("fiche.php?rowid=$rowid", $langs->trans('DeleteIntoSpip'), $langs->trans('DeleteIntoSpipConfirmation'), 'confirm_del_spip'); print $form->formconfirm("fiche.php?rowid=$rowid", $langs->trans('DeleteIntoSpip'), $langs->trans('DeleteIntoSpipConfirmation'), 'confirm_del_spip');
if ($ret == 'html') print '<br>';
} }
$rowspan=17; $rowspan=17;

View File

@ -291,8 +291,7 @@ 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 (! empty($conf->banque->enabled) && ! empty($conf->global->ADHERENT_BANK_USE)) $text.='<br>'.img_warning().' '.$langs->trans("ThisWillAlsoDeleteBankRecord"); if (! empty($conf->banque->enabled) && ! empty($conf->global->ADHERENT_BANK_USE)) $text.='<br>'.img_warning().' '.$langs->trans("ThisWillAlsoDeleteBankRecord");
$ret=$form->form_confirm($_SERVER["PHP_SELF"]."?rowid=".$subscription->id,$langs->trans("DeleteSubscription"),$text,"confirm_delete",$formquestion,0,1); print $form->formconfirm($_SERVER["PHP_SELF"]."?rowid=".$subscription->id,$langs->trans("DeleteSubscription"),$text,"confirm_delete",$formquestion,0,1);
if ($ret == 'html') print '<br>';
} }
print '<form action="'.$_SERVER["PHP_SELF"].'" method="post">'; print '<form action="'.$_SERVER["PHP_SELF"].'" method="post">';

View File

@ -233,7 +233,6 @@ if (! $rowid && $action != 'create' && $action != 'edit')
/* ************************************************************************** */ /* ************************************************************************** */
if ($action == 'create') if ($action == 'create')
{ {
$form = new Form($db);
$adht = new AdherentType($db); $adht = new AdherentType($db);
print_fiche_titre($langs->trans("NewMemberType")); print_fiche_titre($langs->trans("NewMemberType"));
@ -620,8 +619,6 @@ if ($rowid > 0)
if ($action == 'edit') if ($action == 'edit')
{ {
$form = new Form($db);
$adht = new AdherentType($db); $adht = new AdherentType($db);
$adht->id = $rowid; $adht->id = $rowid;
$adht->fetch($rowid); $adht->fetch($rowid);

View File

@ -143,6 +143,8 @@ if ($action == 'delete')
* View * View
*/ */
$form = new Form($db);
llxHeader('',$langs->trans("OtherSetup")); llxHeader('',$langs->trans("OtherSetup"));
// Add logic to show/hide buttons // Add logic to show/hide buttons
@ -184,9 +186,6 @@ print '<td align="center">'.$langs->trans("Action").'</td>';
print "</tr>\n"; print "</tr>\n";
$form = new Form($db);
// Line to add new record // Line to add new record
$var=false; $var=false;
print "\n"; print "\n";

View File

@ -123,6 +123,8 @@ if ($action == 'update')
* View * View
*/ */
$form = new Form($db);
llxHeader(); llxHeader();
print_fiche_titre($langs->trans("DelaysOfToleranceBeforeWarning"),'','setup'); print_fiche_titre($langs->trans("DelaysOfToleranceBeforeWarning"),'','setup');
@ -131,7 +133,6 @@ print $langs->transnoentities("DelaysOfToleranceDesc",img_warning());
print " ".$langs->trans("OnlyActiveElementsAreShown",DOL_URL_ROOT.'/admin/modules.php')."<br>\n"; print " ".$langs->trans("OnlyActiveElementsAreShown",DOL_URL_ROOT.'/admin/modules.php')."<br>\n";
print "<br>\n"; print "<br>\n";
$form = new Form($db);
$countrynotdefined='<font class="error">'.$langs->trans("ErrorSetACountryFirst").' ('.$langs->trans("SeeAbove").')</font>'; $countrynotdefined='<font class="error">'.$langs->trans("ErrorSetACountryFirst").' ('.$langs->trans("SeeAbove").')</font>';
if ($action == 'edit') if ($action == 'edit')

View File

@ -676,8 +676,7 @@ print "<br>\n";
// Confirmation de la suppression de la ligne // Confirmation de la suppression de la ligne
if ($action == 'delete') if ($action == 'delete')
{ {
$ret=$form->form_confirm($_SERVER["PHP_SELF"].'?'.($page?'page='.$page.'&':'').'sortfield='.$sortfield.'&sortorder='.$sortorder.'&rowid='.$rowid.'&code='.$_GET["code"].'&id='.$id, $langs->trans('DeleteLine'), $langs->trans('ConfirmDeleteLine'), 'confirm_delete','',0,1); print $form->formconfirm($_SERVER["PHP_SELF"].'?'.($page?'page='.$page.'&':'').'sortfield='.$sortfield.'&sortorder='.$sortorder.'&rowid='.$rowid.'&code='.$_GET["code"].'&id='.$id, $langs->trans('DeleteLine'), $langs->trans('ConfirmDeleteLine'), 'confirm_delete','',0,1);
if ($ret == 'html') print '<br>';
} }
/* /*

View File

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

View File

@ -66,6 +66,8 @@ if ($action == 'reset' && $user->admin)
* View * View
*/ */
$form = new Form($db);
$_SESSION["mode"]=$mode; $_SESSION["mode"]=$mode;
$help_url='EN:First_setup|FR:Premiers_paramétrages|ES:Primeras_configuraciones'; $help_url='EN:First_setup|FR:Premiers_paramétrages|ES:Primeras_configuraciones';
@ -252,7 +254,6 @@ if (! empty($categ[$categidx]))
$categidx='expdev'; $categidx='expdev';
if (! empty($categ[$categidx])) if (! empty($categ[$categidx]))
{ {
$form = new Form($db);
$categidx='expdev'; $categidx='expdev';
$head[$h][0] = DOL_URL_ROOT."/admin/modules.php?mode=".$categidx; $head[$h][0] = DOL_URL_ROOT."/admin/modules.php?mode=".$categidx;
$head[$h][1] = $form->textwithpicto($langs->trans("ModuleFamilyExperimental"), $langs->trans('DoNotUseInProduction'), 1, 'warning', '', 0, 3); $head[$h][1] = $form->textwithpicto($langs->trans("ModuleFamilyExperimental"), $langs->trans('DoNotUseInProduction'), 1, 'warning', '', 0, 3);

View File

@ -35,13 +35,13 @@ if (! $user->admin)
* View * View
*/ */
$form = new Form($db);
$title=$langs->trans("SystemToolsArea"); $title=$langs->trans("SystemToolsArea");
if (GETPOST('leftmenu') == 'modulesadmintools') $title=$langs->trans("ModulesSystemTools"); if (GETPOST('leftmenu') == 'modulesadmintools') $title=$langs->trans("ModulesSystemTools");
llxHeader(array(),$title); llxHeader(array(),$title);
$form = new Form($db);
print_fiche_titre($title,'','setup'); print_fiche_titre($title,'','setup');
print $langs->trans("SystemToolsAreaDesc").'<br>'; print $langs->trans("SystemToolsAreaDesc").'<br>';

View File

@ -150,8 +150,7 @@ if ($result)
if ($action == 'purge') if ($action == 'purge')
{ {
$formquestion=array(); $formquestion=array();
$ret=$form->form_confirm($_SERVER["PHP_SELF"].'?noparam=noparam', $langs->trans('PurgeAuditEvents'), $langs->trans('ConfirmPurgeAuditEvents'),'confirm_purge',$formquestion,'no',1); print $form->formconfirm($_SERVER["PHP_SELF"].'?noparam=noparam', $langs->trans('PurgeAuditEvents'), $langs->trans('ConfirmPurgeAuditEvents'),'confirm_purge',$formquestion,'no',1);
if ($ret == 'html') print '<br>';
} }
print '<table class="liste" width="100%">'; print '<table class="liste" width="100%">';

View File

@ -116,14 +116,12 @@ print '<br>';
if ($action == 'purge') if ($action == 'purge')
{ {
$formquestion=array(); $formquestion=array();
$ret=$form->form_confirm($_SERVER["PHP_SELF"].'?noparam=noparam', $langs->trans('PurgeSessions'), $langs->trans('ConfirmPurgeSessions'),'confirm_purge',$formquestion,'no',2); print $form->formconfirm($_SERVER["PHP_SELF"].'?noparam=noparam', $langs->trans('PurgeSessions'), $langs->trans('ConfirmPurgeSessions'),'confirm_purge',$formquestion,'no',2);
if ($ret == 'html') print '<br>';
} }
else if ($action == 'lock') else if ($action == 'lock')
{ {
$formquestion=array(); $formquestion=array();
$ret=$form->form_confirm($_SERVER["PHP_SELF"].'?noparam=noparam', $langs->trans('LockNewSessions'), $langs->trans('ConfirmLockNewSessions',$user->login),'confirm_lock',$formquestion,'no',1); print $form->formconfirm($_SERVER["PHP_SELF"].'?noparam=noparam', $langs->trans('LockNewSessions'), $langs->trans('ConfirmLockNewSessions',$user->login),'confirm_lock',$formquestion,'no',1);
if ($ret == 'html') print '<br>';
} }
if ($savehandler == 'files') if ($savehandler == 'files')

View File

@ -193,9 +193,10 @@ if (($action == 'add' || $action == 'confirmed') && $user->rights->categorie->cr
* View * View
*/ */
llxHeader("","",$langs->trans("Categories"));
$form = new Form($db); $form = new Form($db);
llxHeader("","",$langs->trans("Categories"));
if ($user->rights->categorie->creer) if ($user->rights->categorie->creer)
{ {
/* /*

View File

@ -104,8 +104,7 @@ if ($object->id)
*/ */
if ($action == 'delete') if ($action == 'delete')
{ {
$ret=$form->form_confirm($_SERVER["PHP_SELF"].'?id='.$object->id.'&type='.$type.'&file='.$_GET["file"], $langs->trans('DeletePicture'), $langs->trans('ConfirmDeletePicture'), 'confirm_delete', '', 0, 1); print $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id.'&type='.$type.'&file='.$_GET["file"], $langs->trans('DeletePicture'), $langs->trans('ConfirmDeletePicture'), 'confirm_delete', '', 0, 1);
if ($ret == 'html') print '<br>';
} }
print($mesg); print($mesg);

View File

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

View File

@ -685,8 +685,7 @@ if ($id > 0)
// Confirmation suppression action // Confirmation suppression action
if ($action == 'delete') if ($action == 'delete')
{ {
$ret=$form->form_confirm("fiche.php?id=".$id,$langs->trans("DeleteAction"),$langs->trans("ConfirmDeleteAction"),"confirm_delete",'','',1); print $form->formconfirm("fiche.php?id=".$id,$langs->trans("DeleteAction"),$langs->trans("ConfirmDeleteAction"),"confirm_delete",'','',1);
if ($ret == 'html') print '<br>';
} }
if ($action == 'edit') if ($action == 'edit')

View File

@ -416,9 +416,7 @@ else
// Confirmation delete // Confirmation delete
if ($action == 'delete') if ($action == 'delete')
{ {
$form = new Form($db); print $form->formconfirm($_SERVER['PHP_SELF']."?socid=".$object->socid."&amp;id=".$id,$langs->trans("DeleteAddress"),$langs->trans("ConfirmDeleteAddress"),"confirm_delete");
$ret=$form->form_confirm($_SERVER['PHP_SELF']."?socid=".$object->socid."&amp;id=".$id,$langs->trans("DeleteAddress"),$langs->trans("ConfirmDeleteAddress"),"confirm_delete");
if ($ret == 'html') print '<br>';
} }
$nblines = count($object->lines); $nblines = count($object->lines);

View File

@ -299,7 +299,6 @@ if ($id > 0)
// Conditions de reglement par defaut // Conditions de reglement par defaut
$langs->load('bills'); $langs->load('bills');
$form = new Form($db);
print '<tr><td>'; print '<tr><td>';
print '<table width="100%" class="nobordernopadding"><tr><td>'; print '<table width="100%" class="nobordernopadding"><tr><td>';
print $langs->trans('PaymentConditions'); print $langs->trans('PaymentConditions');

View File

@ -700,20 +700,17 @@ else
// Confirmation de la validation du mailing // Confirmation de la validation du mailing
if ($action == 'valid') if ($action == 'valid')
{ {
$ret=$form->form_confirm($_SERVER["PHP_SELF"]."?id=".$object->id,$langs->trans("ValidMailing"),$langs->trans("ConfirmValidMailing"),"confirm_valid",'','',1); print $form->formconfirm($_SERVER["PHP_SELF"]."?id=".$object->id,$langs->trans("ValidMailing"),$langs->trans("ConfirmValidMailing"),"confirm_valid",'','',1);
if ($ret == 'html') print '<br>';
} }
// Confirm reset // Confirm reset
else if ($action == 'reset') else if ($action == 'reset')
{ {
$ret=$form->form_confirm($_SERVER["PHP_SELF"]."?id=".$object->id,$langs->trans("ResetMailing"),$langs->trans("ConfirmResetMailing",$object->ref),"confirm_reset",'','',2); print $form->formconfirm($_SERVER["PHP_SELF"]."?id=".$object->id,$langs->trans("ResetMailing"),$langs->trans("ConfirmResetMailing",$object->ref),"confirm_reset",'','',2);
if ($ret == 'html') print '<br>';
} }
// Confirm delete // Confirm delete
else if ($action == 'delete') else if ($action == 'delete')
{ {
$ret=$form->form_confirm($_SERVER["PHP_SELF"]."?id=".$object->id.(! empty($urlfrom) ? '&urlfrom='.urlencode($urlfrom) : ''),$langs->trans("DeleteAMailing"),$langs->trans("ConfirmDeleteMailing"),"confirm_delete",'','',1); print $form->formconfirm($_SERVER["PHP_SELF"]."?id=".$object->id.(! empty($urlfrom) ? '&urlfrom='.urlencode($urlfrom) : ''),$langs->trans("DeleteAMailing"),$langs->trans("ConfirmDeleteMailing"),"confirm_delete",'','',1);
if ($ret == 'html') print '<br>';
} }
@ -749,8 +746,7 @@ else
} }
$text.=$langs->trans('ConfirmSendingEmailing').'<br>'; $text.=$langs->trans('ConfirmSendingEmailing').'<br>';
$text.=$langs->trans('LimitSendingEmailing',$conf->global->MAILING_LIMIT_SENDBYWEB); $text.=$langs->trans('LimitSendingEmailing',$conf->global->MAILING_LIMIT_SENDBYWEB);
$ret=$form->form_confirm($_SERVER['PHP_SELF'].'?id='.$object->id,$langs->trans('SendMailing'),$text,'sendallconfirmed',$formquestion,'',1,260); print $form->formconfirm($_SERVER['PHP_SELF'].'?id='.$object->id,$langs->trans('SendMailing'),$text,'sendallconfirmed',$formquestion,'',1,260);
if ($ret == 'html') print '<br>';
} }
} }

View File

@ -158,8 +158,7 @@ if ($object->id > 0)
*/ */
if ($action == 'delete') if ($action == 'delete')
{ {
$ret=$form->form_confirm($_SERVER["PHP_SELF"].'?id='.$object->id.'&urlfile='.urlencode(GETPOST("urlfile")), $langs->trans('DeleteFile'), $langs->trans('ConfirmDeleteFile'), 'confirm_deletefile', '', 0, 1); print $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id.'&urlfile='.urlencode(GETPOST("urlfile")), $langs->trans('DeleteFile'), $langs->trans('ConfirmDeleteFile'), 'confirm_deletefile', '', 0, 1);
if ($ret == 'html') print '<br>';
} }
// Affiche formulaire upload // Affiche formulaire upload

View File

@ -297,7 +297,7 @@ if ($socid > 0)
if ($_GET['action'] == 'remove') if ($_GET['action'] == 'remove')
{ {
$ret=$form->form_confirm($_SERVER["PHP_SELF"].'?id='.$objsoc->id.'&remid='.$_GET["remid"], $langs->trans('RemoveDiscount'), $langs->trans('ConfirmRemoveDiscount'), 'confirm_remove', '', 0, 1); print $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$objsoc->id.'&remid='.$_GET["remid"], $langs->trans('RemoveDiscount'), $langs->trans('ConfirmRemoveDiscount'), 'confirm_remove', '', 0, 1);
} }
/* /*
@ -394,7 +394,7 @@ if ($socid > 0)
array('type' => 'text', 'name' => 'amount_ttc_2', 'label' => $langs->trans("AmountTTC").' 2', 'value' => $amount2, 'size' => '5') array('type' => 'text', 'name' => 'amount_ttc_2', 'label' => $langs->trans("AmountTTC").' 2', 'value' => $amount2, 'size' => '5')
); );
$langs->load("dict"); $langs->load("dict");
$ret=$form->form_confirm($_SERVER["PHP_SELF"].'?id='.$objsoc->id.'&remid='.$obj->rowid, $langs->trans('SplitDiscount'), $langs->trans('ConfirmSplitDiscount',price($obj->amount_ttc),$langs->transnoentities("Currency".$conf->currency)), 'confirm_split', $formquestion, 0, 0); print $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$objsoc->id.'&remid='.$obj->rowid, $langs->trans('SplitDiscount'), $langs->trans('ConfirmSplitDiscount',price($obj->amount_ttc),$langs->transnoentities("Currency".$conf->currency)), 'confirm_split', $formquestion, 0, 0);
print '</td>'; print '</td>';
print '</tr>'; print '</tr>';
} }

View File

@ -145,8 +145,8 @@ if ($id > 0 || ! empty($ref))
*/ */
if ($action == 'delete') if ($action == 'delete')
{ {
$ret=$form->form_confirm($_SERVER["PHP_SELF"].'?id='.$object->id.'&urlfile='.urlencode($_GET["urlfile"]), $langs->trans('DeleteFile'), $langs->trans('ConfirmDeleteFile'), 'confirm_deletefile', '', 0, 1); print $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id.'&urlfile='.urlencode($_GET["urlfile"]), $langs->trans('DeleteFile'), $langs->trans('ConfirmDeleteFile'), 'confirm_deletefile', '', 0, 1);
if ($ret == 'html') print '<br>';
} }
// Affiche formulaire upload // Affiche formulaire upload

View File

@ -1123,14 +1123,11 @@ else if ($action == 'builddoc') // In get or post
{ {
/* /*
* Generate order document * Generate order document
* define into /core/modules/commande/modules_commande.php * define into /core/modules/commande/modules_commande.php
*/ */
// Sauvegarde le dernier modele choisi pour generer un document // Save last template used to generate document
if ($_REQUEST['model']) if (GETPOST('model')) $object->setDocModel($user, GETPOST('model','alpha'));
{
$object->setDocModel($user, $_REQUEST['model']);
}
// Define output language // Define output language
$outputlangs = $langs; $outputlangs = $langs;
@ -1149,11 +1146,6 @@ else if ($action == 'builddoc') // In get or post
dol_print_error($db,$result); dol_print_error($db,$result);
exit; exit;
} }
else
{
header('Location: '.$_SERVER["PHP_SELF"].'?id='.$object->id.(empty($conf->global->MAIN_JUMP_TAG)?'':'#builddoc'));
exit;
}
} }
// Remove file in doc form // Remove file in doc form

View File

@ -300,8 +300,8 @@ if ($id > 0 || ! empty($ref))
if ($action == 'delete') if ($action == 'delete')
{ {
$text=$langs->trans('ConfirmDeleteTransaction'); $text=$langs->trans('ConfirmDeleteTransaction');
$ret=$form->form_confirm($_SERVER['PHP_SELF'].'?id='.$object->id.'&amp;rowid='.GETPOST("rowid"),$langs->trans('DeleteTransaction'),$text,'confirm_delete'); print $form->formconfirm($_SERVER['PHP_SELF'].'?id='.$object->id.'&amp;rowid='.GETPOST("rowid"),$langs->trans('DeleteTransaction'),$text,'confirm_delete');
if ($ret == 'html') print '<br>';
} }
// Define transaction list navigation string // Define transaction list navigation string

View File

@ -130,8 +130,8 @@ if (($_GET["id"] || $_GET["ref"]) && $action != 'edit')
// Confirmation de la suppression // Confirmation de la suppression
if ($action == 'delete') if ($action == 'delete')
{ {
$ret=$form->form_confirm($_SERVER["PHP_SELF"].'?id='.$account->id,$langs->trans("DeleteAccount"),$langs->trans("ConfirmDeleteAccount"),"confirm_delete"); print $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$account->id,$langs->trans("DeleteAccount"),$langs->trans("ConfirmDeleteAccount"),"confirm_delete");
if ($ret == 'html') print '<br>';
} }

View File

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

View File

@ -266,8 +266,8 @@ if ($result)
// Confirmations // Confirmations
if ($action == 'delete_categ') if ($action == 'delete_categ')
{ {
$ret=$form->form_confirm($_SERVER['PHP_SELF']."?rowid=".$rowid."&cat1=".GETPOST("fk_categ")."&orig_account=".$orig_account, $langs->trans("RemoveFromRubrique"), $langs->trans("RemoveFromRubriqueConfirm"), "confirm_delete_categ", '', 'yes', 1); print $form->formconfirm($_SERVER['PHP_SELF']."?rowid=".$rowid."&cat1=".GETPOST("fk_categ")."&orig_account=".$orig_account, $langs->trans("RemoveFromRubrique"), $langs->trans("RemoveFromRubriqueConfirm"), "confirm_delete_categ", '', 'yes', 1);
if ($ret == 'html') print '<br>';
} }
print '<form name="update" method="POST" action="'.$_SERVER['PHP_SELF'].'?rowid='.$rowid.'">'; print '<form name="update" method="POST" action="'.$_SERVER['PHP_SELF'].'?rowid='.$rowid.'">';

View File

@ -146,8 +146,8 @@ if ($object->id)
*/ */
if ($action == 'delete') if ($action == 'delete')
{ {
$ret=$form->form_confirm($_SERVER["PHP_SELF"].'?id='.$object->id.'&urlfile='.urlencode($_GET["urlfile"]), $langs->trans('DeleteFile'), $langs->trans('ConfirmDeleteFile'), 'confirm_deletefile', '', 0, 1); print $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id.'&urlfile='.urlencode($_GET["urlfile"]), $langs->trans('DeleteFile'), $langs->trans('ConfirmDeleteFile'), 'confirm_deletefile', '', 0, 1);
if ($ret == 'html') print '<br>';
} }
// Affiche formulaire upload // Affiche formulaire upload

View File

@ -436,8 +436,8 @@ else if ($id)
*/ */
if ($action == 'delete') if ($action == 'delete')
{ {
$ret=$form->form_confirm($_SERVER["PHP_SELF"]."?id=".$id,$langs->trans("DeleteTrip"),$langs->trans("ConfirmDeleteTrip"),"confirm_delete"); print $form->formconfirm($_SERVER["PHP_SELF"]."?id=".$id,$langs->trans("DeleteTrip"),$langs->trans("ConfirmDeleteTrip"),"confirm_delete");
if ($ret == 'html') print '<br>';
} }
$soc = new Societe($db); $soc = new Societe($db);

View File

@ -217,35 +217,28 @@ if ($action == 'set_encaisse')
*/ */
if ($action == 'builddoc') if ($action == 'builddoc')
{ {
$donation = new Don($db); $object = new Don($db);
$donation->fetch($id); $object->fetch($id);
if ($_REQUEST['model']) // Save last template used to generate document
{ if (GETPOST('model')) $object->setDocModel($user, GETPOST('model','alpha'));
$donation->setDocModel($user, $_REQUEST['model']);
}
// Define output language // Define output language
$outputlangs = $langs; $outputlangs = $langs;
$newlang=''; $newlang='';
if ($conf->global->MAIN_MULTILANGS && empty($newlang) && ! empty($_REQUEST['lang_id'])) $newlang=$_REQUEST['lang_id']; if ($conf->global->MAIN_MULTILANGS && empty($newlang) && ! empty($_REQUEST['lang_id'])) $newlang=$_REQUEST['lang_id'];
if ($conf->global->MAIN_MULTILANGS && empty($newlang)) $newlang=$donation->client->default_lang; if ($conf->global->MAIN_MULTILANGS && empty($newlang)) $newlang=$object->client->default_lang;
if (! empty($newlang)) if (! empty($newlang))
{ {
$outputlangs = new Translate("",$conf); $outputlangs = new Translate("",$conf);
$outputlangs->setDefaultLang($newlang); $outputlangs->setDefaultLang($newlang);
} }
$result=don_create($db, $donation->id, '', $donation->modelpdf, $outputlangs); $result=don_create($db, $object->id, '', $object->modelpdf, $outputlangs);
if ($result <= 0) if ($result <= 0)
{ {
dol_print_error($db,$result); dol_print_error($db,$result);
exit; exit;
} }
else
{
header('Location: '.$_SERVER["PHP_SELF"].'?id='.$donation->id.(empty($conf->global->MAIN_JUMP_TAG)?'':'#builddoc'));
exit;
}
} }

View File

@ -1795,7 +1795,8 @@ else if ($action == 'builddoc') // En get ou en post
$object->fetch($id); $object->fetch($id);
$object->fetch_thirdparty(); $object->fetch_thirdparty();
if (GETPOST('model')) $object->setDocModel($user, GETPOST('model')); // Save last template used to generate document
if (GETPOST('model')) $object->setDocModel($user, GETPOST('model','alpha'));
if (GETPOST('fk_bank')) $object->fk_bank=GETPOST('fk_bank'); if (GETPOST('fk_bank')) $object->fk_bank=GETPOST('fk_bank');
// Define output language // Define output language
@ -1814,11 +1815,6 @@ else if ($action == 'builddoc') // En get ou en post
dol_print_error($db,$result); dol_print_error($db,$result);
exit; exit;
} }
else
{
header('Location: '.$_SERVER["PHP_SELF"].'?facid='.$object->id.(empty($conf->global->MAIN_JUMP_TAG)?'':'#builddoc'));
exit;
}
} }
// Remove file in doc form // Remove file in doc form

View File

@ -174,8 +174,8 @@ if ($id > 0 || ! empty($ref))
*/ */
if ($action == 'delete') if ($action == 'delete')
{ {
$ret=$form->form_confirm($_SERVER["PHP_SELF"].'?facid='.$id.'&urlfile='.urlencode(GETPOST("urlfile")), $langs->trans('DeleteFile'), $langs->trans('ConfirmDeleteFile'), 'confirm_deletefile', '', 0, 1); print $form->formconfirm($_SERVER["PHP_SELF"].'?facid='.$id.'&urlfile='.urlencode(GETPOST("urlfile")), $langs->trans('DeleteFile'), $langs->trans('ConfirmDeleteFile'), 'confirm_deletefile', '', 0, 1);
if ($ret == 'html') print '<br>';
} }

View File

@ -211,10 +211,8 @@ if ($action == 'builddoc' && $user->rights->banque->cheque)
{ {
$result = $object->fetch($id); $result = $object->fetch($id);
/*if ($_REQUEST['model']) // Save last template used to generate document
{ //if (GETPOST('model')) $object->setDocModel($user, GETPOST('model','alpha'));
$object->setDocModel($user, $_REQUEST['model']);
}*/
$outputlangs = $langs; $outputlangs = $langs;
$newlang=''; $newlang='';
@ -306,8 +304,8 @@ else
*/ */
if ($action == 'delete') if ($action == 'delete')
{ {
$ret=$form->form_confirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans("DeleteCheckReceipt"), $langs->trans("ConfirmDeleteCheckReceipt"), 'confirm_delete','','',1); print $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans("DeleteCheckReceipt"), $langs->trans("ConfirmDeleteCheckReceipt"), 'confirm_delete','','',1);
if ($ret == 'html') print '<br>';
} }
/* /*
@ -315,8 +313,8 @@ else
*/ */
if ($action == 'valide') if ($action == 'valide')
{ {
$ret=$form->form_confirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans("ValidateCheckReceipt"), $langs->trans("ConfirmValidateCheckReceipt"), 'confirm_valide','','',1); print $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans("ValidateCheckReceipt"), $langs->trans("ConfirmValidateCheckReceipt"), 'confirm_valide','','',1);
if ($ret == 'html') print '<br>';
} }
} }

View File

@ -192,8 +192,8 @@ dol_fiche_head($head, $hselected, $langs->trans("PaymentCustomerInvoice"), 0, 'p
*/ */
if ($action == 'delete') if ($action == 'delete')
{ {
$ret=$form->form_confirm($_SERVER['PHP_SELF'].'?id='.$object->id, $langs->trans("DeletePayment"), $langs->trans("ConfirmDeletePayment"), 'confirm_delete','',0,2); print $form->formconfirm($_SERVER['PHP_SELF'].'?id='.$object->id, $langs->trans("DeletePayment"), $langs->trans("ConfirmDeletePayment"), 'confirm_delete','',0,2);
if ($ret == 'html') print '<br>';
} }
/* /*
@ -202,8 +202,8 @@ if ($action == 'delete')
if ($action == 'valide') if ($action == 'valide')
{ {
$facid = $_GET['facid']; $facid = $_GET['facid'];
$ret=$form->form_confirm($_SERVER['PHP_SELF'].'?id='.$object->id.'&amp;facid='.$facid, $langs->trans("ValidatePayment"), $langs->trans("ConfirmValidatePayment"), 'confirm_valide','',0,2); print $form->formconfirm($_SERVER['PHP_SELF'].'?id='.$object->id.'&amp;facid='.$facid, $langs->trans("ValidatePayment"), $langs->trans("ConfirmValidatePayment"), 'confirm_valide','',0,2);
if ($ret == 'html') print '<br>';
} }

View File

@ -55,10 +55,10 @@ if ($action == 'builddoc')
$rap = new pdf_paiement($db); $rap = new pdf_paiement($db);
$outputlangs = $langs; $outputlangs = $langs;
if (! empty($_REQUEST['lang_id'])) if (! empty(GETPOST('lang_id')))
{ {
$outputlangs = new Translate("",$conf); $outputlangs = new Translate("",$conf);
$outputlangs->setDefaultLang($_REQUEST['lang_id']); $outputlangs->setDefaultLang(GETPOST('lang_id'));
} }
// We save charset_output to restore it because write_file can change it if needed for // We save charset_output to restore it because write_file can change it if needed for

View File

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

View File

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

View File

@ -723,6 +723,22 @@ class Contact extends CommonObject
} }
} }
if (! $error)
{
// Remove category
$sql = "DELETE FROM ".MAIN_DB_PREFIX."categorie_contact WHERE fk_socpeople = ".$rowid;
dol_syslog(get_class($this)."::delete sql=".$sql);
$resql=$this->db->query($sql);
if (! $resql)
{
$error++;
$this->error .= $this->db->lasterror();
$errorflag=-1;
dol_syslog(get_class($this)."::delete erreur ".$errorflag." ".$this->error, LOG_ERR);
}
}
if (! $error) if (! $error)
{ {
$sql = "DELETE FROM ".MAIN_DB_PREFIX."socpeople"; $sql = "DELETE FROM ".MAIN_DB_PREFIX."socpeople";

View File

@ -343,8 +343,8 @@ else
{ {
if ($action == 'delete') if ($action == 'delete')
{ {
$ret=$form->form_confirm($_SERVER["PHP_SELF"]."?id=".$_GET["id"],$langs->trans("DeleteContact"),$langs->trans("ConfirmDeleteContact"),"confirm_delete",'',0,1); print $form->formconfirm($_SERVER["PHP_SELF"]."?id=".$_GET["id"],$langs->trans("DeleteContact"),$langs->trans("ConfirmDeleteContact"),"confirm_delete",'',0,1);
if ($ret == 'html') print '<br>';
} }
} }
@ -839,8 +839,8 @@ else
if ($object->socid > 0) $text.=$langs->trans("UserWillBeExternalUser"); if ($object->socid > 0) $text.=$langs->trans("UserWillBeExternalUser");
else $text.=$langs->trans("UserWillBeInternalUser"); else $text.=$langs->trans("UserWillBeInternalUser");
} }
$ret=$form->form_confirm($_SERVER["PHP_SELF"]."?id=".$object->id,$langs->trans("CreateDolibarrLogin"),$text,"confirm_create_user",$formquestion,'yes'); print $form->formconfirm($_SERVER["PHP_SELF"]."?id=".$object->id,$langs->trans("CreateDolibarrLogin"),$text,"confirm_create_user",$formquestion,'yes');
if ($ret == 'html') print '<br>';
} }
print '<table class="border" width="100%">'; print '<table class="border" width="100%">';

View File

@ -122,7 +122,7 @@ $sql.= " cp.code as country_code";
$sql.= " FROM ".MAIN_DB_PREFIX."socpeople as p"; $sql.= " FROM ".MAIN_DB_PREFIX."socpeople as p";
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."c_pays as cp ON cp.rowid = p.fk_pays"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."c_pays as cp ON cp.rowid = p.fk_pays";
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON s.rowid = p.fk_soc"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON s.rowid = p.fk_soc";
if (! empty($search_categ)) $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX."categorie_contact as cs ON s.rowid = cs.fk_socpeople"; // We need this table joined to the select in order to filter by categ if (! empty($search_categ)) $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX."categorie_contact as cs ON p.rowid = cs.fk_socpeople"; // We need this table joined to the select in order to filter by categ
if (!$user->rights->societe->client->voir && !$socid) $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."societe_commerciaux as sc ON s.rowid = sc.fk_soc"; if (!$user->rights->societe->client->voir && !$socid) $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."societe_commerciaux as sc ON s.rowid = sc.fk_soc";
$sql.= ' WHERE p.entity IN ('.getEntity('societe', 1).')'; $sql.= ' WHERE p.entity IN ('.getEntity('societe', 1).')';
if (!$user->rights->societe->client->voir && !$socid) //restriction if (!$user->rights->societe->client->voir && !$socid) //restriction

View File

@ -145,8 +145,8 @@ if ($object->id)
*/ */
if ($action == 'delete') if ($action == 'delete')
{ {
$ret=$form->form_confirm($_SERVER["PHP_SELF"].'?id='.$id.'&urlfile='.urlencode(GETPOST("urlfile")), $langs->trans('DeleteFile'), $langs->trans('ConfirmDeleteFile'), 'confirm_deletefile', '', 0, 1); print $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$id.'&urlfile='.urlencode(GETPOST("urlfile")), $langs->trans('DeleteFile'), $langs->trans('ConfirmDeleteFile'), 'confirm_deletefile', '', 0, 1);
if ($ret == 'html') print '<br>';
} }

View File

@ -947,8 +947,8 @@ else
*/ */
if ($action == 'delete') if ($action == 'delete')
{ {
$ret=$form->form_confirm($_SERVER['PHP_SELF']."?id=".$object->id,$langs->trans("DeleteAContract"),$langs->trans("ConfirmDeleteAContract"),"confirm_delete",'',0,1); print $form->formconfirm($_SERVER['PHP_SELF']."?id=".$object->id,$langs->trans("DeleteAContract"),$langs->trans("ConfirmDeleteAContract"),"confirm_delete",'',0,1);
if ($ret == 'html') print '<br>';
} }
/* /*
@ -968,8 +968,8 @@ else
$text=$langs->trans('ConfirmValidateContract',$numref); $text=$langs->trans('ConfirmValidateContract',$numref);
$ret=$form->form_confirm($_SERVER['PHP_SELF']."?id=".$object->id,$langs->trans("ValidateAContract"),$text,"confirm_valid",'',0,1); print $form->formconfirm($_SERVER['PHP_SELF']."?id=".$object->id,$langs->trans("ValidateAContract"),$text,"confirm_valid",'',0,1);
if ($ret == 'html') print '<br>';
} }
/* /*
@ -977,8 +977,8 @@ else
*/ */
if ($action == 'close') if ($action == 'close')
{ {
$ret=$form->form_confirm($_SERVER['PHP_SELF']."?id=".$object->id,$langs->trans("CloseAContract"),$langs->trans("ConfirmCloseContract"),"confirm_close",'',0,1); print $form->formconfirm($_SERVER['PHP_SELF']."?id=".$object->id,$langs->trans("CloseAContract"),$langs->trans("ConfirmCloseContract"),"confirm_close",'',0,1);
if ($ret == 'html') print '<br>';
} }
/* /*
@ -1314,7 +1314,7 @@ else
*/ */
if ($action == 'deleteline' && ! $_REQUEST["cancel"] && $user->rights->contrat->creer && $object->lines[$cursorline-1]->id == GETPOST('rowid')) if ($action == 'deleteline' && ! $_REQUEST["cancel"] && $user->rights->contrat->creer && $object->lines[$cursorline-1]->id == GETPOST('rowid'))
{ {
$ret=$form->form_confirm($_SERVER["PHP_SELF"]."?id=".$object->id."&lineid=".GETPOST('rowid'),$langs->trans("DeleteContractLine"),$langs->trans("ConfirmDeleteContractLine"),"confirm_deleteline",'',0,1); print $form->formconfirm($_SERVER["PHP_SELF"]."?id=".$object->id."&lineid=".GETPOST('rowid'),$langs->trans("DeleteContractLine"),$langs->trans("ConfirmDeleteContractLine"),"confirm_deleteline",'',0,1);
if ($ret == 'html') print '<table class="notopnoleftnoright" width="100%"><tr '.$bc[false].' height="6"><td></td></tr></table>'; if ($ret == 'html') print '<table class="notopnoleftnoright" width="100%"><tr '.$bc[false].' height="6"><td></td></tr></table>';
} }

View File

@ -2471,10 +2471,11 @@ class Form
* @param string $action Action * @param string $action Action
* @param array $formquestion An array with forms complementary inputs * @param array $formquestion An array with forms complementary inputs
* @param string $selectedchoice "" or "no" or "yes" * @param string $selectedchoice "" or "no" or "yes"
* @param int $useajax 0=No, 1=Yes, 2=Yes but submit page with &confirm=no if choice is No * @param int $useajax 0=No, 1=Yes, 2=Yes but submit page with &confirm=no if choice is No, 'xxx'=preoutput confirm box with div id=dialog-confirm-xxx
* @param int $height Force height of box * @param int $height Force height of box
* @param int $width Force width of box * @param int $width Force width of box
* @return void * @return void
* @deprecated
*/ */
function form_confirm($page, $title, $question, $action, $formquestion='', $selectedchoice="", $useajax=0, $height=170, $width=500) function form_confirm($page, $title, $question, $action, $formquestion='', $selectedchoice="", $useajax=0, $height=170, $width=500)
{ {
@ -2482,7 +2483,15 @@ class Form
} }
/** /**
* Show a confirmation HTML form or AJAX popup * Show a confirmation HTML form or AJAX popup.
* Easiest way to use this is with useajax=1.
* If you use useajax='xxx', you must also add jquery code to trigger opening of box (with correct parameters)
* just after calling this method. For example:
* print '<script type="text/javascript">'."\n";
* print 'jQuery(document).ready(function() {'."\n";
* print 'jQuery(".xxxlink").click(function(e) { jQuery("#aparamid").val(jQuery(this).attr("rel")); jQuery("#dialog-confirm-xxx").dialog("open"); return false; });'."\n";
* print '});'."\n";
* print '</script>'."\n";
* *
* @param string $page Url of page to call if confirmation is OK * @param string $page Url of page to call if confirmation is OK
* @param string $title Title * @param string $title Title
@ -2578,7 +2587,9 @@ class Form
$more.='</table>'."\n"; $more.='</table>'."\n";
} }
if (! empty($conf->dol_use_jmobile)) $useajax=0; // JQUI method dialog is broken with jmobile, we use standard HTML. We also change code for button to have get on url with action=xxx and output confirm only when action=xxx // JQUI method dialog is broken with jmobile, we use standard HTML.
// Note: When using dol_use_jmobile, you must also check code for button use a GET url with action=xxx and output the confirm code only when action=xxx
if (! empty($conf->dol_use_jmobile)) $useajax=0;
if ($useajax && $conf->use_javascript_ajax) if ($useajax && $conf->use_javascript_ajax)
{ {

View File

@ -585,7 +585,7 @@ function cleanSerialize(expr) {
var reg = new RegExp("(&)", "g"); var reg = new RegExp("(&)", "g");
var reg2 = new RegExp("[^A-Z0-9,]", "g"); var reg2 = new RegExp("[^A-Z0-9,]", "g");
var liste1 = expr.replace(reg, ","); var liste1 = expr.replace(reg, ",");
return liste = liste1.replace(reg2, ""); return liste1.replace(reg2, "");
} }

View File

@ -1033,7 +1033,7 @@ function pdf_getlinedesc($object,$i,$outputlangs,$hideref=0,$hidedesc=0,$issuppl
} }
// Add an additional description for the category products // Add an additional description for the category products
if (! empty($conf->categorie->enabled)) if (! empty($conf->global->CATEGORY_ADD_DESC_INTO_DOC) && $idprod && ! empty($conf->categorie->enabled))
{ {
include_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; include_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
$categstatic=new Categorie($db); $categstatic=new Categorie($db);

View File

@ -209,6 +209,9 @@ if ($action=='inactive')
* View * View
*/ */
$form = new Form($db);
$formCron = new FormCron($db);
llxHeader('',$langs->trans("CronAdd")); llxHeader('',$langs->trans("CronAdd"));
if ($action=='edit' || empty($action) || $action=='delete' || $action=='execute') if ($action=='edit' || empty($action) || $action=='delete' || $action=='execute')
@ -244,19 +247,16 @@ if ($conf->use_javascript_ajax)
print '</script>'."\n"; print '</script>'."\n";
} }
$form = new Form($db);
$formCron = new FormCron($db);
if ($action == 'delete') if ($action == 'delete')
{ {
$ret=$form->form_confirm($_SERVER['PHP_SELF']."?id=".$object->id,$langs->trans("CronDelete"),$langs->trans("CronConfirmDelete"),"confirm_delete",'','',1); print $form->formconfirm($_SERVER['PHP_SELF']."?id=".$object->id,$langs->trans("CronDelete"),$langs->trans("CronConfirmDelete"),"confirm_delete",'','',1);
if ($ret == 'html') print '<br>';
$action=''; $action='';
} }
if ($action == 'execute'){ if ($action == 'execute'){
$ret=$form->form_confirm($_SERVER['PHP_SELF']."?id=".$object->id,$langs->trans("CronExecute"),$langs->trans("CronConfirmExecute"),"confirm_execute",'','',1); print $form->formconfirm($_SERVER['PHP_SELF']."?id=".$object->id,$langs->trans("CronExecute"),$langs->trans("CronConfirmExecute"),"confirm_execute",'','',1);
if ($ret == 'html') print '<br>';
$action=''; $action='';
} }

View File

@ -122,14 +122,14 @@ print $langs->trans('CronInfo');
if ($action == 'delete') if ($action == 'delete')
{ {
$ret=$form->form_confirm($_SERVER['PHP_SELF']."?id=".$id.'&status='.$status,$langs->trans("CronDelete"),$langs->trans("CronConfirmDelete"),"confirm_delete",'','',1); print $form->formconfirm($_SERVER['PHP_SELF']."?id=".$id.'&status='.$status,$langs->trans("CronDelete"),$langs->trans("CronConfirmDelete"),"confirm_delete",'','',1);
if ($ret == 'html') print '<br>';
} }
if ($action == 'execute') if ($action == 'execute')
{ {
$ret=$form->form_confirm($_SERVER['PHP_SELF']."?id=".$id.'&status='.$status,$langs->trans("CronExecute"),$langs->trans("CronConfirmExecute"),"confirm_execute",'','',1); print $form->formconfirm($_SERVER['PHP_SELF']."?id=".$id.'&status='.$status,$langs->trans("CronExecute"),$langs->trans("CronConfirmExecute"),"confirm_execute",'','',1);
if ($ret == 'html') print '<br>';
} }
// liste des jobs creer // liste des jobs creer

View File

@ -204,8 +204,8 @@ if (empty($action) || $action == 'delete_section')
// Confirmation de la suppression d'une ligne categorie // Confirmation de la suppression d'une ligne categorie
if ($action == 'delete_section') if ($action == 'delete_section')
{ {
$ret=$form->form_confirm($_SERVER["PHP_SELF"].'?section='.$section, $langs->trans('DeleteSection'), $langs->trans('ConfirmDeleteSection',$ecmdir->label), 'confirm_deletesection'); print $form->formconfirm($_SERVER["PHP_SELF"].'?section='.$section, $langs->trans('DeleteSection'), $langs->trans('ConfirmDeleteSection',$ecmdir->label), 'confirm_deletesection');
if ($ret == 'html') print '<br>';
} }
// Construit fiche rubrique // Construit fiche rubrique

View File

@ -252,8 +252,8 @@ print '</div>';
// Confirmation de la suppression d'une ligne categorie // Confirmation de la suppression d'une ligne categorie
if ($_GET['action'] == 'delete_file') if ($_GET['action'] == 'delete_file')
{ {
$ret=$form->form_confirm($_SERVER["PHP_SELF"].'?section='.urlencode($_GET["section"]), $langs->trans('DeleteFile'), $langs->trans('ConfirmDeleteFile',$urlfile), 'confirm_deletefile', '', 1, 1); print $form->formconfirm($_SERVER["PHP_SELF"].'?section='.urlencode($_GET["section"]), $langs->trans('DeleteFile'), $langs->trans('ConfirmDeleteFile',$urlfile), 'confirm_deletefile', '', 1, 1);
if ($ret == 'html') print '<br>';
} }
if ($_GET["action"] != 'edit') if ($_GET["action"] != 'edit')

View File

@ -334,16 +334,16 @@ if ($action != 'edit' && $action != 'delete')
// Confirm remove file // Confirm remove file
if ($action == 'delete') if ($action == 'delete')
{ {
$ret=$form->form_confirm($_SERVER["PHP_SELF"].'?section='.$_REQUEST["section"].'&amp;urlfile='.urlencode($_GET["urlfile"]), $langs->trans('DeleteFile'), $langs->trans('ConfirmDeleteFile'), 'confirm_deletefile'); print $form->formconfirm($_SERVER["PHP_SELF"].'?section='.$_REQUEST["section"].'&amp;urlfile='.urlencode($_GET["urlfile"]), $langs->trans('DeleteFile'), $langs->trans('ConfirmDeleteFile'), 'confirm_deletefile');
if ($ret == 'html') print '<br>';
} }
// Confirm remove file // Confirm remove file
if ($action == 'delete_dir') if ($action == 'delete_dir')
{ {
$relativepathwithoutslash=preg_replace('/[\/]$/','',$relativepath); $relativepathwithoutslash=preg_replace('/[\/]$/','',$relativepath);
$ret=$form->form_confirm($_SERVER["PHP_SELF"].'?section='.$_REQUEST["section"], $langs->trans('DeleteSection'), $langs->trans('ConfirmDeleteSection',$relativepathwithoutslash), 'confirm_deletedir', '', 1, 1); print $form->formconfirm($_SERVER["PHP_SELF"].'?section='.$_REQUEST["section"], $langs->trans('DeleteSection'), $langs->trans('ConfirmDeleteSection',$relativepathwithoutslash), 'confirm_deletedir', '', 1, 1);
if ($ret == 'html') print '<br>';
} }
$formfile=new FormFile($db); $formfile=new FormFile($db);

View File

@ -112,8 +112,8 @@ print_fiche_titre($langs->trans("ECMAutoOrg"));
*/ */
if ($_GET['action'] == 'delete_file') if ($_GET['action'] == 'delete_file')
{ {
$ret=$form->form_confirm($_SERVER["PHP_SELF"].'?socid='.$socid.'&amp;urlfile='.urldecode($_GET["urlfile"]), $langs->trans('DeleteFile'), $langs->trans('ConfirmDeleteFile'), 'confirm_deletefile'); print $form->formconfirm($_SERVER["PHP_SELF"].'?socid='.$socid.'&amp;urlfile='.urldecode($_GET["urlfile"]), $langs->trans('DeleteFile'), $langs->trans('ConfirmDeleteFile'), 'confirm_deletefile');
if ($ret == 'html') print '<br>';
} }
// Construit liste des fichiers // Construit liste des fichiers

View File

@ -405,8 +405,8 @@ print '</div>';
// Confirm remove file (for non javascript users) // Confirm remove file (for non javascript users)
if ($action == 'delete' && empty($conf->use_javascript_ajax)) if ($action == 'delete' && empty($conf->use_javascript_ajax))
{ {
$ret=$form->form_confirm($_SERVER["PHP_SELF"].'?section='.$section.'&urlfile='.urlencode($_GET["urlfile"]), $langs->trans('DeleteFile'), $langs->trans('ConfirmDeleteFile'), 'confirm_deletefile','','',1); print $form->formconfirm($_SERVER["PHP_SELF"].'?section='.$section.'&urlfile='.urlencode($_GET["urlfile"]), $langs->trans('DeleteFile'), $langs->trans('ConfirmDeleteFile'), 'confirm_deletefile','','',1);
if ($ret == 'html') print '<br>';
} }
dol_htmloutput_mesg($mesg); dol_htmloutput_mesg($mesg);
@ -455,8 +455,8 @@ print '</div>';
// Confirmation de la suppression d'une ligne categorie // Confirmation de la suppression d'une ligne categorie
if ($action == 'delete_section') if ($action == 'delete_section')
{ {
$ret=$form->form_confirm($_SERVER["PHP_SELF"].'?section='.$section, $langs->trans('DeleteSection'), $langs->trans('ConfirmDeleteSection',$ecmdir->label), 'confirm_deletesection','','',1); print $form->formconfirm($_SERVER["PHP_SELF"].'?section='.$section, $langs->trans('DeleteSection'), $langs->trans('ConfirmDeleteSection',$ecmdir->label), 'confirm_deletesection','','',1);
if ($ret == 'html') print '<br>';
} }
// End confirm // End confirm

View File

@ -294,10 +294,9 @@ else if ($action == 'settrackingnumber' || $action == 'settrackingurl'
// Build document // Build document
else if ($action == 'builddoc') // En get ou en post else if ($action == 'builddoc') // En get ou en post
{ {
if (GETPOST('model','alpha'))
{ // Save last template used to generate document
$object->setDocModel($user, GETPOST('model','alpha')); if (GETPOST('model')) $object->setDocModel($user, GETPOST('model','alpha'));
}
// Define output language // Define output language
$outputlangs = $langs; $outputlangs = $langs;
@ -924,8 +923,8 @@ else
*/ */
if ($action == 'delete') if ($action == 'delete')
{ {
$ret=$form->form_confirm($_SERVER['PHP_SELF'].'?id='.$object->id,$langs->trans('DeleteSending'),$langs->trans("ConfirmDeleteSending",$object->ref),'confirm_delete','',0,1); print $form->formconfirm($_SERVER['PHP_SELF'].'?id='.$object->id,$langs->trans('DeleteSending'),$langs->trans("ConfirmDeleteSending",$object->ref),'confirm_delete','',0,1);
if ($ret == 'html') print '<br>';
} }
/* /*
@ -953,16 +952,16 @@ else
$text.=$notify->confirmMessage('SHIPPING_VALIDATE',$object->socid); $text.=$notify->confirmMessage('SHIPPING_VALIDATE',$object->socid);
} }
$ret=$form->form_confirm($_SERVER['PHP_SELF'].'?id='.$object->id,$langs->trans('ValidateSending'),$text,'confirm_valid','',0,1); print $form->formconfirm($_SERVER['PHP_SELF'].'?id='.$object->id,$langs->trans('ValidateSending'),$text,'confirm_valid','',0,1);
if ($ret == 'html') print '<br>';
} }
/* /*
* Confirmation de l'annulation * Confirmation de l'annulation
*/ */
if ($action == 'annuler') if ($action == 'annuler')
{ {
$ret=$form->form_confirm($_SERVER['PHP_SELF'].'?id='.$object->id,$langs->trans('CancelSending'),$langs->trans("ConfirmCancelSending",$object->ref),'confirm_cancel','',0,1); print $form->formconfirm($_SERVER['PHP_SELF'].'?id='.$object->id,$langs->trans('CancelSending'),$langs->trans("ConfirmCancelSending",$object->ref),'confirm_cancel','',0,1);
if ($ret == 'html') print '<br>';
} }
// Calculate true totalWeight and totalVolume for all products // Calculate true totalWeight and totalVolume for all products

View File

@ -152,8 +152,8 @@ if ($id > 0 || ! empty($ref))
*/ */
if ($action == 'cloture') if ($action == 'cloture')
{ {
$ret=$form->form_confirm($_SERVER['PHP_SELF']."?id=".$id,$langs->trans("CloseShipment"),$langs->trans("ConfirmCloseShipment"),"confirm_cloture"); print $form->formconfirm($_SERVER['PHP_SELF']."?id=".$id,$langs->trans("CloseShipment"),$langs->trans("ConfirmCloseShipment"),"confirm_cloture");
if ($ret == 'html') print '<br>';
} }
// Onglet commande // Onglet commande

View File

@ -225,7 +225,7 @@ if ($step == 1 || $action == 'cleanselect')
if ($action == 'builddoc') if ($action == 'builddoc')
{ {
// Build export file // Build export file
$result=$objexport->build_file($user, $_POST['model'], $datatoexport, $array_selected, $array_filtervalue); $result=$objexport->build_file($user, GETPOST('model','alpha'), $datatoexport, $array_selected, $array_filtervalue);
if ($result < 0) if ($result < 0)
{ {
setEventMessage($objexport->error, 'errors'); setEventMessage($objexport->error, 'errors');
@ -1025,8 +1025,8 @@ if ($step == 5 && $datatoexport)
*/ */
if ($action == 'remove_file') if ($action == 'remove_file')
{ {
$ret=$form->form_confirm($_SERVER["PHP_SELF"].'?step=5&datatoexport='.$datatoexport.'&file='.urlencode(GETPOST("file")), $langs->trans('DeleteFile'), $langs->trans('ConfirmDeleteFile'), 'confirm_deletefile', '', 0, 1); print $form->formconfirm($_SERVER["PHP_SELF"].'?step=5&datatoexport='.$datatoexport.'&file='.urlencode(GETPOST("file")), $langs->trans('DeleteFile'), $langs->trans('ConfirmDeleteFile'), 'confirm_deletefile', '', 0, 1);
if ($ret == 'html') print '<br>';
} }
print '<table width="100%" class="border">'; print '<table width="100%" class="border">';

View File

@ -146,8 +146,8 @@ if ($object->id)
*/ */
if ($action == 'delete') if ($action == 'delete')
{ {
$ret=$form->form_confirm($_SERVER["PHP_SELF"].'?id='.$object->id.'&urlfile='.urlencode($_GET["urlfile"]), $langs->trans('DeleteFile'), $langs->trans('ConfirmDeleteFile'), 'confirm_deletefile', '', 0, 1); print $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id.'&urlfile='.urlencode($_GET["urlfile"]), $langs->trans('DeleteFile'), $langs->trans('ConfirmDeleteFile'), 'confirm_deletefile', '', 0, 1);
if ($ret == 'html') print '<br>';
} }
// Affiche formulaire upload // Affiche formulaire upload

View File

@ -333,10 +333,8 @@ else if ($action == 'builddoc' && $user->rights->ficheinter->creer) // En get ou
$object->fetch_thirdparty(); $object->fetch_thirdparty();
$object->fetch_lines(); $object->fetch_lines();
if (GETPOST('model','alpha')) // Save last template used to generate document
{ if (GETPOST('model')) $object->setDocModel($user, GETPOST('model','alpha'));
$object->setDocModel($user, GETPOST('model','alpha'));
}
// Define output language // Define output language
$outputlangs = $langs; $outputlangs = $langs;
@ -1136,8 +1134,8 @@ else if ($id > 0 || ! empty($ref))
// Confirmation de la suppression de la fiche d'intervention // Confirmation de la suppression de la fiche d'intervention
if ($action == 'delete') if ($action == 'delete')
{ {
$ret=$form->form_confirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('DeleteIntervention'), $langs->trans('ConfirmDeleteIntervention'), 'confirm_delete','',0,1); print $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('DeleteIntervention'), $langs->trans('ConfirmDeleteIntervention'), 'confirm_delete','',0,1);
if ($ret == 'html') print '<br>';
} }
// Confirmation validation // Confirmation validation
@ -1160,22 +1158,22 @@ else if ($id > 0 || ! empty($ref))
} }
$text=$langs->trans('ConfirmValidateIntervention',$numref); $text=$langs->trans('ConfirmValidateIntervention',$numref);
$ret=$form->form_confirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('ValidateIntervention'), $text, 'confirm_validate','',0,1); print $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('ValidateIntervention'), $text, 'confirm_validate','',0,1);
if ($ret == 'html') print '<br>';
} }
// Confirmation de la validation de la fiche d'intervention // Confirmation de la validation de la fiche d'intervention
if ($action == 'modify') if ($action == 'modify')
{ {
$ret=$form->form_confirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('ModifyIntervention'), $langs->trans('ConfirmModifyIntervention'), 'confirm_modify','',0,1); print $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('ModifyIntervention'), $langs->trans('ConfirmModifyIntervention'), 'confirm_modify','',0,1);
if ($ret == 'html') print '<br>';
} }
// Confirmation de la suppression d'une ligne d'intervention // Confirmation de la suppression d'une ligne d'intervention
if ($action == 'ask_deleteline') if ($action == 'ask_deleteline')
{ {
$ret=$form->form_confirm($_SERVER["PHP_SELF"].'?id='.$object->id.'&line_id='.GETPOST('line_id','int'), $langs->trans('DeleteInterventionLine'), $langs->trans('ConfirmDeleteInterventionLine'), 'confirm_deleteline','',0,1); print $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id.'&line_id='.GETPOST('line_id','int'), $langs->trans('DeleteInterventionLine'), $langs->trans('ConfirmDeleteInterventionLine'), 'confirm_deleteline','',0,1);
if ($ret == 'html') print '<br>';
} }
print '<table class="border" width="100%">'; print '<table class="border" width="100%">';

View File

@ -181,8 +181,8 @@ if ($object->id > 0)
*/ */
if ($action == 'delete') if ($action == 'delete')
{ {
$ret=$form->form_confirm($_SERVER["PHP_SELF"].'?id='.$object->id.'&urlfile='.urlencode($_GET["urlfile"]), $langs->trans('DeleteFile'), $langs->trans('ConfirmDeleteFile'), 'confirm_deletefile', '', 0, 1); print $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id.'&urlfile='.urlencode($_GET["urlfile"]), $langs->trans('DeleteFile'), $langs->trans('ConfirmDeleteFile'), 'confirm_deletefile', '', 0, 1);
if ($ret == 'html') print '<br>';
} }
// Affiche formulaire upload // Affiche formulaire upload

View File

@ -628,12 +628,8 @@ else if ($action == 'builddoc' && $user->rights->fournisseur->commande->creer) /
{ {
// Build document // Build document
// Sauvegarde le dernier module choisi pour generer un document // Save last template used to generate document
if (GETPOST('model')) $object->setDocModel($user, GETPOST('model','alpha'));
if (GETPOST('model'))
{
$object->setDocModel($user, GETPOST('model'));
}
$outputlangs = $langs; $outputlangs = $langs;
if (GETPOST('lang_id')) if (GETPOST('lang_id'))
@ -647,11 +643,6 @@ else if ($action == 'builddoc' && $user->rights->fournisseur->commande->creer) /
dol_print_error($db,$result); dol_print_error($db,$result);
exit; exit;
} }
else
{
header('Location: '.$_SERVER["PHP_SELF"].'?id='.$object->id.(empty($conf->global->MAIN_JUMP_TAG)?'':'#builddoc'));
exit;
}
} }
// Delete file in doc form // Delete file in doc form
@ -1069,8 +1060,8 @@ elseif (! empty($object->id))
*/ */
if ($action == 'delete') if ($action == 'delete')
{ {
$ret=$form->form_confirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('DeleteOrder'), $langs->trans('ConfirmDeleteOrder'), 'confirm_delete', '', 0, 2); print $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('DeleteOrder'), $langs->trans('ConfirmDeleteOrder'), 'confirm_delete', '', 0, 2);
if ($ret == 'html') print '<br>';
} }
// Clone confirmation // Clone confirmation
@ -1081,8 +1072,8 @@ elseif (! empty($object->id))
//array('type' => 'checkbox', 'name' => 'update_prices', 'label' => $langs->trans("PuttingPricesUpToDate"), 'value' => 1) //array('type' => 'checkbox', 'name' => 'update_prices', 'label' => $langs->trans("PuttingPricesUpToDate"), 'value' => 1)
); );
// Paiement incomplet. On demande si motif = escompte ou autre // Paiement incomplet. On demande si motif = escompte ou autre
$ret=$form->form_confirm($_SERVER["PHP_SELF"].'?id='.$object->id,$langs->trans('CloneOrder'),$langs->trans('ConfirmCloneOrder',$object->ref),'confirm_clone',$formquestion,'yes',1); print $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id,$langs->trans('CloneOrder'),$langs->trans('ConfirmCloneOrder',$object->ref),'confirm_clone',$formquestion,'yes',1);
if ($ret == 'html') print '<br>';
} }
/* /*
@ -1105,8 +1096,8 @@ elseif (! empty($object->id))
$text.=$notify->confirmMessage('ORDER_SUPPLIER_APPROVE', $object->socid); $text.=$notify->confirmMessage('ORDER_SUPPLIER_APPROVE', $object->socid);
} }
$ret=$form->form_confirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('ValidateOrder'), $text, 'confirm_valid', '', 0, 1); print $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('ValidateOrder'), $text, 'confirm_valid', '', 0, 1);
if ($ret == 'html') print '<br>';
} }
/* /*
@ -1128,8 +1119,8 @@ elseif (! empty($object->id))
); );
} }
$ret=$form->form_confirm($_SERVER['PHP_SELF']."?id=".$object->id,$langs->trans("ApproveThisOrder"),$langs->trans("ConfirmApproveThisOrder",$object->ref),"confirm_approve", $formquestion, 1, 1, 240); print $form->formconfirm($_SERVER['PHP_SELF']."?id=".$object->id,$langs->trans("ApproveThisOrder"),$langs->trans("ConfirmApproveThisOrder",$object->ref),"confirm_approve", $formquestion, 1, 1, 240);
if ($ret == 'html') print '<br>';
} }
/* /*
@ -1137,8 +1128,8 @@ elseif (! empty($object->id))
*/ */
if ($action == 'refuse') if ($action == 'refuse')
{ {
$ret=$form->form_confirm($_SERVER['PHP_SELF']."?id=$object->id",$langs->trans("DenyingThisOrder"),$langs->trans("ConfirmDenyingThisOrder",$object->ref),"confirm_refuse", '', 0, 1); print $form->formconfirm($_SERVER['PHP_SELF']."?id=$object->id",$langs->trans("DenyingThisOrder"),$langs->trans("ConfirmDenyingThisOrder",$object->ref),"confirm_refuse", '', 0, 1);
if ($ret == 'html') print '<br>';
} }
/* /*
@ -1146,8 +1137,8 @@ elseif (! empty($object->id))
*/ */
if ($action == 'cancel') if ($action == 'cancel')
{ {
$ret=$form->form_confirm($_SERVER['PHP_SELF']."?id=$object->id",$langs->trans("Cancel"),$langs->trans("ConfirmCancelThisOrder",$object->ref),"confirm_cancel", '', 0, 1); print $form->formconfirm($_SERVER['PHP_SELF']."?id=$object->id",$langs->trans("Cancel"),$langs->trans("ConfirmCancelThisOrder",$object->ref),"confirm_cancel", '', 0, 1);
if ($ret == 'html') print '<br>';
} }
/* /*
@ -1156,8 +1147,8 @@ elseif (! empty($object->id))
if ($action == 'commande') if ($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"]);
$ret=$form->form_confirm($_SERVER['PHP_SELF']."?id=".$object->id."&datecommande=".$date_com."&methode=".$_POST["methodecommande"]."&comment=".urlencode($_POST["comment"]), $langs->trans("MakeOrder"),$langs->trans("ConfirmMakeOrder",dol_print_date($date_com,'day')),"confirm_commande",'',0,2); print $form->formconfirm($_SERVER['PHP_SELF']."?id=".$object->id."&datecommande=".$date_com."&methode=".$_POST["methodecommande"]."&comment=".urlencode($_POST["comment"]), $langs->trans("MakeOrder"),$langs->trans("ConfirmMakeOrder",dol_print_date($date_com,'day')),"confirm_commande",'',0,2);
if ($ret == 'html') print '<br>';
} }
/* /*
@ -1165,8 +1156,8 @@ elseif (! empty($object->id))
*/ */
if ($action == 'delete_product_line') if ($action == 'delete_product_line')
{ {
$ret=$form->form_confirm($_SERVER["PHP_SELF"].'?id='.$object->id.'&lineid='.$_GET["lineid"], $langs->trans('DeleteProductLine'), $langs->trans('ConfirmDeleteProductLine'), 'confirm_deleteproductline','',0,2); print $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id.'&lineid='.$_GET["lineid"], $langs->trans('DeleteProductLine'), $langs->trans('ConfirmDeleteProductLine'), 'confirm_deleteproductline','',0,2);
if ($ret == 'html') print '<br>';
} }
/* /*
@ -1240,7 +1231,6 @@ elseif (! empty($object->id))
// Conditions de reglement par defaut // Conditions de reglement par defaut
$langs->load('bills'); $langs->load('bills');
$form = new Form($db);
print '<tr><td class="nowrap">'; print '<tr><td class="nowrap">';
print '<table width="100%" class="nobordernopadding"><tr><td class="nowrap">'; print '<table width="100%" class="nobordernopadding"><tr><td class="nowrap">';
print $langs->trans('PaymentConditions'); print $langs->trans('PaymentConditions');
@ -1261,7 +1251,6 @@ elseif (! empty($object->id))
// Mode of payment // Mode of payment
$langs->load('bills'); $langs->load('bills');
$form = new Form($db);
print '<tr><td class="nowrap">'; print '<tr><td class="nowrap">';
print '<table width="100%" class="nobordernopadding"><tr><td class="nowrap">'; print '<table width="100%" class="nobordernopadding"><tr><td class="nowrap">';
print $langs->trans('PaymentMode'); print $langs->trans('PaymentMode');

View File

@ -121,8 +121,8 @@ if ($object->id > 0)
*/ */
if ($action == 'delete') if ($action == 'delete')
{ {
$ret=$form->form_confirm($_SERVER["PHP_SELF"].'?id='.$object->id.'&urlfile='.urlencode($_GET["urlfile"]), $langs->trans('DeleteFile'), $langs->trans('ConfirmDeleteFile'), 'confirm_deletefile', '', 0, 1); print $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id.'&urlfile='.urlencode($_GET["urlfile"]), $langs->trans('DeleteFile'), $langs->trans('ConfirmDeleteFile'), 'confirm_deletefile', '', 0, 1);
if ($ret == 'html') print '<br>';
} }
print '<table class="border" width="100%">'; print '<table class="border" width="100%">';

View File

@ -86,7 +86,7 @@ if ($id > 0 || ! empty($ref))
/* /*
* Actions * Actions
*/ */
// Action clone object // Action clone object
if ($action == 'confirm_clone' && $confirm == 'yes') if ($action == 'confirm_clone' && $confirm == 'yes')
@ -168,7 +168,7 @@ elseif ($action == 'confirm_delete' && $confirm == 'yes' && $user->rights->fourn
} }
} }
elseif ($action == 'confirm_deleteline' && $confirm == 'yes' && $user->rights->fournisseur->facture->creer) elseif ($action == 'confirm_delete_line' && $confirm == 'yes' && $user->rights->fournisseur->facture->creer)
{ {
$object->fetch($id); $object->fetch($id);
$ret = $object->deleteline(GETPOST('lineid')); $ret = $object->deleteline(GETPOST('lineid'));
@ -898,21 +898,22 @@ if ($action == 'send' && ! $_POST['addfile'] && ! $_POST['removedfile'] && ! $_P
} }
// Build document // Build document
elseif ($action == 'builddoc') elseif ($action == 'builddoc')
{ {
// Save modele used // Save modele used
$object->fetch($id); $object->fetch($id);
$object->fetch_thirdparty(); $object->fetch_thirdparty();
if ($_REQUEST['model'])
{ // Save last template used to generate document
$object->setDocModel($user, $_REQUEST['model']); if (GETPOST('model')) $object->setDocModel($user, GETPOST('model','alpha'));
}
$outputlangs = $langs; $outputlangs = $langs;
if (! empty($_REQUEST['lang_id'])) $newlang=GETPOST('lang_id','alpha');
if ($conf->global->MAIN_MULTILANGS && empty($newlang)) $newlang=$object->client->default_lang;
if (! empty($newlang))
{ {
$outputlangs = new Translate("",$conf); $outputlangs = new Translate("",$conf);
$outputlangs->setDefaultLang($_REQUEST['lang_id']); $outputlangs->setDefaultLang($newlang);
} }
$result=supplier_invoice_pdf_create($db, $object, $object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref); $result=supplier_invoice_pdf_create($db, $object, $object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref);
if ($result <= 0) if ($result <= 0)
@ -920,11 +921,6 @@ elseif ($action == 'builddoc')
dol_print_error($db,$result); dol_print_error($db,$result);
exit; exit;
} }
else
{
header('Location: '.$_SERVER["PHP_SELF"].'?id='.$object->id.(empty($conf->global->MAIN_JUMP_TAG)?'':'#builddoc'));
exit;
}
} }
// Delete file in doc form // Delete file in doc form
@ -1373,8 +1369,7 @@ else
// Confirmation de la suppression d'une ligne produit // Confirmation de la suppression d'une ligne produit
if ($action == 'confirm_delete_line') if ($action == 'confirm_delete_line')
{ {
$ret=$form->form_confirm($_SERVER["PHP_SELF"].'?id='.$object->id.'&lineid='.$_GET["lineid"], $langs->trans('DeleteProductLine'), $langs->trans('ConfirmDeleteProductLine'), 'confirm_deleteline', '', 1, 1); print $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id.'&lineid='.$_GET["lineid"], $langs->trans('DeleteProductLine'), $langs->trans('ConfirmDeleteProductLine'), 'confirm_delete_line', '', 1, 1);
if ($ret == 'html') print '<br>';
} }
// Clone confirmation // Clone confirmation
@ -1386,8 +1381,7 @@ 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
$ret=$form->form_confirm($_SERVER["PHP_SELF"].'?id='.$object->id,$langs->trans('CloneInvoice'),$langs->trans('ConfirmCloneInvoice',$object->ref),'confirm_clone',$formquestion,'yes', 1); print $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id,$langs->trans('CloneInvoice'),$langs->trans('ConfirmCloneInvoice',$object->ref),'confirm_clone',$formquestion,'yes', 1);
if ($ret == 'html') print '<br>';
} }
// Confirmation de la validation // Confirmation de la validation
@ -1433,22 +1427,22 @@ else
array('type' => 'other', 'name' => 'idwarehouse', 'label' => $langs->trans("SelectWarehouseForStockIncrease"), 'value' => $formproduct->selectWarehouses(GETPOST('idwarehouse'),'idwarehouse','',1))); array('type' => 'other', 'name' => 'idwarehouse', 'label' => $langs->trans("SelectWarehouseForStockIncrease"), 'value' => $formproduct->selectWarehouses(GETPOST('idwarehouse'),'idwarehouse','',1)));
} }
$ret=$form->form_confirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('ValidateBill'), $text, 'confirm_valid', $formquestion, 1, 1, 240); print $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('ValidateBill'), $text, 'confirm_valid', $formquestion, 1, 1, 240);
if ($ret == 'html') print '<br>';
} }
// Confirmation set paid // Confirmation set paid
if ($action == 'paid') if ($action == 'paid')
{ {
$ret=$form->form_confirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('ClassifyPaid'), $langs->trans('ConfirmClassifyPaidBill', $object->ref), 'confirm_paid', '', 0, 1); print $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('ClassifyPaid'), $langs->trans('ConfirmClassifyPaidBill', $object->ref), 'confirm_paid', '', 0, 1);
if ($ret == 'html') print '<br>';
} }
// Confirmation de la suppression de la facture fournisseur // Confirmation de la suppression de la facture fournisseur
if ($action == 'delete') if ($action == 'delete')
{ {
$ret=$form->form_confirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('DeleteBill'), $langs->trans('ConfirmDeleteBill'), 'confirm_delete', '', 0, 1); print $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('DeleteBill'), $langs->trans('ConfirmDeleteBill'), 'confirm_delete', '', 0, 1);
if ($ret == 'html') print '<br>';
} }
@ -1638,7 +1632,6 @@ else
// Conditions de reglement par defaut // Conditions de reglement par defaut
$langs->load('bills'); $langs->load('bills');
$form = new Form($db);
print '<tr><td class="nowrap">'; print '<tr><td class="nowrap">';
print '<table width="100%" class="nobordernopadding"><tr><td class="nowrap">'; print '<table width="100%" class="nobordernopadding"><tr><td class="nowrap">';
print $langs->trans('PaymentConditions'); print $langs->trans('PaymentConditions');
@ -1659,7 +1652,6 @@ else
// Mode of payment // Mode of payment
$langs->load('bills'); $langs->load('bills');
$form = new Form($db);
print '<tr><td class="nowrap">'; print '<tr><td class="nowrap">';
print '<table width="100%" class="nobordernopadding"><tr><td class="nowrap">'; print '<table width="100%" class="nobordernopadding"><tr><td class="nowrap">';
print $langs->trans('PaymentMode'); print $langs->trans('PaymentMode');
@ -1787,7 +1779,7 @@ else
/* /*
* Lines * Lines
*/ */
print '<br>'; print '<br>';
print '<table class="noborder" width="100%">'; print '<table class="noborder" width="100%">';
$var=1; $var=1;
@ -1956,7 +1948,10 @@ else
print '</td>'; print '</td>';
print '<td align="center" width="16">'; print '<td align="center" width="16">';
if ($object->statut == 0) print '<a href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&amp;action=confirm_delete_line&amp;lineid='.$object->lines[$i]->rowid.'">'.img_delete().'</a>'; if ($object->statut == 0)
{
print '<a href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&amp;action=confirm_delete_line&amp;lineid='.$object->lines[$i]->rowid.'">'.img_delete().'</a>';
}
else print '&nbsp;'; else print '&nbsp;';
print '</td>'; print '</td>';

View File

@ -161,8 +161,8 @@ if ($result > 0)
*/ */
if ($action == 'delete') if ($action == 'delete')
{ {
$ret=$form->form_confirm($_SERVER['PHP_SELF'].'?id='.$object->id, $langs->trans("DeletePayment"), $langs->trans("ConfirmDeletePayment"), 'confirm_delete'); print $form->formconfirm($_SERVER['PHP_SELF'].'?id='.$object->id, $langs->trans("DeletePayment"), $langs->trans("ConfirmDeletePayment"), 'confirm_delete');
if ($ret == 'html') print '<br>';
} }
/* /*
@ -170,8 +170,8 @@ if ($result > 0)
*/ */
if ($action == 'valide') if ($action == 'valide')
{ {
$ret=$form->form_confirm($_SERVER['PHP_SELF'].'?id='.$object->id, $langs->trans("ValidatePayment"), $langs->trans("ConfirmValidatePayment"), 'confirm_valide'); print $form->formconfirm($_SERVER['PHP_SELF'].'?id='.$object->id, $langs->trans("ValidatePayment"), $langs->trans("ConfirmValidatePayment"), 'confirm_valide');
if ($ret == 'html') print '<br>';
} }
print '<table class="border" width="100%">'; print '<table class="border" width="100%">';

View File

@ -403,15 +403,15 @@ else
// Confirm remove file // Confirm remove file
if ($_GET['action'] == 'delete') if ($_GET['action'] == 'delete')
{ {
$ret=$form->form_confirm($_SERVER["PHP_SELF"].'?numero_ftp='.$numero_ftp.'&section='.urlencode($_REQUEST["section"]).'&file='.urlencode($_GET["file"]), $langs->trans('DeleteFile'), $langs->trans('ConfirmDeleteFile'), 'confirm_deletefile','','',1); print $form->formconfirm($_SERVER["PHP_SELF"].'?numero_ftp='.$numero_ftp.'&section='.urlencode($_REQUEST["section"]).'&file='.urlencode($_GET["file"]), $langs->trans('DeleteFile'), $langs->trans('ConfirmDeleteFile'), 'confirm_deletefile','','',1);
if ($ret == 'html') print '<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')
{ {
$ret=$form->form_confirm($_SERVER["PHP_SELF"].'?numero_ftp='.$numero_ftp.'&section='.urlencode($_REQUEST["section"]).'&file='.urlencode($_GET["file"]), $langs->trans('DeleteSection'), $langs->trans('ConfirmDeleteSection',$ecmdir->label), 'confirm_deletesection','','',1); print $form->formconfirm($_SERVER["PHP_SELF"].'?numero_ftp='.$numero_ftp.'&section='.urlencode($_REQUEST["section"]).'&file='.urlencode($_GET["file"]), $langs->trans('DeleteSection'), $langs->trans('ConfirmDeleteSection',$ecmdir->label), 'confirm_deletesection','','',1);
if ($ret == 'html') print '<br>';
} }
print $langs->trans("Server").': <b>'.$ftp_server.'</b><br>'; print $langs->trans("Server").': <b>'.$ftp_server.'</b><br>';

View File

@ -832,7 +832,7 @@ else
if ($action == 'delete' && $cp->statut == 1) { if ($action == 'delete' && $cp->statut == 1) {
if($user->rights->holiday->delete) if($user->rights->holiday->delete)
{ {
$ret=$form->form_confirm("fiche.php?id=".$id,$langs->trans("TitleDeleteCP"),$langs->trans("ConfirmDeleteCP"),"confirm_delete", '', 0, 1); print $form->formconfirm("fiche.php?id=".$id,$langs->trans("TitleDeleteCP"),$langs->trans("ConfirmDeleteCP"),"confirm_delete", '', 0, 1);
if ($ret == 'html') print '<br />'; if ($ret == 'html') print '<br />';
} }
} }
@ -840,14 +840,14 @@ else
// Si envoi en validation // Si envoi en validation
if ($action == 'sendToValidate' && $cp->statut == 1 && $user->id == $cp->fk_user) if ($action == 'sendToValidate' && $cp->statut == 1 && $user->id == $cp->fk_user)
{ {
$ret=$form->form_confirm("fiche.php?id=".$id,$langs->trans("TitleToValidCP"),$langs->trans("ConfirmToValidCP"),"confirm_send", '', 1, 1); print $form->formconfirm("fiche.php?id=".$id,$langs->trans("TitleToValidCP"),$langs->trans("ConfirmToValidCP"),"confirm_send", '', 1, 1);
if ($ret == 'html') print '<br />'; if ($ret == 'html') print '<br />';
} }
// Si validation de la demande // Si validation de la demande
if ($action == 'valid' && $cp->statut == 2 && $user->id == $cp->fk_validator) if ($action == 'valid' && $cp->statut == 2 && $user->id == $cp->fk_validator)
{ {
$ret=$form->form_confirm("fiche.php?id=".$id,$langs->trans("TitleValidCP"),$langs->trans("ConfirmValidCP"),"confirm_valid", '', 1, 1); print $form->formconfirm("fiche.php?id=".$id,$langs->trans("TitleValidCP"),$langs->trans("ConfirmValidCP"),"confirm_valid", '', 1, 1);
if ($ret == 'html') print '<br />'; if ($ret == 'html') print '<br />';
} }
@ -855,14 +855,14 @@ else
if ($action == 'refuse' && $cp->statut == 2 && $user->id == $cp->fk_validator) if ($action == 'refuse' && $cp->statut == 2 && $user->id == $cp->fk_validator)
{ {
$array_input = array(array('type'=>"text",'label'=> $langs->trans('DetailRefusCP'),'name'=>"detail_refuse",'size'=>"50",'value'=>"")); $array_input = array(array('type'=>"text",'label'=> $langs->trans('DetailRefusCP'),'name'=>"detail_refuse",'size'=>"50",'value'=>""));
$ret=$form->form_confirm("fiche.php?id=".$id."&action=confirm_refuse", $langs->trans("TitleRefuseCP"), $langs->trans('ConfirmRefuseCP'), "confirm_refuse", $array_input, 1, 0); print $form->formconfirm("fiche.php?id=".$id."&action=confirm_refuse", $langs->trans("TitleRefuseCP"), $langs->trans('ConfirmRefuseCP'), "confirm_refuse", $array_input, 1, 0);
if ($ret == 'html') print '<br />'; if ($ret == 'html') print '<br />';
} }
// Si annulation de la demande // Si annulation de la demande
if ($action == 'cancel' && $cp->statut == 2 && ($user->id == $cp->fk_validator || $user->id == $cp->fk_user)) if ($action == 'cancel' && $cp->statut == 2 && ($user->id == $cp->fk_validator || $user->id == $cp->fk_user))
{ {
$ret=$form->form_confirm("fiche.php?id=".$id,$langs->trans("TitleCancelCP"),$langs->trans("ConfirmCancelCP"),"confirm_cancel", '', 1, 1); print $form->formconfirm("fiche.php?id=".$id,$langs->trans("TitleCancelCP"),$langs->trans("ConfirmCancelCP"),"confirm_cancel", '', 1, 1);
if ($ret == 'html') print '<br />'; if ($ret == 'html') print '<br />';
} }

View File

@ -135,7 +135,7 @@ if ($action=='downfield' || $action=='upfield')
if ($action == 'builddoc') if ($action == 'builddoc')
{ {
// Build import file // Build import file
$result=$objimport->build_file($user, $_POST['model'], $datatoimport, $array_match_file_to_database); $result=$objimport->build_file($user, GETPOST('model','alpha'), $datatoimport, $array_match_file_to_database);
if ($result < 0) if ($result < 0)
{ {
$mesg='<div class="error">'.$objimport->error.'</div>'; $mesg='<div class="error">'.$objimport->error.'</div>';
@ -481,8 +481,8 @@ if ($step == 3 && $datatoimport)
*/ */
if ($action == 'delete') if ($action == 'delete')
{ {
$ret=$form->form_confirm($_SERVER["PHP_SELF"].'?urlfile='.urlencode(GETPOST('urlfile')).'&step=3'.$param, $langs->trans('DeleteFile'), $langs->trans('ConfirmDeleteFile'), 'confirm_deletefile', '', 0, 1); print $form->formconfirm($_SERVER["PHP_SELF"].'?urlfile='.urlencode(GETPOST('urlfile')).'&step=3'.$param, $langs->trans('DeleteFile'), $langs->trans('ConfirmDeleteFile'), 'confirm_deletefile', '', 0, 1);
if ($ret == 'html') print '<br>';
} }
print '<table width="100%" class="border">'; print '<table width="100%" class="border">';

View File

@ -95,3 +95,4 @@ ReplenishmentOrders=Replenishment orders
UseVirtualStock=Use virtual stock instead of physical stock UseVirtualStock=Use virtual stock instead of physical stock
RuleForStockReplenishment=Rule for stocks replenishment RuleForStockReplenishment=Rule for stocks replenishment
SelectProduct=Select at least one product SelectProduct=Select at least one product
AlertOnly= Alerts only

View File

@ -95,3 +95,4 @@ ReplenishmentOrders=Commandes de réapprovisionnement
UseVirtualStock=Utiliser le stock théorique à la place du stock physique UseVirtualStock=Utiliser le stock théorique à la place du stock physique
RuleForStockReplenishment=Règle de gestion du réapprovisionnement des stocks RuleForStockReplenishment=Règle de gestion du réapprovisionnement des stocks
SelectProduct=Sélectionnez au moins un produit SelectProduct=Sélectionnez au moins un produit
AlertOnly = Alertes seulement

View File

@ -184,15 +184,13 @@ if ($action == 'builddoc') // En get ou en post
$object->fetch($id); $object->fetch($id);
$object->fetch_thirdparty(); $object->fetch_thirdparty();
if ($_REQUEST['model']) // Save last template used to generate document
{ if (GETPOST('model')) $object->setDocModel($user, GETPOST('model','alpha'));
$object->setDocModel($user, $_REQUEST['model']);
}
// Define output language // Define output language
$outputlangs = $langs; $outputlangs = $langs;
$newlang=''; $newlang='';
if ($conf->global->MAIN_MULTILANGS && empty($newlang) && ! empty($_REQUEST['lang_id'])) $newlang=$_REQUEST['lang_id']; if ($conf->global->MAIN_MULTILANGS && empty($newlang) && GETPOST('lang_id')) $newlang=GETPOST('lang_id');
if ($conf->global->MAIN_MULTILANGS && empty($newlang)) $newlang=$object->client->default_lang; if ($conf->global->MAIN_MULTILANGS && empty($newlang)) $newlang=$object->client->default_lang;
if (! empty($newlang)) if (! empty($newlang))
{ {
@ -490,8 +488,8 @@ else
if ($action == 'delete') if ($action == 'delete')
{ {
$expedition_id = $_GET["expid"]; $expedition_id = $_GET["expid"];
$ret=$form->form_confirm($_SERVER['PHP_SELF'].'?id='.$delivery->id.'&amp;expid='.$expedition_id,$langs->trans("DeleteDeliveryReceipt"),$langs->trans("DeleteDeliveryReceiptConfirm",$delivery->ref),'confirm_delete','','',1); print $form->formconfirm($_SERVER['PHP_SELF'].'?id='.$delivery->id.'&amp;expid='.$expedition_id,$langs->trans("DeleteDeliveryReceipt"),$langs->trans("DeleteDeliveryReceiptConfirm",$delivery->ref),'confirm_delete','','',1);
if ($ret == 'html') print '<br>';
} }
/* /*
@ -500,8 +498,8 @@ else
*/ */
if ($action == 'valid') if ($action == 'valid')
{ {
$ret=$form->form_confirm($_SERVER['PHP_SELF'].'?id='.$delivery->id,$langs->trans("ValidateDeliveryReceipt"),$langs->trans("ValidateDeliveryReceiptConfirm",$delivery->ref),'confirm_valid','','',1); print $form->formconfirm($_SERVER['PHP_SELF'].'?id='.$delivery->id,$langs->trans("ValidateDeliveryReceipt"),$langs->trans("ValidateDeliveryReceiptConfirm",$delivery->ref),'confirm_valid','','',1);
if ($ret == 'html') print '<br>';
} }

View File

@ -157,7 +157,6 @@ $productstatic = new Product($db);
$form = new Form($db); $form = new Form($db);
llxHeader("","",$langs->trans("CardProduct".$product->type)); llxHeader("","",$langs->trans("CardProduct".$product->type));
$form = new Form($db);
dol_htmloutput_errors($mesg); dol_htmloutput_errors($mesg);

View File

@ -303,7 +303,9 @@ else
print_liste_field_titre($langs->trans("DateModification"), $_SERVER["PHP_SELF"], "p.tms",$param,"",'align="center"',$sortfield,$sortorder); print_liste_field_titre($langs->trans("DateModification"), $_SERVER["PHP_SELF"], "p.tms",$param,"",'align="center"',$sortfield,$sortorder);
if (! empty($conf->service->enabled) && $type != 0) print_liste_field_titre($langs->trans("Duration"), $_SERVER["PHP_SELF"], "p.duration",$param,"",'align="center"',$sortfield,$sortorder); if (! empty($conf->service->enabled) && $type != 0) print_liste_field_titre($langs->trans("Duration"), $_SERVER["PHP_SELF"], "p.duration",$param,"",'align="center"',$sortfield,$sortorder);
if (empty($conf->global->PRODUIT_MULTIPRICES)) print_liste_field_titre($langs->trans("SellingPrice"), $_SERVER["PHP_SELF"], "p.price",$param,"",'align="right"',$sortfield,$sortorder); if (empty($conf->global->PRODUIT_MULTIPRICES)) print_liste_field_titre($langs->trans("SellingPrice"), $_SERVER["PHP_SELF"], "p.price",$param,"",'align="right"',$sortfield,$sortorder);
print '<td class="liste_titre" align="right">'.$langs->trans("BuyingPriceMinShort").'</td>'; if ($user->rights->produit->creer) {
print '<td class="liste_titre" align="right">'.$langs->trans("BuyingPriceMinShort").'</td>';
}
if (! empty($conf->stock->enabled) && $user->rights->stock->lire && $type != 1) print '<td class="liste_titre" align="right">'.$langs->trans("DesiredStock").'</td>'; if (! empty($conf->stock->enabled) && $user->rights->stock->lire && $type != 1) print '<td class="liste_titre" align="right">'.$langs->trans("DesiredStock").'</td>';
if (! empty($conf->stock->enabled) && $user->rights->stock->lire && $type != 1) print '<td class="liste_titre" align="right">'.$langs->trans("PhysicalStock").'</td>'; if (! empty($conf->stock->enabled) && $user->rights->stock->lire && $type != 1) print '<td class="liste_titre" align="right">'.$langs->trans("PhysicalStock").'</td>';
print_liste_field_titre($langs->trans("Sell"), $_SERVER["PHP_SELF"], "p.tosell",$param,"",'align="right"',$sortfield,$sortorder); print_liste_field_titre($langs->trans("Sell"), $_SERVER["PHP_SELF"], "p.tosell",$param,"",'align="right"',$sortfield,$sortorder);
@ -345,9 +347,11 @@ else
} }
// Minimum buying Price // Minimum buying Price
print '<td class="liste_titre">'; if ($user->rights->produit->creer) {
print '&nbsp;'; print '<td class="liste_titre">';
print '</td>'; print '&nbsp;';
print '</td>';
}
// Stock // Stock
if (! empty($conf->stock->enabled) && $user->rights->stock->lire && $type != 1) if (! empty($conf->stock->enabled) && $user->rights->stock->lire && $type != 1)
@ -442,21 +446,23 @@ else
} }
// Better buy price // Better buy price
print '<td align="right">'; if ($user->rights->produit->creer) {
if ($objp->minsellprice != '') print '<td align="right">';
{ if ($objp->minsellprice != '')
//print price($objp->minsellprice).' '.$langs->trans("HT");
if ($product_fourn->find_min_price_product_fournisseur($objp->rowid) > 0)
{ {
if ($product_fourn->product_fourn_price_id > 0) //print price($objp->minsellprice).' '.$langs->trans("HT");
{ if ($product_fourn->find_min_price_product_fournisseur($objp->rowid) > 0)
$htmltext=$product_fourn->display_price_product_fournisseur(); {
if (! empty($conf->fournisseur->enabled) && $user->rights->fournisseur->lire) print $form->textwithpicto(price($product_fourn->fourn_unitprice).' '.$langs->trans("HT"),$htmltext); if ($product_fourn->product_fourn_price_id > 0)
else print price($product_fourn->fourn_unitprice).' '.$langs->trans("HT"); {
} $htmltext=$product_fourn->display_price_product_fournisseur();
if (! empty($conf->fournisseur->enabled) && $user->rights->fournisseur->lire) print $form->textwithpicto(price($product_fourn->fourn_unitprice).' '.$langs->trans("HT"),$htmltext);
else print price($product_fourn->fourn_unitprice).' '.$langs->trans("HT");
}
}
} }
} print '</td>';
print '</td>'; }
// Show stock // Show stock
if (! empty($conf->stock->enabled) && $user->rights->stock->lire && $type != 1) if (! empty($conf->stock->enabled) && $user->rights->stock->lire && $type != 1)

View File

@ -96,8 +96,8 @@ if ($object->id)
*/ */
if ($action == 'delete') if ($action == 'delete')
{ {
$ret=$form->form_confirm($_SERVER["PHP_SELF"].'?id='.$object->id.'&file='.$_GET["file"], $langs->trans('DeletePicture'), $langs->trans('ConfirmDeletePicture'), 'confirm_delete', '', 0, 1); print $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id.'&file='.$_GET["file"], $langs->trans('DeletePicture'), $langs->trans('ConfirmDeletePicture'), 'confirm_delete', '', 0, 1);
if ($ret == 'html') print '<br>';
} }
print($mesg); print($mesg);

View File

@ -240,9 +240,7 @@ else
// Confirm delete third party // Confirm delete third party
if ($action == 'delete') if ($action == 'delete')
{ {
$form = new Form($db); print $form->formconfirm($_SERVER["PHP_SELF"]."?id=".$object->id,$langs->trans("DeleteAWarehouse"),$langs->trans("ConfirmDeleteWarehouse",$object->libelle),"confirm_delete",'',0,2);
$ret=$form->form_confirm($_SERVER["PHP_SELF"]."?id=".$object->id,$langs->trans("DeleteAWarehouse"),$langs->trans("ConfirmDeleteWarehouse",$object->libelle),"confirm_delete",'',0,2);
if ($ret == 'html') print '<br>';
} }
print '<table class="border" width="100%">'; print '<table class="border" width="100%">';

View File

@ -117,7 +117,7 @@ function ordered($product_id)
} else { } else {
$error = $db->lasterror(); $error = $db->lasterror();
dol_print_error($db); dol_print_error($db);
dol_syslog('replenish.php: ' . $error, LOG_ERROR); dol_syslog('replenish.php: ' . $error, LOG_ERR);
return $langs->trans('error'); return $langs->trans('error');
} }

View File

@ -47,6 +47,7 @@ $snom = GETPOST('snom', 'alpha');
$sall = GETPOST('sall', 'alpha'); $sall = GETPOST('sall', 'alpha');
$type = GETPOST('type','int'); $type = GETPOST('type','int');
$tobuy = GETPOST('tobuy', 'int'); $tobuy = GETPOST('tobuy', 'int');
$salert = GETPOST('salert', 'alpha');
$sortfield = GETPOST('sortfield','alpha'); $sortfield = GETPOST('sortfield','alpha');
$sortorder = GETPOST('sortorder','alpha'); $sortorder = GETPOST('sortorder','alpha');
@ -66,9 +67,16 @@ $offset = $limit * $page ;
* Actions * Actions
*/ */
if (isset($_POST['button_removefilter']) || isset($_POST['valid'])) {
$sref = '';
$snom = '';
$sal = '';
$salert = '';
}
//orders creation //orders creation
//FIXME: could go in the lib //FIXME: could go in the lib
if ($action == 'order') { if ($action == 'order' && isset($_POST['valid'])) {
$linecount = GETPOST('linecount', 'int'); $linecount = GETPOST('linecount', 'int');
$box = 0; $box = 0;
unset($_POST['linecount']); unset($_POST['linecount']);
@ -105,7 +113,7 @@ if ($action == 'order') {
} else { } else {
$error=$db->lasterror(); $error=$db->lasterror();
dol_print_error($db); dol_print_error($db);
dol_syslog('replenish.php: '.$error, LOG_ERROR); dol_syslog('replenish.php: '.$error, LOG_ERR);
} }
$db->free($resql); $db->free($resql);
unset($_POST['fourn' . $i]); unset($_POST['fourn' . $i]);
@ -152,7 +160,7 @@ $title = $langs->trans('Status');
$sql = 'SELECT p.rowid, p.ref, p.label, p.price'; $sql = 'SELECT p.rowid, p.ref, p.label, p.price';
$sql .= ', p.price_ttc, p.price_base_type,p.fk_product_type'; $sql .= ', p.price_ttc, p.price_base_type,p.fk_product_type';
$sql .= ', p.tms as datem, p.duration, p.tobuy, p.seuil_stock_alerte,'; $sql .= ', p.tms as datem, p.duration, p.tobuy, p.seuil_stock_alerte,';
$sql .= ' SUM(s.reel) as stock_physique'; $sql .= ' SUM(COALESCE(s.reel, 0)) as stock_physique';
$sql .= ', p.desiredstock'; $sql .= ', p.desiredstock';
$sql .= ' FROM ' . MAIN_DB_PREFIX . 'product as p'; $sql .= ' FROM ' . MAIN_DB_PREFIX . 'product as p';
$sql .= ' LEFT JOIN ' . MAIN_DB_PREFIX . 'product_fournisseur_price as pf'; $sql .= ' LEFT JOIN ' . MAIN_DB_PREFIX . 'product_fournisseur_price as pf';
@ -175,10 +183,18 @@ if (dol_strlen($type)) {
} }
} }
if ($sref) { if ($sref) {
$sql .= ' AND p.ref LIKE "%' . $sref . '%"'; //natural search
$scrit = explode(' ', $sref);
foreach ($scrit as $crit) {
$sql .= ' AND p.ref LIKE "%' . $crit . '%"';
}
} }
if ($snom) { if ($snom) {
$sql .= ' AND p.label LIKE "%' . $db->escape($snom) . '%"'; //natural search
$scrit = explode(' ', $snom);
foreach ($scrit as $crit) {
$sql .= ' AND p.label LIKE "%' . $db->escape($crit) . '%"';
}
} }
$sql .= ' AND p.tobuy = 1'; $sql .= ' AND p.tobuy = 1';
@ -190,8 +206,12 @@ $sql .= ' GROUP BY p.rowid, p.ref, p.label, p.price';
$sql .= ', p.price_ttc, p.price_base_type,p.fk_product_type, p.tms'; $sql .= ', p.price_ttc, p.price_base_type,p.fk_product_type, p.tms';
$sql .= ', p.duration, p.tobuy, p.seuil_stock_alerte'; $sql .= ', p.duration, p.tobuy, p.seuil_stock_alerte';
$sql .= ', p.desiredstock'; $sql .= ', p.desiredstock';
$sql .= ' HAVING (p.desiredstock > SUM(s.reel) or SUM(s.reel) is NULL)'; $sql .= ' HAVING p.desiredstock > SUM(COALESCE(s.reel, 0))';
$sql .= ' AND p.desiredstock > 0'; $sql .= ' AND p.desiredstock > 0';
if ($salert == 'on') {
$sql .= ' AND SUM(COALESCE(s.reel, 0)) < p.seuil_stock_alerte AND p.seuil_stock_alerte is not NULL';
$alertchecked = 'checked="checked"';
}
$sql .= $db->order($sortfield,$sortorder); $sql .= $db->order($sortfield,$sortorder);
$sql .= $db->plimit($limit + 1, $offset); $sql .= $db->plimit($limit + 1, $offset);
$resql = $db->query($sql); $resql = $db->query($sql);
@ -199,11 +219,6 @@ $resql = $db->query($sql);
if ($resql) { if ($resql) {
$num = $db->num_rows($resql); $num = $db->num_rows($resql);
$i = 0; $i = 0;
if ($num == 1 && ($sall or $snom or $sref)) {
$objp = $db->fetch_object($resql);
header('Location: ../fiche.php?id=' . $objp->rowid);
exit;
}
$helpurl = 'EN:Module_Stocks_En|FR:Module_Stock|'; $helpurl = 'EN:Module_Stocks_En|FR:Module_Stock|';
$helpurl .= 'ES:M&oacute;dulo_Stocks'; $helpurl .= 'ES:M&oacute;dulo_Stocks';
@ -216,9 +231,10 @@ if ($resql) {
$head[1][1] = $langs->trans("ReplenishmentOrders"); $head[1][1] = $langs->trans("ReplenishmentOrders");
$head[1][2] = 'replenishorders'; $head[1][2] = 'replenishorders';
dol_fiche_head($head, 'replenish', $langs->trans('Replenishment'), 0, 'stock'); dol_fiche_head($head, 'replenish', $langs->trans('Replenishment'), 0, 'stock');
if ($sref || $snom || $sall || GETPOST('search', 'alpha')) { if ($sref || $snom || $sall || $salert || GETPOST('search', 'alpha')) {
$filters = '&sref=' . $sref . '&snom=' . $snom; $filters = '&sref=' . $sref . '&snom=' . $snom;
$filters .= '&amp;sall=' . $sall; $filters .= '&sall=' . $sall;
$filters .= '&salert=' . $salert;
print_barre_liste($texte, print_barre_liste($texte,
$page, $page,
'replenish.php', 'replenish.php',
@ -231,7 +247,8 @@ if ($resql) {
} else { } else {
$filters = '&sref=' . $sref . '&snom=' . $snom; $filters = '&sref=' . $sref . '&snom=' . $snom;
$filters .= '&fourn_id=' . $fourn_id; $filters .= '&fourn_id=' . $fourn_id;
$filters .= (isset($type)?'&amp;type=' . $type:''); $filters .= (isset($type)?'&type=' . $type:'');
$filters .= '&salert=' . $salert;
print_barre_liste($texte, print_barre_liste($texte,
$page, $page,
'replenish.php', 'replenish.php',
@ -253,7 +270,7 @@ if ($resql) {
'<table class="liste" width="100%">'; '<table class="liste" width="100%">';
$param = (isset($type)? '&type=' . $type : ''); $param = (isset($type)? '&type=' . $type : '');
$param .= '&fourn_id=' . $fourn_id . '&snom='. $snom; $param .= '&fourn_id=' . $fourn_id . '&snom='. $snom . '&salert=' . $salert;
$param .= '&sref=' . $sref; $param .= '&sref=' . $sref;
// Lignes des titres // Lignes des titres
@ -356,13 +373,15 @@ if ($resql) {
'</td>'; '</td>';
} }
echo '<td class="liste_titre">&nbsp;</td>', echo '<td class="liste_titre">&nbsp;</td>',
'<td class="liste_titre">&nbsp;</td>', '<td class="liste_titre" align="right">' . $langs->trans('AlertOnly') . '&nbsp;<input type="checkbox" name="salert" ' . $alertchecked . '></td>',
'<td class="liste_titre" align="right">&nbsp;</td>', '<td class="liste_titre" align="right">&nbsp;</td>',
'<td class="liste_titre">&nbsp;</td>', '<td class="liste_titre">&nbsp;</td>',
'<td class="liste_titre">&nbsp;</td>', '<td class="liste_titre">&nbsp;</td>',
'<td class="liste_titre" align="right">', '<td class="liste_titre" align="right">',
'<input type="image" class="liste_titre" name="button_search"', '<input type="image" class="liste_titre" name="button_search"',
'src="' . DOL_URL_ROOT . '/theme/' . $conf->theme . '/img/search.png" alt="' . $langs->trans("Search") . '">', 'src="' . DOL_URL_ROOT . '/theme/' . $conf->theme . '/img/search.png" alt="' . $langs->trans("Search") . '">',
'<input type="image" class="liste_titre" name="button_removefilter"
src="'.DOL_URL_ROOT.'/theme/'.$conf->theme.'/img/searchclear.png" value="'.dol_escape_htmltag($langs->trans("Search")).'" title="'.dol_escape_htmltag($langs->trans("Search")).'">',
'</td>', '</td>',
'</tr>'; '</tr>';
@ -396,9 +415,6 @@ if ($resql) {
$prod->type = $objp->fk_product_type; $prod->type = $objp->fk_product_type;
$ordered = ordered($prod->id); $ordered = ordered($prod->id);
if (!$objp->stock_physique) {
$objp->stock_physique = 0;
}
if ($conf->global->USE_VIRTUAL_STOCK) { if ($conf->global->USE_VIRTUAL_STOCK) {
//compute virtual stock //compute virtual stock
$prod->fetch($prod->id); $prod->fetch($prod->id);
@ -487,14 +503,15 @@ if ($resql) {
'</div>', '</div>',
'<table width="100%">', '<table width="100%">',
'<tr><td align="right">', '<tr><td align="right">',
'<input class="butAction" type="submit" value="' . $value . '">', '<input class="butAction" type="submit" name="valid" value="' . $value . '">',
'</td></tr></table>', '</td></tr></table>',
'</form>'; '</form>';
if ($num > $conf->liste_limit) { if ($num > $conf->liste_limit) {
if ($sref || $snom || $sall || GETPOST('search', 'alpha')) { if ($sref || $snom || $sall || $salert || GETPOST('search', 'alpha')) {
$filters = '&sref=' . $sref . '&snom=' . $snom; $filters = '&sref=' . $sref . '&snom=' . $snom;
$filters .= '&amp;sall=' . $sall; $filters .= '&sall=' . $sall;
$filters .= '&salert=' . $salert;
print_barre_liste('', print_barre_liste('',
$page, $page,
'replenish.php', 'replenish.php',
@ -509,7 +526,8 @@ if ($resql) {
} else { } else {
$filters = '&sref=' . $sref . '&snom=' . $snom; $filters = '&sref=' . $sref . '&snom=' . $snom;
$filters .= '&fourn_id=' . $fourn_id; $filters .= '&fourn_id=' . $fourn_id;
$filters .= (isset($type)? '&amp;type=' . $type : ''); $filters .= (isset($type)? '&type=' . $type : '');
$filters .= '&salert=' . $salert;
print_barre_liste('', print_barre_liste('',
$page, $page,
'replenish.php', 'replenish.php',

View File

@ -103,10 +103,17 @@ if (!$user->rights->societe->client->voir && !$socid) {
$sql .= ' AND s.rowid = sc.fk_soc AND sc.fk_user = ' . $user->id; $sql .= ' AND s.rowid = sc.fk_soc AND sc.fk_user = ' . $user->id;
} }
if ($sref) { if ($sref) {
$sql .= ' AND cf.ref LIKE "%' . $db->escape($sref) . '%"'; //natural search
$scrit = explode(' ', $sref);
foreach ($scrit as $crit) {
$sql .= ' AND cf.ref LIKE "%' . $db->escape($crit) . '%"';
}
} }
if ($snom) { if ($snom) {
$sql .= ' AND s.nom LIKE "%' . $db->escape($snom) . '%"'; $scrit = explode(' ', $snom);
foreach ($scrit as $crit) {
$sql .= ' AND s.nom LIKE "%' . $db->escape($crit) . '%"';
}
} }
if ($suser) { if ($suser) {
$sql .= ' AND u.login LIKE "%' . $db->escape($suser) . '%"'; $sql .= ' AND u.login LIKE "%' . $db->escape($suser) . '%"';

View File

@ -122,8 +122,7 @@ if ($object->id > 0)
if ($action == 'delete') if ($action == 'delete')
{ {
$ret=$form->form_confirm($_SERVER["PHP_SELF"]."?id=".$object->id."&urlfile=".urlencode(GETPOST("urlfile")),$langs->trans("DeleteAFile"),$langs->trans("ConfirmDeleteAFile"),"confirm_delete",'','',1); print $form->formconfirm($_SERVER["PHP_SELF"]."?id=".$object->id."&urlfile=".urlencode(GETPOST("urlfile")),$langs->trans("DeleteAFile"),$langs->trans("ConfirmDeleteAFile"),"confirm_delete",'','',1);
if ($ret == 'html') print '<br>';
} }
print '<table class="border" width="100%">'; print '<table class="border" width="100%">';

View File

@ -233,10 +233,8 @@ if ($action == 'update' && ! $_POST["cancel"] && $user->rights->projet->creer)
// Build doc // Build doc
if ($action == 'builddoc' && $user->rights->projet->creer) if ($action == 'builddoc' && $user->rights->projet->creer)
{ {
if (GETPOST('model')) // Save last template used to generate document
{ if (GETPOST('model')) $object->setDocModel($user, GETPOST('model','alpha'));
$object->setDocModel($user, GETPOST('model'));
}
$outputlangs = $langs; $outputlangs = $langs;
if (GETPOST('lang_id')) if (GETPOST('lang_id'))
@ -250,11 +248,6 @@ if ($action == 'builddoc' && $user->rights->projet->creer)
dol_print_error($db,$result); dol_print_error($db,$result);
exit; exit;
} }
else
{
header('Location: '.$_SERVER["PHP_SELF"].'?id='.$object->id.(empty($conf->global->MAIN_JUMP_TAG)?'':'#builddoc'));
exit;
}
} }
// Delete file in doc form // Delete file in doc form
@ -458,20 +451,17 @@ else
// Confirmation validation // Confirmation validation
if ($action == 'validate') if ($action == 'validate')
{ {
$ret=$form->form_confirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('ValidateProject'), $langs->trans('ConfirmValidateProject'), 'confirm_validate','',0,1); print $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('ValidateProject'), $langs->trans('ConfirmValidateProject'), 'confirm_validate','',0,1);
if ($ret == 'html') print '<br>';
} }
// Confirmation close // Confirmation close
if ($action == 'close') if ($action == 'close')
{ {
$ret=$form->form_confirm($_SERVER["PHP_SELF"]."?id=".$object->id,$langs->trans("CloseAProject"),$langs->trans("ConfirmCloseAProject"),"confirm_close",'','',1); print $form->formconfirm($_SERVER["PHP_SELF"]."?id=".$object->id,$langs->trans("CloseAProject"),$langs->trans("ConfirmCloseAProject"),"confirm_close",'','',1);
if ($ret == 'html') print '<br>';
} }
// Confirmation reopen // Confirmation reopen
if ($action == 'reopen') if ($action == 'reopen')
{ {
$ret=$form->form_confirm($_SERVER["PHP_SELF"]."?id=".$object->id,$langs->trans("ReOpenAProject"),$langs->trans("ConfirmReOpenAProject"),"confirm_reopen",'','',1); print $form->formconfirm($_SERVER["PHP_SELF"]."?id=".$object->id,$langs->trans("ReOpenAProject"),$langs->trans("ConfirmReOpenAProject"),"confirm_reopen",'','',1);
if ($ret == 'html') print '<br>';
} }
// Confirmation delete // Confirmation delete
if ($action == 'delete') if ($action == 'delete')
@ -481,8 +471,7 @@ else
$taskarray=$task->getTasksArray(0,0,$object->id,0,0); $taskarray=$task->getTasksArray(0,0,$object->id,0,0);
$nboftask=count($taskarray); $nboftask=count($taskarray);
if ($nboftask) $text.='<br>'.img_warning().' '.$langs->trans("ThisWillAlsoRemoveTasks",$nboftask); if ($nboftask) $text.='<br>'.img_warning().' '.$langs->trans("ThisWillAlsoRemoveTasks",$nboftask);
$ret=$form->form_confirm($_SERVER["PHP_SELF"]."?id=".$object->id,$langs->trans("DeleteAProject"),$text,"confirm_delete",'','',1); print $form->formconfirm($_SERVER["PHP_SELF"]."?id=".$object->id,$langs->trans("DeleteAProject"),$text,"confirm_delete",'','',1);
if ($ret == 'html') print '<br>';
} }
// Clone confirmation // Clone confirmation

View File

@ -146,30 +146,22 @@ if (! empty($project_ref) && ! empty($withproject))
// Build doc // Build doc
if ($action == 'builddoc' && $user->rights->projet->creer) if ($action == 'builddoc' && $user->rights->projet->creer)
{ {
if ($object->fetch($id,$ref) >= 0 ) $object->fetch($id,$ref);
{
if (GETPOST('model'))
{
$object->setDocModel($user, GETPOST('model'));
}
$outputlangs = $langs; // Save last template used to generate document
if (GETPOST('lang_id')) if (GETPOST('model')) $object->setDocModel($user, GETPOST('model','alpha'));
{
$outputlangs = new Translate("",$conf); $outputlangs = $langs;
$outputlangs->setDefaultLang(GETPOST('lang_id')); if (GETPOST('lang_id'))
} {
$result=task_pdf_create($db, $object, $object->modelpdf, $outputlangs); $outputlangs = new Translate("",$conf);
if ($result <= 0) $outputlangs->setDefaultLang(GETPOST('lang_id'));
{ }
dol_print_error($db,$result); $result=task_pdf_create($db, $object, $object->modelpdf, $outputlangs);
exit; if ($result <= 0)
} {
else dol_print_error($db,$result);
{ exit;
header('Location: '.$_SERVER["PHP_SELF"].'?id='.$object->id.(empty($conf->global->MAIN_JUMP_TAG)?'':'#builddoc'));
exit;
}
} }
} }
@ -385,8 +377,7 @@ if ($id > 0 || ! empty($ref))
if ($action == 'delete') if ($action == 'delete')
{ {
$ret=$form->form_confirm($_SERVER["PHP_SELF"]."?id=".$_GET["id"].'&withproject='.$withproject,$langs->trans("DeleteATask"),$langs->trans("ConfirmDeleteATask"),"confirm_delete"); print $form->formconfirm($_SERVER["PHP_SELF"]."?id=".$_GET["id"].'&withproject='.$withproject,$langs->trans("DeleteATask"),$langs->trans("ConfirmDeleteATask"),"confirm_delete");
if ($ret == 'html') print '<br>';
} }
print '<table class="border" width="100%">'; print '<table class="border" width="100%">';

View File

@ -241,8 +241,7 @@ if ($id > 0 || ! empty($ref))
if ($action == 'deleteline') if ($action == 'deleteline')
{ {
$ret=$form->form_confirm($_SERVER["PHP_SELF"]."?id=".$object->id.'&lineid='.$_GET["lineid"].($withproject?'&withproject=1':''),$langs->trans("DeleteATimeSpent"),$langs->trans("ConfirmDeleteATimeSpent"),"confirm_delete",'','',1); print $form->formconfirm($_SERVER["PHP_SELF"]."?id=".$object->id.'&lineid='.$_GET["lineid"].($withproject?'&withproject=1':''),$langs->trans("DeleteATimeSpent"),$langs->trans("ConfirmDeleteATimeSpent"),"confirm_delete",'','',1);
if ($ret == 'html') print '<br>';
} }
print '<table class="border" width="100%">'; print '<table class="border" width="100%">';

View File

@ -333,24 +333,19 @@ abstract class ActionsCardCommon
// Define output language // Define output language
$outputlangs = $langs; $outputlangs = $langs;
$newlang=''; $newlang='';
if ($conf->global->MAIN_MULTILANGS && empty($newlang) && GETPOST('lang_id') ) $newlang=GETPOST('lang_id'); if ($conf->global->MAIN_MULTILANGS && empty($newlang) && GETPOST('lang_id')) $newlang=GETPOST('lang_id');
if ($conf->global->MAIN_MULTILANGS && empty($newlang)) $newlang=$this->object->default_lang; if ($conf->global->MAIN_MULTILANGS && empty($newlang)) $newlang=$this->object->default_lang;
if (! empty($newlang)) if (! empty($newlang))
{ {
$outputlangs = new Translate("",$conf); $outputlangs = new Translate("",$conf);
$outputlangs->setDefaultLang($newlang); $outputlangs->setDefaultLang($newlang);
} }
$result=thirdparty_doc_create($this->db, $this->object->id, '', GETPOST('model'), $outputlangs); $result=thirdparty_doc_create($this->db, $this->object->id, '', GETPOST('model','alpha'), $outputlangs);
if ($result <= 0) if ($result <= 0)
{ {
dol_print_error($this->db,$result); dol_print_error($this->db,$result);
exit; exit;
} }
else
{
header('Location: '.$_SERVER["PHP_SELF"].'?socid='.$this->object->id.(empty($conf->global->MAIN_JUMP_TAG)?'':'#builddoc'));
exit;
}
} }
} }
} }

View File

@ -177,8 +177,7 @@ if ($object->id)
*/ */
if ($action == 'delete') if ($action == 'delete')
{ {
$ret=$form->form_confirm($_SERVER["PHP_SELF"].'?id='.$object->id.'&urlfile='.urlencode(GETPOST("urlfile")), $langs->trans('DeleteFile'), $langs->trans('ConfirmDeleteFile'), 'confirm_deletefile', '', 0, 1); print $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id.'&urlfile='.urlencode(GETPOST("urlfile")), $langs->trans('DeleteFile'), $langs->trans('ConfirmDeleteFile'), 'confirm_deletefile', '', 0, 1);
if ($ret == 'html') print '<br>';
} }
$formfile=new FormFile($db); $formfile=new FormFile($db);

View File

@ -130,10 +130,8 @@ $result=$object->fetch($socid);
if ($result > 0) if ($result > 0)
{ {
$form = new Form($db);
$langs->load("other"); $langs->load("other");
$head = societe_prepare_head($object); $head = societe_prepare_head($object);
dol_fiche_head($head, 'notify', $langs->trans("ThirdParty"),0,'company'); dol_fiche_head($head, 'notify', $langs->trans("ThirdParty"),0,'company');

View File

@ -475,17 +475,12 @@ if (empty($reshook))
$outputlangs = new Translate("",$conf); $outputlangs = new Translate("",$conf);
$outputlangs->setDefaultLang($newlang); $outputlangs->setDefaultLang($newlang);
} }
$result=thirdparty_doc_create($db, $object, '', $_REQUEST['model'], $outputlangs); $result=thirdparty_doc_create($db, $object, '', GETPOST('model','alpha'), $outputlangs);
if ($result <= 0) if ($result <= 0)
{ {
dol_print_error($db,$result); dol_print_error($db,$result);
exit; exit;
} }
else
{
header('Location: '.$_SERVER["PHP_SELF"].'?socid='.$object->id.(empty($conf->global->MAIN_JUMP_TAG)?'':'#builddoc'));
exit;
}
} }
} }
@ -871,7 +866,6 @@ else
if ($j % 2 == 1) print '<td colspan="2"></td></tr>'; if ($j % 2 == 1) print '<td colspan="2"></td></tr>';
// Assujeti TVA // Assujeti TVA
$form = new Form($db);
print '<tr><td>'.$langs->trans('VATIsUsed').'</td>'; print '<tr><td>'.$langs->trans('VATIsUsed').'</td>';
print '<td>'; print '<td>';
print $form->selectyesno('assujtva_value',1,1); // Assujeti par defaut en creation print $form->selectyesno('assujtva_value',1,1); // Assujeti par defaut en creation
@ -1440,9 +1434,7 @@ else
// Confirm delete third party // Confirm delete third party
if ($action == 'delete' || ($conf->use_javascript_ajax && empty($conf->dol_use_jmobile))) if ($action == 'delete' || ($conf->use_javascript_ajax && empty($conf->dol_use_jmobile)))
{ {
$form = new Form($db); print $form->formconfirm($_SERVER["PHP_SELF"]."?socid=".$object->id,$langs->trans("DeleteACompany"),$langs->trans("ConfirmDeleteCompany"),"confirm_delete",'',0,"action-delete");
$ret=$form->form_confirm($_SERVER["PHP_SELF"]."?socid=".$object->id,$langs->trans("DeleteACompany"),$langs->trans("ConfirmDeleteCompany"),"confirm_delete",'',0,"action-delete");
if ($ret == 'html') print '<br>';
} }
dol_htmloutput_errors($error,$errors); dol_htmloutput_errors($error,$errors);
@ -1595,7 +1587,6 @@ else
if ($j % 2 == 1) print '<td colspan="2"></td></tr>'; if ($j % 2 == 1) print '<td colspan="2"></td></tr>';
// VAT payers // VAT payers
$form = new Form($db);
print '<tr><td>'; print '<tr><td>';
print $langs->trans('VATIsUsed'); print $langs->trans('VATIsUsed');
print '</td><td>'; print '</td><td>';

View File

@ -82,7 +82,6 @@ $langs->load("users");
$langs->load("companies"); $langs->load("companies");
$langs->load("ldap"); $langs->load("ldap");
$form = new Form($db);
$object = new User($db); $object = new User($db);
$extrafields = new ExtraFields($db); $extrafields = new ExtraFields($db);
@ -566,10 +565,10 @@ if ($action == 'adduserldap')
* View * View
*/ */
llxHeader('',$langs->trans("UserCard"));
$form = new Form($db); $form = new Form($db);
llxHeader('',$langs->trans("UserCard"));
if (($action == 'create') || ($action == 'adduserldap')) if (($action == 'create') || ($action == 'adduserldap'))
{ {
/* ************************************************************************** */ /* ************************************************************************** */
@ -997,8 +996,7 @@ else
*/ */
if ($action == 'password') if ($action == 'password')
{ {
$ret=$form->form_confirm("fiche.php?id=$object->id",$langs->trans("ReinitPassword"),$langs->trans("ConfirmReinitPassword",$object->login),"confirm_password", '', 0, 1); print $form->formconfirm("fiche.php?id=$object->id",$langs->trans("ReinitPassword"),$langs->trans("ConfirmReinitPassword",$object->login),"confirm_password", '', 0, 1);
if ($ret == 'html') print '<br>';
} }
/* /*
@ -1006,8 +1004,7 @@ else
*/ */
if ($action == 'passwordsend') if ($action == 'passwordsend')
{ {
$ret=$form->form_confirm("fiche.php?id=$object->id",$langs->trans("SendNewPassword"),$langs->trans("ConfirmSendNewPassword",$object->login),"confirm_passwordsend", '', 0, 1); print $form->formconfirm("fiche.php?id=$object->id",$langs->trans("SendNewPassword"),$langs->trans("ConfirmSendNewPassword",$object->login),"confirm_passwordsend", '', 0, 1);
if ($ret == 'html') print '<br>';
} }
/* /*
@ -1015,8 +1012,7 @@ else
*/ */
if ($action == 'disable') if ($action == 'disable')
{ {
$ret=$form->form_confirm("fiche.php?id=$object->id",$langs->trans("DisableAUser"),$langs->trans("ConfirmDisableUser",$object->login),"confirm_disable", '', 0, 1); print $form->formconfirm("fiche.php?id=$object->id",$langs->trans("DisableAUser"),$langs->trans("ConfirmDisableUser",$object->login),"confirm_disable", '', 0, 1);
if ($ret == 'html') print '<br>';
} }
/* /*
@ -1024,8 +1020,7 @@ else
*/ */
if ($action == 'enable') if ($action == 'enable')
{ {
$ret=$form->form_confirm("fiche.php?id=$object->id",$langs->trans("EnableAUser"),$langs->trans("ConfirmEnableUser",$object->login),"confirm_enable", '', 0, 1); print $form->formconfirm("fiche.php?id=$object->id",$langs->trans("EnableAUser"),$langs->trans("ConfirmEnableUser",$object->login),"confirm_enable", '', 0, 1);
if ($ret == 'html') print '<br>';
} }
/* /*
@ -1033,8 +1028,7 @@ else
*/ */
if ($action == 'delete') if ($action == 'delete')
{ {
$ret=$form->form_confirm("fiche.php?id=$object->id",$langs->trans("DeleteAUser"),$langs->trans("ConfirmDeleteUser",$object->login),"confirm_delete", '', 0, 1); print $form->formconfirm("fiche.php?id=$object->id",$langs->trans("DeleteAUser"),$langs->trans("ConfirmDeleteUser",$object->login),"confirm_delete", '', 0, 1);
if ($ret == 'html') print '<br>';
} }
dol_htmloutput_mesg($message); dol_htmloutput_mesg($message);
@ -1409,7 +1403,6 @@ else
if ($caneditgroup) if ($caneditgroup)
{ {
$form = new Form($db);
print '<form action="'.$_SERVER['PHP_SELF'].'?id='.$id.'" method="POST">'."\n"; print '<form action="'.$_SERVER['PHP_SELF'].'?id='.$id.'" method="POST">'."\n";
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'" />'; print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'" />';
print '<input type="hidden" name="action" value="addgroup" />'; print '<input type="hidden" name="action" value="addgroup" />';

View File

@ -278,8 +278,7 @@ else
*/ */
if ($action == 'delete') if ($action == 'delete')
{ {
$ret=$form->form_confirm($_SERVER['PHP_SELF']."?id=".$object->id,$langs->trans("DeleteAGroup"),$langs->trans("ConfirmDeleteGroup",$object->name),"confirm_delete", '',0,1); print $form->formconfirm($_SERVER['PHP_SELF']."?id=".$object->id,$langs->trans("DeleteAGroup"),$langs->trans("ConfirmDeleteGroup",$object->name),"confirm_delete", '',0,1);
if ($ret == 'html') print '<br>';
} }
/* /*