Merge branch 'develop' of github.com:Dolibarr/dolibarr into develop
This commit is contained in:
commit
907a0ea216
@ -63,7 +63,7 @@ if ($action == 'updateMask')
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
setEventMessage($langs->trans("Error"), null, 'errors');
|
setEventMessages($langs->trans("Error"), null, 'errors');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -61,7 +61,7 @@ if ($action == "save")
|
|||||||
}
|
}
|
||||||
|
|
||||||
$db->commit();
|
$db->commit();
|
||||||
setEventMessage($langs->trans("SetupSaved"));
|
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -6,7 +6,7 @@
|
|||||||
* Copyright (C) 2004 Eric Seigne <eric.seigne@ryxeo.com>
|
* Copyright (C) 2004 Eric Seigne <eric.seigne@ryxeo.com>
|
||||||
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
|
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
|
||||||
* Copyright (C) 2011-2012 Juanjo Menent <jmenent@2byte.es>
|
* Copyright (C) 2011-2012 Juanjo Menent <jmenent@2byte.es>
|
||||||
* Copyright (C) 2011-2013 Philippe Grand <philippe.grand@atoo-net.com>
|
* Copyright (C) 2011-2015 Philippe Grand <philippe.grand@atoo-net.com>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -65,9 +65,9 @@ if ($action == 'updateMask')
|
|||||||
if (isset($res))
|
if (isset($res))
|
||||||
{
|
{
|
||||||
if ($res > 0)
|
if ($res > 0)
|
||||||
setEventMessage($langs->trans("SetupSaved"));
|
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
|
||||||
else
|
else
|
||||||
setEventMessage($langs->trans("Error"), 'errors');
|
setEventMessages($langs->trans("Error"), null, 'errors');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -77,9 +77,9 @@ else if ($action == 'set_SHIPPING_FREE_TEXT')
|
|||||||
$res = dolibarr_set_const($db, "SHIPPING_FREE_TEXT",$freetext,'chaine',0,'',$conf->entity);
|
$res = dolibarr_set_const($db, "SHIPPING_FREE_TEXT",$freetext,'chaine',0,'',$conf->entity);
|
||||||
|
|
||||||
if ($res > 0)
|
if ($res > 0)
|
||||||
setEventMessage($langs->trans("SetupSaved"));
|
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
|
||||||
else
|
else
|
||||||
setEventMessage($langs->trans("Error"), 'errors');
|
setEventMessages($langs->trans("Error"), null, 'errors');
|
||||||
}
|
}
|
||||||
|
|
||||||
else if ($action == 'set_SHIPPING_DRAFT_WATERMARK')
|
else if ($action == 'set_SHIPPING_DRAFT_WATERMARK')
|
||||||
@ -88,9 +88,9 @@ else if ($action == 'set_SHIPPING_DRAFT_WATERMARK')
|
|||||||
$res = dolibarr_set_const($db, "SHIPPING_DRAFT_WATERMARK",trim($draft),'chaine',0,'',$conf->entity);
|
$res = dolibarr_set_const($db, "SHIPPING_DRAFT_WATERMARK",trim($draft),'chaine',0,'',$conf->entity);
|
||||||
|
|
||||||
if ($res > 0)
|
if ($res > 0)
|
||||||
setEventMessage($langs->trans("SetupSaved"));
|
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
|
||||||
else
|
else
|
||||||
setEventMessage($langs->trans("Error"), 'errors');
|
setEventMessages($langs->trans("Error"), null, 'errors');
|
||||||
}
|
}
|
||||||
|
|
||||||
else if ($action == 'specimen')
|
else if ($action == 'specimen')
|
||||||
@ -127,13 +127,13 @@ else if ($action == 'specimen')
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
setEventMessage($module->error, 'errors');
|
setEventMessages($module->error, $module->errors, 'errors');
|
||||||
dol_syslog($module->error, LOG_ERR);
|
dol_syslog($module->error, LOG_ERR);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
setEventMessage($langs->trans("ErrorModuleNotFound"), 'errors');
|
setEventMessages($langs->trans("ErrorModuleNotFound"), null, 'errors');
|
||||||
dol_syslog($langs->trans("ErrorModuleNotFound"), LOG_ERR);
|
dol_syslog($langs->trans("ErrorModuleNotFound"), LOG_ERR);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -158,12 +158,12 @@ else if ($action == 'setModuleOptions')
|
|||||||
if (! $error)
|
if (! $error)
|
||||||
{
|
{
|
||||||
$db->commit();
|
$db->commit();
|
||||||
setEventMessage($langs->trans("SetupSaved"));
|
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$db->rollback();
|
$db->rollback();
|
||||||
setEventMessage($langs->trans("Error"),'errors');
|
setEventMessages($langs->trans("Error"), null, 'errors');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -6,7 +6,7 @@
|
|||||||
* Copyright (C) 2005-2014 Regis Houssin <regis.houssin@capnetworks.com>
|
* Copyright (C) 2005-2014 Regis Houssin <regis.houssin@capnetworks.com>
|
||||||
* Copyright (C) 2008 Raphael Bertrand (Resultic) <raphael.bertrand@resultic.fr>
|
* Copyright (C) 2008 Raphael Bertrand (Resultic) <raphael.bertrand@resultic.fr>
|
||||||
* Copyright (C) 2011-2013 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) 2011-2015 Philippe Grand <philippe.grand@atoo-net.com>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -60,11 +60,11 @@ if ($action == 'updateMask')
|
|||||||
|
|
||||||
if (! $error)
|
if (! $error)
|
||||||
{
|
{
|
||||||
setEventMessage($langs->trans("SetupSaved"));
|
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
setEventMessage($langs->trans("Error"),'errors');
|
setEventMessages($langs->trans("Error"), null, 'errors');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -102,13 +102,13 @@ else if ($action == 'specimen') // For fiche inter
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
setEventMessage($obj->error,'errors');
|
setEventMessages($module->error, $module->errors,'errors');
|
||||||
dol_syslog($obj->error, LOG_ERR);
|
dol_syslog($module->error, LOG_ERR);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
setEventMessage($langs->trans("ErrorModuleNotFound"),'errors');
|
setEventMessages($langs->trans("ErrorModuleNotFound"), null, 'errors');
|
||||||
dol_syslog($langs->trans("ErrorModuleNotFound"), LOG_ERR);
|
dol_syslog($langs->trans("ErrorModuleNotFound"), LOG_ERR);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -133,12 +133,12 @@ if ($action == 'setModuleOptions')
|
|||||||
if (! $error)
|
if (! $error)
|
||||||
{
|
{
|
||||||
$db->commit();
|
$db->commit();
|
||||||
setEventMessage($langs->trans("SetupSaved"));
|
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$db->rollback();
|
$db->rollback();
|
||||||
setEventMessage($langs->trans("Error"),'errors');
|
setEventMessages($langs->trans("Error"), null, 'errors');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -196,11 +196,11 @@ else if ($action == 'set_EXPENSEREPORT_FREE_TEXT')
|
|||||||
|
|
||||||
if (! $error)
|
if (! $error)
|
||||||
{
|
{
|
||||||
setEventMessage($langs->trans("SetupSaved"));
|
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
setEventMessage($langs->trans("Error"),'errors');
|
setEventMessages($langs->trans("Error"), null, 'errors');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -214,11 +214,11 @@ else if ($action == 'set_EXPENSEREPORT_DRAFT_WATERMARK')
|
|||||||
|
|
||||||
if (! $error)
|
if (! $error)
|
||||||
{
|
{
|
||||||
setEventMessage($langs->trans("SetupSaved"));
|
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
setEventMessage($langs->trans("Error"),'errors');
|
setEventMessages($langs->trans("Error"), null, 'errors');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -69,11 +69,11 @@ if ($action == 'updateMask')
|
|||||||
|
|
||||||
if (! $error)
|
if (! $error)
|
||||||
{
|
{
|
||||||
setEventMessage($langs->trans("SetupSaved"));
|
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
setEventMessage($langs->trans("Error"),'errors');
|
setEventMessages($langs->trans("Error"), null, 'errors');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -111,13 +111,13 @@ if ($action == 'specimen')
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
setEventMessage($module->error,'errors');
|
setEventMessages($module->error, $module->errors, 'errors');
|
||||||
dol_syslog($module->error, LOG_ERR);
|
dol_syslog($module->error, LOG_ERR);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
setEventMessage($langs->trans("ErrorModuleNotFound"),'errors');
|
setEventMessages($langs->trans("ErrorModuleNotFound"), null, 'errors');
|
||||||
dol_syslog($langs->trans("ErrorModuleNotFound"), LOG_ERR);
|
dol_syslog($langs->trans("ErrorModuleNotFound"), LOG_ERR);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -139,11 +139,11 @@ if ($action == 'setModuleOptions')
|
|||||||
|
|
||||||
if (! $error)
|
if (! $error)
|
||||||
{
|
{
|
||||||
setEventMessage($langs->trans("SetupSaved"));
|
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
setEventMessage($langs->trans("Error"),'errors');
|
setEventMessages($langs->trans("Error"), null, 'errors');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -200,11 +200,11 @@ if ($action == 'setribchq')
|
|||||||
|
|
||||||
if (! $error)
|
if (! $error)
|
||||||
{
|
{
|
||||||
setEventMessage($langs->trans("SetupSaved"));
|
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
setEventMessage($langs->trans("Error"),'errors');
|
setEventMessages($langs->trans("Error"), null, 'errors');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -218,11 +218,11 @@ if ($action == 'set_FACTURE_DRAFT_WATERMARK')
|
|||||||
|
|
||||||
if (! $error)
|
if (! $error)
|
||||||
{
|
{
|
||||||
setEventMessage($langs->trans("SetupSaved"));
|
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
setEventMessage($langs->trans("Error"),'errors');
|
setEventMessages($langs->trans("Error"), null, 'errors');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -236,11 +236,11 @@ if ($action == 'set_INVOICE_FREE_TEXT')
|
|||||||
|
|
||||||
if (! $error)
|
if (! $error)
|
||||||
{
|
{
|
||||||
setEventMessage($langs->trans("SetupSaved"));
|
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
setEventMessage($langs->trans("Error"),'errors');
|
setEventMessages($langs->trans("Error"), null, 'errors');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -254,11 +254,11 @@ if ($action == 'setforcedate')
|
|||||||
|
|
||||||
if (! $error)
|
if (! $error)
|
||||||
{
|
{
|
||||||
setEventMessage($langs->trans("SetupSaved"));
|
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
setEventMessage($langs->trans("Error"),'errors');
|
setEventMessages($langs->trans("Error"), null, 'errors');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -272,11 +272,11 @@ if ($action == 'set_FAC_AUTO_FILLJS')
|
|||||||
|
|
||||||
if (! $error)
|
if (! $error)
|
||||||
{
|
{
|
||||||
setEventMessage($langs->trans("SetupSaved"));
|
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
setEventMessage($langs->trans("Error"),'errors');
|
setEventMessages($langs->trans("Error"), null, 'errors');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -121,11 +121,11 @@ if (GETPOST('save','alpha'))
|
|||||||
|
|
||||||
if (! $error)
|
if (! $error)
|
||||||
{
|
{
|
||||||
setEventMessage($langs->trans("SetupSaved"));
|
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
setEventMessage($langs->trans("Error"),'errors');
|
setEventMessages($langs->trans("Error"), null, 'errors');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -143,7 +143,7 @@ $var=true;
|
|||||||
|
|
||||||
if (empty($conf->use_javascript_ajax))
|
if (empty($conf->use_javascript_ajax))
|
||||||
{
|
{
|
||||||
setEventMessage(array($langs->trans("NotAvailable"), $langs->trans("JavascriptDisabled")), 'errors');
|
setEventMessages(array($langs->trans("NotAvailable"), $langs->trans("JavascriptDisabled")), null, 'errors');
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|||||||
@ -6,7 +6,7 @@
|
|||||||
* Copyright (C) 2005-2014 Regis Houssin <regis.houssin@capnetworks.com>
|
* Copyright (C) 2005-2014 Regis Houssin <regis.houssin@capnetworks.com>
|
||||||
* Copyright (C) 2008 Raphael Bertrand (Resultic) <raphael.bertrand@resultic.fr>
|
* Copyright (C) 2008 Raphael Bertrand (Resultic) <raphael.bertrand@resultic.fr>
|
||||||
* Copyright (C) 2011-2013 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) 2011-2015 Philippe Grand <philippe.grand@atoo-net.com>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -60,11 +60,11 @@ if ($action == 'updateMask')
|
|||||||
|
|
||||||
if (! $error)
|
if (! $error)
|
||||||
{
|
{
|
||||||
setEventMessage($langs->trans("SetupSaved"));
|
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
setEventMessage($langs->trans("Error"),'errors');
|
setEventMessages($langs->trans("Error"), null, 'errors');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -102,13 +102,13 @@ else if ($action == 'specimen') // For fiche inter
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
setEventMessage($obj->error,'errors');
|
setEventMessages($module->error, $module->errors, 'errors');
|
||||||
dol_syslog($obj->error, LOG_ERR);
|
dol_syslog($module->error, LOG_ERR);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
setEventMessage($langs->trans("ErrorModuleNotFound"),'errors');
|
setEventMessages($langs->trans("ErrorModuleNotFound"), null, 'errors');
|
||||||
dol_syslog($langs->trans("ErrorModuleNotFound"), LOG_ERR);
|
dol_syslog($langs->trans("ErrorModuleNotFound"), LOG_ERR);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -133,12 +133,12 @@ if ($action == 'setModuleOptions')
|
|||||||
if (! $error)
|
if (! $error)
|
||||||
{
|
{
|
||||||
$db->commit();
|
$db->commit();
|
||||||
setEventMessage($langs->trans("SetupSaved"));
|
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$db->rollback();
|
$db->rollback();
|
||||||
setEventMessage($langs->trans("Error"),'errors');
|
setEventMessages($langs->trans("Error"), null, 'errors');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -192,11 +192,11 @@ else if ($action == 'set_FICHINTER_FREE_TEXT')
|
|||||||
|
|
||||||
if (! $error)
|
if (! $error)
|
||||||
{
|
{
|
||||||
setEventMessage($langs->trans("SetupSaved"));
|
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
setEventMessage($langs->trans("Error"),'errors');
|
setEventMessages($langs->trans("Error"), null, 'errors');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -209,11 +209,11 @@ else if ($action == 'set_FICHINTER_DRAFT_WATERMARK')
|
|||||||
|
|
||||||
if (! $error)
|
if (! $error)
|
||||||
{
|
{
|
||||||
setEventMessage($langs->trans("SetupSaved"));
|
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
setEventMessage($langs->trans("Error"),'errors');
|
setEventMessages($langs->trans("Error"), null, 'errors');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -226,11 +226,11 @@ elseif ($action == 'set_FICHINTER_PRINT_PRODUCTS')
|
|||||||
|
|
||||||
if (! $error)
|
if (! $error)
|
||||||
{
|
{
|
||||||
setEventMessage($langs->trans("SetupSaved"));
|
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
setEventMessage($langs->trans("Error"),'errors');
|
setEventMessages($langs->trans("Error"), null, 'errors');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -46,7 +46,7 @@ if ($action == 'set')
|
|||||||
|
|
||||||
if (! $gimcdf && ! file_exists($gimcdf))
|
if (! $gimcdf && ! file_exists($gimcdf))
|
||||||
{
|
{
|
||||||
setEventMessage($langs->trans("ErrorFileNotFound",$gimcdf),'errors');
|
setEventMessages($langs->trans("ErrorFileNotFound",$gimcdf), null, 'errors');
|
||||||
$error++;
|
$error++;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -57,11 +57,11 @@ if ($action == 'set')
|
|||||||
|
|
||||||
if (! $error)
|
if (! $error)
|
||||||
{
|
{
|
||||||
setEventMessage($langs->trans("SetupSaved"));
|
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
setEventMessage($langs->trans("Error"),'errors');
|
setEventMessages($langs->trans("Error"), null, 'errors');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -63,7 +63,7 @@ if ($action == 'setvalue' && $user->admin)
|
|||||||
if (! $error)
|
if (! $error)
|
||||||
{
|
{
|
||||||
$db->commit();
|
$db->commit();
|
||||||
setEventMessage($langs->trans("SetupSaved"));
|
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -89,7 +89,7 @@ $head = ldap_prepare_head();
|
|||||||
// Test si fonction LDAP actives
|
// Test si fonction LDAP actives
|
||||||
if (! function_exists("ldap_connect"))
|
if (! function_exists("ldap_connect"))
|
||||||
{
|
{
|
||||||
setEventMessage($langs->trans("LDAPFunctionsNotAvailableOnPHP"),'errors');
|
setEventMessages($langs->trans("LDAPFunctionsNotAvailableOnPHP"), null, 'errors');
|
||||||
}
|
}
|
||||||
|
|
||||||
dol_fiche_head($head, 'ldap', $langs->trans("LDAPSetup"));
|
dol_fiche_head($head, 'ldap', $langs->trans("LDAPSetup"));
|
||||||
|
|||||||
@ -77,7 +77,7 @@ if ($action == 'setvalue' && $user->admin)
|
|||||||
if (! $error)
|
if (! $error)
|
||||||
{
|
{
|
||||||
$db->commit();
|
$db->commit();
|
||||||
setEventMessage($langs->trans("SetupSaved"));
|
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -102,7 +102,7 @@ $head = ldap_prepare_head();
|
|||||||
// Test si fonction LDAP actives
|
// Test si fonction LDAP actives
|
||||||
if (! function_exists("ldap_connect"))
|
if (! function_exists("ldap_connect"))
|
||||||
{
|
{
|
||||||
setEventMessage($langs->trans("LDAPFunctionsNotAvailableOnPHP"),'errors');
|
setEventMessages($langs->trans("LDAPFunctionsNotAvailableOnPHP"), null, 'errors');
|
||||||
}
|
}
|
||||||
|
|
||||||
dol_fiche_head($head, 'contacts', $langs->trans("LDAPSetup"));
|
dol_fiche_head($head, 'contacts', $langs->trans("LDAPSetup"));
|
||||||
|
|||||||
@ -68,7 +68,7 @@ if ($action == 'setvalue' && $user->admin)
|
|||||||
if (! $error)
|
if (! $error)
|
||||||
{
|
{
|
||||||
$db->commit();
|
$db->commit();
|
||||||
setEventMessage($langs->trans("SetupSaved"));
|
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -93,7 +93,7 @@ $head = ldap_prepare_head();
|
|||||||
// Test si fonction LDAP actives
|
// Test si fonction LDAP actives
|
||||||
if (! function_exists("ldap_connect"))
|
if (! function_exists("ldap_connect"))
|
||||||
{
|
{
|
||||||
setEventMessage($langs->trans("LDAPFunctionsNotAvailableOnPHP"),'errors');
|
setEventMessages($langs->trans("LDAPFunctionsNotAvailableOnPHP"), null, 'errors');
|
||||||
}
|
}
|
||||||
|
|
||||||
dol_fiche_head($head, 'groups', $langs->trans("LDAPSetup"));
|
dol_fiche_head($head, 'groups', $langs->trans("LDAPSetup"));
|
||||||
|
|||||||
@ -92,7 +92,7 @@ if ($action == 'setvalue' && $user->admin)
|
|||||||
if (! $error)
|
if (! $error)
|
||||||
{
|
{
|
||||||
$db->commit();
|
$db->commit();
|
||||||
setEventMessage($langs->trans("SetupSaved"));
|
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -117,7 +117,7 @@ $head = ldap_prepare_head();
|
|||||||
// Test si fonction LDAP actives
|
// Test si fonction LDAP actives
|
||||||
if (! function_exists("ldap_connect"))
|
if (! function_exists("ldap_connect"))
|
||||||
{
|
{
|
||||||
setEventMessage($langs->trans("LDAPFunctionsNotAvailableOnPHP"),'errors');
|
setEventMessages($langs->trans("LDAPFunctionsNotAvailableOnPHP"), null, 'errors');
|
||||||
}
|
}
|
||||||
|
|
||||||
dol_fiche_head($head, 'members', $langs->trans("LDAPSetup"));
|
dol_fiche_head($head, 'members', $langs->trans("LDAPSetup"));
|
||||||
|
|||||||
@ -78,7 +78,7 @@ if ($action == 'setvalue' && $user->admin)
|
|||||||
if (! $error)
|
if (! $error)
|
||||||
{
|
{
|
||||||
$db->commit();
|
$db->commit();
|
||||||
setEventMessage($langs->trans("SetupSaved"));
|
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -103,7 +103,7 @@ $head = ldap_prepare_head();
|
|||||||
// Test si fonction LDAP actives
|
// Test si fonction LDAP actives
|
||||||
if (! function_exists("ldap_connect"))
|
if (! function_exists("ldap_connect"))
|
||||||
{
|
{
|
||||||
setEventMessage($langs->trans("LDAPFunctionsNotAvailableOnPHP"),'errors');
|
setEventMessages($langs->trans("LDAPFunctionsNotAvailableOnPHP"), null, 'errors');
|
||||||
}
|
}
|
||||||
|
|
||||||
dol_fiche_head($head, 'users', $langs->trans("LDAPSetup"));
|
dol_fiche_head($head, 'users', $langs->trans("LDAPSetup"));
|
||||||
@ -427,7 +427,7 @@ if (function_exists("ldap_connect"))
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
setEventMessage($ldap->error, 'errors');
|
setEventMessages($ldap->error, $ldap->errors, 'errors');
|
||||||
}
|
}
|
||||||
|
|
||||||
print "<br>\n";
|
print "<br>\n";
|
||||||
|
|||||||
@ -43,7 +43,7 @@ if ($action == 'update')
|
|||||||
|| $_POST["MAIN_MAX_DECIMALS_SHOWN"] > $MAXDEC)
|
|| $_POST["MAIN_MAX_DECIMALS_SHOWN"] > $MAXDEC)
|
||||||
{
|
{
|
||||||
$error++;
|
$error++;
|
||||||
setEventMessage($langs->trans("ErrorDecimalLargerThanAreForbidden",$MAXDEC), 'errors');
|
setEventMessages($langs->trans("ErrorDecimalLargerThanAreForbidden",$MAXDEC), null, 'errors');
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($_POST["MAIN_MAX_DECIMALS_UNIT"] < 0
|
if ($_POST["MAIN_MAX_DECIMALS_UNIT"] < 0
|
||||||
@ -52,7 +52,7 @@ if ($action == 'update')
|
|||||||
{
|
{
|
||||||
$langs->load("errors");
|
$langs->load("errors");
|
||||||
$error++;
|
$error++;
|
||||||
setEventMessage($langs->trans("ErrorNegativeValueNotAllowed"), 'errors');
|
setEventMessages($langs->trans("ErrorNegativeValueNotAllowed"), null, 'errors');
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($_POST["MAIN_ROUNDING_RULE_TOT"])
|
if ($_POST["MAIN_ROUNDING_RULE_TOT"])
|
||||||
@ -61,7 +61,7 @@ if ($action == 'update')
|
|||||||
{
|
{
|
||||||
$langs->load("errors");
|
$langs->load("errors");
|
||||||
$error++;
|
$error++;
|
||||||
setEventMessage($langs->trans("ErrorMAIN_ROUNDING_RULE_TOTCanMAIN_MAX_DECIMALS_TOT"), 'errors');
|
setEventMessages($langs->trans("ErrorMAIN_ROUNDING_RULE_TOTCanMAIN_MAX_DECIMALS_TOT"), null, 'errors');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -6,7 +6,7 @@
|
|||||||
* Copyright (C) 2004 Eric Seigne <eric.seigne@ryxeo.com>
|
* Copyright (C) 2004 Eric Seigne <eric.seigne@ryxeo.com>
|
||||||
* Copyright (C) 2005-2014 Regis Houssin <regis.houssin@capnetworks.com>
|
* Copyright (C) 2005-2014 Regis Houssin <regis.houssin@capnetworks.com>
|
||||||
* Copyright (C) 2011-2013 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) 2011-2015 Philippe Grand <philippe.grand@atoo-net.com>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -58,11 +58,11 @@ if ($action == 'updateMask')
|
|||||||
|
|
||||||
if (! $error)
|
if (! $error)
|
||||||
{
|
{
|
||||||
setEventMessage($langs->trans("SetupSaved"));
|
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
setEventMessage($langs->trans("Error"),'errors');
|
setEventMessages($langs->trans("Error"), null, 'errors');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -75,11 +75,11 @@ if ($action == 'set_DELIVERY_FREE_TEXT')
|
|||||||
|
|
||||||
if (! $error)
|
if (! $error)
|
||||||
{
|
{
|
||||||
setEventMessage($langs->trans("SetupSaved"));
|
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
setEventMessage($langs->trans("Error"),'errors');
|
setEventMessages($langs->trans("Error"), null, 'errors');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -117,13 +117,13 @@ if ($action == 'specimen')
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
setEventMessage($module->error,'errors');
|
setEventMessages($module->error, $module->errors, 'errors');
|
||||||
dol_syslog($module->error, LOG_ERR);
|
dol_syslog($module->error, LOG_ERR);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
setEventMessage($langs->trans("ErrorModuleNotFound"),'errors');
|
setEventMessages($langs->trans("ErrorModuleNotFound"), null, 'errors');
|
||||||
dol_syslog($langs->trans("ErrorModuleNotFound"), LOG_ERR);
|
dol_syslog($langs->trans("ErrorModuleNotFound"), LOG_ERR);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -148,12 +148,12 @@ if ($action == 'setModuleOptions')
|
|||||||
if (! $error)
|
if (! $error)
|
||||||
{
|
{
|
||||||
$db->commit();
|
$db->commit();
|
||||||
setEventMessage($langs->trans("SetupSaved"));
|
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$db->rollback();
|
$db->rollback();
|
||||||
setEventMessage($langs->trans("Error"),'errors');
|
setEventMessages($langs->trans("Error"), null, 'errors');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -61,11 +61,11 @@ if ($action == 'update')
|
|||||||
|
|
||||||
if (! $error)
|
if (! $error)
|
||||||
{
|
{
|
||||||
setEventMessage($langs->trans("SetupSaved"));
|
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
setEventMessage($langs->trans("Error"),'errors');
|
setEventMessages($langs->trans("Error"), null, 'errors');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -64,12 +64,12 @@ if ($action == 'setvalue')
|
|||||||
if (! $error)
|
if (! $error)
|
||||||
{
|
{
|
||||||
$db->commit();
|
$db->commit();
|
||||||
setEventMessage($langs->trans("SetupSaved"));
|
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$db->rollback();
|
$db->rollback();
|
||||||
setEventMessage($langs->trans("Error"),'errors');
|
setEventMessages($langs->trans("Error"), null, 'errors');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -65,11 +65,11 @@ if ($action == 'update' || $action == 'add')
|
|||||||
|
|
||||||
if (! $error)
|
if (! $error)
|
||||||
{
|
{
|
||||||
setEventMessage($langs->trans("SetupSaved"));
|
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
setEventMessage($langs->trans("Error"),'errors');
|
setEventMessages($langs->trans("Error"), null, 'errors');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -123,7 +123,7 @@ if (! empty($_POST['removedfile']) || ! empty($_POST['removedfilehtml']))
|
|||||||
$result = dol_delete_file($pathtodelete,1);
|
$result = dol_delete_file($pathtodelete,1);
|
||||||
if ($result)
|
if ($result)
|
||||||
{
|
{
|
||||||
setEventMessage($langs->trans("FileWasRemoved"), $filetodelete);
|
setEventMessages(array($langs->trans("FileWasRemoved"), $filetodelete), null, 'mesgs');
|
||||||
|
|
||||||
include_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php';
|
include_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php';
|
||||||
$formmail = new FormMail($db);
|
$formmail = new FormMail($db);
|
||||||
@ -209,11 +209,11 @@ if (($action == 'send' || $action == 'sendhtml') && ! GETPOST('addfile') && ! GE
|
|||||||
|
|
||||||
if ($result)
|
if ($result)
|
||||||
{
|
{
|
||||||
setEventMessage($langs->trans("MailSuccessfulySent",$mailfile->getValidAddress($email_from,2),$mailfile->getValidAddress($sendto,2)));
|
setEventMessages($langs->trans("MailSuccessfulySent",$mailfile->getValidAddress($email_from,2),$mailfile->getValidAddress($sendto,2)), null, 'mesgs');
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
setEventMessage($langs->trans("ResultKo").'<br>'.$mailfile->error.' '.$result,'errors');
|
setEventMessages($langs->trans("ResultKo").'<br>'.$mailfile->error.' '.$result, null, 'errors');
|
||||||
}
|
}
|
||||||
|
|
||||||
$action='';
|
$action='';
|
||||||
@ -677,7 +677,7 @@ else
|
|||||||
$errormsg .= ' - '.$mail->error;
|
$errormsg .= ' - '.$mail->error;
|
||||||
}
|
}
|
||||||
|
|
||||||
setEventMessage($errormsg, 'errors');
|
setEventMessages($errormsg, null, 'errors');
|
||||||
}
|
}
|
||||||
print '<br>';
|
print '<br>';
|
||||||
}
|
}
|
||||||
|
|||||||
@ -102,8 +102,7 @@ if ($action == 'update' && empty($_POST["cancel"]))
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
$error++;
|
$error++;
|
||||||
//TODO: Translate
|
setEventMessages($langs->trans("FailedToInitializeMenu").' '.$key, null, 'errors');
|
||||||
setEventMessage('Failed to initialize menu '.$key.'.', 'errors');
|
|
||||||
$db->rollback();
|
$db->rollback();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -66,7 +66,7 @@ $familyinfo=array(
|
|||||||
if ($action == 'set' && $user->admin)
|
if ($action == 'set' && $user->admin)
|
||||||
{
|
{
|
||||||
$result=activateModule($value);
|
$result=activateModule($value);
|
||||||
if ($result) setEventMessage($result, 'errors');
|
if ($result) setEventMessages($result, null, 'errors');
|
||||||
header("Location: modules.php?mode=".$mode);
|
header("Location: modules.php?mode=".$mode);
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
@ -74,7 +74,7 @@ if ($action == 'set' && $user->admin)
|
|||||||
if ($action == 'reset' && $user->admin)
|
if ($action == 'reset' && $user->admin)
|
||||||
{
|
{
|
||||||
$result=unActivateModule($value);
|
$result=unActivateModule($value);
|
||||||
if ($result) setEventMessage($result, 'errors');
|
if ($result) setEventMessages($result, null, 'errors');
|
||||||
header("Location: modules.php?mode=".$mode);
|
header("Location: modules.php?mode=".$mode);
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
@ -125,7 +125,7 @@ foreach ($modulesdir as $dir)
|
|||||||
if (! empty($modNameLoaded[$modName]))
|
if (! empty($modNameLoaded[$modName]))
|
||||||
{
|
{
|
||||||
$mesg="Error: Module ".$modName." was found twice: Into ".$modNameLoaded[$modName]." and ".$dir.". You probably have an old file on your disk.<br>";
|
$mesg="Error: Module ".$modName." was found twice: Into ".$modNameLoaded[$modName]." and ".$dir.". You probably have an old file on your disk.<br>";
|
||||||
setEventMessage($mesg, 'warnings');
|
setEventMessages($mesg, null, 'warnings');
|
||||||
dol_syslog($mesg, LOG_ERR);
|
dol_syslog($mesg, LOG_ERR);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -93,13 +93,13 @@ if ($action == 'setvalue' && $user->admin)
|
|||||||
{
|
{
|
||||||
$db->commit();
|
$db->commit();
|
||||||
|
|
||||||
setEventMessage($langs->trans("SetupSaved"));
|
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$db->rollback();
|
$db->rollback();
|
||||||
|
|
||||||
setEventMessage($langs->trans("Error"),'errors');
|
setEventMessages($langs->trans("Error"), null, 'errors');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -54,11 +54,11 @@ if ($action == 'updateMask')
|
|||||||
|
|
||||||
if (! $error)
|
if (! $error)
|
||||||
{
|
{
|
||||||
setEventMessage($langs->trans("SetupSaved"));
|
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
setEventMessage($langs->trans("Error"),'errors');
|
setEventMessages($langs->trans("Error"), null, 'errors');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -81,12 +81,12 @@ if ($action == "set")
|
|||||||
if (! $error)
|
if (! $error)
|
||||||
{
|
{
|
||||||
$db->commit();
|
$db->commit();
|
||||||
setEventMessage($langs->trans("SetupSaved"));
|
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$db->rollback();
|
$db->rollback();
|
||||||
setEventMessage($langs->trans("Error"),'errors');
|
setEventMessages($langs->trans("Error"), null, 'errors');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -59,11 +59,11 @@ if ($action == 'updateMask')
|
|||||||
|
|
||||||
if (! $error)
|
if (! $error)
|
||||||
{
|
{
|
||||||
setEventMessage($langs->trans("SetupSaved"));
|
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
setEventMessage($langs->trans("Error"),'errors');
|
setEventMessages($langs->trans("Error"), null, 'errors');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -101,13 +101,13 @@ if ($action == 'specimen')
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
setEventMessage($module->error,'errors');
|
setEventMessages($module->error, $module->errors, 'errors');
|
||||||
dol_syslog($module->error, LOG_ERR);
|
dol_syslog($module->error, LOG_ERR);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
setEventMessage($langs->trans("ErrorModuleNotFound"),'errors');
|
setEventMessages($langs->trans("ErrorModuleNotFound"), null, 'errors');
|
||||||
dol_syslog($langs->trans("ErrorModuleNotFound"), LOG_ERR);
|
dol_syslog($langs->trans("ErrorModuleNotFound"), LOG_ERR);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -121,11 +121,11 @@ if ($action == 'set_PROPALE_DRAFT_WATERMARK')
|
|||||||
|
|
||||||
if (! $error)
|
if (! $error)
|
||||||
{
|
{
|
||||||
setEventMessage($langs->trans("SetupSaved"));
|
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
setEventMessage($langs->trans("Error"),'errors');
|
setEventMessages($langs->trans("Error"), null, 'errors');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -139,11 +139,11 @@ if ($action == 'set_PROPOSAL_FREE_TEXT')
|
|||||||
|
|
||||||
if (! $error)
|
if (! $error)
|
||||||
{
|
{
|
||||||
setEventMessage($langs->trans("SetupSaved"));
|
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
setEventMessage($langs->trans("Error"),'errors');
|
setEventMessages($langs->trans("Error"), null, 'errors');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -155,11 +155,11 @@ if ($action == 'setdefaultduration')
|
|||||||
|
|
||||||
if (! $error)
|
if (! $error)
|
||||||
{
|
{
|
||||||
setEventMessage($langs->trans("SetupSaved"));
|
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
setEventMessage($langs->trans("Error"),'errors');
|
setEventMessages($langs->trans("Error"), null, 'errors');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -171,11 +171,11 @@ if ($action == 'set_BANK_ASK_PAYMENT_BANK_DURING_PROPOSAL')
|
|||||||
|
|
||||||
if (! $error)
|
if (! $error)
|
||||||
{
|
{
|
||||||
setEventMessage($langs->trans("SetupSaved"));
|
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
setEventMessage($langs->trans("Error"),'errors');
|
setEventMessages($langs->trans("Error"), null, 'errors');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -199,12 +199,12 @@ if ($action == 'setModuleOptions')
|
|||||||
if (! $error)
|
if (! $error)
|
||||||
{
|
{
|
||||||
$db->commit();
|
$db->commit();
|
||||||
setEventMessage($langs->trans("SetupSaved"));
|
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$db->rollback();
|
$db->rollback();
|
||||||
setEventMessage($langs->trans("Error"),'errors');
|
setEventMessages($langs->trans("Error"), null, 'errors');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -44,12 +44,12 @@ if (GETPOST("action") == 'set_proxy')
|
|||||||
{
|
{
|
||||||
if (GETPOST("MAIN_USE_CONNECT_TIMEOUT") && ! is_numeric(GETPOST("MAIN_USE_CONNECT_TIMEOUT")))
|
if (GETPOST("MAIN_USE_CONNECT_TIMEOUT") && ! is_numeric(GETPOST("MAIN_USE_CONNECT_TIMEOUT")))
|
||||||
{
|
{
|
||||||
setEventMessage($langs->trans("ErrorValueMustBeInteger"),'errors');
|
setEventMessages($langs->trans("ErrorValueMustBeInteger"), null, 'errors');
|
||||||
$error++;
|
$error++;
|
||||||
}
|
}
|
||||||
if (GETPOST("MAIN_USE_RESPONSE_TIMEOUT") && ! is_numeric(GETPOST("MAIN_USE_RESPONSE_TIMEOUT")))
|
if (GETPOST("MAIN_USE_RESPONSE_TIMEOUT") && ! is_numeric(GETPOST("MAIN_USE_RESPONSE_TIMEOUT")))
|
||||||
{
|
{
|
||||||
setEventMessage($langs->trans("ErrorValueMustBeInteger"),'errors');
|
setEventMessages($langs->trans("ErrorValueMustBeInteger"), null, 'errors');
|
||||||
$error++;
|
$error++;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -68,7 +68,7 @@ if (GETPOST("action") == 'set_proxy')
|
|||||||
|
|
||||||
if (! $error)
|
if (! $error)
|
||||||
{
|
{
|
||||||
setEventMessage($langs->trans("RecordModifiedSuccessfully"));
|
setEventMessages($langs->trans("RecordModifiedSuccessfully"), null, 'mesgs');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -60,11 +60,11 @@ if ($action == 'update')
|
|||||||
|
|
||||||
if (! $error)
|
if (! $error)
|
||||||
{
|
{
|
||||||
setEventMessage($langs->trans("SetupSaved"));
|
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
setEventMessage($langs->trans("Error"),'errors');
|
setEventMessages($langs->trans("Error"), null, 'errors');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -135,7 +135,7 @@ if ($action == 'activate_encryptdbpassconf')
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
setEventMessage($langs->trans('InstrucToEncodePass',dol_encode($dolibarr_main_db_pass)),'warnings');
|
setEventMessages($langs->trans('InstrucToEncodePass',dol_encode($dolibarr_main_db_pass)), null, 'warnings');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if ($action == 'disable_encryptdbpassconf')
|
else if ($action == 'disable_encryptdbpassconf')
|
||||||
@ -152,7 +152,7 @@ else if ($action == 'disable_encryptdbpassconf')
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
setEventMessage($langs->trans('InstrucToClearPass',$dolibarr_main_db_pass),'warnings');
|
setEventMessages($langs->trans('InstrucToClearPass',$dolibarr_main_db_pass), null, 'warnings');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -86,7 +86,7 @@ else if ($action == 'updateform')
|
|||||||
$res4=dolibarr_set_const($db, "MAIN_UMASK", $_POST["MAIN_UMASK"],'chaine',0,'',$conf->entity);
|
$res4=dolibarr_set_const($db, "MAIN_UMASK", $_POST["MAIN_UMASK"],'chaine',0,'',$conf->entity);
|
||||||
$res5=dolibarr_set_const($db, "MAIN_ANTIVIRUS_COMMAND", $_POST["MAIN_ANTIVIRUS_COMMAND"],'chaine',0,'',$conf->entity);
|
$res5=dolibarr_set_const($db, "MAIN_ANTIVIRUS_COMMAND", $_POST["MAIN_ANTIVIRUS_COMMAND"],'chaine',0,'',$conf->entity);
|
||||||
$res6=dolibarr_set_const($db, "MAIN_ANTIVIRUS_PARAM", $_POST["MAIN_ANTIVIRUS_PARAM"],'chaine',0,'',$conf->entity);
|
$res6=dolibarr_set_const($db, "MAIN_ANTIVIRUS_PARAM", $_POST["MAIN_ANTIVIRUS_PARAM"],'chaine',0,'',$conf->entity);
|
||||||
if ($res3 && $res4 && $res5 && $res6) setEventMessage($langs->trans("RecordModifiedSuccessfully"));
|
if ($res3 && $res4 && $res5 && $res6) setEventMessages($langs->trans("RecordModifiedSuccessfully"), null, 'mesgs');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -97,8 +97,8 @@ else if ($action == 'delete')
|
|||||||
$langs->load("other");
|
$langs->load("other");
|
||||||
$file = $conf->admin->dir_temp . '/' . GETPOST('urlfile'); // Do not use urldecode here ($_GET and $_REQUEST are already decoded by PHP).
|
$file = $conf->admin->dir_temp . '/' . GETPOST('urlfile'); // Do not use urldecode here ($_GET and $_REQUEST are already decoded by PHP).
|
||||||
$ret=dol_delete_file($file);
|
$ret=dol_delete_file($file);
|
||||||
if ($ret) setEventMessage($langs->trans("FileWasRemoved", GETPOST('urlfile')));
|
if ($ret) setEventMessages($langs->trans("FileWasRemoved", GETPOST('urlfile')), null, 'mesgs');
|
||||||
else setEventMessage($langs->trans("ErrorFailToDeleteFile", GETPOST('urlfile')), 'errors');
|
else setEventMessages($langs->trans("ErrorFailToDeleteFile", GETPOST('urlfile')), null, 'errors');
|
||||||
Header('Location: '.$_SERVER["PHP_SELF"]);
|
Header('Location: '.$_SERVER["PHP_SELF"]);
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -76,7 +76,7 @@ else if ($action == 'updateform')
|
|||||||
{
|
{
|
||||||
$res1=dolibarr_set_const($db, "MAIN_APPLICATION_TITLE", $_POST["MAIN_APPLICATION_TITLE"],'chaine',0,'',$conf->entity);
|
$res1=dolibarr_set_const($db, "MAIN_APPLICATION_TITLE", $_POST["MAIN_APPLICATION_TITLE"],'chaine',0,'',$conf->entity);
|
||||||
$res2=dolibarr_set_const($db, "MAIN_SESSION_TIMEOUT", $_POST["MAIN_SESSION_TIMEOUT"],'chaine',0,'',$conf->entity);
|
$res2=dolibarr_set_const($db, "MAIN_SESSION_TIMEOUT", $_POST["MAIN_SESSION_TIMEOUT"],'chaine',0,'',$conf->entity);
|
||||||
if ($res1 && $res2) setEventMessage($langs->trans("RecordModifiedSuccessfully"));
|
if ($res1 && $res2) setEventMessages($langs->trans("RecordModifiedSuccessfully"), null, 'mesgs');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -88,7 +88,7 @@ if ($action == 'send' && ! $_POST['cancel'])
|
|||||||
|
|
||||||
if (! empty($formsms->error))
|
if (! empty($formsms->error))
|
||||||
{
|
{
|
||||||
setEventMessage($formsms->error,'errors');
|
setEventMessages($formsms->error, $formsms->errors, 'errors');
|
||||||
$action='test';
|
$action='test';
|
||||||
$error++;
|
$error++;
|
||||||
}
|
}
|
||||||
@ -123,11 +123,11 @@ if ($action == 'send' && ! $_POST['cancel'])
|
|||||||
|
|
||||||
if ($result)
|
if ($result)
|
||||||
{
|
{
|
||||||
setEventMessage($langs->trans("SmsSuccessfulySent",$smsfrom,$sendto));
|
setEventMessages($langs->trans("SmsSuccessfulySent",$smsfrom,$sendto), null, 'mesgs');
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
setEventMessage($langs->trans("ResultKo"),'errors');
|
setEventMessages($langs->trans("ResultKo"), null, 'errors');
|
||||||
}
|
}
|
||||||
|
|
||||||
$action='';
|
$action='';
|
||||||
|
|||||||
@ -71,11 +71,11 @@ if ($action == 'update' || $action == 'add')
|
|||||||
|
|
||||||
if (! $error)
|
if (! $error)
|
||||||
{
|
{
|
||||||
setEventMessage($langs->trans("SetupSaved"));
|
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
setEventMessage($langs->trans("Error"),'errors');
|
setEventMessages($langs->trans("Error"), null, 'errors');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -96,12 +96,12 @@ if($action)
|
|||||||
if (! $error)
|
if (! $error)
|
||||||
{
|
{
|
||||||
$db->commit();
|
$db->commit();
|
||||||
setEventMessage($langs->trans("SetupSaved"));
|
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$db->rollback();
|
$db->rollback();
|
||||||
setEventMessage($langs->trans("Error"),'errors');
|
setEventMessages($langs->trans("Error"), null, 'errors');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -5,7 +5,7 @@
|
|||||||
* Copyright (C) 2004 Sebastien Di Cintio <sdicintio@ressource-toi.org>
|
* Copyright (C) 2004 Sebastien Di Cintio <sdicintio@ressource-toi.org>
|
||||||
* Copyright (C) 2004 Benoit Mortier <benoit.mortier@opensides.be>
|
* Copyright (C) 2004 Benoit Mortier <benoit.mortier@opensides.be>
|
||||||
* Copyright (C) 2010-2013 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>
|
* Copyright (C) 2011-2015 Philippe Grand <philippe.grand@atoo-net.com>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -63,11 +63,11 @@ if ($action == 'updateMask')
|
|||||||
|
|
||||||
if (! $error)
|
if (! $error)
|
||||||
{
|
{
|
||||||
setEventMessage($langs->trans("SetupSaved"));
|
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
setEventMessage($langs->trans("Error"),'errors');
|
setEventMessages($langs->trans("Error"), null, 'errors');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -106,13 +106,13 @@ if ($action == 'specimen') // For invoices
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
setEventMessage($module->error,'errors');
|
setEventMessages($module->error, $module->errors, 'errors');
|
||||||
dol_syslog($module->error, LOG_ERR);
|
dol_syslog($module->error, LOG_ERR);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
setEventMessage($langs->trans("ErrorModuleNotFound"),'errors');
|
setEventMessages($langs->trans("ErrorModuleNotFound"), null, 'errors');
|
||||||
dol_syslog($langs->trans("ErrorModuleNotFound"), LOG_ERR);
|
dol_syslog($langs->trans("ErrorModuleNotFound"), LOG_ERR);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -174,11 +174,11 @@ if ($action == 'set_SUPPLIER_INVOICE_FREE_TEXT')
|
|||||||
|
|
||||||
if (! $error)
|
if (! $error)
|
||||||
{
|
{
|
||||||
setEventMessage($langs->trans("SetupSaved"));
|
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
setEventMessage($langs->trans("Error"),'errors');
|
setEventMessages($langs->trans("Error"), null, 'errors');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -5,7 +5,7 @@
|
|||||||
* Copyright (C) 2004 Sebastien Di Cintio <sdicintio@ressource-toi.org>
|
* Copyright (C) 2004 Sebastien Di Cintio <sdicintio@ressource-toi.org>
|
||||||
* Copyright (C) 2004 Benoit Mortier <benoit.mortier@opensides.be>
|
* Copyright (C) 2004 Benoit Mortier <benoit.mortier@opensides.be>
|
||||||
* Copyright (C) 2010-2013 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>
|
* Copyright (C) 2011-2015 Philippe Grand <philippe.grand@atoo-net.com>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -64,11 +64,11 @@ if ($action == 'updateMask')
|
|||||||
|
|
||||||
if (! $error)
|
if (! $error)
|
||||||
{
|
{
|
||||||
setEventMessage($langs->trans("SetupSaved"));
|
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
setEventMessage($langs->trans("Error"),'errors');
|
setEventMessages($langs->trans("Error"), null, 'errors');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -107,13 +107,13 @@ else if ($action == 'specimen') // For orders
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
setEventMessage($module->error,'errors');
|
setEventMessages($module->error, $module->errors, 'errors');
|
||||||
dol_syslog($module->error, LOG_ERR);
|
dol_syslog($module->error, LOG_ERR);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
setEventMessage($langs->trans("ErrorModuleNotFound"),'errors');
|
setEventMessages($langs->trans("ErrorModuleNotFound"), null, 'errors');
|
||||||
dol_syslog($langs->trans("ErrorModuleNotFound"), LOG_ERR);
|
dol_syslog($langs->trans("ErrorModuleNotFound"), LOG_ERR);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -119,12 +119,12 @@ if ($action == 'set')
|
|||||||
if (! $error)
|
if (! $error)
|
||||||
{
|
{
|
||||||
$db->commit();
|
$db->commit();
|
||||||
setEventMessage($langs->trans("SetupSaved"));
|
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$db->rollback();
|
$db->rollback();
|
||||||
setEventMessage($error, 'errors');
|
setEventMessages($error, $errors, 'errors');
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -140,11 +140,11 @@ if ($action == 'setlevel')
|
|||||||
if (! $res > 0) $error++;
|
if (! $res > 0) $error++;
|
||||||
if (! $error)
|
if (! $error)
|
||||||
{
|
{
|
||||||
setEventMessage($langs->trans("SetupSaved"));
|
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
setEventMessage($langs->trans("Error"),'errors');
|
setEventMessages($langs->trans("Error"), null, 'errors');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -98,10 +98,10 @@ if ($action == 'update') {
|
|||||||
|
|
||||||
if (! $error) {
|
if (! $error) {
|
||||||
$db->commit();
|
$db->commit();
|
||||||
setEventMessage($langs->trans("SetupSaved"));
|
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
|
||||||
} else {
|
} else {
|
||||||
$db->rollback();
|
$db->rollback();
|
||||||
setEventMessage($langs->trans("Error"),'errors');
|
setEventMessages($langs->trans("Error"), null, 'errors');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -66,11 +66,9 @@ $var=false;
|
|||||||
print '<form method="post" action="'.DOL_URL_ROOT.'/comm/propal/list.php">';
|
print '<form method="post" action="'.DOL_URL_ROOT.'/comm/propal/list.php">';
|
||||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||||
print '<table class="noborder nohover" width="100%">';
|
print '<table class="noborder nohover" width="100%">';
|
||||||
print '<tr class="liste_titre"><td colspan="3">'.$langs->trans("SearchPropal").'</td></tr>';
|
print '<tr class="liste_titre"><td colspan="3">'.$langs->trans("Search").'</td></tr>';
|
||||||
print '<tr '.$bc[$var].'><td>';
|
print '<tr '.$bc[$var].'><td>';
|
||||||
print $langs->trans("Ref").':</td><td><input type="text" class="flat" name="sref" size=18></td><td rowspan="2"><input type="submit" value="'.$langs->trans("Search").'" class="button"></td></tr>';
|
print $langs->trans("Proposal").':</td><td><input type="text" class="flat" name="sall" size=18></td><td><input type="submit" value="'.$langs->trans("Search").'" class="button"></td></tr>';
|
||||||
print '<tr '.$bc[$var].'><td class="nowrap">'.$langs->trans("Other").':</td><td><input type="text" class="flat" name="sall" size="18"></td>';
|
|
||||||
print '</tr>';
|
|
||||||
print "</table></form><br>\n";
|
print "</table></form><br>\n";
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -67,11 +67,9 @@ $var=false;
|
|||||||
print '<form method="post" action="'.DOL_URL_ROOT.'/commande/list.php">';
|
print '<form method="post" action="'.DOL_URL_ROOT.'/commande/list.php">';
|
||||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||||
print '<table class="noborder nohover" width="100%">';
|
print '<table class="noborder nohover" width="100%">';
|
||||||
print '<tr class="liste_titre"><td colspan="3">'.$langs->trans("SearchOrder").'</td></tr>';
|
print '<tr class="liste_titre"><td colspan="3">'.$langs->trans("Search").'</td></tr>';
|
||||||
print '<tr '.$bc[$var].'><td>';
|
print '<tr '.$bc[$var].'><td>';
|
||||||
print $langs->trans("Ref").':</td><td><input type="text" class="flat" name="sref" size=18></td><td rowspan="2"><input type="submit" value="'.$langs->trans("Search").'" class="button"></td></tr>';
|
print $langs->trans("CustomerOrder").':</td><td><input type="text" class="flat" name="sall" size=18></td><td><input type="submit" value="'.$langs->trans("Search").'" class="button"></td></tr>';
|
||||||
print '<tr '.$bc[$var].'><td class="nowrap">'.$langs->trans("Other").':</td><td><input type="text" class="flat" name="sall" size="18"></td>';
|
|
||||||
print '</tr>';
|
|
||||||
print "</table></form><br>\n";
|
print "</table></form><br>\n";
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -79,12 +79,10 @@ if (! empty($conf->contrat->enabled))
|
|||||||
print '<form method="post" action="'.DOL_URL_ROOT.'/contrat/list.php">';
|
print '<form method="post" action="'.DOL_URL_ROOT.'/contrat/list.php">';
|
||||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||||
print '<table class="noborder nohover" width="100%">';
|
print '<table class="noborder nohover" width="100%">';
|
||||||
print '<tr class="liste_titre"><td colspan="3">'.$langs->trans("SearchAContract").'</td></tr>';
|
print '<tr class="liste_titre"><td colspan="3">'.$langs->trans("Search").'</td></tr>';
|
||||||
print '<tr '.$bc[$var].'>';
|
print '<tr '.$bc[$var].'>';
|
||||||
print '<td class="nowrap">'.$langs->trans("Ref").':</td><td><input type="text" class="flat" name="search_contract" size="18"></td>';
|
print '<td class="nowrap">'.$langs->trans("Contract").':</td><td><input type="text" class="flat" name="sall" size="18"></td>';
|
||||||
print '<td rowspan="2"><input type="submit" value="'.$langs->trans("Search").'" class="button"></td></tr>';
|
print '<td><input type="submit" value="'.$langs->trans("Search").'" class="button"></td></tr>';
|
||||||
print '<tr '.$bc[$var].'><td class="nowrap">'.$langs->trans("Other").':</td><td><input type="text" class="flat" name="sall" size="18"></td>';
|
|
||||||
print '</tr>';
|
|
||||||
print "</table></form>\n";
|
print "</table></form>\n";
|
||||||
print "<br>";
|
print "<br>";
|
||||||
}
|
}
|
||||||
|
|||||||
@ -42,47 +42,73 @@ $arrayresult=array();
|
|||||||
// Define $searchform
|
// Define $searchform
|
||||||
if ((( ! empty($conf->societe->enabled) && (empty($conf->global->SOCIETE_DISABLE_PROSPECTS) || empty($conf->global->SOCIETE_DISABLE_CUSTOMERS))) || ! empty($conf->fournisseur->enabled)) && empty($conf->global->MAIN_SEARCHFORM_SOCIETE_DISABLED) && $user->rights->societe->lire)
|
if ((( ! empty($conf->societe->enabled) && (empty($conf->global->SOCIETE_DISABLE_PROSPECTS) || empty($conf->global->SOCIETE_DISABLE_CUSTOMERS))) || ! empty($conf->fournisseur->enabled)) && empty($conf->global->MAIN_SEARCHFORM_SOCIETE_DISABLED) && $user->rights->societe->lire)
|
||||||
{
|
{
|
||||||
$langs->load("companies");
|
|
||||||
//$searchform.=printSearchForm(DOL_URL_ROOT.'/societe/list.php', DOL_URL_ROOT.'/societe/list.php', $langs->trans("ThirdParties"), 'soc', 'sall', 'T', 'searchleftt', img_object('','company'));
|
|
||||||
$arrayresult['searchintothirdparty']=array('text'=>img_picto('','object_company').' '.$langs->trans("SearchIntoThirdparties", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/societe/list.php?sall='.urlencode($search_boxvalue));
|
$arrayresult['searchintothirdparty']=array('text'=>img_picto('','object_company').' '.$langs->trans("SearchIntoThirdparties", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/societe/list.php?sall='.urlencode($search_boxvalue));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (! empty($conf->societe->enabled) && empty($conf->global->MAIN_SEARCHFORM_CONTACT_DISABLED) && $user->rights->societe->lire)
|
if (! empty($conf->societe->enabled) && empty($conf->global->MAIN_SEARCHFORM_CONTACT_DISABLED) && $user->rights->societe->lire)
|
||||||
{
|
{
|
||||||
$langs->load("companies");
|
|
||||||
//$searchform.=printSearchForm(DOL_URL_ROOT.'/contact/list.php', DOL_URL_ROOT.'/contact/list.php', $langs->trans("Contacts"), 'contact', 'sall', 'A', 'searchleftc', img_object('','contact'));
|
|
||||||
$arrayresult['searchintocontact']=array('text'=>img_picto('','object_contact').' '.$langs->trans("SearchIntoContacts", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/contact/list.php?sall='.urlencode($search_boxvalue));
|
$arrayresult['searchintocontact']=array('text'=>img_picto('','object_contact').' '.$langs->trans("SearchIntoContacts", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/contact/list.php?sall='.urlencode($search_boxvalue));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (((! empty($conf->product->enabled) && $user->rights->produit->lire) || (! empty($conf->service->enabled) && $user->rights->service->lire))
|
if (((! empty($conf->product->enabled) && $user->rights->produit->lire) || (! empty($conf->service->enabled) && $user->rights->service->lire))
|
||||||
&& empty($conf->global->MAIN_SEARCHFORM_PRODUITSERVICE_DISABLED))
|
&& empty($conf->global->MAIN_SEARCHFORM_PRODUITSERVICE_DISABLED))
|
||||||
{
|
{
|
||||||
$langs->load("products");
|
|
||||||
//$searchform.=printSearchForm(DOL_URL_ROOT.'/product/list.php', DOL_URL_ROOT.'/product/list.php', $langs->trans("Products")."/".$langs->trans("Services"), 'products', 'sall', 'P', 'searchleftp', img_object('','product'));
|
|
||||||
$arrayresult['searchintoproduct']=array('text'=>img_picto('','object_product').' '.$langs->trans("SearchIntoProductsOrServices", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/product/list.php?sall='.urlencode($search_boxvalue));
|
$arrayresult['searchintoproduct']=array('text'=>img_picto('','object_product').' '.$langs->trans("SearchIntoProductsOrServices", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/product/list.php?sall='.urlencode($search_boxvalue));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (! empty($conf->projet->enabled) && empty($conf->global->MAIN_SEARCHFORM_PROJECT_DISABLED) && $user->rights->projet->lire)
|
if (! empty($conf->projet->enabled) && empty($conf->global->MAIN_SEARCHFORM_PROJECT_DISABLED) && $user->rights->projet->lire)
|
||||||
{
|
{
|
||||||
$langs->load("projects");
|
|
||||||
//$searchform.=printSearchForm(DOL_URL_ROOT.'/projet/list.php', DOL_URL_ROOT.'/projet/list.php', $langs->trans("Projects"), 'project', 'search_all', 'Q', 'searchleftproj', img_object('','projectpub'));
|
|
||||||
$arrayresult['searchintoprojects']=array('text'=>img_picto('','object_projectpub').' '.$langs->trans("SearchIntoProjects", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/projet/list.php?search_all='.urlencode($search_boxvalue));
|
$arrayresult['searchintoprojects']=array('text'=>img_picto('','object_projectpub').' '.$langs->trans("SearchIntoProjects", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/projet/list.php?search_all='.urlencode($search_boxvalue));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (! empty($conf->adherent->enabled) && empty($conf->global->MAIN_SEARCHFORM_ADHERENT_DISABLED) && $user->rights->adherent->lire)
|
if (! empty($conf->adherent->enabled) && empty($conf->global->MAIN_SEARCHFORM_ADHERENT_DISABLED) && $user->rights->adherent->lire)
|
||||||
{
|
{
|
||||||
$langs->load("members");
|
|
||||||
//$searchform.=printSearchForm(DOL_URL_ROOT.'/adherents/list.php', DOL_URL_ROOT.'/adherents/list.php', $langs->trans("Members"), 'member', 'sall', 'M', 'searchleftm', img_object('','user'));
|
|
||||||
$arrayresult['searchintomember']=array('text'=>img_picto('','object_user').' '.$langs->trans("SearchIntoMembers", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/adherents/list.php?sall='.urlencode($search_boxvalue));
|
$arrayresult['searchintomember']=array('text'=>img_picto('','object_user').' '.$langs->trans("SearchIntoMembers", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/adherents/list.php?sall='.urlencode($search_boxvalue));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (! empty($conf->user->enabled) && empty($conf->global->MAIN_SEARCHFORM_PROJECT_DISABLED) && $user->rights->user->user->lire)
|
if (! empty($conf->user->enabled) && empty($conf->global->MAIN_SEARCHFORM_PROJECT_DISABLED) && $user->rights->user->user->lire)
|
||||||
{
|
{
|
||||||
$langs->load("users");
|
|
||||||
//$searchform.=printSearchForm(DOL_URL_ROOT.'/projet/list.php', DOL_URL_ROOT.'/projet/list.php', $langs->trans("Projects"), 'project', 'search_all', 'Q', 'searchleftproj', img_object('','projectpub'));
|
|
||||||
$arrayresult['searchintouser']=array('text'=>img_picto('','object_user').' '.$langs->trans("SearchIntoUsers", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/user/index.php?sall='.urlencode($search_boxvalue));
|
$arrayresult['searchintouser']=array('text'=>img_picto('','object_user').' '.$langs->trans("SearchIntoUsers", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/user/index.php?sall='.urlencode($search_boxvalue));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (! empty($conf->facture->enabled) && empty($conf->global->MAIN_SEARCHFORM_CUSTOMER_INVOICE_DISABLED) && $user->rights->facture->lire)
|
||||||
|
{
|
||||||
|
$arrayresult['searchintoinvoice']=array('text'=>img_picto('','object_bill').' '.$langs->trans("SearchIntoCustomerInvoices", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/compta/facture/list.php?sall='.urlencode($search_boxvalue));
|
||||||
|
}
|
||||||
|
|
||||||
|
if (! empty($conf->commande->enabled) && empty($conf->global->MAIN_SEARCHFORM_CUSTOMER_ORDER_DISABLED) && $user->rights->commande->lire)
|
||||||
|
{
|
||||||
|
$arrayresult['searchintoorder']=array('text'=>img_picto('','object_order').' '.$langs->trans("SearchIntoCustomerOrders", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/commande/list.php?sall='.urlencode($search_boxvalue));
|
||||||
|
}
|
||||||
|
|
||||||
|
if (! empty($conf->propal->enabled) && empty($conf->global->MAIN_SEARCHFORM_CUSTOMER_PROPAL_DISABLED) && $user->rights->propal->lire)
|
||||||
|
{
|
||||||
|
$arrayresult['searchintopropal']=array('text'=>img_picto('','object_propal').' '.$langs->trans("SearchIntoCustomerProposals", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/comm/propal/list.php?sall='.urlencode($search_boxvalue));
|
||||||
|
}
|
||||||
|
|
||||||
|
if (! empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_SEARCHFORM_SUPPLIER_INVOICE_DISABLED) && $user->rights->fournisseur->facture->lire)
|
||||||
|
{
|
||||||
|
$arrayresult['searchintosupplierinvoice']=array('text'=>img_picto('','object_bill').' '.$langs->trans("SearchIntoSupplierInvoices", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/fourn/facture/list.php?sall='.urlencode($search_boxvalue));
|
||||||
|
}
|
||||||
|
if (! empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_SEARCHFORM_SUPPLIER_ORDER_DISABLED) && $user->rights->fournisseur->commande->lire)
|
||||||
|
{
|
||||||
|
$arrayresult['searchintosupplierorder']=array('text'=>img_picto('','object_propal').' '.$langs->trans("SearchIntoSupplierOrders", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/fourn/commande/list.php?search_all='.urlencode($search_boxvalue));
|
||||||
|
}
|
||||||
|
if (! empty($conf->askpricesupplier->enabled) && empty($conf->global->MAIN_SEARCHFORM_SUPPLIER_PROPAL_DISABLED) && $user->rights->askpricesupplier->lire)
|
||||||
|
{
|
||||||
|
$arrayresult['searchintosupplierpropal']=array('text'=>img_picto('','object_propal').' '.$langs->trans("SearchIntoSupplierProposals", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/askpricesupplier/list.php?sall='.urlencode($search_boxvalue));
|
||||||
|
}
|
||||||
|
|
||||||
|
if (! empty($conf->ficheinter->enabled) && empty($conf->global->MAIN_SEARCHFORM_FICHINTER_DISABLED) && $user->rights->ficheinter->lire)
|
||||||
|
{
|
||||||
|
$arrayresult['searchintointervention']=array('text'=>img_picto('','object_intervention').' '.$langs->trans("SearchIntoInterventions", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/fichinter/list.php?sall='.urlencode($search_boxvalue));
|
||||||
|
}
|
||||||
|
if (! empty($conf->contrat->enabled) && empty($conf->global->MAIN_SEARCHFORM_CONTRACT_DISABLED) && $user->rights->contrat->lire)
|
||||||
|
{
|
||||||
|
$arrayresult['searchintocontract']=array('text'=>img_picto('','object_contract').' '.$langs->trans("SearchIntoContracts", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/contrat/list.php?sall='.urlencode($search_boxvalue));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/* Do we really need this. We already have a select for users, and we should be able to filter into user list on employee flag
|
/* Do we really need this. We already have a select for users, and we should be able to filter into user list on employee flag
|
||||||
if (! empty($conf->hrm->enabled) && ! empty($conf->global->MAIN_SEARCHFORM_EMPLOYEE) && $user->rights->hrm->employee->read)
|
if (! empty($conf->hrm->enabled) && ! empty($conf->global->MAIN_SEARCHFORM_EMPLOYEE) && $user->rights->hrm->employee->read)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -1111,7 +1111,7 @@ class ExtraFields
|
|||||||
*
|
*
|
||||||
* @param string $key Key of attribute
|
* @param string $key Key of attribute
|
||||||
* @param string $value Value to show
|
* @param string $value Value to show
|
||||||
* @param string $moreparam More param
|
* @param string $moreparam To add more parametes on html input tag (only checkbox use html input for output rendering)
|
||||||
* @return string Formated value
|
* @return string Formated value
|
||||||
*/
|
*/
|
||||||
function showOutputField($key,$value,$moreparam='')
|
function showOutputField($key,$value,$moreparam='')
|
||||||
@ -1128,6 +1128,8 @@ class ExtraFields
|
|||||||
$perms=$this->attribute_perms[$key];
|
$perms=$this->attribute_perms[$key];
|
||||||
$list=$this->attribute_list[$key];
|
$list=$this->attribute_list[$key];
|
||||||
|
|
||||||
|
$showsize=0;
|
||||||
|
|
||||||
if ($type == 'date')
|
if ($type == 'date')
|
||||||
{
|
{
|
||||||
$showsize=10;
|
$showsize=10;
|
||||||
@ -1357,11 +1359,59 @@ class ExtraFields
|
|||||||
$showsize=round($size);
|
$showsize=round($size);
|
||||||
if ($showsize > 48) $showsize=48;
|
if ($showsize > 48) $showsize=48;
|
||||||
}
|
}
|
||||||
|
|
||||||
//print $type.'-'.$size;
|
//print $type.'-'.$size;
|
||||||
$out=$value;
|
$out=$value;
|
||||||
|
|
||||||
return $out;
|
return $out;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Return tag to describe alignement to use for this extrafield
|
||||||
|
*
|
||||||
|
* @param string $key Key of attribute
|
||||||
|
* @return string Formated value
|
||||||
|
*/
|
||||||
|
function getAlignFlag($key)
|
||||||
|
{
|
||||||
|
global $conf,$langs;
|
||||||
|
|
||||||
|
$type=$this->attribute_type[$key];
|
||||||
|
|
||||||
|
$align='';
|
||||||
|
|
||||||
|
if ($type == 'date')
|
||||||
|
{
|
||||||
|
$align="center";
|
||||||
|
}
|
||||||
|
elseif ($type == 'datetime')
|
||||||
|
{
|
||||||
|
$align="center";
|
||||||
|
}
|
||||||
|
elseif ($type == 'int')
|
||||||
|
{
|
||||||
|
$align="right";
|
||||||
|
}
|
||||||
|
elseif ($type == 'double')
|
||||||
|
{
|
||||||
|
$align="right";
|
||||||
|
}
|
||||||
|
elseif ($type == 'boolean')
|
||||||
|
{
|
||||||
|
$align="center";
|
||||||
|
}
|
||||||
|
elseif ($type == 'radio')
|
||||||
|
{
|
||||||
|
$align="center";
|
||||||
|
}
|
||||||
|
elseif ($type == 'checkbox')
|
||||||
|
{
|
||||||
|
$align="center";
|
||||||
|
}
|
||||||
|
|
||||||
|
return $align;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return HTML string to print separator extrafield
|
* Return HTML string to print separator extrafield
|
||||||
*
|
*
|
||||||
|
|||||||
@ -210,9 +210,10 @@ function print_end_menu_array_auguria()
|
|||||||
* @param int $noout Disable output (Initialise &$menu only).
|
* @param int $noout Disable output (Initialise &$menu only).
|
||||||
* @param string $forcemainmenu 'x'=Force mainmenu to mainmenu='x'
|
* @param string $forcemainmenu 'x'=Force mainmenu to mainmenu='x'
|
||||||
* @param string $forceleftmenu 'all'=Force leftmenu to '' (= all)
|
* @param string $forceleftmenu 'all'=Force leftmenu to '' (= all)
|
||||||
|
* @param array $moredata An array with more data to output
|
||||||
* @return int Nb of entries
|
* @return int Nb of entries
|
||||||
*/
|
*/
|
||||||
function print_left_auguria_menu($db,$menu_array_before,$menu_array_after,&$tabMenu,&$menu,$noout=0,$forcemainmenu='',$forceleftmenu='')
|
function print_left_auguria_menu($db,$menu_array_before,$menu_array_after,&$tabMenu,&$menu,$noout=0,$forcemainmenu='',$forceleftmenu='',$moredata=null)
|
||||||
{
|
{
|
||||||
global $user,$conf,$langs,$dolibarr_main_db_name,$mysoc;
|
global $user,$conf,$langs,$dolibarr_main_db_name,$mysoc;
|
||||||
|
|
||||||
@ -245,6 +246,16 @@ function print_left_auguria_menu($db,$menu_array_before,$menu_array_after,&$tabM
|
|||||||
print '</div>'."\n";
|
print '</div>'."\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (is_array($moredata) && ! empty($moredata['searchform']))
|
||||||
|
{
|
||||||
|
print "\n";
|
||||||
|
print "<!-- Begin SearchForm -->\n";
|
||||||
|
print '<div id="blockvmenusearch" class="blockvmenusearch">'."\n";
|
||||||
|
print $moredata['searchform'];
|
||||||
|
print '</div>'."\n";
|
||||||
|
print "<!-- End SearchForm -->\n";
|
||||||
|
}
|
||||||
|
|
||||||
// We update newmenu with entries found into database
|
// We update newmenu with entries found into database
|
||||||
$menuArbo = new Menubase($db,'auguria');
|
$menuArbo = new Menubase($db,'auguria');
|
||||||
$newmenu = $menuArbo->menuLeftCharger($newmenu,$mainmenu,$leftmenu,($user->societe_id?1:0),'auguria',$tabMenu);
|
$newmenu = $menuArbo->menuLeftCharger($newmenu,$mainmenu,$leftmenu,($user->societe_id?1:0),'auguria',$tabMenu);
|
||||||
@ -348,7 +359,7 @@ function print_left_auguria_menu($db,$menu_array_before,$menu_array_after,&$tabM
|
|||||||
// Show menu
|
// Show menu
|
||||||
if (empty($noout))
|
if (empty($noout))
|
||||||
{
|
{
|
||||||
$alt=0; $blockvmenuopened=false;
|
$alt=0; $altok=0; $blockvmenuopened=false;
|
||||||
$num=count($menu_array);
|
$num=count($menu_array);
|
||||||
for ($i = 0; $i < $num; $i++)
|
for ($i = 0; $i < $num; $i++)
|
||||||
{
|
{
|
||||||
@ -358,14 +369,15 @@ function print_left_auguria_menu($db,$menu_array_before,$menu_array_after,&$tabM
|
|||||||
$alt++;
|
$alt++;
|
||||||
if (empty($menu_array[$i]['level']) && $showmenu)
|
if (empty($menu_array[$i]['level']) && $showmenu)
|
||||||
{
|
{
|
||||||
|
$altok++;
|
||||||
$blockvmenuopened=true;
|
$blockvmenuopened=true;
|
||||||
if (($alt%2==0))
|
if ($altok % 2 == 0)
|
||||||
{
|
{
|
||||||
print '<div class="blockvmenuimpair">'."\n";
|
print '<div class="blockvmenuimpair'.($altok == 1 ? ' blockvmenufirst':'').'">'."\n";
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
print '<div class="blockvmenupair">'."\n";
|
print '<div class="blockvmenupair'.($altok == 1 ? ' blockvmenufirst':'').'">'."\n";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -437,6 +449,18 @@ function print_left_auguria_menu($db,$menu_array_before,$menu_array_after,&$tabM
|
|||||||
if ($blockvmenuopened) { print "</div>\n"; $blockvmenuopened=false; }
|
if ($blockvmenuopened) { print "</div>\n"; $blockvmenuopened=false; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($altok) print '<div class="blockvmenuend"></div>';
|
||||||
|
}
|
||||||
|
|
||||||
|
if (is_array($moredata) && ! empty($moredata['bookmarks']))
|
||||||
|
{
|
||||||
|
print "\n";
|
||||||
|
print "<!-- Begin Bookmarks -->\n";
|
||||||
|
print '<div id="blockvmenubookmarks" class="blockvmenubookmarks">'."\n";
|
||||||
|
print $moredata['bookmarks'];
|
||||||
|
print '</div>'."\n";
|
||||||
|
print "<!-- End Bookmarks -->\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
return count($menu_array);
|
return count($menu_array);
|
||||||
|
|||||||
@ -158,9 +158,10 @@ class MenuManager
|
|||||||
* Show menu
|
* Show menu
|
||||||
*
|
*
|
||||||
* @param string $mode 'top', 'left', 'jmobile'
|
* @param string $mode 'top', 'left', 'jmobile'
|
||||||
|
* @param array $moredata An array with more data to output
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
function showmenu($mode)
|
function showmenu($mode, $moredata=null)
|
||||||
{
|
{
|
||||||
global $conf, $langs, $user;
|
global $conf, $langs, $user;
|
||||||
|
|
||||||
@ -176,7 +177,7 @@ class MenuManager
|
|||||||
$this->menu=new Menu();
|
$this->menu=new Menu();
|
||||||
|
|
||||||
if ($mode == 'top') print_auguria_menu($this->db,$this->atarget,$this->type_user,$this->tabMenu,$this->menu,0);
|
if ($mode == 'top') print_auguria_menu($this->db,$this->atarget,$this->type_user,$this->tabMenu,$this->menu,0);
|
||||||
if ($mode == 'left') print_left_auguria_menu($this->db,$this->menu_array,$this->menu_array_after,$this->tabMenu,$this->menu,0);
|
if ($mode == 'left') print_left_auguria_menu($this->db,$this->menu_array,$this->menu_array_after,$this->tabMenu,$this->menu,0,'','',$moredata);
|
||||||
if ($mode == 'jmobile')
|
if ($mode == 'jmobile')
|
||||||
{
|
{
|
||||||
print_auguria_menu($this->db,$this->atarget,$this->type_user,$this->tabMenu,$this->menu,1);
|
print_auguria_menu($this->db,$this->atarget,$this->type_user,$this->tabMenu,$this->menu,1);
|
||||||
|
|||||||
@ -414,9 +414,10 @@ function print_end_menu_array()
|
|||||||
* @param int $noout Disable output (Initialise &$menu only).
|
* @param int $noout Disable output (Initialise &$menu only).
|
||||||
* @param string $forcemainmenu 'x'=Force mainmenu to mainmenu='x'
|
* @param string $forcemainmenu 'x'=Force mainmenu to mainmenu='x'
|
||||||
* @param string $forceleftmenu 'all'=Force leftmenu to '' (= all)
|
* @param string $forceleftmenu 'all'=Force leftmenu to '' (= all)
|
||||||
|
* @param array $moredata An array with more data to output
|
||||||
* @return int nb of menu entries
|
* @return int nb of menu entries
|
||||||
*/
|
*/
|
||||||
function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu,&$menu,$noout=0,$forcemainmenu='',$forceleftmenu='')
|
function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu,&$menu,$noout=0,$forcemainmenu='',$forceleftmenu='',$moredata=null)
|
||||||
{
|
{
|
||||||
global $user,$conf,$langs,$dolibarr_main_db_name,$mysoc;
|
global $user,$conf,$langs,$dolibarr_main_db_name,$mysoc;
|
||||||
|
|
||||||
@ -449,6 +450,16 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu
|
|||||||
print '</div>'."\n";
|
print '</div>'."\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (is_array($moredata) && ! empty($moredata['searchform']))
|
||||||
|
{
|
||||||
|
print "\n";
|
||||||
|
print "<!-- Begin SearchForm -->\n";
|
||||||
|
print '<div id="blockvmenusearch" class="blockvmenusearch">'."\n";
|
||||||
|
print $moredata['searchform'];
|
||||||
|
print '</div>'."\n";
|
||||||
|
print "<!-- End SearchForm -->\n";
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* We update newmenu with entries found into database
|
* We update newmenu with entries found into database
|
||||||
* --------------------------------------------------
|
* --------------------------------------------------
|
||||||
@ -1407,11 +1418,11 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu
|
|||||||
$blockvmenuopened=true;
|
$blockvmenuopened=true;
|
||||||
if ($altok % 2 == 0)
|
if ($altok % 2 == 0)
|
||||||
{
|
{
|
||||||
print '<div class="blockvmenuimpair'.$invert.($alt == 1 ? ' blockvmenufirst':'').'">'."\n";
|
print '<div class="blockvmenuimpair'.$invert.($altok == 1 ? ' blockvmenufirst':'').'">'."\n";
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
print '<div class="blockvmenupair'.$invert.($alt == 1 ? ' blockvmenufirst':'').'">'."\n";
|
print '<div class="blockvmenupair'.$invert.($altok == 1 ? ' blockvmenufirst':'').'">'."\n";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1484,6 +1495,16 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu
|
|||||||
if ($altok) print '<div class="blockvmenuend"></div>';
|
if ($altok) print '<div class="blockvmenuend"></div>';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (is_array($moredata) && ! empty($moredata['bookmarks']))
|
||||||
|
{
|
||||||
|
print "\n";
|
||||||
|
print "<!-- Begin Bookmarks -->\n";
|
||||||
|
print '<div id="blockvmenubookmarks" class="blockvmenubookmarks">'."\n";
|
||||||
|
print $moredata['bookmarks'];
|
||||||
|
print '</div>'."\n";
|
||||||
|
print "<!-- End Bookmarks -->\n";
|
||||||
|
}
|
||||||
|
|
||||||
return count($menu_array);
|
return count($menu_array);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -112,9 +112,10 @@ class MenuManager
|
|||||||
* Show menu
|
* Show menu
|
||||||
*
|
*
|
||||||
* @param string $mode 'top', 'left', 'jmobile'
|
* @param string $mode 'top', 'left', 'jmobile'
|
||||||
|
* @param array $moredata An array with more data to output
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
function showmenu($mode)
|
function showmenu($mode, $moredata=null)
|
||||||
{
|
{
|
||||||
global $conf, $langs, $user;
|
global $conf, $langs, $user;
|
||||||
|
|
||||||
@ -132,7 +133,7 @@ class MenuManager
|
|||||||
if (empty($conf->global->MAIN_MENU_INVERT))
|
if (empty($conf->global->MAIN_MENU_INVERT))
|
||||||
{
|
{
|
||||||
if ($mode == 'top') print_eldy_menu($this->db,$this->atarget,$this->type_user,$this->tabMenu,$this->menu,0);
|
if ($mode == 'top') print_eldy_menu($this->db,$this->atarget,$this->type_user,$this->tabMenu,$this->menu,0);
|
||||||
if ($mode == 'left') print_left_eldy_menu($this->db,$this->menu_array,$this->menu_array_after,$this->tabMenu,$this->menu,0);
|
if ($mode == 'left') print_left_eldy_menu($this->db,$this->menu_array,$this->menu_array_after,$this->tabMenu,$this->menu,0,'','',$moredata);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|||||||
@ -61,9 +61,10 @@ class MenuManager
|
|||||||
* Show menu
|
* Show menu
|
||||||
*
|
*
|
||||||
* @param string $mode 'top', 'left', 'jmobile'
|
* @param string $mode 'top', 'left', 'jmobile'
|
||||||
|
* @param array $moredata An array with more data to output
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
function showmenu($mode)
|
function showmenu($mode, $moredata=null)
|
||||||
{
|
{
|
||||||
global $user,$conf,$langs,$dolibarr_main_db_name;
|
global $user,$conf,$langs,$dolibarr_main_db_name;
|
||||||
|
|
||||||
@ -133,20 +134,22 @@ class MenuManager
|
|||||||
|
|
||||||
if (empty($noout))
|
if (empty($noout))
|
||||||
{
|
{
|
||||||
$alt=0;
|
$alt=0; $altok=0; $blockvmenuopened=false;
|
||||||
$num=count($this->menu->liste);
|
$num=count($this->menu->liste);
|
||||||
for ($i = 0; $i < $num; $i++)
|
for ($i = 0; $i < $num; $i++)
|
||||||
{
|
{
|
||||||
$alt++;
|
$alt++;
|
||||||
if (empty($this->menu->liste[$i]['level']))
|
if (empty($this->menu->liste[$i]['level']))
|
||||||
{
|
{
|
||||||
|
$altok++;
|
||||||
|
$blockvmenuopened=true;
|
||||||
if (($alt%2==0))
|
if (($alt%2==0))
|
||||||
{
|
{
|
||||||
print '<div class="blockvmenuimpair">'."\n";
|
print '<div class="blockvmenuimpair'.($alt == 1 ? ' blockvmenufirst':'').'">'."\n";
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
print '<div class="blockvmenupair">'."\n";
|
print '<div class="blockvmenupair'.($alt == 1 ? ' blockvmenufirst':'').'">'."\n";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -201,6 +204,8 @@ class MenuManager
|
|||||||
print "</div>\n";
|
print "</div>\n";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($altok) print '<div class="blockvmenuend"></div>';
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($mode == 'jmobile')
|
if ($mode == 'jmobile')
|
||||||
|
|||||||
@ -123,7 +123,7 @@ print '<td align="right">'.$langs->trans("LibraryVersion").'</td>';
|
|||||||
print '</tr>';
|
print '</tr>';
|
||||||
|
|
||||||
include_once DOL_DOCUMENT_ROOT.'/core/modules/export/modules_export.php';
|
include_once DOL_DOCUMENT_ROOT.'/core/modules/export/modules_export.php';
|
||||||
$model=new ModeleExports();
|
$model=new ModeleExports($db);
|
||||||
$liste=$model->liste_modeles($db); // This is not a static method for exports because method load non static properties
|
$liste=$model->liste_modeles($db); // This is not a static method for exports because method load non static properties
|
||||||
|
|
||||||
$var=true;
|
$var=true;
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
/* Copyright (C) 2003-2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
/* Copyright (C) 2003-2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||||
* Copyright (C) 2004-2011 Laurent Destailleur <eldy@users.sourceforge.net>
|
* Copyright (C) 2004-2015 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
|
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
|
||||||
* Copyright (C) 2015 Charlie Benke <charlie@patas-monkey.com>
|
* Copyright (C) 2015 Charlie Benke <charlie@patas-monkey.com>
|
||||||
|
|
||||||
@ -67,11 +67,9 @@ $var=false;
|
|||||||
print '<table class="noborder nohover" width="100%">';
|
print '<table class="noborder nohover" width="100%">';
|
||||||
print '<form method="post" action="'.DOL_URL_ROOT.'/fichinter/list.php">';
|
print '<form method="post" action="'.DOL_URL_ROOT.'/fichinter/list.php">';
|
||||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||||
print '<tr class="liste_titre"><td colspan="3">'.$langs->trans("SearchAnIntervention").'</td></tr>';
|
print '<tr class="liste_titre"><td colspan="3">'.$langs->trans("Search").'</td></tr>';
|
||||||
print '<tr '.$bc[$var].'><td>';
|
print '<tr '.$bc[$var].'><td>';
|
||||||
print $langs->trans("Ref").':</td><td><input type="text" class="flat" name="sref" size=18></td><td rowspan="2"><input type="submit" value="'.$langs->trans("Search").'" class="button"></td></tr>';
|
print $langs->trans("Intervention").':</td><td><input type="text" class="flat" name="sall" size="18"></td><td><input type="submit" value="'.$langs->trans("Search").'" class="button"></td></tr>';
|
||||||
print '<tr '.$bc[$var].'><td class="nowrap">'.$langs->trans("Other").':</td><td><input type="text" class="flat" name="sall" size="18"></td>';
|
|
||||||
print '</tr>';
|
|
||||||
print "</form></table><br>\n";
|
print "</form></table><br>\n";
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -61,11 +61,9 @@ $var=false;
|
|||||||
print '<form method="post" action="list.php">';
|
print '<form method="post" action="list.php">';
|
||||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||||
print '<table class="noborder nohover" width="100%">';
|
print '<table class="noborder nohover" width="100%">';
|
||||||
print '<tr class="liste_titre"><td colspan="3">'.$langs->trans("SearchOrder").'</td></tr>';
|
print '<tr class="liste_titre"><td colspan="3">'.$langs->trans("Search").'</td></tr>';
|
||||||
print '<tr '.$bc[$var].'><td>';
|
print '<tr '.$bc[$var].'><td>';
|
||||||
print $langs->trans("Ref").':</td><td><input type="text" class="flat" name="search_ref" size=18></td><td rowspan="2"><input type="submit" value="'.$langs->trans("Search").'" class="button"></td></tr>';
|
print $langs->trans("SupplierOrder").':</td><td><input type="text" class="flat" name="search_all" size="18"></td><td><input type="submit" value="'.$langs->trans("Search").'" class="button"></td></tr>';
|
||||||
print '<tr '.$bc[$var].'><td class="nowrap">'.$langs->trans("Other").':</td><td><input type="text" class="flat" name="search_all" size="18"></td>';
|
|
||||||
print '</tr>';
|
|
||||||
print "</table></form><br>\n";
|
print "</table></form><br>\n";
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -38,13 +38,13 @@ $langs->load("orders");
|
|||||||
$langs->load("sendings");
|
$langs->load("sendings");
|
||||||
|
|
||||||
|
|
||||||
|
$sall=GETPOST('search_all');
|
||||||
$search_ref=GETPOST('search_ref');
|
$search_ref=GETPOST('search_ref');
|
||||||
$search_refsupp=GETPOST('search_refsupp');
|
$search_refsupp=GETPOST('search_refsupp');
|
||||||
$search_company=GETPOST('search_company');
|
$search_company=GETPOST('search_company');
|
||||||
$search_user=GETPOST('search_user');
|
$search_user=GETPOST('search_user');
|
||||||
$search_ht=GETPOST('search_ht');
|
$search_ht=GETPOST('search_ht');
|
||||||
$search_ttc=GETPOST('search_ttc');
|
$search_ttc=GETPOST('search_ttc');
|
||||||
$sall=GETPOST('search_all');
|
|
||||||
$search_status=(GETPOST('search_status','alpha')!=''?GETPOST('search_status','alpha'):GETPOST('statut','alpha')); // alpha and not intbecause it can be '6,7'
|
$search_status=(GETPOST('search_status','alpha')!=''?GETPOST('search_status','alpha'):GETPOST('statut','alpha')); // alpha and not intbecause it can be '6,7'
|
||||||
$optioncss = GETPOST('optioncss','alpha');
|
$optioncss = GETPOST('optioncss','alpha');
|
||||||
|
|
||||||
|
|||||||
@ -53,7 +53,7 @@ dol_htmloutput_mesg($mesg);
|
|||||||
|
|
||||||
// Subheader
|
// Subheader
|
||||||
$linkback = '<a href="' . DOL_URL_ROOT . '/admin/modules.php">' . $langs->trans("BackToModuleList") . '</a>';
|
$linkback = '<a href="' . DOL_URL_ROOT . '/admin/modules.php">' . $langs->trans("BackToModuleList") . '</a>';
|
||||||
print load_fiche_titre($langs->trans($page_name), $linkback);
|
print load_fiche_titre($langs->trans("HRMSetup"), $linkback);
|
||||||
|
|
||||||
// Configuration header
|
// Configuration header
|
||||||
$head = hrm_admin_prepare_head();
|
$head = hrm_admin_prepare_head();
|
||||||
|
|||||||
@ -48,7 +48,7 @@ dol_htmloutput_mesg($mesg);
|
|||||||
|
|
||||||
// Subheader
|
// Subheader
|
||||||
$linkback = '<a href="' . DOL_URL_ROOT . '/admin/modules.php">' . $langs->trans("BackToModuleList") . '</a>';
|
$linkback = '<a href="' . DOL_URL_ROOT . '/admin/modules.php">' . $langs->trans("BackToModuleList") . '</a>';
|
||||||
print load_fiche_titre($langs->trans($page_name), $linkback);
|
print load_fiche_titre($langs->trans("HRMSetup"), $linkback);
|
||||||
|
|
||||||
// Configuration header
|
// Configuration header
|
||||||
$head = hrm_admin_prepare_head();
|
$head = hrm_admin_prepare_head();
|
||||||
|
|||||||
226
htdocs/hrm/class/employee.class.php
Normal file
226
htdocs/hrm/class/employee.class.php
Normal file
@ -0,0 +1,226 @@
|
|||||||
|
<?php
|
||||||
|
/* Copyright (C) 2015 Alexandre Spangaro <aspangaro.dolibarr@gmail.com>
|
||||||
|
*
|
||||||
|
* 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
|
||||||
|
* the Free Software Foundation; either version 3 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \file htdocs/hrm/class/employee.class.php
|
||||||
|
* \ingroup HRM
|
||||||
|
* \brief File of class to manage employees
|
||||||
|
*/
|
||||||
|
|
||||||
|
require_once DOL_DOCUMENT_ROOT .'/core/class/commonobject.class.php';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Class to manage establishments
|
||||||
|
*/
|
||||||
|
class Employee extends CommonObject
|
||||||
|
{
|
||||||
|
public $element='employee';
|
||||||
|
public $table_element='user';
|
||||||
|
public $table_element_line = '';
|
||||||
|
public $fk_element = 'fk_user';
|
||||||
|
protected $ismultientitymanaged = 1; // 0=No test on entity, 1=Test with field entity, 2=Test with link by societe
|
||||||
|
|
||||||
|
var $rowid;
|
||||||
|
|
||||||
|
var $name;
|
||||||
|
var $address;
|
||||||
|
var $zip;
|
||||||
|
var $town;
|
||||||
|
var $status; // 0=open, 1=closed
|
||||||
|
var $entity;
|
||||||
|
|
||||||
|
var $statuts=array();
|
||||||
|
var $statuts_short=array();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Constructor
|
||||||
|
*
|
||||||
|
* @param DoliDB $db Database handler
|
||||||
|
*/
|
||||||
|
function __construct($db)
|
||||||
|
{
|
||||||
|
$this->db = $db;
|
||||||
|
|
||||||
|
$this->statuts_short = array(0 => 'Opened', 1 => 'Closed');
|
||||||
|
$this->statuts = array(0 => 'Opened', 1 => 'Closed');
|
||||||
|
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Load an object from database
|
||||||
|
*
|
||||||
|
* @param int $id Id of record to load
|
||||||
|
* @return int <0 if KO, >0 if OK
|
||||||
|
*/
|
||||||
|
function fetch($id)
|
||||||
|
{
|
||||||
|
$sql = "SELECT rowid, firstname, lastname, status, fk_user";
|
||||||
|
$sql.= " FROM ".MAIN_DB_PREFIX."user";
|
||||||
|
$sql.= " WHERE rowid = ".$id;
|
||||||
|
|
||||||
|
dol_syslog(get_class($this)."::fetch", LOG_DEBUG);
|
||||||
|
$result = $this->db->query($sql);
|
||||||
|
if ( $result )
|
||||||
|
{
|
||||||
|
$obj = $this->db->fetch_object($result);
|
||||||
|
|
||||||
|
$this->id = $obj->rowid;
|
||||||
|
$this->name = $obj->name;
|
||||||
|
$this->address = $obj->address;
|
||||||
|
$this->zip = $obj->zip;
|
||||||
|
$this->town = $obj->town;
|
||||||
|
$this->status = $obj->status;
|
||||||
|
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$this->error=$this->db->lasterror();
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Return a link to the employee card (with optionaly the picto)
|
||||||
|
* Use this->id,this->lastname, this->firstname
|
||||||
|
*
|
||||||
|
* @param int $withpictoimg Include picto in link (0=No picto, 1=Include picto into link, 2=Only picto, -1=Include photo into link, -2=Only picto photo)
|
||||||
|
* @param string $option On what the link point to
|
||||||
|
* @param integer $notooltip 1=Disable tooltip on picto and name
|
||||||
|
* @param int $maxlen Max length of visible employee name
|
||||||
|
* @param int $hidethirdpartylogo Hide logo of thirdparty
|
||||||
|
* @param string $mode ''=Show firstname and lastname, 'firstname'=Show only firstname, 'login'=Show login
|
||||||
|
* @param string $morecss Add more css on link
|
||||||
|
* @return string String with URL
|
||||||
|
*/
|
||||||
|
function getNomUrl($withpictoimg=0, $option='', $notooltip=0, $maxlen=24, $hidethirdpartylogo=0, $mode='',$morecss='')
|
||||||
|
{
|
||||||
|
global $langs, $conf;
|
||||||
|
|
||||||
|
if (! empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER) && $withpictoimg) $withpictoimg=0;
|
||||||
|
|
||||||
|
$result = '';
|
||||||
|
$companylink = '';
|
||||||
|
$link = '';
|
||||||
|
|
||||||
|
$label = '<u>' . $langs->trans("Employee") . '</u>';
|
||||||
|
$label.= '<div width="100%">';
|
||||||
|
$label.= '<b>' . $langs->trans('Name') . ':</b> ' . $this->getFullName($langs,'','');
|
||||||
|
$label.= '<br><b>' . $langs->trans("EMail").':</b> '.$this->email;
|
||||||
|
$label.='</div>';
|
||||||
|
if (! empty($this->photo))
|
||||||
|
{
|
||||||
|
$label.= '<div class="photointooltip">';
|
||||||
|
$label.= Form::showphoto('userphoto', $this, 80, 0, 0, 'photowithmargin photologintooltip', 'small', 0, 1);
|
||||||
|
$label.= '</div><div style="clear: both;"></div>';
|
||||||
|
}
|
||||||
|
|
||||||
|
$link.= '<a href="'.DOL_URL_ROOT.'/hrm/employee/card.php?id='.$this->id.'"';
|
||||||
|
if (empty($notooltip))
|
||||||
|
{
|
||||||
|
if (! empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER))
|
||||||
|
{
|
||||||
|
$langs->load("users");
|
||||||
|
$label=$langs->trans("ShowUser");
|
||||||
|
$link.=' alt="'.dol_escape_htmltag($label, 1).'"';
|
||||||
|
}
|
||||||
|
$link.= ' title="'.dol_escape_htmltag($label, 1).'"';
|
||||||
|
$link.= ' class="classfortooltip'.($morecss?' '.$morecss:'').'"';
|
||||||
|
}
|
||||||
|
$link.= '>';
|
||||||
|
$linkend='</a>';
|
||||||
|
|
||||||
|
//if ($withpictoimg == -1) $result.='<div class="nowrap">';
|
||||||
|
$result.=$link;
|
||||||
|
if ($withpictoimg)
|
||||||
|
{
|
||||||
|
$paddafterimage='';
|
||||||
|
if (abs($withpictoimg) == 1) $paddafterimage='style="padding-right: 3px;"';
|
||||||
|
if ($withpictoimg > 0) $picto='<div class="inline-block valignmiddle'.($morecss?' userimg'.$morecss:'').'">'.img_object('', 'user', $paddafterimage.' '.($notooltip?'':'class="classfortooltip"')).'</div>';
|
||||||
|
else $picto='<div class="inline-block valignmiddle'.($morecss?' userimg'.$morecss:'').'"'.($paddafterimage?' '.$paddafterimage:'').'>'.Form::showphoto('userphoto', $this, 0, 0, 0, 'loginphoto', 'mini', 0, 1).'</div>';
|
||||||
|
$result.=$picto;
|
||||||
|
}
|
||||||
|
if (abs($withpictoimg) != 2)
|
||||||
|
{
|
||||||
|
if (empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) $result.='<div class="inline-block valignmiddle'.($morecss?' usertext'.$morecss:'').'">';
|
||||||
|
if ($mode == 'login') $result.=dol_trunc($this->login, $maxlen);
|
||||||
|
else $result.=$this->getFullName($langs,'',($mode == 'firstname' ? 2 : -1),$maxlen);
|
||||||
|
if (empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) $result.='</div>';
|
||||||
|
}
|
||||||
|
$result.=$linkend;
|
||||||
|
//if ($withpictoimg == -1) $result.='</div>';
|
||||||
|
$result.=$companylink;
|
||||||
|
return $result;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Return status label of an employee
|
||||||
|
*
|
||||||
|
* @param int $mode 0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=Short label + Picto
|
||||||
|
* @return string Label of status
|
||||||
|
*/
|
||||||
|
function getLibStatut($mode=0)
|
||||||
|
{
|
||||||
|
return $this->LibStatut($this->statut,$mode);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Return label of given status
|
||||||
|
*
|
||||||
|
* @param int $statut Id statut
|
||||||
|
* @param int $mode 0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=Short label + Picto
|
||||||
|
* @return string Label of status
|
||||||
|
*/
|
||||||
|
function LibStatut($statut,$mode=0)
|
||||||
|
{
|
||||||
|
global $langs;
|
||||||
|
$langs->load('users');
|
||||||
|
|
||||||
|
if ($mode == 0)
|
||||||
|
{
|
||||||
|
$prefix='';
|
||||||
|
if ($statut == 1) return $langs->trans('Enabled');
|
||||||
|
if ($statut == 0) return $langs->trans('Disabled');
|
||||||
|
}
|
||||||
|
if ($mode == 1)
|
||||||
|
{
|
||||||
|
if ($statut == 1) return $langs->trans('Enabled');
|
||||||
|
if ($statut == 0) return $langs->trans('Disabled');
|
||||||
|
}
|
||||||
|
if ($mode == 2)
|
||||||
|
{
|
||||||
|
if ($statut == 1) return img_picto($langs->trans('Enabled'),'statut4').' '.$langs->trans('Enabled');
|
||||||
|
if ($statut == 0) return img_picto($langs->trans('Disabled'),'statut5').' '.$langs->trans('Disabled');
|
||||||
|
}
|
||||||
|
if ($mode == 3)
|
||||||
|
{
|
||||||
|
if ($statut == 1) return img_picto($langs->trans('Enabled'),'statut4');
|
||||||
|
if ($statut == 0) return img_picto($langs->trans('Disabled'),'statut5');
|
||||||
|
}
|
||||||
|
if ($mode == 4)
|
||||||
|
{
|
||||||
|
if ($statut == 1) return img_picto($langs->trans('Enabled'),'statut4').' '.$langs->trans('Enabled');
|
||||||
|
if ($statut == 0) return img_picto($langs->trans('Disabled'),'statut5').' '.$langs->trans('Disabled');
|
||||||
|
}
|
||||||
|
if ($mode == 5)
|
||||||
|
{
|
||||||
|
if ($statut == 1) return $langs->trans('Enabled').' '.img_picto($langs->trans('Enabled'),'statut4');
|
||||||
|
if ($statut == 0) return $langs->trans('Disabled').' '.img_picto($langs->trans('Disabled'),'statut5');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
0
htdocs/hrm/employee/index.html
Normal file
0
htdocs/hrm/employee/index.html
Normal file
223
htdocs/hrm/employee/list.php
Normal file
223
htdocs/hrm/employee/list.php
Normal file
@ -0,0 +1,223 @@
|
|||||||
|
<?php
|
||||||
|
/* Copyright (C) 2002-2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||||
|
* Copyright (C) 2004-2015 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
|
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
|
||||||
|
* Copyright (C) 2015 Alexandre Spangaro <aspangaro.dolibarr@gmail.com>
|
||||||
|
*
|
||||||
|
* 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
|
||||||
|
* the Free Software Foundation; either version 3 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \file htdocs/hrm/employee/list.php
|
||||||
|
* \ingroup core
|
||||||
|
* \brief Page of users
|
||||||
|
*/
|
||||||
|
|
||||||
|
require '../../main.inc.php';
|
||||||
|
require_once DOL_DOCUMENT_ROOT.'/hrm/class/employee.class.php';
|
||||||
|
|
||||||
|
if (! $user->rights->hrm->employee->read)
|
||||||
|
accessforbidden();
|
||||||
|
|
||||||
|
$langs->load("users");
|
||||||
|
$langs->load("companies");
|
||||||
|
$langs->load("hrm");
|
||||||
|
|
||||||
|
// Security check (for external users)
|
||||||
|
$socid=0;
|
||||||
|
if ($user->societe_id > 0)
|
||||||
|
$socid = $user->societe_id;
|
||||||
|
|
||||||
|
$sall=GETPOST('sall','alpha');
|
||||||
|
$search_user=GETPOST('search_user','alpha');
|
||||||
|
$search_login=GETPOST('search_login','alpha');
|
||||||
|
$search_lastname=GETPOST('search_lastname','alpha');
|
||||||
|
$search_firstname=GETPOST('search_firstname','alpha');
|
||||||
|
$search_statut=GETPOST('search_statut','alpha');
|
||||||
|
$search_thirdparty=GETPOST('search_thirdparty','alpha');
|
||||||
|
$optioncss = GETPOST('optioncss','alpha');
|
||||||
|
|
||||||
|
if ($search_statut == '') $search_statut='1';
|
||||||
|
|
||||||
|
$sortfield = GETPOST('sortfield','alpha');
|
||||||
|
$sortorder = GETPOST('sortorder','alpha');
|
||||||
|
$page = GETPOST('page','int');
|
||||||
|
if ($page == -1) { $page = 0; }
|
||||||
|
$offset = $conf->liste_limit * $page;
|
||||||
|
$pageprev = $page - 1;
|
||||||
|
$pagenext = $page + 1;
|
||||||
|
$limit = $conf->liste_limit;
|
||||||
|
if (! $sortfield) $sortfield="u.login";
|
||||||
|
if (! $sortorder) $sortorder="ASC";
|
||||||
|
|
||||||
|
$employeestatic = new Employee($db);
|
||||||
|
$companystatic = new Societe($db);
|
||||||
|
$form = new Form($db);
|
||||||
|
|
||||||
|
if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter"))
|
||||||
|
{
|
||||||
|
$search_user="";
|
||||||
|
$search_login="";
|
||||||
|
$search_lastname="";
|
||||||
|
$search_firstname="";
|
||||||
|
$search_statut="";
|
||||||
|
$search_thirdparty="";
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* View
|
||||||
|
*/
|
||||||
|
|
||||||
|
llxHeader('',$langs->trans("ListOfEmployees"));
|
||||||
|
|
||||||
|
$buttonviewhierarchy='<form action="'.DOL_URL_ROOT.'/hrm/employee/hierarchy.php'.(($search_statut != '' && $search_statut >= 0) ? '?search_statut='.$search_statut : '').'" method="POST"><input type="submit" class="button" style="width:120px" name="viewcal" value="'.dol_escape_htmltag($langs->trans("HierarchicView")).'"></form>';
|
||||||
|
|
||||||
|
print load_fiche_titre($langs->trans("ListOfEmployees"), $buttonviewhierarchy);
|
||||||
|
|
||||||
|
$sql = "SELECT u.rowid, u.lastname, u.firstname, u.email, u.gender,";
|
||||||
|
$sql.= " u.datec,";
|
||||||
|
$sql.= " u.tms as datem,";
|
||||||
|
$sql.= " u.ldap_sid, u.statut, u.entity,";
|
||||||
|
$sql.= " u2.login as login2, u2.firstname as firstname2, u2.lastname as lastname2,";
|
||||||
|
$sql.= " s.nom as name, s.canvas";
|
||||||
|
$sql.= " FROM ".MAIN_DB_PREFIX."user as u";
|
||||||
|
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON u.fk_soc = s.rowid";
|
||||||
|
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."user as u2 ON u.fk_user = u2.rowid";
|
||||||
|
$sql.= " WHERE u.employee >= '1'";
|
||||||
|
$sql.= " AND u.entity IN (".getEntity('user',1).")";
|
||||||
|
|
||||||
|
if ($socid > 0) $sql.= " AND u.fk_soc = ".$socid;
|
||||||
|
if ($search_user != '') $sql.=natural_search(array('u.login', 'u.lastname', 'u.firstname'), $search_user);
|
||||||
|
if ($search_thirdparty != '') $sql.=natural_search(array('s.nom'), $search_thirdparty);
|
||||||
|
if ($search_login != '') $sql.= natural_search("u.login", $search_login);
|
||||||
|
if ($search_lastname != '') $sql.= natural_search("u.lastname", $search_lastname);
|
||||||
|
if ($search_firstname != '') $sql.= natural_search("u.firstname", $search_firstname);
|
||||||
|
if ($search_statut != '' && $search_statut >= 0) $sql.= " AND (u.statut=".$search_statut.")";
|
||||||
|
if ($sall) $sql.= natural_search(array('u.login', 'u.lastname', 'u.firstname', 'u.email', 'u.note'), $sall);
|
||||||
|
$sql.=$db->order($sortfield,$sortorder);
|
||||||
|
|
||||||
|
$result = $db->query($sql);
|
||||||
|
if ($result)
|
||||||
|
{
|
||||||
|
$num = $db->num_rows($result);
|
||||||
|
$i = 0;
|
||||||
|
|
||||||
|
print '<form method="POST" id="searchFormList" action="'.$_SERVER["PHP_SELF"].'">'."\n";
|
||||||
|
if ($optioncss != '') print '<input type="hidden" name="optioncss" value="'.$optioncss.'">';
|
||||||
|
|
||||||
|
$param="search_user=".$search_user."&sall=".$sall;
|
||||||
|
$param.="&search_statut=".$search_statut;
|
||||||
|
if ($optioncss != '') $param.='&optioncss='.$optioncss;
|
||||||
|
|
||||||
|
print '<table class="noborder" width="100%">';
|
||||||
|
print '<tr class="liste_titre">';
|
||||||
|
print_liste_field_titre($langs->trans("Login"),$_SERVER['PHP_SELF'],"u.login",$param,"","",$sortfield,$sortorder);
|
||||||
|
print_liste_field_titre($langs->trans("LastName"),$_SERVER['PHP_SELF'],"u.lastname",$param,"","",$sortfield,$sortorder);
|
||||||
|
print_liste_field_titre($langs->trans("FirstName"),$_SERVER['PHP_SELF'],"u.firstname",$param,"","",$sortfield,$sortorder);
|
||||||
|
if (! empty($conf->multicompany->enabled) && empty($conf->multicompany->transverse_mode))
|
||||||
|
{
|
||||||
|
print_liste_field_titre($langs->trans("Entity"),$_SERVER['PHP_SELF'],"u.entity",$param,"","",$sortfield,$sortorder);
|
||||||
|
}
|
||||||
|
print_liste_field_titre($langs->trans("HierarchicalResponsible"),$_SERVER['PHP_SELF'],"u2.login",$param,"",'align="center"',$sortfield,$sortorder);
|
||||||
|
print_liste_field_titre($langs->trans("Status"),$_SERVER['PHP_SELF'],"u.statut",$param,"",'align="center"',$sortfield,$sortorder);
|
||||||
|
print_liste_field_titre('',$_SERVER["PHP_SELF"],"",'','','',$sortfield,$sortorder,'maxwidthsearch ');
|
||||||
|
print "</tr>\n";
|
||||||
|
|
||||||
|
// Search bar
|
||||||
|
if (! empty($conf->multicompany->enabled) && empty($conf->multicompany->transverse_mode)) $colspan++;
|
||||||
|
print '<tr class="liste_titre">';
|
||||||
|
print '<td><input type="text" name="search_login" size="6" value="'.$search_login.'"></td>';
|
||||||
|
print '<td><input type="text" name="search_lastname" size="6" value="'.$search_lastname.'"></td>';
|
||||||
|
print '<td><input type="text" name="search_firstname" size="6" value="'.$search_firstname.'"></td>';
|
||||||
|
print '<td> </td>';
|
||||||
|
|
||||||
|
// Status
|
||||||
|
print '<td align="right">';
|
||||||
|
print $form->selectarray('search_statut', array('-1'=>'','0'=>$langs->trans('Disabled'),'1'=>$langs->trans('Enabled')),$search_statut);
|
||||||
|
print '</td>';
|
||||||
|
|
||||||
|
print '<td class="liste_titre" align="right"><input type="image" class="liste_titre" name="button_search" src="'.img_picto($langs->trans("Search"),'search.png','','',1).'" value="'.dol_escape_htmltag($langs->trans("Search")).'" title="'.dol_escape_htmltag($langs->trans("Search")).'">';
|
||||||
|
print '<input type="image" class="liste_titre" name="button_removefilter" src="'.img_picto($langs->trans("Search"),'searchclear.png','','',1).'" value="'.dol_escape_htmltag($langs->trans("RemoveFilter")).'" title="'.dol_escape_htmltag($langs->trans("RemoveFilter")).'">';
|
||||||
|
print '</td>';
|
||||||
|
|
||||||
|
print "</tr>\n";
|
||||||
|
|
||||||
|
$employee2=new Employee($db);
|
||||||
|
|
||||||
|
$var=True;
|
||||||
|
while ($i < $num)
|
||||||
|
{
|
||||||
|
$obj = $db->fetch_object($result);
|
||||||
|
$var=!$var;
|
||||||
|
|
||||||
|
$employeestatic->id=$obj->rowid;
|
||||||
|
$employeestatic->ref=$obj->label;
|
||||||
|
$employeestatic->login=$obj->login;
|
||||||
|
$employeestatic->statut=$obj->statut;
|
||||||
|
$employeestatic->email=$obj->email;
|
||||||
|
$employeestatic->gender=$obj->gender;
|
||||||
|
$employeestatic->societe_id=$obj->fk_soc;
|
||||||
|
$employeestatic->firstname='';
|
||||||
|
$employeestatic->lastname=$obj->login;
|
||||||
|
|
||||||
|
$li=$employeestatic->getNomUrl(1,'',0,0,24,1);
|
||||||
|
|
||||||
|
print "<tr ".$bc[$var].">";
|
||||||
|
print '<td>';
|
||||||
|
print $li;
|
||||||
|
if (! empty($conf->multicompany->enabled) && $obj->admin && ! $obj->entity)
|
||||||
|
{
|
||||||
|
print img_picto($langs->trans("SuperAdministrator"),'redstar');
|
||||||
|
}
|
||||||
|
else if ($obj->admin)
|
||||||
|
{
|
||||||
|
print img_picto($langs->trans("Administrator"),'star');
|
||||||
|
}
|
||||||
|
print '</td>';
|
||||||
|
print '<td>'.ucfirst($obj->lastname).'</td>';
|
||||||
|
print '<td>'.ucfirst($obj->firstname).'</td>';
|
||||||
|
|
||||||
|
// Resp
|
||||||
|
print '<td class="nowrap" align="center">';
|
||||||
|
if ($obj->login2)
|
||||||
|
{
|
||||||
|
$employee2->login=$obj->login2;
|
||||||
|
//$employee2->lastname=$obj->lastname2;
|
||||||
|
//$employee2->firstname=$obj->firstname2;
|
||||||
|
$employee2->lastname=$employee2->login;
|
||||||
|
$employee2->firstname='';
|
||||||
|
print $employee2->getNomUrl(1);
|
||||||
|
}
|
||||||
|
print '</td>';
|
||||||
|
|
||||||
|
// Statut
|
||||||
|
$employeestatic->statut=$obj->statut;
|
||||||
|
print '<td align="right">'.$employeestatic->getLibStatut(5).'</td>';
|
||||||
|
print '<td> </td>';
|
||||||
|
print "</tr>\n";
|
||||||
|
$i++;
|
||||||
|
}
|
||||||
|
print "</table>";
|
||||||
|
print "</form>\n";
|
||||||
|
$db->free($result);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
dol_print_error($db);
|
||||||
|
}
|
||||||
|
|
||||||
|
llxFooter();
|
||||||
|
|
||||||
|
$db->close();
|
||||||
@ -31,6 +31,7 @@
|
|||||||
--
|
--
|
||||||
|
|
||||||
delete from llx_c_typent;
|
delete from llx_c_typent;
|
||||||
|
-- Entries for all countries
|
||||||
insert into llx_c_typent (id,code,libelle,fk_country,active) values ( 0, 'TE_UNKNOWN', '-', NULL, 1);
|
insert into llx_c_typent (id,code,libelle,fk_country,active) values ( 0, 'TE_UNKNOWN', '-', NULL, 1);
|
||||||
insert into llx_c_typent (id,code,libelle,fk_country,active) values ( 1, 'TE_STARTUP', 'Start-up', NULL, 0);
|
insert into llx_c_typent (id,code,libelle,fk_country,active) values ( 1, 'TE_STARTUP', 'Start-up', NULL, 0);
|
||||||
insert into llx_c_typent (id,code,libelle,fk_country,active) values ( 2, 'TE_GROUP', 'Grand groupe', NULL, 1);
|
insert into llx_c_typent (id,code,libelle,fk_country,active) values ( 2, 'TE_GROUP', 'Grand groupe', NULL, 1);
|
||||||
@ -41,6 +42,7 @@ insert into llx_c_typent (id,code,libelle,fk_country,active) values ( 6, 'TE_WH
|
|||||||
insert into llx_c_typent (id,code,libelle,fk_country,active) values ( 7, 'TE_RETAIL', 'Revendeur', NULL, 0);
|
insert into llx_c_typent (id,code,libelle,fk_country,active) values ( 7, 'TE_RETAIL', 'Revendeur', NULL, 0);
|
||||||
insert into llx_c_typent (id,code,libelle,fk_country,active) values ( 8, 'TE_PRIVATE', 'Particulier', NULL, 1);
|
insert into llx_c_typent (id,code,libelle,fk_country,active) values ( 8, 'TE_PRIVATE', 'Particulier', NULL, 1);
|
||||||
insert into llx_c_typent (id,code,libelle,fk_country,active) values (100, 'TE_OTHER', 'Autres', NULL, 1);
|
insert into llx_c_typent (id,code,libelle,fk_country,active) values (100, 'TE_OTHER', 'Autres', NULL, 1);
|
||||||
|
-- Argentina (country 23)
|
||||||
insert into llx_c_typent (id,code,libelle,fk_country,active) values (231, 'TE_A_RI', 'Responsable Inscripto', 23, 0);
|
insert into llx_c_typent (id,code,libelle,fk_country,active) values (231, 'TE_A_RI', 'Responsable Inscripto', 23, 0);
|
||||||
insert into llx_c_typent (id,code,libelle,fk_country,active) values (232, 'TE_B_RNI', 'Responsable No Inscripto', 23, 0);
|
insert into llx_c_typent (id,code,libelle,fk_country,active) values (232, 'TE_B_RNI', 'Responsable No Inscripto', 23, 0);
|
||||||
insert into llx_c_typent (id,code,libelle,fk_country,active) values (233, 'TE_C_FE', 'Consumidor Final/Exento', 23, 0);
|
insert into llx_c_typent (id,code,libelle,fk_country,active) values (233, 'TE_C_FE', 'Consumidor Final/Exento', 23, 0);
|
||||||
|
|||||||
@ -106,7 +106,152 @@ ALTER TABLE llx_product ADD COLUMN onportal tinyint DEFAULT 0 after tobuy;
|
|||||||
ALTER TABLE llx_user ADD COLUMN employee tinyint DEFAULT 1;
|
ALTER TABLE llx_user ADD COLUMN employee tinyint DEFAULT 1;
|
||||||
|
|
||||||
|
|
||||||
|
create table llx_stock_lotserial
|
||||||
|
(
|
||||||
|
rowid integer AUTO_INCREMENT PRIMARY KEY,
|
||||||
|
datec datetime,
|
||||||
|
tms timestamp,
|
||||||
|
fk_user_creat integer,
|
||||||
|
fk_user_modif integer,
|
||||||
|
fk_product integer NOT NULL, -- Id of product
|
||||||
|
batch varchar(30) DEFAULT NULL, -- Lot or serial number
|
||||||
|
eatby date DEFAULT NULL, -- Eatby date
|
||||||
|
sellby date DEFAULT NULL -- Sellby date
|
||||||
|
) ENGINE=innodb;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
CREATE TABLE IF NOT EXISTS llx_c_hrm_function
|
||||||
|
(
|
||||||
|
rowid integer PRIMARY KEY,
|
||||||
|
pos tinyint DEFAULT 0 NOT NULL,
|
||||||
|
code varchar(16) NOT NULL,
|
||||||
|
label varchar(50),
|
||||||
|
c_level tinyint DEFAULT 0 NOT NULL,
|
||||||
|
active tinyint DEFAULT 1 NOT NULL
|
||||||
|
)ENGINE=innodb;
|
||||||
|
|
||||||
|
INSERT INTO llx_c_hrm_function (rowid, pos, code, label, c_level, active) VALUES(1, 5, 'EXECBOARD', 'Executive board', 0, 1);
|
||||||
|
INSERT INTO llx_c_hrm_function (rowid, pos, code, label, c_level, active) VALUES(2, 10, 'MANAGDIR', 'Managing director', 1, 1);
|
||||||
|
INSERT INTO llx_c_hrm_function (rowid, pos, code, label, c_level, active) VALUES(3, 15, 'ACCOUNTMANAG', 'Account manager', 0, 1);
|
||||||
|
INSERT INTO llx_c_hrm_function (rowid, pos, code, label, c_level, active) VALUES(3, 20, 'ENGAGDIR', 'Engagement director', 1, 1);
|
||||||
|
INSERT INTO llx_c_hrm_function (rowid, pos, code, label, c_level, active) VALUES(4, 25, 'DIRECTOR', 'Director', 1, 1);
|
||||||
|
INSERT INTO llx_c_hrm_function (rowid, pos, code, label, c_level, active) VALUES(5, 30, 'PROJMANAG', 'Project manager', 0, 1);
|
||||||
|
INSERT INTO llx_c_hrm_function (rowid, pos, code, label, c_level, active) VALUES(6, 35, 'DEPHEAD', 'Department head', 0, 1);
|
||||||
|
INSERT INTO llx_c_hrm_function (rowid, pos, code, label, c_level, active) VALUES(7, 40, 'SECRETAR', 'Secretary', 0, 1);
|
||||||
|
INSERT INTO llx_c_hrm_function (rowid, pos, code, label, c_level, active) VALUES(8, 45, 'EMPLOYEE', 'Department employee', 0, 1);
|
||||||
|
|
||||||
|
CREATE TABLE IF NOT EXISTS llx_c_hrm_department
|
||||||
|
(
|
||||||
|
rowid integer PRIMARY KEY,
|
||||||
|
pos tinyint DEFAULT 0 NOT NULL,
|
||||||
|
code varchar(16) NOT NULL,
|
||||||
|
label varchar(50),
|
||||||
|
active tinyint DEFAULT 1 NOT NULL
|
||||||
|
)ENGINE=innodb;
|
||||||
|
|
||||||
|
INSERT INTO llx_c_hrm_department (rowid, pos, code, label, active) VALUES(1, 5,'MANAGEMENT', 'Management', 1);
|
||||||
|
INSERT INTO llx_c_hrm_department (rowid, pos, code, label, active) VALUES(2, 10,'GESTION', 'Gestion', 1);
|
||||||
|
INSERT INTO llx_c_hrm_department (rowid, pos, code, label, active) VALUES(3, 15,'TRAINING', 'Training', 1);
|
||||||
|
INSERT INTO llx_c_hrm_department (rowid, pos, code, label, active) VALUES(4, 20,'IT', 'Inform. Technology (IT)', 1);
|
||||||
|
INSERT INTO llx_c_hrm_department (rowid, pos, code, label, active) VALUES(5, 25,'MARKETING', 'Marketing', 1);
|
||||||
|
INSERT INTO llx_c_hrm_department (rowid, pos, code, label, active) VALUES(6, 30,'SALES', 'Sales', 1);
|
||||||
|
INSERT INTO llx_c_hrm_department (rowid, pos, code, label, active) VALUES(7, 35,'LEGAL', 'Legal', 1);
|
||||||
|
INSERT INTO llx_c_hrm_department (rowid, pos, code, label, active) VALUES(8, 40,'FINANCIAL', 'Financial accounting', 1);
|
||||||
|
INSERT INTO llx_c_hrm_department (rowid, pos, code, label, active) VALUES(9, 45,'HUMANRES', 'Human resources', 1);
|
||||||
|
INSERT INTO llx_c_hrm_department (rowid, pos, code, label, active) VALUES(10, 50,'PURCHASING', 'Purchasing', 1);
|
||||||
|
INSERT INTO llx_c_hrm_department (rowid, pos, code, label, active) VALUES(11, 55,'SERVICES', 'Services', 1);
|
||||||
|
INSERT INTO llx_c_hrm_department (rowid, pos, code, label, active) VALUES(12, 60,'CUSTOMSERV', 'Customer service', 1);
|
||||||
|
INSERT INTO llx_c_hrm_department (rowid, pos, code, label, active) VALUES(13, 65,'CONSULTING', 'Consulting', 1);
|
||||||
|
INSERT INTO llx_c_hrm_department (rowid, pos, code, label, active) VALUES(14, 70,'LOGISTIC', 'Logistics', 1);
|
||||||
|
INSERT INTO llx_c_hrm_department (rowid, pos, code, label, active) VALUES(15, 75,'CONSTRUCT', 'Engineering/design', 1);
|
||||||
|
INSERT INTO llx_c_hrm_department (rowid, pos, code, label, active) VALUES(16, 80,'PRODUCTION', 'Manufacturing', 1);
|
||||||
|
INSERT INTO llx_c_hrm_department (rowid, pos, code, label, active) VALUES(17, 85,'QUALITY', 'Quality assurance', 1);
|
||||||
|
INSERT INTO llx_c_hrm_department (rowid, pos, code, label, active) VALUES(18, 85,'MAINT', 'Plant assurance', 1);
|
||||||
|
|
||||||
|
CREATE TABLE IF NOT EXISTS llx_establishment (
|
||||||
|
rowid integer NOT NULL auto_increment PRIMARY KEY,
|
||||||
|
entity integer NOT NULL DEFAULT 1,
|
||||||
|
name varchar(50),
|
||||||
|
address varchar(255),
|
||||||
|
zip varchar(25),
|
||||||
|
town varchar(50),
|
||||||
|
fk_state integer DEFAULT 0,
|
||||||
|
fk_country integer DEFAULT 0,
|
||||||
|
profid1 varchar(20),
|
||||||
|
profid2 varchar(20),
|
||||||
|
profid3 varchar(20),
|
||||||
|
phone varchar(20),
|
||||||
|
fk_user_author integer NOT NULL,
|
||||||
|
fk_user_mod integer NOT NULL,
|
||||||
|
datec datetime NOT NULL,
|
||||||
|
tms timestamp NOT NULL,
|
||||||
|
status tinyint DEFAULT 1
|
||||||
|
) ENGINE=InnoDB;
|
||||||
|
|
||||||
|
|
||||||
ALTER TABLE llx_projet_task_time ADD COLUMN invoice_id integer DEFAULT NULL;
|
ALTER TABLE llx_projet_task_time ADD COLUMN invoice_id integer DEFAULT NULL;
|
||||||
ALTER TABLE llx_projet_task_time ADD COLUMN invoice_line_id integer DEFAULT NULL;
|
ALTER TABLE llx_projet_task_time ADD COLUMN invoice_line_id integer DEFAULT NULL;
|
||||||
|
|
||||||
|
|
||||||
|
create table llx_stock_lotserial
|
||||||
|
(
|
||||||
|
rowid integer AUTO_INCREMENT PRIMARY KEY,
|
||||||
|
entity integer,
|
||||||
|
fk_product integer NOT NULL, -- Id of product
|
||||||
|
batch varchar(30) DEFAULT NULL, -- Lot or serial number
|
||||||
|
eatby date DEFAULT NULL, -- Eatby date
|
||||||
|
sellby date DEFAULT NULL, -- Sellby date
|
||||||
|
datec datetime,
|
||||||
|
tms timestamp,
|
||||||
|
fk_user_creat integer,
|
||||||
|
fk_user_modif integer,
|
||||||
|
import_key integer
|
||||||
|
) ENGINE=innodb;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
create table llx_budget
|
||||||
|
(
|
||||||
|
rowid integer AUTO_INCREMENT PRIMARY KEY,
|
||||||
|
entity integer NOT NULL DEFAULT 1,
|
||||||
|
label varchar(255) NOT NULL,
|
||||||
|
status integer,
|
||||||
|
note text,
|
||||||
|
date_start date,
|
||||||
|
date_end date,
|
||||||
|
datec datetime,
|
||||||
|
tms timestamp,
|
||||||
|
fk_user_creat integer,
|
||||||
|
fk_user_modif integer,
|
||||||
|
import_key integer
|
||||||
|
)ENGINE=innodb;
|
||||||
|
|
||||||
|
|
||||||
|
create table llx_budget_lines
|
||||||
|
(
|
||||||
|
rowid integer AUTO_INCREMENT PRIMARY KEY,
|
||||||
|
fk_budget integer NOT NULL,
|
||||||
|
fk_project integer NOT NULL,
|
||||||
|
amount double(24,8) NOT NULL,
|
||||||
|
datec datetime,
|
||||||
|
tms timestamp,
|
||||||
|
fk_user_creat integer,
|
||||||
|
fk_user_modif integer,
|
||||||
|
import_key integer
|
||||||
|
)ENGINE=innodb;
|
||||||
|
|
||||||
|
ALTER TABLE llx_budget_lines ADD UNIQUE INDEX uk_budget_lines (fk_budget, fk_project);
|
||||||
|
|
||||||
|
-- Supprime orphelins pour permettre montee de la cle
|
||||||
|
-- MYSQL V4 DELETE llx_budget_lines FROM llx_budget_lines LEFT JOIN llx_budget ON llx_budget.rowid = llx_budget_lines.fk_budget WHERE llx_budget_lines.rowid IS NULL;
|
||||||
|
-- POSTGRESQL V8 DELETE FROM llx_budget_lines USING llx_budget WHERE llx_budget_lines.fk_budget NOT IN (SELECT llx_budget.rowid FROM llx_budget);
|
||||||
|
|
||||||
|
ALTER TABLE llx_budget_lines ADD INDEX idx_budget_lines (fk_projet);
|
||||||
|
ALTER TABLE llx_budget_lines ADD CONSTRAINT fk_budget_lines_budget FOREIGN KEY (fk_budget) REFERENCES llx_budget (rowid);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
ALTER TABLE llx_c_typent ADD COLUMN position integer NOT NULL DEFAULT 0;
|
||||||
|
ALTER TABLE llx_c_forme_juridique ADD COLUMN position integer NOT NULL DEFAULT 0;
|
||||||
|
ALTER TABLE llx_c_type_fees ADD COLUMN position integer NOT NULL DEFAULT 0;
|
||||||
|
|||||||
@ -1,88 +0,0 @@
|
|||||||
--
|
|
||||||
-- Be carefull to requests order.
|
|
||||||
-- This file must be loaded by calling /install/index.php page
|
|
||||||
-- when current version is 3.9.0 or higher.
|
|
||||||
--
|
|
||||||
-- To rename a table: ALTER TABLE llx_table RENAME TO llx_table_new;
|
|
||||||
-- To add a column: ALTER TABLE llx_table ADD COLUMN newcol varchar(60) NOT NULL DEFAULT '0' AFTER existingcol;
|
|
||||||
-- To rename a column: ALTER TABLE llx_table CHANGE COLUMN oldname newname varchar(60);
|
|
||||||
-- To drop a column: ALTER TABLE llx_table DROP COLUMN oldname;
|
|
||||||
-- To change type of field: ALTER TABLE llx_table MODIFY COLUMN name varchar(60);
|
|
||||||
-- To drop a foreign key: ALTER TABLE llx_table DROP FOREIGN KEY fk_name;
|
|
||||||
-- To restrict request to Mysql version x.y use -- VMYSQLx.y
|
|
||||||
-- To restrict request to Pgsql version x.y use -- VPGSQLx.y
|
|
||||||
-- To make pk to be auto increment (mysql): VMYSQL4.3 ALTER TABLE llx_c_shipment_mode CHANGE COLUMN rowid rowid INTEGER NOT NULL AUTO_INCREMENT;
|
|
||||||
-- To make pk to be auto increment (postgres): VPGSQL8.2 NOT POSSIBLE. MUST DELETE/CREATE TABLE
|
|
||||||
-- To set a field as NULL: VPGSQL8.2 ALTER TABLE llx_table ALTER COLUMN name DROP NOT NULL;
|
|
||||||
-- To set a field as default NULL: VPGSQL8.2 ALTER TABLE llx_table ALTER COLUMN name SET DEFAULT NULL;
|
|
||||||
-- -- VPGSQL8.2 DELETE FROM llx_usergroup_user WHERE fk_user NOT IN (SELECT rowid from llx_user);
|
|
||||||
-- -- VMYSQL4.1 DELETE FROM llx_usergroup_user WHERE fk_usergroup NOT IN (SELECT rowid from llx_usergroup);
|
|
||||||
|
|
||||||
CREATE TABLE IF NOT EXISTS llx_c_hrm_function
|
|
||||||
(
|
|
||||||
rowid integer PRIMARY KEY,
|
|
||||||
pos tinyint DEFAULT 0 NOT NULL,
|
|
||||||
code varchar(16) NOT NULL,
|
|
||||||
label varchar(50),
|
|
||||||
c_level tinyint DEFAULT 0 NOT NULL,
|
|
||||||
active tinyint DEFAULT 1 NOT NULL
|
|
||||||
)ENGINE=innodb;
|
|
||||||
|
|
||||||
INSERT INTO llx_c_hrm_function (rowid, pos, code, label, c_level, active) VALUES(1, 5,'EXECBOARD', 'Executive board', 0, 1);
|
|
||||||
INSERT INTO llx_c_hrm_function (rowid, pos, code, label, c_level, active) VALUES(2, 10, 'MANAGDIR', 'Managing director', 1, 1);
|
|
||||||
INSERT INTO llx_c_hrm_function (rowid, pos, code, label, c_level, active) VALUES(3, 15, 'ACCOUNTMANAG', 'Account manager', 0, 1);
|
|
||||||
INSERT INTO llx_c_hrm_function (rowid, pos, code, label, c_level, active) VALUES(3, 20, 'ENGAGDIR', 'Engagement director', 1, 1);
|
|
||||||
INSERT INTO llx_c_hrm_function (rowid, pos, code, label, c_level, active) VALUES(4, 25, 'DIRECTOR', 'Director', 1, 1);
|
|
||||||
INSERT INTO llx_c_hrm_function (rowid, pos, code, label, c_level, active) VALUES(5, 30, 'PROJMANAG', 'Project manager', 0, 1);
|
|
||||||
INSERT INTO llx_c_hrm_function (rowid, pos, code, label, c_level, active) VALUES(6, 35, 'DEPHEAD', 'Department head', 0, 1);
|
|
||||||
INSERT INTO llx_c_hrm_function (rowid, pos, code, label, c_level, active) VALUES(7, 40, 'SECRETAR', 'Secretary', 0, 1);
|
|
||||||
INSERT INTO llx_c_hrm_function (rowid, pos, code, label, c_level, active) VALUES(8, 45, 'EMPLOYEE', 'Department employee', 0, 1);
|
|
||||||
|
|
||||||
CREATE TABLE IF NOT EXISTS llx_c_hrm_department
|
|
||||||
(
|
|
||||||
rowid integer PRIMARY KEY,
|
|
||||||
pos tinyint DEFAULT 0 NOT NULL,
|
|
||||||
code varchar(16) NOT NULL,
|
|
||||||
label varchar(50),
|
|
||||||
active tinyint DEFAULT 1 NOT NULL
|
|
||||||
)ENGINE=innodb;
|
|
||||||
|
|
||||||
INSERT INTO llx_c_hrm_department (rowid, pos, code, label, active) VALUES(1, 5,'MANAGEMENT', 'Management', 1);
|
|
||||||
INSERT INTO llx_c_hrm_department (rowid, pos, code, label, active) VALUES(2, 10,'GESTION', 'Gestion', 1);
|
|
||||||
INSERT INTO llx_c_hrm_department (rowid, pos, code, label, active) VALUES(3, 15,'TRAINING', 'Training', 1);
|
|
||||||
INSERT INTO llx_c_hrm_department (rowid, pos, code, label, active) VALUES(4, 20,'IT', 'Inform. Technology (IT)', 1);
|
|
||||||
INSERT INTO llx_c_hrm_department (rowid, pos, code, label, active) VALUES(5, 25,'MARKETING', 'Marketing', 1);
|
|
||||||
INSERT INTO llx_c_hrm_department (rowid, pos, code, label, active) VALUES(6, 30,'SALES', 'Sales', 1);
|
|
||||||
INSERT INTO llx_c_hrm_department (rowid, pos, code, label, active) VALUES(7, 35,'LEGAL', 'Legal', 1);
|
|
||||||
INSERT INTO llx_c_hrm_department (rowid, pos, code, label, active) VALUES(8, 40,'FINANCIAL', 'Financial accounting', 1);
|
|
||||||
INSERT INTO llx_c_hrm_department (rowid, pos, code, label, active) VALUES(9, 45,'HUMANRES', 'Human resources', 1);
|
|
||||||
INSERT INTO llx_c_hrm_department (rowid, pos, code, label, active) VALUES(10, 50,'PURCHASING', 'Purchasing', 1);
|
|
||||||
INSERT INTO llx_c_hrm_department (rowid, pos, code, label, active) VALUES(11, 55,'SERVICES', 'Services', 1);
|
|
||||||
INSERT INTO llx_c_hrm_department (rowid, pos, code, label, active) VALUES(12, 60,'CUSTOMSERV', 'Customer service', 1);
|
|
||||||
INSERT INTO llx_c_hrm_department (rowid, pos, code, label, active) VALUES(13, 65,'CONSULTING', 'Consulting', 1);
|
|
||||||
INSERT INTO llx_c_hrm_department (rowid, pos, code, label, active) VALUES(14, 70,'LOGISTIC', 'Logistics', 1);
|
|
||||||
INSERT INTO llx_c_hrm_department (rowid, pos, code, label, active) VALUES(15, 75,'CONSTRUCT', 'Engineering/design', 1);
|
|
||||||
INSERT INTO llx_c_hrm_department (rowid, pos, code, label, active) VALUES(16, 80,'PRODUCTION', 'Manufacturing', 1);
|
|
||||||
INSERT INTO llx_c_hrm_department (rowid, pos, code, label, active) VALUES(17, 85,'QUALITY', 'Quality assurance', 1);
|
|
||||||
INSERT INTO llx_c_hrm_department (rowid, pos, code, label, active) VALUES(18, 85,'MAINT', 'Plant assurance', 1);
|
|
||||||
|
|
||||||
CREATE TABLE IF NOT EXISTS llx_establishment (
|
|
||||||
rowid integer NOT NULL auto_increment PRIMARY KEY,
|
|
||||||
entity integer NOT NULL DEFAULT 1,
|
|
||||||
name varchar(50),
|
|
||||||
address varchar(255),
|
|
||||||
zip varchar(25),
|
|
||||||
town varchar(50),
|
|
||||||
fk_state integer DEFAULT 0,
|
|
||||||
fk_country integer DEFAULT 0,
|
|
||||||
profid1 varchar(20),
|
|
||||||
profid2 varchar(20),
|
|
||||||
profid3 varchar(20),
|
|
||||||
phone varchar(20),
|
|
||||||
fk_user_author integer NOT NULL,
|
|
||||||
fk_user_mod integer NOT NULL,
|
|
||||||
datec datetime NOT NULL,
|
|
||||||
tms timestamp NOT NULL,
|
|
||||||
status tinyint DEFAULT 1
|
|
||||||
) ENGINE=InnoDB;
|
|
||||||
|
|
||||||
33
htdocs/install/mysql/tables/llx_budget.sql
Normal file
33
htdocs/install/mysql/tables/llx_budget.sql
Normal file
@ -0,0 +1,33 @@
|
|||||||
|
-- ============================================================================
|
||||||
|
-- Copyright (C) 2015 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
|
--
|
||||||
|
-- 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
|
||||||
|
-- the Free Software Foundation; either version 3 of the License, or
|
||||||
|
-- (at your option) any later version.
|
||||||
|
--
|
||||||
|
-- This program is distributed in the hope that it will be useful,
|
||||||
|
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
-- GNU General Public License for more details.
|
||||||
|
--
|
||||||
|
-- You should have received a copy of the GNU General Public License
|
||||||
|
-- along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
--
|
||||||
|
-- ===========================================================================
|
||||||
|
|
||||||
|
create table llx_budget
|
||||||
|
(
|
||||||
|
rowid integer AUTO_INCREMENT PRIMARY KEY,
|
||||||
|
entity integer NOT NULL DEFAULT 1,
|
||||||
|
label varchar(255) NOT NULL,
|
||||||
|
status integer,
|
||||||
|
note text,
|
||||||
|
date_start date,
|
||||||
|
date_end date,
|
||||||
|
datec datetime,
|
||||||
|
tms timestamp,
|
||||||
|
fk_user_creat integer,
|
||||||
|
fk_user_modif integer,
|
||||||
|
import_key integer
|
||||||
|
)ENGINE=innodb;
|
||||||
27
htdocs/install/mysql/tables/llx_budget_lines.key.sql
Normal file
27
htdocs/install/mysql/tables/llx_budget_lines.key.sql
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
-- ===================================================================
|
||||||
|
-- Copyright (C) 2015 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
|
--
|
||||||
|
-- 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
|
||||||
|
-- the Free Software Foundation; either version 3 of the License, or
|
||||||
|
-- (at your option) any later version.
|
||||||
|
--
|
||||||
|
-- This program is distributed in the hope that it will be useful,
|
||||||
|
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
-- GNU General Public License for more details.
|
||||||
|
--
|
||||||
|
-- You should have received a copy of the GNU General Public License
|
||||||
|
-- along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
--
|
||||||
|
-- ===================================================================
|
||||||
|
|
||||||
|
|
||||||
|
ALTER TABLE llx_budget_lines ADD UNIQUE INDEX uk_budget_lines (fk_budget, fk_project);
|
||||||
|
|
||||||
|
-- Supprime orphelins pour permettre montee de la cle
|
||||||
|
-- MYSQL V4 DELETE llx_budget_lines FROM llx_budget_lines LEFT JOIN llx_budget ON llx_budget.rowid = llx_budget_lines.fk_budget WHERE llx_budget_lines.rowid IS NULL;
|
||||||
|
-- POSTGRESQL V8 DELETE FROM llx_budget_lines USING llx_budget WHERE llx_budget_lines.fk_budget NOT IN (SELECT llx_budget.rowid FROM llx_budget);
|
||||||
|
|
||||||
|
ALTER TABLE llx_budget_lines ADD INDEX idx_budget_lines (fk_project);
|
||||||
|
ALTER TABLE llx_budget_lines ADD CONSTRAINT fk_budget_lines_budget FOREIGN KEY (fk_budget) REFERENCES llx_budget (rowid);
|
||||||
30
htdocs/install/mysql/tables/llx_budget_lines.sql
Normal file
30
htdocs/install/mysql/tables/llx_budget_lines.sql
Normal file
@ -0,0 +1,30 @@
|
|||||||
|
-- ============================================================================
|
||||||
|
-- Copyright (C) 2015 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
|
--
|
||||||
|
-- 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
|
||||||
|
-- the Free Software Foundation; either version 3 of the License, or
|
||||||
|
-- (at your option) any later version.
|
||||||
|
--
|
||||||
|
-- This program is distributed in the hope that it will be useful,
|
||||||
|
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
-- GNU General Public License for more details.
|
||||||
|
--
|
||||||
|
-- You should have received a copy of the GNU General Public License
|
||||||
|
-- along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
--
|
||||||
|
-- ===========================================================================
|
||||||
|
|
||||||
|
create table llx_budget_lines
|
||||||
|
(
|
||||||
|
rowid integer AUTO_INCREMENT PRIMARY KEY,
|
||||||
|
fk_budget integer NOT NULL,
|
||||||
|
fk_project integer NOT NULL,
|
||||||
|
amount double(24,8) NOT NULL,
|
||||||
|
datec datetime,
|
||||||
|
tms timestamp,
|
||||||
|
fk_user_creat integer,
|
||||||
|
fk_user_modif integer,
|
||||||
|
import_key integer
|
||||||
|
)ENGINE=innodb;
|
||||||
@ -25,6 +25,7 @@ create table llx_c_forme_juridique
|
|||||||
libelle varchar(255),
|
libelle varchar(255),
|
||||||
isvatexempted tinyint DEFAULT 0 NOT NULL,
|
isvatexempted tinyint DEFAULT 0 NOT NULL,
|
||||||
active tinyint DEFAULT 1 NOT NULL,
|
active tinyint DEFAULT 1 NOT NULL,
|
||||||
module varchar(32) NULL
|
module varchar(32) NULL,
|
||||||
|
position integer NOT NULL DEFAULT 0
|
||||||
)ENGINE=innodb;
|
)ENGINE=innodb;
|
||||||
|
|
||||||
|
|||||||
@ -25,5 +25,6 @@ create table llx_c_type_fees
|
|||||||
label varchar(30),
|
label varchar(30),
|
||||||
accountancy_code varchar(32) NULL,
|
accountancy_code varchar(32) NULL,
|
||||||
active tinyint DEFAULT 1 NOT NULL,
|
active tinyint DEFAULT 1 NOT NULL,
|
||||||
module varchar(32) NULL
|
module varchar(32) NULL,
|
||||||
|
position integer NOT NULL DEFAULT 0
|
||||||
)ENGINE=innodb;
|
)ENGINE=innodb;
|
||||||
|
|||||||
@ -24,5 +24,6 @@ create table llx_c_typent
|
|||||||
libelle varchar(30),
|
libelle varchar(30),
|
||||||
fk_country integer NULL, -- Defined only to have specific list for countries that can't use generic list (like argentina that need type A or B)
|
fk_country integer NULL, -- Defined only to have specific list for countries that can't use generic list (like argentina that need type A or B)
|
||||||
active tinyint DEFAULT 1 NOT NULL,
|
active tinyint DEFAULT 1 NOT NULL,
|
||||||
module varchar(32) NULL
|
module varchar(32) NULL,
|
||||||
|
position integer NOT NULL DEFAULT 0
|
||||||
)ENGINE=innodb;
|
)ENGINE=innodb;
|
||||||
|
|||||||
34
htdocs/install/mysql/tables/llx_stock_lotserial.sql
Normal file
34
htdocs/install/mysql/tables/llx_stock_lotserial.sql
Normal file
@ -0,0 +1,34 @@
|
|||||||
|
-- ============================================================================
|
||||||
|
-- Copyright (C) 2015 Laurent Destailleur <eldy@users.sourceofrge.net>
|
||||||
|
--
|
||||||
|
-- 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
|
||||||
|
-- the Free Software Foundation; either version 3 of the License, or
|
||||||
|
-- (at your option) any later version.
|
||||||
|
--
|
||||||
|
-- This program is distributed in the hope that it will be useful,
|
||||||
|
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
-- GNU General Public License for more details.
|
||||||
|
--
|
||||||
|
-- You should have received a copy of the GNU General Public License
|
||||||
|
-- along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
--
|
||||||
|
-- This table may be used to store eatby and sellby date for a couple
|
||||||
|
-- product-batch number.
|
||||||
|
-- ============================================================================
|
||||||
|
|
||||||
|
create table llx_stock_lotserial
|
||||||
|
(
|
||||||
|
rowid integer AUTO_INCREMENT PRIMARY KEY,
|
||||||
|
entity integer,
|
||||||
|
fk_product integer NOT NULL, -- Id of product
|
||||||
|
batch varchar(30) DEFAULT NULL, -- Lot or serial number
|
||||||
|
eatby date DEFAULT NULL, -- Eatby date
|
||||||
|
sellby date DEFAULT NULL, -- Sellby date
|
||||||
|
datec datetime,
|
||||||
|
tms timestamp,
|
||||||
|
fk_user_creat integer,
|
||||||
|
fk_user_modif integer,
|
||||||
|
import_key integer
|
||||||
|
) ENGINE=innodb;
|
||||||
@ -1126,6 +1126,8 @@ EncryptedPasswordInDatabase=To allow the encryption of the passwords in the data
|
|||||||
DisableForgetPasswordLinkOnLogonPage=Do not show the link "Forget password" on login page
|
DisableForgetPasswordLinkOnLogonPage=Do not show the link "Forget password" on login page
|
||||||
UsersSetup=Users module setup
|
UsersSetup=Users module setup
|
||||||
UserMailRequired=EMail required to create a new user
|
UserMailRequired=EMail required to create a new user
|
||||||
|
##### HRM setup #####
|
||||||
|
HRMSetup=HRM module setup
|
||||||
##### Company setup #####
|
##### Company setup #####
|
||||||
CompanySetup=Companies module setup
|
CompanySetup=Companies module setup
|
||||||
CompanyCodeChecker=Module for third parties code generation and checking (customer or supplier)
|
CompanyCodeChecker=Module for third parties code generation and checking (customer or supplier)
|
||||||
@ -1530,6 +1532,7 @@ DeleteMenu=Delete menu entry
|
|||||||
ConfirmDeleteMenu=Are you sure you want to delete menu entry <b>%s</b> ?
|
ConfirmDeleteMenu=Are you sure you want to delete menu entry <b>%s</b> ?
|
||||||
DeleteLine=Delete line
|
DeleteLine=Delete line
|
||||||
ConfirmDeleteLine=Are you sure you want to delete this line ?
|
ConfirmDeleteLine=Are you sure you want to delete this line ?
|
||||||
|
FailedToInitializeMenu=Failed to initialize menu
|
||||||
##### Tax #####
|
##### Tax #####
|
||||||
TaxSetup=Taxes, social or fiscal taxes and dividends module setup
|
TaxSetup=Taxes, social or fiscal taxes and dividends module setup
|
||||||
OptionVatMode=VAT due
|
OptionVatMode=VAT due
|
||||||
|
|||||||
@ -8,6 +8,7 @@ DeleteEstablishment=Delete establishment
|
|||||||
ConfirmDeleteEstablishment=Are-you sure to delete this establishment ?
|
ConfirmDeleteEstablishment=Are-you sure to delete this establishment ?
|
||||||
OpenEtablishment=Open establishment
|
OpenEtablishment=Open establishment
|
||||||
CloseEtablishment=Close establishment
|
CloseEtablishment=Close establishment
|
||||||
|
ListOfEmployees=List of employees
|
||||||
Employees=Employees
|
Employees=Employees
|
||||||
Employee=Employee
|
Employee=Employee
|
||||||
NewEmployee=New employee
|
NewEmployee=New employee
|
||||||
|
|||||||
@ -752,9 +752,17 @@ ShortSaturday=S
|
|||||||
ShortSunday=S
|
ShortSunday=S
|
||||||
SelectMailModel=Select email template
|
SelectMailModel=Select email template
|
||||||
SetRef=Set ref
|
SetRef=Set ref
|
||||||
SearchIntoThirdparties=Search %s into thirdparties
|
SearchIntoThirdparties=Thirdparties
|
||||||
SearchIntoContacts=Search %s into contacts
|
SearchIntoContacts=Contacts
|
||||||
SearchIntoMembers=Search %s into members
|
SearchIntoMembers=Members
|
||||||
SearchIntoUsers=Search %s into users
|
SearchIntoUsers=Users
|
||||||
SearchIntoProductsOrServices=Search %s into products or services
|
SearchIntoProductsOrServices=Products or services
|
||||||
SearchIntoProjects=Search %s into projects
|
SearchIntoProjects=Projects
|
||||||
|
SearchIntoCustomerInvoices=Customer invoices
|
||||||
|
SearchIntoSupplierInvoices=Supplier invoices
|
||||||
|
SearchIntoCustomerOrders=Customer orders
|
||||||
|
SearchIntoSupplierOrders=Supplier orders
|
||||||
|
SearchIntoCustomerProposals=Customer proposals
|
||||||
|
SearchIntoSupplierProposals=Supplier proposals
|
||||||
|
SearchIntoInterventions=Interventions
|
||||||
|
SearchIntoContracts=Contracts
|
||||||
|
|||||||
@ -16,7 +16,7 @@ CancelSending=Cancel sending
|
|||||||
DeleteSending=Delete sending
|
DeleteSending=Delete sending
|
||||||
Stock=Stock
|
Stock=Stock
|
||||||
Stocks=Stocks
|
Stocks=Stocks
|
||||||
StocksByLotSerial=Stock by lot/serial
|
StocksByLotSerial=Stocks by lot/serial
|
||||||
Movement=Movement
|
Movement=Movement
|
||||||
Movements=Movements
|
Movements=Movements
|
||||||
ErrorWarehouseRefRequired=Warehouse reference name is required
|
ErrorWarehouseRefRequired=Warehouse reference name is required
|
||||||
@ -34,9 +34,9 @@ LastMovements=Last movements
|
|||||||
Units=Units
|
Units=Units
|
||||||
Unit=Unit
|
Unit=Unit
|
||||||
StockCorrection=Correct stock
|
StockCorrection=Correct stock
|
||||||
StockTransfer=Stock transfer
|
StockTransfer=Stock movement
|
||||||
StockMovement=Transfer
|
StockMovement=Stock movement
|
||||||
StockMovements=Stock transfers
|
StockMovements=Stock movements
|
||||||
LabelMovement=Movement label
|
LabelMovement=Movement label
|
||||||
NumberOfUnit=Number of units
|
NumberOfUnit=Number of units
|
||||||
UnitPurchaseValue=Unit purchase price
|
UnitPurchaseValue=Unit purchase price
|
||||||
@ -83,8 +83,8 @@ WarehousesAndProductsBatchDetail=Warehouses and products (with detail per lot/se
|
|||||||
AverageUnitPricePMPShort=Weighted average input price
|
AverageUnitPricePMPShort=Weighted average input price
|
||||||
AverageUnitPricePMP=Weighted average input price
|
AverageUnitPricePMP=Weighted average input price
|
||||||
SellPriceMin=Selling Unit Price
|
SellPriceMin=Selling Unit Price
|
||||||
EstimatedStockValueSellShort=Value to sell
|
EstimatedStockValueSellShort=Value for sell
|
||||||
EstimatedStockValueSell=Value to Sell
|
EstimatedStockValueSell=Value for sell
|
||||||
EstimatedStockValueShort=Input stock value
|
EstimatedStockValueShort=Input stock value
|
||||||
EstimatedStockValue=Input stock value
|
EstimatedStockValue=Input stock value
|
||||||
DeleteAWarehouse=Delete a warehouse
|
DeleteAWarehouse=Delete a warehouse
|
||||||
@ -113,7 +113,7 @@ AlertOnly= Alerts only
|
|||||||
WarehouseForStockDecrease=The warehouse <b>%s</b> will be used for stock decrease
|
WarehouseForStockDecrease=The warehouse <b>%s</b> will be used for stock decrease
|
||||||
WarehouseForStockIncrease=The warehouse <b>%s</b> will be used for stock increase
|
WarehouseForStockIncrease=The warehouse <b>%s</b> will be used for stock increase
|
||||||
ForThisWarehouse=For this warehouse
|
ForThisWarehouse=For this warehouse
|
||||||
ReplenishmentStatusDesc=This is a list of all products with a stock lower than desired stock (or lower than alert value if checkbox "alert only" is checked), and suggest you to create supplier orders to fill the difference.
|
ReplenishmentStatusDesc=This is a list of all products with a stock lower than desired stock (or lower than alert value if checkbox "alert only" is checked). Using the checkbox, you can create supplier orders to fill the difference.
|
||||||
ReplenishmentOrdersDesc=This is a list of all opened supplier orders including predefined products. Only opened orders with predefined products, so orders that may affect stocks, are visible here.
|
ReplenishmentOrdersDesc=This is a list of all opened supplier orders including predefined products. Only opened orders with predefined products, so orders that may affect stocks, are visible here.
|
||||||
Replenishments=Replenishments
|
Replenishments=Replenishments
|
||||||
NbOfProductBeforePeriod=Quantity of product %s in stock before selected period (< %s)
|
NbOfProductBeforePeriod=Quantity of product %s in stock before selected period (< %s)
|
||||||
|
|||||||
@ -1543,13 +1543,13 @@ function top_menu($head, $title='', $target='', $disablejs=0, $disablehead=0, $a
|
|||||||
* @param string $helppagename Name of wiki page for help ('' by default).
|
* @param string $helppagename Name of wiki page for help ('' by default).
|
||||||
* Syntax is: For a wiki page: EN:EnglishPage|FR:FrenchPage|ES:SpanishPage
|
* Syntax is: For a wiki page: EN:EnglishPage|FR:FrenchPage|ES:SpanishPage
|
||||||
* For other external page: http://server/url
|
* For other external page: http://server/url
|
||||||
* @param string $moresearchform Search Form Permanent Supplemental
|
* @param string $notused Deprecated. Used in past to add content into left menu. Hooks can be used now.
|
||||||
* @param array $menu_array_after Table of menu entries to show after entries of menu handler
|
* @param array $menu_array_after Table of menu entries to show after entries of menu handler
|
||||||
* @param int $leftmenuwithoutmainarea Must be set to 1. 0 by default for backward compatibility with old modules.
|
* @param int $leftmenuwithoutmainarea Must be set to 1. 0 by default for backward compatibility with old modules.
|
||||||
* @param string $title Title of web page
|
* @param string $title Title of web page
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
function left_menu($menu_array_before, $helppagename='', $moresearchform='', $menu_array_after='', $leftmenuwithoutmainarea=0, $title='')
|
function left_menu($menu_array_before, $helppagename='', $notused='', $menu_array_after='', $leftmenuwithoutmainarea=0, $title='')
|
||||||
{
|
{
|
||||||
global $user, $conf, $langs, $db, $form;
|
global $user, $conf, $langs, $db, $form;
|
||||||
global $hookmanager, $menumanager;
|
global $hookmanager, $menumanager;
|
||||||
@ -1644,13 +1644,8 @@ function left_menu($menu_array_before, $helppagename='', $moresearchform='', $me
|
|||||||
|
|
||||||
print '<div class="vmenu">'."\n\n";
|
print '<div class="vmenu">'."\n\n";
|
||||||
|
|
||||||
$menumanager->menu_array = $menu_array_before;
|
|
||||||
$menumanager->menu_array_after = $menu_array_after;
|
|
||||||
$menumanager->showmenu('left'); // output menu_array and menu found in database
|
|
||||||
|
|
||||||
|
|
||||||
// Show other forms
|
// Show other forms
|
||||||
if ($searchform)
|
/*if ($searchform)
|
||||||
{
|
{
|
||||||
print "\n";
|
print "\n";
|
||||||
print "<!-- Begin SearchForm -->\n";
|
print "<!-- Begin SearchForm -->\n";
|
||||||
@ -1658,15 +1653,14 @@ function left_menu($menu_array_before, $helppagename='', $moresearchform='', $me
|
|||||||
print $searchform;
|
print $searchform;
|
||||||
print '</div>'."\n";
|
print '</div>'."\n";
|
||||||
print "<!-- End SearchForm -->\n";
|
print "<!-- End SearchForm -->\n";
|
||||||
}
|
}*/
|
||||||
|
|
||||||
// More search form
|
$menumanager->menu_array = $menu_array_before;
|
||||||
if ($moresearchform)
|
$menumanager->menu_array_after = $menu_array_after;
|
||||||
{
|
$menumanager->showmenu('left', array('searchform'=>$searchform, 'bookmarks'=>$bookmarks)); // output menu_array and menu found in database
|
||||||
print $moresearchform;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Bookmarks
|
// Bookmarks
|
||||||
|
/*
|
||||||
if ($bookmarks)
|
if ($bookmarks)
|
||||||
{
|
{
|
||||||
print "\n";
|
print "\n";
|
||||||
@ -1675,13 +1669,14 @@ function left_menu($menu_array_before, $helppagename='', $moresearchform='', $me
|
|||||||
print $bookmarks;
|
print $bookmarks;
|
||||||
print '</div>'."\n";
|
print '</div>'."\n";
|
||||||
print "<!-- End Bookmarks -->\n";
|
print "<!-- End Bookmarks -->\n";
|
||||||
}
|
}*/
|
||||||
|
|
||||||
|
// Dolibarr version + help + bug report link
|
||||||
print "\n";
|
print "\n";
|
||||||
print "<!-- Begin Help Block-->\n";
|
print "<!-- Begin Help Block-->\n";
|
||||||
print '<div id="blockvmenuhelp" class="blockvmenuhelp">'."\n";
|
print '<div id="blockvmenuhelp" class="blockvmenuhelp">'."\n";
|
||||||
|
|
||||||
//Dolibarr version
|
// Version
|
||||||
$doliurl='http://www.dolibarr.org';
|
$doliurl='http://www.dolibarr.org';
|
||||||
//local communities
|
//local communities
|
||||||
if (preg_match('/fr/i',$langs->defaultlang)) $doliurl='http://www.dolibarr.fr';
|
if (preg_match('/fr/i',$langs->defaultlang)) $doliurl='http://www.dolibarr.fr';
|
||||||
|
|||||||
@ -2972,7 +2972,7 @@ class Product extends CommonObject
|
|||||||
* Return clicable link of object (with eventually picto)
|
* Return clicable link of object (with eventually picto)
|
||||||
*
|
*
|
||||||
* @param int $withpicto Add picto into link
|
* @param int $withpicto Add picto into link
|
||||||
* @param string $option Where point the link
|
* @param string $option Where point the link ('stock', 'composition', 'category', 'supplier', '')
|
||||||
* @param int $maxlength Maxlength of ref
|
* @param int $maxlength Maxlength of ref
|
||||||
* @return string String with URL
|
* @return string String with URL
|
||||||
*/
|
*/
|
||||||
|
|||||||
@ -56,18 +56,28 @@ $fourn_id = GETPOST("fourn_id",'int');
|
|||||||
$catid = GETPOST('catid','int');
|
$catid = GETPOST('catid','int');
|
||||||
$optioncss = GETPOST('optioncss','alpha');
|
$optioncss = GETPOST('optioncss','alpha');
|
||||||
|
|
||||||
|
$limit = GETPOST("limit")?GETPOST("limit","int"):$conf->liste_limit;
|
||||||
$sortfield = GETPOST("sortfield",'alpha');
|
$sortfield = GETPOST("sortfield",'alpha');
|
||||||
$sortorder = GETPOST("sortorder",'alpha');
|
$sortorder = GETPOST("sortorder",'alpha');
|
||||||
$page = GETPOST("page",'int');
|
$page = GETPOST("page",'int');
|
||||||
if ($page == -1) { $page = 0; }
|
if ($page == -1) { $page = 0; }
|
||||||
$offset = $conf->liste_limit * $page;
|
$offset = $liste_limit * $page;
|
||||||
$pageprev = $page - 1;
|
$pageprev = $page - 1;
|
||||||
$pagenext = $page + 1;
|
$pagenext = $page + 1;
|
||||||
if (! $sortfield) $sortfield="p.ref";
|
if (! $sortfield) $sortfield="p.ref";
|
||||||
if (! $sortorder) $sortorder="ASC";
|
if (! $sortorder) $sortorder="ASC";
|
||||||
|
|
||||||
$limit = $conf->liste_limit;
|
$contextpage='productservicelist';
|
||||||
|
if ($type === '1') { $contextpage='servicelist'; if ($search_type=='') $search_type='1'; }
|
||||||
|
if ($type === '0') { $contextpage='productlist'; if ($search_type=='') $search_type='0'; }
|
||||||
|
|
||||||
|
// Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array
|
||||||
|
$hookmanager->initHooks(array($contextpage));
|
||||||
|
$extrafields = new ExtraFields($db);
|
||||||
|
|
||||||
|
// fetch optionals attributes and labels
|
||||||
|
$extralabels = $extrafields->fetch_name_optionals_label('product');
|
||||||
|
$search_array_options=$extrafields->getOptionalsFromPost($extralabels,'','search_');
|
||||||
|
|
||||||
// Get object canvas (By default, this is not defined, so standard usage of dolibarr)
|
// Get object canvas (By default, this is not defined, so standard usage of dolibarr)
|
||||||
$canvas=GETPOST("canvas");
|
$canvas=GETPOST("canvas");
|
||||||
@ -107,15 +117,18 @@ if (! empty($conf->barcode->enabled)) {
|
|||||||
* Actions
|
* Actions
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
include DOL_DOCUMENT_ROOT.'/core/actions_changeselectedfields.inc.php';
|
||||||
|
|
||||||
if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter.x") || GETPOST("button_removefilter")) // Both test are required to be compatible with all browsers
|
if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter.x") || GETPOST("button_removefilter")) // Both test are required to be compatible with all browsers
|
||||||
{
|
{
|
||||||
$sref="";
|
|
||||||
$sall="";
|
$sall="";
|
||||||
$sbarcode="";
|
$sref="";
|
||||||
$snom="";
|
$snom="";
|
||||||
|
$sbarcode="";
|
||||||
$search_categ=0;
|
$search_categ=0;
|
||||||
$tosell="";
|
$tosell="";
|
||||||
$tobuy="";
|
$tobuy="";
|
||||||
|
$search_array_options=array();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -152,10 +165,17 @@ else
|
|||||||
}
|
}
|
||||||
|
|
||||||
$sql = 'SELECT DISTINCT p.rowid, p.ref, p.label, p.barcode, p.price, p.price_ttc, p.price_base_type,';
|
$sql = 'SELECT DISTINCT p.rowid, p.ref, p.label, p.barcode, p.price, p.price_ttc, p.price_base_type,';
|
||||||
$sql.= ' p.fk_product_type, p.tms as datem,';
|
$sql.= ' p.fk_product_type, p.duration, p.tosell, p.tobuy, p.seuil_stock_alerte, p.desiredstock,';
|
||||||
$sql.= ' p.duration, p.tosell, p.tobuy, p.seuil_stock_alerte, p.desiredstock,';
|
$sql.= ' p.datec as date_creation, p.tms as date_update,';
|
||||||
$sql.= ' MIN(pfp.unitprice) as minsellprice';
|
$sql.= ' MIN(pfp.unitprice) as minsellprice';
|
||||||
|
// Add fields from extrafields
|
||||||
|
foreach ($extrafields->attribute_label as $key => $val) $sql.=",ef.".$key.' as options_'.$key;
|
||||||
|
// Add fields from hooks
|
||||||
|
$parameters=array();
|
||||||
|
$reshook=$hookmanager->executeHooks('printFieldListSelect',$parameters); // Note that $action and $object may have been modified by hook
|
||||||
|
$sql.=$hookmanager->resPrint;
|
||||||
$sql.= ' FROM '.MAIN_DB_PREFIX.'product as p';
|
$sql.= ' FROM '.MAIN_DB_PREFIX.'product as p';
|
||||||
|
if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label)) $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."product_extrafields as ef on (p.rowid = ef.fk_object)";
|
||||||
if (! empty($search_categ) || ! empty($catid)) $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX."categorie_product as cp ON p.rowid = cp.fk_product"; // We'll need this table joined to the select in order to filter by categ
|
if (! empty($search_categ) || ! empty($catid)) $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX."categorie_product as cp ON p.rowid = cp.fk_product"; // We'll need this table joined to the select in order to filter by categ
|
||||||
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."product_fournisseur_price as pfp ON p.rowid = pfp.fk_product";
|
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."product_fournisseur_price as pfp ON p.rowid = pfp.fk_product";
|
||||||
// multilang
|
// multilang
|
||||||
@ -181,11 +201,33 @@ else
|
|||||||
if ($search_categ > 0) $sql.= " AND cp.fk_categorie = ".$db->escape($search_categ);
|
if ($search_categ > 0) $sql.= " AND cp.fk_categorie = ".$db->escape($search_categ);
|
||||||
if ($search_categ == -2) $sql.= " AND cp.fk_categorie IS NULL";
|
if ($search_categ == -2) $sql.= " AND cp.fk_categorie IS NULL";
|
||||||
if ($fourn_id > 0) $sql.= " AND pfp.fk_soc = ".$fourn_id;
|
if ($fourn_id > 0) $sql.= " AND pfp.fk_soc = ".$fourn_id;
|
||||||
|
// Add where from extra fields
|
||||||
|
foreach ($search_array_options as $key => $val)
|
||||||
|
{
|
||||||
|
$crit=$val;
|
||||||
|
$tmpkey=preg_replace('/search_options_/','',$key);
|
||||||
|
$typ=$extrafields->attribute_type[$tmpkey];
|
||||||
|
$mode=0;
|
||||||
|
if (in_array($typ, array('int'))) $mode=1; // Search on a numeric
|
||||||
|
if ($val && ( ($crit != '' && ! in_array($typ, array('select'))) || ! empty($crit)))
|
||||||
|
{
|
||||||
|
$sql .= natural_search('ef.'.$tmpkey, $crit, $mode);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// Add where from hooks
|
||||||
|
$parameters=array();
|
||||||
|
$reshook=$hookmanager->executeHooks('printFieldListWhere',$parameters); // Note that $action and $object may have been modified by hook
|
||||||
|
$sql.=$hookmanager->resPrint;
|
||||||
$sql.= " GROUP BY p.rowid, p.ref, p.label, p.barcode, p.price, p.price_ttc, p.price_base_type,";
|
$sql.= " GROUP BY p.rowid, p.ref, p.label, p.barcode, p.price, p.price_ttc, p.price_base_type,";
|
||||||
$sql.= " p.fk_product_type, p.tms,";
|
$sql.= " p.fk_product_type, p.duration, p.tosell, p.tobuy, p.seuil_stock_alerte, p.desiredstock,";
|
||||||
$sql.= " p.duration, p.tosell, p.tobuy, p.seuil_stock_alerte, p.desiredstock";
|
$sql.= ' p.datec, p.tms';
|
||||||
|
// Add fields from extrafields
|
||||||
|
foreach ($extrafields->attribute_label as $key => $val) $sql.=",ef.".$key;
|
||||||
|
// Add fields from hooks
|
||||||
|
$parameters=array();
|
||||||
|
$reshook=$hookmanager->executeHooks('printFieldSelect',$parameters); // Note that $action and $object may have been modified by hook
|
||||||
|
$sql.=$hookmanager->resPrint;
|
||||||
//if (GETPOST("toolowstock")) $sql.= " HAVING SUM(s.reel) < p.seuil_stock_alerte"; // Not used yet
|
//if (GETPOST("toolowstock")) $sql.= " HAVING SUM(s.reel) < p.seuil_stock_alerte"; // Not used yet
|
||||||
|
|
||||||
$nbtotalofrecords = 0;
|
$nbtotalofrecords = 0;
|
||||||
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
|
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
|
||||||
{
|
{
|
||||||
@ -230,11 +272,23 @@ else
|
|||||||
setEventMessage($langs->trans("ProductDeleted", GETPOST('delprod')));
|
setEventMessage($langs->trans("ProductDeleted", GETPOST('delprod')));
|
||||||
}
|
}
|
||||||
|
|
||||||
$param="&sref=".$sref.($sbarcode?"&sbarcode=".$sbarcode:"")."&snom=".$snom."&sall=".$sall."&tosell=".$tosell."&tobuy=".$tobuy;
|
if ($sref) $param="&sref=".$sref;
|
||||||
$param.=($fourn_id?"&fourn_id=".$fourn_id:"");
|
if ($sbarcode) $param.=($sbarcode?"&sbarcode=".$sbarcode:"");
|
||||||
$param.=($search_categ?"&search_categ=".$search_categ:"");
|
if ($snom) $param.="&snom=".$snom;
|
||||||
$param.=isset($type)?"&type=".$type:"";
|
if ($sall) $param.="&sall=".$sall;
|
||||||
|
if ($tosell != '') $param.="&tosell=".$tosell;
|
||||||
|
if ($tobuy != '') $param.="&tobuy=".$tobuy;
|
||||||
|
if ($fourn_id) $param.=($fourn_id?"&fourn_id=".$fourn_id:"");
|
||||||
|
if ($seach_categ) $param.=($search_categ?"&search_categ=".$search_categ:"");
|
||||||
|
if ($type != '') $param.='&type='.urlencode($type);
|
||||||
if ($optioncss != '') $param.='&optioncss='.$optioncss;
|
if ($optioncss != '') $param.='&optioncss='.$optioncss;
|
||||||
|
// Add $param from extra fields
|
||||||
|
foreach ($search_array_options as $key => $val)
|
||||||
|
{
|
||||||
|
$crit=$val;
|
||||||
|
$tmpkey=preg_replace('/search_options_/','',$key);
|
||||||
|
if ($val != '') $param.='&search_options_'.$tmpkey.'='.urlencode($val);
|
||||||
|
}
|
||||||
|
|
||||||
print_barre_liste($texte, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords,'title_products.png');
|
print_barre_liste($texte, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords,'title_products.png');
|
||||||
|
|
||||||
@ -270,6 +324,7 @@ else
|
|||||||
print '<form action="'.$_SERVER["PHP_SELF"].'" method="post" name="formulaire">';
|
print '<form action="'.$_SERVER["PHP_SELF"].'" method="post" name="formulaire">';
|
||||||
if ($optioncss != '') print '<input type="hidden" name="optioncss" value="'.$optioncss.'">';
|
if ($optioncss != '') print '<input type="hidden" name="optioncss" value="'.$optioncss.'">';
|
||||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||||
|
print '<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
|
||||||
print '<input type="hidden" name="action" value="list">';
|
print '<input type="hidden" name="action" value="list">';
|
||||||
print '<input type="hidden" name="sortfield" value="'.$sortfield.'">';
|
print '<input type="hidden" name="sortfield" value="'.$sortfield.'">';
|
||||||
print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
|
print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
|
||||||
@ -283,13 +338,6 @@ else
|
|||||||
|
|
||||||
// Filter on categories
|
// Filter on categories
|
||||||
$moreforfilter='';
|
$moreforfilter='';
|
||||||
$colspan=6;
|
|
||||||
if (! empty($conf->barcode->enabled)) $colspan++;
|
|
||||||
if (! empty($conf->service->enabled) && $type != 0) $colspan++;
|
|
||||||
if (empty($conf->global->PRODUIT_MULTIPRICES)) $colspan++;
|
|
||||||
if ($user->rights->fournisseur->lire) $colspan++;
|
|
||||||
if (! empty($conf->stock->enabled) && $user->rights->stock->lire && $type != 1) $colspan+=2;
|
|
||||||
|
|
||||||
if (! empty($conf->categorie->enabled))
|
if (! empty($conf->categorie->enabled))
|
||||||
{
|
{
|
||||||
$moreforfilter.='<div class="divsearchfield">';
|
$moreforfilter.='<div class="divsearchfield">';
|
||||||
@ -307,93 +355,162 @@ else
|
|||||||
print '</div>';
|
print '</div>';
|
||||||
}
|
}
|
||||||
|
|
||||||
// Lignes des titres
|
|
||||||
print '<table class="liste '.($moreforfilter?"listwithfilterbefore":"").'">';
|
|
||||||
print '<tr class="liste_titre">';
|
|
||||||
print_liste_field_titre($langs->trans("Ref"), $_SERVER["PHP_SELF"], "p.ref",$param,"","",$sortfield,$sortorder);
|
|
||||||
print_liste_field_titre($langs->trans("Label"), $_SERVER["PHP_SELF"], "p.label",$param,"","",$sortfield,$sortorder);
|
|
||||||
if (! empty($conf->barcode->enabled)) print_liste_field_titre($langs->trans("BarCode"), $_SERVER["PHP_SELF"], "p.barcode",$param,'','',$sortfield,$sortorder);
|
|
||||||
print_liste_field_titre($langs->trans("DateModification"), $_SERVER["PHP_SELF"], "p.tms",$param,"",'align="center"',$sortfield,$sortorder);
|
|
||||||
if (! empty($conf->service->enabled) && $type != 0) print_liste_field_titre($langs->trans("Duration"), $_SERVER["PHP_SELF"], "p.duration",$param,"",'align="center"',$sortfield,$sortorder);
|
|
||||||
if (empty($conf->global->PRODUIT_MULTIPRICES))
|
if (empty($conf->global->PRODUIT_MULTIPRICES))
|
||||||
{
|
{
|
||||||
$titlefield=$langs->trans("SellingPrice");
|
$titlesellprice=$langs->trans("SellingPrice");
|
||||||
if (! empty($conf->global->PRODUIT_CUSTOMER_PRICES))
|
if (! empty($conf->global->PRODUIT_CUSTOMER_PRICES))
|
||||||
{
|
{
|
||||||
$titlefield=$form->textwithpicto($langs->trans("SellingPrice"), $langs->trans("DefaultPriceRealPriceMayDependOnCustomer"));
|
$titlesellprice=$form->textwithpicto($langs->trans("SellingPrice"), $langs->trans("DefaultPriceRealPriceMayDependOnCustomer"));
|
||||||
}
|
}
|
||||||
print_liste_field_titre($titlefield, $_SERVER["PHP_SELF"], "p.price",$param,"",'align="right"',$sortfield,$sortorder);
|
|
||||||
}
|
}
|
||||||
if ($user->rights->fournisseur->lire) print_liste_field_titre($langs->trans("BuyingPriceMinShort"), '', '', '', '', 'align="right"');
|
|
||||||
if (! empty($conf->stock->enabled) && $user->rights->stock->lire && $type != 1) print_liste_field_titre($langs->trans("DesiredStock"), '', '', '', '', 'align="right"');
|
$arrayfields=array(
|
||||||
if (! empty($conf->stock->enabled) && $user->rights->stock->lire && $type != 1) print_liste_field_titre($langs->trans("PhysicalStock"), '', '', '', '', 'align="right"');
|
'p.ref'=>array('label'=>$langs->trans("Ref"), 'checked'=>1),
|
||||||
print_liste_field_titre($langs->trans("Sell"), $_SERVER["PHP_SELF"], "p.tosell",$param,"",'align="center"',$sortfield,$sortorder);
|
'p.label'=>array('label'=>$langs->trans("Label"), 'checked'=>1),
|
||||||
print_liste_field_titre($langs->trans("Buy"), $_SERVER["PHP_SELF"], "p.tobuy",$param,"",'align="center"',$sortfield,$sortorder);
|
'p.barcode'=>array('label'=>$langs->trans("Gencod"), 'checked'=>($contextpage != 'servicelist'), 'enabled'=>(! empty($conf->barcode->enabled))),
|
||||||
print_liste_field_titre('',$_SERVER["PHP_SELF"],"",'','','',$sortfield,$sortorder,'maxwidthsearch ');
|
'p.duration'=>array('label'=>$langs->trans("Duration"), 'checked'=>($contextpage != 'productlist'), 'enabled'=>(! empty($conf->service->enabled))),
|
||||||
|
'p.sellprice'=>array('label'=>$titlesellprice, 'checked'=>1, 'enabled'=>empty($conf->global->PRODUIT_MULTIPRICES)),
|
||||||
|
'p.minbuyprice'=>array('label'=>$langs->trans("BuyingPriceMinShort"), 'checked'=>1, 'enabled'=>(! empty($user->rights->fournisseur->lire))),
|
||||||
|
'p.desiredstock'=>array('label'=>$langs->trans("DesiredStock"), 'checked'=>1, 'enabled'=>(! empty($conf->stock->enabled) && $user->rights->stock->lire && $contextpage != 'service')),
|
||||||
|
'p.stock'=>array('label'=>$langs->trans("PhysicalStock"), 'checked'=>1, 'enabled'=>(! empty($conf->stock->enabled) && $user->rights->stock->lire && $contextpage != 'service')),
|
||||||
|
'p.datec'=>array('label'=>$langs->trans("DateCreation"), 'checked'=>0, 'position'=>500),
|
||||||
|
'p.tms'=>array('label'=>$langs->trans("DateModificationShort"), 'checked'=>0, 'position'=>500),
|
||||||
|
'p.tosell'=>array('label'=>$langs->trans("Status").' ('.$langs->trans("Sell").')', 'checked'=>1, 'position'=>1000),
|
||||||
|
'p.tobuy'=>array('label'=>$langs->trans("Status").' ('.$langs->trans("Purchases").')', 'checked'=>1, 'position'=>1000)
|
||||||
|
);
|
||||||
|
// Extra fields
|
||||||
|
if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label))
|
||||||
|
{
|
||||||
|
foreach($extrafields->attribute_label as $key => $val)
|
||||||
|
{
|
||||||
|
$arrayfields["ef.".$key]=array('label'=>$extrafields->attribute_label[$key], 'checked'=>$extrafields->attribute_list[$key], 'position'=>$extrafields->attribute_pos[$key]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
$varpage=empty($contextpage)?$_SERVER["PHP_SELF"]:$contextpage;
|
||||||
|
$selectedfields=$form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage); // This also change content of $arrayfields
|
||||||
|
print '<table class="liste '.($moreforfilter?"listwithfilterbefore":"").'">';
|
||||||
|
print '<tr class="liste_titre">';
|
||||||
|
if (! empty($arrayfields['p.ref']['checked'])) print_liste_field_titre($arrayfields['p.ref']['label'], $_SERVER["PHP_SELF"],"p.ref","",$param,"",$sortfield,$sortorder);
|
||||||
|
if (! empty($arrayfields['p.label']['checked'])) print_liste_field_titre($arrayfields['p.label']['label'], $_SERVER["PHP_SELF"],"p.label","",$param,"",$sortfield,$sortorder);
|
||||||
|
if (! empty($arrayfields['p.barcode']['checked'])) print_liste_field_titre($arrayfields['p.barcode']['label'], $_SERVER["PHP_SELF"],"p.barcode","",$param,"",$sortfield,$sortorder);
|
||||||
|
if (! empty($arrayfields['p.duration']['checked'])) print_liste_field_titre($arrayfields['p.duration']['label'], $_SERVER["PHP_SELF"],"p.duration","",$param,"",$sortfield,$sortorder);
|
||||||
|
if (! empty($arrayfields['p.sellprice']['checked'])) print_liste_field_titre($arrayfields['p.sellprice']['label'], $_SERVER["PHP_SELF"],"","",$param,'align="right"',$sortfield,$sortorder);
|
||||||
|
if (! empty($arrayfields['p.minbuyprice']['checked'])) print_liste_field_titre($arrayfields['p.minbuyprice']['label'], $_SERVER["PHP_SELF"],"","",$param,'align="right"',$sortfield,$sortorder);
|
||||||
|
if (! empty($arrayfields['p.desiredstock']['checked'])) print_liste_field_titre($arrayfields['p.desiredstock']['label'], $_SERVER["PHP_SELF"],"p.desirestock","",$param,'align="right"',$sortfield,$sortorder);
|
||||||
|
if (! empty($arrayfields['p.stock']['checked'])) print_liste_field_titre($arrayfields['p.stock']['label'], $_SERVER["PHP_SELF"],"p.stock","",$param,'align="right"',$sortfield,$sortorder);
|
||||||
|
if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label))
|
||||||
|
{
|
||||||
|
foreach($extrafields->attribute_label as $key => $val)
|
||||||
|
{
|
||||||
|
if (! empty($arrayfields["ef.".$key]['checked']))
|
||||||
|
{
|
||||||
|
$align=$extrafields->getAlignFlag($key);
|
||||||
|
print_liste_field_titre($extralabels[$key],$_SERVER["PHP_SELF"],"ef.".$key,"",$param,($align?'align="'.$align.'"':''),$sortfield,$sortorder);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// Hook fields
|
||||||
|
$parameters=array('arrayfields'=>$arrayfields);
|
||||||
|
$reshook=$hookmanager->executeHooks('printFieldListTitle',$parameters); // Note that $action and $object may have been modified by hook
|
||||||
|
print $hookmanager->resPrint;
|
||||||
|
if (! empty($arrayfields['p.datec']['checked'])) print_liste_field_titre($arrayfields['p.datec']['label'],$_SERVER["PHP_SELF"],"p.datec","",$param,'align="center" class="nowrap"',$sortfield,$sortorder);
|
||||||
|
if (! empty($arrayfields['p.tms']['checked'])) print_liste_field_titre($arrayfields['p.tms']['label'],$_SERVER["PHP_SELF"],"p.tms","",$param,'align="center" class="nowrap"',$sortfield,$sortorder);
|
||||||
|
if (! empty($arrayfields['p.tosell']['checked'])) print_liste_field_titre($langs->trans("Status").' ('.$langs->trans("Sell").')',$_SERVER["PHP_SELF"],"p.tosell","",$param,'align="center"',$sortfield,$sortorder);
|
||||||
|
if (! empty($arrayfields['p.tobuy']['checked'])) print_liste_field_titre($langs->trans("Status").' ('.$langs->trans("Buy").')',$_SERVER["PHP_SELF"],"p.tobuy","",$param,'align="center"',$sortfield,$sortorder);
|
||||||
|
print_liste_field_titre($selectedfields, $_SERVER["PHP_SELF"],"",'','','align="right"',$sortfield,$sortorder,'maxwidthsearch ');
|
||||||
print "</tr>\n";
|
print "</tr>\n";
|
||||||
|
|
||||||
// Lignes des champs de filtre
|
// Lines with input filters
|
||||||
print '<tr class="liste_titre">';
|
print '<tr class="liste_titre">';
|
||||||
|
if (! empty($arrayfields['p.ref']['checked']))
|
||||||
|
{
|
||||||
print '<td class="liste_titre" align="left">';
|
print '<td class="liste_titre" align="left">';
|
||||||
print '<input class="flat" type="text" name="sref" size="8" value="'.dol_escape_htmltag($sref).'">';
|
print '<input class="flat" type="text" name="sref" size="8" value="'.dol_escape_htmltag($sref).'">';
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
}
|
||||||
|
if (! empty($arrayfields['p.label']['checked']))
|
||||||
|
{
|
||||||
print '<td class="liste_titre" align="left">';
|
print '<td class="liste_titre" align="left">';
|
||||||
print '<input class="flat" type="text" name="snom" size="12" value="'.dol_escape_htmltag($snom).'">';
|
print '<input class="flat" type="text" name="snom" size="12" value="'.dol_escape_htmltag($snom).'">';
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
}
|
||||||
// Barcode
|
// Barcode
|
||||||
if (! empty($conf->barcode->enabled))
|
if (! empty($arrayfields['p.barcode']['checked']))
|
||||||
{
|
{
|
||||||
print '<td class="liste_titre">';
|
print '<td class="liste_titre">';
|
||||||
print '<input class="flat" type="text" name="sbarcode" size="6" value="'.dol_escape_htmltag($sbarcode).'">';
|
print '<input class="flat" type="text" name="sbarcode" size="6" value="'.dol_escape_htmltag($sbarcode).'">';
|
||||||
print '</td>';
|
print '</td>';
|
||||||
}
|
}
|
||||||
// Date modification
|
|
||||||
print '<td class="liste_titre">';
|
|
||||||
print ' ';
|
|
||||||
print '</td>';
|
|
||||||
|
|
||||||
// Duration
|
// Duration
|
||||||
if (! empty($conf->service->enabled) && $type != 0)
|
if (! empty($arrayfields['p.duration']['checked']))
|
||||||
{
|
{
|
||||||
print '<td class="liste_titre">';
|
print '<td class="liste_titre">';
|
||||||
print ' ';
|
print ' ';
|
||||||
print '</td>';
|
print '</td>';
|
||||||
}
|
}
|
||||||
|
|
||||||
// Sell price
|
// Sell price
|
||||||
if (empty($conf->global->PRODUIT_MULTIPRICES))
|
if (! empty($arrayfields['p.sellprice']['checked']))
|
||||||
{
|
{
|
||||||
print '<td class="liste_titre" align="right">';
|
print '<td class="liste_titre" align="right">';
|
||||||
print '</td>';
|
print '</td>';
|
||||||
}
|
}
|
||||||
|
|
||||||
// Minimum buying Price
|
// Minimum buying Price
|
||||||
if ($user->rights->fournisseur->lire) {
|
if (! empty($arrayfields['p.minbuyprice']['checked']))
|
||||||
print '<td class="liste_titre">';
|
|
||||||
print ' ';
|
|
||||||
print '</td>';
|
|
||||||
}
|
|
||||||
|
|
||||||
// Stock
|
|
||||||
if (! empty($conf->stock->enabled) && $user->rights->stock->lire && $type != 1)
|
|
||||||
{
|
{
|
||||||
print '<td class="liste_titre">';
|
print '<td class="liste_titre">';
|
||||||
print ' ';
|
print ' ';
|
||||||
print '</td>';
|
print '</td>';
|
||||||
//desiredstock
|
}
|
||||||
|
// Desired stock
|
||||||
|
if (! empty($arrayfields['p.desiredstock']['checked']))
|
||||||
|
{
|
||||||
print '<td class="liste_titre">';
|
print '<td class="liste_titre">';
|
||||||
print ' ';
|
print ' ';
|
||||||
print '</td>';
|
print '</td>';
|
||||||
}
|
}
|
||||||
|
// Stock
|
||||||
|
if (! empty($arrayfields['p.stock']['checked']))
|
||||||
|
{
|
||||||
|
print '<td class="liste_titre">';
|
||||||
|
print ' ';
|
||||||
|
print '</td>';
|
||||||
|
}
|
||||||
|
// Extra fields
|
||||||
|
if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label))
|
||||||
|
{
|
||||||
|
foreach($extrafields->attribute_label as $key => $val)
|
||||||
|
{
|
||||||
|
if (! empty($arrayfields["ef.".$key]['checked'])) print '<td class="liste_titre"></td>';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// Fields from hook
|
||||||
|
$parameters=array('arrayfields'=>$arrayfields);
|
||||||
|
$reshook=$hookmanager->executeHooks('printFieldListOption',$parameters); // Note that $action and $object may have been modified by hook
|
||||||
|
print $hookmanager->resPrint;
|
||||||
|
// Date creation
|
||||||
|
if (! empty($arrayfields['p.datec']['checked']))
|
||||||
|
{
|
||||||
|
print '<td class="liste_titre">';
|
||||||
|
print '</td>';
|
||||||
|
}
|
||||||
|
// Date modification
|
||||||
|
if (! empty($arrayfields['p.tms']['checked']))
|
||||||
|
{
|
||||||
|
print '<td class="liste_titre">';
|
||||||
|
print '</td>';
|
||||||
|
}
|
||||||
|
if (! empty($arrayfields['p.tosell']['checked']))
|
||||||
|
{
|
||||||
print '<td class="liste_titre" align="center">';
|
print '<td class="liste_titre" align="center">';
|
||||||
print $form->selectarray('tosell', array('0'=>$langs->trans('ProductStatusNotOnSellShort'),'1'=>$langs->trans('ProductStatusOnSellShort')),$tosell,1);
|
print $form->selectarray('tosell', array('0'=>$langs->trans('ProductStatusNotOnSellShort'),'1'=>$langs->trans('ProductStatusOnSellShort')),$tosell,1);
|
||||||
print '</td >';
|
print '</td >';
|
||||||
|
}
|
||||||
|
if (! empty($arrayfields['p.tobuy']['checked']))
|
||||||
|
{
|
||||||
print '<td class="liste_titre" align="center">';
|
print '<td class="liste_titre" align="center">';
|
||||||
print $form->selectarray('tobuy', array('0'=>$langs->trans('ProductStatusNotOnBuyShort'),'1'=>$langs->trans('ProductStatusOnBuyShort')),$tobuy,1);
|
print $form->selectarray('tobuy', array('0'=>$langs->trans('ProductStatusNotOnBuyShort'),'1'=>$langs->trans('ProductStatusOnBuyShort')),$tobuy,1);
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
}
|
||||||
print '<td class="liste_titre nowrap" align="right">';
|
print '<td class="liste_titre nowrap" align="right">';
|
||||||
print '<input type="image" class="liste_titre" name="button_search" src="'.img_picto($langs->trans("Search"),'search.png','','',1).'" value="'.dol_escape_htmltag($langs->trans("Search")).'" title="'.dol_escape_htmltag($langs->trans("Search")).'">';
|
print '<input type="image" class="liste_titre" name="button_search" src="'.img_picto($langs->trans("Search"),'search.png','','',1).'" value="'.dol_escape_htmltag($langs->trans("Search")).'" title="'.dol_escape_htmltag($langs->trans("Search")).'">';
|
||||||
print '<input type="image" class="liste_titre" name="button_removefilter" src="'.img_picto($langs->trans("RemoveFilter"),'searchclear.png','','',1).'" value="'.dol_escape_htmltag($langs->trans("RemoveFilter")).'" title="'.dol_escape_htmltag($langs->trans("RemoveFilter")).'">';
|
print '<input type="image" class="liste_titre" name="button_removefilter" src="'.img_picto($langs->trans("RemoveFilter"),'searchclear.png','','',1).'" value="'.dol_escape_htmltag($langs->trans("RemoveFilter")).'" title="'.dol_escape_htmltag($langs->trans("RemoveFilter")).'">';
|
||||||
@ -427,32 +544,38 @@ else
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$var=!$var;
|
|
||||||
print '<tr '.$bc[$var].'>';
|
|
||||||
|
|
||||||
// Ref
|
|
||||||
print '<td class="nowrap">';
|
|
||||||
$product_static->id = $objp->rowid;
|
$product_static->id = $objp->rowid;
|
||||||
$product_static->ref = $objp->ref;
|
$product_static->ref = $objp->ref;
|
||||||
$product_static->label = $objp->label;
|
$product_static->label = $objp->label;
|
||||||
$product_static->type = $objp->fk_product_type;
|
$product_static->type = $objp->fk_product_type;
|
||||||
|
$product_static->status_buy = $objp->tobuy;
|
||||||
|
$product_static->status = $objp->tosell;
|
||||||
|
|
||||||
|
$var=!$var;
|
||||||
|
print '<tr '.$bc[$var].'>';
|
||||||
|
|
||||||
|
// Ref
|
||||||
|
if (! empty($arrayfields['p.ref']['checked']))
|
||||||
|
{
|
||||||
|
print '<td class="nowrap">';
|
||||||
print $product_static->getNomUrl(1,'',24);
|
print $product_static->getNomUrl(1,'',24);
|
||||||
print "</td>\n";
|
print "</td>\n";
|
||||||
|
}
|
||||||
|
|
||||||
// Label
|
// Label
|
||||||
|
if (! empty($arrayfields['p.label']['checked']))
|
||||||
|
{
|
||||||
print '<td>'.dol_trunc($objp->label,40).'</td>';
|
print '<td>'.dol_trunc($objp->label,40).'</td>';
|
||||||
|
}
|
||||||
|
|
||||||
// Barcode
|
// Barcode
|
||||||
if (! empty($conf->barcode->enabled))
|
if (! empty($arrayfields['p.barcode']['checked']))
|
||||||
{
|
{
|
||||||
print '<td>'.$objp->barcode.'</td>';
|
print '<td>'.$objp->barcode.'</td>';
|
||||||
}
|
}
|
||||||
|
|
||||||
// Modification Date
|
|
||||||
print '<td align="center">'.dol_print_date($db->jdate($objp->datem),'day')."</td>\n";
|
|
||||||
|
|
||||||
// Duration
|
// Duration
|
||||||
if (! empty($conf->service->enabled) && $type != 0)
|
if (! empty($arrayfields['p.duration']['checked']))
|
||||||
{
|
{
|
||||||
print '<td align="center">';
|
print '<td align="center">';
|
||||||
if (preg_match('/([0-9]+)[a-z]/i',$objp->duration))
|
if (preg_match('/([0-9]+)[a-z]/i',$objp->duration))
|
||||||
@ -468,7 +591,7 @@ else
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Sell price
|
// Sell price
|
||||||
if (empty($conf->global->PRODUIT_MULTIPRICES))
|
if (! empty($arrayfields['p.sellprice']['checked']))
|
||||||
{
|
{
|
||||||
print '<td align="right">';
|
print '<td align="right">';
|
||||||
if ($objp->tosell)
|
if ($objp->tosell)
|
||||||
@ -480,7 +603,7 @@ else
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Better buy price
|
// Better buy price
|
||||||
if ($user->rights->fournisseur->lire)
|
if (! empty($arrayfields['p.minbuyprice']['checked']))
|
||||||
{
|
{
|
||||||
print '<td align="right">';
|
print '<td align="right">';
|
||||||
if ($objp->tobuy && $objp->minsellprice != '')
|
if ($objp->tobuy && $objp->minsellprice != '')
|
||||||
@ -502,35 +625,76 @@ else
|
|||||||
print '</td>';
|
print '</td>';
|
||||||
}
|
}
|
||||||
|
|
||||||
// Show stock
|
if (! empty($conf->stock->enabled) && $user->rights->stock->lire && $type != 1) // To optimize call of load_stock
|
||||||
if (! empty($conf->stock->enabled) && $user->rights->stock->lire && $type != 1)
|
|
||||||
{
|
{
|
||||||
if ($objp->fk_product_type != 1)
|
if ($objp->fk_product_type != 1)
|
||||||
{
|
{
|
||||||
$product_static->id = $objp->rowid;
|
$product_static->id = $objp->rowid;
|
||||||
$product_static->load_stock();
|
$product_static->load_stock();
|
||||||
print '<td align="right">';
|
|
||||||
print $objp->desiredstock;
|
|
||||||
print '</td>';
|
|
||||||
print '<td align="right">';
|
|
||||||
if ($product_static->stock_reel < $objp->seuil_stock_alerte) print img_warning($langs->trans("StockTooLow")).' ';
|
|
||||||
print $product_static->stock_reel;
|
|
||||||
print '</td>';
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
print '<td>';
|
|
||||||
print ' ';
|
|
||||||
print '</td>';
|
|
||||||
print '<td>';
|
|
||||||
print ' ';
|
|
||||||
print '</td>';
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$product_static->status_buy = $objp->tobuy;
|
// Desired stock
|
||||||
$product_static->status = $objp->tosell;
|
if (! empty($arrayfields['p.desiredstock']['checked']))
|
||||||
|
{
|
||||||
|
print '<td align="right">';
|
||||||
|
if ($objp->fk_product_type != 1)
|
||||||
|
{
|
||||||
|
print $objp->desiredstock;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// Stock
|
||||||
|
if (! empty($arrayfields['p.stock']['checked']))
|
||||||
|
{
|
||||||
|
print '</td>';
|
||||||
|
print '<td align="right">';
|
||||||
|
if ($objp->fk_product_type != 1)
|
||||||
|
{
|
||||||
|
if ($product_static->stock_reel < $objp->seuil_stock_alerte) print img_warning($langs->trans("StockTooLow")).' ';
|
||||||
|
print $product_static->stock_reel;
|
||||||
|
}
|
||||||
|
print '</td>';
|
||||||
|
}
|
||||||
|
|
||||||
|
// Extra fields
|
||||||
|
if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label))
|
||||||
|
{
|
||||||
|
foreach($extrafields->attribute_label as $key => $val)
|
||||||
|
{
|
||||||
|
if (! empty($arrayfields["ef.".$key]['checked']))
|
||||||
|
{
|
||||||
|
print '<td';
|
||||||
|
$align=$extrafields->getAlignFlag($key);
|
||||||
|
if ($align) print ' align="'.$align.'"';
|
||||||
|
print '>';
|
||||||
|
$tmpkey='options_'.$key;
|
||||||
|
print $extrafields->showOutputField($key, $objp->$tmpkey, '', 1);
|
||||||
|
print '</td>';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// Fields from hook
|
||||||
|
$parameters=array('arrayfields'=>$arrayfields, 'obj'=>$obj);
|
||||||
|
$reshook=$hookmanager->executeHooks('printFieldListValue',$parameters); // Note that $action and $object may have been modified by hook
|
||||||
|
print $hookmanager->resPrint;
|
||||||
|
// Date creation
|
||||||
|
if (! empty($arrayfields['p.datec']['checked']))
|
||||||
|
{
|
||||||
|
print '<td align="center">';
|
||||||
|
print dol_print_date($objp->date_creation, 'dayhour');
|
||||||
|
print '</td>';
|
||||||
|
}
|
||||||
|
// Date modification
|
||||||
|
if (! empty($arrayfields['p.tms']['checked']))
|
||||||
|
{
|
||||||
|
print '<td align="center">';
|
||||||
|
print dol_print_date($objp->date_update, 'dayhour');
|
||||||
|
print '</td>';
|
||||||
|
}
|
||||||
|
|
||||||
// Status (to sell)
|
// Status (to sell)
|
||||||
|
if (! empty($arrayfields['p.tosell']['checked']))
|
||||||
|
{
|
||||||
print '<td align="center" nowrap="nowrap">';
|
print '<td align="center" nowrap="nowrap">';
|
||||||
if (! empty($conf->use_javascript_ajax) && $user->rights->produit->creer && ! empty($conf->global->MAIN_DIRECT_STATUS_UPDATE)) {
|
if (! empty($conf->use_javascript_ajax) && $user->rights->produit->creer && ! empty($conf->global->MAIN_DIRECT_STATUS_UPDATE)) {
|
||||||
print ajax_object_onoff($product_static, 'status', 'tosell', 'ProductStatusOnSell', 'ProductStatusNotOnSell');
|
print ajax_object_onoff($product_static, 'status', 'tosell', 'ProductStatusOnSell', 'ProductStatusNotOnSell');
|
||||||
@ -538,8 +702,10 @@ else
|
|||||||
print $product_static->LibStatut($objp->tosell,5,0);
|
print $product_static->LibStatut($objp->tosell,5,0);
|
||||||
}
|
}
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
}
|
||||||
// Status (to buy)
|
// Status (to buy)
|
||||||
|
if (! empty($arrayfields['p.tobuy']['checked']))
|
||||||
|
{
|
||||||
print '<td align="center" nowrap="nowrap">';
|
print '<td align="center" nowrap="nowrap">';
|
||||||
if (! empty($conf->use_javascript_ajax) && $user->rights->produit->creer && ! empty($conf->global->MAIN_DIRECT_STATUS_UPDATE)) {
|
if (! empty($conf->use_javascript_ajax) && $user->rights->produit->creer && ! empty($conf->global->MAIN_DIRECT_STATUS_UPDATE)) {
|
||||||
print ajax_object_onoff($product_static, 'status_buy', 'tobuy', 'ProductStatusOnBuy', 'ProductStatusNotOnBuy');
|
print ajax_object_onoff($product_static, 'status_buy', 'tobuy', 'ProductStatusOnBuy', 'ProductStatusNotOnBuy');
|
||||||
@ -547,17 +713,14 @@ else
|
|||||||
print $product_static->LibStatut($objp->tobuy,5,1);
|
print $product_static->LibStatut($objp->tobuy,5,1);
|
||||||
}
|
}
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
}
|
||||||
|
// Action
|
||||||
print '<td> </td>';
|
print '<td> </td>';
|
||||||
|
|
||||||
print "</tr>\n";
|
print "</tr>\n";
|
||||||
$i++;
|
$i++;
|
||||||
}
|
}
|
||||||
|
|
||||||
$param="&sref=".$sref.($sbarcode?"&sbarcode=".$sbarcode:"")."&snom=".$snom."&sall=".$sall."&tosell=".$tosell."&tobuy=".$tobuy;
|
|
||||||
$param.=($fourn_id?"&fourn_id=".$fourn_id:"");
|
|
||||||
$param.=($search_categ?"&search_categ=".$search_categ:"");
|
|
||||||
$param.=isset($type)?"&type=".$type:"";
|
|
||||||
print_barre_liste('', $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords, '', '', '', 'paginationatbottom');
|
print_barre_liste('', $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords, '', '', '', 'paginationatbottom');
|
||||||
|
|
||||||
$db->free($resql);
|
$db->free($resql);
|
||||||
|
|||||||
@ -53,7 +53,7 @@ $fourn_id = GETPOST("fourn_id",'int');
|
|||||||
$sortfield = GETPOST("sortfield",'alpha');
|
$sortfield = GETPOST("sortfield",'alpha');
|
||||||
$sortorder = GETPOST("sortorder",'alpha');
|
$sortorder = GETPOST("sortorder",'alpha');
|
||||||
$page = GETPOST("page",'int');
|
$page = GETPOST("page",'int');
|
||||||
if (! $sortfield) $sortfield="stock_physique";
|
if (! $sortfield) $sortfield="p.ref";
|
||||||
if (! $sortorder) $sortorder="ASC";
|
if (! $sortorder) $sortorder="ASC";
|
||||||
$limit = $conf->liste_limit;
|
$limit = $conf->liste_limit;
|
||||||
$offset = $limit * $page ;
|
$offset = $limit * $page ;
|
||||||
@ -255,8 +255,8 @@ if ($resql)
|
|||||||
// TODO Add info of running suppliers/customers orders
|
// TODO Add info of running suppliers/customers orders
|
||||||
//print_liste_field_titre($langs->trans("TheoreticalStock"),$_SERVER["PHP_SELF"], "stock_theorique",$param,"",'align="right"',$sortfield,$sortorder);
|
//print_liste_field_titre($langs->trans("TheoreticalStock"),$_SERVER["PHP_SELF"], "stock_theorique",$param,"",'align="right"',$sortfield,$sortorder);
|
||||||
print_liste_field_titre('');
|
print_liste_field_titre('');
|
||||||
print_liste_field_titre($langs->trans("Sell"),$_SERVER["PHP_SELF"], "p.tosell",$param,"",'align="right"',$sortfield,$sortorder);
|
print_liste_field_titre($langs->trans("Status").' ('.$langs->trans("Sell").')',$_SERVER["PHP_SELF"], "p.tosell",$param,"",'align="right"',$sortfield,$sortorder);
|
||||||
print_liste_field_titre($langs->trans("Buy"),$_SERVER["PHP_SELF"], "p.tobuy",$param,"",'align="right"',$sortfield,$sortorder);
|
print_liste_field_titre($langs->trans("Status").' ('.$langs->trans("Buy").')',$_SERVER["PHP_SELF"], "p.tobuy",$param,"",'align="right"',$sortfield,$sortorder);
|
||||||
print "</tr>\n";
|
print "</tr>\n";
|
||||||
|
|
||||||
// Lignes des champs de filtre
|
// Lignes des champs de filtre
|
||||||
|
|||||||
@ -56,7 +56,7 @@ $fourn_id = GETPOST("fourn_id",'int');
|
|||||||
$sortfield = GETPOST("sortfield",'alpha');
|
$sortfield = GETPOST("sortfield",'alpha');
|
||||||
$sortorder = GETPOST("sortorder",'alpha');
|
$sortorder = GETPOST("sortorder",'alpha');
|
||||||
$page = GETPOST("page",'int');
|
$page = GETPOST("page",'int');
|
||||||
if (! $sortfield) $sortfield="stock_physique";
|
if (! $sortfield) $sortfield="p.ref";
|
||||||
if (! $sortorder) $sortorder="ASC";
|
if (! $sortorder) $sortorder="ASC";
|
||||||
$limit = $conf->liste_limit;
|
$limit = $conf->liste_limit;
|
||||||
$offset = $limit * $page ;
|
$offset = $limit * $page ;
|
||||||
@ -266,9 +266,9 @@ if ($resql)
|
|||||||
print_liste_field_titre($langs->trans("PhysicalStock"), $_SERVER["PHP_SELF"], "stock_physique",$param,"",'align="right"',$sortfield,$sortorder);
|
print_liste_field_titre($langs->trans("PhysicalStock"), $_SERVER["PHP_SELF"], "stock_physique",$param,"",'align="right"',$sortfield,$sortorder);
|
||||||
// TODO Add info of running suppliers/customers orders
|
// TODO Add info of running suppliers/customers orders
|
||||||
//print_liste_field_titre($langs->trans("TheoreticalStock"),$_SERVER["PHP_SELF"], "stock_theorique",$param,"",'align="right"',$sortfield,$sortorder);
|
//print_liste_field_titre($langs->trans("TheoreticalStock"),$_SERVER["PHP_SELF"], "stock_theorique",$param,"",'align="right"',$sortfield,$sortorder);
|
||||||
print '<td class="liste_titre"> </td>';
|
print_liste_field_titre('');
|
||||||
print_liste_field_titre($langs->trans("Sell"),$_SERVER["PHP_SELF"], "p.tosell",$param,"",'align="right"',$sortfield,$sortorder);
|
print_liste_field_titre($langs->trans("Status").' ('.$langs->trans("Sell").')',$_SERVER["PHP_SELF"], "p.tosell",$param,"",'align="right"',$sortfield,$sortorder);
|
||||||
print_liste_field_titre($langs->trans("Buy"),$_SERVER["PHP_SELF"], "p.tobuy",$param,"",'align="right"',$sortfield,$sortorder);
|
print_liste_field_titre($langs->trans("Status").' ('.$langs->trans("Buy").')',$_SERVER["PHP_SELF"], "p.tobuy",$param,"",'align="right"',$sortfield,$sortorder);
|
||||||
print "</tr>\n";
|
print "</tr>\n";
|
||||||
|
|
||||||
// Lignes des champs de filtre
|
// Lignes des champs de filtre
|
||||||
|
|||||||
@ -325,7 +325,7 @@ $title = $langs->trans('MassMovement');
|
|||||||
|
|
||||||
llxHeader('', $title);
|
llxHeader('', $title);
|
||||||
|
|
||||||
print load_fiche_titre($langs->trans("MassStockMovement")).'<br><br>';
|
print load_fiche_titre($langs->trans("MassStockMovement"));
|
||||||
|
|
||||||
$titletoadd=$langs->trans("Select");
|
$titletoadd=$langs->trans("Select");
|
||||||
$titletoaddnoent=$langs->transnoentitiesnoconv("Select");
|
$titletoaddnoent=$langs->transnoentitiesnoconv("Select");
|
||||||
|
|||||||
@ -504,7 +504,7 @@ if ($resql)
|
|||||||
if (empty($conf->productbatch->enabled)) print ' ';
|
if (empty($conf->productbatch->enabled)) print ' ';
|
||||||
//else print '<br>';
|
//else print '<br>';
|
||||||
$syear = $year?$year:-1;
|
$syear = $year?$year:-1;
|
||||||
print '<input class="flat" type="text" size="2" maxlength="4" placeholder="'.dol_escape_htmltag($langs->trans("Year")).'" name="year" value="'.($syear > 0 ? $syear : '').'">';
|
print '<input class="flat" type="text" size="3" maxlength="4" placeholder="'.dol_escape_htmltag($langs->trans("Year")).'" name="year" value="'.($syear > 0 ? $syear : '').'">';
|
||||||
//print $formother->selectyear($syear,'year',1, 20, 5);
|
//print $formother->selectyear($syear,'year',1, 20, 5);
|
||||||
print '</td>';
|
print '</td>';
|
||||||
// Product Ref
|
// Product Ref
|
||||||
@ -575,14 +575,15 @@ if ($resql)
|
|||||||
$productstatic->ref=$objp->product_ref;
|
$productstatic->ref=$objp->product_ref;
|
||||||
$productstatic->label=$objp->produit;
|
$productstatic->label=$objp->produit;
|
||||||
$productstatic->type=$objp->type;
|
$productstatic->type=$objp->type;
|
||||||
print $productstatic->getNomUrl(1,'',16);
|
print $productstatic->getNomUrl(1,'stock',16);
|
||||||
print "</td>\n";
|
print "</td>\n";
|
||||||
// Product label
|
// Product label
|
||||||
print '<td>';
|
print '<td>';
|
||||||
$productstatic->id=$objp->rowid;
|
/*$productstatic->id=$objp->rowid;
|
||||||
$productstatic->ref=$objp->produit;
|
$productstatic->ref=$objp->produit;
|
||||||
$productstatic->type=$objp->type;
|
$productstatic->type=$objp->type;
|
||||||
print $productstatic->getNomUrl(1,'',16);
|
print $productstatic->getNomUrl(1,'',16);*/
|
||||||
|
print $productstatic->label;
|
||||||
print "</td>\n";
|
print "</td>\n";
|
||||||
// Batch
|
// Batch
|
||||||
if (! empty($conf->productbatch->enabled))
|
if (! empty($conf->productbatch->enabled))
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
/* Copyright (C) 2013 Cédric Salvador <csalvador@gpcsolutions.fr>
|
/* Copyright (C) 2013 Cédric Salvador <csalvador@gpcsolutions.fr>
|
||||||
* Copyright (C) 2013-2014 Laurent Destaileur <ely@users.sourceforge.net>
|
* Copyright (C) 2013-2015 Laurent Destaileur <ely@users.sourceforge.net>
|
||||||
* Copyright (C) 2014 Regis Houssin <regis.houssin@capnetworks.com>
|
* Copyright (C) 2014 Regis Houssin <regis.houssin@capnetworks.com>
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* This program is free software: you can redistribute it and/or modify
|
||||||
@ -445,8 +445,8 @@ if ($usevirtualstock == 0) $stocklabel = $langs->trans('PhysicalStock');
|
|||||||
|
|
||||||
|
|
||||||
// Lines of title
|
// Lines of title
|
||||||
print '<tr class="liste_titre"><td><input type="checkbox" onClick="toggle(this)" /></td>';
|
print '<tr class="liste_titre">';
|
||||||
|
print_liste_field_titre('<input type="checkbox" onClick="toggle(this)" />', $_SERVER["PHP_SELF"], '');
|
||||||
print_liste_field_titre($langs->trans('Ref'), $_SERVER["PHP_SELF"], 'p.ref', $param, '', '', $sortfield, $sortorder);
|
print_liste_field_titre($langs->trans('Ref'), $_SERVER["PHP_SELF"], 'p.ref', $param, '', '', $sortfield, $sortorder);
|
||||||
print_liste_field_titre($langs->trans('Label'), $_SERVER["PHP_SELF"], 'p.label', $param, '', '', $sortfield, $sortorder);
|
print_liste_field_titre($langs->trans('Label'), $_SERVER["PHP_SELF"], 'p.label', $param, '', '', $sortfield, $sortorder);
|
||||||
if (!empty($conf->service->enabled) && $type == 1) print_liste_field_titre($langs->trans('Duration'), $_SERVER["PHP_SELF"], 'p.duration', $param, '', 'align="center"', $sortfield, $sortorder);
|
if (!empty($conf->service->enabled) && $type == 1) print_liste_field_titre($langs->trans('Duration'), $_SERVER["PHP_SELF"], 'p.duration', $param, '', 'align="center"', $sortfield, $sortorder);
|
||||||
|
|||||||
@ -1760,7 +1760,7 @@ class Societe extends CommonObject
|
|||||||
|
|
||||||
if (! empty($conf->dol_no_mouse_hover)) $notooltip=1;
|
if (! empty($conf->dol_no_mouse_hover)) $notooltip=1;
|
||||||
|
|
||||||
if ($conf->global->SOCIETE_ADD_REF_IN_LIST && (!empty($withpicto)))
|
if (! empty($conf->global->SOCIETE_ADD_REF_IN_LIST) && (!empty($withpicto)))
|
||||||
{
|
{
|
||||||
if (($this->client) && (! empty ( $this->code_client ))) {
|
if (($this->client) && (! empty ( $this->code_client ))) {
|
||||||
$code = $this->code_client . ' - ';
|
$code = $this->code_client . ' - ';
|
||||||
@ -1771,9 +1771,7 @@ class Societe extends CommonObject
|
|||||||
$name =$code.' '.$name;
|
$name =$code.' '.$name;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!empty($this->name_alias)) {
|
if (!empty($this->name_alias)) $name .= ' ('.$this->name_alias.')';
|
||||||
$name .= ' ('.$this->name_alias.')';
|
|
||||||
}
|
|
||||||
|
|
||||||
$result=''; $label='';
|
$result=''; $label='';
|
||||||
$link=''; $linkend='';
|
$link=''; $linkend='';
|
||||||
|
|||||||
@ -75,13 +75,14 @@ $optioncss=GETPOST('optioncss','alpha');
|
|||||||
$mode=GETPOST("mode");
|
$mode=GETPOST("mode");
|
||||||
$action=GETPOST('action');
|
$action=GETPOST('action');
|
||||||
|
|
||||||
|
$limit = GETPOST("limit")?GETPOST("limit","int"):$conf->liste_limit;
|
||||||
$sortfield=GETPOST("sortfield",'alpha');
|
$sortfield=GETPOST("sortfield",'alpha');
|
||||||
$sortorder=GETPOST("sortorder",'alpha');
|
$sortorder=GETPOST("sortorder",'alpha');
|
||||||
$page=GETPOST("page",'int');
|
$page=GETPOST("page",'int');
|
||||||
if (! $sortorder) $sortorder="ASC";
|
if (! $sortorder) $sortorder="ASC";
|
||||||
if (! $sortfield) $sortfield="s.nom";
|
if (! $sortfield) $sortfield="s.nom";
|
||||||
if ($page == -1) { $page = 0 ; }
|
if ($page == -1) { $page = 0 ; }
|
||||||
$offset = $conf->liste_limit * $page ;
|
$offset = $limit * $page ;
|
||||||
$pageprev = $page - 1;
|
$pageprev = $page - 1;
|
||||||
$pagenext = $page + 1;
|
$pagenext = $page + 1;
|
||||||
|
|
||||||
@ -147,56 +148,6 @@ if (empty($reshook))
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// special search
|
|
||||||
/*if ($mode == 'search')
|
|
||||||
{
|
|
||||||
$sql = "SELECT s.rowid";
|
|
||||||
$sql.= " FROM ".MAIN_DB_PREFIX."societe as s";
|
|
||||||
if ($search_sale || (!$user->rights->societe->client->voir && !$socid)) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
|
||||||
// We'll need this table joined to the select in order to filter by categ
|
|
||||||
if ($search_categ) $sql.= ", ".MAIN_DB_PREFIX."categorie_societe as cs";
|
|
||||||
$sql.= " WHERE s.entity IN (".getEntity('societe', 1).")";
|
|
||||||
// sall criteria
|
|
||||||
$sql.= natural_search($fields, $sall);
|
|
||||||
|
|
||||||
if (!$user->rights->societe->client->voir && !$socid) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id;
|
|
||||||
if ($socid) $sql.= " AND s.rowid = ".$socid;
|
|
||||||
if ($search_sale) $sql.= " AND s.rowid = sc.fk_soc"; // Join for the needed table to filter by sale
|
|
||||||
if ($search_categ) $sql.= " AND s.rowid = cs.fk_soc"; // Join for the needed table to filter by categ
|
|
||||||
if (! $user->rights->societe->lire || ! $user->rights->fournisseur->lire)
|
|
||||||
{
|
|
||||||
if (! $user->rights->fournisseur->lire) $sql.=" AND s.fournisseur != 1";
|
|
||||||
}
|
|
||||||
// Insert sale filter
|
|
||||||
if ($search_sale)
|
|
||||||
{
|
|
||||||
$sql .= " AND sc.fk_user = ".$search_sale;
|
|
||||||
}
|
|
||||||
// Insert categ filter
|
|
||||||
if ($search_categ)
|
|
||||||
{
|
|
||||||
$sql .= " AND cs.fk_categorie = ".$search_categ;
|
|
||||||
}
|
|
||||||
// Filter on type of thirdparty
|
|
||||||
if ($search_type > 0 && in_array($search_type,array('1,3','2,3'))) $sql .= " AND s.client IN (".$db->escape($search_type).")";
|
|
||||||
if ($search_type > 0 && in_array($search_type,array('4'))) $sql .= " AND s.fournisseur = 1";
|
|
||||||
if ($search_type == '0') $sql .= " AND s.client = 0 AND s.fournisseur = 0";
|
|
||||||
|
|
||||||
$result=$db->query($sql);
|
|
||||||
if ($result)
|
|
||||||
{
|
|
||||||
if ($db->num_rows($result) == 1)
|
|
||||||
{
|
|
||||||
$obj = $db->fetch_object($result);
|
|
||||||
$socid = $obj->rowid;
|
|
||||||
header("Location: ".DOL_URL_ROOT."/societe/soc.php?socid=".$socid);
|
|
||||||
exit;
|
|
||||||
}
|
|
||||||
$db->free($result);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
// Do we click on purge search criteria ?
|
// Do we click on purge search criteria ?
|
||||||
if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter.x") || GETPOST("button_removefilter")) // Both test are required to be compatible with all browsers
|
if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter.x") || GETPOST("button_removefilter")) // Both test are required to be compatible with all browsers
|
||||||
{
|
{
|
||||||
@ -346,13 +297,13 @@ if ($search_sale) $sql .= ", sc.fk_soc, sc.fk_user";
|
|||||||
// We'll need these fields in order to filter by categ
|
// We'll need these fields in order to filter by categ
|
||||||
if ($search_categ) $sql .= ", cs.fk_categorie, cs.fk_soc";
|
if ($search_categ) $sql .= ", cs.fk_categorie, cs.fk_soc";
|
||||||
// Add fields from extrafields
|
// Add fields from extrafields
|
||||||
foreach ($extrafields->attribute_list as $key => $val) $sql.=",ef.".$key.' as options_'.$key;
|
foreach ($extrafields->attribute_label as $key => $val) $sql.=",ef.".$key.' as options_'.$key;
|
||||||
// Add fields from hooks
|
// Add fields from hooks
|
||||||
$parameters=array();
|
$parameters=array();
|
||||||
$reshook=$hookmanager->executeHooks('printFieldListSelect',$parameters); // Note that $action and $object may have been modified by hook
|
$reshook=$hookmanager->executeHooks('printFieldListSelect',$parameters); // Note that $action and $object may have been modified by hook
|
||||||
$sql.=$hookmanager->resPrint;
|
$sql.=$hookmanager->resPrint;
|
||||||
$sql.= " FROM ".MAIN_DB_PREFIX."societe as s";
|
$sql.= " FROM ".MAIN_DB_PREFIX."societe as s";
|
||||||
if (is_array($extrafields->attribute_list) && count($extrafields->attribute_list)) $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe_extrafields as ef on (s.rowid = ef.fk_object)";
|
if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label)) $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe_extrafields as ef on (s.rowid = ef.fk_object)";
|
||||||
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."c_country as country on (country.rowid = s.fk_pays) ";
|
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."c_country as country on (country.rowid = s.fk_pays) ";
|
||||||
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."c_typent as typent on (typent.id = s.fk_typent) ";
|
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."c_typent as typent on (typent.id = s.fk_typent) ";
|
||||||
$sql.= " ,".MAIN_DB_PREFIX."c_stcomm as st";
|
$sql.= " ,".MAIN_DB_PREFIX."c_stcomm as st";
|
||||||
@ -579,6 +530,14 @@ if ($resql)
|
|||||||
's.tms'=>array('label'=>$langs->trans("DateModificationShort"), 'checked'=>0, 'position'=>500),
|
's.tms'=>array('label'=>$langs->trans("DateModificationShort"), 'checked'=>0, 'position'=>500),
|
||||||
's.status'=>array('label'=>$langs->trans("Status"), 'checked'=>1, 'position'=>1000),
|
's.status'=>array('label'=>$langs->trans("Status"), 'checked'=>1, 'position'=>1000),
|
||||||
);
|
);
|
||||||
|
// Extra fields
|
||||||
|
if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label))
|
||||||
|
{
|
||||||
|
foreach($extrafields->attribute_label as $key => $val)
|
||||||
|
{
|
||||||
|
$arrayfields["ef.".$key]=array('label'=>$extrafields->attribute_label[$key], 'checked'=>$extrafields->attribute_list[$key], 'position'=>$extrafields->attribute_pos[$key], 'enabled'=>$extrafields->attribute_perms[$key]);
|
||||||
|
}
|
||||||
|
}
|
||||||
$varpage=empty($contextpage)?$_SERVER["PHP_SELF"]:$contextpage;
|
$varpage=empty($contextpage)?$_SERVER["PHP_SELF"]:$contextpage;
|
||||||
$selectedfields=$form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage); // This also change content of $arrayfields
|
$selectedfields=$form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage); // This also change content of $arrayfields
|
||||||
print '<table class="liste '.($moreforfilter?"listwithfilterbefore":"").'">';
|
print '<table class="liste '.($moreforfilter?"listwithfilterbefore":"").'">';
|
||||||
@ -604,13 +563,14 @@ if ($resql)
|
|||||||
if (! empty($arrayfields['s.fk_prospectlevel']['checked'])) print_liste_field_titre($arrayfields['s.fk_prospectlevel']['label'],$_SERVER["PHP_SELF"],"s.fk_prospectlevel","",$param,'align="center"',$sortfield,$sortorder);
|
if (! empty($arrayfields['s.fk_prospectlevel']['checked'])) print_liste_field_titre($arrayfields['s.fk_prospectlevel']['label'],$_SERVER["PHP_SELF"],"s.fk_prospectlevel","",$param,'align="center"',$sortfield,$sortorder);
|
||||||
if (! empty($arrayfields['s.fk_stcomm']['checked'])) print_liste_field_titre($arrayfields['s.fk_stcomm']['label'],$_SERVER["PHP_SELF"],"s.fk_stcomm","",$param,'align="center"',$sortfield,$sortorder);
|
if (! empty($arrayfields['s.fk_stcomm']['checked'])) print_liste_field_titre($arrayfields['s.fk_stcomm']['label'],$_SERVER["PHP_SELF"],"s.fk_stcomm","",$param,'align="center"',$sortfield,$sortorder);
|
||||||
// Extra fields
|
// Extra fields
|
||||||
if (is_array($extrafields->attribute_list) && count($extrafields->attribute_list))
|
if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label))
|
||||||
{
|
{
|
||||||
foreach($extrafields->attribute_list as $key => $val)
|
foreach($extrafields->attribute_label as $key => $val)
|
||||||
{
|
{
|
||||||
if ($val)
|
if (! empty($arrayfields["ef.".$key]['checked']))
|
||||||
{
|
{
|
||||||
if (! empty($arrayfields["ef.".$key]['checked'])) print_liste_field_titre($extralabels[$key],$_SERVER["PHP_SELF"],"ef.".$key,"",$param,"",$sortfield,$sortorder);
|
$align=$extrafields->getAlignFlag($key);
|
||||||
|
print_liste_field_titre($extralabels[$key],$_SERVER["PHP_SELF"],"ef.".$key,"",$param,($align?'align="'.$align.'"':''),$sortfield,$sortorder);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -790,7 +750,18 @@ if ($resql)
|
|||||||
print $form->selectarray('search_stcomm', $arraystcomm, $search_stcomm, -2);
|
print $form->selectarray('search_stcomm', $arraystcomm, $search_stcomm, -2);
|
||||||
print '</td>';
|
print '</td>';
|
||||||
}
|
}
|
||||||
|
// Extra fields
|
||||||
|
if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label))
|
||||||
|
{
|
||||||
|
foreach($extrafields->attribute_label as $key => $val)
|
||||||
|
{
|
||||||
|
if (! empty($arrayfields["ef.".$key]['checked']))
|
||||||
|
{
|
||||||
|
print '<td class="liste_titre">';
|
||||||
|
print '</td>';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
// Fields from hook
|
// Fields from hook
|
||||||
$parameters=array('arrayfields'=>$arrayfields);
|
$parameters=array('arrayfields'=>$arrayfields);
|
||||||
$reshook=$hookmanager->executeHooks('printFieldListOption',$parameters); // Note that $action and $object may have been modified by hook
|
$reshook=$hookmanager->executeHooks('printFieldListOption',$parameters); // Note that $action and $object may have been modified by hook
|
||||||
@ -929,18 +900,21 @@ if ($resql)
|
|||||||
if (($obj->client==1 || $obj->client==3) && empty($conf->global->SOCIETE_DISABLE_CUSTOMERS))
|
if (($obj->client==1 || $obj->client==3) && empty($conf->global->SOCIETE_DISABLE_CUSTOMERS))
|
||||||
{
|
{
|
||||||
$companystatic->name=$langs->trans("Customer");
|
$companystatic->name=$langs->trans("Customer");
|
||||||
|
$companystatic->name_alias='';
|
||||||
$s.=$companystatic->getNomUrl(0,'customer');
|
$s.=$companystatic->getNomUrl(0,'customer');
|
||||||
}
|
}
|
||||||
if (($obj->client==2 || $obj->client==3) && empty($conf->global->SOCIETE_DISABLE_PROSPECTS))
|
if (($obj->client==2 || $obj->client==3) && empty($conf->global->SOCIETE_DISABLE_PROSPECTS))
|
||||||
{
|
{
|
||||||
if ($s) $s.=" / ";
|
if ($s) $s.=" / ";
|
||||||
$companystatic->name=$langs->trans("Prospect");
|
$companystatic->name=$langs->trans("Prospect");
|
||||||
|
$companystatic->name_alias='';
|
||||||
$s.=$companystatic->getNomUrl(0,'prospect');
|
$s.=$companystatic->getNomUrl(0,'prospect');
|
||||||
}
|
}
|
||||||
if (! empty($conf->fournisseur->enabled) && $obj->fournisseur)
|
if (! empty($conf->fournisseur->enabled) && $obj->fournisseur)
|
||||||
{
|
{
|
||||||
if ($s) $s.=" / ";
|
if ($s) $s.=" / ";
|
||||||
$companystatic->name=$langs->trans("Supplier");
|
$companystatic->name=$langs->trans("Supplier");
|
||||||
|
$companystatic->name_alias='';
|
||||||
$s.=$companystatic->getNomUrl(0,'supplier');
|
$s.=$companystatic->getNomUrl(0,'supplier');
|
||||||
}
|
}
|
||||||
print $s;
|
print $s;
|
||||||
@ -966,7 +940,23 @@ if ($resql)
|
|||||||
}
|
}
|
||||||
print '</div></div></td>';
|
print '</div></div></td>';
|
||||||
}
|
}
|
||||||
|
// Extra fields
|
||||||
|
if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label))
|
||||||
|
{
|
||||||
|
foreach($extrafields->attribute_label as $key => $val)
|
||||||
|
{
|
||||||
|
if (! empty($arrayfields["ef.".$key]['checked']))
|
||||||
|
{
|
||||||
|
print '<td';
|
||||||
|
$align=$extrafields->getAlignFlag($key);
|
||||||
|
if ($align) print ' align="'.$align.'"';
|
||||||
|
print '>';
|
||||||
|
$tmpkey='options_'.$key;
|
||||||
|
print $extrafields->showOutputField($key, $obj->$tmpkey, '', 1);
|
||||||
|
print '</td>';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
// Fields from hook
|
// Fields from hook
|
||||||
$parameters=array('arrayfields'=>$arrayfields, 'obj'=>$obj);
|
$parameters=array('arrayfields'=>$arrayfields, 'obj'=>$obj);
|
||||||
$reshook=$hookmanager->executeHooks('printFieldListValue',$parameters); // Note that $action and $object may have been modified by hook
|
$reshook=$hookmanager->executeHooks('printFieldListValue',$parameters); // Note that $action and $object may have been modified by hook
|
||||||
|
|||||||
@ -237,7 +237,7 @@ body {
|
|||||||
<?php print 'direction: '.$langs->trans("DIRECTION").";\n"; ?>
|
<?php print 'direction: '.$langs->trans("DIRECTION").";\n"; ?>
|
||||||
}
|
}
|
||||||
|
|
||||||
a:link, a:visited, a:hover, a:active { font-family: <?php print $fontlist ?>; font-weight: bold; color: #4A4A4A; text-decoration: none; }
|
a:link, a:visited, a:hover, a:active { font-family: <?php print $fontlist ?>; font-weight: bold; color: #000; text-decoration: none; }
|
||||||
|
|
||||||
a:hover { text-decoration: underline; color: #000000;}
|
a:hover { text-decoration: underline; color: #000000;}
|
||||||
|
|
||||||
|
|||||||
@ -230,7 +230,7 @@ body {
|
|||||||
<?php print 'direction: '.$langs->trans("DIRECTION").";\n"; ?>
|
<?php print 'direction: '.$langs->trans("DIRECTION").";\n"; ?>
|
||||||
}
|
}
|
||||||
|
|
||||||
a:link, a:visited, a:hover, a:active { font-family: <?php print $fontlist ?>; font-weight: bold; color: #4A4A4A; text-decoration: none; }
|
a:link, a:visited, a:hover, a:active { font-family: <?php print $fontlist ?>; font-weight: bold; color: #000; text-decoration: none; }
|
||||||
|
|
||||||
a:hover { text-decoration: underline; color: #000000;}
|
a:hover { text-decoration: underline; color: #000000;}
|
||||||
|
|
||||||
|
|||||||
@ -55,14 +55,14 @@ $optioncss = GETPOST('optioncss','alpha');
|
|||||||
|
|
||||||
if ($search_statut == '') $search_statut='1';
|
if ($search_statut == '') $search_statut='1';
|
||||||
|
|
||||||
|
$limit = GETPOST("limit")?GETPOST("limit","int"):$conf->liste_limit;
|
||||||
$sortfield = GETPOST('sortfield','alpha');
|
$sortfield = GETPOST('sortfield','alpha');
|
||||||
$sortorder = GETPOST('sortorder','alpha');
|
$sortorder = GETPOST('sortorder','alpha');
|
||||||
$page = GETPOST('page','int');
|
$page = GETPOST('page','int');
|
||||||
if ($page == -1) { $page = 0; }
|
if ($page == -1) { $page = 0; }
|
||||||
$offset = $conf->liste_limit * $page;
|
$offset = $limit * $page;
|
||||||
$pageprev = $page - 1;
|
$pageprev = $page - 1;
|
||||||
$pagenext = $page + 1;
|
$pagenext = $page + 1;
|
||||||
$limit = $conf->liste_limit;
|
|
||||||
if (! $sortfield) $sortfield="u.login";
|
if (! $sortfield) $sortfield="u.login";
|
||||||
if (! $sortorder) $sortorder="ASC";
|
if (! $sortorder) $sortorder="ASC";
|
||||||
|
|
||||||
@ -93,6 +93,7 @@ if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter")) // Both
|
|||||||
$search_datepreviouslogin="";
|
$search_datepreviouslogin="";
|
||||||
$search_date_creation="";
|
$search_date_creation="";
|
||||||
$search_date_update="";
|
$search_date_update="";
|
||||||
|
$search_array_options=array();
|
||||||
}
|
}
|
||||||
|
|
||||||
// List of fields to search into when doing a "search in all"
|
// List of fields to search into when doing a "search in all"
|
||||||
@ -135,12 +136,13 @@ $sql.= " u.tms as date_update, u.datec as date_creation,";
|
|||||||
$sql.= " u2.rowid as id2, u2.login as login2, u2.firstname as firstname2, u2.lastname as lastname2, u2.admin as admin2, u2.fk_soc as fk_soc2, u2.email as email2, u2.gender as gender2, u2.photo as photo2, u2.entity as entity2,";
|
$sql.= " u2.rowid as id2, u2.login as login2, u2.firstname as firstname2, u2.lastname as lastname2, u2.admin as admin2, u2.fk_soc as fk_soc2, u2.email as email2, u2.gender as gender2, u2.photo as photo2, u2.entity as entity2,";
|
||||||
$sql.= " s.nom as name, s.canvas";
|
$sql.= " s.nom as name, s.canvas";
|
||||||
// Add fields from extrafields
|
// Add fields from extrafields
|
||||||
foreach ($extrafields->attribute_list as $key => $val) $sql.=",ef.".$key.' as options_'.$key;
|
foreach ($extrafields->attribute_label as $key => $val) $sql.=",ef.".$key.' as options_'.$key;
|
||||||
// Add fields from hooks
|
// Add fields from hooks
|
||||||
$parameters=array();
|
$parameters=array();
|
||||||
$reshook=$hookmanager->executeHooks('printFieldListSelect',$parameters); // Note that $action and $object may have been modified by hook
|
$reshook=$hookmanager->executeHooks('printFieldListSelect',$parameters); // Note that $action and $object may have been modified by hook
|
||||||
$sql.=$hookmanager->resPrint;
|
$sql.=$hookmanager->resPrint;
|
||||||
$sql.= " FROM ".MAIN_DB_PREFIX."user as u";
|
$sql.= " FROM ".MAIN_DB_PREFIX."user as u";
|
||||||
|
if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label)) $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."user_extrafields as ef on (u.rowid = ef.fk_object)";
|
||||||
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON u.fk_soc = s.rowid";
|
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON u.fk_soc = s.rowid";
|
||||||
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."user as u2 ON u.fk_user = u2.rowid";
|
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."user as u2 ON u.fk_user = u2.rowid";
|
||||||
if(! empty($conf->multicompany->enabled) && $conf->entity == 1 && (! empty($conf->multicompany->transverse_mode) || (! empty($user->admin) && empty($user->entity))))
|
if(! empty($conf->multicompany->enabled) && $conf->entity == 1 && (! empty($conf->multicompany->transverse_mode) || (! empty($user->admin) && empty($user->entity))))
|
||||||
@ -236,6 +238,14 @@ if ($result)
|
|||||||
'u.tms'=>array('label'=>$langs->trans("DateModificationShort"), 'checked'=>0, 'position'=>500),
|
'u.tms'=>array('label'=>$langs->trans("DateModificationShort"), 'checked'=>0, 'position'=>500),
|
||||||
'u.statut'=>array('label'=>$langs->trans("Status"), 'checked'=>1, 'position'=>1000),
|
'u.statut'=>array('label'=>$langs->trans("Status"), 'checked'=>1, 'position'=>1000),
|
||||||
);
|
);
|
||||||
|
// Extra fields
|
||||||
|
if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label))
|
||||||
|
{
|
||||||
|
foreach($extrafields->attribute_label as $key => $val)
|
||||||
|
{
|
||||||
|
$arrayfields["ef.".$key]=array('label'=>$extrafields->attribute_label[$key], 'checked'=>$extrafields->attribute_list[$key], 'position'=>$extrafields->attribute_pos[$key], 'enabled'=>$extrafields->attribute_perms[$key]);
|
||||||
|
}
|
||||||
|
}
|
||||||
$varpage=empty($contextpage)?$_SERVER["PHP_SELF"]:$contextpage;
|
$varpage=empty($contextpage)?$_SERVER["PHP_SELF"]:$contextpage;
|
||||||
$selectedfields=$form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage); // This also change content of $arrayfields
|
$selectedfields=$form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage); // This also change content of $arrayfields
|
||||||
print '<table class="noborder" width="100%">';
|
print '<table class="noborder" width="100%">';
|
||||||
@ -251,13 +261,14 @@ if ($result)
|
|||||||
if (! empty($arrayfields['u.datelastlogin']['checked'])) print_liste_field_titre($langs->trans("LastConnexion"),$_SERVER['PHP_SELF'],"u.datelastlogin",$param,"",'align="center"',$sortfield,$sortorder);
|
if (! empty($arrayfields['u.datelastlogin']['checked'])) print_liste_field_titre($langs->trans("LastConnexion"),$_SERVER['PHP_SELF'],"u.datelastlogin",$param,"",'align="center"',$sortfield,$sortorder);
|
||||||
if (! empty($arrayfields['u.datepreviouslogin']['checked'])) print_liste_field_titre($langs->trans("PreviousConnexion"),$_SERVER['PHP_SELF'],"u.datepreviouslogin",$param,"",'align="center"',$sortfield,$sortorder);
|
if (! empty($arrayfields['u.datepreviouslogin']['checked'])) print_liste_field_titre($langs->trans("PreviousConnexion"),$_SERVER['PHP_SELF'],"u.datepreviouslogin",$param,"",'align="center"',$sortfield,$sortorder);
|
||||||
// Extra fields
|
// Extra fields
|
||||||
if (is_array($extrafields->attribute_list) && count($extrafields->attribute_list))
|
if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label))
|
||||||
{
|
{
|
||||||
foreach($extrafields->attribute_list as $key => $val)
|
foreach($extrafields->attribute_label as $key => $val)
|
||||||
{
|
{
|
||||||
if ($val)
|
if (! empty($arrayfields["ef.".$key]['checked']))
|
||||||
{
|
{
|
||||||
if (! empty($arrayfields["ef.".$key]['checked'])) print_liste_field_titre($extralabels[$key],$_SERVER["PHP_SELF"],"ef.".$key,"",$param,"",$sortfield,$sortorder);
|
$align=$extrafields->getAlignFlag($key);
|
||||||
|
print_liste_field_titre($extralabels[$key],$_SERVER["PHP_SELF"],"ef.".$key,"",$param,($align?'align="'.$align.'"':''),$sortfield,$sortorder);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -313,7 +324,14 @@ if ($result)
|
|||||||
{
|
{
|
||||||
print '<td></td>';
|
print '<td></td>';
|
||||||
}
|
}
|
||||||
|
// Extra fields
|
||||||
|
if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label))
|
||||||
|
{
|
||||||
|
foreach($extrafields->attribute_label as $key => $val)
|
||||||
|
{
|
||||||
|
if (! empty($arrayfields["ef.".$key]['checked'])) print '<td class="liste_titre"></td>';
|
||||||
|
}
|
||||||
|
}
|
||||||
// Fields from hook
|
// Fields from hook
|
||||||
$parameters=array('arrayfields'=>$arrayfields);
|
$parameters=array('arrayfields'=>$arrayfields);
|
||||||
$reshook=$hookmanager->executeHooks('printFieldListOption',$parameters); // Note that $action and $object may have been modified by hook
|
$reshook=$hookmanager->executeHooks('printFieldListOption',$parameters); // Note that $action and $object may have been modified by hook
|
||||||
@ -480,6 +498,23 @@ if ($result)
|
|||||||
print '<td class="nowrap" align="center">'.dol_print_date($db->jdate($obj->datepreviouslogin),"dayhour").'</td>';
|
print '<td class="nowrap" align="center">'.dol_print_date($db->jdate($obj->datepreviouslogin),"dayhour").'</td>';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Extra fields
|
||||||
|
if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label))
|
||||||
|
{
|
||||||
|
foreach($extrafields->attribute_label as $key => $val)
|
||||||
|
{
|
||||||
|
if (! empty($arrayfields["ef.".$key]['checked']))
|
||||||
|
{
|
||||||
|
print '<td';
|
||||||
|
$align=$extrafields->getAlignFlag($key);
|
||||||
|
if ($align) print ' align="'.$align.'"';
|
||||||
|
print '>';
|
||||||
|
$tmpkey='options_'.$key;
|
||||||
|
print $extrafields->showOutputField($key, $obj->$tmpkey, '', 1);
|
||||||
|
print '</td>';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
// Fields from hook
|
// Fields from hook
|
||||||
$parameters=array('arrayfields'=>$arrayfields, 'obj'=>$obj);
|
$parameters=array('arrayfields'=>$arrayfields, 'obj'=>$obj);
|
||||||
$reshook=$hookmanager->executeHooks('printFieldListValue',$parameters); // Note that $action and $object may have been modified by hook
|
$reshook=$hookmanager->executeHooks('printFieldListValue',$parameters); // Note that $action and $object may have been modified by hook
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user