Merge remote-tracking branch 'Upstream/develop' into develop-admin
This commit is contained in:
commit
c80bc52f5c
@ -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: { }
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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.
|
||||
|
||||
@ -4867,7 +4867,7 @@ CREATE TABLE `llx_opensurvey_sondage` (
|
||||
`mailsonde` tinyint(4) NOT NULL DEFAULT '0',
|
||||
`survey_link_visible` int(11) DEFAULT '1',
|
||||
`origin` varchar(64) DEFAULT NULL,
|
||||
`tms` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
|
||||
`tms` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
||||
PRIMARY KEY (`id_sondage`),
|
||||
KEY `idx_id_sondage_admin` (`id_sondage_admin`),
|
||||
KEY `idx_date_fin` (`date_fin`)
|
||||
|
||||
@ -182,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;
|
||||
|
||||
@ -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";
|
||||
|
||||
@ -25,12 +25,13 @@
|
||||
*/
|
||||
|
||||
/**
|
||||
* Classe permettant la gestion des comptes generaux de compta
|
||||
* Class to manage accounting accounts
|
||||
*/
|
||||
class AccountingAccount
|
||||
{
|
||||
var $db;
|
||||
var $error;
|
||||
var $errors;
|
||||
|
||||
var $id;
|
||||
var $rowid;
|
||||
@ -126,6 +127,8 @@ class AccountingAccount
|
||||
global $conf, $langs;
|
||||
$error = 0;
|
||||
|
||||
$now=dol_now();
|
||||
|
||||
// Clean parameters
|
||||
if (isset($this->fk_pcg_version))
|
||||
$this->fk_pcg_version = trim($this->fk_pcg_version);
|
||||
|
||||
@ -30,6 +30,9 @@
|
||||
class BookKeeping
|
||||
{
|
||||
var $db;
|
||||
var $error;
|
||||
var $errors;
|
||||
|
||||
var $id;
|
||||
var $doc_date;
|
||||
var $doc_type;
|
||||
|
||||
@ -58,8 +58,10 @@ if ($user->societe_id > 0)
|
||||
|
||||
$action = GETPOST('action');
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* View
|
||||
* Actions
|
||||
*/
|
||||
|
||||
$year_current = strftime("%Y", dol_now());
|
||||
@ -152,9 +154,6 @@ if ($result) {
|
||||
dol_print_error($db);
|
||||
}
|
||||
|
||||
/*
|
||||
* Actions
|
||||
*/
|
||||
// Bookkeeping Write
|
||||
if ($action == 'writebookkeeping') {
|
||||
$now = dol_now();
|
||||
@ -237,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');
|
||||
|
||||
@ -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)
|
||||
{
|
||||
@ -291,8 +291,6 @@ if ($action == 'update' && ! $_POST["cancel"] && $user->rights->adherent->creer)
|
||||
//$object->note = trim($_POST["comment"]);
|
||||
$object->morphy = $_POST["morphy"];
|
||||
|
||||
$object->amount = $_POST["amount"];
|
||||
|
||||
if (GETPOST('deletephoto')) $object->photo='';
|
||||
elseif (! empty($_FILES['photo']['name'])) $object->photo = dol_sanitizeFileName($_FILES['photo']['name']);
|
||||
|
||||
|
||||
@ -465,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
|
||||
|
||||
@ -453,8 +453,8 @@ if (GETPOST('actionadd') || GETPOST('actionmodify'))
|
||||
$ok=1;
|
||||
foreach ($listfield as $f => $value)
|
||||
{
|
||||
if ($value == 'country_id' && in_array($tablib[$id],array('DictionaryVAT','DictionaryRegion','DictionaryCompanyType'))) continue; // For some pages, country is not mandatory
|
||||
if ($value == 'country' && in_array($tablib[$id],array('DictionaryCanton','DictionaryCompanyType'))) continue; // For some pages, country is not mandatory
|
||||
if ($value == 'country_id' && in_array($tablib[$id],array('DictionaryRegion','DictionaryCompanyType'))) continue; // For some pages, country is not mandatory
|
||||
if ($value == 'localtax1' && empty($_POST['localtax1_type'])) continue;
|
||||
if ($value == 'localtax2' && empty($_POST['localtax2_type'])) continue;
|
||||
if ($value == 'color' && empty($_POST['color'])) continue;
|
||||
@ -1361,14 +1361,18 @@ function fieldList($fieldlist,$obj='',$tabname='')
|
||||
continue;
|
||||
} // For state page, we do not show the country input (we link to region, not country)
|
||||
print '<td>';
|
||||
print $form->select_country((! empty($obj->country_code)?$obj->country_code:(! empty($obj->country)?$obj->country:'')), 'country', '', 28);
|
||||
$fieldname='country';
|
||||
print $form->select_country((! empty($obj->country_code)?$obj->country_code:(! empty($obj->country)?$obj->country:'')), $fieldname, '', 28);
|
||||
print '</td>';
|
||||
}
|
||||
elseif ($fieldlist[$field] == 'country_id') {
|
||||
$country_id = (! empty($obj->$fieldlist[$field]) ? $obj->$fieldlist[$field] : 0);
|
||||
print '<td>';
|
||||
print '<input type="hidden" name="'.$fieldlist[$field].'" value="'.$country_id.'">';
|
||||
print '</td>';
|
||||
if (! in_array('country',$fieldlist)) // If there is already a field country, we don't show country_id (avoid duplicate)
|
||||
{
|
||||
$country_id = (! empty($obj->$fieldlist[$field]) ? $obj->$fieldlist[$field] : 0);
|
||||
print '<td>';
|
||||
print '<input type="hidden" name="'.$fieldlist[$field].'" value="'.$country_id.'">';
|
||||
print '</td>';
|
||||
}
|
||||
}
|
||||
elseif ($fieldlist[$field] == 'region') {
|
||||
print '<td>';
|
||||
|
||||
@ -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>';
|
||||
|
||||
@ -78,15 +78,16 @@ print_fiche_titre($langs->trans("SecuritySetup"),'','setup');
|
||||
print $langs->trans("LogEventDesc")."<br>\n";
|
||||
print "<br>\n";
|
||||
|
||||
$head=security_prepare_head();
|
||||
|
||||
dol_fiche_head($head, 'audit', $langs->trans("Security"));
|
||||
|
||||
|
||||
print '<form action="'.$_SERVER["PHP_SELF"].'" method="POST">';
|
||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
print '<input type="hidden" name="action" value="save">';
|
||||
|
||||
$head=security_prepare_head();
|
||||
|
||||
dol_fiche_head($head, 'audit', $langs->trans("Security"));
|
||||
|
||||
|
||||
$var=true;
|
||||
print "<table class=\"noborder\" width=\"100%\">";
|
||||
print "<tr class=\"liste_titre\">";
|
||||
@ -109,14 +110,14 @@ foreach ($eventstolog as $key => $arr)
|
||||
}
|
||||
print '</table>';
|
||||
|
||||
print '<br><center>';
|
||||
dol_fiche_end();
|
||||
|
||||
print '<div class="center">';
|
||||
print "<input type=\"submit\" name=\"save\" class=\"button\" value=\"".$langs->trans("Save")."\">";
|
||||
print "</center>";
|
||||
print "</div>";
|
||||
|
||||
print "</form>\n";
|
||||
|
||||
print '</div>';
|
||||
|
||||
$db->close();
|
||||
|
||||
llxFooter();
|
||||
$db->close();
|
||||
|
||||
@ -142,7 +142,7 @@ if ($action == 'edit') // Edit
|
||||
print '</table><br>'."\n";
|
||||
|
||||
// Themes
|
||||
show_theme('',1);
|
||||
show_theme(null,1);
|
||||
print '<br>';
|
||||
|
||||
// Liste des zone de recherche permanantes supportees
|
||||
@ -323,7 +323,7 @@ else // Show
|
||||
|
||||
|
||||
// Themes
|
||||
show_theme('',0);
|
||||
show_theme(null,0);
|
||||
print '<br>';
|
||||
|
||||
|
||||
|
||||
@ -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>'
|
||||
);
|
||||
|
||||
@ -86,6 +86,13 @@ print_fiche_titre($langs->trans("SecuritySetup"),'','setup');
|
||||
print $langs->trans("ProxyDesc")."<br>\n";
|
||||
print "<br>\n";
|
||||
|
||||
|
||||
|
||||
print '<form action="'.$_SERVER["PHP_SELF"].'" method="POST">';
|
||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
print '<input type="hidden" name="action" value="set_proxy">';
|
||||
|
||||
|
||||
$head=security_prepare_head();
|
||||
|
||||
dol_fiche_head($head, 'proxy', $langs->trans("Security"));
|
||||
@ -118,10 +125,6 @@ if ($conf->use_javascript_ajax)
|
||||
// Timeout
|
||||
$var=true;
|
||||
|
||||
print '<form action="'.$_SERVER["PHP_SELF"].'" method="POST">';
|
||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
print '<input type="hidden" name="action" value="set_proxy">';
|
||||
|
||||
print '<table width="100%" class="noborder">';
|
||||
|
||||
print '<tr class="liste_titre">';
|
||||
@ -196,14 +199,13 @@ print '</tr>';
|
||||
|
||||
print '</table>';
|
||||
|
||||
print '<br><center>';
|
||||
print '<input type="submit" class="button" name="button" value="'.$langs->trans("Modify").'">';
|
||||
print '</center>';
|
||||
|
||||
print '</form>';
|
||||
|
||||
dol_fiche_end();
|
||||
|
||||
print '<div class="center">';
|
||||
print '<input type="submit" class="button" name="button" value="'.$langs->trans("Modify").'">';
|
||||
print '</div>';
|
||||
|
||||
print '</form>';
|
||||
|
||||
$db->close();
|
||||
|
||||
|
||||
@ -23,7 +23,7 @@
|
||||
*/
|
||||
|
||||
require '../main.inc.php';
|
||||
|
||||
|
||||
// Class
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
|
||||
|
||||
@ -45,7 +45,7 @@ $list = array (
|
||||
/*
|
||||
* Actions
|
||||
*/
|
||||
|
||||
|
||||
if ($action == 'update')
|
||||
{
|
||||
$error = 0;
|
||||
@ -72,12 +72,12 @@ if ($action == 'update')
|
||||
* View
|
||||
*/
|
||||
|
||||
llxHeader();
|
||||
llxHeader('',$langs->trans('SalariesSetup'));
|
||||
|
||||
$form = new Form($db);
|
||||
|
||||
$linkback='<a href="'.DOL_URL_ROOT.'/admin/modules.php">'.$langs->trans("BackToModuleList").'</a>';
|
||||
print_fiche_titre($langs->trans('ConfigSalaries'),$linkback,'setup');
|
||||
print_fiche_titre($langs->trans('SalariesSetup'),$linkback,'setup');
|
||||
|
||||
print '<form action="'.$_SERVER["PHP_SELF"].'" method="post">';
|
||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
@ -98,7 +98,7 @@ foreach ($list as $key)
|
||||
print '<tr '.$bc[$var].' class="value">';
|
||||
|
||||
// Param
|
||||
$label = $langs->trans($key);
|
||||
$label = $langs->trans($key);
|
||||
print '<td><label for="'.$key.'">'.$label.'</label></td>';
|
||||
|
||||
// Value
|
||||
|
||||
@ -80,35 +80,15 @@ else if (preg_match('/del_(.*)/',$action,$reg))
|
||||
}
|
||||
}
|
||||
|
||||
else if ($action == 'MAIN_SESSION_TIMEOUT')
|
||||
else if ($action == 'updateform')
|
||||
{
|
||||
if (! dolibarr_set_const($db, "MAIN_SESSION_TIMEOUT", $_POST["MAIN_SESSION_TIMEOUT"],'chaine',0,'',$conf->entity)) dol_print_error($db);
|
||||
else setEventMessage($langs->trans("RecordModifiedSuccessfully"));
|
||||
}
|
||||
else if ($action == 'MAIN_UPLOAD_DOC')
|
||||
{
|
||||
if (! dolibarr_set_const($db, 'MAIN_UPLOAD_DOC',$_POST["MAIN_UPLOAD_DOC"],'chaine',0,'',$conf->entity)) dol_print_error($db);
|
||||
else setEventMessage($langs->trans("RecordModifiedSuccessfully"));
|
||||
}
|
||||
else if ($action == 'MAIN_UMASK')
|
||||
{
|
||||
if (! dolibarr_set_const($db, "MAIN_UMASK", $_POST["MAIN_UMASK"],'chaine',0,'',$conf->entity)) dol_print_error($db);
|
||||
else setEventMessage($langs->trans("RecordModifiedSuccessfully"));
|
||||
}
|
||||
else if ($action == 'MAIN_ANTIVIRUS_COMMAND')
|
||||
{
|
||||
if (! dolibarr_set_const($db, "MAIN_ANTIVIRUS_COMMAND", $_POST["MAIN_ANTIVIRUS_COMMAND"],'chaine',0,'',$conf->entity)) dol_print_error($db);
|
||||
else setEventMessage($langs->trans("RecordModifiedSuccessfully"));
|
||||
}
|
||||
else if ($action == 'MAIN_ANTIVIRUS_PARAM')
|
||||
{
|
||||
if (! dolibarr_set_const($db, "MAIN_ANTIVIRUS_PARAM", $_POST["MAIN_ANTIVIRUS_PARAM"],'chaine',0,'',$conf->entity)) dol_print_error($db);
|
||||
else setEventMessage($langs->trans("RecordModifiedSuccessfully"));
|
||||
}
|
||||
else if ($action == 'MAIN_APPLICATION_TITLE')
|
||||
{
|
||||
if (! dolibarr_set_const($db, "MAIN_APPLICATION_TITLE", $_POST["MAIN_SESSION_TIMEOUT"],'chaine',0,'',$conf->entity)) dol_print_error($db);
|
||||
else setEventMessage($langs->trans("RecordModifiedSuccessfully"));
|
||||
$res1=dolibarr_set_const($db, "MAIN_APPLICATION_TITLE", $_POST["MAIN_APPLICATION_TITLE"],'chaine',0,'',$conf->entity);
|
||||
$res2=dolibarr_set_const($db, "MAIN_SESSION_TIMEOUT", $_POST["MAIN_SESSION_TIMEOUT"],'chaine',0,'',$conf->entity);
|
||||
$res3=dolibarr_set_const($db, 'MAIN_UPLOAD_DOC',$_POST["MAIN_UPLOAD_DOC"],'chaine',0,'',$conf->entity);
|
||||
$res4=dolibarr_set_const($db, "MAIN_UMASK", $_POST["MAIN_UMASK"],'chaine',0,'',$conf->entity);
|
||||
$res5=dolibarr_set_const($db, "MAIN_ANTIVIRUS_COMMAND", $_POST["MAIN_ANTIVIRUS_COMMAND"],'chaine',0,'',$conf->entity);
|
||||
$res6=dolibarr_set_const($db, "MAIN_ANTIVIRUS_PARAM", $_POST["MAIN_ANTIVIRUS_PARAM"],'chaine',0,'',$conf->entity);
|
||||
if ($res1 && $res2 && $res3 && $res4 && $res5 && $res6) setEventMessage($langs->trans("RecordModifiedSuccessfully"));
|
||||
}
|
||||
|
||||
|
||||
@ -138,59 +118,17 @@ print_fiche_titre($langs->trans("SecuritySetup"),'','setup');
|
||||
print $langs->trans("MiscellaneousDesc")."<br>\n";
|
||||
print "<br>\n";
|
||||
|
||||
|
||||
|
||||
print '<form action="'.$_SERVER["PHP_SELF"].'" method="POST">';
|
||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
print '<input type="hidden" name="action" value="updateform">';
|
||||
|
||||
$head=security_prepare_head();
|
||||
|
||||
dol_fiche_head($head, 'misc', $langs->trans("Security"));
|
||||
|
||||
|
||||
// Timeout
|
||||
$var=true;
|
||||
|
||||
print '<table width="100%" class="noborder">';
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td colspan="2">'.$langs->trans("Parameters").'</td>';
|
||||
print '<td>'.$langs->trans("Value").'</td>';
|
||||
print '<td width="100"> </td>';
|
||||
print "</tr>\n";
|
||||
|
||||
$var=!$var;
|
||||
$sessiontimeout=ini_get("session.gc_maxlifetime");
|
||||
if (empty($conf->global->MAIN_SESSION_TIMEOUT)) $conf->global->MAIN_SESSION_TIMEOUT=$sessiontimeout;
|
||||
print '<form action="'.$_SERVER["PHP_SELF"].'?action=MAIN_SESSION_TIMEOUT" method="POST">';
|
||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
print '<tr '.$bc[$var].'>';
|
||||
print '<td>'.$langs->trans("SessionTimeOut").'</td><td align="right">';
|
||||
print $form->textwithpicto('',$langs->trans("SessionExplanation",ini_get("session.gc_probability"),ini_get("session.gc_divisor")));
|
||||
print '</td>';
|
||||
print '<td class="nowrap">';
|
||||
print '<input class="flat" name="MAIN_SESSION_TIMEOUT" type="text" size="6" value="'.htmlentities($conf->global->MAIN_SESSION_TIMEOUT).'"> '.strtolower($langs->trans("Seconds"));
|
||||
print '</td>';
|
||||
print '<td align="right">';
|
||||
print '<input type="submit" class="button" name="button" value="'.$langs->trans("Modify").'">';
|
||||
print '</td>';
|
||||
print '</tr></form>';
|
||||
|
||||
$var=!$var;
|
||||
$sessiontimeout=ini_get("session.gc_maxlifetime");
|
||||
if (empty($conf->global->MAIN_APPLICATION_TITLE)) $conf->global->MAIN_APPLICATION_TITLE="";
|
||||
print '<form action="'.$_SERVER["PHP_SELF"].'?action=MAIN_APPLICATION_TITLE" method="POST">';
|
||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
print '<tr '.$bc[$var].'>';
|
||||
print '<td>'.$langs->trans("HiddeNumVersion").'</td><td align="right">';
|
||||
print $form->textwithpicto('',$langs->trans("HiddeNumVersionExample",ini_get("session.gc_probability"),ini_get("session.gc_divisor")));
|
||||
print '</td>';
|
||||
print '<td class="nowrap">';
|
||||
print '<input class="flat" name="MAIN_SESSION_TIMEOUT" type="text" size="20" value="'.htmlentities($conf->global->MAIN_APPLICATION_TITLE).'"> ';
|
||||
print '</td>';
|
||||
print '<td align="right">';
|
||||
print '<input type="submit" class="button" name="button" value="'.$langs->trans("Modify").'">';
|
||||
print '</td>';
|
||||
print '</tr></form>';
|
||||
|
||||
print '</table>';
|
||||
print '<br>';
|
||||
|
||||
|
||||
// Other Options
|
||||
$var=true;
|
||||
|
||||
@ -254,6 +192,44 @@ print "</td></tr>";
|
||||
|
||||
print '</table>';
|
||||
|
||||
|
||||
print '<br>';
|
||||
|
||||
|
||||
// Timeout
|
||||
$var=true;
|
||||
|
||||
print '<table width="100%" class="noborder">';
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td colspan="2">'.$langs->trans("Parameters").'</td>';
|
||||
print '<td>'.$langs->trans("Value").'</td>';
|
||||
print "</tr>\n";
|
||||
|
||||
$var=!$var;
|
||||
$sessiontimeout=ini_get("session.gc_maxlifetime");
|
||||
if (empty($conf->global->MAIN_SESSION_TIMEOUT)) $conf->global->MAIN_SESSION_TIMEOUT=$sessiontimeout;
|
||||
print '<tr '.$bc[$var].'>';
|
||||
print '<td>'.$langs->trans("SessionTimeOut").'</td><td align="right">';
|
||||
print $form->textwithpicto('',$langs->trans("SessionExplanation",ini_get("session.gc_probability"),ini_get("session.gc_divisor")));
|
||||
print '</td>';
|
||||
print '<td class="nowrap">';
|
||||
print '<input class="flat" name="MAIN_SESSION_TIMEOUT" type="text" size="6" value="'.htmlentities($conf->global->MAIN_SESSION_TIMEOUT).'"> '.strtolower($langs->trans("Seconds"));
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
|
||||
$var=!$var;
|
||||
$sessiontimeout=ini_get("session.gc_maxlifetime");
|
||||
if (empty($conf->global->MAIN_APPLICATION_TITLE)) $conf->global->MAIN_APPLICATION_TITLE="";
|
||||
print '<tr '.$bc[$var].'>';
|
||||
print '<td>'.$langs->trans("MAIN_APPLICATION_TITLE").'</td><td align="right">';
|
||||
print '</td>';
|
||||
print '<td class="nowrap">';
|
||||
print '<input class="flat" name="MAIN_APPLICATION_TITLE" type="text" size="20" value="'.htmlentities($conf->global->MAIN_APPLICATION_TITLE).'"> ';
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
|
||||
print '</table>';
|
||||
|
||||
print '<br>';
|
||||
|
||||
// Upload options
|
||||
@ -263,11 +239,8 @@ print '<table class="noborder" width="100%">';
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td colspan="2">'.$langs->trans("Parameters").'</td>';
|
||||
print '<td>'.$langs->trans("Value").'</td>';
|
||||
print '<td width="100"> </td>';
|
||||
print '</tr>';
|
||||
|
||||
print '<form action="'.$_SERVER["PHP_SELF"].'?action=MAIN_UPLOAD_DOC" method="POST">';
|
||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
print '<tr '.$bc[$var].'>';
|
||||
print '<td colspan="2">'.$langs->trans("MaxSizeForUploadedFiles").'.';
|
||||
$max=@ini_get('upload_max_filesize');
|
||||
@ -277,14 +250,9 @@ print '</td>';
|
||||
print '<td class="nowrap">';
|
||||
print '<input class="flat" name="MAIN_UPLOAD_DOC" type="text" size="6" value="'.htmlentities($conf->global->MAIN_UPLOAD_DOC).'"> '.$langs->trans("Kb");
|
||||
print '</td>';
|
||||
print '<td align="right">';
|
||||
print '<input type="submit" class="button" name="button" value="'.$langs->trans("Modify").'">';
|
||||
print '</td>';
|
||||
print '</tr></form>';
|
||||
print '</tr>';
|
||||
|
||||
$var=!$var;
|
||||
print '<form action="'.$_SERVER["PHP_SELF"].'?action=MAIN_UMASK" method="POST">';
|
||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
print '<tr '.$bc[$var].'>';
|
||||
print '<td>'.$langs->trans("UMask").'</td><td align="right">';
|
||||
print $form->textwithpicto('',$langs->trans("UMaskExplanation"));
|
||||
@ -292,15 +260,10 @@ print '</td>';
|
||||
print '<td class="nowrap">';
|
||||
print '<input class="flat" name="MAIN_UMASK" type="text" size="6" value="'.htmlentities($conf->global->MAIN_UMASK).'">';
|
||||
print '</td>';
|
||||
print '<td align="right">';
|
||||
print '<input type="submit" class="button" name="button" value="'.$langs->trans("Modify").'">';
|
||||
print '</td>';
|
||||
print '</tr></form>';
|
||||
print '</tr>';
|
||||
|
||||
// Use anti virus
|
||||
$var=!$var;
|
||||
print '<form action="'.$_SERVER["PHP_SELF"].'?action=MAIN_ANTIVIRUS_COMMAND" method="POST">';
|
||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
print "<tr ".$bc[$var].">";
|
||||
print '<td colspan="2">'.$langs->trans("AntiVirusCommand").'<br>';
|
||||
print $langs->trans("AntiVirusCommandExample");
|
||||
@ -320,16 +283,10 @@ if (ini_get('safe_mode') && ! empty($conf->global->MAIN_ANTIVIRUS_COMMAND))
|
||||
}
|
||||
print '<input type="text" name="MAIN_ANTIVIRUS_COMMAND" size="72" value="'.(! empty($conf->global->MAIN_ANTIVIRUS_COMMAND)?dol_htmlentities($conf->global->MAIN_ANTIVIRUS_COMMAND):'').'">';
|
||||
print "</td>";
|
||||
print '<td align="right">';
|
||||
print '<input type="submit" class="button" name="button" value="'.$langs->trans("Modify").'">';
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
print '</form>';
|
||||
|
||||
// Use anti virus
|
||||
$var=!$var;
|
||||
print '<form action="'.$_SERVER["PHP_SELF"].'?action=MAIN_ANTIVIRUS_PARAM" method="POST">';
|
||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
print "<tr ".$bc[$var].">";
|
||||
print '<td colspan="2">'.$langs->trans("AntiVirusParam").'<br>';
|
||||
print $langs->trans("AntiVirusParamExample");
|
||||
@ -337,16 +294,18 @@ print '</td>';
|
||||
print '<td>';
|
||||
print '<input type="text" name="MAIN_ANTIVIRUS_PARAM" size="72" value="'.(! empty($conf->global->MAIN_ANTIVIRUS_PARAM)?dol_htmlentities($conf->global->MAIN_ANTIVIRUS_PARAM):'').'">';
|
||||
print "</td>";
|
||||
print '<td align="right">';
|
||||
print '<input type="submit" class="button" name="button" value="'.$langs->trans("Modify").'">';
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
print '</form>';
|
||||
|
||||
print '</table>';
|
||||
|
||||
dol_fiche_end();
|
||||
|
||||
print '<div class="center"><input type="submit" class="button" name="button" value="'.$langs->trans("Modify").'"></div>';
|
||||
|
||||
print '</form>';
|
||||
|
||||
|
||||
|
||||
// Form to test upload
|
||||
print '<br>';
|
||||
$formfile=new FormFile($db);
|
||||
|
||||
@ -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
|
||||
{
|
||||
|
||||
@ -35,6 +35,8 @@ require_once DOL_DOCUMENT_ROOT.'/user/class/user.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/comm/action/class/cactioncomm.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/comm/action/class/actioncomm.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formactions.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php';
|
||||
|
||||
if (! empty($conf->projet->enabled))
|
||||
{
|
||||
require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
|
||||
@ -74,6 +76,7 @@ $cactioncomm = new CActionComm($db);
|
||||
$object = new ActionComm($db);
|
||||
$contact = new Contact($db);
|
||||
$extrafields = new ExtraFields($db);
|
||||
$formfile = new FormFile($db);
|
||||
|
||||
// fetch optionals attributes and labels
|
||||
$extralabels=$extrafields->fetch_name_optionals_label($object->table_element);
|
||||
@ -710,9 +713,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);
|
||||
}
|
||||
|
||||
}
|
||||
@ -1243,6 +1246,34 @@ if ($id > 0)
|
||||
|
||||
if ($action != 'edit')
|
||||
{
|
||||
|
||||
if (empty($conf->global->SOCIETE_DISABLE_BUILDDOC)) {
|
||||
print '<div class="fichecenter"><div class="fichehalfleft">';
|
||||
print '<a name="builddoc"></a>'; // ancre
|
||||
|
||||
/*
|
||||
* Documents generes
|
||||
*/
|
||||
|
||||
$filedir=$conf->agenda->multidir_output[$conf->entity].'/'.$object->id;
|
||||
$urlsource=$_SERVER["PHP_SELF"]."?socid=".$object->id;
|
||||
|
||||
$genallowed=$user->rights->agenda->myactions->create;
|
||||
$delallowed=$user->rights->agenda->myactions->delete;
|
||||
|
||||
$var=true;
|
||||
|
||||
$somethingshown=$formfile->show_documents('agenda',$object->id,$filedir,$urlsource,$genallowed,$delallowed,'',0,0,0,0,0,'','','',$object->default_lang);
|
||||
|
||||
print '</div><div class="fichehalfright"><div class="ficheaddleft">';
|
||||
|
||||
|
||||
print '</div></div></div>';
|
||||
|
||||
print '<div style="clear:both;"> </div>';
|
||||
}
|
||||
|
||||
|
||||
// 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;">';
|
||||
|
||||
@ -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)
|
||||
{
|
||||
|
||||
@ -201,6 +201,7 @@ if ($filter) $param.="&filter=".$filter;
|
||||
if ($filtera) $param.="&filtera=".$filtera;
|
||||
if ($filtert) $param.="&filtert=".$filtert;
|
||||
if ($filterd) $param.="&filterd=".$filterd;
|
||||
if ($usergroup) $param.="&usergroup=".$usergroup;
|
||||
if ($socid) $param.="&socid=".$socid;
|
||||
if ($showbirthday) $param.="&showbirthday=1";
|
||||
if ($pid) $param.="&projectid=".$pid;
|
||||
@ -242,6 +243,20 @@ $nav.=" (<a href=\"?year=".$nowyear."&month=".$nowmonth."&day=".$
|
||||
$picto='calendarweek';
|
||||
|
||||
$nav.=' <form name="dateselect" action="'.$_SERVER["PHP_SELF"].'?action=show_peruser'.$param.'">';
|
||||
$nav.='<input type="hidden" name="token" value="' . $_SESSION ['newtoken'] . '">';
|
||||
$nav.='<input type="hidden" name="action" value="' . $action . '">';
|
||||
$nav.='<input type="hidden" name="usertodo" value="' . $filtert . '">';
|
||||
$nav.='<input type="hidden" name="usergroup" value="' . $usergroup . '">';
|
||||
$nav.='<input type="hidden" name="actioncode" value="' . $actioncode . '">';
|
||||
$nav.='<input type="hidden" name="status" value="' . $status . '">';
|
||||
$nav.='<input type="hidden" name="socid" value="' . $socid . '">';
|
||||
$nav.='<input type="hidden" name="projectid" value="' . $projectid . '">';
|
||||
$nav.='<input type="hidden" name="begin_h" value="' . $begin_h . '">';
|
||||
$nav.='<input type="hidden" name="end_h" value="' . $end_h . '">';
|
||||
$nav.='<input type="hidden" name="begin_d" value="' . $begin_d . '">';
|
||||
$nav.='<input type="hidden" name="end_d" value="' . $end_d . '">';
|
||||
$nav.='<input type="hidden" name="showbirthday" value="' . $showbirthday . '">';
|
||||
|
||||
$nav.=$form->select_date($dateselect, 'dateselect', 0, 0, 1, '', 1, 0, 1);
|
||||
$nav.=' <input type="submit" name="submitdateselect" class="button" value="'.$langs->trans("Refresh").'">';
|
||||
$nav.='</form>';
|
||||
@ -659,10 +674,12 @@ while ($obj = $db->fetch_object($resql))
|
||||
$todayarray=dol_getdate($now,'fast');
|
||||
$sav = $tmpday;
|
||||
$showheader = true;
|
||||
$var = false;
|
||||
foreach ($usernames as $username)
|
||||
{
|
||||
$var = ! $var;
|
||||
echo "<tr>";
|
||||
echo '<td class="cal_current_month">' . $username->getNomUrl(1). '</td>';
|
||||
echo '<td class="cal_current_month"'.($var?' style="background: #F8F8F8"':'').'>' . $username->getNomUrl(1). '</td>';
|
||||
$tmpday = $sav;
|
||||
|
||||
// Lopp on each day of week
|
||||
@ -688,7 +705,7 @@ foreach ($usernames as $username)
|
||||
if ($todayarray['mday']==$tmpday && $todayarray['mon']==$tmpmonth && $todayarray['year']==$tmpyear) $today=1;
|
||||
if ($today) $style='cal_today_peruser';
|
||||
|
||||
show_day_events2($username, $tmpday, $tmpmonth, $tmpyear, $monthshown, $style, $eventarray, 0, $maxnbofchar, $newparam, 1, 300, $showheader, $colorsbytype);
|
||||
show_day_events2($username, $tmpday, $tmpmonth, $tmpyear, $monthshown, $style, $eventarray, 0, $maxnbofchar, $newparam, 1, 300, $showheader, $colorsbytype, $var);
|
||||
|
||||
$i++;
|
||||
}
|
||||
@ -785,9 +802,10 @@ $db->close();
|
||||
* @param int $minheight Minimum height for each event. 60px by default.
|
||||
* @param boolean $showheader Show header
|
||||
* @param array $colorsbytype Array with colors by type
|
||||
* @param string $var true or false for alternat style on tr/td
|
||||
* @return void
|
||||
*/
|
||||
function show_day_events2($username, $day, $month, $year, $monthshown, $style, &$eventarray, $maxprint=0, $maxnbofchar=16, $newparam='', $showinfo=0, $minheight=60, $showheader=false, $colorsbytype=array())
|
||||
function show_day_events2($username, $day, $month, $year, $monthshown, $style, &$eventarray, $maxprint=0, $maxnbofchar=16, $newparam='', $showinfo=0, $minheight=60, $showheader=false, $colorsbytype=array(), $var=false)
|
||||
{
|
||||
global $db;
|
||||
global $user, $conf, $langs, $hookmanager, $action;
|
||||
@ -989,8 +1007,8 @@ function show_day_events2($username, $day, $month, $year, $monthshown, $style, &
|
||||
}
|
||||
|
||||
|
||||
if ($h == $begin_h) echo '<td class="'.$style.'_peruserleft cal_peruser">';
|
||||
else echo '<td class="'.$style.' cal_peruser">';
|
||||
if ($h == $begin_h) echo '<td class="'.$style.'_peruserleft cal_peruser"'.($var?' style="background: #F8F8F8"':'').'>';
|
||||
else echo '<td class="'.$style.' cal_peruser"'.($var?' style="background: #F8F8F8"':'').'>';
|
||||
if (count($cases1[$h]) == 1) // 1 seul evenement
|
||||
{
|
||||
$ids=array_keys($cases1[$h]);
|
||||
|
||||
@ -48,13 +48,12 @@ $pagenext = $page + 1;
|
||||
if (! $sortorder) $sortorder="ASC";
|
||||
if (! $sortfield) $sortfield="s.nom";
|
||||
|
||||
$search_nom=GETPOST("search_nom");
|
||||
$search_company=GETPOST("search_company");
|
||||
$search_zipcode=GETPOST("search_zipcode");
|
||||
$search_town=GETPOST("search_town");
|
||||
$search_code=GETPOST("search_code");
|
||||
$search_compta=GETPOST("search_compta");
|
||||
$search_status = GETPOST("search_status",'int');
|
||||
if ($search_status=='') $search_status=1; // always display activ customer first
|
||||
|
||||
// Load sale and categ filters
|
||||
$search_sale = GETPOST("search_sale");
|
||||
@ -78,21 +77,18 @@ if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'e
|
||||
// Do we click on purge search criteria ?
|
||||
if (GETPOST("button_removefilter_x"))
|
||||
{
|
||||
$search_categ='';
|
||||
$catid='';
|
||||
$search_sale='';
|
||||
$socname="";
|
||||
$search_nom="";
|
||||
$search_sale="";
|
||||
$search_categ="";
|
||||
$catid="";
|
||||
$search_company="";
|
||||
$search_zipcode="";
|
||||
$search_town="";
|
||||
$search_idprof1='';
|
||||
$search_idprof2='';
|
||||
$search_idprof3='';
|
||||
$search_idprof4='';
|
||||
$seach_status=1;
|
||||
$search_code='';
|
||||
$search_compta='';
|
||||
$search_status='';
|
||||
}
|
||||
|
||||
|
||||
if ($search_status=='') $search_status=1; // always display activ customer first
|
||||
|
||||
/*
|
||||
* view
|
||||
@ -122,8 +118,8 @@ if ($catid > 0) $sql.= " AND cs.fk_categorie = ".$catid;
|
||||
if ($catid == -2) $sql.= " AND cs.fk_categorie IS NULL";
|
||||
if ($search_categ > 0) $sql.= " AND cs.fk_categorie = ".$search_categ;
|
||||
if ($search_categ == -2) $sql.= " AND cs.fk_categorie IS NULL";
|
||||
if ($search_nom) {
|
||||
$sql .= natural_search('s.nom', $search_nom);
|
||||
if ($search_company) {
|
||||
$sql .= natural_search('s.nom', $search_company);
|
||||
}
|
||||
if ($search_zipcode) $sql.= " AND s.zip LIKE '".$db->escape($search_zipcode)."%'";
|
||||
if ($search_town) {
|
||||
@ -156,7 +152,7 @@ if ($result)
|
||||
{
|
||||
$num = $db->num_rows($result);
|
||||
|
||||
$param = "&search_nom=".$search_nom."&search_code=".$search_code."&search_zipcode=".$search_zipcode."&search_town=".$search_town;
|
||||
$param = "&search_company=".$search_company."&search_code=".$search_code."&search_zipcode=".$search_zipcode."&search_town=".$search_town;
|
||||
if ($search_categ != '') $param.='&search_categ='.$search_categ;
|
||||
if ($search_sale != '') $param.='&search_sale='.$search_sale;
|
||||
if ($search_status != '') $param.='&search_status='.$search_status;
|
||||
@ -207,7 +203,7 @@ if ($result)
|
||||
print '<tr class="liste_titre">';
|
||||
|
||||
print '<td class="liste_titre">';
|
||||
print '<input type="text" class="flat" name="search_nom" value="'.$search_nom.'" size="10">';
|
||||
print '<input type="text" class="flat" name="search_company" value="'.$search_company.'" size="10">';
|
||||
print '</td>';
|
||||
|
||||
print '<td class="liste_titre">';
|
||||
@ -235,7 +231,6 @@ if ($result)
|
||||
print '</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 '</td>';
|
||||
|
||||
|
||||
@ -2000,7 +2000,7 @@ if ($action == 'create')
|
||||
{
|
||||
$var = true;
|
||||
|
||||
// Add free products/services
|
||||
// Add products/services form
|
||||
$object->formAddObjectLine(1, $mysoc, $soc);
|
||||
|
||||
$parameters = array();
|
||||
|
||||
@ -651,7 +651,7 @@ class Propal extends CommonObject
|
||||
* @param int $notrigger 1=Does not execute triggers, 0= execuete triggers
|
||||
* @return int <0 if KO, >=0 if OK
|
||||
*/
|
||||
function create($user='', $notrigger=0)
|
||||
function create($user, $notrigger=0)
|
||||
{
|
||||
global $langs,$conf,$mysoc,$hookmanager;
|
||||
$error=0;
|
||||
@ -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'));
|
||||
@ -917,7 +919,7 @@ class Propal extends CommonObject
|
||||
{
|
||||
$this->products=$this->lines;
|
||||
|
||||
return $this->create();
|
||||
return $this->create($user);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -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;
|
||||
|
||||
@ -56,6 +56,8 @@ $search_societe=GETPOST('search_societe','alpha');
|
||||
$search_montant_ht=GETPOST('search_montant_ht','alpha');
|
||||
$search_author=GETPOST('search_author','alpha');
|
||||
$search_town=GETPOST('search_town','alpha');
|
||||
$viewstatut=$db->escape(GETPOST('viewstatut'));
|
||||
$object_statut=$db->escape(GETPOST('propal_statut'));
|
||||
|
||||
$sall=GETPOST("sall");
|
||||
$mesg=(GETPOST("msg") ? GETPOST("msg") : GETPOST("mesg"));
|
||||
@ -78,6 +80,26 @@ if (! empty($socid))
|
||||
}
|
||||
$result = restrictedArea($user, $module, $objectid, $dbtable);
|
||||
|
||||
if (GETPOST("button_removefilter") || GETPOST("button_removefilter_x")) // Both tests are required to be compatible with all browsers
|
||||
{
|
||||
$search_categ='';
|
||||
$search_user='';
|
||||
$search_sale='';
|
||||
$search_ref='';
|
||||
$search_refcustomer='';
|
||||
$search_societe='';
|
||||
$search_montant_ht='';
|
||||
$search_author='';
|
||||
$search_town='';
|
||||
$year='';
|
||||
$month='';
|
||||
$viewstatut='';
|
||||
$object_statut='';
|
||||
}
|
||||
|
||||
if($object_statut != '')
|
||||
$viewstatut=$object_statut;
|
||||
|
||||
|
||||
// Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array
|
||||
$hookmanager->initHooks(array('propallist'));
|
||||
@ -93,21 +115,6 @@ $parameters=array('socid'=>$socid);
|
||||
$reshook=$hookmanager->executeHooks('doActions',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks
|
||||
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='';
|
||||
$search_author='';
|
||||
$search_town='';
|
||||
$year='';
|
||||
$month='';
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
@ -132,11 +139,6 @@ $offset = $conf->liste_limit * $page;
|
||||
$pageprev = $page - 1;
|
||||
$pagenext = $page + 1;
|
||||
|
||||
$viewstatut=$db->escape(GETPOST('viewstatut'));
|
||||
$object_statut = $db->escape(GETPOST('propal_statut'));
|
||||
if($object_statut != '')
|
||||
$viewstatut=$object_statut;
|
||||
|
||||
if (! $sortfield) $sortfield='p.datep';
|
||||
if (! $sortorder) $sortorder='DESC';
|
||||
$limit = $conf->liste_limit;
|
||||
@ -322,10 +324,12 @@ if ($result)
|
||||
print '<td class="liste_titre" align="right">';
|
||||
$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 '<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 '<input type="image" name="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" name="button_removefilter" class="liste_titre" src="'.img_picto($langs->trans("RemoveFilter"),'searchclear.png','','',1).'" value="'.dol_escape_htmltag($langs->trans("RemoveFilter")).'" title="'.dol_escape_htmltag($langs->trans("RemoveFilter")).'">';
|
||||
print '</td>';
|
||||
|
||||
print "</tr>\n";
|
||||
|
||||
$var=true;
|
||||
@ -391,7 +395,7 @@ if ($result)
|
||||
|
||||
// Date proposal
|
||||
print '<td align="center">';
|
||||
print dol_print_date($db->jdate($obj->dp), 'day');
|
||||
print dol_print_date($db->jdate($objp->dp), 'day');
|
||||
print "</td>\n";
|
||||
|
||||
// Date end validity
|
||||
|
||||
@ -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'));
|
||||
@ -998,7 +1000,12 @@ class Commande extends CommonOrder
|
||||
$line->marge_tx = $marginInfos[1];
|
||||
$line->marque_tx = $marginInfos[2];
|
||||
|
||||
$this->lines[$i] = $line;
|
||||
// get extrafields from original line
|
||||
$object->lines[$i]->fetch_optionals($object->lines[$i]->rowid);
|
||||
foreach($object->lines[$i]->array_options as $options_key => $value)
|
||||
$line->array_options[$options_key] = $value;
|
||||
|
||||
$this->lines[$i] = $line;
|
||||
}
|
||||
|
||||
$this->socid = $object->socid;
|
||||
@ -1019,6 +1026,11 @@ class Commande extends CommonOrder
|
||||
$this->origin = $object->element;
|
||||
$this->origin_id = $object->id;
|
||||
|
||||
// get extrafields from original line
|
||||
$object->fetch_optionals($object->id);
|
||||
foreach($object->array_options as $options_key => $value)
|
||||
$this->array_options[$options_key] = $value;
|
||||
|
||||
// Possibility to add external linked objects with hooks
|
||||
$this->linked_objects[$this->origin] = $this->origin_id;
|
||||
if (is_array($object->other_linked_objects) && ! empty($object->other_linked_objects))
|
||||
@ -2928,6 +2940,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 +3294,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;
|
||||
|
||||
@ -229,7 +229,7 @@ if ($resql)
|
||||
if ($viewstatut == 1)
|
||||
$title.=' - '.$langs->trans('StatusOrderValidatedShort');
|
||||
if ($viewstatut == 2)
|
||||
$title.=' - '.$langs->trans('StatusOrderOnProcessShort');
|
||||
$title.=' - '.$langs->trans('StatusOrderSentShort');
|
||||
if ($viewstatut == 3)
|
||||
$title.=' - '.$langs->trans('StatusOrderToBillShort');
|
||||
if ($viewstatut == 4)
|
||||
@ -295,7 +295,7 @@ if ($resql)
|
||||
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="search_ref" value="'.$search_ref.'">';
|
||||
|
||||
@ -63,8 +63,7 @@ if ($action == 'update' && ! $_POST["cancel"])
|
||||
$account->number = trim($_POST["number"]);
|
||||
$account->cle_rib = trim($_POST["cle_rib"]);
|
||||
$account->bic = trim($_POST["bic"]);
|
||||
$account->iban = trim($_POST["iban_prefix"]);
|
||||
$account->iban_prefix = trim($_POST["iban_prefix"]); // deprecated
|
||||
$account->iban = trim($_POST["iban"]);
|
||||
$account->domiciliation = trim($_POST["domiciliation"]);
|
||||
$account->proprio = trim($_POST["proprio"]);
|
||||
$account->owner_address = trim($_POST["owner_address"]);
|
||||
@ -246,7 +245,7 @@ if (($_GET["id"] || $_GET["ref"]) && $action != 'edit')
|
||||
if ($account->getCountryCode() == 'IN') $bickey="SWIFT";
|
||||
|
||||
print '<tr><td valign="top">'.$langs->trans($ibankey).'</td>';
|
||||
print '<td colspan="3">'.$account->iban_prefix.'</td></tr>';
|
||||
print '<td colspan="3">'.$account->iban.'</td></tr>';
|
||||
|
||||
print '<tr><td valign="top">'.$langs->trans($bickey).'</td>';
|
||||
print '<td colspan="3">'.$account->bic.'</td></tr>';
|
||||
@ -423,7 +422,7 @@ if ($_GET["id"] && $action == 'edit' && $user->rights->banque->configurer)
|
||||
|
||||
// IBAN
|
||||
print '<tr><td valign="top">'.$langs->trans($ibankey).'</td>';
|
||||
print '<td colspan="3"><input size="34" maxlength="34" type="text" class="flat" name="iban_prefix" value="'.$account->iban_prefix.'"></td></tr>';
|
||||
print '<td colspan="3"><input size="34" maxlength="34" type="text" class="flat" name="iban" value="'.$account->iban.'"></td></tr>';
|
||||
|
||||
print '<tr><td valign="top">'.$langs->trans($bickey).'</td>';
|
||||
print '<td colspan="3"><input size="11" maxlength="11" type="text" class="flat" name="bic" value="'.$account->bic.'"></td></tr>';
|
||||
|
||||
@ -135,7 +135,7 @@ if ($_POST["action"] == 'update' && ! $_POST["cancel"])
|
||||
$account->number = trim($_POST["number"]);
|
||||
$account->cle_rib = trim($_POST["cle_rib"]);
|
||||
$account->bic = trim($_POST["bic"]);
|
||||
$account->iban_prefix = trim($_POST["iban_prefix"]);
|
||||
$account->iban = trim($_POST["iban"]);
|
||||
$account->domiciliation = trim($_POST["domiciliation"]);
|
||||
|
||||
$account->proprio = trim($_POST["proprio"]);
|
||||
|
||||
@ -59,7 +59,7 @@ class Account extends CommonObject
|
||||
//! BIC/SWIFT number
|
||||
var $bic;
|
||||
//! IBAN number (International Bank Account Number)
|
||||
var $iban_prefix;
|
||||
var $iban; // stored into iban_prefix field into database
|
||||
var $proprio;
|
||||
var $owner_address;
|
||||
|
||||
@ -642,7 +642,6 @@ class Account extends CommonObject
|
||||
$this->cle_rib = $obj->cle_rib;
|
||||
$this->bic = $obj->bic;
|
||||
$this->iban = $obj->iban;
|
||||
$this->iban_prefix = $obj->iban; // deprecated
|
||||
$this->domiciliation = $obj->domiciliation;
|
||||
$this->proprio = $obj->proprio;
|
||||
$this->owner_address = $obj->owner_address;
|
||||
@ -1011,7 +1010,6 @@ class Account extends CommonObject
|
||||
$this->cle_rib = 50;
|
||||
$this->bic = 'AA12';
|
||||
$this->iban = 'FR999999999';
|
||||
$this->iban_prefix = 'FR'; // deprecated
|
||||
$this->domiciliation = 'The bank addresse';
|
||||
$this->proprio = 'Owner';
|
||||
$this->owner_address = 'Owner address';
|
||||
@ -1145,7 +1143,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 +1192,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;
|
||||
|
||||
@ -157,7 +157,7 @@ if ($_REQUEST["account"] || $_REQUEST["ref"])
|
||||
$sql.= " ORDER BY dlr ASC";
|
||||
|
||||
// Supplier invoices
|
||||
$sql2= " SELECT 'invoice_supplier' as family, ff.rowid as objid, ff.ref_supplier as ref, (-1*ff.total_ttc) as total_ttc, ff.type, ff.date_lim_reglement as dlr,";
|
||||
$sql2= " SELECT 'invoice_supplier' as family, ff.rowid as objid, ff.ref as ref, ff.ref_supplier as ref_supplier, (-1*ff.total_ttc) as total_ttc, ff.type, ff.date_lim_reglement as dlr,";
|
||||
$sql2.= " s.rowid as socid, s.nom as name, s.fournisseur";
|
||||
$sql2.= " FROM ".MAIN_DB_PREFIX."facture_fourn as ff";
|
||||
$sql2.= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON ff.fk_soc = s.rowid";
|
||||
@ -254,12 +254,13 @@ if ($_REQUEST["account"] || $_REQUEST["ref"])
|
||||
|
||||
if ($obj->family == 'invoice_supplier')
|
||||
{
|
||||
// TODO This code is to avoid to count suppliers credit note (ff.type = 2)
|
||||
// Ajouter gestion des avoirs fournisseurs, champ
|
||||
if (($obj->total_ttc < 0 && $obj->type != 2)
|
||||
|| ($obj->total_ttc > 0 && $obj->type == 2))
|
||||
$showline=1;
|
||||
// Uncomment this line to avoid to count suppliers credit note (ff.type = 2)
|
||||
//$showline=(($obj->total_ttc < 0 && $obj->type != 2) || ($obj->total_ttc > 0 && $obj->type == 2))
|
||||
if ($showline)
|
||||
{
|
||||
$facturefournstatic->ref=$obj->ref;
|
||||
$ref=$obj->ref;
|
||||
$facturefournstatic->ref=$ref;
|
||||
$facturefournstatic->id=$obj->objid;
|
||||
$facturefournstatic->type=$obj->type;
|
||||
$ref = $facturefournstatic->getNomUrl(1,'');
|
||||
@ -298,7 +299,7 @@ if ($_REQUEST["account"] || $_REQUEST["ref"])
|
||||
if ($paiement) $total_ttc = $obj->total_ttc - $paiement;
|
||||
$solde += $total_ttc;
|
||||
|
||||
// We discard with a remain to pay to 0
|
||||
// We discard lines with a remainder to pay to 0
|
||||
if (price2num($total_ttc) != 0)
|
||||
{
|
||||
$var=!$var;
|
||||
|
||||
@ -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'));
|
||||
@ -733,6 +735,11 @@ class Facture extends CommonInvoice
|
||||
$marginInfos = getMarginInfos($object->lines[$i]->subprice, $object->lines[$i]->remise_percent, $object->lines[$i]->tva_tx, $object->lines[$i]->localtax1_tx, $object->lines[$i]->localtax2_tx, $object->lines[$i]->fk_fournprice, $object->lines[$i]->pa_ht);
|
||||
$line->pa_ht = $marginInfos[0];
|
||||
|
||||
// get extrafields from original line
|
||||
$object->lines[$i]->fetch_optionals($object->lines[$i]->rowid);
|
||||
foreach($object->lines[$i]->array_options as $options_key => $value)
|
||||
$line->array_options[$options_key] = $value;
|
||||
|
||||
$this->lines[$i] = $line;
|
||||
}
|
||||
|
||||
@ -752,6 +759,11 @@ class Facture extends CommonInvoice
|
||||
$this->origin = $object->element;
|
||||
$this->origin_id = $object->id;
|
||||
|
||||
// get extrafields from original line
|
||||
$object->fetch_optionals($object->id);
|
||||
foreach($object->array_options as $options_key => $value)
|
||||
$this->array_options[$options_key] = $value;
|
||||
|
||||
// Possibility to add external linked objects with hooks
|
||||
$this->linked_objects[$this->origin] = $this->origin_id;
|
||||
if (! empty($object->other_linked_objects) && is_array($object->other_linked_objects))
|
||||
@ -1040,7 +1052,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;
|
||||
|
||||
@ -429,7 +429,8 @@ if ($search_paymentmode) $sql .= " AND f.fk_mode_reglement = ".$search_payme
|
||||
if ($search_montant_ht) $sql .= " AND f.total = '".$db->escape($search_montant_ht)."'";
|
||||
if ($search_montant_ttc) $sql .= " AND f.total_ttc = '".$db->escape($search_montant_ttc)."'";
|
||||
if (GETPOST('sf_ref')) $sql .= " AND f.facnumber LIKE '%".$db->escape(GETPOST('sf_ref'))."%'";
|
||||
$sql.= " GROUP BY s.nom, s.rowid, s.email, f.rowid, f.facnumber, f.increment, f.total, f.tva, f.total_ttc, f.localtax1, f.localtax2, f.revenuestamp, f.datef, f.date_lim_reglement, f.paye, f.fk_statut, f.type ";
|
||||
$sql.= " GROUP BY s.nom, s.rowid, s.email, f.rowid, f.facnumber, f.ref_client, f.increment, f.total, f.tva, f.total_ttc, f.localtax1, f.localtax2, f.revenuestamp,";
|
||||
$sql.= " f.datef, f.date_lim_reglement, f.paye, f.fk_statut, f.type, fk_mode_reglement";
|
||||
if (! $user->rights->societe->client->voir && ! $socid) $sql .= ", sc.fk_soc, sc.fk_user ";
|
||||
$sql.= " ORDER BY ";
|
||||
$listfield=explode(',',$sortfield);
|
||||
|
||||
@ -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;
|
||||
|
||||
|
||||
@ -29,6 +29,8 @@ require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
|
||||
|
||||
$langs->load("banks");
|
||||
$langs->load("categories");
|
||||
$langs->load("compta");
|
||||
$langs->load("bills");
|
||||
|
||||
// Security check
|
||||
if ($user->societe_id) $socid=$user->societe_id;
|
||||
|
||||
@ -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)
|
||||
{
|
||||
|
||||
@ -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;
|
||||
|
||||
@ -132,6 +132,8 @@ $tableparams = array_merge($commonparams, $tableparams);
|
||||
foreach($allparams as $key => $value) {
|
||||
$paramslink .= '&' . $key . '=' . $value;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* View
|
||||
*/
|
||||
@ -174,12 +176,12 @@ report_header($nom,$nomlink,$period,$periodlink,$description,$builddate,$exportl
|
||||
// SQL request
|
||||
$catotal=0;
|
||||
|
||||
if ($modecompta == 'CREANCES-DETTES')
|
||||
if ($modecompta == 'CREANCES-DETTES')
|
||||
{
|
||||
$sql = "SELECT DISTINCT p.rowid as rowid, p.ref as ref, p.label as label,";
|
||||
$sql.= " sum(l.total_ht) as amount, sum(l.total_ttc) as amount_ttc";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."facture as f, ".MAIN_DB_PREFIX."facturedet as l, ".MAIN_DB_PREFIX."product as p";
|
||||
if ($selected_cat === -2) // Without any category
|
||||
if ($selected_cat === -2) // Without any category
|
||||
{
|
||||
$sql.= " LEFT OUTER JOIN ".MAIN_DB_PREFIX."categorie_product as cp ON p.rowid = cp.fk_product";
|
||||
}
|
||||
@ -198,7 +200,7 @@ if ($modecompta == 'CREANCES-DETTES')
|
||||
if ($date_start && $date_end) {
|
||||
$sql.= " AND f.datef >= '".$db->idate($date_start)."' AND f.datef <= '".$db->idate($date_end)."'";
|
||||
}
|
||||
if ($selected_cat === -2) // Without any category
|
||||
if ($selected_cat === -2) // Without any category
|
||||
{
|
||||
$sql.=" AND cp.fk_product is null";
|
||||
}
|
||||
@ -209,7 +211,7 @@ if ($modecompta == 'CREANCES-DETTES')
|
||||
$sql.= " AND cp.fk_categorie = c.rowid AND cp.fk_product = p.rowid";
|
||||
}
|
||||
$sql.= " AND f.entity = ".$conf->entity;
|
||||
$sql.= " GROUP BY p.rowid";
|
||||
$sql.= " GROUP BY p.rowid, p.ref, p.label";
|
||||
$sql.= " ORDER BY p.ref";
|
||||
|
||||
dol_syslog("cabyprodserv", LOG_DEBUG);
|
||||
@ -390,7 +392,7 @@ if ($modecompta == 'CREANCES-DETTES')
|
||||
// $modecompta != 'CREANCES-DETTES'
|
||||
// "Calculation of part of each product for accountancy in this mode is not possible. When a partial payment (for example 5 euros) is done on an
|
||||
// invoice with 2 product (product A for 10 euros and product B for 20 euros), what is part of paiment for product A and part of paiment for product B ?
|
||||
// Because there is no way to know this, this report is not relevant.
|
||||
// Because there is no way to know this, this report is not relevant.
|
||||
print '<br>'.$langs->trans("TurnoverPerProductInCommitmentAccountingNotRelevant") . '<br>';
|
||||
}
|
||||
|
||||
|
||||
@ -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";
|
||||
|
||||
@ -97,7 +97,6 @@ if ($filtre) {
|
||||
if ($typeid) {
|
||||
$sql .= " AND t.fk_typepayment=".$typeid;
|
||||
}
|
||||
$sql.= " GROUP BY t.rowid, t.fk_typepayment, t.amount, t.datev, t.label";
|
||||
$sql.= $db->order($sortfield,$sortorder);
|
||||
$sql.= $db->plimit($limit+1,$offset);
|
||||
|
||||
@ -111,7 +110,7 @@ if ($result)
|
||||
|
||||
$param='';
|
||||
if ($typeid) $param.='&typeid='.$typeid;
|
||||
|
||||
|
||||
print_barre_liste($langs->trans("VATPayments"),$page,$_SERVER["PHP_SELF"],$param,$sortfield,$sortorder,'',$num,$totalnboflines);
|
||||
|
||||
print '<form method="GET" action="'.$_SERVER["PHP_SELF"].'">';
|
||||
@ -125,7 +124,7 @@ if ($result)
|
||||
print_liste_field_titre($langs->trans("PayedByThisPayment"),$_SERVER["PHP_SELF"],"t.amount","",$param,'align="right"',$sortfield,$sortorder);
|
||||
print_liste_field_titre("");
|
||||
print "</tr>\n";
|
||||
|
||||
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td class="liste_titre"><input type="text" class="flat" size="4" name="search_ref" value="'.$search_ref.'"></td>';
|
||||
print '<td class="liste_titre"><input type="text" class="flat" size="10" name="search_label" value="'.$search_label.'"></td>';
|
||||
@ -138,21 +137,21 @@ if ($result)
|
||||
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";
|
||||
|
||||
|
||||
while ($i < min($num,$limit))
|
||||
{
|
||||
$obj = $db->fetch_object($result);
|
||||
$var=!$var;
|
||||
|
||||
|
||||
if ($obj->payment_code <> '')
|
||||
{
|
||||
$type = '<td>'.$langs->trans("PaymentTypeShort".$obj->payment_code).' '.$obj->num_payment.'</td>';
|
||||
$type = '<td>'.$langs->trans("PaymentTypeShort".$obj->payment_code).' '.$obj->num_payment.'</td>';
|
||||
}
|
||||
else
|
||||
{
|
||||
$type = '<td> </td>';
|
||||
}
|
||||
|
||||
|
||||
print "<tr ".$bc[$var].">";
|
||||
|
||||
$tva_static->id=$obj->rowid;
|
||||
@ -172,12 +171,12 @@ if ($result)
|
||||
}
|
||||
print '<tr class="liste_total"><td colspan="4">'.$langs->trans("Total").'</td>';
|
||||
print "<td align=\"right\"><b>".price($total)."</b></td>";
|
||||
print "<td> </td></tr>";
|
||||
print "<td> </td></tr>";
|
||||
|
||||
print "</table>";
|
||||
|
||||
|
||||
print '</form>';
|
||||
|
||||
|
||||
$db->free($result);
|
||||
}
|
||||
else
|
||||
@ -186,6 +185,6 @@ else
|
||||
}
|
||||
|
||||
|
||||
$db->close();
|
||||
|
||||
llxFooter();
|
||||
|
||||
$db->close();
|
||||
|
||||
@ -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);
|
||||
}
|
||||
|
||||
@ -53,7 +53,7 @@ $search_email=GETPOST("search_email");
|
||||
$search_skype=GETPOST("search_skype");
|
||||
$search_priv=GETPOST("search_priv");
|
||||
$search_categ=GETPOST("search_categ",'int');
|
||||
$search_statu=GETPOST("search_status",'int');
|
||||
$search_status=GETPOST("search_status",'int');
|
||||
if ($search_status=='') $search_status=1; // always display activ customer first
|
||||
|
||||
|
||||
@ -96,9 +96,9 @@ else if ($type == "o")
|
||||
$urlfiche="";
|
||||
}
|
||||
|
||||
if (GETPOST('button_removefilter'))
|
||||
if (GETPOST('button_removefilter_x') || GETPOST('button_removefilter')) // Both tests are required to be compatible with all browsers
|
||||
{
|
||||
$search_firstlast_only="";
|
||||
$search_firstlast_only="";
|
||||
$search_lastname="";
|
||||
$search_firstname="";
|
||||
$search_societe="";
|
||||
@ -302,7 +302,7 @@ if ($result)
|
||||
print_liste_field_titre($langs->trans("PostOrFunction"),$_SERVER["PHP_SELF"],"p.poste", $begin, $param, '', $sortfield,$sortorder);
|
||||
if (empty($conf->global->SOCIETE_DISABLE_CONTACTS)) print_liste_field_titre($langs->trans("Company"),$_SERVER["PHP_SELF"],"s.nom", $begin, $param, '', $sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("Phone"),$_SERVER["PHP_SELF"],"p.phone", $begin, $param, '', $sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("PhoneMobile"),$_SERVER["PHP_SELF"],"p.phone_mob", $begin, $param, '', $sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("PhoneMobile"),$_SERVER["PHP_SELF"],"p.phone_mobile", $begin, $param, '', $sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("Fax"),$_SERVER["PHP_SELF"],"p.fax", $begin, $param, '', $sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("EMail"),$_SERVER["PHP_SELF"],"p.email", $begin, $param, '', $sortfield,$sortorder);
|
||||
if (! empty($conf->skype->enabled)) { print_liste_field_titre($langs->trans("Skype"),$_SERVER["PHP_SELF"],"p.skype", $begin, $param, '', $sortfield,$sortorder); }
|
||||
@ -356,8 +356,8 @@ if ($result)
|
||||
print $form->selectarray('search_status', array('0'=>$langs->trans('ActivityCeased'),'1'=>$langs->trans('InActivity')),$search_status);
|
||||
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 '<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 '<input type="image" name="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" name="button_removefilter" class="liste_titre" src="'.img_picto($langs->trans("RemoveFilter"),'searchclear.png','','',1).'" value="'.dol_escape_htmltag($langs->trans("RemoveFilter")).'" title="'.dol_escape_htmltag($langs->trans("RemoveFilter")).'">';
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
|
||||
|
||||
@ -935,8 +935,8 @@ if ($action == 'create')
|
||||
}
|
||||
print '<tr><td class="fieldrequired">'.$langs->trans('Ref').'</td><td colspan="2">'.$tmpcode.'</td></tr>';
|
||||
|
||||
// Ref Int
|
||||
print '<tr><td>'.$langs->trans('RefCustomer').'</td>';
|
||||
// Ref supplier
|
||||
print '<tr><td>'.$langs->trans('RefSupplier').'</td>';
|
||||
print '<td colspan="2"><input type="text" size="5" name="ref_supplier" id="ref_supplier" value="'.GETPOST('ref_supplier','alpha').'"></td></tr>';
|
||||
|
||||
// Customer
|
||||
@ -1134,9 +1134,9 @@ else
|
||||
|
||||
print '<tr>';
|
||||
print '<td width="20%">';
|
||||
print $form->editfieldkey("RefCustomer",'ref_supplier',$object->ref_supplier,$object,$user->rights->contrat->creer);
|
||||
print $form->editfieldkey("RefSupplier",'ref_supplier',$object->ref_supplier,$object,$user->rights->contrat->creer);
|
||||
print '</td><td>';
|
||||
print $form->editfieldval("RefCustomer",'ref_supplier',$object->ref_supplier,$object,$user->rights->contrat->creer);
|
||||
print $form->editfieldval("RefSupplier",'ref_supplier',$object->ref_supplier,$object,$user->rights->contrat->creer);
|
||||
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;
|
||||
|
||||
@ -79,14 +79,13 @@ $now=dol_now();
|
||||
llxHeader();
|
||||
|
||||
$sql = 'SELECT';
|
||||
$sql.= " c.rowid as cid, c.ref, c.datec, c.date_contrat, c.statut, c.ref_supplier,";
|
||||
$sql.= " s.nom as name, s.rowid as socid,";
|
||||
$sql.= ' SUM('.$db->ifsql("cd.statut=0",1,0).') as nb_initial,';
|
||||
$sql.= ' SUM('.$db->ifsql("cd.statut=4 AND (cd.date_fin_validite IS NULL OR cd.date_fin_validite >= '".$db->idate($now)."')",1,0).') as nb_running,';
|
||||
$sql.= ' SUM('.$db->ifsql("cd.statut=4 AND (cd.date_fin_validite IS NOT NULL AND cd.date_fin_validite < '".$db->idate($now)."')",1,0).') as nb_expired,';
|
||||
$sql.= ' SUM('.$db->ifsql("cd.statut=4 AND (cd.date_fin_validite IS NOT NULL AND cd.date_fin_validite < '".$db->idate($now - $conf->contrat->services->expires->warning_delay)."')",1,0).') as nb_late,';
|
||||
$sql.= ' SUM('.$db->ifsql("cd.statut=5",1,0).') as nb_closed,';
|
||||
$sql.= " c.rowid as cid, c.ref, c.datec, c.date_contrat, c.statut,";
|
||||
$sql.= " s.nom as name, s.rowid as socid";
|
||||
$sql.= " ,c.ref_supplier";
|
||||
$sql.= ' SUM('.$db->ifsql("cd.statut=5",1,0).') as nb_closed';
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."societe as s";
|
||||
if (!$user->rights->societe->client->voir && !$socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
||||
$sql.= ", ".MAIN_DB_PREFIX."contrat as c";
|
||||
@ -107,7 +106,7 @@ if (!empty($search_ref_supplier)) {
|
||||
if ($sall) {
|
||||
$sql .= natural_search(array('s.nom', 'cd.label', 'cd.description'), $sall);
|
||||
}
|
||||
$sql.= " GROUP BY c.rowid, c.ref, c.datec, c.date_contrat, c.statut, s.nom, s.rowid";
|
||||
$sql.= " GROUP BY c.rowid, c.ref, c.datec, c.date_contrat, c.statut, c.ref_supplier, s.nom, s.rowid";
|
||||
$sql.= $db->order($sortfield,$sortorder);
|
||||
$sql.= $db->plimit($conf->liste_limit + 1, $offset);
|
||||
|
||||
|
||||
@ -146,10 +146,10 @@ if (($action == 'send' || $action == 'relance') && ! $_POST['addfile'] && ! $_PO
|
||||
if ($message)
|
||||
{
|
||||
$actionmsg=$langs->transnoentities('MailSentBy').' '.$from.' '.$langs->transnoentities('To').' '.$sendto;
|
||||
if ($sendtocc) $actionmsg = dol_concatdesc($actionmsg, $langs->transnoentities('Bcc') . ": " . $sendtocc);
|
||||
$actionmsg = dol_concatdesc($actionmsg, $langs->transnoentities('MailTopic') . ": " . $subject);
|
||||
$actionmsg = dol_concatdesc($actionmsg, $langs->transnoentities('TextUsedInTheMessageBody') . ":");
|
||||
$actionmsg = dol_concatdesc($actionmsg, $message);
|
||||
if ($sendtocc) $actionmsg = dol_concatdesc($actionmsg, $langs->transnoentities('Bcc') . ": " . $sendtocc);
|
||||
$actionmsg = dol_concatdesc($actionmsg, $langs->transnoentities('MailTopic') . ": " . $subject);
|
||||
$actionmsg = dol_concatdesc($actionmsg, $langs->transnoentities('TextUsedInTheMessageBody') . ":");
|
||||
$actionmsg = dol_concatdesc($actionmsg, $message);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -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"))
|
||||
|
||||
@ -79,7 +79,7 @@ class box_comptes extends ModeleBoxes
|
||||
if ($user->rights->banque->lire)
|
||||
{
|
||||
$sql = "SELECT rowid, ref, label, bank, number, courant, clos, rappro, url,";
|
||||
$sql.= " code_banque, code_guichet, cle_rib, bic, iban_prefix,";
|
||||
$sql.= " code_banque, code_guichet, cle_rib, bic, iban_prefix as iban,";
|
||||
$sql.= " domiciliation, proprio, owner_address,";
|
||||
$sql.= " account_number, currency_code,";
|
||||
$sql.= " min_allowed, min_desired, comment";
|
||||
|
||||
@ -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)
|
||||
|
||||
@ -3,7 +3,7 @@
|
||||
* Copyright (C) 2005-2013 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
* Copyright (C) 2010-2013 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2012 Christophe Battarel <christophe.battarel@altairis.fr>
|
||||
* Copyright (C) 2010-2011 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2010-2014 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2012-2013 Christophe Battarel <christophe.battarel@altairis.fr>
|
||||
* Copyright (C) 2011-2014 Philippe Grand <philippe.grand@atoo-net.com>
|
||||
* Copyright (C) 2012 Marcos García <marcosgdf@gmail.com>
|
||||
@ -34,7 +34,7 @@
|
||||
*/
|
||||
abstract class CommonObject
|
||||
{
|
||||
protected $db;
|
||||
public $db;
|
||||
public $error;
|
||||
public $errors;
|
||||
public $canvas; // Contains canvas name if it is
|
||||
@ -601,18 +601,22 @@ abstract class CommonObject
|
||||
/**
|
||||
* Load the third party of object, from id $this->socid or $this->fk_soc, into this->thirdparty
|
||||
*
|
||||
* @return int <0 if KO, >0 if OK
|
||||
* @param int $force_thirdparty_id Force thirdparty id
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*/
|
||||
function fetch_thirdparty()
|
||||
function fetch_thirdparty($force_thirdparty_id=0)
|
||||
{
|
||||
global $conf;
|
||||
|
||||
if (empty($this->socid) && empty($this->fk_soc) && empty($this->fk_thirdparty)) return 0;
|
||||
if (empty($this->socid) && empty($this->fk_soc) && empty($this->fk_thirdparty) && empty($force_thirdparty_id)) return 0;
|
||||
|
||||
require_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php';
|
||||
|
||||
$idtofetch=isset($this->socid)?$this->socid:(isset($this->fk_soc)?$this->fk_soc:$this->fk_thirdparty);
|
||||
if ($force_thirdparty_id) $idtofetch=$force_thirdparty_id;
|
||||
|
||||
$thirdparty = new Societe($this->db);
|
||||
$result=$thirdparty->fetch(isset($this->socid)?$this->socid:(isset($this->fk_soc)?$this->fk_soc:$this->fk_thirdparty));
|
||||
$result=$thirdparty->fetch($idtofetch);
|
||||
$this->client = $thirdparty; // deprecated
|
||||
$this->thirdparty = $thirdparty;
|
||||
|
||||
|
||||
@ -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',
|
||||
@ -510,17 +510,6 @@ class ExtraFields
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Load array of labels
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
function fetch_optionals()
|
||||
{
|
||||
$this->fetch_name_optionals_label();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Load array this->attribute_xxx like attribute_label, attribute_type, ...
|
||||
*
|
||||
@ -528,15 +517,14 @@ class ExtraFields
|
||||
* @param boolean $forceload Force load of extra fields whatever is option MAIN_EXTRAFIELDS_DISABLED
|
||||
* @return array Array of attributes for all extra fields
|
||||
*/
|
||||
function fetch_name_optionals_label($elementtype='adherent',$forceload=false)
|
||||
function fetch_name_optionals_label($elementtype,$forceload=false)
|
||||
{
|
||||
global $conf;
|
||||
|
||||
$array_name_label=array();
|
||||
|
||||
// For avoid conflicts with external modules
|
||||
if (!$forceload && !empty($conf->global->MAIN_EXTRAFIELDS_DISABLED))
|
||||
return $array_name_label;
|
||||
if (!$forceload && !empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) return $array_name_label;
|
||||
|
||||
$sql = "SELECT rowid,name,label,type,size,elementtype,fieldunique,fieldrequired,param,pos,alwayseditable";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."extrafields";
|
||||
@ -569,13 +557,13 @@ class ExtraFields
|
||||
$this->attribute_alwayseditable[$tab->name]=$tab->alwayseditable;
|
||||
}
|
||||
}
|
||||
|
||||
return $array_name_label;
|
||||
}
|
||||
else
|
||||
{
|
||||
print dol_print_error($this->db);
|
||||
}
|
||||
|
||||
return $array_name_label;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -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
|
||||
@ -3039,13 +3096,14 @@ class Form
|
||||
/**
|
||||
* Show a form to select a project
|
||||
*
|
||||
* @param int $page Page
|
||||
* @param int $socid Id third party (-1=all, 0=only projects not linked to a third party, id=projects not linked or linked to third party id)
|
||||
* @param int $selected Id pre-selected project
|
||||
* @param string $htmlname Name of select field
|
||||
* @param int $page Page
|
||||
* @param int $socid Id third party (-1=all, 0=only projects not linked to a third party, id=projects not linked or linked to third party id)
|
||||
* @param int $selected Id pre-selected project
|
||||
* @param string $htmlname Name of select field
|
||||
* @param int $discard_closed Hide all closed projects
|
||||
* @return void
|
||||
*/
|
||||
function form_project($page, $socid, $selected='', $htmlname='projectid')
|
||||
function form_project($page, $socid, $selected='', $htmlname='projectid', $discard_closed=0)
|
||||
{
|
||||
global $langs;
|
||||
|
||||
@ -3062,8 +3120,7 @@ class Form
|
||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
print '<table class="nobordernopadding" cellpadding="0" cellspacing="0">';
|
||||
print '<tr><td>';
|
||||
//print "$socid,$selected,$htmlname";
|
||||
$formproject->select_projects($socid,$selected,$htmlname);
|
||||
$formproject->select_projects($socid,$selected,$htmlname,20,0,1,$discard_closed);
|
||||
print '</td>';
|
||||
print '<td align="left"><input type="submit" class="button" value="'.$langs->trans("Modify").'"></td>';
|
||||
print '</tr></table></form>';
|
||||
@ -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);
|
||||
|
||||
@ -65,7 +65,7 @@ class FormContract
|
||||
$sql.= " WHERE c.entity = ".$conf->entity;
|
||||
//if ($contratListId) $sql.= " AND c.rowid IN (".$contratListId.")";
|
||||
if ($socid == 0) $sql.= " AND (c.fk_soc = 0 OR c.fk_soc IS NULL)";
|
||||
else $sql.= " AND c.fk_soc = ".$socid;
|
||||
if ($socid > 0) $sql.= " AND (c.fk_soc=".$socid." OR c.fk_soc IS NULL)";
|
||||
|
||||
dol_syslog(get_class($this)."::select_contract", LOG_DEBUG);
|
||||
$resql=$db->query($sql);
|
||||
|
||||
@ -301,6 +301,12 @@ class FormFile
|
||||
$modellist=ModeleThirdPartyDoc::liste_modeles($this->db);
|
||||
}
|
||||
}
|
||||
|
||||
else if ($modulepart == 'agenda')
|
||||
{
|
||||
null;
|
||||
}
|
||||
|
||||
else if ($modulepart == 'propal')
|
||||
{
|
||||
if (is_array($genallowed)) $modellist=$genallowed;
|
||||
@ -433,6 +439,7 @@ class FormFile
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
// For normalized standard modules
|
||||
$file=dol_buildpath('/core/modules/'.$modulepart.'/modules_'.$modulepart.'.php',0);
|
||||
if (file_exists($file))
|
||||
|
||||
@ -49,11 +49,12 @@ class FormProjets
|
||||
* @param int $selected Id project preselected
|
||||
* @param string $htmlname Nom de la zone html
|
||||
* @param int $maxlength Maximum length of label
|
||||
* @param int $option_only Option only
|
||||
* @param int $option_only Return only html options lines without the select tag
|
||||
* @param int $show_empty Add an empty line
|
||||
* @param int $discard_closed Discard closed projects
|
||||
* @return int Nber of project if OK, <0 if KO
|
||||
*/
|
||||
function select_projects($socid=-1, $selected='', $htmlname='projectid', $maxlength=16, $option_only=0, $show_empty=1)
|
||||
function select_projects($socid=-1, $selected='', $htmlname='projectid', $maxlength=16, $option_only=0, $show_empty=1, $discard_closed=0)
|
||||
{
|
||||
global $user,$conf,$langs;
|
||||
|
||||
@ -104,6 +105,12 @@ class FormProjets
|
||||
}
|
||||
else
|
||||
{
|
||||
if ($discard_closed && $obj->fk_statut == 2)
|
||||
{
|
||||
$i++;
|
||||
continue;
|
||||
}
|
||||
|
||||
$labeltoshow=dol_trunc($obj->ref,18);
|
||||
//if ($obj->public) $labeltoshow.=' ('.$langs->trans("SharedProject").')';
|
||||
//else $labeltoshow.=' ('.$langs->trans("Private").')';
|
||||
|
||||
@ -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;
|
||||
|
||||
|
||||
@ -197,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='')
|
||||
{
|
||||
|
||||
@ -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;
|
||||
|
||||
@ -1100,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);
|
||||
@ -3837,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)
|
||||
{
|
||||
@ -3998,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
|
||||
|
||||
@ -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))
|
||||
|
||||
@ -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>';
|
||||
|
||||
@ -242,7 +242,7 @@ function entity_prepare_head($object, $aEntities)
|
||||
/**
|
||||
* Show list of themes. Show all thumbs of themes
|
||||
*
|
||||
* @param User $fuser User concerned or '' for global theme
|
||||
* @param User $fuser User concerned or null for global theme
|
||||
* @param int $edit 1 to add edit form
|
||||
* @param boolean $foruserprofile Show for user profile view
|
||||
* @return void
|
||||
@ -265,7 +265,7 @@ function show_theme($fuser,$edit=0,$foruserprofile=false)
|
||||
|
||||
$selected_theme='';
|
||||
if (empty($foruserprofile)) $selected_theme=$conf->global->MAIN_THEME;
|
||||
else $selected_theme=empty($fuser->conf->MAIN_THEME)?'':$fuser->conf->MAIN_THEME;
|
||||
else $selected_theme=((is_object($fuser) && ! empty($fuser->conf->MAIN_THEME))?$fuser->conf->MAIN_THEME:'');
|
||||
|
||||
$colspan=2;
|
||||
if ($foruserprofile) $colspan=4;
|
||||
|
||||
@ -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
|
||||
{
|
||||
|
||||
@ -271,7 +271,7 @@ else {
|
||||
</tr>
|
||||
|
||||
<?php
|
||||
if (! empty($conf->service->enabled) && $dateSelector)
|
||||
if (! empty($conf->service->enabled) && $dateSelector && GETPOST('type') != '0')
|
||||
{
|
||||
if(! empty($conf->global->MAIN_VIEW_LINE_NUMBER)) $colspan = 10;
|
||||
else $colspan = 9;
|
||||
|
||||
@ -96,7 +96,7 @@ class Cronjob extends CommonObject
|
||||
$error=0;
|
||||
|
||||
$now=dol_now();
|
||||
|
||||
|
||||
// Clean parameters
|
||||
|
||||
if (isset($this->label)) $this->label=trim($this->label);
|
||||
@ -501,7 +501,7 @@ class Cronjob 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;
|
||||
|
||||
|
||||
@ -184,7 +184,7 @@ class EcmDirectory // 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;
|
||||
|
||||
|
||||
@ -800,7 +800,7 @@ class Expedition 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;
|
||||
|
||||
@ -36,7 +36,7 @@ $result = restrictedArea($user, 'expedition',$expeditionid,'');
|
||||
|
||||
$search_ref_exp = GETPOST("search_ref_exp");
|
||||
$search_ref_liv = GETPOST('search_ref_liv');
|
||||
$search_societe = GETPOST("search_societe");
|
||||
$search_company = GETPOST("search_company");
|
||||
|
||||
$sortfield = GETPOST('sortfield','alpha');
|
||||
$sortorder = GETPOST('sortorder','alpha');
|
||||
@ -51,12 +51,12 @@ if (! $sortfield) $sortfield="e.ref";
|
||||
if (! $sortorder) $sortorder="DESC";
|
||||
$limit = $conf->liste_limit;
|
||||
|
||||
// Do we click on purge search criteria ?
|
||||
// Purge search criteria
|
||||
if (GETPOST("button_removefilter_x"))
|
||||
{
|
||||
$search_ref_exp='';
|
||||
$search_ref_liv='';
|
||||
$search_societe='';
|
||||
$search_company='';
|
||||
}
|
||||
|
||||
/*
|
||||
@ -92,7 +92,7 @@ if ($socid)
|
||||
}
|
||||
if ($search_ref_exp) $sql .= natural_search('e.ref', $search_ref_exp);
|
||||
if ($search_ref_liv) $sql .= natural_search('l.ref', $search_ref_liv);
|
||||
if ($search_societe) $sql .= natural_search('s.nom', $search_societe);
|
||||
if ($search_company) $sql .= natural_search('s.nom', $search_company);
|
||||
|
||||
$sql.= $db->order($sortfield,$sortorder);
|
||||
$sql.= $db->plimit($limit + 1,$offset);
|
||||
@ -107,12 +107,13 @@ if ($resql)
|
||||
$param="";
|
||||
if ($search_ref_exp) $param.= "&search_ref_exp=".$search_ref_exp;
|
||||
if ($search_ref_liv) $param.= "&search_ref_liv=".$search_ref_liv;
|
||||
if ($search_societe) $param.= "&search_societe=".$search_societe;
|
||||
if ($search_company) $param.= "&search_company=".$search_company;
|
||||
|
||||
print_barre_liste($langs->trans('ListOfSendings'), $page, $_SERVER["PHP_SELF"],$param,$sortfield,$sortorder,'',$num);
|
||||
|
||||
|
||||
$i = 0;
|
||||
print '<form method="GET" action="'.$_SERVER["PHP_SELF"].'">'."\n";
|
||||
print '<table class="noborder" width="100%">';
|
||||
|
||||
print '<tr class="liste_titre">';
|
||||
@ -124,6 +125,7 @@ if ($resql)
|
||||
print_liste_field_titre($langs->trans("DateReceived"),"ship2bill.php","e.date_expedition","",$param, 'align="center"',$sortfield,$sortorder);
|
||||
}
|
||||
print_liste_field_titre($langs->trans("Status"),"ship2bill.php","e.fk_statut","",$param,'align="right"',$sortfield,$sortorder);
|
||||
print '<td class="liste_titre"> </td>';
|
||||
print "</tr>\n";
|
||||
|
||||
// Lignes des champs de filtre
|
||||
@ -132,7 +134,7 @@ if ($resql)
|
||||
print '<input class="flat" size="10" type="text" name="search_ref_exp" value="'.$search_ref_exp.'">';
|
||||
print '</td>';
|
||||
print '<td class="liste_titre" align="left">';
|
||||
print '<input class="flat" type="text" size="10" name="search_societe" value="'.dol_escape_htmltag($search_societe).'">';
|
||||
print '<input class="flat" type="text" size="10" name="search_company" value="'.dol_escape_htmltag($search_company).'">';
|
||||
print '</td>';
|
||||
print '<td class="liste_titre"> </td>';
|
||||
if($conf->livraison_bon->enabled) {
|
||||
@ -141,13 +143,9 @@ if ($resql)
|
||||
print '</td>';
|
||||
print '<td class="liste_titre"> </td>';
|
||||
}
|
||||
print '<td class="liste_titre" align="right">';
|
||||
// Développé dans la 3.7
|
||||
//print img_search();
|
||||
//print img_searchclear();
|
||||
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 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>';
|
||||
print '</td>';
|
||||
print '<td class="liste_titre" align="center">';
|
||||
print '<a href="#" id="checkall">'.$langs->trans("All").'</a> / <a href="#" id="checknone">'.$langs->trans("None").'</a>';
|
||||
print '</td>';
|
||||
@ -161,12 +159,15 @@ if ($resql)
|
||||
$objp = $db->fetch_object($resql);
|
||||
|
||||
$var=!$var;
|
||||
|
||||
// Ref
|
||||
print "<tr ".$bc[$var].">";
|
||||
print "<td>";
|
||||
$shipment->id=$objp->rowid;
|
||||
$shipment->ref=$objp->ref;
|
||||
print $shipment->getNomUrl(1);
|
||||
print "</td>\n";
|
||||
|
||||
// Third party
|
||||
print '<td>';
|
||||
$companystatic->id=$objp->socid;
|
||||
@ -174,7 +175,8 @@ if ($resql)
|
||||
$companystatic->name=$objp->socname;
|
||||
print $companystatic->getNomUrl(1);
|
||||
print '</td>';
|
||||
// Date delivery planed
|
||||
|
||||
// Date delivery planed
|
||||
print "<td align=\"center\">";
|
||||
print dol_print_date($db->jdate($objp->date_expedition),"day");
|
||||
/*$now = time();
|
||||
|
||||
@ -99,7 +99,7 @@ $var=!$var;
|
||||
print "<tr ".$bc[$var].">";
|
||||
print '<td class="fieldrequired">'.$langs->trans("Label")."</td>";
|
||||
print "<td><input type=\"text\" class=\"flat\" name=\"EXTERNALSITE_LABEL\" value=\"". (GETPOST('EXTERNALSITE_LABEL','alpha')?GETPOST('EXTERNALSITE_LABEL','alpha'):((empty($conf->global->EXTERNALSITE_LABEL) || $conf->global->EXTERNALSITE_LABEL=='ExternalSite')?'':$conf->global->EXTERNALSITE_LABEL)) . "\" size=\"12\"></td>";
|
||||
print "<td>My menu entry</td>";
|
||||
print "<td>".$langs->trans("ExampleMyMenuEntry")."</td>";
|
||||
print "</tr>";
|
||||
|
||||
$var=!$var;
|
||||
|
||||
@ -155,7 +155,7 @@ if ($id > 0 || ! empty($ref))
|
||||
|
||||
// Date
|
||||
print '<tr><td>'.$langs->trans("Date").'</td>';
|
||||
print "<td colspan=\"2\">".dol_print_date($object->date,"daytext")."</td>\n";
|
||||
print "<td colspan=\"2\">".dol_print_date($object->datec,"daytext")."</td>\n";
|
||||
print '</tr>';
|
||||
|
||||
print '</table>';
|
||||
|
||||
@ -158,7 +158,7 @@ if ($result)
|
||||
}
|
||||
print '<td class="liste_titre" align="right">';
|
||||
$liststatus=$interventionstatic->statuts_short;
|
||||
print $form->selectarray('search_status', $liststatus, GETPOST('search_status'), 1, 0, 0, '', 1);
|
||||
print $form->selectarray('search_status', $liststatus, $search_status, 1, 0, 0, '', 1);
|
||||
print '</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")).'">';
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
<?php
|
||||
/* Copyright (C) 2001-2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2003 Eric Seigne <erics@rycks.com>
|
||||
* Copyright (C) 2004-2011 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2004-2014 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2005-2010 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
* Copyright (C) 2010-2014 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2014 Jean Heimburger <jean@tiaris.info>
|
||||
@ -304,8 +304,8 @@ if ($object->fetch($id))
|
||||
|
||||
if ($user->rights->fournisseur->commande->lire)
|
||||
{
|
||||
|
||||
|
||||
|
||||
|
||||
// TODO move to DAO class
|
||||
// Check if there are supplier orders billable
|
||||
$sql2 = 'SELECT s.nom, s.rowid as socid, s.client, c.rowid, c.ref, c.total_ht, c.ref_supplier,';
|
||||
@ -325,7 +325,7 @@ if ($object->fetch($id))
|
||||
} else {
|
||||
setEventMessage($db->lasterror(),'errors');
|
||||
}
|
||||
|
||||
|
||||
// TODO move to DAO class
|
||||
$sql = "SELECT p.rowid,p.ref, p.date_commande as dc, p.fk_statut";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."commande_fournisseur as p ";
|
||||
@ -394,13 +394,13 @@ if ($object->fetch($id))
|
||||
if ($user->rights->fournisseur->facture->lire)
|
||||
{
|
||||
// TODO move to DAO class
|
||||
$sql = 'SELECT f.rowid,f.libelle,f.ref_supplier,f.fk_statut,f.datef as df,f.total_ttc as amount,f.paye,';
|
||||
$sql = 'SELECT f.rowid,f.libelle,f.ref,f.ref_supplier,f.fk_statut,f.datef as df,f.total_ttc as amount,f.paye,';
|
||||
$sql.= ' SUM(pf.amount) as am';
|
||||
$sql.= ' FROM '.MAIN_DB_PREFIX.'facture_fourn as f';
|
||||
$sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'paiementfourn_facturefourn as pf ON f.rowid=pf.fk_facturefourn';
|
||||
$sql.= ' WHERE f.fk_soc = '.$object->id;
|
||||
$sql.= " AND f.entity =".$conf->entity;
|
||||
$sql.= ' GROUP BY f.rowid,f.libelle,f.ref_supplier,f.fk_statut,f.datef,f.total_ttc,f.paye';
|
||||
$sql.= ' GROUP BY f.rowid,f.libelle,f.ref,f.ref_supplier,f.fk_statut,f.datef,f.total_ttc,f.paye';
|
||||
$sql.= ' ORDER BY f.datef DESC';
|
||||
$resql=$db->query($sql);
|
||||
if ($resql)
|
||||
@ -425,7 +425,13 @@ if ($object->fetch($id))
|
||||
print '<tr '.$bc[$var].'>';
|
||||
print '<td>';
|
||||
print '<a href="facture/card.php?facid='.$obj->rowid.'">';
|
||||
print img_object($langs->trans('ShowBill'),'bill').' '.$obj->ref_supplier.'</a> '.dol_trunc($obj->libelle,14).'</td>';
|
||||
$facturestatic->id=$obj->rowid;
|
||||
$facturestatic->ref=($obj->ref?$obj->ref:$obj->rowid).($obj->ref_supplier?' - '.$obj->ref_supplier:'');
|
||||
//$facturestatic->ref_supplier=$obj->ref_supplier;
|
||||
print $facturestatic->getNomUrl(1);
|
||||
//print img_object($langs->trans('ShowBill'),'bill').' '.($obj->ref?$obj->ref:$obj->rowid).' - '.$obj->ref_supplier.'</a>';
|
||||
print ' '.dol_trunc($obj->libelle,14);
|
||||
print '</td>';
|
||||
print '<td align="center" class="nowrap">'.dol_print_date($db->jdate($obj->df),'day').'</td>';
|
||||
print '<td align="right" class="nowrap">'.price($obj->amount).'</td>';
|
||||
print '<td align="right" class="nowrap">';
|
||||
@ -455,11 +461,11 @@ if ($object->fetch($id))
|
||||
$parameters = array();
|
||||
$reshook = $hookmanager->executeHooks('addMoreActionsButtons', $parameters, $object, $action); // Note that $action and $object may have been
|
||||
// modified by hook
|
||||
if (empty($reshook))
|
||||
if (empty($reshook))
|
||||
{
|
||||
|
||||
print '<div class="tabsAction">';
|
||||
|
||||
|
||||
if ($user->rights->fournisseur->commande->creer)
|
||||
{
|
||||
$langs->load("orders");
|
||||
@ -471,7 +477,7 @@ if ($object->fetch($id))
|
||||
$langs->load("bills");
|
||||
print '<a class="butAction" href="'.DOL_URL_ROOT.'/fourn/facture/card.php?action=create&socid='.$object->id.'">'.$langs->trans("AddBill").'</a>';
|
||||
}
|
||||
|
||||
|
||||
if ($user->rights->fournisseur->facture->creer)
|
||||
{
|
||||
if (! empty($orders2invoice) && $orders2invoice > 0) print '<div class="inline-block divButAction"><a class="butAction" href="'.DOL_URL_ROOT.'/fourn/commande/orderstoinvoice.php?socid='.$object->id.'">'.$langs->trans("CreateInvoiceForThisCustomer").'</a></div>';
|
||||
|
||||
@ -953,6 +953,8 @@ class CommandeFournisseur 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('supplierorderdao'));
|
||||
|
||||
@ -255,6 +255,8 @@ class FactureFournisseur extends CommonInvoice
|
||||
$result=$this->update_price();
|
||||
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('supplierinvoicedao'));
|
||||
@ -539,7 +541,7 @@ class FactureFournisseur 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;
|
||||
|
||||
@ -117,7 +117,7 @@ if ($user->rights->fournisseur->facture->lire)
|
||||
|
||||
if ($search_ref)
|
||||
{
|
||||
$sql .= " AND f.rowid LIKE '%".$search_ref."%'";
|
||||
$sql .= " AND f.ref LIKE '%".$search_ref."%'";
|
||||
}
|
||||
if ($search_ref_supplier)
|
||||
{
|
||||
@ -241,7 +241,7 @@ if ($user->rights->fournisseur->facture->lire)
|
||||
print $facturestatic->getNomUrl(1);
|
||||
print "</td>\n";
|
||||
|
||||
print '<td class="nowrap">'.dol_trunc($objp->ref_supplier,12)."</td>\n";
|
||||
print '<td class="nowrap">'.dol_trunc($objp->ref_supplier,12).'</td>';
|
||||
|
||||
print '<td class="nowrap" align="center">'.dol_print_date($db->jdate($objp->df),'day')."</td>\n";
|
||||
print '<td class="nowrap" align="center">'.dol_print_date($db->jdate($objp->datelimite),'day');
|
||||
@ -258,7 +258,7 @@ if ($user->rights->fournisseur->facture->lire)
|
||||
print "<td align=\"right\">".price($objp->total_ttc)."</td>";
|
||||
print "<td align=\"right\">".price($objp->am)."</td>";
|
||||
|
||||
// Affiche statut de la facture
|
||||
// Show invoice status
|
||||
print '<td align="right" class="nowrap">';
|
||||
print $facturestatic->LibStatut($objp->paye,$objp->fk_statut,5,$objp->am);
|
||||
print '</td>';
|
||||
|
||||
@ -72,8 +72,9 @@ $search_amount_no_tax = GETPOST("search_amount_no_tax","alpha");
|
||||
$search_amount_all_tax = GETPOST("search_amount_all_tax","alpha");
|
||||
$month = GETPOST("month","int");
|
||||
$year = GETPOST("year","int");
|
||||
$filter = GETPOST("filtre");
|
||||
|
||||
if (GETPOST("button_removefilter"))
|
||||
if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter")) // Both test must be present to be compatible with all browsers
|
||||
{
|
||||
$search_ref="";
|
||||
$search_ref_supplier="";
|
||||
@ -83,6 +84,7 @@ if (GETPOST("button_removefilter"))
|
||||
$search_amount_all_tax="";
|
||||
$year="";
|
||||
$month="";
|
||||
$filter="";
|
||||
}
|
||||
|
||||
/*
|
||||
@ -136,9 +138,9 @@ if ($socid)
|
||||
{
|
||||
$sql .= " AND s.rowid = ".$socid;
|
||||
}
|
||||
if (GETPOST('filtre') && GETPOST('filtre') != -1) // GETPOST('filtre') may be a string
|
||||
if ($filter && $filter != -1) // GETPOST('filtre') may be a string
|
||||
{
|
||||
$filtrearr = explode(",", GETPOST('filtre'));
|
||||
$filtrearr = explode(",", $filter);
|
||||
foreach ($filtrearr as $fil)
|
||||
{
|
||||
$filt = explode(":", $fil);
|
||||
@ -217,7 +219,7 @@ if ($resql)
|
||||
if ($search_company) $param.='&search_company='.urlencode($search_company);
|
||||
if ($search_amount_no_tax) $param.='&search_amount_no_tax='.urlencode($search_amount_no_tax);
|
||||
if ($search_amount_all_tax) $param.='&search_amount_all_tax='.urlencode($search_amount_all_tax);
|
||||
if (GETPOST("filtre") && GETPOST('filtre') != -1) $param.='&filtre='.urlencode(GETPOST("filtre"));
|
||||
if ($filter && $filter != -1) $param.='&filtre='.urlencode($filter);
|
||||
|
||||
print_barre_liste($langs->trans("BillsSuppliers").($socid?" $soc->name.":""),$page,$_SERVER["PHP_SELF"],$param,$sortfield,$sortorder,'',$num,$nbtotalofrecords);
|
||||
print '<form method="GET" action="'.$_SERVER["PHP_SELF"].'">';
|
||||
@ -269,8 +271,8 @@ if ($resql)
|
||||
print '</td><td class="liste_titre" align="right">';
|
||||
print '<input class="flat" type="text" size="8" name="search_amount_all_tax" value="'.$search_amount_all_tax.'">';
|
||||
print '</td><td class="liste_titre" align="right">';
|
||||
$liststatus=array('paye:0'=>$langs->trans("Unpayed"), 'paye:1'=>$langs->trans("Payed"));
|
||||
print $form->selectarray('filtre', $liststatus, GETPOST('filtre'), 1);
|
||||
$liststatus=array('paye:0'=>$langs->trans("Unpaid"), 'paye:1'=>$langs->trans("Paid"));
|
||||
print $form->selectarray('filtre', $liststatus, $filter, 1);
|
||||
print '</td><td class="liste_titre" align="right">';
|
||||
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 '<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")).'">';
|
||||
@ -329,7 +331,7 @@ if ($resql)
|
||||
//print $facturestatic->LibStatut($obj->paye,$obj->fk_statut,5,$objp->am);
|
||||
print $facturestatic->LibStatut($obj->paye,$obj->fk_statut,5);
|
||||
print '</td>';
|
||||
|
||||
|
||||
print '<td align="center"> </td>';
|
||||
|
||||
print "</tr>\n";
|
||||
|
||||
@ -536,7 +536,7 @@ if (empty($action))
|
||||
print_liste_field_titre($langs->trans('ThirdParty'),$_SERVER["PHP_SELF"],'s.nom','',$paramlist,'',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans('Type'),$_SERVER["PHP_SELF"],'c.libelle','',$paramlist,'',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans('Account'),$_SERVER["PHP_SELF"],'ba.label','',$paramlist,'',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans('Amount'),$_SERVER["PHP_SELF"],'f.amount','',$paramlist,'align="right"',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans('Amount'),$_SERVER["PHP_SELF"],'p.amount','',$paramlist,'align="right"',$sortfield,$sortorder);
|
||||
//print_liste_field_titre($langs->trans('Invoice'),$_SERVER["PHP_SELF"],'ref_supplier','',$paramlist,'',$sortfield,$sortorder);
|
||||
print '<td class="liste_titre"> </td>';
|
||||
print "</tr>\n";
|
||||
|
||||
@ -761,7 +761,6 @@ if (empty($id) || $action == 'add' || $action == 'request' || $action == 'create
|
||||
print '<input type="hidden" name="userid" value="'.$userid.'">';
|
||||
}
|
||||
else print $form->select_users(GETPOST('userid')?GETPOST('userid'):$user->id,'userid',0,'',0);
|
||||
//var_dump($cp->getConfCP('nbHolidayDeducted'));
|
||||
$nb_holiday = $cp->getCPforUser($user->id) / $cp->getConfCP('nbHolidayDeducted');
|
||||
print ' <span>'.$langs->trans('SoldeCPUser', round($nb_holiday,2)).'</span>';
|
||||
print '</td>';
|
||||
|
||||
@ -470,7 +470,7 @@ class Holiday 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;
|
||||
@ -1045,7 +1045,8 @@ class Holiday extends CommonObject
|
||||
$result = $this->db->query($sql);
|
||||
if($result) {
|
||||
$obj = $this->db->fetch_object($result);
|
||||
return number_format($obj->nb_holiday,2);
|
||||
//return number_format($obj->nb_holiday,2);
|
||||
return $obj->nb_holiday;
|
||||
} else {
|
||||
return '0';
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user