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

Conflicts:
	htdocs/install/mysql/migration/3.7.0-3.8.0.sql
This commit is contained in:
aspangaro 2015-03-20 06:36:06 +01:00
commit c4a580723d
1463 changed files with 48062 additions and 4699 deletions

View File

@ -1,6 +1,6 @@
[main] [main]
host = https://www.transifex.com host = https://www.transifex.com
lang_map = uz: uz_UZ lang_map = uz: uz_UZ, sw: sw_SW
[dolibarr.accountancy] [dolibarr.accountancy]
file_filter = htdocs/langs/<lang>/accountancy.lang file_filter = htdocs/langs/<lang>/accountancy.lang
@ -146,6 +146,12 @@ source_file = htdocs/langs/en_US/holiday.lang
source_lang = en_US source_lang = en_US
type = MOZILLAPROPERTIES type = MOZILLAPROPERTIES
[dolibarr.incoterm]
file_filter = htdocs/langs/<lang>/incoterm.lang
source_file = htdocs/langs/en_US/incoterm.lang
source_lang = en_US
type = MOZILLAPROPERTIES
[dolibarr.install] [dolibarr.install]
file_filter = htdocs/langs/<lang>/install.lang file_filter = htdocs/langs/<lang>/install.lang
source_file = htdocs/langs/en_US/install.lang source_file = htdocs/langs/en_US/install.lang

View File

@ -31,7 +31,8 @@ WARNING: Following changes may create regression for some external modules, but
Dolibarr better: Dolibarr better:
- Removed hoo supplierorderdao into supplier order creation. This is a business event, so we must use the - Removed hoo supplierorderdao into supplier order creation. This is a business event, so we must use the
trigger ORDER_SUPPLIER_CREATE instead. trigger ORDER_SUPPLIER_CREATE instead.
- Hooks 'printLeftBlock' and 'formConfirm' are now compliant with hook development rules. They are
"addreplace" hooks, so you must return content with "->resprints='mycontent'" and not with "return 'mycontent'"
***** ChangeLog for 3.7 compared to 3.6.* ***** ***** ChangeLog for 3.7 compared to 3.6.* *****

View File

@ -32,13 +32,18 @@ then
for dir in `find htdocs/langs/$3* -type d` for dir in `find htdocs/langs/$3* -type d`
do do
dirshort=`basename $dir` dirshort=`basename $dir`
#echo $dirshort #echo $dirshort
export aa=`echo $dirshort | nawk -F"_" '{ print $1 }'` export aa=`echo $dirshort | nawk -F"_" '{ print $1 }'`
export bb=`echo $dirshort | nawk -F"_" '{ print $2 }'` export bb=`echo $dirshort | nawk -F"_" '{ print $2 }'`
aaupper=`echo $dirshort | nawk -F"_" '{ print toupper($1) }'` aaupper=`echo $dirshort | nawk -F"_" '{ print toupper($1) }'`
if [ $aaupper = "EN" ]
then
aaupper="US"
fi
bblower=`echo $dirshort | nawk -F"_" '{ print tolower($2) }'` bblower=`echo $dirshort | nawk -F"_" '{ print tolower($2) }'`
if [ "$aa" != "$bblower" ] if [ "$aa" != "$bblower" -a "$dirshort" != "en_US" ]
then then
reflang="htdocs/langs/"$aa"_"$aaupper reflang="htdocs/langs/"$aa"_"$aaupper
if [ -d $reflang ] if [ -d $reflang ]
@ -48,6 +53,15 @@ then
echo ./dev/translation/strip_language_file.php $aa"_"$aaupper $aa"_"$bb $2 echo ./dev/translation/strip_language_file.php $aa"_"$aaupper $aa"_"$bb $2
./dev/translation/strip_language_file.php $aa"_"$aaupper $aa"_"$bb $2 ./dev/translation/strip_language_file.php $aa"_"$aaupper $aa"_"$bb $2
for fic in `ls htdocs/langs/${aa}_${bb}/*.delta`; do f=`echo $fic | sed -e 's/\.delta//'`; echo $f; mv $f.delta $f; done for fic in `ls htdocs/langs/${aa}_${bb}/*.delta`; do f=`echo $fic | sed -e 's/\.delta//'`; echo $f; mv $f.delta $f; done
for fic in `ls htdocs/langs/${aa}_${bb}/*.lang`;
do f=`cat $fic | wc -l`;
#echo $f lines into file $fic;
if [ $f = 1 ]
then
echo Only one line remainging into file $fic, we delete it;
rm $fic
fi;
done
fi fi
fi fi
done; done;

View File

@ -60,6 +60,7 @@ $rc = 0;
$lPrimary = isset($argv[1])?$argv[1]:''; $lPrimary = isset($argv[1])?$argv[1]:'';
$lSecondary = isset($argv[2])?$argv[2]:''; $lSecondary = isset($argv[2])?$argv[2]:'';
$lEnglish = 'en_US';
$filesToProcess = isset($argv[3])?$argv[3]:''; $filesToProcess = isset($argv[3])?$argv[3]:'';
if (empty($lPrimary) || empty($lSecondary) || empty($filesToProcess)) if (empty($lPrimary) || empty($lSecondary) || empty($filesToProcess))
@ -73,6 +74,7 @@ if (empty($lPrimary) || empty($lSecondary) || empty($filesToProcess))
$aPrimary = array(); $aPrimary = array();
$aSecondary = array(); $aSecondary = array();
$aEnglish = array();
// Define array $filesToProcess // Define array $filesToProcess
if ($filesToProcess == 'all') if ($filesToProcess == 'all')
@ -96,6 +98,7 @@ foreach($filesToProcess as $fileToProcess)
{ {
$lPrimaryFile = 'htdocs/langs/'.$lPrimary.'/'.$fileToProcess; $lPrimaryFile = 'htdocs/langs/'.$lPrimary.'/'.$fileToProcess;
$lSecondaryFile = 'htdocs/langs/'.$lSecondary.'/'.$fileToProcess; $lSecondaryFile = 'htdocs/langs/'.$lSecondary.'/'.$fileToProcess;
$lEnglishFile = 'htdocs/langs/'.$lEnglish.'/'.$fileToProcess;
$output = $lSecondaryFile . '.delta'; $output = $lSecondaryFile . '.delta';
print "---- Process language file ".$lSecondaryFile."\n"; print "---- Process language file ".$lSecondaryFile."\n";
@ -114,6 +117,13 @@ foreach($filesToProcess as $fileToProcess)
continue; continue;
} }
if ( ! is_readable($lEnglishFile) ) {
$rc = 3;
$msg = "Cannot read english language file $lEnglishFile. We discard this file.";
print $msg . "\n";
continue;
}
// Start reading and parsing Secondary // Start reading and parsing Secondary
if ( $handle = fopen($lSecondaryFile, 'r') ) if ( $handle = fopen($lSecondaryFile, 'r') )
@ -172,6 +182,65 @@ foreach($filesToProcess as $fileToProcess)
} }
// Start reading and parsing English
if ( $handle = fopen($lEnglishFile, 'r') )
{
print "Read English File $lEnglishFile:\n";
$cnt = 0;
while (($line = fgets($handle)) !== false)
{
$cnt++;
// strip comments
if ( preg_match("/^\w*#/", $line) ) {
continue;
}
// strip empty lines
if ( preg_match("/^\w*$/", $line) ) {
continue;
}
$a = mb_split('=', trim($line), 2);
if ( count($a) != 2 ) {
print "ERROR in file $lEnglishFile, line $cnt: " . trim($line) . "\n";
continue;
}
list($key, $value) = $a;
// key is redundant
if ( array_key_exists($key, $aEnglish) ) {
print "Key $key is redundant in file $lEnglishFile (line: $cnt).\n";
continue;
}
// String has no value
if ( $value == '' ) {
print "Key $key has no value in file $lEnglishFile (line: $cnt).\n";
continue;
}
$aEnglish[$key] = trim($value);
}
if ( ! feof($handle) )
{
$rc = 5;
$msg = "Unexpected fgets() fail";
print $msg . " (rc=$rc).\n";
exit($rc);
}
fclose($handle);
}
else {
$rc = 6;
$msg = "Cannot open file $lEnglishFile";
print $msg . " (rc=$rc).\n";
exit($rc);
}
// Start reading and parsing Primary. See rules in header! // Start reading and parsing Primary. See rules in header!
$arrayofkeytoalwayskeep=array('DIRECTION','FONTFORPDF','FONTSIZEFORPDF','SeparatorDecimal','SeparatorThousand'); $arrayofkeytoalwayskeep=array('DIRECTION','FONTFORPDF','FONTSIZEFORPDF','SeparatorDecimal','SeparatorThousand');
@ -246,7 +315,11 @@ foreach($filesToProcess as $fileToProcess)
} }
// String exists in both files and does not match // String exists in both files and does not match
if ((! empty($aSecondary[$key]) && $aSecondary[$key] != $aPrimary[$key]) || in_array($key, $arrayofkeytoalwayskeep) || preg_match('/^FormatDate/',$key) || preg_match('/^FormatHour/',$key)) if (
(! empty($aSecondary[$key]) && $aSecondary[$key] != $aPrimary[$key]
&& ! empty($aEnglish[$key]) && $aSecondary[$key] != $aEnglish[$key])
|| in_array($key, $arrayofkeytoalwayskeep) || preg_match('/^FormatDate/',$key) || preg_match('/^FormatHour/',$key)
)
{ {
//print "Key $key differs so we add it into new secondary language (line: $cnt).\n"; //print "Key $key differs so we add it into new secondary language (line: $cnt).\n";
fwrite($oh, $key."=".(empty($aSecondary[$key])?$aPrimary[$key]:$aSecondary[$key])."\n"); fwrite($oh, $key."=".(empty($aSecondary[$key])?$aPrimary[$key]:$aSecondary[$key])."\n");

View File

@ -13,7 +13,7 @@ then
echo "This pull remote transifex files to local dir." echo "This pull remote transifex files to local dir."
echo "Note: If you pull a language file (not source), file will be skipped if local file is newer." echo "Note: If you pull a language file (not source), file will be skipped if local file is newer."
echo " Using -f will overwrite local file (does not work with 'all')." echo " Using -f will overwrite local file (does not work with 'all')."
echo "Usage: ./dev/translation/txpull.sh (all|xx_XX) [-r dolibarr.file] [-f]" echo "Usage: ./dev/translation/txpull.sh (all|xx_XX) [-r dolibarr.file] [-f] [-s]"
exit exit
fi fi
@ -26,13 +26,21 @@ fi
if [ "x$1" = "xall" ] if [ "x$1" = "xall" ]
then then
for fic in ar_SA bg_BG bs_BA ca_ES cs_CZ da_DK de_DE el_GR es_ES et_EE eu_ES fa_IR fi_FI fr_FR he_IL hr_HR hu_HU id_ID is_IS it_IT ja_JP ka_GE ko_KR lt_LT lv_LV mk_MK nb_NO nl_NL pl_PL pt_PT ro_RO ru_RU ru_UA sk_SK sl_SI sq_AL sv_SE th_TH tr_TR uk_UA uz_UZ vi_VN zh_CN zh_TW cd htdocs/lang
for dir in `find htdocs/langs/* -type d`
do do
fic=`basename $dir`
if [ $fic != "en_US" ]
then
echo "tx pull -l $fic $2 $3" echo "tx pull -l $fic $2 $3"
tx pull -l $fic $2 $3 tx pull -l $fic $2 $3
fi
done done
cd -
else else
echo "tx pull -l $1 $2 $3 $4" echo "tx pull -l $1 $2 $3 $4 $5"
tx pull -l $1 $2 $3 $4 tx pull -l $1 $2 $3 $4 $5
fi fi
echo Think to launch also:
echo "> dev/fixaltlanguages.sh fix all"

View File

@ -1,6 +1,6 @@
<?php <?php
/* Copyright (C) 2002-2004 Rodolphe Quiedeville <rodolphe@quiedeville.org> /* Copyright (C) 2002-2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2006-2008 Laurent Destailleur <eldy@users.sourceforge.net> * Copyright (C) 2006-2015 Laurent Destailleur <eldy@users.sourceforge.net>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
@ -90,7 +90,7 @@ class Cotisation extends CommonObject
} }
else else
{ {
$this->error=$this->db->error(); $this->error=$this->db->lasterror();
return -1; return -1;
} }
} }
@ -140,7 +140,7 @@ class Cotisation extends CommonObject
} }
else else
{ {
$this->error=$this->db->error(); $this->error=$this->db->lasterror();
return -1; return -1;
} }
} }
@ -181,7 +181,7 @@ class Cotisation extends CommonObject
else else
{ {
$this->db->rollback(); $this->db->rollback();
$this->error=$this->db->error(); $this->error=$this->db->lasterror();
return -1; return -1;
} }
} }
@ -217,7 +217,7 @@ class Cotisation extends CommonObject
$result=$member->fetch($this->fk_adherent); $result=$member->fetch($this->fk_adherent);
$result=$member->update_end_date($user); $result=$member->update_end_date($user);
if ($accountline->rowid > 0) // If we found bank account line (this means this->fk_bank defined) if ($accountline->id > 0) // If we found bank account line (this means this->fk_bank defined)
{ {
$result=$accountline->delete($user); // Return false if refused because line is conciliated $result=$accountline->delete($user); // Return false if refused because line is conciliated
if ($result > 0) if ($result > 0)

View File

@ -622,9 +622,29 @@ else
} }
print '</table>'; print '</table>';
print '<br>'; print '<br>';
/*
* Notifications
*/
print_titre($langs->trans("Notifications"));
print '<table class="noborder" width="100%">';
print '<tr class="liste_titre">';
print '<td>'.$langs->trans("Parameter").'</td>';
print '<td align="center" width="60"></td>';
print '<td width="80">&nbsp;</td>';
print "</tr>\n";
print '<tr '.$bc[$var].'><td colspan="2">';
print $langs->trans("YouMayFindNotificationsFeaturesIntoModuleNotification").'<br>';
print '</td><td align="right">';
print "</td></tr>\n";
print '</table>';
llxFooter(); llxFooter();
$db->close(); $db->close();

View File

@ -229,7 +229,7 @@ $sql.= ", note";
$sql.= ", entity"; $sql.= ", entity";
$sql.= " FROM ".MAIN_DB_PREFIX."const"; $sql.= " FROM ".MAIN_DB_PREFIX."const";
$sql.= " WHERE entity IN (".$user->entity.",".$conf->entity.")"; $sql.= " WHERE entity IN (".$user->entity.",".$conf->entity.")";
if (empty($user->entity) && $debug) {} // to force for superadmin if ((empty($user->entity) || $user->admin) && $debug) {} // to force for superadmin
else $sql.= " AND visible = 1"; // We must always have this. Otherwise, array is too large and submitting data fails due to apache POST or GET limits else $sql.= " AND visible = 1"; // We must always have this. Otherwise, array is too large and submitting data fails due to apache POST or GET limits
$sql.= " ORDER BY entity, name ASC"; $sql.= " ORDER BY entity, name ASC";

View File

@ -630,7 +630,6 @@ print '</table>';
/* /*
* Modes de reglement * Modes de reglement
*
*/ */
print '<br>'; print '<br>';
print_titre($langs->trans("SuggestedPaymentModesIfNotDefinedInInvoice")); print_titre($langs->trans("SuggestedPaymentModesIfNotDefinedInInvoice"));
@ -811,7 +810,27 @@ print '</tr>'."\n";
print "</table>\n"; print "</table>\n";
//dol_fiche_end(); /*
* Notifications
*/
print '<br>';
print_titre($langs->trans("Notifications"));
print '<table class="noborder" width="100%">';
print '<tr class="liste_titre">';
print '<td>'.$langs->trans("Parameter").'</td>';
print '<td align="center" width="60"></td>';
print '<td width="80">&nbsp;</td>';
print "</tr>\n";
print '<tr '.$bc[$var].'><td colspan="2">';
print $langs->trans("YouMayFindNotificationsFeaturesIntoModuleNotification").'<br>';
print '</td><td align="right">';
print "</td></tr>\n";
print '</table>';
dol_fiche_end();
llxFooter(); llxFooter();

View File

@ -24,6 +24,7 @@
*/ */
require '../main.inc.php'; require '../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/notify.class.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/triggers/interface_50_modNotification_Notification.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/triggers/interface_50_modNotification_Notification.class.php';
@ -48,25 +49,56 @@ $action = GETPOST("action");
if ($action == 'setvalue' && $user->admin) if ($action == 'setvalue' && $user->admin)
{ {
$db->begin();
$result=dolibarr_set_const($db, "NOTIFICATION_EMAIL_FROM", $_POST["email_from"], 'chaine', 0, '', $conf->entity); $result=dolibarr_set_const($db, "NOTIFICATION_EMAIL_FROM", $_POST["email_from"], 'chaine', 0, '', $conf->entity);
if ($result < 0) $error++; if ($result < 0) $error++;
if (! $error) if (! $error)
{ {
//var_dump($_POST);
foreach($_POST as $key => $val) foreach($_POST as $key => $val)
{ {
if (! preg_match('/^NOTIFICATION_FIXEDEMAIL_/',$key)) continue; if (! preg_match('/^NOTIF_(.*)_key$/', $key, $reg)) continue;
//print $key.' - '.$val.'<br>';
$result=dolibarr_set_const($db, $key, $val, 'chaine', 0, '', $conf->entity); $newval='';
$newkey='';
$shortkey=preg_replace('/_key$/','',$key);
//print $shortkey.'<br>';
if (preg_match('/^NOTIF_(.*)_old_(.*)_key/',$key,$reg))
{
dolibarr_del_const($db, 'NOTIFICATION_FIXEDEMAIL_'.$reg[1].'_THRESHOLD_HIGHER_'.$reg[2], $conf->entity);
$newkey='NOTIFICATION_FIXEDEMAIL_'.$reg[1].'_THRESHOLD_HIGHER_'.((int) GETPOST($shortkey.'_amount'));
$newval=GETPOST($shortkey.'_key');
//print $newkey.' - '.$newval.'<br>';
}
else if (preg_match('/^NOTIF_(.*)_new_key/',$key,$reg))
{
// Add a new entry
$newkey='NOTIFICATION_FIXEDEMAIL_'.$reg[1].'_THRESHOLD_HIGHER_'.((int) GETPOST($shortkey.'_amount'));
$newval=GETPOST($shortkey.'_key');
}
if ($newkey && $newval)
{
$result=dolibarr_set_const($db, $newkey, $newval, 'chaine', 0, '', $conf->entity);
}
} }
} }
if (! $error) if (! $error)
{ {
$db->commit();
setEventMessage($langs->trans("SetupSaved")); setEventMessage($langs->trans("SetupSaved"));
} }
else else
{ {
$db->rollback();
setEventMessage($langs->trans("Error"),'errors'); setEventMessage($langs->trans("Error"),'errors');
} }
} }
@ -78,6 +110,7 @@ if ($action == 'setvalue' && $user->admin)
*/ */
$form=new Form($db); $form=new Form($db);
$notify = new Notify($db);
llxHeader('',$langs->trans("NotificationSetup")); llxHeader('',$langs->trans("NotificationSetup"));
@ -107,7 +140,53 @@ print '</table>';
print '<br>'; print '<br>';
print_fiche_titre($langs->trans("ListOfAvailableNotifications"),'','');
if ($conf->societe->enabled)
{
print_fiche_titre($langs->trans("ListOfNotificationsPerContact"),'','');
print '<table class="noborder" width="100%">';
print '<tr class="liste_titre">';
print '<td>'.$langs->trans("Module").'</td>';
print '<td>'.$langs->trans("Code").'</td>';
print '<td>'.$langs->trans("Label").'</td>';
print '<td align="right">'.$langs->trans("NbOfTargetedContacts").'</td>';
print '<td>'.'</td>';
print "</tr>\n";
// Load array of available notifications
$notificationtrigger=new InterfaceNotification($db);
$listofnotifiedevents=$notificationtrigger->getListOfManagedEvents();
$var=true;
foreach($listofnotifiedevents as $notifiedevent)
{
$var=!$var;
$label=$langs->trans("Notify_".$notifiedevent['code']); //!=$langs->trans("Notify_".$notifiedevent['code'])?$langs->trans("Notify_".$notifiedevent['code']):$notifiedevent['label'];
if ($notifiedevent['elementtype'] == 'order_supplier') $elementLabel = $langs->trans('SupplierOrder');
elseif ($notifiedevent['elementtype'] == 'propal') $elementLabel = $langs->trans('Proposal');
elseif ($notifiedevent['elementtype'] == 'facture') $elementLabel = $langs->trans('Bill');
elseif ($notifiedevent['elementtype'] == 'commande') $elementLabel = $langs->trans('Order');
print '<tr '.$bc[$var].'>';
print '<td>'.$elementLabel.'</td>';
print '<td>'.$notifiedevent['code'].'</td>';
print '<td>'.$label.'</td>';
print '<td align="right">';
$nb = $notify->countDefinedNotifications($notifiedevent['code'], 0);
print $nb;
print '</td>';
print '</tr>';
}
print '</table>';
print '* '.$langs->trans("GoOntoContactCardToAddMore").'<br>';
print '<br>';
}
print_fiche_titre($langs->trans("ListOfFixedNotifications"),'','');
print '<table class="noborder" width="100%">'; print '<table class="noborder" width="100%">';
print '<tr class="liste_titre">'; print '<tr class="liste_titre">';
@ -115,12 +194,15 @@ print '<td>'.$langs->trans("Module").'</td>';
print '<td>'.$langs->trans("Code").'</td>'; print '<td>'.$langs->trans("Code").'</td>';
print '<td>'.$langs->trans("Label").'</td>'; print '<td>'.$langs->trans("Label").'</td>';
print '<td>'.$langs->trans("FixedEmailTarget").'</td>'; print '<td>'.$langs->trans("FixedEmailTarget").'</td>';
print '<td>'.$langs->trans("Threshold").'</td>';
print '<td>'.'</td>';
print "</tr>\n"; print "</tr>\n";
// Load array of available notifications // Load array of available notifications
$notificationtrigger=new InterfaceNotification($db); $notificationtrigger=new InterfaceNotification($db);
$listofnotifiedevents=$notificationtrigger->getListOfManagedEvents(); $listofnotifiedevents=$notificationtrigger->getListOfManagedEvents();
$var=true;
foreach($listofnotifiedevents as $notifiedevent) foreach($listofnotifiedevents as $notifiedevent)
{ {
$var=!$var; $var=!$var;
@ -136,18 +218,47 @@ foreach($listofnotifiedevents as $notifiedevent)
print '<td>'.$notifiedevent['code'].'</td>'; print '<td>'.$notifiedevent['code'].'</td>';
print '<td>'.$label.'</td>'; print '<td>'.$label.'</td>';
print '<td>'; print '<td>';
$param='NOTIFICATION_FIXEDEMAIL_'.$notifiedevent['code']; // Notification with threshold
$value=GETPOST($param)?GETPOST($param,'alpha'):$conf->global->$param; foreach($conf->global as $key => $val)
$s='<input type="text" size="32" name="'.$param.'" value="'.dol_escape_htmltag($value).'">'; // Do not use type="email" here, we must be able to enter a list of email with , separator. {
if ($val == '' || ! preg_match('/^NOTIFICATION_FIXEDEMAIL_'.$notifiedevent['code'].'_THRESHOLD_HIGHER_(.*)/', $key, $reg)) continue;
$param='NOTIFICATION_FIXEDEMAIL_'.$notifiedevent['code'].'_THRESHOLD_HIGHER_'.$reg[1];
$value=GETPOST('NOTIF_'.$notifiedevent['code'].'_old_'.$reg[1].'_key')?GETPOST('NOTIF_'.$notifiedevent['code'].'_old_'.$reg[1].'_key','alpha'):$conf->global->$param;
$s='<input type="text" size="32" name="NOTIF_'.$notifiedevent['code'].'_old_'.$reg[1].'_key" value="'.dol_escape_htmltag($value).'">'; // Do not use type="email" here, we must be able to enter a list of email with , separator.
$arrayemail=explode(',',$value); $arrayemail=explode(',',$value);
$showwarning=0; $showwarning=0;
foreach($arrayemail as $key=>$valuedet) foreach($arrayemail as $key=>$valuedet)
{ {
$valuedet=trim($valuedet); $valuedet=trim($valuedet);
if (! empty($valuedet) && ! isValidEmail($valuedet)) $showwarning++; if (! empty($valuedet) && ! isValidEmail($valuedet,1)) $showwarning++;
} }
if ((! empty($conf->global->$param)) && $showwarning) $s.=' '.img_warning($langs->trans("ErrorBadEMail")); if ((! empty($conf->global->$param)) && $showwarning) $s.=' '.img_warning($langs->trans("ErrorBadEMail"));
print $form->textwithpicto($s,$langs->trans("YouCanUseCommaSeparatorForSeveralRecipients")); print $form->textwithpicto($s,$langs->trans("YouCanUseCommaSeparatorForSeveralRecipients").'<br>'.$langs->trans("YouCanAlsoUseSupervisorKeyword"),1,'help','',0,2);
print '<br>';
}
// New entry input fields
$s='<input type="text" size="32" name="NOTIF_'.$notifiedevent['code'].'_new_key" value="">'; // Do not use type="email" here, we must be able to enter a list of email with , separator.
print $form->textwithpicto($s,$langs->trans("YouCanUseCommaSeparatorForSeveralRecipients"),1,'help','',0,2);
print '</td>';
print '<td>';
// Notification with threshold
foreach($conf->global as $key => $val)
{
if ($val == '' || ! preg_match('/^NOTIFICATION_FIXEDEMAIL_'.$notifiedevent['code'].'_THRESHOLD_HIGHER_(.*)/', $key, $reg)) continue;
print $langs->trans("AmountHT").' >= <input type="text" size="4" name="NOTIF_'.$notifiedevent['code'].'_old_'.$reg[1].'_amount" value="'.dol_escape_htmltag($reg[1]).'">';
print '<br>';
}
// New entry input fields
print $langs->trans("AmountHT").' >= <input type="text" size="4" name="NOTIF_'.$notifiedevent['code'].'_new_amount" value="">';
print '</td>';
print '<td>';
// TODO Add link to show message content
print '</td>'; print '</td>';
print '</tr>'; print '</tr>';
} }

View File

@ -643,6 +643,27 @@ print "</tr>\n";
print "<tr ".$bc[false].">\n <td width=\"140\">".$langs->trans("PathDirectory")."</td>\n <td>".$conf->propal->dir_output."</td>\n</tr>\n"; print "<tr ".$bc[false].">\n <td width=\"140\">".$langs->trans("PathDirectory")."</td>\n <td>".$conf->propal->dir_output."</td>\n</tr>\n";
print "</table>\n<br>"; print "</table>\n<br>";
$db->close();
/*
* Notifications
*/
print_titre($langs->trans("Notifications"));
print '<table class="noborder" width="100%">';
print '<tr class="liste_titre">';
print '<td>'.$langs->trans("Parameter").'</td>';
print '<td align="center" width="60"></td>';
print '<td width="80">&nbsp;</td>';
print "</tr>\n";
print '<tr '.$bc[$var].'><td colspan="2">';
print $langs->trans("YouMayFindNotificationsFeaturesIntoModuleNotification").'<br>';
print '</td><td align="right">';
print "</td></tr>\n";
print '</table>';
llxFooter(); llxFooter();
$db->close();

View File

@ -443,14 +443,16 @@ foreach ($dirmodels as $reldir)
} }
} }
print '</table><br/>'; print '</table><br>';
print '<br>';
/* /*
* Other options * Other options
*
*/ */
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_SUPPLIER_INVOICE_FREE_TEXT">';
print_titre($langs->trans("OtherOptions")); print_titre($langs->trans("OtherOptions"));
print '<table class="noborder" width="100%">'; print '<table class="noborder" width="100%">';
print '<tr class="liste_titre">'; print '<tr class="liste_titre">';
@ -459,16 +461,38 @@ print '<td align="center" width="60">'.$langs->trans("Value").'</td>';
print '<td width="80">&nbsp;</td>'; print '<td width="80">&nbsp;</td>';
print "</tr>\n"; print "</tr>\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_SUPPLIER_INVOICE_FREE_TEXT">';
print '<tr '.$bc[$var].'><td colspan="2">'; print '<tr '.$bc[$var].'><td colspan="2">';
print $langs->trans("FreeLegalTextOnInvoices").' ('.$langs->trans("AddCRIfTooLong").')<br>'; print $langs->trans("FreeLegalTextOnInvoices").' ('.$langs->trans("AddCRIfTooLong").')<br>';
print '<textarea name="SUPPLIER_INVOICE_FREE_TEXT" class="flat" cols="120">'.$conf->global->SUPPLIER_INVOICE_FREE_TEXT.'</textarea>'; print '<textarea name="SUPPLIER_INVOICE_FREE_TEXT" class="flat" cols="120">'.$conf->global->SUPPLIER_INVOICE_FREE_TEXT.'</textarea>';
print '</td><td align="right">'; print '</td><td align="right">';
print '<input type="submit" class="button" value="'.$langs->trans("Modify").'">'; print '<input type="submit" class="button" value="'.$langs->trans("Modify").'">';
print "</td></tr>\n"; print "</td></tr>\n";
print '</table><br>';
print '</form>'; print '</form>';
$db->close();
/*
* Notifications
*/
print_titre($langs->trans("Notifications"));
print '<table class="noborder" width="100%">';
print '<tr class="liste_titre">';
print '<td>'.$langs->trans("Parameter").'</td>';
print '<td align="center" width="60"></td>';
print '<td width="80">&nbsp;</td>';
print "</tr>\n";
print '<tr '.$bc[$var].'><td colspan="2">';
print $langs->trans("YouMayFindNotificationsFeaturesIntoModuleNotification").'<br>';
print '</td><td align="right">';
print "</td></tr>\n";
print '</table>';
llxFooter(); llxFooter();
$db->close();

