mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2026-02-07 16:41:48 +01:00
Compare commits
48 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
fd0cd7257c | ||
|
|
b36b56b7a1 | ||
|
|
4a111234a0 | ||
|
|
e2d71b3215 | ||
|
|
0fbd626822 | ||
|
|
a79d440a9b | ||
|
|
78deb405b2 | ||
|
|
5046c20b81 | ||
|
|
8b28893fbe | ||
|
|
c4f3e872ca | ||
|
|
f0cfbb8b0d | ||
|
|
0511ba87f4 | ||
|
|
04d5a41e9c | ||
|
|
62c3f04392 | ||
|
|
feaf5266e9 | ||
|
|
2b75c81af9 | ||
|
|
d3986b4936 | ||
|
|
9c08abb52c | ||
|
|
185c03eea5 | ||
|
|
9614881bed | ||
|
|
dbb62f010d | ||
|
|
8de657a215 | ||
|
|
e20b0b2e7b | ||
|
|
21ad42afab | ||
|
|
99b33a70a3 | ||
|
|
dfda863b7e | ||
|
|
37f866c31f | ||
|
|
7a3f6b9acc | ||
|
|
de7b060e12 | ||
|
|
f25802520a | ||
|
|
a7d6289d4b | ||
|
|
d12700aeab | ||
|
|
77688cf988 | ||
|
|
b66aeabb88 | ||
|
|
49ae52c708 | ||
|
|
9fbd6f0b58 | ||
|
|
433ca88c43 | ||
|
|
aa65ebe136 | ||
|
|
43a8b9176f | ||
|
|
6e12d84f14 | ||
|
|
1eac98dc43 | ||
|
|
6691bef701 | ||
|
|
24cc745ae8 | ||
|
|
7a42514833 | ||
|
|
749f371d4e | ||
|
|
bee6b92a7b | ||
|
|
36ff4abe3c | ||
|
|
6012dff11e |
16
ChangeLog
16
ChangeLog
@@ -3,8 +3,20 @@ English Dolibarr ChangeLog
|
||||
--------------------------------------------------------------
|
||||
|
||||
|
||||
***** ChangeLog for 3.2.2 compared to 3.2.1 *****
|
||||
|
||||
- Fix: Modify spanish VAT to new rates.
|
||||
- Fix: Add error message when creating already existing product.
|
||||
- Fix: Edition of percentage of an event.
|
||||
- Fix: Minor look fix for theme bureau2crea.
|
||||
- Fix: Start and end date not saved at project creation
|
||||
- Fix: Default vat is zero for customer invoices if company does not use vat
|
||||
- Fix: Localtaxes unit prices precision
|
||||
|
||||
|
||||
|
||||
***** ChangeLog for 3.2.1 compared to 3.2.0 *****
|
||||
|
||||
- Fix: Edit of projects.
|
||||
- Fix: Activation of modules does not fails if directory install was removed.
|
||||
- Fix: [ bug #444 ] Regression on auto-closing for proposals and orders.
|
||||
@@ -30,7 +42,10 @@ English Dolibarr ChangeLog
|
||||
- Fix: [ bug #506 ] Can't set percentage of a started event
|
||||
- Fix: Bad assignation of const for pdf delivery module name
|
||||
|
||||
|
||||
|
||||
***** ChangeLog for 3.2.0 compared to 3.1.3 *****
|
||||
|
||||
WARNING: PHP lower than 5.x are no more supported.
|
||||
WARNING: Because of a major datastructure change onto supplier prices tables, be aware
|
||||
to make a backup of your database before making upgrade.
|
||||
@@ -169,6 +184,7 @@ Fix: bug #405 - Late icon always displayed on comm/propal.php
|
||||
|
||||
|
||||
***** ChangeLog for 3.1 compared to 3.0 *****
|
||||
|
||||
WARNING: IE6 browser is no more supported in this version.
|
||||
For users:
|
||||
- New: War against number of clicks:
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
dolibarr (3.2.1+nmu1) unstable; urgency=low
|
||||
dolibarr (3.2.2+nmu1) unstable; urgency=low
|
||||
|
||||
* Non-maintainer upload.
|
||||
* New upstream release.
|
||||
|
||||
@@ -17,9 +17,9 @@
|
||||
; ----- Change this -----
|
||||
AppName=DoliWamp
|
||||
; DoliWamp-x.x.x or DoliWamp-x.x.x-alpha or DoliWamp-x.x.x-beta or DoliWamp-x.x.x-rc or DoliWamp-x.x.x
|
||||
AppVerName=DoliWamp-3.2.1
|
||||
AppVerName=DoliWamp-3.2.2
|
||||
; DoliWamp-x.x x or DoliWamp-x.x.x-alpha or DoliWamp-x.x.x-beta or DoliWamp-x.x.x-rc or DoliWamp-x.x.x
|
||||
OutputBaseFilename=DoliWamp-3.2.1
|
||||
OutputBaseFilename=DoliWamp-3.2.2
|
||||
; Define full path from wich all relative path are defined
|
||||
; You must modify this to put here your dolibarr root directory
|
||||
;SourceDir=C:\Documents and Settings\ldestail\git\dolibarr_old
|
||||
|
||||
@@ -10,7 +10,7 @@ use Cwd;
|
||||
$PROJECT="dolibarr";
|
||||
$MAJOR="3";
|
||||
$MINOR="2";
|
||||
$BUILD="1"; # Mettre x pour release, x-dev pour dev, x-beta pour beta, x-rc pour release candidate
|
||||
$BUILD="2"; # Mettre x pour release, x-dev pour dev, x-beta pour beta, x-rc pour release candidate
|
||||
$RPMSUBVERSION="auto"; # auto use value found into BUILD
|
||||
|
||||
@LISTETARGET=("TGZ","ZIP","RPM_GENERIC","RPM_FEDORA","RPM_MANDRIVA","RPM_OPENSUSE","DEB","APS","EXEDOLIWAMP","SNAPSHOT"); # Possible packages
|
||||
|
||||
@@ -4,8 +4,8 @@
|
||||
<CompanyName />
|
||||
<Program_Info>
|
||||
<Program_Name>DoliWamp</Program_Name>
|
||||
<Program_Version>3.2.1</Program_Version>
|
||||
<Program_Release_Month>05</Program_Release_Month>
|
||||
<Program_Version>3.2.2</Program_Version>
|
||||
<Program_Release_Month>09</Program_Release_Month>
|
||||
<Program_Release_Day>10</Program_Release_Day>
|
||||
<Program_Release_Year>2012</Program_Release_Year>
|
||||
<Program_Cost_Dollars />
|
||||
|
||||
@@ -4,8 +4,8 @@
|
||||
<CompanyName />
|
||||
<Program_Info>
|
||||
<Program_Name>Dolibarr</Program_Name>
|
||||
<Program_Version>3.2.1</Program_Version>
|
||||
<Program_Release_Month>05</Program_Release_Month>
|
||||
<Program_Version>3.2.2</Program_Version>
|
||||
<Program_Release_Month>09</Program_Release_Month>
|
||||
<Program_Release_Day>10</Program_Release_Day>
|
||||
<Program_Release_Year>2012</Program_Release_Year>
|
||||
<Program_Cost_Dollars />
|
||||
|
||||
@@ -34,8 +34,8 @@
|
||||
</Company_Info>
|
||||
<Program_Info>
|
||||
<Program_Name>Dolibarr</Program_Name>
|
||||
<Program_Version>3.2.1</Program_Version>
|
||||
<Program_Release_Month>08</Program_Release_Month>
|
||||
<Program_Version>3.2.2</Program_Version>
|
||||
<Program_Release_Month>09</Program_Release_Month>
|
||||
<Program_Release_Day>10</Program_Release_Day>
|
||||
<Program_Release_Year>2012</Program_Release_Year>
|
||||
<Program_Cost_Dollars />
|
||||
|
||||
@@ -34,8 +34,8 @@
|
||||
</Company_Info>
|
||||
<Program_Info>
|
||||
<Program_Name>DoliWamp</Program_Name>
|
||||
<Program_Version>3.2.1</Program_Version>
|
||||
<Program_Release_Month>08</Program_Release_Month>
|
||||
<Program_Version>3.2.2</Program_Version>
|
||||
<Program_Release_Month>09</Program_Release_Month>
|
||||
<Program_Release_Day>10</Program_Release_Day>
|
||||
<Program_Release_Year>2012</Program_Release_Year>
|
||||
<Program_Cost_Dollars />
|
||||
|
||||
@@ -30,7 +30,7 @@ return "Regis Houssin";
|
||||
# script_dolibarr_versions()
|
||||
sub script_dolibarr_versions
|
||||
{
|
||||
return ( "3.2.0", "3.1.1", "3.0.1", "2.9.0" );
|
||||
return ( "3.2.1", "3.1.1", "3.0.1", "2.9.0" );
|
||||
}
|
||||
|
||||
sub script_dolibarr_category
|
||||
@@ -362,7 +362,9 @@ sub script_dolibarr_check_latest
|
||||
{
|
||||
local ($ver) = @_;
|
||||
local @vers = &osdn_package_versions("dolibarr",
|
||||
$ver >= 3 ? "dolibarr\\-(3\\.[0-9\\.]+)\\.tgz" :
|
||||
$ver >= 3.2 ? "dolibarr\\-(3\\.[0-9\\.]+)\\.tgz" :
|
||||
$ver >= 3.1 ? "dolibarr\\-(3\\.1\\.[0-9\\.]+)\\.tgz" :
|
||||
$ver >= 3 ? "dolibarr\\-(3\\.0\\.[0-9\\.]+)\\.tgz" :
|
||||
$ver >= 2.9 ? "dolibarr\\-(2\\.9\\.[0-9\\.]+)\\.tgz" :
|
||||
"dolibarr\\-(2\\.8\\.[0-9\\.]+)\\.tgz");
|
||||
return "Failed to find versions" if (!@vers);
|
||||
|
||||
@@ -312,5 +312,5 @@ fi
|
||||
|
||||
|
||||
%changelog
|
||||
* Mon Jul 23 2012 Laurent Destailleur 3.2.1-0.3
|
||||
* Mon Jul 23 2012 Laurent Destailleur 3.2.2-0.3
|
||||
- Initial version (#723326)
|
||||
|
||||
@@ -368,5 +368,5 @@ fi
|
||||
|
||||
|
||||
%changelog
|
||||
* Mon Jul 23 2012 Laurent Destailleur 3.2.1-0.3
|
||||
* Mon Jul 23 2012 Laurent Destailleur 3.2.2-0.3
|
||||
- Initial version (#723326)
|
||||
|
||||
@@ -301,5 +301,5 @@ fi
|
||||
|
||||
|
||||
%changelog
|
||||
* Mon Jul 23 2012 Laurent Destailleur 3.2.1-0.3
|
||||
* Mon Jul 23 2012 Laurent Destailleur 3.2.2-0.3
|
||||
- Initial version (#723326)
|
||||
|
||||
@@ -306,5 +306,5 @@ fi
|
||||
|
||||
|
||||
%changelog
|
||||
* Mon Jul 23 2012 Laurent Destailleur 3.2.1-0.3
|
||||
* Mon Jul 23 2012 Laurent Destailleur 3.2.2-0.3
|
||||
- Initial version (#723326)
|
||||
|
||||
@@ -85,13 +85,14 @@ if ($action == 'add_action')
|
||||
}
|
||||
|
||||
$fulldayevent=$_POST["fullday"];
|
||||
$percentage=in_array(GETPOST('status'),array(-1,100))?GETPOST('status'):GETPOST("percentage"); // If status is -1 or 100, percentage is not defined and we must use status
|
||||
|
||||
// Clean parameters
|
||||
$datep=dol_mktime($fulldayevent?'00':$_POST["aphour"], $fulldayevent?'00':$_POST["apmin"], 0, $_POST["apmonth"], $_POST["apday"], $_POST["apyear"]);
|
||||
$datef=dol_mktime($fulldayevent?'23':$_POST["p2hour"], $fulldayevent?'59':$_POST["p2min"], $fulldayevent?'59':'0', $_POST["p2month"], $_POST["p2day"], $_POST["p2year"]);
|
||||
|
||||
// Check parameters
|
||||
if (! $datef && $_POST["percentage"] == 100)
|
||||
if (! $datef && $percentage == 100)
|
||||
{
|
||||
$error++;
|
||||
$action = 'create';
|
||||
@@ -135,7 +136,7 @@ if ($action == 'add_action')
|
||||
$actioncomm->fk_project = isset($_POST["projectid"])?$_POST["projectid"]:0;
|
||||
$actioncomm->datep = $datep;
|
||||
$actioncomm->datef = $datef;
|
||||
$actioncomm->percentage = isset($_POST["percentage"])?$_POST["percentage"]:0;
|
||||
$actioncomm->percentage = $percentage;
|
||||
$actioncomm->duree=(($_POST["dureehour"] * 60) + $_POST["dureemin"]) * 60;
|
||||
|
||||
$usertodo=new User($db);
|
||||
@@ -257,21 +258,20 @@ if ($action == 'confirm_delete' && GETPOST("confirm") == 'yes')
|
||||
}
|
||||
|
||||
/*
|
||||
* Action mise a jour de l'action
|
||||
* Action update event
|
||||
*/
|
||||
if ($action == 'update')
|
||||
{
|
||||
if (! $_POST["cancel"])
|
||||
{
|
||||
$fulldayevent=$_POST["fullday"];
|
||||
$percentage=in_array(GETPOST('status'),array(-1,100))?GETPOST('status'):GETPOST("percentage"); // If status is -1 or 100, percentage is not defined and we must use status
|
||||
|
||||
// Clean parameters
|
||||
if ($_POST["aphour"] == -1) $_POST["aphour"]='0';
|
||||
if ($_POST["apmin"] == -1) $_POST["apmin"]='0';
|
||||
if ($_POST["p2hour"] == -1) $_POST["p2hour"]='0';
|
||||
if ($_POST["p2min"] == -1) $_POST["p2min"]='0';
|
||||
//if ($_POST["adhour"] == -1) $_POST["adhour"]='0';
|
||||
//if ($_POST["admin"] == -1) $_POST["admin"]='0';
|
||||
|
||||
$actioncomm = new Actioncomm($db);
|
||||
$actioncomm->fetch($id);
|
||||
@@ -282,9 +282,7 @@ if ($action == 'update')
|
||||
$actioncomm->label = $_POST["label"];
|
||||
$actioncomm->datep = $datep;
|
||||
$actioncomm->datef = $datef;
|
||||
//$actioncomm->date = $datea;
|
||||
//$actioncomm->dateend = $datea2;
|
||||
$actioncomm->percentage = $_POST["percentage"];
|
||||
$actioncomm->percentage = $percentage;
|
||||
$actioncomm->priority = $_POST["priority"];
|
||||
$actioncomm->fulldayevent= $_POST["fullday"]?1:0;
|
||||
$actioncomm->location = isset($_POST["location"])?$_POST["location"]:'';
|
||||
@@ -294,7 +292,7 @@ if ($action == 'update')
|
||||
$actioncomm->note = $_POST["note"];
|
||||
$actioncomm->pnote = $_POST["note"];
|
||||
|
||||
if (! $datef && $_POST["percentage"] == 100)
|
||||
if (! $datef && $percentage == 100)
|
||||
{
|
||||
$error=$langs->trans("ErrorFieldRequired",$langs->trans("DateEnd"));
|
||||
$action = 'edit';
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?PHP
|
||||
/* Copyright (C) 2001-2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2004-2011 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2004-2012 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2008 Raphael Bertrand (Resultic) <raphael.bertrand@resultic.fr>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
@@ -272,7 +272,7 @@ if ($socid > 0)
|
||||
print '<td><input type="text" size="5" name="amount_ht" value="'.$_POST["amount_ht"].'"> '.$langs->trans("Currency".$conf->currency).'</td></tr>';
|
||||
print '<tr><td width="38%">'.$langs->trans("VAT").'</td>';
|
||||
print '<td>';
|
||||
print $form->load_tva('tva_tx',GETPOST('tva_tx'),'',$mysoc,'');
|
||||
print $form->load_tva('tva_tx',GETPOST('tva_tx'),$mysoc,$objsoc);
|
||||
print '</td></tr>';
|
||||
print '<tr><td>'.$langs->trans("NoteReason").'</td>';
|
||||
print '<td><input type="text" size="60" name="desc" value="'.$_POST["desc"].'"></td></tr>';
|
||||
|
||||
@@ -963,8 +963,8 @@ class Form
|
||||
$out='';
|
||||
|
||||
// On recherche les utilisateurs
|
||||
$sql = "SELECT u.rowid, u.name as lastname, u.firstname, u.login, u.admin, u.entity";
|
||||
if(! empty($conf->multicompany->enabled) && $conf->entity == 1 && $user->admin && ! $user->entity)
|
||||
$sql = "SELECT DISTINCT u.rowid, u.name as lastname, u.firstname, u.login, u.admin, u.entity";
|
||||
if (! empty($conf->multicompany->enabled) && $conf->entity == 1 && $user->admin && ! $user->entity)
|
||||
{
|
||||
$sql.= ", e.label";
|
||||
}
|
||||
@@ -977,7 +977,16 @@ class Form
|
||||
}
|
||||
else
|
||||
{
|
||||
$sql.= " WHERE u.entity IN (0,".$conf->entity.")";
|
||||
if (! empty($conf->multicompany->transverse_mode))
|
||||
{
|
||||
$sql.= ", ".MAIN_DB_PREFIX."usergroup_user as ug";
|
||||
$sql.= " WHERE ug.fk_user = u.rowid";
|
||||
$sql.= " AND ug.entity = ".$conf->entity;
|
||||
}
|
||||
else
|
||||
{
|
||||
$sql.= " WHERE u.entity IN (0,".$conf->entity.")";
|
||||
}
|
||||
}
|
||||
if (! empty($user->societe_id)) $sql.= " AND u.fk_societe = ".$user->societe_id;
|
||||
if (is_array($exclude) && $excludeUsers) $sql.= " AND u.rowid NOT IN ('".$excludeUsers."')";
|
||||
|
||||
@@ -1,185 +1,215 @@
|
||||
<?php
|
||||
/* Copyright (c) 2008-2012 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2010-2011 Regis Houssin <regis@dolibarr.fr>
|
||||
* Copyright (C) 2010 Juanjo Menent <jmenent@2byte.es>
|
||||
*
|
||||
* 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
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
* Copyright (C) 2010 Juanjo Menent <jmenent@2byte.es>
|
||||
*
|
||||
* 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
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
/**
|
||||
* \file htdocs/core/class/html.formactions.class.php
|
||||
* \ingroup core
|
||||
* \brief Fichier de la classe des fonctions predefinie de composants html actions
|
||||
*/
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
* Class to manage building of HTML components
|
||||
*/
|
||||
*/
|
||||
class FormActions
|
||||
{
|
||||
var $db;
|
||||
var $error;
|
||||
var $db;
|
||||
var $error;
|
||||
|
||||
|
||||
/**
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @param DoliDB $db Database handler
|
||||
*/
|
||||
function FormActions($db)
|
||||
{
|
||||
$this->db = $db;
|
||||
return 1;
|
||||
}
|
||||
*/
|
||||
function FormActions($db)
|
||||
{
|
||||
$this->db = $db;
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Show list of action status
|
||||
*
|
||||
* @param string $formname Name of form where select in included
|
||||
* @param string $selected Preselected value
|
||||
* @param int $canedit 1=can edit, 0=read only
|
||||
* @param string $htmlname Name of html prefix for html fields (selectX and valX)
|
||||
* @return void
|
||||
*/
|
||||
function form_select_status_action($formname,$selected,$canedit=1,$htmlname='complete')
|
||||
{
|
||||
global $langs,$conf;
|
||||
/**
|
||||
* Show list of action status
|
||||
*
|
||||
* @param string $formname Name of form where select in included
|
||||
* @param string $selected Preselected value (-1..100)
|
||||
* @param int $canedit 1=can edit, 0=read only
|
||||
* @param string $htmlname Name of html prefix for html fields (selectX and valX)
|
||||
* @return void
|
||||
*/
|
||||
function form_select_status_action($formname,$selected,$canedit=1,$htmlname='complete')
|
||||
{
|
||||
global $langs,$conf;
|
||||
|
||||
$listofstatus=array('-1'=>$langs->trans("ActionNotApplicable"),
|
||||
'0'=>$langs->trans("ActionRunningNotStarted"),
|
||||
'50'=>$langs->trans("ActionRunningShort"),
|
||||
'100'=>$langs->trans("ActionDoneShort"));
|
||||
$listofstatus = array(
|
||||
'-1' => $langs->trans("ActionNotApplicable"),
|
||||
'0' => $langs->trans("ActionRunningNotStarted"),
|
||||
'50' => $langs->trans("ActionRunningShort"),
|
||||
'100' => $langs->trans("ActionDoneShort")
|
||||
);
|
||||
|
||||
if ($conf->use_javascript_ajax)
|
||||
{
|
||||
print "\n";
|
||||
print '<script type="text/javascript">'."\n";
|
||||
print 'jQuery(document).ready(function () {'."\n";
|
||||
print 'jQuery("#select'.$htmlname.'").change(function() { select_status(document.'.$formname.'.status.value); });'."\n";
|
||||
print 'jQuery("#val'.$htmlname.'").change(function() { select_status(jQuery("#val'.$htmlname.'").val()); });'."\n";
|
||||
print 'select_status(document.'.$formname.'.status.value);'."\n";
|
||||
print '});'."\n";
|
||||
print 'function select_status(mypercentage) {'."\n";
|
||||
print 'document.'.$formname.'.percentageshown.value=(mypercentage>=0?mypercentage:\'\');'."\n";
|
||||
print 'document.'.$formname.'.percentage.value=mypercentage;'."\n";
|
||||
print 'if (mypercentage == -1) { document.'.$formname.'.percentageshown.disabled=true; jQuery(".hideifna").hide(); }'."\n";
|
||||
print 'else if (mypercentage == 0) { document.'.$formname.'.percentageshown.disabled=true; jQuery(".hideifna").show();}'."\n";
|
||||
print 'else if (mypercentage == 100) { document.'.$formname.'.percentageshown.disabled=true; jQuery(".hideifna").show();}'."\n";
|
||||
print 'else { document.'.$formname.'.percentageshown.disabled=false; jQuery(".hideifna").show();}'."\n";
|
||||
print '}'."\n";
|
||||
print '</script>'."\n";
|
||||
print '<select '.($canedit?'':'disabled="disabled" ').'name="status" id="select'.$htmlname.'" class="flat">';
|
||||
foreach($listofstatus as $key => $val)
|
||||
{
|
||||
print '<option value="'.$key.'"'.($selected == $key?' selected="selected"':'').'>'.$val.'</option>';
|
||||
}
|
||||
print '</select>';
|
||||
if ($selected == 0 || $selected == 100) $canedit=0;
|
||||
print ' <input type="text" id="val'.$htmlname.'" name="percentageshown" class="flat hideifna" value="'.($selected>=0?$selected:'').'" size="2"'.($canedit&&($selected>=0)?'':' disabled="disabled"').'>';
|
||||
print '<span class="hideifna">%</span>';
|
||||
print ' <input type="hidden" name="percentage" value="'.$selected.'">';
|
||||
}
|
||||
else
|
||||
{
|
||||
print ' <input type="text" id="val'.$htmlname.'" name="percentage" class="flat" value="'.($selected>=0?$selected:'').'" size="2"'.($canedit?'':' disabled="disabled"').'>%';
|
||||
}
|
||||
}
|
||||
if (! empty($conf->use_javascript_ajax))
|
||||
{
|
||||
print "\n";
|
||||
print "<script type=\"text/javascript\">
|
||||
var htmlname = '".$htmlname."';
|
||||
|
||||
$(document).ready(function () {
|
||||
select_status();
|
||||
|
||||
$('#select' + htmlname).change(function() {
|
||||
select_status();
|
||||
});
|
||||
// FIXME use another method for update combobox
|
||||
//$('#val' + htmlname).change(function() {
|
||||
//select_status();
|
||||
//});
|
||||
});
|
||||
|
||||
function select_status() {
|
||||
var defaultvalue = $('#select' + htmlname).val();
|
||||
var percentage = $('input[name=percentage]');
|
||||
var selected = '".(isset($selected)?$selected:'')."';
|
||||
var value = (selected>0?selected:(defaultvalue>=0?defaultvalue:''));
|
||||
|
||||
percentage.val(value);
|
||||
|
||||
if (defaultvalue == -1) {
|
||||
percentage.attr('disabled', 'disabled');
|
||||
$('.hideifna').hide();
|
||||
}
|
||||
else if (defaultvalue == 0) {
|
||||
percentage.val(0);
|
||||
percentage.attr('disabled', 'disabled');
|
||||
$('.hideifna').show();
|
||||
}
|
||||
else if (defaultvalue == 100) {
|
||||
percentage.val(100);
|
||||
percentage.attr('disabled', 'disabled');
|
||||
$('.hideifna').show();
|
||||
}
|
||||
else {
|
||||
if (defaultvalue == 50 && (percentage.val() == 0 || percentage.val() == 100)) { percentage.val(50) };
|
||||
percentage.removeAttr('disabled');
|
||||
$('.hideifna').show();
|
||||
}
|
||||
}
|
||||
</script>\n";
|
||||
print '<select '.($canedit?'':'disabled="disabled" ').'name="status" id="select'.$htmlname.'" class="flat">';
|
||||
foreach($listofstatus as $key => $val)
|
||||
{
|
||||
print '<option value="'.$key.'"'.(($selected == $key) || (($selected > 0 && $selected < 100) && $key == '50') ? ' selected="selected"' : '').'>'.$val.'</option>';
|
||||
}
|
||||
print '</select>';
|
||||
if ($selected == 0 || $selected == 100) $canedit=0;
|
||||
print ' <input type="text" id="val'.$htmlname.'" name="percentage" class="flat hideifna" value="'.($selected>=0?$selected:'').'" size="2"'.($canedit&&($selected>=0)?'':' disabled="disabled"').'>';
|
||||
print '<span class="hideifna">%</span>';
|
||||
}
|
||||
else
|
||||
{
|
||||
print ' <input type="text" id="val'.$htmlname.'" name="percentage" class="flat" value="'.($selected>=0?$selected:'').'" size="2"'.($canedit?'':' disabled="disabled"').'>%';
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Show list of actions for element
|
||||
*
|
||||
* @param Object $object Object
|
||||
* @param string $typeelement 'invoice','propal','order','invoice_supplier','order_supplier','fichinter'
|
||||
* @param int $socid socid of user
|
||||
* @return int <0 if KO, >=0 if OK
|
||||
*/
|
||||
function showactions($object,$typeelement,$socid=0)
|
||||
{
|
||||
global $langs,$conf,$user;
|
||||
global $bc;
|
||||
/**
|
||||
* Show list of actions for element
|
||||
*
|
||||
* @param Object $object Object
|
||||
* @param string $typeelement 'invoice','propal','order','invoice_supplier','order_supplier','fichinter'
|
||||
* @param int $socid socid of user
|
||||
* @return int <0 if KO, >=0 if OK
|
||||
*/
|
||||
function showactions($object,$typeelement,$socid=0)
|
||||
{
|
||||
global $langs,$conf,$user;
|
||||
global $bc;
|
||||
|
||||
require_once(DOL_DOCUMENT_ROOT."/comm/action/class/actioncomm.class.php");
|
||||
require_once(DOL_DOCUMENT_ROOT."/comm/action/class/actioncomm.class.php");
|
||||
|
||||
$actioncomm = new ActionComm($this->db);
|
||||
$actioncomm->getActions($socid, $object->id, $typeelement);
|
||||
$actioncomm = new ActionComm($this->db);
|
||||
$actioncomm->getActions($socid, $object->id, $typeelement);
|
||||
|
||||
$num = count($actioncomm->actions);
|
||||
if ($num)
|
||||
{
|
||||
if ($typeelement == 'invoice') $title=$langs->trans('ActionsOnBill');
|
||||
elseif ($typeelement == 'invoice_supplier' || $typeelement == 'supplier_invoice') $title=$langs->trans('ActionsOnBill');
|
||||
elseif ($typeelement == 'propal') $title=$langs->trans('ActionsOnPropal');
|
||||
elseif ($typeelement == 'order') $title=$langs->trans('ActionsOnOrder');
|
||||
elseif ($typeelement == 'order_supplier' || $typeelement == 'supplier_order') $title=$langs->trans('ActionsOnOrder');
|
||||
elseif ($typeelement == 'project') $title=$langs->trans('ActionsOnProject');
|
||||
elseif ($typeelement == 'shipping') $title=$langs->trans('ActionsOnShipping');
|
||||
elseif ($typeelement == 'fichinter') $title=$langs->trans('ActionsOnFicheInter');
|
||||
else $title=$langs->trans("Actions");
|
||||
$num = count($actioncomm->actions);
|
||||
if ($num)
|
||||
{
|
||||
if ($typeelement == 'invoice') $title=$langs->trans('ActionsOnBill');
|
||||
elseif ($typeelement == 'invoice_supplier' || $typeelement == 'supplier_invoice') $title=$langs->trans('ActionsOnBill');
|
||||
elseif ($typeelement == 'propal') $title=$langs->trans('ActionsOnPropal');
|
||||
elseif ($typeelement == 'order') $title=$langs->trans('ActionsOnOrder');
|
||||
elseif ($typeelement == 'order_supplier' || $typeelement == 'supplier_order') $title=$langs->trans('ActionsOnOrder');
|
||||
elseif ($typeelement == 'project') $title=$langs->trans('ActionsOnProject');
|
||||
elseif ($typeelement == 'shipping') $title=$langs->trans('ActionsOnShipping');
|
||||
elseif ($typeelement == 'fichinter') $title=$langs->trans('ActionsOnFicheInter');
|
||||
else $title=$langs->trans("Actions");
|
||||
|
||||
print_titre($title);
|
||||
print_titre($title);
|
||||
|
||||
$total = 0; $var=true;
|
||||
print '<table class="noborder" width="100%">';
|
||||
print '<tr class="liste_titre"><th class="liste_titre">'.$langs->trans('Ref').'</th><th class="liste_titre">'.$langs->trans('Date').'</th><th class="liste_titre">'.$langs->trans('Action').'</th><th class="liste_titre">'.$langs->trans('By').'</th></tr>';
|
||||
print "\n";
|
||||
$total = 0; $var=true;
|
||||
print '<table class="noborder" width="100%">';
|
||||
print '<tr class="liste_titre"><th class="liste_titre">'.$langs->trans('Ref').'</th><th class="liste_titre">'.$langs->trans('Date').'</th><th class="liste_titre">'.$langs->trans('Action').'</th><th class="liste_titre">'.$langs->trans('By').'</th></tr>';
|
||||
print "\n";
|
||||
|
||||
foreach($actioncomm->actions as $action)
|
||||
{
|
||||
$var=!$var;
|
||||
print '<tr '.$bc[$var].'>';
|
||||
print '<td>'.$action->getNomUrl(1).'</td>';
|
||||
print '<td>'.dol_print_date($action->datep,'day').'</td>';
|
||||
print '<td title="'.dol_escape_htmltag($action->label).'">'.dol_trunc($action->label,32).'</td>';
|
||||
$userstatic = new User($this->db);
|
||||
$userstatic->id = $action->author->id;
|
||||
$userstatic->firstname = $action->author->firstname;
|
||||
$userstatic->lastname = $action->author->lastname;
|
||||
print '<td>'.$userstatic->getNomUrl(1).'</td>';
|
||||
print '</tr>';
|
||||
}
|
||||
print '</table>';
|
||||
}
|
||||
foreach($actioncomm->actions as $action)
|
||||
{
|
||||
$var=!$var;
|
||||
print '<tr '.$bc[$var].'>';
|
||||
print '<td>'.$action->getNomUrl(1).'</td>';
|
||||
print '<td>'.dol_print_date($action->datep,'day').'</td>';
|
||||
print '<td title="'.dol_escape_htmltag($action->label).'">'.dol_trunc($action->label,32).'</td>';
|
||||
$userstatic = new User($this->db);
|
||||
$userstatic->id = $action->author->id;
|
||||
$userstatic->firstname = $action->author->firstname;
|
||||
$userstatic->lastname = $action->author->lastname;
|
||||
print '<td>'.$userstatic->getNomUrl(1).'</td>';
|
||||
print '</tr>';
|
||||
}
|
||||
print '</table>';
|
||||
}
|
||||
|
||||
return $num;
|
||||
}
|
||||
return $num;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Output list of type of event
|
||||
*
|
||||
* @param string $selected Type pre-selectionne
|
||||
* @param string $htmlname Nom champ formulaire
|
||||
* @return void
|
||||
*/
|
||||
function select_type_actions($selected='',$htmlname='actioncode')
|
||||
{
|
||||
global $langs,$user;
|
||||
/**
|
||||
* Output list of type of event
|
||||
*
|
||||
* @param string $selected Type pre-selectionne
|
||||
* @param string $htmlname Nom champ formulaire
|
||||
* @return void
|
||||
*/
|
||||
function select_type_actions($selected='',$htmlname='actioncode')
|
||||
{
|
||||
global $langs,$user;
|
||||
|
||||
require_once(DOL_DOCUMENT_ROOT."/comm/action/class/cactioncomm.class.php");
|
||||
require_once(DOL_DOCUMENT_ROOT."/core/class/html.form.class.php");
|
||||
$caction=new CActionComm($this->db);
|
||||
$form=new Form($this->db);
|
||||
require_once(DOL_DOCUMENT_ROOT."/comm/action/class/cactioncomm.class.php");
|
||||
require_once(DOL_DOCUMENT_ROOT."/core/class/html.form.class.php");
|
||||
$caction=new CActionComm($this->db);
|
||||
$form=new Form($this->db);
|
||||
|
||||
$arraylist=$caction->liste_array(1,'code');
|
||||
array_unshift($arraylist,' '); // Add empty line at start
|
||||
//asort($arraylist);
|
||||
$arraylist=$caction->liste_array(1,'code');
|
||||
array_unshift($arraylist,' '); // Add empty line at start
|
||||
//asort($arraylist);
|
||||
|
||||
print $form->selectarray($htmlname, $arraylist, $selected);
|
||||
if ($user->admin) print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionnarySetup"),1);
|
||||
}
|
||||
print $form->selectarray($htmlname, $arraylist, $selected);
|
||||
if ($user->admin) print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionnarySetup"),1);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -169,7 +169,7 @@ class FormBarCode
|
||||
{
|
||||
print '<form method="post" action="'.$page.'">';
|
||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
print '<input type="hidden" name="action" value="setbarcodetype">';
|
||||
print '<input type="hidden" name="action" value="set'.$htmlname.'">';
|
||||
print '<table class="nobordernopadding" cellpadding="0" cellspacing="0">';
|
||||
print '<tr><td>';
|
||||
$this->select_barcode_type($selected, $htmlname, 1);
|
||||
|
||||
@@ -218,7 +218,7 @@ function pdf_build_address($outputlangs,$sourcecompany,$targetcompany='',$target
|
||||
{
|
||||
$stringaddress .= ($stringaddress ? "\n" : '' ).$outputlangs->convToOutputCharset(dol_format_address($sourcecompany))."\n";
|
||||
|
||||
if (! empty($conf->global->MAIN_PDF_ADDALSOSOURCEDETAILS))
|
||||
if (empty($conf->global->MAIN_PDF_DISABLESOURCEDETAILS))
|
||||
{
|
||||
// Tel
|
||||
if ($sourcecompany->tel) $stringaddress .= ($stringaddress ? "\n" : '' ).$outputlangs->transnoentities("Phone").": ".$outputlangs->convToOutputCharset($sourcecompany->tel);
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
/* Copyright (C) 2002-2006 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2006-2008 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2010 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2010-2012 Juanjo Menent <jmenent@2byte.es>
|
||||
*
|
||||
* 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
|
||||
@@ -95,8 +95,8 @@ function calcul_price_total($qty, $pu, $remise_percent_ligne, $txtva, $txlocalta
|
||||
$result[9] = price2num(($result[0] * ( 1 + ( $txlocaltax1 / 100))) - $result[0], 'MT');
|
||||
$result[2] = price2num($result[2] + $result[9], 'MT');
|
||||
|
||||
$result[11] = price2num(($result[3] * ( 1 + ( $txlocaltax1 / 100))) - $pu, 'MT');
|
||||
$result[5] = price2num($result[5] + $result[11], 'MT');
|
||||
$result[11] = price2num(($result[3] * ( 1 + ( $txlocaltax1 / 100))) - $pu, 'MU');
|
||||
$result[5] = price2num($result[5] + $result[11], 'MU');
|
||||
|
||||
}
|
||||
else
|
||||
@@ -110,7 +110,7 @@ function calcul_price_total($qty, $pu, $remise_percent_ligne, $txtva, $txlocalta
|
||||
{
|
||||
$result[15] = price2num(($result[6] * ( 1 + ( $txlocaltax2 / 100))) - $result[6], 'MT');
|
||||
$result[10] = price2num(($result[0] * ( 1 + ( $txlocaltax2 / 100))) - $result[0], 'MT');
|
||||
$result[12] = price2num(($result[3] * ( 1 + ( $txlocaltax2 / 100))) - $pu, 'MT');
|
||||
$result[12] = price2num(($result[3] * ( 1 + ( $txlocaltax2 / 100))) - $pu, 'MU');
|
||||
|
||||
//If Country is Spain, localtax2 (IRPF) will be subtracted
|
||||
if ($mysoc->country_code=='ES')
|
||||
|
||||
@@ -244,7 +244,7 @@ function dol_loginfunction($langs,$conf,$mysoc)
|
||||
$hookmanager->executeHooks('getLoginPageOptions',$parameters); // Note that $action and $object may have been modified by some hooks
|
||||
|
||||
// Login
|
||||
$login = (! empty($hookmanager->resArray['username']) ? $hookmanager->resArray['username'] : (GETPOST("username","alpha",2) ? GETPOST("username","alpha",2) : $demologin));
|
||||
$login = (! empty($hookmanager->resArray['username']) ? $hookmanager->resArray['username'] : (GETPOST("username","alpha") ? GETPOST("username","alpha") : $demologin));
|
||||
$password = $demopassword;
|
||||
|
||||
// Show logo (search in order: small company logo, large company logo, theme logo, common logo)
|
||||
|
||||
@@ -491,9 +491,9 @@ Class pdf_expedition_rouget extends ModelePdfExpedition
|
||||
$pdf->MultiCell(80, 4, $carac_emetteur, 0, 'L');
|
||||
|
||||
|
||||
// If CUSTOMER contact defined, we use it
|
||||
// If SHIPPING contact defined, we use it
|
||||
$usecontact=false;
|
||||
$arrayidcontact=$object->getIdContact('external','CUSTOMER');
|
||||
$arrayidcontact=$object->getIdContact('external','SHIPPING');
|
||||
if (count($arrayidcontact) > 0)
|
||||
{
|
||||
$usecontact=true;
|
||||
|
||||
@@ -63,7 +63,7 @@
|
||||
|
||||
<td align="right">
|
||||
<?php
|
||||
if ($buyer->tva_assuj == "0") echo '<input type="hidden" name="np_tva_tx" value="0">0';
|
||||
if ($seller->tva_assuj == "0") echo '<input type="hidden" name="np_tva_tx" value="0">0';
|
||||
else echo $form->load_tva('np_tva_tx', (isset($_POST["np_tva_tx"])?$_POST["np_tva_tx"]:-1), $seller, $buyer);
|
||||
?>
|
||||
</td>
|
||||
|
||||
@@ -82,7 +82,7 @@ $(document).ready(function () {
|
||||
<input type="hidden" name="screenwidth" id="screenwidth" value="" />
|
||||
<input type="hidden" name="screenheight" id="screenheight" value="" />
|
||||
|
||||
<table class="login_table" summary="<?php echo $title; ?>" cellpadding="0" cellspacing="0" border="0" align="center">
|
||||
<table class="login_table" summary="<?php echo dol_escape_htmltag($title); ?>" cellpadding="0" cellspacing="0" border="0" align="center">
|
||||
<tr class="vmenu"><td align="center"><?php echo $title; ?></td></tr>
|
||||
</table>
|
||||
<br>
|
||||
@@ -96,22 +96,24 @@ $(document).ready(function () {
|
||||
<tr>
|
||||
<td valign="bottom"> <strong><label for="username"><?php echo $langs->trans('Login'); ?></label></strong> </td>
|
||||
<td valign="bottom" nowrap="nowrap">
|
||||
<input type="text" id="username" name="username" class="flat" size="15" maxlength="40" value="<?php echo GETPOST('username')?GETPOST('username'):$login; ?>" tabindex="1" />
|
||||
<input type="text" id="username" name="username" class="flat" size="15" maxlength="40" value="<?php echo dol_escape_htmltag($login); ?>" tabindex="1" />
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<!-- Password -->
|
||||
<tr><td valign="top" nowrap="nowrap"> <strong><label for="password"><?php echo $langs->trans('Password'); ?></label></strong> </td>
|
||||
<td valign="top" nowrap="nowrap">
|
||||
<input id="password" name="password" class="flat" type="password" size="15" maxlength="30" value="<?php echo $password; ?>" tabindex="2" />
|
||||
<input id="password" name="password" class="flat" type="password" size="15" maxlength="30" value="<?php echo dol_escape_htmltag($password); ?>" tabindex="2" />
|
||||
</td></tr>
|
||||
|
||||
<?php
|
||||
if (! empty($hookmanager->resArray['options'])) {
|
||||
foreach ($hookmanager->resArray['options'] as $option)
|
||||
foreach ($hookmanager->resArray['options'] as $format => $option)
|
||||
{
|
||||
echo '<!-- Option by hook -->';
|
||||
echo $option;
|
||||
if ($format == 'table') {
|
||||
echo '<!-- Option by hook -->';
|
||||
echo $option;
|
||||
}
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
||||
@@ -35,10 +35,12 @@ print '<!-- Includes for JQuery (Ajax library) -->'."\n";
|
||||
if (constant('JS_JQUERY_UI')) print '<link rel="stylesheet" type="text/css" href="'.JS_JQUERY_UI.'css/'.$jquerytheme.'/jquery-ui.min.css" />'."\n"; // JQuery
|
||||
else print '<link rel="stylesheet" type="text/css" href="'.DOL_URL_ROOT.'/includes/jquery/css/'.$jquerytheme.'/jquery-ui-latest.custom.css" />'."\n"; // JQuery
|
||||
// JQuery. Must be before other includes
|
||||
$ext='.js';
|
||||
if (isset($conf->global->MAIN_OPTIMIZE_SPEED) && ($conf->global->MAIN_OPTIMIZE_SPEED & 0x01)) $ext='.jgz';
|
||||
print '<!-- Includes JS for JQuery -->'."\n";
|
||||
if (constant('JS_JQUERY')) print '<script type="text/javascript" src="'.JS_JQUERY.'jquery.min.js"></script>'."\n";
|
||||
else print '<script type="text/javascript" src="'.DOL_URL_ROOT.'/includes/jquery/js/jquery-latest.min'.$ext.'"></script>'."\n";
|
||||
print '<link rel="stylesheet" type="text/css" href="'.$conf_css.'" />
|
||||
print '<link rel="stylesheet" type="text/css" href="'.dol_escape_htmltag($conf_css).'" />
|
||||
<style type="text/css">
|
||||
<!--
|
||||
#login {
|
||||
@@ -81,12 +83,17 @@ print '<!-- HTTP_USER_AGENT = '.$_SERVER['HTTP_USER_AGENT'].' -->
|
||||
<input type="text" <?php echo $disabled; ?> id="username" name="username" class="flat" size="15" maxlength="25" value="<?php echo $login; ?>" tabindex="1" /></td>
|
||||
</tr>
|
||||
|
||||
<?php if ($select_entity) { ?>
|
||||
<tr><td valign="top" nowrap="nowrap"> <b><?php echo $langs->trans('Entity'); ?></b> </td>
|
||||
<td valign="top" nowrap="nowrap">
|
||||
<?php echo $select_entity; ?>
|
||||
</td></tr>
|
||||
<?php } ?>
|
||||
<?php
|
||||
if (! empty($hookmanager->resArray['options'])) {
|
||||
foreach ($hookmanager->resArray['options'] as $format => $option)
|
||||
{
|
||||
if ($format == 'table') {
|
||||
echo '<!-- Option by hook -->';
|
||||
echo $option;
|
||||
}
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
||||
<?php if ($captcha) { ?>
|
||||
<tr><td valign="middle" nowrap="nowrap"> <b><?php echo $langs->trans('SecurityCode'); ?></b></td>
|
||||
|
||||
@@ -123,11 +123,11 @@ else if ($action == 'add' && $user->rights->ficheinter->creer)
|
||||
$object->duree = GETPOST('duree','int');
|
||||
$object->fk_project = GETPOST('projectid','int');
|
||||
$object->author = $user->id;
|
||||
$object->description = GETPOST('description','alpha');
|
||||
$object->description = GETPOST('description');
|
||||
$object->ref = $ref;
|
||||
$object->modelpdf = GETPOST('model','alpha');
|
||||
$object->note_private = GETPOST('note_private','alpha');
|
||||
$object->note_public = GETPOST('note_public','alpha');
|
||||
$object->note_private = GETPOST('note_private');
|
||||
$object->note_public = GETPOST('note_public');
|
||||
|
||||
if ($object->socid > 0)
|
||||
{
|
||||
@@ -233,7 +233,7 @@ else if ($action == 'confirm_delete' && $confirm == 'yes' && $user->rights->fich
|
||||
else if ($action == 'setdescription' && $user->rights->ficheinter->creer)
|
||||
{
|
||||
$object->fetch($id);
|
||||
$result=$object->set_description($user,GETPOST('description','alpha'));
|
||||
$result=$object->set_description($user,GETPOST('description'));
|
||||
if ($result < 0) dol_print_error($db,$object->error);
|
||||
}
|
||||
else if ($action == 'setnote_public' && $user->rights->ficheinter->creer)
|
||||
@@ -252,7 +252,7 @@ else if ($action == 'setnote_private' && $user->rights->ficheinter->creer)
|
||||
// Add line
|
||||
else if ($action == "addline" && $user->rights->ficheinter->creer)
|
||||
{
|
||||
if (!GETPOST('np_desc','alpha'))
|
||||
if (!GETPOST('np_desc'))
|
||||
{
|
||||
$mesg='<div class="error">'.$langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("Description")).'</div>';
|
||||
$error++;
|
||||
@@ -269,7 +269,7 @@ else if ($action == "addline" && $user->rights->ficheinter->creer)
|
||||
$ret=$object->fetch($id);
|
||||
$object->fetch_thirdparty();
|
||||
|
||||
$desc=GETPOST('np_desc','alpha');
|
||||
$desc=GETPOST('np_desc');
|
||||
$date_intervention = dol_mktime(GETPOST('dihour','int'), GETPOST('dimin','int'), 0, GETPOST('dimonth','int'), GETPOST('diday','int'), GETPOST('diyear','int'));
|
||||
$duration = convertTime2Seconds(GETPOST('durationhour','int'), GETPOST('durationmin','int'));
|
||||
|
||||
@@ -342,7 +342,7 @@ else if ($action == 'updateline' && $user->rights->ficheinter->creer && GETPOST(
|
||||
}
|
||||
$object->fetch_thirdparty();
|
||||
|
||||
$desc = GETPOST('np_desc','alpha');
|
||||
$desc = GETPOST('np_desc');
|
||||
$date_inter = dol_mktime(GETPOST('dihour','int'), GETPOST('dimin','int'), 0, GETPOST('dimonth','int'), GETPOST('diday','int'), GETPOST('diyear','int'));
|
||||
$duration = convertTime2Seconds(GETPOST('durationhour','int'),GETPOST('durationmin','int'));
|
||||
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
* \brief File that include conf.php file and commons lib like functions.lib.php
|
||||
*/
|
||||
|
||||
if (! defined('DOL_VERSION')) define('DOL_VERSION','3.2.1'); // Also defined in htdocs/install/inc.php (Ex: x.y.z-alpha, x.y.z)
|
||||
if (! defined('DOL_VERSION')) define('DOL_VERSION','3.2.2'); // Also defined in htdocs/install/inc.php (Ex: x.y.z-alpha, x.y.z)
|
||||
if (! defined('EURO')) define('EURO',chr(128));
|
||||
|
||||
// Define syslog constants
|
||||
@@ -54,6 +54,7 @@ if (! defined('LOG_DEBUG'))
|
||||
}
|
||||
|
||||
// Force PHP error_reporting setup (Dolibarr may report warning without this)
|
||||
if (! defined('E_DEPRECATED')) define('E_DEPRECATED',0); // For PHP < 5.3.0 compatibility
|
||||
error_reporting(E_ALL & ~(E_STRICT|E_NOTICE|E_DEPRECATED));
|
||||
//error_reporting(E_ALL | E_STRICT);
|
||||
|
||||
@@ -76,6 +77,7 @@ if (! $result && ! empty($_SERVER["GATEWAY_INTERFACE"])) // If install not do
|
||||
exit;
|
||||
}
|
||||
|
||||
|
||||
// Disable php display errors
|
||||
if (! empty($dolibarr_main_prod))
|
||||
{
|
||||
@@ -100,6 +102,7 @@ if (empty($dolibarr_main_limit_users)) $dolibarr_main_limit_users=0;
|
||||
if (empty($dolibarr_mailing_limit_sendbyweb)) $dolibarr_mailing_limit_sendbyweb=0;
|
||||
if (empty($force_charset_do_notuse)) $force_charset_do_notuse='UTF-8';
|
||||
if (empty($multicompany_transverse_mode)) $multicompany_transverse_mode=0;
|
||||
if (empty($multicompany_force_entity)) $multicompany_force_entity=0; // To force entity in login page
|
||||
|
||||
// Security: CSRF protection
|
||||
// This test check if referrer ($_SERVER['HTTP_REFERER']) is same web site than Dolibarr ($_SERVER['HTTP_HOST'])
|
||||
|
||||
@@ -607,5 +607,5 @@ dolibarr_install_syslog("--- install/etape2.php end", LOG_INFO);
|
||||
|
||||
pFooter(!$ok,$setuplang);
|
||||
|
||||
$db->close();
|
||||
if (isset($db) && is_object($db)) $db->close();
|
||||
?>
|
||||
@@ -1,9 +1,9 @@
|
||||
<?php
|
||||
/* Copyright (C) 2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2004-2011 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2004 Benoit Mortier <benoit.mortier@opensides.be>
|
||||
* Copyright (C) 2004 Sebastien DiCintio <sdicintio@ressource-toi.org>
|
||||
* Copyright (C) 2005-2009 Regis Houssin <regis@dolibarr.fr>
|
||||
/* Copyright (C) 2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2004-2011 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2004 Benoit Mortier <benoit.mortier@opensides.be>
|
||||
* Copyright (C) 2004 Sebastien DiCintio <sdicintio@ressource-toi.org>
|
||||
* Copyright (C) 2005-2012 Regis Houssin <regis@dolibarr.fr>
|
||||
*
|
||||
* 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
|
||||
@@ -31,23 +31,24 @@ require_once($dolibarr_main_document_root . "/core/lib/admin.lib.php");
|
||||
require_once($dolibarr_main_document_root . "/core/lib/security.lib.php"); // for dol_hash
|
||||
|
||||
|
||||
$setuplang=isset($_POST["selectlang"])?$_POST["selectlang"]:(isset($_GET["selectlang"])?$_GET["selectlang"]:'auto');
|
||||
$setuplang=GETPOST("selectlang",'',3)?GETPOST("selectlang",'',3):'auto';
|
||||
$langs->setDefaultLang($setuplang);
|
||||
$versionfrom=GETPOST("versionfrom",'',3)?GETPOST("versionfrom",'',3):(empty($argv[1])?'':$argv[1]);
|
||||
$versionto=GETPOST("versionto",'',3)?GETPOST("versionto",'',3):(empty($argv[2])?'':$argv[2]);
|
||||
$action=GETPOST('action', 'alpha');
|
||||
|
||||
// Define targetversion used to update MAIN_VERSION_LAST_INSTALL for first install
|
||||
// or MAIN_VERSION_LAST_UPGRADE for upgrade.
|
||||
$targetversion=DOL_VERSION; // It it's last upgrade
|
||||
if (isset($_POST["action"]) && preg_match('/upgrade/i',$_POST["action"])) // If it's an old upgrade
|
||||
if (! empty($action) && preg_match('/upgrade/i', $action)) // If it's an old upgrade
|
||||
{
|
||||
$tmp=explode('_',$_POST["action"],2);
|
||||
$tmp=explode('_', $action, 2);
|
||||
if ($tmp[0]=='upgrade' && ! empty($tmp[1])) $targetversion=$tmp[1];
|
||||
}
|
||||
|
||||
$langs->load("admin");
|
||||
$langs->load("install");
|
||||
|
||||
$action=GETPOST('action');
|
||||
|
||||
$success=0;
|
||||
|
||||
// Init "forced values" to nothing. "forced values" are used after using an install wizard (using a file install.forced.php).
|
||||
@@ -105,14 +106,14 @@ pHeader($langs->trans("SetupEnd"),"etape5");
|
||||
print '<br>';
|
||||
|
||||
// Test if we can run a first install process
|
||||
if (! GETPOST("versionfrom") && ! GETPOST("versionto") && ! is_writable($conffile))
|
||||
if (empty($versionfrom) && empty($versionto) && ! is_writable($conffile))
|
||||
{
|
||||
print $langs->trans("ConfFileIsNotWritable",$conffiletoshow);
|
||||
pFooter(1,$setuplang,'jscheckparam');
|
||||
exit;
|
||||
}
|
||||
|
||||
if ($action == "set" || preg_match('/upgrade/i',$action))
|
||||
if ($action == "set" || empty($action) || preg_match('/upgrade/i',$action))
|
||||
{
|
||||
print '<table cellspacing="0" cellpadding="2" width="100%">';
|
||||
$error=0;
|
||||
@@ -250,7 +251,7 @@ if ($action == "set" || preg_match('/upgrade/i',$action))
|
||||
}
|
||||
}
|
||||
// If upgrade
|
||||
elseif (preg_match('/upgrade/i',$action))
|
||||
elseif (empty($action) || preg_match('/upgrade/i',$action))
|
||||
{
|
||||
if ($db->connected == 1)
|
||||
{
|
||||
@@ -355,7 +356,7 @@ if ($action == "set")
|
||||
}
|
||||
}
|
||||
// If upgrade
|
||||
elseif (preg_match('/upgrade/i',$action))
|
||||
elseif (empty($action) || preg_match('/upgrade/i',$action))
|
||||
{
|
||||
if (empty($conf->global->MAIN_VERSION_LAST_UPGRADE) || ($conf->global->MAIN_VERSION_LAST_UPGRADE == DOL_VERSION))
|
||||
{
|
||||
@@ -416,4 +417,4 @@ clearstatcache();
|
||||
dolibarr_install_syslog("--- install/etape5.php Dolibarr setup finished", LOG_INFO);
|
||||
|
||||
pFooter(1,$setuplang);
|
||||
?>
|
||||
?>
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
* \brief File that define environment for support pages
|
||||
*/
|
||||
|
||||
define('DOL_VERSION','3.2.1'); // Also defined in htdocs/master.inc.php (Ex: x.y.z-alpha, x.y.z)
|
||||
define('DOL_VERSION','3.2.2'); // Also defined in htdocs/master.inc.php (Ex: x.y.z-alpha, x.y.z)
|
||||
|
||||
// Define DOL_DOCUMENT_ROOT an ADODB_PATH used for install/upgrade process
|
||||
if (! defined('DOL_DOCUMENT_ROOT')) define('DOL_DOCUMENT_ROOT', '..');
|
||||
|
||||
@@ -181,8 +181,8 @@ INSERT INTO llx_c_tva(rowid, fk_pays, taux, recuperableonly, note, active) VALUE
|
||||
INSERT INTO llx_c_tva(rowid, fk_pays, taux, recuperableonly, note, active) VALUES (2023, 202, '0', '0', 'VAT Rate 0', 1);
|
||||
|
||||
-- SPAIN (id country=4)
|
||||
insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,localtax1,note,active) values ( 41, 4, '18','0','4','VAT standard rate',1);
|
||||
insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,localtax1,note,active) values ( 42, 4, '8','0','1','VAT reduced rate',1);
|
||||
insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,localtax1,note,active) values ( 41, 4, '21','0','5.2','VAT standard rate',1);
|
||||
insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,localtax1,note,active) values ( 42, 4, '10','0','1.4','VAT reduced rate',1);
|
||||
insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,localtax1,note,active) values ( 43, 4, '4','0','0.5','VAT super-reduced rate',1);
|
||||
insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 44, 4, '0','0','VAT Rate 0',1);
|
||||
|
||||
|
||||
@@ -30,10 +30,14 @@ update llx_facture_rec set fk_projet = null where fk_projet not in (select rowid
|
||||
update llx_fichinter set fk_projet = null where fk_projet not in (select rowid from llx_projet);
|
||||
update llx_projet_task set fk_projet = null where fk_projet not in (select rowid from llx_projet);
|
||||
|
||||
update llx_propal set fk_user_author = null where fk_user_author not in (select rowid from llx_user);
|
||||
update llx_propal set fk_user_valid = null where fk_user_valid not in (select rowid from llx_user);
|
||||
update llx_propal set fk_user_cloture = null where fk_user_cloture not in (select rowid from llx_user);
|
||||
update llx_commande set fk_user_author = null where fk_user_author not in (select rowid from llx_user);
|
||||
update llx_commande set fk_user_valid = null where fk_user_valid not in (select rowid from llx_user);
|
||||
|
||||
|
||||
ALTER TABLE llx_extrafields ADD COLUMN TYPE VARCHAR(8);
|
||||
ALTER TABLE llx_extrafields ADD COLUMN type VARCHAR(8);
|
||||
|
||||
UPDATE llx_c_paper_format SET active=1 WHERE active=0;
|
||||
|
||||
|
||||
@@ -34,7 +34,11 @@ update llx_facture_rec set fk_projet = null where fk_projet not in (select rowid
|
||||
update llx_fichinter set fk_projet = null where fk_projet not in (select rowid from llx_projet);
|
||||
update llx_projet_task set fk_projet = null where fk_projet not in (select rowid from llx_projet);
|
||||
|
||||
update llx_propal set fk_user_author = null where fk_user_author not in (select rowid from llx_user);
|
||||
update llx_propal set fk_user_valid = null where fk_user_valid not in (select rowid from llx_user);
|
||||
update llx_propal set fk_user_cloture = null where fk_user_cloture not in (select rowid from llx_user);
|
||||
update llx_commande set fk_user_author = null where fk_user_author not in (select rowid from llx_user);
|
||||
update llx_commande set fk_user_valid = null where fk_user_valid not in (select rowid from llx_user);
|
||||
|
||||
delete from llx_societe_extrafields where fk_object not in (select rowid from llx_societe);
|
||||
delete from llx_adherent_extrafields where fk_object not in (select rowid from llx_adherent);
|
||||
|
||||
@@ -292,11 +292,15 @@ if (! GETPOST("action") || preg_match('/upgrade/i',GETPOST('action')))
|
||||
{
|
||||
$dir = "mysql/migration/"; // We use mysql migration scripts whatever is database driver
|
||||
|
||||
// For minor version
|
||||
$newversionfrom=preg_replace('/(\.[0-9]+)$/i','.0',$versionfrom);
|
||||
$newversionto=preg_replace('/(\.[0-9]+)$/i','.0',$versionto);
|
||||
|
||||
$filelist=array();
|
||||
$i = 0;
|
||||
$ok = 0;
|
||||
$from='^'.$versionfrom;
|
||||
$to=$versionto.'\.sql$';
|
||||
$from='^'.$newversionfrom;
|
||||
$to=$newversionto.'\.sql$';
|
||||
|
||||
// Get files list
|
||||
$filesindir=array();
|
||||
|
||||
@@ -866,8 +866,8 @@ MAIN_PROXY_HOST=Nom/Adresse du serveur proxy mandataire
|
||||
MAIN_PROXY_PORT=Port du serveur proxy mandataire
|
||||
MAIN_PROXY_USER=Login pour passer le serveur proxy mandataire
|
||||
MAIN_PROXY_PASS=Mot de passe pour passer le serveur proxy mandataire
|
||||
DefineHereComplementaryAttributes=Definissez ici la liste des attributs supplémentaire, non disponible en standard, et que vous voulez voir gérez sur les %s.
|
||||
ExtraFields=Attributs suplémentaires
|
||||
DefineHereComplementaryAttributes=Définissez ici la liste des attributs supplémentaires, non disponibles en standard, et que vous voulez voir gérés sur les %s.
|
||||
ExtraFields=Attributs supplémentaires
|
||||
ExtraFieldHasWrongValue=L'attribut %s a une valeur incorrecte.
|
||||
AlphaNumOnlyCharsAndNoSpace=uniquement caractères alphanumériques sans espace
|
||||
SendingMailSetup=Configuration de l'envoi par mail
|
||||
|
||||
@@ -885,6 +885,10 @@ function top_htmlhead($head, $title='', $disablejs=0, $disablehead=0, $arrayofjs
|
||||
{
|
||||
foreach($conf->css_modules as $key => $cssfile)
|
||||
{
|
||||
// For compatibility and avoid error if external module use $conf->module_parts
|
||||
// TODO: Removed in 3.3
|
||||
if (is_array($cssfile)) $cssfile = $cssfile[0];
|
||||
|
||||
// cssfile is an absolute path
|
||||
print '<link rel="stylesheet" type="text/css" title="default" href="'.dol_buildpath($cssfile,1);
|
||||
// We add params only if page is not static, because some web server setup does not return content type text/css if url has parameters, so browser cache is not used.
|
||||
|
||||
@@ -76,6 +76,8 @@ if (! empty($dolibarr_main_document_root_alt))
|
||||
if (defined('TEST_DB_FORCE_TYPE')) $conf->db->type=constant('TEST_DB_FORCE_TYPE');
|
||||
// Force Multi-Company transverse mode
|
||||
$conf->multicompany->transverse_mode = empty($multicompany_transverse_mode)?'':$multicompany_transverse_mode;
|
||||
// Force entity in login page
|
||||
$conf->multicompany->force_entity = empty($multicompany_force_entity)?'':(int) $multicompany_force_entity;
|
||||
|
||||
// Chargement des includes principaux de librairies communes
|
||||
if (! defined('NOREQUIREUSER')) require_once(DOL_DOCUMENT_ROOT ."/user/class/user.class.php"); // Need 500ko memory
|
||||
@@ -139,6 +141,10 @@ if (! defined('NOREQUIREDB'))
|
||||
{
|
||||
$conf->entity = DOLENTITY;
|
||||
}
|
||||
else if (! empty($conf->multicompany->force_entity) && is_int($conf->multicompany->force_entity)) // To force entity in login page
|
||||
{
|
||||
$conf->entity = $conf->multicompany->force_entity;
|
||||
}
|
||||
|
||||
//print "Will work with data into entity instance number '".$conf->entity."'";
|
||||
|
||||
|
||||
@@ -361,6 +361,7 @@ class Product extends CommonObject
|
||||
{
|
||||
// Product already exists with this ref
|
||||
$langs->load("products");
|
||||
$error++;
|
||||
$this->error = "ErrorProductAlreadyExists";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1114,7 +1114,7 @@ else
|
||||
{
|
||||
require_once(DOL_DOCUMENT_ROOT."/core/class/html.formbarcode.class.php");
|
||||
$formbarcode = new FormBarCode($db);
|
||||
$formbarcode->form_barcode_type($_SERVER['PHP_SELF'].'?id='.$object->id,$object->barcode_type,'barcodetype_id');
|
||||
$formbarcode->form_barcode_type($_SERVER['PHP_SELF'].'?id='.$object->id,$object->barcode_type,'fk_barcode_type');
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -84,7 +84,7 @@ class Project extends CommonObject
|
||||
if (!trim($this->ref))
|
||||
{
|
||||
$this->error = 'ErrorFieldsRequired';
|
||||
dol_syslog("Project::Create error -1 ref null", LOG_ERR);
|
||||
dol_syslog(get_class($this)."::create error -1 ref null", LOG_ERR);
|
||||
return -1;
|
||||
}
|
||||
|
||||
@@ -111,12 +111,12 @@ class Project extends CommonObject
|
||||
$sql.= ", 0";
|
||||
$sql.= ", " . ($this->public ? 1 : 0);
|
||||
$sql.= ", " . ($this->datec != '' ? $this->db->idate($this->datec) : 'null');
|
||||
$sql.= ", " . ($this->dateo != '' ? $this->db->idate($this->dateo) : 'null');
|
||||
$sql.= ", " . ($this->datee != '' ? $this->db->idate($this->datee) : 'null');
|
||||
$sql.= ", " . ($this->date_start != '' ? $this->db->idate($this->date_start) : 'null');
|
||||
$sql.= ", " . ($this->date_end != '' ? $this->db->idate($this->date_end) : 'null');
|
||||
$sql.= ", ".$conf->entity;
|
||||
$sql.= ")";
|
||||
|
||||
dol_syslog("Project::create sql=" . $sql, LOG_DEBUG);
|
||||
dol_syslog(get_class($this)."::create sql=" . $sql, LOG_DEBUG);
|
||||
$resql = $this->db->query($sql);
|
||||
if ($resql)
|
||||
{
|
||||
@@ -141,7 +141,7 @@ class Project extends CommonObject
|
||||
{
|
||||
$this->error = $this->db->lasterror();
|
||||
$this->errno = $this->db->lasterrno();
|
||||
dol_syslog("Project::Create error -2 " . $this->error, LOG_ERR);
|
||||
dol_syslog(get_class($this)."::create error -2 " . $this->error, LOG_ERR);
|
||||
$error++;
|
||||
}
|
||||
|
||||
|
||||
@@ -129,7 +129,7 @@ class Societe extends CommonObject
|
||||
var $datec;
|
||||
var $date_update;
|
||||
|
||||
var $commercial_id; //Id du commercial affecte
|
||||
var $commercial_id; // Id of sales representative to link (used for thirdparty creation). Not filled by a fetch, because we can have several sales representatives.
|
||||
var $default_lang;
|
||||
|
||||
var $ref_int;
|
||||
@@ -138,7 +138,7 @@ class Societe extends CommonObject
|
||||
var $logo;
|
||||
var $logo_small;
|
||||
var $logo_mini;
|
||||
|
||||
|
||||
var $oldcopy;
|
||||
|
||||
/**
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
* \brief File that define environment for support pages
|
||||
*/
|
||||
|
||||
define('DOL_VERSION','3.2.1'); // Also defined in htdocs/master.inc.php
|
||||
define('DOL_VERSION','3.2.2'); // Also defined in htdocs/master.inc.php
|
||||
|
||||
// Define DOL_DOCUMENT_ROOT an ADODB_PATH used for install/upgrade process
|
||||
if (! defined('DOL_DOCUMENT_ROOT')) define('DOL_DOCUMENT_ROOT', '..');
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 2.6 KiB After Width: | Height: | Size: 3.4 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 5.6 KiB After Width: | Height: | Size: 9.3 KiB |
@@ -2291,6 +2291,11 @@ div#infoLogin {
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
|
||||
/* can be removed in 3.3 */
|
||||
div.entityBox {
|
||||
margin-top: 10px;
|
||||
}
|
||||
|
||||
div.other {
|
||||
margin: 10px 0px;
|
||||
text-align: center;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<?php
|
||||
/* Copyright (C) 2009-2010 Regis Houssin <regis@dolibarr.fr>
|
||||
/* Copyright (C) 2009-2012 Regis Houssin <regis@dolibarr.fr>
|
||||
*
|
||||
* 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
|
||||
@@ -34,10 +34,13 @@ print '<!-- Includes for JQuery (Ajax library) -->'."\n";
|
||||
if (constant('JS_JQUERY_UI')) print '<link rel="stylesheet" type="text/css" href="'.JS_JQUERY_UI.'css/'.$jquerytheme.'/jquery-ui.min.css" />'."\n"; // JQuery
|
||||
else print '<link rel="stylesheet" type="text/css" href="'.DOL_URL_ROOT.'/includes/jquery/css/'.$jquerytheme.'/jquery-ui-latest.custom.css" />'."\n"; // JQuery
|
||||
// JQuery. Must be before other includes
|
||||
$ext='.js';
|
||||
if (isset($conf->global->MAIN_OPTIMIZE_SPEED) && ($conf->global->MAIN_OPTIMIZE_SPEED & 0x01)) $ext='.jgz';
|
||||
print '<!-- Includes JS for JQuery -->'."\n";
|
||||
if (constant('JS_JQUERY')) print '<script type="text/javascript" src="'.JS_JQUERY.'jquery.min.js"></script>'."\n";
|
||||
else print '<script type="text/javascript" src="'.DOL_URL_ROOT.'/includes/jquery/js/jquery-latest.min'.$ext.'"></script>'."\n";
|
||||
print '<link rel="stylesheet" type="text/css" href="'.$conf_css.'" />
|
||||
print '<script type="text/javascript" src="'.DOL_URL_ROOT.'/core/js/dst.js"></script>'."\n";
|
||||
print '<link rel="stylesheet" type="text/css" href="'.dol_escape_htmltag($conf_css).'" />
|
||||
<style type="text/css">
|
||||
<!--
|
||||
#login {
|
||||
@@ -61,140 +64,9 @@ print '<!-- HTTP_USER_AGENT = '.$_SERVER['HTTP_USER_AGENT'].' -->
|
||||
|
||||
<!-- Javascript code on logon page only to detect user tz, dst_observed, dst_first, dst_second -->
|
||||
<script type="text/javascript">
|
||||
function DisplayDstSwitchDates(firstsecond)
|
||||
{
|
||||
var year = new Date().getYear();
|
||||
if (year < 1000) year += 1900;
|
||||
|
||||
var firstSwitch = 0;
|
||||
var secondSwitch = 0;
|
||||
var lastOffset = 99;
|
||||
|
||||
// Loop through every month of the current year
|
||||
for (i = 0; i < 12; i++)
|
||||
{
|
||||
// Fetch the timezone value for the month
|
||||
var newDate = new Date(Date.UTC(year, i, 0, 0, 0, 0, 0));
|
||||
var tz = -1 * newDate.getTimezoneOffset() / 60;
|
||||
|
||||
// Capture when a timzezone change occurs
|
||||
if (tz > lastOffset)
|
||||
firstSwitch = i-1;
|
||||
else if (tz < lastOffset)
|
||||
secondSwitch = i-1;
|
||||
|
||||
lastOffset = tz;
|
||||
}
|
||||
|
||||
// Go figure out date/time occurences a minute before
|
||||
// a DST adjustment occurs
|
||||
var secondDstDate = FindDstSwitchDate(year, secondSwitch);
|
||||
var firstDstDate = FindDstSwitchDate(year, firstSwitch);
|
||||
|
||||
if (firstsecond == 'first') return firstDstDate;
|
||||
if (firstsecond == 'second') return secondDstDate;
|
||||
|
||||
if (firstDstDate == null && secondDstDate == null)
|
||||
return 'Daylight Savings is not observed in your timezone.';
|
||||
else
|
||||
return 'Last minute before DST change occurs in ' +
|
||||
year + ': ' + firstDstDate + ' and ' + secondDstDate;
|
||||
}
|
||||
|
||||
function FindDstSwitchDate(year, month)
|
||||
{
|
||||
// Set the starting date
|
||||
var baseDate = new Date(Date.UTC(year, month, 0, 0, 0, 0, 0));
|
||||
var changeDay = 0;
|
||||
var changeMinute = -1;
|
||||
var baseOffset = -1 * baseDate.getTimezoneOffset() / 60;
|
||||
var dstDate;
|
||||
|
||||
// Loop to find the exact day a timezone adjust occurs
|
||||
for (day = 0; day < 50; day++)
|
||||
{
|
||||
var tmpDate = new Date(Date.UTC(year, month, day, 0, 0, 0, 0));
|
||||
var tmpOffset = -1 * tmpDate.getTimezoneOffset() / 60;
|
||||
|
||||
// Check if the timezone changed from one day to the next
|
||||
if (tmpOffset != baseOffset)
|
||||
{
|
||||
var minutes = 0;
|
||||
changeDay = day;
|
||||
|
||||
// Back-up one day and grap the offset
|
||||
tmpDate = new Date(Date.UTC(year, month, day-1, 0, 0, 0, 0));
|
||||
tmpOffset = -1 * tmpDate.getTimezoneOffset() / 60;
|
||||
|
||||
// Count the minutes until a timezone chnage occurs
|
||||
while (changeMinute == -1)
|
||||
{
|
||||
tmpDate = new Date(Date.UTC(year, month, day-1, 0, minutes, 0, 0));
|
||||
tmpOffset = -1 * tmpDate.getTimezoneOffset() / 60;
|
||||
|
||||
// Determine the exact minute a timezone change
|
||||
// occurs
|
||||
if (tmpOffset != baseOffset)
|
||||
{
|
||||
// Back-up a minute to get the date/time just
|
||||
// before a timezone change occurs
|
||||
tmpOffset = new Date(Date.UTC(year, month,
|
||||
day-1, 0, minutes-1, 0, 0));
|
||||
changeMinute = minutes;
|
||||
break;
|
||||
}
|
||||
else
|
||||
minutes++;
|
||||
}
|
||||
|
||||
// Add a month (for display) since JavaScript counts
|
||||
// months from 0 to 11
|
||||
dstDate = tmpOffset.getMonth() + 1;
|
||||
|
||||
// Pad the month as needed
|
||||
if (dstDate < 10) dstDate = "0" + dstDate;
|
||||
|
||||
// Add the day and year
|
||||
dstDate = year + '-' + dstDate + '-' + tmpOffset.getDate() + 'T';
|
||||
|
||||
// Capture the time stamp
|
||||
tmpDate = new Date(Date.UTC(year, month,
|
||||
day-1, 0, minutes-1, 0, 0));
|
||||
dstDate += tmpDate.toTimeString().split(' ')[0] + 'Z';
|
||||
return dstDate;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
jQuery(document).ready(function () {
|
||||
$(document).ready(function () {
|
||||
// Set focus on correct field
|
||||
<?php if ($focus_element) { ?>jQuery('#<?php echo $focus_element; ?>').focus(); <?php } ?> // Warning to use this only on visible element
|
||||
// Detect and save TZ and DST
|
||||
var rightNow = new Date();
|
||||
var jan1 = new Date(rightNow.getFullYear(), 0, 1, 0, 0, 0, 0);
|
||||
var temp = jan1.toGMTString();
|
||||
var jan2 = new Date(temp.substring(0, temp.lastIndexOf(" ")-1));
|
||||
var std_time_offset = (jan1 - jan2) / (1000 * 60 * 60);
|
||||
var june1 = new Date(rightNow.getFullYear(), 6, 1, 0, 0, 0, 0);
|
||||
temp = june1.toGMTString();
|
||||
var june2 = new Date(temp.substring(0, temp.lastIndexOf(" ")-1));
|
||||
var daylight_time_offset = (june1 - june2) / (1000 * 60 * 60);
|
||||
var dst;
|
||||
if (std_time_offset == daylight_time_offset) {
|
||||
dst = "0"; // daylight savings time is NOT observed
|
||||
} else {
|
||||
dst = "1"; // daylight savings time is observed
|
||||
}
|
||||
var dst_first=DisplayDstSwitchDates('first');
|
||||
var dst_second=DisplayDstSwitchDates('second');
|
||||
//alert(dst);
|
||||
jQuery('#tz').val(std_time_offset); // returns TZ
|
||||
jQuery('#dst_observed').val(dst); // returns if DST is observed on summer
|
||||
jQuery('#dst_first').val(dst_first); // returns DST first switch in year
|
||||
jQuery('#dst_second').val(dst_second); // returns DST second switch in year
|
||||
// Detect and save screen resolution
|
||||
jQuery('#screenwidth').val(jQuery(window).width()); // returns width of browser viewport
|
||||
jQuery('#screenheight').val(jQuery(window).height()); // returns width of browser viewport
|
||||
<?php if ($focus_element) { ?>$('#<?php echo $focus_element; ?>').focus(); <?php } ?> // Warning to use this only on visible element
|
||||
});
|
||||
</script>
|
||||
|
||||
@@ -217,12 +89,20 @@ jQuery(document).ready(function () {
|
||||
|
||||
<div id="parameterBox">
|
||||
|
||||
<div id="logBox"><strong><label for="username"><?php echo $langs->trans('Login'); ?></label></strong><input type="text" id="username" name="username" class="flat" size="15" maxlength="40" value="<?php echo GETPOST('username')?GETPOST('username'):$login; ?>" tabindex="1" /></div>
|
||||
<div id="passBox"><strong><label for="password"><?php echo $langs->trans('Password'); ?></label></strong><input id="password" name="password" class="flat" type="password" size="15" maxlength="30" value="<?php echo $password; ?>" tabindex="2" /></div>
|
||||
<div id="logBox"><strong><label for="username"><?php echo $langs->trans('Login'); ?></label></strong><input type="text" id="username" name="username" class="flat" size="15" maxlength="40" value="<?php echo dol_escape_htmltag($login); ?>" tabindex="1" /></div>
|
||||
<div id="passBox"><strong><label for="password"><?php echo $langs->trans('Password'); ?></label></strong><input id="password" name="password" class="flat" type="password" size="15" maxlength="30" value="<?php echo dol_escape_htmltag($password); ?>" tabindex="2" /></div>
|
||||
|
||||
<?php if ($select_entity) { ?>
|
||||
<div><strong><?php echo $langs->trans('Entity'); ?></strong><?php echo $select_entity; ?></div>
|
||||
<?php } ?>
|
||||
<?php
|
||||
if (! empty($hookmanager->resArray['options'])) {
|
||||
foreach ($hookmanager->resArray['options'] as $format => $option)
|
||||
{
|
||||
if ($format == 'div') {
|
||||
echo '<!-- Option by hook -->';
|
||||
echo $option;
|
||||
}
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
||||
<?php if ($captcha) { ?>
|
||||
<div class="captchaBox">
|
||||
@@ -309,4 +189,4 @@ jQuery(document).ready(function () {
|
||||
</body>
|
||||
</html>
|
||||
|
||||
<!-- END PHP TEMPLATE -->
|
||||
<!-- END PHP TEMPLATE -->
|
||||
|
||||
@@ -35,10 +35,12 @@ print '<!-- Includes for JQuery (Ajax library) -->'."\n";
|
||||
if (constant('JS_JQUERY_UI')) print '<link rel="stylesheet" type="text/css" href="'.JS_JQUERY_UI.'css/'.$jquerytheme.'/jquery-ui.min.css" />'."\n"; // JQuery
|
||||
else print '<link rel="stylesheet" type="text/css" href="'.DOL_URL_ROOT.'/includes/jquery/css/'.$jquerytheme.'/jquery-ui-latest.custom.css" />'."\n"; // JQuery
|
||||
// JQuery. Must be before other includes
|
||||
$ext='.js';
|
||||
if (isset($conf->global->MAIN_OPTIMIZE_SPEED) && ($conf->global->MAIN_OPTIMIZE_SPEED & 0x01)) $ext='.jgz';
|
||||
print '<!-- Includes JS for JQuery -->'."\n";
|
||||
if (constant('JS_JQUERY')) print '<script type="text/javascript" src="'.JS_JQUERY.'jquery.min.js"></script>'."\n";
|
||||
else print '<script type="text/javascript" src="'.DOL_URL_ROOT.'/includes/jquery/js/jquery-latest.min'.$ext.'"></script>'."\n";
|
||||
print '<link rel="stylesheet" type="text/css" href="'.$conf_css.'" />
|
||||
print '<link rel="stylesheet" type="text/css" href="'.dol_escape_htmltag($conf_css).'" />
|
||||
<style type="text/css">
|
||||
<!--
|
||||
#login {
|
||||
@@ -72,11 +74,17 @@ print '<!-- HTTP_USER_AGENT = '.$_SERVER['HTTP_USER_AGENT'].' -->
|
||||
<div id="parameterBox">
|
||||
<div id="logBox"><strong><label for="username"><?php echo $langs->trans('Login'); ?></label></strong><input type="text" <?php echo $disabled; ?> id="username" name="username" class="flat" size="15" maxlength="25" value="<?php echo $login; ?>" tabindex="1" /></div>
|
||||
|
||||
<?php if ($select_entity) { ?>
|
||||
<div><?php echo $langs->trans('Entity'); ?>
|
||||
<?php echo $select_entity; ?>
|
||||
</div>
|
||||
<?php } ?>
|
||||
<?php
|
||||
if (! empty($hookmanager->resArray['options'])) {
|
||||
foreach ($hookmanager->resArray['options'] as $format => $option)
|
||||
{
|
||||
if ($format == 'div') {
|
||||
echo '<!-- Option by hook -->';
|
||||
echo $option;
|
||||
}
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
||||
<?php if ($captcha) { ?>
|
||||
<div class="captchaBox">
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
* Copyright (C) 2005-2012 Regis Houssin <regis@dolibarr.fr>
|
||||
* Copyright (C) 2005 Lionel Cousteix <etm_ltd@tiscali.co.uk>
|
||||
* Copyright (C) 2011 Herve Prot <herve.prot@symeos.com>
|
||||
* Copyright (C) 2012 Juanjo Menent <jmenent@2byte.es>
|
||||
*
|
||||
* 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
|
||||
@@ -886,7 +887,7 @@ else
|
||||
$result=$ldap->connect_bind();
|
||||
if ($result > 0)
|
||||
{
|
||||
$userSearchFilter = '('.$conf->global->LDAP_FILTER_CONNECTION.'('.$this->getUserIdentifier().'='.$fuser->login.'))';
|
||||
$userSearchFilter = '('.$conf->global->LDAP_FILTER_CONNECTION.'('.$ldap->getUserIdentifier().'='.$fuser->login.'))';
|
||||
$entries = $ldap->fetch($fuser->login,$userSearchFilter);
|
||||
if (! $entries)
|
||||
{
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
/* Copyright (C) 2007-2011 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2008-2011 Regis Houssin <regis@dolibarr.fr>
|
||||
* Copyright (C) 2008-2011 Juanjo Menent <jmenent@2byte.es>
|
||||
/* Copyright (C) 2007-2011 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2008-2012 Regis Houssin <regis@dolibarr.fr>
|
||||
* Copyright (C) 2008-2011 Juanjo Menent <jmenent@2byte.es>
|
||||
*
|
||||
* 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
|
||||
@@ -42,7 +42,7 @@ if ($conf->global->MAIN_SECURITY_DISABLEFORGETPASSLINK)
|
||||
exit;
|
||||
}
|
||||
|
||||
$action=GETPOST('action');
|
||||
$action=GETPOST('action', 'alpha');
|
||||
$mode=$dolibarr_main_authentication;
|
||||
if (! $mode) $mode='http';
|
||||
|
||||
@@ -50,6 +50,14 @@ $username = GETPOST('username');
|
||||
$passwordmd5 = GETPOST('passwordmd5');
|
||||
$conf->entity = (GETPOST('entity') ? GETPOST('entity') : 1);
|
||||
|
||||
// Instantiate hooks of thirdparty module only if not already define
|
||||
if (! is_object($hookmanager))
|
||||
{
|
||||
include_once DOL_DOCUMENT_ROOT.'/core/class/hookmanager.class.php';
|
||||
$hookmanager=new HookManager($db);
|
||||
}
|
||||
$hookmanager->initHooks(array('passwordforgottenpage'));
|
||||
|
||||
|
||||
/**
|
||||
* Actions
|
||||
@@ -167,6 +175,9 @@ else
|
||||
$conf->css = "/theme/".$conf->theme."/style.css.php?lang=".$langs->defaultlang;
|
||||
$conf_css = DOL_URL_ROOT.$conf->css;
|
||||
|
||||
$jquerytheme = 'smoothness';
|
||||
if (! empty($conf->global->MAIN_USE_JQUERY_THEME)) $jquerytheme = $conf->global->MAIN_USE_JQUERY_THEME;
|
||||
|
||||
if (file_exists(DOL_DOCUMENT_ROOT.'/theme/'.$conf->theme.'/img/login_background.png'))
|
||||
{
|
||||
$login_background = DOL_URL_ROOT.'/theme/'.$conf->theme.'/img/login_background.png';
|
||||
@@ -204,31 +215,6 @@ elseif (! empty($mysoc->logo_small) && is_readable($conf->mycompany->dir_output.
|
||||
$urllogo=DOL_URL_ROOT.'/theme/dolibarr_logo.png';
|
||||
}
|
||||
|
||||
// Entity combobox
|
||||
$select_entity='';
|
||||
if (! empty($conf->multicompany->enabled) && empty($conf->global->MULTICOMPANY_HIDE_LOGIN_COMBOBOX) && ! $disabled)
|
||||
{
|
||||
$rowspan++;
|
||||
$lastuser='';
|
||||
$lastentity = GETPOST('entity');
|
||||
|
||||
if (! empty($conf->global->MULTICOMPANY_COOKIE_ENABLED))
|
||||
{
|
||||
$prefix=dol_getprefix();
|
||||
$entityCookieName = 'DOLENTITYID_'.$prefix;
|
||||
if (isset($_COOKIE[$entityCookieName]))
|
||||
{
|
||||
include_once(DOL_DOCUMENT_ROOT . "/core/class/cookie.class.php");
|
||||
$lastuser = ''; $lastentity = '';
|
||||
$entityCookie = new DolCookie($conf->file->cookie_cryptkey);
|
||||
$cookieValue = $entityCookie->_getCookie($entityCookieName);
|
||||
list($lastuser, $lastentity) = explode('|', $cookieValue);
|
||||
}
|
||||
}
|
||||
|
||||
$select_entity = $mc->select_entities($lastentity, 'entity', ' tabindex="2"');
|
||||
}
|
||||
|
||||
// Security graphical code
|
||||
if (function_exists("imagecreatefrompng") && ! $disabled)
|
||||
{
|
||||
@@ -236,6 +222,11 @@ if (function_exists("imagecreatefrompng") && ! $disabled)
|
||||
$captcha_refresh = img_picto($langs->trans("Refresh"),'refresh','id="captcha_refresh_img"');
|
||||
}
|
||||
|
||||
include($template_dir.'passwordforgotten.tpl.php'); // To use native PHP
|
||||
// Execute hook getPasswordForgottenPageOptions
|
||||
// Should be an array with differents options in $hookmanager->resArray
|
||||
$parameters=array('entity' => GETPOST('entity','int'));
|
||||
$hookmanager->executeHooks('getPasswordForgottenPageOptions',$parameters); // Note that $action and $object may have been modified by some hooks
|
||||
|
||||
include $template_dir.'passwordforgotten.tpl.php'; // To use native PHP
|
||||
|
||||
?>
|
||||
@@ -179,9 +179,9 @@ function getUser($authentication,$id,$ref='',$ref_ext='')
|
||||
$fuser->getrights();
|
||||
|
||||
if ($fuser->rights->user->user->lire
|
||||
|| ($fuser->rights->user->self->creer && $id && $id=$fuser->id)
|
||||
|| ($fuser->rights->user->self->creer && $ref && $ref=$fuser->login)
|
||||
|| ($fuser->rights->user->self->creer && $ref_ext && $ref_ext=$fuser->ref_ext))
|
||||
|| ($fuser->rights->user->self->creer && $id && $id==$fuser->id)
|
||||
|| ($fuser->rights->user->self->creer && $ref && $ref==$fuser->login)
|
||||
|| ($fuser->rights->user->self->creer && $ref_ext && $ref_ext==$fuser->ref_ext))
|
||||
{
|
||||
$user=new User($db);
|
||||
$result=$user->fetch($id,$ref,$ref_ext);
|
||||
|
||||
@@ -150,6 +150,15 @@ class PricesTest extends PHPUnit_Framework_TestCase
|
||||
print __METHOD__." value8=1.36 result8=".$result1[8]."\n";
|
||||
$this->assertEquals(1.36,$result1[8]);
|
||||
|
||||
$result2=calcul_price_total(10, 10, 0, 10, 1.4, 0, 0, 'HT', 0); // 10 * 10 HT - 0% discount with 10% vat and 1.4% localtax1, 0% localtax2
|
||||
|
||||
print __METHOD__." value0=100 result0=".$result2[0]."\n";
|
||||
$this->assertEquals(100,$result2[0]);
|
||||
print __METHOD__." value1=10 result1=".$result2[1]."\n";
|
||||
$this->assertEquals(10,$result2[1]);
|
||||
print __METHOD__." value2=111.4 result2=".$result2[2]."\n";
|
||||
$this->assertEquals(111.4,$result2[2]);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user