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

Conflicts:
	htdocs/install/mysql/migration/3.2.0-3.3.0.sql
This commit is contained in:
Maxime Kohlhaas 2012-12-05 09:10:55 +01:00
commit 954a578ebd
135 changed files with 4708 additions and 2982 deletions

View File

@ -142,6 +142,27 @@ while($i<count($properties))
$targetcontent=preg_replace('/\'prop1\'=>\$'.$classmin.'->prop1,/', $varprop, $targetcontent);
$targetcontent=preg_replace('/\'prop2\'=>\$'.$classmin.'->prop2,/', '', $targetcontent);
// Substitute get method parameters
$varprop="\n\t\t";
$cleanparam='';
$i=0;
while($i<count($properties))
{
$varprop.='$newobject->'.$properties[$i].'=$'.$classmin.'->'.$properties[$i].';';
$i++;
if ($i == count($properties))
$varprop.="\n";
else
$varprop.="\n\t\t";
}
$targetcontent=preg_replace('/\$newobject->prop1=\$'.$classmin.'->prop1;/', $varprop, $targetcontent);
$targetcontent=preg_replace('/\$newobject->prop2=\$'.$classmin.'->prop2;/', '', $targetcontent);
// Build file
$fp=fopen($outfile,"w");
if ($fp)

View File

@ -111,9 +111,9 @@ class modMyModule extends DolibarrModules
$this->const = array();
// Array to add new pages in new tabs
// Example: $this->tabs = array('objecttype:+tabname1:Title1:mylangfile@mymodule:$user->rights->mymodule->read:/mymodule/mynewtab1.php?id=__ID__', // To add a new tab identified by code tabname1
// 'objecttype:+tabname2:Title2:mylangfile@mymodule:$user->rights->othermodule->read:/mymodule/mynewtab2.php?id=__ID__', // To add another new tab identified by code tabname2
// 'objecttype:-tabname'); // To remove an existing tab identified by code tabname
// Example: $this->tabs = array('objecttype:+tabname1:Title1:mylangfile@mymodule:$user->rights->mymodule->read:/mymodule/mynewtab1.php?id=__ID__', // To add a new tab identified by code tabname1
// 'objecttype:+tabname2:Title2:mylangfile@mymodule:$user->rights->othermodule->read:/mymodule/mynewtab2.php?id=__ID__', // To add another new tab identified by code tabname2
// 'objecttype:-tabname':NU:conditiontoremove); // To remove an existing tab identified by code tabname
// where objecttype can be
// 'thirdparty' to add a tab in third party view
// 'intervention' to add a tab in intervention view

View File

@ -118,11 +118,25 @@ $server->register(
'WS to get skeleton'
);
// Register WSDL
$server->register(
'createSkeleton',
// Entry values
array('authentication'=>'tns:authentication','skeleton'=>'tns:skeleton'),
// Exit values
array('result'=>'tns:result','id'=>'xsd:string'),
$ns,
$ns.'#createSkeleton',
$styledoc,
$styleuse,
'WS to create a skeleton'
);
/**
* Get produt or service
* Get Skeleton
*
* @param array $authentication Array of authentication information
* @param int $id Id of object
@ -192,6 +206,67 @@ function getSkeleton($authentication,$id,$ref='',$ref_ext='')
}
/**
* Create Skeleton
*
* @param array $authentication Array of authentication information
* @param Skeleton $skeleton $skeleton
* @return array Array result
*/
function createSkeleton($authentication,$skeleton)
{
global $db,$conf,$langs;
$now=dol_now();
dol_syslog("Function: createSkeleton 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 (! $error)
{
$newobject=new Skeleton($db);
$newobject->prop1=$skeleton->prop1;
$newobject->prop2=$skeleton->prop2;
//...
$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;
}
// Return the results.
$server->service($HTTP_RAW_POST_DATA);

View File

@ -704,7 +704,7 @@ class Adherent extends CommonObject
$this->db->begin();
// Suppression options
// Remove extrafields
$sql = "DELETE FROM ".MAIN_DB_PREFIX."adherent_extrafields WHERE fk_object = ".$rowid;
dol_syslog(get_class($this)."::delete sql=".$sql);

View File

@ -22,8 +22,8 @@
*/
require '../../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/member.lib.php';
require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/member.lib.php';
require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php';
$graphwidth = 700;
$mapratio = 0.5;
@ -83,8 +83,8 @@ if ($resql)
{
$obj=$db->fetch_object($resql);
if ($obj->code == 'phy') $foundphy++;
if ($obj->code == 'mor') $foundmor++;
if ($obj->code == 'phy') $foundphy++;
if ($obj->code == 'mor') $foundmor++;
$data[]=array('label'=>$obj->code, 'nb'=>$obj->nb, 'lastdate'=>$db->jdate($obj->lastdate));
@ -122,8 +122,8 @@ print '<td align="center">'.$langs->trans("NbOfMembers").'</td>';
print '<td align="center">'.$langs->trans("LastMemberDate").'</td>';
print '</tr>';
if (! $foundphy) $data[]=array('label'=>'phy','nb'=>'0','lastdate'=>'');
if (! $foundmor) $data[]=array('label'=>'mor','nb'=>'0','lastdate'=>'');
if (! $foundphy) $data[]=array('label'=>'phy','nb'=>'0','lastdate'=>'');
if (! $foundmor) $data[]=array('label'=>'mor','nb'=>'0','lastdate'=>'');
$oldyear=0;
$var=true;

View File

@ -94,6 +94,34 @@ if ($action == "save" && empty($cancel))
}
}
if (preg_match('/set_(.*)/',$action,$reg))
{
$code=$reg[1];
$value=(GETPOST($code) ? GETPOST($code) : 1);
if (dolibarr_set_const($db, $code, $value, 'chaine', 0, '', $conf->entity) > 0)
{
Header("Location: ".$_SERVER["PHP_SELF"]);
exit;
}
else
{
dol_print_error($db);
}
}
if (preg_match('/del_(.*)/',$action,$reg))
{
$code=$reg[1];
if (dolibarr_del_const($db, $code, $conf->entity) > 0)
{
Header("Location: ".$_SERVER["PHP_SELF"]);
exit;
}
else
{
dol_print_error($db);
}
}
/**
@ -159,6 +187,46 @@ print "</form>\n";
print '</div>';
/*
* Other options
*/
print_titre($langs->trans("OtherOptions"));
$var=true;
print '<table class="noborder allwidth">'."\n";
print '<tr class="liste_titre">'."\n";
print '<td>'.$langs->trans("Parameters").'</td>'."\n";
print '<td align="center" width="20">&nbsp;</td>'."\n";
print '<td align="center" width="100">'.$langs->trans("Value").'</td>'."\n";
print '</tr>'."\n";
// Manual or automatic
$var=!$var;
print '<tr '.$bc[$var].'>'."\n";
print '<td>'.$langs->trans("AGENDA_USE_EVENT_TYPE").'</td>'."\n";
print '<td align="center" width="20">&nbsp;</td>'."\n";
print '<td align="center" width="100">'."\n";
if ($conf->use_javascript_ajax)
{
print ajax_constantonoff('AGENDA_USE_EVENT_TYPE');
}
else
{
if($conf->global->AGENDA_USE_EVENT_TYPE == 0)
{
print '<a href="'.$_SERVER['PHP_SELF'].'?action=set_AGENDA_USE_EVENT_TYPE">'.img_picto($langs->trans("Disabled"),'off').'</a>';
}
else if($conf->global->BUSINESS_VISIBLE_TO_ALL_BY_DEFAULT == 1)
{
print '<a href="'.$_SERVER['PHP_SELF'].'?action=del_AGENDA_USE_EVENT_TYPE">'.img_picto($langs->trans("Enabled"),'on').'</a>';
}
}
print '</td></tr>'."\n";
print "<br>";
dol_htmloutput_mesg($mesg);

View File

@ -563,7 +563,8 @@ if ($action == 'edit' || $action == 'updateedit')
print '<td colspan="2">';
print "<table>";
print "<tr><td>".$langs->transcountry("LocalTax1IsUsedDesc",$mysoc->country_code)."</td></tr>";
print "<tr><td><i>".$langs->trans("Example").': '.$langs->transcountry("LocalTax1IsUsedExample",$mysoc->country_code)."</i></td></tr>\n";
$example=$langs->transcountry("LocalTax1IsUsedExample",$mysoc->country_code);
print ($example!="LocalTax1IsUsedExample"?"<tr><td><i>".$langs->trans("Example").': '.$langs->transcountry("LocalTax1IsUsedExample",$mysoc->country_code)."</i></td></tr>\n":"");
print "</table>";
print "</td></tr>\n";
@ -572,7 +573,8 @@ if ($action == 'edit' || $action == 'updateedit')
print '<td colspan="2">';
print "<table>";
print "<tr><td>".$langs->transcountry("LocalTax1IsNotUsedDesc",$mysoc->country_code)."</td></tr>";
print "<tr><td><i>".$langs->trans("Example").': '.$langs->transcountry("LocalTax1IsNotUsedExample",$mysoc->country_code)."</i></td></tr>\n";
$example=$langs->transcountry("LocalTax1IsNotUsedExample",$mysoc->country_code);
print ($example!="LocalTax1IsNotUsedExample"?"<tr><td><i>".$langs->trans("Example").': '.$langs->transcountry("LocalTax1IsNotUsedExample",$mysoc->country_code)."</i></td></tr>\n":"");
print "</table>";
print "</td></tr>\n";
print "</table>";
@ -593,7 +595,8 @@ if ($action == 'edit' || $action == 'updateedit')
print '<td colspan="2">';
print "<table>";
print "<tr><td>".$langs->transcountry("LocalTax2IsUsedDesc",$mysoc->country_code)."</td></tr>";
print "<tr><td><i>".$langs->trans("Example").': '.$langs->transcountry("LocalTax2IsUsedExample",$mysoc->country_code)."</i></td></tr>\n";
$example=$langs->transcountry("LocalTax2IsUsedExample",$mysoc->country_code);
print ($example!="LocalTax2IsUsedExample"?"<tr><td><i>".$langs->trans("Example").': '.$langs->transcountry("LocalTax2IsUsedExample",$mysoc->country_code)."</i></td></tr>\n":"");
print "</table>";
print "</td></tr>\n";
@ -602,7 +605,8 @@ if ($action == 'edit' || $action == 'updateedit')
print '<td colspan="2">';
print "<table>";
print "<tr><td>".$langs->transcountry("LocalTax2IsNotUsedDesc",$mysoc->country_code)."</td></tr>";
print "<tr><td><i>".$langs->trans("Example").': '.$langs->transcountry("LocalTax2IsNotUsedExample",$mysoc->country_code)."</i></td></tr>\n";
$example=$langs->transcountry("LocalTax2IsNotUsedExample",$mysoc->country_code);
print ($example!="LocalTax2IsNotUsedExample"?"<tr><td><i>".$langs->trans("Example").': '.$langs->transcountry("LocalTax2IsNotUsedExample",$mysoc->country_code)."</i></td></tr>\n":"");
print "</table>";
print "</td></tr>\n";
print "</table>";
@ -939,7 +943,8 @@ else
print '<td colspan="2">';
print "<table>";
print "<tr><td>".$langs->transcountry("LocalTax1IsUsedDesc",$mysoc->country_code)."</td></tr>";
print "<tr><td><i>".$langs->trans("Example",$mysoc->country_code).': '.$langs->transcountry("LocalTax1IsUsedExample",$mysoc->country_code)."</i></td></tr>\n";
$example=$langs->transcountry("LocalTax1IsUsedExample",$mysoc->country_code);
print ($example!="LocalTax1IsUsedExample"?"<tr><td><i>".$langs->trans("Example").': '.$langs->transcountry("LocalTax1IsUsedExample",$mysoc->country_code)."</i></td></tr>\n":"");
print "</table>";
print "</td></tr>\n";
@ -948,7 +953,8 @@ else
print '<td colspan="2">';
print "<table>";
print "<tr><td>".$langs->transcountry("LocalTax1IsNotUsedDesc",$mysoc->country_code)."</td></tr>";
print "<tr><td><i>".$langs->trans("Example",$mysoc->country_code).': '.$langs->transcountry("LocalTax1IsNotUsedExample",$mysoc->country_code)."</i></td></tr>\n";
$example=$langs->transcountry("LocalTax1IsNotUsedExample",$mysoc->country_code);
print ($example!="LocalTax1IsNotUsedExample"?"<tr><td><i>".$langs->trans("Example").': '.$langs->transcountry("LocalTax1IsNotUsedExample",$mysoc->country_code)."</i></td></tr>\n":"");
print "</table>";
print "</td></tr>\n";
@ -970,7 +976,8 @@ else
print '<td colspan="2">';
print "<table>";
print "<tr><td>".$langs->transcountry("LocalTax2IsUsedDesc",$mysoc->country_code)."</td></tr>";
print "<tr><td><i>".$langs->trans("Example").': '.$langs->transcountry("LocalTax2IsUsedExample",$mysoc->country_code)."</i></td></tr>\n";
$example=$langs->transcountry("LocalTax2IsUsedExample",$mysoc->country_code);
print ($example!="LocalTax2IsUsedExample"?"<tr><td><i>".$langs->trans("Example").': '.$langs->transcountry("LocalTax2IsUsedExample",$mysoc->country_code)."</i></td></tr>\n":"");
print "</table>";
print "</td></tr>\n";
@ -979,7 +986,8 @@ else
print '<td colspan="2">';
print "<table>";
print "<tr><td>".$langs->transcountry("LocalTax2IsNotUsedDesc",$mysoc->country_code)."</td></tr>";
print "<tr><td><i>".$langs->trans("Example").': '.$langs->transcountry("LocalTax2IsNotUsedExample",$mysoc->country_code)."</i></td></tr>\n";
$example=$langs->transcountry("LocalTax2IsNotUsedExample",$mysoc->country_code);
print ($example!="LocalTax2IsNotUsedExample"?"<tr><td><i>".$langs->trans("Example").': '.$langs->transcountry("LocalTax2IsNotUsedExample",$mysoc->country_code)."</i></td></tr>\n":"");
print "</table>";
print "</td></tr>\n";

View File

@ -1066,7 +1066,6 @@ if ($id)
}
}
print '<td align="center" nowrap="nowrap">';
// Est-ce une entree du dictionnaire qui peut etre desactivee ?
$iserasable=1; // Oui par defaut
if (isset($obj->code) && ($obj->code == '0' || $obj->code == '' || preg_match('/unknown/i',$obj->code))) $iserasable=0;
@ -1074,8 +1073,14 @@ if ($id)
if (isset($obj->code) && $obj->code == 'EF0') $iserasable=0;
if (isset($obj->type) && in_array($obj->type, array('system', 'systemauto'))) $iserasable=0;
// Active
print '<td align="center" nowrap="nowrap">';
if ($iserasable) print '<a href="'.$_SERVER["PHP_SELF"].'?'.($page?'page='.$page.'&':'').'sortfield='.$sortfield.'&sortorder='.$sortorder.'&rowid='.(! empty($obj->rowid)?$obj->rowid:(! empty($obj->code)?$obj->code:'')).'&amp;code='.(! empty($obj->code)?$obj->code:'').'&amp;id='.$id.'&amp;action='.$acts[$obj->active].'">'.$actl[$obj->active].'</a>';
else print $langs->trans("AlwaysActive");
else
{
if (isset($obj->type) && in_array($obj->type, array('system', 'systemauto')) && empty($obj->active)) print $langs->trans("Deprecated");
else print $langs->trans("AlwaysActive");
}
print "</td>";
// Modify link

View File

@ -29,7 +29,7 @@
require '../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/usergroups.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php';
$langs->load("admin");
$langs->load("members");

View File

