cvsimport

This commit is contained in:
Laurent Destailleur
2011-07-03 22:42:35 +00:00
26 changed files with 936 additions and 198 deletions

View File

@@ -1,6 +1,6 @@
--------------------------------------------------------------
English Dolibarr ChangeLog
$Id: ChangeLog,v 1.421 2011/07/02 11:28:03 eldy Exp $
$Id: ChangeLog,v 1.422 2011/07/03 13:44:02 eldy Exp $
--------------------------------------------------------------
***** ChangeLog for 3.1 compared to 3.0 *****
@@ -59,8 +59,6 @@ For users:
- New: task #11003: checkbox on checks for deposit.
- New: Add status into export. Add third party default language into export.
- New: Can filter on date and bank account when building check receipts.
- New: Paypal module can show paypal list of transaction and convert one
into an order.
- New: task #10958 : Add link to cheque receipts into bank transaction
line if exists
- New: Can import external ical url into dolibarr agenda view.

View File

@@ -17,17 +17,14 @@ beta version of Dolibarr, step by step.
- Update version number with x.x.x-y in htdocs/install/inc.php
- Commit all changes.
- Add a CVS Tag (DOLIBARR_x_y_BETA)
- If it's a new branch (Vx.y), create a branch (DOLIBARR_x_y_BRANCH).
- Create a branch (DOLIBARR_x_y_BRANCH).
- Build Dolibarr and DoliWamp with makepack-dolibarr.pl
- Check content of built packages.
- Move build files (tgz+exe+deb), ChangeLog and PAD/DOAP files into the
Dolibarr web site repository /home/dolibarr/wwwroot/files.
- Update and upload NLTechno web page with DoliWamp version.
- Add/Update entries on joomla web site www.dolibarr.org with links
to files http://www.dolibarr.org/files/XXX.
- Update the CVS on server that build automatically the tgz beta package
or build Dolibarr and DoliWamp with makepack-dolibarr.pl
- Enable entries on joomla web site www.dolibarr.org with links
that point to that file ("Dolibarr CVS snapshot of current beta").
- Post a news on dolibarr.org/dolibarr.fr
- Send mail on mailings-list

188
htdocs/adherents/admin/public.php Executable file
View File

@@ -0,0 +1,188 @@
<?php
/* Copyright (C) 2001-2002 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2006-2010 Laurent Destailleur <eldy@users.sourceforge.net>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
/**
* \file htdocs/adherents/admin/public.php
* \ingroup member
* \brief File of main public page for member module
* \author Laurent Destailleur
* \version $Id: public.php,v 1.1 2011/07/03 16:00:19 eldy Exp $
*/
require("../../main.inc.php");
require_once(DOL_DOCUMENT_ROOT."/lib/admin.lib.php");
require_once(DOL_DOCUMENT_ROOT."/lib/company.lib.php");
require_once(DOL_DOCUMENT_ROOT."/lib/member.lib.php");
$action=GETPOST('action');
/*
* Actions
*/
if ($action == 'update')
{
$i=0;
$i+=dolibarr_set_const($db, "MEMBER_ENABLE_PUBLIC",$_POST["MEMBER_ENABLE_PUBLIC"],'chaine',0,'',$conf->entity);
$i+=dolibarr_set_const($db, "MEMBER_NEWFORM_AMOUNT",$_POST["MEMBER_NEWFORM_AMOUNT"],'chaine',0,'',$conf->entity);
$i+=dolibarr_set_const($db, "MEMBER_NEWFORM_EDITAMOUNT",$_POST["MEMBER_NEWFORM_EDITAMOUNT"],'chaine',0,'',$conf->entity);
$i+=dolibarr_set_const($db, "MEMBER_NEWFORM_PAYONLINE",$_POST["MEMBER_NEWFORM_PAYONLINE"],'chaine',0,'',$conf->entity);
if ($i == 4) $mesg=$langs->trans("RecordModifiedSuccessfully");
}
/*
* View
*/
$form=new Form($db);
$help_url='EN:Module_Foundations|FR:Module_Adh&eacute;rents|ES:M&oacute;dulo_Miembros';
llxHeader('',$langs->trans("MembersSetup"),$help_url);
$linkback='<a href="'.DOL_URL_ROOT.'/admin/modules.php">'.$langs->trans("BackToModuleList").'</a>';
print_fiche_titre($langs->trans("MembersSetup"),$linkback,'setup');
$head = member_admin_prepare_head($adh);
dol_fiche_head($head, 'public', $langs->trans("Member"), 0, 'user');
dol_htmloutput_mesg($mesg);
if ($conf->use_javascript_ajax)
{
print "\n".'<script type="text/javascript" language="javascript">';
print 'jQuery(document).ready(function () {
function initfields()
{
if (jQuery("#MEMBER_ENABLE_PUBLIC").val()==\'0\')
{
jQuery(".drag").hide();
}
if (jQuery("#MEMBER_ENABLE_PUBLIC").val()==\'1\')
{
jQuery(".drag").show();
}
}
initfields();
jQuery("#MEMBER_ENABLE_PUBLIC").change(function() {
initfields();
});
})';
print '</script>'."\n";
}
print $langs->trans("BlankSubscriptionFormDesc").'<br><br>';
print '<form action="'.$_SERVER["PHP_SELF"].'" method="post">';
print '<input type="hidden" name="action" value="update">';
print '<table class="noborder" width="100%">';
print '<tr class="liste_titre">';
print '<td>'.$langs->trans("Parameter").'</td>';
print '<td align="center" width="60">'.$langs->trans("Value").'</td>';
print "</tr>\n";
$var=true;
// Allow public form
$var=! $var;
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<tr '.$bc[$var].'><td>';
print $langs->trans("EnablePublicSubscriptionForm");
print '</td><td width="60" align="right">';
print $form->selectyesno("MEMBER_ENABLE_PUBLIC",$conf->global->MEMBER_ENABLE_PUBLIC,1);
print "</td></tr>\n";
print '</form>';
// Type
/*$var=! $var;
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<tr '.$bcdd[$var].'><td>';
print $langs->trans("EnablePublicSubscriptionForm");
print '</td><td width="60" align="center">';
print $form->selectyesno("forcedate",$conf->global->MEMBER_NEWFORM_FORCETYPE,1);
print "</td></tr>\n"; */
// Amount
$var=! $var;
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<tr '.$bcdd[$var].'><td>';
print $langs->trans("DefaultAmount");
print '</td><td width="60" align="right">';
print '<input type="text" id="MEMBER_NEWFORM_AMOUNT" name="MEMBER_NEWFORM_AMOUNT" size="5" value="'.$conf->global->MEMBER_NEWFORM_AMOUNT.'">';;
print "</td></tr>\n";
// Can edit
$var=! $var;
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<tr '.$bcdd[$var].'><td>';
print $langs->trans("CanEditAmount");
print '</td><td width="60" align="right">';
print $form->selectyesno("MEMBER_NEWFORM_EDITAMOUNT",$conf->global->MEMBER_NEWFORM_EDITAMOUNT,1);
print "</td></tr>\n";
if ($conf->paybox->enabled || $conf->paypal->enabled)
{
// Jump to an online payment page
$var=! $var;
print '<tr '.$bcdd[$var].'><td>';
print $langs->trans("MEMBER_NEWFORM_PAYONLINE");
print '</td><td width="60" align="right">';
$listofval=array();
if ($conf->paybox->enabled) $listofval['paybox']='Paybox';
if ($conf->paypal->enabled) $listofval['paypal']='PayPal';
print $form->selectarray("MEMBER_NEWFORM_PAYONLINE",$listofval,$conf->global->MEMBER_NEWFORM_PAYONLINE,1);
print "</td></tr>\n";
}
print '</table>';
print '<center>';
print '<input type="submit" class="button" value="'.$langs->trans("Modify").'">';
print '</center>';
print '</form>';
dol_fiche_end();
print '<br>';
//print $langs->trans('FollowingLinksArePublic').'<br>';
print img_picto('','object_globe.png').' '.$langs->trans('BlankSubscriptionForm').':<br>';
print '<a target="_blank" href="'.DOL_URL_ROOT.'/public/members/new.php'.'">'.DOL_MAIN_URL_ROOT.'/public/members/new.php'.'</a>';
/*
print '<table class="border" cellspacing="0" cellpadding="3">';
print '<tr class="liste_titre"><td>'.$langs->trans("Description").'</td><td>'.$langs->trans("URL").'</td></tr>';
print '<tr><td>'.$langs->trans("BlankSubscriptionForm").'</td><td>'..'</td></tr>';
print '<tr><td>'.$langs->trans("PublicMemberList").'</td><td>'.img_picto('','object_globe.png').' '.'<a target="_blank" href="'.DOL_URL_ROOT.'/public/members/public_list.php'.'">'.DOL_MAIN_URL_ROOT.'/public/members/public_list.php'.'</a></td></tr>';
print '<tr><td>'.$langs->trans("PublicMemberCard").'</td><td>'.img_picto('','object_globe.png').' '.DOL_MAIN_URL_ROOT.'/public/members/public_card.php?id=xxx'.'</td></tr>';
print '</table>';
*/
$db->close();
llxFooter('$Date: 2011/07/03 16:00:19 $ - $Revision: 1.1 $');
?>

View File

