Merge branch 'develop' of https://github.com/Dolibarr/dolibarr.git into develop_dict

This commit is contained in:
Regis Houssin 2017-06-08 15:05:45 +02:00
commit 4b98a1aefd
77 changed files with 1232 additions and 1074 deletions

View File

@ -52,7 +52,7 @@ if ($user->societe_id > 0) accessforbidden();
if (! $user->rights->accounting->chartofaccount) accessforbidden(); if (! $user->rights->accounting->chartofaccount) accessforbidden();
// Load variable for pagination // Load variable for pagination
$limit = GETPOST("limit")?GETPOST("limit","int"):$conf->liste_limit; $limit = GETPOST('limit','int')?GETPOST('limit','int'):$conf->liste_limit;
$sortfield = GETPOST("sortfield", 'alpha'); $sortfield = GETPOST("sortfield", 'alpha');
$sortorder = GETPOST("sortorder", 'sortorder'); $sortorder = GETPOST("sortorder", 'sortorder');
$page = GETPOST("page", 'int'); $page = GETPOST("page", 'int');

View File

@ -28,7 +28,7 @@ require_once DOL_DOCUMENT_ROOT . '/core/class/fiscalyear.class.php';
$action = GETPOST('action','aZ09'); $action = GETPOST('action','aZ09');
// Load variable for pagination // Load variable for pagination
$limit = GETPOST("limit")?GETPOST("limit","int"):$conf->liste_limit; $limit = GETPOST('limit','int')?GETPOST('limit','int'):$conf->liste_limit;
$sortfield = GETPOST('sortfield','alpha'); $sortfield = GETPOST('sortfield','alpha');
$sortorder = GETPOST('sortorder','alpha'); $sortorder = GETPOST('sortorder','alpha');
$page = GETPOST('page','int'); $page = GETPOST('page','int');

View File

@ -39,7 +39,7 @@ $langs->load("accountancy");
if (! $user->admin) if (! $user->admin)
accessforbidden(); accessforbidden();
$limit = GETPOST("limit")?GETPOST("limit","int"):(empty($conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION)?$conf->liste_limit:$conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION); $limit = GETPOST('limit','int')?GETPOST('limit','int'):(empty($conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION)?$conf->liste_limit:$conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION);
$sortfield = GETPOST("sortfield",'alpha'); $sortfield = GETPOST("sortfield",'alpha');
$sortorder = GETPOST("sortorder",'alpha'); $sortorder = GETPOST("sortorder",'alpha');
$page = GETPOST("page",'int'); $page = GETPOST("page",'int');

View File

@ -70,7 +70,7 @@ $accounting_product_mode = GETPOST('accounting_product_mode', 'alpha');
$btn_changeaccount = GETPOST('changeaccount'); $btn_changeaccount = GETPOST('changeaccount');
$btn_changetype = GETPOST('changetype'); $btn_changetype = GETPOST('changetype');
$limit = GETPOST("limit")?GETPOST("limit","int"):(empty($conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION)?$conf->liste_limit:$conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION); $limit = GETPOST('limit','int')?GETPOST('limit','int'):(empty($conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION)?$conf->liste_limit:$conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION);
$sortfield = GETPOST("sortfield",'alpha'); $sortfield = GETPOST("sortfield",'alpha');
$sortorder = GETPOST("sortorder",'alpha'); $sortorder = GETPOST("sortorder",'alpha');
$page = GETPOST("page",'int'); $page = GETPOST("page",'int');

View File

@ -55,7 +55,7 @@ if (GETPOST("button_export_csv_x") || GETPOST("button_export_csv")) {
$action = 'export_csv'; $action = 'export_csv';
} }
$limit = GETPOST('limit') ? GETPOST('limit', 'int') : $conf->liste_limit; $limit = GETPOST('limit','int')?GETPOST('limit', 'int'):$conf->liste_limit;
$offset = $limit * $page; $offset = $limit * $page;

View File

@ -80,7 +80,7 @@ $search_direction = GETPOST('search_direction', 'alpha');
$search_ledger_code = GETPOST('search_ledger_code', 'alpha'); $search_ledger_code = GETPOST('search_ledger_code', 'alpha');
// Load variable for pagination // Load variable for pagination
$limit = GETPOST('limit') ? GETPOST('limit', 'int') : (empty($conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION)?$conf->liste_limit:$conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION); $limit = GETPOST('limit','int')?GETPOST('limit', 'int'):(empty($conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION)?$conf->liste_limit:$conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION);
$sortfield = GETPOST('sortfield', 'alpha'); $sortfield = GETPOST('sortfield', 'alpha');
$sortorder = GETPOST('sortorder', 'alpha'); $sortorder = GETPOST('sortorder', 'alpha');
$page = GETPOST('page','int'); $page = GETPOST('page','int');
@ -466,7 +466,7 @@ print '</td>';
print '<td align="right">'; print '<td align="right">';
print price($total_credit); print price($total_credit);
print '</td>'; print '</td>';
print '<td></td>'; print '<td colspan="2"></td>';
print '</tr>'; print '</tr>';
print "</table>"; print "</table>";

View File

@ -59,7 +59,7 @@ $search_direction = GETPOST('search_direction', 'alpha');
$search_ledger_code = GETPOST('search_ledger_code', 'alpha'); $search_ledger_code = GETPOST('search_ledger_code', 'alpha');
// Load variable for pagination // Load variable for pagination
$limit = GETPOST('limit') ? GETPOST('limit', 'int') : (empty($conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION)?$conf->liste_limit:$conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION); $limit = GETPOST('limit','int')?GETPOST('limit', 'int'):(empty($conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION)?$conf->liste_limit:$conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION);
$sortfield = GETPOST('sortfield', 'alpha'); $sortfield = GETPOST('sortfield', 'alpha');
$sortorder = GETPOST('sortorder', 'alpha'); $sortorder = GETPOST('sortorder', 'alpha');
$page = GETPOST('page','int'); $page = GETPOST('page','int');

View File

@ -37,7 +37,7 @@ $langs->load("accountancy");
$page = GETPOST("page"); $page = GETPOST("page");
$sortorder = GETPOST("sortorder"); $sortorder = GETPOST("sortorder");
$sortfield = GETPOST("sortfield"); $sortfield = GETPOST("sortfield");
$limit = GETPOST('limit') ? GETPOST('limit', 'int') : $conf->liste_limit; $limit = GETPOST('limit','int')?GETPOST('limit', 'int'):$conf->liste_limit;
$search_date_start = dol_mktime(0, 0, 0, GETPOST('date_startmonth', 'int'), GETPOST('date_startday', 'int'), GETPOST('date_startyear', 'int')); $search_date_start = dol_mktime(0, 0, 0, GETPOST('date_startmonth', 'int'), GETPOST('date_startday', 'int'), GETPOST('date_startyear', 'int'));
$search_date_end = dol_mktime(0, 0, 0, GETPOST('date_endmonth', 'int'), GETPOST('date_endday', 'int'), GETPOST('date_endyear', 'int')); $search_date_end = dol_mktime(0, 0, 0, GETPOST('date_endmonth', 'int'), GETPOST('date_endday', 'int'), GETPOST('date_endyear', 'int'));
$search_doc_type = GETPOST('search_doc_type', 'alpha'); $search_doc_type = GETPOST('search_doc_type', 'alpha');

View File

