';
print '';
@@ -1130,7 +1133,7 @@ class FormFile
// Show list of documents
if (empty($useinecm)) print load_fiche_titre($langs->trans("AttachedFiles"));
if (empty($url)) $url=$_SERVER["PHP_SELF"];
- print '';
+ print ''."\n";
print '';
$sortref="fullname";
if ($modulepart == 'invoice_supplier') $sortref='level1name';
@@ -1139,7 +1142,7 @@ class FormFile
print_liste_field_titre($langs->trans("Size"),$url,"size","",$param,'align="right"',$sortfield,$sortorder);
print_liste_field_titre($langs->trans("Date"),$url,"date","",$param,'align="center"',$sortfield,$sortorder);
print_liste_field_titre('','','');
- print ' ';
+ print ''."\n";
// To show ref or specific information according to view to show (defined by $module)
if ($modulepart == 'company')
@@ -1275,6 +1278,7 @@ class FormFile
if (! $found > 0 || ! is_object($this->cache_objects[$modulepart.'_'.$id.'_'.$ref])) continue; // We do not show orphelins files
$var=!$var;
+ print ''."\n";
print '';
print '';
if ($found > 0 && is_object($this->cache_objects[$modulepart.'_'.$id.'_'.$ref])) print $this->cache_objects[$modulepart.'_'.$id.'_'.$ref]->getNomUrl(1,'document');
diff --git a/htdocs/core/class/html.formmail.class.php b/htdocs/core/class/html.formmail.class.php
index 47cc7cd9d89..6d88e735770 100644
--- a/htdocs/core/class/html.formmail.class.php
+++ b/htdocs/core/class/html.formmail.class.php
@@ -322,8 +322,8 @@ class FormMail extends Form
// Zone to select its email template
if (count($modelmail_array)>0)
{
- $out.= ''."\n";
- $out.= $langs->trans('SelectMailModel').': '.$this->selectarray('modelmailselected', $modelmail_array, 0, 1);
+ $out.= '
'."\n";
+ $out.= $langs->trans('SelectMailModel').': '.$this->selectarray('modelmailselected', $modelmail_array, 0, 1);
if ($user->admin) $out.= info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"),1);
$out.= ' ';
$out.= '
';
@@ -336,7 +336,7 @@ class FormMail extends Form
'invoice_supplier_send','thirdparty'
)))
{
- $out.= '
'."\n";
+ $out.= '
'."\n";
$out.= $langs->trans('SelectMailModel').':
'.$langs->trans("NoTemplateDefined").' '; // Do not put disabled on option, it is already on select and it makes chrome crazy.
if ($user->admin) $out.= info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"),1);
$out.= ' ';
diff --git a/htdocs/core/class/html.formpropal.class.php b/htdocs/core/class/html.formpropal.class.php
index 2cfeaadd368..14e1a466275 100644
--- a/htdocs/core/class/html.formpropal.class.php
+++ b/htdocs/core/class/html.formpropal.class.php
@@ -101,7 +101,7 @@ class FormPropal
}
print '
';
- if ($showempty) print ' ';
+ if ($showempty) print ' ';
foreach($listofstatus as $key => $obj)
{
@@ -113,7 +113,7 @@ class FormPropal
continue;
}
}
- if ($selected == $obj['id'])
+ if ($selected != '' && $selected == $obj['id'])
{
print '';
}
diff --git a/htdocs/core/lib/admin.lib.php b/htdocs/core/lib/admin.lib.php
index 321a21a9637..5726981586a 100644
--- a/htdocs/core/lib/admin.lib.php
+++ b/htdocs/core/lib/admin.lib.php
@@ -1236,7 +1236,7 @@ function form_constantes($tableau,$strictw3c=0)
else if (in_array($const,array('ADHERENT_AUTOREGISTER_NOTIF_MAIL','ADHERENT_AUTOREGISTER_MAIL','ADHERENT_MAIL_VALID','ADHERENT_MAIL_COTIS','ADHERENT_MAIL_RESIL')))
{
require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
- $doleditor=new DolEditor('constvalue_'.$const.(empty($strictw3c)?'':'[]'),$obj->value,'',160,'dolibarr_notes','',false,false,$conf->fckeditor->enabled,5,60);
+ $doleditor=new DolEditor('constvalue_'.$const.(empty($strictw3c)?'':'[]'),$obj->value,'',160,'dolibarr_notes','',false,false,$conf->fckeditor->enabled,ROWS_5,'90%');
$doleditor->Create();
print ' ';
}
diff --git a/htdocs/core/lib/agenda.lib.php b/htdocs/core/lib/agenda.lib.php
index 57a4c03c63f..ad592359936 100644
--- a/htdocs/core/lib/agenda.lib.php
+++ b/htdocs/core/lib/agenda.lib.php
@@ -68,14 +68,14 @@ function print_actions_filter($form, $canedit, $status, $year, $month, $day, $sh
if (! empty($conf->browser->phone)) print '';
else print '
';
- print '';
+ print '';
if ($canedit)
{
print '';
print '';
print $langs->trans("ActionsToDoBy").' ';
- print ' ';
+ print ' ';
print $form->select_dolusers($filtert, 'usertodo', 1, '', ! $canedit, '', '', 0, 0, 0, '', 0, '', 'maxwidth300');
if (empty($conf->dol_optimize_smallscreen)) print ' '.$langs->trans("or") . ' '.$langs->trans("ToUserOfGroup").' ';
print $form->select_dolgroups($usergroupid, 'usergroup', 1, '', ! $canedit);
@@ -102,7 +102,7 @@ function print_actions_filter($form, $canedit, $status, $year, $month, $day, $sh
print ' ';
print '';
print $langs->trans("Type");
- print ' ';
+ print ' ';
$multiselect=0;
if (! empty($conf->global->MAIN_ENABLE_MULTISELECT_TYPE)) // We use an option here because it adds bugs when used on agenda page "peruser" and "list"
{
@@ -117,7 +117,7 @@ function print_actions_filter($form, $canedit, $status, $year, $month, $day, $sh
print ' ';
print '';
print $langs->trans("ThirdParty").' ';
- print ' ';
+ print ' ';
print $form->select_company($socid, 'socid', '', 1);
print ' ';
}
@@ -130,7 +130,7 @@ function print_actions_filter($form, $canedit, $status, $year, $month, $day, $sh
print '';
print '';
print $langs->trans("Project").' ';
- print ' ';
+ print ' ';
$formproject->select_projects($socid?$socid:-1, $pid, 'projectid', 0);
print ' ';
}
@@ -141,7 +141,7 @@ function print_actions_filter($form, $canedit, $status, $year, $month, $day, $sh
print '';
print '';
print $langs->trans("Status");
- print ' ';
+ print ' ';
$formactions->form_select_status_action('formaction',$status,1,'status',1,2);
print ' ';
}
@@ -151,7 +151,7 @@ function print_actions_filter($form, $canedit, $status, $year, $month, $day, $sh
// Filter on hours
print '';
print ''.$langs->trans("VisibleTimeRange").' ';
- print "";
+ print " ";
print '';
print '
';
if (empty($conf->dol_use_jmobile)) print ' - ';
@@ -164,7 +164,7 @@ function print_actions_filter($form, $canedit, $status, $year, $month, $day, $sh
// Filter on days
print '
';
print ''.$langs->trans("VisibleDaysRange").' ';
- print "";
+ print " ";
print '';
print '
';
if (empty($conf->dol_use_jmobile)) print ' - ';
@@ -186,7 +186,7 @@ function print_actions_filter($form, $canedit, $status, $year, $month, $day, $sh
if (! empty($conf->browser->phone)) print '
';
else print '
';
- print '';
+ print '';
print '';
print ' ';
print '
';
diff --git a/htdocs/core/lib/files.lib.php b/htdocs/core/lib/files.lib.php
index 3d43108e6a3..f67f1a0daf4 100644
--- a/htdocs/core/lib/files.lib.php
+++ b/htdocs/core/lib/files.lib.php
@@ -602,7 +602,7 @@ function dol_move_uploaded_file($src_file, $dest_file, $allowoverwrite, $disable
if (empty($disablevirusscan) && file_exists($src_file) && ! empty($conf->global->MAIN_ANTIVIRUS_COMMAND))
{
if (! class_exists('AntiVir')) {
- require DOL_DOCUMENT_ROOT.'/core/class/antivir.class.php';
+ require_once DOL_DOCUMENT_ROOT.'/core/class/antivir.class.php';
}
$antivir=new AntiVir($db);
$result = $antivir->dol_avscan_file($src_file);
diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php
index 677b619bd02..1e0e4239763 100644
--- a/htdocs/core/lib/functions.lib.php
+++ b/htdocs/core/lib/functions.lib.php
@@ -102,7 +102,14 @@ function getDoliDBInstance($type, $host, $user, $pass, $name, $port)
/**
* Get list of entity id to use
*
- * @param string $element Current element ('actioncomm', ...)
+ * @param string $element Current element
+ * 'societe', 'socpeople', 'actioncomm', 'agenda', 'resource',
+ * 'product', 'productprice', 'stock',
+ * 'propal', 'facture', 'facture_fourn',
+ * 'categorie', 'bank_account', 'bank_account', 'adherent', 'user',
+ * 'commande', 'commande_fournisseur', 'expedition', 'intervention', 'survey',
+ * 'contract', 'tax', 'expensereport', 'holiday', 'multicurrency', 'project',
+ * 'email_template', 'event',
* @param int $shared 0=Return id of entity, 1=Return id entity + shared entities
* @return mixed Entity id(s) to use
*/
@@ -110,6 +117,11 @@ function getEntity($element=false, $shared=0)
{
global $conf, $mc;
+ // For backward compatibilty
+ if ($element == 'actioncomm') $element='agenda';
+ if ($element == 'fichinter') $element='intervention';
+ if ($element == 'categorie') $element='category';
+
if (is_object($mc))
{
return $mc->getEntity($element, $shared);
@@ -619,17 +631,18 @@ function dol_escape_js($stringtoescape, $mode=0, $noescapebackslashn=0)
* Returns text escaped for inclusion in HTML alt or title tags, or into values of HTML input fields.
*
* @param string $stringtoescape String to escape
- * @param int $keepb Do not clean b tags
+ * @param int $keepb 1=Preserve b tags (otherwise, remove them)
+ * @param int $keepn 1=Preserve \r\n strings (otherwise, remove them)
* @return string Escaped string
*
* @see dol_string_nohtmltag
*/
-function dol_escape_htmltag($stringtoescape,$keepb=0)
+function dol_escape_htmltag($stringtoescape, $keepb=0, $keepn=0)
{
// escape quotes and backslashes, newlines, etc.
$tmp=dol_html_entity_decode($stringtoescape,ENT_COMPAT,'UTF-8');
- if ($keepb) $tmp=strtr($tmp, array("\r"=>'\\r',"\n"=>'\\n'));
- else $tmp=strtr($tmp, array("\r"=>'\\r',"\n"=>'\\n',""=>'',' '=>''));
+ if (! $keepb) $tmp=strtr($tmp, array(""=>'',' '=>''));
+ if (! $keepn) $tmp=strtr($tmp, array("\r"=>'\\r',"\n"=>'\\n'));
return dol_htmlentities($tmp,ENT_COMPAT,'UTF-8');
}
@@ -944,8 +957,8 @@ function dol_get_fiche_end($notab=0)
* @param int $nodbprefix Do not include DB prefix to forge table name
* @param string $morehtmlleft More html code to show before ref
* @param string $morehtmlstatus More html code to show under navigation arrows
- * @param string $morehtmlright More html code to show before navigation arrows
* @param int $onlybanner Put this to 1, if the card will contains only a banner
+ * @param string $morehtmlright More html code to show before navigation arrows
* @return void
*/
function dol_banner_tab($object, $paramid, $morehtml='', $shownav=1, $fieldid='rowid', $fieldref='ref', $morehtmlref='', $moreparam='', $nodbprefix=0, $morehtmlleft='', $morehtmlstatus='', $onlybanner=0, $morehtmlright='')
@@ -1042,6 +1055,12 @@ function dol_banner_tab($object, $paramid, $morehtml='', $shownav=1, $fieldid='r
if (empty($tmptxt) || $tmptxt == $object->getLibStatut(3) || $conf->browser->layout=='phone') $tmptxt=$object->getLibStatut(5, $object->totalpaye);
$morehtmlstatus.=$tmptxt;
}
+ elseif ($object->element == 'chargesociales')
+ {
+ $tmptxt=$object->getLibStatut(6, $object->totalpaye);
+ if (empty($tmptxt) || $tmptxt == $object->getLibStatut(3) || $conf->browser->layout=='phone') $tmptxt=$object->getLibStatut(5, $object->totalpaye);
+ $morehtmlstatus.=$tmptxt;
+ }
elseif ($object->element == 'facturerec')
{
$morehtmlstatus.='';
@@ -3144,7 +3163,7 @@ function load_fiche_titre($titre, $morehtmlright='', $picto='title_generic.png',
* @param string $options More parameters for links ('' by default, does not include sortfield neither sortorder)
* @param string $sortfield Field to sort on ('' by default)
* @param string $sortorder Order to sort ('' by default)
- * @param string $center Strin gin the middle ('' by default). We often find here string $massaction comming from $form->selectMassAction()
+ * @param string $center String in the middle ('' by default). We often find here string $massaction comming from $form->selectMassAction()
* @param int $num Number of records found by select with limit+1
* @param int $totalnboflines Total number of records/lines for all pages (if known). Use a negative value to not show number.
* @param string $picto Icon to use before title (should be a 32x32 transparent png file)
@@ -3155,7 +3174,7 @@ function load_fiche_titre($titre, $morehtmlright='', $picto='title_generic.png',
* @param int $hideselectlimit Force to hide select limit
* @return void
*/
-function print_barre_liste($titre, $page, $file, $options='', $sortfield='', $sortorder='', $center='', $num=-1, $totalnboflines=0, $picto='title_generic.png', $pictoisfullpath=0, $morehtml='', $morecss='', $limit=-1, $hideselectlimit=0)
+function print_barre_liste($titre, $page, $file, $options='', $sortfield='', $sortorder='', $center='', $num=-1, $totalnboflines=-1, $picto='title_generic.png', $pictoisfullpath=0, $morehtml='', $morecss='', $limit=-1, $hideselectlimit=0)
{
global $conf,$langs;
@@ -3185,7 +3204,7 @@ function print_barre_liste($titre, $page, $file, $options='', $sortfield='', $so
print ' ';
if ($picto && $titre) print img_picto('', $picto, 'class="hideonsmartphone valignmiddle" id="pictotitle"', $pictoisfullpath);
print ''.$titre;
- if (!empty($titre) && $savtotalnboflines > 0) print ' ('.$totalnboflines.')';
+ if (!empty($titre) && $savtotalnboflines >= 0) print ' ('.$totalnboflines.')';
print '
';
// Center
@@ -3475,7 +3494,7 @@ function price($amount, $form=0, $outlangs='', $trunc=1, $rounding=-1, $forcerou
* @param string $rounding ''=No rounding
* 'MU'=Round to Max unit price (MAIN_MAX_DECIMALS_UNIT)
* 'MT'=Round to Max for totals with Tax (MAIN_MAX_DECIMALS_TOT)
- * 'MS'=Round to Max Shown (MAIN_MAX_DECIMALS_SHOWN)
+ * 'MS'=Round to Max for stock quantity (MAIN_MAX_DECIMALS_STOCK)
* @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.
*
@@ -3525,7 +3544,7 @@ function price2num($amount,$rounding='',$alreadysqlnb=0)
$nbofdectoround='';
if ($rounding == 'MU') $nbofdectoround=$conf->global->MAIN_MAX_DECIMALS_UNIT;
elseif ($rounding == 'MT') $nbofdectoround=$conf->global->MAIN_MAX_DECIMALS_TOT;
- elseif ($rounding == 'MS') $nbofdectoround=$conf->global->MAIN_MAX_DECIMALS_SHOWN;
+ elseif ($rounding == 'MS') $nbofdectoround=empty($conf->global->MAIN_MAX_DECIMALS_STOCK)?5:$conf->global->MAIN_MAX_DECIMALS_STOCK;
elseif (is_numeric($rounding)) $nbofdectoround=$rounding; // For admin info page
//print "RR".$amount.' - '.$nbofdectoround.' ';
if (dol_strlen($nbofdectoround)) $amount = round($amount,$nbofdectoround); // $nbofdectoround can be 0.
@@ -4003,7 +4022,7 @@ function get_product_localtax_for_country($idprod, $local, $thirdparty_seller)
global $db,$mysoc;
if (! class_exists('Product')) {
- require DOL_DOCUMENT_ROOT . '/product/class/product.class.php';
+ require_once DOL_DOCUMENT_ROOT . '/product/class/product.class.php';
}
$ret=0;
@@ -4160,7 +4179,7 @@ function get_default_npr(Societe $thirdparty_seller, Societe $thirdparty_buyer,
if ($idprodfournprice > 0)
{
if (! class_exists('ProductFournisseur'))
- require DOL_DOCUMENT_ROOT . '/fourn/class/fournisseur.product.class.php';
+ require_once DOL_DOCUMENT_ROOT . '/fourn/class/fournisseur.product.class.php';
$prodprice = new ProductFournisseur($db);
$prodprice->fetch_product_fournisseur_price($idprodfournprice);
return $prodprice->fourn_tva_npr;
@@ -4168,7 +4187,7 @@ function get_default_npr(Societe $thirdparty_seller, Societe $thirdparty_buyer,
elseif ($idprod > 0)
{
if (! class_exists('Product'))
- require DOL_DOCUMENT_ROOT . '/product/class/product.class.php';
+ require_once DOL_DOCUMENT_ROOT . '/product/class/product.class.php';
$prod = new Product($db);
$prod->fetch($idprod);
return $prod->tva_npr;
@@ -4395,7 +4414,7 @@ function picto_required()
* Clean a string from all HTML tags and entities
*
* @param string $StringHtml String to clean
- * @param integer $removelinefeed 1=Replace also all lines feeds by a space, 0=Only last one are removed
+ * @param integer $removelinefeed 1=Replace also new lines by a space, 0=Only last one are removed
* @param string $pagecodeto Encoding of input/output string
* @return string String cleaned
*
@@ -4404,6 +4423,7 @@ function picto_required()
function dol_string_nohtmltag($StringHtml,$removelinefeed=1,$pagecodeto='UTF-8')
{
$pattern = "/<[^<>]+>/";
+ $StringHtml = preg_replace('/ ]*>/', "\n", $StringHtml);
$temp = dol_html_entity_decode($StringHtml,ENT_COMPAT,$pagecodeto);
$temp = preg_replace($pattern,"",$temp);
@@ -4425,7 +4445,7 @@ function dol_string_nohtmltag($StringHtml,$removelinefeed=1,$pagecodeto='UTF-8')
*
* @param string $text Input text
* @return string Output text
- * @see dol_nboflines_bis
+ * @see dol_nboflines_bis, dol_string_nohtmltag, dol_escape_htmltag
*/
function dolGetFirstLineOfText($text)
{
@@ -5486,11 +5506,14 @@ function printCommonFooter($zone='private')
});'."\n";
print '});'."\n";
- print ''."\n";
- print 'jQuery(".menuhider").click(function() {';
- print " $('.side-nav').toggle();";
- if ($conf->theme == 'md') print " $('.login_block').toggle();";
- print '});'."\n";
+ if (empty($conf->dol_use_jmobile))
+ {
+ print ''."\n";
+ print 'jQuery(".menuhider").click(function() {';
+ print " $('.side-nav').toggle();";
+ if ($conf->theme == 'md') print " $('.login_block').toggle();";
+ print '});'."\n";
+ }
print ''."\n";
}
diff --git a/htdocs/core/menus/init_menu_auguria.sql b/htdocs/core/menus/init_menu_auguria.sql
index bb53a0dd1da..84f61145de7 100644
--- a/htdocs/core/menus/init_menu_auguria.sql
+++ b/htdocs/core/menus/init_menu_auguria.sql
@@ -20,7 +20,7 @@ insert into llx_menu (module, enabled, rowid, menu_handler, type, mainmenu, left
insert into llx_menu (module, enabled, rowid, menu_handler, type, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('hrm|holiday|deplacement|expensereport', '$conf->hrm->enabled || $conf->holiday->enabled || $conf->deplacement->enabled || $conf->expensereport->enabled', 15__+MAX_llx_menu__, __HANDLER__, 'top', 'hrm', '', 0, '/hrm/index.php?mainmenu=hrm&leftmenu=', 'HRM', -1, 'holiday', '$user->rights->hrm->employee->read || $user->rights->holiday->write || $user->rights->deplacement->lire || $user->rights->expensereport->lire', '', 0, 80, __ENTITY__);
-- Home - Dashboard
-insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '1', __HANDLER__, 'left', 90__+MAX_llx_menu__, 'home', '', 1__+MAX_llx_menu__, '/index.php', 'Dashboard', 0, '', '', '', 2, 0, __ENTITY__);
+insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '1', __HANDLER__, 'left', 90__+MAX_llx_menu__, 'home', '', 1__+MAX_llx_menu__, '/index.php', 'MyDashboard', 0, '', '', '', 2, 0, __ENTITY__);
-- Home - Setup
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$user->admin', __HANDLER__, 'left', 100__+MAX_llx_menu__, 'home', 'setup', 1__+MAX_llx_menu__, '/admin/index.php?leftmenu=setup', 'Setup', 0, 'admin', '', '', 2, 1, __ENTITY__);
diff --git a/htdocs/core/menus/standard/eldy.lib.php b/htdocs/core/menus/standard/eldy.lib.php
index 629db07eb77..ec39ba35302 100644
--- a/htdocs/core/menus/standard/eldy.lib.php
+++ b/htdocs/core/menus/standard/eldy.lib.php
@@ -508,7 +508,7 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu
$langs->load("users");
// Home - dashboard
- $newmenu->add("/index.php?mainmenu=home&leftmenu=home", $langs->trans("Dashboard"), 0, 1, '', $mainmenu, 'home');
+ $newmenu->add("/index.php?mainmenu=home&leftmenu=home", $langs->trans("MyDashboard"), 0, 1, '', $mainmenu, 'home');
// Setup
$newmenu->add("/admin/index.php?mainmenu=home&leftmenu=setup", $langs->trans("Setup"), 0, $user->admin, '', $mainmenu, 'setup');
diff --git a/htdocs/core/modules/DolibarrModules.class.php b/htdocs/core/modules/DolibarrModules.class.php
index dbb8f9b3f01..efb2ec646c8 100644
--- a/htdocs/core/modules/DolibarrModules.class.php
+++ b/htdocs/core/modules/DolibarrModules.class.php
@@ -1507,7 +1507,7 @@ class DolibarrModules // Can not be abstract, because we need to insta
if ($reinitadminperms)
{
if (! class_exists('User')) {
- require DOL_DOCUMENT_ROOT . '/user/class/user.class.php';
+ require_once DOL_DOCUMENT_ROOT . '/user/class/user.class.php';
}
$sql="SELECT rowid FROM ".MAIN_DB_PREFIX."user WHERE admin = 1";
dol_syslog(get_class($this)."::insert_permissions Search all admin users", LOG_DEBUG);
diff --git a/htdocs/core/modules/import/import_csv.modules.php b/htdocs/core/modules/import/import_csv.modules.php
index 89b2230d4e7..fed4489c9db 100644
--- a/htdocs/core/modules/import/import_csv.modules.php
+++ b/htdocs/core/modules/import/import_csv.modules.php
@@ -381,7 +381,12 @@ class ImportCsv extends ModeleImports
}
else
{
- dol_include_once($file);
+ $resultload = dol_include_once($file);
+ if (empty($resultload))
+ {
+ dol_print_error('', 'Error trying to call file='.$file.', class='.$class.', method='.$method);
+ break;
+ }
$classinstance=new $class($this->db);
// Try the fetch from code or ref
call_user_func_array(array($classinstance, $method),array('', $newval));
@@ -454,6 +459,22 @@ class ImportCsv extends ModeleImports
}
if (empty($newval)) $arrayrecord[($key-1)]['type']=-1; // If we get empty value, we will use "null"
}
+ elseif ($objimport->array_import_convertvalue[0][$val]['rule']=='getrefifauto')
+ {
+ $defaultref='';
+ // TODO provide the $modTask (module of generation of ref) as parameter of import_insert function
+ $obj = empty($conf->global->PROJECT_TASK_ADDON)?'mod_task_simple':$conf->global->PROJECT_TASK_ADDON;
+ if (! empty($conf->global->PROJECT_TASK_ADDON) && is_readable(DOL_DOCUMENT_ROOT ."/core/modules/project/task/".$conf->global->PROJECT_TASK_ADDON.".php"))
+ {
+ require_once DOL_DOCUMENT_ROOT ."/core/modules/project/task/".$conf->global->PROJECT_TASK_ADDON.'.php';
+ $modTask = new $obj;
+ $defaultref = $modTask->getNextValue(null,null);
+ }
+ if (is_numeric($defaultref) && $defaultref <= 0) $defaultref='';
+ $newval=$defaultref;
+ }
+
+
elseif ($objimport->array_import_convertvalue[0][$val]['rule']=='numeric')
{
$newval = price2num($newval);
diff --git a/htdocs/core/modules/livraison/doc/pdf_typhon.modules.php b/htdocs/core/modules/livraison/doc/pdf_typhon.modules.php
index ed0d537d736..1f8e06eb04d 100644
--- a/htdocs/core/modules/livraison/doc/pdf_typhon.modules.php
+++ b/htdocs/core/modules/livraison/doc/pdf_typhon.modules.php
@@ -315,9 +315,9 @@ class pdf_typhon extends ModelePDFDeliveryOrder
$height_note=0;
}
- $iniY = $tab_top + 7;
- $curY = $tab_top + 7;
- $nexY = $tab_top + 7;
+ $iniY = $tab_top + 11;
+ $curY = $tab_top + 11;
+ $nexY = $tab_top + 11;
// Loop on each lines
for ($i = 0 ; $i < $nblines ; $i++)
@@ -637,7 +637,7 @@ class pdf_typhon extends ModelePDFDeliveryOrder
if (empty($hidetop))
{
- $pdf->line($this->marge_gauche, $tab_top+6, $this->page_largeur-$this->marge_droite, $tab_top+6);
+ $pdf->line($this->marge_gauche, $tab_top+10, $this->page_largeur-$this->marge_droite, $tab_top+10);
}
$pdf->SetDrawColor(128,128,128);
diff --git a/htdocs/core/modules/mailings/modules_mailings.php b/htdocs/core/modules/mailings/modules_mailings.php
index c75e22ed334..16b930e8907 100644
--- a/htdocs/core/modules/mailings/modules_mailings.php
+++ b/htdocs/core/modules/mailings/modules_mailings.php
@@ -33,7 +33,8 @@ class MailingTargets // This can't be abstract as it is used for some method
{
var $db;
var $error;
-
+ var $tooltip='';
+
/**
* Constructor
@@ -52,11 +53,16 @@ class MailingTargets // This can't be abstract as it is used for some method
*/
function getDesc()
{
- global $langs;
+ global $langs, $form;
+
$langs->load("mails");
$transstring="MailingModuleDesc".$this->name;
- if ($langs->trans($transstring) != $transstring) return $langs->trans($transstring);
- else return $this->desc;
+ $s='';
+ if ($langs->trans($transstring) != $transstring) $s=$langs->trans($transstring);
+ else $s=$this->desc;
+
+ if ($this->tooltip && is_object($form)) $s .= ' '.$form->textwithpicto('', $langs->trans($this->tooltip), 1, 1);
+ return $s;
}
/**
diff --git a/htdocs/core/modules/mailings/xinputfile.modules.php b/htdocs/core/modules/mailings/xinputfile.modules.php
index 7b6f8361d24..04c4be3ce2e 100644
--- a/htdocs/core/modules/mailings/xinputfile.modules.php
+++ b/htdocs/core/modules/mailings/xinputfile.modules.php
@@ -31,12 +31,11 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
class mailing_xinputfile extends MailingTargets
{
var $name='EmailsFromFile'; // Identifiant du module mailing
- var $desc='EMails issus d\'un fichier'; // Libelle utilise si aucune traduction pour MailingModuleDescXXX ou XXX=name trouv�e
+ var $desc='EMails from a file'; // Libelle utilise si aucune traduction pour MailingModuleDescXXX ou XXX=name trouv�e
var $require_module=array(); // Module mailing actif si modules require_module actifs
var $require_admin=0; // Module mailing actif pour user admin ou non
var $picto='generic';
-
- var $db;
+ var $tooltip='UseFormatFileEmailToTarget';
/**
diff --git a/htdocs/core/modules/mailings/xinputuser.modules.php b/htdocs/core/modules/mailings/xinputuser.modules.php
index 7832d1f6a93..4c5567f574d 100644
--- a/htdocs/core/modules/mailings/xinputuser.modules.php
+++ b/htdocs/core/modules/mailings/xinputuser.modules.php
@@ -35,9 +35,8 @@ class mailing_xinputuser extends MailingTargets
var $require_module=array(); // Module mailing actif si modules require_module actifs
var $require_admin=0; // Module mailing actif pour user admin ou non
var $picto='generic';
-
- var $db;
-
+ var $tooltip='UseFormatInputEmailToTarget';
+
/**
* Constructor
@@ -104,7 +103,7 @@ class mailing_xinputuser extends MailingTargets
global $langs;
$s='';
- $s.=' ';
+ $s.=' ';
return $s;
}
diff --git a/htdocs/core/modules/modBanque.class.php b/htdocs/core/modules/modBanque.class.php
index d3c28b246df..a868bfd2f08 100644
--- a/htdocs/core/modules/modBanque.class.php
+++ b/htdocs/core/modules/modBanque.class.php
@@ -162,7 +162,7 @@ class modBanque extends DolibarrModules
$this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX."bank_url as bu ON (bu.fk_bank = b.rowid AND bu.type = 'company')";
$this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'societe as s ON bu.url_id = s.rowid';
$this->export_sql_end[$r] .=' WHERE ba.rowid = b.fk_account';
- $this->export_sql_end[$r] .=' AND ba.entity IN ('.getEntity('bank',1).')';
+ $this->export_sql_end[$r] .=' AND ba.entity IN ('.getEntity('bank_account',1).')';
$this->export_sql_order[$r] =' ORDER BY b.datev, b.num_releve';
$r++;
@@ -189,7 +189,7 @@ class modBanque extends DolibarrModules
$this->export_sql_end[$r] .=' WHERE ba.rowid = b.fk_account AND bch.rowid = b.fk_bordereau and bch.fk_bank_account=ba.rowid';
$this->export_sql_end[$r] .=" AND b.fk_type = 'CHQ'";
$this->export_sql_end[$r] .=' AND p.fk_paiement = 7';
- $this->export_sql_end[$r] .=' AND ba.entity IN ('.getEntity('bank',1).')';
+ $this->export_sql_end[$r] .=' AND ba.entity IN ('.getEntity('bank_account',1).')';
$this->export_sql_order[$r] =' ORDER BY b.datev, b.num_releve';
}
diff --git a/htdocs/core/modules/modExpedition.class.php b/htdocs/core/modules/modExpedition.class.php
index 29825cb995d..eec7cd174cd 100644
--- a/htdocs/core/modules/modExpedition.class.php
+++ b/htdocs/core/modules/modExpedition.class.php
@@ -277,7 +277,7 @@ class modExpedition extends DolibarrModules
$this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'socpeople_extrafields as extra3 ON sp.rowid = extra3.fk_object';
}
$this->export_sql_end[$r] .=' WHERE c.fk_soc = s.rowid AND c.rowid = ed.fk_expedition AND ed.fk_origin_line = cd.rowid';
- $this->export_sql_end[$r] .=' AND c.entity IN ('.getEntity('shipment',1).')';
+ $this->export_sql_end[$r] .=' AND c.entity IN ('.getEntity('expedition',1).')';
if(!$user->rights->societe->client->voir) $this->export_sql_end[$r] .=' AND sc.fk_user = '.$user->id;
}
diff --git a/htdocs/core/modules/modFournisseur.class.php b/htdocs/core/modules/modFournisseur.class.php
index 2999bddd1bd..c0203f7e490 100644
--- a/htdocs/core/modules/modFournisseur.class.php
+++ b/htdocs/core/modules/modFournisseur.class.php
@@ -380,7 +380,7 @@ class modFournisseur extends DolibarrModules
$this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'facture_fourn_det_extrafields as extraline ON fd.rowid = extraline.fk_object';
$this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'product as p on (fd.fk_product = p.rowid)';
$this->export_sql_end[$r] .=' WHERE f.fk_soc = s.rowid AND f.rowid = fd.fk_facture_fourn';
- $this->export_sql_end[$r] .=' AND f.entity IN ('.getEntity('supplier_invoice',1).')';
+ $this->export_sql_end[$r] .=' AND f.entity IN ('.getEntity('facture_fournisseur',1).')';
if(!$user->rights->societe->client->voir) $this->export_sql_end[$r] .=' AND sc.fk_user = '.$user->id;
$r++;
@@ -443,7 +443,7 @@ class modFournisseur extends DolibarrModules
$this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'paiementfourn_facturefourn as pf ON pf.fk_facturefourn = f.rowid';
$this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'paiementfourn as p ON pf.fk_paiementfourn = p.rowid';
$this->export_sql_end[$r] .=' WHERE f.fk_soc = s.rowid';
- $this->export_sql_end[$r] .=' AND f.entity IN ('.getEntity('supplier_invoice',1).')';
+ $this->export_sql_end[$r] .=' AND f.entity IN ('.getEntity('facture_fournisseur',1).')';
if(!$user->rights->societe->client->voir) $this->export_sql_end[$r] .=' AND sc.fk_user = '.$user->id;
// Order
@@ -552,7 +552,7 @@ class modFournisseur extends DolibarrModules
$this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'commande_fournisseurdet_extrafields as extraline ON fd.rowid = extraline.fk_object';
$this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'product as p on (fd.fk_product = p.rowid)';
$this->export_sql_end[$r] .=' WHERE f.fk_soc = s.rowid AND f.rowid = fd.fk_commande';
- $this->export_sql_end[$r] .=' AND f.entity IN ('.getEntity('supplier_order',1).')';
+ $this->export_sql_end[$r] .=' AND f.entity IN ('.getEntity('commande_fournisseur',1).')';
if(!$user->rights->societe->client->voir) $this->export_sql_end[$r] .=' AND sc.fk_user = '.$user->id;
}
diff --git a/htdocs/core/modules/modProjet.class.php b/htdocs/core/modules/modProjet.class.php
index ea7e93924ed..30404a02699 100644
--- a/htdocs/core/modules/modProjet.class.php
+++ b/htdocs/core/modules/modProjet.class.php
@@ -206,7 +206,7 @@ class modProjet extends DolibarrModules
// Menus
//-------
$this->menu = 1; // This module add menu entries. They are coded into menu manager.
-
+
//Exports
//--------
@@ -322,6 +322,40 @@ class modProjet extends DolibarrModules
$this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX."projet_task_time as ptt ON pt.rowid = ptt.fk_task";
$this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'societe as s ON p.fk_soc = s.rowid';
$this->export_sql_end[$r] .=' WHERE p.entity = '.$conf->entity;
+
+
+ // Import list of tasks
+ if (empty($conf->global->PROJECT_HIDE_TASKS))
+ {
+ $r++;
+ $this->import_code[$r]='tasksofprojects';
+ $this->import_label[$r]='ImportDatasetTasks';
+ $this->import_icon[$r]='task';
+ $this->import_entities_array[$r]=array('t.fk_projet'=>'project'); // We define here only fields that use another icon that the one defined into import_icon
+ $this->import_tables_array[$r]=array('t'=>MAIN_DB_PREFIX.'projet_task','extra'=>MAIN_DB_PREFIX.'projet_task_extrafields'); // List of tables to insert into (insert done in same order)
+ $this->import_fields_array[$r]=array('t.fk_projet'=>'ProjectRef*','t.ref'=>'RefTask*','t.label'=>'LabelTask*','t.dateo'=>"DateStart",'t.datee'=>"DateEnd",'t.planned_workload'=>"PlannedWorkload",'t.progress'=>"Progress",'t.note_private'=>"NotePrivate",'t.note_public'=>"NotePublic",'t.datec'=>"DateCreation");
+ // Add extra fields
+ $sql="SELECT name, label, fieldrequired FROM ".MAIN_DB_PREFIX."extrafields WHERE elementtype = 'projet_task' AND entity = ".$conf->entity;
+ $resql=$this->db->query($sql);
+ if ($resql) // This can fail when class is used on old database (during migration for example)
+ {
+ while ($obj=$this->db->fetch_object($resql))
+ {
+ $fieldname='extra.'.$obj->name;
+ $fieldlabel=ucfirst($obj->label);
+ $this->import_fields_array[$r][$fieldname]=$fieldlabel.($obj->fieldrequired?'*':'');
+ }
+ }
+ // End add extra fields
+ $this->import_fieldshidden_array[$r]=array('t.fk_user_creat'=>'user->id','extra.fk_object'=>'lastrowid-'.MAIN_DB_PREFIX.'projet_task'); // aliastable.field => ('user->id' or 'lastrowid-'.tableparent)
+ $this->import_convertvalue_array[$r]=array(
+ 't.fk_projet'=>array('rule'=>'fetchidfromref','classfile'=>'/projet/class/project.class.php','class'=>'Project','method'=>'fetch','element'=>'Project'),
+ 't.ref'=>array('rule'=>'getrefifauto')
+ );
+ //$this->import_convertvalue_array[$r]=array('s.fk_soc'=>array('rule'=>'lastrowid',table='t');
+ $this->import_regex_array[$r]=array('t.dateo'=>'^[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]$','t.datee'=>'^[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]$','t.datec'=>'^[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]( [0-9][0-9]:[0-9][0-9]:[0-9][0-9])?$');
+ $this->import_examplevalues_array[$r]=array('t.fk_projet'=>'MyProjectRef','t.ref'=>"auto or TK2010-1234",'t.label'=>"My task",'t.progress'=>"0 (not started) to 100 (finished)",'t.datec'=>'1972-10-10','t.note_private'=>"My private note",'t.note_public'=>"My public note");
+ }
}
diff --git a/htdocs/core/modules/modSociete.class.php b/htdocs/core/modules/modSociete.class.php
index 737bb8e3bf5..1943e3f7b20 100644
--- a/htdocs/core/modules/modSociete.class.php
+++ b/htdocs/core/modules/modSociete.class.php
@@ -242,12 +242,12 @@ class modSociete extends DolibarrModules
$this->rights[$r][4] = 'contact';
$this->rights[$r][5] = 'export';
-
+
// Menus
//-------
$this->menu = 1; // This module add menu entries. They are coded into menu manager.
-
-
+
+
// Exports
//--------
$r=0;
@@ -282,7 +282,7 @@ class modSociete extends DolibarrModules
$this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'c_paiement as paymode ON s.mode_reglement = paymode.id';
$this->export_sql_end[$r] .=' WHERE s.entity IN ('.getEntity('societe', 1).')';
if(!$user->rights->societe->client->voir) $this->export_sql_end[$r] .=' AND sc.fk_user = '.$user->id;
-
+
// Export list of contacts and attributes
$r++;
$this->export_code[$r]=$this->rights_class.'_'.$r;
@@ -300,9 +300,12 @@ class modSociete extends DolibarrModules
}
$keyforselect='socpeople'; $keyforelement='contact'; $keyforaliasextra='extra';
include DOL_DOCUMENT_ROOT.'/core/extrafieldsinexport.inc.php';
+ $keyforselect='societe'; $keyforelement='company'; $keyforaliasextra='extrasoc';
+ include DOL_DOCUMENT_ROOT.'/core/extrafieldsinexport.inc.php';
$this->export_sql_start[$r]='SELECT DISTINCT ';
$this->export_sql_end[$r] =' FROM '.MAIN_DB_PREFIX.'socpeople as c';
$this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'societe as s ON c.fk_soc = s.rowid';
+ $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'societe_extrafields as extrasoc ON s.rowid = extrasoc.fk_object';
if(!$user->rights->societe->client->voir) $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'societe_commerciaux as sc ON sc.fk_soc = s.rowid';
$this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'c_departements as d ON c.fk_departement = d.rowid';
$this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'c_country as co ON c.fk_pays = co.rowid';
@@ -402,7 +405,7 @@ class modSociete extends DolibarrModules
'sr.code_banque'=>"0000", 'sr.code_guichet'=>"1111",'sr.number'=>"3333333333",
'sr.cle_rib'=>"22",'sr.bic'=>"USHINGMMXXX",'sr.iban_prefix'=>"US00 0000 1111 22 3333 3333"
);
-
+
// Import Company Salesman
$r++;
$this->import_code[$r]=$this->rights_class.'_'.$r;
@@ -411,7 +414,7 @@ class modSociete extends DolibarrModules
$this->import_entities_array[$r]=array('sr.fk_user'=>'user'); // We define here only fields that use another icon that the one defined into import_icon
$this->import_tables_array[$r]=array('sr'=>MAIN_DB_PREFIX.'societe_commerciaux');
$this->import_fields_array[$r]=array('sr.fk_soc'=>"ThirdPartyName*",'sr.fk_user'=>"User*");
-
+
$this->import_convertvalue_array[$r]=array(
'sr.fk_soc'=>array('rule'=>'fetchidfromref','classfile'=>'/societe/class/societe.class.php','class'=>'Societe','method'=>'fetch','element'=>'ThirdParty'),
'sr.fk_user'=>array('rule'=>'fetchidfromref','classfile'=>'/user/class/user.class.php','class'=>'User','method'=>'fetch','element'=>'User')
diff --git a/htdocs/core/modules/project/task/mod_task_simple.php b/htdocs/core/modules/project/task/mod_task_simple.php
index 0e7b416d72e..97203d402d5 100644
--- a/htdocs/core/modules/project/task/mod_task_simple.php
+++ b/htdocs/core/modules/project/task/mod_task_simple.php
@@ -101,10 +101,10 @@ class mod_task_simple extends ModeleNumRefTask
* Return next value
*
* @param Societe $objsoc Object third party
- * @param Task $task Object Task
+ * @param Task $object Object Task
* @return string Value if OK, 0 if KO
*/
- function getNextValue($objsoc,$task)
+ function getNextValue($objsoc,$object)
{
global $db,$conf;
@@ -127,7 +127,7 @@ class mod_task_simple extends ModeleNumRefTask
return -1;
}
- $date=empty($task->date_c)?dol_now():$task->date_c;
+ $date=empty($object->date_c)?dol_now():$object->date_c;
//$yymm = strftime("%y%m",time());
$yymm = strftime("%y%m",$date);
@@ -144,12 +144,12 @@ class mod_task_simple extends ModeleNumRefTask
* Return next reference not yet used as a reference
*
* @param Societe $objsoc Object third party
- * @param Task $task Object task
+ * @param Task $object Object task
* @return string Next not used reference
*/
- function task_get_num($objsoc=0,$task='')
+ function task_get_num($objsoc=0,$object='')
{
- return $this->getNextValue($objsoc,$task);
+ return $this->getNextValue($objsoc,$object);
}
}
diff --git a/htdocs/core/modules/project/task/mod_task_universal.php b/htdocs/core/modules/project/task/mod_task_universal.php
index 529814079c1..d89acb22b06 100644
--- a/htdocs/core/modules/project/task/mod_task_universal.php
+++ b/htdocs/core/modules/project/task/mod_task_universal.php
@@ -102,10 +102,10 @@ class mod_task_universal extends ModeleNumRefTask
* Return next value
*
* @param Societe $objsoc Object third party
- * @param Project $project Object project
+ * @param Task $object Object task
* @return string Value if OK, 0 if KO
*/
- function getNextValue($objsoc,$project)
+ function getNextValue($objsoc,$object)
{
global $db,$conf;
@@ -120,8 +120,8 @@ class mod_task_universal extends ModeleNumRefTask
return 0;
}
- $date=empty($project->date_c)?dol_now():$project->date_c;
- $numFinal=get_next_value($db,$mask,'projet_task','ref','',$objsoc->code_client,$date);
+ $date=empty($object->date_c)?dol_now():$object->date_c;
+ $numFinal=get_next_value($db,$mask,'projet_task','ref','',(is_object($objsoc)?$objsoc->code_client:''),$date);
return $numFinal;
}
@@ -131,12 +131,12 @@ class mod_task_universal extends ModeleNumRefTask
* Return next reference not yet used as a reference
*
* @param Societe $objsoc Object third party
- * @param Project $project Object project
+ * @param Task $object Object task
* @return string Next not used reference
*/
- function project_get_num($objsoc=0,$project='')
+ function project_get_num($objsoc=0,$object='')
{
- return $this->getNextValue($objsoc,$project);
+ return $this->getNextValue($objsoc,$object);
}
}
diff --git a/htdocs/core/modules/propale/doc/pdf_azur.modules.php b/htdocs/core/modules/propale/doc/pdf_azur.modules.php
index 19d09fd7631..9aa1ca994ef 100644
--- a/htdocs/core/modules/propale/doc/pdf_azur.modules.php
+++ b/htdocs/core/modules/propale/doc/pdf_azur.modules.php
@@ -374,6 +374,14 @@ class pdf_azur extends ModelePDFPropales
if (! empty($salerepobj->signature)) $notetoshow=dol_concatdesc($notetoshow, $salerepobj->signature);
}
}
+ if (! empty($conf->global->MAIN_ADD_CREATOR_IN_NOTE) && $object->user_author_id > 0)
+ {
+ $tmpuser=new User($this->db);
+ $tmpuser->fetch($object->user_author_id);
+ $notetoshow.='Affaire suivi par '.$tmpuser->getFullName($langs);
+ if ($tmpuser->email) $notetoshow.=', Mail: '.$tmpuser->email;
+ if ($tmpuser->office_phone) $notetoshow.=', Tel: '.$tmpuser->office_phone;
+ }
if ($notetoshow)
{
$tab_top = 88 + $height_incoterms;
diff --git a/htdocs/core/tpl/admin_extrafields_view.tpl.php b/htdocs/core/tpl/admin_extrafields_view.tpl.php
index 6acc81f009f..d20184c70b4 100644
--- a/htdocs/core/tpl/admin_extrafields_view.tpl.php
+++ b/htdocs/core/tpl/admin_extrafields_view.tpl.php
@@ -1,5 +1,5 @@
+/* Copyright (C) 2010-2016 Laurent Destailleur
* Copyright (C) 2012 Regis Houssin
*
* This program is free software; you can redistribute it and/or modify
@@ -33,6 +33,7 @@ print ' ';
// Load attribute_label
$extrafields->fetch_name_optionals_label($elementtype);
+print '';
print "
";
print '';
@@ -68,6 +69,6 @@ foreach($extrafields->attribute_type as $key => $value)
}
print "
";
-
+print '
';
?>
diff --git a/htdocs/core/tpl/ajaxrow.tpl.php b/htdocs/core/tpl/ajaxrow.tpl.php
index 4b8d82bce40..123fcef662c 100644
--- a/htdocs/core/tpl/ajaxrow.tpl.php
+++ b/htdocs/core/tpl/ajaxrow.tpl.php
@@ -1,6 +1,6 @@
- * Copyright (C) 2010-2012 Laurent Destailleur
+ * Copyright (C) 2010-2016 Laurent Destailleur
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -17,7 +17,7 @@
*
* Javascript code to activate drag and drop on lines
* You can use this if you want to be abale to drag and drop rows of a table.
- * You must add id="tablelines" ont table level tag and have count($object->lines) or count($taskarray) > 0
+ * You must add id="tablelines" on table level tag and have count($object->lines) or count($taskarray) > 0
*/
?>
diff --git a/htdocs/core/tpl/contacts.tpl.php b/htdocs/core/tpl/contacts.tpl.php
index 845bc30ce13..3a00ca2c060 100644
--- a/htdocs/core/tpl/contacts.tpl.php
+++ b/htdocs/core/tpl/contacts.tpl.php
@@ -52,6 +52,7 @@ $userstatic=new User($db);
?>
+
';
print $langs->trans('CronNote')." ";
- $doleditor = new DolEditor('note', $object->note, '', 160, 'dolibarr_notes', 'In', true, false, 0, 4, 90);
+ $doleditor = new DolEditor('note', $object->note, '', 160, 'dolibarr_notes', 'In', true, false, 0, ROWS_4, '90%');
$doleditor->Create();
print " ";
print "";
diff --git a/htdocs/cron/list.php b/htdocs/cron/list.php
index 49d916d2d9d..c400f9d167b 100644
--- a/htdocs/cron/list.php
+++ b/htdocs/cron/list.php
@@ -225,7 +225,7 @@ $sql.=$hookmanager->resPrint;
$sql.= $db->order($sortfield,$sortorder);
// Count total nb of records
-$nbtotalofrecords = 0;
+$nbtotalofrecords = -1;
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
{
$result = $db->query($sql);
diff --git a/htdocs/don/card.php b/htdocs/don/card.php
index 125f6ea656e..fd68b028254 100644
--- a/htdocs/don/card.php
+++ b/htdocs/don/card.php
@@ -305,9 +305,6 @@ if ($action == 'create')
print '';
print '';
- $nbrows=11;
- if (! empty($conf->projet->enabled)) $nbrows++;
-
// Date
print ''.$langs->trans("Date").' ';
$form->select_date($donation_date?$donation_date:-1,'','','','',"add",1,1);
@@ -346,7 +343,7 @@ if ($action == 'create')
print ' ' . $langs->trans('NotePublic') . ' ';
print '';
- $doleditor = new DolEditor('note_public', $note_public, '', 80, 'dolibarr_notes', 'In', 0, false, true, ROWS_3, 70);
+ $doleditor = new DolEditor('note_public', $note_public, '', 80, 'dolibarr_notes', 'In', 0, false, true, ROWS_3, '90%');
print $doleditor->Create(1);
print ' ';
@@ -356,7 +353,7 @@ if ($action == 'create')
print '' . $langs->trans('NotePrivate') . ' ';
print '';
- $doleditor = new DolEditor('note_private', $note_private, '', 80, 'dolibarr_notes', 'In', 0, false, true, ROWS_3, 70);
+ $doleditor = new DolEditor('note_private', $note_private, '', 80, 'dolibarr_notes', 'In', 0, false, true, ROWS_3, '90%');
print $doleditor->Create(1);
print ' ';
}
@@ -428,11 +425,8 @@ if (! empty($id) && $action == 'edit')
print '';
print '';
- $nbrows=12;
- if (! empty($conf->projet->enabled)) $nbrows++;
-
// Date
- print "".''.$langs->trans("Date").' ';
+ print ' '.$langs->trans("Date").' ';
$form->select_date($object->date,'','','','',"update");
print ' ';
@@ -454,10 +448,10 @@ if (! empty($id) && $action == 'edit')
print " \n";
$langs->load("companies");
- print "".''.$langs->trans("Company").' ';
- print "".''.$langs->trans("Lastname").' ';
- print "".''.$langs->trans("Firstname").' ';
- print "".''.$langs->trans("Address").' ';
+ print ' '.$langs->trans("Company").' ';
+ print ''.$langs->trans("Lastname").' ';
+ print ''.$langs->trans("Firstname").' ';
+ print ''.$langs->trans("Address").' ';
print ' ';
// Zip / Town
@@ -468,7 +462,7 @@ if (! empty($id) && $action == 'edit')
print '';
// Country
- print ''.$langs->trans('Country').' ';
+ print ' '.$langs->trans('Country').' ';
print $form->select_country((!empty($object->country_id)?$object->country_id:$mysoc->country_code),'country_id');
if ($user->admin) print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"),1);
print ' ';
@@ -593,9 +587,6 @@ if (! empty($id) && $action != 'edit')
print '';
- $nbrows=12;
- if (! empty($conf->projet->enabled)) $nbrows++;
-
// Ref
/*
print ''.$langs->trans("Ref").' ';
@@ -604,7 +595,7 @@ if (! empty($id) && $action != 'edit')
print ' ';
*/
// Date
- print ''.$langs->trans("Date").' ';
+ print ' '.$langs->trans("Date").' ';
print dol_print_date($object->date,"day");
print " ";
@@ -668,13 +659,13 @@ if (! empty($id) && $action != 'edit')
// Other attributes
$cols = 2;
include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_view.tpl.php';
-
+
print '
';
-
+
print '';
print '';
print '
';
-
+
/*
* Payments
*/
@@ -737,16 +728,13 @@ if (! empty($id) && $action != 'edit')
dol_print_error($db);
}
-
print '
';
print '
';
print '';
-
+
print '
';
-
-
+
dol_fiche_end();
-
$remaintopay = $object->amount - $totalpaid;
@@ -821,7 +809,7 @@ if (! empty($id) && $action != 'edit')
print $formfile->showdocuments('donation',$filename,$filedir,$urlsource,$genallowed,$delallowed,$object->modelpdf);
print '';
}
diff --git a/htdocs/don/list.php b/htdocs/don/list.php
index f5ce8b0350b..9ca8a79bb15 100644
--- a/htdocs/don/list.php
+++ b/htdocs/don/list.php
@@ -113,7 +113,7 @@ if (trim($search_name) != '')
if ($search_amount) $sql.= natural_search(array('d.amount'), price2num(trim($search_amount)), 1);
$sql.= $db->order($sortfield,$sortorder);
-$nbtotalofrecords = 0;
+$nbtotalofrecords = -1;
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
{
$result = $db->query($sql);
@@ -157,7 +157,9 @@ if ($resql)
print $langs->trans("FilterOnInto", $search_all) . join(', ',$fieldstosearchall);
}
- print "";
+ print '';
+ print '
'."\n";
+
print '';
print_liste_field_titre($langs->trans("Ref"),$_SERVER["PHP_SELF"],"d.rowid","", $param,"",$sortfield,$sortorder);
print_liste_field_titre($langs->trans("Company"),$_SERVER["PHP_SELF"],"d.societe","", $param,"",$sortfield,$sortorder);
@@ -237,6 +239,7 @@ if ($resql)
$i++;
}
print "
";
+ print '
';
print "\n";
$db->free($resql);
}
diff --git a/htdocs/ecm/ajax/ecmdatabase.php b/htdocs/ecm/ajax/ecmdatabase.php
index 4e5103399d9..ac3a45d5683 100644
--- a/htdocs/ecm/ajax/ecmdatabase.php
+++ b/htdocs/ecm/ajax/ecmdatabase.php
@@ -28,7 +28,7 @@ if (! defined('NOREQUIRESOC')) define('NOREQUIRESOC','1');
//if (! defined('NOREQUIRETRAN')) define('NOREQUIRETRAN','1');
require '../../main.inc.php';
-require DOL_DOCUMENT_ROOT . '/core/lib/files.lib.php';
+require_once DOL_DOCUMENT_ROOT . '/core/lib/files.lib.php';
$action = GETPOST('action','alpha');
$element = GETPOST('element', 'alpha');
@@ -48,7 +48,7 @@ if (isset($action) && ! empty($action))
if ($action == 'build' && ! empty($element))
{
- require DOL_DOCUMENT_ROOT . '/ecm/class/ecmdirectory.class.php';
+ require_once DOL_DOCUMENT_ROOT . '/ecm/class/ecmdirectory.class.php';
$ecmdirstatic = new EcmDirectory($db);
$ecmdirtmp = new EcmDirectory($db);
diff --git a/htdocs/ecm/docfile.php b/htdocs/ecm/docfile.php
index ce4bf480668..89caaf91824 100644
--- a/htdocs/ecm/docfile.php
+++ b/htdocs/ecm/docfile.php
@@ -1,5 +1,5 @@
+/* Copyright (C) 2008-2016 Laurent Destailleur
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -159,14 +159,13 @@ llxHeader();
$form=new Form($db);
-$fullpath=$conf->ecm->dir_output.'/'.$ecmdir->label.'/'.$urlfile;
+$fullpath=$conf->ecm->dir_output.'/'.$relativepath.$urlfile;
$file = new stdClass();
$file->section_id=$ecmdir->id;
$file->label=$urlfile;
$head = ecm_file_prepare_head($file);
-dol_fiche_head($head, 'card', $langs->trans("File"), 0, 'generic');
if ($_GET["action"] == 'edit')
{
@@ -177,8 +176,10 @@ if ($_GET["action"] == 'edit')
print ' ';
}
+dol_fiche_head($head, 'card', $langs->trans("File"), 0, 'generic');
+
print '';
+
+dol_fiche_end();
+
if ($_GET["action"] == 'edit')
{
- print '';
+ print '';
+ print ' ';
+ print ' ';
+ print ' ';
+ print '
';
+
+ print '';
}
-print '';
// Confirmation de la suppression d'une ligne categorie
diff --git a/htdocs/ecm/docmine.php b/htdocs/ecm/docmine.php
index 17e1a1a4308..0099e831776 100644
--- a/htdocs/ecm/docmine.php
+++ b/htdocs/ecm/docmine.php
@@ -222,7 +222,7 @@ if ($action == 'edit')
}
print '