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:
commit
c4a580723d
@ -1,6 +1,6 @@
|
||||
[main]
|
||||
host = https://www.transifex.com
|
||||
lang_map = uz: uz_UZ
|
||||
lang_map = uz: uz_UZ, sw: sw_SW
|
||||
|
||||
[dolibarr.accountancy]
|
||||
file_filter = htdocs/langs/<lang>/accountancy.lang
|
||||
@ -146,6 +146,12 @@ source_file = htdocs/langs/en_US/holiday.lang
|
||||
source_lang = en_US
|
||||
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]
|
||||
file_filter = htdocs/langs/<lang>/install.lang
|
||||
source_file = htdocs/langs/en_US/install.lang
|
||||
|
||||
@ -31,7 +31,8 @@ WARNING: Following changes may create regression for some external modules, but
|
||||
Dolibarr better:
|
||||
- Removed hoo supplierorderdao into supplier order creation. This is a business event, so we must use the
|
||||
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.* *****
|
||||
|
||||
@ -32,13 +32,18 @@ then
|
||||
for dir in `find htdocs/langs/$3* -type d`
|
||||
do
|
||||
dirshort=`basename $dir`
|
||||
|
||||
#echo $dirshort
|
||||
|
||||
export aa=`echo $dirshort | nawk -F"_" '{ print $1 }'`
|
||||
export bb=`echo $dirshort | nawk -F"_" '{ print $2 }'`
|
||||
aaupper=`echo $dirshort | nawk -F"_" '{ print toupper($1) }'`
|
||||
if [ $aaupper = "EN" ]
|
||||
then
|
||||
aaupper="US"
|
||||
fi
|
||||
bblower=`echo $dirshort | nawk -F"_" '{ print tolower($2) }'`
|
||||
if [ "$aa" != "$bblower" ]
|
||||
if [ "$aa" != "$bblower" -a "$dirshort" != "en_US" ]
|
||||
then
|
||||
reflang="htdocs/langs/"$aa"_"$aaupper
|
||||
if [ -d $reflang ]
|
||||
@ -48,6 +53,15 @@ then
|
||||
echo ./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}/*.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
|
||||
done;
|
||||
|
||||
@ -60,6 +60,7 @@ $rc = 0;
|
||||
|
||||
$lPrimary = isset($argv[1])?$argv[1]:'';
|
||||
$lSecondary = isset($argv[2])?$argv[2]:'';
|
||||
$lEnglish = 'en_US';
|
||||
$filesToProcess = isset($argv[3])?$argv[3]:'';
|
||||
|
||||
if (empty($lPrimary) || empty($lSecondary) || empty($filesToProcess))
|
||||
@ -73,6 +74,7 @@ if (empty($lPrimary) || empty($lSecondary) || empty($filesToProcess))
|
||||
|
||||
$aPrimary = array();
|
||||
$aSecondary = array();
|
||||
$aEnglish = array();
|
||||
|
||||
// Define array $filesToProcess
|
||||
if ($filesToProcess == 'all')
|
||||
@ -96,6 +98,7 @@ foreach($filesToProcess as $fileToProcess)
|
||||
{
|
||||
$lPrimaryFile = 'htdocs/langs/'.$lPrimary.'/'.$fileToProcess;
|
||||
$lSecondaryFile = 'htdocs/langs/'.$lSecondary.'/'.$fileToProcess;
|
||||
$lEnglishFile = 'htdocs/langs/'.$lEnglish.'/'.$fileToProcess;
|
||||
$output = $lSecondaryFile . '.delta';
|
||||
|
||||
print "---- Process language file ".$lSecondaryFile."\n";
|
||||
@ -114,6 +117,13 @@ foreach($filesToProcess as $fileToProcess)
|
||||
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
|
||||
|
||||
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!
|
||||
|
||||
$arrayofkeytoalwayskeep=array('DIRECTION','FONTFORPDF','FONTSIZEFORPDF','SeparatorDecimal','SeparatorThousand');
|
||||
@ -246,7 +315,11 @@ foreach($filesToProcess as $fileToProcess)
|
||||
}
|
||||
|
||||
// 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";
|
||||
fwrite($oh, $key."=".(empty($aSecondary[$key])?$aPrimary[$key]:$aSecondary[$key])."\n");
|
||||
|
||||
@ -13,7 +13,7 @@ then
|
||||
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 " 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
|
||||
fi
|
||||
|
||||
@ -26,13 +26,21 @@ fi
|
||||
|
||||
if [ "x$1" = "xall" ]
|
||||
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
|
||||
echo "tx pull -l $fic $2 $3"
|
||||
tx pull -l $fic $2 $3
|
||||
fic=`basename $dir`
|
||||
if [ $fic != "en_US" ]
|
||||
then
|
||||
echo "tx pull -l $fic $2 $3"
|
||||
tx pull -l $fic $2 $3
|
||||
fi
|
||||
done
|
||||
cd -
|
||||
else
|
||||
echo "tx pull -l $1 $2 $3 $4"
|
||||
tx pull -l $1 $2 $3 $4
|
||||
echo "tx pull -l $1 $2 $3 $4 $5"
|
||||
tx pull -l $1 $2 $3 $4 $5
|
||||
fi
|
||||
|
||||
echo Think to launch also:
|
||||
echo "> dev/fixaltlanguages.sh fix all"
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/* 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
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@ -90,7 +90,7 @@ class Cotisation extends CommonObject
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->error=$this->db->error();
|
||||
$this->error=$this->db->lasterror();
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
@ -140,7 +140,7 @@ class Cotisation extends CommonObject
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->error=$this->db->error();
|
||||
$this->error=$this->db->lasterror();
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
@ -181,7 +181,7 @@ class Cotisation extends CommonObject
|
||||
else
|
||||
{
|
||||
$this->db->rollback();
|
||||
$this->error=$this->db->error();
|
||||
$this->error=$this->db->lasterror();
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
@ -217,7 +217,7 @@ class Cotisation extends CommonObject
|
||||
$result=$member->fetch($this->fk_adherent);
|
||||
$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
|
||||
if ($result > 0)
|
||||
|
||||
@ -622,9 +622,29 @@ else
|
||||
}
|
||||
|
||||
print '</table>';
|
||||
|
||||
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"> </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();
|
||||
|
||||
$db->close();
|
||||
|
||||
@ -229,7 +229,7 @@ $sql.= ", note";
|
||||
$sql.= ", entity";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."const";
|
||||
$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
|
||||
$sql.= " ORDER BY entity, name ASC";
|
||||
|
||||
|
||||
@ -171,7 +171,7 @@ else if ($action == 'setdoc')
|
||||
// on passe donc par une variable pour avoir un affichage coherent
|
||||
$conf->global->FACTURE_ADDON_PDF = $value;
|
||||
}
|
||||
|
||||
|
||||
// On active le modele
|
||||
$ret = delDocumentModel($value, $type);
|
||||
if ($ret > 0)
|
||||
@ -341,7 +341,7 @@ foreach ($dirmodels as $reldir)
|
||||
// Check if there is a filter on country
|
||||
preg_match('/\-(.*)_(.*)$/',$classname,$reg);
|
||||
if (! empty($reg[2]) && $reg[2] != strtoupper($mysoc->country_code)) continue;
|
||||
|
||||
|
||||
$classname = preg_replace('/\-.*$/','',$classname);
|
||||
if (! class_exists($classname) && is_readable($dir.$filebis) && (preg_match('/mod_/',$filebis) || preg_match('/mod_/',$classname)) && substr($filebis, dol_strlen($filebis)-3, 3) == 'php')
|
||||
{
|
||||
@ -416,7 +416,7 @@ foreach ($dirmodels as $reldir)
|
||||
$htmltooltip.=$langs->trans($module->error).'<br>';
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Example for credit invoice
|
||||
$facture->type=2;
|
||||
$nextval=$module->getNextValue($mysoc,$facture);
|
||||
@ -630,7 +630,6 @@ print '</table>';
|
||||
|
||||
/*
|
||||
* Modes de reglement
|
||||
*
|
||||
*/
|
||||
print '<br>';
|
||||
print_titre($langs->trans("SuggestedPaymentModesIfNotDefinedInInvoice"));
|
||||
@ -811,7 +810,27 @@ print '</tr>'."\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"> </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();
|
||||
|
||||
|
||||
@ -24,6 +24,7 @@
|
||||
*/
|
||||
|
||||
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/triggers/interface_50_modNotification_Notification.class.php';
|
||||
|
||||
@ -48,25 +49,56 @@ $action = GETPOST("action");
|
||||
|
||||
if ($action == 'setvalue' && $user->admin)
|
||||
{
|
||||
$db->begin();
|
||||
|
||||
$result=dolibarr_set_const($db, "NOTIFICATION_EMAIL_FROM", $_POST["email_from"], 'chaine', 0, '', $conf->entity);
|
||||
if ($result < 0) $error++;
|
||||
|
||||
if (! $error)
|
||||
{
|
||||
//var_dump($_POST);
|
||||
foreach($_POST as $key => $val)
|
||||
{
|
||||
if (! preg_match('/^NOTIFICATION_FIXEDEMAIL_/',$key)) continue;
|
||||
//print $key.' - '.$val.'<br>';
|
||||
$result=dolibarr_set_const($db, $key, $val, 'chaine', 0, '', $conf->entity);
|
||||
if (! preg_match('/^NOTIF_(.*)_key$/', $key, $reg)) continue;
|
||||
|
||||
$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)
|
||||
{
|
||||
$db->commit();
|
||||
|
||||
setEventMessage($langs->trans("SetupSaved"));
|
||||
}
|
||||
else
|
||||
{
|
||||
$db->rollback();
|
||||
|
||||
setEventMessage($langs->trans("Error"),'errors');
|
||||
}
|
||||
}
|
||||
@ -78,6 +110,7 @@ if ($action == 'setvalue' && $user->admin)
|
||||
*/
|
||||
|
||||
$form=new Form($db);
|
||||
$notify = new Notify($db);
|
||||
|
||||
llxHeader('',$langs->trans("NotificationSetup"));
|
||||
|
||||
@ -107,7 +140,53 @@ print '</table>';
|
||||
|
||||
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 '<tr class="liste_titre">';
|
||||
@ -115,12 +194,15 @@ print '<td>'.$langs->trans("Module").'</td>';
|
||||
print '<td>'.$langs->trans("Code").'</td>';
|
||||
print '<td>'.$langs->trans("Label").'</td>';
|
||||
print '<td>'.$langs->trans("FixedEmailTarget").'</td>';
|
||||
print '<td>'.$langs->trans("Threshold").'</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;
|
||||
@ -136,18 +218,47 @@ foreach($listofnotifiedevents as $notifiedevent)
|
||||
print '<td>'.$notifiedevent['code'].'</td>';
|
||||
print '<td>'.$label.'</td>';
|
||||
print '<td>';
|
||||
$param='NOTIFICATION_FIXEDEMAIL_'.$notifiedevent['code'];
|
||||
$value=GETPOST($param)?GETPOST($param,'alpha'):$conf->global->$param;
|
||||
$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.
|
||||
$arrayemail=explode(',',$value);
|
||||
$showwarning=0;
|
||||
foreach($arrayemail as $key=>$valuedet)
|
||||
{
|
||||
$valuedet=trim($valuedet);
|
||||
if (! empty($valuedet) && ! isValidEmail($valuedet)) $showwarning++;
|
||||
}
|
||||
if ((! empty($conf->global->$param)) && $showwarning) $s.=' '.img_warning($langs->trans("ErrorBadEMail"));
|
||||
print $form->textwithpicto($s,$langs->trans("YouCanUseCommaSeparatorForSeveralRecipients"));
|
||||
// Notification with threshold
|
||||
foreach($conf->global as $key => $val)
|
||||
{
|
||||
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);
|
||||
$showwarning=0;
|
||||
foreach($arrayemail as $key=>$valuedet)
|
||||
{
|
||||
$valuedet=trim($valuedet);
|
||||
if (! empty($valuedet) && ! isValidEmail($valuedet,1)) $showwarning++;
|
||||
}
|
||||
if ((! empty($conf->global->$param)) && $showwarning) $s.=' '.img_warning($langs->trans("ErrorBadEMail"));
|
||||
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 '</tr>';
|
||||
}
|
||||
|
||||
@ -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 "</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"> </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();
|
||||
|
||||
$db->close();
|
||||
|
||||
@ -443,14 +443,16 @@ foreach ($dirmodels as $reldir)
|
||||
}
|
||||
}
|
||||
|
||||
print '</table><br/>';
|
||||
print '<br>';
|
||||
print '</table><br>';
|
||||
|
||||
/*
|
||||
* 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 '<table class="noborder" width="100%">';
|
||||
print '<tr class="liste_titre">';
|
||||
@ -459,16 +461,38 @@ print '<td align="center" width="60">'.$langs->trans("Value").'</td>';
|
||||
print '<td width="80"> </td>';
|
||||
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 $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 '</td><td align="right">';
|
||||
print '<input type="submit" class="button" value="'.$langs->trans("Modify").'">';
|
||||
print "</td></tr>\n";
|
||||
|
||||
print '</table><br>';
|
||||
|
||||
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"> </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();
|
||||
|
||||
$db->close();
|
||||
|
||||
@ -439,14 +439,16 @@ foreach ($dirmodels as $reldir)
|
||||
}
|
||||
}
|
||||
|
||||
print '</table><br/>';
|
||||
print '<br>';
|
||||
print '</table><br>';
|
||||
|
||||
/*
|
||||
* 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 '<table class="noborder" width="100%">';
|
||||
print '<tr class="liste_titre">';
|
||||
@ -455,16 +457,39 @@ print '<td align="center" width="60">'.$langs->trans("Value").'</td>';
|
||||
print '<td width="80"> </td>';
|
||||
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 $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 '</td><td align="right">';
|
||||
print '<input type="submit" class="button" value="'.$langs->trans("Modify").'">';
|
||||
print "</td></tr>\n";
|
||||
|
||||
print '</table><br>';
|
||||
|
||||
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"> </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();
|
||||
|
||||
$db->close();
|
||||
|
||||
@ -1337,7 +1337,7 @@ if ($action == 'create')
|
||||
require_once DOL_DOCUMENT_ROOT . '/core/class/notify.class.php';
|
||||
$notify = new Notify($db);
|
||||
$text .= '<br>';
|
||||
$text .= $notify->confirmMessage('ASKPRICESUPPLIER_VALIDATE', $object->socid);
|
||||
$text .= $notify->confirmMessage('ASKPRICESUPPLIER_VALIDATE', $object->socid, $object);
|
||||
}
|
||||
|
||||
if (! $error)
|
||||
@ -1346,9 +1346,9 @@ if ($action == 'create')
|
||||
|
||||
if (! $formconfirm) {
|
||||
$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
|
||||
|
||||
@ -185,7 +185,7 @@ class AskPriceSupplier extends CommonObject
|
||||
$price = $prod->price;
|
||||
}
|
||||
|
||||
$line = new AskPriceSupplierLigne($this->db);
|
||||
$line = new AskPriceSupplierLine($this->db);
|
||||
|
||||
$line->fk_product=$idproduct;
|
||||
$line->desc=$productdesc;
|
||||
@ -225,7 +225,7 @@ class AskPriceSupplier extends CommonObject
|
||||
return -5;
|
||||
}
|
||||
|
||||
$askpricesupplierligne=new AskPriceSupplierLigne($this->db);
|
||||
$askpricesupplierligne=new AskPriceSupplierLine($this->db);
|
||||
$askpricesupplierligne->fk_askpricesupplier=$this->id;
|
||||
$askpricesupplierligne->fk_remise_except=$remise->id;
|
||||
$askpricesupplierligne->desc=$remise->description; // Description ligne
|
||||
@ -376,7 +376,7 @@ class AskPriceSupplier extends CommonObject
|
||||
}
|
||||
|
||||
// Insert line
|
||||
$this->line=new AskPriceSupplierLigne($this->db);
|
||||
$this->line=new AskPriceSupplierLine($this->db);
|
||||
|
||||
$this->line->fk_askpricesupplier=$this->id;
|
||||
$this->line->label=$label;
|
||||
@ -525,10 +525,10 @@ class AskPriceSupplier extends CommonObject
|
||||
}
|
||||
|
||||
// Update line
|
||||
$this->line=new AskPriceSupplierLigne($this->db);
|
||||
$this->line=new AskPriceSupplierLine($this->db);
|
||||
|
||||
// Stock previous line records
|
||||
$staticline=new AskPriceSupplierLigne($this->db);
|
||||
$staticline=new AskPriceSupplierLine($this->db);
|
||||
$staticline->fetch($rowid);
|
||||
$this->line->oldline = $staticline;
|
||||
|
||||
@ -621,7 +621,7 @@ class AskPriceSupplier extends CommonObject
|
||||
{
|
||||
if ($this->statut == 0)
|
||||
{
|
||||
$line=new AskPriceSupplierLigne($this->db);
|
||||
$line=new AskPriceSupplierLine($this->db);
|
||||
|
||||
// For triggers
|
||||
$line->fetch($lineid);
|
||||
@ -1106,7 +1106,7 @@ class AskPriceSupplier extends CommonObject
|
||||
{
|
||||
$objp = $this->db->fetch_object($result);
|
||||
|
||||
$line = new AskPriceSupplierLigne($this->db);
|
||||
$line = new AskPriceSupplierLine($this->db);
|
||||
|
||||
$line->rowid = $objp->rowid;
|
||||
$line->fk_askpricesupplier = $objp->fk_askpricesupplier;
|
||||
@ -2088,7 +2088,7 @@ class AskPriceSupplier extends CommonObject
|
||||
$xnbp = 0;
|
||||
while ($xnbp < $nbp)
|
||||
{
|
||||
$line=new AskPriceSupplierLigne($this->db);
|
||||
$line=new AskPriceSupplierLine($this->db);
|
||||
$line->desc=$langs->trans("Description")." ".$xnbp;
|
||||
$line->qty=1;
|
||||
$line->subprice=100;
|
||||
@ -2287,7 +2287,7 @@ class AskPriceSupplier extends CommonObject
|
||||
{
|
||||
$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]->rowid = $obj->rowid;
|
||||
$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
|
||||
*/
|
||||
class AskPriceSupplierLigne extends CommonObject
|
||||
class AskPriceSupplierLine extends CommonObject
|
||||
{
|
||||
var $db;
|
||||
var $error;
|
||||
@ -2689,7 +2689,7 @@ class AskPriceSupplierLigne extends CommonObject
|
||||
$this->db->begin();
|
||||
|
||||
$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) )
|
||||
{
|
||||
|
||||
@ -2852,7 +2852,7 @@ class AskPriceSupplierLigne extends CommonObject
|
||||
$sql.= ",total_ttc=".price2num($this->total_ttc,'MT')."";
|
||||
$sql.= " WHERE rowid = ".$this->rowid;
|
||||
|
||||
dol_syslog("AskPriceSupplierLigne::update_total", LOG_DEBUG);
|
||||
dol_syslog("AskPriceSupplierLine::update_total", LOG_DEBUG);
|
||||
|
||||
$resql=$this->db->query($sql);
|
||||
if ($resql)
|
||||
|
||||
@ -1671,7 +1671,7 @@ if ($action == 'create')
|
||||
require_once DOL_DOCUMENT_ROOT . '/core/class/notify.class.php';
|
||||
$notify = new Notify($db);
|
||||
$text .= '<br>';
|
||||
$text .= $notify->confirmMessage('PROPAL_VALIDATE', $object->socid);
|
||||
$text .= $notify->confirmMessage('PROPAL_VALIDATE', $object->socid, $object);
|
||||
}
|
||||
|
||||
if (! $error)
|
||||
@ -1680,9 +1680,9 @@ if ($action == 'create')
|
||||
|
||||
if (! $formconfirm) {
|
||||
$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
|
||||
|
||||
@ -399,7 +399,8 @@ if ($resql)
|
||||
print "</td></tr>\n";
|
||||
|
||||
$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";
|
||||
|
||||
|
||||
@ -253,7 +253,7 @@ if (empty($reshook))
|
||||
$object->contactid = GETPOST('contactid');
|
||||
$object->fk_incoterms = GETPOST('incoterm_id', 'int');
|
||||
$object->location_incoterms = GETPOST('location_incoterms', 'alpha');
|
||||
|
||||
|
||||
// If creation from another object of another module (Example: origin=propal, originid=1)
|
||||
if (! empty($origin) && ! empty($originid))
|
||||
{
|
||||
@ -523,7 +523,7 @@ if (empty($reshook))
|
||||
{
|
||||
$result = $object->setIncoterms(GETPOST('incoterm_id', 'int'), GETPOST('location_incoterms', 'alpha'));
|
||||
}
|
||||
|
||||
|
||||
// bank account
|
||||
else if ($action == 'setbankaccount' && $user->rights->commande->creer) {
|
||||
$result=$object->setBankAccount(GETPOST('fk_account', 'int'));
|
||||
@ -1600,7 +1600,7 @@ if ($action == 'create' && $user->rights->commande->creer)
|
||||
require_once DOL_DOCUMENT_ROOT . '/core/class/notify.class.php';
|
||||
$notify = new Notify($db);
|
||||
$text .= '<br>';
|
||||
$text .= $notify->confirmMessage('ORDER_VALIDATE', $object->socid);
|
||||
$text .= $notify->confirmMessage('ORDER_VALIDATE', $object->socid, $object);
|
||||
}
|
||||
|
||||
$qualified_for_stock_change=0;
|
||||
@ -1726,8 +1726,9 @@ if ($action == 'create' && $user->rights->commande->creer)
|
||||
|
||||
if (! $formconfirm) {
|
||||
$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
|
||||
@ -1988,10 +1989,10 @@ if ($action == 'create' && $user->rights->commande->creer)
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
}
|
||||
|
||||
|
||||
// Incoterms
|
||||
if (!empty($conf->incoterm->enabled))
|
||||
{
|
||||
{
|
||||
print '<tr><td>';
|
||||
print '<table width="100%" class="nobordernopadding"><tr><td>';
|
||||
print $langs->trans('IncotermLabel');
|
||||
@ -2005,13 +2006,13 @@ if ($action == 'create' && $user->rights->commande->creer)
|
||||
{
|
||||
print $form->textwithpicto($object->display_incoterms(), $object->libelle_incoterms, 1);
|
||||
}
|
||||
else
|
||||
else
|
||||
{
|
||||
print $form->select_incoterms((!empty($object->fk_incoterms) ? $object->fk_incoterms : ''), (!empty($object->location_incoterms)?$object->location_incoterms:''), $_SERVER['PHP_SELF'].'?id='.$object->id);
|
||||
}
|
||||
print '</td></tr>';
|
||||
}
|
||||
|
||||
|
||||
// Other attributes
|
||||
$cols = 3;
|
||||
include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_view.tpl.php';
|
||||
@ -2044,7 +2045,7 @@ if ($action == 'create' && $user->rights->commande->creer)
|
||||
|
||||
// Total HT
|
||||
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
|
||||
if (! empty($conf->margin->enabled)) {
|
||||
@ -2056,23 +2057,23 @@ if ($action == 'create' && $user->rights->commande->creer)
|
||||
|
||||
print '</tr>';
|
||||
|
||||
// Total TVA
|
||||
print '<tr><td>' . $langs->trans('AmountVAT') . '</td><td align="right">' . price($object->total_tva, 1, '', 1, - 1, - 1, $conf->currency) . '</td></tr>';
|
||||
// Total VAT
|
||||
print '<tr><td>' . $langs->trans('AmountVAT') . '</td><td>' . price($object->total_tva, 1, '', 1, - 1, - 1, $conf->currency) . '</td></tr>';
|
||||
|
||||
// Amount Local Taxes
|
||||
if ($mysoc->localtax1_assuj == "1" || $object->total_localtax1 != 0) // Localtax1
|
||||
{
|
||||
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
|
||||
{
|
||||
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
|
||||
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
|
||||
print '<tr><td>' . $langs->trans('Status') . '</td><td>' . $object->getLibStatut(4) . '</td></tr>';
|
||||
@ -2243,10 +2244,10 @@ if ($action == 'create' && $user->rights->commande->creer)
|
||||
}
|
||||
|
||||
// Cancel order
|
||||
if ($object->statut == 1 &&
|
||||
if ($object->statut == 1 &&
|
||||
((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->commande->cloturer))
|
||||
|| (! empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->commande->order_advance->annuler)))
|
||||
)
|
||||
)
|
||||
{
|
||||
print '<div class="inline-block divButAction"><a class="butActionDelete" href="' . $_SERVER["PHP_SELF"] . '?id=' . $object->id . '&action=cancel">' . $langs->trans('Cancel') . '</a></div>';
|
||||
}
|
||||
|
||||
@ -110,7 +110,12 @@ class Commande extends CommonOrder
|
||||
var $fk_incoterms;
|
||||
var $location_incoterms;
|
||||
var $libelle_incoterms; //Used into tooltip
|
||||
|
||||
|
||||
// Pour board
|
||||
var $nbtodo;
|
||||
var $nbtodolate;
|
||||
|
||||
|
||||
/**
|
||||
* ERR Not engouch stock
|
||||
*/
|
||||
@ -629,8 +634,8 @@ class Commande extends CommonOrder
|
||||
* Note that this->ref can be set or empty. If empty, we will use "(PROV)"
|
||||
*
|
||||
* @param User $user Objet user that make creation
|
||||
* @param int $notrigger Disable all triggers
|
||||
* @return int <0 if KO, >0 if OK
|
||||
* @param int $notrigger Disable all triggers
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*/
|
||||
function create($user, $notrigger=0)
|
||||
{
|
||||
@ -638,22 +643,22 @@ class Commande extends CommonOrder
|
||||
$error=0;
|
||||
|
||||
// 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);
|
||||
|
||||
// Check parameters
|
||||
if (! empty($this->ref)) // We check that ref is not already used
|
||||
{
|
||||
$result=self::isExistingObject($this->element, 0, $this->ref); // Check ref is not yet used
|
||||
if ($result > 0)
|
||||
{
|
||||
$this->error='ErrorRefAlreadyExists';
|
||||
dol_syslog(get_class($this)."::create ".$this->error,LOG_WARNING);
|
||||
$this->db->rollback();
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
{
|
||||
$result=self::isExistingObject($this->element, 0, $this->ref); // Check ref is not yet used
|
||||
if ($result > 0)
|
||||
{
|
||||
$this->error='ErrorRefAlreadyExists';
|
||||
dol_syslog(get_class($this)."::create ".$this->error,LOG_WARNING);
|
||||
$this->db->rollback();
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
$soc = new Societe($this->db);
|
||||
$result=$soc->fetch($this->socid);
|
||||
@ -682,7 +687,7 @@ class Commande extends CommonOrder
|
||||
$sql.= ", model_pdf, fk_cond_reglement, fk_mode_reglement, fk_account, fk_availability, fk_input_reason, date_livraison, fk_delivery_address";
|
||||
$sql.= ", fk_shipping_method";
|
||||
$sql.= ", remise_absolue, remise_percent";
|
||||
$sql.= ", fk_incoterms, location_incoterms";
|
||||
$sql.= ", fk_incoterms, location_incoterms";
|
||||
$sql.= ", entity";
|
||||
$sql.= ")";
|
||||
$sql.= " VALUES ('(PROV)',".$this->socid.", '".$this->db->idate($now)."', ".$user->id;
|
||||
@ -722,7 +727,7 @@ class Commande extends CommonOrder
|
||||
$num=count($this->lines);
|
||||
|
||||
/*
|
||||
* Insertion du detail des produits dans la base
|
||||
* Insert products details into db
|
||||
*/
|
||||
for ($i=0;$i<$num;$i++)
|
||||
{
|
||||
@ -753,7 +758,7 @@ class Commande extends CommonOrder
|
||||
$this->lines[$i]->fk_fournprice,
|
||||
$this->lines[$i]->pa_ht,
|
||||
$this->lines[$i]->label,
|
||||
$this->lines[$i]->array_options
|
||||
$this->lines[$i]->array_options
|
||||
);
|
||||
if ($result < 0)
|
||||
{
|
||||
@ -771,13 +776,16 @@ class Commande extends CommonOrder
|
||||
}
|
||||
}
|
||||
|
||||
// Mise a jour ref
|
||||
$sql = 'UPDATE '.MAIN_DB_PREFIX."commande SET ref='(PROV".$this->id.")' WHERE rowid=".$this->id;
|
||||
// update ref
|
||||
$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->id)
|
||||
{
|
||||
$this->ref="(PROV".$this->id.")";
|
||||
$this->ref = $initialref;
|
||||
|
||||
// Add object linked
|
||||
if (is_array($this->linked_objects) && ! empty($this->linked_objects))
|
||||
@ -1476,7 +1484,7 @@ class Commande extends CommonOrder
|
||||
|
||||
//Incoterms
|
||||
$this->fk_incoterms = $obj->fk_incoterms;
|
||||
$this->location_incoterms = $obj->location_incoterms;
|
||||
$this->location_incoterms = $obj->location_incoterms;
|
||||
$this->libelle_incoterms = $obj->libelle_incoterms;
|
||||
|
||||
$this->extraparams = (array) json_decode($obj->extraparams, true);
|
||||
|
||||
@ -39,12 +39,12 @@ class Account extends CommonObject
|
||||
public $table_element='bank_account';
|
||||
|
||||
/**
|
||||
* //TODO: Discuss this. $rowid is preferred over $id
|
||||
* @var
|
||||
* @var int Use id instead of rowid
|
||||
* @deprecated
|
||||
*/
|
||||
var $rowid;
|
||||
var $id;
|
||||
|
||||
var $ref;
|
||||
var $label;
|
||||
//! 1=Compte courant/check/carte, 2=Compte liquide, 0=Compte épargne
|
||||
|
||||
@ -324,7 +324,7 @@ if (empty($reshook))
|
||||
{
|
||||
$result = $object->setIncoterms(GETPOST('incoterm_id', 'int'), GETPOST('location_incoterms', 'alpha'));
|
||||
}
|
||||
|
||||
|
||||
// bank account
|
||||
else if ($action == 'setbankaccount' && $user->rights->facture->creer)
|
||||
{
|
||||
@ -2289,7 +2289,7 @@ if ($action == 'create')
|
||||
print $form->select_incoterms((!empty($objectsrc->fk_incoterms) ? $objectsrc->fk_incoterms : ''), (!empty($objectsrc->location_incoterms)?$objectsrc->location_incoterms:''));
|
||||
print '</td></tr>';
|
||||
}
|
||||
|
||||
|
||||
// Other attributes
|
||||
$parameters = array('objectsrc' => $objectsrc,'colspan' => ' colspan="3"');
|
||||
$reshook = $hookmanager->executeHooks('formObjectOptions', $parameters, $object, $action); // Note that $action and $object may have been modified by
|
||||
@ -2587,7 +2587,7 @@ if ($action == 'create')
|
||||
require_once DOL_DOCUMENT_ROOT . '/core/class/notify.class.php';
|
||||
$notify = new Notify($db);
|
||||
$text .= '<br>';
|
||||
$text .= $notify->confirmMessage('BILL_VALIDATE', $object->socid);
|
||||
$text .= $notify->confirmMessage('BILL_VALIDATE', $object->socid, $object);
|
||||
}
|
||||
$formquestion = array();
|
||||
|
||||
@ -2749,8 +2749,9 @@ if ($action == 'create')
|
||||
|
||||
if (! $formconfirm) {
|
||||
$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
|
||||
@ -3389,10 +3390,10 @@ if ($action == 'create')
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
}
|
||||
|
||||
|
||||
// Incoterms
|
||||
if (!empty($conf->incoterm->enabled))
|
||||
{
|
||||
{
|
||||
print '<tr><td>';
|
||||
print '<table width="100%" class="nobordernopadding"><tr><td>';
|
||||
print $langs->trans('IncotermLabel');
|
||||
@ -3406,7 +3407,7 @@ if ($action == 'create')
|
||||
{
|
||||
print $form->textwithpicto($object->display_incoterms(), $object->libelle_incoterms, 1);
|
||||
}
|
||||
else
|
||||
else
|
||||
{
|
||||
print $form->select_incoterms((!empty($object->fk_incoterms) ? $object->fk_incoterms : ''), (!empty($object->location_incoterms)?$object->location_incoterms:''), $_SERVER['PHP_SELF'].'?id='.$object->id);
|
||||
}
|
||||
|
||||
@ -89,23 +89,7 @@ class Contrat extends CommonObject
|
||||
var $product;
|
||||
|
||||
/**
|
||||
* TODO: Which is the correct one?
|
||||
* 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
|
||||
* @var int Id of user author of the contract
|
||||
*/
|
||||
public $fk_user_author;
|
||||
|
||||
@ -117,38 +101,37 @@ class Contrat extends CommonObject
|
||||
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;
|
||||
|
||||
/**
|
||||
* Date of creation
|
||||
* @var int
|
||||
* @var int Date of creation
|
||||
*/
|
||||
var $date_creation;
|
||||
|
||||
/**
|
||||
* Date of last modification
|
||||
* Not filled until you call ->info()
|
||||
* @var int
|
||||
* @var int Date of last modification. Not filled until you call ->info()
|
||||
*/
|
||||
public $date_modification;
|
||||
|
||||
/**
|
||||
* Date of validation
|
||||
* @var int
|
||||
* @var int Date of validation
|
||||
*/
|
||||
var $date_validation;
|
||||
|
||||
/**
|
||||
* Date when contract was signed
|
||||
* @var int
|
||||
* @var int Date when contract was signed
|
||||
*/
|
||||
var $date_contrat;
|
||||
|
||||
/**
|
||||
* Date of contract closure
|
||||
* @var int
|
||||
* @var int Date of contract closure
|
||||
* @deprecated we close contract lines, not a contract
|
||||
*/
|
||||
var $date_cloture;
|
||||
@ -157,21 +140,15 @@ class Contrat extends CommonObject
|
||||
var $commercial_suivi_id;
|
||||
|
||||
/**
|
||||
* @deprecated Use note_private or note_public instead
|
||||
*/
|
||||
var $note;
|
||||
|
||||
/**
|
||||
* Private note
|
||||
* @var string
|
||||
* @var string Private note
|
||||
*/
|
||||
var $note_private;
|
||||
|
||||
/**
|
||||
* Public note
|
||||
* @var string
|
||||
* @var string Public note
|
||||
*/
|
||||
var $note_public;
|
||||
|
||||
var $modelpdf;
|
||||
|
||||
/**
|
||||
@ -184,8 +161,7 @@ class Contrat extends CommonObject
|
||||
var $extraparams=array();
|
||||
|
||||
/**
|
||||
* Contract lines
|
||||
* @var ContratLigne[]
|
||||
* @var ContratLigne[] Contract lines
|
||||
*/
|
||||
var $lines=array();
|
||||
|
||||
@ -569,7 +545,6 @@ class Contrat extends CommonObject
|
||||
$this->commercial_signature_id = $result["fk_commercial_signature"];
|
||||
$this->commercial_suivi_id = $result["fk_commercial_suivi"];
|
||||
|
||||
$this->note = $result["note_private"]; // deprecated
|
||||
$this->note_private = $result["note_private"];
|
||||
$this->note_public = $result["note_public"];
|
||||
$this->modelpdf = $result["model_pdf"];
|
||||
@ -726,7 +701,7 @@ class Contrat extends CommonObject
|
||||
// Retreive all extrafield for propal
|
||||
// fetch optionals attributes and labels
|
||||
$line->fetch_optionals($line->id,$extralabelsline);
|
||||
|
||||
|
||||
$this->lines[] = $line;
|
||||
|
||||
//dol_syslog("1 ".$line->desc);
|
||||
@ -822,13 +797,13 @@ class Contrat extends CommonObject
|
||||
if ($line->statut == 4 && (! empty($line->date_fin_prevue) && $line->date_fin_prevue < $now)) $this->nbofservicesexpired++;
|
||||
if ($line->statut == 5) $this->nbofservicesclosed++;
|
||||
|
||||
|
||||
|
||||
// Retreive all extrafield for propal
|
||||
// fetch optionals attributes and labels
|
||||
|
||||
|
||||
$line->fetch_optionals($line->id,$extralabelsline);
|
||||
|
||||
|
||||
|
||||
|
||||
$this->lines[] = $line;
|
||||
|
||||
$total_ttc+=$objp->total_ttc;
|
||||
|
||||
@ -233,7 +233,7 @@ class box_activity extends ModeleBoxes
|
||||
'url' => DOL_URL_ROOT."/compta/facture/list.php?".$billurl."&mainmenu=accountancy&leftmenu=customers_bills",
|
||||
);
|
||||
$totalnb += $data[$j]->nb;
|
||||
$this->info_box_contents[$line][3] = array(
|
||||
$this->info_box_contents[$line][3] = array(
|
||||
'td' => 'align="right"',
|
||||
'text' => price($data[$j]->Mnttot,1,$langs,0,0,-1,$conf->currency),
|
||||
);
|
||||
@ -342,7 +342,8 @@ class box_activity extends ModeleBoxes
|
||||
}
|
||||
|
||||
// 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';
|
||||
$propalstatic=new Propal($db);
|
||||
|
||||
@ -350,7 +351,8 @@ class box_activity extends ModeleBoxes
|
||||
$filename = '/boxactivity-propal'.$fileid;
|
||||
$refresh = dol_cache_refresh($cachedir, $filename, $cachetime);
|
||||
$data = array();
|
||||
if ($refresh) {
|
||||
if ($refresh)
|
||||
{
|
||||
$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";
|
||||
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";
|
||||
|
||||
$result = $db->query($sql);
|
||||
|
||||
if ($result) {
|
||||
if ($result)
|
||||
{
|
||||
$num = $db->num_rows($result) + $line;
|
||||
$j=0;
|
||||
while ($j < $num) {
|
||||
@ -380,12 +382,17 @@ class box_activity extends ModeleBoxes
|
||||
} else {
|
||||
dol_print_error($db);
|
||||
}
|
||||
} else {
|
||||
}
|
||||
else
|
||||
{
|
||||
$data = dol_readcachefile($cachedir, $filename);
|
||||
}
|
||||
if (! empty($data)) {
|
||||
|
||||
if (! empty($data))
|
||||
{
|
||||
$j=0;
|
||||
while ($line < count($data)) {
|
||||
while ($line < count($data))
|
||||
{
|
||||
$this->info_box_contents[$line][] = array(
|
||||
'td' => 'align="left" width="16"',
|
||||
'url' => DOL_URL_ROOT."/comm/propal/list.php?mainmenu=commercial&leftmenu=propals&viewstatut=".$data[$j]->fk_statut,
|
||||
@ -393,7 +400,6 @@ class box_activity extends ModeleBoxes
|
||||
'logo' => 'object_propal'
|
||||
);
|
||||
|
||||
$objp = $db->fetch_object($result);
|
||||
$this->info_box_contents[$line][] = array(
|
||||
'td' => 'align="left"',
|
||||
'text' => $langs->trans("Proposals")." ".$propalstatic->LibStatut($data[$j]->fk_statut,0),
|
||||
|
||||
@ -85,8 +85,8 @@ class CMailFile
|
||||
* CMailFile
|
||||
*
|
||||
* @param string $subject Topic/Subject of mail
|
||||
* @param string $to Recipients emails (RFC 2822: "Nom firstname <email>[, ...]" ou "email[, ...]" ou "<email>[, ...]")
|
||||
* @param string $from Sender email (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: "Name firstname <email>[, ...]" or "email[, ...]" or "<email>[, ...]")
|
||||
* @param string $msg Message
|
||||
* @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
|
||||
@ -98,9 +98,7 @@ class CMailFile
|
||||
* @param string $errors_to Email errors
|
||||
* @param string $css Css option
|
||||
*/
|
||||
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='')
|
||||
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='')
|
||||
{
|
||||
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 $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>'
|
||||
|
||||
@ -35,46 +35,69 @@
|
||||
*/
|
||||
abstract class CommonObject
|
||||
{
|
||||
public $db;
|
||||
/**
|
||||
* @var DoliDb Database handler (result of a new DoliDB)
|
||||
*/
|
||||
public $db;
|
||||
|
||||
/**
|
||||
* @var error Error string
|
||||
* @deprecated Use instead the array of error strings
|
||||
* @var string Error string
|
||||
* @deprecated Use instead the array of error strings
|
||||
*/
|
||||
public $error;
|
||||
|
||||
/**
|
||||
* @var errors Aray of error string
|
||||
* @var string[] Array of error strings
|
||||
*/
|
||||
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 $lastname;
|
||||
public $firstname;
|
||||
public $civility_id;
|
||||
public $import_key;
|
||||
|
||||
public $array_options=array();
|
||||
|
||||
/**
|
||||
* @var Societe
|
||||
*/
|
||||
public $thirdparty;
|
||||
|
||||
public $linkedObjectsIds; // Loaded by ->fetchObjectLinked
|
||||
public $linkedObjects; // Loaded by ->fetchObjectLinked
|
||||
|
||||
// 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
|
||||
|
||||
@ -65,7 +65,7 @@ class DolGraph
|
||||
var $bgcolorgrid=array(255,255,255); // 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
|
||||
|
||||
|
||||
/**
|
||||
|
||||
@ -530,7 +530,7 @@ class ExtraFields
|
||||
$sql.= " ".($perms?"'".$this->db->escape($perms)."'":"null").",";
|
||||
$sql.= " '".$pos."',";
|
||||
$sql.= " '".$alwayseditable."',";
|
||||
$sql.= " '".$param."'";
|
||||
$sql.= " '".$param."',";
|
||||
$sql.= " ".$list;
|
||||
$sql.= ")";
|
||||
dol_syslog(get_class($this)."::update_label", LOG_DEBUG);
|
||||
@ -1062,7 +1062,7 @@ class ExtraFields
|
||||
$object = new $InfoFieldList[0]($this->db);
|
||||
$object->fetch($value);
|
||||
$out='<input type="text" class="flat" name="options_'.$key.$keyprefix.'" size="20" value="'.$object->ref.'" >';
|
||||
|
||||
|
||||
}
|
||||
/* Add comments
|
||||
if ($type == 'date') $out.=' (YYYY-MM-DD)';
|
||||
|
||||
@ -26,7 +26,7 @@ require_once DOL_DOCUMENT_ROOT .'/core/class/commonobject.class.php';
|
||||
/**
|
||||
* Class to manage fiscal year
|
||||
*/
|
||||
class Fiscalyear
|
||||
class Fiscalyear extends CommonObject
|
||||
{
|
||||
public $element='fiscalyear';
|
||||
public $table_element='accounting_fiscalyear';
|
||||
|
||||
@ -395,12 +395,13 @@ class Form
|
||||
$htmltext=str_replace("\n","",$htmltext);
|
||||
|
||||
$htmltext=str_replace('"',""",$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
|
||||
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
|
||||
$s="";
|
||||
if (empty($notabs)) $s.='<table class="nobordernopadding" summary=""><tr>';
|
||||
elseif ($notabs == 2) $s.='<div class="inline-block nowrap">';
|
||||
if ($direction < 0) {
|
||||
$s.='<'.$tag.$paramfortooltipimg;
|
||||
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
|
||||
// TODO add this in css
|
||||
//if ($text != '') $s.='<'.$tag.$paramfortooltiptd.'>'.(($direction < 0)?' ':'').$text.(($direction > 0)?' ':'').'</'.$tag.'>';
|
||||
$paramfortooltiptd.= (($direction < 0)?' style="padding-left: 3px !important;"':'');
|
||||
$paramfortooltiptd.= (($direction > 0)?' style="padding-right: 3px !important;"':'');
|
||||
$paramfortooltiptd.= (($direction < 0)?' class="inline-block" style="padding-left: 3px !important;"':'');
|
||||
$paramfortooltiptd.= (($direction > 0)?' class="inline-block" style="padding-right: 3px !important;"':'');
|
||||
if ((string) $text != '') $s.='<'.$tag.$paramfortooltiptd.'>'.$text.'</'.$tag.'>';
|
||||
if ($direction > 0) {
|
||||
$s.='<'.$tag.$paramfortooltipimg;
|
||||
@ -422,6 +423,7 @@ class Form
|
||||
$s.= '>'.$img.'</'.$tag.'>';
|
||||
}
|
||||
if (empty($notabs)) $s.='</tr></table>';
|
||||
elseif ($notabs == 2) $s.='</div>';
|
||||
|
||||
return $s;
|
||||
}
|
||||
@ -583,7 +585,7 @@ class Form
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."c_incoterms";
|
||||
$sql.= " WHERE active = 1";
|
||||
$sql.= " ORDER BY code ASC";
|
||||
|
||||
|
||||
dol_syslog(get_class($this)."::select_incoterm", LOG_DEBUG);
|
||||
$resql=$this->db->query($sql);
|
||||
if ($resql)
|
||||
@ -593,14 +595,14 @@ class Form
|
||||
include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
|
||||
$out .= ajax_combobox($htmlname, $events);
|
||||
}
|
||||
|
||||
|
||||
if (!empty($page))
|
||||
{
|
||||
$out .= '<form method="post" action="'.$page.'">';
|
||||
$out .= '<input type="hidden" name="action" value="set_incoterms">';
|
||||
$out .= '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
}
|
||||
|
||||
|
||||
$out.= '<select id="'.$htmlname.'" class="flat selectincoterm" name="'.$htmlname.'" '.$htmloption.'>';
|
||||
$out.= '<option value=""></option>';
|
||||
$num = $this->db->num_rows($resql);
|
||||
@ -627,17 +629,17 @@ class Form
|
||||
{
|
||||
$out.= '<option value="'.$row['rowid'].'">';
|
||||
}
|
||||
|
||||
|
||||
if ($row['code']) $out.= $row['code'];
|
||||
|
||||
|
||||
$out.= '</option>';
|
||||
}
|
||||
}
|
||||
$out.= '</select>';
|
||||
|
||||
|
||||
$out .= '<input id="location_incoterms" name="location_incoterms" size="14" value="'.$location_incoterms.'">';
|
||||
|
||||
if (!empty($page))
|
||||
|
||||
if (!empty($page))
|
||||
{
|
||||
$out .= '<input type="submit" class="button" value="'.$langs->trans("Modify").'"></form>';
|
||||
}
|
||||
@ -4445,7 +4447,7 @@ class Form
|
||||
}
|
||||
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="'.$no.'"'.$selected.'>'.$langs->trans("No").'</option>'."\n";
|
||||
}
|
||||
|
||||
@ -550,7 +550,11 @@ class FormFile
|
||||
|
||||
// Execute hooks
|
||||
$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
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
/* Copyright (C) 2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2004 Benoit Mortier <benoit.mortier@opensides.be>
|
||||
* 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
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@ -25,11 +25,12 @@
|
||||
*/
|
||||
|
||||
/**
|
||||
* \class Ldap
|
||||
* \brief Class to manage LDAP features
|
||||
* Class to manage LDAP features
|
||||
*/
|
||||
class Ldap
|
||||
{
|
||||
var $error;
|
||||
|
||||
/**
|
||||
* Tableau des serveurs (IP addresses ou nom d'hotes)
|
||||
*/
|
||||
@ -78,7 +79,7 @@ class Ldap
|
||||
var $name;
|
||||
var $firstname;
|
||||
var $login;
|
||||
var $phone;
|
||||
var $phone;
|
||||
var $skype;
|
||||
var $fax;
|
||||
var $mail;
|
||||
@ -414,9 +415,10 @@ class Ldap
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->error=@ldap_error($this->connection);
|
||||
$this->errno=@ldap_errno($this->connection);
|
||||
dol_syslog(get_class($this)."::add failed: ".$this->errno." ".$this->error, LOG_ERR);
|
||||
$this->ldapErrorCode = @ldap_errno($this->connection);
|
||||
$this->ldapErrorText = @ldap_error($this->connection);
|
||||
$this->error=$this->ldapErrorCode." ".$this->ldapErrorText;
|
||||
dol_syslog(get_class($this)."::add failed: ".$this->error, LOG_ERR);
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
@ -61,14 +61,15 @@ class Notify
|
||||
*
|
||||
* @param string $action Id of action in llx_c_action_trigger
|
||||
* @param int $socid Id of third party
|
||||
* @param Object $object Object the notification is about
|
||||
* @return string Message
|
||||
*/
|
||||
function confirmMessage($action,$socid)
|
||||
function confirmMessage($action,$socid,$object)
|
||||
{
|
||||
global $langs;
|
||||
$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 == 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);
|
||||
@ -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 int $socid Id of third party
|
||||
* @return int <0 if KO, nb of notifications sent if OK
|
||||
* @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 or 0 for all thirdparties
|
||||
* @param Object $object Object the notification is about
|
||||
* @return int <0 if KO, nb of notifications sent if OK
|
||||
*/
|
||||
function countDefinedNotifications($action,$socid)
|
||||
function countDefinedNotifications($notifcode,$socid,$object=null)
|
||||
{
|
||||
global $conf;
|
||||
|
||||
$error=0;
|
||||
$num=0;
|
||||
|
||||
$valueforthreshold = $object->total_ht;
|
||||
|
||||
if (! $error)
|
||||
{
|
||||
$sql = "SELECT n.rowid";
|
||||
$sql = "SELECT COUNT(n.rowid) as nb";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."notify_def as n,";
|
||||
$sql.= " ".MAIN_DB_PREFIX."socpeople as c,";
|
||||
$sql.= " ".MAIN_DB_PREFIX."c_action_trigger as a,";
|
||||
@ -99,22 +103,23 @@ class Notify
|
||||
$sql.= " WHERE n.fk_contact = c.rowid";
|
||||
$sql.= " AND a.rowid = n.fk_action";
|
||||
$sql.= " AND n.fk_soc = s.rowid";
|
||||
if (is_numeric($action)) $sql.= " AND n.fk_action = ".$action; // Old usage
|
||||
else $sql.= " AND a.code = '".$action."'"; // New usage
|
||||
if (is_numeric($notifcode)) $sql.= " AND n.fk_action = ".$notifcode; // Old usage
|
||||
else $sql.= " AND a.code = '".$notifcode."'"; // New usage
|
||||
$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);
|
||||
if ($resql)
|
||||
{
|
||||
$num = $this->db->num_rows($resql);
|
||||
$obj = $this->db->fetch_object($resql);
|
||||
if ($obj) $num = $obj->nb;
|
||||
}
|
||||
else
|
||||
{
|
||||
$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
|
||||
foreach($conf->global as $key => $val)
|
||||
{
|
||||
if (! preg_match('/^NOTIFICATION_FIXEDEMAIL_'.$action.'/', $key, $reg)) continue;
|
||||
$num++;
|
||||
if ($val == '' || ! preg_match('/^NOTIFICATION_FIXEDEMAIL_'.$notifcode.'_THRESHOLD_HIGHER_(.*)$/', $key, $reg)) continue;
|
||||
|
||||
$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;
|
||||
return $num;
|
||||
}
|
||||
@ -137,17 +149,17 @@ class Notify
|
||||
* Check if notification are active for couple action/company.
|
||||
* 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 Object $object Object the notification deals on
|
||||
* @return int <0 if KO, or number of changes if OK
|
||||
* @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
|
||||
* @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';
|
||||
|
||||
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");
|
||||
|
||||
@ -166,7 +178,20 @@ class Notify
|
||||
$link = '';
|
||||
$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;
|
||||
}
|
||||
@ -181,8 +206,8 @@ class Notify
|
||||
$sql.= " ".MAIN_DB_PREFIX."societe as s";
|
||||
$sql.= " WHERE n.fk_contact = c.rowid AND a.rowid = n.fk_action";
|
||||
$sql.= " AND n.fk_soc = s.rowid";
|
||||
if (is_numeric($action)) $sql.= " AND n.fk_action = ".$action; // Old usage
|
||||
else $sql.= " AND a.code = '".$action."'"; // New usage
|
||||
if (is_numeric($notifcode)) $sql.= " AND n.fk_action = ".$notifcode; // Old usage
|
||||
else $sql.= " AND a.code = '".$notifcode."'"; // New usage
|
||||
$sql .= " AND s.rowid = ".$object->socid;
|
||||
|
||||
$result = $this->db->query($sql);
|
||||
@ -197,8 +222,8 @@ class Notify
|
||||
{
|
||||
$obj = $this->db->fetch_object($result);
|
||||
|
||||
$sendto = $obj->firstname . " " . $obj->lastname . " <".$obj->email.">";
|
||||
$actiondefid = $obj->adid;
|
||||
$sendto = dolGetFirstLastname($obj->firstname,$obj->lastname) . " <".$obj->email.">";
|
||||
$notifcodedefid = $obj->adid;
|
||||
|
||||
if (dol_strlen($obj->email))
|
||||
{
|
||||
@ -210,7 +235,7 @@ class Notify
|
||||
$outputlangs->setDefaultLang($obj->default_lang);
|
||||
}
|
||||
|
||||
switch ($action) {
|
||||
switch ($notifcode) {
|
||||
case 'BILL_VALIDATE':
|
||||
$link='/compta/facture.php?facid='.$object->id;
|
||||
$dir_output = $conf->facture->dir_output;
|
||||
@ -235,6 +260,14 @@ class Notify
|
||||
$object_type = 'ficheinter';
|
||||
$mesg = $langs->transnoentitiesnoconv("EMailTextInterventionValidated",$object->ref);
|
||||
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':
|
||||
$link='/fourn/commande/card.php?id='.$object->id;
|
||||
$dir_output = $conf->fournisseur->dir_output.'/commande/';
|
||||
@ -294,7 +327,7 @@ class Notify
|
||||
if ($mailfile->sendfile())
|
||||
{
|
||||
$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))
|
||||
{
|
||||
dol_print_error($this->db);
|
||||
@ -328,113 +361,150 @@ class Notify
|
||||
// Check notification using fixed email
|
||||
if (! $error)
|
||||
{
|
||||
$param='NOTIFICATION_FIXEDEMAIL_'.$action;
|
||||
if (! empty($conf->global->$param))
|
||||
{
|
||||
$sendto = $conf->global->$param;
|
||||
$actiondefid = dol_getIdFromCode($this->db, $action, 'c_action_trigger', 'code', 'rowid');
|
||||
if ($actiondefid <= 0) dol_print_error($this->db, 'Failed to get id from code');
|
||||
foreach($conf->global as $key => $val)
|
||||
{
|
||||
if ($val == '' || ! preg_match('/^NOTIFICATION_FIXEDEMAIL_'.$notifcode.'_THRESHOLD_HIGHER_(.*)$/', $key, $reg)) continue;
|
||||
|
||||
$object_type = '';
|
||||
$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;
|
||||
$notifcodedefid = dol_getIdFromCode($this->db, $notifcode, 'c_action_trigger', 'code', 'rowid');
|
||||
if ($notifcodedefid <= 0) dol_print_error($this->db, 'Failed to get id from code');
|
||||
|
||||
$object_type = '';
|
||||
$link = '';
|
||||
$num++;
|
||||
$num++;
|
||||
|
||||
switch ($action) {
|
||||
case 'BILL_VALIDATE':
|
||||
$link='/compta/facture.php?facid='.$object->id;
|
||||
$dir_output = $conf->facture->dir_output;
|
||||
$object_type = 'facture';
|
||||
$mesg = $langs->transnoentitiesnoconv("EMailTextInvoiceValidated",$object->ref);
|
||||
break;
|
||||
case 'ORDER_VALIDATE':
|
||||
$link='/commande/card.php?id='.$object->id;
|
||||
$dir_output = $conf->commande->dir_output;
|
||||
$object_type = 'order';
|
||||
$mesg = $langs->transnoentitiesnoconv("EMailTextOrderValidated",$object->ref);
|
||||
break;
|
||||
case 'PROPAL_VALIDATE':
|
||||
$link='/comm/propal.php?id='.$object->id;
|
||||
$dir_output = $conf->propal->dir_output;
|
||||
$object_type = 'propal';
|
||||
$mesg = $langs->transnoentitiesnoconv("EMailTextProposalValidated",$object->ref);
|
||||
break;
|
||||
case 'FICHINTER_VALIDATE':
|
||||
$link='/fichinter/card.php?id='.$object->id;
|
||||
$dir_output = $conf->facture->dir_output;
|
||||
$object_type = 'ficheinter';
|
||||
$mesg = $langs->transnoentitiesnoconv("EMailTextInterventionValidated",$object->ref);
|
||||
break;
|
||||
case 'ORDER_SUPPLIER_APPROVE':
|
||||
$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("EMailTextOrderApprovedBy",$object->ref,$user->getFullName($langs));
|
||||
$mesg.= "\n\n".$langs->transnoentitiesnoconv("Sincerely").".\n\n";
|
||||
break;
|
||||
case 'ORDER_SUPPLIER_REFUSE':
|
||||
$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("EMailTextOrderRefusedBy",$object->ref,$user->getFullName($langs));
|
||||
$mesg.= "\n\n".$langs->transnoentitiesnoconv("Sincerely").".\n\n";
|
||||
break;
|
||||
case 'SHIPPING_VALIDATE':
|
||||
$dir_output = $conf->expedition->dir_output.'/sending/';
|
||||
$object_type = 'order_supplier';
|
||||
$mesg = $langs->transnoentitiesnoconv("EMailTextExpeditionValidated",$object->ref);
|
||||
break;
|
||||
}
|
||||
$ref = dol_sanitizeFileName($object->ref);
|
||||
$pdf_path = $dir_output."/".$ref."/".$ref.".pdf";
|
||||
if (! dol_is_file($pdf_path))
|
||||
{
|
||||
// We can't add PDF as it is not generated yet.
|
||||
$filepdf = '';
|
||||
}
|
||||
else
|
||||
{
|
||||
$filepdf = $pdf_path;
|
||||
}
|
||||
switch ($notifcode) {
|
||||
case 'BILL_VALIDATE':
|
||||
$link='/compta/facture.php?facid='.$object->id;
|
||||
$dir_output = $conf->facture->dir_output;
|
||||
$object_type = 'facture';
|
||||
$mesg = $langs->transnoentitiesnoconv("EMailTextInvoiceValidated",$object->ref);
|
||||
break;
|
||||
case 'ORDER_VALIDATE':
|
||||
$link='/commande/card.php?id='.$object->id;
|
||||
$dir_output = $conf->commande->dir_output;
|
||||
$object_type = 'order';
|
||||
$mesg = $langs->transnoentitiesnoconv("EMailTextOrderValidated",$object->ref);
|
||||
break;
|
||||
case 'PROPAL_VALIDATE':
|
||||
$link='/comm/propal.php?id='.$object->id;
|
||||
$dir_output = $conf->propal->dir_output;
|
||||
$object_type = 'propal';
|
||||
$mesg = $langs->transnoentitiesnoconv("EMailTextProposalValidated",$object->ref);
|
||||
break;
|
||||
case 'FICHINTER_VALIDATE':
|
||||
$link='/fichinter/card.php?id='.$object->id;
|
||||
$dir_output = $conf->facture->dir_output;
|
||||
$object_type = 'ficheinter';
|
||||
$mesg = $langs->transnoentitiesnoconv("EMailTextInterventionValidated",$object->ref);
|
||||
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':
|
||||
$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("EMailTextOrderApprovedBy",$object->ref,$user->getFullName($langs));
|
||||
$mesg.= "\n\n".$langs->transnoentitiesnoconv("Sincerely").".\n\n";
|
||||
break;
|
||||
case 'ORDER_SUPPLIER_REFUSE':
|
||||
$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("EMailTextOrderRefusedBy",$object->ref,$user->getFullName($langs));
|
||||
$mesg.= "\n\n".$langs->transnoentitiesnoconv("Sincerely").".\n\n";
|
||||
break;
|
||||
case 'SHIPPING_VALIDATE':
|
||||
$dir_output = $conf->expedition->dir_output.'/sending/';
|
||||
$object_type = 'order_supplier';
|
||||
$mesg = $langs->transnoentitiesnoconv("EMailTextExpeditionValidated",$object->ref);
|
||||
break;
|
||||
}
|
||||
$ref = dol_sanitizeFileName($object->ref);
|
||||
$pdf_path = $dir_output."/".$ref."/".$ref.".pdf";
|
||||
if (! dol_is_file($pdf_path))
|
||||
{
|
||||
// We can't add PDF as it is not generated yet.
|
||||
$filepdf = '';
|
||||
}
|
||||
else
|
||||
{
|
||||
$filepdf = $pdf_path;
|
||||
}
|
||||
|
||||
$subject = '['.$application.'] '.$langs->transnoentitiesnoconv("DolibarrNotification");
|
||||
$subject = '['.$application.'] '.$langs->transnoentitiesnoconv("DolibarrNotification");
|
||||
|
||||
$message = $langs->transnoentities("YouReceiveMailBecauseOfNotification",$application,$mysoc->name)."\n";
|
||||
$message.= $langs->transnoentities("YouReceiveMailBecauseOfNotification2",$application,$mysoc->name)."\n";
|
||||
$message.= "\n";
|
||||
$message.= $mesg;
|
||||
if ($link) $message=dol_concatdesc($message,$urlwithroot.$link);
|
||||
$message = $langs->transnoentities("YouReceiveMailBecauseOfNotification",$application,$mysoc->name)."\n";
|
||||
$message.= $langs->transnoentities("YouReceiveMailBecauseOfNotification2",$application,$mysoc->name)."\n";
|
||||
$message.= "\n";
|
||||
$message.= $mesg;
|
||||
if ($link) $message=dol_concatdesc($message,$urlwithroot.$link);
|
||||
|
||||
$mailfile = new CMailFile(
|
||||
$subject,
|
||||
$sendto,
|
||||
$replyto,
|
||||
$message,
|
||||
array($file),
|
||||
array($mimefile),
|
||||
array($filename[count($filename)-1]),
|
||||
'',
|
||||
'',
|
||||
0,
|
||||
-1
|
||||
);
|
||||
// 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 ($mailfile->sendfile())
|
||||
{
|
||||
$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)."')";
|
||||
if (! $this->db->query($sql))
|
||||
{
|
||||
dol_print_error($this->db);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$error++;
|
||||
$this->errors[]=$mailfile->error;
|
||||
}
|
||||
}
|
||||
if ($sendto)
|
||||
{
|
||||
$mailfile = new CMailFile(
|
||||
$subject,
|
||||
$sendto,
|
||||
$replyto,
|
||||
$message,
|
||||
array($file),
|
||||
array($mimefile),
|
||||
array($filename[count($filename)-1]),
|
||||
'',
|
||||
'',
|
||||
0,
|
||||
-1
|
||||
);
|
||||
|
||||
if ($mailfile->sendfile())
|
||||
{
|
||||
$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())."', ".$notifcodedefid.", ".$object->socid.", null, 'email', '".$object_type."', ".$object->id.", '".$this->db->escape($conf->global->$param)."')";
|
||||
if (! $this->db->query($sql))
|
||||
{
|
||||
dol_print_error($this->db);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$error++;
|
||||
$this->errors[]=$mailfile->error;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (! $error) return $num;
|
||||
|
||||
@ -315,7 +315,7 @@ class DoliDBSqlite3 extends DoliDB
|
||||
* @param string $login login
|
||||
* @param string $passwd password
|
||||
* @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
|
||||
* @see close
|
||||
*/
|
||||
@ -530,7 +530,7 @@ class DoliDBSqlite3 extends DoliDB
|
||||
/**
|
||||
* Return datas as an array
|
||||
*
|
||||
* @param Resultset $resultset Resultset of request
|
||||
* @param resource $resultset Resultset of request
|
||||
* @return array Array
|
||||
*/
|
||||
function fetch_row($resultset)
|
||||
@ -588,7 +588,7 @@ class DoliDBSqlite3 extends DoliDB
|
||||
/**
|
||||
* Free last resultset used.
|
||||
*
|
||||
* @param resultset $resultset Curseur de la requete voulue
|
||||
* @param integer $resultset Curseur de la requete voulue
|
||||
* @return void
|
||||
*/
|
||||
function free($resultset=0)
|
||||
@ -709,7 +709,7 @@ class DoliDBSqlite3 extends DoliDB
|
||||
*
|
||||
* @param string $fieldorvalue Field name or value to encrypt
|
||||
* @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)
|
||||
{
|
||||
@ -1277,7 +1277,7 @@ class DoliDBSqlite3 extends DoliDB
|
||||
* Cette fonction est l'equivalent de la fonction MONTH de MySql.
|
||||
*
|
||||
* @param string $date Date
|
||||
* @return integer
|
||||
* @return string
|
||||
*/
|
||||
public static function dbMONTH($date)
|
||||
{
|
||||
@ -1320,7 +1320,7 @@ class DoliDBSqlite3 extends DoliDB
|
||||
* dbWEEKDAY
|
||||
*
|
||||
* @param int $date Date
|
||||
* @return string
|
||||
* @return double
|
||||
*/
|
||||
public static function dbWEEKDAY($date) {
|
||||
$arr = date_parse($date);
|
||||
@ -1472,7 +1472,7 @@ class DoliDBSqlite3 extends DoliDB
|
||||
* week_mode
|
||||
*
|
||||
* @param string $mode Mode
|
||||
* @return string Week format
|
||||
* @return integer Week format
|
||||
*/
|
||||
private static function week_mode($mode) {
|
||||
$week_format= ($mode & 7);
|
||||
|
||||
@ -84,7 +84,7 @@ function CreateXmlFooter()
|
||||
/**
|
||||
* SendError
|
||||
*
|
||||
* @param unknown_type $number Number
|
||||
* @param integer $number Number
|
||||
* @param unknown_type $text Text
|
||||
* @return void
|
||||
*/
|
||||
|
||||
@ -30,7 +30,7 @@ require 'commands.php';
|
||||
/**
|
||||
* SendError
|
||||
*
|
||||
* @param string $number Number
|
||||
* @param integer $number Number
|
||||
* @param string $text Text
|
||||
* @return void
|
||||
*/
|
||||
|
||||
@ -122,7 +122,28 @@ function updateTotal(days,mode)
|
||||
var nbline = document.getElementById('numberOfLines').value;
|
||||
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 element=document.getElementById(id);
|
||||
if(element)
|
||||
@ -152,7 +173,23 @@ function updateTotal(days,mode)
|
||||
var nbline = document.getElementById('numberOfLines').value;
|
||||
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 element=document.getElementById(id);
|
||||
if(element)
|
||||
|
||||
@ -386,6 +386,12 @@ function dolibarr_del_const($db, $name, $entity=1)
|
||||
{
|
||||
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.= " WHERE (".$db->decrypt('name')." = '".$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 string $name Name of constant
|
||||
|
||||
@ -120,7 +120,7 @@ function bank_admin_prepare_head($object)
|
||||
* Check SWIFT informations for 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)
|
||||
{
|
||||
@ -137,7 +137,7 @@ function checkSwiftForAccount($account)
|
||||
* Check IBAN number informations for 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)
|
||||
{
|
||||
@ -156,7 +156,7 @@ function checkIbanForAccount($account)
|
||||
* Check account number informations for 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)
|
||||
{
|
||||
|
||||
@ -1633,14 +1633,14 @@ function dol_print_address($address, $htmlid, $mode, $id)
|
||||
/**
|
||||
* Return true if email syntax is ok
|
||||
*
|
||||
* @param string $address email (Ex: "toto@titi.com", "John Do <johndo@titi.com>")
|
||||
* @return boolean true if email syntax is OK, false if KO or empty string
|
||||
* @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
|
||||
*/
|
||||
function isValidEmail($address)
|
||||
function isValidEmail($address, $acceptsupervisorkey=0)
|
||||
{
|
||||
if (filter_var($address, FILTER_VALIDATE_EMAIL)) {
|
||||
return true;
|
||||
}
|
||||
if ($acceptsupervisorkey && $address == '__SUPERVISOREMAIL__') return true;
|
||||
if (filter_var($address, FILTER_VALIDATE_EMAIL)) return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
@ -2116,7 +2116,7 @@ function img_edit_remove($titlealt = 'default', $other='')
|
||||
* 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 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
|
||||
* @return string Return tag img
|
||||
*/
|
||||
@ -2133,7 +2133,7 @@ function img_edit($titlealt = 'default', $float = 0, $other = '')
|
||||
* 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 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
|
||||
* @return string Return tag img
|
||||
*/
|
||||
@ -2446,7 +2446,7 @@ function img_searchclear($titlealt = 'default', $other = '')
|
||||
* Show information for admin users
|
||||
*
|
||||
* @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
|
||||
* @return string String with info text
|
||||
*/
|
||||
@ -2495,7 +2495,7 @@ function dol_print_error($db='',$error='')
|
||||
if ($_SERVER['DOCUMENT_ROOT']) // Mode web
|
||||
{
|
||||
$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.="<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 string $file Lien
|
||||
* @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
|
||||
* @return void
|
||||
*/
|
||||
@ -2923,7 +2923,7 @@ function vatrate($rate,$addpercent=false,$info_bits=0,$usestarfornpr=0)
|
||||
* Function used into PDF and HTML pages
|
||||
*
|
||||
* @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 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)
|
||||
@ -3622,7 +3622,7 @@ function get_default_npr($thirdparty_seller, $thirdparty_buyer, $idprod=0, $idpr
|
||||
* @param Societe $thirdparty_buyer Thirdparty buyer
|
||||
* @param int $local Localtax to process (1 or 2)
|
||||
* @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
|
||||
*/
|
||||
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
|
||||
*
|
||||
* @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.
|
||||
* @return string HTML string
|
||||
*/
|
||||
@ -3805,7 +3805,7 @@ function picto_required()
|
||||
* Clean a string from all HTML tags and entities
|
||||
*
|
||||
* @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
|
||||
* @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 string $format Output format
|
||||
* @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
|
||||
*/
|
||||
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');
|
||||
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';
|
||||
}
|
||||
if (function_exists("memory_get_usage"))
|
||||
@ -4952,7 +4952,7 @@ function dol_getmypid()
|
||||
* @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 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
|
||||
*/
|
||||
function natural_search($fields, $value, $numeric=0)
|
||||
|
||||
@ -941,7 +941,7 @@ function pdf_writeLinkedObjects(&$pdf,$object,$outputlangs,$posx,$posy,$w,$h,$al
|
||||
* @param int $hideref Hide reference
|
||||
* @param int $hidedesc Hide description
|
||||
* @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)
|
||||
{
|
||||
@ -1159,7 +1159,7 @@ function pdf_getlinedesc($object,$i,$outputlangs,$hideref=0,$hidedesc=0,$issuppl
|
||||
* @param int $i Current line number
|
||||
* @param Translate $outputlangs Object langs for output
|
||||
* @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)
|
||||
{
|
||||
@ -1185,7 +1185,7 @@ function pdf_getlinenum($object,$i,$outputlangs,$hidedetails=0)
|
||||
* @param int $i Current line number
|
||||
* @param Translate $outputlangs Object langs for output
|
||||
* @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)
|
||||
{
|
||||
@ -1210,7 +1210,7 @@ function pdf_getlineref($object,$i,$outputlangs,$hidedetails=0)
|
||||
* @param int $i Current line number
|
||||
* @param Translate $outputlangs Object langs for output
|
||||
* @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)
|
||||
{
|
||||
@ -1569,7 +1569,7 @@ function pdf_getlinetotalwithtax($object,$i,$outputlangs,$hidedetails=0)
|
||||
* @param Object $object Object
|
||||
* @param string $type Type
|
||||
* @param Translate $outputlangs Object langs for output
|
||||
* @return void
|
||||
* @return integer
|
||||
*/
|
||||
function pdf_getTotalQty($object,$type,$outputlangs)
|
||||
{
|
||||
|
||||
@ -49,7 +49,7 @@
|
||||
* @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 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,
|
||||
* 1=total_vat,
|
||||
* 2=total_ttc,
|
||||
|
||||
@ -27,7 +27,7 @@
|
||||
/**
|
||||
* 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
|
||||
* @return array Array of tabs to show
|
||||
*/
|
||||
@ -183,7 +183,7 @@ function product_admin_prepare_head()
|
||||
*
|
||||
* @param Product $product Product object
|
||||
* @param int $socid Thirdparty id
|
||||
* @return void
|
||||
* @return integer
|
||||
*/
|
||||
function show_stats_for_company($product,$socid)
|
||||
{
|
||||
|
||||
@ -177,7 +177,15 @@ function project_timesheet_prepare_head($mode)
|
||||
|
||||
$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][1] = $langs->trans("InputPerDay");
|
||||
@ -185,13 +193,13 @@ function project_timesheet_prepare_head($mode)
|
||||
$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][1] = $langs->trans("InputPerTime");
|
||||
$head[$h][2] = 'inputpertime';
|
||||
$head[$h][0] = DOL_URL_ROOT."/projet/activity/peraction.php".($mode?'?mode='.$mode:'');
|
||||
$head[$h][1] = $langs->trans("InputPerAction");
|
||||
$head[$h][2] = 'inputperaction';
|
||||
$h++;
|
||||
}
|
||||
}*/
|
||||
|
||||
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
|
||||
* @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 $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;
|
||||
|
||||
$var=true;
|
||||
@ -617,7 +619,7 @@ function projectLinesPerTime(&$inc, $parent, $lines, &$level, &$projectsrole, &$
|
||||
print '</td><td align="right">';
|
||||
//$s.=' ';
|
||||
$s=$form->select_duration($lines[$i]->id.'duration','',$disabledtask,'text',0,1);
|
||||
$s.=' <input type="submit" class="button"'.($disabledtask?' disabled="disabled"':'').' value="'.$langs->trans("Add").'">';
|
||||
//$s.=' <input type="submit" class="button"'.($disabledtask?' disabled="disabled"':'').' value="'.$langs->trans("Add").'">';
|
||||
print $s;
|
||||
print '</td>';
|
||||
|
||||
@ -631,7 +633,7 @@ function projectLinesPerTime(&$inc, $parent, $lines, &$level, &$projectsrole, &$
|
||||
|
||||
$inc++;
|
||||
$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--;
|
||||
}
|
||||
else
|
||||
@ -649,6 +651,8 @@ function projectLinesPerTime(&$inc, $parent, $lines, &$level, &$projectsrole, &$
|
||||
* Output a task line into a perday intput mode
|
||||
*
|
||||
* @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 Task[] $lines Array of lines
|
||||
* @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
|
||||
* @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 $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;
|
||||
|
||||
$var=true;
|
||||
@ -687,7 +685,7 @@ function projectLinesPerDay(&$inc, $parent, $lines, &$level, &$projectsrole, &$t
|
||||
$lastprojectid=$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
|
||||
@ -708,17 +706,18 @@ function projectLinesPerDay(&$inc, $parent, $lines, &$level, &$projectsrole, &$t
|
||||
print '<td class="nowrap">';
|
||||
$taskstatic->id=$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>';
|
||||
|
||||
// Label task
|
||||
print "<td>";
|
||||
print '<!-- Task id = '.$lines[$i]->id.' -->';
|
||||
for ($k = 0 ; $k < $level ; $k++) print " ";
|
||||
$taskstatic->id=$lines[$i]->id;
|
||||
$taskstatic->ref=$lines[$i]->label;
|
||||
$taskstatic->date_start=$lines[$i]->date_start;
|
||||
$taskstatic->date_end=$lines[$i]->date_end;
|
||||
print $taskstatic->getNomUrl(0);
|
||||
print $taskstatic->getNomUrl(0, 'withproject', 'time');
|
||||
//print "<br>";
|
||||
//for ($k = 0 ; $k < $level ; $k++) print " ";
|
||||
//print get_date_range($lines[$i]->date_start,$lines[$i]->date_end,'',$langs,0);
|
||||
@ -770,18 +769,22 @@ function projectLinesPerDay(&$inc, $parent, $lines, &$level, &$projectsrole, &$t
|
||||
$disabledtask=1;
|
||||
}
|
||||
|
||||
//var_dump($projectstatic->weekWorkLoad);
|
||||
//var_dump($projectstatic->weekWorkLoadPerTask);
|
||||
|
||||
// Fields to show current time
|
||||
$tableCell=''; $modeinput='hours';
|
||||
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.='<span class="timesheetalreadyrecorded"><input type="text" class="center" size="2" disabled="disabled" value="'.convertSecondToTime($dayWorkLoad,'allhourmin').'"></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.='<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.='+';
|
||||
$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.= 'onblur="regexEvent(this,event,\''.$modeinput.'\');updateTotal('.$idw.',\''.$modeinput.'\')" />';
|
||||
$tableCell.= 'onblur="regexEvent(this,event,\''.$modeinput.'\'); updateTotal('.$idw.',\''.$modeinput.'\')" />';
|
||||
$tableCell.='</td>';
|
||||
print $tableCell;
|
||||
}
|
||||
@ -790,7 +793,7 @@ function projectLinesPerDay(&$inc, $parent, $lines, &$level, &$projectsrole, &$t
|
||||
|
||||
$inc++;
|
||||
$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--;
|
||||
}
|
||||
else
|
||||
|
||||
@ -31,7 +31,7 @@
|
||||
* @param array $fulltree Array of entries in correct order
|
||||
* @param string $key Key of entry into fulltree to show picto
|
||||
* @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)
|
||||
{
|
||||
|
||||
@ -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', 3701__+MAX_llx_menu__, 'project', '', 3700__+MAX_llx_menu__, '/projet/tasks.php?leftmenu=projects&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', 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&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&action=create&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&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&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&mode=mine', 'NewTimeSpent', 1, 'projects', '$user->rights->projet->lire', '', 2, 3, __ENTITY__);
|
||||
-- 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', 3901__+MAX_llx_menu__, 'tools', '', 3900__+MAX_llx_menu__, '/comm/mailing/card.php?leftmenu=mailing&action=create', 'NewMailing', 1, 'mails', '$user->rights->mailing->creer', '', 0, 0, __ENTITY__);
|
||||
|
||||
@ -158,7 +158,7 @@ class MenuManager
|
||||
* Show menu
|
||||
*
|
||||
* @param string $mode 'top', 'left', 'jmobile'
|
||||
* @return void
|
||||
* @return string
|
||||
*/
|
||||
function showmenu($mode)
|
||||
{
|
||||
|
||||
@ -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/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/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
|
||||
$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/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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -112,7 +112,7 @@ class MenuManager
|
||||
* Show menu
|
||||
*
|
||||
* @param string $mode 'top', 'left', 'jmobile'
|
||||
* @return void
|
||||
* @return string
|
||||
*/
|
||||
function showmenu($mode)
|
||||
{
|
||||
|
||||
@ -61,7 +61,7 @@ class MenuManager
|
||||
* Show menu
|
||||
*
|
||||
* @param string $mode 'top', 'left', 'jmobile'
|
||||
* @return void
|
||||
* @return string
|
||||
*/
|
||||
function showmenu($mode)
|
||||
{
|
||||
|
||||
@ -303,7 +303,7 @@ class CommActionRapport
|
||||
* @param PDF $pdf Object PDF
|
||||
* @param Translate $outputlangs Object lang for output
|
||||
* @param int $pagenb Page nb
|
||||
* @return void
|
||||
* @return integer
|
||||
*/
|
||||
function _pagehead(&$pdf, $outputlangs, $pagenb)
|
||||
{
|
||||
|
||||
@ -108,7 +108,7 @@ class modPhpbarcode extends ModeleBarCode
|
||||
* @param string $code Value to encode
|
||||
* @param string $encoding Mode of encoding
|
||||
* @param string $readable Code can be read
|
||||
* @param string $scale Scale
|
||||
* @param integer $scale Scale
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*/
|
||||
function buildBarCode($code,$encoding,$readable='Y',$scale=1)
|
||||
@ -148,7 +148,7 @@ class modPhpbarcode extends ModeleBarCode
|
||||
* @param string $code Value to encode
|
||||
* @param string $encoding Mode of encoding
|
||||
* @param string $readable Code can be read
|
||||
* @param string $scale Scale
|
||||
* @param integer $scale Scale
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*/
|
||||
function writeBarCode($code,$encoding,$readable='Y',$scale=1)
|
||||
|
||||
@ -42,7 +42,7 @@ abstract class ModeleChequeReceipts extends CommonDocGenerator
|
||||
* Return list of active generation modules
|
||||
*
|
||||
* @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
|
||||
*/
|
||||
static function liste_modeles($db,$maxfilenamelength=0)
|
||||
|
||||
@ -74,7 +74,7 @@ class ExportCsv extends ModeleExports
|
||||
/**
|
||||
* getDriverId
|
||||
*
|
||||
* @return int
|
||||
* @return string
|
||||
*/
|
||||
function getDriverId()
|
||||
{
|
||||
|
||||
@ -76,7 +76,7 @@ class ExportExcel extends ModeleExports
|
||||
/**
|
||||
* getDriverId
|
||||
*
|
||||
* @return int
|
||||
* @return string
|
||||
*/
|
||||
function getDriverId()
|
||||
{
|
||||
|
||||
@ -69,7 +69,7 @@ class ExportTsv extends ModeleExports
|
||||
/**
|
||||
* getDriverId
|
||||
*
|
||||
* @return int
|
||||
* @return string
|
||||
*/
|
||||
function getDriverId()
|
||||
{
|
||||
|
||||
@ -657,7 +657,7 @@ class pdf_soleil extends ModelePDFFicheinter
|
||||
* @param Object $object Object to show
|
||||
* @param Translate $outputlangs Object lang for output
|
||||
* @param int $hidefreetext 1=Hide free text
|
||||
* @return void
|
||||
* @return integer
|
||||
*/
|
||||
function _pagefoot(&$pdf,$object,$outputlangs,$hidefreetext=0)
|
||||
{
|
||||
|
||||
@ -41,7 +41,7 @@ abstract class ModelePDFFicheinter extends CommonDocGenerator
|
||||
* Return list of active generation modules
|
||||
*
|
||||
* @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
|
||||
*/
|
||||
static function liste_modeles($db,$maxfilenamelength=0)
|
||||
|
||||
@ -88,7 +88,7 @@ class ImportCsv extends ModeleImports
|
||||
/**
|
||||
* getDriverId
|
||||
*
|
||||
* @return int Id
|
||||
* @return string Id
|
||||
*/
|
||||
function getDriverId()
|
||||
{
|
||||
@ -305,7 +305,7 @@ class ImportCsv extends ModeleImports
|
||||
/**
|
||||
* Close file handle
|
||||
*
|
||||
* @return void
|
||||
* @return integer
|
||||
*/
|
||||
function import_close_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 string Example
|
||||
* @return integer Example
|
||||
*/
|
||||
function getNbOfRecords()
|
||||
{
|
||||
|
||||
@ -57,7 +57,7 @@ class mailing_pomme extends MailingTargets
|
||||
* array of SQL request that returns two field:
|
||||
* One called "label", One called "nb".
|
||||
*
|
||||
* @return array Array with SQL requests
|
||||
* @return string[] Array with SQL requests
|
||||
*/
|
||||
function getSqlArrayForStats()
|
||||
{
|
||||
|
||||
@ -41,7 +41,7 @@ class ModelePDFCards
|
||||
* Return list of active generation modules
|
||||
*
|
||||
* @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
|
||||
*/
|
||||
function liste_modeles($db,$maxfilenamelength=0)
|
||||
|
||||
@ -21,7 +21,7 @@
|
||||
*/
|
||||
|
||||
/**
|
||||
* \defgroup askpricesupplier Module to request supplier price proposals
|
||||
* \defgroup askpricesupplier Module askpricesupplier
|
||||
* \brief Module to request supplier price proposals
|
||||
* \file htdocs/core/modules/modAskPriceSupplier.class.php
|
||||
* \ingroup askpricesupplier
|
||||
|
||||
@ -17,14 +17,13 @@
|
||||
*/
|
||||
|
||||
/**
|
||||
* \defgroup Indicateurs
|
||||
* \brief Module indicateurs
|
||||
* Such a file must be copied into htdocs/includes/module directory.
|
||||
* \defgroup expensereport Module expensereport
|
||||
* \brief Module to manage expense report. Replace old module Deplacement.
|
||||
*/
|
||||
|
||||
/**
|
||||
* \file htdocs/indicateurs/core/modules/modExpenseReport.class.php
|
||||
* \ingroup indicateur
|
||||
* \file htdocs/core/modules/modExpenseReport.class.php
|
||||
* \ingroup expensereport
|
||||
* \brief Description and activation file for module ExpenseReport
|
||||
*/
|
||||
include_once(DOL_DOCUMENT_ROOT ."/core/modules/DolibarrModules.class.php");
|
||||
|
||||
@ -17,7 +17,7 @@
|
||||
*/
|
||||
|
||||
/**
|
||||
* \defgroup ftp Module FTP
|
||||
* \defgroup ftp Module ftp
|
||||
* \brief Module for FTP client module
|
||||
* \file htdocs/core/modules/modFTP.class.php
|
||||
* \ingroup ftp
|
||||
|
||||
@ -21,7 +21,7 @@
|
||||
*/
|
||||
|
||||
/**
|
||||
* \defgroup ficheinter Module intervention cards
|
||||
* \defgroup ficheinter Module Interventions
|
||||
* \brief Module to manage intervention cards
|
||||
* \file htdocs/core/modules/modFicheinter.class.php
|
||||
* \ingroup ficheinter
|
||||
|
||||
@ -16,7 +16,7 @@
|
||||
*/
|
||||
|
||||
/**
|
||||
* \defgroup geoip Module GeoIP
|
||||
* \defgroup geoip Module geoipmaxmind
|
||||
* \brief Module to make geoip conversions
|
||||
* \file htdocs/core/modules/modGeoIPMaxmind.class.php
|
||||
* \ingroup geoip
|
||||
|
||||
@ -17,7 +17,7 @@
|
||||
*/
|
||||
|
||||
/**
|
||||
* \defgroup resource Resource module
|
||||
* \defgroup resource Module resource
|
||||
* \brief Resource module descriptor.
|
||||
* \file core/modules/modResource.class.php
|
||||
* \ingroup resource
|
||||
|
||||
@ -41,7 +41,7 @@ class ModelePDFLabels
|
||||
* Return list of active generation modules
|
||||
*
|
||||
* @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
|
||||
*/
|
||||
function liste_modeles($db,$maxfilenamelength=0)
|
||||
|
||||
@ -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.'/core/lib/company.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
|
||||
$this->posxref=$this->marge_gauche+1;
|
||||
$this->posxlabel=$this->marge_gauche+25;
|
||||
$this->posxworkload=$this->marge_gauche+100;
|
||||
$this->posxprogress=$this->marge_gauche+140;
|
||||
$this->posxdatestart=$this->marge_gauche+150;
|
||||
$this->posxdateend=$this->marge_gauche+170;
|
||||
@ -216,20 +218,22 @@ class pdf_baleine extends ModelePDFProjects
|
||||
$progress=$object->lines[$i]->progress.'%';
|
||||
$datestart=dol_print_date($object->lines[$i]->date_start,'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->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->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->MultiCell(16, 3, $progress, 0, 'L');
|
||||
$pdf->MultiCell($this->posxdatestart-$this->posxprogress, 3, $progress, 0, 'R');
|
||||
$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->MultiCell(20, 3, $dateend, 0, 'L');
|
||||
$pdf->MultiCell($this->page_largeur-$this->marge_droite-$this->posxdateend, 3, $dateend, 0, 'C');
|
||||
|
||||
|
||||
$pageposafter=$pdf->getPage();
|
||||
@ -362,8 +366,23 @@ class pdf_baleine extends ModelePDFProjects
|
||||
$pdf->SetTextColor(0,0,0);
|
||||
$pdf->SetFont('','', $default_font_size);
|
||||
|
||||
$pdf->SetXY($this->posxref-1, $tab_top+2);
|
||||
$pdf->MultiCell(80,2, $outputlangs->transnoentities("Tasks"),'','L');
|
||||
$pdf->SetXY($this->posxref, $tab_top+1);
|
||||
$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.
|
||||
*
|
||||
* @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 Translate $outputlangs Object lang for output
|
||||
* @return void
|
||||
@ -457,10 +476,10 @@ class pdf_baleine extends ModelePDFProjects
|
||||
* Show footer of page. Need this->emetteur object
|
||||
*
|
||||
* @param PDF $pdf PDF
|
||||
* @param Object $object Object to show
|
||||
* @param Project $object Object to show
|
||||
* @param Translate $outputlangs Object lang for output
|
||||
* @param int $hidefreetext 1=Hide free text
|
||||
* @return void
|
||||
* @return integer
|
||||
*/
|
||||
function _pagefoot(&$pdf,$object,$outputlangs,$hidefreetext=0)
|
||||
{
|
||||
|
||||
@ -38,7 +38,7 @@ abstract class ModelePDFProjects extends CommonDocGenerator
|
||||
* Return list of active generation modules
|
||||
*
|
||||
* @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
|
||||
*/
|
||||
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
|
||||
*
|
||||
* @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 Translate $outputlangs objet lang a utiliser pour traduction
|
||||
* @param int $hidedetails Hide details of lines
|
||||
|
||||
@ -106,7 +106,7 @@ class doc_generic_task_odt extends ModelePDFTask
|
||||
/**
|
||||
* 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
|
||||
* @return array Array of substitution
|
||||
*/
|
||||
|
||||
@ -39,7 +39,7 @@ abstract class ModelePDFTask extends CommonDocGenerator
|
||||
* Return list of active generation modules
|
||||
*
|
||||
* @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
|
||||
*/
|
||||
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
|
||||
*
|
||||
* @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 Translate $outputlangs objet lang a utiliser pour traduction
|
||||
* @param int $hidedetails Hide details of lines
|
||||
|
||||
@ -45,8 +45,8 @@ class mod_codecompta_aquarium extends ModeleAccountancyCode
|
||||
function __construct()
|
||||
{
|
||||
global $conf;
|
||||
if (empty($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_CUSTOMER) || trim($conf->global->COMPANY_AQUARIUM_MASK_CUSTOMER) == '') $conf->global->COMPANY_AQUARIUM_MASK_CUSTOMER='411';
|
||||
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->prefixsupplieraccountancycode=$conf->global->COMPANY_AQUARIUM_MASK_SUPPLIER;
|
||||
}
|
||||
|
||||
@ -554,7 +554,7 @@ class pdf_muscadet extends ModelePDFSuppliersOrders
|
||||
* Show payments table
|
||||
*
|
||||
* @param PDF $pdf Object PDF
|
||||
* @param Object $object Object order
|
||||
* @param CommandeFournisseur $object Object order
|
||||
* @param int $posy Position y in PDF
|
||||
* @param Translate $outputlangs Object langs for output
|
||||
* @return int <0 if KO, >0 if OK
|
||||
@ -569,10 +569,10 @@ class pdf_muscadet extends ModelePDFSuppliersOrders
|
||||
* Show miscellaneous information (payment mode, payment term, ...)
|
||||
*
|
||||
* @param PDF $pdf Object PDF
|
||||
* @param Object $object Object to show
|
||||
* @param CommandeFournisseur $object Object to show
|
||||
* @param int $posy Y
|
||||
* @param Translate $outputlangs Langs object
|
||||
* @return void
|
||||
* @return integer
|
||||
*/
|
||||
function _tableau_info(&$pdf, $object, $posy, $outputlangs)
|
||||
{
|
||||
@ -938,7 +938,7 @@ class pdf_muscadet extends ModelePDFSuppliersOrders
|
||||
* Show top header of page.
|
||||
*
|
||||
* @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 Translate $outputlangs Object lang for output
|
||||
* @return void
|
||||
@ -1139,7 +1139,7 @@ class pdf_muscadet extends ModelePDFSuppliersOrders
|
||||
* Show footer of page. Need this->emetteur object
|
||||
*
|
||||
* @param PDF $pdf PDF
|
||||
* @param Object $object Object to show
|
||||
* @param CommandeFournisseur $object Object to show
|
||||
* @param Translate $outputlangs Object lang for output
|
||||
* @param int $hidefreetext 1=Hide free text
|
||||
* @return int Return height of bottom margin including footer text
|
||||
|
||||
@ -114,7 +114,7 @@ class mod_syslog_chromephp extends LogHandler implements LogHandlerInterface
|
||||
* Output log content
|
||||
*
|
||||
* @param array $content Content to log
|
||||
* @return void
|
||||
* @return null|false
|
||||
*/
|
||||
public function export($content)
|
||||
{
|
||||
|
||||
@ -111,7 +111,7 @@ class mod_syslog_firephp extends LogHandler implements LogHandlerInterface
|
||||
* Output log content
|
||||
*
|
||||
* @param array $content Content to log
|
||||
* @return void
|
||||
* @return null|false
|
||||
*/
|
||||
public function export($content)
|
||||
{
|
||||
|
||||
@ -274,7 +274,7 @@ else {
|
||||
$newline = new PropaleLigne($this->db);
|
||||
}
|
||||
elseif ($this->table_element_line=='askpricesupplierdet') {
|
||||
$newline = new AskPriceSupplierLigne($this->db);
|
||||
$newline = new AskPriceSupplierLine($this->db);
|
||||
}
|
||||
elseif ($this->table_element_line=='facturedet') {
|
||||
$newline = new FactureLigne($this->db);
|
||||
|
||||
@ -40,6 +40,7 @@ class InterfaceNotification extends DolibarrTriggers
|
||||
'ORDER_VALIDATE',
|
||||
'PROPAL_VALIDATE',
|
||||
'FICHINTER_VALIDATE',
|
||||
'ORDER_SUPPLIER_VALIDATE',
|
||||
'ORDER_SUPPLIER_APPROVE',
|
||||
'ORDER_SUPPLIER_REFUSE',
|
||||
'SHIPPING_VALIDATE'
|
||||
@ -84,8 +85,8 @@ class InterfaceNotification extends DolibarrTriggers
|
||||
|
||||
$sql = "SELECT rowid, code, label, description, elementtype";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."c_action_trigger";
|
||||
$sql.= $this->db->order("elementtype, code");
|
||||
dol_syslog("Get list of notifications", LOG_DEBUG);
|
||||
$sql.= $this->db->order("rang, elementtype, code");
|
||||
dol_syslog("getListOfManagedEvents Get list of notifications", LOG_DEBUG);
|
||||
$resql=$this->db->query($sql);
|
||||
if ($resql)
|
||||
{
|
||||
@ -103,13 +104,14 @@ class InterfaceNotification extends DolibarrTriggers
|
||||
{
|
||||
//print 'xx'.$obj->code;
|
||||
$element=$obj->elementtype;
|
||||
|
||||
// Exclude events if related module is disabled
|
||||
if ($element == 'order_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 == 'shipping' && empty($conf->expedition->enabled)) $qualified=0;
|
||||
elseif ($element == 'member' && empty($conf->adherent->enabled)) $qualified=0;
|
||||
elseif (! in_array($element,array('order_supplier','invoice_supplier','withdraw','shipping','member'))
|
||||
&& empty($conf->$element->enabled)) $qualified=0;
|
||||
elseif (! in_array($element,array('order_supplier','invoice_supplier','withdraw','shipping','member')) && empty($conf->$element->enabled)) $qualified=0;
|
||||
}
|
||||
|
||||
if ($qualified)
|
||||
|
||||
@ -602,7 +602,7 @@ if ($action == 'create')
|
||||
print $form->select_incoterms((!empty($object->fk_incoterms) ? $object->fk_incoterms : ''), (!empty($object->location_incoterms)?$object->location_incoterms:''));
|
||||
print '</td></tr>';
|
||||
}
|
||||
|
||||
|
||||
// Other attributes
|
||||
$parameters=array('colspan' => ' colspan="3"');
|
||||
$reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$expe,$action); // Note that $action and $object may have been modified by hook
|
||||
@ -934,7 +934,7 @@ else if ($id || $ref)
|
||||
require_once DOL_DOCUMENT_ROOT .'/core/class/notify.class.php';
|
||||
$notify=new Notify($db);
|
||||
$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);
|
||||
@ -1193,7 +1193,7 @@ else if ($id || $ref)
|
||||
|
||||
// Incoterms
|
||||
if (!empty($conf->incoterm->enabled))
|
||||
{
|
||||
{
|
||||
print '<tr><td>';
|
||||
print '<table width="100%" class="nobordernopadding"><tr><td>';
|
||||
print $langs->trans('IncotermLabel');
|
||||
@ -1207,7 +1207,7 @@ else if ($id || $ref)
|
||||
{
|
||||
print $form->textwithpicto($object->display_incoterms(), $object->libelle_incoterms, 1);
|
||||
}
|
||||
else
|
||||
else
|
||||
{
|
||||
print $form->select_incoterms((!empty($object->fk_incoterms) ? $object->fk_incoterms : ''), (!empty($object->location_incoterms)?$object->location_incoterms:''), $_SERVER['PHP_SELF'].'?id='.$object->id);
|
||||
}
|
||||
|
||||
@ -20,6 +20,7 @@
|
||||
|
||||
/**
|
||||
* \file htdocs/expensereport/ajax/ajaxprojet.php
|
||||
* \ingroup expensereport
|
||||
* \brief File to return Ajax response on third parties request
|
||||
*/
|
||||
|
||||
|
||||
@ -19,7 +19,8 @@
|
||||
|
||||
/**
|
||||
* \file htdocs/expensereport/card.php
|
||||
* \brief Page for trip and expense card
|
||||
* \ingroup expensereport
|
||||
* \brief Page for trip and expense report card
|
||||
*/
|
||||
|
||||
$res=0;
|
||||
@ -1135,7 +1136,7 @@ if ($action == 'create')
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
}
|
||||
|
||||
|
||||
// Public note
|
||||
print '<tr>';
|
||||
print '<td class="border" valign="top">' . $langs->trans('NotePublic') . '</td>';
|
||||
@ -1155,7 +1156,7 @@ if ($action == 'create')
|
||||
print $doleditor->Create(1);
|
||||
print '</td></tr>';
|
||||
}
|
||||
|
||||
|
||||
print '<tbody>';
|
||||
print '</table>';
|
||||
|
||||
@ -1286,7 +1287,7 @@ else
|
||||
print '</td></tr>';
|
||||
|
||||
}
|
||||
|
||||
|
||||
// Public note
|
||||
print '<tr>';
|
||||
print '<td class="border" valign="top">' . $langs->trans('NotePublic') . '</td>';
|
||||
@ -1295,7 +1296,7 @@ else
|
||||
$doleditor = new DolEditor('note_public', $object->note_public, '', 80, 'dolibarr_notes', 'In', 0, false, true, ROWS_3, 70);
|
||||
print $doleditor->Create(1);
|
||||
print '</td></tr>';
|
||||
|
||||
|
||||
// Private note
|
||||
if (empty($user->societe_id)) {
|
||||
print '<tr>';
|
||||
@ -1306,7 +1307,7 @@ else
|
||||
print $doleditor->Create(1);
|
||||
print '</td></tr>';
|
||||
}
|
||||
|
||||
|
||||
print '</table>';
|
||||
|
||||
dol_fiche_end();
|
||||
|
||||
@ -16,6 +16,11 @@
|
||||
* 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';
|
||||
|
||||
/**
|
||||
@ -1420,7 +1425,7 @@ class ExpenseReport extends CommonObject
|
||||
|
||||
return $this->commonGenerateDocument($modelpath, $modele, $outputlangs, $hidedetails, $hidedesc, $hideref);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* List of types
|
||||
*
|
||||
|
||||
@ -19,7 +19,7 @@
|
||||
|
||||
/**
|
||||
* \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
|
||||
*/
|
||||
include_once DOL_DOCUMENT_ROOT . '/core/class/stats.class.php';
|
||||
|
||||
@ -17,6 +17,7 @@
|
||||
|
||||
/**
|
||||
* \file htdocs/expensereport/index.php
|
||||
* \ingroup expensereport
|
||||
* \brief Page list of expenses
|
||||
*/
|
||||
|
||||
|
||||
@ -21,6 +21,7 @@
|
||||
|
||||
/**
|
||||
* \file htdocs/expensereport/index.php
|
||||
* \ingroup expensereport
|
||||
* \brief Page list of expenses
|
||||
*/
|
||||
|
||||
|
||||
@ -19,7 +19,7 @@
|
||||
|
||||
/**
|
||||
* \file htdocs/expensereport/info.php
|
||||
* \ingroup trip
|
||||
* \ingroup expensereport
|
||||
* \brief Page to show a trip information
|
||||
*/
|
||||
|
||||
|
||||
@ -21,6 +21,7 @@
|
||||
|
||||
/**
|
||||
* \file htdocs/expensereport/index.php
|
||||
* \ingroup expensereport
|
||||
* \brief list of expense reports
|
||||
*/
|
||||
|
||||
|
||||
@ -337,13 +337,15 @@ class Export
|
||||
/**
|
||||
* 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 $ValueField Initial value of the field to filter
|
||||
* @return string html string of the input field ex : "<input type=text name=... value=...>"
|
||||
*/
|
||||
function build_filterField($TypeField, $NameField, $ValueField)
|
||||
{
|
||||
global $langs;
|
||||
|
||||
$szFilterField='';
|
||||
$InfoFieldList = explode(":", $TypeField);
|
||||
|
||||
@ -354,7 +356,7 @@ class Export
|
||||
case 'Date':
|
||||
case 'Duree':
|
||||
case 'Numeric':
|
||||
$szFilterField='<input type="text" name='.$NameField." value='".$ValueField."'>";
|
||||
$szFilterField='<input type="text" name="'.$NameField.'" value="'.$ValueField.'">';
|
||||
break;
|
||||
case 'Boolean':
|
||||
$szFilterField='<select name="'.$NameField.'" class="flat">';
|
||||
@ -375,12 +377,14 @@ class Export
|
||||
// 0 : Type du champ
|
||||
// 1 : Nom de la table
|
||||
// 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)
|
||||
$keyList=$InfoFieldList[3];
|
||||
else
|
||||
$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];
|
||||
|
||||
$resql = $this->db->query($sql);
|
||||
@ -396,14 +400,25 @@ class Export
|
||||
while ($i < $num)
|
||||
{
|
||||
$obj = $this->db->fetch_object($resql);
|
||||
if ($obj->$InfoFieldList[2] == '-')
|
||||
if ($obj->label == '-')
|
||||
{
|
||||
// Discard entry '-'
|
||||
$i++;
|
||||
continue;
|
||||
}
|
||||
|
||||
$labeltoshow=dol_trunc($obj->$InfoFieldList[2],18);
|
||||
//var_dump($InfoFieldList[1]);
|
||||
$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)
|
||||
{
|
||||
$szFilterField.='<option value="'.$obj->rowid.'" selected="selected">'.$labeltoshow.'</option>';
|
||||
@ -417,8 +432,9 @@ class Export
|
||||
}
|
||||
$szFilterField.="</select>";
|
||||
|
||||
$this->db->free();
|
||||
$this->db->free($resql);
|
||||
}
|
||||
else dol_print_error($this->db);
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
@ -1210,7 +1210,9 @@ else if ($id > 0 || ! empty($ref))
|
||||
if (!$formconfirm)
|
||||
{
|
||||
$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
|
||||
|
||||
@ -1657,7 +1657,7 @@ elseif (! empty($object->id))
|
||||
require_once DOL_DOCUMENT_ROOT .'/core/class/notify.class.php';
|
||||
$notify=new Notify($db);
|
||||
$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);
|
||||
@ -1733,7 +1733,9 @@ elseif (! empty($object->id))
|
||||
|
||||
if (!$formconfirm) {
|
||||
$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
|
||||
|
||||
@ -1664,7 +1664,7 @@ else
|
||||
require_once DOL_DOCUMENT_ROOT .'/core/class/notify.class.php';
|
||||
$notify=new Notify($db);
|
||||
$text.='<br>';
|
||||
$text.=$notify->confirmMessage('BILL_SUPPLIER_VALIDATE',$object->socid);
|
||||
$text.=$notify->confirmMessage('BILL_SUPPLIER_VALIDATE',$object->socid, $object);
|
||||
}*/
|
||||
$formquestion=array();
|
||||
|
||||
@ -1716,7 +1716,9 @@ else
|
||||
|
||||
if (!$formconfirm) {
|
||||
$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
|
||||
|
||||
@ -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";
|
||||
if (!$user->rights->societe->client->voir && !$socid) $sql .= ", sc.fk_soc, sc.fk_user ";
|
||||
// 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
|
||||
$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.= " FROM ".MAIN_DB_PREFIX."societe as s";
|
||||
$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";
|
||||
// Add where from hooks
|
||||
$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
|
||||
$nbtotalofrecords = 0;
|
||||
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("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);
|
||||
|
||||
$parameters=array();
|
||||
$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);
|
||||
|
||||
$parameters=array();
|
||||
$formconfirm=$hookmanager->executeHooks('printFieldListTitle',$parameters); // Note that $action and $object may have been modified by hook
|
||||
|
||||
print "</tr>\n";
|
||||
|
||||
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 '</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 '<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";
|
||||
|
||||
$parameters=array();
|
||||
$formconfirm=$hookmanager->executeHooks('printFieldListOption',$parameters); // Note that $action and $object may have been modified by hook
|
||||
|
||||
print '</tr>';
|
||||
|
||||
$var=True;
|
||||
@ -241,12 +244,13 @@ if ($resql)
|
||||
print '<td>'.$obj->town.'</td>'."\n";
|
||||
print '<td align="left">'.$obj->code_fournisseur.' </td>';
|
||||
print '<td align="left">'.$obj->code_compta_fournisseur.' </td>';
|
||||
print '<td align="right">';
|
||||
print dol_print_date($db->jdate($obj->datec),'day').'</td>';
|
||||
print '<td align="right">'.$thirdpartystatic->getLibStatut(3).'</td>';
|
||||
print '<td align="right">'.dol_print_date($db->jdate($obj->datec),'day').'</td>';
|
||||
|
||||
$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";
|
||||
$i++;
|
||||
@ -256,7 +260,8 @@ if ($resql)
|
||||
$db->free($resql);
|
||||
|
||||
$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
|
||||
{
|
||||
|
||||
@ -634,7 +634,7 @@ llxFooter();
|
||||
* @param string $ftp_user FTP user
|
||||
* @param string $ftp_password FTP password
|
||||
* @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
|
||||
*/
|
||||
function dol_ftp_connect($ftp_server, $ftp_port, $ftp_user, $ftp_password, $section, $ftp_passive=0)
|
||||
|
||||
@ -1754,7 +1754,7 @@ function show_elem($fieldssource,$pos,$key,$var,$nostyle='')
|
||||
*
|
||||
* @param array $fieldssource Array of field source
|
||||
* @param array $listofkey Array of keys
|
||||
* @return void
|
||||
* @return integer
|
||||
*/
|
||||
function getnewkey(&$fieldssource,&$listofkey)
|
||||
{
|
||||
|
||||
@ -776,7 +776,7 @@ function write_master_file($masterfile,$main_dir)
|
||||
* Save configuration file. No particular permissions are set by installer.
|
||||
*
|
||||
* @param string $conffile Path to conf file to generate/update
|
||||
* @return void
|
||||
* @return integer
|
||||
*/
|
||||
function write_conf_file($conffile)
|
||||
{
|
||||
|
||||
@ -411,10 +411,10 @@ function pHeader($subtitle,$next,$action='set',$param='',$forcejqueryurl='')
|
||||
/**
|
||||
* 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 $jscheckfunction Add a javascript check function
|
||||
* @param string $withpleasewait Add also please wait tags
|
||||
* @param integer $withpleasewait Add also please wait tags
|
||||
* @return void
|
||||
*/
|
||||
function pFooter($nonext=0,$setuplang='',$jscheckfunction='', $withpleasewait=0)
|
||||
|
||||
@ -31,8 +31,8 @@
|
||||
--
|
||||
|
||||
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 ( 0, 'ST_NEVER', 'Jamais contacté');
|
||||
insert into llx_c_stcomm (id,code,libelle) values ( 1, 'ST_TODO', 'A contacter');
|
||||
insert into llx_c_stcomm (id,code,libelle) values ( 2, 'ST_PEND', 'Contact en cours');
|
||||
insert into llx_c_stcomm (id,code,libelle) values ( 3, 'ST_DONE', 'Contactée');
|
||||
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', 'Never contacted');
|
||||
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 in progress');
|
||||
insert into llx_c_stcomm (id,code,libelle) values ( 3, 'ST_DONE', 'Contacted');
|
||||
|
||||
@ -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;
|
||||
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;
|
||||
|
||||
@ -392,3 +395,43 @@ create table llx_payment_donation
|
||||
fk_user_creat integer, -- creation user
|
||||
fk_user_modif integer -- last modification user
|
||||
)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);
|
||||
|
||||
@ -22,9 +22,9 @@
|
||||
create table llx_c_action_trigger
|
||||
(
|
||||
rowid integer AUTO_INCREMENT PRIMARY KEY,
|
||||
elementtype varchar(16) NOT NULL,
|
||||
code varchar(32) NOT NULL,
|
||||
label varchar(128) NOT NULL,
|
||||
description varchar(255),
|
||||
elementtype varchar(16) NOT NULL,
|
||||
rang integer DEFAULT 0
|
||||
)ENGINE=innodb;
|
||||
|
||||
@ -47,7 +47,7 @@ $ok = 0;
|
||||
// Ne fonctionne que si on est pas en safe_mode.
|
||||
$err=error_reporting();
|
||||
error_reporting(0);
|
||||
@set_time_limit(120);
|
||||
@set_time_limit(300);
|
||||
error_reporting($err);
|
||||
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user