This commit is contained in:
Laurent Destailleur 2012-08-28 18:42:39 +02:00
commit e5c2d07c53
44 changed files with 376 additions and 302 deletions

View File

@ -51,6 +51,7 @@ Copyright (C) 2012
- Juanjo Menent <jmenent@2byte.es>
- Philippe Grand <philippe.grand@atoo-net.com>
- Jean Heimburger <jean@tiaris.info>
- Marcos García <marcosgdf@gmail.com>
Copyright (C) 2011
- Laurent Destailleur <eldy@users.sourceforge.net>

View File

@ -18,8 +18,17 @@ English Dolibarr ChangeLog
- Fix: Allows to use a comma decimal separator in supplier invoices payments.
- Fix: Translation for tr_TR, es_ES, pt_BR.
- 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 *****
WARNING: PHP lower than 5.x are no more supported.

View File

@ -4,7 +4,7 @@
<CompanyName />
<Program_Info>
<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_Day>10</Program_Release_Day>
<Program_Release_Year>2012</Program_Release_Year>

View File

@ -4,7 +4,7 @@
<CompanyName />
<Program_Info>
<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_Day>10</Program_Release_Day>
<Program_Release_Year>2012</Program_Release_Year>

View File

@ -34,9 +34,9 @@
</Company_Info>
<Program_Info>
<Program_Name>Dolibarr</Program_Name>
<Program_Version>3.2.0</Program_Version>
<Program_Release_Month>06</Program_Release_Month>
<Program_Release_Day>18</Program_Release_Day>
<Program_Version>3.2.1</Program_Version>
<Program_Release_Month>08</Program_Release_Month>
<Program_Release_Day>10</Program_Release_Day>
<Program_Release_Year>2012</Program_Release_Year>
<Program_Cost_Dollars />
<Program_Cost_Other_Code />

View File

@ -34,9 +34,9 @@
</Company_Info>
<Program_Info>
<Program_Name>DoliWamp</Program_Name>
<Program_Version>3.2.0</Program_Version>
<Program_Release_Month>06</Program_Release_Month>
<Program_Release_Day>18</Program_Release_Day>
<Program_Version>3.2.1</Program_Version>
<Program_Release_Month>08</Program_Release_Month>
<Program_Release_Day>10</Program_Release_Day>
<Program_Release_Year>2012</Program_Release_Year>
<Program_Cost_Dollars />
<Program_Cost_Other_Code />

View File