View File

@ -439,14 +439,16 @@ foreach ($dirmodels as $reldir)
} }
} }
print '</table><br/>'; print '</table><br>';
print '<br>';
/* /*
* Other options * Other options
*
*/ */
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_SUPPLIER_ORDER_FREE_TEXT">';
print_titre($langs->trans("OtherOptions")); print_titre($langs->trans("OtherOptions"));
print '<table class="noborder" width="100%">'; print '<table class="noborder" width="100%">';
print '<tr class="liste_titre">'; print '<tr class="liste_titre">';
@ -455,16 +457,39 @@ print '<td align="center" width="60">'.$langs->trans("Value").'</td>';
print '<td width="80">&nbsp;</td>'; print '<td width="80">&nbsp;</td>';
print "</tr>\n"; print "</tr>\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_SUPPLIER_ORDER_FREE_TEXT">';
print '<tr '.$bc[$var].'><td colspan="2">'; print '<tr '.$bc[$var].'><td colspan="2">';
print $langs->trans("FreeLegalTextOnOrders").' ('.$langs->trans("AddCRIfTooLong").')<br>'; print $langs->trans("FreeLegalTextOnOrders").' ('.$langs->trans("AddCRIfTooLong").')<br>';
print '<textarea name="SUPPLIER_ORDER_FREE_TEXT" class="flat" cols="120">'.$conf->global->SUPPLIER_ORDER_FREE_TEXT.'</textarea>'; print '<textarea name="SUPPLIER_ORDER_FREE_TEXT" class="flat" cols="120">'.$conf->global->SUPPLIER_ORDER_FREE_TEXT.'</textarea>';
print '</td><td align="right">'; print '</td><td align="right">';
print '<input type="submit" class="button" value="'.$langs->trans("Modify").'">'; print '<input type="submit" class="button" value="'.$langs->trans("Modify").'">';
print "</td></tr>\n"; print "</td></tr>\n";
print '</table><br>';
print '</form>'; print '</form>';
$db->close();
/*
* Notifications
*/
print_titre($langs->trans("Notifications"));
print '<table class="noborder" width="100%">';
print '<tr class="liste_titre">';
print '<td>'.$langs->trans("Parameter").'</td>';
print '<td align="center" width="60"></td>';
print '<td width="80">&nbsp;</td>';
print "</tr>\n";
print '<tr '.$bc[$var].'><td colspan="2">';
print $langs->trans("YouMayFindNotificationsFeaturesIntoModuleNotification").'<br>';
print '</td><td align="right">';
print "</td></tr>\n";
print '</table>';
llxFooter(); llxFooter();
$db->close();

View File

@ -1337,7 +1337,7 @@ if ($action == 'create')
require_once DOL_DOCUMENT_ROOT . '/core/class/notify.class.php'; require_once DOL_DOCUMENT_ROOT . '/core/class/notify.class.php';
$notify = new Notify($db); $notify = new Notify($db);
$text .= '<br>'; $text .= '<br>';
$text .= $notify->confirmMessage('ASKPRICESUPPLIER_VALIDATE', $object->socid); $text .= $notify->confirmMessage('ASKPRICESUPPLIER_VALIDATE', $object->socid, $object);
} }
if (! $error) if (! $error)
@ -1346,9 +1346,9 @@ if ($action == 'create')
if (! $formconfirm) { if (! $formconfirm) {
$parameters = array('lineid' => $lineid); $parameters = array('lineid' => $lineid);
$formconfirm = $hookmanager->executeHooks('formConfirm', $parameters, $object, $action); // Note that $action and $object may have been modified $reshook = $hookmanager->executeHooks('formConfirm', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
// by if (empty($reshook)) $formconfirm.=$hookmanager->resPrint;
// hook elseif ($reshook > 0) $formconfirm=$hookmanager->resPrint;
} }
// Print form confirm // Print form confirm

View File

