diff --git a/dev/skeletons/modMyModule.class.php b/dev/skeletons/modMyModule.class.php index 4bb936ba339..17fa97ec523 100644 --- a/dev/skeletons/modMyModule.class.php +++ b/dev/skeletons/modMyModule.class.php @@ -176,7 +176,7 @@ class modMyModule extends DolibarrModules // Main menu entries - $this->menus = array(); // List of menus to add + $this->menu = array(); // List of menus to add $r=0; // Add here entries to declare new menus diff --git a/htdocs/comm/propal.php b/htdocs/comm/propal.php index 821d1dd98b0..1ad89847ea8 100644 --- a/htdocs/comm/propal.php +++ b/htdocs/comm/propal.php @@ -351,7 +351,7 @@ else if ($action == 'add' && $user->rights->propal->creer) if ($id > 0) { // Insertion contact par defaut si defini - if (GETPOST('contactidp')) + if (GETPOST('contactidp') > 0) { $result=$object->add_contact(GETPOST('contactidp'),'CUSTOMER','external'); if ($result < 0) @@ -1347,6 +1347,7 @@ if ($action == 'create') $numprojet=select_projects($soc->id,$projectid); if ($numprojet==0) { + $langs->load("projects"); print '   '.$langs->trans("AddProject").''; } print ''; diff --git a/htdocs/comm/propal/class/propal.class.php b/htdocs/comm/propal/class/propal.class.php index dc2c708cbec..7dc63fdace9 100644 --- a/htdocs/comm/propal/class/propal.class.php +++ b/htdocs/comm/propal/class/propal.class.php @@ -648,8 +648,7 @@ class Propal extends CommonObject dol_syslog(get_class($this)."::create"); // Check parameters - $soc = new Societe($this->db); - $result=$soc->fetch($this->socid); + $result=$this->fetch_thirdparty(); if ($result < 0) { $this->error="Failed to fetch company"; @@ -670,8 +669,6 @@ class Propal extends CommonObject $this->db->begin(); - $this->fetch_thirdparty(); - // Insert into database $sql = "INSERT INTO ".MAIN_DB_PREFIX."propal ("; $sql.= "fk_soc"; diff --git a/htdocs/core/lib/barcode.lib.php b/htdocs/core/lib/barcode.lib.php index f83ea5f433c..67b51748d3e 100644 --- a/htdocs/core/lib/barcode.lib.php +++ b/htdocs/core/lib/barcode.lib.php @@ -74,11 +74,11 @@ function barcode_print($code, $encoding="ANY", $scale = 2 ,$mode = "png") dol_syslog("barcode.lib.php::barcode_print $code $encoding $scale $mode"); $bars=barcode_encode($code,$encoding); - - if (! $bars) + if (! $bars || ! empty($bars['error'])) { // DOLCHANGE LDR Return error message instead of array - $error='Bad Value '.$code.' for encoding '.$encoding; + if (empty($bars['error'])) $error='Bad Value '.$code.' for encoding '.$encoding; + else $error=$bars['error']; dol_syslog('barcode.lib.php::barcode_print '.$error, LOG_ERR); return $error; } @@ -133,7 +133,7 @@ function barcode_encode($code,$encoding) dol_syslog("barcode.lib.php::barcode_encode Use barcode_encode_ean"); $bars=barcode_encode_ean($code, $encoding); } - else if (file_exists($genbarcode_loc)) + else if (file_exists($genbarcode_loc)) // For example C39 { /* use genbarcode */ dol_syslog("barcode.lib.php::barcode_encode Use genbarcode ".$genbarcode_loc." code=".$code." encoding=".$encoding); @@ -252,10 +252,11 @@ function barcode_encode_genbarcode($code,$encoding) $code=preg_replace("/[\\\|]/", "_", $code); $command=escapeshellarg($genbarcode_loc); - $paramclear=" \"".str_replace("\"", "\\\"",$code)."\" \"".str_replace("\"", "\\\"",strtoupper($encoding))."\""; - + //$paramclear=" \"".str_replace("\"", "\\\"",$code)."\" \"".str_replace("\"", "\\\"",strtoupper($encoding))."\""; + $paramclear=" ".escapeshellarg($code)." ".escapeshellarg(strtoupper($encoding)); + $fullcommandclear=$command." ".$paramclear." 2>&1"; - //print $fullcommandclear."
\n"; + //print $fullcommandclear."
\n";exit; dol_syslog("Run command ".$fullcommandclear); $fp=popen($fullcommandclear, "r"); @@ -273,14 +274,20 @@ function barcode_encode_genbarcode($code,$encoding) } //var_dump($bars); $ret=array( - "encoding" => trim($encoding), "bars" => trim($bars), - "text" => trim($text) + "text" => trim($text), + "encoding" => trim($encoding), + "error" => "" ); //var_dump($ret); - if (!$ret['encoding']) return false; + if (preg_match('/permission denied/i',$ret['bars'])) + { + $ret['error']=$ret['bars']; $ret['bars']=''; + return $ret; + } if (!$ret['bars']) return false; if (!$ret['text']) return false; + if (!$ret['encoding']) return false; return $ret; } diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 784762907d3..2fc96042895 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -2194,10 +2194,10 @@ function dol_print_error($db='',$error='') $out.="".$langs->trans("PHP").": ".phpversion()."
\n"; //phpinfo(); // This is to show location of php.ini file } - $out.="".$langs->trans("Server").": ".$_SERVER["SERVER_SOFTWARE"]."
\n";; + $out.="".$langs->trans("Server").": ".$_SERVER["SERVER_SOFTWARE"]."
\n"; $out.="
\n"; - $out.="".$langs->trans("RequestedUrl").": ".$_SERVER["REQUEST_URI"]."
\n";; - $out.="".$langs->trans("Referer").": ".(isset($_SERVER["HTTP_REFERER"])?$_SERVER["HTTP_REFERER"]:'')."
\n";; + $out.="".$langs->trans("RequestedUrl").": ".dol_htmlentities($_SERVER["REQUEST_URI"],ENT_COMPAT,'UTF-8')."
\n"; + $out.="".$langs->trans("Referer").": ".(isset($_SERVER["HTTP_REFERER"])?dol_htmlentities($_SERVER["HTTP_REFERER"],ENT_COMPAT,'UTF-8'):'')."
\n"; $out.="".$langs->trans("MenuManager").": ".(isset($conf->standard_menu)?$conf->standard_menu:'')."
\n"; $out.="
\n"; $syslog.="url=".$_SERVER["REQUEST_URI"]; diff --git a/htdocs/core/search_page.php b/htdocs/core/search_page.php index cf44cccce2b..1ea6138873e 100644 --- a/htdocs/core/search_page.php +++ b/htdocs/core/search_page.php @@ -102,7 +102,7 @@ else $searchform=$hookmanager->resPrint; print "\n"; print "\n"; -print '
'; +print '
'; print ''; //print '
'; print '
'."\n"; diff --git a/htdocs/core/tpl/freeproductline_create.tpl.php b/htdocs/core/tpl/freeproductline_create.tpl.php index ad0b0eeb426..328b8d9a69b 100644 --- a/htdocs/core/tpl/freeproductline_create.tpl.php +++ b/htdocs/core/tpl/freeproductline_create.tpl.php @@ -30,6 +30,13 @@ if (! empty($conf->margin->enabled) && ! empty($object->element) && in_array($ob ?> + +
"> + + + + global->MAIN_VIEW_LINE_NUMBER) ? ' colspan="2"' : ''); ?>>
margin->enabled) && ! empty($object->element) && in_array($ob   -"> - - - - - > - global->MAIN_VIEW_LINE_NUMBER) ? ' colspan="2"' : ''); ?>> - > + global->MAIN_VIEW_LINE_NUMBER) ? ' colspan="2"' : ''); ?>> + '; echo $form->select_type_of_lines(isset($_POST["type"])?$_POST["type"]:-1,'type',1); @@ -90,66 +91,69 @@ if (! empty($conf->margin->enabled) && ! empty($object->element) && in_array($ob $doleditor=new DolEditor('dp_desc',GETPOST('dp_desc'),'',100,'dolibarr_details','',false,true,$enabled,$nbrows,70); $doleditor->Create(); ?> - + - tva_assuj == "0") echo '0'; - else echo $form->load_tva('tva_tx', (isset($_POST["tva_tx"])?$_POST["tva_tx"]:-1), $seller, $buyer); - ?> - - "> - - "> - % - - "> - - global->DISPLAY_MARGIN_RATES)) $colspan++; - if (! empty($conf->global->DISPLAY_MARK_RATES)) $colspan++; - } - ?> - - - - service->enabled) && $dateSelector) - { - if(! empty($conf->global->MAIN_VIEW_LINE_NUMBER)) $colspan = 10; - else $colspan = 9; - - if (! empty($usemargins)) - { - $colspan++; // For the buying price - if($conf->global->DISPLAY_MARGIN_RATES) $colspan++; - if($conf->global->DISPLAY_MARK_RATES) $colspan++; - } + tva_assuj == "0") echo '0'; + else echo $form->load_tva('tva_tx', (isset($_POST["tva_tx"])?$_POST["tva_tx"]:-1), $seller, $buyer); ?> - > - element) && $object->element == 'contrat') - { - print $langs->trans("DateStartPlanned").' '; - $form->select_date('',"date_start_sl",$usehm,$usehm,1,"addline_sl"); - print '   '.$langs->trans("DateEndPlanned").' '; - $form->select_date('',"date_end_sl",$usehm,$usehm,1,"addline_sl"); - } - else - { - echo $langs->trans('ServiceLimitedDuration').' '.$langs->trans('From').' '; - echo $form->select_date('','date_start',empty($conf->global->MAIN_USE_HOURMIN_IN_DATE_RANGE)?0:1,empty($conf->global->MAIN_USE_HOURMIN_IN_DATE_RANGE)?0:1,1,"addproduct"); - echo ' '.$langs->trans('to').' '; - echo $form->select_date('','date_end',empty($conf->global->MAIN_USE_HOURMIN_IN_DATE_RANGE)?0:1,empty($conf->global->MAIN_USE_HOURMIN_IN_DATE_RANGE)?0:1,1,"addproduct"); - } + + "> + + "> + % + + "> - - + global->DISPLAY_MARGIN_RATES)) $colspan++; + if (! empty($conf->global->DISPLAY_MARK_RATES)) $colspan++; + } + ?> + + + +service->enabled) && $dateSelector) +{ + if(! empty($conf->global->MAIN_VIEW_LINE_NUMBER)) $colspan = 10; + else $colspan = 9; + + if (! empty($usemargins)) + { + $colspan++; // For the buying price + if($conf->global->DISPLAY_MARGIN_RATES) $colspan++; + if($conf->global->DISPLAY_MARK_RATES) $colspan++; + } +?> + +> + element) && $object->element == 'contrat') + { + print $langs->trans("DateStartPlanned").' '; + $form->select_date('',"date_start_sl",$usehm,$usehm,1,"addline_sl"); + print '   '.$langs->trans("DateEndPlanned").' '; + $form->select_date('',"date_end_sl",$usehm,$usehm,1,"addline_sl"); + } + else + { + echo $langs->trans('ServiceLimitedDuration').' '.$langs->trans('From').' '; + echo $form->select_date('','date_start',empty($conf->global->MAIN_USE_HOURMIN_IN_DATE_RANGE)?0:1,empty($conf->global->MAIN_USE_HOURMIN_IN_DATE_RANGE)?0:1,1,"addproduct"); + echo ' '.$langs->trans('to').' '; + echo $form->select_date('','date_end',empty($conf->global->MAIN_USE_HOURMIN_IN_DATE_RANGE)?0:1,empty($conf->global->MAIN_USE_HOURMIN_IN_DATE_RANGE)?0:1,1,"addproduct"); + } + ?> + + + \ No newline at end of file diff --git a/htdocs/core/tpl/predefinedproductline_create.tpl.php b/htdocs/core/tpl/predefinedproductline_create.tpl.php index ae8491784e6..b435d40be64 100644 --- a/htdocs/core/tpl/predefinedproductline_create.tpl.php +++ b/htdocs/core/tpl/predefinedproductline_create.tpl.php @@ -32,6 +32,21 @@ if (! empty($conf->margin->enabled) && ! empty($object->element) && in_array($ob +
"> + + + + + + + global->MAIN_VIEW_LINE_NUMBER) ? ' colspan="4"' : ' colspan="3"'); ?>> ">  -"> - - - - - - > global->MAIN_VIEW_LINE_NUMBER) ? ' colspan="4"' : ' colspan="3"'); ?>> Create(); ?> - - % + + % global->DISPLAY_MARK_RATES)) $colspan++; ?> - - "> + + "> service->enabled) && $dateSelector) if (! empty($conf->global->DISPLAY_MARK_RATES)) $colspan++; } ?> + > ; text-align: ; } th.liste_titre, td.liste_titre { padding-left: 6px; padding-right: 6px; - /*vertical-align: text-top;*/ + white-space: ; } th.liste_titre_sel, td.liste_titre_sel { background-position: top right; color: #A51B00; font-weight: bold; - white-space: nowrap; + white-space: ; } input.liste_titre { diff --git a/htdocs/theme/eldy/style.css.php b/htdocs/theme/eldy/style.css.php index b5b380f5158..1fbca3e51a0 100644 --- a/htdocs/theme/eldy/style.css.php +++ b/htdocs/theme/eldy/style.css.php @@ -238,7 +238,7 @@ input, input.flat, textarea, textarea.flat, form.flat select, select.flat { background: #FDFDFD; border: 1px solid #C0C0C0; - padding: 1px 1px 1px 1px; + /*padding: 1px 1px 1px 1px; */ margin: 0px 0px 0px 0px; }