Merge remote branch 'upstream/develop' into selectbank

Conflicts:
	htdocs/install/mysql/migration/3.6.0-3.7.0.sql
This commit is contained in:
frederic34 2014-07-08 22:46:38 +02:00
commit c8e6387e52
82 changed files with 2822 additions and 1178 deletions

View File

@ -87,6 +87,7 @@ before_script:
script: script:
- cd htdocs/install - cd htdocs/install
- date
- php upgrade.php 3.4.0 3.5.0 > upgrade.log - php upgrade.php 3.4.0 3.5.0 > upgrade.log
- php upgrade2.php 3.4.0 3.5.0 > upgrade2.log - php upgrade2.php 3.4.0 3.5.0 > upgrade2.log
- php upgrade.php 3.5.0 3.6.0 >> upgrade.log - php upgrade.php 3.5.0 3.6.0 >> upgrade.log
@ -96,13 +97,12 @@ script:
# - cat upgrade.log # - cat upgrade.log
# - cat upgrade2.log # - cat upgrade2.log
- cd ../.. - cd ../..
# - phpunit -d memory_limit=-1 --configuration test/phpunit/phpunittest.xml --coverage-text test/phpunit/AllTests.php - date
# - phpunit -d memory_limit=-1 --configuration test/phpunit/phpunittest.xml --coverage-text test/phpunit/BuildDocTest.php
# - phpunit -d memory_limit=-1 --configuration test/phpunit/phpunittest.xml test/phpunit/WebservicesOtherTest.php
# - phpcs -p --warning-severity=0 -s --report-checkstyle --report-summary --standard=dev/codesniffer/ruleset.xml --tab-width=4 --ignore=/build/html/,/documents/,/includes/,/test/report/ htdocs/core/class/dolgraph.class.php
- phpcs -p --warning-severity=0 -s --report-checkstyle --report-summary --standard=dev/codesniffer/ruleset.xml --tab-width=4 --ignore=/build/html/,/documents/,/includes/,/test/report/ .
# - phpcs -p --warning-severity=0 -s --report-summary --standard=dev/codesniffer/ruleset.xml --tab-width=4 --ignore=/build/html/,/documents/,/includes/,/test/report/ .
- phpunit -d memory_limit=-1 --configuration test/phpunit/phpunittest.xml test/phpunit/AllTests.php - phpunit -d memory_limit=-1 --configuration test/phpunit/phpunittest.xml test/phpunit/AllTests.php
- date
# - phpcs -p --warning-severity=0 -s --report-summary --standard=dev/codesniffer/ruleset.xml --tab-width=4 --ignore=/build/html/,/dev/vagrant/,/documents/,/includes/,/test/report/ htdocs/core/class/dolgraph.class.php 2>&1
- phpcs -p --warning-severity=0 -s --report-checkstyle --report-summary --standard=dev/codesniffer/ruleset.xml --tab-width=4 --ignore=/build/html/,/dev/vagrant/,/documents/,/includes/,/test/report/ . 2>&1
- date
after_script: after_script:
# - echo Output dolibarr log file; cat $(pwd)/htdocs/documents/dolibarr.log # - echo Output dolibarr log file; cat $(pwd)/htdocs/documents/dolibarr.log

View File

@ -13,6 +13,10 @@ For users:
permissions are ok (save one click per photo to add). permissions are ok (save one click per photo to add).
- New: Add option PRODUCT_MAX_VISIBLE_PHOTO to limit number of photos - New: Add option PRODUCT_MAX_VISIBLE_PHOTO to limit number of photos
shown on main product card. shown on main product card.
- New: Add event FICHINTER_CLASSIFY_BILLED into list of possible events to
create an automatic event into agenda.
- New: Add new type of event (when type of events are used, not by
default)
- Fix: [ bug #1487 ] PAYMENT_DELETE trigger does not intercept trigger action - Fix: [ bug #1487 ] PAYMENT_DELETE trigger does not intercept trigger action
- Fix: [ bug #1470, #1472, #1473] User trigger problem - Fix: [ bug #1470, #1472, #1473] User trigger problem
- Fix: [ bug #1489, #1491 ] Intervention trigger problem - Fix: [ bug #1489, #1491 ] Intervention trigger problem
@ -29,6 +33,7 @@ For translators:
For developers: For developers:
- New: Add hook "searchAgendaFrom". - New: Add hook "searchAgendaFrom".
- New: Add trigger DON_UPDATE, DON_DELETE - New: Add trigger DON_UPDATE, DON_DELETE
- Qual: Removed hard coded rowid into data init of table llx_c_action_trigger.
WARNING: Following change may create regression for some external modules, but was necessary to make WARNING: Following change may create regression for some external modules, but was necessary to make
Dolibarr better: Dolibarr better:

View File

@ -18,6 +18,9 @@
<severity>0</severity> <severity>0</severity>
</rule> </rule>
<!-- The closing ?> tag MUST be omitted from files containing only PHP. -->
<!-- <rule ref="Zend.Files.ClosingTag"/> -->
<!-- <rule ref="Generic.CodeAnalysis.ForLoopShouldBeWhileLoop" /> --> <!-- <rule ref="Generic.CodeAnalysis.ForLoopShouldBeWhileLoop" /> -->
<rule ref="Generic.CodeAnalysis.ForLoopWithTestFunctionCall" /> <rule ref="Generic.CodeAnalysis.ForLoopWithTestFunctionCall" />
@ -46,6 +49,9 @@
</rule> </rule>
--> -->
<!-- PHP code MUST use only UTF-8 without BOM. -->
<rule ref="Generic.Files.ByteOrderMark"/>
<!-- Lines can be 85 chars long, but never show errors --> <!-- Lines can be 85 chars long, but never show errors -->
<rule ref="Generic.Files.LineLength"> <rule ref="Generic.Files.LineLength">
<properties> <properties>

View File

@ -173,7 +173,7 @@ class modMyModule extends DolibarrModules
// Add here list of permission defined by an id, a label, a boolean and two constant strings. // Add here list of permission defined by an id, a label, a boolean and two constant strings.
// Example: // Example:
// $this->rights[$r][0] = 2000; // Permission id (must not be already used) // $this->rights[$r][0] = $this->numero + $r; // Permission id (must not be already used)
// $this->rights[$r][1] = 'Permision label'; // Permission label // $this->rights[$r][1] = 'Permision label'; // Permission label
// $this->rights[$r][3] = 1; // Permission by default for new user (0/1) // $this->rights[$r][3] = 1; // Permission by default for new user (0/1)
// $this->rights[$r][4] = 'level1'; // In php code, permission will be checked by test if ($user->rights->permkey->level1->level2) // $this->rights[$r][4] = 'level1'; // In php code, permission will be checked by test if ($user->rights->permkey->level1->level2)

View File

@ -1,5 +1,5 @@
<?php <?php
/* Copyright (C) 2008-2010 Laurent Destailleur <eldy@users.sourceforge.net> /* Copyright (C) 2008-2014 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2011 Regis Houssin <regis.houssin@capnetworks.com> * Copyright (C) 2011 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2011-2012 Juanjo Menent <jmenent@2byte.es> * Copyright (C) 2011-2012 Juanjo Menent <jmenent@2byte.es>
* *
@ -36,11 +36,11 @@ $langs->load("other");
$action = GETPOST('action','alpha'); $action = GETPOST('action','alpha');
$cancel = GETPOST('cancel','alpha'); $cancel = GETPOST('cancel','alpha');
// Get list of triggers available // Get list of triggers available
$sql = "SELECT a.rowid, a.code, a.label, a.elementtype"; $sql = "SELECT a.rowid, a.code, a.label, a.elementtype";
$sql.= " FROM ".MAIN_DB_PREFIX."c_action_trigger as a"; $sql.= " FROM ".MAIN_DB_PREFIX."c_action_trigger as a";
$sql.= " ORDER BY a.rang ASC"; $sql.= " ORDER BY a.rang ASC";
$resql=$db->query($sql); $resql=$db->query($sql);
if ($resql) if ($resql)
{ {
@ -67,6 +67,7 @@ else
/* /*
* Actions * Actions
*/ */
if ($action == "save" && empty($cancel)) if ($action == "save" && empty($cancel))
{ {
$i=0; $i=0;
@ -153,6 +154,7 @@ print '<tr class="liste_titre">';
print '<td colspan="2">'.$langs->trans("ActionsEvents").'</td>'; print '<td colspan="2">'.$langs->trans("ActionsEvents").'</td>';
print '<td><a href="'.$_SERVER["PHP_SELF"].'?action=selectall">'.$langs->trans("All").'</a>/<a href="'.$_SERVER["PHP_SELF"].'?action=selectnone">'.$langs->trans("None").'</a>'; print '<td><a href="'.$_SERVER["PHP_SELF"].'?action=selectall">'.$langs->trans("All").'</a>/<a href="'.$_SERVER["PHP_SELF"].'?action=selectnone">'.$langs->trans("None").'</a>';
print '</tr>'."\n"; print '</tr>'."\n";
// Show each trigger
if (! empty($triggers)) if (! empty($triggers))
{ {
foreach ($triggers as $trigger) foreach ($triggers as $trigger)
@ -165,6 +167,9 @@ if (! empty($triggers))
//print 'module='.$module.'<br>'; //print 'module='.$module.'<br>';
if (! empty($conf->$module->enabled)) if (! empty($conf->$module->enabled))
{ {
// Discard special case.
if ($trigger['code'] == 'FICHINTER_CLASSIFY_BILLED' && empty($conf->global->FICHINTER_CLASSIFY_BILLED)) continue;
$var=!$var; $var=!$var;
print '<tr '.$bc[$var].'>'; print '<tr '.$bc[$var].'>';
print '<td>'.$trigger['code'].'</td>'; print '<td>'.$trigger['code'].'</td>';

View File

@ -534,4 +534,3 @@ print '<br>';
llxFooter(); llxFooter();
$db->close(); $db->close();
?>

136
htdocs/admin/fiscalyear.php Normal file
View File

@ -0,0 +1,136 @@
<?php
/* Copyright (C) 2013-2014 Alexandre Spangaro <alexandre.spangaro@gmail.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/**
* \file htdocs/admin/fiscalyear.php
* \ingroup fiscal year
* \brief Setup page to configure fiscal year
*/
require '../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/fiscalyear.class.php';
$action=GETPOST('action');
$langs->load("admin");
$langs->load("compta");
if (! $user->admin) accessforbidden();
$error=0;
// List of statut
static $tmpstatut2label=array(
'0'=>'OpenFiscalYear',
'1'=>'CloseFiscalYear'
);
$statut2label=array('');
foreach ($tmpstatut2label as $key => $val) $statut2label[$key]=$langs->trans($val);
$mesg='';
$errors=array();
$object = new Fiscalyear($db);
/*
* Actions
*/
/*
* View
*/
$form = new Form($db);
llxHeader('',$title);
$title = $langs->trans('FiscalYears');
print_fiche_titre($langs->trans('FiscalYears'));
dol_htmloutput_errors($mesg);
$sql = "SELECT f.rowid, f.label, f.date_start, f.date_end, f.statut, f.entity";
$sql.= " FROM ".MAIN_DB_PREFIX."accounting_fiscalyear as f";
$sql.= " WHERE f.entity = ".$conf->entity;
$result = $db->query($sql);
$max=10;
if ($result)
{
$var=false;
$num = $db->num_rows($result);
$i = 0;
// Load attribute_label
print '<table class="noborder" width="100%">';
print '<tr class="liste_titre">';
print '<td>'.$langs->trans("Ref").'</td>';
print '<td>'.$langs->trans("Label").'</td>';
print '<td>'.$langs->trans("DateStart").'</td>';
print '<td>'.$langs->trans("DateEnd").'</td>';
print '<td>'.$langs->trans("Statut").'</td>';
print '</tr>';
if ($num)
{
$fiscalyearstatic=new Fiscalyear($db);
while ($i < $num && $i < $max)
{
$obj = $db->fetch_object($result);
$fiscalyearstatic->ref=$obj->rowid;
$fiscalyearstatic->id=$obj->rowid;
print '<tr '.$bc[$var].'>';
print '<td><a href="fiscalyear_card.php?id='.$obj->rowid.'">'.img_object($langs->trans("ShowFiscalYear"),"technic").' '.$obj->rowid.'</a></td>';
print '<td align="left">'.$obj->label.'</td>';
print '<td align="left">'.dol_print_date($db->jdate($obj->date_start),'day').'</td>';
print '<td align="left">'.dol_print_date($db->jdate($obj->date_end),'day').'</td>';
print '<td>'.$fiscalyearstatic->LibStatut($obj->statut,5).'</td>';
print '</tr>';
$var=!$var;
$i++;
}
}
else
{
print '<tr '.$bc[$var].'><td colspan="5">'.$langs->trans("None").'</td></tr>';
}
print '</table>';
print '</form>';
}
else
{
dol_print_error($db);
}
dol_fiche_end();
// Buttons
print '<div class="tabsAction">';
print '<a class="butAction" href="fiscalyear_card.php?action=create">'.$langs->trans("NewFiscalYear").'</a>';
print '</div>';
llxFooter();
$db->close();

View File

@ -0,0 +1,333 @@
<?php
/* Copyright (C) 2014 Alexandre Spangaro <alexandre.spangaro@gmail.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/**
* \file htdocs/admin/fiscalyear_card.php
* \brief Page to show a fiscal year
*/
require '../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/fiscalyear.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/fiscalyear.class.php';
$langs->load("admin");
$langs->load("compta");
// Security check
if (! $user->admin) accessforbidden();
$error=0;
$action = GETPOST('action','alpha');
$confirm = GETPOST('confirm','alpha');
$id = GETPOST('id','int');
// List of statut
static $tmpstatut2label=array(
'0'=>'OpenFiscalYear',
'1'=>'CloseFiscalYear'
);
$statut2label=array('');
foreach ($tmpstatut2label as $key => $val) $statut2label[$key]=$langs->trans($val);
$mesg = '';
$object = new Fiscalyear($db);
$date_start=dol_mktime(0,0,0,GETPOST('fiscalyearmonth','int'),GETPOST('fiscalyearday','int'),GETPOST('fiscalyearyear','int'));
$date_end=dol_mktime(0,0,0,GETPOST('fiscalyearendmonth','int'),GETPOST('fiscalyearendday','int'),GETPOST('fiscalyearendyear','int'));
/*
* Actions
*/
if ($action == 'confirm_delete' && $confirm == "yes")
{
$result=$object->delete($id);
if ($result >= 0)
{
header("Location: fiscalyear.php");
exit;
}
else
{
$mesg=$object->error;
}
}
else if ($action == 'add')
{
if (! GETPOST('cancel','alpha'))
{
$error=0;
$db->begin();
$object->date_start = $date_start;
$object->date_end = $date_end;
$object->label = GETPOST('label','alpha');
$object->statut = GETPOST('statut','int');
$object->datec = dol_now();
if (empty($object->date_start) && empty($object->date_end))
{
$mesg.=$langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("Date"));
$error++;
}
if (empty($object->label))
{
$mesg='<div class="error">'.$langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("Label")).'</div>';
$error++;
}
if (! $error)
{
$id = $object->create($user);
if ($id > 0)
{
header("Location: " . $_SERVER["PHP_SELF"] . "?id=" . $id);
exit;
}
else
{
$mesg=$object->error;
$action='create';
}
}
else
{
$action='create';
}
}
else
{
header("Location: ./fiscalyear.php");
exit;
}
}
// Update record
else if ($action == 'update')
{
if (! GETPOST('cancel','alpha'))
{
$result = $object->fetch($id);
$object->date_start = empty($_POST["fiscalyear"])?'':$date_start;
$object->date_end = empty($_POST["fiscalyearend"])?'':$date_end;
$object->label = GETPOST('label','alpha');
$object->statut = GETPOST('statut','int');
$result = $object->update($user);
if ($result > 0)
{
header("Location: " . $_SERVER["PHP_SELF"] . "?id=" . $id);
exit;
}
else
{
$mesg=$object->error;
}
}
else
{
header("Location: " . $_SERVER["PHP_SELF"] . "?id=" . $id);
exit;
}
}
/*
* View
*/
llxHeader();
$form = new Form($db);
/*
* Action create
*/
if ($action == 'create')
{
print_fiche_titre($langs->trans("NewFiscalYear"));
dol_htmloutput_errors($mesg);
print '<form action="'.$_SERVER["PHP_SELF"].'" method="POST">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<input type="hidden" name="action" value="add">';
print '<table class="border" width="100%">';
// Label
print '<tr><td class="fieldrequired">'.$langs->trans("Label").'</td><td><input name="label" size="32" value="' . GETPOST("label") . '"></td></tr>';
// Date start
print '<tr><td class="fieldrequired">'.$langs->trans("DateStart").'</td><td>';
print $form->select_date(($date_start?$date_start:''),'fiscalyear');
print '</td></tr>';
// Date end
print '<tr><td class="fieldrequired">'.$langs->trans("DateEnd").'</td><td>';
print $form->select_date(($date_end?$date_end:-1),'fiscalyearend');
print '</td></tr>';
// Statut
print '<tr>';
print '<td class="fieldrequired">'.$langs->trans("Statut").'</td>';
print '<td class="valeur">';
print $form->selectarray('statut',$statut2label,GETPOST('statut'));
print '</td></tr>';
print '</table>';
print '<br><center><input class="button" type="submit" value="'.$langs->trans("Save").'"> &nbsp; &nbsp; ';
print '<input class="button" type="submit" name="cancel" value="'.$langs->trans("Cancel").'"></center';
print '</form>';
}
else if ($id)
{
$result = $object->fetch($id);
if ($result > 0)
{
dol_htmloutput_mesg($mesg);
$head = fiscalyear_prepare_head($object);
dol_fiche_head($head, 'card', $langs->trans("FiscalYearCard"), 0, 'cron');
if ($action == 'edit')
{
print '<form name="update" action="' . $_SERVER["PHP_SELF"] . '" method="POST">' . "\n";
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<input type="hidden" name="action" value="update">';
print '<input type="hidden" name="id" value="'.$id.'">';
print '<table class="border" width="100%">';
// Ref
print "<tr>";
print '<td width="20%">'.$langs->trans("Ref").'</td><td>';
print $object->ref;
print '</td></tr>';
// Label
print '<tr><td class="fieldrequired">'.$langs->trans("Label").'</td><td>';
print '<input name="label" class="flat" size="32" value="'.$object->label.'">';
print '</td></tr>';
// Date start
print '<tr><td class="fieldrequired">'.$langs->trans("DateStart").'</td><td>';
print $form->select_date($object->date_start?$object->date_start:-1,'fiscalyear');
print '</td></tr>';
// Date end
print '<tr><td class="fieldrequired">'.$langs->trans("DateEnd").'</td><td>';
print $form->select_date($object->date_end?$object->date_end:-1,'fiscalyearend');
print '</td></tr>';
// Statut
print '<tr><td>'.$langs->trans("Statut").'</td><td>';
print $form->selectarray('statut',$statut2label,$object->statut);
print '</td></tr>';
print '</table>';
print '<br><center><input type="submit" class="button" value="'.$langs->trans("Save").'"> &nbsp; ';
print '<input type="submit" name="cancel" class="button" value="'.$langs->trans("Cancel").'">';
print '</center>';
print '</form>';
print '</div>';
}
else
{
/*
* Confirm delete
*/
if ($action == 'delete')
{
print $form->formconfirm($_SERVER["PHP_SELF"]."?id=".$id,$langs->trans("DeleteFiscalYear"),$langs->trans("ConfirmDeleteFiscalYear"),"confirm_delete");
}
print '<table class="border" width="100%">';
$linkback = '<a href="'.DOL_URL_ROOT.'/admin/fiscalyear.php">'.$langs->trans("BackToList").'</a>';
// Ref
print '<tr><td width="25%">'.$langs->trans("Ref").'</td><td width="50%">';
print $object->ref;
print '</td><td width="25%">';
print $linkback;
print '</td></tr>';
// Label
print '<tr><td valign="top">';
print $form->editfieldkey("Label",'label',$object->label,$object,$conf->global->MAIN_EDIT_ALSO_INLINE,'alpha:32');
print '</td><td colspan="2">';
print $form->editfieldval("Label",'label',$object->label,$object,$conf->global->MAIN_EDIT_ALSO_INLINE,'alpha:32');
print "</td></tr>";
// Date start
print '<tr><td>';
print $form->editfieldkey("Date",'date_start',$object->date_start,$object,$conf->global->MAIN_EDIT_ALSO_INLINE,'datepicker');
print '</td><td colspan="2">';
print $form->editfieldval("Date",'date_start',$object->date_start,$object,$conf->global->MAIN_EDIT_ALSO_INLINE,'datepicker');
print '</td></tr>';
// Date end
print '<tr><td>';
print $form->editfieldkey("Date",'date_end',$object->date_end,$object,$conf->global->MAIN_EDIT_ALSO_INLINE,'datepicker');
print '</td><td colspan="2">';
print $form->editfieldval("Date",'date_end',$object->date_end,$object,$conf->global->MAIN_EDIT_ALSO_INLINE,'datepicker');
print '</td></tr>';
// Statut
print '<tr><td>'.$langs->trans("Status").'</td><td colspan="2">'.$object->getLibStatut(4).'</td></tr>';
print "</table><br>";
print '</div>';
/*
* Barre d'actions
*/
print '<div class="tabsAction">';
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?action=edit&id='.$id.'">'.$langs->trans('Modify').'</a>';
print '<a class="butActionDelete" href="'.$_SERVER["PHP_SELF"].'?action=delete&id='.$id.'">'.$langs->trans('Delete').'</a>';
print '</div>';
}
}
else
{
dol_print_error($db);
}
}
llxFooter();
$db->close();

View File

@ -0,0 +1,60 @@
<?php
/* Copyright (C) 2014 Alexandre Spangaro <alexandre.spangaro@gmail.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, seehttp://www.gnu.org/licenses/>.
*/
/**
* \file htdocs/admin/fiscalyear_card.php
* \brief Page to show info of a fiscal year
*/
require '../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/fiscalyear.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/fiscalyear.class.php';
$langs->load("admin");
$langs->load("compta");
// Security check
if (! $user->admin) accessforbidden();
$id = GETPOST('id','int');
// View
llxHeader();
if ($id)
{
$object = new Fiscalyear($db);
$object->fetch($id);
$object->info($id);
$head = fiscalyear_prepare_head($object);
dol_fiche_head($head, 'info', $langs->trans("FiscalYearCard"), 0, 'cron');
print '<table width="100%"><tr><td>';
dol_print_object_info($object);
print '</td></tr></table>';
print '</div>';
}
$db->close();
llxFooter();

View File

@ -143,4 +143,3 @@ print '</table>';
llxFooter(); llxFooter();
$db->close(); $db->close();
?>

View File

@ -329,7 +329,6 @@ if ($virtualdiffersfromphysical)
print '</table>'; print '</table>';
} }
$db->close();
llxFooter(); llxFooter();
?>
$db->close();

View File

@ -124,4 +124,5 @@ else
} }
llxFooter(); llxFooter();
?>
$db->close();

View File

@ -129,5 +129,5 @@ else
} }
llxFooter(); llxFooter();
$db->close(); $db->close();
?>

View File

@ -379,4 +379,3 @@ print '</table>';
llxFooter(); llxFooter();
$db->close(); $db->close();
?>

View File

@ -119,4 +119,3 @@ llxFooter();
$db->close(); $db->close();
?>

View File

@ -350,4 +350,3 @@ print "<br><br>";
llxFooter(); llxFooter();
$db->close(); $db->close();
?>

View File

@ -165,5 +165,5 @@ if (preg_match('/^confirm/i',$choice))
llxFooter(); llxFooter();
$db->close(); $db->close();
?>

View File

@ -173,5 +173,5 @@ if (! empty($result['return']))
} }
llxFooter(); llxFooter();
$db->close(); $db->close();
?>

