2
0
forked from Wavyzz/dolibarr

Merge branch 'patch-1' of https://github.com/mwelters/dolibarr into patch-1

This commit is contained in:
Rafael Ingenleuf
2019-03-11 16:44:49 +01:00
44 changed files with 673 additions and 342 deletions

View File

@@ -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 *****

View File

@@ -1,7 +1,7 @@
<?php
/* Copyright (C) 2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2003 Jean-Louis Bergamo <jlb@j1b.org>
* Copyright (C) 2006-2011 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2006-2013 Laurent Destailleur <eldy@users.sourceforge.net>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -249,13 +249,14 @@ $form=new Form($db);
llxHeader('', $langs->trans("MembersCards"));
print load_fiche_titre($langs->trans("LinkToGeneratedPages"));
print '<br>';
print $langs->trans("LinkToGeneratedPagesDesc").'<br>';
print '<span class="opacitymedium">'.$langs->trans("LinkToGeneratedPagesDesc").'</span><br>';
print '<br>';
dol_htmloutput_errors($mesg);
print '<br>';
print img_picto('', 'puce').' '.$langs->trans("DocForAllMembersCards", ($conf->global->ADHERENT_CARD_TYPE?$conf->global->ADHERENT_CARD_TYPE:$langs->transnoentitiesnoconv("None"))).' ';
print '<form action="'.$_SERVER["PHP_SELF"].'" method="POST">';
print '<input type="hidden" name="foruserid" value="all">';
@@ -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 '<br><input class="button" type="submit" value="'.$langs->trans("BuildDoc").'">';
print '</form>';
print '<br>';
print '<br><br>';
print img_picto('', 'puce').' '.$langs->trans("DocForOneMemberCards", ($conf->global->ADHERENT_CARD_TYPE?$conf->global->ADHERENT_CARD_TYPE:$langs->transnoentitiesnoconv("None"))).' ';
print '<form action="'.$_SERVER["PHP_SELF"].'" method="POST">';
@@ -290,7 +292,8 @@ print $form->selectarray('model', $arrayoflabels, (GETPOST('model')?GETPOST('mod
print '<br>'.$langs->trans("Login").': <input size="10" type="text" name="foruserlogin" value="'.GETPOST('foruserlogin').'">';
print '<br><input class="button" type="submit" value="'.$langs->trans("BuildDoc").'">';
print '</form>';
print '<br>';
print '<br><br>';
print img_picto('', 'puce').' '.$langs->trans("DocForLabels", $conf->global->ADHERENT_ETIQUETTE_TYPE).' ';
print '<form action="'.$_SERVER["PHP_SELF"].'" method="POST">';
@@ -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 '<br><input class="button" type="submit" value="'.$langs->trans("BuildDoc").'">';
print '</form>';
print '<br>';
// End of page
llxFooter();

View File

@@ -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)
{

View File

@@ -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

View File

@@ -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;

View File

@@ -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)
{

View File

@@ -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

View File

@@ -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 versionarray1<versionarray2 (value depends on level of difference)
* 0 if same
* 1,2,3,4 if versionarray1>versionarray2 (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)
{

View File

@@ -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')
{

View File

@@ -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)
{
@@ -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 = '')
{

View File

@@ -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

View File

@@ -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)

View File

@@ -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')

View File

@@ -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 <br>, true=Use <br />
* @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,7 +5743,7 @@ function dol_textishtml($msg, $option = 0)
* @param bool $forxml false=Use <br>instead of \n if html content detected, true=Use <br /> 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)
{
@@ -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)
{

View File

@@ -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)
{

View File

@@ -140,7 +140,7 @@ function dol_convertToWord($num, $langs, $currency = false, $centimes = false)
*
* @deprecated
* @param float $numero Number to convert
* @param Lang $langs Language
* @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)
*/

View File

@@ -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

View File