@ -477,12 +477,14 @@ class ActionComm extends CommonObject
* @param int $fk_element Id of element action is linked to
* @param string $elementtype Type of element action is linked to
* @param string $filter Other filter
* @return int <0 if KO, >0 if OK
* @return array <0 if KO, array with actions
*/
function getActions($socid=0, $fk_element=0, $elementtype='', $filter='')
static function getActions($db, $socid=0, $fk_element=0, $elementtype='', $filter='')
{
global $conf, $langs;
$resarray=array();
$sql = "SELECT a.id";
$sql.= " FROM ".MAIN_DB_PREFIX."actioncomm as a";
$sql.= " WHERE a.entity = ".$conf->entity;
@ -495,27 +497,27 @@ class ActionComm extends CommonObject
if (! empty($filter)) $sql.= $filter;
dol_syslog(get_class($this)."::getActions sql=".$sql);
$resql=$this->db->query($sql);
$resql=$db->query($sql);
if ($resql)
{
$num = $this->db->num_rows($resql);
$num = $db->num_rows($resql);
if ($num)
{
for($i=0;$i<$num;$i++)
{
$obj = $this->db->fetch_object($resql);
$actioncommstatic = new ActionComm($this->db);
$obj = $db->fetch_object($resql);
$actioncommstatic = new ActionComm($db);
$actioncommstatic->fetch($obj->id);
$this->actions[$i] = $actioncommstatic;
$resarray[$i] = $actioncommstatic;
}
}
$this->db->free($resql);
return 1;
$db->free($resql);
return $resarray;
}
else
{
$this->error=$this->db->lasterror();
$this->error=$db->lasterror();
return -1;
}
}
@ -707,26 +709,34 @@ class ActionComm extends CommonObject
if ($option=='birthday') $lien = '<a '.($classname?'class="'.$classname.'" ':'').'href="'.DOL_URL_ROOT.'/contact/perso.php?id='.$this->id.'">';
else $lien = '<a '.($classname?'class="'.$classname.'" ':'').'href="'.DOL_URL_ROOT.'/comm/action/fiche.php?id='.$this->id.'">';
$lienfin='</a>';
//print $this->libelle;
$label=$this->label;
if (empty($label)) $label=$this->libelle; // Fro backward compatibility
//print 'rrr'.$this->libelle;
if ($withpicto == 2)
{
$libelle=$langs->trans("Action".$this->type_code);
$libelle=$label;
if (! empty($conf->global->AGENDA_USE_EVENT_TYPE)) $libelle=$langs->trans("Action".$this->type_code);
$libelleshort='';
}
else if (empty($this->libelle))
{
$libelle=$langs->trans("Action".$this->type_code);
$libelleshort=$langs->trans("Action".$this->type_code,'','','','',$maxlength);
$libelle=$label;
if (! empty($conf->global->AGENDA_USE_EVENT_TYPE)) $libelle=$langs->trans("Action".$this->type_code);
$libelleshort=dol_trunc($label, $maxlength);
}
else
{
$libelle=$this->libelle;
$libelleshort=dol_trunc($this->libelle,$maxlength);
{
$libelle=$label;
$libelleshort=dol_trunc($label,$maxlength);
}
if ($withpicto)
{
$libelle.=(($this->type_code && $libelle!=$langs->trans("Action".$this->type_code) && $langs->trans("Action".$this->type_code)!="Action".$this->type_code)?' ('.$langs->trans("Action".$this->type_code).')':'');
if (! empty($conf->global->AGENDA_USE_EVENT_TYPE))
{
$libelle.=(($this->type_code && $libelle!=$langs->trans("Action".$this->type_code) && $langs->trans("Action".$this->type_code)!="Action".$this->type_code)?' ('.$langs->trans("Action".$this->type_code).')':'');
}
$result.=$lien.img_object($langs->trans("ShowAction").': '.$libelle,($overwritepicto?$overwritepicto:'action')).$lienfin;
}
if ($withpicto==1) $result.=' ';

View File

@ -100,9 +100,10 @@ class CActionComm
* @param int $active 1 or 0 to filter on event state active or not ('' by default = no filter)
* @param string $idorcode 'id' or 'code'
* @param string $excludetype Type to exclude
* @param string $onlyautoornot Group list by auto events or not
* @return array Array of all event types if OK, <0 if KO
*/
function liste_array($active='',$idorcode='id',$excludetype='')
function liste_array($active='',$idorcode='id',$excludetype='',$onlyautoornot=0)
{
global $langs,$conf;
$langs->load("commercial");
@ -110,7 +111,7 @@ class CActionComm
$repid = array();
$repcode = array();
$sql = "SELECT id, code, libelle, module";
$sql = "SELECT id, code, libelle, module, type";
$sql.= " FROM ".MAIN_DB_PREFIX."c_actioncomm";
if ($active != '') $sql.=" WHERE active=".$active;
if (! empty($excludetype)) $sql.=($active != ''?" AND":" WHERE")." type <> '".$excludetype."'";
@ -127,20 +128,31 @@ class CActionComm
while ($i < $nump)
{
$obj = $this->db->fetch_object($resql);
$qualified=1;
if ($obj->module)
// $obj->type can be system, systemauto, module, moduleauto, xxx, xxxauto
if ($qualified && $onlyautoornot && preg_match('/^system/',$obj->type) && ! preg_match('/^AC_OTH/',$obj->code)) $qualified=0; // We discard detailed system events. We keep only the 2 generic lines (AC_OTH and AC_OTHER)
if ($qualified && $obj->module)
{
if ($obj->module == 'invoice' && ! $conf->facture->enabled) $qualified=0;
if ($obj->module == 'order' && ! $conf->commande->enabled) $qualified=0;
if ($obj->module == 'propal' && ! $conf->propal->enabled) $qualified=0;
if ($obj->module == 'invoice_supplier' && ! $conf->fournisseur->enabled) $qualified=0;
if ($obj->module == 'order_supplier' && ! $conf->fournisseur->enabled) $qualified=0;
if ($obj->module == 'shipping' && ! $conf->expedition->enabled) $qualified=0;
}
if ($qualified)
{
$transcode=$langs->trans("Action".$obj->code);
$repid[$obj->id] = ($transcode!="Action".$obj->code?$transcode:$langs->trans($obj->libelle));
$repcode[$obj->code] = ($transcode!="Action".$obj->code?$transcode:$langs->trans($obj->libelle));
$code=$obj->code;
if ($onlyautoornot && $code == 'AC_OTH') $code='AC_MANUAL';
if ($onlyautoornot && $code == 'AC_OTH_AUTO') $code='AC_AUTO';
$transcode=$langs->trans("Action".$code);
$repid[$obj->id] = ($transcode!="Action".$code?$transcode:$langs->trans($obj->libelle));
$repcode[$obj->code] = ($transcode!="Action".$code?$transcode:$langs->trans($obj->libelle));
if ($onlyautoornot && preg_match('/^module/',$obj->type) && $obj->module) $repcode[$obj->code].=' ('.$langs->trans("Module").': '.$obj->module.')';
}
$i++;
}

View File

@ -0,0 +1,429 @@
<?php
/* Copyright (C) 2001-2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2012 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2012 Regis Houssin <regis@dolibarr.fr>
* Copyright (C) 2012 Philippe Grand <philippe.grand@atoo-net.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* 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/comm/action/contact.php
* \ingroup agenda
* \brief Page for multi-users event
*/
require '../../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/agenda.lib.php';
require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php';
require_once DOL_DOCUMENT_ROOT.'/user/class/user.class.php';
require_once DOL_DOCUMENT_ROOT.'/comm/action/class/actioncomm.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php';
$langs->load("companies");
$langs->load("commercial");
$langs->load("other");
$langs->load("bills");
$id = GETPOST('id','int');
$action = GETPOST('action','alpha');
$ref = GETPOST('ref');
$confirm = GETPOST('confirm');
$lineid = GETPOST('lineid','int');
// Security check
if ($user->societe_id > 0)
{
unset($_GET["action"]);
$action='';
$socid = $user->societe_id;
}
$object = new ActionComm($db);
/*
* Actions
*/
/*
* Ajout d'un nouveau contact
*/
if ($action == 'addcontact')
{
$result = $object->fetch($id);
if ($object->id > 0)
{
$contactid = (GETPOST('userid','int') ? GETPOST('userid','int') : GETPOST('contactid','int'));
$result = $object->add_contact($contactid, $_POST["type"], $_POST["source"]);
}
if ($result >= 0)
{
header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id);
exit;
}
else
{
if ($object->error == 'DB_ERROR_RECORD_ALREADY_EXISTS')
{
$langs->load("errors");
setEventMessage($langs->trans("ErrorThisContactIsAlreadyDefinedAsThisType"), 'errors');
}
else
{
setEventMessage($object->error, 'errors');
}
}
}
// modification d'un contact. On enregistre le type
if ($action == 'updateline')
{
if ($object->fetch($id))
{
$contact = $object->detail_contact($_POST["line"]);
$type = $_POST["type"];
$statut = $contact->statut;
$result = $object->update_contact($_POST["line"], $statut, $type);
if ($result >= 0)
{
$db->commit();
} else
{
dol_print_error($db, "result=$result");
$db->rollback();
}
}
else
{
setEventMessage($object->error, 'errors');
}
}
// Bascule du statut d'un contact
else if ($action == 'swapstatut')
{
if ($object->id > 0)
{
$result=$object->swapContactStatus(GETPOST('ligne'));
}
}
// Efface un contact
else if ($action == 'deletecontact')
{
$result = $object->delete_contact($lineid);
if ($result >= 0)
{
header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id);
exit;
}
else
{
dol_print_error($db);
}
}
/*
* View
*/
$form = new Form($db);
$formcompany= new FormCompany($db);
$contactstatic=new Contact($db);
$userstatic=new User($db);
$help_url='EN:Module_Agenda_En|FR:Module_Agenda|ES:M&omodulodulo_Agenda';
llxHeader('',$langs->trans("Agenda"),$help_url);
if ($id > 0 || ! empty($ref))
{
dol_htmloutput_mesg($mesg,$mesgs);
if ($object->fetch($id,$ref) > 0)
{
$head=actions_prepare_head($object);
dol_fiche_head($head, 'contact', $langs->trans("Action"),0,'action');
// Affichage fiche action en mode visu
print '<table class="border" width="100%">';
$linkback = '<a href="'.DOL_URL_ROOT.'/comm/action/index.php">'.$langs->trans("BackToList").'</a>';
// Ref
print '<tr><td width="30%">'.$langs->trans("Ref").'</td><td colspan="3">';
print $form->showrefnav($object, 'id', $linkback, ($user->societe_id?0:1), 'id', 'ref', '');
print '</td></tr>';
// Type
if (! empty($conf->global->AGENDA_USE_EVENT_TYPE))
{
print '<tr><td>'.$langs->trans("Type").'</td><td colspan="3">'.$object->type.'</td></tr>';
}
// Title
print '<tr><td>'.$langs->trans("Title").'</td><td colspan="3">'.$object->label.'</td></tr>';
// Full day event
print '<tr><td>'.$langs->trans("EventOnFullDay").'</td><td colspan="3">'.yn($object->fulldayevent).'</td></tr>';
// Date start
print '<tr><td width="30%">'.$langs->trans("DateActionStart").'</td><td colspan="2">';
if (! $object->fulldayevent) print dol_print_date($object->datep,'dayhour');
else print dol_print_date($object->datep,'day');
if ($object->percentage == 0 && $object->datep && $object->datep < ($now - $delay_warning)) print img_warning($langs->trans("Late"));
print '</td>';
print '<td rowspan="4" align="center" valign="middle" width="180">'."\n";
print '<form name="listactionsfiltermonth" action="'.DOL_URL_ROOT.'/comm/action/index.php" method="POST">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<input type="hidden" name="action" value="show_month">';
print '<input type="hidden" name="year" value="'.dol_print_date($object->datep,'%Y').'">';
print '<input type="hidden" name="month" value="'.dol_print_date($object->datep,'%m').'">';
print '<input type="hidden" name="day" value="'.dol_print_date($object->datep,'%d').'">';
//print '<input type="hidden" name="day" value="'.dol_print_date($object->datep,'%d').'">';
print img_picto($langs->trans("ViewCal"),'object_calendar').' <input type="submit" style="width: 120px" class="button" name="viewcal" value="'.$langs->trans("ViewCal").'">';
print '</form>'."\n";
print '<form name="listactionsfilterweek" action="'.DOL_URL_ROOT.'/comm/action/index.php" method="POST">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<input type="hidden" name="action" value="show_week">';
print '<input type="hidden" name="year" value="'.dol_print_date($object->datep,'%Y').'">';
print '<input type="hidden" name="month" value="'.dol_print_date($object->datep,'%m').'">';
print '<input type="hidden" name="day" value="'.dol_print_date($object->datep,'%d').'">';
//print '<input type="hidden" name="day" value="'.dol_print_date($object->datep,'%d').'">';
print img_picto($langs->trans("ViewCal"),'object_calendarweek').' <input type="submit" style="width: 120px" class="button" name="viewweek" value="'.$langs->trans("ViewWeek").'">';
print '</form>'."\n";
print '<form name="listactionsfilterday" action="'.DOL_URL_ROOT.'/comm/action/index.php" method="POST">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<input type="hidden" name="action" value="show_day">';
print '<input type="hidden" name="year" value="'.dol_print_date($object->datep,'%Y').'">';
print '<input type="hidden" name="month" value="'.dol_print_date($object->datep,'%m').'">';
print '<input type="hidden" name="day" value="'.dol_print_date($object->datep,'%d').'">';
//print '<input type="hidden" name="day" value="'.dol_print_date($object->datep,'%d').'">';
print img_picto($langs->trans("ViewCal"),'object_calendarday').' <input type="submit" style="width: 120px" class="button" name="viewday" value="'.$langs->trans("ViewDay").'">';
print '</form>'."\n";
print '</td>';
print '</tr>';
// Date end
print '<tr><td>'.$langs->trans("DateActionEnd").'</td><td colspan="2">';
if (! $object->fulldayevent) print dol_print_date($object->datef,'dayhour');
else print dol_print_date($object->datef,'day');
if ($object->percentage > 0 && $object->percentage < 100 && $object->datef && $object->datef < ($now- $delay_warning)) print img_warning($langs->trans("Late"));
print '</td></tr>';
// Location
print '<tr><td>'.$langs->trans("Location").'</td><td colspan="2">'.$object->location.'</td></tr>';
print '</table>';
print '</div>';
/*
* Lignes de contacts
*/
print '<br><table class="noborder" width="100%">';
/*
* Ajouter une ligne de contact
* Non affiche en mode modification de ligne
*/
if ($action != 'editline')
{
print '<tr class="liste_titre">';
print '<td>'.$langs->trans("Source").'</td>';
print '<td>'.$langs->trans("Company").'</td>';
print '<td>'.$langs->trans("Contacts").'</td>';
print '<td>'.$langs->trans("ContactType").'</td>';
print '<td colspan="3">&nbsp;</td>';
print "</tr>\n";
$var = false;
print '<form action="'.$_SERVER["PHP_SELF"].'?id='.$id.'" method="POST">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<input type="hidden" name="action" value="addcontact">';
print '<input type="hidden" name="source" value="internal">';
print '<input type="hidden" name="id" value="'.$id.'">';
// Ligne ajout pour contact interne
print "<tr $bc[$var]>";
print '<td nowrap="nowrap">';
print img_object('','user').' '.$langs->trans("Users");
print '</td>';
print '<td colspan="1">';
print $conf->global->MAIN_INFO_SOCIETE_NOM;
print '</td>';
print '<td colspan="1">';
// On recupere les id des users deja selectionnes
$form->select_users($user->id,'contactid',0);
print '</td>';
print '<td>';
$formcompany->selectTypeContact($object, '', 'type','internal','rowid');
print '</td>';
print '<td align="right" colspan="3" ><input type="submit" class="button" value="'.$langs->trans("Add").'"></td>';
print '</tr>';
print '</form>';
print '<form action="'.$_SERVER["PHP_SELF"].'?id='.$id.'" method="POST">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<input type="hidden" name="action" value="addcontact">';
print '<input type="hidden" name="source" value="external">';
print '<input type="hidden" name="id" value="'.$id.'">';
// Line to add external contact. Only if project is linked to a third party.
if ($object->socid)
{
$var=!$var;
print "<tr $bc[$var]>";
print '<td nowrap="nowrap">';
print img_object('','contact').' '.$langs->trans("ThirdPartyContacts");
print '</td>';
print '<td colspan="1">';
$selectedCompany = isset($_GET["newcompany"])?$_GET["newcompany"]:$object->socid;
$selectedCompany = $formcompany->selectCompaniesForNewContact($object, 'id', $selectedCompany, 'newcompany');
print '</td>';
print '<td colspan="1">';
$nbofcontacts=$form->select_contacts($selectedCompany,'','contactid');
if ($nbofcontacts == 0) print $langs->trans("NoContactDefined");
print '</td>';
print '<td>';
$formcompany->selectTypeContact($object,'','type','external','rowid');
print '</td>';
print '<td align="right" colspan="3" ><input type="submit" class="button" value="'.$langs->trans("Add").'"';
if (! $nbofcontacts) print ' disabled="true"';
print '></td>';
print '</tr>';
}
print "</form>";
print '<tr><td colspan="6">&nbsp;</td></tr>';
}
// Liste des contacts lies
print '<tr class="liste_titre">';
print '<td>'.$langs->trans("Source").'</td>';
print '<td>'.$langs->trans("Company").'</td>';
print '<td>'.$langs->trans("Contacts").'</td>';
print '<td>'.$langs->trans("ContactType").'</td>';
print '<td align="center">'.$langs->trans("Status").'</td>';
print '<td colspan="2">&nbsp;</td>';
print "</tr>\n";
$companystatic = new Societe($db);
$var = true;
foreach(array('internal','external') as $source)
{
$tab = $object->liste_contact(-1,$source);
$num=sizeof($tab);
$i = 0;
while ($i < $num)
{
$var = !$var;
print '<tr '.$bc[$var].' valign="top">';
// Source
print '<td align="left">';
if ($tab[$i]['source']=='internal') print $langs->trans("User");
if ($tab[$i]['source']=='external') print $langs->trans("ThirdPartyContact");
print '</td>';
// Societe
print '<td align="left">';
if ($tab[$i]['socid'] > 0)
{
$companystatic->fetch($tab[$i]['socid']);
print $companystatic->getNomUrl(1);
}
if ($tab[$i]['socid'] < 0)
{
print $conf->global->MAIN_INFO_SOCIETE_NOM;
}
if (! $tab[$i]['socid'])
{
print '&nbsp;';
}
print '</td>';
// Contact
print '<td>';
if ($tab[$i]['source']=='internal')
{
print '<a href="'.DOL_URL_ROOT.'/user/fiche.php?id='.$tab[$i]['id'].'">';
print img_object($langs->trans("ShowUser"),"user").' '.$tab[$i]['nom'].'</a>';
}
if ($tab[$i]['source']=='external')
{
print '<a href="'.DOL_URL_ROOT.'/contact/fiche.php?id='.$tab[$i]['id'].'">';
print img_object($langs->trans("ShowContact"),"contact").' '.$tab[$i]['nom'].'</a>';
}
print '</td>';
// Type de contact
print '<td>'.$tab[$i]['libelle'].'</td>';
// Statut
print '<td align="center">';
// Activation desativation du contact
if ($object->statut >= 0 ) print '<a href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&amp;action=swapstatut&amp;line='.$tab[$i]['rowid'].'">';
print $contactstatic->LibStatut($tab[$i]['status'],3);
if ($object->statut >= 0 ) print '</a>';
print '</td>';
// Icon update et delete
print '<td align="center" nowrap>';
/*if ($user->rights->business->write && $userAccess)
{*/
print '&nbsp;';
print '<a href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&amp;action=deleteline&amp;line='.$tab[$i]['rowid'].'">';
print img_delete();
print '</a>';
//}
print '</td>';
print "</tr>\n";
$i ++;
}
}
print "</table>";
}
else
{
print "ErrorRecordNotFound";
}
}
llxFooter();
$db->close();
?>

View File

@ -127,7 +127,10 @@ if ($objectid > 0)
print '</td></tr>';
// Type
print '<tr><td>'.$langs->trans("Type").'</td><td colspan="3">'.$act->type.'</td></tr>';
if (! empty($conf->global->AGENDA_USE_EVENT_TYPE))
{
print '<tr><td>'.$langs->trans("Type").'</td><td colspan="3">'.$act->type.'</td></tr>';
}
// Title
print '<tr><td>'.$langs->trans("Title").'</td><td colspan="3">'.$act->label.'</td></tr>';

View File

@ -107,6 +107,13 @@ if ($action == 'add_action')
$mesg='<div class="error">'.$langs->trans("ErrorFieldRequired",$langs->trans("DateEnd")).'</div>';
}
if (empty($conf->global->AGENDA_USE_EVENT_TYPE) && ! GETPOST('label'))
{
$error++;
$action = 'create';
$mesg='<div class="error">'.$langs->trans("ErrorFieldRequired",$langs->trans("Title")).'</div>';
}
// Initialisation objet cactioncomm
if (! GETPOST('actioncode'))
{
@ -122,13 +129,13 @@ if ($action == 'add_action')
// Initialisation objet actioncomm
$actioncomm->type_id = $cactioncomm->id;
$actioncomm->type_code = $cactioncomm->code;
$actioncomm->priority = isset($_POST["priority"])?$_POST["priority"]:0;
$actioncomm->priority = GETPOST("priority")?GETPOST("priority"):0;
$actioncomm->fulldayevent = (! empty($fulldayevent)?1:0);
$actioncomm->location = isset($_POST["location"])?$_POST["location"]:'';
$actioncomm->label = trim($_POST["label"]);
if (! $_POST["label"])
$actioncomm->location = GETPOST("location");
$actioncomm->label = trim(GETPOST('label'));
if (! GETPOST('label'))
{
if ($_POST["actioncode"] == 'AC_RDV' && $contact->getFullName($langs))
if (GETPOST('actioncode') == 'AC_RDV' && $contact->getFullName($langs))
{
$actioncomm->label = $langs->transnoentitiesnoconv("TaskRDVWith",$contact->getFullName($langs));
}
@ -390,11 +397,13 @@ if ($action == 'create')
$(".fulldaystartmin").removeAttr("disabled");
$(".fulldayendhour").removeAttr("disabled");
$(".fulldayendmin").removeAttr("disabled");
$("#p2").removeAttr("disabled");
} else {
$(".fulldaystarthour").attr("disabled","disabled").val("00");
$(".fulldaystartmin").attr("disabled","disabled").val("00");
$(".fulldayendhour").attr("disabled","disabled").val("23");
$(".fulldayendmin").attr("disabled","disabled").val("59");
$("#p2").attr("disabled","disabled").val("");
}
}
setdatefields();
@ -432,21 +441,25 @@ if ($action == 'create')
print '<table class="border" width="100%">';
// Type d'action actifs
print '<tr><td width="30%"><span class="fieldrequired">'.$langs->trans("Type").'</span></b></td><td>';
if (GETPOST("actioncode"))
if (! empty($conf->global->AGENDA_USE_EVENT_TYPE))
{
print '<input type="hidden" name="actioncode" value="'.GETPOST("actioncode").'">'."\n";
$cactioncomm->fetch(GETPOST("actioncode"));
print $cactioncomm->getNomUrl();
print '<tr><td width="30%"><span class="fieldrequired">'.$langs->trans("Type").'</span></b></td><td>';
if (GETPOST("actioncode"))
{
print '<input type="hidden" name="actioncode" value="'.GETPOST("actioncode").'">'."\n";
$cactioncomm->fetch(GETPOST("actioncode"));
print $cactioncomm->getNomUrl();
}
else
{
$htmlactions->select_type_actions($actioncomm->type_code, "actioncode","systemauto");
}
print '</td></tr>';
}
else
{
$htmlactions->select_type_actions($actioncomm->type_code, "actioncode","systemauto");
}
print '</td></tr>';
else print '<input type="hidden" name="actioncode" value="AC_OTH">';
// Title
print '<tr><td>'.$langs->trans("Title").'</td><td><input type="text" name="label" size="60" value="'.GETPOST('label').'"></td></tr>';
print '<tr><td'.(empty($conf->global->AGENDA_USE_EVENT_TYPE)?' class="fieldrequired"':'').'>'.$langs->trans("Title").'</td><td><input type="text" name="label" size="60" value="'.GETPOST('label').'"></td></tr>';
// Full day
print '<tr><td class="fieldrequired">'.$langs->trans("EventOnFullDay").'</td><td><input type="checkbox" id="fullday" name="fullday" '.(GETPOST('fullday')?' checked="checked"':'').'></td></tr>';
@ -678,10 +691,13 @@ if ($id)
print '<tr><td width="30%">'.$langs->trans("Ref").'</td><td colspan="3">'.$act->id.'</td></tr>';
// Type
print '<tr><td class="fieldrequired">'.$langs->trans("Type").'</td><td colspan="3">'.$act->type.'</td></tr>';
if (! empty($conf->global->AGENDA_USE_EVENT_TYPE))
{
print '<tr><td class="fieldrequired">'.$langs->trans("Type").'</td><td colspan="3">'.$act->type.'</td></tr>';
}
// Title
print '<tr><td>'.$langs->trans("Title").'</td><td colspan="3"><input type="text" name="label" size="50" value="'.$act->label.'"></td></tr>';
print '<tr><td'.(empty($conf->global->AGENDA_USE_EVENT_TYPE)?' class="fieldrequired"':'').'>'.$langs->trans("Title").'</td><td colspan="3"><input type="text" name="label" size="50" value="'.$act->label.'"></td></tr>';
// Full day event
print '<tr><td class="fieldrequired">'.$langs->trans("EventOnFullDay").'</td><td colspan="3"><input type="checkbox" id="fullday" name="fullday" '.($act->fulldayevent?' checked="checked"':'').'></td></tr>';
@ -797,7 +813,10 @@ if ($id)
print '</td></tr>';
// Type
print '<tr><td>'.$langs->trans("Type").'</td><td colspan="3">'.$act->type.'</td></tr>';
if (! empty($conf->global->AGENDA_USE_EVENT_TYPE))
{
print '<tr><td>'.$langs->trans("Type").'</td><td colspan="3">'.$act->type.'</td></tr>';
}
// Title
print '<tr><td>'.$langs->trans("Title").'</td><td colspan="3">'.$act->label.'</td></tr>';

View File

@ -340,6 +340,7 @@ if ($action == 'create')
$langs->load("bills");
print '<center>';
print '<input type="submit" class="button" value="'.$langs->trans("CreateDraft").'">';
print '&nbsp;<input type="button" class="button" value="'.$langs->trans("Cancel").'" onClick="javascript:history.go(-1)">';
print '</center>';
print "</form>";

View File

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

View File

