Merge branch '5.0' of git@github.com:Dolibarr/dolibarr.git into 5.0

This commit is contained in:
Laurent Destailleur 2017-01-27 01:21:34 +01:00
commit f2f8d7b6a5
20 changed files with 194 additions and 177 deletions

View File

@ -219,7 +219,7 @@ if ($id > 0 && ! preg_match('/^add/i',$action))
$linkback = '<a href="'.DOL_URL_ROOT.'/bookmarks/list.php">'.$langs->trans("BackToList").'</a>'; $linkback = '<a href="'.DOL_URL_ROOT.'/bookmarks/list.php">'.$langs->trans("BackToList").'</a>';
dol_banner_tab($object, 'id', $linkback, 1, 'rowid', 'ref', '', '', 0, '', '', 0); dol_banner_tab($object, 'id', $linkback, 1, 'rowid', 'ref', '', '', 0, '', '', 0);
print '<div class="underbanner clearboth"></div>'; print '<div class="underbanner clearboth"></div>';
print '<table class="border" width="100%">'; print '<table class="border" width="100%">';

View File

@ -983,7 +983,7 @@ if ($action == 'create')
$projectid = GETPOST('projectid')?GETPOST('projectid'):$object->fk_project; $projectid = GETPOST('projectid')?GETPOST('projectid'):$object->fk_project;
$langs->load('projects'); $langs->load('projects');
print '<tr><td>' . $langs->trans('Project') . '</td><td>'; print '<tr><td>' . $langs->trans('Project') . '</td><td>';
$numprojet = $formproject->select_projects($socid, $projectid, 'projectid', 0, 0, 1, 0, 0, 0, 0, '', 0, $forceaddid=0, $morecss=''); $numprojet = $formproject->select_projects($object->thirdparty->id, $projectid, 'projectid', 0, 0, 1, 0, 0, 0, 0, '', 0, 0, '');
print ' &nbsp; <a href="'.DOL_URL_ROOT.'/projet/card.php?socid=' . $object->thirdparty->id . '&action=create&status=1&backtopage='.urlencode($_SERVER["PHP_SELF"].'?action=create&socid='.$object->thirdparty->id.(!empty($id)?'&id='.$id:'')).'">' . $langs->trans("AddProject") . '</a>'; print ' &nbsp; <a href="'.DOL_URL_ROOT.'/projet/card.php?socid=' . $object->thirdparty->id . '&action=create&status=1&backtopage='.urlencode($_SERVER["PHP_SELF"].'?action=create&socid='.$object->thirdparty->id.(!empty($id)?'&id='.$id:'')).'">' . $langs->trans("AddProject") . '</a>';
print '</td></tr>'; print '</td></tr>';
} }

View File

@ -77,7 +77,7 @@ $userid=GETPOST('userid','int');
$begin=GETPOST('begin'); $begin=GETPOST('begin');
if (! $sortorder) $sortorder="ASC"; if (! $sortorder) $sortorder="ASC";
if (! $sortfield) $sortfield="p.lastname"; if (! $sortfield) $sortfield="p.lastname";
if ($page < 0) { $page = 0; } if (empty($page) || $page < 0) { $page = 0; }
$offset = $limit * $page; $offset = $limit * $page;
$langs->load("companies"); $langs->load("companies");

View File

