Merge remote-tracking branch 'Upstream/develop' into develop-admin

This commit is contained in:
aspangaro 2014-11-23 13:50:17 +01:00
commit c80bc52f5c
225 changed files with 7011 additions and 1686 deletions

View File

@ -180,8 +180,38 @@ tools:
- 'htdocs/includes/*' - 'htdocs/includes/*'
paths: { } paths: { }
php_changetracking:
enabled: false
bug_patterns:
- '\bfix(?:es|ed)?\b'
feature_patterns:
- '\badd(?:s|ed)?\b'
- '\bimplement(?:s|ed)?\b'
filter:
excluded_paths:
- 'build/*'
- 'dev/*'
- 'doc/*'
- 'test/*'
- 'htdocs/includes/*'
paths: { }
# Coding-Style / Bug Detection # Coding-Style / Bug Detection
js_hint: false js_hint:
enabled: false
use_native_config: true
extensions:
- js
filter:
excluded_paths:
- 'build/*'
- 'dev/*'
- 'doc/*'
- 'test/*'
- 'htdocs/includes/*'
paths: { }
config: { }
path_configs: { }
before_commands: { } before_commands: { }

View File

@ -26,7 +26,7 @@ TCPDF 6.0.093 LGPL-3+ Yes
JS libraries: JS libraries:
jQuery 1.8.2 MIT License Yes JS library jQuery 1.8.2 MIT License Yes JS library
jQuery UI 1.9.1 GPL and MIT License Yes JS library plugin UI jQuery UI 1.9.1 GPL and MIT License Yes JS library plugin UI
jQuery multiple-select 1.1.0 MIT License Yes JS library plugin for sexier multiselect jQuery select2 3.5.2 GPL and Apache License Yes JS library plugin for sexier multiselect
jQuery blockUI 2.43 GPL and MIT License Yes JS library plugin blockUI (to use ajax popups) jQuery blockUI 2.43 GPL and MIT License Yes JS library plugin blockUI (to use ajax popups)
jQuery Colorpicker 1.1 MIT License Yes JS library for color picker for a defined list of colors jQuery Colorpicker 1.1 MIT License Yes JS library for color picker for a defined list of colors
jQuery DataTables 1.9.4 BSD Yes JS library for tables output jQuery DataTables 1.9.4 BSD Yes JS library for tables output

View File

@ -5,6 +5,8 @@ English Dolibarr ChangeLog
***** ChangeLog for 3.7 compared to 3.6.* ***** ***** ChangeLog for 3.7 compared to 3.6.* *****
For users: For users:
- New: Match other auth system: Login can be done entering login or user
email (this open the road for SSO).
- New: Agenda export by project #1967. - New: Agenda export by project #1967.
- New: Increase length of thirdparty to 128 chars. - New: Increase length of thirdparty to 128 chars.
- New: "Is Order shippable" icon #1975. - New: "Is Order shippable" icon #1975.

View File