@ -708,36 +708,43 @@ class Adherent extends CommonObject
$resql=$this->db->query($sql);
if ($resql)
{
$sql = "DELETE FROM ".MAIN_DB_PREFIX."adherent WHERE rowid = ".$rowid;
dol_syslog(get_class($this)."::delete sql=".$sql);
$resql=$this->db->query($sql);
if ($resql)
{
if ($this->db->affected_rows($resql))
{
// Appel des triggers
include_once(DOL_DOCUMENT_ROOT . "/core/class/interfaces.class.php");
$interface=new Interfaces($this->db);
$result=$interface->run_triggers('MEMBER_DELETE',$this,$user,$langs,$conf);
if ($result < 0) { $error++; $this->errors=$interface->errors; }
// Fin appel triggers
$this->db->commit();
return 1;
}
else
{
// Rien a effacer
$this->db->rollback();
return 0;
}
}
else
{
$this->error=$this->db->error();
$this->db->rollback();
return -3;
}
// Remove linked user
$ret=$this->setUserId(0);
if ($ret > 0)
{
$sql = "DELETE FROM ".MAIN_DB_PREFIX."adherent WHERE rowid = ".$rowid;
dol_syslog(get_class($this)."::delete sql=".$sql);
$resql=$this->db->query($sql);
if ($resql)
{
if ($this->db->affected_rows($resql))
{
// Appel des triggers
include_once(DOL_DOCUMENT_ROOT . "/core/class/interfaces.class.php");
$interface=new Interfaces($this->db);
$result=$interface->run_triggers('MEMBER_DELETE',$this,$user,$langs,$conf);
if ($result < 0) {
$error++; $this->errors=$interface->errors;
}
// Fin appel triggers
$this->db->commit();
return 1;
}
else
{
// Rien a effacer
$this->db->rollback();
return 0;
}
}
else
{
$this->error=$this->db->error();
$this->db->rollback();
return -3;
}
}
}
else
{

View File

@ -247,7 +247,7 @@ if ($resql)
$statictype->libelle=$obj->libelle;
print '<td>'.$staticmember->getNomUrl(1,24).'</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 '</tr>';
$i++;

View File

@ -1,8 +1,8 @@
<?php
/* Copyright (C) 2003-2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2011 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2009 Regis Houssin <regis@dolibarr.fr>
* Copyright (C) 2011 Juanjo Menent <jmenent@2byte.es>
/* Copyright (C) 2003-2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2011 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2012 Regis Houssin <regis@dolibarr.fr>
* Copyright (C) 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
@ -112,7 +112,7 @@ $dirbarcode=array_merge(array("/core/modules/barcode/"),$conf->barcode_modules);
foreach($dirbarcode as $reldir)
{
$dir=dol_buildpath($reldir,0);
$dir=dol_buildpath($reldir);
$newdir=dol_osencode($dir);
// Check if directory exists (we do not use dol_is_dir to avoid loading files.lib.php)
@ -334,4 +334,4 @@ dol_htmloutput_mesg($mesg);
$db->close();
llxFooter();
?>
?>

View File

@ -158,7 +158,7 @@ if ($what == 'mysql')
if (! empty($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";

View File

@ -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>';
// 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
$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>';
// 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
print '<tr><td nowrap="nowrap" class="fieldrequired">'.$langs->trans("DateActionStart").'</td><td colspan="3">';

View File

@ -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
{
$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_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('/day=[0-9]+&?/i','',$newparam);
$newparam=preg_replace('/month=[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 ' <tr class="liste_titre">';
$i=0;
@ -810,11 +812,13 @@ if (empty($action) || $action == 'show_month') // View by month
elseif ($action == 'show_week') // View by week
{
$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_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('/day=[0-9]+&?/i','',$newparam);
$newparam=preg_replace('/month=[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 ' <tr class="liste_titre">';
$i=0;
@ -866,9 +870,6 @@ else // View by day
$newparam=$param; // newparam is for birthday links
$newparam=preg_replace('/action=show_month&?/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
$style='cal_current_month';
$today=0;

View File

@ -1,7 +1,8 @@
<?php
/* Copyright (C) 2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* 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
* 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
$data = $stats->getNbByMonthWithPrevYear($endyear,$startyear);
//var_dump($data);
// $data = array(array('Lib',val1,val2,val3),...)
@ -110,7 +110,6 @@ if (! $mesg)
// Build graphic amount of object
$data = $stats->getAmountByMonthWithPrevYear($endyear,$startyear);
//var_dump($data);
// $data = array(array('Lib',val1,val2,val3),...)
if (!$user->rights->societe->client->voir || $user->societe_id)
@ -151,13 +150,7 @@ if (! $mesg)
$px2->draw($filenameamount,$fileurlamount);
}
$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]);
}
$data = $stats->getAverageByMonthWithPrevYear($endyear, $startyear);
if (!$user->rights->societe->client->voir || $user->societe_id)
{
@ -177,8 +170,7 @@ $mesg = $px3->isGraphKo();
if (! $mesg)
{
$px3->SetData($data);
//$i=$startyear;$legend=array();
$i=$endyear;$legend=array();
$i=$startyear;$legend=array();
while ($i <= $endyear)
{
$legend[]=$i;

View File

@ -1,7 +1,8 @@
<?php
/* Copyright (C) 2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* 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
* 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."societe as s";
$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;

View File

@ -1,6 +1,8 @@
<?php
/* Copyright (C) 2001-2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* 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
* it under the terms of the GNU General Public License as published by
@ -168,12 +170,7 @@ if (! $mesg)
}
$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]);
}
$data = $stats->getAverageByMonthWithPrevYear($endyear, $startyear);
if (!$user->rights->societe->client->voir || $user->societe_id)
{
@ -193,8 +190,7 @@ $mesg = $px3->isGraphKo();
if (! $mesg)
{
$px3->SetData($data);
//$i=$startyear;$legend=array();
$i=$endyear;$legend=array();
$i=$startyear;$legend=array();
while ($i <= $endyear)
{
$legend[]=$i;

View File

@ -48,6 +48,7 @@ $fieldtype = (! empty($ref) ? 'ref' :'rowid');
if ($user->societe_id) $socid=$user->societe_id;
$result=restrictedArea($user,'banque',$fieldvalue,'bank_account','','',$fieldtype);
$paiementtype=GETPOST('paiementtype','alpha',3);
$req_nb=GETPOST("req_nb",'',3);
$thirdparty=GETPOST("thirdparty",'',3);
$vline=GETPOST("vline");
@ -78,17 +79,17 @@ if ($action == 'add' && $id && ! isset($_POST["cancel"]) && $user->rights->banqu
{
$amount = - price2num($_POST["debit"]);
}
$dateop = dol_mktime(12,0,0,$_POST["opmonth"],$_POST["opday"],$_POST["opyear"]);
$operation=$_POST["operation"];
$num_chq=$_POST["num_chq"];
$label=$_POST["label"];
$cat1=$_POST["cat1"];
if (! $dateop) $mesg=$langs->trans("ErrorFieldRequired",$langs->trans("Date"));
if (! $operation) $mesg=$langs->trans("ErrorFieldRequired",$langs->trans("Type"));
if (! $amount) $mesg=$langs->trans("ErrorFieldRequired",$langs->trans("Amount"));
if (! $mesg)
{
$object->fetch($id);
@ -143,15 +144,15 @@ if ($id > 0 || ! empty($ref))
}
$result=$object->fetch($id, $ref);
// Chargement des categories bancaires dans $options
$nbcategories=0;
$sql = "SELECT rowid, label";
$sql.= " FROM ".MAIN_DB_PREFIX."bank_categ";
$sql.= " WHERE entity = ".$conf->entity;
$sql.= " ORDER BY label";
$result = $db->query($sql);
if ($result)
{
@ -168,7 +169,7 @@ if ($id > 0 || ! empty($ref))
}
$db->free($result);
}
// Definition de sql_rech et param
$param='';
$sql_rech='';
@ -203,13 +204,13 @@ if ($id > 0 || ! empty($ref))
$param.='&amp;thirdparty='.urlencode($thirdparty);
$mode_search = 1;
}
if (GETPOST("paiementtype"))
if ($paiementtype)
{
$sql_rech.=" AND b.fk_type = '".$db->escape(GETPOST("paiementtype"))."'";
$param.='&amp;paiementtype='.urlencode(GETPOST("paiementtype"));
$sql_rech.=" AND b.fk_type = '".$db->escape($paiementtype)."'";
$param.='&amp;paiementtype='.urlencode($paiementtype);
$mode_search = 1;
}
$sql = "SELECT count(*) as nb";
$sql.= " FROM ".MAIN_DB_PREFIX."bank_account as ba";
$sql.= ", ".MAIN_DB_PREFIX."bank as b";
@ -222,7 +223,7 @@ if ($id > 0 || ! empty($ref))
$sql.= " AND b.fk_account = ba.rowid";
$sql.= " AND ba.entity = ".$conf->entity;
$sql.= $sql_rech;
dol_syslog("account.php count transactions - sql=".$sql, LOG_DEBUG);
$result=$db->query($sql);
if ($result)
@ -230,7 +231,7 @@ if ($id > 0 || ! empty($ref))
$obj = $db->fetch_object($result);
$nbline = $obj->nb;
$total_lines = $nbline;
if ($nbline > $viewline ) $limit = $nbline - $viewline ;
else $limit = $viewline;
@ -240,7 +241,7 @@ if ($id > 0 || ! empty($ref))
{
dol_print_error($db);
}
if ($page > 0)
{
$limitsql = $nbline - ($page * $viewline);
@ -253,34 +254,34 @@ if ($id > 0 || ! empty($ref))
$limitsql = $nbline;
}
//print $limitsql.'-'.$page.'-'.$viewline;
// Onglets
$head=bank_prepare_head($object);
dol_fiche_head($head,'journal',$langs->trans("FinancialAccount"),0,'account');
print '<table class="border" width="100%">';
// Ref
print '<tr><td valign="top" width="25%">'.$langs->trans("Ref").'</td>';
print '<td colspan="3">';
print $form->showrefnav($object,'ref','',1,'ref');
print '</td></tr>';
// Label
print '<tr><td valign="top">'.$langs->trans("Label").'</td>';
print '<td colspan="3">'.$object->label.'</td></tr>';
print '</table>';
print '<br>';
dol_htmloutput_errors($mesg);
/**
* Search form
*/
$param.='&amp;account='.$object->id;
// Define transaction list navigation string
$navig='';
$navig.='<form action="'.$_SERVER["PHP_SELF"].'" name="newpage" method="GET">';
@ -289,6 +290,7 @@ if ($id > 0 || ! empty($ref))
if ($limitsql > $viewline) $navig.='<a href="account.php?'.$param.'&amp;page='.($page+1).'">'.img_previous().'</a>';
$navig.= $langs->trans("Page")." "; // ' 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_desc" value="'.GETPOST("req_desc").'">';
$navig.='<input type="hidden" name="req_debit" value="'.GETPOST("req_debit").'">';
@ -303,7 +305,7 @@ if ($id > 0 || ! empty($ref))
}
$navig.='</form>';
//var_dump($navig);
// Confirmation delete
if ($action == 'delete')
{
@ -311,15 +313,15 @@ if ($id > 0 || ! empty($ref))
$ret=$form->form_confirm($_SERVER['PHP_SELF'].'?id='.$object->id.'&amp;rowid='.$_GET["rowid"],$langs->trans('DeleteTransaction'),$text,'confirm_delete');
if ($ret == 'html') print '<br>';
}
print '<table class="notopnoleftnoright" width="100%">';
// Show title
if ($action != 'addline' && $action != 'delete')
{
print '<tr><td colspan="9" align="right">'.$navig.'</td></tr>';
}
// Form to add a transaction with no invoice
if ($user->rights->banque->modifier && $action == 'addline')
{
@ -328,11 +330,11 @@ if ($id > 0 || ! empty($ref))
print '<input type="hidden" name="action" value="add">';
print '<input type="hidden" name="vline" value="'.$vline.'">';
print '<input type="hidden" name="id" value="'.$object->id.'">';
print '<tr>';
print '<td align="left" colspan="10"><b>'.$langs->trans("AddBankRecordLong").'</b></td>';
print '</tr>';
print '<tr class="liste_titre">';
print '<td>'.$langs->trans("Date").'</td>';
print '<td>&nbsp;</td>';
@ -343,7 +345,7 @@ if ($id > 0 || ! empty($ref))
print '<td align=right>'.$langs->trans("Credit").'</td>';
print '<td colspan="2" align="center">&nbsp;</td>';
print '</tr>';
print '<tr '.$bc[false].'>';
print '<td nowrap="nowrap" colspan="2">';
$form->select_date($dateop,'op',0,0,0,'transaction');
@ -366,14 +368,14 @@ if ($id > 0 || ! empty($ref))
print '<input type="submit" name="cancel" class="button" value="'.$langs->trans("Cancel").'">';
print '</td></tr>';
print "</form>";
print '<tr class="noborder"><td colspan="8">&nbsp;</td></tr>'."\n";
}
/*
* Affiche tableau des transactions bancaires
*/
// Ligne de titre tableau des ecritures
print '<tr class="liste_titre">';
print '<td>'.$langs->trans("Date").'</td>';
@ -389,19 +391,19 @@ if ($id > 0 || ! empty($ref))
if ($object->type != 2 && $object->rappro) print $langs->trans("AccountStatementShort");
else print '&nbsp;';
print '</td></tr>';
print '<form action="'.$_SERVER["PHP_SELF"].'?'.$param.'" name="search" method="POST">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<input type="hidden" name="action" value="search">';
print '<input type="hidden" name="id" value="'.$object->id.'">';
print '<tr class="liste_titre">';
print '<td>&nbsp;</td>';
print '<td>&nbsp;</td>';
print '<td>';
//$filtertype=array('TIP'=>'TIP','PRE'=>'PRE',...)
$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><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>';
@ -412,13 +414,13 @@ if ($id > 0 || ! empty($ref))
print '<td align="center" width="40"><input type="image" class="liste_titre" src="'.DOL_URL_ROOT.'/theme/'.$conf->theme.'/img/search.png" value="'.dol_escape_htmltag($langs->trans("Search")).'" title="'.dol_escape_htmltag($langs->trans("Search")).'"></td>';
print "</tr>\n";
print "</form>\n";
/*
* Another solution
* create temporary table solde type=heap select amount from llx_bank limit 100 ;
* select sum(amount) from solde ;
*/
$sql = "SELECT b.rowid, b.dateo as do, b.datev as dv,";
$sql.= " b.amount, b.label, b.rappro, b.num_releve, b.num_chq, b.fk_type";
if ($mode_search)
@ -428,11 +430,11 @@ if ($id > 0 || ! empty($ref))
/*
if ($mode_search && $conf->adherent->enabled)
{
}
if ($mode_search && $conf->tax->enabled)
{
}
*/
$sql.= " FROM ".MAIN_DB_PREFIX."bank_account as ba";
@ -459,22 +461,22 @@ if ($id > 0 || ! empty($ref))
$sql.= $sql_rech;
$sql.= $db->order("b.datev, b.datec", "ASC"); // We add date of creation to have correct order when everything is done the same day
$sql.= $db->plimit($limitsql, 0);
dol_syslog("account.php get transactions - sql=".$sql, LOG_DEBUG);
$result = $db->query($sql);
if ($result)
{
$now=dol_now();
$nows=dol_print_date($now,'%Y%m%d');
//$form->load_cache_types_paiements();
//$form->cache_types_paiements
$var=true;
$num = $db->num_rows($result);
$i = 0; $total = 0; $sep = 0;
while ($i < $num)
{
$objp = $db->fetch_object($result);
@ -482,7 +484,7 @@ if ($id > 0 || ! empty($ref))
if ($i >= ($nbline - $viewline))
{
$var=!$var;
// Is it a transaction in future ?
$dos=dol_print_date($db->jdate($objp->do),'%Y%m%d');
//print "dos=".$dos." nows=".$nows;
@ -496,26 +498,26 @@ if ($id > 0 || ! empty($ref))
print "<td>&nbsp;</td>";
print '</tr>';
}
print '<tr '.$bc[$var].'>';
print '<td nowrap="nowrap">'.dol_print_date($db->jdate($objp->do),"day")."</td>\n";
print '<td nowrap="nowrap">'.dol_print_date($db->jdate($objp->dv),"day");
print "</td>\n";
// Payment type
print "<td nowrap>";
$label=($langs->trans("PaymentTypeShort".$objp->fk_type)!="PaymentTypeShort".$objp->fk_type)?$langs->trans("PaymentTypeShort".$objp->fk_type):$objp->fk_type;
// $label=$langs->getTradFromKey("PaymentTypeShort".$objp->fk_type);
if ($objp->fk_type == 'SOLD') $label='&nbsp;';
print $label;
print "</td>\n";
// Num
print '<td nowrap>'.($objp->num_chq?$objp->num_chq:"")."</td>\n";
// Description
print '<td>';
// Show generic description
@ -545,7 +547,7 @@ if ($id > 0 || ! empty($ref))
}
else if ($links[$key]['type']=='company')
{
}
else if ($links[$key]['type']=='payment_sc')
{
@ -567,11 +569,11 @@ if ($id > 0 || ! empty($ref))
}
else if ($links[$key]['type']=='member')
{
}
else if ($links[$key]['type']=='sc')
{
}
else
{
@ -592,7 +594,7 @@ if ($id > 0 || ! empty($ref))
}
}
print '</td>';
// Add third party column
print '<td>';
foreach($links as $key=>$val)
@ -627,7 +629,7 @@ if ($id > 0 || ! empty($ref))
}
}
print '</td>';
// Amount
if ($objp->amount < 0)
{
@ -637,7 +639,7 @@ if ($id > 0 || ! empty($ref))
{
print '<td>&nbsp;</td><td align="right" nowrap="nowrap">&nbsp;'.price($objp->amount).'</td>'."\n";
}
// Balance
if ($action != 'search')
{
@ -654,7 +656,7 @@ if ($id > 0 || ! empty($ref))
{
print '<td align="right">-</td>';
}
// Transaction reconciliated or edit link
if ($objp->rappro && $object->canBeConciliated() > 0) // If line not conciliated and account can be conciliated
{
@ -697,13 +699,13 @@ if ($id > 0 || ! empty($ref))
}
print '</td>';
}
print "</tr>";
}
$i++;
}
// Show total
if ($page == 0 && ! $mode_search)
{
@ -721,19 +723,19 @@ if ($id > 0 || ! empty($ref))
{
dol_print_error($db);
}
print "</table>";
print "\n</div>\n";
/*
* Boutons actions
*/
if ($action != 'delete')
{
print '<div class="tabsAction">';
if ($object->type != 2 && $object->rappro) // If not cash account and can be reconciliate
{
if ($user->rights->banque->consolidate)
@ -745,7 +747,7 @@ if ($id > 0 || ! empty($ref))
print '<a class="butActionRefused" title="'.$langs->trans("NotEnoughPermissions").'" href="#">'.$langs->trans("Conciliate").'</a>';
}
}
if ($action != 'addline')
{
if ($user->rights->banque->modifier)
@ -757,10 +759,10 @@ if ($id > 0 || ! empty($ref))
print '<a class="butActionRefused" title="'.$langs->trans("NotEnoughPermissions").'" href="#">'.$langs->trans("AddBankRecord").'</a>';
}
}
print '</div>';
}
print '<br>';
}
else
@ -771,4 +773,4 @@ else
llxFooter();
$db->close();
?>
?>

