Merge pull request #5 from Dolibarr/develop
Merge pull request #5 from Dolibarr/develop
This commit is contained in:
commit
dcb0d47534
@ -180,8 +180,38 @@ tools:
|
||||
- 'htdocs/includes/*'
|
||||
paths: { }
|
||||
|
||||
php_changetracking:
|
||||
enabled: false
|
||||
bug_patterns:
|
||||
- '\bfix(?:es|ed)?\b'
|
||||
feature_patterns:
|
||||
- '\badd(?:s|ed)?\b'
|
||||
- '\bimplement(?:s|ed)?\b'
|
||||
filter:
|
||||
excluded_paths:
|
||||
- 'build/*'
|
||||
- 'dev/*'
|
||||
- 'doc/*'
|
||||
- 'test/*'
|
||||
- 'htdocs/includes/*'
|
||||
paths: { }
|
||||
|
||||
# Coding-Style / Bug Detection
|
||||
js_hint: false
|
||||
js_hint:
|
||||
enabled: false
|
||||
use_native_config: true
|
||||
extensions:
|
||||
- js
|
||||
filter:
|
||||
excluded_paths:
|
||||
- 'build/*'
|
||||
- 'dev/*'
|
||||
- 'doc/*'
|
||||
- 'test/*'
|
||||
- 'htdocs/includes/*'
|
||||
paths: { }
|
||||
config: { }
|
||||
path_configs: { }
|
||||
|
||||
|
||||
before_commands: { }
|
||||
|
||||
10
.travis.yml
10
.travis.yml
@ -53,12 +53,14 @@ before_script:
|
||||
- sh -c "if [ '$PHPV' = '5.3' ]; then echo 'zend_extension_ts = xdebug.so' >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini; fi"
|
||||
- sh -c "if [ '$PHPV' = '5.4' ]; then echo 'zend_extension_ts = xdebug.so' >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini; fi"
|
||||
- cat ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini
|
||||
- echo Mysql version
|
||||
- mysql --version
|
||||
- echo Init database
|
||||
- sh -c "if [ '$DB' = 'pgsql' ]; then psql -c 'DROP DATABASE IF EXISTS myapp_test;' -U postgres; fi"
|
||||
- sh -c "if [ '$DB' = 'pgsql' ]; then psql -c 'CREATE DATABASE myapp_test;' -U postgres; fi"
|
||||
- sh -c "if [ '$DB' = 'mysql' ]; then mysql -e 'DROP DATABASE IF EXISTS myapp_test;'; fi"
|
||||
- sh -c "if [ '$DB' = 'mysql' ]; then mysql -e 'CREATE DATABASE IF NOT EXISTS myapp_test;'; fi"
|
||||
- sh -c "if [ '$DB' = 'mysql' ]; then mysql -D myapp_test < $(pwd)/dev/initdata/mysqldump_dolibarr_3.4.0.sql; fi"
|
||||
- sh -c "if [ '$DB' = 'mysql' ]; then mysql -D myapp_test < $(pwd)/dev/initdata/mysqldump_dolibarr_3.5.0.sql; fi"
|
||||
- echo Create config file htdocs/conf/conf.php
|
||||
- echo '<?php ' > htdocs/conf/conf.php
|
||||
- sh -c "if [ '$DB' = 'pgsql' ]; then echo '$'dolibarr_main_db_type=\'pgsql\'';' >> htdocs/conf/conf.php; fi"
|
||||
@ -88,12 +90,12 @@ 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.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 upgrade.log
|
||||
# - cat upgrade360370.log
|
||||
- php upgrade2.php 3.6.0 3.7.0 >> upgrade2.log
|
||||
# - cat upgrade2.log
|
||||
- cd ../..
|
||||
|
||||
@ -26,7 +26,7 @@ TCPDF 6.0.093 LGPL-3+ Yes
|
||||
JS libraries:
|
||||
jQuery 1.8.2 MIT License Yes JS library
|
||||
jQuery UI 1.9.1 GPL and MIT License Yes JS library plugin UI
|
||||
jQuery multiple-select 1.1.0 MIT License Yes JS library plugin for sexier multiselect
|
||||
jQuery select2 3.5.2 GPL and Apache License Yes JS library plugin for sexier multiselect
|
||||
jQuery blockUI 2.43 GPL and MIT License Yes JS library plugin blockUI (to use ajax popups)
|
||||
jQuery Colorpicker 1.1 MIT License Yes JS library for color picker for a defined list of colors
|
||||
jQuery DataTables 1.9.4 BSD Yes JS library for tables output
|
||||
|
||||
18
ChangeLog
18
ChangeLog
@ -5,6 +5,8 @@ English Dolibarr ChangeLog
|
||||
|
||||
***** ChangeLog for 3.7 compared to 3.6.* *****
|
||||
For users:
|
||||
- New: Match other auth system: Login can be done entering login or user
|
||||
email (this open the road for SSO).
|
||||
- New: Agenda export by project #1967.
|
||||
- New: Increase length of thirdparty to 128 chars.
|
||||
- New: "Is Order shippable" icon #1975.
|
||||
@ -99,6 +101,7 @@ For users:
|
||||
- Fix: [ bug #1506, #1507 ] ECM trigger error problem
|
||||
- Fix: [ bug #1469 ] Triggers CONTACT_MODIFY and CONTACT_DELETE duplicates error message
|
||||
- Fix: [ bug #1537 ] Difference between societe.nom and adherent.societe.
|
||||
- Fix: [ bug #1535 ] Supplier invoice Extrafields are not shown
|
||||
|
||||
For users, new experimental module (need to set feature level of instance to experimental to see them):
|
||||
- New: Module Accounting Expert to manage accountancy
|
||||
@ -163,18 +166,20 @@ Dolibarr better:
|
||||
|
||||
|
||||
***** ChangeLog for 3.6.2 compared to 3.6.1 *****
|
||||
- Fix: fix ErrorBadValueForParamNotAString error message in price customer multiprice
|
||||
- Fix: bug 1588 : relative discount
|
||||
- Fix: fix ErrorBadValueForParamNotAString error message in price customer multiprice.
|
||||
- Fix: bug 1588 : relative discount.
|
||||
- Fix: label of input method not tranlated.
|
||||
- Fix: box of customer and propsects were not correctly disabled.
|
||||
- Fix: right and error management #1961
|
||||
- Fix: Fix Error when trying to clone an Order #1943
|
||||
- Fix: [ bug #1618 ] PHP Error thrown when saving a barcode
|
||||
- Fix: Civility & birthdate wasn't save into adherent module.
|
||||
- Fix: webservice Thirdparty parameter lastname for invidual creation is now lastname and not ref
|
||||
- Fix: Chars - is no more allowed into value for code for extra fields.
|
||||
( Fix: [ bug #1622 ] Requesting holiday than spans across two years cause high CPU usage by Apache
|
||||
|
||||
***** ChangeLog for 3.6.1 compared to 3.6.* *****
|
||||
For users:
|
||||
- Fix: Can upload files on services.
|
||||
- Fix: sql errors on updat fichinter.
|
||||
- Fix: sql errors on update fichinter.
|
||||
- Fix: debian script syntax error.
|
||||
- Fix: error "menu param is not inside list" into pos module.
|
||||
- Fix: Salary payments are not reflected on the reporting sheets.
|
||||
@ -310,6 +315,9 @@ removed. You must now use the 6 parameters way. See file modMyModule.class.php f
|
||||
- Remove add_photo_web() that is ot used anymore by core code.
|
||||
|
||||
|
||||
***** ChangeLog for 3.5.6 compared to 3.5.5 *****
|
||||
Fix: Avoid missing class error for fetch_thirdparty method #1973
|
||||
|
||||
***** ChangeLog for 3.5.5 compared to 3.5.4 *****
|
||||
Fix: Holiday module was broken. Initializaion of amount of holidays failed.
|
||||
Fix: [ bug #1523 ] suite bug #1334 : filtre et ordre de tri conjoints ne s'appliquent pas.
|
||||
|
||||
@ -446,6 +446,7 @@ if ($nboftargetok) {
|
||||
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/public/test`;
|
||||
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/teclib*`;
|
||||
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/themes/oblyon*`;
|
||||
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/themes/eldy/*.new`;
|
||||
$ret=`rm -fr $BUILDROOT/$PROJECT/test`;
|
||||
$ret=`rm -fr $BUILDROOT/$PROJECT/Thumbs.db $BUILDROOT/$PROJECT/*/Thumbs.db $BUILDROOT/$PROJECT/*/*/Thumbs.db $BUILDROOT/$PROJECT/*/*/*/Thumbs.db $BUILDROOT/$PROJECT/*/*/*/*/Thumbs.db`;
|
||||
$ret=`rm -f $BUILDROOT/$PROJECT/.cvsignore $BUILDROOT/$PROJECT/*/.cvsignore $BUILDROOT/$PROJECT/*/*/.cvsignore $BUILDROOT/$PROJECT/*/*/*/.cvsignore $BUILDROOT/$PROJECT/*/*/*/*/.cvsignore $BUILDROOT/$PROJECT/*/*/*/*/*/.cvsignore $BUILDROOT/$PROJECT/*/*/*/*/*/*/.cvsignore`;
|
||||
|
||||
@ -108,7 +108,7 @@
|
||||
<rule ref="Generic.Metrics.CyclomaticComplexity">
|
||||
<properties>
|
||||
<property name="complexity" value="80" />
|
||||
<property name="absoluteComplexity" value="200" />
|
||||
<property name="absoluteComplexity" value="250" />
|
||||
</properties>
|
||||
</rule>
|
||||
<rule ref="Generic.Metrics.NestingLevel">
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
<?php
|
||||
/* Copyright (C) 2007-2012 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2014 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) ---Put here your own copyright and developer email---
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
@ -79,7 +80,7 @@ class Skeleton_Class extends CommonObject
|
||||
// Put here code to add control on parameters values
|
||||
|
||||
// Insert request
|
||||
$sql = "INSERT INTO ".MAIN_DB_PREFIX."mytable(";
|
||||
$sql = "INSERT INTO ".MAIN_DB_PREFIX.$this->table_element."(";
|
||||
$sql.= " field1,";
|
||||
$sql.= " field2";
|
||||
//...
|
||||
@ -91,13 +92,13 @@ class Skeleton_Class extends CommonObject
|
||||
|
||||
$this->db->begin();
|
||||
|
||||
dol_syslog(get_class($this)."::create", LOG_DEBUG);
|
||||
dol_syslog(__METHOD__, LOG_DEBUG);
|
||||
$resql=$this->db->query($sql);
|
||||
if (! $resql) { $error++; $this->errors[]="Error ".$this->db->lasterror(); }
|
||||
|
||||
if (! $error)
|
||||
{
|
||||
$this->id = $this->db->last_insert_id(MAIN_DB_PREFIX."mytable");
|
||||
$this->id = $this->db->last_insert_id(MAIN_DB_PREFIX.$this->table_element);
|
||||
|
||||
if (! $notrigger)
|
||||
{
|
||||
@ -116,7 +117,7 @@ class Skeleton_Class extends CommonObject
|
||||
{
|
||||
foreach($this->errors as $errmsg)
|
||||
{
|
||||
dol_syslog(get_class($this)."::create ".$errmsg, LOG_ERR);
|
||||
dol_syslog(__METHOD__." ".$errmsg, LOG_ERR);
|
||||
$this->error.=($this->error?', '.$errmsg:$errmsg);
|
||||
}
|
||||
$this->db->rollback();
|
||||
@ -145,7 +146,7 @@ class Skeleton_Class extends CommonObject
|
||||
$sql.= " t.field1,";
|
||||
$sql.= " t.field2";
|
||||
//...
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."mytable as t";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX.$this->table_element." as t";
|
||||
if ($ref) $sql.= " WHERE t.ref = '".$ref."'";
|
||||
else $sql.= " WHERE t.rowid = ".$id;
|
||||
|
||||
@ -181,7 +182,7 @@ class Skeleton_Class extends CommonObject
|
||||
* @param int $notrigger 0=launch triggers after, 1=disable triggers
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*/
|
||||
function update($user=0, $notrigger=0)
|
||||
function update($user, $notrigger=0)
|
||||
{
|
||||
global $conf, $langs;
|
||||
$error=0;
|
||||
@ -195,7 +196,7 @@ class Skeleton_Class extends CommonObject
|
||||
// Put here code to add a control on parameters values
|
||||
|
||||
// Update request
|
||||
$sql = "UPDATE ".MAIN_DB_PREFIX."mytable SET";
|
||||
$sql = "UPDATE ".MAIN_DB_PREFIX.$this->table_element." SET";
|
||||
$sql.= " field1=".(isset($this->field1)?"'".$this->db->escape($this->field1)."'":"null").",";
|
||||
$sql.= " field2=".(isset($this->field2)?"'".$this->db->escape($this->field2)."'":"null")."";
|
||||
//...
|
||||
@ -203,7 +204,7 @@ class Skeleton_Class extends CommonObject
|
||||
|
||||
$this->db->begin();
|
||||
|
||||
dol_syslog(get_class($this)."::update");
|
||||
dol_syslog(__METHOD__);
|
||||
$resql = $this->db->query($sql);
|
||||
if (! $resql) { $error++; $this->errors[]="Error ".$this->db->lasterror(); }
|
||||
|
||||
@ -226,7 +227,7 @@ class Skeleton_Class extends CommonObject
|
||||
{
|
||||
foreach($this->errors as $errmsg)
|
||||
{
|
||||
dol_syslog(get_class($this)."::update ".$errmsg, LOG_ERR);
|
||||
dol_syslog(__METHOD__." ".$errmsg, LOG_ERR);
|
||||
$this->error.=($this->error?', '.$errmsg:$errmsg);
|
||||
}
|
||||
$this->db->rollback();
|
||||
@ -270,10 +271,10 @@ class Skeleton_Class extends CommonObject
|
||||
|
||||
if (! $error)
|
||||
{
|
||||
$sql = "DELETE FROM ".MAIN_DB_PREFIX."mytable";
|
||||
$sql = "DELETE FROM ".MAIN_DB_PREFIX.$this->table_element;
|
||||
$sql.= " WHERE rowid=".$this->id;
|
||||
|
||||
dol_syslog(get_class($this)."::delete");
|
||||
dol_syslog(__METHOD__);
|
||||
$resql = $this->db->query($sql);
|
||||
if (! $resql) { $error++; $this->errors[]="Error ".$this->db->lasterror(); }
|
||||
}
|
||||
@ -283,7 +284,7 @@ class Skeleton_Class extends CommonObject
|
||||
{
|
||||
foreach($this->errors as $errmsg)
|
||||
{
|
||||
dol_syslog(get_class($this)."::delete ".$errmsg, LOG_ERR);
|
||||
dol_syslog(__METHOD__." ".$errmsg, LOG_ERR);
|
||||
$this->error.=($this->error?', '.$errmsg:$errmsg);
|
||||
}
|
||||
$this->db->rollback();
|
||||
|
||||
@ -37,6 +37,11 @@ $mesg = '';
|
||||
$action = GETPOST('action');
|
||||
$id = GETPOST('id', 'int');
|
||||
$rowid = GETPOST('rowid', 'int');
|
||||
$search_account = GETPOST("search_account");
|
||||
$search_label = GETPOST("search_label");
|
||||
$search_accountparent = GETPOST("search_accountparent");
|
||||
$search_pcgtype = GETPOST("search_pcgtype");
|
||||
$search_pcgsubtype = GETPOST("search_pcgsubtype");
|
||||
|
||||
// Security check
|
||||
if (!$user->admin)
|
||||
@ -83,6 +88,15 @@ if ($action == 'disable') {
|
||||
}
|
||||
}
|
||||
|
||||
if (GETPOST("button_removefilter"))
|
||||
{
|
||||
$search_account="";
|
||||
$search_label="";
|
||||
$search_accountparent="";
|
||||
$search_pcgtype="";
|
||||
$search_pcgsubtype="";
|
||||
}
|
||||
|
||||
/*
|
||||
* View
|
||||
*
|
||||
@ -96,20 +110,20 @@ $sql .= " FROM " . MAIN_DB_PREFIX . "accountingaccount as aa, " . MAIN_DB_PREFIX
|
||||
$sql .= " WHERE aa.fk_pcg_version = asy.pcg_version";
|
||||
$sql .= " AND asy.rowid = " . $pcgver;
|
||||
|
||||
if (strlen(trim($_GET["search_account"]))) {
|
||||
$sql .= " AND aa.account_number like '%" . $_GET["search_account"] . "%'";
|
||||
if (strlen(trim($search_account))) {
|
||||
$sql .= " AND aa.account_number like '%" . $search_account . "%'";
|
||||
}
|
||||
if (strlen(trim($_GET["search_label"]))) {
|
||||
$sql .= " AND aa.label like '%" . $_GET["search_label"] . "%'";
|
||||
if (strlen(trim($search_label))) {
|
||||
$sql .= " AND aa.label like '%" . $search_label . "%'";
|
||||
}
|
||||
if (strlen(trim($_GET["search_accountparent"]))) {
|
||||
$sql .= " AND aa.account_parent like '%" . $_GET["search_accountparent"] . "%'";
|
||||
if (strlen(trim($search_accountparent))) {
|
||||
$sql .= " AND aa.account_parent like '%" . $search_accountparent . "%'";
|
||||
}
|
||||
if (strlen(trim($_GET["search_pcgtype"]))) {
|
||||
$sql .= " AND aa.pcg_type like '%" . $_GET["search_pcgtype"] . "%'";
|
||||
if (strlen(trim($search_pcgtype))) {
|
||||
$sql .= " AND aa.pcg_type like '%" . $search_pcgtype . "%'";
|
||||
}
|
||||
if (strlen(trim($_GET["search_pcgsubtype"]))) {
|
||||
$sql .= " AND aa.pcg_subtype like '%" . $_GET["search_pcgsubtype"] . "%'";
|
||||
if (strlen(trim($search_pcgsubtype))) {
|
||||
$sql .= " AND aa.pcg_subtype like '%" . $search_pcgsubtype . "%'";
|
||||
}
|
||||
|
||||
$sql .= $db->order($sortfield, $sortorder);
|
||||
@ -141,18 +155,20 @@ if ($result) {
|
||||
print_liste_field_titre($langs->trans("Pcgtype"), $_SERVER["PHP_SELF"], "aa.pcg_type", "", $param, "", $sortfield, $sortorder);
|
||||
print_liste_field_titre($langs->trans("Pcgsubtype"), $_SERVER["PHP_SELF"], "aa.pcg_subtype", "", $param, "", $sortfield, $sortorder);
|
||||
print_liste_field_titre($langs->trans("Active"), $_SERVER["PHP_SELF"], "aa.active", "", $param, "", $sortfield, $sortorder);
|
||||
print_liste_field_titre(" ");
|
||||
print_liste_field_titre($langs->trans("Action"),$_SERVER["PHP_SELF"],"",$param,"",'width="60" align="center"',$sortfield,$sortorder);
|
||||
print '</tr>';
|
||||
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td class="liste_titre"><input type="text" class="flat" size="15" name="search_account" value="' . GETPOST("search_account") . '"></td>';
|
||||
print '<td class="liste_titre"><input type="text" class="flat" size="15" name="search_label" value="' . GETPOST("search_label") . '"></td>';
|
||||
print '<td class="liste_titre"><input type="text" class="flat" size="15" name="search_accountparent" value="' . GETPOST("search_accountparent") . '"></td>';
|
||||
print '<td class="liste_titre"><input type="text" class="flat" size="15" name="search_pcgtype" value="' . GETPOST("search_pcgtype") . '"></td>';
|
||||
print '<td class="liste_titre"><input type="text" class="flat" size="15" name="search_pcgsubtype" value="' . GETPOST("search_pcgsubtype") . '"></td>';
|
||||
print '<td class="liste_titre"><input type="text" class="flat" size="15" name="search_account" value="' . $search_account . '"></td>';
|
||||
print '<td class="liste_titre"><input type="text" class="flat" size="15" name="search_label" value="' . $search_label . '"></td>';
|
||||
print '<td class="liste_titre"><input type="text" class="flat" size="15" name="search_accountparent" value="' . $search_accountparent . '"></td>';
|
||||
print '<td class="liste_titre"><input type="text" class="flat" size="15" name="search_pcgtype" value="' . $search_pcgtype . '"></td>';
|
||||
print '<td class="liste_titre"><input type="text" class="flat" size="15" name="search_pcgsubtype" value="' . $search_pcgsubtype . '"></td>';
|
||||
print '<td class="liste_titre"> </td>';
|
||||
print '<td class="liste_titre" align="right">';
|
||||
print '<input type="image" class="liste_titre" src="' . DOL_URL_ROOT . '/theme/' . $conf->theme . '/img/search.png" name="button_search" value="' . dol_escape_htmltag($langs->trans("Search")) . '" title="' . dol_escape_htmltag($langs->trans("Search")) . '">';
|
||||
print '<td align="right" colspan="2" class="liste_titre">';
|
||||
print '<input type="image" class="liste_titre" src="'.img_picto($langs->trans("Search"),'search.png','','',1).'" name="button_search" value="'.dol_escape_htmltag($langs->trans("Search")).'" title="'.dol_escape_htmltag($langs->trans("Search")).'">';
|
||||
print ' ';
|
||||
print '<input type="image" class="liste_titre" src="'.img_picto($langs->trans("Search"),'searchclear.png','','',1).'" name="button_removefilter" value="'.dol_escape_htmltag($langs->trans("RemoveFilter")).'" title="'.dol_escape_htmltag($langs->trans("RemoveFilter")).'">';
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
|
||||
@ -180,11 +196,13 @@ if ($result) {
|
||||
}
|
||||
print '</td>';
|
||||
|
||||
print '<td>';
|
||||
// Action
|
||||
print '<td align="center">';
|
||||
if ($user->admin) {
|
||||
print '<a href="./card.php?action=update&id=' . $obj->rowid . '">';
|
||||
print img_edit();
|
||||
print '</a> ';
|
||||
print '</a>';
|
||||
print ' ';
|
||||
print '<a href="./card.php?action=delete&id=' . $obj->rowid . '">';
|
||||
print img_delete();
|
||||
print '</a>';
|
||||
|
||||
@ -181,11 +181,6 @@ else if ($id)
|
||||
|
||||
if ($action == 'update')
|
||||
{
|
||||
// WYSIWYG Editor
|
||||
$htmlacc = new FormVentilation($db);
|
||||
|
||||
require_once DOL_DOCUMENT_ROOT . '/core/class/doleditor.class.php';
|
||||
|
||||
$soc = new Societe($db);
|
||||
if ($object->socid) {
|
||||
$soc->fetch($object->socid);
|
||||
|
||||
@ -26,7 +26,7 @@
|
||||
*/
|
||||
|
||||
require '../../main.inc.php';
|
||||
|
||||
|
||||
// Class
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/accounting.lib.php';
|
||||
@ -44,7 +44,7 @@ $action = GETPOST('action', 'alpha');
|
||||
|
||||
// Other parameters ACCOUNTING_*
|
||||
$list = array (
|
||||
'ACCOUNTING_SEPARATORCSV'
|
||||
'ACCOUNTING_SEPARATORCSV'
|
||||
);
|
||||
|
||||
/*
|
||||
@ -52,26 +52,26 @@ $list = array (
|
||||
*/
|
||||
if ($action == 'update') {
|
||||
$error = 0;
|
||||
|
||||
|
||||
$modelcsv = GETPOST('modelcsv', 'int');
|
||||
|
||||
|
||||
if (! empty($modelcsv)) {
|
||||
|
||||
|
||||
if (! dolibarr_set_const($db, 'ACCOUNTING_MODELCSV', $modelcsv, 'chaine', 0, '', $conf->entity)) {
|
||||
$error ++;
|
||||
}
|
||||
} else {
|
||||
$error ++;
|
||||
}
|
||||
|
||||
|
||||
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 {
|
||||
@ -90,7 +90,7 @@ $form = new Form($db);
|
||||
$linkback='<a href="'.DOL_URL_ROOT.'/admin/modules.php">'.$langs->trans("BackToModuleList").'</a>';
|
||||
print_fiche_titre($langs->trans('ConfigAccountingExpert'),$linkback,'setup');
|
||||
|
||||
$head = admin_accounting_prepare_head(null);
|
||||
$head = admin_accounting_prepare_head();
|
||||
|
||||
dol_fiche_head($head, 'export', $langs->trans("Configuration"), 0, 'cron');
|
||||
|
||||
@ -142,13 +142,13 @@ if ($num) {
|
||||
|
||||
foreach ( $list as $key ) {
|
||||
$var = ! $var;
|
||||
|
||||
|
||||
print '<tr ' . $bc[$var] . ' class="value">';
|
||||
|
||||
|
||||
// Param
|
||||
$label = $langs->trans($key);
|
||||
print '<td>' . $label . '</td>';
|
||||
|
||||
|
||||
// Value
|
||||
print '<td>';
|
||||
print '<input type="text" size="20" name="' . $key . '" value="' . $conf->global->$key . '">';
|
||||
|
||||
@ -59,10 +59,10 @@ $max=100;
|
||||
|
||||
$form = new Form($db);
|
||||
|
||||
llxHeader('',$title);
|
||||
|
||||
$title = $langs->trans('FiscalYears');
|
||||
|
||||
llxHeader('',$title,LOG_ERR);
|
||||
|
||||
print_fiche_titre($langs->trans('FiscalYears'));
|
||||
|
||||
$sql = "SELECT f.rowid, f.label, f.date_start, f.date_end, f.statut, f.entity";
|
||||
|
||||
@ -35,8 +35,6 @@ $langs->load("accounting");
|
||||
$id = GETPOST('id', 'int');
|
||||
if ($user->societe_id > 0)
|
||||
accessforbidden();
|
||||
if (! $user->rights->accounting->access)
|
||||
accessforbidden();
|
||||
|
||||
$action = GETPOST('action');
|
||||
$piece_num = GETPOST("piece_num");
|
||||
@ -238,7 +236,9 @@ if ($action == 'create') {
|
||||
print '<input type="submit" class="butAction" value="' . $langs->trans("Save") . '">';
|
||||
|
||||
print '</form>';
|
||||
} else {
|
||||
}
|
||||
else
|
||||
{
|
||||
$book = new BookKeeping($db);
|
||||
$result = $book->fetch_per_mvt($piece_num);
|
||||
if ($result < 0) {
|
||||
@ -309,14 +309,12 @@ if ($action == 'create') {
|
||||
print '<td><input type="text" size="6" name="credit" value="' . price($line->credit) . '"/></td>';
|
||||
print '<td>' . $line->montant . '</td>';
|
||||
print '<td>' . $line->sens . '</td>';
|
||||
|
||||
print '<td>';
|
||||
if ($user->rights->accounting->access) {
|
||||
print '<input type="submit" class="button" value="' . $langs->trans("Update") . '">';
|
||||
}
|
||||
print '<input type="submit" class="button" value="' . $langs->trans("Update") . '">';
|
||||
print '</form>';
|
||||
print '</td>';
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
print '<td>' . $line->numero_compte . '</td>';
|
||||
print '<td>' . $line->code_tiers . '</td>';
|
||||
print '<td>' . $line->label_compte . '</td>';
|
||||
@ -324,16 +322,15 @@ if ($action == 'create') {
|
||||
print '<td>' . $line->credit . '</td>';
|
||||
print '<td>' . $line->montant . '</td>';
|
||||
print '<td>' . $line->sens . '</td>';
|
||||
|
||||
|
||||
print '<td>';
|
||||
if ($user->rights->accouting->access) {
|
||||
print '<a href="./card.php?action=update&id=' . $line->id . '&piece_num=' . $line->piece_num . '">';
|
||||
print img_edit();
|
||||
print '</a> ';
|
||||
print '<a href="./card.php?action=delete&id=' . $line->id . '&piece_num=' . $line->piece_num . '">';
|
||||
print img_delete();
|
||||
print '</a>';
|
||||
}
|
||||
print '<a href="./card.php?action=update&id=' . $line->id . '&piece_num=' . $line->piece_num . '">';
|
||||
print img_edit();
|
||||
print '</a> ';
|
||||
print '<a href="./card.php?action=delete&id=' . $line->id . '&piece_num=' . $line->piece_num . '">';
|
||||
print img_delete();
|
||||
print '</a>';
|
||||
|
||||
print '</td>';
|
||||
}
|
||||
print "</tr>\n";
|
||||
@ -342,7 +339,7 @@ if ($action == 'create') {
|
||||
if ($action == "" || $action == 'add') {
|
||||
$var = ! $var;
|
||||
print "<tr $bc[$var]>";
|
||||
|
||||
|
||||
print '<form action="' . $_SERVER["PHP_SELF"] . '?piece_num=' . $book->piece_num . '" method="post">';
|
||||
print '<input type="hidden" name="action" value="add">' . "\n";
|
||||
print '<input type="hidden" name="doc_date" value="' . $book->doc_date . '">' . "\n";
|
||||
@ -359,14 +356,13 @@ if ($action == 'create') {
|
||||
print '<td></td>';
|
||||
print '<td></td>';
|
||||
print '<td><input type="submit" class="button" value="' . $langs->trans("Save") . '"></td>';
|
||||
|
||||
print '</tr>';
|
||||
}
|
||||
|
||||
print "</table>";
|
||||
}
|
||||
}
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
print_fiche_titre($langs->trans("NoRecords"));
|
||||
}
|
||||
}
|
||||
|
||||
@ -36,6 +36,11 @@ $page = GETPOST("page");
|
||||
$sortorder = GETPOST("sortorder");
|
||||
$sortfield = GETPOST("sortfield");
|
||||
$action = GETPOST('action', 'alpha');
|
||||
$search_doc_type = GETPOST("search_doc_type");
|
||||
$search_doc_ref = GETPOST("search_doc_ref");
|
||||
$search_account = GETPOST("search_account");
|
||||
$search_thirdparty = GETPOST("search_thirdparty");
|
||||
$search_journal = GETPOST("search_journal");
|
||||
|
||||
if ($sortorder == "")
|
||||
$sortorder = "ASC";
|
||||
@ -46,6 +51,15 @@ $offset = $conf->liste_limit * $page;
|
||||
|
||||
$formventilation = new FormVentilation($db);
|
||||
|
||||
if (GETPOST("button_removefilter"))
|
||||
{
|
||||
$search_doc_type="";
|
||||
$search_doc_ref="";
|
||||
$search_account="";
|
||||
$search_thirdparty="";
|
||||
$search_journal="";
|
||||
}
|
||||
|
||||
/*
|
||||
* Action
|
||||
*/
|
||||
@ -100,25 +114,25 @@ else {
|
||||
$sql = "SELECT bk.rowid, bk.doc_date, bk.doc_type, bk.doc_ref, bk.code_tiers, bk.numero_compte , bk.label_compte, bk.debit , bk.credit, bk.montant , bk.sens , bk.code_journal , bk.piece_num ";
|
||||
$sql .= " FROM " . MAIN_DB_PREFIX . "accounting_bookkeeping as bk";
|
||||
|
||||
if (dol_strlen(trim(GETPOST("search_doc_type")))) {
|
||||
if (dol_strlen(trim($search_doc_type))) {
|
||||
|
||||
$sql .= " WHERE bk.doc_type LIKE '%" . GETPOST("search_doc_type") . "%'";
|
||||
$sql .= " WHERE bk.doc_type LIKE '%" . $search_doc_type . "%'";
|
||||
|
||||
if (dol_strlen(trim(GETPOST("search_doc_ref")))) {
|
||||
$sql .= " AND bk.doc_ref LIKE '%" . GETPOST("search_doc_ref") . "%'";
|
||||
if (dol_strlen(trim($search_doc_ref))) {
|
||||
$sql .= " AND bk.doc_ref LIKE '%" . $search_doc_ref . "%'";
|
||||
}
|
||||
}
|
||||
if (dol_strlen(trim(GETPOST("search_doc_ref")))) {
|
||||
$sql .= " WHERE bk.doc_ref LIKE '%" . GETPOST("search_doc_ref") . "%'";
|
||||
if (dol_strlen(trim($search_doc_ref))) {
|
||||
$sql .= " WHERE bk.doc_ref LIKE '%" . $search_doc_ref . "%'";
|
||||
}
|
||||
if (dol_strlen(trim(GETPOST("search_compte")))) {
|
||||
$sql .= " WHERE bk.numero_compte LIKE '%" . GETPOST("search_compte") . "%'";
|
||||
if (dol_strlen(trim($search_account))) {
|
||||
$sql .= " WHERE bk.numero_compte LIKE '%" . $search_account . "%'";
|
||||
}
|
||||
if (dol_strlen(trim(GETPOST("search_tiers")))) {
|
||||
$sql .= " WHERE bk.code_tiers LIKE '%" . GETPOST("search_tiers") . "%'";
|
||||
if (dol_strlen(trim($search_thirdparty))) {
|
||||
$sql .= " WHERE bk.code_tiers LIKE '%" . $search_thirdparty . "%'";
|
||||
}
|
||||
if (dol_strlen(trim(GETPOST("search_journal")))) {
|
||||
$sql .= " WHERE bk.code_journal LIKE '%" . GETPOST("search_journal") . "%'";
|
||||
if (dol_strlen(trim($search_journal))) {
|
||||
$sql .= " WHERE bk.code_journal LIKE '%" . $search_journal . "%'";
|
||||
}
|
||||
|
||||
$sql .= " ORDER BY $sortfield $sortorder " . $db->plimit($conf->liste_limit + 1, $offset);
|
||||
@ -149,7 +163,7 @@ else {
|
||||
print '<input type="submit" class="button" style="float: right;" value="Export CSV" />';
|
||||
print '</form>';
|
||||
|
||||
print "<table class=\"noborder\" width=\"100%\">";
|
||||
print '<table class="noborder" width="100%">';
|
||||
print '<tr class="liste_titre">';
|
||||
print_liste_field_titre($langs->trans("Doctype"), $_SERVER['PHP_SELF'], "bk.doc_type", "", "", "", $sortfield, $sortorder);
|
||||
print_liste_field_titre($langs->trans("Docdate"), $_SERVER['PHP_SELF'], "bk.doc_date", "", "", "", $sortfield, $sortorder);
|
||||
@ -157,29 +171,31 @@ else {
|
||||
print_liste_field_titre($langs->trans("Numerocompte"), $_SERVER['PHP_SELF'], "bk.numero_compte", "", "", "", $sortfield, $sortorder);
|
||||
print_liste_field_titre($langs->trans("Code_tiers"), $_SERVER['PHP_SELF'], "bk.code_tiers", "", "", "", $sortfield, $sortorder);
|
||||
print_liste_field_titre($langs->trans("Labelcompte"), $_SERVER['PHP_SELF'], "bk_label_compte", "", "", "", $sortfield, $sortorder);
|
||||
print_liste_field_titre($langs->trans("Debit"), $_SERVER['PHP_SELF'], "bk.debit", "", "", "", $sortfield, $sortorder);
|
||||
print_liste_field_titre($langs->trans("Credit"), $_SERVER['PHP_SELF'], "bk.credit", "", "", "", $sortfield, $sortorder);
|
||||
print_liste_field_titre($langs->trans("Amount"), $_SERVER['PHP_SELF'], "bk.montant", "", "", "", $sortfield, $sortorder);
|
||||
print_liste_field_titre($langs->trans("Sens"), $_SERVER['PHP_SELF'], "bk.sens", "", "", "", $sortfield, $sortorder);
|
||||
print_liste_field_titre($langs->trans("Debit"), $_SERVER['PHP_SELF'], "bk.debit", "", "", 'align="center"', $sortfield, $sortorder);
|
||||
print_liste_field_titre($langs->trans("Credit"), $_SERVER['PHP_SELF'], "bk.credit", "", "", 'align="center"', $sortfield, $sortorder);
|
||||
print_liste_field_titre($langs->trans("Amount"), $_SERVER['PHP_SELF'], "bk.montant", "", "", 'align="center"', $sortfield, $sortorder);
|
||||
print_liste_field_titre($langs->trans("Sens"), $_SERVER['PHP_SELF'], "bk.sens", "", "", 'align="center"', $sortfield, $sortorder);
|
||||
print_liste_field_titre($langs->trans("Codejournal"), $_SERVER['PHP_SELF'], "bk.code_journal", "", "", "", $sortfield, $sortorder);
|
||||
print_liste_field_titre(" ");
|
||||
print_liste_field_titre($langs->trans("Action"),$_SERVER["PHP_SELF"],"",$param,"",'width="60" align="center"',$sortfield,$sortorder);
|
||||
print "</tr>\n";
|
||||
|
||||
print '<tr class="liste_titre">';
|
||||
print '<form action="'.$_SERVER["PHP_SELF"].'" method="GET">';
|
||||
print '<td><input type="text" name="search_doc_type" value="' . $_GET["search_doc_type"] . '"></td>';
|
||||
print '<td><input type="text" name="search_doc_type" size="8" value="' . $search_doc_type . '"></td>';
|
||||
print '<td> </td>';
|
||||
print '<td><input type="text" name="search_doc_ref" value="' . $_GET["search_doc_ref"] . '"></td>';
|
||||
print '<td><input type="text" name="search_compte" value="' . $_GET["search_compte"] . '"></td>';
|
||||
print '<td><input type="text" name="search_tiers" value="' . $_GET["search_tiers"] . '"></td>';
|
||||
print '<td><input type="text" name="search_doc_ref" size="8" value="' . $search_doc_ref . '"></td>';
|
||||
print '<td><input type="text" name="search_account" size="8" value="' . $search_account . '"></td>';
|
||||
print '<td><input type="text" name="search_thirdparty" size="8" value="' . $search_thirdparty . '"></td>';
|
||||
print '<td> </td>';
|
||||
print '<td> </td>';
|
||||
print '<td> </td>';
|
||||
print '<td> </td>';
|
||||
print '<td> </td>';
|
||||
print '<td><input type="text" name="search_journal" size="3" value="' . $_GET["search_journal"] . '"></td>';
|
||||
print '<td align="right">';
|
||||
print '<input type="image" class="liste_titre" name="button_search" src="' . DOL_URL_ROOT . '/theme/' . $conf->theme . '/img/search.png" value="' . dol_escape_htmltag($langs->trans("Search")) . '" title="' . dol_escape_htmltag($langs->trans("Search")) . '">';
|
||||
print '<td><input type="text" name="search_journal" size="3" value="' . $search_journal . '"></td>';
|
||||
print '<td align="right" colspan="2" class="liste_titre">';
|
||||
print '<input type="image" class="liste_titre" src="'.img_picto($langs->trans("Search"),'search.png','','',1).'" name="button_search" value="'.dol_escape_htmltag($langs->trans("Search")).'" title="'.dol_escape_htmltag($langs->trans("Search")).'">';
|
||||
print ' ';
|
||||
print '<input type="image" class="liste_titre" src="'.img_picto($langs->trans("Search"),'searchclear.png','','',1).'" name="button_removefilter" value="'.dol_escape_htmltag($langs->trans("RemoveFilter")).'" title="'.dol_escape_htmltag($langs->trans("RemoveFilter")).'">';
|
||||
print '</td>';
|
||||
print '</form>';
|
||||
print '</tr>';
|
||||
@ -201,9 +217,9 @@ else {
|
||||
print '<td align="right">' . price($obj->debit) . '</td>';
|
||||
print '<td align="right">' . price($obj->credit) . '</td>';
|
||||
print '<td align="right">' . price($obj->montant) . '</td>';
|
||||
print '<td>' . $obj->sens . '</td>';
|
||||
print '<td align="center">' . $obj->sens . '</td>';
|
||||
print '<td>' . $obj->code_journal . '</td>';
|
||||
print '<td><a href="./card.php?piece_num=' . $obj->piece_num . '">' . img_edit() . '</a></td>';
|
||||
print '<td align="center"><a href="./card.php?piece_num=' . $obj->piece_num . '">' . img_edit() . '</a></td>';
|
||||
print "</tr>\n";
|
||||
$i ++;
|
||||
}
|
||||
|
||||
@ -30,6 +30,8 @@
|
||||
class BookKeeping
|
||||
{
|
||||
var $db;
|
||||
var $error;
|
||||
|
||||
var $id;
|
||||
var $doc_date;
|
||||
var $doc_type;
|
||||
|
||||
@ -40,14 +40,12 @@ $id = GETPOST('id');
|
||||
// Security check
|
||||
if ($user->societe_id > 0)
|
||||
accessforbidden();
|
||||
if (! $user->rights->accounting->access)
|
||||
accessforbidden();
|
||||
|
||||
/*
|
||||
* Actions
|
||||
*/
|
||||
|
||||
if ($action == 'ventil' && $user->rights->accounting->access)
|
||||
if ($action == 'ventil' && $user->rights->accounting->ventilation->dispatch)
|
||||
{
|
||||
if (! GETPOST('cancel', 'alpha'))
|
||||
{
|
||||
@ -109,7 +107,7 @@ if (! empty($id)) {
|
||||
print '<input type="hidden" name="action" value="ventil">';
|
||||
|
||||
$linkback='<a href="'.DOL_URL_ROOT.'/accountancy/customer/lines.php">'.$langs->trans("Back").'</a>';
|
||||
print_fiche_titre($langs->trans('AccountingVentilationCustomer'),$linkback,'setup');
|
||||
print_fiche_titre($langs->trans('CustomersVentilation'),$linkback,'setup');
|
||||
|
||||
print '<table class="border" width="100%">';
|
||||
|
||||
|
||||
@ -93,8 +93,8 @@ if ($action == 'validatehistory') {
|
||||
*/
|
||||
llxHeader('', $langs->trans("CustomersVentilation"));
|
||||
|
||||
$textprevyear = "<a href=\"index.php?year=" . ($year_current - 1) . "\">" . img_previous() . "</a>";
|
||||
$textnextyear = " <a href=\"index.php?year=" . ($year_current + 1) . "\">" . img_next() . "</a>";
|
||||
$textprevyear = '<a href="' . $_SERVER["PHP_SELF"] . '?year=' . ($year_current - 1) . '">' . img_previous() . '</a>';
|
||||
$textnextyear = ' <a href="' . $_SERVER["PHP_SELF"] . '?year=' . ($year_current + 1) . '">' . img_next() . '</a>';
|
||||
|
||||
print_fiche_titre($langs->trans("CustomersVentilation") . " " . $textprevyear . " " . $langs->trans("Year") . " " . $year_start . " " . $textnextyear);
|
||||
|
||||
@ -197,7 +197,7 @@ print "</table>\n";
|
||||
|
||||
print "<br>\n";
|
||||
print '<table class="noborder" width="100%">';
|
||||
print '<tr class="liste_titre"><td width="400" align="left">' . $langs->trans("TotalVente") . '</td>';
|
||||
print '<tr class="liste_titre"><td width="400" align="left">' . $langs->trans("Total") . '</td>';
|
||||
print '<td width="60" align="center">' . $langs->trans("JanuaryMin") . '</td>';
|
||||
print '<td width="60" align="center">' . $langs->trans("FebruaryMin") . '</td>';
|
||||
print '<td width="60" align="center">' . $langs->trans("MarchMin") . '</td>';
|
||||
@ -212,7 +212,7 @@ print '<td width="60" align="center">' . $langs->trans("NovemberMin") . '</td>';
|
||||
print '<td width="60" align="center">' . $langs->trans("DecemberMin") . '</td>';
|
||||
print '<td width="60" align="center"><b>' . $langs->trans("Total") . '</b></td></tr>';
|
||||
|
||||
$sql = "SELECT '" . $langs->trans("Vide") . "' AS 'Total',";
|
||||
$sql = "SELECT '" . $langs->trans("TotalVente") . "' AS 'Total',";
|
||||
$sql .= " ROUND(SUM(IF(MONTH(f.datef)=1,fd.total_ht,0)),2) AS 'Janvier',";
|
||||
$sql .= " ROUND(SUM(IF(MONTH(f.datef)=2,fd.total_ht,0)),2) AS 'Fevrier',";
|
||||
$sql .= " ROUND(SUM(IF(MONTH(f.datef)=3,fd.total_ht,0)),2) AS 'Mars',";
|
||||
|
||||
@ -68,8 +68,6 @@ $action = GETPOST('action');
|
||||
// Security check
|
||||
if ($user->societe_id > 0)
|
||||
accessforbidden();
|
||||
if (! $user->rights->accounting->access)
|
||||
accessforbidden();
|
||||
|
||||
/*
|
||||
* View
|
||||
|
||||
@ -62,8 +62,6 @@ $date_endyear = GETPOST('date_endyear');
|
||||
// Security check
|
||||
if ($user->societe_id > 0)
|
||||
accessforbidden();
|
||||
if (! $user->rights->accounting->access)
|
||||
accessforbidden();
|
||||
|
||||
$action = GETPOST('action');
|
||||
|
||||
|
||||
@ -36,8 +36,6 @@ $langs->load("accountancy");
|
||||
// Security check
|
||||
if ($user->societe_id > 0)
|
||||
accessforbidden();
|
||||
if (! $user->rights->accounting->access)
|
||||
accessforbidden();
|
||||
|
||||
llxHeader('', 'Journaux', '');
|
||||
|
||||
|
||||
@ -55,13 +55,13 @@ $date_endyear = GETPOST('date_endyear');
|
||||
// Security check
|
||||
if ($user->societe_id > 0)
|
||||
accessforbidden();
|
||||
if (! $user->rights->accounting->access)
|
||||
accessforbidden();
|
||||
|
||||
$action = GETPOST('action');
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* View
|
||||
* Actions
|
||||
*/
|
||||
|
||||
$year_current = strftime("%Y", dol_now());
|
||||
@ -154,9 +154,6 @@ if ($result) {
|
||||
dol_print_error($db);
|
||||
}
|
||||
|
||||
/*
|
||||
* Actions
|
||||
*/
|
||||
// Bookkeeping Write
|
||||
if ($action == 'writebookkeeping') {
|
||||
$now = dol_now();
|
||||
@ -239,9 +236,16 @@ if ($action == 'writebookkeeping') {
|
||||
}
|
||||
}
|
||||
|
||||
// export csv
|
||||
|
||||
if ($action == 'export_csv') {
|
||||
/*
|
||||
* View
|
||||
*/
|
||||
|
||||
$companystatic = new Societe($db);
|
||||
|
||||
// export csv
|
||||
if ($action == 'export_csv')
|
||||
{
|
||||
$sep = $conf->global->ACCOUNTING_SEPARATORCSV;
|
||||
|
||||
header('Content-Type: text/csv');
|
||||
|
||||
@ -56,8 +56,6 @@ $date_endyear = GETPOST('date_endyear');
|
||||
// Security check
|
||||
if ($user->societe_id > 0)
|
||||
accessforbidden();
|
||||
if (! $user->rights->accounting->access)
|
||||
accessforbidden();
|
||||
|
||||
$action = GETPOST('action');
|
||||
|
||||
|
||||
@ -46,10 +46,9 @@ $codeventil = GETPOST('codeventil');
|
||||
// Security check
|
||||
if ($user->societe_id > 0)
|
||||
accessforbidden();
|
||||
if (! $user->rights->accounting->ventilation->dispatch)
|
||||
accessforbidden();
|
||||
|
||||
if ($action == 'ventil' && $user->rights->accounting->access) {
|
||||
if ($action == 'ventil' && $user->rights->accounting->ventilation->dispatch)
|
||||
{
|
||||
$sql = " UPDATE " . MAIN_DB_PREFIX . "facture_fourn_det";
|
||||
$sql .= " SET fk_code_ventilation = " . $codeventil;
|
||||
$sql .= " WHERE rowid = " . $id;
|
||||
@ -103,7 +102,7 @@ if ($_GET["id"]) {
|
||||
print '<input type="hidden" name="token" value="' . $_SESSION['newtoken'] . '">';
|
||||
print '<input type="hidden" name="action" value="ventil">';
|
||||
|
||||
print_fiche_titre($langs->trans("Ventilation"));
|
||||
print_fiche_titre($langs->trans("SuppliersVentilation"));
|
||||
|
||||
print '<table class="border" width="100%" cellspacing="0" cellpadding="4">';
|
||||
|
||||
|
||||
@ -92,10 +92,10 @@ if ($action == 'validatehistory') {
|
||||
|
||||
llxHeader('', $langs->trans("SuppliersVentilation"));
|
||||
|
||||
$textprevyear = "<a href=\"index.php?year=" . ($year_current - 1) . "\">" . img_previous() . "</a>";
|
||||
$textnextyear = " <a href=\"index.php?year=" . ($year_current + 1) . "\">" . img_next() . "</a>";
|
||||
$textprevyear = '<a href="' . $_SERVER["PHP_SELF"] . '?year=' . ($year_current - 1) . '">' . img_previous() . '</a>';
|
||||
$textnextyear = ' <a href="' . $_SERVER["PHP_SELF"] . '?year=' . ($year_current + 1) . '">' . img_next() . '</a>';
|
||||
|
||||
print_fiche_titre($langs->trans("AccountingVentilationSupplier") . " " . $textprevyear . " " . $langs->trans("Year") . " " . $year_start . " " . $textnextyear);
|
||||
print_fiche_titre($langs->trans("SuppliersVentilation") . " " . $textprevyear . " " . $langs->trans("Year") . " " . $year_start . " " . $textnextyear);
|
||||
|
||||
print '<b>' . $langs->trans("DescVentilSupplier") . '</b>';
|
||||
print '<div class="inline-block divButAction"><a class="butAction" href="' . $_SERVER['PHP_SELF'] . '?action=validatehistory">' . $langs->trans("ValidateHistory") . '</a></div>';
|
||||
|
||||
@ -7,7 +7,7 @@
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* 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,
|
||||
@ -17,6 +17,7 @@
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
* or see http://www.gnu.org/
|
||||
*/
|
||||
|
||||
/**
|
||||
|
||||
@ -70,7 +70,7 @@ $extralabels=$extrafields->fetch_name_optionals_label($object->table_element);
|
||||
// Get object canvas (By default, this is not defined, so standard usage of dolibarr)
|
||||
$object->getCanvas($rowid);
|
||||
$canvas = $object->canvas?$object->canvas:GETPOST("canvas");
|
||||
$objcanvas='';
|
||||
$objcanvas=null;
|
||||
if (! empty($canvas))
|
||||
{
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/canvas.class.php';
|
||||
@ -79,7 +79,7 @@ if (! empty($canvas))
|
||||
}
|
||||
|
||||
// Security check
|
||||
$result=restrictedArea($user,'adherent',$rowid,'','','fk_soc', 'rowid', $objcanvas);
|
||||
$result=restrictedArea($user, 'adherent', $rowid, '', '', 'fk_soc', 'rowid', $objcanvas);
|
||||
|
||||
if ($rowid > 0)
|
||||
{
|
||||
@ -723,7 +723,7 @@ else
|
||||
{
|
||||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* Fiche creation */
|
||||
/* Creation card */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
$object->canvas=$canvas;
|
||||
|
||||
@ -5,6 +5,7 @@
|
||||
* Copyright (C) 2004 Sebastien Di Cintio <sdicintio@ressource-toi.org>
|
||||
* Copyright (C) 2004 Benoit Mortier <benoit.mortier@opensides.be>
|
||||
* Copyright (C) 2009-2012 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
* 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
|
||||
@ -124,7 +125,7 @@ class Adherent extends CommonObject
|
||||
|
||||
|
||||
/**
|
||||
* Fonction envoyant un email a l'adherent avec le texte fourni en parametre.
|
||||
* Function sending an email has the adherent with the text supplied in parameter.
|
||||
*
|
||||
* @param string $text Content of message (not html entities encoded)
|
||||
* @param string $subject Subject of message
|
||||
@ -247,9 +248,9 @@ class Adherent extends CommonObject
|
||||
|
||||
|
||||
/**
|
||||
* Renvoie le libelle traduit de la nature d'un adherent (physique ou morale)
|
||||
* Return translated label by the nature of a adherent (physical or moral)
|
||||
*
|
||||
* @param string $morphy Nature physique ou morale de l'adherent
|
||||
* @param string $morphy Nature of the adherent (physical or moral)
|
||||
* @return string Label
|
||||
*/
|
||||
function getmorphylib($morphy='')
|
||||
@ -464,8 +465,11 @@ class Adherent extends CommonObject
|
||||
|
||||
$nbrowsaffected+=$this->db->affected_rows($resql);
|
||||
|
||||
$action='update';
|
||||
|
||||
// Actions on extra fields (by external module)
|
||||
$hookmanager->initHooks(array('memberdao'));
|
||||
// FIXME le hook fait double emploi avec le trigger !!
|
||||
$hookmanager->initHooks(array('memberdao'));
|
||||
$parameters=array('id'=>$this->id);
|
||||
$action='';
|
||||
$reshook=$hookmanager->executeHooks('insertExtraFields',$parameters,$this,$action); // Note that $action and $object may have been modified by some hooks
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
/* Copyright (C) 2005-2010 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2012-2013 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2013 Philippe Grand <philippe.grand@atoo-net.com>
|
||||
* Copyright (C) 2014 Alexandre Spangaro <alexandre.spangaro@gmail.com>
|
||||
* 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
|
||||
@ -37,6 +37,8 @@ $typeconst=array('yesno','texte','chaine');
|
||||
|
||||
$action = GETPOST('action','alpha');
|
||||
|
||||
$type='donation';
|
||||
|
||||
|
||||
/*
|
||||
* Action
|
||||
@ -135,7 +137,7 @@ else if ($action == 'setart200') {
|
||||
$res = dolibarr_set_const($db, "DONATION_ART200", $setart200, 'yesno', 0, '', $conf->entity);
|
||||
if (! $res > 0)
|
||||
$error ++;
|
||||
|
||||
|
||||
if (! $error) {
|
||||
setEventMessage($langs->trans("SetupSaved"), 'mesgs');
|
||||
} else {
|
||||
@ -147,7 +149,7 @@ else if ($action == 'setart238') {
|
||||
$res = dolibarr_set_const($db, "DONATION_ART238", $setart238, 'yesno', 0, '', $conf->entity);
|
||||
if (! $res > 0)
|
||||
$error ++;
|
||||
|
||||
|
||||
if (! $error) {
|
||||
setEventMessage($langs->trans("SetupSaved"), 'mesgs');
|
||||
} else {
|
||||
@ -159,7 +161,7 @@ else if ($action == 'setart885') {
|
||||
$res = dolibarr_set_const($db, "DONATION_ART885", $setart885, 'yesno', 0, '', $conf->entity);
|
||||
if (! $res > 0)
|
||||
$error ++;
|
||||
|
||||
|
||||
if (! $error) {
|
||||
setEventMessage($langs->trans("SetupSaved"), 'mesgs');
|
||||
} else {
|
||||
@ -183,7 +185,7 @@ print_fiche_titre($langs->trans("DonationsSetup"),$linkback,'setup');
|
||||
* Params
|
||||
*/
|
||||
print_titre($langs->trans("Options"));
|
||||
|
||||
|
||||
print '<table class="noborder" width="100%">';
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td>'.$langs->trans("Parameter").'</td>';
|
||||
@ -207,11 +209,11 @@ print '</form>';
|
||||
/*
|
||||
* French params
|
||||
*/
|
||||
if ($conf->global->MAIN_LANG_DEFAULT == "fr_FR")
|
||||
if ($conf->global->MAIN_LANG_DEFAULT == "fr_FR")
|
||||
{
|
||||
print '<br>';
|
||||
print_titre($langs->trans("FrenchOptions"));
|
||||
|
||||
|
||||
print '<table class="noborder" width="100%">';
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td colspan="3">' . $langs->trans('Parameters') . '</td>';
|
||||
@ -377,7 +379,7 @@ if (is_resource($handle))
|
||||
print '<td align="center">';
|
||||
print $form->textwithpicto('',$htmltooltip,-1,0);
|
||||
print '</td>';
|
||||
|
||||
|
||||
// Preview
|
||||
print '<td align="center">';
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=specimen&module='.$name.'" target="specimen">'.img_object($langs->trans("Preview"),'generic').'</a>';
|
||||
|
||||
@ -26,7 +26,6 @@
|
||||
require '../main.inc.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formadmin.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
|
||||
|
||||
$action=GETPOST('action');
|
||||
|
||||
|
||||
@ -326,6 +326,7 @@ if ($conf->use_javascript_ajax)
|
||||
'<a href="edit.php?menu_handler='.$menu_handler_to_search.'&action=edit&menuId='.$menu['rowid'].'">'.img_edit('default',0,'class="menuEdit" id="edit'.$menu['rowid'].'"').'</a> '.
|
||||
'<a href="edit.php?menu_handler='.$menu_handler_to_search.'&action=create&menuId='.$menu['rowid'].'">'.img_edit_add('default').'</a> '.
|
||||
'<a href="index.php?menu_handler='.$menu_handler_to_search.'&action=delete&menuId='.$menu['rowid'].'">'.img_delete('default').'</a> '.
|
||||
' '.
|
||||
'<a href="index.php?menu_handler='.$menu_handler_to_search.'&action=up&menuId='.$menu['rowid'].'">'.img_picto("Monter","1uparrow").'</a><a href="index.php?menu_handler='.$menu_handler_to_search.'&action=down&menuId='.$menu['rowid'].'">'.img_picto("Descendre","1downarrow").'</a>'.
|
||||
'</td></tr></table>'
|
||||
);
|
||||
|
||||
@ -183,8 +183,9 @@ foreach ($syslogModules as $moduleName)
|
||||
{
|
||||
$module = new $moduleName;
|
||||
|
||||
$moduleactive=$module->isActive();
|
||||
if ($moduleactive == -1 && empty($conf->global->MAIN_FEATURES_LEVEL)) continue; // Some modules are hidden if not activable and not into debug mode (end user must not see them)
|
||||
$moduleactive=(int) $module->isActive();
|
||||
//print $moduleName." = ".$moduleactive." - ".$module->getName()." ".($moduleactive == -1)."<br>\n";
|
||||
if (($moduleactive == -1) && empty($conf->global->MAIN_FEATURES_LEVEL)) continue; // Some modules are hidden if not activable and not into debug mode (end user must not see them)
|
||||
|
||||
$var=!$var;
|
||||
print '<tr '.$bc[$var].'>';
|
||||
@ -199,7 +200,7 @@ foreach ($syslogModules as $moduleName)
|
||||
{
|
||||
foreach ($setuparray as $option)
|
||||
{
|
||||
if (isset($_POST[$option['constant']])) $value=$_POST[$option['constant']];
|
||||
if (isset($_POST[$option['constant']])) $value=$_POST[$option['constant']];
|
||||
else if (defined($option['constant'])) $value = constant($option['constant']);
|
||||
else $value = (isset($option['default']) ? $option['default'] : '');
|
||||
|
||||
@ -220,7 +221,7 @@ foreach ($syslogModules as $moduleName)
|
||||
print "</table>\n";
|
||||
print "</form>\n";
|
||||
|
||||
print '<br>';
|
||||
print '<br>'."\n\n";
|
||||
|
||||
print_titre($langs->trans("SyslogLevel"));
|
||||
|
||||
|
||||
@ -107,7 +107,7 @@ class Categorie extends CommonObject
|
||||
$this->type = $res['type'];
|
||||
$this->entity = $res['entity'];
|
||||
|
||||
$this->fetch_optionals($this->id,$extralabels);
|
||||
$this->fetch_optionals($this->id,null);
|
||||
|
||||
$this->db->free($resql);
|
||||
|
||||
@ -198,6 +198,8 @@ class Categorie extends CommonObject
|
||||
{
|
||||
$this->id = $id;
|
||||
|
||||
$action='create';
|
||||
|
||||
// Actions on extra fields (by external module or standard code)
|
||||
// FIXME le hook fait double emploi avec le trigger !!
|
||||
$hookmanager->initHooks(array('HookModuleNamedao'));
|
||||
@ -289,11 +291,13 @@ class Categorie extends CommonObject
|
||||
dol_syslog(get_class($this)."::update", LOG_DEBUG);
|
||||
if ($this->db->query($sql))
|
||||
{
|
||||
$action='update';
|
||||
|
||||
// Actions on extra fields (by external module or standard code)
|
||||
// FIXME le hook fait double emploi avec le trigger !!
|
||||
$hookmanager->initHooks(array('HookCategorydao'));
|
||||
$parameters=array();
|
||||
$action='update';
|
||||
$reshook=$hookmanager->executeHooks('insertExtraFields',$parameters,$this,$action); // Note that $action and $object may have been modified by some hooks
|
||||
if (empty($reshook))
|
||||
{
|
||||
@ -408,6 +412,17 @@ class Categorie extends CommonObject
|
||||
$error++;
|
||||
}
|
||||
}
|
||||
if (! $error)
|
||||
{
|
||||
$sql = "DELETE FROM ".MAIN_DB_PREFIX."categorie_lang";
|
||||
$sql .= " WHERE fk_category = ".$this->id;
|
||||
if (!$this->db->query($sql))
|
||||
{
|
||||
$this->error=$this->db->lasterror();
|
||||
dol_syslog("Error sql=".$sql." ".$this->error, LOG_ERR);
|
||||
$error++;
|
||||
}
|
||||
}
|
||||
|
||||
// Delete category
|
||||
if (! $error)
|
||||
@ -430,7 +445,7 @@ class Categorie extends CommonObject
|
||||
if ($result < 0)
|
||||
{
|
||||
$error++;
|
||||
dol_syslog(get_class($this)."::delete erreur ".$errorflag." ".$this->error, LOG_ERR);
|
||||
dol_syslog(get_class($this)."::delete erreur ".$this->error, LOG_ERR);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -788,7 +803,7 @@ class Categorie extends CommonObject
|
||||
*/
|
||||
function get_full_arbo($type,$markafterid=0)
|
||||
{
|
||||
global $langs;
|
||||
global $conf, $langs;
|
||||
|
||||
$this->cats = array();
|
||||
|
||||
@ -798,11 +813,9 @@ class Categorie extends CommonObject
|
||||
|
||||
// Init $this->cats array
|
||||
$sql = "SELECT DISTINCT c.rowid, c.label, c.description, c.fk_parent"; // Distinct reduce pb with old tables with duplicates
|
||||
if (! empty($conf->global->MAIN_MULTILANGS))
|
||||
$sql.= ", t.label as label_trans, t.description as description_trans";
|
||||
if (! empty($conf->global->MAIN_MULTILANGS)) $sql.= ", t.label as label_trans, t.description as description_trans";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."categorie as c";
|
||||
if (! empty($conf->global->MAIN_MULTILANGS))
|
||||
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."categorie_lang as t ON t.fk_category=c.rowid AND t.lang='".$current_lang."'";
|
||||
if (! empty($conf->global->MAIN_MULTILANGS)) $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."categorie_lang as t ON t.fk_category=c.rowid AND t.lang='".$current_lang."'";
|
||||
$sql.= " WHERE c.entity IN (".getEntity('category',1).")";
|
||||
$sql.= " AND c.type = ".$type;
|
||||
|
||||
@ -1263,7 +1276,7 @@ class Categorie extends CommonObject
|
||||
$result='';
|
||||
|
||||
$lien = '<a href="'.DOL_URL_ROOT.'/categories/viewcat.php?id='.$this->id.'&type='.$this->type.'">';
|
||||
$label=$langs->trans("ShowCategory").': '.$this->label;
|
||||
$label=$langs->trans("ShowCategory").': '. ($this->ref?$this->ref:$this->label);
|
||||
$lienfin='</a>';
|
||||
|
||||
$picto='category';
|
||||
@ -1271,7 +1284,7 @@ class Categorie extends CommonObject
|
||||
|
||||
if ($withpicto) $result.=($lien.img_object($label,$picto).$lienfin);
|
||||
if ($withpicto && $withpicto != 2) $result.=' ';
|
||||
if ($withpicto != 2) $result.=$lien.dol_trunc($this->ref,$maxlength).$lienfin;
|
||||
if ($withpicto != 2) $result.=$lien.dol_trunc(($this->ref?$this->ref:$this->label),$maxlength).$lienfin;
|
||||
return $result;
|
||||
}
|
||||
|
||||
@ -1369,7 +1382,7 @@ class Categorie extends CommonObject
|
||||
// Objet
|
||||
$obj=array();
|
||||
$obj['photo']=$photo;
|
||||
if ($photo_vignette && is_file($dirthumb.$photo_vignette)) $obj['photo_vignette']=$photo_vignette;
|
||||
if ($photo_vignette && is_file($dirthumb.$photo_vignette)) $obj['photo_vignette']='thumbs/' . $photo_vignette;
|
||||
else $obj['photo_vignette']="";
|
||||
|
||||
$tabobj[$nbphoto-1]=$obj;
|
||||
|
||||
@ -241,7 +241,7 @@ if ($object->id)
|
||||
// Si fichier vignette disponible, on l'utilise, sinon on utilise photo origine
|
||||
if ($obj['photo_vignette'])
|
||||
{
|
||||
$filename='thumbs/'.$obj['photo_vignette'];
|
||||
$filename=$obj['photo_vignette'];
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@ -710,9 +710,9 @@ if ($action == 'create')
|
||||
$events[]=array('method' => 'getContacts', 'url' => dol_buildpath('/core/ajax/contacts.php',1), 'htmlname' => 'contactid', 'params' => array('add-customer-contact' => 'disabled'));
|
||||
//For external user force the company to user company
|
||||
if (!empty($user->societe_id)) {
|
||||
print $form->select_company($user->societe_id,'socid','',1,1,0,$events);
|
||||
print $form->select_thirdparty_list($user->societe_id,'socid','',1,1,0,$events);
|
||||
} else {
|
||||
print $form->select_company('','socid','',1,1,0,$events);
|
||||
print $form->select_thirdparty_list('','socid','',1,1,0,$events);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -241,8 +241,11 @@ class ActionComm extends CommonObject
|
||||
|
||||
if (! $error)
|
||||
{
|
||||
$action='create';
|
||||
|
||||
// Actions on extra fields (by external module or standard code)
|
||||
$hookmanager->initHooks(array('actioncommdao'));
|
||||
// FIXME le hook fait double emploi avec le trigger !!
|
||||
$hookmanager->initHooks(array('actioncommdao'));
|
||||
$parameters=array('actcomm'=>$this->id);
|
||||
$reshook=$hookmanager->executeHooks('insertExtraFields',$parameters,$this,$action); // Note that $action and $object may have been modified by some hooks
|
||||
if (empty($reshook))
|
||||
@ -560,8 +563,10 @@ class ActionComm extends CommonObject
|
||||
dol_syslog(get_class($this)."::update", LOG_DEBUG);
|
||||
if ($this->db->query($sql))
|
||||
{
|
||||
$action='update';
|
||||
|
||||
// Actions on extra fields (by external module or standard code)
|
||||
// FIXME le hook fait double emploi avec le trigger !!
|
||||
$hookmanager->initHooks(array('actioncommdao'));
|
||||
$parameters=array('actcomm'=>$this->id);
|
||||
$reshook=$hookmanager->executeHooks('insertExtraFields',$parameters,$this,$action); // Note that $action and $object may have been modified by some hooks
|
||||
|
||||
@ -103,7 +103,7 @@ class CActionComm
|
||||
* @param string $idorcode 'id' or 'code'
|
||||
* @param string $excludetype Type to exclude
|
||||
* @param string $onlyautoornot Group list by auto events or not
|
||||
* @return array Array of all event types if OK, <0 if KO
|
||||
* @return mixed Array of all event types if OK, <0 if KO
|
||||
*/
|
||||
function liste_array($active='',$idorcode='id',$excludetype='',$onlyautoornot=0)
|
||||
{
|
||||
|
||||
@ -277,20 +277,14 @@ if ($object->id > 0)
|
||||
print '<tr><td width="30%" nowrap>'.$langs->trans("NbOfAttachedFiles").'</td><td colspan="3">'.count($filearray).'</td></tr>';
|
||||
print '<tr><td>'.$langs->trans("TotalSizeOfAttachedFiles").'</td><td colspan="3">'.$totalsize.' '.$langs->trans("bytes").'</td></tr>';
|
||||
|
||||
print '</table>';
|
||||
print '</table>';
|
||||
|
||||
print '</div>';
|
||||
dol_fiche_end();
|
||||
|
||||
$modulepart = 'actions';
|
||||
$permission = $user->rights->agenda->myactions->create||$user->rights->agenda->allactions->create;
|
||||
$param = '&id=' . $object->id;
|
||||
include_once DOL_DOCUMENT_ROOT . '/core/tpl/document_actions_post_headers.tpl.php';
|
||||
|
||||
|
||||
if ($action != 'edit')
|
||||
{
|
||||
print "<br>";
|
||||
|
||||
// Link to agenda views
|
||||
print '<div id="agendaviewbutton">';
|
||||
print '<form name="listactionsfiltermonth" action="'.DOL_URL_ROOT.'/comm/action/index.php" method="POST" style="float: left; padding-right: 10px;">';
|
||||
@ -330,13 +324,23 @@ if ($object->id > 0)
|
||||
print img_picto($langs->trans("ViewCal"),'object_calendarperuser','class="hideonsmartphone"').' <input type="submit" style="min-width: 120px" class="button" name="viewperuser" value="'.$langs->trans("ViewPerUser").'">';
|
||||
print '</form>'."\n";
|
||||
print '</div>';
|
||||
|
||||
print '<div style="clear: both"></div>';
|
||||
print "<br><br>";
|
||||
}
|
||||
|
||||
|
||||
$modulepart = 'actions';
|
||||
$permission = $user->rights->agenda->myactions->create||$user->rights->agenda->allactions->create;
|
||||
$param = '&id=' . $object->id;
|
||||
include_once DOL_DOCUMENT_ROOT . '/core/tpl/document_actions_post_headers.tpl.php';
|
||||
}
|
||||
else
|
||||
{
|
||||
print $langs->trans("ErrorUnknown");
|
||||
}
|
||||
|
||||
$db->close();
|
||||
|
||||
llxFooter();
|
||||
|
||||
$db->close();
|
||||
|
||||
@ -99,6 +99,13 @@ if (! $user->rights->agenda->allactions->read || $filter=='mine') // If no permi
|
||||
$filterd=$user->id;
|
||||
}
|
||||
|
||||
// Purge search criteria
|
||||
if (GETPOST("button_removefilter"))
|
||||
{
|
||||
$datestart='';
|
||||
$dateend='';
|
||||
}
|
||||
|
||||
// Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array
|
||||
$hookmanager->initHooks(array('agendalist'));
|
||||
|
||||
@ -278,8 +285,7 @@ if ($resql)
|
||||
//print '<td class="liste_titre"></td>';
|
||||
print '<td class="liste_titre"></td>';
|
||||
print '<td class="liste_titre" align="right"><input class="liste_titre" type="image" src="'.img_picto($langs->trans("Search"),'search.png','','',1).'" value="'.dol_escape_htmltag($langs->trans("Search")).'" title="'.dol_escape_htmltag($langs->trans("Search")).'">';
|
||||
//print ' ';
|
||||
//print '<input type="image" class="liste_titre" name="button_removefilter" src="'.img_picto($langs->trans("Search"),'searchclear.png','','',1).'" value="'.dol_escape_htmltag($langs->trans("RemoveFilter")).'" title="'.dol_escape_htmltag($langs->trans("RemoveFilter")).'">';
|
||||
print '<input type="image" class="liste_titre" name="button_removefilter" src="'.img_picto($langs->trans("Search"),'searchclear.png','','',1).'" value="'.dol_escape_htmltag($langs->trans("RemoveFilter")).'" title="'.dol_escape_htmltag($langs->trans("RemoveFilter")).'">';
|
||||
print '</td>';
|
||||
print "</tr>\n";
|
||||
|
||||
|
||||
@ -1008,8 +1008,9 @@ function show_day_events2($username, $day, $month, $year, $monthshown, $style, &
|
||||
if ($output[0]['color']) $color2 = $output[0]['color'];
|
||||
}
|
||||
else if (count($cases2[$h]) > 1) $color2='222222';
|
||||
$ids1=join(',',array_keys($cases1[$h]));
|
||||
$ids2=join(',',array_keys($cases2[$h]));
|
||||
$ids1='';$ids2='';
|
||||
if (count($cases1[$h]) && array_keys($cases1[$h])) $ids1=join(',',array_keys($cases1[$h]));
|
||||
if (count($cases2[$h]) && array_keys($cases2[$h])) $ids2=join(',',array_keys($cases2[$h]));
|
||||
//var_dump($cases1[$h]);
|
||||
print '<table class="nobordernopadding" width="100%">';
|
||||
print '<tr><td '.($color1?'style="background: #'.$color1.';"':'').'class="'.($style1?$style1.' ':'').'onclickopenref'.($title1?' cursorpointer':'').'" ref="ref_'.$username->id.'_'.sprintf("%04d",$year).'_'.sprintf("%02d",$month).'_'.sprintf("%02d",$day).'_'.sprintf("%02d",$h).'_00_'.($ids1?$ids1:'none').'"'.($title1?' title="'.$title1.'"':'').'>';
|
||||
|
||||
@ -2000,7 +2000,7 @@ if ($action == 'create')
|
||||
{
|
||||
$var = true;
|
||||
|
||||
// Add free products/services
|
||||
// Add products/services form
|
||||
$object->formAddObjectLine(1, $mysoc, $soc);
|
||||
|
||||
$parameters = array();
|
||||
|
||||
@ -846,6 +846,8 @@ class Propal extends CommonObject
|
||||
$resql=$this->update_price(1);
|
||||
if ($resql)
|
||||
{
|
||||
$action='update';
|
||||
|
||||
// Actions on extra fields (by external module or standard code)
|
||||
// FIXME le hook fait double emploi avec le trigger !!
|
||||
$hookmanager->initHooks(array('propaldao'));
|
||||
@ -1264,6 +1266,8 @@ class Propal extends CommonObject
|
||||
*/
|
||||
function update_extrafields($user)
|
||||
{
|
||||
$action='update';
|
||||
|
||||
// Actions on extra fields (by external module or standard code)
|
||||
// FIXME le hook fait double emploi avec le trigger !!
|
||||
$hookmanager->initHooks(array('propaldao'));
|
||||
@ -2118,7 +2122,7 @@ class Propal extends CommonObject
|
||||
|
||||
if (! $error)
|
||||
{
|
||||
dol_syslog(get_class($this)."::delete $this->id by $user->id", LOG_DEBUG);
|
||||
dol_syslog(get_class($this)."::delete ".$this->id." by ".$user->id, LOG_DEBUG);
|
||||
$this->db->commit();
|
||||
return 1;
|
||||
}
|
||||
@ -2879,7 +2883,7 @@ class PropaleLigne extends CommonObject
|
||||
|
||||
$error=0;
|
||||
|
||||
dol_syslog("PropaleLigne::insert rang=".$this->rang);
|
||||
dol_syslog(get_class($this)."::insert rang=".$this->rang);
|
||||
|
||||
// Clean parameters
|
||||
if (empty($this->tva_tx)) $this->tva_tx=0;
|
||||
|
||||
@ -323,10 +323,9 @@ if ($result)
|
||||
$formpropal->selectProposalStatus($viewstatut,1);
|
||||
print '</td>';
|
||||
print '<td class="liste_titre" align="right">';
|
||||
print '<input type="image" value="button_search" class="liste_titre" src="'.img_picto($langs->trans("Search"),'search.png','','',1).'" value="'.dol_escape_htmltag($langs->trans("Search")).'" title="'.dol_escape_htmltag($langs->trans("Search")).'">';
|
||||
print ' ';
|
||||
print '<input type="image" value="button_removefilter" class="liste_titre" src="'.img_picto($langs->trans("Search"),'searchclear.png','','',1).'" value="'.dol_escape_htmltag($langs->trans("RemoveFilter")).'" title="'.dol_escape_htmltag($langs->trans("RemoveFilter")).'">';
|
||||
print '</td>';
|
||||
print '<input type="image" value="button_search" class="liste_titre" src="'.img_picto($langs->trans("Search"),'search.png','','',1).'" value="'.dol_escape_htmltag($langs->trans("Search")).'" title="'.dol_escape_htmltag($langs->trans("Search")).'">';
|
||||
print '<input type="image" value="button_removefilter" class="liste_titre" src="'.img_picto($langs->trans("Search"),'searchclear.png','','',1).'" value="'.dol_escape_htmltag($langs->trans("RemoveFilter")).'" title="'.dol_escape_htmltag($langs->trans("RemoveFilter")).'">';
|
||||
print '</td>';
|
||||
print "</tr>\n";
|
||||
|
||||
$var=true;
|
||||
|
||||
@ -801,6 +801,8 @@ class Commande extends CommonOrder
|
||||
|
||||
if (! $error)
|
||||
{
|
||||
$action='create';
|
||||
|
||||
// Actions on extra fields (by external module or standard code)
|
||||
// FIXME le hook fait double emploi avec le trigger !!
|
||||
$hookmanager->initHooks(array('orderdao'));
|
||||
@ -2928,6 +2930,8 @@ class Commande extends CommonOrder
|
||||
*/
|
||||
function update_extrafields($user)
|
||||
{
|
||||
$action='create';
|
||||
|
||||
// Actions on extra fields (by external module or standard code)
|
||||
// FIXME le hook fait double emploi avec le trigger !!
|
||||
$hookmanager->initHooks(array('orderdao'));
|
||||
@ -3280,7 +3284,7 @@ class OrderLine extends CommonOrderLine
|
||||
|
||||
$error=0;
|
||||
|
||||
dol_syslog("OrderLine::insert rang=".$this->rang);
|
||||
dol_syslog(get_class($this)."::insert rang=".$this->rang);
|
||||
|
||||
// Clean parameters
|
||||
if (empty($this->tva_tx)) $this->tva_tx=0;
|
||||
|
||||
@ -43,9 +43,9 @@ $orderyear=GETPOST("orderyear","int");
|
||||
$ordermonth=GETPOST("ordermonth","int");
|
||||
$deliveryyear=GETPOST("deliveryyear","int");
|
||||
$deliverymonth=GETPOST("deliverymonth","int");
|
||||
$sref=GETPOST('sref','alpha');
|
||||
$sref_client=GETPOST('sref_client','alpha');
|
||||
$snom=GETPOST('snom','alpha');
|
||||
$search_ref=GETPOST('search_ref','alpha');
|
||||
$search_ref_customer=GETPOST('search_ref_customer','alpha');
|
||||
$search_company=GETPOST('search_company','alpha');
|
||||
$sall=GETPOST('sall');
|
||||
$socid=GETPOST('socid','int');
|
||||
$search_user=GETPOST('search_user','int');
|
||||
@ -69,6 +69,20 @@ $limit = $conf->liste_limit;
|
||||
|
||||
$viewstatut=GETPOST('viewstatut');
|
||||
|
||||
// Purge search criteria
|
||||
if (GETPOST("button_removefilter"))
|
||||
{
|
||||
$search_categ='';
|
||||
$search_user='';
|
||||
$search_sale='';
|
||||
$search_ref='';
|
||||
$search_ref_customer='';
|
||||
$search_company='';
|
||||
$orderyear='';
|
||||
$ordermonth='';
|
||||
$deliverymonth='';
|
||||
$deliveryyear='';
|
||||
}
|
||||
|
||||
// Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array
|
||||
$hookmanager->initHooks(array('orderlist'));
|
||||
@ -81,24 +95,6 @@ $parameters=array('socid'=>$socid);
|
||||
$reshook=$hookmanager->executeHooks('doActions',$parameters,$object,$action); // Note that $action and $object may have been modified by some hook
|
||||
if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
|
||||
|
||||
// Do we click on purge search criteria ?
|
||||
if (GETPOST("button_removefilter_x"))
|
||||
{
|
||||
$search_categ='';
|
||||
$search_user='';
|
||||
$search_sale='';
|
||||
$search_ref='';
|
||||
$search_refcustomer='';
|
||||
$search_societe='';
|
||||
$search_montant_ht='';
|
||||
$orderyear='';
|
||||
$ordermonth='';
|
||||
$deliverymonth='';
|
||||
$deliveryyear='';
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* View
|
||||
*/
|
||||
@ -128,8 +124,8 @@ $sql.= ' WHERE c.fk_soc = s.rowid';
|
||||
$sql.= ' AND c.entity = '.$conf->entity;
|
||||
if ($socid) $sql.= ' AND s.rowid = '.$socid;
|
||||
if (!$user->rights->societe->client->voir && !$socid) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id;
|
||||
if ($sref) {
|
||||
$sql .= natural_search('c.ref', $sref);
|
||||
if ($search_ref) {
|
||||
$sql .= natural_search('c.ref', $search_ref);
|
||||
}
|
||||
if ($sall)
|
||||
{
|
||||
@ -188,13 +184,13 @@ else if ($deliveryyear > 0)
|
||||
{
|
||||
$sql.= " AND c.date_livraison BETWEEN '".$db->idate(dol_get_first_day($deliveryyear,1,false))."' AND '".$db->idate(dol_get_last_day($deliveryyear,12,false))."'";
|
||||
}
|
||||
if (!empty($snom))
|
||||
if (!empty($search_company))
|
||||
{
|
||||
$sql .= natural_search('s.nom', $snom);
|
||||
$sql .= natural_search('s.nom', $search_company);
|
||||
}
|
||||
if (!empty($sref_client))
|
||||
if (!empty($search_ref_customer))
|
||||
{
|
||||
$sql.= ' AND c.ref_client LIKE \'%'.$db->escape($sref_client).'%\'';
|
||||
$sql.= ' AND c.ref_client LIKE \'%'.$db->escape($search_ref_customer).'%\'';
|
||||
}
|
||||
if ($search_sale > 0) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$search_sale;
|
||||
if ($search_user > 0)
|
||||
@ -246,15 +242,15 @@ if ($resql)
|
||||
$title.=' - '.$langs->trans('StatusOrderValidated').', '.(empty($conf->expedition->enabled)?'':$langs->trans("StatusOrderSent").', ').$langs->trans('StatusOrderToBill');
|
||||
|
||||
$param='&socid='.$socid.'&viewstatut='.$viewstatut;
|
||||
if ($ordermonth) $param.='&ordermonth='.$ordermonth;
|
||||
if ($orderyear) $param.='&orderyear='.$orderyear;
|
||||
if ($deliverymonth) $param.='&deliverymonth='.$deliverymonth;
|
||||
if ($deliveryyear) $param.='&deliveryyear='.$deliveryyear;
|
||||
if ($sref) $param.='&sref='.$sref;
|
||||
if ($snom) $param.='&snom='.$snom;
|
||||
if ($sref_client) $param.='&sref_client='.$sref_client;
|
||||
if ($search_user > 0) $param.='&search_user='.$search_user;
|
||||
if ($search_sale > 0) $param.='&search_sale='.$search_sale;
|
||||
if ($ordermonth) $param.='&ordermonth='.$ordermonth;
|
||||
if ($orderyear) $param.='&orderyear='.$orderyear;
|
||||
if ($deliverymonth) $param.='&deliverymonth='.$deliverymonth;
|
||||
if ($deliveryyear) $param.='&deliveryyear='.$deliveryyear;
|
||||
if ($search_ref) $param.='&search_ref='.$search_ref;
|
||||
if ($search_company) $param.='&search_company='.$search_company;
|
||||
if ($search_ref_customer) $param.='&search_ref_customer='.$search_ref_customer;
|
||||
if ($search_user > 0) $param.='&search_user='.$search_user;
|
||||
if ($search_sale > 0) $param.='&search_sale='.$search_sale;
|
||||
|
||||
$num = $db->num_rows($resql);
|
||||
print_barre_liste($title, $page,$_SERVER["PHP_SELF"],$param,$sortfield,$sortorder,'',$num,$nbtotalofrecords);
|
||||
@ -294,33 +290,35 @@ if ($resql)
|
||||
print_liste_field_titre($langs->trans('Ref'),$_SERVER["PHP_SELF"],'c.ref','',$param,'width="25%"',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans('RefCustomerOrder'),$_SERVER["PHP_SELF"],'c.ref_client','',$param,'',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans('Company'),$_SERVER["PHP_SELF"],'s.nom','',$param,'',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans('OrderDate'),$_SERVER["PHP_SELF"],'c.date_commande','',$param, 'align="right"',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans('DeliveryDate'),$_SERVER["PHP_SELF"],'c.date_livraison','',$param, 'align="right"',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans('OrderDate'),$_SERVER["PHP_SELF"],'c.date_commande','',$param, 'align="center"',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans('DeliveryDate'),$_SERVER["PHP_SELF"],'c.date_livraison','',$param, 'align="center"',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans('AmountHT'),$_SERVER["PHP_SELF"],'c.total_ht','',$param, 'align="right"',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans('Status'),$_SERVER["PHP_SELF"],'c.fk_statut','',$param,'align="right"',$sortfield,$sortorder);
|
||||
print '</tr>';
|
||||
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td class="liste_titre">';
|
||||
print '<input class="flat" size="6" type="text" name="sref" value="'.$sref.'">';
|
||||
print '<input class="flat" size="6" type="text" name="search_ref" value="'.$search_ref.'">';
|
||||
print '</td>';
|
||||
print '<td class="liste_titre" align="left">';
|
||||
print '<input class="flat" type="text" size="6" name="sref_client" value="'.$sref_client.'">';
|
||||
print '<input class="flat" type="text" size="6" name="search_ref_customer" value="'.$search_ref_customer.'">';
|
||||
print '</td>';
|
||||
print '<td class="liste_titre" align="left">';
|
||||
print '<input class="flat" type="text" name="snom" value="'.$snom.'">';
|
||||
print '<input class="flat" type="text" name="search_company" value="'.$search_company.'">';
|
||||
print '</td>';
|
||||
print '<td class="liste_titre">';
|
||||
print '<td class="liste_titre" align="center">';
|
||||
if (! empty($conf->global->MAIN_LIST_FILTER_ON_DAY)) print '<input class="flat" type="text" size="1" maxlength="2" name="orderday" value="'.$orderday.'">';
|
||||
print '<input class="flat" type="text" size="1" maxlength="2" name="ordermonth" value="'.$ordermonth.'">';
|
||||
$formother->select_year($orderyear?$orderyear:-1,'orderyear',1, 20, 5);
|
||||
print '</td><td class="liste_titre">';
|
||||
print '</td><td class="liste_titre" align="center">';
|
||||
if (! empty($conf->global->MAIN_LIST_FILTER_ON_DAY)) print '<input class="flat" type="text" size="1" maxlength="2" name="deliveryday" value="'.$deliveryday.'">';
|
||||
print '<input class="flat" type="text" size="1" maxlength="2" name="deliverymonth" value="'.$deliverymonth.'">';
|
||||
$formother->select_year($deliveryyear?$deliveryyear:-1,'deliveryyear',1, 20, 5);
|
||||
print '</td><td class="liste_titre"> ';
|
||||
print '</td><td align="right" class="liste_titre">';
|
||||
print '<input type="image" class="liste_titre" name="button_search" src="'.img_picto($langs->trans("Search"),'search.png','','',1).'" value="'.dol_escape_htmltag($langs->trans("Search")).'" title="'.dol_escape_htmltag($langs->trans("Search")).'">';
|
||||
print '</td></tr>';
|
||||
print '</td>';
|
||||
print '<td class="liste_titre"> </td>';
|
||||
print '<td class="liste_titre" align="right"><input type="image" class="liste_titre" name="button_search" src="'.img_picto($langs->trans("Search"),'search.png','','',1).'" value="'.dol_escape_htmltag($langs->trans("Search")).'" title="'.dol_escape_htmltag($langs->trans("Search")).'">';
|
||||
print '<input type="image" class="liste_titre" name="button_removefilter" src="'.img_picto($langs->trans("Search"),'searchclear.png','','',1).'" value="'.dol_escape_htmltag($langs->trans("RemoveFilter")).'" title="'.dol_escape_htmltag($langs->trans("RemoveFilter")).'">';
|
||||
print "</td></tr>\n";
|
||||
|
||||
$var=true;
|
||||
$total=0;
|
||||
@ -443,12 +441,12 @@ if ($resql)
|
||||
print '</td>';
|
||||
|
||||
// Order date
|
||||
print '<td align="right">';
|
||||
print '<td align="center">';
|
||||
print dol_print_date($db->jdate($objp->date_commande), 'day');
|
||||
print '</td>';
|
||||
|
||||
// Delivery date
|
||||
print '<td align="right">';
|
||||
print '<td align="center">';
|
||||
print dol_print_date($db->jdate($objp->date_livraison), 'day');
|
||||
print '</td>';
|
||||
|
||||
|
||||
@ -1145,7 +1145,7 @@ class AccountLine extends CommonObject
|
||||
* @param User $user User object that delete
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*/
|
||||
function delete($user=0)
|
||||
function delete($user=null)
|
||||
{
|
||||
$nbko=0;
|
||||
|
||||
@ -1194,7 +1194,7 @@ class AccountLine extends CommonObject
|
||||
* @param User $user User object that delete
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*/
|
||||
function delete_urls($user=0)
|
||||
function delete_urls($user=null)
|
||||
{
|
||||
$nbko=0;
|
||||
|
||||
|
||||
@ -172,7 +172,7 @@ class BankCateg // extends CommonObject
|
||||
* @param int $notrigger 0=launch triggers after, 1=disable triggers
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*/
|
||||
function update($user=0, $notrigger=0)
|
||||
function update($user=null, $notrigger=0)
|
||||
{
|
||||
global $conf, $langs;
|
||||
$error=0;
|
||||
|
||||
@ -115,7 +115,7 @@ if ($month > 0)
|
||||
}
|
||||
else if ($year > 0)
|
||||
{
|
||||
$sql.= " AND bc.date_bordereau BETWEEN '".$db->idate(dol_get_first_day($year,1,false))."' AND '".$db->idate(dol_get_last_day($year,12,false))."'";
|
||||
$sql.= " AND d.dated BETWEEN '".$db->idate(dol_get_first_day($year,1,false))."' AND '".$db->idate(dol_get_last_day($year,12,false))."'";
|
||||
}
|
||||
|
||||
$sql.= $db->order($sortfield,$sortorder);
|
||||
|
||||
@ -464,6 +464,8 @@ class Facture extends CommonInvoice
|
||||
$result=$this->update_price(1);
|
||||
if ($result > 0)
|
||||
{
|
||||
$action='create';
|
||||
|
||||
// Actions on extra fields (by external module or standard code)
|
||||
// FIXME le hook fait double emploi avec le trigger !!
|
||||
$hookmanager->initHooks(array('invoicedao'));
|
||||
@ -1040,7 +1042,7 @@ class Facture extends CommonInvoice
|
||||
* @param int $notrigger 0=launch triggers after, 1=disable triggers
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*/
|
||||
function update($user=0, $notrigger=0)
|
||||
function update($user=null, $notrigger=0)
|
||||
{
|
||||
global $conf, $langs;
|
||||
$error=0;
|
||||
|
||||
@ -261,7 +261,7 @@ class PaymentTerm // extends CommonObject
|
||||
* @param int $notrigger 0=launch triggers after, 1=disable triggers
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*/
|
||||
function update($user=0, $notrigger=0)
|
||||
function update($user=null, $notrigger=0)
|
||||
{
|
||||
global $conf, $langs;
|
||||
$error=0;
|
||||
|
||||
@ -31,6 +31,7 @@ require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
|
||||
|
||||
$langs->load('bills');
|
||||
$langs->load('compta');
|
||||
|
||||
// Security check
|
||||
$id=(GETPOST('facid','int')?GETPOST('facid','int'):GETPOST('id','int'));
|
||||
|
||||
@ -127,7 +127,7 @@ class Localtax extends CommonObject
|
||||
* @param int $notrigger 0=no, 1=yes (no update trigger)
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*/
|
||||
function update($user=0, $notrigger=0)
|
||||
function update($user=null, $notrigger=0)
|
||||
{
|
||||
global $conf, $langs;
|
||||
|
||||
|
||||
@ -90,6 +90,7 @@ else
|
||||
//print '</td><td valign="top" width="70%" class="notopnoleftnoright">';
|
||||
print '</div><div class="fichetwothirdright"><div class="ficheaddleft">';
|
||||
|
||||
$max=10;
|
||||
|
||||
$sql = "SELECT bc.rowid, bc.date_bordereau as db, bc.amount, bc.number as ref";
|
||||
$sql.= ", bc.statut, bc.nbcheque";
|
||||
@ -98,8 +99,8 @@ $sql.= " FROM ".MAIN_DB_PREFIX."bordereau_cheque as bc";
|
||||
$sql.= ", ".MAIN_DB_PREFIX."bank_account as ba";
|
||||
$sql.= " WHERE ba.rowid = bc.fk_bank_account";
|
||||
$sql.= " AND bc.entity = ".$conf->entity;
|
||||
$sql.= " ORDER BY bc.rowid";
|
||||
$sql.= " DESC LIMIT 10";
|
||||
$sql.= " ORDER BY bc.date_bordereau DESC, rowid DESC";
|
||||
$sql.= $db->plimit($max);
|
||||
|
||||
$resql = $db->query($sql);
|
||||
|
||||
@ -107,7 +108,7 @@ if ($resql)
|
||||
{
|
||||
print '<table class="noborder" width="100%">';
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td>'.$langs->trans("CheckReceiptShort").'</td>';
|
||||
print '<td>'.$langs->trans("LastCheckReceiptShort",$max).'</td>';
|
||||
print '<td>'.$langs->trans("Date")."</td>";
|
||||
print '<td>'.$langs->trans("Account").'</td>';
|
||||
print '<td align="right">'.$langs->trans("NbOfCheques").'</td>';
|
||||
|
||||
@ -1,103 +0,0 @@
|
||||
<?php
|
||||
/* Copyright (C) 2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2005 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2010-2012 Juanjo Menent <jmenent@2byte.es>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* 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/prelevement/bon.php
|
||||
* \ingroup prelevement
|
||||
* \brief Fiche apercu du bon de prelevement
|
||||
*/
|
||||
|
||||
require('../../main.inc.php');
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/prelevement.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/compta/prelevement/class/bonprelevement.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
|
||||
|
||||
$langs->load("banks");
|
||||
$langs->load("categories");
|
||||
$langs->load("bills");
|
||||
$langs->load("categories");
|
||||
|
||||
// Security check
|
||||
$socid=0;
|
||||
$id = GETPOST('id','int');
|
||||
$ref = GETPOST('ref','alpha');
|
||||
if ($user->societe_id) $socid=$user->societe_id;
|
||||
$result = restrictedArea($user, 'prelevement', $id);
|
||||
|
||||
|
||||
llxHeader('','Bon de prelevement');
|
||||
|
||||
$form = new Form($db);
|
||||
|
||||
if ($id > 0 || ! empty($ref))
|
||||
{
|
||||
$object = new BonPrelevement($db,"");
|
||||
|
||||
if ($object->fetch($id) == 0)
|
||||
{
|
||||
$head = prelevement_prepare_head($object);
|
||||
dol_fiche_head($head, 'preview', 'Prelevement : '. $object->ref);
|
||||
|
||||
print '<table class="border" width="100%">';
|
||||
|
||||
print '<tr><td width="20%">'.$langs->trans("Ref").'</td><td>'.$object->ref.'</td></tr>';
|
||||
print '<tr><td width="20%">'.$langs->trans("Amount").'</td><td>'.price($object->amount).'</td></tr>';
|
||||
print '<tr><td width="20%">'.$langs->trans("File").'</td><td>';
|
||||
|
||||
$relativepath = 'bon/'.$object->ref;
|
||||
|
||||
print '<a data-ajax="false" href="'.DOL_URL_ROOT.'/document.php?type=text/plain&modulepart=prelevement&file='.urlencode($relativepath).'">'.$object->ref.'</a>';
|
||||
|
||||
print '</td></tr>';
|
||||
print '</table><br>';
|
||||
|
||||
$fileimage = $conf->prelevement->dir_output.'/receipts/'.$object->ref.'.ps.png.0';
|
||||
$fileps = $conf->prelevement->dir_output.'/receipts/'.$object->ref.'.ps';
|
||||
|
||||
// Conversion du PDF en image png si fichier png non existant
|
||||
if (!file_exists($fileimage))
|
||||
{
|
||||
if (class_exists("Imagick"))
|
||||
{
|
||||
$ret = dol_convert_file($file,'png',$fileimage);
|
||||
if ($ret < 0) $error++;
|
||||
}
|
||||
else
|
||||
{
|
||||
$langs->load("errors");
|
||||
print '<font class="error">'.$langs->trans("ErrorNoImagickReadimage").'</font>';
|
||||
}
|
||||
}
|
||||
|
||||
if (file_exists($fileimage))
|
||||
{
|
||||
print '<img src="'.DOL_URL_ROOT.'/viewimage.php?modulepart=prelevement&file='.urlencode(basename($fileimage)).'">';
|
||||
|
||||
}
|
||||
|
||||
dol_fiche_end();
|
||||
}
|
||||
else
|
||||
{
|
||||
dol_print_error($db);
|
||||
}
|
||||
}
|
||||
|
||||
llxFooter();
|
||||
@ -755,6 +755,8 @@ class BonPrelevement extends CommonObject
|
||||
$factures = array();
|
||||
$factures_prev = array();
|
||||
$factures_result = array();
|
||||
$factures_prev_id=array();
|
||||
$factures_errors=array();
|
||||
|
||||
if (! $error)
|
||||
{
|
||||
@ -821,7 +823,9 @@ class BonPrelevement extends CommonObject
|
||||
{
|
||||
$bac = new CompanyBankAccount($this->db);
|
||||
$bac->fetch(0,$soc->id);
|
||||
|
||||
if ($bac->verif() >= 1)
|
||||
//if (true)
|
||||
{
|
||||
$factures_prev[$i] = $fac;
|
||||
/* second tableau necessaire pour BonPrelevement */
|
||||
@ -1226,26 +1230,24 @@ class BonPrelevement extends CommonObject
|
||||
* @return int 0 if OK, <0 if KO
|
||||
*/
|
||||
//TODO: Optimize code to read lines in a single function
|
||||
function Generate()
|
||||
function generate()
|
||||
{
|
||||
global $conf,$langs,$mysoc;
|
||||
|
||||
$result = 0;
|
||||
|
||||
dol_syslog(get_class($this)."::Generate build file ".$this->filename);
|
||||
dol_syslog(get_class($this)."::generate build file ".$this->filename);
|
||||
|
||||
$this->file = fopen($this->filename,"w");
|
||||
|
||||
$found=0;
|
||||
|
||||
// Build file for European countries
|
||||
if (! $mysoc->isInEEC())
|
||||
if ($mysoc->isInEEC())
|
||||
{
|
||||
$found++;
|
||||
|
||||
/**
|
||||
* SECTION CREATION FICHIER SEPA
|
||||
* SECTION CREATION FICHIER SEPA
|
||||
* SECTION CREATION FICHIER SEPA
|
||||
*/
|
||||
// SEPA Initialisation
|
||||
@ -1308,8 +1310,6 @@ class BonPrelevement extends CommonObject
|
||||
}
|
||||
|
||||
/**
|
||||
* SECTION CREATION FICHIER SEPA
|
||||
* SECTION CREATION FICHIER SEPA
|
||||
* SECTION CREATION FICHIER SEPA
|
||||
*/
|
||||
// SEPA File Header
|
||||
@ -1401,11 +1401,14 @@ class BonPrelevement extends CommonObject
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
{
|
||||
$result = -2;
|
||||
}
|
||||
|
||||
$langs->load('withdrawals');
|
||||
fputs($this->file, $langs->trans('WithdrawalFileNotCapable'));
|
||||
|
||||
// TODO Add here code to generate a generic file
|
||||
fputs($this->file, $langs->trans('WithdrawalFileNotCapable', $mysoc->country_code));
|
||||
}
|
||||
|
||||
fclose($this->file);
|
||||
|
||||
@ -173,7 +173,8 @@ class RejetPrelevement
|
||||
}
|
||||
//Tag invoice as unpaid
|
||||
dol_syslog("RejetPrelevement::Create set_unpaid fac ".$fac->ref);
|
||||
$fac->set_unpaid($fac->id, $user);
|
||||
|
||||
$fac->set_unpaid($user);
|
||||
|
||||
//TODO: Must be managed by notifications module
|
||||
// Send email to sender of the standing order request
|
||||
@ -194,7 +195,7 @@ class RejetPrelevement
|
||||
}
|
||||
|
||||
/**
|
||||
* Envoi mail
|
||||
* Send email to all users that has asked the withdraw request
|
||||
*
|
||||
* @param Facture $fac Invoice object
|
||||
* @return void
|
||||
|
||||
@ -32,7 +32,7 @@ require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
|
||||
|
||||
$langs->load("banks");
|
||||
$langs->load("categories");
|
||||
$langs->load("widthdrawals");
|
||||
$langs->load("withdrawals");
|
||||
$langs->load("companies");
|
||||
|
||||
// Security check
|
||||
|
||||
@ -213,6 +213,7 @@ else
|
||||
dol_print_error($db);
|
||||
}
|
||||
|
||||
$db->close();
|
||||
|
||||
llxFooter();
|
||||
|
||||
$db->close();
|
||||
|
||||
@ -105,10 +105,13 @@ if ($action == 'confirm_rejet')
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* View
|
||||
*/
|
||||
|
||||
$invoicestatic=new Facture($db);
|
||||
|
||||
llxHeader('',$langs->trans("StandingOrder"));
|
||||
|
||||
$h = 0;
|
||||
@ -134,9 +137,7 @@ if ($id)
|
||||
print '<a href="card.php?id='.$lipre->bon_rowid.'">'.$lipre->bon_ref.'</a></td></tr>';
|
||||
print '<tr><td width="20%">'.$langs->trans("Date").'</td><td>'.dol_print_date($bon->datec,'day').'</td></tr>';
|
||||
print '<tr><td width="20%">'.$langs->trans("Amount").'</td><td>'.price($lipre->amount).'</td></tr>';
|
||||
print '<tr><td width="20%">'.$langs->trans("Status").'</td><td>';
|
||||
|
||||
print $lipre->LibStatut($lipre->statut,1).'</td></tr>';
|
||||
print '<tr><td width="20%">'.$langs->trans("Status").'</td><td>'.$lipre->LibStatut($lipre->statut,1).'</td></tr>';
|
||||
|
||||
if ($lipre->statut == 3)
|
||||
{
|
||||
@ -215,7 +216,7 @@ if ($id)
|
||||
print '</table><br>';
|
||||
|
||||
//Confirm Button
|
||||
print '<center><input type="submit" class="valid" value='.$langs->trans("Confirm").'><center>';
|
||||
print '<center><input type="submit" class="button" value='.$langs->trans("Confirm").'><center>';
|
||||
print '</form>';
|
||||
}
|
||||
|
||||
@ -229,13 +230,20 @@ if ($id)
|
||||
|
||||
if ($action == '')
|
||||
{
|
||||
if ($bon->statut == 2 && $lipre->statut == 2 && $user->rights->prelevement->bons->credit)
|
||||
if ($bon->statut == 2 && $lipre->statut == 2)
|
||||
{
|
||||
print "<a class=\"butAction\" href=\"ligne.php?action=rejet&id=$lipre->id\">".$langs->trans("StandingOrderReject")."</a>";
|
||||
if ($user->rights->prelevement->bons->credit)
|
||||
{
|
||||
print "<a class=\"butAction\" href=\"ligne.php?action=rejet&id=$lipre->id\">".$langs->trans("StandingOrderReject")."</a>";
|
||||
}
|
||||
else
|
||||
{
|
||||
print "<a class=\"butActionRefused\" href=\"#\" title=\"".$langs->trans("NotAllowed")."\">".$langs->trans("StandingOrderReject")."</a>";
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
print "<a class=\"butActionRefused\" href=\"#\">".$langs->trans("StandingOrderReject")."</a>";
|
||||
print "<a class=\"butActionRefused\" href=\"#\" title=\"".$langs->trans("NotPossibleForThisStatusOfWithdrawReceiptORLine")."\">".$langs->trans("StandingOrderReject")."</a>";
|
||||
}
|
||||
}
|
||||
|
||||
@ -256,7 +264,7 @@ if ($id)
|
||||
* Liste des factures
|
||||
*/
|
||||
$sql = "SELECT pf.rowid";
|
||||
$sql.= " ,f.rowid as facid, f.facnumber as ref, f.total_ttc";
|
||||
$sql.= " ,f.rowid as facid, f.facnumber as ref, f.total_ttc, f.paye, f.fk_statut";
|
||||
$sql.= " , s.rowid as socid, s.nom as name";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."prelevement_bons as p";
|
||||
$sql.= " , ".MAIN_DB_PREFIX."prelevement_lignes as pl";
|
||||
@ -287,7 +295,7 @@ if ($id)
|
||||
print"\n<!-- debut table -->\n";
|
||||
print '<table class="noborder" width="100%" cellspacing="0" cellpadding="4">';
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td>'.$langs->trans("Invoice").'</td><td>'.$langs->trans("ThirdParty").'</td><td align="right">'.$langs->trans("Amount").'</td>';
|
||||
print '<td>'.$langs->trans("Invoice").'</td><td>'.$langs->trans("ThirdParty").'</td><td align="right">'.$langs->trans("Amount").'</td><td align="right">'.$langs->trans("Status").'</td>';
|
||||
print '</tr>';
|
||||
|
||||
$var=True;
|
||||
@ -312,6 +320,11 @@ if ($id)
|
||||
|
||||
print '<td align="right">'.price($obj->total_ttc)."</td>\n";
|
||||
|
||||
print '<td align="right">';
|
||||
$invoicestatic->fetch($obj->facid);
|
||||
print $invoicestatic->getLibStatut(5);
|
||||
print "</td>\n";
|
||||
|
||||
print "</tr>\n";
|
||||
|
||||
$i++;
|
||||
|
||||
@ -560,7 +560,7 @@ print '<tr class="liste_titre"><td class="liste_titre"> </td>';
|
||||
|
||||
for ($annee = $year_start ; $annee <= $year_end ; $annee++)
|
||||
{
|
||||
print '<td align="center" colspan="2">';
|
||||
print '<td align="center" colspan="2" class="borderrightlight">';
|
||||
print '<a href="clientfourn.php?year='.$annee.'">';
|
||||
print $annee;
|
||||
if ($conf->global->SOCIETE_FISCAL_MONTH_START > 1) print '-'.($annee+1);
|
||||
@ -571,7 +571,7 @@ print '<tr class="liste_titre"><td class="liste_titre">'.$langs->trans("Month").
|
||||
for ($annee = $year_start ; $annee <= $year_end ; $annee++)
|
||||
{
|
||||
print '<td align="right">'.$langs->trans("Outcome").'</td>';
|
||||
print '<td align="right">'.$langs->trans("Income").'</td>';
|
||||
print '<td align="right" class="borderrightlight">'.$langs->trans("Income").'</td>';
|
||||
}
|
||||
print '</tr>';
|
||||
|
||||
@ -601,7 +601,7 @@ for ($mois = 1+$nb_mois_decalage ; $mois <= 12+$nb_mois_decalage ; $mois++)
|
||||
}
|
||||
print "</td>";
|
||||
|
||||
print '<td align="right"> ';
|
||||
print '<td align="right" class="borderrightlight"> ';
|
||||
//if (isset($encaiss_ttc[$case]) && $encaiss_ttc[$case] != 0)
|
||||
if (isset($encaiss_ttc[$case]))
|
||||
{
|
||||
@ -623,7 +623,7 @@ for ($annee = $year_start ; $annee <= $year_end ; $annee++)
|
||||
{
|
||||
$nbcols+=2;
|
||||
print '<td align="right">'.(isset($totsorties[$annee])?price(price2num($totsorties[$annee],'MT')):' ').'</td>';
|
||||
print '<td align="right">'.(isset($totentrees[$annee])?price(price2num($totentrees[$annee],'MT')):' ').'</td>';
|
||||
print '<td align="right" style="border-right: 1px solid #DDD">'.(isset($totentrees[$annee])?price(price2num($totentrees[$annee],'MT')):' ').'</td>';
|
||||
}
|
||||
print "</tr>\n";
|
||||
|
||||
@ -637,7 +637,7 @@ $var=!$var;
|
||||
print '<tr class="liste_total"><td>'.$langs->trans("Profit").'</td>';
|
||||
for ($annee = $year_start ; $annee <= $year_end ; $annee++)
|
||||
{
|
||||
print '<td align="right" colspan="2"> ';
|
||||
print '<td align="right" colspan="2" class="borderrightlight"> ';
|
||||
if (isset($totentrees[$annee]) || isset($totsorties[$annee]))
|
||||
{
|
||||
$in=(isset($totentrees[$annee])?price2num($totentrees[$annee], 'MT'):0);
|
||||
|
||||
@ -73,7 +73,7 @@ class PaymentSalary extends CommonObject
|
||||
* @param int $notrigger 0=no, 1=yes (no update trigger)
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*/
|
||||
function update($user=0, $notrigger=0)
|
||||
function update($user=null, $notrigger=0)
|
||||
{
|
||||
global $conf, $langs;
|
||||
|
||||
@ -127,7 +127,7 @@ class PaymentSalary extends CommonObject
|
||||
{
|
||||
// Call trigger
|
||||
$result=$this->call_trigger('PAYMENT_SALARY_MODIFY',$user);
|
||||
if ($result < 0) $error++;
|
||||
if ($result < 0) $error++;
|
||||
// End call triggers
|
||||
|
||||
//FIXME: Add rollback if trigger fail
|
||||
@ -144,7 +144,7 @@ class PaymentSalary extends CommonObject
|
||||
* @param User $user User that load
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*/
|
||||
function fetch($id, $user=0)
|
||||
function fetch($id, $user=null)
|
||||
{
|
||||
global $langs;
|
||||
$sql = "SELECT";
|
||||
@ -223,12 +223,12 @@ class PaymentSalary extends CommonObject
|
||||
global $conf, $langs;
|
||||
|
||||
$error=0;
|
||||
|
||||
|
||||
// Call trigger
|
||||
$result=$this->call_trigger('PAYMENT_SALARY_DELETE',$user);
|
||||
if ($result < 0) return -1;
|
||||
// End call triggers
|
||||
|
||||
|
||||
|
||||
$sql = "DELETE FROM ".MAIN_DB_PREFIX."payment_salary";
|
||||
$sql.= " WHERE rowid=".$this->id;
|
||||
@ -279,7 +279,7 @@ class PaymentSalary extends CommonObject
|
||||
function create($user)
|
||||
{
|
||||
global $conf,$langs;
|
||||
|
||||
|
||||
$error=0;
|
||||
|
||||
// Clean parameters
|
||||
@ -414,7 +414,6 @@ class PaymentSalary extends CommonObject
|
||||
$this->fk_user,
|
||||
DOL_URL_ROOT.'/user/card.php?id=',
|
||||
$langs->trans("SalaryPayment").' '.$fuser->getFullName($langs).' '.dol_print_date($this->datesp,'dayrfc').' '.dol_print_date($this->dateep,'dayrfc'),
|
||||
'(User)',
|
||||
'user'
|
||||
);
|
||||
|
||||
@ -427,9 +426,9 @@ class PaymentSalary extends CommonObject
|
||||
|
||||
// Call trigger
|
||||
$result=$this->call_trigger('PAYMENT_SALARY_CREATE',$user);
|
||||
if ($result < 0) $error++;
|
||||
if ($result < 0) $error++;
|
||||
// End call triggers
|
||||
|
||||
|
||||
}
|
||||
else $error++;
|
||||
|
||||
|
||||
@ -62,17 +62,19 @@ class ChargeSociales extends CommonObject
|
||||
/**
|
||||
* Retrouve et charge une charge sociale
|
||||
*
|
||||
* @param int $id 1 si trouve, 0 sinon
|
||||
* @param int $id Id
|
||||
* @param string $ref Ref
|
||||
* @return void
|
||||
*/
|
||||
function fetch($id)
|
||||
function fetch($id, $ref='')
|
||||
{
|
||||
$sql = "SELECT cs.rowid, cs.date_ech,";
|
||||
$sql.= " cs.libelle as lib, cs.fk_type, cs.amount, cs.paye, cs.periode,";
|
||||
$sql.= " c.libelle";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."chargesociales as cs, ".MAIN_DB_PREFIX."c_chargesociales as c";
|
||||
$sql.= " WHERE cs.fk_type = c.id";
|
||||
$sql.= " AND cs.rowid = ".$id;
|
||||
if ($ref) $sql.= " AND cs.rowid = ".$ref;
|
||||
else $sql.= " AND cs.rowid = ".$id;
|
||||
|
||||
dol_syslog(get_class($this)."::fetch", LOG_DEBUG);
|
||||
$resql=$this->db->query($sql);
|
||||
|
||||
@ -220,7 +220,7 @@ class PaymentSocialContribution extends CommonObject
|
||||
* @param int $notrigger 0=launch triggers after, 1=disable triggers
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*/
|
||||
function update($user=0, $notrigger=0)
|
||||
function update($user=null, $notrigger=0)
|
||||
{
|
||||
global $conf, $langs;
|
||||
$error=0;
|
||||
|
||||
@ -184,7 +184,7 @@ print '<tr class="liste_titre"><td> </td>';
|
||||
for ($annee = $year_start ; $annee <= $year_end ; $annee++)
|
||||
{
|
||||
if ($modecompta == 'CREANCES-DETTES') print '<td align="center" width="10%" colspan="3">';
|
||||
else print '<td align="center" width="10%" colspan="2">';
|
||||
else print '<td align="center" width="10%" colspan="2" class="borderrightlight">';
|
||||
print '<a href="casoc.php?year='.$annee.'">';
|
||||
print $annee;
|
||||
if ($conf->global->SOCIETE_FISCAL_MONTH_START > 1) print '-'.($annee+1);
|
||||
@ -198,7 +198,7 @@ for ($annee = $year_start ; $annee <= $year_end ; $annee++)
|
||||
{
|
||||
if ($modecompta == 'CREANCES-DETTES') print '<td align="right">'.$langs->trans("AmountHT").'</td>';
|
||||
print '<td align="right">'.$langs->trans("AmountTTC").'</td>';
|
||||
print '<td align="right">'.$langs->trans("Delta").'</td>';
|
||||
print '<td align="right" class="borderrightlight">'.$langs->trans("Delta").'</td>';
|
||||
if ($annee != $year_end) print '<td width="15"> </td>';
|
||||
}
|
||||
print '</tr>';
|
||||
@ -244,7 +244,7 @@ for ($mois = 1+$nb_mois_decalage ; $mois <= 12+$nb_mois_decalage ; $mois++)
|
||||
}
|
||||
print "</td>";
|
||||
}
|
||||
|
||||
|
||||
// Valeur CA du mois
|
||||
print '<td align="right">';
|
||||
if ($cum[$case])
|
||||
@ -266,29 +266,29 @@ for ($mois = 1+$nb_mois_decalage ; $mois <= 12+$nb_mois_decalage ; $mois++)
|
||||
{
|
||||
$percent=(round(($cum[$case]-$cum[$caseprev])/$cum[$caseprev],4)*100);
|
||||
//print "X $cum[$case] - $cum[$caseprev] - $cum[$caseprev] - $percent X";
|
||||
print '<td align="right">'.($percent>=0?"+$percent":"$percent").'%</td>';
|
||||
print '<td align="right" class="borderrightlight">'.($percent>=0?"+$percent":"$percent").'%</td>';
|
||||
}
|
||||
if ($cum[$caseprev] && ! $cum[$case])
|
||||
{
|
||||
print '<td align="right">-100%</td>';
|
||||
print '<td align="right" class="borderrightlight">-100%</td>';
|
||||
}
|
||||
if (! $cum[$caseprev] && $cum[$case])
|
||||
{
|
||||
//print '<td align="right">+Inf%</td>';
|
||||
print '<td align="right">-</td>';
|
||||
print '<td align="right" class="borderrightlight">-</td>';
|
||||
}
|
||||
if (isset($cum[$caseprev]) && ! $cum[$caseprev] && ! $cum[$case])
|
||||
{
|
||||
print '<td align="right">+0%</td>';
|
||||
print '<td align="right" class="borderrightlight">+0%</td>';
|
||||
}
|
||||
if (! isset($cum[$caseprev]) && ! $cum[$case])
|
||||
{
|
||||
print '<td align="right">-</td>';
|
||||
print '<td align="right" class="borderrightlight">-</td>';
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<td align="right">';
|
||||
print '<td align="right" class="borderrightlight">';
|
||||
if ($minyearmonth <= $case && $case <= $maxyearmonth) { print '-'; }
|
||||
else { print ' '; }
|
||||
print '</td>';
|
||||
@ -382,7 +382,7 @@ for ($annee = $year_start ; $annee <= $year_end ; $annee++)
|
||||
print '<td> </td>';
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Montant total
|
||||
if ($total[$annee] || ($annee >= $minyear && $annee <= max($nowyear,$maxyear)))
|
||||
{
|
||||
@ -398,24 +398,24 @@ for ($annee = $year_start ; $annee <= $year_end ; $annee++)
|
||||
{
|
||||
if ($total[$annee-1] && $total[$annee]) {
|
||||
$percent=(round(($total[$annee]-$total[$annee-1])/$total[$annee-1],4)*100);
|
||||
print '<td align="right" class="nowrap">'.($percent>=0?"+$percent":"$percent").'%</td>';
|
||||
print '<td align="right" class="nowrap borderrightlight">'.($percent>=0?"+$percent":"$percent").'%</td>';
|
||||
}
|
||||
if ($total[$annee-1] && ! $total[$annee])
|
||||
{
|
||||
print '<td align="right">-100%</td>';
|
||||
print '<td align="right" class="borderrightlight">-100%</td>';
|
||||
}
|
||||
if (! $total[$annee-1] && $total[$annee])
|
||||
{
|
||||
print '<td align="right">+Inf%</td>';
|
||||
print '<td align="right" class="borderrightlight">+Inf%</td>';
|
||||
}
|
||||
if (! $total[$annee-1] && ! $total[$annee])
|
||||
{
|
||||
print '<td align="right">+0%</td>';
|
||||
print '<td align="right" class="borderrightlight">+0%</td>';
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<td align="right">';
|
||||
print '<td align="right" class="borderrightlight">';
|
||||
if ($total[$annee] || ($minyear <= $annee && $annee <= max($nowyear,$maxyear))) { print '-'; }
|
||||
else { print ' '; }
|
||||
print '</td>';
|
||||
|
||||
@ -143,7 +143,7 @@ class Tva extends CommonObject
|
||||
* @param int $notrigger 0=no, 1=yes (no update trigger)
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*/
|
||||
function update($user=0, $notrigger=0)
|
||||
function update($user=null, $notrigger=0)
|
||||
{
|
||||
global $conf, $langs;
|
||||
|
||||
@ -205,7 +205,7 @@ class Tva extends CommonObject
|
||||
* @param User $user User that load
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*/
|
||||
function fetch($id, $user=0)
|
||||
function fetch($id, $user=null)
|
||||
{
|
||||
global $langs;
|
||||
$sql = "SELECT";
|
||||
|
||||
@ -220,7 +220,7 @@ class Contact extends CommonObject
|
||||
* @param string $action Current action for hookmanager
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*/
|
||||
function update($id, $user=0, $notrigger=0, $action='update')
|
||||
function update($id, $user=null, $notrigger=0, $action='update')
|
||||
{
|
||||
global $conf, $langs, $hookmanager;
|
||||
|
||||
@ -283,6 +283,8 @@ class Contact extends CommonObject
|
||||
unset($this->state_code);
|
||||
unset($this->state);
|
||||
|
||||
$action='update';
|
||||
|
||||
// Actions on extra fields (by external module or standard code)
|
||||
$hookmanager->initHooks(array('contactdao'));
|
||||
$parameters=array('socid'=>$this->id);
|
||||
@ -427,7 +429,7 @@ class Contact extends CommonObject
|
||||
* @param User $user User asking to change alert or birthday
|
||||
* @return int <0 if KO, >=0 if OK
|
||||
*/
|
||||
function update_perso($id, $user=0)
|
||||
function update_perso($id, $user=null)
|
||||
{
|
||||
$error=0;
|
||||
$result=false;
|
||||
@ -492,7 +494,7 @@ class Contact extends CommonObject
|
||||
* @param User $user Utilisateur (abonnes aux alertes) qui veut les alertes de ce contact
|
||||
* @return int -1 if KO, 0 if OK but not found, 1 if OK
|
||||
*/
|
||||
function fetch($id, $user=0)
|
||||
function fetch($id, $user=null)
|
||||
{
|
||||
global $langs;
|
||||
|
||||
@ -910,7 +912,7 @@ class Contact extends CommonObject
|
||||
global $langs;
|
||||
$langs->load("dict");
|
||||
|
||||
$code=(! empty($this->civility_id)?$this->civility_id:(! empty($this->civility_id)?$this->civility_id:''));
|
||||
$code=(! empty($this->civility_id)?$this->civility_id:(! empty($this->civilite_id)?$this->civilite_id:''));
|
||||
if (empty($code)) return '';
|
||||
return $langs->getLabelFromKey($this->db, "Civility".$code, "c_civility", "code", "label", $code);
|
||||
}
|
||||
|
||||
@ -357,7 +357,6 @@ if ($result)
|
||||
print '</td>';
|
||||
print '<td class="liste_titre" align="right">';
|
||||
print '<input type="image" value="button_search" class="liste_titre" src="'.img_picto($langs->trans("Search"),'search.png','','',1).'" value="'.dol_escape_htmltag($langs->trans("Search")).'" title="'.dol_escape_htmltag($langs->trans("Search")).'">';
|
||||
print ' ';
|
||||
print '<input type="image" value="button_removefilter" class="liste_titre" src="'.img_picto($langs->trans("Search"),'searchclear.png','','',1).'" value="'.dol_escape_htmltag($langs->trans("RemoveFilter")).'" title="'.dol_escape_htmltag($langs->trans("RemoveFilter")).'">';
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
|
||||
@ -1290,7 +1290,8 @@ else
|
||||
$productstatic->ref=$objp->label;
|
||||
print $productstatic->getNomUrl(0,'',16);
|
||||
}
|
||||
if ($objp->description) print '<br>'.dol_nl2br($objp->description);
|
||||
if (! empty($conf->global->PRODUIT_DESC_IN_FORM) and $objp->description)
|
||||
print '<br>'.dol_nl2br($objp->description);
|
||||
print '</td>';
|
||||
}
|
||||
else
|
||||
|
||||
@ -989,7 +989,7 @@ class Contrat extends CommonObject
|
||||
* @param int $notrigger 0=launch triggers after, 1=disable triggers
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*/
|
||||
function update($user=0, $notrigger=0)
|
||||
function update($user=null, $notrigger=0)
|
||||
{
|
||||
global $conf, $langs;
|
||||
$error=0;
|
||||
|
||||
@ -51,8 +51,6 @@ for($i = 0; $i < $length; $i++)
|
||||
$sessionkey='dol_antispam_value';
|
||||
$_SESSION[$sessionkey]=$string;
|
||||
|
||||
header("Content-type: image/png");
|
||||
|
||||
$img = imagecreate(80,32);
|
||||
if (empty($img))
|
||||
{
|
||||
@ -60,6 +58,8 @@ if (empty($img))
|
||||
exit;
|
||||
}
|
||||
|
||||
header("Content-type: image/png");
|
||||
|
||||
$background_color = imagecolorallocate($img, 250, 250, 250);
|
||||
$ecriture_color = imagecolorallocate($img, 0, 0, 0);
|
||||
imagestring($img, 4, 24, 8, $string, $ecriture_color);
|
||||
|
||||
@ -159,6 +159,7 @@ class box_actions extends ModeleBoxes
|
||||
$actioncejour=false;
|
||||
$contents=$this->info_box_contents;
|
||||
$nblines=count($contents);
|
||||
$bcx=array();
|
||||
$bcx[0] = 'class="box_pair"';
|
||||
$bcx[1] = 'class="box_impair"';
|
||||
if ($contents[0][0]['text'] != $langs->trans("NoActionsToDo"))
|
||||
|
||||
@ -181,6 +181,7 @@ class ModeleBoxes // Can't be abtract as it is instantiated to build "empty"
|
||||
global $langs,$conf;
|
||||
|
||||
$MAXLENGTHBOX=60; // Mettre 0 pour pas de limite
|
||||
$bcx=array();
|
||||
$bcx[0] = 'class="box_pair"';
|
||||
$bcx[1] = 'class="box_impair"';
|
||||
$var = false;
|
||||
|
||||
@ -191,7 +191,7 @@ class Ccountry // extends CommonObject
|
||||
* @param int $notrigger 0=launch triggers after, 1=disable triggers
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*/
|
||||
function update($user=0, $notrigger=0)
|
||||
function update($user=null, $notrigger=0)
|
||||
{
|
||||
global $conf, $langs;
|
||||
$error=0;
|
||||
@ -256,10 +256,10 @@ class Ccountry // extends CommonObject
|
||||
|
||||
|
||||
/**
|
||||
* Delete object in database
|
||||
* Delete object in database
|
||||
*
|
||||
* @param User $user User that delete
|
||||
* @param int $notrigger 0=launch triggers after, 1=disable triggers
|
||||
* @param User $user User that delete
|
||||
* @param int $notrigger 0=launch triggers after, 1=disable triggers
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*/
|
||||
function delete($user, $notrigger=0)
|
||||
|
||||
@ -34,7 +34,7 @@
|
||||
*/
|
||||
abstract class CommonObject
|
||||
{
|
||||
protected $db;
|
||||
public $db;
|
||||
public $error;
|
||||
public $errors;
|
||||
public $canvas; // Contains canvas name if it is
|
||||
@ -609,6 +609,10 @@ abstract class CommonObject
|
||||
|
||||
if (empty($this->socid) && empty($this->fk_soc) && empty($this->fk_thirdparty)) return 0;
|
||||
|
||||
require_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php';
|
||||
|
||||
require_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php';
|
||||
|
||||
$thirdparty = new Societe($this->db);
|
||||
$result=$thirdparty->fetch(isset($this->socid)?$this->socid:(isset($this->fk_soc)?$this->fk_soc:$this->fk_thirdparty));
|
||||
$this->client = $thirdparty; // deprecated
|
||||
@ -1823,7 +1827,7 @@ abstract class CommonObject
|
||||
|
||||
if (empty($sourceid) && empty($targetid))
|
||||
{
|
||||
dol_print_error('','Bad usage of function. No parameter defined and no id defined');
|
||||
dol_syslog('Bad usage of function. No source nor target id defined (nor as parameter nor as object id)', LOG_ERROR);
|
||||
return -1;
|
||||
}
|
||||
|
||||
@ -2523,14 +2527,14 @@ abstract class CommonObject
|
||||
if (! empty($conf->margin->enabled) && empty($user->societe_id))
|
||||
{
|
||||
if ($conf->global->MARGIN_TYPE == "1")
|
||||
print '<td align="right" width="80">'.$langs->trans('BuyingPrice').'</td>';
|
||||
print '<td align="right" class="margininfos" width="80">'.$langs->trans('BuyingPrice').'</td>';
|
||||
else
|
||||
print '<td align="right" width="80">'.$langs->trans('CostPrice').'</td>';
|
||||
print '<td align="right" class="margininfos" width="80">'.$langs->trans('CostPrice').'</td>';
|
||||
|
||||
if (! empty($conf->global->DISPLAY_MARGIN_RATES) && $user->rights->margins->liretous)
|
||||
print '<td align="right" width="50">'.$langs->trans('MarginRate').'</td>';
|
||||
print '<td align="right" class="margininfos" width="50">'.$langs->trans('MarginRate').'</td>';
|
||||
if (! empty($conf->global->DISPLAY_MARK_RATES) && $user->rights->margins->liretous)
|
||||
print '<td align="right" width="50">'.$langs->trans('MarkRate').'</td>';
|
||||
print '<td align="right" class="margininfos" width="50">'.$langs->trans('MarkRate').'</td>';
|
||||
}
|
||||
|
||||
// Total HT
|
||||
@ -3010,11 +3014,16 @@ abstract class CommonObject
|
||||
|
||||
$marginInfo = $this->getMarginInfos($force_price);
|
||||
|
||||
if (! empty($conf->global->MARGININFO_HIDE_SHOW))
|
||||
{
|
||||
print "<img onclick=\"$('.margininfos').toggle();\" src='".img_picto($langs->trans("Hide")."/".$langs->trans("Show"),'object_margin.png','','',1)."'>";
|
||||
if ($conf->global->MARGININFO_HIDE_SHOW == 2) print '<script>$(document).ready(function() {$(".margininfos").hide();});</script>'; // hide by default
|
||||
}
|
||||
print $langs->trans('ShowMarginInfos').' : ';
|
||||
$hidemargininfos = $_COOKIE['DOLUSER_MARGININFO_HIDE_SHOW'];
|
||||
print '<span id="showMarginInfos" class="linkobject '.(!empty($hidemargininfos)?'':'hideobject').'">'.img_picto($langs->trans("Disabled"),'switch_off').'</span>';
|
||||
print '<span id="hideMarginInfos" class="linkobject '.(!empty($hidemargininfos)?'hideobject':'').'">'.img_picto($langs->trans("Enabled"),'switch_on').'</span>';
|
||||
|
||||
print '<script>$(document).ready(function() {
|
||||
$("span#showMarginInfos").click(function() { $.getScript( "'.dol_buildpath('/includes/jquery/plugins/jquerytreeview/lib/jquery.cookie.js', 1).'", function( data, textStatus, jqxhr ) { $.cookie("DOLUSER_MARGININFO_HIDE_SHOW", 0); $(".margininfos").show(); $("span#showMarginInfos").addClass("hideobject"); $("span#hideMarginInfos").removeClass("hideobject");})});
|
||||
$("span#hideMarginInfos").click(function() { $.getScript( "'.dol_buildpath('/includes/jquery/plugins/jquerytreeview/lib/jquery.cookie.js', 1).'", function( data, textStatus, jqxhr ) { $.cookie("DOLUSER_MARGININFO_HIDE_SHOW", 1); $(".margininfos").hide(); $("span#hideMarginInfos").addClass("hideobject"); $("span#showMarginInfos").removeClass("hideobject");})});
|
||||
});</script>';
|
||||
if (!empty($hidemargininfos)) print '<script>$(document).ready(function() {$(".margininfos").hide();});</script>';
|
||||
|
||||
print '<table class="nobordernopadding margintable" width="100%">';
|
||||
print '<tr class="liste_titre">';
|
||||
|
||||
@ -198,7 +198,7 @@ class Ctypent // extends CommonObject
|
||||
* @param int $notrigger 0=launch triggers after, 1=disable triggers
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*/
|
||||
function update($user=0, $notrigger=0)
|
||||
function update($user=null, $notrigger=0)
|
||||
{
|
||||
global $conf, $langs;
|
||||
$error=0;
|
||||
|
||||
@ -154,7 +154,7 @@ class Events // extends CommonObject
|
||||
* @param int $notrigger 0=no, 1=yes (no update trigger)
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*/
|
||||
function update($user=0, $notrigger=0)
|
||||
function update($user=null, $notrigger=0)
|
||||
{
|
||||
global $conf, $langs;
|
||||
|
||||
@ -191,7 +191,7 @@ class Events // extends CommonObject
|
||||
* @param User $user User that load
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*/
|
||||
function fetch($id, $user=0)
|
||||
function fetch($id, $user=null)
|
||||
{
|
||||
global $langs;
|
||||
|
||||
|
||||
@ -56,7 +56,7 @@ class ExtraFields
|
||||
var $error;
|
||||
var $errno;
|
||||
|
||||
static $type2label=array(
|
||||
public static $type2label=array(
|
||||
'varchar'=>'String',
|
||||
'text'=>'TextLong',
|
||||
'int'=>'Int',
|
||||
@ -157,7 +157,7 @@ class ExtraFields
|
||||
{
|
||||
$table=$elementtype.'_extrafields';
|
||||
|
||||
if (! empty($attrname) && preg_match("/^\w[a-zA-Z0-9-_]*$/",$attrname) && ! is_numeric($attrname))
|
||||
if (! empty($attrname) && preg_match("/^\w[a-zA-Z0-9_]*$/",$attrname) && ! is_numeric($attrname))
|
||||
{
|
||||
if ($type=='boolean') {
|
||||
$typedb='int';
|
||||
@ -752,15 +752,17 @@ class ExtraFields
|
||||
if (strpos($InfoFieldList[4], 'extra')!==false)
|
||||
{
|
||||
$sql.= ' as main, '.MAIN_DB_PREFIX .$InfoFieldList[0].'_extrafields as extra';
|
||||
$sqlwhere.= ' AND extra.fk_object=main.'.$InfoFieldList[2]. ' AND '.$InfoFieldList[4];
|
||||
$sqlwhere.= ' WHERE extra.fk_object=main.'.$InfoFieldList[2]. ' AND '.$InfoFieldList[4];
|
||||
}
|
||||
else
|
||||
{
|
||||
$sqlwhere.= ' AND '.$InfoFieldList[4];
|
||||
$sqlwhere.= ' WHERE '.$InfoFieldList[4];
|
||||
}
|
||||
}else {
|
||||
$sqlwhere.= ' WHERE 1';
|
||||
}
|
||||
if (in_array($InfoFieldList[0],array('tablewithentity'))) $sqlwhere.= ' AND entity = '.$conf->entity; // Some tables may have field, some other not. For the moment we disable it.
|
||||
$sql.=preg_replace('/^ AND /','',$sqlwhere);
|
||||
//$sql.=preg_replace('/^ AND /','',$sqlwhere);
|
||||
//print $sql;
|
||||
|
||||
dol_syslog(get_class($this).'::showInputField type=sellist', LOG_DEBUG);
|
||||
@ -988,7 +990,10 @@ class ExtraFields
|
||||
{
|
||||
foreach ($fields_label as $field_toshow)
|
||||
{
|
||||
$translabel=$langs->trans($obj->$field_toshow);
|
||||
$translabel='';
|
||||
if (!empty($obj->$field_toshow)) {
|
||||
$translabel=$langs->trans($obj->$field_toshow);
|
||||
}
|
||||
if ($translabel!=$field_toshow) {
|
||||
$value.=dol_trunc($translabel,18).' ';
|
||||
}else {
|
||||
@ -998,7 +1003,10 @@ class ExtraFields
|
||||
}
|
||||
else
|
||||
{
|
||||
$translabel=$langs->trans($obj->$InfoFieldList[1]);
|
||||
$translabel='';
|
||||
if (!empty($obj->$InfoFieldList[1])) {
|
||||
$translabel=$langs->trans($obj->$InfoFieldList[1]);
|
||||
}
|
||||
if ($translabel!=$obj->$InfoFieldList[1]) {
|
||||
$value=dol_trunc($translabel,18);
|
||||
}else {
|
||||
|
||||
@ -746,7 +746,7 @@ class Form
|
||||
* @param int $showempty Add an empty field
|
||||
* @param int $showtype Show third party type in combolist (customer, prospect or supplier)
|
||||
* @param int $forcecombo Force to use combo box
|
||||
* @param array $events Event options. Example: array(array('method'=>'getContacts', 'url'=>dol_buildpath('/core/ajax/contacts.php',1), 'htmlname'=>'contactid', 'params'=>array('add-customer-contact'=>'disabled')))
|
||||
* @param array $events Event options to run on change. Example: array(array('method'=>'getContacts', 'url'=>dol_buildpath('/core/ajax/contacts.php',1), 'htmlname'=>'contactid', 'params'=>array('add-customer-contact'=>'disabled')))
|
||||
* @param int $limit Maximum number of elements
|
||||
* @return string HTML string with
|
||||
* @deprecated Use select_thirdparty instead
|
||||
@ -816,10 +816,67 @@ class Form
|
||||
$resql=$this->db->query($sql);
|
||||
if ($resql)
|
||||
{
|
||||
if (! empty($conf->use_javascript_ajax) && ! empty($conf->global->COMPANY_USE_SEARCH_TO_SELECT) && ! $forcecombo)
|
||||
if (! empty($conf->use_javascript_ajax))
|
||||
{
|
||||
include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
|
||||
$out.= ajax_combobox($htmlname, $events, $conf->global->COMPANY_USE_SEARCH_TO_SELECT);
|
||||
if (! empty($conf->global->COMPANY_USE_SEARCH_TO_SELECT) && ! $forcecombo)
|
||||
{
|
||||
include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
|
||||
$out.= ajax_combobox($htmlname, $events, $conf->global->COMPANY_USE_SEARCH_TO_SELECT);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (count($events)) // Add management of event
|
||||
{
|
||||
print '<script type="text/javascript">
|
||||
$(document).ready(function() {
|
||||
jQuery("#'.$htmlname.'").change(function () {
|
||||
var obj = '.json_encode($events).';
|
||||
$.each(obj, function(key,values) {
|
||||
if (values.method.length) {
|
||||
runJsCodeForEvent'.$htmlname.'(values);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
function runJsCodeForEvent'.$htmlname.'(obj) {
|
||||
var id = $("#'.$htmlname.'").val();
|
||||
var method = obj.method;
|
||||
var url = obj.url;
|
||||
var htmlname = obj.htmlname;
|
||||
var showempty = obj.showempty;
|
||||
$.getJSON(url,
|
||||
{
|
||||
action: method,
|
||||
id: id,
|
||||
htmlname: htmlname,
|
||||
showempty: showempty
|
||||
},
|
||||
function(response) {
|
||||
$.each(obj.params, function(key,action) {
|
||||
if (key.length) {
|
||||
var num = response.num;
|
||||
if (num > 0) {
|
||||
$("#" + key).removeAttr(action);
|
||||
} else {
|
||||
$("#" + key).attr(action, action);
|
||||
}
|
||||
}
|
||||
});
|
||||
$("select#" + htmlname).html(response.value);
|
||||
if (response.num) {
|
||||
var selecthtml_str = response.value;
|
||||
var selecthtml_dom=$.parseHTML(selecthtml_str);
|
||||
$("#inputautocomplete"+htmlname).val(selecthtml_dom[0][0].innerHTML);
|
||||
} else {
|
||||
$("#inputautocomplete"+htmlname).val("");
|
||||
}
|
||||
$("select#" + htmlname).change(); /* Trigger event change */
|
||||
});
|
||||
}
|
||||
})
|
||||
</script>';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Construct $out and $outarray
|
||||
@ -4045,7 +4102,22 @@ class Form
|
||||
|
||||
if ($value_as_key) $array=array_combine($array, $array);
|
||||
|
||||
$out='<select id="'.$htmlname.'" '.($disabled?'disabled="disabled" ':'').'class="flat'.($morecss?' '.$morecss:'').'" name="'.$htmlname.'" '.($moreparam?$moreparam:'').'>';
|
||||
$out='';
|
||||
|
||||
// Add code for jquery to use multiselect
|
||||
if (empty($conf->dol_use_jmobile) && (! empty($conf->global->MAIN_USE_JQUERY_MULTISELECT) || defined('REQUIRE_JQUERY_MULTISELECT')))
|
||||
{
|
||||
$tmpplugin=empty($conf->global->MAIN_USE_JQUERY_MULTISELECT)?constant('REQUIRE_JQUERY_MULTISELECT'):$conf->global->MAIN_USE_JQUERY_MULTISELECT;
|
||||
$out='<!-- JS CODE TO ENABLE '.$tmpplugin.' for id '.$htmlname.' -->
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function () {
|
||||
$(\'#'.$htmlname.'\').'.$tmpplugin.'({
|
||||
});
|
||||
});
|
||||
</script>';
|
||||
}
|
||||
|
||||
$out.='<select id="'.$htmlname.'" '.($disabled?'disabled="disabled" ':'').'class="flat'.($morecss?' '.$morecss:'').'" name="'.$htmlname.'" '.($moreparam?$moreparam:'').'>';
|
||||
|
||||
if ($show_empty)
|
||||
{
|
||||
@ -4109,46 +4181,22 @@ class Form
|
||||
global $conf, $langs;
|
||||
|
||||
// Add code for jquery to use multiselect
|
||||
// Note: Plugin "multiselect" is no more provided by Dolibarr. You must include it and load it into your module to use it.
|
||||
if ((! empty($conf->global->MAIN_USE_JQUERY_MULTISELECT) && ($conf->global->MAIN_USE_JQUERY_MULTISELECT == 'multiselect'))
|
||||
|| (defined('REQUIRE_JQUERY_MULTISELECT') && constant('REQUIRE_JQUERY_MULTISELECT')))
|
||||
if (! empty($conf->global->MAIN_USE_JQUERY_MULTISELECT) || defined('REQUIRE_JQUERY_MULTISELECT'))
|
||||
{
|
||||
print '<!-- JS CODE FOR multiselect -->
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function () {
|
||||
$.extend($.ui.multiselect.locale, {
|
||||
addAll:\''.$langs->transnoentities("AddAll").'\',
|
||||
removeAll:\''.$langs->transnoentities("RemoveAll").'\',
|
||||
itemsCount:\''.$langs->transnoentities("ItemsCount").'\'
|
||||
});
|
||||
$(function(){
|
||||
$("#'.$htmlname.'").multiselect({
|
||||
searchable: false,
|
||||
width: '.($width?$width:300).',
|
||||
height: 120
|
||||
});
|
||||
});
|
||||
});
|
||||
</script>';
|
||||
}
|
||||
|
||||
// Add code for jquery to use multiple-select
|
||||
// Note: Plugin "multiselect" is no more provided by Dolibarr. You must include it and load it into your module to use it.
|
||||
if ((! empty($conf->global->MAIN_USE_JQUERY_MULTISELECT) && ($conf->global->MAIN_USE_JQUERY_MULTISELECT == 'multiple-select'))
|
||||
|| (defined('REQUIRE_JQUERY_MULTISELECT') && constant('REQUIRE_JQUERY_MULTISELECT')))
|
||||
{
|
||||
print '<!-- JS CODE FOR multiple-select -->
|
||||
<script src="'.DOL_URL_ROOT.'/includes/jquery/plugins/multiple-select/jquery.multiple.select.js"></script>
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function () {
|
||||
$(\'#'.$htmlname.'\').multipleSelect();
|
||||
});
|
||||
</script>';
|
||||
$tmpplugin=empty($conf->global->MAIN_USE_JQUERY_MULTISELECT)?constant('REQUIRE_JQUERY_MULTISELECT'):$conf->global->MAIN_USE_JQUERY_MULTISELECT;
|
||||
print '<!-- JS CODE TO ENABLE '.$tmpplugin.' for id '.$htmlname.' -->
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function () {
|
||||
$(\'#'.$htmlname.'\').'.$tmpplugin.'({
|
||||
});
|
||||
});
|
||||
</script>';
|
||||
}
|
||||
|
||||
// Try also magic suggest
|
||||
|
||||
$out = '<select id="'.$htmlname.'" class="multiselect" multiple="multiple" name="'.$htmlname.'[]"'.$option.($width?' style="width: '.$width.'px"':'').'>'."\n";
|
||||
// Add data-role="none" to diable jmobile decoration
|
||||
$out = '<select data-role="none" id="'.$htmlname.'" class="multiselect" multiple="multiple" name="'.$htmlname.'[]"'.$option.($width?' style="width: '.$width.'px"':'').'>'."\n";
|
||||
if (is_array($array) && ! empty($array))
|
||||
{
|
||||
if ($value_as_key) $array=array_combine($array, $array);
|
||||
|
||||
@ -547,7 +547,7 @@ class FormCompany
|
||||
$resql = $this->db->query($sql);
|
||||
if ($resql)
|
||||
{
|
||||
if ($conf->use_javascript_ajax && ! empty($conf->global->COMPANY_USE_SEARCH_TO_SELECT))
|
||||
if (! empty($conf->use_javascript_ajax) && ! empty($conf->global->COMPANY_USE_SEARCH_TO_SELECT))
|
||||
{
|
||||
// Use Ajax search
|
||||
$minLength = (is_numeric($conf->global->COMPANY_USE_SEARCH_TO_SELECT)?$conf->global->COMPANY_USE_SEARCH_TO_SELECT:2);
|
||||
|
||||
@ -4,7 +4,7 @@
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* 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,
|
||||
@ -14,6 +14,7 @@
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
* or see http://www.gnu.org/
|
||||
*/
|
||||
|
||||
/**
|
||||
|
||||
@ -277,7 +277,7 @@ function limitChars(textarea, limit, infodiv)
|
||||
{
|
||||
$defaultmessage=$this->withbody;
|
||||
}
|
||||
$defaultmessage=make_substitutions($defaultmessage,$this->substit,$langs);
|
||||
$defaultmessage=make_substitutions($defaultmessage,$this->substit);
|
||||
if (isset($_POST["message"])) $defaultmessage=$_POST["message"];
|
||||
$defaultmessage=str_replace('\n',"\n",$defaultmessage);
|
||||
|
||||
|
||||
@ -847,6 +847,7 @@ class Ldap
|
||||
*/
|
||||
function getAttributeValues($filterrecord,$attribute)
|
||||
{
|
||||
$attributes=array();
|
||||
$attributes[0] = $attribute;
|
||||
|
||||
// We need to search for this user in order to get their entry.
|
||||
@ -1075,9 +1076,9 @@ class Ldap
|
||||
$subcount = hexdec(substr($hex_sid,2,2)); // Get count of sub-auth entries
|
||||
$auth = hexdec(substr($hex_sid,4,12)); // SECURITY_NT_AUTHORITY
|
||||
$result = "$rev-$auth";
|
||||
for ($x=0;$x < $subcount; $x++) {
|
||||
$subauth[$x] = hexdec($this->littleEndian(substr($hex_sid,16+($x*8),8))); // get all SECURITY_NT_AUTHORITY
|
||||
$result .= "-".$subauth[$x];
|
||||
for ($x=0;$x < $subcount; $x++)
|
||||
{
|
||||
$result .= "-".hexdec($this->littleEndian(substr($hex_sid,16+($x*8),8))); // get all SECURITY_NT_AUTHORITY
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
@ -1090,9 +1091,9 @@ class Ldap
|
||||
* car conflit majuscule-minuscule. A n'utiliser que pour les pages
|
||||
* 'Fiche LDAP' qui affiche champ lisibles par defaut.
|
||||
*
|
||||
* @param string $checkDn DN de recherche (Ex: ou=users,cn=my-domain,cn=com)
|
||||
* @param string $filter Filtre de recherche (ex: (sn=nom_personne) )
|
||||
* @return array Tableau des reponses (cle en minuscule-valeur)
|
||||
* @param string $checkDn DN de recherche (Ex: ou=users,cn=my-domain,cn=com)
|
||||
* @param string $filter Search filter (ex: (sn=nom_personne) )
|
||||
* @return array|int Array with answers (key lowercased - value)
|
||||
*/
|
||||
function search($checkDn, $filter)
|
||||
{
|
||||
|
||||
@ -74,7 +74,7 @@ class Menubase
|
||||
* @param User $user User that create
|
||||
* @return int <0 if KO, Id of record if OK
|
||||
*/
|
||||
function create($user=0)
|
||||
function create($user=null)
|
||||
{
|
||||
global $conf, $langs;
|
||||
|
||||
@ -185,7 +185,7 @@ class Menubase
|
||||
* @param int $notrigger 0=no, 1=yes (no update trigger)
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*/
|
||||
function update($user=0, $notrigger=0)
|
||||
function update($user=null, $notrigger=0)
|
||||
{
|
||||
global $conf, $langs;
|
||||
|
||||
@ -250,7 +250,7 @@ class Menubase
|
||||
* @param User $user User that load
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*/
|
||||
function fetch($id, $user=0)
|
||||
function fetch($id, $user=null)
|
||||
{
|
||||
global $langs;
|
||||
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
<?php
|
||||
/* Copyright (C) 2003-2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2004-2011 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2014 Juanjo Menent <jmenent@2byte.es>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@ -173,7 +174,7 @@ class Notify
|
||||
|
||||
// Check notification per third party
|
||||
$sql = "SELECT s.nom, c.email, c.rowid as cid, c.lastname, c.firstname, c.default_lang,";
|
||||
$sql.= " a.rowid as adid, a.label, a.code, n.rowid";
|
||||
$sql.= " a.rowid as adid, a.label, a.code, n.rowid, n.type";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."socpeople as c,";
|
||||
$sql.= " ".MAIN_DB_PREFIX."c_action_trigger as a,";
|
||||
$sql.= " ".MAIN_DB_PREFIX."notify_def as n,";
|
||||
@ -292,8 +293,8 @@ class Notify
|
||||
|
||||
if ($mailfile->sendfile())
|
||||
{
|
||||
$sql = "INSERT INTO ".MAIN_DB_PREFIX."notify (daten, fk_action, fk_soc, fk_contact, objet_type, objet_id, email)";
|
||||
$sql.= " VALUES ('".$this->db->idate(dol_now())."', ".$actiondefid.", ".$object->socid.", ".$obj->cid.", '".$object_type."', ".$object->id.", '".$this->db->escape($obj->email)."')";
|
||||
$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)."')";
|
||||
if (! $this->db->query($sql))
|
||||
{
|
||||
dol_print_error($this->db);
|
||||
@ -421,8 +422,8 @@ class Notify
|
||||
|
||||
if ($mailfile->sendfile())
|
||||
{
|
||||
$sql = "INSERT INTO ".MAIN_DB_PREFIX."notify (daten, fk_action, fk_soc, fk_contact, objet_type, objet_id, email)";
|
||||
$sql.= " VALUES ('".$this->db->idate(dol_now())."', ".$actiondefid.", ".$object->socid.", null, '".$object_type."', ".$object->id.", '".$this->db->escape($conf->global->$param)."')";
|
||||
$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);
|
||||
|
||||
@ -33,7 +33,6 @@ class Translate
|
||||
|
||||
var $defaultlang; // Current language for current user
|
||||
var $direction = 'ltr'; // Left to right or Right to left
|
||||
var $charset_inputfile=array(); // To store charset encoding used for language
|
||||
var $charset_output='UTF-8'; // Codage used by "trans" method outputs
|
||||
|
||||
var $tab_translate=array(); // Array of all translations key=>value
|
||||
@ -198,6 +197,12 @@ class Translate
|
||||
if ($alt < 1 && isset($langarray[1]) && strtolower($langarray[0]) == strtolower($langarray[1])) $alt=1;
|
||||
if ($alt < 2 && strtolower($langofdir) == 'en_us') $alt=2;
|
||||
|
||||
if (empty($langofdir)) // This may occurs when load is called without setting the language and without providing a value for forcelangdir
|
||||
{
|
||||
dol_syslog("Error: ".get_class($this)."::Load was called but language was not set yet with langs->setDefaultLang(). Nothing will be loaded.", LOG_WARNING);
|
||||
return -1;
|
||||
}
|
||||
|
||||
foreach($this->dir as $keydir => $searchdir)
|
||||
{
|
||||
// Directory of translation files
|
||||
|
||||
@ -121,9 +121,9 @@ interface Database
|
||||
/**
|
||||
* List tables into a database
|
||||
*
|
||||
* @param string $database Name of database
|
||||
* @param string $table Nmae of table filter ('xxx%')
|
||||
* @return resource Resource
|
||||
* @param string $database Name of database
|
||||
* @param string $table Nmae of table filter ('xxx%')
|
||||
* @return array List of tables in an array
|
||||
*/
|
||||
function DDLListTables($database, $table = '');
|
||||
|
||||
@ -386,9 +386,9 @@ interface Database
|
||||
* 19700101020000 -> 3600 with TZ+1 and gmt=0
|
||||
* 19700101020000 -> 7200 whaterver is TZ if gmt=1
|
||||
*
|
||||
* @param string $string Date in a string (YYYYMMDDHHMMSS, YYYYMMDD, YYYY-MM-DD HH:MM:SS)
|
||||
* @param int $gm 1=Input informations are GMT values, otherwise local to server TZ
|
||||
* @return date Date TMS
|
||||
* @param string $string Date in a string (YYYYMMDDHHMMSS, YYYYMMDD, YYYY-MM-DD HH:MM:SS)
|
||||
* @param int $gm 1=Input informations are GMT values, otherwise local to server TZ
|
||||
* @return timestamp|string Date TMS
|
||||
*/
|
||||
function jdate($string, $gm=false);
|
||||
|
||||
|
||||
@ -158,8 +158,8 @@ abstract class DoliDB implements Database
|
||||
/**
|
||||
* Annulation d'une transaction et retour aux anciennes valeurs
|
||||
*
|
||||
* @param string $log Add more log to default log line
|
||||
* @return int 1 si annulation ok ou transaction non ouverte, 0 en cas d'erreur
|
||||
* @param string $log Add more log to default log line
|
||||
* @return resource|int 1 si annulation ok ou transaction non ouverte, 0 en cas d'erreur
|
||||
*/
|
||||
function rollback($log='')
|
||||
{
|
||||
|
||||
@ -631,7 +631,7 @@ function hideMessage(fieldId,message) {
|
||||
|
||||
|
||||
/*
|
||||
* TODO Used by admin page only ?
|
||||
* Used by button to set on/off
|
||||
*/
|
||||
function setConstant(url, code, input, entity, strict) {
|
||||
$.get( url, {
|
||||
@ -689,7 +689,7 @@ function setConstant(url, code, input, entity, strict) {
|
||||
}
|
||||
|
||||
/*
|
||||
* TODO Used by admin page only ?
|
||||
* Used by button to set on/off
|
||||
*/
|
||||
function delConstant(url, code, input, entity, strict) {
|
||||
$.get( url, {
|
||||
@ -743,7 +743,7 @@ function delConstant(url, code, input, entity, strict) {
|
||||
}
|
||||
|
||||
/*
|
||||
* TODO Used by admin page only ?
|
||||
* Used by button to set on/off
|
||||
*/
|
||||
function confirmConstantAction(action, url, code, input, box, entity, yesButton, noButton, strict) {
|
||||
var boxConfirm = box;
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/* Copyright (C) 2013-2014 Olivier Geffroy <jeff@jeffinfo.com>
|
||||
* Copyright (C) 2013-2014 Alexandre Spangaro <alexandre.spangaro@gmail.com>
|
||||
* Copyright (C) 2013-2014 Alexandre Spangaro <alexandre.spangaro@gmail.com>
|
||||
* Copyright (C) 2014 Florian Henry <florian.henry@open-concept.pro>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
@ -26,38 +26,39 @@
|
||||
/**
|
||||
* Prepare array with list of admin tabs
|
||||
*
|
||||
* @param Object $object Object instance we show card
|
||||
* @return array Array of tabs to show
|
||||
*/
|
||||
function admin_accounting_prepare_head()
|
||||
function admin_accounting_prepare_head($object=null)
|
||||
{
|
||||
global $langs, $conf;
|
||||
|
||||
|
||||
$h = 0;
|
||||
$head = array ();
|
||||
|
||||
|
||||
$head[$h][0] = dol_buildpath('/accountancy/admin/index.php', 1);
|
||||
$head[$h][1] = $langs->trans("Configuration");
|
||||
$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, 'accounting_admin');
|
||||
|
||||
|
||||
$head[$h][0] = dol_buildpath('/accountancy/admin/journaux.php', 1);
|
||||
$head[$h][1] = $langs->trans("Journaux");
|
||||
$head[$h][2] = 'journal';
|
||||
$h ++;
|
||||
|
||||
|
||||
$head[$h][0] = dol_buildpath('/accountancy/admin/export.php', 1);
|
||||
$head[$h][1] = $langs->trans("Export");
|
||||
$head[$h][2] = 'export';
|
||||
$h ++;
|
||||
|
||||
|
||||
complete_head_from_modules($conf, $langs, $object, $head, $h, 'accounting_admin', 'remove');
|
||||
|
||||
|
||||
return $head;
|
||||
}
|
||||
|
||||
@ -70,23 +71,23 @@ function admin_accounting_prepare_head()
|
||||
function accounting_prepare_head($object)
|
||||
{
|
||||
global $langs, $conf;
|
||||
|
||||
|
||||
$h = 0;
|
||||
$head = array ();
|
||||
|
||||
|
||||
$head[$h][0] = dol_buildpath('/accountancy/admin/card.php', 1) . '?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, 'accounting_account');
|
||||
|
||||
|
||||
complete_head_from_modules($conf, $langs, $object, $head, $h, 'accounting_account', 'remove');
|
||||
|
||||
|
||||
return $head;
|
||||
}
|
||||
|
||||
@ -94,25 +95,25 @@ function accounting_prepare_head($object)
|
||||
* Return general accounting account with defined length
|
||||
*
|
||||
* @param string $account General accounting account
|
||||
* @return string String with defined length
|
||||
* @return string String with defined length
|
||||
*/
|
||||
function length_accountg($account)
|
||||
{
|
||||
global $conf;
|
||||
|
||||
|
||||
$g = $conf->global->ACCOUNTING_LENGTH_GACCOUNT;
|
||||
|
||||
|
||||
if (! empty($g)) {
|
||||
// Clean parameters
|
||||
$i = strlen($account);
|
||||
|
||||
|
||||
if ($i >= 2) {
|
||||
while ( $i < $g ) {
|
||||
$account .= '0';
|
||||
|
||||
|
||||
$i ++;
|
||||
}
|
||||
|
||||
|
||||
return $account;
|
||||
} else {
|
||||
return $account;
|
||||
@ -126,25 +127,25 @@ function length_accountg($account)
|
||||
* Return auxiliary accounting account with defined length
|
||||
*
|
||||
* @param string $accounta Auxiliary accounting account
|
||||
* @return string String with defined length
|
||||
* @return string String with defined length
|
||||
*/
|
||||
function length_accounta($accounta)
|
||||
{
|
||||
global $conf, $langs;
|
||||
|
||||
|
||||
$a = $conf->global->ACCOUNTING_LENGTH_AACCOUNT;
|
||||
|
||||
|
||||
if (! empty($a)) {
|
||||
// Clean parameters
|
||||
$i = strlen($accounta);
|
||||
|
||||
|
||||
if ($i >= 2) {
|
||||
while ( $i < $a ) {
|
||||
$accounta .= '0';
|
||||
|
||||
|
||||
$i ++;
|
||||
}
|
||||
|
||||
|
||||
return $accounta;
|
||||
} else {
|
||||
return $accounta;
|
||||
@ -160,8 +161,8 @@ function length_accounta($accounta)
|
||||
* @param string $txt Accounting account
|
||||
* @param int $len Length
|
||||
* @param int $end Number of characters
|
||||
*
|
||||
* @return string Formated string
|
||||
*
|
||||
* @return string Formated string
|
||||
*/
|
||||
function length_exportsage($txt, $len, $end)
|
||||
{
|
||||
@ -169,11 +170,11 @@ function length_exportsage($txt, $len, $end)
|
||||
// problem with this function, but we need to have the number of letter
|
||||
if (strlen($txt) == $len) {
|
||||
$res = $txt;
|
||||
}
|
||||
}
|
||||
|
||||
elseif (strlen($txt) > $len) {
|
||||
$res = substr($txt, 0, $len);
|
||||
}
|
||||
}
|
||||
|
||||
else {
|
||||
if ($end == 1) {
|
||||
|
||||
@ -345,13 +345,13 @@ function ajax_combobox($htmlname, $events=array(), $minLengthToAutocomplete=0)
|
||||
var obj = '.json_encode($events).';
|
||||
$.each(obj, function(key,values) {
|
||||
if (values.method.length) {
|
||||
runJsCodeForEvent(values);
|
||||
runJsCodeForEvent'.$htmlname.'(values);
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
function runJsCodeForEvent(obj) {
|
||||
function runJsCodeForEvent'.$htmlname.'(obj) {
|
||||
var id = $("#'.$htmlname.'").val();
|
||||
var method = obj.method;
|
||||
var url = obj.url;
|
||||
|
||||
@ -44,14 +44,31 @@ include_once DOL_DOCUMENT_ROOT .'/core/lib/json.lib.php';
|
||||
* @param string $class Class name
|
||||
* @param string $member Name of property
|
||||
* @return mixed Return value of static property
|
||||
* @deprecated PHP 5.3 is now the minimum requirement, this is no longer necessary
|
||||
*/
|
||||
function getStaticMember($class, $member)
|
||||
{
|
||||
if (isset($class::$member)) {
|
||||
return $class::$member;
|
||||
}
|
||||
// This part is deprecated. Uncomment if for php 5.2.*, and comment next isset class::member
|
||||
/*if (version_compare(phpversion(), '5.3.0', '<'))
|
||||
{
|
||||
if (is_object($class)) $class = get_class($class);
|
||||
$classObj = new ReflectionClass($class);
|
||||
$result = null;
|
||||
|
||||
$found=0;
|
||||
foreach($classObj->getStaticProperties() as $prop => $value)
|
||||
{
|
||||
if ($prop == $member)
|
||||
{
|
||||
$result = $value;
|
||||
$found++;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if ($found) return $result;
|
||||
}*/
|
||||
|
||||
if (isset($class::$member)) return $class::$member;
|
||||
dol_print_error('','Try to get a static member "'.$member.'" in class "'.$class.'" that does not exists or is not static.');
|
||||
return null;
|
||||
}
|
||||
@ -1083,7 +1100,11 @@ function dol_mktime($hour,$minute,$second,$month,$day,$year,$gm=false,$check=1)
|
||||
$default_timezone=@date_default_timezone_get();
|
||||
}
|
||||
}
|
||||
else $localtz = new DateTimeZone('UTC');
|
||||
|
||||
if (empty($localtz)) {
|
||||
$localtz = new DateTimeZone('UTC');
|
||||
}
|
||||
|
||||
$dt = new DateTime(null,$localtz);
|
||||
$dt->setDate($year,$month,$day);
|
||||
$dt->setTime((int) $hour, (int) $minute, (int) $second);
|
||||
@ -2862,7 +2883,7 @@ function price($amount, $form=0, $outlangs='', $trunc=1, $rounding=-1, $forcerou
|
||||
|
||||
$listofcurrenciesbefore=array('USD');
|
||||
if (in_array($currency_code,$listofcurrenciesbefore)) $cursymbolbefore.=$outlangs->getCurrencySymbol($currency_code);
|
||||
else
|
||||
else
|
||||
{
|
||||
$tmpcur=$outlangs->getCurrencySymbol($currency_code);
|
||||
$cursymbolafter.=($tmpcur == $currency_code ? ' '.$tmpcur : $tmpcur);
|
||||
@ -3820,13 +3841,14 @@ function dol_html_entity_decode($a,$b,$c='UTF-8')
|
||||
/**
|
||||
* Replace htmlentities functions to manage errors
|
||||
* http://php.net/manual/en/function.htmlentities.php
|
||||
* TODO Remove this function to replace it with direct htmlentities.
|
||||
*
|
||||
* @param string $string The input string.
|
||||
* @param int $flags Flags(see PHP doc above)
|
||||
* @param string $encoding Encoding
|
||||
* @param bool $double_encode When double_encode is turned off PHP will not encode existing html entities
|
||||
* @return string $ret Encoded string
|
||||
* @deprecated Since PHP4 support is no longer available, this function does not make sense
|
||||
* @deprecated Since PHP4 support is no longer available, this function does not make sense.
|
||||
*/
|
||||
function dol_htmlentities($string, $flags=null, $encoding='UTF-8', $double_encode=false)
|
||||
{
|
||||
@ -3981,10 +4003,7 @@ function dol_concatdesc($text1,$text2,$forxml=false)
|
||||
}
|
||||
|
||||
/**
|
||||
* Make substition into a string
|
||||
* There is two type of substitions:
|
||||
* - From $substitutionarray (oldval=>newval)
|
||||
* - From special constants (__XXX__=>f(objet->xxx)) by substitutions modules
|
||||
* Make substition into a string replacing key with vals from $substitutionarray (oldval=>newval)
|
||||
*
|
||||
* @param string $chaine Source string in which we must do substitution
|
||||
* @param array $substitutionarray Array with key->val to substitute
|
||||
|
||||
@ -2,19 +2,20 @@
|
||||
/*
|
||||
* Copyright (C) 2009-2013 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 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
* 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/>.
|
||||
* or see http://www.gnu.org/
|
||||
*/
|
||||
|
||||
/**
|
||||
* \file htdocs/core/lib/invoice2.lib.php
|
||||
|
||||
@ -758,7 +758,9 @@ function pdf_pagefoot(&$pdf,$outputlangs,$paramfreetext,$fromcompany,$marge_bass
|
||||
// Capital
|
||||
if ($fromcompany->capital)
|
||||
{
|
||||
$line3.=($line3?" - ":"").$outputlangs->transnoentities("CapitalOf",price($fromcompany->capital, 0, $outputlangs, 0, 0, 0, $conf->currency));
|
||||
$tmpamounttoshow = price2num($fromcompany->capital); // This field is a free string
|
||||
if (is_numeric($tmpamounttoshow) && $tmpamounttoshow > 0) $line3.=($line3?" - ":"").$outputlangs->transnoentities("CapitalOf",price($tmpamounttoshow, 0, $outputlangs, 0, 0, 0, $conf->currency));
|
||||
else $line3.=($line3?" - ":"").$outputlangs->transnoentities("CapitalOf",$tmpamounttoshow,$outputlangs);
|
||||
}
|
||||
// Prof Id 1
|
||||
if ($fromcompany->idprof1 && ($fromcompany->country_code != 'FR' || ! $fromcompany->idprof2))
|
||||
|
||||
@ -44,14 +44,6 @@ function prelevement_prepare_head($object)
|
||||
$head[$h][2] = 'prelevement';
|
||||
$h++;
|
||||
|
||||
if (! empty($conf->global->MAIN_USE_PREVIEW_TABS))
|
||||
{
|
||||
$head[$h][0] = DOL_URL_ROOT.'/compta/prelevement/bon.php?id='.$object->id;
|
||||
$head[$h][1] = $langs->trans("Preview");
|
||||
$head[$h][2] = 'preview';
|
||||
$h++;
|
||||
}
|
||||
|
||||
$head[$h][0] = DOL_URL_ROOT.'/compta/prelevement/lignes.php?id='.$object->id;
|
||||
$head[$h][1] = $langs->trans("Lines");
|
||||
$head[$h][2] = 'lines';
|
||||
|
||||
@ -316,6 +316,7 @@ function measuring_units_string($unit,$measuring_style='')
|
||||
{
|
||||
global $langs;
|
||||
|
||||
$measuring_units=array();
|
||||
if ($measuring_style == 'weight')
|
||||
{
|
||||
$measuring_units[3] = $langs->trans("WeightUnitton");
|
||||
|
||||
@ -26,15 +26,15 @@
|
||||
/**
|
||||
* Show header of a VAT report
|
||||
*
|
||||
* @param string $nom Name of report
|
||||
* @param string $variante Link for alternate report
|
||||
* @param string $period Period of report
|
||||
* @param string $periodlink Link to switch period
|
||||
* @param string $description Description
|
||||
* @param date $builddate Date generation
|
||||
* @param string $exportlink Link for export or ''
|
||||
* @param array $moreparam Array with list of params to add into form
|
||||
* @param string $calcmode Calculation mode
|
||||
* @param string $nom Name of report
|
||||
* @param string $variante Link for alternate report
|
||||
* @param string $period Period of report
|
||||
* @param string $periodlink Link to switch period
|
||||
* @param string $description Description
|
||||
* @param timestamp|integer $builddate Date generation
|
||||
* @param string $exportlink Link for export or ''
|
||||
* @param array $moreparam Array with list of params to add into form
|
||||
* @param string $calcmode Calculation mode
|
||||
* @return void
|
||||
*/
|
||||
function report_header($nom,$variante,$period,$periodlink,$description,$builddate,$exportlink='',$moreparam=array(),$calcmode='')
|
||||
@ -79,7 +79,7 @@ function report_header($nom,$variante,$period,$periodlink,$description,$builddat
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
}
|
||||
|
||||
|
||||
// Ligne de la periode d'analyse du rapport
|
||||
print '<tr>';
|
||||
print '<td>'.$langs->trans("ReportPeriod").'</td>';
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
<?php
|
||||
/* Copyright (C) 2007-2008 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
/* Copyright (C) 2007-2014 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2007-2009 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
* Copyright (C) 2010-2011 Juanjo Menent <jmenent@2byte.es>
|
||||
*
|
||||
@ -20,7 +20,7 @@
|
||||
/**
|
||||
* \file htdocs/core/login/functions_dolibarr.php
|
||||
* \ingroup core
|
||||
* \brief Authentication functions for Dolibarr mode
|
||||
* \brief Authentication functions for Dolibarr mode (check user on login or email and check pass)
|
||||
*/
|
||||
|
||||
|
||||
@ -50,13 +50,15 @@ function check_user_password_dolibarr($usertotest,$passwordtotest,$entitytotest=
|
||||
{
|
||||
// If test username/password asked, we define $test=false and $login var if ok, set $_SESSION["dol_loginmesg"] if ko
|
||||
$table = MAIN_DB_PREFIX."user";
|
||||
$usernamecol = 'login';
|
||||
$usernamecol1 = 'login';
|
||||
$usernamecol2 = 'email';
|
||||
$entitycol = 'entity';
|
||||
|
||||
$sql ='SELECT rowid, entity, pass, pass_crypted';
|
||||
$sql ='SELECT rowid, login, entity, pass, pass_crypted';
|
||||
$sql.=' FROM '.$table;
|
||||
$sql.=' WHERE '.$usernamecol." = '".$db->escape($usertotest)."'";
|
||||
$sql.=' AND '.$entitycol." IN (0," . ($entity ? $entity : 1) . ")";
|
||||
$sql.=' WHERE ('.$usernamecol1." = '".$db->escape($usertotest)."'";
|
||||
if (preg_match('/@/',$usertotest)) $sql.=' OR '.$usernamecol2." = '".$db->escape($usertotest)."'";
|
||||
$sql.=') AND '.$entitycol." IN (0," . ($entity ? $entity : 1) . ")";
|
||||
|
||||
dol_syslog("functions_dolibarr::check_user_password_dolibarr", LOG_DEBUG);
|
||||
$resql=$db->query($sql);
|
||||
@ -106,7 +108,7 @@ function check_user_password_dolibarr($usertotest,$passwordtotest,$entitytotest=
|
||||
// Password ok ?
|
||||
if ($passok)
|
||||
{
|
||||
$login=$usertotest;
|
||||
$login=$obj->login;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@ -770,15 +770,18 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu
|
||||
if (! empty($conf->facture->enabled)) $newmenu->add("/commande/list.php?leftmenu=orders&viewstatut=-3", $langs->trans("MenuOrdersToBill2"), 0, $user->rights->commande->lire, '', $mainmenu, 'orders');
|
||||
// if (empty($leftmenu) || $leftmenu=="orders") $newmenu->add("/commande/", $langs->trans("StatusOrderToBill"), 1, $user->rights->commande->lire);
|
||||
}
|
||||
|
||||
|
||||
// Supplier Orders
|
||||
if (! empty($conf->fournisseur->enabled))
|
||||
{
|
||||
$langs->load("supplier");
|
||||
$newmenu->add("/fourn/commande/list.php?leftmenu=orders&search_status=5", $langs->trans("MenuOrdersSupplierToBill"), 0, $user->rights->commande->lire, '', $mainmenu, 'orders');
|
||||
// if (empty($leftmenu) || $leftmenu=="orders") $newmenu->add("/commande/", $langs->trans("StatusOrderToBill"), 1, $user->rights->commande->lire);
|
||||
if (! empty($conf->global->SUPPLIER_MENU_ORDER_RECEIVED_INTO_INVOICE))
|
||||
{
|
||||
$langs->load("supplier");
|
||||
$newmenu->add("/fourn/commande/list.php?leftmenu=orders&search_status=5", $langs->trans("MenuOrdersSupplierToBill"), 0, $user->rights->commande->lire, '', $mainmenu, 'orders');
|
||||
// if (empty($leftmenu) || $leftmenu=="orders") $newmenu->add("/commande/", $langs->trans("StatusOrderToBill"), 1, $user->rights->commande->lire);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
// Donations
|
||||
if (! empty($conf->don->enabled))
|
||||
@ -952,7 +955,7 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu
|
||||
if (! empty($conf->accounting->enabled))
|
||||
{
|
||||
$newmenu->add("/accountancy/admin/fiscalyear.php?mainmenu=accountancy", $langs->trans("Fiscalyear"),0,$user->rights->accounting->fiscalyear, '', $mainmenu, 'fiscalyear');
|
||||
$newmenu->add("/accountancy/admin/account.php?mainmenu=home", $langs->trans("Chartofaccounts"),0,$user->rights->accounting->fiscalyear, '', $mainmenu, 'fiscalyear');
|
||||
$newmenu->add("/accountancy/admin/account.php?mainmenu=accountancy", $langs->trans("Chartofaccounts"),0,$user->rights->accounting->chartofaccount, '', $mainmenu, 'chartofaccount');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -210,6 +210,7 @@ class CommActionRapport
|
||||
$sql.= " WHERE c.id=a.fk_action AND a.fk_user_author = u.rowid";
|
||||
$sql.= " AND a.datep BETWEEN '".$this->db->idate(dol_get_first_day($this->year,$this->month,false))."'";
|
||||
$sql.= " AND '".$this->db->idate(dol_get_last_day($this->year,$this->month,false))."'";
|
||||
$sql.= " AND a.entity = ".$conf->entity;
|
||||
$sql.= " ORDER BY a.datep DESC";
|
||||
|
||||
$eventstatic=new ActionComm($this->db);
|
||||
|
||||
@ -229,6 +229,14 @@ class modAccounting extends DolibarrModules
|
||||
$this->rights[$r][4] = 'fiscalyear';
|
||||
$this->rights[$r][5] = '';
|
||||
$r++;
|
||||
|
||||
$this->rights[$r][0] = 50440;
|
||||
$this->rights[$r][1] = 'Manage chart of accounts';
|
||||
$this->rights[$r][2] = 'r';
|
||||
$this->rights[$r][3] = 1;
|
||||
$this->rights[$r][4] = 'chartofaccount';
|
||||
$this->rights[$r][5] = '';
|
||||
$r++;
|
||||
|
||||
// Main menu entries
|
||||
$this->menus = array();
|
||||
|
||||
@ -90,11 +90,12 @@ class modGeneratePassPerso extends ModeleGenPassword
|
||||
$this->NbRepeat = $tabConf[4];
|
||||
$this->WithoutAmbi = $tabConf[5];
|
||||
|
||||
if($this->WithoutAmbi){
|
||||
$this->Maj = str_replace($this->Ambi,"",$this->Maj );
|
||||
$this->Min = str_replace($this->Ambi,"",$this->Min );
|
||||
$this->Nb = str_replace($this->Ambi,"",$this->Nb );
|
||||
$this->Spe = str_replace($this->Ambi,"",$this->Spe );
|
||||
if ($this->WithoutAmbi)
|
||||
{
|
||||
$this->Maj = str_replace($this->Ambi,"",$this->Maj);
|
||||
$this->Min = str_replace($this->Ambi,"",$this->Min);
|
||||
$this->Nb = str_replace($this->Ambi,"",$this->Nb);
|
||||
$this->Spe = str_replace($this->Ambi,"",$this->Spe);
|
||||
}
|
||||
|
||||
$this->All = str_shuffle($this->Maj. $this->Min. $this->Nb. $this->Spe);
|
||||
@ -148,11 +149,13 @@ class modGeneratePassPerso extends ModeleGenPassword
|
||||
$pass .= $this->All[rand(0,strlen($this->All) -1)];
|
||||
}
|
||||
|
||||
$pass = str_shuffle($pass) ;
|
||||
$pass = str_shuffle($pass);
|
||||
|
||||
if($this->validatePassword($pass)) {
|
||||
if ($this->validatePassword($pass))
|
||||
{
|
||||
return $pass;
|
||||
}
|
||||
|
||||
return $this->getNewGeneratedPassword();
|
||||
}
|
||||
|
||||
|
||||
@ -87,8 +87,8 @@
|
||||
</td>
|
||||
<td>
|
||||
<table class="nobordernopadding">
|
||||
<tr><td width="30%">
|
||||
<textarea name="param" id="param"><?php echo GETPOST('param'); ?></textarea>
|
||||
<tr><td>
|
||||
<textarea name="param" id="param" cols="80" rwos="<?php echo ROWS_4 ?>"><?php echo GETPOST('param'); ?></textarea>
|
||||
</td><td id="helpselect"><?php print $form->textwithpicto('', $langs->trans("ExtrafieldParamHelpselect"),1,0)?></td>
|
||||
<td id="helpsellist"><?php print $form->textwithpicto('', $langs->trans("ExtrafieldParamHelpsellist"),1,0)?></td></tr>
|
||||
</table>
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user