forked from Wavyzz/dolibarr
Merge branch 'develop' into toomanylines
This commit is contained in:
@@ -80,7 +80,7 @@ if ($idobject > 0)
|
|||||||
dol_print_error($db,$obj->error);
|
dol_print_error($db,$obj->error);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if ($obj->error == 'ErrorLoginAlreadyExists')
|
elseif ($obj->error == 'ErrorLoginAlreadyExists')
|
||||||
{
|
{
|
||||||
print "User with login ".$obj->login." already exists\n";
|
print "User with login ".$obj->login." already exists\n";
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -191,6 +191,15 @@
|
|||||||
<rule ref="Squiz.WhiteSpace.ControlStructureSpacing.SpacingBeforeClose" />
|
<rule ref="Squiz.WhiteSpace.ControlStructureSpacing.SpacingBeforeClose" />
|
||||||
|
|
||||||
<rule ref="Squiz.Functions.MultiLineFunctionDeclaration" />
|
<rule ref="Squiz.Functions.MultiLineFunctionDeclaration" />
|
||||||
|
<rule ref="Squiz.Functions.FunctionDeclarationArgumentSpacing">
|
||||||
|
<properties>
|
||||||
|
<property name="equalsSpacing" value="1"/>
|
||||||
|
</properties>
|
||||||
|
</rule>
|
||||||
|
<rule ref="Squiz.Functions.FunctionDeclarationArgumentSpacing.SpacingAfterHint">
|
||||||
|
<severity>0</severity>
|
||||||
|
</rule>
|
||||||
|
|
||||||
|
|
||||||
<!-- Rules from PEAR Standard -->
|
<!-- Rules from PEAR Standard -->
|
||||||
|
|
||||||
@@ -390,6 +399,10 @@
|
|||||||
</rule>
|
</rule>
|
||||||
<rule ref="PEAR.NamingConventions.ValidVariableName" />
|
<rule ref="PEAR.NamingConventions.ValidVariableName" />
|
||||||
|
|
||||||
|
<rule ref="PSR2.Classes.ClassDeclaration" />
|
||||||
|
<rule ref="PSR2.Methods.FunctionClosingBrace" />
|
||||||
|
<rule ref="PSR2.ControlStructures.ElseIfDeclaration.NotAllowed" />
|
||||||
|
|
||||||
<!-- This is not in PSR2 -->
|
<!-- This is not in PSR2 -->
|
||||||
<rule ref="PEAR.NamingConventions.ValidVariableName.PrivateNoUnderscore">
|
<rule ref="PEAR.NamingConventions.ValidVariableName.PrivateNoUnderscore">
|
||||||
<severity>0</severity>
|
<severity>0</severity>
|
||||||
|
|||||||
@@ -50,7 +50,7 @@ class autoTranslator
|
|||||||
* @param string $_apikey Api key
|
* @param string $_apikey Api key
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
function __construct($_destlang,$_refLang,$_langDir,$_limittofile,$_apikey)
|
function __construct($_destlang, $_refLang, $_langDir, $_limittofile, $_apikey)
|
||||||
{
|
{
|
||||||
|
|
||||||
// Set enviorment variables
|
// Set enviorment variables
|
||||||
@@ -156,7 +156,7 @@ class autoTranslator
|
|||||||
* @param string $my_destlang Target language code
|
* @param string $my_destlang Target language code
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
private function updateTranslationFile($destPath,$file,$my_destlang)
|
private function updateTranslationFile($destPath, $file, $my_destlang)
|
||||||
{
|
{
|
||||||
$this->_time_end = date('Y-m-d H:i:s');
|
$this->_time_end = date('Y-m-d H:i:s');
|
||||||
|
|
||||||
@@ -183,7 +183,7 @@ class autoTranslator
|
|||||||
* @param string $my_destlang Target language code
|
* @param string $my_destlang Target language code
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
private function createTranslationFile($path,$my_destlang)
|
private function createTranslationFile($path, $my_destlang)
|
||||||
{
|
{
|
||||||
$fp = fopen($path, 'w+');
|
$fp = fopen($path, 'w+');
|
||||||
fwrite($fp, "/*\n");
|
fwrite($fp, "/*\n");
|
||||||
@@ -205,7 +205,7 @@ class autoTranslator
|
|||||||
* @param string $my_destlang Language code (ie: fr_FR)
|
* @param string $my_destlang Language code (ie: fr_FR)
|
||||||
* @return int 0=Nothing translated, 1=Record translated
|
* @return int 0=Nothing translated, 1=Record translated
|
||||||
*/
|
*/
|
||||||
private function translateFileLine($content,$file,$key,$value,$my_destlang)
|
private function translateFileLine($content, $file, $key, $value, $my_destlang)
|
||||||
{
|
{
|
||||||
|
|
||||||
//print "key =".$key."\n";
|
//print "key =".$key."\n";
|
||||||
@@ -221,8 +221,8 @@ class autoTranslator
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ($key == 'CHARSET') $val=$this->_outputpagecode;
|
if ($key == 'CHARSET') $val=$this->_outputpagecode;
|
||||||
else if (preg_match('/^Format/',$key)) $val=$value;
|
elseif (preg_match('/^Format/',$key)) $val=$value;
|
||||||
else if ($value=='-') $val=$value;
|
elseif ($value=='-') $val=$value;
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// If not translated then translate
|
// If not translated then translate
|
||||||
|
|||||||
@@ -215,8 +215,8 @@ foreach ($dups as $string => $pages)
|
|||||||
$s.="\n";
|
$s.="\n";
|
||||||
|
|
||||||
if ($duplicateinsamefile) $sduplicateinsamefile .= $s;
|
if ($duplicateinsamefile) $sduplicateinsamefile .= $s;
|
||||||
else if ($inmain) $sinmainandother .= $s;
|
elseif ($inmain) $sinmainandother .= $s;
|
||||||
else if ($inadmin) $sininstallandadmin .= $s;
|
elseif ($inadmin) $sininstallandadmin .= $s;
|
||||||
else $sother .= $s;
|
else $sother .= $s;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -310,7 +310,7 @@ foreach($filesToProcess as $fileToProcess)
|
|||||||
{
|
{
|
||||||
//print "Key $key is a key we always want to see into secondary file (line: $cnt).\n";
|
//print "Key $key is a key we always want to see into secondary file (line: $cnt).\n";
|
||||||
}
|
}
|
||||||
else if ( ! array_key_exists($key, $aSecondary))
|
elseif ( ! array_key_exists($key, $aSecondary))
|
||||||
{
|
{
|
||||||
//print "Key $key does NOT exist in secondary language (line: $cnt).\n";
|
//print "Key $key does NOT exist in secondary language (line: $cnt).\n";
|
||||||
continue;
|
continue;
|
||||||
|
|||||||
@@ -162,7 +162,7 @@ if (empty($reshook))
|
|||||||
if ($result < 0) {
|
if ($result < 0) {
|
||||||
setEventMessages($accounting->error, $accounting->errors, 'errors');
|
setEventMessages($accounting->error, $accounting->errors, 'errors');
|
||||||
}
|
}
|
||||||
} else if ($action == 'enable') {
|
} elseif ($action == 'enable') {
|
||||||
if ($accounting->fetch($id)) {
|
if ($accounting->fetch($id)) {
|
||||||
$result = $accounting->account_activate($id);
|
$result = $accounting->account_activate($id);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -270,7 +270,7 @@ if (GETPOST('actionadd','alpha') || GETPOST('actionmodify','alpha'))
|
|||||||
if ($value == 'price' || preg_match('/^amount/i',$value) || $value == 'taux') {
|
if ($value == 'price' || preg_match('/^amount/i',$value) || $value == 'taux') {
|
||||||
$_POST[$listfieldvalue[$i]] = price2num($_POST[$listfieldvalue[$i]],'MU');
|
$_POST[$listfieldvalue[$i]] = price2num($_POST[$listfieldvalue[$i]],'MU');
|
||||||
}
|
}
|
||||||
else if ($value == 'entity') {
|
elseif ($value == 'entity') {
|
||||||
$_POST[$listfieldvalue[$i]] = $conf->entity;
|
$_POST[$listfieldvalue[$i]] = $conf->entity;
|
||||||
}
|
}
|
||||||
if ($i) $sql.=",";
|
if ($i) $sql.=",";
|
||||||
@@ -318,7 +318,7 @@ if (GETPOST('actionadd','alpha') || GETPOST('actionmodify','alpha'))
|
|||||||
if ($field == 'price' || preg_match('/^amount/i',$field) || $field == 'taux') {
|
if ($field == 'price' || preg_match('/^amount/i',$field) || $field == 'taux') {
|
||||||
$_POST[$listfieldvalue[$i]] = price2num($_POST[$listfieldvalue[$i]],'MU');
|
$_POST[$listfieldvalue[$i]] = price2num($_POST[$listfieldvalue[$i]],'MU');
|
||||||
}
|
}
|
||||||
else if ($field == 'entity') {
|
elseif ($field == 'entity') {
|
||||||
$_POST[$listfieldvalue[$i]] = $conf->entity;
|
$_POST[$listfieldvalue[$i]] = $conf->entity;
|
||||||
}
|
}
|
||||||
if ($i) $sql.=",";
|
if ($i) $sql.=",";
|
||||||
@@ -535,7 +535,7 @@ if ($id)
|
|||||||
{
|
{
|
||||||
print '<td align="'.$align.'">';
|
print '<td align="'.$align.'">';
|
||||||
if (! empty($tabhelp[$id][$value]) && preg_match('/^http(s*):/i',$tabhelp[$id][$value])) print '<a href="'.$tabhelp[$id][$value].'" target="_blank">'.$valuetoshow.' '.img_help(1,$valuetoshow).'</a>';
|
if (! empty($tabhelp[$id][$value]) && preg_match('/^http(s*):/i',$tabhelp[$id][$value])) print '<a href="'.$tabhelp[$id][$value].'" target="_blank">'.$valuetoshow.' '.img_help(1,$valuetoshow).'</a>';
|
||||||
else if (! empty($tabhelp[$id][$value])) print $form->textwithpicto($valuetoshow,$tabhelp[$id][$value]);
|
elseif (! empty($tabhelp[$id][$value])) print $form->textwithpicto($valuetoshow,$tabhelp[$id][$value]);
|
||||||
else print $valuetoshow;
|
else print $valuetoshow;
|
||||||
print '</td>';
|
print '</td>';
|
||||||
}
|
}
|
||||||
@@ -729,14 +729,14 @@ if ($id)
|
|||||||
{
|
{
|
||||||
$valuetoshow = isset($elementList[$valuetoshow])?$elementList[$valuetoshow]:$valuetoshow;
|
$valuetoshow = isset($elementList[$valuetoshow])?$elementList[$valuetoshow]:$valuetoshow;
|
||||||
}
|
}
|
||||||
else if ($value == 'source')
|
elseif ($value == 'source')
|
||||||
{
|
{
|
||||||
$valuetoshow = isset($sourceList[$valuetoshow])?$sourceList[$valuetoshow]:$valuetoshow;
|
$valuetoshow = isset($sourceList[$valuetoshow])?$sourceList[$valuetoshow]:$valuetoshow;
|
||||||
}
|
}
|
||||||
else if ($valuetoshow=='all') {
|
elseif ($valuetoshow=='all') {
|
||||||
$valuetoshow=$langs->trans('All');
|
$valuetoshow=$langs->trans('All');
|
||||||
}
|
}
|
||||||
else if ($fieldlist[$field]=='country') {
|
elseif ($fieldlist[$field]=='country') {
|
||||||
if (empty($obj->country_code))
|
if (empty($obj->country_code))
|
||||||
{
|
{
|
||||||
$valuetoshow='-';
|
$valuetoshow='-';
|
||||||
@@ -747,7 +747,7 @@ if ($id)
|
|||||||
$valuetoshow=($key != "Country".strtoupper($obj->country_code)?$obj->country_code." - ".$key:$obj->country);
|
$valuetoshow=($key != "Country".strtoupper($obj->country_code)?$obj->country_code." - ".$key:$obj->country);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if ($fieldlist[$field]=='country_id') {
|
elseif ($fieldlist[$field]=='country_id') {
|
||||||
$showfield=0;
|
$showfield=0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -811,7 +811,7 @@ $db->close();
|
|||||||
* @param string $context 'add'=Output field for the "add form", 'edit'=Output field for the "edit form", 'hide'=Output field for the "add form" but we dont want it to be rendered
|
* @param string $context 'add'=Output field for the "add form", 'edit'=Output field for the "edit form", 'hide'=Output field for the "add form" but we dont want it to be rendered
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
function fieldListAccountModel($fieldlist, $obj='', $tabname='', $context='')
|
function fieldListAccountModel($fieldlist, $obj = '', $tabname = '', $context = '')
|
||||||
{
|
{
|
||||||
global $conf,$langs,$db;
|
global $conf,$langs,$db;
|
||||||
global $form;
|
global $form;
|
||||||
|
|||||||
@@ -124,7 +124,7 @@ if ($action == 'add' && $user->rights->accounting->chartofaccount)
|
|||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else if ($action == 'edit' && $user->rights->accounting->chartofaccount) {
|
} elseif ($action == 'edit' && $user->rights->accounting->chartofaccount) {
|
||||||
if (! $cancel) {
|
if (! $cancel) {
|
||||||
$result = $object->fetch($id);
|
$result = $object->fetch($id);
|
||||||
|
|
||||||
@@ -177,7 +177,7 @@ if ($action == 'add' && $user->rights->accounting->chartofaccount)
|
|||||||
header("Location: " . $urltogo);
|
header("Location: " . $urltogo);
|
||||||
exit();
|
exit();
|
||||||
}
|
}
|
||||||
} else if ($action == 'delete' && $user->rights->accounting->chartofaccount) {
|
} elseif ($action == 'delete' && $user->rights->accounting->chartofaccount) {
|
||||||
$result = $object->fetch($id);
|
$result = $object->fetch($id);
|
||||||
|
|
||||||
if (! empty($object->id)) {
|
if (! empty($object->id)) {
|
||||||
@@ -272,7 +272,7 @@ if ($action == 'create') {
|
|||||||
|
|
||||||
print '</form>';
|
print '</form>';
|
||||||
}
|
}
|
||||||
else if ($id > 0 || $ref) {
|
elseif ($id > 0 || $ref) {
|
||||||
|
|
||||||
$result = $object->fetch($id, $ref, 1);
|
$result = $object->fetch($id, $ref, 1);
|
||||||
|
|
||||||
|
|||||||
@@ -268,7 +268,7 @@ if (GETPOST('actionadd','alpha') || GETPOST('actionmodify','alpha'))
|
|||||||
if ($field == 'fk_country' && $_POST['country'] > 0) {
|
if ($field == 'fk_country' && $_POST['country'] > 0) {
|
||||||
$_POST[$listfieldvalue[$i]] = $_POST['country'];
|
$_POST[$listfieldvalue[$i]] = $_POST['country'];
|
||||||
}
|
}
|
||||||
else if ($field == 'entity') {
|
elseif ($field == 'entity') {
|
||||||
$_POST[$listfieldvalue[$i]] = $conf->entity;
|
$_POST[$listfieldvalue[$i]] = $conf->entity;
|
||||||
}
|
}
|
||||||
if ($i) $sql.=",";
|
if ($i) $sql.=",";
|
||||||
@@ -492,7 +492,7 @@ if ($id)
|
|||||||
{
|
{
|
||||||
print '<td align="'.$align.'">';
|
print '<td align="'.$align.'">';
|
||||||
if (! empty($tabhelp[$id][$value]) && preg_match('/^http(s*):/i',$tabhelp[$id][$value])) print '<a href="'.$tabhelp[$id][$value].'" target="_blank">'.$valuetoshow.' '.img_help(1,$valuetoshow).'</a>';
|
if (! empty($tabhelp[$id][$value]) && preg_match('/^http(s*):/i',$tabhelp[$id][$value])) print '<a href="'.$tabhelp[$id][$value].'" target="_blank">'.$valuetoshow.' '.img_help(1,$valuetoshow).'</a>';
|
||||||
else if (! empty($tabhelp[$id][$value])) print $form->textwithpicto($valuetoshow,$tabhelp[$id][$value]);
|
elseif (! empty($tabhelp[$id][$value])) print $form->textwithpicto($valuetoshow,$tabhelp[$id][$value]);
|
||||||
else print $valuetoshow;
|
else print $valuetoshow;
|
||||||
print '</td>';
|
print '</td>';
|
||||||
}
|
}
|
||||||
@@ -699,10 +699,10 @@ if ($id)
|
|||||||
{
|
{
|
||||||
$valuetoshow = yn($valuetoshow);
|
$valuetoshow = yn($valuetoshow);
|
||||||
}
|
}
|
||||||
else if ($valuetoshow=='all') {
|
elseif ($valuetoshow=='all') {
|
||||||
$valuetoshow=$langs->trans('All');
|
$valuetoshow=$langs->trans('All');
|
||||||
}
|
}
|
||||||
else if ($fieldlist[$field]=='country') {
|
elseif ($fieldlist[$field]=='country') {
|
||||||
if (empty($obj->country_code))
|
if (empty($obj->country_code))
|
||||||
{
|
{
|
||||||
$valuetoshow='-';
|
$valuetoshow='-';
|
||||||
@@ -713,20 +713,20 @@ if ($id)
|
|||||||
$valuetoshow=($key != "Country".strtoupper($obj->country_code)?$obj->country_code." - ".$key:$obj->country);
|
$valuetoshow=($key != "Country".strtoupper($obj->country_code)?$obj->country_code." - ".$key:$obj->country);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if ($fieldlist[$field]=='label' && $tabname[$id]==MAIN_DB_PREFIX.'c_country') {
|
elseif ($fieldlist[$field]=='label' && $tabname[$id]==MAIN_DB_PREFIX.'c_country') {
|
||||||
$key=$langs->trans("Country".strtoupper($obj->code));
|
$key=$langs->trans("Country".strtoupper($obj->code));
|
||||||
$valuetoshow=($obj->code && $key != "Country".strtoupper($obj->code)?$key:$obj->{$fieldlist[$field]});
|
$valuetoshow=($obj->code && $key != "Country".strtoupper($obj->code)?$key:$obj->{$fieldlist[$field]});
|
||||||
}
|
}
|
||||||
else if ($fieldlist[$field]=='label' && $tabname[$id]==MAIN_DB_PREFIX.'c_availability') {
|
elseif ($fieldlist[$field]=='label' && $tabname[$id]==MAIN_DB_PREFIX.'c_availability') {
|
||||||
$langs->loadLangs(array("propal"));
|
$langs->loadLangs(array("propal"));
|
||||||
$key=$langs->trans("AvailabilityType".strtoupper($obj->code));
|
$key=$langs->trans("AvailabilityType".strtoupper($obj->code));
|
||||||
$valuetoshow=($obj->code && $key != "AvailabilityType".strtoupper($obj->code)?$key:$obj->{$fieldlist[$field]});
|
$valuetoshow=($obj->code && $key != "AvailabilityType".strtoupper($obj->code)?$key:$obj->{$fieldlist[$field]});
|
||||||
}
|
}
|
||||||
else if ($fieldlist[$field]=='libelle' && $tabname[$id]==MAIN_DB_PREFIX.'c_actioncomm') {
|
elseif ($fieldlist[$field]=='libelle' && $tabname[$id]==MAIN_DB_PREFIX.'c_actioncomm') {
|
||||||
$key=$langs->trans("Action".strtoupper($obj->code));
|
$key=$langs->trans("Action".strtoupper($obj->code));
|
||||||
$valuetoshow=($obj->code && $key != "Action".strtoupper($obj->code)?$key:$obj->{$fieldlist[$field]});
|
$valuetoshow=($obj->code && $key != "Action".strtoupper($obj->code)?$key:$obj->{$fieldlist[$field]});
|
||||||
}
|
}
|
||||||
else if ($fieldlist[$field]=='region_id' || $fieldlist[$field]=='country_id') {
|
elseif ($fieldlist[$field]=='region_id' || $fieldlist[$field]=='country_id') {
|
||||||
$showfield=0;
|
$showfield=0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -813,7 +813,7 @@ $db->close();
|
|||||||
* @param string $context 'add'=Output field for the "add form", 'edit'=Output field for the "edit form", 'hide'=Output field for the "add form" but we dont want it to be rendered
|
* @param string $context 'add'=Output field for the "add form", 'edit'=Output field for the "edit form", 'hide'=Output field for the "add form" but we dont want it to be rendered
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
function fieldListAccountingCategories($fieldlist, $obj='', $tabname='', $context='')
|
function fieldListAccountingCategories($fieldlist, $obj = '', $tabname = '', $context = '')
|
||||||
{
|
{
|
||||||
global $conf,$langs,$db;
|
global $conf,$langs,$db;
|
||||||
global $form, $mysoc;
|
global $form, $mysoc;
|
||||||
|
|||||||
@@ -73,7 +73,7 @@ if ($action == 'confirm_delete' && $confirm == "yes") {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
else if ($action == 'add') {
|
elseif ($action == 'add') {
|
||||||
if (! GETPOST('cancel', 'alpha')) {
|
if (! GETPOST('cancel', 'alpha')) {
|
||||||
$error = 0;
|
$error = 0;
|
||||||
|
|
||||||
@@ -118,7 +118,7 @@ else if ($action == 'add') {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Update record
|
// Update record
|
||||||
else if ($action == 'update') {
|
elseif ($action == 'update') {
|
||||||
if (! GETPOST('cancel', 'alpha')) {
|
if (! GETPOST('cancel', 'alpha')) {
|
||||||
$result = $object->fetch($id);
|
$result = $object->fetch($id);
|
||||||
|
|
||||||
@@ -198,7 +198,7 @@ if ($action == 'create')
|
|||||||
print '</div>';
|
print '</div>';
|
||||||
|
|
||||||
print '</form>';
|
print '</form>';
|
||||||
} else if ($id) {
|
} elseif ($id) {
|
||||||
$result = $object->fetch($id);
|
$result = $object->fetch($id);
|
||||||
if ($result > 0) {
|
if ($result > 0) {
|
||||||
$head = fiscalyear_prepare_head($object);
|
$head = fiscalyear_prepare_head($object);
|
||||||
|
|||||||
@@ -270,7 +270,7 @@ if (GETPOST('actionadd', 'alpha') || GETPOST('actionmodify', 'alpha'))
|
|||||||
if ($field == 'price' || preg_match('/^amount/i',$field) || $field == 'taux') {
|
if ($field == 'price' || preg_match('/^amount/i',$field) || $field == 'taux') {
|
||||||
$_POST[$listfieldvalue[$i]] = price2num($_POST[$listfieldvalue[$i]],'MU');
|
$_POST[$listfieldvalue[$i]] = price2num($_POST[$listfieldvalue[$i]],'MU');
|
||||||
}
|
}
|
||||||
else if ($field == 'entity') {
|
elseif ($field == 'entity') {
|
||||||
$_POST[$listfieldvalue[$i]] = $conf->entity;
|
$_POST[$listfieldvalue[$i]] = $conf->entity;
|
||||||
}
|
}
|
||||||
if ($i) $sql.=",";
|
if ($i) $sql.=",";
|
||||||
@@ -441,7 +441,7 @@ if ($id)
|
|||||||
{
|
{
|
||||||
print '<td align="'.$align.'">';
|
print '<td align="'.$align.'">';
|
||||||
if (! empty($tabhelp[$id][$value]) && preg_match('/^http(s*):/i',$tabhelp[$id][$value])) print '<a href="'.$tabhelp[$id][$value].'" target="_blank">'.$valuetoshow.' '.img_help(1,$valuetoshow).'</a>';
|
if (! empty($tabhelp[$id][$value]) && preg_match('/^http(s*):/i',$tabhelp[$id][$value])) print '<a href="'.$tabhelp[$id][$value].'" target="_blank">'.$valuetoshow.' '.img_help(1,$valuetoshow).'</a>';
|
||||||
else if (! empty($tabhelp[$id][$value])) print $form->textwithpicto($valuetoshow,$tabhelp[$id][$value]);
|
elseif (! empty($tabhelp[$id][$value])) print $form->textwithpicto($valuetoshow,$tabhelp[$id][$value]);
|
||||||
else print $valuetoshow;
|
else print $valuetoshow;
|
||||||
print '</td>';
|
print '</td>';
|
||||||
}
|
}
|
||||||
@@ -611,11 +611,11 @@ if ($id)
|
|||||||
if ($valuetoshow=='all') {
|
if ($valuetoshow=='all') {
|
||||||
$valuetoshow=$langs->trans('All');
|
$valuetoshow=$langs->trans('All');
|
||||||
}
|
}
|
||||||
else if ($fieldlist[$field]=='nature' && $tabname[$id]==MAIN_DB_PREFIX.'accounting_journal') {
|
elseif ($fieldlist[$field]=='nature' && $tabname[$id]==MAIN_DB_PREFIX.'accounting_journal') {
|
||||||
$key=$langs->trans("AccountingJournalType".strtoupper($obj->nature));
|
$key=$langs->trans("AccountingJournalType".strtoupper($obj->nature));
|
||||||
$valuetoshow=($obj->nature && $key != "AccountingJournalType".strtoupper($langs->trans($obj->nature))?$key:$obj->{$fieldlist[$field]});
|
$valuetoshow=($obj->nature && $key != "AccountingJournalType".strtoupper($langs->trans($obj->nature))?$key:$obj->{$fieldlist[$field]});
|
||||||
}
|
}
|
||||||
else if ($fieldlist[$field]=='label' && $tabname[$id]==MAIN_DB_PREFIX.'accounting_journal') {
|
elseif ($fieldlist[$field]=='label' && $tabname[$id]==MAIN_DB_PREFIX.'accounting_journal') {
|
||||||
$valuetoshow=$langs->trans($obj->label);
|
$valuetoshow=$langs->trans($obj->label);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -630,8 +630,8 @@ if ($id)
|
|||||||
if (isset($obj->code) && $id != 10)
|
if (isset($obj->code) && $id != 10)
|
||||||
{
|
{
|
||||||
if (($obj->code == '0' || $obj->code == '' || preg_match('/unknown/i',$obj->code))) { $iserasable = 0; $canbedisabled = 0; }
|
if (($obj->code == '0' || $obj->code == '' || preg_match('/unknown/i',$obj->code))) { $iserasable = 0; $canbedisabled = 0; }
|
||||||
else if ($obj->code == 'RECEP') { $iserasable = 0; $canbedisabled = 0; }
|
elseif ($obj->code == 'RECEP') { $iserasable = 0; $canbedisabled = 0; }
|
||||||
else if ($obj->code == 'EF0') { $iserasable = 0; $canbedisabled = 0; }
|
elseif ($obj->code == 'EF0') { $iserasable = 0; $canbedisabled = 0; }
|
||||||
}
|
}
|
||||||
|
|
||||||
$canbemodified=$iserasable;
|
$canbemodified=$iserasable;
|
||||||
@@ -696,7 +696,7 @@ $db->close();
|
|||||||
* @param string $context 'add'=Output field for the "add form", 'edit'=Output field for the "edit form", 'hide'=Output field for the "add form" but we dont want it to be rendered
|
* @param string $context 'add'=Output field for the "add form", 'edit'=Output field for the "edit form", 'hide'=Output field for the "add form" but we dont want it to be rendered
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
function fieldListJournal($fieldlist, $obj='', $tabname='', $context='')
|
function fieldListJournal($fieldlist, $obj = '', $tabname = '', $context = '')
|
||||||
{
|
{
|
||||||
global $conf,$langs,$db;
|
global $conf,$langs,$db;
|
||||||
global $form, $mysoc;
|
global $form, $mysoc;
|
||||||
|
|||||||
@@ -140,7 +140,7 @@ if ($action == "confirm_update") {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
else if ($action == "add") {
|
elseif ($action == "add") {
|
||||||
$error = 0;
|
$error = 0;
|
||||||
|
|
||||||
if ((floatval($debit) != 0.0) && (floatval($credit) != 0.0))
|
if ((floatval($debit) != 0.0) && (floatval($credit) != 0.0))
|
||||||
@@ -201,7 +201,7 @@ else if ($action == "add") {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
else if ($action == "confirm_delete") {
|
elseif ($action == "confirm_delete") {
|
||||||
$object = new BookKeeping($db);
|
$object = new BookKeeping($db);
|
||||||
|
|
||||||
$result = $object->fetch($id, null, $mode);
|
$result = $object->fetch($id, null, $mode);
|
||||||
@@ -218,7 +218,7 @@ else if ($action == "confirm_delete") {
|
|||||||
$action = '';
|
$action = '';
|
||||||
}
|
}
|
||||||
|
|
||||||
else if ($action == "confirm_create") {
|
elseif ($action == "confirm_create") {
|
||||||
$error = 0;
|
$error = 0;
|
||||||
|
|
||||||
$object = new BookKeeping($db);
|
$object = new BookKeeping($db);
|
||||||
|
|||||||
@@ -142,7 +142,7 @@ class AccountancyCategory // extends CommonObject
|
|||||||
* @param int $notrigger 0=launch triggers after, 1=disable triggers
|
* @param int $notrigger 0=launch triggers after, 1=disable triggers
|
||||||
* @return int <0 if KO, Id of created object if OK
|
* @return int <0 if KO, Id of created object if OK
|
||||||
*/
|
*/
|
||||||
function create($user, $notrigger=0)
|
function create($user, $notrigger = 0)
|
||||||
{
|
{
|
||||||
global $conf, $langs;
|
global $conf, $langs;
|
||||||
$error=0;
|
$error=0;
|
||||||
@@ -239,7 +239,7 @@ class AccountancyCategory // extends CommonObject
|
|||||||
* @param string $label Label
|
* @param string $label Label
|
||||||
* @return int <0 if KO, >0 if OK
|
* @return int <0 if KO, >0 if OK
|
||||||
*/
|
*/
|
||||||
function fetch($id, $code='', $label='')
|
function fetch($id, $code = '', $label = '')
|
||||||
{
|
{
|
||||||
$sql = "SELECT";
|
$sql = "SELECT";
|
||||||
$sql.= " t.rowid,";
|
$sql.= " t.rowid,";
|
||||||
@@ -299,7 +299,7 @@ class AccountancyCategory // extends CommonObject
|
|||||||
* @param int $notrigger 0=launch triggers after, 1=disable triggers
|
* @param int $notrigger 0=launch triggers after, 1=disable triggers
|
||||||
* @return int <0 if KO, >0 if OK
|
* @return int <0 if KO, >0 if OK
|
||||||
*/
|
*/
|
||||||
function update($user=null, $notrigger=0)
|
function update($user = null, $notrigger = 0)
|
||||||
{
|
{
|
||||||
global $conf, $langs;
|
global $conf, $langs;
|
||||||
$error=0;
|
$error=0;
|
||||||
@@ -379,7 +379,7 @@ class AccountancyCategory // extends CommonObject
|
|||||||
* @param int $notrigger 0=launch triggers after, 1=disable triggers
|
* @param int $notrigger 0=launch triggers after, 1=disable triggers
|
||||||
* @return int <0 if KO, >0 if OK
|
* @return int <0 if KO, >0 if OK
|
||||||
*/
|
*/
|
||||||
function delete($user, $notrigger=0)
|
function delete($user, $notrigger = 0)
|
||||||
{
|
{
|
||||||
global $conf, $langs;
|
global $conf, $langs;
|
||||||
$error=0;
|
$error=0;
|
||||||
@@ -726,7 +726,7 @@ class AccountancyCategory // extends CommonObject
|
|||||||
* @param int $year Specifig year - Can be empty
|
* @param int $year Specifig year - Can be empty
|
||||||
* @return integer <0 if KO, >= 0 if OK
|
* @return integer <0 if KO, >= 0 if OK
|
||||||
*/
|
*/
|
||||||
public function getSumDebitCredit($cpt, $date_start, $date_end, $sens, $thirdparty_code='nofilter', $month=0, $year=0)
|
public function getSumDebitCredit($cpt, $date_start, $date_end, $sens, $thirdparty_code = 'nofilter', $month = 0, $year = 0)
|
||||||
{
|
{
|
||||||
global $conf;
|
global $conf;
|
||||||
|
|
||||||
@@ -796,7 +796,7 @@ class AccountancyCategory // extends CommonObject
|
|||||||
* @param int $categorytype -1=All, 0=Only non computed groups, 1=Only computed groups
|
* @param int $categorytype -1=All, 0=Only non computed groups, 1=Only computed groups
|
||||||
* @return array|int Array of groups or -1 if error
|
* @return array|int Array of groups or -1 if error
|
||||||
*/
|
*/
|
||||||
public function getCats($categorytype=-1)
|
public function getCats($categorytype = -1)
|
||||||
{
|
{
|
||||||
global $conf, $mysoc;
|
global $conf, $mysoc;
|
||||||
|
|
||||||
@@ -853,7 +853,7 @@ class AccountancyCategory // extends CommonObject
|
|||||||
* @param string $predefinedgroupwhere Sql criteria filter to select accounting accounts
|
* @param string $predefinedgroupwhere Sql criteria filter to select accounting accounts
|
||||||
* @return array|int Array of accounting accounts or -1 if error
|
* @return array|int Array of accounting accounts or -1 if error
|
||||||
*/
|
*/
|
||||||
public function getCptsCat($cat_id, $predefinedgroupwhere='')
|
public function getCptsCat($cat_id, $predefinedgroupwhere = '')
|
||||||
{
|
{
|
||||||
global $conf, $mysoc;
|
global $conf, $mysoc;
|
||||||
$sql = '';
|
$sql = '';
|
||||||
|
|||||||
@@ -466,7 +466,7 @@ class AccountingAccount extends CommonObject
|
|||||||
* @param int $save_lastsearch_value -1=Auto, 0=No save of lastsearch_values when clicking, 1=Save lastsearch_values whenclicking
|
* @param int $save_lastsearch_value -1=Auto, 0=No save of lastsearch_values when clicking, 1=Save lastsearch_values whenclicking
|
||||||
* @return string String with URL
|
* @return string String with URL
|
||||||
*/
|
*/
|
||||||
function getNomUrl($withpicto = 0, $withlabel = 0, $nourl = 0, $moretitle='',$notooltip=0, $save_lastsearch_value=-1)
|
function getNomUrl($withpicto = 0, $withlabel = 0, $nourl = 0, $moretitle = '', $notooltip = 0, $save_lastsearch_value = -1)
|
||||||
{
|
{
|
||||||
global $langs, $conf, $user;
|
global $langs, $conf, $user;
|
||||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/accounting.lib.php';
|
require_once DOL_DOCUMENT_ROOT.'/core/lib/accounting.lib.php';
|
||||||
@@ -632,7 +632,7 @@ 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
|
* @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
|
* @return string Label of status
|
||||||
*/
|
*/
|
||||||
function getLibStatut($mode=0)
|
function getLibStatut($mode = 0)
|
||||||
{
|
{
|
||||||
return $this->LibStatut($this->status,$mode);
|
return $this->LibStatut($this->status,$mode);
|
||||||
}
|
}
|
||||||
@@ -645,7 +645,7 @@ 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
|
* @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
|
* @return string Label of status
|
||||||
*/
|
*/
|
||||||
function LibStatut($statut,$mode=0)
|
function LibStatut($statut, $mode = 0)
|
||||||
{
|
{
|
||||||
// phpcs:enable
|
// phpcs:enable
|
||||||
global $langs;
|
global $langs;
|
||||||
|
|||||||
@@ -213,7 +213,7 @@ class AccountingJournal extends CommonObject
|
|||||||
* @param int $notooltip 1=Disable tooltip
|
* @param int $notooltip 1=Disable tooltip
|
||||||
* @return string String with URL
|
* @return string String with URL
|
||||||
*/
|
*/
|
||||||
function getNomUrl($withpicto = 0, $withlabel = 0, $nourl = 0, $moretitle='',$notooltip=0)
|
function getNomUrl($withpicto = 0, $withlabel = 0, $nourl = 0, $moretitle = '', $notooltip = 0)
|
||||||
{
|
{
|
||||||
global $langs, $conf, $user;
|
global $langs, $conf, $user;
|
||||||
|
|
||||||
@@ -270,7 +270,7 @@ class AccountingJournal extends CommonObject
|
|||||||
* @param int $mode 0=libelle long, 1=libelle court
|
* @param int $mode 0=libelle long, 1=libelle court
|
||||||
* @return string Label of type
|
* @return string Label of type
|
||||||
*/
|
*/
|
||||||
function getLibType($mode=0)
|
function getLibType($mode = 0)
|
||||||
{
|
{
|
||||||
return $this->LibType($this->nature,$mode);
|
return $this->LibType($this->nature,$mode);
|
||||||
}
|
}
|
||||||
@@ -283,7 +283,7 @@ class AccountingJournal extends CommonObject
|
|||||||
* @param int $mode 0=libelle long, 1=libelle court
|
* @param int $mode 0=libelle long, 1=libelle court
|
||||||
* @return string Label of type
|
* @return string Label of type
|
||||||
*/
|
*/
|
||||||
function LibType($nature,$mode=0)
|
function LibType($nature, $mode = 0)
|
||||||
{
|
{
|
||||||
// phpcs:enable
|
// phpcs:enable
|
||||||
global $langs;
|
global $langs;
|
||||||
|
|||||||
@@ -411,7 +411,7 @@ class BookKeeping extends CommonObject
|
|||||||
* @param int $save_lastsearch_value -1=Auto, 0=No save of lastsearch_values when clicking, 1=Save lastsearch_values whenclicking
|
* @param int $save_lastsearch_value -1=Auto, 0=No save of lastsearch_values when clicking, 1=Save lastsearch_values whenclicking
|
||||||
* @return string String with URL
|
* @return string String with URL
|
||||||
*/
|
*/
|
||||||
function getNomUrl($withpicto=0, $option='', $notooltip=0, $morecss='', $save_lastsearch_value=-1)
|
function getNomUrl($withpicto = 0, $option = '', $notooltip = 0, $morecss = '', $save_lastsearch_value = -1)
|
||||||
{
|
{
|
||||||
global $db, $conf, $langs;
|
global $db, $conf, $langs;
|
||||||
global $dolibarr_main_authentication, $dolibarr_main_demo;
|
global $dolibarr_main_authentication, $dolibarr_main_demo;
|
||||||
@@ -470,7 +470,7 @@ class BookKeeping extends CommonObject
|
|||||||
* @param string $mode Mode
|
* @param string $mode Mode
|
||||||
* @return int <0 if KO, Id of created object if OK
|
* @return int <0 if KO, Id of created object if OK
|
||||||
*/
|
*/
|
||||||
public function createStd(User $user, $notrigger = false, $mode='')
|
public function createStd(User $user, $notrigger = false, $mode = '')
|
||||||
{
|
{
|
||||||
global $conf;
|
global $conf;
|
||||||
|
|
||||||
@@ -641,7 +641,7 @@ class BookKeeping extends CommonObject
|
|||||||
*
|
*
|
||||||
* @return int <0 if KO, 0 if not found, >0 if OK
|
* @return int <0 if KO, 0 if not found, >0 if OK
|
||||||
*/
|
*/
|
||||||
public function fetch($id, $ref = null, $mode='')
|
public function fetch($id, $ref = null, $mode = '')
|
||||||
{
|
{
|
||||||
global $conf;
|
global $conf;
|
||||||
|
|
||||||
@@ -1090,7 +1090,7 @@ class BookKeeping extends CommonObject
|
|||||||
* @param string $mode Mode
|
* @param string $mode Mode
|
||||||
* @return int <0 if KO, >0 if OK
|
* @return int <0 if KO, >0 if OK
|
||||||
*/
|
*/
|
||||||
public function update(User $user, $notrigger = false, $mode='')
|
public function update(User $user, $notrigger = false, $mode = '')
|
||||||
{
|
{
|
||||||
$error = 0;
|
$error = 0;
|
||||||
|
|
||||||
@@ -1225,7 +1225,7 @@ class BookKeeping extends CommonObject
|
|||||||
* @param string $mode Mode
|
* @param string $mode Mode
|
||||||
* @return number <0 if KO, >0 if OK
|
* @return number <0 if KO, >0 if OK
|
||||||
*/
|
*/
|
||||||
public function updateByMvt($piece_num='', $field='', $value='', $mode='')
|
public function updateByMvt($piece_num = '', $field = '', $value = '', $mode = '')
|
||||||
{
|
{
|
||||||
$error=0;
|
$error=0;
|
||||||
|
|
||||||
@@ -1260,7 +1260,7 @@ class BookKeeping extends CommonObject
|
|||||||
* @param string $mode Mode
|
* @param string $mode Mode
|
||||||
* @return int <0 if KO, >0 if OK
|
* @return int <0 if KO, >0 if OK
|
||||||
*/
|
*/
|
||||||
public function delete(User $user, $notrigger = false, $mode='')
|
public function delete(User $user, $notrigger = false, $mode = '')
|
||||||
{
|
{
|
||||||
dol_syslog(__METHOD__, LOG_DEBUG);
|
dol_syslog(__METHOD__, LOG_DEBUG);
|
||||||
|
|
||||||
@@ -1338,7 +1338,7 @@ class BookKeeping extends CommonObject
|
|||||||
* @param string $mode Mode
|
* @param string $mode Mode
|
||||||
* @return int <0 if KO, >0 if OK
|
* @return int <0 if KO, >0 if OK
|
||||||
*/
|
*/
|
||||||
function deleteByYearAndJournal($delyear='', $journal='', $mode='')
|
function deleteByYearAndJournal($delyear = '', $journal = '', $mode = '')
|
||||||
{
|
{
|
||||||
global $conf;
|
global $conf;
|
||||||
|
|
||||||
@@ -1500,7 +1500,7 @@ class BookKeeping extends CommonObject
|
|||||||
* @param string $mode Mode
|
* @param string $mode Mode
|
||||||
* @return int <0 if KO, >0 if OK
|
* @return int <0 if KO, >0 if OK
|
||||||
*/
|
*/
|
||||||
public function fetchPerMvt($piecenum, $mode='')
|
public function fetchPerMvt($piecenum, $mode = '')
|
||||||
{
|
{
|
||||||
global $conf;
|
global $conf;
|
||||||
|
|
||||||
@@ -1536,7 +1536,7 @@ class BookKeeping extends CommonObject
|
|||||||
* @param string $mode Mode
|
* @param string $mode Mode
|
||||||
* @return string Next numero to use
|
* @return string Next numero to use
|
||||||
*/
|
*/
|
||||||
public function getNextNumMvt($mode='')
|
public function getNextNumMvt($mode = '')
|
||||||
{
|
{
|
||||||
global $conf;
|
global $conf;
|
||||||
|
|
||||||
@@ -1565,7 +1565,7 @@ class BookKeeping extends CommonObject
|
|||||||
* @param string $mode Mode
|
* @param string $mode Mode
|
||||||
* @return int <0 if KO, >0 if OK
|
* @return int <0 if KO, >0 if OK
|
||||||
*/
|
*/
|
||||||
function fetchAllPerMvt($piecenum, $mode='')
|
function fetchAllPerMvt($piecenum, $mode = '')
|
||||||
{
|
{
|
||||||
global $conf;
|
global $conf;
|
||||||
|
|
||||||
@@ -1687,7 +1687,7 @@ class BookKeeping extends CommonObject
|
|||||||
* @param string $piece_num Piece num
|
* @param string $piece_num Piece num
|
||||||
* @return int int <0 if KO, >0 if OK
|
* @return int int <0 if KO, >0 if OK
|
||||||
*/
|
*/
|
||||||
public function transformTransaction($direction=0,$piece_num='')
|
public function transformTransaction($direction = 0, $piece_num = '')
|
||||||
{
|
{
|
||||||
$error = 0;
|
$error = 0;
|
||||||
|
|
||||||
|
|||||||
@@ -219,12 +219,12 @@ if ($search_month > 0)
|
|||||||
{
|
{
|
||||||
if ($search_year > 0 && empty($search_day))
|
if ($search_year > 0 && empty($search_day))
|
||||||
$sql.= " AND f.datef BETWEEN '".$db->idate(dol_get_first_day($search_year,$search_month,false))."' AND '".$db->idate(dol_get_last_day($search_year,$search_month,false))."'";
|
$sql.= " AND f.datef BETWEEN '".$db->idate(dol_get_first_day($search_year,$search_month,false))."' AND '".$db->idate(dol_get_last_day($search_year,$search_month,false))."'";
|
||||||
else if ($search_year > 0 && ! empty($search_day))
|
elseif ($search_year > 0 && ! empty($search_day))
|
||||||
$sql.= " AND f.datef BETWEEN '".$db->idate(dol_mktime(0, 0, 0, $search_month, $search_day, $search_year))."' AND '".$db->idate(dol_mktime(23, 59, 59, $search_month, $search_day, $search_year))."'";
|
$sql.= " AND f.datef BETWEEN '".$db->idate(dol_mktime(0, 0, 0, $search_month, $search_day, $search_year))."' AND '".$db->idate(dol_mktime(23, 59, 59, $search_month, $search_day, $search_year))."'";
|
||||||
else
|
else
|
||||||
$sql.= " AND date_format(f.datef, '%m') = '".$db->escape($search_month)."'";
|
$sql.= " AND date_format(f.datef, '%m') = '".$db->escape($search_month)."'";
|
||||||
}
|
}
|
||||||
else if ($search_year > 0)
|
elseif ($search_year > 0)
|
||||||
{
|
{
|
||||||
$sql.= " AND f.datef BETWEEN '".$db->idate(dol_get_first_day($search_year,1,false))."' AND '".$db->idate(dol_get_last_day($search_year,12,false))."'";
|
$sql.= " AND f.datef BETWEEN '".$db->idate(dol_get_first_day($search_year,1,false))."' AND '".$db->idate(dol_get_last_day($search_year,12,false))."'";
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -257,12 +257,12 @@ if ($search_month > 0)
|
|||||||
{
|
{
|
||||||
if ($search_year > 0 && empty($search_day))
|
if ($search_year > 0 && empty($search_day))
|
||||||
$sql.= " AND f.datef BETWEEN '".$db->idate(dol_get_first_day($search_year,$search_month,false))."' AND '".$db->idate(dol_get_last_day($search_year,$search_month,false))."'";
|
$sql.= " AND f.datef BETWEEN '".$db->idate(dol_get_first_day($search_year,$search_month,false))."' AND '".$db->idate(dol_get_last_day($search_year,$search_month,false))."'";
|
||||||
else if ($search_year > 0 && ! empty($search_day))
|
elseif ($search_year > 0 && ! empty($search_day))
|
||||||
$sql.= " AND f.datef BETWEEN '".$db->idate(dol_mktime(0, 0, 0, $search_month, $search_day, $search_year))."' AND '".$db->idate(dol_mktime(23, 59, 59, $search_month, $search_day, $search_year))."'";
|
$sql.= " AND f.datef BETWEEN '".$db->idate(dol_mktime(0, 0, 0, $search_month, $search_day, $search_year))."' AND '".$db->idate(dol_mktime(23, 59, 59, $search_month, $search_day, $search_year))."'";
|
||||||
else
|
else
|
||||||
$sql.= " AND date_format(f.datef, '%m') = '".$db->escape($search_month)."'";
|
$sql.= " AND date_format(f.datef, '%m') = '".$db->escape($search_month)."'";
|
||||||
}
|
}
|
||||||
else if ($search_year > 0)
|
elseif ($search_year > 0)
|
||||||
{
|
{
|
||||||
$sql.= " AND f.datef BETWEEN '".$db->idate(dol_get_first_day($search_year,1,false))."' AND '".$db->idate(dol_get_last_day($search_year,12,false))."'";
|
$sql.= " AND f.datef BETWEEN '".$db->idate(dol_get_first_day($search_year,1,false))."' AND '".$db->idate(dol_get_last_day($search_year,12,false))."'";
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -190,12 +190,12 @@ if ($search_month > 0)
|
|||||||
{
|
{
|
||||||
if ($search_year > 0 && empty($search_day))
|
if ($search_year > 0 && empty($search_day))
|
||||||
$sql.= " AND erd.date BETWEEN '".$db->idate(dol_get_first_day($search_year,$search_month,false))."' AND '".$db->idate(dol_get_last_day($search_year,$search_month,false))."'";
|
$sql.= " AND erd.date BETWEEN '".$db->idate(dol_get_first_day($search_year,$search_month,false))."' AND '".$db->idate(dol_get_last_day($search_year,$search_month,false))."'";
|
||||||
else if ($search_year > 0 && ! empty($search_day))
|
elseif ($search_year > 0 && ! empty($search_day))
|
||||||
$sql.= " AND erd.date BETWEEN '".$db->idate(dol_mktime(0, 0, 0, $search_month, $search_day, $search_year))."' AND '".$db->idate(dol_mktime(23, 59, 59, $search_month, $search_day, $search_year))."'";
|
$sql.= " AND erd.date BETWEEN '".$db->idate(dol_mktime(0, 0, 0, $search_month, $search_day, $search_year))."' AND '".$db->idate(dol_mktime(23, 59, 59, $search_month, $search_day, $search_year))."'";
|
||||||
else
|
else
|
||||||
$sql.= " AND date_format(erd.date, '%m') = '".$db->escape($search_month)."'";
|
$sql.= " AND date_format(erd.date, '%m') = '".$db->escape($search_month)."'";
|
||||||
}
|
}
|
||||||
else if ($search_year > 0)
|
elseif ($search_year > 0)
|
||||||
{
|
{
|
||||||
$sql.= " AND erd.date BETWEEN '".$db->idate(dol_get_first_day($search_year,1,false))."' AND '".$db->idate(dol_get_last_day($search_year,12,false))."'";
|
$sql.= " AND erd.date BETWEEN '".$db->idate(dol_get_first_day($search_year,1,false))."' AND '".$db->idate(dol_get_last_day($search_year,12,false))."'";
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -219,12 +219,12 @@ if ($search_month > 0)
|
|||||||
{
|
{
|
||||||
if ($search_year > 0 && empty($search_day))
|
if ($search_year > 0 && empty($search_day))
|
||||||
$sql.= " AND erd.date BETWEEN '".$db->idate(dol_get_first_day($search_year,$search_month,false))."' AND '".$db->idate(dol_get_last_day($search_year,$search_month,false))."'";
|
$sql.= " AND erd.date BETWEEN '".$db->idate(dol_get_first_day($search_year,$search_month,false))."' AND '".$db->idate(dol_get_last_day($search_year,$search_month,false))."'";
|
||||||
else if ($search_year > 0 && ! empty($search_day))
|
elseif ($search_year > 0 && ! empty($search_day))
|
||||||
$sql.= " AND erd.date BETWEEN '".$db->idate(dol_mktime(0, 0, 0, $search_month, $search_day, $search_year))."' AND '".$db->idate(dol_mktime(23, 59, 59, $search_month, $search_day, $search_year))."'";
|
$sql.= " AND erd.date BETWEEN '".$db->idate(dol_mktime(0, 0, 0, $search_month, $search_day, $search_year))."' AND '".$db->idate(dol_mktime(23, 59, 59, $search_month, $search_day, $search_year))."'";
|
||||||
else
|
else
|
||||||
$sql.= " AND date_format(erd.date, '%m') = '".$db->escape($search_month)."'";
|
$sql.= " AND date_format(erd.date, '%m') = '".$db->escape($search_month)."'";
|
||||||
}
|
}
|
||||||
else if ($search_year > 0)
|
elseif ($search_year > 0)
|
||||||
{
|
{
|
||||||
$sql.= " AND erd.date BETWEEN '".$db->idate(dol_get_first_day($search_year,1,false))."' AND '".$db->idate(dol_get_last_day($search_year,12,false))."'";
|
$sql.= " AND erd.date BETWEEN '".$db->idate(dol_get_first_day($search_year,1,false))."' AND '".$db->idate(dol_get_last_day($search_year,12,false))."'";
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -290,18 +290,18 @@ if ($result) {
|
|||||||
$paymentstatic->ref = $links[$key]['url_id'];
|
$paymentstatic->ref = $links[$key]['url_id'];
|
||||||
$tabpay[$obj->rowid]["lib"] .= ' ' . $paymentstatic->getNomUrl(2, '', ''); // TODO Do not include list of invoice in tooltip, the dol_string_nohtmltag is ko with this
|
$tabpay[$obj->rowid]["lib"] .= ' ' . $paymentstatic->getNomUrl(2, '', ''); // TODO Do not include list of invoice in tooltip, the dol_string_nohtmltag is ko with this
|
||||||
$tabpay[$obj->rowid]["paymentid"] = $paymentstatic->id;
|
$tabpay[$obj->rowid]["paymentid"] = $paymentstatic->id;
|
||||||
} else if ($links[$key]['type'] == 'payment_supplier') {
|
} elseif ($links[$key]['type'] == 'payment_supplier') {
|
||||||
$paymentsupplierstatic->id = $links[$key]['url_id'];
|
$paymentsupplierstatic->id = $links[$key]['url_id'];
|
||||||
$paymentsupplierstatic->ref = $links[$key]['url_id'];
|
$paymentsupplierstatic->ref = $links[$key]['url_id'];
|
||||||
$tabpay[$obj->rowid]["lib"] .= ' ' . $paymentsupplierstatic->getNomUrl(2);
|
$tabpay[$obj->rowid]["lib"] .= ' ' . $paymentsupplierstatic->getNomUrl(2);
|
||||||
$tabpay[$obj->rowid]["paymentsupplierid"] = $paymentsupplierstatic->id;
|
$tabpay[$obj->rowid]["paymentsupplierid"] = $paymentsupplierstatic->id;
|
||||||
} else if ($links[$key]['type'] == 'company') {
|
} elseif ($links[$key]['type'] == 'company') {
|
||||||
$societestatic->id = $links[$key]['url_id'];
|
$societestatic->id = $links[$key]['url_id'];
|
||||||
$societestatic->name = $links[$key]['label'];
|
$societestatic->name = $links[$key]['label'];
|
||||||
$societestatic->email = $tabcompany[$obj->rowid]['email'];
|
$societestatic->email = $tabcompany[$obj->rowid]['email'];
|
||||||
$tabpay[$obj->rowid]["soclib"] = $societestatic->getNomUrl(1, '', 30);
|
$tabpay[$obj->rowid]["soclib"] = $societestatic->getNomUrl(1, '', 30);
|
||||||
if ($compta_soc) $tabtp[$obj->rowid][$compta_soc] += $obj->amount;
|
if ($compta_soc) $tabtp[$obj->rowid][$compta_soc] += $obj->amount;
|
||||||
} else if ($links[$key]['type'] == 'user') {
|
} elseif ($links[$key]['type'] == 'user') {
|
||||||
$userstatic->id = $links[$key]['url_id'];
|
$userstatic->id = $links[$key]['url_id'];
|
||||||
$userstatic->name = $links[$key]['label'];
|
$userstatic->name = $links[$key]['label'];
|
||||||
$userstatic->email = $tabuser[$obj->rowid]['email'];
|
$userstatic->email = $tabuser[$obj->rowid]['email'];
|
||||||
@@ -310,7 +310,7 @@ if ($result) {
|
|||||||
if ($userstatic->id > 0) $tabpay[$obj->rowid]["soclib"] = $userstatic->getNomUrl(1, '', 30);
|
if ($userstatic->id > 0) $tabpay[$obj->rowid]["soclib"] = $userstatic->getNomUrl(1, '', 30);
|
||||||
else $tabpay[$obj->rowid]["soclib"] = '???'; // Should not happen, but happens with old data when id of user was not saved on expense report payment.
|
else $tabpay[$obj->rowid]["soclib"] = '???'; // Should not happen, but happens with old data when id of user was not saved on expense report payment.
|
||||||
if ($compta_user) $tabtp[$obj->rowid][$compta_user] += $obj->amount;
|
if ($compta_user) $tabtp[$obj->rowid][$compta_user] += $obj->amount;
|
||||||
} else if ($links[$key]['type'] == 'sc') {
|
} elseif ($links[$key]['type'] == 'sc') {
|
||||||
$chargestatic->id = $links[$key]['url_id'];
|
$chargestatic->id = $links[$key]['url_id'];
|
||||||
$chargestatic->ref = $links[$key]['url_id'];
|
$chargestatic->ref = $links[$key]['url_id'];
|
||||||
|
|
||||||
@@ -339,14 +339,14 @@ if ($result) {
|
|||||||
$objmid = $db->fetch_object($resultmid);
|
$objmid = $db->fetch_object($resultmid);
|
||||||
$tabtp[$obj->rowid][$objmid->accountancy_code] += $obj->amount;
|
$tabtp[$obj->rowid][$objmid->accountancy_code] += $obj->amount;
|
||||||
}
|
}
|
||||||
} else if ($links[$key]['type'] == 'payment_donation') {
|
} elseif ($links[$key]['type'] == 'payment_donation') {
|
||||||
$paymentdonstatic->id = $links[$key]['url_id'];
|
$paymentdonstatic->id = $links[$key]['url_id'];
|
||||||
$paymentdonstatic->ref = $links[$key]['url_id'];
|
$paymentdonstatic->ref = $links[$key]['url_id'];
|
||||||
$paymentdonstatic->fk_donation = $links[$key]['url_id'];
|
$paymentdonstatic->fk_donation = $links[$key]['url_id'];
|
||||||
$tabpay[$obj->rowid]["lib"] .= ' ' . $paymentdonstatic->getNomUrl(2);
|
$tabpay[$obj->rowid]["lib"] .= ' ' . $paymentdonstatic->getNomUrl(2);
|
||||||
$tabpay[$obj->rowid]["paymentdonationid"] = $paymentdonstatic->id;
|
$tabpay[$obj->rowid]["paymentdonationid"] = $paymentdonstatic->id;
|
||||||
$tabtp[$obj->rowid][$account_pay_donation] += $obj->amount;
|
$tabtp[$obj->rowid][$account_pay_donation] += $obj->amount;
|
||||||
} else if ($links[$key]['type'] == 'member') {
|
} elseif ($links[$key]['type'] == 'member') {
|
||||||
$paymentsubscriptionstatic->id = $links[$key]['url_id'];
|
$paymentsubscriptionstatic->id = $links[$key]['url_id'];
|
||||||
$paymentsubscriptionstatic->ref = $links[$key]['url_id'];
|
$paymentsubscriptionstatic->ref = $links[$key]['url_id'];
|
||||||
$paymentsubscriptionstatic->label = $links[$key]['label'];
|
$paymentsubscriptionstatic->label = $links[$key]['label'];
|
||||||
@@ -354,24 +354,24 @@ if ($result) {
|
|||||||
$tabpay[$obj->rowid]["paymentsubscriptionid"] = $paymentsubscriptionstatic->id;
|
$tabpay[$obj->rowid]["paymentsubscriptionid"] = $paymentsubscriptionstatic->id;
|
||||||
$paymentsubscriptionstatic->fetch($paymentsubscriptionstatic->id);
|
$paymentsubscriptionstatic->fetch($paymentsubscriptionstatic->id);
|
||||||
$tabtp[$obj->rowid][$account_pay_subscription] += $obj->amount;
|
$tabtp[$obj->rowid][$account_pay_subscription] += $obj->amount;
|
||||||
} else if ($links[$key]['type'] == 'payment_vat') { // Payment VAT
|
} elseif ($links[$key]['type'] == 'payment_vat') { // Payment VAT
|
||||||
$paymentvatstatic->id = $links[$key]['url_id'];
|
$paymentvatstatic->id = $links[$key]['url_id'];
|
||||||
$paymentvatstatic->ref = $links[$key]['url_id'];
|
$paymentvatstatic->ref = $links[$key]['url_id'];
|
||||||
$paymentvatstatic->label = $links[$key]['label'];
|
$paymentvatstatic->label = $links[$key]['label'];
|
||||||
$tabpay[$obj->rowid]["lib"] .= ' ' . $paymentvatstatic->getNomUrl(2);
|
$tabpay[$obj->rowid]["lib"] .= ' ' . $paymentvatstatic->getNomUrl(2);
|
||||||
$tabpay[$obj->rowid]["paymentvatid"] = $paymentvatstatic->id;
|
$tabpay[$obj->rowid]["paymentvatid"] = $paymentvatstatic->id;
|
||||||
$tabtp[$obj->rowid][$account_pay_vat] += $obj->amount;
|
$tabtp[$obj->rowid][$account_pay_vat] += $obj->amount;
|
||||||
} else if ($links[$key]['type'] == 'payment_salary') {
|
} elseif ($links[$key]['type'] == 'payment_salary') {
|
||||||
$paymentsalstatic->id = $links[$key]['url_id'];
|
$paymentsalstatic->id = $links[$key]['url_id'];
|
||||||
$paymentsalstatic->ref = $links[$key]['url_id'];
|
$paymentsalstatic->ref = $links[$key]['url_id'];
|
||||||
$paymentsalstatic->label = $links[$key]['label'];
|
$paymentsalstatic->label = $links[$key]['label'];
|
||||||
$tabpay[$obj->rowid]["lib"] .= ' ' . $paymentsalstatic->getNomUrl(2);
|
$tabpay[$obj->rowid]["lib"] .= ' ' . $paymentsalstatic->getNomUrl(2);
|
||||||
$tabpay[$obj->rowid]["paymentsalid"] = $paymentsalstatic->id;
|
$tabpay[$obj->rowid]["paymentsalid"] = $paymentsalstatic->id;
|
||||||
} else if ($links[$key]['type'] == 'payment_expensereport') {
|
} elseif ($links[$key]['type'] == 'payment_expensereport') {
|
||||||
$paymentexpensereportstatic->id = $links[$key]['url_id'];
|
$paymentexpensereportstatic->id = $links[$key]['url_id'];
|
||||||
$tabpay[$obj->rowid]["lib"] .= $paymentexpensereportstatic->getNomUrl(2);
|
$tabpay[$obj->rowid]["lib"] .= $paymentexpensereportstatic->getNomUrl(2);
|
||||||
$tabpay[$obj->rowid]["paymentexpensereport"] = $paymentexpensereportstatic->id;
|
$tabpay[$obj->rowid]["paymentexpensereport"] = $paymentexpensereportstatic->id;
|
||||||
} else if ($links[$key]['type'] == 'payment_various') {
|
} elseif ($links[$key]['type'] == 'payment_various') {
|
||||||
$paymentvariousstatic->id = $links[$key]['url_id'];
|
$paymentvariousstatic->id = $links[$key]['url_id'];
|
||||||
$paymentvariousstatic->ref = $links[$key]['url_id'];
|
$paymentvariousstatic->ref = $links[$key]['url_id'];
|
||||||
$paymentvariousstatic->label = $links[$key]['label'];
|
$paymentvariousstatic->label = $links[$key]['label'];
|
||||||
@@ -380,7 +380,7 @@ if ($result) {
|
|||||||
$paymentvariousstatic->fetch($paymentvariousstatic->id);
|
$paymentvariousstatic->fetch($paymentvariousstatic->id);
|
||||||
$account_various = (! empty($paymentvariousstatic->accountancy_code) ? $paymentvariousstatic->accountancy_code : 'NotDefined'); // NotDefined is a reserved word
|
$account_various = (! empty($paymentvariousstatic->accountancy_code) ? $paymentvariousstatic->accountancy_code : 'NotDefined'); // NotDefined is a reserved word
|
||||||
$tabtp[$obj->rowid][$account_various] += $obj->amount;
|
$tabtp[$obj->rowid][$account_various] += $obj->amount;
|
||||||
} else if ($links[$key]['type'] == 'payment_loan') {
|
} elseif ($links[$key]['type'] == 'payment_loan') {
|
||||||
$paymentloanstatic->id = $links[$key]['url_id'];
|
$paymentloanstatic->id = $links[$key]['url_id'];
|
||||||
$paymentloanstatic->ref = $links[$key]['url_id'];
|
$paymentloanstatic->ref = $links[$key]['url_id'];
|
||||||
$paymentloanstatic->fk_loan = $links[$key]['url_id'];
|
$paymentloanstatic->fk_loan = $links[$key]['url_id'];
|
||||||
@@ -399,7 +399,7 @@ if ($result) {
|
|||||||
$tabtp[$obj->rowid][$objmid->accountancy_account_insurance] -= $objmid->amount_insurance;
|
$tabtp[$obj->rowid][$objmid->accountancy_account_insurance] -= $objmid->amount_insurance;
|
||||||
$tabtp[$obj->rowid][$objmid->accountancy_account_interest] -= $objmid->amount_interest;
|
$tabtp[$obj->rowid][$objmid->accountancy_account_interest] -= $objmid->amount_interest;
|
||||||
}
|
}
|
||||||
} else if ($links[$key]['type'] == 'banktransfert') {
|
} elseif ($links[$key]['type'] == 'banktransfert') {
|
||||||
$accountLinestatic->fetch($links[$key]['url_id']);
|
$accountLinestatic->fetch($links[$key]['url_id']);
|
||||||
$tabpay[$obj->rowid]["lib"] .= ' '.$langs->trans("BankTransfer").'- ' .$accountLinestatic ->getNomUrl(1);
|
$tabpay[$obj->rowid]["lib"] .= ' '.$langs->trans("BankTransfer").'- ' .$accountLinestatic ->getNomUrl(1);
|
||||||
$tabtp[$obj->rowid][$account_transfer] += $obj->amount;
|
$tabtp[$obj->rowid][$account_transfer] += $obj->amount;
|
||||||
@@ -567,68 +567,68 @@ if (! $error && $action == 'writebookkeeping') {
|
|||||||
|
|
||||||
$accountingaccount->fetch(null, $conf->global->ACCOUNTING_ACCOUNT_CUSTOMER, true);
|
$accountingaccount->fetch(null, $conf->global->ACCOUNTING_ACCOUNT_CUSTOMER, true);
|
||||||
$bookkeeping->label_compte = $accountingaccount->label;
|
$bookkeeping->label_compte = $accountingaccount->label;
|
||||||
} else if ($tabtype[$key] == 'payment_supplier') { // If payment is payment of supplier invoice, we get ref of invoice
|
} elseif ($tabtype[$key] == 'payment_supplier') { // If payment is payment of supplier invoice, we get ref of invoice
|
||||||
$bookkeeping->subledger_account = $tabcompany[$key]['code_compta'];
|
$bookkeeping->subledger_account = $tabcompany[$key]['code_compta'];
|
||||||
$bookkeeping->subledger_label = $tabcompany[$key]['name'];
|
$bookkeeping->subledger_label = $tabcompany[$key]['name'];
|
||||||
$bookkeeping->numero_compte = $conf->global->ACCOUNTING_ACCOUNT_SUPPLIER;
|
$bookkeeping->numero_compte = $conf->global->ACCOUNTING_ACCOUNT_SUPPLIER;
|
||||||
|
|
||||||
$accountingaccount->fetch(null, $conf->global->ACCOUNTING_ACCOUNT_SUPPLIER, true);
|
$accountingaccount->fetch(null, $conf->global->ACCOUNTING_ACCOUNT_SUPPLIER, true);
|
||||||
$bookkeeping->label_compte = $accountingaccount->label;
|
$bookkeeping->label_compte = $accountingaccount->label;
|
||||||
} else if ($tabtype[$key] == 'payment_expensereport') {
|
} elseif ($tabtype[$key] == 'payment_expensereport') {
|
||||||
$bookkeeping->subledger_account = $tabuser[$key]['accountancy_code'];
|
$bookkeeping->subledger_account = $tabuser[$key]['accountancy_code'];
|
||||||
$bookkeeping->subledger_label = $tabuser[$key]['name'];
|
$bookkeeping->subledger_label = $tabuser[$key]['name'];
|
||||||
$bookkeeping->numero_compte = $conf->global->SALARIES_ACCOUNTING_ACCOUNT_PAYMENT;
|
$bookkeeping->numero_compte = $conf->global->SALARIES_ACCOUNTING_ACCOUNT_PAYMENT;
|
||||||
|
|
||||||
$accountingaccount->fetch(null, $conf->global->SALARIES_ACCOUNTING_ACCOUNT_PAYMENT, true);
|
$accountingaccount->fetch(null, $conf->global->SALARIES_ACCOUNTING_ACCOUNT_PAYMENT, true);
|
||||||
$bookkeeping->label_compte = $accountingaccount->label;
|
$bookkeeping->label_compte = $accountingaccount->label;
|
||||||
} else if ($tabtype[$key] == 'payment_salary') {
|
} elseif ($tabtype[$key] == 'payment_salary') {
|
||||||
$bookkeeping->subledger_account = $tabuser[$key]['accountancy_code'];
|
$bookkeeping->subledger_account = $tabuser[$key]['accountancy_code'];
|
||||||
$bookkeeping->subledger_label = $tabuser[$key]['name'];
|
$bookkeeping->subledger_label = $tabuser[$key]['name'];
|
||||||
$bookkeeping->numero_compte = $conf->global->SALARIES_ACCOUNTING_ACCOUNT_PAYMENT;
|
$bookkeeping->numero_compte = $conf->global->SALARIES_ACCOUNTING_ACCOUNT_PAYMENT;
|
||||||
|
|
||||||
$accountingaccount->fetch(null, $conf->global->SALARIES_ACCOUNTING_ACCOUNT_PAYMENT, true);
|
$accountingaccount->fetch(null, $conf->global->SALARIES_ACCOUNTING_ACCOUNT_PAYMENT, true);
|
||||||
$bookkeeping->label_compte = $accountingaccount->label;
|
$bookkeeping->label_compte = $accountingaccount->label;
|
||||||
} else if (in_array($tabtype[$key], array('sc', 'payment_sc'))) { // If payment is payment of social contribution
|
} elseif (in_array($tabtype[$key], array('sc', 'payment_sc'))) { // If payment is payment of social contribution
|
||||||
$bookkeeping->subledger_account = '';
|
$bookkeeping->subledger_account = '';
|
||||||
$bookkeeping->subledger_label = '';
|
$bookkeeping->subledger_label = '';
|
||||||
$bookkeeping->numero_compte = $k;
|
$bookkeeping->numero_compte = $k;
|
||||||
$bookkeeping->label_compte = $objmid->labelc;
|
$bookkeeping->label_compte = $objmid->labelc;
|
||||||
} else if ($tabtype[$key] == 'payment_vat') {
|
} elseif ($tabtype[$key] == 'payment_vat') {
|
||||||
$bookkeeping->subledger_account = '';
|
$bookkeeping->subledger_account = '';
|
||||||
$bookkeeping->subledger_label = '';
|
$bookkeeping->subledger_label = '';
|
||||||
$bookkeeping->numero_compte = $k;
|
$bookkeeping->numero_compte = $k;
|
||||||
|
|
||||||
$accountingaccount->fetch(null, $k, true);
|
$accountingaccount->fetch(null, $k, true);
|
||||||
$bookkeeping->label_compte = $accountingaccount->label;
|
$bookkeeping->label_compte = $accountingaccount->label;
|
||||||
} else if ($tabtype[$key] == 'payment_donation') {
|
} elseif ($tabtype[$key] == 'payment_donation') {
|
||||||
$bookkeeping->subledger_account = '';
|
$bookkeeping->subledger_account = '';
|
||||||
$bookkeeping->subledger_label = '';
|
$bookkeeping->subledger_label = '';
|
||||||
$bookkeeping->numero_compte = $k;
|
$bookkeeping->numero_compte = $k;
|
||||||
|
|
||||||
$accountingaccount->fetch(null, $k, true);
|
$accountingaccount->fetch(null, $k, true);
|
||||||
$bookkeeping->label_compte = $accountingaccount->label;
|
$bookkeeping->label_compte = $accountingaccount->label;
|
||||||
} else if ($tabtype[$key] == 'member') {
|
} elseif ($tabtype[$key] == 'member') {
|
||||||
$bookkeeping->subledger_account = '';
|
$bookkeeping->subledger_account = '';
|
||||||
$bookkeeping->subledger_label = '';
|
$bookkeeping->subledger_label = '';
|
||||||
$bookkeeping->numero_compte = $k;
|
$bookkeeping->numero_compte = $k;
|
||||||
|
|
||||||
$accountingaccount->fetch(null, $k, true);
|
$accountingaccount->fetch(null, $k, true);
|
||||||
$bookkeeping->label_compte = $accountingaccount->label;
|
$bookkeeping->label_compte = $accountingaccount->label;
|
||||||
} else if ($tabtype[$key] == 'payment_loan') {
|
} elseif ($tabtype[$key] == 'payment_loan') {
|
||||||
$bookkeeping->subledger_account = '';
|
$bookkeeping->subledger_account = '';
|
||||||
$bookkeeping->subledger_label = '';
|
$bookkeeping->subledger_label = '';
|
||||||
$bookkeeping->numero_compte = $k;
|
$bookkeeping->numero_compte = $k;
|
||||||
|
|
||||||
$accountingaccount->fetch(null, $k, true);
|
$accountingaccount->fetch(null, $k, true);
|
||||||
$bookkeeping->label_compte = $accountingaccount->label;
|
$bookkeeping->label_compte = $accountingaccount->label;
|
||||||
} else if ($tabtype[$key] == 'payment_various') {
|
} elseif ($tabtype[$key] == 'payment_various') {
|
||||||
$bookkeeping->subledger_account = '';
|
$bookkeeping->subledger_account = '';
|
||||||
$bookkeeping->subledger_label = '';
|
$bookkeeping->subledger_label = '';
|
||||||
$bookkeeping->numero_compte = $k;
|
$bookkeeping->numero_compte = $k;
|
||||||
|
|
||||||
$accountingaccount->fetch(null, $k, true);
|
$accountingaccount->fetch(null, $k, true);
|
||||||
$bookkeeping->label_compte = $accountingaccount->label;
|
$bookkeeping->label_compte = $accountingaccount->label;
|
||||||
} else if ($tabtype[$key] == 'banktransfert') {
|
} elseif ($tabtype[$key] == 'banktransfert') {
|
||||||
$bookkeeping->subledger_account = '';
|
$bookkeeping->subledger_account = '';
|
||||||
$bookkeeping->subledger_label = '';
|
$bookkeeping->subledger_label = '';
|
||||||
$bookkeeping->numero_compte = $k;
|
$bookkeeping->numero_compte = $k;
|
||||||
@@ -845,11 +845,11 @@ if ($action == 'exportcsv') { // ISO and not UTF8 !
|
|||||||
print '"' . length_accounta(html_entity_decode($k)) . '"' . $sep;
|
print '"' . length_accounta(html_entity_decode($k)) . '"' . $sep;
|
||||||
if ($tabtype[$key] == 'payment_supplier') {
|
if ($tabtype[$key] == 'payment_supplier') {
|
||||||
print '"' . $conf->global->ACCOUNTING_ACCOUNT_SUPPLIER . '"' . $sep;
|
print '"' . $conf->global->ACCOUNTING_ACCOUNT_SUPPLIER . '"' . $sep;
|
||||||
} else if($tabtype[$key] == 'payment') {
|
} elseif($tabtype[$key] == 'payment') {
|
||||||
print '"' . $conf->global->ACCOUNTING_ACCOUNT_CUSTOMER . '"' . $sep;
|
print '"' . $conf->global->ACCOUNTING_ACCOUNT_CUSTOMER . '"' . $sep;
|
||||||
} else if($tabtype[$key] == 'payment_expensereport') {
|
} elseif($tabtype[$key] == 'payment_expensereport') {
|
||||||
print '"' . $conf->global->SALARIES_ACCOUNTING_ACCOUNT_PAYMENT . '"' . $sep;
|
print '"' . $conf->global->SALARIES_ACCOUNTING_ACCOUNT_PAYMENT . '"' . $sep;
|
||||||
} else if($tabtype[$key] == 'payment_salary') {
|
} elseif($tabtype[$key] == 'payment_salary') {
|
||||||
print '"' . $conf->global->SALARIES_ACCOUNTING_ACCOUNT_PAYMENT . '"' . $sep;
|
print '"' . $conf->global->SALARIES_ACCOUNTING_ACCOUNT_PAYMENT . '"' . $sep;
|
||||||
} else {
|
} else {
|
||||||
print '"' . length_accounta(html_entity_decode($k)) . '"' . $sep;
|
print '"' . length_accounta(html_entity_decode($k)) . '"' . $sep;
|
||||||
|
|||||||
@@ -214,12 +214,12 @@ if ($search_month > 0)
|
|||||||
{
|
{
|
||||||
if ($search_year > 0 && empty($search_day))
|
if ($search_year > 0 && empty($search_day))
|
||||||
$sql.= " AND f.datef BETWEEN '".$db->idate(dol_get_first_day($search_year,$search_month,false))."' AND '".$db->idate(dol_get_last_day($search_year,$search_month,false))."'";
|
$sql.= " AND f.datef BETWEEN '".$db->idate(dol_get_first_day($search_year,$search_month,false))."' AND '".$db->idate(dol_get_last_day($search_year,$search_month,false))."'";
|
||||||
else if ($search_year > 0 && ! empty($search_day))
|
elseif ($search_year > 0 && ! empty($search_day))
|
||||||
$sql.= " AND f.datef BETWEEN '".$db->idate(dol_mktime(0, 0, 0, $search_month, $search_day, $search_year))."' AND '".$db->idate(dol_mktime(23, 59, 59, $search_month, $search_day, $search_year))."'";
|
$sql.= " AND f.datef BETWEEN '".$db->idate(dol_mktime(0, 0, 0, $search_month, $search_day, $search_year))."' AND '".$db->idate(dol_mktime(23, 59, 59, $search_month, $search_day, $search_year))."'";
|
||||||
else
|
else
|
||||||
$sql.= " AND date_format(f.datef, '%m') = '".$db->escape($search_month)."'";
|
$sql.= " AND date_format(f.datef, '%m') = '".$db->escape($search_month)."'";
|
||||||
}
|
}
|
||||||
else if ($search_year > 0)
|
elseif ($search_year > 0)
|
||||||
{
|
{
|
||||||
$sql.= " AND f.datef BETWEEN '".$db->idate(dol_get_first_day($search_year,1,false))."' AND '".$db->idate(dol_get_last_day($search_year,12,false))."'";
|
$sql.= " AND f.datef BETWEEN '".$db->idate(dol_get_first_day($search_year,1,false))."' AND '".$db->idate(dol_get_last_day($search_year,12,false))."'";
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -256,12 +256,12 @@ if ($search_month > 0)
|
|||||||
{
|
{
|
||||||
if ($search_year > 0 && empty($search_day))
|
if ($search_year > 0 && empty($search_day))
|
||||||
$sql.= " AND f.datef BETWEEN '".$db->idate(dol_get_first_day($search_year,$search_month,false))."' AND '".$db->idate(dol_get_last_day($search_year,$search_month,false))."'";
|
$sql.= " AND f.datef BETWEEN '".$db->idate(dol_get_first_day($search_year,$search_month,false))."' AND '".$db->idate(dol_get_last_day($search_year,$search_month,false))."'";
|
||||||
else if ($search_year > 0 && ! empty($search_day))
|
elseif ($search_year > 0 && ! empty($search_day))
|
||||||
$sql.= " AND f.datef BETWEEN '".$db->idate(dol_mktime(0, 0, 0, $search_month, $search_day, $search_year))."' AND '".$db->idate(dol_mktime(23, 59, 59, $search_month, $search_day, $search_year))."'";
|
$sql.= " AND f.datef BETWEEN '".$db->idate(dol_mktime(0, 0, 0, $search_month, $search_day, $search_year))."' AND '".$db->idate(dol_mktime(23, 59, 59, $search_month, $search_day, $search_year))."'";
|
||||||
else
|
else
|
||||||
$sql.= " AND date_format(f.datef, '%m') = '".$db->escape($search_month)."'";
|
$sql.= " AND date_format(f.datef, '%m') = '".$db->escape($search_month)."'";
|
||||||
}
|
}
|
||||||
else if ($search_year > 0)
|
elseif ($search_year > 0)
|
||||||
{
|
{
|
||||||
$sql.= " AND f.datef BETWEEN '".$db->idate(dol_get_first_day($search_year,1,false))."' AND '".$db->idate(dol_get_last_day($search_year,12,false))."'";
|
$sql.= " AND f.datef BETWEEN '".$db->idate(dol_get_first_day($search_year,1,false))."' AND '".$db->idate(dol_get_last_day($search_year,12,false))."'";
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -246,7 +246,7 @@ class Adherent extends CommonObject
|
|||||||
* @param string $moreinheader Add more html headers
|
* @param string $moreinheader Add more html headers
|
||||||
* @return int <0 if KO, >0 if OK
|
* @return int <0 if KO, >0 if OK
|
||||||
*/
|
*/
|
||||||
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='', $moreinheader='')
|
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 = '', $moreinheader = '')
|
||||||
{
|
{
|
||||||
// phpcs:enable
|
// phpcs:enable
|
||||||
global $conf,$langs;
|
global $conf,$langs;
|
||||||
@@ -358,7 +358,7 @@ class Adherent extends CommonObject
|
|||||||
* @param string $morphy Nature of the adherent (physical or moral)
|
* @param string $morphy Nature of the adherent (physical or moral)
|
||||||
* @return string Label
|
* @return string Label
|
||||||
*/
|
*/
|
||||||
function getmorphylib($morphy='')
|
function getmorphylib($morphy = '')
|
||||||
{
|
{
|
||||||
global $langs;
|
global $langs;
|
||||||
if (! $morphy) { $morphy=$this->morphy; }
|
if (! $morphy) { $morphy=$this->morphy; }
|
||||||
@@ -374,7 +374,7 @@ class Adherent extends CommonObject
|
|||||||
* @param int $notrigger 1 ne declenche pas les triggers, 0 sinon
|
* @param int $notrigger 1 ne declenche pas les triggers, 0 sinon
|
||||||
* @return int <0 if KO, >0 if OK
|
* @return int <0 if KO, >0 if OK
|
||||||
*/
|
*/
|
||||||
function create($user,$notrigger=0)
|
function create($user, $notrigger = 0)
|
||||||
{
|
{
|
||||||
global $conf,$langs;
|
global $conf,$langs;
|
||||||
|
|
||||||
@@ -500,7 +500,7 @@ class Adherent extends CommonObject
|
|||||||
* @param string $action Current action for hookmanager
|
* @param string $action Current action for hookmanager
|
||||||
* @return int <0 if KO, >0 if OK
|
* @return int <0 if KO, >0 if OK
|
||||||
*/
|
*/
|
||||||
function update($user,$notrigger=0,$nosyncuser=0,$nosyncuserpass=0,$nosyncthirdparty=0,$action='update')
|
function update($user, $notrigger = 0, $nosyncuser = 0, $nosyncuserpass = 0, $nosyncthirdparty = 0, $action = 'update')
|
||||||
{
|
{
|
||||||
global $conf, $langs, $hookmanager;
|
global $conf, $langs, $hookmanager;
|
||||||
|
|
||||||
@@ -817,7 +817,7 @@ class Adherent extends CommonObject
|
|||||||
* @param int $notrigger 1=Does not execute triggers, 0= execute triggers
|
* @param int $notrigger 1=Does not execute triggers, 0= execute triggers
|
||||||
* @return int <0 if KO, 0=nothing to do, >0 if OK
|
* @return int <0 if KO, 0=nothing to do, >0 if OK
|
||||||
*/
|
*/
|
||||||
function delete($rowid, $user, $notrigger=0)
|
function delete($rowid, $user, $notrigger = 0)
|
||||||
{
|
{
|
||||||
global $conf, $langs;
|
global $conf, $langs;
|
||||||
|
|
||||||
@@ -927,7 +927,7 @@ class Adherent extends CommonObject
|
|||||||
* @param int $nosyncuser Do not synchronize linked user
|
* @param int $nosyncuser Do not synchronize linked user
|
||||||
* @return string If OK return clear password, 0 if no change, < 0 if error
|
* @return string If OK return clear password, 0 if no change, < 0 if error
|
||||||
*/
|
*/
|
||||||
function setPassword($user, $password='', $isencrypted=0, $notrigger=0, $nosyncuser=0)
|
function setPassword($user, $password = '', $isencrypted = 0, $notrigger = 0, $nosyncuser = 0)
|
||||||
{
|
{
|
||||||
global $conf, $langs;
|
global $conf, $langs;
|
||||||
|
|
||||||
@@ -1147,7 +1147,7 @@ class Adherent extends CommonObject
|
|||||||
* @param string $lastname Lastname
|
* @param string $lastname Lastname
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
function fetch_name($firstname,$lastname)
|
function fetch_name($firstname, $lastname)
|
||||||
{
|
{
|
||||||
// phpcs:enable
|
// phpcs:enable
|
||||||
global $conf;
|
global $conf;
|
||||||
@@ -1183,7 +1183,7 @@ class Adherent extends CommonObject
|
|||||||
* @param bool $fetch_subscriptions To load member subscriptions
|
* @param bool $fetch_subscriptions To load member subscriptions
|
||||||
* @return int >0 if OK, 0 if not found, <0 if KO
|
* @return int >0 if OK, 0 if not found, <0 if KO
|
||||||
*/
|
*/
|
||||||
function fetch($rowid,$ref='',$fk_soc='',$ref_ext='',$fetch_optionals=true,$fetch_subscriptions=true)
|
function fetch($rowid, $ref = '', $fk_soc = '', $ref_ext = '', $fetch_optionals = true, $fetch_subscriptions = true)
|
||||||
{
|
{
|
||||||
global $langs;
|
global $langs;
|
||||||
|
|
||||||
@@ -1400,7 +1400,7 @@ class Adherent extends CommonObject
|
|||||||
* @param int $datesubend Date end subscription
|
* @param int $datesubend Date end subscription
|
||||||
* @return int rowid of record added, <0 if KO
|
* @return int rowid of record added, <0 if KO
|
||||||
*/
|
*/
|
||||||
function subscription($date, $amount, $accountid=0, $operation='', $label='', $num_chq='', $emetteur_nom='', $emetteur_banque='', $datesubend=0)
|
function subscription($date, $amount, $accountid = 0, $operation = '', $label = '', $num_chq = '', $emetteur_nom = '', $emetteur_banque = '', $datesubend = 0)
|
||||||
{
|
{
|
||||||
global $conf,$langs,$user;
|
global $conf,$langs,$user;
|
||||||
|
|
||||||
@@ -1486,7 +1486,7 @@ class Adherent extends CommonObject
|
|||||||
* @param string $autocreatethirdparty Auto create new thirdparty if member not yet linked to a thirdparty and we request an option that generate invoice.
|
* @param string $autocreatethirdparty Auto create new thirdparty if member not yet linked to a thirdparty and we request an option that generate invoice.
|
||||||
* @return int <0 if KO, >0 if OK
|
* @return int <0 if KO, >0 if OK
|
||||||
*/
|
*/
|
||||||
function subscriptionComplementaryActions($subscriptionid, $option, $accountid, $datesubscription, $paymentdate, $operation, $label, $amount, $num_chq, $emetteur_nom='', $emetteur_banque='', $autocreatethirdparty=0)
|
function subscriptionComplementaryActions($subscriptionid, $option, $accountid, $datesubscription, $paymentdate, $operation, $label, $amount, $num_chq, $emetteur_nom = '', $emetteur_banque = '', $autocreatethirdparty = 0)
|
||||||
{
|
{
|
||||||
global $conf, $langs, $user, $mysoc;
|
global $conf, $langs, $user, $mysoc;
|
||||||
|
|
||||||
@@ -2018,7 +2018,7 @@ class Adherent extends CommonObject
|
|||||||
* @param int $save_lastsearch_value -1=Auto, 0=No save of lastsearch_values when clicking, 1=Save lastsearch_values whenclicking
|
* @param int $save_lastsearch_value -1=Auto, 0=No save of lastsearch_values when clicking, 1=Save lastsearch_values whenclicking
|
||||||
* @return string Chaine avec URL
|
* @return string Chaine avec URL
|
||||||
*/
|
*/
|
||||||
function getNomUrl($withpictoimg=0, $maxlen=0, $option='card', $mode='', $morecss='', $save_lastsearch_value=-1)
|
function getNomUrl($withpictoimg = 0, $maxlen = 0, $option = 'card', $mode = '', $morecss = '', $save_lastsearch_value = -1)
|
||||||
{
|
{
|
||||||
global $conf, $langs;
|
global $conf, $langs;
|
||||||
|
|
||||||
@@ -2109,7 +2109,7 @@ 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
|
* @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
|
* @return string Label
|
||||||
*/
|
*/
|
||||||
function getLibStatut($mode=0)
|
function getLibStatut($mode = 0)
|
||||||
{
|
{
|
||||||
return $this->LibStatut($this->statut,$this->need_subscription,$this->datefin,$mode);
|
return $this->LibStatut($this->statut,$this->need_subscription,$this->datefin,$mode);
|
||||||
}
|
}
|
||||||
@@ -2124,7 +2124,7 @@ 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
|
* @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
|
* @return string Label
|
||||||
*/
|
*/
|
||||||
function LibStatut($statut,$need_subscription,$date_end_subscription,$mode=0)
|
function LibStatut($statut, $need_subscription, $date_end_subscription, $mode = 0)
|
||||||
{
|
{
|
||||||
// phpcs:enable
|
// phpcs:enable
|
||||||
global $langs;
|
global $langs;
|
||||||
@@ -2307,7 +2307,7 @@ class Adherent extends CommonObject
|
|||||||
* @param null|array $moreparams Array to provide more information
|
* @param null|array $moreparams Array to provide more information
|
||||||
* @return int 0 if KO, 1 if OK
|
* @return int 0 if KO, 1 if OK
|
||||||
*/
|
*/
|
||||||
public function generateDocument($modele, $outputlangs, $hidedetails=0, $hidedesc=0, $hideref=0, $moreparams=null)
|
public function generateDocument($modele, $outputlangs, $hidedetails = 0, $hidedesc = 0, $hideref = 0, $moreparams = null)
|
||||||
{
|
{
|
||||||
global $conf,$langs;
|
global $conf,$langs;
|
||||||
|
|
||||||
@@ -2400,7 +2400,7 @@ class Adherent extends CommonObject
|
|||||||
* 2=Return key only (uid=qqq)
|
* 2=Return key only (uid=qqq)
|
||||||
* @return string DN
|
* @return string DN
|
||||||
*/
|
*/
|
||||||
function _load_ldap_dn($info,$mode=0)
|
function _load_ldap_dn($info, $mode = 0)
|
||||||
{
|
{
|
||||||
// phpcs:enable
|
// phpcs:enable
|
||||||
global $conf;
|
global $conf;
|
||||||
@@ -2487,7 +2487,7 @@ class Adherent extends CommonObject
|
|||||||
if (! empty($conf->global->LDAP_MEMBER_FIELD_PASSWORD_CRYPTED)) $info[$conf->global->LDAP_MEMBER_FIELD_PASSWORD_CRYPTED] = dol_hash($this->pass, 4); // Create OpenLDAP MD5 password (TODO add type of encryption)
|
if (! empty($conf->global->LDAP_MEMBER_FIELD_PASSWORD_CRYPTED)) $info[$conf->global->LDAP_MEMBER_FIELD_PASSWORD_CRYPTED] = dol_hash($this->pass, 4); // Create OpenLDAP MD5 password (TODO add type of encryption)
|
||||||
}
|
}
|
||||||
// Set LDAP password if possible
|
// Set LDAP password if possible
|
||||||
else if ($conf->global->LDAP_SERVER_PROTOCOLVERSION !== '3') // If ldap key is modified and LDAPv3 we use ldap_rename function for avoid lose encrypt password
|
elseif ($conf->global->LDAP_SERVER_PROTOCOLVERSION !== '3') // If ldap key is modified and LDAPv3 we use ldap_rename function for avoid lose encrypt password
|
||||||
{
|
{
|
||||||
if (! empty($conf->global->DATABASE_PWD_ENCRYPTED))
|
if (! empty($conf->global->DATABASE_PWD_ENCRYPTED))
|
||||||
{
|
{
|
||||||
@@ -2502,7 +2502,7 @@ class Adherent extends CommonObject
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Use $this->pass_indatabase value if exists
|
// Use $this->pass_indatabase value if exists
|
||||||
else if (! empty($this->pass_indatabase))
|
elseif (! empty($this->pass_indatabase))
|
||||||
{
|
{
|
||||||
if (! empty($conf->global->LDAP_MEMBER_FIELD_PASSWORD)) $info[$conf->global->LDAP_MEMBER_FIELD_PASSWORD] = $this->pass_indatabase; // $this->pass_indatabase = mot de passe non crypte
|
if (! empty($conf->global->LDAP_MEMBER_FIELD_PASSWORD)) $info[$conf->global->LDAP_MEMBER_FIELD_PASSWORD] = $this->pass_indatabase; // $this->pass_indatabase = mot de passe non crypte
|
||||||
if (! empty($conf->global->LDAP_MEMBER_FIELD_PASSWORD_CRYPTED)) $info[$conf->global->LDAP_MEMBER_FIELD_PASSWORD_CRYPTED] = dol_hash($this->pass_indatabase, 4); // md5 for OpenLdap TODO add type of encryption
|
if (! empty($conf->global->LDAP_MEMBER_FIELD_PASSWORD_CRYPTED)) $info[$conf->global->LDAP_MEMBER_FIELD_PASSWORD_CRYPTED] = dol_hash($this->pass_indatabase, 4); // md5 for OpenLdap TODO add type of encryption
|
||||||
@@ -2694,7 +2694,7 @@ class Adherent extends CommonObject
|
|||||||
* @param string $daysbeforeendlist Nb of days before end of subscription (negative number = after subscription). Can be a list of delay, separated by a semicolon, for example '10;5;0;-5'
|
* @param string $daysbeforeendlist Nb of days before end of subscription (negative number = after subscription). Can be a list of delay, separated by a semicolon, for example '10;5;0;-5'
|
||||||
* @return int 0 if OK, <>0 if KO (this function is used also by cron so only 0 is OK)
|
* @return int 0 if OK, <>0 if KO (this function is used also by cron so only 0 is OK)
|
||||||
*/
|
*/
|
||||||
public function sendReminderForExpiredSubscription($daysbeforeendlist='10')
|
public function sendReminderForExpiredSubscription($daysbeforeendlist = '10')
|
||||||
{
|
{
|
||||||
global $conf, $langs, $mysoc, $user;
|
global $conf, $langs, $mysoc, $user;
|
||||||
|
|
||||||
|
|||||||
@@ -103,7 +103,7 @@ class AdherentType extends CommonObject
|
|||||||
* @param int $notrigger 1=do not execute triggers, 0 otherwise
|
* @param int $notrigger 1=do not execute triggers, 0 otherwise
|
||||||
* @return int >0 if OK, < 0 if KO
|
* @return int >0 if OK, < 0 if KO
|
||||||
*/
|
*/
|
||||||
function create($user,$notrigger=0)
|
function create($user, $notrigger = 0)
|
||||||
{
|
{
|
||||||
global $conf;
|
global $conf;
|
||||||
|
|
||||||
@@ -170,7 +170,7 @@ class AdherentType extends CommonObject
|
|||||||
* @param int $notrigger 1=do not execute triggers, 0 otherwise
|
* @param int $notrigger 1=do not execute triggers, 0 otherwise
|
||||||
* @return int >0 if OK, < 0 if KO
|
* @return int >0 if OK, < 0 if KO
|
||||||
*/
|
*/
|
||||||
function update($user,$notrigger=0)
|
function update($user, $notrigger = 0)
|
||||||
{
|
{
|
||||||
global $conf, $hookmanager;
|
global $conf, $hookmanager;
|
||||||
|
|
||||||
@@ -356,7 +356,7 @@ class AdherentType extends CommonObject
|
|||||||
* 2=Return array of members id only
|
* 2=Return array of members id only
|
||||||
* @return mixed Array of members or -1 on error
|
* @return mixed Array of members or -1 on error
|
||||||
*/
|
*/
|
||||||
function listMembersForMemberType($excludefilter='', $mode=0)
|
function listMembersForMemberType($excludefilter = '', $mode = 0)
|
||||||
{
|
{
|
||||||
global $conf, $user;
|
global $conf, $user;
|
||||||
|
|
||||||
@@ -411,7 +411,7 @@ class AdherentType extends CommonObject
|
|||||||
* @param int $notooltip 1=Disable tooltip
|
* @param int $notooltip 1=Disable tooltip
|
||||||
* @return string String with URL
|
* @return string String with URL
|
||||||
*/
|
*/
|
||||||
function getNomUrl($withpicto=0, $maxlen=0, $notooltip=0)
|
function getNomUrl($withpicto = 0, $maxlen = 0, $notooltip = 0)
|
||||||
{
|
{
|
||||||
global $langs;
|
global $langs;
|
||||||
|
|
||||||
@@ -449,7 +449,7 @@ class AdherentType extends CommonObject
|
|||||||
* 2=Return key only (uid=qqq)
|
* 2=Return key only (uid=qqq)
|
||||||
* @return string DN
|
* @return string DN
|
||||||
*/
|
*/
|
||||||
function _load_ldap_dn($info,$mode=0)
|
function _load_ldap_dn($info, $mode = 0)
|
||||||
{
|
{
|
||||||
// phpcs:enable
|
// phpcs:enable
|
||||||
global $conf;
|
global $conf;
|
||||||
|
|||||||
@@ -52,7 +52,7 @@ class AdherentStats extends Stats
|
|||||||
* @param int $socid Id third party
|
* @param int $socid Id third party
|
||||||
* @param int $userid Id user for filter
|
* @param int $userid Id user for filter
|
||||||
*/
|
*/
|
||||||
function __construct($db, $socid=0, $userid=0)
|
function __construct($db, $socid = 0, $userid = 0)
|
||||||
{
|
{
|
||||||
global $user, $conf;
|
global $user, $conf;
|
||||||
|
|
||||||
@@ -85,7 +85,7 @@ class AdherentStats extends Stats
|
|||||||
* @param int $format 0=Label of absiss is a translated text, 1=Label of absiss is month number, 2=Label of absiss is first letter of month
|
* @param int $format 0=Label of absiss is a translated text, 1=Label of absiss is month number, 2=Label of absiss is first letter of month
|
||||||
* @return array Array of nb each month
|
* @return array Array of nb each month
|
||||||
*/
|
*/
|
||||||
function getNbByMonth($year, $format=0)
|
function getNbByMonth($year, $format = 0)
|
||||||
{
|
{
|
||||||
global $user;
|
global $user;
|
||||||
|
|
||||||
@@ -126,7 +126,7 @@ class AdherentStats extends Stats
|
|||||||
* @param int $format 0=Label of absiss is a translated text, 1=Label of absiss is month number, 2=Label of absiss is first letter of month
|
* @param int $format 0=Label of absiss is a translated text, 1=Label of absiss is month number, 2=Label of absiss is first letter of month
|
||||||
* @return array Array of amount each month
|
* @return array Array of amount each month
|
||||||
*/
|
*/
|
||||||
function getAmountByMonth($year, $format=0)
|
function getAmountByMonth($year, $format = 0)
|
||||||
{
|
{
|
||||||
global $user;
|
global $user;
|
||||||
|
|
||||||
|
|||||||
@@ -213,7 +213,7 @@ class Members extends DolibarrApi
|
|||||||
if ($result < 0) {
|
if ($result < 0) {
|
||||||
throw new RestException(500, 'Error when resiliating member: '.$member->error);
|
throw new RestException(500, 'Error when resiliating member: '.$member->error);
|
||||||
}
|
}
|
||||||
} else if ($value == '1') {
|
} elseif ($value == '1') {
|
||||||
$result = $member->validate(DolibarrApiAccess::$user);
|
$result = $member->validate(DolibarrApiAccess::$user);
|
||||||
if ($result < 0) {
|
if ($result < 0) {
|
||||||
throw new RestException(500, 'Error when validating member: '.$member->error);
|
throw new RestException(500, 'Error when validating member: '.$member->error);
|
||||||
@@ -361,7 +361,7 @@ class Members extends DolibarrApi
|
|||||||
*
|
*
|
||||||
* @url POST {id}/subscriptions
|
* @url POST {id}/subscriptions
|
||||||
*/
|
*/
|
||||||
function createSubscription($id, $start_date, $end_date, $amount, $label='')
|
function createSubscription($id, $start_date, $end_date, $amount, $label = '')
|
||||||
{
|
{
|
||||||
if(! DolibarrApiAccess::$user->rights->adherent->cotisation->creer) {
|
if(! DolibarrApiAccess::$user->rights->adherent->cotisation->creer) {
|
||||||
throw new RestException(401);
|
throw new RestException(401);
|
||||||
|
|||||||
@@ -207,7 +207,7 @@ $type=$this->fk_type;
|
|||||||
* @param int $notrigger 0=Disable triggers
|
* @param int $notrigger 0=Disable triggers
|
||||||
* @return int <0 if KO, >0 if OK
|
* @return int <0 if KO, >0 if OK
|
||||||
*/
|
*/
|
||||||
function update($user, $notrigger=0)
|
function update($user, $notrigger = 0)
|
||||||
{
|
{
|
||||||
$error = 0;
|
$error = 0;
|
||||||
|
|
||||||
@@ -263,7 +263,7 @@ $type=$this->fk_type;
|
|||||||
* @param bool $notrigger false=launch triggers after, true=disable triggers
|
* @param bool $notrigger false=launch triggers after, true=disable triggers
|
||||||
* @return int <0 if KO, 0 if not found, >0 if OK
|
* @return int <0 if KO, 0 if not found, >0 if OK
|
||||||
*/
|
*/
|
||||||
function delete($user, $notrigger=false)
|
function delete($user, $notrigger = false)
|
||||||
{
|
{
|
||||||
$error = 0;
|
$error = 0;
|
||||||
|
|
||||||
@@ -356,7 +356,7 @@ $type=$this->fk_type;
|
|||||||
* @param int $save_lastsearch_value -1=Auto, 0=No save of lastsearch_values when clicking, 1=Save lastsearch_values whenclicking
|
* @param int $save_lastsearch_value -1=Auto, 0=No save of lastsearch_values when clicking, 1=Save lastsearch_values whenclicking
|
||||||
* @return string Chaine avec URL
|
* @return string Chaine avec URL
|
||||||
*/
|
*/
|
||||||
function getNomUrl($withpicto=0, $notooltip=0, $option='', $morecss='', $save_lastsearch_value=-1)
|
function getNomUrl($withpicto = 0, $notooltip = 0, $option = '', $morecss = '', $save_lastsearch_value = -1)
|
||||||
{
|
{
|
||||||
global $langs;
|
global $langs;
|
||||||
|
|
||||||
@@ -395,7 +395,7 @@ $type=$this->fk_type;
|
|||||||
* @param int $mode 0=libelle long, 1=libelle court, 2=Picto + Libelle court, 3=Picto, 4=Picto + Libelle long, 5=Libelle court + Picto
|
* @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
|
* @return string Label
|
||||||
*/
|
*/
|
||||||
function getLibStatut($mode=0)
|
function getLibStatut($mode = 0)
|
||||||
{
|
{
|
||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -210,9 +210,9 @@ if ($mode && ! count($data))
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
if ($mode == 'memberbycountry') print $langs->trans("MembersByCountryDesc").'<br>';
|
if ($mode == 'memberbycountry') print $langs->trans("MembersByCountryDesc").'<br>';
|
||||||
else if ($mode == 'memberbystate') print $langs->trans("MembersByStateDesc").'<br>';
|
elseif ($mode == 'memberbystate') print $langs->trans("MembersByStateDesc").'<br>';
|
||||||
else if ($mode == 'memberbytown') print $langs->trans("MembersByTownDesc").'<br>';
|
elseif ($mode == 'memberbytown') print $langs->trans("MembersByTownDesc").'<br>';
|
||||||
else if ($mode == 'memberbyregion') print $langs->trans("MembersByRegion").'<br>';//+
|
elseif ($mode == 'memberbyregion') print $langs->trans("MembersByRegion").'<br>';//+
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
print $langs->trans("MembersStatisticsDesc").'<br>';
|
print $langs->trans("MembersStatisticsDesc").'<br>';
|
||||||
|
|||||||
@@ -793,8 +793,8 @@ if ($rowid > 0)
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (! empty($conf->global->ADHERENT_BANK_USE) && $conf->global->ADHERENT_BANK_USE == 'bankviainvoice' && ! empty($conf->banque->enabled) && ! empty($conf->societe->enabled) && ! empty($conf->facture->enabled)) $bankviainvoice=1;
|
if (! empty($conf->global->ADHERENT_BANK_USE) && $conf->global->ADHERENT_BANK_USE == 'bankviainvoice' && ! empty($conf->banque->enabled) && ! empty($conf->societe->enabled) && ! empty($conf->facture->enabled)) $bankviainvoice=1;
|
||||||
else if (! empty($conf->global->ADHERENT_BANK_USE) && $conf->global->ADHERENT_BANK_USE == 'bankdirect' && ! empty($conf->banque->enabled)) $bankdirect=1;
|
elseif (! empty($conf->global->ADHERENT_BANK_USE) && $conf->global->ADHERENT_BANK_USE == 'bankdirect' && ! empty($conf->banque->enabled)) $bankdirect=1;
|
||||||
else if (! empty($conf->global->ADHERENT_BANK_USE) && $conf->global->ADHERENT_BANK_USE == 'invoiceonly' && ! empty($conf->banque->enabled) && ! empty($conf->societe->enabled) && ! empty($conf->facture->enabled)) $invoiceonly=1;
|
elseif (! empty($conf->global->ADHERENT_BANK_USE) && $conf->global->ADHERENT_BANK_USE == 'invoiceonly' && ! empty($conf->banque->enabled) && ! empty($conf->societe->enabled) && ! empty($conf->facture->enabled)) $invoiceonly=1;
|
||||||
}
|
}
|
||||||
|
|
||||||
print "\n\n<!-- Form add subscription -->\n";
|
print "\n\n<!-- Form add subscription -->\n";
|
||||||
|
|||||||
@@ -538,11 +538,11 @@ if ($rowid > 0)
|
|||||||
if ($status != '')
|
if ($status != '')
|
||||||
{
|
{
|
||||||
if ($status == '-1,1') { $titre=$langs->trans("MembersListQualified"); }
|
if ($status == '-1,1') { $titre=$langs->trans("MembersListQualified"); }
|
||||||
else if ($status == '-1') { $titre=$langs->trans("MembersListToValid"); }
|
elseif ($status == '-1') { $titre=$langs->trans("MembersListToValid"); }
|
||||||
else if ($status == '1' && ! $filter) { $titre=$langs->trans("MembersListValid"); }
|
elseif ($status == '1' && ! $filter) { $titre=$langs->trans("MembersListValid"); }
|
||||||
else if ($status == '1' && $filter=='uptodate') { $titre=$langs->trans("MembersListUpToDate"); }
|
elseif ($status == '1' && $filter=='uptodate') { $titre=$langs->trans("MembersListUpToDate"); }
|
||||||
else if ($status == '1' && $filter=='outofdate') { $titre=$langs->trans("MembersListNotUpToDate"); }
|
elseif ($status == '1' && $filter=='outofdate') { $titre=$langs->trans("MembersListNotUpToDate"); }
|
||||||
else if ($status == '0') { $titre=$langs->trans("MembersListResiliated"); }
|
elseif ($status == '0') { $titre=$langs->trans("MembersListResiliated"); }
|
||||||
}
|
}
|
||||||
elseif ($action == 'search')
|
elseif ($action == 'search')
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -86,7 +86,7 @@ if ($action == 'set')
|
|||||||
dolibarr_set_const($db, 'AGENDA_DEFAULT_FILTER_STATUS', GETPOST('AGENDA_DEFAULT_FILTER_STATUS'), 'chaine', 0, '', $conf->entity);
|
dolibarr_set_const($db, 'AGENDA_DEFAULT_FILTER_STATUS', GETPOST('AGENDA_DEFAULT_FILTER_STATUS'), 'chaine', 0, '', $conf->entity);
|
||||||
dolibarr_set_const($db, 'AGENDA_DEFAULT_VIEW', GETPOST('AGENDA_DEFAULT_VIEW'), 'chaine', 0, '', $conf->entity);
|
dolibarr_set_const($db, 'AGENDA_DEFAULT_VIEW', GETPOST('AGENDA_DEFAULT_VIEW'), 'chaine', 0, '', $conf->entity);
|
||||||
}
|
}
|
||||||
else if ($action == 'specimen') // For orders
|
elseif ($action == 'specimen') // For orders
|
||||||
{
|
{
|
||||||
$modele=GETPOST('module','alpha');
|
$modele=GETPOST('module','alpha');
|
||||||
|
|
||||||
@@ -133,13 +133,13 @@ else if ($action == 'specimen') // For orders
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Activate a model
|
// Activate a model
|
||||||
else if ($action == 'setmodel')
|
elseif ($action == 'setmodel')
|
||||||
{
|
{
|
||||||
//print "sssd".$value;
|
//print "sssd".$value;
|
||||||
$ret = addDocumentModel($value, $type, $label, $scandir);
|
$ret = addDocumentModel($value, $type, $label, $scandir);
|
||||||
}
|
}
|
||||||
|
|
||||||
else if ($action == 'del')
|
elseif ($action == 'del')
|
||||||
{
|
{
|
||||||
$ret = delDocumentModel($value, $type);
|
$ret = delDocumentModel($value, $type);
|
||||||
if ($ret > 0)
|
if ($ret > 0)
|
||||||
@@ -149,7 +149,7 @@ else if ($action == 'del')
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Set default model
|
// Set default model
|
||||||
else if ($action == 'setdoc')
|
elseif ($action == 'setdoc')
|
||||||
{
|
{
|
||||||
if (dolibarr_set_const($db, "ACTION_EVENT_ADDON_PDF",$value,'chaine',0,'',$conf->entity))
|
if (dolibarr_set_const($db, "ACTION_EVENT_ADDON_PDF",$value,'chaine',0,'',$conf->entity))
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -81,7 +81,7 @@ if ($action == 'set')
|
|||||||
dolibarr_set_const($db, 'AGENDA_DEFAULT_FILTER_STATUS', GETPOST('AGENDA_DEFAULT_FILTER_STATUS'), 'chaine', 0, '', $conf->entity);
|
dolibarr_set_const($db, 'AGENDA_DEFAULT_FILTER_STATUS', GETPOST('AGENDA_DEFAULT_FILTER_STATUS'), 'chaine', 0, '', $conf->entity);
|
||||||
dolibarr_set_const($db, 'AGENDA_DEFAULT_VIEW', GETPOST('AGENDA_DEFAULT_VIEW'), 'chaine', 0, '', $conf->entity);
|
dolibarr_set_const($db, 'AGENDA_DEFAULT_VIEW', GETPOST('AGENDA_DEFAULT_VIEW'), 'chaine', 0, '', $conf->entity);
|
||||||
}
|
}
|
||||||
else if ($action == 'specimen') // For orders
|
elseif ($action == 'specimen') // For orders
|
||||||
{
|
{
|
||||||
$modele=GETPOST('module','alpha');
|
$modele=GETPOST('module','alpha');
|
||||||
|
|
||||||
@@ -128,13 +128,13 @@ else if ($action == 'specimen') // For orders
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Activate a model
|
// Activate a model
|
||||||
else if ($action == 'setmodel')
|
elseif ($action == 'setmodel')
|
||||||
{
|
{
|
||||||
//print "sssd".$value;
|
//print "sssd".$value;
|
||||||
$ret = addDocumentModel($value, $type, $label, $scandir);
|
$ret = addDocumentModel($value, $type, $label, $scandir);
|
||||||
}
|
}
|
||||||
|
|
||||||
else if ($action == 'del')
|
elseif ($action == 'del')
|
||||||
{
|
{
|
||||||
$ret = delDocumentModel($value, $type);
|
$ret = delDocumentModel($value, $type);
|
||||||
if ($ret > 0)
|
if ($ret > 0)
|
||||||
@@ -144,7 +144,7 @@ else if ($action == 'del')
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Set default model
|
// Set default model
|
||||||
else if ($action == 'setdoc')
|
elseif ($action == 'setdoc')
|
||||||
{
|
{
|
||||||
if (dolibarr_set_const($db, "ACTION_EVENT_ADDON_PDF",$value,'chaine',0,'',$conf->entity))
|
if (dolibarr_set_const($db, "ACTION_EVENT_ADDON_PDF",$value,'chaine',0,'',$conf->entity))
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -133,7 +133,7 @@ if ($action == 'specimen') {
|
|||||||
if ($action == 'set') {
|
if ($action == 'set') {
|
||||||
$ret = addDocumentModel($value, $type, $label, $scandir);
|
$ret = addDocumentModel($value, $type, $label, $scandir);
|
||||||
}
|
}
|
||||||
else if ($action == 'del') {
|
elseif ($action == 'del') {
|
||||||
$ret = delDocumentModel($value, $type);
|
$ret = delDocumentModel($value, $type);
|
||||||
if ($ret > 0) {
|
if ($ret > 0) {
|
||||||
if ($conf->global->BANKADDON_PDF == "$value")
|
if ($conf->global->BANKADDON_PDF == "$value")
|
||||||
@@ -141,7 +141,7 @@ else if ($action == 'del') {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Set default model
|
// Set default model
|
||||||
else if ($action == 'setdoc') {
|
elseif ($action == 'setdoc') {
|
||||||
if (dolibarr_set_const($db, "BANKADDON_PDF", $value, 'chaine', 0, '',
|
if (dolibarr_set_const($db, "BANKADDON_PDF", $value, 'chaine', 0, '',
|
||||||
$conf->entity)) {
|
$conf->entity)) {
|
||||||
// The constant that was read before the new set
|
// The constant that was read before the new set
|
||||||
|
|||||||
@@ -289,14 +289,14 @@ if ($resql)
|
|||||||
$sql="UPDATE ".MAIN_DB_PREFIX."boxes SET box_order = '".$box_order."' WHERE entity = ".$conf->entity." AND box_order = '".$record['box_order']."'";
|
$sql="UPDATE ".MAIN_DB_PREFIX."boxes SET box_order = '".$box_order."' WHERE entity = ".$conf->entity." AND box_order = '".$record['box_order']."'";
|
||||||
$resql = $db->query($sql);
|
$resql = $db->query($sql);
|
||||||
}
|
}
|
||||||
else if (preg_match("/[02468]{1}/",substr($record['box_order'],-1)))
|
elseif (preg_match("/[02468]{1}/",substr($record['box_order'],-1)))
|
||||||
{
|
{
|
||||||
$box_order = "B0".$record['box_order'];
|
$box_order = "B0".$record['box_order'];
|
||||||
$sql="UPDATE ".MAIN_DB_PREFIX."boxes SET box_order = '".$box_order."' WHERE entity = ".$conf->entity." AND box_order = '".$record['box_order']."'";
|
$sql="UPDATE ".MAIN_DB_PREFIX."boxes SET box_order = '".$box_order."' WHERE entity = ".$conf->entity." AND box_order = '".$record['box_order']."'";
|
||||||
$resql = $db->query($sql);
|
$resql = $db->query($sql);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (dol_strlen($record['box_order']) == 2)
|
elseif (dol_strlen($record['box_order']) == 2)
|
||||||
{
|
{
|
||||||
if (preg_match("/[13579]{1}/",substr($record['box_order'],-1)))
|
if (preg_match("/[13579]{1}/",substr($record['box_order'],-1)))
|
||||||
{
|
{
|
||||||
@@ -304,7 +304,7 @@ if ($resql)
|
|||||||
$sql="UPDATE ".MAIN_DB_PREFIX."boxes SET box_order = '".$box_order."' WHERE entity = ".$conf->entity." AND box_order = '".$record['box_order']."'";
|
$sql="UPDATE ".MAIN_DB_PREFIX."boxes SET box_order = '".$box_order."' WHERE entity = ".$conf->entity." AND box_order = '".$record['box_order']."'";
|
||||||
$resql = $db->query($sql);
|
$resql = $db->query($sql);
|
||||||
}
|
}
|
||||||
else if (preg_match("/[02468]{1}/",substr($record['box_order'],-1)))
|
elseif (preg_match("/[02468]{1}/",substr($record['box_order'],-1)))
|
||||||
{
|
{
|
||||||
$box_order = "B".$record['box_order'];
|
$box_order = "B".$record['box_order'];
|
||||||
$sql="UPDATE ".MAIN_DB_PREFIX."boxes SET box_order = '".$box_order."' WHERE entity = ".$conf->entity." AND box_order = '".$record['box_order']."'";
|
$sql="UPDATE ".MAIN_DB_PREFIX."boxes SET box_order = '".$box_order."' WHERE entity = ".$conf->entity." AND box_order = '".$record['box_order']."'";
|
||||||
|
|||||||
@@ -73,7 +73,7 @@ if ($action == 'updateMask')
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
else if ($action == 'specimen')
|
elseif ($action == 'specimen')
|
||||||
{
|
{
|
||||||
$modele=GETPOST('module','alpha');
|
$modele=GETPOST('module','alpha');
|
||||||
|
|
||||||
@@ -119,12 +119,12 @@ else if ($action == 'specimen')
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Activate a model
|
// Activate a model
|
||||||
else if ($action == 'set')
|
elseif ($action == 'set')
|
||||||
{
|
{
|
||||||
$ret = addDocumentModel($value, $type, $label, $scandir);
|
$ret = addDocumentModel($value, $type, $label, $scandir);
|
||||||
}
|
}
|
||||||
|
|
||||||
else if ($action == 'del')
|
elseif ($action == 'del')
|
||||||
{
|
{
|
||||||
$ret = delDocumentModel($value, $type);
|
$ret = delDocumentModel($value, $type);
|
||||||
if ($ret > 0)
|
if ($ret > 0)
|
||||||
@@ -134,7 +134,7 @@ else if ($action == 'del')
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Set default model
|
// Set default model
|
||||||
else if ($action == 'setdoc')
|
elseif ($action == 'setdoc')
|
||||||
{
|
{
|
||||||
if (dolibarr_set_const($db, "COMMANDE_ADDON_PDF",$value,'chaine',0,'',$conf->entity))
|
if (dolibarr_set_const($db, "COMMANDE_ADDON_PDF",$value,'chaine',0,'',$conf->entity))
|
||||||
{
|
{
|
||||||
@@ -151,7 +151,7 @@ else if ($action == 'setdoc')
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
else if ($action == 'setmod')
|
elseif ($action == 'setmod')
|
||||||
{
|
{
|
||||||
// TODO Check if numbering module chosen can be activated
|
// TODO Check if numbering module chosen can be activated
|
||||||
// by calling method canBeActivated
|
// by calling method canBeActivated
|
||||||
@@ -159,7 +159,7 @@ else if ($action == 'setmod')
|
|||||||
dolibarr_set_const($db, "COMMANDE_ADDON",$value,'chaine',0,'',$conf->entity);
|
dolibarr_set_const($db, "COMMANDE_ADDON",$value,'chaine',0,'',$conf->entity);
|
||||||
}
|
}
|
||||||
|
|
||||||
else if ($action == 'set_COMMANDE_DRAFT_WATERMARK')
|
elseif ($action == 'set_COMMANDE_DRAFT_WATERMARK')
|
||||||
{
|
{
|
||||||
$draft = GETPOST("COMMANDE_DRAFT_WATERMARK");
|
$draft = GETPOST("COMMANDE_DRAFT_WATERMARK");
|
||||||
$res = dolibarr_set_const($db, "COMMANDE_DRAFT_WATERMARK",trim($draft),'chaine',0,'',$conf->entity);
|
$res = dolibarr_set_const($db, "COMMANDE_DRAFT_WATERMARK",trim($draft),'chaine',0,'',$conf->entity);
|
||||||
@@ -176,7 +176,7 @@ else if ($action == 'set_COMMANDE_DRAFT_WATERMARK')
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
else if ($action == 'set_ORDER_FREE_TEXT')
|
elseif ($action == 'set_ORDER_FREE_TEXT')
|
||||||
{
|
{
|
||||||
$freetext = GETPOST("ORDER_FREE_TEXT",'none'); // No alpha here, we want exact string
|
$freetext = GETPOST("ORDER_FREE_TEXT",'none'); // No alpha here, we want exact string
|
||||||
|
|
||||||
@@ -195,7 +195,7 @@ else if ($action == 'set_ORDER_FREE_TEXT')
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Activate Set Shippable Icon In List
|
// Activate Set Shippable Icon In List
|
||||||
else if ($action=="setshippableiconinlist") {
|
elseif ($action=="setshippableiconinlist") {
|
||||||
$setshippableiconinlist = GETPOST('value','int');
|
$setshippableiconinlist = GETPOST('value','int');
|
||||||
$res = dolibarr_set_const($db, "SHIPPABLE_ORDER_ICON_IN_LIST", $setshippableiconinlist,'yesno',0,'',$conf->entity);
|
$res = dolibarr_set_const($db, "SHIPPABLE_ORDER_ICON_IN_LIST", $setshippableiconinlist,'yesno',0,'',$conf->entity);
|
||||||
if (! $res > 0) $error++;
|
if (! $res > 0) $error++;
|
||||||
@@ -207,7 +207,7 @@ else if ($action=="setshippableiconinlist") {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Activate ask for payment bank
|
// Activate ask for payment bank
|
||||||
else if ($action == 'set_BANK_ASK_PAYMENT_BANK_DURING_ORDER')
|
elseif ($action == 'set_BANK_ASK_PAYMENT_BANK_DURING_ORDER')
|
||||||
{
|
{
|
||||||
$res = dolibarr_set_const($db, "BANK_ASK_PAYMENT_BANK_DURING_ORDER",$value,'chaine',0,'',$conf->entity);
|
$res = dolibarr_set_const($db, "BANK_ASK_PAYMENT_BANK_DURING_ORDER",$value,'chaine',0,'',$conf->entity);
|
||||||
|
|
||||||
@@ -224,7 +224,7 @@ else if ($action == 'set_BANK_ASK_PAYMENT_BANK_DURING_ORDER')
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Activate ask for warehouse
|
// Activate ask for warehouse
|
||||||
else if ($action == 'set_WAREHOUSE_ASK_WAREHOUSE_DURING_ORDER')
|
elseif ($action == 'set_WAREHOUSE_ASK_WAREHOUSE_DURING_ORDER')
|
||||||
{
|
{
|
||||||
$res = dolibarr_set_const($db, "WAREHOUSE_ASK_WAREHOUSE_DURING_ORDER",$value,'chaine',0,'',$conf->entity);
|
$res = dolibarr_set_const($db, "WAREHOUSE_ASK_WAREHOUSE_DURING_ORDER",$value,'chaine',0,'',$conf->entity);
|
||||||
|
|
||||||
|
|||||||
@@ -137,7 +137,7 @@ if ( ($action == 'update' && ! GETPOST("cancel",'alpha'))
|
|||||||
}
|
}
|
||||||
else dol_syslog("ErrorImageFormatNotSupported",LOG_WARNING);
|
else dol_syslog("ErrorImageFormatNotSupported",LOG_WARNING);
|
||||||
}
|
}
|
||||||
else if (preg_match('/^ErrorFileIsInfectedWithAVirus/',$result))
|
elseif (preg_match('/^ErrorFileIsInfectedWithAVirus/',$result))
|
||||||
{
|
{
|
||||||
$error++;
|
$error++;
|
||||||
$langs->load("errors");
|
$langs->load("errors");
|
||||||
@@ -821,7 +821,7 @@ else
|
|||||||
{
|
{
|
||||||
print '<a class="img_logo" href="'.$_SERVER["PHP_SELF"].'?action=addthumb&file='.urlencode($mysoc->logo).'">'.img_picto($langs->trans('GenerateThumb'),'refresh').'</a> ';
|
print '<a class="img_logo" href="'.$_SERVER["PHP_SELF"].'?action=addthumb&file='.urlencode($mysoc->logo).'">'.img_picto($langs->trans('GenerateThumb'),'refresh').'</a> ';
|
||||||
}
|
}
|
||||||
else if ($mysoc->logo_mini && is_file($conf->mycompany->dir_output.'/logos/thumbs/'.$mysoc->logo_mini))
|
elseif ($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&file='.urlencode('logos/thumbs/'.$mysoc->logo_mini).'">';
|
print '<img class="img_logo" src="'.DOL_URL_ROOT.'/viewimage.php?modulepart=mycompany&file='.urlencode('logos/thumbs/'.$mysoc->logo_mini).'">';
|
||||||
}
|
}
|
||||||
@@ -1097,11 +1097,11 @@ else
|
|||||||
{
|
{
|
||||||
print $langs->trans("CalcLocaltax1").' - '.$langs->trans("CalcLocaltax1Desc");
|
print $langs->trans("CalcLocaltax1").' - '.$langs->trans("CalcLocaltax1Desc");
|
||||||
}
|
}
|
||||||
else if($conf->global->MAIN_INFO_LOCALTAX_CALC1==1)
|
elseif($conf->global->MAIN_INFO_LOCALTAX_CALC1==1)
|
||||||
{
|
{
|
||||||
print $langs->trans("CalcLocaltax2").' - '.$langs->trans("CalcLocaltax2Desc");
|
print $langs->trans("CalcLocaltax2").' - '.$langs->trans("CalcLocaltax2Desc");
|
||||||
}
|
}
|
||||||
else if($conf->global->MAIN_INFO_LOCALTAX_CALC1==2){
|
elseif($conf->global->MAIN_INFO_LOCALTAX_CALC1==2){
|
||||||
print $langs->trans("CalcLocaltax3").' - '.$langs->trans("CalcLocaltax3Desc");
|
print $langs->trans("CalcLocaltax3").' - '.$langs->trans("CalcLocaltax3Desc");
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1151,11 +1151,11 @@ else
|
|||||||
{
|
{
|
||||||
print $langs->trans("CalcLocaltax1").' - '.$langs->trans("CalcLocaltax1Desc");
|
print $langs->trans("CalcLocaltax1").' - '.$langs->trans("CalcLocaltax1Desc");
|
||||||
}
|
}
|
||||||
else if($conf->global->MAIN_INFO_LOCALTAX_CALC2==1)
|
elseif($conf->global->MAIN_INFO_LOCALTAX_CALC2==1)
|
||||||
{
|
{
|
||||||
print $langs->trans("CalcLocaltax2").' - '.$langs->trans("CalcLocaltax2Desc");
|
print $langs->trans("CalcLocaltax2").' - '.$langs->trans("CalcLocaltax2Desc");
|
||||||
}
|
}
|
||||||
else if($conf->global->MAIN_INFO_LOCALTAX_CALC2==2)
|
elseif($conf->global->MAIN_INFO_LOCALTAX_CALC2==2)
|
||||||
{
|
{
|
||||||
print $langs->trans("CalcLocaltax3").' - '.$langs->trans("CalcLocaltax3Desc");
|
print $langs->trans("CalcLocaltax3").' - '.$langs->trans("CalcLocaltax3Desc");
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -71,7 +71,7 @@ if ($action == 'activate_delivery')
|
|||||||
header("Location: confexped.php");
|
header("Location: confexped.php");
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
else if ($action == 'disable_delivery')
|
elseif ($action == 'disable_delivery')
|
||||||
{
|
{
|
||||||
dolibarr_del_const($db, "MAIN_SUBMODULE_LIVRAISON",$conf->entity);
|
dolibarr_del_const($db, "MAIN_SUBMODULE_LIVRAISON",$conf->entity);
|
||||||
header("Location: confexped.php");
|
header("Location: confexped.php");
|
||||||
|
|||||||
@@ -233,7 +233,7 @@ $sql.= ", entity";
|
|||||||
$sql.= " FROM ".MAIN_DB_PREFIX."const";
|
$sql.= " FROM ".MAIN_DB_PREFIX."const";
|
||||||
$sql.= " WHERE entity IN (".$user->entity.",".$conf->entity.")";
|
$sql.= " WHERE entity IN (".$user->entity.",".$conf->entity.")";
|
||||||
if ((empty($user->entity) || $user->admin) && $debug) {} // to force for superadmin to debug
|
if ((empty($user->entity) || $user->admin) && $debug) {} // to force for superadmin to debug
|
||||||
else if (! GETPOST('visible') || GETPOST('visible') != 'all') $sql.= " AND visible = 1"; // We must always have this. Otherwise, array is too large and submitting data fails due to apache POST or GET limits
|
elseif (! GETPOST('visible') || GETPOST('visible') != 'all') $sql.= " AND visible = 1"; // We must always have this. Otherwise, array is too large and submitting data fails due to apache POST or GET limits
|
||||||
if (GETPOST('name')) $sql.=natural_search("name", GETPOST('name'));
|
if (GETPOST('name')) $sql.=natural_search("name", GETPOST('name'));
|
||||||
$sql.= " ORDER BY entity, name ASC";
|
$sql.= " ORDER BY entity, name ASC";
|
||||||
|
|
||||||
|
|||||||
@@ -69,7 +69,7 @@ if ($action == 'updateMask')
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
else if ($action == 'specimen') // For contract
|
elseif ($action == 'specimen') // For contract
|
||||||
{
|
{
|
||||||
$modele= GETPOST('module','alpha');
|
$modele= GETPOST('module','alpha');
|
||||||
|
|
||||||
@@ -115,12 +115,12 @@ else if ($action == 'specimen') // For contract
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Activate a model
|
// Activate a model
|
||||||
else if ($action == 'set')
|
elseif ($action == 'set')
|
||||||
{
|
{
|
||||||
$ret = addDocumentModel($value, $type, $label, $scandir);
|
$ret = addDocumentModel($value, $type, $label, $scandir);
|
||||||
}
|
}
|
||||||
|
|
||||||
else if ($action == 'del')
|
elseif ($action == 'del')
|
||||||
{
|
{
|
||||||
$ret = delDocumentModel($value, $type);
|
$ret = delDocumentModel($value, $type);
|
||||||
if ($ret > 0)
|
if ($ret > 0)
|
||||||
@@ -130,7 +130,7 @@ else if ($action == 'del')
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Set default model
|
// Set default model
|
||||||
else if ($action == 'setdoc')
|
elseif ($action == 'setdoc')
|
||||||
{
|
{
|
||||||
if (dolibarr_set_const($db, "CONTRACT_ADDON_PDF",$value,'chaine',0,'',$conf->entity))
|
if (dolibarr_set_const($db, "CONTRACT_ADDON_PDF",$value,'chaine',0,'',$conf->entity))
|
||||||
{
|
{
|
||||||
@@ -147,7 +147,7 @@ else if ($action == 'setdoc')
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
else if ($action == 'setmod')
|
elseif ($action == 'setmod')
|
||||||
{
|
{
|
||||||
// TODO Verifier si module numerotation choisi peut etre active
|
// TODO Verifier si module numerotation choisi peut etre active
|
||||||
// par appel methode canBeActivated
|
// par appel methode canBeActivated
|
||||||
@@ -155,7 +155,7 @@ else if ($action == 'setmod')
|
|||||||
dolibarr_set_const($db, "CONTRACT_ADDON",$value,'chaine',0,'',$conf->entity);
|
dolibarr_set_const($db, "CONTRACT_ADDON",$value,'chaine',0,'',$conf->entity);
|
||||||
}
|
}
|
||||||
|
|
||||||
else if ($action == 'set_other')
|
elseif ($action == 'set_other')
|
||||||
{
|
{
|
||||||
$freetext= GETPOST('CONTRACT_FREE_TEXT','none'); // No alpha here, we want exact string
|
$freetext= GETPOST('CONTRACT_FREE_TEXT','none'); // No alpha here, we want exact string
|
||||||
$res1 = dolibarr_set_const($db, "CONTRACT_FREE_TEXT",$freetext,'chaine',0,'',$conf->entity);
|
$res1 = dolibarr_set_const($db, "CONTRACT_FREE_TEXT",$freetext,'chaine',0,'',$conf->entity);
|
||||||
|
|||||||
@@ -728,7 +728,7 @@ if (GETPOST('actionadd') || GETPOST('actionmodify'))
|
|||||||
if ($value == 'price' || preg_match('/^amount/i',$value) || $value == 'taux') {
|
if ($value == 'price' || preg_match('/^amount/i',$value) || $value == 'taux') {
|
||||||
$_POST[$listfieldvalue[$i]] = price2num($_POST[$listfieldvalue[$i]],'MU');
|
$_POST[$listfieldvalue[$i]] = price2num($_POST[$listfieldvalue[$i]],'MU');
|
||||||
}
|
}
|
||||||
else if ($value == 'entity') {
|
elseif ($value == 'entity') {
|
||||||
$_POST[$listfieldvalue[$i]] = getEntity($tabname[$id]);
|
$_POST[$listfieldvalue[$i]] = getEntity($tabname[$id]);
|
||||||
}
|
}
|
||||||
if ($i) $sql.=",";
|
if ($i) $sql.=",";
|
||||||
@@ -780,7 +780,7 @@ if (GETPOST('actionadd') || GETPOST('actionmodify'))
|
|||||||
if ($field == 'price' || preg_match('/^amount/i',$field) || $field == 'taux') {
|
if ($field == 'price' || preg_match('/^amount/i',$field) || $field == 'taux') {
|
||||||
$_POST[$listfieldvalue[$i]] = price2num($_POST[$listfieldvalue[$i]],'MU');
|
$_POST[$listfieldvalue[$i]] = price2num($_POST[$listfieldvalue[$i]],'MU');
|
||||||
}
|
}
|
||||||
else if ($field == 'entity') {
|
elseif ($field == 'entity') {
|
||||||
$_POST[$listfieldvalue[$i]] = getEntity($tabname[$id]);
|
$_POST[$listfieldvalue[$i]] = getEntity($tabname[$id]);
|
||||||
}
|
}
|
||||||
if ($i) $sql.=",";
|
if ($i) $sql.=",";
|
||||||
@@ -1125,7 +1125,7 @@ if ($id)
|
|||||||
{
|
{
|
||||||
print '<td'.($class?' class="'.$class.'"':'').'>';
|
print '<td'.($class?' class="'.$class.'"':'').'>';
|
||||||
if (! empty($tabhelp[$id][$value]) && preg_match('/^http(s*):/i',$tabhelp[$id][$value])) print '<a href="'.$tabhelp[$id][$value].'" target="_blank">'.$valuetoshow.' '.img_help(1,$valuetoshow).'</a>';
|
if (! empty($tabhelp[$id][$value]) && preg_match('/^http(s*):/i',$tabhelp[$id][$value])) print '<a href="'.$tabhelp[$id][$value].'" target="_blank">'.$valuetoshow.' '.img_help(1,$valuetoshow).'</a>';
|
||||||
else if (! empty($tabhelp[$id][$value])) print $form->textwithpicto($valuetoshow,$tabhelp[$id][$value]);
|
elseif (! empty($tabhelp[$id][$value])) print $form->textwithpicto($valuetoshow,$tabhelp[$id][$value]);
|
||||||
else print $valuetoshow;
|
else print $valuetoshow;
|
||||||
print '</td>';
|
print '</td>';
|
||||||
}
|
}
|
||||||
@@ -1409,14 +1409,14 @@ if ($id)
|
|||||||
{
|
{
|
||||||
$valuetoshow = isset($elementList[$valuetoshow])?$elementList[$valuetoshow]:$valuetoshow;
|
$valuetoshow = isset($elementList[$valuetoshow])?$elementList[$valuetoshow]:$valuetoshow;
|
||||||
}
|
}
|
||||||
else if ($value == 'source')
|
elseif ($value == 'source')
|
||||||
{
|
{
|
||||||
$valuetoshow = isset($sourceList[$valuetoshow])?$sourceList[$valuetoshow]:$valuetoshow;
|
$valuetoshow = isset($sourceList[$valuetoshow])?$sourceList[$valuetoshow]:$valuetoshow;
|
||||||
}
|
}
|
||||||
else if ($valuetoshow=='all') {
|
elseif ($valuetoshow=='all') {
|
||||||
$valuetoshow=$langs->trans('All');
|
$valuetoshow=$langs->trans('All');
|
||||||
}
|
}
|
||||||
else if ($fieldlist[$field]=='country') {
|
elseif ($fieldlist[$field]=='country') {
|
||||||
if (empty($obj->country_code))
|
if (empty($obj->country_code))
|
||||||
{
|
{
|
||||||
$valuetoshow='-';
|
$valuetoshow='-';
|
||||||
@@ -1427,143 +1427,143 @@ if ($id)
|
|||||||
$valuetoshow=($key != "Country".strtoupper($obj->country_code)?$obj->country_code." - ".$key:$obj->country);
|
$valuetoshow=($key != "Country".strtoupper($obj->country_code)?$obj->country_code." - ".$key:$obj->country);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if ($fieldlist[$field]=='recuperableonly' || $fieldlist[$field] == 'deductible' || $fieldlist[$field] == 'category_type') {
|
elseif ($fieldlist[$field]=='recuperableonly' || $fieldlist[$field] == 'deductible' || $fieldlist[$field] == 'category_type') {
|
||||||
$valuetoshow=yn($valuetoshow);
|
$valuetoshow=yn($valuetoshow);
|
||||||
$align="center";
|
$align="center";
|
||||||
}
|
}
|
||||||
else if ($fieldlist[$field]=='type_cdr') {
|
elseif ($fieldlist[$field]=='type_cdr') {
|
||||||
if(empty($valuetoshow)) $valuetoshow = $langs->trans('None');
|
if(empty($valuetoshow)) $valuetoshow = $langs->trans('None');
|
||||||
elseif($valuetoshow == 1) $valuetoshow = $langs->trans('AtEndOfMonth');
|
elseif($valuetoshow == 1) $valuetoshow = $langs->trans('AtEndOfMonth');
|
||||||
elseif($valuetoshow == 2) $valuetoshow = $langs->trans('CurrentNext');
|
elseif($valuetoshow == 2) $valuetoshow = $langs->trans('CurrentNext');
|
||||||
$align="center";
|
$align="center";
|
||||||
}
|
}
|
||||||
else if ($fieldlist[$field]=='price' || preg_match('/^amount/i',$fieldlist[$field])) {
|
elseif ($fieldlist[$field]=='price' || preg_match('/^amount/i',$fieldlist[$field])) {
|
||||||
$valuetoshow=price($valuetoshow);
|
$valuetoshow=price($valuetoshow);
|
||||||
}
|
}
|
||||||
if ($value == 'private')
|
if ($value == 'private')
|
||||||
{
|
{
|
||||||
$valuetoshow = yn($elementList[$valuetoshow]);
|
$valuetoshow = yn($elementList[$valuetoshow]);
|
||||||
}
|
}
|
||||||
else if ($fieldlist[$field]=='libelle_facture') {
|
elseif ($fieldlist[$field]=='libelle_facture') {
|
||||||
$langs->load("bills");
|
$langs->load("bills");
|
||||||
$key=$langs->trans("PaymentCondition".strtoupper($obj->code));
|
$key=$langs->trans("PaymentCondition".strtoupper($obj->code));
|
||||||
$valuetoshow=($obj->code && $key != "PaymentCondition".strtoupper($obj->code)?$key:$obj->{$fieldlist[$field]});
|
$valuetoshow=($obj->code && $key != "PaymentCondition".strtoupper($obj->code)?$key:$obj->{$fieldlist[$field]});
|
||||||
$valuetoshow=nl2br($valuetoshow);
|
$valuetoshow=nl2br($valuetoshow);
|
||||||
}
|
}
|
||||||
else if ($fieldlist[$field]=='label' && $tabname[$id]==MAIN_DB_PREFIX.'c_country') {
|
elseif ($fieldlist[$field]=='label' && $tabname[$id]==MAIN_DB_PREFIX.'c_country') {
|
||||||
$key=$langs->trans("Country".strtoupper($obj->code));
|
$key=$langs->trans("Country".strtoupper($obj->code));
|
||||||
$valuetoshow=($obj->code && $key != "Country".strtoupper($obj->code)?$key:$obj->{$fieldlist[$field]});
|
$valuetoshow=($obj->code && $key != "Country".strtoupper($obj->code)?$key:$obj->{$fieldlist[$field]});
|
||||||
}
|
}
|
||||||
else if ($fieldlist[$field]=='label' && $tabname[$id]==MAIN_DB_PREFIX.'c_availability') {
|
elseif ($fieldlist[$field]=='label' && $tabname[$id]==MAIN_DB_PREFIX.'c_availability') {
|
||||||
$langs->load("propal");
|
$langs->load("propal");
|
||||||
$key=$langs->trans("AvailabilityType".strtoupper($obj->code));
|
$key=$langs->trans("AvailabilityType".strtoupper($obj->code));
|
||||||
$valuetoshow=($obj->code && $key != "AvailabilityType".strtoupper($obj->code)?$key:$obj->{$fieldlist[$field]});
|
$valuetoshow=($obj->code && $key != "AvailabilityType".strtoupper($obj->code)?$key:$obj->{$fieldlist[$field]});
|
||||||
}
|
}
|
||||||
else if ($fieldlist[$field]=='libelle' && $tabname[$id]==MAIN_DB_PREFIX.'c_actioncomm') {
|
elseif ($fieldlist[$field]=='libelle' && $tabname[$id]==MAIN_DB_PREFIX.'c_actioncomm') {
|
||||||
$key=$langs->trans("Action".strtoupper($obj->code));
|
$key=$langs->trans("Action".strtoupper($obj->code));
|
||||||
$valuetoshow=($obj->code && $key != "Action".strtoupper($obj->code)?$key:$obj->{$fieldlist[$field]});
|
$valuetoshow=($obj->code && $key != "Action".strtoupper($obj->code)?$key:$obj->{$fieldlist[$field]});
|
||||||
}
|
}
|
||||||
else if (! empty($obj->code_iso) && $fieldlist[$field]=='label' && $tabname[$id]==MAIN_DB_PREFIX.'c_currencies') {
|
elseif (! empty($obj->code_iso) && $fieldlist[$field]=='label' && $tabname[$id]==MAIN_DB_PREFIX.'c_currencies') {
|
||||||
$key=$langs->trans("Currency".strtoupper($obj->code_iso));
|
$key=$langs->trans("Currency".strtoupper($obj->code_iso));
|
||||||
$valuetoshow=($obj->code_iso && $key != "Currency".strtoupper($obj->code_iso)?$key:$obj->{$fieldlist[$field]});
|
$valuetoshow=($obj->code_iso && $key != "Currency".strtoupper($obj->code_iso)?$key:$obj->{$fieldlist[$field]});
|
||||||
}
|
}
|
||||||
else if ($fieldlist[$field]=='libelle' && $tabname[$id]==MAIN_DB_PREFIX.'c_typent') {
|
elseif ($fieldlist[$field]=='libelle' && $tabname[$id]==MAIN_DB_PREFIX.'c_typent') {
|
||||||
$key=$langs->trans(strtoupper($obj->code));
|
$key=$langs->trans(strtoupper($obj->code));
|
||||||
$valuetoshow=($key != strtoupper($obj->code)?$key:$obj->{$fieldlist[$field]});
|
$valuetoshow=($key != strtoupper($obj->code)?$key:$obj->{$fieldlist[$field]});
|
||||||
}
|
}
|
||||||
else if ($fieldlist[$field]=='libelle' && $tabname[$id]==MAIN_DB_PREFIX.'c_prospectlevel') {
|
elseif ($fieldlist[$field]=='libelle' && $tabname[$id]==MAIN_DB_PREFIX.'c_prospectlevel') {
|
||||||
$key=$langs->trans(strtoupper($obj->code));
|
$key=$langs->trans(strtoupper($obj->code));
|
||||||
$valuetoshow=($key != strtoupper($obj->code)?$key:$obj->{$fieldlist[$field]});
|
$valuetoshow=($key != strtoupper($obj->code)?$key:$obj->{$fieldlist[$field]});
|
||||||
}
|
}
|
||||||
else if ($fieldlist[$field]=='label' && $tabname[$id]==MAIN_DB_PREFIX.'c_civility') {
|
elseif ($fieldlist[$field]=='label' && $tabname[$id]==MAIN_DB_PREFIX.'c_civility') {
|
||||||
$key=$langs->trans("Civility".strtoupper($obj->code));
|
$key=$langs->trans("Civility".strtoupper($obj->code));
|
||||||
$valuetoshow=($obj->code && $key != "Civility".strtoupper($obj->code)?$key:$obj->{$fieldlist[$field]});
|
$valuetoshow=($obj->code && $key != "Civility".strtoupper($obj->code)?$key:$obj->{$fieldlist[$field]});
|
||||||
}
|
}
|
||||||
else if ($fieldlist[$field]=='libelle' && $tabname[$id]==MAIN_DB_PREFIX.'c_type_contact') {
|
elseif ($fieldlist[$field]=='libelle' && $tabname[$id]==MAIN_DB_PREFIX.'c_type_contact') {
|
||||||
$langs->load('agenda');
|
$langs->load('agenda');
|
||||||
$key=$langs->trans("TypeContact_".$obj->element."_".$obj->source."_".strtoupper($obj->code));
|
$key=$langs->trans("TypeContact_".$obj->element."_".$obj->source."_".strtoupper($obj->code));
|
||||||
$valuetoshow=($obj->code && $key != "TypeContact_".$obj->element."_".$obj->source."_".strtoupper($obj->code)?$key:$obj->{$fieldlist[$field]});
|
$valuetoshow=($obj->code && $key != "TypeContact_".$obj->element."_".$obj->source."_".strtoupper($obj->code)?$key:$obj->{$fieldlist[$field]});
|
||||||
}
|
}
|
||||||
else if ($fieldlist[$field]=='libelle' && $tabname[$id]==MAIN_DB_PREFIX.'c_payment_term') {
|
elseif ($fieldlist[$field]=='libelle' && $tabname[$id]==MAIN_DB_PREFIX.'c_payment_term') {
|
||||||
$langs->load("bills");
|
$langs->load("bills");
|
||||||
$key=$langs->trans("PaymentConditionShort".strtoupper($obj->code));
|
$key=$langs->trans("PaymentConditionShort".strtoupper($obj->code));
|
||||||
$valuetoshow=($obj->code && $key != "PaymentConditionShort".strtoupper($obj->code)?$key:$obj->{$fieldlist[$field]});
|
$valuetoshow=($obj->code && $key != "PaymentConditionShort".strtoupper($obj->code)?$key:$obj->{$fieldlist[$field]});
|
||||||
}
|
}
|
||||||
else if ($fieldlist[$field]=='libelle' && $tabname[$id]==MAIN_DB_PREFIX.'c_paiement') {
|
elseif ($fieldlist[$field]=='libelle' && $tabname[$id]==MAIN_DB_PREFIX.'c_paiement') {
|
||||||
$langs->load("bills");
|
$langs->load("bills");
|
||||||
$key=$langs->trans("PaymentType".strtoupper($obj->code));
|
$key=$langs->trans("PaymentType".strtoupper($obj->code));
|
||||||
$valuetoshow=($obj->code && $key != "PaymentType".strtoupper($obj->code)?$key:$obj->{$fieldlist[$field]});
|
$valuetoshow=($obj->code && $key != "PaymentType".strtoupper($obj->code)?$key:$obj->{$fieldlist[$field]});
|
||||||
}
|
}
|
||||||
else if ($fieldlist[$field]=='label' && $tabname[$id]==MAIN_DB_PREFIX.'c_input_reason') {
|
elseif ($fieldlist[$field]=='label' && $tabname[$id]==MAIN_DB_PREFIX.'c_input_reason') {
|
||||||
$key=$langs->trans("DemandReasonType".strtoupper($obj->code));
|
$key=$langs->trans("DemandReasonType".strtoupper($obj->code));
|
||||||
$valuetoshow=($obj->code && $key != "DemandReasonType".strtoupper($obj->code)?$key:$obj->{$fieldlist[$field]});
|
$valuetoshow=($obj->code && $key != "DemandReasonType".strtoupper($obj->code)?$key:$obj->{$fieldlist[$field]});
|
||||||
}
|
}
|
||||||
else if ($fieldlist[$field]=='libelle' && $tabname[$id]==MAIN_DB_PREFIX.'c_input_method') {
|
elseif ($fieldlist[$field]=='libelle' && $tabname[$id]==MAIN_DB_PREFIX.'c_input_method') {
|
||||||
$langs->load("orders");
|
$langs->load("orders");
|
||||||
$key=$langs->trans($obj->code);
|
$key=$langs->trans($obj->code);
|
||||||
$valuetoshow=($obj->code && $key != $obj->code)?$key:$obj->{$fieldlist[$field]};
|
$valuetoshow=($obj->code && $key != $obj->code)?$key:$obj->{$fieldlist[$field]};
|
||||||
}
|
}
|
||||||
else if ($fieldlist[$field]=='libelle' && $tabname[$id]==MAIN_DB_PREFIX.'c_shipment_mode') {
|
elseif ($fieldlist[$field]=='libelle' && $tabname[$id]==MAIN_DB_PREFIX.'c_shipment_mode') {
|
||||||
$langs->load("sendings");
|
$langs->load("sendings");
|
||||||
$key=$langs->trans("SendingMethod".strtoupper($obj->code));
|
$key=$langs->trans("SendingMethod".strtoupper($obj->code));
|
||||||
$valuetoshow=($obj->code && $key != "SendingMethod".strtoupper($obj->code)?$key:$obj->{$fieldlist[$field]});
|
$valuetoshow=($obj->code && $key != "SendingMethod".strtoupper($obj->code)?$key:$obj->{$fieldlist[$field]});
|
||||||
}
|
}
|
||||||
else if ($fieldlist[$field] == 'libelle' && $tabname[$id]==MAIN_DB_PREFIX.'c_paper_format')
|
elseif ($fieldlist[$field] == 'libelle' && $tabname[$id]==MAIN_DB_PREFIX.'c_paper_format')
|
||||||
{
|
{
|
||||||
$key = $langs->trans('PaperFormat'.strtoupper($obj->code));
|
$key = $langs->trans('PaperFormat'.strtoupper($obj->code));
|
||||||
$valuetoshow = ($obj->code && $key != 'PaperFormat'.strtoupper($obj->code) ? $key : $obj->{$fieldlist[$field]});
|
$valuetoshow = ($obj->code && $key != 'PaperFormat'.strtoupper($obj->code) ? $key : $obj->{$fieldlist[$field]});
|
||||||
}
|
}
|
||||||
else if ($fieldlist[$field] == 'label' && $tabname[$id] == MAIN_DB_PREFIX.'c_type_fees')
|
elseif ($fieldlist[$field] == 'label' && $tabname[$id] == MAIN_DB_PREFIX.'c_type_fees')
|
||||||
{
|
{
|
||||||
$langs->load('trips');
|
$langs->load('trips');
|
||||||
$key = $langs->trans(strtoupper($obj->code));
|
$key = $langs->trans(strtoupper($obj->code));
|
||||||
$valuetoshow = ($obj->code && $key != strtoupper($obj->code) ? $key : $obj->{$fieldlist[$field]});
|
$valuetoshow = ($obj->code && $key != strtoupper($obj->code) ? $key : $obj->{$fieldlist[$field]});
|
||||||
}
|
}
|
||||||
else if ($fieldlist[$field]=='region_id' || $fieldlist[$field]=='country_id') {
|
elseif ($fieldlist[$field]=='region_id' || $fieldlist[$field]=='country_id') {
|
||||||
$showfield=0;
|
$showfield=0;
|
||||||
}
|
}
|
||||||
else if ($fieldlist[$field]=='unicode') {
|
elseif ($fieldlist[$field]=='unicode') {
|
||||||
$valuetoshow = $langs->getCurrencySymbol($obj->code,1);
|
$valuetoshow = $langs->getCurrencySymbol($obj->code,1);
|
||||||
}
|
}
|
||||||
else if ($fieldlist[$field]=='label' && $tabname[$_GET["id"]]==MAIN_DB_PREFIX.'c_units') {
|
elseif ($fieldlist[$field]=='label' && $tabname[$_GET["id"]]==MAIN_DB_PREFIX.'c_units') {
|
||||||
$langs->load("products");
|
$langs->load("products");
|
||||||
$valuetoshow=$langs->trans($obj->{$fieldlist[$field]});
|
$valuetoshow=$langs->trans($obj->{$fieldlist[$field]});
|
||||||
}
|
}
|
||||||
else if ($fieldlist[$field]=='short_label' && $tabname[$_GET["id"]]==MAIN_DB_PREFIX.'c_units') {
|
elseif ($fieldlist[$field]=='short_label' && $tabname[$_GET["id"]]==MAIN_DB_PREFIX.'c_units') {
|
||||||
$langs->load("products");
|
$langs->load("products");
|
||||||
$valuetoshow = $langs->trans($obj->{$fieldlist[$field]});
|
$valuetoshow = $langs->trans($obj->{$fieldlist[$field]});
|
||||||
}
|
}
|
||||||
else if (($fieldlist[$field] == 'unit') && ($tabname[$id] == MAIN_DB_PREFIX.'c_paper_format'))
|
elseif (($fieldlist[$field] == 'unit') && ($tabname[$id] == MAIN_DB_PREFIX.'c_paper_format'))
|
||||||
{
|
{
|
||||||
$key = $langs->trans('SizeUnit'.strtolower($obj->unit));
|
$key = $langs->trans('SizeUnit'.strtolower($obj->unit));
|
||||||
$valuetoshow = ($obj->code && $key != 'SizeUnit'.strtolower($obj->unit) ? $key : $obj->{$fieldlist[$field]});
|
$valuetoshow = ($obj->code && $key != 'SizeUnit'.strtolower($obj->unit) ? $key : $obj->{$fieldlist[$field]});
|
||||||
}
|
}
|
||||||
else if ($fieldlist[$field]=='localtax1' || $fieldlist[$field]=='localtax2') {
|
elseif ($fieldlist[$field]=='localtax1' || $fieldlist[$field]=='localtax2') {
|
||||||
$align="center";
|
$align="center";
|
||||||
}
|
}
|
||||||
else if ($fieldlist[$field]=='localtax1_type') {
|
elseif ($fieldlist[$field]=='localtax1_type') {
|
||||||
if ($obj->localtax1 != 0)
|
if ($obj->localtax1 != 0)
|
||||||
$valuetoshow=$localtax_typeList[$valuetoshow];
|
$valuetoshow=$localtax_typeList[$valuetoshow];
|
||||||
else
|
else
|
||||||
$valuetoshow = '';
|
$valuetoshow = '';
|
||||||
$align="center";
|
$align="center";
|
||||||
}
|
}
|
||||||
else if ($fieldlist[$field]=='localtax2_type') {
|
elseif ($fieldlist[$field]=='localtax2_type') {
|
||||||
if ($obj->localtax2 != 0)
|
if ($obj->localtax2 != 0)
|
||||||
$valuetoshow=$localtax_typeList[$valuetoshow];
|
$valuetoshow=$localtax_typeList[$valuetoshow];
|
||||||
else
|
else
|
||||||
$valuetoshow = '';
|
$valuetoshow = '';
|
||||||
$align="center";
|
$align="center";
|
||||||
}
|
}
|
||||||
else if ($fieldlist[$field]=='taux') {
|
elseif ($fieldlist[$field]=='taux') {
|
||||||
$valuetoshow = price($valuetoshow, 0, $langs, 0, 0);
|
$valuetoshow = price($valuetoshow, 0, $langs, 0, 0);
|
||||||
$align="center";
|
$align="center";
|
||||||
}
|
}
|
||||||
else if (in_array($fieldlist[$field],array('recuperableonly')))
|
elseif (in_array($fieldlist[$field],array('recuperableonly')))
|
||||||
{
|
{
|
||||||
$align="center";
|
$align="center";
|
||||||
}
|
}
|
||||||
else if ($fieldlist[$field]=='accountancy_code' || $fieldlist[$field]=='accountancy_code_sell' || $fieldlist[$field]=='accountancy_code_buy') {
|
elseif ($fieldlist[$field]=='accountancy_code' || $fieldlist[$field]=='accountancy_code_sell' || $fieldlist[$field]=='accountancy_code_buy') {
|
||||||
$valuetoshow = length_accountg($valuetoshow);
|
$valuetoshow = length_accountg($valuetoshow);
|
||||||
}
|
}
|
||||||
elseif ($fieldlist[$field] == 'fk_tva')
|
elseif ($fieldlist[$field] == 'fk_tva')
|
||||||
@@ -1604,8 +1604,8 @@ if ($id)
|
|||||||
if (isset($obj->code) && $id != 10)
|
if (isset($obj->code) && $id != 10)
|
||||||
{
|
{
|
||||||
if (($obj->code == '0' || $obj->code == '' || preg_match('/unknown/i',$obj->code))) { $iserasable = 0; $canbedisabled = 0; }
|
if (($obj->code == '0' || $obj->code == '' || preg_match('/unknown/i',$obj->code))) { $iserasable = 0; $canbedisabled = 0; }
|
||||||
else if ($obj->code == 'RECEP') { $iserasable = 0; $canbedisabled = 0; }
|
elseif ($obj->code == 'RECEP') { $iserasable = 0; $canbedisabled = 0; }
|
||||||
else if ($obj->code == 'EF0') { $iserasable = 0; $canbedisabled = 0; }
|
elseif ($obj->code == 'EF0') { $iserasable = 0; $canbedisabled = 0; }
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isset($obj->type) && in_array($obj->type, array('system', 'systemauto'))) { $iserasable=0; }
|
if (isset($obj->type) && in_array($obj->type, array('system', 'systemauto'))) { $iserasable=0; }
|
||||||
@@ -1639,8 +1639,8 @@ if ($id)
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (in_array($obj->code, array('AC_OTH','AC_OTH_AUTO'))) print $langs->trans("AlwaysActive");
|
if (in_array($obj->code, array('AC_OTH','AC_OTH_AUTO'))) print $langs->trans("AlwaysActive");
|
||||||
else if (isset($obj->type) && in_array($obj->type, array('systemauto')) && empty($obj->active)) print $langs->trans("Deprecated");
|
elseif (isset($obj->type) && in_array($obj->type, array('systemauto')) && empty($obj->active)) print $langs->trans("Deprecated");
|
||||||
else if (isset($obj->type) && in_array($obj->type, array('system')) && ! empty($obj->active) && $obj->code != 'AC_OTH') print $langs->trans("UsedOnlyWithTypeOption");
|
elseif (isset($obj->type) && in_array($obj->type, array('system')) && ! empty($obj->active) && $obj->code != 'AC_OTH') print $langs->trans("UsedOnlyWithTypeOption");
|
||||||
else print $langs->trans("AlwaysActive");
|
else print $langs->trans("AlwaysActive");
|
||||||
}
|
}
|
||||||
print "</td>";
|
print "</td>";
|
||||||
@@ -1755,7 +1755,7 @@ $db->close();
|
|||||||
* @param string $context 'add'=Output field for the "add form", 'edit'=Output field for the "edit form", 'hide'=Output field for the "add form" but we dont want it to be rendered
|
* @param string $context 'add'=Output field for the "add form", 'edit'=Output field for the "edit form", 'hide'=Output field for the "add form" but we dont want it to be rendered
|
||||||
* @return string '' or value of entity into table
|
* @return string '' or value of entity into table
|
||||||
*/
|
*/
|
||||||
function fieldList($fieldlist, $obj='', $tabname='', $context='')
|
function fieldList($fieldlist, $obj = '', $tabname = '', $context = '')
|
||||||
{
|
{
|
||||||
global $conf,$langs,$db,$mysoc;
|
global $conf,$langs,$db,$mysoc;
|
||||||
global $form;
|
global $form;
|
||||||
|
|||||||
@@ -53,6 +53,6 @@ try {
|
|||||||
// Here we are dealing with errors
|
// Here we are dealing with errors
|
||||||
$trace = $e->getTrace();
|
$trace = $e->getTrace();
|
||||||
if ($trace[0]['args'][0] == 404) die('Bad ID');
|
if ($trace[0]['args'][0] == 404) die('Bad ID');
|
||||||
else if ($trace[0]['args'][0] == 401) die('Bad auth key');
|
elseif ($trace[0]['args'][0] == 401) die('Bad auth key');
|
||||||
else die('Can not access to '.$conf->global->MAIN_MODULE_DOLISTORE_API_SRV);
|
else die('Can not access to '.$conf->global->MAIN_MODULE_DOLISTORE_API_SRV);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -54,7 +54,7 @@ class Dolistore
|
|||||||
*
|
*
|
||||||
* @param boolean $debug Enable debug of request on screen
|
* @param boolean $debug Enable debug of request on screen
|
||||||
*/
|
*/
|
||||||
function __construct($debug=false)
|
function __construct($debug = false)
|
||||||
{
|
{
|
||||||
global $conf, $langs;
|
global $conf, $langs;
|
||||||
|
|
||||||
@@ -154,7 +154,7 @@ class Dolistore
|
|||||||
// Here we are dealing with errors
|
// Here we are dealing with errors
|
||||||
$trace = $e->getTrace();
|
$trace = $e->getTrace();
|
||||||
if ($trace[0]['args'][0] == 404) die('Bad ID');
|
if ($trace[0]['args'][0] == 404) die('Bad ID');
|
||||||
else if ($trace[0]['args'][0] == 401) die('Bad auth key');
|
elseif ($trace[0]['args'][0] == 401) die('Bad auth key');
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
print 'Can not access to '.$conf->global->MAIN_MODULE_DOLISTORE_API_SRV.'<br>';
|
print 'Can not access to '.$conf->global->MAIN_MODULE_DOLISTORE_API_SRV.'<br>';
|
||||||
|
|||||||
@@ -100,7 +100,7 @@ else
|
|||||||
{
|
{
|
||||||
print '<a href="'.$_SERVER['PHP_SELF'].'?action=set_ECM_AUTO_TREE_ENABLED">'.img_picto($langs->trans("Disabled"),'off').'</a>';
|
print '<a href="'.$_SERVER['PHP_SELF'].'?action=set_ECM_AUTO_TREE_ENABLED">'.img_picto($langs->trans("Disabled"),'off').'</a>';
|
||||||
}
|
}
|
||||||
else if(! empty($conf->global->USER_MAIL_REQUIRED))
|
elseif(! empty($conf->global->USER_MAIL_REQUIRED))
|
||||||
{
|
{
|
||||||
print '<a href="'.$_SERVER['PHP_SELF'].'?action=del_ECM_AUTO_TREE_ENABLED">'.img_picto($langs->trans("Enabled"),'on').'</a>';
|
print '<a href="'.$_SERVER['PHP_SELF'].'?action=del_ECM_AUTO_TREE_ENABLED">'.img_picto($langs->trans("Enabled"),'on').'</a>';
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -74,7 +74,7 @@ if ($action == 'updateMask')
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
else if ($action == 'set_param')
|
elseif ($action == 'set_param')
|
||||||
{
|
{
|
||||||
$freetext=GETPOST('SHIPPING_FREE_TEXT','none'); // No alpha here, we want exact string
|
$freetext=GETPOST('SHIPPING_FREE_TEXT','none'); // No alpha here, we want exact string
|
||||||
$res = dolibarr_set_const($db, "SHIPPING_FREE_TEXT",$freetext,'chaine',0,'',$conf->entity);
|
$res = dolibarr_set_const($db, "SHIPPING_FREE_TEXT",$freetext,'chaine',0,'',$conf->entity);
|
||||||
@@ -98,7 +98,7 @@ else if ($action == 'set_param')
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
else if ($action == 'specimen')
|
elseif ($action == 'specimen')
|
||||||
{
|
{
|
||||||
$modele=GETPOST('module','alpha');
|
$modele=GETPOST('module','alpha');
|
||||||
|
|
||||||
@@ -144,12 +144,12 @@ else if ($action == 'specimen')
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Activate a model
|
// Activate a model
|
||||||
else if ($action == 'set')
|
elseif ($action == 'set')
|
||||||
{
|
{
|
||||||
$ret = addDocumentModel($value, $type, $label, $scandir);
|
$ret = addDocumentModel($value, $type, $label, $scandir);
|
||||||
}
|
}
|
||||||
|
|
||||||
else if ($action == 'del')
|
elseif ($action == 'del')
|
||||||
{
|
{
|
||||||
$ret = delDocumentModel($value, $type);
|
$ret = delDocumentModel($value, $type);
|
||||||
if ($ret > 0)
|
if ($ret > 0)
|
||||||
@@ -159,7 +159,7 @@ else if ($action == 'del')
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Set default model
|
// Set default model
|
||||||
else if ($action == 'setdoc')
|
elseif ($action == 'setdoc')
|
||||||
{
|
{
|
||||||
if (dolibarr_set_const($db, "EXPEDITION_ADDON_PDF",$value,'chaine',0,'',$conf->entity))
|
if (dolibarr_set_const($db, "EXPEDITION_ADDON_PDF",$value,'chaine',0,'',$conf->entity))
|
||||||
{
|
{
|
||||||
@@ -176,7 +176,7 @@ else if ($action == 'setdoc')
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
else if ($action == 'setmodel')
|
elseif ($action == 'setmodel')
|
||||||
{
|
{
|
||||||
dolibarr_set_const($db, "EXPEDITION_ADDON_NUMBER",$value,'chaine',0,'',$conf->entity);
|
dolibarr_set_const($db, "EXPEDITION_ADDON_NUMBER",$value,'chaine',0,'',$conf->entity);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -70,7 +70,7 @@ if ($action == 'updateMask')
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
else if ($action == 'specimen') // For fiche inter
|
elseif ($action == 'specimen') // For fiche inter
|
||||||
{
|
{
|
||||||
$modele= GETPOST('module','alpha');
|
$modele= GETPOST('module','alpha');
|
||||||
|
|
||||||
@@ -118,7 +118,7 @@ else if ($action == 'specimen') // For fiche inter
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Activate a model
|
// Activate a model
|
||||||
else if ($action == 'set')
|
elseif ($action == 'set')
|
||||||
{
|
{
|
||||||
$ret = addDocumentModel($value, $type, $label, $scandir);
|
$ret = addDocumentModel($value, $type, $label, $scandir);
|
||||||
if ($ret > 0 && empty($conf->global->EXPENSEREPORT_ADDON_PDF))
|
if ($ret > 0 && empty($conf->global->EXPENSEREPORT_ADDON_PDF))
|
||||||
@@ -127,7 +127,7 @@ else if ($action == 'set')
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
else if ($action == 'del')
|
elseif ($action == 'del')
|
||||||
{
|
{
|
||||||
$ret = delDocumentModel($value, $type);
|
$ret = delDocumentModel($value, $type);
|
||||||
if ($ret > 0)
|
if ($ret > 0)
|
||||||
@@ -137,7 +137,7 @@ else if ($action == 'del')
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Set default model
|
// Set default model
|
||||||
else if ($action == 'setdoc')
|
elseif ($action == 'setdoc')
|
||||||
{
|
{
|
||||||
if (dolibarr_set_const($db, "EXPENSEREPORT_ADDON_PDF",$value,'chaine',0,'',$conf->entity))
|
if (dolibarr_set_const($db, "EXPENSEREPORT_ADDON_PDF",$value,'chaine',0,'',$conf->entity))
|
||||||
{
|
{
|
||||||
@@ -154,7 +154,7 @@ else if ($action == 'setdoc')
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
else if ($action == 'setmod')
|
elseif ($action == 'setmod')
|
||||||
{
|
{
|
||||||
// TODO Verifier si module numerotation choisi peut etre active
|
// TODO Verifier si module numerotation choisi peut etre active
|
||||||
// par appel methode canBeActivated
|
// par appel methode canBeActivated
|
||||||
@@ -162,7 +162,7 @@ else if ($action == 'setmod')
|
|||||||
dolibarr_set_const($db, "EXPENSEREPORT_ADDON",$value,'chaine',0,'',$conf->entity);
|
dolibarr_set_const($db, "EXPENSEREPORT_ADDON",$value,'chaine',0,'',$conf->entity);
|
||||||
}
|
}
|
||||||
|
|
||||||
else if ($action == 'setoptions')
|
elseif ($action == 'setoptions')
|
||||||
{
|
{
|
||||||
$db->begin();
|
$db->begin();
|
||||||
|
|
||||||
|
|||||||
@@ -124,12 +124,12 @@ if ($action == 'specimen')
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Activate a model
|
// Activate a model
|
||||||
else if ($action == 'set')
|
elseif ($action == 'set')
|
||||||
{
|
{
|
||||||
$ret = addDocumentModel($value, $type, $label, $scandir);
|
$ret = addDocumentModel($value, $type, $label, $scandir);
|
||||||
}
|
}
|
||||||
|
|
||||||
else if ($action == 'del')
|
elseif ($action == 'del')
|
||||||
{
|
{
|
||||||
$ret = delDocumentModel($value, $type);
|
$ret = delDocumentModel($value, $type);
|
||||||
if ($ret > 0)
|
if ($ret > 0)
|
||||||
@@ -139,7 +139,7 @@ else if ($action == 'del')
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Set default model
|
// Set default model
|
||||||
else if ($action == 'setdoc')
|
elseif ($action == 'setdoc')
|
||||||
{
|
{
|
||||||
if (dolibarr_set_const($db, "FACTURE_ADDON_PDF",$value,'chaine',0,'',$conf->entity))
|
if (dolibarr_set_const($db, "FACTURE_ADDON_PDF",$value,'chaine',0,'',$conf->entity))
|
||||||
{
|
{
|
||||||
@@ -156,7 +156,7 @@ else if ($action == 'setdoc')
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
else if ($action == 'setmod')
|
elseif ($action == 'setmod')
|
||||||
{
|
{
|
||||||
// TODO Verifier si module numerotation choisi peut etre active
|
// TODO Verifier si module numerotation choisi peut etre active
|
||||||
// par appel methode canBeActivated
|
// par appel methode canBeActivated
|
||||||
|
|||||||
@@ -167,7 +167,7 @@ else
|
|||||||
{
|
{
|
||||||
print '<a href="'.$_SERVER['PHP_SELF'].'?action=activate_'.strtolower($const).'">'.img_picto($langs->trans("Disabled"),'switch_off').'</a>';
|
print '<a href="'.$_SERVER['PHP_SELF'].'?action=activate_'.strtolower($const).'">'.img_picto($langs->trans("Disabled"),'switch_off').'</a>';
|
||||||
}
|
}
|
||||||
else if ($value == 1)
|
elseif ($value == 1)
|
||||||
{
|
{
|
||||||
print '<a href="'.$_SERVER['PHP_SELF'].'?action=disable_'.strtolower($const).'">'.img_picto($langs->trans("Enabled"),'switch_on').'</a>';
|
print '<a href="'.$_SERVER['PHP_SELF'].'?action=disable_'.strtolower($const).'">'.img_picto($langs->trans("Enabled"),'switch_on').'</a>';
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -70,7 +70,7 @@ if ($action == 'updateMask')
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
else if ($action == 'specimen') // For fiche inter
|
elseif ($action == 'specimen') // For fiche inter
|
||||||
{
|
{
|
||||||
$modele= GETPOST('module','alpha');
|
$modele= GETPOST('module','alpha');
|
||||||
|
|
||||||
@@ -116,12 +116,12 @@ else if ($action == 'specimen') // For fiche inter
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Activate a model
|
// Activate a model
|
||||||
else if ($action == 'set')
|
elseif ($action == 'set')
|
||||||
{
|
{
|
||||||
$ret = addDocumentModel($value, $type, $label, $scandir);
|
$ret = addDocumentModel($value, $type, $label, $scandir);
|
||||||
}
|
}
|
||||||
|
|
||||||
else if ($action == 'del')
|
elseif ($action == 'del')
|
||||||
{
|
{
|
||||||
$ret = delDocumentModel($value, $type);
|
$ret = delDocumentModel($value, $type);
|
||||||
if ($ret > 0)
|
if ($ret > 0)
|
||||||
@@ -131,7 +131,7 @@ else if ($action == 'del')
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Set default model
|
// Set default model
|
||||||
else if ($action == 'setdoc')
|
elseif ($action == 'setdoc')
|
||||||
{
|
{
|
||||||
if (dolibarr_set_const($db, "FICHEINTER_ADDON_PDF",$value,'chaine',0,'',$conf->entity))
|
if (dolibarr_set_const($db, "FICHEINTER_ADDON_PDF",$value,'chaine',0,'',$conf->entity))
|
||||||
{
|
{
|
||||||
@@ -148,7 +148,7 @@ else if ($action == 'setdoc')
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
else if ($action == 'setmod')
|
elseif ($action == 'setmod')
|
||||||
{
|
{
|
||||||
// TODO Verifier si module numerotation choisi peut etre active
|
// TODO Verifier si module numerotation choisi peut etre active
|
||||||
// par appel methode canBeActivated
|
// par appel methode canBeActivated
|
||||||
@@ -156,7 +156,7 @@ else if ($action == 'setmod')
|
|||||||
dolibarr_set_const($db, "FICHEINTER_ADDON",$value,'chaine',0,'',$conf->entity);
|
dolibarr_set_const($db, "FICHEINTER_ADDON",$value,'chaine',0,'',$conf->entity);
|
||||||
}
|
}
|
||||||
|
|
||||||
else if ($action == 'set_FICHINTER_FREE_TEXT')
|
elseif ($action == 'set_FICHINTER_FREE_TEXT')
|
||||||
{
|
{
|
||||||
$freetext= GETPOST('FICHINTER_FREE_TEXT','none'); // No alpha here, we want exact string
|
$freetext= GETPOST('FICHINTER_FREE_TEXT','none'); // No alpha here, we want exact string
|
||||||
$res = dolibarr_set_const($db, "FICHINTER_FREE_TEXT",$freetext,'chaine',0,'',$conf->entity);
|
$res = dolibarr_set_const($db, "FICHINTER_FREE_TEXT",$freetext,'chaine',0,'',$conf->entity);
|
||||||
@@ -173,7 +173,7 @@ else if ($action == 'set_FICHINTER_FREE_TEXT')
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
else if ($action == 'set_FICHINTER_DRAFT_WATERMARK')
|
elseif ($action == 'set_FICHINTER_DRAFT_WATERMARK')
|
||||||
{
|
{
|
||||||
$draft= GETPOST('FICHINTER_DRAFT_WATERMARK','alpha');
|
$draft= GETPOST('FICHINTER_DRAFT_WATERMARK','alpha');
|
||||||
$res = dolibarr_set_const($db, "FICHINTER_DRAFT_WATERMARK",trim($draft),'chaine',0,'',$conf->entity);
|
$res = dolibarr_set_const($db, "FICHINTER_DRAFT_WATERMARK",trim($draft),'chaine',0,'',$conf->entity);
|
||||||
|
|||||||
@@ -71,7 +71,7 @@ if ($action == 'updateMask')
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
else if ($action == 'specimen') // For contract
|
elseif ($action == 'specimen') // For contract
|
||||||
{
|
{
|
||||||
$modele= GETPOST('module','alpha');
|
$modele= GETPOST('module','alpha');
|
||||||
|
|
||||||
@@ -117,12 +117,12 @@ else if ($action == 'specimen') // For contract
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Activate a model
|
// Activate a model
|
||||||
else if ($action == 'set')
|
elseif ($action == 'set')
|
||||||
{
|
{
|
||||||
$ret = addDocumentModel($value, $type, $label, $scandir);
|
$ret = addDocumentModel($value, $type, $label, $scandir);
|
||||||
}
|
}
|
||||||
|
|
||||||
else if ($action == 'del')
|
elseif ($action == 'del')
|
||||||
{
|
{
|
||||||
$ret = delDocumentModel($value, $type);
|
$ret = delDocumentModel($value, $type);
|
||||||
if ($ret > 0)
|
if ($ret > 0)
|
||||||
@@ -132,7 +132,7 @@ else if ($action == 'del')
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Set default model
|
// Set default model
|
||||||
else if ($action == 'setdoc')
|
elseif ($action == 'setdoc')
|
||||||
{
|
{
|
||||||
if (dolibarr_set_const($db, "HOLIDAY_ADDON_PDF",$value,'chaine',0,'',$conf->entity))
|
if (dolibarr_set_const($db, "HOLIDAY_ADDON_PDF",$value,'chaine',0,'',$conf->entity))
|
||||||
{
|
{
|
||||||
@@ -149,7 +149,7 @@ else if ($action == 'setdoc')
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
else if ($action == 'setmod')
|
elseif ($action == 'setmod')
|
||||||
{
|
{
|
||||||
// TODO Verifier si module numerotation choisi peut etre active
|
// TODO Verifier si module numerotation choisi peut etre active
|
||||||
// par appel methode canBeActivated
|
// par appel methode canBeActivated
|
||||||
@@ -157,7 +157,7 @@ else if ($action == 'setmod')
|
|||||||
dolibarr_set_const($db, "HOLIDAY_ADDON",$value,'chaine',0,'',$conf->entity);
|
dolibarr_set_const($db, "HOLIDAY_ADDON",$value,'chaine',0,'',$conf->entity);
|
||||||
}
|
}
|
||||||
|
|
||||||
else if ($action == 'set_other')
|
elseif ($action == 'set_other')
|
||||||
{
|
{
|
||||||
$freetext= GETPOST('HOLIDAY_FREE_TEXT','none'); // No alpha here, we want exact string
|
$freetext= GETPOST('HOLIDAY_FREE_TEXT','none'); // No alpha here, we want exact string
|
||||||
$res1 = dolibarr_set_const($db, "HOLIDAY_FREE_TEXT",$freetext,'chaine',0,'',$conf->entity);
|
$res1 = dolibarr_set_const($db, "HOLIDAY_FREE_TEXT",$freetext,'chaine',0,'',$conf->entity);
|
||||||
|
|||||||
@@ -173,7 +173,7 @@ if ($action == 'update')
|
|||||||
{
|
{
|
||||||
dolibarr_set_const($db, "MAIN_LOGIN_BACKGROUND",$original_file,'chaine',0,'',$conf->entity);
|
dolibarr_set_const($db, "MAIN_LOGIN_BACKGROUND",$original_file,'chaine',0,'',$conf->entity);
|
||||||
}
|
}
|
||||||
else if (preg_match('/^ErrorFileIsInfectedWithAVirus/',$result))
|
elseif (preg_match('/^ErrorFileIsInfectedWithAVirus/',$result))
|
||||||
{
|
{
|
||||||
$error++;
|
$error++;
|
||||||
$langs->load("errors");
|
$langs->load("errors");
|
||||||
|
|||||||
@@ -673,11 +673,11 @@ else
|
|||||||
{
|
{
|
||||||
print $langs->trans('RobotEmail');
|
print $langs->trans('RobotEmail');
|
||||||
}
|
}
|
||||||
else if ($conf->global->MAIN_MAIL_DEFAULT_FROMTYPE === 'user')
|
elseif ($conf->global->MAIN_MAIL_DEFAULT_FROMTYPE === 'user')
|
||||||
{
|
{
|
||||||
print $langs->trans('UserEmail');
|
print $langs->trans('UserEmail');
|
||||||
}
|
}
|
||||||
else if ($conf->global->MAIN_MAIL_DEFAULT_FROMTYPE === 'company')
|
elseif ($conf->global->MAIN_MAIL_DEFAULT_FROMTYPE === 'company')
|
||||||
{
|
{
|
||||||
print $langs->trans('CompanyEmail').' '.dol_escape_htmltag('<'.$mysoc->email.'>');
|
print $langs->trans('CompanyEmail').' '.dol_escape_htmltag('<'.$mysoc->email.'>');
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -479,7 +479,7 @@ foreach ($fieldlist as $field => $value)
|
|||||||
{
|
{
|
||||||
print '<td align="'.$align.'">';
|
print '<td align="'.$align.'">';
|
||||||
if (! empty($tabhelp[$id][$value]) && preg_match('/^http(s*):/i',$tabhelp[$id][$value])) print '<a href="'.$tabhelp[$id][$value].'" target="_blank">'.$valuetoshow.' '.img_help(1,$valuetoshow).'</a>';
|
if (! empty($tabhelp[$id][$value]) && preg_match('/^http(s*):/i',$tabhelp[$id][$value])) print '<a href="'.$tabhelp[$id][$value].'" target="_blank">'.$valuetoshow.' '.img_help(1,$valuetoshow).'</a>';
|
||||||
else if (! empty($tabhelp[$id][$value]))
|
elseif (! empty($tabhelp[$id][$value]))
|
||||||
{
|
{
|
||||||
if (in_array($value, array('topic'))) print $form->textwithpicto($valuetoshow, $tabhelp[$id][$value], 1, 'help', '', 0, 2, $value); // Tooltip on click
|
if (in_array($value, array('topic'))) print $form->textwithpicto($valuetoshow, $tabhelp[$id][$value], 1, 'help', '', 0, 2, $value); // Tooltip on click
|
||||||
else print $form->textwithpicto($valuetoshow, $tabhelp[$id][$value], 1, 'help', '', 0, 2); // Tooltip on hover
|
else print $form->textwithpicto($valuetoshow, $tabhelp[$id][$value], 1, 'help', '', 0, 2); // Tooltip on hover
|
||||||
@@ -552,7 +552,7 @@ foreach ($fieldsforcontent as $tmpfieldlist)
|
|||||||
if ($tmpfieldlist == 'topic') {
|
if ($tmpfieldlist == 'topic') {
|
||||||
print '<input type="text" class="flat minwidth500" name="'.$tmpfieldlist.'" value="' . (! empty($obj->{$tmpfieldlist}) ? $obj->{$tmpfieldlist} : '') . '">';
|
print '<input type="text" class="flat minwidth500" name="'.$tmpfieldlist.'" value="' . (! empty($obj->{$tmpfieldlist}) ? $obj->{$tmpfieldlist} : '') . '">';
|
||||||
}
|
}
|
||||||
else if ($tmpfieldlist == 'joinfiles') {
|
elseif ($tmpfieldlist == 'joinfiles') {
|
||||||
print '<input type="text" class="flat maxwidth50" name="'.$tmpfieldlist.'" value="' . (isset($obj->{$tmpfieldlist}) ? $obj->{$tmpfieldlist} : '1') . '">';
|
print '<input type="text" class="flat maxwidth50" name="'.$tmpfieldlist.'" value="' . (isset($obj->{$tmpfieldlist}) ? $obj->{$tmpfieldlist} : '1') . '">';
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -947,7 +947,7 @@ $db->close();
|
|||||||
* @param string $context 'add'=Output field for the "add form", 'edit'=Output field for the "edit form", 'hide'=Output field for the "add form" but we dont want it to be rendered
|
* @param string $context 'add'=Output field for the "add form", 'edit'=Output field for the "edit form", 'hide'=Output field for the "add form" but we dont want it to be rendered
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
function fieldList($fieldlist, $obj='', $tabname='', $context='')
|
function fieldList($fieldlist, $obj = '', $tabname = '', $context = '')
|
||||||
{
|
{
|
||||||
global $conf, $langs, $user, $db;
|
global $conf, $langs, $user, $db;
|
||||||
global $form;
|
global $form;
|
||||||
|
|||||||
@@ -42,7 +42,7 @@ if ($action == 'activate_hidemenu')
|
|||||||
header("Location: ".$_SERVER["PHP_SELF"]);
|
header("Location: ".$_SERVER["PHP_SELF"]);
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
else if ($action == 'disable_hidemenu')
|
elseif ($action == 'disable_hidemenu')
|
||||||
{
|
{
|
||||||
dolibarr_del_const($db, "MAIN_MENU_HIDE_UNAUTHORIZED",$conf->entity);
|
dolibarr_del_const($db, "MAIN_MENU_HIDE_UNAUTHORIZED",$conf->entity);
|
||||||
header("Location: ".$_SERVER["PHP_SELF"]);
|
header("Location: ".$_SERVER["PHP_SELF"]);
|
||||||
|
|||||||
@@ -244,7 +244,7 @@ if ($action == 'set' && $user->admin)
|
|||||||
header("Location: ".$_SERVER["PHP_SELF"]."?mode=".$mode.$param.($page_y?'&page_y='.$page_y:''));
|
header("Location: ".$_SERVER["PHP_SELF"]."?mode=".$mode.$param.($page_y?'&page_y='.$page_y:''));
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
else if ($action == 'reset' && $user->admin && GETPOST('confirm') == 'yes')
|
elseif ($action == 'reset' && $user->admin && GETPOST('confirm') == 'yes')
|
||||||
{
|
{
|
||||||
$result=unActivateModule($value);
|
$result=unActivateModule($value);
|
||||||
if ($result) setEventMessages($result, null, 'errors');
|
if ($result) setEventMessages($result, null, 'errors');
|
||||||
@@ -698,7 +698,7 @@ if ($mode == 'common')
|
|||||||
{
|
{
|
||||||
print $langs->trans("Disabled");
|
print $langs->trans("Disabled");
|
||||||
}
|
}
|
||||||
else if (! empty($objMod->always_enabled) || ((! empty($conf->multicompany->enabled) && $objMod->core_enabled) && ($user->entity || $conf->entity!=1)))
|
elseif (! empty($objMod->always_enabled) || ((! empty($conf->multicompany->enabled) && $objMod->core_enabled) && ($user->entity || $conf->entity!=1)))
|
||||||
{
|
{
|
||||||
if (method_exists($objMod, 'alreadyUsed') && $objMod->alreadyUsed()) print $langs->trans("Used");
|
if (method_exists($objMod, 'alreadyUsed') && $objMod->alreadyUsed()) print $langs->trans("Used");
|
||||||
else {
|
else {
|
||||||
@@ -761,7 +761,7 @@ if ($mode == 'common')
|
|||||||
}
|
}
|
||||||
print "</td>\n";
|
print "</td>\n";
|
||||||
}
|
}
|
||||||
else if (preg_match('/^([^@]+)@([^@]+)$/i',$objMod->config_page_url,$regs))
|
elseif (preg_match('/^([^@]+)@([^@]+)$/i',$objMod->config_page_url,$regs))
|
||||||
{
|
{
|
||||||
print '<td class="tdsetuppicto right valignmiddle" width="60px"><a href="'.dol_buildpath('/'.$regs[2].'/admin/'.$regs[1],1).'?save_lastsearch_values=1&backtopage='.urlencode($backtourl).'" title="'.$langs->trans("Setup").'">'.img_picto($langs->trans("Setup"),"setup",'style="padding-right: 6px"').'</a></td>';
|
print '<td class="tdsetuppicto right valignmiddle" width="60px"><a href="'.dol_buildpath('/'.$regs[2].'/admin/'.$regs[1],1).'?save_lastsearch_values=1&backtopage='.urlencode($backtourl).'" title="'.$langs->trans("Setup").'">'.img_picto($langs->trans("Setup"),"setup",'style="padding-right: 6px"').'</a></td>';
|
||||||
}
|
}
|
||||||
@@ -783,7 +783,7 @@ if ($mode == 'common')
|
|||||||
{
|
{
|
||||||
// Should never happened
|
// Should never happened
|
||||||
}
|
}
|
||||||
else if (! empty($objMod->disabled))
|
elseif (! empty($objMod->disabled))
|
||||||
{
|
{
|
||||||
print $langs->trans("Disabled");
|
print $langs->trans("Disabled");
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -71,7 +71,7 @@ if ($action == 'setvalue' && $user->admin)
|
|||||||
$newval=GETPOST($shortkey.'_key');
|
$newval=GETPOST($shortkey.'_key');
|
||||||
//print $newkey.' - '.$newval.'<br>';
|
//print $newkey.' - '.$newval.'<br>';
|
||||||
}
|
}
|
||||||
else if (preg_match('/^NOTIF_(.*)_new_key/',$key,$reg))
|
elseif (preg_match('/^NOTIF_(.*)_new_key/',$key,$reg))
|
||||||
{
|
{
|
||||||
// Add a new entry
|
// Add a new entry
|
||||||
$newkey='NOTIFICATION_FIXEDEMAIL_'.$reg[1].'_THRESHOLD_HIGHER_'.((int) GETPOST($shortkey.'_amount'));
|
$newkey='NOTIFICATION_FIXEDEMAIL_'.$reg[1].'_THRESHOLD_HIGHER_'.((int) GETPOST($shortkey.'_amount'));
|
||||||
|
|||||||
@@ -86,7 +86,7 @@ if ($action == 'activate_pdfsecurity')
|
|||||||
header("Location: ".$_SERVER["PHP_SELF"]."?mainmenu=home&leftmenu=setup");
|
header("Location: ".$_SERVER["PHP_SELF"]."?mainmenu=home&leftmenu=setup");
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
else if ($action == 'disable_pdfsecurity')
|
elseif ($action == 'disable_pdfsecurity')
|
||||||
{
|
{
|
||||||
dolibarr_del_const($db, "PDF_SECURITY_ENCRYPTION",$conf->entity);
|
dolibarr_del_const($db, "PDF_SECURITY_ENCRYPTION",$conf->entity);
|
||||||
header("Location: ".$_SERVER["PHP_SELF"]."?mainmenu=home&leftmenu=setup");
|
header("Location: ".$_SERVER["PHP_SELF"]."?mainmenu=home&leftmenu=setup");
|
||||||
|
|||||||
@@ -96,9 +96,7 @@ if ($action == "set")
|
|||||||
{
|
{
|
||||||
$res = dolibarr_set_const($db, "PRELEVEMENT_ADDDAYS", GETPOST("PRELEVEMENT_ADDDAYS"),'chaine',0,'',$conf->entity);
|
$res = dolibarr_set_const($db, "PRELEVEMENT_ADDDAYS", GETPOST("PRELEVEMENT_ADDDAYS"),'chaine',0,'',$conf->entity);
|
||||||
if (! $res > 0) $error++;
|
if (! $res > 0) $error++;
|
||||||
} else
|
} elseif (! $error)
|
||||||
|
|
||||||
if (! $error)
|
|
||||||
{
|
{
|
||||||
$db->commit();
|
$db->commit();
|
||||||
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
|
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
|
||||||
|
|||||||
@@ -188,7 +188,7 @@ if ($action == 'set')
|
|||||||
$ret = addDocumentModel($value, $type, $label, $scandir);
|
$ret = addDocumentModel($value, $type, $label, $scandir);
|
||||||
}
|
}
|
||||||
|
|
||||||
else if ($action == 'del')
|
elseif ($action == 'del')
|
||||||
{
|
{
|
||||||
$ret = delDocumentModel($value, $type);
|
$ret = delDocumentModel($value, $type);
|
||||||
if ($ret > 0)
|
if ($ret > 0)
|
||||||
@@ -197,7 +197,7 @@ else if ($action == 'del')
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
else if ($action == 'setdoc')
|
elseif ($action == 'setdoc')
|
||||||
{
|
{
|
||||||
if (dolibarr_set_const($db, "PROPALE_ADDON_PDF",$value,'chaine',0,'',$conf->entity))
|
if (dolibarr_set_const($db, "PROPALE_ADDON_PDF",$value,'chaine',0,'',$conf->entity))
|
||||||
{
|
{
|
||||||
@@ -212,7 +212,7 @@ else if ($action == 'setdoc')
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
else if ($action == 'setmod')
|
elseif ($action == 'setmod')
|
||||||
{
|
{
|
||||||
// TODO Verifier si module numerotation choisi peut etre active
|
// TODO Verifier si module numerotation choisi peut etre active
|
||||||
// par appel methode canBeActivated
|
// par appel methode canBeActivated
|
||||||
|
|||||||
@@ -80,7 +80,7 @@ if ($action == 'updateMask')
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
else if ($action == 'set_param')
|
elseif ($action == 'set_param')
|
||||||
{
|
{
|
||||||
$freetext=GETPOST('RECEPTION_FREE_TEXT','none'); // No alpha here, we want exact string
|
$freetext=GETPOST('RECEPTION_FREE_TEXT','none'); // No alpha here, we want exact string
|
||||||
$res = dolibarr_set_const($db, "RECEPTION_FREE_TEXT",$freetext,'chaine',0,'',$conf->entity);
|
$res = dolibarr_set_const($db, "RECEPTION_FREE_TEXT",$freetext,'chaine',0,'',$conf->entity);
|
||||||
@@ -104,7 +104,7 @@ else if ($action == 'set_param')
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
else if ($action == 'specimen')
|
elseif ($action == 'specimen')
|
||||||
{
|
{
|
||||||
$modele=GETPOST('module','alpha');
|
$modele=GETPOST('module','alpha');
|
||||||
|
|
||||||
@@ -150,12 +150,12 @@ else if ($action == 'specimen')
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Activate a model
|
// Activate a model
|
||||||
else if ($action == 'set')
|
elseif ($action == 'set')
|
||||||
{
|
{
|
||||||
$ret = addDocumentModel($value, $type, $label, $scandir);
|
$ret = addDocumentModel($value, $type, $label, $scandir);
|
||||||
}
|
}
|
||||||
|
|
||||||
else if ($action == 'del')
|
elseif ($action == 'del')
|
||||||
{
|
{
|
||||||
$ret = delDocumentModel($value, $type);
|
$ret = delDocumentModel($value, $type);
|
||||||
if ($ret > 0)
|
if ($ret > 0)
|
||||||
@@ -165,7 +165,7 @@ else if ($action == 'del')
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Set default model
|
// Set default model
|
||||||
else if ($action == 'setdoc')
|
elseif ($action == 'setdoc')
|
||||||
{
|
{
|
||||||
if (dolibarr_set_const($db, "RECEPTION_ADDON_PDF",$value,'chaine',0,'',$conf->entity))
|
if (dolibarr_set_const($db, "RECEPTION_ADDON_PDF",$value,'chaine',0,'',$conf->entity))
|
||||||
{
|
{
|
||||||
@@ -182,7 +182,7 @@ else if ($action == 'setdoc')
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
else if ($action == 'setmodel')
|
elseif ($action == 'setmodel')
|
||||||
{
|
{
|
||||||
dolibarr_set_const($db, "RECEPTION_ADDON_NUMBER",$value,'chaine',0,'',$conf->entity);
|
dolibarr_set_const($db, "RECEPTION_ADDON_NUMBER",$value,'chaine',0,'',$conf->entity);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -108,7 +108,7 @@ if ($action == 'activate_encrypt')
|
|||||||
dol_print_error($db,'');
|
dol_print_error($db,'');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if ($action == 'disable_encrypt')
|
elseif ($action == 'disable_encrypt')
|
||||||
{
|
{
|
||||||
//On n'autorise pas l'annulation de l'encryption car les mots de passe ne peuvent pas etre decodes
|
//On n'autorise pas l'annulation de l'encryption car les mots de passe ne peuvent pas etre decodes
|
||||||
//Do not allow "disable encryption" as passwords cannot be decrypted
|
//Do not allow "disable encryption" as passwords cannot be decrypted
|
||||||
@@ -137,7 +137,7 @@ if ($action == 'activate_encryptdbpassconf')
|
|||||||
setEventMessages($langs->trans('InstrucToEncodePass',dol_encode($dolibarr_main_db_pass)), null, 'warnings');
|
setEventMessages($langs->trans('InstrucToEncodePass',dol_encode($dolibarr_main_db_pass)), null, 'warnings');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if ($action == 'disable_encryptdbpassconf')
|
elseif ($action == 'disable_encryptdbpassconf')
|
||||||
{
|
{
|
||||||
$result = encodedecode_dbpassconf(0);
|
$result = encodedecode_dbpassconf(0);
|
||||||
if ($result > 0)
|
if ($result > 0)
|
||||||
@@ -161,7 +161,7 @@ if ($action == 'activate_MAIN_SECURITY_DISABLEFORGETPASSLINK')
|
|||||||
header("Location: security.php");
|
header("Location: security.php");
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
else if ($action == 'disable_MAIN_SECURITY_DISABLEFORGETPASSLINK')
|
elseif ($action == 'disable_MAIN_SECURITY_DISABLEFORGETPASSLINK')
|
||||||
{
|
{
|
||||||
dolibarr_del_const($db, "MAIN_SECURITY_DISABLEFORGETPASSLINK",$conf->entity);
|
dolibarr_del_const($db, "MAIN_SECURITY_DISABLEFORGETPASSLINK",$conf->entity);
|
||||||
header("Location: security.php");
|
header("Location: security.php");
|
||||||
|
|||||||
@@ -67,7 +67,7 @@ if ($action == 'updateform')
|
|||||||
|
|
||||||
|
|
||||||
// Delete file
|
// Delete file
|
||||||
else if ($action == 'delete')
|
elseif ($action == 'delete')
|
||||||
{
|
{
|
||||||
$langs->load("other");
|
$langs->load("other");
|
||||||
$file = $conf->admin->dir_temp . '/' . GETPOST('urlfile','alpha'); // Do not use urldecode here ($_GET and $_REQUEST are already decoded by PHP).
|
$file = $conf->admin->dir_temp . '/' . GETPOST('urlfile','alpha'); // Do not use urldecode here ($_GET and $_REQUEST are already decoded by PHP).
|
||||||
|
|||||||
@@ -57,7 +57,7 @@ if (preg_match('/set_([a-z0-9_\-]+)/i',$action,$reg))
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
else if (preg_match('/del_([a-z0-9_\-]+)/i',$action,$reg))
|
elseif (preg_match('/del_([a-z0-9_\-]+)/i',$action,$reg))
|
||||||
{
|
{
|
||||||
$code=$reg[1];
|
$code=$reg[1];
|
||||||
if (dolibarr_del_const($db, $code, $conf->entity) > 0)
|
if (dolibarr_del_const($db, $code, $conf->entity) > 0)
|
||||||
@@ -71,7 +71,7 @@ else if (preg_match('/del_([a-z0-9_\-]+)/i',$action,$reg))
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
else if ($action == 'updateform')
|
elseif ($action == 'updateform')
|
||||||
{
|
{
|
||||||
$res1=dolibarr_set_const($db, "MAIN_APPLICATION_TITLE", $_POST["MAIN_APPLICATION_TITLE"],'chaine',0,'',$conf->entity);
|
$res1=dolibarr_set_const($db, "MAIN_APPLICATION_TITLE", $_POST["MAIN_APPLICATION_TITLE"],'chaine',0,'',$conf->entity);
|
||||||
$res2=dolibarr_set_const($db, "MAIN_SESSION_TIMEOUT", $_POST["MAIN_SESSION_TIMEOUT"],'chaine',0,'',$conf->entity);
|
$res2=dolibarr_set_const($db, "MAIN_SESSION_TIMEOUT", $_POST["MAIN_SESSION_TIMEOUT"],'chaine',0,'',$conf->entity);
|
||||||
|
|||||||
@@ -122,12 +122,12 @@ if ($action == 'specimen') // For invoices
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Activate a model
|
// Activate a model
|
||||||
else if ($action == 'set')
|
elseif ($action == 'set')
|
||||||
{
|
{
|
||||||
$ret = addDocumentModel($value, $type, $label, $scandir);
|
$ret = addDocumentModel($value, $type, $label, $scandir);
|
||||||
}
|
}
|
||||||
|
|
||||||
else if ($action == 'del')
|
elseif ($action == 'del')
|
||||||
{
|
{
|
||||||
$ret = delDocumentModel($value, $type);
|
$ret = delDocumentModel($value, $type);
|
||||||
if ($ret > 0)
|
if ($ret > 0)
|
||||||
@@ -137,7 +137,7 @@ else if ($action == 'del')
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Set default model
|
// Set default model
|
||||||
else if ($action == 'setdoc')
|
elseif ($action == 'setdoc')
|
||||||
{
|
{
|
||||||
if (dolibarr_set_const($db, "INVOICE_SUPPLIER_ADDON_PDF",$value,'chaine',0,'',$conf->entity))
|
if (dolibarr_set_const($db, "INVOICE_SUPPLIER_ADDON_PDF",$value,'chaine',0,'',$conf->entity))
|
||||||
{
|
{
|
||||||
@@ -153,7 +153,7 @@ else if ($action == 'setdoc')
|
|||||||
$ret = addDocumentModel($value, $type, $label, $scandir);
|
$ret = addDocumentModel($value, $type, $label, $scandir);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if ($action == 'unsetdoc')
|
elseif ($action == 'unsetdoc')
|
||||||
{
|
{
|
||||||
dolibarr_del_const($db, "INVOICE_SUPPLIER_ADDON_PDF", $conf->entity);
|
dolibarr_del_const($db, "INVOICE_SUPPLIER_ADDON_PDF", $conf->entity);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -73,7 +73,7 @@ if ($action == 'updateMask')
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
else if ($action == 'specimen') // For orders
|
elseif ($action == 'specimen') // For orders
|
||||||
{
|
{
|
||||||
$modele=GETPOST('module','alpha');
|
$modele=GETPOST('module','alpha');
|
||||||
|
|
||||||
@@ -120,12 +120,12 @@ else if ($action == 'specimen') // For orders
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Activate a model
|
// Activate a model
|
||||||
else if ($action == 'set')
|
elseif ($action == 'set')
|
||||||
{
|
{
|
||||||
$ret = addDocumentModel($value, $type, $label, $scandir);
|
$ret = addDocumentModel($value, $type, $label, $scandir);
|
||||||
}
|
}
|
||||||
|
|
||||||
else if ($action == 'del')
|
elseif ($action == 'del')
|
||||||
{
|
{
|
||||||
$ret = delDocumentModel($value, $type);
|
$ret = delDocumentModel($value, $type);
|
||||||
if ($ret > 0)
|
if ($ret > 0)
|
||||||
@@ -135,7 +135,7 @@ else if ($action == 'del')
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Set default model
|
// Set default model
|
||||||
else if ($action == 'setdoc')
|
elseif ($action == 'setdoc')
|
||||||
{
|
{
|
||||||
if (dolibarr_set_const($db, "COMMANDE_SUPPLIER_ADDON_PDF",$value,'chaine',0,'',$conf->entity))
|
if (dolibarr_set_const($db, "COMMANDE_SUPPLIER_ADDON_PDF",$value,'chaine',0,'',$conf->entity))
|
||||||
{
|
{
|
||||||
@@ -152,7 +152,7 @@ else if ($action == 'setdoc')
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
else if ($action == 'setmod')
|
elseif ($action == 'setmod')
|
||||||
{
|
{
|
||||||
// TODO Verifier si module numerotation choisi peut etre active
|
// TODO Verifier si module numerotation choisi peut etre active
|
||||||
// par appel methode canBeActivated
|
// par appel methode canBeActivated
|
||||||
@@ -160,13 +160,13 @@ else if ($action == 'setmod')
|
|||||||
dolibarr_set_const($db, "COMMANDE_SUPPLIER_ADDON_NUMBER",$value,'chaine',0,'',$conf->entity);
|
dolibarr_set_const($db, "COMMANDE_SUPPLIER_ADDON_NUMBER",$value,'chaine',0,'',$conf->entity);
|
||||||
}
|
}
|
||||||
|
|
||||||
else if ($action == 'addcat')
|
elseif ($action == 'addcat')
|
||||||
{
|
{
|
||||||
$fourn = new Fournisseur($db);
|
$fourn = new Fournisseur($db);
|
||||||
$fourn->CreateCategory($user,$_POST["cat"]);
|
$fourn->CreateCategory($user,$_POST["cat"]);
|
||||||
}
|
}
|
||||||
|
|
||||||
else if ($action == 'set_SUPPLIER_ORDER_OTHER')
|
elseif ($action == 'set_SUPPLIER_ORDER_OTHER')
|
||||||
{
|
{
|
||||||
$freetext = GETPOST('SUPPLIER_ORDER_FREE_TEXT','none'); // No alpha here, we want exact string
|
$freetext = GETPOST('SUPPLIER_ORDER_FREE_TEXT','none'); // No alpha here, we want exact string
|
||||||
$doubleapproval = GETPOST('SUPPLIER_ORDER_3_STEPS_TO_BE_APPROVED','alpha');
|
$doubleapproval = GETPOST('SUPPLIER_ORDER_3_STEPS_TO_BE_APPROVED','alpha');
|
||||||
@@ -206,7 +206,7 @@ else if ($action == 'set_SUPPLIER_ORDER_OTHER')
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Activate ask for payment bank
|
// Activate ask for payment bank
|
||||||
else if ($action == 'set_BANK_ASK_PAYMENT_BANK_DURING_SUPPLIER_ORDER')
|
elseif ($action == 'set_BANK_ASK_PAYMENT_BANK_DURING_SUPPLIER_ORDER')
|
||||||
{
|
{
|
||||||
$res = dolibarr_set_const($db, "BANK_ASK_PAYMENT_BANK_DURING_SUPPLIER_ORDER",$value,'chaine',0,'',$conf->entity);
|
$res = dolibarr_set_const($db, "BANK_ASK_PAYMENT_BANK_DURING_SUPPLIER_ORDER",$value,'chaine',0,'',$conf->entity);
|
||||||
|
|
||||||
|
|||||||
@@ -61,18 +61,18 @@ if ($action == 'updateMask')
|
|||||||
{
|
{
|
||||||
setEventMessages($langs->trans("Error"), null, 'errors');
|
setEventMessages($langs->trans("Error"), null, 'errors');
|
||||||
}
|
}
|
||||||
}else if ($action == 'setmod')
|
}elseif ($action == 'setmod')
|
||||||
{
|
{
|
||||||
dolibarr_set_const($db, "SUPPLIER_PAYMENT_ADDON", $value, 'chaine', 0, '', $conf->entity);
|
dolibarr_set_const($db, "SUPPLIER_PAYMENT_ADDON", $value, 'chaine', 0, '', $conf->entity);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Activate a model
|
// Activate a model
|
||||||
else if ($action == 'set')
|
elseif ($action == 'set')
|
||||||
{
|
{
|
||||||
$ret = addDocumentModel($value, $type, $label, $scandir);
|
$ret = addDocumentModel($value, $type, $label, $scandir);
|
||||||
}
|
}
|
||||||
|
|
||||||
else if ($action == 'del')
|
elseif ($action == 'del')
|
||||||
{
|
{
|
||||||
$ret = delDocumentModel($value, $type);
|
$ret = delDocumentModel($value, $type);
|
||||||
if ($ret > 0)
|
if ($ret > 0)
|
||||||
@@ -82,7 +82,7 @@ else if ($action == 'del')
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Set default model
|
// Set default model
|
||||||
else if ($action == 'setdoc')
|
elseif ($action == 'setdoc')
|
||||||
{
|
{
|
||||||
if (dolibarr_set_const($db, "SUPPLIER_PAYMENT_ADDON_PDF",$value,'chaine',0,'',$conf->entity))
|
if (dolibarr_set_const($db, "SUPPLIER_PAYMENT_ADDON_PDF",$value,'chaine',0,'',$conf->entity))
|
||||||
{
|
{
|
||||||
@@ -99,7 +99,7 @@ else if ($action == 'setdoc')
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
else if ($action == 'specimen')
|
elseif ($action == 'specimen')
|
||||||
{
|
{
|
||||||
$modele=GETPOST('module','alpha');
|
$modele=GETPOST('module','alpha');
|
||||||
|
|
||||||
|
|||||||
@@ -169,7 +169,7 @@ if ($action == 'set')
|
|||||||
$ret = addDocumentModel($value, $type, $label, $scandir);
|
$ret = addDocumentModel($value, $type, $label, $scandir);
|
||||||
}
|
}
|
||||||
|
|
||||||
else if ($action == 'del')
|
elseif ($action == 'del')
|
||||||
{
|
{
|
||||||
$ret = delDocumentModel($value, $type);
|
$ret = delDocumentModel($value, $type);
|
||||||
if ($ret > 0)
|
if ($ret > 0)
|
||||||
@@ -178,7 +178,7 @@ else if ($action == 'del')
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
else if ($action == 'setdoc')
|
elseif ($action == 'setdoc')
|
||||||
{
|
{
|
||||||
if (dolibarr_set_const($db, "SUPPLIER_PROPOSAL_ADDON_PDF",$value,'chaine',0,'',$conf->entity))
|
if (dolibarr_set_const($db, "SUPPLIER_PROPOSAL_ADDON_PDF",$value,'chaine',0,'',$conf->entity))
|
||||||
{
|
{
|
||||||
@@ -193,7 +193,7 @@ else if ($action == 'setdoc')
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
else if ($action == 'setmod')
|
elseif ($action == 'setmod')
|
||||||
{
|
{
|
||||||
// TODO Verifier si module numerotation choisi peut etre active
|
// TODO Verifier si module numerotation choisi peut etre active
|
||||||
// par appel methode canBeActivated
|
// par appel methode canBeActivated
|
||||||
|
|||||||
@@ -230,7 +230,7 @@ foreach ($syslogModules as $moduleName)
|
|||||||
if (! empty($tmpoption))
|
if (! empty($tmpoption))
|
||||||
{
|
{
|
||||||
if (isset($_POST[$tmpoption])) $value=$_POST[$tmpoption];
|
if (isset($_POST[$tmpoption])) $value=$_POST[$tmpoption];
|
||||||
else if (! empty($conf->global->$tmpoption)) $value = $conf->global->$tmpoption;
|
elseif (! empty($conf->global->$tmpoption)) $value = $conf->global->$tmpoption;
|
||||||
}
|
}
|
||||||
else $value = (isset($option['default']) ? $option['default'] : '');
|
else $value = (isset($option['default']) ? $option['default'] : '');
|
||||||
|
|
||||||
|
|||||||
@@ -183,7 +183,7 @@ foreach($configfileparameters as $key)
|
|||||||
// Value
|
// Value
|
||||||
print "<td>";
|
print "<td>";
|
||||||
if ($newkey == 'dolibarr_main_db_pass') print preg_replace('/./i','*',${$newkey});
|
if ($newkey == 'dolibarr_main_db_pass') print preg_replace('/./i','*',${$newkey});
|
||||||
else if ($newkey == 'dolibarr_main_url_root' && preg_match('/__auto__/',${$newkey})) print ${$newkey}.' => '.constant('DOL_MAIN_URL_ROOT');
|
elseif ($newkey == 'dolibarr_main_url_root' && preg_match('/__auto__/',${$newkey})) print ${$newkey}.' => '.constant('DOL_MAIN_URL_ROOT');
|
||||||
else print ${$newkey};
|
else print ${$newkey};
|
||||||
if ($newkey == 'dolibarr_main_url_root' && ${$newkey} != DOL_MAIN_URL_ROOT) print ' (currently overwritten by autodetected value: '.DOL_MAIN_URL_ROOT.')';
|
if ($newkey == 'dolibarr_main_url_root' && ${$newkey} != DOL_MAIN_URL_ROOT) print ' (currently overwritten by autodetected value: '.DOL_MAIN_URL_ROOT.')';
|
||||||
print "</td>";
|
print "</td>";
|
||||||
|
|||||||
@@ -56,17 +56,17 @@ if (preg_match('/mysql/i',$conf->db->type))
|
|||||||
$sql = "SHOW TABLE STATUS";
|
$sql = "SHOW TABLE STATUS";
|
||||||
$base=1;
|
$base=1;
|
||||||
}
|
}
|
||||||
else if ($conf->db->type == 'pgsql')
|
elseif ($conf->db->type == 'pgsql')
|
||||||
{
|
{
|
||||||
$sql = "SELECT conname, contype FROM pg_constraint;";
|
$sql = "SELECT conname, contype FROM pg_constraint;";
|
||||||
$base=2;
|
$base=2;
|
||||||
}
|
}
|
||||||
else if ($conf->db->type == 'mssql')
|
elseif ($conf->db->type == 'mssql')
|
||||||
{
|
{
|
||||||
//$sqls[0] = "";
|
//$sqls[0] = "";
|
||||||
//$base=3;
|
//$base=3;
|
||||||
}
|
}
|
||||||
else if ($conf->db->type == 'sqlite' || $conf->db->type == 'sqlite3')
|
elseif ($conf->db->type == 'sqlite' || $conf->db->type == 'sqlite3')
|
||||||
{
|
{
|
||||||
//$sql = "SELECT name, type FROM sqlite_master";
|
//$sql = "SELECT name, type FROM sqlite_master";
|
||||||
$base = 4;
|
$base = 4;
|
||||||
|
|||||||
@@ -50,7 +50,7 @@ if (preg_match('/mysql/i',$conf->db->type))
|
|||||||
$sql = "SHOW TABLE STATUS LIKE '".$db->escape($table)."'";
|
$sql = "SHOW TABLE STATUS LIKE '".$db->escape($table)."'";
|
||||||
$base=1;
|
$base=1;
|
||||||
}
|
}
|
||||||
else if ($conf->db->type == 'pgsql')
|
elseif ($conf->db->type == 'pgsql')
|
||||||
{
|
{
|
||||||
$sql = "SELECT conname,contype FROM pg_constraint";
|
$sql = "SELECT conname,contype FROM pg_constraint";
|
||||||
$base=2;
|
$base=2;
|
||||||
|
|||||||
@@ -374,8 +374,8 @@ foreach($configfileparameters as $key => $value)
|
|||||||
// Value
|
// Value
|
||||||
print "<td>";
|
print "<td>";
|
||||||
if ($newkey == 'dolibarr_main_db_pass') print preg_replace('/./i','*',${$newkey});
|
if ($newkey == 'dolibarr_main_db_pass') print preg_replace('/./i','*',${$newkey});
|
||||||
else if ($newkey == 'dolibarr_main_url_root' && preg_match('/__auto__/',${$newkey})) print ${$newkey}.' => '.constant('DOL_MAIN_URL_ROOT');
|
elseif ($newkey == 'dolibarr_main_url_root' && preg_match('/__auto__/',${$newkey})) print ${$newkey}.' => '.constant('DOL_MAIN_URL_ROOT');
|
||||||
else if ($newkey == 'dolibarr_main_document_root_alt')
|
elseif ($newkey == 'dolibarr_main_document_root_alt')
|
||||||
{
|
{
|
||||||
$tmparray=explode(',',${$newkey});
|
$tmparray=explode(',',${$newkey});
|
||||||
$i=0;
|
$i=0;
|
||||||
|
|||||||
@@ -166,7 +166,7 @@ print '<tr '.$bc[false].'><td style="padding-left: 8px">';
|
|||||||
</div>
|
</div>
|
||||||
<?php
|
<?php
|
||||||
}
|
}
|
||||||
else if (in_array($type, array('pgsql')))
|
elseif (in_array($type, array('pgsql')))
|
||||||
{
|
{
|
||||||
?>
|
?>
|
||||||
<div class="formelementrow"><input type="radio" name="what" value="postgresql" id="radio_dump_postgresql" />
|
<div class="formelementrow"><input type="radio" name="what" value="postgresql" id="radio_dump_postgresql" />
|
||||||
|
|||||||
@@ -106,7 +106,7 @@ print $langs->trans("RestoreDesc3",$dolibarr_main_db_name).'<br><br>';
|
|||||||
</div>
|
</div>
|
||||||
<?php
|
<?php
|
||||||
}
|
}
|
||||||
else if (in_array($type, array('pgsql')))
|
elseif (in_array($type, array('pgsql')))
|
||||||
{
|
{
|
||||||
?>
|
?>
|
||||||
<div class="formelementrow">
|
<div class="formelementrow">
|
||||||
@@ -164,7 +164,7 @@ if (in_array($type, array('mysql', 'mysqli')))
|
|||||||
</fieldset>
|
</fieldset>
|
||||||
<?php
|
<?php
|
||||||
}
|
}
|
||||||
else if (in_array($type, array('pgsql')))
|
elseif (in_array($type, array('pgsql')))
|
||||||
{
|
{
|
||||||
?>
|
?>
|
||||||
<fieldset id="postgresql_options">
|
<fieldset id="postgresql_options">
|
||||||
|
|||||||
@@ -48,17 +48,17 @@ if (isset($_POST['caching'])) {
|
|||||||
} else {
|
} else {
|
||||||
eaccelerator_caching(true);
|
eaccelerator_caching(true);
|
||||||
}
|
}
|
||||||
} else if (isset($_POST['optimizer']) && function_exists('eaccelerator_optimizer')) {
|
} elseif (isset($_POST['optimizer']) && function_exists('eaccelerator_optimizer')) {
|
||||||
if ($info['optimizer']) {
|
if ($info['optimizer']) {
|
||||||
eaccelerator_optimizer(false);
|
eaccelerator_optimizer(false);
|
||||||
} else {
|
} else {
|
||||||
eaccelerator_optimizer(true);
|
eaccelerator_optimizer(true);
|
||||||
}
|
}
|
||||||
} else if (isset($_POST['clear'])) {
|
} elseif (isset($_POST['clear'])) {
|
||||||
eaccelerator_clear();
|
eaccelerator_clear();
|
||||||
} else if (isset($_POST['clean'])) {
|
} elseif (isset($_POST['clean'])) {
|
||||||
eaccelerator_clean();
|
eaccelerator_clean();
|
||||||
} else if (isset($_POST['purge'])) {
|
} elseif (isset($_POST['purge'])) {
|
||||||
eaccelerator_purge();
|
eaccelerator_purge();
|
||||||
}
|
}
|
||||||
$info = eaccelerator_info();
|
$info = eaccelerator_info();
|
||||||
@@ -81,7 +81,7 @@ function compare($x, $y)
|
|||||||
|
|
||||||
if ( $x[$sortby] == $y[$sortby] ) {
|
if ( $x[$sortby] == $y[$sortby] ) {
|
||||||
return 0;
|
return 0;
|
||||||
} else if ($x[$sortby] < $y[$sortby]) {
|
} elseif ($x[$sortby] < $y[$sortby]) {
|
||||||
return -1;
|
return -1;
|
||||||
} else {
|
} else {
|
||||||
return 1;
|
return 1;
|
||||||
@@ -101,7 +101,7 @@ function revcompare($x, $y)
|
|||||||
|
|
||||||
if ($x[$sortby] == $y[$sortby]) {
|
if ($x[$sortby] == $y[$sortby]) {
|
||||||
return 0;
|
return 0;
|
||||||
} else if ($x[$sortby] < $y[$sortby]) {
|
} elseif ($x[$sortby] < $y[$sortby]) {
|
||||||
return 1;
|
return 1;
|
||||||
} else {
|
} else {
|
||||||
return -1;
|
return -1;
|
||||||
|
|||||||
@@ -115,7 +115,7 @@ if ($action == 'purge')
|
|||||||
$formquestion=array();
|
$formquestion=array();
|
||||||
print $form->formconfirm($_SERVER["PHP_SELF"].'?noparam=noparam', $langs->trans('PurgeSessions'), $langs->trans('ConfirmPurgeSessions'),'confirm_purge',$formquestion,'no',2);
|
print $form->formconfirm($_SERVER["PHP_SELF"].'?noparam=noparam', $langs->trans('PurgeSessions'), $langs->trans('ConfirmPurgeSessions'),'confirm_purge',$formquestion,'no',2);
|
||||||
}
|
}
|
||||||
else if ($action == 'lock')
|
elseif ($action == 'lock')
|
||||||
{
|
{
|
||||||
$formquestion=array();
|
$formquestion=array();
|
||||||
print $form->formconfirm($_SERVER["PHP_SELF"].'?noparam=noparam', $langs->trans('LockNewSessions'), $langs->trans('ConfirmLockNewSessions',$user->login),'confirm_lock',$formquestion,'no',1);
|
print $form->formconfirm($_SERVER["PHP_SELF"].'?noparam=noparam', $langs->trans('LockNewSessions'), $langs->trans('ConfirmLockNewSessions',$user->login),'confirm_lock',$formquestion,'no',1);
|
||||||
|
|||||||
@@ -543,7 +543,7 @@ if ($mode == 'searchkey')
|
|||||||
$htmltext = $langs->trans("OriginalValueWas", $newlangfileonly->tab_translate[$key]);
|
$htmltext = $langs->trans("OriginalValueWas", $newlangfileonly->tab_translate[$key]);
|
||||||
print $form->textwithpicto('', $htmltext, 1, 'info');
|
print $form->textwithpicto('', $htmltext, 1, 'info');
|
||||||
}
|
}
|
||||||
else if (!empty($conf->global->MAIN_ENABLE_OVERWRITE_TRANSLATION))
|
elseif (!empty($conf->global->MAIN_ENABLE_OVERWRITE_TRANSLATION))
|
||||||
{
|
{
|
||||||
//print $key.'-'.$val;
|
//print $key.'-'.$val;
|
||||||
print '<a href="' . $_SERVER['PHP_SELF'] . '?mode=overwrite&langcode=' . $langcode . '&transkey=' . $key . '">' . img_edit_add($langs->trans("Overwrite")) . '</a>';
|
print '<a href="' . $_SERVER['PHP_SELF'] . '?mode=overwrite&langcode=' . $langcode . '&transkey=' . $key . '">' . img_edit_add($langs->trans("Overwrite")) . '</a>';
|
||||||
|
|||||||
@@ -659,7 +659,7 @@ $db->close();
|
|||||||
* @param string $context 'add'=Output field for the "add form", 'edit'=Output field for the "edit form", 'hide'=Output field for the "add form" but we dont want it to be rendered
|
* @param string $context 'add'=Output field for the "add form", 'edit'=Output field for the "edit form", 'hide'=Output field for the "add form" but we dont want it to be rendered
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
function fieldListWebsites($fieldlist, $obj='', $tabname='', $context='')
|
function fieldListWebsites($fieldlist, $obj = '', $tabname = '', $context = '')
|
||||||
{
|
{
|
||||||
global $conf,$langs,$db;
|
global $conf,$langs,$db;
|
||||||
global $form;
|
global $form;
|
||||||
|
|||||||
@@ -46,7 +46,7 @@ class DolibarrApi
|
|||||||
* @param string $cachedir Cache dir
|
* @param string $cachedir Cache dir
|
||||||
* @param boolean $refreshCache Update cache
|
* @param boolean $refreshCache Update cache
|
||||||
*/
|
*/
|
||||||
function __construct($db, $cachedir='', $refreshCache=false)
|
function __construct($db, $cachedir = '', $refreshCache = false)
|
||||||
{
|
{
|
||||||
global $conf, $dolibarr_main_url_root;
|
global $conf, $dolibarr_main_url_root;
|
||||||
|
|
||||||
@@ -222,7 +222,7 @@ class DolibarrApi
|
|||||||
* @return bool
|
* @return bool
|
||||||
* @throws RestException
|
* @throws RestException
|
||||||
*/
|
*/
|
||||||
static function _checkAccessToResource($resource, $resource_id=0, $dbtablename='', $feature2='', $dbt_keyfield='fk_soc', $dbt_select='rowid')
|
static function _checkAccessToResource($resource, $resource_id = 0, $dbtablename = '', $feature2 = '', $dbt_keyfield = 'fk_soc', $dbt_select = 'rowid')
|
||||||
{
|
{
|
||||||
|
|
||||||
// Features/modules to check
|
// Features/modules to check
|
||||||
@@ -230,7 +230,7 @@ class DolibarrApi
|
|||||||
if (preg_match('/&/', $resource)) {
|
if (preg_match('/&/', $resource)) {
|
||||||
$featuresarray = explode("&", $resource);
|
$featuresarray = explode("&", $resource);
|
||||||
}
|
}
|
||||||
else if (preg_match('/\|/', $resource)) {
|
elseif (preg_match('/\|/', $resource)) {
|
||||||
$featuresarray = explode("|", $resource);
|
$featuresarray = explode("|", $resource);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -55,7 +55,7 @@ class Login
|
|||||||
* @url GET /
|
* @url GET /
|
||||||
* @url POST /
|
* @url POST /
|
||||||
*/
|
*/
|
||||||
public function index($login, $password, $entity='', $reset=0)
|
public function index($login, $password, $entity = '', $reset = 0)
|
||||||
{
|
{
|
||||||
|
|
||||||
global $conf, $dolibarr_main_authentication, $dolibarr_auto_user;
|
global $conf, $dolibarr_main_authentication, $dolibarr_auto_user;
|
||||||
|
|||||||
@@ -202,7 +202,7 @@ class Setup extends DolibarrApi
|
|||||||
if ($country->fetch($id) < 0) {
|
if ($country->fetch($id) < 0) {
|
||||||
throw new RestException(503, 'Error when retrieving country : '.$country->error);
|
throw new RestException(503, 'Error when retrieving country : '.$country->error);
|
||||||
}
|
}
|
||||||
else if ($country->fetch($id) == 0) {
|
elseif ($country->fetch($id) == 0) {
|
||||||
throw new RestException(404, 'country not found');
|
throw new RestException(404, 'country not found');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -312,7 +312,7 @@ class Asset extends CommonObject
|
|||||||
* @param int $save_lastsearch_value -1=Auto, 0=No save of lastsearch_values when clicking, 1=Save lastsearch_values whenclicking
|
* @param int $save_lastsearch_value -1=Auto, 0=No save of lastsearch_values when clicking, 1=Save lastsearch_values whenclicking
|
||||||
* @return string String with URL
|
* @return string String with URL
|
||||||
*/
|
*/
|
||||||
function getNomUrl($withpicto=0, $option='', $notooltip=0, $morecss='', $save_lastsearch_value=-1)
|
function getNomUrl($withpicto = 0, $option = '', $notooltip = 0, $morecss = '', $save_lastsearch_value = -1)
|
||||||
{
|
{
|
||||||
global $db, $conf, $langs;
|
global $db, $conf, $langs;
|
||||||
global $dolibarr_main_authentication, $dolibarr_main_demo;
|
global $dolibarr_main_authentication, $dolibarr_main_demo;
|
||||||
@@ -369,7 +369,7 @@ class Asset 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
|
* @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
|
* @return string Label of status
|
||||||
*/
|
*/
|
||||||
function getLibStatut($mode=0)
|
function getLibStatut($mode = 0)
|
||||||
{
|
{
|
||||||
return $this->LibStatut($this->status,$mode);
|
return $this->LibStatut($this->status,$mode);
|
||||||
}
|
}
|
||||||
@@ -382,7 +382,7 @@ 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
|
* @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
|
* @return string Label of status
|
||||||
*/
|
*/
|
||||||
static function LibStatut($status,$mode=0)
|
static function LibStatut($status, $mode = 0)
|
||||||
{
|
{
|
||||||
// phpcs:enable
|
// phpcs:enable
|
||||||
global $langs;
|
global $langs;
|
||||||
|
|||||||
@@ -89,7 +89,7 @@ class AssetType extends CommonObject
|
|||||||
* @param int $notrigger 1=do not execute triggers, 0 otherwise
|
* @param int $notrigger 1=do not execute triggers, 0 otherwise
|
||||||
* @return int >0 if OK, < 0 if KO
|
* @return int >0 if OK, < 0 if KO
|
||||||
*/
|
*/
|
||||||
function create($user,$notrigger=0)
|
function create($user, $notrigger = 0)
|
||||||
{
|
{
|
||||||
global $conf;
|
global $conf;
|
||||||
|
|
||||||
@@ -166,7 +166,7 @@ class AssetType extends CommonObject
|
|||||||
* @param int $notrigger 1=do not execute triggers, 0 otherwise
|
* @param int $notrigger 1=do not execute triggers, 0 otherwise
|
||||||
* @return int >0 if OK, < 0 if KO
|
* @return int >0 if OK, < 0 if KO
|
||||||
*/
|
*/
|
||||||
function update($user,$notrigger=0)
|
function update($user, $notrigger = 0)
|
||||||
{
|
{
|
||||||
global $conf, $hookmanager;
|
global $conf, $hookmanager;
|
||||||
|
|
||||||
@@ -350,7 +350,7 @@ class AssetType extends CommonObject
|
|||||||
* 2=Return array of asset id only
|
* 2=Return array of asset id only
|
||||||
* @return mixed Array of asset or -1 on error
|
* @return mixed Array of asset or -1 on error
|
||||||
*/
|
*/
|
||||||
function listAssetForAssetType($excludefilter='', $mode=0)
|
function listAssetForAssetType($excludefilter = '', $mode = 0)
|
||||||
{
|
{
|
||||||
global $conf, $user;
|
global $conf, $user;
|
||||||
|
|
||||||
@@ -405,7 +405,7 @@ class AssetType extends CommonObject
|
|||||||
* @param int $notooltip 1=Disable tooltip
|
* @param int $notooltip 1=Disable tooltip
|
||||||
* @return string String with URL
|
* @return string String with URL
|
||||||
*/
|
*/
|
||||||
function getNomUrl($withpicto=0, $maxlen=0, $notooltip=0)
|
function getNomUrl($withpicto = 0, $maxlen = 0, $notooltip = 0)
|
||||||
{
|
{
|
||||||
global $langs;
|
global $langs;
|
||||||
|
|
||||||
|
|||||||
@@ -105,7 +105,7 @@ if ($action === 'downloadblockchain') {
|
|||||||
|
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
else if (GETPOST('downloadcsv','alpha'))
|
elseif (GETPOST('downloadcsv','alpha'))
|
||||||
{
|
{
|
||||||
$error = 0;
|
$error = 0;
|
||||||
|
|
||||||
|
|||||||
@@ -142,7 +142,7 @@ class BlockedLogAuthority
|
|||||||
* @param string $signature Signature of object to load
|
* @param string $signature Signature of object to load
|
||||||
* @return int >0 if OK, <0 if KO, 0 if not found
|
* @return int >0 if OK, <0 if KO, 0 if not found
|
||||||
*/
|
*/
|
||||||
public function fetch($id, $signature='')
|
public function fetch($id, $signature = '')
|
||||||
{
|
{
|
||||||
|
|
||||||
global $langs;
|
global $langs;
|
||||||
@@ -161,7 +161,7 @@ class BlockedLogAuthority
|
|||||||
$sql.= " FROM ".MAIN_DB_PREFIX."blockedlog_authority as b";
|
$sql.= " FROM ".MAIN_DB_PREFIX."blockedlog_authority as b";
|
||||||
|
|
||||||
if ($id) $sql.= " WHERE b.rowid = ". $id;
|
if ($id) $sql.= " WHERE b.rowid = ". $id;
|
||||||
else if($signature)$sql.= " WHERE b.signature = '". $this->db->escape( $signature ) ."'" ;
|
elseif($signature)$sql.= " WHERE b.signature = '". $this->db->escape( $signature ) ."'" ;
|
||||||
|
|
||||||
$resql=$this->db->query($sql);
|
$resql=$this->db->query($sql);
|
||||||
if ($resql)
|
if ($resql)
|
||||||
|
|||||||
@@ -208,7 +208,7 @@ class BlockedLog
|
|||||||
$this->error++;
|
$this->error++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if($this->element === 'payment') {
|
elseif($this->element === 'payment') {
|
||||||
require_once DOL_DOCUMENT_ROOT.'/compta/paiement/class/paiement.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/compta/paiement/class/paiement.class.php';
|
||||||
|
|
||||||
$object = new Paiement($this->db);
|
$object = new Paiement($this->db);
|
||||||
@@ -219,7 +219,7 @@ class BlockedLog
|
|||||||
$this->error++;
|
$this->error++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if($this->element === 'payment_supplier') {
|
elseif($this->element === 'payment_supplier') {
|
||||||
require_once DOL_DOCUMENT_ROOT.'/fourn/class/paiementfourn.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/fourn/class/paiementfourn.class.php';
|
||||||
|
|
||||||
$object = new PaiementFourn($this->db);
|
$object = new PaiementFourn($this->db);
|
||||||
@@ -230,7 +230,7 @@ class BlockedLog
|
|||||||
$this->error++;
|
$this->error++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if($this->element === 'payment_donation') {
|
elseif($this->element === 'payment_donation') {
|
||||||
require_once DOL_DOCUMENT_ROOT.'/don/class/paymentdonation.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/don/class/paymentdonation.class.php';
|
||||||
|
|
||||||
$object = new PaymentDonation($this->db);
|
$object = new PaymentDonation($this->db);
|
||||||
@@ -241,7 +241,7 @@ class BlockedLog
|
|||||||
$this->error++;
|
$this->error++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if($this->element === 'payment_various') {
|
elseif($this->element === 'payment_various') {
|
||||||
require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/paymentvarious.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/paymentvarious.class.php';
|
||||||
|
|
||||||
$object = new PaymentVarious($this->db);
|
$object = new PaymentVarious($this->db);
|
||||||
@@ -252,7 +252,7 @@ class BlockedLog
|
|||||||
$this->error++;
|
$this->error++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if($this->element === 'don' || $this->element === 'donation') {
|
elseif($this->element === 'don' || $this->element === 'donation') {
|
||||||
require_once DOL_DOCUMENT_ROOT.'/don/class/don.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/don/class/don.class.php';
|
||||||
|
|
||||||
$object = new Don($this->db);
|
$object = new Don($this->db);
|
||||||
@@ -263,7 +263,7 @@ class BlockedLog
|
|||||||
$this->error++;
|
$this->error++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if($this->element === 'subscription') {
|
elseif($this->element === 'subscription') {
|
||||||
require_once DOL_DOCUMENT_ROOT.'/adherents/class/subscription.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/adherents/class/subscription.class.php';
|
||||||
|
|
||||||
$object = new Subscription($this->db);
|
$object = new Subscription($this->db);
|
||||||
@@ -274,7 +274,7 @@ class BlockedLog
|
|||||||
$this->error++;
|
$this->error++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if($this->element === 'cashcontrol') {
|
elseif($this->element === 'cashcontrol') {
|
||||||
require_once DOL_DOCUMENT_ROOT.'/compta/cashcontrol/class/cashcontrol.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/compta/cashcontrol/class/cashcontrol.class.php';
|
||||||
|
|
||||||
$object = new CashControl($this->db);
|
$object = new CashControl($this->db);
|
||||||
@@ -285,11 +285,11 @@ class BlockedLog
|
|||||||
$this->error++;
|
$this->error++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if ($this->action == 'MODULE_SET')
|
elseif ($this->action == 'MODULE_SET')
|
||||||
{
|
{
|
||||||
return '<i class="opacitymedium">System to track events into unalterable logs were enabled</i>';
|
return '<i class="opacitymedium">System to track events into unalterable logs were enabled</i>';
|
||||||
}
|
}
|
||||||
else if ($this->action == 'MODULE_RESET')
|
elseif ($this->action == 'MODULE_RESET')
|
||||||
{
|
{
|
||||||
if ($this->signature == '0000000000')
|
if ($this->signature == '0000000000')
|
||||||
{
|
{
|
||||||
@@ -469,7 +469,7 @@ class BlockedLog
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (!is_object($value)) $this->object_data->{$key} = $value;
|
elseif (!is_object($value)) $this->object_data->{$key} = $value;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (! empty($object->newref)) $this->object_data->ref = $object->newref;
|
if (! empty($object->newref)) $this->object_data->ref = $object->newref;
|
||||||
@@ -725,7 +725,7 @@ class BlockedLog
|
|||||||
* @param string $mode 0=unserialize, 1=json_decode
|
* @param string $mode 0=unserialize, 1=json_decode
|
||||||
* @return string Value unserialized
|
* @return string Value unserialized
|
||||||
*/
|
*/
|
||||||
public function dolDecodeBlockedData($data, $mode=0)
|
public function dolDecodeBlockedData($data, $mode = 0)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
@@ -763,7 +763,7 @@ class BlockedLog
|
|||||||
* @param int $forcesignature Force signature (for example '0000000000' when we disabled the module)
|
* @param int $forcesignature Force signature (for example '0000000000' when we disabled the module)
|
||||||
* @return int <0 if KO, >0 if OK
|
* @return int <0 if KO, >0 if OK
|
||||||
*/
|
*/
|
||||||
public function create($user, $forcesignature='')
|
public function create($user, $forcesignature = '')
|
||||||
{
|
{
|
||||||
|
|
||||||
global $conf,$langs,$hookmanager;
|
global $conf,$langs,$hookmanager;
|
||||||
@@ -878,7 +878,7 @@ class BlockedLog
|
|||||||
* @param string $previoushash If previous signature hash is known, we can provide it to avoid to make a search of it in database.
|
* @param string $previoushash If previous signature hash is known, we can provide it to avoid to make a search of it in database.
|
||||||
* @return boolean True if OK, False if KO
|
* @return boolean True if OK, False if KO
|
||||||
*/
|
*/
|
||||||
public function checkSignature($previoushash='')
|
public function checkSignature($previoushash = '')
|
||||||
{
|
{
|
||||||
if (empty($previoushash))
|
if (empty($previoushash))
|
||||||
{
|
{
|
||||||
@@ -921,7 +921,7 @@ class BlockedLog
|
|||||||
* @param int $beforeid ID of a record
|
* @param int $beforeid ID of a record
|
||||||
* @return string Hash of previous record (if beforeid is defined) or hash of last record (if beforeid is 0)
|
* @return string Hash of previous record (if beforeid is defined) or hash of last record (if beforeid is 0)
|
||||||
*/
|
*/
|
||||||
public function getPreviousHash($withlock=0, $beforeid=0)
|
public function getPreviousHash($withlock = 0, $beforeid = 0)
|
||||||
{
|
{
|
||||||
global $conf;
|
global $conf;
|
||||||
|
|
||||||
@@ -972,7 +972,7 @@ class BlockedLog
|
|||||||
* @param string $search_code search code
|
* @param string $search_code search code
|
||||||
* @return array|int Array of object log or <0 if error
|
* @return array|int Array of object log or <0 if error
|
||||||
*/
|
*/
|
||||||
public function getLog($element, $fk_object, $limit = 0, $sortfield = '', $sortorder = '', $search_fk_user = -1, $search_start = -1, $search_end = -1, $search_ref='', $search_amount='', $search_code='')
|
public function getLog($element, $fk_object, $limit = 0, $sortfield = '', $sortorder = '', $search_fk_user = -1, $search_start = -1, $search_end = -1, $search_ref = '', $search_amount = '', $search_code = '')
|
||||||
{
|
{
|
||||||
global $conf, $cachedlogs;
|
global $conf, $cachedlogs;
|
||||||
|
|
||||||
@@ -984,11 +984,11 @@ class BlockedLog
|
|||||||
$sql="SELECT rowid FROM ".MAIN_DB_PREFIX."blockedlog
|
$sql="SELECT rowid FROM ".MAIN_DB_PREFIX."blockedlog
|
||||||
WHERE entity=".$conf->entity;
|
WHERE entity=".$conf->entity;
|
||||||
}
|
}
|
||||||
else if ($element=='not_certified') {
|
elseif ($element=='not_certified') {
|
||||||
$sql="SELECT rowid FROM ".MAIN_DB_PREFIX."blockedlog
|
$sql="SELECT rowid FROM ".MAIN_DB_PREFIX."blockedlog
|
||||||
WHERE entity=".$conf->entity." AND certified = 0";
|
WHERE entity=".$conf->entity." AND certified = 0";
|
||||||
}
|
}
|
||||||
else if ($element=='just_certified') {
|
elseif ($element=='just_certified') {
|
||||||
$sql="SELECT rowid FROM ".MAIN_DB_PREFIX."blockedlog
|
$sql="SELECT rowid FROM ".MAIN_DB_PREFIX."blockedlog
|
||||||
WHERE entity=".$conf->entity." AND certified = 1";
|
WHERE entity=".$conf->entity." AND certified = 1";
|
||||||
}
|
}
|
||||||
@@ -1070,7 +1070,7 @@ class BlockedLog
|
|||||||
* @param int $ignoresystem Ignore system events for the test
|
* @param int $ignoresystem Ignore system events for the test
|
||||||
* @return bool
|
* @return bool
|
||||||
*/
|
*/
|
||||||
function alreadyUsed($ignoresystem=0)
|
function alreadyUsed($ignoresystem = 0)
|
||||||
{
|
{
|
||||||
global $conf;
|
global $conf;
|
||||||
|
|
||||||
|
|||||||
@@ -283,14 +283,14 @@ class Facturation
|
|||||||
* @param int $aId Id
|
* @param int $aId Id
|
||||||
* @return id
|
* @return id
|
||||||
*/
|
*/
|
||||||
public function id($aId=null)
|
public function id($aId = null)
|
||||||
{
|
{
|
||||||
|
|
||||||
if ( !$aId )
|
if ( !$aId )
|
||||||
{
|
{
|
||||||
return $this->id;
|
return $this->id;
|
||||||
}
|
}
|
||||||
else if ( $aId == 'RESET' )
|
elseif ( $aId == 'RESET' )
|
||||||
{
|
{
|
||||||
|
|
||||||
$this->id = null;
|
$this->id = null;
|
||||||
@@ -308,14 +308,14 @@ class Facturation
|
|||||||
* @param string $aRef Ref
|
* @param string $aRef Ref
|
||||||
* @return string Ref
|
* @return string Ref
|
||||||
*/
|
*/
|
||||||
public function ref($aRef=null)
|
public function ref($aRef = null)
|
||||||
{
|
{
|
||||||
|
|
||||||
if (is_null($aRef))
|
if (is_null($aRef))
|
||||||
{
|
{
|
||||||
return $this->ref;
|
return $this->ref;
|
||||||
}
|
}
|
||||||
else if ( $aRef == 'RESET' )
|
elseif ( $aRef == 'RESET' )
|
||||||
{
|
{
|
||||||
$this->ref = null;
|
$this->ref = null;
|
||||||
}
|
}
|
||||||
@@ -331,13 +331,13 @@ class Facturation
|
|||||||
* @param int $aQte Qty
|
* @param int $aQte Qty
|
||||||
* @return int Qty
|
* @return int Qty
|
||||||
*/
|
*/
|
||||||
public function qte($aQte=null)
|
public function qte($aQte = null)
|
||||||
{
|
{
|
||||||
if (is_null($aQte))
|
if (is_null($aQte))
|
||||||
{
|
{
|
||||||
return $this->qte;
|
return $this->qte;
|
||||||
}
|
}
|
||||||
else if ( $aQte == 'RESET' )
|
elseif ( $aQte == 'RESET' )
|
||||||
{
|
{
|
||||||
|
|
||||||
$this->qte = null;
|
$this->qte = null;
|
||||||
@@ -354,14 +354,14 @@ class Facturation
|
|||||||
* @param string $aStock Stock
|
* @param string $aStock Stock
|
||||||
* @return string Stock
|
* @return string Stock
|
||||||
*/
|
*/
|
||||||
public function stock($aStock=null)
|
public function stock($aStock = null)
|
||||||
{
|
{
|
||||||
|
|
||||||
if (is_null($aStock))
|
if (is_null($aStock))
|
||||||
{
|
{
|
||||||
return $this->stock;
|
return $this->stock;
|
||||||
}
|
}
|
||||||
else if ( $aStock == 'RESET' )
|
elseif ( $aStock == 'RESET' )
|
||||||
{
|
{
|
||||||
$this->stock = null;
|
$this->stock = null;
|
||||||
}
|
}
|
||||||
@@ -377,14 +377,14 @@ class Facturation
|
|||||||
* @param string $aRemisePercent Discount
|
* @param string $aRemisePercent Discount
|
||||||
* @return string Discount
|
* @return string Discount
|
||||||
*/
|
*/
|
||||||
public function remisePercent($aRemisePercent=null)
|
public function remisePercent($aRemisePercent = null)
|
||||||
{
|
{
|
||||||
|
|
||||||
if (is_null($aRemisePercent))
|
if (is_null($aRemisePercent))
|
||||||
{
|
{
|
||||||
return $this->remise_percent;
|
return $this->remise_percent;
|
||||||
}
|
}
|
||||||
else if ($aRemisePercent == 'RESET')
|
elseif ($aRemisePercent == 'RESET')
|
||||||
{
|
{
|
||||||
$this->remise_percent = null;
|
$this->remise_percent = null;
|
||||||
}
|
}
|
||||||
@@ -400,13 +400,13 @@ class Facturation
|
|||||||
* @param int $aMontantRemise Amount
|
* @param int $aMontantRemise Amount
|
||||||
* @return string Amount
|
* @return string Amount
|
||||||
*/
|
*/
|
||||||
public function montantRemise($aMontantRemise=null)
|
public function montantRemise($aMontantRemise = null)
|
||||||
{
|
{
|
||||||
|
|
||||||
if (is_null($aMontantRemise)) {
|
if (is_null($aMontantRemise)) {
|
||||||
|
|
||||||
return $this->montant_remise;
|
return $this->montant_remise;
|
||||||
} else if ( $aMontantRemise == 'RESET' ) {
|
} elseif ( $aMontantRemise == 'RESET' ) {
|
||||||
|
|
||||||
$this->montant_remise = null;
|
$this->montant_remise = null;
|
||||||
} else {
|
} else {
|
||||||
@@ -421,13 +421,13 @@ class Facturation
|
|||||||
* @param int $aPrix Price
|
* @param int $aPrix Price
|
||||||
* @return string Stock
|
* @return string Stock
|
||||||
*/
|
*/
|
||||||
public function prix($aPrix=null)
|
public function prix($aPrix = null)
|
||||||
{
|
{
|
||||||
|
|
||||||
if (is_null($aPrix)) {
|
if (is_null($aPrix)) {
|
||||||
|
|
||||||
return $this->prix;
|
return $this->prix;
|
||||||
} else if ( $aPrix == 'RESET' ) {
|
} elseif ( $aPrix == 'RESET' ) {
|
||||||
|
|
||||||
$this->prix = null;
|
$this->prix = null;
|
||||||
} else {
|
} else {
|
||||||
@@ -442,12 +442,12 @@ class Facturation
|
|||||||
* @param int $aTva Vat
|
* @param int $aTva Vat
|
||||||
* @return int Vat
|
* @return int Vat
|
||||||
*/
|
*/
|
||||||
public function tva($aTva=null)
|
public function tva($aTva = null)
|
||||||
{
|
{
|
||||||
if (is_null($aTva)) {
|
if (is_null($aTva)) {
|
||||||
|
|
||||||
return $this->tva;
|
return $this->tva;
|
||||||
} else if ( $aTva == 'RESET' ) {
|
} elseif ( $aTva == 'RESET' ) {
|
||||||
|
|
||||||
$this->tva = null;
|
$this->tva = null;
|
||||||
} else {
|
} else {
|
||||||
@@ -462,12 +462,12 @@ class Facturation
|
|||||||
* @param string $aNumFacture Invoice ref
|
* @param string $aNumFacture Invoice ref
|
||||||
* @return string Invoice ref
|
* @return string Invoice ref
|
||||||
*/
|
*/
|
||||||
public function numInvoice($aNumFacture=null)
|
public function numInvoice($aNumFacture = null)
|
||||||
{
|
{
|
||||||
if (is_null($aNumFacture)) {
|
if (is_null($aNumFacture)) {
|
||||||
|
|
||||||
return $this->num_facture;
|
return $this->num_facture;
|
||||||
} else if ( $aNumFacture == 'RESET' ) {
|
} elseif ( $aNumFacture == 'RESET' ) {
|
||||||
|
|
||||||
$this->num_facture = null;
|
$this->num_facture = null;
|
||||||
} else {
|
} else {
|
||||||
@@ -482,13 +482,13 @@ class Facturation
|
|||||||
* @param int $aModeReglement Payment mode
|
* @param int $aModeReglement Payment mode
|
||||||
* @return int Payment mode
|
* @return int Payment mode
|
||||||
*/
|
*/
|
||||||
public function getSetPaymentMode($aModeReglement=null)
|
public function getSetPaymentMode($aModeReglement = null)
|
||||||
{
|
{
|
||||||
|
|
||||||
if (is_null($aModeReglement)) {
|
if (is_null($aModeReglement)) {
|
||||||
|
|
||||||
return $this->mode_reglement;
|
return $this->mode_reglement;
|
||||||
} else if ( $aModeReglement == 'RESET' ) {
|
} elseif ( $aModeReglement == 'RESET' ) {
|
||||||
|
|
||||||
$this->mode_reglement = null;
|
$this->mode_reglement = null;
|
||||||
} else {
|
} else {
|
||||||
@@ -503,13 +503,13 @@ class Facturation
|
|||||||
* @param int $aMontantEncaisse Amount
|
* @param int $aMontantEncaisse Amount
|
||||||
* @return int Amount
|
* @return int Amount
|
||||||
*/
|
*/
|
||||||
public function montantEncaisse($aMontantEncaisse=null)
|
public function montantEncaisse($aMontantEncaisse = null)
|
||||||
{
|
{
|
||||||
|
|
||||||
if (is_null($aMontantEncaisse)) {
|
if (is_null($aMontantEncaisse)) {
|
||||||
|
|
||||||
return $this->montant_encaisse;
|
return $this->montant_encaisse;
|
||||||
} else if ( $aMontantEncaisse == 'RESET' ) {
|
} elseif ( $aMontantEncaisse == 'RESET' ) {
|
||||||
|
|
||||||
$this->montant_encaisse = null;
|
$this->montant_encaisse = null;
|
||||||
} else {
|
} else {
|
||||||
@@ -524,13 +524,13 @@ class Facturation
|
|||||||
* @param int $aMontantRendu Amount
|
* @param int $aMontantRendu Amount
|
||||||
* @return int Amount
|
* @return int Amount
|
||||||
*/
|
*/
|
||||||
public function montantRendu($aMontantRendu=null)
|
public function montantRendu($aMontantRendu = null)
|
||||||
{
|
{
|
||||||
|
|
||||||
if (is_null($aMontantRendu)) {
|
if (is_null($aMontantRendu)) {
|
||||||
|
|
||||||
return $this->montant_rendu;
|
return $this->montant_rendu;
|
||||||
} else if ( $aMontantRendu == 'RESET' ) {
|
} elseif ( $aMontantRendu == 'RESET' ) {
|
||||||
|
|
||||||
$this->montant_rendu = null;
|
$this->montant_rendu = null;
|
||||||
} else {
|
} else {
|
||||||
@@ -545,12 +545,12 @@ class Facturation
|
|||||||
* @param date $aPaiementLe Date
|
* @param date $aPaiementLe Date
|
||||||
* @return date Date
|
* @return date Date
|
||||||
*/
|
*/
|
||||||
public function paiementLe($aPaiementLe=null)
|
public function paiementLe($aPaiementLe = null)
|
||||||
{
|
{
|
||||||
if (is_null($aPaiementLe)) {
|
if (is_null($aPaiementLe)) {
|
||||||
|
|
||||||
return $this->paiement_le;
|
return $this->paiement_le;
|
||||||
} else if ( $aPaiementLe == 'RESET' ) {
|
} elseif ( $aPaiementLe == 'RESET' ) {
|
||||||
|
|
||||||
$this->paiement_le = null;
|
$this->paiement_le = null;
|
||||||
} else {
|
} else {
|
||||||
@@ -565,12 +565,12 @@ class Facturation
|
|||||||
* @param int $aTotalHt Total amount
|
* @param int $aTotalHt Total amount
|
||||||
* @return int Total amount
|
* @return int Total amount
|
||||||
*/
|
*/
|
||||||
public function prixTotalHt($aTotalHt=null)
|
public function prixTotalHt($aTotalHt = null)
|
||||||
{
|
{
|
||||||
if (is_null($aTotalHt)) {
|
if (is_null($aTotalHt)) {
|
||||||
|
|
||||||
return $this->prix_total_ht;
|
return $this->prix_total_ht;
|
||||||
} else if ( $aTotalHt == 'RESET' ) {
|
} elseif ( $aTotalHt == 'RESET' ) {
|
||||||
|
|
||||||
$this->prix_total_ht = null;
|
$this->prix_total_ht = null;
|
||||||
} else {
|
} else {
|
||||||
@@ -585,12 +585,12 @@ class Facturation
|
|||||||
* @param int $aMontantTva Amount vat
|
* @param int $aMontantTva Amount vat
|
||||||
* @return int Amount vat
|
* @return int Amount vat
|
||||||
*/
|
*/
|
||||||
public function montantTva($aMontantTva=null)
|
public function montantTva($aMontantTva = null)
|
||||||
{
|
{
|
||||||
if (is_null($aMontantTva)) {
|
if (is_null($aMontantTva)) {
|
||||||
|
|
||||||
return $this->montant_tva;
|
return $this->montant_tva;
|
||||||
} else if ( $aMontantTva == 'RESET' ) {
|
} elseif ( $aMontantTva == 'RESET' ) {
|
||||||
|
|
||||||
$this->montant_tva = null;
|
$this->montant_tva = null;
|
||||||
} else {
|
} else {
|
||||||
@@ -605,7 +605,7 @@ class Facturation
|
|||||||
* @param int $aTotalTtc Amount ttc
|
* @param int $aTotalTtc Amount ttc
|
||||||
* @return int Amount ttc
|
* @return int Amount ttc
|
||||||
*/
|
*/
|
||||||
public function prixTotalTtc($aTotalTtc=null)
|
public function prixTotalTtc($aTotalTtc = null)
|
||||||
{
|
{
|
||||||
if (is_null($aTotalTtc))
|
if (is_null($aTotalTtc))
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -138,7 +138,7 @@ if ( $nbr_enreg > 1 )
|
|||||||
$top_liste_produits = '----- '.$nbr_enreg.' '.$langs->transnoentitiesnoconv("CashDeskProducts").' '.$langs->trans("CashDeskOn").' '.$nbr_enreg.' -----';
|
$top_liste_produits = '----- '.$nbr_enreg.' '.$langs->transnoentitiesnoconv("CashDeskProducts").' '.$langs->trans("CashDeskOn").' '.$nbr_enreg.' -----';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if ( $nbr_enreg == 1 )
|
elseif ( $nbr_enreg == 1 )
|
||||||
{
|
{
|
||||||
$top_liste_produits = '----- 1 '.$langs->transnoentitiesnoconv("ProductFound"). ' -----';
|
$top_liste_produits = '----- 1 '.$langs->transnoentitiesnoconv("ProductFound"). ' -----';
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -51,7 +51,7 @@ switch($action)
|
|||||||
{
|
{
|
||||||
$sql.= " AND p.rowid = ".$_POST['selProduit'];
|
$sql.= " AND p.rowid = ".$_POST['selProduit'];
|
||||||
}
|
}
|
||||||
else if ( $_POST['hdnSource'] == 'REF' )
|
elseif ( $_POST['hdnSource'] == 'REF' )
|
||||||
{
|
{
|
||||||
$sql.= " AND p.ref = '".$_POST['txtRef']."'";
|
$sql.= " AND p.ref = '".$_POST['txtRef']."'";
|
||||||
}
|
}
|
||||||
@@ -163,7 +163,7 @@ switch($action)
|
|||||||
{
|
{
|
||||||
$filtre = $ret['ref'];
|
$filtre = $ret['ref'];
|
||||||
}
|
}
|
||||||
else if ( $_POST['hdnSource'] == 'REF' )
|
elseif ( $_POST['hdnSource'] == 'REF' )
|
||||||
{
|
{
|
||||||
$filtre = $_POST['txtRef'];
|
$filtre = $_POST['txtRef'];
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -89,32 +89,32 @@ if ($action == 'add' && $user->rights->categorie->creer)
|
|||||||
header("Location: ".$urlfrom);
|
header("Location: ".$urlfrom);
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
else if ($idProdOrigin)
|
elseif ($idProdOrigin)
|
||||||
{
|
{
|
||||||
header("Location: ".DOL_URL_ROOT.'/categories/viewcat.php?id='.$idProdOrigin.'&type='.$type);
|
header("Location: ".DOL_URL_ROOT.'/categories/viewcat.php?id='.$idProdOrigin.'&type='.$type);
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
else if ($idCompanyOrigin)
|
elseif ($idCompanyOrigin)
|
||||||
{
|
{
|
||||||
header("Location: ".DOL_URL_ROOT.'/categories/viewcat.php?id='.$idCompanyOrigin.'&type='.$type);
|
header("Location: ".DOL_URL_ROOT.'/categories/viewcat.php?id='.$idCompanyOrigin.'&type='.$type);
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
else if ($idSupplierOrigin)
|
elseif ($idSupplierOrigin)
|
||||||
{
|
{
|
||||||
header("Location: ".DOL_URL_ROOT.'/categories/viewcat.php?id='.$idSupplierOrigin.'&type='.$type);
|
header("Location: ".DOL_URL_ROOT.'/categories/viewcat.php?id='.$idSupplierOrigin.'&type='.$type);
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
else if ($idMemberOrigin)
|
elseif ($idMemberOrigin)
|
||||||
{
|
{
|
||||||
header("Location: ".DOL_URL_ROOT.'/categories/viewcat.php?id='.$idMemberOrigin.'&type='.$type);
|
header("Location: ".DOL_URL_ROOT.'/categories/viewcat.php?id='.$idMemberOrigin.'&type='.$type);
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
else if ($idContactOrigin)
|
elseif ($idContactOrigin)
|
||||||
{
|
{
|
||||||
header("Location: ".DOL_URL_ROOT.'/categories/viewcat.php?id='.$idContactOrigin.'&type='.$type);
|
header("Location: ".DOL_URL_ROOT.'/categories/viewcat.php?id='.$idContactOrigin.'&type='.$type);
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
else if ($idProjectOrigin)
|
elseif ($idProjectOrigin)
|
||||||
{
|
{
|
||||||
header("Location: ".DOL_URL_ROOT.'/categories/viewcat.php?id='.$idProjectOrigin.'&type='.$type);
|
header("Location: ".DOL_URL_ROOT.'/categories/viewcat.php?id='.$idProjectOrigin.'&type='.$type);
|
||||||
exit;
|
exit;
|
||||||
@@ -179,32 +179,32 @@ if (($action == 'add' || $action == 'confirmed') && $user->rights->categorie->cr
|
|||||||
header("Location: ".$backtopage);
|
header("Location: ".$backtopage);
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
else if ($idProdOrigin)
|
elseif ($idProdOrigin)
|
||||||
{
|
{
|
||||||
header("Location: ".DOL_URL_ROOT.'/categories/viewcat.php?id='.$idProdOrigin.'&type='.$type.'&mesg='.urlencode($langs->trans("CatCreated")));
|
header("Location: ".DOL_URL_ROOT.'/categories/viewcat.php?id='.$idProdOrigin.'&type='.$type.'&mesg='.urlencode($langs->trans("CatCreated")));
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
else if ($idCompanyOrigin)
|
elseif ($idCompanyOrigin)
|
||||||
{
|
{
|
||||||
header("Location: ".DOL_URL_ROOT.'/categories/viewcat.php?id='.$idCompanyOrigin.'&type='.$type.'&mesg='.urlencode($langs->trans("CatCreated")));
|
header("Location: ".DOL_URL_ROOT.'/categories/viewcat.php?id='.$idCompanyOrigin.'&type='.$type.'&mesg='.urlencode($langs->trans("CatCreated")));
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
else if ($idSupplierOrigin)
|
elseif ($idSupplierOrigin)
|
||||||
{
|
{
|
||||||
header("Location: ".DOL_URL_ROOT.'/categories/viewcat.php?id='.$idSupplierOrigin.'&type='.$type.'&mesg='.urlencode($langs->trans("CatCreated")));
|
header("Location: ".DOL_URL_ROOT.'/categories/viewcat.php?id='.$idSupplierOrigin.'&type='.$type.'&mesg='.urlencode($langs->trans("CatCreated")));
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
else if ($idMemberOrigin)
|
elseif ($idMemberOrigin)
|
||||||
{
|
{
|
||||||
header("Location: ".DOL_URL_ROOT.'/categories/viewcat.php?id='.$idMemberOrigin.'&type='.$type.'&mesg='.urlencode($langs->trans("CatCreated")));
|
header("Location: ".DOL_URL_ROOT.'/categories/viewcat.php?id='.$idMemberOrigin.'&type='.$type.'&mesg='.urlencode($langs->trans("CatCreated")));
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
else if ($idContactOrigin)
|
elseif ($idContactOrigin)
|
||||||
{
|
{
|
||||||
header("Location: ".DOL_URL_ROOT.'/categories/viewcat.php?id='.$idContactOrigin.'&type='.$type.'&mesg='.urlencode($langs->trans("CatCreated")));
|
header("Location: ".DOL_URL_ROOT.'/categories/viewcat.php?id='.$idContactOrigin.'&type='.$type.'&mesg='.urlencode($langs->trans("CatCreated")));
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
else if ($idProjectOrigin)
|
elseif ($idProjectOrigin)
|
||||||
{
|
{
|
||||||
header("Location: ".DOL_URL_ROOT.'/categories/viewcat.php?id='.$idProjectOrigin.'&type='.$type.'&mesg='.urlencode($langs->trans("CatCreated")));
|
header("Location: ".DOL_URL_ROOT.'/categories/viewcat.php?id='.$idProjectOrigin.'&type='.$type.'&mesg='.urlencode($langs->trans("CatCreated")));
|
||||||
exit;
|
exit;
|
||||||
|
|||||||
@@ -234,7 +234,7 @@ class Categorie extends CommonObject
|
|||||||
* @param string $type Type of category ('product', '...') or (0, 1, ...)
|
* @param string $type Type of category ('product', '...') or (0, 1, ...)
|
||||||
* @return int <0 if KO, >0 if OK
|
* @return int <0 if KO, >0 if OK
|
||||||
*/
|
*/
|
||||||
function fetch($id, $label='', $type=null)
|
function fetch($id, $label = '', $type = null)
|
||||||
{
|
{
|
||||||
global $conf;
|
global $conf;
|
||||||
|
|
||||||
@@ -501,7 +501,7 @@ class Categorie extends CommonObject
|
|||||||
* @param int $notrigger 1=Does not execute triggers, 0= execute triggers
|
* @param int $notrigger 1=Does not execute triggers, 0= execute triggers
|
||||||
* @return int <0 KO >0 OK
|
* @return int <0 KO >0 OK
|
||||||
*/
|
*/
|
||||||
function delete($user, $notrigger=0)
|
function delete($user, $notrigger = 0)
|
||||||
{
|
{
|
||||||
global $conf,$langs;
|
global $conf,$langs;
|
||||||
|
|
||||||
@@ -691,7 +691,7 @@ class Categorie extends CommonObject
|
|||||||
*
|
*
|
||||||
* @return int 1 if OK, -1 if KO
|
* @return int 1 if OK, -1 if KO
|
||||||
*/
|
*/
|
||||||
function del_type($obj,$type)
|
function del_type($obj, $type)
|
||||||
{
|
{
|
||||||
// phpcs:enable
|
// phpcs:enable
|
||||||
global $user,$langs,$conf;
|
global $user,$langs,$conf;
|
||||||
@@ -749,7 +749,7 @@ class Categorie extends CommonObject
|
|||||||
* @return array|int -1 if KO, array of instance of object if OK
|
* @return array|int -1 if KO, array of instance of object if OK
|
||||||
* @see containsObject
|
* @see containsObject
|
||||||
*/
|
*/
|
||||||
function getObjectsInCateg($type, $onlyids=0)
|
function getObjectsInCateg($type, $onlyids = 0)
|
||||||
{
|
{
|
||||||
$objs = array();
|
$objs = array();
|
||||||
|
|
||||||
@@ -821,7 +821,7 @@ class Categorie extends CommonObject
|
|||||||
* @param int $page Page number
|
* @param int $page Page number
|
||||||
* @return array|int Array of categories, 0 if no cat, -1 on error
|
* @return array|int Array of categories, 0 if no cat, -1 on error
|
||||||
*/
|
*/
|
||||||
function getListForItem($id, $type='customer', $sortfield = "s.rowid", $sortorder = 'ASC', $limit = 0, $page = 0)
|
function getListForItem($id, $type = 'customer', $sortfield = "s.rowid", $sortorder = 'ASC', $limit = 0, $page = 0)
|
||||||
{
|
{
|
||||||
global $conf;
|
global $conf;
|
||||||
|
|
||||||
@@ -990,7 +990,7 @@ class Categorie extends CommonObject
|
|||||||
*
|
*
|
||||||
* @return array|int Array of categories. this->cats and this->motherof are set, -1 on error
|
* @return array|int Array of categories. this->cats and this->motherof are set, -1 on error
|
||||||
*/
|
*/
|
||||||
function get_full_arbo($type, $markafterid=0)
|
function get_full_arbo($type, $markafterid = 0)
|
||||||
{
|
{
|
||||||
// phpcs:enable
|
// phpcs:enable
|
||||||
global $conf, $langs;
|
global $conf, $langs;
|
||||||
@@ -1076,7 +1076,7 @@ class Categorie extends CommonObject
|
|||||||
* @param int $protection Deep counter to avoid infinite loop
|
* @param int $protection Deep counter to avoid infinite loop
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
function build_path_from_id_categ($id_categ,$protection=1000)
|
function build_path_from_id_categ($id_categ, $protection = 1000)
|
||||||
{
|
{
|
||||||
// phpcs:enable
|
// phpcs:enable
|
||||||
dol_syslog(get_class($this)."::build_path_from_id_categ id_categ=".$id_categ." protection=".$protection, LOG_DEBUG);
|
dol_syslog(get_class($this)."::build_path_from_id_categ id_categ=".$id_categ." protection=".$protection, LOG_DEBUG);
|
||||||
@@ -1143,7 +1143,7 @@ class Categorie extends CommonObject
|
|||||||
* @param boolean $parent Just parent categories if true
|
* @param boolean $parent Just parent categories if true
|
||||||
* @return array|int Table of Object Category, -1 on error
|
* @return array|int Table of Object Category, -1 on error
|
||||||
*/
|
*/
|
||||||
function get_all_categories($type=null, $parent=false)
|
function get_all_categories($type = null, $parent = false)
|
||||||
{
|
{
|
||||||
// phpcs:enable
|
// phpcs:enable
|
||||||
if (! is_numeric($type)) $type = $this->MAP_ID[$type];
|
if (! is_numeric($type)) $type = $this->MAP_ID[$type];
|
||||||
@@ -1232,7 +1232,7 @@ class Categorie extends CommonObject
|
|||||||
* @param int $type Type of category (0, 1, ...)
|
* @param int $type Type of category (0, 1, ...)
|
||||||
* @return array
|
* @return array
|
||||||
*/
|
*/
|
||||||
function get_main_categories($type=null)
|
function get_main_categories($type = null)
|
||||||
{
|
{
|
||||||
// phpcs:enable
|
// phpcs:enable
|
||||||
return $this->get_all_categories($type, true);
|
return $this->get_all_categories($type, true);
|
||||||
@@ -1248,7 +1248,7 @@ class Categorie extends CommonObject
|
|||||||
* @param int $nocolor 0
|
* @param int $nocolor 0
|
||||||
* @return array
|
* @return array
|
||||||
*/
|
*/
|
||||||
function print_all_ways($sep = " >> ", $url='', $nocolor=0)
|
function print_all_ways($sep = " >> ", $url = '', $nocolor = 0)
|
||||||
{
|
{
|
||||||
// phpcs:enable
|
// phpcs:enable
|
||||||
$ways = array();
|
$ways = array();
|
||||||
@@ -1376,7 +1376,7 @@ class Categorie extends CommonObject
|
|||||||
* labels, 'id'= Get array of category IDs
|
* labels, 'id'= Get array of category IDs
|
||||||
* @return array|int Array of category objects or < 0 if KO
|
* @return array|int Array of category objects or < 0 if KO
|
||||||
*/
|
*/
|
||||||
function containing($id, $type, $mode='object')
|
function containing($id, $type, $mode = 'object')
|
||||||
{
|
{
|
||||||
$cats = array();
|
$cats = array();
|
||||||
|
|
||||||
@@ -1397,7 +1397,7 @@ class Categorie extends CommonObject
|
|||||||
{
|
{
|
||||||
if ($mode == 'id') {
|
if ($mode == 'id') {
|
||||||
$cats[] = $obj->rowid;
|
$cats[] = $obj->rowid;
|
||||||
} else if ($mode == 'label') {
|
} elseif ($mode == 'label') {
|
||||||
$cats[] = $obj->label;
|
$cats[] = $obj->label;
|
||||||
} else {
|
} else {
|
||||||
$cat = new Categorie($this->db);
|
$cat = new Categorie($this->db);
|
||||||
@@ -1427,7 +1427,7 @@ class Categorie extends CommonObject
|
|||||||
{
|
{
|
||||||
if ($mode == 'id') {
|
if ($mode == 'id') {
|
||||||
$cats[] = $obj->rowid;
|
$cats[] = $obj->rowid;
|
||||||
} else if ($mode == 'label') {
|
} elseif ($mode == 'label') {
|
||||||
$cats[] = $obj->label;
|
$cats[] = $obj->label;
|
||||||
} else {
|
} else {
|
||||||
$cat = new Categorie($this->db);
|
$cat = new Categorie($this->db);
|
||||||
@@ -1522,7 +1522,7 @@ class Categorie extends CommonObject
|
|||||||
* @param int $maxlength Max length of text
|
* @param int $maxlength Max length of text
|
||||||
* @return string Chaine avec URL
|
* @return string Chaine avec URL
|
||||||
*/
|
*/
|
||||||
function getNomUrl($withpicto=0,$option='',$maxlength=0)
|
function getNomUrl($withpicto = 0, $option = '', $maxlength = 0)
|
||||||
{
|
{
|
||||||
global $langs;
|
global $langs;
|
||||||
|
|
||||||
@@ -1608,7 +1608,7 @@ class Categorie extends CommonObject
|
|||||||
* @param int $nbmax Nombre maximum de photos (0=pas de max)
|
* @param int $nbmax Nombre maximum de photos (0=pas de max)
|
||||||
* @return array Tableau de photos
|
* @return array Tableau de photos
|
||||||
*/
|
*/
|
||||||
function liste_photos($dir,$nbmax=0)
|
function liste_photos($dir, $nbmax = 0)
|
||||||
{
|
{
|
||||||
// phpcs:enable
|
// phpcs:enable
|
||||||
include_once DOL_DOCUMENT_ROOT .'/core/lib/files.lib.php';
|
include_once DOL_DOCUMENT_ROOT .'/core/lib/files.lib.php';
|
||||||
@@ -1747,7 +1747,7 @@ class Categorie extends CommonObject
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (isset($this->multilangs["$key"]))
|
elseif (isset($this->multilangs["$key"]))
|
||||||
{
|
{
|
||||||
if ($this->db->num_rows($result)) // si aucune ligne dans la base
|
if ($this->db->num_rows($result)) // si aucune ligne dans la base
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -270,7 +270,7 @@ if ($action == 'edit')
|
|||||||
|
|
||||||
print '</form>';
|
print '</form>';
|
||||||
}
|
}
|
||||||
else if ($action != 'add')
|
elseif ($action != 'add')
|
||||||
{
|
{
|
||||||
if ($cnt_trans) print '<div class="underbanner clearboth"></div>';
|
if ($cnt_trans) print '<div class="underbanner clearboth"></div>';
|
||||||
|
|
||||||
|
|||||||
@@ -86,40 +86,40 @@ if ($id > 0 && $removeelem > 0)
|
|||||||
$result = $tmpobject->fetch($removeelem);
|
$result = $tmpobject->fetch($removeelem);
|
||||||
$elementtype = 'product';
|
$elementtype = 'product';
|
||||||
}
|
}
|
||||||
else if ($type == Categorie::TYPE_SUPPLIER && $user->rights->societe->creer)
|
elseif ($type == Categorie::TYPE_SUPPLIER && $user->rights->societe->creer)
|
||||||
{
|
{
|
||||||
$tmpobject = new Societe($db);
|
$tmpobject = new Societe($db);
|
||||||
$result = $tmpobject->fetch($removeelem);
|
$result = $tmpobject->fetch($removeelem);
|
||||||
$elementtype = 'supplier';
|
$elementtype = 'supplier';
|
||||||
}
|
}
|
||||||
else if ($type == Categorie::TYPE_CUSTOMER && $user->rights->societe->creer)
|
elseif ($type == Categorie::TYPE_CUSTOMER && $user->rights->societe->creer)
|
||||||
{
|
{
|
||||||
$tmpobject = new Societe($db);
|
$tmpobject = new Societe($db);
|
||||||
$result = $tmpobject->fetch($removeelem);
|
$result = $tmpobject->fetch($removeelem);
|
||||||
$elementtype = 'customer';
|
$elementtype = 'customer';
|
||||||
}
|
}
|
||||||
else if ($type == Categorie::TYPE_MEMBER && $user->rights->adherent->creer)
|
elseif ($type == Categorie::TYPE_MEMBER && $user->rights->adherent->creer)
|
||||||
{
|
{
|
||||||
require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php';
|
||||||
$tmpobject = new Adherent($db);
|
$tmpobject = new Adherent($db);
|
||||||
$result = $tmpobject->fetch($removeelem);
|
$result = $tmpobject->fetch($removeelem);
|
||||||
$elementtype = 'member';
|
$elementtype = 'member';
|
||||||
}
|
}
|
||||||
else if ($type == Categorie::TYPE_CONTACT && $user->rights->societe->creer) {
|
elseif ($type == Categorie::TYPE_CONTACT && $user->rights->societe->creer) {
|
||||||
|
|
||||||
require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php';
|
||||||
$tmpobject = new Contact($db);
|
$tmpobject = new Contact($db);
|
||||||
$result = $tmpobject->fetch($removeelem);
|
$result = $tmpobject->fetch($removeelem);
|
||||||
$elementtype = 'contact';
|
$elementtype = 'contact';
|
||||||
}
|
}
|
||||||
else if ($type == Categorie::TYPE_ACCOUNT && $user->rights->banque->configurer)
|
elseif ($type == Categorie::TYPE_ACCOUNT && $user->rights->banque->configurer)
|
||||||
{
|
{
|
||||||
require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
|
||||||
$tmpobject = new Account($db);
|
$tmpobject = new Account($db);
|
||||||
$result = $tmpobject->fetch($removeelem);
|
$result = $tmpobject->fetch($removeelem);
|
||||||
$elementtype = 'account';
|
$elementtype = 'account';
|
||||||
}
|
}
|
||||||
else if ($type == Categorie::TYPE_PROJECT && $user->rights->projet->creer)
|
elseif ($type == Categorie::TYPE_PROJECT && $user->rights->projet->creer)
|
||||||
{
|
{
|
||||||
require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
|
||||||
$tmpobject = new Project($db);
|
$tmpobject = new Project($db);
|
||||||
|
|||||||
@@ -791,11 +791,11 @@ if ($action == 'create')
|
|||||||
print '<td>';
|
print '<td>';
|
||||||
$percent=-1;
|
$percent=-1;
|
||||||
if (isset($_GET['status']) || isset($_POST['status'])) $percent=GETPOST('status');
|
if (isset($_GET['status']) || isset($_POST['status'])) $percent=GETPOST('status');
|
||||||
else if (isset($_GET['percentage']) || isset($_POST['percentage'])) $percent=GETPOST('percentage');
|
elseif (isset($_GET['percentage']) || isset($_POST['percentage'])) $percent=GETPOST('percentage');
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (GETPOST('complete') == '0' || GETPOST("afaire") == 1) $percent='0';
|
if (GETPOST('complete') == '0' || GETPOST("afaire") == 1) $percent='0';
|
||||||
else if (GETPOST('complete') == 100 || GETPOST("afaire") == 2) $percent=100;
|
elseif (GETPOST('complete') == 100 || GETPOST("afaire") == 2) $percent=100;
|
||||||
}
|
}
|
||||||
$formactions->form_select_status_action('formaction', $percent, 1, 'complete', 0, 0, 'maxwidth200');
|
$formactions->form_select_status_action('formaction', $percent, 1, 'complete', 0, 0, 'maxwidth200');
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|||||||
@@ -293,7 +293,7 @@ class ActionComm extends CommonObject
|
|||||||
$this->type_id=$cactioncomm->id;
|
$this->type_id=$cactioncomm->id;
|
||||||
$this->type_code=$cactioncomm->code;
|
$this->type_code=$cactioncomm->code;
|
||||||
}
|
}
|
||||||
else if ($result == 0)
|
elseif ($result == 0)
|
||||||
{
|
{
|
||||||
$this->error='Failed to get record with id '.$this->type_id.' code '.$this->type_code.' from dictionary "type of events"';
|
$this->error='Failed to get record with id '.$this->type_id.' code '.$this->type_code.' from dictionary "type of events"';
|
||||||
return -1;
|
return -1;
|
||||||
@@ -566,7 +566,7 @@ class ActionComm extends CommonObject
|
|||||||
* @param string $ref_ext Ref ext to get
|
* @param string $ref_ext Ref ext to get
|
||||||
* @return int <0 if KO, >0 if OK
|
* @return int <0 if KO, >0 if OK
|
||||||
*/
|
*/
|
||||||
function fetch($id, $ref='',$ref_ext='')
|
function fetch($id, $ref = '', $ref_ext = '')
|
||||||
{
|
{
|
||||||
global $langs;
|
global $langs;
|
||||||
|
|
||||||
@@ -761,7 +761,7 @@ class ActionComm extends CommonObject
|
|||||||
* @param int $notrigger 1 = disable triggers, 0 = enable triggers
|
* @param int $notrigger 1 = disable triggers, 0 = enable triggers
|
||||||
* @return int <0 if KO, >0 if OK
|
* @return int <0 if KO, >0 if OK
|
||||||
*/
|
*/
|
||||||
function delete($notrigger=0)
|
function delete($notrigger = 0)
|
||||||
{
|
{
|
||||||
global $user,$langs,$conf;
|
global $user,$langs,$conf;
|
||||||
|
|
||||||
@@ -838,7 +838,7 @@ class ActionComm extends CommonObject
|
|||||||
* @param int $notrigger 1 = disable triggers, 0 = enable triggers
|
* @param int $notrigger 1 = disable triggers, 0 = enable triggers
|
||||||
* @return int <0 if KO, >0 if OK
|
* @return int <0 if KO, >0 if OK
|
||||||
*/
|
*/
|
||||||
function update($user,$notrigger=0)
|
function update($user, $notrigger = 0)
|
||||||
{
|
{
|
||||||
global $langs,$conf,$hookmanager;
|
global $langs,$conf,$hookmanager;
|
||||||
|
|
||||||
@@ -999,7 +999,7 @@ class ActionComm extends CommonObject
|
|||||||
* @param string $limit Limit number of answers
|
* @param string $limit Limit number of answers
|
||||||
* @return array or string Error string if KO, array with actions if OK
|
* @return array or string Error string if KO, array with actions if OK
|
||||||
*/
|
*/
|
||||||
static function getActions($db, $socid=0, $fk_element=0, $elementtype='', $filter='', $sortfield='a.datep', $sortorder='DESC', $limit=0)
|
static function getActions($db, $socid = 0, $fk_element = 0, $elementtype = '', $filter = '', $sortfield = 'a.datep', $sortorder = 'DESC', $limit = 0)
|
||||||
{
|
{
|
||||||
global $conf, $langs;
|
global $conf, $langs;
|
||||||
|
|
||||||
@@ -1051,7 +1051,7 @@ class ActionComm extends CommonObject
|
|||||||
* @param int $load_state_board Charge indicateurs this->nb de tableau de bord
|
* @param int $load_state_board Charge indicateurs this->nb de tableau de bord
|
||||||
* @return WorkboardResponse|int <0 if KO, WorkboardResponse if OK
|
* @return WorkboardResponse|int <0 if KO, WorkboardResponse if OK
|
||||||
*/
|
*/
|
||||||
function load_board($user, $load_state_board=0)
|
function load_board($user, $load_state_board = 0)
|
||||||
{
|
{
|
||||||
// phpcs:enable
|
// phpcs:enable
|
||||||
global $conf, $langs;
|
global $conf, $langs;
|
||||||
@@ -1164,7 +1164,7 @@ class ActionComm extends CommonObject
|
|||||||
* @param int $hidenastatus 1=Show nothing if status is "Not applicable"
|
* @param int $hidenastatus 1=Show nothing if status is "Not applicable"
|
||||||
* @return string String with status
|
* @return string String with status
|
||||||
*/
|
*/
|
||||||
function getLibStatut($mode,$hidenastatus=0)
|
function getLibStatut($mode, $hidenastatus = 0)
|
||||||
{
|
{
|
||||||
return $this->LibStatut($this->percentage,$mode,$hidenastatus,$this->datep);
|
return $this->LibStatut($this->percentage,$mode,$hidenastatus,$this->datep);
|
||||||
}
|
}
|
||||||
@@ -1179,7 +1179,7 @@ class ActionComm extends CommonObject
|
|||||||
* @param int $datestart Date start of event
|
* @param int $datestart Date start of event
|
||||||
* @return string Label
|
* @return string Label
|
||||||
*/
|
*/
|
||||||
function LibStatut($percent,$mode,$hidenastatus=0,$datestart='')
|
function LibStatut($percent, $mode, $hidenastatus = 0, $datestart = '')
|
||||||
{
|
{
|
||||||
// phpcs:enable
|
// phpcs:enable
|
||||||
global $langs;
|
global $langs;
|
||||||
@@ -1257,7 +1257,7 @@ class ActionComm extends CommonObject
|
|||||||
* @param int $save_lastsearch_value -1=Auto, 0=No save of lastsearch_values when clicking, 1=Save lastsearch_values whenclicking
|
* @param int $save_lastsearch_value -1=Auto, 0=No save of lastsearch_values when clicking, 1=Save lastsearch_values whenclicking
|
||||||
* @return string Chaine avec URL
|
* @return string Chaine avec URL
|
||||||
*/
|
*/
|
||||||
function getNomUrl($withpicto=0, $maxlength=0, $classname='', $option='', $overwritepicto=0, $notooltip=0, $save_lastsearch_value=-1)
|
function getNomUrl($withpicto = 0, $maxlength = 0, $classname = '', $option = '', $overwritepicto = 0, $notooltip = 0, $save_lastsearch_value = -1)
|
||||||
{
|
{
|
||||||
global $conf, $langs, $user, $hookmanager, $action;
|
global $conf, $langs, $user, $hookmanager, $action;
|
||||||
|
|
||||||
@@ -1391,7 +1391,7 @@ class ActionComm extends CommonObject
|
|||||||
* @param array $filters Array of filters. Exemple array('notolderthan'=>99, 'year'=>..., 'idfrom'=>..., 'notactiontype'=>'systemauto', 'project'=>123, ...)
|
* @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
|
* @return int <0 if error, nb of events in new file if ok
|
||||||
*/
|
*/
|
||||||
function build_exportfile($format,$type,$cachedelay,$filename,$filters)
|
function build_exportfile($format, $type, $cachedelay, $filename, $filters)
|
||||||
{
|
{
|
||||||
// phpcs:enable
|
// phpcs:enable
|
||||||
global $conf,$langs,$dolibarr_main_url_root,$mysoc;
|
global $conf,$langs,$dolibarr_main_url_root,$mysoc;
|
||||||
|
|||||||
@@ -178,7 +178,7 @@ class ActionCommReminder 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
|
* @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
|
* @return string Label of status
|
||||||
*/
|
*/
|
||||||
function getLibStatut($mode=0)
|
function getLibStatut($mode = 0)
|
||||||
{
|
{
|
||||||
return $this->LibStatut($this->status,$mode);
|
return $this->LibStatut($this->status,$mode);
|
||||||
}
|
}
|
||||||
@@ -191,7 +191,7 @@ 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
|
* @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
|
* @return string Label of status
|
||||||
*/
|
*/
|
||||||
static function LibStatut($status,$mode=0)
|
static function LibStatut($status, $mode = 0)
|
||||||
{
|
{
|
||||||
// phpcs:enable
|
// phpcs:enable
|
||||||
global $langs;
|
global $langs;
|
||||||
|
|||||||
@@ -130,7 +130,7 @@ class CActionComm
|
|||||||
* @param int $shortlabel 1=Get short label instead of long label
|
* @param int $shortlabel 1=Get short label instead of long label
|
||||||
* @return mixed Array of all event types if OK, <0 if KO. Key of array is id or code depending on parameter $idorcode.
|
* @return mixed Array of all event types if OK, <0 if KO. Key of array is id or code depending on parameter $idorcode.
|
||||||
*/
|
*/
|
||||||
function liste_array($active='',$idorcode='id',$excludetype='',$onlyautoornot=0, $morefilter='', $shortlabel=0)
|
function liste_array($active = '', $idorcode = 'id', $excludetype = '', $onlyautoornot = 0, $morefilter = '', $shortlabel = 0)
|
||||||
{
|
{
|
||||||
// phpcs:enable
|
// phpcs:enable
|
||||||
global $langs,$conf;
|
global $langs,$conf;
|
||||||
@@ -223,7 +223,7 @@ class CActionComm
|
|||||||
* @param int $withpicto 0=No picto, 1=Include picto into link, 2=Picto only
|
* @param int $withpicto 0=No picto, 1=Include picto into link, 2=Picto only
|
||||||
* @return string Label of action type
|
* @return string Label of action type
|
||||||
*/
|
*/
|
||||||
function getNomUrl($withpicto=0)
|
function getNomUrl($withpicto = 0)
|
||||||
{
|
{
|
||||||
global $langs;
|
global $langs;
|
||||||
|
|
||||||
|
|||||||
@@ -779,7 +779,7 @@ if (count($listofextcals))
|
|||||||
$datecurstart=dol_stringtotime($icalevent['DTSTART;VALUE=DATE'],1);
|
$datecurstart=dol_stringtotime($icalevent['DTSTART;VALUE=DATE'],1);
|
||||||
$datecurend=dol_stringtotime($icalevent['DTEND;VALUE=DATE'],1)-1; // We remove one second to get last second of day
|
$datecurend=dol_stringtotime($icalevent['DTEND;VALUE=DATE'],1)-1; // We remove one second to get last second of day
|
||||||
}
|
}
|
||||||
else if (is_array($icalevent['DTSTART']) && ! empty($icalevent['DTSTART']['unixtime']))
|
elseif (is_array($icalevent['DTSTART']) && ! empty($icalevent['DTSTART']['unixtime']))
|
||||||
{
|
{
|
||||||
$datecurstart=$icalevent['DTSTART']['unixtime'];
|
$datecurstart=$icalevent['DTSTART']['unixtime'];
|
||||||
$datecurend=$icalevent['DTEND']['unixtime'];
|
$datecurend=$icalevent['DTEND']['unixtime'];
|
||||||
@@ -1277,7 +1277,7 @@ $db->close();
|
|||||||
* @param string $nonew 0=Add "new entry button", 1=No "new entry button", -1=Only "new entry button"
|
* @param string $nonew 0=Add "new entry button", 1=No "new entry button", -1=Only "new entry button"
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventarray, $maxprint=0, $maxnbofchar=16, $newparam='', $showinfo=0, $minheight=60, $nonew=0)
|
function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventarray, $maxprint = 0, $maxnbofchar = 16, $newparam = '', $showinfo = 0, $minheight = 60, $nonew = 0)
|
||||||
{
|
{
|
||||||
global $user, $conf, $langs;
|
global $user, $conf, $langs;
|
||||||
global $action, $filter, $filtert, $status, $actioncode, $usergroup; // Filters used into search form
|
global $action, $filter, $filtert, $status, $actioncode, $usergroup; // Filters used into search form
|
||||||
@@ -1365,7 +1365,7 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa
|
|||||||
// We decide to choose color of owner of event (event->userownerid is user id of owner, event->userassigned contains all users assigned to event)
|
// We decide to choose color of owner of event (event->userownerid is user id of owner, event->userassigned contains all users assigned to event)
|
||||||
if (! empty($cacheusers[$event->userownerid]->color)) $color=$cacheusers[$event->userownerid]->color;
|
if (! empty($cacheusers[$event->userownerid]->color)) $color=$cacheusers[$event->userownerid]->color;
|
||||||
}
|
}
|
||||||
else if ($event->type_code == 'ICALEVENT') // Event come from external ical file
|
elseif ($event->type_code == 'ICALEVENT') // Event come from external ical file
|
||||||
{
|
{
|
||||||
$numical++;
|
$numical++;
|
||||||
if (! empty($event->icalname)) {
|
if (! empty($event->icalname)) {
|
||||||
@@ -1378,7 +1378,7 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa
|
|||||||
$color=($event->icalcolor?$event->icalcolor:-1);
|
$color=($event->icalcolor?$event->icalcolor:-1);
|
||||||
$cssclass=(! empty($event->icalname)?'family_ext'.md5($event->icalname):'family_other');
|
$cssclass=(! empty($event->icalname)?'family_ext'.md5($event->icalname):'family_other');
|
||||||
}
|
}
|
||||||
else if ($event->type_code == 'BIRTHDAY')
|
elseif ($event->type_code == 'BIRTHDAY')
|
||||||
{
|
{
|
||||||
$numbirthday++; $colorindex=2; $cssclass='family_birthday unmovable'; $color=sprintf("%02x%02x%02x",$theme_datacolor[$colorindex][0],$theme_datacolor[$colorindex][1],$theme_datacolor[$colorindex][2]);
|
$numbirthday++; $colorindex=2; $cssclass='family_birthday unmovable'; $color=sprintf("%02x%02x%02x",$theme_datacolor[$colorindex][0],$theme_datacolor[$colorindex][1],$theme_datacolor[$colorindex][2]);
|
||||||
}
|
}
|
||||||
@@ -1425,11 +1425,11 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa
|
|||||||
{
|
{
|
||||||
$cssclass.= " unmovable";
|
$cssclass.= " unmovable";
|
||||||
}
|
}
|
||||||
else if ($event->type_code == 'ICALEVENT')
|
elseif ($event->type_code == 'ICALEVENT')
|
||||||
{
|
{
|
||||||
$cssclass.= " unmovable";
|
$cssclass.= " unmovable";
|
||||||
}
|
}
|
||||||
else if ($event->date_end_in_calendar && date('Ymd',$event->date_start_in_calendar) != date('Ymd',$event->date_end_in_calendar))
|
elseif ($event->date_end_in_calendar && date('Ymd',$event->date_start_in_calendar) != date('Ymd',$event->date_end_in_calendar))
|
||||||
{
|
{
|
||||||
$tmpyearend = date('Y',$event->date_end_in_calendar);
|
$tmpyearend = date('Y',$event->date_end_in_calendar);
|
||||||
$tmpmonthend = date('m',$event->date_end_in_calendar);
|
$tmpmonthend = date('m',$event->date_end_in_calendar);
|
||||||
|
|||||||
@@ -757,7 +757,7 @@ $db->close();
|
|||||||
* @param bool $var true or false for alternat style on tr/td
|
* @param bool $var true or false for alternat style on tr/td
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
function show_day_events_pertype($username, $day, $month, $year, $monthshown, $style, &$eventarray, $maxprint=0, $maxnbofchar=16, $newparam='', $showinfo=0, $minheight=60, $showheader=false, $colorsbytype=array(), $var=false)
|
function show_day_events_pertype($username, $day, $month, $year, $monthshown, $style, &$eventarray, $maxprint = 0, $maxnbofchar = 16, $newparam = '', $showinfo = 0, $minheight = 60, $showheader = false, $colorsbytype = array(), $var = false)
|
||||||
{
|
{
|
||||||
global $db;
|
global $db;
|
||||||
global $user, $conf, $langs, $hookmanager, $action;
|
global $user, $conf, $langs, $hookmanager, $action;
|
||||||
@@ -809,7 +809,7 @@ function show_day_events_pertype($username, $day, $month, $year, $monthshown, $s
|
|||||||
$nummytasks++; $cssclass='family_mytasks';
|
$nummytasks++; $cssclass='family_mytasks';
|
||||||
if (! empty($conf->global->AGENDA_USE_EVENT_TYPE)) $color=$event->type_color;
|
if (! empty($conf->global->AGENDA_USE_EVENT_TYPE)) $color=$event->type_color;
|
||||||
}
|
}
|
||||||
else if ($event->type_code == 'ICALEVENT')
|
elseif ($event->type_code == 'ICALEVENT')
|
||||||
{
|
{
|
||||||
$numical++;
|
$numical++;
|
||||||
if (! empty($event->icalname))
|
if (! empty($event->icalname))
|
||||||
@@ -823,7 +823,7 @@ function show_day_events_pertype($username, $day, $month, $year, $monthshown, $s
|
|||||||
$color=$event->icalcolor;
|
$color=$event->icalcolor;
|
||||||
$cssclass=(! empty($event->icalname)?'family_ext'.md5($event->icalname):'family_other unsortable');
|
$cssclass=(! empty($event->icalname)?'family_ext'.md5($event->icalname):'family_other unsortable');
|
||||||
}
|
}
|
||||||
else if ($event->type_code == 'BIRTHDAY')
|
elseif ($event->type_code == 'BIRTHDAY')
|
||||||
{
|
{
|
||||||
$numbirthday++; $colorindex=2; $cssclass='family_birthday unsortable'; $color=sprintf("%02x%02x%02x",$theme_datacolor[$colorindex][0],$theme_datacolor[$colorindex][1],$theme_datacolor[$colorindex][2]);
|
$numbirthday++; $colorindex=2; $cssclass='family_birthday unsortable'; $color=sprintf("%02x%02x%02x",$theme_datacolor[$colorindex][0],$theme_datacolor[$colorindex][1],$theme_datacolor[$colorindex][2]);
|
||||||
}
|
}
|
||||||
@@ -1026,7 +1026,7 @@ function show_day_events_pertype($username, $day, $month, $year, $monthshown, $s
|
|||||||
if ($output[0]['string']) $title1.=($title1?' - ':'').$output[0]['string'];
|
if ($output[0]['string']) $title1.=($title1?' - ':'').$output[0]['string'];
|
||||||
if ($output[0]['color']) $color1 = $output[0]['color'];
|
if ($output[0]['color']) $color1 = $output[0]['color'];
|
||||||
}
|
}
|
||||||
else if (count($cases1[$h]) > 1)
|
elseif (count($cases1[$h]) > 1)
|
||||||
{
|
{
|
||||||
$title1=$langs->trans("Ref").' '.$ids1.($title1?' - '.$title1:'');
|
$title1=$langs->trans("Ref").' '.$ids1.($title1?' - '.$title1:'');
|
||||||
$color1='222222';
|
$color1='222222';
|
||||||
@@ -1039,7 +1039,7 @@ function show_day_events_pertype($username, $day, $month, $year, $monthshown, $s
|
|||||||
if ($output[0]['string']) $title2.=($title2?' - ':'').$output[0]['string'];
|
if ($output[0]['string']) $title2.=($title2?' - ':'').$output[0]['string'];
|
||||||
if ($output[0]['color']) $color2 = $output[0]['color'];
|
if ($output[0]['color']) $color2 = $output[0]['color'];
|
||||||
}
|
}
|
||||||
else if (count($cases2[$h]) > 1)
|
elseif (count($cases2[$h]) > 1)
|
||||||
{
|
{
|
||||||
$title2=$langs->trans("Ref").' '.$ids2.($title2?' - '.$title2:'');
|
$title2=$langs->trans("Ref").' '.$ids2.($title2?' - '.$title2:'');
|
||||||
$color2='222222';
|
$color2='222222';
|
||||||
|
|||||||
@@ -905,7 +905,7 @@ $db->close();
|
|||||||
* @param bool $var true or false for alternat style on tr/td
|
* @param bool $var true or false for alternat style on tr/td
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
function show_day_events2($username, $day, $month, $year, $monthshown, $style, &$eventarray, $maxprint=0, $maxnbofchar=16, $newparam='', $showinfo=0, $minheight=60, $showheader=false, $colorsbytype=array(), $var=false)
|
function show_day_events2($username, $day, $month, $year, $monthshown, $style, &$eventarray, $maxprint = 0, $maxnbofchar = 16, $newparam = '', $showinfo = 0, $minheight = 60, $showheader = false, $colorsbytype = array(), $var = false)
|
||||||
{
|
{
|
||||||
global $db;
|
global $db;
|
||||||
global $user, $conf, $langs, $hookmanager, $action;
|
global $user, $conf, $langs, $hookmanager, $action;
|
||||||
@@ -970,7 +970,7 @@ function show_day_events2($username, $day, $month, $year, $monthshown, $style, &
|
|||||||
|
|
||||||
if (! empty($conf->global->AGENDA_USE_COLOR_PER_EVENT_TYPE)) $color=$event->type_color;
|
if (! empty($conf->global->AGENDA_USE_COLOR_PER_EVENT_TYPE)) $color=$event->type_color;
|
||||||
}
|
}
|
||||||
else if ($event->type_code == 'ICALEVENT')
|
elseif ($event->type_code == 'ICALEVENT')
|
||||||
{
|
{
|
||||||
$numical++;
|
$numical++;
|
||||||
if (! empty($event->icalname))
|
if (! empty($event->icalname))
|
||||||
@@ -984,7 +984,7 @@ function show_day_events2($username, $day, $month, $year, $monthshown, $style, &
|
|||||||
$color=$event->icalcolor;
|
$color=$event->icalcolor;
|
||||||
$cssclass=(! empty($event->icalname)?'family_ext'.md5($event->icalname):'family_other unsortable');
|
$cssclass=(! empty($event->icalname)?'family_ext'.md5($event->icalname):'family_other unsortable');
|
||||||
}
|
}
|
||||||
else if ($event->type_code == 'BIRTHDAY')
|
elseif ($event->type_code == 'BIRTHDAY')
|
||||||
{
|
{
|
||||||
$numbirthday++; $colorindex=2; $cssclass='family_birthday unsortable'; $color=sprintf("%02x%02x%02x",$theme_datacolor[$colorindex][0],$theme_datacolor[$colorindex][1],$theme_datacolor[$colorindex][2]);
|
$numbirthday++; $colorindex=2; $cssclass='family_birthday unsortable'; $color=sprintf("%02x%02x%02x",$theme_datacolor[$colorindex][0],$theme_datacolor[$colorindex][1],$theme_datacolor[$colorindex][2]);
|
||||||
}
|
}
|
||||||
@@ -1201,7 +1201,7 @@ function show_day_events2($username, $day, $month, $year, $monthshown, $style, &
|
|||||||
if ($output[0]['string']) $title1.=($title1?' - ':'').$output[0]['string'];
|
if ($output[0]['string']) $title1.=($title1?' - ':'').$output[0]['string'];
|
||||||
if ($output[0]['color']) $color1 = $output[0]['color'];
|
if ($output[0]['color']) $color1 = $output[0]['color'];
|
||||||
}
|
}
|
||||||
else if (count($cases1[$h]) > 1)
|
elseif (count($cases1[$h]) > 1)
|
||||||
{
|
{
|
||||||
$title1=$langs->trans("Ref").' '.$ids1.($title1?' - '.$title1:'');
|
$title1=$langs->trans("Ref").' '.$ids1.($title1?' - '.$title1:'');
|
||||||
$color1='222222';
|
$color1='222222';
|
||||||
@@ -1214,7 +1214,7 @@ function show_day_events2($username, $day, $month, $year, $monthshown, $style, &
|
|||||||
if ($output[0]['string']) $title2.=($title2?' - ':'').$output[0]['string'];
|
if ($output[0]['string']) $title2.=($title2?' - ':'').$output[0]['string'];
|
||||||
if ($output[0]['color']) $color2 = $output[0]['color'];
|
if ($output[0]['color']) $color2 = $output[0]['color'];
|
||||||
}
|
}
|
||||||
else if (count($cases2[$h]) > 1)
|
elseif (count($cases2[$h]) > 1)
|
||||||
{
|
{
|
||||||
$title2=$langs->trans("Ref").' '.$ids2.($title2?' - '.$title2:'');
|
$title2=$langs->trans("Ref").' '.$ids2.($title2?' - '.$title2:'');
|
||||||
$color2='222222';
|
$color2='222222';
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user