Merge branch 'develop' of https://github.com/Dolibarr/dolibarr.git into develop
This commit is contained in:
commit
a2368daa57
@ -39,7 +39,13 @@ END
|
||||
|
||||
|
||||
# To use Alioth.debian.org
|
||||
* Create a login
|
||||
* Create an account login
|
||||
* Update your ~/.ssh/config file to add:
|
||||
Host svn.debian.org git.debian.org bzr.debian.org hg.debian.org darcs.debian.org arch.debian.org
|
||||
User eldy-guest
|
||||
IdentityFile ~/.ssh/id_rsa
|
||||
* Check login on page https://alioth.debian.org/users/login
|
||||
Ex: https://alioth.debian.org/users/eldy-guest
|
||||
* 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/
|
||||
|
||||
@ -192,8 +198,7 @@ To update dolibarr debian package
|
||||
* You can git clone debian git repo
|
||||
> git clone git.debian.org:/git/collab-maint/dolibarr.git [dolibarr-debian]
|
||||
or better
|
||||
> mkdir gitdebian
|
||||
> cd gitdebian
|
||||
> cd ~; mkdir git-debian; cd git-debian
|
||||
> gbp-clone git.debian.org:/git/collab-maint/dolibarr.git
|
||||
|
||||
* You can then create a PHP project from Eclipse called dolibarr-debian
|
||||
|
||||
File diff suppressed because one or more lines are too long
@ -13,7 +13,7 @@ then
|
||||
echo "This push local files to transifex."
|
||||
echo "Note: If you push a language file (not source), file will be skipped if transifex file is newer."
|
||||
echo " Using -f will overwrite translation but not memory."
|
||||
echo "Usage: txpush.sh (source|all|xx_XX) [-r dolibarr.file] [-f] [--skip] [--no-interactive]"
|
||||
echo "Usage: txpush.sh (source|all|xx_XX) [-r dolibarr.file] [-f] [--no-interactive]"
|
||||
exit
|
||||
fi
|
||||
|
||||
@ -22,8 +22,8 @@ if [ "x$1" = "xall" ]
|
||||
then
|
||||
for fic in ar_SA bg_BG ca_ES da_DK de_DE el_GR es_ES et_EE fa_IR fi_FI fr_FR he_IL hu_HU is_IS it_IT ja_JP ko_KR nb_NO nl_NL pl_PL pt_PT ro_RO ru_RU ru_UA sl_SI sv_SE tr_TR vi_VN zh_CN zh_TW
|
||||
do
|
||||
echo "tx push -t -l $fic $2 $3"
|
||||
tx push -t -l $fic $2 $3
|
||||
echo "tx push --skip -t -l $fic $2 $3"
|
||||
tx push --skip -t -l $fic $2 $3
|
||||
done
|
||||
else
|
||||
if [ "x$1" = "xsource" ]
|
||||
@ -31,7 +31,7 @@ then
|
||||
echo "tx push -s $2 $3"
|
||||
tx push -s $2 $3
|
||||
else
|
||||
echo "tx push -t -l $1 $2 $3 $4"
|
||||
tx push -t -l $1 $2 $3 $4
|
||||
echo "tx push --skip -t -l $1 $2 $3 $4"
|
||||
tx push --skip -t -l $1 $2 $3 $4
|
||||
fi
|
||||
fi
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/* Copyright (C) 2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2005-2012 Laurent Destailleur <eldy@users.sourceforge.org>
|
||||
* Copyright (C) 2005-2013 Laurent Destailleur <eldy@users.sourceforge.org>
|
||||
* Copyright (C) 2011-2013 Juanjo Menent <jmenent@2byte.es>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
@ -40,15 +40,6 @@ $action = GETPOST('action','alpha');
|
||||
* Actions
|
||||
*/
|
||||
|
||||
if ($action == 'setMAILING_EMAIL_UNSUBSCRIBE')
|
||||
{
|
||||
$res=dolibarr_set_const($db, "MAILING_EMAIL_UNSUBSCRIBE",1,'chaine',0,'',$conf->entity);
|
||||
}
|
||||
if ($action == 'unsetMAILING_EMAIL_UNSUBSCRIBE')
|
||||
{
|
||||
$res=dolibarr_del_const($db, "MAILING_EMAIL_UNSUBSCRIBE");
|
||||
}
|
||||
|
||||
if ($action == 'setvalue')
|
||||
{
|
||||
$db->begin();
|
||||
@ -62,22 +53,8 @@ if ($action == 'setvalue')
|
||||
if (! $res > 0) $error++;
|
||||
$res=dolibarr_set_const($db, "MAILING_EMAIL_ERRORSTO",$mailerror,'chaine',0,'',$conf->entity);
|
||||
if (! $res > 0) $error++;
|
||||
if ($checkread=='on')
|
||||
{
|
||||
$res=dolibarr_set_const($db, "MAILING_EMAIL_UNSUBSCRIBE",1,'chaine',0,'',$conf->entity);
|
||||
if (! $res > 0) $error++;
|
||||
}
|
||||
else if ($checkread=='off')
|
||||
{
|
||||
$res=dolibarr_set_const($db, "MAILING_EMAIL_UNSUBSCRIBE",0,'chaine',0,'',$conf->entity);
|
||||
if (! $res > 0) $error++;
|
||||
}
|
||||
|
||||
//Create temporary encryption key if nedded
|
||||
if (($conf->global->MAILING_EMAIL_UNSUBSCRIBE==1) && (empty($checkread_key)))
|
||||
{
|
||||
$checkread_key=getRandomPassword(true);
|
||||
}
|
||||
// Create temporary encryption key if nedded
|
||||
$res=dolibarr_set_const($db, "MAILING_EMAIL_UNSUBSCRIBE_KEY",$checkread_key,'chaine',0,'',$conf->entity);
|
||||
if (! $res > 0) $error++;
|
||||
|
||||
@ -157,32 +134,13 @@ print '<input size="32" type="text" name="MAILING_EMAIL_ERRORSTO" value="'.$conf
|
||||
if (!empty($conf->global->MAILING_EMAIL_ERRORSTO) && ! isValidEmail($conf->global->MAILING_EMAIL_ERRORSTO)) print ' '.img_warning($langs->trans("BadEMail"));
|
||||
print '</td></tr>';
|
||||
|
||||
// TODO the precedent values are deleted after turn on this switch
|
||||
$var=!$var;
|
||||
print '<tr '.$bc[$var].'><td>';
|
||||
print $langs->trans("ActivateCheckRead").'</td><td>';
|
||||
if (!empty($conf->global->MAILING_EMAIL_UNSUBSCRIBE))
|
||||
{
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=unsetMAILING_EMAIL_UNSUBSCRIBE">';
|
||||
print img_picto($langs->trans("Enabled"),'switch_on');
|
||||
print '</a>';
|
||||
$readonly='';
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=setMAILING_EMAIL_UNSUBSCRIBE">';
|
||||
print img_picto($langs->trans("Disabled"),'switch_off');
|
||||
print '</a>';
|
||||
$readonly='disabled="disabled"';
|
||||
}
|
||||
print '</td></tr>';
|
||||
|
||||
// Constant to add salt into the unsubscribe and check read tag.
|
||||
// It is also used as a security key parameter.
|
||||
$var=!$var;
|
||||
print '<tr '.$bc[$var].'><td>';
|
||||
print $langs->trans("ActivateCheckReadKey").'</td><td>';
|
||||
print '<input size="32" type="text" name="MAILING_EMAIL_UNSUBSCRIBE_KEY" id="MAILING_EMAIL_UNSUBSCRIBE_KEY" '.$readonly.' value="'.$conf->global->MAILING_EMAIL_UNSUBSCRIBE_KEY.'">';
|
||||
if (! empty($conf->use_javascript_ajax))
|
||||
print ' '.img_picto($langs->trans('Generate'), 'refresh', 'id="generate_token" class="linkobject"');
|
||||
print '<input size="32" type="text" name="MAILING_EMAIL_UNSUBSCRIBE_KEY" id="MAILING_EMAIL_UNSUBSCRIBE_KEY" value="'.$conf->global->MAILING_EMAIL_UNSUBSCRIBE_KEY.'">';
|
||||
if (! empty($conf->use_javascript_ajax)) print ' '.img_picto($langs->trans('Generate'), 'refresh', 'id="generate_token" class="linkobject"');
|
||||
print '</td></tr>';
|
||||
|
||||
print '</table>';
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/* Copyright (C) 2011 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2013 Juanjo Menent <jmenent@2byte.es>
|
||||
/* Copyright (C) 2011-2013 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2013 Juanjo Menent <jmenent@2byte.es>
|
||||
*
|
||||
* 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
|
||||
@ -196,13 +196,14 @@ print '</tr>';
|
||||
|
||||
print '</table>';
|
||||
|
||||
dol_fiche_end();
|
||||
|
||||
print '<center>';
|
||||
print '<br><center>';
|
||||
print '<input type="submit" class="button" name="button" value="'.$langs->trans("Modify").'">';
|
||||
print '</center>';
|
||||
|
||||
print '</form><br>';
|
||||
print '</form>';
|
||||
|
||||
dol_fiche_end();
|
||||
|
||||
|
||||
$db->close();
|
||||
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
<?php
|
||||
/* Copyright (C) 2004-2013 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
* Copyright (C) 2013 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2013 Juanjo Menent <jmenent@2byte.es>
|
||||
*
|
||||
* 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
|
||||
@ -327,7 +327,7 @@ dol_fiche_end();
|
||||
// Form to test upload
|
||||
print '<br>';
|
||||
$formfile=new FormFile($db);
|
||||
$formfile->form_attach_new_file($_SERVER['PHP_SELF'], $langs->trans("FormToTestFileUploadForm"), 0, 0, 1);
|
||||
$formfile->form_attach_new_file($_SERVER['PHP_SELF'], $langs->trans("FormToTestFileUploadForm"), 0, 0, 1, 50, '', '', 1, '', 0);
|
||||
|
||||
// List of document
|
||||
$filearray=dol_dir_list($upload_dir, "files", 0, '', '', 'name', SORT_ASC, 1);
|
||||
|
||||
@ -105,6 +105,11 @@ $url='http://wiki.dolibarr.org/index.php/Subscribe';
|
||||
if (preg_match('/^fr_/i',$langs->getDefaultLang())) $url='http://wiki.dolibarr.org/index.php/Adh%C3%A9rer';
|
||||
if (preg_match('/^es_/i',$langs->getDefaultLang())) $url='http://wiki.dolibarr.org/index.php/Subscribirse';
|
||||
print '<li><a href="'.$url.'" target="_blank">'.$langs->trans("SubscribeToFoundation").'</a></li>';
|
||||
|
||||
print '<li><a href="http://facebook.com/dolibarr" target="_blank">FaceBook</a></li>';
|
||||
print '<li><a href="http://twitter.com/dolibarr" target="_blank">Twitter</a></li>';
|
||||
print '<li><a href="http://plus.google.com/+DolibarrOrg" target="_blank">Google Plus page</a></li>';
|
||||
|
||||
print '</ul>';
|
||||
|
||||
|
||||
|
||||
@ -1,12 +1,12 @@
|
||||
<?php
|
||||
/* Copyright (C) 2001-2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2004-2011 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2004-2013 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2004 Eric Seigne <eric.seigne@ryxeo.com>
|
||||
* Copyright (C) 2006 Andre Cianfarani <acianfa@free.fr>
|
||||
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
* Copyright (C) 2008 Raphael Bertrand (Resultic) <raphael.bertrand@resultic.fr>
|
||||
* Copyright (C) 2010-2012 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2013 Alexandre Spangaro <alexandre.spangaro@gmail.com>
|
||||
* Copyright (C) 2010-2013 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2013 Alexandre Spangaro <alexandre.spangaro@gmail.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@ -198,7 +198,7 @@ if ($id > 0)
|
||||
|
||||
print '<div class="fichecenter"><div class="fichehalfleft">';
|
||||
|
||||
|
||||
|
||||
print '<table class="border" width="100%">';
|
||||
|
||||
print '<tr><td width="30%">'.$langs->trans("ThirdPartyName").'</td><td width="70%" colspan="3">';
|
||||
@ -272,7 +272,7 @@ if ($id > 0)
|
||||
{
|
||||
print '<td>'.$langs->trans('Skype').'</td><td colspan="3">'.dol_print_skype($object->skype,0,$object->id,'AC_SKYPE').'</td></tr>';
|
||||
}
|
||||
|
||||
|
||||
// Assujeti a TVA ou pas
|
||||
print '<tr>';
|
||||
print '<td class="nowrap">'.$langs->trans('VATIsUsed').'</td><td colspan="3">';
|
||||
@ -389,7 +389,7 @@ if ($id > 0)
|
||||
print '<td>';
|
||||
print $form->editfieldkey("OutstandingBill",'OutstandingBill',$object->outstanding_limit,$object,$user->rights->societe->creer);
|
||||
print '</td><td colspan="3">';
|
||||
print $form->editfieldval("OutstandingBill",'OutstandingBill',$object->outstanding_limit,$object,$user->rights->societe->creer);
|
||||
print $form->editfieldval("OutstandingBill",'OutstandingBill',$object->outstanding_limit,$object,$user->rights->societe->creer,'amount',($object->outstanding_limit != '' ? price($object->outstanding_limit) : ''));
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
}
|
||||
|
||||
@ -67,13 +67,10 @@ $object->substitutionarray=array(
|
||||
'__OTHER4__' => 'Other4',
|
||||
'__OTHER5__' => 'Other5',
|
||||
'__SIGNATURE__' => 'TagSignature',
|
||||
'__CHECK_READ__' => 'TagCheckMail'
|
||||
'__CHECK_READ__' => 'TagCheckMail',
|
||||
'__UNSUBSCRIBE__' => 'TagUnsubscribe'
|
||||
//,'__PERSONALIZED__' => 'Personalized' // Hidden because not used yet
|
||||
);
|
||||
if (! empty($conf->global->MAILING_EMAIL_UNSUBSCRIBE))
|
||||
{
|
||||
$object->substitutionarray=array_merge($object->substitutionarray, array('__UNSUBSCRIBE__' => 'TagUnsubscribe'));
|
||||
}
|
||||
|
||||
$object->substitutionarrayfortest=array(
|
||||
'__ID__' => 'TESTIdRecord',
|
||||
@ -86,19 +83,12 @@ $object->substitutionarrayfortest=array(
|
||||
'__OTHER3__' => 'TESTOther3',
|
||||
'__OTHER4__' => 'TESTOther4',
|
||||
'__OTHER5__' => 'TESTOther5',
|
||||
'__SIGNATURE__' => (($user->signature && empty($conf->global->MAIN_MAIL_DO_NOT_USE_SIGN))?$user->signature:'')
|
||||
//,'__PERSONALIZED__' => 'TESTPersonalized' // Not used yet
|
||||
'__SIGNATURE__' => (($user->signature && empty($conf->global->MAIN_MAIL_DO_NOT_USE_SIGN))?$user->signature:''),
|
||||
'__CHECK_READ__' => 'TagCheckMail',
|
||||
'__UNSUBSCRIBE__' => 'TagUnsubscribe'
|
||||
//,'__PERSONALIZED__' => 'TESTPersonalized' // Not used yet
|
||||
);
|
||||
if (!empty($conf->global->MAILING_EMAIL_UNSUBSCRIBE))
|
||||
{
|
||||
$object->substitutionarrayfortest=array_merge(
|
||||
$object->substitutionarrayfortest,
|
||||
array(
|
||||
'__CHECK_READ__' => 'TESTCheckMail',
|
||||
'__UNSUBSCRIBE__' => 'TESTUnsubscribe'
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Actions
|
||||
@ -221,8 +211,8 @@ if ($action == 'sendallconfirmed' && $confirm == 'yes')
|
||||
$substitutionarray=array(
|
||||
'__ID__' => $obj->source_id,
|
||||
'__EMAIL__' => $obj->email,
|
||||
'__CHECK_READ__' => '<img src="'.DOL_MAIN_URL_ROOT.'/public/emailing/mailing-read.php?tag='.$obj->tag.'" width="1" height="1" style="width:1px;height:1px" border="0"/>',
|
||||
'__UNSUBSCRIBE__' => '<a href="'.DOL_MAIN_URL_ROOT.'/public/emailing/mailing-unsubscribe.php?tag='.$obj->tag.'&unsuscrib=1" target="_blank">'.$langs->trans("MailUnsubcribe").'</a>',
|
||||
'__CHECK_READ__' => '<img src="'.DOL_MAIN_URL_ROOT.'/public/emailing/mailing-read.php?tag='.$obj->tag.'&securitykey='.urlencode($conf->global->MAILING_EMAIL_UNSUBSCRIBE_KEY).'" width="1" height="1" style="width:1px;height:1px" border="0"/>',
|
||||
'__UNSUBSCRIBE__' => '<a href="'.DOL_MAIN_URL_ROOT.'/public/emailing/mailing-unsubscribe.php?tag='.$obj->tag.'&unsuscrib=1&securitykey='.urlencode($conf->global->MAILING_EMAIL_UNSUBSCRIBE_KEY).'" target="_blank">'.$langs->trans("MailUnsubcribe").'</a>',
|
||||
'__MAILTOEMAIL__' => '<a href="mailto:'.$obj->email.'">'.$obj->email.'</a>',
|
||||
'__LASTNAME__' => $obj->lastname,
|
||||
'__FIRSTNAME__' => $obj->firstname,
|
||||
|
||||
@ -1929,7 +1929,7 @@ if ($action == 'update_extras')
|
||||
$ret = $extrafields->setOptionalsFromPost($extralabels,$object,GETPOST('attribute'));
|
||||
if ($ret < 0) $error++;
|
||||
|
||||
if (! $error)
|
||||
if (! $error)
|
||||
{
|
||||
// Actions on extra fields (by external module or standard code)
|
||||
// FIXME le hook fait double emploi avec le trigger !!
|
||||
@ -1946,7 +1946,7 @@ if ($action == 'update_extras')
|
||||
}
|
||||
else if ($reshook < 0) $error++;
|
||||
}
|
||||
|
||||
|
||||
if ($error) $action = 'edit_extras';
|
||||
}
|
||||
|
||||
@ -2083,6 +2083,16 @@ if ($action == 'create')
|
||||
print '<td colspan="2">';
|
||||
print $soc->getNomUrl(1);
|
||||
print '<input type="hidden" name="socid" value="'.$soc->id.'">';
|
||||
// Outstanding Bill
|
||||
$outstandigBills=$soc->get_OutstandingBill();
|
||||
print ' ('.$langs->trans('CurrentOutstandingBill').': ';
|
||||
print price($outstandigBills,'',$langs,0,0,-1,$conf->currency);
|
||||
if ($soc->outstanding_limit != '')
|
||||
{
|
||||
if ($outstandigBills > $soc->outstanding_limit) print img_warning($langs->trans("OutstandingBillReached"));
|
||||
print ' / '.price($soc->outstanding_limit);
|
||||
}
|
||||
print ')';
|
||||
print '</td>';
|
||||
}
|
||||
else
|
||||
@ -2312,18 +2322,6 @@ if ($action == 'create')
|
||||
print '</td></tr>';
|
||||
}
|
||||
|
||||
if ($soc->outstanding_limit)
|
||||
{
|
||||
// Outstanding Bill
|
||||
print '<tr><td>';
|
||||
print $langs->trans('OutstandingBill');
|
||||
print '</td><td align=right>';
|
||||
print price($soc->get_OutstandingBill()).' / ';
|
||||
print price($soc->outstanding_limit).'</td><td colspan=2>';
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
}
|
||||
|
||||
// Other attributes
|
||||
$parameters=array('objectsrc' => $objectsrc, 'colspan' => ' colspan="3"');
|
||||
$reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$object,$action); // Note that $action and $object may have been modified by hook
|
||||
@ -2872,7 +2870,18 @@ else if ($id > 0 || ! empty($ref))
|
||||
else
|
||||
{
|
||||
print ' '.$soc->getNomUrl(1,'compta');
|
||||
print ' (<a href="'.DOL_URL_ROOT.'/compta/facture/list.php?socid='.$object->socid.'">'.$langs->trans('OtherBills').'</a>)';
|
||||
print ' ';
|
||||
print '(<a href="'.DOL_URL_ROOT.'/compta/facture/list.php?socid='.$object->socid.'">'.$langs->trans('OtherBills').'</a>';
|
||||
// Outstanding Bill
|
||||
$outstandigBills=$soc->get_OutstandingBill();
|
||||
print ' - '.$langs->trans('CurrentOutstandingBill').': ';
|
||||
print price($outstandigBills,'',$langs,0,0,-1,$conf->currency);
|
||||
if ($soc->outstanding_limit != '')
|
||||
{
|
||||
if ($outstandigBills > $soc->outstanding_limit) print img_warning($langs->trans("OutstandingBillReached"));
|
||||
print ' / '.price($soc->outstanding_limit);
|
||||
}
|
||||
print ')';
|
||||
}
|
||||
print '</tr>';
|
||||
|
||||
@ -3040,7 +3049,7 @@ else if ($id > 0 || ! empty($ref))
|
||||
$nbrows=8; $nbcols=2;
|
||||
if (! empty($conf->projet->enabled)) $nbrows++;
|
||||
if (! empty($conf->banque->enabled)) $nbcols++;
|
||||
if (! empty($soc->outstandingbill)) $nbrows++;
|
||||
//if (! empty($soc->outstandingbill)) $nbrows++;
|
||||
if($mysoc->localtax1_assuj=="1") $nbrows++;
|
||||
if($mysoc->localtax2_assuj=="1") $nbrows++;
|
||||
if ($selleruserevenustamp) $nbrows++;
|
||||
@ -3312,18 +3321,6 @@ else if ($id > 0 || ! empty($ref))
|
||||
}
|
||||
print '</td></tr>';
|
||||
|
||||
if ($soc->outstandingbill)
|
||||
{
|
||||
// Outstanding Bill
|
||||
print '<tr><td>';
|
||||
print $langs->trans('OutstandingBill');
|
||||
print '</td><td align=right>';
|
||||
print price($soc->get_OutstandingBill()).' / ';
|
||||
print price($soc->outstandingbill);
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
}
|
||||
|
||||
// Amount
|
||||
print '<tr><td>'.$langs->trans('AmountHT').'</td>';
|
||||
print '<td align="right" colspan="3" nowrap>'.price($object->total_ht,1,'',1,-1,-1,$conf->currency).'</td></tr>';
|
||||
@ -3443,9 +3440,9 @@ else if ($id > 0 || ! empty($ref))
|
||||
print '<input type="hidden" name="attribute" value="'.$key.'">';
|
||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
print '<input type="hidden" name="id" value="'.$object->id.'">';
|
||||
|
||||
|
||||
print $extrafields->showInputField($key,$value);
|
||||
|
||||
|
||||
print '<input type="submit" class="button" value="'.$langs->trans('Modify').'">';
|
||||
print '</form>';
|
||||
}
|
||||
@ -3791,7 +3788,7 @@ else if ($id > 0 || ! empty($ref))
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
}
|
||||
|
||||
|
||||
$i++;
|
||||
}
|
||||
print '</table>';
|
||||
@ -3803,10 +3800,10 @@ else if ($id > 0 || ! empty($ref))
|
||||
{
|
||||
dol_print_error($db);
|
||||
}
|
||||
|
||||
|
||||
print '</div>';
|
||||
}
|
||||
|
||||
|
||||
// Link for paypal payment
|
||||
if (! empty($conf->paypal->enabled) && $object->statut != 0)
|
||||
{
|
||||
|
||||
@ -207,6 +207,7 @@ if (file_exists($fullpathselecteddir))
|
||||
// Enable jquery handlers on new generated HTML objects
|
||||
print '<script type="text/javascript">';
|
||||
print 'jQuery(".classfortooltip").tipTip({ maxWidth: "600px", edgeOffset: 10, delay: 50, fadeIn: 50, fadeOut: 50});';
|
||||
// TODO Remove this. Is replaced with function as 3rd parameter of fileTree
|
||||
print 'jQuery(".fmdirlia").click(function(e) {
|
||||
id=jQuery(this).attr(\'id\').substr(12);
|
||||
jQuery("#formuserfile_section_dir").val(jQuery(this).attr(\'rel\'));
|
||||
@ -221,7 +222,7 @@ if (file_exists($fullpathselecteddir))
|
||||
else print "PermissionDenied";
|
||||
}
|
||||
|
||||
// This ajax service is called only when a directory $selecteddir is opened but not closed.
|
||||
// This ajax service is called only when a directory $selecteddir is opened but not when closed.
|
||||
//print '<script language="javascript">';
|
||||
//print "loadandshowpreview('".dol_escape_js($selecteddir)."');";
|
||||
//print '</script>';
|
||||
|
||||
@ -121,8 +121,8 @@ class Form
|
||||
* @param string $value Value to show/edit
|
||||
* @param object $object Object
|
||||
* @param boolean $perm Permission to allow button to edit parameter
|
||||
* @param string $typeofdata Type of data ('string' by default, 'email', 'numeric:99', 'text' or 'textarea:rows:cols', 'day' or 'datepicker', 'ckeditor:dolibarr_zzz:width:height:savemethod:toolbarstartexpanded:rows:cols', 'select:xxx'...)
|
||||
* @param string $editvalue When in edit mode, use this value as $value instead of value
|
||||
* @param string $typeofdata Type of data ('string' by default, 'amount', 'email', 'numeric:99', 'text' or 'textarea:rows:cols', 'day' or 'datepicker', 'ckeditor:dolibarr_zzz:width:height:savemethod:toolbarstartexpanded:rows:cols', 'select:xxx'...)
|
||||
* @param string $editvalue When in edit mode, use this value as $value instead of value (for example, you can provide here a formated price instead of value)
|
||||
* @param object $extObject External object
|
||||
* @param string $success Success message
|
||||
* @param string $moreparam More param to add on a href URL
|
||||
@ -134,6 +134,9 @@ class Form
|
||||
|
||||
$ret='';
|
||||
|
||||
// Check parameters
|
||||
if (empty($typeofdata)) return 'ErrorBadParameter';
|
||||
|
||||
// When option to edit inline is activated
|
||||
if (! empty($conf->global->MAIN_USE_JQUERY_JEDITABLE) && ! preg_match('/^select;|datehourpicker/',$typeofdata)) // FIXME add jquery timepicker
|
||||
{
|
||||
@ -150,7 +153,7 @@ class Form
|
||||
$ret.='<input type="hidden" name="id" value="'.$object->id.'">';
|
||||
$ret.='<table class="nobordernopadding" cellpadding="0" cellspacing="0">';
|
||||
$ret.='<tr><td>';
|
||||
if (preg_match('/^(string|email|numeric)/',$typeofdata))
|
||||
if (preg_match('/^(string|email|numeric|amount)/',$typeofdata))
|
||||
{
|
||||
$tmp=explode(':',$typeofdata);
|
||||
$ret.='<input type="text" id="'.$htmlname.'" name="'.$htmlname.'" value="'.($editvalue?$editvalue:$value).'"'.($tmp[1]?' size="'.$tmp[1].'"':'').'>';
|
||||
@ -191,8 +194,9 @@ class Form
|
||||
$ret.='</form>'."\n";
|
||||
}
|
||||
else
|
||||
{
|
||||
{
|
||||
if ($typeofdata == 'email') $ret.=dol_print_email($value,0,0,0,0,1);
|
||||
elseif ($typeofdata == 'amount') $ret.=($value != '' ? price($value,'',$langs) : '');
|
||||
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');
|
||||
|
||||
@ -64,9 +64,10 @@ class FormFile
|
||||
* @param boolean $useajax Use fileupload ajax (0=never, 1=if enabled, 2=always whatever is option). 2 should never be used.
|
||||
* @param string $savingdocmask Mask to use to define output filename. For example 'XXXXX-__YYYYMMDD__-__file__'
|
||||
* @param string $linkfiles 1=Also add form to link files, 0=Do not show form to link files
|
||||
* @param string $htmlname Name and id of HTML form
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*/
|
||||
function form_attach_new_file($url, $title='', $addcancel=0, $sectionid=0, $perm=1, $size=50, $object='', $options='', $useajax=1, $savingdocmask='', $linkfiles=1)
|
||||
function form_attach_new_file($url, $title='', $addcancel=0, $sectionid=0, $perm=1, $size=50, $object='', $options='', $useajax=1, $savingdocmask='', $linkfiles=1, $htmlname='formuserfile')
|
||||
{
|
||||
global $conf,$langs, $hookmanager;
|
||||
$hookmanager->initHooks(array('formfile'));
|
||||
@ -90,9 +91,9 @@ class FormFile
|
||||
if (empty($title)) $title=$langs->trans("AttachANewFile");
|
||||
if ($title != 'none') print_titre($title);
|
||||
|
||||
$out .= '<form name="formuserfile" action="'.$url.'" enctype="multipart/form-data" method="POST">';
|
||||
$out .= '<input type="hidden" id="formuserfile_section_dir" name="section_dir" value="">';
|
||||
$out .= '<input type="hidden" id="formuserfile_section_id" name="section_id" value="'.$sectionid.'">';
|
||||
$out .= '<form name="'.$htmlname.'" id="'.$htmlname.'" action="'.$url.'" enctype="multipart/form-data" method="POST">';
|
||||
$out .= '<input type="hidden" id="'.$htmlname.'_section_dir" name="section_dir" value="">';
|
||||
$out .= '<input type="hidden" id="'.$htmlname.'_section_id" name="section_id" value="'.$sectionid.'">';
|
||||
$out .= '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
|
||||
$out .= '<table width="100%" class="nobordernopadding">';
|
||||
@ -165,9 +166,9 @@ class FormFile
|
||||
$langs->load('link');
|
||||
$title = $langs->trans("LinkANewFile");
|
||||
$out .= load_fiche_titre($title, null, null);
|
||||
$out .= '<form name="formuserfile" action="'.$url.'" method="POST">';
|
||||
$out .= '<input type="hidden" id="formuserfile_section_dir" name="section_dir" value="">';
|
||||
$out .= '<input type="hidden" id="formuserfile_section_id" name="section_id" value="'.$sectionid.'">';
|
||||
$out .= '<form name="'.$htmlname.'_link" id="'.$htmlname.'_link" action="'.$url.'" method="POST">';
|
||||
$out .= '<input type="hidden" id="'.$htmlname.'_link_section_dir" name="link_section_dir" value="">';
|
||||
$out .= '<input type="hidden" id="'.$htmlname.'_link_section_id" name="link_section_id" value="'.$sectionid.'">';
|
||||
$out .= '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
|
||||
$out .= '<table width="100%" class="nobordernopadding">';
|
||||
@ -770,14 +771,14 @@ class FormFile
|
||||
print '<a data-ajax="false" href="'.DOL_URL_ROOT.'/document.php?modulepart='.$modulepart;
|
||||
if ($forcedownload) print '&attachment=1';
|
||||
if (! empty($object->entity)) print '&entity='.$object->entity;
|
||||
print '&file='.urlencode($relativepath.$file['name']);
|
||||
/* Restore old code: When file is at level 2+, full relative path must be in url, not only level1
|
||||
$filepath=$relativepath.$file['name'];
|
||||
/* Restore old code: When file is at level 2+, full relative path (and not only level1) must be into url
|
||||
if ($file['level1name'] <> $object->id)
|
||||
$filepath=urlencode($object->id.'/'.$file['level1name'].'/'.$file['name']);
|
||||
$filepath=$object->id.'/'.$file['level1name'].'/'.$file['name'];
|
||||
else
|
||||
$filepath=urlencode($object->id.'/'.$file['name']);
|
||||
print '&file='.$filepath;
|
||||
*/
|
||||
$filepath=$object->id.'/'.$file['name'];
|
||||
*/
|
||||
print '&file='.urlencode($filepath);
|
||||
print '">';
|
||||
|
||||
print img_mime($file['name'],$file['name'].' ('.dol_print_size($file['size'],0,0).')').' ';
|
||||
@ -800,14 +801,16 @@ class FormFile
|
||||
// Delete or view link
|
||||
// ($param must start with &)
|
||||
print '<td align="right">';
|
||||
if ($useinecm) print '<a href="'.DOL_URL_ROOT.'/ecm/docfile.php?urlfile='.urlencode($file['name']).$param.'" class="editfilelink" rel="'.urlencode($file['name']).$param.'">'.img_view().'</a> ';
|
||||
if ($useinecm) print '<a href="'.DOL_URL_ROOT.'/ecm/docfile.php?urlfile='.urlencode($file['name']).$param.'" class="editfilelink" rel="'.urlencode($file['name']).'">'.img_view().'</a> ';
|
||||
if ($permtodelete)
|
||||
{
|
||||
/*
|
||||
if ($file['level1name'] <> $object->id)
|
||||
$filepath=urlencode($file['level1name'].'/'.$file['name']);
|
||||
$filepath=$file['level1name'].'/'.$file['name'];
|
||||
else
|
||||
$filepath=urlencode($file['name']);
|
||||
print '<a href="'.(($useinecm && ! empty($conf->use_javascript_ajax) && empty($conf->global->MAIN_ECM_DISABLE_JS))?'#':$url.'?action=delete&urlfile='.$filepath.$param).'" class="deletefilelink" rel="'.$filepath.$param.'">'.img_delete().'</a>';
|
||||
$filepath=$file['name'];
|
||||
*/
|
||||
print '<a href="'.(($useinecm && ! empty($conf->use_javascript_ajax) && empty($conf->global->MAIN_ECM_DISABLE_JS))?'#':$url.'?action=delete&urlfile='.urlencode($filepath).$param).'" class="deletefilelink" rel="'.$filepath.'">'.img_delete().'</a>';
|
||||
}
|
||||
else print ' ';
|
||||
print "</td>";
|
||||
@ -831,7 +834,7 @@ class FormFile
|
||||
/**
|
||||
* Show list of documents in a directory
|
||||
*
|
||||
* @param string $upload_dir Directory that was scanned
|
||||
* @param string $upload_dir Directory that was scanned
|
||||
* @param array $filearray Array of files loaded by dol_dir_list function before calling this function
|
||||
* @param string $modulepart Value for modulepart used by download wrapper
|
||||
* @param string $param Parameters on sort links
|
||||
@ -841,7 +844,7 @@ class FormFile
|
||||
* @param int $useinecm Change output for use in ecm module
|
||||
* @param int $textifempty Text to show if filearray is empty
|
||||
* @param int $maxlength Maximum length of file name shown
|
||||
* @param string $url Full url to use for click links ('' = autodetect)
|
||||
* @param string $url Full url to use for click links ('' = autodetect)
|
||||
* @return int <0 if KO, nb of files shown if OK
|
||||
*/
|
||||
function list_of_autoecmfiles($upload_dir,$filearray,$modulepart,$param,$forcedownload=0,$relativepath='',$permtodelete=1,$useinecm=0,$textifempty='',$maxlength=0,$url='')
|
||||
|
||||
@ -210,7 +210,8 @@ class DoliDBPgsql extends DoliDB
|
||||
|
||||
// tinyint type conversion
|
||||
$line=preg_replace('/tinyint\(?[0-9]*\)?/','smallint',$line);
|
||||
|
||||
$line=preg_replace('/tinyint/i','smallint',$line);
|
||||
|
||||
// nuke unsigned
|
||||
$line=preg_replace('/(int\w+|smallint)\s+unsigned/i','\\1',$line);
|
||||
|
||||
@ -875,7 +876,7 @@ class DoliDBPgsql extends DoliDB
|
||||
42701=> 'DB_ERROR_COLUMN_ALREADY_EXISTS',
|
||||
'42710' => 'DB_ERROR_KEY_NAME_ALREADY_EXISTS',
|
||||
'23505' => 'DB_ERROR_RECORD_ALREADY_EXISTS',
|
||||
'42704' => 'DB_ERROR_NO_INDEX_TO_DROP',
|
||||
'42704' => 'DB_ERROR_NO_INDEX_TO_DROP', // May also be Type xxx does not exists
|
||||
'42601' => 'DB_ERROR_SYNTAX',
|
||||
'42P16' => 'DB_ERROR_PRIMARY_KEY_ALREADY_EXISTS',
|
||||
1075 => 'DB_ERROR_CANT_DROP_PRIMARY_KEY',
|
||||
|
||||
@ -155,24 +155,20 @@ class MailingTargets // This can't be abstract as it is used for some method
|
||||
if (! empty($targetarray['email'])) // avoid empty email address
|
||||
{
|
||||
$sql = "INSERT INTO ".MAIN_DB_PREFIX."mailing_cibles";
|
||||
$sql .= " (fk_mailing,";
|
||||
$sql .= " fk_contact,";
|
||||
$sql .= " lastname, firstname, email, other, source_url, source_id,";
|
||||
if (! empty($conf->global->MAILING_EMAIL_UNSUBSCRIBE)) {
|
||||
$sql .= " tag,";
|
||||
}
|
||||
$sql.= " (fk_mailing,";
|
||||
$sql.= " fk_contact,";
|
||||
$sql.= " lastname, firstname, email, other, source_url, source_id,";
|
||||
$sql.= " tag,";
|
||||
$sql.= " source_type)";
|
||||
$sql .= " VALUES (".$mailing_id.",";
|
||||
$sql .= (empty($targetarray['fk_contact']) ? '0' : "'".$targetarray['fk_contact']."'") .",";
|
||||
$sql .= "'".$this->db->escape($targetarray['lastname'])."',";
|
||||
$sql .= "'".$this->db->escape($targetarray['firstname'])."',";
|
||||
$sql .= "'".$this->db->escape($targetarray['email'])."',";
|
||||
$sql .= "'".$this->db->escape($targetarray['other'])."',";
|
||||
$sql .= "'".$this->db->escape($targetarray['source_url'])."',";
|
||||
$sql .= (empty($targetarray['source_id']) ? 'null' : "'".$this->db->escape($targetarray['source_id'])."'").",";
|
||||
if (! empty($conf->global->MAILING_EMAIL_UNSUBSCRIBE)) {
|
||||
$sql .= "'".$this->db->escape(md5($targetarray['email'].';'.$targetarray['name'].';'.$mailing_id.';'.$conf->global->MAILING_EMAIL_UNSUBSCRIBE_KEY))."',";
|
||||
}
|
||||
$sql.= " VALUES (".$mailing_id.",";
|
||||
$sql.= (empty($targetarray['fk_contact']) ? '0' : "'".$targetarray['fk_contact']."'") .",";
|
||||
$sql.= "'".$this->db->escape($targetarray['lastname'])."',";
|
||||
$sql.= "'".$this->db->escape($targetarray['firstname'])."',";
|
||||
$sql.= "'".$this->db->escape($targetarray['email'])."',";
|
||||
$sql.= "'".$this->db->escape($targetarray['other'])."',";
|
||||
$sql.= "'".$this->db->escape($targetarray['source_url'])."',";
|
||||
$sql.= (empty($targetarray['source_id']) ? 'null' : "'".$this->db->escape($targetarray['source_id'])."'").",";
|
||||
$sql .= "'".$this->db->escape(dol_hash($targetarray['email'].';'.$targetarray['name'].';'.$mailing_id.';'.$conf->global->MAILING_EMAIL_UNSUBSCRIBE_KEY))."',";
|
||||
$sql .= "'".$this->db->escape($targetarray['source_type'])."')";
|
||||
$result=$this->db->query($sql);
|
||||
if ($result)
|
||||
|
||||
@ -53,6 +53,7 @@ $action=GETPOST("action");
|
||||
$section=GETPOST("section")?GETPOST("section","int"):GETPOST("section_id","int");
|
||||
$module=GETPOST("module");
|
||||
if (! $section) $section=0;
|
||||
$section_dir=GETPOST('section_dir');
|
||||
|
||||
$sortfield = GETPOST("sortfield",'alpha');
|
||||
$sortorder = GETPOST("sortorder",'alpha');
|
||||
@ -93,7 +94,7 @@ if (GETPOST("sendit") && ! empty($conf->global->MAIN_UPLOAD_DOC))
|
||||
// Define relativepath and upload_dir
|
||||
$relativepath='';
|
||||
if ($ecmdir->id) $relativepath=$ecmdir->getRelativePath();
|
||||
else $relativepath=GETPOST('section_dir');
|
||||
else $relativepath=$section_dir;
|
||||
$upload_dir = $conf->ecm->dir_output.'/'.$relativepath;
|
||||
|
||||
if (empty($_FILES['userfile']['tmp_name']))
|
||||
@ -167,16 +168,20 @@ if ($action == 'confirm_deletefile')
|
||||
{
|
||||
if (GETPOST('confirm') == 'yes')
|
||||
{
|
||||
$langs->load("other");
|
||||
$result=$ecmdir->fetch($section);
|
||||
if (! ($result > 0))
|
||||
$langs->load("other");
|
||||
if ($section)
|
||||
{
|
||||
dol_print_error($db,$ecmdir->error);
|
||||
exit;
|
||||
$result=$ecmdir->fetch($section);
|
||||
if (! ($result > 0))
|
||||
{
|
||||
dol_print_error($db,$ecmdir->error);
|
||||
exit;
|
||||
}
|
||||
$relativepath=$ecmdir->getRelativePath();
|
||||
}
|
||||
$relativepath=$ecmdir->getRelativePath();
|
||||
$upload_dir = $conf->ecm->dir_output.'/'.$relativepath;
|
||||
$file = $upload_dir . "/" . GETPOST('urlfile'); // Do not use urldecode here ($_GET and $_REQUEST are already decoded by PHP).
|
||||
else $relativepath='';
|
||||
$upload_dir = $conf->ecm->dir_output.($relativepath?'/'.$relativepath:'');
|
||||
$file = $upload_dir . "/" . GETPOST('urlfile'); // Do not use urldecode here ($_GET and $_POST are already decoded by PHP).
|
||||
|
||||
$ret=dol_delete_file($file);
|
||||
if ($ret) setEventMessage($langs->trans("FileWasRemoved", GETPOST('urlfile')));
|
||||
@ -391,7 +396,7 @@ if (!empty($conf->global->ECM_AUTO_TREE_ENABLED)) {
|
||||
if (! empty($conf->fournisseur->enabled)) { $rowspan++; $sectionauto[]=array('level'=>1, 'module'=>'order_supplier', 'test'=>$conf->fournisseur->enabled, 'label'=>$langs->trans("SuppliersOrders"), 'desc'=>$langs->trans("ECMDocsByOrders")); }
|
||||
if (! empty($conf->fournisseur->enabled)) { $rowspan++; $sectionauto[]=array('level'=>1, 'module'=>'invoice_supplier', 'test'=>$conf->fournisseur->enabled, 'label'=>$langs->trans("SuppliersInvoices"), 'desc'=>$langs->trans("ECMDocsByInvoices")); }
|
||||
if (! empty($conf->tax->enabled)) { $rowspan++; $sectionauto[]=array('level'=>1, 'module'=>'tax', 'test'=>$conf->tax->enabled, 'label'=>$langs->trans("SocialContributions"), 'desc'=>$langs->trans("ECMDocsBySocialContributions")); }
|
||||
if (! empty($conf->projet->enabled)) { $rowspan++; $sectionauto[]=array('level'=>1, 'module'=>'project', 'test'=>$conf->projet->enabled, 'label'=>$langs->trans("Projects"), 'desc'=>$langs->trans("ECMDocsByProjects")); }
|
||||
if (! empty($conf->projet->enabled)) { $rowspan++; $sectionauto[]=array('level'=>1, 'module'=>'project', 'test'=>$conf->projet->enabled, 'label'=>$langs->trans("Projects"), 'desc'=>$langs->trans("ECMDocsByProjects")); }
|
||||
}
|
||||
|
||||
print_fiche_titre($langs->trans("ECMArea").' - '.$langs->trans("ECMFileManager"));
|
||||
@ -461,7 +466,6 @@ if ($action == 'delete_section')
|
||||
// End confirm
|
||||
|
||||
|
||||
|
||||
if (empty($action) || $action == 'file_manager' || preg_match('/refresh/i',$action) || $action == 'delete')
|
||||
{
|
||||
print '<table width="100%" class="nobordernopadding">';
|
||||
@ -774,8 +778,19 @@ include_once DOL_DOCUMENT_ROOT.'/core/ajax/ajaxdirpreview.php';
|
||||
// To attach new file
|
||||
if ((! empty($conf->use_javascript_ajax) && empty($conf->global->MAIN_ECM_DISABLE_JS)) || ! empty($section))
|
||||
{
|
||||
if (empty($section) || $section == -1)
|
||||
{
|
||||
?>
|
||||
<script type="text/javascript">
|
||||
jQuery(document).ready(function() {
|
||||
jQuery('#formuserfile').hide();
|
||||
});
|
||||
</script>
|
||||
<?php
|
||||
}
|
||||
|
||||
$formfile=new FormFile($db);
|
||||
$formfile->form_attach_new_file(DOL_URL_ROOT.'/ecm/index.php', 'none', 0, ($section?$section:-1), $user->rights->ecm->upload, 48, null, '', 0, '', 0);
|
||||
$formfile->form_attach_new_file(DOL_URL_ROOT.'/ecm/index.php', 'none', 0, ($section?$section:-1), $user->rights->ecm->upload, 48, null, '', 0, '', 0, 'formuserfile');
|
||||
}
|
||||
else print ' ';
|
||||
|
||||
@ -789,6 +804,8 @@ else print ' ';
|
||||
<?php
|
||||
// End of page
|
||||
|
||||
|
||||
|
||||
if (! empty($conf->use_javascript_ajax) && empty($conf->global->MAIN_ECM_DISABLE_JS)) {
|
||||
include 'tpl/builddatabase.tpl.php';
|
||||
}
|
||||
|
||||
@ -13,28 +13,39 @@
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*
|
||||
* Output javascript for interactions code of ecm module
|
||||
*/
|
||||
|
||||
$openeddir='/';
|
||||
|
||||
// TODO: just use ajaxdirtree.php for load database after ajax refresh and not scan directories
|
||||
// too slow every page loaded !
|
||||
|
||||
?>
|
||||
|
||||
<!-- BEGIN PHP TEMPLATE FOR JQUERY -->
|
||||
<!-- BEGIN PHP TEMPLATE ecm/tpl/builddatabase.tpl.php -->
|
||||
<!-- Doc of fileTree plugin at http://www.abeautifulsite.net/blog/2008/03/jquery-file-tree/ -->
|
||||
|
||||
<script type="text/javascript">
|
||||
$(document).ready( function() {
|
||||
$('#filetree').fileTree({ root: '<?php print dol_escape_js($openeddir); ?>',
|
||||
// Called if we click on a file (not a dir)
|
||||
script: '<?php echo DOL_URL_ROOT.'/core/ajax/ajaxdirtree.php?modulepart=ecm&openeddir='.urlencode($openeddir); ?>',
|
||||
folderEvent: 'click',
|
||||
multiFolder: false },
|
||||
// Called if we click on a file (not a dir)
|
||||
|
||||
<?php
|
||||
$openeddir='/';
|
||||
?>
|
||||
|
||||
$(document).ready(function() {
|
||||
|
||||
$('#filetree').fileTree({
|
||||
root: '<?php print dol_escape_js($openeddir); ?>',
|
||||
// Ajax called if we click to expand a dir (not a file). Parameter of dir is provided as a POST parameter.
|
||||
script: '<?php echo DOL_URL_ROOT.'/core/ajax/ajaxdirtree.php?modulepart=ecm&openeddir='.urlencode($openeddir); ?>',
|
||||
folderEvent: 'click', // 'dblclick'
|
||||
multiFolder: false },
|
||||
// Called if we click on a file (not a dir)
|
||||
function(file) {
|
||||
$("#mesg").hide();
|
||||
loadandshowpreview(file,0);
|
||||
},
|
||||
// Called if we click on a dir (not a file)
|
||||
function(elem) {
|
||||
id=elem.attr('id').substr(12);
|
||||
jQuery("#formuserfile_section_dir").val(elem.attr('rel'));
|
||||
jQuery("#formuserfile_section_id").val(id);
|
||||
jQuery('#formuserfile').show();
|
||||
}
|
||||
);
|
||||
|
||||
@ -78,5 +89,6 @@ ecmBuildDatabase = function() {
|
||||
location.href="<?php echo $_SERVER['PHP_SELF']; ?>";
|
||||
});
|
||||
};
|
||||
|
||||
</script>
|
||||
<!-- END PHP TEMPLATE FOR JQUERY -->
|
||||
<!-- END PHP TEMPLATE ecm/tpl/builddatabase.tpl.php -->
|
||||
@ -33,7 +33,7 @@
|
||||
if(jQuery) (function($){
|
||||
|
||||
$.extend($.fn, {
|
||||
fileTree: function(o, h) {
|
||||
fileTree: function(o, h, hd) { // CHANGE DOL_LDR add hd param
|
||||
// Defaults
|
||||
if( !o ) var o = {};
|
||||
if( o.root == undefined ) o.root = '/';
|
||||
@ -77,6 +77,8 @@ if(jQuery) (function($){
|
||||
$(this).parent().find('UL').slideUp({ duration: o.collapseSpeed, easing: o.collapseEasing });
|
||||
$(this).parent().removeClass('expanded').addClass('collapsed');
|
||||
}
|
||||
// CHANGE DOL_LDR use hd function provided in param
|
||||
if (hd != null) hd($(this));
|
||||
} else {
|
||||
h($(this).attr('rel'));
|
||||
}
|
||||
|
||||
@ -88,13 +88,13 @@ insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (80
|
||||
insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (802,80, '0','0','VAT Rate 0',1);
|
||||
|
||||
-- FRANCE (id country=1)
|
||||
insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 11, 1,'19.6','0','VAT standard rate (France hors DOM-TOM)',1);
|
||||
insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 11, 1, '20','0','VAT standard rate (France hors DOM-TOM)',1);
|
||||
insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 12, 1, '8.5','0','VAT standard rate (DOM sauf Guyane et Saint-Martin)',0);
|
||||
insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 13, 1, '8.5','1','VAT standard rate (DOM sauf Guyane et Saint-Martin), non perçu par le vendeur mais récupérable par acheteur',0);
|
||||
insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 14, 1, '5.5','0','VAT reduced rate (France hors DOM-TOM)',1);
|
||||
insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 15, 1, '0','0','VAT Rate 0 ou non applicable',1);
|
||||
insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 16, 1, '2.1','0','VAT super-reduced rate',1);
|
||||
insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 17, 1, '7','0','VAT reduced rate',1);
|
||||
insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 17, 1, '10','0','VAT reduced rate',1);
|
||||
|
||||
-- GERMANY (id country=5)
|
||||
insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 51, 5, '19.0','0','allgemeine Ust.',1);
|
||||
|
||||
@ -359,5 +359,5 @@ ALTER TABLE llx_societe ADD skype VARCHAR(255) AFTER email;
|
||||
ALTER TABLE llx_adherent ADD skype VARCHAR(255) AFTER email;
|
||||
|
||||
-- multi-rib
|
||||
ALTER TABLE llx_societe_rib ADD default_rib TINYINT NOT NULL DEFAULT 0 AFTER owner_address;
|
||||
ALTER TABLE llx_societe_rib ADD default_rib smallint NOT NULL DEFAULT 0 AFTER owner_address;
|
||||
UPDATE llx_societe_rib SET default_rib = 1;
|
||||
|
||||
@ -36,7 +36,7 @@ create table llx_societe_rib
|
||||
domiciliation varchar(255),
|
||||
proprio varchar(60),
|
||||
owner_address varchar(255),
|
||||
default_rib tinyint NOT NULL DEFAULT 0,
|
||||
default_rib smallint NOT NULL DEFAULT 0,
|
||||
import_key varchar(14) -- import key
|
||||
|
||||
|
||||
|
||||
@ -228,7 +228,7 @@ OfficialWebSiteFr=French official web site
|
||||
OfficialWiki=Dolibarr documentation on Wiki
|
||||
OfficialDemo=Dolibarr online demo
|
||||
OfficialMarketPlace=Official market place for external modules/addons
|
||||
OfficialWebHostingService=Official web hosting service (Cloud hosting)
|
||||
OfficialWebHostingService=Official web hosting services (Cloud hosting)
|
||||
ForDocumentationSeeWiki=For user or developer documentation (Doc, FAQs...),<br>take a look at the Dolibarr Wiki:<br><b><a href="%s" target="_blank">%s</a></b>
|
||||
ForAnswersSeeForum=For any other questions/help, you can use the Dolibarr forum:<br><b><a href="%s" target="_blank">%s</a></b>
|
||||
HelpCenterDesc1=This area can help you to get a Help support service on Dolibarr.
|
||||
|
||||
@ -398,7 +398,9 @@ InActivity=Open
|
||||
ActivityCeased=Closed
|
||||
ActivityStateFilter=Activity status
|
||||
ProductsIntoElements=List of products into
|
||||
CurrentOutstandingBill=Current outstanding bill
|
||||
OutstandingBill=Max. for outstanding bill
|
||||
OutstandingBillReached=Reached max. for outstanding bill
|
||||
# Monkey
|
||||
MonkeyNumRefModelDesc=Return numero with format %syymm-nnnn for customer code and %syymm-nnnn for supplier code where yy is year, mm is month and nnnn is a sequence with no break and no return to 0.
|
||||
# Leopard
|
||||
|
||||
@ -399,6 +399,7 @@ ActivityCeased=Cerrado
|
||||
ActivityStateFilter=Estado de actividad
|
||||
ProductsIntoElements=Listado de productos en %s
|
||||
OutstandingBill=Importe máximo para facturas pendientes
|
||||
OutstandingBillReached=Importe máximo alcanzado
|
||||
# Monkey
|
||||
MonkeyNumRefModelDesc=Devuelve un número bajo el formato %syymm-nnnn para los códigos de clientes y %syymm-nnnn para los códigos de los proveedores, donde yy es el año, mm el mes y nnnn un contador secuencial sin ruptura y sin volver a 0.
|
||||
# Leopard
|
||||
|
||||
@ -398,7 +398,9 @@ InActivity=En activité
|
||||
ActivityCeased=Clos
|
||||
ActivityStateFilter=Statut d'activité
|
||||
ProductsIntoElements=Liste des produits dans les %s
|
||||
CurrentOutstandingBill=Montant encours
|
||||
OutstandingBill=Montant max. en attente
|
||||
OutstandingBillReached=Montant max. endetté
|
||||
# Monkey
|
||||
MonkeyNumRefModelDesc=Renvoie le numéro sous la forme %syymm-nnnn pour les codes clients et %syymm-nnnn pour les codes fournisseurs où yy est l'année, mm le mois et nnnn un compteur séquentiel sans rupture et sans remise à 0.
|
||||
# Leopard
|
||||
|
||||
@ -26,4 +26,4 @@ LinkToGoldMember=Vous pouvez appeler immédiatement un des quelques accompagnate
|
||||
PossibleLanguages=Langues disponibles
|
||||
MakeADonation=Aidez le projet Dolibarr, faites un don
|
||||
SubscribeToFoundation=Aidez le projet Dolibarr, adhérez à l'association Dolibarr
|
||||
SeeOfficalSupport=Pour un accompagnement officielle Dolibarr dans votre langue : <br><b><a href="%s" target="_blank">%s</a></b>
|
||||
SeeOfficalSupport=Pour un accompagnement officiel Dolibarr dans votre langue : <br><b><a href="%s" target="_blank">%s</a></b>
|
||||
@ -2820,36 +2820,39 @@ class Societe extends CommonObject
|
||||
$this->db->begin();
|
||||
|
||||
$now=dol_now();
|
||||
|
||||
|
||||
// Clean parameters
|
||||
$outstanding = price2num($this->outstanding_limit);
|
||||
|
||||
// Positionne l'encours de facturaiton
|
||||
|
||||
// Set outstanding amount
|
||||
$sql = "UPDATE ".MAIN_DB_PREFIX."societe SET ";
|
||||
$sql.= " outstanding_limit=".$outstanding;
|
||||
$sql.= " outstanding_limit= ".($outstanding!=''?$outstanding:'null');
|
||||
$sql.= " WHERE rowid = ".$this->id;
|
||||
|
||||
dol_syslog(get_class($this)."::set_outstanding sql=".$sql);
|
||||
$resql=$this->db->query($sql);
|
||||
if (! $resql)
|
||||
if ($resql)
|
||||
{
|
||||
$this->db->commit();
|
||||
return 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->db->rollback();
|
||||
$this->error=$this->db->error();
|
||||
$this->error=$this->db->lasterror();
|
||||
return -1;
|
||||
}
|
||||
|
||||
$this->db->commit();
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* return amount of bill not paid
|
||||
* Return amount of bill not paid
|
||||
*
|
||||
* @return boolean Yes or no
|
||||
* @return int Amount in debt for thirdparty
|
||||
*/
|
||||
function get_OutstandingBill()
|
||||
{
|
||||
/* Accurate value of remain to pay is to sum remaintopay for each invoice
|
||||
/* Accurate value of remain to pay is to sum remaintopay for each invoice
|
||||
$paiement = $invoice->getSommePaiement();
|
||||
$creditnotes=$invoice->getSumCreditNotesUsed();
|
||||
$deposits=$invoice->getSumDepositsUsed();
|
||||
@ -2857,7 +2860,7 @@ class Societe extends CommonObject
|
||||
$remaintopay=price2num($invoice->total_ttc - $paiement - $creditnotes - $deposits,'MT');
|
||||
*/
|
||||
$sql = "SELECT sum(total) as amount FROM ".MAIN_DB_PREFIX."facture as f";
|
||||
$sql .= " WHERE fk_soc = ". $this->id;
|
||||
$sql .= " WHERE fk_soc = ". $this->id;
|
||||
$sql .= " AND paye = 0";
|
||||
$sql .= " AND fk_statut <> 0";
|
||||
|
||||
@ -2873,9 +2876,9 @@ class Societe extends CommonObject
|
||||
}
|
||||
|
||||
/**
|
||||
* Return label of status customer is prospect/customer
|
||||
* Return label of status customer is prospect/customer
|
||||
*
|
||||
* @return string Libelle
|
||||
* @return string Label
|
||||
*/
|
||||
function getLibCustProspStatut()
|
||||
{
|
||||
|
||||
@ -47,17 +47,14 @@ $parameters=array('id'=>$socid);
|
||||
$reshook=$hookmanager->executeHooks('doActions',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks
|
||||
$error=$hookmanager->error; $errors=array_merge($errors, (array) $hookmanager->errors);
|
||||
|
||||
|
||||
/*
|
||||
* View
|
||||
*/
|
||||
|
||||
$contactstatic = new Contact($db);
|
||||
|
||||
$form = new Form($db);
|
||||
|
||||
/*
|
||||
* Fiche categorie de client et/ou fournisseur
|
||||
*/
|
||||
if ($socid)
|
||||
{
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php';
|
||||
@ -140,43 +137,45 @@ if ($socid)
|
||||
print '<tr><td>'.$langs->trans('Phone').'</td><td>'.dol_print_phone($soc->phone,$soc->country_code,0,$soc->id,'AC_TEL').'</td>';
|
||||
print '<td>'.$langs->trans('Fax').'</td><td>'.dol_print_phone($soc->fax,$soc->country_code,0,$soc->id,'AC_FAX').'</td></tr>';
|
||||
|
||||
|
||||
if($mysoc->localtax1_assuj=="1" && $mysoc->localtax2_assuj=="1")
|
||||
{
|
||||
print '<tr><td class="nowrap">'.$langs->transcountry('LocalTax1IsUsed',$mysoc->country_code).'</td><td colspan="3">';
|
||||
print yn($soc->localtax1_assuj);
|
||||
print '</td></tr>';
|
||||
print '<tr><td class="nowrap">'.$langs->transcountry('LocalTax2IsUsed',$mysoc->country_code).'</td><td colspan="3">';
|
||||
print yn($soc->localtax2_assuj);
|
||||
print '</td></tr>';
|
||||
}
|
||||
elseif($mysoc->localtax1_assuj=="1")
|
||||
{
|
||||
print '<tr><td>'.$langs->transcountry('LocalTax1IsUsed',$mysoc->country_code).'</td><td colspan="3">';
|
||||
print yn($soc->localtax1_assuj);
|
||||
print '</td></tr>';
|
||||
}
|
||||
elseif($mysoc->localtax2_assuj=="1")
|
||||
{
|
||||
print '<tr><td>'.$langs->transcountry('LocalTax2IsUsed',$mysoc->country_code).'</td><td colspan="3">';
|
||||
print yn($soc->localtax2_assuj);
|
||||
print '</td></tr>';
|
||||
}
|
||||
|
||||
|
||||
|
||||
if ($mysoc->localtax1_assuj=="1" && $mysoc->localtax2_assuj=="1")
|
||||
{
|
||||
print '<tr><td class="nowrap">'.$langs->transcountry('LocalTax1IsUsed',$mysoc->country_code).'</td><td colspan="3">';
|
||||
print yn($soc->localtax1_assuj);
|
||||
print '</td></tr>';
|
||||
print '<tr><td class="nowrap">'.$langs->transcountry('LocalTax2IsUsed',$mysoc->country_code).'</td><td colspan="3">';
|
||||
print yn($soc->localtax2_assuj);
|
||||
print '</td></tr>';
|
||||
}
|
||||
elseif($mysoc->localtax1_assuj=="1")
|
||||
{
|
||||
print '<tr><td>'.$langs->transcountry('LocalTax1IsUsed',$mysoc->country_code).'</td><td colspan="3">';
|
||||
print yn($soc->localtax1_assuj);
|
||||
print '</td></tr>';
|
||||
}
|
||||
elseif($mysoc->localtax2_assuj=="1")
|
||||
{
|
||||
print '<tr><td>'.$langs->transcountry('LocalTax2IsUsed',$mysoc->country_code).'</td><td colspan="3">';
|
||||
print yn($soc->localtax2_assuj);
|
||||
print '</td></tr>';
|
||||
}
|
||||
|
||||
print '</table>';
|
||||
|
||||
print '</div>';
|
||||
|
||||
|
||||
// TODO: Improve and move to tpl
|
||||
|
||||
dol_fiche_end();
|
||||
|
||||
|
||||
print '<form action="'.$_SERVER["PHP_SELF"].'?socid='.$soc->id.'" method="post">';
|
||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
print '<input type="hidden" name="action" value="updatetva">';
|
||||
print '<input type="hidden" name="vatid" value="'.$vatid.'">';
|
||||
|
||||
// Localtaxes
|
||||
|
||||
|
||||
print '<table id="tablelines" class="noborder" width="100%">';
|
||||
|
||||
|
||||
print '<tr class="liste_titre nodrag nodrop">';
|
||||
|
||||
|
||||
// Description
|
||||
print '<td>'.$langs->trans('Description').'</td>';
|
||||
|
||||
@ -195,8 +194,8 @@ if ($socid)
|
||||
print '<td width="10" class="nowrap"></td>'; // No width to allow autodim
|
||||
|
||||
print "</tr>\n";
|
||||
|
||||
|
||||
|
||||
|
||||
$sql = "SELECT DISTINCT t.rowid, t.note, t.taux, t.localtax1, t.localtax2, t.recuperableonly";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."c_tva as t, ".MAIN_DB_PREFIX."c_pays as p";
|
||||
$sql.= " WHERE t.fk_pays = p.rowid";
|
||||
@ -215,21 +214,16 @@ if ($socid)
|
||||
{
|
||||
$var=!$var;
|
||||
|
||||
|
||||
|
||||
$obj = $db->fetch_object($resql);
|
||||
|
||||
|
||||
if ($action == 'edit' && $obj->rowid==$vatid && $user->rights->societe->creer)
|
||||
{
|
||||
print '<form action="'.$_SERVER["PHP_SELF"].'?socid='.$soc->id.'" method="post">';
|
||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
print '<input type="hidden" name="action" value="updatetva">';
|
||||
print '<input type="hidden" name="vatid" value="'.$vatid.'">';
|
||||
|
||||
print '<tr '.$bc[$var].'>';
|
||||
|
||||
|
||||
print '<td>'.$obj->note.'</td>';
|
||||
print '<td align="right">'.$obj->taux.'</td>';
|
||||
|
||||
|
||||
if ($mysoc->localtax1_assuj=="1" && $soc->localtax1_assuj)
|
||||
print '<td align="right"><input size="4" type="text" class="flat" name="localtax1" value="'.$obj->localtax1.'"></td>';
|
||||
if ($mysoc->localtax2_assuj=="1" && $soc->localtax2_assuj)
|
||||
@ -238,27 +232,33 @@ if ($socid)
|
||||
print '<td align="right"><input type="submit" class="button" name="save" value="'.$langs->trans('Save').'">';
|
||||
print '<br><input type="submit" class="button" name="cancel" value="'.$langs->trans('Cancel').'"></td>';
|
||||
print '</tr>';
|
||||
print '</form>';
|
||||
}
|
||||
else
|
||||
else
|
||||
{
|
||||
print '<tr '.$bc[$var].'>';
|
||||
|
||||
|
||||
print '<td>'.$obj->note.'</td>';
|
||||
print '<td align="right">'.$obj->taux.'</td>';
|
||||
if ($mysoc->localtax1_assuj=="1" && $soc->localtax1_assuj)
|
||||
print '<td align="right">'.$obj->localtax1.'</td>';
|
||||
if ($mysoc->localtax2_assuj=="1" && $soc->localtax2_assuj)
|
||||
print '<td align="right">'.$obj->localtax2.'</td>';
|
||||
print '<td align="right">';
|
||||
if ($user->rights->societe->creer)
|
||||
print '<td align="right"><a href="'.$_SERVER["PHP_SELF"].'?action=edit&socid='.$soc->id.'&vatid='.$obj->rowid.'">'.img_edit().'</a></td>';
|
||||
{
|
||||
// TODO Comment this because the action to save is not supported
|
||||
//print '<a href="'.$_SERVER["PHP_SELF"].'?action=edit&socid='.$soc->id.'&vatid='.$obj->rowid.'">'.img_edit().'</a>';
|
||||
}
|
||||
print '</td>';
|
||||
print "</tr>\n";
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
print '</table>';
|
||||
|
||||
print '</form>';
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -103,6 +103,7 @@ print "\n";
|
||||
|
||||
print '</div><div class="inline-block">';
|
||||
|
||||
/*
|
||||
|
||||
// Official support
|
||||
print '<table class="login" width="100%">';
|
||||
@ -136,9 +137,9 @@ print '</td>';
|
||||
print '</tr>';
|
||||
print '</table>'."\n";
|
||||
print "\n";
|
||||
|
||||
print '</div><div class="inline-block">';
|
||||
|
||||
/*
|
||||
|
||||
// Online support
|
||||
print '<table class="login" width="100%">';
|
||||
|
||||
@ -227,7 +227,7 @@ if ($resql)
|
||||
$error++;
|
||||
}
|
||||
|
||||
//Update status communication of contact prospect
|
||||
//Update status communication of contact prospect
|
||||
$sqlx = "UPDATE ".MAIN_DB_PREFIX."societe SET fk_stcomm=2 WHERE rowid IN (SELECT sc.fk_soc FROM ".MAIN_DB_PREFIX."socpeople AS sc INNER JOIN ".MAIN_DB_PREFIX."mailing_cibles AS mc ON mc.rowid=".$obj2->rowid." AND mc.source_type = 'contact' AND mc.source_id = sc.rowid)";
|
||||
dol_syslog("fiche.php: set prospect contact status sql=".$sql, LOG_DEBUG);
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user