@ -546,17 +546,12 @@ class BonPrelevement extends CommonObject
// TODO Call trigger to create a notification using notification module
}
else
{
{
dol_syslog(get_class($this)."::set_infotrans Erreur 1", LOG_ERR);
dol_syslog($this->db->error());
$error++;
}
/*
* End of procedure
*
*/
if ($error == 0)
{
$this->db->commit();
@ -1047,6 +1042,44 @@ class BonPrelevement extends CommonObject
}
/**
* Get object and lines from database
*
* @return int >0 if OK, <0 if KO
*/
function delete()
{
$this->db->begin();
$sql = "DELETE FROM ".MAIN_DB_PREFIX."prelevement_facture WHERE fk_prelevement_lignes IN (SELECT rowid FROM ".MAIN_DB_PREFIX."prelevement_lignes WHERE fk_prelevement_bons = '".$this->id."')";
$resql1=$this->db->query($sql);
if (! $resql1) dol_print_error($this->db);
$sql = "DELETE FROM ".MAIN_DB_PREFIX."prelevement_lignes WHERE fk_prelevement_bons = '".$this->id."'";
$resql2=$this->db->query($sql);
if (! $resql2) dol_print_error($this->db);
$sql = "DELETE FROM ".MAIN_DB_PREFIX."prelevement_bons WHERE rowid = '".$this->id."'";
$resql3=$this->db->query($sql);
if (! $resql3) dol_print_error($this->db);
$sql = "UPDATE ".MAIN_DB_PREFIX."prelevement_facture_demande SET fk_prelevement_bons = NULL, traite = 0 WHERE fk_prelevement_bons = '".$this->id."'";
$resql4=$this->db->query($sql);
if (! $resql4) dol_print_error($this->db);
if ($resql1 && $resql2 && $resql3)
{
$this->db->commit();
return 1;
}
else
{
$this->db->rollback();
return -1;
}
}
/**
* Returns clickable name (with picto)
*
@ -1595,20 +1628,20 @@ class BonPrelevement extends CommonObject
{
if ($statut==0) return img_picto($langs->trans($this->labelstatut[$statut]),'statut0').' '.$langs->trans($this->labelstatut[$statut]);
if ($statut==1) return img_picto($langs->trans($this->labelstatut[$statut]),'statut1').' '.$langs->trans($this->labelstatut[$statut]);
if ($statut==2) return img_picto($langs->trans($this->labelstatut[$statut]),'statut4').' '.$langs->trans($this->labelstatut[$statut]);
if ($statut==2) return img_picto($langs->trans($this->labelstatut[$statut]),'statut6').' '.$langs->trans($this->labelstatut[$statut]);
}
if ($mode == 2)
{
if ($statut==0) return img_picto($langs->trans($this->labelstatut[$statut]),'statut0');
if ($statut==1) return img_picto($langs->trans($this->labelstatut[$statut]),'statut1');
if ($statut==2) return img_picto($langs->trans($this->labelstatut[$statut]),'statut4');
if ($statut==2) return img_picto($langs->trans($this->labelstatut[$statut]),'statut6');
}
if ($mode == 3)
{
if ($statut==0) return $langs->trans($this->labelstatut[$statut]).' '.img_picto($langs->trans($this->labelstatut[$statut]),'statut0');
if ($statut==1) return $langs->trans($this->labelstatut[$statut]).' '.img_picto($langs->trans($this->labelstatut[$statut]),'statut1');
if ($statut==2) return $langs->trans($this->labelstatut[$statut]).' '.img_picto($langs->trans($this->labelstatut[$statut]),'statut4');
if ($statut==2) return $langs->trans($this->labelstatut[$statut]).' '.img_picto($langs->trans($this->labelstatut[$statut]),'statut6');
}
}

View File

@ -55,27 +55,21 @@ if ($prev_id)
dol_fiche_head($head, 'invoices', $langs->trans("WithdrawalReceipt"), '', 'payment');
print '<table class="border" width="100%">';
print '<tr><td width="20%">'.$langs->trans("Ref").'</td><td>'.$bon->getNomUrl(1).'</td></tr>';
print '<tr><td width="20%">'.$langs->trans("Ref").'</td><td>'.$bon->getNomUrl(1).'</td></tr>';
print '<tr><td width="20%">'.$langs->trans("Date").'</td><td>'.dol_print_date($bon->datec,'day').'</td></tr>';
print '<tr><td width="20%">'.$langs->trans("Amount").'</td><td>'.price($bon->amount).'</td></tr>';
print '<tr><td width="20%">'.$langs->trans("File").'</td><td>';
$relativepath = 'receipts/'.$bon->ref;
print '<a href="'.DOL_URL_ROOT.'/document.php?type=text/plain&amp;modulepart=prelevement&amp;file='.urlencode($relativepath).'">'.$relativepath.'</a>';
print '</td></tr>';
// Status
print '<tr><td width="20%">'.$langs->trans('Status').'</td>';
print '<td>'.$bon->getLibStatut(1).'</td>';
print '</tr>';
if($bon->date_trans <> 0)
{
$muser = new User($db);
$muser->fetch($bon->user_trans);
print '<tr><td width="20%">'.$langs->trans("TransData").'</td><td>';
print dol_print_date($bon->date_trans,'day');
print ' '.$langs->trans("By").' '.$muser->getFullName($langs).'</td></tr>';
@ -89,10 +83,19 @@ if ($prev_id)
print dol_print_date($bon->date_credit,'day');
print '</td></tr>';
}
print '</table>';
print '</div>';
print '</table>';
print '<br>';
print '<table class="border" width="100%"><tr><td width="20%">';
print $langs->trans("WithdrawalFile").'</td><td>';
$relativepath = 'receipts/'.$bon->ref;
print '<a href="'.DOL_URL_ROOT.'/document.php?type=text/plain&amp;modulepart=prelevement&amp;file='.urlencode($relativepath).'">'.$relativepath.'</a>';
print '</td></tr></table>';
dol_fiche_end();
}
else
{

View File

@ -54,27 +54,21 @@ if ($prev_id)
dol_fiche_head($head, 'rejects', $langs->trans("WithdrawalReceipt"), '', 'payment');
print '<table class="border" width="100%">';
print '<tr><td width="20%">'.$langs->trans("Ref").'</td><td>'.$bon->getNomUrl(1).'</td></tr>';
print '<tr><td width="20%">'.$langs->trans("Ref").'</td><td>'.$bon->getNomUrl(1).'</td></tr>';
print '<tr><td width="20%">'.$langs->trans("Date").'</td><td>'.dol_print_date($bon->datec,'day').'</td></tr>';
print '<tr><td width="20%">'.$langs->trans("Amount").'</td><td>'.price($bon->amount).'</td></tr>';
print '<tr><td width="20%">'.$langs->trans("File").'</td><td>';
$relativepath = 'receipts/'.$bon->ref;
print '<a href="'.DOL_URL_ROOT.'/document.php?type=text/plain&amp;modulepart=prelevement&amp;file='.urlencode($relativepath).'">'.$relativepath.'</a>';
print '</td></tr>';
// Status
print '<tr><td width="20%">'.$langs->trans('Status').'</td>';
print '<td>'.$bon->getLibStatut(1).'</td>';
print '</tr>';
if($bon->date_trans <> 0)
{
$muser = new User($db);
$muser->fetch($bon->user_trans);
print '<tr><td width="20%">'.$langs->trans("TransData").'</td><td>';
print dol_print_date($bon->date_trans,'day');
print ' '.$langs->trans("By").' '.$muser->getFullName($langs).'</td></tr>';
@ -88,10 +82,19 @@ if ($prev_id)
print dol_print_date($bon->date_credit,'day');
print '</td></tr>';
}
print '</table>';
print '</div>';
print '</table>';
print '<br>';
print '<table class="border" width="100%"><tr><td width="20%">';
print $langs->trans("WithdrawalFile").'</td><td>';
$relativepath = 'receipts/'.$bon->ref;
print '<a href="'.DOL_URL_ROOT.'/document.php?type=text/plain&amp;modulepart=prelevement&amp;file='.urlencode($relativepath).'">'.$relativepath.'</a>';
print '</td></tr></table>';
dol_fiche_end();
}
else
{
@ -103,8 +106,6 @@ $rej = new RejetPrelevement($db, $user);
/*
* Liste des factures
*
*
*/
$sql = "SELECT pl.rowid, pl.amount, pl.statut";
$sql.= " , s.rowid as socid, s.nom";
@ -141,10 +142,10 @@ if ($resql)
{
$obj = $db->fetch_object($resql);
print "<tr $bc[$var]><td>";
print '<img border="0" src="./img/statut'.$obj->statut.'.png"></a>&nbsp;';
print '<a href="'.DOL_URL_ROOT.'/compta/prelevement/ligne.php?id='.$obj->rowid.'">';
print "<tr ".$bc[$var]."><td>";
print '<a href="'.DOL_URL_ROOT.'/compta/prelevement/ligne.php?id='.$obj->rowid.'">';
print img_picto('', 'statut'.$obj->statut).' ';
print substr('000000'.$obj->rowid, -6);
print '</a></td>';
print '<td><a href="'.DOL_URL_ROOT.'/comm/fiche.php?socid='.$obj->socid.'">'.stripslashes($obj->nom)."</a></td>\n";
@ -164,7 +165,7 @@ if ($resql)
print '<tr class="liste_total"><td>&nbsp;</td>';
print '<td class="liste_total">'.$langs->trans("Total").'</td>';
print '<td align="right">'.price($total)."</td>\n";
print '<td>&nbsp;</td>';
print '<td colspan="3">&nbsp;</td>';
print "</tr>\n</table>\n";
$db->free($resql);
}

View File

@ -58,24 +58,17 @@ if ($prev_id)
print '<tr><td width="20%">'.$langs->trans("Ref").'</td><td>'.$bon->getNomUrl(1).'</td></tr>';
print '<tr><td width="20%">'.$langs->trans("Date").'</td><td>'.dol_print_date($bon->datec,'day').'</td></tr>';
print '<tr><td width="20%">'.$langs->trans("Amount").'</td><td>'.price($bon->amount).'</td></tr>';
print '<tr><td width="20%">'.$langs->trans("File").'</td><td>';
$relativepath = 'receipts/'.$bon->ref;
print '<a href="'.DOL_URL_ROOT.'/document.php?type=text/plain&amp;modulepart=prelevement&amp;file='.urlencode($relativepath).'">'.$relativepath.'</a>';
print '</td></tr>';
// Status
print '<tr><td width="20%">'.$langs->trans('Status').'</td>';
print '<td>'.$bon->getLibStatut(1).'</td>';
print '</tr>';
if($bon->date_trans <> 0)
{
$muser = new User($db);
$muser->fetch($bon->user_trans);
print '<tr><td width="20%">'.$langs->trans("TransData").'</td><td>';
print dol_print_date($bon->date_trans,'day');
print ' '.$langs->trans("By").' '.$muser->getFullName($langs).'</td></tr>';
@ -89,10 +82,19 @@ if ($prev_id)
print dol_print_date($bon->date_credit,'day');
print '</td></tr>';
}
print '</table>';
print '</div>';
print '<br>';
print '<table class="border" width="100%"><tr><td width="20%">';
print $langs->trans("WithdrawalFile").'</td><td>';
$relativepath = 'receipts/'.$bon->ref;
print '<a href="'.DOL_URL_ROOT.'/document.php?type=text/plain&amp;modulepart=prelevement&amp;file='.urlencode($relativepath).'">'.$relativepath.'</a>';
print '</td></tr></table>';
dol_fiche_end();
}
else
{

View File

@ -42,14 +42,28 @@ if ($user->societe_id > 0) accessforbidden();
$action = GETPOST('action','alpha');
$id = GETPOST('id','int');
/*
* Actions
*/
if ( $action == 'confirm_delete' )
{
$bon = new BonPrelevement($db,"");
$bon->fetch($id);
$res=$bon->delete();
if ($res > 0)
{
header("Location: index.php");
exit;
}
}
if ( $action == 'confirm_credite' && GETPOST('confirm','alpha') == 'yes')
{
$bon = new BonPrelevement($db,"");
$bon->id = $id;
$bon->fetch($id);
$bon->set_credite();
header("Location: fiche.php?id=".$id);
@ -63,14 +77,15 @@ if ($action == 'infotrans' && $user->rights->prelevement->bons->send)
$bon = new BonPrelevement($db,"");
$bon->fetch($id);
$dt = dol_mktime(12,0,0,GETPOST('remonth','int'),GETPOST('reday','int'),GETPOST('reyear','int'));
/*
if ($_FILES['userfile']['name'] && basename($_FILES['userfile']['name'],".ps") == $bon->ref)
{
$dir = $conf->prelevement->dir_output.'/receipts';
if (dol_move_uploaded_file($_FILES['userfile']['tmp_name'], $dir . "/" . dol_unescapefile($_FILES['userfile']['name']),1) > 0)
{
$dt = dol_mktime(12,0,0,GETPOST('remonth','int'),GETPOST('reday','int'),GETPOST('reyear','int'));
$bon->set_infotrans($user, $dt, GETPOST('methode','alpha'));
}
@ -81,6 +96,14 @@ if ($action == 'infotrans' && $user->rights->prelevement->bons->send)
{
dol_syslog("Fichier invalide",LOG_WARNING);
$mesg='BadFile';
}*/
$error = $bon->set_infotrans($user, $dt, GETPOST('methode','alpha'));
if ($error)
{
header("Location: fiche.php?id=".$id."&error=$error");
exit;
}
}
@ -92,15 +115,11 @@ if ($action == 'infocredit' && $user->rights->prelevement->bons->credit)
$error = $bon->set_infocredit($user, $dt);
if ($error == 0)
{
header("Location: fiche.php?id=".$id);
}
else
if ($error)
{
header("Location: fiche.php?id=".$id."&error=$error");
exit;
}
exit;
}
@ -108,132 +127,139 @@ if ($action == 'infocredit' && $user->rights->prelevement->bons->credit)
* View
*/
llxHeader('',$langs->trans("WithdrawalReceipt"));
$bon = new BonPrelevement($db,"");
$form = new Form($db);
if ($id)
llxHeader('',$langs->trans("WithdrawalReceipt"));
if ($id > 0)
{
$bon = new BonPrelevement($db,"");
$bon->fetch($id);
if ($bon->fetch($id) == 0)
$head = prelevement_prepare_head($bon);
dol_fiche_head($head, 'prelevement', $langs->trans("WithdrawalReceipt"), '', 'payment');
if (GETPOST('error','alpha')!='')
{
$head = prelevement_prepare_head($bon);
dol_fiche_head($head, 'prelevement', $langs->trans("WithdrawalReceipt"), '', 'payment');
print '<div class="error">'.$bon->ReadError(GETPOST('error','alpha')).'</div>';
}
if (GETPOST('error','alpha')!='')
{
print '<div class="error">'.$bon->ReadError(GETPOST('error','alpha')).'</div>';
}
/*if ($action == 'credite')
{
$ret=$form->form_confirm("fiche.php?id=".$bon->id,$langs->trans("ClassCredited"),$langs->trans("ClassCreditedConfirm"),"confirm_credite",'',1,1);
if ($ret == 'html') print '<br>';
}*/
if ($action == 'credite')
{
$ret=$form->form_confirm("fiche.php?id=".$bon->id,$langs->trans("ClassCredited"),$langs->trans("ClassCreditedConfirm"),"confirm_credite",'',1,1);
if ($ret == 'html') print '<br>';
}
print '<table class="border" width="100%">';
print '<table class="border" width="100%">';
print '<tr><td width="20%">'.$langs->trans("Ref").'</td><td>'.$bon->getNomUrl(1).'</td></tr>';
print '<tr><td width="20%">'.$langs->trans("Date").'</td><td>'.dol_print_date($bon->datec,'day').'</td></tr>';
print '<tr><td width="20%">'.$langs->trans("Amount").'</td><td>'.price($bon->amount).'</td></tr>';
print '<tr><td width="20%">'.$langs->trans("Ref").'</td><td>'.$bon->getNomUrl(1).'</td></tr>';
print '<tr><td width="20%">'.$langs->trans("Date").'</td><td>'.dol_print_date($bon->datec,'day').'</td></tr>';
print '<tr><td width="20%">'.$langs->trans("Amount").'</td><td>'.price($bon->amount).'</td></tr>';
print '<tr><td width="20%">'.$langs->trans("File").'</td><td>';
// Status
print '<tr><td width="20%">'.$langs->trans('Status').'</td>';
print '<td>'.$bon->getLibStatut(1).'</td>';
print '</tr>';
$relativepath = 'receipts/'.$bon->ref;
print '<a href="'.DOL_URL_ROOT.'/document.php?type=text/plain&amp;modulepart=prelevement&amp;file='.urlencode($relativepath).'">'.$relativepath.'</a>';
if($bon->date_trans <> 0)
{
$muser = new User($db);
$muser->fetch($bon->user_trans);
print '<tr><td width="20%">'.$langs->trans("TransData").'</td><td>';
print dol_print_date($bon->date_trans,'day');
print ' '.$langs->trans("By").' '.$muser->getFullName($langs).'</td></tr>';
print '<tr><td width="20%">'.$langs->trans("TransMetod").'</td><td>';
print $bon->methodes_trans[$bon->method_trans];
print '</td></tr>';
// Status
print '<tr><td width="20%">'.$langs->trans('Status').'</td>';
print '<td>'.$bon->getLibStatut(1).'</td>';
print '</tr>';
if($bon->date_trans <> 0)
{
$muser = new User($db);
$muser->fetch($bon->user_trans);
print '<tr><td width="20%">'.$langs->trans("TransData").'</td><td>';
print dol_print_date($bon->date_trans,'day');
print ' '.$langs->trans("By").' '.$muser->getFullName($langs).'</td></tr>';
print '<tr><td width="20%">'.$langs->trans("TransMetod").'</td><td>';
print $bon->methodes_trans[$bon->method_trans];
print '</td></tr>';
}
if($bon->date_credit <> 0)
{
print '<tr><td width="20%">'.$langs->trans('CreditDate').'</td><td>';
print dol_print_date($bon->date_credit,'day');
print '</td></tr>';
}
print '</table>';
dol_fiche_end();
if($bon->date_trans == 0 && $user->rights->prelevement->bons->send)
{
print '<form method="post" name="userfile" action="fiche.php?id='.$bon->id.'" enctype="multipart/form-data">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<input type="hidden" name="action" value="infotrans">';
print '<table class="border" width="100%">';
print '<tr class="liste_titre">';
print '<td colspan="3">'.$langs->trans("NotifyTransmision").'</td></tr>';
print '<tr><td width="20%">'.$langs->trans("TransData").'</td><td>';
print $form->select_date('','','','','',"userfile");
print '</td></tr>';
print '<tr><td width="20%">'.$langs->trans("TransMetod").'</td><td>';
print $form->selectarray("methode",$bon->methodes_trans);
print '</td></tr>';
print '<tr><td width="20%">'.$langs->trans("File").'</td><td>';
print '<input type="hidden" name="max_file_size" value="'.$conf->maxfilesize.'">';
print '<input class="flat" type="file" name="userfile"><br>';
print '</td></tr>';
print '</table><br>';
print '<center><input type="submit" class="button" value="'.$langs->trans("Send").'">';
print '</form>';
}
if($bon->date_trans <> 0 && $bon->date_credit == 0 && $user->rights->prelevement->bons->credit)
{
print '<form name="infocredit" method="post" action="fiche.php?id='.$bon->id.'">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<input type="hidden" name="action" value="infocredit">';
print '<table class="border" width="100%">';
print '<tr class="liste_titre">';
print '<td colspan="3">'.$langs->trans("NotifyCredit").'</td></tr>';
print '<tr><td width="20%">'.$langs->trans('CreditDate').'</td><td>';
print $form->select_date('','','','','',"infocredit");
print '</td></tr>';
print '</table><br>';
print '<center><input type="submit" class="button" value="'.$langs->trans("ClassCredited").'">';
print '</form>';
}
}
else
if($bon->date_credit <> 0)
{
dol_print_error($db);
print '<tr><td width="20%">'.$langs->trans('CreditDate').'</td><td>';
print dol_print_date($bon->date_credit,'day');
print '</td></tr>';
}
print '</table>';
print '<br>';
print '<table class="border" width="100%"><tr><td width="20%">';
print $langs->trans("WithdrawalFile").'</td><td>';
$relativepath = 'receipts/'.$bon->ref;
print '<a href="'.DOL_URL_ROOT.'/document.php?type=text/plain&amp;modulepart=prelevement&amp;file='.urlencode($relativepath).'">'.$relativepath.'</a>';
print '</td></tr></table>';
dol_fiche_end();
if (empty($bon->date_trans) && $user->rights->prelevement->bons->send && $action=='settransmitted')
{
print '<form method="post" name="userfile" action="fiche.php?id='.$bon->id.'" enctype="multipart/form-data">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<input type="hidden" name="action" value="infotrans">';
print '<table class="border" width="100%">';
print '<tr class="liste_titre">';
print '<td colspan="3">'.$langs->trans("NotifyTransmision").'</td></tr>';
print '<tr><td width="20%">'.$langs->trans("TransData").'</td><td>';
print $form->select_date('','','','','',"userfile",1,1);
print '</td></tr>';
print '<tr><td width="20%">'.$langs->trans("TransMetod").'</td><td>';
print $form->selectarray("methode",$bon->methodes_trans);
print '</td></tr>';
/* print '<tr><td width="20%">'.$langs->trans("File").'</td><td>';
print '<input type="hidden" name="max_file_size" value="'.$conf->maxfilesize.'">';
print '<input class="flat" type="file" name="userfile"><br>';
print '</td></tr>';*/
print '</table><br>';
print '<center><input type="submit" class="button" value="'.dol_escape_htmltag($langs->trans("SetToStatusSent")).'">';
print '</form>';
}
if (! empty($bon->date_trans) && $bon->date_credit == 0 && $user->rights->prelevement->bons->credit && $action=='setcredited')
{
print '<form name="infocredit" method="post" action="fiche.php?id='.$bon->id.'">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<input type="hidden" name="action" value="infocredit">';
print '<table class="border" width="100%">';
print '<tr class="liste_titre">';
print '<td colspan="3">'.$langs->trans("NotifyCredit").'</td></tr>';
print '<tr><td width="20%">'.$langs->trans('CreditDate').'</td><td>';
print $form->select_date('','','','','',"infocredit",1,1);
print '</td></tr>';
print '</table>';
print '<br>'.$langs->trans("ThisWillAlsoAddPaymentOnInvoice");
print '<center><input type="submit" class="button" value="'.dol_escape_htmltag($langs->trans("ClassCredited")).'">';
print '</form>';
}
// Actions
if ($action != 'settransmitted' && $action != 'setcredited')
{
print "\n<div class=\"tabsAction\">\n";
if (empty($bon->date_trans) && $user->rights->prelevement->bons->send)
{
print "<a class=\"butAction\" href=\"fiche.php?action=settransmitted&id=".$bon->id."\">".$langs->trans("SetToStatusSent")."</a>";
}
if (! empty($bon->date_trans) && $bon->date_credit == 0)
{
print "<a class=\"butAction\" href=\"fiche.php?action=setcredited&id=".$bon->id."\">".$langs->trans("ClassCredited")."</a>";
}
print "<a class=\"butActionDelete\" href=\"fiche.php?action=confirm_delete&id=".$bon->id."\">".$langs->trans("Delete")."</a>";
print "</div>";
}
}
/* ************************************************************************** */
/* */
/* Barre d'action */
/* */
/* ************************************************************************** */
/*
print "\n</div>\n<div class=\"tabsAction\">\n";
if ($bon->statut == 0)
{
print "<a class=\"butAction\" href=\"fiche.php?action=credite&amp;id=$bon->id\">".$langs->trans("ClassCredited")."</a>";
}
*/
print "</div>";
$db->close();
llxFooter();
$db->close();
?>

View File

@ -1,6 +1,6 @@
<?php
/* Copyright (C) 2004-2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2005-2011 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2012 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2009 Regis Houssin <regis@dolibarr.fr>
* Copyright (C) 2011 Juanjo Menent <jmenent@2byte.es>
*
@ -93,10 +93,10 @@ print '</td><td valign="top" width="70%">';
* Withdraw receipts
*/
$limit=5;
$sql = "SELECT p.rowid, p.ref, p.amount, p.datec";
$sql .= " ,p.statut ";
$sql .= " FROM ".MAIN_DB_PREFIX."prelevement_bons as p";
$sql .= " ORDER BY datec DESC LIMIT ".$limit;
$sql = "SELECT p.rowid, p.ref, p.amount, p.datec, p.statut";
$sql.= " FROM ".MAIN_DB_PREFIX."prelevement_bons as p";
$sql.= " ORDER BY datec DESC";
$sql.= $db->plimit($limit);
$result = $db->query($sql);
if ($result)
@ -110,6 +110,7 @@ if ($result)
print '<tr class="liste_titre"><td>'.$langs->trans("LastWithdrawalReceipt",$limit).'</td>';
print '<td>'.$langs->trans("Date").'</td>';
print '<td align="right">'.$langs->trans("Amount").'</td>';
print '<td align="right">'.$langs->trans("Status").'</td>';
print '</tr>';
while ($i < min($num,$limit))
@ -117,15 +118,17 @@ if ($result)
$obj = $db->fetch_object($result);
$var=!$var;
print "<tr $bc[$var]><td>";
print '<img border="0" src="./img/statut'.$obj->statut.'.png"></a>&nbsp;';
print '<a href="fiche.php?id='.$obj->rowid.'">'.$obj->ref."</a></td>\n";
print "<tr ".$bc[$var].">";
print "<td>";
$bprev->id=$obj->rowid;
$bprev->ref=$obj->ref;
$bprev->statut=$obj->statut;
print $bprev->getNomUrl(1);
print "</td>\n";
print '<td>'.dol_print_date($db->jdate($obj->datec),"dayhour")."</td>\n";
print '<td align="right">'.price($obj->amount)."</td>\n";
print '<td align="right">'.$bprev->getLibStatut(3)."</td>\n";
print "</tr>\n";
$i++;