@@ -25,7 +25,7 @@
* \file htdocs/adherents/class/adherent.class.php
* \ingroup member
* \brief File of class to manage members of a foundation
* \version $Id$
* \version $Id: adherent.class.php,v 1.44 2011/07/03 16:55:31 eldy Exp $
*/
require_once(DOL_DOCUMENT_ROOT."/core/class/commonobject.class.php");
@@ -274,7 +274,7 @@ class Adherent extends CommonObject
$sql.= " VALUES (";
$sql.= " '".$this->db->idate($this->datec)."'";
$sql.= ", ".($this->login?"'".$this->db->escape($this->login)."'":"null");
$sql.= ", ".($user->id>0?$user->id:"null"); // Can be null because member can be create by a guest or a script
$sql.= ", ".($user->id>0?$user->id:"null"); // Can be null because member can be createb by a guest or a script
$sql.= ", null, null, '".$this->morphy."'";
$sql.= ", '".$this->typeid."'";
$sql.= ", ".$conf->entity;
@@ -288,6 +288,7 @@ class Adherent extends CommonObject
if ($id > 0)
{
$this->id=$id;
$this->ref=$id;
// Update minor fields
$result=$this->update($user,1,1); // nosync is 1 to avoid update data of user

View File

@@ -1,62 +0,0 @@
<?php
/* Copyright (C) 2001-2002 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2006-2010 Laurent Destailleur <eldy@users.sourceforge.net>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
/**
* \file htdocs/adherents/public.php
* \ingroup member
* \brief File of main public page for member module
* \author Laurent Destailleur
* \version $Id$
*/
require("../main.inc.php");
/*
* View
*/
llxHeader();
print_fiche_titre($langs->trans("PublicMembersArea"));
print '<table border="0" width="100%" class="notopnoleftnoright">';
print '<tr><td valign="top" width="100%" class="notopnoleft">';
print $langs->trans('FollowingLinksArePublic').'<br>';
print '<br>';
print '<table class="border" cellspacing="0" cellpadding="3">';
print '<tr class="liste_titre"><td>'.$langs->trans("Description").'</td><td>'.$langs->trans("URL").'</td></tr>';
print '<tr><td>'.$langs->trans("BlankSubscriptionForm").'</td><td>'.img_picto('','object_globe.png').' '.'<a target="_blank" href="'.DOL_URL_ROOT.'/public/members/new.php'.'">'.DOL_MAIN_URL_ROOT.'/public/members/new.php'.'</a></td></tr>';
print '<tr><td>'.$langs->trans("PublicMemberList").'</td><td>'.img_picto('','object_globe.png').' '.'<a target="_blank" href="'.DOL_URL_ROOT.'/public/members/public_list.php'.'">'.DOL_MAIN_URL_ROOT.'/public/members/public_list.php'.'</a></td></tr>';
print '<tr><td>'.$langs->trans("PublicMemberCard").'</td><td>'.img_picto('','object_globe.png').' '.DOL_MAIN_URL_ROOT.'/public/members/public_card.php?id=xxx'.'</td></tr>';
print '</table>';
print '</td></tr></table>';
$db->close();
llxFooter('$Date$ - $Revision$');
?>

View File

@@ -0,0 +1,349 @@
<?php
/*
* jQuery File Upload Plugin PHP Example 5.2.2
* https://github.com/blueimp/jQuery-File-Upload
*
* Copyright 2010, Sebastian Tschan
* https://blueimp.net
*
* Licensed under the MIT license:
* http://creativecommons.org/licenses/MIT/
*/
//if (! defined('NOREQUIREUSER')) define('NOREQUIREUSER','1');
//if (! defined('NOREQUIREDB')) define('NOREQUIREDB','1');
if (! defined('NOREQUIRESOC')) define('NOREQUIRESOC','1');
//if (! defined('NOREQUIRETRAN')) define('NOREQUIRETRAN','1');
if (! defined('NOCSRFCHECK')) define('NOCSRFCHECK','1');
if (! defined('NOTOKENRENEWAL')) define('NOTOKENRENEWAL','1');
if (! defined('NOREQUIREMENU')) define('NOREQUIREMENU','1'); // If there is no menu to show
if (! defined('NOREQUIREHTML')) define('NOREQUIREHTML','1'); // If we don't need to load the html.form.class.php
//if (! defined('NOREQUIREAJAX')) define('NOREQUIREAJAX','1');
//if (! defined("NOLOGIN")) define("NOLOGIN",'1'); // If this page is public (can be called outside logged session)
$res=@include("../../main.inc.php"); // For "custom" directory
if (! $res) $res=@include("../main.inc.php"); // For root directory
if (! $res) @include("../../../../dolibarr/htdocs/main.inc.php"); // Used on dev env only
require_once(DOL_DOCUMENT_ROOT."/lib/files.lib.php");
error_reporting(E_ALL | E_STRICT);
//print_r($_POST);
//print_r($_GET);
//print 'upload_dir='.GETPOST('upload_dir');
$fk_element = GETPOST('fk_element');
$element = GETPOST('element');
class UploadHandler
{
private $options;
private $fk_elment;
private $element;
function __construct($options=null,$fk_element=null,$element=null) {
global $conf;
$this->fk_element=$fk_element;
$this->element=$element;
$this->options = array(
'script_url' => $_SERVER['PHP_SELF'],
'upload_dir' => $conf->$element->dir_output . '/' . $fk_element . '/',
'upload_url' => DOL_URL_ROOT.'/document.php?modulepart='.$element.'&attachment=1&file=/'.$fk_element.'/',
'param_name' => 'files',
// The php.ini settings upload_max_filesize and post_max_size
// take precedence over the following max_file_size setting:
'max_file_size' => null,
'min_file_size' => 1,
'accept_file_types' => '/.+$/i',
'max_number_of_files' => null,
'discard_aborted_uploads' => true,
'image_versions' => array(
// Uncomment the following version to restrict the size of
// uploaded images. You can also add additional versions with
// their own upload directories:
/*
'large' => array(
'upload_dir' => dirname(__FILE__).'/files/',
'upload_url' => dirname($_SERVER['PHP_SELF']).'/files/',
'max_width' => 1920,
'max_height' => 1200
),
*/
'thumbnail' => array(
'upload_dir' => $conf->$element->dir_output . '/' . $fk_element . '/thumbs/',
'upload_url' => DOL_URL_ROOT.'/document.php?modulepart='.$element.'&attachment=1&file=/'.$fk_element.'/thumbs/',
'max_width' => 40,
'max_height' => 40
)
)
);
if ($options) {
$this->options = array_merge_recursive($this->options, $options);
}
}
private function get_file_object($file_name) {
$file_path = $this->options['upload_dir'].$file_name;
if (is_file($file_path) && $file_name[0] !== '.') {
$file = new stdClass();
$file->name = $file_name;
$file->mime = dol_mimetype($file_name,'',2);
$file->size = filesize($file_path);
$file->url = $this->options['upload_url'].rawurlencode($file->name);
foreach($this->options['image_versions'] as $version => $options) {
if (is_file($options['upload_dir'].$file_name)) {
$file->{$version.'_url'} = $options['upload_url']
.rawurlencode($file->name);
}
}
$file->delete_url = $this->options['script_url']
.'?file='.rawurlencode($file->name).'&fk_element='.$this->fk_element.'&element='.$this->element;
$file->delete_type = 'DELETE';
return $file;
}
return null;
}
private function get_file_objects() {
return array_values(array_filter(array_map(
array($this, 'get_file_object'),
scandir($this->options['upload_dir'])
)));
}
private function create_scaled_image($file_name, $options) {
$file_path = $this->options['upload_dir'].$file_name;
$new_file_path = $options['upload_dir'].$file_name;
list($img_width, $img_height) = @getimagesize($file_path);
if (!$img_width || !$img_height) {
return false;
}
$scale = min(
$options['max_width'] / $img_width,
$options['max_height'] / $img_height
);
if ($scale > 1) {
$scale = 1;
}
$new_width = $img_width * $scale;
$new_height = $img_height * $scale;
$new_img = @imagecreatetruecolor($new_width, $new_height);
switch (strtolower(substr(strrchr($file_name, '.'), 1))) {
case 'jpg':
case 'jpeg':
$src_img = @imagecreatefromjpeg($file_path);
$write_image = 'imagejpeg';
break;
case 'gif':
$src_img = @imagecreatefromgif($file_path);
$write_image = 'imagegif';
break;
case 'png':
$src_img = @imagecreatefrompng($file_path);
$write_image = 'imagepng';
break;
default:
$src_img = $image_method = null;
}
$success = $src_img && @imagecopyresampled(
$new_img,
$src_img,
0, 0, 0, 0,
$new_width,
$new_height,
$img_width,
$img_height
) && $write_image($new_img, $new_file_path);
// Free up memory (imagedestroy does not delete files):
@imagedestroy($src_img);
@imagedestroy($new_img);
return $success;
}
private function has_error($uploaded_file, $file, $error) {
if ($error) {
return $error;
}
if (!preg_match($this->options['accept_file_types'], $file->name)) {
return 'acceptFileTypes';
}
if ($uploaded_file && is_uploaded_file($uploaded_file)) {
$file_size = filesize($uploaded_file);
} else {
$file_size = $_SERVER['CONTENT_LENGTH'];
}
if ($this->options['max_file_size'] && (
$file_size > $this->options['max_file_size'] ||
$file->size > $this->options['max_file_size'])
) {
return 'maxFileSize';
}
if ($this->options['min_file_size'] &&
$file_size < $this->options['min_file_size']) {
return 'minFileSize';
}
if (is_int($this->options['max_number_of_files']) && (
count($this->get_file_objects()) >= $this->options['max_number_of_files'])
) {
return 'maxNumberOfFiles';
}
return $error;
}
private function handle_file_upload($uploaded_file, $name, $size, $type, $error) {
$file = new stdClass();
$file->name = basename(stripslashes($name));
$file->mime = dol_mimetype($file->name,'',2);
$file->size = intval($size);
$file->type = $type;
$error = $this->has_error($uploaded_file, $file, $error);
if (!$error && $file->name) {
if ($file->name[0] === '.') {
$file->name = substr($file->name, 1);
}
$file_path = $this->options['upload_dir'].$file->name;
$append_file = is_file($file_path) && $file->size > filesize($file_path);
clearstatcache();
if ($uploaded_file && is_uploaded_file($uploaded_file)) {
// multipart/formdata uploads (POST method uploads)
if ($append_file) {
file_put_contents(
$file_path,
fopen($uploaded_file, 'r'),
FILE_APPEND
);
} else {
move_uploaded_file($uploaded_file, $file_path);
}
} else {
// Non-multipart uploads (PUT method support)
file_put_contents(
$file_path,
fopen('php://input', 'r'),
$append_file ? FILE_APPEND : 0
);
}
$file_size = filesize($file_path);
if ($file_size === $file->size) {
$file->url = $this->options['upload_url'].rawurlencode($file->name);
foreach($this->options['image_versions'] as $version => $options) {
if ($this->create_scaled_image($file->name, $options)) {
$file->{$version.'_url'} = $options['upload_url']
.rawurlencode($file->name);
}
}
} else if ($this->options['discard_aborted_uploads']) {
unlink($file_path);
$file->error = 'abort';
}
$file->size = $file_size;
$file->delete_url = $this->options['script_url']
.'?file='.rawurlencode($file->name).'&fk_element='.$this->fk_element.'&element='.$this->element;
$file->delete_type = 'DELETE';
} else {
$file->error = $error;
}
return $file;
}
public function get() {
$file_name = isset($_REQUEST['file']) ?
basename(stripslashes($_REQUEST['file'])) : null;
if ($file_name) {
$info = $this->get_file_object($file_name);
} else {
$info = $this->get_file_objects();
}
header('Content-type: application/json');
echo json_encode($info);
}
public function post() {
$upload = isset($_FILES[$this->options['param_name']]) ?
$_FILES[$this->options['param_name']] : array(
'tmp_name' => null,
'name' => null,
'size' => null,
'type' => null,
'error' => null
);
$info = array();
if (is_array($upload['tmp_name'])) {
foreach ($upload['tmp_name'] as $index => $value) {
$info[] = $this->handle_file_upload(
$upload['tmp_name'][$index],
isset($_SERVER['HTTP_X_FILE_NAME']) ?
$_SERVER['HTTP_X_FILE_NAME'] : $upload['name'][$index],
isset($_SERVER['HTTP_X_FILE_SIZE']) ?
$_SERVER['HTTP_X_FILE_SIZE'] : $upload['size'][$index],
isset($_SERVER['HTTP_X_FILE_TYPE']) ?
$_SERVER['HTTP_X_FILE_TYPE'] : $upload['type'][$index],
$upload['error'][$index]
);
}
} else {
$info[] = $this->handle_file_upload(
$upload['tmp_name'],
isset($_SERVER['HTTP_X_FILE_NAME']) ?
$_SERVER['HTTP_X_FILE_NAME'] : $upload['name'],
isset($_SERVER['HTTP_X_FILE_SIZE']) ?
$_SERVER['HTTP_X_FILE_SIZE'] : $upload['size'],
isset($_SERVER['HTTP_X_FILE_TYPE']) ?
$_SERVER['HTTP_X_FILE_TYPE'] : $upload['type'],
$upload['error']
);
}
header('Vary: Accept');
if (isset($_SERVER['HTTP_ACCEPT']) &&
(strpos($_SERVER['HTTP_ACCEPT'], 'application/json') !== false)) {
header('Content-type: application/json');
} else {
header('Content-type: text/plain');
}
echo json_encode($info);
}
public function delete() {
$file_name = isset($_REQUEST['file']) ?
basename(stripslashes($_REQUEST['file'])) : null;
$file_path = $this->options['upload_dir'].$file_name;
$success = is_file($file_path) && $file_name[0] !== '.' && unlink($file_path);
if ($success) {
foreach($this->options['image_versions'] as $version => $options) {
$file = $options['upload_dir'].$file_name;
if (is_file($file)) {
unlink($file);
}
}
}
header('Content-type: application/json');
echo json_encode($success);
}
}
$upload_handler = new UploadHandler(null,$fk_element,$element);
header('Pragma: no-cache');
header('Cache-Control: private, no-cache');
header('Content-Disposition: inline; filename="files.json"');
switch ($_SERVER['REQUEST_METHOD']) {
case 'HEAD':
case 'GET':
$upload_handler->get();
break;
case 'POST':
$upload_handler->post();
break;
case 'DELETE':
$upload_handler->delete();
break;
default:
header('HTTP/1.0 405 Method Not Allowed');
}
?>

View File

@@ -24,7 +24,7 @@
* \file htdocs/core/class/commondocgenerator.class.php
* \ingroup core
* \brief File of parent class for documents generators
* \version $Id$
* \version $Id: commondocgenerator.class.php,v 1.6 2011/07/03 21:59:53 eldy Exp $
*/
@@ -86,7 +86,8 @@ class CommonDocGenerator
'mycompany_address'=>$mysoc->address,
'mycompany_zip'=>$mysoc->zip,
'mycompany_town'=>$mysoc->town,
'mycompany_country'=>$mysoc->country,
'mycompany_country'=>$outputlangs->transnoentitiesnoconv("Country".$mysoc->pays_code),
'mycompany_country_code'=>$mysoc->pays_code,
'mycompany_web'=>$mysoc->url,
'mycompany_juridicalstatus'=>$mysoc->forme_juridique,
'mycompany_capital'=>$mysoc->capital,

View File

@@ -22,7 +22,7 @@
* \file htdocs/core/class/html.formfile.class.php
* \ingroup core
* \brief File of class to offer components to list and upload files
* \version $Id: html.formfile.class.php,v 1.34 2011/06/30 13:27:20 hregis Exp $
* \version $Id: html.formfile.class.php,v 1.37 2011/07/03 15:04:18 hregis Exp $
*/
@@ -732,6 +732,95 @@ class FormFile
// Fin de zone
}
/**
* Show form to upload a new file with jquery fileupload
*/
function form_ajaxfileupload($object)
{
global $langs;
print '<script type="text/javascript">
$(function () {
\'use strict\';
// Initialize the jQuery File Upload widget:
$("#fileupload").fileupload();
// Load existing files:
$.getJSON($("#fileupload form").prop("action"), { fk_element: "'.$object->id.'", element: "'.$object->element.'"}, function (files) {
var fu = $("#fileupload").data("fileupload");
fu._adjustMaxNumberOfFiles(-files.length);
fu._renderDownload(files)
.appendTo($("#fileupload .files"))
.fadeIn(function () {
// Fix for IE7 and lower:
$(this).show();
});
});
// Open download dialogs via iframes,
// to prevent aborting current uploads:
$("#fileupload .files a:not([target^=_blank])").live("click", function (e) {
e.preventDefault();
$(\'<iframe style="display:none;"></iframe>\')
.prop("src", this.href)
.appendTo("body");
});
// Confirm delete file
$("#fileupload").fileupload({
destroy: function (e, data) {
var that = $(this).data("fileupload");
if ( confirm("Delete this file ?") == true ) {
if (data.url) {
$.ajax(data)
.success(function () {
that._adjustMaxNumberOfFiles(1);
$(this).fadeOut(function () {
$(this).remove();
});
});
} else {
data.context.fadeOut(function () {
$(this).remove();
});
}
}
}
});
});
</script>';
print '<div id="fileupload">';
print '<form action="'.DOL_URL_ROOT.'/core/ajaxfileupload.php" method="POST" enctype="multipart/form-data">';
print '<input type="hidden" name="fk_element" value="'.$object->id.'">';
print '<input type="hidden" name="element" value="'.$object->element.'">';
print '<div class="fileupload-buttonbar">';
print '<input type="hidden" name="protocol" value="http">';
print '<label class="fileinput-button">';
print '<span>'.$langs->trans('AddFiles').'</span>';
print '<input type="file" name="files[]" multiple>';
print '</label>';
print '<button type="submit" class="start">'.$langs->trans('StartUpload').'</button>';
print '<button type="reset" class="cancel">'.$langs->trans('CancelUpload').'</button>';
print '</div></form>';
print '<div class="fileupload-content">';
print '<table width="100%" class="files">';
print '<tr class="liste_titre">';
print '<td>'.$langs->trans("Documents2").'</td>';
print '<td>'.$langs->trans("Preview").'</td>';
print '<td align="right">'.$langs->trans("Size").'</td>';
print '<td colspan="3"></td>';
print '</tr>';
print '</table>';
print '<div class="fileupload-progressbar"></div>';
print '</div>';
print '</div>';
// Include template
include(DOL_DOCUMENT_ROOT.'/core/tpl/ajaxfileupload.tpl.php');
}
}

