diff --git a/htdocs/accountancy/admin/journal.php b/htdocs/accountancy/admin/journal.php index ca4ab67aee8..b511c6dfd1a 100644 --- a/htdocs/accountancy/admin/journal.php +++ b/htdocs/accountancy/admin/journal.php @@ -1,31 +1,32 @@ * Copyright (C) 2013-2015 Alexandre Spangaro - * Copyright (C) 2014 Florian Henry - * Copyright (C) 2014 Marcos García - * Copyright (C) 2014 Juanjo Menent - * Copyright (C) 2015 Jean-François Ferry - * - * 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 . - * - */ +* Copyright (C) 2014 Florian Henry +* Copyright (C) 2014 Marcos García +* Copyright (C) 2014 Juanjo Menent +* Copyright (C) 2015 Jean-François Ferry +* Copyright (C) 2016 Laurent Destailleur +* +* 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 . +* +*/ /** * \file htdocs/accountancy/admin/journal.php - * \ingroup Advanced accountancy - * \brief Setup page to configure accounting expert module - */ +* \ingroup Advanced accountancy +* \brief Setup page to configure accounting expert module +*/ require '../../main.inc.php'; // Class @@ -48,24 +49,44 @@ $list = array ( 'ACCOUNTING_PURCHASE_JOURNAL', 'ACCOUNTING_SOCIAL_JOURNAL', 'ACCOUNTING_MISCELLANEOUS_JOURNAL', - 'ACCOUNTING_EXPENSEREPORT_JOURNAL' + 'ACCOUNTING_EXPENSEREPORT_JOURNAL' ); /* * Actions - */ +*/ if ($action == 'update') { $error = 0; - - foreach ( $list as $constname ) { + + // Save vars + foreach ($list as $constname) + { $constvalue = GETPOST($constname, 'alpha'); - + if (! dolibarr_set_const($db, $constname, $constvalue, 'chaine', 0, '', $conf->entity)) { $error ++; } } - + + // Save bank account journals + $arrayofbankaccount = GETPOST('bank_account', 'array'); + foreach($arrayofbankaccount as $key => $code) + { + $bankaccount = new Account($db); + $res = $bankaccount->fetch($key); + if ($res > 0) + { + $bankaccount->accountancy_journal = $code; + $bankaccount->update($user); + } + else + { + $error++; + break; + } + } + if (! $error) { setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); } else { @@ -75,7 +96,7 @@ if ($action == 'update') { /* * View - */ +*/ llxHeader(); @@ -99,13 +120,13 @@ print "\n"; foreach ( $list as $key ) { $var = ! $var; - + print ''; - + // Param $label = $langs->trans($key); print ''; - + // Value print ''; print ''; @@ -118,11 +139,11 @@ print '
'; print ''; print ''; -print ''; +print ''; print "\n"; // Bank account -$sql = "SELECT rowid, label, accountancy_journal"; +$sql = "SELECT rowid, label, number, accountancy_journal"; $sql .= " FROM " . MAIN_DB_PREFIX . "bank_account"; $sql .= " WHERE entity = " . $conf->entity; $sql .= " AND clos = 0"; @@ -132,29 +153,41 @@ $resql = $db->query($sql); if ($resql) { $numr = $db->num_rows($resql); $i = 0; - + if ($numr > 0) - - while ( $i < $numr ) { - $objp = $db->fetch_object($resql); + + $bankaccountstatic=new Account($db); + + while ( $i < $numr ) { + $objp = $db->fetch_object($resql); - $var = ! $var; + $var = ! $var; - print ''; + $bankaccountstatic->id = $objp->rowid; + $bankaccountstatic->label = $objp->label; + $bankaccountstatic->number = $objp->number; + $bankaccountstatic->accountancy_journal = $objp->accountancy_journal; - // Param - print ''; + print ''; - // Value - print ''; + // Param + print ''; - $i ++; - } -} else + // Value + print ''; + + $i ++; + } + $db->free($resql); +} +else +{ dol_print_error($db); -$db->free($resql); +} print "
' . $langs->trans('JournalFinancial') . '' . $langs->trans('JournalFinancial') . ' ('.$langs->trans('Opened').')
'; - print ''; - print '
'; + print ''; + print '
\n"; diff --git a/htdocs/cashdesk/index.php b/htdocs/cashdesk/index.php index 3a5b54519a8..4a892f909e5 100644 --- a/htdocs/cashdesk/index.php +++ b/htdocs/cashdesk/index.php @@ -59,7 +59,7 @@ top_htmlhead('','',0,0,'',$arrayofcss);
diff --git a/htdocs/comm/action/listactions.php b/htdocs/comm/action/listactions.php index 31290318742..1f597ffeddc 100644 --- a/htdocs/comm/action/listactions.php +++ b/htdocs/comm/action/listactions.php @@ -308,7 +308,7 @@ if ($resql) print_liste_field_titre($langs->trans("DateEnd"),$_SERVER["PHP_SELF"],"a.datep2",$param,'','align="center"',$sortfield,$sortorder); print_liste_field_titre($langs->trans("ThirdParty"),$_SERVER["PHP_SELF"],"s.nom",$param,"","",$sortfield,$sortorder); print_liste_field_titre($langs->trans("Contact"),$_SERVER["PHP_SELF"],"a.fk_contact",$param,"","",$sortfield,$sortorder); - print_liste_field_titre($langs->trans("ActionsOwnedBy"),$_SERVER["PHP_SELF"],"",$param,"","",$sortfield,$sortorder); + print_liste_field_titre($langs->trans("ActionsOwnedByShort"),$_SERVER["PHP_SELF"],"",$param,"","",$sortfield,$sortorder); print_liste_field_titre($langs->trans("Status"),$_SERVER["PHP_SELF"],"a.percent",$param,"",'align="center"',$sortfield,$sortorder); print_liste_field_titre(""); print "\n"; diff --git a/htdocs/core/lib/accounting.lib.php b/htdocs/core/lib/accounting.lib.php index 7a73861e71f..773e68913f9 100644 --- a/htdocs/core/lib/accounting.lib.php +++ b/htdocs/core/lib/accounting.lib.php @@ -37,26 +37,26 @@ function admin_accounting_prepare_head(AccountingAccount $object=null) $head = array (); $head[$h][0] = dol_buildpath('/accountancy/admin/index.php', 1); - $head[$h][1] = $langs->trans("Configuration"); + $head[$h][1] = $langs->trans("Miscellaneous"); $head[$h][2] = 'general'; $h ++; - // Show more tabs from modules - // Entries must be declared in modules descriptor with line - // $this->tabs = array('entity:+tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to add new tab - // $this->tabs = array('entity:-tabname); to remove a tab - complete_head_from_modules($conf, $langs, $object, $head, $h, 'accounting_admin'); - $head[$h][0] = DOL_URL_ROOT.'/accountancy/admin/journal.php'; $head[$h][1] = $langs->trans("Journaux"); $head[$h][2] = 'journal'; $h ++; $head[$h][0] = DOL_URL_ROOT.'/accountancy/admin/export.php'; - $head[$h][1] = $langs->trans("Export"); + $head[$h][1] = $langs->trans("ExportOptions"); $head[$h][2] = 'export'; $h ++; + // Show more tabs from modules + // Entries must be declared in modules descriptor with line + // $this->tabs = array('entity:+tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to add new tab + // $this->tabs = array('entity:-tabname); to remove a tab + complete_head_from_modules($conf, $langs, $object, $head, $h, 'accounting_admin'); + complete_head_from_modules($conf, $langs, $object, $head, $h, 'accounting_admin', 'remove'); return $head; diff --git a/htdocs/core/modules/modAccounting.class.php b/htdocs/core/modules/modAccounting.class.php index f20cf663b2c..03b450aa275 100644 --- a/htdocs/core/modules/modAccounting.class.php +++ b/htdocs/core/modules/modAccounting.class.php @@ -3,6 +3,7 @@ * Copyright (C) 2013-2016 Alexandre Spangaro * Copyright (C) 2014 Ari Elbaz (elarifr) * Copyright (C) 2014 Florian Henry + * Copyright (C) 2016 Laurent Destailleur * * 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 @@ -50,7 +51,7 @@ class modAccounting extends DolibarrModules $this->description = "Advanced accounting management"; // Possible values for version are: 'development', 'experimental', 'dolibarr' or version - $this->version = 'development'; + $this->version = 'experimental'; $this->const_name = 'MAIN_MODULE_' . strtoupper($this->name); $this->special = 0; diff --git a/htdocs/langs/en_US/agenda.lang b/htdocs/langs/en_US/agenda.lang index a01e0c6c412..d4b651b46b5 100644 --- a/htdocs/langs/en_US/agenda.lang +++ b/htdocs/langs/en_US/agenda.lang @@ -8,6 +8,7 @@ Calendar=Calendar Calendars=Calendars LocalAgenda=Internal calendar ActionsOwnedBy=Event owned by +ActionsOwnedByShort=Owner AffectedTo=Assigned to DoneBy=Done by Event=Event diff --git a/htdocs/opensurvey/card.php b/htdocs/opensurvey/card.php index ce941a680c7..b1c69268325 100644 --- a/htdocs/opensurvey/card.php +++ b/htdocs/opensurvey/card.php @@ -84,14 +84,14 @@ if (empty($reshook)) if ($action == 'close') { $object->status = Opensurveysondage::STATUS_CLOSED; - $object->update(); + $object->update($user); } // Reopend if ($action == 'reopen') { $object->status = Opensurveysondage::STATUS_VALIDATED; - $object->update(); + $object->update($user); } // Update diff --git a/htdocs/opensurvey/class/opensurveysondage.class.php b/htdocs/opensurvey/class/opensurveysondage.class.php index fecb7904a9c..02952f4bf75 100644 --- a/htdocs/opensurvey/class/opensurveysondage.class.php +++ b/htdocs/opensurvey/class/opensurveysondage.class.php @@ -275,7 +275,7 @@ class Opensurveysondage extends CommonObject * @param int $notrigger 0=launch triggers after, 1=disable triggers * @return int <0 if KO, >0 if OK */ - function update($user=null, $notrigger=0) + function update($user, $notrigger=0) { global $conf, $langs; $error=0;