@ -8,7 +8,7 @@
* Copyright (C) 2013 Christophe Battarel <christophe.battarel@altairis.fr> * Copyright (C) 2013 Christophe Battarel <christophe.battarel@altairis.fr>
* Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro> * Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
* Copyright (C) 2014-2015 Marcos García <marcosgdf@gmail.com> * Copyright (C) 2014-2015 Marcos García <marcosgdf@gmail.com>
* Copyright (C) 2015-2016 Ferran Marcet <fmarcet@2byte.es> * Copyright (C) 2015-2017 Ferran Marcet <fmarcet@2byte.es>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
@ -2253,11 +2253,11 @@ class Contrat extends CommonObject
$this->context['createfromclone'] = 'createfromclone'; $this->context['createfromclone'] = 'createfromclone';
$error = 0; $error = 0;
$now = dol_now();
$this->fetch($this->id); $this->fetch($this->id);
// Load dest object // Load dest object
$clonedObj = clone $this; $clonedObj = clone $this;
$clonedObj->socid = $socid;
$this->db->begin(); $this->db->begin();
@ -2292,16 +2292,13 @@ class Contrat extends CommonObject
$this->error = $clonedObj->error; $this->error = $clonedObj->error;
$this->errors[] = $clonedObj->error; $this->errors[] = $clonedObj->error;
} else { } else {
// copy internal contacts // copy external contacts if same company
if ($clonedObj->copy_linked_contact($this, 'internal') < 0) if ($this->socid == $clonedObj->socid) {
$error ++; if ($clonedObj->copy_linked_contact($this, 'external') < 0) {
$error++;
// copy external contacts if same company }
elseif ($this->socid == $clonedObj->socid) { }
if ($clonedObj->copy_linked_contact($this, 'external') < 0) }
$error ++;
}
}
if (! $error) { if (! $error) {
foreach ( $this->lines as $line ) { foreach ( $this->lines as $line ) {

View File

@ -272,7 +272,7 @@ $sql.= " state.code_departement, state.nom";
// Add where from extra fields // Add where from extra fields
foreach ($extrafields->attribute_label as $key => $val) foreach ($extrafields->attribute_label as $key => $val)
{ {
$sql .= ', ef.'.$val; $sql .= ', ef.'.$key;
} }
// Add where from hooks // Add where from hooks
$parameters=array(); $parameters=array();

View File

@ -6,6 +6,7 @@
* Copyright (C) 2012 Christophe Battarel <christophe.battarel@altairis.fr> * Copyright (C) 2012 Christophe Battarel <christophe.battarel@altairis.fr>
* Copyright (C) 2012 Cedric Salvador <csalvador@gpcsolutions.fr> * Copyright (C) 2012 Cedric Salvador <csalvador@gpcsolutions.fr>
* Copyright (C) 2015 Marcos García <marcosgdf@gmail.com> * Copyright (C) 2015 Marcos García <marcosgdf@gmail.com>
* Copyright (C) 2017 Ferran Marcet <fmarcet@2byte.es>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
@ -1261,10 +1262,12 @@ class pdf_einstein extends ModelePDFCommandes
$arrayidcontact=$object->getIdContact('internal','SALESREPFOLL'); $arrayidcontact=$object->getIdContact('internal','SALESREPFOLL');
if (count($arrayidcontact) > 0) if (count($arrayidcontact) > 0)
{ {
$usertmp=new User($this->db); $usertmp=new User($this->db);
$usertmp->fetch($arrayidcontact[0]); $usertmp->fetch($arrayidcontact[0]);
$posy+=4;
$pdf->SetXY($posx,$posy);
$pdf->SetTextColor(0,0,60); $pdf->SetTextColor(0,0,60);
$pdf->MultiCell(190, 3, $langs->trans("SalesRepresentative")." : ".$usertmp->getFullName($langs), '', 'R'); $pdf->MultiCell(100, 3, $langs->trans("SalesRepresentative")." : ".$usertmp->getFullName($langs), '', 'R');
} }
} }

View File

@ -7,6 +7,7 @@
* Copyright (C) 2012 Cédric Salvador <csalvador@gpcsolutions.fr> * Copyright (C) 2012 Cédric Salvador <csalvador@gpcsolutions.fr>
* Copyright (C) 2012-2014 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr> * Copyright (C) 2012-2014 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
* Copyright (C) 2015 Marcos García <marcosgdf@gmail.com> * Copyright (C) 2015 Marcos García <marcosgdf@gmail.com>
* Copyright (C) 2017 Ferran Marcet <fmarcet@2byte.es>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
@ -1620,8 +1621,10 @@ class pdf_crabe extends ModelePDFFactures
{ {
$usertmp=new User($this->db); $usertmp=new User($this->db);
$usertmp->fetch($arrayidcontact[0]); $usertmp->fetch($arrayidcontact[0]);
$posy+=4;
$pdf->SetXY($posx,$posy);
$pdf->SetTextColor(0,0,60); $pdf->SetTextColor(0,0,60);
$pdf->MultiCell(190, 3, $langs->trans("SalesRepresentative")." : ".$usertmp->getFullName($langs), '', 'R'); $pdf->MultiCell($w, 3, $langs->trans("SalesRepresentative")." : ".$usertmp->getFullName($langs), '', 'R');
} }
} }