View File

@ -69,4 +69,3 @@ print $langs->trans("SeeAlso").': <a href="'.$urlwikitranslatordoc.'" target="_b
llxFooter(); llxFooter();
$db->close(); $db->close();
?>

View File

@ -146,4 +146,3 @@ print '</table>';
llxFooter(); llxFooter();
$db->close(); $db->close();
?>

View File

@ -76,4 +76,3 @@ include_once 'affPied.php';
print '</div></div></div>'."\n"; print '</div></div></div>'."\n";
print '</body></html>'."\n"; print '</body></html>'."\n";
?>

View File

@ -191,5 +191,3 @@ $obj_facturation->paiementLe('RESET');
// Affichage des templates // Affichage des templates
require ('tpl/facturation1.tpl.php'); require ('tpl/facturation1.tpl.php');
?>

View File

@ -50,4 +50,3 @@ function genkeypad($keypadname, $formname)
$sz.='</div>'; $sz.='</div>';
return $sz; return $sz;
} }
?>

View File

@ -78,4 +78,3 @@ if (!empty($_SESSION["CASHDESK_ID_WAREHOUSE"]) && ! empty($conf->stock->enabled)
} }
print '</li></ul>'; print '</li></ul>';
print '</div>'; print '</div>';
?>

View File

@ -154,3 +154,4 @@ echo '<tr><th class="nowrap">'.$langs->trans("TotalTTC").'</th><td class="nowrap
onclick="javascript: window.close(); return(false);"><?php echo $langs->trans("Close"); ?></a> onclick="javascript: window.close(); return(false);"><?php echo $langs->trans("Close"); ?></a>
</body> </body>
</html>

View File

@ -219,14 +219,14 @@ class Categorie extends CommonObject
// End call triggers // End call triggers
if ( ! $error ) if ( ! $error )
{
$this->db->rollback();
return -3;
}
else
{ {
$this->db->commit(); $this->db->commit();
return $id; return $id;
}
else
{
$this->db->rollback();
return -3;
} }
} }
else else

View File

@ -519,5 +519,5 @@ if($object->type == 4)
llxFooter(); llxFooter();
$db->close(); $db->close();
?>

View File

@ -1054,4 +1054,3 @@ class ActionComm extends CommonObject
} }
?>

View File

@ -930,5 +930,5 @@ dol_htmloutput_mesg('',$mesgs);
// End of page // End of page
llxFooter(); llxFooter();
$db->close(); $db->close();
?>

View File

@ -185,7 +185,7 @@ else
dol_print_error($db); dol_print_error($db);
} }
llxFooter();
$db->close(); $db->close();
llxFooter();
?>

View File

@ -420,4 +420,3 @@ elseif (file_exists($fileimagebis))
$db->close(); $db->close();
llxFooter(); llxFooter();
?>

View File

@ -666,4 +666,3 @@ else
$db->close(); $db->close();
llxFooter(); llxFooter();
?>

View File