View File

@ -1,6 +1,7 @@
<?php
/* Copyright (C) 2003-2006 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* 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
* it under the terms of the GNU General Public License as published by
@ -137,12 +138,7 @@ if (! $mesg)
}
$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]);
}
$data = $stats->getAverageByMonthWithPrevYear($endyear, $startyear);
if (!$user->rights->societe->client->voir || $user->societe_id)
{
@ -162,8 +158,7 @@ $mesg = $px3->isGraphKo();
if (! $mesg)
{
$px3->SetData($data);
//$i=$startyear;$legend=array();
$i=$endyear;$legend=array();
$i = $startyear;$legend=array();
while ($i <= $endyear)
{
$legend[]=$i;

View File

@ -1,6 +1,7 @@
<?php
/* Copyright (C) 2003-2006 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* 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
* it under the terms of the GNU General Public License as published by
@ -148,12 +149,7 @@ if (! $mesg)
}
$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]);
}
$data = $stats->getAverageByMonthWithPrevYear($endyear, $startyear);
if (!$user->rights->societe->client->voir || $user->societe_id)
{
@ -173,8 +169,7 @@ $mesg = $px3->isGraphKo();
if (! $mesg)
{
$px3->SetData($data);
//$i=$startyear;$legend=array();
$i=$endyear;$legend=array();
$i = $startyear;$legend=array();
while ($i <= $endyear)
{
$legend[]=$i;

View File

@ -87,16 +87,21 @@ report_header($nom,$nomlink,$period,$periodlink,$description,$builddate,$exportl
$p = explode(":", $conf->global->MAIN_INFO_SOCIETE_PAYS);
$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.= " p.accountancy_code_sell, s.code_compta , ct.accountancy_code";
$sql = "SELECT f.rowid, f.facnumber, f.type, f.datef, f.ref_client,";
$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.= " 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."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.= " 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)."'";
$sql .= " order by f.rowid";
$sql.= " ORDER BY f.rowid";
$result = $db->query($sql);
if ($result)

View File

@ -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 File

@ -69,7 +69,7 @@ class FormActions
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(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";
@ -78,7 +78,7 @@ class FormActions
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; }'."\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">';

View File

@ -1,6 +1,8 @@
<?php
/* Copyright (C) 2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (c) 2008-2012 Laurent Destailleur <eldy@users.sourceforge.net>
/* Copyright (C) 2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* 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
* it under the terms of the GNU General Public License as published by
@ -103,6 +105,42 @@ abstract class Stats
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
@ -295,7 +333,16 @@ abstract class Stats
$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;
}
}

View File

@ -232,8 +232,8 @@ function displayBox($selectedDate,$month,$year)
// Sur click dans calendrier, appelle fonction dpClickDay
echo "<TD class=\"".$dayclass."\"";
echo " onMouseOver=\"dpHighlightDay(".$mydate["year"].",".dol_print_date($thedate,"%m").",".$mydate["mday"].",tradMonths)\"";
echo " onClick=\"dpClickDay(".$mydate["year"].",".dol_print_date($thedate,"%m").",".$mydate["mday"].",'".$langs->trans("FormatDateShortJava")."')\"";
echo " onMouseOver=\"dpHighlightDay(".$mydate["year"].",parseInt('".dol_print_date($thedate,"%m")."',10),".$mydate["mday"].",tradMonths)\"";
echo " onClick=\"dpClickDay(".$mydate["year"].",parseInt('".dol_print_date($thedate,"%m")."',10),".$mydate["mday"].",'".$langs->trans("FormatDateShortJava")."')\"";
echo ">".sprintf("%02s",$mydate["mday"])."</TD>";
$cols++;

View File

@ -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);
// 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]);
@ -266,7 +266,7 @@ function run_sql($sqlfile,$silent=1,$entity='',$usesavepoint=1,$handler='',$oker
}
// 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]);
@ -1138,15 +1138,15 @@ function form_constantes($tableau)
function addDocumentModel($name, $type, $label='', $description='')
{
global $db, $conf;
$db->begin();
$sql = "INSERT INTO ".MAIN_DB_PREFIX."document_model (nom, type, entity, libelle, description)";
$sql.= " VALUES ('".$db->escape($name)."','".$type."',".$conf->entity.", ";
$sql.= ($label?"'".$db->escape($label)."'":'null').", ";
$sql.= (! empty($description)?"'".$db->escape($description)."'":"null");
$sql.= ")";
dol_syslog("admin.lib::addDocumentModel sql=".$sql);
$resql=$db->query($sql);
if ($resql)
@ -1172,9 +1172,9 @@ function addDocumentModel($name, $type, $label='', $description='')
function delDocumentModel($name, $type)
{
global $db, $conf;
$db->begin();
$sql = "DELETE FROM ".MAIN_DB_PREFIX."document_model";
$sql.= " WHERE nom = '".$db->escape($name)."'";
$sql.= " AND type = '".$type."'";

View File

@ -62,7 +62,7 @@ abstract class DolibarrModules
*/
function _init($array_sql, $options='')
{
global $langs;
global $conf, $langs;
$err=0;
$this->db->begin();
@ -113,6 +113,9 @@ abstract class DolibarrModules
$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);
$result=$this->db->query($sql);
if (! $result)