@@ -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)
{

View File

@@ -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)
{

View File

@@ -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<!-- start banner of report -->\n";
if(! empty($varlink)) $varlink = '?'.$varlink;
$head = array();
$h=0;
$head[$h][0] = $_SERVER["PHP_SELF"].$varlink;
$head[$h][1] = $langs->trans("Report");

View File

@@ -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')
{

View File

@@ -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)
{

View File

@@ -194,7 +194,7 @@ function user_prepare_head($object)
/**
* Prepare array with list of tabs
*
* @param Group $object Object group
* @param UserGroup $object Object group
* @return array Array of tabs
*/
function group_prepare_head($object)

View File

@@ -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)
{

View File

@@ -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);

View File

@@ -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)

View File

@@ -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.<br>Documentation for alternative <a href="%s" target="_blank">manual development is here</a>.
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): <strong>%s</strong>
ModuleBuilderDesc2=Path where modules are generated/edited (first directory for external modules defined into %s): <strong>%s</strong>
ModuleBuilderDesc3=Generated/editable modules found: <strong>%s</strong>
ModuleBuilderDesc4=A module is detected as 'editable' when the file <strong>%s</strong> exists in root of module directory
NewModule=New module
@@ -101,3 +101,7 @@ UseDocFolder=Disable the documentation folder
UseSpecificReadme=Use a specific ReadMe
RealPathOfModule=Real path of module
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

View File

