diff --git a/ChangeLog b/ChangeLog index 63e3cc58bd1..64cd0f21e92 100644 --- a/ChangeLog +++ b/ChangeLog @@ -15,7 +15,7 @@ WARNING: Following changes may create regressions for some external modules, but were necessary to make Dolibarr better: * Method GetUrlTrackingStatus were renamed into getUrlTrackingStatus for consistency with naming rules. * API getListOfCivility has been renamed into getListOfCivilities for consistency with naming rules. - +* Deprecated function img_phone as been removed. You can use img_picto(..., 'call|call_out') instead.; ***** ChangeLog for 9.0.1 compared to 9.0.0 ***** diff --git a/htdocs/adherents/cartes/carte.php b/htdocs/adherents/cartes/carte.php index 412f0f4288d..b0ff07ac867 100644 --- a/htdocs/adherents/cartes/carte.php +++ b/htdocs/adherents/cartes/carte.php @@ -1,7 +1,7 @@ * Copyright (C) 2003 Jean-Louis Bergamo - * Copyright (C) 2006-2011 Laurent Destailleur + * Copyright (C) 2006-2013 Laurent Destailleur * * 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 @@ -249,13 +249,14 @@ $form=new Form($db); llxHeader('', $langs->trans("MembersCards")); print load_fiche_titre($langs->trans("LinkToGeneratedPages")); -print '
'; -print $langs->trans("LinkToGeneratedPagesDesc").'
'; +print ''.$langs->trans("LinkToGeneratedPagesDesc").'
'; print '
'; dol_htmloutput_errors($mesg); +print '
'; + print img_picto('', 'puce').' '.$langs->trans("DocForAllMembersCards", ($conf->global->ADHERENT_CARD_TYPE?$conf->global->ADHERENT_CARD_TYPE:$langs->transnoentitiesnoconv("None"))).' '; print '
'; print ''; @@ -272,7 +273,8 @@ asort($arrayoflabels); print $form->selectarray('model', $arrayoflabels, (GETPOST('model')?GETPOST('model'):$conf->global->ADHERENT_CARD_TYPE), 1, 0, 0, '', 0, 0, 0, '', '', 1); print '
'; print '
'; -print '
'; + +print '

'; print img_picto('', 'puce').' '.$langs->trans("DocForOneMemberCards", ($conf->global->ADHERENT_CARD_TYPE?$conf->global->ADHERENT_CARD_TYPE:$langs->transnoentitiesnoconv("None"))).' '; print '
'; @@ -290,7 +292,8 @@ print $form->selectarray('model', $arrayoflabels, (GETPOST('model')?GETPOST('mod print '
'.$langs->trans("Login").': '; print '
'; print '
'; -print '
'; + +print '

