Merge branch 'develop' into testsqlAndScript

This commit is contained in:
Laurent Destailleur 2018-09-15 17:01:23 +02:00 committed by GitHub
commit 76cdbc8bf1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
627 changed files with 42258 additions and 39017 deletions

View File

@ -4,22 +4,59 @@ English Dolibarr ChangeLog
***** ChangeLog for 9.0.0 compared to 8.0.0 *****
For Users:
NEW: Stable module: Website
NEW: Stable module: WebDAV
NEW: Stable module: Module Builder
NEW: Dolibarr can provide information in page title when multicompany is enabled of not, making
Android application like DoliDroid able to provide native features for multicompany module
Android application like DoliDroid able to provide native features for multicompany module.
For developers:
Code changes to be more compatible with PSR2
* Code changes to be more compatible with PSR2
* Removed trigger USER_LOGOUT, USER_LOGIN, USER_LOGIN_FAILED (Some hooks are already dedicated for that)
WARNING:
Following changes may create regressions for some external modules, but were necessary to make Dolibarr better:
* If you use some links like viewimages.php?modulepart=mycompany&file=... in you external modules, you must
replace them with links like viewimages.php?modulepart=mycompany&file=logos/... (note that link change only for
modulepart=mycompany that now works like others).
***** ChangeLog for 8.0.1 compared to 8.0.0 *****
FIX: #9258
FIX: #9328
FIX: #9337
FIX: adding GROUP BY for PostgreSQL
FIX: API template for list pages in module builder
FIX: API template for record page to delete a record
FIX: a removed option was still in setup
FIX: badge on time spent on project and tasks
FIX: Delete file on smartphone
FIX: Fetch function will fetch comments
FIX: Fetch task will now fetch comments
FIX: $fk_account is always empty, must be $soc->fk_account
FIX: Force stripe api version to avoid trouble if we update stripe api
FIX: get_product_vat_for_country functions.lib.php
FIX: Get templates in a forced language
FIX: hook on dispatch order fourn
FIX: Language selection lost if error during creation of email template
FIX: Look and feel v8
FIX: propal.class.php
FIX: Add calls to fetchComments function
FIX: Remove fetchComments from project and task fetch function
FIX: remove internal property isextrafieldmanaged from API returns
FIX: sql error
FIX: table llx_chargessociales doesn't exists
FIX: trans on null object
FIX: vat rate code not returned by get_product_vat_for_country
FIX: warning for late template invoices to remove when suspended
FIX: Add hidden option MAIN_xxx_IN_SOURCE_ADDRESS to solve legal issues on PDF
FIX: Table llx_facture_rec_extrafields missing after migration
***** ChangeLog for 8.0.0 compared to 7.0.0 *****
For Users:
NEW: Experimental module: Ticket
NEW: Experimental module: WebDAV
@ -205,7 +242,8 @@ Following changes may create regressions for some external modules, but were nec
* Remove method Categorie:get_nb_categories() that was not used.
* Hook getnomurltooltip provide a duplicate feature compared to hook getNomUrl so all hooks getnomurltooltip
are now replaced with hook getNomUrl.
* The substitution key __CONTACTCIVNAME__ is no longer present, it has been replaced by __CONTACT_NAME_{TYPE}__
where {TYPE} is contact type code (BILLING, SHIPPING, CUSTOMER, ... see contact type dictionnary).
***** ChangeLog for 7.0.3 compared to 7.0.2 *****

View File

