develop

Conflicts:
	htdocs/core/modules/mailings/thirdparties_services_expired.modules.php
	htdocs/fourn/class/fournisseur.product.class.php
	htdocs/opensurvey/fonctions.php
	htdocs/opensurvey/public/choix_date.php
	htdocs/opensurvey/public/create_survey.php
	htdocs/opensurvey/public/exportcsv.php
	htdocs/public/paybox/paymentko.php

Change-Id: I57468f3a0f6bb1115bd48b84517060432102c2ea
This commit is contained in:
fhenry 2013-04-11 10:04:27 +02:00
commit 2440513007
44 changed files with 231 additions and 674 deletions

View File

@ -1,21 +0,0 @@
README (English)
--------------------------------
This directory contains example of PHPCheckStyle configuration
to use for quality assurance on PHP developpement.
To run PHPCheckstyle in eclipse, you must:
- install plugin PHP Tools integration http://www.phpsrc.org/eclipse/pti/
- Unzip PHPCheckStyle archive into a directory.
- Go in Eclipse - Window - Preferences - Dynamic Languages - Validator
Choose External PHP Script,
Set path ro run.php file for localhost
Choose a PHP version,
Set parameter string with
--src %f --config "phpstandard.cfg.xml" --format console
Choose php as Filename extension
Check Print PHP output to console
Then add patern
* %f INFO Line:%n - %m Warning
* %f WARNING Line:%n - %m Warning
* %f ERROR Line:%n - %m Error

View File

