Fix: Codesniffer
This commit is contained in:
parent
bc1469ff29
commit
ba93a4bfe2
@ -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
|
|
||||||
@ -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>
|
|
||||||
@ -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 "">
|
|
||||||
@ -2783,7 +2783,6 @@ class Commande extends CommonOrder
|
|||||||
* Update value of extrafields on the proposal
|
* Update value of extrafields on the proposal
|
||||||
*
|
*
|
||||||
* @param User $user Object user that modify
|
* @param User $user Object user that modify
|
||||||
* @param double $remise Amount discount
|
|
||||||
* @return int <0 if ko, >0 if ok
|
* @return int <0 if ko, >0 if ok
|
||||||
*/
|
*/
|
||||||
function update_extrafields($user)
|
function update_extrafields($user)
|
||||||
|
|||||||
@ -175,11 +175,10 @@ class mailing_thirdparties_services_expired extends MailingTargets
|
|||||||
* For example if this selector is used to extract 500 different
|
* For example if this selector is used to extract 500 different
|
||||||
* emails from a text file, this function must return 500.
|
* emails from a text file, this function must return 500.
|
||||||
*
|
*
|
||||||
* @param int $filter Filter
|
* @param string $sql Request
|
||||||
* @param string $option Option
|
|
||||||
* @return int Number of recipients
|
* @return int Number of recipients
|
||||||
*/
|
*/
|
||||||
function getNbOfRecipients($sql,$filter=1,$option='')
|
function getNbOfRecipients($sql='')
|
||||||
{
|
{
|
||||||
$now=dol_now();
|
$now=dol_now();
|
||||||
|
|
||||||
|
|||||||
@ -146,6 +146,7 @@ class ProductFournisseur extends Product
|
|||||||
* @param string $charges costs affering to product
|
* @param string $charges costs affering to product
|
||||||
* @param float $remise_percent Discount regarding qty (percent)
|
* @param float $remise_percent Discount regarding qty (percent)
|
||||||
* @param float $remise Discount regarding qty (amount)
|
* @param float $remise Discount regarding qty (amount)
|
||||||
|
* @param int $newnpr Set NPR or not
|
||||||
* @return int <0 if KO, >=0 if OK
|
* @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)
|
function update_buyprice($qty, $buyprice, $user, $price_base_type, $fourn, $availability, $ref_fourn, $tva_tx, $charges=0, $remise_percent=0, $remise=0, $newnpr=0)
|
||||||
|
|||||||
@ -202,7 +202,7 @@ if (isset($_POST["ajoutercolonne"]) && ($object->format == "D" || $object->forma
|
|||||||
|
|
||||||
//on rajoute la valeur dans les valeurs
|
//on rajoute la valeur dans les valeurs
|
||||||
$datesbase = explode(",",$object->sujet);
|
$datesbase = explode(",",$object->sujet);
|
||||||
$taillebase = sizeof($datesbase);
|
$taillebase = count($datesbase);
|
||||||
|
|
||||||
//recherche de l'endroit de l'insertion de la nouvelle date dans les dates deja entrées dans le tableau
|
//recherche de l'endroit de l'insertion de la nouvelle date dans les dates deja entrées dans le tableau
|
||||||
if ($nouvelledate < $datesbase[0]) {
|
if ($nouvelledate < $datesbase[0]) {
|
||||||
@ -210,7 +210,9 @@ if (isset($_POST["ajoutercolonne"]) && ($object->format == "D" || $object->forma
|
|||||||
} elseif ($nouvelledate > $datesbase[$taillebase-1]) {
|
} elseif ($nouvelledate > $datesbase[$taillebase-1]) {
|
||||||
$cleinsertion = count($datesbase);
|
$cleinsertion = count($datesbase);
|
||||||
} else {
|
} else {
|
||||||
for ($i = 0; $i < count($datesbase); $i++) {
|
$nbdatesbase=count($datesbase);
|
||||||
|
for ($i = 0; $i < $nbdatesbase; $i++)
|
||||||
|
{
|
||||||
$j = $i + 1;
|
$j = $i + 1;
|
||||||
if ($nouvelledate > $datesbase[$i] && $nouvelledate < $datesbase[$j]) {
|
if ($nouvelledate > $datesbase[$i] && $nouvelledate < $datesbase[$j]) {
|
||||||
$cleinsertion = $j;
|
$cleinsertion = $j;
|
||||||
|
|||||||
@ -340,7 +340,7 @@ class Opensurveysondage extends CommonObject
|
|||||||
* @param string $numsondageadmin Num sondage to delete
|
* @param string $numsondageadmin Num sondage to delete
|
||||||
* @return int <0 if KO, >0 if OK
|
* @return int <0 if KO, >0 if OK
|
||||||
*/
|
*/
|
||||||
function delete($user, $notrigger=0, $numsondageadmin)
|
function delete($user, $notrigger, $numsondageadmin)
|
||||||
{
|
{
|
||||||
global $conf, $langs;
|
global $conf, $langs;
|
||||||
$error=0;
|
$error=0;
|
||||||
|
|||||||
@ -120,8 +120,8 @@ function get_server_name()
|
|||||||
/**
|
/**
|
||||||
* is_error
|
* is_error
|
||||||
*
|
*
|
||||||
* @param unknown_type $cerr
|
* @param string $cerr Error value
|
||||||
* @return boolean
|
* @return boolean Error key found or not
|
||||||
*/
|
*/
|
||||||
function is_error($cerr)
|
function is_error($cerr)
|
||||||
{
|
{
|
||||||
@ -190,6 +190,7 @@ function getUrlSondage($id, $admin = false)
|
|||||||
/**
|
/**
|
||||||
* Generate a random id
|
* Generate a random id
|
||||||
*
|
*
|
||||||
|
* @param string $car Char to generate key
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
function dol_survey_random($car)
|
function dol_survey_random($car)
|
||||||
@ -229,7 +230,7 @@ function ajouter_sondage($origin)
|
|||||||
|
|
||||||
if ($_SESSION["formatsondage"]=="D"||$_SESSION["formatsondage"]=="D+") {
|
if ($_SESSION["formatsondage"]=="D"||$_SESSION["formatsondage"]=="D+") {
|
||||||
//Calcul de la date de fin du sondage
|
//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;
|
$date_fin=$_SESSION["totalchoixjour"][$taille_tableau]+200000;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -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
|
// Si le test est passé, alors on insere la valeur dans la variable de session qui contient les dates
|
||||||
if ($journeuf && issetAndNoEmpty('choixjourajout') === true) {
|
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"]);
|
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
|
//On sauvegarde les heures deja entrées
|
||||||
for ($i = 0; $i < $cle; $i++) {
|
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
|
//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'))) {
|
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;
|
$jour_arret = $_SESSION["totalchoixjour"][$taille_tableau]+200000;
|
||||||
$date_fin=dol_print_date($jour_arret, 'dayhourtext');
|
$date_fin=dol_print_date($jour_arret, 'dayhourtext');
|
||||||
|
|
||||||
|
|||||||
@ -162,7 +162,7 @@ print '</script>'."\n";
|
|||||||
|
|
||||||
print '<br>'."\n";
|
print '<br>'."\n";
|
||||||
|
|
||||||
#affichage du cochage par défaut
|
// Check or not
|
||||||
$cocheplus='';
|
$cocheplus='';
|
||||||
if ($_SESSION["canedit"]) $cocheplus="checked";
|
if ($_SESSION["canedit"]) $cocheplus="checked";
|
||||||
|
|
||||||
|
|||||||
@ -64,7 +64,6 @@ $now=dol_now();
|
|||||||
|
|
||||||
$nbcolonnes=substr_count($object->sujet,',')+1;
|
$nbcolonnes=substr_count($object->sujet,',')+1;
|
||||||
$toutsujet=explode(",",$object->sujet);
|
$toutsujet=explode(",",$object->sujet);
|
||||||
#$toutsujet=str_replace("°","'",$toutsujet);
|
|
||||||
|
|
||||||
// affichage des sujets du sondage
|
// affichage des sujets du sondage
|
||||||
$input.=$langs->trans("Name").";";
|
$input.=$langs->trans("Name").";";
|
||||||
|
|||||||
@ -118,11 +118,11 @@ class WebservicesInvoicesTest extends PHPUnit_Framework_TestCase
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* testWSInvoices_xxx
|
* testWSInvoicesXxx
|
||||||
*
|
*
|
||||||
* @return int
|
* @return int
|
||||||
*/
|
*/
|
||||||
public function testWSInvoices_xxx()
|
public function testWSInvoicesXxx()
|
||||||
{
|
{
|
||||||
global $conf,$user,$langs,$db;
|
global $conf,$user,$langs,$db;
|
||||||
$conf=$this->savconf;
|
$conf=$this->savconf;
|
||||||
|
|||||||
@ -118,11 +118,11 @@ class WebservicesOrdersTest extends PHPUnit_Framework_TestCase
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* testWSOrder_xxx
|
* testWSOrderXxx
|
||||||
*
|
*
|
||||||
* @return int
|
* @return int
|
||||||
*/
|
*/
|
||||||
public function testWSOrder_xxx()
|
public function testWSOrderXxx()
|
||||||
{
|
{
|
||||||
global $conf,$user,$langs,$db;
|
global $conf,$user,$langs,$db;
|
||||||
$conf=$this->savconf;
|
$conf=$this->savconf;
|
||||||
@ -178,11 +178,11 @@ class WebservicesOrdersTest extends PHPUnit_Framework_TestCase
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* testWSOther_GetVersions
|
* testWSOtherGetVersions
|
||||||
*
|
*
|
||||||
* @return int
|
* @return int
|
||||||
*/
|
*/
|
||||||
public function testWSOther_GetVersions()
|
public function testWSOtherGetVersions()
|
||||||
{
|
{
|
||||||
global $conf,$user,$langs,$db;
|
global $conf,$user,$langs,$db;
|
||||||
$conf=$this->savconf;
|
$conf=$this->savconf;
|
||||||
|
|||||||
@ -118,11 +118,11 @@ class WebservicesOtherTest extends PHPUnit_Framework_TestCase
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* testWSOther_GetVersions
|
* testWSOtherGetVersions
|
||||||
*
|
*
|
||||||
* @return int
|
* @return int
|
||||||
*/
|
*/
|
||||||
public function testWSOther_GetVersions()
|
public function testWSOtherGetVersions()
|
||||||
{
|
{
|
||||||
global $conf,$user,$langs,$db;
|
global $conf,$user,$langs,$db;
|
||||||
$conf=$this->savconf;
|
$conf=$this->savconf;
|
||||||
|
|||||||
@ -118,11 +118,11 @@ class WebservicesThirdpartyTest extends PHPUnit_Framework_TestCase
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* testWSThirdparty_xxx
|
* testWSThirdpartyXxx
|
||||||
*
|
*
|
||||||
* @return int
|
* @return int
|
||||||
*/
|
*/
|
||||||
public function testWSThirdparty_xxx()
|
public function testWSThirdpartyXxx()
|
||||||
{
|
{
|
||||||
global $conf,$user,$langs,$db;
|
global $conf,$user,$langs,$db;
|
||||||
$conf=$this->savconf;
|
$conf=$this->savconf;
|
||||||
|
|||||||
@ -118,11 +118,11 @@ class WebservicesUserTest extends PHPUnit_Framework_TestCase
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* testWSUser_xxx
|
* testWSUserXxx
|
||||||
*
|
*
|
||||||
* @return int
|
* @return int
|
||||||
*/
|
*/
|
||||||
public function testWSUser_xxx()
|
public function testWSUserXxx()
|
||||||
{
|
{
|
||||||
global $conf,$user,$langs,$db;
|
global $conf,$user,$langs,$db;
|
||||||
$conf=$this->savconf;
|
$conf=$this->savconf;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user