@ -440,6 +440,14 @@ class Contrat extends CommonObject
$this->db->free($resql); $this->db->free($resql);
// Retreive all extrafield for thirdparty
// fetch optionals attributes and labels
require_once(DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php');
$extrafields=new ExtraFields($this->db);
$extralabels=$extrafields->fetch_name_optionals_label($this->table_element,true);
$this->fetch_optionals($this->id,$extralabels);
return $this->id; return $this->id;
} }
else else
@ -745,6 +753,19 @@ class Contrat extends CommonObject
$result=$this->add_contact($this->commercial_suivi_id,'SALESREPFOLL','internal'); $result=$this->add_contact($this->commercial_suivi_id,'SALESREPFOLL','internal');
if ($result < 0) $error++; if ($result < 0) $error++;
if (! $error)
{
if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) // For avoid conflicts if trigger used
{
$result=$this->insertExtraFields();
if ($result < 0)
{
$error++;
}
}
}
if (! $error) if (! $error)
{ {
// Call trigger // Call trigger

View File

@ -5,7 +5,7 @@
* Copyright (C) 2006 Andre Cianfarani <acianfa@free.fr> * Copyright (C) 2006 Andre Cianfarani <acianfa@free.fr>
* Copyright (C) 2010-2013 Juanjo Menent <jmenent@2byte.es> * Copyright (C) 2010-2013 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2013 Christophe Battarel <christophe.battarel@altairis.fr> * Copyright (C) 2013 Christophe Battarel <christophe.battarel@altairis.fr>
* Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro> * Copyright (C) 2013-2014 Florian Henry <florian.henry@open-concept.pro>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
@ -40,6 +40,7 @@ if (! empty($conf->projet->enabled)) {
require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php';
} }
require_once DOL_DOCUMENT_ROOT . '/core/class/extrafields.class.php';
$langs->load("contracts"); $langs->load("contracts");
$langs->load("orders"); $langs->load("orders");
@ -65,6 +66,10 @@ $usehm=(! empty($conf->global->MAIN_USE_HOURMIN_IN_DATE_RANGE)?$conf->global->MA
$hookmanager->initHooks(array('contractcard')); $hookmanager->initHooks(array('contractcard'));
$object = new Contrat($db); $object = new Contrat($db);
$extrafields = new ExtraFields($db);
// fetch optionals attributes and labels
$extralabels = $extrafields->fetch_name_optionals_label($object->table_element);
$permissionnote=$user->rights->contrat->creer; // Used by the include of actions_setnotes.inc.php $permissionnote=$user->rights->contrat->creer; // Used by the include of actions_setnotes.inc.php
@ -86,7 +91,7 @@ if ($action == 'confirm_active' && $confirm == 'yes' && $user->rights->contrat->
exit; exit;
} }
else { else {
$mesg=$object->error; setEventMessage($object->error,'errors');
} }
} }
@ -107,7 +112,7 @@ else if ($action == 'confirm_closeline' && $confirm == 'yes' && $user->rights->c
exit; exit;
} }
else { else {
$mesg=$object->error; setEventMessage($object->error,'errors');
} }
} }
} }
@ -176,7 +181,7 @@ if ($action == 'add' && $user->rights->contrat->creer)
if (empty($datecontrat)) if (empty($datecontrat))
{ {
$error++; $error++;
$mesg='<div class="error">'.$langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("Date")).'</div>'; setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("Date")),'errors');
$action='create'; $action='create';
} }
@ -228,7 +233,7 @@ if ($action == 'add' && $user->rights->contrat->creer)
$id = $object->create($user); $id = $object->create($user);
if ($id < 0) { if ($id < 0) {
$mesg='<div class="error">'.$object->error.'</div>'; setEventMessage($object->error,'errors');
} }
if ($id > 0) if ($id > 0)
@ -319,26 +324,30 @@ if ($action == 'add' && $user->rights->contrat->creer)
} }
else else
{ {
$mesg=$srcobject->error; setEventMessage($srcobject->error,'errors');
$error++; $error++;
} }
} }
else else
{ {
$mesg=$object->error; setEventMessage($object->error,'errors');
$error++; $error++;
} }
} }
else else
{ {
$result = $object->create($user,$langs,$conf);
// Fill array 'array_options' with data from add form
$ret = $extrafields->setOptionalsFromPost($extralabels, $object);
$result = $object->create($user);
if ($result > 0) if ($result > 0)
{ {
header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id); header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id);
exit; exit;
} }
else { else {
$mesg='<div class="error">'.$object->error.'</div>'; setEventMessage($object->error,'errors');
} }
$action='create'; $action='create';
} }
@ -389,7 +398,7 @@ else if ($action == 'addline' && $user->rights->contrat->creer)
$ret=$object->fetch($id); $ret=$object->fetch($id);
if ($ret < 0) if ($ret < 0)
{ {
dol_print_error($db,$object->error); setEventMessage($object->error,'errors');
exit; exit;
} }
$ret=$object->fetch_thirdparty(); $ret=$object->fetch_thirdparty();
@ -546,7 +555,7 @@ else if ($action == 'addline' && $user->rights->contrat->creer)
} }
else else
{ {
$mesg='<div class="error">'.$object->error.'</div>'; setEventMessage($object->error,'errors');
} }
} }
} }
@ -604,13 +613,13 @@ else if ($action == 'updateligne' && $user->rights->contrat->creer && ! GETPOST(
} }
else else
{ {
dol_print_error($db,'Failed to update contrat_det'); setEventMessage($objectline->error,'errors');
$db->rollback(); $db->rollback();
} }
} }
else else
{ {
dol_print_error($db); setEventMessage($objectline->error,'errors');
} }
} }
@ -626,7 +635,7 @@ else if ($action == 'confirm_deleteline' && $confirm == 'yes' && $user->rights->
} }
else else
{ {
$mesg=$object->error; setEventMessage($object->error,'errors');
} }
} }
@ -655,7 +664,7 @@ else if ($action == 'confirm_delete' && $confirm == 'yes' && $user->rights->cont
} }
else else
{ {
$mesg='<div class="error">'.$object->error.'</div>'; setEventMessage($object->error,'errors');
} }
} }
@ -674,12 +683,33 @@ else if ($action == 'confirm_move' && $confirm == 'yes' && $user->rights->contra
} }
else else
{ {
$mesg='<div class="error">'.$object->error.'</div>'; setEventMessage($object->error,'errors');
} }
} }
else else
{ {
$mesg='<div class="error">'.$langs->trans("ErrorFieldRequired",$langs->transnoentities("RefNewContract")).'</div>'; setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentities("RefNewContract")),'errors');
}
} else if ($action == 'update_extras') {
// Fill array 'array_options' with data from update form
$object->fetch($id);
$extralabels = $extrafields->fetch_name_optionals_label($object->table_element);
$ret = $extrafields->setOptionalsFromPost($extralabels, $object, GETPOST('attribute'));
if ($ret < 0)
$error ++;
if (! $error) {
$result = $object->insertExtraFields();
if ($result < 0) {
$error ++;
}
} else if ($reshook < 0)
$error ++;
if ($error) {
$action = 'edit_extras';
setEventMessage($object->error,'errors');
} }
} }
@ -705,11 +735,11 @@ if (! empty($conf->global->MAIN_DISABLE_CONTACTS_TAB) && $user->rights->contrat-
if ($object->error == 'DB_ERROR_RECORD_ALREADY_EXISTS') if ($object->error == 'DB_ERROR_RECORD_ALREADY_EXISTS')
{ {
$langs->load("errors"); $langs->load("errors");
$mesg = '<div class="error">'.$langs->trans("ErrorThisContactIsAlreadyDefinedAsThisType").'</div>'; setEventMessage($langs->trans("ErrorThisContactIsAlreadyDefinedAsThisType"),'errors');
} }
else else
{ {
$mesg = '<div class="error">'.$object->error.'</div>'; setEventMessage($object->error,'errors');
} }
} }
} }
@ -723,7 +753,7 @@ if (! empty($conf->global->MAIN_DISABLE_CONTACTS_TAB) && $user->rights->contrat-
} }
else else
{ {
dol_print_error($db); setEventMessage($object->error,'errors');
} }
} }
@ -739,7 +769,7 @@ if (! empty($conf->global->MAIN_DISABLE_CONTACTS_TAB) && $user->rights->contrat-
exit; exit;
} }
else { else {
dol_print_error($db); setEventMessage($object->error,'errors');
} }
} }
} }
@ -765,8 +795,6 @@ if ($action == 'create')
{ {
print_fiche_titre($langs->trans('AddContract')); print_fiche_titre($langs->trans('AddContract'));
dol_htmloutput_errors($mesg,'');
$soc = new Societe($db); $soc = new Societe($db);
if ($socid>0) $soc->fetch($socid); if ($socid>0) $soc->fetch($socid);
@ -902,9 +930,14 @@ if ($action == 'create')
} }
// Other attributes // Other attributes
$parameters=array('colspan' => ' colspan="3"'); $parameters=array('objectsrc' => $objectsrc,'colspan' => ' colspan="3"');
$reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$object,$action); // Note that $action and $object may have been modified by hook $reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$object,$action); // Note that $action and $object may have been modified by hook
// Other attributes
if (empty($reshook) && ! empty($extrafields->attribute_label)) {
print $object->showOptionals($extrafields, 'edit');
}
print "</table>\n"; print "</table>\n";
if (is_object($objectsrc)) if (is_object($objectsrc))
@ -937,8 +970,6 @@ else
$result=$object->fetch_thirdparty(); $result=$object->fetch_thirdparty();
if ($result < 0) dol_print_error($db,$object->error); if ($result < 0) dol_print_error($db,$object->error);
dol_htmloutput_errors($mesg,'');
$nbofservices=count($object->lines); $nbofservices=count($object->lines);
$author = new User($db); $author = new User($db);
@ -1066,6 +1097,50 @@ else
$parameters=array('colspan' => ' colspan="3"'); $parameters=array('colspan' => ' colspan="3"');
$reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$object,$action); // Note that $action and $object may have been modified by hook $reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$object,$action); // Note that $action and $object may have been modified by hook
$res = $object->fetch_optionals($object->id, $extralabels);
if (empty($reshook) && ! empty($extrafields->attribute_label)) {
foreach ($extrafields->attribute_label as $key => $label) {
if ($action == 'edit_extras') {
$value = (isset($_POST ["options_" . $key]) ? $_POST ["options_" . $key] : $object->array_options ["options_" . $key]);
} else {
$value = $object->array_options ["options_" . $key];
}
if ($extrafields->attribute_type [$key] == 'separate') {
print $extrafields->showSeparator($key);
} else {
print '<tr><td';
if (! empty($extrafields->attribute_required [$key]))
print ' class="fieldrequired"';
print '>' . $label . '</td><td colspan="5">';
// Convert date into timestamp format
if (in_array($extrafields->attribute_type [$key], array('date','datetime'))) {
$value = isset($_POST ["options_" . $key]) ? dol_mktime($_POST ["options_" . $key . "hour"], $_POST ["options_" . $key . "min"], 0, $_POST ["options_" . $key . "month"], $_POST ["options_" . $key . "day"], $_POST ["options_" . $key . "year"]) : $db->jdate($object->array_options ['options_' . $key]);
}
if ($action == 'edit_extras' && $user->rights->commande->creer && GETPOST('attribute') == $key) {
print '<form enctype="multipart/form-data" action="' . $_SERVER["PHP_SELF"] . '" method="post" name="formcontract">';
print '<input type="hidden" name="action" value="update_extras">';
print '<input type="hidden" name="attribute" value="' . $key . '">';
print '<input type="hidden" name="token" value="' . $_SESSION ['newtoken'] . '">';
print '<input type="hidden" name="id" value="' . $object->id . '">';
print $extrafields->showInputField($key, $value);
print '<input type="submit" class="button" value="' . $langs->trans('Modify') . '">';
print '</form>';
} else {
print $extrafields->showOutputField($key, $value);
if ($object->statut == 0 && $user->rights->commande->creer)
print '<a href="' . $_SERVER['PHP_SELF'] . '?id=' . $object->id . '&action=edit_extras&attribute=' . $key . '">' . img_picto('', 'edit') . ' ' . $langs->trans('Modify') . '</a>';
}
print '</td></tr>' . "\n";
}
}
}
print "</table>"; print "</table>";
if (! empty($object->brouillon) && $user->rights->contrat->creer) if (! empty($object->brouillon) && $user->rights->contrat->creer)

View File

@ -229,5 +229,3 @@ if (($action == 'send' || $action == 'relance') && ! $_POST['addfile'] && ! $_PO
} }
} }
?>

View File

@ -43,5 +43,3 @@ else if ($action == 'setnote_private' && ! empty($permissionnote) && ! GETPOST('
$result=$object->update_note(dol_html_entity_decode(GETPOST('note_private'), ENT_QUOTES),'_private'); $result=$object->update_note(dol_html_entity_decode(GETPOST('note_private'), ENT_QUOTES),'_private');
if ($result < 0) setEventMessage($object->error,'errors'); if ($result < 0) setEventMessage($object->error,'errors');
} }
?>

View File

@ -158,4 +158,3 @@ class box_factures extends ModeleBoxes
} }
} }
?>

View File

@ -153,4 +153,4 @@ class box_project extends ModeleBoxes
parent::showBox($this->info_box_head, $this->info_box_contents); parent::showBox($this->info_box_head, $this->info_box_contents);
} }
} }
?>

View File

@ -140,4 +140,3 @@ class box_task extends ModeleBoxes
parent::showBox($this->info_box_head, $this->info_box_contents); parent::showBox($this->info_box_head, $this->info_box_contents);
} }
} }
?>

View File

@ -229,15 +229,16 @@ abstract class CommonObject
} }
else else
{ {
$this->db->rollback();
if ($this->db->errno() == 'DB_ERROR_RECORD_ALREADY_EXISTS') if ($this->db->errno() == 'DB_ERROR_RECORD_ALREADY_EXISTS')
{ {
$this->error=$this->db->errno(); $this->error=$this->db->errno();
$this->db->rollback();
return -2; return -2;
} }
else else
{ {
$this->error=$this->db->error(); $this->error=$this->db->error();
$this->db->rollback();
return -1; return -1;
} }
} }

View File

@ -201,4 +201,3 @@ class dolprintIPP
return $ipp->printer_attributes; return $ipp->printer_attributes;
} }
} }
?>

View File

