Fix: When all boxes are moved on a side, we can still move on the other side

This commit is contained in:
Laurent Destailleur 2010-04-28 15:31:49 +00:00
parent 905f9c7e27
commit 798ac42880
8 changed files with 47 additions and 30 deletions

View File

@ -52,7 +52,7 @@ function printBoxesArea($user,$areacode)
print '<table width="100%" style="border-collapse: collapse; border: 0px; margin: 0px; padding: 0px;"><tr>';
// Affichage colonne gauche
print '<td width="50%" valign="top">'."\n";
print '<td width="50%" valign="top" style="padding-right: 4px;">'."\n";
print "\n<!-- Box left container -->\n";
print '<div id="left">'."\n";
@ -73,21 +73,21 @@ function printBoxesArea($user,$areacode)
}
// If no box on left, we add an invisible empty box
if ($ii==0)
{
// if ($ii==0)
// {
$emptybox=new ModeleBoxes($db);
$emptybox->box_id='A';
$emptybox->info_box_head=array();
$emptybox->info_box_contents=array();
$emptybox->showBox(array(),array());
}
// }
print "</div>\n";
print "<!-- End box container -->\n";
print "</td>\n";
// Affichage colonne droite
print '<td width="50%" valign="top">';
print '<td width="50%" valign="top" style="padding-right: 2px;">';
print "\n<!-- Box right container -->\n";
print '<div id="right">'."\n";
@ -108,14 +108,14 @@ function printBoxesArea($user,$areacode)
}
// If no box on right, we show add an invisible empty box
if ($ii==0)
{
// if ($ii==0)
// {
$emptybox=new ModeleBoxes($db);
$emptybox->box_id='B';
$emptybox->info_box_head=array();
$emptybox->info_box_contents=array();
$emptybox->showBox(array(),array());
}
// }
print "</div>\n";
print "<!-- End box container -->\n";

View File

