This commit is contained in:
Alexis Algoud 2013-12-11 15:15:30 +01:00
commit 4844aed67e
57 changed files with 655 additions and 428 deletions

View File

@ -140,6 +140,14 @@ Fix: [ bug #1142 ] Set paiement on invoice (PGSql)
Fix: [ bug #1145 ] Agenda button list type do not display Fix: [ bug #1145 ] Agenda button list type do not display
Fix: [ bug #1148 ] Product consomation : supplier order bad status Fix: [ bug #1148 ] Product consomation : supplier order bad status
Fix: [ bug #1159 ] Commercial search "other" give p.note do not exists Fix: [ bug #1159 ] Commercial search "other" give p.note do not exists
Fix: [ bug #1174 ] Product translated description not good into PDF
Fix: [ bug #1163 ] SQL Error when searching for supplier orders
Fix: [ bug #1162 ] Translaction for morning and afternoon
Fix: [ bug #1161 ] Search on product label
Fix: [ bug #1075 ] POS module doesn't decrement stock of products in delayed payment mode.
Fix: [ bug #1171 ] Documents lost in interventions after validating
Fix: fix unsubscribe URL into mailing when sending manually (not by script)
Fix: [ bug #1182 ] ODT company_country tag is htmlencoded
***** ChangeLog for 3.4.1 compared to 3.4.0 ***** ***** ChangeLog for 3.4.1 compared to 3.4.0 *****
Fix: Display buying price on line edit when no supplier price is defined Fix: Display buying price on line edit when no supplier price is defined
@ -170,7 +178,6 @@ Fix: there was no escaping on filter fields in supplier product list
Fix: bugs on margin reports and better margin calculation on credit notes Fix: bugs on margin reports and better margin calculation on credit notes
Qual: Add travis-ci integration Qual: Add travis-ci integration
***** ChangeLog for 3.4 compared to 3.3.* ***** ***** ChangeLog for 3.4 compared to 3.3.* *****
For users: For users:
- New: Can use ODS templates as document templates. - New: Can use ODS templates as document templates.

View File

@ -22,7 +22,7 @@ File added into doxygen generated documentation
<hr class="footer" /> <hr class="footer" />
<address class="footer"><small>Generated on $datetime <address class="footer"><small>Generated on $datetime
for <a href="http://www.dolibarr.org">$projectname</a> by Doxygen </a> $doxygenversion </small></address> for <a href="http://www.dolibarr.org">$projectname</a> by Doxygen $doxygenversion </small></address>
<!-- Google AdSense --> <!-- Google AdSense -->
@ -40,5 +40,6 @@ google_ad_height = 60;
<!-- End google adsense --> <!-- End google adsense -->
<br> <br>
</div>
</body> </body>
</html> </html>

16
htdocs/.gitignore vendored
View File

@ -1,11 +1,11 @@
/test.php /test.php
/custom* /custom*
/bootstrap /extensions*
/extensions /nltechno*
/google /bootstrap*
/multicompany /google*
/numberingpack /multicompany*
/ovh /numberingpack*
/ovh*
/pos /pos
/skincoloreditor /ultimatepdf*
/ultimatepdf

View File

@ -292,14 +292,14 @@ if ($action == 'edit' || $action == 'updateedit')
// Country // Country
$var=!$var; $var=!$var;
print '<tr '.$bc[$var].'><td class="fieldrequired">'.$langs->trans("Country").'</td><td>'; print '<tr '.$bc[$var].'><td class="fieldrequired">'.$langs->trans("Country").'</td><td class="maxwidthonsmartphone">';
//if (empty($country_selected)) $country_selected=substr($langs->defaultlang,-2); // Par defaut, pays de la localisation //if (empty($country_selected)) $country_selected=substr($langs->defaultlang,-2); // Par defaut, pays de la localisation
print $form->select_country($mysoc->country_id,'country_id'); print $form->select_country($mysoc->country_id,'country_id');
if ($user->admin) print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionnarySetup"),1); if ($user->admin) print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionnarySetup"),1);
print '</td></tr>'."\n"; print '</td></tr>'."\n";
$var=!$var; $var=!$var;
print '<tr '.$bc[$var].'><td>'.$langs->trans("State").'</td><td>'; print '<tr '.$bc[$var].'><td>'.$langs->trans("State").'</td><td class="maxwidthonsmartphone">';
$formcompany->select_departement($conf->global->MAIN_INFO_SOCIETE_STATE,$mysoc->country_code,'state_id'); $formcompany->select_departement($conf->global->MAIN_INFO_SOCIETE_STATE,$mysoc->country_code,'state_id');
print '</td></tr>'."\n"; print '</td></tr>'."\n";

View File

@ -42,9 +42,6 @@ $consts=GETPOST('const');
$constname=GETPOST('constname','alpha'); $constname=GETPOST('constname','alpha');
$constvalue=GETPOST('constvalue'); $constvalue=GETPOST('constvalue');
$constnote=GETPOST('constnote','alpha'); $constnote=GETPOST('constnote','alpha');
$consttype=(GETPOST('consttype','alpha')?GETPOST('consttype','alpha'):'chaine');
$typeconst=array('yesno' => 'yesno', 'texte' => 'texte', 'chaine' => 'chaine');
@ -52,7 +49,7 @@ $typeconst=array('yesno' => 'yesno', 'texte' => 'texte', 'chaine' => 'chaine');
* Actions * Actions
*/ */
if ($action == 'add') if ($action == 'add' || (GETPOST('add') && $action != 'update'))
{ {
$error=0; $error=0;
@ -69,9 +66,13 @@ if ($action == 'add')
if (! $error) if (! $error)
{ {
if (dolibarr_set_const($db, $constname, $constvalue, $typeconst[$consttype], 1, $constnote, $entity) >= 0) if (dolibarr_set_const($db, $constname, $constvalue, 'chaine', 1, $constnote, $entity) >= 0)
{ {
setEventMessage($langs->trans("RecordSaved")); setEventMessage($langs->trans("RecordSaved"));
$action="";
$constname="";
$constvalue="";
$constnote="";
} }
else else
{ {
@ -176,6 +177,10 @@ print_fiche_titre($langs->trans("OtherSetup"),'','setup');
print $langs->trans("ConstDesc")."<br>\n"; print $langs->trans("ConstDesc")."<br>\n";
print "<br>\n"; print "<br>\n";
print '<form action="'.$_SERVER["PHP_SELF"].((empty($user->entity) && $debug)?'?debug=1':'').'" method="POST">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<input type="hidden" id="action" name="action" value="">';
print '<table class="noborder" width="100%">'; print '<table class="noborder" width="100%">';
print '<tr class="liste_titre">'; print '<tr class="liste_titre">';
print '<td>'.$langs->trans("Name").'</td>'; print '<td>'.$langs->trans("Name").'</td>';
@ -189,15 +194,12 @@ print "</tr>\n";
// Line to add new record // Line to add new record
$var=false; $var=false;
print "\n"; print "\n";
print '<form action="'.$_SERVER["PHP_SELF"].'" method="POST">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<input type="hidden" name="action" value="add">';
print '<tr '.$bc[$var].'><td><input type="text" class="flat" size="24" name="constname" value=""></td>'."\n"; print '<tr '.$bc[$var].'><td><input type="text" class="flat" size="24" name="constname" value="'.$constname.'"></td>'."\n";
print '<td>'; print '<td>';
print '<input type="text" class="flat" size="30" name="constvalue" value="">'; print '<input type="text" class="flat" size="30" name="constvalue" value="'.$constvalue.'">';
print '</td><td>'; print '</td><td>';
print '<input type="text" class="flat" size="40" name="constnote" value="">'; print '<input type="text" class="flat" size="40" name="constnote" value="'.$constnote.'">';
print '</td>'; print '</td>';
// Limit to superadmin // Limit to superadmin
if (! empty($conf->multicompany->enabled) && !$user->entity) if (! empty($conf->multicompany->enabled) && !$user->entity)
@ -205,22 +207,17 @@ if (! empty($conf->multicompany->enabled) && !$user->entity)
print '<td>'; print '<td>';
print '<input type="text" class="flat" size="1" name="entity" value="'.$conf->entity.'">'; print '<input type="text" class="flat" size="1" name="entity" value="'.$conf->entity.'">';
print '</td>'; print '</td>';
print '<td align="center">';
} }
else else
{ {
print '<td align="center">';
print '<input type="hidden" name="entity" value="'.$conf->entity.'">'; print '<input type="hidden" name="entity" value="'.$conf->entity.'">';
} }
print '<td align="center">'; print '<input type="submit" class="button" value="'.$langs->trans("Add").'" name="add">';
print '<input type="submit" class="button" value="'.$langs->trans("Add").'" name="Button">';
print "</td>\n"; print "</td>\n";
print '</tr>'; print '</tr>';
print '</form>';
print "\n";
print '<form action="'.$_SERVER["PHP_SELF"].((empty($user->entity) && $debug)?'?debug=1':'').'" method="POST">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<input type="hidden" id="action" name="action" value="">';
// Show constants // Show constants
$sql = "SELECT"; $sql = "SELECT";
@ -250,21 +247,20 @@ if ($result)
$var=!$var; $var=!$var;
print "\n"; print "\n";
print '<input type="hidden" name="const['.$i.'][rowid]" value="'.$obj->rowid.'">';
print '<input type="hidden" name="const['.$i.'][name]" value="'.$obj->name.'">';
print '<input type="hidden" name="const['.$i.'][type]" value="'.$obj->type.'">';
print '<tr '.$bc[$var].'><td>'.$obj->name.'</td>'."\n"; print '<tr '.$bc[$var].'><td>'.$obj->name.'</td>'."\n";
// Value // Value
print '<td>'; print '<td>';
print '<input type="text" id="value_'.$i.'" class="flat inputforupdate" size="30" name="const['.$i.'][value]" value="'.htmlspecialchars($obj->value).'"'; print '<input type="hidden" name="const['.$i.'][rowid]" value="'.$obj->rowid.'">';
print '>'; print '<input type="hidden" name="const['.$i.'][name]" value="'.$obj->name.'">';
print '</td><td>'; print '<input type="hidden" name="const['.$i.'][type]" value="'.$obj->type.'">';
print '<input type="text" id="value_'.$i.'" class="flat inputforupdate" size="30" name="const['.$i.'][value]" value="'.htmlspecialchars($obj->value).'">';
print '</td>';
// Note // Note
print '<input type="text" id="note_'.$i.'"class="flat inputforupdate" size="40" name="const['.$i.'][note]" value="'.htmlspecialchars($obj->note,1).'"'; print '<td>';
print '>'; print '<input type="text" id="note_'.$i.'"class="flat inputforupdate" size="40" name="const['.$i.'][note]" value="'.htmlspecialchars($obj->note,1).'">';
print '</td>'; print '</td>';
// Entity limit to superadmin // Entity limit to superadmin
@ -273,13 +269,14 @@ if ($result)
print '<td>'; print '<td>';
print '<input type="text" class="flat" size="1" name="const['.$i.'][entity]" value="'.$obj->entity.'">'; print '<input type="text" class="flat" size="1" name="const['.$i.'][entity]" value="'.$obj->entity.'">';
print '</td>'; print '</td>';
print '<td align="center">';
} }
else else
{ {
print '<td align="center">';
print '<input type="hidden" name="const['.$i.'][entity]" value="'.$obj->entity.'">'; print '<input type="hidden" name="const['.$i.'][entity]" value="'.$obj->entity.'">';
} }
print '<td align="center">';
if ($conf->use_javascript_ajax) if ($conf->use_javascript_ajax)
{ {
print '<input type="checkbox" class="flat checkboxfordelete" id="check_'.$i.'" name="const['.$i.'][check]" value="1">'; print '<input type="checkbox" class="flat checkboxfordelete" id="check_'.$i.'" name="const['.$i.'][check]" value="1">';

View File

@ -1316,9 +1316,9 @@ function fieldList($fieldlist,$obj='',$tabname='')
$size=''; $size='';
if ($fieldlist[$field]=='libelle') $size='size="32" '; if ($fieldlist[$field]=='libelle') $size='size="32" ';
if ($fieldlist[$field]=='tracking') $size='size="92" '; if ($fieldlist[$field]=='tracking') $size='size="92" ';
if ($fieldlist[$field]=='accountancy_code') $size='size="15" '; if ($fieldlist[$field]=='accountancy_code') $size='size="10" ';
if ($fieldlist[$field]=='accountancy_code_sell') $size='size="15" '; if ($fieldlist[$field]=='accountancy_code_sell') $size='size="10" ';
if ($fieldlist[$field]=='accountancy_code_buy') $size='size="15" '; if ($fieldlist[$field]=='accountancy_code_buy') $size='size="10" ';
print '<input type="text" '.$size.' class="flat" value="'.(isset($obj->$fieldlist[$field])?$obj->$fieldlist[$field]:'').'" name="'.$fieldlist[$field].'">'; print '<input type="text" '.$size.' class="flat" value="'.(isset($obj->$fieldlist[$field])?$obj->$fieldlist[$field]:'').'" name="'.$fieldlist[$field].'">';
print '</td>'; print '</td>';
} }

View File

@ -136,44 +136,57 @@ foreach ($modulesdir as $dir)
try try
{ {
$res=include_once $dir.$file; $res=include_once $dir.$file;
$objMod = new $modName($db); if (class_exists($modName))
$modNameLoaded[$modName]=$dir; {
try {
$objMod = new $modName($db);
$modNameLoaded[$modName]=$dir;
if ($objMod->numero > 0) if ($objMod->numero > 0)
{ {
$j = $objMod->numero; $j = $objMod->numero;
} }
else else
{ {
$j = 1000 + $i; $j = 1000 + $i;
} }
$modulequalified=1; $modulequalified=1;
// We discard modules according to features level (PS: if module is activated we always show it) // We discard modules according to features level (PS: if module is activated we always show it)
$const_name = 'MAIN_MODULE_'.strtoupper(preg_replace('/^mod/i','',get_class($objMod))); $const_name = 'MAIN_MODULE_'.strtoupper(preg_replace('/^mod/i','',get_class($objMod)));
if ($objMod->version == 'development' && (empty($conf->global->$const_name) && ($conf->global->MAIN_FEATURES_LEVEL < 2))) $modulequalified=0; if ($objMod->version == 'development' && (empty($conf->global->$const_name) && ($conf->global->MAIN_FEATURES_LEVEL < 2))) $modulequalified=0;
if ($objMod->version == 'experimental' && (empty($conf->global->$const_name) && ($conf->global->MAIN_FEATURES_LEVEL < 1))) $modulequalified=0; if ($objMod->version == 'experimental' && (empty($conf->global->$const_name) && ($conf->global->MAIN_FEATURES_LEVEL < 1))) $modulequalified=0;
// We discard modules according to property disabled // We discard modules according to property disabled
if (isset($objMod->hidden) && $objMod->hidden) $modulequalified=false; if (isset($objMod->hidden) && $objMod->hidden) $modulequalified=false;
// Define array $categ with categ with at least one qualified module // Define array $categ with categ with at least one qualified module
if ($modulequalified) if ($modulequalified)
{ {
$modules[$i] = $objMod; $modules[$i] = $objMod;
$filename[$i]= $modName; $filename[$i]= $modName;
$orders[$i] = $objMod->family."_".$j; // Sort by family, then by module number $orders[$i] = $objMod->family."_".$j; // Sort by family, then by module number
$dirmod[$i] = $dir; $dirmod[$i] = $dir;
// Set categ[$i] // Set categ[$i]
$special = isset($specialtostring[$objMod->special])?$specialtostring[$objMod->special]:'unknown'; $special = isset($specialtostring[$objMod->special])?$specialtostring[$objMod->special]:'unknown';
if ($objMod->version == 'development' || $objMod->version == 'experimental') $special='expdev'; if ($objMod->version == 'development' || $objMod->version == 'experimental') $special='expdev';
if (isset($categ[$special])) $categ[$special]++; // Array of all different modules categories if (isset($categ[$special])) $categ[$special]++; // Array of all different modules categories
else $categ[$special]=1; else $categ[$special]=1;
$j++; $j++;
$i++; $i++;
} }
else dol_syslog("Module ".get_class($objMod)." not qualified"); else dol_syslog("Module ".get_class($objMod)." not qualified");
} }
catch(Exception $e)
{
dol_syslog("Failed to load ".$dir.$file." ".$e->getMessage(), LOG_ERR);
}
}
else
{
print "Warning bad descriptor file : ".$dir.$file." (Class ".$modName." not found into file)<br>";
}
}
catch(Exception $e) catch(Exception $e)
{ {
dol_syslog("Failed to load ".$dir.$file." ".$e->getMessage(), LOG_ERR); dol_syslog("Failed to load ".$dir.$file." ".$e->getMessage(), LOG_ERR);

View File

@ -74,15 +74,27 @@ foreach($modulesdir as $dir)
else else
{ {
// File to load // File to load
include_once $dir.$file; $res=include_once $dir.$file;
if (class_exists($modName))
{
try {
$objMod = new $modName($db);
$objMod = new $modName($db); $modules[$objMod->numero]=$objMod;
$modules_names[$objMod->numero]=$objMod->name;
$modules[$objMod->numero]=$objMod; $modules_files[$objMod->numero]=$file;
$modules_names[$objMod->numero]=$objMod->name; $modules_fullpath[$file]=$dir.$file;
$modules_files[$objMod->numero]=$file; $picto[$objMod->numero]=(isset($objMod->picto) && $objMod->picto)?$objMod->picto:'generic';
$modules_fullpath[$file]=$dir.$file; }
$picto[$objMod->numero]=(isset($objMod->picto) && $objMod->picto)?$objMod->picto:'generic'; catch(Exception $e)
{
dol_syslog("Failed to load ".$dir.$file." ".$e->getMessage(), LOG_ERR);
}
}
else
{
print "Warning bad descriptor file : ".$dir.$file." (Class ".$modName." not found into file)<br>";
}
} }
} }
} }

View File

@ -1,5 +1,5 @@
<?php <?php
/* Copyright (C) 2005-2012 Laurent Destailleur <eldy@users.sourceforge.net> /* Copyright (C) 2005-2013 Laurent Destailleur <eldy@users.sourceforge.net>
* *
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by

View File

@ -700,6 +700,8 @@ else if (($action == 'addline' || $action == 'addline_predef') && $user->rights-
$price_min=0; $price_min=0;
$price_base_type = (GETPOST('price_base_type', 'alpha')?GETPOST('price_base_type', 'alpha'):'HT'); $price_base_type = (GETPOST('price_base_type', 'alpha')?GETPOST('price_base_type', 'alpha'):'HT');
$db->begin();
// Ecrase $pu par celui du produit // Ecrase $pu par celui du produit
// Ecrase $desc par celui du produit // Ecrase $desc par celui du produit
// Ecrase $txtva par celui du produit // Ecrase $txtva par celui du produit
@ -858,6 +860,8 @@ else if (($action == 'addline' || $action == 'addline_predef') && $user->rights-
if ($result > 0) if ($result > 0)
{ {
$db->commit();
if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE))
{ {
// Define output language // Define output language
@ -898,6 +902,8 @@ else if (($action == 'addline' || $action == 'addline_predef') && $user->rights-
} }
else else
{ {
$db->rollback();
setEventMessage($object->error, 'errors'); setEventMessage($object->error, 'errors');
} }
} }
@ -981,6 +987,8 @@ else if ($action == 'updateligne' && $user->rights->propal->creer && GETPOST('sa
if (! $error) if (! $error)
{ {
$db->begin();
$result = $object->updateline( $result = $object->updateline(
GETPOST('lineid'), GETPOST('lineid'),
$pu_ht, $pu_ht,
@ -1006,6 +1014,8 @@ else if ($action == 'updateligne' && $user->rights->propal->creer && GETPOST('sa
if ($result >= 0) if ($result >= 0)
{ {
$db->commit();
if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE))
{ {
// Define output language // Define output language
@ -1035,6 +1045,8 @@ else if ($action == 'updateligne' && $user->rights->propal->creer && GETPOST('sa
} }
else else
{ {
$db->rollback();
setEventMessage($object->error, 'errors'); setEventMessage($object->error, 'errors');
} }
} }

View File

@ -1422,7 +1422,7 @@ else if (($action == 'addline' || $action == 'addline_predef') && $user->rights-
} }
} }
elseif ($action == 'updateligne' && $user->rights->facture->creer && $_POST['save'] == $langs->trans('Save')) elseif ($action == 'updateligne' && $user->rights->facture->creer && ! GETPOST('cancel'))
{ {
if (! $object->fetch($id) > 0) dol_print_error($db); if (! $object->fetch($id) > 0) dol_print_error($db);
$object->fetch_thirdparty(); $object->fetch_thirdparty();

View File

@ -1,6 +1,6 @@
<?php <?php
/* Copyright (C) 2003 Rodolphe Quiedeville <rodolphe@quiedeville.org> /* Copyright (C) 2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2010 Laurent Destailleur <eldy@users.sourceforge.net> * Copyright (C) 2004-2013 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2013 Regis Houssin <regis.houssin@capnetworks.com> * Copyright (C) 2005-2013 Regis Houssin <regis.houssin@capnetworks.com>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
@ -31,7 +31,7 @@ $langs->load("compta");
$langs->load("banks"); $langs->load("banks");
$langs->load("bills"); $langs->load("bills");
$id=GETPOST("id"); $id=GETPOST("id",'int');
$action=GETPOST('action'); $action=GETPOST('action');
// Security check // Security check
@ -87,7 +87,7 @@ if ($action == 'add' && $_POST["cancel"] <> $langs->trans("Cancel"))
if ($action == 'delete') if ($action == 'delete')
{ {
$result=$tva->fetch($_GET['id']); $result=$tva->fetch($id);
if ($tva->rappro == 0) if ($tva->rappro == 0)
{ {
@ -100,10 +100,10 @@ if ($action == 'delete')
{ {
$accountline=new AccountLine($db); $accountline=new AccountLine($db);
$result=$accountline->fetch($tva->fk_bank); $result=$accountline->fetch($tva->fk_bank);
$result=$accountline->delete($user); if ($result > 0) $result=$accountline->delete($user); // $result may be 0 if not found (when bank entry was deleted manually and fk_bank point to nothing)
} }
if ($result > 0) if ($result >= 0)
{ {
$db->commit(); $db->commit();
header("Location: ".DOL_URL_ROOT.'/compta/tva/reglement.php'); header("Location: ".DOL_URL_ROOT.'/compta/tva/reglement.php');

View File

@ -29,9 +29,10 @@ require_once DOL_DOCUMENT_ROOT.'/compta/tva/class/tva.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
$langs->load("other"); $langs->load("other");
$langs->load("compta");
$year=$_GET["year"]; $year=GETPOST("year","int");
if ($year == 0 ) if ($year == 0)
{ {
$year_current = strftime("%Y",time()); $year_current = strftime("%Y",time());
$year_start = $year_current; $year_start = $year_current;
@ -51,7 +52,14 @@ $modetax = $conf->global->TAX_MODE;
if (isset($_GET["modetax"])) $modetax=$_GET["modetax"]; if (isset($_GET["modetax"])) $modetax=$_GET["modetax"];
/**
* pt
*
* @param DoliDB $db Database handler
* @param string $sql SQL Request
* @param date $date Date
* @return void
*/
function pt ($db, $sql, $date) function pt ($db, $sql, $date)
{ {
global $conf, $bc,$langs; global $conf, $bc,$langs;

View File

@ -951,37 +951,35 @@ class Contact extends CommonObject
if ($mode == 0) if ($mode == 0)
{ {
if ($statut==0) return $langs->trans('Disabled'); if ($statut==0 || $statut==5) return $langs->trans('Disabled');
elseif ($statut==1) return $langs->trans('Enabled'); elseif ($statut==1 || $statut==4) return $langs->trans('Enabled');
} }
elseif ($mode == 1) elseif ($mode == 1)
{ {
if ($statut==0) return $langs->trans('Disabled'); if ($statut==0 || $statut==5) return $langs->trans('Disabled');
elseif ($statut==1) return $langs->trans('Enabled'); elseif ($statut==1 || $statut==4) return $langs->trans('Enabled');
} }
elseif ($mode == 2) elseif ($mode == 2)
{ {
if ($statut==0) return img_picto($langs->trans('Disabled'),'statut5').' '.$langs->trans('Disabled'); if ($statut==0 || $statut==5) return img_picto($langs->trans('Disabled'),'statut5').' '.$langs->trans('Disabled');
elseif ($statut==1) return img_picto($langs->trans('Enabled'),'statut4').' '.$langs->trans('Enabled'); elseif ($statut==1 || $statut==4) return img_picto($langs->trans('Enabled'),'statut4').' '.$langs->trans('Enabled');
} }
elseif ($mode == 3) elseif ($mode == 3)
{ {
if ($statut==0) return img_picto($langs->trans('Disabled'),'statut5'); if ($statut==0 || $statut==5) return img_picto($langs->trans('Disabled'),'statut5');
elseif ($statut==1) return img_picto($langs->trans('Enabled'),'statut4'); elseif ($statut==1 || $statut==4) return img_picto($langs->trans('Enabled'),'statut4');
} }
elseif ($mode == 4) elseif ($mode == 4)
{ {
if ($statut==0) return img_picto($langs->trans('Disabled'),'statut5').' '.$langs->trans('StatusContactDraft'); if ($statut==0) return img_picto($langs->trans('Disabled'),'statut5').' '.$langs->trans('StatusContactDraft');
elseif ($statut==1) return img_picto($langs->trans('Enabled'),'statut4').' '.$langs->trans('Enabled'); elseif ($statut==1 || $statut==4) return img_picto($langs->trans('Enabled'),'statut4').' '.$langs->trans('Enabled');
} }
elseif ($mode == 5) elseif ($mode == 5)
{ {
if ($statut==0) return '<span class="hideonsmartphone">'.$langs->trans('Disabled').' </span>'.img_picto($langs->trans('Disabled'),'statut5'); if ($statut==0 || $statut==5) return '<span class="hideonsmartphone">'.$langs->trans('Disabled').' </span>'.img_picto($langs->trans('Disabled'),'statut5');
elseif ($statut==1) return '<span class="hideonsmartphone">'.$langs->trans('Enabled').' </span>'.img_picto($langs->trans('Enabled'),'statut4'); elseif ($statut==1 || $statut==4) return '<span class="hideonsmartphone">'.$langs->trans('Enabled').' </span>'.img_picto($langs->trans('Enabled'),'statut4');
} }
} }

View File

@ -432,14 +432,14 @@ else
if ($socid > 0) if ($socid > 0)
{ {
print '<tr><td>'.$langs->trans("Company").'</td>'; print '<tr><td>'.$langs->trans("Company").'</td>';
print '<td colspan="3">'; print '<td colspan="3" class="maxwidthonsmartphone">';
print $objsoc->getNomUrl(1); print $objsoc->getNomUrl(1);
print '</td>'; print '</td>';
print '<input type="hidden" name="socid" value="'.$objsoc->id.'">'; print '<input type="hidden" name="socid" value="'.$objsoc->id.'">';
print '</td></tr>'; print '</td></tr>';
} }
else { else {
print '<tr><td>'.$langs->trans("Company").'</td><td colspan="3">'; print '<tr><td>'.$langs->trans("Company").'</td><td colspan="3" class="maxwidthonsmartphone">';
print $form->select_company($socid,'socid','',1); print $form->select_company($socid,'socid','',1);
print '</td></tr>'; print '</td></tr>';
} }
@ -474,13 +474,13 @@ else
// Zip / Town // Zip / Town
if (($objsoc->typent_code == 'TE_PRIVATE' || ! empty($conf->global->CONTACT_USE_COMPANY_ADDRESS)) && dol_strlen(trim($object->zip)) == 0) $object->zip = $objsoc->zip; // Predefined with third party if (($objsoc->typent_code == 'TE_PRIVATE' || ! empty($conf->global->CONTACT_USE_COMPANY_ADDRESS)) && dol_strlen(trim($object->zip)) == 0) $object->zip = $objsoc->zip; // Predefined with third party
if (($objsoc->typent_code == 'TE_PRIVATE' || ! empty($conf->global->CONTACT_USE_COMPANY_ADDRESS)) && dol_strlen(trim($object->town)) == 0) $object->town = $objsoc->town; // Predefined with third party if (($objsoc->typent_code == 'TE_PRIVATE' || ! empty($conf->global->CONTACT_USE_COMPANY_ADDRESS)) && dol_strlen(trim($object->town)) == 0) $object->town = $objsoc->town; // Predefined with third party
print '<tr><td>'.$langs->trans("Zip").' / '.$langs->trans("Town").'</td><td colspan="'.$colspan.'">'; print '<tr><td>'.$langs->trans("Zip").' / '.$langs->trans("Town").'</td><td colspan="'.$colspan.'" class="maxwidthonsmartphone">';
print $formcompany->select_ziptown((isset($_POST["zipcode"])?$_POST["zipcode"]:$object->zip),'zipcode',array('town','selectcountry_id','state_id'),6).'&nbsp;'; print $formcompany->select_ziptown((isset($_POST["zipcode"])?$_POST["zipcode"]:$object->zip),'zipcode',array('town','selectcountry_id','state_id'),6).'&nbsp;';
print $formcompany->select_ziptown((isset($_POST["town"])?$_POST["town"]:$object->town),'town',array('zipcode','selectcountry_id','state_id')); print $formcompany->select_ziptown((isset($_POST["town"])?$_POST["town"]:$object->town),'town',array('zipcode','selectcountry_id','state_id'));
print '</td></tr>'; print '</td></tr>';
// Country // Country
print '<tr><td>'.$langs->trans("Country").'</td><td colspan="'.$colspan.'">'; print '<tr><td>'.$langs->trans("Country").'</td><td colspan="'.$colspan.'" class="maxwidthonsmartphone">';
print $form->select_country((isset($_POST["country_id"])?$_POST["country_id"]:$object->country_id),'country_id'); print $form->select_country((isset($_POST["country_id"])?$_POST["country_id"]:$object->country_id),'country_id');
if ($user->admin) print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionnarySetup"),1); if ($user->admin) print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionnarySetup"),1);
print '</td></tr>'; print '</td></tr>';
@ -488,7 +488,7 @@ else
// State // State
if (empty($conf->global->SOCIETE_DISABLE_STATE)) if (empty($conf->global->SOCIETE_DISABLE_STATE))
{ {
print '<tr><td>'.$langs->trans('State').'</td><td colspan="'.$colspan.'">'; print '<tr><td>'.$langs->trans('State').'</td><td colspan="'.$colspan.'" class="maxwidthonsmartphone">';
if ($object->country_id) if ($object->country_id)
{ {
print $formcompany->select_state(isset($_POST["state_id"])?$_POST["state_id"]:$object->state_id,$object->country_code,'state_id'); print $formcompany->select_state(isset($_POST["state_id"])?$_POST["state_id"]:$object->state_id,$object->country_code,'state_id');
@ -655,7 +655,7 @@ else
if (empty($conf->global->SOCIETE_DISABLE_CONTACTS)) if (empty($conf->global->SOCIETE_DISABLE_CONTACTS))
{ {
print '<tr><td>'.$langs->trans("Company").'</td>'; print '<tr><td>'.$langs->trans("Company").'</td>';
print '<td colspan="3">'; print '<td colspan="3" class="maxwidthonsmartphone">';
print $form->select_company(GETPOST('socid','int')?GETPOST('socid','int'):($object->socid?$object->socid:-1),'socid','',1); print $form->select_company(GETPOST('socid','int')?GETPOST('socid','int'):($object->socid?$object->socid:-1),'socid','',1);
print '</td>'; print '</td>';
print '</tr>'; print '</tr>';
@ -680,13 +680,13 @@ else
print '</td></tr>'; print '</td></tr>';
// Zip / Town // Zip / Town
print '<tr><td>'.$langs->trans("Zip").' / '.$langs->trans("Town").'</td><td colspan="2">'; print '<tr><td>'.$langs->trans("Zip").' / '.$langs->trans("Town").'</td><td colspan="2" class="maxwidthonsmartphone">';
print $formcompany->select_ziptown((isset($_POST["zipcode"])?$_POST["zipcode"]:$object->zip),'zipcode',array('town','selectcountry_id','state_id'),6).'&nbsp;'; print $formcompany->select_ziptown((isset($_POST["zipcode"])?$_POST["zipcode"]:$object->zip),'zipcode',array('town','selectcountry_id','state_id'),6).'&nbsp;';
print $formcompany->select_ziptown((isset($_POST["town"])?$_POST["town"]:$object->town),'town',array('zipcode','selectcountry_id','state_id')); print $formcompany->select_ziptown((isset($_POST["town"])?$_POST["town"]:$object->town),'town',array('zipcode','selectcountry_id','state_id'));
print '</td></tr>'; print '</td></tr>';
// Country // Country
print '<tr><td>'.$langs->trans("Country").'</td><td colspan="2">'; print '<tr><td>'.$langs->trans("Country").'</td><td colspan="2" class="maxwidthonsmartphone">';
print $form->select_country(isset($_POST["country_id"])?$_POST["country_id"]:$object->country_id,'country_id'); print $form->select_country(isset($_POST["country_id"])?$_POST["country_id"]:$object->country_id,'country_id');
if ($user->admin) print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionnarySetup"),1); if ($user->admin) print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionnarySetup"),1);
print '</td></tr>'; print '</td></tr>';
@ -694,7 +694,7 @@ else
// State // State
if (empty($conf->global->SOCIETE_DISABLE_STATE)) if (empty($conf->global->SOCIETE_DISABLE_STATE))
{ {
print '<tr><td>'.$langs->trans('State').'</td><td colspan="2">'; print '<tr><td>'.$langs->trans('State').'</td><td colspan="2" class="maxwidthonsmartphone">';
print $formcompany->select_state($object->state_id,isset($_POST["country_id"])?$_POST["country_id"]:$object->country_id,'state_id'); print $formcompany->select_state($object->state_id,isset($_POST["country_id"])?$_POST["country_id"]:$object->country_id,'state_id');
print '</td></tr>'; print '</td></tr>';
} }

View File

@ -259,6 +259,12 @@ class Interfaces
$modName = $modules[$key]; $modName = $modules[$key];
if (empty($modName)) continue; if (empty($modName)) continue;
if (! class_exists($modName))
{
print 'Error: A trigger file was found but its class "'.$modName.'" was not found.'."<br>\n";
continue;
}
$objMod = new $modName($this->db); $objMod = new $modName($this->db);
// Define disabledbyname and disabledbymodule // Define disabledbyname and disabledbymodule

View File

@ -99,7 +99,7 @@ function checkBanForAccount($account)
if (empty($account->number)) $account->number=$account->num_compte; if (empty($account->number)) $account->number=$account->num_compte;
if (empty($account->cle)) $account->cle=$account->cle_rib; if (empty($account->cle)) $account->cle=$account->cle_rib;
dol_syslog("Bank.lib::checkBanForAccount account->code_banque=".$account->code_banque." account->code_guichet=".$account->code_guichet." account->number=".$account->number." account->cle=".$account->cle." account->iban=".$account->iban." country_code=".$country_code, LOG_DEBUG); dol_syslog("bank.lib::checkBanForAccount account->code_banque=".$account->code_banque." account->code_guichet=".$account->code_guichet." account->number=".$account->number." account->cle=".$account->cle." account->iban=".$account->iban." country_code=".$country_code, LOG_DEBUG);
if ($country_code == 'FR') // France rules if ($country_code == 'FR') // France rules
{ {

View File

@ -957,7 +957,17 @@ function pdf_getlinedesc($object,$i,$outputlangs,$hideref=0,$hidedesc=0,$issuppl
if (! empty($conf->global->MAIN_MULTILANGS) && ($outputlangs->defaultlang != $langs->defaultlang)) if (! empty($conf->global->MAIN_MULTILANGS) && ($outputlangs->defaultlang != $langs->defaultlang))
{ {
if (! empty($prodser->multilangs[$outputlangs->defaultlang]["label"]) && $label == $prodser->label) $label=$prodser->multilangs[$outputlangs->defaultlang]["label"]; if (! empty($prodser->multilangs[$outputlangs->defaultlang]["label"]) && $label == $prodser->label) $label=$prodser->multilangs[$outputlangs->defaultlang]["label"];
if (! empty($prodser->multilangs[$outputlangs->defaultlang]["description"]) && $desc == $prodser->description) $desc=$prodser->multilangs[$outputlangs->defaultlang]["description"];
//Manage HTML entities description test
//Cause $prodser->description is store with htmlentities but $desc no
$needdesctranslation=false;
if (!empty($desc) && dol_textishtml($desc) && !empty($prodser->description) && dol_textishtml($prodser->description)) {
$needdesctranslation=(strpos(dol_html_entity_decode($desc,ENT_QUOTES | ENT_HTML401),dol_html_entity_decode($prodser->description,ENT_QUOTES | ENT_HTML401))!==false);
} else {
$needdesctranslation=($desc == $prodser->description);
}
if (! empty($prodser->multilangs[$outputlangs->defaultlang]["description"]) && ($needdesctranslation)) $desc=$prodser->multilangs[$outputlangs->defaultlang]["description"];
if (! empty($prodser->multilangs[$outputlangs->defaultlang]["note"]) && $note == $prodser->note) $note=$prodser->multilangs[$outputlangs->defaultlang]["note"]; if (! empty($prodser->multilangs[$outputlangs->defaultlang]["note"]) && $note == $prodser->note) $note=$prodser->multilangs[$outputlangs->defaultlang]["note"];
} }
} }

View File

@ -288,7 +288,7 @@ function show_theme($fuser,$edit=0,$foruserprofile=false)
$var=!$var; $var=!$var;
print '<tr '.$bc[$var].'><td colspan="'.$colspan.'">'; print '<tr '.$bc[$var].'><td colspan="'.$colspan.'">';
print '<table class="nobordernopadding" width="100%">'; print '<table class="nobordernopadding" width="100%"><tr><td><div align="center">';
$i=0; $i=0;
foreach($dirthemes as $dir) foreach($dirthemes as $dir)
@ -310,22 +310,15 @@ function show_theme($fuser,$edit=0,$foruserprofile=false)
// Disable not stable themes // Disable not stable themes
//if ($conf->global->MAIN_FEATURES_LEVEL < 1 && preg_match('/bureau2crea/i',$subdir)) continue; //if ($conf->global->MAIN_FEATURES_LEVEL < 1 && preg_match('/bureau2crea/i',$subdir)) continue;
if ($i % $thumbsbyrow == 0) print '<div class="inline-block" style="margin-top: 10px; margin-bottom: 10px; margin-right: 20px; margin-left: 20px;">';
{
print '<tr '.$bc[$var].'>';
}
print '<td align="center">';
$file=$dirtheme."/".$subdir."/thumb.png"; $file=$dirtheme."/".$subdir."/thumb.png";
$url=$urltheme."/".$subdir."/thumb.png"; $url=$urltheme."/".$subdir."/thumb.png";
if (! file_exists($file)) $url=$urltheme."/common/nophoto.jpg"; if (! file_exists($file)) $url=$urltheme."/common/nophoto.jpg";
print '<table><tr><td>';
print '<a href="'.$_SERVER["PHP_SELF"].($edit?'?action=edit&theme=':'?theme=').$subdir.(GETPOST("optioncss")?'&optioncss='.GETPOST("optioncss",'alpha',1):'').($fuser?'&id='.$fuser->id:'').'" style="font-weight: normal;" alt="'.$langs->trans("Preview").'">'; print '<a href="'.$_SERVER["PHP_SELF"].($edit?'?action=edit&theme=':'?theme=').$subdir.(GETPOST("optioncss")?'&optioncss='.GETPOST("optioncss",'alpha',1):'').($fuser?'&id='.$fuser->id:'').'" style="font-weight: normal;" alt="'.$langs->trans("Preview").'">';
if ($subdir == $conf->global->MAIN_THEME) $title=$langs->trans("ThemeCurrentlyActive"); if ($subdir == $conf->global->MAIN_THEME) $title=$langs->trans("ThemeCurrentlyActive");
else $title=$langs->trans("ShowPreview"); else $title=$langs->trans("ShowPreview");
print '<img src="'.$url.'" border="0" width="80" height="60" alt="'.$title.'" title="'.$title.'">'; print '<img src="'.$url.'" border="0" width="80" height="60" alt="'.$title.'" title="'.$title.'" style="margin-bottom: 5px;">';
print '</a>'; print '</a><br>';
print '</td></tr><tr><td align="center">';
if ($subdir == $selected_theme) if ($subdir == $selected_theme)
{ {
print '<input '.($edit?'':'disabled').' type="radio" '.$bc[$var].' style="border: 0px;" checked name="main_theme" value="'.$subdir.'"> <b>'.$subdir.'</b>'; print '<input '.($edit?'':'disabled').' type="radio" '.$bc[$var].' style="border: 0px;" checked name="main_theme" value="'.$subdir.'"> <b>'.$subdir.'</b>';
@ -334,27 +327,16 @@ function show_theme($fuser,$edit=0,$foruserprofile=false)
{ {
print '<input '.($edit?'':'disabled').' type="radio" '.$bc[$var].' style="border: 0px;" name="main_theme" value="'.$subdir.'"> '.$subdir; print '<input '.($edit?'':'disabled').' type="radio" '.$bc[$var].' style="border: 0px;" name="main_theme" value="'.$subdir.'"> '.$subdir;
} }
print '</td></tr></table></td>'; print '</div>';
$i++; $i++;
if ($i % $thumbsbyrow == 0) print '</tr>';
} }
} }
} }
} }
} }
if ($i % $thumbsbyrow != 0) print '</div></td></tr></table>';
{
while ($i % $thumbsbyrow != 0)
{
print '<td>&nbsp;</td>';
$i++;
}
print '</tr>';
}
print '</table>';
print '</td></tr>'; print '</td></tr>';
print '</table>'; print '</table>';

View File

@ -627,7 +627,7 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu
$newmenu->add("/contact/fiche.php?leftmenu=contacts&amp;action=create", (! empty($conf->global->SOCIETE_ADDRESSES_MANAGEMENT) ? $langs->trans("NewContact") : $langs->trans("NewContactAddress")), 1, $user->rights->societe->contact->creer); $newmenu->add("/contact/fiche.php?leftmenu=contacts&amp;action=create", (! empty($conf->global->SOCIETE_ADDRESSES_MANAGEMENT) ? $langs->trans("NewContact") : $langs->trans("NewContactAddress")), 1, $user->rights->societe->contact->creer);
$newmenu->add("/contact/list.php?leftmenu=contacts", $langs->trans("List"), 1, $user->rights->societe->contact->lire); $newmenu->add("/contact/list.php?leftmenu=contacts", $langs->trans("List"), 1, $user->rights->societe->contact->lire);
if (empty($conf->global->SOCIETE_DISABLE_PROSPECTS)) $newmenu->add("/contact/list.php?leftmenu=contacts&type=p", $langs->trans("Prospects"), 2, $user->rights->societe->contact->lire); if (empty($conf->global->SOCIETE_DISABLE_PROSPECTS)) $newmenu->add("/contact/list.php?leftmenu=contacts&type=p", $langs->trans("Prospects"), 2, $user->rights->societe->contact->lire);
$newmenu->add("/contact/list.php?leftmenu=contacts&type=c", $langs->trans("Customers"), 2, $user->rights->societe->contact->lire); if (empty($conf->global->SOCIETE_DISABLE_CUSTOMERS)) $newmenu->add("/contact/list.php?leftmenu=contacts&type=c", $langs->trans("Customers"), 2, $user->rights->societe->contact->lire);
if (! empty($conf->fournisseur->enabled)) $newmenu->add("/contact/list.php?leftmenu=contacts&type=f", $langs->trans("Suppliers"), 2, $user->rights->societe->contact->lire); if (! empty($conf->fournisseur->enabled)) $newmenu->add("/contact/list.php?leftmenu=contacts&type=f", $langs->trans("Suppliers"), 2, $user->rights->societe->contact->lire);
$newmenu->add("/contact/list.php?leftmenu=contacts&type=o", $langs->trans("Others"), 2, $user->rights->societe->contact->lire); $newmenu->add("/contact/list.php?leftmenu=contacts&type=o", $langs->trans("Others"), 2, $user->rights->societe->contact->lire);
//$newmenu->add("/contact/list.php?userid=$user->id", $langs->trans("MyContacts"), 1, $user->rights->societe->contact->lire); //$newmenu->add("/contact/list.php?userid=$user->id", $langs->trans("MyContacts"), 1, $user->rights->societe->contact->lire);
@ -636,11 +636,14 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu
if (! empty($conf->categorie->enabled)) if (! empty($conf->categorie->enabled))
{ {
$langs->load("categories"); $langs->load("categories");
// Categories prospects/customers if (empty($conf->global->SOCIETE_DISABLE_PROSPECTS) && empty($conf->global->SOCIETE_DISABLE_CUSTOMERS))
$newmenu->add("/categories/index.php?leftmenu=cat&amp;type=2", $langs->trans("CustomersProspectsCategoriesShort"), 0, $user->rights->categorie->lire, '', $mainmenu, 'cat');
if (empty($user->societe_id))
{ {
$newmenu->add("/categories/fiche.php?action=create&amp;type=2", $langs->trans("NewCategory"), 1, $user->rights->categorie->creer); // Categories prospects/customers
$newmenu->add("/categories/index.php?leftmenu=cat&amp;type=2", $langs->trans("CustomersProspectsCategoriesShort"), 0, $user->rights->categorie->lire, '', $mainmenu, 'cat');
if (empty($user->societe_id))
{
$newmenu->add("/categories/fiche.php?action=create&amp;type=2", $langs->trans("NewCategory"), 1, $user->rights->categorie->creer);
}
} }
// Categories Contact // Categories Contact
$newmenu->add("/categories/index.php?leftmenu=cat&amp;type=4", $langs->trans("ContactCategoriesShort"), 0, $user->rights->categorie->lire, '', $mainmenu, 'cat'); $newmenu->add("/categories/index.php?leftmenu=cat&amp;type=4", $langs->trans("ContactCategoriesShort"), 0, $user->rights->categorie->lire, '', $mainmenu, 'cat');

View File

@ -178,10 +178,10 @@ class modFacture extends DolibarrModules
$this->export_label[$r]='CustomersInvoicesAndInvoiceLines'; // Translation key (used only if key ExportDataset_xxx_z not found) $this->export_label[$r]='CustomersInvoicesAndInvoiceLines'; // Translation key (used only if key ExportDataset_xxx_z not found)
$this->export_icon[$r]='bill'; $this->export_icon[$r]='bill';
$this->export_permission[$r]=array(array("facture","facture","export")); $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_private'=>"NotePrivate",'f.note_public'=>"NotePublic",'fd.rowid'=>'LineId','fd.label'=>"Label",'fd.description'=>"LineDescription",'fd.price'=>"LineUnitPrice",'fd.tva_tx'=>"LineVATRate",'fd.qty'=>"LineQty",'fd.total_ht'=>"LineTotalHT",'fd.total_tva'=>"LineTotalVAT",'fd.total_ttc'=>"LineTotalTTC",'fd.date_start'=>"DateStart",'fd.date_end'=>"DateEnd",'fd.product_type'=>"TypeOfLineServiceOrProduct",'fd.fk_product'=>'ProductId','p.ref'=>'ProductRef','p.label'=>'ProductLabel','p.accountancy_code_sell'=>'ProductAccountancyBuyCode'); $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",'fd.rowid'=>'LineId','fd.label'=>"Label",'fd.description'=>"LineDescription",'fd.price'=>"LineUnitPrice",'fd.tva_tx'=>"LineVATRate",'fd.qty'=>"LineQty",'fd.total_ht'=>"LineTotalHT",'fd.total_tva'=>"LineTotalVAT",'fd.total_ttc'=>"LineTotalTTC",'fd.date_start'=>"DateStart",'fd.date_end'=>"DateEnd",'fd.special_code'=>'SpecialCode','fd.product_type'=>"TypeOfLineServiceOrProduct",'fd.fk_product'=>'ProductId','p.ref'=>'ProductRef','p.label'=>'ProductLabel','p.accountancy_code_sell'=>'ProductAccountancyBuyCode');
//$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.facnumber'=>"Text",'f.datec'=>"Date",'f.datef'=>"Date",'f.date_lim_reglement'=>"Date",'f.total'=>"Numeric",'f.total_ttc'=>"Numeric",'f.tva'=>"Numeric",'f.paye'=>"Boolean",'f.fk_statut'=>'Status','f.note_private'=>"Text",'f.note_public'=>"Text",'fd.description'=>"Text",'fd.price'=>"Numeric",'fd.tva_tx'=>"Numeric",'fd.qty'=>"Numeric",'fd.total_ht'=>"Numeric",'fd.total_tva'=>"Numeric",'fd.total_ttc'=>"Numeric",'fd.date_start'=>"Date",'fd.date_end'=>"Date",'fd.product_type'=>"Numeric",'fd.fk_product'=>'List:Product:label','p.ref'=>'Text','p.label'=>'Text'); //$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.facnumber'=>"Text",'f.datec'=>"Date",'f.datef'=>"Date",'f.date_lim_reglement'=>"Date",'f.total'=>"Numeric",'f.total_ttc'=>"Numeric",'f.tva'=>"Numeric",'f.paye'=>"Boolean",'f.fk_statut'=>'Status','f.note_private'=>"Text",'f.note_public'=>"Text",'fd.description'=>"Text",'fd.price'=>"Numeric",'fd.tva_tx'=>"Numeric",'fd.qty'=>"Numeric",'fd.total_ht'=>"Numeric",'fd.total_tva'=>"Numeric",'fd.total_ttc'=>"Numeric",'fd.date_start'=>"Date",'fd.date_end'=>"Date",'fd.product_type'=>"Numeric",'fd.fk_product'=>'List:Product:label','p.ref'=>'Text','p.label'=>'Text');
$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.facnumber'=>"Text",'f.datec'=>"Date",'f.datef'=>"Date",'f.date_lim_reglement'=>"Date",'f.total'=>"Numeric",'f.total_ttc'=>"Numeric",'f.tva'=>"Numeric",'f.paye'=>"Boolean",'f.fk_statut'=>'Status','f.note_private'=>"Text",'f.note_public'=>"Text",'fd.description'=>"Text",'fd.price'=>"Numeric",'fd.tva_tx'=>"Numeric",'fd.qty'=>"Numeric",'fd.total_ht'=>"Numeric",'fd.total_tva'=>"Numeric",'fd.total_ttc'=>"Numeric",'fd.date_start'=>"Date",'fd.date_end'=>"Date",'fd.product_type'=>"Numeric",'fd.fk_product'=>'List:Product:label','p.ref'=>'Text','p.label'=>'Text','p.accountancy_code_sell'=>'Text'); $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.facnumber'=>"Text",'f.datec'=>"Date",'f.datef'=>"Date",'f.date_lim_reglement'=>"Date",'f.total'=>"Numeric",'f.total_ttc'=>"Numeric",'f.tva'=>"Numeric",'f.paye'=>"Boolean",'f.fk_statut'=>'Status','f.note_private'=>"Text",'f.note_public'=>"Text",'fd.description'=>"Text",'fd.price'=>"Numeric",'fd.tva_tx'=>"Numeric",'fd.qty'=>"Numeric",'fd.total_ht'=>"Numeric",'fd.total_tva'=>"Numeric",'fd.total_ttc'=>"Numeric",'fd.date_start'=>"Date",'fd.date_end'=>"Date",'fd.special_code'=>'Numeric','fd.product_type'=>"Numeric",'fd.fk_product'=>'List:Product:label','p.ref'=>'Text','p.label'=>'Text','p.accountancy_code_sell'=>'Text');
$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",'fd.rowid'=>'invoice_line','fd.label'=>"invoice_line",'fd.description'=>"invoice_line",'fd.price'=>"invoice_line",'fd.total_ht'=>"invoice_line",'fd.total_tva'=>"invoice_line",'fd.total_ttc'=>"invoice_line",'fd.tva_tx'=>"invoice_line",'fd.qty'=>"invoice_line",'fd.date_start'=>"invoice_line",'fd.date_end'=>"invoice_line",'fd.product_type'=>'invoice_line','fd.fk_product'=>'product','p.ref'=>'product','p.label'=>'product','p.accountancy_code_sell'=>'product'); $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",'fd.rowid'=>'invoice_line','fd.label'=>"invoice_line",'fd.description'=>"invoice_line",'fd.price'=>"invoice_line",'fd.total_ht'=>"invoice_line",'fd.total_tva'=>"invoice_line",'fd.total_ttc'=>"invoice_line",'fd.tva_tx'=>"invoice_line",'fd.qty'=>"invoice_line",'fd.date_start'=>"invoice_line",'fd.date_end'=>"invoice_line",'fd.special_code'=>'invoice_line','fd.product_type'=>'invoice_line','fd.fk_product'=>'product','p.ref'=>'product','p.label'=>'product','p.accountancy_code_sell'=>'product');
$this->export_dependencies_array[$r]=array('invoice_line'=>'fd.rowid','product'=>'fd.rowid'); // To add unique key if we ask a field of a child to avoid the DISTINCT to discard them $this->export_dependencies_array[$r]=array('invoice_line'=>'fd.rowid','product'=>'fd.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 '; $this->export_sql_start[$r]='SELECT DISTINCT ';

View File

@ -47,77 +47,77 @@ $userstatic=new User($db);
<div class="tagtable centpercent noborder allwidth"> <div class="tagtable centpercent noborder allwidth">
<?php if ($permission) { ?> <?php if ($permission) { ?>
<form class="liste_titre"> <form class="tagtr liste_titre">
<div><?php echo $langs->trans("Source"); ?></div> <div class="tagtd"><?php echo $langs->trans("Source"); ?></div>
<div><?php echo $langs->trans("Company"); ?></div> <div class="tagtd"><?php echo $langs->trans("Company"); ?></div>
<div><?php echo $langs->trans("Contacts"); ?></div> <div class="tagtd"><?php echo $langs->trans("Contacts"); ?></div>
<div><?php echo $langs->trans("ContactType"); ?></div> <div class="tagtd"><?php echo $langs->trans("ContactType"); ?></div>
<div>&nbsp;</div> <div class="tagtd">&nbsp;</div>
<div>&nbsp;</div> <div class="tagtd">&nbsp;</div>
</form> </form>
<?php $var=false; ?> <?php $var=false; ?>
<form <?php echo $bc[$var]; ?> action="<?php echo $_SERVER["PHP_SELF"].'?id='.$object->id; ?>" method="POST"> <form class="tagtr impair" action="<?php echo $_SERVER["PHP_SELF"].'?id='.$object->id; ?>" method="POST">
<input type="hidden" name="token" value="<?php echo $_SESSION['newtoken']; ?>" /> <input type="hidden" name="token" value="<?php echo $_SESSION['newtoken']; ?>" />
<input type="hidden" name="id" value="<?php echo $object->id; ?>" /> <input type="hidden" name="id" value="<?php echo $object->id; ?>" />
<input type="hidden" name="action" value="addcontact" /> <input type="hidden" name="action" value="addcontact" />
<input type="hidden" name="source" value="internal" /> <input type="hidden" name="source" value="internal" />
<div class="nowrap"><?php echo img_object('','user').' '.$langs->trans("Users"); ?></div> <div class="nowrap tagtd"><?php echo img_object('','user').' '.$langs->trans("Users"); ?></div>
<div><?php echo $conf->global->MAIN_INFO_SOCIETE_NOM; ?></div> <div class="tagtd"><?php echo $conf->global->MAIN_INFO_SOCIETE_NOM; ?></div>
<div><?php echo $form->select_dolusers($user->id, 'userid', 0, (! empty($userAlreadySelected)?$userAlreadySelected:null), 0, null, null, 0, 56); ?></div> <div class="tagtd maxwidthonsmartphone"><?php echo $form->select_dolusers($user->id, 'userid', 0, (! empty($userAlreadySelected)?$userAlreadySelected:null), 0, null, null, 0, 56); ?></div>
<div><?php echo $formcompany->selectTypeContact($object, '', 'type','internal'); ?></div> <div class="tagtd maxwidthonsmartphone"><?php echo $formcompany->selectTypeContact($object, '', 'type','internal'); ?></div>
<div>&nbsp;</div> <div class="tagtd">&nbsp;</div>
<div align="right"><input type="submit" class="button" value="<?php echo $langs->trans("Add"); ?>"></div> <div class="tagtd" align="right"><input type="submit" class="button" value="<?php echo $langs->trans("Add"); ?>"></div>
</form> </form>
<?php $var=!$var; ?> <?php $var=!$var; ?>
<form <?php echo $bc[$var]; ?> action="<?php echo $_SERVER["PHP_SELF"].'?id='.$object->id; ?>" method="POST"> <form class="tagtr pair" action="<?php echo $_SERVER["PHP_SELF"].'?id='.$object->id; ?>" method="POST">
<input type="hidden" name="token" value="<?php echo $_SESSION['newtoken']; ?>" /> <input type="hidden" name="token" value="<?php echo $_SESSION['newtoken']; ?>" />
<input type="hidden" name="id" value="<?php echo $object->id; ?>" /> <input type="hidden" name="id" value="<?php echo $object->id; ?>" />
<input type="hidden" name="action" value="addcontact" /> <input type="hidden" name="action" value="addcontact" />
<input type="hidden" name="source" value="external" /> <input type="hidden" name="source" value="external" />
<div class="nowrap"><?php echo img_object('','contact').' '.$langs->trans("ThirdPartyContacts"); ?></div> <div class="tagtd nowrap"><?php echo img_object('','contact').' '.$langs->trans("ThirdPartyContacts"); ?></div>
<?php if ($conf->use_javascript_ajax && ! empty($conf->global->COMPANY_USE_SEARCH_TO_SELECT)) { ?> <?php if ($conf->use_javascript_ajax && ! empty($conf->global->COMPANY_USE_SEARCH_TO_SELECT)) { ?>
<div class="nowrap"> <div class="tagtd nowrap maxwidthonsmartphone">
<?php <?php
$events=array(); $events=array();
$events[]=array('method' => 'getContacts', 'url' => dol_buildpath('/core/ajax/contacts.php',1), 'htmlname' => 'contactid', 'params' => array('add-customer-contact' => 'disabled')); $events[]=array('method' => 'getContacts', 'url' => dol_buildpath('/core/ajax/contacts.php',1), 'htmlname' => 'contactid', 'params' => array('add-customer-contact' => 'disabled'));
print $form->select_company($object->socid,'socid','',1,0,0,$events); print $form->select_company($object->socid,'socid','',1,0,0,$events);
?> ?>
</div> </div>
<div> <div class="tagtd maxwidthonsmartphone">
<?php $nbofcontacts=$form->select_contacts($object->socid, '', 'contactid'); ?> <?php $nbofcontacts=$form->select_contacts($object->socid, '', 'contactid'); ?>
</div> </div>
<?php } else { ?> <?php } else { ?>
<div> <div class="tagtd maxwidthonsmartphone">
<?php $selectedCompany = isset($_GET["newcompany"])?$_GET["newcompany"]:$object->socid; ?> <?php $selectedCompany = isset($_GET["newcompany"])?$_GET["newcompany"]:$object->socid; ?>
<?php $selectedCompany = $formcompany->selectCompaniesForNewContact($object, 'id', $selectedCompany, 'newcompany'); ?> <?php $selectedCompany = $formcompany->selectCompaniesForNewContact($object, 'id', $selectedCompany, 'newcompany'); ?>
</div> </div>
<div> <div class="tagtd maxwidthonsmartphone">
<?php $nbofcontacts=$form->select_contacts($selectedCompany, '', 'contactid'); ?> <?php $nbofcontacts=$form->select_contacts($selectedCompany, '', 'contactid'); ?>
</div> </div>
<?php } ?> <?php } ?>
<div> <div class="tagtd maxwidthonsmartphone">
<?php $formcompany->selectTypeContact($object, '', 'type','external'); ?> <?php $formcompany->selectTypeContact($object, '', 'type','external'); ?>
</div> </div>
<div>&nbsp;</div> <div class="tagtd">&nbsp;</div>
<div align="right"> <div class="tagtd" align="right">
<input type="submit" id="add-customer-contact" class="button" value="<?php echo $langs->trans("Add"); ?>"<?php if (! $nbofcontacts) echo ' disabled="disabled"'; ?>> <input type="submit" id="add-customer-contact" class="button" value="<?php echo $langs->trans("Add"); ?>"<?php if (! $nbofcontacts) echo ' disabled="disabled"'; ?>>
</div> </div>
</form> </form>
<?php } ?> <?php } ?>
<form class="liste_titre"> <form class="tagtr liste_titre">
<div><?php echo $langs->trans("Source"); ?></div> <div class="tagtd"><?php echo $langs->trans("Source"); ?></div>
<div><?php echo $langs->trans("Company"); ?></div> <div class="tagtd"><?php echo $langs->trans("Company"); ?></div>
<div><?php echo $langs->trans("Contacts"); ?></div> <div class="tagtd"><?php echo $langs->trans("Contacts"); ?></div>
<div><?php echo $langs->trans("ContactType"); ?></div> <div class="tagtd"><?php echo $langs->trans("ContactType"); ?></div>
<div align="center"><?php echo $langs->trans("Status"); ?></div> <div class="tagtd" align="center"><?php echo $langs->trans("Status"); ?></div>
<div>&nbsp;</div> <div class="tagtd">&nbsp;</div>
</form> </form>
<?php $var=true; ?> <?php $var=true; ?>
@ -132,12 +132,12 @@ $userstatic=new User($db);
$var = !$var; $var = !$var;
?> ?>
<form <?php echo $bc[$var]; ?>> <form class="tagtr <?php echo $var?"pair":"impair"; ?>">
<div align="left"> <div class="tagtd" align="left">
<?php if ($tab[$i]['source']=='internal') echo $langs->trans("User"); ?> <?php if ($tab[$i]['source']=='internal') echo $langs->trans("User"); ?>
<?php if ($tab[$i]['source']=='external') echo $langs->trans("ThirdPartyContact"); ?> <?php if ($tab[$i]['source']=='external') echo $langs->trans("ThirdPartyContact"); ?>
</div> </div>
<div align="left"> <div class="tagtd" align="left">
<?php <?php
if ($tab[$i]['socid'] > 0) if ($tab[$i]['socid'] > 0)
{ {
@ -154,7 +154,7 @@ $userstatic=new User($db);
} }
?> ?>
</div> </div>
<div> <div class="tagtd">
<?php <?php
if ($tab[$i]['source']=='internal') if ($tab[$i]['source']=='internal')
{ {
@ -172,13 +172,28 @@ $userstatic=new User($db);
} }
?> ?>
</div> </div>
<div><?php echo $tab[$i]['libelle']; ?></div> <div class="tagtd"><?php echo $tab[$i]['libelle']; ?></div>
<div align="center"> <div class="tagtd" align="center">
<?php if ($object->statut >= 0) echo '<a href="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'&amp;action=swapstatut&amp;ligne='.$tab[$i]['rowid'].'">'; ?> <?php if ($object->statut >= 0) echo '<a href="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'&amp;action=swapstatut&amp;ligne='.$tab[$i]['rowid'].'">'; ?>
<?php echo $contactstatic->LibStatut($tab[$i]['status'],3); ?> <?php
if ($tab[$i]['source']=='internal')
{
$userstatic->id=$tab[$i]['id'];
$userstatic->lastname=$tab[$i]['lastname'];
$userstatic->firstname=$tab[$i]['firstname'];
//echo $userstatic->LibStatut($tab[$i]['status'],3);
}
if ($tab[$i]['source']=='external')
{
$contactstatic->id=$tab[$i]['id'];
$contactstatic->lastname=$tab[$i]['lastname'];
$contactstatic->firstname=$tab[$i]['firstname'];
echo $contactstatic->LibStatut($tab[$i]['status'],3);
}
?>
<?php if ($object->statut >= 0) echo '</a>'; ?> <?php if ($object->statut >= 0) echo '</a>'; ?>
</div> </div>
<div align="center" class="nowrap"> <div class="tagtd nowrap" align="center">
<?php if ($permission) { ?> <?php if ($permission) { ?>
&nbsp;<a href="<?php echo $_SERVER["PHP_SELF"].'?id='.$object->id.'&amp;action=deletecontact&amp;lineid='.$tab[$i]['rowid']; ?>"><?php echo img_delete(); ?></a> &nbsp;<a href="<?php echo $_SERVER["PHP_SELF"].'?id='.$object->id.'&amp;action=deletecontact&amp;lineid='.$tab[$i]['rowid']; ?>"><?php echo img_delete(); ?></a>
<?php } ?> <?php } ?>

View File

@ -51,7 +51,9 @@ if (isset($action) && ! empty($action))
require DOL_DOCUMENT_ROOT . '/ecm/class/ecmdirectory.class.php'; require DOL_DOCUMENT_ROOT . '/ecm/class/ecmdirectory.class.php';
$ecmdirstatic = new EcmDirectory($db); $ecmdirstatic = new EcmDirectory($db);
$ecmdirtmp = new EcmDirectory($db);
// This part of code is same than into file index.php for action refreshmanual TODO Remove duplicate
clearstatcache(); clearstatcache();
$diroutputslash=str_replace('\\', '/', $conf->$element->dir_output); $diroutputslash=str_replace('\\', '/', $conf->$element->dir_output);
@ -129,7 +131,6 @@ if (isset($action) && ! empty($action))
if ($fk_parent >= 0) if ($fk_parent >= 0)
{ {
$ecmdirtmp=new EcmDirectory($db);
$ecmdirtmp->ref = 'NOTUSEDYET'; $ecmdirtmp->ref = 'NOTUSEDYET';
$ecmdirtmp->label = dol_basename($dirdesc['fullname']); $ecmdirtmp->label = dol_basename($dirdesc['fullname']);
$ecmdirtmp->description = ''; $ecmdirtmp->description = '';
@ -163,7 +164,21 @@ if (isset($action) && ! empty($action))
} }
} }
// Loop now on each sql tree to check if dir exists
foreach($sqltree as $dirdesc) // Loop on each sqltree to check dir is on disk
{
$dirtotest=$conf->$element->dir_output.'/'.$dirdesc['fullrelativename'];
if (! dol_is_dir($dirtotest))
{
$mesg.=$dirtotest." not found onto disk. We delete from database dir with id=".$dirdesc['id']."<br>\n";
$ecmdirtmp->id=$dirdesc['id'];
$ecmdirtmp->delete($user,'databaseonly');
//exit;
}
}
$sql="UPDATE ".MAIN_DB_PREFIX."ecm_directories set cachenbofdoc = -1 WHERE cachenbofdoc < 0"; // If pb into cahce counting, we set to value -1 = "unknown" $sql="UPDATE ".MAIN_DB_PREFIX."ecm_directories set cachenbofdoc = -1 WHERE cachenbofdoc < 0"; // If pb into cahce counting, we set to value -1 = "unknown"
dol_syslog("sql = ".$sql);
$db->query($sql); $db->query($sql);
} }
} }

