302 changes: 232 additions & 70 deletions htdocs/compta/stats/casoc.php

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion htdocs/contrat/note.php
Expand Up @@ -50,7 +50,7 @@

if ($action == 'setnote_public' && $user->rights->contrat->creer)
{
$result=$object->update_note(dol_html_entity_decode(dol_htmlcleanlastbr(GETPOST('note_public')), ENT_QUOTES),'_pubic');
$result=$object->update_note(dol_html_entity_decode(dol_htmlcleanlastbr(GETPOST('note_public')), ENT_QUOTES),'_public');
if ($result < 0) dol_print_error($db,$object->error);
}

Expand Down
139 changes: 43 additions & 96 deletions htdocs/core/ajax/ajaxdirpreview.php
Expand Up @@ -4,6 +4,7 @@
* Copyright (C) 2005 Simon Tosser <simon@kornog-computing.com>
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2010 Pierre Morin <pierre.morin@auguria.net>
* Copyright (C) 2013 Marcos GarcĂ­a <marcosgdf@gmail.com>
*
* 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
Expand Down Expand Up @@ -139,8 +140,7 @@
print '<!-- TYPE='.$type.' -->'."\n";
print '<!-- Page called with mode='.(isset($mode)?$mode:'').' type='.$type.' module='.$module.' url='.$_SERVER["PHP_SELF"].'?'.$_SERVER["QUERY_STRING"].' -->'."\n";

$param='';
$param.=($sortfield?'&sortfield='.$sortfield:'').($sortorder?'&sortorder='.$sortorder:'');
$param=($sortfield?'&sortfield='.$sortfield:'').($sortorder?'&sortorder='.$sortorder:'');
$url=DOL_URL_ROOT.'/ecm/index.php';

// Dir scan
Expand All @@ -149,126 +149,73 @@
$formfile=new FormFile($db);

$maxlengthname=40;
$excludefiles = array('^SPECIMEN\.pdf$','^\.','\.meta$','^temp$','^payments$','^CVS$','^thumbs$');
$sorting = (strtolower($sortorder)=='desc'?SORT_DESC:SORT_ASC);

// Right area. If module is defined, we are in automatic ecm.
if ($module == 'company') // Auto area for suppliers invoices
{
$upload_dir = $conf->societe->dir_output; // TODO change for multicompany sharing
$filearray=dol_dir_list($upload_dir,"files",1,'',array('^SPECIMEN\.pdf$','^\.','\.meta$','^temp$','^payments$','^CVS$','^thumbs$'),$sortfield,(strtolower($sortorder)=='desc'?SORT_DESC:SORT_ASC),1);

$param.='&module='.$module;
$textifempty=($section?$langs->trans("NoFileFound"):($showonrightsize=='featurenotyetavailable'?$langs->trans("FeatureNotYetAvailable"):$langs->trans("NoFileFound")));

$formfile->list_of_autoecmfiles($upload_dir,$filearray,$module,$param,1,'',$user->rights->ecm->upload,1,$textifempty,$maxlengthname,$url);
}
else if ($module == 'invoice') // Auto area for suppliers invoices
{
$upload_dir = $conf->facture->dir_output;
$filearray=dol_dir_list($upload_dir,"files",1,'',array('^SPECIMEN\.pdf$','^\.','\.meta$','^temp$','^payments$','^CVS$','^thumbs$'),$sortfield,(strtolower($sortorder)=='desc'?SORT_DESC:SORT_ASC),1);

$param.='&module='.$module;
$textifempty=($section?$langs->trans("NoFileFound"):($showonrightsize=='featurenotyetavailable'?$langs->trans("FeatureNotYetAvailable"):$langs->trans("NoFileFound")));

$formfile->list_of_autoecmfiles($upload_dir,$filearray,$module,$param,1,'',$user->rights->ecm->upload,1,$textifempty,$maxlengthname,$url);
}
else if ($module == 'invoice_supplier') // Auto area for suppliers invoices
$automodules = array('company', 'invoice', 'invoice_supplier', 'propal', 'order', 'order_supplier', 'contract', 'product', 'tax', 'project');

// TODO change for multicompany sharing
// Auto area for suppliers invoices
if ($module == 'company') $upload_dir = $conf->societe->dir_output;
// Auto area for suppliers invoices
else if ($module == 'invoice') $upload_dir = $conf->facture->dir_output;
// Auto area for suppliers invoices
else if ($module == 'invoice_supplier')
{
$relativepath='facture';
$upload_dir = $conf->fournisseur->dir_output.'/'.$relativepath;
$filearray=dol_dir_list($upload_dir,"files",1,'',array('^SPECIMEN\.pdf$','^\.','\.meta$','^temp$','^CVS$','^thumbs$'),$sortfield,(strtolower($sortorder)=='desc'?SORT_DESC:SORT_ASC),1);
$param.='&module='.$module;
$textifempty=($section?$langs->trans("NoFileFound"):($showonrightsize=='featurenotyetavailable'?$langs->trans("FeatureNotYetAvailable"):$langs->trans("NoFileFound")));
$formfile->list_of_autoecmfiles($upload_dir,$filearray,$module,$param,1,'',$user->rights->ecm->upload,1,$textifempty,$maxlengthname,$url);
}
else if ($module == 'propal') // Auto area for customers orders
{
$upload_dir = $conf->propal->dir_output;
$filearray=dol_dir_list($upload_dir,"files",1,'',array('^SPECIMEN\.pdf$','^\.','\.meta$','^temp$','^payments$','^CVS$','^thumbs$'),$sortfield,(strtolower($sortorder)=='desc'?SORT_DESC:SORT_ASC),1);

$param.='&module='.$module;
$textifempty=($section?$langs->trans("NoFileFound"):($showonrightsize=='featurenotyetavailable'?$langs->trans("FeatureNotYetAvailable"):$langs->trans("NoFileFound")));

$formfile->list_of_autoecmfiles($upload_dir,$filearray,$module,$param,1,'',$user->rights->ecm->upload,1,$textifempty,$maxlengthname,$url);
}
else if ($module == 'order') // Auto area for customers orders
{
$upload_dir = $conf->commande->dir_output;
$filearray=dol_dir_list($upload_dir,"files",1,'',array('^SPECIMEN\.pdf$','^\.','\.meta$','^temp$','^payments$','^CVS$','^thumbs$'),$sortfield,(strtolower($sortorder)=='desc'?SORT_DESC:SORT_ASC),1);

$param.='&module='.$module;
$textifempty=($section?$langs->trans("NoFileFound"):($showonrightsize=='featurenotyetavailable'?$langs->trans("FeatureNotYetAvailable"):$langs->trans("NoFileFound")));

$formfile->list_of_autoecmfiles($upload_dir,$filearray,$module,$param,1,'',$user->rights->ecm->upload,1,$textifempty,$maxlengthname,$url);
}
else if ($module == 'order_supplier') // Auto area for suppliers orders
// Auto area for customers orders
else if ($module == 'propal') $upload_dir = $conf->propal->dir_output;
// Auto area for customers orders
else if ($module == 'order') $upload_dir = $conf->commande->dir_output;
// Auto area for suppliers orders
else if ($module == 'order_supplier')
{
$relativepath='commande';
$upload_dir = $conf->fournisseur->dir_output.'/'.$relativepath;
$filearray=dol_dir_list($upload_dir,"files",1,'',array('^SPECIMEN\.pdf$','^\.','\.meta$','^temp$','^payments$','^CVS$','^thumbs$'),$sortfield,(strtolower($sortorder)=='desc'?SORT_DESC:SORT_ASC),1);

$param.='&module='.$module;
$textifempty=($section?$langs->trans("NoFileFound"):($showonrightsize=='featurenotyetavailable'?$langs->trans("FeatureNotYetAvailable"):$langs->trans("NoFileFound")));

$formfile->list_of_autoecmfiles($upload_dir,$filearray,$module,$param,1,'',$user->rights->ecm->upload,1,$textifempty,$maxlengthname,$url);
}
else if ($module == 'contract') // Auto area for suppliers invoices
// Auto area for suppliers invoices
else if ($module == 'contract') $upload_dir = $conf->contrat->dir_output;
// Auto area for products
else if ($module == 'product') $upload_dir = $conf->product->dir_output;
// Auto area for suppliers invoices
else if ($module == 'tax') $upload_dir = $conf->tax->dir_output;
// Auto area for projects
else if ($module == 'project') $upload_dir = $conf->projet->dir_output;

if (in_array($module, $automodules))
{
$upload_dir = $conf->contrat->dir_output;
$filearray=dol_dir_list($upload_dir,"files",1,'',array('^SPECIMEN\.pdf$','^\.','\.meta$','^temp$','^CVS$','^thumbs$'),$sortfield,(strtolower($sortorder)=='desc'?SORT_DESC:SORT_ASC),1);

$param.='&module='.$module;
$textifempty=($section?$langs->trans("NoFileFound"):($showonrightsize=='featurenotyetavailable'?$langs->trans("FeatureNotYetAvailable"):$langs->trans("NoFileFound")));

$formfile->list_of_autoecmfiles($upload_dir,$filearray,$module,$param,1,'',$user->rights->ecm->upload,1,$textifempty,$maxlengthname,$url);
}
else if ($module == 'product') // Auto area for products
{
$upload_dir = $conf->product->dir_output;
$filearray=dol_dir_list($upload_dir,"files",1,'',array('^SPECIMEN\.pdf$','^\.','\.meta$','^temp$','^CVS$','^thumbs$'),$sortfield,(strtolower($sortorder)=='desc'?SORT_DESC:SORT_ASC),1);

$param.='&module='.$module;
$textifempty=($section?$langs->trans("NoFileFound"):($showonrightsize=='featurenotyetavailable'?$langs->trans("FeatureNotYetAvailable"):$langs->trans("NoFileFound")));

$filearray=dol_dir_list($upload_dir,"files",1,'', $excludefiles, $sortfield, $sorting,1);
$formfile->list_of_autoecmfiles($upload_dir,$filearray,$module,$param,1,'',$user->rights->ecm->upload,1,$textifempty,$maxlengthname,$url);
}
else if ($module == 'tax') // Auto area for suppliers invoices
{
$upload_dir = $conf->tax->dir_output;
$filearray=dol_dir_list($upload_dir,"files",1,'',array('^SPECIMEN\.pdf$','^\.','\.meta$','^temp$','^CVS$','^thumbs$'),$sortfield,(strtolower($sortorder)=='desc'?SORT_DESC:SORT_ASC),1);

$param.='&module='.$module;
$textifempty=($section?$langs->trans("NoFileFound"):($showonrightsize=='featurenotyetavailable'?$langs->trans("FeatureNotYetAvailable"):$langs->trans("NoFileFound")));

$formfile->list_of_autoecmfiles($upload_dir,$filearray,$module,$param,1,'',$user->rights->ecm->upload,1,$textifempty,$maxlengthname,$url);
}
else if ($module == 'project') // Auto area for projects
{
$upload_dir = $conf->projet->dir_output;
$filearray=dol_dir_list($upload_dir,"files",1,'',array('^SPECIMEN\.pdf$','^\.','\.meta$','^temp$','^CVS$','^thumbs$'),$sortfield,(strtolower($sortorder)=='desc'?SORT_DESC:SORT_ASC),1);

$param.='&module='.$module;
$textifempty=($section?$langs->trans("NoFileFound"):($showonrightsize=='featurenotyetavailable'?$langs->trans("FeatureNotYetAvailable"):$langs->trans("NoFileFound")));

$formfile->list_of_autoecmfiles($upload_dir,$filearray,$module,$param,1,'',$user->rights->ecm->upload,1,$textifempty,$maxlengthname,$url);
}
else // Manual area
//Manual area
else
{
$relativepath=$ecmdir->getRelativePath();
$upload_dir = $conf->ecm->dir_output.'/'.$relativepath;

$filearray=dol_dir_list($upload_dir,"files",0,'',array('^\.','\.meta$','^temp$','^CVS$'),$sortfield,(strtolower($sortorder)=='desc'?SORT_DESC:SORT_ASC),1);

if ($section) $param.='&section='.$section;
$textifempty=($section?$langs->trans("NoFileFound"):($showonrightsize=='featurenotyetavailable'?$langs->trans("FeatureNotYetAvailable"):$langs->trans("ECMSelectASection")));
// If $section defined with value 0
if ($section === '0')
{
$filearray=array();
$textifempty='<br><div align="center"><font class="warning">'.$langs->trans("DirNotSynchronizedSyncFirst").'</font></div><br>';
$filearray=array();
$textifempty='<br><div align="center"><font class="warning">'.$langs->trans("DirNotSynchronizedSyncFirst").'</font></div><br>';
}
else $filearray=dol_dir_list($upload_dir,"files",0,'',array('^\.','\.meta$','^temp$','^CVS$'),$sortfield, $sorting,1);

if ($section)
{
$param.='&section='.$section;
$textifempty = $langs->trans('NoFileFound');
}
else $textifempty=($showonrightsize=='featurenotyetavailable'?$langs->trans("FeatureNotYetAvailable"):$langs->trans("ECMSelectASection"));

$formfile->list_of_documents($filearray,'','ecm',$param,1,$relativepath,$user->rights->ecm->upload,1,$textifempty,$maxlengthname,'',$url);
}

}

