Merge branch 'develop' into commercial-name

Conflicts:
	htdocs/comm/card.php
This commit is contained in:
Marcos García de La Fuente 2015-03-30 03:25:57 +02:00
commit 8b8171c700
1915 changed files with 62589 additions and 6772 deletions

View File

@ -104,16 +104,15 @@ before_script:
script:
- cd htdocs/install
- date
# - php upgrade.php 3.4.0 3.5.0 > upgrade.log
# - php upgrade2.php 3.4.0 3.5.0 > upgrade2.log
- php upgrade.php 3.5.0 3.6.0 >> upgrade.log
- php upgrade2.php 3.5.0 3.6.0 >> upgrade2.log
- php upgrade.php 3.6.0 3.7.0 >> upgrade.log
# - cat upgrade360370.log
- php upgrade2.php 3.6.0 3.7.0 >> upgrade2.log
- php upgrade.php 3.7.0 3.8.0 >> upgrade.log
- php upgrade2.php 3.7.0 3.8.0 >> upgrade2.log
# - cat upgrade2.log
# - php upgrade.php 3.4.0 3.5.0 ignoredbversion > upgrade340350.log
# - php upgrade2.php 3.4.0 3.5.0 ignoredbversion > upgrade340350-2.log
- php upgrade.php 3.5.0 3.6.0 ignoredbversion > upgrade350360.log
- php upgrade2.php 3.5.0 3.6.0 ignoredbversion > upgrade350360-2.log
- php upgrade.php 3.6.0 3.7.0 ignoredbversion > upgrade360370.log
- php upgrade2.php 3.6.0 3.7.0 ignoredbversion > upgrade360370-2.log
- php upgrade.php 3.7.0 3.8.0 ignoredbversion > upgrade370380.log
- php upgrade2.php 3.7.0 3.8.0 ignoredbversion > upgrade370380-2.log
# - cat upgrade370380-2.log
- cd ../..
- date
- phpunit -d memory_limit=-1 --configuration test/phpunit/phpunittest.xml test/phpunit/AllTests.php

View File

@ -1,6 +1,6 @@
[main]
host = https://www.transifex.com
lang_map = uz: uz_UZ
lang_map = uz: uz_UZ, sw: sw_SW
[dolibarr.accountancy]
file_filter = htdocs/langs/<lang>/accountancy.lang
@ -146,6 +146,12 @@ source_file = htdocs/langs/en_US/holiday.lang
source_lang = en_US
type = MOZILLAPROPERTIES
[dolibarr.incoterm]
file_filter = htdocs/langs/<lang>/incoterm.lang
source_file = htdocs/langs/en_US/incoterm.lang
source_lang = en_US
type = MOZILLAPROPERTIES
[dolibarr.install]
file_filter = htdocs/langs/<lang>/install.lang
source_file = htdocs/langs/en_US/install.lang
@ -176,6 +182,12 @@ source_file = htdocs/langs/en_US/link.lang
source_lang = en_US
type = MOZILLAPROPERTIES
[dolibarr.loan]
file_filter = htdocs/langs/<lang>/loan.lang
source_file = htdocs/langs/en_US/loan.lang
source_lang = en_US
type = MOZILLAPROPERTIES
[dolibarr.mailmanspip]
file_filter = htdocs/langs/<lang>/mailmanspip.lang
source_file = htdocs/langs/en_US/mailmanspip.lang

View File