@ -4867,7 +4867,7 @@ CREATE TABLE `llx_opensurvey_sondage` (
`mailsonde` tinyint(4) NOT NULL DEFAULT '0', `mailsonde` tinyint(4) NOT NULL DEFAULT '0',
`survey_link_visible` int(11) DEFAULT '1', `survey_link_visible` int(11) DEFAULT '1',
`origin` varchar(64) DEFAULT NULL, `origin` varchar(64) DEFAULT NULL,
`tms` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', `tms` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY (`id_sondage`), PRIMARY KEY (`id_sondage`),
KEY `idx_id_sondage_admin` (`id_sondage_admin`), KEY `idx_id_sondage_admin` (`id_sondage_admin`),
KEY `idx_date_fin` (`date_fin`) KEY `idx_date_fin` (`date_fin`)

View File

@ -182,7 +182,7 @@ class Skeleton_Class extends CommonObject
* @param int $notrigger 0=launch triggers after, 1=disable triggers * @param int $notrigger 0=launch triggers after, 1=disable triggers
* @return int <0 if KO, >0 if OK * @return int <0 if KO, >0 if OK
*/ */
function update($user=0, $notrigger=0) function update($user, $notrigger=0)
{ {
global $conf, $langs; global $conf, $langs;
$error=0; $error=0;

View File

@ -90,7 +90,7 @@ $form = new Form($db);
$linkback='<a href="'.DOL_URL_ROOT.'/admin/modules.php">'.$langs->trans("BackToModuleList").'</a>'; $linkback='<a href="'.DOL_URL_ROOT.'/admin/modules.php">'.$langs->trans("BackToModuleList").'</a>';
print_fiche_titre($langs->trans('ConfigAccountingExpert'),$linkback,'setup'); print_fiche_titre($langs->trans('ConfigAccountingExpert'),$linkback,'setup');
$head = admin_accounting_prepare_head(null); $head = admin_accounting_prepare_head();
dol_fiche_head($head, 'export', $langs->trans("Configuration"), 0, 'cron'); dol_fiche_head($head, 'export', $langs->trans("Configuration"), 0, 'cron');

View File

@ -59,10 +59,10 @@ $max=100;
$form = new Form($db); $form = new Form($db);
llxHeader('',$title);
$title = $langs->trans('FiscalYears'); $title = $langs->trans('FiscalYears');
llxHeader('',$title,LOG_ERR);
print_fiche_titre($langs->trans('FiscalYears')); print_fiche_titre($langs->trans('FiscalYears'));
$sql = "SELECT f.rowid, f.label, f.date_start, f.date_end, f.statut, f.entity"; $sql = "SELECT f.rowid, f.label, f.date_start, f.date_end, f.statut, f.entity";

View File

@ -25,12 +25,13 @@
*/ */
/** /**
* Classe permettant la gestion des comptes generaux de compta * Class to manage accounting accounts
*/ */
class AccountingAccount class AccountingAccount
{ {
var $db; var $db;
var $error; var $error;
var $errors;
var $id; var $id;
var $rowid; var $rowid;
@ -126,6 +127,8 @@ class AccountingAccount
global $conf, $langs; global $conf, $langs;
$error = 0; $error = 0;
$now=dol_now();
// Clean parameters // Clean parameters
if (isset($this->fk_pcg_version)) if (isset($this->fk_pcg_version))
$this->fk_pcg_version = trim($this->fk_pcg_version); $this->fk_pcg_version = trim($this->fk_pcg_version);

View File

@ -30,6 +30,9 @@
class BookKeeping class BookKeeping
{ {
var $db; var $db;
var $error;
var $errors;
var $id; var $id;
var $doc_date; var $doc_date;
var $doc_type; var $doc_type;

View File

@ -58,8 +58,10 @@ if ($user->societe_id > 0)
$action = GETPOST('action'); $action = GETPOST('action');
/* /*
* View * Actions
*/ */
$year_current = strftime("%Y", dol_now()); $year_current = strftime("%Y", dol_now());
@ -152,9 +154,6 @@ if ($result) {
dol_print_error($db); dol_print_error($db);
} }
/*
* Actions
*/
// Bookkeeping Write // Bookkeeping Write
if ($action == 'writebookkeeping') { if ($action == 'writebookkeeping') {
$now = dol_now(); $now = dol_now();
@ -237,9 +236,16 @@ if ($action == 'writebookkeeping') {
} }
} }
// export csv
if ($action == 'export_csv') { /*
* View
*/
$companystatic = new Societe($db);
// export csv
if ($action == 'export_csv')
{
$sep = $conf->global->ACCOUNTING_SEPARATORCSV; $sep = $conf->global->ACCOUNTING_SEPARATORCSV;
header('Content-Type: text/csv'); header('Content-Type: text/csv');

View File

@ -70,7 +70,7 @@ $extralabels=$extrafields->fetch_name_optionals_label($object->table_element);
// Get object canvas (By default, this is not defined, so standard usage of dolibarr) // Get object canvas (By default, this is not defined, so standard usage of dolibarr)
$object->getCanvas($rowid); $object->getCanvas($rowid);
$canvas = $object->canvas?$object->canvas:GETPOST("canvas"); $canvas = $object->canvas?$object->canvas:GETPOST("canvas");
$objcanvas=''; $objcanvas=null;
if (! empty($canvas)) if (! empty($canvas))
{ {
require_once DOL_DOCUMENT_ROOT.'/core/class/canvas.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/canvas.class.php';
@ -79,7 +79,7 @@ if (! empty($canvas))
} }
// Security check // Security check
$result=restrictedArea($user,'adherent',$rowid,'','','fk_soc', 'rowid', $objcanvas); $result=restrictedArea($user, 'adherent', $rowid, '', '', 'fk_soc', 'rowid', $objcanvas);
if ($rowid > 0) if ($rowid > 0)
{ {
@ -291,8 +291,6 @@ if ($action == 'update' && ! $_POST["cancel"] && $user->rights->adherent->creer)
//$object->note = trim($_POST["comment"]); //$object->note = trim($_POST["comment"]);
$object->morphy = $_POST["morphy"]; $object->morphy = $_POST["morphy"];
$object->amount = $_POST["amount"];
if (GETPOST('deletephoto')) $object->photo=''; if (GETPOST('deletephoto')) $object->photo='';
elseif (! empty($_FILES['photo']['name'])) $object->photo = dol_sanitizeFileName($_FILES['photo']['name']); elseif (! empty($_FILES['photo']['name'])) $object->photo = dol_sanitizeFileName($_FILES['photo']['name']);

View File

@ -465,8 +465,11 @@ class Adherent extends CommonObject
$nbrowsaffected+=$this->db->affected_rows($resql); $nbrowsaffected+=$this->db->affected_rows($resql);
$action='update';
// Actions on extra fields (by external module) // Actions on extra fields (by external module)
$hookmanager->initHooks(array('memberdao')); // FIXME le hook fait double emploi avec le trigger !!
$hookmanager->initHooks(array('memberdao'));
$parameters=array('id'=>$this->id); $parameters=array('id'=>$this->id);
$action=''; $action='';
$reshook=$hookmanager->executeHooks('insertExtraFields',$parameters,$this,$action); // Note that $action and $object may have been modified by some hooks $reshook=$hookmanager->executeHooks('insertExtraFields',$parameters,$this,$action); // Note that $action and $object may have been modified by some hooks

View File

@ -453,8 +453,8 @@ if (GETPOST('actionadd') || GETPOST('actionmodify'))
$ok=1; $ok=1;
foreach ($listfield as $f => $value) foreach ($listfield as $f => $value)
{ {
if ($value == 'country_id' && in_array($tablib[$id],array('DictionaryVAT','DictionaryRegion','DictionaryCompanyType'))) continue; // For some pages, country is not mandatory
if ($value == 'country' && in_array($tablib[$id],array('DictionaryCanton','DictionaryCompanyType'))) continue; // For some pages, country is not mandatory if ($value == 'country' && in_array($tablib[$id],array('DictionaryCanton','DictionaryCompanyType'))) continue; // For some pages, country is not mandatory
if ($value == 'country_id' && in_array($tablib[$id],array('DictionaryRegion','DictionaryCompanyType'))) continue; // For some pages, country is not mandatory
if ($value == 'localtax1' && empty($_POST['localtax1_type'])) continue; if ($value == 'localtax1' && empty($_POST['localtax1_type'])) continue;
if ($value == 'localtax2' && empty($_POST['localtax2_type'])) continue; if ($value == 'localtax2' && empty($_POST['localtax2_type'])) continue;
if ($value == 'color' && empty($_POST['color'])) continue; if ($value == 'color' && empty($_POST['color'])) continue;
@ -1361,14 +1361,18 @@ function fieldList($fieldlist,$obj='',$tabname='')
continue; continue;
} // For state page, we do not show the country input (we link to region, not country) } // For state page, we do not show the country input (we link to region, not country)
print '<td>'; print '<td>';
print $form->select_country((! empty($obj->country_code)?$obj->country_code:(! empty($obj->country)?$obj->country:'')), 'country', '', 28); $fieldname='country';
print $form->select_country((! empty($obj->country_code)?$obj->country_code:(! empty($obj->country)?$obj->country:'')), $fieldname, '', 28);
print '</td>'; print '</td>';
} }
elseif ($fieldlist[$field] == 'country_id') { elseif ($fieldlist[$field] == 'country_id') {
$country_id = (! empty($obj->$fieldlist[$field]) ? $obj->$fieldlist[$field] : 0); if (! in_array('country',$fieldlist)) // If there is already a field country, we don't show country_id (avoid duplicate)
print '<td>'; {
print '<input type="hidden" name="'.$fieldlist[$field].'" value="'.$country_id.'">'; $country_id = (! empty($obj->$fieldlist[$field]) ? $obj->$fieldlist[$field] : 0);
print '</td>'; print '<td>';
print '<input type="hidden" name="'.$fieldlist[$field].'" value="'.$country_id.'">';
print '</td>';
}
} }
elseif ($fieldlist[$field] == 'region') { elseif ($fieldlist[$field] == 'region') {
print '<td>'; print '<td>';

View File

@ -37,6 +37,8 @@ $typeconst=array('yesno','texte','chaine');
$action = GETPOST('action','alpha'); $action = GETPOST('action','alpha');
$type='donation';
/* /*
* Action * Action

View File

@ -78,15 +78,16 @@ print_fiche_titre($langs->trans("SecuritySetup"),'','setup');
print $langs->trans("LogEventDesc")."<br>\n"; print $langs->trans("LogEventDesc")."<br>\n";
print "<br>\n"; print "<br>\n";
$head=security_prepare_head();
dol_fiche_head($head, 'audit', $langs->trans("Security"));
print '<form action="'.$_SERVER["PHP_SELF"].'" method="POST">'; print '<form action="'.$_SERVER["PHP_SELF"].'" method="POST">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">'; print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<input type="hidden" name="action" value="save">'; print '<input type="hidden" name="action" value="save">';
$head=security_prepare_head();
dol_fiche_head($head, 'audit', $langs->trans("Security"));
$var=true; $var=true;
print "<table class=\"noborder\" width=\"100%\">"; print "<table class=\"noborder\" width=\"100%\">";
print "<tr class=\"liste_titre\">"; print "<tr class=\"liste_titre\">";
@ -109,14 +110,14 @@ foreach ($eventstolog as $key => $arr)
} }
print '</table>'; print '</table>';
print '<br><center>'; dol_fiche_end();
print '<div class="center">';
print "<input type=\"submit\" name=\"save\" class=\"button\" value=\"".$langs->trans("Save")."\">"; print "<input type=\"submit\" name=\"save\" class=\"button\" value=\"".$langs->trans("Save")."\">";
print "</center>"; print "</div>";
print "</form>\n"; print "</form>\n";
print '</div>';
$db->close();
llxFooter(); llxFooter();
$db->close();

View File

@ -142,7 +142,7 @@ if ($action == 'edit') // Edit
print '</table><br>'."\n"; print '</table><br>'."\n";
// Themes // Themes
show_theme('',1); show_theme(null,1);
print '<br>'; print '<br>';
// Liste des zone de recherche permanantes supportees // Liste des zone de recherche permanantes supportees
@ -323,7 +323,7 @@ else // Show
// Themes // Themes
show_theme('',0); show_theme(null,0);
print '<br>'; print '<br>';

View File

@ -26,7 +26,6 @@
require '../main.inc.php'; require '../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formadmin.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formadmin.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
$action=GETPOST('action'); $action=GETPOST('action');

View File

@ -326,6 +326,7 @@ if ($conf->use_javascript_ajax)
'<a href="edit.php?menu_handler='.$menu_handler_to_search.'&action=edit&menuId='.$menu['rowid'].'">'.img_edit('default',0,'class="menuEdit" id="edit'.$menu['rowid'].'"').'</a> '. '<a href="edit.php?menu_handler='.$menu_handler_to_search.'&action=edit&menuId='.$menu['rowid'].'">'.img_edit('default',0,'class="menuEdit" id="edit'.$menu['rowid'].'"').'</a> '.
'<a href="edit.php?menu_handler='.$menu_handler_to_search.'&action=create&menuId='.$menu['rowid'].'">'.img_edit_add('default').'</a> '. '<a href="edit.php?menu_handler='.$menu_handler_to_search.'&action=create&menuId='.$menu['rowid'].'">'.img_edit_add('default').'</a> '.
'<a href="index.php?menu_handler='.$menu_handler_to_search.'&action=delete&menuId='.$menu['rowid'].'">'.img_delete('default').'</a> '. '<a href="index.php?menu_handler='.$menu_handler_to_search.'&action=delete&menuId='.$menu['rowid'].'">'.img_delete('default').'</a> '.
'&nbsp; &nbsp; &nbsp;'.
'<a href="index.php?menu_handler='.$menu_handler_to_search.'&action=up&menuId='.$menu['rowid'].'">'.img_picto("Monter","1uparrow").'</a><a href="index.php?menu_handler='.$menu_handler_to_search.'&action=down&menuId='.$menu['rowid'].'">'.img_picto("Descendre","1downarrow").'</a>'. '<a href="index.php?menu_handler='.$menu_handler_to_search.'&action=up&menuId='.$menu['rowid'].'">'.img_picto("Monter","1uparrow").'</a><a href="index.php?menu_handler='.$menu_handler_to_search.'&action=down&menuId='.$menu['rowid'].'">'.img_picto("Descendre","1downarrow").'</a>'.
'</td></tr></table>' '</td></tr></table>'
); );

View File

@ -86,6 +86,13 @@ print_fiche_titre($langs->trans("SecuritySetup"),'','setup');
print $langs->trans("ProxyDesc")."<br>\n"; print $langs->trans("ProxyDesc")."<br>\n";
print "<br>\n"; print "<br>\n";
print '<form action="'.$_SERVER["PHP_SELF"].'" method="POST">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<input type="hidden" name="action" value="set_proxy">';
$head=security_prepare_head(); $head=security_prepare_head();
dol_fiche_head($head, 'proxy', $langs->trans("Security")); dol_fiche_head($head, 'proxy', $langs->trans("Security"));
@ -118,10 +125,6 @@ if ($conf->use_javascript_ajax)
// Timeout // Timeout
$var=true; $var=true;
print '<form action="'.$_SERVER["PHP_SELF"].'" method="POST">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<input type="hidden" name="action" value="set_proxy">';
print '<table width="100%" class="noborder">'; print '<table width="100%" class="noborder">';
print '<tr class="liste_titre">'; print '<tr class="liste_titre">';
@ -196,14 +199,13 @@ print '</tr>';
print '</table>'; print '</table>';
print '<br><center>';
print '<input type="submit" class="button" name="button" value="'.$langs->trans("Modify").'">';
print '</center>';
print '</form>';
dol_fiche_end(); dol_fiche_end();
print '<div class="center">';
print '<input type="submit" class="button" name="button" value="'.$langs->trans("Modify").'">';
print '</div>';
print '</form>';
$db->close(); $db->close();

View File

@ -72,12 +72,12 @@ if ($action == 'update')
* View * View
*/ */
llxHeader(); llxHeader('',$langs->trans('SalariesSetup'));
$form = new Form($db); $form = new Form($db);
$linkback='<a href="'.DOL_URL_ROOT.'/admin/modules.php">'.$langs->trans("BackToModuleList").'</a>'; $linkback='<a href="'.DOL_URL_ROOT.'/admin/modules.php">'.$langs->trans("BackToModuleList").'</a>';
print_fiche_titre($langs->trans('ConfigSalaries'),$linkback,'setup'); print_fiche_titre($langs->trans('SalariesSetup'),$linkback,'setup');
print '<form action="'.$_SERVER["PHP_SELF"].'" method="post">'; print '<form action="'.$_SERVER["PHP_SELF"].'" method="post">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">'; print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';

View File

@ -80,35 +80,15 @@ else if (preg_match('/del_(.*)/',$action,$reg))
} }
} }
else if ($action == 'MAIN_SESSION_TIMEOUT') else if ($action == 'updateform')
{ {
if (! dolibarr_set_const($db, "MAIN_SESSION_TIMEOUT", $_POST["MAIN_SESSION_TIMEOUT"],'chaine',0,'',$conf->entity)) dol_print_error($db); $res1=dolibarr_set_const($db, "MAIN_APPLICATION_TITLE", $_POST["MAIN_APPLICATION_TITLE"],'chaine',0,'',$conf->entity);
else setEventMessage($langs->trans("RecordModifiedSuccessfully")); $res2=dolibarr_set_const($db, "MAIN_SESSION_TIMEOUT", $_POST["MAIN_SESSION_TIMEOUT"],'chaine',0,'',$conf->entity);
} $res3=dolibarr_set_const($db, 'MAIN_UPLOAD_DOC',$_POST["MAIN_UPLOAD_DOC"],'chaine',0,'',$conf->entity);
else if ($action == 'MAIN_UPLOAD_DOC') $res4=dolibarr_set_const($db, "MAIN_UMASK", $_POST["MAIN_UMASK"],'chaine',0,'',$conf->entity);
{ $res5=dolibarr_set_const($db, "MAIN_ANTIVIRUS_COMMAND", $_POST["MAIN_ANTIVIRUS_COMMAND"],'chaine',0,'',$conf->entity);
if (! dolibarr_set_const($db, 'MAIN_UPLOAD_DOC',$_POST["MAIN_UPLOAD_DOC"],'chaine',0,'',$conf->entity)) dol_print_error($db); $res6=dolibarr_set_const($db, "MAIN_ANTIVIRUS_PARAM", $_POST["MAIN_ANTIVIRUS_PARAM"],'chaine',0,'',$conf->entity);
else setEventMessage($langs->trans("RecordModifiedSuccessfully")); if ($res1 && $res2 && $res3 && $res4 && $res5 && $res6) setEventMessage($langs->trans("RecordModifiedSuccessfully"));
}
else if ($action == 'MAIN_UMASK')
{
if (! dolibarr_set_const($db, "MAIN_UMASK", $_POST["MAIN_UMASK"],'chaine',0,'',$conf->entity)) dol_print_error($db);
else setEventMessage($langs->trans("RecordModifiedSuccessfully"));
}
else if ($action == 'MAIN_ANTIVIRUS_COMMAND')
{
if (! dolibarr_set_const($db, "MAIN_ANTIVIRUS_COMMAND", $_POST["MAIN_ANTIVIRUS_COMMAND"],'chaine',0,'',$conf->entity)) dol_print_error($db);
else setEventMessage($langs->trans("RecordModifiedSuccessfully"));
}
else if ($action == 'MAIN_ANTIVIRUS_PARAM')
{
if (! dolibarr_set_const($db, "MAIN_ANTIVIRUS_PARAM", $_POST["MAIN_ANTIVIRUS_PARAM"],'chaine',0,'',$conf->entity)) dol_print_error($db);
else setEventMessage($langs->trans("RecordModifiedSuccessfully"));
}
else if ($action == 'MAIN_APPLICATION_TITLE')
{
if (! dolibarr_set_const($db, "MAIN_APPLICATION_TITLE", $_POST["MAIN_SESSION_TIMEOUT"],'chaine',0,'',$conf->entity)) dol_print_error($db);
else setEventMessage($langs->trans("RecordModifiedSuccessfully"));
} }
@ -138,59 +118,17 @@ print_fiche_titre($langs->trans("SecuritySetup"),'','setup');
print $langs->trans("MiscellaneousDesc")."<br>\n"; print $langs->trans("MiscellaneousDesc")."<br>\n";
print "<br>\n"; print "<br>\n";
print '<form action="'.$_SERVER["PHP_SELF"].'" method="POST">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<input type="hidden" name="action" value="updateform">';
$head=security_prepare_head(); $head=security_prepare_head();
dol_fiche_head($head, 'misc', $langs->trans("Security")); dol_fiche_head($head, 'misc', $langs->trans("Security"));
// Timeout
$var=true;
print '<table width="100%" class="noborder">';
print '<tr class="liste_titre">';
print '<td colspan="2">'.$langs->trans("Parameters").'</td>';
print '<td>'.$langs->trans("Value").'</td>';
print '<td width="100">&nbsp;</td>';
print "</tr>\n";
$var=!$var;
$sessiontimeout=ini_get("session.gc_maxlifetime");
if (empty($conf->global->MAIN_SESSION_TIMEOUT)) $conf->global->MAIN_SESSION_TIMEOUT=$sessiontimeout;
print '<form action="'.$_SERVER["PHP_SELF"].'?action=MAIN_SESSION_TIMEOUT" method="POST">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<tr '.$bc[$var].'>';
print '<td>'.$langs->trans("SessionTimeOut").'</td><td align="right">';
print $form->textwithpicto('',$langs->trans("SessionExplanation",ini_get("session.gc_probability"),ini_get("session.gc_divisor")));
print '</td>';
print '<td class="nowrap">';
print '<input class="flat" name="MAIN_SESSION_TIMEOUT" type="text" size="6" value="'.htmlentities($conf->global->MAIN_SESSION_TIMEOUT).'"> '.strtolower($langs->trans("Seconds"));
print '</td>';
print '<td align="right">';
print '<input type="submit" class="button" name="button" value="'.$langs->trans("Modify").'">';
print '</td>';
print '</tr></form>';
$var=!$var;
$sessiontimeout=ini_get("session.gc_maxlifetime");
if (empty($conf->global->MAIN_APPLICATION_TITLE)) $conf->global->MAIN_APPLICATION_TITLE="";
print '<form action="'.$_SERVER["PHP_SELF"].'?action=MAIN_APPLICATION_TITLE" method="POST">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<tr '.$bc[$var].'>';
print '<td>'.$langs->trans("HiddeNumVersion").'</td><td align="right">';
print $form->textwithpicto('',$langs->trans("HiddeNumVersionExample",ini_get("session.gc_probability"),ini_get("session.gc_divisor")));
print '</td>';
print '<td class="nowrap">';
print '<input class="flat" name="MAIN_SESSION_TIMEOUT" type="text" size="20" value="'.htmlentities($conf->global->MAIN_APPLICATION_TITLE).'"> ';
print '</td>';
print '<td align="right">';
print '<input type="submit" class="button" name="button" value="'.$langs->trans("Modify").'">';
print '</td>';
print '</tr></form>';
print '</table>';
print '<br>';
// Other Options // Other Options
$var=true; $var=true;
@ -254,6 +192,44 @@ print "</td></tr>";
print '</table>'; print '</table>';
print '<br>';
// Timeout
$var=true;
print '<table width="100%" class="noborder">';
print '<tr class="liste_titre">';
print '<td colspan="2">'.$langs->trans("Parameters").'</td>';
print '<td>'.$langs->trans("Value").'</td>';
print "</tr>\n";
$var=!$var;
$sessiontimeout=ini_get("session.gc_maxlifetime");
if (empty($conf->global->MAIN_SESSION_TIMEOUT)) $conf->global->MAIN_SESSION_TIMEOUT=$sessiontimeout;
print '<tr '.$bc[$var].'>';
print '<td>'.$langs->trans("SessionTimeOut").'</td><td align="right">';
print $form->textwithpicto('',$langs->trans("SessionExplanation",ini_get("session.gc_probability"),ini_get("session.gc_divisor")));
print '</td>';
print '<td class="nowrap">';
print '<input class="flat" name="MAIN_SESSION_TIMEOUT" type="text" size="6" value="'.htmlentities($conf->global->MAIN_SESSION_TIMEOUT).'"> '.strtolower($langs->trans("Seconds"));
print '</td>';
print '</tr>';
$var=!$var;
$sessiontimeout=ini_get("session.gc_maxlifetime");
if (empty($conf->global->MAIN_APPLICATION_TITLE)) $conf->global->MAIN_APPLICATION_TITLE="";
print '<tr '.$bc[$var].'>';
print '<td>'.$langs->trans("MAIN_APPLICATION_TITLE").'</td><td align="right">';
print '</td>';
print '<td class="nowrap">';
print '<input class="flat" name="MAIN_APPLICATION_TITLE" type="text" size="20" value="'.htmlentities($conf->global->MAIN_APPLICATION_TITLE).'"> ';
print '</td>';
print '</tr>';
print '</table>';
print '<br>'; print '<br>';
// Upload options // Upload options
@ -263,11 +239,8 @@ print '<table class="noborder" width="100%">';
print '<tr class="liste_titre">'; print '<tr class="liste_titre">';
print '<td colspan="2">'.$langs->trans("Parameters").'</td>'; print '<td colspan="2">'.$langs->trans("Parameters").'</td>';
print '<td>'.$langs->trans("Value").'</td>'; print '<td>'.$langs->trans("Value").'</td>';
print '<td width="100">&nbsp;</td>';
print '</tr>'; print '</tr>';
print '<form action="'.$_SERVER["PHP_SELF"].'?action=MAIN_UPLOAD_DOC" method="POST">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<tr '.$bc[$var].'>'; print '<tr '.$bc[$var].'>';
print '<td colspan="2">'.$langs->trans("MaxSizeForUploadedFiles").'.'; print '<td colspan="2">'.$langs->trans("MaxSizeForUploadedFiles").'.';
$max=@ini_get('upload_max_filesize'); $max=@ini_get('upload_max_filesize');
@ -277,14 +250,9 @@ print '</td>';
print '<td class="nowrap">'; print '<td class="nowrap">';
print '<input class="flat" name="MAIN_UPLOAD_DOC" type="text" size="6" value="'.htmlentities($conf->global->MAIN_UPLOAD_DOC).'"> '.$langs->trans("Kb"); print '<input class="flat" name="MAIN_UPLOAD_DOC" type="text" size="6" value="'.htmlentities($conf->global->MAIN_UPLOAD_DOC).'"> '.$langs->trans("Kb");
print '</td>'; print '</td>';
print '<td align="right">'; print '</tr>';
print '<input type="submit" class="button" name="button" value="'.$langs->trans("Modify").'">';
print '</td>';
print '</tr></form>';
$var=!$var; $var=!$var;
print '<form action="'.$_SERVER["PHP_SELF"].'?action=MAIN_UMASK" method="POST">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<tr '.$bc[$var].'>'; print '<tr '.$bc[$var].'>';
print '<td>'.$langs->trans("UMask").'</td><td align="right">'; print '<td>'.$langs->trans("UMask").'</td><td align="right">';
print $form->textwithpicto('',$langs->trans("UMaskExplanation")); print $form->textwithpicto('',$langs->trans("UMaskExplanation"));
@ -292,15 +260,10 @@ print '</td>';
print '<td class="nowrap">'; print '<td class="nowrap">';
print '<input class="flat" name="MAIN_UMASK" type="text" size="6" value="'.htmlentities($conf->global->MAIN_UMASK).'">'; print '<input class="flat" name="MAIN_UMASK" type="text" size="6" value="'.htmlentities($conf->global->MAIN_UMASK).'">';
print '</td>'; print '</td>';
print '<td align="right">'; print '</tr>';
print '<input type="submit" class="button" name="button" value="'.$langs->trans("Modify").'">';
print '</td>';
print '</tr></form>';
// Use anti virus // Use anti virus
$var=!$var; $var=!$var;
print '<form action="'.$_SERVER["PHP_SELF"].'?action=MAIN_ANTIVIRUS_COMMAND" method="POST">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print "<tr ".$bc[$var].">"; print "<tr ".$bc[$var].">";
print '<td colspan="2">'.$langs->trans("AntiVirusCommand").'<br>'; print '<td colspan="2">'.$langs->trans("AntiVirusCommand").'<br>';
print $langs->trans("AntiVirusCommandExample"); print $langs->trans("AntiVirusCommandExample");
@ -320,16 +283,10 @@ if (ini_get('safe_mode') && ! empty($conf->global->MAIN_ANTIVIRUS_COMMAND))
} }
print '<input type="text" name="MAIN_ANTIVIRUS_COMMAND" size="72" value="'.(! empty($conf->global->MAIN_ANTIVIRUS_COMMAND)?dol_htmlentities($conf->global->MAIN_ANTIVIRUS_COMMAND):'').'">'; print '<input type="text" name="MAIN_ANTIVIRUS_COMMAND" size="72" value="'.(! empty($conf->global->MAIN_ANTIVIRUS_COMMAND)?dol_htmlentities($conf->global->MAIN_ANTIVIRUS_COMMAND):'').'">';
print "</td>"; print "</td>";
print '<td align="right">';
print '<input type="submit" class="button" name="button" value="'.$langs->trans("Modify").'">';
print '</td>';
print '</tr>'; print '</tr>';
print '</form>';
// Use anti virus // Use anti virus
$var=!$var; $var=!$var;
print '<form action="'.$_SERVER["PHP_SELF"].'?action=MAIN_ANTIVIRUS_PARAM" method="POST">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print "<tr ".$bc[$var].">"; print "<tr ".$bc[$var].">";
print '<td colspan="2">'.$langs->trans("AntiVirusParam").'<br>'; print '<td colspan="2">'.$langs->trans("AntiVirusParam").'<br>';
print $langs->trans("AntiVirusParamExample"); print $langs->trans("AntiVirusParamExample");
@ -337,16 +294,18 @@ print '</td>';
print '<td>'; print '<td>';
print '<input type="text" name="MAIN_ANTIVIRUS_PARAM" size="72" value="'.(! empty($conf->global->MAIN_ANTIVIRUS_PARAM)?dol_htmlentities($conf->global->MAIN_ANTIVIRUS_PARAM):'').'">'; print '<input type="text" name="MAIN_ANTIVIRUS_PARAM" size="72" value="'.(! empty($conf->global->MAIN_ANTIVIRUS_PARAM)?dol_htmlentities($conf->global->MAIN_ANTIVIRUS_PARAM):'').'">';
print "</td>"; print "</td>";
print '<td align="right">';
print '<input type="submit" class="button" name="button" value="'.$langs->trans("Modify").'">';
print '</td>';
print '</tr>'; print '</tr>';
print '</form>';
print '</table>'; print '</table>';
dol_fiche_end(); dol_fiche_end();
print '<div class="center"><input type="submit" class="button" name="button" value="'.$langs->trans("Modify").'"></div>';
print '</form>';
// Form to test upload // Form to test upload
print '<br>'; print '<br>';
$formfile=new FormFile($db); $formfile=new FormFile($db);

View File

@ -183,8 +183,9 @@ foreach ($syslogModules as $moduleName)
{ {
$module = new $moduleName; $module = new $moduleName;
$moduleactive=$module->isActive(); $moduleactive=(int) $module->isActive();
if ($moduleactive == -1 && empty($conf->global->MAIN_FEATURES_LEVEL)) continue; // Some modules are hidden if not activable and not into debug mode (end user must not see them) //print $moduleName." = ".$moduleactive." - ".$module->getName()." ".($moduleactive == -1)."<br>\n";
if (($moduleactive == -1) && empty($conf->global->MAIN_FEATURES_LEVEL)) continue; // Some modules are hidden if not activable and not into debug mode (end user must not see them)
$var=!$var; $var=!$var;
print '<tr '.$bc[$var].'>'; print '<tr '.$bc[$var].'>';
@ -220,7 +221,7 @@ foreach ($syslogModules as $moduleName)
print "</table>\n"; print "</table>\n";
print "</form>\n"; print "</form>\n";
print '<br>'; print '<br>'."\n\n";
print_titre($langs->trans("SyslogLevel")); print_titre($langs->trans("SyslogLevel"));

View File

@ -107,7 +107,7 @@ class Categorie extends CommonObject
$this->type = $res['type']; $this->type = $res['type'];
$this->entity = $res['entity']; $this->entity = $res['entity'];
$this->fetch_optionals($this->id,$extralabels); $this->fetch_optionals($this->id,null);
$this->db->free($resql); $this->db->free($resql);
@ -198,6 +198,8 @@ class Categorie extends CommonObject
{ {
$this->id = $id; $this->id = $id;
$action='create';
// Actions on extra fields (by external module or standard code) // Actions on extra fields (by external module or standard code)
// FIXME le hook fait double emploi avec le trigger !! // FIXME le hook fait double emploi avec le trigger !!
$hookmanager->initHooks(array('HookModuleNamedao')); $hookmanager->initHooks(array('HookModuleNamedao'));
@ -289,11 +291,13 @@ class Categorie extends CommonObject
dol_syslog(get_class($this)."::update", LOG_DEBUG); dol_syslog(get_class($this)."::update", LOG_DEBUG);
if ($this->db->query($sql)) if ($this->db->query($sql))
{ {
$action='update';
// Actions on extra fields (by external module or standard code) // Actions on extra fields (by external module or standard code)
// FIXME le hook fait double emploi avec le trigger !! // FIXME le hook fait double emploi avec le trigger !!
$hookmanager->initHooks(array('HookCategorydao')); $hookmanager->initHooks(array('HookCategorydao'));
$parameters=array(); $parameters=array();
$action='update';
$reshook=$hookmanager->executeHooks('insertExtraFields',$parameters,$this,$action); // Note that $action and $object may have been modified by some hooks $reshook=$hookmanager->executeHooks('insertExtraFields',$parameters,$this,$action); // Note that $action and $object may have been modified by some hooks
if (empty($reshook)) if (empty($reshook))
{ {
@ -408,6 +412,17 @@ class Categorie extends CommonObject
$error++; $error++;
} }
} }
if (! $error)
{
$sql = "DELETE FROM ".MAIN_DB_PREFIX."categorie_lang";
$sql .= " WHERE fk_category = ".$this->id;
if (!$this->db->query($sql))
{
$this->error=$this->db->lasterror();
dol_syslog("Error sql=".$sql." ".$this->error, LOG_ERR);
$error++;
}
}
// Delete category // Delete category
if (! $error) if (! $error)
@ -430,7 +445,7 @@ class Categorie extends CommonObject
if ($result < 0) if ($result < 0)
{ {
$error++; $error++;
dol_syslog(get_class($this)."::delete erreur ".$errorflag." ".$this->error, LOG_ERR); dol_syslog(get_class($this)."::delete erreur ".$this->error, LOG_ERR);
} }
} }
} }
@ -788,7 +803,7 @@ class Categorie extends CommonObject
*/ */
function get_full_arbo($type,$markafterid=0) function get_full_arbo($type,$markafterid=0)
{ {
global $langs; global $conf, $langs;
$this->cats = array(); $this->cats = array();
@ -798,11 +813,9 @@ class Categorie extends CommonObject
// Init $this->cats array // Init $this->cats array
$sql = "SELECT DISTINCT c.rowid, c.label, c.description, c.fk_parent"; // Distinct reduce pb with old tables with duplicates $sql = "SELECT DISTINCT c.rowid, c.label, c.description, c.fk_parent"; // Distinct reduce pb with old tables with duplicates
if (! empty($conf->global->MAIN_MULTILANGS)) if (! empty($conf->global->MAIN_MULTILANGS)) $sql.= ", t.label as label_trans, t.description as description_trans";
$sql.= ", t.label as label_trans, t.description as description_trans";
$sql.= " FROM ".MAIN_DB_PREFIX."categorie as c"; $sql.= " FROM ".MAIN_DB_PREFIX."categorie as c";
if (! empty($conf->global->MAIN_MULTILANGS)) if (! empty($conf->global->MAIN_MULTILANGS)) $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."categorie_lang as t ON t.fk_category=c.rowid AND t.lang='".$current_lang."'";
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."categorie_lang as t ON t.fk_category=c.rowid AND t.lang='".$current_lang."'";
$sql.= " WHERE c.entity IN (".getEntity('category',1).")"; $sql.= " WHERE c.entity IN (".getEntity('category',1).")";
$sql.= " AND c.type = ".$type; $sql.= " AND c.type = ".$type;
@ -1263,7 +1276,7 @@ class Categorie extends CommonObject
$result=''; $result='';
$lien = '<a href="'.DOL_URL_ROOT.'/categories/viewcat.php?id='.$this->id.'&type='.$this->type.'">'; $lien = '<a href="'.DOL_URL_ROOT.'/categories/viewcat.php?id='.$this->id.'&type='.$this->type.'">';
$label=$langs->trans("ShowCategory").': '.$this->label; $label=$langs->trans("ShowCategory").': '. ($this->ref?$this->ref:$this->label);
$lienfin='</a>'; $lienfin='</a>';
$picto='category'; $picto='category';
@ -1271,7 +1284,7 @@ class Categorie extends CommonObject
if ($withpicto) $result.=($lien.img_object($label,$picto).$lienfin); if ($withpicto) $result.=($lien.img_object($label,$picto).$lienfin);
if ($withpicto && $withpicto != 2) $result.=' '; if ($withpicto && $withpicto != 2) $result.=' ';
if ($withpicto != 2) $result.=$lien.dol_trunc($this->ref,$maxlength).$lienfin; if ($withpicto != 2) $result.=$lien.dol_trunc(($this->ref?$this->ref:$this->label),$maxlength).$lienfin;
return $result; return $result;
} }
@ -1369,7 +1382,7 @@ class Categorie extends CommonObject
// Objet // Objet
$obj=array(); $obj=array();
$obj['photo']=$photo; $obj['photo']=$photo;
if ($photo_vignette && is_file($dirthumb.$photo_vignette)) $obj['photo_vignette']=$photo_vignette; if ($photo_vignette && is_file($dirthumb.$photo_vignette)) $obj['photo_vignette']='thumbs/' . $photo_vignette;
else $obj['photo_vignette']=""; else $obj['photo_vignette']="";
$tabobj[$nbphoto-1]=$obj; $tabobj[$nbphoto-1]=$obj;

View File

@ -241,7 +241,7 @@ if ($object->id)
// Si fichier vignette disponible, on l'utilise, sinon on utilise photo origine // Si fichier vignette disponible, on l'utilise, sinon on utilise photo origine
if ($obj['photo_vignette']) if ($obj['photo_vignette'])
{ {
$filename='thumbs/'.$obj['photo_vignette']; $filename=$obj['photo_vignette'];
} }
else else
{ {

View File

@ -35,6 +35,8 @@ require_once DOL_DOCUMENT_ROOT.'/user/class/user.class.php';
require_once DOL_DOCUMENT_ROOT.'/comm/action/class/cactioncomm.class.php'; require_once DOL_DOCUMENT_ROOT.'/comm/action/class/cactioncomm.class.php';
require_once DOL_DOCUMENT_ROOT.'/comm/action/class/actioncomm.class.php'; require_once DOL_DOCUMENT_ROOT.'/comm/action/class/actioncomm.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formactions.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formactions.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php';
if (! empty($conf->projet->enabled)) 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';
@ -74,6 +76,7 @@ $cactioncomm = new CActionComm($db);
$object = new ActionComm($db); $object = new ActionComm($db);
$contact = new Contact($db); $contact = new Contact($db);
$extrafields = new ExtraFields($db); $extrafields = new ExtraFields($db);
$formfile = new FormFile($db);
// fetch optionals attributes and labels // fetch optionals attributes and labels
$extralabels=$extrafields->fetch_name_optionals_label($object->table_element); $extralabels=$extrafields->fetch_name_optionals_label($object->table_element);
@ -710,9 +713,9 @@ if ($action == 'create')
$events[]=array('method' => 'getContacts', 'url' => dol_buildpath('/core/ajax/contacts.php',1), 'htmlname' => 'contactid', 'params' => array('add-customer-contact' => 'disabled')); $events[]=array('method' => 'getContacts', 'url' => dol_buildpath('/core/ajax/contacts.php',1), 'htmlname' => 'contactid', 'params' => array('add-customer-contact' => 'disabled'));
//For external user force the company to user company //For external user force the company to user company
if (!empty($user->societe_id)) { if (!empty($user->societe_id)) {
print $form->select_company($user->societe_id,'socid','',1,1,0,$events); print $form->select_thirdparty_list($user->societe_id,'socid','',1,1,0,$events);
} else { } else {
print $form->select_company('','socid','',1,1,0,$events); print $form->select_thirdparty_list('','socid','',1,1,0,$events);
} }
} }
@ -1243,6 +1246,34 @@ if ($id > 0)
if ($action != 'edit') if ($action != 'edit')
{ {
if (empty($conf->global->SOCIETE_DISABLE_BUILDDOC)) {
print '<div class="fichecenter"><div class="fichehalfleft">';
print '<a name="builddoc"></a>'; // ancre
/*
* Documents generes
*/
$filedir=$conf->agenda->multidir_output[$conf->entity].'/'.$object->id;
$urlsource=$_SERVER["PHP_SELF"]."?socid=".$object->id;
$genallowed=$user->rights->agenda->myactions->create;
$delallowed=$user->rights->agenda->myactions->delete;
$var=true;
$somethingshown=$formfile->show_documents('agenda',$object->id,$filedir,$urlsource,$genallowed,$delallowed,'',0,0,0,0,0,'','','',$object->default_lang);
print '</div><div class="fichehalfright"><div class="ficheaddleft">';
print '</div></div></div>';
print '<div style="clear:both;">&nbsp;</div>';
}
// Link to agenda views // Link to agenda views
print '<div id="agendaviewbutton">'; print '<div id="agendaviewbutton">';
print '<form name="listactionsfiltermonth" action="'.DOL_URL_ROOT.'/comm/action/index.php" method="POST" style="float: left; padding-right: 10px;">'; print '<form name="listactionsfiltermonth" action="'.DOL_URL_ROOT.'/comm/action/index.php" method="POST" style="float: left; padding-right: 10px;">';

View File

@ -241,8 +241,11 @@ class ActionComm extends CommonObject
if (! $error) if (! $error)
{ {
$action='create';
// Actions on extra fields (by external module or standard code) // Actions on extra fields (by external module or standard code)
$hookmanager->initHooks(array('actioncommdao')); // FIXME le hook fait double emploi avec le trigger !!
$hookmanager->initHooks(array('actioncommdao'));
$parameters=array('actcomm'=>$this->id); $parameters=array('actcomm'=>$this->id);
$reshook=$hookmanager->executeHooks('insertExtraFields',$parameters,$this,$action); // Note that $action and $object may have been modified by some hooks $reshook=$hookmanager->executeHooks('insertExtraFields',$parameters,$this,$action); // Note that $action and $object may have been modified by some hooks
if (empty($reshook)) if (empty($reshook))
@ -560,8 +563,10 @@ class ActionComm extends CommonObject
dol_syslog(get_class($this)."::update", LOG_DEBUG); dol_syslog(get_class($this)."::update", LOG_DEBUG);
if ($this->db->query($sql)) if ($this->db->query($sql))
{ {
$action='update';
// Actions on extra fields (by external module or standard code) // Actions on extra fields (by external module or standard code)
// FIXME le hook fait double emploi avec le trigger !!
$hookmanager->initHooks(array('actioncommdao')); $hookmanager->initHooks(array('actioncommdao'));
$parameters=array('actcomm'=>$this->id); $parameters=array('actcomm'=>$this->id);
$reshook=$hookmanager->executeHooks('insertExtraFields',$parameters,$this,$action); // Note that $action and $object may have been modified by some hooks $reshook=$hookmanager->executeHooks('insertExtraFields',$parameters,$this,$action); // Note that $action and $object may have been modified by some hooks

View File

@ -103,7 +103,7 @@ class CActionComm
* @param string $idorcode 'id' or 'code' * @param string $idorcode 'id' or 'code'
* @param string $excludetype Type to exclude * @param string $excludetype Type to exclude
* @param string $onlyautoornot Group list by auto events or not * @param string $onlyautoornot Group list by auto events or not
* @return array Array of all event types if OK, <0 if KO * @return mixed Array of all event types if OK, <0 if KO
*/ */
function liste_array($active='',$idorcode='id',$excludetype='',$onlyautoornot=0) function liste_array($active='',$idorcode='id',$excludetype='',$onlyautoornot=0)
{ {

View File

@ -201,6 +201,7 @@ if ($filter) $param.="&filter=".$filter;
if ($filtera) $param.="&filtera=".$filtera; if ($filtera) $param.="&filtera=".$filtera;
if ($filtert) $param.="&filtert=".$filtert; if ($filtert) $param.="&filtert=".$filtert;
if ($filterd) $param.="&filterd=".$filterd; if ($filterd) $param.="&filterd=".$filterd;
if ($usergroup) $param.="&usergroup=".$usergroup;
if ($socid) $param.="&socid=".$socid; if ($socid) $param.="&socid=".$socid;
if ($showbirthday) $param.="&showbirthday=1"; if ($showbirthday) $param.="&showbirthday=1";
if ($pid) $param.="&projectid=".$pid; if ($pid) $param.="&projectid=".$pid;
@ -242,6 +243,20 @@ $nav.=" &nbsp; (<a href=\"?year=".$nowyear."&amp;month=".$nowmonth."&amp;day=".$
$picto='calendarweek'; $picto='calendarweek';
$nav.=' &nbsp; <form name="dateselect" action="'.$_SERVER["PHP_SELF"].'?action=show_peruser'.$param.'">'; $nav.=' &nbsp; <form name="dateselect" action="'.$_SERVER["PHP_SELF"].'?action=show_peruser'.$param.'">';
$nav.='<input type="hidden" name="token" value="' . $_SESSION ['newtoken'] . '">';
$nav.='<input type="hidden" name="action" value="' . $action . '">';
$nav.='<input type="hidden" name="usertodo" value="' . $filtert . '">';
$nav.='<input type="hidden" name="usergroup" value="' . $usergroup . '">';
$nav.='<input type="hidden" name="actioncode" value="' . $actioncode . '">';
$nav.='<input type="hidden" name="status" value="' . $status . '">';
$nav.='<input type="hidden" name="socid" value="' . $socid . '">';
$nav.='<input type="hidden" name="projectid" value="' . $projectid . '">';
$nav.='<input type="hidden" name="begin_h" value="' . $begin_h . '">';
$nav.='<input type="hidden" name="end_h" value="' . $end_h . '">';
$nav.='<input type="hidden" name="begin_d" value="' . $begin_d . '">';
$nav.='<input type="hidden" name="end_d" value="' . $end_d . '">';
$nav.='<input type="hidden" name="showbirthday" value="' . $showbirthday . '">';
$nav.=$form->select_date($dateselect, 'dateselect', 0, 0, 1, '', 1, 0, 1); $nav.=$form->select_date($dateselect, 'dateselect', 0, 0, 1, '', 1, 0, 1);
$nav.=' <input type="submit" name="submitdateselect" class="button" value="'.$langs->trans("Refresh").'">'; $nav.=' <input type="submit" name="submitdateselect" class="button" value="'.$langs->trans("Refresh").'">';
$nav.='</form>'; $nav.='</form>';
@ -659,10 +674,12 @@ while ($obj = $db->fetch_object($resql))
$todayarray=dol_getdate($now,'fast'); $todayarray=dol_getdate($now,'fast');
$sav = $tmpday; $sav = $tmpday;
$showheader = true; $showheader = true;
$var = false;
foreach ($usernames as $username) foreach ($usernames as $username)
{ {
$var = ! $var;
echo "<tr>"; echo "<tr>";
echo '<td class="cal_current_month">' . $username->getNomUrl(1). '</td>'; echo '<td class="cal_current_month"'.($var?' style="background: #F8F8F8"':'').'>' . $username->getNomUrl(1). '</td>';
$tmpday = $sav; $tmpday = $sav;
// Lopp on each day of week // Lopp on each day of week
@ -688,7 +705,7 @@ foreach ($usernames as $username)
if ($todayarray['mday']==$tmpday && $todayarray['mon']==$tmpmonth && $todayarray['year']==$tmpyear) $today=1; if ($todayarray['mday']==$tmpday && $todayarray['mon']==$tmpmonth && $todayarray['year']==$tmpyear) $today=1;
if ($today) $style='cal_today_peruser'; if ($today) $style='cal_today_peruser';
show_day_events2($username, $tmpday, $tmpmonth, $tmpyear, $monthshown, $style, $eventarray, 0, $maxnbofchar, $newparam, 1, 300, $showheader, $colorsbytype); show_day_events2($username, $tmpday, $tmpmonth, $tmpyear, $monthshown, $style, $eventarray, 0, $maxnbofchar, $newparam, 1, 300, $showheader, $colorsbytype, $var);
$i++; $i++;
} }
@ -785,9 +802,10 @@ $db->close();
* @param int $minheight Minimum height for each event. 60px by default. * @param int $minheight Minimum height for each event. 60px by default.
* @param boolean $showheader Show header * @param boolean $showheader Show header
* @param array $colorsbytype Array with colors by type * @param array $colorsbytype Array with colors by type
* @param string $var true or false for alternat style on tr/td
* @return void * @return void
*/ */
function show_day_events2($username, $day, $month, $year, $monthshown, $style, &$eventarray, $maxprint=0, $maxnbofchar=16, $newparam='', $showinfo=0, $minheight=60, $showheader=false, $colorsbytype=array()) function show_day_events2($username, $day, $month, $year, $monthshown, $style, &$eventarray, $maxprint=0, $maxnbofchar=16, $newparam='', $showinfo=0, $minheight=60, $showheader=false, $colorsbytype=array(), $var=false)
{ {
global $db; global $db;
global $user, $conf, $langs, $hookmanager, $action; global $user, $conf, $langs, $hookmanager, $action;
@ -989,8 +1007,8 @@ function show_day_events2($username, $day, $month, $year, $monthshown, $style, &
} }
if ($h == $begin_h) echo '<td class="'.$style.'_peruserleft cal_peruser">'; if ($h == $begin_h) echo '<td class="'.$style.'_peruserleft cal_peruser"'.($var?' style="background: #F8F8F8"':'').'>';
else echo '<td class="'.$style.' cal_peruser">'; else echo '<td class="'.$style.' cal_peruser"'.($var?' style="background: #F8F8F8"':'').'>';
if (count($cases1[$h]) == 1) // 1 seul evenement if (count($cases1[$h]) == 1) // 1 seul evenement
{ {
$ids=array_keys($cases1[$h]); $ids=array_keys($cases1[$h]);

View File

@ -48,13 +48,12 @@ $pagenext = $page + 1;
if (! $sortorder) $sortorder="ASC"; if (! $sortorder) $sortorder="ASC";
if (! $sortfield) $sortfield="s.nom"; if (! $sortfield) $sortfield="s.nom";
$search_nom=GETPOST("search_nom"); $search_company=GETPOST("search_company");
$search_zipcode=GETPOST("search_zipcode"); $search_zipcode=GETPOST("search_zipcode");
$search_town=GETPOST("search_town"); $search_town=GETPOST("search_town");
$search_code=GETPOST("search_code"); $search_code=GETPOST("search_code");
$search_compta=GETPOST("search_compta"); $search_compta=GETPOST("search_compta");
$search_status = GETPOST("search_status",'int'); $search_status = GETPOST("search_status",'int');
if ($search_status=='') $search_status=1; // always display activ customer first
// Load sale and categ filters // Load sale and categ filters
$search_sale = GETPOST("search_sale"); $search_sale = GETPOST("search_sale");
@ -78,21 +77,18 @@ if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'e
// Do we click on purge search criteria ? // Do we click on purge search criteria ?
if (GETPOST("button_removefilter_x")) if (GETPOST("button_removefilter_x"))
{ {
$search_categ=''; $search_sale="";
$catid=''; $search_categ="";
$search_sale=''; $catid="";
$socname=""; $search_company="";
$search_nom="";
$search_zipcode=""; $search_zipcode="";
$search_town=""; $search_town="";
$search_idprof1=''; $search_code='';
$search_idprof2=''; $search_compta='';
$search_idprof3=''; $search_status='';
$search_idprof4='';
$seach_status=1;
} }
if ($search_status=='') $search_status=1; // always display activ customer first
/* /*
* view * view
@ -122,8 +118,8 @@ if ($catid > 0) $sql.= " AND cs.fk_categorie = ".$catid;
if ($catid == -2) $sql.= " AND cs.fk_categorie IS NULL"; if ($catid == -2) $sql.= " AND cs.fk_categorie IS NULL";
if ($search_categ > 0) $sql.= " AND cs.fk_categorie = ".$search_categ; if ($search_categ > 0) $sql.= " AND cs.fk_categorie = ".$search_categ;
if ($search_categ == -2) $sql.= " AND cs.fk_categorie IS NULL"; if ($search_categ == -2) $sql.= " AND cs.fk_categorie IS NULL";
if ($search_nom) { if ($search_company) {
$sql .= natural_search('s.nom', $search_nom); $sql .= natural_search('s.nom', $search_company);
} }
if ($search_zipcode) $sql.= " AND s.zip LIKE '".$db->escape($search_zipcode)."%'"; if ($search_zipcode) $sql.= " AND s.zip LIKE '".$db->escape($search_zipcode)."%'";
if ($search_town) { if ($search_town) {
@ -156,7 +152,7 @@ if ($result)
{ {
$num = $db->num_rows($result); $num = $db->num_rows($result);
$param = "&amp;search_nom=".$search_nom."&amp;search_code=".$search_code."&amp;search_zipcode=".$search_zipcode."&amp;search_town=".$search_town; $param = "&amp;search_company=".$search_company."&amp;search_code=".$search_code."&amp;search_zipcode=".$search_zipcode."&amp;search_town=".$search_town;
if ($search_categ != '') $param.='&amp;search_categ='.$search_categ; if ($search_categ != '') $param.='&amp;search_categ='.$search_categ;
if ($search_sale != '') $param.='&amp;search_sale='.$search_sale; if ($search_sale != '') $param.='&amp;search_sale='.$search_sale;
if ($search_status != '') $param.='&amp;search_status='.$search_status; if ($search_status != '') $param.='&amp;search_status='.$search_status;
@ -207,7 +203,7 @@ if ($result)
print '<tr class="liste_titre">'; print '<tr class="liste_titre">';
print '<td class="liste_titre">'; print '<td class="liste_titre">';
print '<input type="text" class="flat" name="search_nom" value="'.$search_nom.'" size="10">'; print '<input type="text" class="flat" name="search_company" value="'.$search_company.'" size="10">';
print '</td>'; print '</td>';
print '<td class="liste_titre">'; print '<td class="liste_titre">';
@ -235,7 +231,6 @@ if ($result)
print '</td>'; print '</td>';
print '<td class="liste_titre" align="right"><input class="liste_titre" type="image" src="'.img_picto($langs->trans("Search"),'search.png','','',1).'" value="'.dol_escape_htmltag($langs->trans("Search")).'" title="'.dol_escape_htmltag($langs->trans("Search")).'">'; print '<td class="liste_titre" align="right"><input class="liste_titre" type="image" src="'.img_picto($langs->trans("Search"),'search.png','','',1).'" value="'.dol_escape_htmltag($langs->trans("Search")).'" title="'.dol_escape_htmltag($langs->trans("Search")).'">';
print '&nbsp; ';
print '<input type="image" class="liste_titre" name="button_removefilter" src="'.img_picto($langs->trans("Search"),'searchclear.png','','',1).'" value="'.dol_escape_htmltag($langs->trans("RemoveFilter")).'" title="'.dol_escape_htmltag($langs->trans("RemoveFilter")).'">'; print '<input type="image" class="liste_titre" name="button_removefilter" src="'.img_picto($langs->trans("Search"),'searchclear.png','','',1).'" value="'.dol_escape_htmltag($langs->trans("RemoveFilter")).'" title="'.dol_escape_htmltag($langs->trans("RemoveFilter")).'">';
print '</td>'; print '</td>';

View File

@ -2000,7 +2000,7 @@ if ($action == 'create')
{ {
$var = true; $var = true;
// Add free products/services // Add products/services form
$object->formAddObjectLine(1, $mysoc, $soc); $object->formAddObjectLine(1, $mysoc, $soc);
$parameters = array(); $parameters = array();

View File

@ -651,7 +651,7 @@ class Propal extends CommonObject
* @param int $notrigger 1=Does not execute triggers, 0= execuete triggers * @param int $notrigger 1=Does not execute triggers, 0= execuete triggers
* @return int <0 if KO, >=0 if OK * @return int <0 if KO, >=0 if OK
*/ */
function create($user='', $notrigger=0) function create($user, $notrigger=0)
{ {
global $langs,$conf,$mysoc,$hookmanager; global $langs,$conf,$mysoc,$hookmanager;
$error=0; $error=0;
@ -846,6 +846,8 @@ class Propal extends CommonObject
$resql=$this->update_price(1); $resql=$this->update_price(1);
if ($resql) if ($resql)
{ {
$action='update';
// Actions on extra fields (by external module or standard code) // Actions on extra fields (by external module or standard code)
// FIXME le hook fait double emploi avec le trigger !! // FIXME le hook fait double emploi avec le trigger !!
$hookmanager->initHooks(array('propaldao')); $hookmanager->initHooks(array('propaldao'));
@ -917,7 +919,7 @@ class Propal extends CommonObject
{ {
$this->products=$this->lines; $this->products=$this->lines;
return $this->create(); return $this->create($user);
} }
/** /**
@ -1264,6 +1266,8 @@ class Propal extends CommonObject
*/ */
function update_extrafields($user) function update_extrafields($user)
{ {
$action='update';
// Actions on extra fields (by external module or standard code) // Actions on extra fields (by external module or standard code)
// FIXME le hook fait double emploi avec le trigger !! // FIXME le hook fait double emploi avec le trigger !!
$hookmanager->initHooks(array('propaldao')); $hookmanager->initHooks(array('propaldao'));
@ -2118,7 +2122,7 @@ class Propal extends CommonObject
if (! $error) if (! $error)
{ {
dol_syslog(get_class($this)."::delete $this->id by $user->id", LOG_DEBUG); dol_syslog(get_class($this)."::delete ".$this->id." by ".$user->id, LOG_DEBUG);
$this->db->commit(); $this->db->commit();
return 1; return 1;
} }
@ -2879,7 +2883,7 @@ class PropaleLigne extends CommonObject
$error=0; $error=0;
dol_syslog("PropaleLigne::insert rang=".$this->rang); dol_syslog(get_class($this)."::insert rang=".$this->rang);
// Clean parameters // Clean parameters
if (empty($this->tva_tx)) $this->tva_tx=0; if (empty($this->tva_tx)) $this->tva_tx=0;

View File

@ -56,6 +56,8 @@ $search_societe=GETPOST('search_societe','alpha');
$search_montant_ht=GETPOST('search_montant_ht','alpha'); $search_montant_ht=GETPOST('search_montant_ht','alpha');
$search_author=GETPOST('search_author','alpha'); $search_author=GETPOST('search_author','alpha');
$search_town=GETPOST('search_town','alpha'); $search_town=GETPOST('search_town','alpha');
$viewstatut=$db->escape(GETPOST('viewstatut'));
$object_statut=$db->escape(GETPOST('propal_statut'));
$sall=GETPOST("sall"); $sall=GETPOST("sall");
$mesg=(GETPOST("msg") ? GETPOST("msg") : GETPOST("mesg")); $mesg=(GETPOST("msg") ? GETPOST("msg") : GETPOST("mesg"));
@ -78,6 +80,26 @@ if (! empty($socid))
} }
$result = restrictedArea($user, $module, $objectid, $dbtable); $result = restrictedArea($user, $module, $objectid, $dbtable);
if (GETPOST("button_removefilter") || GETPOST("button_removefilter_x")) // Both tests are required to be compatible with all browsers
{
$search_categ='';
$search_user='';
$search_sale='';
$search_ref='';
$search_refcustomer='';
$search_societe='';
$search_montant_ht='';
$search_author='';
$search_town='';
$year='';
$month='';
$viewstatut='';
$object_statut='';
}
if($object_statut != '')
$viewstatut=$object_statut;
// Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array // Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array
$hookmanager->initHooks(array('propallist')); $hookmanager->initHooks(array('propallist'));
@ -93,21 +115,6 @@ $parameters=array('socid'=>$socid);
$reshook=$hookmanager->executeHooks('doActions',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks $reshook=$hookmanager->executeHooks('doActions',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks
if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
// Do we click on purge search criteria ?
if (GETPOST("button_removefilter_x"))
{
$search_categ='';
$search_user='';
$search_sale='';
$search_ref='';
$search_refcustomer='';
$search_societe='';
$search_montant_ht='';
$search_author='';
$search_town='';
$year='';
$month='';
}
/* /*
@ -132,11 +139,6 @@ $offset = $conf->liste_limit * $page;
$pageprev = $page - 1; $pageprev = $page - 1;
$pagenext = $page + 1; $pagenext = $page + 1;
$viewstatut=$db->escape(GETPOST('viewstatut'));
$object_statut = $db->escape(GETPOST('propal_statut'));
if($object_statut != '')
$viewstatut=$object_statut;
if (! $sortfield) $sortfield='p.datep'; if (! $sortfield) $sortfield='p.datep';
if (! $sortorder) $sortorder='DESC'; if (! $sortorder) $sortorder='DESC';
$limit = $conf->liste_limit; $limit = $conf->liste_limit;
@ -322,10 +324,12 @@ if ($result)
print '<td class="liste_titre" align="right">'; print '<td class="liste_titre" align="right">';
$formpropal->selectProposalStatus($viewstatut,1); $formpropal->selectProposalStatus($viewstatut,1);
print '</td>'; print '</td>';
print '<td class="liste_titre" align="right">'; print '<td class="liste_titre" align="right">';
print '<input type="image" value="button_search" class="liste_titre" src="'.img_picto($langs->trans("Search"),'search.png','','',1).'" value="'.dol_escape_htmltag($langs->trans("Search")).'" title="'.dol_escape_htmltag($langs->trans("Search")).'">'; print '<input type="image" name="button_search" class="liste_titre" src="'.img_picto($langs->trans("Search"),'search.png','','',1).'" value="'.dol_escape_htmltag($langs->trans("Search")).'" title="'.dol_escape_htmltag($langs->trans("Search")).'">';
print '<input type="image" value="button_removefilter" class="liste_titre" src="'.img_picto($langs->trans("Search"),'searchclear.png','','',1).'" value="'.dol_escape_htmltag($langs->trans("RemoveFilter")).'" title="'.dol_escape_htmltag($langs->trans("RemoveFilter")).'">'; print '<input type="image" name="button_removefilter" class="liste_titre" src="'.img_picto($langs->trans("RemoveFilter"),'searchclear.png','','',1).'" value="'.dol_escape_htmltag($langs->trans("RemoveFilter")).'" title="'.dol_escape_htmltag($langs->trans("RemoveFilter")).'">';
print '</td>'; print '</td>';
print "</tr>\n"; print "</tr>\n";
$var=true; $var=true;
@ -391,7 +395,7 @@ if ($result)
// Date proposal // Date proposal
print '<td align="center">'; print '<td align="center">';
print dol_print_date($db->jdate($obj->dp), 'day'); print dol_print_date($db->jdate($objp->dp), 'day');
print "</td>\n"; print "</td>\n";
// Date end validity // Date end validity

View File

@ -801,6 +801,8 @@ class Commande extends CommonOrder
if (! $error) if (! $error)
{ {
$action='create';
// Actions on extra fields (by external module or standard code) // Actions on extra fields (by external module or standard code)
// FIXME le hook fait double emploi avec le trigger !! // FIXME le hook fait double emploi avec le trigger !!
$hookmanager->initHooks(array('orderdao')); $hookmanager->initHooks(array('orderdao'));
@ -998,7 +1000,12 @@ class Commande extends CommonOrder
$line->marge_tx = $marginInfos[1]; $line->marge_tx = $marginInfos[1];
$line->marque_tx = $marginInfos[2]; $line->marque_tx = $marginInfos[2];
$this->lines[$i] = $line; // get extrafields from original line
$object->lines[$i]->fetch_optionals($object->lines[$i]->rowid);
foreach($object->lines[$i]->array_options as $options_key => $value)
$line->array_options[$options_key] = $value;
$this->lines[$i] = $line;
} }
$this->socid = $object->socid; $this->socid = $object->socid;
@ -1019,6 +1026,11 @@ class Commande extends CommonOrder
$this->origin = $object->element; $this->origin = $object->element;
$this->origin_id = $object->id; $this->origin_id = $object->id;
// get extrafields from original line
$object->fetch_optionals($object->id);
foreach($object->array_options as $options_key => $value)
$this->array_options[$options_key] = $value;
// Possibility to add external linked objects with hooks // Possibility to add external linked objects with hooks
$this->linked_objects[$this->origin] = $this->origin_id; $this->linked_objects[$this->origin] = $this->origin_id;
if (is_array($object->other_linked_objects) && ! empty($object->other_linked_objects)) if (is_array($object->other_linked_objects) && ! empty($object->other_linked_objects))
@ -2928,6 +2940,8 @@ class Commande extends CommonOrder
*/ */
function update_extrafields($user) function update_extrafields($user)
{ {
$action='create';
// Actions on extra fields (by external module or standard code) // Actions on extra fields (by external module or standard code)
// FIXME le hook fait double emploi avec le trigger !! // FIXME le hook fait double emploi avec le trigger !!
$hookmanager->initHooks(array('orderdao')); $hookmanager->initHooks(array('orderdao'));
@ -3280,7 +3294,7 @@ class OrderLine extends CommonOrderLine
$error=0; $error=0;
dol_syslog("OrderLine::insert rang=".$this->rang); dol_syslog(get_class($this)."::insert rang=".$this->rang);
// Clean parameters // Clean parameters
if (empty($this->tva_tx)) $this->tva_tx=0; if (empty($this->tva_tx)) $this->tva_tx=0;

View File

@ -229,7 +229,7 @@ if ($resql)
if ($viewstatut == 1) if ($viewstatut == 1)
$title.=' - '.$langs->trans('StatusOrderValidatedShort'); $title.=' - '.$langs->trans('StatusOrderValidatedShort');
if ($viewstatut == 2) if ($viewstatut == 2)
$title.=' - '.$langs->trans('StatusOrderOnProcessShort'); $title.=' - '.$langs->trans('StatusOrderSentShort');
if ($viewstatut == 3) if ($viewstatut == 3)
$title.=' - '.$langs->trans('StatusOrderToBillShort'); $title.=' - '.$langs->trans('StatusOrderToBillShort');
if ($viewstatut == 4) if ($viewstatut == 4)

View File

@ -63,8 +63,7 @@ if ($action == 'update' && ! $_POST["cancel"])
$account->number = trim($_POST["number"]); $account->number = trim($_POST["number"]);
$account->cle_rib = trim($_POST["cle_rib"]); $account->cle_rib = trim($_POST["cle_rib"]);
$account->bic = trim($_POST["bic"]); $account->bic = trim($_POST["bic"]);
$account->iban = trim($_POST["iban_prefix"]); $account->iban = trim($_POST["iban"]);
$account->iban_prefix = trim($_POST["iban_prefix"]); // deprecated
$account->domiciliation = trim($_POST["domiciliation"]); $account->domiciliation = trim($_POST["domiciliation"]);
$account->proprio = trim($_POST["proprio"]); $account->proprio = trim($_POST["proprio"]);
$account->owner_address = trim($_POST["owner_address"]); $account->owner_address = trim($_POST["owner_address"]);
@ -246,7 +245,7 @@ if (($_GET["id"] || $_GET["ref"]) && $action != 'edit')
if ($account->getCountryCode() == 'IN') $bickey="SWIFT"; if ($account->getCountryCode() == 'IN') $bickey="SWIFT";
print '<tr><td valign="top">'.$langs->trans($ibankey).'</td>'; print '<tr><td valign="top">'.$langs->trans($ibankey).'</td>';
print '<td colspan="3">'.$account->iban_prefix.'</td></tr>'; print '<td colspan="3">'.$account->iban.'</td></tr>';
print '<tr><td valign="top">'.$langs->trans($bickey).'</td>'; print '<tr><td valign="top">'.$langs->trans($bickey).'</td>';
print '<td colspan="3">'.$account->bic.'</td></tr>'; print '<td colspan="3">'.$account->bic.'</td></tr>';
@ -423,7 +422,7 @@ if ($_GET["id"] && $action == 'edit' && $user->rights->banque->configurer)
// IBAN // IBAN
print '<tr><td valign="top">'.$langs->trans($ibankey).'</td>'; print '<tr><td valign="top">'.$langs->trans($ibankey).'</td>';
print '<td colspan="3"><input size="34" maxlength="34" type="text" class="flat" name="iban_prefix" value="'.$account->iban_prefix.'"></td></tr>'; print '<td colspan="3"><input size="34" maxlength="34" type="text" class="flat" name="iban" value="'.$account->iban.'"></td></tr>';
print '<tr><td valign="top">'.$langs->trans($bickey).'</td>'; print '<tr><td valign="top">'.$langs->trans($bickey).'</td>';
print '<td colspan="3"><input size="11" maxlength="11" type="text" class="flat" name="bic" value="'.$account->bic.'"></td></tr>'; print '<td colspan="3"><input size="11" maxlength="11" type="text" class="flat" name="bic" value="'.$account->bic.'"></td></tr>';

View File

@ -135,7 +135,7 @@ if ($_POST["action"] == 'update' && ! $_POST["cancel"])
$account->number = trim($_POST["number"]); $account->number = trim($_POST["number"]);
$account->cle_rib = trim($_POST["cle_rib"]); $account->cle_rib = trim($_POST["cle_rib"]);
$account->bic = trim($_POST["bic"]); $account->bic = trim($_POST["bic"]);
$account->iban_prefix = trim($_POST["iban_prefix"]); $account->iban = trim($_POST["iban"]);
$account->domiciliation = trim($_POST["domiciliation"]); $account->domiciliation = trim($_POST["domiciliation"]);
$account->proprio = trim($_POST["proprio"]); $account->proprio = trim($_POST["proprio"]);

View File

@ -59,7 +59,7 @@ class Account extends CommonObject
//! BIC/SWIFT number //! BIC/SWIFT number
var $bic; var $bic;
//! IBAN number (International Bank Account Number) //! IBAN number (International Bank Account Number)
var $iban_prefix; var $iban; // stored into iban_prefix field into database
var $proprio; var $proprio;
var $owner_address; var $owner_address;
@ -642,7 +642,6 @@ class Account extends CommonObject
$this->cle_rib = $obj->cle_rib; $this->cle_rib = $obj->cle_rib;
$this->bic = $obj->bic; $this->bic = $obj->bic;
$this->iban = $obj->iban; $this->iban = $obj->iban;
$this->iban_prefix = $obj->iban; // deprecated
$this->domiciliation = $obj->domiciliation; $this->domiciliation = $obj->domiciliation;
$this->proprio = $obj->proprio; $this->proprio = $obj->proprio;
$this->owner_address = $obj->owner_address; $this->owner_address = $obj->owner_address;
@ -1011,7 +1010,6 @@ class Account extends CommonObject
$this->cle_rib = 50; $this->cle_rib = 50;
$this->bic = 'AA12'; $this->bic = 'AA12';
$this->iban = 'FR999999999'; $this->iban = 'FR999999999';
$this->iban_prefix = 'FR'; // deprecated
$this->domiciliation = 'The bank addresse'; $this->domiciliation = 'The bank addresse';
$this->proprio = 'Owner'; $this->proprio = 'Owner';
$this->owner_address = 'Owner address'; $this->owner_address = 'Owner address';
@ -1145,7 +1143,7 @@ class AccountLine extends CommonObject
* @param User $user User object that delete * @param User $user User object that delete
* @return int <0 if KO, >0 if OK * @return int <0 if KO, >0 if OK
*/ */
function delete($user=0) function delete($user=null)
{ {
$nbko=0; $nbko=0;
@ -1194,7 +1192,7 @@ class AccountLine extends CommonObject
* @param User $user User object that delete * @param User $user User object that delete
* @return int <0 if KO, >0 if OK * @return int <0 if KO, >0 if OK
*/ */
function delete_urls($user=0) function delete_urls($user=null)
{ {
$nbko=0; $nbko=0;

View File

@ -172,7 +172,7 @@ class BankCateg // extends CommonObject
* @param int $notrigger 0=launch triggers after, 1=disable triggers * @param int $notrigger 0=launch triggers after, 1=disable triggers
* @return int <0 if KO, >0 if OK * @return int <0 if KO, >0 if OK
*/ */
function update($user=0, $notrigger=0) function update($user=null, $notrigger=0)
{ {
global $conf, $langs; global $conf, $langs;
$error=0; $error=0;

View File

@ -157,7 +157,7 @@ if ($_REQUEST["account"] || $_REQUEST["ref"])
$sql.= " ORDER BY dlr ASC"; $sql.= " ORDER BY dlr ASC";
// Supplier invoices // Supplier invoices
$sql2= " SELECT 'invoice_supplier' as family, ff.rowid as objid, ff.ref_supplier as ref, (-1*ff.total_ttc) as total_ttc, ff.type, ff.date_lim_reglement as dlr,"; $sql2= " SELECT 'invoice_supplier' as family, ff.rowid as objid, ff.ref as ref, ff.ref_supplier as ref_supplier, (-1*ff.total_ttc) as total_ttc, ff.type, ff.date_lim_reglement as dlr,";
$sql2.= " s.rowid as socid, s.nom as name, s.fournisseur"; $sql2.= " s.rowid as socid, s.nom as name, s.fournisseur";
$sql2.= " FROM ".MAIN_DB_PREFIX."facture_fourn as ff"; $sql2.= " FROM ".MAIN_DB_PREFIX."facture_fourn as ff";
$sql2.= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON ff.fk_soc = s.rowid"; $sql2.= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON ff.fk_soc = s.rowid";
@ -254,12 +254,13 @@ if ($_REQUEST["account"] || $_REQUEST["ref"])
if ($obj->family == 'invoice_supplier') if ($obj->family == 'invoice_supplier')
{ {
// TODO This code is to avoid to count suppliers credit note (ff.type = 2) $showline=1;
// Ajouter gestion des avoirs fournisseurs, champ // Uncomment this line to avoid to count suppliers credit note (ff.type = 2)
if (($obj->total_ttc < 0 && $obj->type != 2) //$showline=(($obj->total_ttc < 0 && $obj->type != 2) || ($obj->total_ttc > 0 && $obj->type == 2))
|| ($obj->total_ttc > 0 && $obj->type == 2)) if ($showline)
{ {
$facturefournstatic->ref=$obj->ref; $ref=$obj->ref;
$facturefournstatic->ref=$ref;
$facturefournstatic->id=$obj->objid; $facturefournstatic->id=$obj->objid;
$facturefournstatic->type=$obj->type; $facturefournstatic->type=$obj->type;
$ref = $facturefournstatic->getNomUrl(1,''); $ref = $facturefournstatic->getNomUrl(1,'');
@ -298,7 +299,7 @@ if ($_REQUEST["account"] || $_REQUEST["ref"])
if ($paiement) $total_ttc = $obj->total_ttc - $paiement; if ($paiement) $total_ttc = $obj->total_ttc - $paiement;
$solde += $total_ttc; $solde += $total_ttc;
// We discard with a remain to pay to 0 // We discard lines with a remainder to pay to 0
if (price2num($total_ttc) != 0) if (price2num($total_ttc) != 0)
{ {
$var=!$var; $var=!$var;

View File

@ -464,6 +464,8 @@ class Facture extends CommonInvoice
$result=$this->update_price(1); $result=$this->update_price(1);
if ($result > 0) if ($result > 0)
{ {
$action='create';
// Actions on extra fields (by external module or standard code) // Actions on extra fields (by external module or standard code)
// FIXME le hook fait double emploi avec le trigger !! // FIXME le hook fait double emploi avec le trigger !!
$hookmanager->initHooks(array('invoicedao')); $hookmanager->initHooks(array('invoicedao'));
@ -733,6 +735,11 @@ class Facture extends CommonInvoice
$marginInfos = getMarginInfos($object->lines[$i]->subprice, $object->lines[$i]->remise_percent, $object->lines[$i]->tva_tx, $object->lines[$i]->localtax1_tx, $object->lines[$i]->localtax2_tx, $object->lines[$i]->fk_fournprice, $object->lines[$i]->pa_ht); $marginInfos = getMarginInfos($object->lines[$i]->subprice, $object->lines[$i]->remise_percent, $object->lines[$i]->tva_tx, $object->lines[$i]->localtax1_tx, $object->lines[$i]->localtax2_tx, $object->lines[$i]->fk_fournprice, $object->lines[$i]->pa_ht);
$line->pa_ht = $marginInfos[0]; $line->pa_ht = $marginInfos[0];
// get extrafields from original line
$object->lines[$i]->fetch_optionals($object->lines[$i]->rowid);
foreach($object->lines[$i]->array_options as $options_key => $value)
$line->array_options[$options_key] = $value;
$this->lines[$i] = $line; $this->lines[$i] = $line;
} }
@ -752,6 +759,11 @@ class Facture extends CommonInvoice
$this->origin = $object->element; $this->origin = $object->element;
$this->origin_id = $object->id; $this->origin_id = $object->id;
// get extrafields from original line
$object->fetch_optionals($object->id);
foreach($object->array_options as $options_key => $value)
$this->array_options[$options_key] = $value;
// Possibility to add external linked objects with hooks // Possibility to add external linked objects with hooks
$this->linked_objects[$this->origin] = $this->origin_id; $this->linked_objects[$this->origin] = $this->origin_id;
if (! empty($object->other_linked_objects) && is_array($object->other_linked_objects)) if (! empty($object->other_linked_objects) && is_array($object->other_linked_objects))
@ -1040,7 +1052,7 @@ class Facture extends CommonInvoice
* @param int $notrigger 0=launch triggers after, 1=disable triggers * @param int $notrigger 0=launch triggers after, 1=disable triggers
* @return int <0 if KO, >0 if OK * @return int <0 if KO, >0 if OK
*/ */
function update($user=0, $notrigger=0) function update($user=null, $notrigger=0)
{ {
global $conf, $langs; global $conf, $langs;
$error=0; $error=0;

View File

@ -261,7 +261,7 @@ class PaymentTerm // extends CommonObject
* @param int $notrigger 0=launch triggers after, 1=disable triggers * @param int $notrigger 0=launch triggers after, 1=disable triggers
* @return int <0 if KO, >0 if OK * @return int <0 if KO, >0 if OK
*/ */
function update($user=0, $notrigger=0) function update($user=null, $notrigger=0)
{ {
global $conf, $langs; global $conf, $langs;
$error=0; $error=0;

View File

@ -429,7 +429,8 @@ if ($search_paymentmode) $sql .= " AND f.fk_mode_reglement = ".$search_payme
if ($search_montant_ht) $sql .= " AND f.total = '".$db->escape($search_montant_ht)."'"; if ($search_montant_ht) $sql .= " AND f.total = '".$db->escape($search_montant_ht)."'";
if ($search_montant_ttc) $sql .= " AND f.total_ttc = '".$db->escape($search_montant_ttc)."'"; if ($search_montant_ttc) $sql .= " AND f.total_ttc = '".$db->escape($search_montant_ttc)."'";
if (GETPOST('sf_ref')) $sql .= " AND f.facnumber LIKE '%".$db->escape(GETPOST('sf_ref'))."%'"; if (GETPOST('sf_ref')) $sql .= " AND f.facnumber LIKE '%".$db->escape(GETPOST('sf_ref'))."%'";
$sql.= " GROUP BY s.nom, s.rowid, s.email, f.rowid, f.facnumber, f.increment, f.total, f.tva, f.total_ttc, f.localtax1, f.localtax2, f.revenuestamp, f.datef, f.date_lim_reglement, f.paye, f.fk_statut, f.type "; $sql.= " GROUP BY s.nom, s.rowid, s.email, f.rowid, f.facnumber, f.ref_client, f.increment, f.total, f.tva, f.total_ttc, f.localtax1, f.localtax2, f.revenuestamp,";
$sql.= " f.datef, f.date_lim_reglement, f.paye, f.fk_statut, f.type, fk_mode_reglement";
if (! $user->rights->societe->client->voir && ! $socid) $sql .= ", sc.fk_soc, sc.fk_user "; if (! $user->rights->societe->client->voir && ! $socid) $sql .= ", sc.fk_soc, sc.fk_user ";
$sql.= " ORDER BY "; $sql.= " ORDER BY ";
$listfield=explode(',',$sortfield); $listfield=explode(',',$sortfield);

View File

@ -127,7 +127,7 @@ class Localtax extends CommonObject
* @param int $notrigger 0=no, 1=yes (no update trigger) * @param int $notrigger 0=no, 1=yes (no update trigger)
* @return int <0 if KO, >0 if OK * @return int <0 if KO, >0 if OK
*/ */
function update($user=0, $notrigger=0) function update($user=null, $notrigger=0)
{ {
global $conf, $langs; global $conf, $langs;

View File

@ -29,6 +29,8 @@ require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
$langs->load("banks"); $langs->load("banks");
$langs->load("categories"); $langs->load("categories");
$langs->load("compta");
$langs->load("bills");
// Security check // Security check
if ($user->societe_id) $socid=$user->societe_id; if ($user->societe_id) $socid=$user->societe_id;

View File

@ -755,6 +755,8 @@ class BonPrelevement extends CommonObject
$factures = array(); $factures = array();
$factures_prev = array(); $factures_prev = array();
$factures_result = array(); $factures_result = array();
$factures_prev_id=array();
$factures_errors=array();
if (! $error) if (! $error)
{ {

View File

@ -73,7 +73,7 @@ class PaymentSalary extends CommonObject
* @param int $notrigger 0=no, 1=yes (no update trigger) * @param int $notrigger 0=no, 1=yes (no update trigger)
* @return int <0 if KO, >0 if OK * @return int <0 if KO, >0 if OK
*/ */
function update($user=0, $notrigger=0) function update($user=null, $notrigger=0)
{ {
global $conf, $langs; global $conf, $langs;
@ -144,7 +144,7 @@ class PaymentSalary extends CommonObject
* @param User $user User that load * @param User $user User that load
* @return int <0 if KO, >0 if OK * @return int <0 if KO, >0 if OK
*/ */
function fetch($id, $user=0) function fetch($id, $user=null)
{ {
global $langs; global $langs;
$sql = "SELECT"; $sql = "SELECT";
@ -414,7 +414,6 @@ class PaymentSalary extends CommonObject
$this->fk_user, $this->fk_user,
DOL_URL_ROOT.'/user/card.php?id=', DOL_URL_ROOT.'/user/card.php?id=',
$langs->trans("SalaryPayment").' '.$fuser->getFullName($langs).' '.dol_print_date($this->datesp,'dayrfc').' '.dol_print_date($this->dateep,'dayrfc'), $langs->trans("SalaryPayment").' '.$fuser->getFullName($langs).' '.dol_print_date($this->datesp,'dayrfc').' '.dol_print_date($this->dateep,'dayrfc'),
'(User)',
'user' 'user'
); );

View File

@ -62,17 +62,19 @@ class ChargeSociales extends CommonObject
/** /**
* Retrouve et charge une charge sociale * Retrouve et charge une charge sociale
* *
* @param int $id 1 si trouve, 0 sinon * @param int $id Id
* @param string $ref Ref
* @return void * @return void
*/ */
function fetch($id) function fetch($id, $ref='')
{ {
$sql = "SELECT cs.rowid, cs.date_ech,"; $sql = "SELECT cs.rowid, cs.date_ech,";
$sql.= " cs.libelle as lib, cs.fk_type, cs.amount, cs.paye, cs.periode,"; $sql.= " cs.libelle as lib, cs.fk_type, cs.amount, cs.paye, cs.periode,";
$sql.= " c.libelle"; $sql.= " c.libelle";
$sql.= " FROM ".MAIN_DB_PREFIX."chargesociales as cs, ".MAIN_DB_PREFIX."c_chargesociales as c"; $sql.= " FROM ".MAIN_DB_PREFIX."chargesociales as cs, ".MAIN_DB_PREFIX."c_chargesociales as c";
$sql.= " WHERE cs.fk_type = c.id"; $sql.= " WHERE cs.fk_type = c.id";
$sql.= " AND cs.rowid = ".$id; if ($ref) $sql.= " AND cs.rowid = ".$ref;
else $sql.= " AND cs.rowid = ".$id;
dol_syslog(get_class($this)."::fetch", LOG_DEBUG); dol_syslog(get_class($this)."::fetch", LOG_DEBUG);
$resql=$this->db->query($sql); $resql=$this->db->query($sql);

View File

@ -220,7 +220,7 @@ class PaymentSocialContribution extends CommonObject
* @param int $notrigger 0=launch triggers after, 1=disable triggers * @param int $notrigger 0=launch triggers after, 1=disable triggers
* @return int <0 if KO, >0 if OK * @return int <0 if KO, >0 if OK
*/ */
function update($user=0, $notrigger=0) function update($user=null, $notrigger=0)
{ {
global $conf, $langs; global $conf, $langs;
$error=0; $error=0;

View File

@ -132,6 +132,8 @@ $tableparams = array_merge($commonparams, $tableparams);
foreach($allparams as $key => $value) { foreach($allparams as $key => $value) {
$paramslink .= '&' . $key . '=' . $value; $paramslink .= '&' . $key . '=' . $value;
} }
/* /*
* View * View
*/ */
@ -209,7 +211,7 @@ if ($modecompta == 'CREANCES-DETTES')
$sql.= " AND cp.fk_categorie = c.rowid AND cp.fk_product = p.rowid"; $sql.= " AND cp.fk_categorie = c.rowid AND cp.fk_product = p.rowid";
} }
$sql.= " AND f.entity = ".$conf->entity; $sql.= " AND f.entity = ".$conf->entity;
$sql.= " GROUP BY p.rowid"; $sql.= " GROUP BY p.rowid, p.ref, p.label";
$sql.= " ORDER BY p.ref"; $sql.= " ORDER BY p.ref";
dol_syslog("cabyprodserv", LOG_DEBUG); dol_syslog("cabyprodserv", LOG_DEBUG);

View File

@ -143,7 +143,7 @@ class Tva extends CommonObject
* @param int $notrigger 0=no, 1=yes (no update trigger) * @param int $notrigger 0=no, 1=yes (no update trigger)
* @return int <0 if KO, >0 if OK * @return int <0 if KO, >0 if OK
*/ */
function update($user=0, $notrigger=0) function update($user=null, $notrigger=0)
{ {
global $conf, $langs; global $conf, $langs;
@ -205,7 +205,7 @@ class Tva extends CommonObject
* @param User $user User that load * @param User $user User that load
* @return int <0 if KO, >0 if OK * @return int <0 if KO, >0 if OK
*/ */
function fetch($id, $user=0) function fetch($id, $user=null)
{ {
global $langs; global $langs;
$sql = "SELECT"; $sql = "SELECT";

View File

@ -97,7 +97,6 @@ if ($filtre) {
if ($typeid) { if ($typeid) {
$sql .= " AND t.fk_typepayment=".$typeid; $sql .= " AND t.fk_typepayment=".$typeid;
} }
$sql.= " GROUP BY t.rowid, t.fk_typepayment, t.amount, t.datev, t.label";
$sql.= $db->order($sortfield,$sortorder); $sql.= $db->order($sortfield,$sortorder);
$sql.= $db->plimit($limit+1,$offset); $sql.= $db->plimit($limit+1,$offset);
@ -186,6 +185,6 @@ else
} }
$db->close();
llxFooter(); llxFooter();
$db->close();

View File

@ -220,7 +220,7 @@ class Contact extends CommonObject
* @param string $action Current action for hookmanager * @param string $action Current action for hookmanager
* @return int <0 if KO, >0 if OK * @return int <0 if KO, >0 if OK
*/ */
function update($id, $user=0, $notrigger=0, $action='update') function update($id, $user=null, $notrigger=0, $action='update')
{ {
global $conf, $langs, $hookmanager; global $conf, $langs, $hookmanager;
@ -283,6 +283,8 @@ class Contact extends CommonObject
unset($this->state_code); unset($this->state_code);
unset($this->state); unset($this->state);
$action='update';
// Actions on extra fields (by external module or standard code) // Actions on extra fields (by external module or standard code)
$hookmanager->initHooks(array('contactdao')); $hookmanager->initHooks(array('contactdao'));
$parameters=array('socid'=>$this->id); $parameters=array('socid'=>$this->id);
@ -427,7 +429,7 @@ class Contact extends CommonObject
* @param User $user User asking to change alert or birthday * @param User $user User asking to change alert or birthday
* @return int <0 if KO, >=0 if OK * @return int <0 if KO, >=0 if OK
*/ */
function update_perso($id, $user=0) function update_perso($id, $user=null)
{ {
$error=0; $error=0;
$result=false; $result=false;
@ -492,7 +494,7 @@ class Contact extends CommonObject
* @param User $user Utilisateur (abonnes aux alertes) qui veut les alertes de ce contact * @param User $user Utilisateur (abonnes aux alertes) qui veut les alertes de ce contact
* @return int -1 if KO, 0 if OK but not found, 1 if OK * @return int -1 if KO, 0 if OK but not found, 1 if OK
*/ */
function fetch($id, $user=0) function fetch($id, $user=null)
{ {
global $langs; global $langs;
@ -910,7 +912,7 @@ class Contact extends CommonObject
global $langs; global $langs;
$langs->load("dict"); $langs->load("dict");
$code=(! empty($this->civility_id)?$this->civility_id:(! empty($this->civility_id)?$this->civility_id:'')); $code=(! empty($this->civility_id)?$this->civility_id:(! empty($this->civilite_id)?$this->civilite_id:''));
if (empty($code)) return ''; if (empty($code)) return '';
return $langs->getLabelFromKey($this->db, "Civility".$code, "c_civility", "code", "label", $code); return $langs->getLabelFromKey($this->db, "Civility".$code, "c_civility", "code", "label", $code);
} }

View File

@ -53,7 +53,7 @@ $search_email=GETPOST("search_email");
$search_skype=GETPOST("search_skype"); $search_skype=GETPOST("search_skype");
$search_priv=GETPOST("search_priv"); $search_priv=GETPOST("search_priv");
$search_categ=GETPOST("search_categ",'int'); $search_categ=GETPOST("search_categ",'int');
$search_statu=GETPOST("search_status",'int'); $search_status=GETPOST("search_status",'int');
if ($search_status=='') $search_status=1; // always display activ customer first if ($search_status=='') $search_status=1; // always display activ customer first
@ -96,9 +96,9 @@ else if ($type == "o")
$urlfiche=""; $urlfiche="";
} }
if (GETPOST('button_removefilter')) if (GETPOST('button_removefilter_x') || GETPOST('button_removefilter')) // Both tests are required to be compatible with all browsers
{ {
$search_firstlast_only=""; $search_firstlast_only="";
$search_lastname=""; $search_lastname="";
$search_firstname=""; $search_firstname="";
$search_societe=""; $search_societe="";
@ -302,7 +302,7 @@ if ($result)
print_liste_field_titre($langs->trans("PostOrFunction"),$_SERVER["PHP_SELF"],"p.poste", $begin, $param, '', $sortfield,$sortorder); print_liste_field_titre($langs->trans("PostOrFunction"),$_SERVER["PHP_SELF"],"p.poste", $begin, $param, '', $sortfield,$sortorder);
if (empty($conf->global->SOCIETE_DISABLE_CONTACTS)) print_liste_field_titre($langs->trans("Company"),$_SERVER["PHP_SELF"],"s.nom", $begin, $param, '', $sortfield,$sortorder); if (empty($conf->global->SOCIETE_DISABLE_CONTACTS)) print_liste_field_titre($langs->trans("Company"),$_SERVER["PHP_SELF"],"s.nom", $begin, $param, '', $sortfield,$sortorder);
print_liste_field_titre($langs->trans("Phone"),$_SERVER["PHP_SELF"],"p.phone", $begin, $param, '', $sortfield,$sortorder); print_liste_field_titre($langs->trans("Phone"),$_SERVER["PHP_SELF"],"p.phone", $begin, $param, '', $sortfield,$sortorder);
print_liste_field_titre($langs->trans("PhoneMobile"),$_SERVER["PHP_SELF"],"p.phone_mob", $begin, $param, '', $sortfield,$sortorder); print_liste_field_titre($langs->trans("PhoneMobile"),$_SERVER["PHP_SELF"],"p.phone_mobile", $begin, $param, '', $sortfield,$sortorder);
print_liste_field_titre($langs->trans("Fax"),$_SERVER["PHP_SELF"],"p.fax", $begin, $param, '', $sortfield,$sortorder); print_liste_field_titre($langs->trans("Fax"),$_SERVER["PHP_SELF"],"p.fax", $begin, $param, '', $sortfield,$sortorder);
print_liste_field_titre($langs->trans("EMail"),$_SERVER["PHP_SELF"],"p.email", $begin, $param, '', $sortfield,$sortorder); print_liste_field_titre($langs->trans("EMail"),$_SERVER["PHP_SELF"],"p.email", $begin, $param, '', $sortfield,$sortorder);
if (! empty($conf->skype->enabled)) { print_liste_field_titre($langs->trans("Skype"),$_SERVER["PHP_SELF"],"p.skype", $begin, $param, '', $sortfield,$sortorder); } if (! empty($conf->skype->enabled)) { print_liste_field_titre($langs->trans("Skype"),$_SERVER["PHP_SELF"],"p.skype", $begin, $param, '', $sortfield,$sortorder); }
@ -356,8 +356,8 @@ if ($result)
print $form->selectarray('search_status', array('0'=>$langs->trans('ActivityCeased'),'1'=>$langs->trans('InActivity')),$search_status); print $form->selectarray('search_status', array('0'=>$langs->trans('ActivityCeased'),'1'=>$langs->trans('InActivity')),$search_status);
print '</td>'; print '</td>';
print '<td class="liste_titre" align="right">'; print '<td class="liste_titre" align="right">';
print '<input type="image" value="button_search" class="liste_titre" src="'.img_picto($langs->trans("Search"),'search.png','','',1).'" value="'.dol_escape_htmltag($langs->trans("Search")).'" title="'.dol_escape_htmltag($langs->trans("Search")).'">'; print '<input type="image" name="button_search" class="liste_titre" src="'.img_picto($langs->trans("Search"),'search.png','','',1).'" value="'.dol_escape_htmltag($langs->trans("Search")).'" title="'.dol_escape_htmltag($langs->trans("Search")).'">';
print '<input type="image" value="button_removefilter" class="liste_titre" src="'.img_picto($langs->trans("Search"),'searchclear.png','','',1).'" value="'.dol_escape_htmltag($langs->trans("RemoveFilter")).'" title="'.dol_escape_htmltag($langs->trans("RemoveFilter")).'">'; print '<input type="image" name="button_removefilter" class="liste_titre" src="'.img_picto($langs->trans("RemoveFilter"),'searchclear.png','','',1).'" value="'.dol_escape_htmltag($langs->trans("RemoveFilter")).'" title="'.dol_escape_htmltag($langs->trans("RemoveFilter")).'">';
print '</td>'; print '</td>';
print '</tr>'; print '</tr>';

View File

@ -935,8 +935,8 @@ if ($action == 'create')
} }
print '<tr><td class="fieldrequired">'.$langs->trans('Ref').'</td><td colspan="2">'.$tmpcode.'</td></tr>'; print '<tr><td class="fieldrequired">'.$langs->trans('Ref').'</td><td colspan="2">'.$tmpcode.'</td></tr>';
// Ref Int // Ref supplier
print '<tr><td>'.$langs->trans('RefCustomer').'</td>'; print '<tr><td>'.$langs->trans('RefSupplier').'</td>';
print '<td colspan="2"><input type="text" size="5" name="ref_supplier" id="ref_supplier" value="'.GETPOST('ref_supplier','alpha').'"></td></tr>'; print '<td colspan="2"><input type="text" size="5" name="ref_supplier" id="ref_supplier" value="'.GETPOST('ref_supplier','alpha').'"></td></tr>';
// Customer // Customer
@ -1134,9 +1134,9 @@ else
print '<tr>'; print '<tr>';
print '<td width="20%">'; print '<td width="20%">';
print $form->editfieldkey("RefCustomer",'ref_supplier',$object->ref_supplier,$object,$user->rights->contrat->creer); print $form->editfieldkey("RefSupplier",'ref_supplier',$object->ref_supplier,$object,$user->rights->contrat->creer);
print '</td><td>'; print '</td><td>';
print $form->editfieldval("RefCustomer",'ref_supplier',$object->ref_supplier,$object,$user->rights->contrat->creer); print $form->editfieldval("RefSupplier",'ref_supplier',$object->ref_supplier,$object,$user->rights->contrat->creer);
print '</td>'; print '</td>';
print '</tr>'; print '</tr>';
@ -1290,7 +1290,8 @@ else
$productstatic->ref=$objp->label; $productstatic->ref=$objp->label;
print $productstatic->getNomUrl(0,'',16); print $productstatic->getNomUrl(0,'',16);
} }
if ($objp->description) print '<br>'.dol_nl2br($objp->description); if (! empty($conf->global->PRODUIT_DESC_IN_FORM) and $objp->description)
print '<br>'.dol_nl2br($objp->description);
print '</td>'; print '</td>';
} }
else else

View File

@ -989,7 +989,7 @@ class Contrat extends CommonObject
* @param int $notrigger 0=launch triggers after, 1=disable triggers * @param int $notrigger 0=launch triggers after, 1=disable triggers
* @return int <0 if KO, >0 if OK * @return int <0 if KO, >0 if OK
*/ */
function update($user=0, $notrigger=0) function update($user=null, $notrigger=0)
{ {
global $conf, $langs; global $conf, $langs;
$error=0; $error=0;

View File

@ -79,14 +79,13 @@ $now=dol_now();
llxHeader(); llxHeader();
$sql = 'SELECT'; $sql = 'SELECT';
$sql.= " c.rowid as cid, c.ref, c.datec, c.date_contrat, c.statut, c.ref_supplier,";
$sql.= " s.nom as name, s.rowid as socid,";
$sql.= ' SUM('.$db->ifsql("cd.statut=0",1,0).') as nb_initial,'; $sql.= ' SUM('.$db->ifsql("cd.statut=0",1,0).') as nb_initial,';
$sql.= ' SUM('.$db->ifsql("cd.statut=4 AND (cd.date_fin_validite IS NULL OR cd.date_fin_validite >= '".$db->idate($now)."')",1,0).') as nb_running,'; $sql.= ' SUM('.$db->ifsql("cd.statut=4 AND (cd.date_fin_validite IS NULL OR cd.date_fin_validite >= '".$db->idate($now)."')",1,0).') as nb_running,';
$sql.= ' SUM('.$db->ifsql("cd.statut=4 AND (cd.date_fin_validite IS NOT NULL AND cd.date_fin_validite < '".$db->idate($now)."')",1,0).') as nb_expired,'; $sql.= ' SUM('.$db->ifsql("cd.statut=4 AND (cd.date_fin_validite IS NOT NULL AND cd.date_fin_validite < '".$db->idate($now)."')",1,0).') as nb_expired,';
$sql.= ' SUM('.$db->ifsql("cd.statut=4 AND (cd.date_fin_validite IS NOT NULL AND cd.date_fin_validite < '".$db->idate($now - $conf->contrat->services->expires->warning_delay)."')",1,0).') as nb_late,'; $sql.= ' SUM('.$db->ifsql("cd.statut=4 AND (cd.date_fin_validite IS NOT NULL AND cd.date_fin_validite < '".$db->idate($now - $conf->contrat->services->expires->warning_delay)."')",1,0).') as nb_late,';
$sql.= ' SUM('.$db->ifsql("cd.statut=5",1,0).') as nb_closed,'; $sql.= ' SUM('.$db->ifsql("cd.statut=5",1,0).') as nb_closed';
$sql.= " c.rowid as cid, c.ref, c.datec, c.date_contrat, c.statut,";
$sql.= " s.nom as name, s.rowid as socid";
$sql.= " ,c.ref_supplier";
$sql.= " FROM ".MAIN_DB_PREFIX."societe as s"; $sql.= " FROM ".MAIN_DB_PREFIX."societe as s";
if (!$user->rights->societe->client->voir && !$socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; if (!$user->rights->societe->client->voir && !$socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
$sql.= ", ".MAIN_DB_PREFIX."contrat as c"; $sql.= ", ".MAIN_DB_PREFIX."contrat as c";
@ -107,7 +106,7 @@ if (!empty($search_ref_supplier)) {
if ($sall) { if ($sall) {
$sql .= natural_search(array('s.nom', 'cd.label', 'cd.description'), $sall); $sql .= natural_search(array('s.nom', 'cd.label', 'cd.description'), $sall);
} }
$sql.= " GROUP BY c.rowid, c.ref, c.datec, c.date_contrat, c.statut, s.nom, s.rowid"; $sql.= " GROUP BY c.rowid, c.ref, c.datec, c.date_contrat, c.statut, c.ref_supplier, s.nom, s.rowid";
$sql.= $db->order($sortfield,$sortorder); $sql.= $db->order($sortfield,$sortorder);
$sql.= $db->plimit($conf->liste_limit + 1, $offset); $sql.= $db->plimit($conf->liste_limit + 1, $offset);

View File

@ -159,6 +159,7 @@ class box_actions extends ModeleBoxes
$actioncejour=false; $actioncejour=false;
$contents=$this->info_box_contents; $contents=$this->info_box_contents;
$nblines=count($contents); $nblines=count($contents);
$bcx=array();
$bcx[0] = 'class="box_pair"'; $bcx[0] = 'class="box_pair"';
$bcx[1] = 'class="box_impair"'; $bcx[1] = 'class="box_impair"';
if ($contents[0][0]['text'] != $langs->trans("NoActionsToDo")) if ($contents[0][0]['text'] != $langs->trans("NoActionsToDo"))

View File

@ -79,7 +79,7 @@ class box_comptes extends ModeleBoxes
if ($user->rights->banque->lire) if ($user->rights->banque->lire)
{ {
$sql = "SELECT rowid, ref, label, bank, number, courant, clos, rappro, url,"; $sql = "SELECT rowid, ref, label, bank, number, courant, clos, rappro, url,";
$sql.= " code_banque, code_guichet, cle_rib, bic, iban_prefix,"; $sql.= " code_banque, code_guichet, cle_rib, bic, iban_prefix as iban,";
$sql.= " domiciliation, proprio, owner_address,"; $sql.= " domiciliation, proprio, owner_address,";
$sql.= " account_number, currency_code,"; $sql.= " account_number, currency_code,";
$sql.= " min_allowed, min_desired, comment"; $sql.= " min_allowed, min_desired, comment";

View File

@ -181,6 +181,7 @@ class ModeleBoxes // Can't be abtract as it is instantiated to build "empty"
global $langs,$conf; global $langs,$conf;
$MAXLENGTHBOX=60; // Mettre 0 pour pas de limite $MAXLENGTHBOX=60; // Mettre 0 pour pas de limite
$bcx=array();
$bcx[0] = 'class="box_pair"'; $bcx[0] = 'class="box_pair"';
$bcx[1] = 'class="box_impair"'; $bcx[1] = 'class="box_impair"';
$var = false; $var = false;

View File

@ -191,7 +191,7 @@ class Ccountry // extends CommonObject
* @param int $notrigger 0=launch triggers after, 1=disable triggers * @param int $notrigger 0=launch triggers after, 1=disable triggers
* @return int <0 if KO, >0 if OK * @return int <0 if KO, >0 if OK
*/ */
function update($user=0, $notrigger=0) function update($user=null, $notrigger=0)
{ {
global $conf, $langs; global $conf, $langs;
$error=0; $error=0;
@ -256,10 +256,10 @@ class Ccountry // extends CommonObject
/** /**
* Delete object in database * Delete object in database
* *
* @param User $user User that delete * @param User $user User that delete
* @param int $notrigger 0=launch triggers after, 1=disable triggers * @param int $notrigger 0=launch triggers after, 1=disable triggers
* @return int <0 if KO, >0 if OK * @return int <0 if KO, >0 if OK
*/ */
function delete($user, $notrigger=0) function delete($user, $notrigger=0)

View File

@ -3,7 +3,7 @@
* Copyright (C) 2005-2013 Regis Houssin <regis.houssin@capnetworks.com> * Copyright (C) 2005-2013 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2010-2013 Juanjo Menent <jmenent@2byte.es> * Copyright (C) 2010-2013 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2012 Christophe Battarel <christophe.battarel@altairis.fr> * Copyright (C) 2012 Christophe Battarel <christophe.battarel@altairis.fr>
* Copyright (C) 2010-2011 Juanjo Menent <jmenent@2byte.es> * Copyright (C) 2010-2014 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2012-2013 Christophe Battarel <christophe.battarel@altairis.fr> * Copyright (C) 2012-2013 Christophe Battarel <christophe.battarel@altairis.fr>
* Copyright (C) 2011-2014 Philippe Grand <philippe.grand@atoo-net.com> * Copyright (C) 2011-2014 Philippe Grand <philippe.grand@atoo-net.com>
* Copyright (C) 2012 Marcos García <marcosgdf@gmail.com> * Copyright (C) 2012 Marcos García <marcosgdf@gmail.com>
@ -34,7 +34,7 @@
*/ */
abstract class CommonObject abstract class CommonObject
{ {
protected $db; public $db;
public $error; public $error;
public $errors; public $errors;
public $canvas; // Contains canvas name if it is public $canvas; // Contains canvas name if it is
@ -601,18 +601,22 @@ abstract class CommonObject
/** /**
* Load the third party of object, from id $this->socid or $this->fk_soc, into this->thirdparty * Load the third party of object, from id $this->socid or $this->fk_soc, into this->thirdparty
* *
* @return int <0 if KO, >0 if OK * @param int $force_thirdparty_id Force thirdparty id
* @return int <0 if KO, >0 if OK
*/ */
function fetch_thirdparty() function fetch_thirdparty($force_thirdparty_id=0)
{ {
global $conf; global $conf;
if (empty($this->socid) && empty($this->fk_soc) && empty($this->fk_thirdparty)) return 0; if (empty($this->socid) && empty($this->fk_soc) && empty($this->fk_thirdparty) && empty($force_thirdparty_id)) return 0;
require_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php'; require_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php';
$idtofetch=isset($this->socid)?$this->socid:(isset($this->fk_soc)?$this->fk_soc:$this->fk_thirdparty);
if ($force_thirdparty_id) $idtofetch=$force_thirdparty_id;
$thirdparty = new Societe($this->db); $thirdparty = new Societe($this->db);
$result=$thirdparty->fetch(isset($this->socid)?$this->socid:(isset($this->fk_soc)?$this->fk_soc:$this->fk_thirdparty)); $result=$thirdparty->fetch($idtofetch);
$this->client = $thirdparty; // deprecated $this->client = $thirdparty; // deprecated
$this->thirdparty = $thirdparty; $this->thirdparty = $thirdparty;

View File

@ -198,7 +198,7 @@ class Ctypent // extends CommonObject
* @param int $notrigger 0=launch triggers after, 1=disable triggers * @param int $notrigger 0=launch triggers after, 1=disable triggers
* @return int <0 if KO, >0 if OK * @return int <0 if KO, >0 if OK
*/ */
function update($user=0, $notrigger=0) function update($user=null, $notrigger=0)
{ {
global $conf, $langs; global $conf, $langs;
$error=0; $error=0;

View File

@ -154,7 +154,7 @@ class Events // extends CommonObject
* @param int $notrigger 0=no, 1=yes (no update trigger) * @param int $notrigger 0=no, 1=yes (no update trigger)
* @return int <0 if KO, >0 if OK * @return int <0 if KO, >0 if OK
*/ */
function update($user=0, $notrigger=0) function update($user=null, $notrigger=0)
{ {
global $conf, $langs; global $conf, $langs;
@ -191,7 +191,7 @@ class Events // extends CommonObject
* @param User $user User that load * @param User $user User that load
* @return int <0 if KO, >0 if OK * @return int <0 if KO, >0 if OK
*/ */
function fetch($id, $user=0) function fetch($id, $user=null)
{ {
global $langs; global $langs;

View File

@ -56,7 +56,7 @@ class ExtraFields
var $error; var $error;
var $errno; var $errno;
static $type2label=array( public static $type2label=array(
'varchar'=>'String', 'varchar'=>'String',
'text'=>'TextLong', 'text'=>'TextLong',
'int'=>'Int', 'int'=>'Int',
@ -510,17 +510,6 @@ class ExtraFields
} }
/**
* Load array of labels
*
* @return void
*/
function fetch_optionals()
{
$this->fetch_name_optionals_label();
}
/** /**
* Load array this->attribute_xxx like attribute_label, attribute_type, ... * Load array this->attribute_xxx like attribute_label, attribute_type, ...
* *
@ -528,15 +517,14 @@ class ExtraFields
* @param boolean $forceload Force load of extra fields whatever is option MAIN_EXTRAFIELDS_DISABLED * @param boolean $forceload Force load of extra fields whatever is option MAIN_EXTRAFIELDS_DISABLED
* @return array Array of attributes for all extra fields * @return array Array of attributes for all extra fields
*/ */
function fetch_name_optionals_label($elementtype='adherent',$forceload=false) function fetch_name_optionals_label($elementtype,$forceload=false)
{ {
global $conf; global $conf;
$array_name_label=array(); $array_name_label=array();
// For avoid conflicts with external modules // For avoid conflicts with external modules
if (!$forceload && !empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) if (!$forceload && !empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) return $array_name_label;
return $array_name_label;
$sql = "SELECT rowid,name,label,type,size,elementtype,fieldunique,fieldrequired,param,pos,alwayseditable"; $sql = "SELECT rowid,name,label,type,size,elementtype,fieldunique,fieldrequired,param,pos,alwayseditable";
$sql.= " FROM ".MAIN_DB_PREFIX."extrafields"; $sql.= " FROM ".MAIN_DB_PREFIX."extrafields";
@ -569,13 +557,13 @@ class ExtraFields
$this->attribute_alwayseditable[$tab->name]=$tab->alwayseditable; $this->attribute_alwayseditable[$tab->name]=$tab->alwayseditable;
} }
} }
return $array_name_label;
} }
else else
{ {
print dol_print_error($this->db); print dol_print_error($this->db);
} }
return $array_name_label;
} }

View File

@ -746,7 +746,7 @@ class Form
* @param int $showempty Add an empty field * @param int $showempty Add an empty field
* @param int $showtype Show third party type in combolist (customer, prospect or supplier) * @param int $showtype Show third party type in combolist (customer, prospect or supplier)
* @param int $forcecombo Force to use combo box * @param int $forcecombo Force to use combo box
* @param array $events Event options. Example: array(array('method'=>'getContacts', 'url'=>dol_buildpath('/core/ajax/contacts.php',1), 'htmlname'=>'contactid', 'params'=>array('add-customer-contact'=>'disabled'))) * @param array $events Event options to run on change. Example: array(array('method'=>'getContacts', 'url'=>dol_buildpath('/core/ajax/contacts.php',1), 'htmlname'=>'contactid', 'params'=>array('add-customer-contact'=>'disabled')))
* @param int $limit Maximum number of elements * @param int $limit Maximum number of elements
* @return string HTML string with * @return string HTML string with
* @deprecated Use select_thirdparty instead * @deprecated Use select_thirdparty instead
@ -816,10 +816,67 @@ class Form
$resql=$this->db->query($sql); $resql=$this->db->query($sql);
if ($resql) if ($resql)
{ {
if (! empty($conf->use_javascript_ajax) && ! empty($conf->global->COMPANY_USE_SEARCH_TO_SELECT) && ! $forcecombo) if (! empty($conf->use_javascript_ajax))
{ {
include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php'; if (! empty($conf->global->COMPANY_USE_SEARCH_TO_SELECT) && ! $forcecombo)
$out.= ajax_combobox($htmlname, $events, $conf->global->COMPANY_USE_SEARCH_TO_SELECT); {
include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
$out.= ajax_combobox($htmlname, $events, $conf->global->COMPANY_USE_SEARCH_TO_SELECT);
}
else
{
if (count($events)) // Add management of event
{
print '<script type="text/javascript">
$(document).ready(function() {
jQuery("#'.$htmlname.'").change(function () {
var obj = '.json_encode($events).';
$.each(obj, function(key,values) {
if (values.method.length) {
runJsCodeForEvent'.$htmlname.'(values);
}
});
});
function runJsCodeForEvent'.$htmlname.'(obj) {
var id = $("#'.$htmlname.'").val();
var method = obj.method;
var url = obj.url;
var htmlname = obj.htmlname;
var showempty = obj.showempty;
$.getJSON(url,
{
action: method,
id: id,
htmlname: htmlname,
showempty: showempty
},
function(response) {
$.each(obj.params, function(key,action) {
if (key.length) {
var num = response.num;
if (num > 0) {
$("#" + key).removeAttr(action);
} else {
$("#" + key).attr(action, action);
}
}
});
$("select#" + htmlname).html(response.value);
if (response.num) {
var selecthtml_str = response.value;
var selecthtml_dom=$.parseHTML(selecthtml_str);
$("#inputautocomplete"+htmlname).val(selecthtml_dom[0][0].innerHTML);
} else {
$("#inputautocomplete"+htmlname).val("");
}
$("select#" + htmlname).change(); /* Trigger event change */
});
}
})
</script>';
}
}
} }
// Construct $out and $outarray // Construct $out and $outarray
@ -3039,13 +3096,14 @@ class Form
/** /**
* Show a form to select a project * Show a form to select a project
* *
* @param int $page Page * @param int $page Page
* @param int $socid Id third party (-1=all, 0=only projects not linked to a third party, id=projects not linked or linked to third party id) * @param int $socid Id third party (-1=all, 0=only projects not linked to a third party, id=projects not linked or linked to third party id)
* @param int $selected Id pre-selected project * @param int $selected Id pre-selected project
* @param string $htmlname Name of select field * @param string $htmlname Name of select field
* @param int $discard_closed Hide all closed projects
* @return void * @return void
*/ */
function form_project($page, $socid, $selected='', $htmlname='projectid') function form_project($page, $socid, $selected='', $htmlname='projectid', $discard_closed=0)
{ {
global $langs; global $langs;
@ -3062,8 +3120,7 @@ class Form
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">'; 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>';
//print "$socid,$selected,$htmlname"; $formproject->select_projects($socid,$selected,$htmlname,20,0,1,$discard_closed);
$formproject->select_projects($socid,$selected,$htmlname);
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></form>';
@ -4045,7 +4102,22 @@ class Form
if ($value_as_key) $array=array_combine($array, $array); if ($value_as_key) $array=array_combine($array, $array);
$out='<select id="'.$htmlname.'" '.($disabled?'disabled="disabled" ':'').'class="flat'.($morecss?' '.$morecss:'').'" name="'.$htmlname.'" '.($moreparam?$moreparam:'').'>'; $out='';
// Add code for jquery to use multiselect
if (empty($conf->dol_use_jmobile) && (! empty($conf->global->MAIN_USE_JQUERY_MULTISELECT) || defined('REQUIRE_JQUERY_MULTISELECT')))
{
$tmpplugin=empty($conf->global->MAIN_USE_JQUERY_MULTISELECT)?constant('REQUIRE_JQUERY_MULTISELECT'):$conf->global->MAIN_USE_JQUERY_MULTISELECT;
$out='<!-- JS CODE TO ENABLE '.$tmpplugin.' for id '.$htmlname.' -->
<script type="text/javascript">
$(document).ready(function () {
$(\'#'.$htmlname.'\').'.$tmpplugin.'({
});
});
</script>';
}
$out.='<select id="'.$htmlname.'" '.($disabled?'disabled="disabled" ':'').'class="flat'.($morecss?' '.$morecss:'').'" name="'.$htmlname.'" '.($moreparam?$moreparam:'').'>';
if ($show_empty) if ($show_empty)
{ {
@ -4109,46 +4181,22 @@ class Form
global $conf, $langs; global $conf, $langs;
// Add code for jquery to use multiselect // Add code for jquery to use multiselect
// Note: Plugin "multiselect" is no more provided by Dolibarr. You must include it and load it into your module to use it. if (! empty($conf->global->MAIN_USE_JQUERY_MULTISELECT) || defined('REQUIRE_JQUERY_MULTISELECT'))
if ((! empty($conf->global->MAIN_USE_JQUERY_MULTISELECT) && ($conf->global->MAIN_USE_JQUERY_MULTISELECT == 'multiselect'))
|| (defined('REQUIRE_JQUERY_MULTISELECT') && constant('REQUIRE_JQUERY_MULTISELECT')))
{ {
print '<!-- JS CODE FOR multiselect --> $tmpplugin=empty($conf->global->MAIN_USE_JQUERY_MULTISELECT)?constant('REQUIRE_JQUERY_MULTISELECT'):$conf->global->MAIN_USE_JQUERY_MULTISELECT;
<script type="text/javascript"> print '<!-- JS CODE TO ENABLE '.$tmpplugin.' for id '.$htmlname.' -->
$(document).ready(function () { <script type="text/javascript">
$.extend($.ui.multiselect.locale, { $(document).ready(function () {
addAll:\''.$langs->transnoentities("AddAll").'\', $(\'#'.$htmlname.'\').'.$tmpplugin.'({
removeAll:\''.$langs->transnoentities("RemoveAll").'\', });
itemsCount:\''.$langs->transnoentities("ItemsCount").'\' });
}); </script>';
$(function(){
$("#'.$htmlname.'").multiselect({
searchable: false,
width: '.($width?$width:300).',
height: 120
});
});
});
</script>';
}
// Add code for jquery to use multiple-select
// Note: Plugin "multiselect" is no more provided by Dolibarr. You must include it and load it into your module to use it.
if ((! empty($conf->global->MAIN_USE_JQUERY_MULTISELECT) && ($conf->global->MAIN_USE_JQUERY_MULTISELECT == 'multiple-select'))
|| (defined('REQUIRE_JQUERY_MULTISELECT') && constant('REQUIRE_JQUERY_MULTISELECT')))
{
print '<!-- JS CODE FOR multiple-select -->
<script src="'.DOL_URL_ROOT.'/includes/jquery/plugins/multiple-select/jquery.multiple.select.js"></script>
<script type="text/javascript">
$(document).ready(function () {
$(\'#'.$htmlname.'\').multipleSelect();
});
</script>';
} }
// Try also magic suggest // Try also magic suggest
$out = '<select id="'.$htmlname.'" class="multiselect" multiple="multiple" name="'.$htmlname.'[]"'.$option.($width?' style="width: '.$width.'px"':'').'>'."\n"; // Add data-role="none" to diable jmobile decoration
$out = '<select data-role="none" id="'.$htmlname.'" class="multiselect" multiple="multiple" name="'.$htmlname.'[]"'.$option.($width?' style="width: '.$width.'px"':'').'>'."\n";
if (is_array($array) && ! empty($array)) if (is_array($array) && ! empty($array))
{ {
if ($value_as_key) $array=array_combine($array, $array); if ($value_as_key) $array=array_combine($array, $array);

View File

@ -547,7 +547,7 @@ class FormCompany
$resql = $this->db->query($sql); $resql = $this->db->query($sql);
if ($resql) if ($resql)
{ {
if ($conf->use_javascript_ajax && ! empty($conf->global->COMPANY_USE_SEARCH_TO_SELECT)) if (! empty($conf->use_javascript_ajax) && ! empty($conf->global->COMPANY_USE_SEARCH_TO_SELECT))
{ {
// Use Ajax search // Use Ajax search
$minLength = (is_numeric($conf->global->COMPANY_USE_SEARCH_TO_SELECT)?$conf->global->COMPANY_USE_SEARCH_TO_SELECT:2); $minLength = (is_numeric($conf->global->COMPANY_USE_SEARCH_TO_SELECT)?$conf->global->COMPANY_USE_SEARCH_TO_SELECT:2);

View File

@ -65,7 +65,7 @@ class FormContract
$sql.= " WHERE c.entity = ".$conf->entity; $sql.= " WHERE c.entity = ".$conf->entity;
//if ($contratListId) $sql.= " AND c.rowid IN (".$contratListId.")"; //if ($contratListId) $sql.= " AND c.rowid IN (".$contratListId.")";
if ($socid == 0) $sql.= " AND (c.fk_soc = 0 OR c.fk_soc IS NULL)"; if ($socid == 0) $sql.= " AND (c.fk_soc = 0 OR c.fk_soc IS NULL)";
else $sql.= " AND c.fk_soc = ".$socid; if ($socid > 0) $sql.= " AND (c.fk_soc=".$socid." OR c.fk_soc IS NULL)";
dol_syslog(get_class($this)."::select_contract", LOG_DEBUG); dol_syslog(get_class($this)."::select_contract", LOG_DEBUG);
$resql=$db->query($sql); $resql=$db->query($sql);

View File

@ -301,6 +301,12 @@ class FormFile
$modellist=ModeleThirdPartyDoc::liste_modeles($this->db); $modellist=ModeleThirdPartyDoc::liste_modeles($this->db);
} }
} }
else if ($modulepart == 'agenda')
{
null;
}
else if ($modulepart == 'propal') else if ($modulepart == 'propal')
{ {
if (is_array($genallowed)) $modellist=$genallowed; if (is_array($genallowed)) $modellist=$genallowed;
@ -433,6 +439,7 @@ class FormFile
} }
else else
{ {
// For normalized standard modules // For normalized standard modules
$file=dol_buildpath('/core/modules/'.$modulepart.'/modules_'.$modulepart.'.php',0); $file=dol_buildpath('/core/modules/'.$modulepart.'/modules_'.$modulepart.'.php',0);
if (file_exists($file)) if (file_exists($file))

View File

@ -49,11 +49,12 @@ class FormProjets
* @param int $selected Id project preselected * @param int $selected Id project preselected
* @param string $htmlname Nom de la zone html * @param string $htmlname Nom de la zone html
* @param int $maxlength Maximum length of label * @param int $maxlength Maximum length of label
* @param int $option_only Option only * @param int $option_only Return only html options lines without the select tag
* @param int $show_empty Add an empty line * @param int $show_empty Add an empty line
* @param int $discard_closed Discard closed projects
* @return int Nber of project if OK, <0 if KO * @return int Nber of project if OK, <0 if KO
*/ */
function select_projects($socid=-1, $selected='', $htmlname='projectid', $maxlength=16, $option_only=0, $show_empty=1) function select_projects($socid=-1, $selected='', $htmlname='projectid', $maxlength=16, $option_only=0, $show_empty=1, $discard_closed=0)
{ {
global $user,$conf,$langs; global $user,$conf,$langs;
@ -104,6 +105,12 @@ class FormProjets
} }
else else
{ {
if ($discard_closed && $obj->fk_statut == 2)
{
$i++;
continue;
}
$labeltoshow=dol_trunc($obj->ref,18); $labeltoshow=dol_trunc($obj->ref,18);
//if ($obj->public) $labeltoshow.=' ('.$langs->trans("SharedProject").')'; //if ($obj->public) $labeltoshow.=' ('.$langs->trans("SharedProject").')';
//else $labeltoshow.=' ('.$langs->trans("Private").')'; //else $labeltoshow.=' ('.$langs->trans("Private").')';

View File

@ -277,7 +277,7 @@ function limitChars(textarea, limit, infodiv)
{ {
$defaultmessage=$this->withbody; $defaultmessage=$this->withbody;
} }
$defaultmessage=make_substitutions($defaultmessage,$this->substit,$langs); $defaultmessage=make_substitutions($defaultmessage,$this->substit);
if (isset($_POST["message"])) $defaultmessage=$_POST["message"]; if (isset($_POST["message"])) $defaultmessage=$_POST["message"];
$defaultmessage=str_replace('\n',"\n",$defaultmessage); $defaultmessage=str_replace('\n',"\n",$defaultmessage);

View File

@ -847,6 +847,7 @@ class Ldap
*/ */
function getAttributeValues($filterrecord,$attribute) function getAttributeValues($filterrecord,$attribute)
{ {
$attributes=array();
$attributes[0] = $attribute; $attributes[0] = $attribute;
// We need to search for this user in order to get their entry. // We need to search for this user in order to get their entry.
@ -1075,9 +1076,9 @@ class Ldap
$subcount = hexdec(substr($hex_sid,2,2)); // Get count of sub-auth entries $subcount = hexdec(substr($hex_sid,2,2)); // Get count of sub-auth entries
$auth = hexdec(substr($hex_sid,4,12)); // SECURITY_NT_AUTHORITY $auth = hexdec(substr($hex_sid,4,12)); // SECURITY_NT_AUTHORITY
$result = "$rev-$auth"; $result = "$rev-$auth";
for ($x=0;$x < $subcount; $x++) { for ($x=0;$x < $subcount; $x++)
$subauth[$x] = hexdec($this->littleEndian(substr($hex_sid,16+($x*8),8))); // get all SECURITY_NT_AUTHORITY {
$result .= "-".$subauth[$x]; $result .= "-".hexdec($this->littleEndian(substr($hex_sid,16+($x*8),8))); // get all SECURITY_NT_AUTHORITY
} }
return $result; return $result;
} }
@ -1090,9 +1091,9 @@ class Ldap
* car conflit majuscule-minuscule. A n'utiliser que pour les pages * car conflit majuscule-minuscule. A n'utiliser que pour les pages
* 'Fiche LDAP' qui affiche champ lisibles par defaut. * 'Fiche LDAP' qui affiche champ lisibles par defaut.
* *
* @param string $checkDn DN de recherche (Ex: ou=users,cn=my-domain,cn=com) * @param string $checkDn DN de recherche (Ex: ou=users,cn=my-domain,cn=com)
* @param string $filter Filtre de recherche (ex: (sn=nom_personne) ) * @param string $filter Search filter (ex: (sn=nom_personne) )
* @return array Tableau des reponses (cle en minuscule-valeur) * @return array|int Array with answers (key lowercased - value)
*/ */
function search($checkDn, $filter) function search($checkDn, $filter)
{ {

View File

@ -74,7 +74,7 @@ class Menubase
* @param User $user User that create * @param User $user User that create
* @return int <0 if KO, Id of record if OK * @return int <0 if KO, Id of record if OK
*/ */
function create($user=0) function create($user=null)
{ {
global $conf, $langs; global $conf, $langs;
@ -185,7 +185,7 @@ class Menubase
* @param int $notrigger 0=no, 1=yes (no update trigger) * @param int $notrigger 0=no, 1=yes (no update trigger)
* @return int <0 if KO, >0 if OK * @return int <0 if KO, >0 if OK
*/ */
function update($user=0, $notrigger=0) function update($user=null, $notrigger=0)
{ {
global $conf, $langs; global $conf, $langs;
@ -250,7 +250,7 @@ class Menubase
* @param User $user User that load * @param User $user User that load
* @return int <0 if KO, >0 if OK * @return int <0 if KO, >0 if OK
*/ */
function fetch($id, $user=0) function fetch($id, $user=null)
{ {
global $langs; global $langs;

View File

@ -197,6 +197,12 @@ class Translate
if ($alt < 1 && isset($langarray[1]) && strtolower($langarray[0]) == strtolower($langarray[1])) $alt=1; if ($alt < 1 && isset($langarray[1]) && strtolower($langarray[0]) == strtolower($langarray[1])) $alt=1;
if ($alt < 2 && strtolower($langofdir) == 'en_us') $alt=2; if ($alt < 2 && strtolower($langofdir) == 'en_us') $alt=2;
if (empty($langofdir)) // This may occurs when load is called without setting the language and without providing a value for forcelangdir
{
dol_syslog("Error: ".get_class($this)."::Load was called but language was not set yet with langs->setDefaultLang(). Nothing will be loaded.", LOG_WARNING);
return -1;
}
foreach($this->dir as $keydir => $searchdir) foreach($this->dir as $keydir => $searchdir)
{ {
// Directory of translation files // Directory of translation files

View File

@ -121,9 +121,9 @@ interface Database
/** /**
* List tables into a database * List tables into a database
* *
* @param string $database Name of database * @param string $database Name of database
* @param string $table Nmae of table filter ('xxx%') * @param string $table Nmae of table filter ('xxx%')
* @return resource Resource * @return array List of tables in an array
*/ */
function DDLListTables($database, $table = ''); function DDLListTables($database, $table = '');
@ -386,9 +386,9 @@ interface Database
* 19700101020000 -> 3600 with TZ+1 and gmt=0 * 19700101020000 -> 3600 with TZ+1 and gmt=0
* 19700101020000 -> 7200 whaterver is TZ if gmt=1 * 19700101020000 -> 7200 whaterver is TZ if gmt=1
* *
* @param string $string Date in a string (YYYYMMDDHHMMSS, YYYYMMDD, YYYY-MM-DD HH:MM:SS) * @param string $string Date in a string (YYYYMMDDHHMMSS, YYYYMMDD, YYYY-MM-DD HH:MM:SS)
* @param int $gm 1=Input informations are GMT values, otherwise local to server TZ * @param int $gm 1=Input informations are GMT values, otherwise local to server TZ
* @return date Date TMS * @return timestamp|string Date TMS
*/ */
function jdate($string, $gm=false); function jdate($string, $gm=false);

View File

@ -158,8 +158,8 @@ abstract class DoliDB implements Database
/** /**
* Annulation d'une transaction et retour aux anciennes valeurs * Annulation d'une transaction et retour aux anciennes valeurs
* *
* @param string $log Add more log to default log line * @param string $log Add more log to default log line
* @return int 1 si annulation ok ou transaction non ouverte, 0 en cas d'erreur * @return resource|int 1 si annulation ok ou transaction non ouverte, 0 en cas d'erreur
*/ */
function rollback($log='') function rollback($log='')
{ {

View File

@ -26,9 +26,10 @@
/** /**
* Prepare array with list of admin tabs * Prepare array with list of admin tabs
* *
* @param Object $object Object instance we show card
* @return array Array of tabs to show * @return array Array of tabs to show
*/ */
function admin_accounting_prepare_head() function admin_accounting_prepare_head($object=null)
{ {
global $langs, $conf; global $langs, $conf;

View File

@ -345,13 +345,13 @@ function ajax_combobox($htmlname, $events=array(), $minLengthToAutocomplete=0)
var obj = '.json_encode($events).'; var obj = '.json_encode($events).';
$.each(obj, function(key,values) { $.each(obj, function(key,values) {
if (values.method.length) { if (values.method.length) {
runJsCodeForEvent(values); runJsCodeForEvent'.$htmlname.'(values);
} }
}); });
} }
}); });
function runJsCodeForEvent(obj) { function runJsCodeForEvent'.$htmlname.'(obj) {
var id = $("#'.$htmlname.'").val(); var id = $("#'.$htmlname.'").val();
var method = obj.method; var method = obj.method;
var url = obj.url; var url = obj.url;

View File

@ -1100,7 +1100,11 @@ function dol_mktime($hour,$minute,$second,$month,$day,$year,$gm=false,$check=1)
$default_timezone=@date_default_timezone_get(); $default_timezone=@date_default_timezone_get();
} }
} }
else $localtz = new DateTimeZone('UTC');
if (empty($localtz)) {
$localtz = new DateTimeZone('UTC');
}
$dt = new DateTime(null,$localtz); $dt = new DateTime(null,$localtz);
$dt->setDate($year,$month,$day); $dt->setDate($year,$month,$day);
$dt->setTime((int) $hour, (int) $minute, (int) $second); $dt->setTime((int) $hour, (int) $minute, (int) $second);
@ -3837,13 +3841,14 @@ function dol_html_entity_decode($a,$b,$c='UTF-8')
/** /**
* Replace htmlentities functions to manage errors * Replace htmlentities functions to manage errors
* http://php.net/manual/en/function.htmlentities.php * http://php.net/manual/en/function.htmlentities.php
* TODO Remove this function to replace it with direct htmlentities.
* *
* @param string $string The input string. * @param string $string The input string.
* @param int $flags Flags(see PHP doc above) * @param int $flags Flags(see PHP doc above)
* @param string $encoding Encoding * @param string $encoding Encoding
* @param bool $double_encode When double_encode is turned off PHP will not encode existing html entities * @param bool $double_encode When double_encode is turned off PHP will not encode existing html entities
* @return string $ret Encoded string * @return string $ret Encoded string
* @deprecated Since PHP4 support is no longer available, this function does not make sense * @deprecated Since PHP4 support is no longer available, this function does not make sense.
*/ */
function dol_htmlentities($string, $flags=null, $encoding='UTF-8', $double_encode=false) function dol_htmlentities($string, $flags=null, $encoding='UTF-8', $double_encode=false)
{ {
@ -3998,10 +4003,7 @@ function dol_concatdesc($text1,$text2,$forxml=false)
} }
/** /**
* Make substition into a string * Make substition into a string replacing key with vals from $substitutionarray (oldval=>newval)
* There is two type of substitions:
* - From $substitutionarray (oldval=>newval)
* - From special constants (__XXX__=>f(objet->xxx)) by substitutions modules
* *
* @param string $chaine Source string in which we must do substitution * @param string $chaine Source string in which we must do substitution
* @param array $substitutionarray Array with key->val to substitute * @param array $substitutionarray Array with key->val to substitute

View File

@ -758,7 +758,9 @@ function pdf_pagefoot(&$pdf,$outputlangs,$paramfreetext,$fromcompany,$marge_bass
// Capital // Capital
if ($fromcompany->capital) if ($fromcompany->capital)
{ {
$line3.=($line3?" - ":"").$outputlangs->transnoentities("CapitalOf",price($fromcompany->capital, 0, $outputlangs, 0, 0, 0, $conf->currency)); $tmpamounttoshow = price2num($fromcompany->capital); // This field is a free string
if (is_numeric($tmpamounttoshow) && $tmpamounttoshow > 0) $line3.=($line3?" - ":"").$outputlangs->transnoentities("CapitalOf",price($tmpamounttoshow, 0, $outputlangs, 0, 0, 0, $conf->currency));
else $line3.=($line3?" - ":"").$outputlangs->transnoentities("CapitalOf",$tmpamounttoshow,$outputlangs);
} }
// Prof Id 1 // Prof Id 1
if ($fromcompany->idprof1 && ($fromcompany->country_code != 'FR' || ! $fromcompany->idprof2)) if ($fromcompany->idprof1 && ($fromcompany->country_code != 'FR' || ! $fromcompany->idprof2))

View File

@ -316,6 +316,7 @@ function measuring_units_string($unit,$measuring_style='')
{ {
global $langs; global $langs;
$measuring_units=array();
if ($measuring_style == 'weight') if ($measuring_style == 'weight')
{ {
$measuring_units[3] = $langs->trans("WeightUnitton"); $measuring_units[3] = $langs->trans("WeightUnitton");

View File

@ -26,15 +26,15 @@
/** /**
* Show header of a VAT report * Show header of a VAT report
* *
* @param string $nom Name of report * @param string $nom Name of report
* @param string $variante Link for alternate report * @param string $variante Link for alternate report
* @param string $period Period of report * @param string $period Period of report
* @param string $periodlink Link to switch period * @param string $periodlink Link to switch period
* @param string $description Description * @param string $description Description
* @param date $builddate Date generation * @param timestamp|integer $builddate Date generation
* @param string $exportlink Link for export or '' * @param string $exportlink Link for export or ''
* @param array $moreparam Array with list of params to add into form * @param array $moreparam Array with list of params to add into form
* @param string $calcmode Calculation mode * @param string $calcmode Calculation mode
* @return void * @return void
*/ */
function report_header($nom,$variante,$period,$periodlink,$description,$builddate,$exportlink='',$moreparam=array(),$calcmode='') function report_header($nom,$variante,$period,$periodlink,$description,$builddate,$exportlink='',$moreparam=array(),$calcmode='')

View File

@ -242,7 +242,7 @@ function entity_prepare_head($object, $aEntities)
/** /**
* Show list of themes. Show all thumbs of themes * Show list of themes. Show all thumbs of themes
* *
* @param User $fuser User concerned or '' for global theme * @param User $fuser User concerned or null for global theme
* @param int $edit 1 to add edit form * @param int $edit 1 to add edit form
* @param boolean $foruserprofile Show for user profile view * @param boolean $foruserprofile Show for user profile view
* @return void * @return void
@ -265,7 +265,7 @@ function show_theme($fuser,$edit=0,$foruserprofile=false)
$selected_theme=''; $selected_theme='';
if (empty($foruserprofile)) $selected_theme=$conf->global->MAIN_THEME; if (empty($foruserprofile)) $selected_theme=$conf->global->MAIN_THEME;
else $selected_theme=empty($fuser->conf->MAIN_THEME)?'':$fuser->conf->MAIN_THEME; else $selected_theme=((is_object($fuser) && ! empty($fuser->conf->MAIN_THEME))?$fuser->conf->MAIN_THEME:'');
$colspan=2; $colspan=2;
if ($foruserprofile) $colspan=4; if ($foruserprofile) $colspan=4;

View File

@ -1,5 +1,5 @@
<?php <?php
/* Copyright (C) 2007-2008 Laurent Destailleur <eldy@users.sourceforge.net> /* Copyright (C) 2007-2014 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2007-2009 Regis Houssin <regis.houssin@capnetworks.com> * Copyright (C) 2007-2009 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2010-2011 Juanjo Menent <jmenent@2byte.es> * Copyright (C) 2010-2011 Juanjo Menent <jmenent@2byte.es>
* *
@ -20,7 +20,7 @@
/** /**
* \file htdocs/core/login/functions_dolibarr.php * \file htdocs/core/login/functions_dolibarr.php
* \ingroup core * \ingroup core
* \brief Authentication functions for Dolibarr mode * \brief Authentication functions for Dolibarr mode (check user on login or email and check pass)
*/ */
@ -50,13 +50,15 @@ function check_user_password_dolibarr($usertotest,$passwordtotest,$entitytotest=
{ {
// If test username/password asked, we define $test=false and $login var if ok, set $_SESSION["dol_loginmesg"] if ko // If test username/password asked, we define $test=false and $login var if ok, set $_SESSION["dol_loginmesg"] if ko
$table = MAIN_DB_PREFIX."user"; $table = MAIN_DB_PREFIX."user";
$usernamecol = 'login'; $usernamecol1 = 'login';
$usernamecol2 = 'email';
$entitycol = 'entity'; $entitycol = 'entity';
$sql ='SELECT rowid, entity, pass, pass_crypted'; $sql ='SELECT rowid, login, entity, pass, pass_crypted';
$sql.=' FROM '.$table; $sql.=' FROM '.$table;
$sql.=' WHERE '.$usernamecol." = '".$db->escape($usertotest)."'"; $sql.=' WHERE ('.$usernamecol1." = '".$db->escape($usertotest)."'";
$sql.=' AND '.$entitycol." IN (0," . ($entity ? $entity : 1) . ")"; if (preg_match('/@/',$usertotest)) $sql.=' OR '.$usernamecol2." = '".$db->escape($usertotest)."'";
$sql.=') AND '.$entitycol." IN (0," . ($entity ? $entity : 1) . ")";
dol_syslog("functions_dolibarr::check_user_password_dolibarr", LOG_DEBUG); dol_syslog("functions_dolibarr::check_user_password_dolibarr", LOG_DEBUG);
$resql=$db->query($sql); $resql=$db->query($sql);
@ -106,7 +108,7 @@ function check_user_password_dolibarr($usertotest,$passwordtotest,$entitytotest=
// Password ok ? // Password ok ?
if ($passok) if ($passok)
{ {
$login=$usertotest; $login=$obj->login;
} }
else else
{ {

View File

@ -271,7 +271,7 @@ else {
</tr> </tr>
<?php <?php
if (! empty($conf->service->enabled) && $dateSelector) if (! empty($conf->service->enabled) && $dateSelector && GETPOST('type') != '0')
{ {
if(! empty($conf->global->MAIN_VIEW_LINE_NUMBER)) $colspan = 10; if(! empty($conf->global->MAIN_VIEW_LINE_NUMBER)) $colspan = 10;
else $colspan = 9; else $colspan = 9;

View File

@ -501,7 +501,7 @@ class Cronjob extends CommonObject
* @param int $notrigger 0=launch triggers after, 1=disable triggers * @param int $notrigger 0=launch triggers after, 1=disable triggers
* @return int <0 if KO, >0 if OK * @return int <0 if KO, >0 if OK
*/ */
function update($user=0, $notrigger=0) function update($user=null, $notrigger=0)
{ {
global $conf, $langs; global $conf, $langs;

View File

@ -184,7 +184,7 @@ class EcmDirectory // extends CommonObject
* @param int $notrigger 0=no, 1=yes (no update trigger) * @param int $notrigger 0=no, 1=yes (no update trigger)
* @return int <0 if KO, >0 if OK * @return int <0 if KO, >0 if OK
*/ */
function update($user=0, $notrigger=0) function update($user=null, $notrigger=0)
{ {
global $conf, $langs; global $conf, $langs;

View File

@ -800,7 +800,7 @@ class Expedition extends CommonObject
* @param int $notrigger 0=launch triggers after, 1=disable triggers * @param int $notrigger 0=launch triggers after, 1=disable triggers
* @return int <0 if KO, >0 if OK * @return int <0 if KO, >0 if OK
*/ */
function update($user=0, $notrigger=0) function update($user=null, $notrigger=0)
{ {
global $conf, $langs; global $conf, $langs;
$error=0; $error=0;

View File

@ -36,7 +36,7 @@ $result = restrictedArea($user, 'expedition',$expeditionid,'');
$search_ref_exp = GETPOST("search_ref_exp"); $search_ref_exp = GETPOST("search_ref_exp");
$search_ref_liv = GETPOST('search_ref_liv'); $search_ref_liv = GETPOST('search_ref_liv');
$search_societe = GETPOST("search_societe"); $search_company = GETPOST("search_company");
$sortfield = GETPOST('sortfield','alpha'); $sortfield = GETPOST('sortfield','alpha');
$sortorder = GETPOST('sortorder','alpha'); $sortorder = GETPOST('sortorder','alpha');
@ -51,12 +51,12 @@ if (! $sortfield) $sortfield="e.ref";
if (! $sortorder) $sortorder="DESC"; if (! $sortorder) $sortorder="DESC";
$limit = $conf->liste_limit; $limit = $conf->liste_limit;
// Do we click on purge search criteria ? // Purge search criteria
if (GETPOST("button_removefilter_x")) if (GETPOST("button_removefilter_x"))
{ {
$search_ref_exp=''; $search_ref_exp='';
$search_ref_liv=''; $search_ref_liv='';
$search_societe=''; $search_company='';
} }
/* /*
@ -92,7 +92,7 @@ if ($socid)
} }
if ($search_ref_exp) $sql .= natural_search('e.ref', $search_ref_exp); if ($search_ref_exp) $sql .= natural_search('e.ref', $search_ref_exp);
if ($search_ref_liv) $sql .= natural_search('l.ref', $search_ref_liv); if ($search_ref_liv) $sql .= natural_search('l.ref', $search_ref_liv);
if ($search_societe) $sql .= natural_search('s.nom', $search_societe); if ($search_company) $sql .= natural_search('s.nom', $search_company);
$sql.= $db->order($sortfield,$sortorder); $sql.= $db->order($sortfield,$sortorder);
$sql.= $db->plimit($limit + 1,$offset); $sql.= $db->plimit($limit + 1,$offset);
@ -107,12 +107,13 @@ if ($resql)
$param=""; $param="";
if ($search_ref_exp) $param.= "&amp;search_ref_exp=".$search_ref_exp; if ($search_ref_exp) $param.= "&amp;search_ref_exp=".$search_ref_exp;
if ($search_ref_liv) $param.= "&amp;search_ref_liv=".$search_ref_liv; if ($search_ref_liv) $param.= "&amp;search_ref_liv=".$search_ref_liv;
if ($search_societe) $param.= "&amp;search_societe=".$search_societe; if ($search_company) $param.= "&amp;search_company=".$search_company;
print_barre_liste($langs->trans('ListOfSendings'), $page, $_SERVER["PHP_SELF"],$param,$sortfield,$sortorder,'',$num); print_barre_liste($langs->trans('ListOfSendings'), $page, $_SERVER["PHP_SELF"],$param,$sortfield,$sortorder,'',$num);
$i = 0; $i = 0;
print '<form method="GET" action="'.$_SERVER["PHP_SELF"].'">'."\n";
print '<table class="noborder" width="100%">'; print '<table class="noborder" width="100%">';
print '<tr class="liste_titre">'; print '<tr class="liste_titre">';
@ -124,6 +125,7 @@ if ($resql)
print_liste_field_titre($langs->trans("DateReceived"),"ship2bill.php","e.date_expedition","",$param, 'align="center"',$sortfield,$sortorder); print_liste_field_titre($langs->trans("DateReceived"),"ship2bill.php","e.date_expedition","",$param, 'align="center"',$sortfield,$sortorder);
} }
print_liste_field_titre($langs->trans("Status"),"ship2bill.php","e.fk_statut","",$param,'align="right"',$sortfield,$sortorder); print_liste_field_titre($langs->trans("Status"),"ship2bill.php","e.fk_statut","",$param,'align="right"',$sortfield,$sortorder);
print '<td class="liste_titre">&nbsp;</td>';
print "</tr>\n"; print "</tr>\n";
// Lignes des champs de filtre // Lignes des champs de filtre
@ -132,7 +134,7 @@ if ($resql)
print '<input class="flat" size="10" type="text" name="search_ref_exp" value="'.$search_ref_exp.'">'; print '<input class="flat" size="10" type="text" name="search_ref_exp" value="'.$search_ref_exp.'">';
print '</td>'; print '</td>';
print '<td class="liste_titre" align="left">'; print '<td class="liste_titre" align="left">';
print '<input class="flat" type="text" size="10" name="search_societe" value="'.dol_escape_htmltag($search_societe).'">'; print '<input class="flat" type="text" size="10" name="search_company" value="'.dol_escape_htmltag($search_company).'">';
print '</td>'; print '</td>';
print '<td class="liste_titre">&nbsp;</td>'; print '<td class="liste_titre">&nbsp;</td>';
if($conf->livraison_bon->enabled) { if($conf->livraison_bon->enabled) {
@ -141,13 +143,9 @@ if ($resql)
print '</td>'; print '</td>';
print '<td class="liste_titre">&nbsp;</td>'; print '<td class="liste_titre">&nbsp;</td>';
} }
print '<td class="liste_titre" align="right">'; print '<td class="liste_titre" align="right"><input type="image" class="liste_titre" name="button_search" src="'.img_picto($langs->trans("Search"),'search.png','','',1).'" value="'.dol_escape_htmltag($langs->trans("Search")).'" title="'.dol_escape_htmltag($langs->trans("Search")).'">';
// Développé dans la 3.7
//print img_search();
//print img_searchclear();
print '<input type="image" class="liste_titre" name="button_search" src="'.img_picto($langs->trans("Search"),'search.png','','',1).'" value="'.dol_escape_htmltag($langs->trans("Search")).'" title="'.dol_escape_htmltag($langs->trans("Search")).'">';
print '<input type="image" class="liste_titre" name="button_removefilter" src="'.img_picto($langs->trans("Search"),'searchclear.png','','',1).'" value="'.dol_escape_htmltag($langs->trans("RemoveFilter")).'" title="'.dol_escape_htmltag($langs->trans("RemoveFilter")).'">'; print '<input type="image" class="liste_titre" name="button_removefilter" src="'.img_picto($langs->trans("Search"),'searchclear.png','','',1).'" value="'.dol_escape_htmltag($langs->trans("RemoveFilter")).'" title="'.dol_escape_htmltag($langs->trans("RemoveFilter")).'">';
print '</td>'; print '</td>';
print '<td class="liste_titre" align="center">'; print '<td class="liste_titre" align="center">';
print '<a href="#" id="checkall">'.$langs->trans("All").'</a> / <a href="#" id="checknone">'.$langs->trans("None").'</a>'; print '<a href="#" id="checkall">'.$langs->trans("All").'</a> / <a href="#" id="checknone">'.$langs->trans("None").'</a>';
print '</td>'; print '</td>';
@ -161,12 +159,15 @@ if ($resql)
$objp = $db->fetch_object($resql); $objp = $db->fetch_object($resql);
$var=!$var; $var=!$var;
// Ref
print "<tr ".$bc[$var].">"; print "<tr ".$bc[$var].">";
print "<td>"; print "<td>";
$shipment->id=$objp->rowid; $shipment->id=$objp->rowid;
$shipment->ref=$objp->ref; $shipment->ref=$objp->ref;
print $shipment->getNomUrl(1); print $shipment->getNomUrl(1);
print "</td>\n"; print "</td>\n";
// Third party // Third party
print '<td>'; print '<td>';
$companystatic->id=$objp->socid; $companystatic->id=$objp->socid;
@ -174,7 +175,8 @@ if ($resql)
$companystatic->name=$objp->socname; $companystatic->name=$objp->socname;
print $companystatic->getNomUrl(1); print $companystatic->getNomUrl(1);
print '</td>'; print '</td>';
// Date delivery planed
// Date delivery planed
print "<td align=\"center\">"; print "<td align=\"center\">";
print dol_print_date($db->jdate($objp->date_expedition),"day"); print dol_print_date($db->jdate($objp->date_expedition),"day");
/*$now = time(); /*$now = time();

View File

@ -99,7 +99,7 @@ $var=!$var;
print "<tr ".$bc[$var].">"; print "<tr ".$bc[$var].">";
print '<td class="fieldrequired">'.$langs->trans("Label")."</td>"; print '<td class="fieldrequired">'.$langs->trans("Label")."</td>";
print "<td><input type=\"text\" class=\"flat\" name=\"EXTERNALSITE_LABEL\" value=\"". (GETPOST('EXTERNALSITE_LABEL','alpha')?GETPOST('EXTERNALSITE_LABEL','alpha'):((empty($conf->global->EXTERNALSITE_LABEL) || $conf->global->EXTERNALSITE_LABEL=='ExternalSite')?'':$conf->global->EXTERNALSITE_LABEL)) . "\" size=\"12\"></td>"; print "<td><input type=\"text\" class=\"flat\" name=\"EXTERNALSITE_LABEL\" value=\"". (GETPOST('EXTERNALSITE_LABEL','alpha')?GETPOST('EXTERNALSITE_LABEL','alpha'):((empty($conf->global->EXTERNALSITE_LABEL) || $conf->global->EXTERNALSITE_LABEL=='ExternalSite')?'':$conf->global->EXTERNALSITE_LABEL)) . "\" size=\"12\"></td>";
print "<td>My menu entry</td>"; print "<td>".$langs->trans("ExampleMyMenuEntry")."</td>";
print "</tr>"; print "</tr>";
$var=!$var; $var=!$var;

View File

@ -155,7 +155,7 @@ if ($id > 0 || ! empty($ref))
// Date // Date
print '<tr><td>'.$langs->trans("Date").'</td>'; print '<tr><td>'.$langs->trans("Date").'</td>';
print "<td colspan=\"2\">".dol_print_date($object->date,"daytext")."</td>\n"; print "<td colspan=\"2\">".dol_print_date($object->datec,"daytext")."</td>\n";
print '</tr>'; print '</tr>';
print '</table>'; print '</table>';

View File

@ -158,7 +158,7 @@ if ($result)
} }
print '<td class="liste_titre" align="right">'; print '<td class="liste_titre" align="right">';
$liststatus=$interventionstatic->statuts_short; $liststatus=$interventionstatic->statuts_short;
print $form->selectarray('search_status', $liststatus, GETPOST('search_status'), 1, 0, 0, '', 1); print $form->selectarray('search_status', $liststatus, $search_status, 1, 0, 0, '', 1);
print '</td>'; print '</td>';
print '<td class="liste_titre" align="right"><input type="image" class="liste_titre" name="button_search" src="'.img_picto($langs->trans("Search"),'search.png','','',1).'" value="'.dol_escape_htmltag($langs->trans("Search")).'" title="'.dol_escape_htmltag($langs->trans("Search")).'">'; print '<td class="liste_titre" align="right"><input type="image" class="liste_titre" name="button_search" src="'.img_picto($langs->trans("Search"),'search.png','','',1).'" value="'.dol_escape_htmltag($langs->trans("Search")).'" title="'.dol_escape_htmltag($langs->trans("Search")).'">';
print '<input type="image" class="liste_titre" name="button_removefilter" src="'.img_picto($langs->trans("Search"),'searchclear.png','','',1).'" value="'.dol_escape_htmltag($langs->trans("RemoveFilter")).'" title="'.dol_escape_htmltag($langs->trans("RemoveFilter")).'">'; print '<input type="image" class="liste_titre" name="button_removefilter" src="'.img_picto($langs->trans("Search"),'searchclear.png','','',1).'" value="'.dol_escape_htmltag($langs->trans("RemoveFilter")).'" title="'.dol_escape_htmltag($langs->trans("RemoveFilter")).'">';

View File

@ -1,7 +1,7 @@
<?php <?php
/* Copyright (C) 2001-2005 Rodolphe Quiedeville <rodolphe@quiedeville.org> /* Copyright (C) 2001-2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2003 Eric Seigne <erics@rycks.com> * Copyright (C) 2003 Eric Seigne <erics@rycks.com>
* Copyright (C) 2004-2011 Laurent Destailleur <eldy@users.sourceforge.net> * Copyright (C) 2004-2014 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2010 Regis Houssin <regis.houssin@capnetworks.com> * Copyright (C) 2005-2010 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2010-2014 Juanjo Menent <jmenent@2byte.es> * Copyright (C) 2010-2014 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2014 Jean Heimburger <jean@tiaris.info> * Copyright (C) 2014 Jean Heimburger <jean@tiaris.info>
@ -394,13 +394,13 @@ if ($object->fetch($id))
if ($user->rights->fournisseur->facture->lire) if ($user->rights->fournisseur->facture->lire)
{ {
// TODO move to DAO class // TODO move to DAO class
$sql = 'SELECT f.rowid,f.libelle,f.ref_supplier,f.fk_statut,f.datef as df,f.total_ttc as amount,f.paye,'; $sql = 'SELECT f.rowid,f.libelle,f.ref,f.ref_supplier,f.fk_statut,f.datef as df,f.total_ttc as amount,f.paye,';
$sql.= ' SUM(pf.amount) as am'; $sql.= ' SUM(pf.amount) as am';
$sql.= ' FROM '.MAIN_DB_PREFIX.'facture_fourn as f'; $sql.= ' FROM '.MAIN_DB_PREFIX.'facture_fourn as f';
$sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'paiementfourn_facturefourn as pf ON f.rowid=pf.fk_facturefourn'; $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'paiementfourn_facturefourn as pf ON f.rowid=pf.fk_facturefourn';
$sql.= ' WHERE f.fk_soc = '.$object->id; $sql.= ' WHERE f.fk_soc = '.$object->id;
$sql.= " AND f.entity =".$conf->entity; $sql.= " AND f.entity =".$conf->entity;
$sql.= ' GROUP BY f.rowid,f.libelle,f.ref_supplier,f.fk_statut,f.datef,f.total_ttc,f.paye'; $sql.= ' GROUP BY f.rowid,f.libelle,f.ref,f.ref_supplier,f.fk_statut,f.datef,f.total_ttc,f.paye';
$sql.= ' ORDER BY f.datef DESC'; $sql.= ' ORDER BY f.datef DESC';
$resql=$db->query($sql); $resql=$db->query($sql);
if ($resql) if ($resql)
@ -425,7 +425,13 @@ if ($object->fetch($id))
print '<tr '.$bc[$var].'>'; print '<tr '.$bc[$var].'>';
print '<td>'; print '<td>';
print '<a href="facture/card.php?facid='.$obj->rowid.'">'; print '<a href="facture/card.php?facid='.$obj->rowid.'">';
print img_object($langs->trans('ShowBill'),'bill').' '.$obj->ref_supplier.'</a> '.dol_trunc($obj->libelle,14).'</td>'; $facturestatic->id=$obj->rowid;
$facturestatic->ref=($obj->ref?$obj->ref:$obj->rowid).($obj->ref_supplier?' - '.$obj->ref_supplier:'');
//$facturestatic->ref_supplier=$obj->ref_supplier;
print $facturestatic->getNomUrl(1);
//print img_object($langs->trans('ShowBill'),'bill').' '.($obj->ref?$obj->ref:$obj->rowid).' - '.$obj->ref_supplier.'</a>';
print ' '.dol_trunc($obj->libelle,14);
print '</td>';
print '<td align="center" class="nowrap">'.dol_print_date($db->jdate($obj->df),'day').'</td>'; print '<td align="center" class="nowrap">'.dol_print_date($db->jdate($obj->df),'day').'</td>';
print '<td align="right" class="nowrap">'.price($obj->amount).'</td>'; print '<td align="right" class="nowrap">'.price($obj->amount).'</td>';
print '<td align="right" class="nowrap">'; print '<td align="right" class="nowrap">';

View File

@ -953,6 +953,8 @@ class CommandeFournisseur extends CommonOrder
if (! $error) if (! $error)
{ {
$action='create';
// Actions on extra fields (by external module or standard code) // Actions on extra fields (by external module or standard code)
// FIXME le hook fait double emploi avec le trigger !! // FIXME le hook fait double emploi avec le trigger !!
$hookmanager->initHooks(array('supplierorderdao')); $hookmanager->initHooks(array('supplierorderdao'));

View File

@ -255,6 +255,8 @@ class FactureFournisseur extends CommonInvoice
$result=$this->update_price(); $result=$this->update_price();
if ($result > 0) if ($result > 0)
{ {
$action='create';
// Actions on extra fields (by external module or standard code) // Actions on extra fields (by external module or standard code)
// FIXME le hook fait double emploi avec le trigger !! // FIXME le hook fait double emploi avec le trigger !!
$hookmanager->initHooks(array('supplierinvoicedao')); $hookmanager->initHooks(array('supplierinvoicedao'));
@ -539,7 +541,7 @@ class FactureFournisseur extends CommonInvoice
* @param int $notrigger 0=launch triggers after, 1=disable triggers * @param int $notrigger 0=launch triggers after, 1=disable triggers
* @return int <0 if KO, >0 if OK * @return int <0 if KO, >0 if OK
*/ */
function update($user=0, $notrigger=0) function update($user=null, $notrigger=0)
{ {
global $conf, $langs; global $conf, $langs;
$error=0; $error=0;

View File

@ -117,7 +117,7 @@ if ($user->rights->fournisseur->facture->lire)
if ($search_ref) if ($search_ref)
{ {
$sql .= " AND f.rowid LIKE '%".$search_ref."%'"; $sql .= " AND f.ref LIKE '%".$search_ref."%'";
} }
if ($search_ref_supplier) if ($search_ref_supplier)
{ {
@ -241,7 +241,7 @@ if ($user->rights->fournisseur->facture->lire)
print $facturestatic->getNomUrl(1); print $facturestatic->getNomUrl(1);
print "</td>\n"; print "</td>\n";
print '<td class="nowrap">'.dol_trunc($objp->ref_supplier,12)."</td>\n"; print '<td class="nowrap">'.dol_trunc($objp->ref_supplier,12).'</td>';
print '<td class="nowrap" align="center">'.dol_print_date($db->jdate($objp->df),'day')."</td>\n"; print '<td class="nowrap" align="center">'.dol_print_date($db->jdate($objp->df),'day')."</td>\n";
print '<td class="nowrap" align="center">'.dol_print_date($db->jdate($objp->datelimite),'day'); print '<td class="nowrap" align="center">'.dol_print_date($db->jdate($objp->datelimite),'day');
@ -258,7 +258,7 @@ if ($user->rights->fournisseur->facture->lire)
print "<td align=\"right\">".price($objp->total_ttc)."</td>"; print "<td align=\"right\">".price($objp->total_ttc)."</td>";
print "<td align=\"right\">".price($objp->am)."</td>"; print "<td align=\"right\">".price($objp->am)."</td>";
// Affiche statut de la facture // Show invoice status
print '<td align="right" class="nowrap">'; print '<td align="right" class="nowrap">';
print $facturestatic->LibStatut($objp->paye,$objp->fk_statut,5,$objp->am); print $facturestatic->LibStatut($objp->paye,$objp->fk_statut,5,$objp->am);
print '</td>'; print '</td>';

View File

@ -72,8 +72,9 @@ $search_amount_no_tax = GETPOST("search_amount_no_tax","alpha");
$search_amount_all_tax = GETPOST("search_amount_all_tax","alpha"); $search_amount_all_tax = GETPOST("search_amount_all_tax","alpha");
$month = GETPOST("month","int"); $month = GETPOST("month","int");
$year = GETPOST("year","int"); $year = GETPOST("year","int");
$filter = GETPOST("filtre");
if (GETPOST("button_removefilter")) if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter")) // Both test must be present to be compatible with all browsers
{ {
$search_ref=""; $search_ref="";
$search_ref_supplier=""; $search_ref_supplier="";
@ -83,6 +84,7 @@ if (GETPOST("button_removefilter"))
$search_amount_all_tax=""; $search_amount_all_tax="";
$year=""; $year="";
$month=""; $month="";
$filter="";
} }
/* /*
@ -136,9 +138,9 @@ if ($socid)
{ {
$sql .= " AND s.rowid = ".$socid; $sql .= " AND s.rowid = ".$socid;
} }
if (GETPOST('filtre') && GETPOST('filtre') != -1) // GETPOST('filtre') may be a string if ($filter && $filter != -1) // GETPOST('filtre') may be a string
{ {
$filtrearr = explode(",", GETPOST('filtre')); $filtrearr = explode(",", $filter);
foreach ($filtrearr as $fil) foreach ($filtrearr as $fil)
{ {
$filt = explode(":", $fil); $filt = explode(":", $fil);
@ -217,7 +219,7 @@ if ($resql)
if ($search_company) $param.='&search_company='.urlencode($search_company); if ($search_company) $param.='&search_company='.urlencode($search_company);
if ($search_amount_no_tax) $param.='&search_amount_no_tax='.urlencode($search_amount_no_tax); if ($search_amount_no_tax) $param.='&search_amount_no_tax='.urlencode($search_amount_no_tax);
if ($search_amount_all_tax) $param.='&search_amount_all_tax='.urlencode($search_amount_all_tax); if ($search_amount_all_tax) $param.='&search_amount_all_tax='.urlencode($search_amount_all_tax);
if (GETPOST("filtre") && GETPOST('filtre') != -1) $param.='&filtre='.urlencode(GETPOST("filtre")); if ($filter && $filter != -1) $param.='&filtre='.urlencode($filter);
print_barre_liste($langs->trans("BillsSuppliers").($socid?" $soc->name.":""),$page,$_SERVER["PHP_SELF"],$param,$sortfield,$sortorder,'',$num,$nbtotalofrecords); print_barre_liste($langs->trans("BillsSuppliers").($socid?" $soc->name.":""),$page,$_SERVER["PHP_SELF"],$param,$sortfield,$sortorder,'',$num,$nbtotalofrecords);
print '<form method="GET" action="'.$_SERVER["PHP_SELF"].'">'; print '<form method="GET" action="'.$_SERVER["PHP_SELF"].'">';
@ -269,8 +271,8 @@ if ($resql)
print '</td><td class="liste_titre" align="right">'; print '</td><td class="liste_titre" align="right">';
print '<input class="flat" type="text" size="8" name="search_amount_all_tax" value="'.$search_amount_all_tax.'">'; print '<input class="flat" type="text" size="8" name="search_amount_all_tax" value="'.$search_amount_all_tax.'">';
print '</td><td class="liste_titre" align="right">'; print '</td><td class="liste_titre" align="right">';
$liststatus=array('paye:0'=>$langs->trans("Unpayed"), 'paye:1'=>$langs->trans("Payed")); $liststatus=array('paye:0'=>$langs->trans("Unpaid"), 'paye:1'=>$langs->trans("Paid"));
print $form->selectarray('filtre', $liststatus, GETPOST('filtre'), 1); print $form->selectarray('filtre', $liststatus, $filter, 1);
print '</td><td class="liste_titre" align="right">'; print '</td><td class="liste_titre" align="right">';
print '<input type="image" class="liste_titre" name="button_search" src="'.img_picto($langs->trans("Search"),'search.png','','',1).'" value="'.dol_escape_htmltag($langs->trans("Search")).'" title="'.dol_escape_htmltag($langs->trans("Search")).'">'; print '<input type="image" class="liste_titre" name="button_search" src="'.img_picto($langs->trans("Search"),'search.png','','',1).'" value="'.dol_escape_htmltag($langs->trans("Search")).'" title="'.dol_escape_htmltag($langs->trans("Search")).'">';
print '<input type="image" class="liste_titre" name="button_removefilter" src="'.img_picto($langs->trans("Search"),'searchclear.png','','',1).'" value="'.dol_escape_htmltag($langs->trans("RemoveFilter")).'" title="'.dol_escape_htmltag($langs->trans("RemoveFilter")).'">'; print '<input type="image" class="liste_titre" name="button_removefilter" src="'.img_picto($langs->trans("Search"),'searchclear.png','','',1).'" value="'.dol_escape_htmltag($langs->trans("RemoveFilter")).'" title="'.dol_escape_htmltag($langs->trans("RemoveFilter")).'">';

View File

@ -536,7 +536,7 @@ if (empty($action))
print_liste_field_titre($langs->trans('ThirdParty'),$_SERVER["PHP_SELF"],'s.nom','',$paramlist,'',$sortfield,$sortorder); print_liste_field_titre($langs->trans('ThirdParty'),$_SERVER["PHP_SELF"],'s.nom','',$paramlist,'',$sortfield,$sortorder);
print_liste_field_titre($langs->trans('Type'),$_SERVER["PHP_SELF"],'c.libelle','',$paramlist,'',$sortfield,$sortorder); print_liste_field_titre($langs->trans('Type'),$_SERVER["PHP_SELF"],'c.libelle','',$paramlist,'',$sortfield,$sortorder);
print_liste_field_titre($langs->trans('Account'),$_SERVER["PHP_SELF"],'ba.label','',$paramlist,'',$sortfield,$sortorder); print_liste_field_titre($langs->trans('Account'),$_SERVER["PHP_SELF"],'ba.label','',$paramlist,'',$sortfield,$sortorder);
print_liste_field_titre($langs->trans('Amount'),$_SERVER["PHP_SELF"],'f.amount','',$paramlist,'align="right"',$sortfield,$sortorder); print_liste_field_titre($langs->trans('Amount'),$_SERVER["PHP_SELF"],'p.amount','',$paramlist,'align="right"',$sortfield,$sortorder);
//print_liste_field_titre($langs->trans('Invoice'),$_SERVER["PHP_SELF"],'ref_supplier','',$paramlist,'',$sortfield,$sortorder); //print_liste_field_titre($langs->trans('Invoice'),$_SERVER["PHP_SELF"],'ref_supplier','',$paramlist,'',$sortfield,$sortorder);
print '<td class="liste_titre">&nbsp;</td>'; print '<td class="liste_titre">&nbsp;</td>';
print "</tr>\n"; print "</tr>\n";

View File

@ -761,7 +761,6 @@ if (empty($id) || $action == 'add' || $action == 'request' || $action == 'create
print '<input type="hidden" name="userid" value="'.$userid.'">'; print '<input type="hidden" name="userid" value="'.$userid.'">';
} }
else print $form->select_users(GETPOST('userid')?GETPOST('userid'):$user->id,'userid',0,'',0); else print $form->select_users(GETPOST('userid')?GETPOST('userid'):$user->id,'userid',0,'',0);
//var_dump($cp->getConfCP('nbHolidayDeducted'));
$nb_holiday = $cp->getCPforUser($user->id) / $cp->getConfCP('nbHolidayDeducted'); $nb_holiday = $cp->getCPforUser($user->id) / $cp->getConfCP('nbHolidayDeducted');
print ' &nbsp; <span>'.$langs->trans('SoldeCPUser', round($nb_holiday,2)).'</span>'; print ' &nbsp; <span>'.$langs->trans('SoldeCPUser', round($nb_holiday,2)).'</span>';
print '</td>'; print '</td>';

View File

@ -470,7 +470,7 @@ class Holiday extends CommonObject
* @param int $notrigger 0=launch triggers after, 1=disable triggers * @param int $notrigger 0=launch triggers after, 1=disable triggers
* @return int <0 if KO, >0 if OK * @return int <0 if KO, >0 if OK
*/ */
function update($user=0, $notrigger=0) function update($user=null, $notrigger=0)
{ {
global $conf, $langs; global $conf, $langs;
$error=0; $error=0;
@ -1045,7 +1045,8 @@ class Holiday extends CommonObject
$result = $this->db->query($sql); $result = $this->db->query($sql);
if($result) { if($result) {
$obj = $this->db->fetch_object($result); $obj = $this->db->fetch_object($result);
return number_format($obj->nb_holiday,2); //return number_format($obj->nb_holiday,2);
return $obj->nb_holiday;
} else { } else {
return '0'; return '0';
} }

View File

@ -1,21 +0,0 @@
(The MIT License)
Copyright (c) 2012-2014 Zhixin Wen <wenzhixin2010@gmail.com>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.

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