View File

@ -325,21 +325,23 @@ class EcmDirectory // extends CommonObject
/** /**
* Delete object on database and on disk * Delete object on database and/or on disk
* *
* @param User $user User that delete * @param User $user User that delete
* @param int $mode 'all'=delete all, 'databaseonly'=only database entry, 'fileonly' (not implemented)
* @return int <0 if KO, >0 if OK * @return int <0 if KO, >0 if OK
*/ */
function delete($user) function delete($user, $mode='all')
{ {
global $conf, $langs; global $conf, $langs;
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
$error=0; $error=0;
$result=0;
$relativepath=$this->getRelativePath(1); // Ex: dir1/dir2/dir3 if ($mode != 'databaseonly') $relativepath=$this->getRelativePath(1); // Ex: dir1/dir2/dir3
dol_syslog(get_class($this)."::delete remove directory ".$relativepath); dol_syslog(get_class($this)."::delete remove directory id=".$this->id." mode=".$mode.(($mode == 'databaseonly')?'':' relativepath='.$relativepath));
$this->db->begin(); $this->db->begin();
@ -356,8 +358,11 @@ class EcmDirectory // extends CommonObject
return -2; return -2;
} }
$file = $conf->ecm->dir_output . "/" . $relativepath; if ($mode != 'databaseonly')
$result=@dol_delete_dir($file); {
$file = $conf->ecm->dir_output . "/" . $relativepath;
$result=@dol_delete_dir($file);
}
if ($result || ! @is_dir(dol_osencode($file))) if ($result || ! @is_dir(dol_osencode($file)))
{ {

View File

@ -206,7 +206,10 @@ if ($action == 'confirm_deletesection' && GETPOST('confirm') == 'yes')
// Refresh directory view // Refresh directory view
if ($action == 'refreshmanual') if ($action == 'refreshmanual')
{ {
clearstatcache(); $ecmdirtmp = new EcmDirectory($db);
// This part of code is same than into file ecm/ajax/ecmdatabase.php TODO Remove duplicate
clearstatcache();
$diroutputslash=str_replace('\\','/',$conf->ecm->dir_output); $diroutputslash=str_replace('\\','/',$conf->ecm->dir_output);
$diroutputslash.='/'; $diroutputslash.='/';
@ -269,7 +272,7 @@ if ($action == 'refreshmanual')
//break; // We found parent, we can stop the while loop //break; // We found parent, we can stop the while loop
} }
else else
{ {
dol_syslog("No"); dol_syslog("No");
//print "No<br>\n"; //print "No<br>\n";
} }
@ -282,7 +285,6 @@ if ($action == 'refreshmanual')
if ($fk_parent >= 0) if ($fk_parent >= 0)
{ {
$ecmdirtmp=new EcmDirectory($db);
$ecmdirtmp->ref = 'NOTUSEDYET'; $ecmdirtmp->ref = 'NOTUSEDYET';
$ecmdirtmp->label = dol_basename($dirdesc['fullname']); $ecmdirtmp->label = dol_basename($dirdesc['fullname']);
$ecmdirtmp->description = ''; $ecmdirtmp->description = '';
@ -316,6 +318,19 @@ if ($action == 'refreshmanual')
} }
} }
// Loop now on each sql tree to check if dir exists
foreach($sqltree as $dirdesc) // Loop on each sqltree to check dir is on disk
{
$dirtotest=$conf->ecm->dir_output.'/'.$dirdesc['fullrelativename'];
if (! dol_is_dir($dirtotest))
{
$mesg.=$dirtotest." not found onto disk. We delete from database dir with id=".$dirdesc['id']."<br>\n";
$ecmdirtmp->id=$dirdesc['id'];
$ecmdirtmp->delete($user,'databaseonly');
//exit;
}
}
$sql="UPDATE ".MAIN_DB_PREFIX."ecm_directories set cachenbofdoc = -1 WHERE cachenbofdoc < 0"; // If pb into cahce counting, we set to value -1 = "unknown" $sql="UPDATE ".MAIN_DB_PREFIX."ecm_directories set cachenbofdoc = -1 WHERE cachenbofdoc < 0"; // If pb into cahce counting, we set to value -1 = "unknown"
dol_syslog("sql = ".$sql); dol_syslog("sql = ".$sql);
$db->query($sql); $db->query($sql);