@ -85,6 +85,7 @@ class BookKeeping extends CommonObject
public $fk_user_author; public $fk_user_author;
public $import_key; public $import_key;
public $code_journal; public $code_journal;
public $journal_label;
public $piece_num; public $piece_num;
/** /**
@ -156,6 +157,9 @@ class BookKeeping extends CommonObject
if (isset($this->code_journal)) { if (isset($this->code_journal)) {
$this->code_journal = trim($this->code_journal); $this->code_journal = trim($this->code_journal);
} }
if (isset($this->journal_label)) {
$this->journal_label = trim($this->journal_label);
}
if (isset($this->piece_num)) { if (isset($this->piece_num)) {
$this->piece_num = trim($this->piece_num); $this->piece_num = trim($this->piece_num);
} }
@ -250,6 +254,7 @@ class BookKeeping extends CommonObject
$sql .= ", fk_user_author"; $sql .= ", fk_user_author";
$sql .= ", import_key"; $sql .= ", import_key";
$sql .= ", code_journal"; $sql .= ", code_journal";
$sql .= ", journal_label";
$sql .= ", piece_num"; $sql .= ", piece_num";
$sql .= ', entity'; $sql .= ', entity';
$sql .= ") VALUES ("; $sql .= ") VALUES (";
@ -268,6 +273,7 @@ class BookKeeping extends CommonObject
$sql .= ",'" . $this->fk_user_author . "'"; $sql .= ",'" . $this->fk_user_author . "'";
$sql .= ",'" . $this->db->idate($this->date_create). "'"; $sql .= ",'" . $this->db->idate($this->date_create). "'";
$sql .= ",'" . $this->code_journal . "'"; $sql .= ",'" . $this->code_journal . "'";
$sql .= ",'" . $this->journal_label . "'";
$sql .= "," . $this->piece_num; $sql .= "," . $this->piece_num;
$sql .= ", " . (! isset($this->entity) ? '1' : $this->entity); $sql .= ", " . (! isset($this->entity) ? '1' : $this->entity);
$sql .= ")"; $sql .= ")";
@ -384,6 +390,9 @@ class BookKeeping extends CommonObject
if (isset($this->code_journal)) { if (isset($this->code_journal)) {
$this->code_journal = trim($this->code_journal); $this->code_journal = trim($this->code_journal);
} }
if (isset($this->journal_label)) {
$this->journal_label = trim($this->journal_label);
}
if (isset($this->piece_num)) { if (isset($this->piece_num)) {
$this->piece_num = trim($this->piece_num); $this->piece_num = trim($this->piece_num);
} }
@ -410,6 +419,7 @@ class BookKeeping extends CommonObject
$sql .= 'fk_user_author,'; $sql .= 'fk_user_author,';
$sql .= 'import_key,'; $sql .= 'import_key,';
$sql .= 'code_journal,'; $sql .= 'code_journal,';
$sql .= 'journal_label,';
$sql .= 'piece_num,'; $sql .= 'piece_num,';
$sql .= 'entity'; $sql .= 'entity';
$sql .= ') VALUES ('; $sql .= ') VALUES (';
@ -428,6 +438,7 @@ class BookKeeping extends CommonObject
$sql .= ' ' . $user->id . ','; $sql .= ' ' . $user->id . ',';
$sql .= ' ' . (! isset($this->import_key) ? 'NULL' : "'" . $this->db->escape($this->import_key) . "'") . ','; $sql .= ' ' . (! isset($this->import_key) ? 'NULL' : "'" . $this->db->escape($this->import_key) . "'") . ',';
$sql .= ' ' . (empty($this->code_journal) ? 'NULL' : "'" . $this->db->escape($this->code_journal) . "'") . ','; $sql .= ' ' . (empty($this->code_journal) ? 'NULL' : "'" . $this->db->escape($this->code_journal) . "'") . ',';
$sql .= ' ' . (empty($this->journal_label) ? 'NULL' : "'" . $this->db->escape($this->journal_label) . "'") . ',';
$sql .= ' ' . (empty($this->piece_num) ? 'NULL' : $this->piece_num).','; $sql .= ' ' . (empty($this->piece_num) ? 'NULL' : $this->piece_num).',';
$sql .= ' ' . (! isset($this->entity) ? '1' : $this->entity); $sql .= ' ' . (! isset($this->entity) ? '1' : $this->entity);
$sql .= ')'; $sql .= ')';
@ -497,6 +508,7 @@ class BookKeeping extends CommonObject
$sql .= " t.fk_user_author,"; $sql .= " t.fk_user_author,";
$sql .= " t.import_key,"; $sql .= " t.import_key,";
$sql .= " t.code_journal,"; $sql .= " t.code_journal,";
$sql .= " t.journal_label,";
$sql .= " t.piece_num"; $sql .= " t.piece_num";
$sql .= ' FROM ' . MAIN_DB_PREFIX . $this->table_element . ' as t'; $sql .= ' FROM ' . MAIN_DB_PREFIX . $this->table_element . ' as t';
$sql .= ' WHERE 1 = 1'; $sql .= ' WHERE 1 = 1';
@ -530,6 +542,7 @@ class BookKeeping extends CommonObject
$this->fk_user_author = $obj->fk_user_author; $this->fk_user_author = $obj->fk_user_author;
$this->import_key = $obj->import_key; $this->import_key = $obj->import_key;
$this->code_journal = $obj->code_journal; $this->code_journal = $obj->code_journal;
$this->journal_label = $obj->journal_label;
$this->piece_num = $obj->piece_num; $this->piece_num = $obj->piece_num;
} }
$this->db->free($resql); $this->db->free($resql);
@ -581,6 +594,7 @@ class BookKeeping extends CommonObject
$sql .= " t.fk_user_author,"; $sql .= " t.fk_user_author,";
$sql .= " t.import_key,"; $sql .= " t.import_key,";
$sql .= " t.code_journal,"; $sql .= " t.code_journal,";
$sql .= " t.journal_label,";
$sql .= " t.piece_num"; $sql .= " t.piece_num";
// Manage filter // Manage filter
$sqlwhere = array (); $sqlwhere = array ();
@ -643,6 +657,7 @@ class BookKeeping extends CommonObject
$line->fk_user_author = $obj->fk_user_author; $line->fk_user_author = $obj->fk_user_author;
$line->import_key = $obj->import_key; $line->import_key = $obj->import_key;
$line->code_journal = $obj->code_journal; $line->code_journal = $obj->code_journal;
$line->journal_label = $obj->journal_label;
$line->piece_num = $obj->piece_num; $line->piece_num = $obj->piece_num;
$this->lines[] = $line; $this->lines[] = $line;
@ -693,6 +708,7 @@ class BookKeeping extends CommonObject
$sql .= " t.fk_user_author,"; $sql .= " t.fk_user_author,";
$sql .= " t.import_key,"; $sql .= " t.import_key,";
$sql .= " t.code_journal,"; $sql .= " t.code_journal,";
$sql .= " t.journal_label,";
$sql .= " t.piece_num"; $sql .= " t.piece_num";
$sql .= ' FROM ' . MAIN_DB_PREFIX . $this->table_element . ' as t'; $sql .= ' FROM ' . MAIN_DB_PREFIX . $this->table_element . ' as t';
// Manage filter // Manage filter
@ -752,6 +768,7 @@ class BookKeeping extends CommonObject
$line->fk_user_author = $obj->fk_user_author; $line->fk_user_author = $obj->fk_user_author;
$line->import_key = $obj->import_key; $line->import_key = $obj->import_key;
$line->code_journal = $obj->code_journal; $line->code_journal = $obj->code_journal;
$line->journal_label = $obj->journal_label;
$line->piece_num = $obj->piece_num; $line->piece_num = $obj->piece_num;
$this->lines[] = $line; $this->lines[] = $line;
@ -903,6 +920,9 @@ class BookKeeping extends CommonObject
if (isset($this->code_journal)) { if (isset($this->code_journal)) {
$this->code_journal = trim($this->code_journal); $this->code_journal = trim($this->code_journal);
} }
if (isset($this->journal_label)) {
$this->journal_label = trim($this->journal_label);
}
if (isset($this->piece_num)) { if (isset($this->piece_num)) {
$this->piece_num = trim($this->piece_num); $this->piece_num = trim($this->piece_num);
} }
@ -927,6 +947,7 @@ class BookKeeping extends CommonObject
$sql .= ' fk_user_author = ' . (isset($this->fk_user_author) ? $this->fk_user_author : "null") . ','; $sql .= ' fk_user_author = ' . (isset($this->fk_user_author) ? $this->fk_user_author : "null") . ',';
$sql .= ' import_key = ' . (isset($this->import_key) ? "'" . $this->db->escape($this->import_key) . "'" : "null") . ','; $sql .= ' import_key = ' . (isset($this->import_key) ? "'" . $this->db->escape($this->import_key) . "'" : "null") . ',';
$sql .= ' code_journal = ' . (isset($this->code_journal) ? "'" . $this->db->escape($this->code_journal) . "'" : "null") . ','; $sql .= ' code_journal = ' . (isset($this->code_journal) ? "'" . $this->db->escape($this->code_journal) . "'" : "null") . ',';
$sql .= ' journal_label = ' . (isset($this->journal_label) ? "'" . $this->db->escape($this->journal_label) . "'" : "null") . ',';
$sql .= ' piece_num = ' . (isset($this->piece_num) ? $this->piece_num : "null"); $sql .= ' piece_num = ' . (isset($this->piece_num) ? $this->piece_num : "null");
$sql .= ' WHERE rowid=' . $this->id; $sql .= ' WHERE rowid=' . $this->id;
@ -1185,6 +1206,7 @@ class BookKeeping extends CommonObject
$this->fk_user_author = $user->id; $this->fk_user_author = $user->id;
$this->import_key = ''; $this->import_key = '';
$this->code_journal = ''; $this->code_journal = '';
$this->journal_label = '';
$this->piece_num = ''; $this->piece_num = '';
} }
@ -1197,7 +1219,7 @@ class BookKeeping extends CommonObject
public function fetchPerMvt($piecenum) { public function fetchPerMvt($piecenum) {
global $conf; global $conf;
$sql = "SELECT piece_num,doc_date,code_journal,doc_ref,doc_type"; $sql = "SELECT piece_num,doc_date,code_journal,journal_label,doc_ref,doc_type";
$sql .= " FROM " . MAIN_DB_PREFIX . $this->table_element; $sql .= " FROM " . MAIN_DB_PREFIX . $this->table_element;
$sql .= " WHERE piece_num = " . $piecenum; $sql .= " WHERE piece_num = " . $piecenum;
$sql .= " AND entity IN (" . getEntity('accountancy') . ")"; $sql .= " AND entity IN (" . getEntity('accountancy') . ")";
@ -1209,6 +1231,7 @@ class BookKeeping extends CommonObject
$this->piece_num = $obj->piece_num; $this->piece_num = $obj->piece_num;
$this->code_journal = $obj->code_journal; $this->code_journal = $obj->code_journal;
$this->journal_label = $obj->journal_label;
$this->doc_date = $this->db->jdate($obj->doc_date); $this->doc_date = $this->db->jdate($obj->doc_date);
$this->doc_ref = $obj->doc_ref; $this->doc_ref = $obj->doc_ref;
$this->doc_type = $obj->doc_type; $this->doc_type = $obj->doc_type;
@ -1260,7 +1283,7 @@ class BookKeeping extends CommonObject
$sql = "SELECT rowid, doc_date, doc_type,"; $sql = "SELECT rowid, doc_date, doc_type,";
$sql .= " doc_ref, fk_doc, fk_docdet, code_tiers,"; $sql .= " doc_ref, fk_doc, fk_docdet, code_tiers,";
$sql .= " numero_compte, label_compte, debit, credit,"; $sql .= " numero_compte, label_compte, debit, credit,";
$sql .= " montant, sens, fk_user_author, import_key, code_journal, piece_num"; $sql .= " montant, sens, fk_user_author, import_key, code_journal, journal_label, piece_num";
$sql .= " FROM " . MAIN_DB_PREFIX . $this->table_element; $sql .= " FROM " . MAIN_DB_PREFIX . $this->table_element;
$sql .= " WHERE piece_num = " . $piecenum; $sql .= " WHERE piece_num = " . $piecenum;
$sql .= " AND entity IN (" . getEntity('accountancy') . ")"; $sql .= " AND entity IN (" . getEntity('accountancy') . ")";
@ -1288,6 +1311,7 @@ class BookKeeping extends CommonObject
$line->montant = $obj->montant; $line->montant = $obj->montant;
$line->sens = $obj->sens; $line->sens = $obj->sens;
$line->code_journal = $obj->code_journal; $line->code_journal = $obj->code_journal;
$line->journal_label = $obj->journal_label;
$line->piece_num = $obj->piece_num; $line->piece_num = $obj->piece_num;
$this->linesmvt[] = $line; $this->linesmvt[] = $line;
@ -1533,5 +1557,6 @@ class BookKeepingLine
public $fk_user_author; public $fk_user_author;
public $import_key; public $import_key;
public $code_journal; public $code_journal;
public $journal_label;
public $piece_num; public $piece_num;
} }

View File

@ -55,7 +55,7 @@ $search_country = GETPOST('search_country', 'alpha');
$search_tvaintra = GETPOST('search_tvaintra', 'alpha'); $search_tvaintra = GETPOST('search_tvaintra', 'alpha');
// Load variable for pagination // Load variable for pagination
$limit = GETPOST('limit') ? GETPOST('limit', 'int') : (empty($conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION)?$conf->liste_limit:$conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION); $limit = GETPOST('limit','int')?GETPOST('limit', 'int'):(empty($conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION)?$conf->liste_limit:$conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION);
$sortfield = GETPOST('sortfield', 'alpha'); $sortfield = GETPOST('sortfield', 'alpha');
$sortorder = GETPOST('sortorder', 'alpha'); $sortorder = GETPOST('sortorder', 'alpha');
$page = GETPOST('page', 'int'); $page = GETPOST('page', 'int');

View File

@ -63,7 +63,7 @@ $search_vat = GETPOST('search_vat', 'alpha');
$btn_ventil = GETPOST('ventil', 'alpha'); $btn_ventil = GETPOST('ventil', 'alpha');
// Load variable for pagination // Load variable for pagination
$limit = GETPOST('limit') ? GETPOST('limit', 'int') : (empty($conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION)?$conf->liste_limit:$conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION); $limit = GETPOST('limit','int')?GETPOST('limit', 'int'):(empty($conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION)?$conf->liste_limit:$conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION);
$sortfield = GETPOST('sortfield', 'alpha'); $sortfield = GETPOST('sortfield', 'alpha');
$sortorder = GETPOST('sortorder', 'alpha'); $sortorder = GETPOST('sortorder', 'alpha');
$page = GETPOST('page','int'); $page = GETPOST('page','int');

View File

@ -52,7 +52,7 @@ $search_account = GETPOST('search_account', 'alpha');
$search_vat = GETPOST('search_vat', 'alpha'); $search_vat = GETPOST('search_vat', 'alpha');
// Load variable for pagination // Load variable for pagination
$limit = GETPOST('limit') ? GETPOST('limit', 'int') : (empty($conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION)?$conf->liste_limit:$conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION); $limit = GETPOST('limit','int')?GETPOST('limit', 'int'):(empty($conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION)?$conf->liste_limit:$conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION);
$sortfield = GETPOST('sortfield', 'alpha'); $sortfield = GETPOST('sortfield', 'alpha');
$sortorder = GETPOST('sortorder', 'alpha'); $sortorder = GETPOST('sortorder', 'alpha');
$page = GETPOST('page', 'int'); $page = GETPOST('page', 'int');

View File

@ -61,7 +61,7 @@ $search_vat = GETPOST('search_vat', 'alpha');
$btn_ventil = GETPOST('ventil', 'alpha'); $btn_ventil = GETPOST('ventil', 'alpha');
// Load variable for pagination // Load variable for pagination
$limit = GETPOST('limit') ? GETPOST('limit', 'int') : (empty($conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION)?$conf->liste_limit:$conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION); $limit = GETPOST('limit','int')?GETPOST('limit', 'int'):(empty($conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION)?$conf->liste_limit:$conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION);
$sortfield = GETPOST('sortfield', 'alpha'); $sortfield = GETPOST('sortfield', 'alpha');
$sortorder = GETPOST('sortorder', 'alpha'); $sortorder = GETPOST('sortorder', 'alpha');
$page = GETPOST('page','int'); $page = GETPOST('page','int');

View File

@ -28,8 +28,6 @@
* \brief Page with bank journal * \brief Page with bank journal
*/ */
require '../../main.inc.php'; require '../../main.inc.php';
// Class
require_once DOL_DOCUMENT_ROOT . '/core/lib/report.lib.php'; require_once DOL_DOCUMENT_ROOT . '/core/lib/report.lib.php';
require_once DOL_DOCUMENT_ROOT . '/core/lib/date.lib.php'; require_once DOL_DOCUMENT_ROOT . '/core/lib/date.lib.php';
require_once DOL_DOCUMENT_ROOT . '/core/lib/bank.lib.php'; require_once DOL_DOCUMENT_ROOT . '/core/lib/bank.lib.php';
@ -53,8 +51,6 @@ require_once DOL_DOCUMENT_ROOT . '/societe/class/client.class.php';
require_once DOL_DOCUMENT_ROOT . '/expensereport/class/expensereport.class.php'; require_once DOL_DOCUMENT_ROOT . '/expensereport/class/expensereport.class.php';
require_once DOL_DOCUMENT_ROOT . '/expensereport/class/paymentexpensereport.class.php'; require_once DOL_DOCUMENT_ROOT . '/expensereport/class/paymentexpensereport.class.php';
// Langs
$langs->load("companies"); $langs->load("companies");
$langs->load("other"); $langs->load("other");
$langs->load("compta"); $langs->load("compta");
@ -77,6 +73,7 @@ $date_endyear = GETPOST('date_endyear');
$action = GETPOST('action','aZ09'); $action = GETPOST('action','aZ09');
$now = dol_now(); $now = dol_now();
$action = GETPOST('action','aZ09');
// Security check // Security check
if ($user->societe_id > 0 && empty($id_journal)) if ($user->societe_id > 0 && empty($id_journal))
@ -140,6 +137,7 @@ $paymentexpensereportstatic = new PaymentExpenseReport($db);
$accountingjournalstatic = new AccountingJournal($db); $accountingjournalstatic = new AccountingJournal($db);
$accountingjournalstatic->fetch($id_journal); $accountingjournalstatic->fetch($id_journal);
$journal = $accountingjournalstatic->code; $journal = $accountingjournalstatic->code;
$journal_label = $accountingjournalstatic->label;
dol_syslog("accountancy/journal/bankjournal.php", LOG_DEBUG); dol_syslog("accountancy/journal/bankjournal.php", LOG_DEBUG);
$result = $db->query($sql); $result = $db->query($sql);
@ -361,6 +359,7 @@ if (! $error && $action == 'writebookkeeping') {
$bookkeeping->debit = ($mt >= 0 ? $mt : 0); $bookkeeping->debit = ($mt >= 0 ? $mt : 0);
$bookkeeping->credit = ($mt < 0 ? - $mt : 0); $bookkeeping->credit = ($mt < 0 ? - $mt : 0);
$bookkeeping->code_journal = $journal; $bookkeeping->code_journal = $journal;
$bookkeeping->journal_label = $journal_label;
$bookkeeping->fk_user_author = $user->id; $bookkeeping->fk_user_author = $user->id;
$bookkeeping->date_create = $now; $bookkeeping->date_create = $now;
@ -454,6 +453,7 @@ if (! $error && $action == 'writebookkeeping') {
$bookkeeping->debit = ($mt < 0 ? - $mt : 0); $bookkeeping->debit = ($mt < 0 ? - $mt : 0);
$bookkeeping->credit = ($mt >= 0) ? $mt : 0; $bookkeeping->credit = ($mt >= 0) ? $mt : 0;
$bookkeeping->code_journal = $journal; $bookkeeping->code_journal = $journal;
$bookkeeping->journal_label = $journal_label;
$bookkeeping->fk_user_author = $user->id; $bookkeeping->fk_user_author = $user->id;
$bookkeeping->date_create = $now; $bookkeeping->date_create = $now;

View File

@ -27,8 +27,6 @@
* \brief Page with expense reports journal * \brief Page with expense reports journal
*/ */
require '../../main.inc.php'; require '../../main.inc.php';
// Class
require_once DOL_DOCUMENT_ROOT . '/core/lib/report.lib.php'; require_once DOL_DOCUMENT_ROOT . '/core/lib/report.lib.php';
require_once DOL_DOCUMENT_ROOT . '/core/lib/date.lib.php'; require_once DOL_DOCUMENT_ROOT . '/core/lib/date.lib.php';
require_once DOL_DOCUMENT_ROOT . '/core/lib/accounting.lib.php'; require_once DOL_DOCUMENT_ROOT . '/core/lib/accounting.lib.php';
@ -38,7 +36,6 @@ require_once DOL_DOCUMENT_ROOT . '/expensereport/class/expensereport.class.php';
require_once DOL_DOCUMENT_ROOT . '/user/class/user.class.php'; require_once DOL_DOCUMENT_ROOT . '/user/class/user.class.php';
require_once DOL_DOCUMENT_ROOT . '/accountancy/class/bookkeeping.class.php'; require_once DOL_DOCUMENT_ROOT . '/accountancy/class/bookkeeping.class.php';
// Langs
$langs->load("compta"); $langs->load("compta");
$langs->load("bills"); $langs->load("bills");
$langs->load("other"); $langs->load("other");
@ -46,8 +43,8 @@ $langs->load("main");
$langs->load("accountancy"); $langs->load("accountancy");
$langs->load("trips"); $langs->load("trips");
// Multi journal
$id_journal = GETPOST('id_journal', 'int'); $id_journal = GETPOST('id_journal', 'int');
$action = GETPOST('action','aZ09');
$date_startmonth = GETPOST('date_startmonth'); $date_startmonth = GETPOST('date_startmonth');
$date_startday = GETPOST('date_startday'); $date_startday = GETPOST('date_startday');
@ -62,16 +59,15 @@ $now = dol_now();
if ($user->societe_id > 0) if ($user->societe_id > 0)
accessforbidden(); accessforbidden();
$action = GETPOST('action','aZ09');
/* /*
* Actions * Actions
*/ */
// Get code of finance journal
// Get informations of journal
$accountingjournalstatic = new AccountingJournal($db); $accountingjournalstatic = new AccountingJournal($db);
$accountingjournalstatic->fetch($id_journal); $accountingjournalstatic->fetch($id_journal);
$journal = $accountingjournalstatic->code; $journal = $accountingjournalstatic->code;
$journal_label = $accountingjournalstatic->label;
$year_current = strftime("%Y", dol_now()); $year_current = strftime("%Y", dol_now());
$pastmonth = strftime("%m", dol_now()) - 1; $pastmonth = strftime("%m", dol_now()) - 1;
@ -187,6 +183,7 @@ if ($action == 'writebookkeeping') {
$bookkeeping->debit = ($mt <= 0) ? $mt : 0; $bookkeeping->debit = ($mt <= 0) ? $mt : 0;
$bookkeeping->credit = ($mt > 0) ? $mt : 0; $bookkeeping->credit = ($mt > 0) ? $mt : 0;
$bookkeeping->code_journal = $journal; $bookkeeping->code_journal = $journal;
$bookkeeping->journal_label = $journal_label;
$bookkeeping->fk_user_author = $user->id; $bookkeeping->fk_user_author = $user->id;
$result = $bookkeeping->create($user); $result = $bookkeeping->create($user);
@ -233,6 +230,7 @@ if ($action == 'writebookkeeping') {
$bookkeeping->debit = ($mt > 0) ? $mt : 0; $bookkeeping->debit = ($mt > 0) ? $mt : 0;
$bookkeeping->credit = ($mt <= 0) ? $mt : 0; $bookkeeping->credit = ($mt <= 0) ? $mt : 0;
$bookkeeping->code_journal = $journal; $bookkeeping->code_journal = $journal;
$bookkeeping->journal_label = $journal_label;
$bookkeeping->fk_user_author = $user->id; $bookkeeping->fk_user_author = $user->id;
$result = $bookkeeping->create($user); $result = $bookkeeping->create($user);
@ -277,6 +275,7 @@ if ($action == 'writebookkeeping') {
$bookkeeping->debit = ($mt > 0) ? $mt : 0; $bookkeeping->debit = ($mt > 0) ? $mt : 0;
$bookkeeping->credit = ($mt <= 0) ? $mt : 0; $bookkeeping->credit = ($mt <= 0) ? $mt : 0;
$bookkeeping->code_journal = $journal; $bookkeeping->code_journal = $journal;
$bookkeeping->journal_label = $journal_label;
$bookkeeping->fk_user_author = $user->id; $bookkeeping->fk_user_author = $user->id;
$result = $bookkeeping->create($user); $result = $bookkeeping->create($user);
@ -444,7 +443,7 @@ if (empty($action) || $action == 'view') {
llxHeader('', $langs->trans("ExpenseReportsJournal")); llxHeader('', $langs->trans("ExpenseReportsJournal"));
$nom = $langs->trans("ExpenseReportsJournal"); $nom = $langs->trans("ExpenseReportsJournal") . ' - ' . $accountingjournalstatic->getNomUrl(1);
$nomlink = ''; $nomlink = '';
$periodlink = ''; $periodlink = '';
$exportlink = ''; $exportlink = '';

View File

@ -3,7 +3,7 @@
* Copyright (C) 2007-2010 Jean Heimburger <jean@tiaris.info> * Copyright (C) 2007-2010 Jean Heimburger <jean@tiaris.info>
* Copyright (C) 2011 Juanjo Menent <jmenent@2byte.es> * Copyright (C) 2011 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2012 Regis Houssin <regis@dolibarr.fr> * Copyright (C) 2012 Regis Houssin <regis@dolibarr.fr>
* Copyright (C) 2013-2015 Alexandre Spangaro <aspangaro.dolibarr@gmail.com> * Copyright (C) 2013-2015 Alexandre Spangaro <aspangaro@zendsi.com>
* Copyright (C) 2013-2016 Olivier Geffroy <jeff@jeffinfo.com> * Copyright (C) 2013-2016 Olivier Geffroy <jeff@jeffinfo.com>
* Copyright (C) 2013-2016 Florian Henry <florian.henry@open-concept.pro> * Copyright (C) 2013-2016 Florian Henry <florian.henry@open-concept.pro>
* *
@ -27,23 +27,24 @@
* \brief Page with purchases journal * \brief Page with purchases journal
*/ */
require '../../main.inc.php'; require '../../main.inc.php';
// Class
require_once DOL_DOCUMENT_ROOT . '/core/lib/report.lib.php'; require_once DOL_DOCUMENT_ROOT . '/core/lib/report.lib.php';
require_once DOL_DOCUMENT_ROOT . '/core/lib/date.lib.php'; require_once DOL_DOCUMENT_ROOT . '/core/lib/date.lib.php';
require_once DOL_DOCUMENT_ROOT . '/core/lib/accounting.lib.php'; require_once DOL_DOCUMENT_ROOT . '/core/lib/accounting.lib.php';
require_once DOL_DOCUMENT_ROOT . '/accountancy/class/accountingjournal.class.php';
require_once DOL_DOCUMENT_ROOT . '/accountancy/class/accountingaccount.class.php';
require_once DOL_DOCUMENT_ROOT . '/fourn/class/fournisseur.facture.class.php'; require_once DOL_DOCUMENT_ROOT . '/fourn/class/fournisseur.facture.class.php';
require_once DOL_DOCUMENT_ROOT . '/fourn/class/fournisseur.class.php'; require_once DOL_DOCUMENT_ROOT . '/fourn/class/fournisseur.class.php';
require_once DOL_DOCUMENT_ROOT . '/accountancy/class/bookkeeping.class.php'; require_once DOL_DOCUMENT_ROOT . '/accountancy/class/bookkeeping.class.php';
require_once DOL_DOCUMENT_ROOT . '/accountancy/class/accountingaccount.class.php';
// Langs
$langs->load("compta"); $langs->load("compta");
$langs->load("bills"); $langs->load("bills");
$langs->load("other"); $langs->load("other");
$langs->load("main"); $langs->load("main");
$langs->load("accountancy"); $langs->load("accountancy");
$id_journal = GETPOST('id_journal', 'int');
$action = GETPOST('action','aZ09');
$date_startmonth = GETPOST('date_startmonth'); $date_startmonth = GETPOST('date_startmonth');
$date_startday = GETPOST('date_startday'); $date_startday = GETPOST('date_startday');
$date_startyear = GETPOST('date_startyear'); $date_startyear = GETPOST('date_startyear');
@ -57,13 +58,16 @@ $now = dol_now();
if ($user->societe_id > 0) if ($user->societe_id > 0)
accessforbidden(); accessforbidden();
$action = GETPOST('action','aZ09');
/* /*
* Actions * Actions
*/ */
// Get informations of journal
$accountingjournalstatic = new AccountingJournal($db);
$accountingjournalstatic->fetch($id_journal);
$journal = $accountingjournalstatic->code;
$journal_label = $accountingjournalstatic->label;
$year_current = strftime("%Y", dol_now()); $year_current = strftime("%Y", dol_now());
$pastmonth = strftime("%m", dol_now()) - 1; $pastmonth = strftime("%m", dol_now()) - 1;
$pastmonthyear = $year_current; $pastmonthyear = $year_current;
@ -217,7 +221,8 @@ if ($action == 'writebookkeeping') {
$bookkeeping->sens = ($mt >= 0) ? 'C' : 'D'; $bookkeeping->sens = ($mt >= 0) ? 'C' : 'D';
$bookkeeping->debit = ($mt <= 0) ? $mt : 0; $bookkeeping->debit = ($mt <= 0) ? $mt : 0;
$bookkeeping->credit = ($mt > 0) ? $mt : 0; $bookkeeping->credit = ($mt > 0) ? $mt : 0;
$bookkeeping->code_journal = $conf->global->ACCOUNTING_PURCHASE_JOURNAL; $bookkeeping->code_journal = $journal;
$bookkeeping->journal_label = $journal_label;
$bookkeeping->fk_user_author = $user->id; $bookkeeping->fk_user_author = $user->id;
$result = $bookkeeping->create($user); $result = $bookkeeping->create($user);
@ -263,7 +268,8 @@ if ($action == 'writebookkeeping') {
$bookkeeping->sens = ($mt < 0) ? 'C' : 'D'; $bookkeeping->sens = ($mt < 0) ? 'C' : 'D';
$bookkeeping->debit = ($mt > 0) ? $mt : 0; $bookkeeping->debit = ($mt > 0) ? $mt : 0;
$bookkeeping->credit = ($mt <= 0) ? $mt : 0; $bookkeeping->credit = ($mt <= 0) ? $mt : 0;
$bookkeeping->code_journal = $conf->global->ACCOUNTING_PURCHASE_JOURNAL; $bookkeeping->code_journal = $journal;
$bookkeeping->journal_label = $journal_label;
$bookkeeping->fk_user_author = $user->id; $bookkeeping->fk_user_author = $user->id;
$result = $bookkeeping->create($user); $result = $bookkeeping->create($user);
@ -307,7 +313,8 @@ if ($action == 'writebookkeeping') {
$bookkeeping->sens = ($mt < 0) ? 'C' : 'D'; $bookkeeping->sens = ($mt < 0) ? 'C' : 'D';
$bookkeeping->debit = ($mt > 0) ? $mt : 0; $bookkeeping->debit = ($mt > 0) ? $mt : 0;
$bookkeeping->credit = ($mt <= 0) ? $mt : 0; $bookkeeping->credit = ($mt <= 0) ? $mt : 0;
$bookkeeping->code_journal = $conf->global->ACCOUNTING_PURCHASE_JOURNAL; $bookkeeping->code_journal = $journal;
$bookkeeping->journal_label = $journal_label;
$bookkeeping->fk_user_author = $user->id; $bookkeeping->fk_user_author = $user->id;
$result = $bookkeeping->create($user); $result = $bookkeeping->create($user);
@ -337,7 +344,6 @@ if ($action == 'writebookkeeping') {
{ {
$db->rollback(); $db->rollback();
} }
} }
if (empty($error) && count($tabpay)) { if (empty($error) && count($tabpay)) {
@ -351,7 +357,6 @@ if ($action == 'writebookkeeping') {
{ {
setEventMessages($langs->trans("GeneralLedgerSomeRecordWasNotRecorded"), null, 'warnings'); setEventMessages($langs->trans("GeneralLedgerSomeRecordWasNotRecorded"), null, 'warnings');
} }
$action=''; $action='';
} }
@ -488,7 +493,7 @@ if (empty($action) || $action == 'view') {
llxHeader('', $langs->trans("PurchasesJournal")); llxHeader('', $langs->trans("PurchasesJournal"));
$nom = $langs->trans("PurchasesJournal"); $nom = $langs->trans("PurchasesJournal") . ' - ' . $accountingjournalstatic->getNomUrl(1);
$nomlink = ''; $nomlink = '';
$periodlink = ''; $periodlink = '';
$exportlink = ''; $exportlink = '';
@ -503,7 +508,9 @@ if (empty($action) || $action == 'view') {
$period = $form->select_date($date_start, 'date_start', 0, 0, 0, '', 1, 0, 1) . ' - ' . $form->select_date($date_end, 'date_end', 0, 0, 0, '', 1, 0, 1); $period = $form->select_date($date_start, 'date_start', 0, 0, 0, '', 1, 0, 1) . ' - ' . $form->select_date($date_end, 'date_end', 0, 0, 0, '', 1, 0, 1);
journalHead($nom, $nomlink, $period, $periodlink, $description, $builddate, $exportlink, array('action' => '')); $varlink = 'id_journal=' . $id_journal;
journalHead($nom, $nomlink, $period, $periodlink, $description, $builddate, $exportlink, array('action' => ''), '', $varlink);
/*if ($conf->global->ACCOUNTING_EXPORT_MODELCSV != 1 && $conf->global->ACCOUNTING_EXPORT_MODELCSV != 2) { /*if ($conf->global->ACCOUNTING_EXPORT_MODELCSV != 1 && $conf->global->ACCOUNTING_EXPORT_MODELCSV != 2) {
print '<input type="button" class="butActionRefused" style="float: right;" value="' . $langs->trans("Export") . '" disabled="disabled" title="' . $langs->trans('ExportNotSupported') . '"/>'; print '<input type="button" class="butActionRefused" style="float: right;" value="' . $langs->trans("Export") . '" disabled="disabled" title="' . $langs->trans('ExportNotSupported') . '"/>';
@ -537,7 +544,6 @@ if (empty($action) || $action == 'view') {
$i = 0; $i = 0;
print "<table class=\"noborder\" width=\"100%\">"; print "<table class=\"noborder\" width=\"100%\">";
print "<tr class=\"liste_titre\">"; print "<tr class=\"liste_titre\">";
// /print "<td>".$langs->trans("JournalNum")."</td>";
print "<td></td>"; print "<td></td>";
print "<td>" . $langs->trans("Date") . "</td>"; print "<td>" . $langs->trans("Date") . "</td>";
print "<td>" . $langs->trans("Piece") . ' (' . $langs->trans("InvoiceRef") . ")</td>"; print "<td>" . $langs->trans("Piece") . ' (' . $langs->trans("InvoiceRef") . ")</td>";
@ -590,6 +596,7 @@ if (empty($action) || $action == 'view') {
print "</tr>"; print "</tr>";
} }
} }
// VAT // VAT
foreach ( $tabtva[$key] as $k => $mt ) { foreach ( $tabtva[$key] as $k => $mt ) {
if ($mt) { if ($mt) {

View File

@ -4,7 +4,7 @@
* Copyright (C) 2011 Juanjo Menent <jmenent@2byte.es> * Copyright (C) 2011 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2012 Regis Houssin <regis@dolibarr.fr> * Copyright (C) 2012 Regis Houssin <regis@dolibarr.fr>
* Copyright (C) 2013 Christophe Battarel <christophe.battarel@altairis.fr> * Copyright (C) 2013 Christophe Battarel <christophe.battarel@altairis.fr>
* Copyright (C) 2013-2016 Alexandre Spangaro <aspangaro.dolibarr@gmail.com> * Copyright (C) 2013-2017 Alexandre Spangaro <aspangaro@zendsi.com>
* Copyright (C) 2013-2016 Florian Henry <florian.henry@open-concept.pro> * Copyright (C) 2013-2016 Florian Henry <florian.henry@open-concept.pro>
* Copyright (C) 2013-2016 Olivier Geffroy <jeff@jeffinfo.com> * Copyright (C) 2013-2016 Olivier Geffroy <jeff@jeffinfo.com>
* Copyright (C) 2014 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr> * Copyright (C) 2014 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
@ -29,17 +29,15 @@
* \brief Page with sells journal * \brief Page with sells journal
*/ */
require '../../main.inc.php'; require '../../main.inc.php';
// Class
require_once DOL_DOCUMENT_ROOT . '/core/lib/report.lib.php'; require_once DOL_DOCUMENT_ROOT . '/core/lib/report.lib.php';
require_once DOL_DOCUMENT_ROOT . '/core/lib/date.lib.php'; require_once DOL_DOCUMENT_ROOT . '/core/lib/date.lib.php';
require_once DOL_DOCUMENT_ROOT . '/core/lib/accounting.lib.php'; require_once DOL_DOCUMENT_ROOT . '/core/lib/accounting.lib.php';
require_once DOL_DOCUMENT_ROOT . '/accountancy/class/accountingjournal.class.php';
require_once DOL_DOCUMENT_ROOT . '/accountancy/class/accountingaccount.class.php';
require_once DOL_DOCUMENT_ROOT . '/compta/facture/class/facture.class.php'; require_once DOL_DOCUMENT_ROOT . '/compta/facture/class/facture.class.php';
require_once DOL_DOCUMENT_ROOT . '/societe/class/client.class.php'; require_once DOL_DOCUMENT_ROOT . '/societe/class/client.class.php';
require_once DOL_DOCUMENT_ROOT . '/accountancy/class/bookkeeping.class.php'; require_once DOL_DOCUMENT_ROOT . '/accountancy/class/bookkeeping.class.php';
require_once DOL_DOCUMENT_ROOT . '/accountancy/class/accountingaccount.class.php';
// Langs
$langs->load("commercial"); $langs->load("commercial");
$langs->load("compta"); $langs->load("compta");
$langs->load("bills"); $langs->load("bills");
@ -47,6 +45,9 @@ $langs->load("other");
$langs->load("main"); $langs->load("main");
$langs->load("accountancy"); $langs->load("accountancy");
$id_journal = GETPOST('id_journal', 'int');
$action = GETPOST('action','aZ09');
$date_startmonth = GETPOST('date_startmonth'); $date_startmonth = GETPOST('date_startmonth');
$date_startday = GETPOST('date_startday'); $date_startday = GETPOST('date_startday');
$date_startyear = GETPOST('date_startyear'); $date_startyear = GETPOST('date_startyear');
@ -60,13 +61,17 @@ $now = dol_now();
if ($user->societe_id > 0) if ($user->societe_id > 0)
accessforbidden(); accessforbidden();
$action = GETPOST('action','aZ09');
/* /*
* Actions * Actions
*/ */
// Get informations of journal
$accountingjournalstatic = new AccountingJournal($db);
$accountingjournalstatic->fetch($id_journal);
$journal = $accountingjournalstatic->code;
$journal_label = $accountingjournalstatic->label;
$year_current = strftime("%Y", dol_now()); $year_current = strftime("%Y", dol_now());
$pastmonth = strftime("%m", dol_now()) - 1; $pastmonth = strftime("%m", dol_now()) - 1;
$pastmonthyear = $year_current; $pastmonthyear = $year_current;
@ -234,7 +239,8 @@ if ($action == 'writebookkeeping') {
$bookkeeping->sens = ($mt >= 0) ? 'D' : 'C'; $bookkeeping->sens = ($mt >= 0) ? 'D' : 'C';
$bookkeeping->debit = ($mt >= 0) ? $mt : 0; $bookkeeping->debit = ($mt >= 0) ? $mt : 0;
$bookkeeping->credit = ($mt < 0) ? $mt : 0; $bookkeeping->credit = ($mt < 0) ? $mt : 0;
$bookkeeping->code_journal = $conf->global->ACCOUNTING_SELL_JOURNAL; $bookkeeping->code_journal = $journal;
$bookkeeping->journal_label = $journal_label;
$bookkeeping->fk_user_author = $user->id; $bookkeeping->fk_user_author = $user->id;
$result = $bookkeeping->create($user); $result = $bookkeeping->create($user);
@ -278,7 +284,8 @@ if ($action == 'writebookkeeping') {
$bookkeeping->sens = ($mt < 0) ? 'D' : 'C'; $bookkeeping->sens = ($mt < 0) ? 'D' : 'C';
$bookkeeping->debit = ($mt < 0) ? $mt : 0; $bookkeeping->debit = ($mt < 0) ? $mt : 0;
$bookkeeping->credit = ($mt >= 0) ? $mt : 0; $bookkeeping->credit = ($mt >= 0) ? $mt : 0;
$bookkeeping->code_journal = $conf->global->ACCOUNTING_SELL_JOURNAL; $bookkeeping->code_journal = $journal;
$bookkeeping->journal_label = $journal_label;
$bookkeeping->fk_user_author = $user->id; $bookkeeping->fk_user_author = $user->id;
$result = $bookkeeping->create($user); $result = $bookkeeping->create($user);
@ -321,7 +328,8 @@ if ($action == 'writebookkeeping') {
$bookkeeping->sens = ($mt < 0) ? 'D' : 'C'; $bookkeeping->sens = ($mt < 0) ? 'D' : 'C';
$bookkeeping->debit = ($mt < 0) ? $mt : 0; $bookkeeping->debit = ($mt < 0) ? $mt : 0;
$bookkeeping->credit = ($mt >= 0) ? $mt : 0; $bookkeeping->credit = ($mt >= 0) ? $mt : 0;
$bookkeeping->code_journal = $conf->global->ACCOUNTING_SELL_JOURNAL; $bookkeeping->code_journal = $journal;
$bookkeeping->journal_label = $journal_label;
$bookkeeping->fk_user_author = $user->id; $bookkeeping->fk_user_author = $user->id;
$result = $bookkeeping->create($user); $result = $bookkeeping->create($user);
@ -505,7 +513,7 @@ if (empty($action) || $action == 'view') {
llxHeader('', $langs->trans("SellsJournal")); llxHeader('', $langs->trans("SellsJournal"));
$nom = $langs->trans("SellsJournal"); $nom = $langs->trans("SellsJournal") . ' - ' . $accountingjournalstatic->getNomUrl(1);
$nomlink = ''; $nomlink = '';
$periodlink = ''; $periodlink = '';
$exportlink = ''; $exportlink = '';
@ -518,7 +526,9 @@ if (empty($action) || $action == 'view') {
$description .= $langs->trans("DepositsAreIncluded"); $description .= $langs->trans("DepositsAreIncluded");
$period = $form->select_date($date_start, 'date_start', 0, 0, 0, '', 1, 0, 1) . ' - ' . $form->select_date($date_end, 'date_end', 0, 0, 0, '', 1, 0, 1); $period = $form->select_date($date_start, 'date_start', 0, 0, 0, '', 1, 0, 1) . ' - ' . $form->select_date($date_end, 'date_end', 0, 0, 0, '', 1, 0, 1);
journalHead($nom, $nomlink, $period, $periodlink, $description, $builddate, $exportlink, array('action' => '')); $varlink = 'id_journal=' . $id_journal;
journalHead($nom, $nomlink, $period, $periodlink, $description, $builddate, $exportlink, array('action' => ''), '', $varlink);
/*if ($conf->global->ACCOUNTING_EXPORT_MODELCSV != 1 && $conf->global->ACCOUNTING_EXPORT_MODELCSV != 2) { /*if ($conf->global->ACCOUNTING_EXPORT_MODELCSV != 1 && $conf->global->ACCOUNTING_EXPORT_MODELCSV != 2) {
print '<input type="button" class="butActionRefused" style="float: right;" value="' . $langs->trans("Export") . '" disabled="disabled" title="' . $langs->trans('ExportNotSupported') . '"/>'; print '<input type="button" class="butActionRefused" style="float: right;" value="' . $langs->trans("Export") . '" disabled="disabled" title="' . $langs->trans('ExportNotSupported') . '"/>';

View File

@ -54,7 +54,7 @@ $search_account = GETPOST('search_account', 'alpha');
$search_vat = GETPOST('search_vat', 'alpha'); $search_vat = GETPOST('search_vat', 'alpha');
// Load variable for pagination // Load variable for pagination
$limit = GETPOST('limit') ? GETPOST('limit', 'int') : (empty($conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION)?$conf->liste_limit:$conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION); $limit = GETPOST('limit','int')?GETPOST('limit', 'int'):(empty($conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION)?$conf->liste_limit:$conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION);
$sortfield = GETPOST('sortfield', 'alpha'); $sortfield = GETPOST('sortfield', 'alpha');
$sortorder = GETPOST('sortorder', 'alpha'); $sortorder = GETPOST('sortorder', 'alpha');
$page = GETPOST('page', 'int'); $page = GETPOST('page', 'int');

View File

@ -63,7 +63,7 @@ $search_vat = GETPOST('search_vat', 'alpha');
$btn_ventil = GETPOST('ventil', 'alpha'); $btn_ventil = GETPOST('ventil', 'alpha');
// Load variable for pagination // Load variable for pagination
$limit = GETPOST('limit') ? GETPOST('limit', 'int') : (empty($conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION)?$conf->liste_limit:$conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION); $limit = GETPOST('limit','int')?GETPOST('limit', 'int'):(empty($conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION)?$conf->liste_limit:$conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION);
$sortfield = GETPOST('sortfield', 'alpha'); $sortfield = GETPOST('sortfield', 'alpha');
$sortorder = GETPOST('sortorder', 'alpha'); $sortorder = GETPOST('sortorder', 'alpha');
$page = GETPOST('page','int'); $page = GETPOST('page','int');

View File

@ -62,7 +62,7 @@ $optioncss = GETPOST('optioncss','alpha');
if ($statut < -1) $statut = ''; if ($statut < -1) $statut = '';
$limit = GETPOST("limit")?GETPOST("limit","int"):$conf->liste_limit; $limit = GETPOST('limit','int')?GETPOST('limit','int'):$conf->liste_limit;
$sortfield = GETPOST("sortfield",'alpha'); $sortfield = GETPOST("sortfield",'alpha');
$sortorder = GETPOST("sortorder",'alpha'); $sortorder = GETPOST("sortorder",'alpha');
$page = GETPOST("page",'int'); $page = GETPOST("page",'int');

View File

@ -42,7 +42,7 @@ $optioncss = GETPOST('optioncss','alpha');
$date_select=isset($_GET["date_select"])?$_GET["date_select"]:$_POST["date_select"]; $date_select=isset($_GET["date_select"])?$_GET["date_select"]:$_POST["date_select"];
$limit = GETPOST("limit")?GETPOST("limit","int"):$conf->liste_limit; $limit = GETPOST('limit','int')?GETPOST('limit','int'):$conf->liste_limit;
$sortfield = GETPOST("sortfield",'alpha'); $sortfield = GETPOST("sortfield",'alpha');
$sortorder = GETPOST("sortorder",'alpha'); $sortorder = GETPOST("sortorder",'alpha');
$page = GETPOST("page",'int'); $page = GETPOST("page",'int');

View File

@ -44,7 +44,7 @@ $search_email = GETPOST('search_email','alpha');
$type = GETPOST('type','alpha'); $type = GETPOST('type','alpha');
$status = GETPOST('status','alpha'); $status = GETPOST('status','alpha');
$limit = GETPOST("limit")?GETPOST("limit","int"):$conf->liste_limit; $limit = GETPOST('limit','int')?GETPOST('limit','int'):$conf->liste_limit;
$sortfield = GETPOST("sortfield",'alpha'); $sortfield = GETPOST("sortfield",'alpha');
$sortorder = GETPOST("sortorder",'alpha'); $sortorder = GETPOST("sortorder",'alpha');
$page = GETPOST("page",'int'); $page = GETPOST("page",'int');

View File

@ -148,7 +148,6 @@ print "</tr>\n";
foreach ($list as $key) foreach ($list as $key)
{ {
print '<tr class="oddeven value">'; print '<tr class="oddeven value">';
// Param // Param

View File

@ -39,7 +39,7 @@ $action=GETPOST('action','alpha');
$mode = GETPOST('mode')?GETPOST('mode'):'createform'; // 'createform', 'filters', 'sortorder', 'focus' $mode = GETPOST('mode')?GETPOST('mode'):'createform'; // 'createform', 'filters', 'sortorder', 'focus'
$limit = GETPOST("limit")?GETPOST("limit","int"):$conf->liste_limit; $limit = GETPOST('limit','int')?GETPOST('limit','int'):$conf->liste_limit;
$sortfield = GETPOST("sortfield",'alpha'); $sortfield = GETPOST("sortfield",'alpha');
$sortorder = GETPOST("sortorder",'alpha'); $sortorder = GETPOST("sortorder",'alpha');
$page = GETPOST("page",'int'); $page = GETPOST("page",'int');

View File

@ -547,7 +547,6 @@ print '<input type="submit" class="button" value="'.$langs->trans("Modify").'">'
print "</td></tr>\n"; print "</td></tr>\n";
print '</form>'; print '</form>';
// print products on fichinter // print products on fichinter
$var=! $var;
print '<form action="'.$_SERVER["PHP_SELF"].'" method="post">'; print '<form action="'.$_SERVER["PHP_SELF"].'" 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="set_FICHINTER_PRINT_PRODUCTS">'; print '<input type="hidden" name="action" value="set_FICHINTER_PRINT_PRODUCTS">';

View File

@ -45,7 +45,7 @@ $transvalue=GETPOST('transvalue','alpha');
$mode = GETPOST('mode')?GETPOST('mode'):'overwrite'; $mode = GETPOST('mode')?GETPOST('mode'):'overwrite';
$limit = GETPOST("limit")?GETPOST("limit","int"):$conf->liste_limit; $limit = GETPOST('limit','int')?GETPOST('limit','int'):$conf->liste_limit;
$sortfield = GETPOST("sortfield",'alpha'); $sortfield = GETPOST("sortfield",'alpha');
$sortorder = GETPOST("sortorder",'alpha'); $sortorder = GETPOST("sortorder",'alpha');
$page = GETPOST("page",'int'); $page = GETPOST("page",'int');

View File

@ -39,7 +39,7 @@ if (! $user->rights->bookmark->lire) {
} }
$optioncss = GETPOST('optioncss','alpha'); $optioncss = GETPOST('optioncss','alpha');
$limit = GETPOST("limit")?GETPOST("limit","int"):$conf->liste_limit; $limit = GETPOST('limit','int')?GETPOST('limit','int'):$conf->liste_limit;
$sortfield = GETPOST("sortfield",'alpha'); $sortfield = GETPOST("sortfield",'alpha');
$sortorder = GETPOST("sortorder",'alpha'); $sortorder = GETPOST("sortorder",'alpha');
$page = GETPOST("page",'int'); $page = GETPOST("page",'int');

View File

@ -76,7 +76,7 @@ if (empty($filtert) && empty($conf->global->AGENDA_ALL_CALENDARS))
$filtert=$user->id; $filtert=$user->id;
} }
$limit = GETPOST("limit")?GETPOST("limit","int"):$conf->liste_limit; $limit = GETPOST('limit','int')?GETPOST('limit','int'):$conf->liste_limit;
$sortfield = GETPOST("sortfield",'alpha'); $sortfield = GETPOST("sortfield",'alpha');
$sortorder = GETPOST("sortorder",'alpha'); $sortorder = GETPOST("sortorder",'alpha');
$page = GETPOST("page",'int'); $page = GETPOST("page",'int');

View File

@ -39,7 +39,7 @@ if (! $user->rights->mailing->lire || $user->societe_id > 0) accessforbidden();
// Load variable for pagination // Load variable for pagination
$limit = GETPOST("limit")?GETPOST("limit","int"):$conf->liste_limit; $limit = GETPOST('limit','int')?GETPOST('limit','int'):$conf->liste_limit;
$sortfield = GETPOST('sortfield','alpha'); $sortfield = GETPOST('sortfield','alpha');
$sortorder = GETPOST('sortorder','alpha'); $sortorder = GETPOST('sortorder','alpha');
$page = GETPOST('page','int'); $page = GETPOST('page','int');

View File

@ -45,7 +45,7 @@ accessforbidden();
$langs->load("companies"); $langs->load("companies");
$langs->load("orders"); $langs->load("orders");
$limit = GETPOST("limit")?GETPOST("limit","int"):$conf->liste_limit; $limit = GETPOST('limit','int')?GETPOST('limit','int'):$conf->liste_limit;
$sortfield = GETPOST("sortfield",'alpha'); $sortfield = GETPOST("sortfield",'alpha');
$sortorder = GETPOST("sortorder",'alpha'); $sortorder = GETPOST("sortorder",'alpha');
$page = GETPOST("page",'int'); $page = GETPOST("page",'int');

View File

@ -82,7 +82,7 @@ $result = restrictedArea($user, 'commande', $id,'');
$diroutputmassaction=$conf->commande->dir_output . '/temp/massgeneration/'.$user->id; $diroutputmassaction=$conf->commande->dir_output . '/temp/massgeneration/'.$user->id;
$limit = GETPOST("limit")?GETPOST("limit","int"):$conf->liste_limit; $limit = GETPOST('limit','int')?GETPOST('limit','int'):$conf->liste_limit;
$sortfield = GETPOST("sortfield",'alpha'); $sortfield = GETPOST("sortfield",'alpha');
$sortorder = GETPOST("sortorder",'alpha'); $sortorder = GETPOST("sortorder",'alpha');
$page = GETPOST("page",'int'); $page = GETPOST("page",'int');

View File

@ -55,7 +55,7 @@ $result=restrictedArea($user,'banque');
$diroutputmassaction=$conf->bank->dir_output . '/temp/massgeneration/'.$user->id; $diroutputmassaction=$conf->bank->dir_output . '/temp/massgeneration/'.$user->id;
$limit = GETPOST("limit")?GETPOST("limit","int"):$conf->liste_limit; $limit = GETPOST('limit','int')?GETPOST('limit','int'):$conf->liste_limit;
$sortfield = GETPOST("sortfield",'alpha'); $sortfield = GETPOST("sortfield",'alpha');
$sortorder = GETPOST("sortorder",'alpha'); $sortorder = GETPOST("sortorder",'alpha');
$page = GETPOST("page",'int'); $page = GETPOST("page",'int');

View File

@ -48,7 +48,7 @@ $id = GETPOST('id','int');
$socid = GETPOST('socid','int'); $socid = GETPOST('socid','int');
$limit = GETPOST("limit")?GETPOST("limit","int"):$conf->liste_limit; $limit = GETPOST('limit','int')?GETPOST('limit','int'):$conf->liste_limit;
$sortfield = GETPOST("sortfield",'alpha'); $sortfield = GETPOST("sortfield",'alpha');
$sortorder = GETPOST("sortorder",'alpha'); $sortorder = GETPOST("sortorder",'alpha');
$page = GETPOST("page",'int'); $page = GETPOST("page",'int');

View File

@ -45,7 +45,7 @@ $page = GETPOST('page','int');
$sortorder = GETPOST('sortorder','alpha'); $sortorder = GETPOST('sortorder','alpha');
$sortfield = GETPOST('sortfield','alpha'); $sortfield = GETPOST('sortfield','alpha');
$limit = GETPOST("limit")?GETPOST("limit","int"):$conf->liste_limit; $limit = GETPOST('limit','int')?GETPOST('limit','int'):$conf->liste_limit;
$sortfield = GETPOST("sortfield",'alpha'); $sortfield = GETPOST("sortfield",'alpha');
$sortorder = GETPOST("sortorder",'alpha'); $sortorder = GETPOST("sortorder",'alpha');
$page = GETPOST("page",'int'); $page = GETPOST("page",'int');

View File

@ -44,7 +44,7 @@ if ($user->societe_id > 0) accessforbidden();
$prev_id = GETPOST('id','int'); $prev_id = GETPOST('id','int');
$socid = GETPOST('socid','int'); $socid = GETPOST('socid','int');
$limit = GETPOST("limit")?GETPOST("limit","int"):$conf->liste_limit; $limit = GETPOST('limit','int')?GETPOST('limit','int'):$conf->liste_limit;
$sortfield = GETPOST("sortfield",'alpha'); $sortfield = GETPOST("sortfield",'alpha');
$sortorder = GETPOST("sortorder",'alpha'); $sortorder = GETPOST("sortorder",'alpha');
$page = GETPOST("page",'int'); $page = GETPOST("page",'int');

View File

@ -40,7 +40,7 @@ $object = new Societe($db);
if ($id > 0) $object->fetch($id); if ($id > 0) $object->fetch($id);
// Load variable for pagination // Load variable for pagination
$limit = GETPOST("limit")?GETPOST("limit","int"):$conf->liste_limit; $limit = GETPOST('limit','int')?GETPOST('limit','int'):$conf->liste_limit;
$sortfield = GETPOST('sortfield','alpha'); $sortfield = GETPOST('sortfield','alpha');
$sortorder = GETPOST('sortorder','alpha'); $sortorder = GETPOST('sortorder','alpha');
$page = GETPOST('page','int'); $page = GETPOST('page','int');

View File

@ -52,7 +52,7 @@ if ($user->societe_id > 0) $socid = $user->societe_id;
if (! empty($conf->comptabilite->enabled)) $result=restrictedArea($user,'compta','','','resultat'); if (! empty($conf->comptabilite->enabled)) $result=restrictedArea($user,'compta','','','resultat');
if (! empty($conf->accounting->enabled)) $result=restrictedArea($user,'accounting','','','comptarapport'); if (! empty($conf->accounting->enabled)) $result=restrictedArea($user,'accounting','','','comptarapport');
$limit = GETPOST("limit")?GETPOST("limit","int"):$conf->liste_limit; $limit = GETPOST('limit','int')?GETPOST('limit','int'):$conf->liste_limit;
$sortfield = GETPOST("sortfield",'alpha'); $sortfield = GETPOST("sortfield",'alpha');
$sortorder = GETPOST("sortorder",'alpha'); $sortorder = GETPOST("sortorder",'alpha');
$page = GETPOST("page",'int'); $page = GETPOST("page",'int');

View File

@ -89,7 +89,7 @@ $search_agenda_label=GETPOST('search_agenda_label');
if ($user->societe_id) $socid=$user->societe_id; if ($user->societe_id) $socid=$user->societe_id;
$result = restrictedArea($user, 'contact', $id, 'socpeople&societe', '', '', 'rowid', $objcanvas); // If we create a contact with no company (shared contacts), no check on write permission $result = restrictedArea($user, 'contact', $id, 'socpeople&societe', '', '', 'rowid', $objcanvas); // If we create a contact with no company (shared contacts), no check on write permission
$limit = GETPOST("limit")?GETPOST("limit","int"):$conf->liste_limit; $limit = GETPOST('limit','int')?GETPOST('limit','int'):$conf->liste_limit;
$sortfield = GETPOST("sortfield",'alpha'); $sortfield = GETPOST("sortfield",'alpha');
$sortorder = GETPOST("sortorder",'alpha'); $sortorder = GETPOST("sortorder",'alpha');
$page = GETPOST("page",'int'); $page = GETPOST("page",'int');

View File

@ -74,7 +74,7 @@ $optioncss = GETPOST('optioncss','alpha');
$type=GETPOST("type"); $type=GETPOST("type");
$view=GETPOST("view"); $view=GETPOST("view");
$limit = GETPOST("limit")?GETPOST("limit","int"):$conf->liste_limit; $limit = GETPOST('limit','int')?GETPOST('limit','int'):$conf->liste_limit;
$sortfield = GETPOST('sortfield', 'alpha'); $sortfield = GETPOST('sortfield', 'alpha');
$sortorder = GETPOST('sortorder', 'alpha'); $sortorder = GETPOST('sortorder', 'alpha');
$page = GETPOST('page', 'int'); $page = GETPOST('page', 'int');
@ -682,6 +682,7 @@ print "</tr>\n";
$i = 0; $i = 0;
$totalarray=array();
while ($i < min($num,$limit)) while ($i < min($num,$limit))
{ {
$obj = $db->fetch_object($result); $obj = $db->fetch_object($result);
@ -706,56 +707,67 @@ while ($i < min($num,$limit))
print '<td valign="middle">'; print '<td valign="middle">';
print $contactstatic->getNomUrl(1,'',0); print $contactstatic->getNomUrl(1,'',0);
print '</td>'; print '</td>';
if (! $i) $totalarray['nbfield']++;
} }
// Firstname // Firstname
if (! empty($arrayfields['p.firstname']['checked'])) if (! empty($arrayfields['p.firstname']['checked']))
{ {
print '<td>'.$obj->firstname.'</td>'; print '<td>'.$obj->firstname.'</td>';
if (! $i) $totalarray['nbfield']++;
} }
// Zip // Zip
if (! empty($arrayfields['p.zip']['checked'])) if (! empty($arrayfields['p.zip']['checked']))
{ {
print '<td>'.$obj->zip.'</td>'; print '<td>'.$obj->zip.'</td>';
if (! $i) $totalarray['nbfield']++;
} }
// Town // Town
if (! empty($arrayfields['p.town']['checked'])) if (! empty($arrayfields['p.town']['checked']))
{ {
print '<td>'.$obj->town.'</td>'; print '<td>'.$obj->town.'</td>';
if (! $i) $totalarray['nbfield']++;
} }
// Function // Function
if (! empty($arrayfields['p.poste']['checked'])) if (! empty($arrayfields['p.poste']['checked']))
{ {
print '<td>'.dol_trunc($obj->poste,20).'</td>'; print '<td>'.dol_trunc($obj->poste,20).'</td>';
if (! $i) $totalarray['nbfield']++;
} }
// Phone // Phone
if (! empty($arrayfields['p.phone']['checked'])) if (! empty($arrayfields['p.phone']['checked']))
{ {
print '<td>'.dol_print_phone($obj->phone_pro,$obj->country_code,$obj->rowid,$obj->socid,'AC_TEL').'</td>'; print '<td>'.dol_print_phone($obj->phone_pro,$obj->country_code,$obj->rowid,$obj->socid,'AC_TEL').'</td>';
if (! $i) $totalarray['nbfield']++;
} }
// Phone perso // Phone perso
if (! empty($arrayfields['p.phone_perso']['checked'])) if (! empty($arrayfields['p.phone_perso']['checked']))
{ {
print '<td>'.dol_print_phone($obj->phone_perso,$obj->country_code,$obj->rowid,$obj->socid,'AC_TEL').'</td>'; print '<td>'.dol_print_phone($obj->phone_perso,$obj->country_code,$obj->rowid,$obj->socid,'AC_TEL').'</td>';
if (! $i) $totalarray['nbfield']++;
} }
// Phone mobile // Phone mobile
if (! empty($arrayfields['p.phone_mobile']['checked'])) if (! empty($arrayfields['p.phone_mobile']['checked']))
{ {
print '<td>'.dol_print_phone($obj->phone_mobile,$obj->country_code,$obj->rowid,$obj->socid,'AC_TEL').'</td>'; print '<td>'.dol_print_phone($obj->phone_mobile,$obj->country_code,$obj->rowid,$obj->socid,'AC_TEL').'</td>';
if (! $i) $totalarray['nbfield']++;
} }
// Fax // Fax
if (! empty($arrayfields['p.fax']['checked'])) if (! empty($arrayfields['p.fax']['checked']))
{ {
print '<td>'.dol_print_phone($obj->fax,$obj->country_code,$obj->rowid,$obj->socid,'AC_TEL').'</td>'; print '<td>'.dol_print_phone($obj->fax,$obj->country_code,$obj->rowid,$obj->socid,'AC_TEL').'</td>';
if (! $i) $totalarray['nbfield']++;
} }
// EMail // EMail
if (! empty($arrayfields['p.email']['checked'])) if (! empty($arrayfields['p.email']['checked']))
{ {
print '<td>'.dol_print_email($obj->email,$obj->rowid,$obj->socid,'AC_EMAIL',18).'</td>'; print '<td>'.dol_print_email($obj->email,$obj->rowid,$obj->socid,'AC_EMAIL',18).'</td>';
if (! $i) $totalarray['nbfield']++;
} }
// Skype // Skype
if (! empty($arrayfields['p.skype']['checked'])) if (! empty($arrayfields['p.skype']['checked']))
{ {
if (! empty($conf->skype->enabled)) { print '<td>'.dol_print_skype($obj->skype,$obj->rowid,$obj->socid,'AC_SKYPE',18).'</td>'; } if (! empty($conf->skype->enabled)) { print '<td>'.dol_print_skype($obj->skype,$obj->rowid,$obj->socid,'AC_SKYPE',18).'</td>'; }
if (! $i) $totalarray['nbfield']++;
} }
// Company // Company
if (! empty($arrayfields['p.thirdparty']['checked'])) if (! empty($arrayfields['p.thirdparty']['checked']))
@ -770,12 +782,14 @@ while ($i < min($num,$limit))
else else
print '&nbsp;'; print '&nbsp;';
print '</td>'; print '</td>';
if (! $i) $totalarray['nbfield']++;
} }
// Private/Public // Private/Public
if (! empty($arrayfields['p.priv']['checked'])) if (! empty($arrayfields['p.priv']['checked']))
{ {
print '<td align="center">'.$contactstatic->LibPubPriv($obj->priv).'</td>'; print '<td align="center">'.$contactstatic->LibPubPriv($obj->priv).'</td>';
if (! $i) $totalarray['nbfield']++;
} }
// Extra fields // Extra fields
@ -792,6 +806,7 @@ while ($i < min($num,$limit))
$tmpkey='options_'.$key; $tmpkey='options_'.$key;
print $extrafields->showOutputField($key, $obj->$tmpkey, '', 1); print $extrafields->showOutputField($key, $obj->$tmpkey, '', 1);
print '</td>'; print '</td>';
if (! $i) $totalarray['nbfield']++;
} }
} }
} }
@ -805,6 +820,7 @@ while ($i < min($num,$limit))
print '<td align="center">'; print '<td align="center">';
print dol_print_date($db->jdate($obj->date_creation), 'dayhour'); print dol_print_date($db->jdate($obj->date_creation), 'dayhour');
print '</td>'; print '</td>';
if (! $i) $totalarray['nbfield']++;
} }
// Date modification // Date modification
if (! empty($arrayfields['p.tms']['checked'])) if (! empty($arrayfields['p.tms']['checked']))
@ -812,11 +828,13 @@ while ($i < min($num,$limit))
print '<td align="center">'; print '<td align="center">';
print dol_print_date($db->jdate($obj->date_update), 'dayhour'); print dol_print_date($db->jdate($obj->date_update), 'dayhour');
print '</td>'; print '</td>';
if (! $i) $totalarray['nbfield']++;
} }
// Status // Status
if (! empty($arrayfields['p.statut']['checked'])) if (! empty($arrayfields['p.statut']['checked']))
{ {
print '<td align="center">'.$contactstatic->getLibStatut(3).'</td>'; print '<td align="center">'.$contactstatic->getLibStatut(3).'</td>';
if (! $i) $totalarray['nbfield']++;
} }
// Action column // Action column

View File

@ -65,7 +65,7 @@ $month=GETPOST("month","int");
$optioncss = GETPOST('optioncss','alpha'); $optioncss = GETPOST('optioncss','alpha');
$limit = GETPOST("limit")?GETPOST("limit","int"):$conf->liste_limit; $limit = GETPOST('limit','int')?GETPOST('limit','int'):$conf->liste_limit;
$sortfield = GETPOST("sortfield",'alpha'); $sortfield = GETPOST("sortfield",'alpha');
$sortorder = GETPOST("sortorder",'alpha'); $sortorder = GETPOST("sortorder",'alpha');
$page = GETPOST("page",'int'); $page = GETPOST("page",'int');

View File

@ -33,7 +33,7 @@ $langs->load("products");
$langs->load("contracts"); $langs->load("contracts");
$langs->load("companies"); $langs->load("companies");
$limit = GETPOST("limit")?GETPOST("limit","int"):$conf->liste_limit; $limit = GETPOST('limit','int')?GETPOST('limit','int'):$conf->liste_limit;
$sortfield = GETPOST("sortfield",'alpha'); $sortfield = GETPOST("sortfield",'alpha');
$sortorder = GETPOST("sortorder",'alpha'); $sortorder = GETPOST("sortorder",'alpha');
$page = GETPOST("page",'int'); $page = GETPOST("page",'int');

View File

@ -59,8 +59,7 @@ class HookManager
/** /**
* Init array $this->hooks with instantiated action controlers. * Init array $this->hooks with instantiated action controlers.
* First, a hook is declared by a module by adding a constant MAIN_MODULE_MYMODULENAME_HOOKS * First, a hook is declared by a module by adding a constant MAIN_MODULE_MYMODULENAME_HOOKS with value 'nameofcontext1:nameofcontext2:...' into $this->const of module descriptor file.
* with value 'nameofcontext1:nameofcontext2:...' into $this->const of module descriptor file.
* This makes $conf->hooks_modules loaded with an entry ('modulename'=>array(nameofcontext1,nameofcontext2,...)) * This makes $conf->hooks_modules loaded with an entry ('modulename'=>array(nameofcontext1,nameofcontext2,...))
* When initHooks function is called, with initHooks(list_of_contexts), an array $this->hooks is defined with instance of controler * When initHooks function is called, with initHooks(list_of_contexts), an array $this->hooks is defined with instance of controler
* class found into file /mymodule/class/actions_mymodule.class.php (if module has declared the context as a managed context). * class found into file /mymodule/class/actions_mymodule.class.php (if module has declared the context as a managed context).

View File

@ -984,6 +984,7 @@ class Form
if (! empty($conf->use_javascript_ajax) && ! empty($conf->global->COMPANY_USE_SEARCH_TO_SELECT) && ! $forcecombo) if (! empty($conf->use_javascript_ajax) && ! empty($conf->global->COMPANY_USE_SEARCH_TO_SELECT) && ! $forcecombo)
{ {
// No immediate load of all database
$placeholder=''; $placeholder='';
if ($selected && empty($selected_input_value)) if ($selected && empty($selected_input_value))
{ {
@ -1016,6 +1017,7 @@ class Form
} }
else else
{ {
// Immediate load of all database
$out.=$this->select_thirdparty_list($selected, $htmlname, $filter, $showempty, $showtype, $forcecombo, $events, '', 0, $limit, $morecss, $moreparam); $out.=$this->select_thirdparty_list($selected, $htmlname, $filter, $showempty, $showtype, $forcecombo, $events, '', 0, $limit, $morecss, $moreparam);
} }
@ -1023,7 +1025,8 @@ class Form
} }
/** /**
* Output html form to select a third party * Output html form to select a third party.
* Note, you must use the select_company to get the component to select a third party. This function must only be called by select_company.
* *
* @param string $selected Preselected type * @param string $selected Preselected type
* @param string $htmlname Name of field in form * @param string $htmlname Name of field in form
@ -1085,8 +1088,6 @@ class Form
$resql=$this->db->query($sql); $resql=$this->db->query($sql);
if ($resql) if ($resql)
{ {
$events = null;
if ($conf->use_javascript_ajax && ! $forcecombo) if ($conf->use_javascript_ajax && ! $forcecombo)
{ {
include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php'; include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
@ -5759,7 +5760,7 @@ class Form
$disabled = ($disabled ? ' disabled' : ''); $disabled = ($disabled ? ' disabled' : '');
$resultyesno = '<select class="flat" id="'.$htmlname.'" name="'.$htmlname.'"'.$disabled.'>'."\n"; $resultyesno = '<select class="flat" id="'.$htmlname.'" name="'.$htmlname.'"'.$disabled.'>'."\n";
if ($useempty) $resultyesno .= '<option value="-1"'.(($value < 0)?' selected':'').'></option>'."\n"; if ($useempty) $resultyesno .= '<option value="-1"'.(($value < 0)?' selected':'').'>&nbsp;</option>'."\n";
if (("$value" == 'yes') || ($value == 1)) if (("$value" == 'yes') || ($value == 1))
{ {
$resultyesno .= '<option value="'.$yes.'" selected>'.$langs->trans("Yes").'</option>'."\n"; $resultyesno .= '<option value="'.$yes.'" selected>'.$langs->trans("Yes").'</option>'."\n";

View File

@ -3704,7 +3704,7 @@ function vatrate($rate, $addpercent=false, $info_bits=0, $usestarfornpr=0)
* @param float $amount Amount to format * @param float $amount Amount to format
* @param integer $form Type of format, HTML or not (not by default) * @param integer $form Type of format, HTML or not (not by default)
* @param Translate $outlangs Object langs for output * @param Translate $outlangs Object langs for output
* @param int $trunc 1=Truncate if there is too much decimals (default), 0=Does not truncate. Deprecated because amount are rounded (to unit or total amount accurancy) before inserted into database or after a computation, so this parameter should be useless. * @param int $trunc 1=Truncate if there is more decimals than MAIN_MAX_DECIMALS_SHOWN (default), 0=Does not truncate. Deprecated because amount are rounded (to unit or total amount accurancy) before inserted into database or after a computation, so this parameter should be useless.
* @param int $rounding Minimum number of decimal to show. If 0, no change, if -1, we use min($conf->global->MAIN_MAX_DECIMALS_UNIT,$conf->global->MAIN_MAX_DECIMALS_TOTAL) * @param int $rounding Minimum number of decimal to show. If 0, no change, if -1, we use min($conf->global->MAIN_MAX_DECIMALS_UNIT,$conf->global->MAIN_MAX_DECIMALS_TOTAL)
* @param int $forcerounding Force the number of decimal to forcerounding decimal (-1=do not force) * @param int $forcerounding Force the number of decimal to forcerounding decimal (-1=do not force)
* @param string $currency_code To add currency symbol (''=add nothing, 'auto'=Use default currency, 'XXX'=add currency symbols for XXX currency) * @param string $currency_code To add currency symbol (''=add nothing, 'auto'=Use default currency, 'XXX'=add currency symbols for XXX currency)

View File

@ -1155,8 +1155,7 @@ class Cronjob extends CommonObject
} }
} }
dol_syslog(get_class($this)."::reprogram_jobs ", LOG_DEBUG); dol_syslog(get_class($this)."::reprogram_jobs datenextrun=".$this->datenextrun." ".dol_print_date($this->datenextrun, 'dayhourrfc')." frequency=".$this->frequency." unitfrequency=".$this->unitfrequency, LOG_DEBUG);
if (empty($this->datenextrun)) if (empty($this->datenextrun))
{ {
@ -1177,6 +1176,7 @@ class Cronjob extends CommonObject
else else
{ {
//$this->datenextrun=$this->datenextrun + ($this->frequency * $this->unitfrequency); //$this->datenextrun=$this->datenextrun + ($this->frequency * $this->unitfrequency);
dol_syslog(get_class($this)."::reprogram_jobs datenextrun is already in future, we do not change it");
} }

View File

@ -48,7 +48,7 @@ $object->info($id);
$head = cron_prepare_head($object); $head = cron_prepare_head($object);
dol_fiche_head($head, 'info', $langs->trans("CronTask"), 0, 'cron'); dol_fiche_head($head, 'info', $langs->trans("CronTask"), -1, 'cron');
print '<table width="100%"><tr><td>'; print '<table width="100%"><tr><td>';
dol_print_object_info($object); dol_print_object_info($object);

View File

@ -39,7 +39,7 @@ $action=GETPOST('action','alpha');
$confirm=GETPOST('confirm','alpha'); $confirm=GETPOST('confirm','alpha');
$id=GETPOST('id','int'); $id=GETPOST('id','int');
$limit = GETPOST("limit")?GETPOST("limit","int"):$conf->liste_limit; $limit = GETPOST('limit','int')?GETPOST('limit','int'):$conf->liste_limit;
$sortfield = GETPOST("sortfield",'alpha'); $sortfield = GETPOST("sortfield",'alpha');
$sortorder = GETPOST("sortorder",'alpha'); $sortorder = GETPOST("sortorder",'alpha');
$page = GETPOST("page",'int'); $page = GETPOST("page",'int');

View File

@ -53,7 +53,7 @@ $search_type_thirdparty=GETPOST("search_type_thirdparty",'int');
$sall = GETPOST('sall', 'alphanohtml'); $sall = GETPOST('sall', 'alphanohtml');
$optioncss = GETPOST('optioncss','alpha'); $optioncss = GETPOST('optioncss','alpha');
$limit = GETPOST("limit")?GETPOST("limit","int"):$conf->liste_limit; $limit = GETPOST('limit','int')?GETPOST('limit','int'):$conf->liste_limit;
$sortfield = GETPOST('sortfield','alpha'); $sortfield = GETPOST('sortfield','alpha');
$sortorder = GETPOST('sortorder','alpha'); $sortorder = GETPOST('sortorder','alpha');
$page = GETPOST('page','int'); $page = GETPOST('page','int');

View File

@ -51,7 +51,7 @@ $diroutputmassaction=$conf->expensereport->dir_output . '/temp/massgeneration/'.
// Load variable for pagination // Load variable for pagination
$limit = GETPOST("limit")?GETPOST("limit","int"):$conf->liste_limit; $limit = GETPOST('limit','int')?GETPOST('limit','int'):$conf->liste_limit;
$sortfield = GETPOST('sortfield','alpha'); $sortfield = GETPOST('sortfield','alpha');
$sortorder = GETPOST('sortorder','alpha'); $sortorder = GETPOST('sortorder','alpha');
$page = GETPOST('page','int'); $page = GETPOST('page','int');

View File

@ -101,7 +101,7 @@ $result = restrictedArea($user, 'fournisseur', $orderid, '', 'commande');
$diroutputmassaction=$conf->fournisseur->commande->dir_output . '/temp/massgeneration/'.$user->id; $diroutputmassaction=$conf->fournisseur->commande->dir_output . '/temp/massgeneration/'.$user->id;
$limit = GETPOST("limit")?GETPOST("limit","int"):$conf->liste_limit; $limit = GETPOST('limit','int')?GETPOST('limit','int'):$conf->liste_limit;
$sortfield = GETPOST("sortfield",'alpha'); $sortfield = GETPOST("sortfield",'alpha');
$sortorder = GETPOST("sortorder",'alpha'); $sortorder = GETPOST("sortorder",'alpha');
$page = GETPOST("page",'int'); $page = GETPOST("page",'int');

View File

@ -42,7 +42,7 @@ $type = GETPOST('type');
$optioncss = GETPOST('optioncss','alpha'); $optioncss = GETPOST('optioncss','alpha');
// Load variable for pagination // Load variable for pagination
$limit = GETPOST("limit")?GETPOST("limit","int"):$conf->liste_limit; $limit = GETPOST('limit','int')?GETPOST('limit','int'):$conf->liste_limit;
$sortfield = GETPOST('sortfield','alpha'); $sortfield = GETPOST('sortfield','alpha');
$sortorder = GETPOST('sortorder','alpha'); $sortorder = GETPOST('sortorder','alpha');
$page = GETPOST('page','int'); $page = GETPOST('page','int');

View File

@ -136,6 +136,7 @@ if (! GETPOST('action','aZ09') || preg_match('/upgrade/i',GETPOST('action','aZ09
// Create the global $hookmanager object // Create the global $hookmanager object
include_once DOL_DOCUMENT_ROOT.'/core/class/hookmanager.class.php'; include_once DOL_DOCUMENT_ROOT.'/core/class/hookmanager.class.php';
$hookmanager=new HookManager($db); $hookmanager=new HookManager($db);
$hookmanager->initHooks(array('upgrade'));
if (!$db->connected) if (!$db->connected)
{ {
@ -490,12 +491,16 @@ if (! GETPOST('action','aZ09') || preg_match('/upgrade/i',GETPOST('action','aZ09
} }
} }
else else
{
//if (! empty($conf->modules))
if (! empty($conf->modules_parts['hooks'])) // If there is at least one module with one hook, we show message to say nothing was done
{ {
print '<tr><td colspan="4">'; print '<tr><td colspan="4">';
print '<b>'.$langs->trans('UpgradeExternalModule').'</b>: '.$langs->trans("None"); print '<b>'.$langs->trans('UpgradeExternalModule').'</b>: '.$langs->trans("None");
print '</td></tr>'; print '</td></tr>';
} }
} }
}
print '</table>'; print '</table>';

View File

@ -50,7 +50,7 @@ class modMyModule extends DolibarrModules
// Id for module (must be unique). // Id for module (must be unique).
// Use here a free id (See in Home -> System information -> Dolibarr for list of used modules id). // Use here a free id (See in Home -> System information -> Dolibarr for list of used modules id).
$this->numero = 500000; // TODO Go on page http://wiki.dolibarr.org/index.php/List_of_modules_id to reserve id number for your module $this->numero = 500000; // TODO Go on page https://wiki.dolibarr.org/index.php/List_of_modules_id to reserve id number for your module
// Key text used to identify module (for permissions, menus, etc...) // Key text used to identify module (for permissions, menus, etc...)
$this->rights_class = 'mymodule'; $this->rights_class = 'mymodule';
@ -62,11 +62,13 @@ class modMyModule extends DolibarrModules
// Gives the possibility to the module, to provide his own family info and position of this family (Overwrite $this->family and $this->module_position. Avoid this) // Gives the possibility to the module, to provide his own family info and position of this family (Overwrite $this->family and $this->module_position. Avoid this)
//$this->familyinfo = array('myownfamily' => array('position' => '001', 'label' => $langs->trans("MyOwnFamily"))); //$this->familyinfo = array('myownfamily' => array('position' => '001', 'label' => $langs->trans("MyOwnFamily")));
// Module label (no space allowed), used if translation string 'ModuleXXXName' not found (where XXX is value of numeric property 'numero' of module) // Module label (no space allowed), used if translation string 'ModuleMyModuleName' not found (MyModue is name of module).
$this->name = preg_replace('/^mod/i','',get_class($this)); $this->name = preg_replace('/^mod/i','',get_class($this));
// Module description, used if translation string 'ModuleXXXDesc' not found (where XXX is value of numeric property 'numero' of module) // Module description, used if translation string 'ModuleMyModuleDesc' not found (MyModue is name of module).
$this->description = "MyModuleDescription"; $this->description = "MyModuleDescription";
// Used only if file README.md and README-LL.md not found.
$this->descriptionlong = "MyModuleDescription (Long)"; $this->descriptionlong = "MyModuleDescription (Long)";
$this->editor_name = 'Editor name'; $this->editor_name = 'Editor name';
$this->editor_url = 'https://www.example.com'; $this->editor_url = 'https://www.example.com';

View File

@ -17,11 +17,9 @@
*/ */
/** /**
* \file css/mycss.css.php * \file htdocs/modulebuilder/template/css/mycss.css.php
* \ingroup mymodule * \ingroup mymodule
* \brief Example CSS. * \brief CSS file for module MyModule.
*
* Put detailed description here.
*/ */
header('Content-Type: text/css'); header('Content-Type: text/css');

View File

@ -19,9 +19,7 @@
/** /**
* \file htdocs/modulebuilder/template/js/mymodule.js.php * \file htdocs/modulebuilder/template/js/mymodule.js.php
* \ingroup mymodule * \ingroup mymodule
* \brief Example JavaScript. * \brief JavaScript file for module MyModule.
*
* Put detailed description here.
*/ */
header('Content-Type: application/javascript'); header('Content-Type: application/javascript');

View File

@ -68,7 +68,7 @@ $search_myfield=GETPOST('search_myfield');
$optioncss = GETPOST('optioncss','alpha'); $optioncss = GETPOST('optioncss','alpha');
// Load variable for pagination // Load variable for pagination
$limit = GETPOST("limit")?GETPOST("limit","int"):$conf->liste_limit; $limit = GETPOST('limit','int')?GETPOST('limit','int'):$conf->liste_limit;
$sortfield = GETPOST('sortfield','alpha'); $sortfield = GETPOST('sortfield','alpha');
$sortorder = GETPOST('sortorder','alpha'); $sortorder = GETPOST('sortorder','alpha');
$page = GETPOST('page','int'); $page = GETPOST('page','int');

View File

@ -36,7 +36,7 @@ require_once DOL_DOCUMENT_ROOT.'/product/inventory/lib/inventory.lib.php';
$langs->load("stock"); $langs->load("stock");
$langs->load("inventory"); $langs->load("inventory");
$limit = GETPOST("limit")?GETPOST("limit","int"):$conf->liste_limit; $limit = GETPOST('limit','int')?GETPOST('limit','int'):$conf->liste_limit;
$sortfield = GETPOST("sortfield",'alpha'); $sortfield = GETPOST("sortfield",'alpha');
$sortorder = GETPOST("sortorder",'alpha'); $sortorder = GETPOST("sortorder",'alpha');
$page = (GETPOST("page",'int')?GETPOST("page", 'int'):0); $page = (GETPOST("page",'int')?GETPOST("page", 'int'):0);

View File

@ -77,7 +77,7 @@ if (!$_POST) {
$diroutputmassaction=$conf->product->dir_output . '/temp/massgeneration/'.$user->id; $diroutputmassaction=$conf->product->dir_output . '/temp/massgeneration/'.$user->id;
$limit = GETPOST("limit")?GETPOST("limit","int"):$conf->liste_limit; $limit = GETPOST('limit','int')?GETPOST('limit','int'):$conf->liste_limit;
$sortfield = GETPOST("sortfield",'alpha'); $sortfield = GETPOST("sortfield",'alpha');
$sortorder = GETPOST("sortorder",'alpha'); $sortorder = GETPOST("sortorder",'alpha');
$page = (GETPOST("page",'int')?GETPOST("page", 'int'):0); $page = (GETPOST("page",'int')?GETPOST("page", 'int'):0);

View File

@ -77,7 +77,7 @@ if (!$_POST) {
$diroutputmassaction=$conf->product->dir_output . '/temp/massgeneration/'.$user->id; $diroutputmassaction=$conf->product->dir_output . '/temp/massgeneration/'.$user->id;
$limit = GETPOST("limit")?GETPOST("limit","int"):$conf->liste_limit; $limit = GETPOST('limit','int')?GETPOST('limit','int'):$conf->liste_limit;
$sortfield = GETPOST("sortfield",'alpha'); $sortfield = GETPOST("sortfield",'alpha');
$sortorder = GETPOST("sortorder",'alpha'); $sortorder = GETPOST("sortorder",'alpha');
$page = (GETPOST("page",'int')?GETPOST("page", 'int'):0); $page = (GETPOST("page",'int')?GETPOST("page", 'int'):0);
@ -674,6 +674,7 @@ else
$product_fourn =new ProductFournisseur($db); $product_fourn =new ProductFournisseur($db);
$i = 0; $i = 0;
$totalarray=array();
while ($i < min($num,$limit)) while ($i < min($num,$limit))
{ {
$obj = $db->fetch_object($resql); $obj = $db->fetch_object($resql);
@ -721,6 +722,7 @@ else
print '<td class="nowrap">'; print '<td class="nowrap">';
print $product_static->getNomUrl(1,'',24); print $product_static->getNomUrl(1,'',24);
print "</td>\n"; print "</td>\n";
if (! $i) $totalarray['nbfield']++;
} }
// Ref supplier // Ref supplier
if (! empty($arrayfields['pfp.ref_fourn']['checked'])) if (! empty($arrayfields['pfp.ref_fourn']['checked']))
@ -728,23 +730,27 @@ else
print '<td class="nowrap">'; print '<td class="nowrap">';
print $product_static->getNomUrl(1,'',24); print $product_static->getNomUrl(1,'',24);
print "</td>\n"; print "</td>\n";
if (! $i) $totalarray['nbfield']++;
} }
// Label // Label
if (! empty($arrayfields['p.label']['checked'])) if (! empty($arrayfields['p.label']['checked']))
{ {
print '<td>'.dol_trunc($obj->label,40).'</td>'; print '<td>'.dol_trunc($obj->label,40).'</td>';
if (! $i) $totalarray['nbfield']++;
} }
// Type // Type
if (! empty($arrayfields['p.fk_product_type']['checked'])) if (! empty($arrayfields['p.fk_product_type']['checked']))
{ {
print '<td>'.$obj->fk_product_type.'</td>'; print '<td>'.$obj->fk_product_type.'</td>';
if (! $i) $totalarray['nbfield']++;
} }
// Barcode // Barcode
if (! empty($arrayfields['p.barcode']['checked'])) if (! empty($arrayfields['p.barcode']['checked']))
{ {
print '<td>'.$obj->barcode.'</td>'; print '<td>'.$obj->barcode.'</td>';
if (! $i) $totalarray['nbfield']++;
} }
// Duration // Duration
@ -761,6 +767,7 @@ else
else print $obj->duration; else print $obj->duration;
} }
print '</td>'; print '</td>';
if (! $i) $totalarray['nbfield']++;
} }
// Sell price // Sell price
@ -773,6 +780,7 @@ else
else print price($obj->price).' '.$langs->trans("HT"); else print price($obj->price).' '.$langs->trans("HT");
} }
print '</td>'; print '</td>';
if (! $i) $totalarray['nbfield']++;
} }
// Better buy price // Better buy price
@ -796,6 +804,7 @@ else
} }
} }
print '</td>'; print '</td>';
if (! $i) $totalarray['nbfield']++;
} }
// Limit alert // Limit alert
@ -807,6 +816,7 @@ else
print $obj->seuil_stock_alerte; print $obj->seuil_stock_alerte;
} }
print '</td>'; print '</td>';
if (! $i) $totalarray['nbfield']++;
} }
// Desired stock // Desired stock
if (! empty($arrayfields['p.desiredstock']['checked'])) if (! empty($arrayfields['p.desiredstock']['checked']))
@ -817,6 +827,7 @@ else
print $obj->desiredstock; print $obj->desiredstock;
} }
print '</td>'; print '</td>';
if (! $i) $totalarray['nbfield']++;
} }
// Stock // Stock
if (! empty($arrayfields['p.stock']['checked'])) if (! empty($arrayfields['p.stock']['checked']))
@ -828,6 +839,7 @@ else
print $product_static->stock_reel; print $product_static->stock_reel;
} }
print '</td>'; print '</td>';
if (! $i) $totalarray['nbfield']++;
} }
// Stock // Stock
if (! empty($arrayfields['stock_virtual']['checked'])) if (! empty($arrayfields['stock_virtual']['checked']))
@ -839,6 +851,7 @@ else
print $product_static->stock_theorique; print $product_static->stock_theorique;
} }
print '</td>'; print '</td>';
if (! $i) $totalarray['nbfield']++;
} }
// Lot/Serial // Lot/Serial
if (! empty($arrayfields['p.tobatch']['checked'])) if (! empty($arrayfields['p.tobatch']['checked']))
@ -846,11 +859,20 @@ else
print '<td align="center">'; print '<td align="center">';
print yn($obj->tobatch); print yn($obj->tobatch);
print '</td>'; print '</td>';
if (! $i) $totalarray['nbfield']++;
} }
// Accountancy code sell // Accountancy code sell
if (! empty($arrayfields['p.accountancy_code_sell']['checked'])) print '<td>'.$obj->accountancy_code_sell.'</td>'; if (! empty($arrayfields['p.accountancy_code_sell']['checked']))
{
print '<td>'.$obj->accountancy_code_sell.'</td>';
if (! $i) $totalarray['nbfield']++;
}
// Accountancy code sell // Accountancy code sell
if (! empty($arrayfields['p.accountancy_code_buy']['checked'])) print '<td>'.$obj->accountancy_code_buy.'</td>'; if (! empty($arrayfields['p.accountancy_code_buy']['checked']))
{
print '<td>'.$obj->accountancy_code_buy.'</td>';
if (! $i) $totalarray['nbfield']++;
}
// Extra fields // Extra fields
if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label)) if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label))
{ {
@ -865,6 +887,7 @@ else
$tmpkey='options_'.$key; $tmpkey='options_'.$key;
print $extrafields->showOutputField($key, $obj->$tmpkey, '', 1); print $extrafields->showOutputField($key, $obj->$tmpkey, '', 1);
print '</td>'; print '</td>';
if (! $i) $totalarray['nbfield']++;
} }
} }
} }
@ -878,6 +901,7 @@ else
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>';
if (! $i) $totalarray['nbfield']++;
} }
// Date modification // Date modification
if (! empty($arrayfields['p.tms']['checked'])) if (! empty($arrayfields['p.tms']['checked']))
@ -885,6 +909,7 @@ else
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>';
if (! $i) $totalarray['nbfield']++;
} }
// Status (to sell) // Status (to sell)
@ -897,6 +922,7 @@ else
print $product_static->LibStatut($obj->tosell,5,0); print $product_static->LibStatut($obj->tosell,5,0);
} }
print '</td>'; print '</td>';
if (! $i) $totalarray['nbfield']++;
} }
// Status (to buy) // Status (to buy)
if (! empty($arrayfields['p.tobuy']['checked'])) if (! empty($arrayfields['p.tobuy']['checked']))
@ -908,6 +934,7 @@ else
print $product_static->LibStatut($obj->tobuy,5,1); print $product_static->LibStatut($obj->tobuy,5,1);
} }
print '</td>'; print '</td>';
if (! $i) $totalarray['nbfield']++;
} }
// Action // Action
print '<td class="nowrap" align="center">'; print '<td class="nowrap" align="center">';
@ -918,6 +945,7 @@ else
print '<input id="cb'.$obj->rowid.'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$obj->rowid.'"'.($selected?' checked="checked"':'').'>'; print '<input id="cb'.$obj->rowid.'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$obj->rowid.'"'.($selected?' checked="checked"':'').'>';
} }
print '</td>'; print '</td>';
if (! $i) $totalarray['nbfield']++;
print "</tr>\n"; print "</tr>\n";
$i++; $i++;

