Fix navigation in accounting account card
This commit is contained in:
parent
6d9a9dd3fe
commit
15ed7584b8
@ -39,6 +39,7 @@ $mesg = '';
|
|||||||
$action = GETPOST('action','aZ09');
|
$action = GETPOST('action','aZ09');
|
||||||
$backtopage = GETPOST('backtopage','alpha');
|
$backtopage = GETPOST('backtopage','alpha');
|
||||||
$id = GETPOST('id', 'int');
|
$id = GETPOST('id', 'int');
|
||||||
|
$ref = GETPOST('ref', 'alpha');
|
||||||
$rowid = GETPOST('rowid', 'int');
|
$rowid = GETPOST('rowid', 'int');
|
||||||
$cancel = GETPOST('cancel','alpha');
|
$cancel = GETPOST('cancel','alpha');
|
||||||
|
|
||||||
@ -261,8 +262,10 @@ if ($action == 'create') {
|
|||||||
print '</div>';
|
print '</div>';
|
||||||
|
|
||||||
print '</form>';
|
print '</form>';
|
||||||
} else if ($id) {
|
}
|
||||||
$result = $object->fetch($id);
|
else if ($id > 0 || $ref) {
|
||||||
|
|
||||||
|
$result = $object->fetch($id, $ref, 1);
|
||||||
|
|
||||||
if ($result > 0) {
|
if ($result > 0) {
|
||||||
dol_htmloutput_mesg($mesg);
|
dol_htmloutput_mesg($mesg);
|
||||||
@ -329,17 +332,18 @@ if ($action == 'create') {
|
|||||||
// View mode
|
// View mode
|
||||||
$linkback = '<a href="'.DOL_URL_ROOT.'/accountancy/admin/account.php">' . $langs->trans("BackToList") . '</a>';
|
$linkback = '<a href="'.DOL_URL_ROOT.'/accountancy/admin/account.php">' . $langs->trans("BackToList") . '</a>';
|
||||||
|
|
||||||
dol_fiche_head($head, 'card', $langs->trans('AccountAccounting'), 0, 'billr');
|
dol_fiche_head($head, 'card', $langs->trans('AccountAccounting'), -1, 'billr');
|
||||||
|
|
||||||
|
dol_banner_tab($object, 'ref', $linkback, 1, 'account_number', 'ref');
|
||||||
|
|
||||||
|
|
||||||
|
print '<div class="fichecenter">';
|
||||||
|
print '<div class="underbanner clearboth"></div>';
|
||||||
|
|
||||||
print '<table class="border" width="100%">';
|
print '<table class="border" width="100%">';
|
||||||
|
|
||||||
// Account number
|
|
||||||
print '<tr><td class="titlefield">' . $langs->trans("AccountNumber") . '</td>';
|
|
||||||
print '<td>' . $object->account_number . '</td>';
|
|
||||||
print '<td align="right" width="25%">' . $linkback . '</td></tr>';
|
|
||||||
|
|
||||||
// Label
|
// Label
|
||||||
print '<tr><td>' . $langs->trans("Label") . '</td>';
|
print '<tr><td class="titlefield">' . $langs->trans("Label") . '</td>';
|
||||||
print '<td colspan="2">' . $object->label . '</td></tr>';
|
print '<td colspan="2">' . $object->label . '</td></tr>';
|
||||||
|
|
||||||
// Account parent
|
// Account parent
|
||||||
@ -361,20 +365,10 @@ if ($action == 'create') {
|
|||||||
print '<tr><td>' . $langs->trans("Pcgsubtype") . '</td>';
|
print '<tr><td>' . $langs->trans("Pcgsubtype") . '</td>';
|
||||||
print '<td colspan="2">' . $object->pcg_subtype . '</td></tr>';
|
print '<td colspan="2">' . $object->pcg_subtype . '</td></tr>';
|
||||||
|
|
||||||
// Active
|
|
||||||
print '<tr><td>' . $langs->trans("Status") . '</td>';
|
|
||||||
print '<td colspan="2">';
|
|
||||||
print $object->getLibStatut(4);
|
|
||||||
/*if (empty($object->active)) {
|
|
||||||
print img_picto($langs->trans("Disabled"), 'switch_off');
|
|
||||||
} else {
|
|
||||||
print img_picto($langs->trans("Activated"), 'switch_on');
|
|
||||||
}*/
|
|
||||||
|
|
||||||
print '</td></tr>';
|
|
||||||
|
|
||||||
print '</table>';
|
print '</table>';
|
||||||
|
|
||||||
|
print '</div>';
|
||||||
|
|
||||||
dol_fiche_end();
|
dol_fiche_end();
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -397,7 +391,7 @@ if ($action == 'create') {
|
|||||||
print '</div>';
|
print '</div>';
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
dol_print_error($db);
|
dol_print_error($db, $object->error, $object->errors);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -30,6 +30,21 @@
|
|||||||
*/
|
*/
|
||||||
class AccountingAccount extends CommonObject
|
class AccountingAccount extends CommonObject
|
||||||
{
|
{
|
||||||
|
public $element='accounting_account';
|
||||||
|
public $table_element='accounting_account';
|
||||||
|
public $picto = 'billr';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 0=No test on entity, 1=Test with field entity, 2=Test with link by societe
|
||||||
|
* @var int
|
||||||
|
*/
|
||||||
|
public $ismultientitymanaged = 1;
|
||||||
|
/**
|
||||||
|
* 0=Default, 1=View may be restricted to sales representative only if no permission to see all or to company of external user if external user
|
||||||
|
* @var integer
|
||||||
|
*/
|
||||||
|
public $restrictiononfksoc = 1;
|
||||||
|
|
||||||
var $db;
|
var $db;
|
||||||
var $error;
|
var $error;
|
||||||
var $errors;
|
var $errors;
|
||||||
@ -48,13 +63,17 @@ class AccountingAccount extends CommonObject
|
|||||||
var $active; // duplicate with status
|
var $active; // duplicate with status
|
||||||
var $status;
|
var $status;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor
|
* Constructor
|
||||||
*
|
*
|
||||||
* @param DoliDB $db Database handle
|
* @param DoliDB $db Database handle
|
||||||
*/
|
*/
|
||||||
function __construct($db) {
|
function __construct($db) {
|
||||||
|
global $conf;
|
||||||
|
|
||||||
$this->db = $db;
|
$this->db = $db;
|
||||||
|
$this->next_prev_filter='fk_pcg_version IN (SELECT pcg_version FROM ' . MAIN_DB_PREFIX . 'accounting_system WHERE rowid=' . $conf->global->CHARTOFACCOUNTS . ')'; // Used to add a filter in Form::showrefnav method
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -91,6 +110,7 @@ class AccountingAccount extends CommonObject
|
|||||||
if ($obj) {
|
if ($obj) {
|
||||||
$this->id = $obj->rowid;
|
$this->id = $obj->rowid;
|
||||||
$this->rowid = $obj->rowid;
|
$this->rowid = $obj->rowid;
|
||||||
|
$this->ref = $obj->account_number;
|
||||||
$this->datec = $obj->datec;
|
$this->datec = $obj->datec;
|
||||||
$this->tms = $obj->tms;
|
$this->tms = $obj->tms;
|
||||||
$this->fk_pcg_version = $obj->fk_pcg_version;
|
$this->fk_pcg_version = $obj->fk_pcg_version;
|
||||||
|
|||||||
@ -6234,7 +6234,6 @@ class Form
|
|||||||
$reshook=$hookmanager->executeHooks('printFieldListWhere',$parameters, $object); // Note that $action and $object may have been modified by hook
|
$reshook=$hookmanager->executeHooks('printFieldListWhere',$parameters, $object); // Note that $action and $object may have been modified by hook
|
||||||
$object->next_prev_filter.=$hookmanager->resPrint;
|
$object->next_prev_filter.=$hookmanager->resPrint;
|
||||||
}
|
}
|
||||||
|
|
||||||
$previous_ref = $next_ref = '';
|
$previous_ref = $next_ref = '';
|
||||||
if ($shownav)
|
if ($shownav)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -25,6 +25,10 @@
|
|||||||
-- -- VMYSQL4.1 DELETE FROM llx_usergroup_user WHERE fk_usergroup NOT IN (SELECT rowid from llx_usergroup);
|
-- -- VMYSQL4.1 DELETE FROM llx_usergroup_user WHERE fk_usergroup NOT IN (SELECT rowid from llx_usergroup);
|
||||||
|
|
||||||
|
|
||||||
|
-- VMYSQLUTF8UNICODECI ALTER TABLE llx_accounting_account MODIFY fk_pcg_version VARCHAR(20) CHARACTER SET utf8;
|
||||||
|
-- VMYSQLUTF8UNICODECI ALTER TABLE llx_accounting_account MODIFY fk_pcg_version VARCHAR(20) COLLATE utf8_unicode_ci;
|
||||||
|
-- VMYSQLUTF8UNICODECI ALTER TABLE llx_accounting_system MODIFY pcg_version VARCHAR(20) CHARACTER SET utf8;
|
||||||
|
-- VMYSQLUTF8UNICODECI ALTER TABLE llx_accounting_system MODIFY pcg_version VARCHAR(20) COLLATE utf8_unicode_ci;
|
||||||
-- VMYSQLUTF8UNICODECI ALTER TABLE llx_accounting_account MODIFY account_number VARCHAR(20) CHARACTER SET utf8;
|
-- VMYSQLUTF8UNICODECI ALTER TABLE llx_accounting_account MODIFY account_number VARCHAR(20) CHARACTER SET utf8;
|
||||||
-- VMYSQLUTF8UNICODECI ALTER TABLE llx_accounting_account MODIFY account_number VARCHAR(20) COLLATE utf8_unicode_ci;
|
-- VMYSQLUTF8UNICODECI ALTER TABLE llx_accounting_account MODIFY account_number VARCHAR(20) COLLATE utf8_unicode_ci;
|
||||||
-- VMYSQLUTF8UNICODECI ALTER TABLE llx_accounting_bookkeeping MODIFY numero_compte VARCHAR(20) CHARACTER SET utf8;
|
-- VMYSQLUTF8UNICODECI ALTER TABLE llx_accounting_bookkeeping MODIFY numero_compte VARCHAR(20) CHARACTER SET utf8;
|
||||||
|
|||||||
@ -1036,10 +1036,13 @@ if ($ok && GETPOST('force_utf8_on_tables','alpha'))
|
|||||||
print '<tr><td colspan="2">';
|
print '<tr><td colspan="2">';
|
||||||
print $table;
|
print $table;
|
||||||
$sql='ALTER TABLE '.$table.' CONVERT TO CHARACTER SET utf8 COLLATE utf8_unicode_ci';
|
$sql='ALTER TABLE '.$table.' CONVERT TO CHARACTER SET utf8 COLLATE utf8_unicode_ci';
|
||||||
|
print $sql;
|
||||||
if (GETPOST('force_utf8_on_tables','alpha') == 'confirmed')
|
if (GETPOST('force_utf8_on_tables','alpha') == 'confirmed')
|
||||||
{
|
{
|
||||||
$db->query($sql);
|
$resql = $db->query($sql);
|
||||||
|
print ' - Done ('.$resql.')';
|
||||||
}
|
}
|
||||||
|
else print ' - Disabled';
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user