if (! empty($conf->use_javascript_ajax) && empty($conf->global->MAIN_ECM_DISABLE_JS))
Expand Down
2 changes: 1 addition & 1 deletion htdocs/core/ajax/ajaxdirtree.php
Expand Up @@ -117,7 +117,7 @@
// Loop on all database entries (sqltree) to find the one matching the subdir found into dir to scan
foreach($sqltree as $key => $tmpval)
{
//print "-- key=".$key." - ".$val['fullrelativename']." vs ".(($selecteddir != '/'?$selecteddir.'/':'').$file).'<br>';
//print "-- key=".$key." - ".$tmpval['fullrelativename']." vs ".(($selecteddir != '/'?$selecteddir.'/':'').$file)."<br>\n";
if ($tmpval['fullrelativename'] == (($selecteddir != '/'?$selecteddir.'/':'').$file)) // We found equivalent record into database
{
$val=$tmpval;
Expand Down
16 changes: 10 additions & 6 deletions htdocs/core/boxes/box_produits_alerte_stock.php
Expand Up @@ -64,20 +64,23 @@ function loadBox($max=5)

if ($user->rights->produit->lire || $user->rights->service->lire)
{
$sql = "SELECT p.rowid, p.label, p.price, p.price_base_type, p.price_ttc, p.fk_product_type, p.tms, p.tosell, p.tobuy, p.seuil_stock_alerte, s.reel";
$sql = "SELECT p.rowid, p.label, p.price, p.price_base_type, p.price_ttc, p.fk_product_type, p.tms, p.tosell, p.tobuy, p.seuil_stock_alerte,";
$sql.= " SUM(".$db->ifsql("s.reel IS NULL","0","s.reel").") as total_stock";
$sql.= " FROM ".MAIN_DB_PREFIX."product as p";
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."product_stock as s on p.rowid = s.fk_product";
$sql.= ' WHERE p.entity IN ('.getEntity($productstatic->element, 1).')';
$sql.= " AND p.tosell = 1";
$sql.= " AND p.tosell = 1 AND p.seuil_stock_alerte > 0";
if (empty($user->rights->produit->lire)) $sql.=' AND p.fk_product_type != 0';
if (empty($user->rights->service->lire)) $sql.=' AND p.fk_product_type != 1';
$sql.= " HAVING s.reel < p.seuil_stock_alerte";
$sql.= $db->order('s.reel', 'DESC');
$sql.= " GROUP BY p.rowid, p.label, p.price, p.price_base_type, p.price_ttc, p.fk_product_type, p.tms, p.tosell, p.tobuy, p.seuil_stock_alerte";
$sql.= " HAVING SUM(".$db->ifsql("s.reel IS NULL","0","s.reel").") < p.seuil_stock_alerte";
$sql.= $db->order('p.seuil_stock_alerte', 'DESC');
$sql.= $db->plimit($max, 0);

$result = $db->query($sql);
if ($result)
{
$langs->load("stocks");
$num = $db->num_rows($result);
$i = 0;
while ($i < $num)
Expand Down Expand Up @@ -128,7 +131,8 @@ function loadBox($max=5)
'text' => $price_base_type);

$this->info_box_contents[$i][4] = array('td' => 'align="center"',
'text' => $objp->reel . ' / '.$objp->seuil_stock_alerte);
'text' => $objp->total_stock . ' / '.$objp->seuil_stock_alerte,
'text2'=>img_warning($langs->transnoentitiesnoconv("StockLowerThanLimit")));

$this->info_box_contents[$i][5] = array('td' => 'align="right" width="18"',
'text' => $productstatic->LibStatut($objp->tosell,3,0));
Expand All @@ -138,7 +142,7 @@ function loadBox($max=5)

$i++;
}
if ($num==0) $this->info_box_contents[$i][0] = array('td' => 'align="center"','text'=>$langs->trans("NoRecordedProducts"));
if ($num==0) $this->info_box_contents[$i][0] = array('td' => 'align="center"','text'=>$langs->trans("NoTooLowStockProducts"));
}
else
{
Expand Down
3 changes: 2 additions & 1 deletion htdocs/core/boxes/modules_boxes.php
Expand Up @@ -165,7 +165,8 @@ function showBox($head, $contents)
print '</td><td class="nocellnopadd boxclose" nowrap="nowrap">';
// The image must have the class 'boxhandle' beause it's value used in DOM draggable objects to define the area used to catch the full object
print img_picto($langs->trans("MoveBox",$this->box_id),'grip','class="boxhandle hideonsmartphone" style="cursor:move;"');
print img_picto($langs->trans("Close",$this->box_id),'close','class="boxclose" style="cursor:pointer;" id="imgclose'.$this->box_id.'"');
print img_picto($langs->trans("Close",$this->box_id),'close','class="boxclose" rel="x:y" style="cursor:pointer;" id="imgclose'.$this->box_id.'"');
print '<input type="hidden" id="boxlabelentry'.$this->box_id.'" value="'.dol_escape_htmltag($head['text']).'">';
print '</td></tr></table>';
}
print '</td>';
Expand Down
301 changes: 157 additions & 144 deletions htdocs/core/class/commonobject.class.php

Large diffs are not rendered by default.

886 changes: 476 additions & 410 deletions htdocs/core/class/extrafields.class.php

Large diffs are not rendered by default.

