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

This commit is contained in:
Laurent Destailleur 2013-05-24 18:24:17 +02:00
commit 6e634eb722
29 changed files with 139 additions and 44 deletions

View File

@ -13,6 +13,7 @@ For users:
- New: Add option "filter=bank" onto script rebuild_merge_pdf.php to merge
PDF that has one payment on a specific bank account.*
- New: [ task #901 ] Add Extrafeild on Fiche Inter
- New: Show process id in all command line scripts
For developers:
- New: DolGraph can build graph with three lines.

View File

@ -55,3 +55,15 @@ See page http://www.debian.org/devel/wnpp/#l1 for example of ITP requests conten
- Once package is uploaded, following URL are available:
http://packages.qa.debian.org/package.html
http://bugs.debian.org/package
##########################################################
To use Alioth.debian.org
Create a login
Setup your ssh as described into page: http://wiki.debian.org/Alioth/SSH
Ask to be included into project collab-maint: http://alioth.debian.org/projects/collab-maint/
Then you can git clone tcpdf
git clone git.debian.org:/git/collab-maint/tcpdf.git

View File

@ -34,7 +34,7 @@ if (substr($sapi_type, 0, 3) == 'cgi') {
exit;
}
// Init global variables
// Global variables
$version='1.0';
$error=0;
@ -57,7 +57,7 @@ if (! $result > 0) { dol_print_error('',$user->error); exit; }
$user->getrights();
print "***** ".$script_file." (".$version.") *****\n";
print "***** ".$script_file." (".$version.") pid=".getmypid()." *****\n";
if (! isset($argv[1])) { // Check parameters
print "Usage: ".$script_file." param1 param2 ...\n";
exit;

View File

@ -189,6 +189,23 @@ else if ($action == 'set_FICHINTER_DRAFT_WATERMARK')
}
}
elseif ($action == 'set_FICHINTER_PRINT_PRODUCTS')
{
$val = GETPOST('FICHINTER_PRINT_PRODUCTS','alpha');
$res = dolibarr_set_const($db, "FICHINTER_PRINT_PRODUCTS",($val == 'on'),'bool',0,'',$conf->entity);
if (! $res > 0) $error++;
if (! $error)
{
$mesg = "<font class=\"ok\">".$langs->trans("SetupSaved")."</font>";
}
else
{
$mesg = "<font class=\"error\">".$langs->trans("Error")."</font>";
}
}
/*
* View
@ -469,6 +486,22 @@ print '<input size="50" class="flat" type="text" name="FICHINTER_DRAFT_WATERMARK
print '</td><td align="right">';
print '<input type="submit" class="button" value="'.$langs->trans("Modify").'">';
print "</td></tr>\n";
// print products on fichinter
$var=! $var;
print '<form action="'.$_SERVER["PHP_SELF"].'" method="post">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<input type="hidden" name="action" value="set_FICHINTER_PRINT_PRODUCTS">';
print '<tr '.$bc[$var].'><td>';
print $langs->trans("PrintProductsOnFichinter").' ('.$langs->trans("PrintProductsOnFichinterDetails").')</td>';
print '<td align="center"><input type="checkbox" name="FICHINTER_PRINT_PRODUCTS" ';
if ($conf->global->FICHINTER_PRINT_PRODUCTS)
print 'checked="checked" ';
print '/>';
print '</td><td align="right">';
print '<input type="submit" class="button" value="'.$langs->trans("Modify").'">';
print "</td></tr>\n";
print '</form>';

View File

@ -1,7 +1,7 @@
<?php
/* Copyright (C) 2007-2010 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2007-2010 Jean Heimburger <jean@tiaris.info>
* Copyright (C) 2011 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2011-2013 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2012 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2011-2012 Alexandre spangaro <alexandre.spangaro@gmail.com>
* Copyright (C) 2013 Marcos García <marcosgdf@gmail.com>
@ -225,7 +225,7 @@ foreach ($tabfac as $key => $val)
{
print "<tr ".$bc[$var]." >";
//print "<td>".$conf->global->COMPTA_JOURNAL_BUY."</td>";
print "<td>".$val["date"]."</td>";
print "<td>".dol_print_date($val["date"])."</td>";
print "<td>".$invoicestatic->getNomUrl(1)."</td>";
print "<td>".$k."</td><td>".$line['label']."</td>";

View File

@ -1,7 +1,7 @@
<?php
/* Copyright (C) 2007-2010 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2007-2010 Jean Heimburger <jean@tiaris.info>
* Copyright (C) 2011 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2011-2013 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2012 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2011-2012 Alexandre Spangaro <alexandre.spangaro@gmail.com>
* Copyright (C) 2013 Marcos García <marcosgdf@gmail.com>
@ -236,7 +236,7 @@ foreach ($tabfac as $key => $val)
{
print "<tr ".$bc[$var]." >";
//print "<td>".$conf->global->COMPTA_JOURNAL_SELL."</td>";
print "<td>".$val["date"]."</td>";
print "<td>".dol_print_date($val["date"])."</td>";
print "<td>".$invoicestatic->getNomUrl(1)."</td>";
print "<td>".$k."</td><td>".$line['label']."</td>";

View File

@ -3913,6 +3913,11 @@ class Form
if ($object->photo) $file=get_exdir($id, 2).'photos/'.$object->photo;
if (! empty($conf->global->MAIN_OLD_IMAGE_LINKS)) $altfile=$object->id.".jpg"; // For backward compatibility
$email=$object->email;
}else {
$dir=$conf->$modulepart->dir_output;
if ($object->photo) $file=get_exdir($id, 2).'photos/'.$object->photo;
if (! empty($conf->global->MAIN_OLD_IMAGE_LINKS)) $altfile=$object->id.".jpg"; // For backward compatibility
$email=$object->email;
}
if ($dir)

View File

@ -60,15 +60,15 @@ function societe_prepare_head($object)
$head[$h][2] = 'supplier';
$h++;
}
if (! empty($conf->agenda->enabled) && !empty($user->right->agenda->lire))
{
if (! empty($conf->agenda->enabled) && (!empty($user->rights->agenda->myactions->read) || !empty($user->rights->agenda->allactions->read) ))
{
$head[$h][0] = DOL_URL_ROOT.'/societe/agenda.php?socid='.$object->id;
$head[$h][1] = $langs->trans("Agenda");
$head[$h][2] = 'agenda';
$h++;
}
//show categorie tab
if (! empty($conf->categorie->enabled) && !empty($user->right->categorie->lire))
if (! empty($conf->categorie->enabled) && ! empty($user->rights->categorie->lire))
{
$type = 2;
if ($object->fournisseur) $type = 1;

View File

@ -611,7 +611,10 @@ function get_next_value($db,$mask,$table,$field,$where='',$objsoc='',$date='',$m
if ($maskraz > 0) // A reset is required
{
if ($maskraz == 99) $maskraz = date('m');
if ($maskraz == 99) {
$maskraz = date('m');
$resetEveryMonth = true;
}
if ($maskraz > 12) return 'ErrorBadMaskBadRazMonth';
// Define posy, posm and reg
@ -653,13 +656,13 @@ function get_next_value($db,$mask,$table,$field,$where='',$objsoc='',$date='',$m
else if ($date >= $newyeardate && $yearoffsettype == '-') $yearoffset=-1;
}
// For backward compatibility
else if (date("m",$date) < $maskraz) { $yearoffset=-1; } // If current month lower that month of return to zero, year is previous year
else if (date("m",$date) < $maskraz && empty($resetEveryMonth)) { $yearoffset=-1; } // If current month lower that month of return to zero, year is previous year
$yearlen = dol_strlen($reg[$posy]);
if ($yearlen == 4) $yearcomp=sprintf("%04d",date("Y",$date)+$yearoffset);
elseif ($yearlen == 2) $yearcomp=sprintf("%02d",date("y",$date)+$yearoffset);
elseif ($yearlen == 1) $yearcomp=substr(date("y",$date),2,1)+$yearoffset;
if ($monthcomp > 1) // Test with month is useless if monthcomp = 0 or 1 (0 is same as 1) (regis: $monthcomp can't equal 0)
if ($monthcomp > 1 && empty($resetEveryMonth)) // Test with month is useless if monthcomp = 0 or 1 (0 is same as 1) (regis: $monthcomp can't equal 0)
{
if ($yearlen == 4) $yearcomp1=sprintf("%04d",date("Y",$date)+$yearoffset+1);
elseif ($yearlen == 2) $yearcomp1=sprintf("%02d",date("y",$date)+$yearoffset+1);
@ -680,6 +683,17 @@ function get_next_value($db,$mask,$table,$field,$where='',$objsoc='',$date='',$m
$sqlwhere.=" AND SUBSTRING(".$field.", ".$monthpos.", ".$monthlen.") < '".str_pad($monthcomp, $monthlen, '0', STR_PAD_LEFT)."') ";
$sqlwhere.=')';
}
else if($resetEveryMonth) {
$monthlen = dol_strlen($reg[$posm]);
$yearpos = (dol_strlen($reg[1])+1);
$monthpos = ($yearpos+$yearlen);
if ($posy == 3) {
$monthpos = (dol_strlen($reg[1])+1);
$yearpos = ($monthpos+$monthlen);
}
$sqlwhere.=" SUBSTRING(".$field.", ".$yearpos.", ".$yearlen.") = '".$yearcomp."'";
$sqlwhere.=" AND SUBSTRING(".$field.", ".$monthpos.", ".$monthlen.") = '".str_pad($monthcomp, $monthlen, '0', STR_PAD_LEFT)."' ";
}
else // reset is done on january
{
$sqlwhere.='(SUBSTRING('.$field.', '.(dol_strlen($reg[1])+1).', '.dol_strlen($reg[2]).") = '".$yearcomp."')";

View File

@ -178,7 +178,7 @@ else if ($action == 'add' && $user->rights->ficheinter->creer)
$object->linked_objects = array_merge($object->linked_objects, $_POST['other_linked_objects']);
}
$id = $object->create();
$id = $object->create($user);
if ($id > 0)
{
@ -202,12 +202,10 @@ else if ($action == 'add' && $user->rights->ficheinter->creer)
{
$product_type=($lines[$i]->product_type?$lines[$i]->product_type:0);
if ($product_type == 1) { //only services
if ($product_type == 1 || !empty($conf->global->FICHINTER_PRINT_PRODUCTS)) { //only services except if config includes products
// service prédéfini
if ($lines[$i]->fk_product > 0)
{
$product_static = new Product($db);
// Define output language
if (! empty($conf->global->MAIN_MULTILANGS) && ! empty($conf->global->PRODUIT_TEXTS_IN_THIRDPARTY_LANGUAGE))
{
@ -230,15 +228,8 @@ else if ($action == 'add' && $user->rights->ficheinter->creer)
$label = $lines[$i]->product_label;
}
$product_static->type=$lines[$i]->fk_product_type;
$product_static->id=$lines[$i]->fk_product;
$product_static->ref=$lines[$i]->ref;
$product_static->libelle=$label;
$desc=$product_static->getNomUrl(0);
$desc.= ' - '.$label;
$desc = $label;
$desc .= ' ('.$langs->trans('Quantity').': '.$lines[$i]->qty.')';
if ($conf->global->PRODUIT_DESC_IN_FORM)
$desc .= ($lines[$i]->desc && $lines[$i]->desc!=$lines[$i]->libelle)?'<br>'.dol_htmlentitiesbr($lines[$i]->desc):'';
}
else {
$desc = dol_htmlentitiesbr($lines[$i]->desc);
@ -246,7 +237,14 @@ else if ($action == 'add' && $user->rights->ficheinter->creer)
}
$timearray=dol_getdate(mktime());
$date_intervention=dol_mktime(0,0,0,$timearray['mon'],$timearray['mday'],$timearray['year']);
$duration = 3600;
if ($product_type == 1)
{ //service
$duration = 3600;
}
else
{ //product
$duration = 0;
}
$result = $object->addline(
$user,
@ -1621,7 +1619,7 @@ else if ($id > 0 || ! empty($ref))
$somethingshown=$object->showLinkedObjectBlock();
//print '</td><td valign="top" width="50%">';
print '</div><div class="fichehalfright"><div class="ficheaddleft">';
print '</div><div class="fichehalfright"><div class="ficheaddleft">';
// List of actions on element
include_once DOL_DOCUMENT_ROOT.'/core/class/html.formactions.class.php';

View File

@ -39,3 +39,5 @@ ArcticNumRefModelDesc1=Generic number model
ArcticNumRefModelError=Failed to activate
PacificNumRefModelDesc1=Return numero with format %syymm-nnnn where yy is year, mm is month and nnnn is a sequence with no break and no return to 0
PacificNumRefModelError=An intervention card starting with $syymm already exists and is not compatible with this model of sequence. Remove it or rename it to activate this module.
PrintProductsOnFichinter=Print products on intervention card
PrintProductsOnFichinterDetails=forinterventions generated from orders

View File

@ -52,3 +52,5 @@ PacificNumRefModelDesc1=Renvoie le numéro sous la forme %syymm-nnnn où yy est
PacificNumRefModelError=Une facture commençant par $syymm existe en base et est incompatible avec cette numérotation. Supprimez la ou renommez la pour activer ce module.
SendInterventionByMail=Envoi de la fiche d'intervention par mail
SendInterventionRef=Envoi Intervention %s
PrintProductsOnFichinter=Afficher les produits sur la fiche d'intervention
PrintProductsOnFichinterDetails=pour les interventions générées à partir des commandes

View File

@ -59,7 +59,7 @@ $error=0;
*/
@set_time_limit(0);
print "***** ".$script_file." (".$version.") *****\n";
print "***** ".$script_file." (".$version.") pid=".getmypid()." *****\n";
if (! isset($argv[3]) || ! $argv[3]) {
print "Usage: $script_file bank_ref bank_receipt_number (csv|tsv|excel|excel2007) [lang=xx_XX]\n";

View File

@ -59,7 +59,7 @@ $error=0;
*/
@set_time_limit(0);
print "***** ".$script_file." (".$version.") *****\n";
print "***** ".$script_file." (".$version.") pid=".getmypid()." *****\n";
$fname = DOL_DATA_ROOT.'/export-contacts.xls';

View File

@ -56,7 +56,7 @@ $error=0;
*/
@set_time_limit(0);
print "***** ".$script_file." (".$version.") *****\n";
print "***** ".$script_file." (".$version.") pid=".getmypid()." *****\n";
print "Mails sending disabled (useless in batch mode)\n";
$conf->global->MAIN_DISABLE_ALL_MAILS=1; // On bloque les mails

View File

@ -65,13 +65,15 @@ $error=0;
*/
@set_time_limit(0);
print "***** ".$script_file." (".$version.") *****\n";
print "***** ".$script_file." (".$version.") pid=".getmypid()." *****\n";
$now=dol_now('tzserver');
$duration_value=isset($argv[2])?$argv[2]:'none';
print $script_file." launched with mode ".$mode.(is_numeric($duration_value)?" delay=".$duration_value:"")."\n";
if ($mode != 'confirm') $conf->global->MAIN_DISABLE_ALL_MAILS=1;
$sql = "SELECT DISTINCT s.nom as name, c.ref, cd.date_fin_validite, cd.total_ttc, p.label label, s.email, s.default_lang";
$sql .= " FROM ".MAIN_DB_PREFIX."societe AS s";
$sql .= ", ".MAIN_DB_PREFIX."contrat AS c";
@ -243,6 +245,11 @@ function envoi_mail($mode,$oldemail,$message,$total,$userlang,$oldcustomer,$dura
if ($mode == 'confirm')
{
$result=$mail->sendfile();
if (! $result)
{
print "Error sending email ".$mail->error."\n";
dol_syslog("Error sending email ".$mail->error."\n");
}
}
else
{

View File

@ -65,13 +65,15 @@ $error=0;
*/
@set_time_limit(0);
print "***** ".$script_file." (".$version.") *****\n";
print "***** ".$script_file." (".$version.") pid=".getmypid()." *****\n";
$now=dol_now('tzserver');
$duration_value=isset($argv[2])?$argv[2]:'none';
print $script_file." launched with mode ".$mode.(is_numeric($duration_value)?" delay=".$duration_value:"")."\n";
if ($mode != 'confirm') $conf->global->MAIN_DISABLE_ALL_MAILS=1;
$sql = "SELECT DISTINCT s.nom, c.ref, cd.date_fin_validite, cd.total_ttc, p.label label, c.fk_soc,u.rowid AS uid, u.lastname, u.firstname, u.email, u.lang";
$sql .= " FROM ".MAIN_DB_PREFIX."societe AS s, ".MAIN_DB_PREFIX."contrat AS c, ".MAIN_DB_PREFIX."contratdet AS cd";
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."product AS p ON p.rowid = cd.fk_product, ".MAIN_DB_PREFIX."societe_commerciaux AS sc, ".MAIN_DB_PREFIX."user AS u";
@ -242,6 +244,11 @@ function envoi_mail($mode,$oldemail,$message,$total,$userlang,$oldsalerepresenta
if ($mode == 'confirm')
{
$result=$mail->sendfile();
if (! $result)
{
print "Error sending email ".$mail->error."\n";
dol_syslog("Error sending email ".$mail->error."\n");
}
}
else
{

View File

@ -69,7 +69,7 @@ $error=0;
*/
@set_time_limit(0);
print "***** ".$script_file." (".$version.") *****\n";
print "***** ".$script_file." (".$version.") pid=".getmypid()." *****\n";
// Check security key
if ($key != $conf->global->CRON_KEY)

View File

@ -56,7 +56,7 @@ $error=0;
*/
@set_time_limit(0);
print "***** ".$script_file." (".$version.") *****\n";
print "***** ".$script_file." (".$version.") pid=".getmypid()." *****\n";

View File

@ -65,7 +65,7 @@ $error=0;
*/
@set_time_limit(0);
print "***** ".$script_file." (".$version.") *****\n";
print "***** ".$script_file." (".$version.") pid=".getmypid()." *****\n";
$now=dol_now('tzserver');
$duration_value=isset($argv[3])?$argv[3]:'none';
@ -73,6 +73,8 @@ $duration_value=isset($argv[3])?$argv[3]:'none';
$error = 0;
print $script_file." launched with mode ".$mode.(is_numeric($duration_value)?" delay=".$duration_value:"")."\n";
if ($mode != 'confirm') $conf->global->MAIN_DISABLE_ALL_MAILS=1;
$sql = "SELECT f.facnumber, f.total_ttc, f.date_lim_reglement as due_date,";
$sql.= " s.rowid as sid, s.nom as name, s.email, s.default_lang";
if ($targettype == 'contacts') $sql.= ", sp.rowid as cid, sp.firstname as cfirstname, sp.lastname as clastname, sp.email as cemail";
@ -262,6 +264,11 @@ function envoi_mail($mode,$oldemail,$message,$total,$userlang,$oldtarget)
if ($mode == 'confirm')
{
$result=$mail->sendfile();
if (! $result)
{
print "Error sending email ".$mail->error."\n";
dol_syslog("Error sending email ".$mail->error."\n");
}
}
else
{

View File

@ -65,13 +65,15 @@ $error=0;
*/
@set_time_limit(0);
print "***** ".$script_file." (".$version.") *****\n";
print "***** ".$script_file." (".$version.") pid=".getmypid()." *****\n";
$now=dol_now('tzserver');
$duration_value=isset($argv[2])?$argv[2]:'none';
print $script_file." launched with mode ".$mode.(is_numeric($duration_value)?" delay=".$duration_value:"")."\n";
if ($mode != 'confirm') $conf->global->MAIN_DISABLE_ALL_MAILS=1;
$sql = "SELECT f.facnumber, f.total_ttc, f.date_lim_reglement as due_date, s.nom as name, u.rowid as uid, u.lastname, u.firstname, u.email, u.lang";
$sql .= " FROM ".MAIN_DB_PREFIX."facture as f";
$sql .= " , ".MAIN_DB_PREFIX."societe as s";
@ -173,7 +175,7 @@ else
* @param string $total Total amount of unpayed invoices
* @param string $userlang Code lang to use for email output.
* @param string $oldsalerepresentative Old sale representative
* @return int <0 if KO, >0 if OK
* @return int <0 if KO, >0 if OK
*/
function envoi_mail($mode,$oldemail,$message,$total,$userlang,$oldsalerepresentative)
{
@ -237,6 +239,11 @@ function envoi_mail($mode,$oldemail,$message,$total,$userlang,$oldsalerepresenta
if ($mode == 'confirm')
{
$result=$mail->sendfile();
if (! $result)
{
print "Error sending email ".$mail->error."\n";
dol_syslog("Error sending email ".$mail->error."\n");
}
}
else
{

View File

@ -56,7 +56,7 @@ $error=0;
*/
@set_time_limit(0);
print "***** ".$script_file." (".$version.") *****\n";
print "***** ".$script_file." (".$version.") pid=".getmypid()." *****\n";
// Check parameters
if (! isset($argv[1]))

View File

@ -51,7 +51,7 @@ $error=0;
*/
@set_time_limit(0);
print "***** ".$script_file." (".$version.") *****\n";
print "***** ".$script_file." (".$version.") pid=".getmypid()." *****\n";
if (! isset($argv[1]) || ! $argv[1]) {
print "Usage: $script_file now\n";

View File

@ -56,7 +56,7 @@ $forcecommit=0;
*/
@set_time_limit(0);
print "***** ".$script_file." (".$version.") *****\n";
print "***** ".$script_file." (".$version.") pid=".getmypid()." *****\n";
// List of fields to get from LDAP
$required_fields = array(

View File

@ -54,7 +54,7 @@ $error=0;
*/
@set_time_limit(0);
print "***** ".$script_file." (".$version.") *****\n";
print "***** ".$script_file." (".$version.") pid=".getmypid()." *****\n";
/*
if (! $conf->global->LDAP_SYNCHRO_ACTIVE)

View File

@ -56,7 +56,7 @@ $forcecommit=0;
*/
@set_time_limit(0);
print "***** ".$script_file." (".$version.") *****\n";
print "***** ".$script_file." (".$version.") pid=".getmypid()." *****\n";
// List of fields to get from LDAP

View File

@ -54,7 +54,7 @@ $error=0;
*/
@set_time_limit(0);
print "***** ".$script_file." (".$version.") *****\n";
print "***** ".$script_file." (".$version.") pid=".getmypid()." *****\n";
/*
if (! $conf->global->LDAP_SYNCHRO_ACTIVE)

View File

@ -54,7 +54,7 @@ $forcecommit=0;
*/
@set_time_limit(0);
print "***** ".$script_file." (".$version.") *****\n";
print "***** ".$script_file." (".$version.") pid=".getmypid()." *****\n";
// List of fields to get from LDAP
$required_fields = array(

View File

@ -50,7 +50,7 @@ $error=0;
*/
@set_time_limit(0);
print "***** ".$script_file." (".$version.") *****\n";
print "***** ".$script_file." (".$version.") pid=".getmypid()." *****\n";
$datetimeprev = time();