Merge branch 'develop' of https://github.com/Dolibarr/dolibarr.git into develop

This commit is contained in:
Laurent Destailleur 2012-07-04 10:22:51 +02:00
commit 571041e5d5
182 changed files with 6259 additions and 5103 deletions

View File

@ -5,6 +5,7 @@ English Dolibarr ChangeLog
***** ChangeLog for 3.3 compared to 3.2 ***** ***** ChangeLog for 3.3 compared to 3.2 *****
For users: For users:
- New: Can filter list of proposal, order or invoice on sales representative.
- New: Add supplier ref on supplier orders. - New: Add supplier ref on supplier orders.
- New: Can export supplier orders. - New: Can export supplier orders.
- New: First feature to install external plugins from gui. - New: First feature to install external plugins from gui.
@ -26,6 +27,7 @@ For users:
not work with this. not work with this.
For developers: For developers:
- New: Add webservice for thirdparty creation and list.
- New: A module can overwrite templates parts. - New: A module can overwrite templates parts.
- New: Can add a link on title field of added dictionnary. - New: Can add a link on title field of added dictionnary.
- New: Uniformize code. - New: Uniformize code.
@ -39,7 +41,7 @@ to make a backup of your database before making upgrade.
For users: For users:
- New: Each user can remove/add its own boxes. - New: Each user can remove/add its own boxes.
- New: Add signature at end of predefined email text. - New: Add signature at end of predefined email text.
- New: Can use personalized fields of products/services. - New: Can use personalized fields on products/services.
- New: Can attach files on social contributions. - New: Can attach files on social contributions.
- New: Show payments terms and conditions onto muscadet template. - New: Show payments terms and conditions onto muscadet template.
- New: Can open back a closed commercial proposal. - New: Can open back a closed commercial proposal.
@ -57,7 +59,7 @@ For users:
- New: task #10606 : more comprehensive message error. - New: task #10606 : more comprehensive message error.
- New: task #11278 : Option into point of sale module to add services in list. - New: task #11278 : Option into point of sale module to add services in list.
- New: task #11261 : Add an entry into menu called "New shipment". - New: task #11261 : Add an entry into menu called "New shipment".
- New: [ task #187 ] Gerer les evenement recurrents dans les imports ical - New: [ task #187 ] Gerer les evenement recurrents dans les imports ical.
- New: Make option MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT available by default. - New: Make option MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT available by default.
- New: Can build PDF in USLetter format or canada format (change paper size). - New: Can build PDF in USLetter format or canada format (change paper size).
- New: Can export into Excel 2007 format. - New: Can export into Excel 2007 format.
@ -72,7 +74,7 @@ For users:
- New: Reduce seriously size of packages. - New: Reduce seriously size of packages.
- New: Can define country code for import. - New: Can define country code for import.
- New: When invoice was generated from order, order date is visible on PDF, after order ref. - New: When invoice was generated from order, order date is visible on PDF, after order ref.
- New: [ task #181 ] Hide password of click2dial in user card - New: [ task #181 ] Hide password of click2dial in user card.
- New: Chart are faster to build - New: Chart are faster to build
- New: Value of data into charts are visible on mouse hover. - New: Value of data into charts are visible on mouse hover.
- New: Import wizard can import contacts. - New: Import wizard can import contacts.
@ -97,6 +99,8 @@ For users:
- Fix: Sanitize input parameters. - Fix: Sanitize input parameters.
- Fix: [ bug #368 ] Product list - Fix: [ bug #368 ] Product list
- Fix: [ bug #370 ] Filter in accountancy -> suppliers_bills - Fix: [ bug #370 ] Filter in accountancy -> suppliers_bills
- Fix: [ bug #399 ] Bad calculation of local taxes in update line products
- Fix: [ bug #427 ] Bad links to wiki help in certains menus
For developers: For developers:
- New: Can add a left menu into an existing top menu or left menu. - New: Can add a left menu into an existing top menu or left menu.

View File

@ -24,7 +24,7 @@ $RPMSUBVERSION="auto"; # auto use value found into BUILD
"RPM_OPENSUSE"=>"rpmbuild", "RPM_OPENSUSE"=>"rpmbuild",
"DEB"=>"dpkg", "DEB"=>"dpkg",
"APS"=>"zip", "APS"=>"zip",
"EXEDOLIWAMP"=>"iscc.exe" "EXEDOLIWAMP"=>"ISCC.exe"
); );
%ALTERNATEPATH=( %ALTERNATEPATH=(
"7z"=>"7-ZIP", "7z"=>"7-ZIP",

View File

@ -94,8 +94,8 @@ DoliWamp is the auto-installer for Windows users with no technical knowledge to
</Program_Descriptions> </Program_Descriptions>
<Web_Info> <Web_Info>
<Application_URLs> <Application_URLs>
<Application_Info_URL>http://www.nltechno.com/pages/dolibarrwinbin.php</Application_Info_URL> <Application_Info_URL>http://www.nltechno.com/doliwamp/</Application_Info_URL>
<Application_Order_URL>http://www.nltechno.com/pages/dolibarrwinbin.php</Application_Order_URL> <Application_Order_URL>http://www.nltechno.com/doliwamp/</Application_Order_URL>
<Application_Screenshot_URL>http://www.dolibarr.org/images/dolibarr_screenshot1.png</Application_Screenshot_URL> <Application_Screenshot_URL>http://www.dolibarr.org/images/dolibarr_screenshot1.png</Application_Screenshot_URL>
<Application_Icon_URL>http://www.dolibarr.org/images/dolibarr.gif</Application_Icon_URL> <Application_Icon_URL>http://www.dolibarr.org/images/dolibarr.gif</Application_Icon_URL>
<Application_XML_File_URL>http://www.dolibarr.org/files/pad_doliwamp.xml</Application_XML_File_URL> <Application_XML_File_URL>http://www.dolibarr.org/files/pad_doliwamp.xml</Application_XML_File_URL>

View File

@ -30,7 +30,7 @@ return "Regis Houssin";
# script_dolibarr_versions() # script_dolibarr_versions()
sub script_dolibarr_versions sub script_dolibarr_versions
{ {
return ( "3.3.0", "3.2.0", "3.1.0", "3.0.1", "2.9.0" ); return ( "3.3.0", "3.2.1", "3.1.1" );
} }
sub script_dolibarr_category sub script_dolibarr_category
@ -43,13 +43,6 @@ sub script_dolibarr_php_vers
return ( 5 ); return ( 5 );
} }
sub script_dolibarr_php_vars
{
return ( [ 'memory_limit', '64M', '+' ],
[ 'upload_max_filesize', '10M', '+' ],
[ 'max_execution_time', '60', '+' ] );
}
sub script_dolibarr_php_modules sub script_dolibarr_php_modules
{ {
local ($d, $ver, $phpver, $opts) = @_; local ($d, $ver, $phpver, $opts) = @_;
@ -348,21 +341,32 @@ if ($opts->{'newdb'}) {
return (1, "Dolibarr directory and tables deleted."); return (1, "Dolibarr directory and tables deleted.");
} }
# script_dolibarr_latest(version) # script_dolibarr_realversion(&domain, &opts)
# Returns a URL and regular expression or callback func to get the version # Returns the real version number of some script install, or undef if unknown
sub script_dolibarr_latest sub script_dolibarr_realversion
{
local ($d, $opts, $sinfo) = @_;
local $lref = &read_file_lines("$opts->{'dir'}/filefunc.inc.php", 1);
foreach my $l (@$lref) {
if ($l =~ /'DOL_VERSION','([0-9a-z\.\-]+)'/) {
return $1;
}
}
return undef;
}
# script_dolibarr_check_latest(version)
# Checks if some version is the latest for this project, and if not returns
# a newer one. Otherwise returns undef.
sub script_dolibarr_check_latest
{ {
local ($ver) = @_; local ($ver) = @_;
if ($ver >= 3.0) { local @vers = &osdn_package_versions("dolibarr",
return ( "http://sourceforge.net/projects/dolibarr/files/". $ver >= 3 ? "dolibarr\\-(3\\.[0-9\\.]+)\\.tgz" :
"Dolibarr%20ERP-CRM", $ver >= 2.9 ? "dolibarr\\-(2\\.9\\.[0-9\\.]+)\\.tgz" :
"(3\\.[0-9\\.]+)" ); "dolibarr\\-(2\\.8\\.[0-9\\.]+)\\.tgz");
} return "Failed to find versions" if (!@vers);
elsif ($ver >= 2.9) { return $ver eq $vers[0] ? undef : $vers[0];
return ( "http://www.dolibarr.fr/files/stable/",
"dolibarr\\-(2\\.[0-9\\.]+)" );
}
return ( );
} }
sub script_dolibarr_site sub script_dolibarr_site

View File

@ -58,7 +58,7 @@ if (! isset($argv[1]))
if ($db->type != 'mysql' && $db->type != 'mysqli') if ($db->type != 'mysql' && $db->type != 'mysqli')
{ {
print "Error: This script works with mysql driver only\n"; print "Error: This script works with mysql or mysqli driver only\n";
exit; exit;
} }
@ -67,15 +67,10 @@ print 'Tablename='.$argv[1]."\n";
print "Current dir is ".getcwd()."\n"; print "Current dir is ".getcwd()."\n";
// Define array with list of properties
//--------------------------------
// Build skeleton_class.class.php
//--------------------------------
$table=$argv[1];
$property=array(); $property=array();
$table=$argv[1];
$foundprimary=0; $foundprimary=0;
$resql=$db->DDLDescTable($table); $resql=$db->DDLDescTable($table);
if ($resql) if ($resql)
{ {
@ -121,9 +116,32 @@ if ($resql)
else else
{ {
print "Error: Failed to get description for table '".$table."'.\n"; print "Error: Failed to get description for table '".$table."'.\n";
return false;
} }
//var_dump($property); //var_dump($property);
// Define substitute select parameters
$varpropselect="\n";
$cleanparam='';
$i=0;
foreach($property as $key => $prop)
{
$i++;
if ($prop['field'] != 'rowid')
{
$varpropselect.="\t\t\$sql.= \" ";
$varpropselect.="t.".$prop['field'];
if ($i < count($property)) $varpropselect.=",";
$varpropselect.="\";";
$varpropselect.="\n";
}
}
//--------------------------------
// Build skeleton_class.class.php
//--------------------------------
// Define working variables // Define working variables
$table=strtolower($table); $table=strtolower($table);
@ -296,22 +314,7 @@ $targetcontent=preg_replace('/\$sql.= " field1=".\(isset\(\$this->field1\)\?"\'"
$targetcontent=preg_replace('/\$sql.= " field2=".\(isset\(\$this->field2\)\?"\'".\$this->db->escape\(\$this->field2\)."\'":"null"\)."";/', '', $targetcontent); $targetcontent=preg_replace('/\$sql.= " field2=".\(isset\(\$this->field2\)\?"\'".\$this->db->escape\(\$this->field2\)."\'":"null"\)."";/', '', $targetcontent);
// Substitute select parameters // Substitute select parameters
$varprop="\n"; $targetcontent=preg_replace('/\$sql\.= " t\.field1,";/', $varpropselect, $targetcontent);
$cleanparam='';
$i=0;
foreach($property as $key => $prop)
{
$i++;
if ($prop['field'] != 'rowid')
{
$varprop.="\t\t\$sql.= \" ";
$varprop.="t.".$prop['field'];
if ($i < count($property)) $varprop.=",";
$varprop.="\";";
$varprop.="\n";
}
}
$targetcontent=preg_replace('/\$sql\.= " t\.field1,";/', $varprop, $targetcontent);
$targetcontent=preg_replace('/\$sql\.= " t\.field2";/', '', $targetcontent); $targetcontent=preg_replace('/\$sql\.= " t\.field2";/', '', $targetcontent);
// Substitute select set parameters // Substitute select set parameters
@ -405,6 +408,54 @@ if ($fp)
} }
else $error++; else $error++;
//--------------------------------
// Build skeleton_page.php
//--------------------------------
// Read skeleton_page.php file
$skeletonfile=$path.'skeleton_page.php';
$sourcecontent=file_get_contents($skeletonfile);
if (! $sourcecontent)
{
print "\n";
print "Error: Failed to read skeleton sample '".$skeletonfile."'\n";
print "Try to run script from skeletons directory.\n";
exit;
}
// Define output variables
$outfile='out.'.$classmin.'_page.php';
$targetcontent=$sourcecontent;
// Substitute class name
$targetcontent=preg_replace('/skeleton_class\.class\.php/', $classmin.'.class.php', $targetcontent);
$targetcontent=preg_replace('/skeleton_script\.php/', $classmin.'_script.php', $targetcontent);
$targetcontent=preg_replace('/\$element=\'skeleton\'/', '\$element=\''.$classmin.'\'', $targetcontent);
$targetcontent=preg_replace('/\$table_element=\'skeleton\'/', '\$table_element=\''.$classmin.'\'', $targetcontent);
$targetcontent=preg_replace('/Skeleton_Class/', $classname, $targetcontent);
$targetcontent=preg_replace('/skeleton/', $classname, $targetcontent);
// Substitute comments
$targetcontent=preg_replace('/This file is an example to create a new class file/', 'Put here description of this class', $targetcontent);
$targetcontent=preg_replace('/\s*\/\/\.\.\./', '', $targetcontent);
$targetcontent=preg_replace('/Put here some comments/','Initialy built by build_class_from_table on '.strftime('%Y-%m-%d %H:%M',mktime()), $targetcontent);
// Substitute table name
$targetcontent=preg_replace('/MAIN_DB_PREFIX."mytable/', 'MAIN_DB_PREFIX."'.$tablenoprefix, $targetcontent);
// Build file
$fp=fopen($outfile,"w");
if ($fp)
{
fputs($fp, $targetcontent);
fclose($fp);
print "File '".$outfile."' has been built in current directory.\n";
}
else $error++;
// -------------------- END OF BUILD_CLASS_FROM_TABLE SCRIPT -------------------- // -------------------- END OF BUILD_CLASS_FROM_TABLE SCRIPT --------------------
print "You can now rename generated files by removing the 'out.' prefix in their name and store them in a directory of your choice.\n"; print "You can now rename generated files by removing the 'out.' prefix in their name and store them in a directory of your choice.\n";

View File

@ -43,8 +43,8 @@ if (! $res && file_exists("../../../dolibarr/htdocs/main.inc.php")) $res=@includ
if (! $res && file_exists("../../../../dolibarr/htdocs/main.inc.php")) $res=@include("../../../../dolibarr/htdocs/main.inc.php"); // Used on dev env only if (! $res && file_exists("../../../../dolibarr/htdocs/main.inc.php")) $res=@include("../../../../dolibarr/htdocs/main.inc.php"); // Used on dev env only
if (! $res && file_exists("../../../../../dolibarr/htdocs/main.inc.php")) $res=@include("../../../../../dolibarr/htdocs/main.inc.php"); // Used on dev env only if (! $res && file_exists("../../../../../dolibarr/htdocs/main.inc.php")) $res=@include("../../../../../dolibarr/htdocs/main.inc.php"); // Used on dev env only
if (! $res) die("Include of main fails"); if (! $res) die("Include of main fails");
// Change this following line to use the correct relative path from htdocs (do not remove DOL_DOCUMENT_ROOT) // Change this following line to use the correct relative path from htdocs
require_once(DOL_DOCUMENT_ROOT."/skeleton/skeleton_class.class.php"); dol_include_once("/module/class/skeleton_class.class.php");
// Load traductions files requiredby by page // Load traductions files requiredby by page
$langs->load("companies"); $langs->load("companies");
@ -118,11 +118,57 @@ jQuery(document).ready(function() {
</script>'; </script>';
// Example 2 : Adding links to objects
// Example 2 : Adding jquery code
$somethingshown=$myobject->showLinkedObjectBlock(); $somethingshown=$myobject->showLinkedObjectBlock();
// Example 3 : List of data
if ($action == 'list')
{
$sql = "SELECT";
$sql.= " t.field1,";
$sql.= " t.field2";
$sql.= " FROM ".MAIN_DB_PREFIX."skeleton as t";
$sql.= " WHERE field3 = 'xxx'";
$sql.= " ORDER BY field1 ASC";
print '<tr class="liste_titre">';
print_liste_field_titre($langs->trans('field1'),$_SERVER['PHP_SELF'],'t.field1','',$param,'',$sortfield,$sortorder);
print_liste_field_titre($langs->trans('field2'),$_SERVER['PHP_SELF'],'t.field2','',$param,'',$sortfield,$sortorder);
print '</tr>';
dol_syslog($script_file." sql=".$sql, LOG_DEBUG);
$resql=$db->query($sql);
if ($resql)
{
$num = $db->num_rows($resql);
$i = 0;
if ($num)
{
while ($i < $num)
{
$obj = $db->fetch_object($resql);
if ($obj)
{
// You can use here results
print '<tr><td>';
print $obj->field1;
print $obj->field2;
print '</td></tr>';
}
$i++;
}
}
}
else
{
$error++;
dol_print_error($db);
}
}
// End of page // End of page
llxFooter(); llxFooter();
$db->close(); $db->close();

View File

@ -112,7 +112,7 @@ else print "Object with id ".$myobject->id." deleted\n";
// An example of a direct SQL read without using the fetch method // An example of a direct SQL read without using the fetch method
/* /*
$sql = "SELECT field1, field2"; $sql = "SELECT field1, field2";
$sql.= " FROM ".MAIN_DB_PREFIX."c_pays"; $sql.= " FROM ".MAIN_DB_PREFIX."skeleton";
$sql.= " WHERE field3 = 'xxx'"; $sql.= " WHERE field3 = 'xxx'";
$sql.= " ORDER BY field1 ASC"; $sql.= " ORDER BY field1 ASC";

View File

@ -40,7 +40,7 @@ $mesg=isset($_GET["mesg"])?'<div class="ok">'.$_GET["mesg"].'</div>':'';
$id = GETPOST('id','int'); $id = GETPOST('id','int');
// Security check // Security check
if (! $user->rights->adherent->lire) accessforbidden(); $result=restrictedArea($user,'adherent',$id);
$object = new Adherent($db); $object = new Adherent($db);
$result=$object->fetch($id); $result=$object->fetch($id);

View File

@ -184,7 +184,7 @@ class Adherent extends CommonObject
*/ */
function makeSubstitution($text) function makeSubstitution($text)
{ {
global $langs; global $conf,$langs;
$birthday = dol_print_date($this->naiss,'day'); $birthday = dol_print_date($this->naiss,'day');
@ -202,8 +202,11 @@ class Adherent extends CommonObject
$infos.= $langs->transnoentities("Town").": ".$this->town."\n"; $infos.= $langs->transnoentities("Town").": ".$this->town."\n";
$infos.= $langs->transnoentities("Country").": ".$this->country."\n"; $infos.= $langs->transnoentities("Country").": ".$this->country."\n";
$infos.= $langs->transnoentities("EMail").": ".$this->email."\n"; $infos.= $langs->transnoentities("EMail").": ".$this->email."\n";
$infos.= $langs->transnoentities("Login").": ".$this->login."\n"; if (empty($conf->global->ADHERENT_LOGIN_NOT_REQUIRED))
$infos.= $langs->transnoentities("Password").": ".$this->pass."\n"; {
$infos.= $langs->transnoentities("Login").": ".$this->login."\n";
$infos.= $langs->transnoentities("Password").": ".$this->pass."\n";
}
$infos.= $langs->transnoentities("Birthday").": ".$birthday."\n"; $infos.= $langs->transnoentities("Birthday").": ".$birthday."\n";
$infos.= $langs->transnoentities("Photo").": ".$this->photo."\n"; $infos.= $langs->transnoentities("Photo").": ".$this->photo."\n";
$infos.= $langs->transnoentities("Public").": ".yn($this->public); $infos.= $langs->transnoentities("Public").": ".yn($this->public);

View File

@ -201,8 +201,13 @@ if ($action == 'confirm_sendinfo' && $confirm == 'yes')
{ {
if ($object->email) if ($object->email)
{ {
$result=$object->send_an_email($langs->transnoentitiesnoconv("ThisIsContentOfYourCard")."\n\n%INFOS%\n\n",$langs->transnoentitiesnoconv("CardContent")); $from=$conf->email_from;
$mesg=$langs->trans("CardSent"); if ($conf->global->ADHERENT_MAIL_FROM) $from=$conf->global->ADHERENT_MAIL_FROM;
$result=$object->send_an_email($langs->transnoentitiesnoconv("ThisIsContentOfYourCard")."\n\n%INFOS%\n\n",$langs->transnoentitiesnoconv("CardContent"));
$langs->load("mails");
$mesg=$langs->trans("MailSuccessfulySent", $from, $object->email);
} }
} }
@ -1089,7 +1094,9 @@ if ($action == 'edit')
if ($rowid && $action != 'edit') if ($rowid && $action != 'edit')
{ {
/* ************************************************************************** */ dol_htmloutput_mesg($mesg);
/* ************************************************************************** */
/* */ /* */
/* Mode affichage */ /* Mode affichage */
/* */ /* */

View File

@ -255,7 +255,7 @@ if ($mode != 4)
{ {
print "<table summary=\"list_of_modules\" class=\"noborder\" width=\"100%\">\n"; print "<table summary=\"list_of_modules\" class=\"noborder\" width=\"100%\">\n";
//print "<tr class=\"liste_titre\">\n"; //print "<tr class=\"liste_titre\">\n";
print '<tr class="liste_total">'."\n"; print '<tr class="liste_titre">'."\n";
//print " <td>".$langs->trans("Family")."</td>\n"; //print " <td>".$langs->trans("Family")."</td>\n";
print " <td colspan=\"2\">".$langs->trans("Module")."</td>\n"; print " <td colspan=\"2\">".$langs->trans("Module")."</td>\n";
print " <td>".$langs->trans("Description")."</td>\n"; print " <td>".$langs->trans("Description")."</td>\n";

View File

@ -88,7 +88,7 @@ $workflow=array(
) )
); );
if (! empty($conf->modules_parts['workflow'])) $workflow = array_merge($workflow, $conf->modules_parts['workflow']); if (! empty($conf->modules_parts['workflow']) && is_array($conf->modules_parts['workflow'])) $workflow = array_merge($workflow, $conf->modules_parts['workflow']);
foreach($workflow as $child => $parents) foreach($workflow as $child => $parents)
{ {

View File

@ -365,6 +365,9 @@ if ($id > 0)
print '</tr>'; print '</tr>';
} }
// Sales representative
include(DOL_DOCUMENT_ROOT.'/societe/tpl/linesalesrepresentative.tpl.php');
// Module Adherent // Module Adherent
if ($conf->adherent->enabled) if ($conf->adherent->enabled)
{ {

View File

@ -33,6 +33,7 @@ require("../../main.inc.php");
require_once(DOL_DOCUMENT_ROOT."/core/class/html.formother.class.php"); require_once(DOL_DOCUMENT_ROOT."/core/class/html.formother.class.php");
require_once(DOL_DOCUMENT_ROOT."/core/class/html.formfile.class.php"); require_once(DOL_DOCUMENT_ROOT."/core/class/html.formfile.class.php");
require_once(DOL_DOCUMENT_ROOT."/core/class/html.formpropal.class.php"); require_once(DOL_DOCUMENT_ROOT."/core/class/html.formpropal.class.php");
require_once(DOL_DOCUMENT_ROOT."/core/lib/date.lib.php");
require_once(DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php'); require_once(DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php');
if ($conf->projet->enabled) require_once(DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'); if ($conf->projet->enabled) require_once(DOL_DOCUMENT_ROOT.'/projet/class/project.class.php');
@ -51,6 +52,7 @@ $confirm=GETPOST('confirm','alpha');
$lineid=GETPOST('lineid','int'); $lineid=GETPOST('lineid','int');
$search_user=GETPOST('search_user','int'); $search_user=GETPOST('search_user','int');
$search_sale=GETPOST('search_sale','int');
$search_ref=GETPOST('sf_ref')?GETPOST('sf_ref','alpha'):GETPOST('search_ref','alpha'); $search_ref=GETPOST('sf_ref')?GETPOST('sf_ref','alpha'):GETPOST('search_ref','alpha');
$search_refcustomer=GETPOST('search_refcustomer','alpha'); $search_refcustomer=GETPOST('search_refcustomer','alpha');
$search_societe=GETPOST('search_societe','alpha'); $search_societe=GETPOST('search_societe','alpha');
@ -105,6 +107,7 @@ if (GETPOST("button_removefilter_x"))
{ {
$search_categ=''; $search_categ='';
$search_user=''; $search_user='';
$search_sale='';
$search_ref=''; $search_ref='';
$search_refcustomer=''; $search_refcustomer='';
$search_societe=''; $search_societe='';
@ -152,7 +155,8 @@ $sql.= ' u.login';
$sql.= ' FROM '.MAIN_DB_PREFIX.'societe as s, '.MAIN_DB_PREFIX.'propal as p'; $sql.= ' FROM '.MAIN_DB_PREFIX.'societe as s, '.MAIN_DB_PREFIX.'propal as p';
if ($sall) $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'propaldet as pd ON p.rowid=pd.fk_propal'; if ($sall) $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'propaldet as pd ON p.rowid=pd.fk_propal';
$sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'user as u ON p.fk_user_author = u.rowid'; $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'user as u ON p.fk_user_author = u.rowid';
if (! $user->rights->societe->client->voir && ! $socid) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; // We'll need this table joined to the select in order to filter by sale
if ($search_sale || (! $user->rights->societe->client->voir && ! $socid)) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
if ($search_user > 0) if ($search_user > 0)
{ {
$sql.=", ".MAIN_DB_PREFIX."element_contact as c"; $sql.=", ".MAIN_DB_PREFIX."element_contact as c";
@ -160,7 +164,6 @@ if ($search_user > 0)
} }
$sql.= ' WHERE p.fk_soc = s.rowid'; $sql.= ' WHERE p.fk_soc = s.rowid';
$sql.= ' AND p.entity = '.$conf->entity; $sql.= ' AND p.entity = '.$conf->entity;
if (! $user->rights->societe->client->voir && ! $socid) //restriction if (! $user->rights->societe->client->voir && ! $socid) //restriction
{ {
$sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id; $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id;
@ -200,6 +203,7 @@ else if ($year > 0)
{ {
$sql.= " AND p.datep BETWEEN '".$db->idate(dol_get_first_day($year,1,false))."' AND '".$db->idate(dol_get_last_day($year,12,false))."'"; $sql.= " AND p.datep BETWEEN '".$db->idate(dol_get_first_day($year,1,false))."' AND '".$db->idate(dol_get_last_day($year,12,false))."'";
} }
if ($search_sale > 0) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$search_sale;
if ($search_user > 0) if ($search_user > 0)
{ {
$sql.= " AND c.fk_c_type_contact = tc.rowid AND tc.element='propal' AND tc.source='internal' AND c.element_id = p.rowid AND c.fk_socpeople = ".$search_user; $sql.= " AND c.fk_c_type_contact = tc.rowid AND tc.element='propal' AND tc.source='internal' AND c.element_id = p.rowid AND c.fk_socpeople = ".$search_user;
@ -224,13 +228,14 @@ if ($result)
} }
$param='&socid='.$socid.'&viewstatut='.$viewstatut; $param='&socid='.$socid.'&viewstatut='.$viewstatut;
if ($month) $param.='&month='.$month; if ($month) $param.='&month='.$month;
if ($year) $param.='&year='.$year; if ($year) $param.='&year='.$year;
if ($search_ref) $param.='&search_ref=' .$search_ref; if ($search_ref) $param.='&search_ref=' .$search_ref;
if ($search_refcustomer) $param.='&search_ref=' .$search_refcustomer; if ($search_refcustomer) $param.='&search_ref=' .$search_refcustomer;
if ($search_societe) $param.='&search_societe=' .$search_societe; if ($search_societe) $param.='&search_societe=' .$search_societe;
if ($search_user > 0) $param.='&search_user='.$search_user; if ($search_user > 0) $param.='&search_user='.$search_user;
if ($search_montant_ht) $param.='&search_montant_ht='.$search_montant_ht; if ($search_sale > 0) $param.='&search_sale='.$search_sale;
if ($search_montant_ht) $param.='&search_montant_ht='.$search_montant_ht;
print_barre_liste($langs->trans('ListOfProposals').' '.($socid?'- '.$soc->nom:''), $page, $_SERVER["PHP_SELF"],$param,$sortfield,$sortorder,'',$num); print_barre_liste($langs->trans('ListOfProposals').' '.($socid?'- '.$soc->nom:''), $page, $_SERVER["PHP_SELF"],$param,$sortfield,$sortorder,'',$num);
// Lignes des champs de filtre // Lignes des champs de filtre
@ -239,6 +244,13 @@ if ($result)
$i = 0; $i = 0;
print '<table class="liste" width="100%">'; print '<table class="liste" width="100%">';
// If the user can view prospects other than his'
if ($user->rights->societe->client->voir || $socid)
{
$moreforfilter.=$langs->trans('ThirdPartiesOfSaleRepresentative'). ': ';
$moreforfilter.=$formother->select_salesrepresentatives($search_sale,'search_sale',$user);
$moreforfilter.=' &nbsp; &nbsp; &nbsp; ';
}
// If the user can view prospects other than his' // If the user can view prospects other than his'
if ($user->rights->societe->client->voir || $socid) if ($user->rights->societe->client->voir || $socid)
{ {

View File

@ -41,6 +41,8 @@ $socid = GETPOST('socid','int');
if ($user->societe_id) $socid=$user->societe_id; if ($user->societe_id) $socid=$user->societe_id;
$result = restrictedArea($user, 'societe', $socid, '&societe'); $result = restrictedArea($user, 'societe', $socid, '&societe');
$object = new Prospect($db);
/* /*
* Actions * Actions
@ -55,9 +57,8 @@ if ($_GET["action"] == 'cstc')
// set prospect level // set prospect level
if ($_POST["action"] == 'setprospectlevel' && $user->rights->societe->creer) if ($_POST["action"] == 'setprospectlevel' && $user->rights->societe->creer)
{ {
$societe = new Societe($db); $object->fetch($_GET["socid"]);
$societe->fetch($_GET["socid"]); $object->fk_prospectlevel=$_POST['prospect_level_id'];
$societe->fk_prospectlevel=$_POST['prospect_level_id'];
$sql = "UPDATE ".MAIN_DB_PREFIX."societe SET fk_prospectlevel='".$_POST['prospect_level_id']; $sql = "UPDATE ".MAIN_DB_PREFIX."societe SET fk_prospectlevel='".$_POST['prospect_level_id'];
$sql.= "' WHERE rowid='".$_GET["socid"]."'"; $sql.= "' WHERE rowid='".$_GET["socid"]."'";
$result = $db->query($sql); $result = $db->query($sql);
@ -81,8 +82,7 @@ $formcompany=new FormCompany($db);
if ($socid > 0) if ($socid > 0)
{ {
$actionstatic=new ActionComm($db); $actionstatic=new ActionComm($db);
$societe = new Prospect($db, $socid); $result = $object->fetch($socid);
$result = $societe->fetch($socid);
if ($result < 0) if ($result < 0)
{ {
dol_print_error($db); dol_print_error($db);
@ -92,7 +92,7 @@ if ($socid > 0)
/* /*
* Affichage onglets * Affichage onglets
*/ */
$head = societe_prepare_head($societe); $head = societe_prepare_head($object);
dol_fiche_head($head, 'prospect', $langs->trans("ThirdParty"),0,'company'); dol_fiche_head($head, 'prospect', $langs->trans("ThirdParty"),0,'company');
@ -101,51 +101,51 @@ if ($socid > 0)
print '<table class="border" width="100%">'; print '<table class="border" width="100%">';
print '<tr><td width="25%">'.$langs->trans("ThirdPartyName").'</td><td colspan="3">'; print '<tr><td width="25%">'.$langs->trans("ThirdPartyName").'</td><td colspan="3">';
$societe->next_prev_filter="te.client in (2,3)"; $object->next_prev_filter="te.client in (2,3)";
print $form->showrefnav($societe,'socid','',($user->societe_id?0:1),'rowid','nom','',''); print $form->showrefnav($object,'socid','',($user->societe_id?0:1),'rowid','nom','','');
print '</td></tr>'; print '</td></tr>';
// Address // Address
print '<tr><td valign="top">'.$langs->trans("Address").'</td><td colspan="3">'; print '<tr><td valign="top">'.$langs->trans("Address").'</td><td colspan="3">';
dol_print_address($societe->address,'gmap','thirdparty',$societe->id); dol_print_address($object->address,'gmap','thirdparty',$object->id);
print "</td></tr>"; print "</td></tr>";
// Zip / Town // Zip / Town
print '<tr><td nowrap="nowrap">'.$langs->trans('Zip').' / '.$langs->trans("Town").'</td><td colspan="3">'.$societe->cp.(($societe->cp && $societe->ville)?' / ':'').$societe->ville.'</td>'; print '<tr><td nowrap="nowrap">'.$langs->trans('Zip').' / '.$langs->trans("Town").'</td><td colspan="3">'.$object->zip.(($object->zip && $object->town)?' / ':'').$societe->town.'</td>';
print '</tr>'; print '</tr>';
// Country // Country
print '<tr><td>'.$langs->trans("Country").'</td><td colspan="3">'; print '<tr><td>'.$langs->trans("Country").'</td><td colspan="3">';
$img=picto_from_langcode($societe->country_code); $img=picto_from_langcode($object->country_code);
if ($societe->isInEEC()) print $form->textwithpicto(($img?$img.' ':'').$societe->country,$langs->trans("CountryIsInEEC"),1,0); if ($object->isInEEC()) print $form->textwithpicto(($img?$img.' ':'').$object->country,$langs->trans("CountryIsInEEC"),1,0);
else print ($img?$img.' ':'').$societe->country; else print ($img?$img.' ':'').$object->country;
print '</td></tr>'; print '</td></tr>';
// Phone // Phone
print '<tr><td>'.$langs->trans("Phone").'</td><td style="min-width: 25%;">'.dol_print_phone($societe->tel,$societe->country_code,0,$societe->id,'AC_TEL').'</td>'; print '<tr><td>'.$langs->trans("Phone").'</td><td style="min-width: 25%;">'.dol_print_phone($object->tel,$object->country_code,0,$object->id,'AC_TEL').'</td>';
print '<td>'.$langs->trans("Fax").'</td><td style="min-width: 25%;">'.dol_print_phone($societe->fax,$societe->country_code).'</td></tr>'; print '<td>'.$langs->trans("Fax").'</td><td style="min-width: 25%;">'.dol_print_phone($object->fax,$object->country_code).'</td></tr>';
// EMail // EMail
print '<td>'.$langs->trans('EMail').'</td><td colspan="3">'.dol_print_email($societe->email,0,$societe->id,'AC_EMAIL').'</td></tr>'; print '<td>'.$langs->trans('EMail').'</td><td colspan="3">'.dol_print_email($object->email,0,$object->id,'AC_EMAIL').'</td></tr>';
// Web // Web
print '<tr><td>'.$langs->trans("Web")."</td><td colspan=\"3\"><a href=\"http://$societe->url\">$societe->url</a></td></tr>"; print '<tr><td>'.$langs->trans("Web")."</td><td colspan=\"3\"><a href=\"http://$object->url\">$object->url</a></td></tr>";
// Level of prospect // Level of prospect
print '<tr><td nowrap>'; print '<tr><td nowrap>';
print '<table width="100%" class="nobordernopadding"><tr><td nowrap>'; print '<table width="100%" class="nobordernopadding"><tr><td nowrap>';
print $langs->trans('ProspectLevelShort'); print $langs->trans('ProspectLevelShort');
print '<td>'; print '<td>';
if (($_GET['action'] != 'editlevel') && $user->rights->societe->creer) print '<td align="right"><a href="'.$_SERVER["PHP_SELF"].'?action=editlevel&amp;socid='.$societe->id.'">'.img_edit($langs->trans('SetLevel'),1).'</a></td>'; if (($_GET['action'] != 'editlevel') && $user->rights->societe->creer) print '<td align="right"><a href="'.$_SERVER["PHP_SELF"].'?action=editlevel&amp;socid='.$object->id.'">'.img_edit($langs->trans('SetLevel'),1).'</a></td>';
print '</tr></table>'; print '</tr></table>';
print '</td><td colspan="3">'; print '</td><td colspan="3">';
if ($_GET['action'] == 'editlevel') if ($_GET['action'] == 'editlevel')
{ {
$formcompany->form_prospect_level($_SERVER['PHP_SELF'].'?socid='.$societe->id,$societe->fk_prospectlevel,'prospect_level_id',1); $formcompany->form_prospect_level($_SERVER['PHP_SELF'].'?socid='.$object->id,$object->fk_prospectlevel,'prospect_level_id',1);
} }
else else
{ {
print $societe->getLibLevel(); print $object->getLibLevel();
//$formcompany->form_prospect_level($_SERVER['PHP_SELF'].'?socid='.$objsoc->id,$objsoc->mode_reglement,'none'); //$formcompany->form_prospect_level($_SERVER['PHP_SELF'].'?socid='.$objsoc->id,$objsoc->mode_reglement,'none');
} }
print "</td>"; print "</td>";
@ -160,23 +160,26 @@ if ($socid > 0)
print '<td><td align="right">'; print '<td><td align="right">';
if ($user->rights->societe->creer) if ($user->rights->societe->creer)
{ {
print '<a href="'.DOL_URL_ROOT.'/comm/multiprix.php?id='.$societe->id.'">'.img_edit($langs->trans("Modify")).'</a>'; print '<a href="'.DOL_URL_ROOT.'/comm/multiprix.php?id='.$object->id.'">'.img_edit($langs->trans("Modify")).'</a>';
} }
print '</td></tr></table>'; print '</td></tr></table>';
print '</td><td colspan="3">'.$societe->price_level."</td>"; print '</td><td colspan="3">'.$object->price_level."</td>";
print '</tr>'; print '</tr>';
} }
// Status // Status
print '<tr><td>'.$langs->trans("StatusProsp").'</td><td colspan="2">'.$societe->getLibProspStatut(4).'</td>'; print '<tr><td>'.$langs->trans("StatusProsp").'</td><td colspan="2">'.$object->getLibProspStatut(4).'</td>';
print '<td>'; print '<td>';
if ($societe->stcomm_id != -1) print '<a href="fiche.php?socid='.$societe->id.'&amp;stcomm=-1&amp;action=cstc">'.img_action(0,-1).'</a>'; if ($object->stcomm_id != -1) print '<a href="fiche.php?socid='.$object->id.'&amp;stcomm=-1&amp;action=cstc">'.img_action(0,-1).'</a>';
if ($societe->stcomm_id != 0) print '<a href="fiche.php?socid='.$societe->id.'&amp;stcomm=0&amp;action=cstc">'.img_action(0,0).'</a>'; if ($object->stcomm_id != 0) print '<a href="fiche.php?socid='.$object->id.'&amp;stcomm=0&amp;action=cstc">'.img_action(0,0).'</a>';
if ($societe->stcomm_id != 1) print '<a href="fiche.php?socid='.$societe->id.'&amp;stcomm=1&amp;action=cstc">'.img_action(0,1).'</a>'; if ($object->stcomm_id != 1) print '<a href="fiche.php?socid='.$object->id.'&amp;stcomm=1&amp;action=cstc">'.img_action(0,1).'</a>';
if ($societe->stcomm_id != 2) print '<a href="fiche.php?socid='.$societe->id.'&amp;stcomm=2&amp;action=cstc">'.img_action(0,2).'</a>'; if ($object->stcomm_id != 2) print '<a href="fiche.php?socid='.$object->id.'&amp;stcomm=2&amp;action=cstc">'.img_action(0,2).'</a>';
if ($societe->stcomm_id != 3) print '<a href="fiche.php?socid='.$societe->id.'&amp;stcomm=3&amp;action=cstc">'.img_action(0,3).'</a>'; if ($object->stcomm_id != 3) print '<a href="fiche.php?socid='.$object->id.'&amp;stcomm=3&amp;action=cstc">'.img_action(0,3).'</a>';
print '</td></tr>'; print '</td></tr>';
// Sales representative
include(DOL_DOCUMENT_ROOT.'/societe/tpl/linesalesrepresentative.tpl.php');
// Module Adherent // Module Adherent
if ($conf->adherent->enabled) if ($conf->adherent->enabled)
{ {
@ -185,7 +188,7 @@ if ($socid > 0)
print '<tr><td width="25%" valign="top">'.$langs->trans("LinkedToDolibarrMember").'</td>'; print '<tr><td width="25%" valign="top">'.$langs->trans("LinkedToDolibarrMember").'</td>';
print '<td colspan="3">'; print '<td colspan="3">';
$adh=new Adherent($db); $adh=new Adherent($db);
$result=$adh->fetch('','',$societe->id); $result=$adh->fetch('','',$object->id);
if ($result > 0) if ($result > 0)
{ {
$adh->ref=$adh->getFullName($langs); $adh->ref=$adh->getFullName($langs);
@ -213,7 +216,7 @@ if ($socid > 0)
print '<table class="noborder" width="100%">'; print '<table class="noborder" width="100%">';
print '<tr class="liste_titre">'; print '<tr class="liste_titre">';
print '<td colspan="4"><table width="100%" class="nobordernopadding"><tr><td>'.$langs->trans("Summary").'</td>'; print '<td colspan="4"><table width="100%" class="nobordernopadding"><tr><td>'.$langs->trans("Summary").'</td>';
print '<td align="right"><a href="'.DOL_URL_ROOT.'/comm/prospect/recap-prospect.php?socid='.$societe->id.'">'.$langs->trans("ShowProspectPreview").'</a></td></tr></table></td>'; print '<td align="right"><a href="'.DOL_URL_ROOT.'/comm/prospect/recap-prospect.php?socid='.$object->id.'">'.$langs->trans("ShowProspectPreview").'</a></td></tr></table></td>';
print '</tr>'; print '</tr>';
print '</table>'; print '</table>';
print '<br>'; print '<br>';
@ -235,7 +238,7 @@ if ($socid > 0)
$sql.= " WHERE p.fk_soc = s.rowid"; $sql.= " WHERE p.fk_soc = s.rowid";
$sql.= " AND p.fk_statut = c.id"; $sql.= " AND p.fk_statut = c.id";
$sql.= " AND p.entity = ".$conf->entity; $sql.= " AND p.entity = ".$conf->entity;
$sql.= " AND s.rowid = ".$societe->id; $sql.= " AND s.rowid = ".$object->id;
$sql.= " ORDER BY p.datep DESC"; $sql.= " ORDER BY p.datep DESC";
$resql=$db->query($sql); $resql=$db->query($sql);
@ -249,8 +252,8 @@ if ($socid > 0)
{ {
print '<table class="noborder" width="100%">'; print '<table class="noborder" width="100%">';
print '<tr class="liste_titre">'; print '<tr class="liste_titre">';
print '<td colspan="4"><table width="100%" class="nobordernopadding"><tr><td>'.$langs->trans("LastPropals",($num<=$MAXLIST?"":$MAXLIST)).'</td><td align="right"><a href="'.DOL_URL_ROOT.'/comm/propal.php?socid='.$societe->id.'">'.$langs->trans("AllPropals").' ('.$num.')</a></td>'; print '<td colspan="4"><table width="100%" class="nobordernopadding"><tr><td>'.$langs->trans("LastPropals",($num<=$MAXLIST?"":$MAXLIST)).'</td><td align="right"><a href="'.DOL_URL_ROOT.'/comm/propal.php?socid='.$object->id.'">'.$langs->trans("AllPropals").' ('.$num.')</a></td>';
print '<td width="20px" align="right"><a href="'.DOL_URL_ROOT.'/comm/propal/stats/index.php?socid='.$societe->id.'">'.img_picto($langs->trans("Statistics"),'stats').'</a></td>'; print '<td width="20px" align="right"><a href="'.DOL_URL_ROOT.'/comm/propal/stats/index.php?socid='.$object->id.'">'.img_picto($langs->trans("Statistics"),'stats').'</a></td>';
print '</tr></table></td>'; print '</tr></table></td>';
print '</tr>'; print '</tr>';
} }
@ -296,7 +299,7 @@ if ($socid > 0)
if ($conf->propal->enabled && $user->rights->propale->creer) if ($conf->propal->enabled && $user->rights->propale->creer)
{ {
print '<a class="butAction" href="'.DOL_URL_ROOT.'/comm/addpropal.php?socid='.$societe->id.'&amp;action=create">'.$langs->trans("AddProp").'</a>'; print '<a class="butAction" href="'.DOL_URL_ROOT.'/comm/addpropal.php?socid='.$object->id.'&amp;action=create">'.$langs->trans("AddProp").'</a>';
} }
// Add action // Add action
@ -304,7 +307,7 @@ if ($socid > 0)
{ {
if ($user->rights->agenda->myactions->create) if ($user->rights->agenda->myactions->create)
{ {
print '<a class="butAction" href="'.DOL_URL_ROOT.'/comm/action/fiche.php?action=create&socid='.$societe->id.'">'.$langs->trans("AddAction").'</a>'; print '<a class="butAction" href="'.DOL_URL_ROOT.'/comm/action/fiche.php?action=create&socid='.$object->id.'">'.$langs->trans("AddAction").'</a>';
} }
else else
{ {
@ -321,7 +324,7 @@ if ($socid > 0)
{ {
print '<br>'; print '<br>';
// List of contacts // List of contacts
show_contacts($conf,$langs,$db,$societe,$_SERVER["PHP_SELF"].'?socid='.$societe->id); show_contacts($conf,$langs,$db,$object,$_SERVER["PHP_SELF"].'?socid='.$object->id);
} }
if (! empty($conf->global->MAIN_REPEATTASKONEACHTAB)) if (! empty($conf->global->MAIN_REPEATTASKONEACHTAB))
@ -329,10 +332,10 @@ if ($socid > 0)
print load_fiche_titre($langs->trans("ActionsOnCompany"),'',''); print load_fiche_titre($langs->trans("ActionsOnCompany"),'','');
// List of todo actions // List of todo actions
show_actions_todo($conf,$langs,$db,$societe); show_actions_todo($conf,$langs,$db,$object);
// List of done actions // List of done actions
show_actions_done($conf,$langs,$db,$societe); show_actions_done($conf,$langs,$db,$object);
} }
} }

View File

@ -159,7 +159,7 @@ if ($_GET["action"] == 'cstc')
* View * View
*/ */
$htmlother=new FormOther($db); $formother=new FormOther($db);
$sql = "SELECT s.rowid, s.nom, s.ville, s.datec, s.datea, s.status as status,"; $sql = "SELECT s.rowid, s.nom, s.ville, s.datec, s.datea, s.status as status,";
$sql.= " st.libelle as stcomm, s.prefix_comm, s.fk_stcomm, s.fk_prospectlevel,"; $sql.= " st.libelle as stcomm, s.prefix_comm, s.fk_stcomm, s.fk_prospectlevel,";
@ -271,14 +271,14 @@ if ($resql)
if ($conf->categorie->enabled) if ($conf->categorie->enabled)
{ {
$moreforfilter.=$langs->trans('Categories'). ': '; $moreforfilter.=$langs->trans('Categories'). ': ';
$moreforfilter.=$htmlother->select_categories(2,$search_categ,'search_categ'); $moreforfilter.=$formother->select_categories(2,$search_categ,'search_categ');
$moreforfilter.=' &nbsp; &nbsp; &nbsp; '; $moreforfilter.=' &nbsp; &nbsp; &nbsp; ';
} }
// If the user can view prospects other than his' // If the user can view prospects other than his'
if ($user->rights->societe->client->voir || $socid) if ($user->rights->societe->client->voir || $socid)
{ {
$moreforfilter.=$langs->trans('SalesRepresentatives'). ': '; $moreforfilter.=$langs->trans('SalesRepresentatives'). ': ';
$moreforfilter.=$htmlother->select_salesrepresentatives($search_sale,'search_sale',$user); $moreforfilter.=$formother->select_salesrepresentatives($search_sale,'search_sale',$user);
} }
if ($moreforfilter) if ($moreforfilter)
{ {

View File

@ -27,7 +27,8 @@
require("../main.inc.php"); require("../main.inc.php");
require_once(DOL_DOCUMENT_ROOT."/core/class/html.formfile.class.php"); require_once(DOL_DOCUMENT_ROOT."/core/class/html.formfile.class.php");
require_once(DOL_DOCUMENT_ROOT ."/commande/class/commande.class.php"); require_once(DOL_DOCUMENT_ROOT."/core/class/html.formother.class.php");
require_once(DOL_DOCUMENT_ROOT."/commande/class/commande.class.php");
$langs->load('orders'); $langs->load('orders');
$langs->load('deliveries'); $langs->load('deliveries');
@ -43,6 +44,7 @@ $snom=GETPOST('snom','alpha');
$sall=GETPOST('sall'); $sall=GETPOST('sall');
$socid=GETPOST('socid','int'); $socid=GETPOST('socid','int');
$search_user=GETPOST('search_user','int'); $search_user=GETPOST('search_user','int');
$search_sale=GETPOST('search_sale','int');
// Security check // Security check
$id = (GETPOST('orderid')?GETPOST('orderid'):GETPOST('id','int')); $id = (GETPOST('orderid')?GETPOST('orderid'):GETPOST('id','int'));
@ -63,6 +65,25 @@ $limit = $conf->liste_limit;
$viewstatut=GETPOST('viewstatut'); $viewstatut=GETPOST('viewstatut');
/*
* Actions
*/
// Do we click on purge search criteria ?
if (GETPOST("button_removefilter_x"))
{
$search_categ='';
$search_user='';
$search_sale='';
$search_ref='';
$search_refcustomer='';
$search_societe='';
$search_montant_ht='';
$year='';
$month='';
}
/* /*
* View * View
@ -71,6 +92,7 @@ $viewstatut=GETPOST('viewstatut');
$now=dol_now(); $now=dol_now();
$form = new Form($db); $form = new Form($db);
$formother = new FormOther($db);
$formfile = new FormFile($db); $formfile = new FormFile($db);
$companystatic = new Societe($db); $companystatic = new Societe($db);
@ -80,7 +102,8 @@ $sql = 'SELECT s.nom, s.rowid as socid, s.client, c.rowid, c.ref, c.total_ht, c.
$sql.= ' c.date_valid, c.date_commande, c.date_livraison, c.fk_statut, c.facture as facturee'; $sql.= ' c.date_valid, c.date_commande, c.date_livraison, c.fk_statut, c.facture as facturee';
$sql.= ' FROM '.MAIN_DB_PREFIX.'societe as s'; $sql.= ' FROM '.MAIN_DB_PREFIX.'societe as s';
$sql.= ', '.MAIN_DB_PREFIX.'commande as c'; $sql.= ', '.MAIN_DB_PREFIX.'commande as c';
if (!$user->rights->societe->client->voir && !$socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; // We'll need this table joined to the select in order to filter by sale
if ($search_sale > 0 || (! $user->rights->societe->client->voir && ! $socid)) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
if ($search_user > 0) if ($search_user > 0)
{ {
$sql.=", ".MAIN_DB_PREFIX."element_contact as ec"; $sql.=", ".MAIN_DB_PREFIX."element_contact as ec";
@ -152,6 +175,7 @@ if (!empty($sref_client))
{ {
$sql.= ' AND c.ref_client LIKE \'%'.$db->escape($sref_client).'%\''; $sql.= ' AND c.ref_client LIKE \'%'.$db->escape($sref_client).'%\'';
} }
if ($search_sale > 0) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$search_sale;
if ($search_user > 0) if ($search_user > 0)
{ {
$sql.= " AND ec.fk_c_type_contact = tc.rowid AND tc.element='commande' AND tc.source='internal' AND ec.element_id = c.rowid AND ec.fk_socpeople = ".$search_user; $sql.= " AND ec.fk_c_type_contact = tc.rowid AND tc.element='commande' AND tc.source='internal' AND ec.element_id = c.rowid AND ec.fk_socpeople = ".$search_user;
@ -190,12 +214,13 @@ if ($resql)
$title.=' - '.$langs->trans('StatusOrderToProcessShort'); $title.=' - '.$langs->trans('StatusOrderToProcessShort');
$param='&socid='.$socid.'&viewstatut='.$viewstatut; $param='&socid='.$socid.'&viewstatut='.$viewstatut;
if ($month) $param.='&month='.$month; if ($month) $param.='&month='.$month;
if ($year) $param.='&year='.$year; if ($year) $param.='&year='.$year;
if ($sref) $param.='&sref='.$sref; if ($sref) $param.='&sref='.$sref;
if ($snom) $param.='&snom='.$snom; if ($snom) $param.='&snom='.$snom;
if ($sref_client) $param.='&sref_client='.$sref_client; if ($sref_client) $param.='&sref_client='.$sref_client;
if ($search_user > 0) $param.='&search_user='.$search_user; if ($search_user > 0) $param.='&search_user='.$search_user;
if ($search_sale > 0) $param.='&search_sale='.$search_sale;
$num = $db->num_rows($resql); $num = $db->num_rows($resql);
print_barre_liste($title, $page,$_SERVER["PHP_SELF"],$param,$sortfield,$sortorder,'',$num); print_barre_liste($title, $page,$_SERVER["PHP_SELF"],$param,$sortfield,$sortorder,'',$num);
@ -206,6 +231,13 @@ if ($resql)
print '<table class="noborder" width="100%">'; print '<table class="noborder" width="100%">';
// If the user can view prospects other than his'
if ($user->rights->societe->client->voir || $socid)
{
$moreforfilter.=$langs->trans('ThirdPartiesOfSaleRepresentative'). ': ';
$moreforfilter.=$formother->select_salesrepresentatives($search_sale,'search_sale',$user);
$moreforfilter.=' &nbsp; &nbsp; &nbsp; ';
}
// If the user can view prospects other than his' // If the user can view prospects other than his'
if ($user->rights->societe->client->voir || $socid) if ($user->rights->societe->client->voir || $socid)
{ {

View File

@ -268,6 +268,7 @@ if ($resql)
print_liste_field_titre($langs->trans("AmountHT"),$_SERVER["PHP_SELF"],"f.total","",$param,'align="right"',$sortfield,$sortorder); print_liste_field_titre($langs->trans("AmountHT"),$_SERVER["PHP_SELF"],"f.total","",$param,'align="right"',$sortfield,$sortorder);
print_liste_field_titre($langs->trans("AmountTTC"),$_SERVER["PHP_SELF"],"f.total_ttc","",$param,'align="right"',$sortfield,$sortorder); print_liste_field_titre($langs->trans("AmountTTC"),$_SERVER["PHP_SELF"],"f.total_ttc","",$param,'align="right"',$sortfield,$sortorder);
print_liste_field_titre($langs->trans("Received"),$_SERVER["PHP_SELF"],"am","",$param,'align="right"',$sortfield,$sortorder); print_liste_field_titre($langs->trans("Received"),$_SERVER["PHP_SELF"],"am","",$param,'align="right"',$sortfield,$sortorder);
print_liste_field_titre($langs->trans("Rest"),$_SERVER["PHP_SELF"],"am","",$param,'align="right"',$sortfield,$sortorder);
print_liste_field_titre($langs->trans("Status"),$_SERVER["PHP_SELF"],"fk_statut,paye,am","",$param,'align="right"',$sortfield,$sortorder); print_liste_field_titre($langs->trans("Status"),$_SERVER["PHP_SELF"],"fk_statut,paye,am","",$param,'align="right"',$sortfield,$sortorder);
print_liste_field_titre($langs->trans("Merge"),$_SERVER["PHP_SELF"],"","",$param,'align="center"',$sortfield,$sortorder); print_liste_field_titre($langs->trans("Merge"),$_SERVER["PHP_SELF"],"","",$param,'align="center"',$sortfield,$sortorder);
print "</tr>\n"; print "</tr>\n";
@ -286,7 +287,7 @@ if ($resql)
print '<input class="flat" type="text" size="10" name="search_montant_ht" value="'.$search_montant_ht.'">'; print '<input class="flat" type="text" size="10" name="search_montant_ht" value="'.$search_montant_ht.'">';
print '</td><td class="liste_titre" align="right">'; print '</td><td class="liste_titre" align="right">';
print '<input class="flat" type="text" size="10" name="search_montant_ttc" value="'.$search_montant_ttc.'">'; print '<input class="flat" type="text" size="10" name="search_montant_ttc" value="'.$search_montant_ttc.'">';
print '</td><td class="liste_titre" colspan="2" align="right">'; print '</td><td class="liste_titre" colspan="3" 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")).'">';
print '</td>'; print '</td>';
print '<td class="liste_titre" align="center">'; print '<td class="liste_titre" align="center">';
@ -354,6 +355,10 @@ if ($resql)
print '<td align="right">'.price($objp->total_ht).'</td>'; print '<td align="right">'.price($objp->total_ht).'</td>';
print '<td align="right">'.price($objp->total_ttc).'</td>'; print '<td align="right">'.price($objp->total_ttc).'</td>';
print '<td align="right">'.price($objp->am).'</td>'; print '<td align="right">'.price($objp->am).'</td>';
if ($objp->am==0)
{ print '<td align="right"></td>'; }
else
{ print '<td align="right">'.price($objp->total_ttc-$objp->am).'</td>'; }
// Affiche statut de la facture // Affiche statut de la facture
print '<td align="right" nowrap="nowrap">'; print '<td align="right" nowrap="nowrap">';

View File

@ -112,7 +112,19 @@ $now=dol_now();
$parameters=array('socid'=>$socid); $parameters=array('socid'=>$socid);
$reshook=$hookmanager->executeHooks('doActions',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks $reshook=$hookmanager->executeHooks('doActions',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks
// None // Do we click on purge search criteria ?
if (GETPOST("button_removefilter_x"))
{
$search_categ='';
$search_user='';
$search_sale='';
$search_ref='';
$search_refcustomer='';
$search_societe='';
$search_montant_ht='';
$year='';
$month='';
}
/* /*
@ -122,7 +134,7 @@ $reshook=$hookmanager->executeHooks('doActions',$parameters,$object,$action);
llxHeader('',$langs->trans('Bill'),'EN:Customers_Invoices|FR:Factures_Clients|ES:Facturas_a_clientes'); llxHeader('',$langs->trans('Bill'),'EN:Customers_Invoices|FR:Factures_Clients|ES:Facturas_a_clientes');
$form = new Form($db); $form = new Form($db);
$htmlother = new FormOther($db); $formother = new FormOther($db);
$formfile = new FormFile($db); $formfile = new FormFile($db);
$bankaccountstatic=new Account($db); $bankaccountstatic=new Account($db);
$facturestatic=new Facture($db); $facturestatic=new Facture($db);
@ -135,10 +147,11 @@ $sql.= ' f.paye as paye, f.fk_statut, f.note,';
$sql.= ' s.nom, s.rowid as socid'; $sql.= ' s.nom, s.rowid as socid';
if (! $sall) $sql.= ', SUM(pf.amount) as am'; // To be able to sort on status if (! $sall) $sql.= ', SUM(pf.amount) as am'; // To be able to sort on status
$sql.= ' FROM '.MAIN_DB_PREFIX.'societe as s'; $sql.= ' FROM '.MAIN_DB_PREFIX.'societe as s';
if (! $user->rights->societe->client->voir && ! $socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
$sql.= ', '.MAIN_DB_PREFIX.'facture as f'; $sql.= ', '.MAIN_DB_PREFIX.'facture as f';
if (! $sall) $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'paiement_facture as pf ON pf.fk_facture = f.rowid'; if (! $sall) $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'paiement_facture as pf ON pf.fk_facture = f.rowid';
else $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'facturedet as fd ON fd.fk_facture = f.rowid'; else $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'facturedet as fd ON fd.fk_facture = f.rowid';
// We'll need this table joined to the select in order to filter by sale
if ($search_sale > 0 || (! $user->rights->societe->client->voir && ! $socid)) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
if ($search_user > 0) if ($search_user > 0)
{ {
$sql.=", ".MAIN_DB_PREFIX."element_contact as ec"; $sql.=", ".MAIN_DB_PREFIX."element_contact as ec";
@ -191,6 +204,7 @@ else if ($year > 0)
{ {
$sql.= " AND f.datef BETWEEN '".$db->idate(dol_get_first_day($year,1,false))."' AND '".$db->idate(dol_get_last_day($year,12,false))."'"; $sql.= " AND f.datef BETWEEN '".$db->idate(dol_get_first_day($year,1,false))."' AND '".$db->idate(dol_get_last_day($year,12,false))."'";
} }
if ($search_sale > 0) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$search_sale;
if ($search_user > 0) if ($search_user > 0)
{ {
$sql.= " AND ec.fk_c_type_contact = tc.rowid AND tc.element='facture' AND tc.source='internal' AND ec.element_id = f.rowid AND ec.fk_socpeople = ".$search_user; $sql.= " AND ec.fk_c_type_contact = tc.rowid AND tc.element='facture' AND tc.source='internal' AND ec.element_id = f.rowid AND ec.fk_socpeople = ".$search_user;
@ -199,7 +213,7 @@ if (! $sall)
{ {
$sql.= ' GROUP BY f.rowid, f.facnumber, f.type, f.increment, f.total, f.total_ttc,'; $sql.= ' GROUP BY f.rowid, f.facnumber, f.type, f.increment, f.total, f.total_ttc,';
$sql.= ' f.datef, f.date_lim_reglement,'; $sql.= ' f.datef, f.date_lim_reglement,';
$sql.= ' f.paye, f.fk_statut,'; $sql.= ' f.paye, f.fk_statut, f.note,';
$sql.= ' s.nom, s.rowid'; $sql.= ' s.nom, s.rowid';
} }
else else
@ -225,11 +239,12 @@ if ($resql)
} }
$param='&socid='.$socid; $param='&socid='.$socid;
if ($month) $param.='&month='.$month; if ($month) $param.='&month='.$month;
if ($year) $param.='&year=' .$year; if ($year) $param.='&year=' .$year;
if ($search_ref) $param.='&search_ref=' .$search_ref; if ($search_ref) $param.='&search_ref=' .$search_ref;
if ($search_societe) $param.='&search_societe=' .$search_societe; if ($search_societe) $param.='&search_societe=' .$search_societe;
if ($search_user > 0) $param.='&search_user=' .$search_user; if ($search_sale > 0) $param.='&search_sale=' .$search_sale;
if ($search_user > 0) $param.='&search_user=' .$search_user;
if ($search_montant_ht) $param.='&search_montant_ht='.$search_montant_ht; if ($search_montant_ht) $param.='&search_montant_ht='.$search_montant_ht;
if ($search_montant_ttc) $param.='&search_montant_ttc='.$search_montant_ttc; if ($search_montant_ttc) $param.='&search_montant_ttc='.$search_montant_ttc;
print_barre_liste($langs->trans('BillsCustomers').' '.($socid?' '.$soc->nom:''),$page,$_SERVER["PHP_SELF"],$param,$sortfield,$sortorder,'',$num); print_barre_liste($langs->trans('BillsCustomers').' '.($socid?' '.$soc->nom:''),$page,$_SERVER["PHP_SELF"],$param,$sortfield,$sortorder,'',$num);
@ -238,6 +253,13 @@ if ($resql)
print '<form method="GET" action="'.$_SERVER["PHP_SELF"].'">'."\n"; print '<form method="GET" action="'.$_SERVER["PHP_SELF"].'">'."\n";
print '<table class="liste" width="100%">'; print '<table class="liste" width="100%">';
// If the user can view prospects other than his'
if ($user->rights->societe->client->voir || $socid)
{
$moreforfilter.=$langs->trans('ThirdPartiesOfSaleRepresentative'). ': ';
$moreforfilter.=$formother->select_salesrepresentatives($search_sale,'search_sale',$user);
$moreforfilter.=' &nbsp; &nbsp; &nbsp; ';
}
// If the user can view prospects other than his' // If the user can view prospects other than his'
if ($user->rights->societe->client->voir || $socid) if ($user->rights->societe->client->voir || $socid)
{ {
@ -272,7 +294,7 @@ if ($resql)
print '<td class="liste_titre" align="center">'; print '<td class="liste_titre" align="center">';
if (! empty($conf->global->MAIN_LIST_FILTER_ON_DAY)) print '<input class="flat" type="text" size="1" maxlength="2" name="day" value="'.$day.'">'; if (! empty($conf->global->MAIN_LIST_FILTER_ON_DAY)) print '<input class="flat" type="text" size="1" maxlength="2" name="day" value="'.$day.'">';
print '<input class="flat" type="text" size="1" maxlength="2" name="month" value="'.$month.'">'; print '<input class="flat" type="text" size="1" maxlength="2" name="month" value="'.$month.'">';
$htmlother->select_year($year?$year:-1,'year',1, 20, 5); $formother->select_year($year?$year:-1,'year',1, 20, 5);
print '</td>'; print '</td>';
print '<td class="liste_titre" align="left">&nbsp;</td>'; print '<td class="liste_titre" align="left">&nbsp;</td>';
print '<td class="liste_titre" align="left">'; print '<td class="liste_titre" align="left">';

View File

@ -1013,7 +1013,7 @@ class Contact extends CommonObject
// Initialise parameters // Initialise parameters
$this->id=0; $this->id=0;
$this->specimen=1; $this->specimen=1;
$this->name = 'DOLIBARR'; $this->lastname = 'DOLIBARR';
$this->firstname = 'SPECIMEN'; $this->firstname = 'SPECIMEN';
$this->address = '61 jump street'; $this->address = '61 jump street';
$this->zip = '75000'; $this->zip = '75000';

View File

@ -137,8 +137,6 @@ if (empty($reshook))
$object->address = $_POST["address"]; $object->address = $_POST["address"];
$object->zip = $_POST["zipcode"]; $object->zip = $_POST["zipcode"];
$object->town = $_POST["town"]; $object->town = $_POST["town"];
$object->fk_pays = $_POST["country_id"];
$object->fk_departement = $_POST["departement_id"];
$object->country_id = $_POST["country_id"]; $object->country_id = $_POST["country_id"];
$object->state_id = $_POST["departement_id"]; $object->state_id = $_POST["departement_id"];
$object->email = $_POST["email"]; $object->email = $_POST["email"];
@ -229,8 +227,6 @@ if (empty($reshook))
$object->address = $_POST["address"]; $object->address = $_POST["address"];
$object->zip = $_POST["zipcode"]; $object->zip = $_POST["zipcode"];
$object->town = $_POST["town"]; $object->town = $_POST["town"];
$object->fk_departement = $_POST["departement_id"];
$object->fk_pays = $_POST["country_id"];
$object->state_id = $_POST["departement_id"]; $object->state_id = $_POST["departement_id"];
$object->country_id = $_POST["country_id"]; $object->country_id = $_POST["country_id"];
@ -338,15 +334,13 @@ else
*/ */
$object->canvas=$canvas; $object->canvas=$canvas;
$object->fk_departement = $_POST["departement_id"]; $object->state_id = $_POST["state_id"];
// We set country_id, country_code and label for the selected country // We set country_id, country_code and label for the selected country
$object->country_id=$_POST["country_id"]?$_POST["country_id"]:$mysoc->country_id; $object->country_id=$_POST["country_id"]?$_POST["country_id"]:$mysoc->country_id;
if ($object->country_id) if ($object->country_id)
{ {
$tmparray=getCountry($object->country_id,'all'); $tmparray=getCountry($object->country_id,'all');
$object->pays_code = $tmparray['code'];
$object->pays = $tmparray['label'];
$object->country_code = $tmparray['code']; $object->country_code = $tmparray['code'];
$object->country = $tmparray['label']; $object->country = $tmparray['label'];
} }
@ -414,8 +408,8 @@ else
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="3">'; print '<tr><td>'.$langs->trans("Zip").' / '.$langs->trans("Town").'</td><td colspan="3">';
print $formcompany->select_ziptown((isset($_POST["zipcode"])?$_POST["zipcode"]:$object->zip),'zipcode',array('town','selectcountry_id','departement_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','departement_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
@ -431,7 +425,7 @@ else
print '<tr><td>'.$langs->trans('State').'</td><td colspan="3">'; print '<tr><td>'.$langs->trans('State').'</td><td colspan="3">';
if ($object->country_id) if ($object->country_id)
{ {
print $formcompany->select_state(isset($_POST["departement_id"])?$_POST["departement_id"]:$object->fk_departement,$object->country_code); print $formcompany->select_state(isset($_POST["state_id"])?$_POST["state_id"]:$object->state_id,$object->country_code,'state_id');
} }
else else
{ {
@ -583,8 +577,8 @@ else
// Zip / Town // Zip / Town
print '<tr><td>'.$langs->trans("Zip").' / '.$langs->trans("Town").'</td><td colspan="3">'; print '<tr><td>'.$langs->trans("Zip").' / '.$langs->trans("Town").'</td><td colspan="3">';
print $formcompany->select_ziptown((isset($_POST["zipcode"])?$_POST["zipcode"]:$object->zip),'zipcode',array('town','selectcountry_id','departement_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','departement_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
@ -597,7 +591,7 @@ else
if (empty($conf->global->SOCIETE_DISABLE_STATE)) if (empty($conf->global->SOCIETE_DISABLE_STATE))
{ {
print '<tr><td>'.$langs->trans('State').'</td><td colspan="3">'; print '<tr><td>'.$langs->trans('State').'</td><td colspan="3">';
print $formcompany->select_state($object->fk_departement,isset($_POST["country_id"])?$_POST["country_id"]:$object->country_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>';
} }
@ -785,7 +779,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="3">'.$object->departement.'</td>'; print '<tr><td>'.$langs->trans('State').'</td><td colspan="3">'.$object->state.'</td>';
} }
// Phone // Phone

View File

@ -31,7 +31,8 @@ if (! defined('NOREQUIREMENU')) define('NOREQUIREMENU','1');
if (! defined('NOREQUIREHTML')) define('NOREQUIREHTML','1'); if (! defined('NOREQUIREHTML')) define('NOREQUIREHTML','1');
if (! defined('NOREQUIREAJAX')) define('NOREQUIREAJAX','1'); if (! defined('NOREQUIREAJAX')) define('NOREQUIREAJAX','1');
if (! isset($mode) || $mode != 'noajax')
if (! isset($mode) || $mode != 'noajax') // For ajax call
{ {
require_once("../../main.inc.php"); require_once("../../main.inc.php");
require_once(DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'); require_once(DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php');
@ -54,7 +55,7 @@ if (! isset($mode) || $mode != 'noajax')
exit; exit;
} }
} }
else else // For no ajax call
{ {
$ecmdir = new EcmDirectory($db); $ecmdir = new EcmDirectory($db);
$relativepath=''; $relativepath='';
@ -124,11 +125,11 @@ if (! dol_is_dir($upload_dir))
} }
print '<!-- TYPE='.$type.' -->'."\n"; print '<!-- TYPE='.$type.' -->'."\n";
print '<!-- Ajax page called with url '.$_SERVER["PHP_SELF"].'?'.$_SERVER["QUERY_STRING"].' -->'."\n"; print '<!-- Page called with mode='.$mode.' url='.$_SERVER["PHP_SELF"].'?'.$_SERVER["QUERY_STRING"].' -->'."\n";
$param=''; $param='';
// Dir // Dir scan
if ($type == 'directory') if ($type == 'directory')
{ {
$formfile=new FormFile($db); $formfile=new FormFile($db);
@ -136,7 +137,7 @@ if ($type == 'directory')
$param.=($sortfield?'&sortfield='.$sortfield:'').($sortorder?'&sortorder='.$sortorder:''); $param.=($sortfield?'&sortfield='.$sortfield:'').($sortorder?'&sortorder='.$sortorder:'');
$maxlengthname=40; $maxlengthname=40;
// Right area // Right area. If module is defined, we are in automatic ecm.
if ($module == 'company') // Auto area for suppliers invoices if ($module == 'company') // Auto area for suppliers invoices
{ {
$upload_dir = $conf->societe->dir_output; // TODO change for multicompany sharing $upload_dir = $conf->societe->dir_output; // TODO change for multicompany sharing

View File

@ -33,13 +33,14 @@ if (! defined('NOREQUIREAJAX')) define('NOREQUIREAJAX','1');
$res=@include("../../main.inc.php"); $res=@include("../../main.inc.php");
include_once(DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'); include_once(DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php');
include_once(DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php');
include_once(DOL_DOCUMENT_ROOT.'/core/lib/treeview.lib.php'); include_once(DOL_DOCUMENT_ROOT.'/core/lib/treeview.lib.php');
include_once(DOL_DOCUMENT_ROOT.'/core/class/html.form.class.php'); include_once(DOL_DOCUMENT_ROOT.'/core/class/html.form.class.php');
include_once(DOL_DOCUMENT_ROOT."/ecm/class/ecmdirectory.class.php"); include_once(DOL_DOCUMENT_ROOT."/ecm/class/ecmdirectory.class.php");
$openeddir = GETPOST('openeddir'); $openeddir = GETPOST('openeddir');
$modulepart= GETPOST('modulepart'); $modulepart= GETPOST('modulepart');
$selecteddir = urldecode(GETPOST('dir')); // relative patch. We must keep the urldecode here because para comes from jqueyrFileTree that url encode it. $selecteddir = jsUnEscape(GETPOST('dir')); // relative path. We must decode using same encoding function used by javascript: escape()
if ($selecteddir != '/') $selecteddir = preg_replace('/\/$/','',$selecteddir); // We removed last '/' except if it is '/' if ($selecteddir != '/') $selecteddir = preg_replace('/\/$/','',$selecteddir); // We removed last '/' except if it is '/'
$langs->load("ecm"); $langs->load("ecm");
@ -89,7 +90,6 @@ foreach($sqltree as $keycursor => $val)
} }
} }
//var_dump($sqltree);
if( file_exists($fullpathselecteddir) ) if( file_exists($fullpathselecteddir) )
{ {
@ -111,6 +111,7 @@ if( file_exists($fullpathselecteddir) )
// Try to find key into $sqltree // Try to find key into $sqltree
$val=array(); $val=array();
foreach($sqltree as $key => $tmpval) foreach($sqltree as $key => $tmpval)
{ {
//print "-- ".$val['fullrelativename']." vs ".(($selecteddir != '/'?$selecteddir.'/':'').$file).'<br>'; //print "-- ".$val['fullrelativename']." vs ".(($selecteddir != '/'?$selecteddir.'/':'').$file).'<br>';

View File

@ -47,7 +47,7 @@ top_httphead();
//print '<!-- Ajax page called with url '.$_SERVER["PHP_SELF"].'?'.$_SERVER["QUERY_STRING"].' -->'."\n"; //print '<!-- Ajax page called with url '.$_SERVER["PHP_SELF"].'?'.$_SERVER["QUERY_STRING"].' -->'."\n";
dol_syslog("GET is ".join(',',$_GET)); dol_syslog("GET is ".join(',',$_GET).', MAIN_USE_ZIPTOWN_DICTIONNARY='.(empty($conf->global->MAIN_USE_ZIPTOWN_DICTIONNARY)?'':$conf->global->MAIN_USE_ZIPTOWN_DICTIONNARY));
//var_dump($_GET); //var_dump($_GET);
// Generation of list of zip-town // Generation of list of zip-town
@ -133,4 +133,6 @@ else
} }
$db->close();
?> ?>

View File

@ -0,0 +1,227 @@
<?php
/* Copyright (C) 2012 Charles-François BENKE <charles.fr@benke.fr>
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/**
* \file htdocs/core/boxes/box_activity.php
* \ingroup societes
* \brief Module to show box of bills, orders & propal of the current year
*/
include_once(DOL_DOCUMENT_ROOT."/core/boxes/modules_boxes.php");
class box_activity extends ModeleBoxes
{
var $boxcode="activity";
var $boximg="object_bill";
var $boxlabel;
var $depends = array("facture");
var $db;
var $param;
var $info_box_head = array();
var $info_box_contents = array();
/**
* \brief Constructeur de la classe
*/
function box_activity()
{
global $langs;
$langs->load("boxes");
$langs->load("bills");
$langs->load("projects");
$langs->trans("orders");
$this->boxlabel=$langs->transnoentitiesnoconv("BoxGlobalActivity");
}
/**
* \brief Charge les donnees en memoire pour affichage ulterieur
* \param $max Nombre maximum d'enregistrements a charger
*/
function loadBox()
{
global $conf, $user, $langs, $db;
$totalMnt = 0;
$totalnb = 0;
include_once(DOL_DOCUMENT_ROOT."/compta/facture/class/facture.class.php");
include_once(DOL_DOCUMENT_ROOT."/comm/propal/class/propal.class.php");
include_once(DOL_DOCUMENT_ROOT."/commande/class/commande.class.php");
$facturestatic=new Facture($db);
$propalstatic=new Propal($db);
$commandestatic=new Commande($db);
$textHead = $langs->trans("Activity")."&nbsp;".date("Y");
$this->info_box_head = array('text' => $textHead, 'limit'=> dol_strlen($textHead));
// list the summary of the bills
if ($conf->facture->enabled && $user->rights->facture->lire)
{
$sql = "SELECT f.paye, f.fk_statut, sum(f.total_ttc) as Mnttot, count(*) as nb";
$sql.= " FROM ".MAIN_DB_PREFIX."societe as s,".MAIN_DB_PREFIX."facture as f";
$sql.= " WHERE f.entity = ".$conf->entity;
$sql.= " AND f.fk_soc = s.rowid";
$sql.= " AND (DATE_FORMAT(f.datef,'%Y') = ".date("Y")." or paye=0)";
$sql.= " GROUP BY f.paye, f.fk_statut ";
$sql.= " ORDER BY f.fk_statut DESC";
$result = $db->query($sql);
if ($result)
{
$num = $db->num_rows($result);
$now=gmmktime();
$i = 0;
while ($i < $num)
{
$this->info_box_contents[$i][0] = array('td' => 'align="left" width="16"',
'logo' => 'bill');
$objp = $db->fetch_object($result);
$this->info_box_contents[$i][1] = array('td' => 'align="left"',
'text' => $langs->trans("Bills")."&nbsp;".$facturestatic->LibStatut($objp->paye,$objp->fk_statut,0));
if($objp->fk_statut==0)
{ // draft
$billurl="viewstatut=0&paye=0";
} elseif($objp->fk_statut==1)
{ // unpaid
$billurl="viewstatut=1&paye=0";
} else
{ // paid for current year
$billurl="viewstatut=2&paye=1";
}
$this->info_box_contents[$i][2] = array('td' => 'align="right"',
'text' => $objp->nb, 'url' => DOL_URL_ROOT."/compta/facture/list.php?".$billurl."&mainmenu=accountancy&leftmenu=customers_bills"
);
$totalnb += $objp->nb;
$this->info_box_contents[$i][3] = array('td' => 'align="right"',
'text' => dol_trunc(number_format($objp->Mnttot, 0, ',', ' '),40)."&nbsp;".getCurrencySymbol($conf->currency)
);
$totalMnt += $objp->Mnttot;
$this->info_box_contents[$i][4] = array('td' => 'align="right" width="18"',
'text' => $facturestatic->LibStatut($objp->paye,$objp->fk_statut,3)
);
$i++;
}
if ($num==0) $this->info_box_contents[$i][0] = array('td' => 'align="center"','text'=>$langs->trans("NoRecordedInvoices"));
} else {
$this->info_box_contents[0][0] = array( 'td' => 'align="left"', 'maxlength'=>500, 'text' => ($db->error().' sql='.$sql));
}
}
// list the summary of the orders
if ($conf->commande->enabled && $user->rights->commande->lire)
{
$sql = "SELECT c.fk_statut,c.facture, sum(c.total_ttc) as Mnttot, count(*) as nb";
$sql.= " FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."commande as c";
$sql.= " WHERE c.entity = ".$conf->entity;
$sql.= " AND c.fk_soc = s.rowid";
$sql.= " AND c.facture=0";
$sql.= " GROUP BY c.fk_statut";
$sql.= " ORDER BY c.fk_statut DESC";
$result = $db->query($sql);
if ($result)
{
$num = $db->num_rows($result)+$i;
while ($i < $num)
{
$this->info_box_contents[$i][0] = array('td' => 'align="left" width="16"','logo' => 'object_order');
$objp = $db->fetch_object($result);
$this->info_box_contents[$i][1] = array('td' => 'align="left"',
'text' =>$langs->trans("Orders")."&nbsp;".$commandestatic->LibStatut($objp->fk_statut,$objp->facture,0)
);
$this->info_box_contents[$i][2] = array('td' => 'align="right"',
'text' => $objp->nb,
'url' => DOL_URL_ROOT."/commande/liste.php?mainmenu=commercial&leftmenu=orders&viewstatut=".$objp->fk_statut
);
$totalnb += $objp->nb;
$this->info_box_contents[$i][3] = array('td' => 'align="right"',
'text' => dol_trunc(number_format($objp->Mnttot, 0, ',', ' '),40)."&nbsp;".getCurrencySymbol($conf->currency)
);
$totalMnt += $objp->Mnttot;
$this->info_box_contents[$i][4] = array('td' => 'align="right" width="18"', 'text' => $commandestatic->LibStatut($objp->fk_statut,$objp->facture,3));
$i++;
}
}
}
// list the summary of the propals
if ($conf->propal->enabled && $user->rights->propal->lire)
{
$sql = "SELECT p.fk_statut, sum(p.total) as Mnttot, count(*) as nb";
$sql.= " FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."propal as p";
$sql.= " WHERE p.entity = ".$conf->entity;
$sql.= " AND p.fk_soc = s.rowid";
$sql.= " AND DATE_FORMAT(p.datep,'%Y') = ".date("Y");
$sql.= " AND p.date_cloture IS NULL "; // just unclosed
$sql.= " GROUP BY p.fk_statut";
$sql.= " ORDER BY p.fk_statut DESC";
$result = $db->query($sql);
if ($result)
{
$num = $db->num_rows($result)+$i;
while ($i < $num)
{
$this->info_box_contents[$i][0] = array('td' => 'align="left" width="16"','logo' => 'object_propal');
$objp = $db->fetch_object($result);
$this->info_box_contents[$i][1] = array('td' => 'align="left"',
'text' =>$langs->trans("Proposals")."&nbsp;".$propalstatic->LibStatut($objp->fk_statut,0)
);
$this->info_box_contents[$i][2] = array('td' => 'align="right"',
'text' => $objp->nb,
'url' => DOL_URL_ROOT."/comm/propal/list.php?mainmenu=commercial&leftmenu=propals&viewstatut=".$objp->fk_statut
);
$totalnb += $objp->nb;
$this->info_box_contents[$i][3] = array('td' => 'align="right"',
'text' => dol_trunc(number_format($objp->Mnttot, 0, ',', ' '),40)."&nbsp;".getCurrencySymbol($conf->currency)
);
$totalMnt += $objp->Mnttot;
$this->info_box_contents[$i][4] = array('td' => 'align="right" width="18"', 'text' => $propalstatic->LibStatut($objp->fk_statut,3));
$i++;
}
}
}
// Add the sum in the bottom of the boxes
$this->info_box_contents[$i][1] = array('td' => 'align="left" ', 'text' => $langs->trans("Total")."&nbsp;".$textHead);
$this->info_box_contents[$i][2] = array('td' => 'align="right" ', 'text' => number_format($totalnb, 0, ',', ' '));
$this->info_box_contents[$i][3] = array('td' => 'align="right" ', 'text' => number_format($totalMnt, 0, ',', ' ')."&nbsp;".getCurrencySymbol($conf->currency));
$this->info_box_contents[$i][4] = array('td' => 'align="right" ', 'text' => "");
$this->info_box_contents[$i][5] = array('td' => 'align="right"', 'text' => "");
}
function showBox($head = null, $contents = null)
{
parent::showBox($this->info_box_head, $this->info_box_contents);
}
}
?>

View File

@ -71,8 +71,10 @@ class box_contacts extends ModeleBoxes
if ($user->rights->societe->lire) if ($user->rights->societe->lire)
{ {
$sql = "SELECT sp.rowid, sp.name, sp.firstname, sp.civilite, sp.datec, sp.tms"; $sql = "SELECT sp.rowid, sp.name, sp.firstname, sp.civilite, sp.datec, sp.tms, sp.fk_soc,";
$sql.= " s.nom as socname";
$sql.= " FROM ".MAIN_DB_PREFIX."socpeople as sp"; $sql.= " FROM ".MAIN_DB_PREFIX."socpeople as sp";
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON sp.fk_soc = s.rowid";
if (! $user->rights->societe->client->voir && ! $user->societe_id) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; if (! $user->rights->societe->client->voir && ! $user->societe_id) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
$sql.= " WHERE sp.entity IN (".getEntity('societe', 1).")"; $sql.= " WHERE sp.entity IN (".getEntity('societe', 1).")";
if (! $user->rights->societe->client->voir && ! $user->societe_id) $sql.= " AND sp.rowid = sc.fk_soc AND sc.fk_user = " .$user->id; if (! $user->rights->societe->client->voir && ! $user->societe_id) $sql.= " AND sp.rowid = sc.fk_soc AND sc.fk_user = " .$user->id;
@ -87,6 +89,7 @@ class box_contacts extends ModeleBoxes
$num = $db->num_rows($result); $num = $db->num_rows($result);
$contactstatic=new Contact($db); $contactstatic=new Contact($db);
$societestatic=new Societe($db);
$i = 0; $i = 0;
while ($i < $num) while ($i < $num)
@ -99,6 +102,9 @@ class box_contacts extends ModeleBoxes
$contactstatic->firstname=$objp->firstname; $contactstatic->firstname=$objp->firstname;
$contactstatic->civilite_id=$objp->civilite; $contactstatic->civilite_id=$objp->civilite;
$societestatic->id=$objp->fk_soc;
$societestatic->name=$objp->socname;
$this->info_box_contents[$i][0] = array('td' => 'align="left" width="16"', $this->info_box_contents[$i][0] = array('td' => 'align="left" width="16"',
'logo' => $this->boximg, 'logo' => $this->boximg,
'url' => DOL_URL_ROOT."/contact/fiche.php?id=".$objp->rowid); 'url' => DOL_URL_ROOT."/contact/fiche.php?id=".$objp->rowid);
@ -107,7 +113,15 @@ class box_contacts extends ModeleBoxes
'text' => $contactstatic->getFullName($langs,1), 'text' => $contactstatic->getFullName($langs,1),
'url' => DOL_URL_ROOT."/contact/fiche.php?id=".$objp->rowid); 'url' => DOL_URL_ROOT."/contact/fiche.php?id=".$objp->rowid);
$this->info_box_contents[$i][2] = array('td' => 'align="right"', $this->info_box_contents[$i][2] = array('td' => 'align="left" width="16"',
'logo' => ($objp->fk_soc > 0?'company':''),
'url' => ($objp->fk_soc > 0?DOL_URL_ROOT."/societe/soc.php?socid=".$objp->fk_soc:''));
$this->info_box_contents[$i][3] = array('td' => 'align="left"',
'text' => $societestatic->name,
'url' => DOL_URL_ROOT."/societe/soc.php?socid=".$objp->fk_soc);
$this->info_box_contents[$i][4] = array('td' => 'align="right"',
'text' => dol_print_date($datem, "day")); 'text' => dol_print_date($datem, "day"));
$i++; $i++;

View File

@ -1646,7 +1646,7 @@ abstract class CommonObject
$sourceid = (! empty($sourceid) ? $sourceid : $this->id); $sourceid = (! empty($sourceid) ? $sourceid : $this->id);
$targetid = (! empty($targetid) ? $targetid : $this->id); $targetid = (! empty($targetid) ? $targetid : $this->id);
$sourcetype = (! empty($sourcetype) ? $sourcetype : (! empty($this->origin) ? $this->origin : $this->element)); $sourcetype = (! empty($sourcetype) ? $sourcetype : $this->element);
$targettype = (! empty($targettype) ? $targettype : $this->element); $targettype = (! empty($targettype) ? $targettype : $this->element);
// Links beetween objects are stored in this table // Links beetween objects are stored in this table
@ -2283,6 +2283,9 @@ abstract class CommonObject
if ($objecttype == 'member') { if ($objecttype == 'member') {
$classpath = 'adherents/class'; $module='adherent'; $subelement='adherent'; $classpath = 'adherents/class'; $module='adherent'; $subelement='adherent';
} }
if ($objecttype == 'cabinetmed_cons') {
$classpath = 'cabinetmed/class'; $module='cabinetmed'; $subelement='cabinetmedcons';
}
//print "objecttype=".$objecttype." module=".$module." subelement=".$subelement; //print "objecttype=".$objecttype." module=".$module." subelement=".$subelement;
@ -2294,13 +2297,15 @@ abstract class CommonObject
$classfile = 'fournisseur.commande'; $classname='CommandeFournisseur'; $classfile = 'fournisseur.commande'; $classname='CommandeFournisseur';
} }
if ($conf->$module->enabled) if (! empty($conf->$module->enabled))
{ {
dol_include_once('/'.$classpath.'/'.$classfile.'.class.php'); $res=dol_include_once('/'.$classpath.'/'.$classfile.'.class.php');
if ($res)
$object = new $classname($this->db); {
$ret=$object->fetch($objectid); $object = new $classname($this->db);
if ($ret > 0) return $object->getNomUrl($withpicto,$option); $ret=$object->fetch($objectid);
if ($ret > 0) return $object->getNomUrl($withpicto,$option);
}
} }
} }

View File

@ -3561,18 +3561,20 @@ class Form
* To add a particular filter on select, you must set $object->next_prev_filter to SQL criteria. * To add a particular filter on select, you must set $object->next_prev_filter to SQL criteria.
* *
* @param Object $object Object to show * @param Object $object Object to show
* @param int $paramid Name of parameter to use to name the id into the URL link * @param string $paramid Name of parameter to use to name the id into the URL link
* @param string $morehtml More html content to output just before the nav bar * @param string $morehtml More html content to output just before the nav bar
* @param int $shownav Show Condition (navigation is shown if value is 1) * @param int $shownav Show Condition (navigation is shown if value is 1)
* @param int $fieldid Nom du champ en base a utiliser pour select next et previous * @param string $fieldid Nom du champ en base a utiliser pour select next et previous
* @param string $fieldref Nom du champ objet ref (object->ref) a utiliser pour select next et previous * @param string $fieldref Nom du champ objet ref (object->ref) a utiliser pour select next et previous
* @param string $morehtmlref Code html supplementaire a afficher apres ref * @param string $morehtmlref Code html supplementaire a afficher apres ref
* @param string $moreparam More param to add in nav link url. * @param string $moreparam More param to add in nav link url.
* @return tring Portion HTML avec ref + boutons nav * @return tring Portion HTML avec ref + boutons nav
*/ */
function showrefnav($object,$paramid,$morehtml='',$shownav=1,$fieldid='rowid',$fieldref='ref',$morehtmlref='',$moreparam='') function showrefnav($object,$paramid,$morehtml='',$shownav=1,$fieldid='rowid',$fieldref='ref',$morehtmlref='',$moreparam='')
{ {
$ret=''; $ret='';
if (empty($fieldid)) $fieldid='rowid';
if (empty($fieldref)) $fieldref='ref';
//print "paramid=$paramid,morehtml=$morehtml,shownav=$shownav,$fieldid,$fieldref,$morehtmlref,$moreparam"; //print "paramid=$paramid,morehtml=$morehtml,shownav=$shownav,$fieldid,$fieldref,$morehtmlref,$moreparam";
$object->load_previous_next_ref((isset($object->next_prev_filter)?$object->next_prev_filter:''),$fieldid); $object->load_previous_next_ref((isset($object->next_prev_filter)?$object->next_prev_filter:''),$fieldid);

View File

@ -650,6 +650,8 @@ class FormFile
global $bc; global $bc;
global $sortfield, $sortorder; global $sortfield, $sortorder;
dol_syslog(get_class($this).'::list_of_autoecmfiles upload_dir='.$upload_dir.' modulepart='.$modulepart);
// Affiche liste des documents existant // Affiche liste des documents existant
if (empty($useinecm)) print_titre($langs->trans("AttachedFiles")); if (empty($useinecm)) print_titre($langs->trans("AttachedFiles"));
//else { $bc[true]=''; $bc[false]=''; }; //else { $bc[true]=''; $bc[false]=''; };
@ -666,7 +668,12 @@ class FormFile
print '</tr>'; print '</tr>';
// To show ref or specific information according to view to show (defined by $module) // To show ref or specific information according to view to show (defined by $module)
if ($modulepart == 'invoice') if ($modulepart == 'company')
{
include_once(DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php');
$object_instance=new Societe($this->db);
}
else if ($modulepart == 'invoice')
{ {
include_once(DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'); include_once(DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php');
$object_instance=new Facture($this->db); $object_instance=new Facture($this->db);
@ -718,6 +725,7 @@ class FormFile
$id=0; $ref=''; $label=''; $id=0; $ref=''; $label='';
// To show ref or specific information according to view to show (defined by $module) // To show ref or specific information according to view to show (defined by $module)
if ($modulepart == 'company') { preg_match('/(\d+)\/[^\/]+$/',$relativefile,$reg); $id=$reg[1]; }
if ($modulepart == 'invoice') { preg_match('/(.*)\/[^\/]+$/',$relativefile,$reg); $ref=$reg[1]; } if ($modulepart == 'invoice') { preg_match('/(.*)\/[^\/]+$/',$relativefile,$reg); $ref=$reg[1]; }
if ($modulepart == 'invoice_supplier') { preg_match('/(\d+)\/[^\/]+$/',$relativefile,$reg); $id=$reg[1]; } if ($modulepart == 'invoice_supplier') { preg_match('/(\d+)\/[^\/]+$/',$relativefile,$reg); $id=$reg[1]; }
if ($modulepart == 'propal') { preg_match('/(.*)\/[^\/]+$/',$relativefile,$reg); $ref=$reg[1]; } if ($modulepart == 'propal') { preg_match('/(.*)\/[^\/]+$/',$relativefile,$reg); $ref=$reg[1]; }

View File

@ -69,54 +69,56 @@ $(document).ready(function() {
$('#editval_' + $(this).attr('id')).show().click(); $('#editval_' + $(this).attr('id')).show().click();
}); });
$('.editval_ckeditor').editable(urlSaveInPlace, { if (typeof ckeditorConfig != 'undefined') {
type : 'ckeditor', $('.editval_ckeditor').editable(urlSaveInPlace, {
id : 'field', type : 'ckeditor',
onblur : 'ignore', id : 'field',
tooltip : tooltipInPlace, onblur : 'ignore',
placeholder : '&nbsp;', tooltip : tooltipInPlace,
cancel : cancelInPlace, placeholder : '&nbsp;',
submit : submitInPlace, cancel : cancelInPlace,
indicator : indicatorInPlace, submit : submitInPlace,
ckeditor : { indicator : indicatorInPlace,
customConfig: ckeditorConfig, ckeditor : {
toolbar: $('#ckeditor_toolbar').val(), customConfig: ckeditorConfig,
filebrowserBrowseUrl : ckeditorFilebrowserBrowseUrl, toolbar: $('#ckeditor_toolbar').val(),
filebrowserImageBrowseUrl : ckeditorFilebrowserImageBrowseUrl, filebrowserBrowseUrl : ckeditorFilebrowserBrowseUrl,
filebrowserWindowWidth : '900', filebrowserImageBrowseUrl : ckeditorFilebrowserImageBrowseUrl,
filebrowserWindowHeight : '500', filebrowserWindowWidth : '900',
filebrowserImageWindowWidth : '900', filebrowserWindowHeight : '500',
filebrowserImageWindowHeight : '500' filebrowserImageWindowWidth : '900',
}, filebrowserImageWindowHeight : '500'
submitdata : function(result, settings) {
return getParameters(this, 'ckeditor');
},
callback : function(result, settings) {
getResult(this, result);
},
onreset : function(result, settings) {
getDefault(settings);
}
});
$('.editkey_ckeditor').hover(
function () {
$('#viewval_' + $(this).attr('id')).addClass("viewval_hover");
}, },
function () { submitdata : function(result, settings) {
$('#viewval_' + $(this).attr('id')).removeClass("viewval_hover"); return getParameters(this, 'ckeditor');
},
callback : function(result, settings) {
getResult(this, result);
},
onreset : function(result, settings) {
getDefault(settings);
} }
); });
$('.editkey_ckeditor').click(function() { $('.editkey_ckeditor').hover(
$( '#viewval_' + $(this).attr('id') ).click(); function () {
}); $('#viewval_' + $(this).attr('id')).addClass("viewval_hover");
$('.viewval_ckeditor.active').click(function() { },
$('#viewval_' + $(this).attr('id').substr(8)).hide(); function () {
$('#editval_' + $(this).attr('id').substr(8)).show().click(); $('#viewval_' + $(this).attr('id')).removeClass("viewval_hover");
}); }
$('.editkey_ckeditor').click(function() { );
$('#viewval_' + $(this).attr('id')).hide(); $('.editkey_ckeditor').click(function() {
$('#editval_' + $(this).attr('id')).show().click(); $( '#viewval_' + $(this).attr('id') ).click();
}); });
$('.viewval_ckeditor.active').click(function() {
$('#viewval_' + $(this).attr('id').substr(8)).hide();
$('#editval_' + $(this).attr('id').substr(8)).show().click();
});
$('.editkey_ckeditor').click(function() {
$('#viewval_' + $(this).attr('id')).hide();
$('#editval_' + $(this).attr('id')).show().click();
});
}
$('.editval_string').editable(urlSaveInPlace, { $('.editval_string').editable(urlSaveInPlace, {
type : 'text', type : 'text',

View File

@ -75,7 +75,7 @@ function getServerTimeZoneString()
/** /**
* Return server timezone int. * Return server timezone int.
* If $conf->global->MAIN_NEW_DATE is set, we use new behaviour: All convertions take care of dayling saving time. * If $conf->global->MAIN_OLD_DATE is set or PHP too old, we use old behaviour: All convertions does not take care of dayling saving time.
* *
* @param string $refgmtdate Reference period for timezone (timezone differs on winter and summer. May be 'now', 'winter' or 'summer') * @param string $refgmtdate Reference period for timezone (timezone differs on winter and summer. May be 'now', 'winter' or 'summer')
* @return int An offset in hour (+1 for Europe/Paris on winter and +2 for Europe/Paris on summer) * @return int An offset in hour (+1 for Europe/Paris on winter and +2 for Europe/Paris on summer)
@ -83,7 +83,7 @@ function getServerTimeZoneString()
function getServerTimeZoneInt($refgmtdate='now') function getServerTimeZoneInt($refgmtdate='now')
{ {
global $conf; global $conf;
if (method_exists('DateTimeZone','getOffset') && ! empty($conf->global->MAIN_NEW_DATE)) if (method_exists('DateTimeZone','getOffset') && empty($conf->global->MAIN_OLD_DATE))
{ {
// Method 1 (include daylight) // Method 1 (include daylight)
$gmtnow=dol_now('gmt'); $yearref=dol_print_date($gmtnow,'%Y'); $monthref=dol_print_date($gmtnow,'%m'); $dayref=dol_print_date($gmtnow,'%d'); $gmtnow=dol_now('gmt'); $yearref=dol_print_date($gmtnow,'%Y'); $monthref=dol_print_date($gmtnow,'%m'); $dayref=dol_print_date($gmtnow,'%d');
@ -101,7 +101,7 @@ function getServerTimeZoneInt($refgmtdate='now')
if ($refgmtdate == 'now') if ($refgmtdate == 'now')
{ {
if (ini_get("date.timezone")=='UTC') return 0; if (ini_get("date.timezone")=='UTC') return 0;
// We don't know server timezone string, so we don't know location, so we can't guess daylight. We assume we use same than client. Fix is to use MAIN_NEW_DATE. // We don't know server timezone string, so we don't know location, so we can't guess daylight. We assume we use same than client. Fix is to use new PHP with not MAIN_OLD_DATE.
$gmtnow=dol_now('gmt'); $yearref=dol_print_date($gmtnow,'%Y'); $monthref=dol_print_date($gmtnow,'%m'); $dayref=dol_print_date($gmtnow,'%d'); $gmtnow=dol_now('gmt'); $yearref=dol_print_date($gmtnow,'%Y'); $monthref=dol_print_date($gmtnow,'%m'); $dayref=dol_print_date($gmtnow,'%d');
if (dol_stringtotime($_SESSION['dol_dst_first']) <= $gmtnow && $gmtnow < dol_stringtotime($_SESSION['dol_dst_second'])) $daylight=1; if (dol_stringtotime($_SESSION['dol_dst_first']) <= $gmtnow && $gmtnow < dol_stringtotime($_SESSION['dol_dst_second'])) $daylight=1;
else $daylight=0; else $daylight=0;
@ -111,7 +111,7 @@ function getServerTimeZoneInt($refgmtdate='now')
elseif ($refgmtdate == 'summer') elseif ($refgmtdate == 'summer')
{ {
if (ini_get("date.timezone")=='UTC') return 0; if (ini_get("date.timezone")=='UTC') return 0;
// We don't know server timezone string, so we don't know location, so we can't guess daylight. We assume we use same than client. Fix is to use MAIN_NEW_DATE. // We don't know server timezone string, so we don't know location, so we can't guess daylight. We assume we use same than client. Fix is to use new PHP with not MAIN_OLD_DATE.
$gmtnow=dol_now('gmt'); $yearref=dol_print_date($gmtnow,'%Y'); $monthref='08'; $dayref='01'; $gmtnow=dol_now('gmt'); $yearref=dol_print_date($gmtnow,'%Y'); $monthref='08'; $dayref='01';
if (dol_stringtotime($_SESSION['dol_dst_first']) <= dol_stringtotime($yearref.'-'.$monthref.'-'.$dayref) && dol_stringtotime($yearref.'-'.$monthref.'-'.$dayref) < dol_stringtotime($_SESSION['dol_dst_second'])) $daylight=1; if (dol_stringtotime($_SESSION['dol_dst_first']) <= dol_stringtotime($yearref.'-'.$monthref.'-'.$dayref) && dol_stringtotime($yearref.'-'.$monthref.'-'.$dayref) < dol_stringtotime($_SESSION['dol_dst_second'])) $daylight=1;
else $daylight=0; else $daylight=0;
@ -146,7 +146,7 @@ function getParentCompanyTimeZoneString()
function getParentCompanyTimeZoneInt($refgmtdate='now') function getParentCompanyTimeZoneInt($refgmtdate='now')
{ {
global $conf; global $conf;
if (class_exists('DateTime') && ! empty($conf->global->MAIN_NEW_DATE)) if (class_exists('DateTime') && empty($conf->global->MAIN_OLD_DATE))
{ {
// Method 1 (include daylight) // Method 1 (include daylight)
$localtz = new DateTimeZone(getParentCompanyTimeZoneString()); $localtz = new DateTimeZone(getParentCompanyTimeZoneString());

View File

@ -23,6 +23,17 @@
* \brief Library for file managing functions * \brief Library for file managing functions
*/ */
/**
* Make a basename working with all page code (default PHP basenamed fails with cyrillic).
* We supose dir separator for input is '/'.
*
* @param string $pathfile String to find basename.
* @return string Basename of input
*/
function dol_basename($pathfile)
{
return preg_replace('/^.*\/([^\/]+)$/','$1',rtrim($pathfile,'/'));
}
/** /**
* Scan a directory and return a list of files/directories. * Scan a directory and return a list of files/directories.

View File

@ -960,7 +960,7 @@ function dol_mktime($hour,$minute,$second,$month,$day,$year,$gm=false,$check=1)
if ($second< 0 || $second > 60) return ''; if ($second< 0 || $second > 60) return '';
} }
if (method_exists('DateTime','getTimestamp') && ! empty($conf->global->MAIN_NEW_DATE)) if (method_exists('DateTime','getTimestamp') && empty($conf->global->MAIN_OLD_DATE))
{ {
if (empty($gm)) $localtz = new DateTimeZone(date_default_timezone_get()); if (empty($gm)) $localtz = new DateTimeZone(date_default_timezone_get());
else $localtz = new DateTimeZone('UTC'); else $localtz = new DateTimeZone('UTC');

View File

@ -24,6 +24,45 @@
* This file contains all rare functions. * This file contains all rare functions.
*/ */
/**
* Same function than javascript unescape() function but in PHP.
*
* @param string $sourcetodecode String to decode
* @return
*/
function jsUnEscape($source)
{
$decodedStr = "";
$pos = 0;
$len = strlen ($source);
while ($pos < $len) {
$charAt = substr ($source, $pos, 1);
if ($charAt == '%') {
$pos++;
$charAt = substr ($source, $pos, 1);
if ($charAt == 'u') {
// we got a unicode character
$pos++;
$unicodeHexVal = substr ($source, $pos, 4);
$unicode = hexdec ($unicodeHexVal);
$entity = "&#". $unicode . ';';
$decodedStr .= utf8_encode ($entity);
$pos += 4;
}
else {
// we have an escaped ascii character
$hexVal = substr ($source, $pos, 2);
$decodedStr .= chr (hexdec ($hexVal));
$pos += 2;
}
} else {
$decodedStr .= $charAt;
$pos++;
}
}
return dol_html_entity_decode($decodedStr, ENT_COMPAT);
}
/** /**
* Return list of modules directories * Return list of modules directories

View File

@ -1417,6 +1417,18 @@ function pdf_getLinkedObjects($object,$outputlangs,$hookmanager=false)
$linkedobjects[$objecttype]['date_value'] = dol_print_date($objects[$i]->date,'day','',$outputlangs); $linkedobjects[$objecttype]['date_value'] = dol_print_date($objects[$i]->date,'day','',$outputlangs);
} }
} }
else if ($objecttype == 'contrat')
{
$outputlangs->load('contracts');
$num=count($objects);
for ($i=0;$i<$num;$i++)
{
$linkedobjects[$objecttype]['ref_title'] = $outputlangs->transnoentities("RefContract");
$linkedobjects[$objecttype]['ref_value'] = $outputlangs->transnoentities($objects[$i]->ref);
$linkedobjects[$objecttype]['date_title'] = $outputlangs->transnoentities("DateContract");
$linkedobjects[$objecttype]['date_value'] = dol_print_date($objects[$i]->date_contrat,'day','',$outputlangs);
}
}
} }
// For add external linked objects // For add external linked objects

View File

@ -286,7 +286,7 @@ function restrictedArea($user, $features, $objectid=0, $dbtablename='', $feature
{ {
$sql=''; $sql='';
$check = array('banque','user','usergroup','produit','service','produit|service','categorie'); // Test on entity only (Objects with no link to company) $check = array('adherent','banque','user','usergroup','produit','service','produit|service','categorie'); // Test on entity only (Objects with no link to company)
$checksoc = array('societe'); // Test for societe object $checksoc = array('societe'); // Test for societe object
$checkother = array('contact'); // Test on entity and link to societe. Allowed if link is empty (Ex: contacts...). $checkother = array('contact'); // Test on entity and link to societe. Allowed if link is empty (Ex: contacts...).
$checkproject = array('projet'); // Test for project object $checkproject = array('projet'); // Test for project object
@ -319,7 +319,7 @@ function restrictedArea($user, $features, $objectid=0, $dbtablename='', $feature
if ($user->societe_id <> $objectid) accessforbidden(); if ($user->societe_id <> $objectid) accessforbidden();
} }
// If internal user: Check permission for internal users that are restricted on their objects // If internal user: Check permission for internal users that are restricted on their objects
else if (! $user->rights->societe->client->voir) else if (! empty($conf->societe->enabled) && ($user->rights->societe->lire && ! $user->rights->societe->client->voir))
{ {
$sql = "SELECT sc.fk_soc"; $sql = "SELECT sc.fk_soc";
$sql.= " FROM (".MAIN_DB_PREFIX."societe_commerciaux as sc"; $sql.= " FROM (".MAIN_DB_PREFIX."societe_commerciaux as sc";
@ -349,7 +349,7 @@ function restrictedArea($user, $features, $objectid=0, $dbtablename='', $feature
$sql.= " AND dbt.fk_soc = ".$user->societe_id; $sql.= " AND dbt.fk_soc = ".$user->societe_id;
} }
// If internal user: Check permission for internal users that are restricted on their objects // If internal user: Check permission for internal users that are restricted on their objects
else if (! $user->rights->societe->client->voir) else if (! empty($conf->societe->enabled) && ($user->rights->societe->lire && ! $user->rights->societe->client->voir))
{ {
$sql = "SELECT dbt.rowid"; $sql = "SELECT dbt.rowid";
$sql.= " FROM ".MAIN_DB_PREFIX.$dbtablename." as dbt"; $sql.= " FROM ".MAIN_DB_PREFIX.$dbtablename." as dbt";
@ -369,7 +369,7 @@ function restrictedArea($user, $features, $objectid=0, $dbtablename='', $feature
} }
else if (in_array($feature,$checkproject)) else if (in_array($feature,$checkproject))
{ {
if (! $user->rights->projet->all->lire) if (! empty($conf->projet->enabled) && ! $user->rights->projet->all->lire)
{ {
include_once(DOL_DOCUMENT_ROOT."/projet/class/project.class.php"); include_once(DOL_DOCUMENT_ROOT."/projet/class/project.class.php");
$projectstatic=new Project($db); $projectstatic=new Project($db);
@ -396,7 +396,7 @@ function restrictedArea($user, $features, $objectid=0, $dbtablename='', $feature
$sql.= " AND dbt.".$dbt_keyfield." = ".$user->societe_id; $sql.= " AND dbt.".$dbt_keyfield." = ".$user->societe_id;
} }
// If internal user: Check permission for internal users that are restricted on their objects // If internal user: Check permission for internal users that are restricted on their objects
else if (! $user->rights->societe->client->voir) else if (! empty($conf->societe->enabled) && ($user->rights->societe->lire && ! $user->rights->societe->client->voir))
{ {
$sql = "SELECT sc.fk_soc"; $sql = "SELECT sc.fk_soc";
$sql.= " FROM ".MAIN_DB_PREFIX.$dbtablename." as dbt"; $sql.= " FROM ".MAIN_DB_PREFIX.$dbtablename." as dbt";

View File

@ -45,12 +45,17 @@ function shipping_prepare_head($object)
$head[$h][2] = 'shipping'; $head[$h][2] = 'shipping';
$h++; $h++;
if ($conf->livraison_bon->enabled && $user->rights->expedition->livraison->lire && ! empty($object->linkedObjectsIds['delivery'][0])) if ($conf->livraison_bon->enabled && $user->rights->expedition->livraison->lire)
{ {
$head[$h][0] = DOL_URL_ROOT."/livraison/fiche.php?id=".$object->linkedObjectsIds['delivery'][0]; // delivery link
$head[$h][1] = $langs->trans("DeliveryCard"); $object->fetchObjectLinked($object->id,$object->element);
$head[$h][2] = 'delivery'; if (! empty($object->linkedObjectsIds['delivery'][0]))
$h++; {
$head[$h][0] = DOL_URL_ROOT."/livraison/fiche.php?id=".$object->linkedObjectsIds['delivery'][0];
$head[$h][1] = $langs->trans("DeliveryCard");
$head[$h][2] = 'delivery';
$h++;
}
} }
$head[$h][0] = DOL_URL_ROOT."/expedition/contact.php?id=".$object->id; $head[$h][0] = DOL_URL_ROOT."/expedition/contact.php?id=".$object->id;

View File

@ -166,8 +166,8 @@ class CommActionRapport
$sql = "SELECT s.nom as societe, s.rowid as socid, s.client,"; $sql = "SELECT s.nom as societe, s.rowid as socid, s.client,";
$sql.= " a.id, a.datep as dp, a.datep2 as dp2,"; $sql.= " a.id, a.datep as dp, a.datep2 as dp2,";
$sql.= " a.fk_contact, a.note, a.percent as percent,"; $sql.= " a.fk_contact, a.note, a.percent as percent, a.label,";
$sql.= " c.libelle,"; $sql.= " c.code, c.libelle,";
$sql.= " u.login"; $sql.= " u.login";
$sql.= " FROM ".MAIN_DB_PREFIX."c_actioncomm as c, ".MAIN_DB_PREFIX."user as u, ".MAIN_DB_PREFIX."actioncomm as a"; $sql.= " FROM ".MAIN_DB_PREFIX."c_actioncomm as c, ".MAIN_DB_PREFIX."user as u, ".MAIN_DB_PREFIX."actioncomm as a";
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON a.fk_soc = s.rowid"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON a.fk_soc = s.rowid";
@ -191,7 +191,10 @@ class CommActionRapport
$y = max($y, $pdf->GetY(), $y0, $y1, $y2, $y3); $y = max($y, $pdf->GetY(), $y0, $y1, $y2, $y3);
// Calculate height of text // Calculate height of text
$text=dol_trunc(dol_htmlentitiesbr_decode($obj->note),150); $text='';
if (! preg_match('/^'.preg_quote($obj->label).'/',$obj->note)) $text=$obj->label."\n";
$text.=$obj->note;
$text=dol_trunc(dol_htmlentitiesbr_decode($text),150);
//print 'd'.$text; exit; //print 'd'.$text; exit;
$nboflines=dol_nboflines($text); $nboflines=dol_nboflines($text);
$heightlinemax=max(2*$height,$nboflines*$height); $heightlinemax=max(2*$height,$nboflines*$height);
@ -215,7 +218,7 @@ class CommActionRapport
$y1 = $pdf->GetY(); $y1 = $pdf->GetY();
$pdf->SetXY(60,$y); $pdf->SetXY(60,$y);
$pdf->MultiCell(32, $height, dol_trunc($outputlangs->convToOutputCharset($obj->libelle),32), 0, 'L', 0); $pdf->MultiCell(32, $height, dol_trunc($outputlangs->convToOutputCharset($outputlangs->transnoentitiesnoconv("Action".$obj->code)),32), 0, 'L', 0);
$y2 = $pdf->GetY(); $y2 = $pdf->GetY();
$pdf->SetXY(106,$y); $pdf->SetXY(106,$y);

View File

@ -111,6 +111,8 @@ class modSociete extends DolibarrModules
$this->boxes[$r][1] = "box_prospect.php"; $this->boxes[$r][1] = "box_prospect.php";
$r++; $r++;
$this->boxes[$r][1] = "box_contacts.php"; $this->boxes[$r][1] = "box_contacts.php";
$r++;
$this->boxes[$r][1] = "box_activity.php";
$r++; $r++;
// Permissions // Permissions

View File

@ -311,6 +311,7 @@ class doc_generic_odt extends ModeleThirdPartyDoc
} }
} }
$this->error='UnknownError';
return -1; return -1;
} }

View File

@ -78,7 +78,8 @@ class mod_codecompta_panicum extends ModeleAccountancyCode
function get_code($db, $societe, $type='') function get_code($db, $societe, $type='')
{ {
// Renvoie toujours ok // Renvoie toujours ok
$this->code = $societe->code_compta; if ($type == 'supplier') $this->code = $societe->code_compta_fournisseur;
else $this->code = $societe->code_compta;
return 0; return 0;
} }
} }

View File

@ -607,8 +607,8 @@ class EcmDirectory // extends CommonObject
} }
/** /**
* Calcule les proprietes fullpath, fullrelativename, fulllabel d'un repertoire * Define properties fullpath, fullrelativename, fulllabel of a directory of array this->cats and all its childs.
* du tableau this->cats et de toutes ces enfants. * Separator between directories is always '/', whatever is OS.
* *
* @param int $id_categ id_categ entry to update * @param int $id_categ id_categ entry to update
* @param int $protection Deep counter to avoid infinite loop * @param int $protection Deep counter to avoid infinite loop

View File

@ -257,7 +257,8 @@ if ($action == 'refreshmanual')
} }
} }
else else
{ {
dol_syslog("Parent is root");
$fk_parent=0; // Parent is root $fk_parent=0; // Parent is root
} }
@ -265,7 +266,7 @@ if ($action == 'refreshmanual')
{ {
$ecmdirtmp=new EcmDirectory($db); $ecmdirtmp=new EcmDirectory($db);
$ecmdirtmp->ref = 'NOTUSEDYET'; $ecmdirtmp->ref = 'NOTUSEDYET';
$ecmdirtmp->label = basename($dirdesc['fullname']); $ecmdirtmp->label = dol_basename($dirdesc['fullname']);
$ecmdirtmp->description = ''; $ecmdirtmp->description = '';
$ecmdirtmp->fk_parent = $fk_parent; $ecmdirtmp->fk_parent = $fk_parent;
@ -284,6 +285,10 @@ if ($action == 'refreshmanual')
//var_dump($sqltree); //var_dump($sqltree);
$adirwascreated=1; $adirwascreated=1;
} }
else
{
dol_syslog("Failed to create directory ".$ecmdirtmp->label, LOG_ERR);
}
} }
else { else {
$txt="Parent of ".$dirdesc['fullname']." not found"; $txt="Parent of ".$dirdesc['fullname']." not found";
@ -559,7 +564,7 @@ if (empty($action) || $action == 'file_manager' || preg_match('/refresh/i',$acti
function loadandshowpreview(filedirname,section) function loadandshowpreview(filedirname,section)
{ {
//alert('filename='+filename); alert('filename='+filename);
jQuery('#ecmfileview').empty(); jQuery('#ecmfileview').empty();
url='<?php echo dol_buildpath('/core/ajax/ajaxdirpreview.php',1); ?>?action=preview&module=ecm&section='+section+'&file='+urlencode(filedirname); url='<?php echo dol_buildpath('/core/ajax/ajaxdirpreview.php',1); ?>?action=preview&module=ecm&section='+section+'&file='+urlencode(filedirname);
@ -584,10 +589,12 @@ if (empty($action) || $action == 'file_manager' || preg_match('/refresh/i',$acti
jQuery(document).ready( function() { jQuery(document).ready( function() {
jQuery('#filetree').fileTree({ root: '<?php print dol_escape_js($openeddir); ?>', jQuery('#filetree').fileTree({ root: '<?php print dol_escape_js($openeddir); ?>',
// Called if we click on a file (not a dir)
script: '<?php echo DOL_URL_ROOT.'/core/ajax/ajaxdirtree.php?modulepart=ecm&openeddir='.urlencode($openeddir); ?>', script: '<?php echo DOL_URL_ROOT.'/core/ajax/ajaxdirtree.php?modulepart=ecm&openeddir='.urlencode($openeddir); ?>',
folderEvent: 'click', folderEvent: 'click',
multiFolder: false }, multiFolder: false },
function(file) { // Called if we click on a file (not a dir)
function(file) {
jQuery("#mesg").hide(); jQuery("#mesg").hide();
loadandshowpreview(file,0); loadandshowpreview(file,0);
} }

View File

@ -872,9 +872,6 @@ else
$soc = new Societe($db); $soc = new Societe($db);
$soc->fetch($object->socid); $soc->fetch($object->socid);
// delivery link
$object->fetchObjectLinked($object->id,$object->element,-1,-1);
$head=shipping_prepare_head($object); $head=shipping_prepare_head($object);
dol_fiche_head($head, 'shipping', $langs->trans("Sending"), 0, 'sending'); dol_fiche_head($head, 'shipping', $langs->trans("Sending"), 0, 'sending');

View File

@ -1,7 +1,7 @@
<?php <?php
/* Copyright (C) 2003-2005 Rodolphe Quiedeville <rodolphe@quiedeville.org> /* Copyright (C) 2003-2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2011 Laurent Destailleur <eldy@users.sourceforge.net> * Copyright (C) 2004-2011 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2009 Regis Houssin <regis@dolibarr.fr> * Copyright (C) 2005-2012 Regis Houssin <regis@dolibarr.fr>
* *
* 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
@ -222,23 +222,17 @@ else dol_print_error($db);
/* /*
* Last shipments * Last shipments
*/ */
$clause = " WHERE ";
$sql = "SELECT e.rowid, e.ref"; $sql = "SELECT e.rowid, e.ref";
$sql.= ", s.nom, s.rowid as socid"; $sql.= ", s.nom, s.rowid as socid";
$sql.= ", c.ref as commande_ref, c.rowid as commande_id"; $sql.= ", c.ref as commande_ref, c.rowid as commande_id";
$sql.= " FROM ".MAIN_DB_PREFIX."expedition as e"; $sql.= " FROM ".MAIN_DB_PREFIX."expedition as e";
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."element_element as el ON e.rowid = el.fk_target AND el.sourcetype in ('commande')"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."element_element as el ON e.rowid = el.fk_target AND el.targettype = 'shipping' AND el.sourcetype IN ('commande')";
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."commande as c ON el.fk_source = c.rowid"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."commande as c ON el.fk_source = c.rowid AND el.sourcetype IN ('commande') AND el.targettype = 'shipping'";
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON s.rowid = e.fk_soc"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON s.rowid = e.fk_soc";
if (!$user->rights->societe->client->voir && !$socid) if (! $user->rights->societe->client->voir && ! $socid) $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe_commerciaux as sc ON e.fk_soc = sc.fk_soc";
{ $sql.= " WHERE e.entity = ".$conf->entity;
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe_commerciaux as sc ON e.fk_soc = sc.fk_soc"; if (! $user->rights->societe->client->voir && ! $socid) $sql.= " AND sc.fk_user = " .$user->id;
$sql.= $clause." sc.fk_user = " .$user->id; $sql.= " AND e.fk_statut = 1";
$clause = " AND ";
}
$sql.= $clause." e.fk_statut = 1";
$sql.= " AND e.entity = ".$conf->entity;
if ($socid) $sql.= " AND c.fk_soc = ".$socid; if ($socid) $sql.= " AND c.fk_soc = ".$socid;
$sql.= " ORDER BY e.date_delivery DESC"; $sql.= " ORDER BY e.date_delivery DESC";
$sql.= $db->plimit(5, 0); $sql.= $db->plimit(5, 0);
@ -258,7 +252,7 @@ if ($resql)
{ {
$var=!$var; $var=!$var;
$obj = $db->fetch_object($resql); $obj = $db->fetch_object($resql);
print "<tr $bc[$var]><td width=\"20%\"><a href=\"fiche.php?id=$obj->rowid\">".img_object($langs->trans("ShowSending"),"sending").' '; print '<tr '.$bc[$var].'><td width="20%"><a href="fiche.php?id='.$obj->rowid.'">'.img_object($langs->trans("ShowSending"),"sending").' ';
print $obj->ref.'</a></td>'; print $obj->ref.'</a></td>';
print '<td><a href="'.DOL_URL_ROOT.'/comm/fiche.php?socid='.$obj->socid.'">'.img_object($langs->trans("ShowCompany"),"company").' '.$obj->nom.'</a></td>'; print '<td><a href="'.DOL_URL_ROOT.'/comm/fiche.php?socid='.$obj->socid.'">'.img_object($langs->trans("ShowCompany"),"company").' '.$obj->nom.'</a></td>';
print '<td>'; print '<td>';
@ -280,8 +274,7 @@ else dol_print_error($db);
print '</td></tr></table>'; print '</td></tr></table>';
$db->close();
llxFooter(); llxFooter();
$db->close();
?> ?>

View File

@ -0,0 +1,65 @@
<?php
/* Copyright (C) 2012 Regis Houssin <regis@dolibarr.fr>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
?>
<!-- BEGIN PHP TEMPLATE -->
<?php
$langs = $GLOBALS['langs'];
$linkedObjectBlock = $GLOBALS['linkedObjectBlock'];
$langs->load("sendings");
echo '<br>';
print_titre($langs->trans('RelatedShippings'));
?>
<table class="noborder allwidth">
<tr class="liste_titre">
<td><?php echo $langs->trans("Ref"); ?></td>
<td align="center"><?php echo $langs->trans("Date"); ?></td>
<td align="center"><?php echo $langs->trans("DateSendingShort"); ?></td>
<td align="right"><?php echo $langs->trans("AmountHTShort"); ?></td>
<td align="right"><?php echo $langs->trans("Status"); ?></td>
</tr>
<?php
$var=true;
foreach($linkedObjectBlock as $object)
{
$var=!$var;
?>
<tr <?php echo $GLOBALS['bc'][$var]; ?> ><td>
<a href="<?php echo DOL_URL_ROOT.'/expedition/fiche.php?id='.$object->id ?>"><?php echo img_object($langs->trans("ShowShipping"),"sending").' '.$object->ref; ?></a></td>
<td align="center"><?php echo dol_print_date($object->date_creation,'day'); ?></td>
<td align="center"><?php echo dol_print_date($object->date_delivery,'day'); ?></td>
<td align="right"><?php echo price($object->total_ht); ?></td>
<td align="right"><?php echo $object->getLibStatut(3); ?></td>
</tr>
<?php
$total = $total + $object->total_ht;
}
?>
<tr class="liste_total">
<td align="left" colspan="3"><?php echo $langs->trans('TotalHT'); ?></td>
<td align="right"><?php echo price($total); ?></td>
<td>&nbsp;</td>
</tr>
</table>
<!-- END PHP TEMPLATE -->

View File

@ -29,6 +29,7 @@ require_once(DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.class.php');
require_once(DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.facture.class.php'); require_once(DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.facture.class.php');
require_once(DOL_DOCUMENT_ROOT.'/core/lib/fourn.lib.php'); require_once(DOL_DOCUMENT_ROOT.'/core/lib/fourn.lib.php');
require_once(DOL_DOCUMENT_ROOT."/core/lib/files.lib.php"); require_once(DOL_DOCUMENT_ROOT."/core/lib/files.lib.php");
require_once(DOL_DOCUMENT_ROOT."/core/lib/images.lib.php");
require_once(DOL_DOCUMENT_ROOT."/core/class/html.formfile.class.php"); require_once(DOL_DOCUMENT_ROOT."/core/class/html.formfile.class.php");
$langs->load('bills'); $langs->load('bills');

View File

@ -108,7 +108,7 @@ print '<tr '.$bc[false].'>';
print '<td nowrap="nowrap">'.$langs->trans("User").'</td><td>'.$user->getNomUrl(0).'</td></tr>'; print '<td nowrap="nowrap">'.$langs->trans("User").'</td><td>'.$user->getNomUrl(0).'</td></tr>';
print '<tr '.$bc[true].'>'; print '<tr '.$bc[true].'>';
print '<td nowrap="nowrap">'.$langs->trans("PreviousConnexion").'</td><td>'; print '<td nowrap="nowrap">'.$langs->trans("PreviousConnexion").'</td><td>';
if ($user->datepreviouslogin) print dol_print_date($user->datepreviouslogin,"dayhour"); if ($user->datepreviouslogin) print dol_print_date($user->datepreviouslogin,"dayhour",'tzuser');
else print $langs->trans("Unknown"); else print $langs->trans("Unknown");
print '</td>'; print '</td>';
print "</tr>\n"; print "</tr>\n";

View File

@ -0,0 +1,112 @@
<?php
/* Copyright (C) 2012 Regis Houssin <regis@dolibarr.fr>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
* or see http://www.gnu.org/
*/
/**
* \file htdocs/install/lib/repair.lib.php
* \brief Library of repair functions
*/
/**
* Check if an element exist
*
* @param int $id Element id
* @param string $table Table of Element
*/
function checkElementExist($id, $table)
{
global $db;
$sql = 'SELECT rowid FROM ' . MAIN_DB_PREFIX . $table;
$sql.= ' WHERE rowid = '.$id;
$resql=$db->query($sql);
if ($resql)
{
$num = $db->num_rows($resql);
if ($num > 0) return true;
else return false;
}
else return true; // for security
}
/**
* Check linked elements and delete if invalid
*
* @param string $sourcetype Source element type
* @param string $targettype Target element type
* @return string
*/
function checkLinkedElements($sourcetype, $targettype)
{
global $db, $langs;
$elements=array();
$deleted=0;
$sourcetable=$sourcetype;
$targettable=$targettype;
if ($sourcetype == 'shipping') $sourcetable = 'expedition';
else if ($targettype == 'shipping') $targettable = 'expedition';
if ($sourcetype == 'delivery') $sourcetable = 'livraison';
else if ($targettype == 'delivery') $targettable = 'livraison';
if ($sourcetype == 'order_supplier') $sourcetable = 'commande_fournisseur';
else if ($targettype == 'order_supplier') $targettable = 'commande_fournisseur';
if ($sourcetype == 'invoice_supplier') $sourcetable = 'facture_fourn';
else if ($targettype == 'invoice_supplier') $targettable = 'facture_fourn';
$out = $langs->trans('SourceType').': '.$sourcetype.' => '.$langs->trans('TargetType').': '.$targettype.' ';
$sql = 'SELECT * FROM '.MAIN_DB_PREFIX .'element_element';
$sql.= ' WHERE sourcetype="'.$sourcetype.'" AND targettype="'.$targettype.'"';
$resql=$db->query($sql);
if ($resql)
{
$num = $db->num_rows($resql);
if ($num)
{
$i = 0;
while ($i < $num)
{
$obj = $db->fetch_object($resql);
$elements[$obj->rowid]=array($sourcetype => $obj->fk_source, $targettype => $obj->fk_target);
$i++;
}
}
}
if (! empty($elements))
{
foreach($elements as $key => $element)
{
if (! checkElementExist($element[$sourcetype], $sourcetable) || ! checkElementExist($element[$targettype], $targettable))
{
$sql = 'DELETE FROM '.MAIN_DB_PREFIX .'element_element';
$sql.= ' WHERE rowid = '.$key;
$resql=$db->query($sql);
$deleted++;
}
}
}
if ($deleted) $out.= '('.$langs->trans('LinkedElementsInvalidDeleted', $deleted).')<br>';
else $out.= '('.$langs->trans('NothingToDelete').')<br>';
return $out;
}
?>

View File

@ -36,3 +36,8 @@ ALTER TABLE llx_commande_fournisseur CHANGE COLUMN fk_user_cloture fk_user_appro
ALTER TABLE llx_mailing MODIFY COLUMN body mediumtext; ALTER TABLE llx_mailing MODIFY COLUMN body mediumtext;
ALTER TABLE llx_mailing ADD COLUMN extraparams varchar(255); ALTER TABLE llx_mailing ADD COLUMN extraparams varchar(255);
ALTER TABLE llx_product MODIFY ref varchar(128) NOT NULL;
ALTER TABLE llx_product MODIFY ref_ext varchar(128);

View File

@ -22,10 +22,10 @@
create table llx_product create table llx_product
( (
rowid integer AUTO_INCREMENT PRIMARY KEY, rowid integer AUTO_INCREMENT PRIMARY KEY,
ref varchar(32) NOT NULL, ref varchar(128) NOT NULL,
entity integer DEFAULT 1 NOT NULL, -- Multi company id entity integer DEFAULT 1 NOT NULL, -- Multi company id
ref_ext varchar(32), -- reference into an external system (not used by dolibarr) ref_ext varchar(128), -- reference into an external system (not used by dolibarr)
datec datetime, datec datetime,
tms timestamp, tms timestamp,

View File

@ -1,7 +1,7 @@
<?php <?php
/* Copyright (C) 2004 Rodolphe Quiedeville <rodolphe@quiedeville.org> /* Copyright (C) 2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2009 Laurent Destailleur <eldy@users.sourceforge.net> * Copyright (C) 2004-2012 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2009 Regis Houssin <regis@dolibarr.fr> * Copyright (C) 2005-2012 Regis Houssin <regis@dolibarr.fr>
* *
* 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
@ -26,7 +26,7 @@ include_once("./inc.php");
if (file_exists($conffile)) include_once($conffile); if (file_exists($conffile)) include_once($conffile);
require_once($dolibarr_main_document_root."/core/lib/admin.lib.php"); require_once($dolibarr_main_document_root."/core/lib/admin.lib.php");
require_once($dolibarr_main_document_root."/core/class/extrafields.class.php"); require_once($dolibarr_main_document_root."/core/class/extrafields.class.php");
require_once("lib/repair.lib.php");
$grant_query=''; $grant_query='';
$etape = 2; $etape = 2;
@ -262,6 +262,29 @@ foreach($listofmodulesextra as $tablename => $elementtype)
} }
// Check and clean linked elements
if (GETPOST('clean_linked_elements'))
{
// propal => order
print "</td><td>".checkLinkedElements('propal', 'commande')."</td></tr>\n";
// propal => invoice
print "</td><td>".checkLinkedElements('propal', 'facture')."</td></tr>\n";
// order => invoice
print "</td><td>".checkLinkedElements('commande', 'facture')."</td></tr>\n";
// order => shipping
print "</td><td>".checkLinkedElements('commande', 'shipping')."</td></tr>\n";
// shipping => delivery
print "</td><td>".checkLinkedElements('shipping', 'delivery')."</td></tr>\n";
// order_supplier => invoice_supplier
print "</td><td>".checkLinkedElements('order_supplier', 'invoice_supplier')."</td></tr>\n";
}
// Run purge of directory // Run purge of directory
if (GETPOST('purge')) if (GETPOST('purge'))
{ {

View File

@ -24,6 +24,7 @@ TaskRDVWith=Meeting with %s
ShowTask=Show task ShowTask=Show task
ShowAction=Show event ShowAction=Show event
ActionsReport=Events report ActionsReport=Events report
ThirdPartiesOfSaleRepresentative=Thirdparties with sales representative
SalesRepresentative=Sales representative SalesRepresentative=Sales representative
SalesRepresentatives=Sales representatives SalesRepresentatives=Sales representatives
SalesRepresentativeFollowUp=Sales representative (follow-up) SalesRepresentativeFollowUp=Sales representative (follow-up)

View File

@ -39,6 +39,7 @@ ConfirmCloseService=Are you sure you want to close this service with date <b>%s<
ValidateAContract=Validate a contract ValidateAContract=Validate a contract
ActivateService=Activate service ActivateService=Activate service
ConfirmActivateService=Are you sure you want to activate this service with date <b>%s</b> ? ConfirmActivateService=Are you sure you want to activate this service with date <b>%s</b> ?
RefContract=Contract reference
DateContract=Contract date DateContract=Contract date
DateServiceActivate=Service activation date DateServiceActivate=Service activation date
DateServiceUnactivate=Service deactivation date DateServiceUnactivate=Service deactivation date

View File

@ -57,6 +57,7 @@ SendShippingRef=Send shipment %s
ActionsOnShipping=Events on shipment ActionsOnShipping=Events on shipment
LinkToTrackYourPackage=Link to track your package LinkToTrackYourPackage=Link to track your package
ShipmentCreationIsDoneFromOrder=For the moment, creation of a new shipment is done from the order card. ShipmentCreationIsDoneFromOrder=For the moment, creation of a new shipment is done from the order card.
RelatedShippings=Related shippings
# Sending methods # Sending methods
SendingMethodCATCH=Catch by customer SendingMethodCATCH=Catch by customer

View File

@ -24,6 +24,7 @@ TaskRDVWith=Rendez-vous avec %s
ShowTask=Afficher tâche ShowTask=Afficher tâche
ShowAction=Afficher événement ShowAction=Afficher événement
ActionsReport=Rapport des événements ActionsReport=Rapport des événements
ThirdPartiesOfSaleRepresentative=Tiers ayant pour commercial
SalesRepresentative=Commercial SalesRepresentative=Commercial
SalesRepresentatives=Commerciaux SalesRepresentatives=Commerciaux
SalesRepresentativeFollowUp=Commercial (suivi) SalesRepresentativeFollowUp=Commercial (suivi)

View File

@ -39,6 +39,7 @@ ConfirmCloseService=Êtes-vous sûr de vouloir fermer ce service à la date du <
ValidateAContract=Valider un contrat ValidateAContract=Valider un contrat
ActivateService=Activer le service ActivateService=Activer le service
ConfirmActivateService=Êtes-vous sûr de vouloir activer ce service en date du <b>%s</b> ? ConfirmActivateService=Êtes-vous sûr de vouloir activer ce service en date du <b>%s</b> ?
RefContract=Référence du contrat
DateContract=Date contrat DateContract=Date contrat
DateServiceActivate=Date activation du service DateServiceActivate=Date activation du service
DateServiceUnactivate=Date désactivation du service DateServiceUnactivate=Date désactivation du service

View File

@ -155,7 +155,10 @@ MigrationShippingDelivery2=Mise à jour stockage des expéditions 2
MigrationFinished=Migration terminée MigrationFinished=Migration terminée
LastStepDesc=<strong>Dernière étape</strong>: Définissez ici le compte et mot de passe du premier utilisateur que vous allez utiliser pour vous connecter à l'application. Ne perdez pas ces identifiants, il s'agit du compte permettant d'administrer les autres. LastStepDesc=<strong>Dernière étape</strong>: Définissez ici le compte et mot de passe du premier utilisateur que vous allez utiliser pour vous connecter à l'application. Ne perdez pas ces identifiants, il s'agit du compte permettant d'administrer les autres.
ActivateModule=Activation du module %s ActivateModule=Activation du module %s
LinkedElementsInvalidDeleted=<b>%s</b> liaisons invalides ont été supprimées
NothingToDelete=Aucune liaison invalide trouvée
SourceType=Source
TargetType=Cible
######### #########
# upgrade # upgrade

View File

@ -57,6 +57,7 @@ SendShippingRef=Envoi bon d'expédition %s
ActionsOnShipping=Événements sur l'expédition ActionsOnShipping=Événements sur l'expédition
LinkToTrackYourPackage=Lien pour suivi de votre colis LinkToTrackYourPackage=Lien pour suivi de votre colis
ShipmentCreationIsDoneFromOrder=Pour le moment, la création d'une nouvelle expédition se fait depuis la fiche commande. ShipmentCreationIsDoneFromOrder=Pour le moment, la création d'une nouvelle expédition se fait depuis la fiche commande.
RelatedShippings=Expédition(s) associée(s)
# Sending methods # Sending methods
SendingMethodCATCH=Enlèvement par le client SendingMethodCATCH=Enlèvement par le client

File diff suppressed because it is too large Load Diff

View File

@ -1,12 +1,12 @@
/* /*
* Language code: tr_TR * Language code: tr_TR
* Automatic generated via autotranslator.php tool * Manually generated
* Generation date 2010-03-15 19:05:26 * Generation date 2012-24-06 23:50:00
*/ */
// START - Lines generated via autotranslator.php tool (2010-03-15 19:05:26). // START - Lines generated manually (2012-24-06 23:50:00).
// Reference language: en_US // Reference language: en_US - main
CHARSET=UTF-8 CHARSET=UTF-8
DIRECTION=ltr DIRECTION=ltr
FONTFORPDF=DejaVuSans FONTFORPDF=DejaVuSans
@ -25,165 +25,165 @@ DatabaseConnection=Veritabanı bağlantısı
Error=Hata Error=Hata
ErrorFieldRequired='%s' Alanı gereklidir. ErrorFieldRequired='%s' Alanı gereklidir.
ErrorFieldFormat='%s' değeri hatalı. ErrorFieldFormat='%s' değeri hatalı.
ErrorFileDoesNotExists='%s' dosyası yok ErrorFileDoesNotExists='%s' Dosyası yok
ErrorFailedToOpenFile='%s' Dosyası açılamadı ErrorFailedToOpenFile='%s' Dosyası açılamadı
ErrorCanNotCreateDir='%s' dizini oluşturulamıyor ErrorCanNotCreateDir='%s' Dizini oluşturulamıyor
ErrorCanNotReadDir='%s' dizini okunamıyor ErrorCanNotReadDir='%s' Dizini okunamıyor
ErrorConstantNotDefined=%s Parametresi tanımlı değil ErrorConstantNotDefined=%s Parametresi tanımlı değil
ErrorUnknown=Bilinmeyen hata ErrorUnknown=Bilinmeyen hata
ErrorSQL=SQL Hatası ErrorSQL=SQL Hatası
ErrorLogoFileNotFound='%s' Logo dosyası bulunamadı ErrorLogoFileNotFound='%s' Logo dosyası bulunamadı
ErrorGoToGlobalSetup='Company/Foundation' ayarlarına giderek düzeltiniz. ErrorGoToGlobalSetup='Firma/Kuruluş' ayarlarına giderek düzeltiniz.
ErrorGoToModuleSetup=Bu düzeltmek için kurulum Modülü git ErrorGoToModuleSetup=Bunu düzeltmek için Modülü Kurulumuna git
ErrorFailedToSendMail=, Alıcı =% s) s (Sender =% posta gönderilemedi ErrorFailedToSendMail=Posta gönderilemedi (Alan=%s Gönderen=%s)
ErrorAttachedFilesDisabled=Dosya bu sunucuda devre dışı bağlama ErrorAttachedFilesDisabled=Bu sunucuda dosya ekleme engellenmiştir
ErrorFileNotUploaded=Dosya yükledi değildi. Izin verilen maksimum, bu boş geçmeyen bu boyutunu kontrol edin diskte ve mevcuttur ki, bu dizine aynı isimde zaten bir dosya değil. ErrorFileNotUploaded=Dosya gönderilemedi. Boyutun izin verilen ençok dosya boyutunu aşmadığını denetleyin, bu dizinde yeterli boş alan olmalı ve aynı isimde başka bir dosya olmamalı.
ErrorInternalErrorDetected=Hata algılandı ErrorInternalErrorDetected=Hata algılandı
ErrorNoRequestRan=No isteği koştu ErrorNoRequestRan=Hiçbir istek yürütülmedi
ErrorWrongHostParameter=Yanlış ana parametre ErrorWrongHostParameter=Yanlış ana parametre
ErrorYourCountryIsNotDefined=Ülkeniz tanımlı değil. Eve git-Kur-Düzenle ve tekrar formu gönderin. ErrorYourCountryIsNotDefined=Ülkeniz tanımlı değil. Giriş-Kur-Düzenle ye git ve formu yeniden gönder.
ErrorRecordIsUsedByChild=Bu kaydı silinemedi. Bu kaydı tarafından çocuk kayıtları en az kullanılır. ErrorRecordIsUsedByChild=Bu kayıt silinemedi. Bu kayıt en az bir alt kayıt tarafından kullanılmaktadır.
ErrorWrongValue=Yanlış değer ErrorWrongValue=Yanlış değer
ErrorWrongValueForParameterX=Parametresi% s için yanlış değer ErrorWrongValueForParameterX=Parametresi %s için yanlış değer
ErrorNoRequestInError=Hata yok isteği ErrorNoRequestInError=Hatalı istek yok
ErrorServiceUnavailableTryLater=Servis an için mevcut değil. Daha sonra tekrar deneyin. ErrorServiceUnavailableTryLater=Hizmet şu an için kullanılamıyor. Daha sonra yeniden deneyin.
ErrorDuplicateField=Benzersiz bir alanda Yinelenen değer ErrorDuplicateField=Benzersiz bir alanda yinelenen değer
ErrorSomeErrorWereFoundRollbackIsDone=Bazı hatalar bulundu. Biz geri alma değişir. ErrorSomeErrorWereFoundRollbackIsDone=Bazı hatalar bulundu. Değişikler geri alındı.
ErrorConfigParameterNotDefined=<b>Parametresi %s</b> Dolibarr yapılandırma dosyası <b>conf.php</b> içinde tanımlı değil. ErrorConfigParameterNotDefined= Parametre <b>%s</b> Dolibarr yapılandırma dosyasında <b>conf.php</b> tanımlı değil.
ErrorCantLoadUserFromDolibarrDatabase=<b>Kullanıcı %s</b> bulamadı Dolibarr veritabanında <b>var.</b> ErrorCantLoadUserFromDolibarrDatabase=Dolibarr veritabanında kullanıcı <b>%s</b> bulunamadı.
ErrorNoVATRateDefinedForSellerCountry=Hata, tanımlı ülke için vergi oranı tanımlanmamış '%s'. ErrorNoVATRateDefinedForSellerCountry=Hata, ülke '%s' için herhangi bir KDV oranı tanımlanmamış.
ErrorNoSocialContributionForSellerCountry=Hata, herhangi bir sosyal katkı tipi ülke %s tanımlanmış. ErrorNoSocialContributionForSellerCountry=Hata, ülke %s için herhangi bir sosyal güvenlik primi türü tanımlanmış.
ErrorFailedToSaveFile=Hata, dosya kaydetmek için başarısız oldu. ErrorFailedToSaveFile=Hata, dosya kaydedilemedi.
ErrorOnlyPngJpgSupported=Hata sadece. Png ve. Görüntü dosya formatı jpg desteklenmektedir. ErrorOnlyPngJpgSupported=Hata yalnızca .Png ve .jpg görüntü dosya formatları desteklenmektedir.
ErrorImageFormatNotSupported=PHP bu biçimin görüntüleri dönüştürmek için işlevleri desteklemez. ErrorImageFormatNotSupported=PHP bu biçimdeki görüntüleri dönüştürecek işlevleri desteklemez.
GoToWikiHelpPage=Read online yardım (Internet erişimi gerekir) GoToWikiHelpPage=Çevrimiçi yardım oku(Internet erişimi gerekir)
GoToHelpPage=Okuyun yardım GoToHelpPage=Yardım oku
RecordSaved=Kayıt kaydedilir RecordSaved=Kayıt kaydedildi
LevelOfFeature=Düzey özellikler LevelOfFeature= Özellik düzeyleri
NotDefined=Tanımlanmamış NotDefined=Tanımlanmamış
DefinedAndHasThisValue=Tanımlanmış ve değeri DefinedAndHasThisValue=Tanımlanmış ve şuna değer atanmıştır
IsNotDefined=undefined IsNotDefined=tanımlanmamış
DolibarrInHttpAuthenticationSoPasswordUseless=Dolibarr kimlik doğrulama modu <b>için%</b> kurulumudur yapılandırma dosyası <b>conf.php s.</b> <br> Bu şifre veritabanı Dolibarr için extern, bu nedenle hiçbir etkisi olabilir bu alanda değişen anlamına gelir. DolibarrInHttpAuthenticationSoPasswordUseless= Yapılandırma dosyası <b>conf.php</b>da Dolibarr kimlik doğrulama modu <b>%s</b> a ayarlanmıştır.<br>Bu demektir ki; veritabanı parolası Dolibarr dışıdır, yani bu alanı değiştirmek hiçbir etki yaratmaz.
Administrator=Yönetici Administrator=Yönetici
Undefined=Undefined Undefined=Tanımlanmamış
PasswordForgotten=Şifrenizi mi unuttunuz? PasswordForgotten=Şifrenizi mi unuttunuz?
SeeAbove=Bak yukarıda SeeAbove=Yukarı bak
HomeArea=Ev alanı HomeArea=Giriş alanı
LastConnexion=Son bağlantı LastConnexion=Son bağlantı
PreviousConnexion=Önceki bağlantısı PreviousConnexion=Önceki bağlantısı
ConnectedOnMultiCompany=Taraf Doğum Bağlı ConnectedOnMultiCompany=Çevreye bağlanmış
ConnectedSince=Beri Bağlı ConnectedSince=den beri bağlı
AuthenticationMode=Doğrulama modu AuthenticationMode=Doğrulama modu
RequestedUrl=İstenen URL RequestedUrl=İstenen URL
DatabaseTypeManager=Veritabanı tipi yönetici DatabaseTypeManager=Veritabanı türü yönetici
RequestLastAccess=İstek son veritabanı erişimi RequestLastAccess=Son veritabanı erişimi isteği
RequestLastAccessInError=İstek hatası geçen veritabanı erişimi RequestLastAccessInError=Son veritabanı erişimi istek hatası
ReturnCodeLastAccessInError=Hata son veritabanı erişimi Dönüş kodu ReturnCodeLastAccessInError= kodunu göster
InformationLastAccessInError=Bilgi hatası geçen veritabanı erişimi InformationLastAccessInError= Hatalı son veritabanı erişimi bilgisi
DolibarrHasDetectedError=Dolibarr teknik bir hata algıladı DolibarrHasDetectedError=Dolibarr teknik bir hata algıladı
InformationToHelpDiagnose=Bu bilgiler teşhis etmeye yardımcı olabilir InformationToHelpDiagnose=Bu bilgiler teşhis etmeye yardımcı olabilir
MoreInformation=Daha fazla bilgi MoreInformation=Daha fazla bilgi
NotePublic=(Kamu) Not NotePublic=Not (Genel)
NotePrivate=Not (özel) NotePrivate=Not (özel)
PrecisionUnitIsLimitedToXDecimals=<b>Dolibarr%</b> için birim fiyatlar hassas sınırlamak için kurulum oldu ondalık <b>var.</b> PrecisionUnitIsLimitedToXDecimals=Dolibarr birim fiyatlar için hassasiyeti <b>%s</b> ondalık olarak sınırlandırmıştır.
DoTest=Deneme DoTest=Deneme
ToFilter=Filtre ToFilter=Süzgeç
WarningYouHaveAtLeastOneTaskLate=Uyarı, bu hoşgörü gecikme aştı en az bir eleman var. WarningYouHaveAtLeastOneTaskLate=Uyarı, gecikme toleransını aşan en az bir var.
yes=evet yes=evet
Yes=Evet Yes=Evet
no=hayır no=hayır
No=Hayır No=Hayır
All=Hepsi All=Hepsi
Home=Ev Home=Giriş
Help=Yardım Help=Yardım
OnlineHelp=Online yardım OnlineHelp=Çevrimiçi yardım
PageWiki=Wiki sayfası PageWiki=Wiki sayfası
Always=Daima Always=Daima
Never=Asla Never=Asla
Under=altında Under=altında
Period=Dönem Period=Dönem
PeriodEndDate=Dönem için Bitiş tarihi PeriodEndDate=Dönem için Bitiş tarihi
Activate=Etkinleştirmek Activate=Etkinleştir
Activated=Aktive Activated=Etkin
Closed=Kapalı Closed=Kapalı
Closed2=Kapalı Closed2=Kapalı
Enabled=Etkin Enabled=Etkin
Disable=Devre dışı bırakmak Disable=Engelli
Disabled=Engelli Disabled=Engelli
Add=Eklemek Add=Ekle
Update=Güncellemek Update=Güncelle
AddActionToDo=Eylem ekleme yapmak AddActionToDo=Yapılacak eylem ekle
AddActionDone=Add eylem yapıldı AddActionDone=Bitmiş eylem ekle
Close=Kapatmak Close=Kapat
Close2=Kapatmak Close2=Kapat
Confirm=Onayla Confirm=Onayla
ConfirmSendCardByMail=Gerçekten posta ile bu kart göndermek istiyor musunuz? ConfirmSendCardByMail=Gerçekten bu kartı posta ile <b>%s</b> a göndermek istiyor musunuz?
Delete=Silmek Delete=Sil
Remove=Çıkarmak Remove=Çıkar
Resiliate=Resiliate Resiliate=Sonlandır
Cancel=Iptal Cancel=İptal
Modify=Değiştirmek Modify=Değiştir
Edit=Değiştir Edit=Düzenle
Validate=Validate Validate=Doğrula
ToValidate=Doğrulamak için ToValidate=Doğrulamak için
Save=Kaydetmek Save=Kaydet
SaveAs=Farklı kaydet SaveAs=Farklı kaydet
TestConnection=Test bağlantısı TestConnection=Test bağlantısı
ToClone=Clone ToClone=Klonla
ConfirmClone=Sen clone istediğiniz verileri seçin: ConfirmClone=Klonlamak istediğiniz verileri seçin:
NoCloneOptionsSpecified=Hiçbir veri tanımlı clone. NoCloneOptionsSpecified= Klonlanacak hiçbir veri tanımlanmamış.
CopyOf=Kopya CopyOf=Kopyası
Show=Göstermek Show=Göster
ShowCardHere=Show kart ShowCardHere=Kartı göster
Search=Aramak Search=Ara
Valid=Geçerli Valid=Geçerli
Approve=Onayla Approve=Onayla
ReOpen=Yeniden açın ReOpen=Yeniden aç
Upload=Dosya gönder Upload=Dosya gönder
Select=Seçin Select=Seç
Choose=Seçmek Choose=Seç
ChooseLangage=Lütfen dilinizi seçin ChooseLangage=Lütfen dilinizi seçin
Author=Yazar Author=Yazar
User=Kullanıcı User=Kullanıcı
Users=Kullanıcılar Users=Kullanıcılar
Group=Grup Group=Grup
Groups=Gruplar Groups=Gruplar
Password=Şifre Password=Parola
PasswordRetype=Şifrenizi yeniden yazın PasswordRetype=Parolanızı yeniden yazın
NoteSomeFeaturesAreDisabled=Bu özellikleri bir çok / modules bu gösteriye özürlü olduğunu unutmayın. NoteSomeFeaturesAreDisabled=Bu demoda bir çok özelliğin/modülün engelli olduğuna dikkat edin.
Name=Ad Name=Ad
Person=Kişi Person=Kişi
Parameter=Parametre Parameter=Parametre
Parameters=Parametreler Parameters=Parametreler
Value=Fiyat Value=Değer
GlobalValue=Küresel değer GlobalValue=Genel değer
PersonalValue=Kişisel değer PersonalValue=Kişisel değer
NewValue=Yeni değeri NewValue=Yeni değer
CurrentValue=Şimdiki değeri CurrentValue=Geçerli değer
Code=Kodu Code=Kod
Type=Tür Type=Tür
Language=Dil Language=Dil
MultiLanguage=Multi-language MultiLanguage=Çoklu-dil
Note=Not Note=Not
CurrentNote=Geçerli notu CurrentNote=Geçerli not
Title=Title Title=Başlık
Label=Etiket Label=Etiket
RefOrLabel=Ref. veya etiket RefOrLabel=Ref. veya etiket
Info=Log Info=Log
Family=Aile Family=Aile
Description=Açıklamalar Description=Açıklama
Designation=Açıklamalar Designation=Açıklama
Model=Model Model=Model
DefaultModel=Varsayılan modeli DefaultModel=Varsayılan model
Action=Eylem Action=Eylem
About=Ile ilgili About=Hakkında
WelcomeString=% <font class="body">Vardır ve biz</font> ler <font class="body">kullanıcı bağlı olarak%</font> s WelcomeString=% <font class="body">Vardır ve biz</font> ler <font class="body">kullanıcı bağlı olarak%</font> s
Number=Numarası Number=Sayı
Numero=Numero Numero=Sayı
Limit=Limit Limit=Sınır
Limits=Limitleri Limits=Sınırlar
DevelopmentTeam=Geliştirme Ekibi DevelopmentTeam=Geliştirme Ekibi
Logout=Logout Logout=Çıkış
Connection=Bağlantı Connection=Bağlantı
Setup=Kurulum Setup=Kurulum
Alert=Uyarı Alert=Uyarı
@ -193,25 +193,25 @@ Cards=Kartlar
Card=Kart Card=Kart
Now=Şimdi Now=Şimdi
Date=Tarih Date=Tarih
DateStart=Tarihi başlangıç DateStart= Başlangıç tarihi
DateEnd=Tarih sonu DateEnd=Bitiş tarih
DateCreation=Oluşturma tarihi DateCreation=Oluşturma tarihi
DateModification=Modification date DateModification=Değiştirme tarihi
DateModificationShort=Modif. tarih DateModificationShort=Değiş. tarihi
DateLastModification=Son değiştirme tarihini DateLastModification=Son değiştirme tarihi
DateValidation=Doğrulama Tarih DateValidation=Doğrulama tarihi
DateClosing=Kapanış tarihi DateClosing=Kapanış tarihi
DateDue=Son tarih DateDue=Vade tarihi
DateValue=Değer tarih DateValue=Satış tarihi (valör)
DateValueShort=Değer tarih DateValueShort=Satış tarihi
DateOperation=Operasyon tarih DateOperation=İşlem tarihi
DateOperationShort=Oper. Tarih DateOperationShort=İşl. Tarih
DateLimit=Limit Tarih DateLimit=Sınır tarihi
DateRequest=Request Date DateRequest=İstek tarihi
DateProcess=Tarih süreci DateProcess=İşleme tarihi
DatePlanShort=Tarih Rendeleme DatePlanShort=Planlana tarih
DateRealShort=Tarih gerçek. DateRealShort= Gerç.Tarih
DateBuild=Rapor tarihi inşa DateBuild=Oluşturma tarihi raporu
DurationYear=yıl DurationYear=yıl
DurationMonth=ay DurationMonth=ay
DurationWeek=hafta DurationWeek=hafta
@ -226,7 +226,7 @@ Week=Hafta
Day=Gün Day=Gün
Hour=Saat Hour=Saat
Minute=Dakika Minute=Dakika
Second=Ikinci Second=Saniye
Years=Yıl Years=Yıl
Months=Ay Months=Ay
Days=Gün Days=Gün
@ -237,11 +237,11 @@ Seconds=Saniye
Today=Bugün Today=Bugün
Yesterday=Dün Yesterday=Dün
Tomorrow=Yarın Tomorrow=Yarın
Quadri=Quadri Quadri=Çeyrek
MonthOfDay=Ay gün MonthOfDay=Ayın günü
HourShort=H HourShort=H
Rate=Oran Rate=Oran
Bytes=Bytes Bytes=Bayt
KiloBytes=Kilobayt KiloBytes=Kilobayt
MegaBytes=Megabayt MegaBytes=Megabayt
GigaBytes=Gigabayt GigaBytes=Gigabayt
@ -249,91 +249,91 @@ b=b.
Kb=Kb Kb=Kb
Mb=Mb Mb=Mb
Gb=Gb Gb=Gb
Cut=Kesmek Cut=Kes
Copy=Kopya Copy=Kopyala
Paste=Yapıştırmak Paste=Yapıştır
Default=Varsayılan Default=Varsayılan
DefaultValue=Varsayılan değer DefaultValue=Varsayılan değer
DefaultGlobalValue=Küresel değer DefaultGlobalValue=Genel değer
Price=Fiyat Price=Fiyat
UnitPrice=Birim fiyat UnitPrice=Birim fiyat
UnitPriceHT=Birim fiyat (net) UnitPriceHT=Birim fiyat (net)
UnitPriceTTC=Birim fiyat UnitPriceTTC=Birim fiyat
PriceU=UP PriceU=B.F.
PriceUHT=UP (net) PriceUHT=B.F. (net)
PriceUTTC=UP PriceUTTC=B.F.
Amount=Miktar Amount=Tutar
AmountInvoice=Fatura tutarı AmountInvoice=Fatura tutarı
AmountPayment=Ödeme tutarı AmountPayment=Ödeme tutarı
AmountHTShort=Tutar (net) AmountHTShort=Tutar (net)
AmountTTCShort=Miktarı (bahis vergi) AmountTTCShort=Miktarı (vergi dahil)
AmountHT=Tutar (vergi net) AmountHT=Tutar (vergi hariç)
AmountTTC=Miktarı (bahis vergi) AmountTTC=Miktarı (vergi dahil)
AmountVAT=Miktar KDV AmountVAT= KDV tutarı
AmountTotal=Toplam tutar AmountTotal=Toplam tutar
AmountAverage=Ortalama miktar AmountAverage=Ortalama tutar
PriceQtyHT=Fiyat bu miktar için (vergi net) PriceQtyHT= Bu miktar için fiyat (vergi hariç)
PriceQtyMinHT=Fiyat miktar dk. (vergi net) PriceQtyMinHT=Enaz miktar fiyatı (vergi hariç)
PriceQtyTTC=Fiyat bu miktar (bahis vergi için) PriceQtyTTC= Bu miktar için fiyat (vergi dahil)
PriceQtyMinTTC=Fiyat miktar dk. (bahis vergi) PriceQtyMinTTC= Enaz miktar fiyatı (vergi dahil)
Percentage=Yüzde Percentage=Yüzde
Total=Toplam Total=Toplam
SubTotal=Subtotal SubTotal=Aratoplam
TotalHTShort=(Net) Toplam TotalHTShort=Toplam (Net)
TotalTTCShort=Toplam (bahis vergi) TotalTTCShort=Toplam (vergi dahil)
TotalHT=(Toplam vergi net) TotalHT=Toplam (vergi hariç)
TotalTTC=Toplam (bahis vergi) TotalTTC=Toplam (vergi dahil)
TotalTTCToYourCredit=Kredi için toplam (bahis vergi) TotalTTCToYourCredit=Kredi için toplam (vergi dahil)
TotalVAT=Toplam KDV TotalVAT=Toplam KDV
IncludedVAT=KDV dahil IncludedVAT=KDV dahil
HT=Vergi Net HT=Vergi hariç
TTC=Inc KDV TTC=KDV dahil
VAT=KDV VAT=KDV
VATRate=KDV Oranı VATRate=KDV Oranı
Average=Ortalama Average=Ortalama
Sum=Sum Sum=Toplam
Delta=Delta Delta=Değişim oranı
Module=Modülü Module=Modül
Option=Seçenek Option=Seçenek
List=List List=Liste
FullList=Tüm liste FullList=Tüm liste
Statistics=İstatistikler Statistics=İstatistikler
Status=Konum Status=Durum
Ref=Ref. Ref=Ref.
RefSupplier=Ref. tedarikçi RefSupplier=Ref. tedarikçi
RefPayment=Ref. ödeme RefPayment=Ref. ödeme
CommercialProposals=Ticari öneriler CommercialProposals=Ticari teklifler
Comment=Yorum Comment=Yorum
Comments=Yorumlar Comments=Yorumlar
ActionsToDo=Yapılacak Eylemler ActionsToDo=Yapılacak Eylemler
ActionsDone=Eylemler yapıldı ActionsDone=Biten eylemler
ActionsToDoShort=Yapmak için ActionsToDoShort=Yapılacaklar
ActionsRunningshort=Başladı ActionsRunningshort=Başladı
ActionsDoneShort=Yapıldı ActionsDoneShort=Yapıldı
ActionRunningNotStarted=Başlamadı ActionRunningNotStarted=Başlamadı
ActionRunningShort=Başladı ActionRunningShort=Başladı
ActionDoneShort=Bitmiş ActionDoneShort=Bitti
CompanyFoundation=Firma / Kuruluş CompanyFoundation=Firma/Kuruluş
ContactsForCompany=Firma Kartvizitleri ContactsForCompany=Firma Kartvizitleri
ActionsOnCompany=Bu üçüncü parti hakkında Eylemler ActionsOnCompany=Bu üçüncü parti hakkındaki eylemler
NActions=% eylemler s NActions=%s eylemleri
NActionsLate=% geç NActionsLate=%s geç
Filter=Filtre Filter=Süzgeç
RemoveFilter=Kaldır filtre RemoveFilter=Süzgeç kaldır
ChartGenerated=Grafik oluşturuldu ChartGenerated=Grafik oluşturuldu
ChartNotGenerated=Grafik değil oluşturuldu ChartNotGenerated=Grafik oluşturulmadı
GeneratedOn=Build% s GeneratedOn=%s Oluşturuldu
Generate=Oluşturmak Generate=Oluştur
Duration=Süre Duration=Süre
TotalDuration=Toplam süresi TotalDuration=Toplam süre
Summary=Özet Summary=Özet
MyBookmarks=My bookmarks MyBookmarks=Yerimlerim
OtherInformationsBoxes=Diğer bilgiler kutuları OtherInformationsBoxes=Diğer bilgi kutuları
DolibarrBoard=Dolibarr kurulu DolibarrBoard=Dolibarr kurulu
DolibarrStateBoard=İstatistikler DolibarrStateBoard=İstatistikler
DolibarrWorkBoard=Iş görevleri kurulu DolibarrWorkBoard=Iş görevleri kurulu
NotYetAvailable=Henüz mevcut NotYetAvailable=Henüz mevcut değil
NotAvailable=Müsait değil NotAvailable=Uygun değil
Popularity=Popülerlik Popularity=Popülerlik
Categories=Kategoriler Categories=Kategoriler
Category=Kategori Category=Kategori
@ -346,115 +346,115 @@ Other=Diğer
Others=Diğerleri Others=Diğerleri
OtherInformations=Diğer Bilgiler OtherInformations=Diğer Bilgiler
Quantity=Miktar Quantity=Miktar
Qty=Adet Qty=Mik
ChangedBy=Tarafından değiştirilmedi ChangedBy=Tarafından değiştirildi
ReCalculate=Yeniden ReCalculate=Yeniden hesapla
ResultOk=Başarı ResultOk=Başarılı
ResultKo=Kusur ResultKo=Başarısız
Reporting=Raporlama Reporting=Raporlama
Reportings=Raporlama Reportings=Raporlama
Draft=Taslak Draft=Taslak
Drafts=Taslaklar Drafts=Taslaklar
Validated=Validated Validated=Doğrulanmış
Opened=Açılış Opened=Açık
New=Yeni New=Yeni
Discount=Indirimli Discount=İndirim
Unknown=Unknown Unknown=Bilinmeyen
General=Genel General=Genel
Size=Büyüklük Size=Boyut
Received=Alınan Received=Alınan
Paid=Ödenmiş Paid=Ödenen
Topic=Sujet Topic=Konu
ByCompanies=Şirketler tarafından ByCompanies=Şirketlere göre
ByUsers=Kullanıcılar tarafından ByUsers=Kullanıcılara göre
Links=Linkler Links=Bağlantılar
Link=Bağlantı Link=Bağlantı
Receipts=Makbuzlar Receipts=Makbuzlar
Rejects=Reddetti Rejects=Kusurlular
Preview=Önizleme Preview=Önizleme
NextStep=Sonraki adım NextStep=Sonraki adım
PreviousStep=Önceki adım PreviousStep=Önceki adım
Datas=Veri Datas=Veriler
None=Hiçbiri None=Hiçbiri
NoneF=Hiçbiri NoneF=Hiçbiri
Late=Geç Late=Geç
Photo=Resim Photo=Resim
Photos=Resimler Photos=Resimler
AddPhoto=Resim ekle AddPhoto=Resim ekle
Login=Oturum açmak Login=Oturum aç
CurrentLogin=Geçerli giriş CurrentLogin=Geçerli giriş
January=Ocak January=Ocak
February=Subat February=Şubat
March=Mart March=Mart
April=Nisan April=Nisan
May=Yapabilir May=Mayıs
June=Haziran June=Haziran
July=Temmuz July=Temmuz
August=Agustos August=Ağustos
September=Eylül September=Eylül
October=Ekim October=Ekim
November=Kasım November=Kasım
December=Aralık December=Aralık
Month01=Ocak Month01=ocak
Month02=Subat Month02=şubat
Month03=yürüyüş Month03=mart
Month04=Nisan Month04=nisan
Month05=yapabilir Month05=mayıs
Month06=Haziran Month06=haziran
Month07=Temmuz Month07=temmuz
Month08=Agustos Month08=ağustos
Month09=Eylül Month09=eylül
Month10=Ekim Month10=ekim
Month11=Kasım Month11=kasım
Month12=Aralık Month12=aralık
MonthShort01=Ocak MonthShort01=Oca
MonthShort02=Subat MonthShort02=Şub
MonthShort03=mar MonthShort03=Mar
MonthShort04=Nisan MonthShort04=Nis
MonthShort05=yapabilir MonthShort05=May
MonthShort06=Haziran MonthShort06=Haz
MonthShort07=Temmuz MonthShort07=Tem
MonthShort08=Agustos MonthShort08=Ağu
MonthShort09=Eylül MonthShort09=Eyl
MonthShort10=Ekim MonthShort10=Eki
MonthShort11=Kasım MonthShort11=Kas
MonthShort12=Aralık MonthShort12=Ara
AttachedFiles=Ekli dosya ve belgeler AttachedFiles=Ekli dosya ve belgeler
FileTransferComplete=Dosya başarıyla yüklenmedi FileTransferComplete=Dosya başarıyla gönderildi
DateFormatYYYYMM=YYYY-AA DateFormatYYYYMM=YYYY-AA
DateFormatYYYYMMDD=YYYY-AA-GG DateFormatYYYYMMDD=YYYY-AA-GG
DateFormatYYYYMMDDHHMM=YYYY-AA-GG SS: SS DateFormatYYYYMMDDHHMM=YYYY-AA-GG SS: SS
ReportName=Rapor Adı ReportName=Rapor Adı
ReportPeriod=Rapor süresi ReportPeriod=Rapor dönemi
ReportDescription=Açıklamalar ReportDescription=Açıklama
Report=Rapor Report=Rapor
Keyword=Mot clé Keyword=Anahtar kelime
Legend=Legend Legend=Gösterge
FillTownFromZip=Zip den doldurun şehir FillTownFromZip= İli Posta Kodundan (zip) doldurun
ShowLog=Show log ShowLog=Günlüğ (loğu) göster
File=Dosya File=Dosya
Files=Dosyalar Files=Dosyalar
NotAllowed=Izin verilmiyor NotAllowed=İzin verilmez
ReadPermissionNotAllowed=Okuma izni izin ReadPermissionNotAllowed=Okuma izni yok
AmountInCurrency=Döviz miktarı% s AmountInCurrency=Para birimi tutarı %s
Example=Örnek Example=Örnek
NoExample=Hayır Örneğin NoExample=Örnek yok
FindBug=Hata bildir FindBug=Hata bul
NbOfThirdParties=Sayı üçüncü tarafların NbOfThirdParties=Üçüncü parti sayısı
NbOfCustomers=Sayı müşterilerinin NbOfCustomers=Müşterilerin sayısı
NbOfLines=Satır sayısı NbOfLines=Satır sayısı
NbOfObjects=Sayı nesnelerin NbOfObjects=Nesne sayısı
NbOfReferers=Sayı yönlendirmelerin NbOfReferers=Yönlendirenlerin sayısı
Referers=Referanslar Referers=Referanslar
TotalQuantity=Toplam miktar TotalQuantity=Toplam miktar
DateFromTo=Den%% s DateFromTo=%s den %s e kadar
DateFrom=% S DateFrom=%s den
DateUntil=Kadar% s DateUntil= %s e Kadar
Check=Kontrol etmek Check=Denetle
Internal=Iç Internal=İç
External=Harici External=Dış
Internals=Iç Internals=İçler
Externals=Harici Externals=Dışlar
Warning=Uyarı Warning=Uyarı
Warnings=Uyarılar Warnings=Uyarılar
BuildPDF=PDF oluştur BuildPDF=PDF oluştur
@ -463,22 +463,22 @@ BuildDoc=Doc oluştur
RebuildDoc=Yeniden Doc oluştur RebuildDoc=Yeniden Doc oluştur
Entity=Varlık Entity=Varlık
Entities=Varlıklar Entities=Varlıklar
EventLogs=Kayıtlar EventLogs=Günlükler (loglar)
CustomerPreview=Müşteri önizleme CustomerPreview=Müşteri önizleme
SupplierPreview=Tedarikçi önizleme SupplierPreview=Tedarikçi önizleme
AccountancyPreview=Muhasebe önizleme AccountancyPreview=Muhasebe önizleme
ShowCustomerPreview=Müşteri önizlemeyi göster ShowCustomerPreview=Müşteri önizlemeyi göster
ShowSupplierPreview=Tedarikçi önizlemeyi göster ShowSupplierPreview=Tedarikçi önizlemeyi göster
ShowAccountancyPreview=Muhasebe önizlemeyi göster ShowAccountancyPreview=Muhasebe önizlemeyi göster
ShowProspectPreview=Potansiyel önizlemeyi göster ShowProspectPreview=Aday önizlemeyi göster
RefCustomer=Müşteri Ref. RefCustomer=Müşteri Ref.
Currency=Döviz Currency=Para birimi
InfoAdmin=Yöneticiler için InfoAdmin=Yöneticiler için bilgi
Undo=Geri al Undo=Geri al
Redo=İleri al Redo=Yinele
ExpandAll=Tümünü genişlet ExpandAll=Tümünü genişlet
UndoExpandAll=Daralt UndoExpandAll=Genişletmeyi geri al
Reason=Sebep Reason=Neden
FeatureNotYetSupported=Özellik henüz desteklenmiyor FeatureNotYetSupported=Özellik henüz desteklenmiyor
CloseWindow=Pencereyi kapat CloseWindow=Pencereyi kapat
Question=Soru Question=Soru
@ -486,11 +486,11 @@ Response=Yanıt
Priority=Öncelik Priority=Öncelik
MailSentBy=E-posta ile gönderildi MailSentBy=E-posta ile gönderildi
TextUsedInTheMessageBody=Mesaj gövdesinde yazı kullanıldı. TextUsedInTheMessageBody=Mesaj gövdesinde yazı kullanıldı.
SendAcknowledgementByMail=Ack gönderin. e-posta ile SendAcknowledgementByMail=Alındı bilgisini e-posta ile gönder.
NoEMail=E-posta yok NoEMail=E-posta yok
Owner=Sahip Owner=Sahibi
DetectedVersion=Tespit sürümü DetectedVersion= Nelirlenen sürüm
FollowingConstantsWillBeSubstituted=Aşağıdaki sabitler ilgili değeri yerine olacaktır. FollowingConstantsWillBeSubstituted=Aşağıdaki sabitler uygun değerlerin yerine konacaktır.
Refresh=Yenile Refresh=Yenile
BackToList=Listeye dön BackToList=Listeye dön
GoBack=Geri dön GoBack=Geri dön
@ -498,60 +498,60 @@ CanBeModifiedIfOk=Geçerliyse değiştirilebilir
CanBeModifiedIfKo=Geçerli değilse değiştirilebilir CanBeModifiedIfKo=Geçerli değilse değiştirilebilir
RecordModifiedSuccessfully=Kayıt başarıyla değiştirildi RecordModifiedSuccessfully=Kayıt başarıyla değiştirildi
AutomaticCode=Otomatik kod AutomaticCode=Otomatik kod
NotManaged=Yönetilmeyen NotManaged=Başarılamadı
FeatureDisabled=Özellik devre dışı FeatureDisabled=Özellik devre dışı
MoveBox=Hareket kutusu %s MoveBox= Kutu %s i taşı
Offered=Teklif Offered=Önerilen
NotEnoughPermissions=Bu eylem için izin yok NotEnoughPermissions=Bu eylem için izininiz yok
SessionName=Oturum adı SessionName=Oturum adı
Method=Yöntem Method=Yöntem
Receive=Almak Receive=Al
PartialWoman=Kısmi PartialWoman=Kısmi
PartialMan=Kısmi PartialMan=Kısmi
TotalWoman=Toplam TotalWoman=Toplam
TotalMan=Toplam TotalMan=Toplam
NeverReceived=Hiç alınan NeverReceived=Hiç alınmadı
Canceled=Iptal Canceled=Vazgeçildi
YouCanChangeValuesForThisListFromDictionnarySetup=Menü kurulum bu liste için değerleri değiştirebilirsiniz - dictionnary YouCanChangeValuesForThisListFromDictionnarySetup=Bu listedeki değerleri Kurulum->Sözlük kurulumu menüsünden değiştirebilirsiniz
Color=Color Color=Renk
Documents=Bağlı dosyalar Documents=Bağlı dosyalar
DocumentsNb=Bağlı dosyalar (% s) DocumentsNb=Bağlı dosyalar (%s)
Documents2=Belgeler Documents2=Belgeler
BuildDocuments=Oluşturulan belgeleri BuildDocuments=Oluşturulan belgeler
UploadDisabled=Engelli yükle UploadDisabled=Gönderme engelli
MenuECM=Belgeler MenuECM=Belgeler
MenuAWStats=AWStats MenuAWStats=AWStats
MenuMembers=Üye MenuMembers=Üyeler
MenuAgendaGoogle=Google gündemi MenuAgendaGoogle=Google gündemi
ThisLimitIsDefinedInSetup=Dolibarr sınırı (Menü ev-kurulum-güvenlik):% Kb, PHP sınırı:% s s KB ThisLimitIsDefinedInSetup=Dolibarr sınırı (Giriş->Kurulum->Güvenlik menüsü):%s Kb, PHP sınırı:%s Kb
NoFileFound=Hiçbir belge bu dizine kaydedilir NoFileFound=Hiçbir belge bu dizine kaydedilmedi
CurrentUserLanguage=Geçerli dil CurrentUserLanguage=Geçerli dil
CurrentTheme=Geçerli tema CurrentTheme=Geçerli tema
DisabledModules=Engelli modülleri DisabledModules=Engelli modüller
For=Için For=İçin
ForCustomer=Müşteri için ForCustomer=Müşteriler için
Signature=İmza Signature=İmza
HidePassword=Şifre ile Show komutu gizli HidePassword= Komutu gizli parola ile göster
UnHidePassword=Net şifre ile göster gerçek komut UnHidePassword=Gerçek komutu açık parola ile göster
Root=Root Root=Kök
Informations=Bilgi Informations=Bilgi
Page=Sayfa Page=Sayfa
Notes=Notlar Notes=Notlar
AddNewLine=Yeni satır ekle AddNewLine=Yeni satır ekle
AddFile=Dosya ekle AddFile=Dosya ekle
ListOfFiles=Dosyaları mevcuttur Listesi ListOfFiles=Varolan dosyaların listesi
FreeZone=Serbest metin FreeZone=Serbest metin
CloneMainAttributes=Ana özellikleri ile Clone nesne CloneMainAttributes=Nesneyi ana öznitelikleri ile klonla
PDFMerge=PDF Birleştirme PDFMerge=PDF Birleştir
Merge=Merge Merge=Birleştir
PrintContentArea=Show sayfa ana içerik alanı yazdırmak için PrintContentArea=Sayfa yazdırılacak ana içerik alanını göster
NoMenu=No alt menü NoMenu=Alt menü yok
WarningYouAreInMaintenanceMode=Uyarı, bir bakım modunda <b>s</b> şu anda uygulamayı kullanmak için izin verilen bu nedenle yalnızca <b>giriş%</b> bulunmaktadır. WarningYouAreInMaintenanceMode=Uyarı, bakım modundasınız, şu anda uygulamayı kullanmak için yalnızca <b>%s</b> girişine izin veriliyor.
CreditCard=Kredi kartı CreditCard=Kredi kartı
FieldsWithAreMandatory=<b>Alanları% s</b> ile zorunludur FieldsWithAreMandatory=<b>%s</b> olan alanları zorunludur
FieldsWithIsForPublic=Alanları <b>ile%</b> üyelerinin kamu listesi gösterilir <b>var.</b> Bunu istemiyorum, &quot;kamu&quot; kutusunu işaretleyin. FieldsWithIsForPublic= Üyelerin genel listelerinde <b>%s</b> olan alanlar gösterilir. Bunu istemiyorsanız, “genel” kutusundan işareti kaldırın.
AccordingToGeoIPDatabase=(GeoIP dönüşüm göre) AccordingToGeoIPDatabase=(GeoIP dönüşümüne göre)
Line=Line Line=Satır
NotSupported=Desteklenmez NotSupported=Desteklenmez
RequiredField=Gerekli alan RequiredField=Gerekli alan
Day1=Pazartesi Day1=Pazartesi
@ -561,47 +561,38 @@ Day4=Perşembe
Day5=Cuma Day5=Cuma
Day6=Cumartesi Day6=Cumartesi
Day0=Pazar Day0=Pazar
ShortMonday=M ShortMonday=Pt
ShortTuesday=T ShortTuesday=Sa
ShortWednesday=W ShortWednesday=Ça
ShortThursday=T ShortThursday=Pe
ShortFriday=F ShortFriday=Cu
ShortSaturday=S ShortSaturday=Ct
ShortSunday=S ShortSunday=Pa
// STOP - Lines generated via autotranslator.php tool (2010-03-15 19:05:26).
// START - Lines generated via autotranslator.php tool (2010-09-04 02:09:13).
// Reference language: en_US -> tr_TR
FormatHourShortDuration=%H:%M FormatHourShortDuration=%H:%M
NoError=Hata NoError=Hata yok
BackgroundColorByDefault=Varsayılan arkaplan rengi BackgroundColorByDefault=Varsayılan arkaplan rengi
FileWasNotUploaded=Dosya eki için seçilen ancak henüz tarih değildi. Ekle yi tıklatın Dosya bunun için. FileWasNotUploaded= Bu ekleme için bir dosya seçildi ama henüz gönderilmedi. Bunun için “Dosya ekle” ye tıklayın.
NbOfEntries=Nb girişlerinin NbOfEntries=Girişlerin sayısı
Resize=Resize Resize=Yeniden boyutlandır
Recenter=Recenter Recenter=Yeniden ortala
NumberByMonth=Sayı ay NumberByMonth=Aya göre say
AmountLT1ES=Miktar RE AmountLT1ES= RE Tutarı
AmountLT2ES=Miktar IRPF AmountLT2ES= IRPF Tutarı
TotalLT1ES=Toplam RE TotalLT1ES=Toplam RE
TotalLT2ES=Toplam IRPF TotalLT2ES=Toplam IRPF
Available=Mevcut Available=Mevcut
Examples=Örnekler Examples=Örnekler
Reason=Neden Reason=Neden
SendByMail=E-posta Gönder tarafından SendByMail=E-posta ile gönder
Result=Sonuç Result=Sonuç
ToTest=Test ToTest=Denem
ValidateBefore=Kart bu özelliği kullanmadan önce kontrol edilmeli ValidateBefore= Bu özelliği kullanmadan önce kart doğrulanmalıdır
Visibility=Görünürlük Visibility=Görünürlük
Private=Özel Private=Özel
Hidden=Gizli Hidden=Gizli
Resources=Kaynaklar Resources=Kaynaklar
Source=Kaynak Source=Kaynak
Prefix=Önek Prefix=Önek
// STOP - Lines generated via autotranslator.php tool (2010-09-04 02:22:35).
// START - Lines generated via autotranslator.php tool (2011-10-09 14:05:49).
// Reference language: en_US -> tr_TR
FormatDateShortJQuery=dd/mm/yy FormatDateShortJQuery=dd/mm/yy
DatePayment=Ödeme tarihi DatePayment=Ödeme tarihi
TeraBytes=Terabayt TeraBytes=Terabayt
@ -609,79 +600,58 @@ Tb=Tb
OtherStatistics=Diğer istatistikler OtherStatistics=Diğer istatistikler
ActionNotApplicable=Uygulanamaz ActionNotApplicable=Uygulanamaz
JanuaryMin=Ara JanuaryMin=Ara
FebruaryMin=Şubat FebruaryMin=Şub
MarchMin=Bozmak MarchMin=Mar
AprilMin=Nisan AprilMin=Nis
MayMin=Mayıs MayMin=May
WednesdayMin=Biz WednesdayMin=Ça
ThursdayMin=Th ThursdayMin=Pe
FridayMin=Fr FridayMin=Cu
SaturdayMin=Sa SaturdayMin=Ct
SundayMin=Su SundayMin=Pa
// STOP - Lines generated via autotranslator.php tool (2011-10-09 14:21:16).
// START - Lines generated via autotranslator.php tool (2011-10-10 11:19:16).
// Reference language: en_US -> tr_TR
AddLink=Link ekle AddLink=Link ekle
Of=, Of=,
SearchOf=Arama SearchOf=Ara
DecemberMin=Aralık DecemberMin=Ara
CoreErrorTitle=Sistem hatası CoreErrorTitle=Sistem hatası
CoreErrorMessage=Üzgünüz, bir hata oluştu. Günlükleri kontrol edin veya sistem yöneticinize başvurun. CoreErrorMessage=Üzgünüz, bir hata oluştu. Günlükleri kontrol edin veya sistem yöneticinize başvurun.
Before=Önce Before=Önce
URLPhoto=Fotoğraf / logo url URLPhoto=Fotoğrafın/logonun url si
CreateDraft=Taslak oluşturun CreateDraft=Taslak oluştur
Monday=Pazartesi Monday=Pazartesi
Tuesday=Salı Tuesday=Salı
Wednesday=Çarşamba Wednesday=Çarşamba
// STOP - Lines generated via autotranslator.php tool (2011-10-10 11:57:40).
// START - Lines generated via autotranslator.php tool (2011-10-10 12:34:37).
// Reference language: en_US -> tr_TR
AmountByMonth=Aylık Tutarı AmountByMonth=Aylık Tutarı
IM=Anlık mesajlaşma IM=Anlık mesajlaşma
NewAttribute=Yeni bir öznitelik NewAttribute=Yeni bir öznitelik
AttributeCode=Nitelik kodu AttributeCode=Öznitelik kodu
OptionalFieldsSetup=Ekstra özellikler Ayarları OptionalFieldsSetup=Ekstra öznitelik ayarları
Thursday=Perşembe Thursday=Perşembe
// STOP - Lines generated via autotranslator.php tool (2011-10-10 12:52:14). JuneMin=Haz
JulyMin=Tem
AugustMin=Ağu
// START - Lines generated via autotranslator.php tool (2011-10-10 13:39:01). SeptemberMin=Eyl
// Reference language: en_US -> tr_TR OctoberMin=Eki
JuneMin=Haziran NovemberMin=Kas
JulyMin=Temmuz
AugustMin=Ağustos
SeptemberMin=Eylül
OctoberMin=Ekim
NovemberMin=Kasım
After=Sonra After=Sonra
IPAddress=IP adresi IPAddress=IP adresi
Frequency=Frekans Frequency=Frekans
Friday=Cuma Friday=Cuma
Saturday=Cumartesi Saturday=Cumartesi
Sunday=Pazar Sunday=Pazar
MondayMin=Mo MondayMin=Pt
TuesdayMin=Tu TuesdayMin=Sa
// STOP - Lines generated via autotranslator.php tool (2011-10-10 13:50:27).
// START - Lines generated via autotranslator.php tool (2012-02-29 17:35:48).
// Reference language: en_US -> tr_TR
LT1ES=RE LT1ES=RE
LT2ES=IRPF LT2ES=IRPF
ActionsOnMember=Bu üye hakkında Etkinlikler ActionsOnMember=Bu üye hakkında eylemler
SetLinkToThirdParty=Başka bir üçüncü taraf bağlantı SetLinkToThirdParty=Başka bir üçüncü parti bağlantısı
ClickToEdit=Düzenlemek için tıklayın ClickToEdit=Düzenlemek için tıklayın
ObjectDeleted=Nesne %s silindi ObjectDeleted=Nesne %s silindi
ByCountry=Ülkeye göre ByCountry=Ülkeye göre
ByTown=Kasaba ByTown=İlçeye göre
ByDate=Tarihe göre ByDate=Tarihe göre
ByMonthYear=Ay / yıl olarak ByMonthYear=Ay/yıl olarak
ByYear=Yılına ByYear=Yıla göre
ByMonth=ay ByMonth=Aya göre
ByDay=Gündüzleri ByDay=Güne göre
BySalesRepresentative=Satış temsilcisinin BySalesRepresentative=Satış temsilcisine göre
// STOP - Lines generated via autotranslator.php tool (2012-02-29 17:36:49).

View File

@ -807,7 +807,7 @@ class Livraison extends CommonObject
global $langs; global $langs;
// Get the linked object // Get the linked object
$this->fetchObjectLinked(-1,-1,$this->id,$this->element); $this->fetchObjectLinked('','',$this->id,$this->element);
//var_dump($this->linkedObjectIds); //var_dump($this->linkedObjectIds);
// Get the product ref and qty in source // Get the product ref and qty in source
$sqlSourceLine = "SELECT st.rowid, st.description, st.qty"; $sqlSourceLine = "SELECT st.rowid, st.description, st.qty";

View File

@ -1011,21 +1011,15 @@ function top_htmlhead($head, $title='', $disablejs=0, $disablehead=0, $arrayofjs
if (! empty($conf->fckeditor->enabled) && (empty($conf->global->FCKEDITOR_EDITORNAME) || $conf->global->FCKEDITOR_EDITORNAME == 'ckeditor')) if (! empty($conf->fckeditor->enabled) && (empty($conf->global->FCKEDITOR_EDITORNAME) || $conf->global->FCKEDITOR_EDITORNAME == 'ckeditor'))
{ {
print '<!-- Includes JS for CKEditor -->'."\n"; print '<!-- Includes JS for CKEditor -->'."\n";
if (constant('JS_CKEDITOR')) $pathckeditor=DOL_URL_ROOT.'/includes/ckeditor/';
{ if (constant('JS_CKEDITOR')) $pathckeditor=JS_CKEDITOR; // To use external ckeditor js lib
print '<script type="text/javascript">var CKEDITOR_BASEPATH = \''.JS_CKEDITOR.'\';</script>'."\n"; print '<script type="text/javascript">';
print '<script type="text/javascript" src="'.JS_CKEDITOR.'ckeditor_basic.js"></script>'."\n"; print 'var CKEDITOR_BASEPATH = \''.$pathckeditor.'\';'."\n";
} print 'var ckeditorConfig = \''.dol_buildpath('/theme/'.$conf->theme.'/ckeditor/config.js',1).'\';'."\n";
else print 'var ckeditorFilebrowserBrowseUrl = \''.DOL_URL_ROOT.'/core/filemanagerdol/browser/default/browser.php?Connector='.DOL_URL_ROOT.'/core/filemanagerdol/connectors/php/connector.php\';'."\n";
{ print 'var ckeditorFilebrowserImageBrowseUrl = \''.DOL_URL_ROOT.'/core/filemanagerdol/browser/default/browser.php?Type=Image&Connector='.DOL_URL_ROOT.'/core/filemanagerdol/connectors/php/connector.php\';'."\n";
print '<script type="text/javascript">'; print '</script>'."\n";
print 'var CKEDITOR_BASEPATH = \''.DOL_URL_ROOT.'/includes/ckeditor/\';'."\n"; print '<script type="text/javascript" src="'.$pathckeditor.'ckeditor_basic.js"></script>'."\n";
print 'var ckeditorConfig = \''.dol_buildpath('/theme/'.$conf->theme.'/ckeditor/config.js',1).'\';'."\n";
print 'var ckeditorFilebrowserBrowseUrl = \''.DOL_URL_ROOT.'/core/filemanagerdol/browser/default/browser.php?Connector='.DOL_URL_ROOT.'/core/filemanagerdol/connectors/php/connector.php\';'."\n";
print 'var ckeditorFilebrowserImageBrowseUrl = \''.DOL_URL_ROOT.'/core/filemanagerdol/browser/default/browser.php?Type=Image&Connector='.DOL_URL_ROOT.'/core/filemanagerdol/connectors/php/connector.php\';'."\n";
print '</script>'."\n";
print '<script type="text/javascript" src="'.DOL_URL_ROOT.'/includes/ckeditor/ckeditor_basic.js"></script>'."\n";
}
} }
// Global js function // Global js function

View File

@ -1,4 +1,4 @@
<?PHP <?php
/* Copyright (C) 2002-2007 Rodolphe Quiedeville <rodolphe@quiedeville.org> /* Copyright (C) 2002-2007 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2003 Xavier Dutoit <doli@sydesy.com> * Copyright (C) 2003 Xavier Dutoit <doli@sydesy.com>
* Copyright (C) 2004-2012 Laurent Destailleur <eldy@users.sourceforge.net> * Copyright (C) 2004-2012 Laurent Destailleur <eldy@users.sourceforge.net>
@ -155,11 +155,6 @@ if (! empty($conf->file->mailing_limit_sendbyweb))
// If software has been locked. Only login $conf->global->MAIN_ONLY_LOGIN_ALLOWED is allowed. // If software has been locked. Only login $conf->global->MAIN_ONLY_LOGIN_ALLOWED is allowed.
if (! empty($conf->global->MAIN_ONLY_LOGIN_ALLOWED)) if (! empty($conf->global->MAIN_ONLY_LOGIN_ALLOWED))
{ {
/*print '$_SERVER["GATEWAY_INTERFACE"]='.$_SERVER["GATEWAY_INTERFACE"].'<br>';
print 'session_id()='.session_id().'<br>';
print '$_SESSION["dol_login"]='.$_SESSION["dol_login"].'<br>';
print '$conf->global->MAIN_ONLY_LOGIN_ALLOWED='.$conf->global->MAIN_ONLY_LOGIN_ALLOWED.'<br>';
exit;*/
$ok=0; $ok=0;
if ((! session_id() || ! isset($_SESSION["dol_login"])) && ! isset($_POST["username"]) && ! empty($_SERVER["GATEWAY_INTERFACE"])) $ok=1; // We let working pages if not logged and inside a web browser (login form, to allow login by admin) if ((! session_id() || ! isset($_SESSION["dol_login"])) && ! isset($_POST["username"]) && ! empty($_SERVER["GATEWAY_INTERFACE"])) $ok=1; // We let working pages if not logged and inside a web browser (login form, to allow login by admin)
elseif (isset($_POST["username"]) && $_POST["username"] == $conf->global->MAIN_ONLY_LOGIN_ALLOWED) $ok=1; // We let working pages that is a login submission (login submit, to allow login by admin) elseif (isset($_POST["username"]) && $_POST["username"] == $conf->global->MAIN_ONLY_LOGIN_ALLOWED) $ok=1; // We let working pages that is a login submission (login submit, to allow login by admin)
@ -205,20 +200,24 @@ if (! defined('NOREQUIREDB') && ! defined('NOREQUIRESOC'))
$mysoc->state_id=$conf->global->MAIN_INFO_SOCIETE_DEPARTEMENT; $mysoc->state_id=$conf->global->MAIN_INFO_SOCIETE_DEPARTEMENT;
$mysoc->note=empty($conf->global->MAIN_INFO_SOCIETE_NOTE)?'':$conf->global->MAIN_INFO_SOCIETE_NOTE; $mysoc->note=empty($conf->global->MAIN_INFO_SOCIETE_NOTE)?'':$conf->global->MAIN_INFO_SOCIETE_NOTE;
// We define pays_id, pays_code and country // We define country_id, country_code and country
$tmp=explode(':',$conf->global->MAIN_INFO_SOCIETE_PAYS); $country_id=$country_code=$country_label='';
$country_id=$tmp[0]; if (! empty($conf->global->MAIN_INFO_SOCIETE_PAYS))
if (! empty($tmp[1])) // If $conf->global->MAIN_INFO_SOCIETE_PAYS is "id:code:label"
{ {
$country_code=$tmp[1]; $tmp=explode(':',$conf->global->MAIN_INFO_SOCIETE_PAYS);
$country_label=$tmp[2]; $country_id=$tmp[0];
} if (! empty($tmp[1])) // If $conf->global->MAIN_INFO_SOCIETE_PAYS is "id:code:label"
else // For backward compatibility {
{ $country_code=$tmp[1];
dol_syslog("Your country setup use an old syntax. Reedit it in setup area.", LOG_WARNING); $country_label=$tmp[2];
include_once(DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'); }
$country_code=getCountry($country_id,2,$db); // This need a SQL request, but it's the old feature else // For backward compatibility
$country_label=getCountry($country_id,0,$db); // This need a SQL request, but it's the old feature {
dol_syslog("Your country setup use an old syntax. Reedit it using setup area.", LOG_WARNING);
include_once(DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php');
$country_code=getCountry($country_id,2,$db); // This need a SQL request, but it's the old feature
$country_label=getCountry($country_id,0,$db); // This need a SQL request, but it's the old feature
}
} }
$mysoc->pays_id=$country_id; // TODO deprecated $mysoc->pays_id=$country_id; // TODO deprecated
$mysoc->country_id=$country_id; $mysoc->country_id=$country_id;

View File

@ -2405,9 +2405,12 @@ class Product extends CommonObject
{ {
$this->stock_reel = 0; $this->stock_reel = 0;
$sql = "SELECT reel, fk_entrepot, pmp"; $sql = "SELECT ps.reel, ps.fk_entrepot, ps.pmp";
$sql.= " FROM ".MAIN_DB_PREFIX."product_stock"; $sql.= " FROM ".MAIN_DB_PREFIX."product_stock as ps";
$sql.= " WHERE fk_product = '".$this->id."'"; $sql.= ", ".MAIN_DB_PREFIX."entrepot as w";
$sql.= " WHERE w.entity = (".getEntity('warehouse', 1).")";
$sql.= " AND w.rowid = ps.fk_entrepot";
$sql.= " AND ps.fk_product = ".$this->id;
dol_syslog(get_class($this)."::load_stock sql=".$sql); dol_syslog(get_class($this)."::load_stock sql=".$sql);
$result = $this->db->query($sql); $result = $this->db->query($sql);
@ -2615,7 +2618,7 @@ class Product extends CommonObject
if (! utf8_check($file)) $file=utf8_encode($file); // To be sure file is stored in UTF8 in memory if (! utf8_check($file)) $file=utf8_encode($file); // To be sure file is stored in UTF8 in memory
if (dol_is_file($dir.$file) && preg_match('/(\.jpg|\.bmp|\.gif|\.png|\.tiff)$/i',$dir.$file)) if (dol_is_file($dir.$file) && preg_match('/(\.jpg|\.bmp|\.gif|\.png|\.tiff)$/i', $dir.$file))
{ {
$nbphoto++; $nbphoto++;
$photo = $file; $photo = $file;
@ -2624,8 +2627,8 @@ class Product extends CommonObject
if ($size == 1) { // Format vignette if ($size == 1) { // Format vignette
// On determine nom du fichier vignette // On determine nom du fichier vignette
$photo_vignette=''; $photo_vignette='';
if (preg_match('/(\.jpg|\.bmp|\.gif|\.png|\.tiff)$/i',$photo,$regs)) { if (preg_match('/(\.jpg|\.bmp|\.gif|\.png|\.tiff)$/i', $photo, $regs)) {
$photo_vignette=preg_replace('/'.$regs[0].'/i','',$photo)."_small".$regs[0]; $photo_vignette=preg_replace('/'.$regs[0].'/i', '', $photo)."_small".$regs[0];
if (! dol_is_file($dirthumb.$photo_vignette)) $photo_vignette=''; if (! dol_is_file($dirthumb.$photo_vignette)) $photo_vignette='';
} }
@ -2660,7 +2663,7 @@ class Product extends CommonObject
{ {
$return.= '<br>'; $return.= '<br>';
// On propose la generation de la vignette si elle n'existe pas et si la taille est superieure aux limites // On propose la generation de la vignette si elle n'existe pas et si la taille est superieure aux limites
if ($photo_vignette && preg_match('/(\.bmp|\.gif|\.jpg|\.jpeg|\.png)$/i',$photo) && ($product->imgWidth > $maxWidth || $product->imgHeight > $maxHeight)) if ($photo_vignette && preg_match('/(\.bmp|\.gif|\.jpg|\.jpeg|\.png)$/i', $photo) && ($product->imgWidth > $maxWidth || $product->imgHeight > $maxHeight))
{ {
$return.= '<a href="'.$_SERVER["PHP_SELF"].'?id='.$_GET["id"].'&amp;action=addthumb&amp;file='.urlencode($pdir.$viewfilename).'">'.img_picto($langs->trans('GenerateThumb'),'refresh').'&nbsp;&nbsp;</a>'; $return.= '<a href="'.$_SERVER["PHP_SELF"].'?id='.$_GET["id"].'&amp;action=addthumb&amp;file='.urlencode($pdir.$viewfilename).'">'.img_picto($langs->trans('GenerateThumb'),'refresh').'&nbsp;&nbsp;</a>';
} }
@ -2747,16 +2750,16 @@ class Product extends CommonObject
while (($file = readdir($handle)) != false) while (($file = readdir($handle)) != false)
{ {
if (! utf8_check($file)) $file=utf8_encode($file); // readdir returns ISO if (! utf8_check($file)) $file=utf8_encode($file); // readdir returns ISO
if (dol_is_file($dir.$file)) if (dol_is_file($dir.$file) && preg_match('/(\.jpg|\.bmp|\.gif|\.png|\.tiff)$/i', $dir.$file))
{ {
$nbphoto++; $nbphoto++;
// On determine nom du fichier vignette // On determine nom du fichier vignette
$photo=$file; $photo=$file;
$photo_vignette=''; $photo_vignette='';
if (preg_match('/(\.jpg|\.bmp|\.gif|\.png|\.tiff)$/i',$photo,$regs)) if (preg_match('/(\.jpg|\.bmp|\.gif|\.png|\.tiff)$/i', $photo, $regs))
{ {
$photo_vignette=preg_replace('/'.$regs[0].'/i','',$photo).'_small'.$regs[0]; $photo_vignette=preg_replace('/'.$regs[0].'/i', '', $photo).'_small'.$regs[0];
} }
$dirthumb = $dir.'thumbs/'; $dirthumb = $dir.'thumbs/';

View File

@ -126,7 +126,7 @@ if (empty($reshook))
$action=""; $action="";
} }
if ($action == 'setaccountancy_code_buy') if ($action == 'setaccountancy_code_sell')
{ {
$object->fetch($id,$ref); $object->fetch($id,$ref);
$result = $object->setValueFrom('accountancy_code_sell', $_POST['accountancy_code_sell']); $result = $object->setValueFrom('accountancy_code_sell', $_POST['accountancy_code_sell']);

View File

@ -76,6 +76,8 @@ class Entrepot extends CommonObject
*/ */
function create($user) function create($user)
{ {
global $conf;
// Si libelle non defini, erreur // Si libelle non defini, erreur
if ($this->libelle == '') if ($this->libelle == '')
{ {
@ -87,8 +89,8 @@ class Entrepot extends CommonObject
$this->db->begin(); $this->db->begin();
$sql = "INSERT INTO ".MAIN_DB_PREFIX."entrepot (datec, fk_user_author, label)"; $sql = "INSERT INTO ".MAIN_DB_PREFIX."entrepot (entity, datec, fk_user_author, label)";
$sql .= " VALUES ('".$this->db->idate($now)."',".$user->id.",'".$this->db->escape($this->libelle)."')"; $sql .= " VALUES (".$conf->entity.",'".$this->db->idate($now)."',".$user->id.",'".$this->db->escape($this->libelle)."')";
dol_syslog(get_class($this)."::create sql=".$sql); dol_syslog(get_class($this)."::create sql=".$sql);
$result=$this->db->query($sql); $result=$this->db->query($sql);
@ -99,7 +101,7 @@ class Entrepot extends CommonObject
{ {
$this->id = $id; $this->id = $id;
if ( $this->update($id, $user) > 0) if ($this->update($id, $user) > 0)
{ {
$this->db->commit(); $this->db->commit();
return $id; return $id;
@ -184,7 +186,6 @@ class Entrepot extends CommonObject
*/ */
function delete($user) function delete($user)
{ {
$this->db->begin(); $this->db->begin();
$sql = "DELETE FROM ".MAIN_DB_PREFIX."stock_mouvement"; $sql = "DELETE FROM ".MAIN_DB_PREFIX."stock_mouvement";
@ -338,7 +339,8 @@ class Entrepot extends CommonObject
$sql = "SELECT rowid, label"; $sql = "SELECT rowid, label";
$sql.= " FROM ".MAIN_DB_PREFIX."entrepot"; $sql.= " FROM ".MAIN_DB_PREFIX."entrepot";
$sql.= " WHERE statut = ".$status; $sql.= " WHERE entity IN (".getEntity('warehouse', 1).")";
$sql.= " AND statut = ".$status;
$result = $this->db->query($sql); $result = $this->db->query($sql);
$i = 0; $i = 0;
@ -363,13 +365,13 @@ class Entrepot extends CommonObject
*/ */
function nb_products() function nb_products()
{ {
global $conf,$user;
$ret=array(); $ret=array();
$sql = "SELECT sum(ps.reel) as nb, sum(ps.reel * ps.pmp) as value"; $sql = "SELECT sum(ps.reel) as nb, sum(ps.reel * ps.pmp) as value";
$sql .= " FROM ".MAIN_DB_PREFIX."product_stock as ps, ".MAIN_DB_PREFIX."product as p"; $sql.= " FROM ".MAIN_DB_PREFIX."product_stock as ps";
$sql .= " WHERE ps.fk_entrepot = ".$this->id." AND ps.fk_product=p.rowid"; $sql.= ", ".MAIN_DB_PREFIX."product as p";
$sql.= " WHERE ps.fk_entrepot = ".$this->id;
$sql.= " AND ps.fk_product = p.rowid";
//print $sql; //print $sql;
$result = $this->db->query($sql); $result = $this->db->query($sql);

View File

@ -44,7 +44,7 @@ $id = GETPOST('id')?GETPOST('id'):GETPOST('ref');
$ref = GETPOST('ref'); $ref = GETPOST('ref');
$fieldid = isset($_GET["ref"])?'ref':'rowid'; $fieldid = isset($_GET["ref"])?'ref':'rowid';
if ($user->societe_id) $socid=$user->societe_id; if ($user->societe_id) $socid=$user->societe_id;
$result=restrictedArea($user,'produit&stock',$id,'product','','',$fieldid); $result=restrictedArea($user,'produit&stock',$id,'product&product','','',$fieldid);
$mesg = ''; $mesg = '';
@ -217,6 +217,7 @@ if ($_GET["id"] || $_GET["ref"])
print '</tr>'; print '</tr>';
// Real stock // Real stock
$product->load_stock();
print '<tr><td>'.$langs->trans("PhysicalStock").'</td>'; print '<tr><td>'.$langs->trans("PhysicalStock").'</td>';
print '<td>'.$product->stock_reel; print '<td>'.$product->stock_reel;
if ($product->seuil_stock_alerte && ($product->stock_reel < $product->seuil_stock_alerte)) print ' '.img_warning($langs->trans("StockTooLow")); if ($product->seuil_stock_alerte && ($product->stock_reel < $product->seuil_stock_alerte)) print ' '.img_warning($langs->trans("StockTooLow"));

View File

@ -409,6 +409,8 @@ class Societe extends CommonObject
$this->idprof2 = trim($this->idprof2); $this->idprof2 = trim($this->idprof2);
$this->idprof3 = trim($this->idprof3); $this->idprof3 = trim($this->idprof3);
$this->idprof4 = trim($this->idprof4); $this->idprof4 = trim($this->idprof4);
$this->idprof5 = trim($this->idprof5);
$this->idprof6 = trim($this->idprof6);
$this->prefix_comm = trim($this->prefix_comm); $this->prefix_comm = trim($this->prefix_comm);
$this->tva_assuj = trim($this->tva_assuj); $this->tva_assuj = trim($this->tva_assuj);
@ -442,6 +444,12 @@ class Societe extends CommonObject
$this->error = $langs->trans("ErrorBadEMail",$this->email); $this->error = $langs->trans("ErrorBadEMail",$this->email);
return -1; return -1;
} }
if (! is_numeric($this->client) && ! is_numeric($this->fournisseur))
{
$langs->load("errors");
$this->error = $langs->trans("BadValueForParameterClientOrSupplier");
return -1;
}
$this->db->begin(); $this->db->begin();
@ -469,10 +477,12 @@ class Societe extends CommonObject
$sql .= ",email = ".($this->email?"'".$this->db->escape($this->email)."'":"null"); $sql .= ",email = ".($this->email?"'".$this->db->escape($this->email)."'":"null");
$sql .= ",url = ".($this->url?"'".$this->db->escape($this->url)."'":"null"); $sql .= ",url = ".($this->url?"'".$this->db->escape($this->url)."'":"null");
$sql .= ",siren = '". $this->db->escape($this->idprof1) ."'"; $sql .= ",siren = '". $this->db->escape($this->idprof1) ."'";
$sql .= ",siret = '". $this->db->escape($this->idprof2) ."'"; $sql .= ",siret = '". $this->db->escape($this->idprof2) ."'";
$sql .= ",ape = '". $this->db->escape($this->idprof3) ."'"; $sql .= ",ape = '". $this->db->escape($this->idprof3) ."'";
$sql .= ",idprof4 = '". $this->db->escape($this->idprof4) ."'"; $sql .= ",idprof4 = '". $this->db->escape($this->idprof4) ."'";
$sql .= ",idprof5 = '". $this->db->escape($this->idprof5) ."'";
$sql .= ",idprof6 = '". $this->db->escape($this->idprof6) ."'";
$sql .= ",tva_assuj = ".($this->tva_assuj!=''?"'".$this->tva_assuj."'":"null"); $sql .= ",tva_assuj = ".($this->tva_assuj!=''?"'".$this->tva_assuj."'":"null");
$sql .= ",tva_intra = '" . $this->db->escape($this->tva_intra) ."'"; $sql .= ",tva_intra = '" . $this->db->escape($this->tva_intra) ."'";
@ -627,7 +637,7 @@ class Societe extends CommonObject
$sql .= ', s.price_level'; $sql .= ', s.price_level';
$sql .= ', s.tms as date_update'; $sql .= ', s.tms as date_update';
$sql .= ', s.tel, s.fax, s.email, s.url, s.cp as zip, s.ville as town, s.note, s.client, s.fournisseur'; $sql .= ', s.tel, s.fax, s.email, s.url, s.cp as zip, s.ville as town, s.note, s.client, s.fournisseur';
$sql .= ', s.siren as idprof1, s.siret as idprof2, s.ape as idprof3, s.idprof4'; $sql .= ', s.siren as idprof1, s.siret as idprof2, s.ape as idprof3, s.idprof4, s.idprof5, s.idprof6';
$sql .= ', s.capital, s.tva_intra'; $sql .= ', s.capital, s.tva_intra';
$sql .= ', s.fk_typent as typent_id'; $sql .= ', s.fk_typent as typent_id';
$sql .= ', s.fk_effectif as effectif_id'; $sql .= ', s.fk_effectif as effectif_id';
@ -721,6 +731,8 @@ class Societe extends CommonObject
$this->idprof2 = $obj->idprof2; $this->idprof2 = $obj->idprof2;
$this->idprof3 = $obj->idprof3; $this->idprof3 = $obj->idprof3;
$this->idprof4 = $obj->idprof4; $this->idprof4 = $obj->idprof4;
$this->idprof5 = $obj->idprof5;
$this->idprof6 = $obj->idprof6;
$this->capital = $obj->capital; $this->capital = $obj->capital;
@ -2331,6 +2343,8 @@ class Societe extends CommonObject
$this->idprof2='idprof2'; $this->idprof2='idprof2';
$this->idprof3='idprof3'; $this->idprof3='idprof3';
$this->idprof4='idprof4'; $this->idprof4='idprof4';
$this->idprof5='idprof5';
$this->idprof6='idprof6';
} }
} }

View File

@ -1,7 +1,7 @@
<?php <?php
/* Copyright (C) 2001-2007 Rodolphe Quiedeville <rodolphe@quiedeville.org> /* Copyright (C) 2001-2007 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2003 Brian Fraval <brian@fraval.org> * Copyright (C) 2003 Brian Fraval <brian@fraval.org>
* Copyright (C) 2004-2011 Laurent Destailleur <eldy@users.sourceforge.net> * Copyright (C) 2004-2012 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005 Eric Seigne <eric.seigne@ryxeo.com> * Copyright (C) 2005 Eric Seigne <eric.seigne@ryxeo.com>
* Copyright (C) 2005-2012 Regis Houssin <regis@dolibarr.fr> * Copyright (C) 2005-2012 Regis Houssin <regis@dolibarr.fr>
* Copyright (C) 2008 Patrick Raguin <patrick.raguin@auguria.net> * Copyright (C) 2008 Patrick Raguin <patrick.raguin@auguria.net>
@ -629,7 +629,7 @@ else
$object->forme_juridique_code=$_POST['forme_juridique_code']; $object->forme_juridique_code=$_POST['forme_juridique_code'];
/* Show create form */ /* Show create form */
print_fiche_titre($langs->trans("NewCompany")); print_fiche_titre($langs->trans("NewThirdParty"));
if ($conf->use_javascript_ajax) if ($conf->use_javascript_ajax)
{ {
@ -760,6 +760,7 @@ else
print '</td></tr>'; print '</td></tr>';
// Category // Category
/* This must be set into category tab, like for customer category
if ($object->fournisseur) if ($object->fournisseur)
{ {
$load = $object->LoadSupplierCateg(); $load = $object->LoadSupplierCateg();
@ -773,7 +774,7 @@ else
print '</td></tr>'; print '</td></tr>';
} }
} }
} }*/
} }
// Status // Status
@ -860,7 +861,7 @@ else
print "\n"; print "\n";
print '<script language="JavaScript" type="text/javascript">'; print '<script language="JavaScript" type="text/javascript">';
print "function CheckVAT(a) {\n"; print "function CheckVAT(a) {\n";
print "newpopup('".DOL_URL_ROOT."/societe/checkvat/checkVatPopup.php?vatNumber='+a,'".dol_escape_js($langs->trans("VATIntraCheckableOnEUSite"))."',500,230);\n"; print "newpopup('".DOL_URL_ROOT."/societe/checkvat/checkVatPopup.php?vatNumber='+a,'".dol_escape_js($langs->trans("VATIntraCheckableOnEUSite"))."',500,300);\n";
print "}\n"; print "}\n";
print '</script>'; print '</script>';
print "\n"; print "\n";
@ -1747,43 +1748,8 @@ else
print '</td></tr>'; print '</td></tr>';
} }
// Commercial // Sales representative
print '<tr><td>'; include(DOL_DOCUMENT_ROOT.'/societe/tpl/linesalesrepresentative.tpl.php');
print '<table width="100%" class="nobordernopadding"><tr><td>';
print $langs->trans('SalesRepresentatives');
print '<td><td align="right">';
if ($user->rights->societe->creer)
print '<a href="'.DOL_URL_ROOT.'/societe/commerciaux.php?socid='.$object->id.'">'.img_edit().'</a>';
else
print '&nbsp;';
print '</td></tr></table>';
print '</td>';
print '<td colspan="3">';
$listsalesrepresentatives=$object->getSalesRepresentatives($user);
$nbofsalesrepresentative=count($listsalesrepresentatives);
if ($nbofsalesrepresentative > 3) // We print only number
{
print '<a href="'.DOL_URL_ROOT.'/societe/commerciaux.php?socid='.$object->id.'">';
print $nbofsalesrepresentative;
print '</a>';
}
else if ($nbofsalesrepresentative > 0)
{
$userstatic=new User($db);
$i=0;
foreach($listsalesrepresentatives as $val)
{
$userstatic->id=$val['id'];
$userstatic->lastname=$val['name'];
$userstatic->firstname=$val['firstname'];
print $userstatic->getNomUrl(1);
$i++;
if ($i < $nbofsalesrepresentative) print ', ';
}
}
else print $langs->trans("NoSalesRepresentativeAffected");
print '</td></tr>';
// Module Adherent // Module Adherent
if ($conf->adherent->enabled) if ($conf->adherent->enabled)

View File

@ -0,0 +1,39 @@
<?php
// Sale representative
print '<tr><td>';
print '<table width="100%" class="nobordernopadding"><tr><td>';
print $langs->trans('SalesRepresentatives');
print '<td><td align="right">';
if ($user->rights->societe->creer)
print '<a href="'.DOL_URL_ROOT.'/societe/commerciaux.php?socid='.$object->id.'">'.img_edit().'</a>';
else
print '&nbsp;';
print '</td></tr></table>';
print '</td>';
print '<td colspan="3">';
$listsalesrepresentatives=$object->getSalesRepresentatives($user);
$nbofsalesrepresentative=count($listsalesrepresentatives);
if ($nbofsalesrepresentative > 3) // We print only number
{
print '<a href="'.DOL_URL_ROOT.'/societe/commerciaux.php?socid='.$object->id.'">';
print $nbofsalesrepresentative;
print '</a>';
}
else if ($nbofsalesrepresentative > 0)
{
$userstatic=new User($db);
$i=0;
foreach($listsalesrepresentatives as $val)
{
$userstatic->id=$val['id'];
$userstatic->lastname=$val['name'];
$userstatic->firstname=$val['firstname'];
print $userstatic->getNomUrl(1);
$i++;
if ($i < $nbofsalesrepresentative) print ', ';
}
}
else print $langs->trans("NoSalesRepresentativeAffected");
print '</td></tr>';
?>

View File

@ -52,7 +52,7 @@ CKEDITOR.editorConfig = function( config )
['Undo','Redo','-','Find','Replace'], ['Undo','Redo','-','Find','Replace'],
['Font','FontSize'], ['Font','FontSize'],
['Bold','Italic','Underline','Strike','Subscript','Superscript','-','TextColor','RemoveFormat'], ['Bold','Italic','Underline','Strike','Subscript','Superscript','-','TextColor','RemoveFormat'],
['NumberedList','BulletedList','Outdent','Indent'], ['NumberedList','BulletedList','Outdent','Indent','CreateDiv'],
['JustifyLeft','JustifyCenter','JustifyRight','JustifyBlock'], ['JustifyLeft','JustifyCenter','JustifyRight','JustifyBlock'],
['Link','Unlink','Anchor','Image','Table','SpecialChar'] ['Link','Unlink','Anchor','Image','Table','SpecialChar']
]; ];

View File

@ -52,7 +52,7 @@ CKEDITOR.editorConfig = function( config )
['Undo','Redo','-','Find','Replace'], ['Undo','Redo','-','Find','Replace'],
['Font','FontSize'], ['Font','FontSize'],
['Bold','Italic','Underline','Strike','Subscript','Superscript','-','TextColor','RemoveFormat'], ['Bold','Italic','Underline','Strike','Subscript','Superscript','-','TextColor','RemoveFormat'],
['NumberedList','BulletedList','Outdent','Indent'], ['NumberedList','BulletedList','Outdent','Indent','CreateDiv'],
['JustifyLeft','JustifyCenter','JustifyRight','JustifyBlock'], ['JustifyLeft','JustifyCenter','JustifyRight','JustifyBlock'],
['Link','Unlink','Anchor','Image','Table','SpecialChar'] ['Link','Unlink','Anchor','Image','Table','SpecialChar']
]; ];

View File

@ -1178,45 +1178,46 @@ border-left: 1px solid #000000;
/* Main boxes */ /* Main boxes */
table.noborder { table.noborder {
border-collapse: collapse; border-collapse: collapse;
border-top-color: #FEFEFE; border-top-color: #FEFEFE;
border-right-width: 1px; border-right-width: 1px;
border-right-color: #BBBBBB; border-right-color: #BBBBBB;
border-right-style: solid; border-right-style: solid;
border-left-width: 1px; border-left-width: 1px;
border-left-color: #BBBBBB; border-left-color: #BBBBBB;
border-left-style: solid; border-left-style: solid;
border-bottom-width: 1px; border-bottom-width: 1px;
border-bottom-color: #BBBBBB; border-bottom-color: #BBBBBB;
border-bottom-style: solid; border-bottom-style: solid;
margin-left: 1px; margin-left: 1px;
margin-right: 1px; margin-right: 1px;
margin-bottom: 2px; margin-bottom: 2px;
margin-top: 0px; margin-top: 0px;
-moz-box-shadow: 4px 4px 4px #CCC; -moz-box-shadow: 4px 4px 4px #CCC;
-webkit-box-shadow: 4px 4px 4px #CCC; -webkit-box-shadow: 4px 4px 4px #CCC;
box-shadow: 4px 4px 4px #CCC; box-shadow: 4px 4px 4px #CCC;
} }
table.noborder tr { table.noborder tr {
border-top-color: #FEFEFE; border-top-color: #FEFEFE;
border-right-width: 1px; border-right-width: 1px;
border-right-color: #BBBBBB; border-right-color: #BBBBBB;
border-right-style: solid; border-right-style: solid;
border-left-width: 1px; border-left-width: 1px;
border-left-color: #BBBBBB; border-left-color: #BBBBBB;
border-left-style: solid; border-left-style: solid;
height: 20px;
} }
table.noborder td { table.noborder td {
padding: 1px 2px 2px 1px; /* t r b l */ padding: 1px 2px 2px 1px; /* t r b l */
} }
table.nobordernopadding { table.nobordernopadding {

View File

@ -52,7 +52,7 @@ CKEDITOR.editorConfig = function( config )
['Undo','Redo','-','Find','Replace'], ['Undo','Redo','-','Find','Replace'],
['Font','FontSize'], ['Font','FontSize'],
['Bold','Italic','Underline','Strike','Subscript','Superscript','-','TextColor','RemoveFormat'], ['Bold','Italic','Underline','Strike','Subscript','Superscript','-','TextColor','RemoveFormat'],
['NumberedList','BulletedList','Outdent','Indent'], ['NumberedList','BulletedList','Outdent','Indent','CreateDiv'],
['JustifyLeft','JustifyCenter','JustifyRight','JustifyBlock'], ['JustifyLeft','JustifyCenter','JustifyRight','JustifyBlock'],
['Link','Unlink','Anchor','Image','Table','SpecialChar'] ['Link','Unlink','Anchor','Image','Table','SpecialChar']
]; ];

View File

@ -52,7 +52,7 @@ CKEDITOR.editorConfig = function( config )
['Undo','Redo','-','Find','Replace'], ['Undo','Redo','-','Find','Replace'],
['Font','FontSize'], ['Font','FontSize'],
['Bold','Italic','Underline','Strike','Subscript','Superscript','-','TextColor','RemoveFormat'], ['Bold','Italic','Underline','Strike','Subscript','Superscript','-','TextColor','RemoveFormat'],
['NumberedList','BulletedList','Outdent','Indent'], ['NumberedList','BulletedList','Outdent','Indent','CreateDiv'],
['JustifyLeft','JustifyCenter','JustifyRight','JustifyBlock'], ['JustifyLeft','JustifyCenter','JustifyRight','JustifyBlock'],
['Link','Unlink','Anchor','Image','Table','SpecialChar'] ['Link','Unlink','Anchor','Image','Table','SpecialChar']
]; ];

View File

@ -52,7 +52,7 @@ CKEDITOR.editorConfig = function( config )
['Undo','Redo','-','Find','Replace'], ['Undo','Redo','-','Find','Replace'],
['Font','FontSize'], ['Font','FontSize'],
['Bold','Italic','Underline','Strike','Subscript','Superscript','-','TextColor','RemoveFormat'], ['Bold','Italic','Underline','Strike','Subscript','Superscript','-','TextColor','RemoveFormat'],
['NumberedList','BulletedList','Outdent','Indent'], ['NumberedList','BulletedList','Outdent','Indent','CreateDiv'],
['JustifyLeft','JustifyCenter','JustifyRight','JustifyBlock'], ['JustifyLeft','JustifyCenter','JustifyRight','JustifyBlock'],
['Link','Unlink','Anchor','Image','Table','SpecialChar'] ['Link','Unlink','Anchor','Image','Table','SpecialChar']
]; ];

View File

@ -1812,7 +1812,7 @@ div.titre {
font-weight: bold; font-weight: bold;
color: rgb(<?php print $colortext; ?>); color: rgb(<?php print $colortext; ?>);
text-decoration: none; text-decoration: none;
text-shadow: 2px 2px 4px #BFBFBF; text-shadow: 1px 1px 2px #CFCFCF;
} }
#dolpaymenttable { width: 600px; font-size: 13px; } #dolpaymenttable { width: 600px; font-size: 13px; }

View File

@ -125,7 +125,7 @@ $server->wsdl->addComplexType(
'all', 'all',
'', '',
array( array(
// 'limit' => array('name'=>'limit','type'=>'xsd:string'), //'limit' => array('name'=>'limit','type'=>'xsd:string'),
'type' => array('name'=>'type','type'=>'xsd:string'), 'type' => array('name'=>'type','type'=>'xsd:string'),
'status_tobuy' => array('name'=>'status_tobuy','type'=>'xsd:string'), 'status_tobuy' => array('name'=>'status_tobuy','type'=>'xsd:string'),
'status_tosell' => array('name'=>'status_tosell','type'=>'xsd:string'), 'status_tosell' => array('name'=>'status_tosell','type'=>'xsd:string'),

View File

@ -92,7 +92,12 @@ $server->wsdl->addComplexType(
'ref' => array('name'=>'name','type'=>'xsd:string'), 'ref' => array('name'=>'name','type'=>'xsd:string'),
'ref_ext' => array('name'=>'ref_ext','type'=>'xsd:string'), 'ref_ext' => array('name'=>'ref_ext','type'=>'xsd:string'),
'fk_user_author' => array('name'=>'fk_user_author','type'=>'xsd:string'), 'fk_user_author' => array('name'=>'fk_user_author','type'=>'xsd:string'),
'date' => array('name'=>'date','type'=>'xsd:date'), 'client' => array('name'=>'client','type'=>'xsd:string'),
'supplier' => array('name'=>'supplier','type'=>'xsd:string'),
'customer_code' => array('name'=>'customer_code','type'=>'xsd:string'),
'supplier_code' => array('name'=>'supplier_code','type'=>'xsd:string'),
'customer_code_accountancy' => array('name'=>'customer_code_accountancy','type'=>'xsd:string'),
'supplier_code_accountancy' => array('name'=>'supplier_code_accountancy','type'=>'xsd:string'),
'date_creation' => array('name'=>'date_creation','type'=>'xsd:dateTime'), 'date_creation' => array('name'=>'date_creation','type'=>'xsd:dateTime'),
'date_modification' => array('name'=>'date_modification','type'=>'xsd:dateTime'), 'date_modification' => array('name'=>'date_modification','type'=>'xsd:dateTime'),
'note' => array('name'=>'note','type'=>'xsd:string'), 'note' => array('name'=>'note','type'=>'xsd:string'),
@ -111,12 +116,56 @@ $server->wsdl->addComplexType(
'profid2' => array('name'=>'profid2','type'=>'xsd:string'), 'profid2' => array('name'=>'profid2','type'=>'xsd:string'),
'profid3' => array('name'=>'profid3','type'=>'xsd:string'), 'profid3' => array('name'=>'profid3','type'=>'xsd:string'),
'profid4' => array('name'=>'profid4','type'=>'xsd:string'), 'profid4' => array('name'=>'profid4','type'=>'xsd:string'),
'prefix' => array('name'=>'prefix','type'=>'xsd:string'), 'profid5' => array('name'=>'profid5','type'=>'xsd:string'),
'profid6' => array('name'=>'profid6','type'=>'xsd:string'),
'capital' => array('name'=>'capital','type'=>'xsd:string'),
'vat_used' => array('name'=>'vat_used','type'=>'xsd:string'), 'vat_used' => array('name'=>'vat_used','type'=>'xsd:string'),
'vat_number' => array('name'=>'vat_number','type'=>'xsd:string') 'vat_number' => array('name'=>'vat_number','type'=>'xsd:string')
) )
); );
// Define other specific objects
$server->wsdl->addComplexType(
'filterthirdparty',
'complexType',
'struct',
'all',
'',
array(
//'limit' => array('name'=>'limit','type'=>'xsd:string'),
'client' => array('name'=>'client','type'=>'xsd:string'),
'supplier' => array('name'=>'supplier','type'=>'xsd:string')
)
);
$server->wsdl->addComplexType(
'ThirdPartiesArray',
'complexType',
'array',
'',
'SOAP-ENC:Array',
array(),
array(
array('ref'=>'SOAP-ENC:arrayType','wsdl:arrayType'=>'tns:thirdparty[]')
),
'tns:thirdparty'
);
$server->wsdl->addComplexType(
'ThirdPartiesArray2',
'complexType',
'array',
'sequence',
'',
array(
'thirdparty' => array(
'name' => 'thirdparty',
'type' => 'tns:thirdparty',
'minOccurs' => '0',
'maxOccurs' => 'unbounded'
)
)
);
// 5 styles: RPC/encoded, RPC/literal, Document/encoded (not WS-I compliant), Document/literal, Document/literal wrapped // 5 styles: RPC/encoded, RPC/literal, Document/encoded (not WS-I compliant), Document/literal, Document/literal wrapped
// Style merely dictates how to translate a WSDL binding to a SOAP message. Nothing more. You can use either style with any programming model. // Style merely dictates how to translate a WSDL binding to a SOAP message. Nothing more. You can use either style with any programming model.
@ -133,12 +182,40 @@ $server->register(
// Exit values // Exit values
array('result'=>'tns:result','thirdparty'=>'tns:thirdparty'), array('result'=>'tns:result','thirdparty'=>'tns:thirdparty'),
$ns, $ns,
$ns.'#getVersions', $ns.'#getThirdParty',
$styledoc, $styledoc,
$styleuse, $styleuse,
'WS to get Versions' 'WS to get a thirdparty from its id, ref or ref_ext'
); );
// Register WSDL
$server->register(
'createThirdParty',
// Entry values
array('authentication'=>'tns:authentication','thirdparty'=>'tns:thirdparty'),
// Exit values
array('result'=>'tns:result','id'=>'xsd:string'),
$ns,
$ns.'#createThirdParty',
$styledoc,
$styleuse,
'WS to create a thirdparty'
);
// Register WSDL
$server->register(
'getListOfThirdParties',
// Entry values
array('authentication'=>'tns:authentication','filterthirdparty'=>'tns:filterthirdparty'),
// Exit values
array('result'=>'tns:result','thirdparties'=>'tns:ThirdPartiesArray2'),
$ns,
$ns.'#getListOfThirdParties',
$styledoc,
$styleuse,
'WS to get list of thirdparties id and ref'
);
// Full methods code // Full methods code
@ -179,7 +256,14 @@ function getThirdParty($authentication,$id='',$ref='',$ref_ext='')
'id' => $thirdparty->id, 'id' => $thirdparty->id,
'ref' => $thirdparty->name, 'ref' => $thirdparty->name,
'ref_ext' => $thirdparty->ref_ext, 'ref_ext' => $thirdparty->ref_ext,
'fk_user_author' => $thirdparty->fk_user_author, 'status' => $thirdparty->status,
'client' => $thirdparty->client,
'supplier' => $thirdparty->fournisseur,
'customer_code' => $thirdparty->code_client,
'supplier_code' => $thirdparty->code_fournisseur,
'customer_code_accountancy' => $thirdparty->code_compta,
'supplier_code_accountancy' => $thirdparty->code_compta_fournisseur,
'fk_user_author' => $thirdparty->fk_user_author,
'date_creation' => dol_print_date($thirdparty->datec,'dayhourrfc'), 'date_creation' => dol_print_date($thirdparty->datec,'dayhourrfc'),
'date_modification' => dol_print_date($thirdparty->date_update,'dayhourrfc'), 'date_modification' => dol_print_date($thirdparty->date_update,'dayhourrfc'),
'address' => $thirdparty->address, 'address' => $thirdparty->address,
@ -197,8 +281,11 @@ function getThirdParty($authentication,$id='',$ref='',$ref_ext='')
'profid2' => $thirdparty->idprof2, 'profid2' => $thirdparty->idprof2,
'profid3' => $thirdparty->idprof3, 'profid3' => $thirdparty->idprof3,
'profid4' => $thirdparty->idprof4, 'profid4' => $thirdparty->idprof4,
'prefix' => $thirdparty->prefix_comm, 'profid5' => $thirdparty->idprof5,
'vat_used' => $thirdparty->tva_assuj, 'profid6' => $thirdparty->idprof6,
'capital' => $thirdparty->capital,
'barcode' => $thirdparty->barcode,
'vat_used' => $thirdparty->tva_assuj,
'vat_number' => $thirdparty->tva_intra 'vat_number' => $thirdparty->tva_intra
)); ));
} }
@ -225,6 +312,188 @@ function getThirdParty($authentication,$id='',$ref='',$ref_ext='')
/**
* Create a thirdparty
*
* @param array $authentication Array of authentication information
* @param Societe $thirdparty Thirdparty
* @return array Array result
*/
function createThirdParty($authentication,$thirdparty)
{
global $db,$conf,$langs;
$now=dol_now();
dol_syslog("Function: createThirdParty login=".$authentication['login']);
if ($authentication['entity']) $conf->entity=$authentication['entity'];
// Init and check authentication
$objectresp=array();
$errorcode='';$errorlabel='';
$error=0;
$fuser=check_authentication($authentication,$error,$errorcode,$errorlabel);
// Check parameters
if (empty($thirdparty['ref']))
{
$error++; $errorcode='KO'; $errorlabel="Name is mandatory.";
}
if (! $error)
{
include_once(DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php');
$newobject=new Societe($db);
$newobject->ref=$thirdparty['ref'];
$newobject->name=$thirdparty['ref'];
$newobject->ref_ext=$thirdparty['ref_ext'];
$newobject->status=$thirdparty['status'];
$newobject->client=$thirdparty['client'];
$newobject->fournisseur=$thirdparty['supplier'];
$newobject->code_client=$thirdparty['customer_code'];
$newobject->code_fournisseur=$thirdparty['supplier_code'];
$newobject->code_compta=$thirdparty['customer_code_accountancy'];
$newobject->code_compta_fournisseur=$thirdparty['supplier_code_accountancy'];
$newobject->date_creation=$now;
$newobject->note=$thirdparty['note'];
$newobject->address=$thirdparty['address'];
$newobject->zip=$thirdparty['zip'];
$newobject->town=$thirdparty['town'];
$newobject->country_id=$thirdparty['country_id'];
if ($thirdparty['country_code']) $newobject->country_id=getCountry($thirdparty['country_code'],3);
$newobject->province_id=$thirdparty['province_id'];
//if ($thirdparty['province_code']) $newobject->province_code=getCountry($thirdparty['province_code'],3);
$newobject->phone=$thirdparty['phone'];
$newobject->fax=$thirdparty['fax'];
$newobject->email=$thirdparty['email'];
$newobject->url=$thirdparty['url'];
$newobject->idprof1=$thirdparty['profid1'];
$newobject->idprof2=$thirdparty['profid2'];
$newobject->idprof3=$thirdparty['profid3'];
$newobject->idprof4=$thirdparty['profid4'];
$newobject->idprof5=$thirdparty['profid5'];
$newobject->idprof6=$thirdparty['profid6'];
$newobject->capital=$thirdparty['capital'];
$newobject->barcode=$thirdparty['barcode'];
$newobject->tva_assuj=$thirdparty['vat_used'];
$newobject->tva_intra=$thirdparty['vat_number'];
$newobject->canvas=$thirdparty['canvas'];
$db->begin();
$result=$newobject->create($fuser);
if ($result <= 0)
{
$error++;
}
if (! $error)
{
$db->commit();
$objectresp=array('result'=>array('result_code'=>'OK', 'result_label'=>''),'id'=>$newobject->id,'ref'=>$newobject->ref);
}
else
{
$db->rollback();
$error++;
$errorcode='KO';
$errorlabel=$newobject->error;
}
}
if ($error)
{
$objectresp = array('result'=>array('result_code' => $errorcode, 'result_label' => $errorlabel));
}
return $objectresp;
}
/**
* getListOfThirdParties
*
* @param array $authentication Array of authentication information
* @param array $filterthirdparty Filter fields
* @return array Array result
*/
function getListOfThirdParties($authentication,$filterthirdparty)
{
global $db,$conf,$langs;
$now=dol_now();
dol_syslog("Function: getListOfThirdParties login=".$authentication['login']);
if ($authentication['entity']) $conf->entity=$authentication['entity'];
// Init and check authentication
$objectresp=array();
$arraythirdparties=array();
$errorcode='';$errorlabel='';
$error=0;
$fuser=check_authentication($authentication,$error,$errorcode,$errorlabel);
// Check parameters
if (! $error)
{
$sql ="SELECT rowid, nom as ref, ref_ext";
$sql.=" FROM ".MAIN_DB_PREFIX."societe";
$sql.=" WHERE entity=".$conf->entity;
foreach($filterthirdparty as $key => $val)
{
if ($key == 'client' && $val != '') $sql.=" AND client = ".$db->escape($val);
if ($key == 'supplier' && $val != '') $sql.=" AND fournisseur = ".$db->escape($val);
}
$resql=$db->query($sql);
if ($resql)
{
$num=$db->num_rows($resql);
$i=0;
while ($i < $num)
{
$obj=$db->fetch_object($resql);
$arraythirdparties[]=array('id'=>$obj->rowid,'ref'=>$obj->ref,'ref_ext'=>$obj->ref_ext);
$i++;
}
}
else
{
$error++;
$errorcode=$db->lasterrno();
$errorlabel=$db->lasterror();
}
}
if ($error)
{
$objectresp = array(
'result'=>array('result_code' => $errorcode, 'result_label' => $errorlabel),
'thirdparties'=>$arraythirdparties
);
}
else
{
$objectresp = array(
'result'=>array('result_code' => 'OK', 'result_label' => ''),
'thirdparties'=>$arraythirdparties
);
}
return $objectresp;
}
// Return the results. // Return the results.
$server->service($HTTP_RAW_POST_DATA); $server->service($HTTP_RAW_POST_DATA);

View File

@ -39,8 +39,9 @@ require_once($path."../../htdocs/master.inc.php");
require_once(DOL_DOCUMENT_ROOT."/cron/functions_cron.lib.php"); require_once(DOL_DOCUMENT_ROOT."/cron/functions_cron.lib.php");
require_once(DOL_DOCUMENT_ROOT."/compta/facture/class/facture.class.php"); require_once(DOL_DOCUMENT_ROOT."/compta/facture/class/facture.class.php");
require_once(DOL_DOCUMENT_ROOT."/core/modules/facture/modules_facture.php"); require_once(DOL_DOCUMENT_ROOT."/core/modules/facture/modules_facture.php");
require_once(DOL_DOCUMENT_ROOT.'/core/lib/pdf.lib.php');
require_once(DOL_DOCUMENT_ROOT."/core/lib/date.lib.php"); require_once(DOL_DOCUMENT_ROOT."/core/lib/date.lib.php");
require_once(DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php');
require_once(DOL_DOCUMENT_ROOT.'/core/lib/pdf.lib.php');
// Load main language strings // Load main language strings
@ -66,6 +67,7 @@ $diroutputpdf=$conf->facture->dir_output . '/temp';
$newmodel=''; // To force a new model $newmodel=''; // To force a new model
$newlangid='en_EN'; // To force a new lang id $newlangid='en_EN'; // To force a new lang id
$filter=array(); $filter=array();
$regenerate='';
$option=''; $option='';
foreach ($argv as $key => $value) foreach ($argv as $key => $value)
@ -81,6 +83,16 @@ foreach ($argv as $key => $value)
print 'Use language '.$newlangid.".\n"; print 'Use language '.$newlangid.".\n";
} }
if (preg_match('/^regenerate=(.*)/i',$value,$reg))
{
if (! in_array($reg[1],array('','0','no')))
{
$found=true;
$regenerate=$reg[1];
print 'Regeneration of PDF is requested with template '.$regenerate."\n";
}
}
if ($value == 'filter=all') if ($value == 'filter=all')
{ {
$found=true; $found=true;
@ -269,11 +281,18 @@ if ( $resql=$db->query($sql) )
$outputlangs->setDefaultLang($newlangid); $outputlangs->setDefaultLang($newlangid);
} }
} }
print "Build PDF for invoice ".$obj->facnumber." - Lang = ".$outputlangs->defaultlang."\n"; $filename=$conf->facture->dir_output.'/'.$fac->ref.'/'.$fac->ref.'.pdf';
$result=facture_pdf_create($db, $fac, $newmodel?$newmodel:$fac->modelpdf, $outputlangs); if ($regenerate || ! dol_is_file($filename))
{
print "Build PDF for invoice ".$obj->facnumber." - Lang = ".$outputlangs->defaultlang."\n";
$result=facture_pdf_create($db, $fac, $newmodel?$newmodel:$fac->modelpdf, $outputlangs);
}
else {
print "PDF for invoice ".$obj->facnumber." already exists\n";
}
// Add file into files array // Add file into files array
$files[] = $conf->facture->dir_output.'/'.$fac->ref.'/'.$fac->ref.'.pdf'; $files[] = $filename;
} }
if ($result <= 0) if ($result <= 0)
@ -393,8 +412,9 @@ function usage()
print "To exclude credit notes, use filter=nocreditnote\n"; print "To exclude credit notes, use filter=nocreditnote\n";
print "To exclude replacement invoices, use filter=noreplacement\n"; print "To exclude replacement invoices, use filter=noreplacement\n";
print "To exclude deposit invoices, use filter=nodeposit\n"; print "To exclude deposit invoices, use filter=nodeposit\n";
print "To regenerate existing PDF, use regenerate=crabe\n";
print "\n"; print "\n";
print "Example: ".$script_file." filter=payments 20080101 20081231 lang=fr_FR\n"; print "Example: ".$script_file." filter=payments 20080101 20081231 lang=fr_FR regenerate=yes\n";
print "Example: ".$script_file." filter=all lang=it_IT\n"; print "Example: ".$script_file." filter=all lang=it_IT\n";
print "\n"; print "\n";
print "Note that some filters can be cumulated.\n"; print "Note that some filters can be cumulated.\n";

View File

@ -72,6 +72,8 @@ class AllTests
$suite->addTestSuite('ImagesLibTest'); $suite->addTestSuite('ImagesLibTest');
require_once dirname(__FILE__).'/FunctionsTest.php'; require_once dirname(__FILE__).'/FunctionsTest.php';
$suite->addTestSuite('FunctionsTest'); $suite->addTestSuite('FunctionsTest');
require_once dirname(__FILE__).'/Functions2Test.php';
$suite->addTestSuite('Functions2Test');
require_once dirname(__FILE__).'/SecurityTest.php'; require_once dirname(__FILE__).'/SecurityTest.php';
$suite->addTestSuite('SecurityTest'); $suite->addTestSuite('SecurityTest');
@ -123,6 +125,8 @@ class AllTests
$suite->addTestSuite('UserTest'); $suite->addTestSuite('UserTest');
require_once dirname(__FILE__).'/UserGroupTest.php'; require_once dirname(__FILE__).'/UserGroupTest.php';
$suite->addTestSuite('UserGroupTest'); $suite->addTestSuite('UserGroupTest');
require_once dirname(__FILE__).'/BankAccountTest.php';
$suite->addTestSuite('BankAccountTest');
require_once dirname(__FILE__).'/CompanyBankAccountTest.php'; require_once dirname(__FILE__).'/CompanyBankAccountTest.php';
$suite->addTestSuite('CompanyBankAccountTest'); $suite->addTestSuite('CompanyBankAccountTest');
require_once dirname(__FILE__).'/ChargeSocialesTest.php'; require_once dirname(__FILE__).'/ChargeSocialesTest.php';

View File

@ -114,6 +114,38 @@ class FilesLibTest extends PHPUnit_Framework_TestCase
print __METHOD__."\n"; print __METHOD__."\n";
} }
/**
* testDolBasename
*
* @return int
*/
public function testDolBasename()
{
global $conf,$user,$langs,$db;
$conf=$this->savconf;
$user=$this->savuser;
$langs=$this->savlangs;
$db=$this->savdb;
$result=dol_basename('adir/afile');
print __METHOD__." result=".$result."\n";
$this->assertEquals('afile',$result);
$result=dol_basename('adir/afile/');
print __METHOD__." result=".$result."\n";
$this->assertEquals('afile',$result);
$result=dol_basename('adir/νεο'); // With cyrillic data. Here basename fails to return correct value
print __METHOD__." result=".$result."\n";
$this->assertEquals('νεο',$result);
$result=dol_basename('adir/νεο/'); // With cyrillic data. Here basename fails to return correct value
print __METHOD__." result=".$result."\n";
$this->assertEquals('νεο',$result);
}
/** /**
* testDolCountNbOfLine * testDolCountNbOfLine
* *

134
test/phpunit/Functions2Test.php Executable file
View File

@ -0,0 +1,134 @@
<?php
/* Copyright (C) 2010-2012 Laurent Destailleur <eldy@users.sourceforge.net>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
* or see http://www.gnu.org/
*/
/**
* \file test/phpunit/FunctionsTest.php
* \ingroup test
* \brief PHPUnit test
* \remarks To run this script as CLI: phpunit filename.php
*/
global $conf,$user,$langs,$db;
//define('TEST_DB_FORCE_TYPE','mysql'); // This is to force using mysql driver
require_once 'PHPUnit/Autoload.php';
require_once dirname(__FILE__).'/../../htdocs/master.inc.php';
require_once dirname(__FILE__).'/../../htdocs/core/lib/functions2.lib.php';
if (! defined('NOREQUIREUSER')) define('NOREQUIREUSER','1');
if (! defined('NOREQUIREDB')) define('NOREQUIREDB','1');
if (! defined('NOREQUIRESOC')) define('NOREQUIRESOC','1');
if (! defined('NOREQUIRETRAN')) define('NOREQUIRETRAN','1');
if (! defined('NOCSRFCHECK')) define('NOCSRFCHECK','1');
if (! defined('NOTOKENRENEWAL')) define('NOTOKENRENEWAL','1');
if (! defined('NOREQUIREMENU')) define('NOREQUIREMENU','1'); // If there is no menu to show
if (! defined('NOREQUIREHTML')) define('NOREQUIREHTML','1'); // If we don't need to load the html.form.class.php
if (! defined('NOREQUIREAJAX')) define('NOREQUIREAJAX','1');
if (! defined("NOLOGIN")) define("NOLOGIN",'1'); // If this page is public (can be called outside logged session)
/**
* Class for PHPUnit tests
*
* @backupGlobals disabled
* @backupStaticAttributes enabled
* @remarks backupGlobals must be disabled to have db,conf,user and lang not erased.
*/
class Functions2Test extends PHPUnit_Framework_TestCase
{
protected $savconf;
protected $savuser;
protected $savlangs;
protected $savdb;
/**
* Constructor
* We save global variables into local variables
*
* @return CoreTest
*/
function Functions2Test()
{
//$this->sharedFixture
global $conf,$user,$langs,$db;
$this->savconf=$conf;
$this->savuser=$user;
$this->savlangs=$langs;
$this->savdb=$db;
print __METHOD__." db->type=".$db->type." user->id=".$user->id;
//print " - db ".$db->db;
print "\n";
}
// Static methods
public static function setUpBeforeClass()
{
global $conf,$user,$langs,$db;
//$db->begin(); // This is to have all actions inside a transaction even if test launched without suite.
print __METHOD__."\n";
}
public static function tearDownAfterClass()
{
global $conf,$user,$langs,$db;
//$db->rollback();
print __METHOD__."\n";
}
/**
* Init phpunit tests
*
* @return void
*/
protected function setUp()
{
global $conf,$user,$langs,$db;
$conf=$this->savconf;
$user=$this->savuser;
$langs=$this->savlangs;
$db=$this->savdb;
print __METHOD__."\n";
}
/**
* End phpunit tests
*
* @return void
*/
protected function tearDown()
{
print __METHOD__."\n";
}
/**
* testJsUnEscape
*
* @return void
*/
public function testJsUnEscape()
{
$result=jsUnEscape('%u03BD%u03B5%u03BF');
print __METHOD__." result=".$result."\n";
$this->assertEquals('νεο',$result);
return;
}
}
?>