@ -676,7 +676,7 @@ class ExtraFields
if ($conf->use_javascript_ajax && $conf->global->COMPANY_USE_SEARCH_TO_SELECT && ! $forcecombo) if ($conf->use_javascript_ajax && $conf->global->COMPANY_USE_SEARCH_TO_SELECT && ! $forcecombo)
{ {
include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php'; include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
$out.= ajax_combobox('options_'.$key.$keyprefix, $event, $conf->global->COMPANY_USE_SEARCH_TO_SELECT); $out.= ajax_combobox('options_'.$key.$keyprefix, array(), $conf->global->COMPANY_USE_SEARCH_TO_SELECT);
} }
$out.='<select class="flat" name="options_'.$key.$keyprefix.'" id="options_'.$key.$keyprefix.'" '.($moreparam?$moreparam:'').'>'; $out.='<select class="flat" name="options_'.$key.$keyprefix.'" id="options_'.$key.$keyprefix.'" '.($moreparam?$moreparam:'').'>';
@ -696,7 +696,7 @@ class ExtraFields
if ($conf->use_javascript_ajax && $conf->global->COMPANY_USE_SEARCH_TO_SELECT && ! $forcecombo) if ($conf->use_javascript_ajax && $conf->global->COMPANY_USE_SEARCH_TO_SELECT && ! $forcecombo)
{ {
include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php'; include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
$out.= ajax_combobox('options_'.$key.$keyprefix, $event, $conf->global->COMPANY_USE_SEARCH_TO_SELECT); $out.= ajax_combobox('options_'.$key.$keyprefix, array(), $conf->global->COMPANY_USE_SEARCH_TO_SELECT);
} }
$out.='<select class="flat" name="options_'.$key.$keyprefix.'" id="options_'.$key.$keyprefix.'" '.($moreparam?$moreparam:'').'>'; $out.='<select class="flat" name="options_'.$key.$keyprefix.'" id="options_'.$key.$keyprefix.'" '.($moreparam?$moreparam:'').'>';

View File

@ -0,0 +1,326 @@
<?php
/* Copyright (C) 2014 Alexandre Spangaro <alexandre.spangaro@gmail.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/**
* \file htdocs/core/class/fiscalyear.php
* \ingroup fiscal year
* \brief File of class to manage fiscal years
*/
require_once DOL_DOCUMENT_ROOT .'/core/class/commonobject.class.php';
/**
* Class to manage fiscal year
*/
class Fiscalyear
{
public $element='fiscalyear';
public $table_element='accounting_fiscalyear';
public $table_element_line = '';
public $fk_element = '';
protected $ismultientitymanaged = 1; // 0=No test on entity, 1=Test with field entity, 2=Test with link by societe
var $id;
var $rowid;
var $label;
var $date_start;
var $date_end;
var $statut; // 0=open, 1=closed
var $entity;
var $statuts=array();
var $statuts_short=array();
/**
* Constructor
*
* @param DoliDB $db Database handler
*/
function __construct($db)
{
$this->db = $db;
$this->statuts_short = array(0 => 'Opened', 1 => 'Closed');
$this->statuts = array(0 => 'Opened', 1 => 'Closed');
return 1;
}
/**
* Create object in database
*
* @param User $user User making creation
* @return int <0 if KO, >0 if OK
*/
function create($user)
{
global $conf;
$error = 0;
$now=dol_now();
$this->db->begin();
$sql = "INSERT INTO ".MAIN_DB_PREFIX."accounting_fiscalyear (";
$sql.= "label";
$sql.= ", date_start";
$sql.= ", date_end";
$sql.= ", statut";
$sql.= ", entity";
$sql.= ", datec";
$sql.= ", fk_user_author";
$sql.= ") VALUES (";
$sql.= " '".$this->label."'";
$sql.= ", '".$this->db->idate($this->date_start)."'";
$sql.= ", '".$this->db->idate($this->date_end)."'";
$sql.= ", ".$this->statut;
$sql.= ", ".$conf->entity;
$sql.= ", '".$this->db->idate($now)."'";
$sql.= ", ". $user->id;
$sql.= ")";
dol_syslog(get_class($this)."::create", LOG_DEBUG);
$result = $this->db->query($sql);
if ($result)
{
$this->id = $this->db->last_insert_id(MAIN_DB_PREFIX."accounting_fiscalyear");
$result=$this->update($user);
if ($result > 0)
{
$this->db->commit();
return $this->id;
}
else
{
$this->error=$this->db->error();
$this->db->rollback();
return $result;
}
}
else
{
$this->error=$this->db->error()." sql=".$sql;
$this->db->rollback();
return -1;
}
}
/**
* Update record
*
* @param User $user User making update
* @return int <0 if KO, >0 if OK
*/
function update($user)
{
global $langs;
// Check parameters
if (empty($this->date_start) && empty($this->date_end))
{
$this->error='ErrorBadParameter';
return -1;
}
$this->db->begin();
$sql = "UPDATE ".MAIN_DB_PREFIX."accounting_fiscalyear ";
$sql .= " SET label = '".$this->label."'";
$sql .= ", date_start = '".$this->db->idate($this->date_start)."'";
$sql .= ", date_end = '".$this->db->idate($this->date_end)."'";
$sql .= ", statut = '".$this->statut."'";
$sql .= ", datec = " . ($this->datec != '' ? $this->db->idate($this->datec) : 'null');
$sql .= ", fk_user_modif = " . $user->id;
$sql .= " WHERE rowid = ".$this->id;
dol_syslog(get_class($this)."::update", LOG_DEBUG);
$result = $this->db->query($sql);
if ($result)
{
$this->db->commit();
return 1;
}
else
{
$this->error=$this->db->lasterror();
$this->db->rollback();
return -1;
}
}
/**
* Load an object from database
*
* @param int $id Id of record to load
* @return int <0 if KO, >0 if OK
*/
function fetch($id)
{
$sql = "SELECT rowid, label, date_start, date_end, statut";
$sql.= " FROM ".MAIN_DB_PREFIX."accounting_fiscalyear";
$sql.= " WHERE rowid = ".$id;
dol_syslog(get_class($this)."::fetch", LOG_DEBUG);
$result = $this->db->query($sql);
if ( $result )
{
$obj = $this->db->fetch_object($result);
$this->id = $obj->rowid;
$this->ref = $obj->rowid;
$this->date_start = $this->db->jdate($obj->date_start);
$this->date_end = $this->db->jdate($obj->date_end);
$this->label = $obj->label;
$this->statut = $obj->statut;
return 1;
}
else
{
$this->error=$this->db->error();
return -1;
}
}
/**
* Delete record
*
* @param int $id Id of record to delete
* @return int <0 if KO, >0 if OK
*/
function delete($id)
{
$this->db->begin();
$sql = "DELETE FROM ".MAIN_DB_PREFIX."accounting_fiscalyear WHERE rowid = ".$id;
dol_syslog(get_class($this)."::delete", LOG_DEBUG);
$result = $this->db->query($sql);
if ($result)
{
$this->db->commit();
return 1;
}
else
{
$this->error=$this->db->error();
$this->db->rollback();
return -1;
}
}
/**
* Give a label from a status
*
* @param int $mode 0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=Short label + Picto
* @return string Label
*/
function getLibStatut($mode=0)
{
return $this->LibStatut($this->statut,$mode);
}
/**
* Give a label from a status
*
* @param int $statut Id status
* @param int $mode 0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=Short label + Picto
* @return string Label
*/
function LibStatut($statut,$mode=0)
{
global $langs;
if ($mode == 0)
{
return $langs->trans($this->statuts[$statut]);
}
if ($mode == 1)
{
return $langs->trans($this->statuts_short[$statut]);
}
if ($mode == 2)
{
if ($statut==0) return img_picto($langs->trans($this->statuts_short[$statut]),'statut4').' '.$langs->trans($this->statuts_short[$statut]);
if ($statut==1) return img_picto($langs->trans($this->statuts_short[$statut]),'statut8').' '.$langs->trans($this->statuts_short[$statut]);
}
if ($mode == 3)
{
if ($statut==0 && ! empty($this->statuts_short[$statut])) return img_picto($langs->trans($this->statuts_short[$statut]),'statut4');
if ($statut==1 && ! empty($this->statuts_short[$statut])) return img_picto($langs->trans($this->statuts_short[$statut]),'statut8');
}
if ($mode == 4)
{
if ($statut==0 && ! empty($this->statuts_short[$statut])) return img_picto($langs->trans($this->statuts_short[$statut]),'statut4').' '.$langs->trans($this->statuts[$statut]);
if ($statut==1 && ! empty($this->statuts_short[$statut])) return img_picto($langs->trans($this->statuts_short[$statut]),'statut8').' '.$langs->trans($this->statuts[$statut]);
}
if ($mode == 5)
{
if ($statut==0 && ! empty($this->statuts_short[$statut])) return $langs->trans($this->statuts_short[$statut]).' '.img_picto($langs->trans($this->statuts_short[$statut]),'statut4');
if ($statut==1 && ! empty($this->statuts_short[$statut])) return $langs->trans($this->statuts_short[$statut]).' '.img_picto($langs->trans($this->statuts_short[$statut]),'statut8');
}
}
/**
* Information on record
*
* @param int $id Id of record
* @return void
*/
function info($id)
{
$sql = 'SELECT fy.rowid, fy.datec, fy.fk_user_author, fy.fk_user_modif,';
$sql.= ' fy.tms';
$sql.= ' FROM '.MAIN_DB_PREFIX.'accounting_fiscalyear as fy';
$sql.= ' WHERE fy.rowid = '.$id;
dol_syslog(get_class($this)."::fetch info", LOG_DEBUG);
$result = $this->db->query($sql);
if ($result)
{
if ($this->db->num_rows($result))
{
$obj = $this->db->fetch_object($result);
$this->id = $obj->rowid;
if ($obj->fk_user_author)
{
$cuser = new User($this->db);
$cuser->fetch($obj->fk_user_author);
$this->user_creation = $cuser;
}
if ($obj->fk_user_modif)
{
$muser = new User($this->db);
$muser->fetch($obj->fk_user_modif);
$this->user_modification = $muser;
}
$this->date_creation = $this->db->jdate($obj->datec);
$this->date_modification = $this->db->jdate($obj->tms);
}
$this->db->free($result);
}
else
{
dol_print_error($this->db);
}
}
}

View File

@ -0,0 +1,56 @@
<?php
/* Copyright (C) 2014 Alexandre Spangaro <alexandre.spangaro@gmail.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
* or see http://www.gnu.org/
*/
/**
* \file htdocs/core/lib/fiscalyear.lib.php
* \brief Set basic functions for fiscal years
*/
/**
* Prepare array with list of tabs
*
* @param Object $object Object related to tabs
* @return array Array of tabs to shoc
*/
function fiscalyear_prepare_head($object)
{
global $langs, $conf;
$h = 0;
$head = array();
$head[$h][0] = DOL_URL_ROOT . '/admin/fiscalyear_card.php?id=' . $object->id;
$head[$h][1] = $langs->trans("Card");
$head[$h][2] = 'card';
$h++;
// Show more tabs from modules
// Entries must be declared in modules descriptor with line
// $this->tabs = array('entity:+tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to add new tab
// $this->tabs = array('entity:-tabname); to remove a tab
complete_head_from_modules($conf,$langs,$object,$head,$h,'fiscalyear');
$head[$h][0] = DOL_URL_ROOT . '/admin/fiscalyear_info.php?id=' . $object->id;
$head[$h][1] = $langs->trans("Info");
$head[$h][2] = 'info';
$h++;
complete_head_from_modules($conf,$langs,$object,$head,$h,'fiscalyear','remove');
return $head;
}

View File

@ -49,5 +49,3 @@ function holiday_prepare_head($object)
return $head; return $head;
} }
?>

View File

@ -357,5 +357,3 @@ function measuring_units_string($unit,$measuring_style='')
return $measuring_units[$unit]; return $measuring_units[$unit];
} }
?>

View File

@ -59,5 +59,3 @@ function trip_prepare_head($object)
return $head; return $head;
} }
?>

View File

@ -342,4 +342,3 @@ function show_theme($fuser,$edit=0,$foruserprofile=false)
print '</table>'; print '</table>';
} }
?>

View File

@ -39,5 +39,3 @@ function check_user_password_empty($usertotest,$passwordtotest,$entitytotest)
return $login; return $login;
} }
?>

View File

@ -47,5 +47,3 @@ function check_user_password_forceuser($usertotest,$passwordtotest,$entitytotest
return $login; return $login;
} }
?>

View File

@ -44,5 +44,3 @@ function check_user_password_http($usertotest,$passwordtotest,$entitytotest)
return $login; return $login;
} }
?>

View File

@ -227,5 +227,3 @@ function check_user_password_ldap($usertotest,$passwordtotest,$entitytotest)
return $login; return $login;
} }
?>

View File

@ -112,5 +112,3 @@ function check_user_password_openid($usertotest,$passwordtotest,$entitytotest)
return $login; return $login;
} }
?>

View File

