forked from Wavyzz/dolibarr
Merge branch 'develop' of git@github.com:Dolibarr/dolibarr.git into develop
This commit is contained in:
@@ -48,6 +48,9 @@ For users:
|
||||
- Fix: [ bug #992 ] Proforma invoices don't have a separated numeric count
|
||||
- New : Add pdf link into supplier invoice list and supplier order list
|
||||
- New : Genrate auto the PDF for supplier invoice
|
||||
- New : Add category into filter webservice thirdparty method getListOfThirdParties
|
||||
- New : Allow to define margin or mark rate during quoting, ordering, invoicing
|
||||
- New : User permissions on margin module
|
||||
|
||||
For translators:
|
||||
- Qual: Normalized sort order of all languages files with english reference files.
|
||||
@@ -99,6 +102,12 @@ parameter. All methods addline in this case were modified to remove this paramet
|
||||
|
||||
***** ChangeLog for 3.4.1 compared to 3.4.0 *****
|
||||
Fix: [ bug #1029 ] Tulip numbering mask
|
||||
Fix: Supplier invoice and supplier order are not displayed into object link into agenda event card
|
||||
Fix: [ bug #1033 ] SUPPLIER REF disappeared
|
||||
Fix: update extrafield do not display immediatly after update
|
||||
Fix: Fix bug with canvas thirdparty
|
||||
Fix: [ bug #1037 ] Consumption> Supplier invoices related
|
||||
Fix: User group name do not display in card (view or edit mode)
|
||||
|
||||
|
||||
***** ChangeLog for 3.4 compared to 3.3.* *****
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
/* Copyright (C) 2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2004-2008 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2005-2009 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
* Copyright (C) 2011-2012 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2011-2013 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2011-2012 Alexandre Spangaro <alexandre.spangaro@gmail.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
@@ -48,11 +48,11 @@ if ($action == 'setcomptamode')
|
||||
|
||||
if (! $error)
|
||||
{
|
||||
$mesg = "<font class=\"ok\">".$langs->trans("SetupSaved")."</font>";
|
||||
setEventMessage($langs->trans("SetupSaved"));
|
||||
}
|
||||
else
|
||||
{
|
||||
$mesg = "<font class=\"error\">".$langs->trans("Error")."</font>";
|
||||
setEventMessage($langs->trans("Error"),'errors');
|
||||
}
|
||||
|
||||
}
|
||||
@@ -67,11 +67,11 @@ if ($action == 'setchart')
|
||||
|
||||
if (! $error)
|
||||
{
|
||||
$mesg = "<font class=\"ok\">".$langs->trans("SetupSaved")."</font>";
|
||||
setEventMessage($langs->trans("SetupSaved"));
|
||||
}
|
||||
else
|
||||
{
|
||||
$mesg = "<font class=\"error\">".$langs->trans("Error")."</font>";
|
||||
setEventMessage($langs->trans("Error"),'errors');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -88,11 +88,11 @@ if ($action == 'update' || $action == 'add')
|
||||
|
||||
if (! $error)
|
||||
{
|
||||
$mesg = "<font class=\"ok\">".$langs->trans("SetupSaved")."</font>";
|
||||
setEventMessage($langs->trans("SetupSaved"));
|
||||
}
|
||||
else
|
||||
{
|
||||
$mesg = "<font class=\"error\">".$langs->trans("Error")."</font>";
|
||||
setEventMessage($langs->trans("Error"),'errors');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -255,8 +255,6 @@ if ($num)
|
||||
print "</table>\n";
|
||||
}
|
||||
|
||||
dol_htmloutput_mesg($mesg);
|
||||
|
||||
$db->close();
|
||||
|
||||
llxFooter();
|
||||
|
||||
@@ -84,13 +84,11 @@ if ($action == "save" && empty($cancel))
|
||||
|
||||
if (! $error)
|
||||
{
|
||||
$db->commit();
|
||||
$mesg = "<font class=\"ok\">".$langs->trans("SetupSaved")."</font>";
|
||||
setEventMessage($langs->trans("SetupSaved"));
|
||||
}
|
||||
else
|
||||
{
|
||||
$db->rollback();
|
||||
$mesg = "<font class=\"error\">".$langs->trans("Error")."</font>";
|
||||
setEventMessage($langs->trans("Error"),'errors');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -189,8 +187,6 @@ dol_fiche_end();
|
||||
|
||||
print "<br>";
|
||||
|
||||
dol_htmloutput_mesg($mesg);
|
||||
|
||||
llxFooter();
|
||||
|
||||
$db->close();
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/* Copyright (C) 2008-2011 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2011-2012 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2011-2013 Juanjo Menent <jmenent@2byte.es>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -97,12 +97,12 @@ if ($actionsave)
|
||||
if (! $error)
|
||||
{
|
||||
$db->commit();
|
||||
$mesg = "<font class=\"ok\">".$langs->trans("SetupSaved")."</font>";
|
||||
setEventMessage($langs->trans("SetupSaved"));
|
||||
}
|
||||
else
|
||||
{
|
||||
$db->rollback();
|
||||
if (empty($errorsaved)) $mesg = "<font class=\"error\">".$langs->trans("Error")."</font>";
|
||||
if (empty($errorsaved)) setEventMessage($langs->trans("Error"),'errors');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -225,9 +225,6 @@ print "</form>\n";
|
||||
|
||||
dol_fiche_end();
|
||||
|
||||
dol_htmloutput_mesg($mesg);
|
||||
|
||||
|
||||
llxFooter();
|
||||
|
||||
$db->close();
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
/* Copyright (C) 2008-2010 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2011 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
* Copyright (C) 2011-2012 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2011-2013 Juanjo Menent <jmenent@2byte.es>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -127,8 +127,6 @@ dol_fiche_end();
|
||||
|
||||
print "<br>";
|
||||
|
||||
dol_htmloutput_mesg($mesg);
|
||||
|
||||
llxFooter();
|
||||
|
||||
$db->close();
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/* Copyright (C) 2008-2012 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2012 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2012-2013 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2012 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/* Copyright (C) 2009 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2010-2012 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2010-2013 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2013 Philippe Grand <philippe.grand@atoo-net.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
@@ -54,11 +54,11 @@ if ($action == 'set_BANK_CHEQUERECEIPT_FREE_TEXT')
|
||||
|
||||
if (! $error)
|
||||
{
|
||||
$mesg = "<font class=\"ok\">".$langs->trans("SetupSaved")."</font>";
|
||||
setEventMessage($langs->trans("SetupSaved"));
|
||||
}
|
||||
else
|
||||
{
|
||||
$mesg = "<font class=\"error\">".$langs->trans("Error")."</font>";
|
||||
setEventMessage($langs->trans("Error"),'errors');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -177,13 +177,13 @@ while ($i < $nbofbank)
|
||||
if ($conf->global->BANK_SHOW_ORDER_OPTION == $i)
|
||||
{
|
||||
print '<td align="center">';
|
||||
print img_picto($langs->trans("Activated"),'on');
|
||||
print img_picto($langs->trans("Activated"),'switch_on');
|
||||
print '</td>';
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<td align="center"><a href="'.$_SERVER['PHP_SELF'].'?action=setbankorder&value='.$i.'">';
|
||||
print img_picto($langs->trans("Disabled"),'off');
|
||||
print img_picto($langs->trans("Disabled"),'switch_off');
|
||||
print '</a></td>';
|
||||
}
|
||||
print '<td> </td>';
|
||||
@@ -193,8 +193,6 @@ while ($i < $nbofbank)
|
||||
|
||||
print '</table>'."\n";
|
||||
|
||||
dol_htmloutput_mesg($mesg);
|
||||
|
||||
$db->close();
|
||||
|
||||
llxFooter();
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
/* Copyright (C) 2003-2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2004-2011 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
* Copyright (C) 2011 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2011-2013 Juanjo Menent <jmenent@2byte.es>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -79,14 +79,14 @@ if($action && $action!='setcoder')
|
||||
{
|
||||
if (! $res > 0) $error++;
|
||||
|
||||
if (! $error)
|
||||
if (! $error)
|
||||
{
|
||||
$mesg = "<font class=\"ok\">".$langs->trans("SetupSaved")."</font>";
|
||||
setEventMessage($langs->trans("SetupSaved"));
|
||||
}
|
||||
else
|
||||
{
|
||||
$mesg = "<font class=\"error\">".$langs->trans("Error")."</font>";
|
||||
}
|
||||
setEventMessage($langs->trans("Error"),'errors');
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -329,8 +329,6 @@ print '</table>';
|
||||
|
||||
print "<br>";
|
||||
|
||||
dol_htmloutput_mesg($mesg);
|
||||
|
||||
$db->close();
|
||||
|
||||
llxFooter();
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
/* Copyright (C) 2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2005-2011 Laurent Destailleur <eldy@users.sourceforge.org>
|
||||
* Copyright (C) 2011 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2011-2013 Juanjo Menent <jmenent@2byte.es>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -41,11 +41,11 @@ if ($action == 'setvalue' && $user->admin)
|
||||
$result=dolibarr_set_const($db, "CLICKTODIAL_URL", GETPOST("url"), 'chaine', 0, '', $conf->entity);
|
||||
if ($result >= 0)
|
||||
{
|
||||
$mesg = "<font class=\"ok\">".$langs->trans("SetupSaved")."</font>";
|
||||
setEventMessage($langs->trans("SetupSaved"));
|
||||
}
|
||||
else
|
||||
{
|
||||
$mesg = "<font class=\"error\">".$langs->trans("Error")."</font>";
|
||||
setEventMessage($langs->trans("Error"),'errors');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -128,9 +128,6 @@ if (! empty($conf->global->CLICKTODIAL_URL))
|
||||
}
|
||||
}
|
||||
|
||||
dol_htmloutput_mesg($mesg);
|
||||
|
||||
|
||||
llxFooter();
|
||||
|
||||
$db->close();
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
* Copyright (C) 2004 Andre Cianfarani <acianfa@free.fr>
|
||||
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
* Copyright (C) 2008 Raphael Bertrand (Resultic) <raphael.bertrand@resultic.fr>
|
||||
* Copyright (C) 2011-2012 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2011-2013 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2011-2013 Philippe Grand <philippe.grand@atoo-net.com>
|
||||
* Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
|
||||
*
|
||||
@@ -64,11 +64,11 @@ if ($action == 'updateMask')
|
||||
|
||||
if (! $error)
|
||||
{
|
||||
$mesg = "<font class=\"ok\">".$langs->trans("SetupSaved")."</font>";
|
||||
setEventMessage($langs->trans("SetupSaved"));
|
||||
}
|
||||
else
|
||||
{
|
||||
$mesg = "<font class=\"error\">".$langs->trans("Error")."</font>";
|
||||
setEventMessage($langs->trans("Error"),'errors');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -106,13 +106,13 @@ else if ($action == 'specimen')
|
||||
}
|
||||
else
|
||||
{
|
||||
$mesg='<font class="error">'.$module->error.'</font>';
|
||||
setEventMessage($module->error,'errors');
|
||||
dol_syslog($module->error, LOG_ERR);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$mesg='<font class="error">'.$langs->trans("ErrorModuleNotFound").'</font>';
|
||||
setEventMessage($langs->trans("ErrorModuleNotFound"),'errors');
|
||||
dol_syslog($langs->trans("ErrorModuleNotFound"), LOG_ERR);
|
||||
}
|
||||
}
|
||||
@@ -167,11 +167,11 @@ else if ($action == 'set_COMMANDE_DRAFT_WATERMARK')
|
||||
|
||||
if (! $error)
|
||||
{
|
||||
$mesg = "<font class=\"ok\">".$langs->trans("SetupSaved")."</font>";
|
||||
setEventMessage($langs->trans("SetupSaved"));
|
||||
}
|
||||
else
|
||||
{
|
||||
$mesg = "<font class=\"error\">".$langs->trans("Error")."</font>";
|
||||
setEventMessage($langs->trans("Error"),'errors');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -185,11 +185,11 @@ else if ($action == 'set_COMMANDE_FREE_TEXT')
|
||||
|
||||
if (! $error)
|
||||
{
|
||||
$mesg = "<font class=\"ok\">".$langs->trans("SetupSaved")."</font>";
|
||||
setEventMessage($langs->trans("SetupSaved"));
|
||||
}
|
||||
else
|
||||
{
|
||||
$mesg = "<font class=\"error\">".$langs->trans("Error")."</font>";
|
||||
setEventMessage($langs->trans("Error"),'errors');
|
||||
}
|
||||
}
|
||||
else if ($action=='setModuleOptions') {
|
||||
@@ -531,8 +531,6 @@ print '</table>';
|
||||
|
||||
print '<br>';
|
||||
|
||||
dol_htmloutput_mesg($mesg);
|
||||
|
||||
llxFooter();
|
||||
|
||||
$db->close();
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
/* Copyright (C) 2001-2007 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2004-2013 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
* Copyright (C) 2010 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2010-2013 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2011 Philippe Grand <philippe.grand@atoo-net.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
@@ -41,8 +41,7 @@ $langs->load("companies");
|
||||
|
||||
if (! $user->admin) accessforbidden();
|
||||
|
||||
$message='';
|
||||
|
||||
$error=0;
|
||||
|
||||
/*
|
||||
* Actions
|
||||
@@ -122,18 +121,21 @@ if ( ($action == 'update' && empty($_POST["cancel"]))
|
||||
}
|
||||
else if (preg_match('/^ErrorFileIsInfectedWithAVirus/',$result))
|
||||
{
|
||||
$error++;
|
||||
$langs->load("errors");
|
||||
$tmparray=explode(':',$result);
|
||||
$message .= '<div class="error">'.$langs->trans('ErrorFileIsInfectedWithAVirus',$tmparray[1]).'</div>';
|
||||
setEventMessage($langs->trans('ErrorFileIsInfectedWithAVirus',$tmparray[1]),'errors');
|
||||
}
|
||||
else
|
||||
{
|
||||
$message .= '<div class="error">'.$langs->trans("ErrorFailedToSaveFile").'</div>';
|
||||
$error++;
|
||||
setEventMessage($langs->trans("ErrorFailedToSaveFile"),'errors');
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$message .= '<div class="error">'.$langs->trans("ErrorOnlyPngJpgSupported").'</div>';
|
||||
$error++;
|
||||
setEventMessage($langs->trans("ErrorOnlyPngJpgSupported"),'errors');
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -157,7 +159,7 @@ if ( ($action == 'update' && empty($_POST["cancel"]))
|
||||
dolibarr_set_const($db, "FACTURE_LOCAL_TAX1_OPTION",$_POST["optionlocaltax1"],'chaine',0,'',$conf->entity);
|
||||
dolibarr_set_const($db, "FACTURE_LOCAL_TAX2_OPTION",$_POST["optionlocaltax2"],'chaine',0,'',$conf->entity);
|
||||
|
||||
if ($action != 'updateedit' && ! $message)
|
||||
if ($action != 'updateedit' && ! $error)
|
||||
{
|
||||
header("Location: ".$_SERVER["PHP_SELF"]);
|
||||
exit;
|
||||
@@ -198,13 +200,15 @@ if ($action == 'addthumb')
|
||||
}
|
||||
else
|
||||
{
|
||||
$message .= '<div class="error">'.$langs->trans("ErrorImageFormatNotSupported").'</div>';
|
||||
$error++;
|
||||
setEventMessage($langs->trans("ErrorImageFormatNotSupported"),'errors');
|
||||
dol_syslog($langs->transnoentities("ErrorImageFormatNotSupported"),LOG_WARNING);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$message .= '<div class="error">'.$langs->trans("ErrorFileDoesNotExists",$_GET["file"]).'</div>';
|
||||
$error++;
|
||||
setEventMessage($langs->trans("ErrorFileDoesNotExists",$_GET["file"]),'errors');
|
||||
dol_syslog($langs->transnoentities("ErrorFileDoesNotExists",$_GET["file"]),LOG_WARNING);
|
||||
}
|
||||
}
|
||||
@@ -628,8 +632,6 @@ else
|
||||
* Show parameters
|
||||
*/
|
||||
|
||||
dol_htmloutput_mesg($message);
|
||||
|
||||
// Actions buttons
|
||||
//print '<div class="tabsAction">';
|
||||
//print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?action=edit">'.$langs->trans("Modify").'</a>';
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
/* Copyright (C) 2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2004-2008 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2005-2009 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
* Copyright (C) 2011-2012 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2011-2013 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2013 Philippe Grand <philippe.grand@atoo-net.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
@@ -52,11 +52,11 @@ if ($action == 'setcomptamode')
|
||||
|
||||
if (! $error)
|
||||
{
|
||||
$mesg = "<font class=\"ok\">".$langs->trans("SetupSaved")."</font>";
|
||||
setEventMessage($langs->trans("SetupSaved"));
|
||||
}
|
||||
else
|
||||
{
|
||||
$mesg = "<font class=\"error\">".$langs->trans("Error")."</font>";
|
||||
setEventMessage($langs->trans("Error"),'errors');
|
||||
}
|
||||
|
||||
}
|
||||
@@ -74,11 +74,11 @@ if ($action == 'update' || $action == 'add')
|
||||
|
||||
if (! $error)
|
||||
{
|
||||
$mesg = "<font class=\"ok\">".$langs->trans("SetupSaved")."</font>";
|
||||
setEventMessage($langs->trans("SetupSaved"));
|
||||
}
|
||||
else
|
||||
{
|
||||
$mesg = "<font class=\"error\">".$langs->trans("Error")."</font>";
|
||||
setEventMessage($langs->trans("Error"),'errors');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -214,8 +214,6 @@ if ($num)
|
||||
print "</table>\n";
|
||||
}
|
||||
|
||||
dol_htmloutput_mesg($mesg);
|
||||
|
||||
$db->close();
|
||||
|
||||
llxFooter();
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
/* Copyright (C) 2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2004-2013 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
* Copyright (C) 2013 Juanjo Menent <jmenent@2byte.es>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -44,7 +45,6 @@ $constnote=GETPOST('constnote','alpha');
|
||||
$consttype=(GETPOST('consttype','alpha')?GETPOST('consttype','alpha'):'chaine');
|
||||
|
||||
$typeconst=array('yesno' => 'yesno', 'texte' => 'texte', 'chaine' => 'chaine');
|
||||
$mesg='';
|
||||
|
||||
|
||||
|
||||
@@ -58,12 +58,12 @@ if ($action == 'add')
|
||||
|
||||
if (empty($constname))
|
||||
{
|
||||
$mesg='<div class="error">'.$langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("Name")).'</div>';
|
||||
setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("Name")),'errors');
|
||||
$error++;
|
||||
}
|
||||
if ($constvalue == '')
|
||||
{
|
||||
$mesg='<div class="error">'.$langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("Value")).'</div>';
|
||||
setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("Value")),'errors');
|
||||
$error++;
|
||||
}
|
||||
|
||||
@@ -174,8 +174,6 @@ print_fiche_titre($langs->trans("OtherSetup"),'','setup');
|
||||
print $langs->trans("ConstDesc")."<br>\n";
|
||||
print "<br>\n";
|
||||
|
||||
dol_htmloutput_mesg($mesg);
|
||||
|
||||
print '<table class="noborder" width="100%">';
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td>'.$langs->trans("Name").'</td>';
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<?php
|
||||
/* Copyright (C) 2011-2012 Juanjo Menent <jmenent@2byte.es>
|
||||
/* Copyright (C) 2011-2013 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2011-2013 Philippe Grand <philippe.grand@atoo-net.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
@@ -53,13 +53,13 @@ if ($action == 'updateMask')
|
||||
|
||||
if (! $res > 0) $error++;
|
||||
|
||||
if (! $error)
|
||||
if (! $error)
|
||||
{
|
||||
$mesg = "<font class=\"ok\">".$langs->trans("SetupSaved")."</font>";
|
||||
setEventMessage($langs->trans("SetupSaved"));
|
||||
}
|
||||
else
|
||||
{
|
||||
$mesg = "<font class=\"error\">".$langs->trans("Error")."</font>";
|
||||
setEventMessage($langs->trans("Error"),'errors');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -199,8 +199,6 @@ if (is_resource($handle))
|
||||
|
||||
print '</table><br>';
|
||||
|
||||
dol_htmloutput_mesg($mesg);
|
||||
|
||||
$db->close();
|
||||
|
||||
llxFooter();
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
* Copyright (C) 2004-2012 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2004 Benoit Mortier <benoit.mortier@opensides.be>
|
||||
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
* Copyright (C) 2010-2011 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2010-2013 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2011 Philippe Grand <philippe.grand@atoo-net.com>
|
||||
* Copyright (C) 2011 Remy Younes <ryounes@gmail.com>
|
||||
* Copyright (C) 2012-2013 Marcos García <marcosgdf@gmail.com>
|
||||
@@ -404,7 +404,6 @@ if ($id == 10)
|
||||
);
|
||||
if (! empty($conf->global->MAIN_USE_LOCALTAX_TYPE_7)) $localtax_typeList["7"]= $langs->trans("Yes").' ('.$langs->trans("Type")." 7)"; //$langs->trans("AmountOnOrder") // We will enable this later. For the moment, work only of invoice localtype
|
||||
}
|
||||
$msg='';
|
||||
|
||||
|
||||
// Actions ajout ou modification d'une entree dans un dictionnaire de donnee
|
||||
@@ -442,20 +441,20 @@ if (GETPOST('actionadd') || GETPOST('actionmodify'))
|
||||
if ($fieldnamekey == 'unicode') $fieldnamekey = 'Unicode';
|
||||
if ($fieldnamekey == 'deductible') $fieldnamekey = 'Deductible';
|
||||
|
||||
$msg.=$langs->transnoentities("ErrorFieldRequired", $langs->transnoentities($fieldnamekey)).'<br>';
|
||||
setEventMessage($langs->transnoentities("ErrorFieldRequired", $langs->transnoentities($fieldnamekey)),'errors');
|
||||
}
|
||||
}
|
||||
// Other checks
|
||||
if ($tabname[$id] == MAIN_DB_PREFIX."c_actioncomm" && isset($_POST["type"]) && in_array($_POST["type"],array('system','systemauto'))) {
|
||||
$ok=0;
|
||||
$msg.= $langs->transnoentities('ErrorReservedTypeSystemSystemAuto').'<br>';
|
||||
$ok=0;
|
||||
setEventMessage($langs->transnoentities('ErrorReservedTypeSystemSystemAuto'),'errors');
|
||||
}
|
||||
if (isset($_POST["code"]))
|
||||
{
|
||||
if ($_POST["code"]=='0')
|
||||
{
|
||||
$ok=0;
|
||||
$msg.= $langs->transnoentities('ErrorCodeCantContainZero').'<br>';
|
||||
setEventMessage($langs->transnoentities('ErrorCodeCantContainZero'),'errors');
|
||||
}
|
||||
// FIXME regresion if code with not in numeric base
|
||||
/*if (!is_numeric($_POST['code']))
|
||||
@@ -466,7 +465,7 @@ if (GETPOST('actionadd') || GETPOST('actionmodify'))
|
||||
}
|
||||
if (isset($_POST["country"]) && $_POST["country"]=='0') {
|
||||
$ok=0;
|
||||
$msg.=$langs->transnoentities("ErrorFieldRequired",$langs->transnoentities("Country")).'<br>';
|
||||
setEventMessage($langs->transnoentities("ErrorFieldRequired",$langs->transnoentities("Country")),'errors');
|
||||
}
|
||||
|
||||
// Clean some parameters
|
||||
@@ -530,7 +529,7 @@ if (GETPOST('actionadd') || GETPOST('actionmodify'))
|
||||
else
|
||||
{
|
||||
if ($db->errno() == 'DB_ERROR_RECORD_ALREADY_EXISTS') {
|
||||
$msg=$langs->transnoentities("ErrorRecordAlreadyExists").'<br>';
|
||||
setEventMessage($langs->transnoentities("ErrorRecordAlreadyExists"),'errors');
|
||||
}
|
||||
else {
|
||||
dol_print_error($db);
|
||||
@@ -574,11 +573,9 @@ if (GETPOST('actionadd') || GETPOST('actionmodify'))
|
||||
$resql = $db->query($sql);
|
||||
if (! $resql)
|
||||
{
|
||||
$msg=$db->error();
|
||||
setEventMessage($db->error(),'errors');
|
||||
}
|
||||
}
|
||||
|
||||
if ($msg) $msg='<div class="error">'.$msg.'</div>';
|
||||
//$_GET["id"]=GETPOST('id', 'int'); // Force affichage dictionnaire en cours d'edition
|
||||
}
|
||||
|
||||
@@ -600,7 +597,7 @@ if ($action == 'confirm_delete' && $confirm == 'yes') // delete
|
||||
{
|
||||
if ($db->errno() == 'DB_ERROR_CHILD_EXISTS')
|
||||
{
|
||||
$msg='<div class="error">'.$langs->transnoentities("ErrorRecordIsUsedByChild").'</div>';
|
||||
setEventMessage($langs->transnoentities("ErrorRecordIsUsedByChild"),'errors');
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -688,7 +685,6 @@ if ($action == 'delete')
|
||||
*/
|
||||
if ($id)
|
||||
{
|
||||
dol_htmloutput_mesg($msg);
|
||||
|
||||
// Complete requete recherche valeurs avec critere de tri
|
||||
$sql=$tabsql[$id];
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/* Copyright (C) 2005-2010 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2012 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2012-2013 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2013 Philippe Grand <philippe.grand@atoo-net.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
@@ -65,13 +65,13 @@ if ($action == 'specimen')
|
||||
}
|
||||
else
|
||||
{
|
||||
$mesg='<div class="error">'.$obj->error.'</div>';
|
||||
setEventMessage($obj->error,'errors');
|
||||
dol_syslog($obj->error, LOG_ERR);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$mesg='<div class="error">'.$langs->trans("ErrorModuleNotFound").'</div>';
|
||||
setEventMessage($langs->trans("ErrorModuleNotFound"),'errors');
|
||||
dol_syslog($langs->trans("ErrorModuleNotFound"), LOG_ERR);
|
||||
}
|
||||
}
|
||||
@@ -160,7 +160,7 @@ else
|
||||
dol_print_error($db);
|
||||
}
|
||||
|
||||
print '<table class="noborder" width=\"100%\">';
|
||||
print '<table class="noborder" width="100%">';
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td>'.$langs->trans("Name").'</td>';
|
||||
print '<td>'.$langs->trans("Description").'</td>';
|
||||
@@ -206,20 +206,20 @@ if (is_resource($handle))
|
||||
print "<td align=\"center\">\n";
|
||||
if ($conf->global->DON_ADDON_MODEL == $name)
|
||||
{
|
||||
print img_picto($langs->trans("Enabled"),'on');
|
||||
print img_picto($langs->trans("Enabled"),'switch_on');
|
||||
}
|
||||
else
|
||||
{
|
||||
print ' ';
|
||||
print '</td><td align="center">';
|
||||
print '<a href="dons.php?action=setdoc&value='.$name.'&scandir='.$module->scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Enabled"),'on').'</a>';
|
||||
print '<a href="dons.php?action=setdoc&value='.$name.'&scandir='.$module->scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Enabled"),'switch_on').'</a>';
|
||||
}
|
||||
print '</td>';
|
||||
}
|
||||
else
|
||||
{
|
||||
print "<td align=\"center\">\n";
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=set&value='.$name.'&scandir='.$module->scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"),'off').'</a>';
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=set&value='.$name.'&scandir='.$module->scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"),'switch_off').'</a>';
|
||||
print "</td>";
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
<?php
|
||||
/* Copyright (C) 2008-2011 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2013 Juanjo Menent <jmenent@2byte.es>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -60,7 +61,7 @@ if ($action == "save")
|
||||
}
|
||||
|
||||
$db->commit();
|
||||
$mesg = "<font class=\"ok\">".$langs->trans("SetupSaved")."</font>";
|
||||
setEventMessage($langs->trans("SetupSaved"));
|
||||
}
|
||||
|
||||
|
||||
@@ -116,10 +117,6 @@ print "</form>\n";
|
||||
|
||||
print '</div>';
|
||||
|
||||
|
||||
dol_htmloutput_mesg($mesg);
|
||||
|
||||
|
||||
$db->close();
|
||||
|
||||
llxFooter();
|
||||
|
||||
@@ -68,11 +68,11 @@ if ($action == 'updateMask')
|
||||
|
||||
if (! $error)
|
||||
{
|
||||
$mesg = "<font class=\"ok\">".$langs->trans("SetupSaved")."</font>";
|
||||
setEventMessage($langs->trans("SetupSaved"));
|
||||
}
|
||||
else
|
||||
{
|
||||
$mesg = "<font class=\"error\">".$langs->trans("Error")."</font>";
|
||||
setEventMessage($langs->trans("Error"),'errors');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -110,13 +110,13 @@ if ($action == 'specimen')
|
||||
}
|
||||
else
|
||||
{
|
||||
$mesg='<font class="error">'.$module->error.'</font>';
|
||||
setEventMessage($module->error,'errors');
|
||||
dol_syslog($module->error, LOG_ERR);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$mesg='<font class="error">'.$langs->trans("ErrorModuleNotFound").'</font>';
|
||||
setEventMessage($langs->trans("ErrorModuleNotFound"),'errors');
|
||||
dol_syslog($langs->trans("ErrorModuleNotFound"), LOG_ERR);
|
||||
}
|
||||
}
|
||||
@@ -138,11 +138,11 @@ if ($action == 'setModuleOptions')
|
||||
|
||||
if (! $error)
|
||||
{
|
||||
$mesg = "<font class=\"ok\">".$langs->trans("SetupSaved")."</font>";
|
||||
setEventMessage($langs->trans("SetupSaved"));
|
||||
}
|
||||
else
|
||||
{
|
||||
$mesg = "<font class=\"error\">".$langs->trans("Error")."</font>";
|
||||
setEventMessage($langs->trans("Error"),'errors');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -199,11 +199,11 @@ if ($action == 'setribchq')
|
||||
|
||||
if (! $error)
|
||||
{
|
||||
$mesg = "<font class=\"ok\">".$langs->trans("SetupSaved")."</font>";
|
||||
setEventMessage($langs->trans("SetupSaved"));
|
||||
}
|
||||
else
|
||||
{
|
||||
$mesg = "<font class=\"error\">".$langs->trans("Error")."</font>";
|
||||
setEventMessage($langs->trans("Error"),'errors');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -217,11 +217,11 @@ if ($action == 'set_FACTURE_DRAFT_WATERMARK')
|
||||
|
||||
if (! $error)
|
||||
{
|
||||
$mesg = "<font class=\"ok\">".$langs->trans("SetupSaved")."</font>";
|
||||
setEventMessage($langs->trans("SetupSaved"));
|
||||
}
|
||||
else
|
||||
{
|
||||
$mesg = "<font class=\"error\">".$langs->trans("Error")."</font>";
|
||||
setEventMessage($langs->trans("Error"),'errors');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -235,11 +235,11 @@ if ($action == 'set_FACTURE_FREE_TEXT')
|
||||
|
||||
if (! $error)
|
||||
{
|
||||
$mesg = "<font class=\"ok\">".$langs->trans("SetupSaved")."</font>";
|
||||
setEventMessage($langs->trans("SetupSaved"));
|
||||
}
|
||||
else
|
||||
{
|
||||
$mesg = "<font class=\"error\">".$langs->trans("Error")."</font>";
|
||||
setEventMessage($langs->trans("Error"),'errors');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -253,11 +253,11 @@ if ($action == 'setforcedate')
|
||||
|
||||
if (! $error)
|
||||
{
|
||||
$mesg = "<font class=\"ok\">".$langs->trans("SetupSaved")."</font>";
|
||||
setEventMessage($langs->trans("SetupSaved"));
|
||||
}
|
||||
else
|
||||
{
|
||||
$mesg = "<font class=\"error\">".$langs->trans("Error")."</font>";
|
||||
setEventMessage($langs->trans("Error"),'errors');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -788,9 +788,6 @@ print "</table>\n";
|
||||
|
||||
//dol_fiche_end();
|
||||
|
||||
dol_htmloutput_mesg($mesg);
|
||||
|
||||
|
||||
llxFooter();
|
||||
|
||||
$db->close();
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
/* Copyright (C) 2004-2011 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
* Copyright (C) 2012 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2012-20113 Juanjo Menent <jmenent@2byte.es>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -94,7 +94,7 @@ if (GETPOST('save','alpha'))
|
||||
{
|
||||
$res=dolibarr_set_const($db, "FCKEDITOR_TEST", GETPOST('formtestfield'),'chaine',0,'',$conf->entity);
|
||||
|
||||
if ($res > 0) $mesg=$langs->trans("RecordModifiedSuccessfully");
|
||||
if ($res > 0) setEventMessage($langs->trans("RecordModifiedSuccessfully"));
|
||||
}
|
||||
|
||||
|
||||
@@ -151,8 +151,6 @@ else
|
||||
|
||||
print '</table>'."\n";
|
||||
|
||||
dol_htmloutput_mesg($mesg);
|
||||
|
||||
print '<br>'."\n";
|
||||
print_fiche_titre($langs->trans("TestSubmitForm"),'','');
|
||||
print '<form name="formtest" method="POST" action="'.$_SERVER["PHP_SELF"].'">'."\n";
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
* Copyright (C) 2004 Benoit Mortier <benoit.mortier@opensides.be>
|
||||
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
* Copyright (C) 2008 Raphael Bertrand (Resultic) <raphael.bertrand@resultic.fr>
|
||||
* Copyright (C) 2011-2012 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2011-2013 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2011-2013 Philippe Grand <philippe.grand@atoo-net.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
@@ -60,11 +60,11 @@ if ($action == 'updateMask')
|
||||
|
||||
if (! $error)
|
||||
{
|
||||
$mesg = "<font class=\"ok\">".$langs->trans("SetupSaved")."</font>";
|
||||
setEventMessage($langs->trans("SetupSaved"));
|
||||
}
|
||||
else
|
||||
{
|
||||
$mesg = "<font class=\"error\">".$langs->trans("Error")."</font>";
|
||||
setEventMessage($langs->trans("Error"),'errors');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -102,13 +102,13 @@ else if ($action == 'specimen') // For fiche inter
|
||||
}
|
||||
else
|
||||
{
|
||||
$mesg='<font class="error">'.$obj->error.'</font>';
|
||||
setEventMessage($obj->error,'errors');
|
||||
dol_syslog($obj->error, LOG_ERR);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$mesg='<font class="error">'.$langs->trans("ErrorModuleNotFound").'</font>';
|
||||
setEventMessage($langs->trans("ErrorModuleNotFound"),'errors');
|
||||
dol_syslog($langs->trans("ErrorModuleNotFound"), LOG_ERR);
|
||||
}
|
||||
}
|
||||
@@ -163,11 +163,11 @@ else if ($action == 'set_FICHINTER_FREE_TEXT')
|
||||
|
||||
if (! $error)
|
||||
{
|
||||
$mesg = "<font class=\"ok\">".$langs->trans("SetupSaved")."</font>";
|
||||
setEventMessage($langs->trans("SetupSaved"));
|
||||
}
|
||||
else
|
||||
{
|
||||
$mesg = "<font class=\"error\">".$langs->trans("Error")."</font>";
|
||||
setEventMessage($langs->trans("Error"),'errors');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -181,11 +181,11 @@ else if ($action == 'set_FICHINTER_DRAFT_WATERMARK')
|
||||
|
||||
if (! $error)
|
||||
{
|
||||
$mesg = "<font class=\"ok\">".$langs->trans("SetupSaved")."</font>";
|
||||
setEventMessage($langs->trans("SetupSaved"));
|
||||
}
|
||||
else
|
||||
{
|
||||
$mesg = "<font class=\"error\">".$langs->trans("Error")."</font>";
|
||||
setEventMessage($langs->trans("Error"),'errors');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -198,11 +198,11 @@ elseif ($action == 'set_FICHINTER_PRINT_PRODUCTS')
|
||||
|
||||
if (! $error)
|
||||
{
|
||||
$mesg = "<font class=\"ok\">".$langs->trans("SetupSaved")."</font>";
|
||||
setEventMessage($langs->trans("SetupSaved"));
|
||||
}
|
||||
else
|
||||
{
|
||||
$mesg = "<font class=\"error\">".$langs->trans("Error")."</font>";
|
||||
setEventMessage($langs->trans("Error"),'errors');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -509,8 +509,6 @@ print '</table>';
|
||||
|
||||
print '<br>';
|
||||
|
||||
dol_htmloutput_mesg($mesg);
|
||||
|
||||
$db->close();
|
||||
|
||||
llxFooter();
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/* Copyright (C) 2009-2012 Laurent Destailleur <eldy@users.sourceforge.org>
|
||||
* Copyright (C) 2011 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2011-2013 Juanjo Menent <jmenent@2byte.es>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -46,7 +46,7 @@ if ($action == 'set')
|
||||
|
||||
if (! $gimcdf && ! file_exists($gimcdf))
|
||||
{
|
||||
$mesg='<div class="error">'.$langs->trans("ErrorFileNotFound",$gimcdf).'</div>';
|
||||
setEventMessage($langs->trans("ErrorFileNotFound",$gimcdf),'errors');
|
||||
$error++;
|
||||
}
|
||||
|
||||
@@ -56,13 +56,13 @@ if ($action == 'set')
|
||||
if (! $res > 0) $error++;
|
||||
|
||||
if (! $error)
|
||||
{
|
||||
$mesg = "<font class=\"ok\">".$langs->trans("SetupSaved")."</font>";
|
||||
}
|
||||
else
|
||||
{
|
||||
$mesg = "<font class=\"error\">".$langs->trans("Error")."</font>";
|
||||
}
|
||||
{
|
||||
setEventMessage($langs->trans("SetupSaved"));
|
||||
}
|
||||
else
|
||||
{
|
||||
setEventMessage($langs->trans("Error"),'errors');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -155,8 +155,6 @@ if ($geoip)
|
||||
$geoip->close();
|
||||
}
|
||||
|
||||
dol_htmloutput_mesg($mesg);
|
||||
|
||||
llxFooter();
|
||||
|
||||
$db->close();
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
* Copyright (C) 2004 Benoit Mortier <benoit.mortier@opensides.be>
|
||||
* Copyright (C) 2005 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
* Copyright (C) 2006-2011 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2011 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2011-2013 Juanjo Menent <jmenent@2byte.es>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -60,15 +60,15 @@ if ($action == 'setvalue' && $user->admin)
|
||||
if (! dolibarr_set_const($db, 'LDAP_CONTACT_ACTIVE',GETPOST("activecontact"),'chaine',0,'',$conf->entity)) $error++;
|
||||
if (! dolibarr_set_const($db, 'LDAP_MEMBER_ACTIVE',GETPOST("activemembers"),'chaine',0,'',$conf->entity)) $error++;
|
||||
|
||||
if (! $error)
|
||||
{
|
||||
$db->commit();
|
||||
$mesg='<div class="ok">'.$langs->trans("SetupSaved").'</div>';
|
||||
}
|
||||
else
|
||||
{
|
||||
$db->rollback();
|
||||
dol_print_error($db);
|
||||
if (! $error)
|
||||
{
|
||||
$db->commit();
|
||||
setEventMessage($langs->trans("SetupSaved"));
|
||||
}
|
||||
else
|
||||
{
|
||||
$db->rollback();
|
||||
dol_print_error($db);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -89,7 +89,7 @@ $head = ldap_prepare_head();
|
||||
// Test si fonction LDAP actives
|
||||
if (! function_exists("ldap_connect"))
|
||||
{
|
||||
$mesg.='<div class="error">'.$langs->trans("LDAPFunctionsNotAvailableOnPHP").'</div>'; ;
|
||||
setEventMessage($langs->trans("LDAPFunctionsNotAvailableOnPHP"),'errors');
|
||||
}
|
||||
|
||||
dol_fiche_head($head, 'ldap', $langs->trans("LDAPSetup"));
|
||||
@@ -323,8 +323,6 @@ if (function_exists("ldap_connect"))
|
||||
}
|
||||
}
|
||||
|
||||
dol_htmloutput_mesg($mesg);
|
||||
|
||||
$db->close();
|
||||
|
||||
llxFooter();
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
* Copyright (C) 2004 Benoit Mortier <benoit.mortier@opensides.be>
|
||||
* Copyright (C) 2005 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
* Copyright (C) 2006-2011 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2011 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2011-2013 Juanjo Menent <jmenent@2byte.es>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -72,23 +72,23 @@ if ($action == 'setvalue' && $user->admin)
|
||||
$key=GETPOST("key");
|
||||
if ($key) $valkey=$conf->global->$key;
|
||||
if (! dolibarr_set_const($db, 'LDAP_KEY_CONTACTS',$valkey,'chaine',0,'',$conf->entity)) $error++;
|
||||
|
||||
if (! $error)
|
||||
{
|
||||
$db->commit();
|
||||
$mesg='<div class="ok">'.$langs->trans("SetupSaved").'</div>';
|
||||
}
|
||||
else
|
||||
{
|
||||
$db->rollback();
|
||||
dol_print_error($db);
|
||||
|
||||
if (! $error)
|
||||
{
|
||||
$db->commit();
|
||||
setEventMessage($langs->trans("SetupSaved"));
|
||||
}
|
||||
else
|
||||
{
|
||||
$db->rollback();
|
||||
dol_print_error($db);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* Visu
|
||||
* View
|
||||
*/
|
||||
|
||||
llxHeader('',$langs->trans("LDAPSetup"),'EN:Module_LDAP_En|FR:Module_LDAP|ES:Módulo_LDAP');
|
||||
@@ -101,7 +101,7 @@ $head = ldap_prepare_head();
|
||||
// Test si fonction LDAP actives
|
||||
if (! function_exists("ldap_connect"))
|
||||
{
|
||||
$mesg.='<div class="error">'.$langs->trans("LDAPFunctionsNotAvailableOnPHP").'</div>'; ;
|
||||
setEventMessage($langs->trans("LDAPFunctionsNotAvailableOnPHP"),'errors');
|
||||
}
|
||||
|
||||
dol_fiche_head($head, 'contacts', $langs->trans("LDAPSetup"));
|
||||
@@ -328,8 +328,6 @@ if (function_exists("ldap_connect"))
|
||||
}
|
||||
}
|
||||
|
||||
dol_htmloutput_mesg($mesg);
|
||||
|
||||
$db->close();
|
||||
|
||||
llxFooter();
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
* Copyright (C) 2004 Benoit Mortier <benoit.mortier@opensides.be>
|
||||
* Copyright (C) 2005 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
* Copyright (C) 2006-2011 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2011 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2011-2013 Juanjo Menent <jmenent@2byte.es>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -64,16 +64,16 @@ if ($action == 'setvalue' && $user->admin)
|
||||
$key=GETPOST("key");
|
||||
if ($key) $valkey=$conf->global->$key;
|
||||
if (! dolibarr_set_const($db, 'LDAP_KEY_GROUPS',$valkey,'chaine',0,'',$conf->entity)) $error++;
|
||||
|
||||
if (! $error)
|
||||
{
|
||||
$db->commit();
|
||||
$mesg='<div class="ok">'.$langs->trans("SetupSaved").'</div>';
|
||||
}
|
||||
else
|
||||
{
|
||||
$db->rollback();
|
||||
dol_print_error($db);
|
||||
|
||||
if (! $error)
|
||||
{
|
||||
$db->commit();
|
||||
setEventMessage($langs->trans("SetupSaved"));
|
||||
}
|
||||
else
|
||||
{
|
||||
$db->rollback();
|
||||
dol_print_error($db);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -93,7 +93,7 @@ $head = ldap_prepare_head();
|
||||
// Test si fonction LDAP actives
|
||||
if (! function_exists("ldap_connect"))
|
||||
{
|
||||
$mesg.='<div class="error">'.$langs->trans("LDAPFunctionsNotAvailableOnPHP").'</div>'; ;
|
||||
setEventMessage($langs->trans("LDAPFunctionsNotAvailableOnPHP"),'errors');
|
||||
}
|
||||
|
||||
dol_fiche_head($head, 'groups', $langs->trans("LDAPSetup"));
|
||||
@@ -253,8 +253,6 @@ if (function_exists("ldap_connect"))
|
||||
}
|
||||
}
|
||||
|
||||
dol_htmloutput_mesg($mesg);
|
||||
|
||||
$db->close();
|
||||
|
||||
llxFooter();
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
* Copyright (C) 2004 Benoit Mortier <benoit.mortier@opensides.be>
|
||||
* Copyright (C) 2005 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
* Copyright (C) 2006-2008 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2011 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2011-2013 Juanjo Menent <jmenent@2byte.es>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -87,15 +87,15 @@ if ($action == 'setvalue' && $user->admin)
|
||||
if ($key) $valkey=$conf->global->$key;
|
||||
if (! dolibarr_set_const($db, 'LDAP_KEY_MEMBERS',$valkey,'chaine',0,'',$conf->entity)) $error++;
|
||||
|
||||
if (! $error)
|
||||
{
|
||||
$db->commit();
|
||||
$mesg='<div class="ok">'.$langs->trans("SetupSaved").'</div>';
|
||||
}
|
||||
else
|
||||
{
|
||||
$db->rollback();
|
||||
dol_print_error($db);
|
||||
if (! $error)
|
||||
{
|
||||
$db->commit();
|
||||
setEventMessage($langs->trans("SetupSaved"));
|
||||
}
|
||||
else
|
||||
{
|
||||
$db->rollback();
|
||||
dol_print_error($db);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -115,7 +115,7 @@ $head = ldap_prepare_head();
|
||||
// Test si fonction LDAP actives
|
||||
if (! function_exists("ldap_connect"))
|
||||
{
|
||||
$mesg.='<div class="error">'.$langs->trans("LDAPFunctionsNotAvailableOnPHP").'</div>'; ;
|
||||
setEventMessage($langs->trans("LDAPFunctionsNotAvailableOnPHP"),'errors');
|
||||
}
|
||||
|
||||
dol_fiche_head($head, 'members', $langs->trans("LDAPSetup"));
|
||||
@@ -436,8 +436,6 @@ if (function_exists("ldap_connect"))
|
||||
|
||||
}
|
||||
|
||||
dol_htmloutput_mesg($mesg);
|
||||
|
||||
$db->close();
|
||||
|
||||
llxFooter();
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
* Copyright (C) 2004 Benoit Mortier <benoit.mortier@opensides.be>
|
||||
* Copyright (C) 2005 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
* Copyright (C) 2006-2011 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2011 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2011-2013 Juanjo Menent <jmenent@2byte.es>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -74,15 +74,15 @@ if ($action == 'setvalue' && $user->admin)
|
||||
if ($key) $valkey=$conf->global->$key;
|
||||
if (! dolibarr_set_const($db, 'LDAP_KEY_USERS',$valkey,'chaine',0,'',$conf->entity)) $error++;
|
||||
|
||||
if (! $error)
|
||||
{
|
||||
$db->commit();
|
||||
$mesg='<div class="ok">'.$langs->trans("SetupSaved").'</div>';
|
||||
}
|
||||
else
|
||||
{
|
||||
$db->rollback();
|
||||
dol_print_error($db);
|
||||
if (! $error)
|
||||
{
|
||||
$db->commit();
|
||||
setEventMessage($langs->trans("SetupSaved"));
|
||||
}
|
||||
else
|
||||
{
|
||||
$db->rollback();
|
||||
dol_print_error($db);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -102,7 +102,7 @@ $head = ldap_prepare_head();
|
||||
// Test si fonction LDAP actives
|
||||
if (! function_exists("ldap_connect"))
|
||||
{
|
||||
$mesg.='<div class="error">'.$langs->trans("LDAPFunctionsNotAvailableOnPHP").'</div>'; ;
|
||||
setEventMessage($langs->trans("LDAPFunctionsNotAvailableOnPHP"),'errors');
|
||||
}
|
||||
|
||||
dol_fiche_head($head, 'users', $langs->trans("LDAPSetup"));
|
||||
@@ -440,8 +440,6 @@ if (function_exists("ldap_connect"))
|
||||
}
|
||||
}
|
||||
|
||||
dol_htmloutput_mesg($mesg);
|
||||
|
||||
$db->close();
|
||||
|
||||
llxFooter();
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
* Copyright (C) 2004 Benoit Mortier <benoit.mortier@opensides.be>
|
||||
* Copyright (C) 2004 Eric Seigne <eric.seigne@ryxeo.com>
|
||||
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
* Copyright (C) 2011-2012 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2011-2013 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2011-2013 Philippe Grand <philippe.grand@atoo-net.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
@@ -56,13 +56,13 @@ if ($action == 'updateMask')
|
||||
|
||||
if (! $res > 0) $error++;
|
||||
|
||||
if (! $error)
|
||||
if (! $error)
|
||||
{
|
||||
$mesg = "<font class=\"ok\">".$langs->trans("SetupSaved")."</font>";
|
||||
setEventMessage($langs->trans("SetupSaved"));
|
||||
}
|
||||
else
|
||||
{
|
||||
$mesg = "<font class=\"error\">".$langs->trans("Error")."</font>";
|
||||
setEventMessage($langs->trans("Error"),'errors');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -73,13 +73,13 @@ if ($action == 'set_DELIVERY_FREE_TEXT')
|
||||
|
||||
if (! $res > 0) $error++;
|
||||
|
||||
if (! $error)
|
||||
if (! $error)
|
||||
{
|
||||
$mesg = "<font class=\"ok\">".$langs->trans("SetupSaved")."</font>";
|
||||
setEventMessage($langs->trans("SetupSaved"));
|
||||
}
|
||||
else
|
||||
{
|
||||
$mesg = "<font class=\"error\">".$langs->trans("Error")."</font>";
|
||||
setEventMessage($langs->trans("Error"),'errors');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -117,13 +117,13 @@ if ($action == 'specimen')
|
||||
}
|
||||
else
|
||||
{
|
||||
$mesg='<font class="error">'.$module->error.'</font>';
|
||||
setEventMessage($module->error,'errors');
|
||||
dol_syslog($module->error, LOG_ERR);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$mesg='<font class="error">'.$langs->trans("ErrorModuleNotFound").'</font>';
|
||||
setEventMessage($langs->trans("ErrorModuleNotFound"),'errors');
|
||||
dol_syslog($langs->trans("ErrorModuleNotFound"), LOG_ERR);
|
||||
}
|
||||
}
|
||||
@@ -458,8 +458,6 @@ print '</form>';
|
||||
|
||||
print '</table>';
|
||||
|
||||
dol_htmloutput_mesg($mesg);
|
||||
|
||||
$db->close();
|
||||
|
||||
llxFooter();
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
/* Copyright (C) 2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2005-2012 Laurent Destailleur <eldy@users.sourceforge.org>
|
||||
* Copyright (C) 2011-2012 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2011-2013 Juanjo Menent <jmenent@2byte.es>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -80,16 +80,16 @@ if ($action == 'setvalue')
|
||||
}
|
||||
$res=dolibarr_set_const($db, "MAILING_EMAIL_UNSUBSCRIBE_KEY",$checkread_key,'chaine',0,'',$conf->entity);
|
||||
if (! $res > 0) $error++;
|
||||
|
||||
if (! $error)
|
||||
|
||||
if (! $error)
|
||||
{
|
||||
$db->commit();
|
||||
$mesg = "<font class=\"ok\">".$langs->trans("SetupSaved")."</font>";
|
||||
setEventMessage($langs->trans("SetupSaved"));
|
||||
}
|
||||
else
|
||||
{
|
||||
$db->rollback();
|
||||
$mesg = "<font class=\"error\">".$langs->trans("Error")."</font>";
|
||||
setEventMessage($langs->trans("Error"),'errors');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -113,9 +113,6 @@ $h++;
|
||||
|
||||
dol_fiche_head($head, $hselected, $langs->trans("ModuleSetup"));
|
||||
|
||||
dol_htmloutput_mesg($mesg);
|
||||
|
||||
|
||||
if (! empty($conf->use_javascript_ajax))
|
||||
{
|
||||
print "\n".'<script type="text/javascript">';
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
* Copyright (C) 2004 Sebastien Di Cintio <sdicintio@ressource-toi.org>
|
||||
* Copyright (C) 2004 Benoit Mortier <benoit.mortier@opensides.be>
|
||||
* Copyright (C) 2005-2011 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
* Copyright (C) 2011 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2011-2013 Juanjo Menent <jmenent@2byte.es>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -63,14 +63,14 @@ if ($action == 'update' || $action == 'add')
|
||||
if (! $res > 0) $error++;
|
||||
}
|
||||
|
||||
if (! $error)
|
||||
{
|
||||
$mesg = '<div class="ok">'.$langs->trans("SetupSaved").'</div>';
|
||||
}
|
||||
else
|
||||
{
|
||||
$mesg = '<div class="error">'.$langs->trans("Error").'</div>';
|
||||
}
|
||||
if (! $error)
|
||||
{
|
||||
setEventMessage($langs->trans("SetupSaved"));
|
||||
}
|
||||
else
|
||||
{
|
||||
setEventMessage($langs->trans("Error"),'errors');
|
||||
}
|
||||
}
|
||||
|
||||
// Action activation d'un sous module du module adherent
|
||||
@@ -99,7 +99,7 @@ if (($action == 'testsubscribe' || $action == 'testunsubscribe') && ! empty($con
|
||||
if (! isValidEmail($email))
|
||||
{
|
||||
$langs->load("errors");
|
||||
$mesg='<div class="error">'.$langs->trans("ErrorBadEMail",$email).'</div>';
|
||||
setEventMessage($langs->trans("ErrorBadEMail",$email),'errors');
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -115,28 +115,28 @@ if (($action == 'testsubscribe' || $action == 'testunsubscribe') && ! empty($con
|
||||
if ($action == 'testsubscribe')
|
||||
{
|
||||
$result=$mailmanspip->add_to_mailman($object);
|
||||
if ($result < 0)
|
||||
{
|
||||
$error++;
|
||||
$mesg='<div class="error">'.$mailmanspip->error.'</div>';
|
||||
}
|
||||
else
|
||||
{
|
||||
$mesg='MailmanCreationSuccess';
|
||||
}
|
||||
if ($result < 0)
|
||||
{
|
||||
$error++;
|
||||
setEventMessage($mailmanspip->error,'errors');
|
||||
}
|
||||
else
|
||||
{
|
||||
setEventMessage($langs->trans("MailmanCreationSuccess"));
|
||||
}
|
||||
}
|
||||
if ($action == 'testunsubscribe')
|
||||
{
|
||||
$result=$mailmanspip->del_to_mailman($object);
|
||||
if ($result < 0)
|
||||
{
|
||||
$error++;
|
||||
$mesg='<div class="error">'.$mailmanspip->error.'</div>';
|
||||
}
|
||||
else
|
||||
{
|
||||
$mesg='MailmanDeletionSuccess';
|
||||
}
|
||||
if ($result < 0)
|
||||
{
|
||||
$error++;
|
||||
setEventMessage($mailmanspip->error,'errors');
|
||||
}
|
||||
else
|
||||
{
|
||||
setEventMessage($langs->trans("MailmanDeletionSuccess"));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -154,15 +154,10 @@ llxHeader('',$langs->trans("MailmanSpipSetup"),$help_url);
|
||||
$linkback='<a href="'.DOL_URL_ROOT.'/admin/modules.php">'.$langs->trans("BackToModuleList").'</a>';
|
||||
print_fiche_titre($langs->trans("MailmanSpipSetup"),$linkback,'setup');
|
||||
|
||||
|
||||
$head = mailmanspip_admin_prepare_head();
|
||||
|
||||
dol_fiche_head($head, 'mailman', $langs->trans("Setup"), 0, 'user');
|
||||
|
||||
|
||||
dol_htmloutput_mesg($mesg);
|
||||
|
||||
|
||||
$var=!$var;
|
||||
if (! empty($conf->global->ADHERENT_USE_MAILMAN))
|
||||
{
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
<?php
|
||||
/* Copyright (C) 2007-2012 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2009-2012 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
* Copyright (C) 2013 Juanjo Menent <jmenent@2byte.es>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -46,7 +47,6 @@ $substitutionarrayfortest=array(
|
||||
complete_substitutions_array($substitutionarrayfortest, $langs);
|
||||
|
||||
$action=GETPOST('action');
|
||||
$message='';
|
||||
|
||||
|
||||
/*
|
||||
@@ -126,14 +126,6 @@ if (! empty($_POST['removedfile']) || ! empty($_POST['removedfilehtml']))
|
||||
if ($_POST['removedfilehtml'] || $action='sendhtml') $action='testhtml';
|
||||
}
|
||||
|
||||
/*
|
||||
* Cancel
|
||||
*/
|
||||
if (($action == 'send' || $action == 'sendhtml') && GETPOST('cancel'))
|
||||
{
|
||||
$message='';
|
||||
}
|
||||
|
||||
/*
|
||||
* Send mail
|
||||
*/
|
||||
@@ -141,9 +133,6 @@ if (($action == 'send' || $action == 'sendhtml') && ! GETPOST('addfile') && ! GE
|
||||
{
|
||||
$error=0;
|
||||
|
||||
|
||||
|
||||
|
||||
$email_from='';
|
||||
if (! empty($_POST["fromname"])) $email_from=$_POST["fromname"].' ';
|
||||
if (! empty($_POST["frommail"])) $email_from.='<'.$_POST["frommail"].'>';
|
||||
@@ -172,13 +161,13 @@ if (($action == 'send' || $action == 'sendhtml') && ! GETPOST('addfile') && ! GE
|
||||
|
||||
if (empty($_POST["frommail"]))
|
||||
{
|
||||
$message='<div class="error">'.$langs->trans("ErrorFieldRequired",$langs->transnoentities("MailFrom")).'</div>';
|
||||
setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentities("MailFrom")),'errors');
|
||||
$action='test';
|
||||
$error++;
|
||||
}
|
||||
if (empty($sendto))
|
||||
{
|
||||
$message='<div class="error">'.$langs->trans("ErrorFieldRequired",$langs->transnoentities("MailTo")).'</div>';
|
||||
setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentities("MailTo")),'errors');
|
||||
$action='test';
|
||||
$error++;
|
||||
}
|
||||
@@ -212,11 +201,11 @@ if (($action == 'send' || $action == 'sendhtml') && ! GETPOST('addfile') && ! GE
|
||||
|
||||
if ($result)
|
||||
{
|
||||
$message='<div class="ok">'.$langs->trans("MailSuccessfulySent",$mailfile->getValidAddress($email_from,2),$mailfile->getValidAddress($sendto,2)).'</div>';
|
||||
setEventMessage($langs->trans("MailSuccessfulySent",$mailfile->getValidAddress($email_from,2),$mailfile->getValidAddress($sendto,2)));
|
||||
}
|
||||
else
|
||||
{
|
||||
$message='<div class="error">'.$langs->trans("ResultKo").'<br>'.$mailfile->error.' '.$result.'</div>';
|
||||
setEventMessage($langs->trans("ResultKo").'<br>'.$mailfile->error.' '.$result,'errors');
|
||||
}
|
||||
|
||||
$action='';
|
||||
@@ -253,8 +242,6 @@ print_fiche_titre($langs->trans("EMailsSetup"),'','setup');
|
||||
print $langs->trans("EMailsDesc")."<br>\n";
|
||||
print "<br>\n";
|
||||
|
||||
dol_htmloutput_mesg($message);
|
||||
|
||||
// List of sending methods
|
||||
$listofmethods=array();
|
||||
$listofmethods['mail']='PHP mail function';
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
<?php
|
||||
/* Copyright (C) 2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2005-2011 Laurent Destailleur <eldy@users.sourceforge.org>
|
||||
* Copyright (C) 2013 Juanjo Menent <jmenent@2byte.es>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -46,12 +47,12 @@ if ($action == 'setvalue' && $user->admin)
|
||||
{
|
||||
$result=dolibarr_set_const($db, "NOTIFICATION_EMAIL_FROM",$_POST["email_from"],'chaine',0,'',$conf->entity);
|
||||
if ($result >= 0)
|
||||
{
|
||||
$mesg = "<font class=\"ok\">".$langs->trans("SetupSaved")."</font>";
|
||||
}
|
||||
else
|
||||
{
|
||||
$mesg = "<font class=\"error\">".$langs->trans("Error")."</font>";
|
||||
{
|
||||
setEventMessage($langs->trans("SetupSaved"));
|
||||
}
|
||||
else
|
||||
{
|
||||
setEventMessage($langs->trans("Error"),'errors');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -126,8 +127,6 @@ foreach($listofnotifiedevents as $notifiedevent)
|
||||
}
|
||||
print '</table>';
|
||||
|
||||
dol_htmloutput_mesg($mesg);
|
||||
|
||||
$db->close();
|
||||
|
||||
llxFooter();
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
/* Copyright (C) 2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2005-2010 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2005-2010 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
* Copyright (C) 2010-2012 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2010-2013 Juanjo Menent <jmenent@2byte.es>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -76,15 +76,13 @@ if ($action == "set")
|
||||
else $error++;
|
||||
|
||||
if (! $error)
|
||||
{
|
||||
$db->commit();
|
||||
$mesg = "<font class=\"ok\">".$langs->trans("SetupSaved")."</font>";
|
||||
}
|
||||
else
|
||||
{
|
||||
$db->rollback();
|
||||
$mesg = "<font class=\"error\">".$langs->trans("Error")."</font>";
|
||||
}
|
||||
{
|
||||
setEventMessage($langs->trans("SetupSaved"));
|
||||
}
|
||||
else
|
||||
{
|
||||
setEventMessage($langs->trans("Error"),'errors');
|
||||
}
|
||||
}
|
||||
|
||||
if ($action == "addnotif")
|
||||
@@ -278,8 +276,6 @@ if ($resql)
|
||||
print '</table>';
|
||||
print '</form>';
|
||||
|
||||
dol_htmloutput_mesg($mesg);
|
||||
|
||||
$db->close();
|
||||
|
||||
llxFooter();
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
* Copyright (C) 2004 Eric Seigne <eric.seigne@ryxeo.com>
|
||||
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
* Copyright (C) 2008 Raphael Bertrand (Resultic) <raphael.bertrand@resultic.fr>
|
||||
* Copyright (C) 2011-2012 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2011-2013 Juanjo Menent <jmenent@2byte.es>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -48,7 +48,7 @@ $type='propal';
|
||||
/*
|
||||
* Actions
|
||||
*/
|
||||
|
||||
$error=0;
|
||||
if ($action == 'updateMask')
|
||||
{
|
||||
$maskconstpropal=GETPOST('maskconstpropal','alpha');
|
||||
@@ -58,13 +58,13 @@ if ($action == 'updateMask')
|
||||
if (! $res > 0) $error++;
|
||||
|
||||
if (! $error)
|
||||
{
|
||||
$mesg = "<font class=\"ok\">".$langs->trans("SetupSaved")."</font>";
|
||||
}
|
||||
else
|
||||
{
|
||||
$mesg = "<font class=\"error\">".$langs->trans("Error")."</font>";
|
||||
}
|
||||
{
|
||||
setEventMessage($langs->trans("SetupSaved"));
|
||||
}
|
||||
else
|
||||
{
|
||||
setEventMessage($langs->trans("Error"),'errors');
|
||||
}
|
||||
}
|
||||
|
||||
if ($action == 'specimen')
|
||||
@@ -101,13 +101,13 @@ if ($action == 'specimen')
|
||||
}
|
||||
else
|
||||
{
|
||||
$mesg='<font class="error">'.$module->error.'</font>';
|
||||
setEventMessage($module->error,'errors');
|
||||
dol_syslog($module->error, LOG_ERR);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$mesg='<font class="error">'.$langs->trans("ErrorModuleNotFound").'</font>';
|
||||
setEventMessage($langs->trans("ErrorModuleNotFound"),'errors');
|
||||
dol_syslog($langs->trans("ErrorModuleNotFound"), LOG_ERR);
|
||||
}
|
||||
}
|
||||
@@ -120,13 +120,13 @@ if ($action == 'set_PROPALE_DRAFT_WATERMARK')
|
||||
if (! $res > 0) $error++;
|
||||
|
||||
if (! $error)
|
||||
{
|
||||
$mesg = "<font class=\"ok\">".$langs->trans("SetupSaved")."</font>";
|
||||
}
|
||||
else
|
||||
{
|
||||
$mesg = "<font class=\"error\">".$langs->trans("Error")."</font>";
|
||||
}
|
||||
{
|
||||
setEventMessage($langs->trans("SetupSaved"));
|
||||
}
|
||||
else
|
||||
{
|
||||
setEventMessage($langs->trans("Error"),'errors');
|
||||
}
|
||||
}
|
||||
|
||||
if ($action == 'set_PROPALE_FREE_TEXT')
|
||||
@@ -138,13 +138,13 @@ if ($action == 'set_PROPALE_FREE_TEXT')
|
||||
if (! $res > 0) $error++;
|
||||
|
||||
if (! $error)
|
||||
{
|
||||
$mesg = "<font class=\"ok\">".$langs->trans("SetupSaved")."</font>";
|
||||
}
|
||||
else
|
||||
{
|
||||
$mesg = "<font class=\"error\">".$langs->trans("Error")."</font>";
|
||||
}
|
||||
{
|
||||
setEventMessage($langs->trans("SetupSaved"));
|
||||
}
|
||||
else
|
||||
{
|
||||
setEventMessage($langs->trans("Error"),'errors');
|
||||
}
|
||||
}
|
||||
|
||||
if ($action == 'setdefaultduration')
|
||||
@@ -154,13 +154,13 @@ if ($action == 'setdefaultduration')
|
||||
if (! $res > 0) $error++;
|
||||
|
||||
if (! $error)
|
||||
{
|
||||
$mesg = "<font class=\"ok\">".$langs->trans("SetupSaved")."</font>";
|
||||
}
|
||||
else
|
||||
{
|
||||
$mesg = "<font class=\"error\">".$langs->trans("Error")."</font>";
|
||||
}
|
||||
{
|
||||
setEventMessage($langs->trans("SetupSaved"));
|
||||
}
|
||||
else
|
||||
{
|
||||
setEventMessage($langs->trans("Error"),'errors');
|
||||
}
|
||||
}
|
||||
|
||||
// Define constants for submodules that contains parameters (forms with param1, param2, ... and value1, value2, ...)
|
||||
@@ -183,12 +183,12 @@ if ($action == 'setModuleOptions')
|
||||
if (! $error)
|
||||
{
|
||||
$db->commit();
|
||||
$mesg = "<font class=\"ok\">".$langs->trans("SetupSaved")."</font>";
|
||||
setEventMessage($langs->trans("SetupSaved"));
|
||||
}
|
||||
else
|
||||
{
|
||||
$db->rollback();
|
||||
$mesg = "<font class=\"error\">".$langs->trans("Error")."</font>";
|
||||
setEventMessage($langs->trans("Error"),'errors');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -601,8 +601,6 @@ print "</tr>\n";
|
||||
print "<tr ".$bc[false].">\n <td width=\"140\">".$langs->trans("PathDirectory")."</td>\n <td>".$conf->propal->dir_output."</td>\n</tr>\n";
|
||||
print "</table>\n<br>";
|
||||
|
||||
dol_htmloutput_mesg($mesg);
|
||||
|
||||
$db->close();
|
||||
|
||||
llxFooter();
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
<?php
|
||||
/* Copyright (C) 2011 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2013 Juanjo Menent <jmenent@2byte.es>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -43,12 +44,12 @@ if (GETPOST("action") == 'set_proxy')
|
||||
{
|
||||
if (GETPOST("MAIN_USE_CONNECT_TIMEOUT") && ! is_numeric(GETPOST("MAIN_USE_CONNECT_TIMEOUT")))
|
||||
{
|
||||
$mesg='<div class="error">'.$langs->trans("ErrorValueMustBeInteger").'</div>';
|
||||
setEventMessage($langs->trans("ErrorValueMustBeInteger"),'errors');
|
||||
$error++;
|
||||
}
|
||||
if (GETPOST("MAIN_USE_RESPONSE_TIMEOUT") && ! is_numeric(GETPOST("MAIN_USE_RESPONSE_TIMEOUT")))
|
||||
{
|
||||
$mesg='<div class="error">'.$langs->trans("ErrorValueMustBeInteger").'</div>';
|
||||
setEventMessage($langs->trans("ErrorValueMustBeInteger"),'errors');
|
||||
$error++;
|
||||
}
|
||||
|
||||
@@ -67,7 +68,7 @@ if (GETPOST("action") == 'set_proxy')
|
||||
|
||||
if (! $error)
|
||||
{
|
||||
$mesg='<div class="ok">'.$langs->trans("RecordModifiedSuccessfully").'</div>';
|
||||
setEventMessage($langs->trans("RecordModifiedSuccessfully"));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -203,10 +204,6 @@ print '</center>';
|
||||
|
||||
print '</form><br>';
|
||||
|
||||
|
||||
dol_htmloutput_mesg($mesg);
|
||||
|
||||
|
||||
$db->close();
|
||||
|
||||
llxFooter();
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
<?php
|
||||
/* Copyright (C) 2004-2009 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2005-2007 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
* Copyright (C) 2013 Juanjo Menent <jmenent@2byte.es>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -37,9 +38,6 @@ if (!$user->admin) accessforbidden();
|
||||
// Allow/Disallow change to clear passwords once passwords are crypted
|
||||
$allow_disable_encryption=true;
|
||||
|
||||
$mesg = '';
|
||||
|
||||
|
||||
/*
|
||||
* Actions
|
||||
*/
|
||||
@@ -135,7 +133,7 @@ if ($action == 'activate_encryptdbpassconf')
|
||||
}
|
||||
else
|
||||
{
|
||||
$mesg='<div class="warning">'.$langs->trans('InstrucToEncodePass',dol_encode($dolibarr_main_db_pass)).'</div>';
|
||||
setEventMessage($langs->trans('InstrucToEncodePass',dol_encode($dolibarr_main_db_pass)),'warnings');
|
||||
}
|
||||
}
|
||||
else if ($action == 'disable_encryptdbpassconf')
|
||||
@@ -150,7 +148,7 @@ else if ($action == 'disable_encryptdbpassconf')
|
||||
}
|
||||
else
|
||||
{
|
||||
$mesg='<div class="warning">'.$langs->trans('InstrucToClearPass',$dolibarr_main_db_pass).'</div>';
|
||||
setEventMessage($langs->trans('InstrucToClearPass',$dolibarr_main_db_pass),'warnings');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -179,8 +177,6 @@ llxHeader('',$langs->trans("Passwords"));
|
||||
|
||||
print_fiche_titre($langs->trans("SecuritySetup"),'','setup');
|
||||
|
||||
dol_htmloutput_mesg($mesg);
|
||||
|
||||
print $langs->trans("GeneratedPasswordDesc")."<br>\n";
|
||||
print "<br>\n";
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
<?php
|
||||
/* Copyright (C) 2004-2013 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
* Copyright (C) 2013 Juanjo Menent <jmenent@2byte.es>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -82,27 +83,27 @@ else if (preg_match('/del_(.*)/',$action,$reg))
|
||||
else if ($action == 'MAIN_SESSION_TIMEOUT')
|
||||
{
|
||||
if (! dolibarr_set_const($db, "MAIN_SESSION_TIMEOUT", $_POST["MAIN_SESSION_TIMEOUT"],'chaine',0,'',$conf->entity)) dol_print_error($db);
|
||||
else $mesg=$langs->trans("RecordModifiedSuccessfully");
|
||||
else setEventMessage($langs->trans("RecordModifiedSuccessfully"));
|
||||
}
|
||||
else if ($action == 'MAIN_UPLOAD_DOC')
|
||||
{
|
||||
if (! dolibarr_set_const($db, 'MAIN_UPLOAD_DOC',$_POST["MAIN_UPLOAD_DOC"],'chaine',0,'',$conf->entity)) dol_print_error($db);
|
||||
else $mesg=$langs->trans("RecordModifiedSuccessfully");
|
||||
else setEventMessage($langs->trans("RecordModifiedSuccessfully"));
|
||||
}
|
||||
else if ($action == 'MAIN_UMASK')
|
||||
{
|
||||
if (! dolibarr_set_const($db, "MAIN_UMASK", $_POST["MAIN_UMASK"],'chaine',0,'',$conf->entity)) dol_print_error($db);
|
||||
else $mesg=$langs->trans("RecordModifiedSuccessfully");
|
||||
else setEventMessage($langs->trans("RecordModifiedSuccessfully"));
|
||||
}
|
||||
else if ($action == 'MAIN_ANTIVIRUS_COMMAND')
|
||||
{
|
||||
if (! dolibarr_set_const($db, "MAIN_ANTIVIRUS_COMMAND", $_POST["MAIN_ANTIVIRUS_COMMAND"],'chaine',0,'',$conf->entity)) dol_print_error($db);
|
||||
else $mesg=$langs->trans("RecordModifiedSuccessfully");
|
||||
else setEventMessage($langs->trans("RecordModifiedSuccessfully"));
|
||||
}
|
||||
else if ($action == 'MAIN_ANTIVIRUS_PARAM')
|
||||
{
|
||||
if (! dolibarr_set_const($db, "MAIN_ANTIVIRUS_PARAM", $_POST["MAIN_ANTIVIRUS_PARAM"],'chaine',0,'',$conf->entity)) dol_print_error($db);
|
||||
else $mesg=$langs->trans("RecordModifiedSuccessfully");
|
||||
else setEventMessage($langs->trans("RecordModifiedSuccessfully"));
|
||||
}
|
||||
|
||||
// Delete file
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
<?php
|
||||
/* Copyright (C) 2007-2011 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2009 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
* Copyright (C) 2013 Juanjo Menent <jmenent@2byte.es>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -87,25 +88,25 @@ if ($action == 'send' && ! $_POST['cancel'])
|
||||
|
||||
if (! empty($formsms->error))
|
||||
{
|
||||
$message='<div class="error">'.$formsms->error.'</div>';
|
||||
setEventMessage($formsms->error,'errors');
|
||||
$action='test';
|
||||
$error++;
|
||||
}
|
||||
if (empty($body))
|
||||
{
|
||||
$message='<div class="error">'.$langs->trans("ErrorFieldRequired",$langs->transnoentities("Message")).'</div>';
|
||||
setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentities("Message")),'errors');
|
||||
$action='test';
|
||||
$error++;
|
||||
}
|
||||
if (empty($smsfrom) || ! str_replace('+','',$smsfrom))
|
||||
{
|
||||
$message='<div class="error">'.$langs->trans("ErrorFieldRequired",$langs->transnoentities("SmsFrom")).'</div>';
|
||||
setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentities("SmsFrom")),'errors');
|
||||
$action='test';
|
||||
$error++;
|
||||
}
|
||||
if (empty($sendto) || ! str_replace('+','',$sendto))
|
||||
{
|
||||
$message='<div class="error">'.$langs->trans("ErrorFieldRequired",$langs->transnoentities("SmsTo")).'</div>';
|
||||
setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentities("SmsTo")),'errors');
|
||||
$action='test';
|
||||
$error++;
|
||||
}
|
||||
@@ -122,11 +123,11 @@ if ($action == 'send' && ! $_POST['cancel'])
|
||||
|
||||
if ($result)
|
||||
{
|
||||
$message='<div class="ok">'.$langs->trans("SmsSuccessfulySent",$smsfrom,$sendto).'</div>';
|
||||
setEventMessage($langs->trans("SmsSuccessfulySent",$smsfrom,$sendto));
|
||||
}
|
||||
else
|
||||
{
|
||||
$message='<div class="error">'.$langs->trans("ResultKo").'<br>'.$smsfile->error.' '.$result.'</div>';
|
||||
setEventMessage($langs->trans("ResultKo"),'errors');
|
||||
}
|
||||
|
||||
$action='';
|
||||
@@ -151,8 +152,6 @@ print_fiche_titre($langs->trans("SmsSetup"),'','setup');
|
||||
print $langs->trans("SmsDesc")."<br>\n";
|
||||
print "<br>\n";
|
||||
|
||||
dol_htmloutput_mesg($message);
|
||||
|
||||
// List of sending methods
|
||||
$listofmethods=(is_array($conf->modules_parts['sms'])?$conf->modules_parts['sms']:array());
|
||||
asort($listofmethods);
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
* Copyright (C) 2004 Sebastien Di Cintio <sdicintio@ressource-toi.org>
|
||||
* Copyright (C) 2004 Benoit Mortier <benoit.mortier@opensides.be>
|
||||
* Copyright (C) 2005-2011 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
* Copyright (C) 2011 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2011-2013 Juanjo Menent <jmenent@2byte.es>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -70,11 +70,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,9 +117,6 @@ $head = mailmanspip_admin_prepare_head();
|
||||
|
||||
dol_fiche_head($head, 'spip', $langs->trans("Setup"), 0, 'user');
|
||||
|
||||
|
||||
dol_htmloutput_mesg($mesg);
|
||||
|
||||
/*
|
||||
* Spip
|
||||
*/
|
||||
|
||||
@@ -2,9 +2,9 @@
|
||||
/* Copyright (C) 2006 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2008-2010 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2005-2009 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
* Copyright (C) 2012 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2012-2013 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2013 Philippe Grand <philippe.grand@atoo-net.com>
|
||||
* Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
|
||||
* Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -85,12 +85,12 @@ if($action)
|
||||
if (! $error)
|
||||
{
|
||||
$db->commit();
|
||||
$mesg = "<font class=\"ok\">".$langs->trans("SetupSaved")."</font>";
|
||||
setEventMessage($langs->trans("SetupSaved"));
|
||||
}
|
||||
else
|
||||
{
|
||||
$db->rollback();
|
||||
$mesg = "<font class=\"error\">".$langs->trans("Error")."</font>";
|
||||
setEventMessage($langs->trans("Error"),'errors');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -269,8 +269,6 @@ print "</td>\n";
|
||||
print "</tr>\n";
|
||||
print '</table>';
|
||||
|
||||
dol_htmloutput_mesg($mesg);
|
||||
|
||||
$db->close();
|
||||
|
||||
llxFooter();
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
* Copyright (C) 2005-2011 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
* Copyright (C) 2004 Sebastien Di Cintio <sdicintio@ressource-toi.org>
|
||||
* Copyright (C) 2004 Benoit Mortier <benoit.mortier@opensides.be>
|
||||
* Copyright (C) 2010-2012 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2010-2013 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2011-2013 Philippe Grand <philippe.grand@atoo-net.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
@@ -61,14 +61,14 @@ if ($action == 'updateMask')
|
||||
|
||||
if (! $res > 0) $error++;
|
||||
|
||||
if (! $error)
|
||||
{
|
||||
$mesg = "<font class=\"ok\">".$langs->trans("SetupSaved")."</font>";
|
||||
}
|
||||
else
|
||||
{
|
||||
$mesg = "<font class=\"error\">".$langs->trans("Error")."</font>";
|
||||
}
|
||||
if (! $error)
|
||||
{
|
||||
setEventMessage($langs->trans("SetupSaved"));
|
||||
}
|
||||
else
|
||||
{
|
||||
setEventMessage($langs->trans("Error"),'errors');
|
||||
}
|
||||
}
|
||||
|
||||
if ($action == 'specimen') // For invoices
|
||||
@@ -106,13 +106,13 @@ if ($action == 'specimen') // For invoices
|
||||
}
|
||||
else
|
||||
{
|
||||
$mesg='<font class="error">'.$module->error.'</font>';
|
||||
setEventMessage($module->error,'errors');
|
||||
dol_syslog($module->error, LOG_ERR);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$mesg='<font class="error">'.$langs->trans("ErrorModuleNotFound").'</font>';
|
||||
setEventMessage($langs->trans("ErrorModuleNotFound"),'errors');
|
||||
dol_syslog($langs->trans("ErrorModuleNotFound"), LOG_ERR);
|
||||
}
|
||||
}
|
||||
@@ -172,14 +172,14 @@ if ($action == 'set_SUPPLIER_INVOICE_FREE_TEXT')
|
||||
|
||||
if (! $res > 0) $error++;
|
||||
|
||||
if (! $error)
|
||||
{
|
||||
$mesg = "<font class=\"ok\">".$langs->trans("SetupSaved")."</font>";
|
||||
}
|
||||
else
|
||||
{
|
||||
$mesg = "<font class=\"error\">".$langs->trans("Error")."</font>";
|
||||
}
|
||||
if (! $error)
|
||||
{
|
||||
setEventMessage($langs->trans("SetupSaved"));
|
||||
}
|
||||
else
|
||||
{
|
||||
setEventMessage($langs->trans("Error"),'errors');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -467,8 +467,6 @@ print '<input type="submit" class="button" value="'.$langs->trans("Modify").'">'
|
||||
print "</td></tr>\n";
|
||||
print '</form>';
|
||||
|
||||
dol_htmloutput_mesg($mesg);
|
||||
|
||||
$db->close();
|
||||
llxFooter();
|
||||
?>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
* Copyright (C) 2005-2011 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
* Copyright (C) 2004 Sebastien Di Cintio <sdicintio@ressource-toi.org>
|
||||
* Copyright (C) 2004 Benoit Mortier <benoit.mortier@opensides.be>
|
||||
* Copyright (C) 2010-2012 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2010-2013 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2011-2013 Philippe Grand <philippe.grand@atoo-net.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
@@ -61,14 +61,14 @@ if ($action == 'updateMask')
|
||||
|
||||
if (! $res > 0) $error++;
|
||||
|
||||
if (! $error)
|
||||
{
|
||||
$mesg = "<font class=\"ok\">".$langs->trans("SetupSaved")."</font>";
|
||||
}
|
||||
else
|
||||
{
|
||||
$mesg = "<font class=\"error\">".$langs->trans("Error")."</font>";
|
||||
}
|
||||
if (! $error)
|
||||
{
|
||||
setEventMessage($langs->trans("SetupSaved"));
|
||||
}
|
||||
else
|
||||
{
|
||||
setEventMessage($langs->trans("Error"),'errors');
|
||||
}
|
||||
}
|
||||
|
||||
else if ($action == 'specimen') // For orders
|
||||
@@ -106,13 +106,13 @@ else if ($action == 'specimen') // For orders
|
||||
}
|
||||
else
|
||||
{
|
||||
$mesg='<font class="error">'.$module->error.'</font>';
|
||||
setEventMessage($module->error,'errors');
|
||||
dol_syslog($module->error, LOG_ERR);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$mesg='<font class="error">'.$langs->trans("ErrorModuleNotFound").'</font>';
|
||||
setEventMessage($langs->trans("ErrorModuleNotFound"),'errors');
|
||||
dol_syslog($langs->trans("ErrorModuleNotFound"), LOG_ERR);
|
||||
}
|
||||
}
|
||||
@@ -172,14 +172,14 @@ else if ($action == 'set_SUPPLIER_ORDER_FREE_TEXT')
|
||||
|
||||
if (! $res > 0) $error++;
|
||||
|
||||
if (! $error)
|
||||
{
|
||||
$mesg = "<font class=\"ok\">".$langs->trans("SetupSaved")."</font>";
|
||||
}
|
||||
else
|
||||
{
|
||||
$mesg = "<font class=\"error\">".$langs->trans("Error")."</font>";
|
||||
}
|
||||
if (! $error)
|
||||
{
|
||||
setEventMessage($langs->trans("SetupSaved"));
|
||||
}
|
||||
else
|
||||
{
|
||||
setEventMessage($langs->trans("Error"),'errors');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -462,8 +462,6 @@ print '<input type="submit" class="button" value="'.$langs->trans("Modify").'">'
|
||||
print "</td></tr>\n";
|
||||
print '</form>';
|
||||
|
||||
dol_htmloutput_mesg($mesg);
|
||||
|
||||
$db->close();
|
||||
llxFooter();
|
||||
?>
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
/* Copyright (C) 2005-2012 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2005-2009 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
* Copyright (C) 2007 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2013 Juanjo Menent <jmenent@2byte.es>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -31,7 +32,7 @@ if (!$user->admin) accessforbidden();
|
||||
$langs->load("admin");
|
||||
$langs->load("other");
|
||||
|
||||
$error=0; $mesg='';
|
||||
$error=0;
|
||||
$action = GETPOST("action");
|
||||
|
||||
$syslogModules = array();
|
||||
@@ -110,12 +111,12 @@ if ($action == 'set')
|
||||
if (! $error)
|
||||
{
|
||||
$db->commit();
|
||||
$mesg = "<font class=\"ok\">".$langs->trans("SetupSaved")."</font>";
|
||||
setEventMessage($langs->trans("SetupSaved"));
|
||||
}
|
||||
else
|
||||
{
|
||||
$db->rollback();
|
||||
if (empty($mesg)) $mesg = "<font class=\"error\">".$langs->trans("Error")."</font>";
|
||||
setEventMessage($langs->trans("Error"),'errors');
|
||||
}
|
||||
|
||||
}
|
||||
@@ -129,12 +130,12 @@ if ($action == 'setlevel')
|
||||
|
||||
if (! $res > 0) $error++;
|
||||
if (! $error)
|
||||
{
|
||||
$mesg = "<font class=\"ok\">".$langs->trans("SetupSaved")."</font>";
|
||||
}
|
||||
else
|
||||
{
|
||||
$mesg = "<font class=\"error\">".$langs->trans("Error")."</font>";
|
||||
{
|
||||
setEventMessage($langs->trans("SetupSaved"));
|
||||
}
|
||||
else
|
||||
{
|
||||
setEventMessage($langs->trans("Error"),'errors');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -249,8 +250,6 @@ print '</td></tr>';
|
||||
print '</table>';
|
||||
print "</form>\n";
|
||||
|
||||
dol_htmloutput_mesg($mesg);
|
||||
|
||||
llxFooter();
|
||||
|
||||
$db->close();
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
/* Copyright (C) 2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2004-2008 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2005-2009 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
* Copyright (C) 2011-2012 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2011-2013 Juanjo Menent <jmenent@2byte.es>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -82,12 +82,12 @@ if ($action == 'settaxmode')
|
||||
if (! $error)
|
||||
{
|
||||
$db->commit();
|
||||
$mesg = "<font class=\"ok\">".$langs->trans("SetupSaved")."</font>";
|
||||
setEventMessage($langs->trans("SetupSaved"));
|
||||
}
|
||||
else
|
||||
{
|
||||
$db->rollback();
|
||||
$mesg = "<font class=\"error\">".$langs->trans("Error")."</font>";
|
||||
setEventMessage($langs->trans("Error"),'errors');
|
||||
}
|
||||
|
||||
|
||||
@@ -208,8 +208,6 @@ else
|
||||
print '</table>';
|
||||
}
|
||||
|
||||
dol_htmloutput_mesg($mesg);
|
||||
|
||||
$db->close();
|
||||
|
||||
llxFooter();
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
* Copyright (C) 2006 Andre Cianfarani <acianfa@free.fr>
|
||||
* Copyright (C) 2010-2013 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2010-2011 Philippe Grand <philippe.grand@atoo-net.com>
|
||||
* Copyright (C) 2012 Christophe Battarel <christophe.battarel@altairis.fr>
|
||||
* Copyright (C) 2012-2013 Christophe Battarel <christophe.battarel@altairis.fr>
|
||||
* Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
@@ -724,9 +724,16 @@ else if ($action == "addline" && $user->rights->propal->creer)
|
||||
$price_base_type = $prod->price_base_type;
|
||||
}
|
||||
|
||||
// if price ht is forced (ie: calculated by margin rate and cost price)
|
||||
if (!empty($price_ht))
|
||||
{
|
||||
$pu_ht = price2num($price_ht, 'MU');
|
||||
$pu_ttc = price2num($pu_ht * (1 + ($tva_tx/100)), 'MU');
|
||||
}
|
||||
|
||||
// On reevalue prix selon taux tva car taux tva transaction peut etre different
|
||||
// de ceux du produit par defaut (par exemple si pays different entre vendeur et acheteur).
|
||||
if ($tva_tx != $prod->tva_tx)
|
||||
elseif ($tva_tx != $prod->tva_tx)
|
||||
{
|
||||
if ($price_base_type != 'HT')
|
||||
{
|
||||
@@ -861,6 +868,8 @@ else if ($action == "addline" && $user->rights->propal->creer)
|
||||
unset($_POST['product_desc']);
|
||||
unset($_POST['fournprice']);
|
||||
unset($_POST['buying_price']);
|
||||
unset($_POST['np_marginRate']);
|
||||
unset($_POST['np_markRate']);
|
||||
|
||||
// old method
|
||||
unset($_POST['np_desc']);
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
* Copyright (C) 2006 Andre Cianfarani <acianfa@free.fr>
|
||||
* Copyright (C) 2010-2013 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2011 Philippe Grand <philippe.grand@atoo-net.com>
|
||||
* Copyright (C) 2012 Christophe Battarel <christophe.battarel@altairis.fr>
|
||||
* Copyright (C) 2012-2013 Christophe Battarel <christophe.battarel@altairis.fr>
|
||||
* Copyright (C) 2012 Marcos García <marcosgdf@gmail.com>
|
||||
* Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
|
||||
*
|
||||
@@ -666,9 +666,16 @@ else if ($action == 'addline' && $user->rights->commande->creer)
|
||||
$price_base_type = $prod->price_base_type;
|
||||
}
|
||||
|
||||
// if price ht is forced (ie: calculated by margin rate and cost price)
|
||||
if (!empty($price_ht))
|
||||
{
|
||||
$pu_ht = price2num($price_ht, 'MU');
|
||||
$pu_ttc = price2num($pu_ht * (1 + ($tva_tx/100)), 'MU');
|
||||
}
|
||||
|
||||
// On reevalue prix selon taux tva car taux tva transaction peut etre different
|
||||
// de ceux du produit par defaut (par exemple si pays different entre vendeur et acheteur).
|
||||
if ($tva_tx != $prod->tva_tx)
|
||||
elseif ($tva_tx != $prod->tva_tx)
|
||||
{
|
||||
if ($price_base_type != 'HT')
|
||||
{
|
||||
@@ -806,6 +813,8 @@ else if ($action == 'addline' && $user->rights->commande->creer)
|
||||
unset($_POST['product_desc']);
|
||||
unset($_POST['fournprice']);
|
||||
unset($_POST['buying_price']);
|
||||
unset($_POST['np_marginRate']);
|
||||
unset($_POST['np_markRate']);
|
||||
|
||||
// old method
|
||||
unset($_POST['np_desc']);
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
* Copyright (C) 2006 Andre Cianfarani <acianfa@free.fr>
|
||||
* Copyright (C) 2010-2013 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2012 Christophe Battarel <christophe.battarel@altairis.fr>
|
||||
* Copyright (C) 2012-2013 Christophe Battarel <christophe.battarel@altairis.fr>
|
||||
* Copyright (C) 2013 Jean-Francois FERRY <jfefe@aternatik.fr>
|
||||
* Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
|
||||
*
|
||||
@@ -1227,9 +1227,16 @@ else if (($action == 'addline' || $action == 'addline_predef') && $user->rights-
|
||||
$price_base_type = $prod->price_base_type;
|
||||
}
|
||||
|
||||
// if price ht is forced (ie: calculated by margin rate and cost price)
|
||||
if (!empty($price_ht))
|
||||
{
|
||||
$pu_ht = price2num($price_ht, 'MU');
|
||||
$pu_ttc = price2num($pu_ht * (1 + ($tva_tx/100)), 'MU');
|
||||
}
|
||||
|
||||
// On reevalue prix selon taux tva car taux tva transaction peut etre different
|
||||
// de ceux du produit par defaut (par exemple si pays different entre vendeur et acheteur).
|
||||
if ($tva_tx != $prod->tva_tx)
|
||||
elseif ($tva_tx != $prod->tva_tx)
|
||||
{
|
||||
if ($price_base_type != 'HT')
|
||||
{
|
||||
@@ -1367,6 +1374,8 @@ else if (($action == 'addline' || $action == 'addline_predef') && $user->rights-
|
||||
unset($_POST['product_desc']);
|
||||
unset($_POST['fournprice']);
|
||||
unset($_POST['buying_price']);
|
||||
unset($_POST['np_marginRate']);
|
||||
unset($_POST['np_markRate']);
|
||||
|
||||
// old method
|
||||
unset($_POST['np_desc']);
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
/* Copyright (C) 2006-2012 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
* Copyright (C) 2010-2011 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2010-2013 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2012 Christophe Battarel <christophe.battarel@altairis.fr>
|
||||
* Copyright (C) 2011-2012 Philippe Grand <philippe.grand@atoo-net.com>
|
||||
* Copyright (C) 2012 Marcos García <marcosgdf@gmail.com>
|
||||
@@ -2229,7 +2229,14 @@ abstract class CommonObject
|
||||
}else {
|
||||
$colspan='3';
|
||||
}
|
||||
$value=(isset($_POST["options_".$key])?$_POST["options_".$key]:$this->array_options["options_".$key]);
|
||||
switch($mode) {
|
||||
case "view":
|
||||
$value=$this->array_options["options_".$key];
|
||||
break;
|
||||
case "edit":
|
||||
$value=(isset($_POST["options_".$key])?$_POST["options_".$key]:$this->array_options["options_".$key]);
|
||||
break;
|
||||
}
|
||||
if ($extrafields->attribute_type[$key] == 'separate')
|
||||
{
|
||||
$out .= $extrafields->showSeparator($key);
|
||||
@@ -2602,6 +2609,7 @@ abstract class CommonObject
|
||||
{
|
||||
global $conf,$langs,$object,$hookmanager;
|
||||
global $form,$bcnd,$var;
|
||||
global $user;
|
||||
//Line extrafield
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php';
|
||||
$extrafieldsline = new ExtraFields($this->db);
|
||||
@@ -2626,6 +2634,7 @@ abstract class CommonObject
|
||||
{
|
||||
global $conf,$langs,$object,$hookmanager;
|
||||
global $form,$bcnd,$var;
|
||||
global $user;
|
||||
|
||||
//Line extrafield
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php';
|
||||
@@ -2722,9 +2731,9 @@ abstract class CommonObject
|
||||
else
|
||||
print '<td align="right" width="80">'.$langs->trans('CostPrice').'</td>';
|
||||
|
||||
if (! empty($conf->global->DISPLAY_MARGIN_RATES))
|
||||
if (! empty($conf->global->DISPLAY_MARGIN_RATES) && $user->rights->margins->liretous)
|
||||
print '<td align="right" width="50">'.$langs->trans('MarginRate').'</td>';
|
||||
if (! empty($conf->global->DISPLAY_MARK_RATES))
|
||||
if (! empty($conf->global->DISPLAY_MARK_RATES) && $user->rights->margins->liretous)
|
||||
print '<td align="right" width="50">'.$langs->trans('MarkRate').'</td>';
|
||||
}
|
||||
|
||||
@@ -3160,6 +3169,8 @@ abstract class CommonObject
|
||||
global $langs, $conf, $user;
|
||||
|
||||
if (! empty($user->societe_id)) return;
|
||||
|
||||
if (! $user->rights->margins->liretous) return;
|
||||
|
||||
$marginInfo = $this->getMarginInfos($force_price);
|
||||
|
||||
@@ -3213,3 +3224,4 @@ abstract class CommonObject
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
||||
|
||||
@@ -79,8 +79,8 @@ class modMargin extends DolibarrModules
|
||||
|
||||
// New pages on tabs
|
||||
$this->tabs = array(
|
||||
'product:+margin:Margins:margins:$conf->margin->enabled:/margin/tabs/productMargins.php?id=__ID__',
|
||||
'thirdparty:+margin:Margins:margins:$conf->margin->enabled && empty($user->societe_id):/margin/tabs/thirdpartyMargins.php?socid=__ID__'
|
||||
'product:+margin:Margins:margins:$user->rights->margins->liretous:/margin/tabs/productMargins.php?id=__ID__',
|
||||
'thirdparty:+margin:Margins:margins:empty($user->societe_id) && $user->rights->margins->liretous:/margin/tabs/thirdpartyMargins.php?socid=__ID__'
|
||||
);
|
||||
|
||||
|
||||
@@ -106,11 +106,30 @@ class modMargin extends DolibarrModules
|
||||
'url'=>'/margin/index.php',
|
||||
'langs'=>'margins', // Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory.
|
||||
'position'=>100,
|
||||
'enabled'=>'$conf->margin->enabled', // Define condition to show or hide menu entry. Use '$conf->monmodule->enabled' if entry must be visible if module is enabled.
|
||||
'enabled'=>'$user->rights->margins->liretous', // Define condition to show or hide menu entry. Use '$conf->monmodule->enabled' if entry must be visible if module is enabled.
|
||||
'perms'=>'1', // Use 'perms'=>'$user->rights->monmodule->level1->level2' if you want your menu with a permission rules
|
||||
'target'=>'',
|
||||
'user'=>2); // 0=Menu for internal users, 1=external users, 2=both
|
||||
$r++;
|
||||
|
||||
// Permissions
|
||||
$this->rights = array();
|
||||
$this->rights_class = 'margins';
|
||||
$r=0;
|
||||
|
||||
$r++;
|
||||
$this->rights[$r][0] = 59001; // id de la permission
|
||||
$this->rights[$r][1] = 'Visualiser les marges'; // libelle de la permission
|
||||
$this->rights[$r][2] = 'r'; // type de la permission (deprecie a ce jour)
|
||||
$this->rights[$r][3] = 1; // La permission est-elle une permission par defaut
|
||||
$this->rights[$r][4] = 'liretous';
|
||||
|
||||
$r++;
|
||||
$this->rights[$r][0] = 59002; // id de la permission
|
||||
$this->rights[$r][1] = 'Définir les marges'; // libelle de la permission
|
||||
$this->rights[$r][2] = 'w'; // type de la permission (deprecie a ce jour)
|
||||
$this->rights[$r][3] = 0; // La permission est-elle une permission par defaut
|
||||
$this->rights[$r][4] = 'creer';
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -290,7 +290,7 @@ class pdf_muscadet extends ModelePDFSuppliersOrders
|
||||
$showpricebeforepagebreak=1;
|
||||
|
||||
$pdf->startTransaction();
|
||||
pdf_writelinedesc($pdf,$object,$i,$outputlangs,$this->posxtva-$curX,3,$curX,$curY,$hideref,$hidedesc);
|
||||
pdf_writelinedesc($pdf,$object,$i,$outputlangs,$this->posxtva-$curX,3,$curX,$curY,$hideref,$hidedesc,1);
|
||||
$pageposafter=$pdf->getPage();
|
||||
if ($pageposafter > $pageposbefore) // There is a pagebreak
|
||||
{
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
/* Copyright (C) 2010-2012 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
* Copyright (C) 2010-2013 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2012 Christophe Battarel <christophe.battarel@altairis.fr>
|
||||
* Copyright (C) 2012-2013 Christophe Battarel <christophe.battarel@altairis.fr>
|
||||
* Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
@@ -61,8 +61,22 @@ if (! empty($conf->margin->enabled) && ! empty($object->element) && in_array($ob
|
||||
?>
|
||||
</td>
|
||||
<?php
|
||||
if (! empty($conf->global->DISPLAY_MARGIN_RATES)) $colspan++;
|
||||
if (! empty($conf->global->DISPLAY_MARK_RATES)) $colspan++;
|
||||
if ($user->rights->margins->creer)
|
||||
{
|
||||
if(! empty($conf->global->DISPLAY_MARGIN_RATES))
|
||||
{
|
||||
echo '<td align="right">'.$langs->trans('MarginRate').'</td>';
|
||||
}
|
||||
if(! empty($conf->global->DISPLAY_MARK_RATES))
|
||||
{
|
||||
echo '<td align="right">'.$langs->trans('MarkRate').'</td>';
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (! empty($conf->global->DISPLAY_MARGIN_RATES)) $colspan++;
|
||||
if (! empty($conf->global->DISPLAY_MARK_RATES)) $colspan++;
|
||||
}
|
||||
}
|
||||
?>
|
||||
<td colspan="<?php echo $colspan; ?>"> </td>
|
||||
@@ -109,7 +123,7 @@ if (! empty($conf->margin->enabled) && ! empty($object->element) && in_array($ob
|
||||
<td align="right"><input type="text" size="5" name="price_ht" class="flat" value="<?php echo (isset($_POST["price_ht"])?$_POST["price_ht"]:''); ?>">
|
||||
</td>
|
||||
<td align="right"><input type="text" size="2" name="qty" class="flat" value="<?php echo (isset($_POST["qty"])?$_POST["qty"]:1); ?>"></td>
|
||||
<td align="right" class="nowrap"><input type="text" size="1" class="flat" value="<?php echo $buyer->remise_percent; ?>" name="remise_percent"><span class="hideonsmartphone">%</span></td>
|
||||
<td align="right" class="nowrap"><input type="text" size="1" class="flat" value="<?php echo (isset($_POST["remise_percent"])?$_POST["remise_percent"]:$buyer->remise_client); ?>" name="remise_percent"><span class="hideonsmartphone">%</span></td>
|
||||
<?php
|
||||
$colspan = 4;
|
||||
if (! empty($usemargins))
|
||||
@@ -119,6 +133,17 @@ if (! empty($conf->margin->enabled) && ! empty($object->element) && in_array($ob
|
||||
value="<?php echo (isset($_POST["buying_price"])?$_POST["buying_price"]:''); ?>">
|
||||
</td>
|
||||
<?php
|
||||
if ($user->rights->margins->creer)
|
||||
{
|
||||
if (! empty($conf->global->DISPLAY_MARGIN_RATES)) {
|
||||
echo '<td align="right"><input type="text" size="2" name="np_marginRate" value="'.(isset($_POST["np_marginRate"])?$_POST["np_marginRate"]:'').'">%</td>';
|
||||
}
|
||||
elseif (! empty($conf->global->DISPLAY_MARK_RATES)) {
|
||||
echo '<td align="right"><input type="text" size="2" name="np_markRate" value="'.(isset($_POST["np_markRate"])?$_POST["np_markRate"]:'').'">%</td>';
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (! empty($conf->global->DISPLAY_MARGIN_RATES)) {
|
||||
$colspan++;
|
||||
$coldisplay++;
|
||||
@@ -127,6 +152,7 @@ if (! empty($conf->margin->enabled) && ! empty($object->element) && in_array($ob
|
||||
$colspan++;
|
||||
$coldisplay++;
|
||||
}
|
||||
}
|
||||
}
|
||||
?>
|
||||
<td align="center" valign="middle" colspan="<?php echo $colspan; ?>"><input type="submit" class="button" value="<?php echo $langs->trans('Add'); ?>" name="addline"></td>
|
||||
@@ -185,4 +211,102 @@ if (! empty($conf->service->enabled) && $dateSelector)
|
||||
?>
|
||||
|
||||
</form>
|
||||
|
||||
<?php if ($conf->margin->enabled && $user->rights->margins->creer)
|
||||
{
|
||||
?>
|
||||
<script type="text/javascript">
|
||||
var npRate = null;
|
||||
<?php
|
||||
if (! empty($conf->global->DISPLAY_MARGIN_RATES)) { ?>
|
||||
npRate = "np_marginRate";
|
||||
<?php }
|
||||
elseif (! empty($conf->global->DISPLAY_MARK_RATES)) { ?>
|
||||
npRate = "np_markRate";
|
||||
<?php }
|
||||
?>
|
||||
|
||||
$("form#addproduct").submit(function(e) {
|
||||
if (npRate) return checkFreeLine(e, npRate);
|
||||
else return true;
|
||||
});
|
||||
if (npRate == 'np_marginRate') {
|
||||
$("input[name='np_marginRate']:first").blur(function(e) {
|
||||
return checkFreeLine(e, npRate);
|
||||
});
|
||||
}
|
||||
else {
|
||||
if (npRate == 'np_markRate') {
|
||||
$("input[name='np_markRate']:first").blur(function(e) {
|
||||
return checkFreeLine(e, npRate);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
function checkFreeLine(e, npRate)
|
||||
{
|
||||
var buying_price = $("input[name='buying_price']:first");
|
||||
var remise = $("input[name='remise_percent']:first");
|
||||
|
||||
var rate = $("input[name='"+npRate+"']:first");
|
||||
if (rate.val() == '')
|
||||
return true;
|
||||
if (! $.isNumeric(rate.val().replace(',','.')))
|
||||
{
|
||||
alert('<?php echo $langs->trans("rateMustBeNumeric"); ?>');
|
||||
e.stopPropagation();
|
||||
setTimeout(function () { rate.focus() }, 50);
|
||||
return false;
|
||||
}
|
||||
if (npRate == "np_markRate" && rate.val() >= 100)
|
||||
{
|
||||
alert('<?php echo $langs->trans("markRateShouldBeLesserThan100"); ?>');
|
||||
e.stopPropagation();
|
||||
setTimeout(function () { rate.focus() }, 50);
|
||||
return false;
|
||||
}
|
||||
|
||||
var np_price = 0;
|
||||
if (remise.val().replace(',','.') != 100)
|
||||
{
|
||||
if (npRate == "np_marginRate")
|
||||
np_price = ((buying_price.val().replace(',','.') * (1 + rate.val().replace(',','.') / 100)) / (1 - remise.val().replace(',','.') / 100));
|
||||
else {
|
||||
if (npRate == "np_markRate")
|
||||
np_price = ((buying_price.val().replace(',','.') / (1 - rate.val().replace(',','.') / 100)) / (1 - remise.val().replace(',','.') / 100));
|
||||
}
|
||||
}
|
||||
$("input[name='price_ht']:first").val(formatFloat(np_price));
|
||||
|
||||
return true;
|
||||
}
|
||||
function roundFloat(num) {
|
||||
var main_max_dec_shown = <?php echo $conf->global->MAIN_MAX_DECIMALS_SHOWN; ?>;
|
||||
var main_rounding = <?php echo min($conf->global->MAIN_MAX_DECIMALS_UNIT,$conf->global->MAIN_MAX_DECIMALS_TOT); ?>;
|
||||
|
||||
var amount = num.toString().replace(',','.'); // should be useless
|
||||
var nbdec = 0;
|
||||
var rounding = main_rounding;
|
||||
var pos = amount.indexOf('.');
|
||||
var decpart = '';
|
||||
if (pos >= 0)
|
||||
decpart = amount.substr(pos+1).replace('/0+$/i',''); // Supprime les 0 de fin de partie decimale
|
||||
nbdec = decpart.length;
|
||||
if (nbdec > rounding)
|
||||
rounding = nbdec;
|
||||
// Si on depasse max
|
||||
if (rounding > main_max_dec_shown)
|
||||
{
|
||||
rounding = main_max_dec_shown;
|
||||
}
|
||||
//amount = parseFloat(amount) + (1 / Math.pow(100, rounding)); // to avoid floating-point errors
|
||||
return parseFloat(amount).toFixed(rounding);
|
||||
}
|
||||
|
||||
function formatFloat(num) {
|
||||
return roundFloat(num).replace('.', ',');
|
||||
}
|
||||
|
||||
</script>
|
||||
<?php } ?>
|
||||
<!-- END PHP TEMPLATE freeproductline_create.tpl.php -->
|
||||
|
||||
@@ -123,11 +123,11 @@
|
||||
if (! empty($conf->margin->enabled) && empty($user->societe_id)) {
|
||||
?>
|
||||
<td align="right" class="nowrap"><?php $coldisplay++; ?><?php echo price($line->pa_ht); ?></td>
|
||||
<?php if (! empty($conf->global->DISPLAY_MARGIN_RATES)) {?>
|
||||
<?php if (! empty($conf->global->DISPLAY_MARGIN_RATES) && $user->rights->margins->liretous) {?>
|
||||
<td align="right" class="nowrap"><?php $coldisplay++; ?><?php echo (($line->pa_ht == 0)?'n/a':price($line->marge_tx).'%'); ?></td>
|
||||
<?php
|
||||
}
|
||||
if (! empty($conf->global->DISPLAY_MARK_RATES)) {?>
|
||||
if (! empty($conf->global->DISPLAY_MARK_RATES) && $user->rights->margins->liretous) {?>
|
||||
<td align="right" class="nowrap"><?php $coldisplay++; ?><?php echo price($line->marque_tx).'%'; ?></td>
|
||||
<?php } } ?>
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
/* Copyright (C) 2010-2012 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
* Copyright (C) 2010-2012 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2012 Christophe Battarel <christophe.battarel@altairis.fr>
|
||||
* Copyright (C) 2012-2013 Christophe Battarel <christophe.battarel@altairis.fr>
|
||||
* Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
@@ -63,8 +63,6 @@ jQuery(document).ready(function() {
|
||||
$colspan = 4;
|
||||
if (! empty($usemargins))
|
||||
{
|
||||
if (! empty($conf->global->DISPLAY_MARGIN_RATES)) $colspan++;
|
||||
if (! empty($conf->global->DISPLAY_MARK_RATES)) $colspan++;
|
||||
?>
|
||||
<td align="right">
|
||||
<?php
|
||||
@@ -72,6 +70,23 @@ if (! empty($usemargins))
|
||||
echo $langs->trans('BuyingPrice');
|
||||
else
|
||||
echo $langs->trans('CostPrice');
|
||||
|
||||
if ($user->rights->margins->creer)
|
||||
{
|
||||
if(! empty($conf->global->DISPLAY_MARGIN_RATES))
|
||||
{
|
||||
echo '<td align="right">'.$langs->trans('MarginRate').'</td>';
|
||||
}
|
||||
if(! empty($conf->global->DISPLAY_MARK_RATES))
|
||||
{
|
||||
echo '<td align="right">'.$langs->trans('MarkRate').'</td>';
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (! empty($conf->global->DISPLAY_MARGIN_RATES)) $colspan++;
|
||||
if (! empty($conf->global->DISPLAY_MARK_RATES)) $colspan++;
|
||||
}
|
||||
?>
|
||||
</td>
|
||||
<?php
|
||||
@@ -113,26 +128,38 @@ else {
|
||||
$doleditor->Create();
|
||||
?>
|
||||
</td>
|
||||
<td align="right"><input type="text" size="2" name="qty" class="flat" value="1"></td>
|
||||
<td align="right"><input type="hidden" name="price_ht"><input type="text" size="2" name="qty" class="flat" value="1"></td>
|
||||
<td align="right" nowrap><input type="text" size="1" class="flat" name="remise_percent" value="<?php echo $buyer->remise_percent; ?>"><span class="hideonsmartphone">%</span></td>
|
||||
<?php
|
||||
$colspan = 4;
|
||||
if (! empty($usemargins))
|
||||
{
|
||||
if (! empty($conf->global->DISPLAY_MARGIN_RATES)) {
|
||||
$colspan++;
|
||||
$coldisplay++;
|
||||
}
|
||||
if (! empty($conf->global->DISPLAY_MARK_RATES)) {
|
||||
$colspan++;
|
||||
$coldisplay++;
|
||||
}
|
||||
?>
|
||||
<td align="right">
|
||||
<select id="fournprice" name="fournprice" class="flat" style="display: none;"></select>
|
||||
<input type="text" size="5" id="buying_price" name="buying_price" class="flat" value="<?php echo (isset($_POST["buying_price"])?$_POST["buying_price"]:''); ?>">
|
||||
</td>
|
||||
<?php
|
||||
if ($user->rights->margins->creer)
|
||||
{
|
||||
if (! empty($conf->global->DISPLAY_MARGIN_RATES)) {
|
||||
echo '<td align="right"><input type="text" size="2" name="np_marginRate" value="'.(isset($_POST["np_marginRate"])?$_POST["np_marginRate"]:'').'">%</td>';
|
||||
}
|
||||
elseif (! empty($conf->global->DISPLAY_MARK_RATES)) {
|
||||
echo '<td align="right"><input type="text" size="2" name="np_markRate" value="'.(isset($_POST["np_markRate"])?$_POST["np_markRate"]:'').'">%</td>';
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (! empty($conf->global->DISPLAY_MARGIN_RATES)) {
|
||||
$colspan++;
|
||||
$coldisplay++;
|
||||
}
|
||||
if (! empty($conf->global->DISPLAY_MARK_RATES)) {
|
||||
$colspan++;
|
||||
$coldisplay++;
|
||||
}
|
||||
}
|
||||
}
|
||||
?>
|
||||
<td align="center" valign="middle" colspan="<?php echo $colspan; ?>">
|
||||
@@ -200,6 +227,103 @@ if (! empty($usemargins))
|
||||
{
|
||||
?>
|
||||
<script type="text/javascript">
|
||||
<?php
|
||||
if ($user->rights->margins->creer)
|
||||
{
|
||||
?>
|
||||
var npRate = null;
|
||||
<?php
|
||||
if (! empty($conf->global->DISPLAY_MARGIN_RATES)) { ?>
|
||||
npRate = "np_marginRate";
|
||||
<?php }
|
||||
elseif (! empty($conf->global->DISPLAY_MARK_RATES)) { ?>
|
||||
npRate = "np_markRate";
|
||||
<?php }
|
||||
?>
|
||||
|
||||
$("form#addpredefinedproduct").submit(function(e) {
|
||||
if (npRate) return checkLine(e, npRate);
|
||||
else return true;
|
||||
});
|
||||
if (npRate == 'np_marginRate') {
|
||||
$("input[name='np_marginRate']:last").blur(function(e) {
|
||||
return checkLine(e, npRate);
|
||||
});
|
||||
}
|
||||
else {
|
||||
if (npRate == 'np_markRate') {
|
||||
$("input[name='np_markRate']:last").blur(function(e) {
|
||||
return checkLine(e, npRate);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
function checkLine(e, npRate)
|
||||
{
|
||||
var buying_price = $("input[name='buying_price']:last");
|
||||
var remise = $("input[name='remise_percent']:last");
|
||||
|
||||
var rate = $("input[name='"+npRate+"']:last");
|
||||
if (rate.val() == '')
|
||||
return true;
|
||||
if (! $.isNumeric(rate.val().replace(',','.')))
|
||||
{
|
||||
alert('<?php echo $langs->trans("rateMustBeNumeric"); ?>');
|
||||
e.stopPropagation();
|
||||
setTimeout(function () { rate.focus() }, 50);
|
||||
return false;
|
||||
}
|
||||
if (npRate == "np_markRate" && rate.val() >= 100)
|
||||
{
|
||||
alert('<?php echo $langs->trans("markRateShouldBeLesserThan100"); ?>');
|
||||
e.stopPropagation();
|
||||
setTimeout(function () { rate.focus() }, 50);
|
||||
return false;
|
||||
}
|
||||
|
||||
var np_price = 0;
|
||||
if (remise.val().replace(',','.') != 100)
|
||||
{
|
||||
if (npRate == "np_marginRate")
|
||||
np_price = ((buying_price.val().replace(',','.') * (1 + rate.val().replace(',','.') / 100)) / (1 - remise.val().replace(',','.') / 100));
|
||||
else {
|
||||
if (npRate == "np_markRate")
|
||||
np_price = ((buying_price.val().replace(',','.') / (1 - rate.val().replace(',','.') / 100)) / (1 - remise.val().replace(',','.') / 100));
|
||||
}
|
||||
}
|
||||
$("input[name='price_ht']:last").val(formatFloat(np_price));
|
||||
|
||||
return true;
|
||||
}
|
||||
function roundFloat(num) {
|
||||
var main_max_dec_shown = <?php echo $conf->global->MAIN_MAX_DECIMALS_SHOWN; ?>;
|
||||
var main_rounding = <?php echo min($conf->global->MAIN_MAX_DECIMALS_UNIT,$conf->global->MAIN_MAX_DECIMALS_TOT); ?>;
|
||||
|
||||
var amount = num.toString().replace(',','.'); // should be useless
|
||||
var nbdec = 0;
|
||||
var rounding = main_rounding;
|
||||
var pos = amount.indexOf('.');
|
||||
var decpart = '';
|
||||
if (pos >= 0)
|
||||
decpart = amount.substr(pos+1).replace('/0+$/i',''); // Supprime les 0 de fin de partie decimale
|
||||
nbdec = decpart.length;
|
||||
if (nbdec > rounding)
|
||||
rounding = nbdec;
|
||||
// Si on depasse max
|
||||
if (rounding > main_max_dec_shown)
|
||||
{
|
||||
rounding = main_max_dec_shown;
|
||||
}
|
||||
//amount = parseFloat(amount) + (1 / Math.pow(100, rounding)); // to avoid floating-point errors
|
||||
return parseFloat(amount).toFixed(rounding);
|
||||
}
|
||||
|
||||
function formatFloat(num) {
|
||||
return roundFloat(num).replace('.', ',');
|
||||
}
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
$("#idprod").change(function() {
|
||||
$("#fournprice options").remove();
|
||||
$("#fournprice").hide();
|
||||
|
||||
@@ -177,9 +177,9 @@ if ($resql)
|
||||
// Lignes des titres
|
||||
print "<tr class=\"liste_titre\">";
|
||||
print_liste_field_titre($langs->trans("Ref"),"liste.php", "p.ref",$param,"","",$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("RefSupplierShort"),"liste.php", "pf.ref_fourn",$param,"","",$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("RefSupplierShort"),"liste.php", "ppf.ref_fourn",$param,"","",$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("Label"),"liste.php", "p.label",$param,"","",$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("Supplier"),"liste.php", "pf.fk_soc",$param,"","",$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("Supplier"),"liste.php", "ppf.fk_soc",$param,"","",$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("BuyingPrice"),"liste.php", "ppf.price",$param,"",'align="right"',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("QtyMin"),"liste.php", "ppf.qty",$param,"",'align="right"',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("UnitPrice"),"liste.php", "ppf.unitprice",$param,"",'align="right"',$sortfield,$sortorder);
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
/* Copyright (C) 2003-2007 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2004-2009 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
* Copyright (C) 2013 Juanjo Menent <jmenent@2byte.es>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -121,7 +122,7 @@ if ($id > 0 || ! empty($ref))
|
||||
print '</div>';
|
||||
|
||||
|
||||
$sql = "SELECT distinct s.nom, s.rowid as socid, s.code_client, f.facnumber, f.total_ht as total_ht,";
|
||||
$sql = "SELECT distinct s.nom, s.rowid as socid, s.code_client, f.ref, f.total_ht as total_ht,";
|
||||
$sql.= " f.datef, f.paye, f.fk_statut as statut, f.rowid as facid";
|
||||
if (!$user->rights->societe->client->voir && !$socid) $sql.= ", sc.fk_soc, sc.fk_user ";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."societe as s";
|
||||
|
||||
@@ -105,7 +105,7 @@
|
||||
|
||||
<tr>
|
||||
<td valign="top"><?php echo $langs->trans('Address'); ?></td>
|
||||
<td colspan="3"><textarea name="adresse" cols="40" rows="3"><?php echo $this->control->tpl['address']; ?></textarea></td>
|
||||
<td colspan="3"><textarea name="adress" cols="40" rows="3"><?php echo $this->control->tpl['address']; ?></textarea></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
@@ -127,7 +127,7 @@
|
||||
|
||||
<tr>
|
||||
<td><?php echo $langs->trans('Phone'); ?></td>
|
||||
<td><input type="text" name="tel" value="<?php echo $this->control->tpl['tel']; ?>"></td>
|
||||
<td><input type="text" name="phone" value="<?php echo $this->control->tpl['phone']; ?>"></td>
|
||||
<td><?php echo $langs->trans('Fax'); ?></td>
|
||||
<td><input type="text" name="fax" value="<?php echo $this->control->tpl['fax']; ?>"></td>
|
||||
</tr>
|
||||
|
||||
@@ -120,7 +120,7 @@ if ($this->control->tpl['fournisseur']) {
|
||||
|
||||
<tr>
|
||||
<td valign="top"><?php echo $langs->trans('Address'); ?></td>
|
||||
<td colspan="3"><textarea name="adresse" cols="40" rows="3"><?php echo $this->control->tpl['address']; ?></textarea></td>
|
||||
<td colspan="3"><textarea name="adress" cols="40" rows="3"><?php echo $this->control->tpl['address']; ?></textarea></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
@@ -142,7 +142,7 @@ if ($this->control->tpl['fournisseur']) {
|
||||
|
||||
<tr>
|
||||
<td><?php echo $langs->trans('Phone'); ?></td>
|
||||
<td><input type="text" name="tel" value="<?php echo $this->control->tpl['tel']; ?>"></td>
|
||||
<td><input type="text" name="phone" value="<?php echo $this->control->tpl['phone']; ?>"></td>
|
||||
<td><?php echo $langs->trans('Fax'); ?></td>
|
||||
<td><input type="text" name="fax" value="<?php echo $this->control->tpl['fax']; ?>"></td>
|
||||
</tr>
|
||||
|
||||
@@ -1879,6 +1879,12 @@ div.tabBar .noborder {
|
||||
border: 1px solid #AAA;
|
||||
text-align: center;
|
||||
border-radius: 5px;
|
||||
background-image: linear-gradient(bottom, rgba(255,255,255,.3) 0%, rgba(164,164,164,.3) 100%);
|
||||
background-image: -o-linear-gradient(bottom, rgba(255,255,255,.3) 0%, rgba(164,164,164,.3) 100%);
|
||||
background-image: -moz-linear-gradient(bottom, rgba(255,255,255,.3) 0%, rgba(164,164,164,.3) 100%);
|
||||
background-image: -webkit-linear-gradient(bottom, rgba(255,255,255,.3) 0%, rgba(164,164,164,.3) 100%);
|
||||
background-image: -ms-linear-gradient(bottom, rgba(255,255,255,.3) 0%, rgba(164,164,164,.3) 100%);
|
||||
background-image: -webkit-gradient( linear, left bottom, left top, color-stop(0, rgba(255,255,255,.3)), color-stop(1, rgba(164,164,164,.3)) );
|
||||
}
|
||||
|
||||
.boxtable {
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
/* Copyright (c) 2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (c) 2005-2012 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (c) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
* Copyright (C) 2012 Florian Henry <florian.henry@open-concept.pro>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -97,6 +98,7 @@ class UserGroup extends CommonObject
|
||||
$this->ref = $obj->rowid;
|
||||
$this->entity = $obj->entity;
|
||||
$this->name = $obj->name;
|
||||
$this->nom = $obj->name; //Deprecated
|
||||
$this->note = $obj->note;
|
||||
$this->datec = $obj->datec;
|
||||
$this->datem = $obj->datem;
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
* Copyright (C) 2005-2011 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
* Copyright (C) 2011 Herve Prot <herve.prot@symeos.com>
|
||||
* Copyright (C) 2012 Florian Henry <florian.henry@open-concept.pro>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -298,7 +299,7 @@ else
|
||||
|
||||
// Name
|
||||
print '<tr><td width="25%" valign="top">'.$langs->trans("Name").'</td>';
|
||||
print '<td width="75%" class="valeur">'.$object->nom;
|
||||
print '<td width="75%" class="valeur">'.$object->name;
|
||||
if (empty($object->entity))
|
||||
{
|
||||
print img_picto($langs->trans("GlobalGroup"),'redstar');
|
||||
@@ -480,7 +481,7 @@ else
|
||||
|
||||
print '<table class="border" width="100%">';
|
||||
print '<tr><td width="25%" valign="top" class="fieldrequired">'.$langs->trans("Name").'</td>';
|
||||
print '<td width="75%" class="valeur"><input size="15" type="text" name="group" value="'.$object->nom.'">';
|
||||
print '<td width="75%" class="valeur"><input size="15" type="text" name="group" value="'.$object->name.'">';
|
||||
print "</td></tr>\n";
|
||||
|
||||
// Multicompany
|
||||
|
||||
@@ -32,12 +32,14 @@ $WS_DOL_URL = DOL_MAIN_URL_ROOT.'/webservices/server_thirdparty.php';
|
||||
$WS_METHOD_GETTHIRDSPARTY = 'getThirdParty';
|
||||
$WS_METHOD_CREATETHIRDSPARTY = 'createThirdParty';
|
||||
$WS_METHOD_UPDATETHIRDSPARTY = 'updateThirdParty';
|
||||
$WS_METHOD_GETTHIRDSPARTYLIST = 'getListOfThirdParties';
|
||||
$ns='http://www.dolibarr.org/ns/';
|
||||
|
||||
//Chosse action to do
|
||||
//$action='get';
|
||||
$action='create';
|
||||
//$action='create';
|
||||
//$action='update';
|
||||
$action='getList';
|
||||
|
||||
|
||||
// Set the WebService URL
|
||||
@@ -75,6 +77,24 @@ if ($action=='get')
|
||||
}
|
||||
}
|
||||
|
||||
// Test URL
|
||||
if ($action=='getList')
|
||||
{
|
||||
$filterthirdparty=array('category'=>'3');
|
||||
$parameters = array('authentication'=>$authentication,$filterthirdparty);
|
||||
dol_syslog("Call method ".$WS_METHOD_GETTHIRDSPARTYLIST);
|
||||
$result = $soapclient->call($WS_METHOD_GETTHIRDSPARTYLIST,$parameters,$ns,'');
|
||||
if (! $result)
|
||||
{
|
||||
print $soapclient->error_str;
|
||||
print "<br>\n\n";
|
||||
print $soapclient->request;
|
||||
print "<br>\n\n";
|
||||
print $soapclient->response;
|
||||
exit;
|
||||
}
|
||||
}
|
||||
|
||||
// Test URL
|
||||
if ($action=='create')
|
||||
{
|
||||
|
||||
@@ -160,7 +160,8 @@ $server->wsdl->addComplexType(
|
||||
array(
|
||||
//'limit' => array('name'=>'limit','type'=>'xsd:string'),
|
||||
'client' => array('name'=>'client','type'=>'xsd:string'),
|
||||
'supplier' => array('name'=>'supplier','type'=>'xsd:string')
|
||||
'supplier' => array('name'=>'supplier','type'=>'xsd:string'),
|
||||
'category' => array('name'=>'category','type'=>'xsd:string')
|
||||
)
|
||||
);
|
||||
|
||||
@@ -640,14 +641,17 @@ function getListOfThirdParties($authentication,$filterthirdparty)
|
||||
|
||||
if (! $error)
|
||||
{
|
||||
$sql ="SELECT rowid, nom as ref, ref_ext";
|
||||
$sql.=" FROM ".MAIN_DB_PREFIX."societe";
|
||||
$sql ="SELECT s.rowid, s.nom as ref, s.ref_ext, s.address, s.zip, s.town, p.libelle as country, s.phone, s.fax, s.url";
|
||||
$sql.=" FROM ".MAIN_DB_PREFIX."societe as s";
|
||||
$sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_pays as p ON s.fk_pays = p.rowid';
|
||||
$sql.=" WHERE entity=".$conf->entity;
|
||||
foreach($filterthirdparty as $key => $val)
|
||||
{
|
||||
if ($key == 'client' && $val != '') $sql.=" AND client = ".$db->escape($val);
|
||||
if ($key == 'supplier' && $val != '') $sql.=" AND fournisseur = ".$db->escape($val);
|
||||
if ($key == 'client' && $val != '') $sql.=" AND s.client = ".$db->escape($val);
|
||||
if ($key == 'supplier' && $val != '') $sql.=" AND s.fournisseur = ".$db->escape($val);
|
||||
if ($key == 'category' && $val != '') $sql.=" AND s.rowid IN (SELECT fk_societe FROM ".MAIN_DB_PREFIX."categorie_societe WHERE fk_categorie=".$db->escape($val).") ";
|
||||
}
|
||||
dol_syslog("Function: getListOfThirdParties sql=".$sql);
|
||||
$resql=$db->query($sql);
|
||||
if ($resql)
|
||||
{
|
||||
@@ -657,7 +661,17 @@ function getListOfThirdParties($authentication,$filterthirdparty)
|
||||
while ($i < $num)
|
||||
{
|
||||
$obj=$db->fetch_object($resql);
|
||||
$arraythirdparties[]=array('id'=>$obj->rowid,'ref'=>$obj->ref,'ref_ext'=>$obj->ref_ext);
|
||||
$arraythirdparties[]=array('id'=>$obj->rowid,
|
||||
'ref'=>$obj->ref,
|
||||
'ref_ext'=>$obj->ref_ext,
|
||||
'adress'=>$obj->adress,
|
||||
'zip'=>$obj->zip,
|
||||
'town'=>$obj->town,
|
||||
'country'=>$obj->country,
|
||||
'phone'=>$obj->phone,
|
||||
'fax'=>$obj->fax,
|
||||
'url'=>$obj->url
|
||||
);
|
||||
$i++;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user