View File

@ -50,7 +50,15 @@ $(document).ready(function() {
); );
$('#refreshbutton').click( function() { $('#refreshbutton').click( function() {
ecmBuildDatabase(); $.pleaseBePatient("<?php echo $langs->trans('PleaseBePatient'); ?>");
$.getJSON( "<?php echo DOL_URL_ROOT . '/ecm/ajax/ecmdatabase.php'; ?>", {
action: "build",
element: "ecm"
},
function(response) {
$.unblockUI();
location.href="<?php echo $_SERVER['PHP_SELF']; ?>";
});
}); });
}); });
@ -78,17 +86,5 @@ function loadandshowpreview(filedirname,section)
}); });
} }
ecmBuildDatabase = function() {
$.pleaseBePatient("<?php echo $langs->trans('PleaseBePatient'); ?>");
$.getJSON( "<?php echo DOL_URL_ROOT . '/ecm/ajax/ecmdatabase.php'; ?>", {
action: "build",
element: "ecm"
},
function(response) {
$.unblockUI();
location.href="<?php echo $_SERVER['PHP_SELF']; ?>";
});
};
</script> </script>
<!-- END PHP TEMPLATE ecm/tpl/builddatabase.tpl.php --> <!-- END PHP TEMPLATE ecm/tpl/builddatabase.tpl.php -->