View File

@ -112,9 +112,16 @@ class modBarcode extends DolibarrModules
// Permissions
$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);
}
/**
@ -129,7 +136,7 @@ class modBarcode extends DolibarrModules
{
$sql = array();
return $this->_remove($sql,$options);
return $this->_remove($sql, $options);
}
}

View File

@ -211,8 +211,8 @@ class modExpedition extends DolibarrModules
$sql = array(
"DELETE FROM ".MAIN_DB_PREFIX."document_model WHERE nom = '".$this->const[0][2]."' AND entity = ".$conf->entity,
"INSERT INTO ".MAIN_DB_PREFIX."document_model (nom, type, entity) VALUES('".$this->const[0][2]."','shipping',".$conf->entity.")",
"DELETE FROM ".MAIN_DB_PREFIX."document_model WHERE nom = '".$this->const[1][2]."' AND entity = ".$conf->entity,
"INSERT INTO ".MAIN_DB_PREFIX."document_model (nom, type, entity) VALUES('".$this->const[1][2]."','delivery',".$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[2][2]."','delivery',".$conf->entity.")",
);
return $this->_init($sql,$options);

View File

@ -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');

View File

@ -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);
-- 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_LEVEL','7','chaine','Level of debug info to show',0,0);

View File

@ -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 = 'product@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);

View File

@ -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_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
-- 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)

View 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);

View File

@ -36,7 +36,7 @@ $langs->load("admin");
$langs->load("products");
// Security check
if (! $user->admin || empty($conf->product->enabled))
if (! $user->admin || (empty($conf->product->enabled) && empty($conf->service->enabled)))
accessforbidden();
$action = GETPOST('action','alpha');

View File

@ -2,6 +2,7 @@
/* Copyright (C) 2001-2002 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2003 Jean-Louis Bergamo <jlb@j1b.org>
* 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
* 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');
print $langs->trans("DefineHereComplementaryAttributes",$textobject).'<br>'."\n";
print $langs->trans('DefineHereComplementaryAttributes', $tab).'<br>'."\n";
print '<br>';
dol_htmloutput_errors($mesg);

View File

@ -604,6 +604,7 @@ class Project extends CommonObject
if (!$error)
{
$this->statut = 2;
$this->db->commit();
return 1;
}

View File

@ -44,11 +44,11 @@ $ref= GETPOST('ref','alpha');
$withproject=GETPOST('withproject','int');
$project_ref = GETPOST('project_ref','alpha');
$mesg='';
if (isset($_SESSION['DolMessage']))
{
$mesg=$_SESSION['DolMessage'];
unset($_SESSION['DolMessage']);
$mesg='';
if (isset($_SESSION['DolMessage']))
{
$mesg=$_SESSION['DolMessage'];
unset($_SESSION['DolMessage']);
}
// Security check
@ -79,55 +79,6 @@ $projectstatic = new Project($db);
* Actions
*/
// Envoi fichier
if ($_POST["sendit"] && ! empty($conf->global->MAIN_UPLOAD_DOC))
{
if (dol_mkdir($upload_dir) >= 0)
{
$resupload=dol_move_uploaded_file($_FILES['userfile']['tmp_name'], $upload_dir . "/" . dol_unescapefile($_FILES['userfile']['name']),0,0,$_FILES['userfile']['error']);
if (is_numeric($resupload) && $resupload > 0)
{
if (image_format_supported($upload_dir . "/" . $_FILES['userfile']['name']) == 1)
{
// Create small thumbs for image (Ratio is near 16/9)
// Used on logon for example
$imgThumbSmall = vignette($upload_dir . "/" . $_FILES['userfile']['name'], $maxwidthsmall, $maxheightsmall, '_small', $quality, "thumbs");
// Create mini thumbs for image (Ratio is near 16/9)
// Used on menu or for setup page for example
$imgThumbMini = vignette($upload_dir . "/" . $_FILES['userfile']['name'], $maxwidthmini, $maxheightmini, '_mini', $quality, "thumbs");
}
$mesg = '<div class="ok">'.$langs->trans("FileTransferComplete").'</div>';
}
else
{
$langs->load("errors");
if ($resupload < 0) // Unknown error
{
$mesg = '<div class="error">'.$langs->trans("ErrorFileNotUploaded").'</div>';
}
else if (preg_match('/ErrorFileIsInfectedWithAVirus/',$resupload)) // Files infected by a virus
{
$mesg = '<div class="error">'.$langs->trans("ErrorFileIsInfectedWithAVirus").'</div>';
}
else // Known error
{
$mesg = '<div class="error">'.$langs->trans($resupload).'</div>';
}
}
}
}
// Delete
if ($action=='delete')
{
$langs->load("other");
$file = $upload_dir . '/' . GETPOST('urlfile'); // Do not use urldecode here ($_GET and $_REQUEST are already decoded by PHP).
dol_delete_file($file);
$_SESSION['DolMessage'] = '<div class="ok">'.$langs->trans("FileWasRemoved",GETPOST('urlfile')).'</div>';
Header('Location: '.$_SERVER["PHP_SELF"].'?id='.$id);
exit;
}
// Retreive First Task ID of Project if withprojet is on to allow project prev next to work
if (! empty($project_ref) && ! empty($withproject))
{
@ -164,6 +115,56 @@ if ($id > 0 || ! empty($ref))
}
}
// Envoi fichier
if ($_POST["sendit"] && ! empty($conf->global->MAIN_UPLOAD_DOC))
{
if (dol_mkdir($upload_dir) >= 0)
{
$resupload=dol_move_uploaded_file($_FILES['userfile']['tmp_name'], $upload_dir . "/" . dol_unescapefile($_FILES['userfile']['name']),0,0,$_FILES['userfile']['error']);
if (is_numeric($resupload) && $resupload > 0)
{
if (image_format_supported($upload_dir . "/" . $_FILES['userfile']['name']) == 1)
{
// Create small thumbs for image (Ratio is near 16/9)
// Used on logon for example
$imgThumbSmall = vignette($upload_dir . "/" . $_FILES['userfile']['name'], $maxwidthsmall, $maxheightsmall, '_small', $quality, "thumbs");
// Create mini thumbs for image (Ratio is near 16/9)
// Used on menu or for setup page for example
$imgThumbMini = vignette($upload_dir . "/" . $_FILES['userfile']['name'], $maxwidthmini, $maxheightmini, '_mini', $quality, "thumbs");
}
$mesg = '<div class="ok">'.$langs->trans("FileTransferComplete").'</div>';
}
else
{
$langs->load("errors");
if ($resupload < 0) // Unknown error
{
$mesg = '<div class="error">'.$langs->trans("ErrorFileNotUploaded").'</div>';
}
else if (preg_match('/ErrorFileIsInfectedWithAVirus/',$resupload)) // Files infected by a virus
{
$mesg = '<div class="error">'.$langs->trans("ErrorFileIsInfectedWithAVirus").'</div>';
}
else // Known error
{
$mesg = '<div class="error">'.$langs->trans($resupload).'</div>';
}
}
}
}
// Delete
if ($action=='delete')
{
$langs->load("other");
$file = $upload_dir . '/' . GETPOST('urlfile'); // Do not use urldecode here ($_GET and $_REQUEST are already decoded by PHP).
dol_delete_file($file);
$_SESSION['DolMessage'] = '<div class="ok">'.$langs->trans("FileWasRemoved",GETPOST('urlfile')).'</div>';
Header('Location: '.$_SERVER["PHP_SELF"].'?id='.$id);
exit;
}
/*
* View
*/