@ -185,7 +185,7 @@ class AskPriceSupplier extends CommonObject
$price = $prod->price; $price = $prod->price;
} }
$line = new AskPriceSupplierLigne($this->db); $line = new AskPriceSupplierLine($this->db);
$line->fk_product=$idproduct; $line->fk_product=$idproduct;
$line->desc=$productdesc; $line->desc=$productdesc;
@ -225,7 +225,7 @@ class AskPriceSupplier extends CommonObject
return -5; return -5;
} }
$askpricesupplierligne=new AskPriceSupplierLigne($this->db); $askpricesupplierligne=new AskPriceSupplierLine($this->db);
$askpricesupplierligne->fk_askpricesupplier=$this->id; $askpricesupplierligne->fk_askpricesupplier=$this->id;
$askpricesupplierligne->fk_remise_except=$remise->id; $askpricesupplierligne->fk_remise_except=$remise->id;
$askpricesupplierligne->desc=$remise->description; // Description ligne $askpricesupplierligne->desc=$remise->description; // Description ligne
@ -376,7 +376,7 @@ class AskPriceSupplier extends CommonObject
} }
// Insert line // Insert line
$this->line=new AskPriceSupplierLigne($this->db); $this->line=new AskPriceSupplierLine($this->db);
$this->line->fk_askpricesupplier=$this->id; $this->line->fk_askpricesupplier=$this->id;
$this->line->label=$label; $this->line->label=$label;
@ -525,10 +525,10 @@ class AskPriceSupplier extends CommonObject
} }
// Update line // Update line
$this->line=new AskPriceSupplierLigne($this->db); $this->line=new AskPriceSupplierLine($this->db);
// Stock previous line records // Stock previous line records
$staticline=new AskPriceSupplierLigne($this->db); $staticline=new AskPriceSupplierLine($this->db);
$staticline->fetch($rowid); $staticline->fetch($rowid);
$this->line->oldline = $staticline; $this->line->oldline = $staticline;
@ -621,7 +621,7 @@ class AskPriceSupplier extends CommonObject
{ {
if ($this->statut == 0) if ($this->statut == 0)
{ {
$line=new AskPriceSupplierLigne($this->db); $line=new AskPriceSupplierLine($this->db);
// For triggers // For triggers
$line->fetch($lineid); $line->fetch($lineid);
@ -1106,7 +1106,7 @@ class AskPriceSupplier extends CommonObject
{ {
$objp = $this->db->fetch_object($result); $objp = $this->db->fetch_object($result);
$line = new AskPriceSupplierLigne($this->db); $line = new AskPriceSupplierLine($this->db);
$line->rowid = $objp->rowid; $line->rowid = $objp->rowid;
$line->fk_askpricesupplier = $objp->fk_askpricesupplier; $line->fk_askpricesupplier = $objp->fk_askpricesupplier;
@ -2088,7 +2088,7 @@ class AskPriceSupplier extends CommonObject
$xnbp = 0; $xnbp = 0;
while ($xnbp < $nbp) while ($xnbp < $nbp)
{ {
$line=new AskPriceSupplierLigne($this->db); $line=new AskPriceSupplierLine($this->db);
$line->desc=$langs->trans("Description")." ".$xnbp; $line->desc=$langs->trans("Description")." ".$xnbp;
$line->qty=1; $line->qty=1;
$line->subprice=100; $line->subprice=100;
@ -2287,7 +2287,7 @@ class AskPriceSupplier extends CommonObject
{ {
$obj = $this->db->fetch_object($resql); $obj = $this->db->fetch_object($resql);
$this->lines[$i] = new AskPriceSupplierLigne($this->db); $this->lines[$i] = new AskPriceSupplierLine($this->db);
$this->lines[$i]->id = $obj->rowid; // for backward compatibility $this->lines[$i]->id = $obj->rowid; // for backward compatibility
$this->lines[$i]->rowid = $obj->rowid; $this->lines[$i]->rowid = $obj->rowid;
$this->lines[$i]->label = $obj->custom_label; $this->lines[$i]->label = $obj->custom_label;
@ -2412,10 +2412,10 @@ class AskPriceSupplier extends CommonObject
/** /**
* \class AskPriceSupplierLigne * \class AskPriceSupplierLine
* \brief Class to manage askpricesupplier lines * \brief Class to manage askpricesupplier lines
*/ */
class AskPriceSupplierLigne extends CommonObject class AskPriceSupplierLine extends CommonObject
{ {
var $db; var $db;
var $error; var $error;
@ -2689,7 +2689,7 @@ class AskPriceSupplierLigne extends CommonObject
$this->db->begin(); $this->db->begin();
$sql = "DELETE FROM ".MAIN_DB_PREFIX."askpricesupplierdet WHERE rowid = ".$this->rowid; $sql = "DELETE FROM ".MAIN_DB_PREFIX."askpricesupplierdet WHERE rowid = ".$this->rowid;
dol_syslog("AskPriceSupplierLigne::delete", LOG_DEBUG); dol_syslog("AskPriceSupplierLine::delete", LOG_DEBUG);
if ($this->db->query($sql) ) if ($this->db->query($sql) )
{ {
@ -2852,7 +2852,7 @@ class AskPriceSupplierLigne extends CommonObject
$sql.= ",total_ttc=".price2num($this->total_ttc,'MT').""; $sql.= ",total_ttc=".price2num($this->total_ttc,'MT')."";
$sql.= " WHERE rowid = ".$this->rowid; $sql.= " WHERE rowid = ".$this->rowid;
dol_syslog("AskPriceSupplierLigne::update_total", LOG_DEBUG); dol_syslog("AskPriceSupplierLine::update_total", LOG_DEBUG);
$resql=$this->db->query($sql); $resql=$this->db->query($sql);
if ($resql) if ($resql)

View File

@ -1671,7 +1671,7 @@ if ($action == 'create')
require_once DOL_DOCUMENT_ROOT . '/core/class/notify.class.php'; require_once DOL_DOCUMENT_ROOT . '/core/class/notify.class.php';
$notify = new Notify($db); $notify = new Notify($db);
$text .= '<br>'; $text .= '<br>';
$text .= $notify->confirmMessage('PROPAL_VALIDATE', $object->socid); $text .= $notify->confirmMessage('PROPAL_VALIDATE', $object->socid, $object);
} }
if (! $error) if (! $error)
@ -1680,9 +1680,9 @@ if ($action == 'create')
if (! $formconfirm) { if (! $formconfirm) {
$parameters = array('lineid' => $lineid); $parameters = array('lineid' => $lineid);
$formconfirm = $hookmanager->executeHooks('formConfirm', $parameters, $object, $action); // Note that $action and $object may have been modified $reshook = $hookmanager->executeHooks('formConfirm', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
// by if (empty($reshook)) $formconfirm.=$hookmanager->resPrint;
// hook elseif ($reshook > 0) $formconfirm=$hookmanager->resPrint;
} }
// Print form confirm // Print form confirm

View File

@ -399,7 +399,8 @@ if ($resql)
print "</td></tr>\n"; print "</td></tr>\n";
$parameters=array(); $parameters=array();
$formconfirm=$hookmanager->executeHooks('printFieldListOption',$parameters); // Note that $action and $object may have been modified by hook $reshook=$hookmanager->executeHooks('printFieldListSearch',$parameters); // Note that $action and $object may have been modified by hook
print $hookmanager->resPrint;
print "</tr>\n"; print "</tr>\n";

View File

@ -1600,7 +1600,7 @@ if ($action == 'create' && $user->rights->commande->creer)
require_once DOL_DOCUMENT_ROOT . '/core/class/notify.class.php'; require_once DOL_DOCUMENT_ROOT . '/core/class/notify.class.php';
$notify = new Notify($db); $notify = new Notify($db);
$text .= '<br>'; $text .= '<br>';
$text .= $notify->confirmMessage('ORDER_VALIDATE', $object->socid); $text .= $notify->confirmMessage('ORDER_VALIDATE', $object->socid, $object);
} }
$qualified_for_stock_change=0; $qualified_for_stock_change=0;
@ -1726,8 +1726,9 @@ if ($action == 'create' && $user->rights->commande->creer)
if (! $formconfirm) { if (! $formconfirm) {
$parameters = array('lineid' => $lineid); $parameters = array('lineid' => $lineid);
$formconfirm = $hookmanager->executeHooks('formConfirm', $parameters, $object, $action); // Note that $action and $object may have been modified $reshook = $hookmanager->executeHooks('formConfirm', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
// by hook if (empty($reshook)) $formconfirm.=$hookmanager->resPrint;
elseif ($reshook > 0) $formconfirm=$hookmanager->resPrint;
} }
// Print form confirm // Print form confirm
@ -2044,7 +2045,7 @@ if ($action == 'create' && $user->rights->commande->creer)
// Total HT // Total HT
print '<tr><td>' . $langs->trans('AmountHT') . '</td>'; print '<tr><td>' . $langs->trans('AmountHT') . '</td>';
print '<td align="right">' . price($object->total_ht, 1, '', 1, - 1, - 1, $conf->currency) . '</td>'; print '<td>' . price($object->total_ht, 1, '', 1, - 1, - 1, $conf->currency) . '</td>';
// Margin Infos // Margin Infos
if (! empty($conf->margin->enabled)) { if (! empty($conf->margin->enabled)) {
@ -2056,23 +2057,23 @@ if ($action == 'create' && $user->rights->commande->creer)
print '</tr>'; print '</tr>';
// Total TVA // Total VAT
print '<tr><td>' . $langs->trans('AmountVAT') . '</td><td align="right">' . price($object->total_tva, 1, '', 1, - 1, - 1, $conf->currency) . '</td></tr>'; print '<tr><td>' . $langs->trans('AmountVAT') . '</td><td>' . price($object->total_tva, 1, '', 1, - 1, - 1, $conf->currency) . '</td></tr>';
// Amount Local Taxes // Amount Local Taxes
if ($mysoc->localtax1_assuj == "1" || $object->total_localtax1 != 0) // Localtax1 if ($mysoc->localtax1_assuj == "1" || $object->total_localtax1 != 0) // Localtax1
{ {
print '<tr><td>' . $langs->transcountry("AmountLT1", $mysoc->country_code) . '</td>'; print '<tr><td>' . $langs->transcountry("AmountLT1", $mysoc->country_code) . '</td>';
print '<td align="right">' . price($object->total_localtax1, 1, '', 1, - 1, - 1, $conf->currency) . '</td></tr>'; print '<td>' . price($object->total_localtax1, 1, '', 1, - 1, - 1, $conf->currency) . '</td></tr>';
} }
if ($mysoc->localtax2_assuj == "1" || $object->total_localtax2 != 0) // Localtax2 IRPF if ($mysoc->localtax2_assuj == "1" || $object->total_localtax2 != 0) // Localtax2 IRPF
{ {
print '<tr><td>' . $langs->transcountry("AmountLT2", $mysoc->country_code) . '</td>'; print '<tr><td>' . $langs->transcountry("AmountLT2", $mysoc->country_code) . '</td>';
print '<td align="right">' . price($object->total_localtax2, 1, '', 1, - 1, - 1, $conf->currency) . '</td></tr>'; print '<td>' . price($object->total_localtax2, 1, '', 1, - 1, - 1, $conf->currency) . '</td></tr>';
} }
// Total TTC // Total TTC
print '<tr><td>' . $langs->trans('AmountTTC') . '</td><td align="right">' . price($object->total_ttc, 1, '', 1, - 1, - 1, $conf->currency) . '</td></tr>'; print '<tr><td>' . $langs->trans('AmountTTC') . '</td><td>' . price($object->total_ttc, 1, '', 1, - 1, - 1, $conf->currency) . '</td></tr>';
// Statut // Statut
print '<tr><td>' . $langs->trans('Status') . '</td><td>' . $object->getLibStatut(4) . '</td></tr>'; print '<tr><td>' . $langs->trans('Status') . '</td><td>' . $object->getLibStatut(4) . '</td></tr>';

View File

@ -111,6 +111,11 @@ class Commande extends CommonOrder
var $location_incoterms; var $location_incoterms;
var $libelle_incoterms; //Used into tooltip var $libelle_incoterms; //Used into tooltip
// Pour board
var $nbtodo;
var $nbtodolate;
/** /**
* ERR Not engouch stock * ERR Not engouch stock
*/ */
@ -638,7 +643,7 @@ class Commande extends CommonOrder
$error=0; $error=0;
// Clean parameters // Clean parameters
$this->brouillon = 1; // On positionne en mode brouillon la commande $this->brouillon = 1; // set command as draft
dol_syslog(get_class($this)."::create user=".$user->id); dol_syslog(get_class($this)."::create user=".$user->id);
@ -722,7 +727,7 @@ class Commande extends CommonOrder
$num=count($this->lines); $num=count($this->lines);
/* /*
* Insertion du detail des produits dans la base * Insert products details into db
*/ */
for ($i=0;$i<$num;$i++) for ($i=0;$i<$num;$i++)
{ {
@ -771,13 +776,16 @@ class Commande extends CommonOrder
} }
} }
// Mise a jour ref // update ref
$sql = 'UPDATE '.MAIN_DB_PREFIX."commande SET ref='(PROV".$this->id.")' WHERE rowid=".$this->id; $initialref='(PROV'.$this->id.')';
if (! empty($this->ref)) $initialref=$this->ref;
$sql = 'UPDATE '.MAIN_DB_PREFIX."commande SET ref='".$this->db->escape($initialref)."' WHERE rowid=".$this->id;
if ($this->db->query($sql)) if ($this->db->query($sql))
{ {
if ($this->id) if ($this->id)
{ {
$this->ref="(PROV".$this->id.")"; $this->ref = $initialref;
// Add object linked // Add object linked
if (is_array($this->linked_objects) && ! empty($this->linked_objects)) if (is_array($this->linked_objects) && ! empty($this->linked_objects))

View File

@ -39,12 +39,12 @@ class Account extends CommonObject
public $table_element='bank_account'; public $table_element='bank_account';
/** /**
* //TODO: Discuss this. $rowid is preferred over $id * @var int Use id instead of rowid
* @var
* @deprecated * @deprecated
*/ */
var $rowid; var $rowid;
var $id; var $id;
var $ref; var $ref;
var $label; var $label;
//! 1=Compte courant/check/carte, 2=Compte liquide, 0=Compte épargne //! 1=Compte courant/check/carte, 2=Compte liquide, 0=Compte épargne

View File

@ -2587,7 +2587,7 @@ if ($action == 'create')
require_once DOL_DOCUMENT_ROOT . '/core/class/notify.class.php'; require_once DOL_DOCUMENT_ROOT . '/core/class/notify.class.php';
$notify = new Notify($db); $notify = new Notify($db);
$text .= '<br>'; $text .= '<br>';
$text .= $notify->confirmMessage('BILL_VALIDATE', $object->socid); $text .= $notify->confirmMessage('BILL_VALIDATE', $object->socid, $object);
} }
$formquestion = array(); $formquestion = array();
@ -2749,8 +2749,9 @@ if ($action == 'create')
if (! $formconfirm) { if (! $formconfirm) {
$parameters = array('lineid' => $lineid); $parameters = array('lineid' => $lineid);
$formconfirm = $hookmanager->executeHooks('formConfirm', $parameters, $object, $action); // Note that $action and $object may have been modified by $reshook = $hookmanager->executeHooks('formConfirm', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
// hook if (empty($reshook)) $formconfirm.=$hookmanager->resPrint;
elseif ($reshook > 0) $formconfirm=$hookmanager->resPrint;
} }
// Print form confirm // Print form confirm

View File

@ -89,23 +89,7 @@ class Contrat extends CommonObject
var $product; var $product;
/** /**
* TODO: Which is the correct one? * @var int Id of user author of the contract
* Author of the contract
* @var
*/
var $user_author;
/**
* TODO: Which is the correct one?
* Author of the contract
* @var User
*/
public $user_creation;
/**
* TODO: Which is the correct one?
* Author of the contract
* @var int
*/ */
public $fk_user_author; public $fk_user_author;
@ -117,38 +101,37 @@ class Contrat extends CommonObject
public $user_author_id; public $user_author_id;
/** /**
* @var User * @var User Object user that create the contract. Set by the info method.
*/
public $user_creation;
/**
* @var User Object user that close the contract. Set by the info method.
*/ */
public $user_cloture; public $user_cloture;
/** /**
* Date of creation * @var int Date of creation
* @var int
*/ */
var $date_creation; var $date_creation;
/** /**
* Date of last modification * @var int Date of last modification. Not filled until you call ->info()
* Not filled until you call ->info()
* @var int
*/ */
public $date_modification; public $date_modification;
/** /**
* Date of validation * @var int Date of validation
* @var int
*/ */
var $date_validation; var $date_validation;
/** /**
* Date when contract was signed * @var int Date when contract was signed
* @var int
*/ */
var $date_contrat; var $date_contrat;
/** /**
* Date of contract closure * @var int Date of contract closure
* @var int
* @deprecated we close contract lines, not a contract * @deprecated we close contract lines, not a contract
*/ */
var $date_cloture; var $date_cloture;
@ -157,21 +140,15 @@ class Contrat extends CommonObject
var $commercial_suivi_id; var $commercial_suivi_id;
/** /**
* @deprecated Use note_private or note_public instead * @var string Private note
*/
var $note;
/**
* Private note
* @var string
*/ */
var $note_private; var $note_private;
/** /**
* Public note * @var string Public note
* @var string
*/ */
var $note_public; var $note_public;
var $modelpdf; var $modelpdf;
/** /**
@ -184,8 +161,7 @@ class Contrat extends CommonObject
var $extraparams=array(); var $extraparams=array();
/** /**
* Contract lines * @var ContratLigne[] Contract lines
* @var ContratLigne[]
*/ */
var $lines=array(); var $lines=array();
@ -569,7 +545,6 @@ class Contrat extends CommonObject
$this->commercial_signature_id = $result["fk_commercial_signature"]; $this->commercial_signature_id = $result["fk_commercial_signature"];
$this->commercial_suivi_id = $result["fk_commercial_suivi"]; $this->commercial_suivi_id = $result["fk_commercial_suivi"];
$this->note = $result["note_private"]; // deprecated
$this->note_private = $result["note_private"]; $this->note_private = $result["note_private"];
$this->note_public = $result["note_public"]; $this->note_public = $result["note_public"];
$this->modelpdf = $result["model_pdf"]; $this->modelpdf = $result["model_pdf"];

View File

@ -342,7 +342,8 @@ class box_activity extends ModeleBoxes
} }
// list the summary of the propals // list the summary of the propals
if (! empty($conf->propal->enabled) && $user->rights->propal->lire) { if (! empty($conf->propal->enabled) && $user->rights->propal->lire)
{
include_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php'; include_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php';
$propalstatic=new Propal($db); $propalstatic=new Propal($db);
@ -350,7 +351,8 @@ class box_activity extends ModeleBoxes
$filename = '/boxactivity-propal'.$fileid; $filename = '/boxactivity-propal'.$fileid;
$refresh = dol_cache_refresh($cachedir, $filename, $cachetime); $refresh = dol_cache_refresh($cachedir, $filename, $cachetime);
$data = array(); $data = array();
if ($refresh) { if ($refresh)
{
$sql = "SELECT p.fk_statut, SUM(p.total) as Mnttot, COUNT(*) as nb"; $sql = "SELECT p.fk_statut, SUM(p.total) as Mnttot, COUNT(*) as nb";
$sql.= " FROM (".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."propal as p"; $sql.= " FROM (".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."propal as p";
if (!$user->rights->societe->client->voir && !$user->societe_id) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; if (!$user->rights->societe->client->voir && !$user->societe_id) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
@ -365,8 +367,8 @@ class box_activity extends ModeleBoxes
$sql.= " ORDER BY p.fk_statut DESC"; $sql.= " ORDER BY p.fk_statut DESC";
$result = $db->query($sql); $result = $db->query($sql);
if ($result)
if ($result) { {
$num = $db->num_rows($result) + $line; $num = $db->num_rows($result) + $line;
$j=0; $j=0;
while ($j < $num) { while ($j < $num) {
@ -380,12 +382,17 @@ class box_activity extends ModeleBoxes
} else { } else {
dol_print_error($db); dol_print_error($db);
} }
} else { }
else
{
$data = dol_readcachefile($cachedir, $filename); $data = dol_readcachefile($cachedir, $filename);
} }
if (! empty($data)) {
if (! empty($data))
{
$j=0; $j=0;
while ($line < count($data)) { while ($line < count($data))
{
$this->info_box_contents[$line][] = array( $this->info_box_contents[$line][] = array(
'td' => 'align="left" width="16"', 'td' => 'align="left" width="16"',
'url' => DOL_URL_ROOT."/comm/propal/list.php?mainmenu=commercial&amp;leftmenu=propals&amp;viewstatut=".$data[$j]->fk_statut, 'url' => DOL_URL_ROOT."/comm/propal/list.php?mainmenu=commercial&amp;leftmenu=propals&amp;viewstatut=".$data[$j]->fk_statut,
@ -393,7 +400,6 @@ class box_activity extends ModeleBoxes
'logo' => 'object_propal' 'logo' => 'object_propal'
); );
$objp = $db->fetch_object($result);
$this->info_box_contents[$line][] = array( $this->info_box_contents[$line][] = array(
'td' => 'align="left"', 'td' => 'align="left"',
'text' => $langs->trans("Proposals")."&nbsp;".$propalstatic->LibStatut($data[$j]->fk_statut,0), 'text' => $langs->trans("Proposals")."&nbsp;".$propalstatic->LibStatut($data[$j]->fk_statut,0),

View File

@ -85,8 +85,8 @@ class CMailFile
* CMailFile * CMailFile
* *
* @param string $subject Topic/Subject of mail * @param string $subject Topic/Subject of mail
* @param string $to Recipients emails (RFC 2822: "Nom firstname <email>[, ...]" ou "email[, ...]" ou "<email>[, ...]") * @param string $to Recipients emails (RFC 2822: "Name firstname <email>[, ...]" or "email[, ...]" or "<email>[, ...]"). Note: the keyword '__SUPERVISOREMAIL__' is not allowed here and must be replaced by caller.
* @param string $from Sender email (RFC 2822: "Nom firstname <email>[, ...]" ou "email[, ...]" ou "<email>[, ...]") * @param string $from Sender email (RFC 2822: "Name firstname <email>[, ...]" or "email[, ...]" or "<email>[, ...]")
* @param string $msg Message * @param string $msg Message
* @param array $filename_list List of files to attach (full path of filename on file system) * @param array $filename_list List of files to attach (full path of filename on file system)
* @param array $mimetype_list List of MIME type of attached files * @param array $mimetype_list List of MIME type of attached files
@ -98,9 +98,7 @@ class CMailFile
* @param string $errors_to Email errors * @param string $errors_to Email errors
* @param string $css Css option * @param string $css Css option
*/ */
function __construct($subject,$to,$from,$msg, function __construct($subject,$to,$from,$msg,$filename_list=array(),$mimetype_list=array(),$mimefilename_list=array(),$addr_cc="",$addr_bcc="",$deliveryreceipt=0,$msgishtml=0,$errors_to='',$css='')
$filename_list=array(),$mimetype_list=array(),$mimefilename_list=array(),
$addr_cc="",$addr_bcc="",$deliveryreceipt=0,$msgishtml=0,$errors_to='',$css='')
{ {
global $conf; global $conf;
@ -1023,9 +1021,9 @@ class CMailFile
} }
/** /**
* Return an address for SMTP protocol * Return a formatted address string for SMTP protocol
* *
* @param string $address Example: 'John Doe <john@doe.com>' or 'john@doe.com' * @param string $address Example: 'John Doe <john@doe.com>, Alan Smith <alan@smith.com>' or 'john@doe.com, alan@smith.com'
* @param int $format 0=auto, 1=emails with <>, 2=emails without <>, 3=auto + label between " * @param int $format 0=auto, 1=emails with <>, 2=emails without <>, 3=auto + label between "
* @param int $encode 1=Encode name to RFC2822 * @param int $encode 1=Encode name to RFC2822
* @return string If format 0: '<john@doe.com>' or 'John Doe <john@doe.com>' or '=?UTF-8?B?Sm9obiBEb2U=?= <john@doe.com>' * @return string If format 0: '<john@doe.com>' or 'John Doe <john@doe.com>' or '=?UTF-8?B?Sm9obiBEb2U=?= <john@doe.com>'

View File

@ -35,46 +35,69 @@
*/ */
abstract class CommonObject abstract class CommonObject
{ {
/**
* @var DoliDb Database handler (result of a new DoliDB)
*/
public $db; public $db;
/** /**
* @var error Error string * @var string Error string
* @deprecated Use instead the array of error strings * @deprecated Use instead the array of error strings
*/ */
public $error; public $error;
/** /**
* @var errors Aray of error string * @var string[] Array of error strings
*/ */
public $errors; public $errors;
public $canvas; // Contains canvas name if it is /**
public $context=array(); // Use to pass context information * @var string Can be used to pass information when only object is provied to method
*/
public $context=array();
/**
* @var string Contains canvas name if record is an alternative canvas record
*/
public $canvas;
/**
* @var string Key value used to track if data is coming from import wizard
*/
public $import_key;
/**
* @var mixed Contains data to manage extrafields
*/
public $array_options=array();
/**
* @var int[] Array of linked objects ids. Loaded by ->fetchObjectLinked
*/
public $linkedObjectsIds;
/**
* @var mixed Array of linked objects. Loaded by ->fetchObjectLinked
*/
public $linkedObjects;
/**
* @var string Column name of the ref field.
*/
protected $table_ref_field = '';
// Following var are used by some objects only. We keep this property here in CommonObject to be able to provide common method using them.
public $name; public $name;
public $lastname; public $lastname;
public $firstname; public $firstname;
public $civility_id; public $civility_id;
public $import_key;
public $array_options=array();
/**
* @var Societe
*/
public $thirdparty; public $thirdparty;
public $linkedObjectsIds; // Loaded by ->fetchObjectLinked
public $linkedObjects; // Loaded by ->fetchObjectLinked
// No constructor as it is an abstract class // No constructor as it is an abstract class
/**
* Column name of the ref field.
* @var string
*/
protected $table_ref_field = '';
/** /**
* Check an object id/ref exists * Check an object id/ref exists

View File

@ -65,7 +65,7 @@ class DolGraph
var $bgcolorgrid=array(255,255,255); // array(R,G,B) var $bgcolorgrid=array(255,255,255); // array(R,G,B)
var $datacolor; // array(array(R,G,B),...) var $datacolor; // array(array(R,G,B),...)
protected $stringtoshow; // To store string to output graph into HTML page private $_stringtoshow; // To store string to output graph into HTML page
/** /**

View File

@ -530,7 +530,7 @@ class ExtraFields
$sql.= " ".($perms?"'".$this->db->escape($perms)."'":"null").","; $sql.= " ".($perms?"'".$this->db->escape($perms)."'":"null").",";
$sql.= " '".$pos."',"; $sql.= " '".$pos."',";
$sql.= " '".$alwayseditable."',"; $sql.= " '".$alwayseditable."',";
$sql.= " '".$param."'"; $sql.= " '".$param."',";
$sql.= " ".$list; $sql.= " ".$list;
$sql.= ")"; $sql.= ")";
dol_syslog(get_class($this)."::update_label", LOG_DEBUG); dol_syslog(get_class($this)."::update_label", LOG_DEBUG);

View File

@ -26,7 +26,7 @@ require_once DOL_DOCUMENT_ROOT .'/core/class/commonobject.class.php';
/** /**
* Class to manage fiscal year * Class to manage fiscal year
*/ */
class Fiscalyear class Fiscalyear extends CommonObject
{ {
public $element='fiscalyear'; public $element='fiscalyear';
public $table_element='accounting_fiscalyear'; public $table_element='accounting_fiscalyear';

View File

@ -395,12 +395,13 @@ class Form
$htmltext=str_replace("\n","",$htmltext); $htmltext=str_replace("\n","",$htmltext);
$htmltext=str_replace('"',"&quot;",$htmltext); $htmltext=str_replace('"',"&quot;",$htmltext);
if ($tooltipon == 2 || $tooltipon == 3) $paramfortooltipimg=' class="classfortooltip'.($extracss?' '.$extracss:'').'" title="'.($noencodehtmltext?$htmltext:dol_escape_htmltag($htmltext,1)).'"'; // Attribut to put on td img tag to store tooltip if ($tooltipon == 2 || $tooltipon == 3) $paramfortooltipimg=' class="classfortooltip inline-block'.($extracss?' '.$extracss:'').'" title="'.($noencodehtmltext?$htmltext:dol_escape_htmltag($htmltext,1)).'"'; // Attribut to put on td img tag to store tooltip
else $paramfortooltipimg =($extracss?' class="'.$extracss.'"':''); // Attribut to put on td text tag else $paramfortooltipimg =($extracss?' class="'.$extracss.'"':''); // Attribut to put on td text tag
if ($tooltipon == 1 || $tooltipon == 3) $paramfortooltiptd=' class="classfortooltip'.($extracss?' '.$extracss:'').'" title="'.($noencodehtmltext?$htmltext:dol_escape_htmltag($htmltext,1)).'"'; // Attribut to put on td tag to store tooltip if ($tooltipon == 1 || $tooltipon == 3) $paramfortooltiptd=' class="classfortooltip inline-block'.($extracss?' '.$extracss:'').'" title="'.($noencodehtmltext?$htmltext:dol_escape_htmltag($htmltext,1)).'"'; // Attribut to put on td tag to store tooltip
else $paramfortooltiptd =($extracss?' class="'.$extracss.'"':''); // Attribut to put on td text tag else $paramfortooltiptd =($extracss?' class="'.$extracss.'"':''); // Attribut to put on td text tag
$s=""; $s="";
if (empty($notabs)) $s.='<table class="nobordernopadding" summary=""><tr>'; if (empty($notabs)) $s.='<table class="nobordernopadding" summary=""><tr>';
elseif ($notabs == 2) $s.='<div class="inline-block nowrap">';
if ($direction < 0) { if ($direction < 0) {
$s.='<'.$tag.$paramfortooltipimg; $s.='<'.$tag.$paramfortooltipimg;
if ($tag == 'td') { if ($tag == 'td') {
@ -411,8 +412,8 @@ class Form
// Use another method to help avoid having a space in value in order to use this value with jquery // Use another method to help avoid having a space in value in order to use this value with jquery
// TODO add this in css // TODO add this in css
//if ($text != '') $s.='<'.$tag.$paramfortooltiptd.'>'.(($direction < 0)?'&nbsp;':'').$text.(($direction > 0)?'&nbsp;':'').'</'.$tag.'>'; //if ($text != '') $s.='<'.$tag.$paramfortooltiptd.'>'.(($direction < 0)?'&nbsp;':'').$text.(($direction > 0)?'&nbsp;':'').'</'.$tag.'>';
$paramfortooltiptd.= (($direction < 0)?' style="padding-left: 3px !important;"':''); $paramfortooltiptd.= (($direction < 0)?' class="inline-block" style="padding-left: 3px !important;"':'');
$paramfortooltiptd.= (($direction > 0)?' style="padding-right: 3px !important;"':''); $paramfortooltiptd.= (($direction > 0)?' class="inline-block" style="padding-right: 3px !important;"':'');
if ((string) $text != '') $s.='<'.$tag.$paramfortooltiptd.'>'.$text.'</'.$tag.'>'; if ((string) $text != '') $s.='<'.$tag.$paramfortooltiptd.'>'.$text.'</'.$tag.'>';
if ($direction > 0) { if ($direction > 0) {
$s.='<'.$tag.$paramfortooltipimg; $s.='<'.$tag.$paramfortooltipimg;
@ -422,6 +423,7 @@ class Form
$s.= '>'.$img.'</'.$tag.'>'; $s.= '>'.$img.'</'.$tag.'>';
} }
if (empty($notabs)) $s.='</tr></table>'; if (empty($notabs)) $s.='</tr></table>';
elseif ($notabs == 2) $s.='</div>';
return $s; return $s;
} }
@ -4445,7 +4447,7 @@ class Form
} }
else else
{ {
$selected=($useempty?'':' selected="selected"'); $selected=(($useempty && $value != '0' && $value != 'no')?'':' selected="selected"');
$resultyesno .= '<option value="'.$yes.'">'.$langs->trans("Yes").'</option>'."\n"; $resultyesno .= '<option value="'.$yes.'">'.$langs->trans("Yes").'</option>'."\n";
$resultyesno .= '<option value="'.$no.'"'.$selected.'>'.$langs->trans("No").'</option>'."\n"; $resultyesno .= '<option value="'.$no.'"'.$selected.'>'.$langs->trans("No").'</option>'."\n";
} }

View File

@ -550,7 +550,11 @@ class FormFile
// Execute hooks // Execute hooks
$parameters=array('socid'=>(isset($GLOBALS['socid'])?$GLOBALS['socid']:''),'id'=>(isset($GLOBALS['id'])?$GLOBALS['id']:''),'modulepart'=>$modulepart); $parameters=array('socid'=>(isset($GLOBALS['socid'])?$GLOBALS['socid']:''),'id'=>(isset($GLOBALS['id'])?$GLOBALS['id']:''),'modulepart'=>$modulepart);
if (is_object($hookmanager)) $out.= $hookmanager->executeHooks('formBuilddocOptions',$parameters,$GLOBALS['object']); if (is_object($hookmanager))
{
$reshook = $hookmanager->executeHooks('formBuilddocOptions',$parameters,$GLOBALS['object']);
$out.= $hookmanager->resPrint;
}
} }
// Get list of files // Get list of files

View File

@ -2,7 +2,7 @@
/* Copyright (C) 2004 Rodolphe Quiedeville <rodolphe@quiedeville.org> /* Copyright (C) 2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004 Benoit Mortier <benoit.mortier@opensides.be> * Copyright (C) 2004 Benoit Mortier <benoit.mortier@opensides.be>
* Copyright (C) 2005-2011 Regis Houssin <regis.houssin@capnetworks.com> * Copyright (C) 2005-2011 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2006-2011 Laurent Destailleur <eldy@users.sourceforge.net> * Copyright (C) 2006-2015 Laurent Destailleur <eldy@users.sourceforge.net>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
@ -25,11 +25,12 @@
*/ */
/** /**
* \class Ldap * Class to manage LDAP features
* \brief Class to manage LDAP features
*/ */
class Ldap class Ldap
{ {
var $error;
/** /**
* Tableau des serveurs (IP addresses ou nom d'hotes) * Tableau des serveurs (IP addresses ou nom d'hotes)
*/ */
@ -414,9 +415,10 @@ class Ldap
} }
else else
{ {
$this->error=@ldap_error($this->connection); $this->ldapErrorCode = @ldap_errno($this->connection);
$this->errno=@ldap_errno($this->connection); $this->ldapErrorText = @ldap_error($this->connection);
dol_syslog(get_class($this)."::add failed: ".$this->errno." ".$this->error, LOG_ERR); $this->error=$this->ldapErrorCode." ".$this->ldapErrorText;
dol_syslog(get_class($this)."::add failed: ".$this->error, LOG_ERR);
return -1; return -1;
} }
} }

View File

@ -61,14 +61,15 @@ class Notify
* *
* @param string $action Id of action in llx_c_action_trigger * @param string $action Id of action in llx_c_action_trigger
* @param int $socid Id of third party * @param int $socid Id of third party
* @param Object $object Object the notification is about
* @return string Message * @return string Message
*/ */
function confirmMessage($action,$socid) function confirmMessage($action,$socid,$object)
{ {
global $langs; global $langs;
$langs->load("mails"); $langs->load("mails");
$nb=$this->countDefinedNotifications($action,$socid); $nb=$this->countDefinedNotifications($action,$socid,$object);
if ($nb <= 0) $texte=img_object($langs->trans("Notifications"),'email').' '.$langs->trans("NoNotificationsWillBeSent"); if ($nb <= 0) $texte=img_object($langs->trans("Notifications"),'email').' '.$langs->trans("NoNotificationsWillBeSent");
if ($nb == 1) $texte=img_object($langs->trans("Notifications"),'email').' '.$langs->trans("ANotificationsWillBeSent"); if ($nb == 1) $texte=img_object($langs->trans("Notifications"),'email').' '.$langs->trans("ANotificationsWillBeSent");
if ($nb >= 2) $texte=img_object($langs->trans("Notifications"),'email').' '.$langs->trans("SomeNotificationsWillBeSent",$nb); if ($nb >= 2) $texte=img_object($langs->trans("Notifications"),'email').' '.$langs->trans("SomeNotificationsWillBeSent",$nb);
@ -76,22 +77,25 @@ class Notify
} }
/** /**
* Return number of notifications activated for action code and third party * Return number of notifications activated for action code (and third party)
* *
* @param string $action Code of action in llx_c_action_trigger (new usage) or Id of action in llx_c_action_trigger (old usage) * @param string $notifcode Code of action in llx_c_action_trigger (new usage) or Id of action in llx_c_action_trigger (old usage)
* @param int $socid Id of third party * @param int $socid Id of third party or 0 for all thirdparties
* @param Object $object Object the notification is about
* @return int <0 if KO, nb of notifications sent if OK * @return int <0 if KO, nb of notifications sent if OK
*/ */
function countDefinedNotifications($action,$socid) function countDefinedNotifications($notifcode,$socid,$object=null)
{ {
global $conf; global $conf;
$error=0; $error=0;
$num=0; $num=0;
$valueforthreshold = $object->total_ht;
if (! $error) if (! $error)
{ {
$sql = "SELECT n.rowid"; $sql = "SELECT COUNT(n.rowid) as nb";
$sql.= " FROM ".MAIN_DB_PREFIX."notify_def as n,"; $sql.= " FROM ".MAIN_DB_PREFIX."notify_def as n,";
$sql.= " ".MAIN_DB_PREFIX."socpeople as c,"; $sql.= " ".MAIN_DB_PREFIX."socpeople as c,";
$sql.= " ".MAIN_DB_PREFIX."c_action_trigger as a,"; $sql.= " ".MAIN_DB_PREFIX."c_action_trigger as a,";
@ -99,22 +103,23 @@ class Notify
$sql.= " WHERE n.fk_contact = c.rowid"; $sql.= " WHERE n.fk_contact = c.rowid";
$sql.= " AND a.rowid = n.fk_action"; $sql.= " AND a.rowid = n.fk_action";
$sql.= " AND n.fk_soc = s.rowid"; $sql.= " AND n.fk_soc = s.rowid";
if (is_numeric($action)) $sql.= " AND n.fk_action = ".$action; // Old usage if (is_numeric($notifcode)) $sql.= " AND n.fk_action = ".$notifcode; // Old usage
else $sql.= " AND a.code = '".$action."'"; // New usage else $sql.= " AND a.code = '".$notifcode."'"; // New usage
$sql.= " AND s.entity IN (".getEntity('societe', 1).")"; $sql.= " AND s.entity IN (".getEntity('societe', 1).")";
$sql.= " AND s.rowid = ".$socid; if ($socid > 0) $sql.= " AND s.rowid = ".$socid;
dol_syslog(get_class($this)."::countDefinedNotifications ".$action.", ".$socid."", LOG_DEBUG); dol_syslog(get_class($this)."::countDefinedNotifications ".$notifcode.", ".$socid."", LOG_DEBUG);
$resql = $this->db->query($sql); $resql = $this->db->query($sql);
if ($resql) if ($resql)
{ {
$num = $this->db->num_rows($resql); $obj = $this->db->fetch_object($resql);
if ($obj) $num = $obj->nb;
} }
else else
{ {
$error++; $error++;
$this->error=$this->db->error.' sql='.$sql; $this->error=$this->db->lasterror();
} }
} }
@ -123,12 +128,19 @@ class Notify
// List of notifications enabled for fixed email // List of notifications enabled for fixed email
foreach($conf->global as $key => $val) foreach($conf->global as $key => $val)
{ {
if (! preg_match('/^NOTIFICATION_FIXEDEMAIL_'.$action.'/', $key, $reg)) continue; if ($val == '' || ! preg_match('/^NOTIFICATION_FIXEDEMAIL_'.$notifcode.'_THRESHOLD_HIGHER_(.*)$/', $key, $reg)) continue;
$num++;
$threshold = (float) $reg[1];
if ($valueforthreshold <= $threshold)
{
continue;
}
$tmpemail=explode(',',$val);
$num+=count($tmpemail);
} }
} }
// TODO return array with list of email instead of number, + type of notification (contacts or fixed email)
if ($error) return -1; if ($error) return -1;
return $num; return $num;
} }
@ -137,17 +149,17 @@ class Notify
* Check if notification are active for couple action/company. * Check if notification are active for couple action/company.
* If yes, send mail and save trace into llx_notify. * If yes, send mail and save trace into llx_notify.
* *
* @param string $action Code of action in llx_c_action_trigger (new usage) or Id of action in llx_c_action_trigger (old usage) * @param string $notifcode Code of action in llx_c_action_trigger (new usage) or Id of action in llx_c_action_trigger (old usage)
* @param Object $object Object the notification deals on * @param Object $object Object the notification deals on
* @return int <0 if KO, or number of changes if OK * @return int <0 if KO, or number of changes if OK
*/ */
function send($action, $object) function send($notifcode, $object)
{ {
global $conf,$langs,$mysoc,$dolibarr_main_url_root; global $user,$conf,$langs,$mysoc,$dolibarr_main_url_root;
include_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; include_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
dol_syslog(get_class($this)."::send action=".$action.", object=".$object->id); dol_syslog(get_class($this)."::send notifcode=".$notifcode.", object=".$object->id);
$langs->load("other"); $langs->load("other");
@ -166,7 +178,20 @@ class Notify
$link = ''; $link = '';
$num = 0; $num = 0;
if (! in_array($action, array('BILL_VALIDATE', 'ORDER_VALIDATE', 'PROPAL_VALIDATE', 'FICHINTER_VALIDATE', 'ORDER_SUPPLIER_APPROVE', 'ORDER_SUPPLIER_REFUSE', 'SHIPPING_VALIDATE'))) if (! in_array(
$notifcode,
array(
'BILL_VALIDATE',
'ORDER_VALIDATE',
'PROPAL_VALIDATE',
'FICHINTER_VALIDATE',
'ORDER_SUPPLIER_VALIDATE',
'ORDER_SUPPLIER_APPROVE',
'ORDER_SUPPLIER_REFUSE',
'SHIPPING_VALIDATE'
)
)
)
{ {
return 0; return 0;
} }
@ -181,8 +206,8 @@ class Notify
$sql.= " ".MAIN_DB_PREFIX."societe as s"; $sql.= " ".MAIN_DB_PREFIX."societe as s";
$sql.= " WHERE n.fk_contact = c.rowid AND a.rowid = n.fk_action"; $sql.= " WHERE n.fk_contact = c.rowid AND a.rowid = n.fk_action";
$sql.= " AND n.fk_soc = s.rowid"; $sql.= " AND n.fk_soc = s.rowid";
if (is_numeric($action)) $sql.= " AND n.fk_action = ".$action; // Old usage if (is_numeric($notifcode)) $sql.= " AND n.fk_action = ".$notifcode; // Old usage
else $sql.= " AND a.code = '".$action."'"; // New usage else $sql.= " AND a.code = '".$notifcode."'"; // New usage
$sql .= " AND s.rowid = ".$object->socid; $sql .= " AND s.rowid = ".$object->socid;
$result = $this->db->query($sql); $result = $this->db->query($sql);
@ -197,8 +222,8 @@ class Notify
{ {
$obj = $this->db->fetch_object($result); $obj = $this->db->fetch_object($result);
$sendto = $obj->firstname . " " . $obj->lastname . " <".$obj->email.">"; $sendto = dolGetFirstLastname($obj->firstname,$obj->lastname) . " <".$obj->email.">";
$actiondefid = $obj->adid; $notifcodedefid = $obj->adid;
if (dol_strlen($obj->email)) if (dol_strlen($obj->email))
{ {
@ -210,7 +235,7 @@ class Notify
$outputlangs->setDefaultLang($obj->default_lang); $outputlangs->setDefaultLang($obj->default_lang);
} }
switch ($action) { switch ($notifcode) {
case 'BILL_VALIDATE': case 'BILL_VALIDATE':
$link='/compta/facture.php?facid='.$object->id; $link='/compta/facture.php?facid='.$object->id;
$dir_output = $conf->facture->dir_output; $dir_output = $conf->facture->dir_output;
@ -235,6 +260,14 @@ class Notify
$object_type = 'ficheinter'; $object_type = 'ficheinter';
$mesg = $langs->transnoentitiesnoconv("EMailTextInterventionValidated",$object->ref); $mesg = $langs->transnoentitiesnoconv("EMailTextInterventionValidated",$object->ref);
break; break;
case 'ORDER_SUPPLIER_VALIDATE':
$link='/fourn/commande/card.php?id='.$object->id;
$dir_output = $conf->fournisseur->dir_output.'/commande/';
$object_type = 'order_supplier';
$mesg = $langs->transnoentitiesnoconv("Hello").",\n\n";
$mesg.= $langs->transnoentitiesnoconv("EMailTextOrderValidatedBy",$object->ref,$user->getFullName($langs));
$mesg.= "\n\n".$langs->transnoentitiesnoconv("Sincerely").".\n\n";
break;
case 'ORDER_SUPPLIER_APPROVE': case 'ORDER_SUPPLIER_APPROVE':
$link='/fourn/commande/card.php?id='.$object->id; $link='/fourn/commande/card.php?id='.$object->id;
$dir_output = $conf->fournisseur->dir_output.'/commande/'; $dir_output = $conf->fournisseur->dir_output.'/commande/';
@ -294,7 +327,7 @@ class Notify
if ($mailfile->sendfile()) if ($mailfile->sendfile())
{ {
$sql = "INSERT INTO ".MAIN_DB_PREFIX."notify (daten, fk_action, fk_soc, fk_contact, type, objet_type, objet_id, email)"; $sql = "INSERT INTO ".MAIN_DB_PREFIX."notify (daten, fk_action, fk_soc, fk_contact, type, objet_type, objet_id, email)";
$sql.= " VALUES ('".$this->db->idate(dol_now())."', ".$actiondefid.", ".$object->socid.", ".$obj->cid.", '".$obj->type."', '".$object_type."', ".$object->id.", '".$this->db->escape($obj->email)."')"; $sql.= " VALUES ('".$this->db->idate(dol_now())."', ".$notifcodedefid.", ".$object->socid.", ".$obj->cid.", '".$obj->type."', '".$object_type."', ".$object->id.", '".$this->db->escape($obj->email)."')";
if (! $this->db->query($sql)) if (! $this->db->query($sql))
{ {
dol_print_error($this->db); dol_print_error($this->db);
@ -328,18 +361,28 @@ class Notify
// Check notification using fixed email // Check notification using fixed email
if (! $error) if (! $error)
{ {
$param='NOTIFICATION_FIXEDEMAIL_'.$action; foreach($conf->global as $key => $val)
if (! empty($conf->global->$param))
{ {
if ($val == '' || ! preg_match('/^NOTIFICATION_FIXEDEMAIL_'.$notifcode.'_THRESHOLD_HIGHER_(.*)$/', $key, $reg)) continue;
$threshold = (float) $reg[1];
if ($object->total_ht <= $threshold)
{
dol_syslog("A notification is requested for notifcode = ".$notifcode." but amount = ".$object->total_ht." so lower than threshold = ".$threshold.". We discard this notification");
continue;
}
$param='NOTIFICATION_FIXEDEMAIL_'.$notifcode.'_THRESHOLD_HIGHER_'.$reg[1];
$sendto = $conf->global->$param; $sendto = $conf->global->$param;
$actiondefid = dol_getIdFromCode($this->db, $action, 'c_action_trigger', 'code', 'rowid'); $notifcodedefid = dol_getIdFromCode($this->db, $notifcode, 'c_action_trigger', 'code', 'rowid');
if ($actiondefid <= 0) dol_print_error($this->db, 'Failed to get id from code'); if ($notifcodedefid <= 0) dol_print_error($this->db, 'Failed to get id from code');
$object_type = ''; $object_type = '';
$link = ''; $link = '';
$num++; $num++;
switch ($action) { switch ($notifcode) {
case 'BILL_VALIDATE': case 'BILL_VALIDATE':
$link='/compta/facture.php?facid='.$object->id; $link='/compta/facture.php?facid='.$object->id;
$dir_output = $conf->facture->dir_output; $dir_output = $conf->facture->dir_output;
@ -364,6 +407,14 @@ class Notify
$object_type = 'ficheinter'; $object_type = 'ficheinter';
$mesg = $langs->transnoentitiesnoconv("EMailTextInterventionValidated",$object->ref); $mesg = $langs->transnoentitiesnoconv("EMailTextInterventionValidated",$object->ref);
break; break;
case 'ORDER_SUPPLIER_VALIDATE':
$link='/fourn/commande/card.php?id='.$object->id;
$dir_output = $conf->fournisseur->dir_output.'/commande/';
$object_type = 'order_supplier';
$mesg = $langs->transnoentitiesnoconv("Hello").",\n\n";
$mesg.= $langs->transnoentitiesnoconv("EMailTextOrderValidatedBy",$object->ref,$user->getFullName($langs));
$mesg.= "\n\n".$langs->transnoentitiesnoconv("Sincerely").".\n\n";
break;
case 'ORDER_SUPPLIER_APPROVE': case 'ORDER_SUPPLIER_APPROVE':
$link='/fourn/commande/card.php?id='.$object->id; $link='/fourn/commande/card.php?id='.$object->id;
$dir_output = $conf->fournisseur->dir_output.'/commande/'; $dir_output = $conf->fournisseur->dir_output.'/commande/';
@ -406,6 +457,24 @@ class Notify
$message.= $mesg; $message.= $mesg;
if ($link) $message=dol_concatdesc($message,$urlwithroot.$link); if ($link) $message=dol_concatdesc($message,$urlwithroot.$link);
// Replace keyword __SUPERVISOREMAIL__
if (preg_match('/__SUPERVISOREMAIL__/', $sendto))
{
$newval='';
if ($user->fk_user > 0)
{
$supervisoruser=new User($this->db);
$supervisoruser->fetch($user->fk_user);
if ($supervisoruser->email) $newval=trim(dolGetFirstLastname($supervisoruser->firstname, $supervisoruser->lastname).' <'.$supervisoruser->email.'>');
}
dol_syslog("Replace the __SUPERVISOREMAIL__ key into recipient email string with ".$newval);
$sendto = preg_replace('/__SUPERVISOREMAIL__/', $newval, $sendto);
$sendto = preg_replace('/^[\s,]+/','',$sendto); // Clean start of string
$sendto = preg_replace('/[\s,]+$/','',$sendto); // Clean end of string
}
if ($sendto)
{
$mailfile = new CMailFile( $mailfile = new CMailFile(
$subject, $subject,
$sendto, $sendto,
@ -423,7 +492,7 @@ class Notify
if ($mailfile->sendfile()) if ($mailfile->sendfile())
{ {
$sql = "INSERT INTO ".MAIN_DB_PREFIX."notify (daten, fk_action, fk_soc, fk_contact, type, objet_type, objet_id, email)"; $sql = "INSERT INTO ".MAIN_DB_PREFIX."notify (daten, fk_action, fk_soc, fk_contact, type, objet_type, objet_id, email)";
$sql.= " VALUES ('".$this->db->idate(dol_now())."', ".$actiondefid.", ".$object->socid.", null, '".$obj->type."', '".$object_type."', ".$object->id.", '".$this->db->escape($conf->global->$param)."')"; $sql.= " VALUES ('".$this->db->idate(dol_now())."', ".$notifcodedefid.", ".$object->socid.", null, 'email', '".$object_type."', ".$object->id.", '".$this->db->escape($conf->global->$param)."')";
if (! $this->db->query($sql)) if (! $this->db->query($sql))
{ {
dol_print_error($this->db); dol_print_error($this->db);
@ -436,6 +505,7 @@ class Notify
} }
} }
} }
}
if (! $error) return $num; if (! $error) return $num;
else return -1 * $error; else return -1 * $error;

View File

@ -315,7 +315,7 @@ class DoliDBSqlite3 extends DoliDB
* @param string $login login * @param string $login login
* @param string $passwd password * @param string $passwd password
* @param string $name name of database (not used for mysql, used for pgsql) * @param string $name name of database (not used for mysql, used for pgsql)
* @param string $port Port of database server * @param integer $port Port of database server
* @return resource Database access handler * @return resource Database access handler
* @see close * @see close
*/ */
@ -530,7 +530,7 @@ class DoliDBSqlite3 extends DoliDB
/** /**
* Return datas as an array * Return datas as an array
* *
* @param Resultset $resultset Resultset of request * @param resource $resultset Resultset of request
* @return array Array * @return array Array
*/ */
function fetch_row($resultset) function fetch_row($resultset)
@ -588,7 +588,7 @@ class DoliDBSqlite3 extends DoliDB
/** /**
* Free last resultset used. * Free last resultset used.
* *
* @param resultset $resultset Curseur de la requete voulue * @param integer $resultset Curseur de la requete voulue
* @return void * @return void
*/ */
function free($resultset=0) function free($resultset=0)
@ -709,7 +709,7 @@ class DoliDBSqlite3 extends DoliDB
* *
* @param string $fieldorvalue Field name or value to encrypt * @param string $fieldorvalue Field name or value to encrypt
* @param int $withQuotes Return string with quotes * @param int $withQuotes Return string with quotes
* @return return XXX(field) or XXX('value') or field or 'value' * @return string XXX(field) or XXX('value') or field or 'value'
*/ */
function encrypt($fieldorvalue, $withQuotes=0) function encrypt($fieldorvalue, $withQuotes=0)
{ {
@ -1277,7 +1277,7 @@ class DoliDBSqlite3 extends DoliDB
* Cette fonction est l'equivalent de la fonction MONTH de MySql. * Cette fonction est l'equivalent de la fonction MONTH de MySql.
* *
* @param string $date Date * @param string $date Date
* @return integer * @return string
*/ */
public static function dbMONTH($date) public static function dbMONTH($date)
{ {
@ -1320,7 +1320,7 @@ class DoliDBSqlite3 extends DoliDB
* dbWEEKDAY * dbWEEKDAY
* *
* @param int $date Date * @param int $date Date
* @return string * @return double
*/ */
public static function dbWEEKDAY($date) { public static function dbWEEKDAY($date) {
$arr = date_parse($date); $arr = date_parse($date);
@ -1472,7 +1472,7 @@ class DoliDBSqlite3 extends DoliDB
* week_mode * week_mode
* *
* @param string $mode Mode * @param string $mode Mode
* @return string Week format * @return integer Week format
*/ */
private static function week_mode($mode) { private static function week_mode($mode) {
$week_format= ($mode & 7); $week_format= ($mode & 7);

View File

@ -84,7 +84,7 @@ function CreateXmlFooter()
/** /**
* SendError * SendError
* *
* @param unknown_type $number Number * @param integer $number Number
* @param unknown_type $text Text * @param unknown_type $text Text
* @return void * @return void
*/ */

View File

@ -30,7 +30,7 @@ require 'commands.php';
/** /**
* SendError * SendError
* *
* @param string $number Number * @param integer $number Number
* @param string $text Text * @param string $text Text
* @return void * @return void
*/ */

View File

@ -122,7 +122,28 @@ function updateTotal(days,mode)
var nbline = document.getElementById('numberOfLines').value; var nbline = document.getElementById('numberOfLines').value;
for (var i=0;i<nbline;i++) for (var i=0;i<nbline;i++)
{ {
var id='task['+i+']['+days+']'; var id='timespent['+i+']['+days+']';
var taskTime= new Date(0);
var element=document.getElementById(id);
if(element)
{
/* alert(element.value);*/
if (element.value)
{
result=parseTime(element.value,taskTime);
}
else
{
result=parseTime(element.innerHTML,taskTime);
}
if (result >= 0)
{
total.setHours(total.getHours()+taskTime.getHours());
total.setMinutes(total.getMinutes()+taskTime.getMinutes());
}
}
var id='timeadded['+i+']['+days+']';
var taskTime= new Date(0); var taskTime= new Date(0);
var element=document.getElementById(id); var element=document.getElementById(id);
if(element) if(element)
@ -152,7 +173,23 @@ function updateTotal(days,mode)
var nbline = document.getElementById('numberOfLines').value; var nbline = document.getElementById('numberOfLines').value;
for (var i=0;i<nbline;i++) for (var i=0;i<nbline;i++)
{ {
var id='task['+i+']['+days+']'; var id='timespent['+i+']['+days+']';
var taskTime= new Date(0);
var element=document.getElementById(id);
if(element)
{
if (element.value)
{
total+=parseInt(element.value);
}
else
{
total+=parseInt(element.innerHTML);
}
}
var id='timeadded['+i+']['+days+']';
var taskTime= new Date(0); var taskTime= new Date(0);
var element=document.getElementById(id); var element=document.getElementById(id);
if(element) if(element)

View File

@ -386,6 +386,12 @@ function dolibarr_del_const($db, $name, $entity=1)
{ {
global $conf; global $conf;
if (empty($name))
{
dol_print_error('','Error call dolibar_del_const with parameter name empty');
return -1;
}
$sql = "DELETE FROM ".MAIN_DB_PREFIX."const"; $sql = "DELETE FROM ".MAIN_DB_PREFIX."const";
$sql.= " WHERE (".$db->decrypt('name')." = '".$db->escape($name)."'"; $sql.= " WHERE (".$db->decrypt('name')." = '".$db->escape($name)."'";
if (is_numeric($name)) $sql.= " OR rowid = '".$db->escape($name)."'"; if (is_numeric($name)) $sql.= " OR rowid = '".$db->escape($name)."'";
@ -438,7 +444,7 @@ function dolibarr_get_const($db, $name, $entity=1)
/** /**
* Insert a parameter (key,value) into database. * Insert a parameter (key,value) into database (delete old key then insert it again).
* *
* @param DoliDB $db Database handler * @param DoliDB $db Database handler
* @param string $name Name of constant * @param string $name Name of constant

View File

@ -120,7 +120,7 @@ function bank_admin_prepare_head($object)
* Check SWIFT informations for a bank account * Check SWIFT informations for a bank account
* *
* @param Account $account A bank account * @param Account $account A bank account
* @return int True if informations are valid, false otherwise * @return boolean True if informations are valid, false otherwise
*/ */
function checkSwiftForAccount($account) function checkSwiftForAccount($account)
{ {
@ -137,7 +137,7 @@ function checkSwiftForAccount($account)
* Check IBAN number informations for a bank account * Check IBAN number informations for a bank account
* *
* @param Account $account A bank account * @param Account $account A bank account
* @return int True if informations are valid, false otherwise * @return boolean True if informations are valid, false otherwise
*/ */
function checkIbanForAccount($account) function checkIbanForAccount($account)
{ {
@ -156,7 +156,7 @@ function checkIbanForAccount($account)
* Check account number informations for a bank account * Check account number informations for a bank account
* *
* @param Account $account A bank account * @param Account $account A bank account
* @return int True if informations are valid, false otherwise * @return boolean True if informations are valid, false otherwise
*/ */
function checkBanForAccount($account) function checkBanForAccount($account)
{ {

View File

@ -1634,13 +1634,13 @@ function dol_print_address($address, $htmlid, $mode, $id)
* Return true if email syntax is ok * Return true if email syntax is ok
* *
* @param string $address email (Ex: "toto@titi.com", "John Do <johndo@titi.com>") * @param string $address email (Ex: "toto@titi.com", "John Do <johndo@titi.com>")
* @param int $acceptsupervisorkey If 1, the special string '__SUPERVISOREMAIL__' is also accepted as valid
* @return boolean true if email syntax is OK, false if KO or empty string * @return boolean true if email syntax is OK, false if KO or empty string
*/ */
function isValidEmail($address) function isValidEmail($address, $acceptsupervisorkey=0)
{ {
if (filter_var($address, FILTER_VALIDATE_EMAIL)) { if ($acceptsupervisorkey && $address == '__SUPERVISOREMAIL__') return true;
return true; if (filter_var($address, FILTER_VALIDATE_EMAIL)) return true;
}
return false; return false;
} }
@ -2116,7 +2116,7 @@ function img_edit_remove($titlealt = 'default', $other='')
* Show logo editer/modifier fiche * Show logo editer/modifier fiche
* *
* @param string $titlealt Text on alt and title of image. Alt only if param notitle is set to 1. If text is "TextA:TextB", use Text A on alt and Text B on title. * @param string $titlealt Text on alt and title of image. Alt only if param notitle is set to 1. If text is "TextA:TextB", use Text A on alt and Text B on title.
* @param float $float Si il faut y mettre le style "float: right" * @param integer $float Si il faut y mettre le style "float: right"
* @param string $other Add more attributes on img * @param string $other Add more attributes on img
* @return string Return tag img * @return string Return tag img
*/ */
@ -2133,7 +2133,7 @@ function img_edit($titlealt = 'default', $float = 0, $other = '')
* Show logo view card * Show logo view card
* *
* @param string $titlealt Text on alt and title of image. Alt only if param notitle is set to 1. If text is "TextA:TextB", use Text A on alt and Text B on title. * @param string $titlealt Text on alt and title of image. Alt only if param notitle is set to 1. If text is "TextA:TextB", use Text A on alt and Text B on title.
* @param float $float Si il faut y mettre le style "float: right" * @param integer $float Si il faut y mettre le style "float: right"
* @param string $other Add more attributes on img * @param string $other Add more attributes on img
* @return string Return tag img * @return string Return tag img
*/ */
@ -2446,7 +2446,7 @@ function img_searchclear($titlealt = 'default', $other = '')
* Show information for admin users * Show information for admin users
* *
* @param string $text Text info * @param string $text Text info
* @param string $infoonimgalt Info is shown only on alt of star picto, otherwise it is show on output after the star picto * @param integer $infoonimgalt Info is shown only on alt of star picto, otherwise it is show on output after the star picto
* @param int $nodiv No div * @param int $nodiv No div
* @return string String with info text * @return string String with info text
*/ */
@ -2495,7 +2495,7 @@ function dol_print_error($db='',$error='')
if ($_SERVER['DOCUMENT_ROOT']) // Mode web if ($_SERVER['DOCUMENT_ROOT']) // Mode web
{ {
$out.=$langs->trans("DolibarrHasDetectedError").".<br>\n"; $out.=$langs->trans("DolibarrHasDetectedError").".<br>\n";
if (! empty($conf->global->MAIN_FEATURES_LEVEL)) $out.="You use an experimental level of features, so please do NOT report any bugs, except if problem is confirmed moving option MAIN_FEATURES_LEVEL back to 0.<br>\n"; if (! empty($conf->global->MAIN_FEATURES_LEVEL)) $out.="You use an experimental or develop level of features, so please do NOT report any bugs, except if problem is confirmed moving option MAIN_FEATURES_LEVEL back to 0.<br>\n";
$out.=$langs->trans("InformationToHelpDiagnose").":<br>\n"; $out.=$langs->trans("InformationToHelpDiagnose").":<br>\n";
$out.="<b>".$langs->trans("Date").":</b> ".dol_print_date(time(),'dayhourlog')."<br>\n"; $out.="<b>".$langs->trans("Date").":</b> ".dol_print_date(time(),'dayhourlog')."<br>\n";
@ -2866,7 +2866,7 @@ function print_barre_liste($titre, $page, $file, $options='', $sortfield='', $so
* @param int $page Number of page * @param int $page Number of page
* @param string $file Lien * @param string $file Lien
* @param string $options Autres parametres d'url a propager dans les liens ("" par defaut) * @param string $options Autres parametres d'url a propager dans les liens ("" par defaut)
* @param boolean|int $nextpage Do we show a next page button * @param integer $nextpage Do we show a next page button
* @param string $betweenarrows HTML Content to show between arrows * @param string $betweenarrows HTML Content to show between arrows
* @return void * @return void
*/ */
@ -2923,7 +2923,7 @@ function vatrate($rate,$addpercent=false,$info_bits=0,$usestarfornpr=0)
* Function used into PDF and HTML pages * Function used into PDF and HTML pages
* *
* @param float $amount Amount to format * @param float $amount Amount to format
* @param string $form Type of format, HTML or not (not by default) * @param integer $form Type of format, HTML or not (not by default)
* @param Translate $outlangs Object langs for output * @param Translate $outlangs Object langs for output
* @param int $trunc 1=Truncate if there is too much decimals (default), 0=Does not truncate * @param int $trunc 1=Truncate if there is too much decimals (default), 0=Does not truncate
* @param int $rounding Minimum number of decimal to show. If 0, no change, if -1, we use min($conf->global->MAIN_MAX_DECIMALS_UNIT,$conf->global->MAIN_MAX_DECIMALS_TOTAL) * @param int $rounding Minimum number of decimal to show. If 0, no change, if -1, we use min($conf->global->MAIN_MAX_DECIMALS_UNIT,$conf->global->MAIN_MAX_DECIMALS_TOTAL)
@ -3622,7 +3622,7 @@ function get_default_npr($thirdparty_seller, $thirdparty_buyer, $idprod=0, $idpr
* @param Societe $thirdparty_buyer Thirdparty buyer * @param Societe $thirdparty_buyer Thirdparty buyer
* @param int $local Localtax to process (1 or 2) * @param int $local Localtax to process (1 or 2)
* @param int $idprod Id product * @param int $idprod Id product
* @return float localtax, -1 si ne peut etre determine * @return integer localtax, -1 si ne peut etre determine
* @see get_default_tva, get_default_npr * @see get_default_tva, get_default_npr
*/ */
function get_default_localtax($thirdparty_seller, $thirdparty_buyer, $local, $idprod=0) function get_default_localtax($thirdparty_seller, $thirdparty_buyer, $local, $idprod=0)
@ -3664,7 +3664,7 @@ function get_default_localtax($thirdparty_seller, $thirdparty_buyer, $local, $id
* Return yes or no in current language * Return yes or no in current language
* *
* @param string $yesno Value to test (1, 'yes', 'true' or 0, 'no', 'false') * @param string $yesno Value to test (1, 'yes', 'true' or 0, 'no', 'false')
* @param string $case 1=Yes/No, 0=yes/no, 2=Disabled checkbox, 3=Disabled checkbox + Yes/No * @param integer $case 1=Yes/No, 0=yes/no, 2=Disabled checkbox, 3=Disabled checkbox + Yes/No
* @param int $color 0=texte only, 1=Text is formated with a color font style ('ok' or 'error'), 2=Text is formated with 'ok' color. * @param int $color 0=texte only, 1=Text is formated with a color font style ('ok' or 'error'), 2=Text is formated with 'ok' color.
* @return string HTML string * @return string HTML string
*/ */
@ -3805,7 +3805,7 @@ function picto_required()
* Clean a string from all HTML tags and entities * Clean a string from all HTML tags and entities
* *
* @param string $StringHtml String to clean * @param string $StringHtml String to clean
* @param string $removelinefeed Replace also all lines feeds by a space, otherwise only last one are removed * @param integer $removelinefeed Replace also all lines feeds by a space, otherwise only last one are removed
* @param string $pagecodeto Encoding of input/output string * @param string $pagecodeto Encoding of input/output string
* @return string String cleaned * @return string String cleaned
* *
@ -4183,7 +4183,7 @@ function print_date_range($date_start,$date_end,$format = '',$outputlangs='')
* @param int $date_end End date * @param int $date_end End date
* @param string $format Output format * @param string $format Output format
* @param Translate $outputlangs Output language * @param Translate $outputlangs Output language
* @param string $withparenthesis 1=Add parenthesis, 0=non parenthesis * @param integer $withparenthesis 1=Add parenthesis, 0=non parenthesis
* @return string String * @return string String
*/ */
function get_date_range($date_start,$date_end,$format = '',$outputlangs='', $withparenthesis=1) function get_date_range($date_start,$date_end,$format = '',$outputlangs='', $withparenthesis=1)
@ -4845,7 +4845,7 @@ function printCommonFooter($zone='private')
print 'MAIN_OPTIMIZE_SPEED='.(isset($conf->global->MAIN_OPTIMIZE_SPEED)?$conf->global->MAIN_OPTIMIZE_SPEED:'off'); print 'MAIN_OPTIMIZE_SPEED='.(isset($conf->global->MAIN_OPTIMIZE_SPEED)?$conf->global->MAIN_OPTIMIZE_SPEED:'off');
if ($micro_start_time) if ($micro_start_time)
{ {
$micro_end_time=dol_microtime_float(true); $micro_end_time=dol_microtime_float();
print ' - Build time: '.ceil(1000*($micro_end_time-$micro_start_time)).' ms'; print ' - Build time: '.ceil(1000*($micro_end_time-$micro_start_time)).' ms';
} }
if (function_exists("memory_get_usage")) if (function_exists("memory_get_usage"))
@ -4952,7 +4952,7 @@ function dol_getmypid()
* @param string $value The value to look for. * @param string $value The value to look for.
* If param $numeric is 0, can contains several keywords separated with a space, like "keyword1 keyword2" = We want record field like keyword1 and field like keyword2 * If param $numeric is 0, can contains several keywords separated with a space, like "keyword1 keyword2" = We want record field like keyword1 and field like keyword2
* If param $numeric is 1, can contains an operator <>= like "<10" or ">=100.5 < 1000" * If param $numeric is 1, can contains an operator <>= like "<10" or ">=100.5 < 1000"
* @param string $numeric 0=value is list of keywords, 1=value is a numeric test * @param integer $numeric 0=value is list of keywords, 1=value is a numeric test
* @return string $res The statement to append to the SQL query * @return string $res The statement to append to the SQL query
*/ */
function natural_search($fields, $value, $numeric=0) function natural_search($fields, $value, $numeric=0)

View File

@ -941,7 +941,7 @@ function pdf_writeLinkedObjects(&$pdf,$object,$outputlangs,$posx,$posy,$w,$h,$al
* @param int $hideref Hide reference * @param int $hideref Hide reference
* @param int $hidedesc Hide description * @param int $hidedesc Hide description
* @param int $issupplierline Is it a line for a supplier object ? * @param int $issupplierline Is it a line for a supplier object ?
* @return void * @return string|null
*/ */
function pdf_writelinedesc(&$pdf,$object,$i,$outputlangs,$w,$h,$posx,$posy,$hideref=0,$hidedesc=0,$issupplierline=0) function pdf_writelinedesc(&$pdf,$object,$i,$outputlangs,$w,$h,$posx,$posy,$hideref=0,$hidedesc=0,$issupplierline=0)
{ {
@ -1159,7 +1159,7 @@ function pdf_getlinedesc($object,$i,$outputlangs,$hideref=0,$hidedesc=0,$issuppl
* @param int $i Current line number * @param int $i Current line number
* @param Translate $outputlangs Object langs for output * @param Translate $outputlangs Object langs for output
* @param int $hidedetails Hide details (0=no, 1=yes, 2=just special lines) * @param int $hidedetails Hide details (0=no, 1=yes, 2=just special lines)
* @return void * @return null|string
*/ */
function pdf_getlinenum($object,$i,$outputlangs,$hidedetails=0) function pdf_getlinenum($object,$i,$outputlangs,$hidedetails=0)
{ {
@ -1185,7 +1185,7 @@ function pdf_getlinenum($object,$i,$outputlangs,$hidedetails=0)
* @param int $i Current line number * @param int $i Current line number
* @param Translate $outputlangs Object langs for output * @param Translate $outputlangs Object langs for output
* @param int $hidedetails Hide details (0=no, 1=yes, 2=just special lines) * @param int $hidedetails Hide details (0=no, 1=yes, 2=just special lines)
* @return void * @return null|string
*/ */
function pdf_getlineref($object,$i,$outputlangs,$hidedetails=0) function pdf_getlineref($object,$i,$outputlangs,$hidedetails=0)
{ {
@ -1210,7 +1210,7 @@ function pdf_getlineref($object,$i,$outputlangs,$hidedetails=0)
* @param int $i Current line number * @param int $i Current line number
* @param Translate $outputlangs Object langs for output * @param Translate $outputlangs Object langs for output
* @param int $hidedetails Hide details (0=no, 1=yes, 2=just special lines) * @param int $hidedetails Hide details (0=no, 1=yes, 2=just special lines)
* @return void * @return null|string
*/ */
function pdf_getlineref_supplier($object,$i,$outputlangs,$hidedetails=0) function pdf_getlineref_supplier($object,$i,$outputlangs,$hidedetails=0)
{ {
@ -1569,7 +1569,7 @@ function pdf_getlinetotalwithtax($object,$i,$outputlangs,$hidedetails=0)
* @param Object $object Object * @param Object $object Object
* @param string $type Type * @param string $type Type
* @param Translate $outputlangs Object langs for output * @param Translate $outputlangs Object langs for output
* @return void * @return integer
*/ */
function pdf_getTotalQty($object,$type,$outputlangs) function pdf_getTotalQty($object,$type,$outputlangs)
{ {

View File

@ -49,7 +49,7 @@
* @param int $type 0/1=Product/service * @param int $type 0/1=Product/service
* @param Societe $seller Thirdparty seller (we need $seller->country_id property). Provided only if seller is the supplier, otherwise $seller will be $mysoc. * @param Societe $seller Thirdparty seller (we need $seller->country_id property). Provided only if seller is the supplier, otherwise $seller will be $mysoc.
* @param array $localtaxes_array Array with localtaxes info (loaded by getLocalTaxesFromRate function). * @param array $localtaxes_array Array with localtaxes info (loaded by getLocalTaxesFromRate function).
* @param float $progress Situation invoices progress (value from 0 to 100, 100 by default) * @param integer $progress Situation invoices progress (value from 0 to 100, 100 by default)
* @return result[ 0=total_ht, * @return result[ 0=total_ht,
* 1=total_vat, * 1=total_vat,
* 2=total_ttc, * 2=total_ttc,

View File

@ -27,7 +27,7 @@
/** /**
* Prepare array with list of tabs * Prepare array with list of tabs
* *
* @param Object $object Object related to tabs * @param Product $object Object related to tabs
* @param User $user Object user * @param User $user Object user
* @return array Array of tabs to show * @return array Array of tabs to show
*/ */
@ -183,7 +183,7 @@ function product_admin_prepare_head()
* *
* @param Product $product Product object * @param Product $product Product object
* @param int $socid Thirdparty id * @param int $socid Thirdparty id
* @return void * @return integer
*/ */
function show_stats_for_company($product,$socid) function show_stats_for_company($product,$socid)
{ {

View File

@ -177,7 +177,15 @@ function project_timesheet_prepare_head($mode)
$h = 0; $h = 0;
if (empty($conf->global->PROJECT_DISABLE_TIMESHEET_PERDAY)) if (empty($conf->global->PROJECT_DISABLE_TIMESHEET_PERWEEK))
{
$head[$h][0] = DOL_URL_ROOT."/projet/activity/perweek.php".($mode?'?mode='.$mode:'');
$head[$h][1] = $langs->trans("InputPerWeek");
$head[$h][2] = 'inputperweek';
$h++;
}
if (empty($conf->global->PROJECT_DISABLE_TIMESHEET_PERTIME))
{ {
$head[$h][0] = DOL_URL_ROOT."/projet/activity/perday.php".($mode?'?mode='.$mode:''); $head[$h][0] = DOL_URL_ROOT."/projet/activity/perday.php".($mode?'?mode='.$mode:'');
$head[$h][1] = $langs->trans("InputPerDay"); $head[$h][1] = $langs->trans("InputPerDay");
@ -185,13 +193,13 @@ function project_timesheet_prepare_head($mode)
$h++; $h++;
} }
if (empty($conf->global->PROJECT_DISABLE_TIMESHEET_PERTIME)) /*if (empty($conf->global->PROJECT_DISABLE_TIMESHEET_PERACTION))
{ {
$head[$h][0] = DOL_URL_ROOT."/projet/activity/pertime.php".($mode?'?mode='.$mode:''); $head[$h][0] = DOL_URL_ROOT."/projet/activity/peraction.php".($mode?'?mode='.$mode:'');
$head[$h][1] = $langs->trans("InputPerTime"); $head[$h][1] = $langs->trans("InputPerAction");
$head[$h][2] = 'inputpertime'; $head[$h][2] = 'inputperaction';
$h++; $h++;
} }*/
complete_head_from_modules($conf,$langs,null,$head,$h,'project_timesheet'); complete_head_from_modules($conf,$langs,null,$head,$h,'project_timesheet');
@ -498,17 +506,11 @@ function projectLinesa(&$inc, $parent, &$lines, &$level, $var, $showproject, &$t
* @param int $restricteditformytask 0=No restriction, 1=Enable add time only if task is a task i am affected to * @param int $restricteditformytask 0=No restriction, 1=Enable add time only if task is a task i am affected to
* @return $inc * @return $inc
*/ */
function projectLinesPerTime(&$inc, $parent, $lines, &$level, &$projectsrole, &$tasksrole, $mine, $restricteditformytask=0) function projectLinesPerDay(&$inc, $parent, $lines, &$level, &$projectsrole, &$tasksrole, $mine, $restricteditformytask=0)
{ {
global $db, $user, $bc, $langs; global $db, $user, $bc, $langs;
global $form, $formother, $projectstatic, $taskstatic; global $form, $formother, $projectstatic, $taskstatic;
if (! is_object($formother))
{
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php';
$formother = new FormOther($db);
}
$lastprojectid=0; $lastprojectid=0;
$var=true; $var=true;
@ -617,7 +619,7 @@ function projectLinesPerTime(&$inc, $parent, $lines, &$level, &$projectsrole, &$
print '</td><td align="right">'; print '</td><td align="right">';
//$s.='&nbsp;&nbsp;&nbsp;'; //$s.='&nbsp;&nbsp;&nbsp;';
$s=$form->select_duration($lines[$i]->id.'duration','',$disabledtask,'text',0,1); $s=$form->select_duration($lines[$i]->id.'duration','',$disabledtask,'text',0,1);
$s.='&nbsp;<input type="submit" class="button"'.($disabledtask?' disabled="disabled"':'').' value="'.$langs->trans("Add").'">'; //$s.='&nbsp;<input type="submit" class="button"'.($disabledtask?' disabled="disabled"':'').' value="'.$langs->trans("Add").'">';
print $s; print $s;
print '</td>'; print '</td>';
@ -631,7 +633,7 @@ function projectLinesPerTime(&$inc, $parent, $lines, &$level, &$projectsrole, &$
$inc++; $inc++;
$level++; $level++;
if ($lines[$i]->id) projectLinesPerTime($inc, $lines[$i]->id, $lines, $level, $projectsrole, $tasksrole, $mine, $restricteditformytask); if ($lines[$i]->id) projectLinesPerDay($inc, $lines[$i]->id, $lines, $level, $projectsrole, $tasksrole, $mine, $restricteditformytask);
$level--; $level--;
} }
else else
@ -649,6 +651,8 @@ function projectLinesPerTime(&$inc, $parent, $lines, &$level, &$projectsrole, &$
* Output a task line into a perday intput mode * Output a task line into a perday intput mode
* *
* @param string $inc Line number (start to 0, then increased by recursive call) * @param string $inc Line number (start to 0, then increased by recursive call)
* @param int $firstdaytoshow First day to show
* @param User|null $fuser Restrict list to user if defined
* @param string $parent Id of parent project to show (0 to show all) * @param string $parent Id of parent project to show (0 to show all)
* @param Task[] $lines Array of lines * @param Task[] $lines Array of lines
* @param int $level Level (start to 0, then increased/decrease by recursive call) * @param int $level Level (start to 0, then increased/decrease by recursive call)
@ -658,17 +662,11 @@ function projectLinesPerTime(&$inc, $parent, $lines, &$level, &$projectsrole, &$
* @param int $restricteditformytask 0=No restriction, 1=Enable add time only if task is a task i am affected to * @param int $restricteditformytask 0=No restriction, 1=Enable add time only if task is a task i am affected to
* @return $inc * @return $inc
*/ */
function projectLinesPerDay(&$inc, $parent, $lines, &$level, &$projectsrole, &$tasksrole, $mine, $restricteditformytask=0) function projectLinesPerWeek(&$inc, $firstdaytoshow, $fuser, $parent, $lines, &$level, &$projectsrole, &$tasksrole, $mine, $restricteditformytask=0)
{ {
global $db, $user, $bc, $langs; global $db, $user, $bc, $langs;
global $form, $formother, $projectstatic, $taskstatic; global $form, $formother, $projectstatic, $taskstatic;
if (! is_object($formother))
{
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php';
$formother = new FormOther($db);
}
$lastprojectid=0; $lastprojectid=0;
$var=true; $var=true;
@ -687,7 +685,7 @@ function projectLinesPerDay(&$inc, $parent, $lines, &$level, &$projectsrole, &$t
$lastprojectid=$lines[$i]->fk_project; $lastprojectid=$lines[$i]->fk_project;
$projectstatic->id = $lines[$i]->fk_project; $projectstatic->id = $lines[$i]->fk_project;
$projectstatic->loadTimeSpent($datestart, $lines[$i]->id, $fuser->id); $projectstatic->loadTimeSpent($firstdaytoshow, 0, $fuser->id); // Load time spent into this->weekWorkLoad and this->weekWorkLoadPerTaks for all day of a week
} }
// If we want all or we have a role on task, we show it // If we want all or we have a role on task, we show it
@ -708,17 +706,18 @@ function projectLinesPerDay(&$inc, $parent, $lines, &$level, &$projectsrole, &$t
print '<td class="nowrap">'; print '<td class="nowrap">';
$taskstatic->id=$lines[$i]->id; $taskstatic->id=$lines[$i]->id;
$taskstatic->ref=($lines[$i]->ref?$lines[$i]->ref:$lines[$i]->id); $taskstatic->ref=($lines[$i]->ref?$lines[$i]->ref:$lines[$i]->id);
print $taskstatic->getNomUrl(1); print $taskstatic->getNomUrl(1, 'withproject', 'time');
print '</td>'; print '</td>';
// Label task // Label task
print "<td>"; print "<td>";
print '<!-- Task id = '.$lines[$i]->id.' -->';
for ($k = 0 ; $k < $level ; $k++) print "&nbsp;&nbsp;&nbsp;"; for ($k = 0 ; $k < $level ; $k++) print "&nbsp;&nbsp;&nbsp;";
$taskstatic->id=$lines[$i]->id; $taskstatic->id=$lines[$i]->id;
$taskstatic->ref=$lines[$i]->label; $taskstatic->ref=$lines[$i]->label;
$taskstatic->date_start=$lines[$i]->date_start; $taskstatic->date_start=$lines[$i]->date_start;
$taskstatic->date_end=$lines[$i]->date_end; $taskstatic->date_end=$lines[$i]->date_end;
print $taskstatic->getNomUrl(0); print $taskstatic->getNomUrl(0, 'withproject', 'time');
//print "<br>"; //print "<br>";
//for ($k = 0 ; $k < $level ; $k++) print "&nbsp;&nbsp;&nbsp;"; //for ($k = 0 ; $k < $level ; $k++) print "&nbsp;&nbsp;&nbsp;";
//print get_date_range($lines[$i]->date_start,$lines[$i]->date_end,'',$langs,0); //print get_date_range($lines[$i]->date_start,$lines[$i]->date_end,'',$langs,0);
@ -770,16 +769,20 @@ function projectLinesPerDay(&$inc, $parent, $lines, &$level, &$projectsrole, &$t
$disabledtask=1; $disabledtask=1;
} }
//var_dump($projectstatic->weekWorkLoad); //var_dump($projectstatic->weekWorkLoadPerTask);
// Fields to show current time // Fields to show current time
$tableCell=''; $modeinput='hours'; $tableCell=''; $modeinput='hours';
for ($idw = 0; $idw < 7; $idw++) for ($idw = 0; $idw < 7; $idw++)
{ {
$dayWorkLoad = 0; $tmpday=dol_time_plus_duree($firstdaytoshow, $idw, 'd');
$dayWorkLoad = $projectstatic->weekWorkLoadPerTask[$tmpday][$lines[$i]->id];
$alreadyspent='';
if ($dayWorkLoad > 0) $alreadyspent=convertSecondToTime($dayWorkLoad,'allhourmin');
$tableCell ='<td align="center">'; $tableCell ='<td align="center">';
$tableCell.='<span class="timesheetalreadyrecorded"><input type="text" class="center" size="2" disabled="disabled" value="'.convertSecondToTime($dayWorkLoad,'allhourmin').'"></span>+'; $tableCell.='<span class="timesheetalreadyrecorded"><input type="text" class="center" size="2" disabled="disabled" id="timespent['.$inc.']['.$idw.']" name="task['.$lines[$i]->id.']['.$idw.']" value="'.$alreadyspent.'"></span>';
$tableCell.='<input type="text" class="center" size="2" id="task['.$inc.']['.$idw.']" name="task['.$lines[$i]->id.']['.$idw.']" value="" cols="2" maxlength="5"'; $tableCell.='+';
$tableCell.='<input type="text" class="center" size="2" id="timeadded['.$inc.']['.$idw.']" name="task['.$lines[$i]->id.']['.$idw.']" value="" cols="2" maxlength="5"';
$tableCell.=' onkeypress="return regexEvent(this,event,\'timeChar\')"'; $tableCell.=' onkeypress="return regexEvent(this,event,\'timeChar\')"';
$tableCell.= 'onblur="regexEvent(this,event,\''.$modeinput.'\'); updateTotal('.$idw.',\''.$modeinput.'\')" />'; $tableCell.= 'onblur="regexEvent(this,event,\''.$modeinput.'\'); updateTotal('.$idw.',\''.$modeinput.'\')" />';
$tableCell.='</td>'; $tableCell.='</td>';
@ -790,7 +793,7 @@ function projectLinesPerDay(&$inc, $parent, $lines, &$level, &$projectsrole, &$t
$inc++; $inc++;
$level++; $level++;
if ($lines[$i]->id) projectLinesPerDay($inc, $lines[$i]->id, $lines, $level, $projectsrole, $tasksrole, $mine, $restricteditformytask); if ($lines[$i]->id) projectLinesPerWeek($inc, $firstdaytoshow, $fuser, $lines[$i]->id, $lines, $level, $projectsrole, $tasksrole, $mine, $restricteditformytask);
$level--; $level--;
} }
else else

View File

@ -31,7 +31,7 @@
* @param array $fulltree Array of entries in correct order * @param array $fulltree Array of entries in correct order
* @param string $key Key of entry into fulltree to show picto * @param string $key Key of entry into fulltree to show picto
* @param int $silent Do not output indent and picto, returns only value * @param int $silent Do not output indent and picto, returns only value
* @return array array(0 or 1 if at least one of this level after, 0 or 1 if at least one of higher level after, nbofdirinsub, nbofdocinsub) * @return integer[] array(0 or 1 if at least one of this level after, 0 or 1 if at least one of higher level after, nbofdirinsub, nbofdocinsub)
*/ */
function tree_showpad(&$fulltree,$key,$silent=0) function tree_showpad(&$fulltree,$key,$silent=0)
{ {

View File

@ -244,12 +244,12 @@ insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, left
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->projet->enabled', __HANDLER__, 'left', 3700__+MAX_llx_menu__, 'project', '', 7__+MAX_llx_menu__, '/projet/activity/index.php?leftmenu=projects', 'Activities', 0, 'projects', '$user->rights->projet->lire', '', 2, 0, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->projet->enabled', __HANDLER__, 'left', 3700__+MAX_llx_menu__, 'project', '', 7__+MAX_llx_menu__, '/projet/activity/index.php?leftmenu=projects', 'Activities', 0, 'projects', '$user->rights->projet->lire', '', 2, 0, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->projet->enabled', __HANDLER__, 'left', 3701__+MAX_llx_menu__, 'project', '', 3700__+MAX_llx_menu__, '/projet/tasks.php?leftmenu=projects&amp;action=create', 'NewTask', 1, 'projects', '$user->rights->projet->creer', '', 2, 1, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->projet->enabled', __HANDLER__, 'left', 3701__+MAX_llx_menu__, 'project', '', 3700__+MAX_llx_menu__, '/projet/tasks.php?leftmenu=projects&amp;action=create', 'NewTask', 1, 'projects', '$user->rights->projet->creer', '', 2, 1, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->projet->enabled', __HANDLER__, 'left', 3702__+MAX_llx_menu__, 'project', '', 3700__+MAX_llx_menu__, '/projet/tasks/index.php?leftmenu=projects', 'List', 1, 'projects', '$user->rights->projet->lire', '', 2, 2, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->projet->enabled', __HANDLER__, 'left', 3702__+MAX_llx_menu__, 'project', '', 3700__+MAX_llx_menu__, '/projet/tasks/index.php?leftmenu=projects', 'List', 1, 'projects', '$user->rights->projet->lire', '', 2, 2, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->projet->enabled', __HANDLER__, 'left', 3703__+MAX_llx_menu__, 'project', '', 3700__+MAX_llx_menu__, '/projet/activity/perday.php?leftmenu=projects', 'NewTimeSpent', 1, 'projects', '$user->rights->projet->lire', '', 2, 3, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->projet->enabled', __HANDLER__, 'left', 3703__+MAX_llx_menu__, 'project', '', 3700__+MAX_llx_menu__, '/projet/activity/perweek.php?leftmenu=projects', 'NewTimeSpent', 1, 'projects', '$user->rights->projet->lire', '', 2, 3, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->projet->enabled', __HANDLER__, 'left', 3800__+MAX_llx_menu__, 'project', '', 7__+MAX_llx_menu__, '/projet/activity/index.php?leftmenu=projects&amp;mode=mine', 'MyActivities', 0, 'projects', '$user->rights->projet->lire', '', 2, 0, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->projet->enabled', __HANDLER__, 'left', 3800__+MAX_llx_menu__, 'project', '', 7__+MAX_llx_menu__, '/projet/activity/index.php?leftmenu=projects&amp;mode=mine', 'MyActivities', 0, 'projects', '$user->rights->projet->lire', '', 2, 0, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->projet->enabled', __HANDLER__, 'left', 3801__+MAX_llx_menu__, 'project', '', 3800__+MAX_llx_menu__, '/projet/tasks.php?leftmenu=projects&amp;action=create&amp;mode=mine', 'NewTask', 1, 'projects', '$user->rights->projet->creer', '', 2, 1, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->projet->enabled', __HANDLER__, 'left', 3801__+MAX_llx_menu__, 'project', '', 3800__+MAX_llx_menu__, '/projet/tasks.php?leftmenu=projects&amp;action=create&amp;mode=mine', 'NewTask', 1, 'projects', '$user->rights->projet->creer', '', 2, 1, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->projet->enabled', __HANDLER__, 'left', 3802__+MAX_llx_menu__, 'project', '', 3800__+MAX_llx_menu__, '/projet/tasks/index.php?leftmenu=projects&amp;mode=mine', 'List', 1, 'projects', '$user->rights->projet->lire', '', 2, 2, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->projet->enabled', __HANDLER__, 'left', 3802__+MAX_llx_menu__, 'project', '', 3800__+MAX_llx_menu__, '/projet/tasks/index.php?leftmenu=projects&amp;mode=mine', 'List', 1, 'projects', '$user->rights->projet->lire', '', 2, 2, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->projet->enabled', __HANDLER__, 'left', 3803__+MAX_llx_menu__, 'project', '', 3800__+MAX_llx_menu__, '/projet/activity/perday.php?leftmenu=projects&amp;mode=mine', 'NewTimeSpent', 1, 'projects', '$user->rights->projet->lire', '', 2, 3, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->projet->enabled', __HANDLER__, 'left', 3803__+MAX_llx_menu__, 'project', '', 3800__+MAX_llx_menu__, '/projet/activity/perweek.php?leftmenu=projects&amp;mode=mine', 'NewTimeSpent', 1, 'projects', '$user->rights->projet->lire', '', 2, 3, __ENTITY__);
-- Tools -- Tools
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->mailing->enabled', __HANDLER__, 'left', 3900__+MAX_llx_menu__, 'tools', 'mailing', 8__+MAX_llx_menu__, '/comm/mailing/index.php?leftmenu=mailing', 'EMailings', 0, 'mails', '$user->rights->mailing->lire', '', 0, 0, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->mailing->enabled', __HANDLER__, 'left', 3900__+MAX_llx_menu__, 'tools', 'mailing', 8__+MAX_llx_menu__, '/comm/mailing/index.php?leftmenu=mailing', 'EMailings', 0, 'mails', '$user->rights->mailing->lire', '', 0, 0, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->mailing->enabled', __HANDLER__, 'left', 3901__+MAX_llx_menu__, 'tools', '', 3900__+MAX_llx_menu__, '/comm/mailing/card.php?leftmenu=mailing&amp;action=create', 'NewMailing', 1, 'mails', '$user->rights->mailing->creer', '', 0, 0, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->mailing->enabled', __HANDLER__, 'left', 3901__+MAX_llx_menu__, 'tools', '', 3900__+MAX_llx_menu__, '/comm/mailing/card.php?leftmenu=mailing&amp;action=create', 'NewMailing', 1, 'mails', '$user->rights->mailing->creer', '', 0, 0, __ENTITY__);

View File

@ -158,7 +158,7 @@ class MenuManager
* Show menu * Show menu
* *
* @param string $mode 'top', 'left', 'jmobile' * @param string $mode 'top', 'left', 'jmobile'
* @return void * @return string
*/ */
function showmenu($mode) function showmenu($mode)
{ {

View File

@ -1148,13 +1148,13 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu
$newmenu->add("/projet/activity/index.php?mode=mine", $langs->trans("MyActivities"), 0, $user->rights->projet->lire); $newmenu->add("/projet/activity/index.php?mode=mine", $langs->trans("MyActivities"), 0, $user->rights->projet->lire);
$newmenu->add("/projet/tasks.php?action=create&mode=mine", $langs->trans("NewTask"), 1, $user->rights->projet->creer); $newmenu->add("/projet/tasks.php?action=create&mode=mine", $langs->trans("NewTask"), 1, $user->rights->projet->creer);
$newmenu->add("/projet/tasks/index.php?mode=mine", $langs->trans("List"), 1, $user->rights->projet->lire); $newmenu->add("/projet/tasks/index.php?mode=mine", $langs->trans("List"), 1, $user->rights->projet->lire);
$newmenu->add("/projet/activity/perday.php?mode=mine", $langs->trans("NewTimeSpent"), 1, $user->rights->projet->creer); $newmenu->add("/projet/activity/perweek.php?mode=mine", $langs->trans("NewTimeSpent"), 1, $user->rights->projet->creer);
// All project i have permission on // All project i have permission on
$newmenu->add("/projet/activity/index.php", $langs->trans("Activities"), 0, $user->rights->projet->lire && $user->rights->projet->lire); $newmenu->add("/projet/activity/index.php", $langs->trans("Activities"), 0, $user->rights->projet->lire && $user->rights->projet->lire);
$newmenu->add("/projet/tasks.php?action=create", $langs->trans("NewTask"), 1, $user->rights->projet->creer && $user->rights->projet->creer); $newmenu->add("/projet/tasks.php?action=create", $langs->trans("NewTask"), 1, $user->rights->projet->creer && $user->rights->projet->creer);
$newmenu->add("/projet/tasks/index.php", $langs->trans("List"), 1, $user->rights->projet->lire && $user->rights->projet->lire); $newmenu->add("/projet/tasks/index.php", $langs->trans("List"), 1, $user->rights->projet->lire && $user->rights->projet->lire);
$newmenu->add("/projet/activity/perday.php", $langs->trans("NewTimeSpent"), 1, $user->rights->projet->creer && $user->rights->projet->creer); $newmenu->add("/projet/activity/perweek.php", $langs->trans("NewTimeSpent"), 1, $user->rights->projet->creer && $user->rights->projet->creer);
} }
} }
} }

View File

@ -112,7 +112,7 @@ class MenuManager
* Show menu * Show menu
* *
* @param string $mode 'top', 'left', 'jmobile' * @param string $mode 'top', 'left', 'jmobile'
* @return void * @return string
*/ */
function showmenu($mode) function showmenu($mode)
{ {

View File

@ -61,7 +61,7 @@ class MenuManager
* Show menu * Show menu
* *
* @param string $mode 'top', 'left', 'jmobile' * @param string $mode 'top', 'left', 'jmobile'
* @return void * @return string
*/ */
function showmenu($mode) function showmenu($mode)
{ {

View File

@ -303,7 +303,7 @@ class CommActionRapport
* @param PDF $pdf Object PDF * @param PDF $pdf Object PDF
* @param Translate $outputlangs Object lang for output * @param Translate $outputlangs Object lang for output
* @param int $pagenb Page nb * @param int $pagenb Page nb
* @return void * @return integer
*/ */
function _pagehead(&$pdf, $outputlangs, $pagenb) function _pagehead(&$pdf, $outputlangs, $pagenb)
{ {

View File

@ -108,7 +108,7 @@ class modPhpbarcode extends ModeleBarCode
* @param string $code Value to encode * @param string $code Value to encode
* @param string $encoding Mode of encoding * @param string $encoding Mode of encoding
* @param string $readable Code can be read * @param string $readable Code can be read
* @param string $scale Scale * @param integer $scale Scale
* @return int <0 if KO, >0 if OK * @return int <0 if KO, >0 if OK
*/ */
function buildBarCode($code,$encoding,$readable='Y',$scale=1) function buildBarCode($code,$encoding,$readable='Y',$scale=1)
@ -148,7 +148,7 @@ class modPhpbarcode extends ModeleBarCode
* @param string $code Value to encode * @param string $code Value to encode
* @param string $encoding Mode of encoding * @param string $encoding Mode of encoding
* @param string $readable Code can be read * @param string $readable Code can be read
* @param string $scale Scale * @param integer $scale Scale
* @return int <0 if KO, >0 if OK * @return int <0 if KO, >0 if OK
*/ */
function writeBarCode($code,$encoding,$readable='Y',$scale=1) function writeBarCode($code,$encoding,$readable='Y',$scale=1)

View File

@ -42,7 +42,7 @@ abstract class ModeleChequeReceipts extends CommonDocGenerator
* Return list of active generation modules * Return list of active generation modules
* *
* @param DoliDB $db Database handler * @param DoliDB $db Database handler
* @param string $maxfilenamelength Max length of value to show * @param integer $maxfilenamelength Max length of value to show
* @return array List of templates * @return array List of templates
*/ */
static function liste_modeles($db,$maxfilenamelength=0) static function liste_modeles($db,$maxfilenamelength=0)

View File

@ -74,7 +74,7 @@ class ExportCsv extends ModeleExports
/** /**
* getDriverId * getDriverId
* *
* @return int * @return string
*/ */
function getDriverId() function getDriverId()
{ {

View File

@ -76,7 +76,7 @@ class ExportExcel extends ModeleExports
/** /**
* getDriverId * getDriverId
* *
* @return int * @return string
*/ */
function getDriverId() function getDriverId()
{ {

View File

@ -69,7 +69,7 @@ class ExportTsv extends ModeleExports
/** /**
* getDriverId * getDriverId
* *
* @return int * @return string
*/ */
function getDriverId() function getDriverId()
{ {

View File

@ -657,7 +657,7 @@ class pdf_soleil extends ModelePDFFicheinter
* @param Object $object Object to show * @param Object $object Object to show
* @param Translate $outputlangs Object lang for output * @param Translate $outputlangs Object lang for output
* @param int $hidefreetext 1=Hide free text * @param int $hidefreetext 1=Hide free text
* @return void * @return integer
*/ */
function _pagefoot(&$pdf,$object,$outputlangs,$hidefreetext=0) function _pagefoot(&$pdf,$object,$outputlangs,$hidefreetext=0)
{ {

View File

@ -41,7 +41,7 @@ abstract class ModelePDFFicheinter extends CommonDocGenerator
* Return list of active generation modules * Return list of active generation modules
* *
* @param DoliDB $db Database handler * @param DoliDB $db Database handler
* @param string $maxfilenamelength Max length of value to show * @param integer $maxfilenamelength Max length of value to show
* @return array List of templates * @return array List of templates
*/ */
static function liste_modeles($db,$maxfilenamelength=0) static function liste_modeles($db,$maxfilenamelength=0)

View File

@ -88,7 +88,7 @@ class ImportCsv extends ModeleImports
/** /**
* getDriverId * getDriverId
* *
* @return int Id * @return string Id
*/ */
function getDriverId() function getDriverId()
{ {
@ -305,7 +305,7 @@ class ImportCsv extends ModeleImports
/** /**
* Close file handle * Close file handle
* *
* @return void * @return integer
*/ */
function import_close_file() function import_close_file()
{ {

View File

@ -62,7 +62,7 @@ class MailingTargets // This can't be abstract as it is used for some method
/** /**
* Return number of records for email selector * Return number of records for email selector
* *
* @return string Example * @return integer Example
*/ */
function getNbOfRecords() function getNbOfRecords()
{ {

View File

@ -57,7 +57,7 @@ class mailing_pomme extends MailingTargets
* array of SQL request that returns two field: * array of SQL request that returns two field:
* One called "label", One called "nb". * One called "label", One called "nb".
* *
* @return array Array with SQL requests * @return string[] Array with SQL requests
*/ */
function getSqlArrayForStats() function getSqlArrayForStats()
{ {

View File

@ -41,7 +41,7 @@ class ModelePDFCards
* Return list of active generation modules * Return list of active generation modules
* *
* @param DoliDB $db Database handler * @param DoliDB $db Database handler
* @param string $maxfilenamelength Max length of value to show * @param integer $maxfilenamelength Max length of value to show
* @return array List of templates * @return array List of templates
*/ */
function liste_modeles($db,$maxfilenamelength=0) function liste_modeles($db,$maxfilenamelength=0)

View File

@ -21,7 +21,7 @@
*/ */
/** /**
* \defgroup askpricesupplier Module to request supplier price proposals * \defgroup askpricesupplier Module askpricesupplier
* \brief Module to request supplier price proposals * \brief Module to request supplier price proposals
* \file htdocs/core/modules/modAskPriceSupplier.class.php * \file htdocs/core/modules/modAskPriceSupplier.class.php
* \ingroup askpricesupplier * \ingroup askpricesupplier

View File

@ -17,14 +17,13 @@
*/ */
/** /**
* \defgroup Indicateurs * \defgroup expensereport Module expensereport
* \brief Module indicateurs * \brief Module to manage expense report. Replace old module Deplacement.
* Such a file must be copied into htdocs/includes/module directory.
*/ */
/** /**
* \file htdocs/indicateurs/core/modules/modExpenseReport.class.php * \file htdocs/core/modules/modExpenseReport.class.php
* \ingroup indicateur * \ingroup expensereport
* \brief Description and activation file for module ExpenseReport * \brief Description and activation file for module ExpenseReport
*/ */
include_once(DOL_DOCUMENT_ROOT ."/core/modules/DolibarrModules.class.php"); include_once(DOL_DOCUMENT_ROOT ."/core/modules/DolibarrModules.class.php");

View File

@ -17,7 +17,7 @@
*/ */
/** /**
* \defgroup ftp Module FTP * \defgroup ftp Module ftp
* \brief Module for FTP client module * \brief Module for FTP client module
* \file htdocs/core/modules/modFTP.class.php * \file htdocs/core/modules/modFTP.class.php
* \ingroup ftp * \ingroup ftp

View File

@ -21,7 +21,7 @@
*/ */
/** /**
* \defgroup ficheinter Module intervention cards * \defgroup ficheinter Module Interventions
* \brief Module to manage intervention cards * \brief Module to manage intervention cards
* \file htdocs/core/modules/modFicheinter.class.php * \file htdocs/core/modules/modFicheinter.class.php
* \ingroup ficheinter * \ingroup ficheinter

View File

@ -16,7 +16,7 @@
*/ */
/** /**
* \defgroup geoip Module GeoIP * \defgroup geoip Module geoipmaxmind
* \brief Module to make geoip conversions * \brief Module to make geoip conversions
* \file htdocs/core/modules/modGeoIPMaxmind.class.php * \file htdocs/core/modules/modGeoIPMaxmind.class.php
* \ingroup geoip * \ingroup geoip

View File

@ -17,7 +17,7 @@
*/ */
/** /**
* \defgroup resource Resource module * \defgroup resource Module resource
* \brief Resource module descriptor. * \brief Resource module descriptor.
* \file core/modules/modResource.class.php * \file core/modules/modResource.class.php
* \ingroup resource * \ingroup resource

View File

@ -41,7 +41,7 @@ class ModelePDFLabels
* Return list of active generation modules * Return list of active generation modules
* *
* @param DoliDB $db Database handler * @param DoliDB $db Database handler
* @param string $maxfilenamelength Max length of value to show * @param integer $maxfilenamelength Max length of value to show
* @return array List of templates * @return array List of templates
*/ */
function liste_modeles($db,$maxfilenamelength=0) function liste_modeles($db,$maxfilenamelength=0)

View File

@ -28,6 +28,7 @@ require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
require_once DOL_DOCUMENT_ROOT.'/projet/class/task.class.php'; require_once DOL_DOCUMENT_ROOT.'/projet/class/task.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/pdf.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/pdf.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
/** /**
@ -77,6 +78,7 @@ class pdf_baleine extends ModelePDFProjects
// Defini position des colonnes // Defini position des colonnes
$this->posxref=$this->marge_gauche+1; $this->posxref=$this->marge_gauche+1;
$this->posxlabel=$this->marge_gauche+25; $this->posxlabel=$this->marge_gauche+25;
$this->posxworkload=$this->marge_gauche+100;
$this->posxprogress=$this->marge_gauche+140; $this->posxprogress=$this->marge_gauche+140;
$this->posxdatestart=$this->marge_gauche+150; $this->posxdatestart=$this->marge_gauche+150;
$this->posxdateend=$this->marge_gauche+170; $this->posxdateend=$this->marge_gauche+170;
@ -216,20 +218,22 @@ class pdf_baleine extends ModelePDFProjects
$progress=$object->lines[$i]->progress.'%'; $progress=$object->lines[$i]->progress.'%';
$datestart=dol_print_date($object->lines[$i]->date_start,'day'); $datestart=dol_print_date($object->lines[$i]->date_start,'day');
$dateend=dol_print_date($object->lines[$i]->date_end,'day'); $dateend=dol_print_date($object->lines[$i]->date_end,'day');
$planned_workload=convertSecondToTime($object->lines[$i]->planned_workload,'allhourmin');
$pdf->SetFont('','', $default_font_size - 1); // Dans boucle pour gerer multi-page $pdf->SetFont('','', $default_font_size - 1); // Dans boucle pour gerer multi-page
$pdf->SetXY($this->posxref, $curY); $pdf->SetXY($this->posxref, $curY);
$pdf->MultiCell(60, 3, $outputlangs->convToOutputCharset($ref), 0, 'L'); $pdf->MultiCell($this->posxlabel-$this->posxref, 3, $outputlangs->convToOutputCharset($ref), 0, 'L');
$pdf->SetXY($this->posxlabel, $curY); $pdf->SetXY($this->posxlabel, $curY);
$pdf->MultiCell(108, 3, $outputlangs->convToOutputCharset($libelleline), 0, 'L'); $pdf->MultiCell($this->posxworkload-$this->posxlabel, 3, $outputlangs->convToOutputCharset($libelleline), 0, 'L');
$pdf->SetXY($this->posxworkload, $curY);
$pdf->MultiCell($this->posxprogress-$this->posxworkload, 3, $planned_workload, 0, 'R');
$pdf->SetXY($this->posxprogress, $curY); $pdf->SetXY($this->posxprogress, $curY);
$pdf->MultiCell(16, 3, $progress, 0, 'L'); $pdf->MultiCell($this->posxdatestart-$this->posxprogress, 3, $progress, 0, 'R');
$pdf->SetXY($this->posxdatestart, $curY); $pdf->SetXY($this->posxdatestart, $curY);
$pdf->MultiCell(20, 3, $datestart, 0, 'L'); $pdf->MultiCell($this->posxdateend-$this->posxdatestart, 3, $datestart, 0, 'C');
$pdf->SetXY($this->posxdateend, $curY); $pdf->SetXY($this->posxdateend, $curY);
$pdf->MultiCell(20, 3, $dateend, 0, 'L'); $pdf->MultiCell($this->page_largeur-$this->marge_droite-$this->posxdateend, 3, $dateend, 0, 'C');
$pageposafter=$pdf->getPage(); $pageposafter=$pdf->getPage();
@ -362,8 +366,23 @@ class pdf_baleine extends ModelePDFProjects
$pdf->SetTextColor(0,0,0); $pdf->SetTextColor(0,0,0);
$pdf->SetFont('','', $default_font_size); $pdf->SetFont('','', $default_font_size);
$pdf->SetXY($this->posxref-1, $tab_top+2); $pdf->SetXY($this->posxref, $tab_top+1);
$pdf->MultiCell(80,2, $outputlangs->transnoentities("Tasks"),'','L'); $pdf->MultiCell($this->posxlabel-$this->posxref,3, $outputlangs->transnoentities("Tasks"),'','L');
$pdf->SetXY($this->posxlabel, $tab_top+1);
$pdf->MultiCell($this->posxworkload-$this->posxlabel, 3, $outputlangs->transnoentities("Description"), 0, 'L');
$pdf->SetXY($this->posxworkload, $tab_top+1);
$pdf->MultiCell($this->posxprogress-$this->posxworkload, 3, $outputlangs->transnoentities("PlannedWorkloadShort"), 0, 'R');
$pdf->SetXY($this->posxprogress, $tab_top+1);
$pdf->MultiCell($this->posxdatestart-$this->posxprogress, 3, '%', 0, 'R');
$pdf->SetXY($this->posxdatestart, $tab_top+1);
$pdf->MultiCell($this->posxdateend-$this->posxdatestart, 3, '', 0, 'C');
$pdf->SetXY($this->posxdateend, $tab_top+1);
$pdf->MultiCell($this->page_largeur - $this->marge_droite - $this->posxdatestart, 3, '', 0, 'C');
} }
@ -371,7 +390,7 @@ class pdf_baleine extends ModelePDFProjects
* Show top header of page. * Show top header of page.
* *
* @param PDF $pdf Object PDF * @param PDF $pdf Object PDF
* @param Object $object Object to show * @param Project $object Object to show
* @param int $showaddress 0=no, 1=yes * @param int $showaddress 0=no, 1=yes
* @param Translate $outputlangs Object lang for output * @param Translate $outputlangs Object lang for output
* @return void * @return void
@ -457,10 +476,10 @@ class pdf_baleine extends ModelePDFProjects
* Show footer of page. Need this->emetteur object * Show footer of page. Need this->emetteur object
* *
* @param PDF $pdf PDF * @param PDF $pdf PDF
* @param Object $object Object to show * @param Project $object Object to show
* @param Translate $outputlangs Object lang for output * @param Translate $outputlangs Object lang for output
* @param int $hidefreetext 1=Hide free text * @param int $hidefreetext 1=Hide free text
* @return void * @return integer
*/ */
function _pagefoot(&$pdf,$object,$outputlangs,$hidefreetext=0) function _pagefoot(&$pdf,$object,$outputlangs,$hidefreetext=0)
{ {

View File

@ -38,7 +38,7 @@ abstract class ModelePDFProjects extends CommonDocGenerator
* Return list of active generation modules * Return list of active generation modules
* *
* @param DoliDB $db Database handler * @param DoliDB $db Database handler
* @param string $maxfilenamelength Max length of value to show * @param integer $maxfilenamelength Max length of value to show
* @return array List of templates * @return array List of templates
*/ */
static function liste_modeles($db,$maxfilenamelength=0) static function liste_modeles($db,$maxfilenamelength=0)
@ -145,7 +145,7 @@ abstract class ModeleNumRefProjects
* Create an intervention document on disk using template defined into PROJECT_ADDON_PDF * Create an intervention document on disk using template defined into PROJECT_ADDON_PDF
* *
* @param DoliDB $db objet base de donnee * @param DoliDB $db objet base de donnee
* @param Object $object Object fichinter * @param Project $object Object fichinter
* @param string $modele force le modele a utiliser ('' par defaut) * @param string $modele force le modele a utiliser ('' par defaut)
* @param Translate $outputlangs objet lang a utiliser pour traduction * @param Translate $outputlangs objet lang a utiliser pour traduction
* @param int $hidedetails Hide details of lines * @param int $hidedetails Hide details of lines

View File

@ -106,7 +106,7 @@ class doc_generic_task_odt extends ModelePDFTask
/** /**
* Define array with couple substitution key => substitution value * Define array with couple substitution key => substitution value
* *
* @param Object $object Main object to use as data source * @param Project $object Main object to use as data source
* @param Translate $outputlangs Lang object to use for output * @param Translate $outputlangs Lang object to use for output
* @return array Array of substitution * @return array Array of substitution
*/ */

View File

@ -39,7 +39,7 @@ abstract class ModelePDFTask extends CommonDocGenerator
* Return list of active generation modules * Return list of active generation modules
* *
* @param DoliDB $db Database handler * @param DoliDB $db Database handler
* @param string $maxfilenamelength Max length of value to show * @param integer $maxfilenamelength Max length of value to show
* @return array List of templates * @return array List of templates
*/ */
static function liste_modeles($db,$maxfilenamelength=0) static function liste_modeles($db,$maxfilenamelength=0)
@ -145,7 +145,7 @@ abstract class ModeleNumRefTask
* Create an intervention document on disk using template defined into PROJECT_TASK_ADDON_PDF * Create an intervention document on disk using template defined into PROJECT_TASK_ADDON_PDF
* *
* @param DoliDB $db objet base de donnee * @param DoliDB $db objet base de donnee
* @param Object $object Object fichinter * @param Task $object Object fichinter
* @param string $modele force le modele a utiliser ('' par defaut) * @param string $modele force le modele a utiliser ('' par defaut)
* @param Translate $outputlangs objet lang a utiliser pour traduction * @param Translate $outputlangs objet lang a utiliser pour traduction
* @param int $hidedetails Hide details of lines * @param int $hidedetails Hide details of lines

View File

@ -45,8 +45,8 @@ class mod_codecompta_aquarium extends ModeleAccountancyCode
function __construct() function __construct()
{ {
global $conf; global $conf;
if (empty($conf->global->COMPANY_AQUARIUM_MASK_CUSTOMER)) $conf->global->COMPANY_AQUARIUM_MASK_CUSTOMER='411'; if (! isset($conf->global->COMPANY_AQUARIUM_MASK_CUSTOMER) || trim($conf->global->COMPANY_AQUARIUM_MASK_CUSTOMER) == '') $conf->global->COMPANY_AQUARIUM_MASK_CUSTOMER='411';
if (empty($conf->global->COMPANY_AQUARIUM_MASK_SUPPLIER)) $conf->global->COMPANY_AQUARIUM_MASK_SUPPLIER='401'; if (! isset($conf->global->COMPANY_AQUARIUM_MASK_SUPPLIER) || trim($conf->global->COMPANY_AQUARIUM_MASK_SUPPLIER) == '') $conf->global->COMPANY_AQUARIUM_MASK_SUPPLIER='401';
$this->prefixcustomeraccountancycode=$conf->global->COMPANY_AQUARIUM_MASK_CUSTOMER; $this->prefixcustomeraccountancycode=$conf->global->COMPANY_AQUARIUM_MASK_CUSTOMER;
$this->prefixsupplieraccountancycode=$conf->global->COMPANY_AQUARIUM_MASK_SUPPLIER; $this->prefixsupplieraccountancycode=$conf->global->COMPANY_AQUARIUM_MASK_SUPPLIER;
} }

View File

@ -554,7 +554,7 @@ class pdf_muscadet extends ModelePDFSuppliersOrders
* Show payments table * Show payments table
* *
* @param PDF $pdf Object PDF * @param PDF $pdf Object PDF
* @param Object $object Object order * @param CommandeFournisseur $object Object order
* @param int $posy Position y in PDF * @param int $posy Position y in PDF
* @param Translate $outputlangs Object langs for output * @param Translate $outputlangs Object langs for output
* @return int <0 if KO, >0 if OK * @return int <0 if KO, >0 if OK
@ -569,10 +569,10 @@ class pdf_muscadet extends ModelePDFSuppliersOrders
* Show miscellaneous information (payment mode, payment term, ...) * Show miscellaneous information (payment mode, payment term, ...)
* *
* @param PDF $pdf Object PDF * @param PDF $pdf Object PDF
* @param Object $object Object to show * @param CommandeFournisseur $object Object to show
* @param int $posy Y * @param int $posy Y
* @param Translate $outputlangs Langs object * @param Translate $outputlangs Langs object
* @return void * @return integer
*/ */
function _tableau_info(&$pdf, $object, $posy, $outputlangs) function _tableau_info(&$pdf, $object, $posy, $outputlangs)
{ {
@ -938,7 +938,7 @@ class pdf_muscadet extends ModelePDFSuppliersOrders
* Show top header of page. * Show top header of page.
* *
* @param PDF $pdf Object PDF * @param PDF $pdf Object PDF
* @param Object $object Object to show * @param CommandeFournisseur $object Object to show
* @param int $showaddress 0=no, 1=yes * @param int $showaddress 0=no, 1=yes
* @param Translate $outputlangs Object lang for output * @param Translate $outputlangs Object lang for output
* @return void * @return void
@ -1139,7 +1139,7 @@ class pdf_muscadet extends ModelePDFSuppliersOrders
* Show footer of page. Need this->emetteur object * Show footer of page. Need this->emetteur object
* *
* @param PDF $pdf PDF * @param PDF $pdf PDF
* @param Object $object Object to show * @param CommandeFournisseur $object Object to show
* @param Translate $outputlangs Object lang for output * @param Translate $outputlangs Object lang for output
* @param int $hidefreetext 1=Hide free text * @param int $hidefreetext 1=Hide free text
* @return int Return height of bottom margin including footer text * @return int Return height of bottom margin including footer text

View File

@ -114,7 +114,7 @@ class mod_syslog_chromephp extends LogHandler implements LogHandlerInterface
* Output log content * Output log content
* *
* @param array $content Content to log * @param array $content Content to log
* @return void * @return null|false
*/ */
public function export($content) public function export($content)
{ {

View File

@ -111,7 +111,7 @@ class mod_syslog_firephp extends LogHandler implements LogHandlerInterface
* Output log content * Output log content
* *
* @param array $content Content to log * @param array $content Content to log
* @return void * @return null|false
*/ */
public function export($content) public function export($content)
{ {

View File

@ -274,7 +274,7 @@ else {
$newline = new PropaleLigne($this->db); $newline = new PropaleLigne($this->db);
} }
elseif ($this->table_element_line=='askpricesupplierdet') { elseif ($this->table_element_line=='askpricesupplierdet') {
$newline = new AskPriceSupplierLigne($this->db); $newline = new AskPriceSupplierLine($this->db);
} }
elseif ($this->table_element_line=='facturedet') { elseif ($this->table_element_line=='facturedet') {
$newline = new FactureLigne($this->db); $newline = new FactureLigne($this->db);

View File

@ -40,6 +40,7 @@ class InterfaceNotification extends DolibarrTriggers
'ORDER_VALIDATE', 'ORDER_VALIDATE',
'PROPAL_VALIDATE', 'PROPAL_VALIDATE',
'FICHINTER_VALIDATE', 'FICHINTER_VALIDATE',
'ORDER_SUPPLIER_VALIDATE',
'ORDER_SUPPLIER_APPROVE', 'ORDER_SUPPLIER_APPROVE',
'ORDER_SUPPLIER_REFUSE', 'ORDER_SUPPLIER_REFUSE',
'SHIPPING_VALIDATE' 'SHIPPING_VALIDATE'
@ -84,8 +85,8 @@ class InterfaceNotification extends DolibarrTriggers
$sql = "SELECT rowid, code, label, description, elementtype"; $sql = "SELECT rowid, code, label, description, elementtype";
$sql.= " FROM ".MAIN_DB_PREFIX."c_action_trigger"; $sql.= " FROM ".MAIN_DB_PREFIX."c_action_trigger";
$sql.= $this->db->order("elementtype, code"); $sql.= $this->db->order("rang, elementtype, code");
dol_syslog("Get list of notifications", LOG_DEBUG); dol_syslog("getListOfManagedEvents Get list of notifications", LOG_DEBUG);
$resql=$this->db->query($sql); $resql=$this->db->query($sql);
if ($resql) if ($resql)
{ {
@ -103,13 +104,14 @@ class InterfaceNotification extends DolibarrTriggers
{ {
//print 'xx'.$obj->code; //print 'xx'.$obj->code;
$element=$obj->elementtype; $element=$obj->elementtype;
// Exclude events if related module is disabled
if ($element == 'order_supplier' && empty($conf->fournisseur->enabled)) $qualified=0; if ($element == 'order_supplier' && empty($conf->fournisseur->enabled)) $qualified=0;
elseif ($element == 'invoice_supplier' && empty($conf->fournisseur->enabled)) $qualified=0; elseif ($element == 'invoice_supplier' && empty($conf->fournisseur->enabled)) $qualified=0;
elseif ($element == 'withdraw' && empty($conf->prelevement->enabled)) $qualified=0; elseif ($element == 'withdraw' && empty($conf->prelevement->enabled)) $qualified=0;
elseif ($element == 'shipping' && empty($conf->expedition->enabled)) $qualified=0; elseif ($element == 'shipping' && empty($conf->expedition->enabled)) $qualified=0;
elseif ($element == 'member' && empty($conf->adherent->enabled)) $qualified=0; elseif ($element == 'member' && empty($conf->adherent->enabled)) $qualified=0;
elseif (! in_array($element,array('order_supplier','invoice_supplier','withdraw','shipping','member')) elseif (! in_array($element,array('order_supplier','invoice_supplier','withdraw','shipping','member')) && empty($conf->$element->enabled)) $qualified=0;
&& empty($conf->$element->enabled)) $qualified=0;
} }
if ($qualified) if ($qualified)

View File

@ -934,7 +934,7 @@ else if ($id || $ref)
require_once DOL_DOCUMENT_ROOT .'/core/class/notify.class.php'; require_once DOL_DOCUMENT_ROOT .'/core/class/notify.class.php';
$notify=new Notify($db); $notify=new Notify($db);
$text.='<br>'; $text.='<br>';
$text.=$notify->confirmMessage('SHIPPING_VALIDATE',$object->socid); $text.=$notify->confirmMessage('SHIPPING_VALIDATE',$object->socid, $object);
} }
print $form->formconfirm($_SERVER['PHP_SELF'].'?id='.$object->id,$langs->trans('ValidateSending'),$text,'confirm_valid','',0,1); print $form->formconfirm($_SERVER['PHP_SELF'].'?id='.$object->id,$langs->trans('ValidateSending'),$text,'confirm_valid','',0,1);

View File

@ -20,6 +20,7 @@
/** /**
* \file htdocs/expensereport/ajax/ajaxprojet.php * \file htdocs/expensereport/ajax/ajaxprojet.php
* \ingroup expensereport
* \brief File to return Ajax response on third parties request * \brief File to return Ajax response on third parties request
*/ */

View File

@ -19,7 +19,8 @@
/** /**
* \file htdocs/expensereport/card.php * \file htdocs/expensereport/card.php
* \brief Page for trip and expense card * \ingroup expensereport
* \brief Page for trip and expense report card
*/ */
$res=0; $res=0;

View File

@ -16,6 +16,11 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
/**
* \file htdocs/expensereport/class/expensereport.class.php
* \ingroup expensereport
* \brief File to manage Expense Reports
*/
require_once DOL_DOCUMENT_ROOT .'/core/class/commonobject.class.php'; require_once DOL_DOCUMENT_ROOT .'/core/class/commonobject.class.php';
/** /**

View File

@ -19,7 +19,7 @@
/** /**
* \file htdocs/expensereport/class/expensereportstats.class.php * \file htdocs/expensereport/class/expensereportstats.class.php
* \ingroup ExpenseReport * \ingroup expensereport
* \brief Fichier de la classe de gestion des stats des expensereport et notes de frais * \brief Fichier de la classe de gestion des stats des expensereport et notes de frais
*/ */
include_once DOL_DOCUMENT_ROOT . '/core/class/stats.class.php'; include_once DOL_DOCUMENT_ROOT . '/core/class/stats.class.php';

View File

@ -17,6 +17,7 @@
/** /**
* \file htdocs/expensereport/index.php * \file htdocs/expensereport/index.php
* \ingroup expensereport
* \brief Page list of expenses * \brief Page list of expenses
*/ */

View File

@ -21,6 +21,7 @@
/** /**
* \file htdocs/expensereport/index.php * \file htdocs/expensereport/index.php
* \ingroup expensereport
* \brief Page list of expenses * \brief Page list of expenses
*/ */

View File

@ -19,7 +19,7 @@
/** /**
* \file htdocs/expensereport/info.php * \file htdocs/expensereport/info.php
* \ingroup trip * \ingroup expensereport
* \brief Page to show a trip information * \brief Page to show a trip information
*/ */

View File

@ -21,6 +21,7 @@
/** /**
* \file htdocs/expensereport/index.php * \file htdocs/expensereport/index.php
* \ingroup expensereport
* \brief list of expense reports * \brief list of expense reports
*/ */

View File

@ -337,13 +337,15 @@ class Export
/** /**
* Build an input field used to filter the query * Build an input field used to filter the query
* *
* @param string $TypeField Type of Field to filter * @param string $TypeField Type of Field to filter. Example: Text, List:c_country:label:rowid, List:c_stcom:label:code, Number, Boolean
* @param string $NameField Name of the field to filter * @param string $NameField Name of the field to filter
* @param string $ValueField Initial value of the field to filter * @param string $ValueField Initial value of the field to filter
* @return string html string of the input field ex : "<input type=text name=... value=...>" * @return string html string of the input field ex : "<input type=text name=... value=...>"
*/ */
function build_filterField($TypeField, $NameField, $ValueField) function build_filterField($TypeField, $NameField, $ValueField)
{ {
global $langs;
$szFilterField=''; $szFilterField='';
$InfoFieldList = explode(":", $TypeField); $InfoFieldList = explode(":", $TypeField);
@ -354,7 +356,7 @@ class Export
case 'Date': case 'Date':
case 'Duree': case 'Duree':
case 'Numeric': case 'Numeric':
$szFilterField='<input type="text" name='.$NameField." value='".$ValueField."'>"; $szFilterField='<input type="text" name="'.$NameField.'" value="'.$ValueField.'">';
break; break;
case 'Boolean': case 'Boolean':
$szFilterField='<select name="'.$NameField.'" class="flat">'; $szFilterField='<select name="'.$NameField.'" class="flat">';
@ -375,12 +377,14 @@ class Export
// 0 : Type du champ // 0 : Type du champ
// 1 : Nom de la table // 1 : Nom de la table
// 2 : Nom du champ contenant le libelle // 2 : Nom du champ contenant le libelle
// 3 : Nom du champ contenant la cle (si different de rowid) // 3 : Name of field with key (if it is not "rowid"). Used this field as key for combo list.
if (count($InfoFieldList)==4) if (count($InfoFieldList)==4)
$keyList=$InfoFieldList[3]; $keyList=$InfoFieldList[3];
else else
$keyList='rowid'; $keyList='rowid';
$sql = 'SELECT '.$keyList.' as rowid, '.$InfoFieldList[2]; $sql = 'SELECT '.$keyList.' as rowid, '.$InfoFieldList[2].' as label'.(empty($InfoFieldList[3])?'':', '.$InfoFieldList[3].' as code');
if ($InfoFieldList[1] == 'c_stcomm') $sql = 'SELECT id as id, '.$keyList.' as rowid, '.$InfoFieldList[2].' as label'.(empty($InfoFieldList[3])?'':', '.$InfoFieldList[3].' as code');
if ($InfoFieldList[1] == 'c_country') $sql = 'SELECT '.$keyList.' as rowid, '.$InfoFieldList[2].' as label, code as code';
$sql.= ' FROM '.MAIN_DB_PREFIX .$InfoFieldList[1]; $sql.= ' FROM '.MAIN_DB_PREFIX .$InfoFieldList[1];
$resql = $this->db->query($sql); $resql = $this->db->query($sql);
@ -396,14 +400,25 @@ class Export
while ($i < $num) while ($i < $num)
{ {
$obj = $this->db->fetch_object($resql); $obj = $this->db->fetch_object($resql);
if ($obj->$InfoFieldList[2] == '-') if ($obj->label == '-')
{ {
// Discard entry '-' // Discard entry '-'
$i++; $i++;
continue; continue;
} }
//var_dump($InfoFieldList[1]);
$labeltoshow=dol_trunc($obj->$InfoFieldList[2],18); $labeltoshow=dol_trunc($obj->label,18);
if ($InfoFieldList[1] == 'c_stcomm')
{
$langs->load("companies");
$labeltoshow=(($langs->trans("StatusProspect".$obj->id) != "StatusProspect".$obj->id)?$langs->trans("StatusProspect".$obj->id):$obj->label);
}
if ($InfoFieldList[1] == 'c_country')
{
//var_dump($sql);
$langs->load("dict");
$labeltoshow=(($langs->trans("Country".$obj->code) != "Country".$obj->code)?$langs->trans("Country".$obj->code):$obj->label);
}
if (!empty($ValueField) && $ValueField == $obj->rowid) if (!empty($ValueField) && $ValueField == $obj->rowid)
{ {
$szFilterField.='<option value="'.$obj->rowid.'" selected="selected">'.$labeltoshow.'</option>'; $szFilterField.='<option value="'.$obj->rowid.'" selected="selected">'.$labeltoshow.'</option>';
@ -417,8 +432,9 @@ class Export
} }
$szFilterField.="</select>"; $szFilterField.="</select>";
$this->db->free(); $this->db->free($resql);
} }
else dol_print_error($this->db);
break; break;
} }

View File

@ -1210,7 +1210,9 @@ else if ($id > 0 || ! empty($ref))
if (!$formconfirm) if (!$formconfirm)
{ {
$parameters=array('lineid'=>$lineid); $parameters=array('lineid'=>$lineid);
$formconfirm=$hookmanager->executeHooks('formConfirm',$parameters,$object,$action); // Note that $action and $object may have been modified by hook $reshook = $hookmanager->executeHooks('formConfirm', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
if (empty($reshook)) $formconfirm.=$hookmanager->resPrint;
elseif ($reshook > 0) $formconfirm=$hookmanager->resPrint;
} }
// Print form confirm // Print form confirm

View File

@ -1657,7 +1657,7 @@ elseif (! empty($object->id))
require_once DOL_DOCUMENT_ROOT .'/core/class/notify.class.php'; require_once DOL_DOCUMENT_ROOT .'/core/class/notify.class.php';
$notify=new Notify($db); $notify=new Notify($db);
$text.='<br>'; $text.='<br>';
$text.=$notify->confirmMessage('ORDER_SUPPLIER_APPROVE', $object->socid); $text.=$notify->confirmMessage('ORDER_SUPPLIER_APPROVE', $object->socid, $object);
} }
$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('ValidateOrder'), $text, 'confirm_valid', '', 0, 1); $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('ValidateOrder'), $text, 'confirm_valid', '', 0, 1);
@ -1733,7 +1733,9 @@ elseif (! empty($object->id))
if (!$formconfirm) { if (!$formconfirm) {
$parameters=array('lineid'=>$lineid); $parameters=array('lineid'=>$lineid);
$formconfirm=$hookmanager->executeHooks('formConfirm',$parameters,$object,$action); // Note that $action and $object may have been modified by hook $reshook = $hookmanager->executeHooks('formConfirm', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
if (empty($reshook)) $formconfirm.=$hookmanager->resPrint;
elseif ($reshook > 0) $formconfirm=$hookmanager->resPrint;
} }
// Print form confirm // Print form confirm

View File

@ -1664,7 +1664,7 @@ else
require_once DOL_DOCUMENT_ROOT .'/core/class/notify.class.php'; require_once DOL_DOCUMENT_ROOT .'/core/class/notify.class.php';
$notify=new Notify($db); $notify=new Notify($db);
$text.='<br>'; $text.='<br>';
$text.=$notify->confirmMessage('BILL_SUPPLIER_VALIDATE',$object->socid); $text.=$notify->confirmMessage('BILL_SUPPLIER_VALIDATE',$object->socid, $object);
}*/ }*/
$formquestion=array(); $formquestion=array();
@ -1716,7 +1716,9 @@ else
if (!$formconfirm) { if (!$formconfirm) {
$parameters=array('lineid'=>$lineid); $parameters=array('lineid'=>$lineid);
$formconfirm=$hookmanager->executeHooks('formConfirm',$parameters,$object,$action); // Note that $action and $object may have been modified by hook $reshook = $hookmanager->executeHooks('formConfirm', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
if (empty($reshook)) $formconfirm.=$hookmanager->resPrint;
elseif ($reshook > 0) $formconfirm=$hookmanager->resPrint;
} }
// Print form confirm // Print form confirm

View File

@ -101,10 +101,10 @@ $sql = "SELECT s.rowid as socid, s.nom as name, s.zip, s.town, s.datec, st.libel
$sql.= "code_fournisseur, code_compta_fournisseur"; $sql.= "code_fournisseur, code_compta_fournisseur";
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 ";
// Add fields for extrafields // Add fields for extrafields
foreach ($extrafields->attribute_list as $key => $val) $sql.=",ef.".$key; foreach ($extrafields->attribute_list as $key => $val) $sql.=",ef.".$key.' as options_'.$key;
// Add fields from hooks // Add fields from hooks
$parameters=array(); $parameters=array();
$hookmanager->executeHooks('printFieldListSelect',$parameters); // Note that $action and $object may have been modified by hook $result=$hookmanager->executeHooks('printFieldListSelect',$parameters); // Note that $action and $object may have been modified by hook
$sql.=$hookmanager->resPrint; $sql.=$hookmanager->resPrint;
$sql.= " FROM ".MAIN_DB_PREFIX."societe as s"; $sql.= " FROM ".MAIN_DB_PREFIX."societe as s";
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe_extrafields as ef ON ef.fk_object = s.rowid"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe_extrafields as ef ON ef.fk_object = s.rowid";
@ -136,7 +136,8 @@ if ($search_categ > 0) $sql.= " AND cf.fk_categorie = ".$search_categ;
if ($search_categ == -2) $sql.= " AND cf.fk_categorie IS NULL"; if ($search_categ == -2) $sql.= " AND cf.fk_categorie IS NULL";
// Add where from hooks // Add where from hooks
$parameters=array(); $parameters=array();
$sql.=$hookmanager->executeHooks('printFieldListWhere',$parameters); // Note that $action and $object may have been modified by hook $result=$hookmanager->executeHooks('printFieldListWhere',$parameters); // Note that $action and $object may have been modified by hook
$sql.=$hookmanager->resPrint;
// Count total nb of records // Count total nb of records
$nbtotalofrecords = 0; $nbtotalofrecords = 0;
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
@ -186,11 +187,12 @@ if ($resql)
print_liste_field_titre($langs->trans("SupplierCode"),$_SERVER["PHP_SELF"],"s.code_fournisseur","",$param,'align="left"',$sortfield,$sortorder); print_liste_field_titre($langs->trans("SupplierCode"),$_SERVER["PHP_SELF"],"s.code_fournisseur","",$param,'align="left"',$sortfield,$sortorder);
print_liste_field_titre($langs->trans("AccountancyCode"),$_SERVER["PHP_SELF"],"s.code_compta_fournisseur","",$param,'align="left"',$sortfield,$sortorder); print_liste_field_titre($langs->trans("AccountancyCode"),$_SERVER["PHP_SELF"],"s.code_compta_fournisseur","",$param,'align="left"',$sortfield,$sortorder);
print_liste_field_titre($langs->trans("DateCreation"),$_SERVER["PHP_SELF"],"s.datec","",$param,'align="right"',$sortfield,$sortorder); print_liste_field_titre($langs->trans("DateCreation"),$_SERVER["PHP_SELF"],"s.datec","",$param,'align="right"',$sortfield,$sortorder);
print_liste_field_titre($langs->trans("Status"),$_SERVER["PHP_SELF"],"s.status","",$param,'align="right"',$sortfield,$sortorder);
$parameters=array(); $parameters=array();
$formconfirm=$hookmanager->executeHooks('printFieldListTitle',$parameters); // Note that $action and $object may have been modified by hook $reshook=$hookmanager->executeHooks('printFieldListTitle',$parameters); // Note that $action and $object may have been modified by hook
print $hookmanager->resPrint;
print_liste_field_titre($langs->trans("Status"),$_SERVER["PHP_SELF"],"s.status","",$param,'align="right"',$sortfield,$sortorder);
print "</tr>\n"; print "</tr>\n";
print '<tr class="liste_titre">'; print '<tr class="liste_titre">';
@ -213,13 +215,14 @@ if ($resql)
print '<input class="flat" type="text" size="10" name="search_datec" value="'.$search_datec.'">'; print '<input class="flat" type="text" size="10" name="search_datec" value="'.$search_datec.'">';
print '</td>'; print '</td>';
$parameters=array();
$reshook=$hookmanager->executeHooks('printFieldListSearch',$parameters); // Note that $action and $object may have been modified by hook
print $hookmanager->resPrint;
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")).'">';
print "</td></tr>\n"; print "</td></tr>\n";
$parameters=array();
$formconfirm=$hookmanager->executeHooks('printFieldListOption',$parameters); // Note that $action and $object may have been modified by hook
print '</tr>'; print '</tr>';
$var=True; $var=True;
@ -241,12 +244,13 @@ if ($resql)
print '<td>'.$obj->town.'</td>'."\n"; print '<td>'.$obj->town.'</td>'."\n";
print '<td align="left">'.$obj->code_fournisseur.'&nbsp;</td>'; print '<td align="left">'.$obj->code_fournisseur.'&nbsp;</td>';
print '<td align="left">'.$obj->code_compta_fournisseur.'&nbsp;</td>'; print '<td align="left">'.$obj->code_compta_fournisseur.'&nbsp;</td>';
print '<td align="right">'; print '<td align="right">'.dol_print_date($db->jdate($obj->datec),'day').'</td>';
print dol_print_date($db->jdate($obj->datec),'day').'</td>';
print '<td align="right">'.$thirdpartystatic->getLibStatut(3).'</td>';
$parameters=array('obj' => $obj); $parameters=array('obj' => $obj);
$formconfirm=$hookmanager->executeHooks('printFieldListValue',$parameters); // Note that $action and $object may have been modified by hook $reshook=$hookmanager->executeHooks('printFieldListValue',$parameters); // Note that $action and $object may have been modified by hook
print $hookmanager->resPrint;
print '<td align="right">'.$thirdpartystatic->getLibStatut(3).'</td>';
print "</tr>\n"; print "</tr>\n";
$i++; $i++;
@ -256,7 +260,8 @@ if ($resql)
$db->free($resql); $db->free($resql);
$parameters=array('sql' => $sql); $parameters=array('sql' => $sql);
$formconfirm=$hookmanager->executeHooks('printFieldListFooter',$parameters); // Note that $action and $object may have been modified by hook $reshook=$hookmanager->executeHooks('printFieldListFooter',$parameters); // Note that $action and $object may have been modified by hook
print $hookmanager->resPrint;
} }
else else
{ {

View File

@ -634,7 +634,7 @@ llxFooter();
* @param string $ftp_user FTP user * @param string $ftp_user FTP user
* @param string $ftp_password FTP password * @param string $ftp_password FTP password
* @param string $section Directory * @param string $section Directory
* @param string $ftp_passive Use a passive mode * @param integer $ftp_passive Use a passive mode
* @return int <0 if OK, >0 if KO * @return int <0 if OK, >0 if KO
*/ */
function dol_ftp_connect($ftp_server, $ftp_port, $ftp_user, $ftp_password, $section, $ftp_passive=0) function dol_ftp_connect($ftp_server, $ftp_port, $ftp_user, $ftp_password, $section, $ftp_passive=0)

View File

@ -1754,7 +1754,7 @@ function show_elem($fieldssource,$pos,$key,$var,$nostyle='')
* *
* @param array $fieldssource Array of field source * @param array $fieldssource Array of field source
* @param array $listofkey Array of keys * @param array $listofkey Array of keys
* @return void * @return integer
*/ */
function getnewkey(&$fieldssource,&$listofkey) function getnewkey(&$fieldssource,&$listofkey)
{ {

View File

@ -776,7 +776,7 @@ function write_master_file($masterfile,$main_dir)
* Save configuration file. No particular permissions are set by installer. * Save configuration file. No particular permissions are set by installer.
* *
* @param string $conffile Path to conf file to generate/update * @param string $conffile Path to conf file to generate/update
* @return void * @return integer
*/ */
function write_conf_file($conffile) function write_conf_file($conffile)
{ {

View File

@ -411,10 +411,10 @@ function pHeader($subtitle,$next,$action='set',$param='',$forcejqueryurl='')
/** /**
* Print HTML footer of install pages * Print HTML footer of install pages
* *
* @param string $nonext No button "Next step" * @param integer $nonext No button "Next step"
* @param string $setuplang Language code * @param string $setuplang Language code
* @param string $jscheckfunction Add a javascript check function * @param string $jscheckfunction Add a javascript check function
* @param string $withpleasewait Add also please wait tags * @param integer $withpleasewait Add also please wait tags
* @return void * @return void
*/ */
function pFooter($nonext=0,$setuplang='',$jscheckfunction='', $withpleasewait=0) function pFooter($nonext=0,$setuplang='',$jscheckfunction='', $withpleasewait=0)

View File

@ -31,8 +31,8 @@
-- --
delete from llx_c_stcomm; delete from llx_c_stcomm;
insert into llx_c_stcomm (id,code,libelle) values (-1, 'ST_NO', 'Ne pas contacter'); insert into llx_c_stcomm (id,code,libelle) values (-1, 'ST_NO', 'Do not contact');
insert into llx_c_stcomm (id,code,libelle) values ( 0, 'ST_NEVER', 'Jamais contacté'); insert into llx_c_stcomm (id,code,libelle) values ( 0, 'ST_NEVER', 'Never contacted');
insert into llx_c_stcomm (id,code,libelle) values ( 1, 'ST_TODO', 'A contacter'); insert into llx_c_stcomm (id,code,libelle) values ( 1, 'ST_TODO', 'To contact');
insert into llx_c_stcomm (id,code,libelle) values ( 2, 'ST_PEND', 'Contact en cours'); insert into llx_c_stcomm (id,code,libelle) values ( 2, 'ST_PEND', 'Contact in progress');
insert into llx_c_stcomm (id,code,libelle) values ( 3, 'ST_DONE', 'Contactée'); insert into llx_c_stcomm (id,code,libelle) values ( 3, 'ST_DONE', 'Contacted');

View File

@ -27,6 +27,9 @@ ALTER TABLE llx_payment_salary ADD COLUMN salary real after datev;
UPDATE llx_projet_task_time SET task_datehour = task_date where task_datehour IS NULL; UPDATE llx_projet_task_time SET task_datehour = task_date where task_datehour IS NULL;
ALTER TABLE llx_projet_task_time ADD COLUMN task_date_withhour integer DEFAULT 0 after task_datehour; ALTER TABLE llx_projet_task_time ADD COLUMN task_date_withhour integer DEFAULT 0 after task_datehour;
ALTER TABLE llx_projet_task MODIFY COLUMN duration_effective real DEFAULT 0 NULL;
ALTER TABLE llx_projet_task MODIFY COLUMN planned_workload real DEFAULT 0 NULL;
ALTER TABLE llx_commande_fournisseur MODIFY COLUMN date_livraison datetime; ALTER TABLE llx_commande_fournisseur MODIFY COLUMN date_livraison datetime;
@ -392,3 +395,43 @@ create table llx_payment_donation
fk_user_creat integer, -- creation user fk_user_creat integer, -- creation user
fk_user_modif integer -- last modification user fk_user_modif integer -- last modification user
)ENGINE=innodb; )ENGINE=innodb;
insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('BILL_VALIDATE','Customer invoice validated','Executed when a customer invoice is approved','facture',6);
insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('ORDER_SUPPLIER_APPROVE','Supplier order request approved','Executed when a supplier order is approved','order_supplier',12);
insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('ORDER_SUPPLIER_REFUSE','Supplier order request refused','Executed when a supplier order is refused','order_supplier',13);
insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('ORDER_VALIDATE','Customer order validate','Executed when a customer order is validated','commande',4);
insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('PROPAL_VALIDATE','Customer proposal validated','Executed when a commercial proposal is validated','propal',2);
insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('COMPANY_SENTBYMAIL','Mails sent from third party card','Executed when you send email from third party card','societe',1);
insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('COMPANY_CREATE','Third party created','Executed when a third party is created','societe',1);
insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('CONTRACT_VALIDATE','Contract validated','Executed when a contract is validated','contrat',18);
insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('PROPAL_SENTBYMAIL','Commercial proposal sent by mail','Executed when a commercial proposal is sent by mail','propal',3);
insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('ORDER_SENTBYMAIL','Customer order sent by mail','Executed when a customer order is sent by mail ','commande',5);
insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('BILL_PAYED','Customer invoice payed','Executed when a customer invoice is payed','facture',7);
insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('BILL_CANCEL','Customer invoice canceled','Executed when a customer invoice is conceled','facture',8);
insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('BILL_SENTBYMAIL','Customer invoice sent by mail','Executed when a customer invoice is sent by mail','facture',9);
insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('ORDER_SUPPLIER_VALIDATE','Supplier order validated','Executed when a supplier order is validated','order_supplier',11);
insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('ORDER_SUPPLIER_SENTBYMAIL','Supplier order sent by mail','Executed when a supplier order is sent by mail','order_supplier',14);
insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('BILL_SUPPLIER_VALIDATE','Supplier invoice validated','Executed when a supplier invoice is validated','invoice_supplier',15);
insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('BILL_SUPPLIER_PAYED','Supplier invoice payed','Executed when a supplier invoice is payed','invoice_supplier',16);
insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('BILL_SUPPLIER_SENTBYMAIL','Supplier invoice sent by mail','Executed when a supplier invoice is sent by mail','invoice_supplier',17);
insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('BILL_SUPPLIER_CANCELED','Supplier invoice cancelled','Executed when a supplier invoice is cancelled','invoice_supplier',17);
insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('SHIPPING_VALIDATE','Shipping validated','Executed when a shipping is validated','shipping',20);
insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('SHIPPING_SENTBYMAIL','Shipping sent by mail','Executed when a shipping is sent by mail','shipping',21);
insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('MEMBER_VALIDATE','Member validated','Executed when a member is validated','member',22);
insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('MEMBER_SUBSCRIPTION','Member subscribed','Executed when a member is subscribed','member',23);
insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('MEMBER_RESILIATE','Member resiliated','Executed when a member is resiliated','member',24);
insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('MEMBER_MODIFY','Member modified','Executed when a member is modified','member',24);
insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('MEMBER_DELETE','Member deleted','Executed when a member is deleted','member',25);
insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('BILL_UNVALIDATE','Customer invoice unvalidated','Executed when a customer invoice status set back to draft','facture',10);
insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('FICHINTER_VALIDATE','Intervention validated','Executed when a intervention is validated','ficheinter',19);
insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('FICHINTER_CLASSIFY_BILLED','Intervention set billed','Executed when a intervention is set to billed (when option FICHINTER_CLASSIFY_BILLED is set)','ficheinter',19);
insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('FICHINTER_CLASSIFY_UNBILLED','Intervention set unbilled','Executed when a intervention is set to unbilled (when option FICHINTER_CLASSIFY_BILLED is set)','ficheinter',19);
insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('FICHINTER_REOPEN','Intervention opened','Executed when a intervention is re-opened','ficheinter',19);
insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('FICHINTER_SENTBYMAIL','Intervention sent by mail','Executed when a intervention is sent by mail','ficheinter',19);
insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('PROJECT_CREATE','Project creation','Executed when a project is created','project',30);
insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('PROPAL_CLOSE_SIGNED','Customer proposal closed signed','Executed when a customer proposal is closed signed','propal',2);
insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('PROPAL_CLOSE_REFUSED','Customer proposal closed refused','Executed when a customer proposal is closed refused','propal',2);
insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('PROPAL_CLASSIFY_BILLED','Customer proposal set billed','Executed when a customer proposal is set to billed','propal',2);
insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('TASK_CREATE','Task created','Executed when a project task is created','project',35);
insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('TASK_MODIFY','Task modified','Executed when a project task is modified','project',36);
insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('TASK_DELETE','Task deleted','Executed when a project task is deleted','project',37);

View File

@ -22,9 +22,9 @@
create table llx_c_action_trigger create table llx_c_action_trigger
( (
rowid integer AUTO_INCREMENT PRIMARY KEY, rowid integer AUTO_INCREMENT PRIMARY KEY,
elementtype varchar(16) NOT NULL,
code varchar(32) NOT NULL, code varchar(32) NOT NULL,
label varchar(128) NOT NULL, label varchar(128) NOT NULL,
description varchar(255), description varchar(255),
elementtype varchar(16) NOT NULL,
rang integer DEFAULT 0 rang integer DEFAULT 0
)ENGINE=innodb; )ENGINE=innodb;

View File

@ -47,7 +47,7 @@ $ok = 0;
// Ne fonctionne que si on est pas en safe_mode. // Ne fonctionne que si on est pas en safe_mode.
$err=error_reporting(); $err=error_reporting();
error_reporting(0); error_reporting(0);
@set_time_limit(120); @set_time_limit(300);
error_reporting($err); error_reporting($err);

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