'; print img_picto('', 'puce').' '.$langs->trans("DocForLabels", $conf->global->ADHERENT_ETIQUETTE_TYPE).' '; print '
'; @@ -307,7 +310,6 @@ asort($arrayoflabels); print $form->selectarray('modellabel', $arrayoflabels, (GETPOST('modellabel')?GETPOST('modellabel'):$conf->global->ADHERENT_ETIQUETTE_TYPE), 1, 0, 0, '', 0, 0, 0, '', '', 1); print '
'; print '
'; -print '
'; // End of page llxFooter(); diff --git a/htdocs/categories/class/categorie.class.php b/htdocs/categories/class/categorie.class.php index aed85c9a83c..4b6f92a03d5 100644 --- a/htdocs/categories/class/categorie.class.php +++ b/htdocs/categories/class/categorie.class.php @@ -747,7 +747,7 @@ class Categorie extends CommonObject * @param string $type Type of category ('customer', 'supplier', 'contact', 'product', 'member') * @param int $onlyids Return only ids of objects (consume less memory) * @return array|int -1 if KO, array of instance of object if OK - * @see containsObject + * @see containsObject() */ public function getObjectsInCateg($type, $onlyids = 0) { @@ -794,7 +794,7 @@ class Categorie extends CommonObject * @param string $type Type of category ('customer', 'supplier', 'contact', 'product', 'member') * @param int $object_id Id of the object to search * @return int Number of occurrences - * @see getObjectsInCateg + * @see getObjectsInCateg() */ public function containsObject($type, $object_id) { diff --git a/htdocs/compta/facture/class/facture.class.php b/htdocs/compta/facture/class/facture.class.php index 7b34ad4e895..c48976c2153 100644 --- a/htdocs/compta/facture/class/facture.class.php +++ b/htdocs/compta/facture/class/facture.class.php @@ -4269,7 +4269,6 @@ class Facture extends CommonInvoice * Checks if the invoice is the last in its cycle * * @return bool Last of the cycle status - * */ public function is_last_in_cycle() { @@ -4299,8 +4298,8 @@ class Facture extends CommonInvoice * Function used to replace a thirdparty id with another one. * * @param DoliDB $db Database handler - * @param int $origin_id Old thirdparty id - * @param int $dest_id New thirdparty id + * @param int $origin_id Old third-party id + * @param int $dest_id New third-party id * @return bool */ public static function replaceThirdparty(DoliDB $db, $origin_id, $dest_id) @@ -4390,13 +4389,13 @@ class FactureLigne extends CommonInvoiceLine // From llx_product /** * @deprecated - * @see product_ref + * @see $product_ref */ public $ref; // Product ref (deprecated) public $product_ref; // Product ref /** * @deprecated - * @see product_label + * @see $product_label */ public $libelle; // Product label (deprecated) public $product_label; // Product label diff --git a/htdocs/core/boxes/modules_boxes.php b/htdocs/core/boxes/modules_boxes.php index 79d4f17d8ee..34070520aa5 100644 --- a/htdocs/core/boxes/modules_boxes.php +++ b/htdocs/core/boxes/modules_boxes.php @@ -397,7 +397,8 @@ class ModeleBoxes // Can't be abtract as it is instantiated to build "empty" box $orders = array(); $i = 0; - $dirwidget=array_merge(array('/core/boxes/')); + //$dirwidget=array_merge(array('/core/boxes/'), $conf->modules_parts['widgets']); + $dirwidget=array('/core/boxes/'); // $conf->modules_parts['widgets'] is not required if (is_array($forcedirwidget)) { $dirwidget=$forcedirwidget; diff --git a/htdocs/core/class/translate.class.php b/htdocs/core/class/translate.class.php index e0865a640e4..56ae3405a98 100644 --- a/htdocs/core/class/translate.class.php +++ b/htdocs/core/class/translate.class.php @@ -171,7 +171,7 @@ class Translate * @param int $forcelangdir To force a different lang directory * @param int $loadfromfileonly 1=Do not load overwritten translation from file or old conf. * @return int <0 if KO, 0 if already loaded or loading not required, >0 if OK - * @see loadLangs + * @see loadLangs() */ public function load($domain, $alt = 0, $stopafterdirection = 0, $forcelangdir = '', $loadfromfileonly = 0) { @@ -831,12 +831,12 @@ class Translate * same number (this module is not provided by default as it use non GPL source code). * * @param int $number Number to encode in full text - * @param int $isamount 1=It's an amount, 0=it's just a number + * @param string $isamount ''=it's just a number, '1'=It's an amount (default currency), 'currencycode'=It's an amount (foreign currency) * @return string Label translated in UTF8 (but without entities) * 10 if setDefaultLang was en_US => ten * 123 if setDefaultLang was fr_FR => cent vingt trois */ - public function getLabelFromNumber($number, $isamount = 0) + public function getLabelFromNumber($number, $isamount = '') { global $conf; @@ -877,7 +877,7 @@ class Translate * @param string $keyforselect Use another value than the translation key for the where into select * @param int $filteronentity Use a filter on entity * @return string Label in UTF8 (but without entities) - * @see dol_getIdFromCode + * @see dol_getIdFromCode() */ public function getLabelFromKey($db, $key, $tablename, $fieldkey, $fieldlabel, $keyforselect = '', $filteronentity = 0) { diff --git a/htdocs/core/lib/accounting.lib.php b/htdocs/core/lib/accounting.lib.php index 75677bd6cc8..0a1a69a758d 100644 --- a/htdocs/core/lib/accounting.lib.php +++ b/htdocs/core/lib/accounting.lib.php @@ -145,7 +145,7 @@ function length_accounta($accounta) * @param string $period Period of report * @param string $periodlink Link to switch period * @param string $description Description - * @param timestamp|integer $builddate Date generation + * @param integer $builddate Date of generation * @param string $exportlink Link for export or '' * @param array $moreparam Array with list of params to add into form * @param string $calcmode Calculation mode diff --git a/htdocs/core/lib/admin.lib.php b/htdocs/core/lib/admin.lib.php index 004762d2810..ddab337dd26 100644 --- a/htdocs/core/lib/admin.lib.php +++ b/htdocs/core/lib/admin.lib.php @@ -31,7 +31,7 @@ require_once DOL_DOCUMENT_ROOT . '/core/lib/functions2.lib.php'; * * @param array $versionarray Tableau de version (vermajeur,vermineur,autre) * @return string Chaine version - * @see versioncompare + * @see versioncompare() */ function versiontostring($versionarray) { @@ -55,7 +55,7 @@ function versiontostring($versionarray) * @return int -4,-3,-2,-1 if versionarray1versionarray2 (value depends on level of difference) - * @see versiontostring + * @see versiontostring() */ function versioncompare($versionarray1, $versionarray2) { @@ -432,7 +432,7 @@ function run_sql($sqlfile, $silent = 1, $entity = '', $usesavepoint = 1, $handle * @param int $entity Multi company id, -1 for all entities * @return int <0 if KO, >0 if OK * - * @see dolibarr_get_const, dolibarr_set_const, dol_set_user_param + * @see dolibarr_get_const(), dolibarr_set_const(), dol_set_user_param() */ function dolibarr_del_const($db, $name, $entity = 1) { @@ -472,7 +472,7 @@ function dolibarr_del_const($db, $name, $entity = 1) * @param int $entity Multi company id * @return string Valeur de la constante * - * @see dolibarr_del_const, dolibarr_set_const, dol_set_user_param + * @see dolibarr_del_const(), dolibarr_set_const(), dol_set_user_param() */ function dolibarr_get_const($db, $name, $entity = 1) { @@ -507,7 +507,7 @@ function dolibarr_get_const($db, $name, $entity = 1) * @param int $entity Multi company id (0 means all entities) * @return int -1 if KO, 1 if OK * - * @see dolibarr_del_const, dolibarr_get_const, dol_set_user_param + * @see dolibarr_del_const(), dolibarr_get_const(), dol_set_user_param() */ function dolibarr_set_const($db, $name, $value, $type = 'chaine', $visible = 0, $note = '', $entity = 1) { diff --git a/htdocs/core/lib/ajax.lib.php b/htdocs/core/lib/ajax.lib.php index 690eb8ec7b9..f1a06b46262 100644 --- a/htdocs/core/lib/ajax.lib.php +++ b/htdocs/core/lib/ajax.lib.php @@ -369,7 +369,7 @@ function ajax_dialog($title, $message, $w = 350, $h = 150) * @param int $forcefocus Force focus on field * @param string $widthTypeOfAutocomplete 'resolve' or 'off' * @return string Return html string to convert a select field into a combo, or '' if feature has been disabled for some reason. - * @see selectArrayAjax of html.form.class + * @see selectArrayAjax() of html.form.class */ function ajax_combobox($htmlname, $events = array(), $minLengthToAutocomplete = 0, $forcefocus = 0, $widthTypeOfAutocomplete = 'resolve') { diff --git a/htdocs/core/lib/date.lib.php b/htdocs/core/lib/date.lib.php index 96f4bba5c40..8b30f56c0d2 100644 --- a/htdocs/core/lib/date.lib.php +++ b/htdocs/core/lib/date.lib.php @@ -149,7 +149,7 @@ function dol_time_plus_duree($time, $duration_value, $duration_unit) * @param int $iMinutes Minutes * @param int $iSeconds Seconds * @return int Time into seconds - * @see convertSecondToTime + * @see convertSecondToTime() */ function convertTime2Seconds($iHours = 0, $iMinutes = 0, $iSeconds = 0) { @@ -177,7 +177,7 @@ function convertTime2Seconds($iHours = 0, $iMinutes = 0, $iSeconds = 0) * @param int $lengthOfWeek Length of week (default 7) * @return string Formated text of duration * Example: 0 return 00:00, 3600 return 1:00, 86400 return 1d, 90000 return 1 Day 01:00 - * @see convertTime2Seconds + * @see convertTime2Seconds() */ function convertSecondToTime($iSecond, $format = 'all', $lengthOfDay = 86400, $lengthOfWeek = 7) { @@ -325,7 +325,7 @@ function dolSqlDateFilter($datefield, $day_date, $month_date, $year_date) * @return int Date as a timestamp * 19700101020000 -> 7200 with gm=1 * - * @see dol_print_date, dol_mktime, dol_getdate + * @see dol_print_date(), dol_mktime(), dol_getdate() */ function dol_stringtotime($string, $gm = 1) { @@ -603,7 +603,7 @@ function dol_get_first_day_week($day, $month, $year, $gm = false) * @param string $countrycode Country code * @param int $lastday Last day is included, 0: no, 1:yes * @return int Nombre de jours feries - * @see num_between_day, num_open_day + * @see num_between_day(), num_open_day() */ function num_public_holiday($timestampStart, $timestampEnd, $countrycode = 'FR', $lastday = 0) { @@ -809,7 +809,7 @@ function num_public_holiday($timestampStart, $timestampEnd, $countrycode = 'FR', // Easter sunday // Monday after easter - $date_eastermonday = mktime( + $date_eastermonday = mktime( date("H", $date_paques), date("i", $date_paques), date("s", $date_paques), @@ -895,7 +895,7 @@ function num_public_holiday($timestampStart, $timestampEnd, $countrycode = 'FR', * @param int $timestampEnd Timestamp end UTC * @param int $lastday Last day is included, 0: no, 1:yes * @return int Number of days - * @see also num_public_holiday, num_open_day + * @seealso num_public_holiday(), num_open_day() */ function num_between_day($timestampStart, $timestampEnd, $lastday = 0) { @@ -925,7 +925,7 @@ function num_between_day($timestampStart, $timestampEnd, $lastday = 0) * @param int $halfday Tag to define half day when holiday start and end * @param string $country_code Country code (company country code if not defined) * @return int Number of days or hours - * @see also num_between_day, num_public_holiday + * @seealso num_between_day(), num_public_holiday() */ function num_open_day($timestampStart, $timestampEnd, $inhour = 0, $lastday = 0, $halfday = 0, $country_code = '') { diff --git a/htdocs/core/lib/doc.lib.php b/htdocs/core/lib/doc.lib.php index f0626dad74a..882a4007344 100644 --- a/htdocs/core/lib/doc.lib.php +++ b/htdocs/core/lib/doc.lib.php @@ -31,7 +31,7 @@ /** * Return line description translated in outputlangs and encoded into UTF8 * - * @param Line $line Current line number (0 = first line, 1 = second line, ...) + * @param Object $line Object of line * @param Translate $outputlangs Object langs for output * @param int $hideref Hide reference * @param int $hidedesc Hide description diff --git a/htdocs/core/lib/donation.lib.php b/htdocs/core/lib/donation.lib.php index 4672085acbd..91c41ffcced 100644 --- a/htdocs/core/lib/donation.lib.php +++ b/htdocs/core/lib/donation.lib.php @@ -43,7 +43,7 @@ function donation_admin_prepare_head() // $this->tabs = array('entity:+tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to add new tab // $this->tabs = array('entity:-tabname); to remove a tab complete_head_from_modules($conf, $langs, null, $head, $h, 'donation_admin'); - + $head[$h][0] = DOL_URL_ROOT . '/don/admin/donation_extrafields.php'; $head[$h][1] = $langs->trans("ExtraFields"); $head[$h][2] = 'attributes'; @@ -57,7 +57,7 @@ function donation_admin_prepare_head() /** * Prepare array with list of tabs * - * @param Donation $object Donation + * @param Don $object Donation * @return array Array of tabs to show */ function donation_prepare_head($object) @@ -97,7 +97,7 @@ function donation_prepare_head($object) if ($nbNote > 0) $head[$h][1].= ' '.$nbNote.''; $head[$h][2] = 'note'; $h++; - + $head[$h][0] = DOL_URL_ROOT . '/don/info.php?id=' . $object->id; $head[$h][1] = $langs->trans("Info"); $head[$h][2] = 'info'; diff --git a/htdocs/core/lib/files.lib.php b/htdocs/core/lib/files.lib.php index b67780da75a..ec7ca11ca69 100644 --- a/htdocs/core/lib/files.lib.php +++ b/htdocs/core/lib/files.lib.php @@ -55,7 +55,7 @@ function dol_basename($pathfile) * @param string $relativename For recursive purpose only. Must be "" at first call. * @param string $donotfollowsymlinks Do not follow symbolic links * @return array Array of array('name'=>'xxx','fullname'=>'/abc/xxx','date'=>'yyy','size'=>99,'type'=>'dir|file',...) - * @see dol_dir_list_indatabase + * @see dol_dir_list_in_database() */ function dol_dir_list($path, $types = "all", $recursive = 0, $filter = "", $excludefilter = null, $sortcriteria = "name", $sortorder = SORT_ASC, $mode = 0, $nohook = 0, $relativename = "", $donotfollowsymlinks = 0) { @@ -225,7 +225,7 @@ function dol_dir_list($path, $types = "all", $recursive = 0, $filter = "", $excl * @param string $sortorder Sort order (SORT_ASC, SORT_DESC) * @param int $mode 0=Return array minimum keys loaded (faster), 1=Force all keys like description * @return array Array of array('name'=>'xxx','fullname'=>'/abc/xxx','type'=>'dir|file',...) - * @see dol_dir_list + * @see dol_dir_list() */ function dol_dir_list_in_database($path, $filter = "", $excludefilter = null, $sortcriteria = "name", $sortorder = SORT_ASC, $mode = 0) { @@ -443,6 +443,18 @@ function dol_is_dir($folder) else return false; } +/** + * Return if path is empty + * + * @param string $dir Path of Directory + * @return boolean True or false + */ +function dol_is_dir_empty($dir) +{ + if (!is_readable($dir)) return false; + return (count(scandir($dir)) == 2); +} + /** * Return if path is a file * @@ -516,7 +528,7 @@ function dol_dir_is_emtpy($folder) * * @param string $file Filename * @return int <0 if KO, Number of lines in files if OK - * @see dol_nboflines + * @see dol_nboflines() */ function dol_count_nb_of_line($file) { @@ -577,7 +589,7 @@ function dol_filemtime($pathoffile) * @param int $newmask Mask for new file (0 by default means $conf->global->MAIN_UMASK). Example: '0666' * @param int $indexdatabase 1=index new file into database. * @return int <0 if error, 0 if nothing done (dest file already exists), >0 if OK - * @see dol_copy dolReplaceRegExInFile + * @see dol_copy() dolReplaceRegExInFile() */ function dolReplaceInFile($srcfile, $arrayreplacement, $destfile = '', $newmask = 0, $indexdatabase = 0) { @@ -647,7 +659,7 @@ function dolReplaceInFile($srcfile, $arrayreplacement, $destfile = '', $newmask * @param int $newmask Mask for new file (0 by default means $conf->global->MAIN_UMASK). Example: '0666' * @param int $indexdatabase Index new file into database. * @return int <0 if error, 0 if nothing done (dest file already exists), >0 if OK - * @see dol_copy dolReplaceInFile + * @see dol_copy() dolReplaceInFile() */ function dolReplaceRegExInFile($srcfile, $arrayreplacement, $destfile = '', $newmask = 0, $indexdatabase = 0) { @@ -662,7 +674,7 @@ function dolReplaceRegExInFile($srcfile, $arrayreplacement, $destfile = '', $new * @param int $newmask Mask for new file (0 by default means $conf->global->MAIN_UMASK). Example: '0666' * @param int $overwriteifexists Overwrite file if exists (1 by default) * @return int <0 if error, 0 if nothing done (dest file already exists and overwriteifexists=0), >0 if OK - * @see dol_delete_file + * @see dol_delete_file() dolCopyDir() */ function dol_copy($srcfile, $destfile, $newmask = 0, $overwriteifexists = 1) { @@ -718,7 +730,7 @@ function dol_copy($srcfile, $destfile, $newmask = 0, $overwriteifexists = 1) * @param int $overwriteifexists Overwrite file if exists (1 by default) * @param array $arrayreplacement Array to use to replace filenames with another one during the copy (works only on file names, not on directory names). * @return int <0 if error, 0 if nothing done (all files already exists and overwriteifexists=0), >0 if OK - * @see dol_copy + * @see dol_copy() */ function dolCopyDir($srcfile, $destfile, $newmask, $overwriteifexists, $arrayreplacement = null) { @@ -810,7 +822,7 @@ function dolCopyDir($srcfile, $destfile, $newmask, $overwriteifexists, $arrayrep * @param int $testvirus Do an antivirus test. Move is canceled if a virus is found. * @param int $indexdatabase Index new file into database. * @return boolean True if OK, false if KO - * @see dol_move_uploaded_file + * @see dol_move_uploaded_file() */ function dol_move($srcfile, $destfile, $newmask = 0, $overwriteifexists = 1, $testvirus = 0, $indexdatabase = 1) { @@ -992,7 +1004,7 @@ function dolCheckVirus($src_file) * @param int $nohook Disable all hooks * @param string $varfiles _FILES var name * @return int >0 if OK, <0 or string if KO - * @see dol_move + * @see dol_move() */ function dol_move_uploaded_file($src_file, $dest_file, $allowoverwrite, $disablevirusscan = 0, $uploaderrorcode = 0, $nohook = 0, $varfiles = 'addedfile') { @@ -1046,7 +1058,7 @@ function dol_move_uploaded_file($src_file, $dest_file, $allowoverwrite, $disable $checkvirusarray=dolCheckVirus($src_file); if (count($checkvirusarray)) { - dol_syslog('Files.lib::dol_move_uploaded_file File "'.$src_file.'" (target name "'.$dest_file.'") KO with antivirus: result='.$result.' errors='.join(',', $checkvirusarray), LOG_WARNING); + dol_syslog('Files.lib::dol_move_uploaded_file File "'.$src_file.'" (target name "'.$dest_file.'") KO with antivirus: errors='.join(',', $checkvirusarray), LOG_WARNING); return 'ErrorFileIsInfectedWithAVirus: '.join(',', $checkvirusarray); } } @@ -1135,7 +1147,7 @@ function dol_move_uploaded_file($src_file, $dest_file, $allowoverwrite, $disable * @param boolean $allowdotdot Allow to delete file path with .. inside. Never use this, it is reserved for migration purpose. * @param int $indexdatabase Try to remove also index entries. * @return boolean True if no error (file is deleted or if glob is used and there's nothing to delete), False if error - * @see dol_delete_dir + * @see dol_delete_dir() */ function dol_delete_file($file, $disableglob = 0, $nophperrors = 0, $nohook = 0, $object = null, $allowdotdot = false, $indexdatabase = 1) { @@ -1245,7 +1257,7 @@ function dol_delete_file($file, $disableglob = 0, $nophperrors = 0, $nohook = 0, * @param string $dir Directory to delete * @param int $nophperrors Disable all PHP output errors * @return boolean True if success, false if error - * @see dol_delete_file dol_copy + * @see dol_delete_file() dolCopyDir() */ function dol_delete_dir($dir, $nophperrors = 0) { @@ -1320,7 +1332,7 @@ function dol_delete_dir_recursive($dir, $count = 0, $nophperrors = 0, $onlysub = * * @param object $object Object to clean * @return int 0 if error, 1 if OK - * @see dol_convert_file + * @see dol_convert_file() */ function dol_delete_preview($object) { @@ -2105,7 +2117,7 @@ function dol_most_recent_file($dir, $regexfilter = '', $excludefilter = array('( * @param string $refname Ref of object to check permission for external users (autodetect if not provided) * @param string $mode Check permission for 'read' or 'write' * @return mixed Array with access information : 'accessallowed' & 'sqlprotectagainstexternals' & 'original_file' (as a full path name) - * @see restrictedArea + * @see restrictedArea() */ function dol_check_secure_access_document($modulepart, $original_file, $entity, $fuser = '', $refname = '', $mode = 'read') { @@ -2124,6 +2136,7 @@ function dol_check_secure_access_document($modulepart, $original_file, $entity, if ($modulepart == 'users') $modulepart='user'; dol_syslog('modulepart='.$modulepart.' original_file='.$original_file.' entity='.$entity); + // We define $accessallowed and $sqlprotectagainstexternals $accessallowed=0; $sqlprotectagainstexternals=''; @@ -2132,8 +2145,6 @@ function dol_check_secure_access_document($modulepart, $original_file, $entity, // Find the subdirectory name as the reference. For exemple original_file='10/myfile.pdf' -> refname='10' if (empty($refname)) $refname=basename(dirname($original_file)."/"); - $relative_original_file = $original_file; - // Define possible keys to use for permission check $lire='lire'; $read='read'; $download='download'; if ($mode == 'write') @@ -2654,7 +2665,7 @@ function dol_check_secure_access_document($modulepart, $original_file, $entity, } if (! empty($conf->productbatch->enabled)) $original_file=$conf->productbatch->multidir_output[$entity].'/'.$original_file; } - + // Wrapping for stock movements elseif ($modulepart == 'movement' || $modulepart == 'mouvement') { diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 36cdf2c7686..0a4014f1855 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -784,7 +784,7 @@ function dol_size($size, $type = '') * @param int $unaccent 1=Remove also accent (default), 0 do not remove them * @return string String cleaned (a-zA-Z_) * - * @see dol_string_nospecial, dol_string_unaccent, dol_sanitizePathName + * @see dol_string_nospecial(), dol_string_unaccent(), dol_sanitizePathName() */ function dol_sanitizeFileName($str, $newstr = '_', $unaccent = 1) { @@ -800,7 +800,7 @@ function dol_sanitizeFileName($str, $newstr = '_', $unaccent = 1) * @param int $unaccent 1=Remove also accent (default), 0 do not remove them * @return string String cleaned (a-zA-Z_) * - * @see dol_string_nospecial, dol_string_unaccent, dol_sanitizeFileName + * @see dol_string_nospecial(), dol_string_unaccent(), dol_sanitizeFileName() */ function dol_sanitizePathName($str, $newstr = '_', $unaccent = 1) { @@ -814,7 +814,7 @@ function dol_sanitizePathName($str, $newstr = '_', $unaccent = 1) * @param string $str String to clean * @return string Cleaned string * - * @see dol_sanitizeFilename, dol_string_nospecial + * @see dol_sanitizeFilename(), dol_string_nospecial() */ function dol_string_unaccent($str) { @@ -872,7 +872,7 @@ $string = strtr( * @param array $badcharstoreplace List of forbidden characters * @return string Cleaned string * - * @see dol_sanitizeFilename, dol_string_unaccent + * @see dol_sanitizeFilename(), dol_string_unaccent() */ function dol_string_nospecial($str, $newstr = '_', $badcharstoreplace = '') { @@ -925,7 +925,7 @@ function dol_escape_js($stringtoescape, $mode = 0, $noescapebackslashn = 0) * @param int $keepb 1=Preserve b tags (otherwise, remove them) * @param int $keepn 1=Preserve \r\n strings (otherwise, replace them with escaped value) * @return string Escaped string - * @see dol_string_nohtmltag, dol_string_nospecial, dol_string_unaccent + * @see dol_string_nohtmltag(), dol_string_nospecial(), dol_string_unaccent() */ function dol_escape_htmltag($stringtoescape, $keepb = 0, $keepn = 0) { @@ -1604,7 +1604,7 @@ function dol_bc($var, $moreclass = '') * @param Translate $outputlangs Object lang that contains language for text translation. * @param int $mode 0=Standard output, 1=Remove address * @return string Formated string - * @see dol_print_address + * @see dol_print_address() */ function dol_format_address($object, $withcountry = 0, $sep = "\n", $outputlangs = '', $mode = 0) { @@ -1707,7 +1707,7 @@ function dol_strftime($fmt, $ts = false, $is_gmt = false) * @param boolean $encodetooutput false=no convert into output pagecode * @return string Formated date or '' if time is null * - * @see dol_mktime, dol_stringtotime, dol_getdate + * @see dol_mktime(), dol_stringtotime(), dol_getdate() */ function dol_print_date($time, $format = '', $tzoutput = 'tzserver', $outputlangs = '', $encodetooutput = false) { @@ -1884,7 +1884,7 @@ function dol_print_date($time, $format = '', $tzoutput = 'tzserver', $outputlang * 'yday' => floor($secsInYear/$_day_power), * 'leap' => $leaf, * 'ndays' => $ndays - * @see dol_print_date, dol_stringtotime, dol_mktime + * @see dol_print_date(), dol_stringtotime(), dol_mktime() */ function dol_getdate($timestamp, $fast = false) { @@ -1923,7 +1923,7 @@ function dol_getdate($timestamp, $fast = false) * 'tz,TimeZone' = use specified timezone * @param int $check 0=No check on parameters (Can use day 32, etc...) * @return int|string Date as a timestamp, '' or false if error - * @see dol_print_date, dol_stringtotime, dol_getdate + * @see dol_print_date(), dol_stringtotime(), dol_getdate() */ function dol_mktime($hour, $minute, $second, $month, $day, $year, $gm = false, $check = 1) { @@ -2711,7 +2711,7 @@ function dol_user_country() * @param int $noprint No output. Result is the function return * @param string $charfornl Char to use instead of nl2br. '' means we use a standad nl2br. * @return string|void Nothing if noprint is 0, formatted address if noprint is 1 - * @see dol_format_address + * @see dol_format_address() */ function dol_print_address($address, $htmlid, $mode, $id, $noprint = 0, $charfornl = '') { @@ -3614,30 +3614,6 @@ function img_mime($file, $titlealt = '', $morecss = '') } -/** - * Show phone logo. - * Use img_picto instead. - * - * @param string $titlealt Text on alt and title of image. Alt only if param notitle is set to 1. If text is "TextA:TextB", use Text A on alt and Text B on title. - * @param int $option Option - * @return string Return img tag - * @deprecated - * @see img_picto - */ -function img_phone($titlealt = 'default', $option = 0) -{ - dol_syslog(__FUNCTION__ . " is deprecated", LOG_WARNING); - - global $conf,$langs; - - if ($titlealt == 'default') $titlealt = $langs->trans('Call'); - - if ($option == 1) $img = 'call'; - else $img = 'call_out'; - - return img_picto($titlealt, $img); -} - /** * Show search logo * @@ -3713,7 +3689,7 @@ function info_admin($text, $infoonimgalt = 0, $nodiv = 0, $admin = '1', $morecss * @param mixed $error String or array of errors strings to show * @param array $errors Array of errors * @return void - * @see dol_htmloutput_errors + * @see dol_htmloutput_errors() */ function dol_print_error($db = '', $error = '', $errors = null) { @@ -4009,7 +3985,7 @@ function getTitleFieldOfList($name, $thead = 0, $file = "", $field = "", $begin * @param string $title Title to show * @return string Title to show * @deprecated Use load_fiche_titre instead - * @see load_fiche_titre + * @see load_fiche_titre() */ function print_titre($title) { @@ -4045,7 +4021,7 @@ function print_fiche_titre($title, $mesg = '', $picto = 'title_generic.png', $pi * @param string $morecssontable More css on table * @param string $morehtmlcenter Added message to show on center * @return string - * @see print_barre_liste + * @see print_barre_liste() */ function load_fiche_titre($titre, $morehtmlright = '', $picto = 'title_generic.png', $pictoisfullpath = 0, $id = '', $morecssontable = '', $morehtmlcenter = '') { @@ -4431,7 +4407,7 @@ function price($amount, $form = 0, $outlangs = '', $trunc = 1, $rounding = -1, $ * @param int $alreadysqlnb Put 1 if you know that content is already universal format number * @return string Amount with universal numeric format (Example: '99.99999') or unchanged text if conversion fails. If amount is null or '', it returns ''. * - * @see price Opposite function of price2num + * @see price() Opposite function of price2num */ function price2num($amount, $rounding = '', $alreadysqlnb = 0) { @@ -4572,7 +4548,7 @@ function showDimensionInBestUnit($dimension, $unit, $type, $outputlangs, $round * @param Societe $thirdparty_seller Object of selling third party ($mysoc if not defined) * @param int $vatnpr If vat rate is NPR or not * @return mixed 0 if not found, localtax rate if found - * @see get_default_tva + * @see get_default_tva() */ function get_localtax($vatrate, $local, $thirdparty_buyer = "", $thirdparty_seller = "", $vatnpr = 0) { @@ -4762,7 +4738,7 @@ function get_localtax_by_third($local) * @param Societe $seller Company object * @param int $firstparamisid 1 if first param is id into table (use this if you can) * @return array array('rowid'=> , 'code'=> ...) - * @see getLocalTaxesFromRate + * @see getLocalTaxesFromRate() */ function getTaxesFromId($vatrate, $buyer = null, $seller = null, $firstparamisid = 1) { @@ -4818,7 +4794,7 @@ function getTaxesFromId($vatrate, $buyer = null, $seller = null, $firstparamisid * @param Societe $seller Company object * @param int $firstparamisid 1 if first param is ID into table instead of Rate+code (use this if you can) * @return array array(localtax_type1(1-6/0 if not found), rate localtax1, localtax_type2, rate localtax2, accountancycodecust, accountancycodesupp) - * @see getTaxesFromId + * @see getTaxesFromId() */ function getLocalTaxesFromRate($vatrate, $local, $buyer, $seller, $firstparamisid = 0) { @@ -4876,7 +4852,7 @@ function getLocalTaxesFromRate($vatrate, $local, $buyer, $seller, $firstparamisi * @param Societe $thirdparty_seller Thirdparty with a ->country_code defined (FR, US, IT, ...) * @param int $idprodfournprice Id product_fournisseur_price (for "supplier" proposal/order/invoice) * @return float|string Vat rate to use with format 5.0 or '5.0 (XXX)' - * @see get_product_localtax_for_country + * @see get_product_localtax_for_country() */ function get_product_vat_for_country($idprod, $thirdparty_seller, $idprodfournprice = 0) { @@ -4953,7 +4929,7 @@ function get_product_vat_for_country($idprod, $thirdparty_seller, $idprodfournpr * @param int $local 1 for localtax1, 2 for localtax 2 * @param Societe $thirdparty_seller Thirdparty with a ->country_code defined (FR, US, IT, ...) * @return int <0 if KO, Vat rate if OK - * @see get_product_vat_for_country + * @see get_product_vat_for_country() */ function get_product_localtax_for_country($idprod, $local, $thirdparty_seller) { @@ -5026,7 +5002,7 @@ function get_product_localtax_for_country($idprod, $local, $thirdparty_seller) * @param int $idprod Id product * @param int $idprodfournprice Id product_fournisseur_price (for supplier order/invoice) * @return float|string Vat rate to use with format 5.0 or '5.0 (XXX)', -1 if we can't guess it - * @see get_default_npr, get_default_localtax + * @see get_default_npr(), get_default_localtax() */ function get_default_tva(Societe $thirdparty_seller, Societe $thirdparty_buyer, $idprod = 0, $idprodfournprice = 0) { @@ -5113,7 +5089,7 @@ function get_default_tva(Societe $thirdparty_seller, Societe $thirdparty_buyer, * @param int $idprod Id product * @param int $idprodfournprice Id supplier price for product * @return float 0 or 1 - * @see get_default_tva, get_default_localtax + * @see get_default_tva(), get_default_localtax() */ function get_default_npr(Societe $thirdparty_seller, Societe $thirdparty_buyer, $idprod = 0, $idprodfournprice = 0) { @@ -5150,7 +5126,7 @@ function get_default_npr(Societe $thirdparty_seller, Societe $thirdparty_buyer, * @param int $local Localtax to process (1 or 2) * @param int $idprod Id product * @return integer localtax, -1 si ne peut etre determine - * @see get_default_tva, get_default_npr + * @see get_default_tva(), get_default_npr() */ function get_default_localtax($thirdparty_seller, $thirdparty_buyer, $local, $idprod = 0) { @@ -5371,7 +5347,7 @@ function picto_required() * @param integer $strip_tags 0=Use internal strip, 1=Use strip_tags() php function (bugged when text contains a < char that is not for a html tag) * @return string String cleaned * - * @see dol_escape_htmltag strip_tags dol_string_onlythesehtmltags dol_string_neverthesehtmltags + * @see dol_escape_htmltag() strip_tags() dol_string_onlythesehtmltags() dol_string_neverthesehtmltags() */ function dol_string_nohtmltag($stringtoclean, $removelinefeed = 1, $pagecodeto = 'UTF-8', $strip_tags = 0) { @@ -5409,7 +5385,7 @@ function dol_string_nohtmltag($stringtoclean, $removelinefeed = 1, $pagecodeto = * @param string $stringtoclean String to clean * @return string String cleaned * - * @see dol_escape_htmltag strip_tags dol_string_nohtmltag dol_string_neverthesehtmltags + * @see dol_escape_htmltag() strip_tags() dol_string_nohtmltag() dol_string_neverthesehtmltags() */ function dol_string_onlythesehtmltags($stringtoclean) { @@ -5435,7 +5411,7 @@ function dol_string_onlythesehtmltags($stringtoclean) * @param array $disallowed_tags Array of tags not allowed * @return string String cleaned * - * @see dol_escape_htmltag strip_tags dol_string_nohtmltag dol_string_onlythesehtmltags + * @see dol_escape_htmltag() strip_tags() dol_string_nohtmltag() dol_string_onlythesehtmltags() */ function dol_string_neverthesehtmltags($stringtoclean, $disallowed_tags = array('textarea')) { @@ -5454,10 +5430,11 @@ function dol_string_neverthesehtmltags($stringtoclean, $disallowed_tags = array( * * @param string $text Input text * @param int $nboflines Nb of lines to get (default is 1 = first line only) + * @param string $charset Charset of $text string (UTF-8 by default) * @return string Output text - * @see dol_nboflines_bis, dol_string_nohtmltag, dol_escape_htmltag + * @see dol_nboflines_bis(), dol_string_nohtmltag(), dol_escape_htmltag() */ -function dolGetFirstLineOfText($text, $nboflines = 1) +function dolGetFirstLineOfText($text, $nboflines = 1, $charset = 'UTF-8') { if ($nboflines == 1) { @@ -5513,7 +5490,7 @@ function dolGetFirstLineOfText($text, $nboflines = 1) * @param int $nl2brmode 0=Adding br before \n, 1=Replacing \n by br * @param bool $forxml false=Use
, true=Use
* @return string String encoded - * @see dol_nboflines, dolGetFirstLineOfText + * @see dol_nboflines(), dolGetFirstLineOfText() */ function dol_nl2br($stringtoencode, $nl2brmode = 0, $forxml = false) { @@ -5650,7 +5627,7 @@ function dol_string_is_good_iso($s) * @param string $s String to check * @param int $maxchar Not yet used * @return int Number of lines - * @see dol_nboflines_bis, dolGetFirstLineOfText + * @see dol_nboflines_bis(), dolGetFirstLineOfText() */ function dol_nboflines($s, $maxchar = 0) { @@ -5669,7 +5646,7 @@ function dol_nboflines($s, $maxchar = 0) * @param int $maxlinesize Largeur de ligne en caracteres (ou 0 si pas de limite - defaut) * @param string $charset Give the charset used to encode the $text variable in memory. * @return int Number of lines - * @see dol_nboflines, dolGetFirstLineOfText + * @see dol_nboflines(), dolGetFirstLineOfText() */ function dol_nboflines_bis($text, $maxlinesize = 0, $charset = 'UTF-8') { @@ -5724,7 +5701,7 @@ function dol_microtime_float() * @param string $msg Content to check * @param int $option 0=Full detection, 1=Fast check * @return boolean true/false - * @see dol_concatdesc + * @see dol_concatdesc() */ function dol_textishtml($msg, $option = 0) { @@ -5766,22 +5743,22 @@ function dol_textishtml($msg, $option = 0) * @param bool $forxml false=Use
instead of \n if html content detected, true=Use
instead of \n if html content detected * @param bool $invert invert order of description lines if CONF CHANGE_ORDER_CONCAT_DESCRIPTION is active * @return string Text 1 + new line + Text2 - * @see dol_textishtml + * @see dol_textishtml() */ function dol_concatdesc($text1, $text2, $forxml = false, $invert = false) { - if (!empty($invert)) - { - $tmp = $text1; - $text1 = $text2; - $text2 = $tmp; - } + if (!empty($invert)) + { + $tmp = $text1; + $text1 = $text2; + $text2 = $tmp; + } - $ret=''; - $ret.= (! dol_textishtml($text1) && dol_textishtml($text2))?dol_nl2br($text1, 0, $forxml):$text1; - $ret.= (! empty($text1) && ! empty($text2)) ? ((dol_textishtml($text1) || dol_textishtml($text2))?($forxml?"
\n":"
\n") : "\n") : ""; - $ret.= (dol_textishtml($text1) && ! dol_textishtml($text2))?dol_nl2br($text2, 0, $forxml):$text2; - return $ret; + $ret=''; + $ret.= (! dol_textishtml($text1) && dol_textishtml($text2))?dol_nl2br($text1, 0, $forxml):$text1; + $ret.= (! empty($text1) && ! empty($text2)) ? ((dol_textishtml($text1) || dol_textishtml($text2))?($forxml?"
\n":"
\n") : "\n") : ""; + $ret.= (dol_textishtml($text1) && ! dol_textishtml($text2))?dol_nl2br($text2, 0, $forxml):$text2; + return $ret; } @@ -5794,7 +5771,7 @@ function dol_concatdesc($text1, $text2, $forxml = false, $invert = false) * @param array $exclude Array of family keys we want to exclude. For example array('system', 'mycompany', 'object', 'objectamount', 'date', 'user', ...) * @param Object $object Object for keys on object * @return array Array of substitutions - * @see setSubstitFromObject + * @see setSubstitFromObject() */ function getCommonSubstitutionArray($outputlangs, $onlykey = 0, $exclude = null, $object = null) { @@ -6087,7 +6064,7 @@ $substitutionarray=array_merge($substitutionarray, array( $tmp4=dol_get_next_day($tmp['mday'], $tmp['mon'], $tmp['year']); $tmp5=dol_get_next_month($tmp['mon'], $tmp['year']); -$substitutionarray=array_merge($substitutionarray, array( + $substitutionarray=array_merge($substitutionarray, array( '__DAY__' => (string) $tmp['mday'], '__DAY_TEXT__' => $outputlangs->trans('Day'.$tmp['wday']), // Monday '__DAY_TEXT_SHORT__' => $outputlangs->trans($tmp['weekday'].'Min'), // Mon @@ -6132,7 +6109,7 @@ $substitutionarray=array_merge($substitutionarray, array( * @param array $substitutionarray Array with key->val to substitute. Example: array('__MYKEY__' => 'MyVal', ...) * @param Translate $outputlangs Output language * @return string Output string after substitutions - * @see complete_substitutions_array, getCommonSubstitutionArray + * @see complete_substitutions_array(), getCommonSubstitutionArray() */ function make_substitutions($text, $substitutionarray, $outputlangs = null) { @@ -6195,7 +6172,7 @@ function make_substitutions($text, $substitutionarray, $outputlangs = null) * @param mixed $parameters Add more parameters (useful to pass product lines) * @param string $callfunc What is the name of the custom function that will be called? (default: completesubstitutionarray) * @return void - * @see make_substitutions + * @see make_substitutions() */ function complete_substitutions_array(&$substitutionarray, $outputlangs, $object = null, $parameters = null, $callfunc = "completesubstitutionarray") { @@ -6339,7 +6316,7 @@ function dolGetFirstLastname($firstname, $lastname, $nameorder = -1) * @param mixed $mesgs Message string or array * @param string $style Which style to use ('mesgs' by default, 'warnings', 'errors') * @return void - * @see dol_htmloutput_events + * @see dol_htmloutput_events() */ function setEventMessage($mesgs, $style = 'mesgs') { @@ -6365,7 +6342,7 @@ function setEventMessage($mesgs, $style = 'mesgs') * @param array $mesgs Message array * @param string $style Which style to use ('mesgs' by default, 'warnings', 'errors') * @return void - * @see dol_htmloutput_events + * @see dol_htmloutput_events() */ function setEventMessages($mesg, $mesgs, $style = 'mesgs') { @@ -6392,7 +6369,7 @@ function setEventMessages($mesg, $mesgs, $style = 'mesgs') * * @param int $disabledoutputofmessages Clear all messages stored into session without diplaying them * @return void - * @see dol_htmloutput_mesg + * @see dol_htmloutput_mesg() */ function dol_htmloutput_events($disabledoutputofmessages = 0) { @@ -6425,9 +6402,9 @@ function dol_htmloutput_events($disabledoutputofmessages = 0) * @param int $keepembedded Set to 1 in error message must be kept embedded into its html place (this disable jnotify) * @return string Return html output * - * @see dol_print_error - * @see dol_htmloutput_errors - * @see setEventMessages + * @see dol_print_error() + * @see dol_htmloutput_errors() + * @see setEventMessages() */ function get_htmloutput_mesg($mesgstring = '', $mesgarray = '', $style = 'ok', $keepembedded = 0) { @@ -6502,8 +6479,8 @@ function get_htmloutput_mesg($mesgstring = '', $mesgarray = '', $style = 'ok', $ * @param int $keepembedded Set to 1 in error message must be kept embedded into its html place (this disable jnotify) * @return string Return html output * - * @see dol_print_error - * @see dol_htmloutput_mesg + * @see dol_print_error() + * @see dol_htmloutput_mesg() */ function get_htmloutput_errors($mesgstring = '', $mesgarray = array(), $keepembedded = 0) { @@ -6519,9 +6496,9 @@ function get_htmloutput_errors($mesgstring = '', $mesgarray = array(), $keepembe * @param int $keepembedded Set to 1 if message must be kept embedded into its html place (this disable jnotify) * @return void * - * @see dol_print_error - * @see dol_htmloutput_errors - * @see setEventMessages + * @see dol_print_error() + * @see dol_htmloutput_errors() + * @see setEventMessages() */ function dol_htmloutput_mesg($mesgstring = '', $mesgarray = array(), $style = 'ok', $keepembedded = 0) { @@ -6574,8 +6551,8 @@ function dol_htmloutput_mesg($mesgstring = '', $mesgarray = array(), $style = 'o * @param int $keepembedded Set to 1 in error message must be kept embedded into its html place (this disable jnotify) * @return void * - * @see dol_print_error - * @see dol_htmloutput_mesg + * @see dol_print_error() + * @see dol_htmloutput_mesg() */ function dol_htmloutput_errors($mesgstring = '', $mesgarray = array(), $keepembedded = 0) { @@ -7692,7 +7669,7 @@ function ajax_autoselect($htmlname, $addlink = '') * @param string $default Default mime type if extension not found in known list * @param int $mode 0=Return full mime, 1=otherwise short mime string, 2=image for mime type, 3=source language, 4=css of font fa * @return string Return a mime type family (text/xxx, application/xxx, image/xxx, audio, video, archive) - * @see image_format_supported (images.lib.php) + * @see image_format_supported() from images.lib.php */ function dol_mimetype($file, $default = 'application/octet-stream', $mode = 0) { diff --git a/htdocs/core/lib/functions2.lib.php b/htdocs/core/lib/functions2.lib.php index d30d0c9ed82..06e551d2ad6 100644 --- a/htdocs/core/lib/functions2.lib.php +++ b/htdocs/core/lib/functions2.lib.php @@ -1453,7 +1453,7 @@ function weight_convert($weight, &$from_unit, $to_unit) * @param array $tab Array (key=>value) with all parameters to save * @return int <0 if KO, >0 if OK * - * @see dolibarr_get_const, dolibarr_set_const, dolibarr_del_const + * @see dolibarr_get_const(), dolibarr_set_const(), dolibarr_del_const() */ function dol_set_user_param($db, $conf, &$user, $tab) { @@ -1553,7 +1553,7 @@ function version_os() * Return PHP version * * @return string PHP version - * @see versionphparray + * @see versionphparray() */ function version_php() { @@ -1564,7 +1564,7 @@ function version_php() * Return Dolibarr version * * @return string Dolibarr version - * @see versiondolibarrarray + * @see versiondolibarrarray() */ function version_dolibarr() { @@ -2137,7 +2137,7 @@ function getElementProperties($element_type) * * @param int $element_id Element id * @param string $element_type Element type - * @param ref $element_ref Element ref (Use this if element_id but not both) + * @param string $element_ref Element ref (Use this or element_id but not both) * @return int|object object || 0 || -1 if error */ function fetchObjectByElement($element_id, $element_type, $element_ref = '') @@ -2167,7 +2167,7 @@ function fetchObjectByElement($element_id, $element_type, $element_ref = '') * @param array $arraycolor Array * @param string $colorifnotfound Color code to return if entry not defined or not a RGB format * @return string RGB hex value (without # before). For example: 'FF00FF', '01FF02' - * @see colorStringToArray + * @see colorStringToArray() */ function colorArrayToHex($arraycolor, $colorifnotfound = '888888') { @@ -2184,11 +2184,12 @@ function colorArrayToHex($arraycolor, $colorifnotfound = '888888') * @param string $stringcolor String with hex (FFFFFF) or comma RGB ('255,255,255') * @param array $colorifnotfound Color code array to return if entry not defined * @return string RGB hex value (without # before). For example: FF00FF - * @see colorArrayToHex + * @see colorArrayToHex() */ function colorStringToArray($stringcolor, $colorifnotfound = array(88,88,88)) { if (is_array($stringcolor)) return $stringcolor; // If already into correct output format, we return as is + $reg=array(); $tmp=preg_match('/^#?([0-9a-fA-F][0-9a-fA-F])([0-9a-fA-F][0-9a-fA-F])([0-9a-fA-F][0-9a-fA-F])$/', $stringcolor, $reg); if (! $tmp) { diff --git a/htdocs/core/lib/functionsnumtoword.lib.php b/htdocs/core/lib/functionsnumtoword.lib.php index 6481604ff64..a20f1dcb99e 100644 --- a/htdocs/core/lib/functionsnumtoword.lib.php +++ b/htdocs/core/lib/functionsnumtoword.lib.php @@ -139,10 +139,10 @@ function dol_convertToWord($num, $langs, $currency = false, $centimes = false) * Function to return number or amount in text. * * @deprecated - * @param float $numero Number to convert - * @param Lang $langs Language - * @param string $numorcurrency 'number' or 'amount' - * @return string Text of the number or -1 in case TOO LONG (more than 1000000000000.99) + * @param float $numero Number to convert + * @param Translate $langs Language + * @param string $numorcurrency 'number' or 'amount' + * @return string Text of the number or -1 in case TOO LONG (more than 1000000000000.99) */ function dolNumberToWord($numero, $langs, $numorcurrency = 'number') { diff --git a/htdocs/core/lib/invoice2.lib.php b/htdocs/core/lib/invoice2.lib.php index 0263d1763ec..21aa57b5433 100644 --- a/htdocs/core/lib/invoice2.lib.php +++ b/htdocs/core/lib/invoice2.lib.php @@ -36,10 +36,10 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/pdf.lib.php'; * @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 $datebeforedate Invoice before date - * @param date $paymentdateafter Payment after date (must includes hour) - * @param date $paymentdatebefore Payment before date (must includes hour) + * @param integer $dateafterdate Invoice after date + * @param integer $datebeforedate Invoice before date + * @param integer $paymentdateafter Payment after date (must includes hour) + * @param integer $paymentdatebefore Payment before date (must includes hour) * @param int $usestdout Add information onto standard output * @param int $regenerate ''=Use existing PDF files, 'nameofpdf'=Regenerate all PDF files using the template * @param string $filesuffix Suffix to add into file name of generated PDF diff --git a/htdocs/core/lib/modulebuilder.lib.php b/htdocs/core/lib/modulebuilder.lib.php index b275025084a..c38448b452a 100644 --- a/htdocs/core/lib/modulebuilder.lib.php +++ b/htdocs/core/lib/modulebuilder.lib.php @@ -35,7 +35,7 @@ * @param string $addfieldentry Array of the field entry to add array('key'=>,'type'=>,''label'=>,'visible'=>,'enabled'=>,'position'=>,'notnull'=>','index'=>,'searchall'=>,'comment'=>,'help'=>,'isameasure') * @param string $delfieldentry Id of field to remove * @return int|object <=0 if KO, Object if OK - * @see rebuildObjectSql + * @see rebuildObjectSql() */ function rebuildObjectClass($destdir, $module, $objectname, $newmask, $readdir = '', $addfieldentry = array(), $delfieldentry = '') { @@ -208,7 +208,7 @@ function rebuildObjectClass($destdir, $module, $objectname, $newmask, $readdir = * @param string $readdir Directory source (use $destdir when not defined) * @param Object $object If object was already loaded/known, it is pass to avaoid another include and new. * @return int <=0 if KO, >0 if OK - * @see rebuildObjectClass + * @see rebuildObjectClass() */ function rebuildObjectSql($destdir, $module, $objectname, $newmask, $readdir = '', $object = null) { diff --git a/htdocs/core/lib/pdf.lib.php b/htdocs/core/lib/pdf.lib.php index a84edde3de9..7657031a249 100644 --- a/htdocs/core/lib/pdf.lib.php +++ b/htdocs/core/lib/pdf.lib.php @@ -264,7 +264,7 @@ function pdf_getHeightForLogo($logo, $url = false) * @param TCPDF $pdf PDF initialized object * @param string $htmlcontent HTML Contect * @return int Height - * @see getStringHeight + * @see getStringHeight() */ function pdfGetHeightForHtmlContent(&$pdf, $htmlcontent) { diff --git a/htdocs/core/lib/report.lib.php b/htdocs/core/lib/report.lib.php index 6939d558a8d..907524d5a97 100644 --- a/htdocs/core/lib/report.lib.php +++ b/htdocs/core/lib/report.lib.php @@ -31,7 +31,7 @@ * @param string $period Period of report * @param string $periodlink Link to switch period * @param string $description Description - * @param timestamp|integer $builddate Date generation + * @param integer $builddate Date generation * @param string $exportlink Link for export or '' * @param array $moreparam Array with list of params to add into form * @param string $calcmode Calculation mode @@ -42,12 +42,12 @@ function report_header($reportname, $notused, $period, $periodlink, $description { global $langs; - if (empty($hselected)) $hselected='report'; - print "\n\n\n"; if(! empty($varlink)) $varlink = '?'.$varlink; + $head = array(); + $h=0; $head[$h][0] = $_SERVER["PHP_SELF"].$varlink; $head[$h][1] = $langs->trans("Report"); diff --git a/htdocs/core/lib/security.lib.php b/htdocs/core/lib/security.lib.php index 0c8a8b6a91e..da14436f749 100644 --- a/htdocs/core/lib/security.lib.php +++ b/htdocs/core/lib/security.lib.php @@ -32,7 +32,7 @@ * @param string $chain string to encode * @param string $key rule to use for delta ('0', '1' or 'myownkey') * @return string encoded string - * @see dol_decode + * @see dol_decode() */ function dol_encode($chain, $key = '1') { @@ -68,7 +68,7 @@ function dol_encode($chain, $key = '1') * @param string $chain string to decode * @param string $key rule to use for delta ('0', '1' or 'myownkey') * @return string decoded string - * @see dol_encode + * @see dol_encode() */ function dol_decode($chain, $key = '1') { @@ -176,7 +176,7 @@ function dol_verifyHash($chain, $hash, $type = '0') * @param string $dbt_select Field name for select if not rowid. Not used if objectid is null (optional) * @param int $isdraft 1=The object with id=$objectid is a draft * @return int Always 1, die process if not allowed - * @see dol_check_secure_access_document + * @see dol_check_secure_access_document() */ function restrictedArea($user, $features, $objectid = 0, $tableandshare = '', $feature2 = '', $dbt_keyfield = 'fk_soc', $dbt_select = 'rowid', $isdraft = 0) { @@ -431,7 +431,7 @@ function restrictedArea($user, $features, $objectid = 0, $tableandshare = '', $f * @param string $dbt_keyfield Field name for socid foreign key if not fk_soc. Not used if objectid is null (optional) * @param string $dbt_select Field name for select if not rowid. Not used if objectid is null (optional) * @return bool True if user has access, False otherwise - * @see restrictedArea + * @see restrictedArea() */ function checkUserAccessToObject($user, $featuresarray, $objectid = 0, $tableandshare = '', $feature2 = '', $dbt_keyfield = '', $dbt_select = 'rowid') { diff --git a/htdocs/core/lib/security2.lib.php b/htdocs/core/lib/security2.lib.php index 27a025d23f1..f98985d0f74 100644 --- a/htdocs/core/lib/security2.lib.php +++ b/htdocs/core/lib/security2.lib.php @@ -446,7 +446,7 @@ function encodedecode_dbpassconf($level = 0) * @param boolean $generic true=Create generic password (32 chars/numbers), false=Use the configured password generation module * @param array $replaceambiguouschars Discard ambigous characters. For example array('I'). * @return string New value for password - * @see dol_hash + * @see dol_hash() */ function getRandomPassword($generic = false, $replaceambiguouschars = null) { diff --git a/htdocs/core/lib/usergroups.lib.php b/htdocs/core/lib/usergroups.lib.php index 22a3aea6d6c..de85a573cab 100644 --- a/htdocs/core/lib/usergroups.lib.php +++ b/htdocs/core/lib/usergroups.lib.php @@ -194,8 +194,8 @@ function user_prepare_head($object) /** * Prepare array with list of tabs * - * @param Group $object Object group - * @return array Array of tabs + * @param UserGroup $object Object group + * @return array Array of tabs */ function group_prepare_head($object) { diff --git a/htdocs/core/lib/website.lib.php b/htdocs/core/lib/website.lib.php index 972a271c140..5676a7aa39c 100644 --- a/htdocs/core/lib/website.lib.php +++ b/htdocs/core/lib/website.lib.php @@ -30,7 +30,7 @@ * @param string $content Content to replace * @param int $removephppart 0=Replace PHP sections with a PHP badge. 1=Remove completely PHP sections. * @return boolean True if OK - * @see dolWebsiteOutput for function used to replace content in a web server context + * @see dolWebsiteOutput() for function used to replace content in a web server context */ function dolWebsiteReplacementOfLinks($website, $content, $removephppart = 0) { @@ -139,7 +139,7 @@ function dolStripPhpCode($str, $replacewith = '') * * @param string $content Content string * @return void - * @see dolWebsiteReplacementOfLinks for function used to replace content in the backoffice context when USEDOLIBARREDITOR is not on + * @see dolWebsiteReplacementOfLinks() for function used to replace content in the backoffice context when USEDOLIBARREDITOR is not on */ function dolWebsiteOutput($content) { diff --git a/htdocs/core/modules/expensereport/doc/pdf_standard.modules.php b/htdocs/core/modules/expensereport/doc/pdf_standard.modules.php index 04b7ef1f2f7..7f70bd7897e 100644 --- a/htdocs/core/modules/expensereport/doc/pdf_standard.modules.php +++ b/htdocs/core/modules/expensereport/doc/pdf_standard.modules.php @@ -34,6 +34,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/usergroups.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/bank.lib.php'; +require_once DOL_DOCUMENT_ROOT .'/compta/bank/class/account.class.php'; require_once DOL_DOCUMENT_ROOT.'/user/class/userbankaccount.class.php'; @@ -630,7 +631,7 @@ class pdf_standard extends ModeleExpenseReport private function _pagehead(&$pdf, $object, $showaddress, $outputlangs) { // global $conf, $langs, $hookmanager; - global $user, $receiver, $receiver_account, $langs, $conf, $mysoc, $db, $hookmanager; + global $user, $langs, $conf, $mysoc, $db, $hookmanager; // Load traductions files requiredby by page $outputlangs->loadLangs(array("main", "trips", "companies")); @@ -781,7 +782,7 @@ class pdf_standard extends ModeleExpenseReport // Informations for trip (dates and users workflow) if ($object->fk_user_author > 0) { $userfee=new User($this->db); - $userfee->fetch($object->fk_user_author); $posy+=6; + $userfee->fetch($object->fk_user_author); $posy+=3; $pdf->SetXY($posx+2, $posy); $pdf->SetFont('', '', 10); diff --git a/htdocs/cron/class/cronjob.class.php b/htdocs/cron/class/cronjob.class.php index 1f22e7b910c..c223f3c76ff 100644 --- a/htdocs/cron/class/cronjob.class.php +++ b/htdocs/cron/class/cronjob.class.php @@ -1207,7 +1207,7 @@ class Cronjob extends CommonObject * Reprogram a job * * @param string $userlogin User login - * @param timestamp $now Date returned by dol_now() + * @param integer $now Date returned by dol_now() * @return int <0 if KO, >0 if OK */ public function reprogram_jobs($userlogin, $now) diff --git a/htdocs/langs/en_US/modulebuilder.lang b/htdocs/langs/en_US/modulebuilder.lang index 765edad6687..a8af38d5240 100644 --- a/htdocs/langs/en_US/modulebuilder.lang +++ b/htdocs/langs/en_US/modulebuilder.lang @@ -2,7 +2,7 @@ ModuleBuilderDesc=This tool must be used by only by experienced users or developers. It gives you utilities to build or edit your own module.
Documentation for alternative manual development is here. EnterNameOfModuleDesc=Enter name of the module/application to create with no spaces. Use uppercase to separate words (For example: MyModule, EcommerceForShop, SyncWithMySystem...) EnterNameOfObjectDesc=Enter name of the object to create with no spaces. Use uppercase to separate words (For example: MyObject, Student, Teacher...). The CRUD class file, but also API file, pages to list/add/edit/delete object and SQL files will be generated. -ModuleBuilderDesc2=Path where modules are generated/edited (first alternative directory defined into %s): %s +ModuleBuilderDesc2=Path where modules are generated/edited (first directory for external modules defined into %s): %s ModuleBuilderDesc3=Generated/editable modules found: %s ModuleBuilderDesc4=A module is detected as 'editable' when the file %s exists in root of module directory NewModule=New module @@ -100,4 +100,8 @@ UseAboutPage=Disable the about page UseDocFolder=Disable the documentation folder UseSpecificReadme=Use a specific ReadMe RealPathOfModule=Real path of module -ContentCantBeEmpty=Content of file can't be empty \ No newline at end of file +ContentCantBeEmpty=Content of file can't be empty +WidgetDesc=You can generate and edit here the widgets that will be embedded with your module. +CLIDesc=You can generate here some command line scripts you want to provide with your module. +CLIFile=CLI File +NoCLIFile=No CLI files \ No newline at end of file diff --git a/htdocs/modulebuilder/index.php b/htdocs/modulebuilder/index.php index b74fb5e2a59..22c83222b8b 100644 --- a/htdocs/modulebuilder/index.php +++ b/htdocs/modulebuilder/index.php @@ -108,8 +108,8 @@ if ($dirins && $action == 'initmodule' && $modulename) $destdir = $dirins.'/'.strtolower($modulename); $arrayreplacement=array( - 'mymodule'=>strtolower($modulename), - 'MyModule'=>$modulename + 'mymodule'=>strtolower($modulename), + 'MyModule'=>$modulename ); $result = dolCopyDir($srcdir, $destdir, 0, 0, $arrayreplacement); @@ -128,31 +128,45 @@ if ($dirins && $action == 'initmodule' && $modulename) } } - if (!empty($conf->global->MODULEBUILDER_USE_ABOUT)) + if (! empty($conf->global->MODULEBUILDER_USE_ABOUT)) { dol_delete_file($destdir.'/admin/about.php'); } - if (!empty($conf->global->MODULEBUILDER_USE_DOCFOLDER)) - { - dol_delete_dir($destdir.'/doc/'); - } - // Delete some files related to object (because to previous dolCopyDir has copied everything) + // Delete dir and files that can be generated in sub tabs later if we need them (we want a minimal module first) + dol_delete_dir_recursive($destdir.'/build/doxygen'); + dol_delete_dir_recursive($destdir.'/core/modules/mailings'); + dol_delete_dir_recursive($destdir.'/core/tpl'); + dol_delete_dir_recursive($destdir.'/core/triggers'); + dol_delete_dir_recursive($destdir.'/doc'); + dol_delete_dir_recursive($destdir.'/.tx'); + dol_delete_dir_recursive($destdir.'/core/boxes'); + + dol_delete_file($destdir.'/sql/data.sql'); + dol_delete_file($destdir.'/sql/update_x.x.x-y.y.y.sql'); + dol_delete_dir($destdir.'/sql'); + + dol_delete_file($destdir.'/class/actions_'.strtolower($modulename).'.class.php'); + dol_delete_file($destdir.'/class/api_'.strtolower($modulename).'.class.php'); + dol_delete_dir($destdir.'/class'); + + dol_delete_file($destdir.'/scripts/'.strtolower($modulename).'.php'); + dol_delete_dir($destdir.'/scripts'); + + + // Delete some files related to Object (because the dolCopyDir has copied everything) dol_delete_file($destdir.'/myobject_card.php'); dol_delete_file($destdir.'/myobject_note.php'); dol_delete_file($destdir.'/myobject_document.php'); dol_delete_file($destdir.'/myobject_agenda.php'); dol_delete_file($destdir.'/myobject_list.php'); - dol_delete_file($destdir.'/lib/mymodule_myobject.lib.php'); + dol_delete_file($destdir.'/lib/'.strtolower($modulename).'_myobject.lib.php'); dol_delete_file($destdir.'/test/phpunit/MyObjectTest.php'); - dol_delete_file($destdir.'/sql/llx_mymodule_myobject.sql'); - dol_delete_file($destdir.'/sql/llx_mymodule_myobject_extrafields.sql'); - dol_delete_file($destdir.'/sql/llx_mymodule_myobject.key.sql'); - dol_delete_file($destdir.'/scripts/myobject.php'); + dol_delete_file($destdir.'/sql/llx'.strtolower($modulename).'_myobject.sql'); + dol_delete_file($destdir.'/sql/llx_'.strtolower($modulename).'_myobject_extrafields.sql'); + dol_delete_file($destdir.'/sql/llx_'.strtolower($modulename).'_myobject.key.sql'); dol_delete_file($destdir.'/img/object_myobject.png'); dol_delete_file($destdir.'/class/myobject.class.php'); - dol_delete_file($destdir.'/class/api_mymodule.class.php'); - dol_delete_file($destdir.'/doc/*example*'); } // Edit PHP files @@ -163,18 +177,17 @@ if ($dirins && $action == 'initmodule' && $modulename) { //var_dump($phpfileval['fullname']); $arrayreplacement=array( - 'mymodule'=>strtolower($modulename), - 'MyModule'=>$modulename, - 'MYMODULE'=>strtoupper($modulename), - 'My module'=>$modulename, - 'my module'=>$modulename, - 'Mon module'=>$modulename, - 'mon module'=>$modulename, - 'htdocs/modulebuilder/template'=>strtolower($modulename), - '---Put here your own copyright and developer email---'=>dol_print_date($now, '%Y').' '.$user->getFullName($langs).($user->email?' <'.$user->email.'>':'') + 'mymodule'=>strtolower($modulename), + 'MyModule'=>$modulename, + 'MYMODULE'=>strtoupper($modulename), + 'My module'=>$modulename, + 'my module'=>$modulename, + 'Mon module'=>$modulename, + 'mon module'=>$modulename, + 'htdocs/modulebuilder/template'=>strtolower($modulename), + '---Put here your own copyright and developer email---'=>dol_print_date($now, '%Y').' '.$user->getFullName($langs).($user->email?' <'.$user->email.'>':'') ); - $result=dolReplaceInFile($phpfileval['fullname'], $arrayreplacement); //var_dump($result); if ($result < 0) @@ -198,6 +211,132 @@ if ($dirins && $action == 'initmodule' && $modulename) } } +if ($dirins && $action == 'inithook' && !empty($module)) +{ + dol_mkdir($dirins.'/'.strtolower($module).'/class'); + $srcdir = DOL_DOCUMENT_ROOT.'/modulebuilder/template'; + $srcfile = $srcdir.'/class/actions_mymodule.class.php'; + $destfile = $dirins.'/'.strtolower($module).'/class/actions_'.strtolower($module).'.class.php'; + //var_dump($srcfile);var_dump($destfile); + $result = dol_copy($srcfile, $destfile, 0, 0); +} +if ($dirins && $action == 'inittrigger' && !empty($module)) +{ + dol_mkdir($dirins.'/'.strtolower($module).'/core/triggers'); + $srcdir = DOL_DOCUMENT_ROOT.'/modulebuilder/template'; + $srcfile = $srcdir.'/core/triggers/interface_99_modMyModule_MyModuleTriggers.class.php'; + $destfile = $dirins.'/'.strtolower($module).'/core/triggers/interface_99_mod'.$module.'_'.$module.'Triggers.class.php'; + //var_dump($srcfile);var_dump($destfile); + $result = dol_copy($srcfile, $destfile, 0, 0); + + if ($result > 0) + { + $modulename = ucfirst($module); // Force first letter in uppercase + + //var_dump($phpfileval['fullname']); + $arrayreplacement=array( + 'mymodule'=>strtolower($modulename), + 'MyModule'=>$modulename, + 'MYMODULE'=>strtoupper($modulename), + 'My module'=>$modulename, + 'my module'=>$modulename, + 'Mon module'=>$modulename, + 'mon module'=>$modulename, + 'htdocs/modulebuilder/template'=>strtolower($modulename), + '---Put here your own copyright and developer email---'=>dol_print_date($now, '%Y').' '.$user->getFullName($langs).($user->email?' <'.$user->email.'>':'') + ); + + dolReplaceInFile($destfile, $arrayreplacement); + } +} +if ($dirins && $action == 'initwidget' && !empty($module)) +{ + dol_mkdir($dirins.'/'.strtolower($module).'/core/boxes'); + $srcdir = DOL_DOCUMENT_ROOT.'/modulebuilder/template'; + $srcfile = $srcdir.'/core/boxes/mymodulewidget1.php'; + $destfile = $dirins.'/'.strtolower($module).'/core/boxes/'.strtolower($module).'widget1.php'; + //var_dump($srcfile);var_dump($destfile); + $result = dol_copy($srcfile, $destfile, 0, 0); + + if ($result > 0) + { + $modulename = ucfirst($module); // Force first letter in uppercase + + //var_dump($phpfileval['fullname']); + $arrayreplacement=array( + 'mymodule'=>strtolower($modulename), + 'MyModule'=>$modulename, + 'MYMODULE'=>strtoupper($modulename), + 'My module'=>$modulename, + 'my module'=>$modulename, + 'Mon module'=>$modulename, + 'mon module'=>$modulename, + 'htdocs/modulebuilder/template'=>strtolower($modulename), + '---Put here your own copyright and developer email---'=>dol_print_date($now, '%Y').' '.$user->getFullName($langs).($user->email?' <'.$user->email.'>':'') + ); + + dolReplaceInFile($destfile, $arrayreplacement); + } +} +if ($dirins && $action == 'initcli' && !empty($module)) +{ + dol_mkdir($dirins.'/'.strtolower($module).'/scripts'); + $srcdir = DOL_DOCUMENT_ROOT.'/modulebuilder/template'; + $srcfile = $srcdir.'/scripts/mymodule.php'; + $destfile = $dirins.'/'.strtolower($module).'/scripts/'.strtolower($module).'.php'; + //var_dump($srcfile);var_dump($destfile); + $result = dol_copy($srcfile, $destfile, 0, 0); + + if ($result > 0) + { + $modulename = ucfirst($module); // Force first letter in uppercase + + //var_dump($phpfileval['fullname']); + $arrayreplacement=array( + 'mymodule'=>strtolower($modulename), + 'MyModule'=>$modulename, + 'MYMODULE'=>strtoupper($modulename), + 'My module'=>$modulename, + 'my module'=>$modulename, + 'Mon module'=>$modulename, + 'mon module'=>$modulename, + 'htdocs/modulebuilder/template'=>strtolower($modulename), + '---Put here your own copyright and developer email---'=>dol_print_date($now, '%Y').' '.$user->getFullName($langs).($user->email?' <'.$user->email.'>':'') + ); + + dolReplaceInFile($destfile, $arrayreplacement); + } +} +if ($dirins && $action == 'initdoc' && !empty($module)) +{ + dol_mkdir($dirins.'/'.strtolower($module).'/doc'); + $srcdir = DOL_DOCUMENT_ROOT.'/modulebuilder/template'; + $srcfile = $srcdir.'/doc/Specifications.asciidoc'; + $destfile = $dirins.'/'.strtolower($module).'/doc/Specifications.asciidoc'; + //var_dump($srcfile);var_dump($destfile); + $result = dol_copy($srcfile, $destfile, 0, 0); + + if ($result > 0) + { + $modulename = ucfirst($module); // Force first letter in uppercase + + //var_dump($phpfileval['fullname']); + $arrayreplacement=array( + 'mymodule'=>strtolower($modulename), + 'MyModule'=>$modulename, + 'MYMODULE'=>strtoupper($modulename), + 'My module'=>$modulename, + 'my module'=>$modulename, + 'Mon module'=>$modulename, + 'mon module'=>$modulename, + 'htdocs/modulebuilder/template'=>strtolower($modulename), + '---Put here your own copyright and developer email---'=>dol_print_date($now, '%Y').' '.$user->getFullName($langs).($user->email?' <'.$user->email.'>':'') + ); + + dolReplaceInFile($destfile, $arrayreplacement); + } +} + if ($dirins && $action == 'addlanguage' && !empty($module)) { $newlangcode=GETPOST('newlangcode', 'aZ09'); @@ -206,6 +345,20 @@ if ($dirins && $action == 'addlanguage' && !empty($module)) $result = dolCopyDir($srcfile, $destfile, 0, 0); } +if ($dirins && $action == 'confirm_removefile' && !empty($module)) +{ + $relativefilename=dol_sanitizePathName(GETPOST('file', 'none')); + if ($relativefilename) + { + $dirnametodelete = dirname($relativefilename); + $filetodelete = $dirins.'/'.$relativefilename; + $dirtodelete = $dirins.'/'.$dirnametodelete; + + $result = dol_delete_file($filetodelete); + if (dol_is_dir_empty($dirtodelete)) dol_delete_dir($dirtodelete); + } +} + if ($dirins && $action == 'initobject' && $module && GETPOST('createtablearray', 'alpha')) { $tablename = GETPOST('initfromtablename', 'alpha'); @@ -413,17 +566,17 @@ if ($dirins && $action == 'initobject' && $module && $objectname) //var_dump($phpfileval['fullname']); $arrayreplacement=array( - 'mymodule'=>strtolower($module), - 'MyModule'=>$module, - 'MYMODULE'=>strtoupper($module), - 'My module'=>$module, - 'my module'=>$module, - 'mon module'=>$module, - 'Mon module'=>$module, - 'htdocs/modulebuilder/template/'=>strtolower($modulename), - 'myobject'=>strtolower($objectname), - 'MyObject'=>$objectname, - 'MYOBJECT'=>strtoupper($objectname) + 'mymodule'=>strtolower($module), + 'MyModule'=>$module, + 'MYMODULE'=>strtoupper($module), + 'My module'=>$module, + 'my module'=>$module, + 'mon module'=>$module, + 'Mon module'=>$module, + 'htdocs/modulebuilder/template/'=>strtolower($modulename), + 'myobject'=>strtolower($objectname), + 'MyObject'=>$objectname, + 'MYOBJECT'=>strtoupper($objectname) ); $result=dolReplaceInFile($phpfileval['fullname'], $arrayreplacement); @@ -1067,6 +1220,7 @@ if ($module == 'initmodule') print $langs->trans("EnterNameOfModuleDesc").'

'; print ''; + print ''; print ''; } @@ -1162,6 +1316,11 @@ elseif (! empty($module)) $head2[$h][2] = 'widgets'; $h++; + $head2[$h][0] = $_SERVER["PHP_SELF"].'?tab=cli&module='.$module.($forceddirread?'@'.$dirread:''); + $head2[$h][1] = $langs->trans("CLI"); + $head2[$h][2] = 'cli'; + $h++; + $head2[$h][0] = $_SERVER["PHP_SELF"].'?tab=cron&module='.$module.($forceddirread?'@'.$dirread:''); $head2[$h][1] = $langs->trans("CronList"); $head2[$h][2] = 'cron'; @@ -1198,21 +1357,24 @@ elseif (! empty($module)) { dol_fiche_head($head2, $tab, '', -1, ''); // Description - level 2 - print $langs->trans("ModuleBuilderDesc".$tab).'

'; + print ''.$langs->trans("ModuleBuilderDesc".$tab).'

'; + print ''; + + print ''; - print ' '.$langs->trans("ReadmeFile").' : '.$pathtofilereadme.''; - print ' '.img_picto($langs->trans("Edit"), 'edit').''; - print '
'; + print ''; - print ' '.$langs->trans("ChangeLog").' : '.$pathtochangelog.''; - print ' '.img_picto($langs->trans("Edit"), 'edit').''; - print '
'; + print ''; - print '
'; + print '
'; print ' '.$langs->trans("DescriptorFile").' : '.$pathtofile.''; - print ' '.img_picto($langs->trans("Edit"), 'edit').''; - print '
'; + print '
'.img_picto($langs->trans("Edit"), 'edit').''; + print '
'.$langs->trans("ReadmeFile").' : '.$pathtofilereadme.''; + print ''.img_picto($langs->trans("Edit"), 'edit').''; + print '
'.$langs->trans("ChangeLog").' : '.$pathtochangelog.''; + print ''.img_picto($langs->trans("Edit"), 'edit').''; + print '
'; print '
'; print load_fiche_titre($langs->trans("DescriptorFile")); @@ -1344,62 +1506,11 @@ elseif (! empty($module)) dol_fiche_head($head2, $tab, '', -1, ''); // Level 2 } - - if ($tab == 'specifications') - { - if ($action != 'editfile' || empty($file)) - { - print $langs->trans("SpecDefDesc").'
'; - print '
'; - - $specs=dol_dir_list(dol_buildpath($modulelowercase.'/doc', 0), 'files', 1, '(\.md|\.asciidoc)$', array('\/temp\/')); - - foreach ($specs as $spec) - { - $pathtofile = $modulelowercase.'/doc/'.$spec['relativename']; - $format='asciidoc'; - if (preg_match('/\.md$/i', $spec['name'])) $format='markdown'; - print ' '.$langs->trans("SpecificationFile").' : '.$pathtofile.''; - print ' '.img_picto($langs->trans("Edit"), 'edit').''; - print '
'; - } - } - else - { - // Use MD or asciidoc - - //print $langs->trans("UseAsciiDocFormat").'
'; - - $fullpathoffile=dol_buildpath($file, 0); - - $content = file_get_contents($fullpathoffile); - - // New module - print '
'; - print ''; - print ''; - print ''; - print ''; - print ''; - - $doleditor=new DolEditor('editfilecontent', $content, '', '300', 'Full', 'In', true, false, 'ace', 0, '99%'); - print $doleditor->Create(1, '', false, $langs->trans("File").' : '.$file, (GETPOST('format', 'aZ09')?GETPOST('format', 'aZ09'):'html')); - print '
'; - print '
'; - print ''; - print '   '; - print ''; - print '
'; - - print '
'; - } - } - if ($tab == 'languages') { if ($action != 'editfile' || empty($file)) { - print $langs->trans("LanguageDefDesc").'
'; + print ''.$langs->trans("LanguageDefDesc").'
'; print '
'; @@ -1418,13 +1529,16 @@ elseif (! empty($module)) $langfiles=dol_dir_list(dol_buildpath($modulelowercase.'/langs', 0), 'files', 1, '\.lang$'); + print ''; foreach ($langfiles as $langfile) { $pathtofile = $modulelowercase.'/langs/'.$langfile['relativename']; - print ' '.$langs->trans("LanguageFile").' '.basename(dirname($pathtofile)).' : '.$pathtofile.''; - print ' '.img_picto($langs->trans("Edit"), 'edit').''; - print '
'; + print ''; } + print '
'.$langs->trans("LanguageFile").' '.basename(dirname($pathtofile)).' : '.$pathtofile.''; + print ''.img_picto($langs->trans("Edit"), 'edit').''; + print ''.img_picto($langs->trans("Delete"), 'delete').''; + print '
'; } else { @@ -1516,7 +1630,7 @@ elseif (! empty($module)) print ''; print ''; - print $langs->trans("EnterNameOfObjectDesc").'

'; + print ''.$langs->trans("EnterNameOfObjectDesc").'

'; print ''; print ''; @@ -1554,7 +1668,7 @@ elseif (! empty($module)) { // tabobj = module if ($action == 'deleteproperty') { - $formconfirm = $form->formconfirm( + $formconfirm = $form->formconfirm( $_SERVER["PHP_SELF"].'?propertykey='.urlencode(GETPOST('propertykey', 'alpha')).'&objectname='.urlencode($objectname).'&tab='.urlencode($tab).'&module='.urlencode($module).'&tabobj='.urlencode($tabobj), $langs->trans('Delete'), $langs->trans('ConfirmDeleteProperty', GETPOST('propertykey', 'alpha')), 'confirm_deleteproperty', '', 0, 1 ); @@ -1852,7 +1966,56 @@ elseif (! empty($module)) } else { - print ''.$langs->trans('Property $field not found into the class. The class was probably not generated by modulebuilder.').''; + if ($tab == 'specifications') + { + if ($action != 'editfile' || empty($file)) + { + print ''.$langs->trans("SpecDefDesc").'
'; + print '
'; + + $specs=dol_dir_list(dol_buildpath($modulelowercase.'/doc', 0), 'files', 1, '(\.md|\.asciidoc)$', array('\/temp\/')); + + foreach ($specs as $spec) + { + $pathtofile = $modulelowercase.'/doc/'.$spec['relativename']; + $format='asciidoc'; + if (preg_match('/\.md$/i', $spec['name'])) $format='markdown'; + print ' '.$langs->trans("SpecificationFile").' : '.$pathtofile.''; + print ' '.img_picto($langs->trans("Edit"), 'edit').''; + print '
'; + } + } + else + { + // Use MD or asciidoc + + //print $langs->trans("UseAsciiDocFormat").'
'; + + $fullpathoffile=dol_buildpath($file, 0); + + $content = file_get_contents($fullpathoffile); + + // New module + print '
'; + print ''; + print ''; + print ''; + print ''; + print ''; + + $doleditor=new DolEditor('editfilecontent', $content, '', '300', 'Full', 'In', true, false, 'ace', 0, '99%'); + print $doleditor->Create(1, '', false, $langs->trans("File").' : '.$file, (GETPOST('format', 'aZ09')?GETPOST('format', 'aZ09'):'html')); + print '
'; + print '
'; + print ''; + print '   '; + print ''; + print '
'; + + print '
'; + } + } + print ''.$langs->trans('Property $field not found into the class. The class was probably not generated by modulebuilder.').''; } print ''; print ''; @@ -1915,7 +2078,7 @@ elseif (! empty($module)) if ($action != 'editfile' || empty($file)) { - print $langs->trans("MenusDefDesc", ''.$langs->trans('Menus').'').'
'; + print ''.$langs->trans("MenusDefDesc", ''.$langs->trans('Menus').'').'
'; print '
'; print ' '.$langs->trans("DescriptorFile").' : '.$pathtofile.''; @@ -2040,7 +2203,7 @@ elseif (! empty($module)) if ($action != 'editfile' || empty($file)) { - print $langs->trans("PermissionsDefDesc", ''.$langs->trans('DefaultPermissions').'').'
'; + print ''.$langs->trans("PermissionsDefDesc", ''.$langs->trans('DefaultPermissions').'').'
'; print '
'; print ' '.$langs->trans("DescriptorFile").' : '.$pathtofile.''; @@ -2161,18 +2324,32 @@ elseif (! empty($module)) { if ($action != 'editfile' || empty($file)) { - print $langs->trans("HooksDefDesc").'
'; + print ''.$langs->trans("HooksDefDesc").'
'; print '
'; + print ''; + print ''; + print ''; + } + else + { + print ''.$langs->trans("FileNotYetGenerated").''; + print ''; + } + print ''; } else { @@ -2210,24 +2387,31 @@ elseif (! empty($module)) if ($action != 'editfile' || empty($file)) { - print $langs->trans("TriggerDefDesc").'
'; + print ''.$langs->trans("TriggerDefDesc").'
'; print '
'; + print '
'; + $pathtofile = $listofmodules[strtolower($module)]['moduledescriptorrelpath']; - print ' '.$langs->trans("DescriptorFile").' : '.$pathtofile.''; - print ' '.img_picto($langs->trans("Edit"), 'edit').''; - print '
'; + print ' '.$langs->trans("DescriptorFile").' : '.$pathtofile.''; + print '
'; + print ''.img_picto($langs->trans("Edit"), 'edit').''; + print '
'; $pathtohook = strtolower($module).'/class/actions_'.strtolower($module).'.class.php'; - print ' '.$langs->trans("HooksFile").' : '.$pathtohook.''; - print ' '.img_picto($langs->trans("Edit"), 'edit').''; - print '
'; + print ' '.$langs->trans("HooksFile").' : '; + if (dol_is_file($dirins.'/'.$pathtohook)) + { + print ''.$pathtohook.''; + print '
'.img_picto($langs->trans("Edit"), 'edit').''.img_picto($langs->trans("Delete"), 'delete').'
'; if (! empty($triggers)) { foreach ($triggers as $trigger) { $pathtofile = $trigger['relpath']; + print ''; + print ''; + print ''; } } else { - print $langs->trans("NoTrigger"); + print ''; + print ''; } + print '
'; print ' '.$langs->trans("TriggersFile").' : '.$pathtofile.''; - print ' '.img_picto($langs->trans("Edit"), 'edit').''; - print '
'; + print '
'.img_picto($langs->trans("Edit"), 'edit').''.img_picto($langs->trans("Delete"), 'delete').'
'; + print ' '.$langs->trans("NoTrigger"); + print '
'; } else { @@ -2264,21 +2448,30 @@ elseif (! empty($module)) if ($action != 'editfile' || empty($file)) { - if (! empty($widget)) + print ''.$langs->trans("WidgetDesc").'
'; + print '
'; + + print ''; + if (! empty($widgets)) { foreach ($widgets as $widget) { $pathtofile = $widget['relpath']; - print ' '.$langs->trans("WidgetFile").' : '.$pathtofile.''; + print ''; + print ''; + print ''; } } else { - print $langs->trans("NoWidget"); + print ''; } + print '
'.$langs->trans("WidgetFile").' : '.$pathtofile.''; print ' '.img_picto($langs->trans("Edit"), 'edit').''; - print '
'; + print '
'.img_picto($langs->trans("Delete"), 'delete').'
'.$langs->trans("NoWidget"); + print ''; + print '
'; } else { @@ -2307,6 +2500,92 @@ elseif (! empty($module)) } } + if ($tab == 'cli') + { + $clifiles = array(); + $i = 0; + + $dircli=array('/'.strtolower($module).'/scripts'); + + foreach($dircli as $reldir) + { + $dir=dol_buildpath($reldir, 0); + $newdir=dol_osencode($dir); + + // Check if directory exists (we do not use dol_is_dir to avoid loading files.lib.php at each call) + if (! is_dir($newdir)) continue; + + $handle=opendir($newdir); + if (is_resource($handle)) + { + while (($tmpfile = readdir($handle))!==false) + { + if (is_readable($newdir.'/'.$file) && preg_match('/^(.+)\.php/', $tmpfile, $reg)) + { + if (preg_match('/\.back$/', $tmpfile)) continue; + + $clifiles[$i]['relpath'] = preg_replace('/^\//', '', $reldir).'/'.$tmpfile; + + $i++; + } + } + closedir($handle); + } + } + + if ($action != 'editfile' || empty($file)) + { + print ''.$langs->trans("CLIDesc").'
'; + print '
'; + + print ''; + if (! empty($clifiles)) + { + foreach ($clifiles as $clifile) + { + $pathtofile = $clifile['relpath']; + + print ''; + print ''; + print ''; + } + } + else + { + print ''; + } + print '
'.$langs->trans("CLIFile").' : '.$pathtofile.''; + print ''.img_picto($langs->trans("Edit"), 'edit').''.img_picto($langs->trans("Delete"), 'delete').'
'.$langs->trans("NoCLIFile"); + print ''; + print '
'; + } + else + { + $fullpathoffile=dol_buildpath($file, 0); + + $content = file_get_contents($fullpathoffile); + + // New module + print '
'; + print ''; + print ''; + print ''; + print ''; + print ''; + + $doleditor=new DolEditor('editfilecontent', $content, '', '300', 'Full', 'In', true, false, 'ace', 0, '99%'); + print $doleditor->Create(1, '', false, $langs->trans("File").' : '.$file, (GETPOST('format', 'aZ09')?GETPOST('format', 'aZ09'):'html')); + print '
'; + print '
'; + print ''; + print '   '; + print ''; + print '
'; + + print '
'; + } + } + if ($tab == 'cron') { $pathtofile = $listofmodules[strtolower($module)]['moduledescriptorrelpath']; @@ -2315,7 +2594,7 @@ elseif (! empty($module)) if ($action != 'editfile' || empty($file)) { - print $langs->trans("CronJobDefDesc", ''.$langs->transnoentities('CronList').'').'
'; + print ''.$langs->trans("CronJobDefDesc", ''.$langs->transnoentities('CronList').'').'
'; print '
'; print ' '.$langs->trans("DescriptorFile").' : '.$pathtofile.''; @@ -2429,6 +2708,70 @@ elseif (! empty($module)) } } + if ($tab == 'specifications') + { + if ($action != 'editfile' || empty($file)) + { + print ''.$langs->trans("SpecDefDesc").'
'; + print '
'; + + $specs=dol_dir_list(dol_buildpath($modulelowercase.'/doc', 0), 'files', 1, '(\.md|\.asciidoc)$', array('\/temp\/')); + + print ''; + if (is_array($specs) && ! empty($specs)) + { + foreach ($specs as $spec) + { + $pathtofile = $modulelowercase.'/doc/'.$spec['relativename']; + $format='asciidoc'; + if (preg_match('/\.md$/i', $spec['name'])) $format='markdown'; + print ''; + print ''; + print ''; + } + } + else + { + print ''; + print ''; + } + print '
'; + print ' '.$langs->trans("SpecificationFile").' : '.$pathtofile.''; + print ''.img_picto($langs->trans("Edit"), 'edit').''.img_picto($langs->trans("Delete"), 'delete').'
'; + print ' '.$langs->trans("FileNotYetGenerated"); + print '
'; + } + else + { + // Use MD or asciidoc + + //print $langs->trans("UseAsciiDocFormat").'
'; + + $fullpathoffile=dol_buildpath($file, 0); + + $content = file_get_contents($fullpathoffile); + + // New module + print '
'; + print ''; + print ''; + print ''; + print ''; + print ''; + + $doleditor=new DolEditor('editfilecontent', $content, '', '300', 'Full', 'In', true, false, 'ace', 0, '99%'); + print $doleditor->Create(1, '', false, $langs->trans("File").' : '.$file, (GETPOST('format', 'aZ09')?GETPOST('format', 'aZ09'):'html')); + print '
'; + print '
'; + print ''; + print '   '; + print ''; + print '
'; + + print '
'; + } + } + if ($tab == 'buildpackage') { if (! class_exists('ZipArchive') && ! defined('ODTPHP_PATHTOPCLZIP')) diff --git a/htdocs/modulebuilder/template/README.md b/htdocs/modulebuilder/template/README.md index 635e1eed5b0..f894c3ac6ae 100644 --- a/htdocs/modulebuilder/template/README.md +++ b/htdocs/modulebuilder/template/README.md @@ -87,14 +87,8 @@ Licenses ### Main code -![GPLv3 logo](img/gplv3.png) - -GPLv3 or (at your option) any later version. - -See file COPYING for more information. +GPLv3 or (at your option) any later version. See file COPYING for more information. #### Documentation -All texts and readmes. - -![GFDL logo](img/gfdl.png) +All texts and readmes are licensed under GFDL. diff --git a/htdocs/modulebuilder/template/core/boxes/mymodulewidget1.php b/htdocs/modulebuilder/template/core/boxes/mymodulewidget1.php index 087f102daef..ed35331f8e3 100644 --- a/htdocs/modulebuilder/template/core/boxes/mymodulewidget1.php +++ b/htdocs/modulebuilder/template/core/boxes/mymodulewidget1.php @@ -18,7 +18,7 @@ */ /** - * \file modulebuilder/template/core/boxes/mymodulewidget1.php + * \file htdocs/modulebuilder/template/core/boxes/mymodulewidget1.php * \ingroup mymodule * \brief Widget provided by MyModule * diff --git a/htdocs/modulebuilder/template/core/modules/modMyModule.class.php b/htdocs/modulebuilder/template/core/modules/modMyModule.class.php index 0f350e83226..c58452bc0aa 100644 --- a/htdocs/modulebuilder/template/core/modules/modMyModule.class.php +++ b/htdocs/modulebuilder/template/core/modules/modMyModule.class.php @@ -91,14 +91,14 @@ class modMyModule extends DolibarrModules 'substitutions' => 1, // Set this to 1 if module has its own menus handler directory (core/menus) 'menus' => 0, - // Set this to 1 if module has its own theme directory (theme) - 'theme' => 0, // Set this to 1 if module overwrite template dir (core/tpl) 'tpl' => 0, // Set this to 1 if module has its own barcode directory (core/modules/barcode) 'barcode' => 0, // Set this to 1 if module has its own models directory (core/modules/xxx) 'models' => 0, + // Set this to 1 if module has its own theme directory (theme) + 'theme' => 0, // Set this to relative path of css file if module has its own css file 'css' => array( '/mymodule/css/mymodule.css.php', diff --git a/htdocs/modulebuilder/template/doc/Specifications.asciidoc b/htdocs/modulebuilder/template/doc/Specifications.asciidoc index be8316c8cda..232ba7a705f 100644 --- a/htdocs/modulebuilder/template/doc/Specifications.asciidoc +++ b/htdocs/modulebuilder/template/doc/Specifications.asciidoc @@ -13,7 +13,7 @@ This document describe specifications of module MyModule [options="header",format="csv"] |=== Author, Date, Version ----Put here your own copyright and developer email---, Date YYY-MM-DD, Version 1.0 +---Put here your own copyright and developer email---, Date YYYY-MM-DD, Version 1.0 |=== diff --git a/htdocs/modulebuilder/template/doc/Specifications_full_en.example.asciidoc b/htdocs/modulebuilder/template/doc/Specifications_full_en.example.asciidoc index 72d1d5f4d82..6917d7cdd68 100644 --- a/htdocs/modulebuilder/template/doc/Specifications_full_en.example.asciidoc +++ b/htdocs/modulebuilder/template/doc/Specifications_full_en.example.asciidoc @@ -39,7 +39,7 @@ external documents stored in the *Appendices* directory accompanying this docume [options="header",format="csv"] |=== Author, Date, Version -John Doe, Date YYY-MM-DD, Version 1.0 +John Doe, Date YYYY-MM-DD, Version 1.0 |=== diff --git a/htdocs/modulebuilder/template/img/gfdl.png b/htdocs/modulebuilder/template/img/gfdl.png deleted file mode 100644 index f2bacfd179a..00000000000 Binary files a/htdocs/modulebuilder/template/img/gfdl.png and /dev/null differ diff --git a/htdocs/modulebuilder/template/img/gplv3.png b/htdocs/modulebuilder/template/img/gplv3.png deleted file mode 100644 index ba78d4c4941..00000000000 Binary files a/htdocs/modulebuilder/template/img/gplv3.png and /dev/null differ diff --git a/htdocs/modulebuilder/template/scripts/myobject.php b/htdocs/modulebuilder/template/scripts/mymodule.php similarity index 96% rename from htdocs/modulebuilder/template/scripts/myobject.php rename to htdocs/modulebuilder/template/scripts/mymodule.php index f80a5f67b3e..765b1138f05 100644 --- a/htdocs/modulebuilder/template/scripts/myobject.php +++ b/htdocs/modulebuilder/template/scripts/mymodule.php @@ -18,9 +18,9 @@ */ /** - * \file htdocs/modulebuilder/template/scripts/myobject.php + * \file htdocs/modulebuilder/template/scripts/mymodule.php * \ingroup mymodule - * \brief This file is an example for a command line script to work on MyObject + * \brief This file is an example for a command line script for module MyModule */ $sapi_type = php_sapi_name(); @@ -81,8 +81,8 @@ $db->begin(); // Examples for manipulating class MyObject -dol_include_once("/mymodule/class/myobject.class.php"); -$myobject=new MyObject($db); +//dol_include_once("/mymodule/class/myobject.class.php"); +//$myobject=new MyObject($db); // Example for inserting creating object in database /* diff --git a/htdocs/opensurvey/card.php b/htdocs/opensurvey/card.php index 0dff8b96b69..5982a8c271b 100644 --- a/htdocs/opensurvey/card.php +++ b/htdocs/opensurvey/card.php @@ -112,13 +112,14 @@ if (empty($reshook)) if (! $error) { - $object->titre = GETPOST('nouveautitre'); - $object->commentaires = GETPOST('nouveauxcommentaires'); - $object->mail_admin = GETPOST('nouvelleadresse'); + $object->titre = GETPOST('nouveautitre', 'nohtml'); + $object->commentaires = GETPOST('nouveauxcommentaires', 'nohtml'); + $object->description = GETPOST('nouveauxcommentaires', 'nohtml'); + $object->mail_admin = GETPOST('nouvelleadresse', 'alpha'); $object->date_fin = $expiredate; - $object->allow_comments = GETPOST('cancomment') == 'on' ? true : false; - $object->allow_spy = GETPOST('canseeothersvote') == 'on' ? true : false; - $object->mailsonde = GETPOST('mailsonde') == 'on' ? true : false; + $object->allow_comments = GETPOST('cancomment', 'alpha') == 'on' ? true : false; + $object->allow_spy = GETPOST('canseeothersvote', 'alpha') == 'on' ? true : false; + $object->mailsonde = GETPOST('mailsonde', 'alpha') == 'on' ? true : false; $res=$object->update($user); if ($res < 0) diff --git a/htdocs/opensurvey/class/opensurveysondage.class.php b/htdocs/opensurvey/class/opensurveysondage.class.php index a688f12654b..8a5a102a9f5 100644 --- a/htdocs/opensurvey/class/opensurveysondage.class.php +++ b/htdocs/opensurvey/class/opensurveysondage.class.php @@ -49,7 +49,7 @@ class Opensurveysondage extends CommonObject public $id_sondage; /** * @deprecated - * @see description + * @see $description */ public $commentaires; @@ -519,6 +519,7 @@ class Opensurveysondage extends CommonObject $this->id_sondage=''; $this->commentaires='Comment of the specimen survey'; + $this->description='Comment of the specimen survey'; $this->mail_admin=''; $this->nom_admin=''; $this->titre='This is a specimen survey'; @@ -606,6 +607,7 @@ class Opensurveysondage extends CommonObject { $this->id_sondage = trim($this->id_sondage); $this->commentaires = trim($this->commentaires); + $this->description = trim($this->description); $this->mail_admin = trim($this->mail_admin); $this->nom_admin = trim($this->nom_admin); $this->titre = trim($this->titre); diff --git a/htdocs/opensurvey/fonctions.php b/htdocs/opensurvey/fonctions.php index c69b6fa3c0f..b93440f9afd 100644 --- a/htdocs/opensurvey/fonctions.php +++ b/htdocs/opensurvey/fonctions.php @@ -207,6 +207,7 @@ function ajouter_sondage() $opensurveysondage = new Opensurveysondage($db); $opensurveysondage->id_sondage = $sondage; $opensurveysondage->commentaires = $_SESSION['commentaires']; + $opensurveysondage->description = $_SESSION['commentaires']; $opensurveysondage->mail_admin = $_SESSION['adresse']; $opensurveysondage->nom_admin = $_SESSION['nom']; $opensurveysondage->titre = $_SESSION['titre']; diff --git a/htdocs/projet/class/project.class.php b/htdocs/projet/class/project.class.php index 34a36e859dc..02bf2679b1b 100644 --- a/htdocs/projet/class/project.class.php +++ b/htdocs/projet/class/project.class.php @@ -74,7 +74,7 @@ class Project extends CommonObject /** * @var string * @deprecated - * @see title + * @see $title */ public $titre; @@ -107,7 +107,7 @@ class Project extends CommonObject /** * @var int Creation date * @deprecated - * @see date_c + * @see $date_c */ public $datec; @@ -119,7 +119,7 @@ class Project extends CommonObject /** * @var int Modification date * @deprecated - * @see date_m + * @see $date_m */ public $datem; @@ -1535,12 +1535,12 @@ class Project extends CommonObject /** * Shift project task date from current date to delta * - * @param timestamp $old_project_dt_start old project start date - * @return int 1 if OK or < 0 if KO + * @param integer $old_project_dt_start Old project start date + * @return int 1 if OK or < 0 if KO */ public function shiftTaskDate($old_project_dt_start) { - global $user,$langs,$conf; + global $user, $langs, $conf; $error=0; diff --git a/htdocs/stripe/class/actions_stripe.class.php b/htdocs/stripe/class/actions_stripe.class.php index 5e11e81ed3e..036c8ed2ba6 100644 --- a/htdocs/stripe/class/actions_stripe.class.php +++ b/htdocs/stripe/class/actions_stripe.class.php @@ -169,7 +169,7 @@ class ActionsStripeconnect /** * addMoreActionsButtons * - * @param arra $parameters Parameters + * @param array $parameters Parameters * @param Object $object Object * @param string $action action * @return int 0 diff --git a/htdocs/theme/eldy/style.css.php b/htdocs/theme/eldy/style.css.php index 1f58937d879..9557c97d6d1 100644 --- a/htdocs/theme/eldy/style.css.php +++ b/htdocs/theme/eldy/style.css.php @@ -1059,10 +1059,6 @@ select.selectarrowonleft option { text-overflow: ellipsis; white-space: nowrap; } - div.titre { - /* margin-top: 12px; */ - /* line-height: 2em; */ - } .border tbody tr, .border tbody tr td, div.tabBar table.border tr, div.tabBar table.border tr td, div.tabBar div.border .table-border-row, div.tabBar div.border .table-key-border-col, div.tabBar div.border .table-val-border-col { height: 40px !important; } @@ -1297,7 +1293,7 @@ div.fiche { div.fiche { margin-: dol_optimize_smallscreen)?'30':'6')); ?>px; - margin-: dol_optimize_smallscreen)?'29':'6')); ?>px; + margin-: dol_optimize_smallscreen)?'28':'6')); ?>px; } @@ -3671,14 +3667,15 @@ label.radioprivate { } div.titre { - font-family: ; font-size: 1.1em; - /* font-weight: bold; */ - color: rgb(); text-decoration: none; padding-top: 5px; padding-bottom: 5px; } +div.titre, .secondary { + font-family: ; + color: rgb(); +} #dolpaymenttable { min-width: 320px; font-size: 16px; } /* Width must have min to make stripe input area visible. Lower than 320 makes input area crazy for credit card that need zip code */ #tablepublicpayment { border: 1px solid #CCCCCC !important; width: 100%; padding: 20px; } diff --git a/htdocs/theme/md/style.css.php b/htdocs/theme/md/style.css.php index 1f98c2d25ca..fbee7633173 100644 --- a/htdocs/theme/md/style.css.php +++ b/htdocs/theme/md/style.css.php @@ -1025,10 +1025,6 @@ select.selectarrowonleft option { div.fiche { margin-top: px !important; } - div.titre { - /* margin-top: 12px; */ - /* line-height: 2em; */ - } .border tbody tr, .border tbody tr td, div.tabBar table.border tr { height: 40px !important; } @@ -3584,16 +3580,17 @@ label.radioprivate { } div.titre { - font-family: ; font-size: 14px; - /* font-weight: bold; */ - color: rgb(); text-decoration: none; padding-top: 5px; padding-bottom: 5px; /* text-shadow: 1px 1px 2px #FFFFFF; */ dol_optimize_smallscreen)?'':'margin-top: 4px;'); ?> } +div.titre, .secondary { + font-family: ; + color: rgb(); +} #dolpaymenttable { min-width: 320px; font-size: 16px; } /* Width must have min to make stripe input area visible. Lower than 320 makes input area crazy for credit card that need zip code */ #tablepublicpayment { border: 1px solid #CCCCCC !important; width: 100%; padding: 20px; } diff --git a/scripts/invoices/rebuild_merge_pdf.php b/scripts/invoices/rebuild_merge_pdf.php index 37c471c01c9..62865570b28 100755 --- a/scripts/invoices/rebuild_merge_pdf.php +++ b/scripts/invoices/rebuild_merge_pdf.php @@ -266,7 +266,7 @@ exit($error); /** * Show usage of script * - * @return unknown + * @return void */ function usage() {