diff --git a/dev/skeletons/build_class_from_table.php b/dev/skeletons/build_class_from_table.php index 62ad1188759..d9e30b23501 100755 --- a/dev/skeletons/build_class_from_table.php +++ b/dev/skeletons/build_class_from_table.php @@ -303,7 +303,7 @@ foreach($property as $key => $prop) $varprop.="\$this->db->escape(\$this->".$prop['field'].")"; $varprop.=".\"'\")"; } - elseif ($prop['field']=='fk_user_mod' || $prop['field']=='fk_user_author') + elseif ($prop['field']=='fk_user_mod' || $prop['field']=='fk_user_m' || $prop['field']=='fk_user_author') { $varprop.="'.\$user->id"; } @@ -367,7 +367,7 @@ foreach($property as $key => $prop) $varprop.=')."\'" : \'null\')'; } - elseif ($prop['field']=='fk_user_mod') { + elseif ($prop['field']=='fk_user_mod' || $prop['field']=='fk_user_m') { $varprop.="'.\$user->id"; } else diff --git a/dev/skeletons/skeleton_class.class.php b/dev/skeletons/skeleton_class.class.php index 4f725fa2dbe..01b48c35f75 100644 --- a/dev/skeletons/skeleton_class.class.php +++ b/dev/skeletons/skeleton_class.class.php @@ -188,11 +188,13 @@ class Skeleton_Class extends CommonObject // Retrieve all extrafields for invoice // fetch optionals attributes and labels + /* require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php'; $extrafields=new ExtraFields($this->db); $extralabels=$extrafields->fetch_name_optionals_label($this->table_element,true); $this->fetch_optionals($this->id,$extralabels); - + */ + // $this->fetch_lines(); $this->db->free($resql); @@ -251,23 +253,19 @@ class Skeleton_Class extends CommonObject $sql .= $this->db->order($sortfield,$sortorder); } if (!empty($limit)) { - $sql .= ' ' . $this->db->plimit($limit + 1, $offset); + $sql .= ' ' . $this->db->plimit($limit, $offset); } - $this->lines = array(); - $resql = $this->db->query($sql); if ($resql) { $num = $this->db->num_rows($resql); while ($obj = $this->db->fetch_object($resql)) { - $line = new Skeleton_ClassLine(); + $line = new self($this->db); $line->id = $obj->rowid; $line->prop1 = $obj->field1; $line->prop2 = $obj->field2; - - $this->lines[$line->id] = $line; //... } $this->db->free($resql); diff --git a/dev/tools/github_authors_peryear.sh b/dev/tools/github_authors_peryear.sh new file mode 100755 index 00000000000..99b28d4d417 --- /dev/null +++ b/dev/tools/github_authors_peryear.sh @@ -0,0 +1,8 @@ +#!/bin/sh + +FROM=2016-01-01 +TO=2016-12-31 + +echo "git log --since $FROM --before $TO | grep ^Author | sort -u -f -i -b | wc -l" +git log --since $FROM --before $TO | grep ^Author | sort -u -f -i -b | wc -l + diff --git a/dev/tools/github_commits_perversion.sh b/dev/tools/github_commits_perversion.sh new file mode 100755 index 00000000000..40ddafee617 --- /dev/null +++ b/dev/tools/github_commits_perversion.sh @@ -0,0 +1,15 @@ +#/bin/bash +Releases=("3.8" "3.9" "4.0" "5.0", "develop") +Dates=("2010-01-01", "2011-01-01", "2012-01-01", "2013-01-01", "2014-01-01", "2015-01-01", "2016-07-01") +let "counter = 1" + +for i in "${Releases[@]}" +do + git shortlog -s -n --after=${Dates[counter-1]} --before=${Dates[counter]} + echo -n "Total $i: " + git log --pretty=oneline --after=${Dates[counter-1]} --before=${Dates[counter]} | wc -l + echo "=======================" + echo + let "counter +=1" +done + diff --git a/htdocs/accountancy/class/html.formventilation.class.php b/htdocs/accountancy/class/html.formventilation.class.php index 376e5b00d56..e1a21d852ea 100644 --- a/htdocs/accountancy/class/html.formventilation.class.php +++ b/htdocs/accountancy/class/html.formventilation.class.php @@ -83,6 +83,8 @@ class FormVentilation extends Form require_once DOL_DOCUMENT_ROOT . '/core/lib/accounting.lib.php'; + $out = ''; + $options = array(); if ($usecache && ! empty($this->options_cache[$usecache])) { @@ -109,7 +111,7 @@ class FormVentilation extends Form return -1; } - $out = ajax_combobox($htmlname, $event); + $out .= ajax_combobox($htmlname, $event); $selected = 0; while ($obj = $this->db->fetch_object($resql)) diff --git a/htdocs/adherents/type.php b/htdocs/adherents/type.php index cab52dceccc..85b591f0fca 100644 --- a/htdocs/adherents/type.php +++ b/htdocs/adherents/type.php @@ -91,10 +91,10 @@ if ($action == 'add' && $user->rights->adherent->configurer) $object = new AdherentType($db); $object->libelle = trim($label); - $object->subscription = trim($subscription); + $object->subscription = (int) trim($subscription); $object->note = trim($comment); - $object->mail_valid = trim($mail_valid); - $object->vote = trim($vote); + $object->mail_valid = (boolean) trim($mail_valid); + $object->vote = (boolean) trim($vote); // Fill array 'array_options' with data from add form $ret = $extrafields->setOptionalsFromPost($extralabels,$object); @@ -129,10 +129,10 @@ if ($action == 'update' && $user->rights->adherent->configurer) $object = new AdherentType($db); $object->id = $rowid; $object->libelle = trim($label); - $object->subscription = trim($subscription); + $object->subscription = (int) trim($subscription); $object->note = trim($comment); - $object->mail_valid = trim($mail_valid); - $object->vote = trim($vote); + $object->mail_valid = (boolean) trim($mail_valid); + $object->vote = (boolean) trim($vote); // Fill array 'array_options' with data from add form $ret = $extrafields->setOptionalsFromPost($extralabels,$object); diff --git a/htdocs/cashdesk/class/Facturation.class.php b/htdocs/cashdesk/class/Facturation.class.php index 240b32e34db..579d244246b 100644 --- a/htdocs/cashdesk/class/Facturation.class.php +++ b/htdocs/cashdesk/class/Facturation.class.php @@ -37,7 +37,7 @@ class Facturation * int $prix => Prix HT du produit en cours * int $tva => 'rowid' du taux de tva dans llx_c_tva */ - var $id; + public $id; protected $ref; protected $qte; protected $stock; diff --git a/htdocs/cashdesk/css/style.css b/htdocs/cashdesk/css/style.css index e606c8d2807..2931ad7638e 100644 --- a/htdocs/cashdesk/css/style.css +++ b/htdocs/cashdesk/css/style.css @@ -115,7 +115,7 @@ li.menu_choix0 { float: right; } -/* ------------------- R�capitulatif des articles ------------------- */ +/* ------------------- Remind of products ------------------- */ .liste_articles { min-width: 215px; float: right; @@ -212,6 +212,9 @@ p.titre { max-width: 900px; } +.blocksellfinished { + min-width: 215px; +} .titre1 { font-weight: bold; color: #ff9900; diff --git a/htdocs/cashdesk/tpl/facturation1.tpl.php b/htdocs/cashdesk/tpl/facturation1.tpl.php index d20eb4c3299..208727a7644 100644 --- a/htdocs/cashdesk/tpl/facturation1.tpl.php +++ b/htdocs/cashdesk/tpl/facturation1.tpl.php @@ -106,23 +106,23 @@ $langs->load("cashdesk"); trans("VATRate"); ?> - + - + - + - + - + @@ -155,17 +155,17 @@ $langs->load("cashdesk");
trans("Amount"); ?> - +
- + - - +
trans("TotalTicket"); ?>trans("Received"); ?>trans("Change"); ?>
+
diff --git a/htdocs/cashdesk/tpl/validation2.tpl.php b/htdocs/cashdesk/tpl/validation2.tpl.php index b74f5afdd52..844522f55e0 100644 --- a/htdocs/cashdesk/tpl/validation2.tpl.php +++ b/htdocs/cashdesk/tpl/validation2.tpl.php @@ -22,9 +22,10 @@ $langs->load("bills"); ?> -

trans("SellFinished"); ?>


+
+

trans("SellFinished"); ?>


'; } - print ''; + print ''; } if ($page > 0) { @@ -3393,7 +3393,7 @@ function print_fleche_navigation($page, $file, $options='', $nextpage=0, $betwee function vatrate($rate, $addpercent=false, $info_bits=0, $usestarfornpr=0) { $morelabel=''; - + if (preg_match('/%/',$rate)) { $rate=str_replace('%','',$rate); @@ -3596,7 +3596,7 @@ function price2num($amount,$rounding='',$alreadysqlnb=0) /** * Output a dimension with best unit - * + * * @param float $dimension Dimension * @param int $unit Unit of dimension (0, -3, ...) * @param string $type 'weight', 'volume', ... @@ -3608,16 +3608,16 @@ function price2num($amount,$rounding='',$alreadysqlnb=0) function showDimensionInBestUnit($dimension, $unit, $type, $outputlangs, $round=-1, $forceunitoutput='no') { require_once DOL_DOCUMENT_ROOT.'/core/lib/product.lib.php'; - - if (($forceunitoutput == 'no' && $dimension < 1/10000) || (is_numeric($forceunitoutput) && $forceunitoutput == -6)) + + if (($forceunitoutput == 'no' && $dimension < 1/10000) || (is_numeric($forceunitoutput) && $forceunitoutput == -6)) { $dimension = $dimension * 1000000; - $unit = $unit - 6; + $unit = $unit - 6; } elseif (($forceunitoutput == 'no' && $dimension < 1/10) || (is_numeric($forceunitoutput) && $forceunitoutput == -3)) { $dimension = $dimension * 1000; - $unit = $unit - 3; + $unit = $unit - 3; } elseif (($forceunitoutput == 'no' && $dimension > 100000000) || (is_numeric($forceunitoutput) && $forceunitoutput == 6)) { @@ -3629,9 +3629,9 @@ function showDimensionInBestUnit($dimension, $unit, $type, $outputlangs, $round= $dimension = $dimension / 1000; $unit = $unit + 3; } - + $ret=price($dimension, 0, $outputlangs, 0, 0, $round).' '.measuring_units_string($unit, $type); - + return $ret; } @@ -3662,12 +3662,12 @@ function get_localtax($vatrate, $local, $thirdparty_buyer="", $thirdparty_seller $vatratecleaned = trim($reg[1]); $vatratecode = $reg[2]; } - + /*if ($thirdparty_buyer->country_code != $thirdparty_seller->country_code) { return 0; }*/ - + // Some test to guess with no need to make database access if ($mysoc->country_code == 'ES') // For spain localtaxes 1 and 2, tax is qualified if buyer use local taxe { @@ -3765,7 +3765,7 @@ function get_localtax($vatrate, $local, $thirdparty_buyer="", $thirdparty_seller if ($local==1) return $obj->localtax1; elseif ($local==2) return $obj->localtax2; } - + return 0; } @@ -3825,7 +3825,7 @@ function get_localtax_by_third($local) /** * Get vat rate and npr from id. - * You can call getLocalTaxesFromRate after to get other fields + * You can call getLocalTaxesFromRate after to get other fields * * @param int $vatrowid Line ID into vat rate table. * @return array array(localtax_type1(1-6 / 0 if not found), rate of localtax1, ...) @@ -3879,7 +3879,7 @@ function getLocalTaxesFromRate($vatrate, $local, $buyer, $seller, $firstparamisi $vatratecleaned = $reg[1]; $vatratecode = $reg[2]; } - + // Search local taxes $sql = "SELECT t.localtax1, t.localtax1_type, t.localtax2, t.localtax2_type, t.accountancy_code_sell, t.accountancy_code_buy"; $sql .= " FROM ".MAIN_DB_PREFIX."c_tva as t"; @@ -3892,7 +3892,7 @@ function getLocalTaxesFromRate($vatrate, $local, $buyer, $seller, $firstparamisi $sql.= " AND t.taux = ".((float) $vatratecleaned)." AND t.active = 1"; if ($vatratecode) $sql.= " AND t.code ='".$vatratecode."'"; } - + $resql=$db->query($sql); if ($resql) { @@ -4299,7 +4299,7 @@ function yn($yesno, $case=1, $color=0) /** * Return a path to have a directory according to object. * New usage: $conf->product->multidir_output[$object->entity].'/'.get_exdir(0, 0, 0, 1, $object, 'modulepart') - * Old usage: '015' with level 3->"0/1/5/", '015' with level 1->"5/", 'ABC-1' with level 3 ->"0/0/1/" + * Old usage: '015' with level 3->"0/1/5/", '015' with level 1->"5/", 'ABC-1' with level 3 ->"0/0/1/" * * @param string $num Id of object (deprecated, $object will be used in future) * @param int $level Level of subdirs to return (1, 2 or 3 levels). (deprecated, global option will be used in future) @@ -4316,7 +4316,7 @@ function get_exdir($num, $level, $alpha, $withoutslash, $object, $modulepart) $path = ''; $arrayforoldpath=array('cheque','user','category','holiday','shipment','supplier_invoice','invoice_supplier','mailing'); - if (! empty($conf->global->PRODUCT_USE_OLD_PATH_FOR_PHOTO)) $arrayforoldpath[]='product'; + if (! empty($conf->global->PRODUCT_USE_OLD_PATH_FOR_PHOTO)) $arrayforoldpath[]='product'; if (! empty($level) && in_array($modulepart, $arrayforoldpath)) { // This part should be removed once all code is using "get_exdir" to forge path, with all parameters provided @@ -4469,7 +4469,7 @@ function dolGetFirstLineOfText($text) { $firstline=preg_replace('/]*>.*$/s','',$text); // The s pattern modifier means the . can match newline characters $firstline=preg_replace('/]*>.*$/s','',$firstline); // The s pattern modifier means the . can match newline characters - + } else { @@ -5375,7 +5375,7 @@ function picto_from_langcode($codelang) } /** - * Complete or removed entries into a head array (used to build tabs). + * Complete or removed entries into a head array (used to build tabs). * For example, with value added by external modules. Such values are declared into $conf->modules_parts['tab']. * Or by change using hook completeTabsHead * @@ -5405,7 +5405,7 @@ function picto_from_langcode($codelang) function complete_head_from_modules($conf,$langs,$object,&$head,&$h,$type,$mode='add') { global $hookmanager; - + if (isset($conf->modules_parts['tabs'][$type]) && is_array($conf->modules_parts['tabs'][$type])) { foreach ($conf->modules_parts['tabs'][$type] as $value) @@ -5471,7 +5471,7 @@ function complete_head_from_modules($conf,$langs,$object,&$head,&$h,$type,$mode= } } } - + // No need to make a return $head. Var is modified as a reference if (! empty($hookmanager)) { @@ -5509,11 +5509,11 @@ function printCommonFooter($zone='private') { print ''."\n"; print ''."\n"; } - + // Google Analytics (need Google module) if (! empty($conf->google->enabled) && ! empty($conf->global->MAIN_GOOGLE_AN_ID)) { @@ -5749,15 +5749,15 @@ function natural_search($fields, $value, $mode=0, $nofirstand=0) $tmpcrit=trim($tmpcrit); $tmpcrit2=$tmpcrit; $tmpbefore='%'; $tmpafter='%'; - if (preg_match('/^[\^\$]/', $tmpcrit)) - { + if (preg_match('/^[\^\$]/', $tmpcrit)) + { $tmpbefore=''; - $tmpcrit2 = preg_replace('/^[\^\$]/', '', $tmpcrit2); + $tmpcrit2 = preg_replace('/^[\^\$]/', '', $tmpcrit2); } - if (preg_match('/[\^\$]$/', $tmpcrit)) - { + if (preg_match('/[\^\$]$/', $tmpcrit)) + { $tmpafter=''; - $tmpcrit2 = preg_replace('/[\^\$]$/', '', $tmpcrit2); + $tmpcrit2 = preg_replace('/[\^\$]$/', '', $tmpcrit2); } $newres .= $tmpbefore; $newres .= $db->escape($tmpcrit2); @@ -5822,7 +5822,7 @@ function getImageFileNameForSize($file, $extName, $extImgTarget='') function getAdvancedPreviewUrl($modulepart, $relativepath) { global $conf; - + if (empty($conf->use_javascript_ajax)) return ''; $mime_preview = array('bmp', 'jpeg', 'png', 'gif', 'tiff', 'pdf', 'plain', 'css'); diff --git a/htdocs/core/lib/images.lib.php b/htdocs/core/lib/images.lib.php index 9cf745a0da0..00153a7849d 100644 --- a/htdocs/core/lib/images.lib.php +++ b/htdocs/core/lib/images.lib.php @@ -37,8 +37,10 @@ $quality = 80; */ function image_format_supported($file) { + $regeximgext='\.gif|\.jpg|\.jpeg|\.png|\.bmp|\.xpm|\.xbm'; // See also into product.class.php + // Case filename is not a format image - if (! preg_match('/(\.gif|\.jpg|\.jpeg|\.png|\.bmp)$/i',$file,$reg)) return -1; + if (! preg_match('/('.$regeximgext.')$/i',$file,$reg)) return -1; // Case filename is a format image but not supported by this PHP $imgfonction=''; @@ -47,6 +49,8 @@ function image_format_supported($file) if (strtolower($reg[1]) == '.jpg') $imgfonction = 'imagecreatefromjpeg'; if (strtolower($reg[1]) == '.jpeg') $imgfonction = 'imagecreatefromjpeg'; if (strtolower($reg[1]) == '.bmp') $imgfonction = 'imagecreatefromwbmp'; + if (strtolower($reg[1]) == '.xpm') $imgfonction = 'imagecreatefromxpm'; + if (strtolower($reg[1]) == '.xbm') $imgfonction = 'imagecreatefromxbm'; if ($imgfonction) { if (! function_exists($imgfonction)) diff --git a/htdocs/core/menus/standard/eldy.lib.php b/htdocs/core/menus/standard/eldy.lib.php index a88e180b16a..8c6c7311f82 100644 --- a/htdocs/core/menus/standard/eldy.lib.php +++ b/htdocs/core/menus/standard/eldy.lib.php @@ -111,13 +111,13 @@ function print_eldy_menu($db,$atarget,$type_user,&$tabMenu,&$menu,$noout=0,$mode $chaine=""; if (! empty($conf->product->enabled)) { - $chaine.=$langs->trans("Products"); + $chaine.=$langs->trans("TMenuProducts"); } if (! empty($conf->product->enabled) && ! empty($conf->service->enabled)) { - $chaine.="/"; + $chaine.=" | "; } if (! empty($conf->service->enabled)) { - $chaine.=$langs->trans("Services"); + $chaine.=$langs->trans("TMenuServices"); } if (empty($noout)) print_start_menu_entry($idsel,$classname,$showmode); @@ -261,7 +261,7 @@ function print_eldy_menu($db,$atarget,$type_user,&$tabMenu,&$menu,$noout=0,$mode $idsel='tools'; if (empty($noout)) print_start_menu_entry($idsel,$classname,$showmode); - if (empty($noout)) print_text_menu_entry($langs->trans("Tools"), $showmode, DOL_URL_ROOT.'/core/tools.php?mainmenu=tools&leftmenu=', $id, $idsel, $classname, $atarget); + if (empty($noout)) print_text_menu_entry($langs->trans("TMenuTools"), $showmode, DOL_URL_ROOT.'/core/tools.php?mainmenu=tools&leftmenu=', $id, $idsel, $classname, $atarget); if (empty($noout)) print_end_menu_entry($showmode); $menu->add('/core/tools.php?mainmenu=tools&leftmenu=', $langs->trans("Tools"), 0, $showmode, $atarget, "tools", ''); } diff --git a/htdocs/core/modules/modAgenda.class.php b/htdocs/core/modules/modAgenda.class.php index a0c2a6e9de4..2ba37ad3cbd 100644 --- a/htdocs/core/modules/modAgenda.class.php +++ b/htdocs/core/modules/modAgenda.class.php @@ -189,7 +189,7 @@ class modAgenda extends DolibarrModules // $r++; $this->menu[$r]=array('fk_menu'=>0, 'type'=>'top', - 'titre'=>'Agenda', + 'titre'=>'TMenuAgenda', 'mainmenu'=>'agenda', 'url'=>'/comm/action/index.php', 'langs'=>'agenda', diff --git a/htdocs/core/photos_resize.php b/htdocs/core/photos_resize.php index 778c37f686a..8fcd0d2b930 100644 --- a/htdocs/core/photos_resize.php +++ b/htdocs/core/photos_resize.php @@ -134,11 +134,50 @@ if ($action == 'confirm_resize' && (isset($_POST["file"]) != "") && (isset($_POS { $fullpath=$dir."/".$original_file; $result=dol_imageResizeOrCrop($fullpath,0,$_POST['sizex'],$_POST['sizey']); - + if ($result == $fullpath) { $object->addThumbs($fullpath); + // Update/create database for file $fullpath + $rel_filename = preg_replace('/^'.preg_quote(DOL_DATA_ROOT,'/').'/', '', $fullpath); + $rel_filename = preg_replace('/^[\\/]/','',$rel_filename); + + include_once DOL_DOCUMENT_ROOT.'/ecm/class/ecmfiles.class.php'; + $ecmfile=new EcmFiles($db); + $result = $ecmfile->fetch(0, '', $rel_filename); + if ($result > 0) // If found + { + $filename = basename($rel_filename); + $rel_dir = dirname($rel_filename); + $rel_dir = preg_replace('/[\\/]$/', '', $rel_dir); + $rel_dir = preg_replace('/^[\\/]/', '', $rel_dir); + + $ecmfile->label = md5_file(dol_osencode($fullpath)); + $result = $ecmfile->update($user); + } + elseif ($result == 0) // If not found + { + $filename = basename($rel_filename); + $rel_dir = dirname($rel_filename); + $rel_dir = preg_replace('/[\\/]$/', '', $rel_dir); + $rel_dir = preg_replace('/^[\\/]/', '', $rel_dir); + + $ecmfile->filepath = $rel_dir; + $ecmfile->filename = $filename; + $ecmfile->label = md5_file(dol_osencode($fullpath)); // $fullpath is a full path to file + $ecmfile->fullpath_orig = $fullpath; + $ecmfile->gen_or_uploaded = 'unknown'; + $ecmfile->description = ''; // indexed content + $ecmfile->keyword = ''; // keyword content + $result = $ecmfile->create($user); + if ($result < 0) + { + setEventMessages($ecmfile->error, $ecmfile->errors, 'warnings'); + } + $result = $ecmfile->create($user); + } + if ($backtourl) { header("Location: ".$backtourl); @@ -168,6 +207,45 @@ if ($action == 'confirm_crop') { $object->addThumbs($fullpath); + // Update/create database for file $fullpath + $rel_filename = preg_replace('/^'.preg_quote(DOL_DATA_ROOT,'/').'/', '', $fullpath); + $rel_filename = preg_replace('/^[\\/]/','',$rel_filename); + + include_once DOL_DOCUMENT_ROOT.'/ecm/class/ecmfiles.class.php'; + $ecmfile=new EcmFiles($db); + $result = $ecmfile->fetch(0, '', $rel_filename); + if ($result > 0) // If found + { + $filename = basename($rel_filename); + $rel_dir = dirname($rel_filename); + $rel_dir = preg_replace('/[\\/]$/', '', $rel_dir); + $rel_dir = preg_replace('/^[\\/]/', '', $rel_dir); + + $ecmfile->label = md5_file(dol_osencode($fullpath)); + $result = $ecmfile->update($user); + } + elseif ($result == 0) // If not found + { + $filename = basename($rel_filename); + $rel_dir = dirname($rel_filename); + $rel_dir = preg_replace('/[\\/]$/', '', $rel_dir); + $rel_dir = preg_replace('/^[\\/]/', '', $rel_dir); + + $ecmfile->filepath = $rel_dir; + $ecmfile->filename = $filename; + $ecmfile->label = md5_file(dol_osencode($fullpath)); // $fullpath is a full path to file + $ecmfile->fullpath_orig = $fullpath; + $ecmfile->gen_or_uploaded = 'unknown'; + $ecmfile->description = ''; // indexed content + $ecmfile->keyword = ''; // keyword content + $result = $ecmfile->create($user); + if ($result < 0) + { + setEventMessages($ecmfile->error, $ecmfile->errors, 'warnings'); + } + $result = $ecmfile->create($user); + } + if ($backtourl) { header("Location: ".$backtourl); @@ -218,10 +296,11 @@ print ''.$langs->trans("Resize").''; print $langs->trans("ResizeDesc").'
'; print $langs->trans("NewLength").': px   '.$langs->trans("or").'   '; print $langs->trans("NewHeight").': px  
'; + print ''; print ''; print ''; -print ''; +print ''; print ''; print '
'; print ''; diff --git a/htdocs/core/tpl/ajaxrow.tpl.php b/htdocs/core/tpl/ajaxrow.tpl.php index 123fcef662c..d0a7b45efea 100644 --- a/htdocs/core/tpl/ajaxrow.tpl.php +++ b/htdocs/core/tpl/ajaxrow.tpl.php @@ -17,18 +17,19 @@ * * 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" on table level tag and have count($object->lines) or count($taskarray) > 0 + * You must add id="tablelines" on table level tag and have ($nboflines or count($object->lines) or count($taskarray) > 0) */ ?> - + id; $fk_element=$object->fk_element; -$table_element_line=$object->table_element_line; -$nboflines=(isset($object->lines)?count($object->lines):(isset($tasksarray)?count($tasksarray):0)); +$table_element_line=(empty($table_element_line)?$object->table_element_line:$table_element_line); +$nboflines=(isset($object->lines)?count($object->lines):(isset($tasksarray)?count($tasksarray):(empty($nboflines)?0:$nboflines))); $forcereloadpage=empty($conf->global->MAIN_FORCE_RELOAD_PAGE)?0:1; $tagidfortablednd=(empty($tagidfortablednd)?'tablelines':$tagidfortablednd); +$filepath=(empty($filepath)?'':$filepath); if (GETPOST('action') != 'editline' && $nboflines > 1) { ?>