Merge branch 'develop' of git@github.com:Dolibarr/dolibarr.git into
develop Conflicts: htdocs/install/mysql/migration/3.8.0-3.9.0.sql
@ -52,7 +52,7 @@ if ($action == "confirm_update") {
|
|||||||
$error = 0;
|
$error = 0;
|
||||||
|
|
||||||
if ((floatval($debit)!=0.0) && (floatval($credit)!=0.0)) {
|
if ((floatval($debit)!=0.0) && (floatval($credit)!=0.0)) {
|
||||||
setEventMessage($langs->trans('ErrorDebitCredit'), 'errors');
|
setEventMessages($langs->trans('ErrorDebitCredit'), null, 'errors');
|
||||||
$error ++;
|
$error ++;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -61,7 +61,7 @@ if ($action == "confirm_update") {
|
|||||||
|
|
||||||
$result = $book->fetch($id);
|
$result = $book->fetch($id);
|
||||||
if ($result < 0) {
|
if ($result < 0) {
|
||||||
setEventMessage($book->errors, 'errors');
|
setEventMessages($book->error, $book->errors, 'errors');
|
||||||
} else {
|
} else {
|
||||||
$book->numero_compte = $numero_compte;
|
$book->numero_compte = $numero_compte;
|
||||||
$book->code_tiers = $code_tiers;
|
$book->code_tiers = $code_tiers;
|
||||||
@ -80,9 +80,9 @@ if ($action == "confirm_update") {
|
|||||||
|
|
||||||
$result = $book->update();
|
$result = $book->update();
|
||||||
if ($result < 0) {
|
if ($result < 0) {
|
||||||
setEventMessage($book->errors, 'errors');
|
setEventMessages($book->error, $book->errors, 'errors');
|
||||||
} else {
|
} else {
|
||||||
setEventMessage($langs->trans('Saved'), 'mesgs');
|
setEventMessages($langs->trans('Saved'), null, 'mesgs');
|
||||||
$action = '';
|
$action = '';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -93,7 +93,7 @@ else if ($action == "add") {
|
|||||||
$error = 0;
|
$error = 0;
|
||||||
|
|
||||||
if ((intval($debit) != 0) && (intval($credit) != 0)) {
|
if ((intval($debit) != 0) && (intval($credit) != 0)) {
|
||||||
setEventMessage($langs->trans('ErrorDebitCredit'), 'errors');
|
setEventMessages($langs->trans('ErrorDebitCredit'), null, 'errors');
|
||||||
$error ++;
|
$error ++;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -124,9 +124,9 @@ else if ($action == "add") {
|
|||||||
|
|
||||||
$result = $book->create_std($user);
|
$result = $book->create_std($user);
|
||||||
if ($result < 0) {
|
if ($result < 0) {
|
||||||
setEventMessage($book->errors, 'errors');
|
setEventMessages($book->error, $book->errors, 'errors');
|
||||||
} else {
|
} else {
|
||||||
setEventMessage($langs->trans('Saved'), 'mesgs');
|
setEventMessages($langs->trans('Saved'), null, 'mesgs');
|
||||||
$action = '';
|
$action = '';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -140,11 +140,11 @@ else if ($action == "confirm_delete") {
|
|||||||
$piece_num = $book->piece_num;
|
$piece_num = $book->piece_num;
|
||||||
|
|
||||||
if ($result < 0) {
|
if ($result < 0) {
|
||||||
setEventMessage($book->errors, 'errors');
|
setEventMessages($book->error, $book->errors, 'errors');
|
||||||
} else {
|
} else {
|
||||||
$result = $book->delete($user);
|
$result = $book->delete($user);
|
||||||
if ($result < 0) {
|
if ($result < 0) {
|
||||||
setEventMessage($book->errors, 'errors');
|
setEventMessages($book->error, $book->errors, 'errors');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$action = '';
|
$action = '';
|
||||||
@ -168,9 +168,9 @@ else if ($action == "confirm_create") {
|
|||||||
|
|
||||||
$result = $book->create_std($user);
|
$result = $book->create_std($user);
|
||||||
if ($result < 0) {
|
if ($result < 0) {
|
||||||
setEventMessage($book->errors, 'errors');
|
setEventMessages($book->error, $book->errors, 'errors');
|
||||||
} else {
|
} else {
|
||||||
setEventMessage($langs->trans('Saved'), 'mesgs');
|
setEventMessages($langs->trans('Saved'), null, 'mesgs');
|
||||||
$action = '';
|
$action = '';
|
||||||
$piece_num = $book->piece_num;
|
$piece_num = $book->piece_num;
|
||||||
}
|
}
|
||||||
@ -246,7 +246,7 @@ if ($action == 'create') {
|
|||||||
$book = new BookKeeping($db);
|
$book = new BookKeeping($db);
|
||||||
$result = $book->fetch_per_mvt($piece_num);
|
$result = $book->fetch_per_mvt($piece_num);
|
||||||
if ($result < 0) {
|
if ($result < 0) {
|
||||||
setEventMessage($book->errors, 'errors');
|
setEventMessages($book->error, $book->errors, 'errors');
|
||||||
}
|
}
|
||||||
if (! empty($book->piece_num)) {
|
if (! empty($book->piece_num)) {
|
||||||
|
|
||||||
@ -277,7 +277,7 @@ if ($action == 'create') {
|
|||||||
|
|
||||||
$result = $book->fetch_all_per_mvt($piece_num);
|
$result = $book->fetch_all_per_mvt($piece_num);
|
||||||
if ($result < 0) {
|
if ($result < 0) {
|
||||||
setEventMessage($book->errors, 'errors');
|
setEventMessages($book->error, $book->errors, 'errors');
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
print load_fiche_titre($langs->trans("ListeMvts"));
|
print load_fiche_titre($langs->trans("ListeMvts"));
|
||||||
|
|||||||
@ -74,7 +74,7 @@ if ($action == 'delbookkeeping') {
|
|||||||
$result = $object->delete_by_importkey($import_key);
|
$result = $object->delete_by_importkey($import_key);
|
||||||
Header("Location: list.php");
|
Header("Location: list.php");
|
||||||
if ($result < 0) {
|
if ($result < 0) {
|
||||||
setEventMessage($object->errors, 'errors');
|
setEventMessages($object->error, $object->errors, 'errors');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} // Export
|
} // Export
|
||||||
@ -86,7 +86,7 @@ else if ($action == 'export_csv') {
|
|||||||
$object = new BookKeeping($db);
|
$object = new BookKeeping($db);
|
||||||
$result = $object->export_bookkeping('ebp');
|
$result = $object->export_bookkeping('ebp');
|
||||||
if ($result < 0) {
|
if ($result < 0) {
|
||||||
setEventMessage($object->errors, 'errors');
|
setEventMessages($object->error, $object->errors, 'errors');
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach ( $object->linesexport as $line ) {
|
foreach ( $object->linesexport as $line ) {
|
||||||
|
|||||||
@ -54,7 +54,7 @@ if ($action == 'ventil' && $user->rights->accounting->ventilation->dispatch) {
|
|||||||
dol_syslog("/accounting/customer/card.php sql=" . $sql, LOG_DEBUG);
|
dol_syslog("/accounting/customer/card.php sql=" . $sql, LOG_DEBUG);
|
||||||
$resql = $db->query($sql);
|
$resql = $db->query($sql);
|
||||||
if (! $resql) {
|
if (! $resql) {
|
||||||
setEventMessage($db->lasterror(), 'errors');
|
setEventMessages($db->lasterror(), null, 'errors');
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
header("Location: ./lines.php");
|
header("Location: ./lines.php");
|
||||||
|
|||||||
@ -83,10 +83,10 @@ if ($action == 'validatehistory') {
|
|||||||
if (! $resql1) {
|
if (! $resql1) {
|
||||||
$error ++;
|
$error ++;
|
||||||
$db->rollback();
|
$db->rollback();
|
||||||
setEventMessage($db->lasterror(), 'errors');
|
setEventMessages($db->lasterror(), null, 'errors');
|
||||||
} else {
|
} else {
|
||||||
$db->commit();
|
$db->commit();
|
||||||
setEventMessage($langs->trans('Dispatched'), 'mesgs');
|
setEventMessages($langs->trans('Dispatched'), null, 'mesgs');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -346,4 +346,4 @@ print "</table>\n";
|
|||||||
print '</td></tr></table>';
|
print '</td></tr></table>';
|
||||||
|
|
||||||
llxFooter();
|
llxFooter();
|
||||||
$db->close();
|
$db->close();
|
||||||
|
|||||||
@ -109,14 +109,14 @@ if (is_array($changeaccount) && count($changeaccount) > 0) {
|
|||||||
$resql1 = $db->query($sql1);
|
$resql1 = $db->query($sql1);
|
||||||
if (! $resql1) {
|
if (! $resql1) {
|
||||||
$error ++;
|
$error ++;
|
||||||
setEventMessage($db->lasterror(), 'errors');
|
setEventMessages($db->lasterror(), null, 'errors');
|
||||||
}
|
}
|
||||||
if (! $error) {
|
if (! $error) {
|
||||||
$db->commit();
|
$db->commit();
|
||||||
setEventMessage($langs->trans('Save'), 'mesgs');
|
setEventMessages($langs->trans('Save'), null, 'mesgs');
|
||||||
} else {
|
} else {
|
||||||
$db->rollback();
|
$db->rollback();
|
||||||
setEventMessage($db->lasterror(), 'errors');
|
setEventMessages($db->lasterror(), null, 'errors');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -343,7 +343,7 @@ if ($action == 'writeBookKeeping')
|
|||||||
$result = $bookkeeping->create();
|
$result = $bookkeeping->create();
|
||||||
if ($result < 0) {
|
if ($result < 0) {
|
||||||
$error ++;
|
$error ++;
|
||||||
setEventMessage($object->errors, 'errors');
|
setEventMessages($object->error, $object->errors, 'errors');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Third party
|
// Third party
|
||||||
@ -420,13 +420,13 @@ if ($action == 'writeBookKeeping')
|
|||||||
$result = $bookkeeping->create();
|
$result = $bookkeeping->create();
|
||||||
if ($result < 0) {
|
if ($result < 0) {
|
||||||
$error ++;
|
$error ++;
|
||||||
setEventMessage($object->errors, 'errors');
|
setEventMessages($object->error, $object->errors, 'errors');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (empty($error)) {
|
if (empty($error)) {
|
||||||
setEventMessage($langs->trans("GeneralLedgerIsWritten"),'mesgs');
|
setEventMessages($langs->trans("GeneralLedgerIsWritten"), null, 'mesgs');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Export
|
// Export
|
||||||
|
|||||||
@ -185,7 +185,7 @@ if ($action == 'writebookkeeping') {
|
|||||||
$result = $bookkeeping->create();
|
$result = $bookkeeping->create();
|
||||||
if ($result < 0) {
|
if ($result < 0) {
|
||||||
$error ++;
|
$error ++;
|
||||||
setEventMessage($object->errors, 'errors');
|
setEventMessages($object->error, $object->errors, 'errors');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -215,7 +215,7 @@ if ($action == 'writebookkeeping') {
|
|||||||
$result = $bookkeeping->create();
|
$result = $bookkeeping->create();
|
||||||
if ($result < 0) {
|
if ($result < 0) {
|
||||||
$error ++;
|
$error ++;
|
||||||
setEventMessage($object->errors, 'errors');
|
setEventMessages($object->error, $object->errors, 'errors');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -246,14 +246,14 @@ if ($action == 'writebookkeeping') {
|
|||||||
$result = $bookkeeping->create();
|
$result = $bookkeeping->create();
|
||||||
if ($result < 0) {
|
if ($result < 0) {
|
||||||
$error ++;
|
$error ++;
|
||||||
setEventMessage($object->errors, 'errors');
|
setEventMessages($object->error, $object->errors, 'errors');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (empty($error)) {
|
if (empty($error)) {
|
||||||
setEventMessage($langs->trans("GeneralLedgerIsWritten"),'mesgs');
|
setEventMessages($langs->trans("GeneralLedgerIsWritten"), null, 'mesgs');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -220,7 +220,7 @@ if ($action == 'writebookkeeping')
|
|||||||
$result = $bookkeeping->create();
|
$result = $bookkeeping->create();
|
||||||
if ($result < 0) {
|
if ($result < 0) {
|
||||||
$error ++;
|
$error ++;
|
||||||
setEventMessage($object->errors, 'errors');
|
setEventMessages($object->error, $object->errors, 'errors');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -250,7 +250,7 @@ if ($action == 'writebookkeeping')
|
|||||||
$result = $bookkeeping->create();
|
$result = $bookkeeping->create();
|
||||||
if ($result < 0) {
|
if ($result < 0) {
|
||||||
$error ++;
|
$error ++;
|
||||||
setEventMessage($object->errors, 'errors');
|
setEventMessages($object->error, $object->errors, 'errors');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -282,14 +282,14 @@ if ($action == 'writebookkeeping')
|
|||||||
$result = $bookkeeping->create();
|
$result = $bookkeeping->create();
|
||||||
if ($result < 0) {
|
if ($result < 0) {
|
||||||
$error ++;
|
$error ++;
|
||||||
setEventMessage($object->errors, 'errors');
|
setEventMessages($object->error, $object->errors, 'errors');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (empty($error)) {
|
if (empty($error)) {
|
||||||
setEventMessage($langs->trans("GeneralLedgerIsWritten"),'mesgs');
|
setEventMessages($langs->trans("GeneralLedgerIsWritten"), null, 'mesgs');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -55,7 +55,7 @@ if ($action == 'ventil' && $user->rights->accounting->ventilation->dispatch) {
|
|||||||
dol_syslog('accountancy/supplier/card.php:: $sql=' . $sql);
|
dol_syslog('accountancy/supplier/card.php:: $sql=' . $sql);
|
||||||
$resql = $db->query($sql);
|
$resql = $db->query($sql);
|
||||||
if (! $resql) {
|
if (! $resql) {
|
||||||
setEventMessage($db->lasterror(), 'errors');
|
setEventMessages($db->lasterror(), null, 'errors');
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
header("Location: ./lines.php");
|
header("Location: ./lines.php");
|
||||||
|
|||||||
@ -79,10 +79,10 @@ if ($action == 'validatehistory') {
|
|||||||
if (! $resql1) {
|
if (! $resql1) {
|
||||||
$error ++;
|
$error ++;
|
||||||
$db->rollback();
|
$db->rollback();
|
||||||
setEventMessage($db->lasterror(), 'errors');
|
setEventMessages($db->lasterror(), null, 'errors');
|
||||||
} else {
|
} else {
|
||||||
$db->commit();
|
$db->commit();
|
||||||
setEventMessage($langs->trans('Dispatched'), 'mesgs');
|
setEventMessages($langs->trans('Dispatched'), null, 'mesgs');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -115,14 +115,14 @@ if (is_array($changeaccount) && count($changeaccount) > 0) {
|
|||||||
$resql1 = $db->query($sql1);
|
$resql1 = $db->query($sql1);
|
||||||
if (! $resql1) {
|
if (! $resql1) {
|
||||||
$error ++;
|
$error ++;
|
||||||
setEventMessage($db->lasterror(), 'errors');
|
setEventMessages($db->lasterror(), null, 'errors');
|
||||||
}
|
}
|
||||||
if (! $error) {
|
if (! $error) {
|
||||||
$db->commit();
|
$db->commit();
|
||||||
setEventMessage($langs->trans('Save'), 'mesgs');
|
setEventMessages($langs->trans('Save'), null, 'mesgs');
|
||||||
} else {
|
} else {
|
||||||
$db->rollback();
|
$db->rollback();
|
||||||
setEventMessage($db->lasterror(), 'errors');
|
setEventMessages($db->lasterror(), null, 'errors');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -7,7 +7,7 @@
|
|||||||
* 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) 2012 J. Fernando Lagrange <fernando@demo-tic.org>
|
* Copyright (C) 2012 J. Fernando Lagrange <fernando@demo-tic.org>
|
||||||
* Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr>
|
* Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr>
|
||||||
*
|
*
|
||||||
* 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
|
||||||
@ -69,11 +69,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');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -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');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -4,7 +4,7 @@
|
|||||||
* Copyright (C) 2004-2012 Laurent Destailleur <eldy@users.sourceforge.net>
|
* Copyright (C) 2004-2012 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) 2012 Marcos García <marcosgdf@gmail.com>
|
* Copyright (C) 2012 Marcos García <marcosgdf@gmail.com>
|
||||||
* Copyright (C) 2012-2013 Philippe Grand <philippe.grand@atoo-net.com>
|
* Copyright (C) 2012-2015 Philippe Grand <philippe.grand@atoo-net.com>
|
||||||
* Copyright (C) 2015 Alexandre Spangaro <aspangaro.dolibarr@gmail.com>
|
* Copyright (C) 2015 Alexandre Spangaro <aspangaro.dolibarr@gmail.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
|
||||||
@ -133,7 +133,7 @@ if (empty($reshook))
|
|||||||
if ($userid != $user->id && $userid != $object->user_id)
|
if ($userid != $user->id && $userid != $object->user_id)
|
||||||
{
|
{
|
||||||
$error++;
|
$error++;
|
||||||
setEventMessage($langs->trans("ErrorUserPermissionAllowsToLinksToItselfOnly"), 'errors');
|
setEventMessages($langs->trans("ErrorUserPermissionAllowsToLinksToItselfOnly"), null, 'errors');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -169,7 +169,7 @@ if (empty($reshook))
|
|||||||
$thirdparty=new Societe($db);
|
$thirdparty=new Societe($db);
|
||||||
$thirdparty->fetch($socid);
|
$thirdparty->fetch($socid);
|
||||||
$error++;
|
$error++;
|
||||||
setEventMessage($langs->trans("ErrorMemberIsAlreadyLinkedToThisThirdParty",$othermember->getFullName($langs),$othermember->login,$thirdparty->name), 'errors');
|
setEventMessages($langs->trans("ErrorMemberIsAlreadyLinkedToThisThirdParty",$othermember->getFullName($langs),$othermember->login,$thirdparty->name), null, 'errors');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -195,12 +195,12 @@ if (empty($reshook))
|
|||||||
if ($result < 0)
|
if ($result < 0)
|
||||||
{
|
{
|
||||||
$langs->load("errors");
|
$langs->load("errors");
|
||||||
setEventMessage($langs->trans($nuser->error), 'errors');
|
setEventMessages($langs->trans($nuser->error), null, 'errors');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
setEventMessage($object->error, 'errors');
|
setEventMessages($object->errors, $object->error, 'errors');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -216,13 +216,13 @@ if (empty($reshook))
|
|||||||
if ($result < 0)
|
if ($result < 0)
|
||||||
{
|
{
|
||||||
$langs->load("errors");
|
$langs->load("errors");
|
||||||
setEventMessage($langs->trans($company->error), 'errors');
|
setEventMessages($langs->trans($company->error), null, 'errors');
|
||||||
setEventMessage($company->errors, 'errors');
|
setEventMessages($company->error, $company->errors, 'errors');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
setEventMessage($object->error, 'errors');
|
setEventMessages($object->error, $object->errors, 'errors');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -236,7 +236,7 @@ if (empty($reshook))
|
|||||||
$result=$object->send_an_email($langs->transnoentitiesnoconv("ThisIsContentOfYourCard")."\n\n%INFOS%\n\n",$langs->transnoentitiesnoconv("CardContent"));
|
$result=$object->send_an_email($langs->transnoentitiesnoconv("ThisIsContentOfYourCard")."\n\n%INFOS%\n\n",$langs->transnoentitiesnoconv("CardContent"));
|
||||||
|
|
||||||
$langs->load("mails");
|
$langs->load("mails");
|
||||||
setEventMessage($langs->trans("MailSuccessfulySent", $from, $object->email));
|
setEventMessages($langs->trans("MailSuccessfulySent", $from, $object->email), null, 'mesgs');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -352,7 +352,7 @@ if (empty($reshook))
|
|||||||
$newfile=$dir.'/'.dol_sanitizeFileName($_FILES['photo']['name']);
|
$newfile=$dir.'/'.dol_sanitizeFileName($_FILES['photo']['name']);
|
||||||
if (! dol_move_uploaded_file($_FILES['photo']['tmp_name'],$newfile,1,0,$_FILES['photo']['error']) > 0)
|
if (! dol_move_uploaded_file($_FILES['photo']['tmp_name'],$newfile,1,0,$_FILES['photo']['error']) > 0)
|
||||||
{
|
{
|
||||||
setEventMessage($langs->trans("ErrorFailedToSaveFile"), 'errors');
|
setEventMessages($langs->trans("ErrorFailedToSaveFile"), null, 'errors');
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -368,7 +368,7 @@ if (empty($reshook))
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
setEventMessage("ErrorBadImageFormat", 'errors');
|
setEventMessages("ErrorBadImageFormat", null, 'errors');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -397,9 +397,9 @@ if (empty($reshook))
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
if ($object->error) {
|
if ($object->error) {
|
||||||
setEventMessage($object->error, 'errors');
|
setEventMessages($object->error, $object->errors, 'errors');
|
||||||
} else {
|
} else {
|
||||||
setEventMessage($object->errors, 'errors');
|
setEventMessages($object->error, $object->errors, 'errors');
|
||||||
}
|
}
|
||||||
$action='';
|
$action='';
|
||||||
}
|
}
|
||||||
@ -503,7 +503,7 @@ if (empty($reshook))
|
|||||||
if ($num) {
|
if ($num) {
|
||||||
$error++;
|
$error++;
|
||||||
$langs->load("errors");
|
$langs->load("errors");
|
||||||
setEventMessage($langs->trans("ErrorLoginAlreadyExists",$login), 'errors');
|
setEventMessages($langs->trans("ErrorLoginAlreadyExists",$login), null, 'errors');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (empty($pass)) {
|
if (empty($pass)) {
|
||||||
@ -528,7 +528,7 @@ if (empty($reshook))
|
|||||||
if ($conf->global->ADHERENT_MAIL_REQUIRED && ! isValidEMail($email)) {
|
if ($conf->global->ADHERENT_MAIL_REQUIRED && ! isValidEMail($email)) {
|
||||||
$error++;
|
$error++;
|
||||||
$langs->load("errors");
|
$langs->load("errors");
|
||||||
setEventMessage($langs->trans("ErrorBadEMail",$email), 'errors');
|
setEventMessages($langs->trans("ErrorBadEMail",$email), null, 'errors');
|
||||||
}
|
}
|
||||||
$public=0;
|
$public=0;
|
||||||
if (isset($public)) $public=1;
|
if (isset($public)) $public=1;
|
||||||
@ -554,9 +554,9 @@ if (empty($reshook))
|
|||||||
$db->rollback();
|
$db->rollback();
|
||||||
|
|
||||||
if ($object->error) {
|
if ($object->error) {
|
||||||
setEventMessage($object->error, 'errors');
|
setEventMessages($object->error, $object->errors, 'errors');
|
||||||
} else {
|
} else {
|
||||||
setEventMessage($object->errors, 'errors');
|
setEventMessages($object->error, $object->errors, 'errors');
|
||||||
}
|
}
|
||||||
|
|
||||||
$action = 'create';
|
$action = 'create';
|
||||||
@ -609,7 +609,7 @@ if (empty($reshook))
|
|||||||
if ($result < 0)
|
if ($result < 0)
|
||||||
{
|
{
|
||||||
$error++;
|
$error++;
|
||||||
setEventMessage($object->error, 'errors');
|
setEventMessages($object->error, $object->errors, 'errors');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -617,9 +617,9 @@ if (empty($reshook))
|
|||||||
{
|
{
|
||||||
$error++;
|
$error++;
|
||||||
if ($object->error) {
|
if ($object->error) {
|
||||||
setEventMessage($object->error, 'errors');
|
setEventMessages($object->error, $object->errors, 'errors');
|
||||||
} else {
|
} else {
|
||||||
setEventMessage($object->errors, 'errors');
|
setEventMessages($object->error, $object->errors, 'errors');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -654,7 +654,7 @@ if (empty($reshook))
|
|||||||
if ($result < 0)
|
if ($result < 0)
|
||||||
{
|
{
|
||||||
$error++;
|
$error++;
|
||||||
setEventMessage($object->error, 'errors');
|
setEventMessages($object->error, $object->errors, 'errors');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -662,9 +662,9 @@ if (empty($reshook))
|
|||||||
$error++;
|
$error++;
|
||||||
|
|
||||||
if ($object->error) {
|
if ($object->error) {
|
||||||
setEventMessage($object->error, 'errors');
|
setEventMessages($object->error, $object->errors, 'errors');
|
||||||
} else {
|
} else {
|
||||||
setEventMessage($object->errors, 'errors');
|
setEventMessages($object->error, $object->errors, 'errors');
|
||||||
}
|
}
|
||||||
$action='';
|
$action='';
|
||||||
}
|
}
|
||||||
@ -683,7 +683,7 @@ if (empty($reshook))
|
|||||||
{
|
{
|
||||||
if (!$mailmanspip->del_to_spip($object))
|
if (!$mailmanspip->del_to_spip($object))
|
||||||
{
|
{
|
||||||
setEventMessage($langs->trans('DeleteIntoSpipError').': '.$mailmanspip->error, 'errors');
|
setEventMessages($langs->trans('DeleteIntoSpipError').': '.$mailmanspip->error, null, 'errors');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -694,7 +694,7 @@ if (empty($reshook))
|
|||||||
{
|
{
|
||||||
if (!$mailmanspip->add_to_spip($object))
|
if (!$mailmanspip->add_to_spip($object))
|
||||||
{
|
{
|
||||||
setEventMessage($langs->trans('AddIntoSpipError').': '.$mailmanspip->error, 'errors');
|
setEventMessages($langs->trans('AddIntoSpipError').': '.$mailmanspip->error, null, 'errors');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -110,7 +110,7 @@ if ($action == 'confirm_create_thirdparty' && $confirm == 'yes' && $user->rights
|
|||||||
{
|
{
|
||||||
$langs->load("errors");
|
$langs->load("errors");
|
||||||
$errmsg=$langs->trans($company->error);
|
$errmsg=$langs->trans($company->error);
|
||||||
setEventMessage($company->errors, 'errors');
|
setEventMessages($company->error, $company->errors, 'errors');
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -131,7 +131,7 @@ if ($action == 'setuserid' && ($user->rights->user->self->creer || $user->rights
|
|||||||
if ($_POST["userid"] != $user->id && $_POST["userid"] != $object->user_id)
|
if ($_POST["userid"] != $user->id && $_POST["userid"] != $object->user_id)
|
||||||
{
|
{
|
||||||
$error++;
|
$error++;
|
||||||
setEventMessage($langs->trans("ErrorUserPermissionAllowsToLinksToItselfOnly"), 'errors');
|
setEventMessages($langs->trans("ErrorUserPermissionAllowsToLinksToItselfOnly"), null, 'errors');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -167,7 +167,7 @@ if ($action == 'setsocid')
|
|||||||
$thirdparty=new Societe($db);
|
$thirdparty=new Societe($db);
|
||||||
$thirdparty->fetch(GETPOST('socid','int'));
|
$thirdparty->fetch(GETPOST('socid','int'));
|
||||||
$error++;
|
$error++;
|
||||||
setEventMessage($langs->trans("ErrorMemberIsAlreadyLinkedToThisThirdParty",$othermember->getFullName($langs),$othermember->login,$thirdparty->name), 'errors');
|
setEventMessages($langs->trans("ErrorMemberIsAlreadyLinkedToThisThirdParty",$othermember->getFullName($langs),$othermember->login,$thirdparty->name), null, 'errors');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -1575,7 +1575,7 @@ class Adherent extends CommonObject
|
|||||||
|
|
||||||
$picto='user';
|
$picto='user';
|
||||||
|
|
||||||
if ($withpicto) $result.=($link.img_object($label, $picto, 'class="classfortooltip"').$linkend);
|
if ($withpicto) $result.=($link.img_object('', $picto, 'class="classfortooltip"').$linkend);
|
||||||
if ($withpicto && $withpicto != 2) $result.=' ';
|
if ($withpicto && $withpicto != 2) $result.=' ';
|
||||||
$result.=$link.($maxlen?dol_trunc($this->ref,$maxlen):$this->ref).$linkend;
|
$result.=$link.($maxlen?dol_trunc($this->ref,$maxlen):$this->ref).$linkend;
|
||||||
return $result;
|
return $result;
|
||||||
|
|||||||
@ -72,12 +72,12 @@ if ($action == 'dolibarr2ldap')
|
|||||||
|
|
||||||
if ($result >= 0)
|
if ($result >= 0)
|
||||||
{
|
{
|
||||||
setEventMessage($langs->trans("MemberSynchronized"));
|
setEventMessages($langs->trans("MemberSynchronized"), null, 'mesgs');
|
||||||
$db->commit();
|
$db->commit();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
setEventMessage($ldap->error, 'errors');
|
setEventMessages($ldap->errors, $ldap->error, 'errors');
|
||||||
$db->rollback();
|
$db->rollback();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -86,12 +86,12 @@ if ($action == "save" && empty($cancel))
|
|||||||
|
|
||||||
if (! $error)
|
if (! $error)
|
||||||
{
|
{
|
||||||
setEventMessage($langs->trans("SetupSaved"));
|
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
|
||||||
$db->commit();
|
$db->commit();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
setEventMessage($langs->trans("Error"),'errors');
|
setEventMessages($langs->trans("Error"),null, 'errors');
|
||||||
$db->rollback();
|
$db->rollback();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -72,7 +72,7 @@ if ($actionsave)
|
|||||||
|
|
||||||
if (! empty($src) && ! dol_is_url($src))
|
if (! empty($src) && ! dol_is_url($src))
|
||||||
{
|
{
|
||||||
setEventMessage($langs->trans("ErrorParamMustBeAnUrl"),'errors');
|
setEventMessages($langs->trans("ErrorParamMustBeAnUrl"), null, 'errors');
|
||||||
$error++;
|
$error++;
|
||||||
$errorsaved++;
|
$errorsaved++;
|
||||||
break;
|
break;
|
||||||
@ -104,12 +104,12 @@ if ($actionsave)
|
|||||||
if (! $error)
|
if (! $error)
|
||||||
{
|
{
|
||||||
$db->commit();
|
$db->commit();
|
||||||
setEventMessage($langs->trans("SetupSaved"));
|
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$db->rollback();
|
$db->rollback();
|
||||||
if (empty($errorsaved)) setEventMessage($langs->trans("Error"),'errors');
|
if (empty($errorsaved)) setEventMessages($langs->trans("Error"), null, 'errors');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -54,12 +54,12 @@ if ($actionsave)
|
|||||||
if ($i >= 4)
|
if ($i >= 4)
|
||||||
{
|
{
|
||||||
$db->commit();
|
$db->commit();
|
||||||
setEventMessage($langs->trans("SetupSaved"));
|
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$db->rollback();
|
$db->rollback();
|
||||||
setEventMessage($langs->trans("SaveFailed"), 'errors');
|
setEventMessages($langs->trans("SaveFailed"), null, 'errors');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -6,8 +6,8 @@
|
|||||||
* 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) 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) 2015 Jean-François Ferry <jfefe@aternatik.fr>
|
* Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr>
|
||||||
*
|
*
|
||||||
* 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
|
||||||
@ -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');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -96,13 +96,13 @@ if ($action == 'specimen')
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
setEventMessage($module->error,'errors');
|
setEventMessages($module->error, null, '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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -116,11 +116,11 @@ if ($action == 'set_ASKPRICESUPPLIER_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');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -134,11 +134,11 @@ if ($action == 'set_ASKPRICESUPPLIER_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');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -150,11 +150,11 @@ if ($action == 'set_BANK_ASK_PAYMENT_BANK_DURING_ASKPRICESUPPLIER')
|
|||||||
|
|
||||||
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');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -178,12 +178,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');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -56,11 +56,11 @@ if ($action == 'set_BANK_CHEQUERECEIPT_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');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -97,11 +97,11 @@ if ($action == 'setModuleOptions')
|
|||||||
|
|
||||||
if (! $error)
|
if (! $error)
|
||||||
{
|
{
|
||||||
setEventMessage($langs->trans("SetupSaved"));
|
setEventMessages($langs->trans("SetupSaved"), null, 'msgs');
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
setEventMessage($langs->trans("Error"),'errors');
|
setEventMessages($langs->trans("Error"), null, 'errors');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -111,11 +111,11 @@ if ($action && $action != 'setcoder' && $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');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -85,7 +85,7 @@ if ($action == 'add') {
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
setEventMessage($db->lasterror(), 'errors');
|
setEventMessages($db->lasterror(), null, 'errors');
|
||||||
$error++;
|
$error++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -121,7 +121,7 @@ if ($action == 'add') {
|
|||||||
$resql = $db->query($sql);
|
$resql = $db->query($sql);
|
||||||
if (! $resql)
|
if (! $resql)
|
||||||
{
|
{
|
||||||
setEventMessage($db->lasterror(), 'errors');
|
setEventMessages($db->lasterror(), null, 'errors');
|
||||||
$error++;
|
$error++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -36,16 +36,19 @@ $action = GETPOST("action");
|
|||||||
/*
|
/*
|
||||||
* Actions
|
* Actions
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if ($action == 'setvalue' && $user->admin)
|
if ($action == 'setvalue' && $user->admin)
|
||||||
{
|
{
|
||||||
$result=dolibarr_set_const($db, "CLICKTODIAL_URL", GETPOST("url"), 'chaine', 0, '', $conf->entity);
|
$result=dolibarr_set_const($db, "CLICKTODIAL_USE_TEL_LINK_ON_PHONE_NUMBERS", GETPOST("CLICKTODIAL_USE_TEL_LINK_ON_PHONE_NUMBERS"), 'chaine', 0, '', $conf->entity);
|
||||||
if ($result >= 0)
|
$result=dolibarr_set_const($db, "CLICKTODIAL_URL", GETPOST("CLICKTODIAL_URL"), 'chaine', 0, '', $conf->entity);
|
||||||
|
|
||||||
|
if ($result1 >= 0 && $result2 >= 0)
|
||||||
{
|
{
|
||||||
setEventMessage($langs->trans("SetupSaved"));
|
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
setEventMessage($langs->trans("Error"),'errors');
|
setEventMessages($langs->trans("Error"), null, 'errors');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -73,13 +76,22 @@ $var=true;
|
|||||||
|
|
||||||
print '<table class="noborder" width="100%">';
|
print '<table class="noborder" width="100%">';
|
||||||
print '<tr class="liste_titre">';
|
print '<tr class="liste_titre">';
|
||||||
print '<td width="120">'.$langs->trans("Name").'</td>';
|
print '<td>'.$langs->trans("Name").'</td>';
|
||||||
print '<td>'.$langs->trans("Value").'</td>';
|
print '<td>'.$langs->trans("Value").'</td>';
|
||||||
print "</tr>\n";
|
print "</tr>\n";
|
||||||
|
|
||||||
$var=!$var;
|
$var=!$var;
|
||||||
print '<tr '.$bc[$var].'><td valign="top">';
|
print '<tr '.$bc[$var].'><td>';
|
||||||
|
print $langs->trans("ClickToDialUseTelLink").'</td><td>';
|
||||||
|
print $form->selectyesno("CLICKTODIAL_USE_TEL_LINK_ON_PHONE_NUMBERS", $conf->global->CLICKTODIAL_USE_TEL_LINK_ON_PHONE_NUMBERS, 1).'<br>';
|
||||||
|
print '<br>';
|
||||||
|
print $langs->trans("ClickToDialUseTelLinkDesc");
|
||||||
|
print '</td></tr>';
|
||||||
|
|
||||||
|
$var=!$var;
|
||||||
|
print '<tr '.$bc[$var].'><td>';
|
||||||
print $langs->trans("DefaultLink").'</td><td>';
|
print $langs->trans("DefaultLink").'</td><td>';
|
||||||
print '<input size="92" type="text" name="url" value="'.$conf->global->CLICKTODIAL_URL.'"><br>';
|
print '<input size="92" type="text" name="CLICKTODIAL_URL"'.($conf->global->CLICKTODIAL_USE_TEL_LINK_ON_PHONE_NUMBERS?' disabled="disabled"':'').' value="'.$conf->global->CLICKTODIAL_URL.'"><br>';
|
||||||
print '<br>';
|
print '<br>';
|
||||||
print $langs->trans("ClickToDialUrlDesc").'<br>';
|
print $langs->trans("ClickToDialUrlDesc").'<br>';
|
||||||
print $langs->trans("Example").':<br>http://myphoneserver/mypage?login=__LOGIN__&password=__PASS__&caller=__PHONEFROM__&called=__PHONETO__';
|
print $langs->trans("Example").':<br>http://myphoneserver/mypage?login=__LOGIN__&password=__PASS__&caller=__PHONEFROM__&called=__PHONETO__';
|
||||||
|
|||||||
@ -7,7 +7,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>
|
||||||
* Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
|
* Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
@ -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');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -106,13 +106,13 @@ else if ($action == 'specimen')
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
setEventMessage($module->error,'errors');
|
setEventMessages($module->error, null, '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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -137,12 +137,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_COMMANDE_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');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -214,11 +214,11 @@ else if ($action == 'set_ORDER_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');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -228,9 +228,9 @@ else if ($action=="setshippableiconinlist") {
|
|||||||
$res = dolibarr_set_const($db, "SHIPPABLE_ORDER_ICON_IN_LIST", $setshippableiconinlist,'yesno',0,'',$conf->entity);
|
$res = dolibarr_set_const($db, "SHIPPABLE_ORDER_ICON_IN_LIST", $setshippableiconinlist,'yesno',0,'',$conf->entity);
|
||||||
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');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -243,11 +243,11 @@ else if ($action == 'set_BANK_ASK_PAYMENT_BANK_DURING_ORDER')
|
|||||||
|
|
||||||
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');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -260,11 +260,11 @@ else if ($action == 'set_WAREHOUSE_ASK_WAREHOUSE_DURING_ORDER')
|
|||||||
|
|
||||||
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');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -3,7 +3,7 @@
|
|||||||
* Copyright (C) 2004-2013 Laurent Destailleur <eldy@users.sourceforge.net>
|
* Copyright (C) 2004-2013 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) 2010-2014 Juanjo Menent <jmenent@2byte.es>
|
* Copyright (C) 2010-2014 Juanjo Menent <jmenent@2byte.es>
|
||||||
* Copyright (C) 2011 Philippe Grand <philippe.grand@atoo-net.com>
|
* Copyright (C) 2011-2015 Philippe Grand <philippe.grand@atoo-net.com>
|
||||||
* Copyright (C) 2015 Alexandre Spangaro <aspangaro.dolibarr@gmail.com>
|
* Copyright (C) 2015 Alexandre Spangaro <aspangaro.dolibarr@gmail.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
|
||||||
@ -125,19 +125,19 @@ if ( ($action == 'update' && empty($_POST["cancel"]))
|
|||||||
$error++;
|
$error++;
|
||||||
$langs->load("errors");
|
$langs->load("errors");
|
||||||
$tmparray=explode(':',$result);
|
$tmparray=explode(':',$result);
|
||||||
setEventMessage($langs->trans('ErrorFileIsInfectedWithAVirus',$tmparray[1]),'errors');
|
setEventMessages($langs->trans('ErrorFileIsInfectedWithAVirus',$tmparray[1]), null, 'errors');
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$error++;
|
$error++;
|
||||||
setEventMessage($langs->trans("ErrorFailedToSaveFile"),'errors');
|
setEventMessages($langs->trans("ErrorFailedToSaveFile"), null, 'errors');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$error++;
|
$error++;
|
||||||
$langs->load("errors");
|
$langs->load("errors");
|
||||||
setEventMessage($langs->trans("ErrorBadImageFormat"),'errors');
|
setEventMessages($langs->trans("ErrorBadImageFormat"), null, 'errors');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -230,7 +230,7 @@ if ($action == 'addthumb')
|
|||||||
{
|
{
|
||||||
$error++;
|
$error++;
|
||||||
$langs->load("errors");
|
$langs->load("errors");
|
||||||
setEventMessage($langs->trans("ErrorBadImageFormat"),'errors');
|
setEventMessages($langs->trans("ErrorBadImageFormat"), null, 'errors');
|
||||||
dol_syslog($langs->transnoentities("ErrorBadImageFormat"),LOG_WARNING);
|
dol_syslog($langs->transnoentities("ErrorBadImageFormat"),LOG_WARNING);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -238,7 +238,7 @@ if ($action == 'addthumb')
|
|||||||
{
|
{
|
||||||
$error++;
|
$error++;
|
||||||
$langs->load("errors");
|
$langs->load("errors");
|
||||||
setEventMessage($langs->trans("ErrorFileDoesNotExists",$_GET["file"]),'errors');
|
setEventMessages($langs->trans("ErrorFileDoesNotExists",$_GET["file"]), null, 'errors');
|
||||||
dol_syslog($langs->transnoentities("ErrorFileDoesNotExists",$_GET["file"]),LOG_WARNING);
|
dol_syslog($langs->transnoentities("ErrorFileDoesNotExists",$_GET["file"]),LOG_WARNING);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -3,7 +3,7 @@
|
|||||||
* Copyright (C) 2004-2008 Laurent Destailleur <eldy@users.sourceforge.net>
|
* Copyright (C) 2004-2008 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
* Copyright (C) 2005-2009 Regis Houssin <regis.houssin@capnetworks.com>
|
* Copyright (C) 2005-2009 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) 2013 Philippe Grand <philippe.grand@atoo-net.com>
|
* Copyright (C) 2013-2015 Philippe Grand <philippe.grand@atoo-net.com>
|
||||||
* Copyright (C) 2014 Marcos García <marcosgdf@gmail.com>
|
* Copyright (C) 2014 Marcos García <marcosgdf@gmail.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
|
||||||
@ -87,11 +87,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');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -68,7 +68,7 @@ if ($action == 'add' || (GETPOST('add') && $action != 'update'))
|
|||||||
{
|
{
|
||||||
if (dolibarr_set_const($db, $constname, $constvalue, 'chaine', 1, $constnote, $entity) >= 0)
|
if (dolibarr_set_const($db, $constname, $constvalue, 'chaine', 1, $constnote, $entity) >= 0)
|
||||||
{
|
{
|
||||||
setEventMessage($langs->trans("RecordSaved"));
|
setEventMessages($langs->trans("RecordSaved"), null, 'mesgs');
|
||||||
$action="";
|
$action="";
|
||||||
$constname="";
|
$constname="";
|
||||||
$constvalue="";
|
$constvalue="";
|
||||||
@ -99,7 +99,7 @@ if (! empty($consts) && $action == 'update')
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if ($nbmodified > 0) setEventMessage($langs->trans("RecordSaved"));
|
if ($nbmodified > 0) setEventMessages($langs->trans("RecordSaved"), null, 'mesgs');
|
||||||
$action='';
|
$action='';
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -122,7 +122,7 @@ if (! empty($consts) && $action == 'delete')
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if ($nbdeleted > 0) setEventMessage($langs->trans("RecordDeleted"));
|
if ($nbdeleted > 0) setEventMessages($langs->trans("RecordDeleted"), null, 'mesgs');
|
||||||
$action='';
|
$action='';
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -131,7 +131,7 @@ if ($action == 'delete')
|
|||||||
{
|
{
|
||||||
if (dolibarr_del_const($db, $rowid, $entity) >= 0)
|
if (dolibarr_del_const($db, $rowid, $entity) >= 0)
|
||||||
{
|
{
|
||||||
setEventMessage($langs->trans("RecordDeleted"));
|
setEventMessages($langs->trans("RecordDeleted"), null, 'mesgs');
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
/* Copyright (C) 2011-2013 Juanjo Menent <jmenent@2byte.es>
|
/* Copyright (C) 2011-2013 Juanjo Menent <jmenent@2byte.es>
|
||||||
* Copyright (C) 2011-2014 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
|
||||||
@ -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 @@ else if ($action == 'specimen') // For contract
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
setEventMessage($obj->error,'errors');
|
setEventMessages($obj->error, $obj->errors, 'errors');
|
||||||
dol_syslog($obj->error, LOG_ERR);
|
dol_syslog($obj->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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -132,12 +132,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');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -194,11 +194,11 @@ else if ($action == 'set_other')
|
|||||||
|
|
||||||
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');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -4,7 +4,7 @@
|
|||||||
* Copyright (C) 2004 Benoit Mortier <benoit.mortier@opensides.be>
|
* Copyright (C) 2004 Benoit Mortier <benoit.mortier@opensides.be>
|
||||||
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
|
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
|
||||||
* Copyright (C) 2010-2013 Juanjo Menent <jmenent@2byte.es>
|
* Copyright (C) 2010-2013 Juanjo Menent <jmenent@2byte.es>
|
||||||
* Copyright (C) 2011 Philippe Grand <philippe.grand@atoo-net.com>
|
* Copyright (C) 2011-2015 Philippe Grand <philippe.grand@atoo-net.com>
|
||||||
* Copyright (C) 2011 Remy Younes <ryounes@gmail.com>
|
* Copyright (C) 2011 Remy Younes <ryounes@gmail.com>
|
||||||
* Copyright (C) 2012-2015 Marcos García <marcosgdf@gmail.com>
|
* Copyright (C) 2012-2015 Marcos García <marcosgdf@gmail.com>
|
||||||
* Copyright (C) 2012 Christophe Battarel <christophe.battarel@ltairis.fr>
|
* Copyright (C) 2012 Christophe Battarel <christophe.battarel@ltairis.fr>
|
||||||
@ -548,20 +548,20 @@ if (GETPOST('actionadd') || GETPOST('actionmodify'))
|
|||||||
if ($fieldnamekey == 'deductible') $fieldnamekey = 'Deductible';
|
if ($fieldnamekey == 'deductible') $fieldnamekey = 'Deductible';
|
||||||
if ($fieldnamekey == 'sortorder') $fieldnamekey = 'SortOrder';
|
if ($fieldnamekey == 'sortorder') $fieldnamekey = 'SortOrder';
|
||||||
|
|
||||||
setEventMessage($langs->transnoentities("ErrorFieldRequired", $langs->transnoentities($fieldnamekey)),'errors');
|
setEventMessages($langs->transnoentities("ErrorFieldRequired", $langs->transnoentities($fieldnamekey)), null, 'errors');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Other checks
|
// Other checks
|
||||||
if ($tabname[$id] == MAIN_DB_PREFIX."c_actioncomm" && isset($_POST["type"]) && in_array($_POST["type"],array('system','systemauto'))) {
|
if ($tabname[$id] == MAIN_DB_PREFIX."c_actioncomm" && isset($_POST["type"]) && in_array($_POST["type"],array('system','systemauto'))) {
|
||||||
$ok=0;
|
$ok=0;
|
||||||
setEventMessage($langs->transnoentities('ErrorReservedTypeSystemSystemAuto'),'errors');
|
setEventMessages($langs->transnoentities('ErrorReservedTypeSystemSystemAuto'), null, 'errors');
|
||||||
}
|
}
|
||||||
if (isset($_POST["code"]))
|
if (isset($_POST["code"]))
|
||||||
{
|
{
|
||||||
if ($_POST["code"]=='0')
|
if ($_POST["code"]=='0')
|
||||||
{
|
{
|
||||||
$ok=0;
|
$ok=0;
|
||||||
setEventMessage($langs->transnoentities('ErrorCodeCantContainZero'),'errors');
|
setEventMessages($langs->transnoentities('ErrorCodeCantContainZero'), null, 'errors');
|
||||||
}
|
}
|
||||||
/*if (!is_numeric($_POST['code'])) // disabled, code may not be in numeric base
|
/*if (!is_numeric($_POST['code'])) // disabled, code may not be in numeric base
|
||||||
{
|
{
|
||||||
@ -578,7 +578,7 @@ if (GETPOST('actionadd') || GETPOST('actionmodify'))
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
$ok=0;
|
$ok=0;
|
||||||
setEventMessage($langs->transnoentities("ErrorFieldRequired",$langs->transnoentities("Country")),'errors');
|
setEventMessages($langs->transnoentities("ErrorFieldRequired",$langs->transnoentities("Country")), null, 'errors');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -637,13 +637,13 @@ if (GETPOST('actionadd') || GETPOST('actionmodify'))
|
|||||||
$result = $db->query($sql);
|
$result = $db->query($sql);
|
||||||
if ($result) // Add is ok
|
if ($result) // Add is ok
|
||||||
{
|
{
|
||||||
setEventMessage($langs->transnoentities("RecordSaved"));
|
setEventMessages($langs->transnoentities("RecordSaved"), null, 'mesgs');
|
||||||
$_POST=array('id'=>$id); // Clean $_POST array, we keep only
|
$_POST=array('id'=>$id); // Clean $_POST array, we keep only
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if ($db->errno() == 'DB_ERROR_RECORD_ALREADY_EXISTS') {
|
if ($db->errno() == 'DB_ERROR_RECORD_ALREADY_EXISTS') {
|
||||||
setEventMessage($langs->transnoentities("ErrorRecordAlreadyExists"),'errors');
|
setEventMessages($langs->transnoentities("ErrorRecordAlreadyExists"), null, 'errors');
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
dol_print_error($db);
|
dol_print_error($db);
|
||||||
@ -687,7 +687,7 @@ if (GETPOST('actionadd') || GETPOST('actionmodify'))
|
|||||||
$resql = $db->query($sql);
|
$resql = $db->query($sql);
|
||||||
if (! $resql)
|
if (! $resql)
|
||||||
{
|
{
|
||||||
setEventMessage($db->error(),'errors');
|
setEventMessage($db->error(), 'errors');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//$_GET["id"]=GETPOST('id', 'int'); // Force affichage dictionnaire en cours d'edition
|
//$_GET["id"]=GETPOST('id', 'int'); // Force affichage dictionnaire en cours d'edition
|
||||||
@ -711,7 +711,7 @@ if ($action == 'confirm_delete' && $confirm == 'yes') // delete
|
|||||||
{
|
{
|
||||||
if ($db->errno() == 'DB_ERROR_CHILD_EXISTS')
|
if ($db->errno() == 'DB_ERROR_CHILD_EXISTS')
|
||||||
{
|
{
|
||||||
setEventMessage($langs->transnoentities("ErrorRecordIsUsedByChild"),'errors');
|
setEventMessages($langs->transnoentities("ErrorRecordIsUsedByChild"), null, 'errors');
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|||||||
@ -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
|
||||||
{
|
{
|
||||||
|
|||||||
@ -47,11 +47,14 @@ $action = GETPOST('action');
|
|||||||
if (! defined("MAIN_MOTD")) define("MAIN_MOTD","");
|
if (! defined("MAIN_MOTD")) define("MAIN_MOTD","");
|
||||||
|
|
||||||
// List of supported permanent search area
|
// List of supported permanent search area
|
||||||
$searchform=array("MAIN_SEARCHFORM_SOCIETE", "MAIN_SEARCHFORM_CONTACT", "MAIN_SEARCHFORM_PRODUITSERVICE", "MAIN_SEARCHFORM_PRODUITSERVICE_SUPPLIER", "MAIN_SEARCHFORM_ADHERENT", "MAIN_SEARCHFORM_PROJECT", "MAIN_SEARCHFORM_EMPLOYEE");
|
$searchform=array();
|
||||||
$searchformconst=array($conf->global->MAIN_SEARCHFORM_SOCIETE,$conf->global->MAIN_SEARCHFORM_CONTACT,$conf->global->MAIN_SEARCHFORM_PRODUITSERVICE,$conf->global->MAIN_SEARCHFORM_PRODUITSERVICE_SUPPLIER,$conf->global->MAIN_SEARCHFORM_ADHERENT,$conf->global->MAIN_SEARCHFORM_PROJECT,$conf->global->MAIN_SEARCHFORM_EMPLOYEE);
|
if (empty($conf->use_javascript_ajax))
|
||||||
$searchformtitle=array($langs->trans("Companies"), $langs->trans("Contacts"), $langs->trans("ProductsAndServices"), $langs->trans("ProductsAndServices").' ('.$langs->trans("SupplierRef").')', $langs->trans("Members"), $langs->trans("Projects"), $langs->trans("Employees"));
|
{
|
||||||
$searchformmodule=array('Module1Name','Module1Name','Module50Name','Module50Name','Module310Name','Module4000Name');
|
$searchform=array("MAIN_SEARCHFORM_SOCIETE", "MAIN_SEARCHFORM_CONTACT", "MAIN_SEARCHFORM_PRODUITSERVICE", "MAIN_SEARCHFORM_PRODUITSERVICE_SUPPLIER", "MAIN_SEARCHFORM_ADHERENT", "MAIN_SEARCHFORM_PROJECT", "MAIN_SEARCHFORM_EMPLOYEE");
|
||||||
|
$searchformconst=array($conf->global->MAIN_SEARCHFORM_SOCIETE,$conf->global->MAIN_SEARCHFORM_CONTACT,$conf->global->MAIN_SEARCHFORM_PRODUITSERVICE,$conf->global->MAIN_SEARCHFORM_PRODUITSERVICE_SUPPLIER,$conf->global->MAIN_SEARCHFORM_ADHERENT,$conf->global->MAIN_SEARCHFORM_PROJECT,$conf->global->MAIN_SEARCHFORM_EMPLOYEE);
|
||||||
|
$searchformtitle=array($langs->trans("Companies"), $langs->trans("Contacts"), $langs->trans("ProductsAndServices"), $langs->trans("ProductsAndServices").' ('.$langs->trans("SupplierRef").')', $langs->trans("Members"), $langs->trans("Projects"), $langs->trans("Users"));
|
||||||
|
$searchformmodule=array('Module1Name','Module1Name','Module50Name','Module50Name','Module310Name','Module400Name');
|
||||||
|
}
|
||||||
|
|
||||||
if ($action == 'update')
|
if ($action == 'update')
|
||||||
{
|
{
|
||||||
@ -78,6 +81,7 @@ if ($action == 'update')
|
|||||||
if ($val == '') dolibarr_del_const($db, 'THEME_ELDY_BACKTITLE1', $conf->entity);
|
if ($val == '') dolibarr_del_const($db, 'THEME_ELDY_BACKTITLE1', $conf->entity);
|
||||||
else dolibarr_set_const($db, 'THEME_ELDY_BACKTITLE1', join(',',colorStringToArray(GETPOST('THEME_ELDY_BACKTITLE1'),array())),'chaine',0,'',$conf->entity);
|
else dolibarr_set_const($db, 'THEME_ELDY_BACKTITLE1', join(',',colorStringToArray(GETPOST('THEME_ELDY_BACKTITLE1'),array())),'chaine',0,'',$conf->entity);
|
||||||
|
|
||||||
|
/*
|
||||||
dolibarr_set_const($db, "MAIN_SEARCHFORM_CONTACT", $_POST["MAIN_SEARCHFORM_CONTACT"],'chaine',0,'',$conf->entity);
|
dolibarr_set_const($db, "MAIN_SEARCHFORM_CONTACT", $_POST["MAIN_SEARCHFORM_CONTACT"],'chaine',0,'',$conf->entity);
|
||||||
dolibarr_set_const($db, "MAIN_SEARCHFORM_SOCIETE", $_POST["MAIN_SEARCHFORM_SOCIETE"],'chaine',0,'',$conf->entity);
|
dolibarr_set_const($db, "MAIN_SEARCHFORM_SOCIETE", $_POST["MAIN_SEARCHFORM_SOCIETE"],'chaine',0,'',$conf->entity);
|
||||||
dolibarr_set_const($db, "MAIN_SEARCHFORM_PRODUITSERVICE", $_POST["MAIN_SEARCHFORM_PRODUITSERVICE"],'chaine',0,'',$conf->entity);
|
dolibarr_set_const($db, "MAIN_SEARCHFORM_PRODUITSERVICE", $_POST["MAIN_SEARCHFORM_PRODUITSERVICE"],'chaine',0,'',$conf->entity);
|
||||||
@ -85,7 +89,8 @@ if ($action == 'update')
|
|||||||
dolibarr_set_const($db, "MAIN_SEARCHFORM_ADHERENT", $_POST["MAIN_SEARCHFORM_ADHERENT"],'chaine',0,'',$conf->entity);
|
dolibarr_set_const($db, "MAIN_SEARCHFORM_ADHERENT", $_POST["MAIN_SEARCHFORM_ADHERENT"],'chaine',0,'',$conf->entity);
|
||||||
dolibarr_set_const($db, "MAIN_SEARCHFORM_PROJECT", $_POST["MAIN_SEARCHFORM_PROJECT"],'chaine',0,'',$conf->entity);
|
dolibarr_set_const($db, "MAIN_SEARCHFORM_PROJECT", $_POST["MAIN_SEARCHFORM_PROJECT"],'chaine',0,'',$conf->entity);
|
||||||
dolibarr_set_const($db, "MAIN_SEARCHFORM_EMPLOYEE", $_POST["MAIN_SEARCHFORM_EMPLOYEE"],'chaine',0,'',$conf->entity);
|
dolibarr_set_const($db, "MAIN_SEARCHFORM_EMPLOYEE", $_POST["MAIN_SEARCHFORM_EMPLOYEE"],'chaine',0,'',$conf->entity);
|
||||||
|
*/
|
||||||
|
|
||||||
dolibarr_set_const($db, "MAIN_HELPCENTER_DISABLELINK", $_POST["MAIN_HELPCENTER_DISABLELINK"],'chaine',0,'',0); // Param for all entities
|
dolibarr_set_const($db, "MAIN_HELPCENTER_DISABLELINK", $_POST["MAIN_HELPCENTER_DISABLELINK"],'chaine',0,'',0); // Param for all entities
|
||||||
dolibarr_set_const($db, "MAIN_MOTD", dol_htmlcleanlastbr($_POST["main_motd"]),'chaine',0,'',$conf->entity);
|
dolibarr_set_const($db, "MAIN_MOTD", dol_htmlcleanlastbr($_POST["main_motd"]),'chaine',0,'',$conf->entity);
|
||||||
dolibarr_set_const($db, "MAIN_HOME", dol_htmlcleanlastbr($_POST["main_home"]),'chaine',0,'',$conf->entity);
|
dolibarr_set_const($db, "MAIN_HOME", dol_htmlcleanlastbr($_POST["main_home"]),'chaine',0,'',$conf->entity);
|
||||||
@ -164,19 +169,22 @@ if ($action == 'edit') // Edit
|
|||||||
print '<br>';
|
print '<br>';
|
||||||
|
|
||||||
// Liste des zone de recherche permanantes supportees
|
// Liste des zone de recherche permanantes supportees
|
||||||
print '<table summary="search" class="noborder" width="100%">';
|
if (! empty($searchform))
|
||||||
print '<tr class="liste_titre"><td width="35%">'.$langs->trans("PermanentLeftSearchForm").'</td><td colspan="2">'.$langs->trans("Activated").'</td></tr>';
|
|
||||||
$var=True;
|
|
||||||
foreach ($searchform as $key => $value)
|
|
||||||
{
|
{
|
||||||
$var=!$var;
|
print '<table summary="search" class="noborder" width="100%">';
|
||||||
print '<tr '.$bc[$var].'><td width="35%">'.$searchformtitle[$key].'</td><td colspan="2">';
|
print '<tr class="liste_titre"><td width="35%">'.$langs->trans("PermanentLeftSearchForm").'</td><td colspan="2">'.$langs->trans("Activated").'</td></tr>';
|
||||||
print $form->selectyesno($searchform[$key],$searchformconst[$key],1);
|
$var=True;
|
||||||
print '</td></tr>';
|
foreach ($searchform as $key => $value)
|
||||||
|
{
|
||||||
|
$var=!$var;
|
||||||
|
print '<tr '.$bc[$var].'><td width="35%">'.$searchformtitle[$key].'</td><td colspan="2">';
|
||||||
|
print $form->selectyesno($searchform[$key],$searchformconst[$key],1);
|
||||||
|
print '</td></tr>';
|
||||||
|
}
|
||||||
|
print '</table>';
|
||||||
|
print '<br>';
|
||||||
}
|
}
|
||||||
print '</table>';
|
|
||||||
print '<br>';
|
|
||||||
|
|
||||||
// Other
|
// Other
|
||||||
print '<table summary="edit" class="noborder" width="100%">';
|
print '<table summary="edit" class="noborder" width="100%">';
|
||||||
print '<tr class="liste_titre"><td width="35%">'.$langs->trans("Parameters").'</td><td>'.$langs->trans("Value").'</td>';
|
print '<tr class="liste_titre"><td width="35%">'.$langs->trans("Parameters").'</td><td>'.$langs->trans("Value").'</td>';
|
||||||
@ -209,7 +217,7 @@ if ($action == 'edit') // Edit
|
|||||||
|
|
||||||
// Max size of short lists on customer card
|
// Max size of short lists on customer card
|
||||||
$var=!$var;
|
$var=!$var;
|
||||||
print '<tr '.$bc[$var].'><td>'.$langs->trans("DefaultMaxSizeShortListCustomerCard").'</td><td><input class="flat" name="main_size_shortliste_limit" size="4" value="' . $conf->global->MAIN_SIZE_SHORTLISTE_LIMIT . '"></td>';
|
print '<tr '.$bc[$var].'><td>'.$langs->trans("DefaultMaxSizeShortList").'</td><td><input class="flat" name="main_size_shortliste_limit" size="4" value="' . $conf->global->MAIN_SIZE_SHORTLISTE_LIMIT . '"></td>';
|
||||||
print '<td width="20"> </td>';
|
print '<td width="20"> </td>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
|
|
||||||
@ -357,20 +365,23 @@ else // Show
|
|||||||
print '<br>';
|
print '<br>';
|
||||||
|
|
||||||
|
|
||||||
// Liste des zone de recherches permanentes supportees
|
// List of search forms to show
|
||||||
print '<table class="noborder" width="100%">';
|
if (! empty($searchform))
|
||||||
print '<tr class="liste_titre"><td width="35%">'.$langs->trans("PermanentLeftSearchForm").'</td><td>'.$langs->trans("Activated").'</td><td> </td></tr>';
|
|
||||||
$var=true;
|
|
||||||
foreach ($searchform as $key => $value)
|
|
||||||
{
|
{
|
||||||
$var=!$var;
|
print '<table class="noborder" width="100%">';
|
||||||
print '<tr '.$bc[$var].'><td width="35%">'.$searchformtitle[$key].'</td><td>'.yn($searchformconst[$key]).'</td>';
|
print '<tr class="liste_titre"><td width="35%">'.$langs->trans("PermanentLeftSearchForm").'</td><td>'.$langs->trans("Activated").'</td><td> </td></tr>';
|
||||||
print '<td align="left">'.$langs->trans("IfModuleEnabled",$langs->transnoentitiesnoconv($searchformmodule[$key]));
|
$var=true;
|
||||||
print '</td></tr>';
|
foreach ($searchform as $key => $value)
|
||||||
|
{
|
||||||
|
$var=!$var;
|
||||||
|
print '<tr '.$bc[$var].'><td width="35%">'.$searchformtitle[$key].'</td><td>'.yn($searchformconst[$key]).'</td>';
|
||||||
|
print '<td align="left">';
|
||||||
|
if (! empty($searchformmodule[$key])) print $langs->trans("IfModuleEnabled",$langs->transnoentitiesnoconv($searchformmodule[$key]));
|
||||||
|
print '</td></tr>';
|
||||||
|
}
|
||||||
|
print '</table>';
|
||||||
|
print '<br>';
|
||||||
}
|
}
|
||||||
print '</table>';
|
|
||||||
print '<br>';
|
|
||||||
|
|
||||||
|
|
||||||
// Other
|
// Other
|
||||||
$var=true;
|
$var=true;
|
||||||
@ -396,7 +407,7 @@ else // Show
|
|||||||
print "</tr>";
|
print "</tr>";
|
||||||
|
|
||||||
$var=!$var;
|
$var=!$var;
|
||||||
print '<tr '.$bc[$var].'><td>'.$langs->trans("DefaultMaxSizeShortListCustomerCard").'</td><td>' . $conf->global->MAIN_SIZE_SHORTLISTE_LIMIT . '</td>';
|
print '<tr '.$bc[$var].'><td>'.$langs->trans("DefaultMaxSizeShortList").'</td><td>' . $conf->global->MAIN_SIZE_SHORTLISTE_LIMIT . '</td>';
|
||||||
print '<td width="20"> </td>';
|
print '<td width="20"> </td>';
|
||||||
print "</tr>";
|
print "</tr>";
|
||||||
|
|
||||||
|
|||||||
@ -78,16 +78,16 @@ if ($action == 'update')
|
|||||||
$result=$menu->update($user);
|
$result=$menu->update($user);
|
||||||
if ($result > 0)
|
if ($result > 0)
|
||||||
{
|
{
|
||||||
setEventMessage($langs->trans("RecordModifiedSuccessfully"));
|
setEventMessages($langs->trans("RecordModifiedSuccessfully"), null, 'mesgs');
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
setEventMessage($menu->error, 'errors');
|
setEventMessages($menu->error, $menu->errors, 'errors');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
setEventMessage($menu->error, 'errors');
|
setEventMessages($menu->error, $menu->errors, 'errors');
|
||||||
}
|
}
|
||||||
$_GET["menuId"] = $_POST['menuId'];
|
$_GET["menuId"] = $_POST['menuId'];
|
||||||
$action = "edit";
|
$action = "edit";
|
||||||
@ -159,13 +159,13 @@ if ($action == 'add')
|
|||||||
}
|
}
|
||||||
if (! $error && $_POST['menuId'] && $_POST['type'] == 'top')
|
if (! $error && $_POST['menuId'] && $_POST['type'] == 'top')
|
||||||
{
|
{
|
||||||
setEventMessage($langs->trans("ErrorTopMenuMustHaveAParentWithId0"), 'errors');
|
setEventMessages($langs->trans("ErrorTopMenuMustHaveAParentWithId0"), null, 'errors');
|
||||||
$action = 'create';
|
$action = 'create';
|
||||||
$error++;
|
$error++;
|
||||||
}
|
}
|
||||||
if (! $error && empty($_POST['menuId']) && $_POST['type'] == 'left')
|
if (! $error && empty($_POST['menuId']) && $_POST['type'] == 'left')
|
||||||
{
|
{
|
||||||
setEventMessage($langs->trans("ErrorLeftMenuMustHaveAParentId"), 'errors');
|
setEventMessages($langs->trans("ErrorLeftMenuMustHaveAParentId"), null, 'errors');
|
||||||
$action = 'create';
|
$action = 'create';
|
||||||
$error++;
|
$error++;
|
||||||
}
|
}
|
||||||
@ -204,7 +204,7 @@ if ($action == 'add')
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
$action = 'create';
|
$action = 'create';
|
||||||
setEventMessage($menu->error, 'errors');
|
setEventMessages($menu->error, $menu->errors, 'errors');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -222,7 +222,7 @@ if ($action == 'confirm_delete' && $_POST["confirm"] == 'yes')
|
|||||||
$this->db->commit();
|
$this->db->commit();
|
||||||
|
|
||||||
llxHeader();
|
llxHeader();
|
||||||
setEventMessage($langs->trans("MenuDeleted"));
|
setEventMessages($langs->trans("MenuDeleted"), null, 'mesgs');
|
||||||
llxFooter();
|
llxFooter();
|
||||||
exit ;
|
exit ;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -186,7 +186,7 @@ elseif ($action == 'confirm_delete' && $confirm == 'yes')
|
|||||||
{
|
{
|
||||||
$db->commit();
|
$db->commit();
|
||||||
|
|
||||||
setEventMessage($langs->trans("MenuDeleted"));
|
setEventMessages($langs->trans("MenuDeleted"), null, 'mesgs');
|
||||||
|
|
||||||
header("Location: ".DOL_URL_ROOT.'/admin/menus/index.php?menu_handler='.$menu_handler);
|
header("Location: ".DOL_URL_ROOT.'/admin/menus/index.php?menu_handler='.$menu_handler);
|
||||||
exit ;
|
exit ;
|
||||||
@ -359,7 +359,7 @@ if ($conf->use_javascript_ajax)
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
$langs->load("errors");
|
$langs->load("errors");
|
||||||
setEventMessage($langs->trans("ErrorFeatureNeedJavascript"), 'errors');
|
setEventMessages($langs->trans("ErrorFeatureNeedJavascript"), null, 'errors');
|
||||||
}
|
}
|
||||||
|
|
||||||
print '<br>';
|
print '<br>';
|
||||||
|
|||||||
@ -141,58 +141,75 @@ $var=true;
|
|||||||
|
|
||||||
$found=0;
|
$found=0;
|
||||||
|
|
||||||
|
$var=!$var;
|
||||||
|
print "<tr ".$bc[$var].">";
|
||||||
|
print '<td width="60%">'.$langs->trans("DeStockOnBill").'</td>';
|
||||||
|
print '<td width="160" align="right">';
|
||||||
if (! empty($conf->facture->enabled))
|
if (! empty($conf->facture->enabled))
|
||||||
{
|
{
|
||||||
$var=!$var;
|
print "<form method=\"post\" action=\"stock.php\">";
|
||||||
print "<tr ".$bc[$var].">";
|
|
||||||
print '<td width="60%">'.$langs->trans("DeStockOnBill").'</td>';
|
|
||||||
print '<td width="160" align="right">';
|
|
||||||
print "<form method=\"post\" action=\"stock.php\">";
|
|
||||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||||
print "<input type=\"hidden\" name=\"action\" value=\"STOCK_CALCULATE_ON_BILL\">";
|
print "<input type=\"hidden\" name=\"action\" value=\"STOCK_CALCULATE_ON_BILL\">";
|
||||||
print $form->selectyesno("STOCK_CALCULATE_ON_BILL",$conf->global->STOCK_CALCULATE_ON_BILL,1,$disabled);
|
print $form->selectyesno("STOCK_CALCULATE_ON_BILL",$conf->global->STOCK_CALCULATE_ON_BILL,1,$disabled);
|
||||||
print '<input type="submit" class="button" value="'.$langs->trans("Modify").'"'.$disabled.'>';
|
print '<input type="submit" class="button" value="'.$langs->trans("Modify").'"'.$disabled.'>';
|
||||||
print "</form>\n</td>\n</tr>\n";
|
print "</form>\n";
|
||||||
$found++;
|
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
print $langs->trans("ModuleMustBeEnabledFirst", $langs->transnoentitiesnoconv("Module30Name"));
|
||||||
|
}
|
||||||
|
print "</td>\n</tr>\n";
|
||||||
|
$found++;
|
||||||
|
|
||||||
|
$var=!$var;
|
||||||
|
print "<tr ".$bc[$var].">";
|
||||||
|
print '<td width="60%">'.$langs->trans("DeStockOnValidateOrder").'</td>';
|
||||||
|
print '<td width="160" align="right">';
|
||||||
if (! empty($conf->commande->enabled))
|
if (! empty($conf->commande->enabled))
|
||||||
{
|
{
|
||||||
$var=!$var;
|
print "<form method=\"post\" action=\"stock.php\">";
|
||||||
print "<tr ".$bc[$var].">";
|
|
||||||
print '<td width="60%">'.$langs->trans("DeStockOnValidateOrder").'</td>';
|
|
||||||
print '<td width="160" align="right">';
|
|
||||||
print "<form method=\"post\" action=\"stock.php\">";
|
|
||||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||||
print "<input type=\"hidden\" name=\"action\" value=\"STOCK_CALCULATE_ON_VALIDATE_ORDER\">";
|
print "<input type=\"hidden\" name=\"action\" value=\"STOCK_CALCULATE_ON_VALIDATE_ORDER\">";
|
||||||
print $form->selectyesno("STOCK_CALCULATE_ON_VALIDATE_ORDER",$conf->global->STOCK_CALCULATE_ON_VALIDATE_ORDER,1,$disabled);
|
print $form->selectyesno("STOCK_CALCULATE_ON_VALIDATE_ORDER",$conf->global->STOCK_CALCULATE_ON_VALIDATE_ORDER,1,$disabled);
|
||||||
print '<input type="submit" class="button" value="'.$langs->trans("Modify").'"'.$disabled.'>';
|
print '<input type="submit" class="button" value="'.$langs->trans("Modify").'"'.$disabled.'>';
|
||||||
print "</form>\n</td>\n</tr>\n";
|
print "</form>\n";
|
||||||
$found++;
|
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
print $langs->trans("ModuleMustBeEnabledFirst", $langs->transnoentitiesnoconv("Module25Name"));
|
||||||
|
}
|
||||||
|
print "</td>\n</tr>\n";
|
||||||
|
$found++;
|
||||||
|
|
||||||
|
//if (! empty($conf->expedition->enabled))
|
||||||
|
//{
|
||||||
|
$var=!$var;
|
||||||
|
print "<tr ".$bc[$var].">";
|
||||||
|
print '<td width="60%">'.$langs->trans("DeStockOnShipment").'</td>';
|
||||||
|
print '<td width="160" align="right">';
|
||||||
if (! empty($conf->expedition->enabled))
|
if (! empty($conf->expedition->enabled))
|
||||||
{
|
{
|
||||||
$var=!$var;
|
|
||||||
print "<tr ".$bc[$var].">";
|
|
||||||
print '<td width="60%">'.$langs->trans("DeStockOnShipment").'</td>';
|
|
||||||
print '<td width="160" align="right">';
|
|
||||||
print "<form method=\"post\" action=\"stock.php\">";
|
print "<form method=\"post\" action=\"stock.php\">";
|
||||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||||
print "<input type=\"hidden\" name=\"action\" value=\"STOCK_CALCULATE_ON_SHIPMENT\">";
|
print "<input type=\"hidden\" name=\"action\" value=\"STOCK_CALCULATE_ON_SHIPMENT\">";
|
||||||
print $form->selectyesno("STOCK_CALCULATE_ON_SHIPMENT",$conf->global->STOCK_CALCULATE_ON_SHIPMENT,1,$disabled);
|
print $form->selectyesno("STOCK_CALCULATE_ON_SHIPMENT",$conf->global->STOCK_CALCULATE_ON_SHIPMENT,1,$disabled);
|
||||||
print '<input type="submit" class="button" value="'.$langs->trans("Modify").'"'.$disabled.'>';
|
print '<input type="submit" class="button" value="'.$langs->trans("Modify").'"'.$disabled.'>';
|
||||||
print "</form>\n</td>\n</tr>\n";
|
print "</form>\n";
|
||||||
$found++;
|
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
print $langs->trans("ModuleMustBeEnabledFirst", $langs->transnoentitiesnoconv("Module80Name"));
|
||||||
|
}
|
||||||
|
print "</td>\n</tr>\n";
|
||||||
|
$found++;
|
||||||
|
|
||||||
if (! $found)
|
/*if (! $found)
|
||||||
{
|
{
|
||||||
$var=!$var;
|
$var=!$var;
|
||||||
print "<tr ".$bc[$var].">";
|
print "<tr ".$bc[$var].">";
|
||||||
print '<td colspan="2">'.$langs->trans("NoModueToManageStockDecrease").'</td>';
|
print '<td colspan="2">'.$langs->trans("NoModuleToManageStockDecrease").'</td>';
|
||||||
print "</tr>\n";
|
print "</tr>\n";
|
||||||
}
|
}*/
|
||||||
|
|
||||||
print '</table>';
|
print '</table>';
|
||||||
|
|
||||||
@ -208,57 +225,74 @@ $var=true;
|
|||||||
|
|
||||||
$found=0;
|
$found=0;
|
||||||
|
|
||||||
|
$var=!$var;
|
||||||
|
print "<tr ".$bc[$var].">";
|
||||||
|
print '<td width="60%">'.$langs->trans("ReStockOnBill").'</td>';
|
||||||
|
print '<td width="160" align="right">';
|
||||||
if (! empty($conf->fournisseur->enabled))
|
if (! empty($conf->fournisseur->enabled))
|
||||||
{
|
{
|
||||||
$var=!$var;
|
print "<form method=\"post\" action=\"stock.php\">";
|
||||||
print "<tr ".$bc[$var].">";
|
|
||||||
print '<td width="60%">'.$langs->trans("ReStockOnBill").'</td>';
|
|
||||||
print '<td width="160" align="right">';
|
|
||||||
print "<form method=\"post\" action=\"stock.php\">";
|
|
||||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||||
print "<input type=\"hidden\" name=\"action\" value=\"STOCK_CALCULATE_ON_SUPPLIER_BILL\">";
|
print "<input type=\"hidden\" name=\"action\" value=\"STOCK_CALCULATE_ON_SUPPLIER_BILL\">";
|
||||||
print $form->selectyesno("STOCK_CALCULATE_ON_SUPPLIER_BILL",$conf->global->STOCK_CALCULATE_ON_SUPPLIER_BILL,1,$disabled);
|
print $form->selectyesno("STOCK_CALCULATE_ON_SUPPLIER_BILL",$conf->global->STOCK_CALCULATE_ON_SUPPLIER_BILL,1,$disabled);
|
||||||
print '<input type="submit" class="button" value="'.$langs->trans("Modify").'"'.$disabled.'>';
|
print '<input type="submit" class="button" value="'.$langs->trans("Modify").'"'.$disabled.'>';
|
||||||
print "</form>\n</td>\n</tr>\n";
|
print "</form>\n";
|
||||||
$found++;
|
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
print $langs->trans("ModuleMustBeEnabledFirst", $langs->transnoentitiesnoconv("Module40Name"));
|
||||||
|
}
|
||||||
|
print "</td>\n</tr>\n";
|
||||||
|
$found++;
|
||||||
|
|
||||||
|
|
||||||
|
$var=!$var;
|
||||||
|
print "<tr ".$bc[$var].">";
|
||||||
|
print '<td width="60%">'.$langs->trans("ReStockOnValidateOrder").'</td>';
|
||||||
|
print '<td width="160" align="right">';
|
||||||
if (! empty($conf->fournisseur->enabled))
|
if (! empty($conf->fournisseur->enabled))
|
||||||
{
|
{
|
||||||
$var=!$var;
|
print "<form method=\"post\" action=\"stock.php\">";
|
||||||
print "<tr ".$bc[$var].">";
|
|
||||||
print '<td width="60%">'.$langs->trans("ReStockOnValidateOrder").'</td>';
|
|
||||||
print '<td width="160" align="right">';
|
|
||||||
print "<form method=\"post\" action=\"stock.php\">";
|
|
||||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||||
print "<input type=\"hidden\" name=\"action\" value=\"STOCK_CALCULATE_ON_SUPPLIER_VALIDATE_ORDER\">";
|
print "<input type=\"hidden\" name=\"action\" value=\"STOCK_CALCULATE_ON_SUPPLIER_VALIDATE_ORDER\">";
|
||||||
print $form->selectyesno("STOCK_CALCULATE_ON_SUPPLIER_VALIDATE_ORDER",$conf->global->STOCK_CALCULATE_ON_SUPPLIER_VALIDATE_ORDER,1,$disabled);
|
print $form->selectyesno("STOCK_CALCULATE_ON_SUPPLIER_VALIDATE_ORDER",$conf->global->STOCK_CALCULATE_ON_SUPPLIER_VALIDATE_ORDER,1,$disabled);
|
||||||
print '<input type="submit" class="button" value="'.$langs->trans("Modify").'"'.$disabled.'>';
|
print '<input type="submit" class="button" value="'.$langs->trans("Modify").'"'.$disabled.'>';
|
||||||
print "</form>\n</td>\n</tr>\n";
|
print "</form>\n";
|
||||||
$found++;
|
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
print $langs->trans("ModuleMustBeEnabledFirst", $langs->transnoentitiesnoconv("Module40Name"));
|
||||||
|
}
|
||||||
|
print "</td>\n</tr>\n";
|
||||||
|
$found++;
|
||||||
|
|
||||||
|
$var=!$var;
|
||||||
|
print "<tr ".$bc[$var].">";
|
||||||
|
print '<td width="60%">'.$langs->trans("ReStockOnDispatchOrder").'</td>';
|
||||||
|
print '<td width="160" align="right">';
|
||||||
if (! empty($conf->fournisseur->enabled))
|
if (! empty($conf->fournisseur->enabled))
|
||||||
{
|
{
|
||||||
$var=!$var;
|
print "<form method=\"post\" action=\"stock.php\">";
|
||||||
print "<tr ".$bc[$var].">";
|
|
||||||
print '<td width="60%">'.$langs->trans("ReStockOnDispatchOrder").'</td>';
|
|
||||||
print '<td width="160" align="right">';
|
|
||||||
print "<form method=\"post\" action=\"stock.php\">";
|
|
||||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||||
print "<input type=\"hidden\" name=\"action\" value=\"STOCK_CALCULATE_ON_SUPPLIER_DISPATCH_ORDER\">";
|
print "<input type=\"hidden\" name=\"action\" value=\"STOCK_CALCULATE_ON_SUPPLIER_DISPATCH_ORDER\">";
|
||||||
print $form->selectyesno("STOCK_CALCULATE_ON_SUPPLIER_DISPATCH_ORDER",$conf->global->STOCK_CALCULATE_ON_SUPPLIER_DISPATCH_ORDER,1,$disabled);
|
print $form->selectyesno("STOCK_CALCULATE_ON_SUPPLIER_DISPATCH_ORDER",$conf->global->STOCK_CALCULATE_ON_SUPPLIER_DISPATCH_ORDER,1,$disabled);
|
||||||
print '<input type="submit" class="button" value="'.$langs->trans("Modify").'"'.$disabled.'>';
|
print '<input type="submit" class="button" value="'.$langs->trans("Modify").'"'.$disabled.'>';
|
||||||
print "</form>\n</td>\n</tr>\n";
|
print "</form>\n";
|
||||||
$found++;
|
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
print $langs->trans("ModuleMustBeEnabledFirst", $langs->transnoentitiesnoconv("Module40Name"));
|
||||||
|
}
|
||||||
|
print "</td>\n</tr>\n";
|
||||||
|
$found++;
|
||||||
|
|
||||||
if (! $found)
|
/*if (! $found)
|
||||||
{
|
{
|
||||||
$var=!$var;
|
$var=!$var;
|
||||||
print "<tr ".$bc[$var].">";
|
print "<tr ".$bc[$var].">";
|
||||||
print '<td colspan="2">'.$langs->trans("NoModueToManageStockIncrease").'</td>';
|
print '<td colspan="2">'.$langs->trans("NoModueToManageStockIncrease").'</td>';
|
||||||
print "</tr>\n";
|
print "</tr>\n";
|
||||||
}
|
}*/
|
||||||
|
|
||||||
print '</table>';
|
print '</table>';
|
||||||
|
|
||||||
|
|||||||
@ -52,8 +52,8 @@ if ($action == 'delete')
|
|||||||
{
|
{
|
||||||
$file=$conf->admin->dir_output.'/'.GETPOST('urlfile');
|
$file=$conf->admin->dir_output.'/'.GETPOST('urlfile');
|
||||||
$ret=dol_delete_file($file, 1);
|
$ret=dol_delete_file($file, 1);
|
||||||
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');
|
||||||
$action='';
|
$action='';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -60,8 +60,8 @@ if ($action == 'delete')
|
|||||||
{
|
{
|
||||||
$file=$conf->admin->dir_output.'/'.GETPOST('urlfile');
|
$file=$conf->admin->dir_output.'/'.GETPOST('urlfile');
|
||||||
$ret=dol_delete_file($file, 1);
|
$ret=dol_delete_file($file, 1);
|
||||||
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');
|
||||||
$action='';
|
$action='';
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -357,7 +357,7 @@ if ($what == 'postgresql')
|
|||||||
//{
|
//{
|
||||||
if ($errormsg)
|
if ($errormsg)
|
||||||
{
|
{
|
||||||
setEventMessage($langs->trans("Error")." : ".$errormsg, 'errors');
|
setEventMessages($langs->trans("Error")." : ".$errormsg, null, 'errors');
|
||||||
|
|
||||||
$resultstring='';
|
$resultstring='';
|
||||||
$resultstring.='<div class="error">'.$langs->trans("Error")." : ".$errormsg.'</div>';
|
$resultstring.='<div class="error">'.$langs->trans("Error")." : ".$errormsg.'</div>';
|
||||||
@ -368,7 +368,7 @@ if ($what == 'postgresql')
|
|||||||
{
|
{
|
||||||
if ($what)
|
if ($what)
|
||||||
{
|
{
|
||||||
setEventMessage($langs->trans("BackupFileSuccessfullyCreated").'.<br>'.$langs->trans("YouCanDownloadBackupFile"));
|
setEventMessages($langs->trans("BackupFileSuccessfullyCreated").'.<br>'.$langs->trans("YouCanDownloadBackupFile"), null, 'mesgs');
|
||||||
|
|
||||||
$resultstring='<div class="ok">';
|
$resultstring='<div class="ok">';
|
||||||
$resultstring.=$langs->trans("BackupFileSuccessfullyCreated").'.<br>';
|
$resultstring.=$langs->trans("BackupFileSuccessfullyCreated").'.<br>';
|
||||||
@ -379,7 +379,7 @@ if ($what == 'postgresql')
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
setEventMessage($langs->trans("YouMustRunCommandFromCommandLineAfterLoginToUser",$dolibarr_main_db_user,$dolibarr_main_db_user));
|
setEventMessages($langs->trans("YouMustRunCommandFromCommandLineAfterLoginToUser",$dolibarr_main_db_user,$dolibarr_main_db_user), null, 'mesgs');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//}
|
//}
|
||||||
|
|||||||
@ -34,7 +34,7 @@ $action=GETPOST('action','alpha');
|
|||||||
if (! $user->admin) accessforbidden();
|
if (! $user->admin) accessforbidden();
|
||||||
|
|
||||||
if (GETPOST('msg','alpha')) {
|
if (GETPOST('msg','alpha')) {
|
||||||
setEventMessage(GETPOST('msg','alpha'), 'errors');
|
setEventMessages(GETPOST('msg','alpha'), null, 'errors');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -63,7 +63,7 @@ if ($action=='install')
|
|||||||
if (! $original_file)
|
if (! $original_file)
|
||||||
{
|
{
|
||||||
$langs->load("Error");
|
$langs->load("Error");
|
||||||
setEventMessage($langs->trans("ErrorFileRequired"), 'warnings');
|
setEventMessages($langs->trans("ErrorFileRequired"), null, 'warnings');
|
||||||
$error++;
|
$error++;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -71,7 +71,7 @@ if ($action=='install')
|
|||||||
if (! preg_match('/\.zip/i',$original_file))
|
if (! preg_match('/\.zip/i',$original_file))
|
||||||
{
|
{
|
||||||
$langs->load("errors");
|
$langs->load("errors");
|
||||||
setEventMessage($langs->trans("ErrorFileMustBeADolibarrPackage",$original_file), 'errors');
|
setEventMessages($langs->trans("ErrorFileMustBeADolibarrPackage",$original_file), null, 'errors');
|
||||||
$error++;
|
$error++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -99,7 +99,7 @@ if ($action=='install')
|
|||||||
if (! empty($result['error']))
|
if (! empty($result['error']))
|
||||||
{
|
{
|
||||||
$langs->load("errors");
|
$langs->load("errors");
|
||||||
setEventMessage($langs->trans($result['error'],$original_file), 'errors');
|
setEventMessages($langs->trans($result['error'],$original_file), null, 'errors');
|
||||||
$error++;
|
$error++;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -116,7 +116,7 @@ if ($action=='install')
|
|||||||
//var_dump($modulenamedir);
|
//var_dump($modulenamedir);
|
||||||
if (! dol_is_dir($modulenamedir))
|
if (! dol_is_dir($modulenamedir))
|
||||||
{
|
{
|
||||||
setEventMessage($langs->trans("ErrorModuleFileSeemsToHaveAWrongFormat"), 'errors');
|
setEventMessages($langs->trans("ErrorModuleFileSeemsToHaveAWrongFormat"), null, 'errors');
|
||||||
$error++;
|
$error++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -128,7 +128,7 @@ if ($action=='install')
|
|||||||
$result=dolCopyDir($modulenamedir, $dirins.'/'.$modulename, '0444', 1);
|
$result=dolCopyDir($modulenamedir, $dirins.'/'.$modulename, '0444', 1);
|
||||||
if ($result <= 0)
|
if ($result <= 0)
|
||||||
{
|
{
|
||||||
setEventMessage($langs->trans("ErrorFailedToCopy"), 'errors');
|
setEventMessages($langs->trans("ErrorFailedToCopy"), null, 'errors');
|
||||||
$error++;
|
$error++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -142,7 +142,7 @@ if ($action=='install')
|
|||||||
|
|
||||||
if (! $error)
|
if (! $error)
|
||||||
{
|
{
|
||||||
setEventMessage($langs->trans("SetupIsReadyForUse"));
|
setEventMessages($langs->trans("SetupIsReadyForUse"), null, 'mesgs');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -184,7 +184,7 @@ $help_url='EN:Module_Third_Parties|FR:Module_Tiers|ES:Empresas';
|
|||||||
llxHeader('',$title,$help_url);
|
llxHeader('',$title,$help_url);
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
if ($mode == 'search')
|
if ($mode == 'search')
|
||||||
{
|
{
|
||||||
if ($modesearch == 'soc')
|
if ($modesearch == 'soc')
|
||||||
@ -209,7 +209,7 @@ if ($mode == 'search')
|
|||||||
$db->free($resql);
|
$db->free($resql);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
if ($id > 0)
|
if ($id > 0)
|
||||||
{
|
{
|
||||||
@ -226,7 +226,7 @@ if ($id > 0)
|
|||||||
print '<table class="border" width="100%">';
|
print '<table class="border" width="100%">';
|
||||||
|
|
||||||
// Alias name (commercial, trademark or alias name)
|
// Alias name (commercial, trademark or alias name)
|
||||||
print '<tr><td class="titelfield">'.$langs->trans('AliasNameShort').'</td><td colspan="3">';
|
print '<tr><td class="titelfield">'.$langs->trans('AliasNames').'</td><td colspan="3">';
|
||||||
print $object->name_alias;
|
print $object->name_alias;
|
||||||
print "</td></tr>";
|
print "</td></tr>";
|
||||||
|
|
||||||
@ -1021,6 +1021,7 @@ if ($id > 0)
|
|||||||
// List of done actions
|
// List of done actions
|
||||||
show_actions_done($conf,$langs,$db,$object);
|
show_actions_done($conf,$langs,$db,$object);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|||||||
@ -2181,7 +2181,7 @@ if ($action == 'create')
|
|||||||
}
|
}
|
||||||
|
|
||||||
$arrayofinvoiceforpropal = $object->getInvoiceArrayList();
|
$arrayofinvoiceforpropal = $object->getInvoiceArrayList();
|
||||||
if ((is_array($arrayofinvoiceforpropal) && count($arrayofinvoiceforpropal) > 0) || ! empty($conf->global->WORKFLOW_PROPAL_CAN_CLASSIFIED_BILLED_WITHOUT_INVOICES))
|
if ((is_array($arrayofinvoiceforpropal) && count($arrayofinvoiceforpropal) > 0) || empty($conf->global->WORKFLOW_PROPAL_NEED_INVOICE_TO_BE_CLASSIFIED_BILLED))
|
||||||
{
|
{
|
||||||
print '<div class="inline-block divButAction"><a class="butAction" href="' . $_SERVER["PHP_SELF"] . '?id=' . $object->id . '&action=classifybilled&socid=' . $object->socid . '">' . $langs->trans("ClassifyBilled") . '</a></div>';
|
print '<div class="inline-block divButAction"><a class="butAction" href="' . $_SERVER["PHP_SELF"] . '?id=' . $object->id . '&action=classifybilled&socid=' . $object->socid . '">' . $langs->trans("ClassifyBilled") . '</a></div>';
|
||||||
}
|
}
|
||||||
|
|||||||
@ -952,7 +952,7 @@ if ($id > 0 || ! empty($ref))
|
|||||||
if ($sep > 0) print ' '; // If we had at least one line in future
|
if ($sep > 0) print ' '; // If we had at least one line in future
|
||||||
else print $langs->trans("CurrentBalance");
|
else print $langs->trans("CurrentBalance");
|
||||||
print ' '.$object->currency_code.'</td>';
|
print ' '.$object->currency_code.'</td>';
|
||||||
print '<td align="right" class="nowrap"><b>'.price($total, 0, $langs, 0, 0, -1, $object->currency_code).'</b></td>';
|
print '<td align="right" class="nowrap"><b>'.price($total).'</b></td>';
|
||||||
print '<td> </td>';
|
print '<td> </td>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
} else {
|
} else {
|
||||||
@ -961,9 +961,9 @@ if ($id > 0 || ! empty($ref))
|
|||||||
if ($sep > 0) print ' '; // If we had at least one line in future
|
if ($sep > 0) print ' '; // If we had at least one line in future
|
||||||
else print $langs->trans("Total");
|
else print $langs->trans("Total");
|
||||||
print ' '.$object->currency_code.'</td>';
|
print ' '.$object->currency_code.'</td>';
|
||||||
print '<td align="right" class="nowrap"><b>'.price($total_deb*-1, 0, $langs, 0, 0, -1, $object->currency_code).'</b></td>';
|
print '<td align="right" class="nowrap"><b>'.price($total_deb*-1).'</b></td>';
|
||||||
print '<td align="right" class="nowrap"><b>'.price($total_cred, 0, $langs, 0, 0, -1, $object->currency_code).'</b></td>';
|
print '<td align="right" class="nowrap"><b>'.price($total_cred).'</b></td>';
|
||||||
print '<td align="right" class="nowrap"><b>'.price($total_cred-($total_deb*-1), 0, $langs, 0, 0, -1, $object->currency_code).'</b></td>';
|
print '<td align="right" class="nowrap"><b>'.price($total_cred-($total_deb*-1)).'</b></td>';
|
||||||
print '<td> </td>';
|
print '<td> </td>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1283,7 +1283,8 @@ if (empty($reshook))
|
|||||||
// Ecrase $txtva par celui du produit
|
// Ecrase $txtva par celui du produit
|
||||||
// Ecrase $base_price_type par celui du produit
|
// Ecrase $base_price_type par celui du produit
|
||||||
// Replaces $fk_unit with the product's
|
// Replaces $fk_unit with the product's
|
||||||
if (! empty($idprod)) {
|
if (! empty($idprod))
|
||||||
|
{
|
||||||
$prod = new Product($db);
|
$prod = new Product($db);
|
||||||
$prod->fetch($idprod);
|
$prod->fetch($idprod);
|
||||||
|
|
||||||
@ -1304,8 +1305,11 @@ if (empty($reshook))
|
|||||||
$pu_ttc = $prod->multiprices_ttc[$object->thirdparty->price_level];
|
$pu_ttc = $prod->multiprices_ttc[$object->thirdparty->price_level];
|
||||||
$price_min = $prod->multiprices_min[$object->thirdparty->price_level];
|
$price_min = $prod->multiprices_min[$object->thirdparty->price_level];
|
||||||
$price_base_type = $prod->multiprices_base_type[$object->thirdparty->price_level];
|
$price_base_type = $prod->multiprices_base_type[$object->thirdparty->price_level];
|
||||||
if (isset($prod->multiprices_tva_tx[$object->thirdparty->price_level])) $tva_tx=$prod->multiprices_tva_tx[$object->thirdparty->price_level];
|
if (! empty($conf->global->PRODUIT_MULTIPRICES_USE_VAT_PER_LEVEL)) // using this option is a bug. kept for backward compatibility
|
||||||
if (isset($prod->multiprices_recuperableonly[$object->thirdparty->price_level])) $tva_npr=$prod->multiprices_recuperableonly[$object->thirdparty->price_level];
|
{
|
||||||
|
if (isset($prod->multiprices_tva_tx[$object->thirdparty->price_level])) $tva_tx=$prod->multiprices_tva_tx[$object->thirdparty->price_level];
|
||||||
|
if (isset($prod->multiprices_recuperableonly[$object->thirdparty->price_level])) $tva_npr=$prod->multiprices_recuperableonly[$object->thirdparty->price_level];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
elseif (! empty($conf->global->PRODUIT_CUSTOMER_PRICES))
|
elseif (! empty($conf->global->PRODUIT_CUSTOMER_PRICES))
|
||||||
{
|
{
|
||||||
@ -1318,26 +1322,30 @@ if (empty($reshook))
|
|||||||
$result = $prodcustprice->fetch_all('', '', 0, 0, $filter);
|
$result = $prodcustprice->fetch_all('', '', 0, 0, $filter);
|
||||||
if ($result) {
|
if ($result) {
|
||||||
if (count($prodcustprice->lines) > 0) {
|
if (count($prodcustprice->lines) > 0) {
|
||||||
$pu_ht = price($prodcustprice->lines [0]->price);
|
$pu_ht = price($prodcustprice->lines[0]->price);
|
||||||
$pu_ttc = price($prodcustprice->lines [0]->price_ttc);
|
$pu_ttc = price($prodcustprice->lines[0]->price_ttc);
|
||||||
$price_base_type = $prodcustprice->lines [0]->price_base_type;
|
$price_base_type = $prodcustprice->lines[0]->price_base_type;
|
||||||
$prod->tva_tx = $prodcustprice->lines [0]->tva_tx;
|
$prod->tva_tx = $prodcustprice->lines[0]->tva_tx;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// if price ht is forced (ie: calculated by margin rate and cost price)
|
// if price ht was forced (ie: from gui when calculated by margin rate and cost price)
|
||||||
if (! empty($price_ht)) {
|
if (! empty($price_ht))
|
||||||
|
{
|
||||||
$pu_ht = price2num($price_ht, 'MU');
|
$pu_ht = price2num($price_ht, 'MU');
|
||||||
$pu_ttc = price2num($pu_ht * (1 + ($tva_tx / 100)), 'MU');
|
$pu_ttc = price2num($pu_ht * (1 + ($tva_tx / 100)), 'MU');
|
||||||
}
|
}
|
||||||
|
|
||||||
// On reevalue prix selon taux tva car taux tva transaction peut etre different
|
// On reevalue prix selon taux tva car taux tva transaction peut etre different
|
||||||
// de ceux du produit par defaut (par exemple si pays different entre vendeur et acheteur).
|
// de ceux du produit par defaut (par exemple si pays different entre vendeur et acheteur).
|
||||||
elseif ($tva_tx != $prod->tva_tx) {
|
elseif ($tva_tx != $prod->tva_tx)
|
||||||
if ($price_base_type != 'HT') {
|
{
|
||||||
|
if ($price_base_type != 'HT')
|
||||||
|
{
|
||||||
$pu_ht = price2num($pu_ttc / (1 + ($tva_tx / 100)), 'MU');
|
$pu_ht = price2num($pu_ttc / (1 + ($tva_tx / 100)), 'MU');
|
||||||
} else {
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
$pu_ttc = price2num($pu_ht * (1 + ($tva_tx / 100)), 'MU');
|
$pu_ttc = price2num($pu_ht * (1 + ($tva_tx / 100)), 'MU');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1870,7 +1878,7 @@ if ($action == 'create')
|
|||||||
$objectsrc->fetch_lines();
|
$objectsrc->fetch_lines();
|
||||||
$objectsrc->fetch_thirdparty();
|
$objectsrc->fetch_thirdparty();
|
||||||
|
|
||||||
$projectid = (! empty($objectsrc->fk_project) ? $objectsrc->fk_project : '');
|
$projectid = (! empty($projectid) ? $projectid : $objectsrc->fk_project);
|
||||||
$ref_client = (! empty($objectsrc->ref_client) ? $objectsrc->ref_client : '');
|
$ref_client = (! empty($objectsrc->ref_client) ? $objectsrc->ref_client : '');
|
||||||
$ref_int = (! empty($objectsrc->ref_int) ? $objectsrc->ref_int : '');
|
$ref_int = (! empty($objectsrc->ref_int) ? $objectsrc->ref_int : '');
|
||||||
|
|
||||||
@ -2250,9 +2258,6 @@ if ($action == 'create')
|
|||||||
// Project
|
// Project
|
||||||
if (! empty($conf->projet->enabled) && $socid > 0)
|
if (! empty($conf->projet->enabled) && $socid > 0)
|
||||||
{
|
{
|
||||||
$projectid = GETPOST('projectid')?GETPOST('projectid'):0;
|
|
||||||
if ($origin == 'project') $projectid = ($originid ? $originid : 0);
|
|
||||||
|
|
||||||
$langs->load('projects');
|
$langs->load('projects');
|
||||||
print '<tr><td>' . $langs->trans('Project') . '</td><td colspan="2">';
|
print '<tr><td>' . $langs->trans('Project') . '</td><td colspan="2">';
|
||||||
$numprojet = $formproject->select_projects($soc->id, $projectid, 'projectid', 0);
|
$numprojet = $formproject->select_projects($soc->id, $projectid, 'projectid', 0);
|
||||||
|
|||||||
@ -281,7 +281,7 @@ if ($resql)
|
|||||||
if ($search_user > 0) $param.='&search_user=' .$search_user;
|
if ($search_user > 0) $param.='&search_user=' .$search_user;
|
||||||
if ($search_montant_ht != '') $param.='&search_montant_ht='.$search_montant_ht;
|
if ($search_montant_ht != '') $param.='&search_montant_ht='.$search_montant_ht;
|
||||||
if ($search_montant_ttc != '') $param.='&search_montant_ttc='.$search_montant_ttc;
|
if ($search_montant_ttc != '') $param.='&search_montant_ttc='.$search_montant_ttc;
|
||||||
if ($search_status > 0) $param.='&search_status='.$search_status;
|
if ($search_status != '') $param.='&search_status='.$search_status;
|
||||||
print_barre_liste($langs->trans('BillsCustomers').' '.($socid?' '.$soc->name:''),$page,$_SERVER["PHP_SELF"],$param,$sortfield,$sortorder,'',$num,$nbtotalofrecords,'title_accountancy.png');
|
print_barre_liste($langs->trans('BillsCustomers').' '.($socid?' '.$soc->name:''),$page,$_SERVER["PHP_SELF"],$param,$sortfield,$sortorder,'',$num,$nbtotalofrecords,'title_accountancy.png');
|
||||||
|
|
||||||
$i = 0;
|
$i = 0;
|
||||||
|
|||||||
@ -417,6 +417,7 @@ $search_societe = GETPOST("search_societe");
|
|||||||
$search_paymentmode = GETPOST("search_paymentmode");
|
$search_paymentmode = GETPOST("search_paymentmode");
|
||||||
$search_montant_ht = GETPOST("search_montant_ht");
|
$search_montant_ht = GETPOST("search_montant_ht");
|
||||||
$search_montant_ttc = GETPOST("search_montant_ttc");
|
$search_montant_ttc = GETPOST("search_montant_ttc");
|
||||||
|
$search_status = GETPOST("search_status");
|
||||||
$late = GETPOST("late");
|
$late = GETPOST("late");
|
||||||
|
|
||||||
// Do we click on purge search criteria ?
|
// Do we click on purge search criteria ?
|
||||||
@ -428,6 +429,7 @@ if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter")) // Both
|
|||||||
$search_paymentmode='';
|
$search_paymentmode='';
|
||||||
$search_montant_ht='';
|
$search_montant_ht='';
|
||||||
$search_montant_ttc='';
|
$search_montant_ttc='';
|
||||||
|
$search_status='';
|
||||||
}
|
}
|
||||||
|
|
||||||
$sortfield = GETPOST("sortfield",'alpha');
|
$sortfield = GETPOST("sortfield",'alpha');
|
||||||
@ -483,6 +485,7 @@ if ($search_paymentmode) $sql .= " AND f.fk_mode_reglement = ".$search_paymentmo
|
|||||||
if ($search_montant_ht) $sql .= " AND f.total = '".$db->escape($search_montant_ht)."'";
|
if ($search_montant_ht) $sql .= " AND f.total = '".$db->escape($search_montant_ht)."'";
|
||||||
if ($search_montant_ttc) $sql .= " AND f.total_ttc = '".$db->escape($search_montant_ttc)."'";
|
if ($search_montant_ttc) $sql .= " AND f.total_ttc = '".$db->escape($search_montant_ttc)."'";
|
||||||
if (GETPOST('sf_ref')) $sql .= " AND f.facnumber LIKE '%".$db->escape(GETPOST('sf_ref'))."%'";
|
if (GETPOST('sf_ref')) $sql .= " AND f.facnumber LIKE '%".$db->escape(GETPOST('sf_ref'))."%'";
|
||||||
|
if ($search_status) $sql .= " AND f.fk_statut = ".$search_status;
|
||||||
if ($month > 0)
|
if ($month > 0)
|
||||||
{
|
{
|
||||||
if ($year > 0)
|
if ($year > 0)
|
||||||
@ -528,6 +531,7 @@ if ($resql)
|
|||||||
if ($search_societe) $param.='&search_paymentmode='.urlencode($search_paymentmode);
|
if ($search_societe) $param.='&search_paymentmode='.urlencode($search_paymentmode);
|
||||||
if ($search_montant_ht) $param.='&search_montant_ht='.urlencode($search_montant_ht);
|
if ($search_montant_ht) $param.='&search_montant_ht='.urlencode($search_montant_ht);
|
||||||
if ($search_montant_ttc) $param.='&search_montant_ttc='.urlencode($search_montant_ttc);
|
if ($search_montant_ttc) $param.='&search_montant_ttc='.urlencode($search_montant_ttc);
|
||||||
|
if ($search_status) $param.='&search_status='.urlencode($search_status);
|
||||||
if ($late) $param.='&late='.urlencode($late);
|
if ($late) $param.='&late='.urlencode($late);
|
||||||
if ($mode) $param.='&mode='.urlencode($mode);
|
if ($mode) $param.='&mode='.urlencode($mode);
|
||||||
$urlsource=$_SERVER['PHP_SELF'].'?sortfield='.$sortfield.'&sortorder='.$sortorder;
|
$urlsource=$_SERVER['PHP_SELF'].'?sortfield='.$sortfield.'&sortorder='.$sortorder;
|
||||||
|
|||||||
@ -908,7 +908,7 @@ class Contact extends CommonObject
|
|||||||
*/
|
*/
|
||||||
function getNomUrl($withpicto=0,$option='',$maxlen=0,$moreparam='')
|
function getNomUrl($withpicto=0,$option='',$maxlen=0,$moreparam='')
|
||||||
{
|
{
|
||||||
global $langs;
|
global $conf, $langs;
|
||||||
|
|
||||||
$result='';
|
$result='';
|
||||||
$label = '<u>' . $langs->trans("ShowContact") . '</u>';
|
$label = '<u>' . $langs->trans("ShowContact") . '</u>';
|
||||||
@ -923,7 +923,14 @@ class Contact extends CommonObject
|
|||||||
$label.= '<br><b>' . $langs->trans("Phone") . ':</b> '.join(', ',$phonelist);
|
$label.= '<br><b>' . $langs->trans("Phone") . ':</b> '.join(', ',$phonelist);
|
||||||
$label.= '<br><b>' . $langs->trans("Address") . ':</b> '.dol_format_address($this, 1, ' ', $langs);
|
$label.= '<br><b>' . $langs->trans("Address") . ':</b> '.dol_format_address($this, 1, ' ', $langs);
|
||||||
|
|
||||||
$link = '<a href="'.DOL_URL_ROOT.'/contact/card.php?id='.$this->id.$moreparam.'" title="'.dol_escape_htmltag($label, 1).'" class="classfortooltip">';
|
$link = '<a href="'.DOL_URL_ROOT.'/contact/card.php?id='.$this->id.$moreparam.'"';
|
||||||
|
if (! empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER))
|
||||||
|
{
|
||||||
|
$label=$langs->trans("ShowContact");
|
||||||
|
$link.=' alt="'.dol_escape_htmltag($label, 1).'"';
|
||||||
|
}
|
||||||
|
$link.= ' title="'.dol_escape_htmltag($label, 1).'"';
|
||||||
|
$link.= ' class="classfortooltip">';
|
||||||
$linkend='</a>';
|
$linkend='</a>';
|
||||||
|
|
||||||
if ($option == 'xxx')
|
if ($option == 'xxx')
|
||||||
|
|||||||
@ -40,57 +40,65 @@ $search_boxvalue=GETPOST('q');
|
|||||||
$arrayresult=array();
|
$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) && $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");
|
$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'));
|
//$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']=img_picto('','object_company').' '.$langs->trans("SearchIntoThirdparties", $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) && $user->rights->societe->lire)
|
if (! empty($conf->societe->enabled) && empty($conf->global->MAIN_SEARCHFORM_CONTACT_DISABLED) && $user->rights->societe->lire)
|
||||||
{
|
{
|
||||||
$langs->load("companies");
|
$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'));
|
//$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']=img_picto('','object_contact').' '.$langs->trans("SearchIntoContacts", $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))
|
&& empty($conf->global->MAIN_SEARCHFORM_PRODUITSERVICE_DISABLED))
|
||||||
{
|
{
|
||||||
$langs->load("products");
|
$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'));
|
//$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']=img_picto('','object_product').' '.$langs->trans("SearchIntoProductsOrServices", $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->product->enabled) && $user->rights->produit->lire) || (! empty($conf->service->enabled) && $user->rights->service->lire)) && ! empty($conf->fournisseur->enabled)
|
if (! empty($conf->projet->enabled) && empty($conf->global->MAIN_SEARCHFORM_PROJECT_DISABLED) && $user->rights->projet->lire)
|
||||||
&& ! empty($conf->global->MAIN_SEARCHFORM_PRODUITSERVICE_SUPPLIER))
|
|
||||||
{
|
|
||||||
$langs->load("products");
|
|
||||||
$searchform.=printSearchForm(DOL_URL_ROOT.'/fourn/product/list.php', DOL_URL_ROOT.'/fourn/product/list.php', $langs->trans("SupplierRef"), 'products', 'srefsupplier', '', 'searchlefts', img_object('','product'));
|
|
||||||
}*/
|
|
||||||
|
|
||||||
if (! empty($conf->adherent->enabled) && ! empty($conf->global->MAIN_SEARCHFORM_ADHERENT) && $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']=img_picto('','object_user').' '.$langs->trans("SearchIntoMembers", $search_boxvalue);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (! empty($conf->projet->enabled) && ! empty($conf->global->MAIN_SEARCHFORM_PROJECT) && $user->rights->projet->lire)
|
|
||||||
{
|
{
|
||||||
$langs->load("projects");
|
$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'));
|
//$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']=img_picto('','object_projectpub').' '.$langs->trans("SearchIntoProjects", $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));
|
||||||
}
|
}
|
||||||
|
|
||||||
// Execute hook printSearchForm
|
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));
|
||||||
|
}
|
||||||
|
|
||||||
|
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));
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 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)
|
||||||
|
{
|
||||||
|
$langs->load("hrm");
|
||||||
|
$searchform.=printSearchForm(DOL_URL_ROOT.'/hrm/employee/list.php', DOL_URL_ROOT.'/hrm/employee/list.php', $langs->trans("Employees"), 'employee', 'search_all', 'M', 'searchleftemployee', img_object('','user'));
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
|
// Execute hook addSearchEntry
|
||||||
$parameters=array();
|
$parameters=array();
|
||||||
$reshook=$hookmanager->executeHooks('printSearchForm',$parameters); // Note that $action and $object may have been modified by some hooks
|
$reshook=$hookmanager->executeHooks('addSearchEntry',$parameters);
|
||||||
if (empty($reshook))
|
if (empty($reshook))
|
||||||
{
|
{
|
||||||
$searchform.=$hookmanager->resPrint;
|
$arrayresult=array_merge($arrayresult, $hookmanager->resArray);
|
||||||
}
|
}
|
||||||
else $searchform=$hookmanager->resPrint;
|
else $arrayresult=$hookmanager->resArray;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -63,8 +63,9 @@ class box_contacts extends ModeleBoxes
|
|||||||
if ($user->rights->societe->lire)
|
if ($user->rights->societe->lire)
|
||||||
{
|
{
|
||||||
$sql = "SELECT sp.rowid as id, sp.lastname, sp.firstname, sp.civility as civility_id, sp.datec, sp.tms, sp.fk_soc, sp.statut as status";
|
$sql = "SELECT sp.rowid as id, sp.lastname, sp.firstname, sp.civility as civility_id, sp.datec, sp.tms, sp.fk_soc, sp.statut as status";
|
||||||
$sql.= ", s.nom as socname";
|
$sql.= ", sp.address, sp.zip, sp.town, sp.phone, sp.phone_perso, sp.phone_mobile";
|
||||||
$sql.= ", s.code_client";
|
$sql.= ", s.nom as socname, s.name_alias";
|
||||||
|
$sql.= ", s.client, s.fournisseur, s.code_client, s.code_fournisseur";
|
||||||
$sql.= " FROM ".MAIN_DB_PREFIX."socpeople as sp";
|
$sql.= " FROM ".MAIN_DB_PREFIX."socpeople as sp";
|
||||||
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON sp.fk_soc = s.rowid";
|
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON sp.fk_soc = s.rowid";
|
||||||
if (! $user->rights->societe->client->voir && ! $user->societe_id) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
if (! $user->rights->societe->client->voir && ! $user->societe_id) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
||||||
@ -93,10 +94,21 @@ class box_contacts extends ModeleBoxes
|
|||||||
$contactstatic->firstname=$objp->firstname;
|
$contactstatic->firstname=$objp->firstname;
|
||||||
$contactstatic->civility_id=$objp->civility_id;
|
$contactstatic->civility_id=$objp->civility_id;
|
||||||
$contactstatic->statut=$objp->status;
|
$contactstatic->statut=$objp->status;
|
||||||
$societestatic->id = $objp->fk_soc;
|
$contactstatic->phone_pro = $objp->phone;
|
||||||
$societestatic->code_client = $objp->code_client;
|
$contactstatic->phone_perso = $objp->phone_perso;
|
||||||
|
$contactstatic->phone_mobile = $objp->phone_mobile;
|
||||||
|
$contactstatic->address = $objp->address;
|
||||||
|
$contactstatic->zip = $objp->zip;
|
||||||
|
$contactstatic->town = $objp->town;
|
||||||
|
|
||||||
|
$societestatic->id = $objp->fk_soc;
|
||||||
$societestatic->name = $objp->socname;
|
$societestatic->name = $objp->socname;
|
||||||
|
$societestatic->name_alias = $objp->name_alias;
|
||||||
|
$societestatic->code_client = $objp->code_client;
|
||||||
|
$societestatic->code_fournisseur = $objp->code_fournisseur;
|
||||||
|
$societestatic->client = $objp->client;
|
||||||
|
$societestatic->fournisseur = $objp->fournisseur;
|
||||||
|
|
||||||
$this->info_box_contents[$line][] = array(
|
$this->info_box_contents[$line][] = array(
|
||||||
'td' => 'align="left"',
|
'td' => 'align="left"',
|
||||||
'text' => $contactstatic->getNomUrl(1),
|
'text' => $contactstatic->getNomUrl(1),
|
||||||
|
|||||||
@ -82,52 +82,51 @@ class box_task extends ModeleBoxes
|
|||||||
|
|
||||||
$sql = "SELECT pt.fk_statut, count(pt.rowid) as nb, sum(ptt.task_duration) as durationtot, sum(pt.planned_workload) as plannedtot";
|
$sql = "SELECT pt.fk_statut, count(pt.rowid) as nb, sum(ptt.task_duration) as durationtot, sum(pt.planned_workload) as plannedtot";
|
||||||
$sql.= " FROM ".MAIN_DB_PREFIX."projet_task as pt, ".MAIN_DB_PREFIX."projet_task_time as ptt";
|
$sql.= " FROM ".MAIN_DB_PREFIX."projet_task as pt, ".MAIN_DB_PREFIX."projet_task_time as ptt";
|
||||||
$sql.= " WHERE DATE_FORMAT(pt.datec,'%Y') = '".date("Y")."' ";
|
$sql.= " WHERE pt.datec BETWEEN '".$this->db->idate(dol_get_first_day(date("Y"), 1))."' AND '".$this->db->idate(dol_get_last_day(date("Y"), 12))."'";
|
||||||
$sql.= " AND pt.rowid = ptt.fk_task";
|
$sql.= " AND pt.rowid = ptt.fk_task";
|
||||||
$sql.= " GROUP BY pt.fk_statut ";
|
$sql.= " GROUP BY pt.fk_statut ";
|
||||||
$sql.= " ORDER BY pt.fk_statut DESC";
|
$sql.= " ORDER BY pt.fk_statut DESC";
|
||||||
$sql.= $db->plimit($max, 0);
|
$sql.= $db->plimit($max, 0);
|
||||||
|
|
||||||
$result = $db->query($sql);
|
$result = $db->query($sql);
|
||||||
|
if ($result)
|
||||||
if ($result) {
|
{
|
||||||
$num = $db->num_rows($result);
|
$num = $db->num_rows($result);
|
||||||
$i = 0;
|
$i = 0;
|
||||||
while ($i < $num) {
|
while ($i < $num)
|
||||||
$this->info_box_contents[$i][0] = array('td' => 'align="left" width="16"','logo' => 'object_projecttask');
|
{
|
||||||
|
|
||||||
$objp = $db->fetch_object($result);
|
$objp = $db->fetch_object($result);
|
||||||
$this->info_box_contents[$i][1] = array(
|
$this->info_box_contents[$i][] = array(
|
||||||
'td' => 'align="left"',
|
'td' => 'align="left"',
|
||||||
'text' =>$langs->trans("Task")." ".$taskstatic->LibStatut($objp->fk_statut,0),
|
'text' =>$langs->trans("Task")." ".$taskstatic->LibStatut($objp->fk_statut,0),
|
||||||
);
|
);
|
||||||
|
|
||||||
$this->info_box_contents[$i][2] = array(
|
$this->info_box_contents[$i][] = array(
|
||||||
'td' => 'align="right"',
|
'td' => 'align="right"',
|
||||||
'text' => $objp->nb." ".$langs->trans("Tasks"),
|
'text' => $objp->nb." ".$langs->trans("Tasks"),
|
||||||
'url' => DOL_URL_ROOT."/projet/tasks/index.php?leftmenu=projects&viewstatut=".$objp->fk_statut,
|
'url' => DOL_URL_ROOT."/projet/tasks/index.php?leftmenu=projects&viewstatut=".$objp->fk_statut,
|
||||||
);
|
);
|
||||||
$totalnb += $objp->nb;
|
$totalnb += $objp->nb;
|
||||||
$this->info_box_contents[$i][3] = array('td' => 'align="right"', 'text' => ConvertSecondToTime($objp->plannedtot,'all',25200,5));
|
$this->info_box_contents[$i][] = array('td' => 'align="right"', 'text' => ConvertSecondToTime($objp->plannedtot,'all',25200,5));
|
||||||
$totalplannedtot += $objp->plannedtot;
|
$totalplannedtot += $objp->plannedtot;
|
||||||
$this->info_box_contents[$i][4] = array('td' => 'align="right"', 'text' => ConvertSecondToTime($objp->durationtot,'all',25200,5));
|
$this->info_box_contents[$i][] = array('td' => 'align="right"', 'text' => ConvertSecondToTime($objp->durationtot,'all',25200,5));
|
||||||
$totaldurationtot += $objp->durationtot;
|
$totaldurationtot += $objp->durationtot;
|
||||||
|
|
||||||
$this->info_box_contents[$i][5] = array('td' => 'align="right" width="18"', 'text' => $taskstatic->LibStatut($objp->fk_statut,3));
|
$this->info_box_contents[$i][] = array('td' => 'align="right" width="18"', 'text' => $taskstatic->LibStatut($objp->fk_statut,3));
|
||||||
|
|
||||||
$i++;
|
$i++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else dol_print_error($this->db);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Add the sum à the bottom of the boxes
|
// Add the sum à the bottom of the boxes
|
||||||
$this->info_box_contents[$i][0] = array('tr' => 'class="liste_total"', 'td' => 'align="left"', 'text' => $langs->trans("Total")." ".$textHead);
|
$this->info_box_contents[$i][] = array('tr' => 'class="liste_total"', 'td' => 'align="left"', 'text' => $langs->trans("Total")." ".$textHead);
|
||||||
$this->info_box_contents[$i][1] = array('td' => '', 'text' => "");
|
$this->info_box_contents[$i][] = array('td' => 'align="right" ', 'text' => number_format($totalnb, 0, ',', ' ')." ".$langs->trans("Tasks"));
|
||||||
$this->info_box_contents[$i][2] = array('td' => 'align="right" ', 'text' => number_format($totalnb, 0, ',', ' ')." ".$langs->trans("Tasks"));
|
$this->info_box_contents[$i][] = array('td' => 'align="right" ', 'text' => ConvertSecondToTime($totalplannedtot,'all',25200,5));
|
||||||
$this->info_box_contents[$i][3] = array('td' => 'align="right" ', 'text' => ConvertSecondToTime($totalplannedtot,'all',25200,5));
|
$this->info_box_contents[$i][] = array('td' => 'align="right" ', 'text' => ConvertSecondToTime($totaldurationtot,'all',25200,5));
|
||||||
$this->info_box_contents[$i][4] = array('td' => 'align="right" ', 'text' => ConvertSecondToTime($totaldurationtot,'all',25200,5));
|
$this->info_box_contents[$i][] = array('td' => '', 'text' => "");
|
||||||
$this->info_box_contents[$i][5] = array('td' => '', 'text' => "");
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -388,11 +388,16 @@ abstract class CommonDocGenerator
|
|||||||
// Add vat by rates
|
// Add vat by rates
|
||||||
foreach ($object->lines as $line)
|
foreach ($object->lines as $line)
|
||||||
{
|
{
|
||||||
|
// $line->tva_tx format depends on database field accuraty, no reliable. This is kept for backward comaptibility
|
||||||
if (empty($resarray[$array_key.'_total_vat_'.$line->tva_tx])) $resarray[$array_key.'_total_vat_'.$line->tva_tx]=0;
|
if (empty($resarray[$array_key.'_total_vat_'.$line->tva_tx])) $resarray[$array_key.'_total_vat_'.$line->tva_tx]=0;
|
||||||
$resarray[$array_key.'_total_vat_'.$line->tva_tx]+=$line->total_tva;
|
$resarray[$array_key.'_total_vat_'.$line->tva_tx]+=$line->total_tva;
|
||||||
$resarray[$array_key.'_total_vat_locale_'.$line->tva_tx]=price($resarray[$array_key.'_total_vat_'.$line->tva_tx]);
|
$resarray[$array_key.'_total_vat_locale_'.$line->tva_tx]=price($resarray[$array_key.'_total_vat_'.$line->tva_tx]);
|
||||||
|
// $vatformated is vat without not expected chars (so 20, or 8.5 or 5.99 for example)
|
||||||
|
$vatformated=vatrate($line->tva_tx);
|
||||||
|
if (empty($resarray[$array_key.'_total_vat_'.$vatformated])) $resarray[$array_key.'_total_vat_'.$vatformated]=0;
|
||||||
|
$resarray[$array_key.'_total_vat_'.$vatformated]+=$line->total_tva;
|
||||||
|
$resarray[$array_key.'_total_vat_locale_'.$vatformated]=price($resarray[$array_key.'_total_vat_'.$vatformated]);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Retrieve extrafields
|
// Retrieve extrafields
|
||||||
if (is_array($object->array_options) && count($object->array_options))
|
if (is_array($object->array_options) && count($object->array_options))
|
||||||
{
|
{
|
||||||
|
|||||||
@ -4504,24 +4504,31 @@ class Form
|
|||||||
* Note: Do not apply langs->trans function on returned content of Ajax service, content may be entity encoded twice.
|
* Note: Do not apply langs->trans function on returned content of Ajax service, content may be entity encoded twice.
|
||||||
*
|
*
|
||||||
* @param string $htmlname Name of html select area
|
* @param string $htmlname Name of html select area
|
||||||
* @param string $url Url
|
* @param string $url Url. Must return a json_encode of array(key=>array('text'=>'A text', 'url'=>'An url'), ...)
|
||||||
* @param string $id Preselected key
|
* @param string $id Preselected key
|
||||||
* @param string $moreparam Add more parameters onto the select tag
|
* @param string $moreparam Add more parameters onto the select tag
|
||||||
* @param string $moreparamtourl Add more parameters onto the Ajax called URL
|
* @param string $moreparamtourl Add more parameters onto the Ajax called URL
|
||||||
* @param int $disabled Html select box is disabled
|
* @param int $disabled Html select box is disabled
|
||||||
* @param int $minimumInputLength Minimum Input Length
|
* @param int $minimumInputLength Minimum Input Length
|
||||||
* @param string $morecss Add more class to css styles
|
* @param string $morecss Add more class to css styles
|
||||||
|
* @param int $callurlonselect If set to 1, some code is added so an url return by the ajax is called when value is selected.
|
||||||
|
* @param string $placeholder String to use as placeholder
|
||||||
* @return string HTML select string.
|
* @return string HTML select string.
|
||||||
*/
|
*/
|
||||||
static function selectArrayAjax($htmlname, $url, $id='', $moreparam='', $moreparamtourl='', $disabled=0, $minimumInputLength=1, $morecss='')
|
static function selectArrayAjax($htmlname, $url, $id='', $moreparam='', $moreparamtourl='', $disabled=0, $minimumInputLength=1, $morecss='', $callurlonselect=0, $placeholder='')
|
||||||
{
|
{
|
||||||
|
global $langs;
|
||||||
|
|
||||||
$out = '';
|
$out = '';
|
||||||
|
|
||||||
$tmpplugin='select2';
|
$tmpplugin='select2';
|
||||||
$out.='<!-- JS CODE TO ENABLE '.$tmpplugin.' for id '.$htmlname.' -->
|
$out.='<!-- JS CODE TO ENABLE '.$tmpplugin.' for id '.$htmlname.' -->
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
$(document).ready(function () {
|
$(document).ready(function () {
|
||||||
$(".'.$htmlname.'").select2({
|
|
||||||
|
'.($callurlonselect ? 'var saveRemoteData = [];':'').'
|
||||||
|
|
||||||
|
$(".'.$htmlname.'").select2({
|
||||||
ajax: {
|
ajax: {
|
||||||
dir: "ltr",
|
dir: "ltr",
|
||||||
url: "'.$url.'",
|
url: "'.$url.'",
|
||||||
@ -4534,12 +4541,13 @@ class Form
|
|||||||
};
|
};
|
||||||
},
|
},
|
||||||
results: function (remoteData, pageNumber, query) {
|
results: function (remoteData, pageNumber, query) {
|
||||||
//console.log(remoteData);
|
console.log(remoteData);
|
||||||
|
saveRemoteData = remoteData;
|
||||||
|
/* format json result for select2 */
|
||||||
result = []
|
result = []
|
||||||
$.each( remoteData, function( key, value ) {
|
$.each( remoteData, function( key, value ) {
|
||||||
result.push({id: key, text: value});
|
result.push({id: key, text: value.text});
|
||||||
});
|
});
|
||||||
//console.log(result);
|
|
||||||
//return {results:[{id:\'none\', text:\'aa\'}, {id:\'rrr\', text:\'Red\'},{id:\'bbb\', text:\'Search a into projects\'}], more:false}
|
//return {results:[{id:\'none\', text:\'aa\'}, {id:\'rrr\', text:\'Red\'},{id:\'bbb\', text:\'Search a into projects\'}], more:false}
|
||||||
return {results: result, more:false}
|
return {results: result, more:false}
|
||||||
},
|
},
|
||||||
@ -4554,19 +4562,26 @@ class Form
|
|||||||
},*/
|
},*/
|
||||||
cache: true
|
cache: true
|
||||||
},
|
},
|
||||||
|
placeholder: "'.dol_escape_js($placeholder).'",
|
||||||
escapeMarkup: function (markup) { return markup; }, // let our custom formatter work
|
escapeMarkup: function (markup) { return markup; }, // let our custom formatter work
|
||||||
minimumInputLength: '.$minimumInputLength.',
|
minimumInputLength: '.$minimumInputLength.',
|
||||||
//templateResult: formatRepo, // omitted for brevity, see the source of this page
|
formatResult: function(result, container, query, escapeMarkup) {
|
||||||
//templateSelection: formatRepoSelection // omitted for brevity, see the source of this page
|
return escapeMarkup(result.text);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
$(".'.$htmlname.'").change(function() {
|
'.($callurlonselect ? '
|
||||||
alert(\'eee\');
|
$(".'.$htmlname.'").change(function() {
|
||||||
/* $(".'.$htmlname.'").select2("search",""); */
|
var selected = $(".'.$htmlname.'").select2("val");
|
||||||
$(".'.$htmlname.'").select2("val",""); /* reset combo box */
|
$(".'.$htmlname.'").select2("val",""); /* reset visible combo value */
|
||||||
} );
|
$.each( saveRemoteData, function( key, value ) {
|
||||||
|
if (key == selected)
|
||||||
|
{
|
||||||
|
console.log("Do a redirect into selectArrayAjax to "+value.url)
|
||||||
|
location.assign(value.url);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});' : '' ) . '
|
||||||
|
|
||||||
});
|
});
|
||||||
</script>';
|
</script>';
|
||||||
@ -5254,10 +5269,12 @@ class Form
|
|||||||
* @param int $height Height of photo (auto if 0)
|
* @param int $height Height of photo (auto if 0)
|
||||||
* @param int $caneditfield Add edit fields
|
* @param int $caneditfield Add edit fields
|
||||||
* @param string $cssclass CSS name to use on img for photo
|
* @param string $cssclass CSS name to use on img for photo
|
||||||
* @param int $genericifundef Use a generic image if no image avaiable
|
* @param string $imagesize 'mini', 'small' or '' (original)
|
||||||
|
* @param int $addlinktofullsize Add link to fullsize image
|
||||||
|
* @param int $cache 1=Accept to use image in cache
|
||||||
* @return string HTML code to output photo
|
* @return string HTML code to output photo
|
||||||
*/
|
*/
|
||||||
static function showphoto($modulepart, $object, $width=100, $height=0, $caneditfield=0, $cssclass='photowithmargin', $genericifundef=0)
|
static function showphoto($modulepart, $object, $width=100, $height=0, $caneditfield=0, $cssclass='photowithmargin', $imagesize='', $addlinktofullsize=1, $cache=0)
|
||||||
{
|
{
|
||||||
global $conf,$langs;
|
global $conf,$langs;
|
||||||
|
|
||||||
@ -5271,47 +5288,73 @@ class Form
|
|||||||
$dir=$conf->societe->multidir_output[$entity];
|
$dir=$conf->societe->multidir_output[$entity];
|
||||||
$smallfile=$object->logo;
|
$smallfile=$object->logo;
|
||||||
$smallfile=preg_replace('/(\.png|\.gif|\.jpg|\.jpeg|\.bmp)/i','_small\\1',$smallfile);
|
$smallfile=preg_replace('/(\.png|\.gif|\.jpg|\.jpeg|\.bmp)/i','_small\\1',$smallfile);
|
||||||
if (! empty($object->logo)) $file=$id.'/logos/thumbs/'.$smallfile;
|
if (! empty($object->logo))
|
||||||
|
{
|
||||||
|
if ((string) $imagesize == 'mini') $file=$id.'/logos/thumbs/'.getImageFileNameForSize($object->logo, '_mini');
|
||||||
|
else if ((string) $imagesize == 'small') $file=$id.'/logos/thumbs/'.getImageFileNameForSize($object->logo, '_small');
|
||||||
|
else $file=$id.'/logos/thumbs/'.$smallfile;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else if ($modulepart=='contact')
|
else if ($modulepart=='contact')
|
||||||
{
|
{
|
||||||
$dir=$conf->societe->multidir_output[$entity].'/contact';
|
$dir=$conf->societe->multidir_output[$entity].'/contact';
|
||||||
$file=$id.'/photos/'.$object->photo;
|
if (! empty($object->photo))
|
||||||
|
{
|
||||||
|
if ((string) $imagesize == 'mini') $file=$id.'/photos/thumbs/'.getImageFileNameForSize($object->photo, '_mini');
|
||||||
|
else if ((string) $imagesize == 'small') $file=$id.'/photos/thumbs/'.getImageFileNameForSize($object->photo, '_small');
|
||||||
|
else $file=$id.'/photos/'.$object->photo;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else if ($modulepart=='userphoto')
|
else if ($modulepart=='userphoto')
|
||||||
{
|
{
|
||||||
$dir=$conf->user->dir_output;
|
$dir=$conf->user->dir_output;
|
||||||
if (! empty($object->photo)) $file=get_exdir($id, 2, 0, 0, $object, 'user').$object->photo;
|
if (! empty($object->photo))
|
||||||
|
{
|
||||||
|
if ((string) $imagesize == 'mini') $file=get_exdir($id, 2, 0, 0, $object, 'user').getImageFileNameForSize($object->photo, '_mini');
|
||||||
|
else if ((string) $imagesize == 'small') $file=get_exdir($id, 2, 0, 0, $object, 'user').getImageFileNameForSize($object->photo, '_small');
|
||||||
|
else $file=get_exdir($id, 2, 0, 0, $object, 'user').$object->photo;
|
||||||
|
}
|
||||||
if (! empty($conf->global->MAIN_OLD_IMAGE_LINKS)) $altfile=$object->id.".jpg"; // For backward compatibility
|
if (! empty($conf->global->MAIN_OLD_IMAGE_LINKS)) $altfile=$object->id.".jpg"; // For backward compatibility
|
||||||
$email=$object->email;
|
$email=$object->email;
|
||||||
}
|
}
|
||||||
else if ($modulepart=='memberphoto')
|
else if ($modulepart=='memberphoto')
|
||||||
{
|
{
|
||||||
$dir=$conf->adherent->dir_output;
|
$dir=$conf->adherent->dir_output;
|
||||||
if (! empty($object->photo)) $file=get_exdir($id, 2, 0, 0, $object, 'invoice_supplier').'photos/'.$object->photo;
|
if (! empty($object->photo))
|
||||||
|
{
|
||||||
|
if ((string) $imagesize == 'mini') $file=get_exdir($id, 2, 0, 0, $object, 'member').'photos/'.getImageFileNameForSize($object->photo, '_mini');
|
||||||
|
else if ((string) $imagesize == 'small') $file=get_exdir($id, 2, 0, 0, $object, 'member').'photos/'.getImageFileNameForSize($object->photo, '_small');
|
||||||
|
else $file=get_exdir($id, 2, 0, 0, $object, 'member').'photos/'.$object->photo;
|
||||||
|
}
|
||||||
if (! empty($conf->global->MAIN_OLD_IMAGE_LINKS)) $altfile=$object->id.".jpg"; // For backward compatibility
|
if (! empty($conf->global->MAIN_OLD_IMAGE_LINKS)) $altfile=$object->id.".jpg"; // For backward compatibility
|
||||||
$email=$object->email;
|
$email=$object->email;
|
||||||
} else {
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
$dir=$conf->$modulepart->dir_output;
|
$dir=$conf->$modulepart->dir_output;
|
||||||
if (! empty($object->photo)) $file=get_exdir($id, 2, 0, 0, $object, 'member').'photos/'.$object->photo;
|
if (! empty($object->photo))
|
||||||
|
{
|
||||||
|
if ((string) $imagesize == 'mini') $file=get_exdir($id, 2, 0, 0, $object, $modulepart).'photos/'.getImageFileNameForSize($object->photo, '_mini');
|
||||||
|
else if ((string) $imagesize == 'small') $file=get_exdir($id, 2, 0, 0, $object, $modulepart).'photos/'.getImageFileNameForSize($object->photo, '_small');
|
||||||
|
else $file=get_exdir($id, 2, 0, 0, $object, $modulepart).'photos/'.$object->photo;
|
||||||
|
}
|
||||||
if (! empty($conf->global->MAIN_OLD_IMAGE_LINKS)) $altfile=$object->id.".jpg"; // For backward compatibility
|
if (! empty($conf->global->MAIN_OLD_IMAGE_LINKS)) $altfile=$object->id.".jpg"; // For backward compatibility
|
||||||
$email=$object->email;
|
$email=$object->email;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($dir)
|
if ($dir)
|
||||||
{
|
{
|
||||||
$cache='0';
|
|
||||||
if ($file && file_exists($dir."/".$file))
|
if ($file && file_exists($dir."/".$file))
|
||||||
{
|
{
|
||||||
$ret.='<a href="'.DOL_URL_ROOT.'/viewimage.php?modulepart='.$modulepart.'&entity='.$entity.'&file='.urlencode($file).'&cache='.$cache.'">';
|
if ($addlinktofullsize) $ret.='<a href="'.DOL_URL_ROOT.'/viewimage.php?modulepart='.$modulepart.'&entity='.$entity.'&file='.urlencode($file).'&cache='.$cache.'">';
|
||||||
$ret.='<img alt="Photo" id="photologo'.(preg_replace('/[^a-z]/i','_',$file)).'" class="'.$cssclass.'" '.($width?' width="'.$width.'"':'').($height?' height="'.$height.'"':'').' src="'.DOL_URL_ROOT.'/viewimage.php?modulepart='.$modulepart.'&entity='.$entity.'&file='.urlencode($file).'&cache='.$cache.'">';
|
$ret.='<img alt="Photo" id="photologo'.(preg_replace('/[^a-z]/i','_',$file)).'" class="'.$cssclass.'" '.($width?' width="'.$width.'"':'').($height?' height="'.$height.'"':'').' src="'.DOL_URL_ROOT.'/viewimage.php?modulepart='.$modulepart.'&entity='.$entity.'&file='.urlencode($file).'&cache='.$cache.'">';
|
||||||
$ret.='</a>';
|
if ($addlinktofullsize) $ret.='</a>';
|
||||||
}
|
}
|
||||||
else if ($altfile && file_exists($dir."/".$altfile))
|
else if ($altfile && file_exists($dir."/".$altfile))
|
||||||
{
|
{
|
||||||
$ret.='<a href="'.DOL_URL_ROOT.'/viewimage.php?modulepart='.$modulepart.'&entity='.$entity.'&file='.urlencode($file).'&cache='.$cache.'">';
|
if ($addlinktofullsize) $ret.='<a href="'.DOL_URL_ROOT.'/viewimage.php?modulepart='.$modulepart.'&entity='.$entity.'&file='.urlencode($file).'&cache='.$cache.'">';
|
||||||
$ret.='<img alt="Photo alt" id="photologo'.(preg_replace('/[^a-z]/i','_',$file)).'" class="'.$cssclass.'" '.($width?' width="'.$width.'"':'').($height?' height="'.$height.'"':'').' src="'.DOL_URL_ROOT.'/viewimage.php?modulepart='.$modulepart.'&entity='.$entity.'&file='.urlencode($altfile).'&cache='.$cache.'">';
|
$ret.='<img alt="Photo alt" id="photologo'.(preg_replace('/[^a-z]/i','_',$file)).'" class="'.$cssclass.'" '.($width?' width="'.$width.'"':'').($height?' height="'.$height.'"':'').' src="'.DOL_URL_ROOT.'/viewimage.php?modulepart='.$modulepart.'&entity='.$entity.'&file='.urlencode($altfile).'&cache='.$cache.'">';
|
||||||
$ret.='</a>';
|
if ($addlinktofullsize) $ret.='</a>';
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|||||||
@ -91,6 +91,13 @@ function societe_prepare_head(Societe $object)
|
|||||||
$head[$h][2] = 'agenda';
|
$head[$h][2] = 'agenda';
|
||||||
$h++;
|
$h++;
|
||||||
}
|
}
|
||||||
|
if (! empty($conf->projet->enabled) && (!empty($user->rights->projet->lire) ))
|
||||||
|
{
|
||||||
|
$head[$h][0] = DOL_URL_ROOT.'/societe/project.php?socid='.$object->id;
|
||||||
|
$head[$h][1] = $langs->trans("Projects");
|
||||||
|
$head[$h][2] = 'project';
|
||||||
|
$h++;
|
||||||
|
}
|
||||||
//show categorie tab
|
//show categorie tab
|
||||||
/*if (! empty($conf->categorie->enabled) && ! empty($user->rights->categorie->lire))
|
/*if (! empty($conf->categorie->enabled) && ! empty($user->rights->categorie->lire))
|
||||||
{
|
{
|
||||||
@ -456,9 +463,10 @@ function getFormeJuridiqueLabel($code)
|
|||||||
* @param DoliDB $db Database handler
|
* @param DoliDB $db Database handler
|
||||||
* @param Object $object Third party object
|
* @param Object $object Third party object
|
||||||
* @param string $backtopage Url to go once contact is created
|
* @param string $backtopage Url to go once contact is created
|
||||||
|
* @param int $nocreatelink 1=Hide create project link
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
function show_projects($conf,$langs,$db,$object,$backtopage='')
|
function show_projects($conf, $langs, $db, $object, $backtopage='', $nocreatelink=0)
|
||||||
{
|
{
|
||||||
global $user;
|
global $user;
|
||||||
global $bc;
|
global $bc;
|
||||||
@ -470,7 +478,7 @@ function show_projects($conf,$langs,$db,$object,$backtopage='')
|
|||||||
$langs->load("projects");
|
$langs->load("projects");
|
||||||
|
|
||||||
$buttoncreate='';
|
$buttoncreate='';
|
||||||
if (! empty($conf->projet->enabled) && $user->rights->projet->creer)
|
if (! empty($conf->projet->enabled) && $user->rights->projet->creer && empty($nocreatelink))
|
||||||
{
|
{
|
||||||
//$buttoncreate='<a class="butAction" href="'.DOL_URL_ROOT.'/projet/card.php?socid='.$object->id.'&action=create&backtopage='.urlencode($backtopage).'">'.$langs->trans("AddProject").'</a>';
|
//$buttoncreate='<a class="butAction" href="'.DOL_URL_ROOT.'/projet/card.php?socid='.$object->id.'&action=create&backtopage='.urlencode($backtopage).'">'.$langs->trans("AddProject").'</a>';
|
||||||
$buttoncreate='<a class="addnewrecord" href="'.DOL_URL_ROOT.'/projet/card.php?socid='.$object->id.'&action=create&backtopage='.urlencode($backtopage).'">'.$langs->trans("AddProject");
|
$buttoncreate='<a class="addnewrecord" href="'.DOL_URL_ROOT.'/projet/card.php?socid='.$object->id.'&action=create&backtopage='.urlencode($backtopage).'">'.$langs->trans("AddProject");
|
||||||
@ -864,13 +872,13 @@ function show_addresses($conf,$langs,$db,$object,$backtopage='')
|
|||||||
/**
|
/**
|
||||||
* Show html area with actions to do
|
* Show html area with actions to do
|
||||||
*
|
*
|
||||||
* @param Conf $conf Object conf
|
* @param Conf $conf Object conf
|
||||||
* @param Translate $langs Object langs
|
* @param Translate $langs Object langs
|
||||||
* @param DoliDB $db Object db
|
* @param DoliDB $db Object db
|
||||||
* @param Adherent|Societe $object Object third party or member
|
* @param Adherent|Societe $object Object third party or member
|
||||||
* @param Contact $objcon Object contact
|
* @param Contact $objcon Object contact
|
||||||
* @param int $noprint Return string but does not output it
|
* @param int $noprint Return string but does not output it
|
||||||
* @return mixed Return html part or void if noprint is 1
|
* @return mixed Return html part or void if noprint is 1
|
||||||
*/
|
*/
|
||||||
function show_actions_todo($conf,$langs,$db,$object,$objcon='',$noprint=0)
|
function show_actions_todo($conf,$langs,$db,$object,$objcon='',$noprint=0)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -1544,9 +1544,9 @@ function dol_print_phone($phone,$countrycode='',$cid=0,$socid=0,$addlink='',$sep
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (! empty($addlink)) // Link on phone number + link to add action (if conf->global->AGENDA_ADDACTIONFORPHONE set)
|
if (! empty($addlink)) // Link on phone number (+ link to add action if conf->global->AGENDA_ADDACTIONFORPHONE set)
|
||||||
{
|
{
|
||||||
if (! empty($conf->browser->phone)) // If phone, we use link of phone
|
if (! empty($conf->browser->phone) || (! empty($conf->clicktodial->enabled) && ! empty($conf->global->CLICKTODIAL_USE_TEL_LINK_ON_PHONE_NUMBERS))) // If phone or option for, we use link of phone
|
||||||
{
|
{
|
||||||
$newphone ='<a href="tel:'.$phone.'"';
|
$newphone ='<a href="tel:'.$phone.'"';
|
||||||
$newphone.='>'.$phone.'</a>';
|
$newphone.='>'.$phone.'</a>';
|
||||||
@ -5223,3 +5223,32 @@ function natural_search($fields, $value, $mode=0, $nofirstand=0)
|
|||||||
return $res;
|
return $res;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Return the filename of file to get the thumbs
|
||||||
|
*
|
||||||
|
* @param string $file Original filename
|
||||||
|
* @param string $extName Extension to differenciate thumb file name ('', '_small', '_mini')
|
||||||
|
* @param string $extImgTarget Force image format for thumbs. Use '' to keep same extension than original image.
|
||||||
|
* @return string New file name
|
||||||
|
*/
|
||||||
|
function getImageFileNameForSize($file, $extName, $extImgTarget='')
|
||||||
|
{
|
||||||
|
$dirName = dirname($file);
|
||||||
|
if ($dirName == '.') $dirName='';
|
||||||
|
|
||||||
|
$fileName = preg_replace('/(\.gif|\.jpeg|\.jpg|\.png|\.bmp)$/i','',$file); // On enleve extension quelquesoit la casse
|
||||||
|
$fileName = basename($fileName);
|
||||||
|
|
||||||
|
if (empty($extImgTarget)) $extImgTarget = (preg_match('/\.jpg$/i',$file)?'.jpg':'');
|
||||||
|
if (empty($extImgTarget)) $extImgTarget = (preg_match('/\.jpeg$/i',$file)?'.jpeg':'');
|
||||||
|
if (empty($extImgTarget)) $extImgTarget = (preg_match('/\.gif$/i',$file)?'.gif':'');
|
||||||
|
if (empty($extImgTarget)) $extImgTarget = (preg_match('/\.png$/i',$file)?'.png':'');
|
||||||
|
if (empty($extImgTarget)) $extImgTarget = (preg_match('/\.bmp$/i',$file)?'.bmp':'');
|
||||||
|
|
||||||
|
if (! $extImgTarget) return $file;
|
||||||
|
|
||||||
|
$subdir='';
|
||||||
|
if ($extName) $subdir = 'thumbs/';
|
||||||
|
|
||||||
|
return $dirName.$subdir.$fileName.$extName.$extImgTarget; // New filename for thumb
|
||||||
|
}
|
||||||
|
|||||||
@ -483,7 +483,7 @@ function vignette($file, $maxWidth = 160, $maxHeight = 120, $extName='_small', $
|
|||||||
break;
|
break;
|
||||||
case IMAGETYPE_JPEG: // 2
|
case IMAGETYPE_JPEG: // 2
|
||||||
$trans_colour = imagecolorallocatealpha($imgThumb, 255, 255, 255, 0);
|
$trans_colour = imagecolorallocatealpha($imgThumb, 255, 255, 255, 0);
|
||||||
$extImgTarget = (preg_match('/\.jpeg$/',$file)?'.jpeg':'.jpg');
|
$extImgTarget = (preg_match('/\.jpeg$/i',$file)?'.jpeg':'.jpg');
|
||||||
$newquality=$quality;
|
$newquality=$quality;
|
||||||
break;
|
break;
|
||||||
case IMAGETYPE_PNG: // 3
|
case IMAGETYPE_PNG: // 3
|
||||||
@ -512,7 +512,7 @@ function vignette($file, $maxWidth = 160, $maxHeight = 120, $extName='_small', $
|
|||||||
|
|
||||||
$fileName = preg_replace('/(\.gif|\.jpeg|\.jpg|\.png|\.bmp)$/i','',$file); // On enleve extension quelquesoit la casse
|
$fileName = preg_replace('/(\.gif|\.jpeg|\.jpg|\.png|\.bmp)$/i','',$file); // On enleve extension quelquesoit la casse
|
||||||
$fileName = basename($fileName);
|
$fileName = basename($fileName);
|
||||||
$imgThumbName = $dirthumb.'/'.$fileName.$extName.$extImgTarget; // Chemin complet du fichier de la vignette
|
$imgThumbName = $dirthumb.'/'.getImageFileNameForSize($file, $extName, $extImgTarget); // Chemin complet du fichier de la vignette
|
||||||
|
|
||||||
// Check if permission are ok
|
// Check if permission are ok
|
||||||
//$fp = fopen($imgThumbName, "w");
|
//$fp = fopen($imgThumbName, "w");
|
||||||
|
|||||||
@ -91,7 +91,7 @@ function check_user_password_dolibarr($usertotest,$passwordtotest,$entitytotest=
|
|||||||
if (! $passok)
|
if (! $passok)
|
||||||
{
|
{
|
||||||
if ((! $passcrypted || $passtyped)
|
if ((! $passcrypted || $passtyped)
|
||||||
&& ($passtyped == $passclear))
|
&& ($passclear && ($passtyped == $passclear)))
|
||||||
{
|
{
|
||||||
$passok=true;
|
$passok=true;
|
||||||
dol_syslog("functions_dolibarr::check_user_password_dolibarr Authentification ok - found pass in database");
|
dol_syslog("functions_dolibarr::check_user_password_dolibarr Authentification ok - found pass in database");
|
||||||
|
|||||||
@ -521,6 +521,7 @@ jQuery(document).ready(function() {
|
|||||||
if (this.id != 'pmpprice')
|
if (this.id != 'pmpprice')
|
||||||
{
|
{
|
||||||
i++;
|
i++;
|
||||||
|
this.price = parseFloat(this.price);//fix this.price >0
|
||||||
|
|
||||||
// If margin is calculated on best supplier price, we set it by defaut (but only if value is not 0)
|
// If margin is calculated on best supplier price, we set it by defaut (but only if value is not 0)
|
||||||
var defaultbuyprice = '<?php echo ((isset($conf->global->MARGIN_TYPE) && $conf->global->MARGIN_TYPE == '1')?'bestsupplierprice':''); ?>';
|
var defaultbuyprice = '<?php echo ((isset($conf->global->MARGIN_TYPE) && $conf->global->MARGIN_TYPE == '1')?'bestsupplierprice':''); ?>';
|
||||||
|
|||||||
@ -1534,7 +1534,7 @@ class ExpenseReport extends CommonObject
|
|||||||
$response->warning_delay=$conf->expensereport->payment->warning_delay/60/60/24;
|
$response->warning_delay=$conf->expensereport->payment->warning_delay/60/60/24;
|
||||||
$response->label=$langs->trans("ExpenseReportsToPay");
|
$response->label=$langs->trans("ExpenseReportsToPay");
|
||||||
$response->url=DOL_URL_ROOT.'/expensereport/list.php?mainmenu=hrm&statut=5';
|
$response->url=DOL_URL_ROOT.'/expensereport/list.php?mainmenu=hrm&statut=5';
|
||||||
$response->img=img_object($langs->trans("ExpenseReports"),"user");
|
$response->img=img_object($langs->trans("ExpenseReports"),"trip");
|
||||||
|
|
||||||
while ($obj=$this->db->fetch_object($resql))
|
while ($obj=$this->db->fetch_object($resql))
|
||||||
{
|
{
|
||||||
|
|||||||
@ -1575,6 +1575,7 @@ class CommandeFournisseur extends CommonOrder
|
|||||||
$result=$this->call_trigger('ORDER_SUPPLIER_DELETE',$user);
|
$result=$this->call_trigger('ORDER_SUPPLIER_DELETE',$user);
|
||||||
if ($result < 0)
|
if ($result < 0)
|
||||||
{
|
{
|
||||||
|
$this->errors[]='ErrorWhenRunningTrigger';
|
||||||
dol_syslog(get_class($this)."::delete ".$this->error, LOG_ERR);
|
dol_syslog(get_class($this)."::delete ".$this->error, LOG_ERR);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
@ -1587,6 +1588,8 @@ class CommandeFournisseur extends CommonOrder
|
|||||||
dol_syslog(get_class($this)."::delete", LOG_DEBUG);
|
dol_syslog(get_class($this)."::delete", LOG_DEBUG);
|
||||||
if (! $this->db->query($sql) )
|
if (! $this->db->query($sql) )
|
||||||
{
|
{
|
||||||
|
$this->error=$this->db->lasterror();
|
||||||
|
$this->errors[]=$this->db->lasterror();
|
||||||
$error++;
|
$error++;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1597,12 +1600,14 @@ class CommandeFournisseur extends CommonOrder
|
|||||||
if ($this->db->affected_rows($resql) < 1)
|
if ($this->db->affected_rows($resql) < 1)
|
||||||
{
|
{
|
||||||
$this->error=$this->db->lasterror();
|
$this->error=$this->db->lasterror();
|
||||||
|
$this->errors[]=$this->db->lasterror();
|
||||||
$error++;
|
$error++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$this->error=$this->db->lasterror();
|
$this->error=$this->db->lasterror();
|
||||||
|
$this->errors[]=$this->db->lasterror();
|
||||||
$error++;
|
$error++;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1612,6 +1617,8 @@ class CommandeFournisseur extends CommonOrder
|
|||||||
$result=$this->deleteExtraFields();
|
$result=$this->deleteExtraFields();
|
||||||
if ($result < 0)
|
if ($result < 0)
|
||||||
{
|
{
|
||||||
|
$this->error='FailToDeleteExtraFields';
|
||||||
|
$this->errors[]='FailToDeleteExtraFields';
|
||||||
$error++;
|
$error++;
|
||||||
dol_syslog(get_class($this)."::delete error -4 ".$this->error, LOG_ERR);
|
dol_syslog(get_class($this)."::delete error -4 ".$this->error, LOG_ERR);
|
||||||
}
|
}
|
||||||
@ -1619,7 +1626,11 @@ class CommandeFournisseur extends CommonOrder
|
|||||||
|
|
||||||
// Delete linked object
|
// Delete linked object
|
||||||
$res = $this->deleteObjectLinked();
|
$res = $this->deleteObjectLinked();
|
||||||
if ($res < 0) $error++;
|
if ($res < 0) {
|
||||||
|
$this->error='FailToDeleteObjectLinked';
|
||||||
|
$this->errors[]='FailToDeleteObjectLinked';
|
||||||
|
$error++;
|
||||||
|
}
|
||||||
|
|
||||||
if (! $error)
|
if (! $error)
|
||||||
{
|
{
|
||||||
@ -1634,6 +1645,7 @@ class CommandeFournisseur extends CommonOrder
|
|||||||
if (! dol_delete_file($file,0,0,0,$this)) // For triggers
|
if (! dol_delete_file($file,0,0,0,$this)) // For triggers
|
||||||
{
|
{
|
||||||
$this->error='ErrorFailToDeleteFile';
|
$this->error='ErrorFailToDeleteFile';
|
||||||
|
$this->errors[]='ErrorFailToDeleteFile';
|
||||||
$error++;
|
$error++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1643,6 +1655,7 @@ class CommandeFournisseur extends CommonOrder
|
|||||||
if (! $res)
|
if (! $res)
|
||||||
{
|
{
|
||||||
$this->error='ErrorFailToDeleteDir';
|
$this->error='ErrorFailToDeleteDir';
|
||||||
|
$this->errors[]='ErrorFailToDeleteDir';
|
||||||
$error++;
|
$error++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -94,9 +94,9 @@ if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter")) // Both
|
|||||||
$search_company="";
|
$search_company="";
|
||||||
$search_amount_no_tax="";
|
$search_amount_no_tax="";
|
||||||
$search_amount_all_tax="";
|
$search_amount_all_tax="";
|
||||||
|
$search_status="";
|
||||||
$year="";
|
$year="";
|
||||||
$month="";
|
$month="";
|
||||||
$filter="";
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// List of fields to search into when doing a "search in all"
|
// List of fields to search into when doing a "search in all"
|
||||||
@ -162,15 +162,6 @@ if ($socid)
|
|||||||
{
|
{
|
||||||
$sql .= " AND s.rowid = ".$socid;
|
$sql .= " AND s.rowid = ".$socid;
|
||||||
}
|
}
|
||||||
if ($filter && $filter != -1) // GETPOST('filtre') may be a string
|
|
||||||
{
|
|
||||||
$filtrearr = explode(",", $filter);
|
|
||||||
foreach ($filtrearr as $fil)
|
|
||||||
{
|
|
||||||
$filt = explode(":", $fil);
|
|
||||||
$sql .= " AND " . $filt[0] . " = " . $filt[1];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if ($search_all)
|
if ($search_all)
|
||||||
{
|
{
|
||||||
$sql.= natural_search(array_keys($fieldstosearchall), $search_all);
|
$sql.= natural_search(array_keys($fieldstosearchall), $search_all);
|
||||||
@ -232,7 +223,7 @@ if ($search_amount_all_tax != '')
|
|||||||
|
|
||||||
if ($search_status != '')
|
if ($search_status != '')
|
||||||
{
|
{
|
||||||
$sql.= " AND fac.fk_statut = '".$db->escape($search_status)."'";
|
$sql.= " AND fac.fk_statut = ".$search_status;
|
||||||
}
|
}
|
||||||
|
|
||||||
$nbtotalofrecords = 0;
|
$nbtotalofrecords = 0;
|
||||||
@ -268,6 +259,7 @@ if ($resql)
|
|||||||
if ($search_amount_all_tax) $param.='&search_amount_all_tax='.urlencode($search_amount_all_tax);
|
if ($search_amount_all_tax) $param.='&search_amount_all_tax='.urlencode($search_amount_all_tax);
|
||||||
if ($filter && $filter != -1) $param.='&filtre='.urlencode($filter);
|
if ($filter && $filter != -1) $param.='&filtre='.urlencode($filter);
|
||||||
if ($optioncss != '') $param.='&optioncss='.$optioncss;
|
if ($optioncss != '') $param.='&optioncss='.$optioncss;
|
||||||
|
if ($search_status >= 0) $param.="&search_status=".$search_status;
|
||||||
|
|
||||||
print_barre_liste($langs->trans("BillsSuppliers").($socid?" $soc->name.":""),$page,$_SERVER["PHP_SELF"],$param,$sortfield,$sortorder,'',$num,$nbtotalofrecords);
|
print_barre_liste($langs->trans("BillsSuppliers").($socid?" $soc->name.":""),$page,$_SERVER["PHP_SELF"],$param,$sortfield,$sortorder,'',$num,$nbtotalofrecords);
|
||||||
print '<form method="GET" action="'.$_SERVER["PHP_SELF"].'">';
|
print '<form method="GET" action="'.$_SERVER["PHP_SELF"].'">';
|
||||||
@ -337,8 +329,8 @@ if ($resql)
|
|||||||
print '</td><td class="liste_titre" align="right">';
|
print '</td><td class="liste_titre" align="right">';
|
||||||
print '<input class="flat" type="text" size="6" name="search_amount_all_tax" value="'.$search_amount_all_tax.'">';
|
print '<input class="flat" type="text" size="6" name="search_amount_all_tax" value="'.$search_amount_all_tax.'">';
|
||||||
print '</td><td class="liste_titre" align="right">';
|
print '</td><td class="liste_titre" align="right">';
|
||||||
$liststatus=array('fac.fk_statut:0'=>$langs->trans("Draft"),'fac.fk_statut:1,paye:0'=>$langs->trans("Unpaid"), 'paye:1'=>$langs->trans("Paid"));
|
$liststatus=array('0'=>$langs->trans("Draft"),'1'=>$langs->trans("Unpaid"), '2'=>$langs->trans("Paid"));
|
||||||
print $form->selectarray('filtre', $liststatus, $filter, 1);
|
print $form->selectarray('filtre', $liststatus, $search_status, 1);
|
||||||
print '</td><td class="liste_titre" align="right">';
|
print '</td><td class="liste_titre" 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("Search"),'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("Search"),'searchclear.png','','',1).'" value="'.dol_escape_htmltag($langs->trans("RemoveFilter")).'" title="'.dol_escape_htmltag($langs->trans("RemoveFilter")).'">';
|
||||||
|
|||||||
@ -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
@ -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
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();
|
||||||
@ -103,7 +103,7 @@ print '<div class="fichecenter"><div class="fichethirdleft">';
|
|||||||
* Informations area
|
* Informations area
|
||||||
*/
|
*/
|
||||||
|
|
||||||
print '<table class="noborder" width="100%">';
|
print '<table summary="Login info" class="noborder" width="100%">';
|
||||||
print '<tr class="liste_titre"><th class="liste_titre" colspan="2">'.$langs->trans("Informations").'</th></tr>';
|
print '<tr class="liste_titre"><th class="liste_titre" colspan="2">'.$langs->trans("Informations").'</th></tr>';
|
||||||
print '<tr '.$bc[false].'>';
|
print '<tr '.$bc[false].'>';
|
||||||
print '<td class="nowrap">'.$langs->trans("User").'</td><td>'.$user->getNomUrl(0).'</td></tr>';
|
print '<td class="nowrap">'.$langs->trans("User").'</td><td>'.$user->getNomUrl(0).'</td></tr>';
|
||||||
@ -129,7 +129,7 @@ $langs->load("contracts");
|
|||||||
if (empty($user->societe_id))
|
if (empty($user->societe_id))
|
||||||
{
|
{
|
||||||
print '<br>';
|
print '<br>';
|
||||||
print '<table class="noborder" width="100%">';
|
print '<table summary="'.$langs->trans("DolibarrStateBoard").'" class="noborder" width="100%">';
|
||||||
print '<tr class="liste_titre">';
|
print '<tr class="liste_titre">';
|
||||||
print '<th class="liste_titre" colspan="2">'.$langs->trans("DolibarrStateBoard").'</th>';
|
print '<th class="liste_titre" colspan="2">'.$langs->trans("DolibarrStateBoard").'</th>';
|
||||||
print '<th class="liste_titre" align="right"> </th>';
|
print '<th class="liste_titre" align="right"> </th>';
|
||||||
|
|||||||
@ -119,3 +119,78 @@ create table llx_stock_lotserial
|
|||||||
sellby date DEFAULT NULL -- Sellby date
|
sellby date DEFAULT NULL -- Sellby date
|
||||||
) ENGINE=innodb;
|
) 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_line_id integer DEFAULT NULL;
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -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;
|
|
||||||
|
|
||||||
@ -16,8 +16,8 @@
|
|||||||
-- along with this program. If not, see <http://www.gnu.org/licenses/>.
|
-- along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
--
|
--
|
||||||
-- ============================================================================
|
-- ============================================================================
|
||||||
-- Table used for relations between elements of different types:
|
-- Table used for relations between an action event and a resource (in most cases
|
||||||
-- invoice-propal, propal-order, etc...
|
-- a 'user', but can also be a 'resource' like a room, or a hardware)
|
||||||
-- ============================================================================
|
-- ============================================================================
|
||||||
|
|
||||||
create table llx_actioncomm_resources
|
create table llx_actioncomm_resources
|
||||||
|
|||||||
@ -26,5 +26,7 @@ create table llx_projet_task_time
|
|||||||
task_duration double,
|
task_duration double,
|
||||||
fk_user integer,
|
fk_user integer,
|
||||||
thm double(24,8),
|
thm double(24,8),
|
||||||
|
invoice_id integer DEFAULT NULL, -- If we need to invoice each line of timespent, we can save invoice id here
|
||||||
|
invoice_line_id integer DEFAULT NULL, -- If we need to invoice each line of timespent, we can save invoice line id here
|
||||||
note text
|
note text
|
||||||
)ENGINE=innodb;
|
)ENGINE=innodb;
|
||||||
|
|||||||
@ -356,7 +356,7 @@ ThemeDir=Skins directory
|
|||||||
ConnectionTimeout=Connexion timeout
|
ConnectionTimeout=Connexion timeout
|
||||||
ResponseTimeout=Response timeout
|
ResponseTimeout=Response timeout
|
||||||
SmsTestMessage=Test message from __PHONEFROM__ to __PHONETO__
|
SmsTestMessage=Test message from __PHONEFROM__ to __PHONETO__
|
||||||
ModuleMustBeEnabledFirst=Module <b>%s</b> must be enabled first before using this feature.
|
ModuleMustBeEnabledFirst=Module <b>%s</b> must be enabled first if you need this feature.
|
||||||
SecurityToken=Key to secure URLs
|
SecurityToken=Key to secure URLs
|
||||||
NoSmsEngine=No SMS sender manager available. SMS sender manager are not installed with default distribution (because they depends on an external supplier) but you can find some on %s
|
NoSmsEngine=No SMS sender manager available. SMS sender manager are not installed with default distribution (because they depends on an external supplier) but you can find some on %s
|
||||||
PDF=PDF
|
PDF=PDF
|
||||||
@ -936,7 +936,8 @@ DefaultMenuSmartphoneManager=Smartphone menu manager
|
|||||||
Skin=Skin theme
|
Skin=Skin theme
|
||||||
DefaultSkin=Default skin theme
|
DefaultSkin=Default skin theme
|
||||||
MaxSizeList=Max length for list
|
MaxSizeList=Max length for list
|
||||||
DefaultMaxSizeList=Default max length for list
|
DefaultMaxSizeList=Default max length for lists
|
||||||
|
DefaultMaxSizeShortList=Default max length for short lists (ie in customer card)
|
||||||
MessageOfDay=Message of the day
|
MessageOfDay=Message of the day
|
||||||
MessageLogin=Login page message
|
MessageLogin=Login page message
|
||||||
PermanentLeftSearchForm=Permanent search form on left menu
|
PermanentLeftSearchForm=Permanent search form on left menu
|
||||||
@ -1125,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)
|
||||||
@ -1559,7 +1562,9 @@ AGENDA_DEFAULT_FILTER_TYPE=Set automatically this type of event into search filt
|
|||||||
AGENDA_DEFAULT_FILTER_STATUS=Set automatically this status for events into search filter of agenda view
|
AGENDA_DEFAULT_FILTER_STATUS=Set automatically this status for events into search filter of agenda view
|
||||||
AGENDA_DEFAULT_VIEW=Which tab do you want to open by default when selecting menu Agenda
|
AGENDA_DEFAULT_VIEW=Which tab do you want to open by default when selecting menu Agenda
|
||||||
##### ClickToDial #####
|
##### ClickToDial #####
|
||||||
ClickToDialDesc=This module allows to add an icon after phone numbers. A click on this icon will call a server with a particular URL you define below. This can be used to call a call center system from Dolibarr that can call the phone number on a SIP system for example.
|
ClickToDialDesc=This module allows to make phone numbers clickable. A click on this icon will call make your phone to call the phone number. This can be used to call a call center system from Dolibarr that can call the phone number on a SIP system for example.
|
||||||
|
ClickToDialUseTelLink=Use just a link "tel:" on phone numbers
|
||||||
|
ClickToDialUseTelLinkDesc=Use this method if your users have a softphone or an interface install on same computer than the browser, and called when you click on a link in your browser that start with "tel:". If you need a full server solution, you must set this to "No" and fill next field.
|
||||||
##### Point Of Sales (CashDesk) #####
|
##### Point Of Sales (CashDesk) #####
|
||||||
CashDesk=Point of sales
|
CashDesk=Point of sales
|
||||||
CashDeskSetup=Point of sales module setup
|
CashDeskSetup=Point of sales module setup
|
||||||
|
|||||||
@ -351,7 +351,7 @@ ExtraInfos=Extra infos
|
|||||||
RegulatedOn=Regulated on
|
RegulatedOn=Regulated on
|
||||||
ChequeNumber=Check N°
|
ChequeNumber=Check N°
|
||||||
ChequeOrTransferNumber=Check/Transfer N°
|
ChequeOrTransferNumber=Check/Transfer N°
|
||||||
ChequeMaker=Check transmitter
|
ChequeMaker=Check/Transfer transmitter
|
||||||
ChequeBank=Bank of Check
|
ChequeBank=Bank of Check
|
||||||
CheckBank=Check
|
CheckBank=Check
|
||||||
NetToBePaid=Net to be paid
|
NetToBePaid=Net to be paid
|
||||||
|
|||||||
@ -305,7 +305,7 @@ ListOfCustomersContacts=List of customer contacts
|
|||||||
ListOfSuppliersContacts=List of supplier contacts
|
ListOfSuppliersContacts=List of supplier contacts
|
||||||
ListOfCompanies=List of companies
|
ListOfCompanies=List of companies
|
||||||
ListOfThirdParties=List of third parties
|
ListOfThirdParties=List of third parties
|
||||||
ShowCompany=Show company
|
ShowCompany=Show thirdparty
|
||||||
ShowContact=Show contact
|
ShowContact=Show contact
|
||||||
ContactsAllShort=All (No filter)
|
ContactsAllShort=All (No filter)
|
||||||
ContactType=Contact type
|
ContactType=Contact type
|
||||||
|
|||||||
@ -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
|
||||||
|
|||||||
@ -755,5 +755,6 @@ SetRef=Set ref
|
|||||||
SearchIntoThirdparties=Search %s into thirdparties
|
SearchIntoThirdparties=Search %s into thirdparties
|
||||||
SearchIntoContacts=Search %s into contacts
|
SearchIntoContacts=Search %s into contacts
|
||||||
SearchIntoMembers=Search %s into members
|
SearchIntoMembers=Search %s into members
|
||||||
|
SearchIntoUsers=Search %s into users
|
||||||
SearchIntoProductsOrServices=Search %s into products or services
|
SearchIntoProductsOrServices=Search %s into products or services
|
||||||
SearchIntoProjects=Search %s into projects
|
SearchIntoProjects=Search %s into projects
|
||||||
@ -67,6 +67,8 @@ ProductStatusNotOnBuy=Not for purchase
|
|||||||
ProductStatusOnBuyShort=For purchase
|
ProductStatusOnBuyShort=For purchase
|
||||||
ProductStatusNotOnBuyShort=Not for purchase
|
ProductStatusNotOnBuyShort=Not for purchase
|
||||||
UpdatePrice=Update price
|
UpdatePrice=Update price
|
||||||
|
UpdateVAT=Update vat
|
||||||
|
UpdateDefaultPrice=Update default price
|
||||||
AppliedPricesFrom=Applied prices from
|
AppliedPricesFrom=Applied prices from
|
||||||
SellingPrice=Selling price
|
SellingPrice=Selling price
|
||||||
SellingPriceHT=Selling price (net of tax)
|
SellingPriceHT=Selling price (net of tax)
|
||||||
|
|||||||
@ -53,8 +53,8 @@ QtyDispatched=Quantity dispatched
|
|||||||
QtyDispatchedShort=Qty dispatched
|
QtyDispatchedShort=Qty dispatched
|
||||||
QtyToDispatchShort=Qty to dispatch
|
QtyToDispatchShort=Qty to dispatch
|
||||||
OrderDispatch=Stock dispatching
|
OrderDispatch=Stock dispatching
|
||||||
RuleForStockManagementDecrease=Rule for stock management decrease
|
RuleForStockManagementDecrease=Rule for automatic stock management decrease (manual decrease is always possible, even if an automatic decrease rule is activated)
|
||||||
RuleForStockManagementIncrease=Rule for stock management increase
|
RuleForStockManagementIncrease=Rule for automatic stock management increase (manual increase is always possible, even if an automatic increase rule is activated)
|
||||||
DeStockOnBill=Decrease real stocks on customers invoices/credit notes validation
|
DeStockOnBill=Decrease real stocks on customers invoices/credit notes validation
|
||||||
DeStockOnValidateOrder=Decrease real stocks on customers orders validation
|
DeStockOnValidateOrder=Decrease real stocks on customers orders validation
|
||||||
DeStockOnShipment=Decrease real stocks on shipping validation
|
DeStockOnShipment=Decrease real stocks on shipping validation
|
||||||
|
|||||||
@ -3,9 +3,9 @@ WorkflowSetup=Workflow module setup
|
|||||||
WorkflowDesc=This module is designed to modify the behaviour of automatic actions into application. By default, workflow is open (you can do things in the order you want). You can activate the automatic actions you are interested in.
|
WorkflowDesc=This module is designed to modify the behaviour of automatic actions into application. By default, workflow is open (you can do things in the order you want). You can activate the automatic actions you are interested in.
|
||||||
ThereIsNoWorkflowToModify=There is no workflow modifications available with the activated modules.
|
ThereIsNoWorkflowToModify=There is no workflow modifications available with the activated modules.
|
||||||
descWORKFLOW_PROPAL_AUTOCREATE_ORDER=Automatically create a customer order after a commercial proposal is signed
|
descWORKFLOW_PROPAL_AUTOCREATE_ORDER=Automatically create a customer order after a commercial proposal is signed
|
||||||
descWORKFLOW_PROPAL_AUTOCREATE_INVOICEAutomatically create a customer invoice after a commercial proposal is signed
|
descWORKFLOW_PROPAL_AUTOCREATE_INVOICE=Automatically create a customer invoice after a commercial proposal is signed
|
||||||
descWORKFLOW_CONTRACT_AUTOCREATE_INVOICEAutomatically create a customer invoice after a contract is validated
|
descWORKFLOW_CONTRACT_AUTOCREATE_INVOICE=Automatically create a customer invoice after a contract is validated
|
||||||
descWORKFLOW_ORDER_AUTOCREATE_INVOICEAutomatically create a customer invoice after a customer order is closed
|
descWORKFLOW_ORDER_AUTOCREATE_INVOICE=Automatically create a customer invoice after a customer order is closed
|
||||||
descWORKFLOW_ORDER_CLASSIFY_BILLED_PROPAL=Classify linked source proposal to billed when customer order is set to paid
|
descWORKFLOW_ORDER_CLASSIFY_BILLED_PROPAL=Classify linked source proposal to billed when customer order is set to paid
|
||||||
descWORKFLOW_INVOICE_CLASSIFY_BILLED_ORDER=Classify linked source customer order(s) to billed when customer invoice is set to paid
|
descWORKFLOW_INVOICE_CLASSIFY_BILLED_ORDER=Classify linked source customer order(s) to billed when customer invoice is set to paid
|
||||||
descWORKFLOW_INVOICE_AMOUNT_CLASSIFY_BILLED_ORDER=Classify linked source customer order(s) to billed when customer invoice is validated
|
descWORKFLOW_INVOICE_AMOUNT_CLASSIFY_BILLED_ORDER=Classify linked source customer order(s) to billed when customer invoice is validated
|
||||||
|
|||||||
@ -1488,7 +1488,7 @@ function top_menu($head, $title='', $target='', $disablejs=0, $disablehead=0, $a
|
|||||||
// Login name with photo and tooltip
|
// Login name with photo and tooltip
|
||||||
$mode=-1;
|
$mode=-1;
|
||||||
$toprightmenu.='<div class="inline-block nowrap"><div class="inline-block login_block_elem login_block_elem_name" style="padding: 0px;">';
|
$toprightmenu.='<div class="inline-block nowrap"><div class="inline-block login_block_elem login_block_elem_name" style="padding: 0px;">';
|
||||||
$toprightmenu.=$user->getNomurl($mode, '', true, 0, 11, 0, ($user->firstname ? 'firstname' : -1),'atoplogin');
|
$toprightmenu.=$user->getNomUrl($mode, '', true, 0, 11, 0, ($user->firstname ? 'firstname' : -1),'atoplogin');
|
||||||
$toprightmenu.='</div></div>';
|
$toprightmenu.='</div></div>';
|
||||||
|
|
||||||
$toprightmenu.='</div>';
|
$toprightmenu.='</div>';
|
||||||
@ -1551,7 +1551,7 @@ function top_menu($head, $title='', $target='', $disablejs=0, $disablehead=0, $a
|
|||||||
*/
|
*/
|
||||||
function left_menu($menu_array_before, $helppagename='', $moresearchform='', $menu_array_after='', $leftmenuwithoutmainarea=0, $title='')
|
function left_menu($menu_array_before, $helppagename='', $moresearchform='', $menu_array_after='', $leftmenuwithoutmainarea=0, $title='')
|
||||||
{
|
{
|
||||||
global $user, $conf, $langs, $db;
|
global $user, $conf, $langs, $db, $form;
|
||||||
global $hookmanager, $menumanager;
|
global $hookmanager, $menumanager;
|
||||||
|
|
||||||
$searchform='';
|
$searchform='';
|
||||||
@ -1567,60 +1567,69 @@ function left_menu($menu_array_before, $helppagename='', $moresearchform='', $me
|
|||||||
|
|
||||||
print "\n";
|
print "\n";
|
||||||
|
|
||||||
// Define $searchform
|
if ($conf->use_javascript_ajax)
|
||||||
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) && $user->rights->societe->lire)
|
|
||||||
{
|
{
|
||||||
$langs->load("companies");
|
if (! is_object($form)) $form=new Form($db);
|
||||||
$searchform.=printSearchForm(DOL_URL_ROOT.'/societe/list.php', DOL_URL_ROOT.'/societe/list.php', $langs->trans("ThirdParties"), 'soc', 'sall', 'T', 'searchleftt', img_object('','company'));
|
$selected=-1;
|
||||||
|
$searchform.=$form->selectArrayAjax('searchselectcombo', DOL_URL_ROOT.'/core/ajax/selectsearchbox.php', $selected, '', '', 0, 1, 'vmenusearchselectcombo', 1, $langs->trans("Search"));
|
||||||
}
|
}
|
||||||
|
else
|
||||||
if (! empty($conf->societe->enabled) && ! empty($conf->global->MAIN_SEARCHFORM_CONTACT) && $user->rights->societe->lire)
|
|
||||||
{
|
{
|
||||||
$langs->load("companies");
|
// Define $searchform
|
||||||
$searchform.=printSearchForm(DOL_URL_ROOT.'/contact/list.php', DOL_URL_ROOT.'/contact/list.php', $langs->trans("Contacts"), 'contact', 'sall', 'A', 'searchleftc', img_object('','contact'));
|
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) && $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'));
|
||||||
|
}
|
||||||
|
|
||||||
|
if (! empty($conf->societe->enabled) && ! empty($conf->global->MAIN_SEARCHFORM_CONTACT) && $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'));
|
||||||
|
}
|
||||||
|
|
||||||
|
if (((! empty($conf->product->enabled) && $user->rights->produit->lire) || (! empty($conf->service->enabled) && $user->rights->service->lire))
|
||||||
|
&& ! empty($conf->global->MAIN_SEARCHFORM_PRODUITSERVICE))
|
||||||
|
{
|
||||||
|
$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'));
|
||||||
|
}
|
||||||
|
|
||||||
|
if (((! empty($conf->product->enabled) && $user->rights->produit->lire) || (! empty($conf->service->enabled) && $user->rights->service->lire)) && ! empty($conf->fournisseur->enabled)
|
||||||
|
&& ! empty($conf->global->MAIN_SEARCHFORM_PRODUITSERVICE_SUPPLIER))
|
||||||
|
{
|
||||||
|
$langs->load("products");
|
||||||
|
$searchform.=printSearchForm(DOL_URL_ROOT.'/fourn/product/list.php', DOL_URL_ROOT.'/fourn/product/list.php', $langs->trans("SupplierRef"), 'products', 'srefsupplier', '', 'searchlefts', img_object('','product'));
|
||||||
|
}
|
||||||
|
|
||||||
|
if (! empty($conf->projet->enabled) && ! empty($conf->global->MAIN_SEARCHFORM_PROJECT) && $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'));
|
||||||
|
}
|
||||||
|
|
||||||
|
if (! empty($conf->adherent->enabled) && ! empty($conf->global->MAIN_SEARCHFORM_ADHERENT) && $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'));
|
||||||
|
}
|
||||||
|
|
||||||
|
if (! empty($conf->user->enabled) && ! empty($conf->global->MAIN_SEARCHFORM_USER) && $user->rights->user->user->lire)
|
||||||
|
{
|
||||||
|
$langs->load("users");
|
||||||
|
$searchform.=printSearchForm(DOL_URL_ROOT.'/user/list.php', DOL_URL_ROOT.'/user/list.php', $langs->trans("Users"), 'user', 'sall', 'M', 'searchleftuser', img_object('','user'));
|
||||||
|
}
|
||||||
|
|
||||||
|
// Execute hook printSearchForm
|
||||||
|
$parameters=array();
|
||||||
|
$reshook=$hookmanager->executeHooks('printSearchForm',$parameters); // Note that $action and $object may have been modified by some hooks
|
||||||
|
if (empty($reshook))
|
||||||
|
{
|
||||||
|
$searchform.=$hookmanager->resPrint;
|
||||||
|
}
|
||||||
|
else $searchform=$hookmanager->resPrint;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (((! empty($conf->product->enabled) && $user->rights->produit->lire) || (! empty($conf->service->enabled) && $user->rights->service->lire))
|
|
||||||
&& ! empty($conf->global->MAIN_SEARCHFORM_PRODUITSERVICE))
|
|
||||||
{
|
|
||||||
$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'));
|
|
||||||
}
|
|
||||||
|
|
||||||
if (((! empty($conf->product->enabled) && $user->rights->produit->lire) || (! empty($conf->service->enabled) && $user->rights->service->lire)) && ! empty($conf->fournisseur->enabled)
|
|
||||||
&& ! empty($conf->global->MAIN_SEARCHFORM_PRODUITSERVICE_SUPPLIER))
|
|
||||||
{
|
|
||||||
$langs->load("products");
|
|
||||||
$searchform.=printSearchForm(DOL_URL_ROOT.'/fourn/product/list.php', DOL_URL_ROOT.'/fourn/product/list.php', $langs->trans("SupplierRef"), 'products', 'srefsupplier', '', 'searchlefts', img_object('','product'));
|
|
||||||
}
|
|
||||||
|
|
||||||
if (! empty($conf->adherent->enabled) && ! empty($conf->global->MAIN_SEARCHFORM_ADHERENT) && $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'));
|
|
||||||
}
|
|
||||||
|
|
||||||
if (! empty($conf->projet->enabled) && ! empty($conf->global->MAIN_SEARCHFORM_PROJECT) && $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'));
|
|
||||||
}
|
|
||||||
|
|
||||||
if (! empty($conf->hrm->enabled) && ! empty($conf->global->MAIN_SEARCHFORM_EMPLOYEE) && $user->rights->hrm->employee->read)
|
|
||||||
{
|
|
||||||
$langs->load("hrm");
|
|
||||||
$searchform.=printSearchForm(DOL_URL_ROOT.'/hrm/employee/list.php', DOL_URL_ROOT.'/hrm/employee/list.php', $langs->trans("Employees"), 'employee', 'search_all', 'M', 'searchleftemployee', img_object('','user'));
|
|
||||||
}
|
|
||||||
|
|
||||||
// Execute hook printSearchForm
|
|
||||||
$parameters=array();
|
|
||||||
$reshook=$hookmanager->executeHooks('printSearchForm',$parameters); // Note that $action and $object may have been modified by some hooks
|
|
||||||
if (empty($reshook))
|
|
||||||
{
|
|
||||||
$searchform.=$hookmanager->resPrint;
|
|
||||||
}
|
|
||||||
else $searchform=$hookmanager->resPrint;
|
|
||||||
|
|
||||||
// Define $bookmarks
|
// Define $bookmarks
|
||||||
if (! empty($conf->bookmark->enabled) && $user->rights->bookmark->lire)
|
if (! empty($conf->bookmark->enabled) && $user->rights->bookmark->lire)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -84,8 +84,37 @@ if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'e
|
|||||||
|
|
||||||
if (empty($reshook))
|
if (empty($reshook))
|
||||||
{
|
{
|
||||||
if ($action == 'update_price' && !$cancel && ($user->rights->produit->creer || $user->rights->service->creer))
|
if (($action == 'update_vat') && !$cancel && ($user->rights->produit->creer || $user->rights->service->creer))
|
||||||
{
|
{
|
||||||
|
$object->tva_tx = GETPOST('tva_tx');
|
||||||
|
|
||||||
|
$db->begin();
|
||||||
|
|
||||||
|
$resql = $object->update($object->id, $user);
|
||||||
|
if (! $resql)
|
||||||
|
{
|
||||||
|
$error++;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($error)
|
||||||
|
{
|
||||||
|
$object->updatePrice($newprice, $newpricebase, $user, $newvat, $newprice_min, $level, $newnpr, $newpsq);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (! $error)
|
||||||
|
{
|
||||||
|
$db->commit();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$db->rollback();
|
||||||
|
}
|
||||||
|
|
||||||
|
$action='';
|
||||||
|
}
|
||||||
|
|
||||||
|
if (($action == 'update_price') && !$cancel && ($user->rights->produit->creer || $user->rights->service->creer))
|
||||||
|
{
|
||||||
$maxpricesupplier = $object->min_recommended_price();
|
$maxpricesupplier = $object->min_recommended_price();
|
||||||
$object->fk_price_expression = empty($eid) ? 0 : $eid; //0 discards expression
|
$object->fk_price_expression = empty($eid) ? 0 : $eid; //0 discards expression
|
||||||
|
|
||||||
@ -399,6 +428,11 @@ if ($isphoto) {
|
|||||||
|
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
|
|
||||||
|
// Status (to sell)
|
||||||
|
print '<tr><td>' . $langs->trans("Status") . ' (' . $langs->trans("Sell") . ')</td><td colspan="2">';
|
||||||
|
print $object->getLibStatut(2, 0);
|
||||||
|
print '</td></tr>';
|
||||||
|
|
||||||
// MultiPrix
|
// MultiPrix
|
||||||
if (! empty($conf->global->PRODUIT_MULTIPRICES))
|
if (! empty($conf->global->PRODUIT_MULTIPRICES))
|
||||||
{
|
{
|
||||||
@ -433,14 +467,32 @@ if (! empty($conf->global->PRODUIT_MULTIPRICES))
|
|||||||
print price($object->multiprices_min["$soc->price_level"]) . ' ' . $langs->trans(empty($object->multiprices_base_type["$soc->price_level"])?'HT':$object->multiprices_base_type["$soc->price_level"]);
|
print price($object->multiprices_min["$soc->price_level"]) . ' ' . $langs->trans(empty($object->multiprices_base_type["$soc->price_level"])?'HT':$object->multiprices_base_type["$soc->price_level"]);
|
||||||
}
|
}
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
// TVA
|
if (! empty($conf->global->PRODUIT_MULTIPRICES_USE_VAT_PER_LEVEL)) // using this option is a bug. kept for backward compatibility
|
||||||
print '<tr><td>' . $langs->trans("VATRate") . '</td><td colspan="2">' . vatrate($object->multiprices_tva_tx["$soc->price_level"], true) . '</td></tr>';
|
{
|
||||||
|
// TVA
|
||||||
|
print '<tr><td>' . $langs->trans("VATRate") . '</td><td colspan="2">' . vatrate($object->multiprices_tva_tx["$soc->price_level"], true) . '</td></tr>';
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// TVA
|
||||||
|
print '<tr><td>' . $langs->trans("VATRate") . '</td><td>' . vatrate($object->tva_tx . ($object->tva_npr ? '*' : ''), true) . '</td></tr>';
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// We show only vat for level 1
|
if (! empty($conf->global->PRODUIT_MULTIPRICES_USE_VAT_PER_LEVEL)) // using this option is a bug. kept for backward compatibility
|
||||||
print '<tr><td>' . $langs->trans("VATRate") . '</td><td colspan="2">' . vatrate($object->multiprices_tva_tx [1], true) . '</td></tr>';
|
{
|
||||||
|
// We show only vat for level 1
|
||||||
|
print '<tr><td>' . $langs->trans("VATRate") . '</td><td colspan="2">' . vatrate($object->multiprices_tva_tx [1], true) . '</td></tr>';
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// TVA
|
||||||
|
print '<tr><td>' . $langs->trans("VATRate") . '</td><td>' . vatrate($object->tva_tx . ($object->tva_npr ? '*' : ''), true) . '</td></tr>';
|
||||||
|
}
|
||||||
|
|
||||||
print '<tr class="liste_titre"><td style="text-align: center">'.$langs->trans("PriceLevel").'</td><td style="text-align: center">'.$langs->trans("SellingPrice").'</td><td style="text-align: center">'.$langs->trans("MinPrice").'</td></tr>';
|
print '<tr class="liste_titre"><td style="text-align: center">'.$langs->trans("PriceLevel").'</td><td style="text-align: center">'.$langs->trans("SellingPrice").'</td><td style="text-align: center">'.$langs->trans("MinPrice").'</td></tr>';
|
||||||
|
|
||||||
for($i = 1; $i <= $conf->global->PRODUIT_MULTIPRICES_LIMIT; $i ++)
|
for($i = 1; $i <= $conf->global->PRODUIT_MULTIPRICES_LIMIT; $i ++)
|
||||||
@ -551,7 +603,9 @@ if (! empty($conf->global->PRODUIT_MULTIPRICES))
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
// TVA
|
// TVA
|
||||||
print '<tr><td>' . $langs->trans("VATRate") . '</td><td>' . vatrate($object->tva_tx . ($object->tva_npr ? '*' : ''), true) . '</td></tr>';
|
print '<tr><td>' . $langs->trans("VATRate") . '</td><td>' . vatrate($object->tva_tx . ($object->tva_npr ? '*' : ''), true) . '</td></tr>';
|
||||||
|
|
||||||
@ -649,11 +703,6 @@ if (! empty($conf->global->PRODUIT_MULTIPRICES))
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Status (to sell)
|
|
||||||
print '<tr><td>' . $langs->trans("Status") . ' (' . $langs->trans("Sell") . ')</td><td colspan="2">';
|
|
||||||
print $object->getLibStatut(2, 0);
|
|
||||||
print '</td></tr>';
|
|
||||||
|
|
||||||
print "</table>\n";
|
print "</table>\n";
|
||||||
|
|
||||||
dol_fiche_end();
|
dol_fiche_end();
|
||||||
@ -669,16 +718,69 @@ if (! $action || $action == 'delete' || $action == 'showlog_customer_price' || $
|
|||||||
{
|
{
|
||||||
print "\n" . '<div class="tabsAction">' . "\n";
|
print "\n" . '<div class="tabsAction">' . "\n";
|
||||||
|
|
||||||
if ($user->rights->produit->creer || $user->rights->service->creer) {
|
if (empty($conf->global->PRODUIT_MULTIPRICES))
|
||||||
print '<div class="inline-block divButAction"><a class="butAction" href="' . $_SERVER['PHP_SELF'] . '?action=edit_price&id=' . $object->id . '">' . $langs->trans("UpdatePrice") . '</a></div>';
|
{
|
||||||
|
if ($user->rights->produit->creer || $user->rights->service->creer) {
|
||||||
|
print '<div class="inline-block divButAction"><a class="butAction" href="' . $_SERVER['PHP_SELF'] . '?action=edit_price&id=' . $object->id . '">' . $langs->trans("UpdateDefaultPrice") . '</a></div>';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if ($user->rights->produit->creer || $user->rights->service->creer) {
|
||||||
|
print '<div class="inline-block divButAction"><a class="butAction" href="' . $_SERVER['PHP_SELF'] . '?action=edit_vat&id=' . $object->id . '">' . $langs->trans("UpdateVAT") . '</a></div>';
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($user->rights->produit->creer || $user->rights->service->creer) {
|
||||||
|
print '<div class="inline-block divButAction"><a class="butAction" href="' . $_SERVER['PHP_SELF'] . '?action=edit_price&id=' . $object->id . '">' . $langs->trans("UpdateDefaultPrice") . '</a></div>';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (! empty($conf->global->PRODUIT_CUSTOMER_PRICES))
|
||||||
|
{
|
||||||
|
if ($user->rights->produit->creer || $user->rights->service->creer) {
|
||||||
|
print '<div class="inline-block divButAction"><a class="butAction" href="' . $_SERVER["PHP_SELF"] . '?action=add_customer_price&id=' . $object->id . '">' . $langs->trans("AddCustomerPrice") . '</a></div>';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
print "\n</div>\n";
|
print "\n</div>\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Edition du prix
|
* Edit price area
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
if ($action == 'edit_vat' && ($user->rights->produit->creer || $user->rights->service->creer))
|
||||||
|
{
|
||||||
|
print load_fiche_titre($langs->trans("UpdateVAT"), '');
|
||||||
|
|
||||||
|
print '<form action="' . $_SERVER["PHP_SELF"] . '?id=' . $object->id . '" method="POST">';
|
||||||
|
print '<input type="hidden" name="token" value="' . $_SESSION ['newtoken'] . '">';
|
||||||
|
print '<input type="hidden" name="action" value="update_vat">';
|
||||||
|
print '<input type="hidden" name="id" value="' . $object->id . '">';
|
||||||
|
|
||||||
|
dol_fiche_head('');
|
||||||
|
|
||||||
|
print '<table class="border" width="100%">';
|
||||||
|
|
||||||
|
// VAT
|
||||||
|
print '<tr><td>' . $langs->trans("VATRate") . '</td><td>';
|
||||||
|
print $form->load_tva("tva_tx", $object->tva_tx, $mysoc, '', $object->id, $object->tva_npr);
|
||||||
|
print '</td></tr>';
|
||||||
|
|
||||||
|
print '</table>';
|
||||||
|
|
||||||
|
dol_fiche_end();
|
||||||
|
|
||||||
|
print '<div class="center">';
|
||||||
|
print '<input type="submit" class="button" value="' . $langs->trans("Save") . '">';
|
||||||
|
print ' ';
|
||||||
|
print '<input type="submit" class="button" name="cancel" value="' . $langs->trans("Cancel") . '">';
|
||||||
|
print '</div>';
|
||||||
|
|
||||||
|
print '<br></form><br>';
|
||||||
|
}
|
||||||
|
|
||||||
if ($action == 'edit_price' && ($user->rights->produit->creer || $user->rights->service->creer))
|
if ($action == 'edit_price' && ($user->rights->produit->creer || $user->rights->service->creer))
|
||||||
{
|
{
|
||||||
print load_fiche_titre($langs->trans("NewPrice"), '');
|
print load_fiche_titre($langs->trans("NewPrice"), '');
|
||||||
@ -785,26 +887,31 @@ if ($action == 'edit_price' && ($user->rights->produit->creer || $user->rights->
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
for($i = 1; $i <= $conf->global->PRODUIT_MULTIPRICES_LIMIT; $i ++)
|
dol_fiche_head('');
|
||||||
|
|
||||||
|
for ($i = 1; $i <= $conf->global->PRODUIT_MULTIPRICES_LIMIT; $i ++)
|
||||||
{
|
{
|
||||||
|
if ($i > 1) print '<br>';
|
||||||
|
|
||||||
print '<form action="' . $_SERVER["PHP_SELF"] . '?id=' . $object->id . '" method="POST">';
|
print '<form action="' . $_SERVER["PHP_SELF"] . '?id=' . $object->id . '" method="POST">';
|
||||||
print '<input type="hidden" name="token" value="' . $_SESSION ['newtoken'] . '">';
|
print '<input type="hidden" name="token" value="' . $_SESSION['newtoken'] . '">';
|
||||||
print '<input type="hidden" name="action" value="update_price">';
|
print '<input type="hidden" name="action" value="update_price">';
|
||||||
print '<input type="hidden" name="id" value="' . $object->id . '">';
|
print '<input type="hidden" name="id" value="' . $object->id . '">';
|
||||||
|
if (empty($conf->global->PRODUIT_MULTIPRICES_USE_VAT_PER_LEVEL))
|
||||||
|
{
|
||||||
|
print '<input type="hidden" name="tva_tx_' . $i . '" value="' . $object->tva_tx . '">';
|
||||||
|
}
|
||||||
|
|
||||||
dol_fiche_head('');
|
|
||||||
|
|
||||||
print '<table class="border" width="100%">';
|
print '<table class="border" width="100%">';
|
||||||
|
|
||||||
// VAT
|
// VAT
|
||||||
if ($i == 1) {
|
if (! empty($conf->global->PRODUIT_MULTIPRICES_USE_VAT_PER_LEVEL))
|
||||||
|
{
|
||||||
print '<tr><td>' . $langs->trans("VATRate") . '</td><td>';
|
print '<tr><td>' . $langs->trans("VATRate") . '</td><td>';
|
||||||
print $form->load_tva("tva_tx_" . $i, $object->multiprices_tva_tx ["$i"], $mysoc, '', $object->id);
|
print $form->load_tva("tva_tx_" . $i, $object->multiprices_tva_tx["$i"], $mysoc, '', $object->id);
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
} else { // We always use the vat rate of price level 1 (A vat rate does not depends on customer)
|
|
||||||
print '<input type="hidden" name="tva_tx_' . $i . '" value="' . $object->multiprices_tva_tx [1] . '">';
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Selling price
|
// Selling price
|
||||||
print '<tr><td width="20%">';
|
print '<tr><td width="20%">';
|
||||||
$text = $langs->trans('SellingPrice') . ' ' . $i;
|
$text = $langs->trans('SellingPrice') . ' ' . $i;
|
||||||
@ -839,10 +946,10 @@ if ($action == 'edit_price' && ($user->rights->produit->creer || $user->rights->
|
|||||||
|
|
||||||
print '</table>';
|
print '</table>';
|
||||||
|
|
||||||
dol_fiche_end();
|
|
||||||
|
|
||||||
print '</form>';
|
print '</form>';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
dol_fiche_end();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -886,14 +993,14 @@ if ($result)
|
|||||||
print '<td>' . $langs->trans("AppliedPricesFrom") . '</td>';
|
print '<td>' . $langs->trans("AppliedPricesFrom") . '</td>';
|
||||||
|
|
||||||
if (! empty($conf->global->PRODUIT_MULTIPRICES)) {
|
if (! empty($conf->global->PRODUIT_MULTIPRICES)) {
|
||||||
print '<td align="center">' . $langs->trans("MultiPriceLevelsName") . '</td>';
|
print '<td align="center">' . $langs->trans("PriceLevel") . '</td>';
|
||||||
}
|
}
|
||||||
if (! empty($conf->global->PRODUIT_CUSTOMER_PRICES_BY_QTY)) {
|
if (! empty($conf->global->PRODUIT_CUSTOMER_PRICES_BY_QTY)) {
|
||||||
print '<td align="center">' . $langs->trans("Type") . '</td>';
|
print '<td align="center">' . $langs->trans("Type") . '</td>';
|
||||||
}
|
}
|
||||||
|
|
||||||
print '<td align="center">' . $langs->trans("PriceBase") . '</td>';
|
print '<td align="center">' . $langs->trans("PriceBase") . '</td>';
|
||||||
print '<td align="right">' . $langs->trans("VAT") . '</td>';
|
if (! empty($conf->global->PRODUIT_MULTIPRICES_USE_VAT_PER_LEVEL) || ! empty($conf->global->PRODUIT_CUSTOMER_PRICES_BY_QTY)) print '<td align="right">' . $langs->trans("VATRate") . '</td>';
|
||||||
print '<td align="right">' . $langs->trans("HT") . '</td>';
|
print '<td align="right">' . $langs->trans("HT") . '</td>';
|
||||||
print '<td align="right">' . $langs->trans("TTC") . '</td>';
|
print '<td align="right">' . $langs->trans("TTC") . '</td>';
|
||||||
if (! empty($conf->dynamicprices->enabled)) {
|
if (! empty($conf->dynamicprices->enabled)) {
|
||||||
@ -928,7 +1035,7 @@ if ($result)
|
|||||||
}
|
}
|
||||||
|
|
||||||
print '<td align="center">' . $langs->trans($objp->price_base_type) . "</td>";
|
print '<td align="center">' . $langs->trans($objp->price_base_type) . "</td>";
|
||||||
print '<td align="right">' . vatrate($objp->tva_tx, true, $objp->recuperableonly) . "</td>";
|
if (! empty($conf->global->PRODUIT_MULTIPRICES_USE_VAT_PER_LEVEL) || ! empty($conf->global->PRODUIT_CUSTOMER_PRICES_BY_QTY)) print '<td align="right">' . vatrate($objp->tva_tx, true, $objp->recuperableonly) . "</td>";
|
||||||
|
|
||||||
//Price
|
//Price
|
||||||
if (! empty($objp->fk_price_expression) && ! empty($conf->dynamicprices->enabled))
|
if (! empty($objp->fk_price_expression) && ! empty($conf->dynamicprices->enabled))
|
||||||
@ -942,14 +1049,14 @@ if ($result)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
print '<td align="right">' . price($objp->price) . "</td>";
|
print '<td align="right">' . ($objp->price_base_type != 'TTC' ? price($objp->price) : ''). "</td>";
|
||||||
print '<td align="right">' . price($objp->price_ttc) . "</td>";
|
print '<td align="right">' . ($objp->price_base_type == 'TTC' ? price($objp->price_ttc) : '') . "</td>";
|
||||||
if (! empty($conf->dynamicprices->enabled)) { //Only if module is enabled
|
if (! empty($conf->dynamicprices->enabled)) { //Only if module is enabled
|
||||||
print '<td align="right"></td>';
|
print '<td align="right"></td>';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
print '<td align="right">' . price($objp->price_min) . '</td>';
|
print '<td align="right">' . ($objp->price_base_type != 'TTC' ? price($objp->price_min) : '') . '</td>';
|
||||||
print '<td align="right">' . price($objp->price_min_ttc) . '</td>';
|
print '<td align="right">' . ($objp->price_base_type == 'TTC' ? price($objp->price_min_ttc) : '') . '</td>';
|
||||||
|
|
||||||
// User
|
// User
|
||||||
print '<td align="right"><a href="' . DOL_URL_ROOT . '/user/card.php?id=' . $objp->user_id . '">' . img_object($langs->trans("ShowUser"), 'user') . ' ' . $objp->login . '</a></td>';
|
print '<td align="right"><a href="' . DOL_URL_ROOT . '/user/card.php?id=' . $objp->user_id . '">' . img_object($langs->trans("ShowUser"), 'user') . ' ' . $objp->login . '</a></td>';
|
||||||
@ -1202,7 +1309,7 @@ if (! empty($conf->global->PRODUIT_CUSTOMER_PRICES))
|
|||||||
print '<td>' . $langs->trans("ThirdParty") . '</td>';
|
print '<td>' . $langs->trans("ThirdParty") . '</td>';
|
||||||
print '<td>' . $langs->trans("AppliedPricesFrom") . '</td>';
|
print '<td>' . $langs->trans("AppliedPricesFrom") . '</td>';
|
||||||
print '<td align="center">' . $langs->trans("PriceBase") . '</td>';
|
print '<td align="center">' . $langs->trans("PriceBase") . '</td>';
|
||||||
print '<td align="right">' . $langs->trans("VAT") . '</td>';
|
print '<td align="right">' . $langs->trans("VATRate") . '</td>';
|
||||||
print '<td align="right">' . $langs->trans("HT") . '</td>';
|
print '<td align="right">' . $langs->trans("HT") . '</td>';
|
||||||
print '<td align="right">' . $langs->trans("TTC") . '</td>';
|
print '<td align="right">' . $langs->trans("TTC") . '</td>';
|
||||||
print '<td align="right">' . $langs->trans("MinPrice") . ' ' . $langs->trans("HT") . '</td>';
|
print '<td align="right">' . $langs->trans("MinPrice") . ' ' . $langs->trans("HT") . '</td>';
|
||||||
@ -1275,7 +1382,7 @@ if (! empty($conf->global->PRODUIT_CUSTOMER_PRICES))
|
|||||||
print '<td>' . $langs->trans("ThirdParty") . '</td>';
|
print '<td>' . $langs->trans("ThirdParty") . '</td>';
|
||||||
print '<td>' . $langs->trans("AppliedPricesFrom") . '</td>';
|
print '<td>' . $langs->trans("AppliedPricesFrom") . '</td>';
|
||||||
print '<td align="center">' . $langs->trans("PriceBase") . '</td>';
|
print '<td align="center">' . $langs->trans("PriceBase") . '</td>';
|
||||||
print '<td align="right">' . $langs->trans("VAT") . '</td>';
|
print '<td align="right">' . $langs->trans("VATRate") . '</td>';
|
||||||
print '<td align="right">' . $langs->trans("HT") . '</td>';
|
print '<td align="right">' . $langs->trans("HT") . '</td>';
|
||||||
print '<td align="right">' . $langs->trans("TTC") . '</td>';
|
print '<td align="right">' . $langs->trans("TTC") . '</td>';
|
||||||
print '<td align="right">' . $langs->trans("MinPrice") . ' ' . $langs->trans("HT") . '</td>';
|
print '<td align="right">' . $langs->trans("MinPrice") . ' ' . $langs->trans("HT") . '</td>';
|
||||||
@ -1355,19 +1462,6 @@ if (! empty($conf->global->PRODUIT_CUSTOMER_PRICES))
|
|||||||
print "</table>";
|
print "</table>";
|
||||||
|
|
||||||
print "</form>";
|
print "</form>";
|
||||||
|
|
||||||
/* ************************************************************************** */
|
|
||||||
/* */
|
|
||||||
/* Barre d'action */
|
|
||||||
/* */
|
|
||||||
/* ************************************************************************** */
|
|
||||||
|
|
||||||
print "\n" . '<div class="tabsAction">' . "\n";
|
|
||||||
|
|
||||||
if ($user->rights->produit->creer || $user->rights->service->creer) {
|
|
||||||
print '<div class="inline-block divButAction"><a class="butAction" href="' . $_SERVER["PHP_SELF"] . '?action=add_customer_price&id=' . $object->id . '">' . $langs->trans("AddCustomerPrice") . '</a></div>';
|
|
||||||
}
|
|
||||||
print "\n</div><br>\n";
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -624,7 +624,7 @@ else
|
|||||||
print '<tr><td class="fieldrequired">'.$langs->trans("Label").'</td>';
|
print '<tr><td class="fieldrequired">'.$langs->trans("Label").'</td>';
|
||||||
print '<td><input size="40" name="title" value="'.$object->title.'"></td></tr>';
|
print '<td><input size="40" name="title" value="'.$object->title.'"></td></tr>';
|
||||||
|
|
||||||
// Customer
|
// Thirdparty
|
||||||
print '<tr><td>'.$langs->trans("ThirdParty").'</td><td>';
|
print '<tr><td>'.$langs->trans("ThirdParty").'</td><td>';
|
||||||
$filteronlist='';
|
$filteronlist='';
|
||||||
if (! empty($conf->global->PROJECT_FILTER_FOR_THIRDPARTY_LIST)) $filteronlist=$conf->global->PROJECT_FILTER_FOR_THIRDPARTY_LIST;
|
if (! empty($conf->global->PROJECT_FILTER_FOR_THIRDPARTY_LIST)) $filteronlist=$conf->global->PROJECT_FILTER_FOR_THIRDPARTY_LIST;
|
||||||
@ -713,7 +713,7 @@ else
|
|||||||
|
|
||||||
// Third party
|
// Third party
|
||||||
print '<tr><td>'.$langs->trans("ThirdParty").'</td><td>';
|
print '<tr><td>'.$langs->trans("ThirdParty").'</td><td>';
|
||||||
if ($object->thirdparty->id > 0) print $object->thirdparty->getNomUrl(1);
|
if ($object->thirdparty->id > 0) print $object->thirdparty->getNomUrl(1, 'project');
|
||||||
else print' ';
|
else print' ';
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
|
|||||||
@ -64,11 +64,9 @@ print $form->selectarray('selectarray',$array);
|
|||||||
|
|
||||||
print '<br><br>'."\n";
|
print '<br><br>'."\n";
|
||||||
|
|
||||||
print "Test 4d: a select with ajax refresh<br>\n";
|
print "Test 4d: a select with ajax refresh and with onchange call of url<br>\n";
|
||||||
//$array=array(0=>'',1=>'Search into xxx',2=>'Search into yyy',3=>'Search into zzz');
|
|
||||||
$array=array();
|
|
||||||
$selected=-1;
|
$selected=-1;
|
||||||
print $form->selectArrayAjax('testselectc', DOL_URL_ROOT.'/core/ajax/selectsearchbox.php', $selected, 'style="min-width: 250px;"', '', 0, 1, '');
|
print $form->selectArrayAjax('testselectc', DOL_URL_ROOT.'/core/ajax/selectsearchbox.php', $selected, 'style="min-width: 250px;"', '', 0, 1, '', 1);
|
||||||
|
|
||||||
|
|
||||||
print '<br><br>'."\n";
|
print '<br><br>'."\n";
|
||||||
|
|||||||
@ -121,17 +121,34 @@ if ($socid)
|
|||||||
|
|
||||||
dol_fiche_end();
|
dol_fiche_end();
|
||||||
|
|
||||||
/*
|
|
||||||
|
|
||||||
|
/*
|
||||||
* Barre d'action
|
* Barre d'action
|
||||||
*/
|
*/
|
||||||
|
|
||||||
print '<div class="tabsAction">';
|
$objthirdparty=$object;
|
||||||
|
$objcon=new stdClass();
|
||||||
|
|
||||||
|
$out='';
|
||||||
|
$permok=$user->rights->agenda->myactions->create;
|
||||||
|
if ((! empty($objthirdparty->id) || ! empty($objcon->id)) && $permok)
|
||||||
|
{
|
||||||
|
//$out.='<a href="'.DOL_URL_ROOT.'/comm/action/card.php?action=create';
|
||||||
|
if (get_class($objthirdparty) == 'Societe') $out.='&socid='.$objthirdparty->id;
|
||||||
|
$out.=(! empty($objcon->id)?'&contactid='.$objcon->id:'').'&backtopage=1&percentage=-1';
|
||||||
|
//$out.=$langs->trans("AddAnAction").' ';
|
||||||
|
//$out.=img_picto($langs->trans("AddAnAction"),'filenew');
|
||||||
|
//$out.="</a>";
|
||||||
|
}
|
||||||
|
|
||||||
|
print '<div class="tabsAction">';
|
||||||
|
|
||||||
if (! empty($conf->agenda->enabled))
|
if (! empty($conf->agenda->enabled))
|
||||||
{
|
{
|
||||||
if (! empty($user->rights->agenda->myactions->create) || ! empty($user->rights->agenda->allactions->create))
|
if (! empty($user->rights->agenda->myactions->create) || ! empty($user->rights->agenda->allactions->create))
|
||||||
{
|
{
|
||||||
print '<a class="butAction" href="'.DOL_URL_ROOT.'/comm/action/card.php?action=create&socid='.$socid.'">'.$langs->trans("AddAction").'</a>';
|
print '<a class="butAction" href="'.DOL_URL_ROOT.'/comm/action/card.php?action=create'.$out.'">'.$langs->trans("AddAction").'</a>';
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -143,25 +160,11 @@ if ($socid)
|
|||||||
|
|
||||||
print '<br>';
|
print '<br>';
|
||||||
|
|
||||||
$objthirdparty=$object;
|
|
||||||
$objcon=new stdClass();
|
|
||||||
|
|
||||||
$out='';
|
print load_fiche_titre($langs->trans("ActionsOnCompany"),'','');
|
||||||
$permok=$user->rights->agenda->myactions->create;
|
|
||||||
if ((! empty($objthirdparty->id) || ! empty($objcon->id)) && $permok)
|
|
||||||
{
|
|
||||||
$out.='<a href="'.DOL_URL_ROOT.'/comm/action/card.php?action=create';
|
|
||||||
if (get_class($objthirdparty) == 'Societe') $out.='&socid='.$objthirdparty->id;
|
|
||||||
$out.=(! empty($objcon->id)?'&contactid='.$objcon->id:'').'&backtopage=1&percentage=-1">';
|
|
||||||
$out.=$langs->trans("AddAnAction").' ';
|
|
||||||
$out.=img_picto($langs->trans("AddAnAction"),'filenew');
|
|
||||||
$out.="</a>";
|
|
||||||
}
|
|
||||||
|
|
||||||
print load_fiche_titre($langs->trans("ActionsOnCompany"),$out,'');
|
|
||||||
|
|
||||||
// List of todo actions
|
// List of todo actions
|
||||||
show_actions_todo($conf,$langs,$db,$object);
|
show_actions_todo($conf,$langs,$db,$object,null,0,1);
|
||||||
|
|
||||||
// List of done actions
|
// List of done actions
|
||||||
show_actions_done($conf,$langs,$db,$object);
|
show_actions_done($conf,$langs,$db,$object);
|
||||||
|
|||||||
@ -1747,12 +1747,12 @@ class Societe extends CommonObject
|
|||||||
* Return a link on thirdparty (with picto)
|
* Return a link on thirdparty (with picto)
|
||||||
*
|
*
|
||||||
* @param int $withpicto Add picto into link (0=No picto, 1=Include picto with link, 2=Picto only)
|
* @param int $withpicto Add picto into link (0=No picto, 1=Include picto with link, 2=Picto only)
|
||||||
* @param string $option Target of link ('', 'customer', 'prospect', 'supplier')
|
* @param string $option Target of link ('', 'customer', 'prospect', 'supplier', 'project')
|
||||||
* @param int $maxlen Max length of name
|
* @param int $maxlen Max length of name
|
||||||
* @param integer $notooltip 1=Disable tooltip
|
* @param integer $notooltip 1=Disable tooltip
|
||||||
* @return string String with URL
|
* @return string String with URL
|
||||||
*/
|
*/
|
||||||
function getNomUrl($withpicto=0,$option='',$maxlen=0,$notooltip=0)
|
function getNomUrl($withpicto=0, $option='', $maxlen=0, $notooltip=0)
|
||||||
{
|
{
|
||||||
global $conf,$langs;
|
global $conf,$langs;
|
||||||
|
|
||||||
@ -1795,6 +1795,16 @@ class Societe extends CommonObject
|
|||||||
$label.= '<u>' . $langs->trans("ShowSupplier") . '</u>';
|
$label.= '<u>' . $langs->trans("ShowSupplier") . '</u>';
|
||||||
$link = '<a href="'.DOL_URL_ROOT.'/fourn/card.php?socid='.$this->id;
|
$link = '<a href="'.DOL_URL_ROOT.'/fourn/card.php?socid='.$this->id;
|
||||||
}
|
}
|
||||||
|
else if ($option == 'agenda')
|
||||||
|
{
|
||||||
|
$label.= '<u>' . $langs->trans("ShowAgenda") . '</u>';
|
||||||
|
$link = '<a href="'.DOL_URL_ROOT.'/societe/agenda.php?socid='.$this->id;
|
||||||
|
}
|
||||||
|
else if ($option == 'project')
|
||||||
|
{
|
||||||
|
$label.= '<u>' . $langs->trans("ShowProject") . '</u>';
|
||||||
|
$link = '<a href="'.DOL_URL_ROOT.'/societe/project.php?socid='.$this->id;
|
||||||
|
}
|
||||||
else if ($option == 'category')
|
else if ($option == 'category')
|
||||||
{
|
{
|
||||||
$label.= '<u>' . $langs->trans("ShowCategory") . '</u>';
|
$label.= '<u>' . $langs->trans("ShowCategory") . '</u>';
|
||||||
@ -1814,10 +1824,13 @@ class Societe extends CommonObject
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (! empty($this->name))
|
if (! empty($this->name))
|
||||||
|
{
|
||||||
$label.= '<br><b>' . $langs->trans('Name') . ':</b> '. $this->name;
|
$label.= '<br><b>' . $langs->trans('Name') . ':</b> '. $this->name;
|
||||||
if (! empty($this->code_client))
|
if (! empty($this->name_alias)) $label.=' ('.$this->name_alias.')';
|
||||||
|
}
|
||||||
|
if (! empty($this->code_client) && $this->client)
|
||||||
$label.= '<br><b>' . $langs->trans('CustomerCode') . ':</b> '. $this->code_client;
|
$label.= '<br><b>' . $langs->trans('CustomerCode') . ':</b> '. $this->code_client;
|
||||||
if (! empty($this->code_fournisseur))
|
if (! empty($this->code_fournisseur) && $this->fournisseur)
|
||||||
$label.= '<br><b>' . $langs->trans('SupplierCode') . ':</b> '. $this->code_fournisseur;
|
$label.= '<br><b>' . $langs->trans('SupplierCode') . ':</b> '. $this->code_fournisseur;
|
||||||
|
|
||||||
if (! empty($this->logo))
|
if (! empty($this->logo))
|
||||||
@ -1831,7 +1844,16 @@ class Societe extends CommonObject
|
|||||||
|
|
||||||
// Add type of canvas
|
// Add type of canvas
|
||||||
$link.=(!empty($this->canvas)?'&canvas='.$this->canvas:'').'"';
|
$link.=(!empty($this->canvas)?'&canvas='.$this->canvas:'').'"';
|
||||||
$link.=($notooltip?'':' title="'.dol_escape_htmltag($label, 1).'" class="classfortooltip"');
|
if (empty($notooltip))
|
||||||
|
{
|
||||||
|
if (! empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER))
|
||||||
|
{
|
||||||
|
$label=$langs->trans("ShowCompany");
|
||||||
|
$link.=' alt="'.dol_escape_htmltag($label, 1).'"';
|
||||||
|
}
|
||||||
|
$link.= ' title="'.dol_escape_htmltag($label, 1).'"';
|
||||||
|
$link.=' class="classfortooltip"';
|
||||||
|
}
|
||||||
$link.='>';
|
$link.='>';
|
||||||
$linkend='</a>';
|
$linkend='</a>';
|
||||||
|
|
||||||
|
|||||||
@ -338,8 +338,8 @@ else dol_print_error($db);
|
|||||||
|
|
||||||
$sql = "SELECT s.rowid, s.nom as name, s.name_alias, s.barcode, s.town, s.zip, s.datec, s.code_client, s.code_fournisseur, ";
|
$sql = "SELECT s.rowid, s.nom as name, s.name_alias, s.barcode, s.town, s.zip, s.datec, s.code_client, s.code_fournisseur, ";
|
||||||
$sql.= " st.libelle as stcomm, s.fk_stcomm as stcomm_id, s.fk_prospectlevel, s.prefix_comm, s.client, s.fournisseur, s.canvas, s.status as status,";
|
$sql.= " st.libelle as stcomm, s.fk_stcomm as stcomm_id, s.fk_prospectlevel, s.prefix_comm, s.client, s.fournisseur, s.canvas, s.status as status,";
|
||||||
$sql.= " s.siren as idprof1, s.siret as idprof2, ape as idprof3, idprof4 as idprof4,";
|
$sql.= " s.siren as idprof1, s.siret as idprof2, ape as idprof3, idprof4 as idprof4, s.fk_pays,";
|
||||||
$sql.= " s.fk_pays, s.tms as date_update, s.datec as date_creation,";
|
$sql.= " s.tms as date_update, s.datec as date_creation,";
|
||||||
$sql.= " typent.code as typent_code";
|
$sql.= " typent.code as typent_code";
|
||||||
// We'll need these fields in order to filter by sale (including the case where the user can only see his prospects)
|
// We'll need these fields in order to filter by sale (including the case where the user can only see his prospects)
|
||||||
if ($search_sale) $sql .= ", sc.fk_soc, sc.fk_user";
|
if ($search_sale) $sql .= ", sc.fk_soc, sc.fk_user";
|
||||||
@ -575,10 +575,10 @@ if ($resql)
|
|||||||
's.idprof6'=>array('label'=>$langs->trans("ProfId6Short"), 'checked'=>$checkedprofid6),
|
's.idprof6'=>array('label'=>$langs->trans("ProfId6Short"), 'checked'=>$checkedprofid6),
|
||||||
's.fk_prospectlevel'=>array('label'=>$langs->trans("ProspectLevelShort"), 'checked'=>$checkprospectlevel),
|
's.fk_prospectlevel'=>array('label'=>$langs->trans("ProspectLevelShort"), 'checked'=>$checkprospectlevel),
|
||||||
's.fk_stcomm'=>array('label'=>$langs->trans("StatusProsp"), 'checked'=>$checkstcomm),
|
's.fk_stcomm'=>array('label'=>$langs->trans("StatusProsp"), 'checked'=>$checkstcomm),
|
||||||
's.status'=>array('label'=>$langs->trans("Status"), 'checked'=>1, 'position'=>200),
|
|
||||||
's.datec'=>array('label'=>$langs->trans("DateCreation"), 'checked'=>0, 'position'=>500),
|
's.datec'=>array('label'=>$langs->trans("DateCreation"), 'checked'=>0, 'position'=>500),
|
||||||
'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),
|
||||||
|
);
|
||||||
$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":"").'">';
|
||||||
@ -618,9 +618,9 @@ if ($resql)
|
|||||||
$parameters=array('arrayfields'=>$arrayfields);
|
$parameters=array('arrayfields'=>$arrayfields);
|
||||||
$reshook=$hookmanager->executeHooks('printFieldListTitle',$parameters); // Note that $action and $object may have been modified by hook
|
$reshook=$hookmanager->executeHooks('printFieldListTitle',$parameters); // Note that $action and $object may have been modified by hook
|
||||||
print $hookmanager->resPrint;
|
print $hookmanager->resPrint;
|
||||||
if (! empty($arrayfields['s.status']['checked'])) print_liste_field_titre($langs->trans("Status"),$_SERVER["PHP_SELF"],"s.status","",$param,'align="center"',$sortfield,$sortorder);
|
|
||||||
if (! empty($arrayfields['s.datec']['checked'])) print_liste_field_titre($langs->trans("DateCreationShort"),$_SERVER["PHP_SELF"],"s.datec","",$param,'align="center" class="nowrap"',$sortfield,$sortorder);
|
if (! empty($arrayfields['s.datec']['checked'])) print_liste_field_titre($langs->trans("DateCreationShort"),$_SERVER["PHP_SELF"],"s.datec","",$param,'align="center" class="nowrap"',$sortfield,$sortorder);
|
||||||
if (! empty($arrayfields['s.tms']['checked'])) print_liste_field_titre($langs->trans("DateModificationShort"),$_SERVER["PHP_SELF"],"s.tms","",$param,'align="center" class="nowrap"',$sortfield,$sortorder);
|
if (! empty($arrayfields['s.tms']['checked'])) print_liste_field_titre($langs->trans("DateModificationShort"),$_SERVER["PHP_SELF"],"s.tms","",$param,'align="center" class="nowrap"',$sortfield,$sortorder);
|
||||||
|
if (! empty($arrayfields['s.status']['checked'])) print_liste_field_titre($langs->trans("Status"),$_SERVER["PHP_SELF"],"s.status","",$param,'align="center"',$sortfield,$sortorder);
|
||||||
print_liste_field_titre($selectedfields, $_SERVER["PHP_SELF"],"",'','','align="right"',$sortfield,$sortorder,'maxwidthsearch ');
|
print_liste_field_titre($selectedfields, $_SERVER["PHP_SELF"],"",'','','align="right"',$sortfield,$sortorder,'maxwidthsearch ');
|
||||||
print "</tr>\n";
|
print "</tr>\n";
|
||||||
|
|
||||||
@ -795,25 +795,25 @@ if ($resql)
|
|||||||
$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
|
||||||
print $hookmanager->resPrint;
|
print $hookmanager->resPrint;
|
||||||
if (! empty($arrayfields['s.status']['checked']))
|
// Date creation
|
||||||
{
|
|
||||||
// Status
|
|
||||||
print '<td class="liste_titre" align="center">';
|
|
||||||
print $form->selectarray('search_status', array('0'=>$langs->trans('ActivityCeased'),'1'=>$langs->trans('InActivity')),$search_status);
|
|
||||||
print '</td>';
|
|
||||||
}
|
|
||||||
if (! empty($arrayfields['s.datec']['checked']))
|
if (! empty($arrayfields['s.datec']['checked']))
|
||||||
{
|
{
|
||||||
// Date creation
|
|
||||||
print '<td class="liste_titre">';
|
print '<td class="liste_titre">';
|
||||||
print '</td>';
|
print '</td>';
|
||||||
}
|
}
|
||||||
|
// Date modification
|
||||||
if (! empty($arrayfields['s.tms']['checked']))
|
if (! empty($arrayfields['s.tms']['checked']))
|
||||||
{
|
{
|
||||||
// Date modification
|
|
||||||
print '<td class="liste_titre">';
|
print '<td class="liste_titre">';
|
||||||
print '</td>';
|
print '</td>';
|
||||||
}
|
}
|
||||||
|
// Status
|
||||||
|
if (! empty($arrayfields['s.status']['checked']))
|
||||||
|
{
|
||||||
|
print '<td class="liste_titre" align="center">';
|
||||||
|
print $form->selectarray('search_status', array('0'=>$langs->trans('ActivityCeased'),'1'=>$langs->trans('InActivity')),$search_status);
|
||||||
|
print '</td>';
|
||||||
|
}
|
||||||
// Action column
|
// Action column
|
||||||
print '<td class="liste_titre" align="right">';
|
print '<td class="liste_titre" align="right">';
|
||||||
if ($type != '') print '<input type="hidden" name="type" value="'.$type.'">';
|
if ($type != '') print '<input type="hidden" name="type" value="'.$type.'">';
|
||||||
@ -971,24 +971,24 @@ if ($resql)
|
|||||||
$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
|
||||||
print $hookmanager->resPrint;
|
print $hookmanager->resPrint;
|
||||||
// Status
|
// Date creation
|
||||||
if (! empty($arrayfields['s.status']['checked']))
|
if (! empty($arrayfields['s.datec']['checked']))
|
||||||
{
|
{
|
||||||
print '<td align="center">'.$companystatic->getLibStatut(3).'</td>';
|
|
||||||
}
|
|
||||||
if (! empty($arrayfields['s.datec']['checked']))
|
|
||||||
{
|
|
||||||
// Date creation
|
|
||||||
print '<td align="center">';
|
print '<td align="center">';
|
||||||
print dol_print_date($obj->date_creation, 'dayhour');
|
print dol_print_date($obj->date_creation, 'dayhour');
|
||||||
print '</td>';
|
print '</td>';
|
||||||
}
|
}
|
||||||
|
// Date modification
|
||||||
if (! empty($arrayfields['s.tms']['checked']))
|
if (! empty($arrayfields['s.tms']['checked']))
|
||||||
{
|
{
|
||||||
// Date modification
|
|
||||||
print '<td align="center">';
|
print '<td align="center">';
|
||||||
print dol_print_date($obj->date_update, 'dayhour');
|
print dol_print_date($obj->date_update, 'dayhour');
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
}
|
||||||
|
// Status
|
||||||
|
if (! empty($arrayfields['s.status']['checked']))
|
||||||
|
{
|
||||||
|
print '<td align="center">'.$companystatic->getLibStatut(3).'</td>';
|
||||||
}
|
}
|
||||||
// Action column
|
// Action column
|
||||||
print '<td></td>';
|
print '<td></td>';
|
||||||
|
|||||||
@ -195,6 +195,8 @@ if ($result > 0)
|
|||||||
|
|
||||||
print "\n";
|
print "\n";
|
||||||
|
|
||||||
|
print '<br>';
|
||||||
|
|
||||||
// Add notification form
|
// Add notification form
|
||||||
print load_fiche_titre($langs->trans("AddNewNotification"),'','');
|
print load_fiche_titre($langs->trans("AddNewNotification"),'','');
|
||||||
|
|
||||||
|
|||||||
@ -172,6 +172,8 @@ print '</div>';
|
|||||||
|
|
||||||
dol_fiche_end();
|
dol_fiche_end();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if (! empty($conf->global->PRODUIT_CUSTOMER_PRICES)) {
|
if (! empty($conf->global->PRODUIT_CUSTOMER_PRICES)) {
|
||||||
|
|
||||||
$prodcustprice = new Productcustomerprice($db);
|
$prodcustprice = new Productcustomerprice($db);
|
||||||
@ -429,107 +431,8 @@ if (! empty($conf->global->PRODUIT_CUSTOMER_PRICES)) {
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
// View mode
|
||||||
|
|
||||||
// View mode
|
|
||||||
|
|
||||||
// Count total nb of records
|
|
||||||
$nbtotalofrecords = 0;
|
|
||||||
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) {
|
|
||||||
$nbtotalofrecords = $prodcustprice->fetch_all('', '', 0, 0, $filter);
|
|
||||||
}
|
|
||||||
|
|
||||||
$result = $prodcustprice->fetch_all($sortorder, $sortfield, $conf->liste_limit, $offset, $filter);
|
|
||||||
if ($result < 0) {
|
|
||||||
setEventMessage($prodcustprice->error, 'errors');
|
|
||||||
}
|
|
||||||
|
|
||||||
$option = '&search_soc=' . $search_soc . '&id=' . $object->id;
|
|
||||||
|
|
||||||
print_barre_liste($langs->trans('PriceForEachProduct'), $page, $_SERVEUR ['PHP_SELF'], $option, $sortfield, $sortorder, '', count($prodcustprice->lines), $nbtotalofrecords);
|
|
||||||
|
|
||||||
print '<form action="' . $_SERVER["PHP_SELF"] . '?id=' . $object->id . '" method="POST">';
|
|
||||||
print '<input type="hidden" name="id" value="' . $object->id . '">';
|
|
||||||
|
|
||||||
print '<table class="noborder" width="100%">';
|
|
||||||
|
|
||||||
print '<tr class="liste_titre">';
|
|
||||||
print '<td>' . $langs->trans("Product") . '</td>';
|
|
||||||
print '<td>' . $langs->trans("AppliedPricesFrom") . '</td>';
|
|
||||||
print '<td align="center">' . $langs->trans("PriceBase") . '</td>';
|
|
||||||
print '<td align="right">' . $langs->trans("VAT") . '</td>';
|
|
||||||
print '<td align="right">' . $langs->trans("HT") . '</td>';
|
|
||||||
print '<td align="right">' . $langs->trans("TTC") . '</td>';
|
|
||||||
print '<td align="right">' . $langs->trans("MinPrice") . ' ' . $langs->trans("HT") . '</td>';
|
|
||||||
print '<td align="right">' . $langs->trans("MinPrice") . ' ' . $langs->trans("TTC") . '</td>';
|
|
||||||
print '<td align="right">' . $langs->trans("ChangedBy") . '</td>';
|
|
||||||
print '<td> </td>';
|
|
||||||
print '</tr>';
|
|
||||||
|
|
||||||
if (count($prodcustprice->lines) > 0) {
|
|
||||||
|
|
||||||
print '<tr class="liste_titre">';
|
|
||||||
print '<td><input type="text" class="flat" name="search_soc" value="' . $search_soc . '" size="20"></td>';
|
|
||||||
print '<td colspan="8"> </td>';
|
|
||||||
// Print the search button
|
|
||||||
print '<td class="liste_titre" align="right">';
|
|
||||||
print '<input class="liste_titre" name="button_search" type="image" src="' . DOL_URL_ROOT . '/theme/' . $conf->theme . '/img/search.png" value="' . dol_escape_htmltag($langs->trans("Search")) . '" title="' . dol_escape_htmltag($langs->trans("Search")) . '">';
|
|
||||||
print '</td>';
|
|
||||||
print '</tr>';
|
|
||||||
|
|
||||||
$var = False;
|
|
||||||
|
|
||||||
foreach($prodcustprice->lines as $line)
|
|
||||||
{
|
|
||||||
print "<tr ".$bc[$var].">";
|
|
||||||
|
|
||||||
$staticprod = new Product($db);
|
|
||||||
$staticprod->fetch($line->fk_product);
|
|
||||||
|
|
||||||
print "<td>" . $staticprod->getNomUrl(1) . "</td>";
|
|
||||||
print "<td>" . dol_print_date($line->datec, "dayhour") . "</td>";
|
|
||||||
|
|
||||||
print '<td align="center">' . $langs->trans($line->price_base_type) . "</td>";
|
|
||||||
print '<td align="right">' . vatrate($line->tva_tx, true, $line->recuperableonly) . "</td>";
|
|
||||||
print '<td align="right">' . price($line->price) . "</td>";
|
|
||||||
print '<td align="right">' . price($line->price_ttc) . "</td>";
|
|
||||||
print '<td align="right">' . price($line->price_min) . '</td>';
|
|
||||||
print '<td align="right">' . price($line->price_min_ttc) . '</td>';
|
|
||||||
|
|
||||||
// User
|
|
||||||
$userstatic = new User($db);
|
|
||||||
$userstatic->fetch($line->fk_user);
|
|
||||||
print '<td align="right">';
|
|
||||||
print $userstatic->getLoginUrl(1);
|
|
||||||
print '</td>';
|
|
||||||
|
|
||||||
// Todo Edit or delete button
|
|
||||||
// Action
|
|
||||||
if ($user->rights->produit->creer || $user->rights->service->creer) {
|
|
||||||
print '<td align="right">';
|
|
||||||
print '<a href="' . $_SERVER["PHP_SELF"] . '?action=showlog_customer_price&socid=' . $object->id . '&prodid=' . $line->fk_product . '">';
|
|
||||||
print img_info();
|
|
||||||
print '</a>';
|
|
||||||
print ' ';
|
|
||||||
print '<a href="' . $_SERVER["PHP_SELF"] . '?action=edit_customer_price&socid=' . $object->id . '&lineid=' . $line->id . '">';
|
|
||||||
print img_edit('default', 0, 'style="vertical-align: middle;"');
|
|
||||||
print '</a>';
|
|
||||||
print ' ';
|
|
||||||
print '<a href="' . $_SERVER["PHP_SELF"] . '?action=delete_customer_price&socid=' . $object->id . '&lineid=' . $line->id . '">';
|
|
||||||
print img_delete('default', 'style="vertical-align: middle;"');
|
|
||||||
print '</a>';
|
|
||||||
print '</td>';
|
|
||||||
}
|
|
||||||
|
|
||||||
print "</tr>\n";
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
print '<tr '.$bc[false].'><td colspan="10">'.$langs->trans('NoPriceSpecificToCustomer').'</td></tr>';
|
|
||||||
}
|
|
||||||
|
|
||||||
print "</table>";
|
|
||||||
|
|
||||||
print "</form>";
|
|
||||||
|
|
||||||
/* ************************************************************************** */
|
/* ************************************************************************** */
|
||||||
/* */
|
/* */
|
||||||
/* Barre d'action */
|
/* Barre d'action */
|
||||||
@ -541,7 +444,112 @@ if (! empty($conf->global->PRODUIT_CUSTOMER_PRICES)) {
|
|||||||
if ($user->rights->produit->creer || $user->rights->service->creer) {
|
if ($user->rights->produit->creer || $user->rights->service->creer) {
|
||||||
print '<div class="inline-block divButAction"><a class="butAction" href="' . $_SERVER["PHP_SELF"] . '?action=add_customer_price&socid=' . $object->id . '">' . $langs->trans("AddCustomerPrice") . '</a></div>';
|
print '<div class="inline-block divButAction"><a class="butAction" href="' . $_SERVER["PHP_SELF"] . '?action=add_customer_price&socid=' . $object->id . '">' . $langs->trans("AddCustomerPrice") . '</a></div>';
|
||||||
}
|
}
|
||||||
print "\n</div><br>\n";
|
print "\n</div>\n";
|
||||||
|
|
||||||
|
|
||||||
|
// Count total nb of records
|
||||||
|
$nbtotalofrecords = 0;
|
||||||
|
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
|
||||||
|
{
|
||||||
|
$nbtotalofrecords = $prodcustprice->fetch_all('', '', 0, 0, $filter);
|
||||||
|
}
|
||||||
|
|
||||||
|
$result = $prodcustprice->fetch_all($sortorder, $sortfield, $conf->liste_limit, $offset, $filter);
|
||||||
|
if ($result < 0)
|
||||||
|
{
|
||||||
|
setEventMessage($prodcustprice->error, 'errors');
|
||||||
|
}
|
||||||
|
|
||||||
|
$option = '&search_soc=' . $search_soc . '&id=' . $object->id;
|
||||||
|
|
||||||
|
print_barre_liste($langs->trans('PriceForEachProduct'), $page, $_SERVEUR['PHP_SELF'], $option, $sortfield, $sortorder, '', count($prodcustprice->lines), $nbtotalofrecords, '');
|
||||||
|
|
||||||
|
print '<form action="' . $_SERVER["PHP_SELF"] . '?id=' . $object->id . '" method="POST">';
|
||||||
|
print '<input type="hidden" name="id" value="' . $object->id . '">';
|
||||||
|
|
||||||
|
print '<table class="noborder" width="100%">';
|
||||||
|
|
||||||
|
print '<tr class="liste_titre">';
|
||||||
|
print '<td>' . $langs->trans("Product") . '</td>';
|
||||||
|
print '<td>' . $langs->trans("AppliedPricesFrom") . '</td>';
|
||||||
|
print '<td align="center">' . $langs->trans("PriceBase") . '</td>';
|
||||||
|
print '<td align="right">' . $langs->trans("VAT") . '</td>';
|
||||||
|
print '<td align="right">' . $langs->trans("HT") . '</td>';
|
||||||
|
print '<td align="right">' . $langs->trans("TTC") . '</td>';
|
||||||
|
print '<td align="right">' . $langs->trans("MinPrice") . ' ' . $langs->trans("HT") . '</td>';
|
||||||
|
print '<td align="right">' . $langs->trans("MinPrice") . ' ' . $langs->trans("TTC") . '</td>';
|
||||||
|
print '<td align="right">' . $langs->trans("ChangedBy") . '</td>';
|
||||||
|
print '<td> </td>';
|
||||||
|
print '</tr>';
|
||||||
|
|
||||||
|
if (count($prodcustprice->lines) > 0)
|
||||||
|
{
|
||||||
|
|
||||||
|
print '<tr class="liste_titre">';
|
||||||
|
print '<td><input type="text" class="flat" name="search_soc" value="' . $search_soc . '" size="20"></td>';
|
||||||
|
print '<td colspan="8"> </td>';
|
||||||
|
// Print the search button
|
||||||
|
print '<td class="liste_titre" align="right">';
|
||||||
|
print '<input class="liste_titre" name="button_search" type="image" src="' . DOL_URL_ROOT . '/theme/' . $conf->theme . '/img/search.png" value="' . dol_escape_htmltag($langs->trans("Search")) . '" title="' . dol_escape_htmltag($langs->trans("Search")) . '">';
|
||||||
|
print '</td>';
|
||||||
|
print '</tr>';
|
||||||
|
|
||||||
|
$var = False;
|
||||||
|
|
||||||
|
foreach ($prodcustprice->lines as $line)
|
||||||
|
{
|
||||||
|
print "<tr " . $bc[$var] . ">";
|
||||||
|
|
||||||
|
$staticprod = new Product($db);
|
||||||
|
$staticprod->fetch($line->fk_product);
|
||||||
|
|
||||||
|
print "<td>" . $staticprod->getNomUrl(1) . "</td>";
|
||||||
|
print "<td>" . dol_print_date($line->datec, "dayhour") . "</td>";
|
||||||
|
|
||||||
|
print '<td align="center">' . $langs->trans($line->price_base_type) . "</td>";
|
||||||
|
print '<td align="right">' . vatrate($line->tva_tx, true, $line->recuperableonly) . "</td>";
|
||||||
|
print '<td align="right">' . price($line->price) . "</td>";
|
||||||
|
print '<td align="right">' . price($line->price_ttc) . "</td>";
|
||||||
|
print '<td align="right">' . price($line->price_min) . '</td>';
|
||||||
|
print '<td align="right">' . price($line->price_min_ttc) . '</td>';
|
||||||
|
|
||||||
|
// User
|
||||||
|
$userstatic = new User($db);
|
||||||
|
$userstatic->fetch($line->fk_user);
|
||||||
|
print '<td align="right">';
|
||||||
|
print $userstatic->getLoginUrl(1);
|
||||||
|
print '</td>';
|
||||||
|
|
||||||
|
// Todo Edit or delete button
|
||||||
|
// Action
|
||||||
|
if ($user->rights->produit->creer || $user->rights->service->creer)
|
||||||
|
{
|
||||||
|
print '<td align="right">';
|
||||||
|
print '<a href="' . $_SERVER["PHP_SELF"] . '?action=showlog_customer_price&socid=' . $object->id . '&prodid=' . $line->fk_product . '">';
|
||||||
|
print img_info();
|
||||||
|
print '</a>';
|
||||||
|
print ' ';
|
||||||
|
print '<a href="' . $_SERVER["PHP_SELF"] . '?action=edit_customer_price&socid=' . $object->id . '&lineid=' . $line->id . '">';
|
||||||
|
print img_edit('default', 0, 'style="vertical-align: middle;"');
|
||||||
|
print '</a>';
|
||||||
|
print ' ';
|
||||||
|
print '<a href="' . $_SERVER["PHP_SELF"] . '?action=delete_customer_price&socid=' . $object->id . '&lineid=' . $line->id . '">';
|
||||||
|
print img_delete('default', 'style="vertical-align: middle;"');
|
||||||
|
print '</a>';
|
||||||
|
print '</td>';
|
||||||
|
}
|
||||||
|
|
||||||
|
print "</tr>\n";
|
||||||
|
}
|
||||||
|
} else
|
||||||
|
{
|
||||||
|
print '<tr ' . $bc[false] . '><td colspan="10">' . $langs->trans('NoPriceSpecificToCustomer') . '</td></tr>';
|
||||||
|
}
|
||||||
|
|
||||||
|
print "</table>";
|
||||||
|
|
||||||
|
print "</form>";
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
156
htdocs/societe/project.php
Normal file
@ -0,0 +1,156 @@
|
|||||||
|
<?php
|
||||||
|
/* Copyright (C) 2001-2007 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||||
|
* Copyright (C) 2005 Brice Davoleau <brice.davoleau@gmail.com>
|
||||||
|
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
|
||||||
|
* Copyright (C) 2006-2015 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
|
* Copyright (C) 2007 Patrick Raguin <patrick.raguin@gmail.com>
|
||||||
|
* Copyright (C) 2010 Juanjo Menent <jmenent@2byte.es>
|
||||||
|
* Copyright (C) 2015 Marcos García <marcosgdf@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/societe/project.php
|
||||||
|
* \ingroup societe
|
||||||
|
* \brief Page of third party projects
|
||||||
|
*/
|
||||||
|
|
||||||
|
require '../main.inc.php';
|
||||||
|
require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php';
|
||||||
|
require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
|
||||||
|
|
||||||
|
$langs->load("companies");
|
||||||
|
|
||||||
|
// Security check
|
||||||
|
$socid = GETPOST('socid','int');
|
||||||
|
if ($user->societe_id) $socid=$user->societe_id;
|
||||||
|
$result = restrictedArea($user, 'societe', $socid, '&societe');
|
||||||
|
|
||||||
|
// Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array
|
||||||
|
$hookmanager->initHooks(array('projectthirdparty'));
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Actions
|
||||||
|
*/
|
||||||
|
|
||||||
|
$parameters=array('id'=>$socid);
|
||||||
|
$reshook=$hookmanager->executeHooks('doActions',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks
|
||||||
|
if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* View
|
||||||
|
*/
|
||||||
|
|
||||||
|
$contactstatic = new Contact($db);
|
||||||
|
|
||||||
|
$form = new Form($db);
|
||||||
|
|
||||||
|
if ($socid)
|
||||||
|
{
|
||||||
|
require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php';
|
||||||
|
require_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php';
|
||||||
|
|
||||||
|
$langs->load("companies");
|
||||||
|
|
||||||
|
|
||||||
|
$object = new Societe($db);
|
||||||
|
$result = $object->fetch($socid);
|
||||||
|
|
||||||
|
$title=$langs->trans("Agenda");
|
||||||
|
if (! empty($conf->global->MAIN_HTML_TITLE) && preg_match('/thirdpartynameonly/',$conf->global->MAIN_HTML_TITLE) && $object->name) $title=$object->name." - ".$title;
|
||||||
|
llxHeader('',$title);
|
||||||
|
|
||||||
|
if (! empty($conf->notification->enabled)) $langs->load("mails");
|
||||||
|
$head = societe_prepare_head($object);
|
||||||
|
|
||||||
|
dol_fiche_head($head, 'project', $langs->trans("ThirdParty"),0,'company');
|
||||||
|
|
||||||
|
dol_banner_tab($object, 'socid', '', ($user->societe_id?0:1), 'rowid', 'nom');
|
||||||
|
|
||||||
|
print '<div class="fichecenter">';
|
||||||
|
|
||||||
|
print '<div class="underbanner clearboth"></div>';
|
||||||
|
print '<table class="border centpercent">';
|
||||||
|
|
||||||
|
// Alias names (commercial, trademark or alias names)
|
||||||
|
print '<tr><td class="titlefield">'.$langs->trans('AliasNames').'</td><td colspan="3">';
|
||||||
|
print $object->name_alias;
|
||||||
|
print "</td></tr>";
|
||||||
|
|
||||||
|
if (! empty($conf->global->SOCIETE_USEPREFIX)) // Old not used prefix field
|
||||||
|
{
|
||||||
|
print '<tr><td>'.$langs->trans('Prefix').'</td><td colspan="3">'.$object->prefix_comm.'</td></tr>';
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($object->client)
|
||||||
|
{
|
||||||
|
print '<tr><td>';
|
||||||
|
print $langs->trans('CustomerCode').'</td><td colspan="3">';
|
||||||
|
print $object->code_client;
|
||||||
|
if ($object->check_codeclient() <> 0) print ' <font class="error">('.$langs->trans("WrongCustomerCode").')</font>';
|
||||||
|
print '</td></tr>';
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($object->fournisseur)
|
||||||
|
{
|
||||||
|
print '<tr><td>';
|
||||||
|
print $langs->trans('SupplierCode').'</td><td colspan="3">';
|
||||||
|
print $object->code_fournisseur;
|
||||||
|
if ($object->check_codefournisseur() <> 0) print ' <font class="error">('.$langs->trans("WrongSupplierCode").')</font>';
|
||||||
|
print '</td></tr>';
|
||||||
|
}
|
||||||
|
|
||||||
|
print '</table>';
|
||||||
|
|
||||||
|
print '</div>';
|
||||||
|
|
||||||
|
dol_fiche_end();
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Barre d'action
|
||||||
|
*/
|
||||||
|
|
||||||
|
print '<div class="tabsAction">';
|
||||||
|
|
||||||
|
if (! empty($conf->projet->enabled))
|
||||||
|
{
|
||||||
|
if (! empty($conf->projet->enabled) && ! empty($user->rights->projet->creer))
|
||||||
|
{
|
||||||
|
print '<a class="butAction" href="'.DOL_URL_ROOT.'/projet/card.php?action=create&socid='.$object->id.'&backtopage='.urlencode($backtopage).'">'.$langs->trans("AddProject").'</a>';
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
print '<a class="butActionRefused" href="#">'.$langs->trans("AddProject").'</a>';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
print '</div>';
|
||||||
|
|
||||||
|
|
||||||
|
print '<br>';
|
||||||
|
|
||||||
|
|
||||||
|
// Projects list
|
||||||
|
$result=show_projects($conf, $langs, $db, $object, $_SERVER["PHP_SELF"].'?socid='.$object->id, 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
llxFooter();
|
||||||
|
|
||||||
|
$db->close();
|
||||||
@ -1908,7 +1908,17 @@ else
|
|||||||
print $object->name_alias;
|
print $object->name_alias;
|
||||||
print "</td></tr>";
|
print "</td></tr>";
|
||||||
|
|
||||||
// Prefix
|
// Prospect/Customer
|
||||||
|
print '<tr><td>'.$langs->trans('ProspectCustomer').'</td><td>';
|
||||||
|
print $object->getLibCustProspStatut();
|
||||||
|
print '</td></tr>';
|
||||||
|
|
||||||
|
// Prospect/Customer
|
||||||
|
print '<tr><td>'.$langs->trans('Supplier').'</td><td>';
|
||||||
|
print yn($object->fournisseur);
|
||||||
|
print '</td></tr>';
|
||||||
|
|
||||||
|
// Prefix
|
||||||
if (! empty($conf->global->SOCIETE_USEPREFIX)) // Old not used prefix field
|
if (! empty($conf->global->SOCIETE_USEPREFIX)) // Old not used prefix field
|
||||||
{
|
{
|
||||||
print '<tr><td>'.$langs->trans('Prefix').'</td><td>'.$object->prefix_comm.'</td>';
|
print '<tr><td>'.$langs->trans('Prefix').'</td><td>'.$object->prefix_comm.'</td>';
|
||||||
@ -2481,9 +2491,6 @@ else
|
|||||||
{
|
{
|
||||||
$result=show_addresses($conf,$langs,$db,$object,$_SERVER["PHP_SELF"].'?socid='.$object->id);
|
$result=show_addresses($conf,$langs,$db,$object,$_SERVER["PHP_SELF"].'?socid='.$object->id);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Projects list
|
|
||||||
$result=show_projects($conf,$langs,$db,$object,$_SERVER["PHP_SELF"].'?socid='.$object->id);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
|
Before Width: | Height: | Size: 593 B After Width: | Height: | Size: 666 B |
|
Before Width: | Height: | Size: 912 B After Width: | Height: | Size: 655 B |
|
Before Width: | Height: | Size: 607 B After Width: | Height: | Size: 581 B |
@ -1145,6 +1145,10 @@ div.vmenu, td.vmenu {
|
|||||||
<?php } ?>
|
<?php } ?>
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.vmenusearchselectcombo {
|
||||||
|
width: 172px;
|
||||||
|
}
|
||||||
|
|
||||||
.menu_contenu {
|
.menu_contenu {
|
||||||
padding-top: 3px;
|
padding-top: 3px;
|
||||||
padding-bottom: 2px;
|
padding-bottom: 2px;
|
||||||
@ -1219,17 +1223,17 @@ div.blockvmenusearch
|
|||||||
color: #000000;
|
color: #000000;
|
||||||
text-align: <?php print $left; ?>;
|
text-align: <?php print $left; ?>;
|
||||||
text-decoration: none;
|
text-decoration: none;
|
||||||
padding-left: 5px;
|
/*padding-left: 5px;
|
||||||
padding-right: 1px;
|
padding-right: 1px;
|
||||||
padding-top: 3px;
|
padding-top: 3px;
|
||||||
padding-bottom: 3px;
|
padding-bottom: 3px; */
|
||||||
margin: 1px 0px 8px 2px;
|
margin: 1px 0px 4px 2px;
|
||||||
background: rgb(<?php echo $colorbackvmenu1; ?>);
|
background: rgb(<?php echo $colorbackvmenu1; ?>);
|
||||||
|
|
||||||
border-left: 1px solid #AAA;
|
/*border-left: 1px solid #AAA;
|
||||||
border-right: 1px solid #BBB;
|
border-right: 1px solid #BBB;
|
||||||
border-bottom: 1px solid #BBB;
|
border-bottom: 1px solid #BBB;
|
||||||
border-top: 1px solid #BBB;
|
border-top: 1px solid #BBB;*/
|
||||||
/*border-radius: 4px;
|
/*border-radius: 4px;
|
||||||
-moz-border-radius: 4px;
|
-moz-border-radius: 4px;
|
||||||
-moz-box-shadow: 3px 3px 4px #DDD;
|
-moz-box-shadow: 3px 3px 4px #DDD;
|
||||||
|
|||||||
|
Before Width: | Height: | Size: 593 B After Width: | Height: | Size: 666 B |
|
Before Width: | Height: | Size: 912 B After Width: | Height: | Size: 655 B |
|
Before Width: | Height: | Size: 607 B After Width: | Height: | Size: 581 B |