View File

@ -6,6 +6,7 @@
* Copyright (C) 2012 Christophe Battarel <christophe.battarel@altairis.fr> * Copyright (C) 2012 Christophe Battarel <christophe.battarel@altairis.fr>
* Copyright (C) 2012 Cedric Salvador <csalvador@gpcsolutions.fr> * Copyright (C) 2012 Cedric Salvador <csalvador@gpcsolutions.fr>
* Copyright (C) 2015 Marcos García <marcosgdf@gmail.com> * Copyright (C) 2015 Marcos García <marcosgdf@gmail.com>
* Copyright (C) 2017 Ferran Marcet <fmarcet@2byte.es>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
@ -1473,8 +1474,10 @@ class pdf_azur extends ModelePDFPropales
{ {
$usertmp=new User($this->db); $usertmp=new User($this->db);
$usertmp->fetch($arrayidcontact[0]); $usertmp->fetch($arrayidcontact[0]);
$posy+=4;
$pdf->SetXY($posx,$posy);
$pdf->SetTextColor(0,0,60); $pdf->SetTextColor(0,0,60);
$pdf->MultiCell(190, 3, $langs->trans("SalesRepresentative")." : ".$usertmp->getFullName($langs), '', 'R'); $pdf->MultiCell(100, 3, $langs->trans("SalesRepresentative")." : ".$usertmp->getFullName($langs), '', 'R');
} }
} }

View File

@ -4,6 +4,7 @@
* Copyright (C) 2007 Franky Van Liedekerke <franky.van.liedekerke@telenet.be> * Copyright (C) 2007 Franky Van Liedekerke <franky.van.liedekerke@telenet.be>
* Copyright (C) 2010-2014 Juanjo Menent <jmenent@2byte.es> * Copyright (C) 2010-2014 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2015 Marcos García <marcosgdf@gmail.com> * Copyright (C) 2015 Marcos García <marcosgdf@gmail.com>
* Copyright (C) 2017 Ferran Marcet <fmarcet@2byte.es>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
@ -1111,8 +1112,10 @@ class pdf_muscadet extends ModelePDFSuppliersOrders
{ {
$usertmp=new User($this->db); $usertmp=new User($this->db);
$usertmp->fetch($arrayidcontact[0]); $usertmp->fetch($arrayidcontact[0]);
$posy+=4;
$pdf->SetXY($posx,$posy);
$pdf->SetTextColor(0,0,60); $pdf->SetTextColor(0,0,60);
$pdf->MultiCell(190, 3, $langs->trans("BuyerName")." : ".$usertmp->getFullName($langs), '', 'R'); $pdf->MultiCell(100, 3, $langs->trans("BuyerName")." : ".$usertmp->getFullName($langs), '', 'R');
} }
} }

View File

@ -4,6 +4,7 @@
* Copyright (C) 2008 Raphael Bertrand <raphael.bertrand@resultic.fr> * Copyright (C) 2008 Raphael Bertrand <raphael.bertrand@resultic.fr>
* Copyright (C) 2010-2014 Juanjo Menent <jmenent@2byte.es> * Copyright (C) 2010-2014 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2012 Christophe Battarel <christophe.battarel@altairis.fr> * Copyright (C) 2012 Christophe Battarel <christophe.battarel@altairis.fr>
* Copyright (C) 2017 Ferran Marcet <fmarcet@2byte.es>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
@ -1288,8 +1289,10 @@ class pdf_aurore extends ModelePDFSupplierProposal
{ {
$usertmp=new User($this->db); $usertmp=new User($this->db);
$usertmp->fetch($arrayidcontact[0]); $usertmp->fetch($arrayidcontact[0]);
$posy+=4;
$pdf->SetXY($posx,$posy);
$pdf->SetTextColor(0,0,60); $pdf->SetTextColor(0,0,60);
$pdf->MultiCell(190, 3, $langs->trans("BuyerName")." : ".$usertmp->getFullName($langs), '', 'R'); $pdf->MultiCell(100, 3, $langs->trans("BuyerName")." : ".$usertmp->getFullName($langs), '', 'R');
} }
} }