View File

@@ -0,0 +1,86 @@
<?php
/* Copyright (C) 2011 Regis Houssin <regis@dolibarr.fr>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
* $Id: ajaxfileupload.tpl.php,v 1.4 2011/07/03 14:43:12 hregis Exp $
*/
?>
<!-- START TEMPLATE FILE UPLOAD -->
<script id="template-upload" type="text/x-jquery-tmpl">
<tr class="template-upload{{if error}} ui-state-error{{/if}}">
<td class="name">${name}</td>
<td class="preview"></td>
<td class="size">${sizef}</td>
{{if error}}
<td class="error" colspan="2">Error:
{{if error === 'maxFileSize'}}File is too big
{{else error === 'minFileSize'}}File is too small
{{else error === 'acceptFileTypes'}}Filetype not allowed
{{else error === 'maxNumberOfFiles'}}Max number of files exceeded
{{else}}${error}
{{/if}}
</td>
{{else}}
<td class="progress"><div></div></td>
<td class="start"><button><?php echo $langs->trans('Start'); ?></button></td>
{{/if}}
<td class="cancel"><button><?php echo $langs->trans('Cancel'); ?></button></td>
</tr>
</script>
<script id="template-download" type="text/x-jquery-tmpl">
<tr class="template-download{{if error}} ui-state-error{{/if}}">
{{if error}}
<td></td>
<td class="name">${name}</td>
<td class="size">${sizef}</td>
<td class="error" colspan="2">Error:
{{if error === 1}}File exceeds upload_max_filesize (php.ini directive)
{{else error === 2}}File exceeds MAX_FILE_SIZE (HTML form directive)
{{else error === 3}}File was only partially uploaded
{{else error === 4}}No File was uploaded
{{else error === 5}}Missing a temporary folder
{{else error === 6}}Failed to write file to disk
{{else error === 7}}File upload stopped by extension
{{else error === 'maxFileSize'}}File is too big
{{else error === 'minFileSize'}}File is too small
{{else error === 'acceptFileTypes'}}Filetype not allowed
{{else error === 'maxNumberOfFiles'}}Max number of files exceeded
{{else error === 'uploadedBytes'}}Uploaded bytes exceed file size
{{else error === 'emptyResult'}}Empty file upload result
{{else}}${error}
{{/if}}
</td>
{{else}}
<td class="name">
<img src="<?php echo DOL_URL_ROOT; ?>/theme/common/mime/${mime}" border="0">
<a href="${url}"{{if thumbnail_url}} target="_blank"{{/if}}>${name}</a>
</td>
<td class="preview">
{{if thumbnail_url}}
<a href="${url}" target="_blank"><img src="${thumbnail_url}"></a>
{{/if}}
</td>
<td class="size">${sizef}</td>
<td colspan="2"></td>
{{/if}}
<td align="right" class="delete">
<button data-type="${delete_type}" data-url="${delete_url}"><?php echo $langs->trans('Delete'); ?></button>
</td>
</tr>
</script>
<!-- END PHP TEMPLATE -->