3 changes: 1 addition & 2 deletions htdocs/core/class/hookmanager.class.php
Expand Up @@ -144,7 +144,6 @@ function executeHooks($method, $parameters=false, &$object='', &$action='')
foreach($modules as $module => $actionclassinstance)
{
//print 'class='.get_class($actionclassinstance).' method='.$method.' action='.$action;

// jump to next class if method does not exists
if (! method_exists($actionclassinstance,$method)) continue;
// test to avoid to run twice a hook, when a module implements several active contexts
Expand Down Expand Up @@ -178,7 +177,7 @@ function executeHooks($method, $parameters=false, &$object='', &$action='')

$result = $actionclassinstance->$method($parameters, $object, $action, $this); // $object and $action can be changed by method ($object->id during creation for example or $action to go back to other action for example)

if (is_array($actionclassinstance->results)) $this->resArray =array_merge($this->resArray, $actionclassinstance->results);
if (! empty($actionclassinstance->results) && is_array($actionclassinstance->results)) $this->resArray =array_merge($this->resArray, $actionclassinstance->results);
if (! empty($actionclassinstance->resprints)) $this->resPrint.=$actionclassinstance->resprints;

// TODO. remove this. array result must be set into $actionclassinstance->results
Expand Down
14 changes: 7 additions & 7 deletions htdocs/core/class/html.form.class.php
Expand Up @@ -344,7 +344,7 @@ private function editInPlace($object, $value, $htmlname, $condition, $inputType=
* Show a text and picto with tooltip on text or picto
*
* @param string $text Text to show
* @param string $htmltext Content html of tooltip. Must be HTML/UTF8 encoded.
* @param string $htmltext HTML content of tooltip. Must be HTML/UTF8 encoded.
* @param int $tooltipon 1=tooltip sur texte, 2=tooltip sur picto, 3=tooltip sur les 2
* @param int $direction -1=Le picto est avant, 0=pas de picto, 1=le picto est apres
* @param string $img Code img du picto (use img_xxx() function to get it)
Expand Down Expand Up @@ -383,7 +383,7 @@ function textwithtooltip($text, $htmltext, $tooltipon = 1, $direction = 0, $img
//if ($text != '') $s.='<'.$tag.$paramfortooltiptd.'>'.(($direction < 0)?'&nbsp;':'').$text.(($direction > 0)?'&nbsp;':'').'</'.$tag.'>';
$paramfortooltiptd.= (($direction < 0)?' style="padding-left: 3px !important;"':'');
$paramfortooltiptd.= (($direction > 0)?' style="padding-right: 3px !important;"':'');
if ($text != '') $s.='<'.$tag.$paramfortooltiptd.'>'.$text.'</'.$tag.'>';
if ((string) $text != '') $s.='<'.$tag.$paramfortooltiptd.'>'.$text.'</'.$tag.'>';
if ($direction > 0) $s.='<'.$tag.$paramfortooltipimg.' valign="top" width="14">'.$img.'</'.$tag.'>';
if (empty($notabs)) $s.='</tr></table>';

Expand Down Expand Up @@ -3333,7 +3333,7 @@ function select_date($set_time='', $prefix='re', $h=0, $m=0, $empty=0, $form_nam
if (strval($set_time) != '' && $set_time != -1)
{
//$formated_date=dol_print_date($set_time,$conf->format_date_short);
$formated_date=dol_print_date($set_time,$langs->trans("FormatDateShort")); // FormatDateShort for dol_print_date/FormatDateShortJava that is same for javascript
$formated_date=dol_print_date($set_time,$langs->trans("FormatDateShortInput")); // FormatDateShortInput for dol_print_date / FormatDateShortJavaInput that is same for javascript
}

// Calendrier popup version eldy
Expand All @@ -3342,15 +3342,15 @@ function select_date($set_time='', $prefix='re', $h=0, $m=0, $empty=0, $form_nam
// Zone de saisie manuelle de la date
$retstring.='<input id="'.$prefix.'" name="'.$prefix.'" type="text" size="9" maxlength="11" value="'.$formated_date.'"';
$retstring.=($disabled?' disabled="disabled"':'');
$retstring.=' onChange="dpChangeDay(\''.$prefix.'\',\''.$langs->trans("FormatDateShortJava").'\'); "'; // FormatDateShort for dol_print_date/FormatDateShortJava that is same for javascript
$retstring.=' onChange="dpChangeDay(\''.$prefix.'\',\''.$langs->trans("FormatDateShortJavaInput").'\'); "'; // FormatDateShortInput for dol_print_date / FormatDateShortJavaInput that is same for javascript
$retstring.='>';

// Icone calendrier
if (! $disabled)
{
$retstring.='<button id="'.$prefix.'Button" type="button" class="dpInvisibleButtons"';
$base=DOL_URL_ROOT.'/core/';
$retstring.=' onClick="showDP(\''.$base.'\',\''.$prefix.'\',\''.$langs->trans("FormatDateShortJava").'\',\''.$langs->defaultlang.'\');">'.img_object($langs->trans("SelectDate"),'calendarday','class="datecallink"').'</button>';
$retstring.=' onClick="showDP(\''.$base.'\',\''.$prefix.'\',\''.$langs->trans("FormatDateShortJavaInput").'\',\''.$langs->defaultlang.'\');">'.img_object($langs->trans("SelectDate"),'calendarday','class="datecallink"').'</button>';
}
else $retstring.='<button id="'.$prefix.'Button" type="button" class="dpInvisibleButtons">'.img_object($langs->trans("Disabled"),'calendarday','class="datecallink"').'</button>';

Expand All @@ -3359,7 +3359,7 @@ function select_date($set_time='', $prefix='re', $h=0, $m=0, $empty=0, $form_nam
$retstring.='<input type="hidden" id="'.$prefix.'year" name="'.$prefix.'year" value="'.$syear.'">'."\n";
}
else
{
{
print "Bad value of MAIN_POPUP_CALENDAR";
}
}
Expand Down Expand Up @@ -3453,7 +3453,7 @@ function select_date($set_time='', $prefix='re', $h=0, $m=0, $empty=0, $form_nam
if ($usecalendar == "eldy")
{
$base=DOL_URL_ROOT.'/core/';
$reset_scripts .= 'resetDP(\''.$base.'\',\''.$prefix.'\',\''.$langs->trans("FormatDateShortJava").'\',\''.$langs->defaultlang.'\');';
$reset_scripts .= 'resetDP(\''.$base.'\',\''.$prefix.'\',\''.$langs->trans("FormatDateShortJavaInput").'\',\''.$langs->defaultlang.'\');';
}
else
{
Expand Down
9 changes: 6 additions & 3 deletions htdocs/core/class/html.formactions.class.php
Expand Up @@ -209,10 +209,10 @@ function showactions($object,$typeelement,$socid=0,$forceshowtitle=0)
/**
* Output list of type of event
*
* @param string $selected Type pre-selectionne
* @param string $selected Type pre-selected (can be 'manual', 'auto' or 'AC_xxx'
* @param string $htmlname Nom champ formulaire
* @param string $excludetype Type to exclude
* @param string $onlyautoornot Group list by auto events or not
* @param string $onlyautoornot Group list by auto events or not: We keep only the 2 generic lines (AC_OTH and AC_OTH_AUTO)
* @return void
*/
function select_type_actions($selected='',$htmlname='actioncode',$excludetype='',$onlyautoornot=0)
Expand All @@ -224,11 +224,14 @@ function select_type_actions($selected='',$htmlname='actioncode',$excludetype=''
$caction=new CActionComm($this->db);
$form=new Form($this->db);

// Suggest a list with manual event or all auto events
// Suggest a list with manual events or all auto events
$arraylist=$caction->liste_array(1, 'code', $excludetype, $onlyautoornot);
array_unshift($arraylist,'&nbsp;'); // Add empty line at start
//asort($arraylist);

if ($selected == 'manual') $selected='AC_OTH';
if ($selected == 'auto') $selected='AC_OTH_AUTO';

print $form->selectarray($htmlname, $arraylist, $selected);
if ($user->admin && empty($onlyautoornot)) print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionnarySetup"),1);
}
Expand Down
12 changes: 6 additions & 6 deletions htdocs/core/class/html.formfile.class.php
Expand Up @@ -480,10 +480,10 @@ function showdocuments($modulepart,$filename,$filedir,$urlsource,$genallowed,$de

// Show file name with link to download
$out.= '<td nowrap="nowrap">';
$out.= '<a href="'.DOL_URL_ROOT . '/document.php?modulepart='.$modulepart.'&amp;file='.urlencode($relativepath).'"';
$out.= '<a data-ajax="false" href="'.DOL_URL_ROOT . '/document.php?modulepart='.$modulepart.'&amp;file='.urlencode($relativepath).'"';
$mime=dol_mimetype($relativepath,'',0);
if (preg_match('/text/',$mime)) $out.= ' target="_blank"';
$out.= '>';
$out.= ' target="_blank">';
$out.= img_mime($file["name"],$langs->trans("File").': '.$file["name"]).' '.dol_trunc($file["name"],$maxfilenamelength);
$out.= '</a>'."\n";
$out.= '</td>';
Expand Down Expand Up @@ -575,7 +575,7 @@ function getDocumentsLink($modulepart, $filename, $filedir)
}

// Show file name with link to download
$out.= '<a href="'.DOL_URL_ROOT . '/document.php?modulepart='.$modulepart.'&amp;file='.urlencode($relativepath).'"';
$out.= '<a data-ajax="false" href="'.DOL_URL_ROOT . '/document.php?modulepart='.$modulepart.'&amp;file='.urlencode($relativepath).'"';
$mime=dol_mimetype($relativepath,'',0);
if (preg_match('/text/',$mime)) $out.= ' target="_blank"';
$out.= '>';
Expand Down Expand Up @@ -669,7 +669,7 @@ function list_of_documents($filearray,$object,$modulepart,$param='',$forcedownlo
print '<tr '.$bc[$var].'>';
print '<td>';
//print "XX".$file['name']; //$file['name'] must be utf8
print '<a href="'.DOL_URL_ROOT.'/document.php?modulepart='.$modulepart;
print '<a data-ajax="false" href="'.DOL_URL_ROOT.'/document.php?modulepart='.$modulepart;
if ($forcedownload) print '&attachment=1';
if (! empty($object->entity)) print '&entity='.$object->entity;
print '&file='.urlencode($relativepath.$file['name']).'">';
Expand Down Expand Up @@ -855,7 +855,7 @@ function list_of_autoecmfiles($upload_dir,$filearray,$modulepart,$param,$forcedo
print '</td>';
print '<td>';
//print "XX".$file['name']; //$file['name'] must be utf8
print '<a href="'.DOL_URL_ROOT.'/document.php?modulepart='.$modulepart;
print '<a data-ajax="false" href="'.DOL_URL_ROOT.'/document.php?modulepart='.$modulepart;
if ($forcedownload) print '&attachment=1';
print '&file='.urlencode($relativefile).'">';
print img_mime($file['name'],$file['name'].' ('.dol_print_size($file['size'],0,0).')').' ';
Expand All @@ -865,7 +865,7 @@ function list_of_autoecmfiles($upload_dir,$filearray,$modulepart,$param,$forcedo
print '<td align="right">'.dol_print_size($file['size'],1,1).'</td>';
print '<td align="center">'.dol_print_date($file['date'],"dayhour").'</td>';
print '<td align="right">';
if (! empty($useinecm)) print '<a href="'.DOL_URL_ROOT.'/document.php?modulepart='.$modulepart;
if (! empty($useinecm)) print '<a data-ajax="false" href="'.DOL_URL_ROOT.'/document.php?modulepart='.$modulepart;
if ($forcedownload) print '&attachment=1';
print '&file='.urlencode($relativefile).'">';
print img_view().'</a> &nbsp; ';
Expand Down
109 changes: 52 additions & 57 deletions htdocs/core/class/html.formother.class.php
Expand Up @@ -893,9 +893,34 @@ static function printBoxesArea($user,$areacode)
$selectboxlist=$form->selectarray('boxcombo', $arrayboxtoactivatelabel,'',1);
}

// Javascript code for dynamic actions
if (! empty($conf->use_javascript_ajax))
{
print '<script type="text/javascript" language="javascript">
// To update list of activated boxes
function updateBoxOrder(closing) {
var left_list = cleanSerialize(jQuery("#left").sortable("serialize"));
var right_list = cleanSerialize(jQuery("#right").sortable("serialize"));
var boxorder = \'A:\' + left_list + \'-B:\' + right_list;
if (boxorder==\'A:A-B:B\' && closing == 1) // There is no more boxes on screen, and we are after a delete of a box so we must hide title
{
jQuery.ajax({
url: \''.DOL_URL_ROOT.'/core/ajax/box.php?boxorder=\'+boxorder+\'&zone='.$areacode.'&userid=\'+'.$user->id.',
async: false
});
// We force reload to be sure to get all boxes into list
window.location.search=\'mainmenu='.GETPOST("mainmenu").'&leftmenu='.GETPOST('leftmenu').'&action=delbox\';
}
else
{
jQuery.ajax({
url: \''.DOL_URL_ROOT.'/core/ajax/box.php?boxorder=\'+boxorder+\'&zone='.$areacode.'&userid=\'+'.$user->id.',
async: true
});
}
}
jQuery(document).ready(function() {
jQuery("#boxcombo").change(function() {
var boxid=jQuery("#boxcombo").val();
Expand All @@ -910,10 +935,33 @@ static function printBoxesArea($user,$areacode)
window.location.search=\'mainmenu='.GETPOST("mainmenu").'&leftmenu='.GETPOST('leftmenu').'&action=addbox&boxid=\'+boxid;
}
});';
if (! count($arrayboxtoactivatelabel)) print 'jQuery("#boxcombo").hide();';
print '
});
</script>';
if (! count($arrayboxtoactivatelabel)) print 'jQuery("#boxcombo").hide();';
print '
jQuery("#left, #right").sortable({
/* placeholder: \'ui-state-highlight\', */
handle: \'.boxhandle\',
revert: \'invalid\',
items: \'.box\',
containment: \'.fiche\',
connectWith: \'.connectedSortable\',
stop: function(event, ui) {
updateBoxOrder(0);
}
});
jQuery(".boxclose").click(function() {
var self = this; // because JQuery can modify this
var boxid=self.id.substring(8);
var label=jQuery(\'#boxlabelentry\'+boxid).val();
jQuery(\'#boxto_\'+boxid).remove();
// TODO Add id, label into combo list
updateBoxOrder(1);
});
});'."\n";

print '</script>'."\n";
}

$nbboxactivated=count($boxidactivatedforuser);
Expand Down Expand Up @@ -996,59 +1044,6 @@ static function printBoxesArea($user,$areacode)

print "</td></tr>";
print "</table>";

if ($conf->use_javascript_ajax)
{
print "\n";
print '<script type="text/javascript" language="javascript">';
// For moving
print 'jQuery(function() {
jQuery("#left, #right").sortable({
/* placeholder: \'ui-state-highlight\', */
handle: \'.boxhandle\',
revert: \'invalid\',
items: \'.box\',
containment: \'.fiche\',
connectWith: \'.connectedSortable\',
stop: function(event, ui) {
updateBoxOrder(0);
}
});
});
'."\n";
// To update list of activated boxes
print 'function updateBoxOrder(closing) {
var left_list = cleanSerialize(jQuery("#left").sortable("serialize"));
var right_list = cleanSerialize(jQuery("#right").sortable("serialize"));
var boxorder = \'A:\' + left_list + \'-B:\' + right_list;
if (boxorder==\'A:A-B:B\' && closing == 1) // There is no more boxes on screen, and we are after a delete of a box so we must hide title
{
jQuery.ajax({
url: \''.DOL_URL_ROOT.'/core/ajax/box.php?boxorder=\'+boxorder+\'&zone='.$areacode.'&userid=\'+'.$user->id.',
async: false
});
// We force reload to be sure to get all boxes into list
window.location.search=\'mainmenu='.GETPOST("mainmenu").'&leftmenu='.GETPOST('leftmenu').'&action=delbox\';
}
else
{
jQuery.ajax({
url: \''.DOL_URL_ROOT.'/core/ajax/box.php?boxorder=\'+boxorder+\'&zone='.$areacode.'&userid=\'+'.$user->id.',
async: true
});
}
}'."\n";
// For closing
print 'jQuery(document).ready(function() {
jQuery(".boxclose").click(function() {
var self = this; // because JQuery can modify this
var boxid=self.id.substring(8);
jQuery(\'#boxto_\'+boxid).remove();
updateBoxOrder(1);
});
});'."\n";
print '</script>'."\n";
}
}

return count($boxactivated);
Expand Down
6 changes: 3 additions & 3 deletions htdocs/core/datepicker.php
Expand Up @@ -224,16 +224,16 @@ function displayBox($selectedDate,$month,$year)
if($thedate==$selDate) $dayclass="dpSelected";
elseif($thedate==$today) $dayclass="dpToday";

if ($langs->trans("FormatDateShortJava")=="FormatDateShortJava")
if ($langs->trans("FormatDateShortJavaInput")=="FormatDateShortJavaInput")
{
print "ERROR FormatDateShortJava not defined for language ".$langs->defaultlang;
print "ERROR FormatDateShortJavaInput not defined for language ".$langs->defaultlang;
exit;
}

// Sur click dans calendrier, appelle fonction dpClickDay
echo "<TD class=\"".$dayclass."\"";
echo " onMouseOver=\"dpHighlightDay(".$mydate["year"].",parseInt('".dol_print_date($thedate,"%m")."',10),".$mydate["mday"].",tradMonths)\"";
echo " onClick=\"dpClickDay(".$mydate["year"].",parseInt('".dol_print_date($thedate,"%m")."',10),".$mydate["mday"].",'".$langs->trans("FormatDateShortJava")."')\"";
echo " onClick=\"dpClickDay(".$mydate["year"].",parseInt('".dol_print_date($thedate,"%m")."',10),".$mydate["mday"].",'".$langs->trans("FormatDateShortJavaInput")."')\"";
echo ">".sprintf("%02s",$mydate["mday"])."</TD>";
$cols++;

Expand Down
5 changes: 0 additions & 5 deletions htdocs/core/get_menudiv.php
Expand Up @@ -40,11 +40,6 @@
$right=($langs->trans("DIRECTION")=='rtl'?'left':'right');
$left=($langs->trans("DIRECTION")=='rtl'?'right':'left');

//var_dump($langs->defaultlang);
//var_dump($conf->format_date_short_java);
//var_dump($langs->trans("FormatDateShortJava"));



/*
* View
Expand Down
11 changes: 8 additions & 3 deletions htdocs/core/lib/agenda.lib.php
Expand Up @@ -40,9 +40,10 @@
* @param int $pid Product id
* @param int $socid Third party id
* @param array $showextcals Array with list of external calendars, or -1 to show no legend
* @param string $actioncode Preselected value of actioncode for filter on type
* @return void
*/
function print_actions_filter($form,$canedit,$status,$year,$month,$day,$showbirthday,$filtera,$filtert,$filterd,$pid,$socid,$showextcals=array())
function print_actions_filter($form,$canedit,$status,$year,$month,$day,$showbirthday,$filtera,$filtert,$filterd,$pid,$socid,$showextcals=array(),$actioncode='')
{
global $conf,$user,$langs,$db;

Expand Down Expand Up @@ -94,8 +95,7 @@ function print_actions_filter($form,$canedit,$status,$year,$month,$day,$showbirt
print $langs->trans("Type");
print ' &nbsp;</td><td nowrap="nowrap">';

// print $formactions->select_type_actions(GETPOST('actioncode'), "actioncode");
print $formactions->select_type_actions(GETPOST('actioncode')?GETPOST('actioncode'):'manual', "actioncode", '', (empty($conf->global->AGENDA_USE_EVENT_TYPE)?1:0));
print $formactions->select_type_actions($actioncode, "actioncode", '', (empty($conf->global->AGENDA_USE_EVENT_TYPE)?1:0));

print '</td></tr>';
}
Expand Down Expand Up @@ -384,6 +384,11 @@ function agenda_prepare_head()
$head[$h][2] = 'extsites';
$h++;

$head[$h][0] = DOL_URL_ROOT."/admin/agenda_other.php";
$head[$h][1] = $langs->trans("Other");
$head[$h][2] = 'other';
$h++;

complete_head_from_modules($conf,$langs,$object,$head,$h,'agenda_admin');

$head[$h][0] = DOL_URL_ROOT."/admin/agenda_extrafields.php";
Expand Down
2 changes: 1 addition & 1 deletion htdocs/core/lib/company.lib.php
Expand Up @@ -47,7 +47,7 @@ function societe_prepare_head($object)
{
$head[$h][0] = DOL_URL_ROOT.'/comm/fiche.php?socid='.$object->id;
if (empty($conf->global->SOCIETE_DISABLE_PROSPECTS) && ($object->client==2 || $object->client==3)) $head[$h][1] = $langs->trans("Prospect");
if ($object->client==3) $head[$h][1] .= '/';
if (empty($conf->global->SOCIETE_DISABLE_PROSPECTS) && empty($conf->global->SOCIETE_DISABLE_CUSTOMERS) && $object->client==3) $head[$h][1] .= '/';
if (empty($conf->global->SOCIETE_DISABLE_CUSTOMERS) && ($object->client==1 || $object->client==3)) $head[$h][1] .= $langs->trans("Customer");
$head[$h][2] = 'customer';
$h++;
Expand Down
41 changes: 27 additions & 14 deletions htdocs/core/lib/functions.lib.php
Expand Up @@ -814,26 +814,33 @@ function dol_print_date($time,$format='',$tzoutput='tzserver',$outputlangs='',$e
}
if (! is_object($outputlangs)) $outputlangs=$langs;
if (! $format) $format='daytextshort';

$reduceformat=(! empty($conf->dol_optimize_smallscreen) && in_array($format,array('day','hour')))?1:0;

// Change predefined format into computer format. If found translation in lang file we use it, otherwise we use default.
if ($format == 'day') $format=($outputlangs->trans("FormatDateShort")!="FormatDateShort"?$outputlangs->trans("FormatDateShort"):$conf->format_date_short);
else if ($format == 'hour') $format=($outputlangs->trans("FormatHourShort")!="FormatHourShort"?$outputlangs->trans("FormatHourShort"):$conf->format_hour_short);
else if ($format == 'hourduration') $format=($outputlangs->trans("FormatHourShortDuration")!="FormatHourShortDuration"?$outputlangs->trans("FormatHourShortDuration"):$conf->format_hour_short_duration);
if ($format == 'day') $format=($outputlangs->trans("FormatDateShort")!="FormatDateShort"?$outputlangs->trans("FormatDateShort"):$conf->format_date_short);
else if ($format == 'hour') $format=($outputlangs->trans("FormatHourShort")!="FormatHourShort"?$outputlangs->trans("FormatHourShort"):$conf->format_hour_short);
else if ($format == 'hourduration') $format=($outputlangs->trans("FormatHourShortDuration")!="FormatHourShortDuration"?$outputlangs->trans("FormatHourShortDuration"):$conf->format_hour_short_duration);
else if ($format == 'daytext') $format=($outputlangs->trans("FormatDateText")!="FormatDateText"?$outputlangs->trans("FormatDateText"):$conf->format_date_text);
else if ($format == 'daytextshort') $format=($outputlangs->trans("FormatDateTextShort")!="FormatDateTextShort"?$outputlangs->trans("FormatDateTextShort"):$conf->format_date_text_short);
else if ($format == 'daytextshort') $format=($outputlangs->trans("FormatDateTextShort")!="FormatDateTextShort"?$outputlangs->trans("FormatDateTextShort"):$conf->format_date_text_short);
else if ($format == 'dayhour') $format=($outputlangs->trans("FormatDateHourShort")!="FormatDateHourShort"?$outputlangs->trans("FormatDateHourShort"):$conf->format_date_hour_short);
else if ($format == 'dayhoursec') $format=($outputlangs->trans("FormatDateHourSecShort")!="FormatDateHourSecShort"?$outputlangs->trans("FormatDateHourSecShort"):$conf->format_date_hour_sec_short);
else if ($format == 'dayhourtext') $format=($outputlangs->trans("FormatDateHourText")!="FormatDateHourText"?$outputlangs->trans("FormatDateHourText"):$conf->format_date_hour_text);
else if ($format == 'dayhourtextshort') $format=($outputlangs->trans("FormatDateHourTextShort")!="FormatDateHourTextShort"?$outputlangs->trans("FormatDateHourTextShort"):$conf->format_date_hour_text_short);
// Format not sensitive to language
else if ($format == 'dayhourlog') $format='%Y%m%d%H%M%S';
else if ($format == 'dayhourldap') $format='%Y%m%d%H%M%SZ';
else if ($format == 'dayhourxcard') $format='%Y%m%dT%H%M%SZ';
else if ($format == 'dayxcard') $format='%Y%m%d';
else if ($format == 'dayhourxcard') $format='%Y%m%dT%H%M%SZ';
else if ($format == 'dayxcard') $format='%Y%m%d';
else if ($format == 'dayrfc') $format='%Y-%m-%d'; // DATE_RFC3339
else if ($format == 'dayhourrfc') $format='%Y-%m-%dT%H:%M:%SZ'; // DATETIME RFC3339
else if ($format == 'standard') $format='%Y-%m-%d %H:%M:%S';
else if ($format == 'standard') $format='%Y-%m-%d %H:%M:%S';

if ($reduceformat)
{
$format=str_replace('%Y','%y',$format);
$format=str_replace('yyyy','yy',$format);
}

// If date undefined or "", we return ""
if (dol_strlen($time) == 0) return ''; // $time=0 allowed (it means 01/01/1970 00:00:00)

Expand Down Expand Up @@ -1072,9 +1079,11 @@ function dol_now($mode='gmt')
*/
function dol_print_size($size,$shortvalue=0,$shortunit=0)
{
global $langs;
global $conf,$langs;
$level=1024;


if (! empty($conf->dol_optimize_smallscreen)) $shortunit=1;

// Set value text
if (empty($shortvalue) || $size < ($level*10))
{
Expand Down Expand Up @@ -2846,7 +2855,7 @@ function getLocalTaxesFromRate($vatrate, $local, $thirdparty)
dol_syslog("getLocalTaxesFromRate vatrate=".$vatrate." local=".$local." thirdparty id=".(is_object($thirdparty)?$thirdparty->id:''));

// Search local taxes
$sql = "SELECT t.localtax1, t.localtax1_type, t.localtax2, t.localtax2_type";
$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, ".MAIN_DB_PREFIX."c_pays as p";
$sql .= " WHERE t.fk_pays = p.rowid AND p.code = '".$thirdparty->country_code."'";
$sql .= " AND t.taux = ".$vatrate." AND t.active = 1";
Expand All @@ -2855,9 +2864,9 @@ function getLocalTaxesFromRate($vatrate, $local, $thirdparty)
if ($resql)
{
$obj = $db->fetch_object($resql);
if ($local == 1) return array($obj->localtax1_type, $obj->localtax1);
elseif ($local == 2) return array($obj->localtax2_type, $obj->localtax2);
else return array($obj->localtax1_type, $obj->localtax1, $obj->localtax2_type, $obj->localtax2);
if ($local == 1) return array($obj->localtax1_type, $obj->localtax1,$obj->accountancy_code_sell,$obj->accountancy_code_buy);
elseif ($local == 2) return array($obj->localtax2_type, $obj->localtax2,$obj->accountancy_code_sell,$obj->accountancy_code_buy);
else return array($obj->localtax1_type, $obj->localtax1, $obj->localtax2_type, $obj->localtax2,$obj->accountancy_code_sell,$obj->accountancy_code_buy);
}

return 0;
Expand Down Expand Up @@ -3105,12 +3114,16 @@ function get_default_npr($thirdparty_seller, $thirdparty_buyer, $idprod=0, $idpr

if ($idprodfournprice > 0)
{
if (! class_exists('ProductFournisseur'))
require DOL_DOCUMENT_ROOT . '/fourn/class/fournisseur.product.class.php';
$prodprice = new ProductFournisseur($db);
$prodprice->fetch_product_fournisseur_price($idprodfournprice);
return $prodprice->fourn_tva_npr;
}
elseif ($idprod > 0)
{
if (! class_exists('Product'))
require DOL_DOCUMENT_ROOT . '/product/class/product.class.php';
$prod = new Product($db);
$prod->fetch($idprod);
return $prod->tva_npr;
Expand Down
2 changes: 1 addition & 1 deletion htdocs/core/lib/functions2.lib.php
Expand Up @@ -1283,7 +1283,7 @@ function getListOfModels($db,$type,$maxfilenamelength=0)
if (! $tmpdir) { unset($listofdir[$key]); continue; }
if (is_dir($tmpdir))
{
$tmpfiles=dol_dir_list($tmpdir,'files',0,'\.odt','','name',SORT_ASC,0,true); // Disable hook for the moment
$tmpfiles=dol_dir_list($tmpdir,'files',0,'\.od(s|t)$','','name',SORT_ASC,0,true); // Disable hook for the moment
if (count($tmpfiles)) $listoffiles=array_merge($listoffiles,$tmpfiles);
}
}
Expand Down
7 changes: 4 additions & 3 deletions htdocs/core/lib/usergroups.lib.php
Expand Up @@ -78,14 +78,15 @@ function user_prepare_head($object)
$head[$h][2] = 'clicktodial';
$h++;
}

// Show more tabs from modules
// Entries must be declared in modules descriptor with line
// $this->tabs = array('entity:+tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to add new tab
// $this->tabs = array('entity:-tabname); to remove a tab
complete_head_from_modules($conf,$langs,$object,$head,$h,'user');

if (! empty($user->societe_id))

//Info on users is visible only by internal user
if (empty($user->societe_id))
{
$head[$h][0] = DOL_URL_ROOT.'/user/note.php?id='.$object->id;
$head[$h][1] = $langs->trans("Note");
Expand Down
2 changes: 2 additions & 0 deletions htdocs/core/menus/standard/eldy.lib.php
Expand Up @@ -852,6 +852,8 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu
*/
if (empty($leftmenu) || $leftmenu=="ca") $newmenu->add("/compta/stats/casoc.php?leftmenu=ca",$langs->trans("ByCompanies"),2,$user->rights->compta->resultat->lire||$user->rights->accounting->comptarapport->lire);
if (empty($leftmenu) || $leftmenu=="ca") $newmenu->add("/compta/stats/cabyuser.php?leftmenu=ca",$langs->trans("ByUsers"),2,$user->rights->compta->resultat->lire||$user->rights->accounting->comptarapport->lire);
if (empty($leftmenu) || $leftmenu=="ca") $newmenu->add("/compta/stats/cabyprodserv.php?leftmenu=ca", $langs->trans("ByProductsAndServices"),2,$user->rights->compta->resultat->lire||$user->rights->accounting->comptarapport->lire);


// Journaux
//if ($leftmenu=="ca") $newmenu->add("/compta/journaux/index.php?leftmenu=ca",$langs->trans("Journaux"),1,$user->rights->compta->resultat->lire||$user->rights->accounting->comptarapport->lire);
Expand Down
Expand Up @@ -519,8 +519,12 @@ function write_file($object,$outputlangs,$srctemplatepath,$hidedetails=0,$hidede
$reshook=$hookmanager->executeHooks('beforeODTSave',$parameters,$this,$action); // Note that $action and $object may have been modified by some hooks

// Write new file
//$result=$odfHandler->exportAsAttachedFile('toto');
$odfHandler->saveToDisk($file);
if (!empty($conf->global->MAIN_ODT_AS_PDF)) {
$odfHandler->exportAsAttachedPDF($file);
}
else {
$odfHandler->saveToDisk($file);
}

if (! empty($conf->global->MAIN_UMASK))
@chmod($file, octdec($conf->global->MAIN_UMASK));
Expand Down
68 changes: 0 additions & 68 deletions htdocs/core/modules/expedition/methode_expedition.modules.php

This file was deleted.

This file was deleted.

57 changes: 0 additions & 57 deletions htdocs/core/modules/expedition/methode_expedition_enl.modules.php

This file was deleted.

This file was deleted.

This file was deleted.

Expand Up @@ -497,8 +497,12 @@ function write_file($object,$outputlangs,$srctemplatepath,$hidedetails=0,$hidede
$reshook=$hookmanager->executeHooks('beforeODTSave',$parameters,$this,$action); // Note that $action and $object may have been modified by some hooks

// Write new file
//$result=$odfHandler->exportAsAttachedFile('toto');
$odfHandler->saveToDisk($file);
if (!empty($conf->global->MAIN_ODT_AS_PDF)) {
$odfHandler->exportAsAttachedPDF($file);
}
else {
$odfHandler->saveToDisk($file);
}

if (! empty($conf->global->MAIN_UMASK))
@chmod($file, octdec($conf->global->MAIN_UMASK));
Expand Down
375 changes: 228 additions & 147 deletions htdocs/core/modules/livraison/pdf/pdf_typhon.modules.php

Large diffs are not rendered by default.

12 changes: 6 additions & 6 deletions htdocs/core/modules/modBarcode.class.php
Expand Up @@ -111,12 +111,12 @@ function init($options='')
$this->remove($options);

$sql = array(
array('sql'=>'INSERT INTO llx_c_barcode_type (code, libelle, coder, example, entity) VALUES ("EAN8", "EAN8", 0, "1234567", __ENTITY__)','ignoreerror'=>1),
array('sql'=>'INSERT INTO llx_c_barcode_type (code, libelle, coder, example, entity) VALUES ("EAN13", "EAN13", 0, "123456789012", __ENTITY__)','ignoreerror'=>1),
array('sql'=>'INSERT INTO llx_c_barcode_type (code, libelle, coder, example, entity) VALUES ("UPC", "UPC", 0, "123456789012", __ENTITY__)','ignoreerror'=>1),
array('sql'=>'INSERT INTO llx_c_barcode_type (code, libelle, coder, example, entity) VALUES ("ISBN", "ISBN", 0, "123456789", __ENTITY__)','ignoreerror'=>1),
array('sql'=>'INSERT INTO llx_c_barcode_type (code, libelle, coder, example, entity) VALUES ("C39", "Code 39", 0, "1234567890", __ENTITY__)','ignoreerror'=>1),
array('sql'=>'INSERT INTO llx_c_barcode_type (code, libelle, coder, example, entity) VALUES ("C128", "Code 128", 0, "ABCD1234567890", __ENTITY__)','ignoreerror'=>1)
array('sql'=>"INSERT INTO llx_c_barcode_type (code, libelle, coder, example, entity) VALUES ('EAN8', 'EAN8', 0, '1234567', __ENTITY__)",'ignoreerror'=>1),
array('sql'=>"INSERT INTO llx_c_barcode_type (code, libelle, coder, example, entity) VALUES ('EAN13', 'EAN13', 0, '123456789012', __ENTITY__)",'ignoreerror'=>1),
array('sql'=>"INSERT INTO llx_c_barcode_type (code, libelle, coder, example, entity) VALUES ('UPC', 'UPC', 0, '123456789012', __ENTITY__)",'ignoreerror'=>1),
array('sql'=>"INSERT INTO llx_c_barcode_type (code, libelle, coder, example, entity) VALUES ('ISBN', 'ISBN', 0, '123456789', __ENTITY__)",'ignoreerror'=>1),
array('sql'=>"INSERT INTO llx_c_barcode_type (code, libelle, coder, example, entity) VALUES ('C39', 'Code 39', 0, '1234567890', __ENTITY__)",'ignoreerror'=>1),
array('sql'=>"INSERT INTO llx_c_barcode_type (code, libelle, coder, example, entity) VALUES ('C128', 'Code 128', 0, 'ABCD1234567890', __ENTITY__)",'ignoreerror'=>1)
);

return $this->_init($sql, $options);
Expand Down
8 changes: 4 additions & 4 deletions htdocs/core/modules/modFacture.class.php
Expand Up @@ -198,10 +198,10 @@ function __construct($db)
$this->export_label[$r]='CustomersInvoicesAndPayments'; // Translation key (used only if key ExportDataset_xxx_z not found)
$this->export_icon[$r]='bill';
$this->export_permission[$r]=array(array("facture","facture","export"));
$this->export_fields_array[$r]=array('s.rowid'=>"IdCompany",'s.nom'=>'CompanyName','s.address'=>'Address','s.zip'=>'Zip','s.town'=>'Town','c.code'=>'CountryCode','s.phone'=>'Phone','s.siren'=>'ProfId1','s.siret'=>'ProfId2','s.ape'=>'ProfId3','s.idprof4'=>'ProfId4','s.code_compta'=>'CustomerAccountancyCode','s.code_compta_fournisseur'=>'SupplierAccountancyCode','s.tva_intra'=>'VATIntra','f.rowid'=>"InvoiceId",'f.facnumber'=>"InvoiceRef",'f.datec'=>"InvoiceDateCreation",'f.datef'=>"DateInvoice",'f.date_lim_reglement'=>"DateDue",'f.total'=>"TotalHT",'f.total_ttc'=>"TotalTTC",'f.tva'=>"TotalVAT",'f.paye'=>"InvoicePaid",'f.fk_statut'=>'InvoiceStatus','f.note'=>"NotePrivate",'f.note_public'=>"NotePublic",'p.rowid'=>'PaymentId','pf.amount'=>'AmountPayment','p.datep'=>'DatePayment','p.num_paiement'=>'PaymentNumber');
//$this->export_TypeFields_array[$r]=array('s.rowid'=>"List:societe:nom",'s.nom'=>'Text','s.address'=>'Text','s.zip'=>'Text','s.town'=>'Text','c.code'=>'Text','s.phone'=>'Text','s.siren'=>'Text','s.siret'=>'Text','s.ape'=>'Text','s.idprof4'=>'Text','s.code_compta'=>'Text','s.code_compta_fournisseur'=>'Text','s.tva_intra'=>'Text','f.rowid'=>"List:facture:facnumber",'f.facnumber'=>"Text",'f.datec'=>"Date",'f.datef'=>"Date",'f.date_lim_reglement'=>"Date",'f.total'=>"Number",'f.total_ttc'=>"Number",'f.tva'=>"Number",'f.paye'=>"Boolean",'f.fk_statut'=>'Status','f.note'=>"Text",'f.note_public'=>"Text",'pf.amount'=>'Number','p.datep'=>'Date','p.num_paiement'=>'Number');
$this->export_TypeFields_array[$r]=array('s.nom'=>'Text','s.address'=>'Text','s.zip'=>'Text','s.town'=>'Text','c.code'=>'Text','s.phone'=>'Text','s.siren'=>'Text','s.siret'=>'Text','s.ape'=>'Text','s.idprof4'=>'Text','s.code_compta'=>'Text','s.code_compta_fournisseur'=>'Text','s.tva_intra'=>'Text','f.rowid'=>"List:facture:facnumber",'f.facnumber'=>"Text",'f.datec'=>"Date",'f.datef'=>"Date",'f.date_lim_reglement'=>"Date",'f.total'=>"Number",'f.total_ttc'=>"Number",'f.tva'=>"Number",'f.paye'=>"Boolean",'f.fk_statut'=>'Status','f.note'=>"Text",'f.note_public'=>"Text",'pf.amount'=>'Number','p.datep'=>'Date','p.num_paiement'=>'Number');
$this->export_entities_array[$r]=array('s.rowid'=>"company",'s.nom'=>'company','s.address'=>'company','s.zip'=>'company','s.town'=>'company','c.code'=>'company','s.phone'=>'company','s.siren'=>'company','s.siret'=>'company','s.ape'=>'company','s.idprof4'=>'company','s.code_compta'=>'company','s.code_compta_fournisseur'=>'company','s.tva_intra'=>'company','f.rowid'=>"invoice",'f.facnumber'=>"invoice",'f.datec'=>"invoice",'f.datef'=>"invoice",'f.date_lim_reglement'=>"invoice",'f.total'=>"invoice",'f.total_ttc'=>"invoice",'f.tva'=>"invoice",'f.paye'=>"invoice",'f.fk_statut'=>'invoice','f.note'=>"invoice",'f.note_public'=>"invoice",'p.rowid'=>'payment','pf.amount'=>'payment','p.datep'=>'payment','p.num_paiement'=>'payment');
$this->export_fields_array[$r]=array('s.rowid'=>"IdCompany",'s.nom'=>'CompanyName','s.address'=>'Address','s.zip'=>'Zip','s.town'=>'Town','c.code'=>'CountryCode','s.phone'=>'Phone','s.siren'=>'ProfId1','s.siret'=>'ProfId2','s.ape'=>'ProfId3','s.idprof4'=>'ProfId4','s.code_compta'=>'CustomerAccountancyCode','s.code_compta_fournisseur'=>'SupplierAccountancyCode','s.tva_intra'=>'VATIntra','f.rowid'=>"InvoiceId",'f.facnumber'=>"InvoiceRef",'f.datec'=>"InvoiceDateCreation",'f.datef'=>"DateInvoice",'f.date_lim_reglement'=>"DateDue",'f.total'=>"TotalHT",'f.total_ttc'=>"TotalTTC",'f.tva'=>"TotalVAT",'f.paye'=>"InvoicePaid",'f.fk_statut'=>'InvoiceStatus','f.note_private'=>"NotePrivate",'f.note_public'=>"NotePublic",'p.rowid'=>'PaymentId','pf.amount'=>'AmountPayment','p.datep'=>'DatePayment','p.num_paiement'=>'PaymentNumber');
//$this->export_TypeFields_array[$r]=array('s.rowid'=>"List:societe:nom",'s.nom'=>'Text','s.address'=>'Text','s.zip'=>'Text','s.town'=>'Text','c.code'=>'Text','s.phone'=>'Text','s.siren'=>'Text','s.siret'=>'Text','s.ape'=>'Text','s.idprof4'=>'Text','s.code_compta'=>'Text','s.code_compta_fournisseur'=>'Text','s.tva_intra'=>'Text','f.rowid'=>"List:facture:facnumber",'f.facnumber'=>"Text",'f.datec'=>"Date",'f.datef'=>"Date",'f.date_lim_reglement'=>"Date",'f.total'=>"Number",'f.total_ttc'=>"Number",'f.tva'=>"Number",'f.paye'=>"Boolean",'f.fk_statut'=>'Status','f.note_private'=>"Text",'f.note_public'=>"Text",'pf.amount'=>'Number','p.datep'=>'Date','p.num_paiement'=>'Number');
$this->export_TypeFields_array[$r]=array('s.nom'=>'Text','s.address'=>'Text','s.zip'=>'Text','s.town'=>'Text','c.code'=>'Text','s.phone'=>'Text','s.siren'=>'Text','s.siret'=>'Text','s.ape'=>'Text','s.idprof4'=>'Text','s.code_compta'=>'Text','s.code_compta_fournisseur'=>'Text','s.tva_intra'=>'Text','f.rowid'=>"List:facture:facnumber",'f.facnumber'=>"Text",'f.datec'=>"Date",'f.datef'=>"Date",'f.date_lim_reglement'=>"Date",'f.total'=>"Number",'f.total_ttc'=>"Number",'f.tva'=>"Number",'f.paye'=>"Boolean",'f.fk_statut'=>'Status','f.note_private'=>"Text",'f.note_public'=>"Text",'pf.amount'=>'Number','p.datep'=>'Date','p.num_paiement'=>'Number');
$this->export_entities_array[$r]=array('s.rowid'=>"company",'s.nom'=>'company','s.address'=>'company','s.zip'=>'company','s.town'=>'company','c.code'=>'company','s.phone'=>'company','s.siren'=>'company','s.siret'=>'company','s.ape'=>'company','s.idprof4'=>'company','s.code_compta'=>'company','s.code_compta_fournisseur'=>'company','s.tva_intra'=>'company','f.rowid'=>"invoice",'f.facnumber'=>"invoice",'f.datec'=>"invoice",'f.datef'=>"invoice",'f.date_lim_reglement'=>"invoice",'f.total'=>"invoice",'f.total_ttc'=>"invoice",'f.tva'=>"invoice",'f.paye'=>"invoice",'f.fk_statut'=>'invoice','f.note_private'=>"invoice",'f.note_public'=>"invoice",'p.rowid'=>'payment','pf.amount'=>'payment','p.datep'=>'payment','p.num_paiement'=>'payment');
$this->export_dependencies_array[$r]=array('payment'=>'p.rowid'); // To add unique key if we ask a field of a child to avoid the DISTINCT to discard them

$this->export_sql_start[$r]='SELECT DISTINCT ';
Expand Down
34 changes: 16 additions & 18 deletions htdocs/core/modules/modOpenSurvey.class.php
@@ -1,7 +1,18 @@
<?php
/* Copyright (C) 2008 Laurent Destailleur <eldy@users.sourceforge.net>
/* Copyright (C) 2013 Laurent Destailleur <eldy@users.sourceforge.net>
*
* Licensed under the GNU GPL v3 or higher (See file gpl-3.0.html)
* 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
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

/**
Expand Down Expand Up @@ -184,10 +195,11 @@ function __construct($db)
*/
function init($options='')
{
// Permissions
$this->remove($options);

$sql = array();

$result=$this->load_tables();

return $this->_init($sql,$options);
}

Expand All @@ -205,20 +217,6 @@ function remove($options='')

return $this->_remove($sql,$options);
}


/**
* Create tables and keys required by module
* Files mymodule.sql and mymodule.key.sql with create table and create keys
* commands must be stored in directory /mymodule/sql/
* This function is called by this->init.
*
* @return int <=0 if KO, >0 if OK
*/
function load_tables()
{
return $this->_load_tables('/opensurvey/sql/');
}
}

?>
Expand Up @@ -650,7 +650,7 @@ function write_file($object,$outputlangs,$srctemplatepath)

//Time ressources
$sql = "SELECT t.rowid, t.task_date, t.task_duration, t.fk_user, t.note";
$sql.= ", u.name, u.firstname";
$sql.= ", u.lastname, u.firstname";
$sql .= " FROM ".MAIN_DB_PREFIX."projet_task_time as t";
$sql .= " , ".MAIN_DB_PREFIX."user as u";
$sql .= " WHERE t.fk_task =".$task->id;
Expand Down Expand Up @@ -973,8 +973,12 @@ function write_file($object,$outputlangs,$srctemplatepath)


// Write new file
$odfHandler->saveToDisk($file);
//$odfHandler->exportAsAttachedPDF($file);
if (!empty($conf->global->MAIN_ODT_AS_PDF)) {
$odfHandler->exportAsAttachedPDF($file);
}
else {
$odfHandler->saveToDisk($file);
}

if (! empty($conf->global->MAIN_UMASK))
@chmod($file, octdec($conf->global->MAIN_UMASK));
Expand Down
Expand Up @@ -482,8 +482,12 @@ function write_file($object,$outputlangs,$srctemplatepath,$hidedetails=0,$hidede
$reshook=$hookmanager->executeHooks('beforeODTSave',$parameters,$this,$action); // Note that $action and $object may have been modified by some hooks

// Write new file
//$result=$odfHandler->exportAsAttachedFile('toto');
$odfHandler->saveToDisk($file);
if (!empty($conf->global->MAIN_ODT_AS_PDF)) {
$odfHandler->exportAsAttachedPDF($file);
}
else {
$odfHandler->saveToDisk($file);
}

if (! empty($conf->global->MAIN_UMASK))
@chmod($file, octdec($conf->global->MAIN_UMASK));
Expand Down
25 changes: 20 additions & 5 deletions htdocs/core/modules/societe/doc/doc_generic_odt.modules.php
Expand Up @@ -109,7 +109,7 @@ function info($langs)
if (! is_dir($tmpdir)) $texttitle.=img_warning($langs->trans("ErrorDirNotFound",$tmpdir),0);
else
{
$tmpfiles=dol_dir_list($tmpdir,'files',0,'\.odt','','name',SORT_ASC,0,true); // Disable hook for the moment
$tmpfiles=dol_dir_list($tmpdir,'files',0,'\.od(s|t)$','','name',SORT_ASC,0,true); // Disable hook for the moment
if (count($tmpfiles)) $listoffiles=array_merge($listoffiles,$tmpfiles);
}
}
Expand Down Expand Up @@ -210,16 +210,27 @@ function write_file($object,$outputlangs,$srctemplatepath,$hidedetails=0,$hidede
{
//print "srctemplatepath=".$srctemplatepath; // Src filename
$newfile=basename($srctemplatepath);
$newfiletmp=preg_replace('/\.odt/i','',$newfile);
$newfiletmp=preg_replace('/\.od(s|t)/i','',$newfile);
$newfiletmp=preg_replace('/template_/i','',$newfiletmp);
$newfiletmp=preg_replace('/modele_/i','',$newfiletmp);
$filename=$newfiletmp.'.'.dol_print_date(dol_now(),'%Y%m%d%H%M%S').'.odt';
// Get extension (ods or odt)
$newfileformat=substr($newfile, strrpos($newfile, '.')+1);
if ( ! empty($conf->global->MAIN_ODT_USE_TIMING))
{
$filename=$newfiletmp.'.'.dol_print_date(dol_now(),'%Y%m%d%H%M%S').'.'.$newfileformat;
}
else
{
$filename=$newfiletmp.'.'.$newfileformat;
}
$file=$dir.'/'.$filename;
$object->builddoc_filename=$filename; // For triggers
//print "newfileformat=".$newfileformat;
//print "newdir=".$dir;
//print "newfile=".$newfile;
//print "file=".$file;
//print "conf->societe->dir_temp=".$conf->societe->dir_temp;
//exit;

dol_mkdir($conf->societe->multidir_temp[$object->entity]);

Expand Down Expand Up @@ -313,8 +324,12 @@ function write_file($object,$outputlangs,$srctemplatepath,$hidedetails=0,$hidede
$reshook=$hookmanager->executeHooks('beforeODTSave',$parameters,$this,$action); // Note that $action and $object may have been modified by some hooks

// Write new file
//$result=$odfHandler->exportAsAttachedFile('toto');
$odfHandler->saveToDisk($file);
if (!empty($conf->global->MAIN_ODT_AS_PDF)) {
$odfHandler->exportAsAttachedPDF($file);
}
else {
$odfHandler->saveToDisk($file);
}

if (! empty($conf->global->MAIN_UMASK))
@chmod($file, octdec($conf->global->MAIN_UMASK));
Expand Down
5 changes: 0 additions & 5 deletions htdocs/core/search_page.php
Expand Up @@ -40,11 +40,6 @@
$right=($langs->trans("DIRECTION")=='rtl'?'left':'right');
$left=($langs->trans("DIRECTION")=='rtl'?'right':'left');

//var_dump($langs->defaultlang);
//var_dump($conf->format_date_short_java);
//var_dump($langs->trans("FormatDateShortJava"));



/*
* View
Expand Down
6 changes: 4 additions & 2 deletions htdocs/core/tpl/admin_extrafields_add.tpl.php
Expand Up @@ -27,7 +27,7 @@ function init_typeoffields(type)
var required = jQuery("#required");
var default_value = jQuery("#default_value");
<?php
if(GETPOST('type') != "select")
if((GETPOST('type') != "select") && (GETPOST('type') != "sellist"))
{
print 'jQuery("#value_choice").hide();';
}
Expand All @@ -48,6 +48,7 @@ function init_typeoffields(type)
else if (type == 'boolean') { size.val('').attr('disabled','disabled'); unique.attr('disabled','disabled'); jQuery("#value_choice").hide();}
else if (type == 'price') { size.val('').attr('disabled','disabled'); unique.attr('disabled','disabled'); jQuery("#value_choice").hide();}
else if (type == 'select') { size.val('').attr('disabled','disabled'); unique.attr('disabled','disabled'); jQuery("#value_choice").show();}
else if (type == 'sellist') { size.val('').attr('disabled','disabled'); unique.attr('disabled','disabled'); jQuery("#value_choice").show();}
else if (type == 'checkbox') { size.val('').attr('disabled','disabled'); unique.attr('disabled','disabled'); jQuery("#value_choice").show();}
else if (type == 'radio') { size.val('').attr('disabled','disabled'); unique.attr('disabled','disabled'); jQuery("#value_choice").show();}
else if (type == 'separate') { size.val('').attr('disabled','disabled'); unique.attr('disabled','disabled'); required.val('').attr('disabled','disabled'); default_value.val('').attr('disabled','disabled'); jQuery("#value_choice").hide();}
Expand All @@ -63,6 +64,7 @@ function init_typeoffields(type)
<form action="<?php echo $_SERVER["PHP_SELF"]; ?>" method="post">
<input type="hidden" name="token" value="<?php echo $_SESSION['newtoken']; ?>">
<input type="hidden" name="action" value="add">
<input type="hidden" name="rowid" value="<?php echo $rowid ?>">

<table summary="listofattributes" class="border centpercent">
<!-- Type -->
Expand All @@ -85,7 +87,7 @@ function init_typeoffields(type)
<table class="nobordernopadding">
<tr><td width="30%">
<textarea name="param" id="param"><?php echo GETPOST('param'); ?></textarea>
</td><td><?php print $form->textwithpicto('', $langs->trans("ExtrafieldParamHelp"),1,0)?></td></tr>
</td><td><?php print $form->textwithpicto('', $langs->trans("ExtrafieldParamHelp".$type),1,0)?></td></tr>
</table>
</td>

Expand Down
7 changes: 6 additions & 1 deletion htdocs/core/tpl/admin_extrafields_edit.tpl.php
Expand Up @@ -44,6 +44,7 @@ function init_typeoffields(type)
<input type="hidden" name="token" value="<?php echo $_SESSION['newtoken']; ?>">
<input type="hidden" name="attrname" value="<?php echo $attrname; ?>">
<input type="hidden" name="action" value="update">
<input type="hidden" name="rowid" value="<?php echo $rowid ?>">

<table summary="listofattributes" class="border centpercent">

Expand Down Expand Up @@ -80,15 +81,19 @@ function init_typeoffields(type)
</td></tr>
<!-- Value (for select list / radio) -->
<?php
if(($type == 'select') || ($type == 'checkbox') ||(($type == 'radio')))
if(($type == 'select') || ($type == 'sellist') || ($type == 'checkbox') ||(($type == 'radio')))
{
?>
<tr id="value_choice">
<td>
<?php echo $langs->trans("Value"); ?>
</td>
<td>
<table class="nobordernopadding">
<tr><td width="30%">
<textarea name="param" id="param"><?php echo $param_chain; ?></textarea>
</td><td><?php print $form->textwithpicto('', $langs->trans("ExtrafieldParamHelp".$type),1,0)?></td></tr>
</table>
</td>
</tr>
<?php
Expand Down
14 changes: 11 additions & 3 deletions htdocs/core/tpl/objectline_add.tpl.php
Expand Up @@ -80,8 +80,8 @@
'origin_price_ht_cache' => 'price_ht',
'origin_tva_tx_cache' => 'tva_tx',
'origin_price_ttc_cache' => 'price_ttc',
'qty' => 'qty'
,'remise_percent' => 'discount'
'qty' => 'qty',
'remise_percent' => 'discount'
),
'update_textarea' => array(
'product_desc' => 'desc'
Expand Down Expand Up @@ -160,7 +160,10 @@
<input type="hidden" id="origin_price_ttc_cache" name="origin_price_ttc_cache" value="" />
</td>
<td align="right"><input type="text" size="3" id="qty" name="qty" value="<?php echo (GETPOST('qty')?GETPOST('qty'):1); ?>"></td>
<td align="right" nowrap="nowrap"><input type="text" size="1" value="<?php echo $buyer->remise_client; ?>" id="remise_percent" name="remise_percent">%</td>
<td align="right" nowrap="nowrap">
<input type="text" size="1" value="<?php echo $buyer->remise_client; ?>" id="remise_percent" name="remise_percent">%
<input type="hidden" id="origin_remise_percent" name="origin_remise_percent" value="<?php echo $buyer->remise_client; ?>" />
</td>
<?php
$colspan = 4;
if (! empty($conf->margin->enabled)) {
Expand Down Expand Up @@ -373,6 +376,11 @@ function(data) {
$('#price_ttc').attr('disabled','disabled');
}

$('#remise_percent').bind('change', function() {
if ($(this).val() < $('#origin_remise_percent').val())
$('#remise_percent').val($('#origin_remise_percent').val());
});

$('#tva_tx').change(function() {
if ($(this).val() == 0) {
if ($('#idprod').val() == 0) {
Expand Down
@@ -1,6 +1,7 @@
<?php
/* Copyright (C) 2006-2011 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2011 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2013 Marcos GarcĂ­a <marcosgdf@gmail.com>
*
* 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
Expand Down Expand Up @@ -35,7 +36,8 @@ class InterfaceNotification
'PROPAL_VALIDATE',
'FICHINTER_VALIDATE',
'ORDER_SUPPLIER_APPROVE',
'ORDER_SUPPLIER_REFUSE'
'ORDER_SUPPLIER_REFUSE',
'SHIPPING_VALIDATE'
);

/**
Expand Down Expand Up @@ -196,6 +198,19 @@ function run_trigger($action,$object,$user,$langs,$conf)
$notify = new Notify($this->db);
$notify->send($action, $object->socid, $mesg, 'order_supplier', $object->id, $filepdf);
}
elseif ($action == 'SHIPPING_VALIDATE')
{
dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);

$ref = dol_sanitizeFileName($object->ref);
$filepdf = $conf->expedition->dir_output . '/sending/' . $ref . '/' . $ref . '.pdf';
if (! file_exists($filepdf)) $filepdf='';
$mesg = $langs->transnoentitiesnoconv("EMailTextExpeditionValidated",$object->ref);


$notify = new Notify($this->db);
$notify->send($action, $object->socid, $mesg, 'expedition', $object->id, $filepdf);
}

// If not found
/*
Expand Down
3 changes: 2 additions & 1 deletion htdocs/ecm/class/ecmdirectory.class.php
Expand Up @@ -142,7 +142,8 @@ function create($user)

$dir=$conf->ecm->dir_output.'/'.$this->getRelativePath();
$result=dol_mkdir($dir);

if ($result < 0) { $error++; $this->error="ErrorFailedToCreateDir"; }

// Appel des triggers
include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php';
$interface=new Interfaces($this->db);
Expand Down
1 change: 1 addition & 0 deletions htdocs/ecm/docdir.php
Expand Up @@ -118,6 +118,7 @@
{
$langs->load("errors");
setEventMessage($langs->trans($ecmdir->error), 'errors');
setEventMessage($ecmdir->errors, 'errors');
$action = 'create';
}
}
Expand Down
71 changes: 13 additions & 58 deletions htdocs/expedition/class/expedition.class.php
Expand Up @@ -1199,7 +1199,7 @@ function list_delivery_methods($id='')
{
global $langs;

$listmeths = array();
$this->listmeths = array();
$i=0;

$sql = "SELECT em.rowid, em.code, em.libelle, em.description, em.tracking, em.active";
Expand All @@ -1216,29 +1216,11 @@ function list_delivery_methods($id='')
$label=$langs->trans('SendingMethod'.$obj->code);
$this->listmeths[$i]['libelle'] = ($label != 'SendingMethod'.$obj->code?$label:$obj->libelle);
$this->listmeths[$i]['description'] = $obj->description;
if ($obj->tracking)
{
$this->listmeths[$i]['tracking'] = $obj->tracking;
}
else
{
if ($obj->code)
{
$classname = "methode_expedition_".strtolower($obj->code);

if (file_exists(DOL_DOCUMENT_ROOT."/core/modules/expedition/methode_expedition_".strtolower($obj->code).".modules.php") )
{
require_once DOL_DOCUMENT_ROOT."/core/modules/expedition/methode_expedition_".strtolower($obj->code).'.modules.php';
$shipmethod = new $classname();
$this->listmeths[$i]['tracking'] = $shipmethod->provider_url_status('{TRACKID}');
}
}
}
$this->listmeths[$i]['tracking'] = $obj->tracking;
$this->listmeths[$i]['active'] = $obj->active;
$i++;
}
}
else dol_print_error($this->db,'');
}

/**
Expand Down Expand Up @@ -1309,8 +1291,6 @@ function disable_delivery_method($id)
*/
function GetUrlTrackingStatus($value='')
{
$code='';

if (! empty($this->shipping_method_id))
{
$sql = "SELECT em.code, em.tracking";
Expand All @@ -1322,46 +1302,21 @@ function GetUrlTrackingStatus($value='')
{
if ($obj = $this->db->fetch_object($resql))
{
$code = $obj->code;
$tracking = $obj->tracking;
$tracking = $obj->tracking;
}
}
}

if ($tracking)
{
$url = str_replace('{TRACKID}', $value, $tracking);
$this->tracking_url = sprintf('<a target="_blank" href="%s">'.($value?$value:'url').'</a>',$url,$url);
}
else
{
if ($code)
{
$classname = "methode_expedition_".strtolower($code);

$url='';
if (file_exists(DOL_DOCUMENT_ROOT."/core/modules/expedition/methode_expedition_".strtolower($code).".modules.php") && ! empty($this->tracking_number))
{
require_once DOL_DOCUMENT_ROOT."/core/modules/expedition/methode_expedition_".strtolower($code).'.modules.php';
$shipmethod = new $classname();
$url = $shipmethod->provider_url_status($this->tracking_number);
}

if ($url)
{
$this->tracking_url = sprintf('<a target="_blank" href="%s">'.($value?$value:'url').'</a>',$url,$url);
}
else
{
$this->tracking_url = $value;
}
}
else
{
$this->tracking_url = $value;
}
}
}
if (!empty($tracking) && !empty($value))
{
$url = str_replace('{TRACKID}', $value, $tracking);
$this->tracking_url = sprintf('<a target="_blank" href="%s">'.($value?$value:'url').'</a>',$url,$url);
}
else
{
$this->tracking_url = $value;
}
}

/**
* Classify the shipping as invoiced
Expand Down
30 changes: 21 additions & 9 deletions htdocs/expedition/fiche.php
Expand Up @@ -5,6 +5,7 @@
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2011-2012 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
* Copyright (C) 2013 Marcos GarcĂ­a <marcosgdf@gmail.com>
*
* 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
Expand Down Expand Up @@ -698,16 +699,16 @@
//$lines = $object->fetch_lines(1);
$numAsked = count($object->lines);

print '<script type="text/javascript" language="javascript">
jQuery(document).ready(function() {
jQuery("#autofill").click(function() {';
print '<script type="text/javascript" language="javascript">
jQuery(document).ready(function() {
jQuery("#autofill").click(function() {';
$i=0;
while($i < $numAsked)
{
print 'jQuery("#qtyl'.$i.'").val(jQuery("#qtyasked'.$i.'").val() - jQuery("#qtydelivered'.$i.'").val());'."\n";
$i++;
}
print '});
}
print '});
jQuery("#autoreset").click(function() {';
$i=0;
while($i < $numAsked)
Expand All @@ -716,8 +717,8 @@
$i++;
}
print '});
});
</script>';
});
</script>';


print '<br>';
Expand Down Expand Up @@ -904,7 +905,7 @@

print '<br><center><input type="submit" class="button" value="'.$langs->trans("Create").'"></center>';

print '</form>';
print '</form>';

print '<br>';
}
Expand Down Expand Up @@ -974,7 +975,18 @@
{
$numref = $object->ref;
}
$ret=$form->form_confirm($_SERVER['PHP_SELF'].'?id='.$object->id,$langs->trans('ValidateSending'),$langs->trans("ConfirmValidateSending",$numref),'confirm_valid','',0,1);

$text = $langs->trans("ConfirmValidateSending",$numref);

if (! empty($conf->notification->enabled))
{
require_once DOL_DOCUMENT_ROOT .'/core/class/notify.class.php';
$notify=new Notify($db);
$text.='<br>';
$text.=$notify->confirmMessage('SHIPPING_VALIDATE',$object->socid);
}

$ret=$form->form_confirm($_SERVER['PHP_SELF'].'?id='.$object->id,$langs->trans('ValidateSending'),$text,'confirm_valid','',0,1);
if ($ret == 'html') print '<br>';
}
/*
Expand Down
4 changes: 2 additions & 2 deletions htdocs/externalsite/frames.php
Expand Up @@ -25,12 +25,12 @@

require '../main.inc.php';

$langs->load("externalsite@externalsite");
$langs->load("externalsite");

if (empty($conf->global->EXTERNALSITE_URL))
{
llxHeader();
print '<div class="error">Module ExternalSite was not configured properly.</div>';
print '<div class="error">'.$langs->trans('ExternalSiteModuleNotComplete').'</div>';
llxFooter();
}

Expand Down
2 changes: 1 addition & 1 deletion htdocs/externalsite/frametop.php
Expand Up @@ -24,7 +24,7 @@

require ("../main.inc.php");

$langs->load("@externalsite");
$langs->load("externalsite");

top_htmlhead("","");
top_menu("","","_top");
Expand Down
4 changes: 2 additions & 2 deletions htdocs/fichinter/apercu.php
Expand Up @@ -100,7 +100,7 @@

print "<tr $bc[$var]><td>".$langs->trans("Intervention")." PDF</td>";

print '<td><a href="'.DOL_URL_ROOT . '/document.php?modulepart=ficheinter&file='.urlencode($relativepath).'">'.$object->ref.'.pdf</a></td>';
print '<td><a data-ajax="false" href="'.DOL_URL_ROOT . '/document.php?modulepart=ficheinter&file='.urlencode($relativepath).'">'.$object->ref.'.pdf</a></td>';
print '<td align="right">'.dol_print_size(dol_filesize($file)).'</td>';
print '<td align="right">'.dol_print_date(dol_filemtime($file),'dayhour').'</td>';
print '</tr>';
Expand All @@ -110,7 +110,7 @@
{
print "<tr $bc[$var]><td>Fiche d'intervention detaillee</td>";

print '<td><a href="'.DOL_URL_ROOT . '/document.php?modulepart=ficheinter&file='.urlencode($relativepathdetail).'">'.$object->ref.'-detail.pdf</a></td>';
print '<td><a data-ajax="false" href="'.DOL_URL_ROOT . '/document.php?modulepart=ficheinter&file='.urlencode($relativepathdetail).'">'.$object->ref.'-detail.pdf</a></td>';
print '<td align="right">'.dol_print_size(dol_filesize($filedetail)).'</td>';
print '<td align="right">'.dol_print_date(dol_filemtime($filedetail),'dayhour').'</td>';
print '</tr>';
Expand Down
2 changes: 1 addition & 1 deletion htdocs/fichinter/fiche.php
Expand Up @@ -386,7 +386,7 @@
else if ($action == 'setnote_private' && $user->rights->ficheinter->creer)
{
$object->fetch($id);
$result=$object->update_note(dol_html_entity_decode(GETPOST('note_private'), ENT_QUOTES));
$result=$object->update_note(dol_html_entity_decode(GETPOST('note_private'), ENT_QUOTES), '_private');
if ($result < 0) dol_print_error($db,$object->error);
}

Expand Down
2 changes: 2 additions & 0 deletions htdocs/fourn/class/fournisseur.facture.class.php
Expand Up @@ -141,6 +141,7 @@ function create($user)
$sql.= ", fk_soc";
$sql.= ", datec";
$sql.= ", datef";
$sql.= ", fk_projet";
$sql.= ", note_private";
$sql.= ", note_public";
$sql.= ", fk_user_author";
Expand All @@ -154,6 +155,7 @@ function create($user)
$sql.= ", ".$this->socid;
$sql.= ", '".$this->db->idate($now)."'";
$sql.= ", '".$this->db->idate($this->date)."'";
$sql.= ", ".$this->fk_project;
$sql.= ", '".$this->db->escape($this->note_private)."'";
$sql.= ", '".$this->db->escape($this->note_public)."'";
$sql.= ", ".$user->id.",";
Expand Down
4 changes: 2 additions & 2 deletions htdocs/fourn/class/fournisseur.product.class.php
Expand Up @@ -296,7 +296,7 @@ function update_buyprice($qty, $buyprice, $user, $price_base_type, $fourn, $avai
function fetch_product_fournisseur_price($rowid)
{
$sql = "SELECT pfp.rowid, pfp.price, pfp.quantity, pfp.unitprice, pfp.remise_percent, pfp.remise, pfp.tva_tx, pfp.fk_availability,";
$sql.= " pfp.fk_soc, pfp.ref_fourn, pfp.fk_product, pfp.charges, pfp.unitcharges, pfp.recuperableonly as fourn_tva_npr";
$sql.= " pfp.fk_soc, pfp.ref_fourn, pfp.fk_product, pfp.charges, pfp.unitcharges"; // , pfp.recuperableonly as fourn_tva_npr"; FIXME this field not exist in llx_product_fournisseur_price
$sql.= " FROM ".MAIN_DB_PREFIX."product_fournisseur_price as pfp";
$sql.= " WHERE pfp.rowid = ".$rowid;

Expand All @@ -320,7 +320,7 @@ function fetch_product_fournisseur_price($rowid)
$this->product_id = $obj->fk_product; // deprecated
$this->fk_product = $obj->fk_product;
$this->fk_availability = $obj->fk_availability;
$this->fourn_tva_npr = $obj->fourn_tva_npr;
//$this->fourn_tva_npr = $obj->fourn_tva_npr; // FIXME this field not exist in llx_product_fournisseur_price
return 1;
}
else
Expand Down
6 changes: 3 additions & 3 deletions htdocs/fourn/commande/fiche.php
Expand Up @@ -1077,7 +1077,7 @@
require_once DOL_DOCUMENT_ROOT .'/core/class/notify.class.php';
$notify=new Notify($db);
$text.='<br>';
$text.=$notify->confirmMessage(3,$object->socid);
$text.=$notify->confirmMessage('ORDER_SUPPLIER_APPROVE', $object->socid);
}

$ret=$form->form_confirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('ValidateOrder'), $text, 'confirm_valid', '', 0, 1);
Expand Down Expand Up @@ -1762,10 +1762,10 @@

print "</div>";
}
print "<br>";
print "<br>";


print '<div class="fichecenter"><div class="fichehalfleft">';
print '<div class="fichecenter"><div class="fichehalfleft">';
//print '<table width="100%"><tr><td width="50%" valign="top">';
//print '<a name="builddoc"></a>'; // ancre

Expand Down
4 changes: 2 additions & 2 deletions htdocs/fourn/commande/note.php
Expand Up @@ -54,9 +54,9 @@
$result=$object->update_note(dol_html_entity_decode(GETPOST('note_public'), ENT_QUOTES),'_public');
if ($result < 0) dol_print_error($db,$object->error);
}
elseif ($action == 'setnote' && $user->rights->fournisseur->commande->creer)
elseif ($action == 'setnote_private' && $user->rights->fournisseur->commande->creer)
{
$result=$object->update_note(dol_html_entity_decode(GETPOST('note'), ENT_QUOTES));
$result=$object->update_note(dol_html_entity_decode(GETPOST('note_private'), ENT_QUOTES), '_private');
if ($result < 0) dol_print_error($db,$object->error);
}

Expand Down
26 changes: 19 additions & 7 deletions htdocs/fourn/facture/fiche.php
Expand Up @@ -41,6 +41,8 @@
require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
if (!empty($conf->projet->enabled))
require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
if (! empty($conf->projet->enabled))
require_once DOL_DOCUMENT_ROOT.'/core/lib/project.lib.php';


$langs->load('bills');
Expand Down Expand Up @@ -271,6 +273,7 @@
// Creation facture
$object->ref = $_POST['ref'];
$object->ref_supplier = $_POST['ref_supplier'];
$object->fk_project = GETPOST('projectid');
$object->socid = $_POST['socid'];
$object->libelle = $_POST['libelle'];
$object->date = $datefacture;
Expand Down Expand Up @@ -1153,6 +1156,15 @@
print '<tr><td>'.$langs->trans('DateMaxPayment').'</td><td>';
$form->select_date($datedue,'ech','','','',"add",1,1);
print '</td></tr>';

// Project
if (! empty($conf->projet->enabled))
{
$langs->load('projects');
print '<tr><td>'.$langs->trans('Project').'</td><td colspan="2">';
select_projects(-1, $projectid, 'projectid');
print '</td></tr>';
}

print '<tr><td>'.$langs->trans('NotePublic').'</td>';
print '<td>';
Expand Down Expand Up @@ -1330,12 +1342,12 @@
}

$text=$langs->trans('ConfirmValidateBill',$numref);
/*if (! empty($conf->notification->enabled))
{
require_once DOL_DOCUMENT_ROOT .'/core/class/notify.class.php';
$notify=new Notify($db);
$text.='<br>';
$text.=$notify->confirmMessage('NOTIFY_VAL_FAC_SUP',$object->socid);
/*if (! empty($conf->notification->enabled))
{
require_once DOL_DOCUMENT_ROOT .'/core/class/notify.class.php';
$notify=new Notify($db);
$text.='<br>';
$text.=$notify->confirmMessage('BILL_SUPPLIER_VALIDATE',$object->socid);
}*/
$formquestion=array();

Expand Down Expand Up @@ -2054,7 +2066,7 @@
print '<a class="butActionDelete" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&amp;action=delete">'.$langs->trans('Delete').'</a>';
}
print '</div>';
print '<br>';
print '<br>';

if ($action != 'edit')
{
Expand Down
6 changes: 3 additions & 3 deletions htdocs/fourn/facture/index.php
@@ -1,7 +1,7 @@
<?php
/* Copyright (C) 2002-2006 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2013 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2005-2013 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2013 Philippe Grand <philippe.grand@atoo-net.com>
*
* This program is free software; you can redistribute it and/or modify
Expand Down Expand Up @@ -156,12 +156,12 @@

if (GETPOST("search_montant_ht"))
{
$sql .= " AND fac.total_ht = '".$db->escape(GETPOST("search_montant_ht"))."'";
$sql .= " AND fac.total_ht = '".$db->escape(price2num(GETPOST("search_montant_ht")))."'";
}

if (GETPOST("search_montant_ttc"))
{
$sql .= " AND fac.total_ttc = '".$db->escape(GETPOST("search_montant_ttc"))."'";
$sql .= " AND fac.total_ttc = '".$db->escape(price2num(GETPOST("search_montant_ttc")))."'";
}

$sql.= $db->order($sortfield,$sortorder);
Expand Down
20 changes: 14 additions & 6 deletions htdocs/fourn/fiche.php
Expand Up @@ -85,8 +85,9 @@
dol_fiche_head($head, 'supplier', $langs->trans("ThirdParty"),0,'company');


print '<table width="100%" class="notopnoleftnoright">';
print '<tr><td valign="top" width="50%" class="notopnoleft">';
print '<div class="fichecenter"><div class="fichehalfleft">';
//print '<table width="100%" class="notopnoleftnoright">';
//print '<tr><td valign="top" width="50%" class="notopnoleft">';

print '<table width="100%" class="border">';
print '<tr><td width="20%">'.$langs->trans("ThirdPartyName").'</td><td width="80%" colspan="3">';
Expand Down Expand Up @@ -216,7 +217,11 @@

print '</table>';

print '</td><td valign="top" width="50%" class="notopnoleftnoright">';

print '</div><div class="fichehalfright"><div class="ficheaddleft">';
//print '</td><td valign="top" width="50%" class="notopnoleftnoright">';


$var=true;

$MAXLIST=5;
Expand Down Expand Up @@ -367,9 +372,12 @@
}
}

print '</td></tr>';
print '</table>' . "\n";
print '</div>';
print '</div></div></div>';
print '<div style="clear:both"></div>';
//print '</td></tr>';
//print '</table>' . "\n";

dol_fiche_end();


/*
Expand Down
2 changes: 1 addition & 1 deletion htdocs/holiday/admin/holiday.php
Expand Up @@ -278,7 +278,7 @@

/*$var=!$var;
print '<tr '.$bc[$var].'>'."\n";
print '<td style="padding:5px; width: 40%;">'.$langs->trans('GroupToValidateCP').'</td>'."\n";
print '<td style="padding:5px;">'.$langs->trans('GroupToValidateCP').'</td>'."\n";
print '<td style="padding:5px;">'.$cp->selectUserGroup('userGroup').'</td>'."\n";
print '</tr>'."\n";
*/
Expand Down
13 changes: 10 additions & 3 deletions htdocs/holiday/index.php
@@ -1,6 +1,6 @@
<?php
/* Copyright (C) 2011 Dimitri Mouillard <dmouillard@teclib.com>
* Copyright (C) 2012 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2013 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2012 Regis Houssin <regis.houssin@capnetworks.com>
*
* This program is free software; you can redistribute it and/or modify
Expand Down Expand Up @@ -228,7 +228,6 @@
print "</tr>\n";

print '</table><br>';

}
else
{
Expand All @@ -242,7 +241,15 @@
$nbdeduced=$holiday->getConfCP('nbHolidayDeducted');
$nb_holiday = $nbaquis / $nbdeduced;
print $langs->trans('SoldeCPUser',round($nb_holiday,2)).($nbdeduced != 1 ? ' ('.$nbaquis.' / '.$nbdeduced.')' : '');
print '</div>';

if ($id > 0)
{
dol_fiche_end();
print '</br>';
}
else {
print '</div>';
}

print '<form method="get" action="'.$_SERVER["PHP_SELF"].'">'."\n";
print '<table class="noborder" width="100%;">';
Expand Down
8 changes: 4 additions & 4 deletions htdocs/imports/import.php
Expand Up @@ -569,7 +569,7 @@
print '<tr '.$bc[$var].'>';
print '<td width="16">'.img_mime($file).'</td>';
print '<td>';
print '<a href="'.DOL_URL_ROOT.'/document.php?modulepart='.$modulepart.'&file='.urlencode($relativepath).'&step=3'.$param.'" target="_blank">';
print '<a data-ajax="false" href="'.DOL_URL_ROOT.'/document.php?modulepart='.$modulepart.'&file='.urlencode($relativepath).'&step=3'.$param.'" target="_blank">';
print $file;
print '</a>';
print '</td>';
Expand Down Expand Up @@ -742,7 +742,7 @@
print '<td>';
$modulepart='import';
$relativepath=GETPOST('filetoimport');
print '<a href="'.DOL_URL_ROOT.'/document.php?modulepart='.$modulepart.'&file='.urlencode($relativepath).'&step=4'.$param.'" target="_blank">';
print '<a data-ajax="false" href="'.DOL_URL_ROOT.'/document.php?modulepart='.$modulepart.'&file='.urlencode($relativepath).'&step=4'.$param.'" target="_blank">';
print $filetoimport;
print '</a>';
print '</td></tr>';
Expand Down Expand Up @@ -1172,7 +1172,7 @@
print '<td>';
$modulepart='import';
$relativepath=GETPOST('filetoimport');
print '<a href="'.DOL_URL_ROOT.'/document.php?modulepart='.$modulepart.'&file='.urlencode($relativepath).'&step=4'.$param.'" target="_blank">';
print '<a data-ajax="false" href="'.DOL_URL_ROOT.'/document.php?modulepart='.$modulepart.'&file='.urlencode($relativepath).'&step=4'.$param.'" target="_blank">';
print $filetoimport;
print '</a>';
print '</td></tr>';
Expand Down Expand Up @@ -1506,7 +1506,7 @@
print '<td>';
$modulepart='import';
$relativepath=GETPOST('filetoimport');
print '<a href="'.DOL_URL_ROOT.'/document.php?modulepart='.$modulepart.'&file='.urlencode($relativepath).'&step=4'.$param.'" target="_blank">';
print '<a data-ajax="false" href="'.DOL_URL_ROOT.'/document.php?modulepart='.$modulepart.'&file='.urlencode($relativepath).'&step=4'.$param.'" target="_blank">';
print $filetoimport;
print '</a>';
print '</td></tr>';
Expand Down