diff --git a/ChangeLog b/ChangeLog index ae46b071d03..46635c71dbf 100644 --- a/ChangeLog +++ b/ChangeLog @@ -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. diff --git a/build/makepack-howto.txt b/build/makepack-howto.txt index c44b6e98a2d..5d7afe36847 100644 --- a/build/makepack-howto.txt +++ b/build/makepack-howto.txt @@ -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 diff --git a/htdocs/adherents/admin/public.php b/htdocs/adherents/admin/public.php new file mode 100755 index 00000000000..6fcf9e8293b --- /dev/null +++ b/htdocs/adherents/admin/public.php @@ -0,0 +1,188 @@ + + * Copyright (C) 2006-2010 Laurent Destailleur + * + * 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érents|ES:Módulo_Miembros'; + +llxHeader('',$langs->trans("MembersSetup"),$help_url); + + +$linkback=''.$langs->trans("BackToModuleList").''; +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".''."\n"; +} + + +print $langs->trans("BlankSubscriptionFormDesc").'

'; + +print '
'; +print ''; + +print ''; + +print ''; +print ''; +print ''; +print "\n"; +$var=true; + +// Allow public form +$var=! $var; +print ''; +print '\n"; +print ''; + +// Type +/*$var=! $var; +print ''; +print '\n"; */ + +// Amount +$var=! $var; +print ''; +print '\n"; + +// Can edit +$var=! $var; +print ''; +print '\n"; + +if ($conf->paybox->enabled || $conf->paypal->enabled) +{ + // Jump to an online payment page + $var=! $var; + print '\n"; +} + +print '
'.$langs->trans("Parameter").''.$langs->trans("Value").'
'; +print $langs->trans("EnablePublicSubscriptionForm"); +print ''; +print $form->selectyesno("MEMBER_ENABLE_PUBLIC",$conf->global->MEMBER_ENABLE_PUBLIC,1); +print "
'; +print $langs->trans("EnablePublicSubscriptionForm"); +print ''; +print $form->selectyesno("forcedate",$conf->global->MEMBER_NEWFORM_FORCETYPE,1); +print "
'; +print $langs->trans("DefaultAmount"); +print ''; +print '';; +print "
'; +print $langs->trans("CanEditAmount"); +print ''; +print $form->selectyesno("MEMBER_NEWFORM_EDITAMOUNT",$conf->global->MEMBER_NEWFORM_EDITAMOUNT,1); +print "
'; + print $langs->trans("MEMBER_NEWFORM_PAYONLINE"); + print ''; + $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 "
'; + +print '
'; +print ''; +print '
'; + +print ''; + +dol_fiche_end(); + + +print '
'; +//print $langs->trans('FollowingLinksArePublic').'
'; +print img_picto('','object_globe.png').' '.$langs->trans('BlankSubscriptionForm').':
'; +print ''.DOL_MAIN_URL_ROOT.'/public/members/new.php'.''; + +/* +print ''; +print ''; +print ''; +print ''; +print ''; +print '
'.$langs->trans("Description").''.$langs->trans("URL").'
'.$langs->trans("BlankSubscriptionForm").''..'
'.$langs->trans("PublicMemberList").''.img_picto('','object_globe.png').' '.''.DOL_MAIN_URL_ROOT.'/public/members/public_list.php'.'
'.$langs->trans("PublicMemberCard").''.img_picto('','object_globe.png').' '.DOL_MAIN_URL_ROOT.'/public/members/public_card.php?id=xxx'.'
'; +*/ + +$db->close(); + +llxFooter('$Date: 2011/07/03 16:00:19 $ - $Revision: 1.1 $'); +?> diff --git a/htdocs/adherents/class/adherent.class.php b/htdocs/adherents/class/adherent.class.php index a92d3ca7d5a..90f05b864f2 100644 --- a/htdocs/adherents/class/adherent.class.php +++ b/htdocs/adherents/class/adherent.class.php @@ -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 diff --git a/htdocs/adherents/public.php b/htdocs/adherents/public.php deleted file mode 100644 index 46d18c37c23..00000000000 --- a/htdocs/adherents/public.php +++ /dev/null @@ -1,62 +0,0 @@ - - * Copyright (C) 2006-2010 Laurent Destailleur - * - * 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 ''; - -print '
'; - -print $langs->trans('FollowingLinksArePublic').'
'; -print '
'; - -print ''; -print ''; -print ''; -print ''; -print ''; -print '
'.$langs->trans("Description").''.$langs->trans("URL").'
'.$langs->trans("BlankSubscriptionForm").''.img_picto('','object_globe.png').' '.''.DOL_MAIN_URL_ROOT.'/public/members/new.php'.'
'.$langs->trans("PublicMemberList").''.img_picto('','object_globe.png').' '.''.DOL_MAIN_URL_ROOT.'/public/members/public_list.php'.'
'.$langs->trans("PublicMemberCard").''.img_picto('','object_globe.png').' '.DOL_MAIN_URL_ROOT.'/public/members/public_card.php?id=xxx'.'
'; - - -print '
'; - - -$db->close(); - -llxFooter('$Date$ - $Revision$'); -?> diff --git a/htdocs/core/ajaxfileupload.php b/htdocs/core/ajaxfileupload.php new file mode 100644 index 00000000000..f7be35cc5d8 --- /dev/null +++ b/htdocs/core/ajaxfileupload.php @@ -0,0 +1,349 @@ +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'); +} +?> \ No newline at end of file diff --git a/htdocs/core/class/commondocgenerator.class.php b/htdocs/core/class/commondocgenerator.class.php index 10c59afda47..3ee0aa6fc50 100755 --- a/htdocs/core/class/commondocgenerator.class.php +++ b/htdocs/core/class/commondocgenerator.class.php @@ -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, diff --git a/htdocs/core/class/html.formfile.class.php b/htdocs/core/class/html.formfile.class.php index 7c054b43622..7f0dc0a7fda 100644 --- a/htdocs/core/class/html.formfile.class.php +++ b/htdocs/core/class/html.formfile.class.php @@ -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 ''; + + print '
'; + print '
'; + print ''; + print ''; + print '
'; + print ''; + print ''; + print ''; + print ''; + print '
'; + print '
'; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print '
'.$langs->trans("Documents2").''.$langs->trans("Preview").''.$langs->trans("Size").'
'; + print '
'; + print '
'; + print '
'; + + // Include template + include(DOL_DOCUMENT_ROOT.'/core/tpl/ajaxfileupload.tpl.php'); + + } } diff --git a/htdocs/core/tpl/ajaxfileupload.tpl.php b/htdocs/core/tpl/ajaxfileupload.tpl.php new file mode 100644 index 00000000000..222f83a7878 --- /dev/null +++ b/htdocs/core/tpl/ajaxfileupload.tpl.php @@ -0,0 +1,86 @@ + + * + * 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 $ + */ +?> + + + + + + \ No newline at end of file diff --git a/htdocs/includes/boxes/box_actions.php b/htdocs/includes/boxes/box_actions.php index 9d7686a0ff9..c09d95ecf16 100644 --- a/htdocs/includes/boxes/box_actions.php +++ b/htdocs/includes/boxes/box_actions.php @@ -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; diff --git a/htdocs/includes/menus/init_menu_auguria.sql b/htdocs/includes/menus/init_menu_auguria.sql index dec3ccbf2b7..f9b90c48d5f 100644 --- a/htdocs/includes/menus/init_menu_auguria.sql +++ b/htdocs/includes/menus/init_menu_auguria.sql @@ -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&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&mainmenu=members&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&mainmenu=members', 'List', 1, 'members', '$user->rights->adherent->configurer', '', 2, 1, __ENTITY__); diff --git a/htdocs/includes/menus/init_menu_smartphone.sql b/htdocs/includes/menus/init_menu_smartphone.sql index 8cf20414457..030c471d50b 100755 --- a/htdocs/includes/menus/init_menu_smartphone.sql +++ b/htdocs/includes/menus/init_menu_smartphone.sql @@ -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&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__); diff --git a/htdocs/includes/menus/standard/eldy.lib.php b/htdocs/includes/menus/standard/eldy.lib.php index 79a43e43887..3cf07c4dc17 100644 --- a/htdocs/includes/menus/standard/eldy.lib.php +++ b/htdocs/includes/menus/standard/eldy.lib.php @@ -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&mainmenu=members",$langs->trans("MembersTypes"),0,$user->rights->adherent->configurer); $newmenu->add("/adherents/type.php?leftmenu=setup&mainmenu=members&action=create",$langs->trans("New"),1,$user->rights->adherent->configurer); diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index 47f4ec5df96..2058244178c 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -306,7 +306,7 @@ ConnectionTimeout=Connexion timeout ResponseTimeout=Response timeout SmsTestMessage=Test message from __PHONEFROM__ to __PHONETO__ ModuleMustBeEnabledFirst=Module %s must be enabled first before using this feature. -SecurityToken=Security token +SecurityToken=Key to encrypt urls # Modules Module0Name=Users & groups diff --git a/htdocs/langs/en_US/members.lang b/htdocs/langs/en_US/members.lang index ada92b09834..ee492c181b6 100644 --- a/htdocs/langs/en_US/members.lang +++ b/htdocs/langs/en_US/members.lang @@ -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) \ No newline at end of file +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 \ No newline at end of file diff --git a/htdocs/langs/fr_FR/admin.lang b/htdocs/langs/fr_FR/admin.lang index 933c1c78700..d03c568bef9 100644 --- a/htdocs/langs/fr_FR/admin.lang +++ b/htdocs/langs/fr_FR/admin.lang @@ -307,7 +307,7 @@ ConnectionTimeout=Timeout de connexion ResponseTimeout=Timeout de réponse SmsTestMessage=Message de test de __PHONEFROM__ vers __PHONETO__ ModuleMustBeEnabledFirst=Le module %s doit etre activé pour utiliser cette fonction. -SecurityToken=Jeton de sécurité +SecurityToken=Clé de cryptage des url # Modules= undefined Module0Name= Utilisateurs & groupes diff --git a/htdocs/langs/fr_FR/members.lang b/htdocs/langs/fr_FR/members.lang index 82a83d39d36..d4a3030cd43 100644 --- a/htdocs/langs/fr_FR/members.lang +++ b/htdocs/langs/fr_FR/members.lang @@ -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é) \ No newline at end of file +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 \ No newline at end of file diff --git a/htdocs/langs/fr_FR/withdrawals.lang b/htdocs/langs/fr_FR/withdrawals.lang index a346376dd42..b66f2bca344 100755 --- a/htdocs/langs/fr_FR/withdrawals.lang +++ b/htdocs/langs/fr_FR/withdrawals.lang @@ -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 diff --git a/htdocs/lib/company.lib.php b/htdocs/lib/company.lib.php index 2f7ef32b660..fd74cf79c4b 100644 --- a/htdocs/lib/company.lib.php +++ b/htdocs/lib/company.lib.php @@ -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 diff --git a/htdocs/lib/functions.lib.php b/htdocs/lib/functions.lib.php index 71561d53c57..69b57e0336f 100644 --- a/htdocs/lib/functions.lib.php +++ b/htdocs/lib/functions.lib.php @@ -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 diff --git a/htdocs/lib/member.lib.php b/htdocs/lib/member.lib.php index 96444256918..74257f9e4e0 100644 --- a/htdocs/lib/member.lib.php +++ b/htdocs/lib/member.lib.php @@ -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 diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index 8fbf3a01061..7054204a43f 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -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 ''."\n"; // Tooltip print ''."\n"; // JNotify //print ''."\n"; // Lightbox + // jQuery fileupload + if (! empty($conf->global->MAIN_USE_JQUERY_FILEUPLOAD)) + { + print ''."\n"; + } } print ''."\n"; @@ -977,6 +982,14 @@ function top_htmlhead($head, $title='', $disablejs=0, $disablehead=0, $arrayofjs print ''."\n"; print ''."\n"; } + // File Upload + if (! empty($conf->global->MAIN_USE_JQUERY_FILEUPLOAD)) + { + print ''."\n"; + print ''."\n"; + print ''."\n"; + print ''."\n"; + } // Global js function print ''."\n"; print ''."\n"; diff --git a/htdocs/paypal/admin/paypal.php b/htdocs/paypal/admin/paypal.php index e696c67d8e7..45eeda8b394 100644 --- a/htdocs/paypal/admin/paypal.php +++ b/htdocs/paypal/admin/paypal.php @@ -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 ''; $var=!$var; print ''; print $langs->trans("SecurityToken").''; -print ''; +print ''; print ''; $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 $'); ?> diff --git a/htdocs/public/members/new.php b/htdocs/public/members/new.php index 51deb9696f1..a7ca9ed3cb0 100644 --- a/htdocs/public/members/new.php +++ b/htdocs/public/members/new.php @@ -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 ''; - 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 '
'.$langs->trans("FieldsWithAreMandatory",'*').'
'; -print $langs->trans("FieldsWithIsForPublic",'**').'
'; +//print $langs->trans("FieldsWithIsForPublic",'**').'
'; print '