View File

@ -38,7 +38,7 @@ $type=GETPOST("type","int");
if (! empty($user->societe_id)) $socid=$user->societe_id; if (! empty($user->societe_id)) $socid=$user->societe_id;
$result=restrictedArea($user,'produit|service'); $result=restrictedArea($user,'produit|service');
$limit = GETPOST("limit")?GETPOST("limit","int"):$conf->liste_limit; $limit = GETPOST('limit','int')?GETPOST('limit','int'):$conf->liste_limit;
$sortfield = GETPOST("sortfield",'alpha'); $sortfield = GETPOST("sortfield",'alpha');
$sortorder = GETPOST("sortorder",'alpha'); $sortorder = GETPOST("sortorder",'alpha');
$page = GETPOST("page",'int'); $page = GETPOST("page",'int');

View File

@ -61,7 +61,7 @@ $search_myfield=GETPOST('search_myfield');
$optioncss = GETPOST('optioncss','alpha'); $optioncss = GETPOST('optioncss','alpha');
// Load variable for pagination // Load variable for pagination
$limit = GETPOST("limit")?GETPOST("limit","int"):$conf->liste_limit; $limit = GETPOST('limit','int')?GETPOST('limit','int'):$conf->liste_limit;
$sortfield = GETPOST('sortfield','alpha'); $sortfield = GETPOST('sortfield','alpha');
$sortorder = GETPOST('sortorder','alpha'); $sortorder = GETPOST('sortorder','alpha');
$page = GETPOST('page','int'); $page = GETPOST('page','int');