@@ -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
@@ -174,7 +188,6 @@ if ($dirins && $action == 'initmodule' && $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');
@@ -1067,6 +1220,7 @@ if ($module == 'initmodule')
print $langs->trans("EnterNameOfModuleDesc").'<br><br>';
print '<input type="text" name="modulename" value="'.dol_escape_htmltag($modulename).'" placeholder="'.dol_escape_htmltag($langs->trans("ModuleKey")).'">';
print '<input type="submit" class="button" name="create" value="'.dol_escape_htmltag($langs->trans("Create")).'"'.($dirins?'':' disabled="disabled"').'>';
print '</form>';
}
@@ -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).'<br><br>';
print '<span class="opacitymedium">'.$langs->trans("ModuleBuilderDesc".$tab).'</span><br><br>';
print '<table>';
print '<tr><td>';
print '<span class="fa fa-file-o"></span> '.$langs->trans("DescriptorFile").' : <strong>'.$pathtofile.'</strong>';
print ' <a href="'.$_SERVER['PHP_SELF'].'?tab='.$tab.'&module='.$module.($forceddirread?'@'.$dirread:'').'&action=editfile&format=php&file='.urlencode($pathtofile).'">'.img_picto($langs->trans("Edit"), 'edit').'</a>';
print '<br>';
print '</td><td><a href="'.$_SERVER['PHP_SELF'].'?tab='.$tab.'&module='.$module.($forceddirread?'@'.$dirread:'').'&action=editfile&format=php&file='.urlencode($pathtofile).'">'.img_picto($langs->trans("Edit"), 'edit').'</a>';
print '</td></tr>';
print '<span class="fa fa-file-o"></span> '.$langs->trans("ReadmeFile").' : <strong>'.$pathtofilereadme.'</strong>';
print ' <a href="'.$_SERVER['PHP_SELF'].'?tab='.$tab.'&module='.$module.($forceddirread?'@'.$dirread:'').'&action=editfile&format=markdown&file='.urlencode($pathtofilereadme).'">'.img_picto($langs->trans("Edit"), 'edit').'</a>';
print '<br>';
print '<tr><td><span class="fa fa-file-o"></span> '.$langs->trans("ReadmeFile").' : <strong>'.$pathtofilereadme.'</strong>';
print '</td><td><a href="'.$_SERVER['PHP_SELF'].'?tab='.$tab.'&module='.$module.($forceddirread?'@'.$dirread:'').'&action=editfile&format=markdown&file='.urlencode($pathtofilereadme).'">'.img_picto($langs->trans("Edit"), 'edit').'</a>';
print '</td></tr>';
print '<span class="fa fa-file-o"></span> '.$langs->trans("ChangeLog").' : <strong>'.$pathtochangelog.'</strong>';
print ' <a href="'.$_SERVER['PHP_SELF'].'?tab='.$tab.'&module='.$module.($forceddirread?'@'.$dirread:'').'&action=editfile&format=markdown&file='.urlencode($pathtochangelog).'">'.img_picto($langs->trans("Edit"), 'edit').'</a>';
print '<br>';
print '<tr><td><span class="fa fa-file-o"></span> '.$langs->trans("ChangeLog").' : <strong>'.$pathtochangelog.'</strong>';
print '</td><td><a href="'.$_SERVER['PHP_SELF'].'?tab='.$tab.'&module='.$module.($forceddirread?'@'.$dirread:'').'&action=editfile&format=markdown&file='.urlencode($pathtochangelog).'">'.img_picto($langs->trans("Edit"), 'edit').'</a>';
print '</td></tr>';
print '<br>';
print '</table>';
print '<br>';
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").'<br>';
print '<br>';
$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 '<span class="fa fa-file-o"></span> '.$langs->trans("SpecificationFile").' : <strong>'.$pathtofile.'</strong>';
print ' <a href="'.$_SERVER['PHP_SELF'].'?tab='.$tab.'&module='.$module.'&action=editfile&format='.$format.'&file='.urlencode($pathtofile).'">'.img_picto($langs->trans("Edit"), 'edit').'</a>';
print '<br>';
}
}
else
{
// Use MD or asciidoc
//print $langs->trans("UseAsciiDocFormat").'<br>';
$fullpathoffile=dol_buildpath($file, 0);
$content = file_get_contents($fullpathoffile);
// New module
print '<form action="'.$_SERVER["PHP_SELF"].'" method="POST">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<input type="hidden" name="action" value="savefile">';
print '<input type="hidden" name="file" value="'.dol_escape_htmltag($file).'">';
print '<input type="hidden" name="tab" value="'.$tab.'">';
print '<input type="hidden" name="module" value="'.$module.'">';
$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 '<br>';
print '<center>';
print '<input type="submit" class="button buttonforacesave" id="savefile" name="savefile" value="'.dol_escape_htmltag($langs->trans("Save")).'">';
print ' &nbsp; ';
print '<input type="submit" class="button" name="cancel" value="'.dol_escape_htmltag($langs->trans("Cancel")).'">';
print '</center>';
print '</form>';
}
}
if ($tab == 'languages')
{
if ($action != 'editfile' || empty($file))
{
print $langs->trans("LanguageDefDesc").'<br>';
print '<span class="opacitymedium">'.$langs->trans("LanguageDefDesc").'</span><br>';
print '<br>';
@@ -1418,13 +1529,16 @@ elseif (! empty($module))
$langfiles=dol_dir_list(dol_buildpath($modulelowercase.'/langs', 0), 'files', 1, '\.lang$');
print '<table class="none">';
foreach ($langfiles as $langfile)
{
$pathtofile = $modulelowercase.'/langs/'.$langfile['relativename'];
print '<span class="fa fa-file-o"></span> '.$langs->trans("LanguageFile").' '.basename(dirname($pathtofile)).' : <strong>'.$pathtofile.'</strong>';
print ' <a href="'.$_SERVER['PHP_SELF'].'?tab='.$tab.'&module='.$module.'&action=editfile&format='.$format.'&file='.urlencode($pathtofile).'">'.img_picto($langs->trans("Edit"), 'edit').'</a>';
print '<br>';
print '<tr><td><span class="fa fa-file-o"></span> '.$langs->trans("LanguageFile").' '.basename(dirname($pathtofile)).' : <strong>'.$pathtofile.'</strong>';
print '</td><td><a href="'.$_SERVER['PHP_SELF'].'?tab='.$tab.'&module='.$module.'&action=editfile&format='.$format.'&file='.urlencode($pathtofile).'">'.img_picto($langs->trans("Edit"), 'edit').'</a>';
print '</td><td><a href="'.$_SERVER['PHP_SELF'].'?tab='.$tab.'&module='.$module.'&action=confirm_removefile&format='.$format.'&file='.urlencode($pathtofile).'">'.img_picto($langs->trans("Delete"), 'delete').'</a>';
print '</td>';
}
print '</table>';
}
else
{
@@ -1516,7 +1630,7 @@ elseif (! empty($module))
print '<input type="hidden" name="tab" value="objects">';
print '<input type="hidden" name="module" value="'.dol_escape_htmltag($module).'">';
print $langs->trans("EnterNameOfObjectDesc").'<br><br>';
print '<span class="opacitymedium">'.$langs->trans("EnterNameOfObjectDesc").'</span><br><br>';
print '<input type="text" name="objectname" value="'.dol_escape_htmltag(GETPOST('objectname', 'alpha')?GETPOST('objectname', 'alpha'):$modulename).'" placeholder="'.dol_escape_htmltag($langs->trans("ObjectKey")).'">';
print '<input type="submit" class="button" name="create" value="'.dol_escape_htmltag($langs->trans("Generate")).'"'.($dirins?'':' disabled="disabled"').'>';
@@ -1852,6 +1966,55 @@ elseif (! empty($module))
}
else
{
if ($tab == 'specifications')
{
if ($action != 'editfile' || empty($file))
{
print '<span class="opacitymedium">'.$langs->trans("SpecDefDesc").'</span><br>';
print '<br>';
$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 '<span class="fa fa-file-o"></span> '.$langs->trans("SpecificationFile").' : <strong>'.$pathtofile.'</strong>';
print ' <a href="'.$_SERVER['PHP_SELF'].'?tab='.$tab.'&module='.$module.'&action=editfile&format='.$format.'&file='.urlencode($pathtofile).'">'.img_picto($langs->trans("Edit"), 'edit').'</a>';
print '<br>';
}
}
else
{
// Use MD or asciidoc
//print $langs->trans("UseAsciiDocFormat").'<br>';
$fullpathoffile=dol_buildpath($file, 0);
$content = file_get_contents($fullpathoffile);
// New module
print '<form action="'.$_SERVER["PHP_SELF"].'" method="POST">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<input type="hidden" name="action" value="savefile">';
print '<input type="hidden" name="file" value="'.dol_escape_htmltag($file).'">';
print '<input type="hidden" name="tab" value="'.$tab.'">';
print '<input type="hidden" name="module" value="'.$module.'">';
$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 '<br>';
print '<center>';
print '<input type="submit" class="button buttonforacesave" id="savefile" name="savefile" value="'.dol_escape_htmltag($langs->trans("Save")).'">';
print ' &nbsp; ';
print '<input type="submit" class="button" name="cancel" value="'.dol_escape_htmltag($langs->trans("Cancel")).'">';
print '</center>';
print '</form>';
}
}
print '<tr><td><span class="warning">'.$langs->trans('Property $field not found into the class. The class was probably not generated by modulebuilder.').'</warning></td></tr>';
}
print '</table>';
@@ -1915,7 +2078,7 @@ elseif (! empty($module))
if ($action != 'editfile' || empty($file))
{
print $langs->trans("MenusDefDesc", '<a href="'.DOL_URL_ROOT.'/admin/menus/index.php">'.$langs->trans('Menus').'</a>').'<br>';
print '<span class="opacitymedium">'.$langs->trans("MenusDefDesc", '<a href="'.DOL_URL_ROOT.'/admin/menus/index.php">'.$langs->trans('Menus').'</a>').'</span><br>';
print '<br>';
print '<span class="fa fa-file-o"></span> '.$langs->trans("DescriptorFile").' : <strong>'.$pathtofile.'</strong>';
@@ -2040,7 +2203,7 @@ elseif (! empty($module))
if ($action != 'editfile' || empty($file))
{
print $langs->trans("PermissionsDefDesc", '<a href="'.DOL_URL_ROOT.'/admin/perms.php">'.$langs->trans('DefaultPermissions').'</a>').'<br>';
print '<span class="opacitymedium">'.$langs->trans("PermissionsDefDesc", '<a href="'.DOL_URL_ROOT.'/admin/perms.php">'.$langs->trans('DefaultPermissions').'</a>').'</span><br>';
print '<br>';
print '<span class="fa fa-file-o"></span> '.$langs->trans("DescriptorFile").' : <strong>'.$pathtofile.'</strong>';
@@ -2161,18 +2324,32 @@ elseif (! empty($module))
{
if ($action != 'editfile' || empty($file))
{
print $langs->trans("HooksDefDesc").'<br>';
print '<span class="opacitymedium">'.$langs->trans("HooksDefDesc").'</span><br>';
print '<br>';
print '<table><tr><td>';
$pathtofile = $listofmodules[strtolower($module)]['moduledescriptorrelpath'];
print '<span class="fa fa-file-o"></span> '.$langs->trans("DescriptorFile").' : <strong>'.$pathtofile.'</strong>';
print ' <a href="'.$_SERVER['PHP_SELF'].'?tab='.$tab.'&module='.$module.'&action=editfile&format=php&file='.urlencode($pathtofile).'">'.img_picto($langs->trans("Edit"), 'edit').'</a>';
print '<br>';
print '<span class="fa fa-file-o"></span> '.$langs->trans("DescriptorFile").' : <strong class="">'.$pathtofile.'</strong>';
print '</td><td>';
print '<a href="'.$_SERVER['PHP_SELF'].'?tab='.$tab.'&module='.$module.'&action=editfile&format=php&file='.urlencode($pathtofile).'">'.img_picto($langs->trans("Edit"), 'edit').'</a>';
print '</td></tr>';
print '<tr><td>';
$pathtohook = strtolower($module).'/class/actions_'.strtolower($module).'.class.php';
print '<span class="fa fa-file-o"></span> '.$langs->trans("HooksFile").' : <strong>'.$pathtohook.'</strong>';
print ' <a href="'.$_SERVER['PHP_SELF'].'?tab='.$tab.'&module='.$module.'&action=editfile&format=php&file='.urlencode($pathtohook).'">'.img_picto($langs->trans("Edit"), 'edit').'</a>';
print '<br>';
print '<span class="fa fa-file-o"></span> '.$langs->trans("HooksFile").' : ';
if (dol_is_file($dirins.'/'.$pathtohook))
{
print '<strong>'.$pathtohook.'</strong>';
print '</td><td><a href="'.$_SERVER['PHP_SELF'].'?tab='.$tab.'&module='.$module.'&action=editfile&format=php&file='.urlencode($pathtohook).'">'.img_picto($langs->trans("Edit"), 'edit').'</a></td>';
print '</td><td><a href="'.$_SERVER['PHP_SELF'].'?tab='.$tab.'&module='.$module.'&action=confirm_removefile&format='.$format.'&file='.urlencode($pathtohook).'">'.img_picto($langs->trans("Delete"), 'delete').'</a></td>';
}
else
{
print '<span class="opacitymedium">'.$langs->trans("FileNotYetGenerated").'</span>';
print '</td><td><a href="'.$_SERVER['PHP_SELF'].'?tab='.$tab.'&module='.$module.'&action=inithook&format=php&file='.urlencode($pathtohook).'"><input type="button" class="button" value="'.$langs->trans("Generate").'"></a></td>';
}
print '</tr>';
}
else
{
@@ -2210,24 +2387,31 @@ elseif (! empty($module))
if ($action != 'editfile' || empty($file))
{
print $langs->trans("TriggerDefDesc").'<br>';
print '<span class="opacitymedium">'.$langs->trans("TriggerDefDesc").'</span><br>';
print '<br>';
print '<table>';
if (! empty($triggers))
{
foreach ($triggers as $trigger)
{
$pathtofile = $trigger['relpath'];
print '<tr><td>';
print '<span class="fa fa-file-o"></span> '.$langs->trans("TriggersFile").' : <strong>'.$pathtofile.'</strong>';
print ' <a href="'.$_SERVER['PHP_SELF'].'?tab='.$tab.'&module='.$module.'&action=editfile&format=php&file='.urlencode($pathtofile).'">'.img_picto($langs->trans("Edit"), 'edit').'</a>';
print '<br>';
print '</td><td><a href="'.$_SERVER['PHP_SELF'].'?tab='.$tab.'&module='.$module.'&action=editfile&format=php&file='.urlencode($pathtofile).'">'.img_picto($langs->trans("Edit"), 'edit').'</a></td>';
print '<td><a href="'.$_SERVER['PHP_SELF'].'?tab='.$tab.'&module='.$module.'&action=confirm_removefile&format='.$format.'&file='.urlencode($pathtofile).'">'.img_picto($langs->trans("Delete"), 'delete').'</a></td>';
print '</tr>';
}
}
else
{
print $langs->trans("NoTrigger");
print '<tr><td>';
print '<span class="fa fa-file-o"></span> '.$langs->trans("NoTrigger");
print '</td><td><a href="'.$_SERVER['PHP_SELF'].'?tab='.$tab.'&module='.$module.'&action=inittrigger&format=php"><input type="button" class="button" value="'.$langs->trans("Generate").'"></a></td>';
print '</tr>';
}
print '</table>';
}
else
{
@@ -2264,21 +2448,116 @@ elseif (! empty($module))
if ($action != 'editfile' || empty($file))
{
if (! empty($widget))
print '<span class="opacitymedium">'.$langs->trans("WidgetDesc").'</span><br>';
print '<br>';
print '<table>';
if (! empty($widgets))
{
foreach ($widgets as $widget)
{
$pathtofile = $widget['relpath'];
print '<span class="fa fa-file-o"></span> '.$langs->trans("WidgetFile").' : <strong>'.$pathtofile.'</strong>';
print '<tr><td><span class="fa fa-file-o"></span> '.$langs->trans("WidgetFile").' : <strong>'.$pathtofile.'</strong>';
print ' <a href="'.$_SERVER['PHP_SELF'].'?tab='.$tab.'&module='.$module.'&action=editfile&format=php&file='.urlencode($pathtofile).'">'.img_picto($langs->trans("Edit"), 'edit').'</a>';
print '<br>';
print '</td>';
print '<td><a href="'.$_SERVER['PHP_SELF'].'?tab='.$tab.'&module='.$module.'&action=confirm_removefile&format='.$format.'&file='.urlencode($pathtofile).'">'.img_picto($langs->trans("Delete"), 'delete').'</a></td>';
print '</tr>';
}
}
else
{
print $langs->trans("NoWidget");
print '<tr><td><span class="fa fa-file-o"></span> '.$langs->trans("NoWidget");
print '</td><td><a href="'.$_SERVER['PHP_SELF'].'?tab='.$tab.'&module='.$module.'&action=initwidget&format=php"><input type="button" class="button" value="'.$langs->trans("Generate").'"></a>';
print '</td></tr>';
}
print '</table>';
}
else
{
$fullpathoffile=dol_buildpath($file, 0);
$content = file_get_contents($fullpathoffile);
// New module
print '<form action="'.$_SERVER["PHP_SELF"].'" method="POST">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<input type="hidden" name="action" value="savefile">';
print '<input type="hidden" name="file" value="'.dol_escape_htmltag($file).'">';
print '<input type="hidden" name="tab" value="'.$tab.'">';
print '<input type="hidden" name="module" value="'.$module.'">';
$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 '<br>';
print '<center>';
print '<input type="submit" class="button buttonforacesave" id="savefile" name="savefile" value="'.dol_escape_htmltag($langs->trans("Save")).'">';
print ' &nbsp; ';
print '<input type="submit" class="button" name="cancel" value="'.dol_escape_htmltag($langs->trans("Cancel")).'">';
print '</center>';
print '</form>';
}
}
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 '<span class="opacitymedium">'.$langs->trans("CLIDesc").'</span><br>';
print '<br>';
print '<table>';
if (! empty($clifiles))
{
foreach ($clifiles as $clifile)
{
$pathtofile = $clifile['relpath'];
print '<tr><td><span class="fa fa-file-o"></span> '.$langs->trans("CLIFile").' : <strong>'.$pathtofile.'</strong>';
print '</td><td><a href="'.$_SERVER['PHP_SELF'].'?tab='.$tab.'&module='.$module.'&action=editfile&format=php&file='.urlencode($pathtofile).'">'.img_picto($langs->trans("Edit"), 'edit').'</a></td>';
print '<td><a href="'.$_SERVER['PHP_SELF'].'?tab='.$tab.'&module='.$module.'&action=confirm_removefile&format='.$format.'&file='.urlencode($pathtofile).'">'.img_picto($langs->trans("Delete"), 'delete').'</a></td>';
print '</tr>';
}
}
else
{
print '<tr><td><span class="fa fa-file-o"></span> '.$langs->trans("NoCLIFile");
print '</td><td><a href="'.$_SERVER['PHP_SELF'].'?tab='.$tab.'&module='.$module.'&action=initcli&format=php"><input type="button" class="button" value="'.$langs->trans("Generate").'"></a>';
print '</td></tr>';
}
print '</table>';
}
else
{
@@ -2315,7 +2594,7 @@ elseif (! empty($module))
if ($action != 'editfile' || empty($file))
{
print $langs->trans("CronJobDefDesc", '<a href="'.DOL_URL_ROOT.'/cron/list.php?status=-2">'.$langs->transnoentities('CronList').'</a>').'<br>';
print '<span class="opacitymedium">'.$langs->trans("CronJobDefDesc", '<a href="'.DOL_URL_ROOT.'/cron/list.php?status=-2">'.$langs->transnoentities('CronList').'</a>').'</span><br>';
print '<br>';
print '<span class="fa fa-file-o"></span> '.$langs->trans("DescriptorFile").' : <strong>'.$pathtofile.'</strong>';
@@ -2429,6 +2708,70 @@ elseif (! empty($module))
}
}
if ($tab == 'specifications')
{
if ($action != 'editfile' || empty($file))
{
print '<span class="opacitymedium">'.$langs->trans("SpecDefDesc").'</span><br>';
print '<br>';
$specs=dol_dir_list(dol_buildpath($modulelowercase.'/doc', 0), 'files', 1, '(\.md|\.asciidoc)$', array('\/temp\/'));
print '<table>';
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 '<tr><td>';
print '<span class="fa fa-file-o"></span> '.$langs->trans("SpecificationFile").' : <strong>'.$pathtofile.'</strong>';
print '</td><td><a href="'.$_SERVER['PHP_SELF'].'?tab='.$tab.'&module='.$module.'&action=editfile&format='.$format.'&file='.urlencode($pathtofile).'">'.img_picto($langs->trans("Edit"), 'edit').'</a></td>';
print '<td><a href="'.$_SERVER['PHP_SELF'].'?tab='.$tab.'&module='.$module.'&action=confirm_removefile&format='.$format.'&file='.urlencode($pathtofile).'">'.img_picto($langs->trans("Delete"), 'delete').'</a></td>';
print '</tr>';
}
}
else
{
print '<tr><td>';
print '<span class="fa fa-file-o"></span> '.$langs->trans("FileNotYetGenerated");
print '</td><td><a href="'.$_SERVER['PHP_SELF'].'?tab='.$tab.'&module='.$module.'&action=initdoc&format=php"><input type="button" class="button" value="'.$langs->trans("Generate").'"></a></td>';
print '</tr>';
}
print '</table>';
}
else
{
// Use MD or asciidoc
//print $langs->trans("UseAsciiDocFormat").'<br>';
$fullpathoffile=dol_buildpath($file, 0);
$content = file_get_contents($fullpathoffile);
// New module
print '<form action="'.$_SERVER["PHP_SELF"].'" method="POST">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<input type="hidden" name="action" value="savefile">';
print '<input type="hidden" name="file" value="'.dol_escape_htmltag($file).'">';
print '<input type="hidden" name="tab" value="'.$tab.'">';
print '<input type="hidden" name="module" value="'.$module.'">';
$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 '<br>';
print '<center>';
print '<input type="submit" class="button buttonforacesave" id="savefile" name="savefile" value="'.dol_escape_htmltag($langs->trans("Save")).'">';
print ' &nbsp; ';
print '<input type="submit" class="button" name="cancel" value="'.dol_escape_htmltag($langs->trans("Cancel")).'">';
print '</center>';
print '</form>';
}
}
if ($tab == 'buildpackage')
{
if (! class_exists('ZipArchive') && ! defined('ODTPHP_PATHTOPCLZIP'))

View File

@@ -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.

View File

@@ -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
*

View File

@@ -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',

View File

@@ -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
|===

View File

@@ -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
|===

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.6 KiB

View File

@@ -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
/*

View File

@@ -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)

View File

@@ -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);

View File

@@ -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'];

View File

@@ -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
* @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;

View File

@@ -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

View File

@@ -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-<?php print $left; ?>: <?php print (GETPOST('optioncss', 'aZ09') == 'print'?6:(empty($conf->dol_optimize_smallscreen)?'30':'6')); ?>px;
margin-<?php print $right; ?>: <?php print (GETPOST('optioncss', 'aZ09') == 'print'?6:(empty($conf->dol_optimize_smallscreen)?'29':'6')); ?>px;
margin-<?php print $right; ?>: <?php print (GETPOST('optioncss', 'aZ09') == 'print'?6:(empty($conf->dol_optimize_smallscreen)?'28':'6')); ?>px;
<?php if (! empty($dol_hide_leftmenu)) print 'margin-bottom: 12px;'."\n"; ?>
<?php if (! empty($dol_hide_leftmenu)) print 'margin-top: 12px;'."\n"; ?>
}
@@ -3671,14 +3667,15 @@ label.radioprivate {
}
div.titre {
font-family: <?php print $fontlist ?>;
font-size: 1.1em;
/* font-weight: bold; */
color: rgb(<?php print $colortexttitlenotab; ?>);
text-decoration: none;
padding-top: 5px;
padding-bottom: 5px;
}
div.titre, .secondary {
font-family: <?php print $fontlist ?>;
color: rgb(<?php print $colortexttitlenotab; ?>);
}
#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; }

View File

@@ -1025,10 +1025,6 @@ select.selectarrowonleft option {
div.fiche {
margin-top: <?php print ($dol_hide_topmenu?'12':'6'); ?>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: <?php print $fontlist ?>;
font-size: 14px;
/* font-weight: bold; */
color: rgb(<?php print $colortexttitlenotab; ?>);
text-decoration: none;
padding-top: 5px;
padding-bottom: 5px;
/* text-shadow: 1px 1px 2px #FFFFFF; */
<?php print (empty($conf->dol_optimize_smallscreen)?'':'margin-top: 4px;'); ?>
}
div.titre, .secondary {
font-family: <?php print $fontlist ?>;
color: rgb(<?php print $colortexttitlenotab; ?>);
}
#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; }

View File

@@ -266,7 +266,7 @@ exit($error);
/**
* Show usage of script
*
* @return unknown
* @return void
*/
function usage()
{