Merge branch 'upstream/develop'
This commit is contained in:
commit
8e4c3dbd1b
@ -1,9 +1,6 @@
|
|||||||
--------------------------------------------------------------
|
--------------------------------------------------------------
|
||||||
English Dolibarr ChangeLog
|
English Dolibarr ChangeLog
|
||||||
--------------------------------------------------------------
|
--------------------------------------------------------------
|
||||||
***** ChangeLog for 3.4.2 compared to 3.4.1 *****
|
|
||||||
Fix: Bad rounding on margin calculations and display.
|
|
||||||
Fix: Option drop table into backup was broken.
|
|
||||||
|
|
||||||
***** ChangeLog for 3.5 compared to 3.4.* *****
|
***** ChangeLog for 3.5 compared to 3.4.* *****
|
||||||
For users:
|
For users:
|
||||||
@ -131,6 +128,10 @@ parameter. All methods addline in this case were modified to remove this paramet
|
|||||||
5) Property ->tel on objects is now ->phone
|
5) Property ->tel on objects is now ->phone
|
||||||
|
|
||||||
|
|
||||||
|
***** ChangeLog for 3.4.2 compared to 3.4.1 *****
|
||||||
|
Fix: Bad rounding on margin calculations and display.
|
||||||
|
Fix: Option drop table into backup was broken.
|
||||||
|
|
||||||
***** ChangeLog for 3.4.1 compared to 3.4.0 *****
|
***** ChangeLog for 3.4.1 compared to 3.4.0 *****
|
||||||
Fix: Display buying price on line edit when no supplier price is defined
|
Fix: Display buying price on line edit when no supplier price is defined
|
||||||
Fix: Retrieving of margin info when invoice created automatically from order
|
Fix: Retrieving of margin info when invoice created automatically from order
|
||||||
|
|||||||
@ -98,20 +98,26 @@ http://bugs.debian.org/package
|
|||||||
|
|
||||||
##### Testing a package into unstable env
|
##### Testing a package into unstable env
|
||||||
|
|
||||||
|
Check you have a mysql server available from another interface than localhost
|
||||||
|
Uncomment line if required and restart mysql
|
||||||
|
bind-address = 127.0.0.1
|
||||||
|
|
||||||
Create a chroot called "unstable-amd64-sbuild"
|
Create a chroot called "unstable-amd64-sbuild"
|
||||||
> sudo sbuild-createchroot --keyring= unstable /srv/chroot/unstable http://ftp.uk.debian.org/debian
|
> sudo sbuild-createchroot --keyring= unstable /srv/chroot/unstable http://ftp.uk.debian.org/debian
|
||||||
|
|
||||||
Pour lister les env chroot
|
Pour lister les env chroot
|
||||||
> schroot -l
|
> schroot -l
|
||||||
|
|
||||||
Puis pour se connecter
|
Puis pour se connecter et préparer l'environnement
|
||||||
> schroot -c name_of_chroot
|
> schroot -c name_of_chroot
|
||||||
|
> vi /usr/sbin/policy-rc.d and replace return code 101 (not allowed) into 0 (ok)
|
||||||
|
> apt-get install links mysql-client
|
||||||
|
|
||||||
Pour tester un package
|
Pour tester un package
|
||||||
> cp *.deb /srv/chroot/unstable/tmp
|
> cp *.deb /srv/chroot/unstable/tmp
|
||||||
> sudo schroot -c name_of_chroot
|
> sudo schroot -c name_of_chroot
|
||||||
> dpkg -i dolibarr*.deb
|
> dpkg -i dolibarr*.deb
|
||||||
> sudo apt-get install -f
|
> apt-get install -f
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -173,6 +179,12 @@ http://packages.qa.debian.org/t/tcpdf.html
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
##### Update but tracker system
|
||||||
|
To set status of a bug to pending
|
||||||
|
> bts tag 728235 +pending
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
##### Create/Maintain dolibarr package
|
##### Create/Maintain dolibarr package
|
||||||
|
|
||||||
To update dolibarr debian package
|
To update dolibarr debian package
|
||||||
|
|||||||
@ -17,9 +17,9 @@
|
|||||||
; ----- Change this -----
|
; ----- Change this -----
|
||||||
AppName=DoliWamp
|
AppName=DoliWamp
|
||||||
; DoliWamp-x.x.x or DoliWamp-x.x.x-alpha or DoliWamp-x.x.x-beta or DoliWamp-x.x.x-rc or DoliWamp-x.x.x
|
; DoliWamp-x.x.x or DoliWamp-x.x.x-alpha or DoliWamp-x.x.x-beta or DoliWamp-x.x.x-rc or DoliWamp-x.x.x
|
||||||
AppVerName=DoliWamp-3.5.0-alpha
|
AppVerName=DoliWamp-3.5.0-beta
|
||||||
; DoliWamp-x.x x or DoliWamp-x.x.x-alpha or DoliWamp-x.x.x-beta or DoliWamp-x.x.x-rc or DoliWamp-x.x.x
|
; DoliWamp-x.x x or DoliWamp-x.x.x-alpha or DoliWamp-x.x.x-beta or DoliWamp-x.x.x-rc or DoliWamp-x.x.x
|
||||||
OutputBaseFilename=DoliWamp-3.5.0-alpha
|
OutputBaseFilename=DoliWamp-3.5.0-beta
|
||||||
; Define full path from wich all relative path are defined
|
; Define full path from wich all relative path are defined
|
||||||
; You must modify this to put here your dolibarr root directory
|
; You must modify this to put here your dolibarr root directory
|
||||||
;SourceDir=Z:\home\ldestailleur\git\dolibarrxxx
|
;SourceDir=Z:\home\ldestailleur\git\dolibarrxxx
|
||||||
|
|||||||
@ -10,7 +10,7 @@ use Cwd;
|
|||||||
$PROJECT="dolibarr";
|
$PROJECT="dolibarr";
|
||||||
$MAJOR="3";
|
$MAJOR="3";
|
||||||
$MINOR="5";
|
$MINOR="5";
|
||||||
$BUILD="0-alpha"; # Mettre x pour release, x-dev pour dev, x-beta pour beta, x-rc pour release candidate
|
$BUILD="0-beta"; # Mettre x pour release, x-dev pour dev, x-beta pour beta, x-rc pour release candidate
|
||||||
$RPMSUBVERSION="auto"; # auto use value found into BUILD
|
$RPMSUBVERSION="auto"; # auto use value found into BUILD
|
||||||
|
|
||||||
@LISTETARGET=("TGZ","ZIP","RPM_GENERIC","RPM_FEDORA","RPM_MANDRIVA","RPM_OPENSUSE","DEB","APS","EXEDOLIWAMP","SNAPSHOT"); # Possible packages
|
@LISTETARGET=("TGZ","ZIP","RPM_GENERIC","RPM_FEDORA","RPM_MANDRIVA","RPM_OPENSUSE","DEB","APS","EXEDOLIWAMP","SNAPSHOT"); # Possible packages
|
||||||
|
|||||||
@ -325,10 +325,10 @@ then
|
|||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
# Upgrade
|
# Upgrade
|
||||||
echo "No remove ation done (this is an upgrade)"
|
echo "No remove action done (this is an upgrade)"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# version x.y.z-0.1.a for alpha, x.y.z-0.2.b for beta, x.y.z-0.3 for release
|
# version x.y.z-0.1.a for alpha, x.y.z-0.2.b for beta, x.y.z-0.3 for release
|
||||||
%changelog
|
%changelog
|
||||||
* Sun Feb 17 2013 Laurent Destailleur 3.5.0-0.1.a
|
* Wed Nov 6 2013 Laurent Destailleur 3.5.0-0.2.b
|
||||||
- Initial version (#723326)
|
- Initial version (#723326)
|
||||||
|
|||||||
@ -553,10 +553,10 @@ then
|
|||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
# Upgrade
|
# Upgrade
|
||||||
echo "No remove ation done (this is an upgrade)"
|
echo "No remove action done (this is an upgrade)"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# version x.y.z-0.1.a for alpha, x.y.z-0.2.b for beta, x.y.z-0.3 for release
|
# version x.y.z-0.1.a for alpha, x.y.z-0.2.b for beta, x.y.z-0.3 for release
|
||||||
%changelog
|
%changelog
|
||||||
* Sun Feb 17 2013 Laurent Destailleur 3.5.0-0.1.a
|
* Wed Nov 6 2013 Laurent Destailleur 3.5.0-0.2.b
|
||||||
- Initial version (#723326)
|
- Initial version (#723326)
|
||||||
|
|||||||
@ -329,11 +329,11 @@ then
|
|||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
# Upgrade
|
# Upgrade
|
||||||
echo "No remove ation done (this is an upgrade)"
|
echo "No remove action done (this is an upgrade)"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
# version x.y.z-0.1.a for alpha, x.y.z-0.2.b for beta, x.y.z-0.3 for release
|
# version x.y.z-0.1.a for alpha, x.y.z-0.2.b for beta, x.y.z-0.3 for release
|
||||||
%changelog
|
%changelog
|
||||||
* Sun Feb 17 2013 Laurent Destailleur 3.5.0-0.1.a
|
* Wed Nov 6 2013 Laurent Destailleur 3.5.0-0.2.b
|
||||||
- Initial version (#723326)
|
- Initial version (#723326)
|
||||||
|
|||||||
@ -339,11 +339,11 @@ then
|
|||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
# Upgrade
|
# Upgrade
|
||||||
echo "No remove ation done (this is an upgrade)"
|
echo "No remove action done (this is an upgrade)"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
# version x.y.z-0.1.a for alpha, x.y.z-0.2.b for beta, x.y.z-0.3 for release
|
# version x.y.z-0.1.a for alpha, x.y.z-0.2.b for beta, x.y.z-0.3 for release
|
||||||
%changelog
|
%changelog
|
||||||
* Sun Feb 17 2013 Laurent Destailleur 3.5.0-0.1.a
|
* Wed Nov 6 2013 Laurent Destailleur 3.5.0-0.2.b
|
||||||
- Initial version (#723326)
|
- Initial version (#723326)
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
@ -3,6 +3,7 @@
|
|||||||
* Copyright (C) 2004-2010 Laurent Destailleur <eldy@users.sourceforge.net>
|
* Copyright (C) 2004-2010 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
|
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
|
||||||
* Copyright (C) 2010 Juanjo Menent <jmenent@2byte.es>
|
* Copyright (C) 2010 Juanjo Menent <jmenent@2byte.es>
|
||||||
|
* Copyright (C) 2013 Cédric Salvador <csalvador@gpcsolutions.fr>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -60,47 +61,31 @@ if (! $sortfield) $sortfield="name";
|
|||||||
|
|
||||||
|
|
||||||
$upload_dir = $conf->adherent->dir_output . "/" . get_exdir($id,2,0,1) . '/' . $id;
|
$upload_dir = $conf->adherent->dir_output . "/" . get_exdir($id,2,0,1) . '/' . $id;
|
||||||
|
$form = new Form($db);
|
||||||
|
$object=new Adherent($db);
|
||||||
|
$membert=new AdherentType($db);
|
||||||
|
$result=$object->fetch($id);
|
||||||
|
if ($result < 0)
|
||||||
|
{
|
||||||
|
dol_print_error($db);
|
||||||
|
exit;
|
||||||
|
}
|
||||||
/*
|
/*
|
||||||
* Actions
|
* Actions
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// Envoie fichier
|
include_once DOL_DOCUMENT_ROOT . '/core/tpl/document_actions_pre_headers.tpl.php';
|
||||||
if (GETPOST('sendit') && ! empty($conf->global->MAIN_UPLOAD_DOC))
|
|
||||||
{
|
|
||||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
|
|
||||||
|
|
||||||
dol_add_file_process($upload_dir,0,1,'userfile');
|
|
||||||
}
|
|
||||||
|
|
||||||
// Suppression fichier
|
|
||||||
if ($action == 'confirm_deletefile' && $confirm == 'yes')
|
|
||||||
{
|
|
||||||
$langs->load("other");
|
|
||||||
$file = $upload_dir . "/" . GETPOST('urlfile'); // Do not use urldecode here ($_GET and $_REQUEST are already decoded by PHP).
|
|
||||||
$ret=dol_delete_file($file);
|
|
||||||
if ($ret) setEventMessage($langs->trans("FileWasRemoved", GETPOST('urlfile')));
|
|
||||||
else setEventMessage($langs->trans("ErrorFailToDeleteFile", GETPOST('urlfile')), 'errors');
|
|
||||||
header('Location: '.$_SERVER["PHP_SELF"].'?id='.$id);
|
|
||||||
exit;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* View
|
* View
|
||||||
*/
|
*/
|
||||||
|
|
||||||
$form = new Form($db);
|
|
||||||
$object=new Adherent($db);
|
|
||||||
$membert=new AdherentType($db);
|
|
||||||
|
|
||||||
llxHeader();
|
llxHeader();
|
||||||
|
|
||||||
if ($id > 0)
|
if ($id > 0)
|
||||||
{
|
{
|
||||||
$result=$object->fetch($id);
|
|
||||||
$result=$membert->fetch($object->typeid);
|
$result=$membert->fetch($object->typeid);
|
||||||
if ($result > 0)
|
if ($result > 0)
|
||||||
{
|
{
|
||||||
@ -180,23 +165,10 @@ if ($id > 0)
|
|||||||
|
|
||||||
print '</div>';
|
print '</div>';
|
||||||
|
|
||||||
/*
|
$modulepart = 'member';
|
||||||
* Confirmation suppression fichier
|
$permission = $user->rights->adherent->creer;
|
||||||
*/
|
$param = '&id=' . $object->id;
|
||||||
if ($action == 'delete')
|
include_once DOL_DOCUMENT_ROOT . '/core/tpl/document_actions_post_headers.tpl.php';
|
||||||
{
|
|
||||||
print $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id.'&urlfile='.urlencode(GETPOST("urlfile")), $langs->trans('DeleteFile'), $langs->trans('ConfirmDeleteFile'), 'confirm_deletefile', '', 0, 1);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// Affiche formulaire upload
|
|
||||||
$formfile=new FormFile($db);
|
|
||||||
$formfile->form_attach_new_file(DOL_URL_ROOT.'/adherents/document.php?id='.$object->id,'',0,0,$user->rights->adherent->creer,50,$object);
|
|
||||||
|
|
||||||
|
|
||||||
// List of document
|
|
||||||
$formfile->list_of_documents($filearray,$object,'member','', 0, get_exdir($object->id,2,0,1).'/'.$object->id.'/');
|
|
||||||
|
|
||||||
print "<br><br>";
|
print "<br><br>";
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|||||||
@ -4,6 +4,7 @@
|
|||||||
* Copyright (C) 2005 Marc Barilley / Ocebo <marc@ocebo.com>
|
* Copyright (C) 2005 Marc Barilley / Ocebo <marc@ocebo.com>
|
||||||
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
|
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
|
||||||
* Copyright (C) 2005 Simon TOSSER <simon@kornog-computing.com>
|
* Copyright (C) 2005 Simon TOSSER <simon@kornog-computing.com>
|
||||||
|
* Copyright (C) 2013 Cédric Salvador <csalvador@gpcsolutions.fr>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -40,8 +41,9 @@ $langs->load("commercial");
|
|||||||
$langs->load("other");
|
$langs->load("other");
|
||||||
$langs->load("bills");
|
$langs->load("bills");
|
||||||
|
|
||||||
$objectid = GETPOST('id','int');
|
$objectid = GETPOST('id', 'int');
|
||||||
$action=GETPOST('action','alpha');
|
$action=GETPOST('action', 'alpha');
|
||||||
|
$confirm = GETPOST('confirm', 'alpha');
|
||||||
|
|
||||||
// Security check
|
// Security check
|
||||||
$socid = GETPOST('socid','int');
|
$socid = GETPOST('socid','int');
|
||||||
@ -79,26 +81,9 @@ if (! $sortfield) $sortfield="name";
|
|||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Action envoie fichier
|
* Actions
|
||||||
*/
|
*/
|
||||||
if (GETPOST('sendit') && ! empty($conf->global->MAIN_UPLOAD_DOC))
|
include_once DOL_DOCUMENT_ROOT . '/core/tpl/document_actions_pre_headers.tpl.php';
|
||||||
{
|
|
||||||
$upload_dir = $conf->agenda->dir_output.'/'.dol_sanitizeFileName($objectid);
|
|
||||||
dol_add_file_process($upload_dir,0,1,'userfile');
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Efface fichier
|
|
||||||
*/
|
|
||||||
if ($action == 'delete')
|
|
||||||
{
|
|
||||||
$upload_dir = $conf->agenda->dir_output.'/'.dol_sanitizeFileName($objectid);
|
|
||||||
$file = $upload_dir . '/' . GETPOST('urlfile'); // Do not use urldecode here ($_GET and $_REQUEST are already decoded by PHP).
|
|
||||||
$ret=dol_delete_file($file,0,0,0,$act);
|
|
||||||
if ($ret) setEventMessage($langs->trans("FileWasRemoved", GETPOST('urlfile')));
|
|
||||||
else setEventMessage($langs->trans("ErrorFailToDeleteFile", GETPOST('urlfile')), 'errors');
|
|
||||||
$action='';
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -268,15 +253,10 @@ if ($act->id > 0)
|
|||||||
|
|
||||||
print '</div>';
|
print '</div>';
|
||||||
|
|
||||||
|
$modulepart = 'actions';
|
||||||
// Affiche formulaire upload
|
$permission = $user->rights->agenda->myactions->create||$user->rights->agenda->allactions->create;
|
||||||
$formfile=new FormFile($db);
|
$param = '&id=' . $act->id;
|
||||||
$formfile->form_attach_new_file(DOL_URL_ROOT.'/comm/action/document.php?id='.$act->id,'',0,0,($user->rights->agenda->myactions->create||$user->rights->agenda->allactions->create),50,$act);
|
include_once DOL_DOCUMENT_ROOT . '/core/tpl/document_actions_post_headers.tpl.php';
|
||||||
|
|
||||||
|
|
||||||
// List of document
|
|
||||||
$param='&id='.$act->id;
|
|
||||||
$formfile->list_of_documents($filearray,$act,'actions',$param,0,'',$user->rights->agenda->myactions->create);
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|||||||
@ -3,6 +3,7 @@
|
|||||||
* Copyright (C) 2004-2009 Laurent Destailleur <eldy@users.sourceforge.net>
|
* Copyright (C) 2004-2009 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
* Copyright (C) 2005 Marc Barilley / Ocebo <marc@ocebo.com>
|
* Copyright (C) 2005 Marc Barilley / Ocebo <marc@ocebo.com>
|
||||||
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
|
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
|
||||||
|
* Copyright (C) 2013 Cédric Salvador <csalvador@gpcsolutions.fr>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -64,38 +65,14 @@ $object->fetch($id,$ref);
|
|||||||
if ($object->id > 0)
|
if ($object->id > 0)
|
||||||
{
|
{
|
||||||
$object->fetch_thirdparty();
|
$object->fetch_thirdparty();
|
||||||
|
$upload_dir = $conf->propal->dir_output.'/'.dol_sanitizeFileName($object->ref);
|
||||||
|
include_once DOL_DOCUMENT_ROOT . '/core/tpl/document_actions_pre_headers.tpl.php';
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Actions
|
* Actions
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// Envoi fichier
|
|
||||||
if (GETPOST('sendit') && ! empty($conf->global->MAIN_UPLOAD_DOC))
|
|
||||||
{
|
|
||||||
if ($object->id > 0)
|
|
||||||
{
|
|
||||||
$upload_dir = $conf->propal->dir_output . "/" . dol_sanitizeFileName($object->ref);
|
|
||||||
dol_add_file_process($upload_dir,0,1,'userfile');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Delete
|
|
||||||
if ($action == 'confirm_deletefile' && $confirm == 'yes')
|
|
||||||
{
|
|
||||||
if ($object->id > 0)
|
|
||||||
{
|
|
||||||
$langs->load("other");
|
|
||||||
|
|
||||||
$upload_dir = $conf->propal->dir_output . "/" . dol_sanitizeFileName($object->ref);
|
|
||||||
$file = $upload_dir . '/' . GETPOST('urlfile'); // Do not use urldecode here ($_GET and $_REQUEST are already decoded by PHP).
|
|
||||||
$ret=dol_delete_file($file,0,0,0,$object);
|
|
||||||
if ($ret) setEventMessage($langs->trans("FileWasRemoved", GETPOST('urlfile')));
|
|
||||||
else setEventMessage($langs->trans("ErrorFailToDeleteFile", GETPOST('urlfile')), 'errors');
|
|
||||||
header('Location: '.$_SERVER["PHP_SELF"].'?id='.$id);
|
|
||||||
exit;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -153,21 +130,10 @@ if ($object->id > 0)
|
|||||||
|
|
||||||
print '</div>';
|
print '</div>';
|
||||||
|
|
||||||
/*
|
$modulepart = 'propal';
|
||||||
* Confirmation suppression fichier
|
$permission = $user->rights->propal->creer;
|
||||||
*/
|
$param = '&id=' . $object->id;
|
||||||
if ($action == 'delete')
|
include_once DOL_DOCUMENT_ROOT . '/core/tpl/document_actions_post_headers.tpl.php';
|
||||||
{
|
|
||||||
print $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id.'&urlfile='.urlencode(GETPOST("urlfile")), $langs->trans('DeleteFile'), $langs->trans('ConfirmDeleteFile'), 'confirm_deletefile', '', 0, 1);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Affiche formulaire upload
|
|
||||||
$formfile=new FormFile($db);
|
|
||||||
$formfile->form_attach_new_file($_SERVER['PHP_SELF'].'?id='.$object->id,'',0,0,$user->rights->propal->creer,50,$object);
|
|
||||||
|
|
||||||
|
|
||||||
// List of document
|
|
||||||
$formfile->list_of_documents($filearray,$object,'propal');
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|||||||
@ -3,6 +3,7 @@
|
|||||||
* Copyright (C) 2004-2008 Laurent Destailleur <eldy@users.sourceforge.net>
|
* Copyright (C) 2004-2008 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
* Copyright (C) 2005 Marc Barilley / Ocebo <marc@ocebo.com>
|
* Copyright (C) 2005 Marc Barilley / Ocebo <marc@ocebo.com>
|
||||||
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
|
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
|
||||||
|
* Copyright (C) 2013 Cédric Salvador <csalvador@gpcsolutions.fr>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -65,35 +66,13 @@ $object = new Commande($db);
|
|||||||
/*
|
/*
|
||||||
* Actions
|
* Actions
|
||||||
*/
|
*/
|
||||||
|
if ($object->fetch($id))
|
||||||
// Envoi fichier
|
|
||||||
if (GETPOST('sendit') && ! empty($conf->global->MAIN_UPLOAD_DOC))
|
|
||||||
{
|
{
|
||||||
if ($object->fetch($id))
|
|
||||||
{
|
|
||||||
$object->fetch_thirdparty();
|
$object->fetch_thirdparty();
|
||||||
$upload_dir = $conf->commande->dir_output . "/" . dol_sanitizeFileName($object->ref);
|
$upload_dir = $conf->commande->dir_output . "/" . dol_sanitizeFileName($object->ref);
|
||||||
dol_add_file_process($upload_dir,0,1,'userfile');
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Delete
|
include_once DOL_DOCUMENT_ROOT . '/core/tpl/document_actions_pre_headers.tpl.php';
|
||||||
else if ($action == 'confirm_deletefile' && $confirm == 'yes')
|
|
||||||
{
|
|
||||||
if ($object->fetch($id))
|
|
||||||
{
|
|
||||||
$langs->load("other");
|
|
||||||
$object->fetch_thirdparty();
|
|
||||||
|
|
||||||
$upload_dir = $conf->commande->dir_output . "/" . dol_sanitizeFileName($object->ref);
|
|
||||||
$file = $upload_dir . '/' . GETPOST('urlfile'); // Do not use urldecode here ($_GET and $_REQUEST are already decoded by PHP).
|
|
||||||
$ret=dol_delete_file($file,0,0,0,$object);
|
|
||||||
if ($ret) setEventMessage($langs->trans("FileWasRemoved", GETPOST('urlfile')));
|
|
||||||
else setEventMessage($langs->trans("ErrorFailToDeleteFile", GETPOST('urlfile')), 'errors');
|
|
||||||
header('Location: '.$_SERVER["PHP_SELF"].'?id='.$id);
|
|
||||||
exit;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -140,23 +119,10 @@ if ($id > 0 || ! empty($ref))
|
|||||||
print "</table>\n";
|
print "</table>\n";
|
||||||
print "</div>\n";
|
print "</div>\n";
|
||||||
|
|
||||||
/*
|
$modulepart = 'commande';
|
||||||
* Confirmation suppression fichier
|
$permission = $user->rights->commande->creer;
|
||||||
*/
|
$param = '&id=' . $object->id;
|
||||||
if ($action == 'delete')
|
include_once DOL_DOCUMENT_ROOT . '/core/tpl/document_actions_post_headers.tpl.php';
|
||||||
{
|
|
||||||
print $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id.'&urlfile='.urlencode($_GET["urlfile"]), $langs->trans('DeleteFile'), $langs->trans('ConfirmDeleteFile'), 'confirm_deletefile', '', 0, 1);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
// Affiche formulaire upload
|
|
||||||
$formfile=new FormFile($db);
|
|
||||||
$formfile->form_attach_new_file(DOL_URL_ROOT.'/commande/document.php?id='.$object->id,'',0,0,$user->rights->commande->creer,50,$object);
|
|
||||||
|
|
||||||
|
|
||||||
// List of document
|
|
||||||
$param='&id='.$object->id;
|
|
||||||
$formfile->list_of_documents($filearray,$object,'commande',$param);
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|||||||
@ -487,7 +487,7 @@ if ($id > 0 || ! empty($ref))
|
|||||||
$var=true;
|
$var=true;
|
||||||
|
|
||||||
$num = $db->num_rows($result);
|
$num = $db->num_rows($result);
|
||||||
$i = 0; $total = 0; $sep = 0;
|
$i = 0; $total = 0; $sep = -1;
|
||||||
|
|
||||||
while ($i < $num)
|
while ($i < $num)
|
||||||
{
|
{
|
||||||
@ -500,13 +500,14 @@ if ($id > 0 || ! empty($ref))
|
|||||||
// Is it a transaction in future ?
|
// Is it a transaction in future ?
|
||||||
$dos=dol_print_date($db->jdate($objp->do),'%Y%m%d');
|
$dos=dol_print_date($db->jdate($objp->do),'%Y%m%d');
|
||||||
//print "dos=".$dos." nows=".$nows;
|
//print "dos=".$dos." nows=".$nows;
|
||||||
if ($dos > $nows && !$sep) // Yes, we show a subtotal
|
if ($dos < $nows) $sep=0; // 0 means there was at least one line before current date
|
||||||
|
if ($dos > $nows && ! $sep) // We have found a line in future and we already found on line before current date
|
||||||
{
|
{
|
||||||
$sep = 1 ;
|
$sep = 1 ;
|
||||||
print '<tr class="liste_total"><td colspan="8">';
|
print '<tr class="liste_total"><td colspan="8">';
|
||||||
print $langs->trans("CurrentBalance");
|
print $langs->trans("CurrentBalance");
|
||||||
print '</td>';
|
print '</td>';
|
||||||
print '<td align="right" nowrap><b>'.price($total - $objp->amount).'</b></td>';
|
print '<td align="right" class="nowrap"><b>'.price($total - $objp->amount).'</b></td>';
|
||||||
print "<td> </td>";
|
print "<td> </td>";
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
}
|
}
|
||||||
@ -754,10 +755,10 @@ if ($id > 0 || ! empty($ref))
|
|||||||
if ($page == 0 && ! $mode_search)
|
if ($page == 0 && ! $mode_search)
|
||||||
{
|
{
|
||||||
print '<tr class="liste_total"><td align="left" colspan="8">';
|
print '<tr class="liste_total"><td align="left" colspan="8">';
|
||||||
if ($sep) print ' ';
|
if ($sep > 0) print ' '; // If we had at least one line in future
|
||||||
else print $langs->trans("CurrentBalance");
|
else print $langs->trans("CurrentBalance");
|
||||||
print '</td>';
|
print '</td>';
|
||||||
print '<td align="right" nowrap>'.price($total).'</td>';
|
print '<td align="right" nowrap><b>'.price($total).'</b></td>';
|
||||||
print '<td> </td>';
|
print '<td> </td>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
}
|
}
|
||||||
|
|||||||
@ -5,6 +5,7 @@
|
|||||||
* Copyright (C) 2005-2009 Regis Houssin <regis.houssin@capnetworks.com>
|
* Copyright (C) 2005-2009 Regis Houssin <regis.houssin@capnetworks.com>
|
||||||
* Copyright (C) 2005 Simon TOSSER <simon@kornog-computing.com>
|
* Copyright (C) 2005 Simon TOSSER <simon@kornog-computing.com>
|
||||||
* Copyright (C) 2011-2012 Juanjo Menent <jmenent@2byte.es>
|
* Copyright (C) 2011-2012 Juanjo Menent <jmenent@2byte.es>
|
||||||
|
* Copyright (C) 2013 Cédric Salvador <csalvador@gpcsolutions.fr>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -71,29 +72,7 @@ $modulepart='trip';
|
|||||||
* Actions
|
* Actions
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if (GETPOST('sendit','alpha') && ! empty($conf->global->MAIN_UPLOAD_DOC))
|
include_once DOL_DOCUMENT_ROOT . '/core/tpl/document_actions_pre_headers.tpl.php';
|
||||||
{
|
|
||||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
|
|
||||||
|
|
||||||
dol_add_file_process($upload_dir,0,1,'userfile');
|
|
||||||
}
|
|
||||||
|
|
||||||
// Delete
|
|
||||||
else if ($action == 'confirm_deletefile' && $confirm == 'yes')
|
|
||||||
{
|
|
||||||
if ($object->id > 0)
|
|
||||||
{
|
|
||||||
$langs->load("other");
|
|
||||||
$object->fetch_thirdparty();
|
|
||||||
|
|
||||||
$file = $upload_dir . '/' . GETPOST('urlfile'); // Do not use urldecode here ($_GET and $_REQUEST are already decoded by PHP).
|
|
||||||
$ret=dol_delete_file($file,0,0,0,$object);
|
|
||||||
if ($ret) setEventMessage($langs->trans("FileWasRemoved", GETPOST('urlfile')));
|
|
||||||
else setEventMessage($langs->trans("ErrorFailToDeleteFile", GETPOST('urlfile')), 'errors');
|
|
||||||
header('Location: '.$_SERVER["PHP_SELF"].'?id='.$id);
|
|
||||||
exit;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -141,23 +120,10 @@ if ($object->id)
|
|||||||
|
|
||||||
print '</div>';
|
print '</div>';
|
||||||
|
|
||||||
/*
|
$modulepart = 'deplacement';
|
||||||
* Confirmation suppression fichier
|
$permission = $user->rights->deplacement->creer;
|
||||||
*/
|
$param = '&id=' . $object->id;
|
||||||
if ($action == 'delete')
|
include_once DOL_DOCUMENT_ROOT . '/core/tpl/document_actions_post_headers.tpl.php';
|
||||||
{
|
|
||||||
print $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id.'&urlfile='.urlencode($_GET["urlfile"]), $langs->trans('DeleteFile'), $langs->trans('ConfirmDeleteFile'), 'confirm_deletefile', '', 0, 1);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
// Affiche formulaire upload
|
|
||||||
$formfile=new FormFile($db);
|
|
||||||
$formfile->form_attach_new_file(DOL_URL_ROOT.'/compta/deplacement/document.php?id='.$object->id,'',0,0,$user->rights->deplacement->creer,50,$object);
|
|
||||||
|
|
||||||
|
|
||||||
// List of document
|
|
||||||
$param='&id='.$object->id;
|
|
||||||
$formfile->list_of_documents($filearray,$object,'deplacement',$param);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|||||||
@ -3,6 +3,7 @@
|
|||||||
* Copyright (C) 2004-2008 Laurent Destailleur <eldy@users.sourceforge.net>
|
* Copyright (C) 2004-2008 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
* Copyright (C) 2005 Marc Barilley / Ocebo <marc@ocebo.com>
|
* Copyright (C) 2005 Marc Barilley / Ocebo <marc@ocebo.com>
|
||||||
* Copyright (C) 2005-2011 Regis Houssin <regis.houssin@capnetworks.com>
|
* Copyright (C) 2005-2011 Regis Houssin <regis.houssin@capnetworks.com>
|
||||||
|
* Copyright (C) 2013 Cédric Salvador <csalvador@gpcsolutions.fr>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -64,40 +65,17 @@ if (! $sortorder) $sortorder="ASC";
|
|||||||
if (! $sortfield) $sortfield="name";
|
if (! $sortfield) $sortfield="name";
|
||||||
|
|
||||||
$object = new Facture($db);
|
$object = new Facture($db);
|
||||||
|
if ($object->fetch($id))
|
||||||
|
{
|
||||||
|
$object->fetch_thirdparty();
|
||||||
|
$upload_dir = $conf->facture->dir_output . "/" . dol_sanitizeFileName($object->ref);
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Actions
|
* Actions
|
||||||
*/
|
*/
|
||||||
|
include_once DOL_DOCUMENT_ROOT . '/core/tpl/document_actions_pre_headers.tpl.php';
|
||||||
|
|
||||||
// Envoi fichier
|
|
||||||
if (GETPOST('sendit') && ! empty($conf->global->MAIN_UPLOAD_DOC))
|
|
||||||
{
|
|
||||||
if ($object->fetch($id))
|
|
||||||
{
|
|
||||||
$object->fetch_thirdparty();
|
|
||||||
$upload_dir = $conf->facture->dir_output . "/" . dol_sanitizeFileName($object->ref);
|
|
||||||
dol_add_file_process($upload_dir,0,1,'userfile');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Delete
|
|
||||||
if ($action == 'confirm_deletefile' && $confirm == 'yes')
|
|
||||||
{
|
|
||||||
if ($object->fetch($id))
|
|
||||||
{
|
|
||||||
$langs->load("other");
|
|
||||||
$object->fetch_thirdparty();
|
|
||||||
|
|
||||||
$upload_dir = $conf->facture->dir_output . "/" . dol_sanitizeFileName($object->ref);
|
|
||||||
$file = $upload_dir . '/' . GETPOST('urlfile'); // Do not use urldecode here ($_GET and $_REQUEST are already decoded by PHP).
|
|
||||||
$ret=dol_delete_file($file,0,0,0,$object);
|
|
||||||
if ($ret) setEventMessage($langs->trans("FileWasRemoved", GETPOST('urlfile')));
|
|
||||||
else setEventMessage($langs->trans("ErrorFailToDeleteFile", GETPOST('urlfile')), 'errors');
|
|
||||||
header('Location: '.$_SERVER["PHP_SELF"].'?id='.$id);
|
|
||||||
exit;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* View
|
* View
|
||||||
@ -169,24 +147,10 @@ if ($id > 0 || ! empty($ref))
|
|||||||
print "</table>\n";
|
print "</table>\n";
|
||||||
print "</div>\n";
|
print "</div>\n";
|
||||||
|
|
||||||
/*
|
$modulepart = 'facture';
|
||||||
* Confirmation suppression fichier
|
$permission = $user->rights->facture->creer;
|
||||||
*/
|
$param = '&id=' . $object->id;
|
||||||
if ($action == 'delete')
|
include_once DOL_DOCUMENT_ROOT . '/core/tpl/document_actions_post_headers.tpl.php';
|
||||||
{
|
|
||||||
print $form->formconfirm($_SERVER["PHP_SELF"].'?facid='.$id.'&urlfile='.urlencode(GETPOST("urlfile")), $langs->trans('DeleteFile'), $langs->trans('ConfirmDeleteFile'), 'confirm_deletefile', '', 0, 1);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// Affiche formulaire upload
|
|
||||||
$formfile=new FormFile($db);
|
|
||||||
$formfile->form_attach_new_file(DOL_URL_ROOT.'/compta/facture/document.php?facid='.$object->id,'',0,0,$user->rights->facture->creer,50,$object);
|
|
||||||
|
|
||||||
|
|
||||||
// List of document
|
|
||||||
$param='&facid='.$object->id;
|
|
||||||
$formfile->list_of_documents($filearray,$object,'facture',$param);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|||||||
@ -5,6 +5,7 @@
|
|||||||
* Copyright (C) 2005-2009 Regis Houssin <regis.houssin@capnetworks.com>
|
* Copyright (C) 2005-2009 Regis Houssin <regis.houssin@capnetworks.com>
|
||||||
* Copyright (C) 2005 Simon TOSSER <simon@kornog-computing.com>
|
* Copyright (C) 2005 Simon TOSSER <simon@kornog-computing.com>
|
||||||
* Copyright (C) 2011 Juanjo Menent <jmenent@2byte.es>
|
* Copyright (C) 2011 Juanjo Menent <jmenent@2byte.es>
|
||||||
|
* Copyright (C) 2013 Cédric Salvador <csalvador@gpcsolutions.fr>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -40,6 +41,7 @@ $langs->load("bills");
|
|||||||
|
|
||||||
$id = GETPOST('id','int');
|
$id = GETPOST('id','int');
|
||||||
$action = GETPOST("action");
|
$action = GETPOST("action");
|
||||||
|
$confirm = GETPOST('confirm', 'alpha');
|
||||||
|
|
||||||
// Security check
|
// Security check
|
||||||
if ($user->societe_id) $socid=$user->societe_id;
|
if ($user->societe_id) $socid=$user->societe_id;
|
||||||
@ -71,18 +73,7 @@ $modulepart='tax';
|
|||||||
* Actions
|
* Actions
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if (GETPOST("sendit") && ! empty($conf->global->MAIN_UPLOAD_DOC))
|
include_once DOL_DOCUMENT_ROOT . '/core/tpl/document_actions_pre_headers.tpl.php';
|
||||||
{
|
|
||||||
dol_add_file_process($upload_dir,0,1,'userfile');
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($action == 'delete')
|
|
||||||
{
|
|
||||||
$file = $upload_dir . '/' . GETPOST("urlfile"); // Do not use urldecode here ($_GET and $_REQUEST are already decoded by PHP).
|
|
||||||
$ret=dol_delete_file($file,0,0,0,$object);
|
|
||||||
if ($ret) setEventMessage($langs->trans("FileWasRemoved", GETPOST('urlfile')));
|
|
||||||
else setEventMessage($langs->trans("ErrorFailToDeleteFile", GETPOST('urlfile')), 'errors');
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -169,16 +160,10 @@ if ($object->id)
|
|||||||
|
|
||||||
print '</div>';
|
print '</div>';
|
||||||
|
|
||||||
|
$modulepart = 'tax';
|
||||||
// Affiche formulaire upload
|
$permission = $user->rights->tax->charges->creer;
|
||||||
$formfile=new FormFile($db);
|
$param = '&id=' . $object->id;
|
||||||
$formfile->form_attach_new_file(DOL_URL_ROOT.'/compta/sociales/document.php?id='.$object->id,'',0,0,$user->rights->tax->charges->creer,50,$object);
|
include_once DOL_DOCUMENT_ROOT . '/core/tpl/document_actions_post_headers.tpl.php';
|
||||||
|
|
||||||
|
|
||||||
// List of document
|
|
||||||
//$param='&id='.$object->id;
|
|
||||||
$formfile->list_of_documents($filearray,$object,'tax',$param);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|||||||
@ -4,6 +4,7 @@
|
|||||||
* Copyright (C) 2005 Marc Barilley / Ocebo <marc@ocebo.com>
|
* Copyright (C) 2005 Marc Barilley / Ocebo <marc@ocebo.com>
|
||||||
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
|
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
|
||||||
* Copyright (C) 2005 Simon TOSSER <simon@kornog-computing.com>
|
* Copyright (C) 2005 Simon TOSSER <simon@kornog-computing.com>
|
||||||
|
* Copyright (C) 2013 Cédric Salvador <csalvador@gpcsolutions.fr>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -74,28 +75,9 @@ $modulepart='contract';
|
|||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Action envoie fichier
|
* Actions
|
||||||
*/
|
*/
|
||||||
if (GETPOST('sendit') && ! empty($conf->global->MAIN_UPLOAD_DOC))
|
include_once DOL_DOCUMENT_ROOT . '/core/tpl/document_actions_pre_headers.tpl.php';
|
||||||
{
|
|
||||||
dol_add_file_process($upload_dir,0,1,'userfile');
|
|
||||||
}
|
|
||||||
|
|
||||||
// Delete
|
|
||||||
if ($action == 'confirm_deletefile' && $confirm == 'yes')
|
|
||||||
{
|
|
||||||
if ($object->id)
|
|
||||||
{
|
|
||||||
$langs->load("other");
|
|
||||||
|
|
||||||
$file = $upload_dir . '/' . GETPOST('urlfile'); // Do not use urldecode here ($_GET and $_REQUEST are already decoded by PHP).
|
|
||||||
$ret=dol_delete_file($file,0,0,0,$object);
|
|
||||||
if ($ret) setEventMessage($langs->trans("FileWasRemoved", GETPOST('urlfile')));
|
|
||||||
else setEventMessage($langs->trans("ErrorFailToDeleteFile", GETPOST('urlfile')), 'errors');
|
|
||||||
header('Location: '.$_SERVER["PHP_SELF"].'?id='.$object->id);
|
|
||||||
exit;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -140,24 +122,10 @@ if ($object->id)
|
|||||||
|
|
||||||
print '</div>';
|
print '</div>';
|
||||||
|
|
||||||
/*
|
$modulepart = 'contract';
|
||||||
* Confirmation suppression fichier
|
$permission = $user->rights->contrat->creer;
|
||||||
*/
|
$param = '&id=' . $object->id;
|
||||||
if ($action == 'delete')
|
include_once DOL_DOCUMENT_ROOT . '/core/tpl/document_actions_post_headers.tpl.php';
|
||||||
{
|
|
||||||
print $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$id.'&urlfile='.urlencode(GETPOST("urlfile")), $langs->trans('DeleteFile'), $langs->trans('ConfirmDeleteFile'), 'confirm_deletefile', '', 0, 1);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// Affiche formulaire upload
|
|
||||||
$formfile=new FormFile($db);
|
|
||||||
$formfile->form_attach_new_file($_SERVER['PHP_SELF'].'?id='.$object->id,'',0,0,$user->rights->contrat->creer,50,$object);
|
|
||||||
|
|
||||||
|
|
||||||
// List of document
|
|
||||||
$param='&id='.$object->id;
|
|
||||||
$formfile->list_of_documents($filearray,$object,'contract',$param);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|||||||
@ -3,6 +3,7 @@
|
|||||||
* Copyright (C) 2010-2012 Regis Houssin <regis.houssin@capnetworks.com>
|
* Copyright (C) 2010-2012 Regis Houssin <regis.houssin@capnetworks.com>
|
||||||
* Copyright (c) 2010 Juanjo Menent <jmenent@2byte.es>
|
* Copyright (c) 2010 Juanjo Menent <jmenent@2byte.es>
|
||||||
* Copyright (c) 2013 Charles-Fr BENKE <charles.fr@benke.fr>
|
* Copyright (c) 2013 Charles-Fr BENKE <charles.fr@benke.fr>
|
||||||
|
* Copyright (C) 2013 Cédric Salvador <csalvador@gpcsolutions.fr>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -59,12 +60,13 @@ class FormFile
|
|||||||
* @param int $perm Value of permission to allow upload
|
* @param int $perm Value of permission to allow upload
|
||||||
* @param int $size Length of input file area
|
* @param int $size Length of input file area
|
||||||
* @param Object $object Object to use (when attachment is done on an element)
|
* @param Object $object Object to use (when attachment is done on an element)
|
||||||
* @param string $options Options
|
* @param string $options Add an option column
|
||||||
* @param boolean $useajax Use fileupload ajax (0=never, 1=if enabled, 2=always whatever is option). 2 should never be used.
|
* @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 $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
|
||||||
* @return int <0 if KO, >0 if OK
|
* @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='')
|
function form_attach_new_file($url, $title='', $addcancel=0, $sectionid=0, $perm=1, $size=50, $object='', $options='', $useajax=1, $savingdocmask='', $linkfiles=1)
|
||||||
{
|
{
|
||||||
global $conf,$langs, $hookmanager;
|
global $conf,$langs, $hookmanager;
|
||||||
$hookmanager->initHooks(array('formfile'));
|
$hookmanager->initHooks(array('formfile'));
|
||||||
@ -76,6 +78,7 @@ class FormFile
|
|||||||
// TODO: Cheeck this works with 2 forms on same page
|
// TODO: Cheeck this works with 2 forms on same page
|
||||||
// TODO: Cheeck this works with GED module, otherwise, force useajax to 0
|
// TODO: Cheeck this works with GED module, otherwise, force useajax to 0
|
||||||
// TODO: This does not support option savingdocmask
|
// TODO: This does not support option savingdocmask
|
||||||
|
// TODO: This break feature to upload links too
|
||||||
return $this->_formAjaxFileUpload($object);
|
return $this->_formAjaxFileUpload($object);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -154,13 +157,46 @@ class FormFile
|
|||||||
$out .= '</form>';
|
$out .= '</form>';
|
||||||
if (empty($sectionid)) $out .= '<br>';
|
if (empty($sectionid)) $out .= '<br>';
|
||||||
|
|
||||||
$out .= "\n<!-- End form attach new file -->\n\n";
|
$out .= "\n<!-- End form attach new file -->\n";
|
||||||
|
|
||||||
|
if ($linkfiles)
|
||||||
|
{
|
||||||
|
$out .= "\n<!-- Start form attach new link -->\n";
|
||||||
|
$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 .= '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||||
|
|
||||||
|
$out .= '<table width="100%" class="nobordernopadding">';
|
||||||
|
$out .= '<tr>';
|
||||||
|
$out .= '<td valign="middle" class="nowrap">';
|
||||||
|
$out .= $langs->trans("Link") . ': ';
|
||||||
|
$out .= '<input type="text" name="link" id="link">';
|
||||||
|
$out .= ' ' . $langs->trans("Label") . ': ';
|
||||||
|
$out .= '<input type="text" name="label" id="label">';
|
||||||
|
$out .= '<input type="hidden" name="objecttype" value="' . $object->element . '">';
|
||||||
|
$out .= '<input type="hidden" name="objectid" value="' . $object->id . '">';
|
||||||
|
$out .= '<input type="submit" class="button" name="linkit" value="'.$langs->trans("ToLink").'"';
|
||||||
|
$out .= (empty($conf->global->MAIN_UPLOAD_DOC) || empty($perm)?' disabled="disabled"':'');
|
||||||
|
$out .= '>';
|
||||||
|
$out .= '</td></tr>';
|
||||||
|
$out .= '</table>';
|
||||||
|
|
||||||
|
$out .= '</form><br>';
|
||||||
$parameters = array('socid'=>(isset($GLOBALS['socid'])?$GLOBALS['socid']:''),'id'=>(isset($GLOBALS['id'])?$GLOBALS['id']:''), 'url'=>$url, 'perm'=>$perm);
|
$parameters = array('socid'=>(isset($GLOBALS['socid'])?$GLOBALS['socid']:''),'id'=>(isset($GLOBALS['id'])?$GLOBALS['id']:''), 'url'=>$url, 'perm'=>$perm);
|
||||||
$res = $hookmanager->executeHooks('formattachOptions',$parameters,$object);
|
$res = $hookmanager->executeHooks('formattachOptions',$parameters,$object);
|
||||||
|
|
||||||
|
$out .= "\n<!-- End form attach new file -->\n";
|
||||||
|
}
|
||||||
|
|
||||||
if (empty($res))
|
if (empty($res))
|
||||||
{
|
{
|
||||||
print $out;
|
print $out;
|
||||||
}
|
}
|
||||||
|
|
||||||
print $hookmanager->resPrint;
|
print $hookmanager->resPrint;
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
@ -994,6 +1030,134 @@ class FormFile
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Show array with linked files
|
||||||
|
*
|
||||||
|
* @param Object $object Object
|
||||||
|
* @param int $permtodelete Deletion is allowed
|
||||||
|
* @param string $action Action
|
||||||
|
* @param string $selected ???
|
||||||
|
* @return int Number of links
|
||||||
|
*/
|
||||||
|
public function listOfLinks($object, $permtodelete=1, $action=null, $selected=null)
|
||||||
|
{
|
||||||
|
global $user, $conf, $langs, $user;
|
||||||
|
global $bc;
|
||||||
|
global $sortfield, $sortorder;
|
||||||
|
|
||||||
|
require_once DOL_DOCUMENT_ROOT . '/link/class/link.class.php';
|
||||||
|
$link = new Link($this->db);
|
||||||
|
$links = array();
|
||||||
|
if ($sortfield == "name") {
|
||||||
|
$sortfield = "label";
|
||||||
|
} elseif ($sortfield == "date") {
|
||||||
|
$sortfield = "datea";
|
||||||
|
} else {
|
||||||
|
$sortfield = null;
|
||||||
|
}
|
||||||
|
$res = $link->fetchAll($links, $object->element, $object->id, $sortfield, $sortorder);
|
||||||
|
$param = (isset($object->id)?'&id=' . $object->id : '');
|
||||||
|
|
||||||
|
// Show list of associated links
|
||||||
|
print_titre($langs->trans("LinkedFiles"));
|
||||||
|
print '<table width="100%" class="liste">';
|
||||||
|
print '<tr class="liste_titre">';
|
||||||
|
print_liste_field_titre(
|
||||||
|
$langs->trans("Documents2"),
|
||||||
|
$_SERVER['PHP_SELF'],
|
||||||
|
"name",
|
||||||
|
"",
|
||||||
|
$param,
|
||||||
|
'align="left"',
|
||||||
|
$sortfield,
|
||||||
|
$sortorder
|
||||||
|
);
|
||||||
|
print_liste_field_titre(
|
||||||
|
$langs->trans("Size"),
|
||||||
|
"",
|
||||||
|
"",
|
||||||
|
"",
|
||||||
|
"",
|
||||||
|
'align="right"'
|
||||||
|
);
|
||||||
|
print_liste_field_titre(
|
||||||
|
$langs->trans("Date"),
|
||||||
|
$_SERVER['PHP_SELF'],
|
||||||
|
"date",
|
||||||
|
"",
|
||||||
|
$param,
|
||||||
|
'align="center"',
|
||||||
|
$sortfield,
|
||||||
|
$sortorder
|
||||||
|
);
|
||||||
|
print_liste_field_titre(
|
||||||
|
'',
|
||||||
|
$_SERVER['PHP_SELF'],
|
||||||
|
"",
|
||||||
|
"",
|
||||||
|
$param,
|
||||||
|
'align="center"'
|
||||||
|
);
|
||||||
|
print_liste_field_titre('','','');
|
||||||
|
print '</tr>';
|
||||||
|
$nboflinks = count($links);
|
||||||
|
if ($nboflinks > 0) {
|
||||||
|
include_once DOL_DOCUMENT_ROOT.'/core/lib/images.lib.php';
|
||||||
|
}
|
||||||
|
|
||||||
|
$var = true;
|
||||||
|
foreach ($links as $link) {
|
||||||
|
$var =! $var;
|
||||||
|
print '<tr ' . $bc[$var] . '>';
|
||||||
|
//edit mode
|
||||||
|
if ($action == 'update' && $selected === $link->id) {
|
||||||
|
print '<form action="' . $_SERVER['PHP_SELF'] . '?id=' . $object->id . '" method="post">';
|
||||||
|
print '<input type="hidden" name="linkid" value="' . $link->id . '">';
|
||||||
|
print '<input type="hidden" name="action" value="confirm_updateline">';
|
||||||
|
print '<td>';
|
||||||
|
print $langs->trans('Link') . ': <input type="text" name="link" value = "' . $link->url . '">';
|
||||||
|
print '</td>';
|
||||||
|
print '<td align="right">';
|
||||||
|
print $langs->trans('Label') . ': <input type="text" name="label" value = "' . $link->label . '">';
|
||||||
|
print '</td>';
|
||||||
|
print '<td align="center">' . dol_print_date(dol_now(), "dayhour", "tzuser") . '</td>';
|
||||||
|
print '<td align="right"></td>';
|
||||||
|
print '<td align="right" colspan="2"><input type="submit" name="save" class="button" value="' . $langs->trans('Save') . '">';
|
||||||
|
print '<input type="submit" name="cancel" class="button" value="' . $langs->trans('Cancel') . '"></td>';
|
||||||
|
print '</form>';
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
print '<td>';
|
||||||
|
print '<a data-ajax="false" href="'. $link->url . '" target="_blank">';
|
||||||
|
print $link->label;
|
||||||
|
print '</a>';
|
||||||
|
print "</td>\n";
|
||||||
|
print '<td align="right"></td>';
|
||||||
|
print '<td align="center">' . dol_print_date($link->datea, "dayhour", "tzuser") . '</td>';
|
||||||
|
print '<td align="center"></td>';
|
||||||
|
print '<td align="right" colspan="2">';
|
||||||
|
print '<a href="' . $_SERVER['PHP_SELF'] . '?action=update&linkid=' . $link->id
|
||||||
|
. '&id=' . $object->id . '" class="editfilelink" >' . img_edit().'</a>';
|
||||||
|
if ($permtodelete) {
|
||||||
|
print '<a href="'. $_SERVER['PHP_SELF'] .'?action=delete&linkid=' . $link->id
|
||||||
|
. '&id=' . $object->id . '" class="deletefilelink" >' . img_delete() . '</a>';
|
||||||
|
} else {
|
||||||
|
print ' ';
|
||||||
|
}
|
||||||
|
print "</td>";
|
||||||
|
}
|
||||||
|
print "</tr>\n";
|
||||||
|
}
|
||||||
|
if ($nboflinks == 0) {
|
||||||
|
print '<tr ' . $bc[$var] . '><td colspan="4">';
|
||||||
|
print $langs->trans("NoLinkFound");
|
||||||
|
print '</td></tr>';
|
||||||
|
}
|
||||||
|
print "</table>";
|
||||||
|
|
||||||
|
return $nboflinks;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|||||||
@ -995,9 +995,10 @@ function dol_init_file_process($pathtoscan='')
|
|||||||
* @param int $donotupdatesession 1=Do no edit _SESSION variable
|
* @param int $donotupdatesession 1=Do no edit _SESSION variable
|
||||||
* @param string $varfiles _FILES var name
|
* @param string $varfiles _FILES var name
|
||||||
* @param string $savingdocmask Mask to use to define output filename. For example 'XXXXX-__YYYYMMDD__-__file__'
|
* @param string $savingdocmask Mask to use to define output filename. For example 'XXXXX-__YYYYMMDD__-__file__'
|
||||||
|
* @param string $link Link to add
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
function dol_add_file_process($upload_dir, $allowoverwrite=0, $donotupdatesession=0, $varfiles='addedfile', $savingdocmask='')
|
function dol_add_file_process($upload_dir, $allowoverwrite=0, $donotupdatesession=0, $varfiles='addedfile', $savingdocmask='', $link=null)
|
||||||
{
|
{
|
||||||
global $db,$user,$conf,$langs;
|
global $db,$user,$conf,$langs;
|
||||||
|
|
||||||
@ -1054,6 +1055,23 @@ function dol_add_file_process($upload_dir, $allowoverwrite=0, $donotupdatesessio
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
} elseif ($link) {
|
||||||
|
if (dol_mkdir($upload_dir) >= 0) {
|
||||||
|
require_once DOL_DOCUMENT_ROOT . '/link/class/link.class.php';
|
||||||
|
$linkObject = new Link($db);
|
||||||
|
$linkObject->entity = $conf->entity;
|
||||||
|
$linkObject->url = $link;
|
||||||
|
$linkObject->objecttype = GETPOST('objecttype', 'alpha');
|
||||||
|
$linkObject->objectid = GETPOST('objectid', 'int');
|
||||||
|
$linkObject->label = GETPOST('label', 'alpha');
|
||||||
|
$res = $linkObject->create($user);
|
||||||
|
$langs->load('link');
|
||||||
|
if ($res > 0) {
|
||||||
|
setEventMessage($langs->trans("LinkComplete"));
|
||||||
|
} else {
|
||||||
|
setEventMessage($langs->trans("ErrorFileNotLinked"), 'errors');
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|||||||
@ -69,10 +69,12 @@ function dol_decode($chain)
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns a hash of a string
|
* Returns a hash of a string.
|
||||||
|
* If constant MAIN_SECURITY_HASH_ALGO is defined, we use this function as hashing function (md5 by default)
|
||||||
|
* If constant MAIN_SECURITY_SALT is defined, we use it as a salt
|
||||||
*
|
*
|
||||||
* @param string $chain String to hash
|
* @param string $chain String to hash
|
||||||
* @param int $type Type of hash (0:md5, 1:sha1, 2:sha1+md5)
|
* @param int $type Type of hash (0:auto, 1:sha1, 2:sha1+md5)
|
||||||
* @return string Hash of string
|
* @return string Hash of string
|
||||||
*/
|
*/
|
||||||
function dol_hash($chain,$type=0)
|
function dol_hash($chain,$type=0)
|
||||||
@ -84,6 +86,8 @@ function dol_hash($chain,$type=0)
|
|||||||
|
|
||||||
if ($type == 1) return sha1($chain);
|
if ($type == 1) return sha1($chain);
|
||||||
else if ($type == 2) return sha1(md5($chain));
|
else if ($type == 2) return sha1(md5($chain));
|
||||||
|
else if (! empty($conf->global->MAIN_SECURITY_HASH_ALGO) && $conf->global->MAIN_SECURITY_HASH_ALGO == 'sha1') return sha1($chain);
|
||||||
|
else if (! empty($conf->global->MAIN_SECURITY_HASH_ALGO) && $conf->global->MAIN_SECURITY_HASH_ALGO == 'sha1md5') return sha1(md5($chain));
|
||||||
else return md5($chain);
|
else return md5($chain);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
63
htdocs/core/tpl/document_actions_post_headers.tpl.php
Normal file
63
htdocs/core/tpl/document_actions_post_headers.tpl.php
Normal file
@ -0,0 +1,63 @@
|
|||||||
|
<?php
|
||||||
|
/* Copyright (C) 2013 Cédric Salvador <csalvador@gpcsolutions.fr>
|
||||||
|
*
|
||||||
|
* This program is free software; you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation; either version 3 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/
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Confirm suppression
|
||||||
|
*/
|
||||||
|
if ($action == 'delete') {
|
||||||
|
$ret = $form->form_confirm(
|
||||||
|
$_SERVER["PHP_SELF"] . '?id=' . $object->id . '&urlfile=' . urlencode(GETPOST("urlfile")) . '&linkid=' . GETPOST('linkid', 'int'),
|
||||||
|
$langs->trans('DeleteFile'),
|
||||||
|
$langs->trans('ConfirmDeleteFile'),
|
||||||
|
'confirm_deletefile',
|
||||||
|
'',
|
||||||
|
0,
|
||||||
|
1
|
||||||
|
);
|
||||||
|
if ($ret == 'html') print '<br>';
|
||||||
|
}
|
||||||
|
|
||||||
|
$formfile=new FormFile($db);
|
||||||
|
|
||||||
|
// Show upload form
|
||||||
|
$formfile->form_attach_new_file(
|
||||||
|
$_SERVER["PHP_SELF"].'?id='.$object->id,
|
||||||
|
'',
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
$permission,
|
||||||
|
50,
|
||||||
|
$object
|
||||||
|
);
|
||||||
|
|
||||||
|
// List of document
|
||||||
|
$formfile->list_of_documents(
|
||||||
|
$filearray,
|
||||||
|
$object,
|
||||||
|
$modulepart,
|
||||||
|
$param,
|
||||||
|
0,
|
||||||
|
'',
|
||||||
|
$permission
|
||||||
|
);
|
||||||
|
|
||||||
|
print "<br>";
|
||||||
|
//List of links
|
||||||
|
$formfile->listOfLinks($object, $permission, $action, GETPOST('linkid', 'int'));
|
||||||
|
print "<br>";
|
||||||
88
htdocs/core/tpl/document_actions_pre_headers.tpl.php
Normal file
88
htdocs/core/tpl/document_actions_pre_headers.tpl.php
Normal file
@ -0,0 +1,88 @@
|
|||||||
|
<?php
|
||||||
|
/* Copyright (C) 2013 Cédric Salvador <csalvador@gpcsolutions.fr>
|
||||||
|
*
|
||||||
|
* This program is free software; you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation; either version 3 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/
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
// Send file/link
|
||||||
|
if (GETPOST('sendit') && ! empty($conf->global->MAIN_UPLOAD_DOC)) {
|
||||||
|
if ($object->id) {
|
||||||
|
dol_add_file_process($upload_dir, 0, 1, 'userfile');
|
||||||
|
}
|
||||||
|
} elseif (GETPOST('linkit') && ! empty($conf->global->MAIN_UPLOAD_DOC)) {
|
||||||
|
if ($object->id) {
|
||||||
|
$link = GETPOST('link', 'alpha');
|
||||||
|
if ($link) {
|
||||||
|
if (substr($link, 0, 7) != 'http://' && substr($link, 0, 8) != 'https://') {
|
||||||
|
$link = 'http://' . $link;
|
||||||
|
}
|
||||||
|
dol_add_file_process($upload_dir, 0, 1, 'userfile', null, $link);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// Delete file/link
|
||||||
|
if ($action == 'confirm_deletefile' && $confirm == 'yes') {
|
||||||
|
if ($object->id) {
|
||||||
|
$urlfile = GETPOST('urlfile', 'alpha');
|
||||||
|
$linkid = GETPOST('linkid', 'int');
|
||||||
|
if ($urlfile) {
|
||||||
|
$file = $upload_dir . "/" . $urlfile; // Do not use urldecode here ($_GET and $_REQUEST are already decoded by PHP).
|
||||||
|
|
||||||
|
$ret = dol_delete_file($file, 0, 0, 0, $object);
|
||||||
|
if ($ret) {
|
||||||
|
setEventMessage($langs->trans("FileWasRemoved", $urlfile));
|
||||||
|
} else {
|
||||||
|
setEventMessage($langs->trans("ErrorFailToDeleteFile", $urlfile), 'errors');
|
||||||
|
}
|
||||||
|
} elseif ($linkid) {
|
||||||
|
require_once DOL_DOCUMENT_ROOT . '/link/class/link.class.php';
|
||||||
|
$link = new Link($db);
|
||||||
|
$link->id = $linkid;
|
||||||
|
$link->fetch();
|
||||||
|
$res = $link->delete($user);
|
||||||
|
$langs->load('link');
|
||||||
|
if ($res) {
|
||||||
|
setEventMessage($langs->trans("LinkRemoved", $link->label));
|
||||||
|
} else {
|
||||||
|
setEventMessage($langs->trans("ErrorFailedToDeleteLink", $link->label), 'errors');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
header('Location: ' . $_SERVER["PHP_SELF"] . '?id=' . $object->id);
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
} elseif ($action == 'confirm_updateline' && GETPOST('save') && GETPOST('link', 'alpha')) {
|
||||||
|
require_once DOL_DOCUMENT_ROOT . '/link/class/link.class.php';
|
||||||
|
$langs->load('link');
|
||||||
|
$link = new Link($db);
|
||||||
|
$link->id = GETPOST('linkid', 'int');
|
||||||
|
$f = $link->fetch();
|
||||||
|
if ($f) {
|
||||||
|
$link->url = GETPOST('link', 'alpha');
|
||||||
|
if (substr($link->url, 0, 7) != 'http://' && substr($link->url, 0, 8) != 'https://') {
|
||||||
|
$link->url = 'http://' . $link->url;
|
||||||
|
}
|
||||||
|
$link->label = GETPOST('label', 'alpha');
|
||||||
|
$res = $link->update($user);
|
||||||
|
if (!$res) {
|
||||||
|
setEventMessage($langs->trans("ErrorFailedToUpdateLink", $link->label));
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
//error fetching
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@ -775,7 +775,7 @@ include_once DOL_DOCUMENT_ROOT.'/core/ajax/ajaxdirpreview.php';
|
|||||||
if ((! empty($conf->use_javascript_ajax) && empty($conf->global->MAIN_ECM_DISABLE_JS)) || ! empty($section))
|
if ((! empty($conf->use_javascript_ajax) && empty($conf->global->MAIN_ECM_DISABLE_JS)) || ! empty($section))
|
||||||
{
|
{
|
||||||
$formfile=new FormFile($db);
|
$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);
|
$formfile->form_attach_new_file(DOL_URL_ROOT.'/ecm/index.php', 'none', 0, ($section?$section:-1), $user->rights->ecm->upload, 48, null, '', 0, '', 0);
|
||||||
}
|
}
|
||||||
else print ' ';
|
else print ' ';
|
||||||
|
|
||||||
|
|||||||
@ -5,6 +5,7 @@
|
|||||||
* Copyright (C) 2005-2009 Regis Houssin <regis.houssin@capnetworks.com>
|
* Copyright (C) 2005-2009 Regis Houssin <regis.houssin@capnetworks.com>
|
||||||
* Copyright (C) 2005 Simon TOSSER <simon@kornog-computing.com>
|
* Copyright (C) 2005 Simon TOSSER <simon@kornog-computing.com>
|
||||||
* Copyright (C) 2011-2012 Juanjo Menent <jmenent@2byte.es>
|
* Copyright (C) 2011-2012 Juanjo Menent <jmenent@2byte.es>
|
||||||
|
* Copyright (C) 2013 Cédric Salvador <csalvador@gpcsolutions.fr>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -71,29 +72,7 @@ $modulepart='fichinter';
|
|||||||
* Actions
|
* Actions
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if (GETPOST('sendit','alpha') && ! empty($conf->global->MAIN_UPLOAD_DOC))
|
include_once DOL_DOCUMENT_ROOT . '/core/tpl/document_actions_pre_headers.tpl.php';
|
||||||
{
|
|
||||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
|
|
||||||
|
|
||||||
dol_add_file_process($upload_dir,0,1,'userfile');
|
|
||||||
}
|
|
||||||
|
|
||||||
// Delete
|
|
||||||
else if ($action == 'confirm_deletefile' && $confirm == 'yes')
|
|
||||||
{
|
|
||||||
if ($object->id > 0)
|
|
||||||
{
|
|
||||||
$langs->load("other");
|
|
||||||
$object->fetch_thirdparty();
|
|
||||||
|
|
||||||
$file = $upload_dir . '/' . GETPOST('urlfile'); // Do not use urldecode here ($_GET and $_REQUEST are already decoded by PHP).
|
|
||||||
$ret=dol_delete_file($file,0,0,0,$object);
|
|
||||||
if ($ret) setEventMessage($langs->trans("FileWasRemoved", GETPOST('urlfile')));
|
|
||||||
else setEventMessage($langs->trans("ErrorFailToDeleteFile", GETPOST('urlfile')), 'errors');
|
|
||||||
header('Location: '.$_SERVER["PHP_SELF"].'?id='.$id);
|
|
||||||
exit;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -141,23 +120,10 @@ if ($object->id)
|
|||||||
|
|
||||||
print '</div>';
|
print '</div>';
|
||||||
|
|
||||||
/*
|
$modulepart = 'ficheinter';
|
||||||
* Confirmation suppression fichier
|
$permission = $user->rights->ficheinter->creer;
|
||||||
*/
|
$param = '&id=' . $object->id;
|
||||||
if ($action == 'delete')
|
include_once DOL_DOCUMENT_ROOT . '/core/tpl/document_actions_post_headers.tpl.php';
|
||||||
{
|
|
||||||
print $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id.'&urlfile='.urlencode($_GET["urlfile"]), $langs->trans('DeleteFile'), $langs->trans('ConfirmDeleteFile'), 'confirm_deletefile', '', 0, 1);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
// Affiche formulaire upload
|
|
||||||
$formfile=new FormFile($db);
|
|
||||||
$formfile->form_attach_new_file(DOL_URL_ROOT.'/fichinter/document.php?id='.$object->id,'',0,0,$user->rights->ficheinter->creer,50,$object);
|
|
||||||
|
|
||||||
|
|
||||||
// List of document
|
|
||||||
$param='&id='.$object->id;
|
|
||||||
$formfile->list_of_documents($filearray,$object,'ficheinter',$param);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
<?php
|
<?php
|
||||||
/* Copyright (C) 2002-2007 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
/* Copyright (C) 2002-2007 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||||
* Copyright (C) 2003 Xavier Dutoit <doli@sydesy.com>
|
* Copyright (C) 2003 Xavier Dutoit <doli@sydesy.com>
|
||||||
* Copyright (C) 2004-2012 Laurent Destailleur <eldy@users.sourceforge.net>
|
* Copyright (C) 2004-2013 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
* Copyright (C) 2004 Sebastien Di Cintio <sdicintio@ressource-toi.org>
|
* Copyright (C) 2004 Sebastien Di Cintio <sdicintio@ressource-toi.org>
|
||||||
* Copyright (C) 2004 Benoit Mortier <benoit.mortier@opensides.be>
|
* Copyright (C) 2004 Benoit Mortier <benoit.mortier@opensides.be>
|
||||||
* Copyright (C) 2005-2011 Regis Houssin <regis.houssin@capnetworks.com>
|
* Copyright (C) 2005-2011 Regis Houssin <regis.houssin@capnetworks.com>
|
||||||
@ -29,7 +29,7 @@
|
|||||||
* \brief File that include conf.php file and commons lib like functions.lib.php
|
* \brief File that include conf.php file and commons lib like functions.lib.php
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if (! defined('DOL_VERSION')) define('DOL_VERSION','3.5.0-alpha');
|
if (! defined('DOL_VERSION')) define('DOL_VERSION','3.5.0-beta');
|
||||||
if (! defined('EURO')) define('EURO',chr(128));
|
if (! defined('EURO')) define('EURO',chr(128));
|
||||||
|
|
||||||
// Define syslog constants
|
// Define syslog constants
|
||||||
|
|||||||
@ -4,6 +4,7 @@
|
|||||||
* Copyright (C) 2005 Marc Barilley / Ocebo <marc@ocebo.com>
|
* Copyright (C) 2005 Marc Barilley / Ocebo <marc@ocebo.com>
|
||||||
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
|
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
|
||||||
* Copyright (C) 2012 Marcos García <marcosgdf@gmail.com>
|
* Copyright (C) 2012 Marcos García <marcosgdf@gmail.com>
|
||||||
|
* Copyright (C) 2013 Cédric Salvador <csalvador@gpcsolutions.fr>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -77,26 +78,7 @@ $object->fetch_thirdparty();
|
|||||||
* Actions
|
* Actions
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// Envoi fichier
|
include_once DOL_DOCUMENT_ROOT . '/core/tpl/document_actions_pre_headers.tpl.php';
|
||||||
if (GETPOST('sendit') && ! empty($conf->global->MAIN_UPLOAD_DOC))
|
|
||||||
{
|
|
||||||
dol_add_file_process($upload_dir,0,1,'userfile');
|
|
||||||
}
|
|
||||||
|
|
||||||
else if ($action == 'confirm_deletefile' && $confirm == 'yes')
|
|
||||||
{
|
|
||||||
if ($object->id > 0)
|
|
||||||
{
|
|
||||||
$langs->load("other");
|
|
||||||
|
|
||||||
$file = $upload_dir . '/' . GETPOST('urlfile'); // Do not use urldecode here ($_GET and $_REQUEST are already decoded by PHP).
|
|
||||||
$ret=dol_delete_file($file,0,0,0,$object);
|
|
||||||
if ($ret) setEventMessage($langs->trans("FileWasRemoved", GETPOST('urlfile')));
|
|
||||||
else setEventMessage($langs->trans("ErrorFailToDeleteFile", GETPOST('urlfile')), 'errors');
|
|
||||||
header('Location: '.$_SERVER["PHP_SELF"].'?id='.$id);
|
|
||||||
exit;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -176,23 +158,11 @@ if ($object->id > 0)
|
|||||||
|
|
||||||
print "</div>\n";
|
print "</div>\n";
|
||||||
|
|
||||||
/*
|
$modulepart = 'commande_fournisseur';
|
||||||
* Confirmation suppression fichier
|
$permission = $user->rights->fournisseur->commande->creer;
|
||||||
*/
|
$param = '&id=' . $object->id;
|
||||||
if ($action == 'delete')
|
include_once DOL_DOCUMENT_ROOT . '/core/tpl/document_actions_post_headers.tpl.php';
|
||||||
{
|
|
||||||
print $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id.'&urlfile='.urlencode($_GET["urlfile"]), $langs->trans('DeleteFile'), $langs->trans('ConfirmDeleteFile'), 'confirm_deletefile', '', 0, 1);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
// Affiche formulaire upload
|
|
||||||
$formfile=new FormFile($db);
|
|
||||||
$formfile->form_attach_new_file(DOL_URL_ROOT.'/fourn/commande/document.php?id='.$object->id,'',0,0,$user->rights->fournisseur->commande->creer,50,$object);
|
|
||||||
|
|
||||||
|
|
||||||
// List of document
|
|
||||||
$param='&id='.$object->id;
|
|
||||||
$formfile->list_of_documents($filearray,$object,'commande_fournisseur',$param);
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|||||||
@ -3,6 +3,7 @@
|
|||||||
* Copyright (C) 2004-2009 Laurent Destailleur <eldy@users.sourceforge.net>
|
* Copyright (C) 2004-2009 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
* Copyright (C) 2005 Marc Barilley / Ocebo <marc@ocebo.com>
|
* Copyright (C) 2005 Marc Barilley / Ocebo <marc@ocebo.com>
|
||||||
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
|
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
|
||||||
|
* Copyright (C) 2013 Cédric Salvador <csalvador@gpcsolutions.fr>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -71,29 +72,7 @@ if ($object->fetch($id, $ref))
|
|||||||
* Actions
|
* Actions
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// Envoi fichier
|
include_once DOL_DOCUMENT_ROOT . '/core/tpl/document_actions_pre_headers.tpl.php';
|
||||||
if (GETPOST('sendit') && ! empty($conf->global->MAIN_UPLOAD_DOC))
|
|
||||||
{
|
|
||||||
if ($object->id > 0)
|
|
||||||
{
|
|
||||||
dol_add_file_process($upload_dir, 0, 1, 'userfile', GETPOST('savingdocmask'));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Delete
|
|
||||||
else if ($action == 'confirm_deletefile' && $confirm == 'yes')
|
|
||||||
{
|
|
||||||
if ($object->id > 0)
|
|
||||||
{
|
|
||||||
$langs->load("other");
|
|
||||||
$file = $upload_dir . '/' . GETPOST('urlfile'); // Do not use urldecode here ($_GET and $_REQUEST are already decoded by PHP).
|
|
||||||
$ret=dol_delete_file($file,0,0,0,$object);
|
|
||||||
if ($ret) setEventMessage($langs->trans("FileWasRemoved", GETPOST('urlfile')));
|
|
||||||
else setEventMessage($langs->trans("ErrorFailToDeleteFile", GETPOST('urlfile')), 'errors');
|
|
||||||
header('Location: '.$_SERVER["PHP_SELF"].'?id='.$id);
|
|
||||||
exit;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -198,17 +177,10 @@ if ($object->id > 0)
|
|||||||
print '</table>';
|
print '</table>';
|
||||||
print '</div>';
|
print '</div>';
|
||||||
|
|
||||||
|
$modulepart = 'facture_fournisseur';
|
||||||
// Affiche formulaire upload
|
$permission = $user->rights->fournisseur->facture->creer;
|
||||||
$formfile=new FormFile($db);
|
$param = '&facid=' . $object->id;
|
||||||
$formfile->form_attach_new_file($_SERVER['PHP_SELF'].'?facid='.$object->id, '', 0, 0, $user->rights->fournisseur->facture->creer, 50, $object, '', 0, dol_sanitizeFileName($object->ref.'_'.$object->ref_supplier.'___file__'));
|
include_once DOL_DOCUMENT_ROOT . '/core/tpl/document_actions_post_headers.tpl.php';
|
||||||
|
|
||||||
|
|
||||||
// List of document
|
|
||||||
$param='&facid='.$object->id;
|
|
||||||
$ref=dol_sanitizeFileName($object->ref);
|
|
||||||
$formfile->list_of_documents($filearray,$object,'facture_fournisseur',$param,0,get_exdir($object->id,2,0).$ref.'/');
|
|
||||||
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|||||||
@ -1688,8 +1688,6 @@ else
|
|||||||
|
|
||||||
print '<tr><td>'.$langs->trans('AmountHT').'</td><td align="right">'.price($object->total_ht,1,$langs,0,-1,-1,$conf->currency).'</td><td colspan="2" align="left"> </td></tr>';
|
print '<tr><td>'.$langs->trans('AmountHT').'</td><td align="right">'.price($object->total_ht,1,$langs,0,-1,-1,$conf->currency).'</td><td colspan="2" align="left"> </td></tr>';
|
||||||
print '<tr><td>'.$langs->trans('AmountVAT').'</td><td align="right">'.price($object->total_tva,1,$langs,0,-1,-1,$conf->currency).'</td><td colspan="2" align="left">';
|
print '<tr><td>'.$langs->trans('AmountVAT').'</td><td align="right">'.price($object->total_tva,1,$langs,0,-1,-1,$conf->currency).'</td><td colspan="2" align="left">';
|
||||||
if (! empty($conf->global->MAIN_FEATURES_LEVEL))
|
|
||||||
{
|
|
||||||
if (GETPOST('calculationrule')) $calculationrule=GETPOST('calculationrule','alpha');
|
if (GETPOST('calculationrule')) $calculationrule=GETPOST('calculationrule','alpha');
|
||||||
else $calculationrule=(empty($conf->global->MAIN_ROUNDOFTOTAL_NOT_TOTALOFROUND)?'totalofround':'roundoftotal');
|
else $calculationrule=(empty($conf->global->MAIN_ROUNDOFTOTAL_NOT_TOTALOFROUND)?'totalofround':'roundoftotal');
|
||||||
if ($calculationrule == 'totalofround') $calculationrulenum=1;
|
if ($calculationrule == 'totalofround') $calculationrulenum=1;
|
||||||
@ -1699,7 +1697,6 @@ else
|
|||||||
$s.=' / ';
|
$s.=' / ';
|
||||||
$s.='<a href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=calculate&calculationrule=roundoftotal">'.$langs->trans("Mode2").'</a>';
|
$s.='<a href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=calculate&calculationrule=roundoftotal">'.$langs->trans("Mode2").'</a>';
|
||||||
print $form->textwithtooltip($s, $langs->trans("CalculationRuleDesc",$calculationrulenum).'<br>'.$langs->trans("CalculationRuleDescSupplier"), 2, 1, img_picto('','help'));
|
print $form->textwithtooltip($s, $langs->trans("CalculationRuleDesc",$calculationrulenum).'<br>'.$langs->trans("CalculationRuleDescSupplier"), 2, 1, img_picto('','help'));
|
||||||
}
|
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
// Amount Local Taxes
|
// Amount Local Taxes
|
||||||
|
|||||||
@ -90,6 +90,17 @@ create table llx_categorie_contact
|
|||||||
import_key varchar(14)
|
import_key varchar(14)
|
||||||
)ENGINE=innodb;
|
)ENGINE=innodb;
|
||||||
|
|
||||||
|
create table llx_links
|
||||||
|
(
|
||||||
|
rowid INTEGER AUTO_INCREMENT PRIMARY KEY,
|
||||||
|
entity INTEGER DEFAULT 1 NOT NULL, -- multi company id
|
||||||
|
datea DATETIME NOT NULL, -- date start
|
||||||
|
url VARCHAR(255) NOT NULL, -- link url
|
||||||
|
label VARCHAR(255) NOT NULL, -- link label
|
||||||
|
objecttype VARCHAR(255) NOT NULL, -- object type in Dolibarr
|
||||||
|
objectid INTEGER NOT NULL
|
||||||
|
)ENGINE=innodb;
|
||||||
|
|
||||||
|
|
||||||
ALTER TABLE llx_categorie_contact ADD PRIMARY KEY pk_categorie_contact (fk_categorie, fk_socpeople);
|
ALTER TABLE llx_categorie_contact ADD PRIMARY KEY pk_categorie_contact (fk_categorie, fk_socpeople);
|
||||||
ALTER TABLE llx_categorie_contact ADD INDEX idx_categorie_contact_fk_categorie (fk_categorie);
|
ALTER TABLE llx_categorie_contact ADD INDEX idx_categorie_contact_fk_categorie (fk_categorie);
|
||||||
|
|||||||
30
htdocs/install/mysql/tables/llx_links.sql
Normal file
30
htdocs/install/mysql/tables/llx_links.sql
Normal file
@ -0,0 +1,30 @@
|
|||||||
|
-- ========================================================================
|
||||||
|
-- Copyright (C) 2013 Cédric Salvador <csalvador@gpcsolutions.fr>
|
||||||
|
--
|
||||||
|
-- This program is free software; you can redistribute it and/or modify
|
||||||
|
-- it under the terms of the GNU General Public License as published by
|
||||||
|
-- the Free Software Foundation; either version 3 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/>.
|
||||||
|
--
|
||||||
|
--
|
||||||
|
-- Actions commerciales
|
||||||
|
-- ========================================================================
|
||||||
|
|
||||||
|
create table llx_links
|
||||||
|
(
|
||||||
|
rowid INTEGER AUTO_INCREMENT PRIMARY KEY,
|
||||||
|
entity INTEGER DEFAULT 1 NOT NULL, -- multi company id
|
||||||
|
datea DATETIME NOT NULL, -- date start
|
||||||
|
url VARCHAR(255) NOT NULL, -- link url
|
||||||
|
label VARCHAR(255) NOT NULL, -- link label
|
||||||
|
objecttype VARCHAR(255) NOT NULL, -- object type in Dolibarr
|
||||||
|
objectid INTEGER NOT NULL
|
||||||
|
)ENGINE=innodb;
|
||||||
@ -17,17 +17,17 @@
|
|||||||
|
|
||||||
CREATE TABLE llx_opensurvey_sondage (
|
CREATE TABLE llx_opensurvey_sondage (
|
||||||
id_sondage VARCHAR(16) PRIMARY KEY,
|
id_sondage VARCHAR(16) PRIMARY KEY,
|
||||||
id_sondage_admin CHAR(24),
|
id_sondage_admin VARCHAR(24),
|
||||||
commentaires text,
|
commentaires text,
|
||||||
mail_admin VARCHAR(128),
|
mail_admin VARCHAR(128),
|
||||||
nom_admin VARCHAR(64),
|
nom_admin VARCHAR(64),
|
||||||
titre text,
|
titre TEXT,
|
||||||
date_fin datetime,
|
date_fin DATETIME,
|
||||||
format VARCHAR(2),
|
format VARCHAR(2),
|
||||||
mailsonde varchar(2) DEFAULT '0',
|
mailsonde varchar(2) DEFAULT '0',
|
||||||
survey_link_visible integer DEFAULT 1,
|
survey_link_visible integer DEFAULT 1,
|
||||||
canedit integer DEFAULT 0,
|
canedit integer DEFAULT 0,
|
||||||
origin varchar(64),
|
origin VARCHAR(64),
|
||||||
tms timestamp,
|
tms TIMESTAMP,
|
||||||
sujet TEXT
|
sujet TEXT
|
||||||
) ENGINE=InnoDB;
|
) ENGINE=InnoDB;
|
||||||
|
|||||||
8
htdocs/langs/en_US/link.lang
Normal file
8
htdocs/langs/en_US/link.lang
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
LinkANewFile=Link a new file/document
|
||||||
|
LinkedFiles=Linked files and documents
|
||||||
|
NoLinkFound=No registered links
|
||||||
|
LinkComplete=The file has been linked successfully
|
||||||
|
ErrorFileNotLinked=The file could not be linked
|
||||||
|
LinkRemoved=The link %s has been removed
|
||||||
|
ErrorFailedToDeleteLink= Failed to remove link '<b>%s</b>'
|
||||||
|
ErrorFailedToUpdateLink= Failed to update link '<b>%s</b>'
|
||||||
@ -155,6 +155,7 @@ Valid=Valid
|
|||||||
Approve=Approve
|
Approve=Approve
|
||||||
ReOpen=Re-Open
|
ReOpen=Re-Open
|
||||||
Upload=Send file
|
Upload=Send file
|
||||||
|
ToLink=Link
|
||||||
Select=Select
|
Select=Select
|
||||||
Choose=Choose
|
Choose=Choose
|
||||||
ChooseLangage=Please choose your language
|
ChooseLangage=Please choose your language
|
||||||
|
|||||||
@ -153,6 +153,12 @@ ProfId3DE=Id. prof. 3 (Handelsregister-Nr.)
|
|||||||
ProfId4DE=-
|
ProfId4DE=-
|
||||||
ProfId5DE=-
|
ProfId5DE=-
|
||||||
ProfId6DE=-
|
ProfId6DE=-
|
||||||
|
ProfId1DZ=Id prof. 1 (RC)
|
||||||
|
ProfId2DZ=Id prof. 2 (NIF)
|
||||||
|
ProfId3DZ=Id prof. 3 (AI)
|
||||||
|
ProfId4DZ=Id prof. 4 (NIS)
|
||||||
|
ProfId5DZ=-
|
||||||
|
ProfId6DZ=-
|
||||||
ProfId1ES=Id. prof. 1 (CIF/NIF)
|
ProfId1ES=Id. prof. 1 (CIF/NIF)
|
||||||
ProfId2ES=Id. prof. 2 (Num. sécurité social)
|
ProfId2ES=Id. prof. 2 (Num. sécurité social)
|
||||||
ProfId3ES=Id. prof. 3 (CNAE)
|
ProfId3ES=Id. prof. 3 (CNAE)
|
||||||
@ -183,6 +189,12 @@ ProfId3IN=Id. prof. 3 (SRVC TAX)
|
|||||||
ProfId4IN=Id. prof. 4
|
ProfId4IN=Id. prof. 4
|
||||||
ProfId5IN=Id. prof. 5
|
ProfId5IN=Id. prof. 5
|
||||||
ProfId6IN=-
|
ProfId6IN=-
|
||||||
|
ProfId1LU=Id prof. 1 (SIREN)
|
||||||
|
ProfId2LU=-
|
||||||
|
ProfId3LU=Id prof. 3 (APE)
|
||||||
|
ProfId4LU=Id prof. 4 (RC/RM)
|
||||||
|
ProfId5LU=-
|
||||||
|
ProfId6LU=-
|
||||||
ProfId1MA=Id. prof. 1 (R.C.)
|
ProfId1MA=Id. prof. 1 (R.C.)
|
||||||
ProfId2MA=Id. prof. 2 (Patente)
|
ProfId2MA=Id. prof. 2 (Patente)
|
||||||
ProfId3MA=Id. prof. 3 (I.F.)
|
ProfId3MA=Id. prof. 3 (I.F.)
|
||||||
|
|||||||
@ -164,7 +164,7 @@ ReCalculate=Recalculer
|
|||||||
Mode1=Mode 1
|
Mode1=Mode 1
|
||||||
Mode2=Mode 2
|
Mode2=Mode 2
|
||||||
CalculationRuleDesc=Pour calculer le total de TVA, il existe 2 modes:<br>Le mode 1 consiste à arrondir la tva de chaque ligne et à sommer cet arrondi.<br>Le mode 2 consiste à sommer la tva de chaque ligne puis à l'arrondir.<br>Les résultats peuvent différer de quelques centimes. Le mode par défaut est le mode <b>%s</b>.
|
CalculationRuleDesc=Pour calculer le total de TVA, il existe 2 modes:<br>Le mode 1 consiste à arrondir la tva de chaque ligne et à sommer cet arrondi.<br>Le mode 2 consiste à sommer la tva de chaque ligne puis à l'arrondir.<br>Les résultats peuvent différer de quelques centimes. Le mode par défaut est le mode <b>%s</b>.
|
||||||
CalculationRuleDescSupplier=Selon le mode utilisé par le fournisseur, choisissez le mode adéquant afin d'appliquer la même règle et obtenir un résultat identique au mode appliqué par votre fournisseur.
|
CalculationRuleDescSupplier=Selon le mode utilisé par le fournisseur, choisissez le mode adéquat afin d'appliquer la même règle et obtenir un résultat identique au mode appliqué par votre fournisseur.
|
||||||
TurnoverPerProductInCommitmentAccountingNotRelevant=Le chiffre d'affaire par produit, dans une comptabilité en mode <b>comptabilité de caisse</b> n'est pas définissable. Ce rapport n'est disponible qu'en mode de comptabilité dit <b>comptabilité d'engagement</b> (voir la configuration du module de comptabilité).
|
TurnoverPerProductInCommitmentAccountingNotRelevant=Le chiffre d'affaire par produit, dans une comptabilité en mode <b>comptabilité de caisse</b> n'est pas définissable. Ce rapport n'est disponible qu'en mode de comptabilité dit <b>comptabilité d'engagement</b> (voir la configuration du module de comptabilité).
|
||||||
CalculationMode=Mode de calcul
|
CalculationMode=Mode de calcul
|
||||||
COMPTA_ACCOUNT_CUSTOMER=Code comptable par défaut des tiers clients
|
COMPTA_ACCOUNT_CUSTOMER=Code comptable par défaut des tiers clients
|
||||||
|
|||||||
9
htdocs/langs/fr_FR/link.lang
Normal file
9
htdocs/langs/fr_FR/link.lang
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
CHARSET=UTF-8
|
||||||
|
LinkANewFile=Lier un nouveau fichier/document
|
||||||
|
LinkedFiles=Fichiers et documents liés
|
||||||
|
NoLinkFound=Aucun lien associé
|
||||||
|
LinkComplete=Le fichier a été correctement lié
|
||||||
|
ErrorFileNotLinked=Le fichier n'a pas pu être lié
|
||||||
|
LinkRemoved=Le lien %s a été supprimé
|
||||||
|
ErrorFailedToDeleteLink= Impossible de supprimer le lien '<b>%s</b>'
|
||||||
|
ErrorFailedToUpdateLink= Impossible de modifier le lien '<b>%s</b>'
|
||||||
@ -155,6 +155,7 @@ Valid=Valider
|
|||||||
Approve=Approuver
|
Approve=Approuver
|
||||||
ReOpen=Réouvrir
|
ReOpen=Réouvrir
|
||||||
Upload=Envoyer fichier
|
Upload=Envoyer fichier
|
||||||
|
ToLink=Lier
|
||||||
Select=Sélectionner
|
Select=Sélectionner
|
||||||
Choose=Choisir
|
Choose=Choisir
|
||||||
ChooseLangage=Choisissez votre langue
|
ChooseLangage=Choisissez votre langue
|
||||||
|
|||||||
365
htdocs/link/class/link.class.php
Normal file
365
htdocs/link/class/link.class.php
Normal file
@ -0,0 +1,365 @@
|
|||||||
|
<?php
|
||||||
|
/* Copyright (C) 2013 Cédric Salvador <csalvador@gpcsolutions.fr>
|
||||||
|
*
|
||||||
|
* This program is free software; you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation; either version 3 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/link/class/link.class.php
|
||||||
|
* \ingroup link
|
||||||
|
* \brief File for link class
|
||||||
|
*/
|
||||||
|
require_once DOL_DOCUMENT_ROOT.'/core/class/commonobject.class.php';
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Class to manage links
|
||||||
|
*/
|
||||||
|
class Link extends CommonObject
|
||||||
|
{
|
||||||
|
public $element = 'link';
|
||||||
|
public $table_element = 'links';
|
||||||
|
|
||||||
|
public $id;
|
||||||
|
public $entity;
|
||||||
|
public $datea;
|
||||||
|
public $url;
|
||||||
|
public $label;
|
||||||
|
public $objecttype;
|
||||||
|
public $objectid;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Constructor
|
||||||
|
*
|
||||||
|
* @param DoliDB $db Database handler
|
||||||
|
*/
|
||||||
|
public function __construct($db)
|
||||||
|
{
|
||||||
|
global $conf;
|
||||||
|
|
||||||
|
$this->db = $db;
|
||||||
|
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Create link in database
|
||||||
|
*
|
||||||
|
* @param User $user Object of user that ask creation
|
||||||
|
* @return int >= 0 if OK, < 0 if KO
|
||||||
|
*/
|
||||||
|
public function create($user='')
|
||||||
|
{
|
||||||
|
global $langs,$conf;
|
||||||
|
|
||||||
|
$error=0;
|
||||||
|
$langs->load("errors");
|
||||||
|
// Clean parameters
|
||||||
|
if (empty($this->label)) {
|
||||||
|
$this->label = trim(basename($this->url));
|
||||||
|
}
|
||||||
|
if (empty($this->datea)) {
|
||||||
|
$this->datea = dol_now();
|
||||||
|
}
|
||||||
|
$this->url = trim($this->url);
|
||||||
|
|
||||||
|
dol_syslog(get_class($this)."::create ".$this->url);
|
||||||
|
|
||||||
|
// Check parameters
|
||||||
|
if (empty($this->url)) {
|
||||||
|
$this->error = $langs->trans("NoUrl");
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
$this->db->begin();
|
||||||
|
|
||||||
|
$sql = "INSERT INTO ".MAIN_DB_PREFIX."links (entity, datea, url, label, objecttype, objectid)";
|
||||||
|
$sql .= " VALUES ('".$conf->entity."', '".$this->db->idate($this->datea)."'";
|
||||||
|
$sql .= ", '" . $this->db->escape($this->url) . "'";
|
||||||
|
$sql .= ", '" . $this->db->escape($this->label) . "'";
|
||||||
|
$sql .= ", '" . $this->objecttype . "'";
|
||||||
|
$sql .= ", " . $this->objectid . ")";
|
||||||
|
|
||||||
|
dol_syslog(get_class($this)."::create sql=".$sql);
|
||||||
|
$result = $this->db->query($sql);
|
||||||
|
if ($result) {
|
||||||
|
$this->id = $this->db->last_insert_id(MAIN_DB_PREFIX . "links");
|
||||||
|
|
||||||
|
if ($this->id > 0) {
|
||||||
|
// Appel des triggers
|
||||||
|
include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php';
|
||||||
|
$interface=new Interfaces($this->db);
|
||||||
|
$result=$interface->run_triggers('LINK_CREATE', $this, $user, $langs, $conf);
|
||||||
|
if ($result < 0) {
|
||||||
|
$error++;
|
||||||
|
$this->errors = $interface->errors;
|
||||||
|
}
|
||||||
|
// Fin appel triggers
|
||||||
|
} else {
|
||||||
|
$error++;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (! $error)
|
||||||
|
{
|
||||||
|
dol_syslog(get_class($this)."::Create success id=" . $this->id);
|
||||||
|
$this->db->commit();
|
||||||
|
return $this->id;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
dol_syslog(get_class($this)."::Create echec update " . $this->error, LOG_ERR);
|
||||||
|
$this->db->rollback();
|
||||||
|
return -3;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if ($this->db->errno() == 'DB_ERROR_RECORD_ALREADY_EXISTS')
|
||||||
|
{
|
||||||
|
|
||||||
|
$this->error=$langs->trans("ErrorCompanyNameAlreadyExists",$this->name);
|
||||||
|
$result=-1;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$this->error=$this->db->lasterror();
|
||||||
|
dol_syslog(get_class($this)."::Create fails insert sql=".$sql, LOG_ERR);
|
||||||
|
$result=-2;
|
||||||
|
}
|
||||||
|
$this->db->rollback();
|
||||||
|
return $result;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Update parameters of third party
|
||||||
|
*
|
||||||
|
* @param User $user User executing update
|
||||||
|
* @param int $call_trigger 0=no, 1=yes
|
||||||
|
* @return int <0 if KO, >=0 if OK
|
||||||
|
*/
|
||||||
|
public function update($user='', $call_trigger=1)
|
||||||
|
{
|
||||||
|
global $langs,$conf;
|
||||||
|
require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
|
||||||
|
$langs->load("errors");
|
||||||
|
$error=0;
|
||||||
|
|
||||||
|
dol_syslog(get_class($this)."::Update id = " . $this->id . " call_trigger = " . $call_trigger);
|
||||||
|
|
||||||
|
// Check parameters
|
||||||
|
if (empty($this->url)) {
|
||||||
|
$this->error = $langs->trans("NoURL");
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Clean parameters
|
||||||
|
$this->url = clean_url($this->url,0);
|
||||||
|
if(empty($this->label)) {
|
||||||
|
$this->label = basename($this->url);
|
||||||
|
}
|
||||||
|
$this->label = trim($this->label);
|
||||||
|
|
||||||
|
|
||||||
|
$this->db->begin();
|
||||||
|
|
||||||
|
$sql = "UPDATE " . MAIN_DB_PREFIX . "links SET ";
|
||||||
|
$sql .= "entity = '" . $conf->entity ."'";
|
||||||
|
$sql .= ", datea = '" . $this->db->idate(dol_now()) . "'";
|
||||||
|
$sql .= ", url = '" . $this->db->escape($this->url) . "'";
|
||||||
|
$sql .= ", label = '" . $this->db->escape($this->label) . "'";
|
||||||
|
$sql .= ", objecttype = '" . $this->objecttype . "'";
|
||||||
|
$sql .= ", objectid = " . $this->objectid;
|
||||||
|
$sql .= " WHERE rowid = '" . $this->id ."'";
|
||||||
|
|
||||||
|
|
||||||
|
dol_syslog(get_class($this)."::Update sql = " .$sql);
|
||||||
|
$resql = $this->db->query($sql);
|
||||||
|
if ($resql)
|
||||||
|
{
|
||||||
|
if ($call_trigger) {
|
||||||
|
// Appel des triggers
|
||||||
|
include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php';
|
||||||
|
$interface = new Interfaces($this->db);
|
||||||
|
$result = $interface->run_triggers('LINK_MODIFY', $this, $user, $langs, $conf);
|
||||||
|
if ($result < 0) {
|
||||||
|
$error++;
|
||||||
|
$this->errors = $interface->errors;
|
||||||
|
}
|
||||||
|
// Fin appel triggers
|
||||||
|
}
|
||||||
|
|
||||||
|
if (! $error) {
|
||||||
|
dol_syslog(get_class($this) . "::Update success");
|
||||||
|
$this->db->commit();
|
||||||
|
return 1;
|
||||||
|
} else {
|
||||||
|
$this->db->rollback();
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if ($this->db->errno() == 'DB_ERROR_RECORD_ALREADY_EXISTS') {
|
||||||
|
// Doublon
|
||||||
|
$this->error = $langs->trans("ErrorDuplicateField");
|
||||||
|
$result = -1;
|
||||||
|
} else {
|
||||||
|
$this->error = $langs->trans("Error sql = " . $sql);
|
||||||
|
dol_syslog(get_class($this) . "::Update fails update sql = " . $sql, LOG_ERR);
|
||||||
|
$result = -2;
|
||||||
|
}
|
||||||
|
$this->db->rollback();
|
||||||
|
return $result;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Loads all links from database
|
||||||
|
*
|
||||||
|
* @param array &$links array of Link objects to fill
|
||||||
|
* @param string $objecttype type of the associated object in dolibarr
|
||||||
|
* @param int $objectid id of the associated object in dolibarr
|
||||||
|
* @param string $sortfield field used to sort
|
||||||
|
* @param string $sortorder sort order
|
||||||
|
* @return 1 if ok, 0 if no records, -1 if error
|
||||||
|
*
|
||||||
|
* */
|
||||||
|
public function fetchAll(&$links, $objecttype, $objectid, $sortfield=null, $sortorder=null)
|
||||||
|
{
|
||||||
|
global $conf;
|
||||||
|
$sql = "SELECT rowid, entity, datea, url, label , objecttype, objectid FROM " . MAIN_DB_PREFIX . "links";
|
||||||
|
$sql .= " WHERE objecttype = '" . $objecttype . "' AND objectid = " . $objectid;
|
||||||
|
if($conf->entity != 0) $sql .= " AND entity = " . $conf->entity;
|
||||||
|
if ($sortfield) {
|
||||||
|
if (empty($sortorder)) {
|
||||||
|
$sortorder = "ASC";
|
||||||
|
}
|
||||||
|
$sql .= " ORDER BY " . $sortfield . " " . $sortorder;
|
||||||
|
}
|
||||||
|
$resql = $this->db->query($sql);
|
||||||
|
dol_syslog(get_class($this)."::fetchAll " . $sql, LOG_DEBUG);
|
||||||
|
if ($resql) {
|
||||||
|
$num = $this->db->num_rows($resql);
|
||||||
|
dol_syslog(get_class($this)."::fetchAll " . $num . "records", LOG_DEBUG);
|
||||||
|
if ($num > 0) {
|
||||||
|
while ($obj = $this->db->fetch_object($resql)) {
|
||||||
|
$link = new Link($db);
|
||||||
|
$link->id = $obj->rowid;
|
||||||
|
$link->entity = $obj->entity;
|
||||||
|
$link->datea = $this->db->jdate($obj->datea);
|
||||||
|
$link->url = $obj->url;
|
||||||
|
$link->label = $obj->label;
|
||||||
|
$link->objecttype = $obj->objecttype;
|
||||||
|
$link->objectid = $obj->objectid;
|
||||||
|
$links[] = $link;
|
||||||
|
}
|
||||||
|
return 1;
|
||||||
|
} else {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
dol_syslog(get_class($this) . "::FetchAll fails sql=" . $sql, LOG_ERR);
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Loads a link from database
|
||||||
|
* @param rowid id of link to load
|
||||||
|
* @return int 1 if ok, 0 if no record found, -1 if error
|
||||||
|
*
|
||||||
|
* */
|
||||||
|
public function fetch($rowid=null)
|
||||||
|
{
|
||||||
|
global $conf;
|
||||||
|
if (empty($rowid)) {
|
||||||
|
$rowid = $this->id;
|
||||||
|
}
|
||||||
|
$sql = "SELECT rowid, entity, datea, url, label, objecttype, objectid FROM " . MAIN_DB_PREFIX . "links";
|
||||||
|
$sql .= " WHERE rowid = " . $rowid;
|
||||||
|
if($conf->entity != 0) $sql .= " AND entity = " . $conf->entity;
|
||||||
|
$resql = $this->db->query($sql);
|
||||||
|
dol_syslog(get_class($this)."::fetch " . $sql, LOG_DEBUG);
|
||||||
|
if ($resql) {
|
||||||
|
if($this->db->num_rows($resql) > 0) {
|
||||||
|
$obj = $this->db->fetch_object($resql);
|
||||||
|
$this->entity = $obj->entity;
|
||||||
|
$this->datea = $this->db->jdate($obj->datea);
|
||||||
|
$this->url = $obj->url;
|
||||||
|
$this->label = $obj->label;
|
||||||
|
$this->objecttype = $obj->objecttype;
|
||||||
|
$this->objectid = $obj->objectid;
|
||||||
|
return 1;
|
||||||
|
} else {
|
||||||
|
$this->error = 'Fetch no link found for id = ' . $rowid;
|
||||||
|
dol_syslog($this->error, LOG_ERR);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
dol_syslog($this->db->error(), LOG_ERR);
|
||||||
|
$this->error=$this->db->error();
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Delete a link from database
|
||||||
|
*
|
||||||
|
* @return int <0 if KO, 0 if nothing done, >0 if OK
|
||||||
|
*/
|
||||||
|
public function delete()
|
||||||
|
{
|
||||||
|
global $user, $langs, $conf;
|
||||||
|
|
||||||
|
dol_syslog(get_class($this)."::delete", LOG_DEBUG);
|
||||||
|
$error = 0;
|
||||||
|
|
||||||
|
$this->db->begin();
|
||||||
|
|
||||||
|
// Remove link
|
||||||
|
|
||||||
|
$sql = "DELETE FROM " . MAIN_DB_PREFIX . "links";
|
||||||
|
$sql.= " WHERE rowid = " . $this->id;
|
||||||
|
dol_syslog(get_class($this)."::delete sql=" . $sql, LOG_DEBUG);
|
||||||
|
if (! $this->db->query($sql)) {
|
||||||
|
$error++;
|
||||||
|
$this->error = $this->db->lasterror();
|
||||||
|
dol_syslog(get_class($this)."::delete error -4 " . $this->error, LOG_ERR);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
if (! $error) {
|
||||||
|
// Appel des triggers
|
||||||
|
include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php';
|
||||||
|
$interface=new Interfaces($this->db);
|
||||||
|
$result = $interface->run_triggers('LINK_DELETE', $this, $user, $langs, $conf);
|
||||||
|
if ($result < 0) {
|
||||||
|
$error++;
|
||||||
|
$this->errors = $interface->errors;
|
||||||
|
}
|
||||||
|
// Fin appel triggers
|
||||||
|
}
|
||||||
|
|
||||||
|
if (! $error) {
|
||||||
|
$this->db->commit();
|
||||||
|
|
||||||
|
return 1;
|
||||||
|
} else {
|
||||||
|
$this->db->rollback();
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@ -168,7 +168,7 @@ print '<input type="checkbox" name="canedit" '.$cocheplus.'> '. $langs->trans("V
|
|||||||
|
|
||||||
if ($_SESSION["mailsonde"]) $cochemail="checked";
|
if ($_SESSION["mailsonde"]) $cochemail="checked";
|
||||||
|
|
||||||
print '<input type=checkbox name=mailsonde '.$cochemail.'> '. $langs->trans("ToReceiveEMailForEachVote") .'<br>'."\n";
|
print '<input type="checkbox" name="mailsonde" '.$cochemail.'> '. $langs->trans("ToReceiveEMailForEachVote") .'<br>'."\n";
|
||||||
|
|
||||||
if (GETPOST('choix_sondage'))
|
if (GETPOST('choix_sondage'))
|
||||||
{
|
{
|
||||||
|
|||||||
@ -1011,6 +1011,11 @@ class Product extends CommonObject
|
|||||||
|
|
||||||
// Check parameters
|
// Check parameters
|
||||||
if ($newvat == '') $newvat=$this->tva_tx;
|
if ($newvat == '') $newvat=$this->tva_tx;
|
||||||
|
if (! empty($newminprice) && ($newminprice > $newprice))
|
||||||
|
{
|
||||||
|
$this->error='ErrorPricCanBeLowerThanMinPrice';
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
if ($newprice!='' || $newprice==0)
|
if ($newprice!='' || $newprice==0)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -5,6 +5,7 @@
|
|||||||
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
|
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
|
||||||
* Copyright (C) 2005 Simon TOSSER <simon@kornog-computing.com>
|
* Copyright (C) 2005 Simon TOSSER <simon@kornog-computing.com>
|
||||||
* Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
|
* Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
|
||||||
|
* Copyright (C) 2013 Cédric Salvador <csalvador@gpcsolutions.fr>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -80,22 +81,7 @@ $reshook=$hookmanager->executeHooks('doActions',$parameters,$object,$action);
|
|||||||
* Action envoie fichier
|
* Action envoie fichier
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if (GETPOST('sendit') && ! empty($conf->global->MAIN_UPLOAD_DOC))
|
include_once DOL_DOCUMENT_ROOT . '/core/tpl/document_actions_pre_headers.tpl.php';
|
||||||
{
|
|
||||||
dol_add_file_process($upload_dir,0,1,'userfile');
|
|
||||||
}
|
|
||||||
|
|
||||||
// Delete
|
|
||||||
if ($action=='delete')
|
|
||||||
{
|
|
||||||
$langs->load("other");
|
|
||||||
$file = $upload_dir . '/' . GETPOST('urlfile'); // Do not use urldecode here ($_GET and $_REQUEST are already decoded by PHP).
|
|
||||||
$ret=dol_delete_file($file,0,0,0,$object);
|
|
||||||
if ($ret) setEventMessage($langs->trans("FileWasRemoved", GETPOST('urlfile')));
|
|
||||||
else setEventMessage($langs->trans("ErrorFailToDeleteFile", GETPOST('urlfile')), 'errors');
|
|
||||||
header('Location: '.$_SERVER["PHP_SELF"].'?id='.$id);
|
|
||||||
exit;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -154,15 +140,10 @@ if ($object->id)
|
|||||||
|
|
||||||
print '</div>';
|
print '</div>';
|
||||||
|
|
||||||
|
$modulepart = 'produit';
|
||||||
// Affiche formulaire upload
|
$permission = $user->rights->produit->creer;
|
||||||
$formfile=new FormFile($db);
|
$param = '&id=' . $object->id;
|
||||||
$formfile->form_attach_new_file(DOL_URL_ROOT.'/product/document.php?id='.$object->id,'',0,0,($user->rights->produit->creer||$user->rights->service->creer),50,$object);
|
include_once DOL_DOCUMENT_ROOT . '/core/tpl/document_actions_post_headers.tpl.php';
|
||||||
|
|
||||||
|
|
||||||
// List of document
|
|
||||||
$formfile->list_of_documents($filearray,$object,'produit');
|
|
||||||
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
/* Copyright (C) 2001-2007 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
/* Copyright (C) 2001-2007 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||||
* Copyright (C) 2004-2012 Laurent Destailleur <eldy@users.sourceforge.net>
|
* Copyright (C) 2004-2013 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
* Copyright (C) 2005 Eric Seigne <eric.seigne@ryxeo.com>
|
* Copyright (C) 2005 Eric Seigne <eric.seigne@ryxeo.com>
|
||||||
* Copyright (C) 2005-2013 Regis Houssin <regis.houssin@capnetworks.com>
|
* Copyright (C) 2005-2013 Regis Houssin <regis.houssin@capnetworks.com>
|
||||||
* Copyright (C) 2006 Andre Cianfarani <acianfa@free.fr>
|
* Copyright (C) 2006 Andre Cianfarani <acianfa@free.fr>
|
||||||
|
|||||||
@ -1,6 +1,7 @@
|
|||||||
<?php
|
<?php
|
||||||
/* Copyright (C) 2010 Regis Houssin <regis.houssin@capnetworks.com>
|
/* Copyright (C) 2010 Regis Houssin <regis.houssin@capnetworks.com>
|
||||||
* Copyright (C) 2012 Laurent Destailleur <eldy@users.sourceforge.net>
|
* Copyright (C) 2012 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
|
* Copyright (C) 2013 Cédric Salvador <csalvador@gpcsolutions.fr>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -49,6 +50,7 @@ $object->fetch($id,$ref);
|
|||||||
if ($object->id > 0)
|
if ($object->id > 0)
|
||||||
{
|
{
|
||||||
$object->fetch_thirdparty();
|
$object->fetch_thirdparty();
|
||||||
|
$upload_dir = $conf->projet->dir_output . "/" . dol_sanitizeFileName($object->ref);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Get parameters
|
// Get parameters
|
||||||
@ -68,25 +70,7 @@ if (! $sortfield) $sortfield="name";
|
|||||||
* Actions
|
* Actions
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// Envoi fichier
|
include_once DOL_DOCUMENT_ROOT . '/core/tpl/document_actions_pre_headers.tpl.php';
|
||||||
if (GETPOST('sendit') && ! empty($conf->global->MAIN_UPLOAD_DOC))
|
|
||||||
{
|
|
||||||
$upload_dir = $conf->projet->dir_output . "/" . dol_sanitizeFileName($object->ref);
|
|
||||||
dol_add_file_process($upload_dir,0,1,'userfile');
|
|
||||||
}
|
|
||||||
|
|
||||||
// Delete
|
|
||||||
if ($action == 'confirm_delete' && $confirm == 'yes' && $user->rights->projet->supprimer)
|
|
||||||
{
|
|
||||||
$langs->load("other");
|
|
||||||
$upload_dir = $conf->projet->dir_output . "/" . dol_sanitizeFileName($object->ref);
|
|
||||||
$file = $upload_dir . '/' . GETPOST('urlfile'); // Do not use urldecode here ($_GET and $_REQUEST are already decoded by PHP).
|
|
||||||
$ret=dol_delete_file($file,0,0,0,$object);
|
|
||||||
if ($ret) setEventMessage($langs->trans("FileWasRemoved", GETPOST('urlfile')));
|
|
||||||
else setEventMessage($langs->trans("ErrorFailToDeleteFile", GETPOST('urlfile')), 'errors');
|
|
||||||
header('Location: '.$_SERVER["PHP_SELF"].'?id='.$object->id);
|
|
||||||
exit;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -120,11 +104,6 @@ if ($object->id > 0)
|
|||||||
$totalsize+=$file['size'];
|
$totalsize+=$file['size'];
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($action == 'delete')
|
|
||||||
{
|
|
||||||
print $form->formconfirm($_SERVER["PHP_SELF"]."?id=".$object->id."&urlfile=".urlencode(GETPOST("urlfile")),$langs->trans("DeleteAFile"),$langs->trans("ConfirmDeleteAFile"),"confirm_delete",'','',1);
|
|
||||||
}
|
|
||||||
|
|
||||||
print '<table class="border" width="100%">';
|
print '<table class="border" width="100%">';
|
||||||
|
|
||||||
$linkback = '<a href="'.DOL_URL_ROOT.'/projet/liste.php">'.$langs->trans("BackToList").'</a>';
|
$linkback = '<a href="'.DOL_URL_ROOT.'/projet/liste.php">'.$langs->trans("BackToList").'</a>';
|
||||||
@ -165,14 +144,10 @@ if ($object->id > 0)
|
|||||||
print "</table>\n";
|
print "</table>\n";
|
||||||
print "</div>\n";
|
print "</div>\n";
|
||||||
|
|
||||||
// Affiche formulaire upload
|
$modulepart = 'projet';
|
||||||
$formfile=new FormFile($db);
|
$permission = ($userWrite > 0);
|
||||||
$formfile->form_attach_new_file(DOL_URL_ROOT.'/projet/document.php?id='.$object->id,'',0,0,($userWrite>0),50,$object);
|
$param = '&id=' . $object->id;
|
||||||
|
include_once DOL_DOCUMENT_ROOT . '/core/tpl/document_actions_post_headers.tpl.php';
|
||||||
|
|
||||||
// List of document
|
|
||||||
$param='&id='.$object->id;
|
|
||||||
$formfile->list_of_documents($filearray,$object,'projet',$param,0,'',($userWrite>0));
|
|
||||||
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|||||||
@ -2,6 +2,7 @@
|
|||||||
/* Copyright (C) 2010-2012 Regis Houssin <regis.houssin@capnetworks.com>
|
/* Copyright (C) 2010-2012 Regis Houssin <regis.houssin@capnetworks.com>
|
||||||
* Copyright (C) 2006-2012 Laurent Destailleur <eldy@users.sourceforge.net>
|
* Copyright (C) 2006-2012 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
* Copyright (C) 2012 Florian Henry <florian.henry@open-concept.pro>
|
* Copyright (C) 2012 Florian Henry <florian.henry@open-concept.pro>
|
||||||
|
* Copyright (C) 2013 Cédric Salvador <csalvador@gpcsolutions.fr>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -107,23 +108,7 @@ if ($id > 0 || ! empty($ref))
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Envoi fichier
|
include_once DOL_DOCUMENT_ROOT . '/core/tpl/document_actions_pre_headers.tpl.php';
|
||||||
if (GETPOST('sendit') && ! empty($conf->global->MAIN_UPLOAD_DOC))
|
|
||||||
{
|
|
||||||
dol_add_file_process($upload_dir,0,1,'userfile');
|
|
||||||
}
|
|
||||||
|
|
||||||
// Delete
|
|
||||||
if ($action=='delete')
|
|
||||||
{
|
|
||||||
$langs->load("other");
|
|
||||||
$file = $upload_dir . '/' . GETPOST('urlfile'); // Do not use urldecode here ($_GET and $_REQUEST are already decoded by PHP).
|
|
||||||
$ret=dol_delete_file($file,0,0,0,$object);
|
|
||||||
if ($ret) setEventMessage($langs->trans("FileWasRemoved", GETPOST('urlfile')));
|
|
||||||
else setEventMessage($langs->trans("ErrorFailToDeleteFile", GETPOST('urlfile')), 'errors');
|
|
||||||
header('Location: '.$_SERVER["PHP_SELF"].'?id='.$id);
|
|
||||||
exit;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* View
|
* View
|
||||||
@ -244,15 +229,10 @@ if ($object->id > 0)
|
|||||||
|
|
||||||
print '<br>';
|
print '<br>';
|
||||||
|
|
||||||
|
$modulepart = 'projet';
|
||||||
// Affiche formulaire upload
|
$permission = $user->rights->projet->creer;
|
||||||
$formfile=new FormFile($db);
|
$param = '&id=' . $object->id;
|
||||||
$formfile->form_attach_new_file(DOL_URL_ROOT.'/projet/tasks/document.php?id='.$object->id.($withproject?'&withproject=1':''),'',0,0,$user->rights->projet->creer,50,$object);
|
include_once DOL_DOCUMENT_ROOT . '/core/tpl/document_actions_post_headers.tpl.php';
|
||||||
|
|
||||||
|
|
||||||
// List of document
|
|
||||||
$param='&id='.$object->id;
|
|
||||||
$formfile->list_of_documents($filearray,$object,'projet',$param,0,dol_sanitizeFileName($projectstatic->ref).'/'.dol_sanitizeFileName($object->ref).'/');
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|||||||
@ -3,6 +3,7 @@
|
|||||||
* Copyright (C) 2004-2010 Laurent Destailleur <eldy@users.sourceforge.net>
|
* Copyright (C) 2004-2010 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
|
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
|
||||||
* Copyright (C) 2010 Juanjo Menent <jmenent@2byte.es>
|
* Copyright (C) 2010 Juanjo Menent <jmenent@2byte.es>
|
||||||
|
* Copyright (C) 2013 Cédric Salvador <csalvador@gpcsolutions.fr>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -72,31 +73,7 @@ if ($id > 0 || ! empty($ref))
|
|||||||
* Actions
|
* Actions
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// TODO Use an include to mutualize this code for action sendit and confirm_deletefile
|
include_once DOL_DOCUMENT_ROOT . '/core/tpl/document_actions_pre_headers.tpl.php';
|
||||||
|
|
||||||
// Post file
|
|
||||||
if (GETPOST('sendit') && ! empty($conf->global->MAIN_UPLOAD_DOC))
|
|
||||||
{
|
|
||||||
if ($object->id)
|
|
||||||
{
|
|
||||||
dol_add_file_process($upload_dir,0,1,'userfile');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Delete file
|
|
||||||
if ($action == 'confirm_deletefile' && $confirm == 'yes')
|
|
||||||
{
|
|
||||||
if ($object->id)
|
|
||||||
{
|
|
||||||
$file = $upload_dir . "/" . GETPOST('urlfile'); // Do not use urldecode here ($_GET and $_REQUEST are already decoded by PHP).
|
|
||||||
|
|
||||||
$ret=dol_delete_file($file,0,0,0,$object);
|
|
||||||
if ($ret) setEventMessage($langs->trans("FileWasRemoved", GETPOST('urlfile')));
|
|
||||||
else setEventMessage($langs->trans("ErrorFailToDeleteFile", GETPOST('urlfile')), 'errors');
|
|
||||||
header('Location: '.$_SERVER["PHP_SELF"].'?id='.$object->id);
|
|
||||||
exit;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -172,23 +149,10 @@ if ($object->id)
|
|||||||
|
|
||||||
print '</div>';
|
print '</div>';
|
||||||
|
|
||||||
/*
|
$modulepart = 'societe';
|
||||||
* Confirmation suppression fichier
|
$permission = $user->rights->societe->creer;
|
||||||
*/
|
$param = '&id=' . $object->id;
|
||||||
if ($action == 'delete')
|
include_once DOL_DOCUMENT_ROOT . '/core/tpl/document_actions_post_headers.tpl.php';
|
||||||
{
|
|
||||||
print $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id.'&urlfile='.urlencode(GETPOST("urlfile")), $langs->trans('DeleteFile'), $langs->trans('ConfirmDeleteFile'), 'confirm_deletefile', '', 0, 1);
|
|
||||||
}
|
|
||||||
|
|
||||||
$formfile=new FormFile($db);
|
|
||||||
|
|
||||||
// Show upload form
|
|
||||||
$formfile->form_attach_new_file($_SERVER["PHP_SELF"].'?id='.$object->id,'',0,0,$user->rights->societe->creer,50,$object);
|
|
||||||
|
|
||||||
// List of document
|
|
||||||
$formfile->list_of_documents($filearray,$object,'societe');
|
|
||||||
|
|
||||||
print "<br><br>";
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user