Skip to content

Commit

Permalink
Migrated old message notifications to the """new""" system
Browse files Browse the repository at this point in the history
  • Loading branch information
marcosgdf committed Jul 19, 2014
1 parent 2564413 commit 434bb1b
Show file tree
Hide file tree
Showing 26 changed files with 156 additions and 274 deletions.
8 changes: 2 additions & 6 deletions htdocs/adherents/admin/adherent.php
Expand Up @@ -68,11 +68,11 @@

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');
}
}

Expand Down Expand Up @@ -117,10 +117,6 @@

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">';
Expand Down
4 changes: 2 additions & 2 deletions htdocs/adherents/ldap.php
Expand Up @@ -75,12 +75,12 @@

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();
}
}
Expand Down
2 changes: 0 additions & 2 deletions htdocs/admin/external_rss.php
Expand Up @@ -105,7 +105,6 @@
if ($result1 && $result2)
{
$db->commit();
//$mesg='<div class="ok">'.$langs->trans("Success").'</div>';
header("Location: ".$_SERVER["PHP_SELF"]);
exit;
}
Expand Down Expand Up @@ -171,7 +170,6 @@
if ($result1 && $result2)
{
$db->commit();
//$mesg='<div class="ok">'.$langs->trans("Success").'</div>';
header("Location: external_rss.php");
exit;
}
Expand Down
27 changes: 11 additions & 16 deletions htdocs/admin/menus/edit.php
Expand Up @@ -39,7 +39,6 @@
$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;
Expand Down Expand Up @@ -79,16 +78,16 @@
$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";
Expand Down Expand Up @@ -136,37 +135,37 @@
$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++;
}
Expand Down Expand Up @@ -205,7 +204,7 @@
else
{
$action = 'create';
$mesg='<div class="error">'.$menu->error.'</div>';
setEventMessage($menu->error, 'errors');
}
}
}
Expand All @@ -223,7 +222,7 @@
$this->db->commit();

llxHeader();
print '<div class="ok">'.$langs->trans("MenuDeleted").'</div>';
setEventMessage($langs->trans("MenuDeleted"));
llxFooter();
exit ;
}
Expand Down Expand Up @@ -375,8 +374,6 @@ function init_topleft()
print '<input type="submit" class="button" name="cancel" value="'.$langs->trans("Cancel").'"></center>';

print '</form>';

dol_htmloutput_mesg($mesg);
}
elseif ($action == 'edit')
{
Expand Down Expand Up @@ -463,8 +460,6 @@ function init_topleft()
print '</form>';

print '<br>';

dol_htmloutput_mesg($mesg);
}


Expand Down
12 changes: 4 additions & 8 deletions htdocs/admin/tools/update.php
Expand Up @@ -54,15 +54,15 @@
if (! $original_file)
{
$langs->load("Error");
$mesg = '<div class="warning">'.$langs->trans("ErrorFileRequired").'</div>';
setEventMessage($langs->trans("ErrorFileRequired"), 'warnings');
$error++;
}
else
{
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++;
}
}
Expand All @@ -80,12 +80,11 @@
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"));
}
}
}
Expand All @@ -107,9 +106,6 @@
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>';
Expand Down
34 changes: 14 additions & 20 deletions htdocs/comm/mailing/fiche.php
Expand Up @@ -107,7 +107,7 @@
{
if (empty($_REQUEST["clone_content"]) && empty($_REQUEST["clone_receivers"]))
{
$mesg='<div class="error">'.$langs->trans("NoCloneOptionsSpecified").'</div>';
setEventMessage($langs->trans("NoCloneOptionsSpecified"), 'errors');
}
else
{
Expand All @@ -119,7 +119,7 @@
}
else
{
$mesg=$object->error;
setEventMessage($object->error, 'errors');
}
}
$action='';
Expand All @@ -130,16 +130,17 @@
{
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
Expand Down Expand Up @@ -390,7 +391,7 @@
$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++;
}

Expand Down Expand Up @@ -430,11 +431,11 @@
$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='';
Expand Down Expand Up @@ -467,7 +468,7 @@
$mesg=$object->error;
}

$mesg='<div class="error">'.$mesg.'</div>';
setEventMessage($mesg, 'errors');
$action="create";
}

Expand All @@ -494,7 +495,7 @@
$mesg=$object->error;
}

$mesg='<div class="error">'.$mesg.'</div>';
setEventMessage($mesg, 'errors');
$action="";
}

Expand Down Expand Up @@ -552,7 +553,7 @@
$mesg=$object->error;
}

$mesg='<div class="error">'.$mesg.'</div>';
setEventMessage($mesg, 'errors');
$action="edit";
}
else
Expand Down Expand Up @@ -598,7 +599,7 @@
}
else
{
$mesg=$object->error;
setEventMessage($object->error, 'errors');
$db->rollback();
}
}
Expand Down Expand Up @@ -646,8 +647,6 @@

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>';
Expand Down Expand Up @@ -829,9 +828,6 @@
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
*/
Expand Down Expand Up @@ -1017,8 +1013,6 @@
* Mailing en mode edition
*/

dol_htmloutput_mesg($mesg);

print '<table class="border" width="100%">';

// Ref
Expand Down

0 comments on commit 434bb1b

Please sign in to comment.