View File

@ -3,6 +3,7 @@
* Copyright (C) 2004-2017 Laurent Destailleur <eldy@users.sourceforge.net> * Copyright (C) 2004-2017 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2009 Regis Houssin <regis@dolibarr.fr> * Copyright (C) 2005-2009 Regis Houssin <regis@dolibarr.fr>
* Copyright (C) 2015-2016 Alexandre Spangaro <aspangaro.dolibarr@gmail.com> * Copyright (C) 2015-2016 Alexandre Spangaro <aspangaro.dolibarr@gmail.com>
* Copyright (C) 2017 Ferran Marcet <fmarcet@2byte.es>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
@ -1228,8 +1229,8 @@ if ($action == 'create')
print '<td>'; print '<td>';
$defaultselectuser=$user->id; $defaultselectuser=$user->id;
if (GETPOST('fk_user_author') > 0) $defaultselectuser=GETPOST('fk_user_author'); if (GETPOST('fk_user_author') > 0) $defaultselectuser=GETPOST('fk_user_author');
$include_users = 'hierarchyme'; $include_users = 'hierarchyme';
if (! empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->expensereport->writeall_advance)) $include_users=array(); if (! empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->expensereport->writeall_advance)) $include_users=array();
$s=$form->select_dolusers($defaultselectuser, "fk_user_author", 0, "", 0, $include_users); $s=$form->select_dolusers($defaultselectuser, "fk_user_author", 0, "", 0, $include_users);
print $s; print $s;
print '</td>'; print '</td>';

View File

@ -6,6 +6,7 @@
* Copyright (C) 2010 Juanjo Menent <jmenent@2byte.es> * Copyright (C) 2010 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2014 Cedric Gross <c.gross@kreiz-it.fr> * Copyright (C) 2014 Cedric Gross <c.gross@kreiz-it.fr>
* Copyright (C) 2016 Florian Henry <florian.henry@atm-consulting.fr> * Copyright (C) 2016 Florian Henry <florian.henry@atm-consulting.fr>
* Copyright (C) 2017 Ferran Marcet <fmarcet@2byte.es>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
@ -368,7 +369,7 @@ if ($id > 0 || ! empty($ref)) {
print "</td></tr>"; print "</td></tr>";
if ($object->methode_commande) { if ($object->methode_commande) {
print '<tr><td>' . $langs->trans("Method") . '</td><td>' . $commande->getInputMethod() . '</td></tr>'; print '<tr><td>' . $langs->trans("Method") . '</td><td>' . $object->getInputMethod() . '</td></tr>';
} }
} }

View File

@ -460,7 +460,7 @@ class Dolresource extends CommonObject
$extrafields=new ExtraFields($this->db); $extrafields=new ExtraFields($this->db);
$extralabels=$extrafields->fetch_name_optionals_label($this->table_element,true); $extralabels=$extrafields->fetch_name_optionals_label($this->table_element,true);
if (is_array($extralabels) && count($extralabels)>0) { if (is_array($extralabels) && count($extralabels)>0) {
foreach($extralabels as $label=>$code) { foreach($extralabels as $code=>$label) {
$sql.= " ef.".$code." as extra_".$code.","; $sql.= " ef.".$code." as extra_".$code.",";
} }
} }

View File

@ -119,12 +119,15 @@ $arrayfields = array(
// Extra fields // Extra fields
if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label)) { if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label)) {
foreach ( $extrafields->attribute_label as $key => $val ) { foreach ( $extrafields->attribute_label as $key => $val ) {
$arrayfields["ef." . $key] = array( $typeofextrafield=$extrafields->attribute_type[$key];
'label' => $extrafields->attribute_label[$key], if ($typeofextrafield!='separate') {
'checked' => $extrafields->attribute_list[$key], $arrayfields["ef." . $key] = array(
'position' => $extrafields->attribute_pos[$key], 'label' => $extrafields->attribute_label[$key],
'enabled' => $extrafields->attribute_perms[$key] 'checked' => $extrafields->attribute_list[$key],
); 'position' => $extrafields->attribute_pos[$key],
'enabled' => $extrafields->attribute_perms[$key]
);
}
} }
} }