View File

@@ -21,8 +21,8 @@
/**
* \file htdocs/includes/boxes/box_actions.php
* \ingroup actions
* \brief Module de generation de l'affichage de la box actions
* \version $Id$
* \brief Module to build boxe for events
* \version $Id: box_actions.php,v 1.48 2011/07/03 12:55:33 eldy Exp $
*/
include_once(DOL_DOCUMENT_ROOT."/includes/boxes/modules_boxes.php");
@@ -79,7 +79,7 @@ class box_actions extends ModeleBoxes {
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON a.fk_soc = s.rowid AND s.entity IN (0, ".$conf->entity.")";
$sql.= " WHERE a.fk_action = ta.id";
$sql.= " AND a.entity = ".$conf->entity;
$sql.= " AND a.percent <> 100";
$sql.= " AND a.percent >= 0 AND a.percent < 100";
if (!$user->rights->societe->client->voir && !$user->societe_id) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id;
if($user->societe_id) $sql.= " AND s.rowid = ".$user->societe_id;
$sql.= " ORDER BY a.datec DESC";
@@ -100,7 +100,7 @@ class box_actions extends ModeleBoxes {
$objp = $db->fetch_object($result);
$datelimite=$db->jdate($objp->dp);
if ($datelimite < ($now - $delay_warning)) $late=img_warning($langs->trans("Late"));
if ($objp->percentage >= 0 && $objp->percentage < 100 && $datelimite < ($now - $delay_warning)) $late=img_warning($langs->trans("Late"));
//($langs->transnoentities("Action".$objp->code)!=("Action".$objp->code) ? $langs->transnoentities("Action".$objp->code) : $objp->label)
$label=$objp->label;

View File

@@ -1,6 +1,6 @@
--
-- $Id: init_menu_auguria.sql,v 1.118 2011/06/29 17:55:34 eldy Exp $
-- $Revision: 1.118 $
-- $Id: init_menu_auguria.sql,v 1.119 2011/07/03 16:00:20 eldy Exp $
-- $Revision: 1.119 $
--
-- Menu base entries
-- This file is loaded when a menu handler base is activated (auguria, etc..)
@@ -263,7 +263,6 @@ insert into llx_menu (enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk
insert into llx_menu (enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('$conf->adherent->enabled && $conf->export->enabled', __HANDLER__, 'left', 4501__+MAX_llx_menu__, 'members', '', 4500__+MAX_llx_menu__, '/exports/index.php?leftmenu=export', 'Datas', 1, 'members', '$user->rights->adherent->export', '', 2, 0, __ENTITY__);
insert into llx_menu (enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('$conf->adherent->enabled', __HANDLER__, 'left', 4502__+MAX_llx_menu__, 'members', '', 4500__+MAX_llx_menu__, '/adherents/htpasswd.php?leftmenu=export', 'Filehtpasswd', 1, 'members', '$user->rights->adherent->export', '', 2, 1, __ENTITY__);
insert into llx_menu (enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('$conf->adherent->enabled', __HANDLER__, 'left', 4503__+MAX_llx_menu__, 'members', '', 4500__+MAX_llx_menu__, '/adherents/cartes/carte.php?leftmenu=export', 'MembersCards', 1, 'members', '$user->rights->adherent->export', '', 2, 2, __ENTITY__);
insert into llx_menu (enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('$conf->adherent->enabled', __HANDLER__, 'left', 4600__+MAX_llx_menu__, 'members', '', 13__+MAX_llx_menu__, '/adherents/public.php?leftmenu=member_public', 'MemberPublicLinks', 0, 'members', '$user->rights->adherent->export', '', 2, 4, __ENTITY__);
insert into llx_menu (enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('$conf->adherent->enabled', __HANDLER__, 'left', 4700__+MAX_llx_menu__, 'members', '', 13__+MAX_llx_menu__, '/adherents/type.php?leftmenu=setup&amp;mainmenu=members', 'MembersType', 0, 'members', '$user->rights->adherent->configurer', '', 2, 5, __ENTITY__);
insert into llx_menu (enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('$conf->adherent->enabled', __HANDLER__, 'left', 4701__+MAX_llx_menu__, 'members', '', 4700__+MAX_llx_menu__, '/adherents/type.php?leftmenu=setup&amp;mainmenu=members&amp;action=create', 'New', 1, 'members', '$user->rights->adherent->configurer', '', 2, 0, __ENTITY__);
insert into llx_menu (enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('$conf->adherent->enabled', __HANDLER__, 'left', 4702__+MAX_llx_menu__, 'members', '', 4700__+MAX_llx_menu__, '/adherents/type.php?leftmenu=setup&amp;mainmenu=members', 'List', 1, 'members', '$user->rights->adherent->configurer', '', 2, 1, __ENTITY__);

View File

@@ -1,6 +1,6 @@
--
-- $Id$
-- $Revision$
-- $Id: init_menu_smartphone.sql,v 1.7 2011/07/03 16:00:20 eldy Exp $
-- $Revision: 1.7 $
--
-- Menu base entries
-- This file is loaded when a menu handler base is activated (auguria, etc..)
@@ -281,7 +281,6 @@ insert into llx_menu (enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk
insert into llx_menu (enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('$conf->adherent->enabled && $conf->export->enabled', __HANDLER__, 'left', 4501__+MAX_llx_menu__, 'members', '', 4500__+MAX_llx_menu__, '/exports/index.php?leftmenu=export', 'Datas', 1, 'members', '$user->rights->adherent->export', '', 2, 0, __ENTITY__);
insert into llx_menu (enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('$conf->adherent->enabled', __HANDLER__, 'left', 4502__+MAX_llx_menu__, 'members', '', 4500__+MAX_llx_menu__, '/adherents/htpasswd.php?leftmenu=export', 'Filehtpasswd', 1, 'members', '$user->rights->adherent->export', '', 2, 1, __ENTITY__);
insert into llx_menu (enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('$conf->adherent->enabled', __HANDLER__, 'left', 4503__+MAX_llx_menu__, 'members', '', 4500__+MAX_llx_menu__, '/adherents/cartes/carte.php?leftmenu=export', 'MembersCards', 1, 'members', '$user->rights->adherent->export', '', 2, 2, __ENTITY__);
insert into llx_menu (enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('$conf->adherent->enabled', __HANDLER__, 'left', 4600__+MAX_llx_menu__, 'members', '', 13__+MAX_llx_menu__, '/adherents/public.php?leftmenu=member_public', 'MemberPublicLinks', 0, 'members', '$user->rights->adherent->export', '', 2, 4, __ENTITY__);
insert into llx_menu (enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('$conf->adherent->enabled', __HANDLER__, 'left', 4700__+MAX_llx_menu__, 'members', '', 13__+MAX_llx_menu__, '/adherents/index.php?leftmenu=setup&amp;mainmenu=members', 'Setup', 0, 'members', '$user->rights->adherent->configurer', '', 2, 5, __ENTITY__);
insert into llx_menu (enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('$conf->adherent->enabled', __HANDLER__, 'left', 4701__+MAX_llx_menu__, 'members', '', 4700__+MAX_llx_menu__, '/adherents/type.php?leftmenu=setup', 'MembersTypes', 1, 'members', '$user->rights->adherent->configurer', '', 2, 0, __ENTITY__);
insert into llx_menu (enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('$conf->adherent->enabled', __HANDLER__, 'left', 4702__+MAX_llx_menu__, 'members', '', 4700__+MAX_llx_menu__, '/adherents/options.php?leftmenu=setup', 'MembersAttributes', 1, 'members', '$user->rights->adherent->configurer', '', 2, 1, __ENTITY__);

View File

@@ -21,7 +21,7 @@
/**
* \file htdocs/includes/menus/standard/eldy.lib.php
* \brief Library for file eldy menus
* \version $Id: eldy.lib.php,v 1.53 2011/06/29 22:41:49 eldy Exp $
* \version $Id: eldy.lib.php,v 1.54 2011/07/03 16:00:18 eldy Exp $
*/
@@ -1301,7 +1301,6 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after)
if ($leftmenu=="export") $newmenu->add("/adherents/htpasswd.php?leftmenu=export",$langs->trans("Filehtpasswd"),1,$user->rights->adherent->export);
if ($leftmenu=="export") $newmenu->add("/adherents/cartes/carte.php?leftmenu=export",$langs->trans("MembersCards"),1,$user->rights->adherent->export);
$newmenu->add("/adherents/public.php?leftmenu=member_public",$langs->trans("MemberPublicLinks"));
// Type
$newmenu->add("/adherents/type.php?leftmenu=setup&amp;mainmenu=members",$langs->trans("MembersTypes"),0,$user->rights->adherent->configurer);
$newmenu->add("/adherents/type.php?leftmenu=setup&amp;mainmenu=members&amp;action=create",$langs->trans("New"),1,$user->rights->adherent->configurer);

View File

@@ -306,7 +306,7 @@ ConnectionTimeout=Connexion timeout
ResponseTimeout=Response timeout
SmsTestMessage=Test message from __PHONEFROM__ to __PHONETO__
ModuleMustBeEnabledFirst=Module <b>%s</b> must be enabled first before using this feature.
SecurityToken=Security token
SecurityToken=Key to encrypt urls
# Modules
Module0Name=Users & groups

View File

@@ -76,7 +76,7 @@ EditMember=Edit member
SubscriptionEndDate=Subscription's end date
MembersTypeSetup=Members type setup
NewSubscription=New subscription
NewSubscriptionDesc=This form allows you to record your subscription as a new member of the foundation. If you want to renew your subscription being already a member, please contact foundation board instead.
NewSubscriptionDesc=This form allows you to record your subscription as a new member of the foundation. If you want to renew your subscription (if already a member), please contact foundation board instead.
Subscription=Subscription
Subscriptions=Subscriptions
SubscriptionLate=Late
@@ -109,7 +109,9 @@ ValidateMember=Validate a member
ConfirmValidateMember=Are you sure you want to validate this member ?
FollowingLinksArePublic=The following links are open pages not protected by any Dolibarr permission. They are not formated pages, provided as example to show how to list members database.
PublicMemberList=Public member list
BlankSubscriptionForm=Subscription form
BlankSubscriptionForm=Public auto-subscription form
BlankSubscriptionFormDesc=Dolibarr can provide you a public URL to allow external visitors to ask to subscribe to the foundation. If an online payment module is enabled, a payment form will also be automatically provided.
EnablePublicSubscriptionForm=Enable the public auto-subscription form
MemberPublicLinks=Public links/pages
ExportDataset_member_1=Members and subscriptions
ImportDataset_member_1=Members
@@ -176,11 +178,14 @@ MembersStatisticsDesc=Choose statistics you want to read...
MenuMembersStats=Statistics
LastMemberDate=Last member date
Nature=Nature
Public=Public
Public=Information are public (no=private)
Exports=Exports
NewMemberbyWeb=New member added. Awaiting approval
NewMemberForm=New member form
SubscriptionsStatistics=Statistics on subscriptions
NbOfSubscriptions=Number of subscriptions
AmountOfSubscriptions=Amount of subscriptions
TurnoverOrBudget=Turnover (for a company) or Budget (for a foundation)
TurnoverOrBudget=Turnover (for a company) or Budget (for a foundation)
DefaultAmount=Default amount of subscription
CanEditAmount=Visitor can choose/edit amount of its subscription
MEMBER_NEWFORM_PAYONLINE=Jump on integrated online payment page

View File

@@ -307,7 +307,7 @@ ConnectionTimeout=Timeout de connexion
ResponseTimeout=Timeout de réponse
SmsTestMessage=Message de test de __PHONEFROM__ vers __PHONETO__
ModuleMustBeEnabledFirst=Le module <b>%s</b> doit etre activé pour utiliser cette fonction.
SecurityToken=Jeton de sécurité
SecurityToken=Clé de cryptage des url
# Modules= undefined
Module0Name= Utilisateurs & groupes

View File

@@ -110,7 +110,9 @@ ValidateMember=Valider un adhérent
ConfirmValidateMember=Êtes-vous sûr de vouloir valider cet adhérent ?
FollowingLinksArePublic=Les liens suivants sont des pages accessibles à tous et non protégées par aucune habilitation Dolibarr. Ces pages n'ont aucun formatage et sont fournies à titre d'exemple pour les associations qui veulent des scripts publics de consultation.
PublicMemberList=Liste des membres publics
BlankSubscriptionForm=Formulaire inscription
BlankSubscriptionForm=Formulaire publique d'auto-inscription
BlankSubscriptionFormDesc=Dolibarr peut offrir une URL de page publique pour les visiteurs externes permettant de postuler à une adhésion. Si un un module de paiement en ligne est également actif, un formulaire de paiement sera également automatiquement proposé.
EnablePublicSubscriptionForm=Activer le formulaire publique d'autoinscription
MemberPublicLinks=Liens/pages publiques
ExportDataset_member_1=Adhérents et adhésions
ImportDataset_member_1=Adhérents
@@ -177,11 +179,14 @@ MembersStatisticsDesc=Choisissez les statistiques que vous désirez consulter...
MenuMembersStats=Statistiques
LastMemberDate=Date dernier adhérent
Nature=Nature
Public=Public
Public=Informations publiques (no=privées)
Exports=Exports
NewMemberbyWeb=Nouvel Adherent ajoute. En attente de validation
NewMemberForm=Nouvel Adherent form
SubscriptionsStatistics=Statistiques sur les cotisations
NbOfSubscriptions=Nombre de cotisations
AmountOfSubscriptions=Montant de cotisations
TurnoverOrBudget=Chiffre affaire (pour société) ou Budget (asso ou collectivité)
TurnoverOrBudget=Chiffre affaire (pour société) ou Budget (asso ou collectivité)
DefaultAmount=Montant par défaut de la cotisation
CanEditAmount=Le visiteur peut modifier/choisir le montant de sa cotisation
MEMBER_NEWFORM_PAYONLINE=Débrancher sur la page intégrée de paiement en ligne

View File

@@ -80,7 +80,7 @@ CreditDate=Crédité le
WithdrawalFileNotCapable=Impossible de generer fichier de bon de prelevements pour votre pays
ShowWithdraw=Voir prélèvement
IfInvoiceNeedOnWithdrawPaymentWontBeClosed=Toutefois, si la facture a au moins un paiement par prélèvement non traité, elle ne le sera pas afin de permettre la gestion du prélèvement d'abord.
DoStandingOrdersBeforePayments=Cet onglet permet de faire une demande de pélèvement bancaire. Une fois terminé, vous pourrez saisir le payement sur la facture pour la clore.
DoStandingOrdersBeforePayments=Cet onglet permet de faire une demande de pélèvement bancaire. Une fois réalisé, vous pourrez saisir le paiement sur la facture pour la clore.
### Notifications
InfoCreditSubject=Credit prélèvement %s a la banque

View File

@@ -24,7 +24,7 @@
* \file htdocs/lib/company.lib.php
* \brief Ensemble de fonctions de base pour le module societe
* \ingroup societe
* \version $Id: company.lib.php,v 1.119 2011/06/26 18:53:16 eldy Exp $
* \version $Id: company.lib.php,v 1.120 2011/07/03 18:32:08 eldy Exp $
*/
/**
@@ -210,7 +210,7 @@ function societe_admin_prepare_head($object)
/**
* Return country label, code or id from an id or a code
* @param id Id or code of country
* @param withcode 0=Return label, 1=Return code + label, 2=Return code from id
* @param withcode 0=Return label, 1=Return code + label, 2=Return code from id, 3=Return id from code
* @param dbtouse Database handler (using in global way may fail because of conflicts with some autoload features)
* @param outputlangs Lang object for output translation
* @param entconv 0=Return value without entities and not converted to output charset
@@ -243,6 +243,7 @@ function getCountry($id,$withcode=0,$dbtouse=0,$outputlangs='',$entconv=1)
}
if ($withcode == 1) return $label?"$obj->code - $label":"$obj->code";
else if ($withcode == 2) return $obj->code;
else if ($withcode == 3) return $obj->rowid;
else return $label;
}
else

View File

@@ -29,7 +29,7 @@
* \file htdocs/lib/functions.lib.php
* \brief A set of functions for Dolibarr
* This file contains all frequently used functions.
* \version $Id: functions.lib.php,v 1.533 2011/07/02 16:48:31 eldy Exp $
* \version $Id: functions.lib.php,v 1.534 2011/07/03 18:31:13 eldy Exp $
*/
// For compatibility during upgrade
@@ -1092,10 +1092,12 @@ function dol_print_ip($ip,$mode=0)
{
$datafile=$conf->global->GEOIPMAXMIND_COUNTRY_DATAFILE;
//$ip='24.24.24.24';
//$datafile='E:\Mes Sites\Web\Admin1\awstats\maxmind\GeoIP.dat';
//$datafile='E:\Mes Sites\Web\Admin1\awstats\maxmind\GeoIP.dat'; Note that this must be downloaded datafile (not same than datafile provided with ubuntu packages)
include_once(DOL_DOCUMENT_ROOT.'/lib/dolgeoip.class.php');
$geoip=new DolGeoIP('country',$datafile);
//print 'ip='.$ip.' databaseType='.$geoip->gi->databaseType." GEOIP_CITY_EDITION_REV1=".GEOIP_CITY_EDITION_REV1."\n";
//print "geoip_country_id_by_addr=".geoip_country_id_by_addr($geoip->gi,$ip)."\n";
$countrycode=$geoip->getCountryCodeFromIP($ip);
if ($countrycode) // If success, countrycode is us, fr, ...
{
@@ -1110,6 +1112,31 @@ function dol_print_ip($ip,$mode=0)
return $ret;
}
/**
* Return country code for current user.
* If software is used inside a local network, detection may fails (we need a public ip)
* @return string country code (fr, es, it, us, ...)
*/
function dol_user_country()
{
global $conf,$langs,$user;
//$ret=$user->xxx;
$ret='';
if (! empty($conf->geoipmaxmind->enabled))
{
$ip=$_SERVER["REMOTE_ADDR"];
$datafile=$conf->global->GEOIPMAXMIND_COUNTRY_DATAFILE;
//$ip='24.24.24.24';
//$datafile='E:\Mes Sites\Web\Admin1\awstats\maxmind\GeoIP.dat';
include_once(DOL_DOCUMENT_ROOT.'/lib/dolgeoip.class.php');
$geoip=new DolGeoIP('country',$datafile);
$countrycode=$geoip->getCountryCodeFromIP($ip);
$ret=$countrycode;
}
return $ret;
}
/**
* Format address string
* @param address Address

View File

@@ -20,7 +20,7 @@
/**
* \file htdocs/lib/member.lib.php
* \brief Ensemble de fonctions de base pour les adherents
* \version $Id$
* \version $Id: member.lib.php,v 1.24 2011/07/03 16:00:19 eldy Exp $
*
* Ensemble de fonctions de base de dolibarr sous forme d'include
*/
@@ -116,6 +116,11 @@ function member_admin_prepare_head($object)
$head[$h][2] = 'attributes';
$h++;
$head[$h][0] = DOL_URL_ROOT.'/adherents/admin/public.php';
$head[$h][1] = $langs->trans("BlankSubscriptionForm");
$head[$h][2] = 'public';
$h++;
// Show more tabs from modules
// Entries must be declared in modules descriptor with line
// $this->tabs = array('entity:+tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to add new tab

View File

@@ -26,7 +26,7 @@
* \file htdocs/main.inc.php
* \ingroup core
* \brief File that defines environment for Dolibarr pages only (variables not required by scripts)
* \version $Id: main.inc.php,v 1.747 2011/07/02 05:49:56 hregis Exp $
* \version $Id: main.inc.php,v 1.748 2011/07/03 13:16:46 hregis Exp $
*/
@ini_set('memory_limit', '64M'); // This may be useless if memory is hard limited by your PHP
@@ -908,6 +908,11 @@ function top_htmlhead($head, $title='', $disablejs=0, $disablehead=0, $arrayofjs
print '<link rel="stylesheet" href="'.DOL_URL_ROOT.'/includes/jquery/plugins/tiptip/tipTip.css" type="text/css" />'."\n"; // Tooltip
print '<link rel="stylesheet" href="'.DOL_URL_ROOT.'/includes/jquery/plugins/jnotify/jquery.jnotify-alt.min.css" type="text/css" />'."\n"; // JNotify
//print '<link rel="stylesheet" href="'.DOL_URL_ROOT.'/includes/jquery/plugins/lightbox/css/jquery.lightbox-0.5.css" media="screen" />'."\n"; // Lightbox
// jQuery fileupload
if (! empty($conf->global->MAIN_USE_JQUERY_FILEUPLOAD))
{
print '<link rel="stylesheet" href="'.DOL_URL_ROOT.'/includes/jquery/plugins/fileupload/jquery.fileupload-ui.css" type="text/css" />'."\n";
}
}
print '<!-- Includes for Dolibarr, modules or specific pages-->'."\n";
@@ -977,6 +982,14 @@ function top_htmlhead($head, $title='', $disablejs=0, $disablehead=0, $arrayofjs
print '<script type="text/javascript">var CKEDITOR_BASEPATH = \''.DOL_URL_ROOT.'/includes/ckeditor/\';</script>'."\n";
print '<script type="text/javascript" src="'.DOL_URL_ROOT.'/includes/ckeditor/ckeditor'.$ext.'"></script>'."\n";
}
// File Upload
if (! empty($conf->global->MAIN_USE_JQUERY_FILEUPLOAD))
{
print '<script type="text/javascript" src="'.DOL_URL_ROOT.'/includes/jquery/plugins/fileupload/jquery.tmpl.min.js"></script>'."\n";
print '<script type="text/javascript" src="'.DOL_URL_ROOT.'/includes/jquery/plugins/fileupload/jquery.iframe-transport.js"></script>'."\n";
print '<script type="text/javascript" src="'.DOL_URL_ROOT.'/includes/jquery/plugins/fileupload/jquery.fileupload.js"></script>'."\n";
print '<script type="text/javascript" src="'.DOL_URL_ROOT.'/includes/jquery/plugins/fileupload/jquery.fileupload-ui.js"></script>'."\n";
}
// Global js function
print '<!-- Includes JS of Dolibarr -->'."\n";
print '<script type="text/javascript" src="'.DOL_URL_ROOT.'/lib/lib_head.js"></script>'."\n";

View File

@@ -21,7 +21,7 @@
/** \file htdocs/paypal/admin/paypal.php
* \ingroup paypal
* \brief Page to setup paypal module
* \version $Id$
* \version $Id: paypal.php,v 1.19 2011/07/03 16:55:04 eldy Exp $
*/
require("../../main.inc.php");
@@ -177,7 +177,7 @@ print '</td></tr>';
$var=!$var;
print '<tr '.$bc[$var].'><td>';
print $langs->trans("SecurityToken").'</td><td>';
print '<input size="64" type="text" name="PAYPAL_SECURITY_TOKEN" value="'.$conf->global->PAYPAL_SECURITY_TOKEN.'">';
print '<input size="16" type="text" name="PAYPAL_SECURITY_TOKEN" value="'.$conf->global->PAYPAL_SECURITY_TOKEN.'">';
print '</td></tr>';
$var=!$var;
@@ -262,5 +262,5 @@ print info_admin($langs->trans("YouCanAddTagOnUrl"));
$db->close();
llxFooter('$Date$ - $Revision$');
llxFooter('$Date: 2011/07/03 16:55:04 $ - $Revision: 1.19 $');
?>

View File

@@ -22,7 +22,7 @@
* \file htdocs/public/members/new.php
* \ingroup member
* \brief Example of form to add a new member
* \version $Id: new.php,v 1.29 2011/06/26 21:51:34 eldy Exp $
* \version $Id: new.php,v 1.37 2011/07/03 18:30:48 eldy Exp $
*
* Note that you can add following constant to change behaviour of page
* MEMBER_NEWFORM_AMOUNT Default amount for autosubscribe form
@@ -45,8 +45,12 @@ require_once(DOL_DOCUMENT_ROOT."/core/class/extrafields.class.php");
require_once(DOL_DOCUMENT_ROOT."/core/class/html.formcompany.class.php");
require_once(DOL_DOCUMENT_ROOT."/lib/company.lib.php");
// Security check
if (empty($conf->adherent->enabled)) accessforbidden('',1,1,1);
// Init vars
$errmsg='';
$num=0;
$error=0;
$backtopage=GETPOST('backtopage');
$action=GETPOST('action');
// Load translation files
$langs->load("main");
@@ -55,12 +59,14 @@ $langs->load("companies");
$langs->load("install");
$langs->load("other");
// Init vars
$errmsg='';
$num=0;
$error=0;
$backtopage=GETPOST('backtopage');
$action=GETPOST('action');
// Security check
if (empty($conf->adherent->enabled)) accessforbidden('',1,1,1);
if (empty($conf->global->MEMBER_ENABLE_PUBLIC))
{
print $langs->trans("Auto subscription form for public visitors has no be enabled");
exit;
}
// Function for page HTML header
@@ -104,15 +110,14 @@ function llxFooterVierge()
/*
* Actions
*/
// Action called when submited page
// Action called when page is submited
if ($action == 'add')
{
// test si le login existe deja
// test if login already exists
if (empty($conf->global->ADHERENT_LOGIN_NOT_REQUIRED))
{
if(! GETPOST('login'))
@@ -215,33 +220,38 @@ if ($action == 'add')
$result=$adh->create($user->id);
if ($result > 0)
{
if ($cotisation > 0)
{
$adh->cotisation(dol_mktime(12, 0 , 0, $remonth, $reday, $reyear), $cotisation);
}
// Send email to say it has been created and will be validated soon...
if ($conf->global->ADHERENT_AUTOREGISTER_MAIL && $conf->global->ADHERENT_AUTOREGISTER_MAIL_SUBJECT)
if (! empty($conf->global->ADHERENT_AUTOREGISTER_MAIL) && ! empty($conf->global->ADHERENT_AUTOREGISTER_MAIL_SUBJECT))
{
$result=$adh->send_an_email($conf->global->ADHERENT_AUTOREGISTER_MAIL,$conf->global->ADHERENT_AUTOREGISTER_MAIL_SUBJECT,array(),array(),array(),"","",0,-1);
}
if ($backtopage)
if ($backtopage) $urlback=$backtopage;
else if ($conf->global->MEMBER_URL_REDIRECT_SUBSCRIPTION) $urlback=$conf->global->MEMBER_URL_REDIRECT_SUBSCRIPTION;
else $urlback=$_SERVER["PHP_SELF"]."?action=added";
if (! empty($conf->global->MEMBER_NEWFORM_PAYONLINE))
{
Header("Location: ".$backtopage);
exit;
}
else if ($conf->global->MEMBER_URL_REDIRECT_SUBSCRIPTION)
{
// Si conf->global->MEMBER_URL_REDIRECT_SBUSCRIPTION defini, faire redirect sur page.
Header("Location: ".$conf->global->MEMBER_URL_REDIRECT_SUBSCRIPTION);
exit;
}
else
{
Header("Location: ".$_SERVER["PHP_SELF"]."?action=added");
exit;
if ($conf->global->MEMBER_NEWFORM_PAYONLINE == 'paybox')
{
$urlback=DOL_MAIN_URL_ROOT.'/public/paybox/newpayment.php?source=membersubscription&ref='.$adh->ref;
if (price2num(GETPOST('amount'))) $urlback.='&amount='.price2num(GETPOST('amount'));
}
else if ($conf->global->MEMBER_NEWFORM_PAYONLINE == 'paypal')
{
$urlback=DOL_MAIN_URL_ROOT.'/public/paypal/newpayment.php?source=membersubscription&ref='.$adh->ref;
if (price2num(GETPOST('amount'))) $urlback.='&amount='.price2num(GETPOST('amount'));
}
else
{
dol_print_error('',"Autosubscribe form is setup to ask an online payment for a not managed online payment");
exit;
}
}
dol_syslog("member ".$adh->ref." was created, we redirect to ".$urlback);
Header("Location: ".$urlback);
exit;
}
else
{
@@ -263,7 +273,7 @@ if ($action == 'added')
print $langs->trans("NewMemberbyWeb");
print '</center>';
llxFooterVierge('$Date: 2011/06/26 21:51:34 $ - $Revision: 1.29 $');
llxFooterVierge('$Date: 2011/07/03 18:30:48 $ - $Revision: 1.37 $');
exit;
}
@@ -290,7 +300,7 @@ if (! empty($conf->global->MEMBER_NEWFORM_TEXT)) print $langs->trans($conf->glob
dol_htmloutput_errors($errmsg);
print '<br>'.$langs->trans("FieldsWithAreMandatory",'*').'<br>';
print $langs->trans("FieldsWithIsForPublic",'**').'<br>';
//print $langs->trans("FieldsWithIsForPublic",'**').'<br>';
print '<script type="text/javascript">
jQuery(document).ready(function () {
@@ -326,14 +336,19 @@ print '<table class="border">'."\n";
// Type
if (empty($conf->global->MEMBER_NEWFORM_FORCETYPE))
{
print '<tr><td width="15%">'.$langs->trans("Type").' <FONT COLOR="red">*</FONT> <FONT COLOR="blue">**</FONT></td><td width="35%">';
print $html->selectarray("type", $adht->liste_array(), GETPOST('type'), 1);
$listoftype=$adht->liste_array();
$tmp=array_keys($listoftype);
$defaulttype='';
$isempty=1;
if (sizeof($listoftype)==1) { $defaulttype=$tmp[0]; $isempty=0; }
print '<tr><td width="15%">'.$langs->trans("Type").' <FONT COLOR="red">*</FONT></td><td width="35%">';
print $html->selectarray("type", $adht->liste_array(), GETPOST('type')?GETPOST('type'):$defaulttype, $isempty);
print '</td></tr>'."\n";
}
else
{
$adht->fetch($conf->global->MEMBER_NEWFORM_FORCETYPE);
print $adht->libelle;
//print $adht->libelle;
print '<input type="hidden" id="type" name="type" value="'.$conf->global->MEMBER_NEWFORM_FORCETYPE.'">';
}
// Moral/Physic attribute
@@ -341,7 +356,7 @@ $morphys["phy"] = $langs->trans("Physical");
$morphys["mor"] = $langs->trans("Moral");
if (empty($conf->global->MEMBER_NEWFORM_FORCEMORPHY))
{
print '<tr><td>'.$langs->trans("MorPhy").' <FONT COLOR="red">*</FONT> <FONT COLOR="blue">**</FONT> </td><td>'."\n";
print '<tr><td>'.$langs->trans("MorPhy").' <FONT COLOR="red">*</FONT></td><td>'."\n";
print $html->selectarray("morphy", $morphys, GETPOST('morphy'), 1);
print '</td></tr>'."\n";
}
@@ -354,11 +369,11 @@ else
print '<tr><td>'.$langs->trans("Civility").'</td><td>';
print $formcompany->select_civilite(GETPOST('civilite_id'),'civilite_id').'</td></tr>'."\n";
// Lastname
print '<tr><td>'.$langs->trans("Lastname").' <FONT COLOR="red">*</FONT> <FONT COLOR="blue">**</FONT></td><td><input type="text" name="nom" size="40" value="'.dol_escape_htmltag(GETPOST('nom')).'"></td></tr>'."\n";
print '<tr><td>'.$langs->trans("Lastname").' <FONT COLOR="red">*</FONT></td><td><input type="text" name="nom" size="40" value="'.dol_escape_htmltag(GETPOST('nom')).'"></td></tr>'."\n";
// Firstname
print '<tr><td>'.$langs->trans("Firstname").' <FONT COLOR="red">*</FONT> <FONT COLOR="blue">**</FONT></td><td><input type="text" name="prenom" size="40" value="'.dol_escape_htmltag(GETPOST('prenom')).'"></td></tr>'."\n";
print '<tr><td>'.$langs->trans("Firstname").' <FONT COLOR="red">*</FONT></td><td><input type="text" name="prenom" size="40" value="'.dol_escape_htmltag(GETPOST('prenom')).'"></td></tr>'."\n";
// Company
print '<tr id="trcompany"><td>'.$langs->trans("Company").'</td><td><input type="text" name="societe" size="40" value="'.dol_escape_htmltag(GETPOST('societe')).'"></td></tr>'."\n";
print '<tr id="trcompany" class="trcompany"><td>'.$langs->trans("Company").'</td><td><input type="text" name="societe" size="40" value="'.dol_escape_htmltag(GETPOST('societe')).'"></td></tr>'."\n";
// Address
print '<tr><td>'.$langs->trans("Address").'</td><td>'."\n";
print '<textarea name="address" id="address" wrap="soft" cols="40" rows="'.ROWS_3.'">'.dol_escape_htmltag(GETPOST('address')).'</textarea></td></tr>'."\n";
@@ -371,8 +386,18 @@ print '</td></tr>';
// Country
print '<tr><td width="25%">'.$langs->trans('Country').'</td><td>';
$pays_id=GETPOST('pays_id');
if (! GETPOST('pays_id') && ! empty($conf->global->MEMBER_NEWFORM_FORCECOUNTRYCODE)) $pays_id=getCountry($conf->global->MEMBER_NEWFORM_FORCECOUNTRYCODE,2,$db,$langs);
if (! GETPOST('pays_id') && ! empty($conf->geoip->enabled)) $pays_id=$pays_id; // TODO
if (! $pays_id && ! empty($conf->global->MEMBER_NEWFORM_FORCECOUNTRYCODE)) $pays_id=getCountry($conf->global->MEMBER_NEWFORM_FORCECOUNTRYCODE,2,$db,$langs);
if (! $pays_id && ! empty($conf->geoipmaxmind->enabled))
{
$pays_code=dol_user_country();
//print $pays_code;
if ($pays_code)
{
$new_pays_id=getCountry($pays_code,3,$db,$langs);
//print 'xxx'.$pays_code.' - '.$new_pays_id;
if ($new_pays_id) $pays_id=$new_pays_id;
}
}
$pays_code=getCountry($pays_id,2,$db,$langs);
print $html->select_country($pays_id,'pays_id');
print '</td></tr>';
@@ -380,12 +405,12 @@ print '</td></tr>';
if (empty($conf->global->SOCIETE_DISABLE_STATE))
{
print '<tr><td>'.$langs->trans('State').'</td><td>';
if ($pays_id) print $formcompany->select_state(GETPOST("departement_id"),$pays_code);
if ($pays_code) print $formcompany->select_state(GETPOST("departement_id"),$pays_code);
else print '';
print '</td></tr>';
}
// EMail
print '<tr><td>'.$langs->trans("Email").' <FONT COLOR="red">*</FONT> <FONT COLOR="blue">**</FONT></td><td><input type="text" name="email" size="40" value="'.dol_escape_htmltag(GETPOST('email')).'"></td></tr>'."\n";
print '<tr><td>'.$langs->trans("Email").' <FONT COLOR="red">*</FONT></td><td><input type="text" name="email" size="40" value="'.dol_escape_htmltag(GETPOST('email')).'"></td></tr>'."\n";
// Login
if (empty($conf->global->ADHERENT_LOGIN_NOT_REQUIRED))
{
@@ -398,9 +423,9 @@ print '<tr><td>'.$langs->trans("Birthday").'</td><td>';
print $html->select_date($birthday,'birth',0,0,1,"newmember");
print '</td></tr>'."\n";
// Photo
print '<tr><td>'.$langs->trans("URLPhoto").' <FONT COLOR="blue">**</FONT></td><td><input type="text" name="photo" size="40" value="'.dol_escape_htmltag(GETPOST('photo')).'"></td></tr>'."\n";
print '<tr><td>'.$langs->trans("URLPhoto").'</td><td><input type="text" name="photo" size="40" value="'.dol_escape_htmltag(GETPOST('photo')).'"></td></tr>'."\n";
// Public
print '<tr><td>'.$langs->trans("Public").' ?</td><td><input type="checkbox" name="public" value="1" checked></td></tr>'."\n";
print '<tr><td>'.$langs->trans("Public").'</td><td><input type="checkbox" name="public" value="1" checked></td></tr>'."\n";
// Extrafields
foreach($extrafields->attribute_label as $key=>$value)
{
@@ -418,7 +443,7 @@ print '</tr>'."\n";
if (! empty($conf->global->MEMBER_NEWFORM_DOLIBARRTURNOVER))
{
$arraybudget=array('50'=>'<= 100 000','100'=>'<= 200 000','200'=>'<= 500 000','400'=>'<= 1 500 000','750'=>'<= 3 000 000','1500'=>'<= 5 000 000','2000'=>'5 000 000+');
print '<tr id="trbudget"><td>'.$langs->trans("TurnoverOrBudget").'</td><td>';
print '<tr id="trbudget" class="trcompany"><td>'.$langs->trans("TurnoverOrBudget").'</td><td>';
print $html->select_array('budget', $arraybudget, GETPOST('budget'), 1);
print ' € or $';
@@ -429,19 +454,27 @@ if (! empty($conf->global->MEMBER_NEWFORM_DOLIBARRTURNOVER))
initturnover();
});
jQuery("#budget").change(function() {
if (jQuery("#budget").val() > 0) { jQuery("#amount").val(jQuery("#budget").val()); }
if (jQuery("#budget").val() > 0) { jQuery(".amount").val(jQuery("#budget").val()); }
else { jQuery("#budget").val(\'\'); }
});
jQuery("#type").change(function() {
if (jQuery("#type").val()==1) { jQuery("#morphy").val(\'mor\'); }
if (jQuery("#type").val()==2) { jQuery("#morphy").val(\'phy\'); }
if (jQuery("#type").val()==3) { jQuery("#morphy").val(\'mor\'); }
if (jQuery("#type").val()==4) { jQuery("#morphy").val(\'mor\'); }
initturnover();
});
function initturnover() {
if (jQuery("#morphy").val()==\'phy\') {
jQuery("#amount").val(20);
jQuery(".amount").val(20);
jQuery("#trbudget").hide();
jQuery("#trcompany").hide();
}
if (jQuery("#morphy").val()==\'mor\') {
jQuery(".amount").val(\'\');
jQuery("#trbudget").show();
jQuery("#trcompany").show();
if (jQuery("#budget").val() > 0) { jQuery("#amount").val(jQuery("#budget").val()); }
if (jQuery("#budget").val() > 0) { jQuery(".amount").val(jQuery("#budget").val()); }
else { jQuery("#budget").val(\'\'); }
}
}
@@ -459,21 +492,18 @@ if (! empty($conf->global->MEMBER_NEWFORM_AMOUNT)
$amount=GETPOST('amount')?GETPOST('amount'):$conf->global->MEMBER_NEWFORM_AMOUNT;
}
// $conf->global->MEMBER_NEWFORM_PAYONLINE is 'paypal' or 'paybox'
print '<tr><td>'.$langs->trans("Subscription").'</td><td nowrap="nowrap">';
if (! empty($conf->global->MEMBER_NEWFORM_EDITAMOUNT))
{
print '<tr><td>'.$langs->trans("Subscription").'</td><td>';
print '<input type="text" name="amount" id="amount" class="flat" size="6" value="'.$amount.'">';
print ' € or $';
print '</td></tr>';
print '<input type="text" name="amount" id="amount" class="flat amount" size="6" value="'.$amount.'">';
}
else
{
print '<tr><td>'.$langs->trans("Subscription").'</td><td>';
print $amount;
print '<input type="hidden" name="amount" id="amount" class="flat" size="6" value="'.$amount.'">';
print ' € or $';
print '</td></tr>';
print '<input type="text" name="amount" id="amounthidden" class="flat amount" disabled="disabled" size="6" value="'.$amount.'">';
print '<input type="hidden" name="amount" id="amount" class="flat amount" size="6" value="'.$amount.'">';
}
print ' '.$langs->trans("Currency".$conf->monnaie);
print '</td></tr>';
}
print "</table>\n";
@@ -490,5 +520,5 @@ print "<br></form>\n";
$db->close();
llxFooterVierge('$Date: 2011/06/26 21:51:34 $ - $Revision: 1.29 $');
llxFooterVierge('$Date: 2011/07/03 18:30:48 $ - $Revision: 1.37 $');
?>

View File

@@ -27,7 +27,7 @@
* \file htdocs/societe/class/societe.class.php
* \ingroup societe
* \brief File for third party class
* \version $Id$
* \version $Id: societe.class.php,v 1.88 2011/07/03 22:07:24 eldy Exp $
*/
require_once(DOL_DOCUMENT_ROOT."/core/class/commonobject.class.php");
@@ -63,6 +63,8 @@ class Societe extends CommonObject
var $pays_id;
var $pays_code;
var $pays; // TODO obsolete
var $country_id;
var $country_code;
var $country;
var $tel;

View File

@@ -23,7 +23,7 @@
* \file htdocs/societe/document.php
* \brief Tab for documents linked to third party
* \ingroup societe
* \version $Id$
* \version $Id: document.php,v 1.31 2011/07/03 13:16:46 hregis Exp $
*/
require("../main.inc.php");
@@ -38,7 +38,7 @@ $langs->load('other');
$mesg = "";
// Security check
$socid = isset($_GET["socid"])?$_GET["socid"]:(! empty($_GET["id"])?$_GET["id"]:'');
$socid = (GETPOST('socid') ? GETPOST('socid') : GETPOST('id'));
if ($user->societe_id > 0)
{
unset($_GET["action"]);
@@ -61,6 +61,7 @@ if (! $sortfield) $sortfield="name";
$upload_dir = $conf->societe->dir_output . "/" . $socid ;
$courrier_dir = $conf->societe->dir_output . "/courrier/" . get_exdir($socid) ;
$object = new Societe($db);
/*
* Actions
@@ -125,14 +126,13 @@ llxHeader('',$langs->trans("ThirdParty").' - '.$langs->trans("Files"),$help_url)
if ($socid > 0)
{
$societe = new Societe($db);
if ($societe->fetch($socid))
if ($object->fetch($socid))
{
/*
* Affichage onglets
*/
if ($conf->notification->enabled) $langs->load("mails");
$head = societe_prepare_head($societe);
$head = societe_prepare_head($object);
$html=new Form($db);
@@ -153,30 +153,30 @@ if ($socid > 0)
// Ref
print '<tr><td width="30%">'.$langs->trans("ThirdPartyName").'</td>';
print '<td colspan="3">';
print $form->showrefnav($societe,'socid','',($user->societe_id?0:1),'rowid','nom');
print $form->showrefnav($object,'socid','',($user->societe_id?0:1),'rowid','nom');
print '</td></tr>';
// Prefix
if (! empty($conf->global->SOCIETE_USEPREFIX)) // Old not used prefix field
{
print '<tr><td>'.$langs->trans('Prefix').'</td><td colspan="3">'.$societe->prefix_comm.'</td></tr>';
print '<tr><td>'.$langs->trans('Prefix').'</td><td colspan="3">'.$object->prefix_comm.'</td></tr>';
}
if ($societe->client)
if ($object->client)
{
print '<tr><td>';
print $langs->trans('CustomerCode').'</td><td colspan="3">';
print $societe->code_client;
if ($societe->check_codeclient() <> 0) print ' <font class="error">('.$langs->trans("WrongCustomerCode").')</font>';
print $object->code_client;
if ($object->check_codeclient() <> 0) print ' <font class="error">('.$langs->trans("WrongCustomerCode").')</font>';
print '</td></tr>';
}
if ($societe->fournisseur)
if ($object->fournisseur)
{
print '<tr><td>';
print $langs->trans('SupplierCode').'</td><td colspan="3">';
print $societe->code_fournisseur;
if ($societe->check_codefournisseur() <> 0) print ' <font class="error">('.$langs->trans("WrongSupplierCode").')</font>';
print $object->code_fournisseur;
if ($object->check_codefournisseur() <> 0) print ' <font class="error">('.$langs->trans("WrongSupplierCode").')</font>';
print '</td></tr>';
}
@@ -190,7 +190,7 @@ if ($socid > 0)
print '</div>';
if ($mesg) { print "$mesg<br>"; }
dol_htmloutput_mesg($mesg,$mesgs);
/*
* Confirmation suppression fichier
@@ -200,17 +200,23 @@ if ($socid > 0)
$ret=$html->form_confirm($_SERVER["PHP_SELF"].'?socid='.$_GET["id"].'&urlfile='.urldecode($_GET["urlfile"]), $langs->trans('DeleteFile'), $langs->trans('ConfirmDeleteFile'), 'confirm_deletefile', '', 0, 1);
if ($ret == 'html') print '<br>';
}
// Affiche formulaire upload
$formfile=new FormFile($db);
$formfile->form_attach_new_file($_SERVER["PHP_SELF"].'?socid='.$socid,'',0,0,$user->rights->societe->creer);
// List of document
$param='&socid='.$societe->id;
$formfile->list_of_documents($filearray,$societe,'societe',$param);
if ($conf->global->MAIN_USE_JQUERY_FILEUPLOAD)
{
$formfile->form_ajaxfileupload($object);
}
else
{
// Affiche formulaire upload
$formfile->form_attach_new_file($_SERVER["PHP_SELF"].'?socid='.$socid,'',0,0,$user->rights->societe->creer);
// List of document
$param='&socid='.$object->id;
$formfile->list_of_documents($filearray,$object,'societe',$param);
}
print "<br><br>";
@@ -268,12 +274,12 @@ if ($socid > 0)
}
else
{
dol_print_error();
accessforbidden('',0,0);
}
$db->close();
llxFooter('$Date$ - $Revision$');
llxFooter('$Date: 2011/07/03 13:16:46 $ - $Revision: 1.31 $');
?>