@ -3,28 +3,30 @@ How to contribute to Dolibarr
Bug reports and feature requests
--------------------------------
Issues are tracked at [Doliforge](https://doliforge.org/projects/dolibarr)
** NEW **
*You need to create an account before being able to use the "Bugs & Tasks" feature.*
Issues are now managed on [GitHub](https://github.com/Dolibarr/dolibarr/Issues).
1. Use the search engine to check if nobody's already reported your problem.
2. Choose the right section. (Bugs or Task and Feature Request).
3. Report with as much detail as possible (Use screenshots or even screencasts whenever possible).
1. Please [use the search engine](https://help.github.com/articles/searching-issues) to check if nobody's already reported your problem.
2. [Create an issue](https://help.github.com/articles/creating-an-issue). Choose an appropriate title. Prepend appropriately with Bug or Feature Request.
3. Report with as much detail as possible ([Use screenshots or even screencasts whenever possible](https://help.github.com/articles/issue-attachments)).
Code
----
We're still figuring out how to migrate old issues to GitHub. In the meantime, they are still available at [Doliforge](https://doliforge.org/projects/dolibarr).
<a name=code></a>Code
---------------------
### Basic workflow
1. Fork the [GitHub repository](https://github.com/Dolibarr/dolibarr).
1. [Fork](https://help.github.com/articles/fork-a-repo) the [GitHub repository](https://github.com/Dolibarr/dolibarr).
2. Clone your fork.
3. Choose a branch(See the Branches section below).
3. Choose a branch(See the [Branches](#branches) section below).
4. Commit and push your changes.
5. Make a pull request.
5. [Make a pull request](https://help.github.com/articles/creating-a-pull-request).
### Branches
### <a name=branches></a>Branches
Unless you're fixing a bug, all pull request should be made against the *develop* branch.
Unless you're fixing a bug, all pull requests should be made against the *develop* branch.
If you're fixing a bug, it is preferred that you cook your fix and pull request it
against the oldest version affected that's still supported.
@ -40,23 +42,36 @@ Please don't edit the ChangeLog file. A project manager will update it from your
Use clear commit messages with the following structure:
<pre>
KEYWORD Short description
KEYWORD Short description (may be the bug number #456)
Long description (Can span accross multiple lines).
</pre>
Where KEYWORD is one of:
- "FIXED:" for bug fixes. In upper case to appear into ChangeLog. (May be followed by the bug number i.e: #456)
- "NEW:" for new features. In upper case to appear into ChangeLog. (May be followed by the task number i.e: #123)
- "Fixed" for bug fixes (May be followed by the bug number i.e: #456)
- "Closed" for a commit to close a feature request issue (May be followed by the bug number i.e: #456)
- void, don't put a keyword if the commit is not introducing feature or closing a bug.
### Pull Requests
When submitting a pull request, use following syntax:
<pre>
KEYWORD Short description (may be the bug number #456)
</pre>
Where KEYWORD is one of:
- "FIXED" or "Fixed" for bug fixes. In upper case to appear into ChangeLog. (May be followed by the bug number i.e: #456)
- "NEW" or "New" for new features. In upper case to appear into ChangeLog. (May be followed by the task number i.e: #123)
### Resources
[Developer documentation](http://wiki.dolibarr.org/index.php/Developer_documentation)
Translations
------------
en_US and delta languages (i.e: fr_XX) are maintained in the repository. See Code section above.
The source language (en_US) is maintained in the repository. See the [Code](#code) section above.
All other translations are managed online at [Transifex](https://www.transifex.com/projects/p/dolibarr).

View File

@ -2,6 +2,13 @@
English Dolibarr ChangeLog
--------------------------------------------------------------
WARNING: Do not try to make any Dolibarr upgrade if you are running Mysql version 5.5.40.
Mysql version 5.5.40 has a very critical bug making your data beeing definitely lost.
You may also experience troubles with Mysql 5.5.41 with error "Lost connection" during migration.
Upgrading to any other version or database system is abolutely required BEFORE trying to
make a migration.
***** ChangeLog for 3.8 compared to 3.7.* *****
For users:
- New: Add Option to not change date on cloning project
@ -31,7 +38,8 @@ WARNING: Following changes may create regression for some external modules, but
Dolibarr better:
- Removed hoo supplierorderdao into supplier order creation. This is a business event, so we must use the
trigger ORDER_SUPPLIER_CREATE instead.
- Hooks 'printLeftBlock' and 'formConfirm' are now compliant with hook development rules. They are
"addreplace" hooks, so you must return content with "->resprints='mycontent'" and not with "return 'mycontent'"
***** ChangeLog for 3.7 compared to 3.6.* *****

View File

@ -172,6 +172,7 @@ done >>%{name}.lang
%_datadir/dolibarr/htdocs/contrat
%_datadir/dolibarr/htdocs/core
%_datadir/dolibarr/htdocs/cron
%_datadir/dolibarr/htdocs/don
%_datadir/dolibarr/htdocs/ecm
%_datadir/dolibarr/htdocs/expedition
%_datadir/dolibarr/htdocs/expensereport
@ -186,6 +187,7 @@ done >>%{name}.lang
%_datadir/dolibarr/htdocs/install
%_datadir/dolibarr/htdocs/langs/HOWTO-Translation.txt
%_datadir/dolibarr/htdocs/livraison
%_datadir/dolibarr/htdocs/loan
%_datadir/dolibarr/htdocs/mailmanspip
%_datadir/dolibarr/htdocs/margin
%_datadir/dolibarr/htdocs/opensurvey

View File

@ -252,6 +252,7 @@ done >>%{name}.lang
%_datadir/dolibarr/htdocs/contrat
%_datadir/dolibarr/htdocs/core
%_datadir/dolibarr/htdocs/cron
%_datadir/dolibarr/htdocs/don
%_datadir/dolibarr/htdocs/ecm
%_datadir/dolibarr/htdocs/expedition
%_datadir/dolibarr/htdocs/expensereport
@ -266,6 +267,7 @@ done >>%{name}.lang
%_datadir/dolibarr/htdocs/install
%_datadir/dolibarr/htdocs/langs/HOWTO-Translation.txt
%_datadir/dolibarr/htdocs/livraison
%_datadir/dolibarr/htdocs/loan
%_datadir/dolibarr/htdocs/mailmanspip
%_datadir/dolibarr/htdocs/margin
%_datadir/dolibarr/htdocs/opensurvey

View File

@ -169,6 +169,7 @@ done >>%{name}.lang
%_datadir/dolibarr/htdocs/contrat
%_datadir/dolibarr/htdocs/core
%_datadir/dolibarr/htdocs/cron
%_datadir/dolibarr/htdocs/don
%_datadir/dolibarr/htdocs/ecm
%_datadir/dolibarr/htdocs/expedition
%_datadir/dolibarr/htdocs/expensereport
@ -183,6 +184,7 @@ done >>%{name}.lang
%_datadir/dolibarr/htdocs/install
%_datadir/dolibarr/htdocs/langs/HOWTO-Translation.txt
%_datadir/dolibarr/htdocs/livraison
%_datadir/dolibarr/htdocs/loan
%_datadir/dolibarr/htdocs/mailmanspip
%_datadir/dolibarr/htdocs/margin
%_datadir/dolibarr/htdocs/opensurvey

View File

@ -180,6 +180,7 @@ done >>%{name}.lang
%_datadir/dolibarr/htdocs/contrat
%_datadir/dolibarr/htdocs/core
%_datadir/dolibarr/htdocs/cron
%_datadir/dolibarr/htdocs/don
%_datadir/dolibarr/htdocs/ecm
%_datadir/dolibarr/htdocs/expedition
%_datadir/dolibarr/htdocs/expensereport
@ -194,6 +195,7 @@ done >>%{name}.lang
%_datadir/dolibarr/htdocs/install
%_datadir/dolibarr/htdocs/langs/HOWTO-Translation.txt
%_datadir/dolibarr/htdocs/livraison
%_datadir/dolibarr/htdocs/loan
%_datadir/dolibarr/htdocs/mailmanspip
%_datadir/dolibarr/htdocs/margin
%_datadir/dolibarr/htdocs/opensurvey

View File

@ -32,13 +32,18 @@ then
for dir in `find htdocs/langs/$3* -type d`
do
dirshort=`basename $dir`
#echo $dirshort
export aa=`echo $dirshort | nawk -F"_" '{ print $1 }'`
export bb=`echo $dirshort | nawk -F"_" '{ print $2 }'`
aaupper=`echo $dirshort | nawk -F"_" '{ print toupper($1) }'`
if [ $aaupper = "EN" ]
then
aaupper="US"
fi
bblower=`echo $dirshort | nawk -F"_" '{ print tolower($2) }'`
if [ "$aa" != "$bblower" ]
if [ "$aa" != "$bblower" -a "$dirshort" != "en_US" ]
then
reflang="htdocs/langs/"$aa"_"$aaupper
if [ -d $reflang ]
@ -48,6 +53,15 @@ then
echo ./dev/translation/strip_language_file.php $aa"_"$aaupper $aa"_"$bb $2
./dev/translation/strip_language_file.php $aa"_"$aaupper $aa"_"$bb $2
for fic in `ls htdocs/langs/${aa}_${bb}/*.delta`; do f=`echo $fic | sed -e 's/\.delta//'`; echo $f; mv $f.delta $f; done
for fic in `ls htdocs/langs/${aa}_${bb}/*.lang`;
do f=`cat $fic | wc -l`;
#echo $f lines into file $fic;
if [ $f = 1 ]
then
echo Only one line remainging into file $fic, we delete it;
rm $fic
fi;
done
fi
fi
done;

View File

@ -174,7 +174,7 @@ $targetcontent=$sourcecontent;
// Substitute class name
$targetcontent=preg_replace('/skeleton_class\.class\.php/', $classmin.'.class.php', $targetcontent);
$targetcontent=preg_replace('/\$element=\'skeleton\'/', '\$element=\''.$classmin.'\'', $targetcontent);
$targetcontent=preg_replace('/\$table_element=\'skeleton\'/', '\$table_element=\''.$classmin.'\'', $targetcontent);
$targetcontent=preg_replace('/\$table_element=\'skeleton\'/', '\$table_element=\''.$tablenoprefix.'\'', $targetcontent);
$targetcontent=preg_replace('/Skeleton_Class/', $classname, $targetcontent);
// Substitute comments
@ -252,7 +252,13 @@ foreach($property as $key => $prop)
if ($addfield)
{
$varprop.="\t\t\$sql.= \" ";
if ($prop['istime'])
if ($prop['field']=='datec')
{
$varprop.='"."\'".$this->db->idate(dol_now())."\'"."';
if ($i < count($property)) $varprop.=",";
$varprop.='";';
}
elseif ($prop['istime'])
{
$varprop.='".(! isset($this->'.$prop['field'].') || dol_strlen($this->'.$prop['field'].')==0?\'NULL\':"\'".$this->db->idate(';
$varprop.="\$this->".$prop['field']."";
@ -268,6 +274,12 @@ foreach($property as $key => $prop)
if ($i < count($property)) $varprop.=",";
$varprop.='";';
}
elseif ($prop['field']=='fk_user_mod' || $prop['field']=='fk_user_author')
{
$varprop.='".$user->id."';
if ($i < count($property)) $varprop.=",";
$varprop.='";';
}
else
{
$varprop.='".(! isset($this->'.$prop['field'].')?\'NULL\':"\'".';
@ -289,11 +301,17 @@ $i=0;
foreach($property as $key => $prop)
{
$i++;
if ($prop['field'] != 'rowid' && $prop['field'] != 'id')
if ($prop['field'] != 'rowid' && $prop['field'] != 'id' && $prop['field'] != 'datec' && $prop['field'] != 'fk_user_author')
{
$varprop.="\t\t\$sql.= \" ";
$varprop.=$prop['field'].'=';
if ($prop['istime'])
if ($prop['field']=='tms') {
$varprop.='".(dol_strlen($this->'.$prop['field'].')!=0 ? "\'".$this->db->idate(';
$varprop.='$this->'.$prop['field'];
$varprop.=')."\'" : "\'".$this->db->idate(dol_now())."\'").';
$varprop.='"';
}
elseif ($prop['istime'])
{
// (dol_strlen($this->datep)!=0 ? "'".$this->db->idate($this->datep)."'" : 'null')
$varprop.='".(dol_strlen($this->'.$prop['field'].')!=0 ? "\'".$this->db->idate(';
@ -301,6 +319,9 @@ foreach($property as $key => $prop)
$varprop.=')."\'" : \'null\').';
$varprop.='"';
}
elseif ($prop['field']=='fk_user_mod') {
$varprop.='".$user->id."';
}
else
{
$varprop.="\".";
@ -325,6 +346,7 @@ $targetcontent=preg_replace('/\$sql\.= " t\.field2";/', '', $targetcontent);
// Substitute select set parameters
$varprop="\n";
$varpropline="\n";
$cleanparam='';
$i=0;
foreach($property as $key => $prop)
@ -338,11 +360,22 @@ foreach($property as $key => $prop)
if ($prop['istime']) $varprop.=')';
$varprop.=";";
$varprop.="\n";
$varpropline.="\t\t\t\t\$line->".$prop['field']." = ";
if ($prop['istime']) $varpropline.='$this->db->jdate(';
$varpropline.='$obj->'.$prop['field'];
if ($prop['istime']) $varpropline.=')';
$varpropline.=";";
$varpropline.="\n";
}
}
$targetcontent=preg_replace('/\$this->prop1 = \$obj->field1;/', $varprop, $targetcontent);
$targetcontent=preg_replace('/\$this->prop2 = \$obj->field2;/', '', $targetcontent);
//Substirute fetchAll
$targetcontent=preg_replace('/\$line->prop1 = \$obj->field1;/', $varpropline, $targetcontent);
$targetcontent=preg_replace('/\$line->prop2 = \$obj->field2;/', '', $targetcontent);
// Substitute initasspecimen parameters
$varprop="\n";

View File

@ -1,6 +1,7 @@
<?php
/* Copyright (C) 2007-2012 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2014 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2015 Florian Henry <florian.henry@open-concept.pro>
* Copyright (C) ---Put here your own copyright and developer email---
*
* This program is free software; you can redistribute it and/or modify
@ -41,6 +42,8 @@ class Skeleton_Class extends CommonObject
var $element='skeleton'; //!< Id that identify managed objects
var $table_element='skeleton'; //!< Name of table without prefix where object is stored
var $lines=array();
var $id;
var $prop1;
var $prop2;
@ -103,11 +106,11 @@ class Skeleton_Class extends CommonObject
if (! $notrigger)
{
// Uncomment this and change MYOBJECT to your own tag if you
// want this action calls a trigger.
// want this action to call a trigger.
//// Call triggers
//$result=$this->call_trigger('MYOBJECT_CREATE',$user);
//if ($result < 0) { $error++; //Do also what you must do to rollback action if trigger fail}
//if ($result < 0) $error++;
//// End call triggers
}
}
@ -115,11 +118,6 @@ class Skeleton_Class extends CommonObject
// Commit or rollback
if ($error)
{
foreach($this->errors as $errmsg)
{
dol_syslog(__METHOD__." ".$errmsg, LOG_ERR);
$this->error.=($this->error?', '.$errmsg:$errmsg);
}
$this->db->rollback();
return -1*$error;
}
@ -175,6 +173,69 @@ class Skeleton_Class extends CommonObject
}
}
/**
* Load object in memory from the database
*
* @param string $sortorder Sort Order
* @param string $sortfield Sort field
* @param int $limit offset limit
* @param int $offset offset limit
* @param array $filter filter array
* @return int <0 if KO, >0 if OK
*/
function fetchAll($sortorder, $sortfield, $limit, $offset, $filter = array())
{
global $langs;
$sql = "SELECT";
$sql.= " t.rowid,";
$sql.= " t.field1,";
$sql.= " t.field2";
//...
$sql.= " FROM ".MAIN_DB_PREFIX."mytable as t";
// Manage filter
$sqlwhere=array();
if (count($filter)>0) {
foreach ( $filter as $key => $value ) {
//$sqlwhere []= ' AND '. $key . ' LIKE \'%' . $this->db->escape($value) . '%\'';
}
}
if (count($sqlwhere)>0) {
$sql.= ' WHERE '.implode(' AND ', $sqlwhere);
}
$sql .= " ORDER BY " . $sortfield . " " . $sortorder . " " . $this->db->plimit($limit + 1, $offset);
$this->lines = array ();
dol_syslog(get_class($this)."::fetchAll", LOG_DEBUG);
$resql=$this->db->query($sql);
if ($resql)
{
$num = $this->db->num_rows($resql);
while ($obj = $this->db->fetch_object($resql))
{
$line=new Skeleton_ClassLine();
$line->id = $obj->rowid;
$line->prop1 = $obj->field1;
$line->prop2 = $obj->field2;
$this->lines[]=$line;
//...
}
$this->db->free($resql);
return $num;
}
else
{
$this->error="Error ".$this->db->lasterror();
dol_syslog(get_class($this)."::fetchAll ".$this->error, LOG_ERR);
return -1;
}
}
/**
* Update object into database
@ -368,3 +429,10 @@ class Skeleton_Class extends CommonObject
}
}
class Skeleton_ClassLine
{
var $id;
var $prop1;
var $prop2;
}

View File

@ -60,6 +60,7 @@ $rc = 0;
$lPrimary = isset($argv[1])?$argv[1]:'';
$lSecondary = isset($argv[2])?$argv[2]:'';
$lEnglish = 'en_US';
$filesToProcess = isset($argv[3])?$argv[3]:'';
if (empty($lPrimary) || empty($lSecondary) || empty($filesToProcess))
@ -73,6 +74,7 @@ if (empty($lPrimary) || empty($lSecondary) || empty($filesToProcess))
$aPrimary = array();
$aSecondary = array();
$aEnglish = array();
// Define array $filesToProcess
if ($filesToProcess == 'all')
@ -96,6 +98,7 @@ foreach($filesToProcess as $fileToProcess)
{
$lPrimaryFile = 'htdocs/langs/'.$lPrimary.'/'.$fileToProcess;
$lSecondaryFile = 'htdocs/langs/'.$lSecondary.'/'.$fileToProcess;
$lEnglishFile = 'htdocs/langs/'.$lEnglish.'/'.$fileToProcess;
$output = $lSecondaryFile . '.delta';
print "---- Process language file ".$lSecondaryFile."\n";
@ -114,6 +117,13 @@ foreach($filesToProcess as $fileToProcess)
continue;
}
if ( ! is_readable($lEnglishFile) ) {
$rc = 3;
$msg = "Cannot read english language file $lEnglishFile. We discard this file.";
print $msg . "\n";
continue;
}
// Start reading and parsing Secondary
if ( $handle = fopen($lSecondaryFile, 'r') )
@ -172,6 +182,65 @@ foreach($filesToProcess as $fileToProcess)
}
// Start reading and parsing English
if ( $handle = fopen($lEnglishFile, 'r') )
{
print "Read English File $lEnglishFile:\n";
$cnt = 0;
while (($line = fgets($handle)) !== false)
{
$cnt++;
// strip comments
if ( preg_match("/^\w*#/", $line) ) {
continue;
}
// strip empty lines
if ( preg_match("/^\w*$/", $line) ) {
continue;
}
$a = mb_split('=', trim($line), 2);
if ( count($a) != 2 ) {
print "ERROR in file $lEnglishFile, line $cnt: " . trim($line) . "\n";
continue;
}
list($key, $value) = $a;
// key is redundant
if ( array_key_exists($key, $aEnglish) ) {
print "Key $key is redundant in file $lEnglishFile (line: $cnt).\n";
continue;
}
// String has no value
if ( $value == '' ) {
print "Key $key has no value in file $lEnglishFile (line: $cnt).\n";
continue;
}
$aEnglish[$key] = trim($value);
}
if ( ! feof($handle) )
{
$rc = 5;
$msg = "Unexpected fgets() fail";
print $msg . " (rc=$rc).\n";
exit($rc);
}
fclose($handle);
}
else {
$rc = 6;
$msg = "Cannot open file $lEnglishFile";
print $msg . " (rc=$rc).\n";
exit($rc);
}
// Start reading and parsing Primary. See rules in header!
$arrayofkeytoalwayskeep=array('DIRECTION','FONTFORPDF','FONTSIZEFORPDF','SeparatorDecimal','SeparatorThousand');
@ -246,7 +315,11 @@ foreach($filesToProcess as $fileToProcess)
}
// String exists in both files and does not match
if ((! empty($aSecondary[$key]) && $aSecondary[$key] != $aPrimary[$key]) || in_array($key, $arrayofkeytoalwayskeep) || preg_match('/^FormatDate/',$key) || preg_match('/^FormatHour/',$key))
if (
(! empty($aSecondary[$key]) && $aSecondary[$key] != $aPrimary[$key]
&& ! empty($aEnglish[$key]) && $aSecondary[$key] != $aEnglish[$key])
|| in_array($key, $arrayofkeytoalwayskeep) || preg_match('/^FormatDate/',$key) || preg_match('/^FormatHour/',$key)
)
{
//print "Key $key differs so we add it into new secondary language (line: $cnt).\n";
fwrite($oh, $key."=".(empty($aSecondary[$key])?$aPrimary[$key]:$aSecondary[$key])."\n");

View File

@ -13,7 +13,7 @@ then
echo "This pull remote transifex files to local dir."
echo "Note: If you pull a language file (not source), file will be skipped if local file is newer."
echo " Using -f will overwrite local file (does not work with 'all')."
echo "Usage: ./dev/translation/txpull.sh (all|xx_XX) [-r dolibarr.file] [-f]"
echo "Usage: ./dev/translation/txpull.sh (all|xx_XX) [-r dolibarr.file] [-f] [-s]"
exit
fi
@ -26,13 +26,21 @@ fi
if [ "x$1" = "xall" ]
then
for fic in ar_SA bg_BG bs_BA ca_ES cs_CZ da_DK de_DE el_GR es_ES et_EE eu_ES fa_IR fi_FI fr_FR he_IL hr_HR hu_HU id_ID is_IS it_IT ja_JP ka_GE ko_KR lt_LT lv_LV mk_MK nb_NO nl_NL pl_PL pt_PT ro_RO ru_RU ru_UA sk_SK sl_SI sq_AL sv_SE th_TH tr_TR uk_UA uz_UZ vi_VN zh_CN zh_TW
cd htdocs/lang
for dir in `find htdocs/langs/* -type d`
do
echo "tx pull -l $fic $2 $3"
tx pull -l $fic $2 $3
fic=`basename $dir`
if [ $fic != "en_US" ]
then
echo "tx pull -l $fic $2 $3"
tx pull -l $fic $2 $3
fi
done
cd -
else
echo "tx pull -l $1 $2 $3 $4"
tx pull -l $1 $2 $3 $4
echo "tx pull -l $1 $2 $3 $4 $5"
tx pull -l $1 $2 $3 $4 $5
fi
echo Think to launch also:
echo "> dev/fixaltlanguages.sh fix all"

View File

@ -249,7 +249,11 @@ if ($action == 'export_csv')
$purchase_journal = $conf->global->ACCOUNTING_PURCHASE_JOURNAL;
header('Content-Type: text/csv');
header('Content-Disposition: attachment;filename=journal_achats.csv');
if ($conf->global->EXPORT_PREFIX_SPEC)
$filename=$conf->global->EXPORT_PREFIX_SPEC."_"."journal_achats.csv";
else
$filename="journal_achats.csv";
header('Content-Disposition: attachment;filename='.$filename);
if ($conf->global->ACCOUNTING_EXPORT_MODELCSV == 2) // Model Cegid Expert Export
{

View File

@ -271,7 +271,11 @@ if ($action == 'export_csv')
$sell_journal = $conf->global->ACCOUNTING_SELL_JOURNAL;
header('Content-Type: text/csv');
header('Content-Disposition: attachment;filename=journal_ventes.csv');
if ($conf->global->EXPORT_PREFIX_SPEC)
$filename=$conf->global->EXPORT_PREFIX_SPEC."_"."journal_ventes.csv";
else
$filename="journal_ventes.csv";
header('Content-Disposition: attachment;filename='.$filename);
$companystatic = new Client($db);

View File

@ -1548,9 +1548,9 @@ class Adherent extends CommonObject
}
/**
* Renvoie nom clicable (avec eventuellement le picto)
* Return clicable name (with picto eventually)
*
* @param int $withpicto 0=Pas de picto, 1=Inclut le picto dans le lien, 2=Picto seul
* @param int $withpicto 0=No picto, 1=Include picto into link, 2=Only picto
* @param int $maxlen length max libelle
* @param string $option Page lien
* @return string Chaine avec URL
@ -1568,25 +1568,25 @@ class Adherent extends CommonObject
if ($option == 'card')
{
$lien = '<a href="'.DOL_URL_ROOT.'/adherents/card.php?rowid='.$this->id.$linkclose;
$lienfin='</a>';
$link = '<a href="'.DOL_URL_ROOT.'/adherents/card.php?rowid='.$this->id.$linkclose;
$linkend='</a>';
}
if ($option == 'subscription')
{
$lien = '<a href="'.DOL_URL_ROOT.'/adherents/card_subscriptions.php?rowid='.$this->id.$linkclose;
$lienfin='</a>';
$link = '<a href="'.DOL_URL_ROOT.'/adherents/card_subscriptions.php?rowid='.$this->id.$linkclose;
$linkend='</a>';
}
if ($option == 'category')
{
$lien = '<a href="'.DOL_URL_ROOT.'/categories/categorie.php?id='.$this->id.'&type=3'.$linkclose;
$lienfin='</a>';
$link = '<a href="'.DOL_URL_ROOT.'/categories/categorie.php?id='.$this->id.'&type=3'.$linkclose;
$linkend='</a>';
}
$picto='user';
if ($withpicto) $result.=($lien.img_object($label, $picto, 'class="classfortooltip"').$lienfin);
if ($withpicto) $result.=($link.img_object($label, $picto, 'class="classfortooltip"').$linkend);
if ($withpicto && $withpicto != 2) $result.=' ';
$result.=$lien.($maxlen?dol_trunc($this->ref,$maxlen):$this->ref).$lienfin;
$result.=$link.($maxlen?dol_trunc($this->ref,$maxlen):$this->ref).$linkend;
return $result;
}

View File

@ -266,9 +266,9 @@ class AdherentType extends CommonObject
/**
* Renvoie nom clicable (avec eventuellement le picto)
* Return clicable name (with picto eventually)
*
* @param int $withpicto 0=Pas de picto, 1=Inclut le picto dans le lien, 2=Picto seul
* @param int $withpicto 0=No picto, 1=Include picto into link, 2=Only picto
* @param int $maxlen length max libelle
* @return string String with URL
*/
@ -279,14 +279,14 @@ class AdherentType extends CommonObject
$result='';
$label=$langs->trans("ShowTypeCard",$this->libelle);
$lien = '<a href="'.DOL_URL_ROOT.'/adherents/type.php?rowid='.$this->id.'" title="'.dol_escape_htmltag($label, 1).'" class="classfortooltip">';
$lienfin='</a>';
$link = '<a href="'.DOL_URL_ROOT.'/adherents/type.php?rowid='.$this->id.'" title="'.dol_escape_htmltag($label, 1).'" class="classfortooltip">';
$linkend='</a>';
$picto='group';
if ($withpicto) $result.=($lien.img_object($label, $picto, 'class="classfortooltip"').$lienfin);
if ($withpicto) $result.=($link.img_object($label, $picto, 'class="classfortooltip"').$linkend);
if ($withpicto && $withpicto != 2) $result.=' ';
$result.=$lien.($maxlen?dol_trunc($this->libelle,$maxlen):$this->libelle).$lienfin;
$result.=$link.($maxlen?dol_trunc($this->libelle,$maxlen):$this->libelle).$linkend;
return $result;
}

View File

@ -1,6 +1,6 @@
<?php
/* Copyright (C) 2002-2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2006-2008 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2006-2015 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
@ -90,7 +90,7 @@ class Cotisation extends CommonObject
}
else
{
$this->error=$this->db->error();
$this->error=$this->db->lasterror();
return -1;
}
}
@ -140,7 +140,7 @@ class Cotisation extends CommonObject
}
else
{
$this->error=$this->db->error();
$this->error=$this->db->lasterror();
return -1;
}
}
@ -181,7 +181,7 @@ class Cotisation extends CommonObject
else
{
$this->db->rollback();
$this->error=$this->db->error();
$this->error=$this->db->lasterror();
return -1;
}
}
@ -217,7 +217,7 @@ class Cotisation extends CommonObject
$result=$member->fetch($this->fk_adherent);
$result=$member->update_end_date($user);
if ($accountline->rowid > 0) // If we found bank account line (this means this->fk_bank defined)
if ($accountline->id > 0) // If we found bank account line (this means this->fk_bank defined)
{
$result=$accountline->delete($user); // Return false if refused because line is conciliated
if ($result > 0)
@ -254,9 +254,9 @@ class Cotisation extends CommonObject
/**
* Renvoie nom clicable (avec eventuellement le picto)
* Return clicable name (with picto eventually)
*
* @param int $withpicto 0=Pas de picto, 1=Inclut le picto dans le lien, 2=Picto seul
* @param int $withpicto 0=No picto, 1=Include picto into link, 2=Only picto
* @return string Chaine avec URL
*/
function getNomUrl($withpicto=0)
@ -266,14 +266,14 @@ class Cotisation extends CommonObject
$result='';
$label=$langs->trans("ShowSubscription").': '.$this->ref;
$lien = '<a href="'.DOL_URL_ROOT.'/adherents/fiche_subscription.php?rowid='.$this->id.'" title="'.dol_escape_htmltag($label, 1).'" class="classfortooltip">';
$lienfin='</a>';
$link = '<a href="'.DOL_URL_ROOT.'/adherents/fiche_subscription.php?rowid='.$this->id.'" title="'.dol_escape_htmltag($label, 1).'" class="classfortooltip">';
$linkend='</a>';
$picto='payment';
if ($withpicto) $result.=($lien.img_object($label, $picto, 'class="classfortooltip"').$lienfin);
if ($withpicto) $result.=($link.img_object($label, $picto, 'class="classfortooltip"').$linkend);
if ($withpicto && $withpicto != 2) $result.=' ';
$result.=$lien.$this->ref.$lienfin;
$result.=$link.$this->ref.$linkend;
return $result;
}

View File

@ -622,9 +622,29 @@ else
}
print '</table>';
print '<br>';
/*
* Notifications
*/
print_titre($langs->trans("Notifications"));
print '<table class="noborder" width="100%">';
print '<tr class="liste_titre">';
print '<td>'.$langs->trans("Parameter").'</td>';
print '<td align="center" width="60"></td>';
print '<td width="80">&nbsp;</td>';
print "</tr>\n";
print '<tr '.$bc[$var].'><td colspan="2">';
print $langs->trans("YouMayFindNotificationsFeaturesIntoModuleNotification").'<br>';
print '</td><td align="right">';
print "</td></tr>\n";
print '</table>';
llxFooter();
$db->close();

View File

@ -229,7 +229,7 @@ $sql.= ", note";
$sql.= ", entity";
$sql.= " FROM ".MAIN_DB_PREFIX."const";
$sql.= " WHERE entity IN (".$user->entity.",".$conf->entity.")";
if (empty($user->entity) && $debug) {} // to force for superadmin
if ((empty($user->entity) || $user->admin) && $debug) {} // to force for superadmin
else $sql.= " AND visible = 1"; // We must always have this. Otherwise, array is too large and submitting data fails due to apache POST or GET limits
$sql.= " ORDER BY entity, name ASC";

View File

@ -171,7 +171,7 @@ else if ($action == 'setdoc')
// on passe donc par une variable pour avoir un affichage coherent
$conf->global->FACTURE_ADDON_PDF = $value;
}
// On active le modele
$ret = delDocumentModel($value, $type);
if ($ret > 0)
@ -341,7 +341,7 @@ foreach ($dirmodels as $reldir)
// Check if there is a filter on country
preg_match('/\-(.*)_(.*)$/',$classname,$reg);
if (! empty($reg[2]) && $reg[2] != strtoupper($mysoc->country_code)) continue;
$classname = preg_replace('/\-.*$/','',$classname);
if (! class_exists($classname) && is_readable($dir.$filebis) && (preg_match('/mod_/',$filebis) || preg_match('/mod_/',$classname)) && substr($filebis, dol_strlen($filebis)-3, 3) == 'php')
{
@ -416,7 +416,7 @@ foreach ($dirmodels as $reldir)
$htmltooltip.=$langs->trans($module->error).'<br>';
}
}
// Example for credit invoice
$facture->type=2;
$nextval=$module->getNextValue($mysoc,$facture);
@ -630,7 +630,6 @@ print '</table>';
/*
* Modes de reglement
*
*/
print '<br>';
print_titre($langs->trans("SuggestedPaymentModesIfNotDefinedInInvoice"));
@ -811,7 +810,27 @@ print '</tr>'."\n";
print "</table>\n";
//dol_fiche_end();
/*
* Notifications
*/
print '<br>';
print_titre($langs->trans("Notifications"));
print '<table class="noborder" width="100%">';
print '<tr class="liste_titre">';
print '<td>'.$langs->trans("Parameter").'</td>';
print '<td align="center" width="60"></td>';
print '<td width="80">&nbsp;</td>';
print "</tr>\n";
print '<tr '.$bc[$var].'><td colspan="2">';
print $langs->trans("YouMayFindNotificationsFeaturesIntoModuleNotification").'<br>';
print '</td><td align="right">';
print "</td></tr>\n";
print '</table>';
dol_fiche_end();
llxFooter();

119
htdocs/admin/loan.php Normal file
View File

@ -0,0 +1,119 @@
<?php
/* Copyright (C) 2014 Alexandre Spangaro <alexandre.spangaro@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 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/admin/loan.php
* \ingroup loan
* \brief Setup page to configure loan module
*/
require '../main.inc.php';
// Class
require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
$langs->load("admin");
$langs->load("loan");
// Security check
if (!$user->admin)
accessforbidden();
$action = GETPOST('action', 'alpha');
// Other parameters LOAN_*
$list = array (
'LOAN_ACCOUNTING_ACCOUNT_CAPITAL',
'LOAN_ACCOUNTING_ACCOUNT_INTEREST',
'LOAN_ACCOUNTING_ACCOUNT_INSURANCE'
);
/*
* Actions
*/
if ($action == 'update')
{
$error = 0;
foreach ($list as $constname) {
$constvalue = GETPOST($constname, 'alpha');
if (!dolibarr_set_const($db, $constname, $constvalue, 'chaine', 0, '', $conf->entity)) {
$error++;
}
}
if (! $error)
{
setEventMessage($langs->trans("SetupSaved"));
}
else
{
setEventMessage($langs->trans("Error"),'errors');
}
}
/*
* View
*/
llxHeader();
$form = new Form($db);
$linkback='<a href="'.DOL_URL_ROOT.'/admin/modules.php">'.$langs->trans("BackToModuleList").'</a>';
print_fiche_titre($langs->trans('ConfigLoan'),$linkback,'setup');
print '<form action="'.$_SERVER["PHP_SELF"].'" method="post">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<input type="hidden" name="action" value="update">';
/*
* Params
*/
print '<table class="noborder" width="100%">';
print '<tr class="liste_titre">';
print '<td colspan="3">' . $langs->trans('Options') . '</td>';
print "</tr>\n";
foreach ($list as $key)
{
$var=!$var;
print '<tr '.$bc[$var].' class="value">';
// Param
$label = $langs->trans($key);
print '<td><label for="'.$key.'">'.$label.'</label></td>';
// Value
print '<td>';
print '<input type="text" size="20" id="'.$key.'" name="'.$key.'" value="'.$conf->global->$key.'">';
print '</td></tr>';
}
print '</tr>';
print '</form>';
print "</table>\n";
print '<br /><div style="text-align:center"><input type="submit" class="button" value="'.$langs->trans('Modify').'" name="button"></div>';
llxFooter();
$db->close();

View File

@ -162,11 +162,11 @@ $var=true;
if (! empty($conf->global->ADHERENT_USE_MAILMAN))
{
//$lien=img_picto($langs->trans("Active"),'tick').' ';
$lien='<a href="'.$_SERVER["PHP_SELF"].'?action=unset&value=0&name=ADHERENT_USE_MAILMAN">';
//$lien.=$langs->trans("Disable");
$lien.=img_picto($langs->trans("Activated"),'switch_on');
$lien.='</a>';
//$link=img_picto($langs->trans("Active"),'tick').' ';
$link='<a href="'.$_SERVER["PHP_SELF"].'?action=unset&value=0&name=ADHERENT_USE_MAILMAN">';
//$link.=$langs->trans("Disable");
$link.=img_picto($langs->trans("Activated"),'switch_on');
$link.='</a>';
// Edition des varibales globales
$constantes=array(
'ADHERENT_MAILMAN_ADMINPW',
@ -175,7 +175,7 @@ if (! empty($conf->global->ADHERENT_USE_MAILMAN))
'ADHERENT_MAILMAN_LISTS'
);
print_fiche_titre($langs->trans('MailmanTitle'), $lien,'');
print_fiche_titre($langs->trans('MailmanTitle'), $link,'');
print '<br>';
@ -207,11 +207,11 @@ if (! empty($conf->global->ADHERENT_USE_MAILMAN))
}
else
{
$lien='<a href="'.$_SERVER["PHP_SELF"].'?action=set&value=1&name=ADHERENT_USE_MAILMAN">';
//$lien.=img_$langs->trans("Activate")
$lien.=img_picto($langs->trans("Disabled"),'switch_off');
$lien.='</a>';
print_fiche_titre($langs->trans('MailmanTitle'), $lien,'');
$link='<a href="'.$_SERVER["PHP_SELF"].'?action=set&value=1&name=ADHERENT_USE_MAILMAN">';
//$link.=img_$langs->trans("Activate")
$link.=img_picto($langs->trans("Disabled"),'switch_off');
$link.='</a>';
print_fiche_titre($langs->trans('MailmanTitle'), $link,'');
}
dol_fiche_end();

View File

@ -24,6 +24,7 @@
*/
require '../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/notify.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/triggers/interface_50_modNotification_Notification.class.php';
@ -48,25 +49,56 @@ $action = GETPOST("action");
if ($action == 'setvalue' && $user->admin)
{
$db->begin();
$result=dolibarr_set_const($db, "NOTIFICATION_EMAIL_FROM", $_POST["email_from"], 'chaine', 0, '', $conf->entity);
if ($result < 0) $error++;
if (! $error)
{
//var_dump($_POST);
foreach($_POST as $key => $val)
{
if (! preg_match('/^NOTIFICATION_FIXEDEMAIL_/',$key)) continue;
//print $key.' - '.$val.'<br>';
$result=dolibarr_set_const($db, $key, $val, 'chaine', 0, '', $conf->entity);
if (! preg_match('/^NOTIF_(.*)_key$/', $key, $reg)) continue;
$newval='';
$newkey='';
$shortkey=preg_replace('/_key$/','',$key);
//print $shortkey.'<br>';
if (preg_match('/^NOTIF_(.*)_old_(.*)_key/',$key,$reg))
{
dolibarr_del_const($db, 'NOTIFICATION_FIXEDEMAIL_'.$reg[1].'_THRESHOLD_HIGHER_'.$reg[2], $conf->entity);
$newkey='NOTIFICATION_FIXEDEMAIL_'.$reg[1].'_THRESHOLD_HIGHER_'.((int) GETPOST($shortkey.'_amount'));
$newval=GETPOST($shortkey.'_key');
//print $newkey.' - '.$newval.'<br>';
}
else if (preg_match('/^NOTIF_(.*)_new_key/',$key,$reg))
{
// Add a new entry
$newkey='NOTIFICATION_FIXEDEMAIL_'.$reg[1].'_THRESHOLD_HIGHER_'.((int) GETPOST($shortkey.'_amount'));
$newval=GETPOST($shortkey.'_key');
}
if ($newkey && $newval)
{
$result=dolibarr_set_const($db, $newkey, $newval, 'chaine', 0, '', $conf->entity);
}
}
}
if (! $error)
{
$db->commit();
setEventMessage($langs->trans("SetupSaved"));
}
else
{
$db->rollback();
setEventMessage($langs->trans("Error"),'errors');
}
}
@ -78,6 +110,7 @@ if ($action == 'setvalue' && $user->admin)
*/
$form=new Form($db);
$notify = new Notify($db);
llxHeader('',$langs->trans("NotificationSetup"));
@ -107,7 +140,53 @@ print '</table>';
print '<br>';
print_fiche_titre($langs->trans("ListOfAvailableNotifications"),'','');
if ($conf->societe->enabled)
{
print_fiche_titre($langs->trans("ListOfNotificationsPerContact"),'','');
print '<table class="noborder" width="100%">';
print '<tr class="liste_titre">';
print '<td>'.$langs->trans("Module").'</td>';
print '<td>'.$langs->trans("Code").'</td>';
print '<td>'.$langs->trans("Label").'</td>';
print '<td align="right">'.$langs->trans("NbOfTargetedContacts").'</td>';
print '<td>'.'</td>';
print "</tr>\n";
// Load array of available notifications
$notificationtrigger=new InterfaceNotification($db);
$listofnotifiedevents=$notificationtrigger->getListOfManagedEvents();
$var=true;
foreach($listofnotifiedevents as $notifiedevent)
{
$var=!$var;
$label=$langs->trans("Notify_".$notifiedevent['code']); //!=$langs->trans("Notify_".$notifiedevent['code'])?$langs->trans("Notify_".$notifiedevent['code']):$notifiedevent['label'];
if ($notifiedevent['elementtype'] == 'order_supplier') $elementLabel = $langs->trans('SupplierOrder');
elseif ($notifiedevent['elementtype'] == 'propal') $elementLabel = $langs->trans('Proposal');
elseif ($notifiedevent['elementtype'] == 'facture') $elementLabel = $langs->trans('Bill');
elseif ($notifiedevent['elementtype'] == 'commande') $elementLabel = $langs->trans('Order');
print '<tr '.$bc[$var].'>';
print '<td>'.$elementLabel.'</td>';
print '<td>'.$notifiedevent['code'].'</td>';
print '<td>'.$label.'</td>';
print '<td align="right">';
$nb = $notify->countDefinedNotifications($notifiedevent['code'], 0);
print $nb;
print '</td>';
print '</tr>';
}
print '</table>';
print '* '.$langs->trans("GoOntoContactCardToAddMore").'<br>';
print '<br>';
}
print_fiche_titre($langs->trans("ListOfFixedNotifications"),'','');
print '<table class="noborder" width="100%">';
print '<tr class="liste_titre">';
@ -115,12 +194,15 @@ print '<td>'.$langs->trans("Module").'</td>';
print '<td>'.$langs->trans("Code").'</td>';
print '<td>'.$langs->trans("Label").'</td>';
print '<td>'.$langs->trans("FixedEmailTarget").'</td>';
print '<td>'.$langs->trans("Threshold").'</td>';
print '<td>'.'</td>';
print "</tr>\n";
// Load array of available notifications
$notificationtrigger=new InterfaceNotification($db);
$listofnotifiedevents=$notificationtrigger->getListOfManagedEvents();
$var=true;
foreach($listofnotifiedevents as $notifiedevent)
{
$var=!$var;
@ -136,18 +218,47 @@ foreach($listofnotifiedevents as $notifiedevent)
print '<td>'.$notifiedevent['code'].'</td>';
print '<td>'.$label.'</td>';
print '<td>';
$param='NOTIFICATION_FIXEDEMAIL_'.$notifiedevent['code'];
$value=GETPOST($param)?GETPOST($param,'alpha'):$conf->global->$param;
$s='<input type="text" size="32" name="'.$param.'" value="'.dol_escape_htmltag($value).'">'; // Do not use type="email" here, we must be able to enter a list of email with , separator.
$arrayemail=explode(',',$value);
$showwarning=0;
foreach($arrayemail as $key=>$valuedet)
{
$valuedet=trim($valuedet);
if (! empty($valuedet) && ! isValidEmail($valuedet)) $showwarning++;
}
if ((! empty($conf->global->$param)) && $showwarning) $s.=' '.img_warning($langs->trans("ErrorBadEMail"));
print $form->textwithpicto($s,$langs->trans("YouCanUseCommaSeparatorForSeveralRecipients"));
// Notification with threshold
foreach($conf->global as $key => $val)
{
if ($val == '' || ! preg_match('/^NOTIFICATION_FIXEDEMAIL_'.$notifiedevent['code'].'_THRESHOLD_HIGHER_(.*)/', $key, $reg)) continue;
$param='NOTIFICATION_FIXEDEMAIL_'.$notifiedevent['code'].'_THRESHOLD_HIGHER_'.$reg[1];
$value=GETPOST('NOTIF_'.$notifiedevent['code'].'_old_'.$reg[1].'_key')?GETPOST('NOTIF_'.$notifiedevent['code'].'_old_'.$reg[1].'_key','alpha'):$conf->global->$param;
$s='<input type="text" size="32" name="NOTIF_'.$notifiedevent['code'].'_old_'.$reg[1].'_key" value="'.dol_escape_htmltag($value).'">'; // Do not use type="email" here, we must be able to enter a list of email with , separator.
$arrayemail=explode(',',$value);
$showwarning=0;
foreach($arrayemail as $key=>$valuedet)
{
$valuedet=trim($valuedet);
if (! empty($valuedet) && ! isValidEmail($valuedet,1)) $showwarning++;
}
if ((! empty($conf->global->$param)) && $showwarning) $s.=' '.img_warning($langs->trans("ErrorBadEMail"));
print $form->textwithpicto($s,$langs->trans("YouCanUseCommaSeparatorForSeveralRecipients").'<br>'.$langs->trans("YouCanAlsoUseSupervisorKeyword"),1,'help','',0,2);
print '<br>';
}
// New entry input fields
$s='<input type="text" size="32" name="NOTIF_'.$notifiedevent['code'].'_new_key" value="">'; // Do not use type="email" here, we must be able to enter a list of email with , separator.
print $form->textwithpicto($s,$langs->trans("YouCanUseCommaSeparatorForSeveralRecipients").'<br>'.$langs->trans("YouCanAlsoUseSupervisorKeyword"),1,'help','',0,2);
print '</td>';
print '<td>';
// Notification with threshold
foreach($conf->global as $key => $val)
{
if ($val == '' || ! preg_match('/^NOTIFICATION_FIXEDEMAIL_'.$notifiedevent['code'].'_THRESHOLD_HIGHER_(.*)/', $key, $reg)) continue;
print $langs->trans("AmountHT").' >= <input type="text" size="4" name="NOTIF_'.$notifiedevent['code'].'_old_'.$reg[1].'_amount" value="'.dol_escape_htmltag($reg[1]).'">';
print '<br>';
}
// New entry input fields
print $langs->trans("AmountHT").' >= <input type="text" size="4" name="NOTIF_'.$notifiedevent['code'].'_new_amount" value="">';
print '</td>';
print '<td>';
// TODO Add link to show message content
print '</td>';
print '</tr>';
}

View File

@ -643,6 +643,27 @@ print "</tr>\n";
print "<tr ".$bc[false].">\n <td width=\"140\">".$langs->trans("PathDirectory")."</td>\n <td>".$conf->propal->dir_output."</td>\n</tr>\n";
print "</table>\n<br>";
$db->close();
/*
* Notifications
*/
print_titre($langs->trans("Notifications"));
print '<table class="noborder" width="100%">';
print '<tr class="liste_titre">';
print '<td>'.$langs->trans("Parameter").'</td>';
print '<td align="center" width="60"></td>';
print '<td width="80">&nbsp;</td>';
print "</tr>\n";
print '<tr '.$bc[$var].'><td colspan="2">';
print $langs->trans("YouMayFindNotificationsFeaturesIntoModuleNotification").'<br>';
print '</td><td align="right">';
print "</td></tr>\n";
print '</table>';
llxFooter();
$db->close();

View File

@ -124,11 +124,11 @@ $var=true;
*/
if (! empty($conf->global->ADHERENT_USE_SPIP))
{
//$lien=img_picto($langs->trans("Active"),'tick').' ';
$lien='<a href="'.$_SERVER["PHP_SELF"].'?action=unset&value=0&name=ADHERENT_USE_SPIP">';
//$lien.=$langs->trans("Disable");
$lien.=img_picto($langs->trans("Activated"),'switch_on');
$lien.='</a>';
//$link=img_picto($langs->trans("Active"),'tick').' ';
$link='<a href="'.$_SERVER["PHP_SELF"].'?action=unset&value=0&name=ADHERENT_USE_SPIP">';
//$link.=$langs->trans("Disable");
$link.=img_picto($langs->trans("Activated"),'switch_on');
$link.='</a>';
// Edition des varibales globales
$constantes=array(
'ADHERENT_SPIP_SERVEUR',
@ -137,18 +137,18 @@ if (! empty($conf->global->ADHERENT_USE_SPIP))
'ADHERENT_SPIP_PASS'
);
print_fiche_titre($langs->trans('SPIPTitle'), $lien, '');
print_fiche_titre($langs->trans('SPIPTitle'), $link, '');
print '<br>';
form_constantes($constantes);
print '<br>';
}
else
{
$lien='<a href="'.$_SERVER["PHP_SELF"].'?action=set&value=1&name=ADHERENT_USE_SPIP">';
//$lien.=$langs->trans("Activate");
$lien.=img_picto($langs->trans("Disabled"),'switch_off');
$lien.='</a>';
print_fiche_titre($langs->trans('SPIPTitle'), $lien, '');
$link='<a href="'.$_SERVER["PHP_SELF"].'?action=set&value=1&name=ADHERENT_USE_SPIP">';
//$link.=$langs->trans("Activate");
$link.=img_picto($langs->trans("Disabled"),'switch_off');
$link.='</a>';
print_fiche_titre($langs->trans('SPIPTitle'), $link, '');
}

View File

@ -443,14 +443,16 @@ foreach ($dirmodels as $reldir)
}
}
print '</table><br/>';
print '<br>';
print '</table><br>';
/*
* Other options
*
*/
print '<form action="'.$_SERVER["PHP_SELF"].'" method="post">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<input type="hidden" name="action" value="set_SUPPLIER_INVOICE_FREE_TEXT">';
print_titre($langs->trans("OtherOptions"));
print '<table class="noborder" width="100%">';
print '<tr class="liste_titre">';
@ -459,16 +461,38 @@ print '<td align="center" width="60">'.$langs->trans("Value").'</td>';
print '<td width="80">&nbsp;</td>';
print "</tr>\n";
print '<form action="'.$_SERVER["PHP_SELF"].'" method="post">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<input type="hidden" name="action" value="set_SUPPLIER_INVOICE_FREE_TEXT">';
print '<tr '.$bc[$var].'><td colspan="2">';
print $langs->trans("FreeLegalTextOnInvoices").' ('.$langs->trans("AddCRIfTooLong").')<br>';
print '<textarea name="SUPPLIER_INVOICE_FREE_TEXT" class="flat" cols="120">'.$conf->global->SUPPLIER_INVOICE_FREE_TEXT.'</textarea>';
print '</td><td align="right">';
print '<input type="submit" class="button" value="'.$langs->trans("Modify").'">';
print "</td></tr>\n";
print '</table><br>';
print '</form>';
$db->close();
/*
* Notifications
*/
print_titre($langs->trans("Notifications"));
print '<table class="noborder" width="100%">';
print '<tr class="liste_titre">';
print '<td>'.$langs->trans("Parameter").'</td>';
print '<td align="center" width="60"></td>';
print '<td width="80">&nbsp;</td>';
print "</tr>\n";
print '<tr '.$bc[$var].'><td colspan="2">';
print $langs->trans("YouMayFindNotificationsFeaturesIntoModuleNotification").'<br>';
print '</td><td align="right">';
print "</td></tr>\n";
print '</table>';
llxFooter();
$db->close();

View File

@ -439,14 +439,16 @@ foreach ($dirmodels as $reldir)
}
}
print '</table><br/>';
print '<br>';
print '</table><br>';
/*
* Other options
*
*/
print '<form action="'.$_SERVER["PHP_SELF"].'" method="post">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<input type="hidden" name="action" value="set_SUPPLIER_ORDER_FREE_TEXT">';
print_titre($langs->trans("OtherOptions"));
print '<table class="noborder" width="100%">';
print '<tr class="liste_titre">';
@ -455,16 +457,39 @@ print '<td align="center" width="60">'.$langs->trans("Value").'</td>';
print '<td width="80">&nbsp;</td>';
print "</tr>\n";
print '<form action="'.$_SERVER["PHP_SELF"].'" method="post">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<input type="hidden" name="action" value="set_SUPPLIER_ORDER_FREE_TEXT">';
print '<tr '.$bc[$var].'><td colspan="2">';
print $langs->trans("FreeLegalTextOnOrders").' ('.$langs->trans("AddCRIfTooLong").')<br>';
print '<textarea name="SUPPLIER_ORDER_FREE_TEXT" class="flat" cols="120">'.$conf->global->SUPPLIER_ORDER_FREE_TEXT.'</textarea>';
print '</td><td align="right">';
print '<input type="submit" class="button" value="'.$langs->trans("Modify").'">';
print "</td></tr>\n";
print '</table><br>';
print '</form>';
$db->close();
/*
* Notifications
*/
print_titre($langs->trans("Notifications"));
print '<table class="noborder" width="100%">';
print '<tr class="liste_titre">';
print '<td>'.$langs->trans("Parameter").'</td>';
print '<td align="center" width="60"></td>';
print '<td width="80">&nbsp;</td>';
print "</tr>\n";
print '<tr '.$bc[$var].'><td colspan="2">';
print $langs->trans("YouMayFindNotificationsFeaturesIntoModuleNotification").'<br>';
print '</td><td align="right">';
print "</td></tr>\n";
print '</table>';
llxFooter();
$db->close();

View File

@ -119,17 +119,17 @@ if ($resql)
print "<a href=\"card.php?id=".$obj->bid."\">".img_object($langs->trans("ShowBookmark"),"bookmark").' '.$obj->bid."</a>";
print '</td>';
$lieninterne=0;
$linkintern=0;
$title=dol_trunc($obj->title,24);
$lien=dol_trunc($obj->url,24);
$link=dol_trunc($obj->url,24);
// Title
print "<td>";
if ($obj->rowid)
{
// Lien interne societe
$lieninterne=1;
$lien="Dolibarr";
$linkintern=1;
$link="Dolibarr";
if (! $obj->title)
{
// For compatibility with old Dolibarr bookmarks
@ -140,16 +140,16 @@ if ($resql)
}
$title=img_object($langs->trans("ShowCompany"),"company").' '.$obj->title;
}
if ($lieninterne) print "<a href=\"".$obj->url."\">";
if ($linkintern) print "<a href=\"".$obj->url."\">";
print $title;
if ($lieninterne) print "</a>";
if ($linkintern) print "</a>";
print "</td>\n";
// Url
print "<td>";
if (! $lieninterne) print '<a href="'.$obj->url.'"'.($obj->target?' target="newlink"':'').'>';
print $lien;
if (! $lieninterne) print '</a>';
if (! $linkintern) print '<a href="'.$obj->url.'"'.($obj->target?' target="newlink"':'').'>';
print $link;
if (! $linkintern) print '</a>';
print "</td>\n";
// Target

View File

@ -1265,7 +1265,7 @@ class Categorie extends CommonObject
/**
* Return name and link of category (with picto)
*
* @param int $withpicto 0=Pas de picto, 1=Inclut le picto dans le lien, 2=Picto seul
* @param int $withpicto 0=No picto, 1=Include picto into link, 2=Only picto
* @param string $option Sur quoi pointe le lien ('', 'xyz')
* @param int $maxlength Max length of text
* @return string Chaine avec URL
@ -1277,15 +1277,15 @@ class Categorie extends CommonObject
$result='';
$label=$langs->trans("ShowCategory").': '. ($this->ref?$this->ref:$this->label);
$lien = '<a href="'.DOL_URL_ROOT.'/categories/viewcat.php?id='.$this->id.'&type='.$this->type.'" title="'.dol_escape_htmltag($label, 1).'" class="classfortooltip">';
$lienfin='</a>';
$link = '<a href="'.DOL_URL_ROOT.'/categories/viewcat.php?id='.$this->id.'&type='.$this->type.'" title="'.dol_escape_htmltag($label, 1).'" class="classfortooltip">';
$linkend='</a>';
$picto='category';
if ($withpicto) $result.=($lien.img_object($label, $picto, 'class="classfortooltip"').$lienfin);
if ($withpicto) $result.=($link.img_object($label, $picto, 'class="classfortooltip"').$linkend);
if ($withpicto && $withpicto != 2) $result.=' ';
if ($withpicto != 2) $result.=$lien.dol_trunc(($this->ref?$this->ref:$this->label),$maxlength).$lienfin;
if ($withpicto != 2) $result.=$link.dol_trunc(($this->ref?$this->ref:$this->label),$maxlength).$linkend;
return $result;
}

View File

@ -957,7 +957,7 @@ class ActionComm extends CommonObject
* Return URL of event
* Use $this->id, $this->type_code, $this->label and $this->type_label
*
* @param int $withpicto 0=Pas de picto, 1=Inclut le picto dans le lien, 2=Picto seul
* @param int $withpicto 0=No picto, 1=Include picto into link, 2=Only picto
* @param int $maxlength Nombre de caracteres max dans libelle
* @param string $classname Force style class on a link
* @param string $option ''=Link to action,'birthday'=Link to contact
@ -974,9 +974,9 @@ class ActionComm extends CommonObject
$label = $this->label;
if (empty($label)) $label=$this->libelle; // For backward compatibility
$linkclose = '" title="'.dol_escape_htmltag($tooltip, 1).'" class="classfortooltip">';
if ($option=='birthday') $lien = '<a '.($classname?'class="'.$classname.'" ':'').'href="'.DOL_URL_ROOT.'/contact/perso.php?id='.$this->id.$linkclose;
else $lien = '<a '.($classname?'class="'.$classname.'" ':'').'href="'.DOL_URL_ROOT.'/comm/action/card.php?id='.$this->id.$linkclose;
$lienfin='</a>';
if ($option=='birthday') $link = '<a '.($classname?'class="'.$classname.'" ':'').'href="'.DOL_URL_ROOT.'/contact/perso.php?id='.$this->id.$linkclose;
else $link = '<a '.($classname?'class="'.$classname.'" ':'').'href="'.DOL_URL_ROOT.'/comm/action/card.php?id='.$this->id.$linkclose;
$linkend='</a>';
//print 'rrr'.$this->libelle.'-'.$withpicto;
if ($withpicto == 2)
@ -998,10 +998,10 @@ class ActionComm extends CommonObject
{
$libelle.=(($this->type_code && $libelle!=$langs->transnoentities("Action".$this->type_code) && $langs->transnoentities("Action".$this->type_code)!="Action".$this->type_code)?' ('.$langs->transnoentities("Action".$this->type_code).')':'');
}
$result.=$lien.img_object($langs->trans("ShowAction").': '.$libelle, ($overwritepicto?$overwritepicto:'action'), 'class="classfortooltip"').$lienfin;
$result.=$link.img_object($langs->trans("ShowAction").': '.$libelle, ($overwritepicto?$overwritepicto:'action'), 'class="classfortooltip"').$linkend;
}
if ($withpicto==1) $result.=' ';
$result.=$lien.$libelleshort.$lienfin;
$result.=$link.$libelleshort.$linkend;
return $result;
}

View File

@ -1337,7 +1337,7 @@ if ($action == 'create')
require_once DOL_DOCUMENT_ROOT . '/core/class/notify.class.php';
$notify = new Notify($db);
$text .= '<br>';
$text .= $notify->confirmMessage('ASKPRICESUPPLIER_VALIDATE', $object->socid);
$text .= $notify->confirmMessage('ASKPRICESUPPLIER_VALIDATE', $object->socid, $object);
}
if (! $error)
@ -1346,9 +1346,9 @@ if ($action == 'create')
if (! $formconfirm) {
$parameters = array('lineid' => $lineid);
$formconfirm = $hookmanager->executeHooks('formConfirm', $parameters, $object, $action); // Note that $action and $object may have been modified
// by
// hook
$reshook = $hookmanager->executeHooks('formConfirm', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
if (empty($reshook)) $formconfirm.=$hookmanager->resPrint;
elseif ($reshook > 0) $formconfirm=$hookmanager->resPrint;
}
// Print form confirm

View File

@ -185,7 +185,7 @@ class AskPriceSupplier extends CommonObject
$price = $prod->price;
}
$line = new AskPriceSupplierLigne($this->db);
$line = new AskPriceSupplierLine($this->db);
$line->fk_product=$idproduct;
$line->desc=$productdesc;
@ -225,7 +225,7 @@ class AskPriceSupplier extends CommonObject
return -5;
}
$askpricesupplierligne=new AskPriceSupplierLigne($this->db);
$askpricesupplierligne=new AskPriceSupplierLine($this->db);
$askpricesupplierligne->fk_askpricesupplier=$this->id;
$askpricesupplierligne->fk_remise_except=$remise->id;
$askpricesupplierligne->desc=$remise->description; // Description ligne
@ -376,7 +376,7 @@ class AskPriceSupplier extends CommonObject
}
// Insert line
$this->line=new AskPriceSupplierLigne($this->db);
$this->line=new AskPriceSupplierLine($this->db);
$this->line->fk_askpricesupplier=$this->id;
$this->line->label=$label;
@ -525,10 +525,10 @@ class AskPriceSupplier extends CommonObject
}
// Update line
$this->line=new AskPriceSupplierLigne($this->db);
$this->line=new AskPriceSupplierLine($this->db);
// Stock previous line records
$staticline=new AskPriceSupplierLigne($this->db);
$staticline=new AskPriceSupplierLine($this->db);
$staticline->fetch($rowid);
$this->line->oldline = $staticline;
@ -621,7 +621,7 @@ class AskPriceSupplier extends CommonObject
{
if ($this->statut == 0)
{
$line=new AskPriceSupplierLigne($this->db);
$line=new AskPriceSupplierLine($this->db);
// For triggers
$line->fetch($lineid);
@ -1106,7 +1106,7 @@ class AskPriceSupplier extends CommonObject
{
$objp = $this->db->fetch_object($result);
$line = new AskPriceSupplierLigne($this->db);
$line = new AskPriceSupplierLine($this->db);
$line->rowid = $objp->rowid;
$line->fk_askpricesupplier = $objp->fk_askpricesupplier;
@ -2088,7 +2088,7 @@ class AskPriceSupplier extends CommonObject
$xnbp = 0;
while ($xnbp < $nbp)
{
$line=new AskPriceSupplierLigne($this->db);
$line=new AskPriceSupplierLine($this->db);
$line->desc=$langs->trans("Description")." ".$xnbp;
$line->qty=1;
$line->subprice=100;
@ -2240,21 +2240,21 @@ class AskPriceSupplier extends CommonObject
$label=$langs->trans("ShowAskpricesupplier").': '.$this->ref;
$linkclose = '" title="'.dol_escape_htmltag($label, 1).'" class="classfortooltip">';
if ($option == '') {
$lien = '<a href="'.DOL_URL_ROOT.'/comm/askpricesupplier/card.php?id='.$this->id. $get_params .$linkclose;
$link = '<a href="'.DOL_URL_ROOT.'/comm/askpricesupplier/card.php?id='.$this->id. $get_params .$linkclose;
}
if ($option == 'document') {
$lien = '<a href="'.DOL_URL_ROOT.'/comm/askpricesupplier/document.php?id='.$this->id. $get_params .$linkclose;
$link = '<a href="'.DOL_URL_ROOT.'/comm/askpricesupplier/document.php?id='.$this->id. $get_params .$linkclose;
}
$lienfin='</a>';
$linkend='</a>';
$picto='askpricesupplier';
if ($withpicto)
$result.=($lien.img_object($label, $picto, 'class="classfortooltip"').$lienfin);
$result.=($link.img_object($label, $picto, 'class="classfortooltip"').$linkend);
if ($withpicto && $withpicto != 2)
$result.=' ';
$result.=$lien.$this->ref.$lienfin;
$result.=$link.$this->ref.$linkend;
return $result;
}
@ -2287,7 +2287,7 @@ class AskPriceSupplier extends CommonObject
{
$obj = $this->db->fetch_object($resql);
$this->lines[$i] = new AskPriceSupplierLigne($this->db);
$this->lines[$i] = new AskPriceSupplierLine($this->db);
$this->lines[$i]->id = $obj->rowid; // for backward compatibility
$this->lines[$i]->rowid = $obj->rowid;
$this->lines[$i]->label = $obj->custom_label;
@ -2412,10 +2412,10 @@ class AskPriceSupplier extends CommonObject
/**
* \class AskPriceSupplierLigne
* \class AskPriceSupplierLine
* \brief Class to manage askpricesupplier lines
*/
class AskPriceSupplierLigne extends CommonObject
class AskPriceSupplierLine extends CommonObject
{
var $db;
var $error;
@ -2689,7 +2689,7 @@ class AskPriceSupplierLigne extends CommonObject
$this->db->begin();
$sql = "DELETE FROM ".MAIN_DB_PREFIX."askpricesupplierdet WHERE rowid = ".$this->rowid;
dol_syslog("AskPriceSupplierLigne::delete", LOG_DEBUG);
dol_syslog("AskPriceSupplierLine::delete", LOG_DEBUG);
if ($this->db->query($sql) )
{
@ -2852,7 +2852,7 @@ class AskPriceSupplierLigne extends CommonObject
$sql.= ",total_ttc=".price2num($this->total_ttc,'MT')."";
$sql.= " WHERE rowid = ".$this->rowid;
dol_syslog("AskPriceSupplierLigne::update_total", LOG_DEBUG);
dol_syslog("AskPriceSupplierLine::update_total", LOG_DEBUG);
$resql=$this->db->query($sql);
if ($resql)

View File

@ -7,6 +7,7 @@
* Copyright (C) 2008 Raphael Bertrand (Resultic) <raphael.bertrand@resultic.fr>
* Copyright (C) 2010-2014 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2013 Alexandre Spangaro <alexandre.spangaro@gmail.com>
* Copyright (C) 2015 Frederic France <frederic.france@free.fr>
* Copyright (C) 2015 Marcos García <marcosgdf@gmail.com>
*
* This program is free software; you can redistribute it and/or modify
@ -32,11 +33,13 @@
require '../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
require_once DOL_DOCUMENT_ROOT.'/societe/class/client.class.php';
require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php';
if (! empty($conf->facture->enabled)) require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
if (! empty($conf->propal->enabled)) require_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php';
if (! empty($conf->commande->enabled)) require_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php';
if (! empty($conf->expedition->enabled)) require_once DOL_DOCUMENT_ROOT.'/expedition/class/expedition.class.php';
if (! empty($conf->contrat->enabled)) require_once DOL_DOCUMENT_ROOT.'/contrat/class/contrat.class.php';
if (! empty($conf->adherent->enabled)) require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php';
if (! empty($conf->ficheinter->enabled)) require_once DOL_DOCUMENT_ROOT.'/fichinter/class/fichinter.class.php';
@ -44,6 +47,7 @@ if (! empty($conf->ficheinter->enabled)) require_once DOL_DOCUMENT_ROOT.'/fichin
$langs->load("companies");
if (! empty($conf->contrat->enabled)) $langs->load("contracts");
if (! empty($conf->commande->enabled)) $langs->load("orders");
if (! empty($conf->expedition->enabled)) $langs->load("sendings");
if (! empty($conf->facture->enabled)) $langs->load("bills");
if (! empty($conf->projet->enabled)) $langs->load("projects");
if (! empty($conf->ficheinter->enabled)) $langs->load("interventions");
@ -221,7 +225,6 @@ if ($id > 0)
print '<table class="border" width="100%">';
print '<tr><td width="30%">'.$langs->trans("ThirdPartyName").'</td><td width="70%" colspan="3">';
$object->next_prev_filter="te.client in (1,2,3)";
print $form->showrefnav($object,'socid','',($user->societe_id?0:1),'rowid','nom','','');
print '</td></tr>';
@ -667,6 +670,73 @@ if ($id > 0)
}
}
/*
* Last sendings
*/
if (! empty($conf->expedition->enabled) && $user->rights->expedition->lire) {
$sendingstatic = new Expedition($db);
$sql = 'SELECT e.rowid as id';
$sql.= ', e.ref';
$sql.= ', e.date_creation';
$sql.= ', e.fk_statut as statut';
$sql.= ', s.nom';
$sql.= ', s.rowid as socid';
$sql.= " FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."expedition as e";
$sql.= " WHERE e.fk_soc = s.rowid AND s.rowid = ".$object->id;
$sql.= " AND e.entity = ".$conf->entity;
$sql.= ' GROUP BY e.rowid';
$sql.= ', e.ref';
$sql.= ', e.date_creation';
$sql.= ', e.fk_statut';
$sql.= ', s.nom';
$sql.= ', s.rowid';
$sql.= " ORDER BY e.date_creation DESC";
$resql = $db->query($sql);
if ($resql) {
$var = true;
$num = $db->num_rows($resql);
$i = 0;
if ($num > 0) {
print '<table class="noborder" width="100%">';
$tableaushown=1;
print '<tr class="liste_titre">';
print '<td colspan="4"><table width="100%" class="nobordernopadding"><tr><td>'.$langs->trans("LastSendings",($num<=$MAXLIST?"":$MAXLIST)).'</td><td align="right"><a href="'.DOL_URL_ROOT.'/expedition/list.php?socid='.$object->id.'">'.$langs->trans("AllSendings").' <span class="badge">'.$num.'</span></a></td>';
print '<td width="20px" align="right"><a href="'.DOL_URL_ROOT.'/expedition/stats/index.php?socid='.$object->id.'">'.img_picto($langs->trans("Statistics"),'stats').'</a></td>';
print '</tr></table></td>';
print '</tr>';
}
while ($i < $num && $i < $MAXLIST) {
$objp = $db->fetch_object($resql);
$var = ! $var;
print "<tr " . $bc[$var] . ">";
print '<td class="nowrap">';
$sendingstatic->id = $objp->id;
$sendingstatic->ref = $objp->ref;
print $sendingstatic->getNomUrl(1);
print '</td>';
if ($objp->date_creation > 0) {
print '<td align="right" width="80">'.dol_print_date($db->jdate($objp->date_creation),'day').'</td>';
} else {
print '<td align="right"><b>!!!</b></td>';
}
print '<td align="right" class="nowrap" width="100" >' . $sendingstatic->LibStatut($objp->statut, 5) . '</td>';
print "</tr>\n";
$i++;
}
$db->free($resql);
if ($num > 0)
print "</table>";
} else {
dol_print_error($db);
}
}
/*
* Last linked contracts
*/

View File

@ -1671,7 +1671,7 @@ if ($action == 'create')
require_once DOL_DOCUMENT_ROOT . '/core/class/notify.class.php';
$notify = new Notify($db);
$text .= '<br>';
$text .= $notify->confirmMessage('PROPAL_VALIDATE', $object->socid);
$text .= $notify->confirmMessage('PROPAL_VALIDATE', $object->socid, $object);
}
if (! $error)
@ -1680,9 +1680,9 @@ if ($action == 'create')
if (! $formconfirm) {
$parameters = array('lineid' => $lineid);
$formconfirm = $hookmanager->executeHooks('formConfirm', $parameters, $object, $action); // Note that $action and $object may have been modified
// by
// hook
$reshook = $hookmanager->executeHooks('formConfirm', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
if (empty($reshook)) $formconfirm.=$hookmanager->resPrint;
elseif ($reshook > 0) $formconfirm=$hookmanager->resPrint;
}
// Print form confirm

View File

@ -107,6 +107,9 @@ class Propal extends CommonObject
var $products=array();
var $extraparams=array();
/**
* @var PropaleLigne[]
*/
var $lines = array();
var $line;
@ -2658,27 +2661,27 @@ class Propal extends CommonObject
$label.= '<br><b>' . $langs->trans('AmountTTC') . ':</b> ' . price($this->total_ttc, 0, $langs, 0, -1, -1, $conf->currency);
$linkclose = '" title="'.dol_escape_htmltag($label, 1).'" class="classfortooltip">';
if ($option == '') {
$lien = '<a href="'.DOL_URL_ROOT.'/comm/propal.php?id='.$this->id. $get_params .$linkclose;
$link = '<a href="'.DOL_URL_ROOT.'/comm/propal.php?id='.$this->id. $get_params .$linkclose;
}
if ($option == 'compta') { // deprecated
$lien = '<a href="'.DOL_URL_ROOT.'/comm/propal.php?id='.$this->id. $get_params .$linkclose;
$link = '<a href="'.DOL_URL_ROOT.'/comm/propal.php?id='.$this->id. $get_params .$linkclose;
}
if ($option == 'expedition') {
$lien = '<a href="'.DOL_URL_ROOT.'/expedition/propal.php?id='.$this->id. $get_params .$linkclose;
$link = '<a href="'.DOL_URL_ROOT.'/expedition/propal.php?id='.$this->id. $get_params .$linkclose;
}
if ($option == 'document') {
$lien = '<a href="'.DOL_URL_ROOT.'/comm/propal/document.php?id='.$this->id. $get_params .$linkclose;
$link = '<a href="'.DOL_URL_ROOT.'/comm/propal/document.php?id='.$this->id. $get_params .$linkclose;
}
$lienfin='</a>';
$linkend='</a>';
$picto='propal';
if ($withpicto)
$result.=($lien.img_object($label, $picto, 'class="classfortooltip"').$lienfin);
$result.=($link.img_object($label, $picto, 'class="classfortooltip"').$linkend);
if ($withpicto && $withpicto != 2)
$result.=' ';
$result.=$lien.$this->ref.$lienfin;
$result.=$link.$this->ref.$linkend;
return $result;
}
@ -2801,9 +2804,6 @@ class Propal extends CommonObject
*/
class PropaleLigne extends CommonObject
{
var $db;
var $error;
public $element='propaldet';
public $table_element='propaldet';

View File

@ -406,7 +406,8 @@ if ($resql)
print "</td></tr>\n";
$parameters=array();
$formconfirm=$hookmanager->executeHooks('printFieldListOption',$parameters); // Note that $action and $object may have been modified by hook
$reshook=$hookmanager->executeHooks('printFieldListSearch',$parameters); // Note that $action and $object may have been modified by hook
print $hookmanager->resPrint;
print "</tr>\n";

View File

@ -253,7 +253,7 @@ if (empty($reshook))
$object->contactid = GETPOST('contactid');
$object->fk_incoterms = GETPOST('incoterm_id', 'int');
$object->location_incoterms = GETPOST('location_incoterms', 'alpha');
// If creation from another object of another module (Example: origin=propal, originid=1)
if (! empty($origin) && ! empty($originid))
{
@ -523,7 +523,7 @@ if (empty($reshook))
{
$result = $object->setIncoterms(GETPOST('incoterm_id', 'int'), GETPOST('location_incoterms', 'alpha'));
}
// bank account
else if ($action == 'setbankaccount' && $user->rights->commande->creer) {
$result=$object->setBankAccount(GETPOST('fk_account', 'int'));
@ -1600,7 +1600,7 @@ if ($action == 'create' && $user->rights->commande->creer)
require_once DOL_DOCUMENT_ROOT . '/core/class/notify.class.php';
$notify = new Notify($db);
$text .= '<br>';
$text .= $notify->confirmMessage('ORDER_VALIDATE', $object->socid);
$text .= $notify->confirmMessage('ORDER_VALIDATE', $object->socid, $object);
}
$qualified_for_stock_change=0;
@ -1726,8 +1726,9 @@ if ($action == 'create' && $user->rights->commande->creer)
if (! $formconfirm) {
$parameters = array('lineid' => $lineid);
$formconfirm = $hookmanager->executeHooks('formConfirm', $parameters, $object, $action); // Note that $action and $object may have been modified
// by hook
$reshook = $hookmanager->executeHooks('formConfirm', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
if (empty($reshook)) $formconfirm.=$hookmanager->resPrint;
elseif ($reshook > 0) $formconfirm=$hookmanager->resPrint;
}
// Print form confirm
@ -1988,10 +1989,10 @@ if ($action == 'create' && $user->rights->commande->creer)
print '</td>';
print '</tr>';
}
// Incoterms
if (!empty($conf->incoterm->enabled))
{
{
print '<tr><td>';
print '<table width="100%" class="nobordernopadding"><tr><td>';
print $langs->trans('IncotermLabel');
@ -2005,13 +2006,13 @@ if ($action == 'create' && $user->rights->commande->creer)
{
print $form->textwithpicto($object->display_incoterms(), $object->libelle_incoterms, 1);
}
else
else
{
print $form->select_incoterms((!empty($object->fk_incoterms) ? $object->fk_incoterms : ''), (!empty($object->location_incoterms)?$object->location_incoterms:''), $_SERVER['PHP_SELF'].'?id='.$object->id);
}
print '</td></tr>';
}
// Other attributes
$cols = 3;
include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_view.tpl.php';
@ -2044,7 +2045,7 @@ if ($action == 'create' && $user->rights->commande->creer)
// Total HT
print '<tr><td>' . $langs->trans('AmountHT') . '</td>';
print '<td align="right">' . price($object->total_ht, 1, '', 1, - 1, - 1, $conf->currency) . '</td>';
print '<td>' . price($object->total_ht, 1, '', 1, - 1, - 1, $conf->currency) . '</td>';
// Margin Infos
if (! empty($conf->margin->enabled)) {
@ -2056,23 +2057,23 @@ if ($action == 'create' && $user->rights->commande->creer)
print '</tr>';
// Total TVA
print '<tr><td>' . $langs->trans('AmountVAT') . '</td><td align="right">' . price($object->total_tva, 1, '', 1, - 1, - 1, $conf->currency) . '</td></tr>';
// Total VAT
print '<tr><td>' . $langs->trans('AmountVAT') . '</td><td>' . price($object->total_tva, 1, '', 1, - 1, - 1, $conf->currency) . '</td></tr>';
// Amount Local Taxes
if ($mysoc->localtax1_assuj == "1" || $object->total_localtax1 != 0) // Localtax1
{
print '<tr><td>' . $langs->transcountry("AmountLT1", $mysoc->country_code) . '</td>';
print '<td align="right">' . price($object->total_localtax1, 1, '', 1, - 1, - 1, $conf->currency) . '</td></tr>';
print '<td>' . price($object->total_localtax1, 1, '', 1, - 1, - 1, $conf->currency) . '</td></tr>';
}
if ($mysoc->localtax2_assuj == "1" || $object->total_localtax2 != 0) // Localtax2 IRPF
{
print '<tr><td>' . $langs->transcountry("AmountLT2", $mysoc->country_code) . '</td>';
print '<td align="right">' . price($object->total_localtax2, 1, '', 1, - 1, - 1, $conf->currency) . '</td></tr>';
print '<td>' . price($object->total_localtax2, 1, '', 1, - 1, - 1, $conf->currency) . '</td></tr>';
}
// Total TTC
print '<tr><td>' . $langs->trans('AmountTTC') . '</td><td align="right">' . price($object->total_ttc, 1, '', 1, - 1, - 1, $conf->currency) . '</td></tr>';
print '<tr><td>' . $langs->trans('AmountTTC') . '</td><td>' . price($object->total_ttc, 1, '', 1, - 1, - 1, $conf->currency) . '</td></tr>';
// Statut
print '<tr><td>' . $langs->trans('Status') . '</td><td>' . $object->getLibStatut(4) . '</td></tr>';
@ -2243,10 +2244,10 @@ if ($action == 'create' && $user->rights->commande->creer)
}
// Cancel order
if ($object->statut == 1 &&
if ($object->statut == 1 &&
((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->commande->cloturer))
|| (! empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->commande->order_advance->annuler)))
)
)
{
print '<div class="inline-block divButAction"><a class="butActionDelete" href="' . $_SERVER["PHP_SELF"] . '?id=' . $object->id . '&amp;action=cancel">' . $langs->trans('Cancel') . '</a></div>';
}

View File

@ -104,13 +104,21 @@ class Commande extends CommonOrder
var $user_author_id;
var $lines = array();
/**
* @var OrderLine[]
*/
var $lines = array();
//Incorterms
var $fk_incoterms;
var $location_incoterms;
var $libelle_incoterms; //Used into tooltip
// Pour board
var $nbtodo;
var $nbtodolate;
/**
* ERR Not engouch stock
*/
@ -629,8 +637,8 @@ class Commande extends CommonOrder
* Note that this->ref can be set or empty. If empty, we will use "(PROV)"
*
* @param User $user Objet user that make creation
* @param int $notrigger Disable all triggers
* @return int <0 if KO, >0 if OK
* @param int $notrigger Disable all triggers
* @return int <0 if KO, >0 if OK
*/
function create($user, $notrigger=0)
{
@ -638,22 +646,22 @@ class Commande extends CommonOrder
$error=0;
// Clean parameters
$this->brouillon = 1; // On positionne en mode brouillon la commande
$this->brouillon = 1; // set command as draft
dol_syslog(get_class($this)."::create user=".$user->id);
// Check parameters
if (! empty($this->ref)) // We check that ref is not already used
{
$result=self::isExistingObject($this->element, 0, $this->ref); // Check ref is not yet used
if ($result > 0)
{
$this->error='ErrorRefAlreadyExists';
dol_syslog(get_class($this)."::create ".$this->error,LOG_WARNING);
$this->db->rollback();
return -1;
}
}
{
$result=self::isExistingObject($this->element, 0, $this->ref); // Check ref is not yet used
if ($result > 0)
{
$this->error='ErrorRefAlreadyExists';
dol_syslog(get_class($this)."::create ".$this->error,LOG_WARNING);
$this->db->rollback();
return -1;
}
}
$soc = new Societe($this->db);
$result=$soc->fetch($this->socid);
@ -682,7 +690,7 @@ class Commande extends CommonOrder
$sql.= ", model_pdf, fk_cond_reglement, fk_mode_reglement, fk_account, fk_availability, fk_input_reason, date_livraison, fk_delivery_address";
$sql.= ", fk_shipping_method";
$sql.= ", remise_absolue, remise_percent";
$sql.= ", fk_incoterms, location_incoterms";
$sql.= ", fk_incoterms, location_incoterms";
$sql.= ", entity";
$sql.= ")";
$sql.= " VALUES ('(PROV)',".$this->socid.", '".$this->db->idate($now)."', ".$user->id;
@ -722,7 +730,7 @@ class Commande extends CommonOrder
$num=count($this->lines);
/*
* Insertion du detail des produits dans la base
* Insert products details into db
*/
for ($i=0;$i<$num;$i++)
{
@ -753,7 +761,7 @@ class Commande extends CommonOrder
$this->lines[$i]->fk_fournprice,
$this->lines[$i]->pa_ht,
$this->lines[$i]->label,
$this->lines[$i]->array_options
$this->lines[$i]->array_options
);
if ($result < 0)
{
@ -771,13 +779,16 @@ class Commande extends CommonOrder
}
}
// Mise a jour ref
$sql = 'UPDATE '.MAIN_DB_PREFIX."commande SET ref='(PROV".$this->id.")' WHERE rowid=".$this->id;
// update ref
$initialref='(PROV'.$this->id.')';
if (! empty($this->ref)) $initialref=$this->ref;
$sql = 'UPDATE '.MAIN_DB_PREFIX."commande SET ref='".$this->db->escape($initialref)."' WHERE rowid=".$this->id;
if ($this->db->query($sql))
{
if ($this->id)
{
$this->ref="(PROV".$this->id.")";
$this->ref = $initialref;
// Add object linked
if (is_array($this->linked_objects) && ! empty($this->linked_objects))
@ -1476,7 +1487,7 @@ class Commande extends CommonOrder
//Incoterms
$this->fk_incoterms = $obj->fk_incoterms;
$this->location_incoterms = $obj->location_incoterms;
$this->location_incoterms = $obj->location_incoterms;
$this->libelle_incoterms = $obj->libelle_incoterms;
$this->extraparams = (array) json_decode($obj->extraparams, true);
@ -1627,12 +1638,12 @@ class Commande extends CommonOrder
$line = new OrderLine($this->db);
$line->rowid = $objp->rowid; // \deprecated
$line->rowid = $objp->rowid;
$line->id = $objp->rowid;
$line->fk_commande = $objp->fk_commande;
$line->commande_id = $objp->fk_commande; // \deprecated
$line->commande_id = $objp->fk_commande;
$line->label = $objp->custom_label;
$line->desc = $objp->description; // Description ligne
$line->desc = $objp->description;
$line->product_type = $objp->product_type;
$line->qty = $objp->qty;
$line->tva_tx = $objp->tva_tx;
@ -1658,11 +1669,11 @@ class Commande extends CommonOrder
$line->special_code = $objp->special_code;
$line->fk_parent_line = $objp->fk_parent_line;
$line->ref = $objp->product_ref; // TODO deprecated
$line->ref = $objp->product_ref;
$line->product_ref = $objp->product_ref;
$line->libelle = $objp->product_label; // TODO deprecated
$line->libelle = $objp->product_label;
$line->product_label = $objp->product_label;
$line->product_desc = $objp->product_desc; // Description produit
$line->product_desc = $objp->product_desc;
$line->fk_product_type = $objp->fk_product_type; // Produit ou service
$line->date_start = $this->db->jdate($objp->date_start);
@ -3253,56 +3264,44 @@ class Commande extends CommonOrder
*/
class OrderLine extends CommonOrderLine
{
var $db;
var $error;
public $element='commandedet';
public $table_element='commandedet';
var $oldline;
/**
* Id of parent order
* @var int
*/
public $fk_commande;
/**
* Id of parent order
* @var int
* @deprecated Use fk_commande
*/
public $commande_id;
// From llx_commandedet
var $rowid;
var $fk_parent_line;
var $fk_facture;
var $label;
var $desc; // Description ligne
var $fk_product; // Id produit predefini
var $product_type = 0; // Type 0 = product, 1 = Service
var $qty; // Quantity (example 2)
var $tva_tx; // VAT Rate for product/service (example 19.6)
var $localtax1_tx; // Local tax 1
var $localtax2_tx; // Local tax 2
var $localtax1_type; // Local tax 1 type
var $localtax2_type; // Local tax 2 type
var $subprice; // U.P. HT (example 100)
var $remise_percent; // % for line discount (example 20%)
var $fk_remise_except;
var $rang = 0;
var $fk_fournprice;
/**
* Buy price without taxes
* @var float
*/
var $pa_ht;
var $marge_tx;
var $marque_tx;
var $info_bits = 0; // Bit 0: 0 si TVA normal - 1 si TVA NPR
// Bit 1: 0 ligne normale - 1 si ligne de remise fixe
var $special_code = 0;
var $total_ht; // Total HT de la ligne toute quantite et incluant la remise ligne
var $total_tva; // Total TVA de la ligne toute quantite et incluant la remise ligne
var $total_localtax1; // Total local tax 1 for the line
var $total_localtax2; // Total local tax 2 for the line
var $total_ttc; // Total TTC de la ligne toute quantite et incluant la remise ligne
// Ne plus utiliser
var $remise;
var $price;
// From llx_product
var $ref; // deprecated
var $libelle; // deprecated
var $product_ref;
var $product_label; // Label produit
var $product_desc; // Description produit
/**
* @deprecated
*/
var $remise;
// Added by Matelli (See http://matelli.fr/showcases/patchs-dolibarr/add-dates-in-order-lines.html)
// Start and end date of the line

View File

@ -158,12 +158,12 @@ if ($resql)
print '<td>';
$result='';
$lien=$lienfin='';
$lien = '<a href="'.dol_buildpath('/commande/orderstoinvoice.php',1).'?socid='.$obj->rowid.'">';
$lienfin='</a>';
$link=$linkend='';
$link = '<a href="'.dol_buildpath('/commande/orderstoinvoice.php',1).'?socid='.$obj->rowid.'">';
$linkend='</a>';
$name=$obj->name;
$result.=($lien.img_object($langs->trans("ShowCompany").': '.$name,'company').$lienfin);
$result.=$lien.(dol_trunc($name,$maxlen)).$lienfin;
$result.=($link.img_object($langs->trans("ShowCompany").': '.$name,'company').$linkend);
$result.=$link.(dol_trunc($name,$maxlen)).$linkend;
print $result;
print '</td>';

View File

@ -6,7 +6,7 @@
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2010-2011 Juanjo Menent <jmenent@@2byte.es>
* Copyright (C) 2012-2014 Marcos García <marcosgdf@gmail.com>
* Copyright (C) 2011-2014 Alexandre Spangaro <alexandre.spangaro@gmail.com>
* Copyright (C) 2011-2015 Alexandre Spangaro <alexandre.spangaro@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
@ -37,6 +37,8 @@ require_once DOL_DOCUMENT_ROOT.'/compta/sociales/class/chargesociales.class.php'
require_once DOL_DOCUMENT_ROOT.'/compta/paiement/class/paiement.class.php';
require_once DOL_DOCUMENT_ROOT.'/compta/tva/class/tva.class.php';
require_once DOL_DOCUMENT_ROOT.'/compta/salaries/class/paymentsalary.class.php';
require_once DOL_DOCUMENT_ROOT.'/don/class/don.class.php';
require_once DOL_DOCUMENT_ROOT.'/loan/class/loan.class.php';
require_once DOL_DOCUMENT_ROOT.'/fourn/class/paiementfourn.class.php';
require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
@ -44,6 +46,8 @@ $langs->load("banks");
$langs->load("categories");
$langs->load("bills");
$langs->load("companies");
$langs->load("loan");
$langs->load("donations");
$id = (GETPOST('id','int') ? GETPOST('id','int') : GETPOST('account','int'));
$ref = GETPOST('ref','alpha');
@ -148,11 +152,13 @@ llxHeader();
$societestatic=new Societe($db);
$userstatic=new User($db);
$chargestatic=new ChargeSociales($db);
$loanstatic=new Loan($db);
$memberstatic=new Adherent($db);
$paymentstatic=new Paiement($db);
$paymentsupplierstatic=new PaiementFourn($db);
$paymentvatstatic=new TVA($db);
$paymentsalstatic=new PaymentSalary($db);
$donstatic=new Don($db);
$bankstatic=new Account($db);
$banklinestatic=new AccountLine($db);
@ -606,6 +612,18 @@ if ($id > 0 || ! empty($ref))
$paymentsalstatic->ref=$links[$key]['url_id'];
print ' '.$paymentsalstatic->getNomUrl(2);
}
elseif ($links[$key]['type']=='payment_loan')
{
print '<a href="'.DOL_URL_ROOT.'/loan/payment/card.php?id='.$links[$key]['url_id'].'">';
print ' '.img_object($langs->trans('ShowPayment'),'payment').' ';
print '</a>';
}
elseif ($links[$key]['type']=='payment_donation')
{
print '<a href="'.DOL_URL_ROOT.'/don/payment/card.php?id='.$links[$key]['url_id'].'">';
print ' '.img_object($langs->trans('ShowPayment'),'payment').' ';
print '</a>';
}
elseif ($links[$key]['type']=='banktransfert')
{
// Do not show link to transfer since there is no transfer card (avoid confusion). Can already be accessed from transaction detail.
@ -705,6 +723,21 @@ if ($id > 0 || ! empty($ref))
$chargestatic->ref=$chargestatic->lib;
print $chargestatic->getNomUrl(1,16);
}
else if ($links[$key]['type']=='loan')
{
$loanstatic->id=$links[$key]['url_id'];
if (preg_match('/^\((.*)\)$/i',$links[$key]['label'],$reg))
{
if ($reg[1]=='loan') $reg[1]='Loan';
$loanstatic->label=$langs->trans($reg[1]);
}
else
{
$loanstatic->label=$links[$key]['label'];
}
$loanstatic->ref=$loanstatic->label;
print $loanstatic->getLinkUrl(1,16);
}
else if ($links[$key]['type']=='member')
{
$memberstatic->id=$links[$key]['url_id'];

View File

@ -137,7 +137,7 @@ $head=bank_prepare_head($acct);
dol_fiche_head($head,'annual',$langs->trans("FinancialAccount"),0,'account');
$title=$langs->trans("FinancialAccount")." : ".$acct->label;
$lien=($year_start?"<a href='".$_SERVER["PHP_SELF"]."?account=".$acct->id."&year_start=".($year_start-1)."'>".img_previous()."</a> ".$langs->trans("Year")." <a href='".$_SERVER["PHP_SELF"]."?account=".$acct->id."&year_start=".($year_start+1)."'>".img_next()."</a>":"");
$link=($year_start?"<a href='".$_SERVER["PHP_SELF"]."?account=".$acct->id."&year_start=".($year_start-1)."'>".img_previous()."</a> ".$langs->trans("Year")." <a href='".$_SERVER["PHP_SELF"]."?account=".$acct->id."&year_start=".($year_start+1)."'>".img_next()."</a>":"");
print '<table class="border" width="100%">';
@ -191,7 +191,7 @@ print '<br>';
// Affiche tableau
print '<table class="notopnoleftnoright" width="100%">';
print '<tr><td colspan="'.(1+($year_end-$year_start+1)*2).'" align="right">'.$lien.'</td></tr>';
print '<tr><td colspan="'.(1+($year_end-$year_start+1)*2).'" align="right">'.$link.'</td></tr>';
print '<tr class="liste_titre"><td class="liste_titre">'.$langs->trans("Month").'</td>';
for ($annee = $year_start ; $annee <= $year_end ; $annee++)

View File

@ -39,12 +39,12 @@ class Account extends CommonObject
public $table_element='bank_account';
/**
* //TODO: Discuss this. $rowid is preferred over $id
* @var
* @var int Use id instead of rowid
* @deprecated
*/
var $rowid;
var $id;
var $ref;
var $label;
//! 1=Compte courant/check/carte, 2=Compte liquide, 0=Compte épargne
@ -968,9 +968,9 @@ class Account extends CommonObject
/**
* Renvoie nom clicable (avec eventuellement le picto)
* Return clicable name (with picto eventually)
*
* @param int $withpicto Inclut le picto dans le lien
* @param int $withpicto Include picto into link
* @param string $mode ''=Link to card, 'transactions'=Link to transactions card
* @return string Chaine avec URL
*/
@ -988,17 +988,17 @@ class Account extends CommonObject
if (empty($mode))
{
$lien = '<a href="'.DOL_URL_ROOT.'/compta/bank/card.php?id='.$this->id.$linkclose;
$lienfin='</a>';
$link = '<a href="'.DOL_URL_ROOT.'/compta/bank/card.php?id='.$this->id.$linkclose;
$linkend='</a>';
}
else if ($mode == 'transactions')
{
$lien = '<a href="'.DOL_URL_ROOT.'/compta/bank/account.php?account='.$this->id.$linkclose;
$lienfin='</a>';
$link = '<a href="'.DOL_URL_ROOT.'/compta/bank/account.php?account='.$this->id.$linkclose;
$linkend='</a>';
}
if ($withpicto) $result.=($lien.img_object($label, 'account', 'class="classfortooltip"').$lienfin.' ');
$result.=$lien.$this->label.$lienfin;
if ($withpicto) $result.=($link.img_object($label, 'account', 'class="classfortooltip"').$linkend.' ');
$result.=$link.$this->label.$linkend;
return $result;
}
@ -1521,9 +1521,9 @@ class AccountLine extends CommonObject
/**
* Renvoie nom clicable (avec eventuellement le picto)
* Return clicable name (with picto eventually)
*
* @param int $withpicto 0=Pas de picto, 1=Inclut le picto dans le lien, 2=Picto seul
* @param int $withpicto 0=No picto, 1=Include picto into link, 2=Only picto
* @param int $maxlen Longueur max libelle
* @param string $option Option ('showall')
* @return string Chaine avec URL
@ -1534,11 +1534,11 @@ class AccountLine extends CommonObject
$result='';
$label=$langs->trans("ShowTransaction").': '.$this->rowid;
$lien = '<a href="'.DOL_URL_ROOT.'/compta/bank/ligne.php?rowid='.$this->rowid.'" title="'.dol_escape_htmltag($label, 1).'" class="classfortooltip">';
$lienfin='</a>';
$link = '<a href="'.DOL_URL_ROOT.'/compta/bank/ligne.php?rowid='.$this->rowid.'" title="'.dol_escape_htmltag($label, 1).'" class="classfortooltip">';
$linkend='</a>';
if ($withpicto) $result.=($lien.img_object($label, 'account', 'class="classfortooltip"').$lienfin.' ');
$result.=$lien.$this->rowid.$lienfin;
if ($withpicto) $result.=($link.img_object($label, 'account', 'class="classfortooltip"').$linkend.' ');
$result.=$link.$this->rowid.$linkend;
if ($option == 'showall' || $option == 'showconciliated') $result.=' (';
if ($option == 'showall')

View File

@ -841,8 +841,8 @@ if ($mode == 'standard')
if ($nextmonth > 12) { $nextmonth=1; $nextyear++; }
// For month
$lien="<a href='".$_SERVER["PHP_SELF"]."?account=".$account.($_GET["option"]!='all'?'':'&option=all')."&year=".$prevyear."&month=".$prevmonth."'>".img_previous()."</a> ".$langs->trans("Month")." <a href='".$_SERVER["PHP_SELF"]."?account=".$account."&year=".$nextyear."&month=".$nextmonth."'>".img_next()."</a>";
print '<tr><td align="right">'.$lien.'</td></tr>';
$link="<a href='".$_SERVER["PHP_SELF"]."?account=".$account.($_GET["option"]!='all'?'':'&option=all')."&year=".$prevyear."&month=".$prevmonth."'>".img_previous()."</a> ".$langs->trans("Month")." <a href='".$_SERVER["PHP_SELF"]."?account=".$account."&year=".$nextyear."&month=".$nextmonth."'>".img_next()."</a>";
print '<tr><td align="right">'.$link.'</td></tr>';
print '<tr><td align="center">';
$file = "movement".$account."-".$year.$month.".png";
@ -855,8 +855,8 @@ if ($mode == 'standard')
// For year
$prevyear=$year-1;$nextyear=$year+1;
$lien="<a href='".$_SERVER["PHP_SELF"]."?account=".$account.($_GET["option"]!='all'?'':'&option=all')."&year=".($prevyear)."'>".img_previous()."</a> ".$langs->trans("Year")." <a href='".$_SERVER["PHP_SELF"]."?account=".$account."&year=".($nextyear)."'>".img_next()."</a>";
print '<tr><td align="right">'.$lien.'</td></tr>';
$link="<a href='".$_SERVER["PHP_SELF"]."?account=".$account.($_GET["option"]!='all'?'':'&option=all')."&year=".($prevyear)."'>".img_previous()."</a> ".$langs->trans("Year")." <a href='".$_SERVER["PHP_SELF"]."?account=".$account."&year=".($nextyear)."'>".img_next()."</a>";
print '<tr><td align="right">'.$link.'</td></tr>';
print '<tr><td align="center">';
print $show5;

View File

@ -4,6 +4,7 @@
* Copyright (C) 2004-2014 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2004 Christophe Combelles <ccomb@free.fr>
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2015 Alexandre Spangaro <alexandre.spangaro@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
@ -21,7 +22,7 @@
/**
* \file htdocs/compta/bank/ligne.php
* \ingroup compta
* \ingroup bank
* \brief Page to edit a bank transaction record
*/
@ -33,6 +34,7 @@ $langs->load("categories");
$langs->load("compta");
$langs->load("bills");
if (! empty($conf->adherent->enabled)) $langs->load("members");
if (! empty($conf->don->enabled)) $langs->load("donations");
$id = (GETPOST('id','int') ? GETPOST('id','int') : GETPOST('account','int'));
@ -350,6 +352,12 @@ if ($result)
print img_object($langs->trans('ShowMember'),'user').' ';
print $links[$key]['label'];
print '</a>';
}
else if ($links[$key]['type']=='payment_donation') {
print '<a href="'.DOL_URL_ROOT.'/don/payment/card.php?id='.$links[$key]['url_id'].'">';
print img_object($langs->trans('ShowDonation'),'payment').' ';
print $langs->trans("DonationPayment");
print '</a>';
}
else if ($links[$key]['type']=='banktransfert') {
print '<a href="'.DOL_URL_ROOT.'/compta/bank/ligne.php?rowid='.$links[$key]['url_id'].'">';

View File

@ -30,7 +30,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/bank.lib.php';
require_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php';
require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/bankcateg.class.php';
require_once DOL_DOCUMENT_ROOT . '/core/class/html.formother.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php';
$langs->load("banks");
$langs->load("categories");
@ -128,7 +128,7 @@ if (! empty($type))
{
$sql.= " AND b.fk_type = '".$db->escape($type)."' ";
}
//Search period criteria
// Search period criteria
if (dol_strlen($search_dt_start)>0) {
$sql .= " AND b.dateo >= '" . $db->idate($search_dt_start) . "'";
}

View File

@ -349,7 +349,7 @@ class Deplacement extends CommonObject
/**
* Return clicable name (with picto eventually)
*
* @param int $withpicto 0=Pas de picto, 1=Inclut le picto dans le lien, 2=Picto seul
* @param int $withpicto 0=No picto, 1=Include picto into link, 2=Only picto
* @return string Chaine avec URL
*/
function getNomUrl($withpicto=0)
@ -359,15 +359,15 @@ class Deplacement extends CommonObject
$result='';
$label=$langs->trans("Show").': '.$this->ref;
$lien = '<a href="'.DOL_URL_ROOT.'/compta/deplacement/card.php?id='.$this->id.'" title="'.dol_escape_htmltag($label, 1).'" class="classfortooltip">';
$lienfin='</a>';
$link = '<a href="'.DOL_URL_ROOT.'/compta/deplacement/card.php?id='.$this->id.'" title="'.dol_escape_htmltag($label, 1).'" class="classfortooltip">';
$linkend='</a>';
$picto='trip';
if ($withpicto) $result.=($lien.img_object($label, $picto, 'class="classfortooltip"').$lienfin);
if ($withpicto) $result.=($link.img_object($label, $picto, 'class="classfortooltip"').$linkend);
if ($withpicto && $withpicto != 2) $result.=' ';
if ($withpicto != 2) $result.=$lien.$this->ref.$lienfin;
if ($withpicto != 2) $result.=$link.$this->ref.$linkend;
return $result;
}

View File

@ -1,593 +0,0 @@
<?php
/* Copyright (C) 2001-2002 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2011 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
*
* 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/compta/dons/card.php
* \ingroup don
* \brief Page of donation card
*/
require '../../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/modules/dons/modules_don.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php';
require_once DOL_DOCUMENT_ROOT.'/compta/dons/class/don.class.php';
require_once DOL_DOCUMENT_ROOT.'/compta/paiement/class/paiement.class.php';
if (! empty($conf->projet->enabled)) {
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php';
}
$langs->load("companies");
$langs->load("donations");
$langs->load("bills");
$id=GETPOST('rowid')?GETPOST('rowid','int'):GETPOST('id','int');
$action=GETPOST('action','alpha');
$cancel=GETPOST('cancel');
$amount=GETPOST('amount');
$don = new Don($db);
$donation_date=dol_mktime(12, 0, 0, GETPOST('remonth'), GETPOST('reday'), GETPOST('reyear'));
// Security check
$result = restrictedArea($user, 'don', $id);
// Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array
$hookmanager->initHooks(array('doncard','globalcard'));
/*
* Actions
*/
if ($action == 'update')
{
if (! empty($cancel))
{
header("Location: ".$_SERVER['PHP_SELF']."?id=".$id);
exit;
}
$error=0;
if (empty($donation_date))
{
setEventMessage($langs->trans("ErrorFieldRequired",$langs->trans("Date")), 'errors');
$action = "create";
$error++;
}
if (empty($amount))
{
setEventMessage($langs->trans("ErrorFieldRequired",$langs->trans("Amount")), 'errors');
$action = "create";
$error++;
}
if (! $error)
{
$don->fetch($id);
$don->firstname = $_POST["firstname"];
$don->lastname = $_POST["lastname"];
$don->societe = $_POST["societe"];
$don->address = $_POST["address"];
$don->amount = price2num($_POST["amount"]);
$don->town = $_POST["town"];
$don->zip = $_POST["zipcode"];
$don->country = $_POST["country"];
$don->email = $_POST["email"];
$don->date = $donation_date;
$don->note = $_POST["note"];
$don->public = $_POST["public"];
$don->fk_project = $_POST["projectid"];
$don->note_private= GETPOST("note_private");
$don->note_public = GETPOST("note_public");
$don->modepaiementid = $_POST["modepaiement"];
if ($don->update($user) > 0)
{
header("Location: ".$_SERVER['PHP_SELF']."?id=".$don->id);
exit;
}
}
}
if ($action == 'add')
{
if (! empty($cancel))
{
header("Location: index.php");
exit;
}
$error=0;
if (empty($donation_date))
{
setEventMessage($langs->trans("ErrorFieldRequired",$langs->trans("Date")), 'errors');
$action = "create";
$error++;
}
if (empty($amount))
{
setEventMessage($langs->trans("ErrorFieldRequired",$langs->trans("Amount")), 'errors');
$action = "create";
$error++;
}
if (! $error)
{
$don->firstname = $_POST["firstname"];
$don->lastname = $_POST["lastname"];
$don->societe = $_POST["societe"];
$don->address = $_POST["address"];
$don->amount = price2num($_POST["amount"]);
$don->town = $_POST["town"];
$don->zip = $_POST["zipcode"];
$don->town = $_POST["town"];
$don->country = $_POST["country"];
$don->email = $_POST["email"];
$don->date = $donation_date;
$don->note_private= GETPOST("note_private");
$don->note_public = GETPOST("note_public");
$don->public = $_POST["public"];
$don->fk_project = $_POST["projectid"];
$don->modepaiementid = $_POST["modepaiement"];
if ($don->create($user) > 0)
{
header("Location: index.php");
exit;
}
}
}
if ($action == 'delete')
{
$don->delete($id);
header("Location: list.php");
exit;
}
if ($action == 'commentaire')
{
$don->fetch($id);
$don->update_note($_POST["commentaire"]);
}
if ($action == 'valid_promesse')
{
if ($don->valid_promesse($id, $user->id) >= 0)
{
header("Location: ".$_SERVER['PHP_SELF']."?id=".$id);
exit;
}
else {
setEventMessage($don->error, 'errors');
}
}
if ($action == 'set_cancel')
{
if ($don->set_cancel($id) >= 0)
{
header("Location: ".$_SERVER['PHP_SELF']."?id=".$id);
exit;
}
else {
setEventMessage($don->error, 'errors');
}
}
if ($action == 'set_paid')
{
if ($don->set_paye($id, $modepaiement) >= 0)
{
header("Location: ".$_SERVER['PHP_SELF']."?id=".$id);
exit;
}
else {
setEventMessage($don->error, 'errors');
}
}
if ($action == 'set_encaisse')
{
if ($don->set_encaisse($id) >= 0)
{
header("Location: ".$_SERVER['PHP_SELF']."?id=".$id);
exit;
}
else {
setEventMessage($don->error, 'errors');
}
}
/*
* Build doc
*/
if ($action == 'builddoc')
{
$object = new Don($db);
$object->fetch($id);
// Save last template used to generate document
if (GETPOST('model')) $object->setDocModel($user, GETPOST('model','alpha'));
// Define output language
$outputlangs = $langs;
$newlang='';
if ($conf->global->MAIN_MULTILANGS && empty($newlang) && ! empty($_REQUEST['lang_id'])) $newlang=$_REQUEST['lang_id'];
if ($conf->global->MAIN_MULTILANGS && empty($newlang)) $newlang=$object->client->default_lang;
if (! empty($newlang))
{
$outputlangs = new Translate("",$conf);
$outputlangs->setDefaultLang($newlang);
}
$result=don_create($db, $object->id, '', $object->modelpdf, $outputlangs);
if ($result <= 0)
{
dol_print_error($db,$result);
exit;
}
}
/*
* View
*/
llxHeader('',$langs->trans("Donations"),'EN:Module_Donations|FR:Module_Dons|ES:M&oacute;dulo_Donaciones');
$form=new Form($db);
$formfile = new FormFile($db);
$formcompany = new FormCompany($db);
/* ************************************************************************** */
/* */
/* Creation */
/* */
/* ************************************************************************** */
if ($action == 'create')
{
print_fiche_titre($langs->trans("AddDonation"));
print '<form name="add" action="card.php" method="post">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<table class="border" width="100%">';
print '<input type="hidden" name="action" value="add">';
$nbrows=11;
if (! empty($conf->projet->enabled)) $nbrows++;
// Date
print '<tr><td class="fieldrequired">'.$langs->trans("Date").'</td><td>';
$form->select_date($donation_date?$donation_date:-1,'','','','',"add",1,1);
print '</td>';
print '<td rowspan="'.$nbrows.'" valign="top">'.$langs->trans("Comments").' :<br>';
print "<textarea name=\"note_private\" wrap=\"soft\" cols=\"40\" rows=\"15\">".GETPOST("note_private")."</textarea></td>";
print "</tr>";
// Amount
print "<tr>".'<td class="fieldrequired">'.$langs->trans("Amount").'</td><td><input type="text" name="amount" value="'.$_POST["amount"].'" size="10"> '.$langs->trans("Currency".$conf->currency).'</td></tr>';
print '<tr><td class="fieldrequired">'.$langs->trans("PublicDonation")."</td><td>";
print $form->selectyesno("public",isset($_POST["public"])?$_POST["public"]:1,1);
print "</td></tr>\n";
print "<tr>".'<td>'.$langs->trans("Company").'</td><td><input type="text" name="societe" value="'.$_POST["societe"].'" size="40"></td></tr>';
print "<tr>".'<td>'.$langs->trans("Firstname").'</td><td><input type="text" name="firstname" value="'.$_POST["firstname"].'" size="40"></td></tr>';
print "<tr>".'<td>'.$langs->trans("Lastname").'</td><td><input type="text" name="lastname" value="'.$_POST["lastname"].'" size="40"></td></tr>';
print "<tr>".'<td>'.$langs->trans("Address").'</td><td>';
print '<textarea name="address" wrap="soft" cols="40" rows="3">'.$_POST["address"].'</textarea></td></tr>';
// Zip / Town
print '<tr><td>'.$langs->trans("Zip").' / '.$langs->trans("Town").'</td><td>';
print $formcompany->select_ziptown((isset($_POST["zipcode"])?$_POST["zipcode"]:$don->zip),'zipcode',array('town','selectcountry_id','state_id'),6);
print ' ';
print $formcompany->select_ziptown((isset($_POST["town"])?$_POST["town"]:$don->town),'town',array('zipcode','selectcountry_id','state_id'));
print '</tr>';
print "<tr>".'<td>'.$langs->trans("Country").'</td><td><input type="text" name="country" value="'.$_POST["country"].'" size="40"></td></tr>';
print "<tr>".'<td>'.$langs->trans("EMail").'</td><td><input type="text" name="email" value="'.$_POST["email"].'" size="40"></td></tr>';
print "<tr><td>".$langs->trans("PaymentMode")."</td><td>\n";
$form->select_types_paiements('', 'modepaiement', 'CRDT', 0, 1);
print "</td></tr>\n";
if (! empty($conf->projet->enabled))
{
$formproject=new FormProjets($db);
// Si module projet actif
print "<tr><td>".$langs->trans("Project")."</td><td>";
$formproject->select_projects('',$_POST["projectid"],"projectid");
print "</td></tr>\n";
}
// Other attributes
$parameters=array('colspan' => ' colspan="1"');
$reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$don,$action); // Note that $action and $object may have been modified by hook
print "</table>\n";
print '<br><div class="center"><input type="submit" class="button" name="save" value="'.$langs->trans("Save").'"> &nbsp; &nbsp; <input type="submit" class="button" name="cancel" value="'.$langs->trans("Cancel").'"></div>';
print "</form>\n";
}
/* ************************************************************ */
/* */
/* Fiche don en mode edition */
/* */
/* ************************************************************ */
if (! empty($id) && $action == 'edit')
{
$don->fetch($id);
$h=0;
$head[$h][0] = $_SERVER['PHP_SELF']."?id=".$don->id;
$head[$h][1] = $langs->trans("Card");
$hselected=$h;
$h++;
dol_fiche_head($head, $hselected, $langs->trans("Donation"), 0, 'generic');
print '<form name="update" action="card.php" method="post">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<table class="border" width="100%">';
print '<input type="hidden" name="action" value="update">';
print '<input type="hidden" name="rowid" value="'.$don->id.'">';
// Ref
print "<tr>".'<td>'.$langs->trans("Ref").'</td><td colspan="2">';
print $don->getNomUrl();
print '</td>';
print '</tr>';
$nbrows=12;
if (! empty($conf->projet->enabled)) $nbrows++;
// Date
print "<tr>".'<td width="25%" class="fieldrequired">'.$langs->trans("Date").'</td><td>';
$form->select_date($don->date,'','','','',"update");
print '</td>';
print '<td rowspan="'.$nbrows.'" valign="top">'.$langs->trans("Comments").' :<br>';
print "<textarea name=\"note_private\" wrap=\"soft\" cols=\"40\" rows=\"15\">".$don->note_private."</textarea></td>";
print "</tr>";
// Amount
print "<tr>".'<td class="fieldrequired">'.$langs->trans("Amount").'</td><td><input type="text" name="amount" size="10" value="'.$don->amount.'"> '.$langs->trans("Currency".$conf->currency).'</td></tr>';
print '<tr><td class="fieldrequired">'.$langs->trans("PublicDonation")."</td><td>";
print $form->selectyesno("public",1,1);
print "</td>";
print "</tr>\n";
$langs->load("companies");
print "<tr>".'<td>'.$langs->trans("Company").'</td><td><input type="text" name="societe" size="40" value="'.$don->societe.'"></td></tr>';
print "<tr>".'<td>'.$langs->trans("Firstname").'</td><td><input type="text" name="firstname" size="40" value="'.$don->firstname.'"></td></tr>';
print "<tr>".'<td>'.$langs->trans("Lastname").'</td><td><input type="text" name="lastname" size="40" value="'.$don->lastname.'"></td></tr>';
print "<tr>".'<td>'.$langs->trans("Address").'</td><td>';
print '<textarea name="address" wrap="soft" cols="40" rows="'.ROWS_3.'">'.$don->address.'</textarea></td></tr>';
// Zip / Town
print '<tr><td>'.$langs->trans("Zip").' / '.$langs->trans("Town").'</td><td>';
print $formcompany->select_ziptown((isset($_POST["zipcode"])?$_POST["zipcode"]:$don->zip),'zipcode',array('town','selectcountry_id','state_id'),6);
print ' ';
print $formcompany->select_ziptown((isset($_POST["town"])?$_POST["town"]:$don->town),'town',array('zipcode','selectcountry_id','state_id'));
print '</tr>';
print "<tr>".'<td>'.$langs->trans("Country").'</td><td><input type="text" name="country" size="40" value="'.$don->country.'"></td></tr>';
print "<tr>".'<td>'.$langs->trans("EMail").'</td><td><input type="text" name="email" size="40" value="'.$don->email.'"></td></tr>';
print "<tr><td>".$langs->trans("PaymentMode")."</td><td>\n";
if ($don->modepaiementid) $selected = $don->modepaiementid;
else $selected = '';
$form->select_types_paiements($selected, 'modepaiement', 'CRDT', 0, 1);
print "</td></tr>\n";
print "<tr>".'<td>'.$langs->trans("Status").'</td><td>'.$don->getLibStatut(4).'</td></tr>';
// Project
if (! empty($conf->projet->enabled))
{
$formproject=new FormProjets($db);
$langs->load('projects');
print '<tr><td>'.$langs->trans('Project').'</td><td>';
$formproject->select_projects(-1, (isset($_POST["projectid"])?$_POST["projectid"]:$don->fk_project), 'projectid');
print '</td></tr>';
}
// Other attributes
$parameters=array('colspan' => ' colspan="1"');
$reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$don,$action); // Note that $action and $object may have been modified by hook
print "</table>\n";
print '<br><div class="center"><input type="submit" class="button" name="save" value="'.$langs->trans("Save").'"> &nbsp; &nbsp; <input type="submit" class="button" name="cancel" value="'.$langs->trans("Cancel").'"></div>';
print "</form>\n";
print "</div>\n";
}
/* ************************************************************ */
/* */
/* Fiche don en mode visu */
/* */
/* ************************************************************ */
if (! empty($id) && $action != 'edit')
{
$result=$don->fetch($id);
$h=0;
$head[$h][0] = $_SERVER['PHP_SELF']."?id=".$don->id;
$head[$h][1] = $langs->trans("Card");
$hselected=$h;
$h++;
dol_fiche_head($head, $hselected, $langs->trans("Donation"), 0, 'generic');
print "<form action=\"card.php\" method=\"post\">";
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<table class="border" width="100%">';
$linkback = '<a href="'.DOL_URL_ROOT.'/compta/dons/list.php'.(! empty($socid)?'?socid='.$socid:'').'">'.$langs->trans("BackToList").'</a>';
$nbrows=12;
if (! empty($conf->projet->enabled)) $nbrows++;
// Ref
print "<tr>".'<td>'.$langs->trans("Ref").'</td><td colspan="2">';
print $form->showrefnav($don, 'rowid', $linkback, 1, 'rowid', 'ref', '');
print '</td>';
print '</tr>';
// Date
print '<tr><td width="25%">'.$langs->trans("Date").'</td><td>';
print dol_print_date($don->date,"day");
print "</td>";
print '<td rowspan="'.$nbrows.'" valign="top" width="50%">'.$langs->trans("Comments").' :<br>';
print nl2br($don->note_private).'</td></tr>';
print "<tr>".'<td>'.$langs->trans("Amount").'</td><td>'.price($don->amount,0,$langs,0,0,-1,$conf->currency).'</td></tr>';
print "<tr><td>".$langs->trans("PublicDonation")."</td><td>";
print yn($don->public);
print "</td></tr>\n";
print "<tr>".'<td>'.$langs->trans("Company").'</td><td>'.$don->societe.'</td></tr>';
print "<tr>".'<td>'.$langs->trans("Firstname").'</td><td>'.$don->firstname.'</td></tr>';
print "<tr>".'<td>'.$langs->trans("Lastname").'</td><td>'.$don->lastname.'</td></tr>';
print "<tr>".'<td>'.$langs->trans("Address").'</td><td>'.dol_nl2br($don->address).'</td></tr>';
// Zip / Town
print "<tr>".'<td>'.$langs->trans("Zip").' / '.$langs->trans("Town").'</td><td>'.$don->zip.($don->zip && $don->town?' / ':'').$don->town.'</td></tr>';
// Country
print "<tr>".'<td>'.$langs->trans("Country").'</td><td>'.$don->country.'</td></tr>';
// EMail
print "<tr>".'<td>'.$langs->trans("EMail").'</td><td>'.dol_print_email($don->email).'</td></tr>';
// Payment mode
print "<tr><td>".$langs->trans("PaymentMode")."</td><td>";
$form->form_modes_reglement(null, $don->modepaiementid,'none');
print "</td></tr>\n";
print "<tr>".'<td>'.$langs->trans("Status").'</td><td>'.$don->getLibStatut(4).'</td></tr>';
// Project
if (! empty($conf->projet->enabled))
{
print "<tr>".'<td>'.$langs->trans("Project").'</td><td>'.$don->projet.'</td></tr>';
}
// Other attributes
$parameters=array('colspan' => ' colspan="1"');
$reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$don,$action); // Note that $action and $object may have been modified by hook
print "</table>\n";
print "</form>\n";
print "</div>";
// TODO Gerer action emettre paiement
$resteapayer = 0;
/**
* Barre d'actions
*/
print '<div class="tabsAction">';
print '<div class="inline-block divButAction"><a class="butAction" href="card.php?action=edit&rowid='.$don->id.'">'.$langs->trans('Modify').'</a></div>';
if ($don->statut == 0)
{
print '<div class="inline-block divButAction"><a class="butAction" href="card.php?rowid='.$don->id.'&action=valid_promesse">'.$langs->trans("ValidPromess").'</a></div>';
}
if (($don->statut == 0 || $don->statut == 1) && $resteapayer == 0 && $don->paye == 0)
{
print '<div class="inline-block divButAction"><a class="butAction" href="card.php?rowid='.$don->id.'&action=set_cancel">'.$langs->trans("ClassifyCanceled")."</a></div>";
}
// TODO Gerer action emettre paiement
if ($don->statut == 1 && $resteapayer > 0)
{
print '<div class="inline-block divButAction"><a class="butAction" href="paiement.php?rowid='.$don->id.'&action=create">'.$langs->trans("DoPayment")."</a></div>";
}
if ($don->statut == 1 && $resteapayer == 0 && $don->paye == 0)
{
print '<div class="inline-block divButAction"><a class="butAction" href="card.php?rowid='.$don->id.'&action=set_paid">'.$langs->trans("ClassifyPaid")."</a></div>";
}
if ($user->rights->don->supprimer)
{
print '<div class="inline-block divButAction"><a class="butActionDelete" href="card.php?rowid='.$don->id.'&action=delete">'.$langs->trans("Delete")."</a></div>";
}
else
{
print '<div class="inline-block divButAction"><a class="butActionRefused" href="#">'.$langs->trans("Delete")."</a></div>";
}
print "</div>";
print '<table width="100%"><tr><td width="50%" valign="top">';
/*
* Documents generes
*/
$filename=dol_sanitizeFileName($don->id);
$filedir=$conf->don->dir_output . '/' . get_exdir($filename,2);
$urlsource=$_SERVER['PHP_SELF'].'?rowid='.$don->id;
// $genallowed=($fac->statut == 1 && ($fac->paye == 0 || $user->admin) && $user->rights->facture->creer);
// $delallowed=$user->rights->facture->supprimer;
$genallowed=1;
$delallowed=0;
$var=true;
print '<br>';
$formfile->show_documents('donation',$filename,$filedir,$urlsource,$genallowed,$delallowed);
print '</td><td>&nbsp;</td>';
print '</tr></table>';
}
llxFooter();
$db->close();

View File

@ -1,84 +0,0 @@
<?php
/* Copyright (C) 2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-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/compta/dons/stats.php
* \ingroup don
* \brief Page des statistiques de dons
*/
require '../../main.inc.php';
$langs->load("donations");
if (!$user->rights->don->lire) accessforbidden();
/*
* View
*/
llxHeader('',$langs->trans("Donations"),'EN:Module_Donations|FR:Module_Dons|ES:M&oacute;dulo_Donaciones');
print_fiche_titre($langs->trans("Statistics"));
$sql = "SELECT d.amount";
$sql .= " FROM ".MAIN_DB_PREFIX."don as d LEFT JOIN ".MAIN_DB_PREFIX."projet as p";
$sql .= " ON p.rowid = d.fk_don_projet";
$result = $db->query($sql);
if ($result)
{
$num = $db->num_rows($result);
$var=true;
$i=0;
$total=0;
while ($i < $num)
{
$objp = $db->fetch_object($result);
$total += $objp->amount;
$i++;
}
print '<table class="noborder" width="50%">';
print '<tr class="liste_titre"><td>'.$langs->trans("Parameter").'</td><td align="right">'.$langs->trans("Value").'</td></tr>';
$var=!$var;
print "<tr ".$bc[$var].">";
print '<td>'.$langs->trans("DonationsNumber").'</td><td align="right">'.$num.'</td></tr>';
$var=!$var;
print "<tr ".$bc[$var].">".'<td>'.$langs->trans("AmountTotal").'</td><td align="right">'.price($total).'</td>';
$var=!$var;
print "<tr ".$bc[$var].">".'<td>'.$langs->trans("Average").'</td><td align="right">'.price($total / ($num?$num:1)).'</td>';
print "</tr>";
print "</table>";
}
else
{
dol_print_error($db);
}
llxFooter();
$db->close();

View File

@ -324,7 +324,7 @@ if (empty($reshook))
{
$result = $object->setIncoterms(GETPOST('incoterm_id', 'int'), GETPOST('location_incoterms', 'alpha'));
}
// bank account
else if ($action == 'setbankaccount' && $user->rights->facture->creer)
{
@ -2289,7 +2289,7 @@ if ($action == 'create')
print $form->select_incoterms((!empty($objectsrc->fk_incoterms) ? $objectsrc->fk_incoterms : ''), (!empty($objectsrc->location_incoterms)?$objectsrc->location_incoterms:''));
print '</td></tr>';
}
// Other attributes
$parameters = array('objectsrc' => $objectsrc,'colspan' => ' colspan="3"');
$reshook = $hookmanager->executeHooks('formObjectOptions', $parameters, $object, $action); // Note that $action and $object may have been modified by
@ -2587,7 +2587,7 @@ if ($action == 'create')
require_once DOL_DOCUMENT_ROOT . '/core/class/notify.class.php';
$notify = new Notify($db);
$text .= '<br>';
$text .= $notify->confirmMessage('BILL_VALIDATE', $object->socid);
$text .= $notify->confirmMessage('BILL_VALIDATE', $object->socid, $object);
}
$formquestion = array();
@ -2749,8 +2749,9 @@ if ($action == 'create')
if (! $formconfirm) {
$parameters = array('lineid' => $lineid);
$formconfirm = $hookmanager->executeHooks('formConfirm', $parameters, $object, $action); // Note that $action and $object may have been modified by
// hook
$reshook = $hookmanager->executeHooks('formConfirm', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
if (empty($reshook)) $formconfirm.=$hookmanager->resPrint;
elseif ($reshook > 0) $formconfirm=$hookmanager->resPrint;
}
// Print form confirm
@ -3389,10 +3390,10 @@ if ($action == 'create')
print '</td>';
print '</tr>';
}
// Incoterms
if (!empty($conf->incoterm->enabled))
{
{
print '<tr><td>';
print '<table width="100%" class="nobordernopadding"><tr><td>';
print $langs->trans('IncotermLabel');
@ -3406,7 +3407,7 @@ if ($action == 'create')
{
print $form->textwithpicto($object->display_incoterms(), $object->libelle_incoterms, 1);
}
else
else
{
print $form->select_incoterms((!empty($object->fk_incoterms) ? $object->fk_incoterms : ''), (!empty($object->location_incoterms)?$object->location_incoterms:''), $_SERVER['PHP_SELF'].'?id='.$object->id);
}

View File

@ -547,9 +547,9 @@ class FactureRec extends Facture
}
/**
* Renvoie nom clicable (avec eventuellement le picto)
* Return clicable name (with picto eventually)
*
* @param int $withpicto 0=Pas de picto, 1=Inclut le picto dans le lien, 2=Picto seul
* @param int $withpicto 0=No picto, 1=Include picto into link, 2=Only picto
* @param string $option Sur quoi pointe le lien ('', 'withdraw')
* @return string Chaine avec URL
*/
@ -560,15 +560,15 @@ class FactureRec extends Facture
$result='';
$label=$langs->trans("ShowInvoice").': '.$this->ref;
$lien = '<a href="'.DOL_URL_ROOT.'/compta/facture/fiche-rec.php?facid='.$this->id.'" title="'.dol_escape_htmltag($label, 1).'" class="classfortooltip">';
$lienfin='</a>';
$link = '<a href="'.DOL_URL_ROOT.'/compta/facture/fiche-rec.php?facid='.$this->id.'" title="'.dol_escape_htmltag($label, 1).'" class="classfortooltip">';
$linkend='</a>';
$picto='bill';
if ($withpicto) $result.=($lien.img_object($label, $picto, 'class="classfortooltip"').$lienfin);
if ($withpicto) $result.=($link.img_object($label, $picto, 'class="classfortooltip"').$linkend);
if ($withpicto && $withpicto != 2) $result.=' ';
if ($withpicto != 2) $result.=$lien.$this->ref.$lienfin;
if ($withpicto != 2) $result.=$link.$this->ref.$linkend;
return $result;
}

View File

@ -3606,16 +3606,12 @@ class Facture extends CommonInvoice
*/
class FactureLigne extends CommonInvoiceLine
{
var $db;
var $error;
public $element='facturedet';
public $table_element='facturedet';
var $oldline;
//! From llx_facturedet
var $rowid;
//! Id facture
var $fk_facture;
//! Id parent line
@ -3623,17 +3619,9 @@ class FactureLigne extends CommonInvoiceLine
var $label; // deprecated
//! Description ligne
var $desc;
var $fk_product; // Id of predefined product
var $product_type = 0; // Type 0 = product, 1 = Service
var $qty; // Quantity (example 2)
var $tva_tx; // Taux tva produit/service (example 19.6)
var $localtax1_tx; // Local tax 1
var $localtax2_tx; // Local tax 2
var $localtax1_type; // Local tax 1 type
var $localtax2_type; // Local tax 2 type
var $subprice; // P.U. HT (example 100)
var $remise_percent; // % de la remise ligne (example 20%)
var $fk_remise_except; // Link to line into llx_remise_except
var $rang = 0;
@ -3642,10 +3630,6 @@ class FactureLigne extends CommonInvoiceLine
var $marge_tx;
var $marque_tx;
var $info_bits = 0; // Liste d'options cumulables:
// Bit 0: 0 si TVA normal - 1 si TVA NPR
// Bit 1: 0 si ligne normal - 1 si bit discount (link to line into llx_remise_except)
var $special_code; // Liste d'options non cumulabels:
// 1: frais de port
// 2: ecotaxe
@ -3654,15 +3638,6 @@ class FactureLigne extends CommonInvoiceLine
var $origin;
var $origin_id;
//! Total HT de la ligne toute quantite et incluant la remise ligne
var $total_ht;
//! Total TVA de la ligne toute quantite et incluant la remise ligne
var $total_tva;
var $total_localtax1; //Total Local tax 1 de la ligne
var $total_localtax2; //Total Local tax 2 de la ligne
//! Total TTC de la ligne toute quantite et incluant la remise ligne
var $total_ttc;
var $fk_code_ventilation = 0;
var $date_start;
@ -3691,16 +3666,6 @@ class FactureLigne extends CommonInvoiceLine
*/
public $fk_prev_id;
/**
* Constructor
*
* @param DoliDB $db Database handler
*/
function __construct($db)
{
$this->db = $db;
}
/**
* Load invoice line from database
*

View File

@ -127,7 +127,7 @@ if (! empty($conf->fournisseur->enabled) && $user->rights->fournisseur->lire)
if (! empty($conf->don->enabled) && $user->rights->don->lire)
{
$langs->load("donations");
print '<form method="post" action="'.DOL_URL_ROOT.'/compta/dons/list.php">';
print '<form method="post" action="'.DOL_URL_ROOT.'/don/list.php">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<table class="noborder nohover" width="100%">';
print '<tr class="liste_titre"><td colspan="3">'.$langs->trans("SearchADonation").'</td></tr>';
@ -497,7 +497,7 @@ if (! empty($conf->fournisseur->enabled) && $user->rights->fournisseur->facture-
// Last donations
if (! empty($conf->don->enabled) && $user->rights->societe->lire)
{
include_once DOL_DOCUMENT_ROOT.'/compta/dons/class/don.class.php';
include_once DOL_DOCUMENT_ROOT.'/don/class/don.class.php';
$langs->load("boxes");
$donationstatic=new Don($db);

View File

@ -582,14 +582,14 @@ class Localtax extends CommonObject
$result='';
$label=$langs->trans("ShowVatPayment").': '.$this->ref;
$lien = '<a href="'.DOL_URL_ROOT.'/compta/localtax/card.php?id='.$this->id.'" title="'.dol_escape_htmltag($label, 1).'" class="classfortooltip">';
$lienfin='</a>';
$link = '<a href="'.DOL_URL_ROOT.'/compta/localtax/card.php?id='.$this->id.'" title="'.dol_escape_htmltag($label, 1).'" class="classfortooltip">';
$linkend='</a>';
$picto='payment';
if ($withpicto) $result.=($lien.img_object($label, $picto, 'class="classfortooltip"').$lienfin);
if ($withpicto) $result.=($link.img_object($label, $picto, 'class="classfortooltip"').$linkend);
if ($withpicto && $withpicto != 2) $result.=' ';
if ($withpicto != 2) $result.=$lien.$this->ref.$lienfin;
if ($withpicto != 2) $result.=$link.$this->ref.$linkend;
return $result;
}

View File

@ -768,9 +768,9 @@ class RemiseCheque extends CommonObject
}
/**
* Renvoie nom clicable (avec eventuellement le picto)
* Return clicable name (with picto eventually)
*
* @param int $withpicto 0=Pas de picto, 1=Inclut le picto dans le lien, 2=Picto seul
* @param int $withpicto 0=No picto, 1=Include picto into link, 2=Only picto
* @param string $option Sur quoi pointe le lien
* @return string Chaine avec URL
*/
@ -781,12 +781,12 @@ class RemiseCheque extends CommonObject
$result='';
$label = $langs->trans("ShowCheckReceipt").': '.$this->ref;
$lien = '<a href="'.DOL_URL_ROOT.'/compta/paiement/cheque/card.php?id='.$this->id.'" title="'.dol_escape_htmltag($label, 1).'" class="classfortooltip">';
$lienfin='</a>';
$link = '<a href="'.DOL_URL_ROOT.'/compta/paiement/cheque/card.php?id='.$this->id.'" title="'.dol_escape_htmltag($label, 1).'" class="classfortooltip">';
$linkend='</a>';
if ($withpicto) $result.=($lien.img_object($label, 'payment', 'class="classfortooltip"').$lienfin);
if ($withpicto) $result.=($link.img_object($label, 'payment', 'class="classfortooltip"').$linkend);
if ($withpicto && $withpicto != 2) $result.=' ';
if ($withpicto != 2) $result.=$lien.$this->ref.$lienfin;
if ($withpicto != 2) $result.=$link.$this->ref.$linkend;
return $result;
}

View File

@ -737,9 +737,9 @@ class Paiement extends CommonObject
/**
* Renvoie nom clicable (avec eventuellement le picto)
* Return clicable name (with picto eventually)
*
* @param int $withpicto 0=Pas de picto, 1=Inclut le picto dans le lien, 2=Picto seul
* @param int $withpicto 0=No picto, 1=Include picto into link, 2=Only picto
* @param string $option Sur quoi pointe le lien
* @return string Chaine avec URL
*/
@ -750,12 +750,12 @@ class Paiement extends CommonObject
$result='';
$label = $langs->trans("ShowPayment").': '.$this->ref;
$lien = '<a href="'.DOL_URL_ROOT.'/compta/paiement/card.php?id='.$this->id.'" title="'.dol_escape_htmltag($label, 1).'" class="classfortooltip">';
$lienfin='</a>';
$link = '<a href="'.DOL_URL_ROOT.'/compta/paiement/card.php?id='.$this->id.'" title="'.dol_escape_htmltag($label, 1).'" class="classfortooltip">';
$linkend='</a>';
if ($withpicto) $result.=($lien.img_object($langs->trans("ShowPayment"), 'payment', 'class="classfortooltip"').$lienfin);
if ($withpicto) $result.=($link.img_object($langs->trans("ShowPayment"), 'payment', 'class="classfortooltip"').$linkend);
if ($withpicto && $withpicto != 2) $result.=' ';
if ($withpicto != 2) $result.=$lien.$this->ref.$lienfin;
if ($withpicto != 2) $result.=$link.$this->ref.$linkend;
return $result;
}

View File

@ -178,7 +178,7 @@ if ($_GET["action"] == 'create')
print '<table cellspacing="0" class="border" width="100%" cellpadding="2">';
print "<tr class=\"liste_titre\"><td colspan=\"3\">Charge</td>";
print "<tr class=\"liste_titre\"><td colspan=\"3\">".$langs->trans("SocialContribution")."</td>";
print '<tr><td>'.$langs->trans("Ref").'</td><td colspan="2"><a href="'.DOL_URL_ROOT.'/compta/sociales/charges.php?id='.$chid.'">'.$chid.'</a></td></tr>';
print '<tr><td>'.$langs->trans("Type")."</td><td colspan=\"2\">".$charge->type_libelle."</td></tr>\n";

View File

@ -1113,17 +1113,17 @@ class BonPrelevement extends CommonObject
$result='';
$label = $langs->trans("ShowWithdraw").': '.$this->ref;
$lien = '<a href="'.DOL_URL_ROOT.'/compta/prelevement/card.php?id='.$this->id.'" title="'.dol_escape_htmltag($label, 1).'" class="classfortooltip">';
$lienfin='</a>';
$link = '<a href="'.DOL_URL_ROOT.'/compta/prelevement/card.php?id='.$this->id.'" title="'.dol_escape_htmltag($label, 1).'" class="classfortooltip">';
$linkend='</a>';
if ($option == 'xxx')
{
$lien = '<a href="'.DOL_URL_ROOT.'/compta/prelevement/card.php?id='.$this->id.'" title="'.dol_escape_htmltag($label, 1).'" class="classfortooltip">';
$lienfin='</a>';
$link = '<a href="'.DOL_URL_ROOT.'/compta/prelevement/card.php?id='.$this->id.'" title="'.dol_escape_htmltag($label, 1).'" class="classfortooltip">';
$linkend='</a>';
}
if ($withpicto) $result.=($lien.img_object($label, 'payment', 'class="classfortooltip"').$lienfin.' ');
$result.=$lien.$this->ref.$lienfin;
if ($withpicto) $result.=($link.img_object($label, 'payment', 'class="classfortooltip"').$linkend.' ');
$result.=$link.$this->ref.$linkend;
return $result;
}

View File

@ -127,7 +127,7 @@ if ($result)
print '<td class="liste_titre">&nbsp;</td>';
print '</tr>';
print '<form action="list.php" method="GET">';
print '<form action="'.$_SERVER["PHP_SELF"].'" method="GET">';
print '<tr class="liste_titre">';
print '<td class="liste_titre"><input type="text" class="flat" name="search_line" value="'. dol_escape_htmltag($search_line).'" size="6"></td>';
print '<td class="liste_titre"><input type="text" class="flat" name="search_bon" value="'. dol_escape_htmltag($search_bon).'" size="8"></td>';

View File

@ -651,7 +651,7 @@ if ($conf->donation->enabled)
$var = !$var;
print "<tr ".$bc[$var]."><td>&nbsp;</td>";
print "<td>".$langs->trans("Donation")." <a href=\"".DOL_URL_ROOT."/compta/dons/list.php?search_company=".$obj->name."&search_name=".$obj->firstname." ".$obj->lastname."\">".$obj->name. " ".$obj->firstname." ".$obj->lastname."</a></td>\n";
print "<td>".$langs->trans("Donation")." <a href=\"".DOL_URL_ROOT."/don/list.php?search_company=".$obj->name."&search_name=".$obj->firstname." ".$obj->lastname."\">".$obj->name. " ".$obj->firstname." ".$obj->lastname."</a></td>\n";
if ($modecompta == 'CREANCES-DETTES') print '<td align="right">'.price($obj->amount).'</td>';
print '<td align="right">'.price($obj->amount).'</td>';

View File

@ -211,7 +211,7 @@ if ($action == 'create')
$datesp=dol_get_first_day($pastmonthyear,$pastmonth,false); $dateep=dol_get_last_day($pastmonthyear,$pastmonth,false);
}
print "<form name='add' action=\"card.php\" method=\"post\">\n";
print '<form name="salary" action="'.$_SERVER["PHP_SELF"].'" method="post">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<input type="hidden" name="action" value="add">';

View File

@ -490,14 +490,14 @@ class PaymentSalary extends CommonObject
$result='';
$label=$langs->trans("ShowSalaryPayment").': '.$this->ref;
$lien = '<a href="'.DOL_URL_ROOT.'/compta/salaries/card.php?id='.$this->id.'" title="'.dol_escape_htmltag($label, 1).'" class="classfortooltip">';
$lienfin='</a>';
$link = '<a href="'.DOL_URL_ROOT.'/compta/salaries/card.php?id='.$this->id.'" title="'.dol_escape_htmltag($label, 1).'" class="classfortooltip">';
$linkend='</a>';
$picto='payment';
if ($withpicto) $result.=($lien.img_object($label, $picto, 'class="classfortooltip"').$lienfin);
if ($withpicto) $result.=($link.img_object($label, $picto, 'class="classfortooltip"').$linkend);
if ($withpicto && $withpicto != 2) $result.=' ';
if ($withpicto != 2) $result.=$lien.$this->ref.$lienfin;
if ($withpicto != 2) $result.=$link.$this->ref.$linkend;
return $result;
}

View File

@ -408,9 +408,9 @@ class ChargeSociales extends CommonObject
/**
* Renvoie nom clicable (avec eventuellement le picto)
* Return clicable name (with picto eventually)
*
* @param int $withpicto 0=Pas de picto, 1=Inclut le picto dans le lien, 2=Picto seul
* @param int $withpicto 0=No picto, 1=Include picto into link, 2=Only picto
* @param int $maxlen Longueur max libelle
* @return string Chaine avec URL
*/
@ -423,12 +423,12 @@ class ChargeSociales extends CommonObject
if (empty($this->ref)) $this->ref=$this->lib;
$label = $langs->trans("ShowSocialContribution").': '.$this->ref;
$lien = '<a href="'.DOL_URL_ROOT.'/compta/sociales/charges.php?id='.$this->id.'" title="'.dol_escape_htmltag($label, 1).'" class="classfortooltip">';
$lienfin='</a>';
$link = '<a href="'.DOL_URL_ROOT.'/compta/sociales/charges.php?id='.$this->id.'" title="'.dol_escape_htmltag($label, 1).'" class="classfortooltip">';
$linkend='</a>';
if ($withpicto) $result.=($lien.img_object($label, 'bill', 'class="classfortooltip"').$lienfin.' ');
if ($withpicto) $result.=($link.img_object($label, 'bill', 'class="classfortooltip"').$linkend.' ');
if ($withpicto && $withpicto != 2) $result.=' ';
if ($withpicto != 2) $result.=$lien.($maxlen?dol_trunc($this->ref,$maxlen):$this->ref).$lienfin;
if ($withpicto != 2) $result.=$link.($maxlen?dol_trunc($this->ref,$maxlen):$this->ref).$linkend;
return $result;
}

View File

@ -576,9 +576,9 @@ class PaymentSocialContribution extends CommonObject
}
/**
* Renvoie nom clicable (avec eventuellement le picto)
* Return clicable name (with picto eventually)
*
* @param int $withpicto 0=Pas de picto, 1=Inclut le picto dans le lien, 2=Picto seul
* @param int $withpicto 0=No picto, 1=Include picto into link, 2=Only picto
* @param int $maxlen Longueur max libelle
* @return string Chaine avec URL
*/
@ -593,12 +593,12 @@ class PaymentSocialContribution extends CommonObject
if (!empty($this->id))
{
$lien = '<a href="'.DOL_URL_ROOT.'/compta/payment_sc/card.php?id='.$this->id.'" title="'.dol_escape_htmltag($label, 1).'" class="classfortooltip">';
$lienfin='</a>';
$link = '<a href="'.DOL_URL_ROOT.'/compta/payment_sc/card.php?id='.$this->id.'" title="'.dol_escape_htmltag($label, 1).'" class="classfortooltip">';
$linkend='</a>';
if ($withpicto) $result.=($lien.img_object($label, 'payment', 'class="classfortooltip"').$lienfin.' ');
if ($withpicto) $result.=($link.img_object($label, 'payment', 'class="classfortooltip"').$linkend.' ');
if ($withpicto && $withpicto != 2) $result.=' ';
if ($withpicto != 2) $result.=$lien.($maxlen?dol_trunc($this->ref,$maxlen):$this->ref).$lienfin;
if ($withpicto != 2) $result.=$link.($maxlen?dol_trunc($this->ref,$maxlen):$this->ref).$linkend;
}
return $result;

View File

@ -640,14 +640,14 @@ class Tva extends CommonObject
$result='';
$label=$langs->trans("ShowVatPayment").': '.$this->ref;
$lien = '<a href="'.DOL_URL_ROOT.'/compta/tva/card.php?id='.$this->id.'" title="'.dol_escape_htmltag($label, 1).'" class="classfortooltip">';
$lienfin='</a>';
$link = '<a href="'.DOL_URL_ROOT.'/compta/tva/card.php?id='.$this->id.'" title="'.dol_escape_htmltag($label, 1).'" class="classfortooltip">';
$linkend='</a>';
$picto='payment';
if ($withpicto) $result.=($lien.img_object($label, $picto, 'class="classfortooltip"').$lienfin);
if ($withpicto) $result.=($link.img_object($label, $picto, 'class="classfortooltip"').$linkend);
if ($withpicto && $withpicto != 2) $result.=' ';
if ($withpicto != 2) $result.=$lien.$this->ref.$lienfin;
if ($withpicto != 2) $result.=$link.$this->ref.$linkend;
return $result;
}

View File

@ -315,12 +315,12 @@ $dolibarr_main_db_prefix='';
// multicompany_transverse_mode
// Prerequisite: Need external module "multicompany"
// Pyramidal (0): The rights and groups are managed in each entity,
// users belong to the entity for their rights.
// Transversal (1): The groups can belong only to the master entity
// and that the user belongs to a particular entity
// Pyramidal (0): The rights and groups are managed in each entity. Each user belongs to the entity he was created into.
// Transversal (1): The user is created and managed only into master entity but can login to all entities if he is admmin
// of entity or belongs to at least one user group created into entity.
// Default value: 0 (pyramidal)
// Examples:
// $multicompany_transverse_mode='1';
?>
?>

View File

@ -895,17 +895,17 @@ class Contact extends CommonObject
$label = '<u>' . $langs->trans("ShowContact") . '</u>';
$label.= '<br><b>' . $langs->trans("Name") . ':</b> '.$this->getFullName($langs);
$lien = '<a href="'.DOL_URL_ROOT.'/contact/card.php?id='.$this->id.$moreparam.'" title="'.dol_escape_htmltag($label, 1).'" class="classfortooltip">';
$lienfin='</a>';
$link = '<a href="'.DOL_URL_ROOT.'/contact/card.php?id='.$this->id.$moreparam.'" title="'.dol_escape_htmltag($label, 1).'" class="classfortooltip">';
$linkend='</a>';
if ($option == 'xxx')
{
$lien = '<a href="'.DOL_URL_ROOT.'/contact/card.php?id='.$this->id.$moreparam.'" title="'.dol_escape_htmltag($label, 1).'" class="classfortooltip">';
$lienfin='</a>';
$link = '<a href="'.DOL_URL_ROOT.'/contact/card.php?id='.$this->id.$moreparam.'" title="'.dol_escape_htmltag($label, 1).'" class="classfortooltip">';
$linkend='</a>';
}
if ($withpicto) $result.=($lien.img_object($label, 'contact', 'class="classfortooltip"').$lienfin.' ');
$result.=$lien.($maxlen?dol_trunc($this->getFullName($langs),$maxlen):$this->getFullName($langs)).$lienfin;
if ($withpicto) $result.=($link.img_object($label, 'contact', 'class="classfortooltip"').$linkend.' ');
$result.=$link.($maxlen?dol_trunc($this->getFullName($langs),$maxlen):$this->getFullName($langs)).$linkend;
return $result;
}

View File

@ -1053,7 +1053,7 @@ if ($action == 'create')
print "</table>\n";
print '<br><center><input type="submit" class="button" value="'.$langs->trans("Create").'"></center>';
print '<br><div align="center"><input type="submit" class="button" value="'.$langs->trans("Create").'"></div>';
if (is_object($objectsrc))
{

View File

@ -89,23 +89,7 @@ class Contrat extends CommonObject
var $product;
/**
* TODO: Which is the correct one?
* Author of the contract
* @var
*/
var $user_author;
/**
* TODO: Which is the correct one?
* Author of the contract
* @var User
*/
public $user_creation;
/**
* TODO: Which is the correct one?
* Author of the contract
* @var int
* @var int Id of user author of the contract
*/
public $fk_user_author;
@ -117,38 +101,37 @@ class Contrat extends CommonObject
public $user_author_id;
/**
* @var User
* @var User Object user that create the contract. Set by the info method.
*/
public $user_creation;
/**
* @var User Object user that close the contract. Set by the info method.
*/
public $user_cloture;
/**
* Date of creation
* @var int
* @var int Date of creation
*/
var $date_creation;
/**
* Date of last modification
* Not filled until you call ->info()
* @var int
* @var int Date of last modification. Not filled until you call ->info()
*/
public $date_modification;
/**
* Date of validation
* @var int
* @var int Date of validation
*/
var $date_validation;
/**
* Date when contract was signed
* @var int
* @var int Date when contract was signed
*/
var $date_contrat;
/**
* Date of contract closure
* @var int
* @var int Date of contract closure
* @deprecated we close contract lines, not a contract
*/
var $date_cloture;
@ -157,21 +140,15 @@ class Contrat extends CommonObject
var $commercial_suivi_id;
/**
* @deprecated Use note_private or note_public instead
*/
var $note;
/**
* Private note
* @var string
* @var string Private note
*/
var $note_private;
/**
* Public note
* @var string
* @var string Public note
*/
var $note_public;
var $modelpdf;
/**
@ -184,8 +161,7 @@ class Contrat extends CommonObject
var $extraparams=array();
/**
* Contract lines
* @var ContratLigne[]
* @var ContratLigne[] Contract lines
*/
var $lines=array();
@ -569,7 +545,6 @@ class Contrat extends CommonObject
$this->commercial_signature_id = $result["fk_commercial_signature"];
$this->commercial_suivi_id = $result["fk_commercial_suivi"];
$this->note = $result["note_private"]; // deprecated
$this->note_private = $result["note_private"];
$this->note_public = $result["note_public"];
$this->modelpdf = $result["model_pdf"];
@ -726,7 +701,7 @@ class Contrat extends CommonObject
// Retreive all extrafield for propal
// fetch optionals attributes and labels
$line->fetch_optionals($line->id,$extralabelsline);
$this->lines[] = $line;
//dol_syslog("1 ".$line->desc);
@ -822,13 +797,13 @@ class Contrat extends CommonObject
if ($line->statut == 4 && (! empty($line->date_fin_prevue) && $line->date_fin_prevue < $now)) $this->nbofservicesexpired++;
if ($line->statut == 5) $this->nbofservicesclosed++;
// Retreive all extrafield for propal
// fetch optionals attributes and labels
$line->fetch_optionals($line->id,$extralabelsline);
$this->lines[] = $line;
$total_ttc+=$objp->total_ttc;
@ -1742,9 +1717,9 @@ class Contrat extends CommonObject
/**
* Renvoie nom clicable (avec eventuellement le picto)
* Return clicable name (with picto eventually)
*
* @param int $withpicto 0=Pas de picto, 1=Inclut le picto dans le lien, 2=Picto seul
* @param int $withpicto 0=No picto, 1=Include picto into link, 2=Only picto
* @param int $maxlength Max length of ref
* @return string Chaine avec URL
*/
@ -1755,15 +1730,15 @@ class Contrat extends CommonObject
$result='';
$label=$langs->trans("ShowContract").': '.$this->ref;
$lien = '<a href="'.DOL_URL_ROOT.'/contrat/card.php?id='.$this->id.'" title="'.dol_escape_htmltag($label, 1).'" class="classfortooltip">';
$lienfin='</a>';
$link = '<a href="'.DOL_URL_ROOT.'/contrat/card.php?id='.$this->id.'" title="'.dol_escape_htmltag($label, 1).'" class="classfortooltip">';
$linkend='</a>';
$picto='contract';
if ($withpicto) $result.=($lien.img_object($label, $picto, 'class="classfortooltip"').$lienfin);
if ($withpicto) $result.=($link.img_object($label, $picto, 'class="classfortooltip"').$linkend);
if ($withpicto && $withpicto != 2) $result.=' ';
if ($withpicto != 2) $result.=$lien.($maxlength?dol_trunc($this->ref,$maxlength):$this->ref).$lienfin;
if ($withpicto != 2) $result.=$link.($maxlength?dol_trunc($this->ref,$maxlength):$this->ref).$linkend;
return $result;
}
@ -2290,9 +2265,9 @@ class ContratLigne extends CommonObject
}
/**
* Renvoie nom clicable (avec eventuellement le picto)
* Return clicable name (with picto eventually)
*
* @param int $withpicto 0=Pas de picto, 1=Inclut le picto dans le lien, 2=Picto seul
* @param int $withpicto 0=No picto, 1=Include picto into link, 2=Only picto
* @param int $maxlength Max length
* @return string Chaine avec URL
*/
@ -2303,15 +2278,15 @@ class ContratLigne extends CommonObject
$result='';
$label=$langs->trans("ShowContractOfService").': '.$this->label;
$lien = '<a href="'.DOL_URL_ROOT.'/contrat/card.php?id='.$this->fk_contrat.'" title="'.dol_escape_htmltag($label, 1).'" class="classfortooltip">';
$lienfin='</a>';
$link = '<a href="'.DOL_URL_ROOT.'/contrat/card.php?id='.$this->fk_contrat.'" title="'.dol_escape_htmltag($label, 1).'" class="classfortooltip">';
$linkend='</a>';
$picto='contract';
if ($withpicto) $result.=($lien.img_object($label, $picto, 'class="classfortooltip"').$lienfin);
if ($withpicto) $result.=($link.img_object($label, $picto, 'class="classfortooltip"').$linkend);
if ($withpicto && $withpicto != 2) $result.=' ';
if ($withpicto != 2) $result.=$lien.$this->label.$lienfin;
if ($withpicto != 2) $result.=$link.$this->label.$linkend;
return $result;
}

View File

@ -89,8 +89,11 @@ class box_activity extends ModeleBoxes
// compute the year limit to show
$tmpdate= dol_time_plus_duree(dol_now(), -1*$nbofyears, "y");
$cumuldata = array();
// list the summary of the bills
if (! empty($conf->facture->enabled) && $user->rights->facture->lire) {
if (! empty($conf->facture->enabled) && $user->rights->facture->lire)
{
include_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
$facturestatic=new Facture($db);
@ -130,9 +133,11 @@ class box_activity extends ModeleBoxes
} else {
$data = dol_readcachefile($cachedir, $filename);
}
$cumuldata=array_merge($cumuldata, $data);
if (! empty($data)) {
$j=0;
while ($line < count($data)) {
while ($line < count($cumuldata)) {
$billurl="viewstatut=2&amp;paye=1&amp;year=".$data[$j]->annee;
$this->info_box_contents[$line][0] = array(
'td' => 'align="left" width="16"',
@ -193,7 +198,7 @@ class box_activity extends ModeleBoxes
$result = $db->query($sql);
if ($result) {
$num = $db->num_rows($result) + $line;
$num = $db->num_rows($result);
$j=0;
while ($j < $num) {
$data[$j]=$db->fetch_object($result);
@ -209,10 +214,12 @@ class box_activity extends ModeleBoxes
} else {
$data = dol_readcachefile($cachedir, $filename);
}
$cumuldata=array_merge($cumuldata, $data);
if (! empty($data)) {
$j=0;
while ($line < count($data)) {
while ($line < count($cumuldata)) {
$billurl="viewstatut=".$data[$j]->fk_statut."&amp;paye=0";
$this->info_box_contents[$line][0] = array(
'td' => 'align="left" width="16"',
@ -233,7 +240,7 @@ class box_activity extends ModeleBoxes
'url' => DOL_URL_ROOT."/compta/facture/list.php?".$billurl."&amp;mainmenu=accountancy&amp;leftmenu=customers_bills",
);
$totalnb += $data[$j]->nb;
$this->info_box_contents[$line][3] = array(
$this->info_box_contents[$line][3] = array(
'td' => 'align="right"',
'text' => price($data[$j]->Mnttot,1,$langs,0,0,-1,$conf->currency),
);
@ -286,7 +293,7 @@ class box_activity extends ModeleBoxes
$result = $db->query($sql);
if ($result) {
$num = $db->num_rows($result) + $line;
$num = $db->num_rows($result);
$j=0;
while ($j < $num) {
$data[$j]=$db->fetch_object($result);
@ -302,9 +309,11 @@ class box_activity extends ModeleBoxes
} else {
$data = dol_readcachefile($cachedir, $filename);
}
$cumuldata=array_merge($cumuldata, $data);
if (! empty($data)) {
$j=0;
while ($line < count($data)) {
while ($line < count($cumuldata)) {
$this->info_box_contents[$line][0] = array(
'td' => 'align="left" width="16"',
'url' => DOL_URL_ROOT."/commande/list.php?mainmenu=commercial&amp;leftmenu=orders&amp;viewstatut=".$data[$j]->fk_statut,
@ -342,7 +351,8 @@ class box_activity extends ModeleBoxes
}
// list the summary of the propals
if (! empty($conf->propal->enabled) && $user->rights->propal->lire) {
if (! empty($conf->propal->enabled) && $user->rights->propal->lire)
{
include_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php';
$propalstatic=new Propal($db);
@ -350,7 +360,8 @@ class box_activity extends ModeleBoxes
$filename = '/boxactivity-propal'.$fileid;
$refresh = dol_cache_refresh($cachedir, $filename, $cachetime);
$data = array();
if ($refresh) {
if ($refresh)
{
$sql = "SELECT p.fk_statut, SUM(p.total) as Mnttot, COUNT(*) as nb";
$sql.= " FROM (".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."propal as p";
if (!$user->rights->societe->client->voir && !$user->societe_id) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
@ -365,9 +376,10 @@ class box_activity extends ModeleBoxes
$sql.= " ORDER BY p.fk_statut DESC";
$result = $db->query($sql);
if ($result)
{
$num = $db->num_rows($result);
if ($result) {
$num = $db->num_rows($result) + $line;
$j=0;
while ($j < $num) {
$data[$j]=$db->fetch_object($result);
@ -380,26 +392,31 @@ class box_activity extends ModeleBoxes
} else {
dol_print_error($db);
}
} else {
}
else
{
$data = dol_readcachefile($cachedir, $filename);
}
if (! empty($data)) {
$cumuldata=array_merge($cumuldata, $data);
if (! empty($data))
{
$j=0;
while ($line < count($data)) {
$this->info_box_contents[$line][] = array(
while ($line < count($cumuldata))
{
$this->info_box_contents[$line][0] = array(
'td' => 'align="left" width="16"',
'url' => DOL_URL_ROOT."/comm/propal/list.php?mainmenu=commercial&amp;leftmenu=propals&amp;viewstatut=".$data[$j]->fk_statut,
'tooltip' => $langs->trans("Proposals")."&nbsp;".$propalstatic->LibStatut($data[$j]->fk_statut,0),
'logo' => 'object_propal'
);
$objp = $db->fetch_object($result);
$this->info_box_contents[$line][] = array(
$this->info_box_contents[$line][1] = array(
'td' => 'align="left"',
'text' => $langs->trans("Proposals")."&nbsp;".$propalstatic->LibStatut($data[$j]->fk_statut,0),
);
$this->info_box_contents[$line][] = array(
$this->info_box_contents[$line][2] = array(
'td' => 'align="right"',
'text' => $data[$j]->nb,
'tooltip' => $langs->trans("Proposals")."&nbsp;".$propalstatic->LibStatut($data[$j]->fk_statut,0),
@ -407,12 +424,12 @@ class box_activity extends ModeleBoxes
);
$totalnb += $data[$j]->nb;
$this->info_box_contents[$line][] = array(
$this->info_box_contents[$line][3] = array(
'td' => 'align="right"',
'text' => price($data[$j]->Mnttot,1,$langs,0,0,-1,$conf->currency),
);
$totalMnt += $data[$j]->Mnttot;
$this->info_box_contents[$line][] = array(
$this->info_box_contents[$line][4] = array(
'td' => 'align="right" width="18"',
'text' => $propalstatic->LibStatut($data[$j]->fk_statut,3),
);
@ -423,38 +440,24 @@ class box_activity extends ModeleBoxes
}
}
// Add the sum in the bottom of the boxes
$this->info_box_contents[$line][1] = array(
'td' => 'align="left" ',
'text' => $langs->trans("Total")."&nbsp;".$textHead,
);
$this->info_box_contents[$line][2] = array(
'td' => 'align="right" ',
'text' => $totalnb,
);
$this->info_box_contents[$line][3] = array(
'td' => 'align="right" ',
'text' => price($totalMnt,1,$langs,0,0,-1,$conf->currency)
);
$this->info_box_contents[$line][4] = array(
'td' => 'align="right" ',
'text' => "",
);
$this->info_box_contents[$line][5] = array(
'td' => 'align="right"',
'text' => "",
);
// Add the sum in the bottom of the boxes
$this->info_box_contents[$line][0] = array('tr' => 'class="liste_total"');
$this->info_box_contents[$line][1] = array('td' => 'align="left" class="liste_total" ', 'text' => $langs->trans("Total")."&nbsp;".$textHead);
$this->info_box_contents[$line][2] = array('td' => 'align="right" class="liste_total" ', 'text' => $totalnb);
$this->info_box_contents[$line][3] = array('td' => 'align="right" class="liste_total" ', 'text' => '');
$this->info_box_contents[$line][4] = array('td' => 'align="right" class="liste_total" ', 'text' => "");
}
/**
* Method to show box
*
* @param array $head Array with properties of box title
* @param array $contents Array with properties of box lines
* @return void
*/
function showBox($head = null, $contents = null)
{
parent::showBox($this->info_box_head, $this->info_box_contents);
}
/**
* Method to show box
*
* @param array $head Array with properties of box title
* @param array $contents Array with properties of box lines
* @return void
*/
function showBox($head = null, $contents = null)
{
parent::showBox($this->info_box_head, $this->info_box_contents);
}
}

View File

@ -62,7 +62,7 @@ class box_contacts extends ModeleBoxes
if ($user->rights->societe->lire)
{
$sql = "SELECT sp.rowid, sp.lastname, sp.firstname, sp.civility as civility_id, sp.datec, sp.tms, sp.fk_soc";
$sql = "SELECT sp.rowid as id, sp.lastname, sp.firstname, sp.civility as civility_id, sp.datec, sp.tms, sp.fk_soc";
$sql.= ", s.nom as socname";
$sql.= ", s.code_client";
$sql.= " FROM ".MAIN_DB_PREFIX."socpeople as sp";
@ -87,7 +87,8 @@ class box_contacts extends ModeleBoxes
$datec=$db->jdate($objp->datec);
$datem=$db->jdate($objp->tms);
$contactstatic->lastname=$objp->lastname;
$contactstatic->id=$objp->id;
$contactstatic->lastname=$objp->lastname;
$contactstatic->firstname=$objp->firstname;
$contactstatic->civility_id=$objp->civility_id;

View File

@ -85,8 +85,8 @@ class CMailFile
* CMailFile
*
* @param string $subject Topic/Subject of mail
* @param string $to Recipients emails (RFC 2822: "Nom firstname <email>[, ...]" ou "email[, ...]" ou "<email>[, ...]")
* @param string $from Sender email (RFC 2822: "Nom firstname <email>[, ...]" ou "email[, ...]" ou "<email>[, ...]")
* @param string $to Recipients emails (RFC 2822: "Name firstname <email>[, ...]" or "email[, ...]" or "<email>[, ...]"). Note: the keyword '__SUPERVISOREMAIL__' is not allowed here and must be replaced by caller.
* @param string $from Sender email (RFC 2822: "Name firstname <email>[, ...]" or "email[, ...]" or "<email>[, ...]")
* @param string $msg Message
* @param array $filename_list List of files to attach (full path of filename on file system)
* @param array $mimetype_list List of MIME type of attached files
@ -98,9 +98,7 @@ class CMailFile
* @param string $errors_to Email errors
* @param string $css Css option
*/
function __construct($subject,$to,$from,$msg,
$filename_list=array(),$mimetype_list=array(),$mimefilename_list=array(),
$addr_cc="",$addr_bcc="",$deliveryreceipt=0,$msgishtml=0,$errors_to='',$css='')
function __construct($subject,$to,$from,$msg,$filename_list=array(),$mimetype_list=array(),$mimefilename_list=array(),$addr_cc="",$addr_bcc="",$deliveryreceipt=0,$msgishtml=0,$errors_to='',$css='')
{
global $conf;
@ -1023,9 +1021,9 @@ class CMailFile
}
/**
* Return an address for SMTP protocol
* Return a formatted address string for SMTP protocol
*
* @param string $address Example: 'John Doe <john@doe.com>' or 'john@doe.com'
* @param string $address Example: 'John Doe <john@doe.com>, Alan Smith <alan@smith.com>' or 'john@doe.com, alan@smith.com'
* @param int $format 0=auto, 1=emails with <>, 2=emails without <>, 3=auto + label between "
* @param int $encode 1=Encode name to RFC2822
* @return string If format 0: '<john@doe.com>' or 'John Doe <john@doe.com>' or '=?UTF-8?B?Sm9obiBEb2U=?= <john@doe.com>'

View File

@ -400,5 +400,100 @@ require_once DOL_DOCUMENT_ROOT .'/core/class/commonobjectline.class.php';
*/
abstract class CommonInvoiceLine extends CommonObjectLine
{
/**
* Quantity
* @var int
*/
public $qty;
/**
* Unit price before taxes
* @var float
*/
public $subprice;
/**
* Type of the product. 0 for product 1 for service
* @var int
*/
public $product_type = 0;
/**
* Id of corresponding product
* @var int
*/
public $fk_product;
/**
* VAT %
* @var float
*/
public $tva_tx;
/**
* Local tax 1 %
* @var float
*/
public $localtax1_tx;
/**
* Local tax 2 %
* @var float
*/
public $localtax2_tx;
/**
* Percent of discount
* @var float
*/
public $remise_percent;
/**
* Total amount before taxes
* @var float
*/
public $total_ht;
/**
* Total VAT amount
* @var float
*/
public $total_tva;
/**
* Total local tax 1 amount
* @var float
*/
public $total_localtax1;
/**
* Total local tax 2 amount
* @var float
*/
public $total_localtax2;
/**
* Total amount with taxes
* @var float
*/
public $total_ttc;
/**
* Liste d'options cumulables:
* Bit 0: 0 si TVA normal - 1 si TVA NPR
* Bit 1: 0 si ligne normal - 1 si bit discount (link to line into llx_remise_except)
* @var int
*/
public $info_bits = 0;
/**
* Constructor
*
* @param DoliDB $db Database handler
*/
public function __construct(DoliDB $db)
{
$this->db = $db;
}
}

View File

@ -35,46 +35,69 @@
*/
abstract class CommonObject
{
public $db;
/**
* @var DoliDb Database handler (result of a new DoliDB)
*/
public $db;
/**
* @var error Error string
* @deprecated Use instead the array of error strings
* @var string Error string
* @deprecated Use instead the array of error strings
*/
public $error;
/**
* @var errors Aray of error string
* @var string[] Array of error strings
*/
public $errors;
public $canvas; // Contains canvas name if it is
public $context=array(); // Use to pass context information
/**
* @var string Can be used to pass information when only object is provied to method
*/
public $context=array();
/**
* @var string Contains canvas name if record is an alternative canvas record
*/
public $canvas;
/**
* @var string Key value used to track if data is coming from import wizard
*/
public $import_key;
/**
* @var mixed Contains data to manage extrafields
*/
public $array_options=array();
/**
* @var int[] Array of linked objects ids. Loaded by ->fetchObjectLinked
*/
public $linkedObjectsIds;
/**
* @var mixed Array of linked objects. Loaded by ->fetchObjectLinked
*/
public $linkedObjects;
/**
* @var string Column name of the ref field.
*/
protected $table_ref_field = '';
// Following var are used by some objects only. We keep this property here in CommonObject to be able to provide common method using them.
public $name;
public $lastname;
public $firstname;
public $civility_id;
public $import_key;
public $array_options=array();
/**
* @var Societe
*/
public $thirdparty;
public $linkedObjectsIds; // Loaded by ->fetchObjectLinked
public $linkedObjects; // Loaded by ->fetchObjectLinked
// No constructor as it is an abstract class
/**
* Column name of the ref field.
* @var string
*/
protected $table_ref_field = '';
/**
* Check an object id/ref exists
@ -2662,10 +2685,9 @@ abstract class CommonObject
* @param string $buyer Object of buyer third party
* @param string $selected Object line selected
* @param int $dateSelector 1=Show also date range input fields
* @param int $permtoedit Permission to edit line
* @return void
*/
function printObjectLines($action, $seller, $buyer, $selected=0, $dateSelector=0, $permtoedit=0)
function printObjectLines($action, $seller, $buyer, $selected=0, $dateSelector=0)
{
global $conf, $hookmanager, $inputalsopricewithtax, $usemargins, $langs, $user;
@ -2758,7 +2780,7 @@ abstract class CommonObject
}
else
{
$this->printObjectLine($action,$line,$var,$num,$i,$dateSelector,$seller,$buyer,$selected,$extrafieldsline,$permtoedit);
$this->printObjectLine($action,$line,$var,$num,$i,$dateSelector,$seller,$buyer,$selected,$extrafieldsline);
}
$i++;
@ -2770,7 +2792,7 @@ abstract class CommonObject
* TODO Move this into an output class file (htmlline.class.php)
*
* @param string $action GET/POST action
* @param array $line Selected object line to output
* @param CommonObjectLine $line Selected object line to output
* @param string $var Is it a an odd line (true)
* @param int $num Number of line (0)
* @param int $i I
@ -2779,13 +2801,14 @@ abstract class CommonObject
* @param string $buyer Object of buyer third party
* @param string $selected Object line selected
* @param object $extrafieldsline Object of extrafield line attribute
* @param int $permtoedit Permission to edit
* @return void
*/
function printObjectLine($action,$line,$var,$num,$i,$dateSelector,$seller,$buyer,$selected=0,$extrafieldsline=0,$permtoedit=0)
function printObjectLine($action,$line,$var,$num,$i,$dateSelector,$seller,$buyer,$selected=0,$extrafieldsline=0)
{
global $conf,$langs,$user,$object,$hookmanager;
global $form,$bc,$bcdd;
global $form,$bc,$bcdd, $object_rights;
$object_rights = $this->getRights();
$element=$this->element;
@ -3860,4 +3883,16 @@ abstract class CommonObject
return $out;
}
/**
* Returns the rights used for this class
* @return stdClass
*/
public function getRights()
{
global $user;
return $user->rights->{$this->element};
}
}

View File

@ -28,6 +28,19 @@
*/
abstract class CommonObjectLine extends CommonObject
{
/**
* Id of the line
* @var int
*/
public $id;
/**
* Id of the line
* @var int
* @deprecated Try to use id property as possible
*/
public $rowid;
// TODO
// Currently we need function at end of file CommonObject for all object lines. Should find a way to avoid duplicate code.

View File

@ -22,6 +22,7 @@
*/
require_once DOL_DOCUMENT_ROOT .'/core/class/commonobject.class.php';
require_once DOL_DOCUMENT_ROOT .'/core/class/commonobjectline.class.php';
/**
* \class CommonOrder
@ -36,8 +37,141 @@ abstract class CommonOrder extends CommonObject
* \class CommonOrderLine
* \brief Superclass for orders classes
*/
abstract class CommonOrderLine extends CommonObject
abstract class CommonOrderLine extends CommonObjectLine
{
/**
* Product ref
* @var string
* @deprecated Use product_ref
*/
public $ref;
/**
* Product ref
* @var string
*/
public $product_ref;
/**
* Product label
* @var string
* @deprecated Use product_label
*/
public $libelle;
/**
* Product label
* @var string
*/
public $product_label;
/**
* Product description
* @var string
*/
public $product_desc;
/**
* Quantity
* @var int
*/
public $qty;
/**
* @deprecated
*/
var $price;
/**
* Unit price before taxes
* @var float
*/
public $subprice;
/**
* Type of the product. 0 for product 1 for service
* @var int
*/
public $product_type = 0;
/**
* Description of the line
* @var string
*/
public $desc;
/**
* Id of corresponding product
* @var int
*/
public $fk_product;
/**
* Percent line discount
* @var float
*/
public $remise_percent;
/**
* VAT %
* @var float
*/
public $tva_tx;
/**
* Local tax 1 %
* @var float
*/
public $localtax1_tx;
/**
* Local tax 2 %
* @var float
*/
public $localtax2_tx;
public $localtax1_type;
public $localtax2_type;
/**
* Total amount before taxes
* @var float
*/
public $total_ht;
/**
* Total VAT amount
* @var float
*/
public $total_tva;
/**
* Total local tax 1 amount
* @var float
*/
public $total_localtax1;
/**
* Total local tax 2 amount
* @var float
*/
public $total_localtax2;
/**
* Total amount with taxes
* @var float
*/
public $total_ttc;
/**
* Liste d'options cumulables:
* Bit 0: 0 si TVA normal - 1 si TVA NPR
* Bit 1: 0 si ligne normal - 1 si bit discount (link to line into llx_remise_except)
* @var int
*/
public $info_bits = 0;
public $special_code = 0;
}

View File

@ -379,16 +379,6 @@ class Conf
$this->global->STOCK_CALCULATE_ON_SUPPLIER_DISPATCH_ORDER=1;
}
if (! empty($conf->productbatch->enabled))
{
$this->global->STOCK_CALCULATE_ON_BILL=0;
$this->global->STOCK_CALCULATE_ON_VALIDATE_ORDER=0;
$this->global->STOCK_CALCULATE_ON_SHIPMENT=1;
$this->global->STOCK_CALCULATE_ON_SUPPLIER_BILL=0;
$this->global->STOCK_CALCULATE_ON_SUPPLIER_VALIDATE_ORDER=0;
$this->global->STOCK_CALCULATE_ON_SUPPLIER_DISPATCH_ORDER=1;
}
// conf->currency
if (empty($this->global->MAIN_MONNAIE)) $this->global->MAIN_MONNAIE='EUR';
$this->currency=$this->global->MAIN_MONNAIE;
@ -448,6 +438,9 @@ class Conf
// Default pdf use dash between lines
if (! isset($this->global->MAIN_PDF_DASH_BETWEEN_LINES)) $this->global->MAIN_PDF_DASH_BETWEEN_LINES=1;
// Set default value to MAIN_SHOW_LOGO
if (! isset($this->global->MAIN_SHOW_LOGO)) $this->global->MAIN_SHOW_LOGO=1;
// Default max file size for upload
$this->maxfilesize = (empty($this->global->MAIN_UPLOAD_DOC) ? 0 : $this->global->MAIN_UPLOAD_DOC * 1024);
@ -455,8 +448,8 @@ class Conf
if (! isset($this->global->MAIN_MODULES_FOR_EXTERNAL)) $this->global->MAIN_MODULES_FOR_EXTERNAL='user,askpricesupplier,facture,categorie,commande,fournisseur,contact,propal,projet,contrat,societe,ficheinter,expedition,agenda,adherent'; // '' means 'all'. Note that contact is added here as it should be a module later.
// Enable select2
if (empty($conf->global->MAIN_USE_JQUERY_MULTISELECT)) $conf->global->MAIN_USE_JQUERY_MULTISELECT='select2';
if (empty($this->global->MAIN_USE_JQUERY_MULTISELECT)) $this->global->MAIN_USE_JQUERY_MULTISELECT='select2';
// Timeouts
if (empty($this->global->MAIN_USE_CONNECT_TIMEOUT)) $this->global->MAIN_USE_CONNECT_TIMEOUT=10;
if (empty($this->global->MAIN_USE_RESPONSE_TIMEOUT)) $this->global->MAIN_USE_RESPONSE_TIMEOUT=30;

View File

@ -435,23 +435,23 @@ class DiscountAbsolute
if ($option == 'invoice') {
$label=$langs->trans("ShowDiscount").': '.$this->ref_facture_source;
$lien = '<a href="'.DOL_URL_ROOT.'/compta/facture.php?facid='.$this->fk_facture_source.'" title="'.dol_escape_htmltag($label, 1).'" class="classfortooltip">';
$lienfin='</a>';
$link = '<a href="'.DOL_URL_ROOT.'/compta/facture.php?facid='.$this->fk_facture_source.'" title="'.dol_escape_htmltag($label, 1).'" class="classfortooltip">';
$linkend='</a>';
$ref=$this->ref_facture_source;
$picto='bill';
}
if ($option == 'discount') {
$label=$langs->trans("Discount");
$lien = '<a href="'.DOL_URL_ROOT.'/comm/remx.php?id='.$this->fk_soc.'" title="'.dol_escape_htmltag($label, 1).'" class="classfortooltip">';
$lienfin='</a>';
$link = '<a href="'.DOL_URL_ROOT.'/comm/remx.php?id='.$this->fk_soc.'" title="'.dol_escape_htmltag($label, 1).'" class="classfortooltip">';
$linkend='</a>';
$ref=$langs->trans("Discount");
$picto='generic';
}
if ($withpicto) $result.=($lien.img_object($label, $picto, 'class="classfortooltip"').$lienfin);
if ($withpicto) $result.=($link.img_object($label, $picto, 'class="classfortooltip"').$linkend);
if ($withpicto && $withpicto != 2) $result.=' ';
$result.=$lien.$ref.$lienfin;
$result.=$link.$ref.$linkend;
return $result;
}

View File

@ -65,7 +65,7 @@ class DolGraph
var $bgcolorgrid=array(255,255,255); // array(R,G,B)
var $datacolor; // array(array(R,G,B),...)
protected $stringtoshow; // To store string to output graph into HTML page
private $_stringtoshow; // To store string to output graph into HTML page
/**

View File

@ -530,7 +530,7 @@ class ExtraFields
$sql.= " ".($perms?"'".$this->db->escape($perms)."'":"null").",";
$sql.= " '".$pos."',";
$sql.= " '".$alwayseditable."',";
$sql.= " '".$param."'";
$sql.= " '".$param."',";
$sql.= " ".$list;
$sql.= ")";
dol_syslog(get_class($this)."::update_label", LOG_DEBUG);
@ -567,10 +567,12 @@ class ExtraFields
{
global $conf;
if ( empty($elementtype) ) return array();
if ($elementtype == 'thirdparty') $elementtype='societe';
$array_name_label=array();
// For avoid conflicts with external modules
if (!$forceload && !empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) return $array_name_label;
@ -1054,6 +1056,7 @@ class ExtraFields
elseif ($type == 'link')
{
$out='';
$param_list=array_keys($param['options']);
// 0 : ObjectName
// 1 : classPath
@ -1062,7 +1065,7 @@ class ExtraFields
$object = new $InfoFieldList[0]($this->db);
$object->fetch($value);
$out='<input type="text" class="flat" name="options_'.$key.$keyprefix.'" size="20" value="'.$object->ref.'" >';
}
/* Add comments
if ($type == 'date') $out.=' (YYYY-MM-DD)';
@ -1292,14 +1295,15 @@ class ExtraFields
elseif ($type == 'link')
{
$out='';
$param_list=array_keys($params['options']);
// 0 : ObjectName
// 1 : classPath
$InfoFieldList = explode(":", $param_list[0]);
dol_include_once($InfoFieldList[1]);
$object = new $InfoFieldList[0]($this->db);
// only if something to display (perf)
if ($value)
{
$param_list=array_keys($params['options']);
// 0 : ObjectName
// 1 : classPath
$InfoFieldList = explode(":", $param_list[0]);
dol_include_once($InfoFieldList[1]);
$object = new $InfoFieldList[0]($this->db);
$object->fetch($value);
$value=$object->getNomUrl(3);
}

View File

@ -26,7 +26,7 @@ require_once DOL_DOCUMENT_ROOT .'/core/class/commonobject.class.php';
/**
* Class to manage fiscal year
*/
class Fiscalyear
class Fiscalyear extends CommonObject
{
public $element='fiscalyear';
public $table_element='accounting_fiscalyear';

View File

@ -395,12 +395,13 @@ class Form
$htmltext=str_replace("\n","",$htmltext);
$htmltext=str_replace('"',"&quot;",$htmltext);
if ($tooltipon == 2 || $tooltipon == 3) $paramfortooltipimg=' class="classfortooltip'.($extracss?' '.$extracss:'').'" title="'.($noencodehtmltext?$htmltext:dol_escape_htmltag($htmltext,1)).'"'; // Attribut to put on td img tag to store tooltip
if ($tooltipon == 2 || $tooltipon == 3) $paramfortooltipimg=' class="classfortooltip inline-block'.($extracss?' '.$extracss:'').'" title="'.($noencodehtmltext?$htmltext:dol_escape_htmltag($htmltext,1)).'"'; // Attribut to put on td img tag to store tooltip
else $paramfortooltipimg =($extracss?' class="'.$extracss.'"':''); // Attribut to put on td text tag
if ($tooltipon == 1 || $tooltipon == 3) $paramfortooltiptd=' class="classfortooltip'.($extracss?' '.$extracss:'').'" title="'.($noencodehtmltext?$htmltext:dol_escape_htmltag($htmltext,1)).'"'; // Attribut to put on td tag to store tooltip
if ($tooltipon == 1 || $tooltipon == 3) $paramfortooltiptd=' class="classfortooltip inline-block'.($extracss?' '.$extracss:'').'" title="'.($noencodehtmltext?$htmltext:dol_escape_htmltag($htmltext,1)).'"'; // Attribut to put on td tag to store tooltip
else $paramfortooltiptd =($extracss?' class="'.$extracss.'"':''); // Attribut to put on td text tag
$s="";
if (empty($notabs)) $s.='<table class="nobordernopadding" summary=""><tr>';
elseif ($notabs == 2) $s.='<div class="inline-block nowrap">';
if ($direction < 0) {
$s.='<'.$tag.$paramfortooltipimg;
if ($tag == 'td') {
@ -411,8 +412,8 @@ class Form
// Use another method to help avoid having a space in value in order to use this value with jquery
// TODO add this in css
//if ($text != '') $s.='<'.$tag.$paramfortooltiptd.'>'.(($direction < 0)?'&nbsp;':'').$text.(($direction > 0)?'&nbsp;':'').'</'.$tag.'>';
$paramfortooltiptd.= (($direction < 0)?' style="padding-left: 3px !important;"':'');
$paramfortooltiptd.= (($direction > 0)?' style="padding-right: 3px !important;"':'');
$paramfortooltiptd.= (($direction < 0)?' class="inline-block" style="padding-left: 3px !important;"':'');
$paramfortooltiptd.= (($direction > 0)?' class="inline-block" style="padding-right: 3px !important;"':'');
if ((string) $text != '') $s.='<'.$tag.$paramfortooltiptd.'>'.$text.'</'.$tag.'>';
if ($direction > 0) {
$s.='<'.$tag.$paramfortooltipimg;
@ -422,6 +423,7 @@ class Form
$s.= '>'.$img.'</'.$tag.'>';
}
if (empty($notabs)) $s.='</tr></table>';
elseif ($notabs == 2) $s.='</div>';
return $s;
}
@ -583,7 +585,7 @@ class Form
$sql.= " FROM ".MAIN_DB_PREFIX."c_incoterms";
$sql.= " WHERE active = 1";
$sql.= " ORDER BY code ASC";
dol_syslog(get_class($this)."::select_incoterm", LOG_DEBUG);
$resql=$this->db->query($sql);
if ($resql)
@ -593,14 +595,14 @@ class Form
include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
$out .= ajax_combobox($htmlname, $events);
}
if (!empty($page))
{
$out .= '<form method="post" action="'.$page.'">';
$out .= '<input type="hidden" name="action" value="set_incoterms">';
$out .= '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
}
$out.= '<select id="'.$htmlname.'" class="flat selectincoterm" name="'.$htmlname.'" '.$htmloption.'>';
$out.= '<option value=""></option>';
$num = $this->db->num_rows($resql);
@ -627,17 +629,17 @@ class Form
{
$out.= '<option value="'.$row['rowid'].'">';
}
if ($row['code']) $out.= $row['code'];
$out.= '</option>';
}
}
$out.= '</select>';
$out .= '<input id="location_incoterms" name="location_incoterms" size="14" value="'.$location_incoterms.'">';
if (!empty($page))
if (!empty($page))
{
$out .= '<input type="submit" class="button" value="'.$langs->trans("Modify").'"></form>';
}
@ -1641,7 +1643,7 @@ class Form
if ($result)
{
require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
require_once DOL_DOCUMENT_ROOT.'/product/class/priceparser.class.php';
require_once DOL_DOCUMENT_ROOT.'/product/dynamic_price/class/price_parser.class.php';
$num = $this->db->num_rows($result);
$out.='<select class="flat" name="'.$htmlname.'" id="'.$htmlname.'">';
@ -2022,7 +2024,7 @@ class Form
$result=$this->db->query($sql);
if ($result)
{
require_once DOL_DOCUMENT_ROOT.'/product/class/priceparser.class.php';
require_once DOL_DOCUMENT_ROOT.'/product/dynamic_price/class/price_parser.class.php';
$num = $this->db->num_rows($result);
@ -2191,7 +2193,7 @@ class Form
}
else
{
require_once DOL_DOCUMENT_ROOT.'/product/class/priceparser.class.php';
require_once DOL_DOCUMENT_ROOT.'/product/dynamic_price/class/price_parser.class.php';
$form.= '<option value="0">&nbsp;</option>';
$i = 0;
@ -4445,7 +4447,7 @@ class Form
}
else
{
$selected=($useempty?'':' selected="selected"');
$selected=(($useempty && $value != '0' && $value != 'no')?'':' selected="selected"');
$resultyesno .= '<option value="'.$yes.'">'.$langs->trans("Yes").'</option>'."\n";
$resultyesno .= '<option value="'.$no.'"'.$selected.'>'.$langs->trans("No").'</option>'."\n";
}

View File

@ -550,7 +550,11 @@ class FormFile
// Execute hooks
$parameters=array('socid'=>(isset($GLOBALS['socid'])?$GLOBALS['socid']:''),'id'=>(isset($GLOBALS['id'])?$GLOBALS['id']:''),'modulepart'=>$modulepart);
if (is_object($hookmanager)) $out.= $hookmanager->executeHooks('formBuilddocOptions',$parameters,$GLOBALS['object']);
if (is_object($hookmanager))
{
$reshook = $hookmanager->executeHooks('formBuilddocOptions',$parameters,$GLOBALS['object']);
$out.= $hookmanager->resPrint;
}
}
// Get list of files

View File

@ -782,7 +782,7 @@ class FormOther
require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
$montharray = monthArray($langs); // Get array
$montharray = monthArray($langs, 1); // Get array
$select_month = '<select class="flat" name="'.$htmlname.'" id="'.$htmlname.'">';
if ($useempty)

View File

@ -2,7 +2,7 @@
/* Copyright (C) 2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004 Benoit Mortier <benoit.mortier@opensides.be>
* Copyright (C) 2005-2011 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2006-2011 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2006-2015 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
@ -25,11 +25,12 @@
*/
/**
* \class Ldap
* \brief Class to manage LDAP features
* Class to manage LDAP features
*/
class Ldap
{
var $error;
/**
* Tableau des serveurs (IP addresses ou nom d'hotes)
*/
@ -78,7 +79,7 @@ class Ldap
var $name;
var $firstname;
var $login;
var $phone;
var $phone;
var $skype;
var $fax;
var $mail;
@ -414,9 +415,10 @@ class Ldap
}
else
{
$this->error=@ldap_error($this->connection);
$this->errno=@ldap_errno($this->connection);
dol_syslog(get_class($this)."::add failed: ".$this->errno." ".$this->error, LOG_ERR);
$this->ldapErrorCode = @ldap_errno($this->connection);
$this->ldapErrorText = @ldap_error($this->connection);
$this->error=$this->ldapErrorCode." ".$this->ldapErrorText;
dol_syslog(get_class($this)."::add failed: ".$this->error, LOG_ERR);
return -1;
}
}

View File

@ -61,14 +61,15 @@ class Notify
*
* @param string $action Id of action in llx_c_action_trigger
* @param int $socid Id of third party
* @param Object $object Object the notification is about
* @return string Message
*/
function confirmMessage($action,$socid)
function confirmMessage($action,$socid,$object)
{
global $langs;
$langs->load("mails");
$nb=$this->countDefinedNotifications($action,$socid);
$nb=$this->countDefinedNotifications($action,$socid,$object);
if ($nb <= 0) $texte=img_object($langs->trans("Notifications"),'email').' '.$langs->trans("NoNotificationsWillBeSent");
if ($nb == 1) $texte=img_object($langs->trans("Notifications"),'email').' '.$langs->trans("ANotificationsWillBeSent");
if ($nb >= 2) $texte=img_object($langs->trans("Notifications"),'email').' '.$langs->trans("SomeNotificationsWillBeSent",$nb);
@ -76,22 +77,26 @@ class Notify
}
/**
* Return number of notifications activated for action code and third party
* Return number of notifications activated for action code (and third party)
*
* @param string $action Code of action in llx_c_action_trigger (new usage) or Id of action in llx_c_action_trigger (old usage)
* @param int $socid Id of third party
* @return int <0 if KO, nb of notifications sent if OK
* @param string $notifcode Code of action in llx_c_action_trigger (new usage) or Id of action in llx_c_action_trigger (old usage)
* @param int $socid Id of third party or 0 for all thirdparties
* @param Object $object Object the notification is about
* @return int <0 if KO, nb of notifications sent if OK
*/
function countDefinedNotifications($action,$socid)
function countDefinedNotifications($notifcode,$socid,$object=null)
{
global $conf;
$error=0;
$num=0;
$valueforthreshold = 0;
if (is_object($object)) $valueforthreshold = $object->total_ht;
if (! $error)
{
$sql = "SELECT n.rowid";
$sql = "SELECT COUNT(n.rowid) as nb";
$sql.= " FROM ".MAIN_DB_PREFIX."notify_def as n,";
$sql.= " ".MAIN_DB_PREFIX."socpeople as c,";
$sql.= " ".MAIN_DB_PREFIX."c_action_trigger as a,";
@ -99,36 +104,52 @@ class Notify
$sql.= " WHERE n.fk_contact = c.rowid";
$sql.= " AND a.rowid = n.fk_action";
$sql.= " AND n.fk_soc = s.rowid";
if (is_numeric($action)) $sql.= " AND n.fk_action = ".$action; // Old usage
else $sql.= " AND a.code = '".$action."'"; // New usage
if ($notifcode)
{
if (is_numeric($notifcode)) $sql.= " AND n.fk_action = ".$notifcode; // Old usage
else $sql.= " AND a.code = '".$notifcode."'"; // New usage
}
$sql.= " AND s.entity IN (".getEntity('societe', 1).")";
$sql.= " AND s.rowid = ".$socid;
if ($socid > 0) $sql.= " AND s.rowid = ".$socid;
dol_syslog(get_class($this)."::countDefinedNotifications ".$action.", ".$socid."", LOG_DEBUG);
dol_syslog(get_class($this)."::countDefinedNotifications ".$notifcode.", ".$socid."", LOG_DEBUG);
$resql = $this->db->query($sql);
if ($resql)
{
$num = $this->db->num_rows($resql);
$obj = $this->db->fetch_object($resql);
if ($obj) $num = $obj->nb;
}
else
{
$error++;
$this->error=$this->db->error.' sql='.$sql;
$this->error=$this->db->lasterror();
}
}
if (! $error)
{
// List of notifications enabled for fixed email
foreach($conf->global as $key => $val)
{
if (! preg_match('/^NOTIFICATION_FIXEDEMAIL_'.$action.'/', $key, $reg)) continue;
$num++;
if ($notifcode)
{
if ($val == '' || ! preg_match('/^NOTIFICATION_FIXEDEMAIL_'.$notifcode.'_THRESHOLD_HIGHER_(.*)$/', $key, $reg)) continue;
}
else
{
if ($val == '' || ! preg_match('/^NOTIFICATION_FIXEDEMAIL_.*_THRESHOLD_HIGHER_(.*)$/', $key, $reg)) continue;
}
$threshold = (float) $reg[1];
if ($valueforthreshold < $threshold) continue;
$tmpemail=explode(',',$val);
$num+=count($tmpemail);
}
}
// TODO return array with list of email instead of number, + type of notification (contacts or fixed email)
if ($error) return -1;
return $num;
}
@ -137,17 +158,17 @@ class Notify
* Check if notification are active for couple action/company.
* If yes, send mail and save trace into llx_notify.
*
* @param string $action Code of action in llx_c_action_trigger (new usage) or Id of action in llx_c_action_trigger (old usage)
* @param Object $object Object the notification deals on
* @return int <0 if KO, or number of changes if OK
* @param string $notifcode Code of action in llx_c_action_trigger (new usage) or Id of action in llx_c_action_trigger (old usage)
* @param Object $object Object the notification deals on
* @return int <0 if KO, or number of changes if OK
*/
function send($action, $object)
function send($notifcode, $object)
{
global $conf,$langs,$mysoc,$dolibarr_main_url_root;
global $user,$conf,$langs,$mysoc,$dolibarr_main_url_root;
include_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
dol_syslog(get_class($this)."::send action=".$action.", object=".$object->id);
dol_syslog(get_class($this)."::send notifcode=".$notifcode.", object=".$object->id);
$langs->load("other");
@ -166,7 +187,20 @@ class Notify
$link = '';
$num = 0;
if (! in_array($action, array('BILL_VALIDATE', 'ORDER_VALIDATE', 'PROPAL_VALIDATE', 'FICHINTER_VALIDATE', 'ORDER_SUPPLIER_APPROVE', 'ORDER_SUPPLIER_REFUSE', 'SHIPPING_VALIDATE')))
if (! in_array(
$notifcode,
array(
'BILL_VALIDATE',
'ORDER_VALIDATE',
'PROPAL_VALIDATE',
'FICHINTER_VALIDATE',
'ORDER_SUPPLIER_VALIDATE',
'ORDER_SUPPLIER_APPROVE',
'ORDER_SUPPLIER_REFUSE',
'SHIPPING_VALIDATE'
)
)
)
{
return 0;
}
@ -181,8 +215,8 @@ class Notify
$sql.= " ".MAIN_DB_PREFIX."societe as s";
$sql.= " WHERE n.fk_contact = c.rowid AND a.rowid = n.fk_action";
$sql.= " AND n.fk_soc = s.rowid";
if (is_numeric($action)) $sql.= " AND n.fk_action = ".$action; // Old usage
else $sql.= " AND a.code = '".$action."'"; // New usage
if (is_numeric($notifcode)) $sql.= " AND n.fk_action = ".$notifcode; // Old usage
else $sql.= " AND a.code = '".$notifcode."'"; // New usage
$sql .= " AND s.rowid = ".$object->socid;
$result = $this->db->query($sql);
@ -197,8 +231,8 @@ class Notify
{
$obj = $this->db->fetch_object($result);
$sendto = $obj->firstname . " " . $obj->lastname . " <".$obj->email.">";
$actiondefid = $obj->adid;
$sendto = dolGetFirstLastname($obj->firstname,$obj->lastname) . " <".$obj->email.">";
$notifcodedefid = $obj->adid;
if (dol_strlen($obj->email))
{
@ -210,7 +244,7 @@ class Notify
$outputlangs->setDefaultLang($obj->default_lang);
}
switch ($action) {
switch ($notifcode) {
case 'BILL_VALIDATE':
$link='/compta/facture.php?facid='.$object->id;
$dir_output = $conf->facture->dir_output;
@ -235,6 +269,14 @@ class Notify
$object_type = 'ficheinter';
$mesg = $langs->transnoentitiesnoconv("EMailTextInterventionValidated",$object->ref);
break;
case 'ORDER_SUPPLIER_VALIDATE':
$link='/fourn/commande/card.php?id='.$object->id;
$dir_output = $conf->fournisseur->dir_output.'/commande/';
$object_type = 'order_supplier';
$mesg = $langs->transnoentitiesnoconv("Hello").",\n\n";
$mesg.= $langs->transnoentitiesnoconv("EMailTextOrderValidatedBy",$object->ref,$user->getFullName($langs));
$mesg.= "\n\n".$langs->transnoentitiesnoconv("Sincerely").".\n\n";
break;
case 'ORDER_SUPPLIER_APPROVE':
$link='/fourn/commande/card.php?id='.$object->id;
$dir_output = $conf->fournisseur->dir_output.'/commande/';
@ -294,7 +336,7 @@ class Notify
if ($mailfile->sendfile())
{
$sql = "INSERT INTO ".MAIN_DB_PREFIX."notify (daten, fk_action, fk_soc, fk_contact, type, objet_type, objet_id, email)";
$sql.= " VALUES ('".$this->db->idate(dol_now())."', ".$actiondefid.", ".$object->socid.", ".$obj->cid.", '".$obj->type."', '".$object_type."', ".$object->id.", '".$this->db->escape($obj->email)."')";
$sql.= " VALUES ('".$this->db->idate(dol_now())."', ".$notifcodedefid.", ".$object->socid.", ".$obj->cid.", '".$obj->type."', '".$object_type."', ".$object->id.", '".$this->db->escape($obj->email)."')";
if (! $this->db->query($sql))
{
dol_print_error($this->db);
@ -328,113 +370,150 @@ class Notify
// Check notification using fixed email
if (! $error)
{
$param='NOTIFICATION_FIXEDEMAIL_'.$action;
if (! empty($conf->global->$param))
{
$sendto = $conf->global->$param;
$actiondefid = dol_getIdFromCode($this->db, $action, 'c_action_trigger', 'code', 'rowid');
if ($actiondefid <= 0) dol_print_error($this->db, 'Failed to get id from code');
foreach($conf->global as $key => $val)
{
if ($val == '' || ! preg_match('/^NOTIFICATION_FIXEDEMAIL_'.$notifcode.'_THRESHOLD_HIGHER_(.*)$/', $key, $reg)) continue;
$object_type = '';
$threshold = (float) $reg[1];
if ($object->total_ht <= $threshold)
{
dol_syslog("A notification is requested for notifcode = ".$notifcode." but amount = ".$object->total_ht." so lower than threshold = ".$threshold.". We discard this notification");
continue;
}
$param='NOTIFICATION_FIXEDEMAIL_'.$notifcode.'_THRESHOLD_HIGHER_'.$reg[1];
$sendto = $conf->global->$param;
$notifcodedefid = dol_getIdFromCode($this->db, $notifcode, 'c_action_trigger', 'code', 'rowid');
if ($notifcodedefid <= 0) dol_print_error($this->db, 'Failed to get id from code');
$object_type = '';
$link = '';
$num++;
$num++;
switch ($action) {
case 'BILL_VALIDATE':
$link='/compta/facture.php?facid='.$object->id;
$dir_output = $conf->facture->dir_output;
$object_type = 'facture';
$mesg = $langs->transnoentitiesnoconv("EMailTextInvoiceValidated",$object->ref);
break;
case 'ORDER_VALIDATE':
$link='/commande/card.php?id='.$object->id;
$dir_output = $conf->commande->dir_output;
$object_type = 'order';
$mesg = $langs->transnoentitiesnoconv("EMailTextOrderValidated",$object->ref);
break;
case 'PROPAL_VALIDATE':
$link='/comm/propal.php?id='.$object->id;
$dir_output = $conf->propal->dir_output;
$object_type = 'propal';
$mesg = $langs->transnoentitiesnoconv("EMailTextProposalValidated",$object->ref);
break;
case 'FICHINTER_VALIDATE':
$link='/fichinter/card.php?id='.$object->id;
$dir_output = $conf->facture->dir_output;
$object_type = 'ficheinter';
$mesg = $langs->transnoentitiesnoconv("EMailTextInterventionValidated",$object->ref);
break;
case 'ORDER_SUPPLIER_APPROVE':
$link='/fourn/commande/card.php?id='.$object->id;
$dir_output = $conf->fournisseur->dir_output.'/commande/';
$object_type = 'order_supplier';
$mesg = $langs->transnoentitiesnoconv("Hello").",\n\n";
$mesg.= $langs->transnoentitiesnoconv("EMailTextOrderApprovedBy",$object->ref,$user->getFullName($langs));
$mesg.= "\n\n".$langs->transnoentitiesnoconv("Sincerely").".\n\n";
break;
case 'ORDER_SUPPLIER_REFUSE':
$link='/fourn/commande/card.php?id='.$object->id;
$dir_output = $conf->fournisseur->dir_output.'/commande/';
$object_type = 'order_supplier';
$mesg = $langs->transnoentitiesnoconv("Hello").",\n\n";
$mesg.= $langs->transnoentitiesnoconv("EMailTextOrderRefusedBy",$object->ref,$user->getFullName($langs));
$mesg.= "\n\n".$langs->transnoentitiesnoconv("Sincerely").".\n\n";
break;
case 'SHIPPING_VALIDATE':
$dir_output = $conf->expedition->dir_output.'/sending/';
$object_type = 'order_supplier';
$mesg = $langs->transnoentitiesnoconv("EMailTextExpeditionValidated",$object->ref);
break;
}
$ref = dol_sanitizeFileName($object->ref);
$pdf_path = $dir_output."/".$ref."/".$ref.".pdf";
if (! dol_is_file($pdf_path))
{
// We can't add PDF as it is not generated yet.
$filepdf = '';
}
else
{
$filepdf = $pdf_path;
}
switch ($notifcode) {
case 'BILL_VALIDATE':
$link='/compta/facture.php?facid='.$object->id;
$dir_output = $conf->facture->dir_output;
$object_type = 'facture';
$mesg = $langs->transnoentitiesnoconv("EMailTextInvoiceValidated",$object->ref);
break;
case 'ORDER_VALIDATE':
$link='/commande/card.php?id='.$object->id;
$dir_output = $conf->commande->dir_output;
$object_type = 'order';
$mesg = $langs->transnoentitiesnoconv("EMailTextOrderValidated",$object->ref);
break;
case 'PROPAL_VALIDATE':
$link='/comm/propal.php?id='.$object->id;
$dir_output = $conf->propal->dir_output;
$object_type = 'propal';
$mesg = $langs->transnoentitiesnoconv("EMailTextProposalValidated",$object->ref);
break;
case 'FICHINTER_VALIDATE':
$link='/fichinter/card.php?id='.$object->id;
$dir_output = $conf->facture->dir_output;
$object_type = 'ficheinter';
$mesg = $langs->transnoentitiesnoconv("EMailTextInterventionValidated",$object->ref);
break;
case 'ORDER_SUPPLIER_VALIDATE':
$link='/fourn/commande/card.php?id='.$object->id;
$dir_output = $conf->fournisseur->dir_output.'/commande/';
$object_type = 'order_supplier';
$mesg = $langs->transnoentitiesnoconv("Hello").",\n\n";
$mesg.= $langs->transnoentitiesnoconv("EMailTextOrderValidatedBy",$object->ref,$user->getFullName($langs));
$mesg.= "\n\n".$langs->transnoentitiesnoconv("Sincerely").".\n\n";
break;
case 'ORDER_SUPPLIER_APPROVE':
$link='/fourn/commande/card.php?id='.$object->id;
$dir_output = $conf->fournisseur->dir_output.'/commande/';
$object_type = 'order_supplier';
$mesg = $langs->transnoentitiesnoconv("Hello").",\n\n";
$mesg.= $langs->transnoentitiesnoconv("EMailTextOrderApprovedBy",$object->ref,$user->getFullName($langs));
$mesg.= "\n\n".$langs->transnoentitiesnoconv("Sincerely").".\n\n";
break;
case 'ORDER_SUPPLIER_REFUSE':
$link='/fourn/commande/card.php?id='.$object->id;
$dir_output = $conf->fournisseur->dir_output.'/commande/';
$object_type = 'order_supplier';
$mesg = $langs->transnoentitiesnoconv("Hello").",\n\n";
$mesg.= $langs->transnoentitiesnoconv("EMailTextOrderRefusedBy",$object->ref,$user->getFullName($langs));
$mesg.= "\n\n".$langs->transnoentitiesnoconv("Sincerely").".\n\n";
break;
case 'SHIPPING_VALIDATE':
$dir_output = $conf->expedition->dir_output.'/sending/';
$object_type = 'order_supplier';
$mesg = $langs->transnoentitiesnoconv("EMailTextExpeditionValidated",$object->ref);
break;
}
$ref = dol_sanitizeFileName($object->ref);
$pdf_path = $dir_output."/".$ref."/".$ref.".pdf";
if (! dol_is_file($pdf_path))
{
// We can't add PDF as it is not generated yet.
$filepdf = '';
}
else
{
$filepdf = $pdf_path;
}
$subject = '['.$application.'] '.$langs->transnoentitiesnoconv("DolibarrNotification");
$subject = '['.$application.'] '.$langs->transnoentitiesnoconv("DolibarrNotification");
$message = $langs->transnoentities("YouReceiveMailBecauseOfNotification",$application,$mysoc->name)."\n";
$message.= $langs->transnoentities("YouReceiveMailBecauseOfNotification2",$application,$mysoc->name)."\n";
$message.= "\n";
$message.= $mesg;
if ($link) $message=dol_concatdesc($message,$urlwithroot.$link);
$message = $langs->transnoentities("YouReceiveMailBecauseOfNotification",$application,$mysoc->name)."\n";
$message.= $langs->transnoentities("YouReceiveMailBecauseOfNotification2",$application,$mysoc->name)."\n";
$message.= "\n";
$message.= $mesg;
if ($link) $message=dol_concatdesc($message,$urlwithroot.$link);
$mailfile = new CMailFile(
$subject,
$sendto,
$replyto,
$message,
array($file),
array($mimefile),
array($filename[count($filename)-1]),
'',
'',
0,
-1
);
// Replace keyword __SUPERVISOREMAIL__
if (preg_match('/__SUPERVISOREMAIL__/', $sendto))
{
$newval='';
if ($user->fk_user > 0)
{
$supervisoruser=new User($this->db);
$supervisoruser->fetch($user->fk_user);
if ($supervisoruser->email) $newval=trim(dolGetFirstLastname($supervisoruser->firstname, $supervisoruser->lastname).' <'.$supervisoruser->email.'>');
}
dol_syslog("Replace the __SUPERVISOREMAIL__ key into recipient email string with ".$newval);
$sendto = preg_replace('/__SUPERVISOREMAIL__/', $newval, $sendto);
$sendto = preg_replace('/^[\s,]+/','',$sendto); // Clean start of string
$sendto = preg_replace('/[\s,]+$/','',$sendto); // Clean end of string
}
if ($mailfile->sendfile())
{
$sql = "INSERT INTO ".MAIN_DB_PREFIX."notify (daten, fk_action, fk_soc, fk_contact, type, objet_type, objet_id, email)";
$sql.= " VALUES ('".$this->db->idate(dol_now())."', ".$actiondefid.", ".$object->socid.", null, '".$obj->type."', '".$object_type."', ".$object->id.", '".$this->db->escape($conf->global->$param)."')";
if (! $this->db->query($sql))
{
dol_print_error($this->db);
}
}
else
{
$error++;
$this->errors[]=$mailfile->error;
}
}
if ($sendto)
{
$mailfile = new CMailFile(
$subject,
$sendto,
$replyto,
$message,
array($file),
array($mimefile),
array($filename[count($filename)-1]),
'',
'',
0,
-1
);
if ($mailfile->sendfile())
{
$sql = "INSERT INTO ".MAIN_DB_PREFIX."notify (daten, fk_action, fk_soc, fk_contact, type, objet_type, objet_id, email)";
$sql.= " VALUES ('".$this->db->idate(dol_now())."', ".$notifcodedefid.", ".$object->socid.", null, 'email', '".$object_type."', ".$object->id.", '".$this->db->escape($conf->global->$param)."')";
if (! $this->db->query($sql))
{
dol_print_error($this->db);
}
}
else
{
$error++;
$this->errors[]=$mailfile->error;
}
}
}
}
if (! $error) return $num;

View File

@ -315,7 +315,7 @@ class DoliDBSqlite3 extends DoliDB
* @param string $login login
* @param string $passwd password
* @param string $name name of database (not used for mysql, used for pgsql)
* @param string $port Port of database server
* @param integer $port Port of database server
* @return resource Database access handler
* @see close
*/
@ -530,7 +530,7 @@ class DoliDBSqlite3 extends DoliDB
/**
* Return datas as an array
*
* @param Resultset $resultset Resultset of request
* @param resource $resultset Resultset of request
* @return array Array
*/
function fetch_row($resultset)
@ -588,7 +588,7 @@ class DoliDBSqlite3 extends DoliDB
/**
* Free last resultset used.
*
* @param resultset $resultset Curseur de la requete voulue
* @param integer $resultset Curseur de la requete voulue
* @return void
*/
function free($resultset=0)
@ -709,7 +709,7 @@ class DoliDBSqlite3 extends DoliDB
*
* @param string $fieldorvalue Field name or value to encrypt
* @param int $withQuotes Return string with quotes
* @return return XXX(field) or XXX('value') or field or 'value'
* @return string XXX(field) or XXX('value') or field or 'value'
*/
function encrypt($fieldorvalue, $withQuotes=0)
{
@ -1277,7 +1277,7 @@ class DoliDBSqlite3 extends DoliDB
* Cette fonction est l'equivalent de la fonction MONTH de MySql.
*
* @param string $date Date
* @return integer
* @return string
*/
public static function dbMONTH($date)
{
@ -1320,7 +1320,7 @@ class DoliDBSqlite3 extends DoliDB
* dbWEEKDAY
*
* @param int $date Date
* @return string
* @return double
*/
public static function dbWEEKDAY($date) {
$arr = date_parse($date);
@ -1472,7 +1472,7 @@ class DoliDBSqlite3 extends DoliDB
* week_mode
*
* @param string $mode Mode
* @return string Week format
* @return integer Week format
*/
private static function week_mode($mode) {
$week_format= ($mode & 7);

View File

@ -84,7 +84,7 @@ function CreateXmlFooter()
/**
* SendError
*
* @param unknown_type $number Number
* @param integer $number Number
* @param unknown_type $text Text
* @return void
*/

View File

@ -30,7 +30,7 @@ require 'commands.php';
/**
* SendError
*
* @param string $number Number
* @param integer $number Number
* @param string $text Text
* @return void
*/

View File

@ -1,5 +1,5 @@
<?php
/* Copyright (C) 2005-2013 Laurent Destailleur <eldy@users.sourceforge.net>
/* Copyright (C) 2005-2015 Laurent Destailleur <eldy@users.sourceforge.net>
*
* This file is a modified version of datepicker.php from phpBSM to fix some
* bugs, to add new features and to dramatically increase speed.

View File

@ -122,7 +122,28 @@ function updateTotal(days,mode)
var nbline = document.getElementById('numberOfLines').value;
for (var i=0;i<nbline;i++)
{
var id='task['+i+']['+days+']';
var id='timespent['+i+']['+days+']';
var taskTime= new Date(0);
var element=document.getElementById(id);
if(element)
{
/* alert(element.value);*/
if (element.value)
{
result=parseTime(element.value,taskTime);
}
else
{
result=parseTime(element.innerHTML,taskTime);
}
if (result >= 0)
{
total.setHours(total.getHours()+taskTime.getHours());
total.setMinutes(total.getMinutes()+taskTime.getMinutes());
}
}
var id='timeadded['+i+']['+days+']';
var taskTime= new Date(0);
var element=document.getElementById(id);
if(element)
@ -152,7 +173,23 @@ function updateTotal(days,mode)
var nbline = document.getElementById('numberOfLines').value;
for (var i=0;i<nbline;i++)
{
var id='task['+i+']['+days+']';
var id='timespent['+i+']['+days+']';
var taskTime= new Date(0);
var element=document.getElementById(id);
if(element)
{
if (element.value)
{
total+=parseInt(element.value);
}
else
{
total+=parseInt(element.innerHTML);
}
}
var id='timeadded['+i+']['+days+']';
var taskTime= new Date(0);
var element=document.getElementById(id);
if(element)

View File

@ -386,6 +386,12 @@ function dolibarr_del_const($db, $name, $entity=1)
{
global $conf;
if (empty($name))
{
dol_print_error('','Error call dolibar_del_const with parameter name empty');
return -1;
}
$sql = "DELETE FROM ".MAIN_DB_PREFIX."const";
$sql.= " WHERE (".$db->decrypt('name')." = '".$db->escape($name)."'";
if (is_numeric($name)) $sql.= " OR rowid = '".$db->escape($name)."'";
@ -438,7 +444,7 @@ function dolibarr_get_const($db, $name, $entity=1)
/**
* Insert a parameter (key,value) into database.
* Insert a parameter (key,value) into database (delete old key then insert it again).
*
* @param DoliDB $db Database handler
* @param string $name Name of constant

View File

@ -120,7 +120,7 @@ function bank_admin_prepare_head($object)
* Check SWIFT informations for a bank account
*
* @param Account $account A bank account
* @return int True if informations are valid, false otherwise
* @return boolean True if informations are valid, false otherwise
*/
function checkSwiftForAccount($account)
{
@ -137,7 +137,7 @@ function checkSwiftForAccount($account)
* Check IBAN number informations for a bank account
*
* @param Account $account A bank account
* @return int True if informations are valid, false otherwise
* @return boolean True if informations are valid, false otherwise
*/
function checkIbanForAccount($account)
{
@ -156,7 +156,7 @@ function checkIbanForAccount($account)
* Check account number informations for a bank account
*
* @param Account $account A bank account
* @return int True if informations are valid, false otherwise
* @return boolean True if informations are valid, false otherwise
*/
function checkBanForAccount($account)
{

View File

@ -471,7 +471,7 @@ function show_projects($conf,$langs,$db,$object,$backtopage='')
print_fiche_titre($langs->trans("ProjectsDedicatedToThisThirdParty"),$buttoncreate,'');
print "\n".'<table class="noborder" width=100%>';
$sql = "SELECT p.rowid,p.title,p.ref,p.public, p.dateo as do, p.datee as de";
$sql = "SELECT p.rowid as id, p.title, p.ref, p.public, p.dateo as do, p.datee as de, p.fk_statut as status";
$sql .= " FROM ".MAIN_DB_PREFIX."projet as p";
$sql .= " WHERE p.fk_soc = ".$object->id;
$sql .= " ORDER BY p.dateo DESC";
@ -483,23 +483,24 @@ function show_projects($conf,$langs,$db,$object,$backtopage='')
print '<tr class="liste_titre">';
print '<td>'.$langs->trans("Ref").'</td><td>'.$langs->trans("Name").'</td><td align="center">'.$langs->trans("DateStart").'</td><td align="center">'.$langs->trans("DateEnd").'</td>';
print '<td align="right">'.$langs->trans("Status").'</td>';
print '</tr>';
if ($num > 0)
{
require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
$projectstatic = new Project($db);
$projecttmp = new Project($db);
$i=0;
$var=false;
while ($i < $num)
{
$obj = $db->fetch_object($result);
$projectstatic->fetch($obj->rowid);
$projecttmp->fetch($obj->id);
// To verify role of users
$userAccess = $projectstatic->restrictedProjectArea($user);
$userAccess = $projecttmp->restrictedProjectArea($user);
if ($user->rights->projet->lire && $userAccess > 0)
{
@ -507,13 +508,15 @@ function show_projects($conf,$langs,$db,$object,$backtopage='')
print "<tr ".$bc[$var].">";
// Ref
print '<td><a href="'.DOL_URL_ROOT.'/projet/card.php?id='.$obj->rowid.'">'.img_object($langs->trans("ShowProject"),($obj->public?'projectpub':'project'))." ".$obj->ref.'</a></td>';
print '<td><a href="'.DOL_URL_ROOT.'/projet/card.php?id='.$projecttmp->id.'">'.img_object($langs->trans("ShowProject"),($obj->public?'projectpub':'project'))." ".$obj->ref.'</a></td>';
// Label
print '<td>'.$obj->title.'</td>';
// Date start
print '<td align="center">'.dol_print_date($db->jdate($obj->do),"day").'</td>';
// Date end
print '<td align="center">'.dol_print_date($db->jdate($obj->de),"day").'</td>';
// Status
print '<td align="right">'.$projecttmp->getLibStatut(5).'</td>';
print '</tr>';
}

View File

@ -813,11 +813,12 @@ function num_open_day($timestampStart, $timestampEnd, $inhour=0, $lastday=0, $ha
* This replace old function monthArrayOrSelected.
*
* @param Translate $outputlangs Object langs
* @param int $short 1=Return short label
* @return array Month string or array if selected < 0
*/
function monthArray($outputlangs)
function monthArray($outputlangs,$short=0)
{
$montharray = array (
$montharray = array (
1 => $outputlangs->trans("January"),
2 => $outputlangs->trans("February"),
3 => $outputlangs->trans("March"),
@ -832,6 +833,24 @@ function monthArray($outputlangs)
12 => $outputlangs->trans("December")
);
return $montharray;
if (! empty($short))
{
$montharray = array (
1 => $outputlangs->trans("Jan"),
2 => $outputlangs->trans("Feb"),
3 => $outputlangs->trans("Mar"),
4 => $outputlangs->trans("Apr"),
5 => $outputlangs->trans("May"),
6 => $outputlangs->trans("Jun"),
7 => $outputlangs->trans("Jul"),
8 => $outputlangs->trans("Aug"),
9 => $outputlangs->trans("Sep"),
10 => $outputlangs->trans("Oct"),
11 => $outputlangs->trans("Nov"),
12 => $outputlangs->trans("Dec")
);
}
return $montharray;
}

View File

@ -0,0 +1,90 @@
<?php
/* Copyright (C) 2015 Alexandre Spangaro <alexandre.spangaro@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 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/core/lib/donation.lib.php
* \ingroup Donation
* \brief Library of donation functions
*/
/**
* Prepare array with list of admin tabs
*
* @param Donation $object Donation
* @return array Array of tabs to show
*/
function donation_admin_prepare_head($object)
{
global $langs, $conf;
$h = 0;
$head = array ();
$head[$h][0] = DOL_URL_ROOT . '/don/admin/donation.php';
$head[$h][1] = $langs->trans("Miscellaneous");
$head[$h][2] = 'general';
$h ++;
// Show more tabs from modules
// Entries must be declared in modules descriptor with line
// $this->tabs = array('entity:+tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to add new tab
// $this->tabs = array('entity:-tabname); to remove a tab
complete_head_from_modules($conf, $langs, $object, $head, $h, 'donation_admin');
$head[$h][0] = DOL_URL_ROOT . '/don/admin/donation_extrafields.php';
$head[$h][1] = $langs->trans("ExtraFields");
$head[$h][2] = 'attributes';
$h++;
complete_head_from_modules($conf, $langs, $object, $head, $h, 'donation_admin', 'remove');
return $head;
}
/**
* Prepare array with list of tabs
*
* @param Donation $object Donation
* @return array Array of tabs to show
*/
function donation_prepare_head($object)
{
global $langs, $conf;
$h = 0;
$head = array ();
$head[$h][0] = DOL_URL_ROOT . '/don/card.php?id=' . $object->id;
$head[$h][1] = $langs->trans("Card");
$head[$h][2] = 'card';
$h ++;
// Show more tabs from modules
// Entries must be declared in modules descriptor with line
// $this->tabs = array('entity:+tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to add new tab
// $this->tabs = array('entity:-tabname); to remove a tab
complete_head_from_modules($conf, $langs, $object, $head, $h, 'donation');
$head[$h][0] = DOL_URL_ROOT . '/don/info.php?id=' . $object->id;
$head[$h][1] = $langs->trans("Info");
$head[$h][2] = 'info';
$h++;
complete_head_from_modules($conf, $langs, $object, $head, $h, 'donation', 'remove');
return $head;
}

View File

@ -592,16 +592,17 @@ function dol_strtoupper($utf8_string)
* This function works only if syslog module is enabled.
* This must not use any call to other function calling dol_syslog (avoid infinite loop).
*
* @param string $message Line to log. Ne doit pas etre traduit si level = LOG_ERR
* @param int $level Log level
* 0=Show nothing
* On Windows LOG_ERR=4, LOG_WARNING=5, LOG_NOTICE=LOG_INFO=6, LOG_DEBUG=6 si define_syslog_variables ou PHP 5.3+, 7 si dolibarr
* On Linux LOG_ERR=3, LOG_WARNING=4, LOG_INFO=6, LOG_DEBUG=7
* @param int $ident 1=Increase ident of 1, -1=Decrease ident of 1
* @param string $suffixinfilename When output is a file, append this suffix into default log filename.
* @param string $message Line to log.
* @param int $level Log level
* 0=Show nothing
* On Windows LOG_ERR=4, LOG_WARNING=5, LOG_NOTICE=LOG_INFO=6, LOG_DEBUG=6 si define_syslog_variables ou PHP 5.3+, 7 si dolibarr
* On Linux LOG_ERR=3, LOG_WARNING=4, LOG_INFO=6, LOG_DEBUG=7
* @param int $ident 1=Increase ident of 1, -1=Decrease ident of 1
* @param string $suffixinfilename When output is a file, append this suffix into default log filename.
* @param string $restricttologhandler Output log only for this log handler
* @return void
*/
function dol_syslog($message, $level = LOG_INFO, $ident = 0, $suffixinfilename='')
function dol_syslog($message, $level = LOG_INFO, $ident = 0, $suffixinfilename='', $restricttologhandler='')
{
global $conf, $user;
@ -624,7 +625,7 @@ function dol_syslog($message, $level = LOG_INFO, $ident = 0, $suffixinfilename='
$conf->logbuffer[] = dol_print_date(time(),"%Y-%m-%d %H:%M:%S")." ".$message;
}
//TODO: Remove this. MAIN_ENABLE_LOG_HTML should be deprecated and use a HTML handler
//TODO: Remove this. MAIN_ENABLE_LOG_HTML should be deprecated and use a log handler dedicated to HTML output
// If enable html log tag enabled and url parameter log defined, we show output log on HTML comments
if (! empty($conf->global->MAIN_ENABLE_LOG_HTML) && ! empty($_GET["log"]))
{
@ -648,10 +649,10 @@ function dol_syslog($message, $level = LOG_INFO, $ident = 0, $suffixinfilename='
else if (! empty($_SERVER['COMPUTERNAME'])) $data['ip'] = $_SERVER['COMPUTERNAME'].(empty($_SERVER['USERNAME'])?'':'@'.$_SERVER['USERNAME']);
// This is when PHP session is ran outside a web server, like from Linux command line (Not always defined, but usefull if OS defined it).
else if (! empty($_SERVER['LOGNAME'])) $data['ip'] = '???@'.$_SERVER['LOGNAME'];
// Loop on each log handler and send output
foreach ($conf->loghandlers as $loghandlerinstance)
{
if ($restricttologhandler && $loghandlerinstance->code != $restricttologhandler) continue;
$loghandlerinstance->export($data,$suffixinfilename);
}
unset($data);
@ -1633,14 +1634,14 @@ function dol_print_address($address, $htmlid, $mode, $id)
/**
* Return true if email syntax is ok
*
* @param string $address email (Ex: "toto@titi.com", "John Do <johndo@titi.com>")
* @return boolean true if email syntax is OK, false if KO or empty string
* @param string $address email (Ex: "toto@titi.com", "John Do <johndo@titi.com>")
* @param int $acceptsupervisorkey If 1, the special string '__SUPERVISOREMAIL__' is also accepted as valid
* @return boolean true if email syntax is OK, false if KO or empty string
*/
function isValidEmail($address)
function isValidEmail($address, $acceptsupervisorkey=0)
{
if (filter_var($address, FILTER_VALIDATE_EMAIL)) {
return true;
}
if ($acceptsupervisorkey && $address == '__SUPERVISOREMAIL__') return true;
if (filter_var($address, FILTER_VALIDATE_EMAIL)) return true;
return false;
}
@ -2116,7 +2117,7 @@ function img_edit_remove($titlealt = 'default', $other='')
* Show logo editer/modifier fiche
*
* @param string $titlealt Text on alt and title of image. Alt only if param notitle is set to 1. If text is "TextA:TextB", use Text A on alt and Text B on title.
* @param float $float Si il faut y mettre le style "float: right"
* @param integer $float Si il faut y mettre le style "float: right"
* @param string $other Add more attributes on img
* @return string Return tag img
*/
@ -2133,7 +2134,7 @@ function img_edit($titlealt = 'default', $float = 0, $other = '')
* Show logo view card
*
* @param string $titlealt Text on alt and title of image. Alt only if param notitle is set to 1. If text is "TextA:TextB", use Text A on alt and Text B on title.
* @param float $float Si il faut y mettre le style "float: right"
* @param integer $float Si il faut y mettre le style "float: right"
* @param string $other Add more attributes on img
* @return string Return tag img
*/
@ -2279,15 +2280,16 @@ function img_previous($titlealt = 'default')
*
* @param string $titlealt Text on alt and title of image. Alt only if param notitle is set to 1. If text is "TextA:TextB", use Text A on alt and Text B on title.
* @param int $selected Selected
* @param string $moreclass Add more CSS classes
* @return string Return img tag
*/
function img_down($titlealt = 'default', $selected = 0)
function img_down($titlealt = 'default', $selected = 0, $moreclass='')
{
global $conf, $langs;
if ($titlealt == 'default') $titlealt = $langs->trans('Down');
return img_picto($titlealt, ($selected ? '1downarrow_selected.png' : '1downarrow.png'), 'class="imgdown"');
return img_picto($titlealt, ($selected ? '1downarrow_selected.png' : '1downarrow.png'), 'class="imgdown'.($moreclass?" ".$moreclass:"").'"');
}
/**
@ -2295,15 +2297,16 @@ function img_down($titlealt = 'default', $selected = 0)
*
* @param string $titlealt Text on alt and title of image. Alt only if param notitle is set to 1. If text is "TextA:TextB", use Text A on alt and Text B on title.
* @param int $selected Selected
* @param string $moreclass Add more CSS classes
* @return string Return img tag
*/
function img_up($titlealt = 'default', $selected = 0)
function img_up($titlealt = 'default', $selected = 0, $moreclass='')
{
global $conf, $langs;
if ($titlealt == 'default') $titlealt = $langs->trans('Up');
return img_picto($titlealt, ($selected ? '1uparrow_selected.png' : '1uparrow.png'), 'class="imgup"');
return img_picto($titlealt, ($selected ? '1uparrow_selected.png' : '1uparrow.png'), 'class="imgup'.($moreclass?" ".$moreclass:"").'"');
}
/**
@ -2446,7 +2449,7 @@ function img_searchclear($titlealt = 'default', $other = '')
* Show information for admin users
*
* @param string $text Text info
* @param string $infoonimgalt Info is shown only on alt of star picto, otherwise it is show on output after the star picto
* @param integer $infoonimgalt Info is shown only on alt of star picto, otherwise it is show on output after the star picto
* @param int $nodiv No div
* @return string String with info text
*/
@ -2495,7 +2498,7 @@ function dol_print_error($db='',$error='')
if ($_SERVER['DOCUMENT_ROOT']) // Mode web
{
$out.=$langs->trans("DolibarrHasDetectedError").".<br>\n";
if (! empty($conf->global->MAIN_FEATURES_LEVEL)) $out.="You use an experimental level of features, so please do NOT report any bugs, except if problem is confirmed moving option MAIN_FEATURES_LEVEL back to 0.<br>\n";
if (! empty($conf->global->MAIN_FEATURES_LEVEL)) $out.="You use an experimental or develop level of features, so please do NOT report any bugs, except if problem is confirmed moving option MAIN_FEATURES_LEVEL back to 0.<br>\n";
$out.=$langs->trans("InformationToHelpDiagnose").":<br>\n";
$out.="<b>".$langs->trans("Date").":</b> ".dol_print_date(time(),'dayhourlog')."<br>\n";
@ -2621,7 +2624,7 @@ function print_liste_field_titre($name, $file="", $field="", $begin="", $morepar
* Get title line of an array
*
* @param string $name Label of field
* @param int $thead 0=To use with standard table forat, 1=To use inside <thead><tr>, 2=To use with <div>
* @param int $thead 0=To use with standard table format, 1=To use inside <thead><tr>, 2=To use with <div>
* @param string $file Url used when we click on sort picto
* @param string $field Field to use for new sorting. Empty if this field is not sortable.
* @param string $begin ("" by defaut)
@ -2866,7 +2869,7 @@ function print_barre_liste($titre, $page, $file, $options='', $sortfield='', $so
* @param int $page Number of page
* @param string $file Lien
* @param string $options Autres parametres d'url a propager dans les liens ("" par defaut)
* @param boolean|int $nextpage Do we show a next page button
* @param integer $nextpage Do we show a next page button
* @param string $betweenarrows HTML Content to show between arrows
* @return void
*/
@ -2923,7 +2926,7 @@ function vatrate($rate,$addpercent=false,$info_bits=0,$usestarfornpr=0)
* Function used into PDF and HTML pages
*
* @param float $amount Amount to format
* @param string $form Type of format, HTML or not (not by default)
* @param integer $form Type of format, HTML or not (not by default)
* @param Translate $outlangs Object langs for output
* @param int $trunc 1=Truncate if there is too much decimals (default), 0=Does not truncate
* @param int $rounding Minimum number of decimal to show. If 0, no change, if -1, we use min($conf->global->MAIN_MAX_DECIMALS_UNIT,$conf->global->MAIN_MAX_DECIMALS_TOTAL)
@ -3622,7 +3625,7 @@ function get_default_npr($thirdparty_seller, $thirdparty_buyer, $idprod=0, $idpr
* @param Societe $thirdparty_buyer Thirdparty buyer
* @param int $local Localtax to process (1 or 2)
* @param int $idprod Id product
* @return float localtax, -1 si ne peut etre determine
* @return integer localtax, -1 si ne peut etre determine
* @see get_default_tva, get_default_npr
*/
function get_default_localtax($thirdparty_seller, $thirdparty_buyer, $local, $idprod=0)
@ -3664,7 +3667,7 @@ function get_default_localtax($thirdparty_seller, $thirdparty_buyer, $local, $id
* Return yes or no in current language
*
* @param string $yesno Value to test (1, 'yes', 'true' or 0, 'no', 'false')
* @param string $case 1=Yes/No, 0=yes/no, 2=Disabled checkbox, 3=Disabled checkbox + Yes/No
* @param integer $case 1=Yes/No, 0=yes/no, 2=Disabled checkbox, 3=Disabled checkbox + Yes/No
* @param int $color 0=texte only, 1=Text is formated with a color font style ('ok' or 'error'), 2=Text is formated with 'ok' color.
* @return string HTML string
*/
@ -3805,7 +3808,7 @@ function picto_required()
* Clean a string from all HTML tags and entities
*
* @param string $StringHtml String to clean
* @param string $removelinefeed Replace also all lines feeds by a space, otherwise only last one are removed
* @param integer $removelinefeed Replace also all lines feeds by a space, otherwise only last one are removed
* @param string $pagecodeto Encoding of input/output string
* @return string String cleaned
*
@ -3926,9 +3929,7 @@ function dol_htmlcleanlastbr($stringtodecode)
*/
function dol_html_entity_decode($a,$b,$c='UTF-8')
{
// We use @ to avoid warning on PHP4 that does not support entity decoding to UTF8;
$ret=@html_entity_decode($a,$b,$c);
return $ret;
return html_entity_decode($a,$b,$c);
}
/**
@ -4183,7 +4184,7 @@ function print_date_range($date_start,$date_end,$format = '',$outputlangs='')
* @param int $date_end End date
* @param string $format Output format
* @param Translate $outputlangs Output language
* @param string $withparenthesis 1=Add parenthesis, 0=non parenthesis
* @param integer $withparenthesis 1=Add parenthesis, 0=non parenthesis
* @return string String
*/
function get_date_range($date_start,$date_end,$format = '',$outputlangs='', $withparenthesis=1)
@ -4845,7 +4846,7 @@ function printCommonFooter($zone='private')
print 'MAIN_OPTIMIZE_SPEED='.(isset($conf->global->MAIN_OPTIMIZE_SPEED)?$conf->global->MAIN_OPTIMIZE_SPEED:'off');
if ($micro_start_time)
{
$micro_end_time=dol_microtime_float(true);
$micro_end_time=dol_microtime_float();
print ' - Build time: '.ceil(1000*($micro_end_time-$micro_start_time)).' ms';
}
if (function_exists("memory_get_usage"))
@ -4952,7 +4953,7 @@ function dol_getmypid()
* @param string $value The value to look for.
* If param $numeric is 0, can contains several keywords separated with a space, like "keyword1 keyword2" = We want record field like keyword1 and field like keyword2
* If param $numeric is 1, can contains an operator <>= like "<10" or ">=100.5 < 1000"
* @param string $numeric 0=value is list of keywords, 1=value is a numeric test
* @param integer $numeric 0=value is list of keywords, 1=value is a numeric test
* @return string $res The statement to append to the SQL query
*/
function natural_search($fields, $value, $numeric=0)

View File

@ -1885,7 +1885,7 @@ function colorArrayToHex($arraycolor,$colorifnotfound='888888')
function colorStringToArray($stringcolor,$colorifnotfound=array(88,88,88))
{
if (is_array($stringcolor)) return $stringcolor; // If already into correct output format, we return as is
$tmp=preg_match('/^([0-9a-fA-F][0-9a-fA-F])([0-9a-fA-F][0-9a-fA-F])([0-9a-fA-F][0-9a-fA-F])$/',$stringcolor,$reg);
$tmp=preg_match('/^#?([0-9a-fA-F][0-9a-fA-F])([0-9a-fA-F][0-9a-fA-F])([0-9a-fA-F][0-9a-fA-F])$/',$stringcolor,$reg);
if (! $tmp)
{
$tmp=explode(',',$stringcolor);

View File

@ -0,0 +1,77 @@
<?php
/* Copyright (C) 2014 Alexandre Spangaro <alexandre.spangaro@gmail.com>
* Copyright (C) 2015 Frederic France <frederic.france@free.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 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/core/lib/loan.lib.php
* \ingroup loan
* \brief Library for loan module
*/
/**
* Prepare array with list of tabs
*
* @param Object $object Object related to tabs
* @return array Array of tabs to show
*/
function loan_prepare_head($object)
{
global $langs, $conf;
$tab = 0;
$head = array();
$head[$tab][0] = DOL_URL_ROOT.'/loan/card.php?id='.$object->id;
$head[$tab][1] = $langs->trans('Card');
$head[$tab][2] = 'card';
$tab++;
if (empty($conf->global->MAIN_DISABLE_NOTES_TAB))
{
$nbNote = (empty($object->note_private)?0:1)+(empty($object->note_public)?0:1);
$head[$tab][0] = DOL_URL_ROOT."/loan/note.php?id=".$object->id;
$head[$tab][1] = $langs->trans("Notes");
if($nbNote > 0) $head[$tab][1].= ' <span class="badge">'.$nbNote.'</span>';
$head[$tab][2] = 'note';
$tab++;
}
// Show more tabs from modules
// Entries must be declared in modules descriptor with line
// $this->tabs = array('entity:+tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to add new tab
// $this->tabs = array('entity:-tabname); to remove a tab
complete_head_from_modules($conf, $langs, $object, $head, $tab,'loan');
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
$upload_dir = $conf->loan->dir_output . "/" . dol_sanitizeFileName($object->ref);
$nbFiles = count(dol_dir_list($upload_dir,'files',0,'','(\.meta|_preview\.png)$'));
$head[$tab][0] = DOL_URL_ROOT.'/loan/document.php?id='.$object->id;
$head[$tab][1] = $langs->trans("Documents");
if($nbFiles > 0) $head[$tab][1].= ' ('.$nbFiles.')';
$head[$tab][2] = 'documents';
$tab++;
$head[$tab][0] = DOL_URL_ROOT.'/loan/info.php?id='.$object->id;
$head[$tab][1] = $langs->trans("Info");
$head[$tab][2] = 'info';
$tab++;
complete_head_from_modules($conf,$langs,$object,$head,$tab,'loan','remove');
return $head;
}

View File

@ -969,7 +969,7 @@ function pdf_writeLinkedObjects(&$pdf,$object,$outputlangs,$posx,$posy,$w,$h,$al
* @param int $hideref Hide reference
* @param int $hidedesc Hide description
* @param int $issupplierline Is it a line for a supplier object ?
* @return void
* @return string|null
*/
function pdf_writelinedesc(&$pdf,$object,$i,$outputlangs,$w,$h,$posx,$posy,$hideref=0,$hidedesc=0,$issupplierline=0)
{
@ -1187,7 +1187,7 @@ function pdf_getlinedesc($object,$i,$outputlangs,$hideref=0,$hidedesc=0,$issuppl
* @param int $i Current line number
* @param Translate $outputlangs Object langs for output
* @param int $hidedetails Hide details (0=no, 1=yes, 2=just special lines)
* @return void
* @return null|string
*/
function pdf_getlinenum($object,$i,$outputlangs,$hidedetails=0)
{
@ -1213,7 +1213,7 @@ function pdf_getlinenum($object,$i,$outputlangs,$hidedetails=0)
* @param int $i Current line number
* @param Translate $outputlangs Object langs for output
* @param int $hidedetails Hide details (0=no, 1=yes, 2=just special lines)
* @return void
* @return null|string
*/
function pdf_getlineref($object,$i,$outputlangs,$hidedetails=0)
{
@ -1238,7 +1238,7 @@ function pdf_getlineref($object,$i,$outputlangs,$hidedetails=0)
* @param int $i Current line number
* @param Translate $outputlangs Object langs for output
* @param int $hidedetails Hide details (0=no, 1=yes, 2=just special lines)
* @return void
* @return null|string
*/
function pdf_getlineref_supplier($object,$i,$outputlangs,$hidedetails=0)
{
@ -1597,7 +1597,7 @@ function pdf_getlinetotalwithtax($object,$i,$outputlangs,$hidedetails=0)
* @param Object $object Object
* @param string $type Type
* @param Translate $outputlangs Object langs for output
* @return void
* @return integer
*/
function pdf_getTotalQty($object,$type,$outputlangs)
{

Some files were not shown because too many files have changed in this diff Show More