Migrated old message notifications to the """new""" system
This commit is contained in:
parent
2564413a70
commit
434bb1bec7
@ -68,11 +68,11 @@ if ($action == 'update' || $action == 'add')
|
||||
|
||||
if (! $error)
|
||||
{
|
||||
$mesg = '<div class="ok">'.$langs->trans("SetupSaved").'</div>';
|
||||
setEventMessage($langs->trans("SetupSaved"));
|
||||
}
|
||||
else
|
||||
{
|
||||
$mesg = '<div class="error">'.$langs->trans("Error").'</div>';
|
||||
setEventMessage($langs->trans("Error"), 'errors');
|
||||
}
|
||||
}
|
||||
|
||||
@ -117,10 +117,6 @@ $head = member_admin_prepare_head();
|
||||
|
||||
dol_fiche_head($head, 'general', $langs->trans("Members"), 0, 'user');
|
||||
|
||||
|
||||
dol_htmloutput_mesg($mesg);
|
||||
|
||||
|
||||
print_fiche_titre($langs->trans("MemberMainOptions"),'','');
|
||||
print '<table class="noborder" width="100%">';
|
||||
print '<tr class="liste_titre">';
|
||||
|
||||
@ -75,12 +75,12 @@ if ($action == 'dolibarr2ldap')
|
||||
|
||||
if ($result >= 0)
|
||||
{
|
||||
$message.='<div class="ok">'.$langs->trans("MemberSynchronized").'</div>';
|
||||
setEventMessage($langs->trans("MemberSynchronized"));
|
||||
$db->commit();
|
||||
}
|
||||
else
|
||||
{
|
||||
$message.='<div class="error">'.$ldap->error.'</div>';
|
||||
setEventMessage($ldap->error, 'errors');
|
||||
$db->rollback();
|
||||
}
|
||||
}
|
||||
|
||||
@ -105,7 +105,6 @@ if ($action == 'add' || GETPOST("modify"))
|
||||
if ($result1 && $result2)
|
||||
{
|
||||
$db->commit();
|
||||
//$mesg='<div class="ok">'.$langs->trans("Success").'</div>';
|
||||
header("Location: ".$_SERVER["PHP_SELF"]);
|
||||
exit;
|
||||
}
|
||||
@ -171,7 +170,6 @@ if ($_POST["delete"])
|
||||
if ($result1 && $result2)
|
||||
{
|
||||
$db->commit();
|
||||
//$mesg='<div class="ok">'.$langs->trans("Success").'</div>';
|
||||
header("Location: external_rss.php");
|
||||
exit;
|
||||
}
|
||||
|
||||
@ -39,7 +39,6 @@ $dirsmartphone = "/core/menus/smartphone";
|
||||
$dirmenu = array($dirstandard,$dirsmartphone);
|
||||
|
||||
$action=GETPOST('action');
|
||||
$mesg=GETPOST('mesg');
|
||||
|
||||
$menu_handler_top=$conf->global->MAIN_MENU_STANDARD;
|
||||
$menu_handler_smartphone=$conf->global->MAIN_MENU_SMARTPHONE;
|
||||
@ -79,16 +78,16 @@ if ($action == 'update')
|
||||
$result=$menu->update($user);
|
||||
if ($result > 0)
|
||||
{
|
||||
$mesg='<div class="ok">'.$langs->trans("RecordModifiedSuccessfully").'</div>';
|
||||
setEventMessage($langs->trans("RecordModifiedSuccessfully"));
|
||||
}
|
||||
else
|
||||
{
|
||||
$mesg='<div class="error">'.$menu->error.'</div>';
|
||||
setEventMessage($menu->error, 'errors');
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$mesg='<div class="error">'.$menu->error.'</div>';
|
||||
setEventMessage($menu->error, 'errors');
|
||||
}
|
||||
$_GET["menuId"] = $_POST['menuId'];
|
||||
$action = "edit";
|
||||
@ -136,37 +135,37 @@ if ($action == 'add')
|
||||
$error=0;
|
||||
if (! $error && ! $_POST['menu_handler'])
|
||||
{
|
||||
$mesg='<div class="error">'.$langs->trans("ErrorFieldRequired",$langs->transnoentities("MenuHandler")).'</div>';
|
||||
setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentities("MenuHandler")), 'errors');
|
||||
$action = 'create';
|
||||
$error++;
|
||||
}
|
||||
if (! $error && ! $_POST['type'])
|
||||
{
|
||||
$mesg='<div class="error">'.$langs->trans("ErrorFieldRequired",$langs->transnoentities("Type")).'</div>';
|
||||
setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentities("Type")), 'errors');
|
||||
$action = 'create';
|
||||
$error++;
|
||||
}
|
||||
if (! $error && ! $_POST['url'])
|
||||
{
|
||||
$mesg='<div class="error">'.$langs->trans("ErrorFieldRequired",$langs->trans("Url")).'</div>';
|
||||
setEventMessage($langs->trans("ErrorFieldRequired",$langs->trans("Url")), 'errors');
|
||||
$action = 'create';
|
||||
$error++;
|
||||
}
|
||||
if (! $error && ! $_POST['titre'])
|
||||
{
|
||||
$mesg='<div class="error">'.$langs->trans("ErrorFieldRequired",$langs->trans("Title")).'</div>';
|
||||
setEventMessage($langs->trans("ErrorFieldRequired",$langs->trans("Title")), 'errors');
|
||||
$action = 'create';
|
||||
$error++;
|
||||
}
|
||||
if (! $error && $_POST['menuId'] && $_POST['type'] == 'top')
|
||||
{
|
||||
$mesg='<div class="error">'.$langs->trans("ErrorTopMenuMustHaveAParentWithId0").'</div>';
|
||||
setEventMessage($langs->trans("ErrorTopMenuMustHaveAParentWithId0"), 'errors');
|
||||
$action = 'create';
|
||||
$error++;
|
||||
}
|
||||
if (! $error && empty($_POST['menuId']) && $_POST['type'] == 'left')
|
||||
{
|
||||
$mesg='<div class="error">'.$langs->trans("ErrorLeftMenuMustHaveAParentId").'</div>';
|
||||
setEventMessage($langs->trans("ErrorLeftMenuMustHaveAParentId"), 'errors');
|
||||
$action = 'create';
|
||||
$error++;
|
||||
}
|
||||
@ -205,7 +204,7 @@ if ($action == 'add')
|
||||
else
|
||||
{
|
||||
$action = 'create';
|
||||
$mesg='<div class="error">'.$menu->error.'</div>';
|
||||
setEventMessage($menu->error, 'errors');
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -223,7 +222,7 @@ if ($action == 'confirm_delete' && $_POST["confirm"] == 'yes')
|
||||
$this->db->commit();
|
||||
|
||||
llxHeader();
|
||||
print '<div class="ok">'.$langs->trans("MenuDeleted").'</div>';
|
||||
setEventMessage($langs->trans("MenuDeleted"));
|
||||
llxFooter();
|
||||
exit ;
|
||||
}
|
||||
@ -375,8 +374,6 @@ if ($action == 'create')
|
||||
print '<input type="submit" class="button" name="cancel" value="'.$langs->trans("Cancel").'"></center>';
|
||||
|
||||
print '</form>';
|
||||
|
||||
dol_htmloutput_mesg($mesg);
|
||||
}
|
||||
elseif ($action == 'edit')
|
||||
{
|
||||
@ -463,8 +460,6 @@ elseif ($action == 'edit')
|
||||
print '</form>';
|
||||
|
||||
print '<br>';
|
||||
|
||||
dol_htmloutput_mesg($mesg);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -54,7 +54,7 @@ if (GETPOST('action','alpha')=='install')
|
||||
if (! $original_file)
|
||||
{
|
||||
$langs->load("Error");
|
||||
$mesg = '<div class="warning">'.$langs->trans("ErrorFileRequired").'</div>';
|
||||
setEventMessage($langs->trans("ErrorFileRequired"), 'warnings');
|
||||
$error++;
|
||||
}
|
||||
else
|
||||
@ -62,7 +62,7 @@ if (GETPOST('action','alpha')=='install')
|
||||
if (! preg_match('/\.zip/i',$original_file))
|
||||
{
|
||||
$langs->load("errors");
|
||||
$mesg = '<div class="error">'.$langs->trans("ErrorFileMustBeADolibarrPackage",$original_file).'</div>';
|
||||
setEventMessage($langs->trans("ErrorFileMustBeADolibarrPackage",$original_file), 'errors');
|
||||
$error++;
|
||||
}
|
||||
}
|
||||
@ -80,12 +80,11 @@ if (GETPOST('action','alpha')=='install')
|
||||
if (! empty($result['error']))
|
||||
{
|
||||
$langs->load("errors");
|
||||
$mesg = '<div class="error">'.$langs->trans($result['error'],$original_file).'</div>';
|
||||
|
||||
setEventMessage($langs->trans($result['error'],$original_file), 'errors');
|
||||
}
|
||||
else
|
||||
{
|
||||
$mesg = '<div class="ok">'.$langs->trans("SetupIsReadyForUse").'</div>';
|
||||
setEventMessage($langs->trans("SetupIsReadyForUse"));
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -107,9 +106,6 @@ print $langs->trans("CurrentVersion").' : <b>'.DOL_VERSION.'</b><br>';
|
||||
print $langs->trans("LastStableVersion").' : <b>'.$langs->trans("FeatureNotYetAvailable").'</b><br>';
|
||||
print '<br>';
|
||||
|
||||
//dol_htmloutput_errors($mesg);
|
||||
dol_htmloutput_mesg($mesg);
|
||||
|
||||
print $langs->trans("Upgrade").'<br>';
|
||||
print '<hr>';
|
||||
print $langs->trans("ThisIsProcessToFollow").'<br>';
|
||||
|
||||
@ -107,7 +107,7 @@ if ($action == 'confirm_clone' && $confirm == 'yes')
|
||||
{
|
||||
if (empty($_REQUEST["clone_content"]) && empty($_REQUEST["clone_receivers"]))
|
||||
{
|
||||
$mesg='<div class="error">'.$langs->trans("NoCloneOptionsSpecified").'</div>';
|
||||
setEventMessage($langs->trans("NoCloneOptionsSpecified"), 'errors');
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -119,7 +119,7 @@ if ($action == 'confirm_clone' && $confirm == 'yes')
|
||||
}
|
||||
else
|
||||
{
|
||||
$mesg=$object->error;
|
||||
setEventMessage($object->error, 'errors');
|
||||
}
|
||||
}
|
||||
$action='';
|
||||
@ -130,16 +130,17 @@ if ($action == 'sendallconfirmed' && $confirm == 'yes')
|
||||
{
|
||||
if (empty($conf->global->MAILING_LIMIT_SENDBYWEB))
|
||||
{
|
||||
//TODO: What is this for?
|
||||
// Pour des raisons de securite, on ne permet pas cette fonction via l'IHM,
|
||||
// on affiche donc juste un message
|
||||
$mesg='<div class="warning">'.$langs->trans("MailingNeedCommand").'</div>';
|
||||
$mesg.='<br><textarea cols="70" rows="'.ROWS_2.'" wrap="soft">php ./scripts/emailings/mailing-send.php '.$object->id.'</textarea>';
|
||||
$mesg.='<br><br><div class="warning">'.$langs->trans("MailingNeedCommand2").'</div>';
|
||||
setEventMessage($langs->trans("MailingNeedCommand"), 'warnings');
|
||||
setEventMessage('<textarea cols="70" rows="'.ROWS_2.'" wrap="soft">php ./scripts/emailings/mailing-send.php '.$object->id.'</textarea>', 'warnings');
|
||||
setEventMessage($langs->trans("MailingNeedCommand2"), 'warnings');
|
||||
$action='';
|
||||
}
|
||||
else if ($conf->global->MAILING_LIMIT_SENDBYWEB < 0)
|
||||
{
|
||||
$mesg='<div class="warning">'.$langs->trans("NotEnoughPermissions").'</div>';
|
||||
setEventMessage($langs->trans("NotEnoughPermissions"), 'warnings');
|
||||
$action='';
|
||||
}
|
||||
else
|
||||
@ -390,7 +391,7 @@ if ($action == 'send' && empty($_POST["cancel"]))
|
||||
$object->sendto = $_POST["sendto"];
|
||||
if (! $object->sendto)
|
||||
{
|
||||
$mesg='<div class="error">'.$langs->trans("ErrorFieldRequired",$langs->trans("MailTo")).'</div>';
|
||||
setEventMessage($langs->trans("ErrorFieldRequired",$langs->trans("MailTo")), 'errors');
|
||||
$error++;
|
||||
}
|
||||
|
||||
@ -430,11 +431,11 @@ if ($action == 'send' && empty($_POST["cancel"]))
|
||||
$result=$mailfile->sendfile();
|
||||
if ($result)
|
||||
{
|
||||
$mesg='<div class="ok">'.$langs->trans("MailSuccessfulySent",$mailfile->getValidAddress($object->email_from,2),$mailfile->getValidAddress($object->sendto,2)).'</div>';
|
||||
setEventMessage($langs->trans("MailSuccessfulySent",$mailfile->getValidAddress($object->email_from,2),$mailfile->getValidAddress($object->sendto,2)));
|
||||
}
|
||||
else
|
||||
{
|
||||
$mesg='<div class="error">'.$langs->trans("ResultKo").'<br>'.$mailfile->error.' '.$result.'</div>';
|
||||
setEventMessage($langs->trans("ResultKo").'<br>'.$mailfile->error.' '.$result, 'errors');
|
||||
}
|
||||
|
||||
$action='';
|
||||
@ -467,7 +468,7 @@ if ($action == 'add')
|
||||
$mesg=$object->error;
|
||||
}
|
||||
|
||||
$mesg='<div class="error">'.$mesg.'</div>';
|
||||
setEventMessage($mesg, 'errors');
|
||||
$action="create";
|
||||
}
|
||||
|
||||
@ -494,7 +495,7 @@ if ($action == 'settitre' || $action == 'setemail_from' || $actino == 'setreplyt
|
||||
$mesg=$object->error;
|
||||
}
|
||||
|
||||
$mesg='<div class="error">'.$mesg.'</div>';
|
||||
setEventMessage($mesg, 'errors');
|
||||
$action="";
|
||||
}
|
||||
|
||||
@ -552,7 +553,7 @@ if ($action == 'update' && empty($_POST["removedfile"]) && empty($_POST["cancel"
|
||||
$mesg=$object->error;
|
||||
}
|
||||
|
||||
$mesg='<div class="error">'.$mesg.'</div>';
|
||||
setEventMessage($mesg, 'errors');
|
||||
$action="edit";
|
||||
}
|
||||
else
|
||||
@ -598,7 +599,7 @@ if ($action == 'confirm_reset' && $confirm == 'yes')
|
||||
}
|
||||
else
|
||||
{
|
||||
$mesg=$object->error;
|
||||
setEventMessage($object->error, 'errors');
|
||||
$db->rollback();
|
||||
}
|
||||
}
|
||||
@ -646,8 +647,6 @@ if ($action == 'create')
|
||||
|
||||
print_fiche_titre($langs->trans("NewMailing"));
|
||||
|
||||
dol_htmloutput_mesg($mesg);
|
||||
|
||||
print '<table class="border" width="100%">';
|
||||
print '<tr><td width="25%" class="fieldrequired">'.$langs->trans("MailTitle").'</td><td><input class="flat" name="titre" size="40" value="'.$_POST['titre'].'"></td></tr>';
|
||||
print '<tr><td width="25%" class="fieldrequired">'.$langs->trans("MailFrom").'</td><td><input class="flat" name="from" size="40" value="'.$conf->global->MAILING_EMAIL_FROM.'"></td></tr>';
|
||||
@ -829,9 +828,6 @@ else
|
||||
print $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id,$langs->trans('CloneEMailing'),$langs->trans('ConfirmCloneEMailing',$object->ref),'confirm_clone',$formquestion,'yes',2,240);
|
||||
}
|
||||
|
||||
|
||||
dol_htmloutput_mesg($mesg);
|
||||
|
||||
/*
|
||||
* Boutons d'action
|
||||
*/
|
||||
@ -1017,8 +1013,6 @@ else
|
||||
* Mailing en mode edition
|
||||
*/
|
||||
|
||||
dol_htmloutput_mesg($mesg);
|
||||
|
||||
print '<table class="border" width="100%">';
|
||||
|
||||
// Ref
|
||||
|
||||
@ -45,8 +45,6 @@ if ($user->societe_id) $socid=$user->societe_id;
|
||||
// TODO ajouter regle pour restreindre acces paiement
|
||||
//$result = restrictedArea($user, 'facture', $id,'');
|
||||
|
||||
$mesg='';
|
||||
|
||||
$object = new Paiement($db);
|
||||
|
||||
|
||||
@ -67,7 +65,7 @@ if ($action == 'setnote' && $user->rights->facture->paiement)
|
||||
}
|
||||
else
|
||||
{
|
||||
$mesg='<div class="error">'.$object->error.'</div>';
|
||||
setEventMessage($object->error, 'errors');
|
||||
$db->rollback();
|
||||
}
|
||||
}
|
||||
@ -87,7 +85,7 @@ if ($action == 'confirm_delete' && $confirm == 'yes' && $user->rights->facture->
|
||||
else
|
||||
{
|
||||
$langs->load("errors");
|
||||
$mesg='<div class="error">'.$langs->trans($object->error).'</div>';
|
||||
setEventMessage($langs->trans($object->error), 'errors');
|
||||
$db->rollback();
|
||||
}
|
||||
}
|
||||
@ -123,7 +121,7 @@ if ($action == 'confirm_valide' && $confirm == 'yes' && $user->rights->facture->
|
||||
else
|
||||
{
|
||||
$langs->load("errors");
|
||||
$mesg='<div class="error">'.$langs->trans($object->error).'</div>';
|
||||
setEventMessage($langs->trans($object->error), 'errors');
|
||||
$db->rollback();
|
||||
}
|
||||
}
|
||||
@ -134,11 +132,11 @@ if ($action == 'setnum_paiement' && ! empty($_POST['num_paiement']))
|
||||
$res = $object->update_num($_POST['num_paiement']);
|
||||
if ($res === 0)
|
||||
{
|
||||
$mesg = '<div class="ok">'.$langs->trans('PaymentNumberUpdateSucceeded').'</div>';
|
||||
setEventMessage($langs->trans('PaymentNumberUpdateSucceeded'));
|
||||
}
|
||||
else
|
||||
{
|
||||
$mesg = '<div class="error">'.$langs->trans('PaymentNumberUpdateFailed').'</div>';
|
||||
setEventMessage($langs->trans('PaymentNumberUpdateFailed'), 'errors');
|
||||
}
|
||||
}
|
||||
|
||||
@ -149,11 +147,11 @@ if ($action == 'setdatep' && ! empty($_POST['datepday']))
|
||||
$res = $object->update_date($datepaye);
|
||||
if ($res === 0)
|
||||
{
|
||||
$mesg = '<div class="ok">'.$langs->trans('PaymentDateUpdateSucceeded').'</div>';
|
||||
setEventMessage($langs->trans('PaymentDateUpdateSucceeded'));
|
||||
}
|
||||
else
|
||||
{
|
||||
$mesg = '<div class="error">'.$langs->trans('PaymentDateUpdateFailed').'</div>';
|
||||
setEventMessage($langs->trans('PaymentDateUpdateFailed'), 'errors');
|
||||
}
|
||||
}
|
||||
|
||||
@ -198,10 +196,6 @@ if ($action == 'valide')
|
||||
|
||||
}
|
||||
|
||||
|
||||
dol_htmloutput_mesg($mesg);
|
||||
|
||||
|
||||
print '<table class="border" width="100%">';
|
||||
|
||||
// Ref
|
||||
|
||||
@ -110,13 +110,9 @@ if ($action == 'add' && $user->rights->tax->charges->creer)
|
||||
$chargesociales->amount=$_POST["amount"];
|
||||
|
||||
$id=$chargesociales->create($user);
|
||||
if ($id > 0)
|
||||
if ($id <= 0)
|
||||
{
|
||||
//$mesg='<div class="ok">'.$langs->trans("SocialContributionAdded").'</div>';
|
||||
}
|
||||
else
|
||||
{
|
||||
$mesg='<div class="error">'.$chargesociales->error.'</div>';
|
||||
setEventMessage($chargesociales->error, 'errors');
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -146,13 +142,9 @@ if ($action == 'update' && ! $_POST["cancel"] && $user->rights->tax->charges->cr
|
||||
$chargesociales->periode=$dateperiod;
|
||||
|
||||
$result=$chargesociales->update($user);
|
||||
if ($result > 0)
|
||||
if ($result <= 0)
|
||||
{
|
||||
//$mesg='<div class="ok">'.$langs->trans("SocialContributionAdded").'</div>';
|
||||
}
|
||||
else
|
||||
{
|
||||
$mesg='<div class="error">'.$chargesociales->error.'</div>';
|
||||
setEventMessage($chargesociales->error, 'errors');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -49,8 +49,6 @@ $contact->fetch($id, $user);
|
||||
|
||||
if ($action == 'dolibarr2ldap')
|
||||
{
|
||||
$message="";
|
||||
|
||||
$db->begin();
|
||||
|
||||
$ldap=new Ldap();
|
||||
@ -64,12 +62,12 @@ if ($action == 'dolibarr2ldap')
|
||||
|
||||
if ($result >= 0)
|
||||
{
|
||||
$message.='<div class="ok">'.$langs->trans("ContactSynchronized").'</div>';
|
||||
setEventMessage($langs->trans("ContactSynchronized"));
|
||||
$db->commit();
|
||||
}
|
||||
else
|
||||
{
|
||||
$message.='<div class="error">'.$ldap->error.'</div>';
|
||||
setEventMessage($ldap->error, 'errors');
|
||||
$db->rollback();
|
||||
}
|
||||
}
|
||||
@ -136,10 +134,6 @@ print '</table>';
|
||||
|
||||
print '</div>';
|
||||
|
||||
|
||||
dol_htmloutput_mesg($message);
|
||||
|
||||
|
||||
/*
|
||||
* Barre d'actions
|
||||
*/
|
||||
|
||||
@ -137,8 +137,6 @@ class mailing_xinputfile extends MailingTargets
|
||||
{
|
||||
$cpt=0;
|
||||
|
||||
//$mesg = '<div class="ok">'.$langs->trans("FileTransferComplete").'</div>';
|
||||
//print_r($_FILES);
|
||||
$file=$upload_dir . "/" . $_FILES['username']['name'];
|
||||
$handle = @fopen($file, "r");
|
||||
if ($handle)
|
||||
|
||||
@ -110,8 +110,6 @@ if (GETPOST("sendit") && ! empty($conf->global->MAIN_UPLOAD_DOC))
|
||||
$resupload = dol_move_uploaded_file($_FILES['userfile']['tmp_name'], $upload_dir . "/" . dol_unescapefile($_FILES['userfile']['name']),0, 0, $_FILES['userfile']['error']);
|
||||
if (is_numeric($resupload) && $resupload > 0)
|
||||
{
|
||||
//$mesg = '<div class="ok">'.$langs->trans("FileTransferComplete").'</div>';
|
||||
//print_r($_FILES);
|
||||
$result=$ecmdir->changeNbOfFiles('+');
|
||||
}
|
||||
else
|
||||
@ -134,7 +132,7 @@ if (GETPOST("sendit") && ! empty($conf->global->MAIN_UPLOAD_DOC))
|
||||
else
|
||||
{
|
||||
$langs->load("errors");
|
||||
$mesg = '<div class="error">'.$langs->trans("ErrorFailToCreateDir",$upload_dir).'</div>';
|
||||
setEventMessage($langs->trans("ErrorFailToCreateDir",$upload_dir), 'errors');
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -156,7 +154,7 @@ if ($action == 'add' && $user->rights->ecm->setup)
|
||||
}
|
||||
else
|
||||
{
|
||||
$mesg='<div class="error">Error '.$langs->trans($ecmdir->error).'</div>';
|
||||
setEventMessage('Error '.$langs->trans($ecmdir->error), 'errors');
|
||||
$action = "create";
|
||||
}
|
||||
|
||||
@ -198,7 +196,7 @@ if ($action == 'confirm_deletefile')
|
||||
if ($action == 'confirm_deletesection' && GETPOST('confirm') == 'yes')
|
||||
{
|
||||
$result=$ecmdir->delete($user);
|
||||
$mesg = '<div class="ok">'.$langs->trans("ECMSectionWasRemoved", $ecmdir->label).'</div>';
|
||||
setEventMessage($langs->trans("ECMSectionWasRemoved", $ecmdir->label));
|
||||
|
||||
clearstatcache();
|
||||
}
|
||||
@ -324,7 +322,6 @@ if ($action == 'refreshmanual')
|
||||
$dirtotest=$conf->ecm->dir_output.'/'.$dirdesc['fullrelativename'];
|
||||
if (! dol_is_dir($dirtotest))
|
||||
{
|
||||
$mesg.=$dirtotest." not found onto disk. We delete from database dir with id=".$dirdesc['id']."<br>\n";
|
||||
$ecmdirtmp->id=$dirdesc['id'];
|
||||
$ecmdirtmp->delete($user,'databaseonly');
|
||||
//exit;
|
||||
@ -440,9 +437,6 @@ if ($action == 'delete' && empty($conf->use_javascript_ajax))
|
||||
|
||||
}
|
||||
|
||||
dol_htmloutput_mesg($mesg);
|
||||
|
||||
|
||||
if (! empty($conf->use_javascript_ajax)) $classviewhide='hidden';
|
||||
else $classviewhide='visible';
|
||||
|
||||
|
||||
@ -110,8 +110,6 @@ if (GETPOST("sendit") && ! empty($conf->global->MAIN_UPLOAD_DOC))
|
||||
$resupload = dol_move_uploaded_file($_FILES['userfile']['tmp_name'], $upload_dir . "/" . dol_unescapefile($_FILES['userfile']['name']),0, 0, $_FILES['userfile']['error']);
|
||||
if (is_numeric($resupload) && $resupload > 0)
|
||||
{
|
||||
//$mesg = '<div class="ok">'.$langs->trans("FileTransferComplete").'</div>';
|
||||
//print_r($_FILES);
|
||||
$result=$ecmdir->changeNbOfFiles('+');
|
||||
}
|
||||
else
|
||||
@ -134,7 +132,7 @@ if (GETPOST("sendit") && ! empty($conf->global->MAIN_UPLOAD_DOC))
|
||||
else
|
||||
{
|
||||
$langs->load("errors");
|
||||
$mesg = '<div class="error">'.$langs->trans("ErrorFailToCreateDir",$upload_dir).'</div>';
|
||||
setEventMessage($langs->trans("ErrorFailToCreateDir",$upload_dir), 'errors');
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -156,7 +154,8 @@ if ($action == 'add' && $user->rights->ecm->setup)
|
||||
}
|
||||
else
|
||||
{
|
||||
$mesg='<div class="error">Error '.$langs->trans($ecmdir->error).'</div>';
|
||||
//TODO: Translate
|
||||
setEventMessage('Error '.$langs->trans($ecmdir->error), 'errors');
|
||||
$action = "create";
|
||||
}
|
||||
|
||||
@ -198,7 +197,7 @@ if ($action == 'confirm_deletefile')
|
||||
if ($action == 'confirm_deletesection' && GETPOST('confirm') == 'yes')
|
||||
{
|
||||
$result=$ecmdir->delete($user);
|
||||
$mesg = '<div class="ok">'.$langs->trans("ECMSectionWasRemoved", $ecmdir->label).'</div>';
|
||||
setEventMessage($langs->trans("ECMSectionWasRemoved", $ecmdir->label));
|
||||
|
||||
clearstatcache();
|
||||
}
|
||||
@ -324,7 +323,6 @@ if ($action == 'refreshmanual')
|
||||
$dirtotest=$conf->ecm->dir_output.'/'.$dirdesc['fullrelativename'];
|
||||
if (! dol_is_dir($dirtotest))
|
||||
{
|
||||
$mesg.=$dirtotest." not found onto disk. We delete from database dir with id=".$dirdesc['id']."<br>\n";
|
||||
$ecmdirtmp->id=$dirdesc['id'];
|
||||
$ecmdirtmp->delete($user,'databaseonly');
|
||||
//exit;
|
||||
@ -436,9 +434,6 @@ if ($action == 'delete' && empty($conf->use_javascript_ajax))
|
||||
|
||||
}
|
||||
|
||||
dol_htmloutput_mesg($mesg);
|
||||
|
||||
|
||||
if (! empty($conf->use_javascript_ajax)) $classviewhide='hidden';
|
||||
else $classviewhide='visible';
|
||||
|
||||
|
||||
@ -36,8 +36,6 @@ $langs->load('banks');
|
||||
$langs->load('companies');
|
||||
$langs->load("suppliers");
|
||||
|
||||
$mesg='';
|
||||
|
||||
$id = GETPOST('id','int');
|
||||
$action = GETPOST('action','alpha');
|
||||
$confirm = GETPOST('confirm','alpha');
|
||||
@ -61,7 +59,7 @@ if ($action == 'setnote' && $user->rights->fournisseur->facture->creer)
|
||||
}
|
||||
else
|
||||
{
|
||||
$mesg='<div class="error">'.$object->error.'</div>';
|
||||
setEventMessage($object->error, 'errors');
|
||||
$db->rollback();
|
||||
}
|
||||
}
|
||||
@ -80,7 +78,7 @@ if ($action == 'confirm_delete' && $confirm == 'yes' && $user->rights->fournisse
|
||||
}
|
||||
else
|
||||
{
|
||||
$mesg='<div class="error">'.$object->error.'</div>';
|
||||
setEventMessage($object->error, 'errors');
|
||||
$db->rollback();
|
||||
}
|
||||
}
|
||||
@ -98,7 +96,7 @@ if ($action == 'confirm_valide' && $confirm == 'yes' && $user->rights->fournisse
|
||||
}
|
||||
else
|
||||
{
|
||||
$mesg='<div class="error">'.$object->error.'</div>';
|
||||
setEventMessage($object->error, 'errors');
|
||||
$db->rollback();
|
||||
}
|
||||
}
|
||||
@ -109,11 +107,11 @@ if ($action == 'setnum_paiement' && ! empty($_POST['num_paiement']))
|
||||
$res = $object->update_num($_POST['num_paiement']);
|
||||
if ($res === 0)
|
||||
{
|
||||
$mesg = '<div class="ok">'.$langs->trans('PaymentNumberUpdateSucceeded').'</div>';
|
||||
$setEventMessage($langs->trans('PaymentNumberUpdateSucceeded'));
|
||||
}
|
||||
else
|
||||
{
|
||||
$mesg = '<div class="error">'.$langs->trans('PaymentNumberUpdateFailed').'</div>';
|
||||
setEventMessage($langs->trans('PaymentNumberUpdateFailed'), 'errors');
|
||||
}
|
||||
}
|
||||
|
||||
@ -124,11 +122,11 @@ if ($action == 'setdatep' && ! empty($_POST['datepday']))
|
||||
$res = $object->update_date($datepaye);
|
||||
if ($res === 0)
|
||||
{
|
||||
$mesg = '<div class="ok">'.$langs->trans('PaymentDateUpdateSucceeded').'</div>';
|
||||
setEventMessage($langs->trans('PaymentDateUpdateSucceeded'));
|
||||
}
|
||||
else
|
||||
{
|
||||
$mesg = '<div class="error">'.$langs->trans('PaymentDateUpdateFailed').'</div>';
|
||||
setEventMessage($langs->trans('PaymentDateUpdateFailed'), 'errors');
|
||||
}
|
||||
}
|
||||
|
||||
@ -229,8 +227,6 @@ if ($result > 0)
|
||||
|
||||
print '</table>';
|
||||
|
||||
dol_htmloutput_mesg($mesg);
|
||||
|
||||
print '<br>';
|
||||
|
||||
/**
|
||||
|
||||
@ -91,7 +91,6 @@ if ($action == 'add' || GETPOST('modify','alpha'))
|
||||
if ($result1 && $result2 && $result3 && $result4 && $result5 && $result6)
|
||||
{
|
||||
$db->commit();
|
||||
//$mesg='<div class="ok">'.$langs->trans("Success").'</div>';
|
||||
header("Location: ".$_SERVER["PHP_SELF"]);
|
||||
exit;
|
||||
}
|
||||
@ -119,7 +118,6 @@ if (GETPOST('delete','alpha'))
|
||||
if ($result1 && $result2 && $result3 && $result4 && $result5 && $result6)
|
||||
{
|
||||
$db->commit();
|
||||
//$mesg='<div class="ok">'.$langs->trans("Success").'</div>';
|
||||
header("Location: ".$_SERVER["PHP_SELF"]);
|
||||
exit;
|
||||
}
|
||||
|
||||
@ -100,8 +100,6 @@ if ( $_POST["sendit"] && ! empty($conf->global->MAIN_UPLOAD_DOC))
|
||||
$resupload = dol_move_uploaded_file($_FILES['userfile']['tmp_name'], $upload_dir . "/" . dol_unescapefile($_FILES['userfile']['name']),0);
|
||||
if (is_numeric($resupload) && $resupload > 0)
|
||||
{
|
||||
//$mesg = '<div class="ok">'.$langs->trans("FileTransferComplete").'</div>';
|
||||
//print_r($_FILES);
|
||||
$result=$ecmdir->changeNbOfFiles('+');
|
||||
}
|
||||
else {
|
||||
@ -124,7 +122,7 @@ if ( $_POST["sendit"] && ! empty($conf->global->MAIN_UPLOAD_DOC))
|
||||
{
|
||||
// Echec transfert (fichier depassant la limite ?)
|
||||
$langs->load("errors");
|
||||
$mesg = '<div class="error">'.$langs->trans("ErrorFailToCreateDir",$upload_dir).'</div>';
|
||||
setEventMessage($langs->trans("ErrorFailToCreateDir",$upload_dir), 'errors');
|
||||
}
|
||||
}
|
||||
|
||||
@ -143,7 +141,8 @@ if ($_POST["action"] == 'add' && $user->rights->ftp->setup)
|
||||
}
|
||||
else
|
||||
{
|
||||
$mesg='<div class="error">Error '.$langs->trans($ecmdir->error).'</div>';
|
||||
//TODO: Translate
|
||||
setEventMessage('Error '.$langs->trans($ecmdir->error));
|
||||
$_GET["action"] = "create";
|
||||
}
|
||||
}
|
||||
@ -175,12 +174,12 @@ if ($_REQUEST['action'] == 'confirm_deletefile' && $_REQUEST['confirm'] == 'yes'
|
||||
$result=@ftp_delete($conn_id, $newremotefileiso);
|
||||
if ($result)
|
||||
{
|
||||
$mesg = '<div class="ok">'.$langs->trans("FileWasRemoved",$file).'</div>';
|
||||
setEventMessage($langs->trans("FileWasRemoved",$file));
|
||||
}
|
||||
else
|
||||
{
|
||||
dol_syslog("ftp/index.php ftp_delete", LOG_ERR);
|
||||
$mesg = '<div class="error">'.$langs->trans("FTPFailedToRemoveFile",$file).'</div>';
|
||||
setEventMessage($langs->trans("FTPFailedToRemoveFile",$file), 'errors');
|
||||
}
|
||||
|
||||
//ftp_close($conn_id); Close later
|
||||
@ -225,12 +224,12 @@ if ($_POST["const"] && $_POST["delete"] && $_POST["delete"] == $langs->trans("De
|
||||
$result=@ftp_delete($conn_id, $newremotefileiso);
|
||||
if ($result)
|
||||
{
|
||||
$mesg .= '<div class="ok">'.$langs->trans("FileWasRemoved",$file).'</div>';
|
||||
setEventMessage($langs->trans("FileWasRemoved",$file));
|
||||
}
|
||||
else
|
||||
{
|
||||
dol_syslog("ftp/index.php ftp_delete", LOG_ERR);
|
||||
$mesg .= '<div class="error">'.$langs->trans("FTPFailedToRemoveFile",$file).'</div>';
|
||||
setEventMessage($langs->trans("FTPFailedToRemoveFile",$file), 'errors');
|
||||
}
|
||||
|
||||
//ftp_close($conn_id); Close later
|
||||
@ -269,11 +268,11 @@ if ($_REQUEST['action'] == 'confirm_deletesection' && $_REQUEST['confirm'] == 'y
|
||||
$result=@ftp_rmdir($conn_id, $newremotefileiso);
|
||||
if ($result)
|
||||
{
|
||||
$mesg = '<div class="ok">'.$langs->trans("DirWasRemoved",$file).'</div>';
|
||||
setEventMessage($langs->trans("DirWasRemoved",$file));
|
||||
}
|
||||
else
|
||||
{
|
||||
$mesg = '<div class="error">'.$langs->trans("FTPFailedToRemoveDir",$file).'</div>';
|
||||
setEventMessage($langs->trans("FTPFailedToRemoveDir",$file), 'errors');
|
||||
}
|
||||
|
||||
//ftp_close($conn_id); Close later
|
||||
@ -340,7 +339,8 @@ if ($_REQUEST['action'] == 'download')
|
||||
}
|
||||
else
|
||||
{
|
||||
$mesg='<div class="error">Failed to get file '.$remotefile.'</div>';
|
||||
//TODO: Translate
|
||||
setEventMessage('Failed to get file '.$remotefile, 'errors');
|
||||
}
|
||||
|
||||
}
|
||||
@ -444,9 +444,6 @@ else
|
||||
print '<br>';
|
||||
print "<br>\n";
|
||||
|
||||
if ($mesg) { print $mesg."<br>"; }
|
||||
|
||||
|
||||
print '<form action="'.$_SERVER["PHP_SELF"].'" method="POST">';
|
||||
print '<input type="hidden" name="numero_ftp" value="'.$numero_ftp.'">';
|
||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
@ -596,9 +593,6 @@ else
|
||||
|
||||
print "</table>";
|
||||
|
||||
|
||||
if (! $ok && $mesg) print $mesg;
|
||||
|
||||
// Actions
|
||||
/*
|
||||
if ($user->rights->ftp->write && ! empty($section))
|
||||
|
||||
@ -142,9 +142,9 @@ if ($action == "add")
|
||||
|
||||
if ($error)
|
||||
{
|
||||
$message = '<div class="error">'.$langs->trans('ErrorUpdateConfCP').'</div>';
|
||||
setEventMessage($langs->trans('ErrorUpdateConfCP'), 'errors');
|
||||
} else {
|
||||
$message = '<div class="ok">'.$langs->trans('UpdateConfCPOK').'</div>';
|
||||
setEventMessage($langs->trans('UpdateConfCPOK'));
|
||||
}
|
||||
|
||||
// Si première mise à jour, prévenir l'utilisateur de mettre à jour le solde des congés payés
|
||||
|
||||
@ -84,10 +84,7 @@ if ($action == 'update' && isset($_POST['update_cp']))
|
||||
dol_syslog('define_holiday update lastUpdate entry', LOG_DEBUG);
|
||||
$result = $db->query($sql);
|
||||
|
||||
$mesg='<div class="ok">'.$langs->trans('UpdateConfCPOK').'</div>';
|
||||
|
||||
dol_htmloutput_mesg($mesg);
|
||||
|
||||
setEventMessage($langs->trans('UpdateConfCPOK'));
|
||||
}
|
||||
elseif($action == 'add_event')
|
||||
{
|
||||
|
||||
@ -138,11 +138,11 @@ if ($action == 'builddoc')
|
||||
$result=$objimport->build_file($user, GETPOST('model','alpha'), $datatoimport, $array_match_file_to_database);
|
||||
if ($result < 0)
|
||||
{
|
||||
$mesg='<div class="error">'.$objimport->error.'</div>';
|
||||
setEventMessage($objimport->error, 'errors');
|
||||
}
|
||||
else
|
||||
{
|
||||
$mesg='<div class="ok">'.$langs->trans("FileSuccessfullyBuilt").'</div>';
|
||||
setEventMessage($langs->trans("FileSuccessfullyBuilt"));
|
||||
}
|
||||
}
|
||||
|
||||
@ -175,21 +175,23 @@ if ($action == 'add_import_model')
|
||||
$result = $objimport->create($user);
|
||||
if ($result >= 0)
|
||||
{
|
||||
$mesg='<div class="ok">'.$langs->trans("ImportModelSaved",$objimport->model_name).'</div>';
|
||||
setEventMessage($langs->trans("ImportModelSaved",$objimport->model_name));
|
||||
}
|
||||
else
|
||||
{
|
||||
$langs->load("errors");
|
||||
if ($objimport->errno == 'DB_ERROR_RECORD_ALREADY_EXISTS')
|
||||
{
|
||||
$mesg='<div class="error">'.$langs->trans("ErrorImportDuplicateProfil").'</div>';
|
||||
setEventMessage($langs->trans("ErrorImportDuplicateProfil"), 'errors');
|
||||
}
|
||||
else {
|
||||
setEventMessage($objimport->error, 'errors');
|
||||
}
|
||||
else $mesg='<div class="error">'.$objimport->error.'</div>';
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$mesg='<div class="error">'.$langs->trans("ErrorFieldRequired",$langs->transnoentities("ImportModelName")).'</div>';
|
||||
setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentities("ImportModelName")), 'errors');
|
||||
}
|
||||
}
|
||||
|
||||
@ -385,8 +387,6 @@ if ($step == 1 || ! $datatoimport)
|
||||
|
||||
dol_fiche_end();
|
||||
|
||||
if ($mesg) print $mesg;
|
||||
|
||||
}
|
||||
|
||||
|
||||
@ -461,7 +461,6 @@ if ($step == 2 && $datatoimport)
|
||||
|
||||
dol_fiche_end();
|
||||
|
||||
if ($mesg) print $mesg;
|
||||
}
|
||||
|
||||
|
||||
@ -597,10 +596,7 @@ if ($step == 3 && $datatoimport)
|
||||
|
||||
print '</table></form>';
|
||||
|
||||
|
||||
dol_fiche_end();
|
||||
|
||||
if ($mesg) print $mesg;
|
||||
}
|
||||
|
||||
|
||||
@ -1010,9 +1006,6 @@ if ($step == 4 && $datatoimport)
|
||||
print '</script>'."\n";
|
||||
}
|
||||
|
||||
|
||||
if ($mesg) print $mesg;
|
||||
|
||||
/*
|
||||
* Barre d'action
|
||||
*/
|
||||
@ -1438,8 +1431,6 @@ if ($step == 5 && $datatoimport)
|
||||
}
|
||||
print '</center>';
|
||||
}
|
||||
|
||||
if ($mesg) print $mesg;
|
||||
}
|
||||
|
||||
|
||||
@ -1679,8 +1670,6 @@ if ($step == 6 && $datatoimport)
|
||||
print $langs->trans("FileWasImported",$importid).'<br>';
|
||||
print $langs->trans("YouCanUseImportIdToFindRecord",$importid).'<br>';
|
||||
print '</center>';
|
||||
|
||||
if ($mesg) print $mesg;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -67,7 +67,7 @@ if ($action == 'setvalue' && $user->admin)
|
||||
if (! $error)
|
||||
{
|
||||
$db->commit();
|
||||
$mesg='<div class="ok">'.$langs->trans("SetupSaved").'</div>';
|
||||
setEventMessage($langs->trans("SetupSaved"));
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -227,8 +227,6 @@ if (! empty($conf->adherent->enabled))
|
||||
print "<br>";
|
||||
print info_admin($langs->trans("YouCanAddTagOnUrl"));
|
||||
|
||||
dol_htmloutput_mesg($mesg);
|
||||
|
||||
$db->close();
|
||||
dol_fiche_end();
|
||||
llxFooter();
|
||||
|
||||
@ -43,7 +43,7 @@ $rowid=GETPOST('rowid','int');
|
||||
$action=GETPOST('action', 'alpha');
|
||||
$socid=GETPOST('socid', 'int');
|
||||
$backtopage=GETPOST('backtopage','alpha');
|
||||
$error=0; $mesg = '';
|
||||
$error=0;
|
||||
|
||||
// If socid provided by ajax company selector
|
||||
if (! empty($_REQUEST['search_fourn_id']))
|
||||
@ -92,7 +92,7 @@ if ($action == 'remove_pf')
|
||||
{
|
||||
$result=$product->remove_product_fournisseur_price($rowid);
|
||||
$action = '';
|
||||
$mesg = '<div class="ok">'.$langs->trans("PriceRemoved").'.</div>';
|
||||
setEventMessage($langs->trans("PriceRemoved"));
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -112,27 +112,27 @@ if ($action == 'updateprice' && GETPOST('cancel') <> $langs->trans("Cancel"))
|
||||
if ($tva_tx == '')
|
||||
{
|
||||
$error++;
|
||||
$mesg='<div class="error">'.$langs->trans("ErrorFieldRequired",$langs->transnoentities("VATRateForSupplierProduct")).'</div>';
|
||||
setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentities("VATRateForSupplierProduct")), 'errors');
|
||||
}
|
||||
if (empty($quantity))
|
||||
{
|
||||
$error++;
|
||||
$mesg='<div class="error">'.$langs->trans("ErrorFieldRequired",$langs->transnoentities("Qty")).'</div>';
|
||||
setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentities("Qty")), 'errors');
|
||||
}
|
||||
if (empty($ref_fourn))
|
||||
{
|
||||
$error++;
|
||||
$mesg='<div class="error">'.$langs->trans("ErrorFieldRequired",$langs->transnoentities("RefSupplier")).'</div>';
|
||||
setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentities("RefSupplier")), 'errors');
|
||||
}
|
||||
if ($id_fourn <= 0)
|
||||
{
|
||||
$error++;
|
||||
$mesg='<div class="error">'.$langs->trans("ErrorFieldRequired",$langs->transnoentities("Supplier")).'</div>';
|
||||
setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentities("Supplier")), 'errors');
|
||||
}
|
||||
if ($_POST["price"] < 0 || $_POST["price"] == '')
|
||||
{
|
||||
$error++;
|
||||
$mesg='<div class="error">'.$langs->trans("ErrorFieldRequired",$langs->transnoentities("Price")).'</div>';
|
||||
setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentities("Price")), 'errors');
|
||||
}
|
||||
|
||||
$product = new ProductFournisseur($db);
|
||||
@ -140,7 +140,7 @@ if ($action == 'updateprice' && GETPOST('cancel') <> $langs->trans("Cancel"))
|
||||
if ($result <= 0)
|
||||
{
|
||||
$error++;
|
||||
$mesg=$product->error;
|
||||
setEventMessage($product->error, 'errors');
|
||||
}
|
||||
|
||||
if (! $error)
|
||||
@ -157,12 +157,12 @@ if ($action == 'updateprice' && GETPOST('cancel') <> $langs->trans("Cancel"))
|
||||
$product->fetch($product->product_id_already_linked);
|
||||
$productLink = $product->getNomUrl(1,'supplier');
|
||||
|
||||
$mesg='<div class="error">'.$langs->trans("ReferenceSupplierIsAlreadyAssociatedWithAProduct",$productLink).'</div>';
|
||||
setEventMessage($langs->trans("ReferenceSupplierIsAlreadyAssociatedWithAProduct",$productLink), 'errors');
|
||||
}
|
||||
else if ($ret < 0)
|
||||
{
|
||||
$error++;
|
||||
$mesg='<div class="error">'.$product->error.'</div>';
|
||||
setEventMessage($product->error, 'errors');
|
||||
}
|
||||
}
|
||||
|
||||
@ -177,7 +177,7 @@ if ($action == 'updateprice' && GETPOST('cancel') <> $langs->trans("Cancel"))
|
||||
if ($ret < 0)
|
||||
{
|
||||
$error++;
|
||||
$mesg='<div class="error">'.$product->error.'</div>';
|
||||
setEventMessage($product->error, 'errors');
|
||||
}
|
||||
}
|
||||
|
||||
@ -264,10 +264,6 @@ if ($id || $ref)
|
||||
|
||||
print "</div>\n";
|
||||
|
||||
|
||||
dol_htmloutput_mesg($mesg);
|
||||
|
||||
|
||||
// Form to add or update a price
|
||||
if (($action == 'add_price' || $action == 'updateprice' ) && ($user->rights->produit->creer || $user->rights->service->creer))
|
||||
{
|
||||
|
||||
@ -94,15 +94,16 @@ if ($action == 'update_price' && ! $_POST ["cancel"] && ($user->rights->produit-
|
||||
|
||||
if ($object->updatePrice($newprice, $newpricebase, $user, $newvat, $newprice_min, $level, $newnpr, $newpsq) > 0) {
|
||||
$action = '';
|
||||
$mesg = '<div class="ok">' . $langs->trans("RecordSaved") . '</div>';
|
||||
setEventMessage($langs->trans("RecordSaved"));
|
||||
} else {
|
||||
$action = 'edit_price';
|
||||
$mesg = '<div class="error">' . $object->error . '</div>';
|
||||
setEventMessage($object->error, 'errors');
|
||||
}
|
||||
} else if ($action == 'delete' && $user->rights->produit->supprimer) {
|
||||
$result = $object->log_price_delete($user, $_GET ["lineid"]);
|
||||
if ($result < 0)
|
||||
$mesg = '<div class="error">' . $object->error . '</div>';
|
||||
if ($result < 0) {
|
||||
setEventMessage($object->error, 'errors');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@ -136,11 +137,11 @@ if ($action == 'update_price_by_qty') { // Ajout / Mise à jour d'un prix par qu
|
||||
|
||||
if (empty($quantity)) {
|
||||
$error ++;
|
||||
$mesg = '<div class="error">' . $langs->trans("ErrorFieldRequired", $langs->transnoentities("Qty")) . '</div>';
|
||||
setEventMessage($langs->trans("ErrorFieldRequired", $langs->transnoentities("Qty")), 'errors');
|
||||
}
|
||||
if (empty($newprice)) {
|
||||
$error ++;
|
||||
$mesg = '<div class="error">' . $langs->trans("ErrorFieldRequired", $langs->transnoentities("Price")) . '</div>';
|
||||
setEventMessage($langs->trans("ErrorFieldRequired", $langs->transnoentities("Price")), 'errors');
|
||||
}
|
||||
if (! $error) {
|
||||
// Calcul du prix HT et du prix unitaire
|
||||
@ -547,10 +548,6 @@ print "</table>\n";
|
||||
|
||||
print "</div>\n";
|
||||
|
||||
if (! empty($mesg)) {
|
||||
dol_htmloutput_mesg($mesg);
|
||||
}
|
||||
|
||||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* Barre d'action */
|
||||
|
||||
@ -43,8 +43,6 @@ $id = GETPOST("id",'int');
|
||||
if (! $sortfield) $sortfield="p.ref";
|
||||
if (! $sortorder) $sortorder="DESC";
|
||||
|
||||
$mesg = '';
|
||||
|
||||
// Security check
|
||||
$result=restrictedArea($user,'stock');
|
||||
|
||||
@ -80,10 +78,10 @@ if ($action == 'add' && $user->rights->stock->creer)
|
||||
}
|
||||
|
||||
$action = 'create';
|
||||
$mesg='<div class="error">'.$object->error.'</div>';
|
||||
setEventMessage($object->error, 'errors');
|
||||
}
|
||||
else {
|
||||
$mesg='<div class="error">'.$langs->trans("ErrorWarehouseRefRequired").'</div>';
|
||||
setEventMessage($langs->trans("ErrorWarehouseRefRequired"), 'errors');
|
||||
$action="create"; // Force retour sur page creation
|
||||
}
|
||||
}
|
||||
@ -101,7 +99,7 @@ if ($action == 'confirm_delete' && $_REQUEST["confirm"] == 'yes' && $user->right
|
||||
}
|
||||
else
|
||||
{
|
||||
$mesg='<div class="error">'.$object->error.'</div>';
|
||||
setEventMessage($object->error, 'errors');
|
||||
$action='';
|
||||
}
|
||||
}
|
||||
@ -124,18 +122,17 @@ if ($action == 'update' && $_POST["cancel"] <> $langs->trans("Cancel"))
|
||||
if ( $object->update($id, $user) > 0)
|
||||
{
|
||||
$action = '';
|
||||
//$mesg = '<div class="ok">Fiche mise a jour</div>';
|
||||
}
|
||||
else
|
||||
{
|
||||
$action = 'edit';
|
||||
$mesg = '<div class="error">'.$object->error.'</div>';
|
||||
setEventMessage($object->error, 'errors');
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$action = 'edit';
|
||||
$mesg = '<div class="error">'.$object->error.'</div>';
|
||||
setEventMessage($object->error, 'errors');
|
||||
}
|
||||
}
|
||||
|
||||
@ -167,8 +164,6 @@ if ($action == 'create')
|
||||
print '<input type="hidden" name="action" value="add">';
|
||||
print '<input type="hidden" name="type" value="'.$type.'">'."\n";
|
||||
|
||||
dol_htmloutput_mesg($mesg);
|
||||
|
||||
print '<table class="border" width="100%">';
|
||||
|
||||
// Ref
|
||||
@ -219,8 +214,6 @@ else
|
||||
$id=GETPOST("id",'int');
|
||||
if ($id)
|
||||
{
|
||||
dol_htmloutput_mesg($mesg);
|
||||
|
||||
$object = new Entrepot($db);
|
||||
$result = $object->fetch($id);
|
||||
if ($result < 0)
|
||||
@ -496,7 +489,7 @@ else
|
||||
*/
|
||||
if (($action == 'edit' || $action == 're-edit') && 1)
|
||||
{
|
||||
print_fiche_titre($langs->trans("WarehouseEdit"), $mesg);
|
||||
$langs->trans("WarehouseEdit");
|
||||
|
||||
print '<form action="fiche.php" method="POST">';
|
||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
|
||||
@ -45,7 +45,6 @@ $action = GETPOST('action','alpha');
|
||||
$confirm = GETPOST('confirm','alpha');
|
||||
$subaction = GETPOST('subaction','alpha');
|
||||
$group = GETPOST("group","int",3);
|
||||
$message='';
|
||||
|
||||
// Define value to know what current user can do on users
|
||||
$canadduser=(! empty($user->admin) || $user->rights->user->user->creer);
|
||||
@ -110,6 +109,8 @@ if ($action == 'confirm_disable' && $confirm == "yes" && $candisableuser)
|
||||
}
|
||||
if ($action == 'confirm_enable' && $confirm == "yes" && $candisableuser)
|
||||
{
|
||||
$error = 0;
|
||||
|
||||
if ($id <> $user->id)
|
||||
{
|
||||
$object->fetch($id);
|
||||
@ -119,11 +120,12 @@ if ($action == 'confirm_enable' && $confirm == "yes" && $candisableuser)
|
||||
$nb = $object->getNbOfUsers("active");
|
||||
if ($nb >= $conf->file->main_limit_users)
|
||||
{
|
||||
$message='<div class="error">'.$langs->trans("YourQuotaOfUsersIsReached").'</div>';
|
||||
$error++;
|
||||
setEventMessage($langs->trans("YourQuotaOfUsersIsReached"), 'errors');
|
||||
}
|
||||
}
|
||||
|
||||
if (! $message)
|
||||
if (! $error)
|
||||
{
|
||||
$object->setstatus(1);
|
||||
header("Location: ".$_SERVER['PHP_SELF'].'?id='.$id);
|
||||
@ -142,7 +144,7 @@ if ($action == 'confirm_delete' && $confirm == "yes" && $candisableuser)
|
||||
if ($result < 0)
|
||||
{
|
||||
$langs->load("errors");
|
||||
$message='<div class="error">'.$langs->trans("ErrorUserCannotBeDelete").'</div>';
|
||||
setEventMessage($langs->trans("ErrorUserCannotBeDelete"), 'errors');
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -155,14 +157,18 @@ if ($action == 'confirm_delete' && $confirm == "yes" && $candisableuser)
|
||||
// Action ajout user
|
||||
if ($action == 'add' && $canadduser)
|
||||
{
|
||||
$error = 0;
|
||||
|
||||
if (! $_POST["lastname"])
|
||||
{
|
||||
$message='<div class="error">'.$langs->trans("NameNotDefined").'</div>';
|
||||
$error++;
|
||||
setEventMessage($langs->trans("NameNotDefined"), 'errors');
|
||||
$action="create"; // Go back to create page
|
||||
}
|
||||
if (! $_POST["login"])
|
||||
{
|
||||
$message='<div class="error">'.$langs->trans("LoginNotDefined").'</div>';
|
||||
$error++;
|
||||
setEventMessage($langs->trans("LoginNotDefined"), 'errors');
|
||||
$action="create"; // Go back to create page
|
||||
}
|
||||
|
||||
@ -171,13 +177,13 @@ if ($action == 'add' && $canadduser)
|
||||
$nb = $object->getNbOfUsers("active");
|
||||
if ($nb >= $conf->file->main_limit_users)
|
||||
{
|
||||
$message='<div class="error">'.$langs->trans("YourQuotaOfUsersIsReached").'</div>';
|
||||
$error++;
|
||||
setEventMessage($langs->trans("YourQuotaOfUsersIsReached"), 'errors');
|
||||
$action="create"; // Go back to create page
|
||||
}
|
||||
}
|
||||
|
||||
if (! $message)
|
||||
{
|
||||
if (!$error) {
|
||||
$object->lastname = GETPOST("lastname",'alpha');
|
||||
$object->firstname = GETPOST("firstname",'alpha');
|
||||
$object->login = GETPOST("login",'alpha');
|
||||
@ -266,7 +272,7 @@ if (($action == 'addgroup' || $action == 'removegroup') && $caneditfield)
|
||||
}
|
||||
else
|
||||
{
|
||||
$message.=$object->error;
|
||||
setEventMessage($object->error, 'errors');
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -281,13 +287,13 @@ if ($action == 'update' && ! $_POST["cancel"])
|
||||
|
||||
if (! $_POST["lastname"])
|
||||
{
|
||||
$message='<div class="error">'.$langs->trans("NameNotDefined").'</div>';
|
||||
setEventMessage($langs->trans("NameNotDefined"), 'errors');
|
||||
$action="edit"; // Go back to create page
|
||||
$error++;
|
||||
}
|
||||
if (! $_POST["login"])
|
||||
{
|
||||
$message='<div class="error">'.$langs->trans("LoginNotDefined").'</div>';
|
||||
setEventMessage($langs->trans("LoginNotDefined"), 'errors');
|
||||
$action="edit"; // Go back to create page
|
||||
$error++;
|
||||
}
|
||||
@ -304,7 +310,7 @@ if ($action == 'update' && ! $_POST["cancel"])
|
||||
$result=$tmpuser->fetch(0, GETPOST("login"));
|
||||
if ($result > 0)
|
||||
{
|
||||
$message='<div class="error">'.$langs->trans("ErrorLoginAlreadyExists").'</div>';
|
||||
setEventMessage($langs->trans("ErrorLoginAlreadyExists"), 'errors');
|
||||
$action="edit"; // Go back to create page
|
||||
$error++;
|
||||
}
|
||||
@ -367,11 +373,11 @@ if ($action == 'update' && ! $_POST["cancel"])
|
||||
if ($db->errno() == 'DB_ERROR_RECORD_ALREADY_EXISTS')
|
||||
{
|
||||
$langs->load("errors");
|
||||
$message.='<div class="error">'.$langs->trans("ErrorLoginAlreadyExists",$object->login).'</div>';
|
||||
setEventMessage($langs->trans("ErrorLoginAlreadyExists",$object->login), 'errors');
|
||||
}
|
||||
else
|
||||
{
|
||||
$message.='<div class="error">'.$object->error.'</div>';
|
||||
setEventMessage($object->error, 'errors');
|
||||
}
|
||||
}
|
||||
|
||||
@ -395,12 +401,12 @@ if ($action == 'update' && ! $_POST["cancel"])
|
||||
$sql.= " SET fk_socpeople=NULL, fk_societe=NULL";
|
||||
$sql.= " WHERE rowid=".$object->id;
|
||||
}
|
||||
dol_syslog("fiche::update", LOG_DEBUG);
|
||||
$resql=$db->query($sql);
|
||||
dol_syslog("fiche::update", LOG_DEBUG);
|
||||
if (! $resql)
|
||||
{
|
||||
$error++;
|
||||
$message.='<div class="error">'.$db->lasterror().'</div>';
|
||||
setEventMessage($db->lasterror(), 'errors');
|
||||
}
|
||||
}
|
||||
|
||||
@ -427,7 +433,7 @@ if ($action == 'update' && ! $_POST["cancel"])
|
||||
|
||||
if (! $result > 0)
|
||||
{
|
||||
$message .= '<div class="error">'.$langs->trans("ErrorFailedToSaveFile").'</div>';
|
||||
setEventMessage($langs->trans("ErrorFailedToSaveFile"), 'errors');
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -445,7 +451,7 @@ if ($action == 'update' && ! $_POST["cancel"])
|
||||
|
||||
if (! $error && ! count($object->errors))
|
||||
{
|
||||
$message.='<div class="ok">'.$langs->trans("UserModified").'</div>';
|
||||
setEventMessage($langs->trans("UserModified"));
|
||||
$db->commit();
|
||||
|
||||
$login=$_SESSION["dol_login"];
|
||||
@ -469,7 +475,7 @@ if ($action == 'update' && ! $_POST["cancel"])
|
||||
$ret=$object->setPassword($user,$_POST["password"]);
|
||||
if ($ret < 0)
|
||||
{
|
||||
$message.='<div class="error">'.$object->error.'</div>';
|
||||
setEventMessage($object->error, 'errors');
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -484,7 +490,7 @@ if ((($action == 'confirm_password' && $confirm == 'yes')
|
||||
if ($newpassword < 0)
|
||||
{
|
||||
// Echec
|
||||
$message = '<div class="error">'.$langs->trans("ErrorFailedToSetNewPassword").'</div>';
|
||||
setEventMessage($langs->trans("ErrorFailedToSetNewPassword"), 'errors');
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -493,18 +499,16 @@ if ((($action == 'confirm_password' && $confirm == 'yes')
|
||||
{
|
||||
if ($object->send_password($user,$newpassword) > 0)
|
||||
{
|
||||
$message = '<div class="ok">'.$langs->trans("PasswordChangedAndSentTo",$object->email).'</div>';
|
||||
//$message.=$newpassword;
|
||||
setEventMessage($langs->trans("PasswordChangedAndSentTo",$object->email));
|
||||
}
|
||||
else
|
||||
{
|
||||
$message = '<div class="ok">'.$langs->trans("PasswordChangedTo",$newpassword).'</div>';
|
||||
$message.= '<div class="error">'.$object->error.'</div>';
|
||||
setEventMessage($object->error, 'errors');
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$message = '<div class="ok">'.$langs->trans("PasswordChangedTo",$newpassword).'</div>';
|
||||
setEventMessage($langs->trans("PasswordChangedTo",$newpassword), 'errors');
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -562,7 +566,7 @@ if ($action == 'adduserldap')
|
||||
}
|
||||
else
|
||||
{
|
||||
$message='<div class="error">'.$ldap->error.'</div>';
|
||||
setEventMessage($ldap->error, 'errors');
|
||||
}
|
||||
}
|
||||
|
||||
@ -590,8 +594,6 @@ if (($action == 'create') || ($action == 'adduserldap'))
|
||||
print "<br>";
|
||||
print "<br>";
|
||||
|
||||
dol_htmloutput_mesg($message);
|
||||
|
||||
if (! empty($conf->ldap->enabled) && (isset($conf->global->LDAP_SYNCHRO_ACTIVE) && $conf->global->LDAP_SYNCHRO_ACTIVE == 'ldap2dolibarr'))
|
||||
{
|
||||
/*
|
||||
@ -648,12 +650,12 @@ if (($action == 'create') || ($action == 'adduserldap'))
|
||||
}
|
||||
else
|
||||
{
|
||||
$message='<div class="error">'.$ldap->error.'</div>';
|
||||
setEventMessage($ldap->error, 'errors');
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$message='<div class="error">'.$ldap->error.'</div>';
|
||||
setEventMessage($ldap->error, 'errors');
|
||||
}
|
||||
|
||||
// Si la liste des users est rempli, on affiche la liste deroulante
|
||||
@ -977,7 +979,7 @@ else
|
||||
$entries = $ldap->fetch($object->login,$userSearchFilter);
|
||||
if (! $entries)
|
||||
{
|
||||
$message .= $ldap->error;
|
||||
setEventMessage($ldap->error, 'errors');
|
||||
}
|
||||
|
||||
$passDoNotExpire = 0;
|
||||
@ -1056,8 +1058,6 @@ else
|
||||
print $form->formconfirm("fiche.php?id=$object->id",$langs->trans("DeleteAUser"),$langs->trans("ConfirmDeleteUser",$object->login),"confirm_delete", '', 0, 1);
|
||||
}
|
||||
|
||||
dol_htmloutput_mesg($message);
|
||||
|
||||
/*
|
||||
* Fiche en mode visu
|
||||
*/
|
||||
|
||||
@ -48,7 +48,6 @@ $id=GETPOST('id', 'int');
|
||||
$action=GETPOST('action', 'alpha');
|
||||
$confirm=GETPOST('confirm', 'alpha');
|
||||
$userid=GETPOST('user', 'int');
|
||||
$message='';
|
||||
|
||||
// Security check
|
||||
$result = restrictedArea($user, 'user', $id, 'usergroup&usergroup', 'user');
|
||||
@ -76,7 +75,7 @@ if ($action == 'confirm_delete' && $confirm == "yes")
|
||||
else
|
||||
{
|
||||
$langs->load("errors");
|
||||
$message = '<div class="error">'.$langs->trans('ErrorForbidden').'</div>';
|
||||
setEventMessage($langs->trans('ErrorForbidden'), 'errors');
|
||||
}
|
||||
}
|
||||
|
||||
@ -87,14 +86,10 @@ if ($action == 'add')
|
||||
{
|
||||
if ($caneditperms)
|
||||
{
|
||||
if (! $_POST["nom"])
|
||||
{
|
||||
$message='<div class="error">'.$langs->trans("NameNotDefined").'</div>';
|
||||
if (! $_POST["nom"]) {
|
||||
setEventMessage($langs->trans("NameNotDefined"), 'errors');
|
||||
$action="create"; // Go back to create page
|
||||
}
|
||||
|
||||
if (! $message)
|
||||
{
|
||||
} else {
|
||||
$object->nom = trim($_POST["nom"]);
|
||||
$object->note = trim($_POST["note"]);
|
||||
|
||||
@ -117,7 +112,7 @@ if ($action == 'add')
|
||||
$db->rollback();
|
||||
|
||||
$langs->load("errors");
|
||||
$message='<div class="error">'.$langs->trans("ErrorGroupAlreadyExists",$object->nom).'</div>';
|
||||
setEventMessage($langs->trans("ErrorGroupAlreadyExists",$object->nom), 'errors');
|
||||
$action="create"; // Go back to create page
|
||||
}
|
||||
}
|
||||
@ -125,7 +120,7 @@ if ($action == 'add')
|
||||
else
|
||||
{
|
||||
$langs->load("errors");
|
||||
$message = '<div class="error">'.$langs->trans('ErrorForbidden').'</div>';
|
||||
setEventMessage($langs->trans('ErrorForbidden'), 'errors');
|
||||
}
|
||||
}
|
||||
|
||||
@ -151,14 +146,14 @@ if ($action == 'adduser' || $action =='removeuser')
|
||||
}
|
||||
else
|
||||
{
|
||||
$message.=$edituser->error;
|
||||
setEventMessage($edituser->error, 'errors');
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$langs->load("errors");
|
||||
$message = '<div class="error">'.$langs->trans('ErrorForbidden').'</div>';
|
||||
setEventMessage($langs->trans('ErrorForbidden'), 'errors');
|
||||
}
|
||||
}
|
||||
|
||||
@ -183,19 +178,19 @@ if ($action == 'update')
|
||||
|
||||
if ($ret >= 0 && ! count($object->errors))
|
||||
{
|
||||
$message.='<div class="ok">'.$langs->trans("GroupModified").'</div>';
|
||||
setEventMessage($langs->trans("GroupModified"));
|
||||
$db->commit();
|
||||
}
|
||||
else
|
||||
{
|
||||
$message.='<div class="error">'.$object->error.'</div>';
|
||||
setEventMessage($object->error);
|
||||
$db->rollback();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$langs->load("errors");
|
||||
$message = '<div class="error">'.$langs->trans('ErrorForbidden').'</div>';
|
||||
setEventMessage($langs->trans('ErrorForbidden'));
|
||||
}
|
||||
}
|
||||
|
||||
@ -214,8 +209,6 @@ if ($action == 'create')
|
||||
{
|
||||
print_fiche_titre($langs->trans("NewGroup"));
|
||||
|
||||
if ($message) { print $message."<br>"; }
|
||||
|
||||
print dol_set_focus('#nom');
|
||||
|
||||
print '<form action="'.$_SERVER["PHP_SELF"].'" method="post">';
|
||||
@ -340,9 +333,6 @@ else
|
||||
print "</div>\n";
|
||||
print "<br>\n";
|
||||
|
||||
|
||||
dol_htmloutput_mesg($message);
|
||||
|
||||
/*
|
||||
* Liste des utilisateurs dans le groupe
|
||||
*/
|
||||
|
||||
@ -56,8 +56,6 @@ $fgroup->getrights();
|
||||
|
||||
if ($action == 'dolibarr2ldap')
|
||||
{
|
||||
$message="";
|
||||
|
||||
$db->begin();
|
||||
|
||||
$ldap=new Ldap();
|
||||
@ -71,12 +69,12 @@ if ($action == 'dolibarr2ldap')
|
||||
|
||||
if ($result >= 0)
|
||||
{
|
||||
$message.='<div class="ok">'.$langs->trans("GroupSynchronized").'</div>';
|
||||
setEventMessage($langs->trans("GroupSynchronized"));
|
||||
$db->commit();
|
||||
}
|
||||
else
|
||||
{
|
||||
$message.='<div class="error">'.$ldap->error.'</div>';
|
||||
setEventMessage($ldap->error);
|
||||
$db->rollback();
|
||||
}
|
||||
}
|
||||
@ -135,10 +133,6 @@ print "</table>\n";
|
||||
|
||||
print '</div>';
|
||||
|
||||
|
||||
dol_htmloutput_mesg($message);
|
||||
|
||||
|
||||
/*
|
||||
* Barre d'actions
|
||||
*/
|
||||
|
||||
@ -52,8 +52,6 @@ $fuser->getrights();
|
||||
|
||||
if ($_GET["action"] == 'dolibarr2ldap')
|
||||
{
|
||||
$message="";
|
||||
|
||||
$db->begin();
|
||||
|
||||
$ldap=new Ldap();
|
||||
@ -67,12 +65,12 @@ if ($_GET["action"] == 'dolibarr2ldap')
|
||||
|
||||
if ($result >= 0)
|
||||
{
|
||||
$message.='<div class="ok">'.$langs->trans("UserSynchronized").'</div>';
|
||||
setEventMessage($langs->trans("UserSynchronized"));
|
||||
$db->commit();
|
||||
}
|
||||
else
|
||||
{
|
||||
$message.='<div class="error">'.$ldap->error.'</div>';
|
||||
setEventMessage($ldap->error, 'errors');
|
||||
$db->rollback();
|
||||
}
|
||||
}
|
||||
@ -152,10 +150,6 @@ print '</table>';
|
||||
|
||||
print '</div>';
|
||||
|
||||
|
||||
dol_htmloutput_mesg($message);
|
||||
|
||||
|
||||
/*
|
||||
* Barre d'actions
|
||||
*/
|
||||
|
||||
Loading…
Reference in New Issue
Block a user