@ -25,16 +25,17 @@ insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, left
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$leftmenu=="setup"', __HANDLER__, 'left', 101__+MAX_llx_menu__, 'home', '', 100__+MAX_llx_menu__, '/admin/company.php?leftmenu=setup', 'MenuCompanySetup', 1, 'admin', '', '', 2, 1, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$leftmenu=="setup"', __HANDLER__, 'left', 101__+MAX_llx_menu__, 'home', '', 100__+MAX_llx_menu__, '/admin/company.php?leftmenu=setup', 'MenuCompanySetup', 1, 'admin', '', '', 2, 1, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$leftmenu=="setup"', __HANDLER__, 'left', 102__+MAX_llx_menu__, 'home', '', 100__+MAX_llx_menu__, '/admin/ihm.php?leftmenu=setup', 'GUISetup', 1, 'admin', '', '', 2, 4, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$leftmenu=="setup"', __HANDLER__, 'left', 102__+MAX_llx_menu__, 'home', '', 100__+MAX_llx_menu__, '/admin/ihm.php?leftmenu=setup', 'GUISetup', 1, 'admin', '', '', 2, 4, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$leftmenu=="setup"', __HANDLER__, 'left', 103__+MAX_llx_menu__, 'home', '', 100__+MAX_llx_menu__, '/admin/modules.php?leftmenu=setup', 'Modules', 1, 'admin', '', '', 2, 2, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$leftmenu=="setup"', __HANDLER__, 'left', 103__+MAX_llx_menu__, 'home', '', 100__+MAX_llx_menu__, '/admin/modules.php?leftmenu=setup', 'Modules', 1, 'admin', '', '', 2, 2, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$leftmenu=="setup"', __HANDLER__, 'left', 104__+MAX_llx_menu__, 'home', '', 100__+MAX_llx_menu__, '/admin/boxes.php?leftmenu=setup', 'Boxes', 1, 'admin', '', '', 2, 5, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$leftmenu=="setup"', __HANDLER__, 'left', 104__+MAX_llx_menu__, 'home', '', 100__+MAX_llx_menu__, '/admin/boxes.php?leftmenu=setup', 'Boxes', 1, 'admin', '', '', 2, 6, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$leftmenu=="setup"', __HANDLER__, 'left', 105__+MAX_llx_menu__, 'home', '', 100__+MAX_llx_menu__, '/admin/menus.php?leftmenu=setup', 'Menus', 1, 'admin', '', '', 2, 3, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$leftmenu=="setup"', __HANDLER__, 'left', 105__+MAX_llx_menu__, 'home', '', 100__+MAX_llx_menu__, '/admin/menus.php?leftmenu=setup', 'Menus', 1, 'admin', '', '', 2, 3, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$leftmenu=="setup"', __HANDLER__, 'left', 106__+MAX_llx_menu__, 'home', '', 100__+MAX_llx_menu__, '/admin/delais.php?leftmenu=setup', 'Alerts', 1, 'admin', '', '', 2, 6, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$leftmenu=="setup"', __HANDLER__, 'left', 114__+MAX_llx_menu__, 'home', '', 100__+MAX_llx_menu__, '/admin/fiscalyear.php?leftmenu=setup', 'Fiscalyear', 1, 'admin', '', '', 2, 5, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$leftmenu=="setup"', __HANDLER__, 'left', 108__+MAX_llx_menu__, 'home', '', 100__+MAX_llx_menu__, '/admin/proxy.php?leftmenu=setup', 'Security', 1, 'admin', '', '', 2, 7, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$leftmenu=="setup"', __HANDLER__, 'left', 106__+MAX_llx_menu__, 'home', '', 100__+MAX_llx_menu__, '/admin/delais.php?leftmenu=setup', 'Alerts', 1, 'admin', '', '', 2, 7, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$leftmenu=="setup"', __HANDLER__, 'left', 110__+MAX_llx_menu__, 'home', '', 100__+MAX_llx_menu__, '/admin/limits.php?leftmenu=setup', 'MenuLimits', 1, 'admin', '', '', 2, 8, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$leftmenu=="setup"', __HANDLER__, 'left', 108__+MAX_llx_menu__, 'home', '', 100__+MAX_llx_menu__, '/admin/proxy.php?leftmenu=setup', 'Security', 1, 'admin', '', '', 2, 8, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$leftmenu=="setup"', __HANDLER__, 'left', 107__+MAX_llx_menu__, 'home', '', 100__+MAX_llx_menu__, '/admin/pdf.php?leftmenu=setup', 'PDF', 1, 'admin', '', '', 2, 9, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$leftmenu=="setup"', __HANDLER__, 'left', 110__+MAX_llx_menu__, 'home', '', 100__+MAX_llx_menu__, '/admin/limits.php?leftmenu=setup', 'MenuLimits', 1, 'admin', '', '', 2, 9, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$leftmenu=="setup"', __HANDLER__, 'left', 109__+MAX_llx_menu__, 'home', '', 100__+MAX_llx_menu__, '/admin/mails.php?leftmenu=setup', 'Emails', 1, 'admin', '', '', 2, 10, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$leftmenu=="setup"', __HANDLER__, 'left', 107__+MAX_llx_menu__, 'home', '', 100__+MAX_llx_menu__, '/admin/pdf.php?leftmenu=setup', 'PDF', 1, 'admin', '', '', 2, 10, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$leftmenu=="setup"', __HANDLER__, 'left', 113__+MAX_llx_menu__, 'home', '', 100__+MAX_llx_menu__, '/admin/sms.php?leftmenu=setup', 'SMS', 1, 'admin', '', '', 2, 11, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$leftmenu=="setup"', __HANDLER__, 'left', 109__+MAX_llx_menu__, 'home', '', 100__+MAX_llx_menu__, '/admin/mails.php?leftmenu=setup', 'Emails', 1, 'admin', '', '', 2, 11, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$leftmenu=="setup"', __HANDLER__, 'left', 111__+MAX_llx_menu__, 'home', '', 100__+MAX_llx_menu__, '/admin/dict.php?leftmenu=setup', 'Dictionary', 1, 'admin', '', '', 2, 12, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$leftmenu=="setup"', __HANDLER__, 'left', 113__+MAX_llx_menu__, 'home', '', 100__+MAX_llx_menu__, '/admin/sms.php?leftmenu=setup', 'SMS', 1, 'admin', '', '', 2, 12, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$leftmenu=="setup"', __HANDLER__, 'left', 112__+MAX_llx_menu__, 'home', '', 100__+MAX_llx_menu__, '/admin/const.php?leftmenu=setup', 'OtherSetup', 1, 'admin', '', '', 2, 13, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$leftmenu=="setup"', __HANDLER__, 'left', 111__+MAX_llx_menu__, 'home', '', 100__+MAX_llx_menu__, '/admin/dict.php?leftmenu=setup', 'Dictionary', 1, 'admin', '', '', 2, 13, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$leftmenu=="setup"', __HANDLER__, 'left', 112__+MAX_llx_menu__, 'home', '', 100__+MAX_llx_menu__, '/admin/const.php?leftmenu=setup', 'OtherSetup', 1, 'admin', '', '', 2, 14, __ENTITY__);
-- Home - Sytem info -- Home - Sytem info
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$user->admin', __HANDLER__, 'left', 300__+MAX_llx_menu__, 'home', 'admintools', 1__+MAX_llx_menu__, '/admin/tools/index.php?leftmenu=admintools', 'SystemTools', 0, 'admin', '', '', 2, 2, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$user->admin', __HANDLER__, 'left', 300__+MAX_llx_menu__, 'home', 'admintools', 1__+MAX_llx_menu__, '/admin/tools/index.php?leftmenu=admintools', 'SystemTools', 0, 'admin', '', '', 2, 2, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$leftmenu=="admintools"', __HANDLER__, 'left', 201__+MAX_llx_menu__, 'home', '', 300__+MAX_llx_menu__, '/admin/system/dolibarr.php?leftmenu=admintools', 'InfoDolibarr', 1, 'admin', '', '', 2, 0, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$leftmenu=="admintools"', __HANDLER__, 'left', 201__+MAX_llx_menu__, 'home', '', 300__+MAX_llx_menu__, '/admin/system/dolibarr.php?leftmenu=admintools', 'InfoDolibarr', 1, 'admin', '', '', 2, 0, __ENTITY__);

View File

@ -431,4 +431,3 @@ function dol_auguria_showmenu($type_user, &$menuentry, &$listofmodulesforexterna
return 1; return 1;
} }
?>

View File

@ -501,6 +501,7 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu
$newmenu->add("/admin/modules.php?mainmenu=home", $langs->trans("Modules").$warnpicto,1); $newmenu->add("/admin/modules.php?mainmenu=home", $langs->trans("Modules").$warnpicto,1);
$newmenu->add("/admin/menus.php?mainmenu=home", $langs->trans("Menus"),1); $newmenu->add("/admin/menus.php?mainmenu=home", $langs->trans("Menus"),1);
$newmenu->add("/admin/ihm.php?mainmenu=home", $langs->trans("GUISetup"),1); $newmenu->add("/admin/ihm.php?mainmenu=home", $langs->trans("GUISetup"),1);
$newmenu->add("/admin/fiscalyear.php?mainmenu=home", $langs->trans("Fiscalyear"),1);
if (! in_array($langs->defaultlang,array('en_US','en_GB','en_NZ','en_AU','fr_FR','fr_BE','es_ES','ca_ES'))) if (! in_array($langs->defaultlang,array('en_US','en_GB','en_NZ','en_AU','fr_FR','fr_BE','es_ES','ca_ES')))
{ {
if (empty($leftmenu) || $leftmenu=="setup") $newmenu->add("/admin/translation.php", $langs->trans("Translation"),1); if (empty($leftmenu) || $leftmenu=="setup") $newmenu->add("/admin/translation.php", $langs->trans("Translation"),1);

View File

@ -115,6 +115,7 @@ class MenuManager
$this->menu->add("/admin/modules.php", $langs->trans("Modules"),1); $this->menu->add("/admin/modules.php", $langs->trans("Modules"),1);
$this->menu->add("/admin/menus.php", $langs->trans("Menus"),1); $this->menu->add("/admin/menus.php", $langs->trans("Menus"),1);
$this->menu->add("/admin/ihm.php", $langs->trans("GUISetup"),1); $this->menu->add("/admin/ihm.php", $langs->trans("GUISetup"),1);
$this->menu->add("/admin/fiscalyear.php", $langs->trans("Fiscalyear"),1);
$this->menu->add("/admin/boxes.php", $langs->trans("Boxes"),1); $this->menu->add("/admin/boxes.php", $langs->trans("Boxes"),1);
$this->menu->add("/admin/delais.php",$langs->trans("Alerts"),1); $this->menu->add("/admin/delais.php",$langs->trans("Alerts"),1);
$this->menu->add("/admin/proxy.php?mainmenu=home", $langs->trans("Security"),1); $this->menu->add("/admin/proxy.php?mainmenu=home", $langs->trans("Security"),1);

View File

@ -254,4 +254,3 @@ function propale_pdf_create($db, $object, $modele, $outputlangs, $hidedetails=0,
} }
} }
?>

View File

@ -31,7 +31,7 @@
$usemargins=0; $usemargins=0;
if (! empty($conf->margin->enabled) && ! empty($object->element) && in_array($object->element,array('facture','propal','commande'))) $usemargins=1; if (! empty($conf->margin->enabled) && ! empty($object->element) && in_array($object->element,array('facture','propal','commande'))) $usemargins=1;
global $dateSelector, $forceall, $senderissupplier, $inputalsopricewithtax; global $forceall, $senderissupplier, $inputalsopricewithtax;
if (empty($dateSelector)) $dateSelector=0; if (empty($dateSelector)) $dateSelector=0;
if (empty($forceall)) $forceall=0; if (empty($forceall)) $forceall=0;
if (empty($senderissupplier)) $senderissupplier=0; if (empty($senderissupplier)) $senderissupplier=0;

View File

@ -31,7 +31,7 @@
$usemargins=0; $usemargins=0;
if (! empty($conf->margin->enabled) && ! empty($object->element) && in_array($object->element,array('facture','propal','commande'))) $usemargins=1; if (! empty($conf->margin->enabled) && ! empty($object->element) && in_array($object->element,array('facture','propal','commande'))) $usemargins=1;
global $dateSelector, $forceall, $senderissupplier, $inputalsopricewithtax; global $forceall, $senderissupplier, $inputalsopricewithtax;
if (empty($dateSelector)) $dateSelector=0; if (empty($dateSelector)) $dateSelector=0;
if (empty($forceall)) $forceall=0; if (empty($forceall)) $forceall=0;
if (empty($senderissupplier)) $senderissupplier=0; if (empty($senderissupplier)) $senderissupplier=0;

View File

@ -116,8 +116,8 @@ class InterfaceActionsAuto
$key='MAIN_AGENDA_ACTIONAUTO_'.$action; $key='MAIN_AGENDA_ACTIONAUTO_'.$action;
//dol_syslog("xxxxxxxxxxx".$key); //dol_syslog("xxxxxxxxxxx".$key);
if (empty($conf->agenda->enabled)) return 0; // Module not active, we do nothing if (empty($conf->agenda->enabled)) return 0; // Module not active, we do nothing
if (empty($conf->global->$key)) return 0; // Log events not enabled for this action if (empty($conf->global->$key)) return 0; // Do not log events not enabled for this action
$ok=0; $ok=0;
@ -370,11 +370,26 @@ class InterfaceActionsAuto
$object->actionmsg=$langs->transnoentities("InterventionSentByEMail",$object->ref); $object->actionmsg=$langs->transnoentities("InterventionSentByEMail",$object->ref);
$object->actionmsg.="\n".$langs->transnoentities("Author").': '.$user->login; $object->actionmsg.="\n".$langs->transnoentities("Author").': '.$user->login;
// Parameters $object->sendotid defined by caller // Parameters $object->sendtoid defined by caller
//$object->sendtoid=0; //$object->sendtoid=0;
$ok=1; $ok=1;
} }
elseif ($action == 'SHIPPING_VALIDATE') elseif ($action == 'FICHINTER_CLASSIFY_BILLED')
{
dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
$langs->load("other");
$langs->load("interventions");
$langs->load("agenda");
$object->actiontypecode='AC_OTH_AUTO';
if (empty($object->actionmsg2)) $object->actionmsg2=$langs->transnoentities("InterventionClassifiedBilled",$object->ref);
$object->actionmsg=$langs->transnoentities("InterventionClassifiedBilled",$object->ref);
$object->actionmsg.="\n".$langs->transnoentities("Author").': '.$user->login;
$object->sendtoid=0;
$ok=1;
}
elseif ($action == 'SHIPPING_VALIDATE')
{ {
dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id); dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
$langs->load("other"); $langs->load("other");
@ -470,7 +485,7 @@ class InterfaceActionsAuto
$object->actionmsg.="\n".$langs->transnoentities("Author").': '.$user->login; $object->actionmsg.="\n".$langs->transnoentities("Author").': '.$user->login;
} }
// Parameters $object->sendotid defined by caller // Parameters $object->sendtoid defined by caller
//$object->sendtoid=0; //$object->sendtoid=0;
$ok=1; $ok=1;
} }
@ -629,6 +644,7 @@ class InterfaceActionsAuto
$object->actionmsg=$langs->transnoentities("ProjectCreatedInDolibarr",$object->ref); $object->actionmsg=$langs->transnoentities("ProjectCreatedInDolibarr",$object->ref);
$object->actionmsg.="\n".$langs->transnoentities("Project").': '.$object->ref; $object->actionmsg.="\n".$langs->transnoentities("Project").': '.$object->ref;
$object->actionmsg.="\n".$langs->transnoentities("Author").': '.$user->login; $object->actionmsg.="\n".$langs->transnoentities("Author").': '.$user->login;
$object->sendtoid=0; $object->sendtoid=0;
$ok=1; $ok=1;
} }
@ -647,6 +663,7 @@ class InterfaceActionsAuto
$object->actionmsg.="\n".$langs->transnoentities("Task").': '.$object->ref; $object->actionmsg.="\n".$langs->transnoentities("Task").': '.$object->ref;
$object->actionmsg.="\n".$langs->transnoentities("Author").': '.$user->login; $object->actionmsg.="\n".$langs->transnoentities("Author").': '.$user->login;
$object->sendtoid=0;
$ok=1; $ok=1;
} }
@ -662,6 +679,7 @@ class InterfaceActionsAuto
$object->actionmsg.="\n".$langs->transnoentities("Task").': '.$object->ref; $object->actionmsg.="\n".$langs->transnoentities("Task").': '.$object->ref;
$object->actionmsg.="\n".$langs->transnoentities("Author").': '.$user->login; $object->actionmsg.="\n".$langs->transnoentities("Author").': '.$user->login;
$object->sendtoid=0;
$ok=1; $ok=1;
} }
@ -677,6 +695,7 @@ class InterfaceActionsAuto
$object->actionmsg.="\n".$langs->transnoentities("Task").': '.$object->ref; $object->actionmsg.="\n".$langs->transnoentities("Task").': '.$object->ref;
$object->actionmsg.="\n".$langs->transnoentities("Author").': '.$user->login; $object->actionmsg.="\n".$langs->transnoentities("Author").': '.$user->login;
$object->sendtoid=0;
$ok=1; $ok=1;
} }
@ -723,8 +742,8 @@ class InterfaceActionsAuto
$actioncomm->contact = $contactforaction; $actioncomm->contact = $contactforaction;
$actioncomm->societe = $societeforaction; $actioncomm->societe = $societeforaction;
$actioncomm->author = $user; // User saving action $actioncomm->author = $user; // User saving action
//$actioncomm->usertodo = $user; // User affected to action $actioncomm->usertodo = $user; // User owner of action
$actioncomm->userdone = $user; // User doing action //$actioncomm->userdone = $user; // User doing action
$actioncomm->fk_element = $object->id; $actioncomm->fk_element = $object->id;
$actioncomm->elementtype = $object->element; $actioncomm->elementtype = $object->element;

