Merge branch 'develop' of git+ssh://git@github.com/Dolibarr/dolibarr.git into develop

This commit is contained in:
Regis Houssin
2012-08-03 20:10:01 +02:00
10 changed files with 876 additions and 864 deletions

View File

@@ -27,6 +27,7 @@ require_once(DOL_DOCUMENT_ROOT."/core/lib/company.lib.php");
require_once(DOL_DOCUMENT_ROOT."/compta/facture/class/facture.class.php"); require_once(DOL_DOCUMENT_ROOT."/compta/facture/class/facture.class.php");
$langs->load("companies"); $langs->load("companies");
$langs->load('other');
if ($conf->facture->enabled) $langs->load("bills"); if ($conf->facture->enabled) $langs->load("bills");
// Security check // Security check

View File

@@ -1930,16 +1930,6 @@ class Facture extends CommonInvoice
$rangtouse = $rangmax + 1; $rangtouse = $rangmax + 1;
} }
// TODO A virer
// Anciens indicateurs: $price, $remise (a ne plus utiliser)
//$price = $pu;
//$remise = 0;
//if ($remise_percent > 0)
//{
// $remise = round(($pu * $remise_percent / 100),2);
// $price = ($pu - $remise);
//}
$product_type=$type; $product_type=$type;
if ($fk_product) if ($fk_product)
{ {
@@ -1980,10 +1970,6 @@ class Facture extends CommonInvoice
$this->line->fk_fournprice = $fk_fournprice; $this->line->fk_fournprice = $fk_fournprice;
$this->line->pa_ht = $pa_ht; $this->line->pa_ht = $pa_ht;
// TODO Ne plus utiliser
//$this->line->price=($this->type==2?-1:1)*abs($price);
//$this->line->remise=($this->type==2?-1:1)*abs($remise);
$result=$this->line->insert(); $result=$this->line->insert();
if ($result > 0) if ($result > 0)
{ {

View File

@@ -2189,11 +2189,6 @@ abstract class CommonObject
{ {
$nb=0; $nb=0;
//if (empty($this->table_element_line)) dol_print_error('Call hasPredefinedProducts on a class with no table_element_line property');
//$sql ='SELECT COUNT(rowid) FROM '.MAIN_DB_PREFIX.$this->table_element_line;
//$sql.='WHERE ...';
//var_dump($this->lines);
foreach($this->lines as $key => $val) foreach($this->lines as $key => $val)
{ {
$qualified=0; $qualified=0;

View File

@@ -346,7 +346,7 @@ class Form
* @return string Code html du tooltip (texte+picto) * @return string Code html du tooltip (texte+picto)
* @see Use function textwithpicto if you can. * @see Use function textwithpicto if you can.
*/ */
function textwithtooltip($text,$htmltext,$tooltipon=1,$direction=0,$img='',$extracss='',$notabs=0,$incbefore='',$noencodehtmltext=0) function textwithtooltip($text, $htmltext, $tooltipon = 1, $direction = 0, $img = '', $extracss = '', $notabs = 0, $incbefore = '', $noencodehtmltext = 0)
{ {
global $conf; global $conf;
@@ -402,18 +402,24 @@ class Form
* @param int $noencodehtmltext Do not encode into html entity the htmltext * @param int $noencodehtmltext Do not encode into html entity the htmltext
* @return string HTML code of text, picto, tooltip * @return string HTML code of text, picto, tooltip
*/ */
function textwithpicto($text,$htmltext,$direction=1,$type='help',$extracss='',$noencodehtmltext=0) function textwithpicto($text, $htmltext, $direction = 1, $type = 'help', $extracss = '', $noencodehtmltext = 0)
{ {
global $conf; global $conf;
if ("$type" == "0") $type='info'; // For backward compatibility $alt = '';
//For backwards compatibility
if ($type == '0') $type = 'info';
elseif ($type == '1') $type = 'help';
$alt='';
// If info or help with no javascript, show only text // If info or help with no javascript, show only text
if (empty($conf->use_javascript_ajax)) if (empty($conf->use_javascript_ajax))
{ {
if ($type == 'info' || $type == 'help') return $text; if ($type == 'info' || $type == 'help') return $text;
else { $alt=$htmltext; $htmltext=''; else
{
$alt = $htmltext;
$htmltext = '';
} }
} }
// If info or help with smartphone, show only text // If info or help with smartphone, show only text
@@ -421,15 +427,14 @@ class Form
{ {
if ($type == 'info' || $type == 'help') return $text; if ($type == 'info' || $type == 'help') return $text;
} }
// Info or help
if ($type == 'info') $img=img_help(0,$alt);
if ($type == 'help' || $type ==1) $img=img_help(1,$alt);
if ($type == 'superadmin') $img=img_picto($alt,"redstar");
if ($type == 'admin') $img=img_picto($alt,"star");
// Warnings
if ($type == 'warning') $img=img_warning($alt);
return $this->textwithtooltip($text,$htmltext,2,$direction,$img,$extracss,0,'',$noencodehtmltext); if ($type == 'info') $img = img_help(0, $alt);
elseif ($type == 'help') $img = img_help(1, $alt);
elseif ($type == 'superadmin') $img = img_picto($alt, 'redstar');
elseif ($type == 'admin') $img = img_picto($alt, 'star');
elseif ($type == 'warning') $img = img_warning($alt);
return $this->textwithtooltip($text, $htmltext, 2, $direction, $img, $extracss, 0, '', $noencodehtmltext);
} }
/** /**

View File

@@ -1707,13 +1707,26 @@ function img_picto($alt, $picto, $options='', $pictoisfullpath=0)
* @return string Return img tag * @return string Return img tag
* @see #img_object, #img_picto * @see #img_object, #img_picto
*/ */
function img_picto_common($alt, $picto, $options='', $pictoisfullpath=0) function img_picto_common($alt, $picto, $options = '', $pictoisfullpath = 0)
{ {
global $conf; global $conf;
if (! preg_match('/(\.png|\.gif)$/i',$picto)) $picto.='.png';
if ($pictoisfullpath) return '<img src="'.$picto.'" border="0" alt="'.dol_escape_htmltag($alt).'" title="'.dol_escape_htmltag($alt).'"'.($options?' '.$options:'').'>'; if (! preg_match('/(\.png|\.gif)$/i', $picto)) $picto .= '.png';
if (! empty($conf->global->MAIN_MODULE_CAN_OVERWRITE_COMMONICONS) && file_exists(DOL_DOCUMENT_ROOT.'/theme/'.$conf->theme.'/img/'.$picto)) return '<img src="'.DOL_URL_ROOT.'/theme/'.$conf->theme.'/img/'.$picto.'" border="0" alt="'.dol_escape_htmltag($alt).'" title="'.dol_escape_htmltag($alt).'"'.($options?' '.$options:'').'>';
return '<img src="'.DOL_URL_ROOT.'/theme/common/'.$picto.'" border="0" alt="'.dol_escape_htmltag($alt).'" title="'.dol_escape_htmltag($alt).'"'.($options?' '.$options:'').'>'; if ($pictoisfullpath) $path = $picto;
else
{
$path = DOL_URL_ROOT.'/theme/common/'.$picto;
if (! empty($conf->global->MAIN_MODULE_CAN_OVERWRITE_COMMONICONS))
{
$themepath = DOL_DOCUMENT_ROOT.'/theme/'.$conf->theme.'/img/'.$picto;
if (file_exists($themepath)) return img_picto($alt, $themepath, $options, 1);
}
}
return img_picto($alt, $path, $options, 1);
} }
/** /**
@@ -1725,16 +1738,18 @@ function img_picto_common($alt, $picto, $options='', $pictoisfullpath=0)
*/ */
function img_action($alt, $numaction) function img_action($alt, $numaction)
{ {
global $conf,$langs; global $conf, $langs;
if ($alt=="default")
if ($alt == 'default')
{ {
if ($numaction == -1) $alt=$langs->transnoentitiesnoconv("ChangeDoNotContact"); if ($numaction == -1) $alt = $langs->transnoentitiesnoconv('ChangeDoNotContact');
if ($numaction == 0) $alt=$langs->transnoentitiesnoconv("ChangeNeverContacted"); if ($numaction == 0) $alt = $langs->transnoentitiesnoconv('ChangeNeverContacted');
if ($numaction == 1) $alt=$langs->transnoentitiesnoconv("ChangeToContact"); if ($numaction == 1) $alt = $langs->transnoentitiesnoconv('ChangeToContact');
if ($numaction == 2) $alt=$langs->transnoentitiesnoconv("ChangeContactInProcess"); if ($numaction == 2) $alt = $langs->transnoentitiesnoconv('ChangeContactInProcess');
if ($numaction == 3) $alt=$langs->transnoentitiesnoconv("ChangeContactDone"); if ($numaction == 3) $alt = $langs->transnoentitiesnoconv('ChangeContactDone');
} }
return '<img src="'.DOL_URL_ROOT.'/theme/'.$conf->theme.'/img/stcomm'.$numaction.'.png" border="0" alt="'.dol_escape_htmltag($alt).'" title="'.dol_escape_htmltag($alt).'">';
return img_picto($alt, 'stcomm'.$numaction.'.png');
} }
/** /**
@@ -1744,11 +1759,13 @@ function img_action($alt, $numaction)
* @param int $size Taille de l'icone : 3 = 16x16px , 2 = 14x14px * @param int $size Taille de l'icone : 3 = 16x16px , 2 = 14x14px
* @return string Retourne tag img * @return string Retourne tag img
*/ */
function img_pdf($alt = "default",$size=3) function img_pdf($alt = 'default', $size = 3)
{ {
global $conf,$langs; global $conf, $langs;
if ($alt=="default") $alt=$langs->trans("Show");
return '<img src="'.DOL_URL_ROOT.'/theme/'.$conf->theme.'/img/pdf'.$size.'.png" border="0" alt="'.dol_escape_htmltag($alt).'" title="'.dol_escape_htmltag($alt).'">'; if ($alt == 'default') $alt = $langs->trans('Show');
return img_picto($alt, 'pdf'.$size.'.png');
} }
/** /**
@@ -1757,11 +1774,13 @@ function img_pdf($alt = "default",$size=3)
* @param string $alt Texte sur le alt de l'image * @param string $alt Texte sur le alt de l'image
* @return string Return tag img * @return string Return tag img
*/ */
function img_edit_add($alt = "default") function img_edit_add($alt = 'default')
{ {
global $conf,$langs; global $conf, $langs;
if ($alt=="default") $alt=$langs->trans("Add");
return img_picto($alt,'edit_add.png'); if ($alt == 'default') $alt = $langs->trans('Add');
return img_picto($alt, 'edit_add.png');
} }
/** /**
* Show logo - * Show logo -
@@ -1769,11 +1788,13 @@ function img_edit_add($alt = "default")
* @param string $alt Texte sur le alt de l'image * @param string $alt Texte sur le alt de l'image
* @return string Retourne tag img * @return string Retourne tag img
*/ */
function img_edit_remove($alt = "default") function img_edit_remove($alt = 'default')
{ {
global $conf,$langs; global $conf, $langs;
if ($alt=="default") $alt=$langs->trans("Remove");
return img_picto($alt,'edit_remove.png'); if ($alt == 'default') $alt = $langs->trans('Remove');
return img_picto($alt, 'edit_remove.png');
} }
/** /**
@@ -1784,15 +1805,13 @@ function img_edit_remove($alt = "default")
* @param string $other Add more attributes on img * @param string $other Add more attributes on img
* @return string Retourne tag img * @return string Retourne tag img
*/ */
function img_edit($alt = "default", $float=0, $other='') function img_edit($alt = 'default', $float = 0, $other = '')
{ {
global $conf,$langs; global $conf, $langs;
if ($alt=="default") $alt=$langs->trans("Modify");
$img='<img src="'.DOL_URL_ROOT.'/theme/'.$conf->theme.'/img/edit.png" border="0" alt="'.dol_escape_htmltag($alt).'" title="'.dol_escape_htmltag($alt).'"'; if ($alt == 'default') $alt = $langs->trans('Modify');
if ($float) $img.=' style="float: right"';
if ($other) $img.=' '.$other; return img_picto($alt, 'edit.png', ($float ? 'style="float: right"' : $other));
$img.='>';
return $img;
} }
/** /**
@@ -1803,15 +1822,15 @@ function img_edit($alt = "default", $float=0, $other='')
* @param string $other Add more attributes on img * @param string $other Add more attributes on img
* @return string Retourne tag img * @return string Retourne tag img
*/ */
function img_view($alt = "default", $float=0, $other='') function img_view($alt = 'default', $float = 0, $other = '')
{ {
global $conf,$langs; global $conf, $langs;
if ($alt=="default") $alt=$langs->trans("View");
$img='<img src="'.DOL_URL_ROOT.'/theme/'.$conf->theme.'/img/view.png" border="0" alt="'.dol_escape_htmltag($alt).'" title="'.dol_escape_htmltag($alt).'"'; if ($alt == 'default') $alt = $langs->trans('View');
if ($float) $img.=' style="float: right"';
if ($other) $img.=' '.$other; $options = ($float ? 'style="float: right" ' : '').$other;
$img.='>';
return $img; return img_picto($alt, 'view.png', $options);
} }
/** /**
@@ -1821,13 +1840,14 @@ function img_view($alt = "default", $float=0, $other='')
* @param string $other Add more attributes on img * @param string $other Add more attributes on img
* @return string Retourne tag img * @return string Retourne tag img
*/ */
function img_delete($alt = "default", $other='') function img_delete($alt = 'default', $other = '')
{ {
global $conf,$langs; global $conf, $langs;
if ($alt=="default") $alt=$langs->trans("Delete");
return img_picto($alt,'delete.png',$other);
}
if ($alt == 'default') $alt = $langs->trans('Delete');
return img_picto($alt, 'delete.png', $other);
}
/** /**
* Show help logo with cursor "?" * Show help logo with cursor "?"
@@ -1836,188 +1856,175 @@ function img_delete($alt = "default", $other='')
* @param string $usealttitle Text to use as alt title * @param string $usealttitle Text to use as alt title
* @return string Retourne tag img * @return string Retourne tag img
*/ */
function img_help($usehelpcursor=1,$usealttitle=1) function img_help($usehelpcursor = 1, $usealttitle = 1)
{ {
global $conf,$langs; global $conf, $langs;
$s ='<img ';
if ($usehelpcursor) $s.='style="cursor: help;" ';
$s.='src="'.DOL_URL_ROOT.'/theme/'.$conf->theme.'/img/info.png" border="0"';
if ($usealttitle) if ($usealttitle)
{ {
if (is_string($usealttitle)) $s.=' alt="'.dol_escape_htmltag($usealttitle).'" title="'.dol_escape_htmltag($usealttitle).'"'; if (is_string($usealttitle)) $alt = dol_escape_htmltag($usealttitle);
else $s.=' alt="'.$langs->trans("Info").'" title="'.$langs->trans("Info").'"'; else $alt = $langs->trans('Info');
} }
else $s.=' alt=""';
$s.='>'; return img_picto($usealttitle, 'info.png', ($usehelpcursor ? 'style="cursor: help"' : ''));
return $s;
} }
/** /**
* Affiche logo info * Show info logo
* *
* @param string $alt Text to show on alt image * @param string $alt Text to show on alt image
* @return string Return img tag * @return string Return img tag
*/ */
function img_info($alt = "default") function img_info($alt = 'default')
{ {
global $conf,$langs; global $conf, $langs;
if ($alt=="default") $alt=$langs->trans("Informations");
return img_picto($alt,'info.png'); if ($alt == 'default') $alt = $langs->trans('Informations');
return img_picto($alt, 'info.png');
} }
/** /**
* Show logo warning * Show warning logo
* *
* @param string $alt Text to show on alt image * @param string $alt Text to show on alt image
* @param int $float If we must add style "float: right" * @param int $float If we must add style "float: right"
* @return string Return img tag * @return string Return img tag
*/ */
function img_warning($alt = "default",$float=0) function img_warning($alt = 'default', $float = 0)
{ {
global $conf,$langs; global $conf, $langs;
if ($alt=="default") $alt=$langs->trans("Warning");
return img_picto($alt,'warning.png',$float?'style="float: right"':''); if ($alt == 'default') $alt = $langs->trans('Warning');
return img_picto($alt, 'warning.png', ($float ? 'style="float: right"' : ''));
} }
/** /**
* Affiche logo error * Show error logo
* *
* @param string $alt Text to show on alt image * @param string $alt Text to show on alt image
* @return string Return img tag * @return string Return img tag
*/ */
function img_error($alt = "default") function img_error($alt = 'default')
{ {
global $conf,$langs; global $conf, $langs;
if ($alt=="default") $alt=$langs->trans("Error");
return img_picto($alt,'error.png'); if ($alt == 'default') $alt = $langs->trans('Error');
return img_picto($alt, 'error.png');
} }
/** /**
* Affiche logo telephone * Show next logo
*
* @param string $alt Text to show on alt image
* @param int $option Option
* @return string Return img tag
*/
function img_phone($alt = "default",$option=0)
{
global $conf,$langs;
if ($alt=="default") $alt=$langs->trans("Call");
$img='call_out';
if ($option == 1) $img='call';
$img='object_commercial';
return '<img src="'.DOL_URL_ROOT.'/theme/'.$conf->theme.'/img/'.$img.'.png" border="0" alt="'.dol_escape_htmltag($alt).'" title="'.dol_escape_htmltag($alt).'">';
}
/**
* Affiche logo suivant
* *
* @param string $alt Text to show on alt image * @param string $alt Text to show on alt image
* @return string Return img tag * @return string Return img tag
*/ */
function img_next($alt = "default") function img_next($alt = 'default')
{ {
global $conf,$langs; global $conf, $langs;
if ($alt=="default") {
$alt=$langs->trans("Next"); if ($alt == 'default') $alt = $langs->trans('Next');
}
return '<img src="'.DOL_URL_ROOT.'/theme/'.$conf->theme.'/img/next.png" border="0" alt="'.dol_escape_htmltag($alt).'" title="'.dol_escape_htmltag($alt).'">'; return img_picto($alt, 'next.png');
} }
/** /**
* Affiche logo precedent * Show previous logo
* *
* @param string $alt Text to show on alt image * @param string $alt Text to show on alt image
* @return string Return img tag * @return string Return img tag
*/ */
function img_previous($alt = "default") function img_previous($alt = 'default')
{ {
global $conf,$langs; global $conf, $langs;
if ($alt=="default") $alt=$langs->trans("Previous");
return '<img src="'.DOL_URL_ROOT.'/theme/'.$conf->theme.'/img/previous.png" border="0" alt="'.dol_escape_htmltag($alt).'" title="'.dol_escape_htmltag($alt).'">'; if ($alt == 'default') $alt = $langs->trans('Previous');
return img_picto($alt, 'previous.png');
} }
/** /**
* Show logo down arrow * Show down arrow logo
* *
* @param string $alt Text to show on alt image * @param string $alt Text to show on alt image
* @param int $selected Selected * @param int $selected Selected
* @return string Return img tag * @return string Return img tag
*/ */
function img_down($alt = "default", $selected=0) function img_down($alt = 'default', $selected = 0)
{ {
global $conf,$langs; global $conf, $langs;
if ($alt=="default") $alt=$langs->trans("Down");
if ($selected) return '<img src="'.DOL_URL_ROOT.'/theme/'.$conf->theme.'/img/1downarrow_selected.png" border="0" alt="'.dol_escape_htmltag($alt).'" title="'.dol_escape_htmltag($alt).'" class="imgdown">'; if ($alt == 'default') $alt = $langs->trans('Down');
else return '<img src="'.DOL_URL_ROOT.'/theme/'.$conf->theme.'/img/1downarrow.png" border="0" alt="'.dol_escape_htmltag($alt).'" title="'.dol_escape_htmltag($alt).'" class="imgdown">';
return img_picto($alt, ($selected ? '1downarrow_selected.png' : '1downarrow.png'), 'class="imgdown"');
} }
/** /**
* Show logo top arrow * Show top arrow logo
* *
* @param string $alt Text to show on alt image * @param string $alt Text to show on alt image
* @param int $selected Selected * @param int $selected Selected
* @return string Return img tag * @return string Return img tag
*/ */
function img_up($alt = "default", $selected=0) function img_up($alt = 'default', $selected = 0)
{ {
global $conf,$langs; global $conf, $langs;
if ($alt=="default") $alt=$langs->trans("Up");
if ($selected) return '<img src="'.DOL_URL_ROOT.'/theme/'.$conf->theme.'/img/1uparrow_selected.png" border="0" alt="'.dol_escape_htmltag($alt).'" title="'.dol_escape_htmltag($alt).'" class="imgup">'; if ($alt == 'default') $alt = $langs->trans('Up');
else return '<img src="'.DOL_URL_ROOT.'/theme/'.$conf->theme.'/img/1uparrow.png" border="0" alt="'.dol_escape_htmltag($alt).'" title="'.dol_escape_htmltag($alt).'" class="imgup">';
return img_picto($alt, ($selected ? '1uparrow_selected.png' : '1uparrow.png'), 'class="imgup"');
} }
/** /**
* Affiche logo gauche * Show left arrow logo
* *
* @param string $alt Text to show on alt image * @param string $alt Text to show on alt image
* @param int $selected Selected * @param int $selected Selected
* @return string Return img tag * @return string Return img tag
*/ */
function img_left($alt = "default", $selected=0) function img_left($alt = 'default', $selected = 0)
{ {
global $conf,$langs; global $conf, $langs;
if ($alt=="default") $alt=$langs->trans("Left");
if ($selected) return '<img src="'.DOL_URL_ROOT.'/theme/'.$conf->theme.'/img/1leftarrow_selected.png" border="0" alt="'.dol_escape_htmltag($alt).'" title="'.dol_escape_htmltag($alt).'">'; if ($alt == 'default') $alt = $langs->trans('Left');
else return '<img src="'.DOL_URL_ROOT.'/theme/'.$conf->theme.'/img/1leftarrow.png" border="0" alt="'.dol_escape_htmltag($alt).'" title="'.dol_escape_htmltag($alt).'">';
return img_picto($alt, ($selected ? '1leftarrow_selected.png' : '1leftarrow.png'));
} }
/** /**
* Affiche logo droite * Show right arrow logo
* *
* @param string $alt Text to show on alt image * @param string $alt Text to show on alt image
* @param int $selected Selected * @param int $selected Selected
* @return string Return img tag * @return string Return img tag
*/ */
function img_right($alt = "default", $selected=0) function img_right($alt = 'default', $selected = 0)
{ {
global $conf,$langs; global $conf, $langs;
if ($alt=="default") $alt=$langs->trans("Right");
if ($selected) return '<img src="'.DOL_URL_ROOT.'/theme/'.$conf->theme.'/img/1rightarrow_selected.png" border="0" alt="'.dol_escape_htmltag($alt).'" title="'.dol_escape_htmltag($alt).'">'; if ($alt == 'default') $alt = $langs->trans('Right');
else return '<img src="'.DOL_URL_ROOT.'/theme/'.$conf->theme.'/img/1rightarrow.png" border="0" alt="'.dol_escape_htmltag($alt).'" title="'.dol_escape_htmltag($alt).'">';
return img_picto($alt, ($selected ? '1rightarrow_selected.png' : '1rightarrow.png'));
} }
/** /**
* Affiche le logo tick si allow * Show tick logo if allowed
* *
* @param string $allow Allow * @param string $allow Allow
* @param string $alt Text to show on alt image * @param string $alt Text to show on alt image
* @return string Return img tag * @return string Return img tag
*/ */
function img_allow($allow,$alt='default') function img_allow($allow, $alt = 'default')
{ {
global $conf,$langs; global $conf, $langs;
if ($alt=="default") $alt=$langs->trans("Active");
if ($allow == 1) if ($alt == 'default') $alt = $langs->trans('Active');
{
return '<img src="'.DOL_URL_ROOT.'/theme/'.$conf->theme.'/img/tick.png" border="0" alt="'.dol_escape_htmltag($alt).'" title="'.dol_escape_htmltag($alt).'">'; if ($allow == 1) return img_picto($alt, 'tick.png');
}
else return '-';
{
return "-";
}
} }
@@ -2028,16 +2035,38 @@ function img_allow($allow,$alt='default')
* @param string $alt Alternate text to show on img mous hover * @param string $alt Alternate text to show on img mous hover
* @return string Return img tag * @return string Return img tag
*/ */
function img_mime($file,$alt='') function img_mime($file, $alt = '')
{ {
require_once(DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'); require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
$mimetype=dol_mimetype($file,'',1); $mimetype = dol_mimetype($file, '', 1);
$mimeimg=dol_mimetype($file,'',2); $mimeimg = dol_mimetype($file, '', 2);
if (empty($alt)) $alt='Mime type: '.$mimetype; if (empty($alt)) $alt = 'Mime type: '.$mimetype;
return '<img src="'.DOL_URL_ROOT.'/theme/common/mime/'.$mimeimg.'" border="0" alt="'.$alt.'" title="'.$alt.'">'; return img_picto_common($alt, 'mime/'.$mimeimg);
}
/**
* Show phone logo.
* Use img_picto instead.
*
* @param string $alt Text to show on alt image
* @param int $option Option
* @return string Return img tag
* @deprecated
*/
function img_phone($alt = 'default', $option = 0)
{
global $conf,$langs;
if ($alt == 'default') $alt = $langs->trans('Call');
if ($option == 1) $img = 'call';
else $img = 'call_out';
return img_picto($alt, $img);
} }
@@ -2048,23 +2077,16 @@ function img_mime($file,$alt='')
* @param string $infoonimgalt Info is shown only on alt of star picto, otherwise it is show on output after the star picto * @param string $infoonimgalt Info is shown only on alt of star picto, otherwise it is show on output after the star picto
* @return string String with info text * @return string String with info text
*/ */
function info_admin($text,$infoonimgalt=0) function info_admin($text, $infoonimgalt = 0)
{ {
global $conf,$langs; global $conf, $langs;
$s='';
if ($infoonimgalt) if ($infoonimgalt)
{ {
$s.=img_picto($text,'star'); return img_picto($text, 'star');
} }
else
{ return '<div class="info">'.img_picto($langs->trans('InfoAdmin'), 'star').' '.$text.'</div>';
$s.='<div class="info">';
$s.=img_picto($langs->trans("InfoAdmin"),'star');
$s.=' ';
$s.=$text;
$s.='</div>';
}
return $s;
} }
@@ -2090,8 +2112,8 @@ function dol_print_error($db='',$error='')
// Si erreur intervenue avant chargement langue // Si erreur intervenue avant chargement langue
if (! $langs) if (! $langs)
{ {
require_once(DOL_DOCUMENT_ROOT ."/core/class/translate.class.php"); require_once DOL_DOCUMENT_ROOT .'/core/class/translate.class.php';
$langs = new Translate("", $conf); $langs = new Translate('', $conf);
$langs->load("main"); $langs->load("main");
} }
$langs->load("main"); $langs->load("main");

View File

@@ -361,7 +361,7 @@ $moreheadjs=empty($conf->use_javascript_ajax)?"":"
}); });
</script>"; </script>";
llxHeader($moreheadcss.$moreheadjs,$langs->trans("ECM"),'','','','',$morejs,'',0,0); llxHeader($moreheadcss.$moreheadjs,$langs->trans("ECMArea"),'','','','',$morejs,'',0,0);
// Add sections to manage // Add sections to manage
@@ -466,7 +466,7 @@ if (empty($action) || $action == 'file_manager' || preg_match('/refresh/i',$acti
print img_picto_common('','treemenu/base.gif'); print img_picto_common('','treemenu/base.gif');
print '</td><td align="left">'; print '</td><td align="left">';
$txt=$langs->trans("ECMRoot").' ('.$langs->trans("ECMSectionsAuto").')'; $txt=$langs->trans("ECMRoot").' ('.$langs->trans("ECMSectionsAuto").')';
print $form->textwithpicto($txt,$htmltooltip,1,0); print $form->textwithpicto($txt, $htmltooltip, 1, 0);
print '</td>'; print '</td>';
print '</tr></table>'; print '</tr></table>';
print '</td>'; print '</td>';
@@ -512,7 +512,7 @@ if (empty($action) || $action == 'file_manager' || preg_match('/refresh/i',$acti
$htmltooltip='<b>'.$langs->trans("Type").'</b>: '.$langs->trans("ECMSectionAuto").'<br>'; $htmltooltip='<b>'.$langs->trans("Type").'</b>: '.$langs->trans("ECMSectionAuto").'<br>';
$htmltooltip.='<b>'.$langs->trans("ECMCreationUser").'</b>: '.$langs->trans("ECMTypeAuto").'<br>'; $htmltooltip.='<b>'.$langs->trans("ECMCreationUser").'</b>: '.$langs->trans("ECMTypeAuto").'<br>';
$htmltooltip.='<b>'.$langs->trans("Description").'</b>: '.$val['desc']; $htmltooltip.='<b>'.$langs->trans("Description").'</b>: '.$val['desc'];
print $form->textwithpicto('',$htmltooltip,1,"info"); print $form->textwithpicto('', $htmltooltip, 1, 'info');
print '</div>'; print '</div>';
print '</li>'; print '</li>';
@@ -534,7 +534,7 @@ if (empty($action) || $action == 'file_manager' || preg_match('/refresh/i',$acti
print img_picto_common('','treemenu/base.gif'); print img_picto_common('','treemenu/base.gif');
print '</td><td align="left">'; print '</td><td align="left">';
$txt=$langs->trans("ECMRoot").' ('.$langs->trans("ECMSectionsManual").')'; $txt=$langs->trans("ECMRoot").' ('.$langs->trans("ECMSectionsManual").')';
print $form->textwithpicto($txt,$htmltooltip,1,"info"); print $form->textwithpicto($txt, $htmltooltip, 1, 'info');
print '</td>'; print '</td>';
print '</tr></table></td>'; print '</tr></table></td>';
print '<td align="right">'; print '<td align="right">';
@@ -745,7 +745,7 @@ if (empty($action) || $action == 'file_manager' || preg_match('/refresh/i',$acti
$htmltooltip.='<b>'.$langs->trans("ECMNbOfFilesInDir").'</b>: '.$val['cachenbofdoc'].'<br>'; $htmltooltip.='<b>'.$langs->trans("ECMNbOfFilesInDir").'</b>: '.$val['cachenbofdoc'].'<br>';
if ($nbofsubdir) $htmltooltip.='<b>'.$langs->trans("ECMNbOfFilesInSubDir").'</b>: '.$nboffilesinsubdir; if ($nbofsubdir) $htmltooltip.='<b>'.$langs->trans("ECMNbOfFilesInSubDir").'</b>: '.$nboffilesinsubdir;
else $htmltooltip.='<b>'.$langs->trans("ECMNbOfSubDir").'</b>: '.$nbofsubdir.'<br>'; else $htmltooltip.='<b>'.$langs->trans("ECMNbOfSubDir").'</b>: '.$nbofsubdir.'<br>';
print $form->textwithpicto('',$htmltooltip,1,"info"); print $form->textwithpicto('', $htmltooltip, 1, 'info');
print "</td>"; print "</td>";
print '</tr></table>'; print '</tr></table>';

View File

@@ -364,6 +364,7 @@ if (! $error && $db->connected && $action == "set")
} }
} }
} }
if ($error) if ($error)
{ {
print "<tr><td>".$langs->trans("ErrorDirDoesNotExists",$main_data_dir); print "<tr><td>".$langs->trans("ErrorDirDoesNotExists",$main_data_dir);
@@ -377,14 +378,14 @@ if (! $error && $db->connected && $action == "set")
{ {
//ODT templates //ODT templates
require_once(DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'); require_once(DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php');
$srcroot='./doctemplates'; $srcroot=$main_dir.'/install/doctemplates';
$destroot=$main_data_dir.'/doctemplates'; $destroot=$main_data_dir.'/doctemplates';
$docs=array('thirdparties' => 'thirdparty', 'proposals' => 'proposal', 'orders' => 'order', 'invoices' => 'invoice'); $docs=array('thirdparties' => 'thirdparty', 'proposals' => 'proposal', 'orders' => 'order', 'invoices' => 'invoice');
foreach($docs as $dir => $file) foreach($docs as $cursordir => $cursorfile)
{ {
$src=$srcroot.'/thirdparties/template_'.$file.'.odt'; $src=$srcroot.'/'.$cursordir.'/template_'.$cursorfile.'.odt';
$dirodt=$destroot.'/'.$dir; $dirodt=$destroot.'/'.$cursordir;
$dest=$dirodt.'/template_'.$file.'.odt'; $dest=$dirodt.'/template_'.$cursorfile.'.odt';
dol_mkdir($dirodt); dol_mkdir($dirodt);
$result=dol_copy($src,$dest,0,0); $result=dol_copy($src,$dest,0,0);

View File

@@ -9,18 +9,20 @@
CHARSET=UTF-8 CHARSET=UTF-8
DIRECTION=ltr DIRECTION=ltr
FONTFORPDF=DejaVuSans
FONTSIZEFORPDF=8
SeparatorDecimal=. SeparatorDecimal=.
SeparatorThousand=, SeparatorThousand=,
FormatDateShort=%d/%m/%Y FormatDateShort=%d/%m/%Y
FormatDateShortJava=dd/mm/yyyy FormatDateShortJava=dd/MM/yyyy
FormatDateShortJQuery=dd/mm/yy FormatDateShortJQuery=dd/mm/yy
FormatHourShort=%I:%M%p FormatHourShort=%H:%M
FormatHourShortDuration=%H:%M FormatHourShortDuration=%H:%M
FormatDateTextShort=%b%d%Y FormatDateTextShort=%d %b %Y
FormatDateText=%D%B%Y FormatDateText=%d %B %Y
FormatDateHourShort=%d/%m/%Y %I:%M%p FormatDateHourShort=%d/%m/%Y %H:%M
FormatDateHourTextShort=%b %d,%Y,%I:%M %p FormatDateHourTextShort=%d %b %Y %H:%M
FormatDateHourText=%D %B %Y,%I:%M %p FormatDateHourText=%d %B %Y %H:%M
DatabaseConnection=Veritabanı bağlantısı DatabaseConnection=Veritabanı bağlantısı
NoError=Hata yok NoError=Hata yok
Error=Hata Error=Hata
@@ -364,8 +366,8 @@ Popularity=Popülerlik
Categories=Kategoriler Categories=Kategoriler
Category=Kategori Category=Kategori
By=Tarafından By=Tarafından
From=Kimden From=Başlama
to=kadar to=Bitiş
and=ve and=ve
or=veya or=veya
Other=Diğer Other=Diğer
@@ -474,7 +476,7 @@ File=Dosya
Files=Dosyalar Files=Dosyalar
NotAllowed=İzin verilmez NotAllowed=İzin verilmez
ReadPermissionNotAllowed=Okuma izni yok ReadPermissionNotAllowed=Okuma izni yok
AmountInCurrency=Para birimi tutarı %s AmountInCurrency=Para birimi: %s
Example=Örnek Example=Örnek
Examples=Örnekler Examples=Örnekler
NoExample=Örnek yok NoExample=Örnek yok
@@ -656,6 +658,3 @@ ShortThursday=Pe
ShortFriday=Cu ShortFriday=Cu
ShortSaturday=Ct ShortSaturday=Ct
ShortSunday=Pa ShortSunday=Pa
FONTFORPDF=DejaVuSans
FONTSIZEFORPDF=8
WelcomeString=% <font class

View File

@@ -541,6 +541,7 @@ class Project extends CommonObject
if (!$error) if (!$error)
{ {
$this->statut=1;
$this->db->commit(); $this->db->commit();
return 1; return 1;
} }

View File

@@ -314,7 +314,7 @@ if ($action == 'confirm_clone' && $user->rights->projet->creer && GETPOST('confi
} }
else else
{ {
$object->id=$result; $object->fetch($result); // Load new object
$action='edit'; $action='edit';
$comefromclone=true; $comefromclone=true;
} }
@@ -494,7 +494,9 @@ else
// Customer // Customer
print '<tr><td>'.$langs->trans("Company").'</td><td>'; print '<tr><td>'.$langs->trans("Company").'</td><td>';
print $form->select_company($object->societe->id,'socid','',1,1); $text=$form->select_company($object->societe->id,'socid','',1,1);
$texthelp=$langs->trans("IfNeedToUseOhterObjectKeepEmpty");
print $form->textwithtooltip($text.' '.img_help(),$texthelp,1);
print '</td></tr>'; print '</td></tr>';
// Visibility // Visibility