@ -1,6 +1,10 @@
# DOLIBARR ERP & CRM
![Build status](https://img.shields.io/travis/Dolibarr/dolibarr/develop.svg) ![Downloads per day](https://img.shields.io/sourceforge/dm/dolibarr.svg)
![Downloads per day](https://img.shields.io/sourceforge/dm/dolibarr.svg)
|6|7|8|develop|
|----------|----------|----------|----------|
|![Build status](https://img.shields.io/travis/Dolibarr/dolibarr/6.0.svg)|![Build status](https://img.shields.io/travis/Dolibarr/dolibarr/7.0.svg)|![Build status](https://img.shields.io/travis/Dolibarr/dolibarr/8.0.svg)|![Build status](https://img.shields.io/travis/Dolibarr/dolibarr/develop.svg)|
Dolibarr ERP & CRM is a modern software package to manage your organization's activity (contacts, suppliers, invoices, orders, stocks, agenda…).

View File

@ -238,9 +238,9 @@
<!--<rule ref="PEAR.Commenting.FunctionComment.MissingReturn">
<severity>0</severity>
</rule>-->
<rule ref="PEAR.Commenting.FunctionComment.Missing">
<!--<rule ref="PEAR.Commenting.FunctionComment.Missing">
<severity>0</severity>
</rule>
</rule>-->
<rule ref="PEAR.Commenting.FunctionComment.SpacingAfterParamType" />

View File

@ -64,7 +64,7 @@ class autoTranslator
// Translate
//ini_set('default_charset','UTF-8');
ini_set('default_charset',$this->_outputpagecode);
$this->parse_refLangTranslationFiles();
$this->parseRefLangTranslationFiles();
}
/**
@ -72,8 +72,7 @@ class autoTranslator
*
* @return void
*/
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
private function parse_refLangTranslationFiles()
private function parseRefLangTranslationFiles()
{
$files = $this->getTranslationFilesArray($this->_refLang);

View File

@ -121,6 +121,9 @@ if (empty($reshook))
if ($country_code)
{
$sqlfile = DOL_DOCUMENT_ROOT.'/install/mysql/data/llx_accounting_account_'.strtolower($country_code).'.sql';
// FIXME Get the ADD rowid and pass it + num of comapny * 100 000 000 to run_sql as a new parameter to say to update sql on the fly to add offset to rowid and account_parent value.
$result = run_sql($sqlfile, 1, 0, 1);
}

View File

@ -1,5 +1,6 @@
<?php
/* Copyright (C) 2014-2016 Alexandre Spangaro <aspangaro@zendsi.com>
/* Copyright (C) 2014-2016 Alexandre Spangaro <aspangaro@zendsi.com>
* Copyright (C) 2018 Frédéric France <frederic.france@netlogic.fr>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -169,12 +170,12 @@ if ($action == 'create')
// Date start
print '<tr><td class="fieldrequired">' . $langs->trans("DateStart") . '</td><td>';
print $form->select_date(($date_start ? $date_start : ''), 'fiscalyear');
print $form->selectDate(($date_start ? $date_start : ''), 'fiscalyear');
print '</td></tr>';
// Date end
print '<tr><td class="fieldrequired">' . $langs->trans("DateEnd") . '</td><td>';
print $form->select_date(($date_end ? $date_end : - 1), 'fiscalyearend');
print $form->selectDate(($date_end ? $date_end : - 1), 'fiscalyearend');
print '</td></tr>';
/*
@ -225,12 +226,12 @@ if ($action == 'create')
// Date start
print '<tr><td class="fieldrequired">' . $langs->trans("DateStart") . '</td><td>';
print $form->select_date($object->date_start ? $object->date_start : - 1, 'fiscalyear');
print $form->selectDate($object->date_start ? $object->date_start : - 1, 'fiscalyear');
print '</td></tr>';
// Date end
print '<tr><td class="fieldrequired">' . $langs->trans("DateEnd") . '</td><td>';
print $form->select_date($object->date_end ? $object->date_end : - 1, 'fiscalyearend');
print $form->selectDate($object->date_end ? $object->date_end : - 1, 'fiscalyearend');
print '</td></tr>';
// Statut

View File

@ -128,16 +128,16 @@ complete_dictionary_with_modules($taborder,$tabname,$tablib,$tabsql,$tabsqlsort,
// Define elementList and sourceList (used for dictionary type of contacts "llx_c_type_contact")
$elementList = array();
// Must match ids defined into eldy.lib.php
$sourceList = array(
'1' => $langs->trans('AccountingJournalType1'),
'2' => $langs->trans('AccountingJournalType2'),
'3' => $langs->trans('AccountingJournalType3'),
'4' => $langs->trans('AccountingJournalType4'),
'5' => $langs->trans('AccountingJournalType5'),
'8' => $langs->trans('AccountingJournalType8'),
'9' => $langs->trans('AccountingJournalType9')
);
// Must match ids defined into eldy.lib.php
$sourceList = array(
'1' => $langs->trans('AccountingJournalType1'),
'2' => $langs->trans('AccountingJournalType2'),
'3' => $langs->trans('AccountingJournalType3'),
'4' => $langs->trans('AccountingJournalType4'),
'5' => $langs->trans('AccountingJournalType5'),
'8' => $langs->trans('AccountingJournalType8'),
'9' => $langs->trans('AccountingJournalType9'),
);
/*
* Actions
@ -294,10 +294,10 @@ if (GETPOST('actionadd') || GETPOST('actionmodify'))
//$_GET["id"]=GETPOST('id', 'int'); // Force affichage dictionnaire en cours d'edition
}
if (GETPOST('actioncancel'))
{
//$_GET["id"]=GETPOST('id', 'int'); // Force affichage dictionnaire en cours d'edition
}
//if (GETPOST('actioncancel'))
//{
// $_GET["id"]=GETPOST('id', 'int'); // Force affichage dictionnaire en cours d'edition
//}
if ($action == 'confirm_delete' && $confirm == 'yes') // delete
{

View File

@ -1,7 +1,8 @@
<?php
/* Copyright (C) 2016 Olivier Geffroy <jeff@jeffinfo.com>
* Copyright (C) 2016 Florian Henry <florian.henry@open-concept.pro>
* Copyright (C) 2016-2018 Alexandre Spangaro <aspangaro@zendsi.com>
/* Copyright (C) 2016 Olivier Geffroy <jeff@jeffinfo.com>
* Copyright (C) 2016 Florian Henry <florian.henry@open-concept.pro>
* Copyright (C) 2016-2018 Alexandre Spangaro <aspangaro@zendsi.com>
* Copyright (C) 2018 Frédéric France <frederic.france@netlogic.fr>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -193,9 +194,9 @@ else {
$moreforfilter .= '<div class="divsearchfield">';
$moreforfilter .= $langs->trans('DateStart') . ': ';
$moreforfilter .= $form->select_date($search_date_start?$search_date_start:-1, 'date_start', 0, 0, 1, '', 1, 0, 1);
$moreforfilter .= $form->selectDate($search_date_start?$search_date_start:-1, 'date_start', 0, 0, 1, '', 1, 0);
$moreforfilter .= $langs->trans('DateEnd') . ': ';
$moreforfilter .= $form->select_date($search_date_end?$search_date_end:-1, 'date_end', 0, 0, 1, '', 1, 0, 1);
$moreforfilter .= $form->selectDate($search_date_end?$search_date_end:-1, 'date_end', 0, 0, 1, '', 1, 0);
$moreforfilter .= '</div>';
if (! empty($moreforfilter)) {

View File

@ -3,6 +3,7 @@
* Copyright (C) 2013-2017 Florian Henry <florian.henry@open-concept.pro>
* Copyright (C) 2013-2018 Alexandre Spangaro <aspangaro@zendsi.com>
* Copyright (C) 2017 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2018 Frédéric France <frederic.france@netlogic.fr>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -350,7 +351,7 @@ if ($action == 'create')
print '<tr>';
print '<td class="titlefieldcreate fieldrequired">' . $langs->trans("Docdate") . '</td>';
print '<td>';
print $html->select_date('', 'doc_date', '', '', '', "create_mvt", 1, 1);
print $html->selectDate('', 'doc_date', '', '', '', "create_mvt", 1, 1);
print '</td>';
print '</tr>';
@ -432,7 +433,7 @@ if ($action == 'create')
print '<input type="hidden" name="token" value="' . $_SESSION ['newtoken'] . '">';
print '<input type="hidden" name="action" value="setdate">';
print '<input type="hidden" name="mode" value="'.$mode.'">';
$form->select_date($object->doc_date ? $object->doc_date : - 1, 'doc_date', '', '', '', "setdate");
print $form->selectDate($object->doc_date ? $object->doc_date : - 1, 'doc_date', '', '', '', "setdate");
print '<input type="submit" class="button" value="' . $langs->trans('Modify') . '">';
print '</form>';
} else {

View File

@ -3,6 +3,7 @@
* Copyright (C) 2013-2016 Florian Henry <florian.henry@open-concept.pro>
* Copyright (C) 2013-2017 Alexandre Spangaro <aspangaro@zendsi.com>
* Copyright (C) 2016-2017 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2018 Frédéric France <frederic.france@netlogic.fr>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -465,11 +466,11 @@ if (! empty($arrayfields['t.doc_date']['checked']))
print '<td class="liste_titre center">';
print '<div class="nowrap">';
print $langs->trans('From') . ' ';
print $form->select_date($search_date_start?$search_date_start:-1, 'search_date_start', 0, 0, 1);
print $form->selectDate($search_date_start?$search_date_start:-1, 'search_date_start', 0, 0, 1);
print '</div>';
print '<div class="nowrap">';
print $langs->trans('to') . ' ';
print $form->select_date($search_date_end?$search_date_end:-1, 'search_date_end', 0, 0, 1);
print $form->selectDate($search_date_end?$search_date_end:-1, 'search_date_end', 0, 0, 1);
print '</div>';
print '</td>';
}
@ -556,11 +557,11 @@ if (! empty($arrayfields['t.date_creation']['checked']))
print '<td class="liste_titre center">';
print '<div class="nowrap">';
print $langs->trans('From') . ' ';
print $form->select_date($search_date_creation_start, 'date_creation_start', 0, 0, 1);
print $form->selectDate($search_date_creation_start, 'date_creation_start', 0, 0, 1);
print '</div>';
print '<div class="nowrap">';
print $langs->trans('to') . ' ';
print $form->select_date($search_date_creation_end, 'date_creation_end', 0, 0, 1);
print $form->selectDate($search_date_creation_end, 'date_creation_end', 0, 0, 1);
print '</div>';
print '</td>';
}
@ -570,11 +571,11 @@ if (! empty($arrayfields['t.tms']['checked']))
print '<td class="liste_titre center">';
print '<div class="nowrap">';
print $langs->trans('From') . ' ';
print $form->select_date($search_date_modification_start, 'date_modification_start', 0, 0, 1);
print $form->selectDate($search_date_modification_start, 'date_modification_start', 0, 0, 1);
print '</div>';
print '<div class="nowrap">';
print $langs->trans('to') . ' ';
print $form->select_date($search_date_modification_end, 'date_modification_end', 0, 0, 1);
print $form->selectDate($search_date_modification_end, 'date_modification_end', 0, 0, 1);
print '</div>';
print '</td>';
}

View File

@ -3,6 +3,7 @@
* Copyright (C) 2013-2016 Olivier Geffroy <jeff@jeffinfo.com>
* Copyright (C) 2013-2016 Florian Henry <florian.henry@open-concept.pro>
* Copyright (C) 2013-2018 Alexandre Spangaro <aspangaro@zendsi.com>
* Copyright (C) 2018 Frédéric France <frederic.france@netlogic.fr>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -287,10 +288,10 @@ print '</td>';
print '<td class="liste_titre"></td>';
print '<td class="liste_titre" align="center">';
print $langs->trans('From') . ': ';
print $form->select_date($search_date_start, 'search_date_start', 0, 0, 1);
print $form->selectDate($search_date_start, 'search_date_start', 0, 0, 1);
print '<br>';
print $langs->trans('to') . ': ';
print $form->select_date($search_date_end, 'search_date_end', 0, 0, 1);
print $form->selectDate($search_date_end, 'search_date_end', 0, 0, 1);
print '</td>';
print '<td class="liste_titre"><input type="text" size="7" class="flat" name="search_doc_ref" value="' . dol_escape_htmltag($search_doc_ref) . '"/></td>';
print '<td class="liste_titre"><input type="text" size="7" class="flat" name="search_label_operation" value="' . dol_escape_htmltag($search_label_operation) . '"/></td>';

View File

@ -56,24 +56,69 @@ class AccountancyCategory // extends CommonObject
*/
public $table_element='c_accounting_category';
public $id;
/**
* @var int ID
*/
public $id;
/**
* @var mixed Sample property 1
*/
public $code;
/**
* @var string proper name for given parameter
* @var string Accountancy Category label
*/
public $label;
/**
* @var mixed Sample property 1
*/
public $range_account;
/**
* @var mixed Sample property 1
*/
public $sens;
/**
* @var mixed Sample property 1
*/
public $category_type;
/**
* @var mixed Sample property 1
*/
public $formula;
/**
* @var mixed Sample property 1
*/
public $position;
/**
* @var mixed Sample property 1
*/
public $fk_country;
/**
* @var mixed Sample property 1
*/
public $active;
/**
* @var mixed Sample property 1
*/
public $lines_cptbk;
/**
* @var mixed Sample property 1
*/
public $lines_display;
/**
* @var mixed Sample property 1
*/
public $sdc;
@ -150,18 +195,18 @@ class AccountancyCategory // extends CommonObject
{
$this->id = $this->db->last_insert_id(MAIN_DB_PREFIX."c_accounting_category");
if (! $notrigger)
{
// Uncomment this and change MYOBJECT to your own tag if you
// want this action call a trigger.
// Uncomment this and change MYOBJECT to your own tag if you
// want this action call a trigger.
//if (! $notrigger)
//{
//// Call triggers
//include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php';
//$interface=new Interfaces($this->db);
//$result=$interface->run_triggers('MYOBJECT_CREATE',$this,$user,$langs,$conf);
//if ($result < 0) { $error++; $this->errors=$interface->errors; }
//// End call triggers
}
// // Call triggers
// include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php';
// $interface=new Interfaces($this->db);
// $result=$interface->run_triggers('MYOBJECT_CREATE',$this,$user,$langs,$conf);
// if ($result < 0) { $error++; $this->errors=$interface->errors; }
// // End call triggers
//}
}
// Commit or rollback
@ -289,18 +334,17 @@ class AccountancyCategory // extends CommonObject
if (! $error)
{
if (! $notrigger)
{
// Uncomment this and change MYOBJECT to your own tag if you
// want this action call a trigger.
//// Call triggers
//include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php';
//$interface=new Interfaces($this->db);
//$result=$interface->run_triggers('MYOBJECT_MODIFY',$this,$user,$langs,$conf);
//if ($result < 0) { $error++; $this->errors=$interface->errors; }
//// End call triggers
}
// Uncomment this and change MYOBJECT to your own tag if you
// want this action call a trigger.
//if (! $notrigger)
//{
// // Call triggers
// include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php';
// $interface=new Interfaces($this->db);
// $result=$interface->run_triggers('MYOBJECT_MODIFY',$this,$user,$langs,$conf);
// if ($result < 0) { $error++; $this->errors=$interface->errors; }
// // End call triggers
//}
}
// Commit or rollback
@ -345,18 +389,17 @@ class AccountancyCategory // extends CommonObject
if (! $error)
{
if (! $notrigger)
{
// Uncomment this and change MYOBJECT to your own tag if you
// want this action call a trigger.
//// Call triggers
//include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php';
//$interface=new Interfaces($this->db);
//$result=$interface->run_triggers('MYOBJECT_DELETE',$this,$user,$langs,$conf);
//if ($result < 0) { $error++; $this->errors=$interface->errors; }
//// End call triggers
}
// Uncomment this and change MYOBJECT to your own tag if you
// want this action call a trigger.
//if (! $notrigger)
//{
// // Call triggers
// include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php';
// $interface=new Interfaces($this->db);
// $result=$interface->run_triggers('MYOBJECT_DELETE',$this,$user,$langs,$conf);
// if ($result < 0) { $error++; $this->errors=$interface->errors; }
// // End call triggers
//}
}
// Commit or rollback

View File

@ -32,22 +32,22 @@ class AccountancySystem
* @var DoliDB Database handler.
*/
public $db;
/**
* @var string Error code (or message)
*/
public $error='';
var $rowid;
var $fk_pcg_version;
var $pcg_type;
var $pcg_subtype;
/**
* @var string proper name for given parameter
* @var string Accountancy System label
*/
public $label;
var $account_number;
var $account_parent;

View File

@ -37,6 +37,9 @@ class AccountingAccount extends CommonObject
*/
public $table_element='accounting_account';
/**
* @var string String with name of icon for myobject. Must be the part after the 'object_' into object_myobject.png
*/
public $picto = 'billr';
/**
@ -71,14 +74,19 @@ class AccountingAccount extends CommonObject
*/
public $id;
var $rowid;
var $datec; // Creation date
var $fk_pcg_version;
var $pcg_type;
var $pcg_subtype;
var $account_number;
var $account_parent;
var $account_category;
/**
* @var int ID
*/
public $rowid;
public $datec; // Creation date
public $fk_pcg_version;
public $pcg_type;
public $pcg_subtype;
public $account_number;
public $account_parent;
public $account_category;
public $status;
/**
* @var string Label of account
@ -96,7 +104,6 @@ class AccountingAccount extends CommonObject
public $fk_user_modif;
public $active; // duplicate with status
public $status;
/**
@ -528,15 +535,16 @@ class AccountingAccount extends CommonObject
}
}
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/**
* Account deactivated
*
* @param int $id Id
* @return int <0 if KO, >0 if OK
*/
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function account_desactivate($id)
{
// phpcs:enable
$result = $this->checkUsage();
if ($result > 0) {
@ -562,15 +570,16 @@ class AccountingAccount extends CommonObject
}
}
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/**
* Account activated
*
* @param int $id Id
* @return int <0 if KO, >0 if OK
*/
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function account_activate($id)
{
// phpcs:enable
$this->db->begin();
$sql = "UPDATE " . MAIN_DB_PREFIX . "accounting_account ";
@ -601,6 +610,7 @@ class AccountingAccount extends CommonObject
return $this->LibStatut($this->status,$mode);
}
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/**
* Renvoi le libelle d'un statut donne
*
@ -608,9 +618,9 @@ class AccountingAccount extends CommonObject
* @param int $mode 0=libelle long, 1=libelle court, 2=Picto + Libelle court, 3=Picto, 4=Picto + Libelle long, 5=Libelle court + Picto
* @return string Label of status
*/
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function LibStatut($statut,$mode=0)
{
// phpcs:enable
global $langs;
$langs->loadLangs(array("users"));
@ -620,27 +630,27 @@ class AccountingAccount extends CommonObject
if ($statut == 1) return $langs->trans('Enabled');
if ($statut == 0) return $langs->trans('Disabled');
}
if ($mode == 1)
elseif ($mode == 1)
{
if ($statut == 1) return $langs->trans('Enabled');
if ($statut == 0) return $langs->trans('Disabled');
}
if ($mode == 2)
elseif ($mode == 2)
{
if ($statut == 1) return img_picto($langs->trans('Enabled'),'statut4').' '.$langs->trans('Enabled');
if ($statut == 0) return img_picto($langs->trans('Disabled'),'statut5').' '.$langs->trans('Disabled');
}
if ($mode == 3)
elseif ($mode == 3)
{
if ($statut == 1) return img_picto($langs->trans('Enabled'),'statut4');
if ($statut == 0) return img_picto($langs->trans('Disabled'),'statut5');
}
if ($mode == 4)
elseif ($mode == 4)
{
if ($statut == 1) return img_picto($langs->trans('Enabled'),'statut4').' '.$langs->trans('Enabled');
if ($statut == 0) return img_picto($langs->trans('Disabled'),'statut5').' '.$langs->trans('Disabled');
}
if ($mode == 5)
elseif ($mode == 5)
{
if ($statut == 1) return $langs->trans('Enabled').' '.img_picto($langs->trans('Enabled'),'statut4');
if ($statut == 0) return $langs->trans('Disabled').' '.img_picto($langs->trans('Disabled'),'statut5');

View File

@ -36,16 +36,27 @@ class AccountingJournal extends CommonObject
*/
public $table_element='accounting_journal';
/**
* @var int Field with ID of parent key if this field has a parent
*/
public $fk_element = '';
public $ismultientitymanaged = 0; // 0=No test on entity, 1=Test with field entity, 2=Test with link by societe
/**
* @var string String with name of icon for myobject. Must be the part after the 'object_' into object_myobject.png
*/
public $picto = 'generic';
/**
* @var int ID
*/
public $rowid;
public $code;
/**
* @var string proper name for given parameter
* @var string Accounting Journal label
*/
public $label;
@ -260,6 +271,7 @@ class AccountingJournal extends CommonObject
return $this->LibType($this->nature,$mode);
}
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/**
* Return type of an accounting journal
*
@ -267,9 +279,9 @@ class AccountingJournal extends CommonObject
* @param int $mode 0=libelle long, 1=libelle court
* @return string Label of type
*/
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function LibType($nature,$mode=0)
{
// phpcs:enable
global $langs;
$langs->loadLangs(array("accountancy"));

View File

@ -35,22 +35,25 @@ class BookKeeping extends CommonObject
* @var string Error code (or message)
*/
public $error;
/**
* @var string[] Error codes (or messages)
*/
public $errors = array();
/**
* @var string Id to identify managed objects
*/
public $element = 'accountingbookkeeping';
/**
* @var string Name of table without prefix where object is stored
*/
public $table_element = 'accounting_bookkeeping';
/**
* @var int Entity
*/
public $entity;
/**
@ -62,8 +65,7 @@ class BookKeeping extends CommonObject
* @var int ID
*/
public $id;
/**
*/
public $doc_date;
public $date_lim_reglement;
public $doc_type;
@ -333,18 +335,15 @@ class BookKeeping extends CommonObject
dol_syslog(__METHOD__ . ' ' . join(',', $this->errors), LOG_ERR);
}
if (! $error) {
// Uncomment this and change MYOBJECT to your own tag if you
// want this action to call a trigger.
//if (! $error && ! $notrigger) {
if (! $notrigger) {
// Uncomment this and change MYOBJECT to your own tag if you
// want this action to call a trigger.
// // Call triggers
// $result=$this->call_trigger('MYOBJECT_CREATE',$user);
// if ($result < 0) $error++;
// // End call triggers
}
}
// // Call triggers
// $result=$this->call_trigger('MYOBJECT_CREATE',$user);
// if ($result < 0) $error++;
// // End call triggers
//}
// Commit or rollback
if ($error) {
@ -564,15 +563,15 @@ class BookKeeping extends CommonObject
if (! $error) {
$this->id = $this->db->last_insert_id(MAIN_DB_PREFIX . $this->table_element . $mode);
if (! $notrigger) {
// Uncomment this and change MYOBJECT to your own tag if you
// want this action to call a trigger.
// Uncomment this and change MYOBJECT to your own tag if you
// want this action to call a trigger.
//if (! $notrigger) {
// // Call triggers
// $result=$this->call_trigger('MYOBJECT_CREATE',$user);
// if ($result < 0) $error++;
// // End call triggers
}
// // Call triggers
// $result=$this->call_trigger('MYOBJECT_CREATE',$user);
// if ($result < 0) $error++;
// // End call triggers
//}
}
// Commit or rollback
@ -1129,15 +1128,15 @@ class BookKeeping extends CommonObject
dol_syslog(__METHOD__ . ' ' . join(',', $this->errors), LOG_ERR);
}
if (! $error && ! $notrigger) {
// Uncomment this and change MYOBJECT to your own tag if you
// want this action calls a trigger.
// Uncomment this and change MYOBJECT to your own tag if you
// want this action calls a trigger.
//if (! $error && ! $notrigger) {
// // Call triggers
// $result=$this->call_trigger('MYOBJECT_MODIFY',$user);
// if ($result < 0) { $error++; //Do also what you must do to rollback action if trigger fail}
// // End call triggers
}
// // Call triggers
// $result=$this->call_trigger('MYOBJECT_MODIFY',$user);
// if ($result < 0) { $error++; //Do also what you must do to rollback action if trigger fail}
// // End call triggers
//}
// Commit or rollback
if ($error) {
@ -1203,17 +1202,15 @@ class BookKeeping extends CommonObject
$this->db->begin();
if (! $error) {
if (! $notrigger) {
// Uncomment this and change MYOBJECT to your own tag if you
// want this action calls a trigger.
// Uncomment this and change MYOBJECT to your own tag if you
// want this action calls a trigger.
//if (! $error && ! $notrigger) {
// // Call triggers
// $result=$this->call_trigger('MYOBJECT_DELETE',$user);
// if ($result < 0) { $error++; //Do also what you must do to rollback action if trigger fail}
// // End call triggers
}
}
// // Call triggers
// $result=$this->call_trigger('MYOBJECT_DELETE',$user);
// if ($result < 0) { $error++; //Do also what you must do to rollback action if trigger fail}
// // End call triggers
//}
if (! $error) {
$sql = 'DELETE FROM ' . MAIN_DB_PREFIX . $this->table_element.$mode;
@ -1551,15 +1548,16 @@ class BookKeeping extends CommonObject
return 1;
}
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/**
* Export bookkeping
*
* @param string $model Model
* @return int Result
*/
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function export_bookkeping($model = 'ebp')
{
// phpcs:enable
global $conf;
$sql = "SELECT rowid, doc_date, doc_type,";
@ -1704,11 +1702,12 @@ class BookKeeping extends CommonObject
*/
}
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/**
* Return list of accounts with label by chart of accounts
*
* @param string $selectid Preselected chart of accounts
* @param string $htmlname Name of field in html form
* @param string $selectid Preselected chart of accounts
* @param string $htmlname Name of field in html form
* @param int $showempty Add an empty field
* @param array $event Event options
* @param int $select_in Value is a aa.rowid (0 default) or aa.account_number (1)
@ -1716,9 +1715,9 @@ class BookKeeping extends CommonObject
* @param int $aabase Set accounting_account base class to display empty=all or from 1 to 8 will display only account beginning by this number
* @return string String with HTML select
*/
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function select_account($selectid, $htmlname = 'account', $showempty = 0, $event = array(), $select_in = 0, $select_out = 0, $aabase = '')
{
// phpcs:enable
global $conf;
require_once DOL_DOCUMENT_ROOT . '/core/lib/accounting.lib.php';
@ -1775,15 +1774,16 @@ class BookKeeping extends CommonObject
return $out;
}
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/**
* Description of a root accounting account
*
* @param string $account Accounting account
* @return string Root account
*/
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function get_compte_racine($account = null)
{
// phpcs:enable
global $conf;
$pcgver = $conf->global->CHARTOFACCOUNTS;
@ -1816,15 +1816,16 @@ class BookKeeping extends CommonObject
}
}
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/**
* Description of accounting account
*
* @param string $account Accounting account
* @return string Account desc
*/
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function get_compte_desc($account = null)
{
// phpcs:enable
global $conf;
$pcgver = $conf->global->CHARTOFACCOUNTS;
@ -1862,7 +1863,11 @@ class BookKeeping extends CommonObject
*/
class BookKeepingLine
{
/**
* @var int ID
*/
public $id;
public $doc_date = '';
public $doc_type;
public $doc_ref;

View File

@ -153,7 +153,7 @@ $y = $year_current;
$buttonbind = '<a class="butAction" href="' . $_SERVER['PHP_SELF'] . '?year=' . $year_current . '&action=validatehistory">' . $langs->trans("ValidateHistory") . '</a>';
print_barre_liste($langs->trans("OverviewOfAmountOfLinesNotBound"), '', '', '', '', '', '', -1, '', '', 0, $buttonbind, '', 0, 1, 1);
//print_fiche_titre($langs->trans("OverviewOfAmountOfLinesNotBound"), $buttonbind, '');
//print load_fiche_titre($langs->trans("OverviewOfAmountOfLinesNotBound"), $buttonbind, '');
print '<div class="div-table-responsive-no-min">';
print '<table class="noborder" width="100%">';
@ -229,7 +229,7 @@ print '<br>';
print_barre_liste($langs->trans("OverviewOfAmountOfLinesBound"), '', '', '', '', '', '', -1, '', '', 0, '', '', 0, 1, 1);
//print_fiche_titre($langs->trans("OverviewOfAmountOfLinesBound"), '', '');
//print load_fiche_titre($langs->trans("OverviewOfAmountOfLinesBound"), '', '');
print '<div class="div-table-responsive-no-min">';
print '<table class="noborder" width="100%">';
@ -309,7 +309,7 @@ if ($conf->global->MAIN_FEATURES_LEVEL > 0) // This part of code looks strange.
print '<br>';
print_barre_liste($langs->trans("OtherInfo"), '', '', '', '', '', '', -1, '', '', 0, '', '', 0, 1, 1);
//print_fiche_titre($langs->trans("OtherInfo"), '', '');
//print load_fiche_titre($langs->trans("OtherInfo"), '', '');
print '<div class="div-table-responsive-no-min">';
print '<table class="noborder" width="100%">';

View File

@ -150,7 +150,7 @@ $buttonbind = '<a class="butAction" href="' . $_SERVER['PHP_SELF'] . '?year=' .
print_barre_liste($langs->trans("OverviewOfAmountOfLinesNotBound"), '', '', '', '', '', '', -1, '', '', 0, $buttonbind, '', 0, 1, 1);
//print_fiche_titre($langs->trans("OverviewOfAmountOfLinesNotBound"), $buttonbind, '');
//print load_fiche_titre($langs->trans("OverviewOfAmountOfLinesNotBound"), $buttonbind, '');
print '<div class="div-table-responsive-no-min">';
print '<table class="noborder" width="100%">';
@ -221,7 +221,7 @@ print '<br>';
print_barre_liste($langs->trans("OverviewOfAmountOfLinesBound"), '', '', '', '', '', '', -1, '', '', 0, '', '', 0, 1, 1);
//print_fiche_titre($langs->trans("OverviewOfAmountOfLinesBound"), '', '');
//print load_fiche_titre($langs->trans("OverviewOfAmountOfLinesBound"), '', '');
print '<div class="div-table-responsive-no-min">';
@ -297,7 +297,7 @@ if ($conf->global->MAIN_FEATURES_LEVEL > 0) // This part of code looks strange.
print '<br>';
print_barre_liste($langs->trans("OtherInfo"), '', '', '', '', '', '', -1, '', '', 0, '', '', 0, 1, 1);
//print_fiche_titre($langs->trans("OtherInfo"), '', '');
//print load_fiche_titre($langs->trans("OtherInfo"), '', '');
print '<div class="div-table-responsive-no-min">';
print '<table class="noborder" width="100%">';

View File

@ -55,7 +55,7 @@ if ($conf->accounting->enabled)
print $langs->trans("AccountancyAreaDescIntro")."<br>\n";
print "<br>\n";print "<br>\n";
print_fiche_titre('<span class="fa fa-calendar-check-o"></span> '.$langs->trans("AccountancyAreaDescActionOnce"), '', '')."<br>\n";
print load_fiche_titre('<span class="fa fa-calendar-check-o"></span> '.$langs->trans("AccountancyAreaDescActionOnce"), '', '')."<br>\n";
print '<hr>';
print "<br>\n";
@ -131,7 +131,7 @@ if ($conf->accounting->enabled)
print "<br>\n";
print_fiche_titre('<span class="fa fa-calendar"></span> '.$langs->trans("AccountancyAreaDescActionFreq"), '', '');
print load_fiche_titre('<span class="fa fa-calendar"></span> '.$langs->trans("AccountancyAreaDescActionFreq"), '', '');
print '<hr>';
print "<br>\n";
$step = 0;

View File

@ -7,7 +7,7 @@
* Copyright (C) 2013-2018 Alexandre Spangaro <aspangaro@zendsi.com>
* Copyright (C) 2013-2014 Florian Henry <florian.henry@open-concept.pro>
* Copyright (C) 2013-2014 Olivier Geffroy <jeff@jeffinfo.com>
* Copyright (C) 2017 Frédéric France <frederic.france@netlogic.fr>
* Copyright (C) 2017-2018 Frédéric France <frederic.france@netlogic.fr>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -852,7 +852,8 @@ if (empty($action) || $action == 'view') {
$description.= $langs->trans("DescJournalOnlyBindedVisible").'<br>';
$listofchoices=array('notyet'=>$langs->trans("NotYetInGeneralLedger"), 'already'=>$langs->trans("AlreadyInGeneralLedger"));
$period = $form->select_date($date_start?$date_start:-1, 'date_start', 0, 0, 0, '', 1, 0, 1) . ' - ' . $form->select_date($date_end?$date_end:-1, 'date_end', 0, 0, 0, '', 1, 0, 1). ' - ' .$langs->trans("JournalizationInLedgerStatus").' '. $form->selectarray('in_bookkeeping', $listofchoices, $in_bookkeeping, 1);
$period = $form->selectDate($date_start?$date_start:-1, 'date_start', 0, 0, 0, '', 1, 0) . ' - ' . $form->selectDate($date_end?$date_end:-1, 'date_end', 0, 0, 0, '', 1, 0);
$period .= ' - ' .$langs->trans("JournalizationInLedgerStatus").' '. $form->selectarray('in_bookkeeping', $listofchoices, $in_bookkeeping, 1);
$varlink = 'id_journal=' . $id_journal;

View File

@ -6,6 +6,7 @@
* Copyright (C) 2013-2017 Alexandre Spangaro <aspangaro@zendsi.com>
* Copyright (C) 2013-2016 Olivier Geffroy <jeff@jeffinfo.com>
* Copyright (C) 2013-2016 Florian Henry <florian.henry@open-concept.pro>
* Copyright (C) 2018 Frédéric France <frederic.france@netlogic.fr>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -534,7 +535,8 @@ if (empty($action) || $action == 'view') {
$description.= $langs->trans("DescJournalOnlyBindedVisible").'<br>';
$listofchoices=array('notyet'=>$langs->trans("NotYetInGeneralLedger"), 'already'=>$langs->trans("AlreadyInGeneralLedger"));
$period = $form->select_date($date_start?$date_start:-1, 'date_start', 0, 0, 0, '', 1, 0, 1) . ' - ' . $form->select_date($date_end?$date_end:-1, 'date_end', 0, 0, 0, '', 1, 0, 1). ' - ' .$langs->trans("JournalizationInLedgerStatus").' '. $form->selectarray('in_bookkeeping', $listofchoices, $in_bookkeeping, 1);
$period = $form->selectDate($date_start?$date_start:-1, 'date_start', 0, 0, 0, '', 1, 0) . ' - ' . $form->selectDate($date_end?$date_end:-1, 'date_end', 0, 0, 0, '', 1, 0);
$period .= ' - ' .$langs->trans("JournalizationInLedgerStatus").' '. $form->selectarray('in_bookkeeping', $listofchoices, $in_bookkeeping, 1);
$varlink = 'id_journal=' . $id_journal;

View File

@ -6,6 +6,7 @@
* Copyright (C) 2013-2017 Alexandre Spangaro <aspangaro@zendsi.com>
* Copyright (C) 2013-2016 Olivier Geffroy <jeff@jeffinfo.com>
* Copyright (C) 2013-2016 Florian Henry <florian.henry@open-concept.pro>
* Copyright (C) 2018 Frédéric France <frederic.france@netlogic.fr>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -726,7 +727,8 @@ if (empty($action) || $action == 'view') {
}
$listofchoices=array('notyet'=>$langs->trans("NotYetInGeneralLedger"), 'already'=>$langs->trans("AlreadyInGeneralLedger"));
$period = $form->select_date($date_start?$date_start:-1, 'date_start', 0, 0, 0, '', 1, 0, 1) . ' - ' . $form->select_date($date_end?$date_end:-1, 'date_end', 0, 0, 0, '', 1, 0, 1). ' - ' .$langs->trans("JournalizationInLedgerStatus").' '. $form->selectarray('in_bookkeeping', $listofchoices, $in_bookkeeping, 1);
$period = $form->selectDate($date_start?$date_start:-1, 'date_start', 0, 0, 0, '', 1, 0) . ' - ' . $form->selectDate($date_end?$date_end:-1, 'date_end', 0, 0, 0, '', 1, 0);
$period .= ' - ' .$langs->trans("JournalizationInLedgerStatus").' '. $form->selectarray('in_bookkeeping', $listofchoices, $in_bookkeeping, 1);
$varlink = 'id_journal=' . $id_journal;

View File

@ -8,6 +8,7 @@
* Copyright (C) 2013-2016 Florian Henry <florian.henry@open-concept.pro>
* Copyright (C) 2013-2016 Olivier Geffroy <jeff@jeffinfo.com>
* Copyright (C) 2014 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
* Copyright (C) 2018 Frédéric France <frederic.france@netlogic.fr>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -656,7 +657,8 @@ if (empty($action) || $action == 'view') {
$description .= $langs->trans("DepositsAreIncluded");
$listofchoices=array('notyet'=>$langs->trans("NotYetInGeneralLedger"), 'already'=>$langs->trans("AlreadyInGeneralLedger"));
$period = $form->select_date($date_start?$date_start:-1, 'date_start', 0, 0, 0, '', 1, 0, 1) . ' - ' . $form->select_date($date_end?$date_end:-1, 'date_end', 0, 0, 0, '', 1, 0, 1). ' - ' .$langs->trans("JournalizationInLedgerStatus").' '. $form->selectarray('in_bookkeeping', $listofchoices, $in_bookkeeping, 1);
$period = $form->selectDate($date_start?$date_start:-1, 'date_start', 0, 0, 0, '', 1, 0) . ' - ' . $form->selectDate($date_end?$date_end:-1, 'date_end', 0, 0, 0, '', 1, 0);
$period .= ' - ' .$langs->trans("JournalizationInLedgerStatus").' '. $form->selectarray('in_bookkeeping', $listofchoices, $in_bookkeeping, 1);
$varlink = 'id_journal=' . $id_journal;

View File

@ -150,7 +150,7 @@ $buttonbind = '<a class="butAction" href="' . $_SERVER['PHP_SELF'] . '?year=' .
print_barre_liste($langs->trans("OverviewOfAmountOfLinesNotBound"), '', '', '', '', '', '', -1, '', '', 0, $buttonbind, '', 0, 1, 1);
//print_fiche_titre($langs->trans("OverviewOfAmountOfLinesNotBound"), $buttonbind, '');
//print load_fiche_titre($langs->trans("OverviewOfAmountOfLinesNotBound"), $buttonbind, '');
print '<div class="div-table-responsive-no-min">';
print '<table class="noborder" width="100%">';
@ -221,7 +221,7 @@ print '<br>';
print_barre_liste($langs->trans("OverviewOfAmountOfLinesBound"), '', '', '', '', '', '', -1, '', '', 0, '', '', 0, 1, 1);
//print_fiche_titre($langs->trans("OverviewOfAmountOfLinesBound"), '', '');
//print load_fiche_titre($langs->trans("OverviewOfAmountOfLinesBound"), '', '');
print '<div class="div-table-responsive-no-min">';
print '<table class="noborder" width="100%">';
@ -295,7 +295,7 @@ if ($conf->global->MAIN_FEATURES_LEVEL > 0) // This part of code looks strange.
print '<br>';
print_barre_liste($langs->trans("OtherInfo"), '', '', '', '', '', '', -1, '', '', 0, '', '', 0, 1, 1);
//print_fiche_titre($langs->trans("OtherInfo"), '', '');
//print load_fiche_titre($langs->trans("OtherInfo"), '', '');
print '<div class="div-table-responsive-no-min">';
print '<table class="noborder" width="100%">';

View File

@ -33,8 +33,8 @@ require '../../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/member.lib.php';
$langs->load("admin");
$langs->load("members");
// Load translation files required by the page
$langs->loadLangs(array("admin","members"));
if (! $user->admin) accessforbidden();

View File

@ -33,8 +33,8 @@ require '../../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/member.lib.php';
$langs->load("admin");
$langs->load("members");
// Load translation files required by the page
$langs->loadLangs(array("admin","members"));
if (! $user->admin) accessforbidden();

View File

@ -28,8 +28,8 @@ require '../../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/member.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php';
$langs->load("members");
$langs->load("admin");
// Load translation files required by the page
$langs->loadLangs(array("admin","members"));
$extrafields = new ExtraFields($db);
$form = new Form($db);

View File

@ -31,8 +31,8 @@ require '../../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/member.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php';
$langs->load("members");
$langs->load("admin");
// Load translation files required by the page
$langs->loadLangs(array("admin","members"));
$extrafields = new ExtraFields($db);
$form = new Form($db);

View File

@ -31,8 +31,8 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/member.lib.php';
require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent_type.class.php';
$langs->load("members");
$langs->load("admin");
// Load translation files required by the page
$langs->loadLangs(array("admin","members"));
$action=GETPOST('action', 'alpha');

View File

@ -33,8 +33,8 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/member.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent_type.class.php';
$langs->load("companies");
$langs->load("members");
// Load translation files required by the page
$langs->loadLangs(array("companies","members"));
$id = GETPOST('id','int')?GETPOST('id','int'):GETPOST('rowid','int');

View File

@ -75,16 +75,17 @@ abstract class ActionsAdherentCardCommon
//}
}
/**
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/**
* Set content of ->tpl array, to use into template
*
* @param string $action Type of action
* @param int $id Id
* @return string HTML output
*/
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function assign_values(&$action, $id)
{
// phpcs:enable
global $conf, $langs, $user, $canvas;
global $form, $formcompany, $objsoc;
@ -233,14 +234,15 @@ abstract class ActionsAdherentCardCommon
}
}
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/**
* Assign POST values into object
*
* @return string HTML output
*/
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
private function assign_post()
{
// phpcs:enable
global $langs, $mysoc;
$this->object->old_name = $_POST["old_name"];

View File

@ -67,6 +67,7 @@ class ActionsAdherentCardDefault extends ActionsAdherentCardCommon
return $out;
}
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/**
* Assign custom values for canvas
*
@ -74,9 +75,9 @@ class ActionsAdherentCardDefault extends ActionsAdherentCardCommon
* @param int $id Id
* @return void
*/
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function assign_values(&$action, $id)
{
// phpcs:enable
global $limit, $offset, $sortfield, $sortorder;
global $conf, $db, $langs, $user;
global $form;
@ -121,6 +122,7 @@ class ActionsAdherentCardDefault extends ActionsAdherentCardCommon
}
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/**
* Fetch datas list and save into ->list_datas
*
@ -130,9 +132,9 @@ class ActionsAdherentCardDefault extends ActionsAdherentCardCommon
* @param string $sortorder Sort order ('ASC' or 'DESC')
* @return void
*/
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function LoadListDatas($limit, $offset, $sortfield, $sortorder)
{
// phpcs:enable
global $conf, $langs;
//$this->getFieldList();

View File

@ -1,11 +1,12 @@
<?php
/* Copyright (C) 2001-2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2002-2003 Jean-Louis Bergamo <jlb@j1b.org>
* Copyright (C) 2004-2012 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2018 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2012 Marcos García <marcosgdf@gmail.com>
* Copyright (C) 2012-2018 Philippe Grand <philippe.grand@atoo-net.com>
* Copyright (C) 2015-2016 Alexandre Spangaro <aspangaro.dolibarr@gmail.com>
/* Copyright (C) 2001-2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2002-2003 Jean-Louis Bergamo <jlb@j1b.org>
* Copyright (C) 2004-2012 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2018 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2012 Marcos García <marcosgdf@gmail.com>
* Copyright (C) 2012-2018 Philippe Grand <philippe.grand@atoo-net.com>
* Copyright (C) 2015-2016 Alexandre Spangaro <aspangaro.dolibarr@gmail.com>
* Copyright (C) 2018 Frédéric France <frederic.france@netlogic.fr>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -980,7 +981,7 @@ else
// Birthday
print "<tr><td>".$langs->trans("Birthday")."</td><td>\n";
$form->select_date(($object->birth ? $object->birth : -1),'birth','','',1,'formsoc');
print $form->selectDate(($object->birth ? $object->birth : -1),'birth','','',1,'formsoc');
print "</td></tr>\n";
// Public profil
@ -1218,7 +1219,7 @@ else
// Birthday
print "<tr><td>".$langs->trans("Birthday")."</td><td>\n";
$form->select_date(($object->birth ? $object->birth : -1),'birth','','',1,'formsoc');
print $form->selectDate(($object->birth ? $object->birth : -1),'birth','','',1,'formsoc');
print "</td></tr>\n";
// Public profil

View File

@ -53,67 +53,73 @@ class Adherent extends CommonObject
public $ismultientitymanaged = 1; // 0=No test on entity, 1=Test with field entity, 2=Test with link by societe
var $mesgs;
public $mesgs;
var $login;
public $login;
//! Clear password in memory
var $pass;
public $pass;
//! Clear password in database (defined if DATABASE_PWD_ENCRYPTED=0)
var $pass_indatabase;
public $pass_indatabase;
//! Encrypted password in database (always defined)
var $pass_indatabase_crypted;
public $pass_indatabase_crypted;
var $societe;
var $company;
var $address;
var $zip;
var $town;
public $societe;
public $company;
public $address;
public $zip;
public $town;
var $state_id; // Id of department
var $state_code; // Code of department
var $state; // Label of department
public $state_id; // Id of department
public $state_code; // Code of department
public $state; // Label of department
var $email;
var $skype;
var $phone;
var $phone_perso;
var $phone_mobile;
public $email;
public $skype;
public $phone;
public $phone_perso;
public $phone_mobile;
var $morphy;
var $public;
var $statut; // -1:brouillon, 0:resilie, >=1:valide,paye
var $photo;
public $morphy;
public $public;
public $statut; // -1:brouillon, 0:resilie, >=1:valide,paye
public $photo;
var $datec;
var $datem;
var $datefin;
var $datevalid;
var $birth;
public $datec;
public $datem;
public $datefin;
public $datevalid;
public $birth;
var $note_public;
var $note_private;
public $note_public;
public $note_private;
var $typeid; // Id type adherent
var $type; // Libelle type adherent
var $need_subscription;
public $typeid; // Id type adherent
public $type; // Libelle type adherent
public $need_subscription;
var $user_id;
var $user_login;
public $user_id;
public $user_login;
var $fk_soc;
/**
* @var int Thirdparty ID
*/
public $fk_soc;
// Fields loaded by fetch_subscriptions()
var $first_subscription_date;
var $first_subscription_amount;
var $last_subscription_date;
var $last_subscription_date_start;
var $last_subscription_date_end;
var $last_subscription_amount;
var $subscriptions=array();
public $first_subscription_date;
public $first_subscription_amount;
public $last_subscription_date;
public $last_subscription_date_start;
public $last_subscription_date_end;
public $last_subscription_amount;
public $subscriptions=array();
var $oldcopy; // To contains a clone of this when we need to save old properties of object
public $oldcopy; // To contains a clone of this when we need to save old properties of object
/**
* @var int Entity
*/
public $entity;
/**
@ -132,6 +138,7 @@ class Adherent extends CommonObject
}
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/**
* Function sending an email has the adherent with the text supplied in parameter.
*
@ -147,9 +154,9 @@ class Adherent extends CommonObject
* @param string $errors_to erros to
* @return int <0 if KO, >0 if OK
*/
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function send_an_email($text, $subject, $filename_list=array(), $mimetype_list=array(), $mimefilename_list=array(), $addr_cc="", $addr_bcc="", $deliveryreceipt=0, $msgishtml=-1, $errors_to='')
{
// phpcs:enable
global $conf,$langs;
// Detect if message is HTML
@ -638,6 +645,7 @@ class Adherent extends CommonObject
}
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/**
* Update denormalized last subscription date.
* This function is called when we delete a subscription for example.
@ -645,9 +653,9 @@ class Adherent extends CommonObject
* @param User $user User making change
* @return int <0 if KO, >0 if OK
*/
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function update_end_date($user)
{
// phpcs:enable
$this->db->begin();
// Search for last subscription id and end date
@ -993,15 +1001,16 @@ class Adherent extends CommonObject
}
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/**
* Method to load member from its login
*
* @param string $login login of member
* @return void
*/
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function fetch_login($login)
{
// phpcs:enable
global $conf;
$sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."adherent";
@ -1023,6 +1032,7 @@ class Adherent extends CommonObject
}
}
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/**
* Method to load member from its name
*
@ -1030,9 +1040,9 @@ class Adherent extends CommonObject
* @param string $lastname Lastname
* @return void
*/
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function fetch_name($firstname,$lastname)
{
// phpcs:enable
global $conf;
$sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."adherent";
@ -1195,6 +1205,7 @@ class Adherent extends CommonObject
}
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/**
* Fonction qui recupere pour un adherent les parametres
* first_subscription_date
@ -1204,9 +1215,9 @@ class Adherent extends CommonObject
*
* @return int <0 si KO, >0 si OK
*/
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function fetch_subscriptions()
{
// phpcs:enable
global $langs;
require_once DOL_DOCUMENT_ROOT.'/adherents/class/subscription.class.php';
@ -1750,14 +1761,15 @@ class Adherent extends CommonObject
}
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/**
* Function to add member into external tools mailing-list, spip, etc.
*
* @return int <0 if KO, >0 if OK
*/
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function add_to_abo()
{
// phpcs:enable
global $conf,$langs;
include_once DOL_DOCUMENT_ROOT.'/mailmanspip/class/mailmanspip.class.php';
@ -1808,14 +1820,15 @@ class Adherent extends CommonObject
}
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/**
* Function to delete a member from external tools like mailing-list, spip, etc.
*
* @return int <0 if KO, >0 if OK
*/
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function del_to_abo()
{
// phpcs:enable
global $conf,$langs;
include_once DOL_DOCUMENT_ROOT.'/mailmanspip/class/mailmanspip.class.php';
@ -1988,6 +2001,7 @@ class Adherent extends CommonObject
return $this->LibStatut($this->statut,$this->need_subscription,$this->datefin,$mode);
}
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/**
* Renvoi le libelle d'un statut donne
*
@ -1997,9 +2011,9 @@ class Adherent extends CommonObject
* @param int $mode 0=libelle long, 1=libelle court, 2=Picto + Libelle court, 3=Picto, 4=Picto + Libelle long, 5=Libelle court + Picto
* @return string Label
*/
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function LibStatut($statut,$need_subscription,$date_end_subscription,$mode=0)
{
// phpcs:enable
global $langs;
$langs->load("members");
if ($mode == 0)
@ -2013,7 +2027,7 @@ class Adherent extends CommonObject
}
if ($statut == 0) return $langs->trans("MemberStatusResiliated");
}
if ($mode == 1)
elseif ($mode == 1)
{
if ($statut == -1) return $langs->trans("MemberStatusDraftShort");
if ($statut >= 1)
@ -2024,7 +2038,7 @@ class Adherent extends CommonObject
}
if ($statut == 0) return $langs->trans("MemberStatusResiliatedShort");
}
if ($mode == 2)
elseif ($mode == 2)
{
if ($statut == -1) return img_picto($langs->trans('MemberStatusDraft'),'statut0').' '.$langs->trans("MemberStatusDraftShort");
if ($statut >= 1)
@ -2035,7 +2049,7 @@ class Adherent extends CommonObject
}
if ($statut == 0) return img_picto($langs->trans('MemberStatusResiliated'),'statut5').' '.$langs->trans("MemberStatusResiliatedShort");
}
if ($mode == 3)
elseif ($mode == 3)
{
if ($statut == -1) return img_picto($langs->trans('MemberStatusDraft'),'statut0');
if ($statut >= 1)
@ -2046,7 +2060,7 @@ class Adherent extends CommonObject
}
if ($statut == 0) return img_picto($langs->trans('MemberStatusResiliated'),'statut5');
}
if ($mode == 4)
elseif ($mode == 4)
{
if ($statut == -1) return img_picto($langs->trans('MemberStatusDraft'),'statut0').' '.$langs->trans("MemberStatusDraft");
if ($statut >= 1)
@ -2057,7 +2071,7 @@ class Adherent extends CommonObject
}
if ($statut == 0) return img_picto($langs->trans('MemberStatusResiliated'),'statut5').' '.$langs->trans("MemberStatusResiliated");
}
if ($mode == 5)
elseif ($mode == 5)
{
if ($statut == -1) return $langs->trans("MemberStatusDraft").' '.img_picto($langs->trans('MemberStatusDraft'),'statut0');
if ($statut >= 1)
@ -2068,7 +2082,7 @@ class Adherent extends CommonObject
}
if ($statut == 0) return '<span class="hideonsmartphone">'.$langs->trans("MemberStatusResiliated").' </span>'.img_picto($langs->trans('MemberStatusResiliated'),'statut5');
}
if ($mode == 6)
elseif ($mode == 6)
{
if ($statut == -1) return $langs->trans("MemberStatusDraft").' '.img_picto($langs->trans('MemberStatusDraft'),'statut0');
if ($statut >= 1)
@ -2082,14 +2096,15 @@ class Adherent extends CommonObject
}
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/**
* Charge indicateurs this->nb de tableau de bord
*
* @return int <0 if KO, >0 if OK
*/
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function load_state_board()
{
// phpcs:enable
global $conf;
$this->nb=array();
@ -2117,15 +2132,16 @@ class Adherent extends CommonObject
}
}
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/**
* Load indicators for dashboard (this->nbtodo and this->nbtodolate)
*
* @param User $user Objet user
* @return WorkboardResponse|int <0 if KO, WorkboardResponse if OK
*/
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function load_board($user)
{
// phpcs:enable
global $conf, $langs;
if ($user->societe_id) return -1; // protection pour eviter appel par utilisateur externe
@ -2260,6 +2276,7 @@ class Adherent extends CommonObject
}
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/**
* Retourne chaine DN complete dans l'annuaire LDAP pour l'objet
*
@ -2269,9 +2286,9 @@ class Adherent extends CommonObject
* 2=Return key only (uid=qqq)
* @return string DN
*/
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function _load_ldap_dn($info,$mode=0)
{
// phpcs:enable
global $conf;
$dn='';
if ($mode==0) $dn=$conf->global->LDAP_KEY_MEMBERS."=".$info[$conf->global->LDAP_KEY_MEMBERS].",".$conf->global->LDAP_MEMBER_DN;
@ -2281,14 +2298,15 @@ class Adherent extends CommonObject
}
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/**
* Initialise tableau info (tableau des attributs LDAP)
*
* @return array Tableau info des attributs
*/
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function _load_ldap_info()
{
// phpcs:enable
global $conf,$langs;
$info=array();
@ -2618,6 +2636,7 @@ class Adherent extends CommonObject
$outputlangs = new Translate('', $conf);
$outputlangs->setDefaultLang(empty($adherent->thirdparty->default_lang) ? $mysoc->default_lang : $adherent->thirdparty->default_lang);
$outputlangs->loadLangs(array("main", "members"));
dol_syslog("sendReminderForExpiredSubscription Language set to ".$outputlangs->defaultlang);
$arraydefaultmessage=null;
$labeltouse = $conf->global->ADHERENT_EMAIL_TEMPLATE_REMIND_EXPIRATION;

View File

@ -36,13 +36,17 @@ class AdherentType extends CommonObject
* @var string Name of table without prefix where object is stored
*/
public $table_element = 'adherent_type';
/**
* @var string ID to identify managed object
*/
public $element = 'adherent_type';
/**
* @var string String with name of icon for myobject. Must be the part after the 'object_' into object_myobject.png
*/
public $picto = 'group';
public $ismultientitymanaged = 1; // 0=No test on entity, 1=Test with field entity, 2=Test with link by societe
/**
@ -51,19 +55,25 @@ class AdherentType extends CommonObject
* @see label
*/
public $libelle;
/** @var string Label */
public $label;
/**
* @var int Subsription required (0 or 1)
* @since 5.0
*/
public $subscription;
/** @var string Public note */
public $note;
/** @var integer Can vote */
public $vote;
/** @var string Email sent during validation */
public $mail_valid;
/** @var array Array of members */
public $members=array();
@ -290,14 +300,15 @@ class AdherentType extends CommonObject
}
}
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/**
* Return list of members' type
*
* @return array List of types of members
*/
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function liste_array()
{
// phpcs:enable
global $conf,$langs;
$adherenttypes = array();
@ -422,6 +433,7 @@ class AdherentType extends CommonObject
return '';
}
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/**
* Retourne chaine DN complete dans l'annuaire LDAP pour l'objet
*
@ -431,9 +443,9 @@ class AdherentType extends CommonObject
* 2=Return key only (uid=qqq)
* @return string DN
*/
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function _load_ldap_dn($info,$mode=0)
{
// phpcs:enable
global $conf;
$dn='';
if ($mode==0) $dn=$conf->global->LDAP_KEY_MEMBERS_TYPES."=".$info[$conf->global->LDAP_KEY_MEMBERS_TYPES].",".$conf->global->LDAP_MEMBER_TYPE_DN;
@ -443,14 +455,15 @@ class AdherentType extends CommonObject
}
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/**
* Initialize the info array (array of LDAP values) that will be used to call LDAP functions
*
* @return array Tableau info des attributs
*/
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function _load_ldap_info()
{
// phpcs:enable
global $conf,$langs;
$info=array();

View File

@ -36,21 +36,24 @@ class Subscription extends CommonObject
* @var string ID to identify managed object
*/
public $element='subscription';
/**
* @var string Name of table without prefix where object is stored
*/
public $table_element='subscription';
public $picto='payment';
var $datec; // Date creation
var $datem; // Date modification
var $dateh; // Subscription start date (date subscription)
var $datef; // Subscription end date
var $fk_adherent;
var $amount;
var $fk_bank;
/**
* @var string String with name of icon for myobject. Must be the part after the 'object_' into object_myobject.png
*/
public $picto='payment';
public $datec; // Date creation
public $datem; // Date modification
public $dateh; // Subscription start date (date subscription)
public $datef; // Subscription end date
public $fk_adherent;
public $amount;
public $fk_bank;
/**
@ -363,15 +366,16 @@ class Subscription extends CommonObject
return '';
}
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/**
* Renvoi le libelle d'un statut donne
*
* @param int $statut Id statut
* @return string Label
*/
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function LibStatut($statut)
{
// phpcs:enable
global $langs;
$langs->load("members");
return '';

View File

@ -33,9 +33,9 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php';
require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php';
require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent_type.class.php';
$langs->load("members");
$langs->load("companies");
$langs->load('other');
// Load translation files required by the page
$langs->loadLangs(array("companies","members","other"));
$id=GETPOST('id','int');
$action=GETPOST('action','alpha');

View File

@ -29,8 +29,8 @@ require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php';
require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent_type.class.php';
require_once DOL_DOCUMENT_ROOT.'/adherents/class/subscription.class.php';
$langs->load("companies");
$langs->load("members");
// Load translation files required by the page
$langs->loadLangs(array("companies","members"));
// Security check
$result=restrictedArea($user,'adherent');

View File

@ -29,10 +29,8 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/ldap.class.php';
require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php';
require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent_type.class.php';
$langs->load("companies");
$langs->load("members");
$langs->load("ldap");
$langs->load("admin");
// Load translation files required by the page
$langs->loadLangs(array("companies","members","ldap","admin"));
$rowid = GETPOST('id','int');
$action = GETPOST('action','aZ09');

View File

@ -48,6 +48,7 @@ $search=GETPOST("search",'alpha');
$search_ref=GETPOST("search_ref",'alpha');
$search_lastname=GETPOST("search_lastname",'alpha');
$search_firstname=GETPOST("search_firstname",'alpha');
$search_civility=GETPOST("search_civility",'alpha');
$search_login=GETPOST("search_login",'alpha');
$search_address=GETPOST("search_address",'alpha');
$search_zip=GETPOST("search_zip",'alpha');
@ -105,6 +106,7 @@ $fieldstosearchall = array(
if($db->type == 'pgsql') unset($fieldstosearchall['d.rowid']);
$arrayfields=array(
'd.ref'=>array('label'=>$langs->trans("Ref"), 'checked'=>1),
'd.civility'=>array('label'=>$langs->trans("Civility"), 'checked'=>0),
'd.lastname'=>array('label'=>$langs->trans("Lastname"), 'checked'=>1),
'd.firstname'=>array('label'=>$langs->trans("Firstname"), 'checked'=>1),
'd.company'=>array('label'=>$langs->trans("Company"), 'checked'=>1),
@ -121,7 +123,7 @@ $arrayfields=array(
'state.nom'=>array('label'=>$langs->trans("State"), 'checked'=>0),
'country.code_iso'=>array('label'=>$langs->trans("Country"), 'checked'=>0),
/*'d.note_public'=>array('label'=>$langs->trans("NotePublic"), 'checked'=>0),
'd.note_private'=>array('label'=>$langs->trans("NotePrivate"), 'checked'=>0),*/
'd.note_private'=>array('label'=>$langs->trans("NotePrivate"), 'checked'=>0),*/
'd.datefin'=>array('label'=>$langs->trans("EndSubscription"), 'checked'=>1, 'position'=>500),
'd.datec'=>array('label'=>$langs->trans("DateCreation"), 'checked'=>0, 'position'=>500),
'd.tms'=>array('label'=>$langs->trans("DateModificationShort"), 'checked'=>0, 'position'=>500),
@ -160,6 +162,7 @@ if (empty($reshook))
$search_ref="";
$search_lastname="";
$search_firstname="";
$search_civility="";
$search_login="";
$search_company="";
$search_type="";
@ -203,7 +206,7 @@ $memberstatic=new Adherent($db);
$now=dol_now();
$sql = "SELECT d.rowid, d.login, d.lastname, d.firstname, d.societe as company, d.fk_soc,";
$sql.= " d.datefin, d.address, d.zip, d.town, d.state_id, d.country,";
$sql.= " d.civility, d.datefin, d.address, d.zip, d.town, d.state_id, d.country,";
$sql.= " d.email, d.phone, d.phone_perso, d.phone_mobile, d.skype, d.birth, d.public, d.photo,";
$sql.= " d.fk_adherent_type as type_id, d.morphy, d.statut, d.datec as date_creation, d.tms as date_update,";
$sql.= " t.libelle as type, t.subscription,";
@ -234,6 +237,7 @@ if ($search_ref)
if (is_numeric($search_ref)) $sql.= " AND (d.rowid = ".$db->escape($search_ref).")";
else $sql.=" AND 1 = 2"; // Always wrong
}
if ($search_civility) $sql.= natural_search("d.civility", $search_civility);
if ($search_firstname) $sql.= natural_search("d.firstname", $search_firstname);
if ($search_lastname) $sql.= natural_search(array("d.firstname", "d.lastname", "d.societe"), $search_lastname);
if ($search_login) $sql.= natural_search("d.login", $search_login);
@ -322,6 +326,7 @@ if ($sall != "") $param.="&sall=".urlencode($sall);
if ($statut != "") $param.="&statut=".urlencode($statut);
if ($search_ref) $param.="&search_ref=".urlencode($search_ref);
if ($search_nom) $param.="&search_nom=".urlencode($search_nom);
if ($search_civility) $param.="&search_civility=".urlencode($search_civility);
if ($search_firstname) $param.="&search_firstname=".urlencode($search_firstname);
if ($search_lastname) $param.="&search_lastname=".urlencode($search_lastname);
if ($search_login) $param.="&search_login=".urlencode($search_login);
@ -427,37 +432,36 @@ if (! empty($arrayfields['d.ref']['checked']))
print '<input class="flat maxwidth50" type="text" name="search_ref" value="'.dol_escape_htmltag($search_ref).'">';
print '</td>';
}
if (! empty($arrayfields['d.civility']['checked']))
{
print '<td class="liste_titre" align="left">';
print '<input class="flat maxwidth25" type="text" name="search_civility" value="'.dol_escape_htmltag($search_civility).'"></td>';
}
if (! empty($arrayfields['d.firstname']['checked']))
{
print '<td class="liste_titre" align="left">';
print '<input class="flat maxwidth50" type="text" name="search_firstname" value="'.dol_escape_htmltag($search_firstname).'"></td>';
}
if (! empty($arrayfields['d.lastname']['checked']))
{
print '<td class="liste_titre" align="left">';
print '<input class="flat maxwidth50" type="text" name="search_lastname" value="'.dol_escape_htmltag($search_lastname).'"></td>';
}
if (! empty($arrayfields['d.company']['checked']))
{
print '<td class="liste_titre" align="left">';
print '<input class="flat maxwidth50" type="text" name="search_company" value="'.dol_escape_htmltag($search_company).'"></td>';
}
if (! empty($arrayfields['d.login']['checked']))
{
print '<td class="liste_titre" align="left">';
print '<input class="flat maxwidth50" type="text" name="search_login" value="'.dol_escape_htmltag($search_login).'"></td>';
}
if (! empty($arrayfields['d.morphy']['checked']))
{
print '<td class="liste_titre" align="left">';
print '</td>';
}
if (! empty($arrayfields['t.libelle']['checked']))
{
print '<td class="liste_titre">';
@ -568,6 +572,7 @@ print "</tr>\n";
print '<tr class="liste_titre">';
if (! empty($conf->global->MAIN_SHOW_TECHNICAL_ID)) print_liste_field_titre("ID",$_SERVER["PHP_SELF"],'','',$param,'align="center"',$sortfield,$sortorder);
if (! empty($arrayfields['d.ref']['checked'])) print_liste_field_titre($arrayfields['d.ref']['label'],$_SERVER["PHP_SELF"],'d.rowid','',$param,'',$sortfield,$sortorder);
if (! empty($arrayfields['d.civility']['checked'])) print_liste_field_titre($arrayfields['d.civility']['label'],$_SERVER["PHP_SELF"],'d.civility','',$param,'',$sortfield,$sortorder);
if (! empty($arrayfields['d.firstname']['checked'])) print_liste_field_titre($arrayfields['d.firstname']['label'],$_SERVER["PHP_SELF"],'d.firstname','',$param,'',$sortfield,$sortorder);
if (! empty($arrayfields['d.lastname']['checked'])) print_liste_field_titre($arrayfields['d.lastname']['label'],$_SERVER["PHP_SELF"],'d.lastname','',$param,'',$sortfield,$sortorder);
if (! empty($arrayfields['d.company']['checked'])) print_liste_field_titre($arrayfields['d.company']['label'],$_SERVER["PHP_SELF"],'d.societe','',$param,'',$sortfield,$sortorder);
@ -605,6 +610,7 @@ while ($i < min($num, $limit))
$datefin=$db->jdate($obj->datefin);
$memberstatic->id=$obj->rowid;
$memberstatic->ref=$obj->rowid;
$memberstatic->civility_id=$obj->civility;
$memberstatic->lastname=$obj->lastname;
$memberstatic->firstname=$obj->firstname;
$memberstatic->statut=$obj->statut;
@ -630,10 +636,17 @@ while ($i < min($num, $limit))
// Ref
if (! empty($arrayfields['d.ref']['checked']))
{
print "<td>";
print "<td>";
print $memberstatic->getNomUrl(-1, 0, 'card', 'ref');
print "</td>\n";
}
// Civility
if (! empty($arrayfields['d.civility']['checked']))
{
print "<td>";
print $obj->civility;
print "</td>\n";
}
// Firstname
if (! empty($arrayfields['d.firstname']['checked']))
{
@ -658,12 +671,12 @@ while ($i < min($num, $limit))
// Login
if (! empty($arrayfields['d.login']['checked']))
{
print "<td>".$obj->login."</td>\n";
print "<td>".$obj->login."</td>\n";
}
// Moral/Physique
if (! empty($arrayfields['d.morphy']['checked']))
{
print "<td>".$memberstatic->getmorphylib($obj->morphy)."</td>\n";
print "<td>".$memberstatic->getmorphylib($obj->morphy)."</td>\n";
}
// Type label
if (! empty($arrayfields['t.libelle']['checked']))

View File

@ -28,9 +28,8 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/member.lib.php';
require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php';
require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent_type.class.php';
$langs->load("companies");
$langs->load("members");
$langs->load("bills");
// Load translation files required by the page
$langs->loadLangs(array("companies","members","bills"));
$action=GETPOST('action','alpha');
$id=GETPOST('id','int');

View File

@ -44,8 +44,8 @@ $year = strftime("%Y", time());
$startyear=$year-2;
$endyear=$year;
$langs->load("members");
$langs->load("companies");
// Load translation files required by the page
$langs->loadLangs(array("companies","members"));
/*

View File

@ -45,8 +45,8 @@ $year = strftime("%Y", time());
$startyear=$year-2;
$endyear=$year;
$langs->load("members");
$langs->load("companies");
// Load translation files required by the page
$langs->loadLangs(array("companies","members"));
/*

View File

@ -46,8 +46,8 @@ $year = strftime("%Y", time());
$startyear=$year-2;
$endyear=$year;
$langs->load("members");
$langs->load("companies");
// Load translation files required by the page
$langs->loadLangs(array("companies","members"));
/*

View File

@ -1,9 +1,10 @@
<?php
/* Copyright (C) 2001-2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2002-2003 Jean-Louis Bergamo <jlb@j1b.org>
* Copyright (C) 2004-2018 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2012-2017 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2015-2016 Alexandre Spangaro <aspangaro.dolibarr@gmail.com>
/* Copyright (C) 2001-2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2002-2003 Jean-Louis Bergamo <jlb@j1b.org>
* Copyright (C) 2004-2018 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2012-2017 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2015-2016 Alexandre Spangaro <aspangaro.dolibarr@gmail.com>
* Copyright (C) 2018 Frédéric France <frederic.france@netlogic.fr>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -895,7 +896,7 @@ if ($rowid > 0)
$datefrom=dol_time_plus_duree($object->datefin,1,'d');
}
}
print $form->select_date($datefrom,'','','','',"subscription",1,1,1);
print $form->selectDate($datefrom, '', '', '', '', "subscription", 1, 1);
print "</td></tr>";
// Date end subscription
@ -908,7 +909,7 @@ if ($rowid > 0)
$dateto=-1; // By default, no date is suggested
}
print '<tr><td>'.$langs->trans("DateEndSubscription").'</td><td>';
print $form->select_date($dateto,'end','','','',"subscription",1,0,1);
print $form->selectDate($dateto, 'end', '', '', '', "subscription", 1, 0);
print "</td></tr>";
if ($adht->subscription)
@ -1009,7 +1010,7 @@ if ($rowid > 0)
// Date of payment
print '<tr class="bankswitchclass"><td class="fieldrequired">'.$langs->trans("DatePayment").'</td><td>';
print $form->select_date(isset($paymentdate)?$paymentdate:-1,'payment',0,0,1,'subscription',1,1,1);
print $form->selectDate(isset($paymentdate)?$paymentdate:-1, 'payment', 0, 0, 1, 'subscription', 1, 1);
print "</td></tr>\n";
print '<tr class="bankswitchclass2"><td>'.$langs->trans('Numero');

View File

@ -1,5 +1,6 @@
<?php
/* Copyright (C) 2007-2012 Laurent Destailleur <eldy@users.sourceforge.net>
/* Copyright (C) 2007-2012 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2018 Frédéric France <frederic.france@netlogic.fr>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -29,10 +30,8 @@ if (! empty($conf->banque->enabled)) {
require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
}
$langs->load("companies");
$langs->load("bills");
$langs->load("members");
$langs->load("users");
// Load translation files required by the page
$langs->loadLangs(array("companies","members","bills","users"));
$adh = new Adherent($db);
$object = new Subscription($db);
@ -211,13 +210,13 @@ if ($user->rights->adherent->cotisation->creer && $action == 'edit')
// Date start subscription
print '<tr><td>'.$langs->trans("DateSubscription").'</td><td class="valeur" colspan="2">';
$form->select_date($object->dateh,'datesub',1,1,0,'update',1);
print $form->selectDate($object->dateh, 'datesub', 1, 1, 0, 'update', 1);
print '</td>';
print '</tr>';
// Date end subscription
print '<tr><td>'.$langs->trans("DateEndSubscription").'</td><td class="valeur" colspan="2">';
$form->select_date($object->datef,'datesubend',0,0,0,'update',1);
print $form->selectDate($object->datef, 'datesubend', 0, 0, 0, 'update', 1);
print '</td>';
print '</tr>';

View File

@ -28,10 +28,8 @@ require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/member.lib.php';
require_once DOL_DOCUMENT_ROOT.'/adherents/class/subscription.class.php';
$langs->load("companies");
$langs->load("bills");
$langs->load("members");
$langs->load("users");
// Load translation files required by the page
$langs->loadLangs(array("companies","members","bills","users"));
if (!$user->rights->adherent->lire)
accessforbidden();

View File

@ -29,9 +29,8 @@ require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent_type.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/ldap.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/ldap.lib.php';
$langs->load("members");
$langs->load("admin");
$langs->load("ldap");
// Load translation files required by the page
$langs->loadLangs(array("admin","members","ldap"));
$id = GETPOST('rowid', 'int');
$action = GETPOST('action','alpha');

View File

@ -356,7 +356,7 @@ print '<tr class="oddeven">'."\n";
print '<td>'.$langs->trans("AGENDA_DEFAULT_VIEW").'</td>'."\n";
print '<td align="center">&nbsp;</td>'."\n";
print '<td align="right">'."\n";
$tmplist=array('show_list'=>$langs->trans("ViewList"), 'show_month'=>$langs->trans("ViewCal"), 'show_week'=>$langs->trans("ViewWeek"), 'show_day'=>$langs->trans("ViewDay"), 'show_peruser'=>$langs->trans("ViewPerUser"));
$tmplist=array(''=>'&nbsp;', 'show_list'=>$langs->trans("ViewList"), 'show_month'=>$langs->trans("ViewCal"), 'show_week'=>$langs->trans("ViewWeek"), 'show_day'=>$langs->trans("ViewDay"), 'show_peruser'=>$langs->trans("ViewPerUser"));
print $form->selectarray('AGENDA_DEFAULT_VIEW', $tmplist, $conf->global->AGENDA_DEFAULT_VIEW);
print '</td></tr>'."\n";

View File

@ -306,7 +306,7 @@ if (! empty($conf->product->enabled))
print '<tr class="oddeven">';
print '<td>'.$langs->trans("SetDefaultBarcodeTypeProducts").'</td>';
print '<td width="60" align="right">';
$formbarcode->select_barcode_type($conf->global->PRODUIT_DEFAULT_BARCODE_TYPE,"PRODUIT_DEFAULT_BARCODE_TYPE",1);
print $formbarcode->selectBarcodeType($conf->global->PRODUIT_DEFAULT_BARCODE_TYPE, "PRODUIT_DEFAULT_BARCODE_TYPE", 1);
print '</td></tr>';
}
@ -317,7 +317,7 @@ if (! empty($conf->societe->enabled))
print '<tr class="oddeven">';
print '<td>'.$langs->trans("SetDefaultBarcodeTypeThirdParties").'</td>';
print '<td width="60" align="right">';
print $formbarcode->select_barcode_type($conf->global->GENBARCODE_BARCODETYPE_THIRDPARTY,"GENBARCODE_BARCODETYPE_THIRDPARTY",1);
print $formbarcode->selectBarcodeType($conf->global->GENBARCODE_BARCODETYPE_THIRDPARTY, "GENBARCODE_BARCODETYPE_THIRDPARTY", 1);
print '</td></tr>';
}

View File

@ -50,6 +50,7 @@ $error=0;
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
$hookmanager->initHooks(array('admincompany','globaladmin'));
/*
* Actions
*/
@ -397,7 +398,7 @@ if ($action == 'edit' || $action == 'updateedit')
print '<a href="'.$_SERVER["PHP_SELF"].'?action=removelogo">'.img_delete($langs->trans("Delete")).'</a>';
if (file_exists($conf->mycompany->dir_output.'/logos/thumbs/'.$mysoc->logo_mini)) {
print ' &nbsp; ';
print '<img src="'.DOL_URL_ROOT.'/viewimage.php?modulepart=mycompany&amp;file='.urlencode('/thumbs/'.$mysoc->logo_mini).'">';
print '<img src="'.DOL_URL_ROOT.'/viewimage.php?modulepart=mycompany&amp;file='.urlencode('logos/thumbs/'.$mysoc->logo_mini).'">';
}
} else {
print '<img height="30" src="'.DOL_URL_ROOT.'/public/theme/common/nophoto.png">';
@ -791,7 +792,7 @@ else
}
else if ($mysoc->logo_mini && is_file($conf->mycompany->dir_output.'/logos/thumbs/'.$mysoc->logo_mini))
{
print '<img class="img_logo" src="'.DOL_URL_ROOT.'/viewimage.php?modulepart=mycompany&amp;file='.urlencode('/thumbs/'.$mysoc->logo_mini).'">';
print '<img class="img_logo" src="'.DOL_URL_ROOT.'/viewimage.php?modulepart=mycompany&amp;file='.urlencode('logos/thumbs/'.$mysoc->logo_mini).'">';
}
else
{

View File

@ -122,6 +122,13 @@ $modules=array(
),
);
$labelmeteo = array(0=>$langs->trans("No"), 1=>$langs->trans("Yes"), 2=>$langs->trans("OnMobileOnly"));
/*
* Actions
*/
if ($action == 'update')
{
foreach($modules as $module => $delays)
@ -201,9 +208,10 @@ if ($action == 'edit')
print '<table class="noborder" width="100%">';
print '<tr class="liste_titre"><td>'.$langs->trans("Parameter").'</td><td class="center" width="120px">'.$langs->trans("Value").'</td></tr>';
$var=false;
print '<tr class="oddeven">';
print '<td>'.$langs->trans("MAIN_DISABLE_METEO").'</td><td class="center">' .$form->selectyesno('MAIN_DISABLE_METEO',(empty($conf->global->MAIN_DISABLE_METEO)?0:1),1) . '</td></tr>';
print '<td>'.$langs->trans("MAIN_DISABLE_METEO").'</td><td class="center">';
print $form->selectarray('MAIN_DISABLE_METEO', $labelmeteo, (empty($conf->global->MAIN_DISABLE_METEO)?0:$conf->global->MAIN_DISABLE_METEO));
print '</td></tr>';
print '</table>';
}
@ -241,7 +249,9 @@ else
print '<tr class="liste_titre"><td>'.$langs->trans("Parameter").'</td><td class="center" width="120px">'.$langs->trans("Value").'</td></tr>';
print '<tr class="oddeven">';
print '<td>'.$langs->trans("MAIN_DISABLE_METEO").'</td><td class="center">' . yn($conf->global->MAIN_DISABLE_METEO) . '</td></tr>';
print '<td>'.$langs->trans("MAIN_DISABLE_METEO").'</td><td class="center">';
print $labelmeteo[$conf->global->MAIN_DISABLE_METEO];
print '</td></tr>';
print '</table>';

View File

@ -163,15 +163,16 @@ class Dolistore
}
}
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/**
* Return tree of Dolistore categories. $this->categories must have been loaded before.
*
* @param int $parent Id of parent category
* @return string
*/
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function get_categories($parent = 0)
{
// phpcs:enable
if (!isset($this->categories)) die('not possible');
if ($parent != 0) {
$html = '<ul>';
@ -211,14 +212,15 @@ class Dolistore
}
}
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/**
* Return list of product formated for output
*
* @return string HTML output
*/
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function get_products()
{
// phpcs:enable
global $langs, $conf;
$html = "";
$parity = "pair";
@ -293,38 +295,41 @@ class Dolistore
return $html;
}
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/**
* get previous link
*
* @param string $text symbol previous
* @return string html previous link
*/
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function get_previous_link($text = '<<')
{
// phpcs:enable
return '<a href="'.$this->get_previous_url().'" class="button">'.$text.'</a>';
}
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/**
* get next link
*
* @param string $text symbol next
* @return string html next link
*/
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function get_next_link($text = '>>')
{
// phpcs:enable
return '<a href="'.$this->get_next_url().'" class="button">'.$text.'</a>';
}
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/**
* get previous url
*
* @return string previous url
*/
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function get_previous_url()
function get_previous_url()
{
// phpcs:enable
$param_array = array();
if ($this->start < $this->per_page) {
$sub = 0;
@ -340,14 +345,15 @@ class Dolistore
return $this->url."&".$param;
}
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/**
* get next url
*
* @return string next url
*/
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function get_next_url()
{
// phpcs:enable
$param_array = array();
if (count($this->products) < $this->per_page) {
$add = 0;
@ -363,6 +369,7 @@ class Dolistore
return $this->url."&".$param;
}
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/**
* version compare
*
@ -370,9 +377,9 @@ class Dolistore
* @param string $v2 version 2
* @return int result of compare
*/
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function version_compare($v1, $v2)
{
// phpcs:enable
$v1 = explode('.', $v1);
$v2 = explode('.', $v2);
$ret = 0;

View File

@ -1,7 +1,8 @@
<?php
/* Copyright (C) 2012 Mikael Carlavan <contact@mika-carl.fr>
* Copyright (C) 2017 ATM Consulting <contact@atm-consulting.fr>
* Copyright (C) 2017 Pierre-Henry Favre <phf@atm-consulting.fr>
/* Copyright (C) 2012 Mikael Carlavan <contact@mika-carl.fr>
* Copyright (C) 2017 ATM Consulting <contact@atm-consulting.fr>
* Copyright (C) 2017 Pierre-Henry Favre <phf@atm-consulting.fr>
* Copyright (C) 2018 Frédéric France <frederic.france@netlogic.fr>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -182,8 +183,8 @@ if ($action != 'edit')
echo '<td>'.$form->selectExpense('', 'fk_c_type_fees', 0, 1, 1).'</td>';
echo '<td>'.$form->selectarray('code_expense_rules_type', $tab_rules_type, '', 0).'</td>';
echo '<td>'.$form->select_date(strtotime(date('Y-m-01', dol_now())), 'start', '', '', 0, '', 1, 0, 1).'</td>';
echo '<td>'.$form->select_date(strtotime(date('Y-m-t', dol_now())), 'end', '', '', 0, '', 1, 0, 1).'</td>';
echo '<td>'.$form->selectDate(strtotime(date('Y-m-01', dol_now())), 'start', '', '', 0, '', 1, 0).'</td>';
echo '<td>'.$form->selectDate(strtotime(date('Y-m-t', dol_now())), 'end', '', '', 0, '', 1, 0).'</td>';
echo '<td><input type="text" value="" name="amount" class="amount" />'.$conf->currency.'</td>';
echo '<td>'.$form->selectyesno('restrictive', 0, 1).'</td>';
echo '<td align="right"><input type="submit" class="button" value="'.$langs->trans('Add').'" /></td>';
@ -270,7 +271,7 @@ foreach ($rules as $rule)
echo '<td>';
if ($action == 'edit' && $object->id == $rule->id)
{
echo $form->select_date(strtotime(date('Y-m-d', $object->dates)), 'start', '', '', 0, '', 1, 0, 1);
print $form->selectDate(strtotime(date('Y-m-d', $object->dates)), 'start', '', '', 0, '', 1, 0);
}
else
{
@ -282,7 +283,7 @@ foreach ($rules as $rule)
echo '<td>';
if ($action == 'edit' && $object->id == $rule->id)
{
echo $form->select_date(strtotime(date('Y-m-d', $object->datee)), 'end', '', '', 0, '', 1, 0, 1);
print $form->selectDate(strtotime(date('Y-m-d', $object->datee)), 'end', '', '', 0, '', 1, 0);
}
else
{

View File

@ -1,8 +1,7 @@
<?php
/* Copyright (C) 2011-2013 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2011-2015 Philippe Grand <philippe.grand@atoo-net.com>
* Copyright (C) 2013 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2018 Charlene Benke <charlie@patas-monkey.com>
* Copyright (C) 2011-2018 Philippe Grand <philippe.grand@atoo-net.com>
* Copyright (C) 2018 Charlene Benke <charlie@patas-monkey.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
@ -30,9 +29,8 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/pdf.lib.php';
require_once DOL_DOCUMENT_ROOT.'/holiday/class/holiday.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/holiday.lib.php';
$langs->load("admin");
$langs->load("errors");
$langs->load("holiday");
// Load translation files required by the page
$langs->loadLangs(array("admin", "errors", "holiday"));
if (!$user->admin) accessforbidden();
@ -341,7 +339,6 @@ print "</tr>\n";
clearstatcache();
$var=true;
foreach ($dirmodels as $reldir)
{
foreach (array('','/doc') as $valdir)
@ -379,7 +376,6 @@ foreach ($dirmodels as $reldir)
if ($modulequalified)
{
$var = !$var;
print '<tr class="oddeven"><td width="100">';
print (empty($module->name)?$name:$module->name);
print "</td><td>\n";
@ -474,7 +470,6 @@ print '<tr class="liste_titre">';
print '<td>'.$langs->trans("Parameter").'</td>';
print '<td align="center" width="60">'.$langs->trans("Value").'</td>';
print "</tr>\n";
$var=true;
$substitutionarray=pdf_getSubstitutionArray($langs, array('objectamount'), null, 2);
$substitutionarray['__(AnyTranslationKey)__']=$langs->trans("Translation");
@ -482,7 +477,6 @@ $htmltext = '<i>'.$langs->trans("AvailableVariables").':<br>';
foreach($substitutionarray as $key => $val) $htmltext.=$key.'<br>';
$htmltext.='</i>';
$var=! $var;
print '<tr class="oddeven"><td colspan="2">';
print $form->textwithpicto($langs->trans("FreeLegalTextOnHolidays"), $langs->trans("AddCRIfTooLong").'<br><br>'.$htmltext, 1, 'help', '', 0, 2, 'tooltiphelp');
print '<br>';

View File

@ -3,6 +3,7 @@
* Copyright (C) 2004-2015 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2017 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2016 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2018 Ferran Marcet <fmarcet@2byte.es>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -133,6 +134,9 @@ if ($action == 'update')
if (GETPOST('THEME_ELDY_USE_HOVER') == '') dolibarr_set_const($db, "THEME_ELDY_USE_HOVER", '0', 'chaine', 0, '', $conf->entity); // If empty, we set to '0' ('000000' is for black)
else dolibarr_set_const($db, "THEME_ELDY_USE_HOVER", $_POST["THEME_ELDY_USE_HOVER"], 'chaine', 0, '', $conf->entity);
if (GETPOST('THEME_ELDY_USE_CHECKED') == '') dolibarr_set_const($db, "THEME_ELDY_USE_CHECKED", '0', 'chaine', 0, '', $conf->entity);
else dolibarr_set_const($db, "THEME_ELDY_USE_CHECKED", $_POST["THEME_ELDY_USE_CHECKED"], 'chaine', 0, '', $conf->entity);
dolibarr_set_const($db, "MAIN_SIZE_LISTE_LIMIT", $_POST["main_size_liste_limit"],'chaine',0,'',$conf->entity);
dolibarr_set_const($db, "MAIN_SIZE_SHORTLIST_LIMIT", $_POST["main_size_shortliste_limit"],'chaine',0,'',$conf->entity);
dolibarr_set_const($db, "MAIN_DISABLE_JAVASCRIPT", $_POST["main_disable_javascript"],'chaine',0,'',$conf->entity);
@ -413,7 +417,7 @@ if ($action == 'edit') // Edit
print '<a href="'.$_SERVER["PHP_SELF"].'?action=removebackgroundlogin">'.img_delete($langs->trans("Delete")).'</a>';
if (file_exists($conf->mycompany->dir_output.'/logos/'.$conf->global->MAIN_LOGIN_BACKGROUND)) {
print ' &nbsp; ';
print '<img class="paddingleft valignmiddle" width="100px" src="'.DOL_URL_ROOT.'/viewimage.php?modulepart=mycompany&amp;file='.urlencode('/'.$conf->global->MAIN_LOGIN_BACKGROUND).'">';
print '<img class="paddingleft valignmiddle" width="100px" src="'.DOL_URL_ROOT.'/viewimage.php?modulepart=mycompany&amp;file='.urlencode('logos/'.$conf->global->MAIN_LOGIN_BACKGROUND).'">';
}
} else {
print '<img class="paddingleft valignmiddle" width="100" src="'.DOL_URL_ROOT.'/public/theme/common/nophoto.png">';
@ -561,7 +565,7 @@ else // Show
print $conf->global->MAIN_LOGIN_BACKGROUND;
if ($conf->global->MAIN_LOGIN_BACKGROUND && is_file($conf->mycompany->dir_output.'/logos/'.$conf->global->MAIN_LOGIN_BACKGROUND))
{
print '<img class="img_logo paddingleft valignmiddle" src="'.DOL_URL_ROOT.'/viewimage.php?modulepart=mycompany&amp;file='.urlencode($conf->global->MAIN_LOGIN_BACKGROUND).'">';
print '<img class="img_logo paddingleft valignmiddle" src="'.DOL_URL_ROOT.'/viewimage.php?modulepart=mycompany&amp;file='.urlencode('logos/'.$conf->global->MAIN_LOGIN_BACKGROUND).'">';
}
else
{

View File

@ -28,9 +28,8 @@ require '../../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formadmin.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/menubase.class.php';
$langs->load("admin");
$langs->load('other');
// Load translation files required by the page
$langs->loadLangs(array("other","admin"));
if (! $user->admin) accessforbidden();

View File

@ -27,8 +27,8 @@ require '../../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formadmin.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/treeview.lib.php';
$langs->load("other");
$langs->load("admin");
// Load translation files required by the page
$langs->loadLangs(array("other","admin"));
if (! $user->admin) accessforbidden();

View File

@ -24,9 +24,8 @@
require '../../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
$langs->load("users");
$langs->load("admin");
$langs->load("other");
// Load translation files required by the page
$langs->loadLangs(array("user","other","admin"));
if (! $user->admin) accessforbidden();

View File

@ -598,17 +598,18 @@ if ($mode == 'common')
}
// Print a separator if we change family
if ($familykey!=$oldfamily)
{
if ($oldfamily) print '</table></div><br>';
if ($familykey != $oldfamily) {
if ($oldfamily) {
print '</table></div><br>';
}
$familytext=empty($familyinfo[$familykey]['label'])?$familykey:$familyinfo[$familykey]['label'];
print_fiche_titre($familytext, '', '');
$familytext = empty($familyinfo[$familykey]['label'])?$familykey:$familyinfo[$familykey]['label'];
print load_fiche_titre($familytext, '', '');
print '<div class="div-table-responsive">';
print '<table class="tagtable liste" summary="list_of_modules">'."\n";
print '<table class="tagtable liste" summary="list_of_modules">'."\n";
$atleastoneforfamily=0;
$atleastoneforfamily=0;
}
$atleastoneforfamily++;

View File

@ -171,7 +171,7 @@ llxHeader('', $langs->trans($page_name));
// Subheader
$linkback = '<a href="' . DOL_URL_ROOT . '/admin/modules.php?restore_lastsearch_values=1">' . $langs->trans("BackToModuleList") . '</a>';
print_fiche_titre($langs->trans($page_name), $linkback);
print load_fiche_titre($langs->trans($page_name), $linkback);
// Configuration header
$head = multicurrencyAdminPrepareHead();

View File

@ -32,11 +32,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/pdf.lib.php';
// Load translation files required by the page
$langs->loadLangs(array('admin', 'languages', 'other'));
$langs->load("companies");
$langs->load("products");
$langs->load("members");
$langs->loadLangs(array('admin', 'languages', 'other', 'companies', 'products', 'members'));
if (! $user->admin) accessforbidden();

View File

@ -75,7 +75,7 @@ if ($action == 'update')
llxHeader('',$langs->trans('SalariesSetup'));
$form = new Form($db);
if (! empty($conf->accounting->enabled)) $formaccounting = New FormAccounting($db);
if (! empty($conf->accounting->enabled)) $formaccounting = new FormAccounting($db);
$linkback='<a href="'.DOL_URL_ROOT.'/admin/modules.php?restore_lastsearch_values=1">'.$langs->trans("BackToModuleList").'</a>';
print load_fiche_titre($langs->trans('SalariesSetup'),$linkback,'title_setup');

View File

@ -4,7 +4,7 @@
* Copyright (C) 2004-2013 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2012 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2012 Florian Henry <florian.henry@open-concept.pro>
* Copyright (C) 2013 Philippe Grand <philippe.grand@atoo-net.com>
* Copyright (C) 2013-2018 Philippe Grand <philippe.grand@atoo-net.com>
* Copyright (C) 2013 Juanjo Menent <jmenent@2byte.es>
*
* This program is free software; you can redistribute it and/or modify
@ -32,17 +32,11 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/fourn.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php';
// Load translation files required by the page
$langs->load("orders");
$langs->loadLangs(array("admin", "other", "bills", "orders", "suppliers"));
if (!$user->admin)
accessforbidden();
$langs->load("admin");
$langs->load("other");
$langs->load("bills");
$langs->load("orders");
$langs->load("suppliers");
$extrafields = new ExtraFields($db);
$form = new Form($db);

View File

@ -28,10 +28,8 @@ require '../../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
$langs->load("admin");
$langs->load("help");
$langs->load("members");
$langs->load("other");
// Load translation files required by the page
$langs->loadLangs(array("help","members","other","admin"));
$action=GETPOST('action','alpha');
@ -196,7 +194,7 @@ if ($showpromotemessage)
{
print '<br>';
print '<br>';
if ((empty($tmp[2]) && (strpos($tmp[1], '0') === 0)) || (strpos($tmp[2], '0') === 0))
{
print $langs->trans("TitleExampleForMajorRelease").':<br>';

View File

@ -26,9 +26,8 @@ require '../../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/memory.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
$langs->load("admin");
$langs->load("install");
$langs->load("other");
// Load translation files required by the page
$langs->loadLangs(array("install","other","admin"));
if (! $user->admin)
accessforbidden();

View File

@ -24,9 +24,8 @@
require '../../main.inc.php';
$langs->load("admin");
$langs->load("user");
$langs->load("install");
// Load translation files required by the page
$langs->loadLangs(array("install","user","admin"));
if (!$user->admin)

View File

@ -29,9 +29,8 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/geturl.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
$langs->load("admin");
$langs->load("install");
$langs->load("other");
// Load translation files required by the page
$langs->loadLangs(array("install","other","admin"));
$action=GETPOST('action','alpha');

View File

@ -422,7 +422,7 @@ if (! $error && $xml)
$outcurrentchecksum = '<span class="'.$resultcode.'">'.$checksumget.'</span>';
}
print_fiche_titre($langs->trans("GlobalChecksum")).'<br>';
print load_fiche_titre($langs->trans("GlobalChecksum")).'<br>';
print $langs->trans("ExpectedChecksum").' = '. $outexpectedchecksum .'<br>';
print $langs->trans("CurrentChecksum").' = '. $outcurrentchecksum;
@ -438,4 +438,3 @@ llxFooter();
$db->close();
exit($error);

View File

@ -25,9 +25,8 @@
require '../../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
$langs->load("admin");
$langs->load("install");
$langs->load("other");
// Load translation files required by the page
$langs->loadLangs(array("install","other","admin"));
if (! $user->admin)
accessforbidden();

View File

@ -26,9 +26,8 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/geturl.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
$langs->load("admin");
$langs->load("install");
$langs->load("other");
// Load translation files required by the page
$langs->loadLangs(array("install","other","admin"));
if (! $user->admin)
accessforbidden();

View File

@ -24,8 +24,8 @@
require '../../main.inc.php';
$langs->load("admin");
$langs->load("other");
// Load translation files required by the page
$langs->loadLangs(array("other","admin"));
if (! $user->admin)
accessforbidden();

View File

@ -24,8 +24,8 @@
require '../../main.inc.php';
$langs->load("admin");
$langs->load("companies");
// Load translation files required by the page
$langs->loadLangs(array("companies","admin"));
if (! $user->admin)
accessforbidden();

View File

@ -2,6 +2,7 @@
/* Copyright (C) 2004-2017 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2015 Bahfir Abbes <bafbes@gmail.com>
* Copyright (C) 2018 Frédéric France <frederic.france@netlogic.fr>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -40,10 +41,8 @@ if ($user->societe_id > 0)
$socid = $user->societe_id;
}
$langs->load("admin");
$langs->load("companies");
$langs->load("users");
$langs->load("other");
// Load translation files required by the page
$langs->loadLangs(array("companies","admin","users","other"));
// Load variable for pagination
$limit = GETPOST('limit','int')?GETPOST('limit','int'):$conf->liste_limit;
@ -237,7 +236,7 @@ if ($result)
// Lignes des champs de filtres
print '<tr class="liste_titre">';
print '<td class="liste_titre" width="15%">'.$form->select_date($date_start,'date_start',0,0,0,'',1,0,1).$form->select_date($date_end,'date_end',0,0,0,'',1,0,1).'</td>';
print '<td class="liste_titre" width="15%">'.$form->selectDate($date_start,'date_start',0,0,0,'',1,0).$form->selectDate($date_end,'date_end',0,0,0,'',1,0).'</td>';
print '<td align="left" class="liste_titre">';
print '<input class="flat" type="text" size="10" name="search_code" value="'.$search_code.'">';

View File

@ -25,7 +25,8 @@
require '../../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
$langs->load("install");
// Load translation files required by the page
$langs->loadLangs(array("companies","install","users","other"));
if (! $user->admin)
accessforbidden();
@ -40,10 +41,6 @@ if ($user->societe_id > 0)
$socid = $user->societe_id;
}
$langs->load("companies");
$langs->load("users");
$langs->load("other");
$sortfield = GETPOST("sortfield",'alpha');
$sortorder = GETPOST("sortorder",'alpha');
$page = GETPOST("page",'int');

View File

@ -27,8 +27,8 @@ require_once DOL_DOCUMENT_ROOT . '/core/lib/admin.lib.php';
require_once DOL_DOCUMENT_ROOT . '/core/lib/files.lib.php';
require_once DOL_DOCUMENT_ROOT . '/core/lib/geturl.lib.php';
$langs->load("admin");
$langs->load("other");
// Load translation files required by the page
$langs->loadLangs(array("admin","other"));
$action=GETPOST('action','alpha');
@ -76,7 +76,7 @@ print $langs->trans("CurrentVersion").' : <strong>'.DOL_VERSION.'</strong><br>';
if (function_exists('curl_init'))
{
$conf->global->MAIN_USE_RESPONSE_TIMEOUT = 10;
if ($action == 'getlastversion')
{
if ($sfurl)
@ -95,7 +95,7 @@ if (function_exists('curl_init'))
}
$i++;
}
// Show version
print $langs->trans("LastStableVersion").' : <b>'. (($version != '0.0')?$version:$langs->trans("Unknown")) .'</b><br>';
}

View File

@ -271,15 +271,16 @@ class DolibarrApi
return true;
}
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/**
* Function to forge a SQL criteria
*
* @param array $matches Array of found string by regex search
* @return string Forged criteria. Example: "t.field like 'abc%'"
*/
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
static function _forge_criteria_callback($matches)
{
// phpcs:enable
global $db;
//dol_syslog("Convert matches ".$matches[1]);

View File

@ -59,15 +59,16 @@ class DolibarrApiAccess implements iAuthenticate
*/
public static $user = '';
// phpcs:disable PEAR.NamingConventions.ValidFunctionName
/**
* Check access
*
* @return bool
* @throws RestException
*/
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName
public function __isAllowed()
{
// phpcs:enable
global $conf, $db;
$login = '';
@ -165,15 +166,16 @@ class DolibarrApiAccess implements iAuthenticate
return in_array(static::$role, (array) $requirefortest) || static::$role == 'admin';
}
// phpcs:disable PEAR.NamingConventions.ValidFunctionName
/**
* @return string string to be used with WWW-Authenticate header
* @example Basic
* @example Digest
* @example OAuth
*/
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName
public function __getWWWAuthenticateString()
{
// phpcs:enable
return '';
}

View File

@ -95,18 +95,36 @@ class Asset extends CommonObject
'import_key' => array('type'=>'varchar(14)', 'label'=>'ImportId', 'visible'=>-2, 'enabled'=>1, 'position'=>1000, 'notnull'=>-1,),
'status' => array('type'=>'integer', 'label'=>'Status', 'visible'=>1, 'enabled'=>1, 'position'=>1000, 'notnull'=>1, 'index'=>1, 'arrayofkeyval'=>array('0'=>'Draft', '1'=>'Active', '-1'=>'Cancel')),
);
/**
* @var int ID
*/
public $rowid;
/**
* @var string Ref
*/
public $ref;
public $entity;
/**
* @var string proper name for given parameter
*/
public $label;
* @var string Asset label
*/
public $label;
public $amount;
public $fk_soc;
/**
* @var int Thirdparty ID
*/
public $fk_soc;
/**
* @var string description
*/
public $description;
public $note_public;
public $note_private;
public $date_creation;
@ -338,6 +356,7 @@ class Asset extends CommonObject
return $this->LibStatut($this->status,$mode);
}
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/**
* Return the status
*
@ -345,43 +364,37 @@ class Asset extends CommonObject
* @param int $mode 0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=Short label + Picto, 6=Long label + Picto
* @return string Label of status
*/
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
static function LibStatut($status,$mode=0)
{
// phpcs:enable
global $langs;
if ($mode == 0)
{
$prefix='';
if ($status == 1) return $langs->trans('Enabled');
if ($status == 0) return $langs->trans('Disabled');
}
if ($mode == 1)
if ($mode == 0 || $mode == 1)
{
if ($status == 1) return $langs->trans('Enabled');
if ($status == 0) return $langs->trans('Disabled');
}
if ($mode == 2)
elseif ($mode == 2)
{
if ($status == 1) return img_picto($langs->trans('Enabled'),'statut4').' '.$langs->trans('Enabled');
if ($status == 0) return img_picto($langs->trans('Disabled'),'statut5').' '.$langs->trans('Disabled');
}
if ($mode == 3)
elseif ($mode == 3)
{
if ($status == 1) return img_picto($langs->trans('Enabled'),'statut4');
if ($status == 0) return img_picto($langs->trans('Disabled'),'statut5');
}
if ($mode == 4)
elseif ($mode == 4)
{
if ($status == 1) return img_picto($langs->trans('Enabled'),'statut4').' '.$langs->trans('Enabled');
if ($status == 0) return img_picto($langs->trans('Disabled'),'statut5').' '.$langs->trans('Disabled');
}
if ($mode == 5)
elseif ($mode == 5)
{
if ($status == 1) return $langs->trans('Enabled').' '.img_picto($langs->trans('Enabled'),'statut4');
if ($status == 0) return $langs->trans('Disabled').' '.img_picto($langs->trans('Disabled'),'statut5');
}
if ($mode == 6)
elseif ($mode == 6)
{
if ($status == 1) return $langs->trans('Enabled').' '.img_picto($langs->trans('Enabled'),'statut4');
if ($status == 0) return $langs->trans('Disabled').' '.img_picto($langs->trans('Disabled'),'statut5');

View File

@ -33,25 +33,34 @@ class AssetType extends CommonObject
* @var string Name of table without prefix where object is stored
*/
public $table_element = 'asset_type';
/**
* @var string ID to identify managed object
*/
public $element = 'asset_type';
/**
* @var string String with name of icon for myobject. Must be the part after the 'object_' into object_myobject.png
*/
public $picto = 'group';
public $ismultientitymanaged = 1; // 0=No test on entity, 1=Test with field entity, 2=Test with link by societe
/** @var string Label */
public $label;
/** @var string Accountancy code asset */
public $accountancy_code_asset;
/** @var string Accountancy code depreciation asset */
public $accountancy_code_depreciation_asset;
/** @var string Accountancy code depreciation expense */
public $accountancy_code_depreciation_expense;
/** @var string Public note */
public $note;
/** @var array Array of asset */
public $asset=array();
@ -282,14 +291,15 @@ class AssetType extends CommonObject
}
}
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/**
* Return list of asset's type
*
* @return array List of types of members
*/
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function liste_array()
{
// phpcs:enable
global $conf,$langs;
$assettypes = array();

View File

@ -178,19 +178,19 @@ if ($action == 'builddoc')
{
// List of values to scan for a replacement
$substitutionarray = array (
'%LOGIN%'=>$user->login,
'%COMPANY%'=>$mysoc->name,
'%ADDRESS%'=>$mysoc->address,
'%ZIP%'=>$mysoc->zip,
'%TOWN%'=>$mysoc->town,
'%COUNTRY%'=>$mysoc->country,
'%COUNTRY_CODE%'=>$mysoc->country_code,
'%EMAIL%'=>$mysoc->email,
'%YEAR%'=>$year,
'%MONTH%'=>$month,
'%DAY%'=>$day,
'%DOL_MAIN_URL_ROOT%'=>DOL_MAIN_URL_ROOT,
'%SERVER%'=>"http://".$_SERVER["SERVER_NAME"]."/"
'%LOGIN%' => $user->login,
'%COMPANY%' => $mysoc->name,
'%ADDRESS%' => $mysoc->address,
'%ZIP%' => $mysoc->zip,
'%TOWN%' => $mysoc->town,
'%COUNTRY%' => $mysoc->country,
'%COUNTRY_CODE%' => $mysoc->country_code,
'%EMAIL%' => $mysoc->email,
'%YEAR%' => $year,
'%MONTH%' => $month,
'%DAY%' => $day,
'%DOL_MAIN_URL_ROOT%' => DOL_MAIN_URL_ROOT,
'%SERVER%' => "http://".$_SERVER["SERVER_NAME"]."/",
);
complete_substitutions_array($substitutionarray, $langs);
@ -416,7 +416,7 @@ print $langs->trans("BarcodeType").' &nbsp; ';
print '</div><div class="tagtd" style="overflow: hidden; white-space: nowrap; max-width: 300px;">';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formbarcode.class.php';
$formbarcode = new FormBarCode($db);
$formbarcode->select_barcode_type($fk_barcode_type, 'fk_barcode_type', 1);
print $formbarcode->selectBarcodeType($fk_barcode_type, 'fk_barcode_type', 1);
print '</div></div>';
// Barcode value

View File

@ -1,6 +1,7 @@
<?php
/* Copyright (C) 2017 ATM Consulting <contact@atm-consulting.fr>
* Copyright (C) 2017-2018 Laurent Destailleur <eldy@destailleur.fr>
/* Copyright (C) 2017 ATM Consulting <contact@atm-consulting.fr>
* Copyright (C) 2017-2018 Laurent Destailleur <eldy@destailleur.fr>
* Copyright (C) 2018 Frédéric France <frederic.france@netlogic.fr>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -372,10 +373,10 @@ print '<td class="liste_titre">&nbsp;</td>';
print '<td class="liste_titre">';
//print $langs->trans("from").': ';
$form->select_date($search_start,'search_start');
print $form->selectDate($search_start,'search_start');
//print '<br>';
//print $langs->trans("to").': ';
$form->select_date($search_end,'search_end');
print $form->selectDate($search_end,'search_end');
print '</td>';
// User

View File

@ -39,6 +39,7 @@ class BlockedLog
* @var int
*/
public $id;
/**
* Entity
* @var int
@ -46,7 +47,7 @@ class BlockedLog
public $entity;
public $error = '';
/**
* @var string[] Error codes (or messages)
*/

View File

@ -29,17 +29,21 @@
class Bookmark extends CommonObject
{
/**
* @var string ID to identify managed object
*/
public $element='bookmark';
* @var string ID to identify managed object
*/
public $element='bookmark';
/**
* @var string Name of table without prefix where object is stored
*/
public $table_element='bookmark';
public $ismultientitymanaged = 1; // 0=No test on entity, 1=Test with field entity, 2=Test with link by societe
public $picto = 'bookmark';
/**
* @var string String with name of icon for myobject. Must be the part after the 'object_' into object_myobject.png
*/
public $picto = 'bookmark';
/**
* @var DoliDB Database handler.
@ -50,14 +54,18 @@ class Bookmark extends CommonObject
* @var int ID
*/
public $id;
var $fk_user;
var $datec;
var $url;
var $target; // 0=replace, 1=new window
var $title;
var $position;
var $favicon;
/**
* @var int User ID
*/
public $fk_user;
public $datec;
public $url;
public $target; // 0=replace, 1=new window
public $title;
public $position;
public $favicon;
/**

View File

@ -36,9 +36,8 @@ if ( $_SESSION['uid'] <= 0 )
exit;
}
$langs->load("companies");
$langs->load("compta");
$langs->load("cashdesk");
// Load translation files required by the page
$langs->loadLangs(array("companies","compta","cashdesk"));
/*

View File

@ -37,7 +37,12 @@ class Facturation
* int $prix => Prix HT du produit en cours
* int $tva => 'rowid' du taux de tva dans llx_c_tva
*/
public $id;
/**
* @var int ID
*/
public $id;
protected $ref;
protected $qte;
protected $stock;

View File

@ -28,8 +28,8 @@
require_once '../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/product/class/html.formproduct.class.php';
$langs->load("admin");
$langs->load("cashdesk");
// Load translation files required by the page
$langs->loadLangs(array("admin","cashdesk"));
// Test if user logged
if ( $_SESSION['uid'] > 0 )
@ -63,7 +63,7 @@ top_htmlhead('','',0,0,'',$arrayofcss);
<?php
if (! empty($mysoc->logo_small))
{
print '<img class="logopos" alt="Logo company" src="'.DOL_URL_ROOT.'/viewimage.php?modulepart=mycompany&amp;file='.urlencode('/thumbs/'.$mysoc->logo_small).'">';
print '<img class="logopos" alt="Logo company" src="'.DOL_URL_ROOT.'/viewimage.php?modulepart=mycompany&amp;file='.urlencode('logos/thumbs/'.$mysoc->logo_small).'">';
}
else
{

View File

@ -30,9 +30,8 @@ include '../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/cashdesk/include/environnement.php';
require_once DOL_DOCUMENT_ROOT.'/cashdesk/class/Auth.class.php';
$langs->load("main");
$langs->load("admin");
$langs->load("cashdesk");
// Load translation files required by the page
$langs->loadLangs(array("main","admin","cashdesk"));
$username = GETPOST("txtUsername");
$password = GETPOST("pwdPassword");
@ -119,7 +118,7 @@ if ( $retour >= 0 )
$_SESSION['firstname'] = $tab['firstname'];
$_SESSION['CASHDESK_ID_THIRDPARTY'] = ($thirdpartyid > 0 ? $thirdpartyid : '');
$_SESSION['CASHDESK_ID_WAREHOUSE'] = ($warehouseid > 0 ? $warehouseid : '');
$_SESSION['CASHDESK_ID_BANKACCOUNT_CASH'] = ($bankid_cash > 0 ? $bankid_cash : '');
$_SESSION['CASHDESK_ID_BANKACCOUNT_CHEQUE'] = ($bankid_cheque > 0 ? $bankid_cheque : '');
$_SESSION['CASHDESK_ID_BANKACCOUNT_CB'] = ($bankid_cb > 0 ? $bankid_cb : '');
@ -135,8 +134,8 @@ if ( $retour >= 0 )
}
else
{
$langs->load("errors");
$langs->load("other");
// Load translation files required by the page
$langs->loadLangs(array("other","errors"));
$retour=$langs->trans("ErrorBadLoginPassword");
header('Location: '.DOL_URL_ROOT.'/cashdesk/index.php?err='.urlencode($retour).'&user='.$username.'&socid='.$thirdpartyid.'&warehouseid='.$warehouseid);
exit;

View File

@ -3,6 +3,7 @@
* Copyright (C) 2011 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2011 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2015 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2018 Frédéric France <frederic.france@netlogic.fr>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -26,10 +27,8 @@ if (empty($langs) || ! is_object($langs))
exit;
}
$langs->load("main");
$langs->load("bills");
$langs->load("cashdesk");
// Load translation files required by the page
$langs->loadLangs(array("main","bills","cashdesk"));
// Object $form must de defined
@ -204,7 +203,7 @@ $langs->load("cashdesk");
<input class="button bouton_mode_reglement" type="submit" name="btnModeReglement" value="<?php echo $langs->trans("Reported"); ?>" onclick="javascript: verifClic('DIF');" />
<?php
print $langs->trans("DateDue").' :';
print $form->select_date(-1,'txtDatePaiement',0,0,0,'paymentmode',1,0,1);
print $form->selectDate(-1,'txtDatePaiement',0,0,0,'paymentmode',1,0);
print '</div>';
?>
</div>

View File

@ -28,9 +28,8 @@ if (empty($langs) || ! is_object($langs))
require_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php';
require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
$langs->load("main");
$langs->load("bills");
$langs->load("cashdesk");
// Load translation files required by the page
$langs->loadLangs(array("main","bills","cashdesk"));
?>

View File

@ -63,9 +63,8 @@ if (!empty($_SESSION["CASHDESK_ID_WAREHOUSE"]) && ! empty($conf->stock->enabled)
$warehouseLink = $warehouse->getNomUrl(1);
}
$langs->load("cashdesk");
$langs->load("main");
// Load translation files required by the page
$langs->loadLangs(array("main","cashdesk"));
print "\n".'<!-- menu.tpl.php -->'."\n";
print '<div class="menu_bloc">';

View File

@ -27,8 +27,8 @@ if (empty($langs) || ! is_object($langs))
include_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
$langs->load("main");
$langs->load('cashdesk');
// Load translation files required by the page
$langs->loadLangs(array("main","cashdesk"));
top_httphead('text/html');
@ -47,7 +47,7 @@ $object->fetch($facid);
<div class="entete">
<div class="logo">
<?php print '<img src="'.DOL_URL_ROOT.'/viewimage.php?modulepart=mycompany&amp;file='.urlencode('/thumbs/'.$mysoc->logo_small).'">'; ?>
<?php print '<img src="'.DOL_URL_ROOT.'/viewimage.php?modulepart=mycompany&amp;file='.urlencode('logos/thumbs/'.$mysoc->logo_small).'">'; ?>
</div>
<div class="infos">
<p class="address"><?php echo $mysoc->name; ?><br>

View File

@ -23,10 +23,8 @@ if (empty($langs) || ! is_object($langs))
exit;
}
$langs->load("main");
$langs->load("bills");
$langs->load("banks");
// Load translation files required by the page
$langs->loadLangs(array("main","bills","banks"));
// Object $form must de defined

View File

@ -24,9 +24,8 @@ if (empty($langs) || ! is_object($langs))
exit;
}
$langs->load("main");
$langs->load("bills");
// Load translation files required by the page
$langs->loadLangs(array("main","bills"));
?>

View File

@ -51,8 +51,11 @@ class Categorie extends CommonObject
const TYPE_USER = 'user';
const TYPE_PROJECT = 'project';
const TYPE_ACCOUNT = 'bank_account';
const TYPE_BANK_LINE = 'bank_line';
const TYPE_BANK_LINE = 'bank_line';
/**
* @var string String with name of icon for myobject. Must be the part after the 'object_' into object_myobject.png
*/
public $picto = 'category';
@ -161,11 +164,15 @@ class Categorie extends CommonObject
public $fk_parent;
/**
* @var string proper name for given parameter
* @var string Category label
*/
public $label;
public $label;
/**
* @var string description
*/
public $description;
/**
* @var string Color
*/
@ -510,112 +517,27 @@ class Categorie extends CommonObject
$error++;
}
}
if (! $error)
{
$sql = "DELETE FROM ".MAIN_DB_PREFIX."categorie_societe";
$sql .= " WHERE fk_categorie = ".$this->id;
if (!$this->db->query($sql))
{
$this->error=$this->db->lasterror();
$error++;
}
}
if (! $error)
{
$sql = "DELETE FROM ".MAIN_DB_PREFIX."categorie_fournisseur";
$sql .= " WHERE fk_categorie = ".$this->id;
if (!$this->db->query($sql))
{
$this->error=$this->db->lasterror();
$error++;
}
}
if (! $error)
{
$sql = "DELETE FROM ".MAIN_DB_PREFIX."categorie_product";
$sql .= " WHERE fk_categorie = ".$this->id;
if (!$this->db->query($sql))
{
$this->error=$this->db->lasterror();
$error++;
}
}
if (! $error)
{
$sql = "DELETE FROM ".MAIN_DB_PREFIX."categorie_member";
$sql .= " WHERE fk_categorie = ".$this->id;
if (!$this->db->query($sql))
{
$this->error=$this->db->lasterror();
$error++;
}
}
if (! $error)
{
$sql = "DELETE FROM ".MAIN_DB_PREFIX."categorie_contact";
$sql .= " WHERE fk_categorie = ".$this->id;
if (!$this->db->query($sql))
{
$this->error=$this->db->lasterror();
$error++;
}
}
if (! $error)
{
$sql = "DELETE FROM ".MAIN_DB_PREFIX."categorie_contact";
$sql .= " WHERE fk_categorie = ".$this->id;
if (!$this->db->query($sql))
{
$this->error=$this->db->lasterror();
$error++;
}
}
if (! $error)
{
$sql = "DELETE FROM ".MAIN_DB_PREFIX."categorie_account";
$sql .= " WHERE fk_categorie = ".$this->id;
if (!$this->db->query($sql))
{
$this->error=$this->db->lasterror();
dol_syslog("Error sql=".$sql." ".$this->error, LOG_ERR);
$error++;
}
}
if (! $error)
{
$sql = "DELETE FROM ".MAIN_DB_PREFIX."bank_class";
$sql .= " WHERE fk_categ = ".$this->id;
if (!$this->db->query($sql))
{
$this->error=$this->db->lasterror();
dol_syslog("Error sql=".$sql." ".$this->error, LOG_ERR);
$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)
{
$sql = "DELETE FROM ".MAIN_DB_PREFIX."categorie";
$sql .= " WHERE rowid = ".$this->id;
if (!$this->db->query($sql))
{
$this->error=$this->db->lasterror();
$error++;
}
}
$arraydelete = array(
'categorie_societe' => 'fk_categorie',
'categorie_fournisseur' => 'fk_categorie',
'categorie_product' => 'fk_categorie',
'categorie_member' => 'fk_categorie',
'categorie_contact' => 'fk_categorie',
'categorie_account' => 'fk_categorie',
'bank_class' => 'fk_categ',
'categorie_lang' => 'fk_category',
'categorie' => 'rowid',
);
foreach ($arraydelete as $key => $value) {
$sql = "DELETE FROM " . MAIN_DB_PREFIX . $key;
$sql .= " WHERE ".$value." = ".$this->id;
if (!$this->db->query($sql)) {
$this->errors[] = $this->db->lasterror();
dol_syslog("Error sql=".$sql." ".$this->error, LOG_ERR);
$error++;
}
}
// Removed extrafields
if (! $error && empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) // For avoid conflicts if trigger used
@ -640,6 +562,7 @@ class Categorie extends CommonObject
}
}
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/**
* Link an object to the category
*
@ -647,9 +570,9 @@ class Categorie extends CommonObject
* @param string $type Type of category ('product', ...)
* @return int 1 : OK, -1 : erreur SQL, -2 : id not defined, -3 : Already linked
*/
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function add_type($obj, $type)
{
// phpcs:enable
global $user,$langs,$conf;
$error=0;
@ -742,6 +665,7 @@ class Categorie extends CommonObject
}
}
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/**
* Delete object from category
*
@ -750,9 +674,9 @@ class Categorie extends CommonObject
*
* @return int 1 if OK, -1 if KO
*/
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function del_type($obj,$type)
{
// phpcs:enable
global $user,$langs,$conf;
$error=0;
@ -966,14 +890,15 @@ class Categorie extends CommonObject
return $categories;
}
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/**
* Return childs of a category
*
* @return array|int <0 KO, array ok
*/
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function get_filles()
{
// phpcs:enable
$sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."categorie";
$sql.= " WHERE fk_parent = ".$this->id;
@ -996,14 +921,15 @@ class Categorie extends CommonObject
}
}
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/**
* Load this->motherof that is array(id_son=>id_parent, ...)
*
* @return int <0 if KO, >0 if OK
*/
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
private function load_motherof()
{
// phpcs:enable
global $conf;
$this->motherof=array();
@ -1031,6 +957,7 @@ class Categorie extends CommonObject
}
}
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/**
* Rebuilding the category tree as an array
* Return an array of table('id','id_mere',...) trie selon arbre et avec:
@ -1046,9 +973,9 @@ class Categorie extends CommonObject
*
* @return array Array of categories. this->cats and this->motherof are set.
*/
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function get_full_arbo($type, $markafterid=0)
{
// phpcs:enable
global $conf, $langs;
if (! is_numeric($type)) $type = $this->MAP_ID[$type];
@ -1123,6 +1050,7 @@ class Categorie extends CommonObject
return $this->cats;
}
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/**
* For category id_categ and its childs available in this->cats, define property fullpath and fulllabel
*
@ -1130,9 +1058,9 @@ class Categorie extends CommonObject
* @param int $protection Deep counter to avoid infinite loop
* @return void
*/
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function build_path_from_id_categ($id_categ,$protection=1000)
{
// phpcs:enable
dol_syslog(get_class($this)."::build_path_from_id_categ id_categ=".$id_categ." protection=".$protection, LOG_DEBUG);
if (! empty($this->cats[$id_categ]['fullpath']))
@ -1166,14 +1094,15 @@ class Categorie extends CommonObject
return;
}
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/**
* Display content of $this->cats
*
* @return void
*/
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function debug_cats()
{
// phpcs:enable
// Display $this->cats
foreach($this->cats as $key => $val)
{
@ -1188,6 +1117,7 @@ class Categorie extends CommonObject
}
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/**
* Returns all categories
*
@ -1195,9 +1125,9 @@ class Categorie extends CommonObject
* @param boolean $parent Just parent categories if true
* @return array Table of Object Category
*/
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function get_all_categories($type=null, $parent=false)
{
// phpcs:enable
if (! is_numeric($type)) $type = $this->MAP_ID[$type];
$sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."categorie";
@ -1226,14 +1156,15 @@ class Categorie extends CommonObject
}
}
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/**
* Check if no category with same label already exists for this cat's parent or root and for this cat's type
*
* @return integer 1 if already exist, 0 otherwise, -1 if error
*/
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function already_exists()
{
// phpcs:enable
$type=$this->type;
if (! is_numeric($type)) $type=$this->MAP_ID[$type];
@ -1276,18 +1207,20 @@ class Categorie extends CommonObject
}
}
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/**
* Returns the top level categories (which are not girls)
*
* @param int $type Type of category (0, 1, ...)
* @return array
*/
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function get_main_categories($type=null)
{
// phpcs:enable
return $this->get_all_categories($type, true);
}
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/**
* Returns the path of the category, with the names of the categories
* separated by $sep (" >> " by default)
@ -1297,9 +1230,9 @@ class Categorie extends CommonObject
* @param int $nocolor 0
* @return array
*/
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function print_all_ways($sep = " &gt;&gt; ", $url='', $nocolor=0)
{
// phpcs:enable
$ways = array();
$allways = $this->get_all_ways(); // Load array of categories
@ -1346,14 +1279,15 @@ class Categorie extends CommonObject
}
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/**
* Returns an array containing the list of parent categories
*
* @return int|array <0 KO, array OK
*/
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function get_meres()
{
// phpcs:enable
$parents = array();
$sql = "SELECT fk_parent FROM ".MAIN_DB_PREFIX."categorie";
@ -1381,15 +1315,16 @@ class Categorie extends CommonObject
}
}
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/**
* Returns in a table all possible paths to get to the category
* starting with the major categories represented by Tables of categories
*
* @return array
*/
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function get_all_ways()
{
// phpcs:enable
$ways = array();
$parents=$this->get_meres();
@ -1596,6 +1531,7 @@ class Categorie extends CommonObject
}
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/**
* Deplace fichier uploade sous le nom $files dans le repertoire sdir
*
@ -1603,9 +1539,9 @@ class Categorie extends CommonObject
* @param string $file Nom du fichier uploade
* @return void
*/
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function add_photo($sdir, $file)
{
// phpcs:enable
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
$dir = $sdir .'/'. get_exdir($this->id,2,0,0,$this,'category') . $this->id ."/";
@ -1646,6 +1582,7 @@ class Categorie extends CommonObject
}
}
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/**
* Return tableau de toutes les photos de la categorie
*
@ -1653,9 +1590,9 @@ class Categorie extends CommonObject
* @param int $nbmax Nombre maximum de photos (0=pas de max)
* @return array Tableau de photos
*/
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function liste_photos($dir,$nbmax=0)
{
// phpcs:enable
include_once DOL_DOCUMENT_ROOT .'/core/lib/files.lib.php';
$nbphoto=0;
@ -1702,15 +1639,16 @@ class Categorie extends CommonObject
return $tabobj;
}
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/**
* Efface la photo de la categorie et sa vignette
*
* @param string $file Path to file
* @return void
*/
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function delete_photo($file)
{
// phpcs:enable
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
$dir = dirname($file).'/'; // Chemin du dossier contenant l'image d'origine
@ -1731,15 +1669,16 @@ class Categorie extends CommonObject
}
}
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/**
* Load size of image file
*
* @param string $file Path to file
* @return void
*/
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function get_image_size($file)
{
// phpcs:enable
$infoImg = getimagesize($file); // Recuperation des infos de l'image
$this->imgWidth = $infoImg[0]; // Largeur de l'image
$this->imgHeight = $infoImg[1]; // Hauteur de l'image

View File

@ -28,9 +28,8 @@ require '../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
$langs->load("admin");
$langs->load("other");
$langs->load("website");
// Load translation files required by the page
$langs->loadLangs(array("admin","other","website"));
if (! $user->admin) accessforbidden();

View File

@ -6,7 +6,8 @@
* Copyright (C) 2010-2013 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
* Copyright (C) 2014 Cedric GROSS <c.gross@kreiz-it.fr>
* Copyright (C) 2015 Alexandre Spangaro <aspangaro.dolibarr@gmail.com>
* Copyright (C) 2015 Alexandre Spangaro <aspangaro.dolibarr@gmail.com>
* Copyright (C) 2018 Frédéric France <frederic.france@netlogic.fr>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -689,9 +690,13 @@ if ($action == 'create')
$datep=($datep?$datep:$object->datep);
if (GETPOST('datep','int',1)) $datep=dol_stringtotime(GETPOST('datep','int',1),0);
print '<tr><td class="nowrap"><span class="fieldrequired">'.$langs->trans("DateActionStart").'</span></td><td>';
if (GETPOST("afaire") == 1) $form->select_date($datep,'ap',1,1,0,"action",1,1,0,0,'fulldayend');
else if (GETPOST("afaire") == 2) $form->select_date($datep,'ap',1,1,1,"action",1,1,0,0,'fulldayend');
else $form->select_date($datep,'ap',1,1,1,"action",1,1,0,0,'fulldaystart');
if (GETPOST("afaire") == 1) {
print $form->selectDate($datep, 'ap', 1, 1, 0, "action", 1, 1, 0, 'fulldayend');
} elseif (GETPOST("afaire") == 2) {
print $form->selectDate($datep, 'ap', 1, 1, 1, "action", 1, 1, 0, 'fulldayend');
} else {
print $form->selectDate($datep, 'ap', 1, 1, 1, "action", 1, 1, 0, 'fulldaystart');
}
print '</td></tr>';
// Date end
@ -702,12 +707,17 @@ if ($action == 'create')
$datef=dol_time_plus_duree($datep, $conf->global->AGENDA_AUTOSET_END_DATE_WITH_DELTA_HOURS, 'h');
}
print '<tr><td><span id="dateend"'.(GETPOST("actioncode") == 'AC_RDV'?' class="fieldrequired"':'').'>'.$langs->trans("DateActionEnd").'</span></td><td>';
if (GETPOST("afaire") == 1) $form->select_date($datef,'p2',1,1,1,"action",1,1,0,0,'fulldayend');
else if (GETPOST("afaire") == 2) $form->select_date($datef,'p2',1,1,1,"action",1,1,0,0,'fulldayend');
else $form->select_date($datef,'p2',1,1,1,"action",1,1,0,0,'fulldayend');
if (GETPOST("afaire") == 1) {
print $form->selectDate($datef, 'p2', 1, 1, 1, "action", 1, 1, 0, 'fulldayend');
} elseif (GETPOST("afaire") == 2) {
print $form->selectDate($datef, 'p2', 1, 1, 1, "action", 1, 1, 0, 'fulldayend');
} else {
print $form->selectDate($datef, 'p2', 1, 1, 1, "action", 1, 1, 0, 'fulldayend');
}
print '</td></tr>';
$userepeatevent=($conf->global->MAIN_FEATURES_LEVEL == 2 ? 1 : 0); // Dev in progress
// Dev in progress
$userepeatevent=($conf->global->MAIN_FEATURES_LEVEL == 2 ? 1 : 0);
if ($userepeatevent)
{
// Repeat
@ -1057,30 +1067,38 @@ if ($id > 0)
// Date start
print '<tr><td class="nowrap"><span class="fieldrequired">'.$langs->trans("DateActionStart").'</span></td><td colspan="3">';
if (GETPOST("afaire") == 1) $form->select_date($datep?$datep:$object->datep,'ap',1,1,0,"action",1,1,0,0,'fulldaystart');
else if (GETPOST("afaire") == 2) $form->select_date($datep?$datep:$object->datep,'ap',1,1,1,"action",1,1,0,0,'fulldaystart');
else $form->select_date($datep?$datep:$object->datep,'ap',1,1,1,"action",1,1,0,0,'fulldaystart');
if (GETPOST("afaire") == 1) {
print $form->selectDate($datep?$datep:$object->datep, 'ap', 1, 1, 0, "action", 1, 1, 0, 'fulldaystart');
} elseif (GETPOST("afaire") == 2) {
print $form->selectDate($datep?$datep:$object->datep, 'ap', 1, 1, 1, "action", 1, 1, 0, 'fulldaystart');
} else {
print $form->selectDate($datep?$datep:$object->datep, 'ap', 1, 1, 1, "action", 1, 1, 0, 'fulldaystart');
}
print '</td></tr>';
// Date end
print '<tr><td>'.$langs->trans("DateActionEnd").'</td><td colspan="3">';
if (GETPOST("afaire") == 1) $form->select_date($datef?$datef:$object->datef,'p2',1,1,1,"action",1,1,0,0,'fulldayend');
else if (GETPOST("afaire") == 2) $form->select_date($datef?$datef:$object->datef,'p2',1,1,1,"action",1,1,0,0,'fulldayend');
//else $form->select_date($datef?$datef:$object->datef,'p2',1,1,1,"action",1,1,0,0,'fulldayend','ap');
else $form->select_date($datef?$datef:$object->datef,'p2',1,1,1,"action",1,1,0,0,'fulldayend');
if (GETPOST("afaire") == 1) {
print $form->selectDate($datef?$datef:$object->datef, 'p2', 1, 1, 1, "action", 1, 1, 0, 'fulldayend');
} elseif (GETPOST("afaire") == 2) {
print $form->selectDate($datef?$datef:$object->datef,'p2', 1, 1, 1, "action", 1, 1, 0, 'fulldayend');
} else {
print $form->selectDate($datef?$datef:$object->datef,'p2', 1, 1, 1, "action", 1, 1, 0, 'fulldayend');
}
print '</td></tr>';
$userepeatevent=($conf->global->MAIN_FEATURES_LEVEL == 2 ? 1 : 0); // Dev in progress
// Dev in progress
$userepeatevent=($conf->global->MAIN_FEATURES_LEVEL == 2 ? 1 : 0);
if ($userepeatevent)
{
// Repeat
print '<tr><td>'.$langs->trans("RepeatEvent").'</td><td colspan="3">';
print '<input type="hidden" name="recurid" value="'.$object->recurid.'">';
$arrayrecurrulefreq=array(
'no'=>$langs->trans("No"),
'MONTHLY'=>$langs->trans("EveryMonth"),
'WEEKLY'=>$langs->trans("EveryWeek"),
//'DAYLY'=>$langs->trans("EveryDay")
);
$arrayrecurrulefreq = array(
'no'=>$langs->trans("No"),
'MONTHLY'=>$langs->trans("EveryMonth"),
'WEEKLY'=>$langs->trans("EveryWeek"),
//'DAYLY'=>$langs->trans("EveryDay"),
);
$selectedrecurrulefreq='no';
$selectedrecurrulebymonthday='';
$selectedrecurrulebyday='';

View File

@ -35,24 +35,28 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/commonobject.class.php';
class ActionComm extends CommonObject
{
/**
* @var string ID to identify managed object
*/
public $element='action';
* @var string ID to identify managed object
*/
public $element='action';
/**
* @var string Name of table without prefix where object is stored
*/
public $table_element = 'actioncomm';
public $table_rowid = 'id';
public $picto='action';
/**
* @var string String with name of icon for myobject. Must be the part after the 'object_' into object_myobject.png
*/
public $picto = 'action';
/**
* 0=No test on entity, 1=Test with field entity, 2=Test with link by societe
* @var int
*/
public $ismultientitymanaged = 1;
/**
* 0=Default, 1=View may be restricted to sales representative only if no permission to see all or to company of external user if external user, 2=Same than 1 but accept record if fksoc is empty
* @var integer
@ -63,7 +67,7 @@ class ActionComm extends CommonObject
* Id of the event
* @var int
*/
public $id;
public $id;
/**
* Id of the event. Use $id as possible
@ -78,7 +82,7 @@ class ActionComm extends CommonObject
var $code; // Free code to identify action. Ie: Agenda trigger add here AC_TRIGGERNAME ('AC_COMPANY_CREATE', 'AC_PROPAL_VALIDATE', ...)
/**
* @var string proper name for given parameter
* @var string Agenda event label
*/
public $label;
@ -694,14 +698,15 @@ class ActionComm extends CommonObject
}
}
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/**
* Initialize this->userassigned array with list of id of user assigned to event
*
* @return int <0 if KO, >0 if OK
*/
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function fetch_userassigned()
{
// phpcs:enable
$sql ="SELECT fk_actioncomm, element_type, fk_element, answer_status, mandatory, transparency";
$sql.=" FROM ".MAIN_DB_PREFIX."actioncomm_resources";
$sql.=" WHERE element_type = 'user' AND fk_actioncomm = ".$this->id;
@ -1017,6 +1022,7 @@ class ActionComm extends CommonObject
}
}
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/**
* Load indicators for dashboard (this->nbtodo and this->nbtodolate)
*
@ -1024,10 +1030,10 @@ class ActionComm extends CommonObject
* @param int $load_state_board Charge indicateurs this->nb de tableau de bord
* @return WorkboardResponse|int <0 if KO, WorkboardResponse if OK
*/
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function load_board($user, $load_state_board=0)
{
global $conf, $langs;
// phpcs:enable
global $conf, $langs;
if(empty($load_state_board)) $sql = "SELECT a.id, a.datep as dp";
else {
@ -1142,6 +1148,7 @@ class ActionComm extends CommonObject
return $this->LibStatut($this->percentage,$mode,$hidenastatus,$this->datep);
}
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/**
* Return label of action status
*
@ -1151,9 +1158,9 @@ class ActionComm extends CommonObject
* @param int $datestart Date start of event
* @return string Label
*/
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function LibStatut($percent,$mode,$hidenastatus=0,$datestart='')
{
// phpcs:enable
global $langs;
if ($mode == 0)
@ -1351,6 +1358,7 @@ class ActionComm extends CommonObject
}
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/**
* Export events from database into a cal file.
*
@ -1361,9 +1369,9 @@ class ActionComm extends CommonObject
* @param array $filters Array of filters. Exemple array('notolderthan'=>99, 'year'=>..., 'idfrom'=>..., 'notactiontype'=>'systemauto', 'project'=>123, ...)
* @return int <0 if error, nb of events in new file if ok
*/
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function build_exportfile($format,$type,$cachedelay,$filename,$filters)
{
// phpcs:enable
global $conf,$langs,$dolibarr_main_url_root,$mysoc;
require_once DOL_DOCUMENT_ROOT ."/core/lib/xcal.lib.php";

View File

@ -34,17 +34,17 @@ class ActionCommReminder extends CommonObject
* @var string ID to identify managed object
*/
public $element = 'actioncomm_reminder';
/**
* @var string Name of table without prefix where object is stored
*/
public $table_element = 'actioncomm_reminder';
/**
* @var array Does actioncommreminder support multicompany module ? 0=No test on entity, 1=Test with field entity, 2=Test with link by societe
*/
public $ismultientitymanaged = 0;
/**
* @var string String with name of icon for actioncommreminder. Must be the part after the 'object_' into object_actioncommreminder.png
*/
@ -84,7 +84,12 @@ class ActionCommReminder extends CommonObject
public $rowid;
public $dateremind;
public $typeremind;
/**
* @var int User ID
*/
public $fk_user;
public $offsetvalue;
public $offsetunit;
public $status;
@ -168,6 +173,7 @@ class ActionCommReminder extends CommonObject
return $this->LibStatut($this->status,$mode);
}
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/**
* Return the status
*
@ -175,9 +181,9 @@ class ActionCommReminder extends CommonObject
* @param int $mode 0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=Short label + Picto, 6=Long label + Picto
* @return string Label of status
*/
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
static function LibStatut($status,$mode=0)
{
// phpcs:enable
global $langs;
if ($mode == 0 || $mode == 1)

View File

@ -219,7 +219,7 @@ class AgendaEvents extends DolibarrApi
/**
* Update Agenda Event general fields (won't touch lines of expensereport)
* Update Agenda Event general fields
*
* @param int $id Id of Agenda Event to update
* @param array $request_data Datas
@ -236,20 +236,20 @@ class AgendaEvents extends DolibarrApi
throw new RestException(401, "Insuffisant rights to create an Agenda Event for owner id ".$request_data['userownerid'].' Your id is '.DolibarrApiAccess::$user->id);
}
$result = $this->expensereport->fetch($id);
$result = $this->actioncomm->fetch($id);
if ( ! $result ) {
throw new RestException(404, 'expensereport not found');
throw new RestException(404, 'actioncomm not found');
}
if ( ! DolibarrApi::_checkAccessToResource('expensereport',$this->expensereport->id)) {
if ( ! DolibarrApi::_checkAccessToResource('actioncomm',$this->actioncomm->id)) {
throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login);
}
foreach($request_data as $field => $value) {
if ($field == 'id') continue;
$this->expensereport->$field = $value;
$this->actioncomm->$field = $value;
}
if ($this->expensereport->update($id, DolibarrApiAccess::$user,1,'','','update'))
if ($this->actioncomm->update($id, DolibarrApiAccess::$user,1,'','','update'))
return $this->get($id);
return false;

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