View File

@ -134,4 +134,3 @@ else
llxFooter(); llxFooter();
$db->close(); $db->close();
?>

View File

@ -50,6 +50,7 @@ if (! empty($conf->global->FICHEINTER_ADDON) && is_readable(DOL_DOCUMENT_ROOT ."
require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php';
$langs->load("bills");
$langs->load("companies"); $langs->load("companies");
$langs->load("interventions"); $langs->load("interventions");
@ -1143,6 +1144,13 @@ else if ($id > 0 || ! empty($ref))
} }
print '<form action="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'" method="POST" name="formfichinter">';
print '<input type="hidden" name="id" value="'.$object->id.'">';
if ($action == 'edit_extras') print '<input type="hidden" name="action" value="update_extras">';
if ($action == 'contrat') print '<input type="hidden" name="action" value="setcontrat">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<table class="border" width="100%">'; print '<table class="border" width="100%">';
$linkback = '<a href="'.DOL_URL_ROOT.'/fichinter/list.php'.(! empty($socid)?'?socid='.$socid:'').'">'.$langs->trans("BackToList").'</a>'; $linkback = '<a href="'.DOL_URL_ROOT.'/fichinter/list.php'.(! empty($socid)?'?socid='.$socid:'').'">'.$langs->trans("BackToList").'</a>';
@ -1218,9 +1226,6 @@ else if ($id > 0 || ! empty($ref))
print '</td><td colspan="3">'; print '</td><td colspan="3">';
if ($action == 'contrat') if ($action == 'contrat')
{ {
print '<form method="post" action="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'">';
print '<input type="hidden" name="action" value="setcontrat">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<table class="nobordernopadding" cellpadding="0" cellspacing="0">'; print '<table class="nobordernopadding" cellpadding="0" cellspacing="0">';
print '<tr><td>'; print '<tr><td>';
$htmlcontract= new Formcontract($db); $htmlcontract= new Formcontract($db);
@ -1229,7 +1234,7 @@ else if ($id > 0 || ! empty($ref))
print '</td>'; print '</td>';
print '<td align="left"><input type="submit" class="button" value="'.$langs->trans("Modify").'"></td>'; print '<td align="left"><input type="submit" class="button" value="'.$langs->trans("Modify").'"></td>';
print '</tr></table></form>'; print '</tr></table>';
} }
else else
{ {
@ -1280,16 +1285,11 @@ else if ($id > 0 || ! empty($ref))
} }
if ($action == 'edit_extras' && $user->rights->ficheinter->creer && GETPOST('attribute') == $key) if ($action == 'edit_extras' && $user->rights->ficheinter->creer && GETPOST('attribute') == $key)
{ {
print '<form enctype="multipart/form-data" action="'.$_SERVER["PHP_SELF"].'" method="post" name="formfichinter">';
print '<input type="hidden" name="action" value="update_extras">';
print '<input type="hidden" name="attribute" value="'.$key.'">'; print '<input type="hidden" name="attribute" value="'.$key.'">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<input type="hidden" name="id" value="'.$object->id.'">';
print $extrafields->showInputField($key,$value); print $extrafields->showInputField($key,$value);
print '<input type="submit" class="button" value="'.$langs->trans('Modify').'">'; print '<input type="submit" class="button" value="'.$langs->trans('Modify').'">';
print '</form>';
} }
else else
{ {
@ -1301,7 +1301,9 @@ else if ($id > 0 || ! empty($ref))
} }
} }
print "</table>"; print "</table><br>";
print '</form>';
if (! empty($conf->global->MAIN_DISABLE_CONTACTS_TAB)) if (! empty($conf->global->MAIN_DISABLE_CONTACTS_TAB))
{ {

View File

@ -190,4 +190,3 @@ dol_fiche_end();
llxFooter(); llxFooter();
$db->close(); $db->close();
?>

View File

@ -32,38 +32,39 @@
-- List of all managed triggered events (used for trigger agenda and for notification) -- List of all managed triggered events (used for trigger agenda and for notification)
-- --
delete from llx_c_action_trigger; delete from llx_c_action_trigger;
insert into llx_c_action_trigger (rowid,code,label,description,elementtype,rang) values (1,'FICHINTER_VALIDATE','Intervention validated','Executed when a intervention is validated','ficheinter',19); insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('FICHINTER_VALIDATE','Intervention validated','Executed when a intervention is validated','ficheinter',19);
insert into llx_c_action_trigger (rowid,code,label,description,elementtype,rang) values (2,'BILL_VALIDATE','Customer invoice validated','Executed when a customer invoice is approved','facture',6); insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('BILL_VALIDATE','Customer invoice validated','Executed when a customer invoice is approved','facture',6);
insert into llx_c_action_trigger (rowid,code,label,description,elementtype,rang) values (3,'ORDER_SUPPLIER_APPROVE','Supplier order request approved','Executed when a supplier order is approved','order_supplier',12); insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('ORDER_SUPPLIER_APPROVE','Supplier order request approved','Executed when a supplier order is approved','order_supplier',12);
insert into llx_c_action_trigger (rowid,code,label,description,elementtype,rang) values (4,'ORDER_SUPPLIER_REFUSE','Supplier order request refused','Executed when a supplier order is refused','order_supplier',13); insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('ORDER_SUPPLIER_REFUSE','Supplier order request refused','Executed when a supplier order is refused','order_supplier',13);
insert into llx_c_action_trigger (rowid,code,label,description,elementtype,rang) values (5,'ORDER_VALIDATE','Customer order validate','Executed when a customer order is validated','commande',4); insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('ORDER_VALIDATE','Customer order validate','Executed when a customer order is validated','commande',4);
insert into llx_c_action_trigger (rowid,code,label,description,elementtype,rang) values (6,'PROPAL_VALIDATE','Customer proposal validated','Executed when a commercial proposal is validated','propal',2); insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('PROPAL_VALIDATE','Customer proposal validated','Executed when a commercial proposal is validated','propal',2);
insert into llx_c_action_trigger (rowid,code,label,description,elementtype,rang) values (9,'COMPANY_SENTBYMAIL','Mails sent from third party card','Executed when you send email from third party card','societe',1); insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('COMPANY_SENTBYMAIL','Mails sent from third party card','Executed when you send email from third party card','societe',1);
insert into llx_c_action_trigger (rowid,code,label,description,elementtype,rang) values (10,'COMPANY_CREATE','Third party created','Executed when a third party is created','societe',1); insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('COMPANY_CREATE','Third party created','Executed when a third party is created','societe',1);
insert into llx_c_action_trigger (rowid,code,label,description,elementtype,rang) values (11,'CONTRACT_VALIDATE','Contract validated','Executed when a contract is validated','contrat',18); insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('CONTRACT_VALIDATE','Contract validated','Executed when a contract is validated','contrat',18);
insert into llx_c_action_trigger (rowid,code,label,description,elementtype,rang) values (12,'PROPAL_SENTBYMAIL','Commercial proposal sent by mail','Executed when a commercial proposal is sent by mail','propal',3); insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('PROPAL_SENTBYMAIL','Commercial proposal sent by mail','Executed when a commercial proposal is sent by mail','propal',3);
insert into llx_c_action_trigger (rowid,code,label,description,elementtype,rang) values (13,'ORDER_SENTBYMAIL','Customer order sent by mail','Executed when a customer order is sent by mail ','commande',5); insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('ORDER_SENTBYMAIL','Customer order sent by mail','Executed when a customer order is sent by mail ','commande',5);
insert into llx_c_action_trigger (rowid,code,label,description,elementtype,rang) values (14,'BILL_PAYED','Customer invoice payed','Executed when a customer invoice is payed','facture',7); insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('BILL_PAYED','Customer invoice payed','Executed when a customer invoice is payed','facture',7);
insert into llx_c_action_trigger (rowid,code,label,description,elementtype,rang) values (15,'BILL_CANCEL','Customer invoice canceled','Executed when a customer invoice is conceled','facture',8); insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('BILL_CANCEL','Customer invoice canceled','Executed when a customer invoice is conceled','facture',8);
insert into llx_c_action_trigger (rowid,code,label,description,elementtype,rang) values (16,'BILL_SENTBYMAIL','Customer invoice sent by mail','Executed when a customer invoice is sent by mail','facture',9); insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('BILL_SENTBYMAIL','Customer invoice sent by mail','Executed when a customer invoice is sent by mail','facture',9);
insert into llx_c_action_trigger (rowid,code,label,description,elementtype,rang) values (17,'ORDER_SUPPLIER_VALIDATE','Supplier order validated','Executed when a supplier order is validated','order_supplier',11); insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('ORDER_SUPPLIER_VALIDATE','Supplier order validated','Executed when a supplier order is validated','order_supplier',11);
insert into llx_c_action_trigger (rowid,code,label,description,elementtype,rang) values (18,'ORDER_SUPPLIER_SENTBYMAIL','Supplier order sent by mail','Executed when a supplier order is sent by mail','order_supplier',14); insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('ORDER_SUPPLIER_SENTBYMAIL','Supplier order sent by mail','Executed when a supplier order is sent by mail','order_supplier',14);
insert into llx_c_action_trigger (rowid,code,label,description,elementtype,rang) values (19,'BILL_SUPPLIER_VALIDATE','Supplier invoice validated','Executed when a supplier invoice is validated','invoice_supplier',15); insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('BILL_SUPPLIER_VALIDATE','Supplier invoice validated','Executed when a supplier invoice is validated','invoice_supplier',15);
insert into llx_c_action_trigger (rowid,code,label,description,elementtype,rang) values (20,'BILL_SUPPLIER_PAYED','Supplier invoice payed','Executed when a supplier invoice is payed','invoice_supplier',16); insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('BILL_SUPPLIER_PAYED','Supplier invoice payed','Executed when a supplier invoice is payed','invoice_supplier',16);
insert into llx_c_action_trigger (rowid,code,label,description,elementtype,rang) values (21,'BILL_SUPPLIER_SENTBYMAIL','Supplier invoice sent by mail','Executed when a supplier invoice is sent by mail','invoice_supplier',17); insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('BILL_SUPPLIER_SENTBYMAIL','Supplier invoice sent by mail','Executed when a supplier invoice is sent by mail','invoice_supplier',17);
insert into llx_c_action_trigger (rowid,code,label,description,elementtype,rang) values (22,'SHIPPING_VALIDATE','Shipping validated','Executed when a shipping is validated','shipping',20); insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('SHIPPING_VALIDATE','Shipping validated','Executed when a shipping is validated','shipping',20);
insert into llx_c_action_trigger (rowid,code,label,description,elementtype,rang) values (23,'SHIPPING_SENTBYMAIL','Shipping sent by mail','Executed when a shipping is sent by mail','shipping',21); insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('SHIPPING_SENTBYMAIL','Shipping sent by mail','Executed when a shipping is sent by mail','shipping',21);
insert into llx_c_action_trigger (rowid,code,label,description,elementtype,rang) values (24,'MEMBER_VALIDATE','Member validated','Executed when a member is validated','member',22); insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('MEMBER_VALIDATE','Member validated','Executed when a member is validated','member',22);
insert into llx_c_action_trigger (rowid,code,label,description,elementtype,rang) values (25,'MEMBER_SUBSCRIPTION','Member subscribed','Executed when a member is subscribed','member',23); insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('MEMBER_SUBSCRIPTION','Member subscribed','Executed when a member is subscribed','member',23);
insert into llx_c_action_trigger (rowid,code,label,description,elementtype,rang) values (26,'MEMBER_RESILIATE','Member resiliated','Executed when a member is resiliated','member',24); insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('MEMBER_RESILIATE','Member resiliated','Executed when a member is resiliated','member',24);
insert into llx_c_action_trigger (rowid,code,label,description,elementtype,rang) values (27,'MEMBER_DELETE','Member deleted','Executed when a member is deleted','member',25); insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('MEMBER_DELETE','Member deleted','Executed when a member is deleted','member',25);
insert into llx_c_action_trigger (rowid,code,label,description,elementtype,rang) values (28,'BILL_UNVALIDATE','Customer invoice unvalidated','Executed when a customer invoice status set back to draft','facture',10); insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('BILL_UNVALIDATE','Customer invoice unvalidated','Executed when a customer invoice status set back to draft','facture',10);
insert into llx_c_action_trigger (rowid,code,label,description,elementtype,rang) values (29,'FICHINTER_SENTBYMAIL','Intervention sent by mail','Executed when a intervention is sent by mail','ficheinter',29); insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('FICHINTER_SENTBYMAIL','Intervention sent by mail','Executed when a intervention is sent by mail','ficheinter',19);
insert into llx_c_action_trigger (rowid,code,label,description,elementtype,rang) values (30,'PROJECT_CREATE','Project creation','Executed when a project is created','project',30); insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('PROJECT_CREATE','Project creation','Executed when a project is created','project',30);
insert into llx_c_action_trigger (rowid,code,label,description,elementtype,rang) values (31,'PROPAL_CLOSE_SIGNED','Customer proposal closed signed','Executed when a customer proposal is closed signed','propal',31); insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('PROPAL_CLOSE_SIGNED','Customer proposal closed signed','Executed when a customer proposal is closed signed','propal',2);
insert into llx_c_action_trigger (rowid,code,label,description,elementtype,rang) values (32,'PROPAL_CLOSE_REFUSED','Customer proposal closed refused','Executed when a customer proposal is closed refused','propal',32); insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('PROPAL_CLOSE_REFUSED','Customer proposal closed refused','Executed when a customer proposal is closed refused','propal',2);
insert into llx_c_action_trigger (rowid,code,label,description,elementtype,rang) values (33,'BILL_SUPPLIER_CANCELED','Supplier invoice cancelled','Executed when a supplier invoice is cancelled','invoice_supplier',33); insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('BILL_SUPPLIER_CANCELED','Supplier invoice cancelled','Executed when a supplier invoice is cancelled','invoice_supplier',17);
insert into llx_c_action_trigger (rowid,code,label,description,elementtype,rang) values (34,'MEMBER_MODIFY','Member modified','Executed when a member is modified','member',34); insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('MEMBER_MODIFY','Member modified','Executed when a member is modified','member',24);
insert into llx_c_action_trigger (rowid,code,label,description,elementtype,rang) values (35,'TASK_CREATE','Task created','Executed when a project task is created','project',35); insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('TASK_CREATE','Task created','Executed when a project task is created','project',35);
insert into llx_c_action_trigger (rowid,code,label,description,elementtype,rang) values (36,'TASK_MODIFY','Task modified','Executed when a project task is modified','project',36); insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('TASK_MODIFY','Task modified','Executed when a project task is modified','project',36);
insert into llx_c_action_trigger (rowid,code,label,description,elementtype,rang) values (37,'TASK_DELETE','Task deleted','Executed when a project task is deleted','project',37); insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('TASK_DELETE','Task deleted','Executed when a project task is deleted','project',37);
insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('FICHINTER_CLASSIFY_BILLED','Classify intervention as billed','Executed when a intervention is classified as billed (when option FICHINTER_DISABLE_DETAILS is set)','ficheinter',19);

View File

@ -36,6 +36,7 @@ insert into llx_c_actioncomm (id, code, type, libelle, module, active, position)
insert into llx_c_actioncomm (id, code, type, libelle, module, active, position) values ( 2,'AC_FAX','system','Send Fax',NULL, 1, 3); insert into llx_c_actioncomm (id, code, type, libelle, module, active, position) values ( 2,'AC_FAX','system','Send Fax',NULL, 1, 3);
insert into llx_c_actioncomm (id, code, type, libelle, module, active, position) values ( 4,'AC_EMAIL','system','Send Email',NULL, 1, 4); insert into llx_c_actioncomm (id, code, type, libelle, module, active, position) values ( 4,'AC_EMAIL','system','Send Email',NULL, 1, 4);
insert into llx_c_actioncomm (id, code, type, libelle, module, active, position) values ( 5,'AC_RDV','system','Rendez-vous',NULL, 1, 1); insert into llx_c_actioncomm (id, code, type, libelle, module, active, position) values ( 5,'AC_RDV','system','Rendez-vous',NULL, 1, 1);
insert into llx_c_actioncomm (id, code, type, libelle, module, active, position) values (11,'AC_INT','system','Intervention on site',NULL, 1, 4);
-- Code kept for backward compatibility < 3.3 -- Code kept for backward compatibility < 3.3
insert into llx_c_actioncomm (id, code, type, libelle, module, active, position) values ( 3,'AC_PROP','systemauto', 'Send commercial proposal by email','propal',0,10); insert into llx_c_actioncomm (id, code, type, libelle, module, active, position) values ( 3,'AC_PROP','systemauto', 'Send commercial proposal by email','propal',0,10);
insert into llx_c_actioncomm (id, code, type, libelle, module, active, position) values ( 8,'AC_COM','systemauto','Send customer order by email','order', 0,8); insert into llx_c_actioncomm (id, code, type, libelle, module, active, position) values ( 8,'AC_COM','systemauto','Send customer order by email','order', 0,8);

File diff suppressed because it is too large Load Diff

View File

@ -11,15 +11,19 @@
-- To drop a foreign key: ALTER TABLE llx_table DROP FOREIGN KEY fk_name; -- To drop a foreign key: ALTER TABLE llx_table DROP FOREIGN KEY fk_name;
-- To restrict request to Mysql version x.y use -- VMYSQLx.y -- To restrict request to Mysql version x.y use -- VMYSQLx.y
-- To restrict request to Pgsql version x.y use -- VPGSQLx.y -- To restrict request to Pgsql version x.y use -- VPGSQLx.y
-- To make pk to be auto increment (mysql): VMYSQL4.3 ALTER TABLE llx_c_shipment_mode CHANGE COLUMN rowid rowid INTEGER NOT NULL AUTO_INCREMENT; -- To make pk to be auto increment (mysql): VMYSQL4.3 ALTER TABLE llx_c_shipment_mode CHANGE COLUMN rowid rowid INTEGER NOT NULL AUTO_INCREMENT;
-- To make pk to be auto increment (postgres) VPGSQL8.2 NOT POSSIBLE. MUST DELETE/CREATE TABLE -- To make pk to be auto increment (postgres): VPGSQL8.2 NOT POSSIBLE. MUST DELETE/CREATE TABLE
-- To set a field as NULL: VPGSQL8.2 ALTER TABLE llx_table ALTER COLUMN name DROP NOT NULL;
-- To set a field as defailt NULL: VPGSQL8.2 ALTER TABLE llx_table ALTER COLUMN name SET DEFAULT NULL;
-- -- VPGSQL8.2 DELETE FROM llx_usergroup_user WHERE fk_user NOT IN (SELECT rowid from llx_user); -- -- VPGSQL8.2 DELETE FROM llx_usergroup_user WHERE fk_user NOT IN (SELECT rowid from llx_user);
-- -- VMYSQL4.1 DELETE FROM llx_usergroup_user WHERE fk_usergroup NOT IN (SELECT rowid from llx_usergroup); -- -- VMYSQL4.1 DELETE FROM llx_usergroup_user WHERE fk_usergroup NOT IN (SELECT rowid from llx_usergroup);
ALTER TABLE llx_c_paiement ADD COLUMN accountancy_code varchar(32) DEFAULT NULL AFTER active; ALTER TABLE llx_c_paiement ADD COLUMN accountancy_code varchar(32) DEFAULT NULL AFTER active;
insert into llx_c_action_trigger (rowid,code,label,description,elementtype,rang) values (29,'FICHINTER_CLASSIFY_BILLED','Classify intervention as billed','Executed when a intervention is classified as billed (when option FICHINTER_DISABLE_DETAILS is set)','ficheinter',19);
insert into llx_c_actioncomm (id, code, type, libelle, module, active, position) values (11,'AC_INT','system','Intervention on site',NULL, 1, 4);
ALTER TABLE llx_accountingaccount add column entity integer DEFAULT 1 NOT NULL AFTER rowid; ALTER TABLE llx_accountingaccount add column entity integer DEFAULT 1 NOT NULL AFTER rowid;
ALTER TABLE llx_accountingaccount add column datec datetime NOT NULL AFTER entity; ALTER TABLE llx_accountingaccount add column datec datetime NOT NULL AFTER entity;
@ -64,15 +68,21 @@ ALTER TABLE llx_societe ADD COLUMN localtax2_value double(6,3) after localtax2_a
-- Added missing relations of llx_product -- Added missing relations of llx_product
-- fk_country -- fk_country
ALTER TABLE llx_product CHANGE COLUMN fk_country fk_country INTEGER NULL DEFAULT NULL; ALTER TABLE llx_product MODIFY COLUMN fk_country INTEGER NULL DEFAULT NULL;
-- VPGSQL8.2 ALTER TABLE llx_product ALTER COLUMN fk_country DROP NOT NULL;
-- VPGSQL8.2 ALTER TABLE llx_product ALTER COLUMN fk_country SET DEFAULT NULL;
UPDATE llx_product SET fk_country = NULL WHERE fk_country = 0; UPDATE llx_product SET fk_country = NULL WHERE fk_country = 0;
ALTER TABLE llx_product ADD INDEX idx_product_fk_country (fk_country); ALTER TABLE llx_product ADD INDEX idx_product_fk_country (fk_country);
ALTER TABLE llx_product ADD CONSTRAINT fk_product_fk_country FOREIGN KEY (fk_country) REFERENCES llx_c_pays (rowid); ALTER TABLE llx_product ADD CONSTRAINT fk_product_fk_country FOREIGN KEY (fk_country) REFERENCES llx_c_pays (rowid);
-- fk_user_author -- fk_user_author
ALTER TABLE llx_product CHANGE COLUMN fk_user_author fk_user_author INTEGER NULL DEFAULT NULL; ALTER TABLE llx_product MODIFY COLUMN fk_user_author INTEGER NULL DEFAULT NULL;
-- VPGSQL8.2 ALTER TABLE llx_product ALTER COLUMN fk_user_author DROP NOT NULL;
-- VPGSQL8.2 ALTER TABLE llx_product ALTER COLUMN fk_user_author SET DEFAULT NULL;
ALTER TABLE llx_product ADD INDEX idx_product_fk_user_author (fk_user_author); ALTER TABLE llx_product ADD INDEX idx_product_fk_user_author (fk_user_author);
-- fk_barcode_type -- fk_barcode_type
ALTER TABLE llx_product CHANGE COLUMN fk_barcode_type fk_barcode_type INTEGER NULL DEFAULT NULL; ALTER TABLE llx_product MODIFY COLUMN fk_barcode_type INTEGER NULL DEFAULT NULL;
-- VPGSQL8.2 ALTER TABLE llx_product ALTER COLUMN fk_barcode_type DROP NOT NULL;
-- VPGSQL8.2 ALTER TABLE llx_product ALTER COLUMN fk_barcode_type SET DEFAULT NULL;
UPDATE llx_product SET fk_barcode_type = NULL WHERE fk_barcode_type = 0; UPDATE llx_product SET fk_barcode_type = NULL WHERE fk_barcode_type = 0;
ALTER TABLE llx_product ADD INDEX idx_product_fk_barcode_type (fk_barcode_type); ALTER TABLE llx_product ADD INDEX idx_product_fk_barcode_type (fk_barcode_type);
ALTER TABLE llx_product ADD CONSTRAINT fk_product_barcode_type FOREIGN KEY (fk_barcode_type) REFERENCES llx_c_barcode_type (rowid); ALTER TABLE llx_product ADD CONSTRAINT fk_product_barcode_type FOREIGN KEY (fk_barcode_type) REFERENCES llx_c_barcode_type (rowid);
@ -90,3 +100,18 @@ ALTER TABLE llx_product_price ADD CONSTRAINT fk_product_price_product FOREIGN K
ALTER TABLE llx_commande_fournisseur ADD COLUMN fk_account integer AFTER date_livraison; ALTER TABLE llx_commande_fournisseur ADD COLUMN fk_account integer AFTER date_livraison;
ALTER TABLE llx_facture_fourn ADD COLUMN fk_account integer AFTER fk_projet; ALTER TABLE llx_facture_fourn ADD COLUMN fk_account integer AFTER fk_projet;
-- Fiscal years
create table llx_accounting_fiscalyear
(
rowid integer AUTO_INCREMENT PRIMARY KEY,
label varchar(128) NOT NULL,
date_start date,
date_end date,
statut tinyint DEFAULT 0 NOT NULL,
entity integer DEFAULT 1 NOT NULL, -- multi company id
datec datetime NOT NULL,
tms timestamp,
fk_user_author integer NULL,
fk_user_modif integer NULL
)ENGINE=innodb;

View File

@ -0,0 +1,31 @@
-- ============================================================================
-- Copyright (C) 2014 Alexandre Spangaro <alexandre.spangaro@gmail.com>
--
-- This program is free software; you can redistribute it and/or modify
-- it under the terms of the GNU General Public License as published by
-- the Free Software Foundation; either version 3 of the License, or
-- (at your option) any later version.
--
-- This program is distributed in the hope that it will be useful,
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-- GNU General Public License for more details.
--
-- You should have received a copy of the GNU General Public License
-- along with this program. If not, see <http://www.gnu.org/licenses/>.
--
-- ============================================================================
create table llx_accounting_fiscalyear
(
rowid integer AUTO_INCREMENT PRIMARY KEY,
label varchar(128) NOT NULL,
date_start date,
date_end date,
statut tinyint DEFAULT 0 NOT NULL,
entity integer DEFAULT 1 NOT NULL, -- multi company id
datec datetime NOT NULL,
tms timestamp,
fk_user_author integer DEFAULT NULL,
fk_user_modif integer DEFAULT NULL
)ENGINE=innodb;

View File

@ -14,6 +14,9 @@
-- You should have received a copy of the GNU General Public License -- You should have received a copy of the GNU General Public License
-- along with this program. If not, see <http://www.gnu.org/licenses/>. -- along with this program. If not, see <http://www.gnu.org/licenses/>.
-- --
-- This table is a list of all available possible automatic actions
-- It is read only by admin page to select action code and save them
-- into llx_const with name MAIN_AGENDA_ACTIONAUTO_XXX_YYY.
-- =================================================================== -- ===================================================================
create table llx_c_action_trigger create table llx_c_action_trigger
@ -24,5 +27,4 @@ create table llx_c_action_trigger
description varchar(255), description varchar(255),
elementtype varchar(16) NOT NULL, elementtype varchar(16) NOT NULL,
rang integer DEFAULT 0 rang integer DEFAULT 0
)ENGINE=innodb; )ENGINE=innodb;