View File

@ -41,6 +41,7 @@ $ref=GETPOST('ref','alpha');
$action=GETPOST('action','alpha'); $action=GETPOST('action','alpha');
$backtopage=GETPOST('backtopage','alpha'); $backtopage=GETPOST('backtopage','alpha');
$cancel=GETPOST('cancel','alpha'); $cancel=GETPOST('cancel','alpha');
$confirm=GETPOST('confirm','aZ09');
$status=GETPOST('status','int'); $status=GETPOST('status','int');
$opp_status=GETPOST('opp_status','int'); $opp_status=GETPOST('opp_status','int');
$opp_percent=price2num(GETPOST('opp_percent','alpha')); $opp_percent=price2num(GETPOST('opp_percent','alpha'));
@ -68,7 +69,7 @@ if ($id > 0 || ! empty($ref))
} }
// Security check // Security check
$socid=GETPOST('socid'); $socid=GETPOST('socid','int');
//if ($user->societe_id > 0) $socid = $user->societe_id; // For external user, no check is done on company because readability is managed by public status of project and assignement. //if ($user->societe_id > 0) $socid = $user->societe_id; // For external user, no check is done on company because readability is managed by public status of project and assignement.
$result = restrictedArea($user, 'projet', $object->id,'projet&project'); $result = restrictedArea($user, 'projet', $object->id,'projet&project');
@ -135,6 +136,12 @@ if (empty($reshook))
setEventMessages($langs->trans("ErrorOppStatusRequiredIfAmount"), null, 'errors'); setEventMessages($langs->trans("ErrorOppStatusRequiredIfAmount"), null, 'errors');
} }
// Create with status validated immediatly
if (! empty($conf->global->PROJECT_CREATE_NO_DRAFT))
{
$status=Project::STATUS_VALIDATED;
}
if (! $error) if (! $error)
{ {
$error=0; $error=0;
@ -148,10 +155,10 @@ if (empty($reshook))
$object->public = GETPOST('public','alpha'); $object->public = GETPOST('public','alpha');
$object->opp_amount = price2num(GETPOST('opp_amount')); $object->opp_amount = price2num(GETPOST('opp_amount'));
$object->budget_amount = price2num(GETPOST('budget_amount')); $object->budget_amount = price2num(GETPOST('budget_amount'));
$object->datec=dol_now(); $object->datec = dol_now();
$object->date_start=$date_start; $object->date_start = $date_start;
$object->date_end=$date_end; $object->date_end = $date_end;
$object->statuts = $status; $object->statut = $status;
$object->opp_status = $opp_status; $object->opp_status = $opp_status;
$object->opp_percent = $opp_percent; $object->opp_percent = $opp_percent;
@ -365,7 +372,7 @@ if (empty($reshook))
} }
if ($action == 'confirm_validate' && GETPOST('confirm') == 'yes') if ($action == 'confirm_validate' && $confirm == 'yes')
{ {
$result = $object->setValid($user); $result = $object->setValid($user);
if ($result <= 0) if ($result <= 0)
@ -374,7 +381,7 @@ if (empty($reshook))
} }
} }
if ($action == 'confirm_close' && GETPOST('confirm') == 'yes') if ($action == 'confirm_close' && $confirm == 'yes')
{ {
$result = $object->setClose($user); $result = $object->setClose($user);
if ($result <= 0) if ($result <= 0)
@ -383,7 +390,7 @@ if (empty($reshook))
} }
} }
if ($action == 'confirm_reopen' && GETPOST('confirm') == 'yes') if ($action == 'confirm_reopen' && $confirm == 'yes')
{ {
$result = $object->setValid($user); $result = $object->setValid($user);
if ($result <= 0) if ($result <= 0)
@ -409,7 +416,7 @@ if (empty($reshook))
} }
} }
if ($action == 'confirm_clone' && $user->rights->projet->creer && GETPOST('confirm') == 'yes') if ($action == 'confirm_clone' && $user->rights->projet->creer && $confirm == 'yes')
{ {
$clone_contacts=GETPOST('clone_contacts')?1:0; $clone_contacts=GETPOST('clone_contacts')?1:0;
$clone_tasks=GETPOST('clone_tasks')?1:0; $clone_tasks=GETPOST('clone_tasks')?1:0;
@ -885,12 +892,16 @@ elseif ($object->id > 0)
// Opportunity percent // Opportunity percent
print '<tr><td>'.$langs->trans("OpportunityProbability").'</td><td>'; print '<tr><td>'.$langs->trans("OpportunityProbability").'</td><td>';
if (strcmp($object->opp_percent,'')) print price($object->opp_percent,0,$langs,1,0).' %'; if (strcmp($object->opp_percent,'')) print price($object->opp_percent, 0, $langs, 1, 0).' %';
print '</td></tr>'; print '</td></tr>';
// Opportunity Amount // Opportunity Amount
print '<tr><td>'.$langs->trans("OpportunityAmount").'</td><td>'; print '<tr><td>'.$langs->trans("OpportunityAmount").'</td><td>';
if (strcmp($object->opp_amount,'')) print price($object->opp_amount,0,$langs,1,0,0,$conf->currency); /*if ($object->opp_status)
{
print price($obj->opp_amount, 1, $langs, 1, 0, -1, $conf->currency);
}*/
if (strcmp($object->opp_amount,'')) print price($object->opp_amount, 0, $langs, 1, 0, -1, $conf->currency);
print '</td></tr>'; print '</td></tr>';
} }