View File

@ -46,17 +46,17 @@ if (!$user->rights->projet->lire) accessforbidden();
$object = new Task($db);
$projectstatic = new Project($db);
if ($id > 0 || ! empty($ref))
{
if ($object->fetch($id,$ref) > 0)
{
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);
}
else
{
dol_print_error($db);
}
if (! empty($projectstatic->socid)) $projectstatic->societe->fetch($projectstatic->socid);
}
else
{
dol_print_error($db);
}
}
@ -78,18 +78,20 @@ if (! empty($project_ref) && ! empty($withproject))
}
}
$permission=($user->rights->projet->creer || $user->rights->projet->all->creer);
/*
* 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));
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));
if ($result < 0) dol_print_error($db,$object->error);
@ -203,7 +205,6 @@ if ($object->id > 0)
print '<br>';
$colwidth=30;
$permission=($user->rights->projet->creer || $user->rights->projet->all->creer);
$moreparam=$param;
include(DOL_DOCUMENT_ROOT.'/core/tpl/notes.tpl.php');

View File

@ -3,6 +3,7 @@
* Copyright (C) 2001-2002 Jean-Louis Bergamo <jlb@j1b.org>
* Copyright (C) 2006-2011 Laurent Destailleur <eldy@users.sourceforge.net>
* 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
* 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
$amount=0;
if (! empty($conf->global->MEMBER_NEWFORM_AMOUNT)) {
$amount=$conf->global->MEMBER_NEWFORM_AMOUNT;
}
if (! empty($conf->global->MEMBER_NEWFORM_PAYONLINE))
{
$amount=GETPOST('amount')?GETPOST('amount'):$conf->global->MEMBER_NEWFORM_AMOUNT;

View File

@ -1984,10 +1984,10 @@ class User extends CommonObject
* Return number of existing 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
*/
function getNbOfUsers($limitTo='',$all=0)
function getNbOfUsers($limitTo='active', $all=false)
{
global $conf;
@ -1999,7 +1999,7 @@ class User extends CommonObject
}
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;
if ($limitTo == 'active') $sql.= " AND statut = 1";
}

View File

@ -123,7 +123,7 @@ if ($action == 'confirm_enable' && $confirm == "yes" && $candisableuser)
if (!empty($conf->file->main_limit_users))
{
$nb = $edituser->getNbOfUsers("active",1);
$nb = $edituser->getNbOfUsers("active");
if ($nb >= $conf->file->main_limit_users)
{
$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
{
$nb = $edituser->getNbOfUsers("active",1);
$nb = $edituser->getNbOfUsers("active");
if ($nb >= $conf->file->main_limit_users)
{
$message='<div class="error">'.$langs->trans("YourQuotaOfUsersIsReached").'</div>';