View File

@ -16,4 +16,4 @@
-- --
-- ============================================================================ -- ============================================================================
ALTER TABLE llx_expeditiondet_batch ADD INDEX ix_fk_expeditiondet (fk_expeditiondet); ALTER TABLE llx_expeditiondet_batch ADD INDEX ix_fk_expeditiondet (fk_expeditiondet);
ALTER TABLE llx_expeditiondet_batch ADD CONSTRAINT fk_expeditiondet_batch_fk_expeditiondet FOREIGN KEY (fk_expeditiondet) REFERENCES llx_expeditiondet (rowid) ON DELETE CASCADE; ALTER TABLE llx_expeditiondet_batch ADD CONSTRAINT fk_expeditiondet_batch_fk_expeditiondet FOREIGN KEY (fk_expeditiondet) REFERENCES llx_expeditiondet(rowid);

View File

@ -21,7 +21,7 @@ create table llx_localtax
( (
rowid integer AUTO_INCREMENT PRIMARY KEY, rowid integer AUTO_INCREMENT PRIMARY KEY,
entity integer DEFAULT 1 NOT NULL, entity integer DEFAULT 1 NOT NULL,
localtaxtype tinyint(4), localtaxtype tinyint,
tms timestamp, tms timestamp,
datep date, -- date of payment datep date, -- date of payment
datev date, -- date of value datev date, -- date of value
@ -31,5 +31,4 @@ create table llx_localtax
fk_bank integer, fk_bank integer,
fk_user_creat integer, fk_user_creat integer,
fk_user_modif integer fk_user_modif integer
)ENGINE=innodb; )ENGINE=innodb;

