Fix: Boxes not visibles if first activation
This commit is contained in:
parent
d1e70fcd67
commit
80a876886e
@ -29,10 +29,9 @@
|
||||
|
||||
|
||||
/**
|
||||
\class InfoBox
|
||||
\brief Classe permettant la gestion des boxes sur une page
|
||||
* \class InfoBox
|
||||
* \brief Classe permettant la gestion des boxes sur une page
|
||||
*/
|
||||
|
||||
class InfoBox
|
||||
{
|
||||
var $db;
|
||||
@ -136,6 +135,11 @@ class InfoBox
|
||||
$box->box_id=$obj->box_id;
|
||||
$box->position=$obj->position;
|
||||
$box->box_order=$obj->box_order;
|
||||
if (is_numeric($box->box_order))
|
||||
{
|
||||
if ($box->box_order % 2 == 1) $box->box_order='A'.$box->box_order;
|
||||
elseif ($box->box_order % 2 == 0) $box->box_order='B'.$box->box_order;
|
||||
}
|
||||
$box->fk_user=$obj->fk_user;
|
||||
$enabled=true;
|
||||
if ($box->depends && sizeof($box->depends) > 0)
|
||||
@ -171,7 +175,7 @@ class InfoBox
|
||||
function saveboxorder($zone,$boxorder,$userid=0)
|
||||
{
|
||||
global $conf;
|
||||
|
||||
|
||||
require_once(DOL_DOCUMENT_ROOT."/lib/functions2.lib.php");
|
||||
|
||||
dol_syslog("InfoBoxes::saveboxorder zone=".$zone." user=".$userid);
|
||||
@ -192,8 +196,8 @@ class InfoBox
|
||||
return -3;
|
||||
}
|
||||
|
||||
$sql = "DELETE ".MAIN_DB_PREFIX."boxes";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."boxes, ".MAIN_DB_PREFIX."boxes_def";
|
||||
$sql = "DELETE FROM ".MAIN_DB_PREFIX."boxes";
|
||||
$sql.= " USING ".MAIN_DB_PREFIX."boxes, ".MAIN_DB_PREFIX."boxes_def";
|
||||
$sql.= " WHERE ".MAIN_DB_PREFIX."boxes.box_id = ".MAIN_DB_PREFIX."boxes_def.rowid";
|
||||
$sql.= " AND ".MAIN_DB_PREFIX."boxes_def.entity = ".$conf->entity;
|
||||
$sql.= " AND ".MAIN_DB_PREFIX."boxes.fk_user = ".$userid;
|
||||
@ -253,8 +257,9 @@ class InfoBox
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->error=$this->db->error();
|
||||
$this->error=$this->db->lasterror();
|
||||
$this->db->rollback();
|
||||
dol_syslog("InfoBox::saveboxorder ".$this->error);
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
@ -21,10 +21,9 @@
|
||||
/**
|
||||
* \file htdocs/includes/boxes/box_comptes.php
|
||||
* \ingroup banque
|
||||
* \brief Module de generation de l'affichage de la box comptes
|
||||
* \brief Module to generate box for bank accounts
|
||||
* \version $Id$
|
||||
*/
|
||||
|
||||
include_once(DOL_DOCUMENT_ROOT."/includes/boxes/modules_boxes.php");
|
||||
include_once(DOL_DOCUMENT_ROOT."/compta/bank/account.class.php");
|
||||
|
||||
@ -121,9 +120,9 @@ class box_comptes extends ModeleBoxes {
|
||||
}
|
||||
|
||||
// Total
|
||||
if (sizeof($listofcurrencies) < 1)
|
||||
if (sizeof($listofcurrencies) <= 1)
|
||||
{
|
||||
$this->info_box_contents[$i][0] = array('tr' => 'class="liste_total"', 'td' => 'align="right" colspan="3" class="liste_total"',
|
||||
$this->info_box_contents[$i][0] = array('tr' => 'class="liste_total"', 'td' => 'align="right" class="liste_total"',
|
||||
'text' => $langs->trans('Total')
|
||||
);
|
||||
$totalamount=price($solde_total).' '.$langs->trans("Currency".$conf->monnaie);
|
||||
|
||||
@ -101,9 +101,9 @@ class ModeleBoxes
|
||||
$MAXLENGTHBOX=60; // Mettre 0 pour pas de limite
|
||||
$bcx[0] = 'class="box_pair"';
|
||||
$bcx[1] = 'class="box_impair"';
|
||||
$var = true;
|
||||
$var = false;
|
||||
|
||||
dol_syslog("modules_box::showBox ".get_Class($this));
|
||||
dol_syslog("ModeleBoxes::showBox ".get_Class($this));
|
||||
|
||||
// Define nbcol and nblines of the box to show
|
||||
$nbcol=0;
|
||||
|
||||
@ -585,7 +585,7 @@ if (sizeof($boxarray))
|
||||
$ii=0;
|
||||
foreach ($boxarray as $key => $box)
|
||||
{
|
||||
if (preg_match('/^A/i',$box->box_order)) // colonne A
|
||||
if (preg_match('/^A/i',$box->box_order)) // column A
|
||||
{
|
||||
$ii++;
|
||||
//print 'box_id '.$boxarray[$ii]->box_id.' ';
|
||||
|
||||
@ -234,9 +234,20 @@ class DoliDb
|
||||
$line.= "CREATE ".(preg_match('/UNIQUE/',$reg[2])?'UNIQUE ':'')."INDEX ".$idxname." ON ".$tablename." (".$fieldlist.")";
|
||||
}
|
||||
|
||||
// Delete using criteria on other table must not declare twice the deleted table
|
||||
// DELETE FROM tabletodelete USING tabletodelete, othertable -> DELETE FROM tabletodelete USING othertable
|
||||
if (preg_match('/DELETE FROM ([a-z_]+) USING ([a-z_]+), ([a-z_]+)/i',$line,$reg))
|
||||
{
|
||||
if ($reg[1] == $reg[2]) // If same table, we remove second one
|
||||
{
|
||||
$line=preg_replace('/DELETE FROM ([a-z_]+) USING ([a-z_]+), ([a-z_]+)/i','DELETE FROM \\1 USING \\3', $line);
|
||||
}
|
||||
}
|
||||
|
||||
// Remove () in the tables in FROM
|
||||
//$line=preg_replace('/FROM\s*\((([a-z_]+)\s+as\s+([a-z_]+)\s*,\s*([a-z_]+)\s+as\s+([a-z_]+)\s*)\)/i','FROM \\1',$line);
|
||||
//print $line;
|
||||
|
||||
} # END of if ($create_sql ne "") i.e. were inside create table statement so processed datatypes
|
||||
else { # not inside create table
|
||||
#---- fix data in inserted data: (from MS world)
|
||||
|
||||
@ -757,16 +757,16 @@ border-left: 1px solid #000000;
|
||||
table.noborder {
|
||||
border-collapse: collapse;
|
||||
border-top-color: #FEFEFE;
|
||||
/*
|
||||
|
||||
border-right-width: 1px;
|
||||
border-right-color: #BBBBBB;
|
||||
border-right-style: solid;
|
||||
*/
|
||||
|
||||
border-bottom-width: 1px;
|
||||
border-bottom-color: #BBBBBB;
|
||||
border-bottom-style: solid;
|
||||
}
|
||||
/*
|
||||
|
||||
table.noborder tr {
|
||||
border-top-color: #FEFEFE;
|
||||
|
||||
@ -777,12 +777,13 @@ border-right-style: solid;
|
||||
border-left-width: 1px;
|
||||
border-left-color: #BBBBBB;
|
||||
border-left-style: solid;
|
||||
|
||||
/*
|
||||
border-bottom-width: 1px;
|
||||
border-bottom-color: #BBBBBB;
|
||||
border-bottom-style: solid;
|
||||
}
|
||||
*/
|
||||
}
|
||||
|
||||
table.noborder td {
|
||||
border: 0px;
|
||||
padding: 1px 2px;
|
||||
@ -864,9 +865,22 @@ border-bottom: 1px solid #FFFFFF;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.impair {
|
||||
/* background: #d0d4d7; */
|
||||
background: #eaeaea;
|
||||
font-family: helvetica, verdana, arial, sans-serif;
|
||||
border: 0px;
|
||||
}
|
||||
/*
|
||||
.impair:hover {
|
||||
background: #c0c4c7;
|
||||
border: 0px;
|
||||
}
|
||||
*/
|
||||
|
||||
.pair {
|
||||
background: #e6ebed;
|
||||
/* background: #e6ebed; */
|
||||
background: #fafafa;
|
||||
font-family: helvetica, verdana, arial, sans-serif;
|
||||
border: 0px;
|
||||
}
|
||||
@ -877,17 +891,6 @@ border: 0px;
|
||||
}
|
||||
*/
|
||||
|
||||
.impair {
|
||||
background: #d0d4d7;
|
||||
font-family: helvetica, verdana, arial, sans-serif;
|
||||
border: 0px;
|
||||
}
|
||||
/*
|
||||
.impair:hover {
|
||||
background: #c0c4c7;
|
||||
border: 0px;
|
||||
}
|
||||
*/
|
||||
|
||||
/*
|
||||
* Boxes
|
||||
@ -910,12 +913,14 @@ white-space: nowrap;
|
||||
}
|
||||
|
||||
tr.box_impair {
|
||||
background: #e6ebed;
|
||||
/* background: #e6ebed; */
|
||||
background: #eaeaea;
|
||||
font-family: arial, helvetica, verdana, sans-serif;
|
||||
}
|
||||
|
||||
tr.box_pair {
|
||||
background: #d0d4d7;
|
||||
/* background: #d0d4d7; */
|
||||
background: #fafafa;
|
||||
font-family: arial, helvetica, verdana, sans-serif;
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user