@ -1542,12 +1542,12 @@ if ($_GET['action'] == 'create')
$element = $regs[1];
$subelement = $regs[2];
}
// For compatibility
if ($element == 'order') { $element = $subelement = 'commande'; }
if ($element == 'propal') { $element = 'comm/propal'; $subelement = 'propal'; }
if ($element == 'contract') { $element = $subelement = 'contrat'; }
require_once(DOL_DOCUMENT_ROOT.'/'.$element.'/class/'.$subelement.'.class.php');
$classname = ucfirst($subelement);
$object = new $classname($db);
@ -2198,7 +2198,7 @@ else
if ($facref == 'PROV')
{
$savdate=$fac->date;
if ($conf->global->FAC_FORCE_DATE_VALIDATION)
if (! empty($conf->global->FAC_FORCE_DATE_VALIDATION))
{
$fac->date=gmmktime();
$fac->date_lim_reglement=$fac->calculate_date_lim_reglement();

View File

@ -1370,7 +1370,7 @@ class Facture extends CommonObject
}
else if (preg_match('/^[\(]?PROV/i', $this->ref))
{
if ($conf->global->FAC_FORCE_DATE_VALIDATION) // If option enabled, we force invoice date
if (! empty($conf->global->FAC_FORCE_DATE_VALIDATION)) // If option enabled, we force invoice date
{
$this->date=gmmktime();
$this->date_lim_reglement=$this->calculate_date_lim_reglement();
@ -1389,7 +1389,7 @@ class Facture extends CommonObject
// Validate
$sql = 'UPDATE '.MAIN_DB_PREFIX.'facture';
$sql.= " SET facnumber='".$num."', fk_statut = 1, fk_user_valid = ".$user->id;
if ($conf->global->FAC_FORCE_DATE_VALIDATION) // If option enabled, we force invoice date
if (! empty($conf->global->FAC_FORCE_DATE_VALIDATION)) // If option enabled, we force invoice date
{
$sql.= ', datef='.$this->db->idate($this->date);
$sql.= ', date_lim_reglement='.$this->db->idate($this->date_lim_reglement);

View File

@ -239,7 +239,7 @@ class ModeleBoxes
}
// If invisible box with no contents
if (empty($head['text']) && empty($head['sublink']) && ! $nblines) print "<br><br>\n";
if (empty($head['text']) && empty($head['sublink']) && ! $nblines) print "<br>\n";
print "</div>\n";
print "<!-- Box end -->\n\n";

View File

@ -90,12 +90,14 @@ class modFacture extends DolibarrModules
$this->const[$r][2] = "terre";
$r++;
$this->const[$r][0] = "FAC_FORCE_DATE_VALIDATION";
$this->const[$r][1] = "yesno";
$this->const[$r][2] = "0";
$this->const[$r][0] = "FACTURE_ADDON_PDF_ODT_PATH";
$this->const[$r][1] = "chaine";
$this->const[$r][2] = "DOL_DATA_ROOT/odttemplates/invoices";
$this->const[$r][3] = "";
$this->const[$r][4] = 0;
$r++;
// Boites
// Boxes
$this->boxes = array();
$r=0;
$this->boxes[$r][1] = "box_factures_imp.php";
@ -211,9 +213,14 @@ class modFacture extends DolibarrModules
{
global $conf;
// Permissions
// Remove permissions and default values
$this->remove();
require_once(DOL_DOCUMENT_ROOT.'/lib/files.lib.php');
$dirodt=DOL_DATA_ROOT.'/odttemplates/invoices';
create_exdir($dirodt);
dol_copy(DOL_DOCUMENT_ROOT.'/install/odttemplates/invoices/template_invoices.odt',$dirodt,0,0);
$sql = array(
"DELETE FROM ".MAIN_DB_PREFIX."document_model WHERE nom = '".$this->const[0][2]."' AND entity = ".$conf->entity,
"INSERT INTO ".MAIN_DB_PREFIX."document_model (nom, type, entity) VALUES('".$this->const[0][2]."','invoice',".$conf->entity.")",

View File

@ -34,7 +34,7 @@
include_once(DOL_DOCUMENT_ROOT ."/includes/modules/DolibarrModules.class.php");
/**
/**
* \class modPropale
* \brief Classe de description et activation du module Propale
*/
@ -173,7 +173,8 @@ class modPropale extends DolibarrModules
function init()
{
global $conf;
// Permissions et valeurs par defaut
// Remove permissions and default values
$this->remove();
$sql = array(

View File

@ -273,11 +273,10 @@ class modSociete extends DolibarrModules
{
global $conf;
require_once(DOL_DOCUMENT_ROOT.'/lib/files.lib.php');
// Prevent pb of modules not correctly disabled
// We disable this to prevent pb of modules not correctly disabled
//$this->remove($options);
require_once(DOL_DOCUMENT_ROOT.'/lib/files.lib.php');
$dirodt=DOL_DATA_ROOT.'/odttemplates/thirdparties';
create_exdir($dirodt);
dol_copy(DOL_DOCUMENT_ROOT.'/install/odttemplates/thirdparties/template_thirdparty.odt',$dirodt,0,0);

View File

@ -161,7 +161,7 @@ td.vmenu {
div.fiche {
margin-<?php print $left; ?>: 4px;
margin-<?php print $right; ?>: 2px;
margin-<?php print $right; ?>: 4px;
}
/* ============================================================================== */
@ -699,7 +699,7 @@ padding-top: 0px;
padding-left: 0px;
padding-right: 0px;
padding-bottom: 4px;
margin: 0px 0px;
margin: 0px 0px 0px 0px;
}
@ -731,10 +731,16 @@ border-right-width: 1px;
border-right-color: #BBBBBB;
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;
margin-left: 1px;
margin-right: 1px;
margin-bottom: 2px;
margin-top: 0px;
}
@ -742,14 +748,17 @@ margin-top: 0px;
table.noborder tr {
border-top-color: #FEFEFE;
border-right-width: 1px;
border-right-color: #BBBBBB;
border-right-style: solid;
border-left-width: 1px;
border-left-color: #FEFEFE;
border-left-color: #BBBBBB;
border-left-style: solid;
}
table.noborder td {
border: 0px;
padding: 1px 2px;
padding: 1px 2px; /* t r b l */
}
table.nobordernopadding {
@ -880,7 +889,8 @@ border: 0px;
*/
.box {
padding-right: 4px;
padding-right: 0px;
padding-left: 0px;
padding-bottom: 4px;
}