View File

@ -65,13 +65,6 @@ if ($prev_id)
print '<tr><td width="20%">'.$langs->trans("Ref").'</td><td>'.$bon->getNomUrl(1).'</td></tr>';
print '<tr><td width="20%">'.$langs->trans("Date").'</td><td>'.dol_print_date($bon->datec,'day').'</td></tr>';
print '<tr><td width="20%">'.$langs->trans("Amount").'</td><td>'.price($bon->amount).'</td></tr>';
print '<tr><td width="20%">'.$langs->trans("File").'</td><td>';
$relativepath = 'receipts/'.$bon->ref;
print '<a href="'.DOL_URL_ROOT.'/document.php?type=text/plain&amp;modulepart=prelevement&amp;file='.urlencode($relativepath).'">'.$relativepath.'</a>';
print '</td></tr>';
// Status
print '<tr><td width="20%">'.$langs->trans('Status').'</td>';
@ -99,7 +92,16 @@ if ($prev_id)
print '</table>';
print '</div>';
print '<br>';
print '<table class="border" width="100%"><tr><td width="20%">';
print $langs->trans("WithdrawalFile").'</td><td>';
$relativepath = 'receipts/'.$bon->ref;
print '<a href="'.DOL_URL_ROOT.'/document.php?type=text/plain&amp;modulepart=prelevement&amp;file='.urlencode($relativepath).'">'.$relativepath.'</a>';
print '</td></tr></table>';
dol_fiche_end();
}
else
{

View File

@ -136,9 +136,9 @@ class Contact extends CommonObject
$sql.= "'".$this->db->escape($this->firstname)."',";
$sql.= " ".($user->id > 0 ? "'".$user->id."'":"null").",";
$sql.= " ".$this->priv.",";
$sql.= " ".($this->canvas?"'".$this->canvas."'":"null").",";
$sql.= " ".(! empty($this->canvas)?"'".$this->canvas."'":"null").",";
$sql.= " ".$conf->entity.",";
$sql.= " ".$this->import_key;
$sql.= " ".(! empty($this->import_key)?"'".$this->import_key."'":"null");
$sql.= ")";
dol_syslog(get_class($this)."::create sql=".$sql);

View File

@ -361,7 +361,7 @@ else
$object->state_id = $_POST["state_id"];
// 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"]:(empty($objsoc->country_id)?$mysoc->country_id:$objsoc->country_id);
if ($object->country_id)
{
$tmparray=getCountry($object->country_id,'all');
@ -434,7 +434,7 @@ else
$colspan=3;
if ($conf->use_javascript_ajax && $socid > 0) $colspan=2;
// Address
if (($objsoc->typent_code == 'TE_PRIVATE' || ! empty($conf->global->CONTACT_USE_COMPANY_ADDRESS)) && dol_strlen(trim($object->address)) == 0) $object->address = $objsoc->address; // Predefined with third party
print '<tr><td>'.$langs->trans("Address");
@ -442,9 +442,9 @@ else
if ($conf->use_javascript_ajax && $socid > 0)
{
$rowspan=3;
$rowspan=3;
if (empty($conf->global->SOCIETE_DISABLE_STATE)) $rowspan++;
print '<td valign="middle" align="center" rowspan="'.$rowspan.'">';
print '<a href="#" id="copyaddressfromsoc">'.$langs->trans('CopyAddressFromSoc').'</a>';
print '</td>';
@ -460,7 +460,6 @@ else
print '</td></tr>';
// Country
if (dol_strlen(trim($object->fk_pays)) == 0) $object->fk_pays = $objsoc->country_id; // Predefined with third party
print '<tr><td>'.$langs->trans("Country").'</td><td colspan="'.$colspan.'">';
print $form->select_country((isset($_POST["country_id"])?$_POST["country_id"]:$object->country_id),'country_id');
if ($user->admin) print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionnarySetup"),1);

View File

@ -221,14 +221,16 @@ abstract class CommonObject
* @param int $rowid Id of line contact-element
* @param int $statut New status of link
* @param int $type_contact_id Id of contact type (not modified if 0)
* @param int $fk_socpeople Id of soc_people to update (not modified if 0)
* @return int <0 if KO, >= 0 if OK
*/
function update_contact($rowid, $statut, $type_contact_id=0)
function update_contact($rowid, $statut, $type_contact_id=0, $fk_socpeople=0)
{
// Insertion dans la base
$sql = "UPDATE ".MAIN_DB_PREFIX."element_contact set";
$sql.= " statut = ".$statut;
if ($type_contact_id) $sql.= ", fk_c_type_contact = '".$type_contact_id ."'";
if ($fk_socpeople) $sql.= ", fk_socpeople = '".$fk_socpeople ."'";
$sql.= " where rowid = ".$rowid;
$resql=$this->db->query($sql);
if ($resql)

View File

@ -60,6 +60,7 @@ class Conf
public $societe_modules = array();
var $logbuffer = array();
var $loghandlers = array();
//! To store properties of multi-company
public $multicompany;
@ -456,6 +457,27 @@ class Conf
{
if (is_object($mc)) $mc->setValues($this);
}
// We init log handlers
if (defined('SYSLOG_HANDLERS')) $handlers = json_decode(constant('SYSLOG_HANDLERS'));
else $handlers = array();
foreach ($handlers as $handler)
{
$file = DOL_DOCUMENT_ROOT.'/core/modules/syslog/'.$handler.'.php';
if (!file_exists($file))
{
throw new Exception('Missing log handler file '.$handler.'.php');
}
require_once $file;
$loghandlerinstance = new $handler();
if (!$loghandlerinstance instanceof LogHandlerInterface)
{
throw new Exception('Log handler does not extend LogHandlerInterface');
}
$this->loghandlers[]=$loghandlerinstance;
}
}
}

View File

@ -42,7 +42,7 @@ class ExtraFields
var $attribute_unique;
// Array to store if attribute is required or not
var $attribute_required;
var $error;
var $errno;
@ -439,6 +439,10 @@ class ExtraFields
$array_name_label=array();
// For avoid conflicts with external modules
if (! empty($conf->global->MAIN_EXTRAFIELDS_DISABLED))
return $array_name_label;
$sql = "SELECT rowid,name,label,type,size,elementtype,fieldunique,fieldrequired";
$sql.= " FROM ".MAIN_DB_PREFIX."extrafields";
$sql.= " WHERE entity = ".$conf->entity;

View File

@ -170,7 +170,7 @@ class HookManager
if (! empty($actionclassinstance->resprints)) $this->resPrint.=$actionclassinstance->resprints;
// TODO. remove this. array result must be set into $actionclassinstance->results
if (is_array($result)) $this->resArray = array_merge($this->resArray, $result);
if (is_array($result)) $this->resArray = array_merge($this->resArray, $result);
// TODO. remove this. result must not be a string. we must use $actionclassinstance->resprint to return a string
if (! is_array($result) && ! is_numeric($result)) $this->resPrint.=$result;
}

View File

@ -165,6 +165,10 @@ class Form
{
$ret.=$this->form_date($_SERVER['PHP_SELF'].'?id='.$object->id,$value,$htmlname);
}
else if ($typeofdata == 'datehourpicker')
{
$ret.=$this->form_date($_SERVER['PHP_SELF'].'?id='.$object->id,$value,$htmlname,1,1);
}
else if (preg_match('/^select;/',$typeofdata))
{
$arraydata=explode(',',preg_replace('/^select;/','',$typeofdata));
@ -183,7 +187,7 @@ class Form
$ret.=$doleditor->Create(1);
}
$ret.='</td>';
if ($typeofdata != 'day' && $typeofdata != 'datepicker') $ret.='<td align="left"><input type="submit" class="button" value="'.$langs->trans("Modify").'"></td>';
if ($typeofdata != 'day' && $typeofdata != 'datepicker' && $typeofdata != 'datehourpicker') $ret.='<td align="left"><input type="submit" class="button" value="'.$langs->trans("Modify").'"></td>';
$ret.='</tr></table>'."\n";
$ret.='</form>'."\n";
}
@ -192,6 +196,7 @@ class Form
if ($typeofdata == 'email') $ret.=dol_print_email($value,0,0,0,0,1);
elseif (preg_match('/^text/',$typeofdata) || preg_match('/^note/',$typeofdata)) $ret.=dol_htmlentitiesbr($value);
elseif ($typeofdata == 'day' || $typeofdata == 'datepicker') $ret.=dol_print_date($value,'day');
elseif ($typeofdata == 'datehourpicker') $ret.=dol_print_date($value,'dayhour');
else if (preg_match('/^select;/',$typeofdata))
{
$arraydata=explode(',',preg_replace('/^select;/','',$typeofdata));
@ -272,7 +277,7 @@ class Form
if (! empty($tmp[1])) $inputOption=$tmp[1];
if (! empty($tmp[2])) $savemethod=$tmp[2];
}
else if (preg_match('/^datepicker/',$inputType))
else if ((preg_match('/^datepicker/',$inputType)) || (preg_match('/^datehourpicker/',$inputType)))
{
$tmp=explode(':',$inputType);
$inputType=$tmp[0];
@ -2327,7 +2332,7 @@ class Form
$inputko=array();
// Clean parameters
$newselectedchoice=empty($selectedchoice)?"no":$selectedchoice;
$newselectedchoice=empty($selectedchoice)?"no":$selectedchoice;
if (is_array($formquestion) && ! empty($formquestion))
{
@ -2707,9 +2712,11 @@ class Form
* @param string $page Page
* @param string $selected Date preselected
* @param string $htmlname Name of input html field
* @param int $displayhour Display hour selector
* @param int $displaymin Display minutes selector
* @return void
*/
function form_date($page, $selected, $htmlname)
function form_date($page, $selected, $htmlname,$displayhour=0,$displaymin=0)
{
global $langs;
@ -2720,7 +2727,7 @@ class Form
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<table class="nobordernopadding" cellpadding="0" cellspacing="0">';
print '<tr><td>';
print $this->select_date($selected,$htmlname,0,0,1,'form'.$htmlname);
print $this->select_date($selected,$htmlname,$displayhour,$displaymin,1,'form'.$htmlname);
print '</td>';
print '<td align="left"><input type="submit" class="button" value="'.$langs->trans("Modify").'"></td>';
print '</tr></table></form>';

View File

@ -144,10 +144,10 @@ class FormActions
require_once DOL_DOCUMENT_ROOT.'/comm/action/class/actioncomm.class.php';
$actioncomm = new ActionComm($this->db);
$actioncomm->getActions($socid, $object->id, $typeelement);
$listofactions=ActionComm::getActions($this->db, $socid, $object->id, $typeelement);
if (is_numeric($listofactions) && $listofactions < 0) dol_print_error($this->db,'FailedToGetActions');
$num = count($actioncomm->actions);
$num = count($listofactions);
if ($num)
{
if ($typeelement == 'invoice') $title=$langs->trans('ActionsOnBill');
@ -164,17 +164,29 @@ class FormActions
$total = 0; $var=true;
print '<table class="noborder" width="100%">';
print '<tr class="liste_titre"><th class="liste_titre">'.$langs->trans('Ref').'</th><th class="liste_titre">'.$langs->trans('Date').'</th><th class="liste_titre">'.$langs->trans('Action').'</th><th class="liste_titre">'.$langs->trans('By').'</th></tr>';
print '<tr class="liste_titre">';
print '<th class="liste_titre">'.$langs->trans('Ref').'</th>';
print '<th class="liste_titre">'.$langs->trans('Action').'</th>';
print '<th class="liste_titre">'.$langs->trans('Date').'</th>';
print '<th class="liste_titre">'.$langs->trans('By').'</th>';
print '</tr>';
print "\n";
foreach($actioncomm->actions as $action)
$userstatic = new User($this->db);
foreach($listofactions as $action)
{
$savlabel=$action->label;
$action->label=$action->ref;
$ref=$action->getNomUrl(1);
$action->label=$savlabel;
$label=$action->getNomUrl(0,38);
$var=!$var;
print '<tr '.$bc[$var].'>';
print '<td>'.$action->getNomUrl(1).'</td>';
print '<td>'.$ref.'</td>';
print '<td>'.$label.'</td>';
print '<td>'.dol_print_date($action->datep,'day').'</td>';
print '<td title="'.dol_escape_htmltag($action->label).'">'.dol_trunc($action->label,32).'</td>';
$userstatic = new User($this->db);
$userstatic->id = $action->author->id;
$userstatic->firstname = $action->author->firstname;
$userstatic->lastname = $action->author->lastname;
@ -194,9 +206,10 @@ class FormActions
* @param string $selected Type pre-selectionne
* @param string $htmlname Nom champ formulaire
* @param string $excludetype Type to exclude
* @param string $onlyautoornot Group list by auto events or not
* @return void
*/
function select_type_actions($selected='',$htmlname='actioncode',$excludetype='')
function select_type_actions($selected='',$htmlname='actioncode',$excludetype='',$onlyautoornot=0)
{
global $langs,$user;
@ -205,12 +218,13 @@ class FormActions
$caction=new CActionComm($this->db);
$form=new Form($this->db);
$arraylist=$caction->liste_array(1, 'code', $excludetype);
array_unshift($arraylist,'&nbsp;'); // Add empty line at start
//asort($arraylist);
// Suggest a list with manual event or all auto events
$arraylist=$caction->liste_array(1, 'code', $excludetype, $onlyautoornot);
array_unshift($arraylist,'&nbsp;'); // Add empty line at start
//asort($arraylist);
print $form->selectarray($htmlname, $arraylist, $selected);
if ($user->admin) print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionnarySetup"),1);
if ($user->admin && empty($onlyautoornot)) print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionnarySetup"),1);
}
}

View File

@ -143,6 +143,9 @@ class Translate
* If data for file already loaded, do nothing.
* All data in translation array are stored in UTF-8 format.
* tab_loaded is completed with $domain key.
* Warning: MAIN_USE_CUSTOM_TRANSLATION is an old deprecated feature. Do not use it. It will revert
* rule "we keep first entry found with we keep last entry found" so it is probably not what you want to do.
*
* Value for hash are: 1:Loaded from disk, 2:Not found, 3:Loaded from cache
*
* @param string $domain File name to load (.lang file). Must be "file" or "file@module" for module language files:
@ -198,13 +201,14 @@ class Translate
// Directory of translation files
$file_lang = $searchdir.($modulename?'/'.$modulename:'')."/langs/".$langofdir."/".$newdomain.".lang";
$file_lang_osencoded=dol_osencode($file_lang);
$filelangexists=is_file($file_lang_osencoded);
//dol_syslog('Translate::Load Try to read for alt='.$alt.' langofdir='.$langofdir.' file_lang='.$file_lang." => filelangexists=".$filelangexists);
if ($filelangexists)
{
// TODO Move cache read out of loop on dirs
// TODO Move cache read out of loop on dirs or at least filelangexists
$found=false;
// Enable caching of lang file in memory (not by default)

View File

@ -26,8 +26,7 @@
/**
* \class DoliDBMysql
* \brief Class to manage Dolibarr database access for a Mysql database
* Class to manage Dolibarr database access for a Mysql database
*/
class DoliDBMysql
{
@ -291,12 +290,14 @@ class DoliDBMysql
{
$this->transaction_opened++;
dol_syslog("BEGIN Transaction",LOG_DEBUG);
dol_syslog('',0,1);
}
return $ret;
}
else
{
$this->transaction_opened++;
dol_syslog('',0,1);
return 1;
}
}
@ -309,6 +310,7 @@ class DoliDBMysql
*/
function commit($log='')
{
dol_syslog('',0,-1);
if ($this->transaction_opened<=1)
{
$ret=$this->query("COMMIT");
@ -334,6 +336,7 @@ class DoliDBMysql
*/
function rollback($log='')
{
dol_syslog('',0,-1);
if ($this->transaction_opened<=1)
{
$ret=$this->query("ROLLBACK");

View File

@ -26,8 +26,7 @@
/**
* \class DoliDBMysqli
* \brief Class to manage Dolibarr database access for a Mysql database
* Class to manage Dolibarr database access for a Mysql database
*/
class DoliDBMysqli
{
@ -286,12 +285,14 @@ class DoliDBMysqli
{
$this->transaction_opened++;
dol_syslog("BEGIN Transaction",LOG_DEBUG);
dol_syslog('',0,1);
}
return $ret;
}
else
{
$this->transaction_opened++;
dol_syslog('',0,1);
return 1;
}
}
@ -304,7 +305,8 @@ class DoliDBMysqli
*/
function commit($log='')
{
if ($this->transaction_opened<=1)
dol_syslog('',0,-1);
if ($this->transaction_opened<=1)
{
$ret=$this->query("COMMIT");
if ($ret)
@ -329,7 +331,8 @@ class DoliDBMysqli
*/
function rollback($log='')
{
if ($this->transaction_opened<=1)
dol_syslog('',0,-1);
if ($this->transaction_opened<=1)
{
$ret=$this->query("ROLLBACK");
$this->transaction_opened=0;

View File

@ -474,12 +474,14 @@ class DoliDBPgsql
{
$this->transaction_opened++;
dol_syslog("BEGIN Transaction",LOG_DEBUG);
dol_syslog('',0,1);
}
return $ret;
}
else
{
$this->transaction_opened++;
dol_syslog('',0,1);
return 1;
}
}
@ -492,6 +494,7 @@ class DoliDBPgsql
*/
function commit($log='')
{
dol_syslog('',0,-1);
if ($this->transaction_opened<=1)
{
$ret=$this->query("COMMIT;");
@ -516,6 +519,7 @@ class DoliDBPgsql
*/
function rollback()
{
dol_syslog('',0,-1);
if ($this->transaction_opened<=1)
{
$ret=$this->query("ROLLBACK;");

View File

@ -416,12 +416,14 @@ class DoliDBSqlite
{
$this->transaction_opened++;
dol_syslog("BEGIN Transaction",LOG_DEBUG);
dol_syslog('',0,1);
}
return $ret;
}
else
{
$this->transaction_opened++;
dol_syslog('',0,1);
return 1;
}
}
@ -434,7 +436,8 @@ class DoliDBSqlite
*/
function commit($log='')
{
if ($this->transaction_opened<=1)
dol_syslog('',0,-1);
if ($this->transaction_opened<=1)
{
$ret=$this->query("COMMIT");
if ($ret)
@ -445,8 +448,8 @@ class DoliDBSqlite
return $ret;
}
else
{
$this->transaction_opened--;
{
$this->transaction_opened--;
return 1;
}
}
@ -459,7 +462,8 @@ class DoliDBSqlite
*/
function rollback($log='')
{
if ($this->transaction_opened<=1)
dol_syslog('',0,-1);
if ($this->transaction_opened<=1)
{
$ret=$this->query("ROLLBACK");
$this->transaction_opened=0;

View File

@ -729,6 +729,7 @@ function confirmConstantAction(action, url, code, input, box, entity, yesButton,
modal: true,
buttons: [
{
id : 'yesButton_' + code,
text : yesButton,
click : function() {
if (action == "set") {
@ -748,6 +749,7 @@ function confirmConstantAction(action, url, code, input, box, entity, yesButton,
}
},
{
id : 'noButton_' + code,
text : noButton,
click : function() {
$(this).dialog("close");
@ -755,6 +757,10 @@ function confirmConstantAction(action, url, code, input, box, entity, yesButton,
}
]
});
// For information dialog box only, hide the noButton
if (boxConfirm.info) {
$("#noButton_" + code).button().hide();
}
}
/*

View File

@ -93,7 +93,10 @@ function print_actions_filter($form,$canedit,$status,$year,$month,$day,$showbirt
print '<td nowrap="nowrap">';
print $langs->trans("Type");
print ' &nbsp;</td><td nowrap="nowrap">';
print $formactions->select_type_actions(GETPOST('actioncode'), "actioncode");
// print $formactions->select_type_actions(GETPOST('actioncode'), "actioncode");
print $formactions->select_type_actions(GETPOST('actioncode')?GETPOST('actioncode'):'manual', "actioncode", '', (empty($conf->global->AGENDA_USE_EVENT_TYPE)?1:0));
print '</td></tr>';
}
@ -403,6 +406,14 @@ function actions_prepare_head($object)
$head[$h][2] = 'card';
$h++;
if (! empty($conf->global->AGENDA_USE_SEVERAL_CONTACTS))
{
$head[$h][0] = DOL_URL_ROOT.'/comm/action/contact.php?id='.$object->id;
$head[$h][1] = $langs->trans("Contacts");
$head[$h][2] = 'contact';
$h++;
}
$head[$h][0] = DOL_URL_ROOT.'/comm/action/document.php?id='.$object->id;
$head[$h][1] = $langs->trans('Documents');
$head[$h][2] = 'documents';
@ -440,9 +451,11 @@ function calendars_prepare_head($param)
// Show more tabs from modules
// Entries must be declared in modules descriptor with line
// $this->tabs = array('entity:+tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to add new tab
// $this->tabs = array('entity:-tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to remove a tab
// $this->tabs = array('entity:-tabname); to remove a tab
complete_head_from_modules($conf,$langs,$object,$head,$h,'agenda');
complete_head_from_modules($conf,$langs,$object,$head,$h,'agenda','remove');
return $head;
}

View File

@ -375,6 +375,11 @@ function ajax_constantonoff($code, $input=array(), $entity=false)
// Set constant
$("#set_" + code).click(function() {
if (input.alert && input.alert.set) {
// Posibility to force label of buttons
if (input.alert.set.yesButton)
yesButton = input.alert.set.yesButton;
if (input.alert.set.noButton)
noButton = input.alert.set.noButton;
confirmConstantAction("set", url, code, input, input.alert.set, entity, yesButton, noButton);
} else {
setConstant(url, code, input, entity);
@ -384,6 +389,11 @@ function ajax_constantonoff($code, $input=array(), $entity=false)
// Del constant
$("#del_" + code).click(function() {
if (input.alert && input.alert.del) {
// Posibility to force label of buttons
if (input.alert.del.yesButton)
yesButton = input.alert.del.yesButton;
if (input.alert.del.noButton)
noButton = input.alert.del.noButton;
confirmConstantAction("del", url, code, input, input.alert.del, entity, yesButton, noButton);
} else {
delConstant(url, code, input, entity);

View File

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

View File

@ -777,7 +777,7 @@ function show_actions_todo($conf,$langs,$db,$object,$objcon='',$noprint=0)
if (get_class($object) == 'Adherent') $sql.= ", ".MAIN_DB_PREFIX."adherent as m";
if (get_class($object) == 'Societe') $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."socpeople as sp ON a.fk_contact = sp.rowid";
$sql.= " WHERE u.rowid = a.fk_user_author";
$sql.= " AND a.entity IN (".getEntity('actioncomm').")";
$sql.= " AND a.entity IN (".getEntity('agenda', 1).")";
if (get_class($object) == 'Adherent') {
$sql.= " AND a.fk_element = m.rowid AND a.elementtype = 'member'";
if (! empty($object->id))
@ -916,7 +916,7 @@ function show_actions_done($conf,$langs,$db,$object,$objcon='',$noprint=0)
if (get_class($object) == 'Adherent') $sql.= ", ".MAIN_DB_PREFIX."adherent as m";
if (get_class($object) == 'Societe') $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."socpeople as sp ON a.fk_contact = sp.rowid";
$sql.= " WHERE u.rowid = a.fk_user_author";
$sql.= " AND a.entity IN (".getEntity('actioncomm').")";
$sql.= " AND a.entity IN (".getEntity('agenda', 1).")";
if (get_class($object) == 'Adherent') $sql.= " AND a.fk_element = m.rowid AND a.elementtype = 'member'";
if (get_class($object) == 'Adherent' && $object->id) $sql.= " AND a.fk_element = ".$object->id;
if (get_class($object) == 'Societe' && $object->id) $sql.= " AND a.fk_soc = ".$object->id;

View File

@ -63,7 +63,7 @@ function contact_prepare_head($object)
// Show more tabs from modules
// Entries must be declared in modules descriptor with line
// $this->tabs = array('entity:+tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to add new tab
// $this->tabs = array('entity:-tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to remove a tab
// $this->tabs = array('entity:-tabname); to remove a tab
complete_head_from_modules($conf,$langs,$object,$head,$h,'contact');
$head[$h][0] = DOL_URL_ROOT.'/contact/info.php?id='.$object->id;
@ -71,7 +71,7 @@ function contact_prepare_head($object)
$head[$h][2] = 'info';
$h++;
complete_head_from_modules($conf,$langs,$object,$head,$h,'contact','remove');
return $head;
}

View File

@ -38,7 +38,7 @@ function contract_prepare_head($object)
$head[$h][1] = $langs->trans("ContractCard");
$head[$h][2] = 'card';
$h++;
if (empty($conf->global->MAIN_DISABLE_CONTACTS_TAB))
{
$head[$h][0] = DOL_URL_ROOT.'/contrat/contact.php?id='.$object->id;
@ -50,9 +50,9 @@ function contract_prepare_head($object)
// Show more tabs from modules
// Entries must be declared in modules descriptor with line
// $this->tabs = array('entity:+tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to add new tab
// $this->tabs = array('entity:-tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to remove a tab
// $this->tabs = array('entity:-tabname); to remove a tab
complete_head_from_modules($conf,$langs,$object,$head,$h,'contract');
if (empty($conf->global->MAIN_DISABLE_NOTES_TAB))
{
$head[$h][0] = DOL_URL_ROOT.'/contrat/note.php?id='.$object->id;
@ -71,6 +71,8 @@ function contract_prepare_head($object)
$head[$h][2] = 'info';
$h++;
complete_head_from_modules($conf,$langs,$object,$head,$h,'contract','remove');
return $head;
}

View File

@ -42,7 +42,7 @@ function fichinter_prepare_head($object)
$head[$h][1] = $langs->trans("Card");
$head[$h][2] = 'card';
$h++;
if (empty($conf->global->MAIN_DISABLE_CONTACTS_TAB))
{
$head[$h][0] = DOL_URL_ROOT.'/fichinter/contact.php?id='.$object->id;
@ -62,9 +62,9 @@ function fichinter_prepare_head($object)
// Show more tabs from modules
// Entries must be declared in modules descriptor with line
// $this->tabs = array('entity:+tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to add new tab
// $this->tabs = array('entity:-tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to remove a tab
// $this->tabs = array('entity:-tabname); to remove a tab
complete_head_from_modules($conf,$langs,$object,$head,$h,'intervention');
if (empty($conf->global->MAIN_DISABLE_NOTES_TAB))
{
$head[$h][0] = DOL_URL_ROOT.'/fichinter/note.php?id='.$object->id;
@ -83,7 +83,9 @@ function fichinter_prepare_head($object)
$head[$h][2] = 'info';
$h++;
return $head;
complete_head_from_modules($conf,$langs,$object,$head,$h,'intervention','remove');
return $head;
}
?>

View File

@ -52,7 +52,7 @@ function facturefourn_prepare_head($object)
// Show more tabs from modules
// Entries must be declared in modules descriptor with line
// $this->tabs = array('entity:+tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to add new tab
// $this->tabs = array('entity:-tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to remove a tab
// $this->tabs = array('entity:-tabname); to remove a tab
complete_head_from_modules($conf,$langs,$object,$head,$h,'supplier_invoice');
if (empty($conf->global->MAIN_DISABLE_NOTES_TAB))
@ -77,7 +77,9 @@ function facturefourn_prepare_head($object)
$head[$h][2] = 'info';
$h++;
return $head;
complete_head_from_modules($conf,$langs,$object,$head,$h,'supplier_invoice','remove');
return $head;
}

View File

@ -232,10 +232,11 @@ function dol_getprefix()
function dol_include_once($relpath, $classname='')
{
global $conf,$langs,$user,$mysoc; // Other global var must be retreived with $GLOBALS['var']
if (! empty($classname) && ! class_exists($classname)) {
return @include dol_buildpath($relpath);
return @include dol_buildpath($relpath); // Remove @ to find error into php log file if you have problems
} else {
return @include_once dol_buildpath($relpath);
return @include_once dol_buildpath($relpath); // Remove @ to find error into php log file if you have problems
}
}
@ -483,90 +484,73 @@ function dol_strtoupper($utf8_string)
*
* @param string $message Line to log. Ne doit pas etre traduit si level = LOG_ERR
* @param int $level Log level
* 0=Show nothing
* On Windows LOG_ERR=4, LOG_WARNING=5, LOG_NOTICE=LOG_INFO=6, LOG_DEBUG=6 si define_syslog_variables ou PHP 5.3+, 7 si dolibarr
* On Linux LOG_ERR=3, LOG_WARNING=4, LOG_INFO=6, LOG_DEBUG=7
* @param int $ident 1=Increase ident of 1, -1=Decrease ident of 1
* @return void
*/
function dol_syslog($message, $level = LOG_INFO)
function dol_syslog($message, $level = LOG_INFO, $ident = 0)
{
global $conf, $user, $langs;
global $conf, $user;
// If syslog module enabled
if (empty($conf->syslog->enabled)) return false;
if (!defined('SYSLOG_HANDLERS') || !constant('SYSLOG_HANDLERS')) return false;
$logLevels = array(
LOG_EMERG,
LOG_ALERT,
LOG_CRIT,
LOG_ERR,
LOG_WARNING,
LOG_NOTICE,
LOG_INFO,
LOG_DEBUG
);
if (!in_array($level, $logLevels))
if (! empty($level))
{
throw new Exception('Incorrect log level');
}
if ($level > $conf->global->SYSLOG_LEVEL) return false;
// If adding log inside HTML page is required
if (! empty($_REQUEST['logtohtml']) && ! empty($conf->global->MAIN_LOGTOHTML))
{
$conf->logbuffer[] = dol_print_date(time(),"%Y-%m-%d %H:%M:%S")." ".$message;
}
// If enable html log tag enabled and url parameter log defined, we show output log on HTML comments
if (! empty($conf->global->MAIN_ENABLE_LOG_HTML) && ! empty($_GET["log"]))
{
print "\n\n<!-- Log start\n";
print $message."\n";
print "Log end -->\n";
}
$data = array(
'message' => $message,
'script' => (isset($_SERVER['PHP_SELF'])? basename($_SERVER['PHP_SELF'],'.php') : false),
'level' => $level,
'user' => ((is_object($user) && $user->id) ? $user->login : false),
'ip' => false
);
if (! empty($_SERVER["REMOTE_ADDR"])) $data['ip'] = $_SERVER['REMOTE_ADDR'];
// This is when PHP session is ran inside a web server but not inside a client request (example: init code of apache)
else if (! empty($_SERVER['SERVER_ADDR'])) $data['ip'] = $_SERVER['SERVER_ADDR'];
// This is when PHP session is ran outside a web server, like from Windows command line (Not always defined, but useful if OS defined it).
else if (! empty($_SERVER['COMPUTERNAME'])) $data['ip'] = $_SERVER['COMPUTERNAME'].(empty($_SERVER['USERNAME'])?'':'@'.$_SERVER['USERNAME']);
// This is when PHP session is ran outside a web server, like from Linux command line (Not always defined, but usefull if OS defined it).
else if (! empty($_SERVER['LOGNAME'])) $data['ip'] = '???@'.$_SERVER['LOGNAME'];
//We load SYSLOG handlers
if (defined('SYSLOG_HANDLERS')) $handlers = json_decode(SYSLOG_HANDLERS);
else $handlers = array();
foreach ($handlers as $handler)
{
$file = DOL_DOCUMENT_ROOT.'/core/modules/syslog/'.$handler.'.php';
if (!file_exists($file))
// Test log level
$logLevels = array( LOG_EMERG, LOG_ALERT, LOG_CRIT, LOG_ERR, LOG_WARNING, LOG_NOTICE, LOG_INFO, LOG_DEBUG);
if (!in_array($level, $logLevels))
{
throw new Exception('Missing log handler');
throw new Exception('Incorrect log level');
}
if ($level > $conf->global->SYSLOG_LEVEL) return false;
// If adding log inside HTML page is required
if (! empty($_REQUEST['logtohtml']) && ! empty($conf->global->MAIN_LOGTOHTML))
{
$conf->logbuffer[] = dol_print_date(time(),"%Y-%m-%d %H:%M:%S")." ".$message;
}
require_once $file;
$class = new $handler();
if (!$class instanceof LogHandlerInterface)
// If enable html log tag enabled and url parameter log defined, we show output log on HTML comments
if (! empty($conf->global->MAIN_ENABLE_LOG_HTML) && ! empty($_GET["log"]))
{
throw new Exception('Log handler does not extend LogHandlerInterface');
print "\n\n<!-- Log start\n";
print $message."\n";
print "Log end -->\n";
}
$class->export($data);
$data = array(
'message' => $message,
'script' => (isset($_SERVER['PHP_SELF'])? basename($_SERVER['PHP_SELF'],'.php') : false),
'level' => $level,
'user' => ((is_object($user) && $user->id) ? $user->login : false),
'ip' => false
);
if (! empty($_SERVER["REMOTE_ADDR"])) $data['ip'] = $_SERVER['REMOTE_ADDR'];
// This is when PHP session is ran inside a web server but not inside a client request (example: init code of apache)
else if (! empty($_SERVER['SERVER_ADDR'])) $data['ip'] = $_SERVER['SERVER_ADDR'];
// This is when PHP session is ran outside a web server, like from Windows command line (Not always defined, but useful if OS defined it).
else if (! empty($_SERVER['COMPUTERNAME'])) $data['ip'] = $_SERVER['COMPUTERNAME'].(empty($_SERVER['USERNAME'])?'':'@'.$_SERVER['USERNAME']);
// This is when PHP session is ran outside a web server, like from Linux command line (Not always defined, but usefull if OS defined it).
else if (! empty($_SERVER['LOGNAME'])) $data['ip'] = '???@'.$_SERVER['LOGNAME'];
// Loop on each log handler and send output
foreach ($conf->loghandlers as $loghandlerinstance)
{
$loghandlerinstance->export($data);
}
unset($data);
}
if (! empty($ident))
{
foreach ($conf->loghandlers as $loghandlerinstance)
{
$loghandlerinstance->setIdent($ident);
}
}
}
@ -2192,7 +2176,7 @@ function dol_print_error($db='',$error='')
/**
* Show a public email and error code to contact if technical error
*
* @param string $prefixcode Prefix of public error code
* @param string $prefixcode Prefix of public error code
* @return void
*/
function dol_print_error_email($prefixcode)
@ -2703,11 +2687,10 @@ function get_localtax($tva, $local, $thirdparty_buyer="", $thirdparty_seller="")
// Some test to guess with no need to make database access
if ($mysoc->country_code == 'ES') // For spain, localtaxes are qualified if both supplier and seller use local taxe
{
if ($local == 1 && (! $thirdparty_seller->localtax1_assuj || ! $thirdparty_buyer->localtax1_assuj)) return 0;
if ($local == 2 && (! $thirdparty_seller->localtax2_assuj || ! $thirdparty_buyer->localtax2_assuj)) return 0;
if ($local == 1 && ! $thirdparty_buyer->localtax1_assuj) return 0;
if ($local == 2 && ! $thirdparty_seller->localtax2_assuj) return 0;
}
else
else
{
if ($local == 1 && ! $thirdparty_seller->localtax1_assuj) return 0;
if ($local == 2 && ! $thirdparty_seller->localtax2_assuj) return 0;
@ -2994,18 +2977,27 @@ function get_default_npr($thirdparty_seller, $thirdparty_buyer, $idprod)
*/
function get_default_localtax($thirdparty_seller, $thirdparty_buyer, $local, $idprod=0)
{
global $mysoc;
if (!is_object($thirdparty_seller)) return -1;
if (!is_object($thirdparty_buyer)) return -1;
if ($local==1) //RE
if ($local==1) // Localtax 1
{
// Si vendeur non assujeti a RE, localtax1 par default=0
if (is_numeric($thirdparty_seller->localtax1_assuj) && ! $thirdparty_seller->localtax1_assuj) return 0;
if (! is_numeric($thirdparty_seller->localtax1_assuj) && $thirdparty_seller->localtax1_assuj=='localtax1off') return 0;
if ($mysoc->country_code == 'ES')
{
if (is_numeric($thirdparty_buyer->localtax1_assuj) && ! $thirdparty_buyer->localtax1_assuj) return 0;
}
else
{
// Si vendeur non assujeti a Localtax1, localtax1 par default=0
if (is_numeric($thirdparty_seller->localtax1_assuj) && ! $thirdparty_seller->localtax1_assuj) return 0;
if (! is_numeric($thirdparty_seller->localtax1_assuj) && $thirdparty_seller->localtax1_assuj=='localtax1off') return 0;
}
}
elseif ($local==2) //IRPF
elseif ($local==2) //I Localtax 2
{
// Si vendeur non assujeti a IRPF, localtax2 par default=0
// Si vendeur non assujeti a Localtax2, localtax2 par default=0
if (is_numeric($thirdparty_seller->localtax2_assuj) && ! $thirdparty_seller->localtax2_assuj) return 0;
if (! is_numeric($thirdparty_seller->localtax2_assuj) && $thirdparty_seller->localtax2_assuj=='localtax2off') return 0;
}

View File

@ -0,0 +1,53 @@
<?php
/* Copyright (C) 2006-2011 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 htdocs/core/lib/holiday.lib.php
* \brief Ensemble de fonctions de base pour les adherents
*/
/**
* Return array head with list of tabs to view object informations
*
* @param Object $object Holiday
* @return array head
*/
function holiday_prepare_head($object)
{
global $langs, $conf, $user;
$h = 0;
$head = array();
$head[$h][0] = DOL_URL_ROOT . '/holiday/fiche.php?id='.$object->id;
$head[$h][1] = $langs->trans("Card");
$head[$h][2] = 'card';
$h++;
// Show more tabs from modules
// Entries must be declared in modules descriptor with line
// $this->tabs = array('entity:+tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to add new tab
// $this->tabs = array('entity:-tabname); to remove a tab
complete_head_from_modules($conf,$langs,$object,$head,$h,'holiday');
complete_head_from_modules($conf,$langs,$object,$head,$h,'holiday','remove');
return $head;
}
?>

View File

@ -39,7 +39,7 @@ function facture_prepare_head($object)
$head[$h][1] = $langs->trans('CardBill');
$head[$h][2] = 'compta';
$h++;
if (empty($conf->global->MAIN_DISABLE_CONTACTS_TAB))
{
$head[$h][0] = DOL_URL_ROOT.'/compta/facture/contact.php?facid='.$object->id;
@ -68,9 +68,9 @@ function facture_prepare_head($object)
// Show more tabs from modules
// Entries must be declared in modules descriptor with line
// $this->tabs = array('entity:+tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to add new tab
// $this->tabs = array('entity:-tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to remove a tab
// $this->tabs = array('entity:-tabname); to remove a tab
complete_head_from_modules($conf,$langs,$object,$head,$h,'invoice');
if (empty($conf->global->MAIN_DISABLE_NOTES_TAB))
{
$head[$h][0] = DOL_URL_ROOT.'/compta/facture/note.php?facid='.$object->id;
@ -93,6 +93,8 @@ function facture_prepare_head($object)
$head[$h][2] = 'info';
$h++;
complete_head_from_modules($conf,$langs,$object,$head,$h,'invoice','remove');
return $head;
}

View File

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

View File

@ -67,7 +67,7 @@ function commande_prepare_head($object)
$head[$h][2] = 'preview';
$h++;
}
if (empty($conf->global->MAIN_DISABLE_CONTACTS_TAB))
{
$head[$h][0] = DOL_URL_ROOT.'/commande/contact.php?id='.$object->id;
@ -79,7 +79,7 @@ function commande_prepare_head($object)
// Show more tabs from modules
// Entries must be declared in modules descriptor with line
// $this->tabs = array('entity:+tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to add new tab
// $this->tabs = array('entity:-tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to remove a tab
// $this->tabs = array('entity:-tabname); to remove a tab
complete_head_from_modules($conf,$langs,$object,$head,$h,'order');
$head[$h][0] = DOL_URL_ROOT.'/commande/document.php?id='.$object->id;
@ -90,7 +90,7 @@ function commande_prepare_head($object)
$head[$h][1] = $langs->trans('Documents');
$head[$h][2] = 'documents';
$h++;
if (empty($conf->global->MAIN_DISABLE_NOTES_TAB))
{
$head[$h][0] = DOL_URL_ROOT.'/commande/note.php?id='.$object->id;
@ -104,7 +104,9 @@ function commande_prepare_head($object)
$head[$h][2] = 'info';
$h++;
return $head;
complete_head_from_modules($conf,$langs,$object,$head,$h,'order','remove');
return $head;
}
?>

View File

@ -127,14 +127,14 @@ function pdf_getInstance($format='',$metric='mm',$pagetype='P')
/**
* This class if a enhanced FPDI class that support method writeHTMLCell
*/
class FPDI_DolExtended extends FPDI
{
public function __call($method, $args)
{
if (isset($this->$method)) {
$func = $this->$method;
$func($args);
}
class FPDI_DolExtended extends FPDI
{
public function __call($method, $args)
{
if (isset($this->$method)) {
$func = $this->$method;
$func($args);
}
}
public function writeHTMLCell($w, $h, $x, $y, $html = '', $border = 0, $ln = 0, $fill = false, $reseth = true, $align = '', $autopadding = true)
@ -144,8 +144,8 @@ function pdf_getInstance($format='',$metric='mm',$pagetype='P')
$val=dol_string_nohtmltag($val,false,'ISO-8859-1');
//print 'eee'.$val;exit;
$this->MultiCell($w,$h,$val,$border,$align,$fill);
}
}
}
}
$pdf2=new FPDI_DolExtended($pagetype,$metric,$format);
unset($pdf);

View File

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

View File

@ -113,7 +113,7 @@ function product_prepare_head($object, $user)
// Show more tabs from modules
// Entries must be declared in modules descriptor with line
// $this->tabs = array('entity:+tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to add new tab
// $this->tabs = array('entity:-tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to remove a tab
// $this->tabs = array('entity:-tabname); to remove a tab
complete_head_from_modules($conf,$langs,$object,$head,$h,'product');
$head[$h][0] = DOL_URL_ROOT.'/product/document.php?id='.$object->id;
@ -158,8 +158,8 @@ function product_admin_prepare_head($object=null)
// Show more tabs from modules
// Entries must be declared in modules descriptor with line
// $this->tabs = array('entity:+tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to add new tab
// $this->tabs = array('entity:-tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to remove a tab
// $this->tabs = array('entity:+tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to add new tab
// $this->tabs = array('entity:-tabname); to remove a tab
complete_head_from_modules($conf,$langs,$object,$head,$h,'product_admin');
$head[$h][0] = DOL_URL_ROOT.'/product/admin/product_extrafields.php';

View File

@ -61,7 +61,7 @@ function project_prepare_head($object)
// Show more tabs from modules
// Entries must be declared in modules descriptor with line
// $this->tabs = array('entity:+tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to add new tab
// $this->tabs = array('entity:-tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to remove a tab
// $this->tabs = array('entity:-tabname); to remove a tab
complete_head_from_modules($conf,$langs,$object,$head,$h,'project');
$head[$h][0] = DOL_URL_ROOT.'/projet/document.php?id='.$object->id;
@ -96,7 +96,9 @@ function project_prepare_head($object)
$head[$h][2] = 'gantt';
$h++;
return $head;
complete_head_from_modules($conf,$langs,$object,$head,$h,'project','remove');
return $head;
}
@ -130,7 +132,7 @@ function task_prepare_head($object)
// Show more tabs from modules
// Entries must be declared in modules descriptor with line
// $this->tabs = array('entity:+tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to add new tab
// $this->tabs = array('entity:-tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to remove a tab
// $this->tabs = array('entity:-tabname); to remove a tab
complete_head_from_modules($conf,$langs,$object,$head,$h,'task');
$head[$h][0] = DOL_URL_ROOT.'/projet/tasks/document.php?id='.$object->id.(GETPOST('withproject')?'&withproject=1':'');;
@ -147,6 +149,8 @@ function task_prepare_head($object)
$head[$h][2] = 'task_notes';
$h++;
complete_head_from_modules($conf,$langs,$object,$head,$h,'task','remove');
return $head;
}

View File

@ -73,7 +73,7 @@ function propal_prepare_head($object)
// Show more tabs from modules
// Entries must be declared in modules descriptor with line
// $this->tabs = array('entity:+tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to add new tab
// $this->tabs = array('entity:-tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to remove a tab
// $this->tabs = array('entity:-tabname); to remove a tab
complete_head_from_modules($conf,$langs,$object,$head,$h,'propal');
if (empty($conf->global->MAIN_DISABLE_NOTES_TAB))
@ -98,6 +98,8 @@ function propal_prepare_head($object)
$head[$h][2] = 'info';
$h++;
complete_head_from_modules($conf,$langs,$object,$head,$h,'propal','remove');
return $head;
}

View File

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

View File

@ -66,7 +66,7 @@ function stock_prepare_head($object)
// Show more tabs from modules
// Entries must be declared in modules descriptor with line
// $this->tabs = array('entity:+tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to add new tab
// $this->tabs = array('entity:-tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to remove a tab
// $this->tabs = array('entity:-tabname); to remove a tab
complete_head_from_modules($conf,$langs,$object,$head,$h,'stock');
$head[$h][0] = DOL_URL_ROOT.'/product/stock/info.php?id='.$object->id;
@ -74,7 +74,9 @@ function stock_prepare_head($object)
$head[$h][2] = 'info';
$h++;
return $head;
complete_head_from_modules($conf,$langs,$object,$head,$h,'stock','remove');
return $head;
}
?>

View File

@ -45,7 +45,7 @@ function tax_prepare_head($object)
// Show more tabs from modules
// Entries must be declared in modules descriptor with line
// $this->tabs = array('entity:+tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to add new tab
// $this->tabs = array('entity:-tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to remove a tab
// $this->tabs = array('entity:-tabname); to remove a tab
complete_head_from_modules($conf,$langs,$object,$head,$h,'tax');
$head[$h][0] = DOL_URL_ROOT.'/compta/sociales/document.php?id='.$object->id;
@ -58,6 +58,8 @@ function tax_prepare_head($object)
$head[$h][2] = 'info';
$h++;
complete_head_from_modules($conf,$langs,$object,$head,$h,'tax','remove');
return $head;
}

View File

@ -33,23 +33,25 @@ function trip_prepare_head($object)
$h = 0;
$head = array();
$head[$h][0] = DOL_URL_ROOT . '/compta/deplacement/fiche.php?id=' . $object->id;
$head[$h][1] = $langs->trans("Card");
$head[$h][2] = 'card';
$h++;
// Show more tabs from modules
// Entries must be declared in modules descriptor with line
// $this->tabs = array('entity:+tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to add new tab
// $this->tabs = array('entity:-tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to remove a tab
// $this->tabs = array('entity:+tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to add new tab
// $this->tabs = array('entity:-tabname); to remove a tab
complete_head_from_modules($conf,$langs,$object,$head,$h,'trip');
$head[$h][0] = DOL_URL_ROOT . '/compta/deplacement/info.php?id=' . $object->id;
$head[$h][1] = $langs->trans("Info");
$head[$h][2] = 'info';
$h++;
complete_head_from_modules($conf,$langs,$object,$head,$h,'trip','remove');
return $head;
}

View File

@ -81,8 +81,8 @@ function user_prepare_head($object)
// Show more tabs from modules
// Entries must be declared in modules descriptor with line
// $this->tabs = array('entity:+tabname:Title:@mymodule:conditiontoshow:/mymodule/mypage.php?id=__ID__'); to add new tab
// $this->tabs = array('entity:-tabname:Title:@mymodule:conditiontoshow:/mymodule/mypage.php?id=__ID__'); to remove a tab
// $this->tabs = array('entity:+tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to add new tab
// $this->tabs = array('entity:-tabname); to remove a tab
complete_head_from_modules($conf,$langs,$object,$head,$h,'user');
if (! empty($user->societe_id))
@ -98,6 +98,8 @@ function user_prepare_head($object)
$h++;
}
complete_head_from_modules($conf,$langs,$object,$head,$h,'user','remove');
return $head;
}
@ -140,45 +142,47 @@ function group_prepare_head($object)
// Show more tabs from modules
// Entries must be declared in modules descriptor with line
// $this->tabs = array('entity:+tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to add new tab
// $this->tabs = array('entity:-tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to remove a tab
// $this->tabs = array('entity:-tabname); to remove a tab
complete_head_from_modules($conf,$langs,$object,$head,$h,'group');
complete_head_from_modules($conf,$langs,$object,$head,$h,'group','remove');
return $head;
}
/**
* Prepare array with list of tabs
*
* @return array Array of tabs to shoc
*/
function user_admin_prepare_head()
{
global $langs, $conf, $user;
$langs->load("users");
/**
* Prepare array with list of tabs
*
* @return array Array of tabs to shoc
*/
function user_admin_prepare_head()
{
global $langs, $conf, $user;
$langs->load("users");
$h=0;
$head[$h][0] = DOL_URL_ROOT.'/admin/user.php';
$head[$h][1] = $langs->trans("Parameters");
$head[$h][2] = 'card';
$h++;
$head[$h][0] = DOL_URL_ROOT.'/user/admin/user_extrafields.php';
$head[$h][1] = $langs->trans("ExtraFields");
$head[$h][2] = 'attributes';
$h++;
// Show more tabs from modules
// Entries must be declared in modules descriptor with line
// $this->tabs = array('entity:+tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to add new tab
// $this->tabs = array('entity:-tabname); to remove a tab
complete_head_from_modules($conf,$langs,$object,$head,$h,'useradmin');
complete_head_from_modules($conf,$langs,$object,$head,$h,'useradmin','remove');
return $head;
$head[$h][0] = DOL_URL_ROOT.'/user/admin/user_extrafields.php';
$head[$h][1] = $langs->trans("ExtraFields");
$head[$h][2] = 'attributes';
$h++;
// Show more tabs from modules
// Entries must be declared in modules descriptor with line
// $this->tabs = array('entity:+tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to add new tab
// $this->tabs = array('entity:-tabname); to remove a tab
complete_head_from_modules($conf,$langs,$object,$head,$h,'useradmin');
complete_head_from_modules($conf,$langs,$object,$head,$h,'useradmin','remove');
return $head;
}

File diff suppressed because it is too large Load Diff

View File

@ -84,7 +84,6 @@ class pdf_expedition_merou extends ModelePdfExpedition
function write_file(&$object,$outputlangs,$srctemplatepath='',$hidedetails=0,$hidedesc=0,$hideref=0,$hookmanager=false)
{
global $user,$conf,$langs,$mysoc;
$default_font_size = pdf_getPDFFontSize($outputlangs);
$object->fetch_thirdparty();
@ -147,6 +146,7 @@ class pdf_expedition_merou extends ModelePdfExpedition
$nblignes = count($object->lines);
$pdf=pdf_getInstance($this->format,'mm','l');
$default_font_size = pdf_getPDFFontSize($outputlangs);
$heightforinfotot = 0; // Height reserved to output the info and total part
$heightforfreetext= (isset($conf->global->MAIN_PDF_FREETEXT_HEIGHT)?$conf->global->MAIN_PDF_FREETEXT_HEIGHT:5); // Height reserved to output the free text on last page
$heightforfooter = $this->marge_basse + 8; // Height reserved to output the footer (value include bottom margin)

View File

@ -87,7 +87,6 @@ class pdf_expedition_rouget extends ModelePdfExpedition
function write_file(&$object,$outputlangs,$srctemplatepath='',$hidedetails=0,$hidedesc=0,$hideref=0,$hookmanager=false)
{
global $user,$conf,$langs;
$default_font_size = pdf_getPDFFontSize($outputlangs);
$object->fetch_thirdparty();
@ -133,7 +132,8 @@ class pdf_expedition_rouget extends ModelePdfExpedition
$nblignes = count($object->lines);
$pdf=pdf_getInstance($this->format);
$heightforinfotot = 0; // Height reserved to output the info and total part
$default_font_size = pdf_getPDFFontSize($outputlangs);
$heightforinfotot = 0; // Height reserved to output the info and total part
$heightforfreetext= (isset($conf->global->MAIN_PDF_FREETEXT_HEIGHT)?$conf->global->MAIN_PDF_FREETEXT_HEIGHT:5); // Height reserved to output the free text on last page
$heightforfooter = $this->marge_basse + 8; // Height reserved to output the footer (value include bottom margin)
$pdf->SetAutoPageBreak(1,0);

View File

@ -151,8 +151,6 @@ class pdf_crabe extends ModelePDFFactures
$outputlangs->load("bills");
$outputlangs->load("products");
$default_font_size = pdf_getPDFFontSize($outputlangs);
if ($conf->facture->dir_output)
{
$object->fetch_thirdparty();
@ -187,6 +185,7 @@ class pdf_crabe extends ModelePDFFactures
$nblignes = count($object->lines);
$pdf=pdf_getInstance($this->format);
$default_font_size = pdf_getPDFFontSize($outputlangs); // Must be after pdf_getInstance
$heightforinfotot = 50; // Height reserved to output the info and total part
$heightforfreetext= (isset($conf->global->MAIN_PDF_FREETEXT_HEIGHT)?$conf->global->MAIN_PDF_FREETEXT_HEIGHT:5); // Height reserved to output the free text on last page
$heightforfooter = $this->marge_basse + 8; // Height reserved to output the footer (value include bottom margin)
@ -198,6 +197,7 @@ class pdf_crabe extends ModelePDFFactures
$pdf->setPrintFooter(false);
}
$pdf->SetFont(pdf_getPDFFont($outputlangs));
// Set path to the background PDF File
if (empty($conf->global->MAIN_DISABLE_FPDI) && ! empty($conf->global->MAIN_ADD_PDF_BACKGROUND))
{

View File

@ -117,8 +117,6 @@ class pdf_soleil extends ModelePDFFicheinter
$outputlangs->load("companies");
$outputlangs->load("interventions");
$default_font_size = pdf_getPDFFontSize($outputlangs);
if ($conf->ficheinter->dir_output)
{
$object->fetch_thirdparty();
@ -140,6 +138,7 @@ class pdf_soleil extends ModelePDFFicheinter
if (file_exists($dir))
{
$pdf=pdf_getInstance($this->format);
$default_font_size = pdf_getPDFFontSize($outputlangs); // Must be after pdf_getInstance
$heightforinfotot = 50; // Height reserved to output the info and total part
$heightforfreetext= (isset($conf->global->MAIN_PDF_FREETEXT_HEIGHT)?$conf->global->MAIN_PDF_FREETEXT_HEIGHT:5); // Height reserved to output the free text on last page
$heightforfooter = $this->marge_basse + 8; // Height reserved to output the footer (value include bottom margin)

View File

@ -113,7 +113,6 @@ class pdf_typhon extends ModelePDFDeliveryOrder
function write_file($object,$outputlangs)
{
global $user,$langs,$conf;
$default_font_size = pdf_getPDFFontSize($outputlangs);
if (! is_object($outputlangs)) $outputlangs=$langs;
// For backward compatibility with FPDF, force output charset to ISO, because FPDF expect text to be encoded in ISO
@ -150,6 +149,7 @@ class pdf_typhon extends ModelePDFDeliveryOrder
if (file_exists($dir))
{
$pdf=pdf_getInstance($this->format);
$default_font_size = pdf_getPDFFontSize($outputlangs); // Must be after pdf_getInstance
$heightforinfotot = 50; // Height reserved to output the info and total part
$heightforfreetext= (isset($conf->global->MAIN_PDF_FREETEXT_HEIGHT)?$conf->global->MAIN_PDF_FREETEXT_HEIGHT:5); // Height reserved to output the free text on last page
$heightforfooter = $this->marge_basse + 8; // Height reserved to output the footer (value include bottom margin)

View File

@ -108,8 +108,6 @@ class pdf_baleine extends ModelePDFProjects
{
$nblignes = count($object->lines);
$default_font_size = pdf_getPDFFontsize($outputlangs);
$objectref = dol_sanitizeFileName($object->ref);
$dir = $conf->projet->dir_output;
if (! preg_match('/specimen/i',$objectref)) $dir.= "/" . $objectref;
@ -127,6 +125,7 @@ class pdf_baleine extends ModelePDFProjects
if (file_exists($dir))
{
$pdf=pdf_getInstance($this->format);
$default_font_size = pdf_getPDFFontSize($outputlangs); // Must be after pdf_getInstance
$heightforinfotot = 50; // Height reserved to output the info and total part
$heightforfreetext= (isset($conf->global->MAIN_PDF_FREETEXT_HEIGHT)?$conf->global->MAIN_PDF_FREETEXT_HEIGHT:5); // Height reserved to output the free text on last page
$heightforfooter = $this->marge_basse + 8; // Height reserved to output the footer (value include bottom margin)

View File

@ -117,8 +117,6 @@ class pdf_azur extends ModelePDFPropales
}
$this->tva=array();
$this->localtax1=array();
$this->localtax2=array();
$this->atleastoneratenotnull=0;
$this->atleastonediscount=0;
}
@ -150,8 +148,6 @@ class pdf_azur extends ModelePDFPropales
$outputlangs->load("propal");
$outputlangs->load("products");
$default_font_size = pdf_getPDFFontSize($outputlangs);
if ($conf->propal->dir_output)
{
$object->fetch_thirdparty();
@ -186,6 +182,7 @@ class pdf_azur extends ModelePDFPropales
// Create pdf instance
$pdf=pdf_getInstance($this->format);
$default_font_size = pdf_getPDFFontSize($outputlangs); // Must be after pdf_getInstance
$heightforinfotot = 50; // Height reserved to output the info and total part
$heightforfreetext= (isset($conf->global->MAIN_PDF_FREETEXT_HEIGHT)?$conf->global->MAIN_PDF_FREETEXT_HEIGHT:5); // Height reserved to output the free text on last page
$heightforfooter = $this->marge_basse + 8; // Height reserved to output the footer (value include bottom margin)

View File

@ -146,8 +146,6 @@ class pdf_canelle extends ModelePDFSuppliersInvoices
$outputlangs->load("bills");
$outputlangs->load("products");
$default_font_size = pdf_getPDFFontSize($outputlangs);
if ($conf->fournisseur->dir_output.'/facture')
{
$object->fetch_thirdparty();
@ -184,6 +182,7 @@ class pdf_canelle extends ModelePDFSuppliersInvoices
$nblignes = count($object->lines);
$pdf=pdf_getInstance($this->format);
$default_font_size = pdf_getPDFFontSize($outputlangs); // Must be after pdf_getInstance
$heightforinfotot = 50; // Height reserved to output the info and total part
$heightforfreetext= (isset($conf->global->MAIN_PDF_FREETEXT_HEIGHT)?$conf->global->MAIN_PDF_FREETEXT_HEIGHT:5); // Height reserved to output the free text on last page
$heightforfooter = $this->marge_basse + 8; // Height reserved to output the footer (value include bottom margin)

View File

@ -156,8 +156,6 @@ class pdf_muscadet extends ModelePDFSuppliersOrders
$outputlangs->load("products");
$outputlangs->load("orders");
$default_font_size = pdf_getPDFFontSize($outputlangs);
if ($conf->fournisseur->dir_output.'/commande')
{
$object->fetch_thirdparty();
@ -196,6 +194,7 @@ class pdf_muscadet extends ModelePDFSuppliersOrders
$nblignes = count($object->lines);
$pdf=pdf_getInstance($this->format);
$default_font_size = pdf_getPDFFontSize($outputlangs); // Must be after pdf_getInstance
$heightforinfotot = 50; // Height reserved to output the info and total part
$heightforfreetext= (isset($conf->global->MAIN_PDF_FREETEXT_HEIGHT)?$conf->global->MAIN_PDF_FREETEXT_HEIGHT:5); // Height reserved to output the free text on last page
$heightforfooter = $this->marge_basse + 8; // Height reserved to output the footer (value include bottom margin)

View File

@ -7,6 +7,9 @@ require_once DOL_DOCUMENT_ROOT.'/core/modules/syslog/logHandlerInterface.php';
*/
class LogHandler
{
protected $ident=0;
/**
* Content of the info tooltip.
*
@ -58,4 +61,15 @@ class LogHandler
{
return array();
}
/**
* Set current ident.
*
* @param int $ident 1=Increase ident of 1, -1=Decrease ident of 1
* @return void
*/
public function setIdent($ident)
{
$this->ident+=$ident;
}
}

View File

@ -7,6 +7,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/modules/syslog/logHandler.php';
*/
class mod_syslog_file extends LogHandler implements LogHandlerInterface
{
/**
* Return name of logger
*
@ -106,6 +107,7 @@ class mod_syslog_file extends LogHandler implements LogHandlerInterface
* Export the message
*
* @param array $content Array containing the info about the message
* @param int $ident 1=Increase ident of 1, -1=Decrease ident of 1
* @return void
*/
public function export($content)
@ -133,7 +135,7 @@ class mod_syslog_file extends LogHandler implements LogHandlerInterface
LOG_DEBUG => 'DEBUG'
);
$message = dol_print_date(time(),"%Y-%m-%d %H:%M:%S")." ".sprintf("%-5s", $logLevels[$content['level']])." ".sprintf("%-15s", $content['ip'])." ".$content['message'];
$message = dol_print_date(time(),"%Y-%m-%d %H:%M:%S")." ".sprintf("%-5s", $logLevels[$content['level']])." ".sprintf("%-15s", $content['ip'])." ".($this->ident>0?str_pad('',$this->ident,' '):'').$content['message'];
fwrite($filefd, $message."\n");
fclose($filefd);

View File

@ -127,7 +127,7 @@ class InterfaceActionsAuto
$langs->load("other");
$langs->load("agenda");
$object->actiontypecode='AC_OTH';
$object->actiontypecode='AC_OTH_AUTO';
if (empty($object->actionmsg2)) $object->actionmsg2=$langs->transnoentities("NewCompanyToDolibarr",$object->nom);
$object->actionmsg=$langs->transnoentities("NewCompanyToDolibarr",$object->nom);
if ($object->prefix) $object->actionmsg.=" (".$object->prefix.")";
@ -146,7 +146,7 @@ class InterfaceActionsAuto
$langs->load("contracts");
$langs->load("agenda");
$object->actiontypecode='AC_OTH';
$object->actiontypecode='AC_OTH_AUTO';
if (empty($object->actionmsg2)) $object->actionmsg2=$langs->transnoentities("ContractValidatedInDolibarr",$object->ref);
$object->actionmsg=$langs->transnoentities("ContractValidatedInDolibarr",$object->ref);
$object->actionmsg.="\n".$langs->transnoentities("Author").': '.$user->login;
@ -160,7 +160,7 @@ class InterfaceActionsAuto
$langs->load("propal");
$langs->load("agenda");
$object->actiontypecode='AC_OTH';
$object->actiontypecode='AC_OTH_AUTO';
if (empty($object->actionmsg2)) $object->actionmsg2=$langs->transnoentities("PropalValidatedInDolibarr",$object->ref);
$object->actionmsg=$langs->transnoentities("PropalValidatedInDolibarr",$object->ref);
$object->actionmsg.="\n".$langs->transnoentities("Author").': '.$user->login;
@ -174,7 +174,7 @@ class InterfaceActionsAuto
$langs->load("propal");
$langs->load("agenda");
$object->actiontypecode='AC_EMAIL';
$object->actiontypecode='AC_OTH_AUTO';
if (empty($object->actionmsg2)) $object->actionmsg2=$langs->transnoentities("ProposalSentByEMail",$object->ref);
if (empty($object->actionmsg))
{
@ -192,7 +192,7 @@ class InterfaceActionsAuto
$langs->load("propal");
$langs->load("agenda");
$object->actiontypecode='AC_OTH';
$object->actiontypecode='AC_OTH_AUTO';
if (empty($object->actionmsg2)) $object->actionmsg2=$langs->transnoentities("PropalClosedSignedInDolibarr",$object->ref);
$object->actionmsg=$langs->transnoentities("PropalClosedSignedInDolibarr",$object->ref);
$object->actionmsg.="\n".$langs->transnoentities("Author").': '.$user->login;
@ -206,7 +206,7 @@ class InterfaceActionsAuto
$langs->load("propal");
$langs->load("agenda");
$object->actiontypecode='AC_OTH';
$object->actiontypecode='AC_OTH_AUTO';
if (empty($object->actionmsg2)) $object->actionmsg2=$langs->transnoentities("PropalClosedRefusedInDolibarr",$object->ref);
$object->actionmsg=$langs->transnoentities("PropalClosedRefusedInDolibarr",$object->ref);
$object->actionmsg.="\n".$langs->transnoentities("Author").': '.$user->login;
@ -220,7 +220,7 @@ class InterfaceActionsAuto
$langs->load("orders");
$langs->load("agenda");
$object->actiontypecode='AC_OTH';
$object->actiontypecode='AC_OTH_AUTO';
if (empty($object->actionmsg2)) $object->actionmsg2=$langs->transnoentities("OrderValidatedInDolibarr",$object->ref);
$object->actionmsg=$langs->transnoentities("OrderValidatedInDolibarr",$object->ref);
$object->actionmsg.="\n".$langs->transnoentities("Author").': '.$user->login;
@ -234,7 +234,7 @@ class InterfaceActionsAuto
$langs->load("orders");
$langs->load("agenda");
$object->actiontypecode='AC_EMAIL';
$object->actiontypecode='AC_OTH_AUTO';
if (empty($object->actionmsg2)) $object->actionmsg2=$langs->transnoentities("OrderSentByEMail",$object->ref);
if (empty($object->actionmsg))
{
@ -253,7 +253,7 @@ class InterfaceActionsAuto
$langs->load("bills");
$langs->load("agenda");
$object->actiontypecode='AC_OTH';
$object->actiontypecode='AC_OTH_AUTO';
if (empty($object->actionmsg2)) $object->actionmsg2=$langs->transnoentities("InvoiceValidatedInDolibarr",$object->ref);
$object->actionmsg=$langs->transnoentities("InvoiceValidatedInDolibarr",$object->ref);
$object->actionmsg.="\n".$langs->transnoentities("Author").': '.$user->login;
@ -268,7 +268,7 @@ class InterfaceActionsAuto
$langs->load("bills");
$langs->load("agenda");
$object->actiontypecode='AC_EMAIL';
$object->actiontypecode='AC_OTH_AUTO';
if (empty($object->actionmsg2)) $object->actionmsg2=$langs->transnoentities("InvoiceSentByEMail",$object->ref);
if (empty($object->actionmsg))
{
@ -288,7 +288,7 @@ class InterfaceActionsAuto
$langs->load("agenda");
// Values for this action can't be defined by caller.
$object->actiontypecode='AC_OTH';
$object->actiontypecode='AC_OTH_AUTO';
$object->actionmsg2=$langs->transnoentities("InvoicePaidInDolibarr",$object->ref);
$object->actionmsg=$langs->transnoentities("InvoicePaidInDolibarr",$object->ref);
$object->actionmsg.="\n".$langs->transnoentities("Author").': '.$user->login;
@ -303,7 +303,7 @@ class InterfaceActionsAuto
$langs->load("bills");
$langs->load("agenda");
$object->actiontypecode='AC_OTH';
$object->actiontypecode='AC_OTH_AUTO';
if (empty($object->actionmsg2)) $object->actionmsg2=$langs->transnoentities("InvoiceCanceledInDolibarr",$object->ref);
$object->actionmsg=$langs->transnoentities("InvoiceCanceledInDolibarr",$object->ref);
$object->actionmsg.="\n".$langs->transnoentities("Author").': '.$user->login;
@ -318,7 +318,7 @@ class InterfaceActionsAuto
$langs->load("interventions");
$langs->load("agenda");
$object->actiontypecode='AC_OTH';
$object->actiontypecode='AC_OTH_AUTO';
if (empty($object->actionmsg2)) $object->actionmsg2=$langs->transnoentities("InterventionValidatedInDolibarr",$object->ref);
$object->actionmsg=$langs->transnoentities("InterventionValidatedInDolibarr",$object->ref);
$object->actionmsg.="\n".$langs->transnoentities("Author").': '.$user->login;
@ -335,7 +335,7 @@ class InterfaceActionsAuto
$langs->load("interventions");
$langs->load("agenda");
$object->actiontypecode='AC_EMAIL';
$object->actiontypecode='AC_OTH_AUTO';
if (empty($object->actionmsg2)) $object->actionmsg2=$langs->transnoentities("InterventionSentByEMail",$object->ref);
$object->actionmsg=$langs->transnoentities("InterventionSentByEMail",$object->ref);
$object->actionmsg.="\n".$langs->transnoentities("Author").': '.$user->login;
@ -351,7 +351,7 @@ class InterfaceActionsAuto
$langs->load("sendings");
$langs->load("agenda");
$object->actiontypecode='AC_SHIP';
$object->actiontypecode='AC_OTH_AUTO';
if (empty($object->actionmsg2)) $object->actionmsg2=$langs->transnoentities("ShippingSentByEMail",$object->ref);
if (empty($object->actionmsg))
{
@ -369,7 +369,7 @@ class InterfaceActionsAuto
$langs->load("orders");
$langs->load("agenda");
$object->actiontypecode='AC_OTH';
$object->actiontypecode='AC_OTH_AUTO';
if (empty($object->actionmsg2)) $object->actionmsg2=$langs->transnoentities("OrderValidatedInDolibarr",$object->ref);
$object->actionmsg=$langs->transnoentities("OrderValidatedInDolibarr",$object->ref);
$object->actionmsg.="\n".$langs->transnoentities("Author").': '.$user->login;
@ -385,7 +385,7 @@ class InterfaceActionsAuto
$langs->load("agenda");
$langs->load("orders");
$object->actiontypecode='AC_EMAIL';
$object->actiontypecode='AC_OTH_AUTO';
if (empty($object->actionmsg2)) $object->actionmsg2=$langs->transnoentities("SupplierOrderSentByEMail",$object->ref);
if (empty($object->actionmsg))
{
@ -404,7 +404,7 @@ class InterfaceActionsAuto
$langs->load("bills");
$langs->load("agenda");
$object->actiontypecode='AC_OTH';
$object->actiontypecode='AC_OTH_AUTO';
if (empty($object->actionmsg2)) $object->actionmsg2=$langs->transnoentities("InvoiceValidatedInDolibarr",$object->ref);
$object->actionmsg=$langs->transnoentities("InvoiceValidatedInDolibarr",$object->ref);
$object->actionmsg.="\n".$langs->transnoentities("Author").': '.$user->login;
@ -420,7 +420,7 @@ class InterfaceActionsAuto
$langs->load("agenda");
$langs->load("orders");
$object->actiontypecode='AC_EMAIL';
$object->actiontypecode='AC_OTH_AUTO';
if (empty($object->actionmsg2)) $object->actionmsg2=$langs->transnoentities("SupplierInvoiceSentByEMail",$object->ref);
if (empty($object->actionmsg))
{
@ -439,7 +439,7 @@ class InterfaceActionsAuto
$langs->load("bills");
$langs->load("agenda");
$object->actiontypecode='AC_OTH';
$object->actiontypecode='AC_OTH_AUTO';
if (empty($object->actionmsg2)) $object->actionmsg2=$langs->transnoentities("InvoicePaidInDolibarr",$object->ref);
$object->actionmsg=$langs->transnoentities("InvoicePaidInDolibarr",$object->ref);
$object->actionmsg.="\n".$langs->transnoentities("Author").': '.$user->login;
@ -454,7 +454,7 @@ class InterfaceActionsAuto
$langs->load("bills");
$langs->load("agenda");
$object->actiontypecode='AC_OTH';
$object->actiontypecode='AC_OTH_AUTO';
if (empty($object->actionmsg2)) $object->actionmsg2=$langs->transnoentities("InvoiceCanceledInDolibarr",$object->ref);
$object->actionmsg=$langs->transnoentities("InvoiceCanceledInDolibarr",$object->ref);
$object->actionmsg.="\n".$langs->transnoentities("Author").': '.$user->login;
@ -471,7 +471,7 @@ class InterfaceActionsAuto
$langs->load("members");
$langs->load("agenda");
$object->actiontypecode='AC_OTH';
$object->actiontypecode='AC_OTH_AUTO';
if (empty($object->actionmsg2)) $object->actionmsg2=$langs->transnoentities("MemberValidatedInDolibarr",$object->ref);
$object->actionmsg=$langs->transnoentities("MemberValidatedInDolibarr",$object->ref);
$object->actionmsg.="\n".$langs->transnoentities("Member").': '.$object->getFullName($langs);
@ -488,7 +488,7 @@ class InterfaceActionsAuto
$langs->load("members");
$langs->load("agenda");
$object->actiontypecode='AC_OTH';
$object->actiontypecode='AC_OTH_AUTO';
if (empty($object->actionmsg2)) $object->actionmsg2=$langs->transnoentities("MemberSubscriptionAddedInDolibarr",$object->ref);
$object->actionmsg=$langs->transnoentities("MemberSubscriptionAddedInDolibarr",$object->ref);
$object->actionmsg.="\n".$langs->transnoentities("Member").': '.$object->getFullName($langs);
@ -511,7 +511,7 @@ class InterfaceActionsAuto
$langs->load("members");
$langs->load("agenda");
$object->actiontypecode='AC_OTH';
$object->actiontypecode='AC_OTH_AUTO';
if (empty($object->actionmsg2)) $object->actionmsg2=$langs->transnoentities("MemberResiliatedInDolibarr",$object->ref);
$object->actionmsg=$langs->transnoentities("MemberResiliatedInDolibarr",$object->ref);
$object->actionmsg.="\n".$langs->transnoentities("Member").': '.$object->getFullName($langs);
@ -528,7 +528,7 @@ class InterfaceActionsAuto
$langs->load("members");
$langs->load("agenda");
$object->actiontypecode='AC_OTH';
$object->actiontypecode='AC_OTH_AUTO';
if (empty($object->actionmsg2)) $object->actionmsg2=$langs->transnoentities("MemberDeletedInDolibarr",$object->ref);
$object->actionmsg=$langs->transnoentities("MemberDeletedInDolibarr",$object->ref);
$object->actionmsg.="\n".$langs->transnoentities("Member").': '.$object->getFullName($langs);

View File

@ -294,7 +294,7 @@ class Export
}
break;
case 'Boolean':
$szFilterQuery=" ".$NameField."=".(is_numeric($ValueField) ? $ValueField : ($ValueField =='yes' ? 1: 0) );
$szFilterQuery=" ".$NameField."=".(is_numeric($ValueField) ? $ValueField : ($ValueField =='yes' ? 1: 0) );
break;
case 'Status':
case 'List':

View File

@ -1122,7 +1122,7 @@ print '<br>';
llxFooter();
$db->close();
$db->close();
/**

View File

@ -889,7 +889,7 @@ class CommandeFournisseur extends CommonOrder
dol_syslog(get_class($this)."::commande sql=".$sql, LOG_DEBUG);
if ($this->db->query($sql))
{
$result = 0;
$result = 1;
$this->log($user, 3, $date, $comment);
}
else
@ -954,34 +954,67 @@ class CommandeFournisseur extends CommonOrder
{
$this->id = $this->db->last_insert_id(MAIN_DB_PREFIX."commande_fournisseur");
$sql = "UPDATE ".MAIN_DB_PREFIX."commande_fournisseur";
$sql.= " SET ref='(PROV".$this->id.")'";
$sql.= " WHERE rowid=".$this->id;
dol_syslog(get_class($this)."::create sql=".$sql);
if ($this->db->query($sql))
{
// On logue creation pour historique
$this->log($user, 0, time());
if ($this->id) {
$num=count($this->lines);
if (! $notrigger)
{
// Appel des triggers
include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php';
$interface=new Interfaces($this->db);
$result=$interface->run_triggers('ORDER_SUPPLIER_CREATE',$this,$user,$langs,$conf);
if ($result < 0) { $error++; $this->errors=$interface->errors; }
// Fin appel triggers
}
/*
* Insertion du detail des produits dans la base
*/
for ($i=0;$i<$num;$i++)
{
$result = $this->addline(
$this->lines[$i]->desc,
$this->lines[$i]->subprice,
$this->lines[$i]->qty,
$this->lines[$i]->tva_tx,
$this->lines[$i]->localtax1_tx,
$this->lines[$i]->localtax2_tx,
$this->lines[$i]->fk_product,
0,
$this->lines[$i]->ref_fourn,
$this->lines[$i]->remise_percent,
'HT',
0,
$this->lines[$i]->info_bits
);
if ($result < 0)
{
$this->error=$this->db->lasterror();
dol_print_error($this->db);
$this->db->rollback();
return -1;
}
}
$this->db->commit();
return $this->id;
}
else
{
$this->error=$this->db->error();
dol_syslog(get_class($this)."::create: Failed -2 - ".$this->error, LOG_ERR);
$this->db->rollback();
return -2;
$sql = "UPDATE ".MAIN_DB_PREFIX."commande_fournisseur";
$sql.= " SET ref='(PROV".$this->id.")'";
$sql.= " WHERE rowid=".$this->id;
dol_syslog(get_class($this)."::create sql=".$sql);
if ($this->db->query($sql))
{
// On logue creation pour historique
$this->log($user, 0, time());
if (! $notrigger)
{
// Appel des triggers
include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php';
$interface=new Interfaces($this->db);
$result=$interface->run_triggers('ORDER_SUPPLIER_CREATE',$this,$user,$langs,$conf);
if ($result < 0) { $error++; $this->errors=$interface->errors; }
// Fin appel triggers
}
$this->db->commit();
return $this->id;
}
else
{
$this->error=$this->db->error();
dol_syslog(get_class($this)."::create: Failed -2 - ".$this->error, LOG_ERR);
$this->db->rollback();
return -2;
}
}
}
else
@ -993,6 +1026,69 @@ class CommandeFournisseur extends CommonOrder
}
}
/**
* Load an object from its id and create a new one in database
*
* @param HookManager $hookmanager Hook manager instance
* @return int New id of clone
*/
function createFromClone($hookmanager=false)
{
global $conf,$user,$langs;
$error=0;
$this->db->begin();
// Load source object
$objFrom = dol_clone($this);
$this->id=0;
$this->statut=0;
// Clear fields
$this->user_author_id = $user->id;
$this->user_valid = '';
$this->date_creation = '';
$this->date_validation = '';
$this->ref_supplier = '';
// Create clone
$result=$this->create($user);
if ($result < 0) $error++;
if (! $error)
{
// Hook of thirdparty module
if (is_object($hookmanager))
{
$parameters=array('objFrom'=>$objFrom);
$action='';
$reshook=$hookmanager->executeHooks('createFrom',$parameters,$this,$action); // Note that $action and $object may have been modified by some hooks
if ($reshook < 0) $error++;
}
// Appel des triggers
include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php';
$interface=new Interfaces($this->db);
$result=$interface->run_triggers('ORDER_SUPPLIER_CLONE',$this,$user,$langs,$conf);
if ($result < 0) { $error++; $this->errors=$interface->errors; }
// Fin appel triggers
}
// End
if (! $error)
{
$this->db->commit();
return $this->id;
}
else
{
$this->db->rollback();
return -1;
}
}
/**
* Add order line
*
@ -1026,6 +1122,7 @@ class CommandeFournisseur extends CommonOrder
if (empty($txtva)) $txtva=0;
if (empty($txlocaltax1)) $txlocaltax1=0;
if (empty($txlocaltax2)) $txlocaltax2=0;
if (empty($remise_percent)) $remise_percent=0;
$remise_percent=price2num($remise_percent);
$qty=price2num($qty);
@ -1044,7 +1141,6 @@ class CommandeFournisseur extends CommonOrder
}
$desc=trim($desc);
// Check parameters
if ($qty < 1 && ! $fk_product)
{
@ -1053,7 +1149,6 @@ class CommandeFournisseur extends CommonOrder
}
if ($type < 0) return -1;
if ($this->statut == 0)
{
$this->db->begin();
@ -1111,7 +1206,7 @@ class CommandeFournisseur extends CommonOrder
$subprice = price2num($pu,'MU');
$sql = "INSERT INTO ".MAIN_DB_PREFIX."commande_fournisseurdet";
$sql.= " (fk_commande,label, description,";
$sql.= " (fk_commande, label, description,";
$sql.= " fk_product, product_type,";
$sql.= " qty, tva_tx, localtax1_tx, localtax2_tx, remise_percent, subprice, ref,";
$sql.= " total_ht, total_tva, total_localtax1, total_localtax2, total_ttc";
@ -1712,24 +1807,19 @@ class CommandeFournisseur extends CommonOrder
$now=dol_now();
// Charge tableau des produits prodids
$prodids = array();
// Find first product
$prodid=0;
$product=new ProductFournisseur($db);
$sql = "SELECT rowid";
$sql.= " FROM ".MAIN_DB_PREFIX."product";
$sql.= " WHERE entity IN (".getEntity('product', 1).")";
$sql.=$this->db->order("rowid","ASC");
$sql.=$this->db->plimit(1);
$resql = $this->db->query($sql);
if ($resql)
{
$num_prods = $this->db->num_rows($resql);
$i = 0;
while ($i < $num_prods)
{
$i++;
$row = $this->db->fetch_row($resql);
$prodids[$i] = $row[0];
}
$obj = $this->db->fetch_object($resql);
$prodid = $obj->rowid;
}
// Initialise parametres
@ -1771,9 +1861,7 @@ class CommandeFournisseur extends CommonOrder
$line->total_tva=19.6;
$line->remise_percent=00;
}
$line->ref_fourn='SUPPLIER_REF_'.$xnbp;
$prodid = rand(1, $num_prods);
$line->fk_product=$prodids[$prodid];
$line->fk_product=$prodid;
$this->lines[$xnbp]=$line;

View File

@ -30,8 +30,7 @@ require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.class.php';
/**
* \class ProductFournisseur
* \brief Class to manage predefined suppliers products
* Class to manage predefined suppliers products
*/
class ProductFournisseur extends Product
{
@ -146,7 +145,7 @@ class ProductFournisseur extends Product
* @param string $charges costs affering to product
* @param float $remise_percent Discount regarding qty (percent)
* @param float $remise Discount regarding qty (amount)
* @return int >0 if KO, >0 if OK
* @return int <0 if KO, >=0 if OK
*/
function update_buyprice($qty, $buyprice, $user, $price_base_type, $fourn, $availability, $ref_fourn, $tva_tx, $charges=0, $remise_percent=0, $remise=0)
{

File diff suppressed because it is too large Load Diff

View File

@ -122,7 +122,7 @@ if ($resql)
print_barre_liste($title, $page, "liste.php", "", $sortfield, $sortorder, '', $num);
print '<form action="liste.php" method="GET">';
print '<table class="liste">';
print '<table class="noborder" width="100%">';
print '<tr class="liste_titre">';
print_liste_field_titre($langs->trans("Ref"),$_SERVER["PHP_SELF"],"cf.ref","","",'',$sortfield,$sortorder);
print_liste_field_titre($langs->trans("Company"),$_SERVER["PHP_SELF"],"s.nom","","",'',$sortfield,$sortorder);

View File

@ -82,7 +82,7 @@ if ($action == 'confirm_clone' && $confirm == 'yes')
$result=$object->createFromClone($id);
if ($result > 0)
{
header("Location: ".$_SERVER['PHP_SELF'].'?id='.$result);
header("Location: ".$_SERVER['PHP_SELF'].'?action=editfacnumber&id='.$result);
exit;
}
else
@ -469,7 +469,7 @@ elseif ($action == 'addline')
if (GETPOST('search_idprodfournprice') || GETPOST('idprodfournprice')) // With combolist idprodfournprice is > 0 or -1, with autocomplete, idprodfournprice is > 0 or ''
{
$idprod=0;
$product=new Product($db);
$product=new Product($db);
if (GETPOST('idprodfournprice') == '')
{
@ -1820,12 +1820,12 @@ else
print '<input type="hidden" name="socid" value="'. $object->socid .'">';
print '<input type="hidden" name="facid" value="'.$object->id.'">';
print '<script type="text/javascript">
jQuery(document).ready(function() {
jQuery(\'#idprodfournprice\').change(function() {
if (jQuery(\'#idprodfournprice\').val() > 0) jQuery(\'#np_desc\').focus();
print '<script type="text/javascript">
jQuery(document).ready(function() {
jQuery(\'#idprodfournprice\').change(function() {
if (jQuery(\'#idprodfournprice\').val() > 0) jQuery(\'#np_desc\').focus();
});
});
});
</script>';
$var=! $var;

View File

@ -90,11 +90,11 @@ class Holiday extends CommonObject
$error=0;
$now=dol_now();
// Check parameters
if (empty($this->fk_user) || ! is_numeric($this->fk_user) || $this->fk_user < 0) { $this->error="ErrorBadParameter"; return -1; }
if (empty($this->fk_validator) || ! is_numeric($this->fk_validator) || $this->fk_validator < 0) { $this->error="ErrorBadParameter"; return -1; }
// Insert request
$sql = "INSERT INTO ".MAIN_DB_PREFIX."holiday(";
@ -191,7 +191,8 @@ class Holiday extends CommonObject
{
$obj = $this->db->fetch_object($resql);
$this->rowid = $obj->rowid;
$this->id = $obj->rowid;
$this->rowid = $obj->rowid; // deprecated
$this->fk_user = $obj->fk_user;
$this->date_create = $this->db->jdate($obj->date_create);
$this->description = $obj->description;
@ -206,8 +207,6 @@ class Holiday extends CommonObject
$this->date_cancel = $this->db->jdate($obj->date_cancel);
$this->fk_user_cancel = $obj->fk_user_cancel;
$this->detail_refuse = $obj->detail_refuse;
}
$this->db->free($resql);
@ -1601,17 +1600,17 @@ class Holiday extends CommonObject
function initAsSpecimen()
{
global $user,$langs;
// Initialise parameters
$this->id=0;
$this->specimen=1;
$this->fk_user=1;
$this->description='SPECIMEN description';
$this->date_debut=dol_now();
$this->date_fin=dol_now()+(24*3600);
$this->fk_validator=1;
}
}
?>

View File

@ -30,6 +30,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/CMailFile.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/holiday.lib.php';
require_once DOL_DOCUMENT_ROOT.'/holiday/common.inc.php';
// Get parameters
@ -752,9 +753,9 @@ else
//print_fiche_titre($langs->trans('TitreRequestCP'));
// Si il y a une erreur
if (GETPOST('error'))
if (GETPOST('error'))
{
switch(GETPOST('error'))
switch(GETPOST('error'))
{
case 'datefin' :
$errors[] = $langs->transnoentitiesnoconv('ErrorEndDateCP');
@ -829,16 +830,8 @@ else
if ($ret == 'html') print '<br />';
}
$head=holiday_prepare_head($cp);
$h=0;
$head = array();
$head[$h][0] = DOL_URL_ROOT . '/holiday/fiche.php?id='.$id;
$head[$h][1] = $langs->trans("Card");
$head[$h][2] = 'card';
$h++;
complete_head_from_modules($conf,$langs,$cp,$head,$h,'holiday');
dol_fiche_head($head,'card',$langs->trans("CPTitreMenu"),0,'holiday');

View File

@ -57,7 +57,7 @@ $search_employe = GETPOST('search_employe');
$search_valideur = GETPOST('search_valideur');
$search_statut = GETPOST('select_statut');
$holiday = new Holiday($db);
$holiday = new Holiday($db);
/*
* Actions
@ -80,8 +80,9 @@ llxHeader(array(),$langs->trans('CPTitreMenu'));
$order = $db->order($sortfield,$sortorder).$db->plimit($conf->liste_limit + 1, $offset);
// WHERE
if(!empty($search_ref)){
$filter.= " AND cp.rowid LIKE '%$search_ref%'\n";
if(!empty($search_ref))
{
$filter.= " AND cp.rowid LIKE '%".$db->escape($search_ref)."%'\n";
}
// DATE START
@ -125,17 +126,17 @@ if($year_create > 0) {
// EMPLOYE
if(!empty($search_employe) && $search_employe != -1) {
$filter.= " AND cp.fk_user = '$search_employe'\n";
$filter.= " AND cp.fk_user = '".$db->escape($search_employe)."'\n";
}
// VALIDEUR
if(!empty($search_valideur) && $search_valideur != -1) {
$filter.= " AND cp.fk_validator = '$search_valideur'\n";
$filter.= " AND cp.fk_validator = '".$db->escape($search_valideur)."'\n";
}
// STATUT
if(!empty($search_statut) && $search_statut != -1) {
$filter.= " AND cp.statut = '$search_statut'\n";
$filter.= " AND cp.statut = '".$db->escape($search_statut)."'\n";
}
/*************************************
@ -146,7 +147,7 @@ if(!empty($search_statut) && $search_statut != -1) {
$user_id = $user->id;
// Récupération des congés payés de l'utilisateur ou de tous les users
if(!$user->rights->holiday->lire_tous)
if (!$user->rights->holiday->lire_tous)
{
$holiday_payes = $holiday->fetchByUser($user_id,$order,$filter);
}
@ -156,7 +157,7 @@ else
}
// Si pas de congés payés
if($holiday_payes == 0)
if ($holiday_payes == 0)
{
print_fiche_titre($langs->trans('CPTitreMenu'));
@ -168,7 +169,7 @@ if($holiday_payes == 0)
}
// Si erreur SQL
if($holiday_payes == '-1')
if ($holiday_payes == '-1')
{
print_fiche_titre($langs->trans('CPTitreMenu'));
@ -290,8 +291,8 @@ if (! empty($holiday->holiday))
print '<td style="text-align: center;">'.dol_print_date($date,'day').'</td>';
print '<td>'.$user->getNomUrl('1').'</td>';
print '<td>'.$validator->getNomUrl('1').'</td>';
print '<td style="text-align: center;">'.$infos_CP['date_debut'].'</td>';
print '<td style="text-align: center;">'.$infos_CP['date_fin'].'</td>';
print '<td style="text-align: center;">'.dol_print_date($infos_CP['date_debut'],'day').'</td>';
print '<td style="text-align: center;">'.dol_print_date($infos_CP['date_fin'],'day').'</td>';
print '<td>';
$nbopenedday=num_open_day($infos_CP['date_debut'],$infos_CP['date_fin'],0,1);
print $nbopenedday;
@ -317,7 +318,7 @@ print '<div style="float: right; margin-top: 8px;">';
print '<a href="./fiche.php?action=request" class="butAction">'.$langs->trans('AddCP').'</a>';
print '</div>';
// Fin de page
$db->close();
llxFooter();
$db->close();
?>

View File

@ -55,8 +55,8 @@ $db_prefix=GETPOST('db_prefix','alpha');
session_start(); // To be able to keep info into session (used for not loosing pass during navigation. pass must not transit throug parmaeters)
// Save a flag to tell to restore input value if we do back
$_SESSION['dol_save_pass']=$db_pass;
//$_SESSION['dol_save_passroot']=$passroot;
$_SESSION['dol_save_pass']=$db_pass;
//$_SESSION['dol_save_passroot']=$passroot;
// Now we load forced value from install.forced.php file.
$useforcedwizard=false;

View File

@ -38,27 +38,27 @@ $langs->load("errors");
dolibarr_install_syslog("Fileconf: Entering fileconf.php page");
// You can force preselected values of the config step of Dolibarr by adding a file
// install.forced.php into directory htdocs/install (This is the case with some wizard
// installer like DoliWamp, DoliMamp or DoliBuntu).
// We first init "forced values" to nothing.
if (! isset($force_install_noedit)) $force_install_noedit=''; // 1=To block var specific to distrib, 2 to block all technical parameters
if (! isset($force_install_type)) $force_install_type='';
if (! isset($force_install_dbserver)) $force_install_dbserver='';
if (! isset($force_install_port)) $force_install_port='';
if (! isset($force_install_database)) $force_install_database='';
if (! isset($force_install_prefix)) $force_install_prefix='';
if (! isset($force_install_createdatabase)) $force_install_createdatabase='';
if (! isset($force_install_databaselogin)) $force_install_databaselogin='';
if (! isset($force_install_databasepass)) $force_install_databasepass='';
if (! isset($force_install_databaserootlogin)) $force_install_databaserootlogin='';
if (! isset($force_install_databaserootpass)) $force_install_databaserootpass='';
// Now we load forced value from install.forced.php file.
$useforcedwizard=false;
$forcedfile="./install.forced.php";
if ($conffile == "/etc/dolibarr/conf.php") $forcedfile="/etc/dolibarr/install.forced.php"; // Must be after inc.php
if (@file_exists($forcedfile)) {
$useforcedwizard=true; include_once $forcedfile;
// You can force preselected values of the config step of Dolibarr by adding a file
// install.forced.php into directory htdocs/install (This is the case with some wizard
// installer like DoliWamp, DoliMamp or DoliBuntu).
// We first init "forced values" to nothing.
if (! isset($force_install_noedit)) $force_install_noedit=''; // 1=To block var specific to distrib, 2 to block all technical parameters
if (! isset($force_install_type)) $force_install_type='';
if (! isset($force_install_dbserver)) $force_install_dbserver='';
if (! isset($force_install_port)) $force_install_port='';
if (! isset($force_install_database)) $force_install_database='';
if (! isset($force_install_prefix)) $force_install_prefix='';
if (! isset($force_install_createdatabase)) $force_install_createdatabase='';
if (! isset($force_install_databaselogin)) $force_install_databaselogin='';
if (! isset($force_install_databasepass)) $force_install_databasepass='';
if (! isset($force_install_databaserootlogin)) $force_install_databaserootlogin='';
if (! isset($force_install_databaserootpass)) $force_install_databaserootpass='';
// Now we load forced value from install.forced.php file.
$useforcedwizard=false;
$forcedfile="./install.forced.php";
if ($conffile == "/etc/dolibarr/conf.php") $forcedfile="/etc/dolibarr/install.forced.php"; // Must be after inc.php
if (@file_exists($forcedfile)) {
$useforcedwizard=true; include_once $forcedfile;
}
//$force_install_message='This is the message';
@ -69,7 +69,7 @@ if (@file_exists($forcedfile)) {
* View
*/
session_start(); // To be able to keep info into session (used for not loosing pass during navigation. pass must not transit throug parmaeters)
session_start(); // To be able to keep info into session (used for not loosing pass during navigation. pass must not transit throug parmaeters)
pHeader($langs->trans("ConfigurationFile"),"etape1","set","",(empty($force_dolibarr_js_JQUERY)?'':$force_dolibarr_js_JQUERY.'/'));

View File

@ -30,6 +30,7 @@ if (! defined('DOL_INC_FOR_VERSION_ERROR')) define('DOL_INC_FOR_VERSION_ERROR','
require_once '../filefunc.inc.php';
// Define DOL_DOCUMENT_ROOT and ADODB_PATH used for install/upgrade process
if (! defined('DOL_DOCUMENT_ROOT')) define('DOL_DOCUMENT_ROOT', '..');
if (! defined('ADODB_PATH'))
@ -316,6 +317,8 @@ function pHeader($subtitle,$next,$action='set',$param='',$forcejqueryurl='')
$langs->load("main");
$langs->load("admin");
$jquerytheme='smoothness';
if ($forcejqueryurl)
{
$jQueryCustomPath = $forcejqueryurl;
@ -327,8 +330,6 @@ function pHeader($subtitle,$next,$action='set',$param='',$forcejqueryurl='')
$jQueryUiCustomPath = (defined('JS_JQUERY_UI') && constant('JS_JQUERY_UI')) ? JS_JQUERY_UI : false;
}
$jquerytheme='smoothness';
// We force the content charset
header("Content-type: text/html; charset=".$conf->file->character_set_client);

View File

@ -30,15 +30,16 @@
-- Types action comm
--
delete from llx_c_actioncomm where id in (1,2,3,4,5,8,9,10,30,31,50);
insert into llx_c_actioncomm (id, code, type, libelle, module, position) values ( 1, 'AC_TEL', 'system', 'Phone call' ,NULL, 2);
insert into llx_c_actioncomm (id, code, type, libelle, module, position) values ( 2, 'AC_FAX', 'system', 'Send Fax' ,NULL, 3);
insert into llx_c_actioncomm (id, code, type, libelle, module, position) values ( 3, 'AC_PROP', 'systemauto', 'Send commercial proposal by email' ,'propal', 10);
insert into llx_c_actioncomm (id, code, type, libelle, module, position) values ( 4, 'AC_EMAIL', 'system', 'Send Email' ,NULL, 4);
insert into llx_c_actioncomm (id, code, type, libelle, module, position) values ( 5, 'AC_RDV', 'system', 'Rendez-vous' ,NULL, 1);
insert into llx_c_actioncomm (id, code, type, libelle, module, position) values ( 8, 'AC_COM', 'systemauto', 'Send customer order by email' ,'order', 8);
insert into llx_c_actioncomm (id, code, type, libelle, module, position) values ( 9, 'AC_FAC', 'systemauto', 'Send customer invoice by email' ,'invoice', 6);
insert into llx_c_actioncomm (id, code, type, libelle, module, position) values ( 10, 'AC_SHIP', 'systemauto', 'Send shipping by email' ,'shipping', 11);
insert into llx_c_actioncomm (id, code, type, libelle, module, position) values ( 30, 'AC_SUP_ORD', 'systemauto', 'Send supplier order by email' ,'order_supplier', 9);
insert into llx_c_actioncomm (id, code, type, libelle, module, position) values (31, 'AC_SUP_INV', 'systemauto', 'Send supplier invoice by email' ,'invoice_supplier', 7);
insert into llx_c_actioncomm (id, code, type, libelle, module, position) values ( 50, 'AC_OTH', 'system', 'Other' ,NULL, 5);
delete from llx_c_actioncomm where id in (1,2,3,4,5,8,9,10,30,31,40,50);
insert into llx_c_actioncomm (id, code, type, libelle, module, active, position) values ( 1,'AC_TEL','system','Phone call',NULL, 1, 2);
insert into llx_c_actioncomm (id, code, type, libelle, module, active, position) values ( 2,'AC_FAX','system','Send Fax',NULL, 1, 3);
insert into llx_c_actioncomm (id, code, type, libelle, module, active, position) values ( 3,'AC_PROP','systemauto', 'Send commercial proposal by email','propal',0,10);
insert into llx_c_actioncomm (id, code, type, libelle, module, active, position) values ( 4,'AC_EMAIL','system','Send Email',NULL, 1, 4);
insert into llx_c_actioncomm (id, code, type, libelle, module, active, position) values ( 5,'AC_RDV','system','Rendez-vous',NULL, 1, 1);
insert into llx_c_actioncomm (id, code, type, libelle, module, active, position) values ( 8,'AC_COM','systemauto','Send customer order by email','order', 0,8);
insert into llx_c_actioncomm (id, code, type, libelle, module, active, position) values ( 9,'AC_FAC','systemauto', 'Send customer invoice by email','invoice',0,6);
insert into llx_c_actioncomm (id, code, type, libelle, module, active, position) values ( 10,'AC_SHIP','systemauto', 'Send shipping by email','shipping',0,11);
insert into llx_c_actioncomm (id, code, type, libelle, module, active, position) values ( 30,'AC_SUP_ORD','systemauto','Send supplier order by email','order_supplier',0,9);
insert into llx_c_actioncomm (id, code, type, libelle, module, active, position) values ( 31,'AC_SUP_INV','systemauto','Send supplier invoice by email','invoice_supplier',0,7);
insert into llx_c_actioncomm (id, code, type, libelle, module, active, position) values ( 40,'AC_OTH_AUTO','systemauto','Other (automatically inserted events)',NULL, 1, 20);
insert into llx_c_actioncomm (id, code, type, libelle, module, active, position) values ( 50,'AC_OTH','system','Other (manually inserted events)',NULL, 1, 5);

View File

@ -255,9 +255,13 @@ insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (15
insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (1543,154, '10','0','VAT Frontero',1);
-- BARBADOS (id country=46)
INSERT INTO llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) VALUES (461,46, '0','0','No VAT',1);
INSERT INTO llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) VALUES (462,46, '15','0','VAT 15%',1);
INSERT INTO llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) VALUES (463,46, '7.5','0','VAT 7.5%',1);
INSERT INTO llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) VALUES ( 461, 46, '0','0','No VAT',1);
INSERT INTO llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) VALUES ( 462, 46, '15','0','VAT 15%',1);
INSERT INTO llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) VALUES ( 463, 46, '7.5','0','VAT 7.5%',1);
-- SOUTH AFRICA (id country=205)
INSERT INTO llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) VALUES (2051,205, '0','0','No VAT',1);
INSERT INTO llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) VALUES (2052,205, '14','0','VAT 14%',1);
-- VENEZUELA (id country=232)
insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (2321,232, '0','0','No VAT',1);

View File

@ -49,6 +49,11 @@ insert into llx_c_type_contact(rowid, element, source, code, libelle, active ) v
insert into llx_c_type_contact(rowid, element, source, code, libelle, active ) values (72, 'invoice_supplier', 'external', 'SHIPPING', 'Contact fournisseur livraison', 1);
insert into llx_c_type_contact(rowid, element, source, code, libelle, active ) values (73, 'invoice_supplier', 'external', 'SERVICE', 'Contact fournisseur prestation', 1);
insert into llx_c_type_contact(rowid, element, source, code, libelle, active ) values (80, 'agenda', 'internal', 'ACTOR', 'Responsable', 1);
insert into llx_c_type_contact(rowid, element, source, code, libelle, active ) values (81, 'agenda', 'internal', 'GUEST', 'Guest', 1);
insert into llx_c_type_contact(rowid, element, source, code, libelle, active ) values (85, 'agenda', 'external', 'ACTOR', 'Responsable', 1);
insert into llx_c_type_contact(rowid, element, source, code, libelle, active ) values (86, 'agenda', 'external', 'GUEST', 'Guest', 1);
insert into llx_c_type_contact(rowid, element, source, code, libelle, active ) values (91, 'commande','internal', 'SALESREPFOLL', 'Responsable suivi de la commande', 1);
insert into llx_c_type_contact(rowid, element, source, code, libelle, active ) values (100,'commande','external', 'BILLING', 'Contact client facturation commande', 1);
insert into llx_c_type_contact(rowid, element, source, code, libelle, active ) values (101,'commande','external', 'CUSTOMER', 'Contact client suivi commande', 1);

View File

@ -34,6 +34,7 @@ ALTER TABLE llx_societe ADD COLUMN idprof6 varchar(128) after idprof5;
ALTER TABLE llx_societe DROP COLUMN fk_secteur;
ALTER TABLE llx_societe DROP COLUMN description;
ALTER TABLE llx_societe DROP COLUMN services;
ALTER TABLE llx_societe MODIFY COLUMN ref_ext varchar(128);
ALTER TABLE llx_bank ADD COLUMN tms timestamp after datec;
@ -197,6 +198,12 @@ INSERT INTO llx_holiday_config (rowid ,name ,value) VALUES (NULL , 'nbHolidayDed
INSERT INTO llx_holiday_config (rowid ,name ,value) VALUES (NULL , 'nbHolidayEveryMonth', '2.08334');
insert into llx_c_type_contact(rowid, element, source, code, libelle, active ) values (80, 'agenda', 'internal', 'ACTOR', 'Responsable', 1);
insert into llx_c_type_contact(rowid, element, source, code, libelle, active ) values (81, 'agenda', 'internal', 'GUEST', 'Guest', 1);
insert into llx_c_type_contact(rowid, element, source, code, libelle, active ) values (85, 'agenda', 'external', 'ACTOR', 'Responsable', 1);
insert into llx_c_type_contact(rowid, element, source, code, libelle, active ) values (86, 'agenda', 'external', 'GUEST', 'Guest', 1);
DELETE FROM llx_document_model WHERE (nom = 'oursin' AND type ='invoice') OR (nom = 'edison' AND type ='order') OR (nom = 'jaune' AND type ='propal');
ALTER TABLE llx_boxes DROP INDEX uk_boxes;
@ -826,6 +833,11 @@ ALTER TABLE llx_c_typent DROP INDEX code, ADD UNIQUE uk_c_typent (code);
ALTER TABLE llx_c_effectif DROP INDEX code, ADD UNIQUE uk_c_effectif (code);
ALTER TABLE llx_c_paiement DROP INDEX code, ADD UNIQUE uk_c_paiement (code);
delete from llx_c_actioncomm where id = 40;
INSERT INTO llx_c_actioncomm (id, code, type, libelle, module, position) values ( 40, 'AC_OTH_AUTO','systemauto', 'Other (automatically inserted events)' ,NULL, 20);
UPDATE llx_c_actioncomm SET libelle = 'Other (manually inserted events)' WHERE code = 'AC_OTH';
UPDATE llx_c_actioncomm SET active = 0 WHERE code in ('AC_PROP', 'AC_COM', 'AC_FAC', 'AC_SHIP', 'AC_SUP_ORD', 'AC_SUP_INV');
-- Update dictionnary of table llx_c_paper_format
DELETE FROM llx_c_paper_format;
@ -866,4 +878,4 @@ create table llx_user_extrafields
import_key varchar(14) -- import key
)ENGINE=innodb;
ALTER TABLE llx_user_extrafields ADD INDEX idx_user_extrafields (fk_object);
ALTER TABLE llx_user_extrafields ADD INDEX idx_user_extrafields (fk_object);

View File

@ -25,7 +25,7 @@ create table llx_societe
nom varchar(60), -- company reference name
entity integer DEFAULT 1 NOT NULL, -- multi company id
ref_ext varchar(60), -- reference into an external system (not used by dolibarr)
ref_ext varchar(128), -- reference into an external system (not used by dolibarr)
ref_int varchar(60), -- reference into an internal system (used by dolibarr)
statut tinyint DEFAULT 0, -- statut

View File

@ -718,6 +718,20 @@ VATIsNotUsedDesc=El tipus d'IVA proposat per defecte és 0. Aquest és el cas d'
VATIsUsedExampleFR=A França, es tracta de les societats o organismes que trien un règim fiscal general (General simplificat o General normal), règim en el qual es declara l'IVA.
VATIsNotUsedExampleFR=A França, es tracta d'associacions exemptes d'IVA o societats, organismes o professions liberals que han eligedo el règim fiscal de mòduls (IVA en franquícia), pagant un IVA en franquícia sense fer declaració d'IVA. Aquesta elecció fa aparèixer l'anotació "IVA no aplicable - art-293B del CGI" en les factures.
##### Local Taxes #####
LocalTax1IsUsed=Subjecte
LocalTax1IsNotUsed=No subjecte
LocalTax1IsUsedDesc=Ús d'un 2on. tipus d'impost (Diferent de l'IVA)
LocalTax1IsNotUsedDesc=No utilitzar un 2on. tipus d'impost (Diferent de l'IVA)
LocalTax1Management=Gestió 2on. tipus d'impost
LocalTax1IsUsedExample=
LocalTax1IsNotUsedExample=
LocalTax2IsUsed=Subjecte
LocalTax2IsNotUsed=No subjecte
LocalTax2IsUsedDesc=Ús d'un 3er. tipus d'impost (Diferent de l'IVA)
LocalTax2IsNotUsedDesc=No utilitzar un 3er. tipus d'impost (Diferent de l'IVA)
LocalTax2Management=Gestió 2on. tipus d'impost
LocalTax2IsUsedExample=
LocalTax2IsNotUsedExample=
LocalTax1ManagementES=Gestió Recàrrec d'Equivalència
LocalTax1IsUsedDescES=El tipus de RE proposat per defecte en les creacions de pressupostos, factures, comandes, etc. Respon a la següent regla:<br>Si el comprador no està subjecte a RE, RE per defecte= 0. Final de regla.<br>Si el comprador està subjecte a RE aleshores s'aplica valor de RE per defecte. Final de regla.<br>
LocalTax1IsNotUsedDescES=El tipus de RE proposat per defecte es 0. Final de regla.

View File

@ -20,7 +20,6 @@ AddThisArticle=Afegeix aquest article
RestartSelling=Reprendre la venda
SellFinished=Venda acabada
PrintTicket=Imprimir tiquet
NoResults=Cap resultat
NoProductFound=Cap article trobat
ProductFound=Producte trobat
ProductsFound=Productes trobats

View File

@ -81,6 +81,8 @@ ActionAC_SHIP=Enviament expedició per correu
ActionAC_SUP_ORD=Enviament comanda a proveïdor per correu
ActionAC_SUP_INV=Enviament factura de proveïdor per correu
ActionAC_OTH=Altra
ActionAC_MANUAL=Esdeveniments creats manualment
ActionAC_AUTO=Esdeveniments creats automàticament
Stats=Estadístiques de venda
CAOrder=Volum de vendes (Comandes validades)
FromTo=de %s a %s

View File

@ -12,6 +12,7 @@ Language_en_AU=Anglès (Australia)
Language_en_GB=Anglès (Regne Unit)
Language_en_IN=Anglès (Índia)
Language_en_NZ=Anglais (Nova Zelanda)
Language_en_SA=Inglés (Aràbia Saudita)
Language_en_US=Anglès (Estats Units)
Language_es_ES=Espanyol
Language_es_AR=Espanyol (Argentina)

View File

@ -77,6 +77,8 @@ YourMailUnsubcribeOK=El correu electrònic <b>%s</b> és correcta desuscribe.
MailtoEMail=mailto email (hyperlink)
ActivateCheckRead=Activar confirmació de lectura i opció de Desubscripció
ActivateCheckReadKey=Clau usada per xifrar la URL de la confirmació de lectura i la funció de desubscripció
EMailSentToNRecipients=E-Mail enviat a %s destinataris.
# Libelle des modules de liste de destinataires mailing==
MailingModuleDescContactCompanies=Contactes de tercers (clients potencials, clients, proveïdors ...)
MailingModuleDescDolibarrUsers=Usuaris de Dolibarr

View File

@ -627,7 +627,8 @@ ByDay=Per dia
BySalesRepresentative=Per comercial
LinkedToSpecificUsers=Enllaçat a un contacte d'usuari particular
DeleteAFile=Eliminació d'arxiu
ConfirmDeleteAFile=Confirma l'eliminació de l'arxiu
ConfirmDeleteAFile=Confirme l'eliminació de l'arxiu
NoResults=Cap resultat
# Week day
Monday=Dilluns
Tuesday=Dimarts

View File

@ -199,3 +199,6 @@ Collectivités=Col.lectivitats
Particuliers=Particulars
Entreprises=Empreses
DOLIBARRFOUNDATION_PAYMENT_FORM=Per realitzar el pagament de la seva cotització per transferència bancària, visiteu la pàgina <a target="_blank" href="http://wiki.dolibarr.org/index.php/Subscribirse#Para_una_adhesi.C3.B3n_por_transferencia">http://wiki.dolibarr.org/index.php/Subscribirse</a>.<br>Per pagar amb targeta de crèdit o PayPal, feu clic al botó a la part inferior d'aquesta pàgina.<br><br>
ByProperties=Per característiques
MembersStatisticsByProperties=Estadístiques dels membres per característiques
MembersByNature=Membres per naturalesa

View File

@ -93,6 +93,8 @@ CloneFiles=Clonar els arxius adjunts
ConfirmCloneProject=Esteu segur que voleu clonar aquest projecte?
ProjectReportDate=Canviar les dates de les tasques en funció de la data d'inici del projecte
ErrorShiftTaskDate=S'ha produït un error en el canvi de les dates de les tasques
ProjectsAndTasksLines=Projectes i tasques
##### Types de contacts #####
TypeContact_project_internal_PROJECTLEADER=Cap de projecte
TypeContact_project_external_PROJECTLEADER=Cap de projecte

View File

@ -58,6 +58,7 @@ ActionsOnShipping=Events sobre l'expedició
LinkToTrackYourPackage=Enllaç per al seguiment del seu paquet
ShipmentCreationIsDoneFromOrder=De moment, la creació d'una nova expedició es realitza des de la fitxa de comanda.
RelatedShippings=Expedició(ns) associades
ShipmentLine=Línia d'expedició
# Sending methods
SendingMethodCATCH=Recollit pel client

Some files were not shown because too many files have changed in this diff Show More