View File

@ -16,4 +16,4 @@
-- --
-- ============================================================================ -- ============================================================================
ALTER TABLE llx_product_batch ADD INDEX ix_fk_product_stock (fk_product_stock); ALTER TABLE llx_product_batch ADD INDEX ix_fk_product_stock (fk_product_stock);
ALTER TABLE llx_product_batch ADD CONSTRAINT fk_product_batch_fk_product_stock FOREIGN KEY (fk_product_stock) REFERENCES llx_product_stock (rowid) ON DELETE CASCADE; ALTER TABLE llx_product_batch ADD CONSTRAINT fk_product_batch_fk_product_stock FOREIGN KEY (fk_product_stock) REFERENCES llx_product_stock (rowid);

View File

@ -1516,6 +1516,17 @@ TaskModelModule=Tasks reports document model
##### ECM (GED) ##### ##### ECM (GED) #####
ECMSetup = GED Setup ECMSetup = GED Setup
ECMAutoTree = Automatic tree folder and document ECMAutoTree = Automatic tree folder and document
##### Fiscal Year #####
FiscalYears=Fiscal years
FiscalYear=Fiscal year
FiscalYearCard=Fiscal year card
NewFiscalYear=New fiscal year
EditFiscalYear=Edit fiscal year
OpenFiscalYear=Open fiscal year
CloseFiscalYear=Close fiscal year
DeleteFiscalYear=Delete fiscal year
ConfirmDeleteFiscalYear=Are you sure to delete this fiscal year ?
Opened=Opened
Closed=Closed
Format=Format Format=Format

View File

@ -58,6 +58,7 @@ SupplierInvoiceSentByEMail=Supplier invoice %s sent by EMail
ShippingSentByEMail=Shipping %s sent by EMail ShippingSentByEMail=Shipping %s sent by EMail
ShippingValidated= Shipping %s validated ShippingValidated= Shipping %s validated
InterventionSentByEMail=Intervention %s sent by EMail InterventionSentByEMail=Intervention %s sent by EMail
InterventionClassifiedBilled=Intervention %s classified as Billed
NewCompanyToDolibarr= Third party created NewCompanyToDolibarr= Third party created
DateActionPlannedStart= Planned start date DateActionPlannedStart= Planned start date
DateActionPlannedEnd= Planned end date DateActionPlannedEnd= Planned end date

View File

@ -71,6 +71,7 @@ ActionAC_FAX=Send fax
ActionAC_PROP=Send proposal by mail ActionAC_PROP=Send proposal by mail
ActionAC_EMAIL=Send Email ActionAC_EMAIL=Send Email
ActionAC_RDV=Meetings ActionAC_RDV=Meetings
ActionAC_INT=Intervention on site
ActionAC_FAC=Send customer invoice by mail ActionAC_FAC=Send customer invoice by mail
ActionAC_REL=Send customer invoice by mail (reminder) ActionAC_REL=Send customer invoice by mail (reminder)
ActionAC_CLO=Close ActionAC_CLO=Close

View File

@ -1503,6 +1503,17 @@ TaskModelModule=Modèles de document de rapport tâches
##### ECM (GED) ##### ##### ECM (GED) #####
ECMSetup = Configuration du module GED ECMSetup = Configuration du module GED
ECMAutoTree = L'arborescence automatique est disponible ECMAutoTree = L'arborescence automatique est disponible
##### Fiscal Year #####
FiscalYears=Exercices fiscaux
FiscalYear=Exercice fiscal
FiscalYearCard=Fiche exercice fiscal
NewFiscalYear=Nouvel exercice fiscal
EditFiscalYear=Editer exercice fiscal
OpenFiscalYear=Exercice fiscal ouvert
CloseFiscalYear=Exercice fiscal fermé
DeleteFiscalYear=Supprimer exercice fiscal
ConfirmDeleteFiscalYear=Êtes-vous sûr de vouloir supprimer cet exercice fiscal ?
Opened=Ouvert
Closed=Fermé
Format=Format Format=Format

View File

@ -448,7 +448,7 @@ if (! defined('NOLOGIN'))
$dol_tz=$_POST["tz"]; $dol_tz=$_POST["tz"];
$dol_tz_string=$_POST["tz_string"]; $dol_tz_string=$_POST["tz_string"];
$dol_tz_string=preg_replace('/\s*\(.+\)$/','',$dol_tz_string); $dol_tz_string=preg_replace('/\s*\(.+\)$/','',$dol_tz_string);
$dol_tz_string=preg_replace('/,/' ,'/',$dol_tz_string); $dol_tz_string=preg_replace('/,/','/',$dol_tz_string);
$dol_tz_string=preg_replace('/\s/','_',$dol_tz_string); $dol_tz_string=preg_replace('/\s/','_',$dol_tz_string);
$dol_dst=0; $dol_dst=0;
if (isset($_POST["dst_first"]) && isset($_POST["dst_second"])) if (isset($_POST["dst_first"]) && isset($_POST["dst_second"]))

View File

@ -1391,6 +1391,14 @@ class Product extends CommonObject
$this->db->free($resql); $this->db->free($resql);
// Retreive all extrafield for thirdparty
// fetch optionals attributes and labels
require_once(DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php');
$extrafields=new ExtraFields($this->db);
$extralabels=$extrafields->fetch_name_optionals_label($this->table_element,true);
$this->fetch_optionals($this->id,$extralabels);
// multilangs // multilangs
if (! empty($conf->global->MAIN_MULTILANGS)) $this->getMultiLangs(); if (! empty($conf->global->MAIN_MULTILANGS)) $this->getMultiLangs();

View File

@ -1014,8 +1014,6 @@ else
else if ($object->id > 0) else if ($object->id > 0)
{ {
$res=$object->fetch_optionals($object->id,$extralabels);
// Fiche en mode edition // Fiche en mode edition
if ($action == 'edit' && ($user->rights->produit->creer || $user->rights->service->creer)) if ($action == 'edit' && ($user->rights->produit->creer || $user->rights->service->creer))
{ {

View File

@ -1230,4 +1230,85 @@ class Task extends CommonObject
} }
} }
/**
* Return status label of object
*
* @param string $mode 0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=Short label + Picto
* @return string Label
*/
function getLibStatut($mode=0)
{
return $this->LibStatut($this->fk_statut,$mode);
}
/**
* Return status label for an object
*
* @param int $statut Id statut
* @param string $mode 0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=Short label + Picto
* @return string Label
*/
function LibStatut($statut,$mode=0)
{
// list of Statut of the task
$this->statuts[0]='Draft';
$this->statuts[1]='Validated';
$this->statuts[2]='Running';
$this->statuts[3]='Finish';
$this->statuts[4]='Transfered';
$this->statuts_short[0]='Draft';
$this->statuts_short[1]='Validated';
$this->statuts_short[2]='Running';
$this->statuts_short[3]='Finish';
$this->statuts_short[4]='Transfered';
global $langs;
if ($mode == 0)
{
return $langs->trans($this->statuts[$statut]);
}
if ($mode == 1)
{
return $langs->trans($this->statuts_short[$statut]);
}
if ($mode == 2)
{
if ($statut==0) return img_picto($langs->trans($this->statuts_short[$statut]),'statut0').' '.$langs->trans($this->statuts_short[$statut]);
if ($statut==1) return img_picto($langs->trans($this->statuts_short[$statut]),'statut1').' '.$langs->trans($this->statuts_short[$statut]);
if ($statut==2) return img_picto($langs->trans($this->statuts_short[$statut]),'statut3').' '.$langs->trans($this->statuts_short[$statut]);
if ($statut==3) return img_picto($langs->trans($this->statuts_short[$statut]),'statut4').' '.$langs->trans($this->statuts_short[$statut]);
if ($statut==4) return img_picto($langs->trans($this->statuts_short[$statut]),'statut6').' '.$langs->trans($this->statuts_short[$statut]);
if ($statut==5) return img_picto($langs->trans($this->statuts_short[$statut]),'statut5').' '.$langs->trans($this->statuts_short[$statut]);
}
if ($mode == 3)
{
if ($statut==0) return img_picto($langs->trans($this->statuts_short[$statut]),'statut0');
if ($statut==1) return img_picto($langs->trans($this->statuts_short[$statut]),'statut1');
if ($statut==2) return img_picto($langs->trans($this->statuts_short[$statut]),'statut3');
if ($statut==3) return img_picto($langs->trans($this->statuts_short[$statut]),'statut4');
if ($statut==4) return img_picto($langs->trans($this->statuts_short[$statut]),'statut6');
if ($statut==5) return img_picto($langs->trans($this->statuts_short[$statut]),'statut5');
}
if ($mode == 4)
{
if ($statut==0) return img_picto($langs->trans($this->statuts_short[$statut]),'statut0').' '.$langs->trans($this->statuts[$statut]);
if ($statut==1) return img_picto($langs->trans($this->statuts_short[$statut]),'statut1').' '.$langs->trans($this->statuts[$statut]);
if ($statut==2) return img_picto($langs->trans($this->statuts_short[$statut]),'statut3').' '.$langs->trans($this->statuts[$statut]);
if ($statut==3) return img_picto($langs->trans($this->statuts_short[$statut]),'statut4').' '.$langs->trans($this->statuts[$statut]);
if ($statut==4) return img_picto($langs->trans($this->statuts_short[$statut]),'statut6').' '.$langs->trans($this->statuts[$statut]);
if ($statut==5) return img_picto($langs->trans($this->statuts_short[$statut]),'statut5').' '.$langs->trans($this->statuts[$statut]);
}
if ($mode == 5)
{
if ($statut==0) return $langs->trans($this->statuts_short[$statut]).' '.img_picto($langs->trans($this->statuts_short[$statut]),'statut0');
if ($statut==1) return $langs->trans($this->statuts_short[$statut]).' '.img_picto($langs->trans($this->statuts_short[$statut]),'statut1');
if ($statut==2) return $langs->trans($this->statuts_short[$statut]).' '.img_picto($langs->trans($this->statuts_short[$statut]),'statut3');
if ($statut==3) return $langs->trans($this->statuts_short[$statut]).' '.img_picto($langs->trans($this->statuts_short[$statut]),'statut4');
if ($statut==4) return $langs->trans($this->statuts_short[$statut]).' '.img_picto($langs->trans($this->statuts_short[$statut]),'statut6');
if ($statut==5) return $langs->trans($this->statuts_short[$statut]).' '.img_picto($langs->trans($this->statuts_short[$statut]),'statut5');
}
}
} }

View File

@ -149,11 +149,15 @@ class SqlTest extends PHPUnit_Framework_TestCase
$result=strpos($filecontent,'`'); $result=strpos($filecontent,'`');
print __METHOD__." Result for checking we don't have back quote = ".$result."\n"; print __METHOD__." Result for checking we don't have back quote = ".$result."\n";
$this->assertTrue($result===false); $this->assertTrue($result===false, 'Found ON back quote. Bad.');
$result=strpos($filecontent,'int('); $result=strpos($filecontent,'int(');
print __METHOD__." Result for checking we don't have back 'int(' instead of integer = ".$result."\n"; print __METHOD__." Result for checking we don't have 'int(' instead of 'integer' = ".$result."\n";
$this->assertTrue($result===false); $this->assertTrue($result===false, 'Found int(x) instead of integer. Bad.');
$result=strpos($filecontent,'ON DELETE CASCADE');
print __METHOD__." Result for checking we don't have 'ON DELETE CASCADE' = ".$result."\n";
$this->assertTrue($result===false, 'Found ON DELETE CASCADE. Bad.');
} }
return; return;