@ -1,316 +0,0 @@
<?xml version="1.0"?>
<!DOCTYPE phpstandard SYSTEM "phpstandard.dtd">
<!-- somewhat inspired by java checkstyle -->
<phpcheckstyle-configuration>
<!-- **************** -->
<!-- Naming -->
<!-- **************** -->
<!-- Check Constant Naming -->
<!-- Disabled to avoid warning with $sql="SELECT ..."
<test name="constantNaming" regexp="/^[A-Z_][A-Z_]*[A-Z_]$/" level="ERROR"/>
-->
<!-- Check Variable Naming -->
<test name="variableNaming" regexp="/^[a-zA-Z_][a-zA-Z0-9_]*$/" />
<!-- Check Function Naming -->
<test name="functionNaming" regexp="/^[a-z_]/" level="WARNING"/>
<!-- Check Private Function Naming -->
<test name="privateFunctionNaming" regexp="/^[a-z_]/" level="ERROR"/>
<!-- Checks the constuctor naming -->
<!-- old = old style (constructor = name of the class) -->
<!-- new = "__construct()" -->
<test name="constructorNaming">
<property name="naming" value="old"/>
</test>
<!-- Check Class Naming -->
<test name="classNaming" regexp="/^[A-Z]/" level="WARNING"/>
<!-- **************** -->
<!-- PHP Tags -->
<!-- **************** -->
<!-- Test if a short php code open tag is used (? instead of ?php ). -->
<test name="noShortPhpCodeTag"/>
<!-- Test if a PHP closing file is present at the end of a file -->
<!-- <test name="noFileCloseTag"/> -->
<!-- Test if a file finish with some inner HTML (OK for some view but could provoque "header already sent" error) -->
<!-- <test name="noFileFinishHTML" level="ERROR" /> -->
<!-- **************** -->
<!-- Comments -->
<!-- **************** -->
<!-- Check if some C style comments are used (#) -->
<test name="noShellComments"/>
<!-- Tests that every function and class is immediately preceded by a docblock. A property "excludePrivateMembers" can be set if you want to disable docblocks for private member functions. -->
<test name="docBlocks">
<property name="excludePrivateMembers" value="true"/>
<property name="testReturn" value="true"/>
<property name="testParam" value="true"/>
<property name="testThrow" value="true"/>
</test>
<!-- **************** -->
<!-- Indentation -->
<!-- **************** -->
<!-- Tests to make sure that a line does not contain the tab character. -->
<!-- <test name="noTabs"/> -->
<!-- Test to make sure that every control structure is included within a {} block, even if it is syntactically optional. -->
<!-- <test name="controlStructNeedCurly"/> -->
<!-- Check the position of the open curly brace in a control structure (if) -->
<!-- sl = same line -->
<!-- nl = new line -->
<test name="controlStructOpenCurly">
<property name="position" value="nl"/>
</test>
<!-- Check the position of the close curly brace -->
<test name="controlCloseCurly" level="INFO">
</test>
<!-- Check the position of the open curly brace after a function -->
<!-- sl = same line -->
<!-- nl = new line -->
<test name="funcDefinitionOpenCurly">
<property name="position" value="nl"/>
</test>
<!-- Check the position of the else -->
<!-- sl = same line -->
<!-- nl = new line -->
<test name="controlStructElse">
<property name="position" value="nl"/>
</test>
<!-- **************** -->
<!-- Spaces -->
<!-- **************** -->
<!-- Tests that the control statements ("if", "else", "while", "for", etc.)
are followed by a space before the opening parenthesis.
PEAR standard stipulates this to distinguish it from function calls.
-->
<!--
<test name="spaceAfterControlStmt"/>
-->
<!-- Check that there is no space after a function name in a function call -->
<!-- <test name="noSpaceAfterFunctionName" level="INFO"></test> -->
<!-- Check for the (required) presence of a white space after some tokens (like ,) -->
<!--
<test name="checkWhiteSpaceAfter">
<exception value="."/>
</test>
-->
<!-- Check for the (required) presence of a white space before some tokens -->
<!--
<test name="checkWhiteSpaceBefore">
<exception value="."/>
<exception value=":"/>
</test>
-->
<!-- Check that there is no space before before some tokens -->
<!--
<test name="noSpaceBeforeToken" level="INFO">
</test>
-->
<!-- Check that there is no space after some tokens -->
<!--
<test name="noSpaceAfterToken" level="INFO">
</test>
-->
<!-- **************** -->
<!-- Metrics -->
<!-- **************** -->
<!-- Check that the lenght of the line doesn't pass the max value -->
<test name="lineLength" level="INFO">
<property name="maxLineLength" value="160"/>
</test>
<!-- Checks that the lenght (in lines) of a function doesn't pass the max value -->
<test name="functionLength" level="INFO">
<property name="maxLength" value="500"/>
</test>
<!-- Checks for excessive parameters in a function declaration -->
<!-- <test name="functionMaxParameters">
<property name="maxParameters" value="4"/>
</test> -->
<!-- Check Cyclomatic Complexity -->
<!-- see http://www.aivosto.com/project/help/pm-complexity.html -->
<test name="cyclomaticComplexity">
<!-- Level raising a warning -->
<property name="warningLevel" value="10"/>
<!-- Level raising an error -->
<property name="errorLevel" value="20"/>
</test>
<!-- **************** -->
<!-- Other -->
<!-- **************** -->
<!-- All arguments with default values should be at the end -->
<test name="defaultValuesOrder"/>
<!-- Check for prohibited functions -->
<!-- @see http://www.php.net/manual/en/indexes.php -->
<test name="checkProhibitedFunctions">
<item value="echo"/>
<item value="system"/>
<item value="print_r"/>
<item value="var_dump"/>
<item value="dl"/>
<!--<item value="exec"/>-->
<item value="passthru"/>
<!-- <item value="delete"/> We disable because of false report when using method delete -->
<item value="ereg_replace"/>
<item value="ereg"/>
<item value="eregi"/>
<!-- <item value="copy"/> -->
<!-- <item value="fwrite"/> -->
</test>
<!-- Check for prohibited tokens -->
<!-- @see http://www.php.net/manual/en/tokens.php -->
<test name="checkProhibitedTokens">
<item value="T_BAD_CHARACTER"/>
<item value="T_DECLARE"/>
<item value="T_ENDDECLARE"/>
<item value="T_ENDFOR"/>
<item value="T_ENDFOREACH"/>
<item value="T_ENDIF"/>
<item value="T_ENDSWITCH"/>
<item value="T_ENDWHILE"/>
<item value="T_HALT_COMPILER"/>
<item value="T_OLD_FUNCTION"/>
<!-- <item value="T_PRINT"/> -->
<!-- Same thing as the noShortPhpCodeTag rule -->
<!-- <item value="T_OPEN_TAG_WITH_ECHO"/> -->
<!-- <item value="T_INLINE_HTML"/> -->
<!-- <item value="T_ECHO"/> -->
</test>
<!-- Check for silenced errors before function calls (@function) -->
<test name="checkSilencedError">
<exception value="rename"/> <!-- Exceptions to this rule -->
<exception value="mkdir"/>
<exception value="chmod"/>
</test>
<!-- Check for encapsed variables inside a String ("$a") -->
<test name="encapsedVariablesInsideString">
</test>
<!-- Avoid passing parameters by reference -->
<test name="avoidPassingReferences">
</test>
<test name="showTODOs">
</test>
<!-- Use boolean operators (&&) instead of logical operators (AND) -->
<test name="useBooleanOperators">
</test>
<!-- Check empty block like if ($a) {} -->
<test name="checkEmptyBlock">
<!-- <exception value="catch"/> -->
</test>
<!-- Check empty statement ( ;; ) -->
<test name="checkEmptyStatement">
</test>
<!-- Check for the presence of heredoc -->
<test name="checkHeredoc">
</test>
<!-- Check for braces around code blocs (if, else, elseif, do, while, for, foreach) -->
<!--
<test name="needBraces">
</test>
-->
<!-- Switch need a default value -->
<test name="switchNeedDefault">
</test>
<!-- Switch case should have a break -->
<!-- <test name="switchCaseNeedBreak">
</test> -->
<!-- Switch default value should be at the end -->
<test name="switchDefaultOrder">
</test>
<!--
Avoid using unary operators (++) inside a control statement
With the exception of for iterators, all variable incrementation or decrementation should occur in their own toplevel statement to increase readability.
-->
<test name="checkUnaryOperator">
<exception value="for"/>
</test>
<!--
With inner assignments it is difficult to see all places where a variable is set.
With the exception of for iterators, all assignments should occur in their own toplevel statement to increase readability.
-->
<test name="checkInnerAssignment">
<exception value="for"/>
</test>
<!-- Detect unused private functions (detecting unused public ones is more difficult) -->
<test name="checkUnusedPrivateFunctions">
</test>
<!-- Detect unused variables -->
<test name="checkUnusedVariables">
</test>
<!-- Detect unused function parameters -->
<test name="checkUnusedFunctionParameters">
</test>
<!-- Only one class declaration per PHP file -->
<test name="oneClassPerFile">
</test>
<!-- ******************* -->
<!-- Optimisation -->
<!-- ******************* -->
<!-- Only one class declaration per PHP file -->
<test name="functionInsideLoop">
</test>
</phpcheckstyle-configuration>

View File

@ -1,13 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!ELEMENT phpcheckstyle-configuration (test+)>
<!ELEMENT test (property*,item*,exception*)>
<!ATTLIST test name CDATA "">
<!ATTLIST test regexp CDATA "">
<!ATTLIST test level CDATA "">
<!ELEMENT property (#PCDATA)>
<!ATTLIST property value CDATA "">
<!ATTLIST property name CDATA "">
<!ELEMENT item (#PCDATA)>
<!ATTLIST item value CDATA "">
<!ELEMENT exception (#PCDATA)>
<!ATTLIST exception value CDATA "">

View File

@ -240,7 +240,9 @@ if ($socid)
}
// Address
print '<tr><td valign="top">'.$langs->trans('Address').'</td><td colspan="3">'.nl2br($soc->address).'</td></tr>';
print '<tr><td valign="top">'.$langs->trans('Address').'</td><td colspan="3">';
print dol_print_address($soc->address,'gmap','thirdparty',$object->id);
print '</td></tr>';
// Zip / Town
print '<tr><td width="25%">'.$langs->trans('Zip').'</td><td width="25%">'.$soc->zip."</td>";

View File

@ -589,8 +589,6 @@ if ($action == 'create')
print '<input type="text" name="priority" value="'.(GETPOST('priority')?GETPOST('priority'):($actioncomm->priority?$actioncomm->priority:'')).'" size="5">';
print '</td></tr>';
add_row_for_calendar_link();
// Description
print '<tr><td valign="top">'.$langs->trans("Description").'</td><td>';
require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
@ -1061,90 +1059,8 @@ if ($id > 0)
print '</div>';
}
llxFooter();
$db->close();
/**
* Ajoute une ligne de tableau a 2 colonnes pour avoir l'option synchro calendrier
*
* @return int Retourne le nombre de lignes ajoutees
*/
function add_row_for_calendar_link()
{
global $conf,$langs,$user;
$nbtr=0;
// Lien avec calendrier si module active
// TODO external module
if (! empty($conf->webcalendar->enabled))
{
if ($conf->global->PHPWEBCALENDAR_SYNCRO != 'never')
{
$langs->load("other");
print '<tr><td width="25%" nowrap>'.$langs->trans("AddCalendarEntry","Webcalendar").'</td>';
if (! $user->webcal_login)
{
print '<td><input type="checkbox" disabled name="add_webcal">';
print ' '.$langs->transnoentities("ErrorWebcalLoginNotDefined","<a href=\"".DOL_URL_ROOT."/user/fiche.php?id=".$user->id."\">".$user->login."</a>");
print '</td>';
print '</tr>';
$nbtr++;
}
else
{
if ($conf->global->PHPWEBCALENDAR_SYNCRO == 'always')
{
print '<input type="hidden" name="add_webcal" value="on">';
}
else
{
print '<td><input type="checkbox" name="add_webcal"'.(($conf->global->PHPWEBCALENDAR_SYNCRO=='always' || $conf->global->PHPWEBCALENDAR_SYNCRO=='yesbydefault')?' checked':'').'></td>';
print '</tr>';
$nbtr++;
}
}
}
}
// TODO external module
if (! empty($conf->phenix->enabled))
{
if ($conf->global->PHPPHENIX_SYNCRO != 'never')
{
$langs->load("other");
print '<tr><td width="25%" nowrap>'.$langs->trans("AddCalendarEntry","Phenix").'</td>';
if (! $user->phenix_login)
{
print '<td><input type="checkbox" disabled name="add_phenix">';
print ' '.$langs->transnoentities("ErrorPhenixLoginNotDefined","<a href=\"".DOL_URL_ROOT."/user/fiche.php?id=".$user->id."\">".$user->login."</a>");
print '</td>';
print '</tr>';
$nbtr++;
}
else
{
if ($conf->global->PHPPHENIX_SYNCRO == 'always')
{
print '<input type="hidden" name="add_phenix" value="on">';
}
else
{
print '<td><input type="checkbox" name="add_phenix"'.(($conf->global->PHPPHENIX_SYNCRO=='always' || $conf->global->PHPPHENIX_SYNCRO=='yesbydefault')?' checked':'').'></td>';
print '</tr>';
$nbtr++;
}
}
}
}
return $nbtr;
}
?>

View File

@ -1,6 +1,6 @@
<?php
/* Copyright (C) 2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2005-2010 Laurent Destailleur <eldy@uers.sourceforge.net>
* Copyright (C) 2005-2013 Laurent Destailleur <eldy@uers.sourceforge.net>
* Copyright (C) 2005-2010 Regis Houssin <regis.houssin@capnetworks.com>
*
* This program is free software; you can redistribute it and/or modify
@ -307,7 +307,7 @@ if ($object->fetch($id) >= 0)
print $modulename;
print "</td>";
*/
$nbofrecipient=$obj->getNbOfRecipients();
$nbofrecipient=$obj->getNbOfRecipients('');
print '<td align="center">';
if ($nbofrecipient >= 0)
{
@ -346,21 +346,8 @@ if ($object->fetch($id) >= 0)
print '</table>';
print '<br>';
print '<form action="'.$_SERVER['PHP_SELF'].'?action=clear&id='.$object->id.'" method="POST">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print_titre($langs->trans("ToClearAllRecipientsClickHere"));
print '<table class="noborder" width="100%">';
print '<tr class="liste_titre">';
print '<td class="liste_titre" align="right"><input type="submit" class="button" value="'.$langs->trans("TargetsReset").'"></td>';
print '</tr>';
print '</table>';
print '</form>';
print '<br>';
}
// List of selected targets
print "\n<!-- Liste destinataires selectionnes -->\n";
print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'">';
@ -383,21 +370,23 @@ if ($object->fetch($id) >= 0)
{
$num = $db->num_rows($resql);
$parm = "&amp;id=".$object->id;
if ($search_lastname) $parm.= "&amp;search_lastname=".urlencode($search_lastname);
if ($search_firstname) $parm.= "&amp;search_firstname=".urlencode($search_firstname);
if ($search_email) $parm.= "&amp;search_email=".urlencode($search_email);
$param = "&amp;id=".$object->id;
if ($search_lastname) $param.= "&amp;search_lastname=".urlencode($search_lastname);
if ($search_firstname) $param.= "&amp;search_firstname=".urlencode($search_firstname);
if ($search_email) $param.= "&amp;search_email=".urlencode($search_email);
print_barre_liste($langs->trans("MailSelectedRecipients"),$page,$_SERVER["PHP_SELF"],$parm,$sortfield,$sortorder,"",$num,$object->nbemail,'');
$cleartext='<br></div><div>'.$langs->trans("ToClearAllRecipientsClickHere").': '.'<input type="submit" class="button" value="'.$langs->trans("TargetsReset").'">';
if ($page) $parm.= "&amp;page=".$page;
print_barre_liste($langs->trans("MailSelectedRecipients").$cleartext,$page,$_SERVER["PHP_SELF"],$param,$sortfield,$sortorder,"",$num,$object->nbemail,'');
if ($page) $param.= "&amp;page=".$page;
print '<table class="noborder" width="100%">';
print '<tr class="liste_titre">';
print_liste_field_titre($langs->trans("EMail"),$_SERVER["PHP_SELF"],"mc.email",$parm,"","",$sortfield,$sortorder);
print_liste_field_titre($langs->trans("Lastname"),$_SERVER["PHP_SELF"],"mc.lastname",$parm,"","",$sortfield,$sortorder);
print_liste_field_titre($langs->trans("Firstname"),$_SERVER["PHP_SELF"],"mc.firstname",$parm,"","",$sortfield,$sortorder);
print_liste_field_titre($langs->trans("OtherInformations"),$_SERVER["PHP_SELF"],"",$parm,"","",$sortfield,$sortorder);
print_liste_field_titre($langs->trans("Source"),$_SERVER["PHP_SELF"],"",$parm,"",'align="center"',$sortfield,$sortorder);
print_liste_field_titre($langs->trans("EMail"),$_SERVER["PHP_SELF"],"mc.email",$param,"","",$sortfield,$sortorder);
print_liste_field_titre($langs->trans("Lastname"),$_SERVER["PHP_SELF"],"mc.lastname",$param,"","",$sortfield,$sortorder);
print_liste_field_titre($langs->trans("Firstname"),$_SERVER["PHP_SELF"],"mc.firstname",$param,"","",$sortfield,$sortorder);
print_liste_field_titre($langs->trans("OtherInformations"),$_SERVER["PHP_SELF"],"",$param,"","",$sortfield,$sortorder);
print_liste_field_titre($langs->trans("Source"),$_SERVER["PHP_SELF"],"",$param,"",'align="center"',$sortfield,$sortorder);
// Date sendinf
if ($object->statut < 2)
@ -406,11 +395,11 @@ if ($object->fetch($id) >= 0)
}
else
{
print_liste_field_titre($langs->trans("DateSending"),$_SERVER["PHP_SELF"],"mc.date_envoi",$parm,'','align="center"',$sortfield,$sortorder);
print_liste_field_titre($langs->trans("DateSending"),$_SERVER["PHP_SELF"],"mc.date_envoi",$param,'','align="center"',$sortfield,$sortorder);
}
// Statut
print_liste_field_titre($langs->trans("Status"),$_SERVER["PHP_SELF"],"mc.statut",$parm,'','align="right"',$sortfield,$sortorder);
print_liste_field_titre($langs->trans("Status"),$_SERVER["PHP_SELF"],"mc.statut",$param,'','align="right"',$sortfield,$sortorder);
print '</tr>';
@ -496,7 +485,7 @@ if ($object->fetch($id) >= 0)
print '<td align="center">&nbsp;</td>';
print '<td align="right" nowrap="nowrap">'.$langs->trans("MailingStatusNotSent");
if ($user->rights->mailing->creer) {
print '<a href="'.$_SERVER['PHP_SELF'].'?action=delete&rowid='.$obj->rowid.$parm.'">'.img_delete($langs->trans("RemoveRecipient"));
print '<a href="'.$_SERVER['PHP_SELF'].'?action=delete&rowid='.$obj->rowid.$param.'">'.img_delete($langs->trans("RemoveRecipient"));
}
print '</td>';
}

View File

@ -541,6 +541,7 @@ class Contact extends CommonObject
$this->mail = $obj->email;
$this->birthday = $this->db->jdate($obj->birthday);
$this->note = $obj->note_private; // deprecated
$this->note_private = $obj->note_private;
$this->note_public = $obj->note_public;
$this->default_lang = $obj->default_lang;

View File

@ -66,6 +66,13 @@ if ($action == 'add')
$mesg[]=$langs->trans("ErrorNoValueForSelectType");
$action = 'create';
}
if (GETPOST('type')=='sellist' && !GETPOST('param'))
{
$error++;
$langs->load("errors");
$mesg[]=$langs->trans("ErrorNoValueForSelectListType");
$action = 'create';
}
if (GETPOST('type')=='checkbox' && !GETPOST('param'))
{
$error++;
@ -82,30 +89,30 @@ if ($action == 'add')
}
if (((GETPOST('type')=='radio') || (GETPOST('type')=='checkbox') || (GETPOST('type')=='radio')) && GETPOST('param'))
{
// Construct array for parameter (value of select list)
$parameters = GETPOST('param');
$parameters_array = explode("\r\n",$parameters);
foreach($parameters_array as $param_ligne)
{
if (!empty($param_ligne)) {
if (preg_match_all('/,/',$param_ligne,$matches))
{
if (count($matches[0])>1) {
$error++;
$langs->load("errors");
$mesg[]=$langs->trans("ErrorBadFormatValueList",$param_ligne);
$action = 'create';
}
}
else
{
// Construct array for parameter (value of select list)
$parameters = GETPOST('param');
$parameters_array = explode("\r\n",$parameters);
foreach($parameters_array as $param_ligne)
{
if (!empty($param_ligne)) {
if (preg_match_all('/,/',$param_ligne,$matches))
{
if (count($matches[0])>1) {
$error++;
$langs->load("errors");
$mesg[]=$langs->trans("ErrorBadFormatValueList",$param_ligne);
$action = 'create';
}
}
}
}
else
{
$error++;
$langs->load("errors");
$mesg[]=$langs->trans("ErrorBadFormatValueList",$param_ligne);
$action = 'create';
}
}
}
}
if (! $error)
@ -114,6 +121,7 @@ if ($action == 'add')
if (isset($_POST["attrname"]) && preg_match("/^\w[a-zA-Z0-9-_]*$/",$_POST['attrname']))
{
// Construct array for parameter (value of select list)
$default_value = GETPOST('default_value');
$parameters = GETPOST('param');
$parameters_array = explode("\r\n",$parameters);
foreach($parameters_array as $param_ligne)
@ -186,6 +194,13 @@ if ($action == 'update')
$mesg[]=$langs->trans("ErrorNoValueForSelectType");
$action = 'edit';
}
if (GETPOST('type')=='sellist' && !GETPOST('param'))
{
$error++;
$langs->load("errors");
$mesg[]=$langs->trans("ErrorNoValueForSelectListType");
$action = 'edit';
}
if (GETPOST('type')=='checkbox' && !GETPOST('param'))
{
$error++;
@ -291,4 +306,4 @@ if ($action == 'delete')
}
}
?>
?>

