From 84447fec353a9bdb11bd9111eb571b8acd0f0aea Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 12 Jul 2013 10:57:49 +0200 Subject: [PATCH 1/4] More complete examples --- htdocs/master.inc.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/master.inc.php b/htdocs/master.inc.php index 9e1c5ad2e14..b39d5216218 100644 --- a/htdocs/master.inc.php +++ b/htdocs/master.inc.php @@ -83,6 +83,7 @@ if (! empty($dolibarr_main_document_root_alt)) print "Should found something like following examples:
\n"; print "\"/extensions\"
\n"; print "\"/extensions1,/extensions2,...\"
\n"; + print "\"/../extensions\"
\n"; print "\"/custom\"
\n"; exit; } From ad8904a4fb2711aeff50448ee97b390256c7f2d0 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 12 Jul 2013 15:10:32 +0200 Subject: [PATCH 2/4] Can add a picto onto line of files list. --- htdocs/core/class/html.formfile.class.php | 63 +++++++++++------------ htdocs/core/lib/files.lib.php | 2 +- 2 files changed, 30 insertions(+), 35 deletions(-) diff --git a/htdocs/core/class/html.formfile.class.php b/htdocs/core/class/html.formfile.class.php index 8f725368f9c..fc87c58cdc4 100644 --- a/htdocs/core/class/html.formfile.class.php +++ b/htdocs/core/class/html.formfile.class.php @@ -184,8 +184,8 @@ class FormFile * Return a string to show the box with list of available documents for object. * This also set the property $this->numoffiles * - * @param string $modulepart propal, facture, facture_fourn, ... - * @param string $filename Sub-directory to scan (Example: '0/1/10', 'FA/DD/MM/YY/9999'). Use '' if $filedir is already complete) + * @param string $modulepart Module the files are related to ('propal', 'facture', 'facture_fourn', 'mymodule', 'mymodule_temp', ...) + * @param string $filename Existing (so sanitized) sub-directory to scan (Example: '0/1/10', 'FA/DD/MM/YY/9999'). Use '' if $filedir is already complete) * @param string $filedir Directory to scan * @param string $urlsource Url of origin page (for return) * @param int $genallowed Generation is allowed (1/0 or array list of templates) @@ -200,9 +200,10 @@ class FormFile * @param string $title Title to show on top of form * @param string $buttonlabel Label on submit button * @param string $codelang Default language code to use on lang combo box if multilang is enabled + * @param string $morepicto Add more HTML content into cell with picto * @return string Output string with HTML array of documents (might be empty string) */ - function showdocuments($modulepart,$filename,$filedir,$urlsource,$genallowed,$delallowed=0,$modelselected='',$allowgenifempty=1,$forcenomultilang=0,$iconPDF=0,$maxfilenamelength=28,$noform=0,$param='',$title='',$buttonlabel='',$codelang='') + function showdocuments($modulepart,$filename,$filedir,$urlsource,$genallowed,$delallowed=0,$modelselected='',$allowgenifempty=1,$forcenomultilang=0,$iconPDF=0,$maxfilenamelength=28,$noform=0,$param='',$title='',$buttonlabel='',$codelang='',$morepicto='') { global $langs,$conf,$hookmanager; global $bc; @@ -220,7 +221,6 @@ class FormFile $out=''; $var=true; - //$filename = dol_sanitizeFileName($filename); //Must be sanitized before calling show_documents $headershown=0; $showempty=0; $i=0; @@ -231,7 +231,7 @@ class FormFile $out.= "\n".''."\n"; //print 'filedir='.$filedir; - // Affiche en-tete tableau + // Show table if ($genallowed) { $modellist=array(); @@ -390,19 +390,6 @@ class FormFile $buttonlabeltoshow=$buttonlabel; if (empty($buttonlabel)) $buttonlabel=$langs->trans('Generate'); - -// Keep this. Used for test with jmobile -/*print ' -
- -
-';*/ - if (empty($noform)) $out.= '
'; $out.= ''; $out.= ''; @@ -448,7 +435,8 @@ class FormFile $out.= ''; // Button - $out.= ''; + $addcolumforpicto=($delallowed || $printer || $morepicto); + $out.= ''; $genbutton = 'hooks['formfile']) { foreach($hookmanager->hooks['formfile'] as $module) @@ -524,22 +511,30 @@ class FormFile $date=(! empty($file['date'])?$file['date']:dol_filemtime($filedir."/".$file["name"])); $out.= ''.dol_print_date($date, 'dayhour').''; - if ($delallowed) + if ($delallowed || $printer || $morepicto) { $out.= ''; - $out.= ''.img_delete().''; - } - // Printer Icon - if ($printer) - { - $out.= ''; - $out.= ' '.img_printer().''; + if ($delallowed) + { + $out.= ''.img_picto($langs->trans("Delete"), 'delete.png').''; + //$out.=''; + } + if ($printer) + { + //$out.= ''; + $out.= ' '.img_picto($langs->trans("Print"),'printer.png').''; + } + if ($morepicto) + { + $out.=$morepicto; + } + $out.=''; } if (is_object($hookmanager)) { diff --git a/htdocs/core/lib/files.lib.php b/htdocs/core/lib/files.lib.php index 02cb6e663e2..e76705a1690 100644 --- a/htdocs/core/lib/files.lib.php +++ b/htdocs/core/lib/files.lib.php @@ -1233,7 +1233,7 @@ function dol_most_recent_file($dir,$regexfilter='',$excludefilter=array('\.meta$ /** * Security check when accessing to a document (used by document.php, viewimage.php and webservices) * - * @param string $modulepart Module of document + * @param string $modulepart Module of document (module, module_user_temp, module_user or module_temp) * @param string $original_file Relative path with filename * @param string $entity Restrict onto entity * @param User $fuser User object (forced) From f009100126e19c7a511a3a3a27c72865a54974e1 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 12 Jul 2013 16:51:31 +0200 Subject: [PATCH 3/4] Fix: Bad column --- htdocs/compta/facture/impayees.php | 1 - 1 file changed, 1 deletion(-) diff --git a/htdocs/compta/facture/impayees.php b/htdocs/compta/facture/impayees.php index 1d7fda3934f..470dfa56ba3 100644 --- a/htdocs/compta/facture/impayees.php +++ b/htdocs/compta/facture/impayees.php @@ -414,7 +414,6 @@ if ($resql) print ''.price($total_paid).''; print ' '; print ' '; - print ' '; print "\n"; } From b5820315f9166f3cf0f56027a19ccadfad4cff36 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 13 Jul 2013 10:34:19 +0200 Subject: [PATCH 4/4] Fix: Correct permissions on files --- dev/initdata/generate-commande.php | 0 dev/initdata/generate-facture.php | 0 dev/initdata/generate-produit.php | 0 dev/initdata/generate-propale.php | 4 +- dev/initdata/generate-societe.php | 0 htdocs/admin/geoipmaxmind.php | 2 +- htdocs/admin/pdf.php | 0 htdocs/admin/proxy.php | 0 htdocs/admin/sms.php | 0 htdocs/admin/system/perf.php | 142 +++++++++--------- htdocs/admin/translation.php | 0 htdocs/admin/workflow.php | 0 htdocs/core/class/CSMSFile.class.php | 0 .../core/class/commondocgenerator.class.php | 0 htdocs/core/class/extrafields.class.php | 0 htdocs/core/class/genericobject.class.php | 0 htdocs/core/class/hookmanager.class.php | 0 htdocs/core/class/html.formfile.class.php | 8 +- htdocs/core/class/html.formsms.class.php | 0 htdocs/core/class/rssparser.class.php | 0 htdocs/core/class/smtps.class.php | 0 htdocs/core/class/vcard.class.php | 0 .../interface_20_all_Logevents.class.php | 0 ...face_20_modPaypal_PaypalWorkflow.class.php | 0 ...e_20_modWorkflow_WorkflowManager.class.php | 0 ...terface_50_modAgenda_ActionsAuto.class.php | 28 ++-- ...interface_50_modLdap_Ldapsynchro.class.php | 0 ..._50_modNotification_Notification.class.php | 0 .../interface_90_all_Demo.class.php-NORUN | 0 htdocs/filefunc.inc.php | 0 htdocs/fourn/commande/index.php | 0 htdocs/fourn/commande/liste.php | 6 +- htdocs/includes/jquery/plugins/flot/Makefile | 24 +-- 33 files changed, 107 insertions(+), 107 deletions(-) mode change 100644 => 100755 dev/initdata/generate-commande.php mode change 100644 => 100755 dev/initdata/generate-facture.php mode change 100644 => 100755 dev/initdata/generate-produit.php mode change 100644 => 100755 dev/initdata/generate-propale.php mode change 100644 => 100755 dev/initdata/generate-societe.php mode change 100755 => 100644 htdocs/admin/pdf.php mode change 100755 => 100644 htdocs/admin/proxy.php mode change 100755 => 100644 htdocs/admin/sms.php mode change 100755 => 100644 htdocs/admin/translation.php mode change 100755 => 100644 htdocs/admin/workflow.php mode change 100755 => 100644 htdocs/core/class/CSMSFile.class.php mode change 100755 => 100644 htdocs/core/class/commondocgenerator.class.php mode change 100755 => 100644 htdocs/core/class/extrafields.class.php mode change 100755 => 100644 htdocs/core/class/genericobject.class.php mode change 100755 => 100644 htdocs/core/class/hookmanager.class.php mode change 100755 => 100644 htdocs/core/class/html.formsms.class.php mode change 100755 => 100644 htdocs/core/class/rssparser.class.php mode change 100755 => 100644 htdocs/core/class/smtps.class.php mode change 100755 => 100644 htdocs/core/class/vcard.class.php mode change 100755 => 100644 htdocs/core/triggers/interface_20_all_Logevents.class.php mode change 100755 => 100644 htdocs/core/triggers/interface_20_modPaypal_PaypalWorkflow.class.php mode change 100755 => 100644 htdocs/core/triggers/interface_20_modWorkflow_WorkflowManager.class.php mode change 100755 => 100644 htdocs/core/triggers/interface_50_modAgenda_ActionsAuto.class.php mode change 100755 => 100644 htdocs/core/triggers/interface_50_modLdap_Ldapsynchro.class.php mode change 100755 => 100644 htdocs/core/triggers/interface_50_modNotification_Notification.class.php mode change 100755 => 100644 htdocs/core/triggers/interface_90_all_Demo.class.php-NORUN mode change 100755 => 100644 htdocs/filefunc.inc.php mode change 100755 => 100644 htdocs/fourn/commande/index.php diff --git a/dev/initdata/generate-commande.php b/dev/initdata/generate-commande.php old mode 100644 new mode 100755 diff --git a/dev/initdata/generate-facture.php b/dev/initdata/generate-facture.php old mode 100644 new mode 100755 diff --git a/dev/initdata/generate-produit.php b/dev/initdata/generate-produit.php old mode 100644 new mode 100755 diff --git a/dev/initdata/generate-propale.php b/dev/initdata/generate-propale.php old mode 100644 new mode 100755 index b0724ecde4f..6d9db265b37 --- a/dev/initdata/generate-propale.php +++ b/dev/initdata/generate-propale.php @@ -143,8 +143,8 @@ while ($i < GEN_NUMBER_PROPAL && $result >= 0) while ($xnbp < $nbp) { $prodid = rand(1, $num_prods); - $product=new Product($db); - $result=$product->fetch($prodids[$prodid]); + $product=new Product($db); + $result=$product->fetch($prodids[$prodid]); $result=$propal->addline($product->description, $product->price, rand(1,5), 0, 0, 0, $prodids[$prodid], 0); if ($result < 0) { diff --git a/dev/initdata/generate-societe.php b/dev/initdata/generate-societe.php old mode 100644 new mode 100755 diff --git a/htdocs/admin/geoipmaxmind.php b/htdocs/admin/geoipmaxmind.php index b06853b4383..fd7704c2858 100644 --- a/htdocs/admin/geoipmaxmind.php +++ b/htdocs/admin/geoipmaxmind.php @@ -90,7 +90,7 @@ if (! empty($conf->global->GEOIPMAXMIND_COUNTRY_DATAFILE)) } else { - if (function_exists('geoip_country_code_by_name')) $geointernal=true; + if (function_exists('geoip_country_code_by_name')) $geointernal=true; } // Mode diff --git a/htdocs/admin/pdf.php b/htdocs/admin/pdf.php old mode 100755 new mode 100644 diff --git a/htdocs/admin/proxy.php b/htdocs/admin/proxy.php old mode 100755 new mode 100644 diff --git a/htdocs/admin/sms.php b/htdocs/admin/sms.php old mode 100755 new mode 100644 diff --git a/htdocs/admin/system/perf.php b/htdocs/admin/system/perf.php index 563bb3e8385..4f24998227a 100644 --- a/htdocs/admin/system/perf.php +++ b/htdocs/admin/system/perf.php @@ -22,8 +22,8 @@ require '../../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/memory.lib.php'; -require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; -require_once DOL_DOCUMENT_ROOT.'/core/lib/geturl.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/core/lib/geturl.lib.php'; $langs->load("admin"); $langs->load("install"); @@ -55,18 +55,18 @@ print $langs->trans("YouMayFindPerfAdviceHere",'http://wiki.dolibarr.org/index.p print '
'; print ''.$langs->trans("XDebug").': '; $test=!function_exists('xdebug_is_enabled'); -if ($test) print img_picto('','tick.png').' '.$langs->trans("NotInstalled"); +if ($test) print img_picto('','tick.png').' '.$langs->trans("NotInstalled"); else { print img_picto('','warning').' '.$langs->trans("XDebugInstalled"); print $langs->trans("MoreInformation").' XDebug admin page'; -} -print '
'; +} +print '
'; // Applicative cache -print '
'; -print ''.$langs->trans("ApplicativeCache").': '; -$test=!empty($conf->memcached->enabled); +print '
'; +print ''.$langs->trans("ApplicativeCache").': '; +$test=!empty($conf->memcached->enabled); if ($test) { if (!empty($conf->global->MEMCACHED_SERVER)) @@ -78,28 +78,28 @@ if ($test) { print img_picto('','warning').' '.$langs->trans("MemcachedModuleAvailableButNotSetup"); } -} -else print img_picto('','warning').' '.$langs->trans("MemcachedNotAvailable"); +} +else print img_picto('','warning').' '.$langs->trans("MemcachedNotAvailable"); print '
'; // OPCode cache -print '
'; +print '
'; print ''.$langs->trans("OPCodeCache").': '; -$test1=function_exists('xcache_info'); +$test1=function_exists('xcache_info'); if ($test1) { print img_picto('','tick.png').' '.$langs->trans("XCacheInstalled"); - print $langs->trans("MoreInformation").' Xcache admin page'; -} + print $langs->trans("MoreInformation").' Xcache admin page'; +} else { $test2=function_exists('eaccelerator_info'); if ($test2) print img_picto('','tick.png').' '.$langs->trans("EAcceleratorInstalled"); else print $langs->trans("NoOPCodeCacheFound"); -} -print '
'; +} +print '
'; -// HTTPCacheStaticResources +// HTTPCacheStaticResources print '