View File

@ -495,6 +495,7 @@ if ($id > 0 || ! empty($ref))
{ {
$product = new Product($db); $product = new Product($db);
$product->fetch($objp->fk_product); $product->fetch($objp->fk_product);
$product->load_stock();
} }
if ($objp->fk_product > 0 && $type == 0 && ! empty($conf->stock->enabled)) if ($objp->fk_product > 0 && $type == 0 && ! empty($conf->stock->enabled))

View File

@ -369,7 +369,7 @@ else if ($action == 'addline' && $user->rights->fournisseur->commande->creer)
/* /*
* Mise a jour d'une ligne dans la commande * Mise a jour d'une ligne dans la commande
*/ */
else if ($action == 'update_line' && $user->rights->fournisseur->commande->creer && $_POST['save'] == $langs->trans('Save')) else if ($action == 'update_line' && $user->rights->fournisseur->commande->creer && ! GETPOST('cancel'))
{ {
if ($_POST["elrowid"]) if ($_POST["elrowid"])
{ {

View File

@ -109,16 +109,17 @@ if ($sttc)
} }
if ($sall) if ($sall)
{ {
$sql .= natural_search(array('cf.ref', 'cf.note_public'), $sall); $sql .= natural_search(array('cf.ref', 'cf.note_public', 'cf.note_private'), $sall);
} }
if ($socid) $sql.= " AND s.rowid = ".$socid; if ($socid) $sql.= " AND s.rowid = ".$socid;
if (GETPOST('statut')) if (GETPOST('statut'))
{ {
$sql .= " AND fk_statut =".GETPOST('statut'); $sql .= " AND fk_statut =".GETPOST('statut','int');
} }
$sql .= " ORDER BY $sortfield $sortorder " . $db->plimit($conf->liste_limit+1, $offset); $sql.= " ORDER BY $sortfield $sortorder ";
$sql.= $db->plimit($conf->liste_limit+1, $offset);
$resql = $db->query($sql); $resql = $db->query($sql);
if ($resql) if ($resql)

View File

@ -53,6 +53,7 @@ Language_sl_SI=Slovenian
Language_sv_SV=Swedish Language_sv_SV=Swedish
Language_sv_SE=Swedish Language_sv_SE=Swedish
Language_sk_SK=Slovakian Language_sk_SK=Slovakian
Language_uz_UZ=Uzbek
Language_vi_VN=Vietnamese Language_vi_VN=Vietnamese
Language_zh_CN=Chinese Language_zh_CN=Chinese
Language_zh_TW=Chinese (Traditional) Language_zh_TW=Chinese (Traditional)

View File

@ -257,6 +257,8 @@ Seconds=Seconds
Today=Today Today=Today
Yesterday=Yesterday Yesterday=Yesterday
Tomorrow=Tomorrow Tomorrow=Tomorrow
Morning=Morning
Afternoon=Afternoon
Quadri=Quadri Quadri=Quadri
MonthOfDay=Month of the day MonthOfDay=Month of the day
HourShort=H HourShort=H

View File

@ -110,3 +110,4 @@ MassStockMovement=Mass stock movement
SelectProductInAndOutWareHouse=Select a product, a quantity, a source warehouse and a target warehouse, then click "%s". Once this is done for all required movements, click onto "%s". SelectProductInAndOutWareHouse=Select a product, a quantity, a source warehouse and a target warehouse, then click "%s". Once this is done for all required movements, click onto "%s".
RecordMovement=Record transfert RecordMovement=Record transfert
ReceivingForSameOrder=Receivings for this order ReceivingForSameOrder=Receivings for this order
StockMovementRecorded=Stock movements recorded

View File

@ -53,6 +53,7 @@ Language_sl_SI=Slovène
Language_sv_SV=Suédois Language_sv_SV=Suédois
Language_sv_SE=Suédois Language_sv_SE=Suédois
Language_sk_SK=Slovaque Language_sk_SK=Slovaque
Language_uz_UZ=Ouzbek
Language_vi_VN=Vietnamien Language_vi_VN=Vietnamien
Language_zh_CN=Chinois Language_zh_CN=Chinois
Language_zh_TW=Chinois (Traditionel) Language_zh_TW=Chinois (Traditionel)

View File

@ -257,6 +257,8 @@ Seconds=Secondes
Today=Aujourd'hui Today=Aujourd'hui
Yesterday=Hier Yesterday=Hier
Tomorrow=Demain Tomorrow=Demain
Morning=Matin
Afternoon=Après-midi
Quadri=Trimestre Quadri=Trimestre
MonthOfDay=Mois du jour MonthOfDay=Mois du jour
HourShort=H HourShort=H

View File

@ -90,7 +90,7 @@ CalculatedVolume=Volume calculé
Weight=Poids Weight=Poids
TotalWeight=Poids total TotalWeight=Poids total
WeightUnitton=tonnes WeightUnitton=tonnes
WeightUnitkg=Kg WeightUnitkg=kg
WeightUnitg=g WeightUnitg=g
WeightUnitmg=mg WeightUnitmg=mg
WeightUnitpound=livre WeightUnitpound=livre

View File

@ -110,3 +110,4 @@ MassStockMovement=Mouvement de stock en masse
SelectProductInAndOutWareHouse=Sélectionner un produit, une quantité à transférer, un entrepôt source et destination et cliquer sur "%s". Une fois tous les mouvements choisis, cliquer sur "%s". SelectProductInAndOutWareHouse=Sélectionner un produit, une quantité à transférer, un entrepôt source et destination et cliquer sur "%s". Une fois tous les mouvements choisis, cliquer sur "%s".
RecordMovement=Enregistrer transferts RecordMovement=Enregistrer transferts
ReceivingForSameOrder=Réceptions pour cette commande ReceivingForSameOrder=Réceptions pour cette commande
StockMovementRecorded=Mouvements de stock enregistrés

View File

@ -90,15 +90,23 @@ function marges_prepare_head()
* @param float $localtax2_tx Vat rate special 2 * @param float $localtax2_tx Vat rate special 2
* @param int $fk_pa ??? * @param int $fk_pa ???
* @param float $paht Buying price without tax * @param float $paht Buying price without tax
* @param int $type Type of line (product or service)
* @param Societe $seller Object of seller
* @param array $localtaxes_array Array of localtaxes
* @return array Array of margin info * @return array Array of margin info
*
* FIXME This function is called too frequently without type, seller and without localtaxes_array defined. This make vat rate detection wrong.
*/ */
function getMarginInfos($pvht, $remise_percent, $tva_tx, $localtax1_tx, $localtax2_tx, $fk_pa, $paht) function getMarginInfos($pvht, $remise_percent, $tva_tx, $localtax1_tx, $localtax2_tx, $fk_pa, $paht, $type=0, $seller='', $localtaxes_array='')
{ {
global $db, $conf; global $db, $conf, $mysoc;
$marge_tx_ret=''; $marge_tx_ret='';
$marque_tx_ret=''; $marque_tx_ret='';
if (empty($seller) || ! is_object($seller)) $seller=$mysoc;
if (empty($localtaxes_array) || ! is_array($localtaxes_array)) $localtaxes_array=array();
if($fk_pa > 0) { if($fk_pa > 0) {
require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.product.class.php'; require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.product.class.php';
$product = new ProductFournisseur($db); $product = new ProductFournisseur($db);
@ -115,7 +123,7 @@ function getMarginInfos($pvht, $remise_percent, $tva_tx, $localtax1_tx, $localta
require_once DOL_DOCUMENT_ROOT.'/core/lib/price.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/price.lib.php';
// calcul pu_ht remisés // calcul pu_ht remisés
$tabprice=calcul_price_total(1, $pvht, $remise_percent, $tva_tx, $localtax1_tx, $localtax2_tx, 0, 'HT', 0, 0); // FIXME Parameter type is missing, i put 0 to avoid blocking error $tabprice=calcul_price_total(1, $pvht, $remise_percent, $tva_tx, $localtax1_tx, $localtax2_tx, 0, 'HT', 0, $type, $seller, $localtaxes_array);
$pu_ht_remise = $tabprice[0]; $pu_ht_remise = $tabprice[0];
// calcul marge // calcul marge
if ($pu_ht_remise < 0) if ($pu_ht_remise < 0)

View File

@ -311,7 +311,7 @@ function getPaypalPaymentUrl($mode,$type,$ref='',$amount='9.99',$freetag='your_f
} }
// For multicompany // For multicompany
$out.="&entity=".$conf->entity; //$out.="&entity=".$conf->entity; // This should not be into link. Link contains already a ref of an object that allow to retreive entity
return $out; return $out;
} }

View File

@ -1,5 +1,6 @@
<?php <?php
/* Copyright (C) 2012 Regis Houssin <regis.houssin@capnetworks.com> /* Copyright (C) 2012 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2013 Laurent Destailleur <eldy@users.sourceforge.net>
* *
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
@ -28,6 +29,7 @@ require '../../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/product.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/product.lib.php';
require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.product.class.php';
$langs->load("admin"); $langs->load("admin");
$langs->load("products"); $langs->load("products");
@ -41,6 +43,7 @@ $newvatrate=GETPOST('newvatrate');
//$price_base_type=GETPOST('price_base_type'); //$price_base_type=GETPOST('price_base_type');
$objectstatic = new Product($db); $objectstatic = new Product($db);
$objectstatic2 = new ProductFournisseur($db);
/* /*
@ -60,104 +63,176 @@ if ($action == 'convert')
if (! $error) if (! $error)
{ {
$country_id=$mysoc->country_id; // TODO Allow to choose country into form
$nbrecordsmodified=0;
$db->begin(); $db->begin();
$sql = 'SELECT rowid'; // If country to edit is my country, so we change customer prices
$sql.= ' FROM '.MAIN_DB_PREFIX.'product'; if ($country_id == $mysoc->country_id)
$sql.= ' WHERE entity IN ('.getEntity('product',1).')'; {
$sql.= " AND tva_tx = '".$db->escape($oldvatrate)."'"; $sql = 'SELECT rowid';
//$sql.= ' AND price_base_type = "'..'"'; $sql.= ' FROM '.MAIN_DB_PREFIX.'product';
//print $sql; $sql.= ' WHERE entity IN ('.getEntity('product',1).')';
$sql.= " AND tva_tx = '".$db->escape($oldvatrate)."'";
$resql=$db->query($sql);
if ($resql)
{
$num = $db->num_rows($resql);
$i = 0;
while ($i < $num)
{
$obj = $db->fetch_object($resql);
$ret=$objectstatic->fetch($obj->rowid);
if ($ret > 0)
{
$ret=0; $retm=0; $updatelevel1=false;
// Update multiprice
$listofmulti=array_reverse($objectstatic->multiprices, true); // To finish with level 1
foreach ($listofmulti as $level => $multiprices)
{
$price_base_type = $objectstatic->multiprices_base_type[$level]; // Get price_base_type of product/service to keep the same for update
if (empty($price_base_type)) continue; // Discard not defined price levels
if ($price_base_type == 'TTC')
{
$newprice=price2num($objectstatic->multiprices_ttc[$level],'MU'); // Second param must be MU (we want a unit price so 'MU'. If unit price was on 4 decimal, we must keep 4 decimals)
$newminprice=$objectstatic->multiprices_min_ttc[$level];
}
else
{
$newprice=price2num($objectstatic->multiprices[$level],'MU'); // Second param must be MU (we want a unit price so 'MU'. If unit price was on 4 decimal, we must keep 4 decimals)
$newminprice=$objectstatic->multiprices_min[$level];
}
if ($newminprice > $newprice) $newminprice=$newprice;
$newvat=str_replace('*','',$newvatrate);
$newnpr=$objectstatic->multiprices_recuperableonly[$level];
$newlevel=$level;
//print "$objectstatic->id $newprice, $price_base_type, $newvat, $newminprice, $newlevel, $newnpr<br>\n";
$retm=$objectstatic->updatePrice($newprice, $price_base_type, $user, $newvat, $newminprice, $newlevel, $newnpr);
if ($retm < 0)
{
$error++;
break;
}
if ($newlevel == 1) $updatelevel1=true;
}
// Update single price
$price_base_type = $objectstatic->price_base_type; // Get price_base_type of product/service to keep the same for update
if ($price_base_type == 'TTC')
{
$newprice=price2num($objectstatic->price_ttc,'MU'); // Second param must be MU (we want a unit price so 'MU'. If unit price was on 4 decimal, we must keep 4 decimals)
$newminprice=$objectstatic->price_min_ttc;
}
else
{
$newprice=price2num($objectstatic->price,'MU'); // Second param must be MU (we want a unit price so 'MU'. If unit price was on 4 decimal, we must keep 4 decimals)
$newminprice=$objectstatic->price_min;
}
if ($newminprice > $newprice) $newminprice=$newprice;
$newvat=str_replace('*','',$newvatrate);
$newnpr=$objectstatic->recuperableonly;
$newlevel=0;
if (! empty($price_base_type) && ! $updatelevel1)
{
//print "$objectstatic->id $newprice, $price_base_type, $newvat, $newminprice, $newlevel, $newnpr<br>\n";
$ret=$objectstatic->updatePrice($newprice, $price_base_type, $user, $newvat, $newminprice, $newlevel, $newnpr);
}
if ($ret < 0 || $retm < 0) $error++;
else $nbrecordsmodified++;
}
$i++;
}
}
else dol_print_error($db);
}
$fourn = new Fournisseur($db);
// Change supplier prices
$sql = 'SELECT pfp.rowid, pfp.fk_soc, pfp.price as price, pfp.quantity as qty, pfp.fk_availability, pfp.ref_fourn';
$sql.= ' FROM '.MAIN_DB_PREFIX.'product_fournisseur_price as pfp, '.MAIN_DB_PREFIX.'societe as s';
$sql.= ' WHERE pfp.fk_soc = s.rowid AND pfp.entity IN ('.getEntity('product',1).')';
$sql.= " AND tva_tx = '".$db->escape($oldvatrate)."'";
$sql.= " AND s.fk_pays = '".$country_id."'";
//print $sql;
$resql=$db->query($sql); $resql=$db->query($sql);
if ($resql) if ($resql)
{ {
$num = $db->num_rows($resql); $num = $db->num_rows($resql);
$i = 0; $nbrecordsmodified=0; $i = 0;
while ($i < $num) while ($i < $num)
{ {
$obj = $db->fetch_object($resql); $obj = $db->fetch_object($resql);
$ret=$objectstatic->fetch($obj->rowid); $ret=$objectstatic2->fetch_product_fournisseur_price($obj->rowid);
if ($ret > 0) if ($ret > 0)
{ {
$ret=0; $retm=0; $updatelevel1=false; $ret=0; $retm=0; $updatelevel1=false;
// Update multiprice $price_base_type='HT';
$listofmulti=array_reverse($objectstatic->multiprices, true); // To finish with level 1 //$price_base_type = $objectstatic2->price_base_type; // Get price_base_type of product/service to keep the same for update
foreach ($listofmulti as $level => $multiprices) //if ($price_base_type == 'TTC')
{ //{
$price_base_type = $objectstatic->multiprices_base_type[$level]; // Get price_base_type of product/service to keep the same for update // $newprice=price2num($objectstatic2->price_ttc,'MU'); // Second param must be MU (we want a unit price so 'MU'. If unit price was on 4 decimal, we must keep 4 decimals)
if (empty($price_base_type)) continue; // Discard not defined price levels // $newminprice=$objectstatic2->price_min_ttc;
//}
if ($price_base_type == 'TTC') //else
{ //{
$newprice=price2num($objectstatic->multiprices_ttc[$level],'MU'); // Second param must be MU (we want a unit price so 'MU'. If unit price was on 4 decimal, we must keep 4 decimals) $newprice=price2num($obj->price,'MU'); // Second param must be MU (we want a unit price so 'MU'. If unit price was on 4 decimal, we must keep 4 decimals)
$newminprice=$objectstatic->multiprices_min_ttc[$level]; //$newminprice=$objectstatic2->fourn_price_min;
} //}
else //if ($newminprice > $newprice) $newminprice=$newprice;
{
$newprice=price2num($objectstatic->multiprices[$level],'MU'); // Second param must be MU (we want a unit price so 'MU'. If unit price was on 4 decimal, we must keep 4 decimals)
$newminprice=$objectstatic->multiprices_min[$level];
}
if ($newminprice > $newprice) $newminprice=$newprice;
$newvat=str_replace('*','',$newvatrate);
$newnpr=$objectstatic->multiprices_recuperableonly[$level];
$newlevel=$level;
//print "$objectstatic->id $newprice, $price_base_type, $newvat, $newminprice, $newlevel, $newnpr<br>\n";
$retm=$objectstatic->updatePrice($newprice, $price_base_type, $user, $newvat, $newminprice, $newlevel, $newnpr);
if ($retm < 0)
{
$error++;
break;
}
if ($newlevel == 1) $updatelevel1=true;
}
// Update single price
$price_base_type = $objectstatic->price_base_type; // Get price_base_type of product/service to keep the same for update
if ($price_base_type == 'TTC')
{
$newprice=price2num($objectstatic->price_ttc,'MU'); // Second param must be MU (we want a unit price so 'MU'. If unit price was on 4 decimal, we must keep 4 decimals)
$newminprice=$objectstatic->price_min_ttc;
}
else
{
$newprice=price2num($objectstatic->price,'MU'); // Second param must be MU (we want a unit price so 'MU'. If unit price was on 4 decimal, we must keep 4 decimals)
$newminprice=$objectstatic->price_min;
}
if ($newminprice > $newprice) $newminprice=$newprice;
$newvat=str_replace('*','',$newvatrate); $newvat=str_replace('*','',$newvatrate);
$newnpr=$objectstatic->recuperableonly; //$newnpr=$objectstatic2->recuperableonly;
$newlevel=0; $newlevel=0;
if (! empty($price_base_type) && ! $updatelevel1) if (! empty($price_base_type) && ! $updatelevel1)
{ {
//print "$objectstatic->id $newprice, $price_base_type, $newvat, $newminprice, $newlevel, $newnpr<br>\n"; //print "$objectstatic2->id $newprice, $price_base_type, $newvat, $newminprice, $newlevel, $newnpr<br>\n";
$ret=$objectstatic->updatePrice($newprice, $price_base_type, $user, $newvat, $newminprice, $newlevel, $newnpr); $fourn->id=$obj->fk_soc;
$ret=$objectstatic2->update_buyprice($obj->qty, $newprice, $user, $price_base_type, $fourn, $obj->fk_availability, $obj->ref_fourn, $newvat);
} }
if ($ret < 0 || $retm < 0) $error++; if ($ret < 0 || $retm < 0) $error++;
else $nbrecordsmodified++; else $nbrecordsmodified++;
} }
$i++; $i++;
} }
if (! $error)
{
if ($nbrecordsmodified > 0) setEventMessage($langs->trans("RecordsModified",$nbrecordsmodified));
else setEventMessage($langs->trans("NoRecordFound"),'warnings');
$db->commit();
}
else
{
setEventMessage($langs->trans("Error"),'errors');
$db->rollback();
}
} }
else dol_print_error($db);
if (! $error)
{
$db->commit();
}
else
{
$db->rollback();
}
// Output result
if (! $error)
{
if ($nbrecordsmodified > 0) setEventMessage($langs->trans("RecordsModified",$nbrecordsmodified));
else setEventMessage($langs->trans("NoRecordFound"),'warnings');
}
else
{
setEventMessage($langs->trans("Error"),'errors');
}
} }
} }

View File

@ -1151,7 +1151,7 @@ class Product extends CommonObject
$sql.= " accountancy_code_buy, accountancy_code_sell, stock, pmp,"; $sql.= " accountancy_code_buy, accountancy_code_sell, stock, pmp,";
$sql.= " datec, tms, import_key, entity, desiredstock"; $sql.= " datec, tms, import_key, entity, desiredstock";
$sql.= " FROM ".MAIN_DB_PREFIX."product"; $sql.= " FROM ".MAIN_DB_PREFIX."product";
if ($id) $sql.= " WHERE rowid = '".$id."'"; if ($id) $sql.= " WHERE rowid = ".$this->db->escape($id);
else else
{ {
$sql.= " WHERE entity IN (".getEntity($this->element, 1).")"; $sql.= " WHERE entity IN (".getEntity($this->element, 1).")";
@ -1224,6 +1224,7 @@ class Product extends CommonObject
$this->db->free($resql); $this->db->free($resql);
// multilangs // multilangs
if (! empty($conf->global->MAIN_MULTILANGS)) $this->getMultiLangs(); if (! empty($conf->global->MAIN_MULTILANGS)) $this->getMultiLangs();
@ -1347,9 +1348,11 @@ class Product extends CommonObject
} }
} }
$res=$this->load_stock(); // We should not load stock at each fetch. If someone need stock, he must call load_stock after fetch.
//$res=$this->load_stock();
//return $res;
return $res; return 1;
} }
else else
{ {

View File

@ -1,6 +1,6 @@
<?php <?php
/* Copyright (C) 2001-2007 Rodolphe Quiedeville <rodolphe@quiedeville.org> /* Copyright (C) 2001-2007 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2012 Laurent Destailleur <eldy@users.sourceforge.net> * Copyright (C) 2004-2013 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2004 Eric Seigne <eric.seigne@ryxeo.com> * Copyright (C) 2004 Eric Seigne <eric.seigne@ryxeo.com>
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com> * Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2010-2012 Juanjo Menent <jmenent@2byte.es> * Copyright (C) 2010-2012 Juanjo Menent <jmenent@2byte.es>
@ -99,6 +99,11 @@ if ($action == 'updateprice' && GETPOST('cancel') <> $langs->trans("Cancel"))
$tva_tx = str_replace('*','', GETPOST('tva_tx','alpha')); $tva_tx = str_replace('*','', GETPOST('tva_tx','alpha'));
$tva_tx = price2num($tva_tx); $tva_tx = price2num($tva_tx);
if ($tva_tx == '')
{
$error++;
$mesg='<div class="error">'.$langs->trans("ErrorFieldRequired",$langs->transnoentities("VATRateForSupplierProduct")).'</div>';
}
if (empty($quantity)) if (empty($quantity))
{ {
$error++; $error++;
@ -353,6 +358,7 @@ if ($id || $ref)
if (! empty($socid)) // When update if (! empty($socid)) // When update
{ {
$default_vat=get_default_tva($supplier, $mysoc, $product->id); $default_vat=get_default_tva($supplier, $mysoc, $product->id);
if (empty($default_vat)) $default_vat=$product->tva_tx;
} }
print '<input type="text" class="flat" size="5" name="tva_tx" value="'.(GETPOST("tva_tx")?vatrate(GETPOST("tva_tx")):($default_vat!=''?vatrate($default_vat):'')).'">'; print '<input type="text" class="flat" size="5" name="tva_tx" value="'.(GETPOST("tva_tx")?vatrate(GETPOST("tva_tx")):($default_vat!=''?vatrate($default_vat):'')).'">';
print '</td></tr>'; print '</td></tr>';

View File

@ -81,6 +81,7 @@ class MouvementStock
dol_print_error('',"Failed to fetch product"); dol_print_error('',"Failed to fetch product");
return -1; return -1;
} }
$product->load_stock();
// Define if we must make the stock change (If product type is a service or if stock is used also for services) // Define if we must make the stock change (If product type is a service or if stock is used also for services)
$movestock=0; $movestock=0;

View File

@ -207,8 +207,8 @@ $formproduct=new FormProduct($db);
if ($id > 0 || $ref) if ($id > 0 || $ref)
{ {
$product = new Product($db); $product = new Product($db);
if ($ref) $result = $product->fetch('',$ref); $result = $product->fetch($id,$ref);
if ($id > 0) $result = $product->fetch($id); $product->load_stock();
$help_url='EN:Module_Stocks_En|FR:Module_Stock|ES:M&oacute;dulo_Stocks'; $help_url='EN:Module_Stocks_En|FR:Module_Stock|ES:M&oacute;dulo_Stocks';
llxHeader("",$langs->trans("CardProduct".$product->type),$help_url); llxHeader("",$langs->trans("CardProduct".$product->type),$help_url);

View File

@ -29,12 +29,10 @@
define("NOLOGIN",1); // This means this output page does not require to be logged. define("NOLOGIN",1); // This means this output page does not require to be logged.
define("NOCSRFCHECK",1); // We accept to go on this page from external web site. define("NOCSRFCHECK",1); // We accept to go on this page from external web site.
// For MultiCompany module // For MultiCompany module. This should be useless. Because entity must be retreive from object ref and not from url.
$entity=(! empty($_GET['entity']) ? (int) $_GET['entity'] : (! empty($_POST['entity']) ? (int) $_POST['entity'] : 1)); $entity=GETPOST('entity')?GETPOST('entity','int'):1;
if (is_int($entity)) if (is_int($entity)) define("DOLENTITY", $entity);
{
define("DOLENTITY", $entity);
}
require '../../main.inc.php'; require '../../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/paypal/lib/paypal.lib.php'; require_once DOL_DOCUMENT_ROOT.'/paypal/lib/paypal.lib.php';

View File

@ -29,12 +29,10 @@
define("NOLOGIN",1); // This means this output page does not require to be logged. define("NOLOGIN",1); // This means this output page does not require to be logged.
define("NOCSRFCHECK",1); // We accept to go on this page from external web site. define("NOCSRFCHECK",1); // We accept to go on this page from external web site.
// For MultiCompany module // For MultiCompany module. This should be useless. Because entity must be retreive from object ref and not from url.
$entity=(! empty($_GET['entity']) ? (int) $_GET['entity'] : (! empty($_POST['entity']) ? (int) $_POST['entity'] : 1)); $entity=GETPOST('entity')?GETPOST('entity','int'):1;
if (is_int($entity)) if (is_int($entity)) define("DOLENTITY", $entity);
{
define("DOLENTITY", $entity);
}
require '../../main.inc.php'; require '../../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/paypal/lib/paypal.lib.php'; require_once DOL_DOCUMENT_ROOT.'/paypal/lib/paypal.lib.php';

View File

@ -44,48 +44,68 @@ This page is a sample of page using tables. To make test with<br>
<br> <br>
Example 0 : Table with div and table with table containg a select that should be overflowed and truncated<br> Example 0a : Table with div+div+div containg a select that should be overflowed and truncated<br>
<div style="display: table;"><div style="display: table-row"><div style="display: table-cell; overflow: hidden; white-space: nowrap; max-width: 100px;"> <!-- If you remove max-width, the jmobile overflow does not work --> <div class="tagtable centpercent">
<select name="hidedetails"><option>aaaaaaaaaaaaaaafd sf sf gfd gfds fsd gfd fhfg hf dhfg hg fhfgdhfgdh gh gfdhdgf h gfdh dfhg dfgh dfgh fdgh gfd hfd hfd gs fgdf gaaaa</option><option>gdfs gdf g sdfg dfg fdsg dsfg dfs gdfs gds fgs gdfdf gd</option></select> <div class="tagtr">
</div></div></div> <div class="tagtd" style="overflow: hidden; white-space: nowrap; max-width: 100px;"> <!-- If you remove max-width, the jmobile overflow does not work -->
<br>
<table width="100%">
<tr><td style="max-width:100px; overflow: hidden; white-space: nowrap;"> <!-- If you remove max-width, the jmobile overflow does not work -->
<select name="hidedetails"><option>aaaaaaaaaaaaaaafd sf sf gfd gfds fsd gfd fhfg hf dhfg hg fhfgdhfgdh gh gfdhdgf h gfdh dfhg dfgh dfgh fdgh gfd hfd hfd gs fgdf gaaaa</option><option>gdfs gdf g sdfg dfg fdsg dsfg dfs gdfs gds fgs gdfdf gd</option></select> <select name="hidedetails"><option>aaaaaaaaaaaaaaafd sf sf gfd gfds fsd gfd fhfg hf dhfg hg fhfgdhfgdh gh gfdhdgf h gfdh dfhg dfgh dfgh fdgh gfd hfd hfd gs fgdf gaaaa</option><option>gdfs gdf g sdfg dfg fdsg dsfg dfs gdfs gds fgs gdfdf gd</option></select>
</td></tr> </div>
<div class="tagtd" style="overflow: hidden; white-space: nowrap; max-width: 100px;"> <!-- If you remove max-width, the jmobile overflow does not work -->
<select name="hidedetails"><option>aaaaaaaaaaaaaaafd sf sf gfd gfds fsd gfd fhfg hf dhfg hg fhfgdhfgdh gh gfdhdgf h gfdh dfhg dfgh dfgh fdgh gfd hfd hfd gs fgdf gaaaa</option><option>gdfs gdf g sdfg dfg fdsg dsfg dfs gdfs gds fgs gdfdf gd</option></select>
</div>
</div>
</div>
Example 0b: Table with div+form+div containg a select that should be overflowed and truncated<br>
<div class="tagtable centpercent">
<form action="xxx" method="POST" class="tagtr">
<div class="tagtd" style="max-width:100px; overflow: hidden; white-space: nowrap;"> <!-- If you remove max-width, the jmobile overflow does not work -->
<select name="hidedetails"><option>aaaaaaaaaaaaaaafd sf sf gfd gfds fsd gfd fhfg hf dhfg hg fhfgdhfgdh gh gfdhdgf h gfdh dfhg dfgh dfgh fdgh gfd hfd hfd gs fgdf gaaaa</option><option>gdfs gdf g sdfg dfg fdsg dsfg dfs gdfs gds fgs gdfdf gd</option></select>
</div>
<div class="tagtd" style="max-width:100px; overflow: hidden; white-space: nowrap;"> <!-- If you remove max-width, the jmobile overflow does not work -->
<select name="hidedetails"><option>aaaaaaaaaaaaaaafd sf sf gfd gfds fsd gfd fhfg hf dhfg hg fhfgdhfgdh gh gfdhdgf h gfdh dfhg dfgh dfgh fdgh gfd hfd hfd gs fgdf gaaaa</option><option>gdfs gdf g sdfg dfg fdsg dsfg dfs gdfs gds fgs gdfdf gd</option></select>
</div>
</form>
</div>
Example 0c: Table with table+tr+td containg a select that should be overflowed and truncated<br>
<table class="centpercent">
<tr>
<td class="tagtd" style="max-width:100px; overflow: hidden; white-space: nowrap;"> <!-- If you remove max-width, the jmobile overflow does not work -->
<select name="hidedetails"><option>aaaaaaaaaaaaaaafd sf sf gfd gfds fsd gfd fhfg hf dhfg hg fhfgdhfgdh gh gfdhdgf h gfdh dfhg dfgh dfgh fdgh gfd hfd hfd gs fgdf gaaaa</option><option>gdfs gdf g sdfg dfg fdsg dsfg dfs gdfs gds fgs gdfdf gd</option></select>
</td>
<td class="tagtd" style="max-width:100px; overflow: hidden; white-space: nowrap;"> <!-- If you remove max-width, the jmobile overflow does not work -->
<select name="hidedetails"><option>aaaaaaaaaaaaaaafd sf sf gfd gfds fsd gfd fhfg hf dhfg hg fhfgdhfgdh gh gfdhdgf h gfdh dfhg dfgh dfgh fdgh gfd hfd hfd gs fgdf gaaaa</option><option>gdfs gdf g sdfg dfg fdsg dsfg dfs gdfs gds fgs gdfdf gd</option></select>
</td>
</tr>
</table> </table>
<br> <br>
Example 1 : Table using tags: div.tagtable+form+div or div.tagtable+div.tagtr+div.tagtd<br> Example 1 : Table using tags: div.tagtable+div.tagtr+div or div.tagtable+div.tagtr+div.tagtd<br>
<?php <?php
$tasksarray=array(1,2,3); // To force having several lines $tasksarray=array(1,2,3); // To force having several lines
$tagidfortablednd='tablelines'; $tagidfortablednd='tablelines';
if (! empty($conf->use_javascript_ajax) && $object->statut == 0) include DOL_DOCUMENT_ROOT.'/core/tpl/ajaxrow.tpl.php'; if (! empty($conf->use_javascript_ajax) && $object->statut == 0) include DOL_DOCUMENT_ROOT.'/core/tpl/ajaxrow.tpl.php';
?> ?>
<div class="tagtable centpercent" id="tablelines"> <div class="tagtable centpercent" id="tablelines">
<div class="liste_titre"> <div class="tagtr liste_titre">
<div>line3<input type="hidden" name="cartitem" value="3"></div> <div class="tagtd">line3<input type="hidden" name="cartitem" value="3"></div>
<div>dfsdf</div> <div class="tagtd">dfsdf</div>
<div>ffdsfsd</div> <div class="tagtd">ffdsfsd</div>
<div class="tdlineupdown">aaaa</div> <div class="tagtd tdlineupdown">aaaa</div>
</div> </div>
<div class="impair tagtr"> <div class="impair tagtr">
<div>line4<input type="hidden" name="cartitem" value="3"></div> <div class="tagtd">line4<input type="hidden" name="cartitem" value="3"></div>
<div>dfsdf</div> <div class="tagtd">dfsdf</div>
<div><input name="count" value="4"></div> <div class="tagtd"><input name="count" value="4"></div>
<div class="tdlineupdown">bbbb</div> <div class="tagtd tdlineupdown">bbbb</div>
</div> </div>
<div class="pair tagtr"> <div class="pair tagtr">
<div>line5<input type="hidden" name="cartitemb" value="3"></div> <div class="tagtd">line5<input type="hidden" name="cartitemb" value="3"></div>
<div>dfsdf</div> <div class="tagtd">dfsdf</div>
<div><input name="countb" value="4"></div> <div class="tagtd"><input name="countb" value="4"></div>
<div class="tdlineupdown">bbbb</div> <div class="tagtd tdlineupdown">bbbb</div>
</div> </div>
<!-- Using form into div make Firefox crazy (page loading does not end) --> <!-- Using form into div make Firefox crazy (page loading does not end) -->
<!-- <form class="liste_titre" method="POST" action="1.php"> <!-- <form class="liste_titre" method="POST" action="1.php">

View File

@ -241,23 +241,72 @@ class CompanyBankAccount extends Account
/** /**
* Return RIB * Return RIB
* *
* @param boolean $displayriblabel Show or Hide Label * @param boolean $displayriblabel Prepend or Hide Label
* @return string RIB * @return string RIB
*/ */
function getRibLabel($displayriblabel = true) function getRibLabel($displayriblabel = true)
{ {
global $langs; global $langs,$conf;
if ($this->code_banque || $this->code_guichet || $this->number || $this->cle_rib) if ($this->code_banque || $this->code_guichet || $this->number || $this->cle_rib)
{ {
if ($this->label && $displayriblabel) if ($this->label && $displayriblabel) $rib = $this->label." : ";
$rib = $this->label." : ";
$rib.= $this->code_banque." ".$this->code_guichet." ".$this->number; // Show fields of bank account
$rib.=($this->cle_rib?" (".$this->cle_rib.")":""); $fieldlists='BankCode DeskCode AccountNumber BankAccountNumberKey';
if (! empty($conf->global->BANK_SHOW_ORDER_OPTION))
{
if (is_numeric($conf->global->BANK_SHOW_ORDER_OPTION))
{
if ($conf->global->BANK_SHOW_ORDER_OPTION == '1') $fieldlists='BankCode DeskCode BankAccountNumberKey AccountNumber';
}
else $fieldlists=$conf->global->BANK_SHOW_ORDER_OPTION;
}
$fieldlistsarray=explode(' ',$fieldlists);
foreach($fieldlistsarray as $val)
{
if ($val == 'BankCode')
{
if ($this->useDetailedBBAN() == 1)
{
$rib.=$this->code_banque.'&nbsp;';
}
}
if ($val == 'DeskCode')
{
if ($this->useDetailedBBAN() == 1)
{
$rib.=$this->code_guichet.'&nbsp;';
}
}
if ($val == 'BankCode')
{
if ($this->useDetailedBBAN() == 2)
{
$rib.=$this->code_banque.'&nbsp;';
}
}
if ($val == 'AccountNumber')
{
$rib.=$this->number.'&nbsp;';
}
if ($val == 'BankAccountNumberKey')
{
if ($this->useDetailedBBAN() == 1)
{
$rib.=$this->cle_rib.'&nbsp;';
}
}
}
} }
else else
{ {
$rib=$langs->trans("NoRIB"); $rib='';
} }
return $rib; return $rib;

View File

@ -771,7 +771,7 @@ class Societe extends CommonObject
$this->country_id = $obj->country_id; $this->country_id = $obj->country_id;
$this->country_code = $obj->country_id?$obj->country_code:''; $this->country_code = $obj->country_id?$obj->country_code:'';
$this->country = $obj->country_id?($langs->trans('Country'.$obj->country_code)!='Country'.$obj->country_code?$langs->trans('Country'.$obj->country_code):$obj->country):''; $this->country = $obj->country_id?($langs->trans('Country'.$obj->country_code)!='Country'.$obj->country_code?$langs->transnoentities('Country'.$obj->country_code):$obj->country):'';
$this->state_id = $obj->fk_departement; $this->state_id = $obj->fk_departement;
$this->state_code = $obj->state_code; $this->state_code = $obj->state_code;
@ -1751,7 +1751,7 @@ class Societe extends CommonObject
require_once DOL_DOCUMENT_ROOT . '/societe/class/companybankaccount.class.php'; require_once DOL_DOCUMENT_ROOT . '/societe/class/companybankaccount.class.php';
$bac = new CompanyBankAccount($this->db); $bac = new CompanyBankAccount($this->db);
$bac->fetch(0,$this->id); $bac->fetch(0,$this->id);
return $bac->getRibLabel(); return $bac->getRibLabel(true);
} }
/** /**

View File

@ -214,6 +214,7 @@ if ($month > 0) {
$sql.= " AND ".$datePrint." BETWEEN '".$db->idate($start)."' AND '".$db->idate($end)."'"; $sql.= " AND ".$datePrint." BETWEEN '".$db->idate($start)."' AND '".$db->idate($end)."'";
} }
if ($sref) $sql.= " AND ".$doc_number." LIKE '%".$sref."%'"; if ($sref) $sql.= " AND ".$doc_number." LIKE '%".$sref."%'";
if ($sprod_fulldescr) $sql.= " AND (d.description LIKE '%".$sprod_fulldescr."%' OR p.label LIKE '%".$sprod_fulldescr."%')";
$sql.= $db->order($sortfield,$sortorder); $sql.= $db->order($sortfield,$sortorder);
$sql.= $db->plimit($limit + 1, $offset); $sql.= $db->plimit($limit + 1, $offset);
@ -249,7 +250,7 @@ print $formother->select_month($month?$month:-1,'month',1);
$formother->select_year($year?$year:-1,'year',1, 20, 1); $formother->select_year($year?$year:-1,'year',1, 20, 1);
print '</td>'; print '</td>';
print '<td class="liste_titre" align="left">'; print '<td class="liste_titre" align="left">';
print '<input class="flat" type="text" name="sprod_fulldescr" size="15" value="'.$sprod_fulldescr.'">'; print '<input class="flat" type="text" name="sprod_fulldescr" size="15" value="'.dol_escape_htmltag($sprod_fulldescr).'">';
print '</td>'; print '</td>';
print '<td class="liste_titre" align="right">'; print '<td class="liste_titre" align="right">';
print '<input type="image" class="liste_titre" name="button_search" src="'.DOL_URL_ROOT.'/theme/'.$conf->theme.'/img/search.png" value="'.dol_escape_htmltag($langs->trans("Search")).'" title="'.dol_escape_htmltag($langs->trans("Search")).'">'; print '<input type="image" class="liste_titre" name="button_search" src="'.DOL_URL_ROOT.'/theme/'.$conf->theme.'/img/search.png" value="'.dol_escape_htmltag($langs->trans("Search")).'" title="'.dol_escape_htmltag($langs->trans("Search")).'">';

View File

@ -1,7 +1,7 @@
<?php <?php
/* Copyright (C) 2002-2004 Rodolphe Quiedeville <rodolphe@quiedeville.org> /* Copyright (C) 2002-2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2003 Jean-Louis Bergamo <jlb@j1b.org> * Copyright (C) 2003 Jean-Louis Bergamo <jlb@j1b.org>
* Copyright (C) 2004-2011 Laurent Destailleur <eldy@users.sourceforge.net> * Copyright (C) 2004-2013 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2009 Regis Houssin <regis.houssin@capnetworks.com> * Copyright (C) 2005-2009 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2013 Peter Fontaine <contact@peterfontaine.fr> * Copyright (C) 2013 Peter Fontaine <contact@peterfontaine.fr>
* *
@ -317,13 +317,16 @@ if ($socid && $action != 'edit' && $action != "create")
$rib_list = $soc->get_all_rib(); $rib_list = $soc->get_all_rib();
$var = false; $var = false;
if (is_array($rib_list)) { if (is_array($rib_list))
{
print '<table class="liste" width="100%">'; print '<table class="liste" width="100%">';
print '<tr class="liste_titre">'; print '<tr class="liste_titre">';
print_liste_field_titre($langs->trans("LabelRIB")); print_liste_field_titre($langs->trans("LabelRIB"));
print_liste_field_titre($langs->trans("Bank")); print_liste_field_titre($langs->trans("Bank"));
print_liste_field_titre($langs->trans("RIB")); print_liste_field_titre($langs->trans("RIB"));
print_liste_field_titre($langs->trans("IBAN"));
print_liste_field_titre($langs->trans("BIC"));
print_liste_field_titre($langs->trans("DefaultRIB"), '', '', '', '', 'align="center"'); print_liste_field_titre($langs->trans("DefaultRIB"), '', '', '', '', 'align="center"');
print '<td width="40"></td>'; print '<td width="40"></td>';
print '</tr>'; print '</tr>';
@ -331,9 +334,17 @@ if ($socid && $action != 'edit' && $action != "create")
foreach ($rib_list as $rib) foreach ($rib_list as $rib)
{ {
print "<tr $bc[$var]>"; print "<tr $bc[$var]>";
// Label
print '<td>'.$rib->label.'</td>'; print '<td>'.$rib->label.'</td>';
// Bank name
print '<td>'.$rib->bank.'</td>'; print '<td>'.$rib->bank.'</td>';
// Account number
print '<td>'.$rib->getRibLabel(false).'</td>'; print '<td>'.$rib->getRibLabel(false).'</td>';
// IBAN
print '<td>'.$rib->iban.'</td>';
// BIC
print '<td>'.$rib->bic.'</td>';
// Default
print '<td align="center" width="70">'; print '<td align="center" width="70">';
if (!$rib->default_rib) { if (!$rib->default_rib) {
print '<a href="'.DOL_URL_ROOT.'/societe/rib.php?socid='.$soc->id.'&ribid='.$rib->id.'&action=setasdefault">'; print '<a href="'.DOL_URL_ROOT.'/societe/rib.php?socid='.$soc->id.'&ribid='.$rib->id.'&action=setasdefault">';
@ -343,6 +354,8 @@ if ($socid && $action != 'edit' && $action != "create")
print img_picto($langs->trans("Enabled"),'on'); print img_picto($langs->trans("Enabled"),'on');
} }
print '</td>'; print '</td>';
// Edit/Delete
print '<td align="right">'; print '<td align="right">';
if ($user->rights->societe->creer) if ($user->rights->societe->creer)
{ {

View File

@ -52,7 +52,7 @@ $action = (GETPOST('action') ? GETPOST('action') : 'view');
$confirm = GETPOST('confirm'); $confirm = GETPOST('confirm');
$socid = GETPOST('socid','int'); $socid = GETPOST('socid','int');
if ($user->societe_id) $socid=$user->societe_id; if ($user->societe_id) $socid=$user->societe_id;
if (empty($socid) && $action = 'view') $action='create'; if (empty($socid) && $action == 'view') $action='create';
$object = new Societe($db); $object = new Societe($db);
$extrafields = new ExtraFields($db); $extrafields = new ExtraFields($db);

View File

@ -247,7 +247,6 @@ input.flat {
border:solid 1px rgba(0,0,0,.3); border:solid 1px rgba(0,0,0,.3);
border-top:solid 1px rgba(0,0,0,.4); border-top:solid 1px rgba(0,0,0,.4);
border-bottom:solid 1px rgba(0,0,0,.2); border-bottom:solid 1px rgba(0,0,0,.2);
box-shadow:1px 1px 2px rgba(0,0,0,.2) inset;
} }
input:disabled {background:#b6b6b6;} input:disabled {background:#b6b6b6;}
@ -1253,8 +1252,6 @@ table.liste td {padding:1px 2px 1px 0px;}
.tagtable, .table-border { display: table; } .tagtable, .table-border { display: table; }
.tagtr, .table-border-row { display: table-row; } .tagtr, .table-border-row { display: table-row; }
.tagtd, .table-border-col, .table-key-border-col, .table-val-border-col { display: table-cell; } .tagtd, .table-border-col, .table-key-border-col, .table-val-border-col { display: table-cell; }
.tagtable form, .tagtable div { display: table-row; }
.tagtable form div, .tagtable div div { display: table-cell; }
tr.liste_titre, tr.liste_titre_sel, form.liste_titre, form.liste_titre_sel tr.liste_titre, tr.liste_titre_sel, form.liste_titre, form.liste_titre_sel
{ {
@ -1285,7 +1282,6 @@ tr.box_titre td.boxclose {
tr.liste_titre td, tr.liste_titre th, form.liste_titre div { tr.liste_titre td, tr.liste_titre th, form.liste_titre div {
padding:2px; padding:2px;
padding-left:2px !important; padding-left:2px !important;
white-space:nowrap;
text-shadow:1px 1px 1px #ffffff; text-shadow:1px 1px 1px #ffffff;
} }
@ -2232,7 +2228,7 @@ ul.ulmenu {
} }
/* Style for first level menu with jmobile */ /* Style for first level menu with jmobile */
.ui-bar-b { .ui-bar-b, .lilevel0 {
background: rgb(<?php echo $colorbacktitle1; ?>); background: rgb(<?php echo $colorbacktitle1; ?>);
background-repeat: repeat-x; background-repeat: repeat-x;
<?php if ($usecss3) { ?> <?php if ($usecss3) { ?>
@ -2261,15 +2257,6 @@ ul.ulmenu {
background-image: -o-linear-gradient( #eee,#e1e1e1 ) !important; background-image: -o-linear-gradient( #eee,#e1e1e1 ) !important;
background-image: linear-gradient( #eee,#e1e1e1 ) !important; background-image: linear-gradient( #eee,#e1e1e1 ) !important;
} }
.lilevel1:hover, .lilevel2:hover, .lilevel3:hover, .lilevel4:hover {
background-image: -webkit-gradient(linear,left top,left bottom,from( #ddd ),to( #d1d1d1 )) !important;
background-image: -webkit-linear-gradient( #ddd,#d1d1d1 ) !important;
background-image: -moz-linear-gradient( #ddd,#d1d1d1 ) !important;
background-image: -ms-linear-gradient( #ddd,#d1d1d1 ) !important;
background-image: -o-linear-gradient( #ddd,#d1d1d1 ) !important;
background-image: linear-gradient( #ddd,#d1d1d1 ) !important;
}
<?php <?php

View File

@ -1364,8 +1364,6 @@ table.liste td {
.tagtable, .table-border { display: table; } .tagtable, .table-border { display: table; }
.tagtr, .table-border-row { display: table-row; } .tagtr, .table-border-row { display: table-row; }
.tagtd, .table-border-col, .table-key-border-col, .table-val-border-col { display: table-cell; } .tagtd, .table-border-col, .table-key-border-col, .table-val-border-col { display: table-cell; }
.tagtable form, .tagtable div { display: table-row; }
.tagtable form div, .tagtable div div { display: table-cell; }
tr.liste_titre, tr.liste_titre_sel, form.liste_titre, form.liste_titre_sel tr.liste_titre, tr.liste_titre_sel, form.liste_titre, form.liste_titre_sel
{ {
@ -1393,7 +1391,6 @@ div.liste_titre, tr.liste_titre, form.liste_titre
color: #FFFFFF; color: #FFFFFF;
font-family: <?php print $fontlist ?>; font-family: <?php print $fontlist ?>;
/* border-bottom: 1px solid #FDFFFF; */ /* border-bottom: 1px solid #FDFFFF; */
white-space: nowrap;
text-align: <?php echo $left; ?>; text-align: <?php echo $left; ?>;
} }
th.liste_titre, td.liste_titre th.liste_titre, td.liste_titre
@ -2434,15 +2431,6 @@ ul.ulmenu {
background-image: -o-linear-gradient( #eee,#e1e1e1 ) !important; background-image: -o-linear-gradient( #eee,#e1e1e1 ) !important;
background-image: linear-gradient( #eee,#e1e1e1 ) !important; background-image: linear-gradient( #eee,#e1e1e1 ) !important;
} }
.lilevel1:hover, .lilevel2:hover, .lilevel3:hover, .lilevel4:hover {
background-image: -webkit-gradient(linear,left top,left bottom,from( #ddd ),to( #d1d1d1 )) !important;
background-image: -webkit-linear-gradient( #ddd,#d1d1d1 ) !important;
background-image: -moz-linear-gradient( #ddd,#d1d1d1 ) !important;
background-image: -ms-linear-gradient( #ddd,#d1d1d1 ) !important;
background-image: -o-linear-gradient( #ddd,#d1d1d1 ) !important;
background-image: linear-gradient( #ddd,#d1d1d1 ) !important;
}
<?php <?php
if (is_object($db)) $db->close(); if (is_object($db)) $db->close();

View File

@ -1472,8 +1472,6 @@ table.noborder {
.tagtable, .table-border { display: table; } .tagtable, .table-border { display: table; }
.tagtr, .table-border-row { display: table-row; } .tagtr, .table-border-row { display: table-row; }
.tagtd, .table-border-col, .table-key-border-col, .table-val-border-col { display: table-cell; } .tagtd, .table-border-col, .table-key-border-col, .table-val-border-col { display: table-cell; }
.tagtable form, .tagtable div { display: table-row; }
.tagtable form div, .tagtable div div { display: table-cell; }
tr.liste_titre, form.liste_titre { tr.liste_titre, form.liste_titre {
height: 25px; height: 25px;
@ -2588,15 +2586,6 @@ ul.ulmenu {
background-image: -o-linear-gradient( #eee,#e1e1e1 ) !important; background-image: -o-linear-gradient( #eee,#e1e1e1 ) !important;
background-image: linear-gradient( #eee,#e1e1e1 ) !important; background-image: linear-gradient( #eee,#e1e1e1 ) !important;
} }
.lilevel1:hover, .lilevel2:hover, .lilevel3:hover, .lilevel4:hover {
background-image: -webkit-gradient(linear,left top,left bottom,from( #ddd ),to( #d1d1d1 )) !important;
background-image: -webkit-linear-gradient( #ddd,#d1d1d1 ) !important;
background-image: -moz-linear-gradient( #ddd,#d1d1d1 ) !important;
background-image: -ms-linear-gradient( #ddd,#d1d1d1 ) !important;
background-image: -o-linear-gradient( #ddd,#d1d1d1 ) !important;
background-image: linear-gradient( #ddd,#d1d1d1 ) !important;
}
<?php <?php

View File

@ -1500,8 +1500,6 @@ table.liste td {
.tagtable, .table-border { display: table; } .tagtable, .table-border { display: table; }
.tagtr, .table-border-row { display: table-row; } .tagtr, .table-border-row { display: table-row; }
.tagtd, .table-border-col, .table-key-border-col, .table-val-border-col { display: table-cell; } .tagtd, .table-border-col, .table-key-border-col, .table-val-border-col { display: table-cell; }
.tagtable form, .tagtable div { display: table-row; }
.tagtable form div, .tagtable div div { display: table-cell; }
tr.liste_titre, tr.liste_titre_sel, form.liste_titre, form.liste_titre_sel tr.liste_titre, tr.liste_titre_sel, form.liste_titre, form.liste_titre_sel
{ {
@ -2502,14 +2500,6 @@ ul.ulmenu {
background-image: -o-linear-gradient( #eee,#e1e1e1 ) !important; background-image: -o-linear-gradient( #eee,#e1e1e1 ) !important;
background-image: linear-gradient( #eee,#e1e1e1 ) !important; background-image: linear-gradient( #eee,#e1e1e1 ) !important;
} }
.lilevel1:hover, .lilevel2:hover, .lilevel3:hover, .lilevel4:hover {
background-image: -webkit-gradient(linear,left top,left bottom,from( #ddd ),to( #d1d1d1 )) !important;
background-image: -webkit-linear-gradient( #ddd,#d1d1d1 ) !important;
background-image: -moz-linear-gradient( #ddd,#d1d1d1 ) !important;
background-image: -ms-linear-gradient( #ddd,#d1d1d1 ) !important;
background-image: -o-linear-gradient( #ddd,#d1d1d1 ) !important;
background-image: linear-gradient( #ddd,#d1d1d1 ) !important;
}
<?php <?php

View File

@ -1727,8 +1727,6 @@ table.liste td {
.tagtable, .table-border { display: table; } .tagtable, .table-border { display: table; }
.tagtr, .table-border-row { display: table-row; } .tagtr, .table-border-row { display: table-row; }
.tagtd, .table-border-col, .table-key-border-col, .table-val-border-col { display: table-cell; } .tagtd, .table-border-col, .table-key-border-col, .table-val-border-col { display: table-cell; }
.tagtable form, .tagtable div { display: table-row; }
.tagtable form div, .tagtable div div { display: table-cell; }
tr.liste_titre, tr.liste_titre_sel, form.liste_titre, form.liste_titre_sel, table.dataTable.tr tr.liste_titre, tr.liste_titre_sel, form.liste_titre, form.liste_titre_sel, table.dataTable.tr
{ {
@ -1759,6 +1757,9 @@ tr.liste_titre th, th.liste_titre, tr.liste_titre td, td.liste_titre, form.liste
text-shadow: 1px 0px 1px #<?php echo $colorshadowtitle; ?>; text-shadow: 1px 0px 1px #<?php echo $colorshadowtitle; ?>;
vertical-align: middle; vertical-align: middle;
} }
tr.liste_titre th a, th.liste_titre a, tr.liste_titre td a, td.liste_titre a, form.liste_titre div a, div.liste_titre a {
text-shadow: none !important;
}
.liste_titre td a { .liste_titre td a {
text-shadow: none !important; text-shadow: none !important;
color: #<?php echo $colortexttitle; ?>; color: #<?php echo $colortexttitle; ?>;
@ -2855,14 +2856,6 @@ ul.ulmenu {
background-image: -o-linear-gradient( #ddd,#d1d1d1 ) !important; background-image: -o-linear-gradient( #ddd,#d1d1d1 ) !important;
background-image: linear-gradient( #ddd,#d1d1d1 ) !important; background-image: linear-gradient( #ddd,#d1d1d1 ) !important;
} }
.lilevel1:hover, .lilevel2:hover, .lilevel3:hover, .lilevel4:hover {
background-image: -webkit-gradient(linear,left top,left bottom,from( #ccc ),to( #c1c1c1 )) !important;
background-image: -webkit-linear-gradient( #ccc,#c1c1c1 ) !important;
background-image: -moz-linear-gradient( #ccc,#c1c1c1 ) !important;
background-image: -ms-linear-gradient( #ccc,#c1c1c1 ) !important;
background-image: -o-linear-gradient( #ccc,#c1c1c1 ) !important;
background-image: linear-gradient( #ccc,#c1c1c1 ) !important;
}
<?php if ($dol_use_jmobile) { ?> <?php if ($dol_use_jmobile) { ?>
.overflowwithjm200 .overflowwithjm200
{ {

View File

@ -333,8 +333,11 @@ function getProductOrService($authentication,$id='',$ref='',$ref_ext='')
{ {
$product=new Product($db); $product=new Product($db);
$result=$product->fetch($id,$ref,$ref_ext); $result=$product->fetch($id,$ref,$ref_ext);
if ($result > 0) if ($result > 0)
{ {
$product->load_stock();
$dir = (!empty($conf->product->dir_output)?$conf->product->dir_output:$conf->service->dir_output); $dir = (!empty($conf->product->dir_output)?$conf->product->dir_output:$conf->service->dir_output);
$pdir = get_exdir($product->id,2) . $product->id ."/photos/"; $pdir = get_exdir($product->id,2) . $product->id ."/photos/";
$dir = $dir . '/'. $pdir; $dir = $dir . '/'. $pdir;