Merge branch 'develop' of https://github.com/Dolibarr/dolibarr.git into develop
This commit is contained in:
commit
ed9581f77f
@ -672,7 +672,7 @@ if ($nboftargetok) {
|
|||||||
#$cmd="dpkg-source -b $BUILDROOT/$PROJECT-$MAJOR.$MINOR.$build";
|
#$cmd="dpkg-source -b $BUILDROOT/$PROJECT-$MAJOR.$MINOR.$build";
|
||||||
$cmd="dpkg-buildpackage -us -uc";
|
$cmd="dpkg-buildpackage -us -uc";
|
||||||
print "Launch DEB build ($cmd)\n";
|
print "Launch DEB build ($cmd)\n";
|
||||||
$ret=`$cmd`;
|
$ret=`$cmd 2>&1 3>&1`;
|
||||||
print $ret."\n";
|
print $ret."\n";
|
||||||
|
|
||||||
chdir("$olddir");
|
chdir("$olddir");
|
||||||
|
|||||||
@ -17,8 +17,8 @@ beta version of Dolibarr, step by step.
|
|||||||
- Update version number with x.x.x in build/doxygen/dolibarr-doxygen.doxyfile
|
- Update version number with x.x.x in build/doxygen/dolibarr-doxygen.doxyfile
|
||||||
- Update version number with x.x.x in build/perl/virtualmin/dolibarr.pl
|
- Update version number with x.x.x in build/perl/virtualmin/dolibarr.pl
|
||||||
- Commit all changes.
|
- Commit all changes.
|
||||||
- Add a Tag (DOLIBARR_x_y_BETA)
|
- Add a Tag (x.y.betaz_YYYYMMDD) and push it: git push --tags
|
||||||
- Create a branch (DOLIBARR_x_y_BRANCH).
|
- Create a branch (x.y).
|
||||||
|
|
||||||
- Run makepack-dolibarr.pl to generate all packages.
|
- Run makepack-dolibarr.pl to generate all packages.
|
||||||
- Move build files into www.dolibarr.org web site (/home/dolibarr/wwwroot/files).
|
- Move build files into www.dolibarr.org web site (/home/dolibarr/wwwroot/files).
|
||||||
|
|||||||
@ -14,7 +14,7 @@ Summary(es): Software ERP y CRM para pequeñas y medianas empresas, asociaciones
|
|||||||
Summary(fr): Logiciel ERP & CRM de gestion de PME/PMI, auto-entrepreneurs ou associations
|
Summary(fr): Logiciel ERP & CRM de gestion de PME/PMI, auto-entrepreneurs ou associations
|
||||||
Summary(it): Programmo gestionale per piccole imprese, fondazioni e liberi professionisti
|
Summary(it): Programmo gestionale per piccole imprese, fondazioni e liberi professionisti
|
||||||
|
|
||||||
License: GPL-3.0+
|
License: GPLv3+
|
||||||
#Packager: Laurent Destailleur (Eldy) <eldy@users.sourceforge.net>
|
#Packager: Laurent Destailleur (Eldy) <eldy@users.sourceforge.net>
|
||||||
Vendor: Dolibarr dev team
|
Vendor: Dolibarr dev team
|
||||||
|
|
||||||
|
|||||||
@ -18,7 +18,11 @@ Summary(es): Software ERP y CRM para pequeñas y medianas empresas, asociaciones
|
|||||||
Summary(fr): Logiciel ERP & CRM de gestion de PME/PMI, auto-entrepreneurs ou associations
|
Summary(fr): Logiciel ERP & CRM de gestion de PME/PMI, auto-entrepreneurs ou associations
|
||||||
Summary(it): Programmo gestionale per piccole imprese, fondazioni e liberi professionisti
|
Summary(it): Programmo gestionale per piccole imprese, fondazioni e liberi professionisti
|
||||||
|
|
||||||
|
%if 0%{?fedora} || 0%{?rhel_version} || 0%{?centos_version}
|
||||||
|
License: GPLv3+
|
||||||
|
%else
|
||||||
License: GPL-3.0+
|
License: GPL-3.0+
|
||||||
|
%endif
|
||||||
#Packager: Laurent Destailleur (Eldy) <eldy@users.sourceforge.net>
|
#Packager: Laurent Destailleur (Eldy) <eldy@users.sourceforge.net>
|
||||||
Vendor: Dolibarr dev team
|
Vendor: Dolibarr dev team
|
||||||
|
|
||||||
|
|||||||
@ -133,6 +133,8 @@ $memberstatic=new Adherent($db);
|
|||||||
$paymentstatic=new Paiement($db);
|
$paymentstatic=new Paiement($db);
|
||||||
$paymentsupplierstatic=new PaiementFourn($db);
|
$paymentsupplierstatic=new PaiementFourn($db);
|
||||||
$paymentvatstatic=new TVA($db);
|
$paymentvatstatic=new TVA($db);
|
||||||
|
$bankstatic=new Account($db);
|
||||||
|
$banklinestatic=new AccountLine($db);
|
||||||
|
|
||||||
$form = new Form($db);
|
$form = new Form($db);
|
||||||
|
|
||||||
@ -426,7 +428,8 @@ if ($id > 0 || ! empty($ref))
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
$sql = "SELECT b.rowid, b.dateo as do, b.datev as dv,";
|
$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";
|
$sql.= " b.amount, b.label, b.rappro, b.num_releve, b.num_chq, b.fk_type,";
|
||||||
|
$sql.= " ba.rowid as bankid, ba.ref as bankref, ba.label as banklabel";
|
||||||
if ($mode_search)
|
if ($mode_search)
|
||||||
{
|
{
|
||||||
$sql.= ", s.rowid as socid, s.nom as thirdparty";
|
$sql.= ", s.rowid as socid, s.nom as thirdparty";
|
||||||
@ -568,7 +571,34 @@ if ($id > 0 || ! empty($ref))
|
|||||||
}
|
}
|
||||||
else if ($links[$key]['type']=='banktransfert')
|
else if ($links[$key]['type']=='banktransfert')
|
||||||
{
|
{
|
||||||
// Do not show this link (avoid confusion). Can already be accessed from transaction detail
|
// Do not show link to transfer ince there is no transfer card (avoid confusion). Can already be accessed from transaction detail.
|
||||||
|
if ($objp->amount > 0)
|
||||||
|
{
|
||||||
|
$banklinestatic->fetch($links[$key]['url_id']);
|
||||||
|
$bankstatic->id=$banklinestatic->fk_account;
|
||||||
|
$bankstatic->label=$banklinestatic->bank_account_label;
|
||||||
|
print ' ('.$langs->trans("From ");
|
||||||
|
print $bankstatic->getNomUrl(1,'transactions');
|
||||||
|
print ' '.$langs->trans("toward").' ';
|
||||||
|
$bankstatic->id=$objp->bankid;
|
||||||
|
$bankstatic->label=$objp->bankref;
|
||||||
|
print $bankstatic->getNomUrl(1,'');
|
||||||
|
print ')';
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$bankstatic->id=$objp->bankid;
|
||||||
|
$bankstatic->label=$objp->bankref;
|
||||||
|
print ' ('.$langs->trans("From ");
|
||||||
|
print $bankstatic->getNomUrl(1,'');
|
||||||
|
print ' '.$langs->trans("toward").' ';
|
||||||
|
$banklinestatic->fetch($links[$key]['url_id']);
|
||||||
|
$bankstatic->id=$banklinestatic->fk_account;
|
||||||
|
$bankstatic->label=$banklinestatic->bank_account_label;
|
||||||
|
print $bankstatic->getNomUrl(1,'transactions');
|
||||||
|
print ')';
|
||||||
|
}
|
||||||
|
//var_dump($links);
|
||||||
}
|
}
|
||||||
else if ($links[$key]['type']=='member')
|
else if ($links[$key]['type']=='member')
|
||||||
{
|
{
|
||||||
@ -776,4 +806,4 @@ else
|
|||||||
llxFooter();
|
llxFooter();
|
||||||
|
|
||||||
$db->close();
|
$db->close();
|
||||||
?>
|
?>
|
||||||
|
|||||||
@ -1081,7 +1081,7 @@ class AccountLine extends CommonObject
|
|||||||
$sql.= " b.fk_type, b.num_releve, b.num_chq, b.rappro, b.note,";
|
$sql.= " b.fk_type, b.num_releve, b.num_chq, b.rappro, b.note,";
|
||||||
$sql.= " b.fk_bordereau, b.banque, b.emetteur,";
|
$sql.= " b.fk_bordereau, b.banque, b.emetteur,";
|
||||||
//$sql.= " b.author"; // Is this used ?
|
//$sql.= " b.author"; // Is this used ?
|
||||||
$sql.= " ba.label as bank_account_label";
|
$sql.= " ba.ref as bank_account_ref, ba.label as bank_account_label";
|
||||||
$sql.= " FROM ".MAIN_DB_PREFIX."bank as b,";
|
$sql.= " FROM ".MAIN_DB_PREFIX."bank as b,";
|
||||||
$sql.= " ".MAIN_DB_PREFIX."bank_account as ba";
|
$sql.= " ".MAIN_DB_PREFIX."bank_account as ba";
|
||||||
$sql.= " WHERE b.fk_account = ba.rowid";
|
$sql.= " WHERE b.fk_account = ba.rowid";
|
||||||
@ -1122,6 +1122,7 @@ class AccountLine extends CommonObject
|
|||||||
$this->fk_bordereau = $obj->fk_bordereau;
|
$this->fk_bordereau = $obj->fk_bordereau;
|
||||||
|
|
||||||
$this->fk_account = $obj->fk_account;
|
$this->fk_account = $obj->fk_account;
|
||||||
|
$this->bank_account_ref = $obj->bank_account_ref;
|
||||||
$this->bank_account_label = $obj->bank_account_label;
|
$this->bank_account_label = $obj->bank_account_label;
|
||||||
|
|
||||||
$ret=1;
|
$ret=1;
|
||||||
|
|||||||
@ -944,7 +944,7 @@ class DoliDBMysqli
|
|||||||
*
|
*
|
||||||
* @param string $table Name of table
|
* @param string $table Name of table
|
||||||
* @param string $field Optionnel : Name of field if we want description of field
|
* @param string $field Optionnel : Name of field if we want description of field
|
||||||
* @return resource Resource
|
* @return resultset Resultset x (x->Field, x->Type, ...)
|
||||||
*/
|
*/
|
||||||
function DDLDescTable($table,$field="")
|
function DDLDescTable($table,$field="")
|
||||||
{
|
{
|
||||||
|
|||||||
@ -1171,7 +1171,7 @@ class DoliDBPgsql
|
|||||||
*
|
*
|
||||||
* @param string $table Name of table
|
* @param string $table Name of table
|
||||||
* @param string $field Optionnel : Name of field if we want description of field
|
* @param string $field Optionnel : Name of field if we want description of field
|
||||||
* @return resource Resource
|
* @return resultset Resultset x (x->attname)
|
||||||
*/
|
*/
|
||||||
function DDLDescTable($table,$field="")
|
function DDLDescTable($table,$field="")
|
||||||
{
|
{
|
||||||
|
|||||||
@ -729,12 +729,14 @@ function dol_delete_file($file,$disableglob=0,$nophperrors=0,$nohook=0,$object=n
|
|||||||
{
|
{
|
||||||
$error=0;
|
$error=0;
|
||||||
|
|
||||||
//print "x".$file." ".$disableglob;
|
//print "x".$file." ".$disableglob;exit;
|
||||||
$ok=true;
|
$ok=true;
|
||||||
$file_osencoded=dol_osencode($file); // New filename encoded in OS filesystem encoding charset
|
$file_osencoded=dol_osencode($file); // New filename encoded in OS filesystem encoding charset
|
||||||
if (empty($disableglob) && ! empty($file_osencoded))
|
if (empty($disableglob) && ! empty($file_osencoded))
|
||||||
{
|
{
|
||||||
foreach (glob($file_osencoded) as $filename)
|
$globencoded=str_replace('[','\[',$file_osencoded);
|
||||||
|
$globencoded=str_replace(']','\]',$globencoded);
|
||||||
|
foreach (glob($globencoded) as $filename)
|
||||||
{
|
{
|
||||||
if ($nophperrors) $ok=@unlink($filename); // The unlink encapsulated by dolibarr
|
if ($nophperrors) $ok=@unlink($filename); // The unlink encapsulated by dolibarr
|
||||||
else $ok=unlink($filename); // The unlink encapsulated by dolibarr
|
else $ok=unlink($filename); // The unlink encapsulated by dolibarr
|
||||||
|
|||||||
@ -66,8 +66,7 @@ class ImportCsv extends ModeleImports
|
|||||||
global $conf,$langs;
|
global $conf,$langs;
|
||||||
$this->db = $db;
|
$this->db = $db;
|
||||||
|
|
||||||
$this->separator=','; // Change also function cleansep
|
$this->separator=(GETPOST('separator')?GETPOST('separator'):(empty($conf->global->IMPORT_CSV_SEPARATOR_TO_USE)?',':$conf->global->IMPORT_CSV_SEPARATOR_TO_USE));
|
||||||
if (! empty($conf->global->IMPORT_CSV_SEPARATOR_TO_USE)) $this->separator=$conf->global->IMPORT_CSV_SEPARATOR_TO_USE;
|
|
||||||
$this->enclosure='"';
|
$this->enclosure='"';
|
||||||
$this->escape='"';
|
$this->escape='"';
|
||||||
|
|
||||||
@ -177,7 +176,7 @@ class ImportCsv extends ModeleImports
|
|||||||
*/
|
*/
|
||||||
function write_title_example($outputlangs,$headerlinefields)
|
function write_title_example($outputlangs,$headerlinefields)
|
||||||
{
|
{
|
||||||
$s.=join($this->separator,array_map('cleansep',$headerlinefields));
|
$s=join($this->separator,array_map('cleansep',$headerlinefields));
|
||||||
return $s."\n";
|
return $s."\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -582,7 +581,7 @@ class ImportCsv extends ModeleImports
|
|||||||
//var_dump($objimport->array_import_convertvalue); exit;
|
//var_dump($objimport->array_import_convertvalue); exit;
|
||||||
|
|
||||||
// Build SQL request
|
// Build SQL request
|
||||||
if (! tablewithentity($tablename))
|
if (! tablewithentity($tablename))
|
||||||
{
|
{
|
||||||
$sql ='INSERT INTO '.$tablename.'('.$listfields.', import_key';
|
$sql ='INSERT INTO '.$tablename.'('.$listfields.', import_key';
|
||||||
if (! empty($objimport->array_import_tables_creator[0][$alias])) $sql.=', '.$objimport->array_import_tables_creator[0][$alias];
|
if (! empty($objimport->array_import_tables_creator[0][$alias])) $sql.=', '.$objimport->array_import_tables_creator[0][$alias];
|
||||||
@ -637,12 +636,12 @@ class ImportCsv extends ModeleImports
|
|||||||
/**
|
/**
|
||||||
* Clean a string from separator
|
* Clean a string from separator
|
||||||
*
|
*
|
||||||
* @param string $value Remove separator
|
* @param string $value Remove standard separators
|
||||||
* @return string String without separator
|
* @return string String without separators
|
||||||
*/
|
*/
|
||||||
function cleansep($value)
|
function cleansep($value)
|
||||||
{
|
{
|
||||||
return str_replace(',','/',$value);
|
return str_replace(array(',',';'),'/',$value);
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -654,25 +653,16 @@ function cleansep($value)
|
|||||||
function tablewithentity($table)
|
function tablewithentity($table)
|
||||||
{
|
{
|
||||||
global $db;
|
global $db;
|
||||||
$sql = "SHOW COLUMNS FROM ".$table." LIKE 'entity'";
|
|
||||||
|
$resql=$db->DDLDescTable($table,'entity');
|
||||||
$resql=$db->query($sql);
|
if ($resql)
|
||||||
if ($resql)
|
{
|
||||||
{
|
$i=0;
|
||||||
$numrows=$db->num_rows($resql);
|
$obj=$db->fetch_object($resql);
|
||||||
if ($numrows)
|
if ($obj) return 1;
|
||||||
{
|
else return 0;
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
return -1;
|
|
||||||
}
|
}
|
||||||
|
else return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|||||||
@ -357,8 +357,8 @@ class modSociete extends DolibarrModules
|
|||||||
$this->import_label[$r]='ImportDataset_company_2';
|
$this->import_label[$r]='ImportDataset_company_2';
|
||||||
$this->import_icon[$r]='contact';
|
$this->import_icon[$r]='contact';
|
||||||
$this->import_entities_array[$r]=array('s.fk_soc'=>'company'); // We define here only fields that use another icon that the one defined into import_icon
|
$this->import_entities_array[$r]=array('s.fk_soc'=>'company'); // We define here only fields that use another icon that the one defined into import_icon
|
||||||
$this->import_tables_array[$r]=array('s'=>MAIN_DB_PREFIX.'socpeople'); // List of tables to insert into (insert done in same order)
|
$this->import_tables_array[$r]=array('s'=>MAIN_DB_PREFIX.'socpeople','extra'=>MAIN_DB_PREFIX.'socpeople_extrafields'); // List of tables to insert into (insert done in same order)
|
||||||
$this->import_fields_array[$r]=array('s.fk_soc'=>'ThirdPartyName*','s.civilite'=>'UserTitle','s.name'=>"Name*",'s.firstname'=>"Firstname",'s.address'=>"Address",'s.zip'=>"Zip",'s.town'=>"Town",'s.fk_pays'=>"CountryCode",'s.birthday'=>"BirthdayDate",'s.poste'=>"Role",'s.phone'=>"Phone",'s.phone_perso'=>"PhonePerso",'s.phone_mobile'=>"PhoneMobile",'s.fax'=>"Fax",'s.email'=>"Email",'s.note'=>"Note",'s.datec'=>"DateCreation");
|
$this->import_fields_array[$r]=array('s.fk_soc'=>'ThirdPartyName*','s.civilite'=>'UserTitle','s.lastname'=>"Name*",'s.firstname'=>"Firstname",'s.address'=>"Address",'s.zip'=>"Zip",'s.town'=>"Town",'s.fk_pays'=>"CountryCode",'s.birthday'=>"BirthdayDate",'s.poste'=>"Role",'s.phone'=>"Phone",'s.phone_perso'=>"PhonePerso",'s.phone_mobile'=>"PhoneMobile",'s.fax'=>"Fax",'s.email'=>"Email",'s.note'=>"Note",'s.datec'=>"DateCreation");
|
||||||
// Add extra fields
|
// Add extra fields
|
||||||
$sql="SELECT name, label, fieldrequired FROM ".MAIN_DB_PREFIX."extrafields WHERE elementtype = 'contact'";
|
$sql="SELECT name, label, fieldrequired FROM ".MAIN_DB_PREFIX."extrafields WHERE elementtype = 'contact'";
|
||||||
$resql=$this->db->query($sql);
|
$resql=$this->db->query($sql);
|
||||||
@ -372,7 +372,7 @@ class modSociete extends DolibarrModules
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
// End add extra fields
|
// End add extra fields
|
||||||
$this->import_fieldshidden_array[$r]=array('s.fk_user_creat'=>'user->id'); // aliastable.field => ('user->id' or 'lastrowid-'.tableparent)
|
$this->import_fieldshidden_array[$r]=array('s.fk_user_creat'=>'user->id','extra.fk_object'=>'lastrowid-'.MAIN_DB_PREFIX.'socpeople'); // aliastable.field => ('user->id' or 'lastrowid-'.tableparent)
|
||||||
$this->import_convertvalue_array[$r]=array(
|
$this->import_convertvalue_array[$r]=array(
|
||||||
's.fk_soc'=>array('rule'=>'fetchidfromref','file'=>'/societe/class/societe.class.php','class'=>'Societe','method'=>'fetch','element'=>'ThirdParty'),
|
's.fk_soc'=>array('rule'=>'fetchidfromref','file'=>'/societe/class/societe.class.php','class'=>'Societe','method'=>'fetch','element'=>'ThirdParty'),
|
||||||
's.fk_pays'=>array('rule'=>'fetchidfromcodeid','classfile'=>'/core/class/cpays.class.php','class'=>'Cpays','method'=>'fetch','dict'=>'DictionnaryCountry'),
|
's.fk_pays'=>array('rule'=>'fetchidfromcodeid','classfile'=>'/core/class/cpays.class.php','class'=>'Cpays','method'=>'fetch','dict'=>'DictionnaryCountry'),
|
||||||
|
|||||||
@ -54,7 +54,7 @@
|
|||||||
else if (type == 'separate') { size.val('').attr('disabled','disabled'); unique.attr('disabled','disabled'); required.val('').attr('disabled','disabled'); default_value.val('').attr('disabled','disabled'); jQuery("#value_choice").hide();}
|
else if (type == 'separate') { size.val('').attr('disabled','disabled'); unique.attr('disabled','disabled'); required.val('').attr('disabled','disabled'); default_value.val('').attr('disabled','disabled'); jQuery("#value_choice").hide();}
|
||||||
else size.val('').attr('disabled','disabled');
|
else size.val('').attr('disabled','disabled');
|
||||||
}
|
}
|
||||||
init_typeoffields('');
|
init_typeoffields('<?php echo GETPOST('type'); ?>');
|
||||||
jQuery("#type").change(function() {
|
jQuery("#type").change(function() {
|
||||||
init_typeoffields($(this).val());
|
init_typeoffields($(this).val());
|
||||||
});
|
});
|
||||||
|
|||||||
@ -2,19 +2,19 @@
|
|||||||
/* Copyright (C) 2012 Nicolas Villa aka Boyquotes http://informetic.fr
|
/* Copyright (C) 2012 Nicolas Villa aka Boyquotes http://informetic.fr
|
||||||
* Copyright (C) 2013 Florian Henry <florian.henry@open-concpt.pro>
|
* Copyright (C) 2013 Florian Henry <florian.henry@open-concpt.pro>
|
||||||
*
|
*
|
||||||
* 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
|
||||||
* the Free Software Foundation; either version 3 of the License, or
|
* the Free Software Foundation; either version 3 of the License, or
|
||||||
* (at your option) any later version.
|
* (at your option) any later version.
|
||||||
*
|
*
|
||||||
* This program is distributed in the hope that it will be useful,
|
* This program is distributed in the hope that it will be useful,
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
* GNU General Public License for more details.
|
* GNU General Public License for more details.
|
||||||
*
|
*
|
||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \file cron/card.php
|
* \file cron/card.php
|
||||||
|
|||||||
@ -1,24 +1,23 @@
|
|||||||
<?php
|
<?php
|
||||||
/* Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
|
/* Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
|
||||||
*
|
*
|
||||||
* 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
|
||||||
* the Free Software Foundation; either version 3 of the License, or
|
* the Free Software Foundation; either version 3 of the License, or
|
||||||
* (at your option) any later version.
|
* (at your option) any later version.
|
||||||
*
|
*
|
||||||
* This program is distributed in the hope that it will be useful,
|
* This program is distributed in the hope that it will be useful,
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
* GNU General Public License for more details.
|
* GNU General Public License for more details.
|
||||||
*
|
*
|
||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* along with this program; if not, write to the Free Software
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
*/
|
||||||
*/
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \file /cron/cron/info.php
|
* \file /cron/cron/info.php
|
||||||
* \brief Page fiche d'une operation
|
* \brief Page fiche d'une operation
|
||||||
*/
|
*/
|
||||||
|
|
||||||
require '../main.inc.php';
|
require '../main.inc.php';
|
||||||
|
|||||||
@ -1017,7 +1017,7 @@ if ($step == 4 && $datatoimport)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
print '<a class="butActionRefused" href="#" title="'.dol_escape_htmltag($langs->trans("SomeMandatoryFieldHaveNoSource")).'">'.$langs->trans("NextStep").'</a>';
|
print '<a class="butActionRefused" href="#" title="'.dol_escape_htmltag($langs->transnoentitiesnoconv("SomeMandatoryFieldHaveNoSource")).'">'.$langs->trans("NextStep").'</a>';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1281,7 +1281,7 @@ if ($step == 5 && $datatoimport)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
print '<a class="butActionRefused" href="#" title="'.dol_escape_htmltag($langs->trans("NotEnoughPermissions")).'">'.$langs->trans("RunSimulateImportFile").'</a>';
|
print '<a class="butActionRefused" href="#" title="'.dol_escape_htmltag($langs->transnoentitiesnoconv("NotEnoughPermissions")).'">'.$langs->trans("RunSimulateImportFile").'</a>';
|
||||||
}
|
}
|
||||||
print '</center>';
|
print '</center>';
|
||||||
}
|
}
|
||||||
|
|||||||
@ -36,6 +36,7 @@ class Project extends CommonObject
|
|||||||
public $table_element = 'projet'; //!< Name of table without prefix where object is stored
|
public $table_element = 'projet'; //!< Name of table without prefix where object is stored
|
||||||
public $table_element_line = 'projet_task';
|
public $table_element_line = 'projet_task';
|
||||||
public $fk_element = 'fk_projet';
|
public $fk_element = 'fk_projet';
|
||||||
|
protected $ismultientitymanaged = 1; // 0=No test on entity, 1=Test with field entity, 2=Test with link by societe
|
||||||
|
|
||||||
var $id;
|
var $id;
|
||||||
var $ref;
|
var $ref;
|
||||||
@ -52,6 +53,7 @@ class Project extends CommonObject
|
|||||||
var $statuts_short;
|
var $statuts_short;
|
||||||
var $statuts;
|
var $statuts;
|
||||||
var $oldcopy;
|
var $oldcopy;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor
|
* Constructor
|
||||||
|
|||||||
@ -44,12 +44,6 @@ if ($id == '' && $ref == '' && ($action != "create" && $action != "add" && $acti
|
|||||||
$mine = GETPOST('mode')=='mine' ? 1 : 0;
|
$mine = GETPOST('mode')=='mine' ? 1 : 0;
|
||||||
//if (! $user->rights->projet->all->lire) $mine=1; // Special for projects
|
//if (! $user->rights->projet->all->lire) $mine=1; // Special for projects
|
||||||
|
|
||||||
|
|
||||||
// Security check
|
|
||||||
$socid=0;
|
|
||||||
if ($user->societe_id > 0) $socid=$user->societe_id;
|
|
||||||
$result = restrictedArea($user, 'projet', $id);
|
|
||||||
|
|
||||||
// Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array
|
// Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array
|
||||||
$hookmanager->initHooks(array('projectcard'));
|
$hookmanager->initHooks(array('projectcard'));
|
||||||
|
|
||||||
@ -61,6 +55,11 @@ if ($object->id > 0)
|
|||||||
$object->fetch_thirdparty();
|
$object->fetch_thirdparty();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Security check
|
||||||
|
$socid=0;
|
||||||
|
if ($user->societe_id > 0) $socid=$user->societe_id;
|
||||||
|
$result = restrictedArea($user, 'projet', $object->id);
|
||||||
|
|
||||||
// fetch optionals attributes and labels
|
// fetch optionals attributes and labels
|
||||||
$extralabels=$extrafields->fetch_name_optionals_label($object->table_element);
|
$extralabels=$extrafields->fetch_name_optionals_label($object->table_element);
|
||||||
|
|
||||||
@ -137,7 +136,7 @@ if ($action == 'add' && $user->rights->projet->creer)
|
|||||||
$object->datec=dol_now();
|
$object->datec=dol_now();
|
||||||
$object->date_start=$date_start;
|
$object->date_start=$date_start;
|
||||||
$object->date_end=$date_end;
|
$object->date_end=$date_end;
|
||||||
|
|
||||||
// Fill array 'array_options' with data from add form
|
// Fill array 'array_options' with data from add form
|
||||||
$ret = $extrafields->setOptionalsFromPost($extralabels,$object);
|
$ret = $extrafields->setOptionalsFromPost($extralabels,$object);
|
||||||
|
|
||||||
@ -209,7 +208,7 @@ if ($action == 'update' && ! $_POST["cancel"] && $user->rights->projet->creer)
|
|||||||
$object->public = GETPOST('public','alpha');
|
$object->public = GETPOST('public','alpha');
|
||||||
$object->date_start = empty($_POST["project"])?'':$date_start;
|
$object->date_start = empty($_POST["project"])?'':$date_start;
|
||||||
$object->date_end = empty($_POST["projectend"])?'':$date_end;
|
$object->date_end = empty($_POST["projectend"])?'':$date_end;
|
||||||
|
|
||||||
// Fill array 'array_options' with data from add form
|
// Fill array 'array_options' with data from add form
|
||||||
$ret = $extrafields->setOptionalsFromPost($extralabels,$object);
|
$ret = $extrafields->setOptionalsFromPost($extralabels,$object);
|
||||||
|
|
||||||
@ -560,7 +559,7 @@ else
|
|||||||
{
|
{
|
||||||
print $object->showOptionals($extrafields,'edit');
|
print $object->showOptionals($extrafields,'edit');
|
||||||
}
|
}
|
||||||
|
|
||||||
print '</table>';
|
print '</table>';
|
||||||
|
|
||||||
print '<div align="center"><br>';
|
print '<div align="center"><br>';
|
||||||
@ -741,10 +740,13 @@ else
|
|||||||
|
|
||||||
print '</td><td valign="top" width="50%">';
|
print '</td><td valign="top" width="50%">';
|
||||||
|
|
||||||
// List of actions on element
|
if (!empty($object->id))
|
||||||
include_once DOL_DOCUMENT_ROOT.'/core/class/html.formactions.class.php';
|
{
|
||||||
$formactions=new FormActions($db);
|
// List of actions on element
|
||||||
$somethingshown=$formactions->showactions($object,'project',$socid);
|
include_once DOL_DOCUMENT_ROOT.'/core/class/html.formactions.class.php';
|
||||||
|
$formactions=new FormActions($db);
|
||||||
|
$somethingshown=$formactions->showactions($object,'project',$socid);
|
||||||
|
}
|
||||||
|
|
||||||
print '</td></tr></table>';
|
print '</td></tr></table>';
|
||||||
}
|
}
|
||||||
|
|||||||
@ -13,8 +13,7 @@
|
|||||||
* GNU General Public License for more details.
|
* GNU General Public License for more details.
|
||||||
*
|
*
|
||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* along with this program; if not, write to the Free Software
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@ -13,8 +13,7 @@
|
|||||||
* GNU General Public License for more details.
|
* GNU General Public License for more details.
|
||||||
*
|
*
|
||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* along with this program; if not, write to the Free Software
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@ -326,7 +326,7 @@ class FilesLibTest extends PHPUnit_Framework_TestCase
|
|||||||
// Again to test with overwriting=1
|
// Again to test with overwriting=1
|
||||||
$result=dol_copy($file, $conf->admin->dir_temp.'/file.csv',0,1);
|
$result=dol_copy($file, $conf->admin->dir_temp.'/file.csv',0,1);
|
||||||
print __METHOD__." result=".$result."\n";
|
print __METHOD__." result=".$result."\n";
|
||||||
$this->assertGreaterThanOrEqual(1,$result,'copy destination already eists, overwrite'); // Should be 1
|
$this->assertGreaterThanOrEqual(1,$result,'copy destination already exists, overwrite'); // Should be 1
|
||||||
|
|
||||||
// Again to test with overwriting=1
|
// Again to test with overwriting=1
|
||||||
$result=dol_move($conf->admin->dir_temp.'/file.csv',$conf->admin->dir_temp.'/file2.csv',0,1);
|
$result=dol_move($conf->admin->dir_temp.'/file.csv',$conf->admin->dir_temp.'/file2.csv',0,1);
|
||||||
@ -341,6 +341,16 @@ class FilesLibTest extends PHPUnit_Framework_TestCase
|
|||||||
$result=dol_delete_file($conf->admin->dir_temp.'/file2.csv');
|
$result=dol_delete_file($conf->admin->dir_temp.'/file2.csv');
|
||||||
print __METHOD__." result=".$result."\n";
|
print __METHOD__." result=".$result."\n";
|
||||||
$this->assertTrue($result,'delete file that does not exists');
|
$this->assertTrue($result,'delete file that does not exists');
|
||||||
|
|
||||||
|
// Test copy with special char / delete with blob
|
||||||
|
$result=dol_copy($file, $conf->admin->dir_temp.'/file with [x] and é.csv',0,1);
|
||||||
|
print __METHOD__." result=".$result."\n";
|
||||||
|
$this->assertGreaterThanOrEqual(1,$result,'copy file with special chars, overwrite'); // Should be 1
|
||||||
|
|
||||||
|
// Try to delete using a glob criteria
|
||||||
|
$result=dol_delete_file($conf->admin->dir_temp.'/file with [x]*é.csv');
|
||||||
|
print __METHOD__." result=".$result."\n";
|
||||||
|
$this->assertTrue($result,'delete file using glob');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user