diff --git a/htdocs/admin/mails.php b/htdocs/admin/mails.php index da83962fcd9..b3aa4cf3e93 100644 --- a/htdocs/admin/mails.php +++ b/htdocs/admin/mails.php @@ -211,7 +211,7 @@ if (($action == 'send' || $action == 'sendhtml') && ! $_POST['addfile'] && ! $_P $body=make_substitutions($body,$substitutionarrayfortest); require_once(DOL_DOCUMENT_ROOT."/core/class/CMailFile.class.php"); - $mailfile = new CMailFile( + $mailfile = new CMailFile( $subject, $sendto, $email_from, @@ -224,7 +224,7 @@ if (($action == 'send' || $action == 'sendhtml') && ! $_POST['addfile'] && ! $_P $deliveryreceipt, $msgishtml, $errors_to - ); + ); $result=$mailfile->sendfile(); diff --git a/htdocs/comm/mailing/fiche.php b/htdocs/comm/mailing/fiche.php index 6f3e616ef3b..abba0cbef1b 100644 --- a/htdocs/comm/mailing/fiche.php +++ b/htdocs/comm/mailing/fiche.php @@ -60,11 +60,11 @@ $substitutionarray=array( if ($conf->global->MAILING_EMAIL_UNSUBSCRIBE) { $substitutionarray=array_merge( - $substitutionarray, - array( - '__CHECK_READ__' => 'CheckMail', - '__UNSUBSCRIBE__' => 'Unsubscribe' - ) + $substitutionarray, + array( + '__CHECK_READ__' => 'CheckMail', + '__UNSUBSCRIBE__' => 'Unsubscribe' + ) ); } @@ -83,13 +83,13 @@ $substitutionarrayfortest=array( ); if ($conf->global->MAILING_EMAIL_UNSUBSCRIBE) { - $substitutionarrayfortest=array_merge( - $substitutionarrayfortest, - array( - '__CHECK_READ__' => 'TESTCheckMail', - '__UNSUBSCRIBE__' => 'TESTUnsubscribe' - ) - ); + $substitutionarrayfortest=array_merge( + $substitutionarrayfortest, + array( + '__CHECK_READ__' => 'TESTCheckMail', + '__UNSUBSCRIBE__' => 'TESTUnsubscribe' + ) + ); } // Action clone object diff --git a/htdocs/commande/class/commande.class.php b/htdocs/commande/class/commande.class.php index 25fa62ba302..27ed1042f75 100644 --- a/htdocs/commande/class/commande.class.php +++ b/htdocs/commande/class/commande.class.php @@ -684,7 +684,7 @@ class Commande extends CommonObject $this->lines[$i]->remise_percent, $this->lines[$i]->info_bits, $this->lines[$i]->fk_remise_except, - 'HT', + 'HT', 0, $this->lines[$i]->date_start, $this->lines[$i]->date_end, @@ -2110,7 +2110,7 @@ class Commande extends CommonObject * @param int $skip_update_total Skip update of total * @return int < 0 if KO, > 0 if OK */ - function updateline($rowid, $desc, $pu, $qty, $remise_percent=0, $txtva, $txlocaltax1=0,$txlocaltax2=0, $price_base_type='HT', $info_bits=0, $date_start='', $date_end='', $type=0, $fk_parent_line=0, $skip_update_total=0) + function updateline($rowid, $desc, $pu, $qty, $remise_percent, $txtva, $txlocaltax1=0,$txlocaltax2=0, $price_base_type='HT', $info_bits=0, $date_start='', $date_end='', $type=0, $fk_parent_line=0, $skip_update_total=0) { global $conf; diff --git a/htdocs/commande/class/commandestats.class.php b/htdocs/commande/class/commandestats.class.php index bc209081ca5..e8aa6c6ffea 100644 --- a/htdocs/commande/class/commandestats.class.php +++ b/htdocs/commande/class/commandestats.class.php @@ -45,7 +45,7 @@ class CommandeStats extends Stats /** * Constructor * - * @param DoliDB $DB Database handler + * @param DoliDB $db Database handler * @param int $socid Id third party for filter * @param string $mode Option * @param int $userid Id user for filter diff --git a/htdocs/compta/facture/class/facture-rec.class.php b/htdocs/compta/facture/class/facture-rec.class.php index 6a976f9ea4a..ba73edbcec3 100644 --- a/htdocs/compta/facture/class/facture-rec.class.php +++ b/htdocs/compta/facture/class/facture-rec.class.php @@ -146,20 +146,20 @@ class FactureRec extends Facture for ($i = 0; $i < $num; $i++) { $result_insert = $this->addline( - $this->id, - $facsrc->lines[$i]->desc, - $facsrc->lines[$i]->subprice, - $facsrc->lines[$i]->qty, - $facsrc->lines[$i]->tva_tx, - $facsrc->lines[$i]->fk_product, - $facsrc->lines[$i]->remise_percent, - 'HT', - 0, - '', - 0, - $facsrc->lines[$i]->product_type, - $facsrc->lines[$i]->rang, - $facsrc->lines[$i]->special_code + $this->id, + $facsrc->lines[$i]->desc, + $facsrc->lines[$i]->subprice, + $facsrc->lines[$i]->qty, + $facsrc->lines[$i]->tva_tx, + $facsrc->lines[$i]->fk_product, + $facsrc->lines[$i]->remise_percent, + 'HT', + 0, + '', + 0, + $facsrc->lines[$i]->product_type, + $facsrc->lines[$i]->rang, + $facsrc->lines[$i]->special_code ); if ($result_insert < 0) diff --git a/htdocs/compta/facture/class/facture.class.php b/htdocs/compta/facture/class/facture.class.php index 30040fe6cb4..4d7ef16713d 100644 --- a/htdocs/compta/facture/class/facture.class.php +++ b/htdocs/compta/facture/class/facture.class.php @@ -349,7 +349,7 @@ class Facture extends CommonObject $this->lines[$i]->fk_code_ventilation, $this->lines[$i]->info_bits, $this->lines[$i]->fk_remise_except, - 'HT', + 'HT', 0, $this->lines[$i]->product_type, $this->lines[$i]->rang, @@ -400,7 +400,13 @@ class Facture extends CommonObject $localtax2_tx, $_facrec->lines[$i]->fk_product, $_facrec->lines[$i]->remise_percent, - '','',0,0,'','HT',0, + '', + '', + 0, + 0, + '', + 'HT', + 0, $_facrec->lines[$i]->product_type, $_facrec->lines[$i]->rang, $_facrec->lines[$i]->special_code @@ -1264,7 +1270,7 @@ class Facture extends CommonObject } } } - + $this->db->commit(); return 1; } diff --git a/htdocs/core/class/fileupload.class.php b/htdocs/core/class/fileupload.class.php index 41fafdb0584..f8b7eb0706e 100644 --- a/htdocs/core/class/fileupload.class.php +++ b/htdocs/core/class/fileupload.class.php @@ -34,10 +34,10 @@ class FileUpload protected $_options; protected $_fk_element; protected $_element; - + /** * Constructor - * + * * @param array $options Options array * @param int $fk_element fk_element * @param string $element element @@ -46,17 +46,17 @@ class FileUpload { global $db, $conf; global $object; - + $this->_fk_element=$fk_element; $this->_element=$element; - + $pathname=$filename=$element; if (preg_match('/^([^_]+)_([^_]+)/i',$element,$regs)) { $pathname = $regs[1]; $filename = $regs[2]; } - + // For compatibility if ($element == 'propal') { $pathname = 'comm/propal'; @@ -82,18 +82,18 @@ class FileUpload } dol_include_once('/'.$pathname.'/class/'.$filename.'.class.php'); - + $classname = ucfirst($filename); - + if ($element == 'order_supplier') { $classname = 'CommandeFournisseur'; } - + $object = new $classname($db); - + $object->fetch($fk_element); $object->fetch_thirdparty(); - + $this->_options = array( 'script_url' => $_SERVER['PHP_SELF'], 'upload_dir' => $dir_output . '/' . $object->ref . '/', @@ -141,11 +141,14 @@ class FileUpload $this->_options = array_replace_recursive($this->_options, $options); } } - + /** - * + * getFullUrl + * + * @return string Full url */ - protected function getFullUrl() { + protected function getFullUrl() + { $https = !empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off'; return ($https ? 'https://' : 'http://'). @@ -155,13 +158,15 @@ class FileUpload $_SERVER['SERVER_PORT'] === 80 ? '' : ':'.$_SERVER['SERVER_PORT']))). substr($_SERVER['SCRIPT_NAME'],0, strrpos($_SERVER['SCRIPT_NAME'], '/')); } - + /** * Set delete url - * - * @param unknown_type $file + * + * @param string $file File + * @return void */ - protected function set_file_delete_url($file) { + protected function set_file_delete_url($file) + { $file->delete_url = $this->_options['script_url'] .'?file='.rawurlencode($file->name).'&fk_element='.$this->_fk_element.'&element='.$this->_element; $file->delete_type = $this->_options['delete_type']; @@ -169,7 +174,7 @@ class FileUpload $file->delete_url .= '&_method=DELETE'; } } - + /** * Enter description here ... * @@ -218,7 +223,7 @@ class FileUpload protected function create_scaled_image($file_name, $options) { global $maxwidthmini, $maxheightmini; - + $file_path = $this->_options['upload_dir'].$file_name; $new_file_path = $options['upload_dir'].$file_name; @@ -302,10 +307,10 @@ class FileUpload } return true; } - + /** * Enter description here ... - * + * * @param unknown_type $matches */ protected function upcount_name_callback($matches) { @@ -313,10 +318,10 @@ class FileUpload $ext = isset($matches[2]) ? $matches[2] : ''; return ' ('.$index.')'.$ext; } - + /** * Enter description here ... - * + * * @param unknown_type $name */ protected function upcount_name($name) { @@ -327,13 +332,14 @@ class FileUpload 1 ); } - + /** * Enter description here ... - * - * @param unknown_type $name - * @param unknown_type $type - * @param unknown_type $index + * + * @param string $name + * @param string $type + * @param string $index + * @return string Trimed string */ protected function trim_file_name($name, $type, $index) { // Remove path information and dots around the filename, to prevent uploading @@ -352,20 +358,20 @@ class FileUpload } return $file_name; } - + /** * Enter description here ... - * + * * @param unknown_type $file * @param unknown_type $index */ protected function handle_form_data($file, $index) { // Handle form data, e.g. $_REQUEST['description'][$index] } - + /** * Enter description here ... - * + * * @param unknown_type $file_path */ protected function orient_image($file_path) { diff --git a/htdocs/core/class/hookmanager.class.php b/htdocs/core/class/hookmanager.class.php index 110285559c1..a9d792e9f5a 100755 --- a/htdocs/core/class/hookmanager.class.php +++ b/htdocs/core/class/hookmanager.class.php @@ -56,7 +56,6 @@ class HookManager /** * Init array this->hooks with instantiated action controlers. - * * First, a hook is declared by a module by adding a constant MAIN_MODULE_MYMODULENAME_HOOKS * with value 'nameofcontext1:nameofcontext2:...' into $this->const of module descriptor file. * This make conf->hooks_modules loaded with an entry ('modulename'=>array(nameofcontext1,nameofcontext2,...)) diff --git a/htdocs/core/class/ldap.class.php b/htdocs/core/class/ldap.class.php index 9ca0b596792..5fe307bdbc6 100644 --- a/htdocs/core/class/ldap.class.php +++ b/htdocs/core/class/ldap.class.php @@ -1013,7 +1013,7 @@ class Ldap * Required by Active Directory * * @param string $hex Hex value - * @return string Little endian + * @return string Little endian */ function littleEndian($hex) { @@ -1028,7 +1028,7 @@ class Ldap * Recupere le SID de l'utilisateur * Required by Active Directory * - * @param string $ldapuser Login de l'utilisateur + * @param string $ldapUser Login de l'utilisateur * @return string Sid */ function getObjectSid($ldapUser) diff --git a/htdocs/core/class/notify.class.php b/htdocs/core/class/notify.class.php index 90aaa6082fd..6aadd2ee9fc 100644 --- a/htdocs/core/class/notify.class.php +++ b/htdocs/core/class/notify.class.php @@ -203,16 +203,16 @@ class Notify $mailfile = new CMailFile( $subject, - $sendto, - $replyto, - $message, - array($file), - array($mimefile), - array($filename[count($filename)-1]), - '', - '', - 0, - $msgishtml + $sendto, + $replyto, + $message, + array($file), + array($mimefile), + array($filename[count($filename)-1]), + '', + '', + 0, + $msgishtml ); if ($mailfile->sendfile()) diff --git a/htdocs/core/lib/date.lib.php b/htdocs/core/lib/date.lib.php index 7ee142cbe46..c23bcc1b6d7 100644 --- a/htdocs/core/lib/date.lib.php +++ b/htdocs/core/lib/date.lib.php @@ -644,7 +644,7 @@ function num_public_holiday($timestampStart, $timestampEnd, $countrycode='FR') date("m", $date_paques), date("d", $date_paques) + 38, date("Y", $date_paques) - ); + ); $jour_ascension = date("d", $date_ascension); $mois_ascension = date("m", $date_ascension); if($jour_ascension == $jour && $mois_ascension == $mois) $ferie=true; @@ -652,12 +652,12 @@ function num_public_holiday($timestampStart, $timestampEnd, $countrycode='FR') // Calcul de Pentecote (11 jours apres Paques) $date_pentecote = mktime( - date("H", $date_ascension), - date("i", $date_ascension), - date("s", $date_ascension), - date("m", $date_ascension), - date("d", $date_ascension) + 11, - date("Y", $date_ascension) + date("H", $date_ascension), + date("i", $date_ascension), + date("s", $date_ascension), + date("m", $date_ascension), + date("d", $date_ascension) + 11, + date("Y", $date_ascension) ); $jour_pentecote = date("d", $date_pentecote); $mois_pentecote = date("m", $date_pentecote); diff --git a/htdocs/core/lib/files.lib.php b/htdocs/core/lib/files.lib.php index 904d5dfef54..22946debaea 100644 --- a/htdocs/core/lib/files.lib.php +++ b/htdocs/core/lib/files.lib.php @@ -490,6 +490,7 @@ function dol_move($srcfile, $destfile, $newmask=0, $overwriteifexists=1) * Before= Capture d\'écran.doc After= Capture d'écran.doc * * @param string $filename Filename + * @return string Unescaped string */ function dol_unescapefile($filename) { diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index a0759939cfe..a0612f4febe 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -373,13 +373,13 @@ function dol_string_unaccent($str) { $string = strtr( $str, - "\xC0\xC1\xC2\xC3\xC5\xC7 + "\xC0\xC1\xC2\xC3\xC5\xC7 \xC8\xC9\xCA\xCB\xCC\xCD\xCE\xCF\xD0\xD1 \xD2\xD3\xD4\xD5\xD8\xD9\xDA\xDB\xDD \xE0\xE1\xE2\xE3\xE5\xE7\xE8\xE9\xEA\xEB \xEC\xED\xEE\xEF\xF0\xF1\xF2\xF3\xF4\xF5\xF8 \xF9\xFA\xFB\xFD\xFF", - "AAAAAC + "AAAAAC EEEEIIIIDN OOOOOUUUY aaaaaceeee @@ -449,7 +449,6 @@ function dol_escape_htmltag($stringtoescape,$keepb=0) * this, use logging to files instead of syslog (see setup of module). * Note: If SYSLOG_FILE_NO_ERROR defined, we never output any error message when writing to log fails. * Note: You can get log message into html sources by adding parameter &logtohtml=1 (constant MAIN_LOGTOHTML must be set) - * * This function works only if syslog module is enabled. * This must not use any call to other function calling dol_syslog (avoid infinite loop). * @@ -877,7 +876,6 @@ function dol_print_date($time,$format='',$tzoutput='tzserver',$outputlangs='',$e /** * Return an array with locale date info. * PHP getdate is restricted to the years 1901-2038 on Unix and 1970-2038 on Windows - * * WARNING: This function always use PHP server timezone to return locale informations. * Usage must be avoid. * diff --git a/htdocs/core/modules/facture/doc/pdf_oursin.modules.php b/htdocs/core/modules/facture/doc/pdf_oursin.modules.php index fb1c41e476d..20057a2b111 100755 --- a/htdocs/core/modules/facture/doc/pdf_oursin.modules.php +++ b/htdocs/core/modules/facture/doc/pdf_oursin.modules.php @@ -392,7 +392,7 @@ class pdf_oursin extends ModelePDFFactures $invoice->fetch($obj->fk_facture_source); - $pdf->SetXY($tab3_posx, $tab3_top+$y ); + $pdf->SetXY($tab3_posx, $tab3_top+$y); $pdf->MultiCell(20, 3, dol_print_date($obj->datef,'day',false,$outputlangs,true), 0, 'L', 0); $pdf->SetXY($tab3_posx+21, $tab3_top+$y); $pdf->MultiCell(20, 3, price($obj->amount_ttc), 0, 'L', 0); @@ -401,7 +401,7 @@ class pdf_oursin extends ModelePDFFactures $pdf->SetXY($tab3_posx+58, $tab3_top+$y); $pdf->MultiCell(20, 3, $invoice->ref, 0, 'L', 0); - $pdf->line($tab3_posx, $tab3_top+$y+3, $tab3_posx+$tab3_width, $tab3_top+$y+3 ); + $pdf->line($tab3_posx, $tab3_top+$y+3, $tab3_posx+$tab3_width, $tab3_top+$y+3); $i++; } @@ -429,7 +429,7 @@ class pdf_oursin extends ModelePDFFactures $y+=3; $row = $this->db->fetch_object($resql); - $pdf->SetXY($tab3_posx, $tab3_top+$y ); + $pdf->SetXY($tab3_posx, $tab3_top+$y); $pdf->MultiCell(20, 3, dol_print_date($this->db->jdate($row->date),'day',false,$outputlangs,true), 0, 'L', 0); $pdf->SetXY($tab3_posx+21, $tab3_top+$y); $pdf->MultiCell(20, 3, price($row->amount), 0, 'L', 0); @@ -440,7 +440,7 @@ class pdf_oursin extends ModelePDFFactures $pdf->SetXY($tab3_posx+58, $tab3_top+$y); $pdf->MultiCell(30, 3, $row->num, 0, 'L', 0); - $pdf->line($tab3_posx, $tab3_top+$y+3, $tab3_posx+$tab3_width, $tab3_top+$y+3 ); + $pdf->line($tab3_posx, $tab3_top+$y+3, $tab3_posx+$tab3_width, $tab3_top+$y+3); $i++; } diff --git a/htdocs/core/modules/societe/doc/doc_generic_odt.modules.php b/htdocs/core/modules/societe/doc/doc_generic_odt.modules.php index 061eb082818..442668b54b4 100644 --- a/htdocs/core/modules/societe/doc/doc_generic_odt.modules.php +++ b/htdocs/core/modules/societe/doc/doc_generic_odt.modules.php @@ -155,7 +155,7 @@ class doc_generic_odt extends ModeleThirdPartyDoc /** * Function to build a document on disk using the generic odt module. * - * @param Societe $object Object source to build document + * @param Societe &$object Object source to build document * @param Translate $outputlangs Lang output object * @param string $srctemplatepath Full path of source filename for generator using a template file * @return int 1 if OK, <=0 if KO diff --git a/htdocs/core/modules/societe/modules_societe.class.php b/htdocs/core/modules/societe/modules_societe.class.php index a627ccdc3fb..bf38ba3d4f4 100644 --- a/htdocs/core/modules/societe/modules_societe.class.php +++ b/htdocs/core/modules/societe/modules_societe.class.php @@ -364,7 +364,7 @@ abstract class ModeleAccountancyCode * Create a document for third party * * @param DoliDB $db Database handler - * @param Societe $object Object of third party to use + * @param Societe &$object Object of third party to use * @param string $message Message * @param string $modele Force model to use ('' to not force). model can be a model name or a template file. * @param Translate $outputlangs Object lang to use for translation @@ -416,7 +416,7 @@ function thirdparty_doc_create($db, &$object, $message, $modele, $outputlangs) if ($obj->write_file($object, $outputlangs, $srctemplatepath) > 0) { $outputlangs->charset_output=$sav_charset_output; - + // Appel des triggers include_once(DOL_DOCUMENT_ROOT . "/core/class/interfaces.class.php"); $interface=new Interfaces($db); @@ -425,7 +425,7 @@ function thirdparty_doc_create($db, &$object, $message, $modele, $outputlangs) $error++; $this->errors=$interface->errors; } // Fin appel triggers - + return 1; } else diff --git a/htdocs/core/modules/supplier_order/pdf/pdf_muscadet.modules.php b/htdocs/core/modules/supplier_order/pdf/pdf_muscadet.modules.php index b3b0fba2d6c..b669f692e1d 100644 --- a/htdocs/core/modules/supplier_order/pdf/pdf_muscadet.modules.php +++ b/htdocs/core/modules/supplier_order/pdf/pdf_muscadet.modules.php @@ -60,7 +60,8 @@ class pdf_muscadet extends ModelePDFSuppliersOrders /** * Constructor * - * @param DoliDB $db Database handler + * @param DoliDB $db Database handler + * @param Societe $object Third party providing order */ function __construct($db,$object) { diff --git a/htdocs/install/lib/repair.lib.php b/htdocs/install/lib/repair.lib.php index c51cf7ec281..e6a26cda565 100644 --- a/htdocs/install/lib/repair.lib.php +++ b/htdocs/install/lib/repair.lib.php @@ -26,6 +26,7 @@ * * @param int $id Element id * @param string $table Table of Element + * @return boolean True if exists */ function checkElementExist($id, $table) { diff --git a/htdocs/product/fiche.php b/htdocs/product/fiche.php index 973efa76322..d8d655b6ae4 100644 --- a/htdocs/product/fiche.php +++ b/htdocs/product/fiche.php @@ -251,7 +251,7 @@ if (empty($reshook)) if ($object->fetch($id,$ref)) { $object->oldcopy=dol_clone($object); - + $object->ref = $ref; $object->libelle = $_POST["libelle"]; $object->description = dol_htmlcleanlastbr($_POST["desc"]); @@ -549,8 +549,8 @@ if (empty($reshook)) $localtax2_tx, // localtax2 $prod->id, $_POST["remise_percent"], - '', - '', //Todo: voir si fk_remise_except est encore valable car n'apparait plus dans les propales + '', + '', //Todo: voir si fk_remise_except est encore valable car n'apparait plus dans les propales $price_base_type, $pu_ttc ); @@ -631,11 +631,11 @@ if (empty($reshook)) $localtax2_tx, $prod->id, $_POST["remise_percent"], - '', - '', - '', - '', - '', + '', + '', + '', + '', + '', $price_base_type, $pu_ttc ); @@ -825,7 +825,7 @@ else // Note (private, no output on invoices, propales...) print '