Merge branch 'Upstream/develop'

This commit is contained in:
aspangaro 2014-09-04 04:34:04 +02:00
commit 102e85e1e7
13 changed files with 63 additions and 136 deletions

View File

@ -5,6 +5,7 @@ English Dolibarr ChangeLog
***** ChangeLog for 3.7 compared to 3.6.* ***** ***** ChangeLog for 3.7 compared to 3.6.* *****
For users: For users:
- New: Add proposals into referer page of thirdparty.
- New: On contact list can set filter on both active and not active (no more exclusive select). - New: On contact list can set filter on both active and not active (no more exclusive select).
- New: Each user can include its own external ics calendar into dolibarr agenda view. - New: Each user can include its own external ics calendar into dolibarr agenda view.
- New: Intervention documents are now available in ECM module. - New: Intervention documents are now available in ECM module.

View File

@ -254,11 +254,11 @@ foreach($property as $key => $prop)
$varprop.="\t\t\$sql.= \" "; $varprop.="\t\t\$sql.= \" ";
if ($prop['istime']) if ($prop['istime'])
{ {
$varprop.='".(! isset($this->'.$prop['field'].') || dol_strlen($this->'.$prop['field'].')==0?\'NULL\':$this->db->idate('; $varprop.='".(! isset($this->'.$prop['field'].') || dol_strlen($this->'.$prop['field'].')==0?\'NULL\':"\'".$this->db->idate(';
$varprop.="\$this->".$prop['field'].""; $varprop.="\$this->".$prop['field']."";
$varprop.='))."'; $varprop.=')."\'")."';
if ($i < count($property)) $varprop.=","; if ($i < count($property)) $varprop.=",";
$varprop.="\";"; $varprop.='";';
} }
elseif ($prop['ischar']) elseif ($prop['ischar'])
{ {

View File

@ -1,95 +0,0 @@
<?php
/* Copyright (C) 2006-2009 Laurent Destailleur <eldy@users.sourceforge.net>
*
* 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 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/**
* \file htdocs/accountancy/class/accountancyaccount.class.php
* \ingroup accounting
* \brief Fichier de la classe des comptes comptables
*/
/**
* \class AccountancyAccount
* \brief Classe permettant la gestion des comptes
*/
class AccountancyAccount
{
var $db;
var $error;
var $rowid;
var $fk_pcg_version;
var $pcg_type;
var $pcg_subtype;
var $label;
var $account_number;
var $account_parent;
/**
* Constructor
*
* @param DoliDB $db Database handler
*/
function __construct($db)
{
$this->db = $db;
}
/**
* Insert account into database
*
* @param User $user User making add
* @return int <0 if KO, Id line added if OK
*/
function create($user)
{
$now=dol_now();
$sql = "INSERT INTO ".MAIN_DB_PREFIX."accountingaccount";
$sql.= " (date_creation, fk_user_author, numero,intitule)";
$sql.= " VALUES ('".$this->db->idate($now)."',".$user->id.",'".$this->numero."','".$this->intitule."')";
$resql = $this->db->query($sql);
if ($resql)
{
$id = $this->db->last_insert_id(MAIN_DB_PREFIX."accountingaccount");
if ($id > 0)
{
$this->id = $id;
$result = $this->id;
}
else
{
$result = -2;
$this->error="AccountancyAccount::Create Erreur $result";
dol_syslog($this->error, LOG_ERR);
}
}
else
{
$result = -1;
$this->error="AccountancyAccount::Create Erreur $result";
dol_syslog($this->error, LOG_ERR);
}
return $result;
}
}

View File

@ -43,20 +43,22 @@ class AccountingAccount
var $active; var $active;
/** /**
* Constructor * Constructor
* *
* @param DoliDB $db Database handler * @param DoliDB $db Database handle
*/ */
function __construct($db, $rowid = '') function __construct($db)
{ {
$this->db = $db; $this->db = $db;
if ($rowid != '')
return $this->fetch($rowid);
} }
/** /**
* \brief Load record in memory * Load record in memory
*
* @param int $rowid Id
* @param string $account_number Account number
* @return int <0 if KO, >0 if OK
*/ */
function fetch($rowid = null, $account_number = null) function fetch($rowid = null, $account_number = null)
{ {
@ -95,8 +97,11 @@ class AccountingAccount
} }
/** /**
* \brief insert line in accountingaccount * Insert line in accountingaccount
* \param user utilisateur qui effectue l'insertion *
* @param User $user Use making action
* @param int $notrigger Disable triggers
* @return int <0 if KO, >0 if OK
*/ */
function create($user, $notrigger = 0) function create($user, $notrigger = 0)
{ {
@ -195,8 +200,8 @@ class AccountingAccount
/** /**
* Update record * Update record
* *
* @param User $user update * @param User $user Use making update
* @return int if KO, >0 if OK * @return int <0 if KO, >0 if OK
*/ */
function update($user) function update($user)
{ {
@ -231,8 +236,7 @@ class AccountingAccount
/** /**
* Check usage of accounting code * Check usage of accounting code
* *
* @param User $user update * @return int <0 if KO, >0 if OK
* @return int if KO, >0 if OK
*/ */
function checkUsage() function checkUsage()
{ {
@ -264,10 +268,10 @@ class AccountingAccount
/** /**
* Delete object in database * Delete object in database
* *
* @param User $user User object of making delete * @param User $user User that deletes
* @param int $notrigger 1=Disable all triggers * @param int $notrigger 0=triggers after, 1=disable triggers
* @return int * @return int <0 if KO, >0 if OK
*/ */
function delete($user, $notrigger = 0) function delete($user, $notrigger = 0)
{ {
global $conf, $langs; global $conf, $langs;
@ -363,8 +367,8 @@ class AccountingAccount
/** /**
* Account desactivate * Account desactivate
* *
* @param User $user update * @param int $id Id
* @return int if KO, >0 if OK * @return int <0 if KO, >0 if OK
*/ */
function account_desactivate($id) function account_desactivate($id)
{ {
@ -398,8 +402,8 @@ class AccountingAccount
/** /**
* Account activate * Account activate
* *
* @param User $user update * @param int $id Id
* @return int if KO, >0 if OK * @return int <0 if KO, >0 if OK
*/ */
function account_activate($id) function account_activate($id)
{ {

View File

@ -1,6 +1,6 @@
<?php <?php
/* Copyright (C) 2001-2005 Rodolphe Quiedeville <rodolphe@quiedeville.org> /* Copyright (C) 2001-2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2011 Laurent Destailleur <eldy@users.sourceforge.net> * Copyright (C) 2004-2014 Laurent Destailleur <eldy@users.sourceforge.net>
* Copytight (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com> * Copytight (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.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
@ -51,7 +51,6 @@ $link='';
if ($statut == '') $link='<a href="'.$_SERVER["PHP_SELF"].'?statut=all">'.$langs->trans("IncludeClosedAccount").'</a>'; if ($statut == '') $link='<a href="'.$_SERVER["PHP_SELF"].'?statut=all">'.$langs->trans("IncludeClosedAccount").'</a>';
if ($statut == 'all') $link='<a href="'.$_SERVER["PHP_SELF"].'">'.$langs->trans("OnlyOpenedAccount").'</a>'; if ($statut == 'all') $link='<a href="'.$_SERVER["PHP_SELF"].'">'.$langs->trans("OnlyOpenedAccount").'</a>';
print_fiche_titre($langs->trans("AccountsArea"),$link); print_fiche_titre($langs->trans("AccountsArea"),$link);
print '<br>';
// On charge tableau des comptes financiers (ouverts par defaut) // On charge tableau des comptes financiers (ouverts par defaut)

View File

@ -207,7 +207,6 @@ if ($type == 'directory')
if ($section === '0') if ($section === '0')
{ {
$filearray=array(); $filearray=array();
$textifempty='<br><div align="center"><font class="warning">'.$langs->trans("DirNotSynchronizedSyncFirst").'</font></div><br>';
} }
else $filearray=dol_dir_list($upload_dir,"files",0,'',array('^\.','(\.meta|_preview\.png)$','^temp$','^CVS$'),$sortfield, $sorting,1); else $filearray=dol_dir_list($upload_dir,"files",0,'',array('^\.','(\.meta|_preview\.png)$','^temp$','^CVS$'),$sortfield, $sorting,1);
@ -216,6 +215,7 @@ if ($type == 'directory')
$param.='&section='.$section; $param.='&section='.$section;
$textifempty = $langs->trans('NoFileFound'); $textifempty = $langs->trans('NoFileFound');
} }
else if ($section === '0') $textifempty='<br><div align="center"><font class="warning">'.$langs->trans("DirNotSynchronizedSyncFirst").'</font></div><br>';
else $textifempty=($showonrightsize=='featurenotyetavailable'?$langs->trans("FeatureNotYetAvailable"):$langs->trans("ECMSelectASection")); else $textifempty=($showonrightsize=='featurenotyetavailable'?$langs->trans("FeatureNotYetAvailable"):$langs->trans("ECMSelectASection"));
$formfile->list_of_documents($filearray,'','ecm',$param,1,$relativepath,$user->rights->ecm->upload,1,$textifempty,$maxlengthname,'',$url); $formfile->list_of_documents($filearray,'','ecm',$param,1,$relativepath,$user->rights->ecm->upload,1,$textifempty,$maxlengthname,'',$url);

View File

@ -145,7 +145,8 @@ if (file_exists($fullpathselecteddir))
{ {
if (empty($val['fullrelativename'])) // If we did not find entry into database, but found a directory (dol_is_dir was ok at previous test) if (empty($val['fullrelativename'])) // If we did not find entry into database, but found a directory (dol_is_dir was ok at previous test)
{ {
$val['fullrelativename']=$file; $val['id']=0; $val['fullrelativename']=$file;
$val['id']=0;
$val['label']=$file; $val['label']=$file;
$val['description']=''; $val['description']='';
$nboffilesinsubdir=$langs->trans("Unknown"); $nboffilesinsubdir=$langs->trans("Unknown");

View File

@ -26,7 +26,7 @@
* Parent class for class inheritance lines of business objects * Parent class for class inheritance lines of business objects
* This class is useless for the moment so no inherit are done on it * This class is useless for the moment so no inherit are done on it
*/ */
abstract class CommonObjectLine extends CommonObject abstract class CommonObjectLine
{ {
/** /**
* Call trigger based on this instance * Call trigger based on this instance

View File

@ -759,7 +759,7 @@ class FormFile
if ($nboffiles > 0) include_once DOL_DOCUMENT_ROOT.'/core/lib/images.lib.php'; if ($nboffiles > 0) include_once DOL_DOCUMENT_ROOT.'/core/lib/images.lib.php';
$var=true; $var=false;
foreach($filearray as $key => $file) // filearray must be only files here foreach($filearray as $key => $file) // filearray must be only files here
{ {
if ($file['name'] != '.' if ($file['name'] != '.'

View File

@ -127,7 +127,7 @@ function fichinter_admin_prepare_head()
$h++; $h++;
$head[$h][0] = DOL_URL_ROOT.'/fichinter/admin/fichinterdet_extrafields.php'; $head[$h][0] = DOL_URL_ROOT.'/fichinter/admin/fichinterdet_extrafields.php';
$head[$h][1] = $langs->trans("ExtraFields"); $head[$h][1] = $langs->trans("ExtraFieldsLines");
$head[$h][2] = 'attributesdet'; $head[$h][2] = 'attributesdet';
$h++; $h++;

View File

@ -511,7 +511,7 @@ class EcmDirectory // extends CommonObject
/** /**
* Reconstruit l'arborescence des categories sous la forme d'un tableau * Reconstruit l'arborescence des categories sous la forme d'un tableau à partir de la base de donnée
* Renvoi un tableau de tableau('id','id_mere',...) trie selon arbre et avec: * Renvoi un tableau de tableau('id','id_mere',...) trie selon arbre et avec:
* id Id de la categorie * id Id de la categorie
* id_mere Id de la categorie mere * id_mere Id de la categorie mere

View File

@ -42,7 +42,7 @@ $(document).ready(function() {
}, },
// Called if we click on a dir (not a file) // Called if we click on a dir (not a file)
function(elem) { function(elem) {
id=elem.attr('id').substr(12); id=elem.attr('id').substr(12); // We get id that is 'fmdirlia_id_xxx' (id we want is xxx)
jQuery("#formuserfile_section_dir").val(elem.attr('rel')); jQuery("#formuserfile_section_dir").val(elem.attr('rel'));
jQuery("#formuserfile_section_id").val(id); jQuery("#formuserfile_section_id").val(id);
jQuery('#formuserfile').show(); jQuery('#formuserfile').show();
@ -65,6 +65,9 @@ $(document).ready(function() {
function loadandshowpreview(filedirname,section) function loadandshowpreview(filedirname,section)
{ {
//alert('filedirname='+filedirname); //alert('filedirname='+filedirname);
//console.log(filedirname);
//console.log(section);
$('#ecmfileview').empty(); $('#ecmfileview').empty();
var url = '<?php echo dol_buildpath('/core/ajax/ajaxdirpreview.php',1); ?>?action=preview&module=ecm&section='+section+'&file='+urlencode(filedirname); var url = '<?php echo dol_buildpath('/core/ajax/ajaxdirpreview.php',1); ?>?action=preview&module=ecm&section='+section+'&file='+urlencode(filedirname);

View File

@ -131,8 +131,9 @@ if ($object->client)
$obj = $db->fetch_object($resql); $obj = $db->fetch_object($resql);
$nbFactsClient = $obj->nb; $nbFactsClient = $obj->nb;
$thirdTypeArray['customer']=$langs->trans("customer"); $thirdTypeArray['customer']=$langs->trans("customer");
if($conf->facture->enabled && $user->rights->facture->lire) $elementTypeArray['invoice']=$langs->trans('Invoices');
if ($conf->commande->enabled && $user->rights->commande->lire) $elementTypeArray['order']=$langs->trans('Orders'); if ($conf->commande->enabled && $user->rights->commande->lire) $elementTypeArray['order']=$langs->trans('Orders');
if ($conf->propal->enabled && $user->rights->propal->lire) $elementTypeArray['propal']=$langs->trans('Proposals');
if ($conf->facture->enabled && $user->rights->facture->lire) $elementTypeArray['invoice']=$langs->trans('Invoices');
} }
if ($object->fournisseur) if ($object->fournisseur)
@ -177,6 +178,19 @@ if ($type_element == 'invoice')
$doc_number='f.facnumber'; $doc_number='f.facnumber';
$thirdTypeSelect='customer'; $thirdTypeSelect='customer';
} }
if ($type_element == 'propal')
{
require_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php';
$documentstatic=new Propal($db);
$sql_select = 'SELECT c.rowid as doc_id, c.ref as doc_number, \'1\' as doc_type, c.datep as datePrint, ';
$tables_from = MAIN_DB_PREFIX."propal as c,".MAIN_DB_PREFIX."propaldet as d";
$where = " WHERE c.fk_soc = s.rowid AND s.rowid = ".$socid;
$where.= " AND d.fk_propal = c.rowid";
$where.= " AND c.entity = ".$conf->entity;
$datePrint = 'c.datep';
$doc_number='c.ref';
$thirdTypeSelect='customer';
}
if ($type_element == 'order') if ($type_element == 'order')
{ {
require_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php'; require_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php';