View File

@ -88,7 +88,7 @@ $sortorder=GETPOST("sortorder",'alpha');
$page=GETPOST("page",'int'); $page=GETPOST("page",'int');
if (! $sortorder) $sortorder="ASC"; if (! $sortorder) $sortorder="ASC";
if (! $sortfield) $sortfield="s.nom"; if (! $sortfield) $sortfield="s.nom";
if ($page == -1) { $page = 0 ; } if (empty($page) || $page == -1) { $page = 0 ; }
$offset = $limit * $page; $offset = $limit * $page;
$pageprev = $page - 1; $pageprev = $page - 1;
$pagenext = $page + 1; $pagenext = $page + 1;

View File

@ -1,7 +1,7 @@
<?php <?php
/* Copyright (C) 2004-2015 Laurent Destailleur <eldy@users.sourceforge.net> /* Copyright (C) 2004-2015 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2006 Rodolphe Quiedeville <rodolphe@quiedeville.org> * Copyright (C) 2006 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2007-2012 Regis Houssin <regis.houssin@capnetworks.com> * Copyright (C) 2007-2017 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2011 Philippe Grand <philippe.grand@atoo-net.com> * Copyright (C) 2011 Philippe Grand <philippe.grand@atoo-net.com>
* Copyright (C) 2012 Juanjo Menent <jmenent@2byte.es> * Copyright (C) 2012 Juanjo Menent <jmenent@2byte.es>
* *
@ -158,25 +158,25 @@ if (! empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED))
// Set text color to black or white // Set text color to black or white
$tmppart=explode(',',$colorbackhmenu1); $tmppart=explode(',',$colorbackhmenu1);
$tmpval=(! empty($tmppart[1]) ? $tmppart[1] : '')+(! empty($tmppart[2]) ? $tmppart[2] : '')+(! empty($tmppart[3]) ? $tmppart[3] : ''); $tmpval=(! empty($tmppart[0]) ? $tmppart[0] : '')+(! empty($tmppart[1]) ? $tmppart[1] : '')+(! empty($tmppart[2]) ? $tmppart[2] : '');
if ($tmpval <= 360) $colortextbackhmenu='FFFFFF'; if ($tmpval <= 360) $colortextbackhmenu='FFFFFF';
else $colortextbackhmenu='000000'; else $colortextbackhmenu='000000';
$tmppart=explode(',',$colorbackvmenu1); $tmppart=explode(',',$colorbackvmenu1);
$tmpval=(! empty($tmppart[1]) ? $tmppart[1] : '')+(! empty($tmppart[2]) ? $tmppart[2] : '')+(! empty($tmppart[3]) ? $tmppart[3] : ''); $tmpval=(! empty($tmppart[0]) ? $tmppart[0] : '')+(! empty($tmppart[1]) ? $tmppart[1] : '')+(! empty($tmppart[2]) ? $tmppart[2] : '');
if ($tmpval <= 360) { $colortextbackvmenu='FFFFFF'; } if ($tmpval <= 360) { $colortextbackvmenu='FFFFFF'; }
else { $colortextbackvmenu='000000'; } else { $colortextbackvmenu='000000'; }
$tmppart=explode(',',$colorbacktitle1); $tmppart=explode(',',$colorbacktitle1);
if ($colortexttitle == '') if ($colortexttitle == '')
{ {
$tmpval=(! empty($tmppart[1]) ? $tmppart[1] : '')+(! empty($tmppart[2]) ? $tmppart[2] : '')+(! empty($tmppart[3]) ? $tmppart[3] : ''); $tmpval=(! empty($tmppart[0]) ? $tmppart[0] : '')+(! empty($tmppart[1]) ? $tmppart[1] : '')+(! empty($tmppart[2]) ? $tmppart[2] : '');
if ($tmpval <= 360) { $colortexttitle='FFFFFF'; $colorshadowtitle='888888'; } if ($tmpval <= 360) { $colortexttitle='FFFFFF'; $colorshadowtitle='888888'; }
else { $colortexttitle='000000'; $colorshadowtitle='FFFFFF'; } else { $colortexttitle='000000'; $colorshadowtitle='FFFFFF'; }
} }
$tmppart=explode(',',$colorbacktabcard1); $tmppart=explode(',',$colorbacktabcard1);
$tmpval=(! empty($tmppart[1]) ? $tmppart[1] : '')+(! empty($tmppart[2]) ? $tmppart[2] : '')+(! empty($tmppart[3]) ? $tmppart[3] : ''); $tmpval=(! empty($tmppart[0]) ? $tmppart[0] : '')+(! empty($tmppart[1]) ? $tmppart[1] : '')+(! empty($tmppart[2]) ? $tmppart[2] : '');
if ($tmpval <= 340) { $colortextbacktab='FFFFFF'; } if ($tmpval <= 340) { $colortextbacktab='FFFFFF'; }
else { $colortextbacktab='111111'; } else { $colortextbacktab='111111'; }

View File

@ -1,7 +1,7 @@
<?php <?php
/* Copyright (C) 2004-2015 Laurent Destailleur <eldy@users.sourceforge.net> /* Copyright (C) 2004-2015 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2006 Rodolphe Quiedeville <rodolphe@quiedeville.org> * Copyright (C) 2006 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2007-2012 Regis Houssin <regis.houssin@capnetworks.com> * Copyright (C) 2007-2017 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2011 Philippe Grand <philippe.grand@atoo-net.com> * Copyright (C) 2011 Philippe Grand <philippe.grand@atoo-net.com>
* Copyright (C) 2012 Juanjo Menent <jmenent@2byte.es> * Copyright (C) 2012 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2015 Alexandre Spangaro <aspangaro.dolibarr@gmail.com> * Copyright (C) 2015 Alexandre Spangaro <aspangaro.dolibarr@gmail.com>
@ -159,25 +159,25 @@ if (empty($colortopbordertitle1)) $colortopbordertitle1=$colorbackhmenu1;
// Set text color to black or white // Set text color to black or white
$tmppart=explode(',',$colorbackhmenu1); $tmppart=explode(',',$colorbackhmenu1);
$tmpval=(! empty($tmppart[1]) ? $tmppart[1] : '')+(! empty($tmppart[2]) ? $tmppart[2] : '')+(! empty($tmppart[3]) ? $tmppart[3] : ''); $tmpval=(! empty($tmppart[0]) ? $tmppart[0] : '')+(! empty($tmppart[1]) ? $tmppart[1] : '')+(! empty($tmppart[2]) ? $tmppart[2] : '');
if ($tmpval <= 360) $colortextbackhmenu='FFFFFF'; if ($tmpval <= 360) $colortextbackhmenu='FFFFFF';
else $colortextbackhmenu='000000'; else $colortextbackhmenu='000000';
$tmppart=explode(',',$colorbackvmenu1); $tmppart=explode(',',$colorbackvmenu1);
$tmpval=(! empty($tmppart[1]) ? $tmppart[1] : '')+(! empty($tmppart[2]) ? $tmppart[2] : '')+(! empty($tmppart[3]) ? $tmppart[3] : ''); $tmpval=(! empty($tmppart[0]) ? $tmppart[0] : '')+(! empty($tmppart[1]) ? $tmppart[1] : '')+(! empty($tmppart[2]) ? $tmppart[2] : '');
if ($tmpval <= 360) { $colortextbackvmenu='FFFFFF'; } if ($tmpval <= 360) { $colortextbackvmenu='FFFFFF'; }
else { $colortextbackvmenu='000000'; } else { $colortextbackvmenu='000000'; }
$tmppart=explode(',',$colorbacktitle1); $tmppart=explode(',',$colorbacktitle1);
if ($colortexttitle == '') if ($colortexttitle == '')
{ {
$tmpval=(! empty($tmppart[1]) ? $tmppart[1] : '')+(! empty($tmppart[2]) ? $tmppart[2] : '')+(! empty($tmppart[3]) ? $tmppart[3] : ''); $tmpval=(! empty($tmppart[0]) ? $tmppart[0] : '')+(! empty($tmppart[1]) ? $tmppart[1] : '')+(! empty($tmppart[2]) ? $tmppart[2] : '');
if ($tmpval <= 260) { $colortexttitle='FFFFFF'; $colorshadowtitle='888888'; } if ($tmpval <= 260) { $colortexttitle='FFFFFF'; $colorshadowtitle='888888'; }
else { $colortexttitle='101010'; $colorshadowtitle='FFFFFF'; } else { $colortexttitle='101010'; $colorshadowtitle='FFFFFF'; }
} }
$tmppart=explode(',',$colorbacktabcard1); $tmppart=explode(',',$colorbacktabcard1);
$tmpval=(! empty($tmppart[1]) ? $tmppart[1] : '')+(! empty($tmppart[2]) ? $tmppart[2] : '')+(! empty($tmppart[3]) ? $tmppart[3] : ''); $tmpval=(! empty($tmppart[0]) ? $tmppart[0] : '')+(! empty($tmppart[1]) ? $tmppart[1] : '')+(! empty($tmppart[2]) ? $tmppart[2] : '');
if ($tmpval <= 340) { $colortextbacktab='FFFFFF'; } if ($tmpval <= 340) { $colortextbacktab='FFFFFF'; }
else { $colortextbacktab='111111'; } else { $colortextbacktab='111111'; }

View File

@ -76,7 +76,7 @@ if ($user->id <> $id && ! $canreaduser) accessforbidden();
$sortfield = GETPOST("sortfield",'alpha'); $sortfield = GETPOST("sortfield",'alpha');
$sortorder = GETPOST("sortorder",'alpha'); $sortorder = GETPOST("sortorder",'alpha');
$page = GETPOST("page",'int'); $page = GETPOST("page",'int');
if ($page == -1) { $page = 0; } if (empty($page) || $page == -1) { $page = 0; }
$offset = $conf->liste_limit * $page; $offset = $conf->liste_limit * $page;
$pageprev = $page - 1; $pageprev = $page - 1;
$pagenext = $page + 1; $pagenext = $page + 1;

View File

@ -1,7 +1,7 @@
<?php <?php
/* Copyright (C) 2002-2003 Rodolphe Quiedeville <rodolphe@quiedeville.org> /* Copyright (C) 2002-2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2011 Laurent Destailleur <eldy@users.sourceforge.net> * Copyright (C) 2004-2011 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2015 Regis Houssin <regis.houssin@capnetworks.com> * Copyright (C) 2005-2017 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2011 Herve Prot <herve.prot@symeos.com> * Copyright (C) 2011 Herve Prot <herve.prot@symeos.com>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
@ -43,7 +43,7 @@ $limit = GETPOST("limit")?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');
if ($page == -1) { $page = 0; } if (empty($page) || $page == -1) { $page = 0; }
$offset = $limit * $page; $offset = $limit * $page;
$pageprev = $page - 1; $pageprev = $page - 1;
$pagenext = $page + 1; $pagenext = $page + 1;

View File

@ -1,7 +1,7 @@
<?php <?php
/* Copyright (C) 2002-2005 Rodolphe Quiedeville <rodolphe@quiedeville.org> /* Copyright (C) 2002-2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2016 Laurent Destailleur <eldy@users.sourceforge.net> * Copyright (C) 2004-2016 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com> * Copyright (C) 2005-2017 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2015 Alexandre Spangaro <aspangaro.dolibarr@gmail.com> * Copyright (C) 2015 Alexandre Spangaro <aspangaro.dolibarr@gmail.com>
* Copyright (C) 2016 Marcos García <marcosgdf@gmail.com> * Copyright (C) 2016 Marcos García <marcosgdf@gmail.com>
* *
@ -50,7 +50,7 @@ $limit = GETPOST("limit")?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');
if ($page == -1) { $page = 0; } if (empty($page) || $page == -1) { $page = 0; }
$offset = $limit * $page; $offset = $limit * $page;
$pageprev = $page - 1; $pageprev = $page - 1;
$pagenext = $page + 1; $pagenext = $page + 1;