View File

@ -252,18 +252,20 @@ function run_sql($sqlfile,$silent=1,$entity='',$usesavepoint=1,$handler='',$oker
// Ajout trace sur requete (eventuellement a commenter si beaucoup de requetes)
if (! $silent) print '<tr><td valign="top">'.$langs->trans("Request").' '.($i+1)." sql='".dol_htmlentities($newsql,ENT_NOQUOTES)."'</td></tr>\n";
dol_syslog('Admin.lib::run_sql Request '.($i+1).' sql='.$newsql, LOG_DEBUG);
$sqlmodified=0;
// Replace for encrypt data
if (preg_match_all('/__ENCRYPT\(\'([A-Za-z0-9_\"\[\]]+)\'\)__/i',$newsql,$reg))
if (preg_match_all('/__ENCRYPT\(\'([^\']+)\'\)__/i',$newsql,$reg))
{
$num=count($reg[0]);
for($i=0;$i<$num;$i++)
for($j=0;$j<$num;$j++)
{
$from = $reg[0][$i];
$to = $db->encrypt($reg[1][$i],1);
$from = $reg[0][$j];
$to = $db->encrypt($reg[1][$j],1);
$newsql = str_replace($from,$to,$newsql);
}
$sqlmodified++;
}
// Replace for decrypt data
@ -271,12 +273,13 @@ function run_sql($sqlfile,$silent=1,$entity='',$usesavepoint=1,$handler='',$oker
{
$num=count($reg[0]);
for($i=0;$i<$num;$i++)
for($j=0;$j<$num;$j++)
{
$from = $reg[0][$i];
$to = $db->decrypt($reg[1][$i]);
$from = $reg[0][$j];
$to = $db->decrypt($reg[1][$j]);
$newsql = str_replace($from,$to,$newsql);
}
$sqlmodified++;
}
// Replace __x__ with rowid of insert nb x
@ -294,9 +297,11 @@ function run_sql($sqlfile,$silent=1,$entity='',$usesavepoint=1,$handler='',$oker
$from='__'.$cursor.'__';
$to=$listofinsertedrowid[$cursor];
$newsql=str_replace($from,$to,$newsql);
dol_syslog('Admin.lib::run_sql New Request '.($i+1).' (replacing '.$from.' to '.$to.') sql='.$newsql, LOG_DEBUG);
$sqlmodified++;
}
if ($sqlmodified) dol_syslog('Admin.lib::run_sql New Request '.($i+1).' sql='.$newsql, LOG_DEBUG);
$result=$db->query($newsql,$usesavepoint);
if ($result)
{

View File

@ -1,7 +1,6 @@
#!/usr/bin/php
<?php
/*
* Copyright (C) 2009-2012 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2009-2013 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
@ -29,22 +28,23 @@ require_once(DOL_DOCUMENT_ROOT.'/core/lib/pdf.lib.php');
/**
* Function to build a compiled PDF
*
* @param DoliDB $db Database handler
* @param Translate $langs Object langs
* @param Conf $conf Object conf
*
* @param DoliDB $db Database handler
* @param Translate $langs Object langs
* @param Conf $conf Object conf
* @param string $diroutputpdf Dir to output file
* @param string $newlangid Lang id
* @param array $filter Array with filters
* @param date $dateafterdate Invoice after date
* @param date $dateafterdate Invoice after date
* @param date $datebeforedate Invoice before date
* @param date $paymentdateafter Payment after date
* @param date $paymentdatebefore Payment before date
* @param int $usestdout Add information onto standard output
* @param int $regenerate ''=Use existing PDF files, 'nameofpdf'=Regenerate all PDF files using the template,
* @return int Error code
* @param int $regenerate ''=Use existing PDF files, 'nameofpdf'=Regenerate all PDF files using the template
* @param string $option Suffix to add into file name of generated PDF
* @return int Error code
*/
function rebuild_merge_pdf($db, $langs, $conf, $diroutputpdf, $newlangid, $filter, $dateafterdate, $datebeforedate, $paymentdateafter, $paymentdatebefore, $usestdout, $regenerate=0)
function rebuild_merge_pdf($db, $langs, $conf, $diroutputpdf, $newlangid, $filter, $dateafterdate, $datebeforedate, $paymentdateafter, $paymentdatebefore, $usestdout, $regenerate=0, $option='')
{
$sql = "SELECT DISTINCT f.rowid, f.facnumber";
$sql.= " FROM ".MAIN_DB_PREFIX."facture as f";
@ -104,19 +104,19 @@ function rebuild_merge_pdf($db, $langs, $conf, $diroutputpdf, $newlangid, $filte
}
if ($sqlwhere) $sql.=$sqlwhere;
if ($sqlorder) $sql.=$sqlorder;
//print $sql; exit;
dol_syslog("scripts/invoices/rebuild_merge.php: sql=".$sql);
if ($usestdout) print '--- start'."\n";
// Start of transaction
//$db->begin();
$error = 0;
$result = 0;
$files = array() ; // liste les fichiers
dol_syslog("scripts/invoices/rebuild_merge.php sql=".$sql);
if ( $resql=$db->query($sql) )
{
@ -125,16 +125,16 @@ function rebuild_merge_pdf($db, $langs, $conf, $diroutputpdf, $newlangid, $filte
$oldemail = '';
$message = '';
$total = '';
if ($num)
{
// First loop on each resultset to build PDF
// -----------------------------------------
while ($cpt < $num)
{
$obj = $db->fetch_object($resql);
$fac = new Facture($db);
$result=$fac->fetch($obj->rowid);
if ($result > 0)
@ -157,35 +157,35 @@ function rebuild_merge_pdf($db, $langs, $conf, $diroutputpdf, $newlangid, $filte
else {
if ($usestdout) print "PDF for invoice ".$obj->facnumber." already exists\n";
}
// Add file into files array
$files[] = $filename;
}
if ($result <= 0)
{
$error++;
if ($usestdout) print "Error: Failed to build PDF for invoice ".$fac->ref."\n";
else dol_syslog("Failed to build PDF for invoice ".$fac->ref, LOG_ERR);
if ($usestdout) print "Error: Failed to build PDF for invoice ".($fac->ref?$fac->ref:' id '.$obj->rowid)."\n";
else dol_syslog("Failed to build PDF for invoice ".($fac->ref?$fac->ref:' id '.$obj->rowid), LOG_ERR);
}
$cpt++;
}
// Define format of output PDF
// Define format of output PDF
$formatarray=pdf_getFormat();
$page_largeur = $formatarray['width'];
$page_hauteur = $formatarray['height'];
$format = array($page_largeur,$page_hauteur);
if ($usestdout) print "Using output PDF format ".join('x',$format)."\n";
else dol_syslog("Using output PDF format ".join('x',$format), LOG_ERR);
// Now, build a merged files with all files in $files array
//---------------------------------------------------------
// Create empty PDF
$pdf=pdf_getInstance($format);
if (class_exists('TCPDF'))
@ -193,12 +193,12 @@ function rebuild_merge_pdf($db, $langs, $conf, $diroutputpdf, $newlangid, $filte
$pdf->setPrintHeader(false);
$pdf->setPrintFooter(false);
}
$pdf->SetFont(pdf_getPDFFont($outputlangs));
$pdf->SetFont(pdf_getPDFFont($langs));
if ($conf->global->MAIN_DISABLE_PDF_COMPRESSION) $pdf->SetCompression(false);
//$pdf->SetCompression(false);
//$pdf->Open();
//$pdf->AddPage();
//$title=$langs->trans("BillsCustomersUnpaid");
@ -224,21 +224,26 @@ function rebuild_merge_pdf($db, $langs, $conf, $diroutputpdf, $newlangid, $filte
// Create output dir if not exists
dol_mkdir($diroutputpdf);
// Save merged file
$filename='mergedpdf';
if (! empty($option)) $filename.='_'.$option;
if ($pagecount)
$file=$diroutputpdf.'/'.$filename.'.pdf';
if (! $error && $pagecount)
{
$file=$diroutputpdf.'/'.$filename.'.pdf';
$pdf->Output($file,'F');
if (! empty($conf->global->MAIN_UMASK))
@chmod($file, octdec($conf->global->MAIN_UMASK));
}
if ($usestdout) print "Merged PDF has been built in ".$file."\n";
if ($usestdout)
{
if (! $error) print "Merged PDF has been built in ".$file."\n";
else print "Can't build PDF ".$file."\n";
}
$result = 1;
}
else
@ -254,7 +259,7 @@ function rebuild_merge_pdf($db, $langs, $conf, $diroutputpdf, $newlangid, $filte
dol_syslog("scripts/invoices/rebuild_merge.php: Error");
$error++;
}
if ($error) return -1;
else return $result;
}

View File

@ -71,11 +71,8 @@ class mailing_contacts1 extends MailingTargets
$statssql=array();
$statssql[0] = "SELECT '".$langs->trans("NbOfCompaniesContacts")."' as label,";
$statssql[0].= " count(distinct(c.email)) as nb";
$statssql[0].= " FROM ".MAIN_DB_PREFIX."socpeople as c,";
$statssql[0].= " ".MAIN_DB_PREFIX."societe as s";
$statssql[0].= " WHERE s.rowid = c.fk_soc";
$statssql[0].= " AND c.entity IN (".getEntity('societe', 1).")";
$statssql[0].= " AND s.client IN (1, 3)";
$statssql[0].= " FROM ".MAIN_DB_PREFIX."socpeople as c";
$statssql[0].= " WHERE c.entity IN (".getEntity('societe', 1).")";
$statssql[0].= " AND c.email != ''"; // Note that null != '' is false
$statssql[0].= " AND c.no_email = 0";
@ -96,12 +93,11 @@ class mailing_contacts1 extends MailingTargets
global $conf;
$sql = "SELECT count(distinct(c.email)) as nb";
$sql .= " FROM ".MAIN_DB_PREFIX."socpeople as c,";
$sql .= " ".MAIN_DB_PREFIX."societe as s";
$sql .= " WHERE s.rowid = c.fk_soc";
$sql .= " AND c.entity IN (".getEntity('societe', 1).")";
$sql .= " AND c.email != ''"; // Note that null != '' is false
$sql .= " AND c.no_email = 0";
$sql.= " FROM ".MAIN_DB_PREFIX."socpeople as c";
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON s.rowid = c.fk_soc";
$sql.= " WHERE c.entity IN (".getEntity('societe', 1).")";
$sql.= " AND c.email != ''"; // Note that null != '' is false
$sql.= " AND c.no_email = 0";
// La requete doit retourner un champ "nb" pour etre comprise
// par parent::getNbOfRecipients
@ -203,10 +199,9 @@ class mailing_contacts1 extends MailingTargets
$sql = "SELECT c.rowid as id, c.email as email, c.rowid as fk_contact,";
$sql.= " c.lastname, c.firstname, c.civilite,";
$sql.= " s.nom as companyname";
$sql.= " FROM ".MAIN_DB_PREFIX."socpeople as c,";
$sql.= " ".MAIN_DB_PREFIX."societe as s";
$sql.= " WHERE s.rowid = c.fk_soc";
$sql.= " AND c.entity IN (".getEntity('societe', 1).")";
$sql.= " FROM ".MAIN_DB_PREFIX."socpeople as c";
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON s.rowid = c.fk_soc";
$sql.= " WHERE c.entity IN (".getEntity('societe', 1).")";
$sql.= " AND c.email != ''";
$sql.= " AND c.no_email = 0";
foreach($filtersarray as $key)

View File

@ -81,13 +81,12 @@ class mailing_contacts2 extends MailingTargets
$sql = "SELECT sp.rowid as id, sp.email as email, sp.rowid as fk_contact,";
$sql.= " sp.lastname, sp.firstname as firstname, sp.civilite,";
$sql.= " s.nom as companyname";
$sql.= " FROM ".MAIN_DB_PREFIX."socpeople as sp,";
$sql.= " ".MAIN_DB_PREFIX."societe as s";
$sql.= " WHERE s.rowid = sp.fk_soc";
$sql.= " FROM ".MAIN_DB_PREFIX."socpeople as sp";
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON s.rowid = sp.fk_soc";
$sql.= " WHERE sp.entity IN (".getEntity('societe', 1).")";
$sql.= " AND sp.email != ''"; // Note that null != '' is false
$sql.= " AND sp.no_email = 0";
//$sql.= " AND sp.poste != ''";
$sql.= " AND sp.entity IN (".getEntity('societe', 1).")";
if ($filtersarray[0]<>'all') $sql.= " AND sp.poste ='".$this->db->escape($filtersarray[0])."'";
$sql.= " ORDER BY sp.lastname, sp.firstname";
$resql = $this->db->query($sql);
@ -163,10 +162,9 @@ class mailing_contacts2 extends MailingTargets
// Number with a filter are show in the combo list for each filter.
// If we want a filter "a position is defined", we must add it into formFilter
$sql = "SELECT count(distinct(sp.email)) as nb";
$sql.= " FROM ".MAIN_DB_PREFIX."socpeople as sp,";
$sql.= " ".MAIN_DB_PREFIX."societe as s";
$sql.= " WHERE s.rowid = sp.fk_soc";
$sql.= " AND sp.entity IN (".getEntity('societe', 1).")";
$sql.= " FROM ".MAIN_DB_PREFIX."socpeople as sp";
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON s.rowid = sp.fk_soc";
$sql.= " WHERE sp.entity IN (".getEntity('societe', 1).")";
$sql.= " AND sp.email != ''"; // Note that null != '' is false
$sql.= " AND sp.no_email = 0";
//$sql.= " AND sp.poste != ''";
@ -188,10 +186,8 @@ class mailing_contacts2 extends MailingTargets
$langs->load("companies");
$sql = "SELECT sp.poste, count(distinct(sp.email)) AS nb";
$sql.= " FROM ".MAIN_DB_PREFIX."socpeople as sp,";
$sql.= " ".MAIN_DB_PREFIX."societe as s";
$sql.= " WHERE s.rowid = sp.fk_soc";
$sql.= " AND sp.entity IN (".getEntity('societe', 1).")";
$sql.= " FROM ".MAIN_DB_PREFIX."socpeople as sp";
$sql.= " WHERE sp.entity IN (".getEntity('societe', 1).")";
$sql.= " AND sp.email != ''"; // Note that null != '' is false
$sql.= " AND sp.no_email = 0";
$sql.= " AND (sp.poste IS NOT NULL AND sp.poste != '')";

View File

@ -79,12 +79,11 @@ class mailing_contacts3 extends MailingTargets
$sql = "SELECT sp.rowid as id, sp.email as email, sp.rowid as fk_contact,";
$sql.= " sp.lastname, sp.firstname, sp.civilite,";
$sql.= " s.nom as companyname";
$sql.= " FROM ".MAIN_DB_PREFIX."socpeople as sp,";
$sql.= " ".MAIN_DB_PREFIX."societe as s";
if ($filtersarray[0] <> 'all') $sql.= ", ".MAIN_DB_PREFIX."categorie as c,";
if ($filtersarray[0] <> 'all') $sql.= " ".MAIN_DB_PREFIX."categorie_societe as cs";
$sql.= " WHERE s.rowid = sp.fk_soc";
$sql.= " AND sp.email != ''"; // Note that null != '' is false
$sql.= " FROM ".MAIN_DB_PREFIX."socpeople as sp";
if ($filtersarray[0] <> 'all') $sql.= ", ".MAIN_DB_PREFIX."categorie as c";
if ($filtersarray[0] <> 'all') $sql.= ", ".MAIN_DB_PREFIX."categorie_societe as cs";
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON s.rowid = sp.fk_soc";
$sql.= " WHERE sp.email != ''"; // Note that null != '' is false
$sql.= " AND sp.no_email = 0";
$sql.= " AND sp.entity IN (".getEntity('societe', 1).")";
if ($filtersarray[0] <> 'all') $sql.= " AND cs.fk_categorie = c.rowid";
@ -168,10 +167,9 @@ class mailing_contacts3 extends MailingTargets
// Number with a filter are show in the combo list for each filter.
// If we want a filter "is inside at least one category", we must add it into formFilter
$sql = "SELECT count(distinct(c.email)) as nb";
$sql.= " FROM ".MAIN_DB_PREFIX."socpeople as c,";
$sql.= " ".MAIN_DB_PREFIX."societe as s";
$sql.= " WHERE s.rowid = c.fk_soc";
$sql.= " AND c.entity IN (".getEntity('societe', 1).")";
$sql.= " FROM ".MAIN_DB_PREFIX."socpeople as c";
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON s.rowid = c.fk_soc";
$sql.= " WHERE c.entity IN (".getEntity('societe', 1).")";
$sql.= " AND c.email != ''"; // Note that null != '' is false
$sql.= " AND c.no_email = 0";
/*
@ -205,11 +203,9 @@ class mailing_contacts3 extends MailingTargets
$sql = "SELECT c.label, count(distinct(sp.email)) AS nb";
$sql.= " FROM ".MAIN_DB_PREFIX."socpeople as sp,";
$sql.= " ".MAIN_DB_PREFIX."societe as s,";
$sql.= " ".MAIN_DB_PREFIX."categorie as c,";
$sql.= " ".MAIN_DB_PREFIX."categorie_societe as cs";
$sql.= " WHERE s.rowid = sp.fk_soc";
$sql.= " AND sp.email != ''"; // Note that null != '' is false
$sql.= " WHERE sp.email != ''"; // Note that null != '' is false
$sql.= " AND sp.no_email = 0";
$sql.= " AND sp.entity IN (".getEntity('societe', 1).")";
$sql.= " AND cs.fk_categorie = c.rowid";

View File

@ -82,7 +82,7 @@ class mailing_pomme extends MailingTargets
* For example if this selector is used to extract 500 different
* emails from a text file, this function must return 500.
*
* @param string $sql Requete sql de comptage
* @param string $sql SQL request to use to count
* @return int Number of recipients
*/
function getNbOfRecipients($sql='')

View File

@ -175,12 +175,10 @@ class mailing_thirdparties_services_expired extends MailingTargets
* For example if this selector is used to extract 500 different
* emails from a text file, this function must return 500.
*
* @param string $sql SQL request to get recipitien
* @param int $filter Filter
* @param string $option Option
* @param string $sql SQL request to use to count
* @return int Number of recipients
*/
function getNbOfRecipients($sql,$filter=1,$option='')
function getNbOfRecipients($sql='')
{
$now=dol_now();

View File

@ -146,7 +146,7 @@ class ProductFournisseur extends Product
* @param string $charges costs affering to product
* @param float $remise_percent Discount regarding qty (percent)
* @param float $remise Discount regarding qty (amount)
* @param float $newnpr new infobit tva npr
* @param int $newnpr Set NPR or not
* @return int <0 if KO, >=0 if OK
*/
function update_buyprice($qty, $buyprice, $user, $price_base_type, $fourn, $availability, $ref_fourn, $tva_tx, $charges=0, $remise_percent=0, $remise=0, $newnpr=0)

View File

@ -26,18 +26,18 @@ create table llx_adherent_type_extrafields
) ENGINE=innodb;
ALTER TABLE llx_adherent_type_extrafields ADD INDEX idx_adherent_type_extrafields (fk_object);
UPDATE llx_const set value='eldy_menu.php' where value='eldy_backoffice.php';
UPDATE llx_const set value='eldy_menu.php' where value='eldy_frontoffice.php';
UPDATE llx_const set value='auguria_menu.php' where value='auguria_backoffice.php';
UPDATE llx_const set value='auguria_menu.php' where value='auguria_frontoffice.php';
UPDATE llx_const set value='smartphone_menu.php' where value='smartphone_backoffice.php';
UPDATE llx_const set value='smartphone_menu.php' where value='smartphone_frontoffice.php';
UPDATE llx_const set name='MAIN_INFO_SOCIETE_ADDRESS' where name='MAIN_INFO_SOCIETE_ADRESSE';
UPDATE llx_const set name='MAIN_INFO_SOCIETE_TOWN' where name='MAIN_INFO_SOCIETE_VILLE';
UPDATE llx_const set name='MAIN_INFO_SOCIETE_ZIP' where name='MAIN_INFO_SOCIETE_CP';
UPDATE llx_const set name='MAIN_INFO_SOCIETE_COUNTRY' where name='MAIN_INFO_SOCIETE_PAYS';
UPDATE llx_const set name='MAIN_INFO_SOCIETE_STATE' where name='MAIN_INFO_SOCIETE_DEPARTEMENT';
UPDATE llx_const set name='LIVRAISON_ADDON_NUMBER' where name='LIVRAISON_ADDON';
UPDATE llx_const set value = __ENCRYPT('eldy_menu.php')__ where __DECRYPT('value')__ = 'eldy_backoffice.php';
UPDATE llx_const set value = __ENCRYPT('eldy_menu.php')__ where __DECRYPT('value')__ = 'eldy_frontoffice.php';
UPDATE llx_const set value = __ENCRYPT('auguria_menu.php')__ where __DECRYPT('value')__ = 'auguria_backoffice.php';
UPDATE llx_const set value = __ENCRYPT('auguria_menu.php')__ where __DECRYPT('value')__ = 'auguria_frontoffice.php';
UPDATE llx_const set value = __ENCRYPT('smartphone_menu.php')__ where __DECRYPT('value')__ = 'smartphone_backoffice.php';
UPDATE llx_const set value = __ENCRYPT('smartphone_menu.php')__ where __DECRYPT('value')__ = 'smartphone_frontoffice.php';
UPDATE llx_const set name = __ENCRYPT('MAIN_INFO_SOCIETE_ADDRESS')__ where __DECRYPT('name')__ = 'MAIN_INFO_SOCIETE_ADRESSE';
UPDATE llx_const set name = __ENCRYPT('MAIN_INFO_SOCIETE_TOWN')__ where __DECRYPT('name')__ = 'MAIN_INFO_SOCIETE_VILLE';
UPDATE llx_const set name = __ENCRYPT('MAIN_INFO_SOCIETE_ZIP')__ where __DECRYPT('name')__ = 'MAIN_INFO_SOCIETE_CP';
UPDATE llx_const set name = __ENCRYPT('MAIN_INFO_SOCIETE_COUNTRY')__ where __DECRYPT('name')__ = 'MAIN_INFO_SOCIETE_PAYS';
UPDATE llx_const set name = __ENCRYPT('MAIN_INFO_SOCIETE_STATE')__ where __DECRYPT('name')__ = 'MAIN_INFO_SOCIETE_DEPARTEMENT';
UPDATE llx_const set name = __ENCRYPT('LIVRAISON_ADDON_NUMBER')__ where __DECRYPT('name')__ = 'LIVRAISON_ADDON';
ALTER TABLE llx_user add COLUMN fk_user integer;

View File

@ -1,6 +1,6 @@
-- ============================================================================
-- Copyright (C) 2001-2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
-- Copyright (C) 2006-2011 Laurent Destailleur <eldy@users.sourceforge.net>
-- Copyright (C) 2006-2013 Laurent Destailleur <eldy@users.sourceforge.net>
-- Copyright (C) 2007-2013 Regis Houssin <regis.houssin@capnetworks.com>
--
-- This program is free software; you can redistribute it and/or modify
@ -47,9 +47,6 @@ create table llx_user
email varchar(255),
signature text DEFAULT NULL,
admin smallint DEFAULT 0,
webcal_login varchar(25), -- TODO move to an extra table (ex: llx_extra_fields)
phenix_login varchar(25), -- TODO move to an extra table (ex: llx_extra_fields)
phenix_pass varchar(128), -- TODO move to an extra table (ex: llx_extra_fields)
module_comm smallint DEFAULT 1,
module_compta smallint DEFAULT 1,
fk_societe integer,
@ -64,6 +61,6 @@ create table llx_user
openid varchar(255),
statut tinyint DEFAULT 1,
photo varchar(255), -- filename or url of photo
lang varchar(6)
lang varchar(6),
color varchar(6)
)ENGINE=innodb;

View File

@ -82,16 +82,16 @@ ActivateCheckReadKey=Key use to encrypt URL use for "Read Receipt" and "Unsubcri
EMailSentToNRecipients=EMail sent to %s recipients.
# Libelle des modules de liste de destinataires mailing
MailingModuleDescContactCompanies=Contacts of all third parties (customer, prospect, supplier, ...)
MailingModuleDescContactCompanies=Contacts/addresses of all third parties (customer, prospect, supplier, ...)
MailingModuleDescDolibarrUsers=Dolibarr users
MailingModuleDescFundationMembers=Foundation members with emails
MailingModuleDescEmailsFromFile=EMails from a text file (email;lastname;firstname;other)
MailingModuleDescEmailsFromUser=EMails from user input (email;lastname;firstname;other)
MailingModuleDescContactsCategories=Third parties (by category)
MailingModuleDescDolibarrContractsLinesExpired=Third parties with expired contract's lines
MailingModuleDescContactsByCompanyCategory=Contacts of third parties (by third parties category)
MailingModuleDescContactsByCompanyCategory=Contacts/addresses of third parties (by third parties category)
MailingModuleDescMembersCategories=Foundation members (by categories)
MailingModuleDescContactsByFunction=Contacts of third parties (by position/function)
MailingModuleDescContactsByFunction=Contacts/addresses of third parties (by position/function)
LineInFile=Line %s in file
@ -100,7 +100,7 @@ MailSelectedRecipients=Selected recipients
MailingArea=EMailings area
LastMailings=Last %s emailings
TargetsStatistics=Targets statistics
NbOfCompaniesContacts=Unique contacts of companies
NbOfCompaniesContacts=Unique contacts/addresses
MailNoChangePossible=Recipients for validated emailing can't be changed
SearchAMailing=Search mailing
SendMailing=Send emailing

View File

@ -99,7 +99,7 @@ MailSelectedRecipients=Destinataires sélectionnés
MailingArea=Espace emailings
LastMailings=Les %s derniers emailings
TargetsStatistics=Statistiques destinataires
NbOfCompaniesContacts=Contacts uniques des sociétés
NbOfCompaniesContacts=Contacts/adresses uniques
MailNoChangePossible=Destinataires d'un mailing validé non modifiables
SearchAMailing=Rechercher un mailing
SendMailing=Envoi emailing

View File

@ -210,7 +210,9 @@ if (isset($_POST["ajoutercolonne"]) && ($object->format == "D" || $object->forma
} elseif ($nouvelledate > $datesbase[$taillebase-1]) {
$cleinsertion = count($datesbase);
} else {
for ($i = 0; $i < count($datesbase); $i++) {
$nbdatesbase=count($datesbase);
for ($i = 0; $i < $nbdatesbase; $i++)
{
$j = $i + 1;
if ($nouvelledate > $datesbase[$i] && $nouvelledate < $datesbase[$j]) {
$cleinsertion = $j;
@ -1059,4 +1061,4 @@ print '</form>'."\n";
llxFooterSurvey();
$db->close();
?>
?>

View File

@ -340,7 +340,7 @@ class Opensurveysondage extends CommonObject
* @param string $numsondageadmin Num sondage to delete
* @return int <0 if KO, >0 if OK
*/
function delete($user, $notrigger=0, $numsondageadmin)
function delete($user, $notrigger, $numsondageadmin)
{
global $conf, $langs;
$error=0;

View File

@ -121,7 +121,8 @@ function get_server_name()
* is_error
*
* @param unknown_type $cerr error number
* @return boolean
* @param string $cerr Error value
* @return boolean Error key found or not
*/
function is_error($cerr)
{
@ -147,7 +148,7 @@ function validateEmail($email)
{
$pattern = '/^(?!(?:(?:\\x22?\\x5C[\\x00-\\x7E]\\x22?)|(?:\\x22?[^\\x5C\\x22]\\x22?)){255,})(?!(?:(?:\\x22?\\x5C[\\x00-\\x7E]\\x22?)|(?:\\x22?[^\\x5C\\x22]\\x22?)){65,}@)(?:(?:[\\x21\\x23-\\x27\\x2A\\x2B\\x2D\\x2F-\\x39\\x3D\\x3F\\x5E-\\x7E]+)|(?:\\x22(?:[\\x01-\\x08\\x0B\\x0C\\x0E-\\x1F\\x21\\x23-\\x5B\\x5D-\\x7F]|(?:\\x5C[\\x00-\\x7F]))*\\x22))(?:\\.(?:(?:[\\x21\\x23-\\x27\\x2A\\x2B\\x2D\\x2F-\\x39\\x3D\\x3F\\x5E-\\x7E]+)|(?:\\x22(?:[\\x01-\\x08\\x0B\\x0C\\x0E-\\x1F\\x21\\x23-\\x5B\\x5D-\\x7F]|(?:\\x5C[\\x00-\\x7F]))*\\x22)))*@(?:(?:(?!.*[^.]{64,})(?:(?:(?:xn--)?[a-z0-9]+(?:-[a-z0-9]+)*\\.){1,126}){1,}(?:(?:[a-z][a-z0-9]*)|(?:(?:xn--)[a-z0-9]+))(?:-[a-z0-9]+)*)|(?:\\[(?:(?:IPv6:(?:(?:[a-f0-9]{1,4}(?::[a-f0-9]{1,4}){7})|(?:(?!(?:.*[a-f0-9][:\\]]){7,})(?:[a-f0-9]{1,4}(?::[a-f0-9]{1,4}){0,5})?::(?:[a-f0-9]{1,4}(?::[a-f0-9]{1,4}){0,5})?)))|(?:(?:IPv6:(?:(?:[a-f0-9]{1,4}(?::[a-f0-9]{1,4}){5}:)|(?:(?!(?:.*[a-f0-9]:){5,})(?:[a-f0-9]{1,4}(?::[a-f0-9]{1,4}){0,3})?::(?:[a-f0-9]{1,4}(?::[a-f0-9]{1,4}){0,3}:)?)))?(?:(?:25[0-5])|(?:2[0-4][0-9])|(?:1[0-9]{2})|(?:[1-9]?[0-9]))(?:\\.(?:(?:25[0-5])|(?:2[0-4][0-9])|(?:1[0-9]{2})|(?:[1-9]?[0-9]))){3}))\\]))$/iD';
return (bool)preg_match($pattern, $email);
return (bool) preg_match($pattern, $email);
}
@ -188,15 +189,16 @@ function getUrlSondage($id, $admin = false)
/**
* Generate a random id
*
* @return void
* Generate a random id
*
* @param string $car Char to generate key
* @return void
*/
function dol_survey_random($car)
{
$string = "";
$chaine = "abcdefghijklmnopqrstuvwxyz123456789";
srand((double)microtime()*1000000);
srand((double) microtime()*1000000);
for($i=0; $i<$car; $i++) {
$string .= $chaine[rand()%strlen($chaine)];
}
@ -229,7 +231,7 @@ function ajouter_sondage($origin)
if ($_SESSION["formatsondage"]=="D"||$_SESSION["formatsondage"]=="D+") {
//Calcul de la date de fin du sondage
$taille_tableau=sizeof($_SESSION["totalchoixjour"])-1;
$taille_tableau=count($_SESSION["totalchoixjour"])-1;
$date_fin=$_SESSION["totalchoixjour"][$taille_tableau]+200000;
}
@ -289,4 +291,4 @@ define('TITLE_EMPTY', 0x0100000000);
define('INVALID_DATE', 0x1000000000);
$err = 0;
?>
?>

View File

@ -257,9 +257,9 @@ if (issetAndNoEmpty('choixjourajout')) {
// Si le test est passé, alors on insere la valeur dans la variable de session qui contient les dates
if ($journeuf && issetAndNoEmpty('choixjourajout') === true) {
array_push($_SESSION["totalchoixjour"],mktime (0,0,0, $_SESSION["mois"], $_POST["choixjourajout"][0], $_SESSION["annee"]));
array_push($_SESSION["totalchoixjour"], dol_mktime(0, 0, 0, $_SESSION["mois"], $_POST["choixjourajout"][0], $_SESSION["annee"]));
sort($_SESSION["totalchoixjour"]);
$cle=array_search(mktime (0,0,0, $_SESSION["mois"], $_POST["choixjourajout"][0], $_SESSION["annee"]), $_SESSION["totalchoixjour"]);
$cle=array_search(dol_mktime(0, 0, 0, $_SESSION["mois"], $_POST["choixjourajout"][0], $_SESSION["annee"]), $_SESSION["totalchoixjour"]);
//On sauvegarde les heures deja entrées
for ($i = 0; $i < $cle; $i++) {
@ -540,7 +540,7 @@ if (issetAndNoEmpty('totalchoixjour', $_SESSION) && (!issetAndNoEmpty('choixheur
//s'il n'y a pas d'erreur et que le bouton de creation est activé, on demande confirmation
if (!$erreur && (GETPOST('choixheures') || GETPOST('choixheures_x'))) {
$taille_tableau=sizeof($_SESSION["totalchoixjour"])-1;
$taille_tableau=count($_SESSION["totalchoixjour"])-1;
$jour_arret = $_SESSION["totalchoixjour"][$taille_tableau]+200000;
$date_fin=dol_print_date($jour_arret, 'dayhourtext');

View File

@ -162,7 +162,11 @@ print '</script>'."\n";
print '<br>'."\n";
<<<<<<< HEAD
//affichage du cochage par défaut
=======
// Check or not
>>>>>>> branch 'develop' of https://github.com/Dolibarr/dolibarr.git
$cocheplus='';
if ($_SESSION["canedit"]) $cocheplus="checked";

View File

@ -64,7 +64,10 @@ $now=dol_now();
$nbcolonnes=substr_count($object->sujet,',')+1;
$toutsujet=explode(",",$object->sujet);
<<<<<<< HEAD
//$toutsujet=str_replace("°","'",$toutsujet);
=======
>>>>>>> branch 'develop' of https://github.com/Dolibarr/dolibarr.git
// affichage des sujets du sondage
$input.=$langs->trans("Name").";";
@ -151,4 +154,4 @@ header('Cache-Control: max-age=10');
echo $input;
exit;
?>
?>

View File

@ -69,12 +69,12 @@ if (! empty($conf->global->MEMBER_PAYONLINE_SENDEMAIL) && preg_match('/MEM=',$fu
$sendto=$conf->global->MEMBER_PAYONLINE_SENDEMAIL;
$from=$conf->global->MAILING_EMAIL_FROM;
require_once DOL_DOCUMENT_ROOT.'/core/class/CMailFile.class.php';
$mailfile = new CMailFile(
$mailfile = new CMailFile(
'New subscription payed',
$sendto,
$from,
$from,
'New subscription payed '.$fulltag);
$result=$mailfile->sendfile();
if ($result)
{

View File

@ -99,7 +99,7 @@ if (! empty($conf->global->MEMBER_PAYONLINE_SENDEMAIL) && preg_match('/MEM=',$fu
$sendto=$conf->global->MEMBER_PAYONLINE_SENDEMAIL;
$from=$conf->global->MAILING_EMAIL_FROM;
require_once DOL_DOCUMENT_ROOT.'/core/class/CMailFile.class.php';
$mailfile = new CMailFile(
$mailfile = new CMailFile(
'New subscription payed',
$sendto,
$from,

View File

@ -77,7 +77,7 @@ if (! empty($conf->global->MEMBER_PAYONLINE_SENDEMAIL) && preg_match('/MEM=',$fu
$sendto=$conf->global->MEMBER_PAYONLINE_SENDEMAIL;
$from=$conf->global->MAILING_EMAIL_FROM;
require_once DOL_DOCUMENT_ROOT.'/core/class/CMailFile.class.php';
$mailfile = new CMailFile(
$mailfile = new CMailFile(
'New subscription payed',
$sendto,
$from,

View File

@ -136,7 +136,7 @@ if ($PAYPALTOKEN)
$sendto=$conf->global->MEMBER_PAYONLINE_SENDEMAIL;
$from=$conf->global->MAILING_EMAIL_FROM;
require_once DOL_DOCUMENT_ROOT.'/core/class/CMailFile.class.php';
$mailfile = new CMailFile(
$mailfile = new CMailFile(
'New subscription payed',
$sendto,
$from,

View File

@ -106,7 +106,7 @@ print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<input type="hidden" name="socid" value="'.$socid.'">';
print '<table class="border" width="100%">';
print '<tr><td width="30%">'.$langs->trans('ThirdPartyName').'</td>';
print '<tr><td width="25%">'.$langs->trans('ThirdPartyName').'</td>';
print '<td colspan="3">';
print $form->showrefnav($object,'socid','',($user->societe_id?0:1),'rowid','nom');
print '</td></tr>';

View File

@ -133,7 +133,7 @@ if ($object->id)
print '<table class="border"width="100%">';
// Ref
print '<tr><td width="30%">'.$langs->trans("ThirdPartyName").'</td>';
print '<tr><td width="25%">'.$langs->trans("ThirdPartyName").'</td>';
print '<td colspan="3">';
print $form->showrefnav($object,'socid','',($user->societe_id?0:1),'rowid','nom');
print '</td></tr>';

View File

@ -92,7 +92,7 @@ if ($id > 0)
print '<table class="border" width="100%">';
print '<tr><td width="20%">'.$langs->trans('ThirdPartyName').'</td>';
print '<tr><td width="25%">'.$langs->trans('ThirdPartyName').'</td>';
print '<td colspan="3">';
print $form->showrefnav($object,'socid','',($user->societe_id?0:1),'rowid','nom');
print '</td></tr>';
@ -121,11 +121,12 @@ if ($id > 0)
}
print "</table>";
print '<br>';
$colwidth='25';
include DOL_DOCUMENT_ROOT.'/core/tpl/notes.tpl.php';
dol_fiche_end();
}

View File

@ -141,7 +141,7 @@ if ($result > 0)
print '<table class="border"width="100%">';
print '<tr><td width="20%">'.$langs->trans("ThirdPartyName").'</td><td colspan="3">';
print '<tr><td width="25%">'.$langs->trans("ThirdPartyName").'</td><td colspan="3">';
print $form->showrefnav($object,'socid','',($user->societe_id?0:1),'rowid','nom');
print '</td></tr>';
@ -169,7 +169,7 @@ if ($result > 0)
print '</td></tr>';
}
print '<tr><td width="30%">'.$langs->trans("NbOfActiveNotifications").'</td>';
print '<tr><td>'.$langs->trans("NbOfActiveNotifications").'</td>';
print '<td colspan="3">';
$sql = "SELECT COUNT(n.rowid) as nb";
$sql.= " FROM ".MAIN_DB_PREFIX."notify_def as n";

View File

@ -1465,7 +1465,7 @@ else
*/
// Name
print '<tr><td width="20%">'.$langs->trans('ThirdPartyName').'</td>';
print '<tr><td width="25%">'.$langs->trans('ThirdPartyName').'</td>';
print '<td colspan="3">';
print $form->showrefnav($object, 'socid', '', ($user->societe_id?0:1), 'rowid', 'nom');
print '</td>';

View File

@ -174,6 +174,7 @@ select.flat {
border-top:solid 1px rgba(0,0,0,.4);
border-bottom:solid 1px rgba(0,0,0,.2);
box-shadow:1px 1px 2px rgba(0,0,0,.2) inset;
background: #FDFDFD;
}
form {

View File

@ -76,11 +76,6 @@ class User extends CommonObject
var $fk_member;
var $fk_user;
var $webcal_login;
var $phenix_login;
var $phenix_pass;
var $phenix_pass_crypted;
var $clicktodial_url;
var $clicktodial_login;
var $clicktodial_password;
@ -144,7 +139,7 @@ class User extends CommonObject
// Get user
$sql = "SELECT u.rowid, u.lastname, u.firstname, u.email, u.job, u.signature, u.office_phone, u.office_fax, u.user_mobile,";
$sql.= " u.admin, u.login, u.webcal_login, u.phenix_login, u.phenix_pass, u.note,";
$sql.= " u.admin, u.login, u.note,";
$sql.= " u.pass, u.pass_crypted, u.pass_temp,";
$sql.= " u.fk_societe, u.fk_socpeople, u.fk_member, u.fk_user, u.ldap_sid,";
$sql.= " u.statut, u.lang, u.entity,";
@ -220,9 +215,6 @@ class User extends CommonObject
$this->datelastlogin = $this->db->jdate($obj->datel);
$this->datepreviouslogin = $this->db->jdate($obj->datep);
$this->webcal_login = $obj->webcal_login;
$this->phenix_login = $obj->phenix_login;
$this->phenix_pass_crypted = $obj->phenix_pass;
$this->societe_id = $obj->fk_societe;
$this->contact_id = $obj->fk_socpeople;
$this->fk_member = $obj->fk_member;
@ -1111,12 +1103,6 @@ class User extends CommonObject
$this->signature = trim($this->signature);
$this->note = trim($this->note);
$this->openid = trim(empty($this->openid)?'':$this->openid); // Avoid warning
$this->webcal_login = trim($this->webcal_login);
$this->phenix_login = trim($this->phenix_login);
if ($this->phenix_pass != $this->phenix_pass_crypted)
{
$this->phenix_pass = dol_hash(trim($this->phenix_pass));
}
$this->admin = $this->admin?$this->admin:0;
// Check parameters
@ -1146,9 +1132,6 @@ class User extends CommonObject
$sql.= ", email = '".$this->db->escape($this->email)."'";
$sql.= ", job = '".$this->db->escape($this->job)."'";
$sql.= ", signature = '".$this->db->escape($this->signature)."'";
$sql.= ", webcal_login = '".$this->db->escape($this->webcal_login)."'";
$sql.= ", phenix_login = '".$this->db->escape($this->phenix_login)."'";
$sql.= ", phenix_pass = '".$this->db->escape($this->phenix_pass)."'";
$sql.= ", note = '".$this->db->escape($this->note)."'";
$sql.= ", photo = ".($this->photo?"'".$this->db->escape($this->photo)."'":"null");
$sql.= ", openid = ".($this->openid?"'".$this->db->escape($this->openid)."'":"null");
@ -1954,6 +1937,8 @@ class User extends CommonObject
{
global $user,$langs;
$now=dol_now();
// Initialise parametres
$this->id=0;
$this->ref = 'SPECIMEN';
@ -1971,12 +1956,11 @@ class User extends CommonObject
$this->pass='dolibspec';
//$this->pass_indatabase='dolibspec'; Set after a fetch
//$this->pass_indatabase_crypted='e80ca5a88c892b0aaaf7e154853bccab'; Set after a fetch
$this->datec=time();
$this->datem=time();
$this->webcal_login='dolibspec';
$this->datec=$now;
$this->datem=$now;
$this->datelastlogin=time();
$this->datepreviouslogin=time();
$this->datelastlogin=$now;
$this->datepreviouslogin=$now;
$this->statut=1;
//$this->societe_id = 1; For external users

View File

@ -357,10 +357,6 @@ function getUser($authentication,$id,$ref='',$ref_ext='')
'fk_thirdparty' => $user->societe_id,
'fk_contact' => $user->contact_id,
'fk_member' => $user->fk_member,
'webcal_login' => $user->webcal_login,
'phenix_login' => $user->phenix_login,
'phenix_pass' => $user->phenix_pass,
'phenix_pass_crypted' => $user->phenix_pass_crypted,
'datelastlogin' => dol_print_date($user->datelastlogin,'dayhourrfc'),
'datepreviouslogin' => dol_print_date($user->datepreviouslogin,'dayhourrfc'),
'statut' => $user->statut,

View File

@ -36,7 +36,6 @@ if (substr($sapi_type, 0, 3) == 'cgi') {
// Include Dolibarr environment
require_once($path."../../htdocs/master.inc.php");
// After this $db is an opened handler to database. We close it at end of file.
require_once(DOL_DOCUMENT_ROOT."/cron/functions_cron.lib.php");
require_once(DOL_DOCUMENT_ROOT."/compta/facture/class/facture.class.php");
require_once(DOL_DOCUMENT_ROOT."/core/modules/facture/modules_facture.php");
require_once(DOL_DOCUMENT_ROOT."/core/lib/date.lib.php");
@ -179,7 +178,7 @@ if (in_array('payments',$filter) && in_array('nopayment',$filter))
// Define SQL and SQL request to select invoices
// Use $filter, $dateafterdate, datebeforedate, $paymentdateafter, $paymentdatebefore
$result=rebuild_merge_pdf($db, $langs, $conf, $diroutputpdf, $newlangid, $filter, $dateafterdate, $datebeforedate, $paymentdateafter, $paymentdatebefore, 1, $regenerate);
$result=rebuild_merge_pdf($db, $langs, $conf, $diroutputpdf, $newlangid, $filter, $dateafterdate, $datebeforedate, $paymentdateafter, $paymentdatebefore, 1, $regenerate, $option);

View File

@ -118,11 +118,11 @@ class WebservicesInvoicesTest extends PHPUnit_Framework_TestCase
/**
* testWSInvoices_xxx
* testWSInvoicesXxx
*
* @return int
*/
public function testWSInvoices_xxx()
public function testWSInvoicesXxx()
{
global $conf,$user,$langs,$db;
$conf=$this->savconf;

View File

@ -118,11 +118,11 @@ class WebservicesOrdersTest extends PHPUnit_Framework_TestCase
/**
* testWSOrder_xxx
* testWSOrderXxx
*
* @return int
*/
public function testWSOrder_xxx()
public function testWSOrderXxx()
{
global $conf,$user,$langs,$db;
$conf=$this->savconf;
@ -178,11 +178,11 @@ class WebservicesOrdersTest extends PHPUnit_Framework_TestCase
/**
* testWSOther_GetVersions
* testWSOtherGetVersions
*
* @return int
*/
public function testWSOther_GetVersions()
public function testWSOtherGetVersions()
{
global $conf,$user,$langs,$db;
$conf=$this->savconf;

View File

@ -118,11 +118,11 @@ class WebservicesOtherTest extends PHPUnit_Framework_TestCase
/**
* testWSOther_GetVersions
* testWSOtherGetVersions
*
* @return int
*/
public function testWSOther_GetVersions()
public function testWSOtherGetVersions()
{
global $conf,$user,$langs,$db;
$conf=$this->savconf;

View File

@ -118,11 +118,11 @@ class WebservicesThirdpartyTest extends PHPUnit_Framework_TestCase
/**
* testWSThirdparty_xxx
* testWSThirdpartyXxx
*
* @return int
*/
public function testWSThirdparty_xxx()
public function testWSThirdpartyXxx()
{
global $conf,$user,$langs,$db;
$conf=$this->savconf;

View File

@ -118,11 +118,11 @@ class WebservicesUserTest extends PHPUnit_Framework_TestCase
/**
* testWSUser_xxx
* testWSUserXxx
*
* @return int
*/
public function testWSUser_xxx()
public function testWSUserXxx()
{
global $conf,$user,$langs,$db;
$conf=$this->savconf;