Merge branch '3.2' of https://github.com/Dolibarr/dolibarr.git into 3.2
This commit is contained in:
commit
e5c2d07c53
@ -51,6 +51,7 @@ Copyright (C) 2012
|
|||||||
- Juanjo Menent <jmenent@2byte.es>
|
- Juanjo Menent <jmenent@2byte.es>
|
||||||
- Philippe Grand <philippe.grand@atoo-net.com>
|
- Philippe Grand <philippe.grand@atoo-net.com>
|
||||||
- Jean Heimburger <jean@tiaris.info>
|
- Jean Heimburger <jean@tiaris.info>
|
||||||
|
- Marcos García <marcosgdf@gmail.com>
|
||||||
|
|
||||||
Copyright (C) 2011
|
Copyright (C) 2011
|
||||||
- Laurent Destailleur <eldy@users.sourceforge.net>
|
- Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
|
|||||||
13
ChangeLog
13
ChangeLog
@ -18,8 +18,17 @@ English Dolibarr ChangeLog
|
|||||||
- Fix: Allows to use a comma decimal separator in supplier invoices payments.
|
- Fix: Allows to use a comma decimal separator in supplier invoices payments.
|
||||||
- Fix: Translation for tr_TR, es_ES, pt_BR.
|
- Fix: Translation for tr_TR, es_ES, pt_BR.
|
||||||
- Fix: Products with no prices not visible.
|
- Fix: Products with no prices not visible.
|
||||||
|
- Fix: Access to product card created with very old version of Dolibarr.
|
||||||
|
- Fix: Delete temporary files after validating an invoice.
|
||||||
|
- Fix: preview of supplier order and invoice template.
|
||||||
|
- Fix: [ bug #485 ] Configurated amount for public auto-subscription form is not taken into account
|
||||||
|
- Fix: Average amount graphs weren't comparing the previous year stats
|
||||||
|
- Fix: Closed project didn't show the new status unless the page was refreshed
|
||||||
|
- Fix: Files were not being uploaded to a project's task
|
||||||
|
- Fix: [ bug #503 ] Unable to delete linked file to a deposit
|
||||||
|
- Fix: [ bug #501 ] Error while trying to modify an user
|
||||||
|
- 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 *****
|
***** ChangeLog for 3.2.0 compared to 3.1.3 *****
|
||||||
WARNING: PHP lower than 5.x are no more supported.
|
WARNING: PHP lower than 5.x are no more supported.
|
||||||
|
|||||||
@ -4,7 +4,7 @@
|
|||||||
<CompanyName />
|
<CompanyName />
|
||||||
<Program_Info>
|
<Program_Info>
|
||||||
<Program_Name>DoliWamp</Program_Name>
|
<Program_Name>DoliWamp</Program_Name>
|
||||||
<Program_Version>3.2..0</Program_Version>
|
<Program_Version>3.2.1</Program_Version>
|
||||||
<Program_Release_Month>05</Program_Release_Month>
|
<Program_Release_Month>05</Program_Release_Month>
|
||||||
<Program_Release_Day>10</Program_Release_Day>
|
<Program_Release_Day>10</Program_Release_Day>
|
||||||
<Program_Release_Year>2012</Program_Release_Year>
|
<Program_Release_Year>2012</Program_Release_Year>
|
||||||
|
|||||||
@ -4,7 +4,7 @@
|
|||||||
<CompanyName />
|
<CompanyName />
|
||||||
<Program_Info>
|
<Program_Info>
|
||||||
<Program_Name>Dolibarr</Program_Name>
|
<Program_Name>Dolibarr</Program_Name>
|
||||||
<Program_Version>3.2.0</Program_Version>
|
<Program_Version>3.2.1</Program_Version>
|
||||||
<Program_Release_Month>05</Program_Release_Month>
|
<Program_Release_Month>05</Program_Release_Month>
|
||||||
<Program_Release_Day>10</Program_Release_Day>
|
<Program_Release_Day>10</Program_Release_Day>
|
||||||
<Program_Release_Year>2012</Program_Release_Year>
|
<Program_Release_Year>2012</Program_Release_Year>
|
||||||
|
|||||||
@ -34,9 +34,9 @@
|
|||||||
</Company_Info>
|
</Company_Info>
|
||||||
<Program_Info>
|
<Program_Info>
|
||||||
<Program_Name>Dolibarr</Program_Name>
|
<Program_Name>Dolibarr</Program_Name>
|
||||||
<Program_Version>3.2.0</Program_Version>
|
<Program_Version>3.2.1</Program_Version>
|
||||||
<Program_Release_Month>06</Program_Release_Month>
|
<Program_Release_Month>08</Program_Release_Month>
|
||||||
<Program_Release_Day>18</Program_Release_Day>
|
<Program_Release_Day>10</Program_Release_Day>
|
||||||
<Program_Release_Year>2012</Program_Release_Year>
|
<Program_Release_Year>2012</Program_Release_Year>
|
||||||
<Program_Cost_Dollars />
|
<Program_Cost_Dollars />
|
||||||
<Program_Cost_Other_Code />
|
<Program_Cost_Other_Code />
|
||||||
|
|||||||
@ -34,9 +34,9 @@
|
|||||||
</Company_Info>
|
</Company_Info>
|
||||||
<Program_Info>
|
<Program_Info>
|
||||||
<Program_Name>DoliWamp</Program_Name>
|
<Program_Name>DoliWamp</Program_Name>
|
||||||
<Program_Version>3.2.0</Program_Version>
|
<Program_Version>3.2.1</Program_Version>
|
||||||
<Program_Release_Month>06</Program_Release_Month>
|
<Program_Release_Month>08</Program_Release_Month>
|
||||||
<Program_Release_Day>18</Program_Release_Day>
|
<Program_Release_Day>10</Program_Release_Day>
|
||||||
<Program_Release_Year>2012</Program_Release_Year>
|
<Program_Release_Year>2012</Program_Release_Year>
|
||||||
<Program_Cost_Dollars />
|
<Program_Cost_Dollars />
|
||||||
<Program_Cost_Other_Code />
|
<Program_Cost_Other_Code />
|
||||||
|
|||||||
@ -707,6 +707,10 @@ class Adherent extends CommonObject
|
|||||||
dol_syslog(get_class($this)."::delete sql=".$sql);
|
dol_syslog(get_class($this)."::delete sql=".$sql);
|
||||||
$resql=$this->db->query($sql);
|
$resql=$this->db->query($sql);
|
||||||
if ($resql)
|
if ($resql)
|
||||||
|
{
|
||||||
|
// Remove linked user
|
||||||
|
$ret=$this->setUserId(0);
|
||||||
|
if ($ret > 0)
|
||||||
{
|
{
|
||||||
$sql = "DELETE FROM ".MAIN_DB_PREFIX."adherent WHERE rowid = ".$rowid;
|
$sql = "DELETE FROM ".MAIN_DB_PREFIX."adherent WHERE rowid = ".$rowid;
|
||||||
dol_syslog(get_class($this)."::delete sql=".$sql);
|
dol_syslog(get_class($this)."::delete sql=".$sql);
|
||||||
@ -719,7 +723,9 @@ class Adherent extends CommonObject
|
|||||||
include_once(DOL_DOCUMENT_ROOT . "/core/class/interfaces.class.php");
|
include_once(DOL_DOCUMENT_ROOT . "/core/class/interfaces.class.php");
|
||||||
$interface=new Interfaces($this->db);
|
$interface=new Interfaces($this->db);
|
||||||
$result=$interface->run_triggers('MEMBER_DELETE',$this,$user,$langs,$conf);
|
$result=$interface->run_triggers('MEMBER_DELETE',$this,$user,$langs,$conf);
|
||||||
if ($result < 0) { $error++; $this->errors=$interface->errors; }
|
if ($result < 0) {
|
||||||
|
$error++; $this->errors=$interface->errors;
|
||||||
|
}
|
||||||
// Fin appel triggers
|
// Fin appel triggers
|
||||||
|
|
||||||
$this->db->commit();
|
$this->db->commit();
|
||||||
@ -739,6 +745,7 @@ class Adherent extends CommonObject
|
|||||||
return -3;
|
return -3;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$this->error=$this->db->error();
|
$this->error=$this->db->error();
|
||||||
|
|||||||
@ -247,7 +247,7 @@ if ($resql)
|
|||||||
$statictype->libelle=$obj->libelle;
|
$statictype->libelle=$obj->libelle;
|
||||||
print '<td>'.$staticmember->getNomUrl(1,24).'</td>';
|
print '<td>'.$staticmember->getNomUrl(1,24).'</td>';
|
||||||
print '<td>'.$statictype->getNomUrl(1,16).'</td>';
|
print '<td>'.$statictype->getNomUrl(1,16).'</td>';
|
||||||
print '<td>'.dol_print_date($db->jdate($obj->date_end),'dayhour').'</td>';
|
print '<td>'.dol_print_date($db->jdate($obj->datem),'dayhour').'</td>';
|
||||||
print '<td align="right">'.$staticmember->LibStatut($obj->statut,($obj->cotisation=='yes'?1:0),$db->jdate($obj->date_end_subscription),5).'</td>';
|
print '<td align="right">'.$staticmember->LibStatut($obj->statut,($obj->cotisation=='yes'?1:0),$db->jdate($obj->date_end_subscription),5).'</td>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
$i++;
|
$i++;
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
<?php
|
<?php
|
||||||
/* Copyright (C) 2003-2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
/* Copyright (C) 2003-2004 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-2009 Regis Houssin <regis@dolibarr.fr>
|
* Copyright (C) 2005-2012 Regis Houssin <regis@dolibarr.fr>
|
||||||
* Copyright (C) 2011 Juanjo Menent <jmenent@2byte.es>
|
* Copyright (C) 2011 Juanjo Menent <jmenent@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
|
||||||
@ -112,7 +112,7 @@ $dirbarcode=array_merge(array("/core/modules/barcode/"),$conf->barcode_modules);
|
|||||||
|
|
||||||
foreach($dirbarcode as $reldir)
|
foreach($dirbarcode as $reldir)
|
||||||
{
|
{
|
||||||
$dir=dol_buildpath($reldir,0);
|
$dir=dol_buildpath($reldir);
|
||||||
$newdir=dol_osencode($dir);
|
$newdir=dol_osencode($dir);
|
||||||
|
|
||||||
// Check if directory exists (we do not use dol_is_dir to avoid loading files.lib.php)
|
// Check if directory exists (we do not use dol_is_dir to avoid loading files.lib.php)
|
||||||
|
|||||||
@ -158,7 +158,7 @@ if ($what == 'mysql')
|
|||||||
if (! empty($dolibarr_main_db_pass))
|
if (! empty($dolibarr_main_db_pass))
|
||||||
{
|
{
|
||||||
$paramcrypted.=' -p"'.preg_replace('/./i','*',$dolibarr_main_db_pass).'"';
|
$paramcrypted.=' -p"'.preg_replace('/./i','*',$dolibarr_main_db_pass).'"';
|
||||||
$paramclear.=' -p"'.str_replace('"','\"',$dolibarr_main_db_pass).'"';
|
$paramclear.=' -p"'.str_replace(array('"','`'),array('\"','\`'),$dolibarr_main_db_pass).'"';
|
||||||
}
|
}
|
||||||
|
|
||||||
print '<b>'.$langs->trans("RunCommandSummary").':</b><br>'."\n";
|
print '<b>'.$langs->trans("RunCommandSummary").':</b><br>'."\n";
|
||||||
|
|||||||
@ -447,7 +447,7 @@ if ($action == 'create')
|
|||||||
print '<tr><td>'.$langs->trans("Title").'</td><td><input type="text" name="label" size="60" value="'.GETPOST('label').'"></td></tr>';
|
print '<tr><td>'.$langs->trans("Title").'</td><td><input type="text" name="label" size="60" value="'.GETPOST('label').'"></td></tr>';
|
||||||
|
|
||||||
// Full day
|
// Full day
|
||||||
print '<tr><td>'.$langs->trans("EventOnFullDay").'</td><td><input type="checkbox" id="fullday" name="fullday" '.(GETPOST('fullday')?' checked="checked"':'').'></td></tr>';
|
print '<tr><td class="fieldrequired">'.$langs->trans("EventOnFullDay").'</td><td><input type="checkbox" id="fullday" name="fullday" '.(GETPOST('fullday')?' checked="checked"':'').'></td></tr>';
|
||||||
|
|
||||||
// Date start
|
// Date start
|
||||||
$datep=$actioncomm->datep;
|
$datep=$actioncomm->datep;
|
||||||
@ -687,7 +687,7 @@ if ($id)
|
|||||||
print '<tr><td>'.$langs->trans("Title").'</td><td colspan="3"><input type="text" name="label" size="50" value="'.$act->label.'"></td></tr>';
|
print '<tr><td>'.$langs->trans("Title").'</td><td colspan="3"><input type="text" name="label" size="50" value="'.$act->label.'"></td></tr>';
|
||||||
|
|
||||||
// Full day event
|
// Full day event
|
||||||
print '<tr><td>'.$langs->trans("EventOnFullDay").'</td><td colspan="3"><input type="checkbox" id="fullday" name="fullday" '.($act->fulldayevent?' checked="checked"':'').'></td></tr>';
|
print '<tr><td class="fieldrequired">'.$langs->trans("EventOnFullDay").'</td><td colspan="3"><input type="checkbox" id="fullday" name="fullday" '.($act->fulldayevent?' checked="checked"':'').'></td></tr>';
|
||||||
|
|
||||||
// Date start
|
// Date start
|
||||||
print '<tr><td nowrap="nowrap" class="fieldrequired">'.$langs->trans("DateActionStart").'</td><td colspan="3">';
|
print '<tr><td nowrap="nowrap" class="fieldrequired">'.$langs->trans("DateActionStart").'</td><td colspan="3">';
|
||||||
|
|||||||
@ -744,11 +744,13 @@ if (! is_array($theme_datacolor)) $theme_datacolor=array(array(120,130,150), arr
|
|||||||
if (empty($action) || $action == 'show_month') // View by month
|
if (empty($action) || $action == 'show_month') // View by month
|
||||||
{
|
{
|
||||||
$newparam=$param; // newparam is for birthday links
|
$newparam=$param; // newparam is for birthday links
|
||||||
|
$newparam=preg_replace('/showbirthday=/i','showbirthday_=',$newparam); // To avoid replacement when replace day= is done
|
||||||
$newparam=preg_replace('/action=show_month&?/i','',$newparam);
|
$newparam=preg_replace('/action=show_month&?/i','',$newparam);
|
||||||
$newparam=preg_replace('/action=show_week&?/i','',$newparam);
|
$newparam=preg_replace('/action=show_week&?/i','',$newparam);
|
||||||
$newparam=preg_replace('/day=[0-9][0-9]&?/i','',$newparam);
|
$newparam=preg_replace('/day=[0-9]+&?/i','',$newparam);
|
||||||
$newparam=preg_replace('/month=[0-9][0-9]&?/i','',$newparam);
|
$newparam=preg_replace('/month=[0-9]+&?/i','',$newparam);
|
||||||
$newparam=preg_replace('/year=[0-9]+&?/i','',$newparam);
|
$newparam=preg_replace('/year=[0-9]+&?/i','',$newparam);
|
||||||
|
$newparam=preg_replace('/showbirthday_=/i','showbirthday=',$newparam); // Restore correct parameter
|
||||||
echo '<table width="100%" class="nocellnopadd">';
|
echo '<table width="100%" class="nocellnopadd">';
|
||||||
echo ' <tr class="liste_titre">';
|
echo ' <tr class="liste_titre">';
|
||||||
$i=0;
|
$i=0;
|
||||||
@ -810,11 +812,13 @@ if (empty($action) || $action == 'show_month') // View by month
|
|||||||
elseif ($action == 'show_week') // View by week
|
elseif ($action == 'show_week') // View by week
|
||||||
{
|
{
|
||||||
$newparam=$param; // newparam is for birthday links
|
$newparam=$param; // newparam is for birthday links
|
||||||
|
$newparam=preg_replace('/showbirthday=/i','showbirthday_=',$newparam); // To avoid replacement when replace day= is done
|
||||||
$newparam=preg_replace('/action=show_month&?/i','',$newparam);
|
$newparam=preg_replace('/action=show_month&?/i','',$newparam);
|
||||||
$newparam=preg_replace('/action=show_week&?/i','',$newparam);
|
$newparam=preg_replace('/action=show_week&?/i','',$newparam);
|
||||||
$newparam=preg_replace('/day=[0-9][0-9]&?/i','',$newparam);
|
$newparam=preg_replace('/day=[0-9]+&?/i','',$newparam);
|
||||||
$newparam=preg_replace('/month=[0-9][0-9]&?/i','',$newparam);
|
$newparam=preg_replace('/month=[0-9]+&?/i','',$newparam);
|
||||||
$newparam=preg_replace('/year=[0-9]+&?/i','',$newparam);
|
$newparam=preg_replace('/year=[0-9]+&?/i','',$newparam);
|
||||||
|
$newparam=preg_replace('/showbirthday_=/i','showbirthday=',$newparam); // Restore correct parameter
|
||||||
echo '<table width="100%" class="nocellnopadd">';
|
echo '<table width="100%" class="nocellnopadd">';
|
||||||
echo ' <tr class="liste_titre">';
|
echo ' <tr class="liste_titre">';
|
||||||
$i=0;
|
$i=0;
|
||||||
@ -866,9 +870,6 @@ else // View by day
|
|||||||
$newparam=$param; // newparam is for birthday links
|
$newparam=$param; // newparam is for birthday links
|
||||||
$newparam=preg_replace('/action=show_month&?/i','',$newparam);
|
$newparam=preg_replace('/action=show_month&?/i','',$newparam);
|
||||||
$newparam=preg_replace('/action=show_week&?/i','',$newparam);
|
$newparam=preg_replace('/action=show_week&?/i','',$newparam);
|
||||||
$newparam=preg_replace('/day=[0-9][0-9]&?/i','',$newparam);
|
|
||||||
$newparam=preg_replace('/month=[0-9][0-9]&?/i','',$newparam);
|
|
||||||
$newparam=preg_replace('/year=[0-9]+&?/i','',$newparam);
|
|
||||||
// Code to show just one day
|
// Code to show just one day
|
||||||
$style='cal_current_month';
|
$style='cal_current_month';
|
||||||
$today=0;
|
$today=0;
|
||||||
|
|||||||
@ -1,7 +1,8 @@
|
|||||||
<?php
|
<?php
|
||||||
/* Copyright (C) 2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
/* Copyright (C) 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-2009 Regis Houssin <regis@dolibarr.fr>
|
* Copyright (C) 2005-2012 Regis Houssin <regis@dolibarr.fr>
|
||||||
|
* Copyright (C) 2012 Marcos García <marcosgdf@gmail.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
|
||||||
* 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
|
||||||
@ -66,7 +67,6 @@ $stats = new PropaleStats($db, $socid, $userid);
|
|||||||
|
|
||||||
// Build graphic number of object
|
// Build graphic number of object
|
||||||
$data = $stats->getNbByMonthWithPrevYear($endyear,$startyear);
|
$data = $stats->getNbByMonthWithPrevYear($endyear,$startyear);
|
||||||
//var_dump($data);
|
|
||||||
// $data = array(array('Lib',val1,val2,val3),...)
|
// $data = array(array('Lib',val1,val2,val3),...)
|
||||||
|
|
||||||
|
|
||||||
@ -110,7 +110,6 @@ if (! $mesg)
|
|||||||
|
|
||||||
// Build graphic amount of object
|
// Build graphic amount of object
|
||||||
$data = $stats->getAmountByMonthWithPrevYear($endyear,$startyear);
|
$data = $stats->getAmountByMonthWithPrevYear($endyear,$startyear);
|
||||||
//var_dump($data);
|
|
||||||
// $data = array(array('Lib',val1,val2,val3),...)
|
// $data = array(array('Lib',val1,val2,val3),...)
|
||||||
|
|
||||||
if (!$user->rights->societe->client->voir || $user->societe_id)
|
if (!$user->rights->societe->client->voir || $user->societe_id)
|
||||||
@ -151,13 +150,7 @@ if (! $mesg)
|
|||||||
$px2->draw($filenameamount,$fileurlamount);
|
$px2->draw($filenameamount,$fileurlamount);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$data = $stats->getAverageByMonthWithPrevYear($endyear, $startyear);
|
||||||
$res = $stats->getAverageByMonth($year);
|
|
||||||
$data = array();
|
|
||||||
for ($i = 1 ; $i < 13 ; $i++)
|
|
||||||
{
|
|
||||||
$data[$i-1] = array(ucfirst(dol_substr(dol_print_date(dol_mktime(12,0,0,$i,1,$year),"%b"),0,3)), $res[$i]);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!$user->rights->societe->client->voir || $user->societe_id)
|
if (!$user->rights->societe->client->voir || $user->societe_id)
|
||||||
{
|
{
|
||||||
@ -177,8 +170,7 @@ $mesg = $px3->isGraphKo();
|
|||||||
if (! $mesg)
|
if (! $mesg)
|
||||||
{
|
{
|
||||||
$px3->SetData($data);
|
$px3->SetData($data);
|
||||||
//$i=$startyear;$legend=array();
|
$i=$startyear;$legend=array();
|
||||||
$i=$endyear;$legend=array();
|
|
||||||
while ($i <= $endyear)
|
while ($i <= $endyear)
|
||||||
{
|
{
|
||||||
$legend[]=$i;
|
$legend[]=$i;
|
||||||
|
|||||||
@ -1,7 +1,8 @@
|
|||||||
<?php
|
<?php
|
||||||
/* Copyright (C) 2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
/* Copyright (C) 2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||||
* Copyright (c) 2005 Laurent Destailleur <eldy@users.sourceforge.net>
|
* Copyright (c) 2005 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
* Copyright (C) 2005-2009 Regis Houssin <regis@dolibarr.fr>
|
* Copyright (C) 2005-2012 Regis Houssin <regis@dolibarr.fr>
|
||||||
|
* Copyright (C) 2012 Marcos García <marcosgdf@gmail.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
|
||||||
* 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
|
||||||
@ -73,7 +74,7 @@ class CommandeStats extends Stats
|
|||||||
$this->from = MAIN_DB_PREFIX.$object->table_element." as c";
|
$this->from = MAIN_DB_PREFIX.$object->table_element." as c";
|
||||||
$this->from.= ", ".MAIN_DB_PREFIX."societe as s";
|
$this->from.= ", ".MAIN_DB_PREFIX."societe as s";
|
||||||
$this->field='total_ht';
|
$this->field='total_ht';
|
||||||
$this->where.= " c.fk_statut > 0"; // Not draft and not cancelled
|
$this->where.= " c.fk_statut > 2"; // Only approved & ordered
|
||||||
}
|
}
|
||||||
$this->where.= " AND c.fk_soc = s.rowid AND c.entity = ".$conf->entity;
|
$this->where.= " AND c.fk_soc = s.rowid AND c.entity = ".$conf->entity;
|
||||||
|
|
||||||
|
|||||||
@ -1,6 +1,8 @@
|
|||||||
<?php
|
<?php
|
||||||
/* Copyright (C) 2001-2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
/* Copyright (C) 2001-2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||||
* Copyright (c) 2004-2012 Laurent Destailleur <eldy@users.sourceforge.net>
|
* Copyright (c) 2004-2012 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
|
* Copyright (C) 2005-2012 Regis Houssin <regis@dolibarr.fr>
|
||||||
|
* Copyright (C) 2012 Marcos García <marcosgdf@gmail.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
|
||||||
* 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
|
||||||
@ -168,12 +170,7 @@ if (! $mesg)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
$res = $stats->getAverageByMonth($year);
|
$data = $stats->getAverageByMonthWithPrevYear($endyear, $startyear);
|
||||||
$data = array();
|
|
||||||
for ($i = 1 ; $i < 13 ; $i++)
|
|
||||||
{
|
|
||||||
$data[$i-1] = array(ucfirst(dol_substr(dol_print_date(dol_mktime(12,0,0,$i,1,$year),"%b"),0,3)), $res[$i]);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!$user->rights->societe->client->voir || $user->societe_id)
|
if (!$user->rights->societe->client->voir || $user->societe_id)
|
||||||
{
|
{
|
||||||
@ -193,8 +190,7 @@ $mesg = $px3->isGraphKo();
|
|||||||
if (! $mesg)
|
if (! $mesg)
|
||||||
{
|
{
|
||||||
$px3->SetData($data);
|
$px3->SetData($data);
|
||||||
//$i=$startyear;$legend=array();
|
$i=$startyear;$legend=array();
|
||||||
$i=$endyear;$legend=array();
|
|
||||||
while ($i <= $endyear)
|
while ($i <= $endyear)
|
||||||
{
|
{
|
||||||
$legend[]=$i;
|
$legend[]=$i;
|
||||||
|
|||||||
@ -48,6 +48,7 @@ $fieldtype = (! empty($ref) ? 'ref' :'rowid');
|
|||||||
if ($user->societe_id) $socid=$user->societe_id;
|
if ($user->societe_id) $socid=$user->societe_id;
|
||||||
$result=restrictedArea($user,'banque',$fieldvalue,'bank_account','','',$fieldtype);
|
$result=restrictedArea($user,'banque',$fieldvalue,'bank_account','','',$fieldtype);
|
||||||
|
|
||||||
|
$paiementtype=GETPOST('paiementtype','alpha',3);
|
||||||
$req_nb=GETPOST("req_nb",'',3);
|
$req_nb=GETPOST("req_nb",'',3);
|
||||||
$thirdparty=GETPOST("thirdparty",'',3);
|
$thirdparty=GETPOST("thirdparty",'',3);
|
||||||
$vline=GETPOST("vline");
|
$vline=GETPOST("vline");
|
||||||
@ -203,10 +204,10 @@ if ($id > 0 || ! empty($ref))
|
|||||||
$param.='&thirdparty='.urlencode($thirdparty);
|
$param.='&thirdparty='.urlencode($thirdparty);
|
||||||
$mode_search = 1;
|
$mode_search = 1;
|
||||||
}
|
}
|
||||||
if (GETPOST("paiementtype"))
|
if ($paiementtype)
|
||||||
{
|
{
|
||||||
$sql_rech.=" AND b.fk_type = '".$db->escape(GETPOST("paiementtype"))."'";
|
$sql_rech.=" AND b.fk_type = '".$db->escape($paiementtype)."'";
|
||||||
$param.='&paiementtype='.urlencode(GETPOST("paiementtype"));
|
$param.='&paiementtype='.urlencode($paiementtype);
|
||||||
$mode_search = 1;
|
$mode_search = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -289,6 +290,7 @@ if ($id > 0 || ! empty($ref))
|
|||||||
if ($limitsql > $viewline) $navig.='<a href="account.php?'.$param.'&page='.($page+1).'">'.img_previous().'</a>';
|
if ($limitsql > $viewline) $navig.='<a href="account.php?'.$param.'&page='.($page+1).'">'.img_previous().'</a>';
|
||||||
$navig.= $langs->trans("Page")." "; // ' Page ';
|
$navig.= $langs->trans("Page")." "; // ' Page ';
|
||||||
$navig.='<input type="text" name="negpage" size="1" class="flat" value="'.($nbpage-$page).'">';
|
$navig.='<input type="text" name="negpage" size="1" class="flat" value="'.($nbpage-$page).'">';
|
||||||
|
$navig.='<input type="hidden" name="paiementtype" value="'.$paiementtype.'">';
|
||||||
$navig.='<input type="hidden" name="req_nb" value="'.$req_nb.'">';
|
$navig.='<input type="hidden" name="req_nb" value="'.$req_nb.'">';
|
||||||
$navig.='<input type="hidden" name="req_desc" value="'.GETPOST("req_desc").'">';
|
$navig.='<input type="hidden" name="req_desc" value="'.GETPOST("req_desc").'">';
|
||||||
$navig.='<input type="hidden" name="req_debit" value="'.GETPOST("req_debit").'">';
|
$navig.='<input type="hidden" name="req_debit" value="'.GETPOST("req_debit").'">';
|
||||||
@ -401,7 +403,7 @@ if ($id > 0 || ! empty($ref))
|
|||||||
print '<td>';
|
print '<td>';
|
||||||
//$filtertype=array('TIP'=>'TIP','PRE'=>'PRE',...)
|
//$filtertype=array('TIP'=>'TIP','PRE'=>'PRE',...)
|
||||||
$filtertype='';
|
$filtertype='';
|
||||||
print $form->select_types_paiements($_REQUEST['paiementtype'],'paiementtype',$filtertype,2,1,1,8);
|
print $form->select_types_paiements($paiementtype,'paiementtype',$filtertype,2,1,1,8);
|
||||||
print '</td>';
|
print '</td>';
|
||||||
print '<td><input type="text" class="flat" name="req_nb" value="'.$req_nb.'" size="2"></td>';
|
print '<td><input type="text" class="flat" name="req_nb" value="'.$req_nb.'" size="2"></td>';
|
||||||
print '<td><input type="text" class="flat" name="req_desc" value="'.GETPOST("req_desc").'" size="24"></td>';
|
print '<td><input type="text" class="flat" name="req_desc" value="'.GETPOST("req_desc").'" size="24"></td>';
|
||||||
|
|||||||
@ -1,6 +1,7 @@
|
|||||||
<?php
|
<?php
|
||||||
/* Copyright (C) 2003-2006 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
/* Copyright (C) 2003-2006 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||||
* Copyright (c) 2004-2012 Laurent Destailleur <eldy@users.sourceforge.net>
|
* Copyright (c) 2004-2012 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
|
* Copyright (C) 2012 Marcos García <marcosgdf@gmail.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
|
||||||
* 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
|
||||||
@ -137,12 +138,7 @@ if (! $mesg)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
$res = $stats->getAverageByMonth($year);
|
$data = $stats->getAverageByMonthWithPrevYear($endyear, $startyear);
|
||||||
$data = array();
|
|
||||||
for ($i = 1 ; $i < 13 ; $i++)
|
|
||||||
{
|
|
||||||
$data[$i-1] = array(ucfirst(dol_substr(dol_print_date(dol_mktime(12,0,0,$i,1,$year),"%b"),0,3)), $res[$i]);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!$user->rights->societe->client->voir || $user->societe_id)
|
if (!$user->rights->societe->client->voir || $user->societe_id)
|
||||||
{
|
{
|
||||||
@ -162,8 +158,7 @@ $mesg = $px3->isGraphKo();
|
|||||||
if (! $mesg)
|
if (! $mesg)
|
||||||
{
|
{
|
||||||
$px3->SetData($data);
|
$px3->SetData($data);
|
||||||
//$i=$startyear;$legend=array();
|
$i = $startyear;$legend=array();
|
||||||
$i=$endyear;$legend=array();
|
|
||||||
while ($i <= $endyear)
|
while ($i <= $endyear)
|
||||||
{
|
{
|
||||||
$legend[]=$i;
|
$legend[]=$i;
|
||||||
|
|||||||
@ -1,6 +1,7 @@
|
|||||||
<?php
|
<?php
|
||||||
/* Copyright (C) 2003-2006 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
/* Copyright (C) 2003-2006 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||||
* Copyright (c) 2004-2012 Laurent Destailleur <eldy@users.sourceforge.net>
|
* Copyright (c) 2004-2012 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
|
* Copyright (C) 2012 Marcos García <marcosgdf@gmail.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
|
||||||
* 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
|
||||||
@ -148,12 +149,7 @@ if (! $mesg)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
$res = $stats->getAverageByMonth($year);
|
$data = $stats->getAverageByMonthWithPrevYear($endyear, $startyear);
|
||||||
$data = array();
|
|
||||||
for ($i = 1 ; $i < 13 ; $i++)
|
|
||||||
{
|
|
||||||
$data[$i-1] = array(ucfirst(dol_substr(dol_print_date(dol_mktime(12,0,0,$i,1,$year),"%b"),0,3)), $res[$i]);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!$user->rights->societe->client->voir || $user->societe_id)
|
if (!$user->rights->societe->client->voir || $user->societe_id)
|
||||||
{
|
{
|
||||||
@ -173,8 +169,7 @@ $mesg = $px3->isGraphKo();
|
|||||||
if (! $mesg)
|
if (! $mesg)
|
||||||
{
|
{
|
||||||
$px3->SetData($data);
|
$px3->SetData($data);
|
||||||
//$i=$startyear;$legend=array();
|
$i = $startyear;$legend=array();
|
||||||
$i=$endyear;$legend=array();
|
|
||||||
while ($i <= $endyear)
|
while ($i <= $endyear)
|
||||||
{
|
{
|
||||||
$legend[]=$i;
|
$legend[]=$i;
|
||||||
|
|||||||
@ -87,16 +87,21 @@ report_header($nom,$nomlink,$period,$periodlink,$description,$builddate,$exportl
|
|||||||
$p = explode(":", $conf->global->MAIN_INFO_SOCIETE_PAYS);
|
$p = explode(":", $conf->global->MAIN_INFO_SOCIETE_PAYS);
|
||||||
$idpays = $p[0];
|
$idpays = $p[0];
|
||||||
|
|
||||||
$sql = "SELECT f.rowid, f.facnumber, f.type, f.datef, f.ref_client , fd.product_type, fd.total_ht, fd.total_tva, fd.tva_tx, fd.total_ttc,";
|
$sql = "SELECT f.rowid, f.facnumber, f.type, f.datef, f.ref_client,";
|
||||||
$sql.= " p.accountancy_code_sell, s.code_compta , ct.accountancy_code";
|
$sql.= " fd.product_type, fd.total_ht, fd.total_tva, fd.tva_tx, fd.total_ttc,";
|
||||||
|
$sql.= " s.rowid as socid, s.nom as name, s.code_compta, s.client,";
|
||||||
|
$sql.= " p.rowid as pid, p.ref as pref, p.accountancy_code_sell,";
|
||||||
|
$sql.= " ct.accountancy_code";
|
||||||
$sql.= " FROM ".MAIN_DB_PREFIX."facturedet fd";
|
$sql.= " FROM ".MAIN_DB_PREFIX."facturedet fd";
|
||||||
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."product p ON p.rowid = fd.fk_product";
|
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."product p ON p.rowid = fd.fk_product";
|
||||||
$sql.= " JOIN ".MAIN_DB_PREFIX."facture f ON f.rowid = fd.fk_facture";
|
$sql.= " JOIN ".MAIN_DB_PREFIX."facture f ON f.rowid = fd.fk_facture";
|
||||||
$sql.= " JOIN ".MAIN_DB_PREFIX."societe s ON s.rowid = f.fk_soc";
|
$sql.= " JOIN ".MAIN_DB_PREFIX."societe s ON s.rowid = f.fk_soc";
|
||||||
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."c_tva ct ON fd.tva_tx = ct.taux AND ct.fk_pays = '".$idpays."'";
|
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."c_tva ct ON fd.tva_tx = ct.taux AND ct.fk_pays = '".$idpays."'";
|
||||||
$sql.= " WHERE f.fk_statut > 0 AND f.entity = ".$conf->entity;
|
$sql.= " WHERE f.entity = ".$conf->entity;
|
||||||
|
$sql.= " AND f.fk_statut > 0";
|
||||||
|
$sql.= " AND fd.product_type IN (0,1)";
|
||||||
if ($date_start && $date_end) $sql .= " AND f.datef >= '".$db->idate($date_start)."' AND f.datef <= '".$db->idate($date_end)."'";
|
if ($date_start && $date_end) $sql .= " AND f.datef >= '".$db->idate($date_start)."' AND f.datef <= '".$db->idate($date_end)."'";
|
||||||
$sql .= " order by f.rowid";
|
$sql.= " ORDER BY f.rowid";
|
||||||
|
|
||||||
$result = $db->query($sql);
|
$result = $db->query($sql);
|
||||||
if ($result)
|
if ($result)
|
||||||
|
|||||||
@ -216,6 +216,21 @@ if ($action == 'builddoc' && $user->rights->banque->cheque)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Remove file in doc form
|
||||||
|
else if ($action == 'remove_file' && $user->rights->banque->cheque)
|
||||||
|
{
|
||||||
|
$remisecheque = new RemiseCheque($db);
|
||||||
|
if ($remisecheque->fetch($_GET["id"]) > 0)
|
||||||
|
{
|
||||||
|
require_once(DOL_DOCUMENT_ROOT."/core/lib/files.lib.php");
|
||||||
|
|
||||||
|
$langs->load("other");
|
||||||
|
|
||||||
|
$file=$dir.get_exdir($remisecheque->number,2,1) . GETPOST('file');
|
||||||
|
$ret=dol_delete_file($file);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* View
|
* View
|
||||||
|
|||||||
@ -69,7 +69,7 @@ class FormActions
|
|||||||
print '<script type="text/javascript">'."\n";
|
print '<script type="text/javascript">'."\n";
|
||||||
print 'jQuery(document).ready(function () {'."\n";
|
print 'jQuery(document).ready(function () {'."\n";
|
||||||
print 'jQuery("#select'.$htmlname.'").change(function() { select_status(document.'.$formname.'.status.value); });'."\n";
|
print 'jQuery("#select'.$htmlname.'").change(function() { select_status(document.'.$formname.'.status.value); });'."\n";
|
||||||
print 'jQuery("#val'.$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 'select_status(document.'.$formname.'.status.value);'."\n";
|
||||||
print '});'."\n";
|
print '});'."\n";
|
||||||
print 'function select_status(mypercentage) {'."\n";
|
print 'function select_status(mypercentage) {'."\n";
|
||||||
@ -78,7 +78,7 @@ class FormActions
|
|||||||
print 'if (mypercentage == -1) { document.'.$formname.'.percentageshown.disabled=true; jQuery(".hideifna").hide(); }'."\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 == 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 if (mypercentage == 100) { document.'.$formname.'.percentageshown.disabled=true; jQuery(".hideifna").show();}'."\n";
|
||||||
print 'else { document.'.$formname.'.percentageshown.disabled=false; }'."\n";
|
print 'else { document.'.$formname.'.percentageshown.disabled=false; jQuery(".hideifna").show();}'."\n";
|
||||||
print '}'."\n";
|
print '}'."\n";
|
||||||
print '</script>'."\n";
|
print '</script>'."\n";
|
||||||
print '<select '.($canedit?'':'disabled="disabled" ').'name="status" id="select'.$htmlname.'" class="flat">';
|
print '<select '.($canedit?'':'disabled="disabled" ').'name="status" id="select'.$htmlname.'" class="flat">';
|
||||||
|
|||||||
@ -1,6 +1,8 @@
|
|||||||
<?php
|
<?php
|
||||||
/* Copyright (C) 2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
/* Copyright (C) 2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||||
* Copyright (c) 2008-2012 Laurent Destailleur <eldy@users.sourceforge.net>
|
* Copyright (c) 2008-2012 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
|
* Copyright (C) 2012 Regis Houssin <regis@dolibarr.fr>
|
||||||
|
* Copyright (C) 2012 Marcos García <marcosgdf@gmail.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
|
||||||
* 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
|
||||||
@ -103,6 +105,42 @@ abstract class Stats
|
|||||||
return $data;
|
return $data;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Return average of entity by month for several years
|
||||||
|
*
|
||||||
|
* @param int $endyear Start year
|
||||||
|
* @param int $startyear End year
|
||||||
|
* @return array Array of values
|
||||||
|
*/
|
||||||
|
function getAverageByMonthWithPrevYear($endyear,$startyear)
|
||||||
|
{
|
||||||
|
if ($startyear > $endyear) return -1;
|
||||||
|
|
||||||
|
$datay=array();
|
||||||
|
|
||||||
|
$year=$startyear;
|
||||||
|
while($year <= $endyear)
|
||||||
|
{
|
||||||
|
$datay[$year] = $this->getAverageByMonth($year);
|
||||||
|
$year++;
|
||||||
|
}
|
||||||
|
|
||||||
|
$data = array();
|
||||||
|
|
||||||
|
for ($i = 0 ; $i < 12 ; $i++)
|
||||||
|
{
|
||||||
|
$data[$i][]=$datay[$endyear][$i][0];
|
||||||
|
$year=$startyear;
|
||||||
|
while($year <= $endyear)
|
||||||
|
{
|
||||||
|
$data[$i][]=$datay[$year][$i][1];
|
||||||
|
$year++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return $data;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return nb of elements by year
|
* Return nb of elements by year
|
||||||
@ -295,7 +333,16 @@ abstract class Stats
|
|||||||
$res[$i] = $result[$i] + 0;
|
$res[$i] = $result[$i] + 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
return $res;
|
$data = array();
|
||||||
|
|
||||||
|
for ($i = 1 ; $i < 13 ; $i++)
|
||||||
|
{
|
||||||
|
$month=dol_print_date(dol_mktime(12,0,0,$i,1,$year),"%b");
|
||||||
|
$month=dol_substr($month,0,3);
|
||||||
|
$data[$i-1] = array(ucfirst($month), $res[$i]);
|
||||||
|
}
|
||||||
|
|
||||||
|
return $data;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -232,8 +232,8 @@ function displayBox($selectedDate,$month,$year)
|
|||||||
|
|
||||||
// Sur click dans calendrier, appelle fonction dpClickDay
|
// Sur click dans calendrier, appelle fonction dpClickDay
|
||||||
echo "<TD class=\"".$dayclass."\"";
|
echo "<TD class=\"".$dayclass."\"";
|
||||||
echo " onMouseOver=\"dpHighlightDay(".$mydate["year"].",".dol_print_date($thedate,"%m").",".$mydate["mday"].",tradMonths)\"";
|
echo " onMouseOver=\"dpHighlightDay(".$mydate["year"].",parseInt('".dol_print_date($thedate,"%m")."',10),".$mydate["mday"].",tradMonths)\"";
|
||||||
echo " onClick=\"dpClickDay(".$mydate["year"].",".dol_print_date($thedate,"%m").",".$mydate["mday"].",'".$langs->trans("FormatDateShortJava")."')\"";
|
echo " onClick=\"dpClickDay(".$mydate["year"].",parseInt('".dol_print_date($thedate,"%m")."',10),".$mydate["mday"].",'".$langs->trans("FormatDateShortJava")."')\"";
|
||||||
echo ">".sprintf("%02s",$mydate["mday"])."</TD>";
|
echo ">".sprintf("%02s",$mydate["mday"])."</TD>";
|
||||||
$cols++;
|
$cols++;
|
||||||
|
|
||||||
|
|||||||
@ -253,7 +253,7 @@ function run_sql($sqlfile,$silent=1,$entity='',$usesavepoint=1,$handler='',$oker
|
|||||||
dol_syslog('Admin.lib::run_sql Request '.($i+1).' sql='.$newsql, LOG_DEBUG);
|
dol_syslog('Admin.lib::run_sql Request '.($i+1).' sql='.$newsql, LOG_DEBUG);
|
||||||
|
|
||||||
// Replace for encrypt data
|
// Replace for encrypt data
|
||||||
if (preg_match_all('/__ENCRYPT\(\'([^\,]+)\'\)__/i',$newsql,$reg))
|
if (preg_match_all('/__ENCRYPT\(\'([A-Za-z0-9_]+)\'\)__/i',$newsql,$reg))
|
||||||
{
|
{
|
||||||
$num=count($reg[0]);
|
$num=count($reg[0]);
|
||||||
|
|
||||||
@ -266,7 +266,7 @@ function run_sql($sqlfile,$silent=1,$entity='',$usesavepoint=1,$handler='',$oker
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Replace for decrypt data
|
// Replace for decrypt data
|
||||||
if (preg_match_all('/__DECRYPT\(\'([^\,]+)\'\)__/i',$newsql,$reg))
|
if (preg_match_all('/__DECRYPT\(\'([A-Za-z0-9_]+)\'\)__/i',$newsql,$reg))
|
||||||
{
|
{
|
||||||
$num=count($reg[0]);
|
$num=count($reg[0]);
|
||||||
|
|
||||||
|
|||||||
@ -62,7 +62,7 @@ abstract class DolibarrModules
|
|||||||
*/
|
*/
|
||||||
function _init($array_sql, $options='')
|
function _init($array_sql, $options='')
|
||||||
{
|
{
|
||||||
global $langs;
|
global $conf, $langs;
|
||||||
$err=0;
|
$err=0;
|
||||||
|
|
||||||
$this->db->begin();
|
$this->db->begin();
|
||||||
@ -113,6 +113,9 @@ abstract class DolibarrModules
|
|||||||
$sql=$val;
|
$sql=$val;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Add current entity id
|
||||||
|
$sql=str_replace('__ENTITY__', $conf->entity, $sql);
|
||||||
|
|
||||||
dol_syslog(get_class($this)."::_init ignoreerror=".$ignoreerror." sql=".$sql, LOG_DEBUG);
|
dol_syslog(get_class($this)."::_init ignoreerror=".$ignoreerror." sql=".$sql, LOG_DEBUG);
|
||||||
$result=$this->db->query($sql);
|
$result=$this->db->query($sql);
|
||||||
if (! $result)
|
if (! $result)
|
||||||
|
|||||||
@ -112,7 +112,14 @@ class modBarcode extends DolibarrModules
|
|||||||
// Permissions
|
// Permissions
|
||||||
$this->remove($options);
|
$this->remove($options);
|
||||||
|
|
||||||
$sql = array();
|
$sql = array(
|
||||||
|
array('sql'=>'INSERT INTO llx_c_barcode_type (code, libelle, coder, example, entity) VALUES ("EAN8", "EAN8", 0, "1234567", __ENTITY__)','ignoreerror'=>1),
|
||||||
|
array('sql'=>'INSERT INTO llx_c_barcode_type (code, libelle, coder, example, entity) VALUES ("EAN13", "EAN13", 0, "123456789012", __ENTITY__)','ignoreerror'=>1),
|
||||||
|
array('sql'=>'INSERT INTO llx_c_barcode_type (code, libelle, coder, example, entity) VALUES ("UPC", "UPC", 0, "123456789012", __ENTITY__)','ignoreerror'=>1),
|
||||||
|
array('sql'=>'INSERT INTO llx_c_barcode_type (code, libelle, coder, example, entity) VALUES ("ISBN", "ISBN", 0, "123456789", __ENTITY__)','ignoreerror'=>1),
|
||||||
|
array('sql'=>'INSERT INTO llx_c_barcode_type (code, libelle, coder, example, entity) VALUES ("C39", "Code 39", 0, "1234567890", __ENTITY__)','ignoreerror'=>1),
|
||||||
|
array('sql'=>'INSERT INTO llx_c_barcode_type (code, libelle, coder, example, entity) VALUES ("C128", "Code 128", 0, "ABCD1234567890", __ENTITY__)','ignoreerror'=>1)
|
||||||
|
);
|
||||||
|
|
||||||
return $this->_init($sql, $options);
|
return $this->_init($sql, $options);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -211,8 +211,8 @@ class modExpedition extends DolibarrModules
|
|||||||
$sql = array(
|
$sql = array(
|
||||||
"DELETE FROM ".MAIN_DB_PREFIX."document_model WHERE nom = '".$this->const[0][2]."' AND entity = ".$conf->entity,
|
"DELETE FROM ".MAIN_DB_PREFIX."document_model WHERE nom = '".$this->const[0][2]."' AND entity = ".$conf->entity,
|
||||||
"INSERT INTO ".MAIN_DB_PREFIX."document_model (nom, type, entity) VALUES('".$this->const[0][2]."','shipping',".$conf->entity.")",
|
"INSERT INTO ".MAIN_DB_PREFIX."document_model (nom, type, entity) VALUES('".$this->const[0][2]."','shipping',".$conf->entity.")",
|
||||||
"DELETE FROM ".MAIN_DB_PREFIX."document_model WHERE nom = '".$this->const[1][2]."' AND entity = ".$conf->entity,
|
"DELETE FROM ".MAIN_DB_PREFIX."document_model WHERE nom = '".$this->const[2][2]."' AND entity = ".$conf->entity,
|
||||||
"INSERT INTO ".MAIN_DB_PREFIX."document_model (nom, type, entity) VALUES('".$this->const[1][2]."','delivery',".$conf->entity.")",
|
"INSERT INTO ".MAIN_DB_PREFIX."document_model (nom, type, entity) VALUES('".$this->const[2][2]."','delivery',".$conf->entity.")",
|
||||||
);
|
);
|
||||||
|
|
||||||
return $this->_init($sql,$options);
|
return $this->_init($sql,$options);
|
||||||
|
|||||||
@ -1,37 +0,0 @@
|
|||||||
-- Copyright (C) 2001-2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
|
||||||
-- Copyright (C) 2003 Jean-Louis Bergamo <jlb@j1b.org>
|
|
||||||
-- Copyright (C) 2004-2009 Laurent Destailleur <eldy@users.sourceforge.net>
|
|
||||||
-- Copyright (C) 2004 Benoit Mortier <benoit.mortier@opensides.be>
|
|
||||||
-- Copyright (C) 2004 Guillaume Delecourt <guillaume.delecourt@opensides.be>
|
|
||||||
-- Copyright (C) 2005-2009 Regis Houssin <regis@dolibarr.fr>
|
|
||||||
-- Copyright (C) 2007 Patrick Raguin <patrick.raguin@gmail.com>
|
|
||||||
--
|
|
||||||
-- 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/>.
|
|
||||||
--
|
|
||||||
--
|
|
||||||
|
|
||||||
--
|
|
||||||
-- Ne pas placer de commentaire en fin de ligne, ce fichier est parsé lors
|
|
||||||
-- de l'install et tous les sigles '--' sont supprimés.
|
|
||||||
--
|
|
||||||
|
|
||||||
--
|
|
||||||
-- Codes barres
|
|
||||||
--
|
|
||||||
INSERT INTO llx_c_barcode_type (rowid, code, libelle, coder, example) VALUES (1, 'EAN8', 'EAN8', 0, '1234567');
|
|
||||||
INSERT INTO llx_c_barcode_type (rowid, code, libelle, coder, example) VALUES (2, 'EAN13', 'EAN13', 0, '123456789012');
|
|
||||||
INSERT INTO llx_c_barcode_type (rowid, code, libelle, coder, example) VALUES (3, 'UPC', 'UPC', 0, '123456789012');
|
|
||||||
INSERT INTO llx_c_barcode_type (rowid, code, libelle, coder, example) VALUES (4, 'ISBN', 'ISBN', 0, '123456789');
|
|
||||||
INSERT INTO llx_c_barcode_type (rowid, code, libelle, coder, example) VALUES (5, 'C39', 'Code 39', 0, '1234567890');
|
|
||||||
INSERT INTO llx_c_barcode_type (rowid, code, libelle, coder, example) VALUES (6, 'C128', 'Code 128', 0, 'ABCD1234567890');
|
|
||||||
@ -35,6 +35,7 @@ insert into llx_const (name, value, type, note, visible, entity) values ('MAIN_N
|
|||||||
insert into llx_const (name, value, type, note, visible, entity) values ('MAIN_FEATURES_LEVEL','0','chaine','Level of features to show (0=stable only, 1=stable+experimental, 2=stable+experimental+development',1,0);
|
insert into llx_const (name, value, type, note, visible, entity) values ('MAIN_FEATURES_LEVEL','0','chaine','Level of features to show (0=stable only, 1=stable+experimental, 2=stable+experimental+development',1,0);
|
||||||
|
|
||||||
-- Hidden and common to all entities
|
-- Hidden and common to all entities
|
||||||
|
insert into llx_const (name, value, type, note, visible, entity) values ('SYSLOG_FILE_ON','1','chaine','Log to file Directory where to write log file',0,0);
|
||||||
insert into llx_const (name, value, type, note, visible, entity) values ('SYSLOG_FILE','DOL_DATA_ROOT/dolibarr.log','chaine','Directory where to write log file',0,0);
|
insert into llx_const (name, value, type, note, visible, entity) values ('SYSLOG_FILE','DOL_DATA_ROOT/dolibarr.log','chaine','Directory where to write log file',0,0);
|
||||||
insert into llx_const (name, value, type, note, visible, entity) values ('SYSLOG_LEVEL','7','chaine','Level of debug info to show',0,0);
|
insert into llx_const (name, value, type, note, visible, entity) values ('SYSLOG_LEVEL','7','chaine','Level of debug info to show',0,0);
|
||||||
|
|
||||||
|
|||||||
@ -456,3 +456,7 @@ ALTER TABLE llx_product_fournisseur_price MODIFY fk_product_fournisseur integer
|
|||||||
UPDATE llx_product SET canvas = NULL where canvas = 'default@product';
|
UPDATE llx_product SET canvas = NULL where canvas = 'default@product';
|
||||||
UPDATE llx_product SET canvas = NULL where canvas = 'product@product';
|
UPDATE llx_product SET canvas = NULL where canvas = 'product@product';
|
||||||
UPDATE llx_product SET canvas = NULL where canvas = 'service@product';
|
UPDATE llx_product SET canvas = NULL where canvas = 'service@product';
|
||||||
|
|
||||||
|
DELETE FROM llx_const WHERE __DECRYPT('name')__ = 'SOCIETE_CODECOMPTA_ADDON' AND __DECRYPT('value')__ = 'mod_codecompta_digitaria';
|
||||||
|
|
||||||
|
ALTER TABLE llx_c_barcode_type ADD UNIQUE INDEX uk_c_barcode_type(code, entity);
|
||||||
|
|||||||
@ -47,6 +47,8 @@ UPDATE llx_product SET canvas = NULL where canvas = 'default@product';
|
|||||||
|
|
||||||
DELETE FROM llx_boxes where box_id NOT IN (SELECT rowid FROM llx_boxes_def);
|
DELETE FROM llx_boxes where box_id NOT IN (SELECT rowid FROM llx_boxes_def);
|
||||||
|
|
||||||
|
DELETE FROM llx_document_model WHERE nom ='elevement' AND type='delivery';
|
||||||
|
|
||||||
-- VMYSQL4.1 DELETE T1 FROM llx_boxes_def as T1, llx_boxes_def as T2 where T1.entity = T2.entity AND T1.file = T2.file AND T1.note = T2.note and T1.rowid > T2.rowid
|
-- VMYSQL4.1 DELETE T1 FROM llx_boxes_def as T1, llx_boxes_def as T2 where T1.entity = T2.entity AND T1.file = T2.file AND T1.note = T2.note and T1.rowid > T2.rowid
|
||||||
-- VPGSQL8.2 DELETE FROM llx_boxes_def as T1 WHERE rowid NOT IN (SELECT min(rowid) FROM llx_boxes_def GROUP BY file, entity, note)
|
-- VPGSQL8.2 DELETE FROM llx_boxes_def as T1 WHERE rowid NOT IN (SELECT min(rowid) FROM llx_boxes_def GROUP BY file, entity, note)
|
||||||
|
|
||||||
|
|||||||
19
htdocs/install/mysql/tables/llx_c_barcode_type.key.sql
Executable file
19
htdocs/install/mysql/tables/llx_c_barcode_type.key.sql
Executable file
@ -0,0 +1,19 @@
|
|||||||
|
-- ========================================================================
|
||||||
|
-- Copyright (C) 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
|
||||||
|
-- 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/>.
|
||||||
|
--
|
||||||
|
-- ========================================================================
|
||||||
|
|
||||||
|
ALTER TABLE llx_c_barcode_type ADD UNIQUE INDEX uk_c_barcode_type(code, entity);
|
||||||
@ -36,7 +36,7 @@ $langs->load("admin");
|
|||||||
$langs->load("products");
|
$langs->load("products");
|
||||||
|
|
||||||
// Security check
|
// Security check
|
||||||
if (! $user->admin || empty($conf->product->enabled))
|
if (! $user->admin || (empty($conf->product->enabled) && empty($conf->service->enabled)))
|
||||||
accessforbidden();
|
accessforbidden();
|
||||||
|
|
||||||
$action = GETPOST('action','alpha');
|
$action = GETPOST('action','alpha');
|
||||||
|
|||||||
@ -2,6 +2,7 @@
|
|||||||
/* Copyright (C) 2001-2002 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
/* Copyright (C) 2001-2002 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||||
* Copyright (C) 2003 Jean-Louis Bergamo <jlb@j1b.org>
|
* Copyright (C) 2003 Jean-Louis Bergamo <jlb@j1b.org>
|
||||||
* Copyright (C) 2004-2011 Laurent Destailleur <eldy@users.sourceforge.net>
|
* Copyright (C) 2004-2011 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
|
* Copyright (C) 2012 Marcos García <marcosgdf@gmail.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
|
||||||
* 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
|
||||||
@ -87,7 +88,7 @@ $head = product_admin_prepare_head(null, $tab);
|
|||||||
dol_fiche_head($head, 'attributes', $tab, 0, 'product');
|
dol_fiche_head($head, 'attributes', $tab, 0, 'product');
|
||||||
|
|
||||||
|
|
||||||
print $langs->trans("DefineHereComplementaryAttributes",$textobject).'<br>'."\n";
|
print $langs->trans('DefineHereComplementaryAttributes', $tab).'<br>'."\n";
|
||||||
print '<br>';
|
print '<br>';
|
||||||
|
|
||||||
dol_htmloutput_errors($mesg);
|
dol_htmloutput_errors($mesg);
|
||||||
|
|||||||
@ -604,6 +604,7 @@ class Project extends CommonObject
|
|||||||
|
|
||||||
if (!$error)
|
if (!$error)
|
||||||
{
|
{
|
||||||
|
$this->statut = 2;
|
||||||
$this->db->commit();
|
$this->db->commit();
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -79,6 +79,42 @@ $projectstatic = new Project($db);
|
|||||||
* Actions
|
* Actions
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
// Retreive First Task ID of Project if withprojet is on to allow project prev next to work
|
||||||
|
if (! empty($project_ref) && ! empty($withproject))
|
||||||
|
{
|
||||||
|
if ($projectstatic->fetch(0,$project_ref) > 0)
|
||||||
|
{
|
||||||
|
$tasksarray=$object->getTasksArray(0, 0, $projectstatic->id, $socid, 0);
|
||||||
|
if (count($tasksarray) > 0)
|
||||||
|
{
|
||||||
|
$id=$tasksarray[0]->id;
|
||||||
|
$object->fetch($id);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Header("Location: ".DOL_URL_ROOT.'/projet/tasks.php?id='.$projectstatic->id.($withproject?'&withproject=1':'').(empty($mode)?'':'&mode='.$mode));
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Find upload dir after retreive is task if necessary
|
||||||
|
if ($id > 0 || ! empty($ref))
|
||||||
|
{
|
||||||
|
if ($object->fetch($id,$ref) > 0)
|
||||||
|
{
|
||||||
|
$projectstatic->fetch($object->fk_project);
|
||||||
|
|
||||||
|
if (! empty($projectstatic->socid)) $projectstatic->societe->fetch($projectstatic->socid);
|
||||||
|
|
||||||
|
$upload_dir = $conf->projet->dir_output.'/'.dol_sanitizeFileName($projectstatic->ref).'/'.dol_sanitizeFileName($object->ref);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
dol_print_error($db);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Envoi fichier
|
// Envoi fichier
|
||||||
if ($_POST["sendit"] && ! empty($conf->global->MAIN_UPLOAD_DOC))
|
if ($_POST["sendit"] && ! empty($conf->global->MAIN_UPLOAD_DOC))
|
||||||
{
|
{
|
||||||
@ -128,41 +164,6 @@ if ($action=='delete')
|
|||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Retreive First Task ID of Project if withprojet is on to allow project prev next to work
|
|
||||||
if (! empty($project_ref) && ! empty($withproject))
|
|
||||||
{
|
|
||||||
if ($projectstatic->fetch(0,$project_ref) > 0)
|
|
||||||
{
|
|
||||||
$tasksarray=$object->getTasksArray(0, 0, $projectstatic->id, $socid, 0);
|
|
||||||
if (count($tasksarray) > 0)
|
|
||||||
{
|
|
||||||
$id=$tasksarray[0]->id;
|
|
||||||
$object->fetch($id);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
Header("Location: ".DOL_URL_ROOT.'/projet/tasks.php?id='.$projectstatic->id.($withproject?'&withproject=1':'').(empty($mode)?'':'&mode='.$mode));
|
|
||||||
exit;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Find upload dir after retreive is task if necessary
|
|
||||||
if ($id > 0 || ! empty($ref))
|
|
||||||
{
|
|
||||||
if ($object->fetch($id,$ref) > 0)
|
|
||||||
{
|
|
||||||
$projectstatic->fetch($object->fk_project);
|
|
||||||
|
|
||||||
if (! empty($projectstatic->socid)) $projectstatic->societe->fetch($projectstatic->socid);
|
|
||||||
|
|
||||||
$upload_dir = $conf->projet->dir_output.'/'.dol_sanitizeFileName($projectstatic->ref).'/'.dol_sanitizeFileName($object->ref);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
dol_print_error($db);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* View
|
* View
|
||||||
|
|||||||
@ -78,18 +78,20 @@ if (! empty($project_ref) && ! empty($withproject))
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$permission=($user->rights->projet->creer || $user->rights->projet->all->creer);
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Actions
|
* Actions
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if ($action == 'setnote_public' && $user->rights->ficheinter->creer)
|
if ($action == 'setnote_public' && ! empty($permission))
|
||||||
{
|
{
|
||||||
$result=$object->update_note_public(dol_html_entity_decode(GETPOST('note_public'), ENT_QUOTES));
|
$result=$object->update_note_public(dol_html_entity_decode(GETPOST('note_public'), ENT_QUOTES));
|
||||||
if ($result < 0) dol_print_error($db,$object->error);
|
if ($result < 0) dol_print_error($db,$object->error);
|
||||||
}
|
}
|
||||||
|
|
||||||
else if ($action == 'setnote_private' && $user->rights->ficheinter->creer)
|
else if ($action == 'setnote_private' && ! empty($permission))
|
||||||
{
|
{
|
||||||
$result=$object->update_note(dol_html_entity_decode(GETPOST('note_private'), ENT_QUOTES));
|
$result=$object->update_note(dol_html_entity_decode(GETPOST('note_private'), ENT_QUOTES));
|
||||||
if ($result < 0) dol_print_error($db,$object->error);
|
if ($result < 0) dol_print_error($db,$object->error);
|
||||||
@ -203,7 +205,6 @@ if ($object->id > 0)
|
|||||||
print '<br>';
|
print '<br>';
|
||||||
|
|
||||||
$colwidth=30;
|
$colwidth=30;
|
||||||
$permission=($user->rights->projet->creer || $user->rights->projet->all->creer);
|
|
||||||
$moreparam=$param;
|
$moreparam=$param;
|
||||||
include(DOL_DOCUMENT_ROOT.'/core/tpl/notes.tpl.php');
|
include(DOL_DOCUMENT_ROOT.'/core/tpl/notes.tpl.php');
|
||||||
|
|
||||||
|
|||||||
@ -3,6 +3,7 @@
|
|||||||
* Copyright (C) 2001-2002 Jean-Louis Bergamo <jlb@j1b.org>
|
* Copyright (C) 2001-2002 Jean-Louis Bergamo <jlb@j1b.org>
|
||||||
* Copyright (C) 2006-2011 Laurent Destailleur <eldy@users.sourceforge.net>
|
* Copyright (C) 2006-2011 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
* Copyright (C) 2012 Regis Houssin <regis@dolibarr.fr>
|
* Copyright (C) 2012 Regis Houssin <regis@dolibarr.fr>
|
||||||
|
* Copyright (C) 2012 J. Fernando Lagrange <fernando@demo-tic.org>
|
||||||
*
|
*
|
||||||
* 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
|
||||||
@ -537,6 +538,10 @@ if (! empty($conf->global->MEMBER_NEWFORM_AMOUNT)
|
|||||||
{
|
{
|
||||||
// $conf->global->MEMBER_NEWFORM_SHOWAMOUNT is an amount
|
// $conf->global->MEMBER_NEWFORM_SHOWAMOUNT is an amount
|
||||||
$amount=0;
|
$amount=0;
|
||||||
|
if (! empty($conf->global->MEMBER_NEWFORM_AMOUNT)) {
|
||||||
|
$amount=$conf->global->MEMBER_NEWFORM_AMOUNT;
|
||||||
|
}
|
||||||
|
|
||||||
if (! empty($conf->global->MEMBER_NEWFORM_PAYONLINE))
|
if (! empty($conf->global->MEMBER_NEWFORM_PAYONLINE))
|
||||||
{
|
{
|
||||||
$amount=GETPOST('amount')?GETPOST('amount'):$conf->global->MEMBER_NEWFORM_AMOUNT;
|
$amount=GETPOST('amount')?GETPOST('amount'):$conf->global->MEMBER_NEWFORM_AMOUNT;
|
||||||
|
|||||||
@ -1984,10 +1984,10 @@ class User extends CommonObject
|
|||||||
* Return number of existing users
|
* Return number of existing users
|
||||||
*
|
*
|
||||||
* @param string $limitTo Limit to 'active' or 'superadmin' users
|
* @param string $limitTo Limit to 'active' or 'superadmin' users
|
||||||
* @param int $all Return for all entities
|
* @param bool $all Return for all entities
|
||||||
* @return int Number of users
|
* @return int Number of users
|
||||||
*/
|
*/
|
||||||
function getNbOfUsers($limitTo='',$all=0)
|
function getNbOfUsers($limitTo='active', $all=false)
|
||||||
{
|
{
|
||||||
global $conf;
|
global $conf;
|
||||||
|
|
||||||
@ -1999,7 +1999,7 @@ class User extends CommonObject
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if ($all) $sql.= " WHERE entity IS NOT NULL"; // all users except superadmin
|
if ($all) $sql.= " WHERE entity > 0"; // all users except superadmins
|
||||||
else $sql.= " WHERE entity = ".$conf->entity;
|
else $sql.= " WHERE entity = ".$conf->entity;
|
||||||
if ($limitTo == 'active') $sql.= " AND statut = 1";
|
if ($limitTo == 'active') $sql.= " AND statut = 1";
|
||||||
}
|
}
|
||||||
|
|||||||
@ -123,7 +123,7 @@ if ($action == 'confirm_enable' && $confirm == "yes" && $candisableuser)
|
|||||||
|
|
||||||
if (!empty($conf->file->main_limit_users))
|
if (!empty($conf->file->main_limit_users))
|
||||||
{
|
{
|
||||||
$nb = $edituser->getNbOfUsers("active",1);
|
$nb = $edituser->getNbOfUsers("active");
|
||||||
if ($nb >= $conf->file->main_limit_users)
|
if ($nb >= $conf->file->main_limit_users)
|
||||||
{
|
{
|
||||||
$message='<div class="error">'.$langs->trans("YourQuotaOfUsersIsReached").'</div>';
|
$message='<div class="error">'.$langs->trans("YourQuotaOfUsersIsReached").'</div>';
|
||||||
@ -178,7 +178,7 @@ if ($action == 'add' && $canadduser)
|
|||||||
|
|
||||||
if (! empty($conf->file->main_limit_users)) // If option to limit users is set
|
if (! empty($conf->file->main_limit_users)) // If option to limit users is set
|
||||||
{
|
{
|
||||||
$nb = $edituser->getNbOfUsers("active",1);
|
$nb = $edituser->getNbOfUsers("active");
|
||||||
if ($nb >= $conf->file->main_limit_users)
|
if ($nb >= $conf->file->main_limit_users)
|
||||||
{
|
{
|
||||||
$message='<div class="error">'.$langs->trans("YourQuotaOfUsersIsReached").'</div>';
|
$message='<div class="error">'.$langs->trans("YourQuotaOfUsersIsReached").'</div>';
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user