View File

@ -103,6 +103,20 @@ class Project extends CommonObject
*/ */
public $lines; public $lines;
/**
* Draft status
*/
const STATUS_DRAFT = 0;
/**
* Open/Validated status
*/
const STATUS_VALIDATED = 1;
/**
* Closed status
*/
const STATUS_CLOSED = 2;
/** /**
* Constructor * Constructor

View File

@ -35,7 +35,7 @@ $ref = GETPOST('ref','alpha');
$socid = GETPOST('socid','int'); $socid = GETPOST('socid','int');
$action = GETPOST('action','alpha'); $action = GETPOST('action','alpha');
$limit = GETPOST("limit")?GETPOST("limit","int"):$conf->liste_limit; $limit = GETPOST('limit','int')?GETPOST('limit','int'):$conf->liste_limit;
$sortfield = GETPOST("sortfield","alpha"); $sortfield = GETPOST("sortfield","alpha");
$sortorder = GETPOST("sortorder"); $sortorder = GETPOST("sortorder");
$page = GETPOST("page"); $page = GETPOST("page");

View File

@ -55,7 +55,7 @@ if (!$user->rights->projet->lire) accessforbidden();
$diroutputmassaction=$conf->projet->dir_output . '/temp/massgeneration/'.$user->id; $diroutputmassaction=$conf->projet->dir_output . '/temp/massgeneration/'.$user->id;
$limit = GETPOST("limit")?GETPOST("limit","int"):$conf->liste_limit; $limit = GETPOST('limit','int')?GETPOST('limit','int'):$conf->liste_limit;
$sortfield = GETPOST("sortfield","alpha"); $sortfield = GETPOST("sortfield","alpha");
$sortorder = GETPOST("sortorder"); $sortorder = GETPOST("sortorder");
$page = GETPOST("page"); $page = GETPOST("page");
@ -384,7 +384,7 @@ if ($search_label != '') $param.='&search_label='.$search_label;
if ($search_societe != '') $param.='&search_societe='.$search_societe; if ($search_societe != '') $param.='&search_societe='.$search_societe;
if ($search_status >= 0) $param.='&search_status='.$search_status; if ($search_status >= 0) $param.='&search_status='.$search_status;
if ((is_numeric($search_opp_status) && $search_opp_status >= 0) || in_array($search_opp_status, array('all','openedopp','none'))) $param.='&search_opp_status='.urlencode($search_opp_status); if ((is_numeric($search_opp_status) && $search_opp_status >= 0) || in_array($search_opp_status, array('all','openedopp','none'))) $param.='&search_opp_status='.urlencode($search_opp_status);
if ((is_numeric($search_opp_percent) && $search_opp_percent >= 0) || in_array($search_opp_percent, array('all','openedopp','none'))) $param.='&search_opp_percent='.urlencode($search_opp_percent); if ($search_opp_percent != '') $param.='&search_opp_percent='.urlencode($search_opp_percent);
if ($search_public != '') $param.='&search_public='.$search_public; if ($search_public != '') $param.='&search_public='.$search_public;
if ($search_project_user != '') $param.='&search_project_user='.$search_project_user; if ($search_project_user != '') $param.='&search_project_user='.$search_project_user;
if ($search_sale > 0) $param.='&search_sale='.$search_sale; if ($search_sale > 0) $param.='&search_sale='.$search_sale;
@ -532,18 +532,18 @@ if (! empty($arrayfields['p.public']['checked']))
print $form->selectarray('search_public',$array,$search_public); print $form->selectarray('search_public',$array,$search_public);
print '</td>'; print '</td>';
} }
if (! empty($arrayfields['p.opp_amount']['checked']))
{
print '<td class="liste_titre nowrap right">';
print '<input type="text" class="flat" name="search_opp_amount" size="3" value="'.$search_opp_amount.'">';
print '</td>';
}
if (! empty($arrayfields['p.fk_opp_status']['checked'])) if (! empty($arrayfields['p.fk_opp_status']['checked']))
{ {
print '<td class="liste_titre nowrap center">'; print '<td class="liste_titre nowrap center">';
print $formproject->selectOpportunityStatus('search_opp_status', $search_opp_status, 1, 1, 1, 0, 'maxwidth100'); print $formproject->selectOpportunityStatus('search_opp_status', $search_opp_status, 1, 1, 1, 0, 'maxwidth100');
print '</td>'; print '</td>';
} }
if (! empty($arrayfields['p.opp_amount']['checked']))
{
print '<td class="liste_titre nowrap right">';
print '<input type="text" class="flat" name="search_opp_amount" size="3" value="'.$search_opp_amount.'">';
print '</td>';
}
if (! empty($arrayfields['p.opp_percent']['checked'])) if (! empty($arrayfields['p.opp_percent']['checked']))
{ {
print '<td class="liste_titre nowrap right">'; print '<td class="liste_titre nowrap right">';
@ -620,8 +620,8 @@ if (! empty($arrayfields['commercial']['checked'])) print_liste_field_titre
if (! empty($arrayfields['p.dateo']['checked'])) print_liste_field_titre($arrayfields['p.dateo']['label'],$_SERVER["PHP_SELF"],"p.dateo","",$param,'align="center"',$sortfield,$sortorder); if (! empty($arrayfields['p.dateo']['checked'])) print_liste_field_titre($arrayfields['p.dateo']['label'],$_SERVER["PHP_SELF"],"p.dateo","",$param,'align="center"',$sortfield,$sortorder);
if (! empty($arrayfields['p.datee']['checked'])) print_liste_field_titre($arrayfields['p.datee']['label'],$_SERVER["PHP_SELF"],"p.datee","",$param,'align="center"',$sortfield,$sortorder); if (! empty($arrayfields['p.datee']['checked'])) print_liste_field_titre($arrayfields['p.datee']['label'],$_SERVER["PHP_SELF"],"p.datee","",$param,'align="center"',$sortfield,$sortorder);
if (! empty($arrayfields['p.public']['checked'])) print_liste_field_titre($arrayfields['p.public']['label'],$_SERVER["PHP_SELF"],"p.public","",$param,"",$sortfield,$sortorder); if (! empty($arrayfields['p.public']['checked'])) print_liste_field_titre($arrayfields['p.public']['label'],$_SERVER["PHP_SELF"],"p.public","",$param,"",$sortfield,$sortorder);
if (! empty($arrayfields['p.opp_amount']['checked'])) print_liste_field_titre($arrayfields['p.opp_amount']['label'],$_SERVER["PHP_SELF"],'p.opp_amount',"",$param,'align="right"',$sortfield,$sortorder);
if (! empty($arrayfields['p.fk_opp_status']['checked'])) print_liste_field_titre($arrayfields['p.fk_opp_status']['label'],$_SERVER["PHP_SELF"],'p.fk_opp_status',"",$param,'align="center"',$sortfield,$sortorder); if (! empty($arrayfields['p.fk_opp_status']['checked'])) print_liste_field_titre($arrayfields['p.fk_opp_status']['label'],$_SERVER["PHP_SELF"],'p.fk_opp_status',"",$param,'align="center"',$sortfield,$sortorder);
if (! empty($arrayfields['p.opp_amount']['checked'])) print_liste_field_titre($arrayfields['p.opp_amount']['label'],$_SERVER["PHP_SELF"],'p.opp_amount',"",$param,'align="right"',$sortfield,$sortorder);
if (! empty($arrayfields['p.opp_percent']['checked'])) print_liste_field_titre($arrayfields['p.opp_percent']['label'],$_SERVER["PHP_SELF"],'p.opp_percent',"",$param,'align="right"',$sortfield,$sortorder); if (! empty($arrayfields['p.opp_percent']['checked'])) print_liste_field_titre($arrayfields['p.opp_percent']['label'],$_SERVER["PHP_SELF"],'p.opp_percent',"",$param,'align="right"',$sortfield,$sortorder);
if (! empty($arrayfields['p.budget_amount']['checked'])) print_liste_field_titre($arrayfields['p.budget_amount']['label'],$_SERVER["PHP_SELF"],'p.budget_amount',"",$param,'align="right"',$sortfield,$sortorder); if (! empty($arrayfields['p.budget_amount']['checked'])) print_liste_field_titre($arrayfields['p.budget_amount']['label'],$_SERVER["PHP_SELF"],'p.budget_amount',"",$param,'align="right"',$sortfield,$sortorder);
// Extra fields // Extra fields
@ -770,19 +770,6 @@ while ($i < min($num,$limit))
print '</td>'; print '</td>';
if (! $i) $totalarray['nbfield']++; if (! $i) $totalarray['nbfield']++;
} }
// Opp Amount
if (! empty($arrayfields['p.opp_amount']['checked']))
{
print '<td align="right">';
if ($obj->opp_status_code)
{
print price($obj->opp_amount, 1, '', 1, -1, -1, '');
$totalarray['totalopp'] += $obj->opp_amount;
}
print '</td>';
if (! $i) $totalarray['nbfield']++;
if (! $i) $totalarray['totaloppfield']=$totalarray['nbfield'];
}
// Opp Status // Opp Status
if (! empty($arrayfields['p.fk_opp_status']['checked'])) if (! empty($arrayfields['p.fk_opp_status']['checked']))
{ {
@ -791,11 +778,25 @@ while ($i < min($num,$limit))
print '</td>'; print '</td>';
if (! $i) $totalarray['nbfield']++; if (! $i) $totalarray['nbfield']++;
} }
// Opp Amount
if (! empty($arrayfields['p.opp_amount']['checked']))
{
print '<td align="right">';
//if ($obj->opp_status_code)
if (strcmp($obj->opp_amount,''))
{
print price($obj->opp_amount, 1, $langs, 1, -1, -1, '');
$totalarray['totalopp'] += $obj->opp_amount;
}
print '</td>';
if (! $i) $totalarray['nbfield']++;
if (! $i) $totalarray['totaloppfield']=$totalarray['nbfield'];
}
// Opp percent // Opp percent
if (! empty($arrayfields['p.opp_percent']['checked'])) if (! empty($arrayfields['p.opp_percent']['checked']))
{ {
print '<td align="right">'; print '<td align="right">';
if ($obj->opp_percent) print price($obj->opp_percent, 1, '', 1, 0).'%'; if ($obj->opp_percent) print price($obj->opp_percent, 1, $langs, 1, 0).'%';
print '</td>'; print '</td>';
if (! $i) $totalarray['nbfield']++; if (! $i) $totalarray['nbfield']++;
} }
@ -805,7 +806,7 @@ while ($i < min($num,$limit))
print '<td align="right">'; print '<td align="right">';
if ($obj->budget_amount != '') if ($obj->budget_amount != '')
{ {
print price($obj->budget_amount, 1, '', 1, -1, -1); print price($obj->budget_amount, 1, $langs, 1, -1, -1);
$totalarray['totalbudget'] += $obj->budget_amount; $totalarray['totalbudget'] += $obj->budget_amount;
} }
print '</td>'; print '</td>';
@ -826,10 +827,10 @@ while ($i < min($num,$limit))
$tmpkey='options_'.$key; $tmpkey='options_'.$key;
print $extrafields->showOutputField($key, $obj->$tmpkey, '', 1); print $extrafields->showOutputField($key, $obj->$tmpkey, '', 1);
print '</td>'; print '</td>';
}
}
if (! $i) $totalarray['nbfield']++; if (! $i) $totalarray['nbfield']++;
} }
}
}
// Fields from hook // Fields from hook
$parameters=array('arrayfields'=>$arrayfields, 'obj'=>$obj); $parameters=array('arrayfields'=>$arrayfields, 'obj'=>$obj);
$reshook=$hookmanager->executeHooks('printFieldListValue',$parameters); // Note that $action and $object may have been modified by hook $reshook=$hookmanager->executeHooks('printFieldListValue',$parameters); // Note that $action and $object may have been modified by hook
@ -887,8 +888,8 @@ if (isset($totalarray['totaloppfield']) || isset($totalarray['totalbudgetfield']
if ($num < $limit && empty($offset)) print '<td align="left">'.$langs->trans("Total").'</td>'; if ($num < $limit && empty($offset)) print '<td align="left">'.$langs->trans("Total").'</td>';
else print '<td align="left">'.$langs->trans("Totalforthispage").'</td>'; else print '<td align="left">'.$langs->trans("Totalforthispage").'</td>';
} }
elseif ($totalarray['totaloppfield'] == $i) print '<td align="right">'.price($totalarray['totalopp']).'</td>'; elseif ($totalarray['totaloppfield'] == $i) print '<td align="right">'.price($totalarray['totalopp'], 1, $langs, 1, -1, -1).'</td>';
elseif ($totalarray['totalbudgetfield'] == $i) print '<td align="right">'.price($totalarray['totalbudget']).'</td>'; elseif ($totalarray['totalbudgetfield'] == $i) print '<td align="right">'.price($totalarray['totalbudget'], 1, $langs, 1, -1, -1).'</td>';
else print '<td></td>'; else print '<td></td>';
} }
print '</tr>'; print '</tr>';

View File

@ -85,7 +85,7 @@ if (!$user->rights->projet->lire) accessforbidden();
$diroutputmassaction=$conf->projet->dir_output . '/tasks/temp/massgeneration/'.$user->id; $diroutputmassaction=$conf->projet->dir_output . '/tasks/temp/massgeneration/'.$user->id;
$limit = GETPOST("limit")?GETPOST("limit","int"):$conf->liste_limit; $limit = GETPOST('limit','int')?GETPOST('limit','int'):$conf->liste_limit;
$sortfield = GETPOST("sortfield",'alpha'); $sortfield = GETPOST("sortfield",'alpha');
$sortorder = GETPOST("sortorder",'alpha'); $sortorder = GETPOST("sortorder",'alpha');
$page = GETPOST("page",'int'); $page = GETPOST("page",'int');

View File

@ -58,7 +58,7 @@ $socid=0;
//if ($user->societe_id > 0) $socid = $user->societe_id; // For external user, no check is done on company because readability is managed by public status of project and assignement. //if ($user->societe_id > 0) $socid = $user->societe_id; // For external user, no check is done on company because readability is managed by public status of project and assignement.
if (!$user->rights->projet->lire) accessforbidden(); if (!$user->rights->projet->lire) accessforbidden();
$limit = GETPOST("limit")?GETPOST("limit","int"):$conf->liste_limit; $limit = GETPOST('limit','int')?GETPOST('limit','int'):$conf->liste_limit;
$sortfield = GETPOST("sortfield",'alpha'); $sortfield = GETPOST("sortfield",'alpha');
$sortorder = GETPOST("sortorder",'alpha'); $sortorder = GETPOST("sortorder",'alpha');
$page = GETPOST("page",'int'); $page = GETPOST("page",'int');

View File

@ -91,7 +91,7 @@ if (empty($sortorder)) $sortorder="ASC";
if (empty($sortfield)) $sortfield="t.rowid"; if (empty($sortfield)) $sortfield="t.rowid";
if (empty($arch)) $arch = 0; if (empty($arch)) $arch = 0;
$limit = GETPOST("limit")?GETPOST("limit","int"):$conf->liste_limit; $limit = GETPOST('limit','int')?GETPOST('limit','int'):$conf->liste_limit;
$page = GETPOST("page"); $page = GETPOST("page");
$page = is_numeric($page) ? $page : 0; $page = is_numeric($page) ? $page : 0;
$page = $page == -1 ? 0 : $page; $page = $page == -1 ? 0 : $page;
@ -257,18 +257,14 @@ if ($ret)
{ {
foreach ($object->lines as $resource) foreach ($object->lines as $resource)
{ {
print '<tr class="oddeven">';
$style='';
if ($resource->id == GETPOST('lineid')) $style='style="background: orange;"';
print '<tr '.$bc[$var].' '.$style.'>';
if (! empty($arrayfields['t.ref']['checked'])) if (! empty($arrayfields['t.ref']['checked']))
{ {
print '<td>'; print '<td>';
print $resource->getNomUrl(5); print $resource->getNomUrl(5);
print '</td>'; print '</td>';
if (! $i) $totalarray['nbfield']++;
} }
if (! empty($arrayfields['ty.label']['checked'])) if (! empty($arrayfields['ty.label']['checked']))
@ -276,6 +272,7 @@ if ($ret)
print '<td>'; print '<td>';
print $resource->type_label; print $resource->type_label;
print '</td>'; print '</td>';
if (! $i) $totalarray['nbfield']++;
} }
// Extra fields // Extra fields
if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label)) if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label))
@ -291,10 +288,10 @@ if ($ret)
$tmpkey='options_'.$key; $tmpkey='options_'.$key;
print $extrafields->showOutputField($key, $resource->array_options[$tmpkey], '', 1); print $extrafields->showOutputField($key, $resource->array_options[$tmpkey], '', 1);
print '</td>'; print '</td>';
}
}
if (! $i) $totalarray['nbfield']++; if (! $i) $totalarray['nbfield']++;
} }
}
}
print '<td align="center">'; print '<td align="center">';
print '<a href="./card.php?action=edit&id='.$resource->id.'">'; print '<a href="./card.php?action=edit&id='.$resource->id.'">';
@ -305,18 +302,18 @@ if ($ret)
print img_delete(); print img_delete();
print '</a>'; print '</a>';
print '</td>'; print '</td>';
if (! $i) $totalarray['nbfield']++;
print '</tr>'; print '</tr>';
} }
print '</table>';
print "</form>\n";
} }
else else
{ {
print '<tr><td class="opacitymedium">'.$langs->trans('NoResourceInDatabase').'</td></tr>'; print '<tr><td class="opacitymedium">'.$langs->trans('NoResourceInDatabase').'</td></tr>';
} }
llxFooter(); print '</table>';
print "</form>\n";
llxFooter();
$db->close(); $db->close();

View File

@ -50,7 +50,7 @@ $socid = GETPOST('socid','int');
if ($user->societe_id) $socid=$user->societe_id; if ($user->societe_id) $socid=$user->societe_id;
$result = restrictedArea($user, 'societe', $socid, '&societe'); $result = restrictedArea($user, 'societe', $socid, '&societe');
$limit = GETPOST("limit")?GETPOST("limit","int"):$conf->liste_limit; $limit = GETPOST('limit','int')?GETPOST('limit','int'):$conf->liste_limit;
$sortfield = GETPOST("sortfield",'alpha'); $sortfield = GETPOST("sortfield",'alpha');
$sortorder = GETPOST("sortorder",'alpha'); $sortorder = GETPOST("sortorder",'alpha');
$page = GETPOST("page",'int'); $page = GETPOST("page",'int');

View File

@ -582,6 +582,7 @@ if (empty($reshook))
if (! empty($backtopage)) if (! empty($backtopage))
{ {
if (preg_match('/\?/', $backtopage)) $backtopage.='&socid='.$object->id;
header("Location: ".$backtopage); header("Location: ".$backtopage);
exit; exit;
} }
@ -1065,7 +1066,7 @@ else
print '<td class="maxwidthonsmartphone">'; print '<td class="maxwidthonsmartphone">';
$selected=isset($_POST['client'])?GETPOST('client'):$object->client; $selected=isset($_POST['client'])?GETPOST('client'):$object->client;
print '<select class="flat" name="client" id="customerprospect">'; print '<select class="flat" name="client" id="customerprospect">';
if (GETPOST("type") == '') print '<option value="-1"></option>'; if (GETPOST("type") == '') print '<option value="-1">&nbsp;</option>';
if (empty($conf->global->SOCIETE_DISABLE_PROSPECTS)) print '<option value="2"'.($selected==2?' selected':'').'>'.$langs->trans('Prospect').'</option>'; if (empty($conf->global->SOCIETE_DISABLE_PROSPECTS)) print '<option value="2"'.($selected==2?' selected':'').'>'.$langs->trans('Prospect').'</option>';
if (empty($conf->global->SOCIETE_DISABLE_PROSPECTS) && empty($conf->global->SOCIETE_DISABLE_CUSTOMERS) && empty($conf->global->SOCIETE_DISABLE_PROSPECTSCUSTOMERS)) print '<option value="3"'.($selected==3?' selected':'').'>'.$langs->trans('ProspectCustomer').'</option>'; if (empty($conf->global->SOCIETE_DISABLE_PROSPECTS) && empty($conf->global->SOCIETE_DISABLE_CUSTOMERS) && empty($conf->global->SOCIETE_DISABLE_PROSPECTSCUSTOMERS)) print '<option value="3"'.($selected==3?' selected':'').'>'.$langs->trans('ProspectCustomer').'</option>';
if (empty($conf->global->SOCIETE_DISABLE_CUSTOMERS)) print '<option value="1"'.($selected==1?' selected':'').'>'.$langs->trans('Customer').'</option>'; if (empty($conf->global->SOCIETE_DISABLE_CUSTOMERS)) print '<option value="1"'.($selected==1?' selected':'').'>'.$langs->trans('Customer').'</option>';

View File

@ -84,7 +84,7 @@ $mode=GETPOST("mode");
$diroutputmassaction=$conf->societe->dir_output . '/temp/massgeneration/'.$user->id; $diroutputmassaction=$conf->societe->dir_output . '/temp/massgeneration/'.$user->id;
$limit = GETPOST("limit")?GETPOST("limit","int"):$conf->liste_limit; $limit = GETPOST('limit','int')?GETPOST('limit','int'):$conf->liste_limit;
$sortfield=GETPOST("sortfield",'alpha'); $sortfield=GETPOST("sortfield",'alpha');
$sortorder=GETPOST("sortorder",'alpha'); $sortorder=GETPOST("sortorder",'alpha');
$page=GETPOST("page",'int'); $page=GETPOST("page",'int');
@ -930,6 +930,7 @@ print "</tr>\n";
$i = 0; $i = 0;
$totalarray=array();
while ($i < min($num, $limit)) while ($i < min($num, $limit))
{ {
$obj = $db->fetch_object($resql); $obj = $db->fetch_object($resql);
@ -955,46 +956,55 @@ while ($i < min($num, $limit))
print '<td class="tdoverflowmax200">'; print '<td class="tdoverflowmax200">';
print $companystatic->getNomUrl(1,'',100); print $companystatic->getNomUrl(1,'',100);
print "</td>\n"; print "</td>\n";
if (! $i) $totalarray['nbfield']++;
} }
// Barcode // Barcode
if (! empty($arrayfields['s.barcode']['checked'])) if (! empty($arrayfields['s.barcode']['checked']))
{ {
print '<td>'.$obj->barcode.'</td>'; print '<td>'.$obj->barcode.'</td>';
if (! $i) $totalarray['nbfield']++;
} }
// Customer code // Customer code
if (! empty($arrayfields['s.code_client']['checked'])) if (! empty($arrayfields['s.code_client']['checked']))
{ {
print '<td>'.$obj->code_client.'</td>'; print '<td>'.$obj->code_client.'</td>';
if (! $i) $totalarray['nbfield']++;
} }
// Supplier code // Supplier code
if (! empty($arrayfields['s.code_fournisseur']['checked'])) if (! empty($arrayfields['s.code_fournisseur']['checked']))
{ {
print '<td>'.$obj->code_fournisseur.'</td>'; print '<td>'.$obj->code_fournisseur.'</td>';
if (! $i) $totalarray['nbfield']++;
} }
// Account customer code // Account customer code
if (! empty($arrayfields['s.code_compta']['checked'])) if (! empty($arrayfields['s.code_compta']['checked']))
{ {
print '<td>'.$obj->code_compta.'</td>'; print '<td>'.$obj->code_compta.'</td>';
if (! $i) $totalarray['nbfield']++;
} }
// Account supplier code // Account supplier code
if (! empty($arrayfields['s.code_compta_fournisseur']['checked'])) if (! empty($arrayfields['s.code_compta_fournisseur']['checked']))
{ {
print '<td>'.$obj->code_compta_fournisseur.'</td>'; print '<td>'.$obj->code_compta_fournisseur.'</td>';
if (! $i) $totalarray['nbfield']++;
} }
// Town // Town
if (! empty($arrayfields['s.town']['checked'])) if (! empty($arrayfields['s.town']['checked']))
{ {
print "<td>".$obj->town."</td>\n"; print "<td>".$obj->town."</td>\n";
if (! $i) $totalarray['nbfield']++;
} }
// Zip // Zip
if (! empty($arrayfields['s.zip']['checked'])) if (! empty($arrayfields['s.zip']['checked']))
{ {
print "<td>".$obj->zip."</td>\n"; print "<td>".$obj->zip."</td>\n";
if (! $i) $totalarray['nbfield']++;
} }
// State // State
if (! empty($arrayfields['state.nom']['checked'])) if (! empty($arrayfields['state.nom']['checked']))
{ {
print "<td>".$obj->state_name."</td>\n"; print "<td>".$obj->state_name."</td>\n";
if (! $i) $totalarray['nbfield']++;
} }
// Country // Country
if (! empty($arrayfields['country.code_iso']['checked'])) if (! empty($arrayfields['country.code_iso']['checked']))
@ -1003,6 +1013,7 @@ while ($i < min($num, $limit))
$tmparray=getCountry($obj->fk_pays,'all'); $tmparray=getCountry($obj->fk_pays,'all');
print $tmparray['label']; print $tmparray['label'];
print '</td>'; print '</td>';
if (! $i) $totalarray['nbfield']++;
} }
// Type ent // Type ent
if (! empty($arrayfields['typent.code']['checked'])) if (! empty($arrayfields['typent.code']['checked']))
@ -1011,42 +1022,52 @@ while ($i < min($num, $limit))
if (count($typenArray)==0) $typenArray = $formcompany->typent_array(1); if (count($typenArray)==0) $typenArray = $formcompany->typent_array(1);
print $typenArray[$obj->typent_code]; print $typenArray[$obj->typent_code];
print '</td>'; print '</td>';
if (! $i) $totalarray['nbfield']++;
} }
if (! empty($arrayfields['s.email']['checked'])) if (! empty($arrayfields['s.email']['checked']))
{ {
print "<td>".$obj->email."</td>\n"; print "<td>".$obj->email."</td>\n";
if (! $i) $totalarray['nbfield']++;
} }
if (! empty($arrayfields['s.phone']['checked'])) if (! empty($arrayfields['s.phone']['checked']))
{ {
print "<td>".$obj->phone."</td>\n"; print "<td>".$obj->phone."</td>\n";
if (! $i) $totalarray['nbfield']++;
} }
if (! empty($arrayfields['s.url']['checked'])) if (! empty($arrayfields['s.url']['checked']))
{ {
print "<td>".$obj->url."</td>\n"; print "<td>".$obj->url."</td>\n";
if (! $i) $totalarray['nbfield']++;
} }
if (! empty($arrayfields['s.siren']['checked'])) if (! empty($arrayfields['s.siren']['checked']))
{ {
print "<td>".$obj->idprof1."</td>\n"; print "<td>".$obj->idprof1."</td>\n";
if (! $i) $totalarray['nbfield']++;
} }
if (! empty($arrayfields['s.siret']['checked'])) if (! empty($arrayfields['s.siret']['checked']))
{ {
print "<td>".$obj->idprof2."</td>\n"; print "<td>".$obj->idprof2."</td>\n";
if (! $i) $totalarray['nbfield']++;
} }
if (! empty($arrayfields['s.ape']['checked'])) if (! empty($arrayfields['s.ape']['checked']))
{ {
print "<td>".$obj->idprof3."</td>\n"; print "<td>".$obj->idprof3."</td>\n";
if (! $i) $totalarray['nbfield']++;
} }
if (! empty($arrayfields['s.idprof4']['checked'])) if (! empty($arrayfields['s.idprof4']['checked']))
{ {
print "<td>".$obj->idprof4."</td>\n"; print "<td>".$obj->idprof4."</td>\n";
if (! $i) $totalarray['nbfield']++;
} }
if (! empty($arrayfields['s.idprof5']['checked'])) if (! empty($arrayfields['s.idprof5']['checked']))
{ {
print "<td>".$obj->idprof5."</td>\n"; print "<td>".$obj->idprof5."</td>\n";
if (! $i) $totalarray['nbfield']++;
} }
if (! empty($arrayfields['s.idprof6']['checked'])) if (! empty($arrayfields['s.idprof6']['checked']))
{ {
print "<td>".$obj->idprof6."</td>\n"; print "<td>".$obj->idprof6."</td>\n";
if (! $i) $totalarray['nbfield']++;
} }
// Type // Type
if (! empty($arrayfields['customerorsupplier']['checked'])) if (! empty($arrayfields['customerorsupplier']['checked']))
@ -1075,6 +1096,7 @@ while ($i < min($num, $limit))
} }
print $s; print $s;
print '</td>'; print '</td>';
if (! $i) $totalarray['nbfield']++;
} }
if (! empty($arrayfields['s.fk_prospectlevel']['checked'])) if (! empty($arrayfields['s.fk_prospectlevel']['checked']))
@ -1083,6 +1105,7 @@ while ($i < min($num, $limit))
print '<td align="center">'; print '<td align="center">';
print $companystatic->getLibProspLevel(); print $companystatic->getLibProspLevel();
print "</td>"; print "</td>";
if (! $i) $totalarray['nbfield']++;
} }
if (! empty($arrayfields['s.fk_stcomm']['checked'])) if (! empty($arrayfields['s.fk_stcomm']['checked']))
@ -1098,6 +1121,7 @@ while ($i < min($num, $limit))
if ($obj->stcomm_id != $val['id']) print '<a class="pictosubstatus" href="'.$_SERVER["PHP_SELF"].'?stcommsocid='.$obj->rowid.'&stcomm='.$val['code'].'&action=setstcomm'.$param.($page?'&page='.urlencode($page):'').'">'.img_action($titlealt,$val['code']).'</a>'; if ($obj->stcomm_id != $val['id']) print '<a class="pictosubstatus" href="'.$_SERVER["PHP_SELF"].'?stcommsocid='.$obj->rowid.'&stcomm='.$val['code'].'&action=setstcomm'.$param.($page?'&page='.urlencode($page):'').'">'.img_action($titlealt,$val['code']).'</a>';
} }
print '</div></div></td>'; print '</div></div></td>';
if (! $i) $totalarray['nbfield']++;
} }
// Extra fields // Extra fields
if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label)) if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label))
@ -1113,6 +1137,7 @@ while ($i < min($num, $limit))
$tmpkey='options_'.$key; $tmpkey='options_'.$key;
print $extrafields->showOutputField($key, $obj->$tmpkey, '', 1); print $extrafields->showOutputField($key, $obj->$tmpkey, '', 1);
print '</td>'; print '</td>';
if (! $i) $totalarray['nbfield']++;
} }
} }
} }
@ -1126,6 +1151,7 @@ while ($i < min($num, $limit))
print '<td align="center" class="nowrap">'; print '<td align="center" class="nowrap">';
print dol_print_date($db->jdate($obj->date_creation), 'dayhour'); print dol_print_date($db->jdate($obj->date_creation), 'dayhour');
print '</td>'; print '</td>';
if (! $i) $totalarray['nbfield']++;
} }
// Date modification // Date modification
if (! empty($arrayfields['s.tms']['checked'])) if (! empty($arrayfields['s.tms']['checked']))
@ -1133,11 +1159,13 @@ while ($i < min($num, $limit))
print '<td align="center" class="nowrap">'; print '<td align="center" class="nowrap">';
print dol_print_date($db->jdate($obj->date_update), 'dayhour'); print dol_print_date($db->jdate($obj->date_update), 'dayhour');
print '</td>'; print '</td>';
if (! $i) $totalarray['nbfield']++;
} }
// Status // Status
if (! empty($arrayfields['s.status']['checked'])) if (! empty($arrayfields['s.status']['checked']))
{ {
print '<td align="center" class="nowrap">'.$companystatic->getLibStatut(3).'</td>'; print '<td align="center" class="nowrap">'.$companystatic->getLibStatut(3).'</td>';
if (! $i) $totalarray['nbfield']++;
} }
// Action column // Action column

View File

@ -44,7 +44,7 @@ $actionid=GETPOST('actionid');
if ($user->societe_id) $socid=$user->societe_id; if ($user->societe_id) $socid=$user->societe_id;
$result = restrictedArea($user, 'societe','',''); $result = restrictedArea($user, 'societe','','');
$limit = GETPOST("limit")?GETPOST("limit","int"):$conf->liste_limit; $limit = GETPOST('limit','int')?GETPOST('limit','int'):$conf->liste_limit;
$sortfield=GETPOST("sortfield",'alpha'); $sortfield=GETPOST("sortfield",'alpha');
$sortorder=GETPOST("sortorder",'alpha'); $sortorder=GETPOST("sortorder",'alpha');
$page=GETPOST("page",'int'); $page=GETPOST("page",'int');

View File

@ -4179,7 +4179,7 @@ dl.dropdown {
position:absolute; position:absolute;
top:2px; top:2px;
list-style:none; list-style:none;
max-height: 300px; max-height: 280px;
overflow: auto; overflow: auto;
} }
.dropdown span.value { .dropdown span.value {

View File

@ -4266,7 +4266,7 @@ dl.dropdown {
position:absolute; position:absolute;
top:2px; top:2px;
list-style:none; list-style:none;
max-height: 300px; max-height: 280px;
overflow: auto; overflow: auto;
} }
.dropdown span.value { .dropdown span.value {

View File

@ -45,7 +45,7 @@ $search_group=GETPOST('search_group');
$optioncss = GETPOST('optioncss','alpha'); $optioncss = GETPOST('optioncss','alpha');
// Load variable for pagination // Load variable for pagination
$limit = GETPOST("limit")?GETPOST("limit","int"):$conf->liste_limit; $limit = GETPOST('limit','int')?GETPOST('limit','int'):$conf->liste_limit;
$sortfield = GETPOST('sortfield','alpha'); $sortfield = GETPOST('sortfield','alpha');
$sortorder = GETPOST('sortorder','alpha'); $sortorder = GETPOST('sortorder','alpha');
$page = GETPOST('page','int'); $page = GETPOST('page','int');

View File

@ -46,7 +46,7 @@ if ($user->societe_id > 0)
$mode = GETPOST("mode", 'alpha'); $mode = GETPOST("mode", 'alpha');
// Load variable for pagination // Load variable for pagination
$limit = GETPOST("limit")?GETPOST("limit","int"):$conf->liste_limit; $limit = GETPOST('limit','int')?GETPOST('limit','int'):$conf->liste_limit;
$sortfield = GETPOST('sortfield','alpha'); $sortfield = GETPOST('sortfield','alpha');
$sortorder = GETPOST('sortorder','alpha'); $sortorder = GETPOST('sortorder','alpha');
$page = GETPOST('page','int'); $page = GETPOST('page','int');
@ -465,6 +465,7 @@ print "</tr>\n";
$i = 0; $i = 0;
$totalarray=array();
while ($i < min($num,$limit)) while ($i < min($num,$limit))
{ {
$obj = $db->fetch_object($result); $obj = $db->fetch_object($result);
@ -497,32 +498,39 @@ while ($i < min($num,$limit))
print img_picto($langs->trans("Administrator"), 'star', 'class="valignmiddle paddingleft"'); print img_picto($langs->trans("Administrator"), 'star', 'class="valignmiddle paddingleft"');
} }
print '</td>'; print '</td>';
if (! $i) $totalarray['nbfield']++;
} }
if (! empty($arrayfields['u.lastname']['checked'])) if (! empty($arrayfields['u.lastname']['checked']))
{ {
print '<td>'.$obj->lastname.'</td>'; print '<td>'.$obj->lastname.'</td>';
if (! $i) $totalarray['nbfield']++;
} }
if (! empty($arrayfields['u.firstname']['checked'])) if (! empty($arrayfields['u.firstname']['checked']))
{ {
print '<td>'.$obj->firstname.'</td>'; print '<td>'.$obj->firstname.'</td>';
if (! $i) $totalarray['nbfield']++;
} }
if (! empty($arrayfields['u.gender']['checked'])) if (! empty($arrayfields['u.gender']['checked']))
{ {
print '<td>'; print '<td>';
if ($obj->gender) print $langs->trans("Gender".$obj->gender); if ($obj->gender) print $langs->trans("Gender".$obj->gender);
print '</td>'; print '</td>';
if (! $i) $totalarray['nbfield']++;
} }
if (! empty($arrayfields['u.employee']['checked'])) if (! empty($arrayfields['u.employee']['checked']))
{ {
print '<td>'.yn($obj->employee).'</td>'; print '<td>'.yn($obj->employee).'</td>';
if (! $i) $totalarray['nbfield']++;
} }
if (! empty($arrayfields['u.accountancy_code']['checked'])) if (! empty($arrayfields['u.accountancy_code']['checked']))
{ {
print '<td>'.$obj->accountancy_code.'</td>'; print '<td>'.$obj->accountancy_code.'</td>';
if (! $i) $totalarray['nbfield']++;
} }
if (! empty($arrayfields['u.email']['checked'])) if (! empty($arrayfields['u.email']['checked']))
{ {
print '<td>'.$obj->email.'</td>'; print '<td>'.$obj->email.'</td>';
if (! $i) $totalarray['nbfield']++;
} }
if (! empty($arrayfields['u.fk_soc']['checked'])) if (! empty($arrayfields['u.fk_soc']['checked']))
{ {
@ -543,6 +551,7 @@ while ($i < min($num,$limit))
print $langs->trans("InternalUser"); print $langs->trans("InternalUser");
} }
print '</td>'; print '</td>';
if (! $i) $totalarray['nbfield']++;
} }
// Multicompany enabled // Multicompany enabled
if (! empty($conf->multicompany->enabled) && is_object($mc) && empty($conf->global->MULTICOMPANY_TRANSVERSE_MODE)) if (! empty($conf->multicompany->enabled) && is_object($mc) && empty($conf->global->MULTICOMPANY_TRANSVERSE_MODE))
@ -560,6 +569,7 @@ while ($i < min($num,$limit))
print $mc->label; print $mc->label;
} }
print '</td>'; print '</td>';
if (! $i) $totalarray['nbfield']++;
} }
} }
// Supervisor // Supervisor
@ -589,17 +599,20 @@ while ($i < min($num,$limit))
} }
} }
print '</td>'; print '</td>';
if (! $i) $totalarray['nbfield']++;
} }
// Date last login // Date last login
if (! empty($arrayfields['u.datelastlogin']['checked'])) if (! empty($arrayfields['u.datelastlogin']['checked']))
{ {
print '<td class="nowrap" align="center">'.dol_print_date($db->jdate($obj->datelastlogin),"dayhour").'</td>'; print '<td class="nowrap" align="center">'.dol_print_date($db->jdate($obj->datelastlogin),"dayhour").'</td>';
if (! $i) $totalarray['nbfield']++;
} }
// Date previous login // Date previous login
if (! empty($arrayfields['u.datepreviouslogin']['checked'])) if (! empty($arrayfields['u.datepreviouslogin']['checked']))
{ {
print '<td class="nowrap" align="center">'.dol_print_date($db->jdate($obj->datepreviouslogin),"dayhour").'</td>'; print '<td class="nowrap" align="center">'.dol_print_date($db->jdate($obj->datepreviouslogin),"dayhour").'</td>';
if (! $i) $totalarray['nbfield']++;
} }
// Extra fields // Extra fields
@ -616,6 +629,7 @@ while ($i < min($num,$limit))
$tmpkey='options_'.$key; $tmpkey='options_'.$key;
print $extrafields->showOutputField($key, $obj->$tmpkey, '', 1); print $extrafields->showOutputField($key, $obj->$tmpkey, '', 1);
print '</td>'; print '</td>';
if (! $i) $totalarray['nbfield']++;
} }
} }
} }
@ -629,6 +643,7 @@ while ($i < min($num,$limit))
print '<td align="center">'; print '<td align="center">';
print dol_print_date($db->jdate($obj->date_creation), 'dayhour'); print dol_print_date($db->jdate($obj->date_creation), 'dayhour');
print '</td>'; print '</td>';
if (! $i) $totalarray['nbfield']++;
} }
// Date modification // Date modification
if (! empty($arrayfields['u.tms']['checked'])) if (! empty($arrayfields['u.tms']['checked']))
@ -636,15 +651,18 @@ while ($i < min($num,$limit))
print '<td align="center">'; print '<td align="center">';
print dol_print_date($db->jdate($obj->date_update), 'dayhour'); print dol_print_date($db->jdate($obj->date_update), 'dayhour');
print '</td>'; print '</td>';
if (! $i) $totalarray['nbfield']++;
} }
// Status // Status
if (! empty($arrayfields['u.statut']['checked'])) if (! empty($arrayfields['u.statut']['checked']))
{ {
$userstatic->statut=$obj->statut; $userstatic->statut=$obj->statut;
print '<td align="center">'.$userstatic->getLibStatut(3).'</td>'; print '<td align="center">'.$userstatic->getLibStatut(3).'</td>';
if (! $i) $totalarray['nbfield']++;
} }
// Action column // Action column
print '<td></td>'; print '<td></td>';
if (! $i) $totalarray['nbfield']++;
print "</tr>\n"; print "</tr>\n";
$i++; $i++;

View File

@ -44,7 +44,7 @@ $actionid=GETPOST('actionid');
if ($user->societe_id) $id=$user->societe_id; if ($user->societe_id) $id=$user->societe_id;
$result = restrictedArea($user, 'societe','',''); $result = restrictedArea($user, 'societe','','');
$limit = GETPOST("limit")?GETPOST("limit","int"):$conf->liste_limit; $limit = GETPOST('limit','int')?GETPOST('limit','int'):$conf->liste_limit;
$sortfield=GETPOST("sortfield",'alpha'); $sortfield=GETPOST("sortfield",'alpha');
$sortorder=GETPOST("sortorder",'alpha'); $sortorder=GETPOST("sortorder",'alpha');
$page=GETPOST("page",'int'); $page=GETPOST("page",'int');