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

This commit is contained in:
Laurent Destailleur 2012-10-04 15:43:28 +02:00
commit 5c6b0c064e
138 changed files with 10306 additions and 7013 deletions

View File

@ -49,9 +49,10 @@ For users:
- New: Add a selection module for emailing to enter a recipient from gui.
- New: Allow to search thirds and products from barcodes directly from the permanent mini search left box.
- New: Allow to search product from barcodes directly from invoices, proposals... through AJAX.
- New: Can make one invoice for several orders.
- New: POS module can works with only one payment method (cach, chq, credit card).
New experimental modules:
- New: Add margin and commissions management module.
- New: Add holiday module.
- Fix: [ bug #499 ]: Supplier order input method not translated
- Fix: No images into product description lines as PDF generation does

View File

@ -21,7 +21,7 @@
<parallel>
<!-- <antcall target="phpmd"/> -->
<antcall target="phpcpd"/>
<antcall target="phpcs"/>
<!-- <antcall target="phpcs"/> -->
<antcall target="doxygen"/>
<antcall target="phploc"/>
</parallel>
@ -72,8 +72,8 @@
<exec executable="phpcs" dir="${basedir}">
<arg line=" --standard=${basedir}/dev/codesniffer/jenkins_ruleset.xml
--report=checkstyle
--report-file=${basedir}/hudson/logs/checkstyle.xml
--ignore=${ignorepaths},${ignoreregexp}
--report-file=${basedir}/hudson/logs/checkstyle.xml
htdocs
"/>
</exec>
@ -98,5 +98,5 @@
</exec>
</target>
<target name="hudson" depends="clean,phpunit,parallelTasks"/>
<target name="hudson" depends="clean,phpunit,phpcs,parallelTasks"/>
</project>

View File

@ -180,11 +180,17 @@ case "$1" in
# Now run the drop user
if eval $mysqlcmd -f -e "\"DROP USER '$dbuser'@'localhost';\"" ; then
echo postrm Database login $dbuser removed
echo postrm Database login $dbuser@localhost removed
else
error="Unable to run $mysqlcmd -f -e \"DROP USER '$dbuser'@'localhost';\""
echo postrm $error
fi
if eval $mysqlcmd -f -e "\"DROP USER '$dbuser'@'%';\"" ; then
echo postrm Database login $dbuser@% removed
else
error="Unable to run $mysqlcmd -f -e \"DROP USER '$dbuser'@'%';\""
echo postrm $error
fi
# Now run the drop commands
if eval $mysqlcmd -f -e "\"show databases;\"" | grep -e "^$dbname" > /dev/null 2>&1 ; then

View File

@ -2,15 +2,6 @@
<!DOCTYPE ruleset SYSTEM "ruleset.dtd">
<ruleset name="Dolibarr">
<description>Dolibarr coding standard.</description>
<exclude-pattern>*/conf/*</exclude-pattern>
<exclude-pattern>*/filemanagerdol/*</exclude-pattern>
<exclude-pattern>*/includes/ckeditor/*</exclude-pattern>
<exclude-pattern>*/PEAR/*</exclude-pattern>
<exclude-pattern>*/NET/*</exclude-pattern>
<exclude-pattern>*/HTTP/*</exclude-pattern>
<exclude-pattern>*/zendgdata/*</exclude-pattern>
<exclude-pattern>*/reportico/*</exclude-pattern>
<!-- List of all tests -->

View File

@ -1,4 +1,4 @@
#!/bin/bash
#!/bin/sh
#------------------------------------------------------
# Script to purge and init a database with demo values.
# Note: "dialog" tool need to be available.
@ -11,13 +11,14 @@
#------------------------------------------------------
export dumpfile=`ls mysqldump_dolibarr_*.sql | sort | tail -n 1`
export mydir=`echo "$0" | sed -e 's/initdemo.sh//'`;
if [ "x$mydir" = "x" ]
then
export mydir="."
fi
export id=`id -u`;
export dumpfile=`ls $mydir/mysqldump_dolibarr_*.sql | sort | tail -n 1`
export dumpfile=`basename $dumpfile`
# ----------------------------- check if root
@ -151,7 +152,7 @@ then
fi
#echo "mysql -P$port -u$admin $passwd $base < $mydir/$dumpfile"
#mysql -P$port -u$admin $passwd $base < $mydir/$dumpfile
echo "mysql -P$port -u$admin ***** $base < $mydir/$dumpfile"
echo "mysql -P$port -u$admin -p***** $base < $mydir/$dumpfile"
mysql -P$port -u$admin $passwd $base < $mydir/$dumpfile
echo "Dolibarr data demo has been loaded."

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

24
dev/initdata/removedemo.sh Normal file → Executable file
View File

@ -3,13 +3,29 @@
# Script to remove setup of a Dolibarr installation.
# Note: "dialog" tool need to be available.
#
# Regis Houssin - regis@dolibarr.fr
# Regis Houssin - regis@dolibarr.fr
# Laurent Destailleur - eldy@users.sourceforge.net
#------------------------------------------------------
# WARNING: This script erase all data of database
# WARNING: This script erase setup of instance,
# but not the database
#------------------------------------------------------
export mydir=`echo "$_" | sed -e 's/removedemo.sh//'`;
export mydir=`echo "$0" | sed -e 's/removedemo.sh//'`;
if [ "x$mydir" = "x" ]
then
export mydir="./"
fi
export id=`id -u`;
# ----------------------------- check if root
if [ "x$id" != "x0" -a "x$id" != "x1001" ]
then
echo "Script must be ran as root"
exit
fi
DIALOG=${DIALOG=dialog}
DIALOG="$DIALOG --ascii-lines"
@ -34,5 +50,5 @@ rm $mydir../../htdocs/conf/conf.php 2>/dev/null
echo "Remove file $mydir../../install.lock"
rm $mydir../../install.lock 2>/dev/null
echo "Dolibarr demo has been removed (need to be installed again)."
echo "Dolibarr setup has been removed (need to be installed again. database not dropped)."
echo

View File

@ -0,0 +1,435 @@
<?php
/* Copyright (C) 2010-2012 Regis Houssin <regis@dolibarr.fr>
* Copyright (C) 2012 Philippe Grand <philippe.grand@atoo-net.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* 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, see <http://www.gnu.org/licenses/>.
*/
/**
* \file htdocs/contact/canvas/actions_adherentcard_common.class.php
* \ingroup thirdparty
* \brief Fichier de la classe Adherent card controller (common)
*/
/**
* \class ActionsAdherentCardCommon
* \brief Classe permettant la gestion des adherents par defaut
*/
abstract class ActionsAdherentCardCommon
{
var $db;
var $dirmodule;
var $targetmodule;
var $canvas;
var $card;
//! Template container
var $tpl = array();
//! Object container
var $object;
//! Error string
var $error;
//! Error array
var $errors=array();
/**
* Instantiation of DAO class
*
* @return void
*/
private function getInstanceDao()
{
if (! is_object($this->object))
{
$modelclassfile = dol_buildpath('/'.$this->dirmodule.'/canvas/'.$this->canvas.'/dao_'.$this->targetmodule.'_'.$this->canvas.'.class.php');
if (file_exists($modelclassfile))
{
// Include dataservice class (model)
$ret = require_once $modelclassfile;
if ($ret)
{
// Instantiate dataservice class (model)
$modelclassname = 'Dao'.ucfirst($this->targetmodule).ucfirst($this->canvas);
$this->object = new $modelclassname($this->db);
}
}
}
}
/**
* Get object
*
* @param int $id Object id
* @return object Object loaded
*/
function getObject($id)
{
$ret = $this->getInstanceDao();
if (is_object($this->object) && method_exists($this->object,'fetch'))
{
if (! empty($id)) $this->object->fetch($id);
}
else
{
$object = new Adherent($this->db);
if (! empty($id)) $object->fetch($id);
$this->object = $object;
}
}
/**
* Load data control
*
* @param string &$action Type of action
* @param int $id Id of object
* @return void
*/
function doActions(&$action, $id)
{
global $conf, $user, $langs;
// Creation utilisateur depuis Adherent
if ($action == 'confirm_create_user' && GETPOST("confirm") == 'yes')
{
// Recuperation adherent actuel
$result = $this->object->fetch($id);
if ($result > 0)
{
$this->db->begin();
// Creation user
$nuser = new User($this->db);
$result=$nuser->create_from_member($this->object,$_POST["login"]);
if ($result > 0)
{
$result2=$nuser->setPassword($user,$_POST["password"],0,1,1);
if ($result2)
{
$this->db->commit();
}
else
{
$this->db->rollback();
}
}
else
{
$this->errors=$nuser->error;
$this->db->rollback();
}
}
else
{
$this->errors=$this->object->errors;
}
}
// Creation adherent
if ($action == 'add')
{
$this->assign_post();
if (! $_POST["name"])
{
array_push($this->errors,$langs->trans("ErrorFieldRequired",$langs->transnoentities("Lastname").' / '.$langs->transnoentities("Label")));
$action = 'create';
}
if ($_POST["name"])
{
$id = $this->object->create($user);
if ($id > 0)
{
header("Location: ".$_SERVER["PHP_SELF"]."?id=".$id);
exit;
}
else
{
$this->errors=$this->object->errors;
$action = 'create';
}
}
}
if ($action == 'confirm_delete' && GETPOST("confirm") == 'yes')
{
$result=$this->object->fetch($id);
$this->object->old_name = $_POST["old_name"];
$this->object->old_firstname = $_POST["old_firstname"];
$result = $this->object->delete();
if ($result > 0)
{
header("Location: list.php");
exit;
}
else
{
$this->errors=$this->object->errors;
}
}
if ($action == 'update')
{
if ($_POST["cancel"])
{
header("Location: ".$_SERVER["PHP_SELF"]."?id=".$this->object->id);
exit;
}
if (empty($_POST["name"]))
{
$this->error=array($langs->trans("ErrorFieldRequired",$langs->transnoentities("Name").' / '.$langs->transnoentities("Label")));
$action = 'edit';
}
if (empty($this->error))
{
$this->object->fetch($_POST["adherentid"]);
$this->object->oldcopy=dol_clone($this->object);
$this->assign_post();
$result = $this->object->update($_POST["adherentid"], $user);
if ($result > 0)
{
header("Location: ".$_SERVER["PHP_SELF"]."?id=".$this->object->id);
exit;
}
else
{
$this->errors=$this->object->errors;
$action = 'edit';
}
}
}
}
/**
* Set content of ->tpl array, to use into template
*
* @param string &$action Type of action
* @param int $id Id
* @return string HTML output
*/
function assign_values(&$action, $id)
{
global $conf, $langs, $user, $canvas;
global $form, $formcompany, $objsoc;
if ($action == 'add' || $action == 'update') $this->assign_post();
foreach($this->object as $key => $value)
{
$this->tpl[$key] = $value;
}
$this->tpl['error']=$this->error;
$this->tpl['errors']=$this->errors;
if ($action == 'create' || $action == 'edit')
{
if ($conf->use_javascript_ajax)
{
$this->tpl['ajax_selectcountry'] = "\n".'<script type="text/javascript" language="javascript">
jQuery(document).ready(function () {
jQuery("#selectcountry_id").change(function() {
document.formsoc.action.value="'.$action.'";
document.formsoc.canvas.value="'.$canvas.'";
document.formsoc.submit();
});
})
</script>'."\n";
}
if (is_object($objsoc) && $objsoc->id > 0)
{
$this->tpl['company'] = $objsoc->getNomUrl(1);
$this->tpl['company_id'] = $objsoc->id;
}
else
{
$this->tpl['company'] = $form->select_company($this->object->socid,'socid','',1);
}
// Civility
$this->tpl['select_civility'] = $formcompany->select_civility($this->object->civilite_id);
// Predefined with third party
if ((isset($objsoc->typent_code) && $objsoc->typent_code == 'TE_PRIVATE'))
{
if (dol_strlen(trim($this->object->address)) == 0) $this->tpl['address'] = $objsoc->address;
if (dol_strlen(trim($this->object->zip)) == 0) $this->object->zip = $objsoc->zip;
if (dol_strlen(trim($this->object->town)) == 0) $this->object->town = $objsoc->town;
if (dol_strlen(trim($this->object->phone_perso)) == 0) $this->object->phone_perso = $objsoc->phone;
if (dol_strlen(trim($this->object->phone_mobile)) == 0) $this->object->phone_mobile = $objsoc->phone_mobile;
if (dol_strlen(trim($this->object->email)) == 0) $this->object->email = $objsoc->email;
}
// Zip
$this->tpl['select_zip'] = $formcompany->select_ziptown($this->object->zip,'zipcode',array('town','selectcountry_id','departement_id'),6);
// Town
$this->tpl['select_town'] = $formcompany->select_ziptown($this->object->town,'town',array('zipcode','selectcountry_id','departement_id'));
if (dol_strlen(trim($this->object->country_id)) == 0) $this->object->country_id = $objsoc->country_id;
// Country
$this->tpl['select_country'] = $form->select_country($this->object->country_id,'country_id');
$countrynotdefined = $langs->trans("ErrorSetACountryFirst").' ('.$langs->trans("SeeAbove").')';
if ($user->admin) $this->tpl['info_admin'] = info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionnarySetup"),1);
// State
if ($this->object->country_id) $this->tpl['select_state'] = $formcompany->select_state($this->object->fk_departement,$this->object->country_code);
else $this->tpl['select_state'] = $countrynotdefined;
// Physical or Moral
$selectarray=array('0'=>$langs->trans("Physical"),'1'=>$langs->trans("Moral"));
$this->tpl['select_morphy'] = $form->selectarray('morphy',$selectarray,$this->object->morphy,0);
}
if ($action == 'view' || $action == 'edit' || $action == 'delete')
{
// Emailing
if (! empty($conf->mailing->enabled))
{
$langs->load("mails");
$this->tpl['nb_emailing'] = $this->object->getNbOfEMailings();
}
// Dolibarr user
if ($this->object->user_id)
{
$dolibarr_user=new User($this->db);
$result=$dolibarr_user->fetch($this->object->user_id);
$this->tpl['dolibarr_user'] = $dolibarr_user->getLoginUrl(1);
}
else $this->tpl['dolibarr_user'] = $langs->trans("NoDolibarrAccess");
}
if ($action == 'view' || $action == 'delete')
{
$this->tpl['showrefnav'] = $form->showrefnav($this->object,'id');
if ($this->object->socid > 0)
{
$objsoc = new Societe($this->db);
$objsoc->fetch($this->object->socid);
$this->tpl['company'] = $objsoc->getNomUrl(1);
}
else
{
$this->tpl['company'] = $langs->trans("AdherentNotLinkedToThirdParty");
}
$this->tpl['civility'] = $this->object->getCivilityLabel();
$this->tpl['address'] = dol_nl2br($this->object->address);
$this->tpl['zip'] = ($this->object->zip?$this->object->zip.'&nbsp;':'');
$img=picto_from_langcode($this->object->country_code);
$this->tpl['country'] = ($img?$img.' ':'').$this->object->country;
$this->tpl['phone_perso'] = dol_print_phone($this->object->phone_perso,$this->object->country_code,0,$this->object->id,'AC_TEL');
$this->tpl['phone_mobile'] = dol_print_phone($this->object->phone_mobile,$this->object->country_code,0,$this->object->id,'AC_TEL');
$this->tpl['email'] = dol_print_email($this->object->email,0,$this->object->id,'AC_EMAIL');
$this->tpl['visibility'] = $this->object->getmorphylib($this->object->morphy);
$this->tpl['note'] = nl2br($this->object->note);
}
if ($action == 'create_user')
{
// Full firstname and name separated with a dot : firstname.name
include_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/security2.lib.php';
$login=dol_buildlogin($this->object->nom, $this->object->prenom);
$generated_password=getRandomPassword('');
$password=$generated_password;
// Create a form array
$formquestion=array(
array('label' => $langs->trans("LoginToCreate"), 'type' => 'text', 'name' => 'login', 'value' => $login),
array('label' => $langs->trans("Password"), 'type' => 'text', 'name' => 'password', 'value' => $password));
$this->tpl['action_create_user'] = $form->formconfirm($_SERVER["PHP_SELF"]."?id=".$this->object->id,$langs->trans("CreateDolibarrLogin"),$langs->trans("ConfirmCreateAdherent"),"confirm_create_user",$formquestion,'no');
}
}
/**
* Assign POST values into object
*
* @return string HTML output
*/
private function assign_post()
{
global $langs, $mysoc;
$this->object->old_name = $_POST["old_name"];
$this->object->old_firstname = $_POST["old_firstname"];
$this->object->fk_soc = $_POST["fk_soc"];
$this->object->name = $_POST["name"];
$this->object->firstname = $_POST["firstname"];
$this->object->civilite_id = $_POST["civilite_id"];
$this->object->address = $_POST["address"];
$this->object->zip = $_POST["zipcode"];
$this->object->town = $_POST["town"];
$this->object->fk_pays = $_POST["country_id"]?$_POST["country_id"]:$mysoc->country_id;
$this->object->fk_departement = $_POST["departement_id"];
$this->object->country_id = $_POST["country_id"]?$_POST["country_id"]:$mysoc->country_id;
$this->object->state_id = $_POST["departement_id"];
$this->object->phone_perso = $_POST["phone_perso"];
$this->object->phone_mobile = $_POST["phone_mobile"];
$this->object->email = $_POST["email"];
$this->object->note = $_POST["note"];
$this->object->canvas = $_POST["canvas"];
// We set country_id, and country_code label of the chosen country
if ($this->object->country_id)
{
$sql = "SELECT code, libelle FROM ".MAIN_DB_PREFIX."c_pays WHERE rowid = ".$this->object->country_id;
$resql=$this->db->query($sql);
if ($resql)
{
$obj = $this->db->fetch_object($resql);
}
else
{
dol_print_error($this->db);
}
$this->object->pays_code = $obj->code;
$this->object->pays = $langs->trans("Country".$obj->code)?$langs->trans("Country".$obj->code):$obj->libelle;
$this->object->country_code = $obj->code;
$this->object->country = $langs->trans("Country".$obj->code)?$langs->trans("Country".$obj->code):$obj->libelle;
}
}
}
?>

View File

@ -0,0 +1,148 @@
<?php
/* Copyright (C) 2010-2012 Regis Houssin <regis@dolibarr.fr>
* Copyright (C) 2011 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2012 Philippe Grand <philippe.grand@atoo-net.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* 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, see <http://www.gnu.org/licenses/>.
*/
/**
* \file htdocs/adherents/canvas/default/actions_adherentcard_default.class.php
* \ingroup member
* \brief Fichier de la classe Thirdparty adherent card controller (default canvas)
*/
include_once DOL_DOCUMENT_ROOT.'/adherents/canvas/actions_adherentcard_common.class.php';
/**
* \class ActionsAdherentCardDefault
* \brief Classe permettant la gestion des adherents par defaut
*/
class ActionsAdherentCardDefault extends ActionsAdherentCardCommon
{
var $db;
var $dirmodule;
var $targetmodule;
var $canvas;
var $card;
/**
* Constructor
*
* @param DoliDB $db Handler acces base de donnees
* @param string $dirmodule Name of directory of module
* @param string $targetmodule Name of directory of module where canvas is stored
* @param string $canvas Name of canvas
* @param string $card Name of tab (sub-canvas)
*/
function __construct($db, $dirmodule, $targetmodule, $canvas, $card)
{
$this->db = $db;
$this->dirmodule = $dirmodule;
$this->targetmodule = $targetmodule;
$this->canvas = $canvas;
$this->card = $card;
}
/**
* Return the title of card
*
* @param string $action Code action
* @return string Title
*/
private function getTitle($action)
{
global $langs;
$out='';
if ($action == 'view') $out.= (! empty($conf->global->ADHERENT_ADDRESSES_MANAGEMENT) ? $langs->trans("Adherent") : $langs->trans("ContactAddress"));
if ($action == 'edit') $out.= (! empty($conf->global->ADHERENT_ADDRESSES_MANAGEMENT) ? $langs->trans("EditAdherent") : $langs->trans("EditAdherentAddress"));
if ($action == 'create') $out.= (! empty($conf->global->ADHERENT_ADDRESSES_MANAGEMENT) ? $langs->trans("NewAdherent") : $langs->trans("NewAdherentAddress"));
return $out;
}
/**
* Assign custom values for canvas
*
* @param string &$action Type of action
* @param int $id Id
* @return void
*/
function assign_values(&$action, $id)
{
global $conf, $db, $langs, $user;
global $form;
$ret = $this->getObject($id);
parent::assign_values($action, $id);
$this->tpl['title'] = $this->getTitle($action);
$this->tpl['error'] = $this->error;
$this->tpl['errors']= $this->errors;
if ($action == 'view')
{
// Card header
$head = member_prepare_head($this->object);
$title = $this->getTitle($action);
$this->tpl['showhead']=dol_get_fiche_head($head, 'card', $title, 0, 'adherent');
$this->tpl['showend']=dol_get_fiche_end();
$objsoc = new Societe($db);
$objsoc->fetch($this->object->socid);
$this->tpl['actionstodo']=show_actions_todo($conf,$langs,$db,$objsoc,$this->object,1);
$this->tpl['actionsdone']=show_actions_done($conf,$langs,$db,$objsoc,$this->object,1);
}
else
{
// Confirm delete contact
if ($action == 'delete' && $user->rights->adherent->supprimer)
{
$this->tpl['action_delete'] = $form->formconfirm($_SERVER["PHP_SELF"]."?id=".$this->object->id,$langs->trans("DeleteAdherent"),$langs->trans("ConfirmDeleteAdherent"),"confirm_delete",'',0,1);
}
}
if ($action == 'list')
{
$this->LoadListDatas($GLOBALS['limit'], $GLOBALS['offset'], $GLOBALS['sortfield'], $GLOBALS['sortorder']);
}
}
/**
* Fetch datas list
*
* @param int $limit Limit number of responses
* @param int $offset Offset for first response
* @param string $sortfield Sort field
* @param string $sortorder Sort order ('ASC' or 'DESC')
* @return void
*/
function LoadListDatas($limit, $offset, $sortfield, $sortorder)
{
global $conf, $langs;
//$this->getFieldList();
$this->list_datas = array();
}
}
?>

View File

@ -0,0 +1 @@
Url not available

View File

@ -0,0 +1,123 @@
<?php
/* Copyright (C) 2010 Regis Houssin <regis@dolibarr.fr>
* Copyright (C) 2012 Philippe Grand <philippe.grand@atoo-net.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* 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, see <http://www.gnu.org/licenses/>.
*
*/
?>
<!-- BEGIN PHP TEMPLATE ADHERENTCARD_CREATE.TPL.PHP DEFAULT -->
<?php
print_fiche_titre($this->control->tpl['title']);
dol_htmloutput_errors((is_numeric($object->error)?'':$object->error),$object->errors);
dol_htmloutput_errors((is_numeric($GLOBALS['error'])?'':$GLOBALS['error']),$GLOBALS['errors']);
dol_htmloutput_errors($this->control->tpl['error'],$this->control->tpl['errors']);
echo $this->control->tpl['ajax_selectcountry']; ?>
<br>
<form method="post" name="formmember" action="<?php echo $_SERVER["PHP_SELF"]; ?>">
<input type="hidden" name="token" value="<?php echo $_SESSION['newtoken']; ?>">
<input type="hidden" name="canvas" value="<?php echo $canvas ?>">
<input type="hidden" name="action" value="add">
<?php if ($this->control->tpl['company_id']) { ?>
<input type="hidden" name="socid" value="<?php echo $this->control->tpl['company_id']; ?>">
<?php } ?>
<table class="border allwidth">
<tr>
<td width="15%" class="fieldrequired"><?php echo $langs->trans("Lastname").' / '.$langs->trans("Label"); ?></td>
<td><input name="lastname" type="text" size="30" maxlength="80" value="<?php echo $this->control->tpl['name']; ?>"></td>
<td width="20%"><?php echo $langs->trans("Firstname"); ?></td>
<td width="25%"><input name="firstname" type="text" size="30" maxlength="80" value="<?php echo $this->control->tpl['firstname']; ?>"></td>
</tr>
<tr>
<td><?php echo $langs->trans("Company"); ?></td>
<td colspan="3"><?php echo $this->control->tpl['company']; ?></td>
</tr>
<tr>
<td width="15%"><?php echo $langs->trans("UserTitle"); ?></td>
<td colspan="3"><?php echo $this->control->tpl['select_civility']; ?></td>
</tr>
<tr>
<td><?php echo $langs->trans("Morphy"); ?></td>
<td colspan="3"><input name="morphy" type="text" size="50" maxlength="80" value="<?php echo $this->control->tpl['select_morphy']; ?>"></td>
</tr>
<tr>
<td><?php echo $langs->trans("Address"); ?></td>
<td colspan="3"><textarea class="flat" name="address" cols="70"><?php echo $this->control->tpl['address']; ?></textarea></td>
</tr>
<tr>
<td><?php echo $langs->trans("Zip").' / '.$langs->trans("Town"); ?></td>
<td colspan="3"><?php echo $this->control->tpl['select_zip'].'&nbsp;'.$this->control->tpl['select_town']; ?></td>
</tr>
<tr>
<td><?php echo $langs->trans("Country"); ?></td>
<td colspan="3"><?php echo $this->control->tpl['select_country'].$this->control->tpl['info_admin']; ?></td>
</tr>
<tr>
<td><?php echo $langs->trans('State'); ?></td>
<td colspan="3"><?php echo $this->control->tpl['select_state']; ?></td>
</tr>
<tr>
<td><?php echo $langs->trans("PhonePro"); ?></td>
<td><input name="phone_pro" type="text" size="18" maxlength="80" value="<?php echo $this->control->tpl['phone_pro']; ?>"></td>
<td><?php echo $langs->trans("PhonePerso"); ?></td>
<td><input name="phone_perso" type="text" size="18" maxlength="80" value="<?php echo $this->control->tpl['phone_perso']; ?>"></td>
</tr>
<tr>
<td><?php echo $langs->trans("PhoneMobile"); ?></td>
<td><input name="phone_mobile" type="text" size="18" maxlength="80" value="<?php echo $this->control->tpl['phone_mobile']; ?>"></td>
</tr>
<tr>
<td><?php echo $langs->trans("Email"); ?></td>
<td colspan="3"><input name="email" type="text" size="50" maxlength="80" value="<?php echo $this->control->tpl['email']; ?>"></td>
</tr>
<tr>
<td><?php echo $langs->trans("ContactVisibility"); ?></td>
<td colspan="3"><?php echo $this->control->tpl['select_visibility']; ?></td>
</tr>
<tr>
<td valign="top"><?php echo $langs->trans("Note"); ?></td>
<td colspan="3" valign="top"><textarea name="note" cols="70" rows="<?php echo ROWS_3; ?>"><?php echo $this->control->tpl['note']; ?></textarea></td>
</tr>
<tr>
<td align="center" colspan="4"><input type="submit" class="button" value="<?php echo $langs->trans("Add"); ?>"></td>
</tr>
</table><br>
</form>
<!-- END PHP TEMPLATE -->

View File

@ -0,0 +1,140 @@
<?php
/* Copyright (C) 2010 Regis Houssin <regis@dolibarr.fr>
* Copyright (C) 2012 Philippe Grand <philippe.grand@atoo-net.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* 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, see <http://www.gnu.org/licenses/>.
*
*/
$contact = $GLOBALS['objcanvas']->control->object;
?>
<!-- BEGIN PHP TEMPLATE ADHERENTCARD_EDIT.TPL.PHP DEFAULT -->
<?php
print_fiche_titre($this->control->tpl['title']);
dol_htmloutput_errors($this->control->tpl['error'],$this->control->tpl['errors']);
echo $this->control->tpl['ajax_selectcountry'];
?>
<br>
<form method="post" name="formmember" action="<?php echo $_SERVER["PHP_SELF"].'?id='.GETPOST('id','int'); ?>">
<input type="hidden" name="token" value="<?php echo $_SESSION['newtoken']; ?>">
<input type="hidden" name="canvas" value="<?php echo $canvas ?>">
<input type="hidden" name="id" value="<?php echo GETPOST('id','int'); ?>">
<input type="hidden" name="action" value="update">
<input type="hidden" name="adherentid" value="<?php echo $this->control->tpl['id']; ?>">
<input type="hidden" name="old_name" value="<?php echo $this->control->tpl['name']; ?>">
<input type="hidden" name="old_firstname" value="<?php echo $this->control->tpl['firstname']; ?>">
<?php if (! empty($this->control->tpl['company_id'])) { ?>
<input type="hidden" name="socid" value="<?php echo $this->control->tpl['company_id']; ?>">
<?php } ?>
<table class="border allwidth">
<tr>
<td><?php echo $langs->trans("Ref"); ?></td>
<td colspan="3"><?php echo $this->control->tpl['ref']; ?></td>
</tr>
<tr>
<td width="15%" class="fieldrequired"><?php echo $langs->trans("Lastname").' / '.$langs->trans("Label"); ?></td>
<td><input name="lastname" type="text" size="30" maxlength="80" value="<?php echo $this->control->tpl['name']; ?>"></td>
<td width="20%"><?php echo $langs->trans("Firstname"); ?></td>
<td width="25%"><input name="firstname" type="text" size="30" maxlength="80" value="<?php echo $this->control->tpl['firstname']; ?>"></td>
</tr>
<tr>
<td><?php echo $langs->trans("Company"); ?></td>
<td colspan="3"><?php echo $this->control->tpl['company']; ?></td>
</tr>
<tr>
<td width="15%"><?php echo $langs->trans("UserTitle"); ?></td>
<td colspan="3"><?php echo $this->control->tpl['select_civility']; ?></td>
</tr>
<tr>
<td><?php echo $langs->trans("Morphy"); ?></td>
<td colspan="3"><input name="poste" type="text" size="50" maxlength="80" value="<?php echo $this->control->tpl['select_morphy']; ?>"></td>
</tr>
<tr>
<td><?php echo $langs->trans("Address"); ?></td>
<td colspan="3"><textarea class="flat" name="address" cols="70"><?php echo $this->control->tpl['address']; ?></textarea></td>
</tr>
<tr>
<td><?php echo $langs->trans("Zip").' / '.$langs->trans("Town"); ?></td>
<td colspan="3"><?php echo $this->control->tpl['select_zip'].'&nbsp;'.$this->control->tpl['select_town']; ?></td>
</tr>
<tr>
<td><?php echo $langs->trans("Country"); ?></td>
<td colspan="3"><?php echo $this->control->tpl['select_country'].$this->control->tpl['info_admin']; ?></td>
</tr>
<tr>
<td><?php echo $langs->trans('State'); ?></td>
<td colspan="3"><?php echo $this->control->tpl['select_state']; ?></td>
</tr>
<tr>
<td><?php echo $langs->trans("PhonePro"); ?></td>
<td><input name="phone_pro" type="text" size="18" maxlength="80" value="<?php echo $this->control->tpl['phone_pro']; ?>"></td>
<td><?php echo $langs->trans("PhonePerso"); ?></td>
<td><input name="phone_perso" type="text" size="18" maxlength="80" value="<?php echo $this->control->tpl['phone_perso']; ?>"></td>
</tr>
<tr>
<td><?php echo $langs->trans("PhoneMobile"); ?></td>
<td><input name="phone_mobile" type="text" size="18" maxlength="80" value="<?php echo $this->control->tpl['phone_mobile']; ?>"></td>
</tr>
<tr>
<td><?php echo $langs->trans("Email"); ?></td>
<td><input name="email" type="text" size="50" maxlength="80" value="<?php echo $this->control->tpl['email']; ?>"></td>
</tr>
<tr>
<td><?php echo $langs->trans("ContactVisibility"); ?></td>
<td colspan="3"><?php echo $this->control->tpl['select_visibility']; ?></td>
</tr>
<tr>
<td valign="top"><?php echo $langs->trans("Note"); ?></td>
<td colspan="3" valign="top"><textarea name="note" cols="70" rows="<?php echo ROWS_3; ?>"><?php echo $this->control->tpl['note']; ?></textarea></td>
</tr>
<tr>
<td><?php echo $langs->trans("DolibarrLogin"); ?></td>
<td colspan="3"><?php echo $this->control->tpl['dolibarr_user']; ?></td>
</tr>
<tr>
<td colspan="4" align="center">
<input type="submit" class="button" name="save" value="<?php echo $langs->trans("Save"); ?>">&nbsp;
<input type="submit" class="button" name="cancel" value="<?php echo $langs->trans("Cancel"); ?>">
</td>
</tr>
</table><br>
</form>
<!-- END PHP TEMPLATE -->

View File

@ -0,0 +1,141 @@
<?php
/* Copyright (C) 2010-2012 Regis Houssin <regis@dolibarr.fr>
* Copyright (C) 2012 Philippe Grand <philippe.grand@atoo-net.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* 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, see <http://www.gnu.org/licenses/>.
*
*/
$contact = $GLOBALS['objcanvas']->control->object;
?>
<!-- BEGIN PHP TEMPLATE ADHERENTCARD_VIEW.TPL.PHP DEFAULT -->
<?php echo $this->control->tpl['showhead']; ?>
<?php
dol_htmloutput_errors($this->control->tpl['error'],$this->control->tpl['errors']);
?>
<?php if (! empty($this->control->tpl['action_create_user'])) echo $this->control->tpl['action_create_user']; ?>
<?php if (! empty($this->control->tpl['action_delete'])) echo $this->control->tpl['action_delete']; ?>
<table class="border allwidth">
<tr>
<td width="20%"><?php echo $langs->trans("Ref"); ?></td>
<td colspan="3"><?php echo $this->control->tpl['showrefnav']; ?></td>
</tr>
<tr>
<td width="20%"><?php echo $langs->trans("Lastname"); ?></td>
<td width="30%"><?php echo $this->control->tpl['name']; ?></td>
<td width="25%"><?php echo $langs->trans("Firstname"); ?></td>
<td width="25%"><?php echo $this->control->tpl['firstname']; ?></td>
</tr>
<tr>
<td><?php echo $langs->trans("Company"); ?></td>
<td colspan="3"><?php echo $this->control->tpl['company']; ?></td>
</tr>
<tr>
<td width="15%"><?php echo $langs->trans("UserTitle"); ?></td>
<td colspan="3"><?php echo $this->control->tpl['civility']; ?></td>
</tr>
<tr>
<td><?php echo $langs->trans("Morphy"); ?></td>
<td colspan="3"><?php echo $this->control->tpl['select_morphy']; ?></td>
</tr>
<tr>
<td><?php echo $langs->trans("Address"); ?></td>
<td colspan="3"><?php echo $this->control->tpl['address']; ?></td>
</tr>
<tr>
<td><?php echo $langs->trans("Zip").' / '.$langs->trans("Town"); ?></td>
<td colspan="3"><?php echo $this->control->tpl['zip'].$this->control->tpl['ville']; ?></td>
</tr>
<tr>
<td><?php echo $langs->trans("Country"); ?></td>
<td colspan="3"><?php echo $this->control->tpl['country']; ?></td>
</tr>
<tr>
<td><?php echo $langs->trans('State'); ?></td>
<td colspan="3"><?php echo $this->control->tpl['departement']; ?></td>
</tr>
<tr>
<td><?php echo $langs->trans("PhonePro"); ?></td>
<td><?php echo $this->control->tpl['phone_pro']; ?></td>
<td><?php echo $langs->trans("PhonePerso"); ?></td>
<td><?php echo $this->control->tpl['phone_perso']; ?></td>
</tr>
<tr>
<td><?php echo $langs->trans("PhoneMobile"); ?></td>
<td><?php echo $this->control->tpl['phone_mobile']; ?></td>
</tr>
<tr>
<td><?php echo $langs->trans("EMail"); ?></td>
<td><?php echo $this->control->tpl['email']; ?></td>
</tr>
<tr>
<td><?php echo $langs->trans("ContactVisibility"); ?></td>
<td colspan="3"><?php echo $this->control->tpl['visibility']; ?></td>
</tr>
<tr>
<td valign="top"><?php echo $langs->trans("Note"); ?></td>
<td colspan="3"><?php echo $this->control->tpl['note']; ?></td>
</tr>
<tr>
<td><?php echo $langs->trans("DolibarrLogin"); ?></td>
<td colspan="3"><?php echo $this->control->tpl['dolibarr_user']; ?></td>
</tr>
</table>
<?php echo $this->control->tpl['showend']; ?>
<?php if (! $user->societe_id) { ?>
<div class="tabsAction">
<?php if ($user->rights->adherent->creer) { ?>
<a class="butAction" href="<?php echo $_SERVER["PHP_SELF"].'?id='.$this->control->tpl['id'].'&amp;action=edit&amp;canvas='.$canvas; ?>"><?php echo $langs->trans('Modify'); ?></a>
<?php } ?>
<?php if (! $this->control->tpl['user_id'] && $user->rights->user->user->creer) { ?>
<a class="butAction" href="<?php echo $_SERVER["PHP_SELF"].'?id='.$this->control->tpl['id'].'&amp;action=create_user&amp;canvas='.$canvas; ?>"><?php echo $langs->trans("CreateDolibarrLogin"); ?></a>
<?php } ?>
<?php if ($user->rights->adherent->supprimer) { ?>
<a class="butActionDelete" href="<?php echo $_SERVER["PHP_SELF"].'?id='.$this->control->tpl['id'].'&amp;action=delete&amp;canvas='.$canvas; ?>"><?php echo $langs->trans('Delete'); ?></a>
<?php } ?>
</div><br>
<?php }
echo $this->control->tpl['actionstodo'];
echo $this->control->tpl['actionsdone'];
?>
<!-- END PHP TEMPLATE -->

View File

@ -0,0 +1 @@
Url not available

View File

@ -0,0 +1 @@
Url not available

View File

@ -1,7 +1,8 @@
<?php
/* Copyright (C) 2001-2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2002-2003 Jean-Louis Bergamo <jlb@j1b.org>
* Copyright (C) 2004-2012 Laurent Destailleur <eldy@users.sourceforge.net>
/* Copyright (C) 2001-2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2002-2003 Jean-Louis Bergamo <jlb@j1b.org>
* Copyright (C) 2004-2012 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2012 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
@ -40,6 +41,7 @@ $langs->load("mails");
$action=GETPOST('action','alpha');
$confirm=GETPOST('confirm','alpha');
$rowid=GETPOST('rowid','int');
$typeid=GETPOST('typeid','int');
@ -87,7 +89,7 @@ if ($rowid)
*/
// Create third party from a member
if ($action == 'confirm_create_thirdparty' && $_POST["confirm"] == 'yes' && $user->rights->societe->creer)
if ($action == 'confirm_create_thirdparty' && $confirm == 'yes' && $user->rights->societe->creer)
{
if ($result > 0)
{
@ -589,10 +591,10 @@ if ($rowid)
print '<table class="nobordernopadding" width="100%"><tr><td>';
print $langs->trans("LinkedToDolibarrUser");
print '</td>';
if ($_GET['action'] != 'editlogin' && $user->rights->adherent->creer) print '<td align="right"><a href="'.$_SERVER["PHP_SELF"].'?action=editlogin&amp;rowid='.$object->id.'">'.img_edit($langs->trans('SetLinkToUser'),1).'</a></td>';
if ($action != 'editlogin' && $user->rights->adherent->creer) print '<td align="right"><a href="'.$_SERVER["PHP_SELF"].'?action=editlogin&amp;rowid='.$object->id.'">'.img_edit($langs->trans('SetLinkToUser'),1).'</a></td>';
print '</tr></table>';
print '</td><td class="valeur">';
if ($_GET['action'] == 'editlogin')
if ($action == 'editlogin')
{
/*$include=array();
if (empty($user->rights->user->user->creer)) // If can edit only itself user, we can link to itself only
@ -748,49 +750,40 @@ if ($rowid)
if ($conf->use_javascript_ajax)
{
print "\n".'<script type="text/javascript" language="javascript">';
print 'jQuery(document).ready(function () {
jQuery(".bankswitchclass").'.($bankdirect||$bankviainvoice||in_array(GETPOST('paymentsave'),array('bankdirect','bankviainvoice'))?'show()':'hide()').';
jQuery(".bankswitchclass2").'.($bankdirect||$bankviainvoice||in_array(GETPOST('paymentsave'),array('bankdirect','bankviainvoice'))?'show()':'hide()').';
jQuery("#none").click(function() {
jQuery(".bankswitchclass").hide();
jQuery(".bankswitchclass2").hide();
print '$(document).ready(function () {
$(".bankswitchclass, .bankswitchclass2").'.($bankdirect||$bankviainvoice||in_array(GETPOST('paymentsave'),array('bankdirect','bankviainvoice'))?'show()':'hide()').';
$("#none, #invoiceonly").click(function() {
$(".bankswitchclass").hide();
$(".bankswitchclass2").hide();
});
jQuery("#bankdirect").click(function() {
jQuery(".bankswitchclass").show();
jQuery(".bankswitchclass2").show();
$("#bankdirect, #bankviainvoice").click(function() {
$(".bankswitchclass").show();
$(".bankswitchclass2").show();
});
jQuery("#bankviainvoice").click(function() {
jQuery(".bankswitchclass").show();
jQuery(".bankswitchclass2").show();
});
jQuery("#invoiceonly").click(function() {
jQuery(".bankswitchclass").hide();
jQuery(".bankswitchclass2").hide();
});
jQuery("#selectoperation").change(function() {
code=jQuery("#selectoperation option:selected").val();
if (code == \'CHQ\')
$("#selectoperation").change(function() {
var code = $(this).val();
if (code == "CHQ")
{
jQuery(\'.fieldrequireddyn\').addClass(\'fieldrequired\');
if (jQuery(\'#fieldchqemetteur\').val() == \'\')
$(".fieldrequireddyn").addClass("fieldrequired");
if ($("#fieldchqemetteur").val() == "")
{
jQuery(\'#fieldchqemetteur\').val(jQuery(\'#memberlabel\').val());
$("#fieldchqemetteur").val($("#memberlabel").val());
}
}
else
{
jQuery(\'.fieldrequireddyn\').removeClass(\'fieldrequired\');
$(".fieldrequireddyn").removeClass("fieldrequired");
}
});
';
if (GETPOST('paymentsave')) print 'jQuery("#'.GETPOST('paymentsave').'").attr(\'checked\',true);';
if (GETPOST('paymentsave')) print '$("#'.GETPOST('paymentsave').'").attr("checked",true);';
print '});';
print '</script>'."\n";
}
// Confirm create third party
if ($_GET["action"] == 'create_thirdparty')
if ($action == 'create_thirdparty')
{
$name = $object->getFullName($langs);
if (! empty($name))
@ -803,14 +796,14 @@ if ($rowid)
}
// Create a form array
$formquestion=array( array('label' => $langs->trans("NameToCreate"), 'type' => 'text', 'name' => 'companyname', 'value' => $name));
$formquestion=array(array('label' => $langs->trans("NameToCreate"), 'type' => 'text', 'name' => 'companyname', 'value' => $name));
$ret=$form->form_confirm($_SERVER["PHP_SELF"]."?rowid=".$object->id,$langs->trans("CreateDolibarrThirdParty"),$langs->trans("ConfirmCreateThirdParty"),"confirm_create_thirdparty",$formquestion,1);
if ($ret == 'html') print '<br>';
}
print '<form name="cotisation" method="post" action="'.$_SERVER["PHP_SELF"].'">';
print '<form name="cotisation" method="POST" action="'.$_SERVER["PHP_SELF"].'">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<input type="hidden" name="action" value="cotisation">';
print '<input type="hidden" name="rowid" value="'.$rowid.'">';
@ -888,15 +881,15 @@ if ($rowid)
print '<tr><td valign="top" class="fieldrequired">'.$langs->trans('MoreActions');
print '</td>';
print '<td>';
print '<input type="radio" class="moreaction" id="none" name="paymentsave" value="none"'.(!$bankdirect&&!$bankviainvoice?' checked="checked"':'').'> '.$langs->trans("None").'<br>';
print '<input type="radio" class="moreaction" id="none" name="paymentsave" value="none"'.(empty($bankdirect) && empty($bankviainvoice)?' checked="checked"':'').'> '.$langs->trans("None").'<br>';
if (! empty($conf->banque->enabled))
{
print '<input type="radio" class="moreaction" id="bankdirect" name="paymentsave" value="bankdirect"'.($bankdirect?' checked="checked"':'');
print '<input type="radio" class="moreaction" id="bankdirect" name="paymentsave" value="bankdirect"'.(! empty($bankdirect)?' checked="checked"':'');
print '> '.$langs->trans("MoreActionBankDirect").'<br>';
}
if (! empty($conf->societe->enabled) && ! empty($conf->facture->enabled))
{
print '<input type="radio" class="moreaction" id="invoiceonly" name="paymentsave" value="invoiceonly"'.($invoiceonly?' checked="checked"':'');
print '<input type="radio" class="moreaction" id="invoiceonly" name="paymentsave" value="invoiceonly"'.(empty($conf->global->ADHERENT_BANK_USE) || $invoiceonly?' checked="checked"':'');
if (empty($object->fk_soc) || empty($bankviainvoice)) print ' disabled="disabled"';
print '> '.$langs->trans("MoreActionInvoiceOnly");
if ($object->fk_soc) print ' ('.$langs->trans("ThirdParty").': '.$company->getNomUrl(1).')';
@ -911,7 +904,7 @@ if ($rowid)
}
if (! empty($conf->banque->enabled) && ! empty($conf->societe->enabled) && ! empty($conf->facture->enabled))
{
print '<input type="radio" class="moreaction" id="bankviainvoice" name="paymentsave" value="bankviainvoice"'.($bankviainvoice?' checked="checked"':'');
print '<input type="radio" class="moreaction" id="bankviainvoice" name="paymentsave" value="bankviainvoice"'.($bankviainvoice && !empty($conf->global->ADHERENT_BANK_USE)?' checked="checked"':'');
if (empty($object->fk_soc) || empty($bankviainvoice)) print ' disabled="disabled"';
print '> '.$langs->trans("MoreActionBankViaInvoice");
if ($object->fk_soc) print ' ('.$langs->trans("ThirdParty").': '.$company->getNomUrl(1).')';

File diff suppressed because it is too large Load Diff

View File

@ -294,12 +294,12 @@ if ($resql)
$staticmember->id=$obj->rowid;
$staticmember->lastname=$obj->lastname;
$staticmember->firstname=$obj->firstname;
if (! empty($obj->fk_soc)) {
$staticmember->socid = $obj->fk_soc;
if (! empty($obj->fk_soc)) {
$staticmember->socid = $obj->fk_soc;
$staticmember->fetch_thirdparty();
$staticmember->name=$staticmember->thirdparty->name;
} else {
$staticmember->name=$obj->company;
$staticmember->name=$staticmember->thirdparty->name;
} else {
$staticmember->name=$obj->company;
}
$staticmember->ref=$staticmember->getFullName($langs);
print '<td>'.$subscriptionstatic->getNomUrl(1).'</td>';

View File

@ -268,12 +268,12 @@ if ($resql)
$memberstatic->lastname=$objp->lastname;
$memberstatic->firstname=$objp->firstname;
if (! empty($objp->fk_soc)) {
$memberstatic->socid = $objp->fk_soc;
$memberstatic->fetch_thirdparty();
$companyname=$memberstatic->thirdparty->name;
} else {
$companyname=$objp->company;
if (! empty($objp->fk_soc)) {
$memberstatic->socid = $objp->fk_soc;
$memberstatic->fetch_thirdparty();
$companyname=$memberstatic->thirdparty->name;
} else {
$companyname=$objp->company;
}
$var=!$var;

View File

@ -1,6 +1,9 @@
<?php
/* Copyright (C) 2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2009 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2004-2008 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2009 Regis Houssin <regis@dolibarr.fr>
* Copyright (C) 2011-2012 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2011-2012 Alexandre Spangaro <alexandre.spangaro@gmail.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -17,9 +20,9 @@
*/
/**
* \file htdocs/admin/accounting.php
* \ingroup accounting
* \brief Page de configuration du module comptabilite expert
* \file htdocs/admin/accounting.php
* \ingroup compta
* \brief Page to setup accountancy module
*/
require '../main.inc.php';
@ -29,43 +32,81 @@ $langs->load('admin');
$langs->load('compta');
if (!$user->admin)
accessforbidden();
accessforbidden();
$action = GETPOST('action','alpha');
$compta_mode = defined('COMPTA_MODE')?COMPTA_MODE:'RECETTES-DEPENSES';
if ($_POST['action'] == 'setcomptamode')
if ($action == 'setcomptamode')
{
$compta_mode = $_POST['compta_mode'];
if (! dolibarr_set_const($db, 'COMPTA_MODE', $compta_mode,'chaine',0,'',$conf->entity)) { print $db->error(); }
$compta_mode = GETPOST('compta_mode','alpha');
$res = dolibarr_set_const($db, 'COMPTA_MODE', $compta_mode,'chaine',0,'',$conf->entity);
if (! $res > 0) $error++;
if (! $error)
{
$mesg = "<font class=\"ok\">".$langs->trans("SetupSaved")."</font>";
}
else
{
$mesg = "<font class=\"error\">".$langs->trans("Error")."</font>";
}
}
if ($action == 'setchart')
{
$chartofaccounts = GETPOST('chartofaccounts','alpha');
$res = dolibarr_set_const($db, 'CHARTOFACCOUNTS', $chartofaccounts,'chaine',0,'',$conf->entity);
if (! $res > 0) $error++;
if (! $error)
{
$mesg = "<font class=\"ok\">".$langs->trans("SetupSaved")."</font>";
}
else
{
$mesg = "<font class=\"error\">".$langs->trans("Error")."</font>";
}
}
if ($action == 'update' || $action == 'add')
{
$constname = GETPOST('constname','alpha');
$constvalue = GETPOST('constvalue','alpha');
$consttype = GETPOST('consttype','alpha');
$constnote = GETPOST('constnote','alpha');
$res = dolibarr_set_const($db, $constname, $constvalue, $consttype, 0, $constnote, $conf->entity);
if (! $res > 0) $error++;
if (! $error)
{
$mesg = "<font class=\"ok\">".$langs->trans("SetupSaved")."</font>";
}
else
{
$mesg = "<font class=\"error\">".$langs->trans("Error")."</font>";
}
}
$form = new Form($db);
$typeconst=array('yesno','texte','chaine');
if ($_POST['action'] == 'update' || $_POST['action'] == 'add')
{
if (! dolibarr_set_const($db, $_POST['constname'], $_POST['constvalue'], $typeconst[$_POST['consttype']], 0, isset($_POST['constnote']) ? $_POST['constnote'] : '',$conf->entity));
{
print $db->error();
}
}
if ($_GET['action'] == 'delete')
/*if ($action == 'delete')
{
if (! dolibarr_del_const($db, $_GET['constname'],$conf->entity));
{
print $db->error();
print $db->error();
}
}
}*/
/*
* View
* Affichage page
*/
llxHeader();
@ -81,92 +122,162 @@ print '<br>';
print '<table class="noborder" width="100%">';
// Cas du parametre COMPTA_MODE
print '<form action="compta.php" method="post">';
print '<form action="'.$_SERVER["PHP_SELF"].'" method="post">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<input type="hidden" name="action" value="setcomptamode">';
print '<tr class="liste_titre">';
print '<td>'.$langs->trans('OptionMode').'</td><td>'.$langs->trans('Description').'</td>';
print '<td><input class="button" type="submit" value="'.$langs->trans('Modify').'"></td>';
print '<td align="right"><input class="button" type="submit" value="'.$langs->trans('Modify').'"></td>';
print "</tr>\n";
print '<tr '.$bc[false].'><td width="200"><input type="radio" name="compta_mode" value="RECETTES-DEPENSES"'.($compta_mode != 'CREANCES-DETTES' ? ' checked' : '').'> '.$langs->trans('OptionModeTrue').'</td>';
print '<td colspan="2">'.nl2br($langs->trans('OptionModeTrueDesc'))."</td></tr>\n";
print '<td colspan="2">'.nl2br($langs->trans('OptionModeTrueDesc'));
// Write info on way to count VAT
if (! empty($conf->global->MAIN_MODULE_COMPTABILITE))
{
// print "<br>\n";
// print nl2br($langs->trans('OptionModeTrueInfoModuleComptabilite'));
}
else
{
// print "<br>\n";
// print nl2br($langs->trans('OptionModeTrueInfoExpert'));
}
print "</td></tr>\n";
print '<tr '.$bc[true].'><td width="200"><input type="radio" name="compta_mode" value="CREANCES-DETTES"'.($compta_mode == 'CREANCES-DETTES' ? ' checked' : '').'> '.$langs->trans('OptionModeVirtual').'</td>';
print '<td colspan="2">'.$langs->trans('OptionModeVirtualDesc')."</td></tr>\n";
print '<td colspan="2">'.nl2br($langs->trans('OptionModeVirtualDesc'))."</td></tr>\n";
print '</form>';
print "</table>\n";
/*
* Define Chart of accounts
*
*/
if (! empty($conf->global->ACCOUNTING_SELECTCHART) && ! empty($conf->accounting->enabled))
{
print '<br>';
print_titre($langs->trans("Definechartofaccounts"));
print '<form action="'.$_SERVER["PHP_SELF"].'" method="POST">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'" />';
print '<table class="noborder" width="100%">';
$var=True;
print '<tr class="liste_titre">';
print '<td>';
print '<input type="hidden" name="action" value="setchart">';
print $langs->trans("Chartofaccounts").'</td>';
print '<td align="right"><input type="submit" class="button" value="'.$langs->trans("Modify").'"></td>';
print "</tr>\n";
$var=!$var;
print '<tr '.$bc[$var].'>';
print "<td>".$langs->trans("Selectchartofaccounts")."</td>";
print "<td>";
print '<select class="flat" name="chartofaccounts" id="chartofaccounts">';
print '<option value="0">'.$langs->trans("DoNotSuggestChart").'</option>';
$sql = "SELECT rowid, pcg_version, fk_pays, label, active";
$sql.= " FROM ".MAIN_DB_PREFIX."accountingsystem";
$sql.= " WHERE active = 1";
$sql.= " AND fk_pays = ".$mysoc->country_id;
$var=True;
$resql=$db->query($sql);
if ($resql)
{
$num = $db->num_rows($resql);
$i = 0;
while ($i < $num)
{
$var=!$var;
$row = $db->fetch_row($resql);
print '<option value="'.$row[0].'"';
print $conf->global->CHARTOFACCOUNTS == $row[0] ? ' selected="selected"':'';
print '>'.$row[1].' - '.$row[3].'</option>';
$i++;
}
}
print "</select>";
print "</td></tr>";
print "</table>";
print "</form>";
}
print "<br>\n";
// Cas des autres param<61>tres COMPTA_*
/*
$sql ="SELECT rowid, name, value, type, note";
$sql.=" FROM ".MAIN_DB_PREFIX."const";
$sql.=" WHERE name like 'COMPTA_%' and name not in ('COMPTA_MODE')";
// Cas des autres parametres COMPTA_*
$list=array('COMPTA_PRODUCT_BUY_ACCOUNT','COMPTA_PRODUCT_SOLD_ACCOUNT','COMPTA_SERVICE_BUY_ACCOUNT','COMPTA_SERVICE_SOLD_ACCOUNT',
'COMPTA_VAT_ACCOUNT','COMPTA_ACCOUNT_CUSTOMER','COMPTA_ACCOUNT_SUPPLIER'
);
/*$sql = "SELECT rowid, name, value, type, note";
$sql.= " FROM ".MAIN_DB_PREFIX."const";
$sql.= " WHERE name LIKE 'COMPTA_%'";
$sql.= " AND name NOT IN ('COMPTA_MODE')";
$sql.= " AND entity = ".$conf->entity;
$result = $db->query($sql);
if ($result)
{
$num = $db->num_rows($result);
$i = 0;
$var=true;
if ($num)
{
print '<table class="noborder" width="100%">';
print '<tr class="liste_titre">';
print '<td colspan="3">'.$langs->trans('OtherOptions').'</td>';
print "</tr>\n";
}
while ($i < $num)
{
$obj = $db->fetch_object($result);
$var=!$var;
print '<form action="compta.php" method="POST">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<input type="hidden" name="action" value="update">';
print '<input type="hidden" name="rowid" value="'.$rowid.'">';
print '<input type="hidden" name="constname" value="'.$obj->name.'">';
print '<tr '.$bc[$var].' class="value">';
print '<td>'.stripslashes(nl2br($obj->note))."</td>\n";
print '<td>';
if ($obj->type == 'yesno')
{
print $form->selectyesno('constvalue',$obj->value,1);
}
elseif ($obj->type == 'texte')
{
print '<textarea name="constvalue" cols="35" rows="5" wrap="soft">';
print $obj->value;
print "</textarea>\n";
}
else
{
print '<input type="text" size="30" name="constvalue" value="'.stripslashes($obj->value).'">';
}
print '</td><td>';
print '<input type="submit" class="button" value="'.$langs->trans('Modify').'" name="button"> &nbsp; ';
print "</td></tr>\n";
print '</form>';
$list[$obj->name]=$obj->value;
$i++;
}
}*/
if ($num)
{
print "</table>\n";
}
$num=count($list);
if ($num)
{
print '<table class="noborder" width="100%">';
print '<tr class="liste_titre">';
print '<td colspan="3">'.$langs->trans('OtherOptions').'</td>';
print "</tr>\n";
}
*/
foreach ($list as $key)
{
$var=!$var;
print '<form action="accounting.php" method="POST">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<input type="hidden" name="action" value="update">';
print '<input type="hidden" name="consttype" value="string">';
print '<input type="hidden" name="constname" value="'.$key.'">';
print '<tr '.$bc[$var].' class="value">';
// Param
$libelle = $langs->trans($key);
print '<td>'.$libelle;
//print ' ('.$key.')';
print "</td>\n";
// Value
print '<td>';
print '<input type="text" size="20" name="constvalue" value="'.$conf->global->$key.'">';
print '</td><td>';
print '<input type="submit" class="button" value="'.$langs->trans('Modify').'" name="button"> &nbsp; ';
print "</td></tr>\n";
print '</form>';
$i++;
}
if ($num)
{
print "</table>\n";
}
dol_htmloutput_mesg($mesg);
$db->close();
llxFooter();
?>

View File

@ -2,7 +2,7 @@
/* Copyright (C) 2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2008 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2009 Regis Houssin <regis@dolibarr.fr>
* Copyright (C) 2011-2012 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2011-2012 Juanjo Menent <jmenent@2byte.es>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by

View File

@ -116,18 +116,18 @@ if ($action == 'add')
$leftmenu=''; $mainmenu='';
if (! empty($_POST['menuId']) && ! is_numeric($_POST['menuId']))
{
$tmp=explode('&',$_POST['menuId']);
foreach($tmp as $s)
{
if (preg_match('/fk_mainmenu=/',$s))
{
$mainmenu=preg_replace('/fk_mainmenu=/','',$s);
}
if (preg_match('/fk_leftmenu=/',$s))
{
$leftmenu=preg_replace('/fk_leftmenu=/','',$s);
}
}
$tmp=explode('&',$_POST['menuId']);
foreach($tmp as $s)
{
if (preg_match('/fk_mainmenu=/',$s))
{
$mainmenu=preg_replace('/fk_mainmenu=/','',$s);
}
if (preg_match('/fk_leftmenu=/',$s))
{
$leftmenu=preg_replace('/fk_leftmenu=/','',$s);
}
}
}
$langs->load("errors");

View File

@ -51,6 +51,7 @@ if ($action == 'set')
$res = dolibarr_del_const($db,"SYSLOG_FILE_ON",0);
$res = dolibarr_del_const($db,"SYSLOG_SYSLOG_ON",0);
$res = dolibarr_del_const($db,"SYSLOG_FIREPHP_ON",0);
$res = dolibarr_del_const($db,"SYSLOG_CHROMEPHP_ON",0);
$syslog_file_on=0;
$syslog_syslog_on=0;

View File

@ -23,7 +23,7 @@
*/
require '../../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
$langs->load("admin");
@ -40,22 +40,22 @@ llxHeader();
$title='InfoPHP';
if (isset($title))
{
print_fiche_titre($langs->trans($title), '', 'setup');
}
if (isset($title))
{
print_fiche_titre($langs->trans($title), '', 'setup');
}
// Get php_info array
// Get php_info array
$phparray=phpinfo_array();
foreach($phparray as $key => $value)
{
//print_titre($key);
print '<table class="noborder">';
print '<tr class="liste_titre">';
print '<table class="noborder">';
print '<tr class="liste_titre">';
//print '<td width="220px">'.$langs->trans("Parameter").'</td>';
print '<td width="220px">'.$key.'</td>';
print '<td colspan="2">'.$langs->trans("Value").'</td>';
print "</tr>\n";
print '<td width="220px">'.$key.'</td>';
print '<td colspan="2">'.$langs->trans("Value").'</td>';
print "</tr>\n";
$var=true;
//var_dump($value);
@ -65,10 +65,10 @@ foreach($phparray as $key => $value)
{
$var=!$var;
print '<tr '.$bc[$var].'>';
print '<td>'.$keyparam.'</td>';
print '<td>'.$keyparam.'</td>';
$valtoshow=$keyvalue;
if ($keyparam == 'X-ChromePhp-Data') $valtoshow=dol_trunc($keyvalue,80);
print '<td colspan="2">'.$valtoshow.'</td>';
print '<td colspan="2">'.$valtoshow.'</td>';
print '</tr>';
}
else
@ -77,13 +77,13 @@ foreach($phparray as $key => $value)
print '<tr '.$bc[$var].'>';
print '<td>'.$keyparam.'</td>';
$i=0;
foreach($keyvalue as $keyparam2 => $keyvalue2)
foreach($keyvalue as $keyparam2 => $keyvalue2)
{
print '<td>';
$valtoshow=$keyvalue2;
if ($keyparam == 'disable_functions') $valtoshow=join(', ',explode(',',trim($valtoshow)));
//print $keyparam2.' = ';
print $valtoshow;
print $valtoshow;
$i++;
print '</td>';
}
@ -92,7 +92,7 @@ foreach($phparray as $key => $value)
}
print '</table><br>';
}
llxFooter();

View File

@ -348,7 +348,7 @@ p.titre {
height: 40px;
}
.bouton_mode_reglement {
.bouton_mode_reglement, .bouton_mode_reglement_disabled {
width: 150px;
height: 40px;
}

View File

@ -56,7 +56,7 @@ if (! empty($conf->stock->enabled) && $conf->global->STOCK_CALCULATE_ON_BILL &&
exit;
}
if (! empty($_POST['txtUsername']) && ! empty($conf->banque->enabled) && (empty($conf_fkaccount_cash) || empty($conf_fkaccount_cheque) || empty($conf_fkaccount_cb)))
if (! empty($_POST['txtUsername']) && ! empty($conf->banque->enabled) && (empty($conf_fkaccount_cash) && empty($conf_fkaccount_cheque) && empty($conf_fkaccount_cb)))
{
$langs->load("errors");
$retour=$langs->trans("ErrorModuleSetupNotComplete");
@ -65,7 +65,6 @@ if (! empty($_POST['txtUsername']) && ! empty($conf->banque->enabled) && (empty(
}
// Check password
$auth = new Auth($db);
$retour = $auth->verif($username, $password);

View File

@ -182,9 +182,32 @@ $langs->load("cashdesk");
<fieldset class="cadre_facturation"><legend class="titre1"><?php echo $langs->trans("PaymentMode"); ?></legend>
<table>
<tr>
<td><input class="bouton_mode_reglement" type="submit" name="btnModeReglement" value="<?php echo $langs->trans("Cash"); ?>" onclick="javascript: verifClic('ESP');" /></td>
<td><input class="bouton_mode_reglement" type="submit" name="btnModeReglement" value="<?php echo $langs->trans("CreditCard"); ?>" onclick="javascript: verifClic('CB');" /></td>
<td><input class="bouton_mode_reglement" type="submit" name="btnModeReglement" value="<?php echo $langs->trans("Cheque"); ?>" onclick="javascript: verifClic('CHQ');" /></td>
<?php
print '<td>';
if (empty($conf->global->CASHDESK_ID_BANKACCOUNT_CASH) || $conf->global->CASHDESK_ID_BANKACCOUNT_CASH < 0)
{
$langs->load("errors");
print '<input class="bouton_mode_reglement_disabled" type="button" name="btnModeReglement" value="'.$langs->trans("Cash").'" title="'.dol_escape_htmltag($langs->trans("ErrorModuleSetupNotComplete")).'" />';
}
else print '<input class="bouton_mode_reglement" type="submit" name="btnModeReglement" value="'.$langs->trans("Cash").'" onclick="javascript: verifClic(\'ESP\');" />';
print '</td>';
print '<td>';
if (empty($conf->global->CASHDESK_ID_BANKACCOUNT_CHEQUE) || $conf->global->CASHDESK_ID_BANKACCOUNT_CHEQUE < 0)
{
$langs->load("errors");
print '<input class="bouton_mode_reglement_disabled" type="button" name="btnModeReglement" value="'.$langs->trans("CreditCard").'" title="'.dol_escape_htmltag($langs->trans("ErrorModuleSetupNotComplete")).'" />';
}
else print '<input class="bouton_mode_reglement" type="submit" name="btnModeReglement" value="'.$langs->trans("CreditCard").'" onclick="javascript: verifClic(\'CB\');" />';
print '</td>';
print '<td>';
if (empty($conf->global->CASHDESK_ID_BANKACCOUNT_CB) || $conf->global->CASHDESK_ID_BANKACCOUNT_CB < 0)
{
$langs->load("errors");
print '<input class="bouton_mode_reglement_disabled" type="button" name="btnModeReglement" value="'.$langs->trans("Cheque").'" title="'.dol_escape_htmltag($langs->trans("ErrorModuleSetupNotComplete")).'" />';
}
else print '<input class="bouton_mode_reglement" type="submit" name="btnModeReglement" value="'.$langs->trans("Cheque").'" onclick="javascript: verifClic(\'CHQ\');" />';
print '</td>';
?>
</tr>
</table>
<table>

View File

@ -20,15 +20,15 @@
/**
* \file htdocs/comm/action/class/actioncomm.class.php
* \ingroup commercial
* \ingroup agenda
* \brief File of class to manage agenda events (actions)
*/
require_once DOL_DOCUMENT_ROOT.'/comm/action/class/cactioncomm.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/commonobject.class.php';
/** \class ActionComm
* \brief Class to manage agenda events (actions)
/**
* Class to manage agenda events (actions)
*/
class ActionComm extends CommonObject
{

View File

@ -18,14 +18,13 @@
/**
* \file htdocs/comm/action/class/cactioncomm.class.php
* \ingroup commercial
* \ingroup agenda
* \brief File of class to manage type of agenda events
*/
/**
* \class CActionComm
* \brief Class to manage different types of events
* Class to manage different types of events
*/
class CActionComm
{

View File

@ -23,6 +23,11 @@
* \ingroup agenda
* \brief File of class to parse ical calendars
*/
/**
* Class to parse ICal calendars
*/
class ICal
{
var $file_text; // Text in file

View File

@ -493,13 +493,29 @@ if ($id > 0)
if ($num > 0)
{
print '<table class="noborder" width="100%">';
// Check if there are orders billable
$sql2 = 'SELECT s.nom, s.rowid as socid, s.client, c.rowid, c.ref, c.total_ht, c.ref_client,';
$sql2.= ' c.date_valid, c.date_commande, c.date_livraison, c.fk_statut, c.facture as facturee';
$sql2.= ' FROM '.MAIN_DB_PREFIX.'societe as s';
$sql2.= ', '.MAIN_DB_PREFIX.'commande as c';
$sql2.= ' WHERE c.fk_soc = s.rowid';
$sql2.= ' AND s.rowid = '.$object->id;
// Show orders with status validated, shipping started and delivered (well any order we can bill)
$sql2.= " AND ((c.fk_statut IN (1,2)) OR (c.fk_statut = 3 AND c.facture = 0))";
$resql2=$db->query($sql2);
$num2 = $db->num_rows($resql2);
$db->free($resql2);
print '<table class="noborder" width="100%">';
print '<tr class="liste_titre">';
print '<td colspan="4"><table width="100%" class="nobordernopadding"><tr><td>'.$langs->trans("LastOrders",($num<=$MAXLIST?"":$MAXLIST)).'</td><td align="right"><a href="'.DOL_URL_ROOT.'/commande/liste.php?socid='.$object->id.'">'.$langs->trans("AllOrders").' ('.$num.')</a></td>';
print '<td width="20px" align="right"><a href="'.DOL_URL_ROOT.'/commande/stats/index.php?socid='.$object->id.'">'.img_picto($langs->trans("Statistics"),'stats').'</a></td>';
print '</tr></table></td>';
print '</tr>';
print '<tr class="liste_titre">';
print '<td colspan="4"><table width="100%" class="nobordernopadding"><tr><td>'.$langs->trans("LastOrders",($num<=$MAXLIST?"":$MAXLIST)).'</td><td align="right"><a href="'.DOL_URL_ROOT.'/commande/liste.php?socid='.$object->id.'">'.$langs->trans("AllOrders").' ('.$num.')</a></td>';
print '<td width="20px" align="right"><a href="'.DOL_URL_ROOT.'/commande/stats/index.php?socid='.$object->id.'">'.img_picto($langs->trans("Statistics"),'stats').'</a></td>';
if($num2 > 0) print '<td width="20px" align="right"><a href="'.DOL_URL_ROOT.'/commande/orderstoinvoice.php?socid='.$object->id.'">'.img_picto($langs->trans("CreateInvoiceForThisCustomer"),'object_bill').'</a></td>';
else print '<td width="20px" align="right"><a href="#">'.img_picto($langs->trans("NoOrdersToInvoice"),'object_bill').'</a></td>';
print '</tr></table></td>';
print '</tr>';
}
$i = 0;

View File

@ -0,0 +1,688 @@
<?php
/* Copyright (C) 2001-2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2011 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005 Marc Barilley / Ocebo <marc@ocebo.com>
* Copyright (C) 2005-2012 Regis Houssin <regis@dolibarr.fr>
* Copyright (C) 2012 Andreu Bisquerra Gaya <jove@bisquerra.com>
* Copyright (C) 2012 David Rodriguez Martinez <davidrm146@gmail.com>
* Copyright (C) 2012 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2012 Maxime Kohlhaas <mko@atm-consulting.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, see <http://www.gnu.org/licenses/>.
*/
/**
* \file htdocs/comm/propal/propalstoorder.php
* \ingroup propal
* \brief Page to order multiple propals
*/
require '../../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php';
require_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php';
require_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/report.lib.php';
if (! empty($conf->projet->enabled)) require_once DOL_DOCUMENT_ROOT.'/core/lib/project.lib.php';
$langs->load('orders');
$langs->load('deliveries');
$langs->load('companies');
if (! $user->rights->commande->creer)
accessforbidden();
$id = (GETPOST('id')?GETPOST("id"):GETPOST("facid")); // For backward compatibility
$ref = GETPOST('ref','alpha');
$action = GETPOST('action','alpha');
$confirm = GETPOST('confirm','alpha');
$sref = GETPOST('sref');
$sref_client = GETPOST('sref_client');
$sall = GETPOST('sall');
$socid = GETPOST('socid','int');
$sortfield = GETPOST("sortfield",'alpha');
$sortorder = GETPOST("sortorder",'alpha');
if (! $sortfield) $sortfield='p.rowid';
if (! $sortorder) $sortorder='DESC';
$date_start=dol_mktime(0,0,0,$_REQUEST["date_startmonth"],$_REQUEST["date_startday"],$_REQUEST["date_startyear"]); // Date for local PHP server
$date_end=dol_mktime(23,59,59,$_REQUEST["date_endmonth"],$_REQUEST["date_endday"],$_REQUEST["date_endyear"]);
$date_starty=dol_mktime(0,0,0,$_REQUEST["date_start_delymonth"],$_REQUEST["date_start_delyday"],$_REQUEST["date_start_delyyear"]); // Date for local PHP server
$date_endy=dol_mktime(23,59,59,$_REQUEST["date_end_delymonth"],$_REQUEST["date_end_delyday"],$_REQUEST["date_end_delyyear"]);
$selected=GETPOST('propals_to_order');
$action=GETPOST('action','alpha');
if ($action == 'create')
{
if (! is_array($selected))
{
$mesgs[]='<div class="error">'.$langs->trans('Error_OrderNotChecked').'</div>';
}
else
{
$socid=GETPOST('socid');
$action=GETPOST('action');
$origin=GETPOST('origin');
$originid=GETPOST('originid');
}
}
$now=dol_now();
$viewstatut=GETPOST('viewstatut');
/*
* Actions
*/
if (($action == 'create' || $action == 'add') && empty($mesgs))
{
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/modules/facture/modules_facture.php';
require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/discount.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/invoice.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
if (! empty($conf->projet->enabled)) {
require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/project.lib.php';
}
$langs->load('bills');
$langs->load('products');
$langs->load('main');
if (isset($_GET['propals_to_order']))
{
$orders_id = $_GET['propals_to_order'];
$n = count($orders_id);
$i = 0;
$originid=$orders_id[0];
$_GET['originid']=$orders_id[0];
}
if (isset($_POST['propals_to_order']))
{
$orders_id = $_POST['propals_to_order'];
$nn = count($orders_id);
$ii = 0;
$originid=$orders_id[0];
$_POST['originid']=$orders_id[0];
}
$projectid = GETPOST('projectid','int')?GETPOST('projectid','int'):0;
$lineid = GETPOST('lineid','int');
$userid = GETPOST('userid','int');
$search_ref = GETPOST('sf_ref')?GETPOST('sf_ref'):GETPOST('search_ref');
$closeOrders = GETPOST('autocloseorders') != '' ? true : false;
// Security check
$fieldid = GETPOST('ref','alpha')?'facnumber':'rowid';
if ($user->societe_id) $socid=$user->societe_id;
$result = restrictedArea($user, 'facture', $id,'','','fk_soc',$fieldid);
$usehm=$conf->global->MAIN_USE_HOURMIN_IN_DATE_RANGE;
$object=new Facture($db);
// Insert new invoice in database
if ($action == 'add' && $user->rights->facture->creer)
{
$object->socid=GETPOST('socid');
$db->begin();
$error=0;
// Standard or deposit or proforma invoice
if ($_POST['type'] == 0 )
{
$datefacture = dol_mktime(12, 0, 0, $_POST['remonth'], $_POST['reday'], $_POST['reyear']);
if (empty($datefacture))
{
$datefacture = dol_mktime(12, 0, 0, date("m"), date("d"), date("Y"));
}
if (! $error)
{
// Si facture standard
$object->socid = $_POST['socid'];
$object->type = $_POST['type'];
$object->number = $_POST['facnumber'];
$object->date = $datefacture;
$object->note_public = trim($_POST['note_public']);
$object->note = trim($_POST['note']);
$object->ref_client = $_POST['ref_client'];
$object->ref_int = $_POST['ref_int'];
$object->modelpdf = $_POST['model'];
$object->fk_project = $_POST['projectid'];
$object->cond_reglement_id = ($_POST['type'] == 3?1:$_POST['cond_reglement_id']);
$object->mode_reglement_id = $_POST['mode_reglement_id'];
$object->amount = $_POST['amount'];
$object->remise_absolue = $_POST['remise_absolue'];
$object->remise_percent = $_POST['remise_percent'];
if ($_POST['origin'] && $_POST['originid'])
{
$object->origin = $_POST['origin'];
$object->origin_id = $orders_id[$ii];
$object->linked_objects = $orders_id;
$id = $object->create($user);
if ($id>0)
{
foreach($orders_id as $origin => $origin_id)
{
$origin_id = (! empty($origin_id) ? $origin_id : $object->origin_id);
$db->begin();
$sql = "INSERT INTO ".MAIN_DB_PREFIX."element_element (";
$sql.= "fk_source";
$sql.= ", sourcetype";
$sql.= ", fk_target";
$sql.= ", targettype";
$sql.= ") VALUES (";
$sql.= $origin_id;
$sql.= ", '".$object->origin."'";
$sql.= ", ".$id;
$sql.= ", '".$object->element."'";
$sql.= ")";
if ($db->query($sql))
{
$db->commit();
}
else
{
$db->rollback();
}
}
while ($ii < $nn)
{
dol_include_once('/commande/class/commande.class.php');
$srcobject = new Commande($db);
dol_syslog("Try to find source object origin=".$object->origin." originid=".$object->origin_id." to add lines");
$result=$srcobject->fetch($orders_id[$ii]);
if ($result > 0)
{
if($closeOrders) {
$srcobject->classer_facturee();
$srcobject->setStatut(3);
}
$lines = $srcobject->lines;
if (empty($lines) && method_exists($srcobject,'fetch_lines')) $lines = $srcobject->fetch_lines();
$fk_parent_line=0;
$num=count($lines);
for ($i=0;$i<$num;$i++)
{
$desc=($lines[$i]->desc?$lines[$i]->desc:$lines[$i]->libelle);
if ($lines[$i]->subprice < 0)
{
// Negative line, we create a discount line
$discount = new DiscountAbsolute($db);
$discount->fk_soc=$object->socid;
$discount->amount_ht=abs($lines[$i]->total_ht);
$discount->amount_tva=abs($lines[$i]->total_tva);
$discount->amount_ttc=abs($lines[$i]->total_ttc);
$discount->tva_tx=$lines[$i]->tva_tx;
$discount->fk_user=$user->id;
$discount->description=$desc;
$discountid=$discount->create($user);
if ($discountid > 0)
{
$result=$object->insert_discount($discountid);
//$result=$discount->link_to_invoice($lineid,$id);
}
else
{
$mesgs[]=$discount->error;
$error++;
break;
}
}
else
{
// Positive line
$product_type=($lines[$i]->product_type?$lines[$i]->product_type:0);
// Date start
$date_start=false;
if ($lines[$i]->date_debut_prevue) $date_start=$lines[$i]->date_debut_prevue;
if ($lines[$i]->date_debut_reel) $date_start=$lines[$i]->date_debut_reel;
if ($lines[$i]->date_start) $date_start=$lines[$i]->date_start;
//Date end
$date_end=false;
if ($lines[$i]->date_fin_prevue) $date_end=$lines[$i]->date_fin_prevue;
if ($lines[$i]->date_fin_reel) $date_end=$lines[$i]->date_fin_reel;
if ($lines[$i]->date_end) $date_end=$lines[$i]->date_end;
// Reset fk_parent_line for no child products and special product
if (($lines[$i]->product_type != 9 && empty($lines[$i]->fk_parent_line)) || $lines[$i]->product_type == 9)
{
$fk_parent_line = 0;
}
$result = $object->addline(
$id,
$desc,
$lines[$i]->subprice,
$lines[$i]->qty,
$lines[$i]->tva_tx,
$lines[$i]->localtax1_tx,
$lines[$i]->localtax2_tx,
$lines[$i]->fk_product,
$lines[$i]->remise_percent,
$date_start,
$date_end,
0,
$lines[$i]->info_bits,
$lines[$i]->fk_remise_except,
'HT',
0,
$product_type,
$lines[$i]->rang,
$lines[$i]->special_code,
$object->origin,
$lines[$i]->rowid,
$fk_parent_line
);
if ($result > 0)
{
$lineid=$result;
}
else
{
$lineid=0;
$error++;
break;
}
// Defined the new fk_parent_line
if ($result > 0 && $lines[$i]->product_type == 9)
{
$fk_parent_line = $result;
}
}
}
}
else
{
$mesgs[]=$srcobject->error;
$error++;
}
$ii++;
}
}
else
{
$mesgs[]=$object->error;
$error++;
}
}
}
}
// End of object creation, we show it
if ($id > 0 && ! $error)
{
$db->commit();
header('Location: '.DOL_URL_ROOT.'/compta/facture.php?facid='.$id);
exit;
}
else
{
$db->rollback();
$action='create';
$_GET["origin"]=$_POST["origin"];
$_GET["originid"]=$_POST["originid"];
$mesgs[]='<div class="error">'.$object->error.'</div>';
}
}
}
/*
* View
*/
$html = new Form($db);
$htmlother = new FormOther($db);
$formfile = new FormFile($db);
$companystatic = new Societe($db);
// Mode creation
if ($action == 'create')
{
$facturestatic=new Facture($db);
llxHeader();
print_fiche_titre($langs->trans('NewBill'));
$soc = new Societe($db);
if ($socid) $res=$soc->fetch($socid);
if ($res)
{
$cond_reglement_id = $soc->cond_reglement_id;
$mode_reglement_id = $soc->mode_reglement_id;
$remise_percent = $soc->remise_percent;
}
$remise_absolue = 0;
$dateinvoice = empty($conf->global->MAIN_AUTOFILL_DATE)?-1:0;
$absolute_discount=$soc->getAvailableDiscounts();
print '<form name="add" action="'.$_SERVER["PHP_SELF"].'" method="POST">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<input type="hidden" name="action" value="add">';
print '<input type="hidden" name="socid" value="'.$soc->id.'">' ."\n";
print '<input name="facnumber" type="hidden" value="provisoire">';
print '<input name="ref_client" type="hidden" value="'.$ref_client.'">';
print '<input name="ref_int" type="hidden" value="'.$ref_int.'">';
print '<input type="hidden" name="origin" value="'.GETPOST('origin').'">';
print '<input type="hidden" name="originid" value="'.GETPOST('originid').'">';
print '<input type="hidden" name="autocloseorders" value="'.GETPOST('autocloseorders').'">';
print '<table class="border" width="100%">';
// Ref
print '<tr><td class="fieldrequired">'.$langs->trans('Ref').'</td><td colspan="2">'.$langs->trans('Draft').'</td></tr>';
// Tiers
print '<tr><td class="fieldrequired">'.$langs->trans('Customer').'</td><td colspan="2">';
print $soc->getNomUrl(1);
print '<input type="hidden" name="socid" value="'.$soc->id.'">';
print '</td>';
print '</tr>'."\n";
print '<tr><td valign="top" class="fieldrequired">'.$langs->trans('Type').'</td><td colspan="2">';
print '<table class="nobordernopadding">'."\n";
// Standard invoice
print '<tr height="18"><td width="16px" valign="middle">';
print '<input type="radio" name="type" value="0"'.(GETPOST('type')==0?' checked="true"':'').'>';
print '</td><td valign="middle">';
$desc=$html->textwithpicto($langs->trans("InvoiceStandardAsk"),$langs->transnoentities("InvoiceStandardDesc"),1);
print $desc;
print '</td></tr>'."\n";
print '</table>';
// Date invoice
print '<tr><td class="fieldrequired">'.$langs->trans('Date').'</td><td colspan="2">';
$html->select_date(0,'','','','',"add",1,1);
print '</td></tr>';
// Payment term
print '<tr><td nowrap>'.$langs->trans('PaymentConditionsShort').'</td><td colspan="2">';
$html->select_conditions_paiements(isset($_POST['cond_reglement_id'])?$_POST['cond_reglement_id']:$cond_reglement_id,'cond_reglement_id');
print '</td></tr>';
// Payment mode
print '<tr><td>'.$langs->trans('PaymentMode').'</td><td colspan="2">';
$html->select_types_paiements(isset($_POST['mode_reglement_id'])?$_POST['mode_reglement_id']:$mode_reglement_id,'mode_reglement_id');
print '</td></tr>';
// Project
if (! empty($conf->projet->enabled))
{
$langs->load('projects');
print '<tr><td>'.$langs->trans('Project').'</td><td colspan="2">';
select_projects($soc->id, $projectid, 'projectid');
print '</td></tr>';
}
// Modele PDF
print '<tr><td>'.$langs->trans('Model').'</td>';
print '<td>';
include_once DOL_DOCUMENT_ROOT.'/core/modules/facture/modules_facture.php';
$liste=ModelePDFFactures::liste_modeles($db);
print $html->selectarray('model',$liste,$conf->global->FACTURE_ADDON_PDF);
print "</td></tr>";
// Public note
print '<tr>';
print '<td class="border" valign="top">'.$langs->trans('NotePublic').'</td>';
print '<td valign="top" colspan="2">';
print '<textarea name="note_public" wrap="soft" cols="70" rows="'.ROWS_3.'">';
dol_include_once('/commande/class/commande.class.php');
$srcobject = new Commande($db);
$commandes = $langs->trans("Orders").": ";
foreach ($selected as $sel)
{
$result=$srcobject->fetch($sel);
if ($result > 0)
{
$commandes.= $srcobject->ref.", ";
}
}
print $commandes;
print '</textarea></td></tr>';
// Private note
if (! $user->societe_id)
{
print '<tr>';
print '<td class="border" valign="top">'.$langs->trans('NotePrivate').'</td>';
print '<td valign="top" colspan="2">';
print '<textarea name="note" wrap="soft" cols="70" rows="'.ROWS_3.'">';
print '</textarea></td></tr>';
}
print '</table>';
while ($i < $n)
{
print '<input type="hidden" name="propals_to_order[]" value="'.$orders_id[$i].'">';
$i++;
}
// Button "Create Draft"
print '<br><center><input type="submit" class="button" name="bouton" value="'.$langs->trans('CreateDraft').'" /></center>';
print "</form>\n";
print '</td></tr>';
print "</table>\n";
}
//Mode liste
if (($action != 'create' && $action != 'add') || ! empty($mesgs))
{
llxHeader();
?>
<script type="text/javascript">
jQuery(document).ready(function() {
jQuery("#checkall").click(function() {
jQuery(".checkformerge").attr('checked', true);
});
jQuery("#checknone").click(function() {
jQuery(".checkformerge").attr('checked', false);
});
});
</script>
<?php
$sql = 'SELECT s.nom, s.rowid as socid, s.client, p.rowid, p.ref, p.total_ht, p.ref_client,';
$sql.= ' p.date_valid, p.fin_validite, p.fk_statut';
$sql.= ' FROM '.MAIN_DB_PREFIX.'societe as s';
$sql.= ', '.MAIN_DB_PREFIX.'propal as p';
if (!$user->rights->societe->client->voir && !$socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
$sql.= ' WHERE p.entity = '.$conf->entity;
$sql.= ' AND p.fk_soc = s.rowid';
// Show orders with status validated, shipping started and delivered (well any order we can bill)
$sql.= " AND p.fk_statut IN (1,2)";
if ($socid) $sql.= ' AND s.rowid = '.$socid;
if (!$user->rights->societe->client->voir && !$socid) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id;
if ($sref)
{
$sql.= " AND p.ref LIKE '%".$db->escape($sref)."%'";
}
if ($sall)
{
$sql.= " AND (p.ref LIKE '%".$db->escape($sall)."%' OR p.note LIKE '%".$db->escape($sall)."%')";
}
//Date filter
if ($date_start && $date_end) $sql.= " AND p.date_valid >= '".$db->idate($date_start)."' AND p.date_valid <= '".$db->idate($date_end)."'";
if ($date_starty && $date_endy) $sql.= " AND p.fin_validite >= '".$db->idate($date_starty)."' AND p.fin_validite <= '".$db->idate($date_endy)."'";
if (!empty($sref_client))
{
$sql.= ' AND p.ref_client LIKE \'%'.$db->escape($sref_client).'%\'';
}
$sql.= ' ORDER BY '.$sortfield.' '.$sortorder;
$resql = $db->query($sql);
if ($resql)
{
if ($socid)
{
$soc = new Societe($db);
$soc->fetch($socid);
}
$title.= $langs->trans('ListOfProposals').' - '.$langs->trans('PropalStatusOpened').', '.$langs->trans("PropalStatusSigned");
$num = $db->num_rows($resql);
print_fiche_titre($title);
$i = 0;
$period=$html->select_date($date_start,'date_start',0,0,1,'',1,0,1).' - '.$html->select_date($date_end,'date_end',0,0,1,'',1,0,1);
$periodely=$html->select_date($date_starty,'date_start_dely',0,0,1,'',1,0,1).' - '.$html->select_date($date_endy,'date_end_dely',0,0,1,'',1,0,1);
if (! empty($socid))
{
// Company
$companystatic->id=$socid;
$companystatic->nom=$soc->nom;
print '<h3>'.$companystatic->getNomUrl(1,'customer').'</h3>';
}
print '<table class="noborder" width="100%">';
print '<tr class="liste_titre">';
print_liste_field_titre($langs->trans('Ref'),'propalstoorder.php','p.ref','','&amp;socid='.$socid,'',$sortfield,$sortorder);
print_liste_field_titre($langs->trans('RefCustomerOrder'),'propalstoorder.php','p.ref_client','','&amp;socid='.$socid,'',$sortfield,$sortorder);
print_liste_field_titre($langs->trans('Date'),'propalstoorder.php','p.date_valid','','&amp;socid='.$socid, 'align="center"',$sortfield,$sortorder);
print_liste_field_titre($langs->trans('DateEndPropal'),'propalstoorder.php','p.fin_validite','','&amp;socid='.$socid, 'align="center"',$sortfield,$sortorder);
print_liste_field_titre($langs->trans('Status'),'','','','','align="right"');
print_liste_field_titre($langs->trans('GenerateBill'),'','','','','align="center"');
print '</tr>';
// Lignes des champs de filtre
print '<form method="get" action="propalstoorder.php">';
print '<input type="hidden" name="socid" value="'.$socid.'">';
print '<tr class="liste_titre">';
print '<td class="liste_titre">';
//REF
print '<input class="flat" size="10" type="text" name="sref" value="'.$sref.'">';
print '</td>';
//print '<td class="liste_titre">';
print '<td class="liste_titre" align="left">';
print '<input class="flat" type="text" size="10" name="sref_client" value="'.$sref_client.'">';
//DATE ORDER
print '<td class="liste_titre" align="center">';
print $period;
print '</td>';
//DATE DELIVERY
print '<td class="liste_titre" align="center">';
print $periodely;
print '</td>';
//SEARCH BUTTON
print '</td><td align="right" class="liste_titre">';
print '<input type="image" class="liste_titre" name="button_search" src="'.DOL_URL_ROOT.'/theme/'.$conf->theme.'/img/search.png" value="'.dol_escape_htmltag($langs->trans("Search")).'" title="'.dol_escape_htmltag($langs->trans("Search")).'">';
//ALL/NONE
print '<td class="liste_titre" align="center">';
if ($conf->use_javascript_ajax) print '<a href="#" id="checkall">'.$langs->trans("All").'</a> / <a href="#" id="checknone">'.$langs->trans("None").'</a>';
print '</td>';
print '</td></tr>';
print '</form>';
print '<form name="propals2order" action="propalstoorder.php" method="GET">';
$var=True;
$generic_propal = new Propal($db);
while ($i < $num)
{
$objp = $db->fetch_object($resql);
$var=!$var;
print '<tr '.$bc[$var].'>';
print '<td nowrap="nowrap">';
$generic_propal->id=$objp->rowid;
$generic_propal->ref=$objp->ref;
print '<table class="nobordernopadding"><tr class="nocellnopadd">';
print '<td class="nobordernopadding" nowrap="nowrap">';
print $generic_propal->getNomUrl(1);
print '</td>';
print '<td width="20" class="nobordernopadding" nowrap="nowrap">';
if (($objp->fk_statut > 0) && ($objp->fk_statut < 3) && $db->jdate($objp->fin_validite) < ($now - $conf->propal->client->warning_delay)) print img_picto($langs->trans("Late"),"warning");
print '</td>';
print '<td width="16" align="right" class="nobordernopadding">';
$filename=dol_sanitizeFileName($objp->ref);
$filedir=$conf->propal->dir_output . '/' . dol_sanitizeFileName($objp->ref);
$urlsource=$_SERVER['PHP_SELF'].'?id='.$objp->rowid;
print $formfile->getDocumentsLink($generic_propal->element, $filename, $filedir);
print '</td></tr></table>';
print '</td>';
print '<td>'.$objp->ref_client.'</td>';
// Validation date
print '<td align="center" nowrap>';
print dol_print_date($db->jdate($objp->date_valid),'day');
print '</td>';
// Limit valid date
print '<td align="center" nowrap>';
print dol_print_date($db->jdate($objp->fin_validite),'day');
print '</td>';
// Statut
print '<td align="right" nowrap="nowrap">'.$generic_propal->LibStatut($objp->fk_statut,5).'</td>';
// Checkbox
print '<td align="center">';
print '<input class="flat checkformerge" type="checkbox" name="propals_to_order[]" value="'.$objp->rowid.'">';
print '</td>' ;
print '</tr>';
$total = $total + $objp->price;
$subtotal = $subtotal + $objp->price;
$i++;
}
print '</table>';
/*
* Boutons actions
*/
print '<div align="right">';
print '<input type="hidden" name="socid" value="'.$socid.'">';
print '<input type="hidden" name="action" value="create">';
print '<input type="hidden" name="origin" value="propal"><br>';
print '<a class="butAction" href="index.php">'.$langs->trans("GoBack").'</a>';
print '<input type="submit" class="button" value='.$langs->trans("GenerateOrder").'>';
print '<center><br><input type="checkbox" checked="checked" name="autoclosepropals"> '.$langs->trans("ClosePropalsAutomatically");
print '</div>';
print '</form>';
$db->free($resql);
}
else
{
print dol_print_error($db);
}
}
dol_htmloutput_mesg($mesg,$mesgs);
llxFooter();
$db->close();
?>

View File

@ -2529,10 +2529,10 @@ class Commande extends CommonOrder
* Return clicable link of object (with eventually picto)
*
* @param int $withpicto Add picto into link
* @param int $option Where point the link
* @param int $option Where point the link (0=> main card, 1,2 => shipment)
* @param int $max Max length to show
* @param int $short Use short labels
* @return string String with URL
* @return string String with URL
*/
function getNomUrl($withpicto=0,$option=0,$max=0,$short=0)
{

View File

@ -126,7 +126,7 @@ if ($sall)
}
if ($viewstatut <> '')
{
if ($viewstatut < 4 && $viewstatut > -2)
if ($viewstatut < 4 && $viewstatut > -3)
{
$sql.= ' AND c.fk_statut ='.$viewstatut; // brouillon, validee, en cours, annulee
if ($viewstatut == 3)
@ -143,6 +143,11 @@ if ($viewstatut <> '')
//$sql.= ' AND c.fk_statut IN (1,2,3) AND c.facture = 0';
$sql.= " AND ((c.fk_statut IN (1,2)) OR (c.fk_statut = 3 AND c.facture = 0))"; // If status is 2 and facture=1, it must be selected
}
if ($viewstatut == -3) // To bill
{
$sql.= ' AND c.fk_statut in (1,2,3)';
$sql.= ' AND c.facture = 0'; // invoice not created
}
}
if ($ordermonth > 0)
{
@ -215,6 +220,8 @@ if ($resql)
$title.=' - '.$langs->trans('StatusOrderCanceledShort');
if ($viewstatut == -2)
$title.=' - '.$langs->trans('StatusOrderToProcessShort');
if ($viewstatut == -3)
$title.=' - '.$langs->trans('StatusOrderValidated').', '.$langs->trans("StatusOrderSent").', '.$langs->trans('StatusOrderToBill');
$param='&socid='.$socid.'&viewstatut='.$viewstatut;
if ($ordermonth) $param.='&ordermonth='.$ordermonth;
@ -233,6 +240,7 @@ if ($resql)
// Lignes des champs de filtre
print '<form method="GET" action="'.$_SERVER["PHP_SELF"].'">';
print '<input type="hidden" name="viewstatut" value="'.$viewstatut.'">';
print '<table class="noborder" width="100%">';
@ -297,7 +305,7 @@ if ($resql)
print '<table class="nobordernopadding"><tr class="nocellnopadd">';
print '<td class="nobordernopadding" nowrap="nowrap">';
print $generic_commande->getNomUrl(1,$objp->fk_statut);
print $generic_commande->getNomUrl(1,($viewstatut != 2?0:$objp->fk_statut));
print '</td>';
print '<td width="20" class="nobordernopadding" nowrap="nowrap">';

View File

@ -40,12 +40,12 @@ $langs->load('orders');
$langs->load('deliveries');
$langs->load('companies');
if (! $user->rights->facture->creer)
if (! $user->rights->facture->creer)
accessforbidden();
$id = (GETPOST('id')?GETPOST("id"):GETPOST("facid")); // For backward compatibility
$ref = GETPOST('ref','alpha');
$action = GETPOST('action','alpha');
$id = (GETPOST('id')?GETPOST("id"):GETPOST("facid")); // For backward compatibility
$ref = GETPOST('ref','alpha');
$action = GETPOST('action','alpha');
$confirm = GETPOST('confirm','alpha');
$sref = GETPOST('sref');
$sref_client = GETPOST('sref_client');
@ -152,7 +152,7 @@ if (($action == 'create' || $action == 'add') && empty($mesgs))
$datefacture = dol_mktime(12, 0, 0, $_POST['remonth'], $_POST['reday'], $_POST['reyear']);
if (empty($datefacture))
{
$datefacture = dol_mktime(12, 0, 0, date("m"), date("d"), date("Y"));
$datefacture = dol_mktime(date("h"), date("M"), 0, date("m"), date("d"), date("Y"));
}
if (! $error)
{
@ -388,16 +388,21 @@ if ($action == 'create')
print '<input type="hidden" name="originid" value="'.GETPOST('originid').'">';
print '<input type="hidden" name="autocloseorders" value="'.GETPOST('autocloseorders').'">';
print '<table class="border" width="100%">';
// Ref
print '<tr><td class="fieldrequired">'.$langs->trans('Ref').'</td><td colspan="2">'.$langs->trans('Draft').'</td></tr>';
// Tiers
// Third party
print '<tr><td class="fieldrequired">'.$langs->trans('Customer').'</td><td colspan="2">';
print $soc->getNomUrl(1);
print '<input type="hidden" name="socid" value="'.$soc->id.'">';
print '</td>';
print '</tr>'."\n";
// Type
print '<tr><td valign="top" class="fieldrequired">'.$langs->trans('Type').'</td><td colspan="2">';
print '<table class="nobordernopadding">'."\n";
// Standard invoice
print '<tr height="18"><td width="16px" valign="middle">';
print '<input type="radio" name="type" value="0"'.(GETPOST('type')==0?' checked="true"':'').'>';
@ -406,7 +411,7 @@ if ($action == 'create')
print $desc;
print '</td></tr>'."\n";
print '</table>';
// Date invoice
print '<tr><td class="fieldrequired">'.$langs->trans('Date').'</td><td colspan="2">';
$html->select_date(0,'','','','',"add",1,1);
@ -443,16 +448,16 @@ if ($action == 'create')
dol_include_once('/commande/class/commande.class.php');
$srcobject = new Commande($db);
$commandes = $langs->trans("Orders").": ";
$listoforders = '';
foreach ($selected as $sel)
{
$result=$srcobject->fetch($sel);
if ($result > 0)
{
$commandes.= $srcobject->ref.", ";
$listoforders .= ($listoforders?', ':'').$srcobject->ref;
}
}
print $commandes;
print $langs->trans("Orders").": ".$listoforders;
print '</textarea></td></tr>';
// Private note
@ -478,7 +483,7 @@ if ($action == 'create')
// Button "Create Draft"
print '<br><center><input type="submit" class="button" name="bouton" value="'.$langs->trans('CreateDraft').'" /></center>';
print "</form>\n";
print '</td></tr>';
print "</table>\n";
}
@ -540,12 +545,8 @@ if (($action != 'create' && $action != 'add') || ! empty($mesgs))
{
$soc = new Societe($db);
$soc->fetch($socid);
$title = $langs->trans('ListOfOrders');
}
else
{
$title = $langs->trans('ListOfOrders');
}
$title = $langs->trans('ListOfOrders');
$title.=' - '.$langs->trans('StatusOrderValidated').', '.$langs->trans("StatusOrderSent").', '.$langs->trans('StatusOrderToBill');
$num = $db->num_rows($resql);
print_fiche_titre($title);
@ -667,13 +668,13 @@ if (($action != 'create' && $action != 'add') || ! empty($mesgs))
/*
* Boutons actions
*/
print '<center><br><input type="checkbox" checked="checked" name="autocloseorders"> '.$langs->trans("CloseProcessedOrdersAutomatically");
print '<div align="right">';
print '<input type="hidden" name="socid" value="'.$socid.'">';
print '<input type="hidden" name="action" value="create">';
print '<input type="hidden" name="origin" value="commande"><br>';
print '<a class="butAction" href="index.php">'.$langs->trans("GoBack").'</a>';
print '<input type="submit" class="button" value='.$langs->trans("GenerateBill").'>';
print '<center><br><input type="checkbox" checked="checked" name="autocloseorders"> '.$langs->trans("CloseProcessedOrdersAutomatically");
//print '<a class="butAction" href="index.php">'.$langs->trans("GoBack").'</a>';
print '<input type="submit" class="butAction" value="'.$langs->trans("GenerateBill").'">';
print '</div>';
print '</form>';
$db->free($resql);

View File

@ -510,7 +510,6 @@ if ($id > 0 || ! empty($ref))
// Payment type
print "<td nowrap>";
$label=($langs->trans("PaymentTypeShort".$objp->fk_type)!="PaymentTypeShort".$objp->fk_type)?$langs->trans("PaymentTypeShort".$objp->fk_type):$objp->fk_type;
// $label=$langs->getTradFromKey("PaymentTypeShort".$objp->fk_type);
if ($objp->fk_type == 'SOLD') $label='&nbsp;';
print $label;

View File

@ -1856,8 +1856,8 @@ if ($action == 'create')
{
$newinvoice_static->id=$key;
$newinvoice_static->ref=$valarray['ref'];
$newinvoice_static->statut=$valarray['status'];
$newinvoice_static->type=$valarray['type'];
$newinvoice_static->statut=$valarray['status'];
$newinvoice_static->type=$valarray['type'];
$newinvoice_static->paye=$valarray['paye'];
$optionsav.='<option value="'.$key.'"';

View File

@ -410,6 +410,7 @@ class FactureRec extends Facture
* @param int $type Type of line (0=product, 1=service)
* @param int $rang Position of line
* @param int $special_code Special code
* @param string $label Label of the line
* @return int <0 if KO, Id of line if OK
*/
function addline($facid, $desc, $pu_ht, $qty, $txtva, $fk_product=0, $remise_percent=0, $price_base_type='HT', $info_bits=0, $fk_remise_except='', $pu_ttc=0, $type=0, $rang=-1, $special_code=0, $label='')

View File

@ -1880,6 +1880,7 @@ class Facture extends CommonInvoice
* @param int $fk_parent_line Id of parent line
* @param int $fk_fournprice To calculate margin
* @param int $pa_ht Buying price of line
* @param string $label Label of the line
* @return int <0 if KO, Id of line if OK
*/
function addline($facid, $desc, $pu_ht, $qty, $txtva, $txlocaltax1=0, $txlocaltax2=0, $fk_product=0, $remise_percent=0, $date_start='', $date_end='', $ventil=0, $info_bits=0, $fk_remise_except='', $price_base_type='HT', $pu_ttc=0, $type=0, $rang=-1, $special_code=0, $origin='', $origin_id=0, $fk_parent_line=0, $fk_fournprice=null, $pa_ht=0, $label='')
@ -2035,6 +2036,7 @@ class Facture extends CommonInvoice
* @param int $skip_update_total ???
* @param int $fk_fournprice To calculate margin
* @param int $pa_ht Buying price of line
* @param string $label Label of the line
* @return int < 0 if KO, > 0 if OK
*/
function updateline($rowid, $desc, $pu, $qty, $remise_percent, $date_start, $date_end, $txtva, $txlocaltax1=0, $txlocaltax2=0, $price_base_type='HT', $info_bits=0, $type=0, $fk_parent_line=0, $skip_update_total=0, $fk_fournprice=null, $pa_ht=0, $label='')

View File

@ -0,0 +1,213 @@
<?php
/** a mettre dans facture.php **/
// Affichage d'autres éléments ajoutables à la facture
if($conf->global->FACTURE_MULTI_ORIGIN) include_once(DOL_DOCUMENT_ROOT.'/compta/facture_multi_origin.php');
if(empty($origin)) return 0;
else if ($origin == 'commande') {
// Show other origin objects mergeable into same invoice
print_titre($langs->trans('OtherOrders'));
// Display list of elements
// 1 - Filters
$sref = GETPOST('sref');
$sref_client = GETPOST('sref_client');
$sall = GETPOST('sall');
$date_start=dol_mktime(0,0,0,$_REQUEST["date_startmonth"],$_REQUEST["date_startday"],$_REQUEST["date_startyear"]); // Date for local PHP server
$date_end=dol_mktime(23,59,59,$_REQUEST["date_endmonth"],$_REQUEST["date_endday"],$_REQUEST["date_endyear"]);
$date_starty=dol_mktime(0,0,0,$_REQUEST["date_start_delymonth"],$_REQUEST["date_start_delyday"],$_REQUEST["date_start_delyyear"]); // Date for local PHP server
$date_endy=dol_mktime(23,59,59,$_REQUEST["date_end_delymonth"],$_REQUEST["date_end_delyday"],$_REQUEST["date_end_delyyear"]);
$sortfield = GETPOST("sortfield",'alpha');
$sortorder = GETPOST("sortorder",'alpha');
if (! $sortfield) $sortfield='c.rowid';
if (! $sortorder) $sortorder='DESC';
$html = new Form($db);
$htmlother = new FormOther($db);
$formfile = new FormFile($db);
$companystatic = new Societe($db);
// 2 - Query for orders
$sql = 'SELECT s.nom, s.rowid as socid, s.client, c.rowid, c.ref, c.total_ht, c.ref_client,';
$sql.= ' c.date_valid, c.date_commande, c.date_livraison, c.fk_statut, c.facture as facturee';
$sql.= ' FROM '.MAIN_DB_PREFIX.'societe as s';
$sql.= ', '.MAIN_DB_PREFIX.'commande as c';
if (!$user->rights->societe->client->voir && !$socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
$sql.= ' WHERE c.entity = '.$conf->entity;
$sql.= ' AND c.fk_soc = s.rowid';
// Show orders with status validated, shipping started and delivered (well any order we can bill)
$sql.= " AND ((c.fk_statut IN (1,2)) OR (c.fk_statut = 3 AND c.facture = 0))";
if ($socid) $sql.= ' AND s.rowid = '.$socid;
if (!$user->rights->societe->client->voir && !$socid) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id;
if ($sref)
{
$sql.= " AND c.ref LIKE '%".$db->escape($sref)."%'";
}
if ($sall)
{
$sql.= " AND (c.ref LIKE '%".$db->escape($sall)."%' OR c.note LIKE '%".$db->escape($sall)."%')";
}
if (!empty($sref_client))
{
$sql.= ' AND c.ref_client LIKE \'%'.$db->escape($sref_client).'%\'';
}
// Date filter
if ($date_start && $date_end) $sql.= " AND c.date_commande >= '".$db->idate($date_start)."' AND c.date_commande <= '".$db->idate($date_end)."'";
if ($date_starty && $date_endy) $sql.= " AND c.date_livraison >= '".$db->idate($date_starty)."' AND c.date_livraison <= '".$db->idate($date_endy)."'";
$sql.= ' ORDER BY '.$sortfield.' '.$sortorder;
$resql = $db->query($sql);
if ($resql)
{
if ($socid)
{
$soc = new Societe($db);
$soc->fetch($socid);
}
$num = $db->num_rows($resql);
$i = 0;
$period=$html->select_date($date_start,'date_start',0,0,1,'',1,0,1).' - '.$html->select_date($date_end,'date_end',0,0,1,'',1,0,1);
$periodely=$html->select_date($date_starty,'date_start_dely',0,0,1,'',1,0,1).' - '.$html->select_date($date_endy,'date_end_dely',0,0,1,'',1,0,1);
print '<table class="noborder" width="100%">';
print '<tr class="liste_titre">';
print_liste_field_titre($langs->trans('Ref'),'orderstoinvoice.php','c.ref','','&amp;socid='.$socid,'',$sortfield,$sortorder);
print_liste_field_titre($langs->trans('RefCustomerOrder'),'orderstoinvoice.php','c.ref_client','','&amp;socid='.$socid,'',$sortfield,$sortorder);
print_liste_field_titre($langs->trans('OrderDate'),'orderstoinvoice.php','c.date_commande','','&amp;socid='.$socid, 'align="center"',$sortfield,$sortorder);
print_liste_field_titre($langs->trans('DeliveryDate'),'orderstoinvoice.php','c.date_livraison','','&amp;socid='.$socid, 'align="center"',$sortfield,$sortorder);
print_liste_field_titre($langs->trans('Status'),'','','','','align="right"');
print_liste_field_titre($langs->trans('GenerateBill'),'','','','','align="center"');
print '</tr>';
// Lignes des champs de filtre
print '<form method="POST" action="'.$_SERVER['PHP_SELF'].'">';
print '<input type="hidden" name="socid" value="'.$socid.'">';
print '<input type="hidden" name="action" value="'.$action.'">';
print '<input type="hidden" name="origin" value="'.$origin.'">';
print '<input type="hidden" name="originid" value="'.$originid.'">';
print '<tr class="liste_titre">';
print '<td class="liste_titre">';
//REF
print '<input class="flat" size="10" type="text" name="sref" value="'.$sref.'">';
print '</td>';
//print '<td class="liste_titre">';
print '<td class="liste_titre" align="left">';
print '<input class="flat" type="text" size="10" name="sref_client" value="'.$sref_client.'">';
//DATE ORDER
print '<td class="liste_titre" align="center">';
print $period;
print '</td>';
//DATE DELIVERY
print '<td class="liste_titre" align="center">';
print $periodely;
print '</td>';
//SEARCH BUTTON
print '</td><td align="right" class="liste_titre">';
print '<input type="image" class="liste_titre" name="button_search" src="'.DOL_URL_ROOT.'/theme/'.$conf->theme.'/img/search.png" value="'.dol_escape_htmltag($langs->trans("Search")).'" title="'.dol_escape_htmltag($langs->trans("Search")).'">';
//ALL/NONE
print '<td class="liste_titre" align="center">';
if ($conf->use_javascript_ajax) print '<a href="#" id="checkall">'.$langs->trans("All").'</a> / <a href="#" id="checknone">'.$langs->trans("None").'</a>';
print '</td>';
print '</td></tr>';
print '</form>';
print '<form method="POST" action="'.$_SERVER['PHP_SELF'].'">';
print '<input type="hidden" name="socid" value="'.$socid.'">';
print '<input type="hidden" name="action" value="'.$action.'">';
print '<input type="hidden" name="origin" value="'.$origin.'">';
print '<input type="hidden" name="originid[]" value="'.$originid.'">';
$var=True;
$generic_commande = new Commande($db);
while ($i < $num)
{
$objp = $db->fetch_object($resql);
$var=!$var;
print '<tr '.$bc[$var].'>';
print '<td nowrap="nowrap">';
$generic_commande->id=$objp->rowid;
$generic_commande->ref=$objp->ref;
print '<table class="nobordernopadding"><tr class="nocellnopadd">';
print '<td class="nobordernopadding" nowrap="nowrap">';
print $generic_commande->getNomUrl(1,$objp->fk_statut);
print '</td>';
print '<td width="20" class="nobordernopadding" nowrap="nowrap">';
if (($objp->fk_statut > 0) && ($objp->fk_statut < 3) && $db->jdate($objp->date_valid) < ($now - $conf->commande->client->warning_delay)) print img_picto($langs->trans("Late"),"warning");
print '</td>';
print '<td width="16" align="right" class="nobordernopadding">';
$filename=dol_sanitizeFileName($objp->ref);
$filedir=$conf->commande->dir_output . '/' . dol_sanitizeFileName($objp->ref);
$urlsource=$_SERVER['PHP_SELF'].'?id='.$objp->rowid;
print $formfile->getDocumentsLink($generic_commande->element, $filename, $filedir);
print '</td></tr></table>';
print '</td>';
print '<td>'.$objp->ref_client.'</td>';
// Order date
print '<td align="center" nowrap>';
print dol_print_date($db->jdate($objp->date_commande),'day');
print '</td>';
//Delivery date
print '<td align="center" nowrap>';
print dol_print_date($db->jdate($objp->date_livraison),'day');
print '</td>';
// Statut
print '<td align="right" nowrap="nowrap">'.$generic_commande->LibStatut($objp->fk_statut,$objp->facturee,5).'</td>';
// Checkbox
print '<td align="center">';
print '<input class="flat checkformerge" type="checkbox" name="originid[]" value="'.$objp->rowid.'"'.true.'>';
print '</td>' ;
print '</tr>';
$total = $total + $objp->price;
$subtotal = $subtotal + $objp->price;
$i++;
}
print '</table>';
print '<center><br><input type="checkbox" checked="checked" name="autocloseorders"> '.$langs->trans("CloseProcessedOrdersAutomatically");
// Button "Create Draft"
print '<br><center><input type="submit" class="button" name="bouton" value="'.$langs->trans('CreateDraftWithSelecedOrders').'"></center>';
print '</form>';
$db->free($resql);
?>
<script type="text/javascript">
jQuery(document).ready(function() {
jQuery("#checkall").click(function() {
jQuery(".checkformerge").attr('checked', true);
});
jQuery("#checknone").click(function() {
jQuery(".checkformerge").attr('checked', false);
});
});
</script>
<?php
}
else
{
print dol_print_error($db);
}
}
?>

View File

@ -140,7 +140,7 @@ if ($socid > 0)
print '<td aling="left">'.$fac->getLibStatut(2,$totalpaye).'</td>';
print '<td align="right">'.price($fac->total_ttc)."</td>\n";
if (($fac->statut == 3 ) || ($fac->statut == 2 && ! $fact->close_code) ) $solde = $solde = $solde + $totalpaye;
if (($fac->statut == 3 ) || ($fac->statut == 2 && ! $fact->close_code) ) $solde = $solde = $solde + $totalpaye;
else $solde = $solde + $fac->total_ttc;
print '<td align="right">&nbsp;</td>';

View File

@ -247,11 +247,17 @@ if ($type == 'directory')
{
$relativepath=$ecmdir->getRelativePath();
$upload_dir = $conf->ecm->dir_output.'/'.$relativepath;
$filearray=dol_dir_list($upload_dir,"files",0,'',array('^\.','\.meta$','^temp$','^CVS$'),$sortfield,(strtolower($sortorder)=='desc'?SORT_DESC:SORT_ASC),1);
if ($section) $param.='&section='.$section;
$textifempty=($section?$langs->trans("NoFileFound"):($showonrightsize=='featurenotyetavailable'?$langs->trans("FeatureNotYetAvailable"):$langs->trans("ECMSelectASection")));
// If $section defined with value 0
if ($section === '0')
{
$filearray=array();
$textifempty='<br><div align="center"><font class="warning">'.$langs->trans("DirNotSynchronizedSyncFirst").'</font></div><br>';
}
$formfile->list_of_documents($filearray,'','ecm',$param,1,$relativepath,$user->rights->ecm->upload,1,$textifempty,$maxlengthname,'',$url);
}

View File

@ -98,12 +98,12 @@ class box_members extends ModeleBoxes
$memberstatic->lastname=$objp->lastname;
$memberstatic->firstname=$objp->firstname;
if (! empty($objp->fk_soc)) {
$memberstatic->socid = $objp->fk_soc;
$memberstatic->fetch_thirdparty();
$memberstatic->name=$memberstatic->thirdparty->name;
} else {
$memberstatic->name=$objp->company;
if (! empty($objp->fk_soc)) {
$memberstatic->socid = $objp->fk_soc;
$memberstatic->fetch_thirdparty();
$memberstatic->name=$memberstatic->thirdparty->name;
} else {
$memberstatic->name=$objp->company;
}
$this->info_box_contents[$i][0] = array('td' => 'align="left" width="16"',

View File

@ -168,13 +168,14 @@ abstract class CommonDocGenerator
/**
* Rect pdf
*
* @param unknown_type $pdf
* @param unknown_type $x
* @param unknown_type $y
* @param unknown_type $l
* @param unknown_type $h
* @param PDF $pdf Object PDF
* @param float $x Abscissa of first point
* @param float $y Ordinate of first point
* @param float $l ??
* @param float $h ??
* @param int $hidetop Hide top
* @param int $hidebottom Hide bottom
* @return void
*/
function printRect($pdf, $x, $y, $l, $h, $hidetop=0, $hidebottom=0)
{

View File

@ -38,8 +38,8 @@ class ExtraFields
var $attribute_label;
// Tableau contenant le nom des champs en clef et la taille de ces champs en value
var $attribute_size;
// Tableau contenant le statut unique ou non
var $attribute_unique;
// Tableau contenant le statut unique ou non
var $attribute_unique;
var $error;
var $errno;
@ -311,10 +311,10 @@ class ExtraFields
$result=$this->db->DDLUpdateField(MAIN_DB_PREFIX.$table, $attrname, $field_desc);
if ($result > 0)
{
if ($label)
{
$result=$this->update_label($attrname,$label,$type,$length,$elementtype,$unique);
}
if ($label)
{
$result=$this->update_label($attrname,$label,$type,$length,$elementtype,$unique);
}
if ($result > 0)
{
$sql='';
@ -324,7 +324,7 @@ class ExtraFields
}
else
{
$sql="ALTER TABLE ".MAIN_DB_PREFIX.$table." DROP INDEX uk_".$table."_".$attrname;
$sql="ALTER TABLE ".MAIN_DB_PREFIX.$table." DROP INDEX uk_".$table."_".$attrname;
}
dol_syslog(get_class($this).'::update sql='.$sql);
$resql=$this->db->query($sql,1,'dml');

View File

@ -1408,7 +1408,7 @@ class Form
$langs->load('stocks');
$sql = "SELECT p.rowid, p.label, p.ref, p.price, p.duration,";
$sql.= " pfp.ref_fourn, pfp.rowid as idprodfournprice, pfp.price as fprice, pfp.quantity, pfp.unitprice,";
$sql.= " pfp.ref_fourn, pfp.rowid as idprodfournprice, pfp.price as fprice, pfp.quantity, pfp.remise_percent, pfp.remise, pfp.unitprice,";
$sql.= " s.nom";
$sql.= " FROM ".MAIN_DB_PREFIX."product as p";
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."product_fournisseur_price as pfp ON p.rowid = pfp.fk_product";
@ -1435,7 +1435,7 @@ class Form
$sql .= " OR p.barcode LIKE '".$filterkey."'";
}
}
$sql.= " ORDER BY pfp.ref_fourn DESC";
$sql.= " ORDER BY pfp.ref_fourn DESC, pfp.quantity ASC";
// Build output string
$outselect='';
@ -1461,6 +1461,7 @@ class Form
$outref=$objp->ref;
$outval='';
$outqty=1;
$outdiscount=0;
$opt = '<option value="'.$objp->idprodfournprice.'"';
if ($selected && $selected == $objp->idprodfournprice) $opt.= ' selected="selected"';
@ -1489,6 +1490,7 @@ class Form
$opt.= price($objp->fprice).' '.$currencytext."/".$objp->quantity;
$outval.= price($objp->fprice).' '.$currencytextnoent."/".$objp->quantity;
$outqty=$objp->quantity;
$outdiscount=$objp->remise_percent;
if ($objp->quantity == 1)
{
$opt.= strtolower($langs->trans("Unit"));
@ -1503,6 +1505,11 @@ class Form
{
$opt.=" (".price($objp->unitprice).' '.$currencytext."/".strtolower($langs->trans("Unit")).")";
$outval.=" (".price($objp->unitprice).' '.$currencytextnoent."/".strtolower($langs->transnoentities("Unit")).")";
}
if ($objp->remise_percent >= 1)
{
$opt.=" - ".$langs->trans("Discount")." : ".vatrate($objp->remise_percent).' %';
$outval.=" - ".$langs->transnoentities("Discount")." : ".vatrate($objp->remise_percent).' %';
}
if ($objp->duration)
{
@ -1526,7 +1533,7 @@ class Form
// "key" value of json key array is used by jQuery automatically as selected value
// "label" value of json key array is used by jQuery automatically as text for combo box
$outselect.=$opt;
array_push($outjson, array('key'=>$outkey, 'value'=>$outref, 'label'=>$outval, 'qty'=>$outqty, 'disabled'=>(empty($objp->idprodfournprice)?true:false)));
array_push($outjson, array('key'=>$outkey, 'value'=>$outref, 'label'=>$outval, 'qty'=>$outqty, 'discount'=>$outdiscount, 'disabled'=>(empty($objp->idprodfournprice)?true:false)));
$i++;
}
@ -3081,7 +3088,6 @@ class Form
// Now we get list
$num = $this->load_cache_vatrates($code_pays);
if ($num > 0)
{
// Definition du taux a pre-selectionner (si defaulttx non force et donc vaut -1 ou '')

View File

@ -235,6 +235,7 @@ class RssParser
//var_dump($opts);exit;
$context = stream_context_create($opts);
// FIXME avoid error if no connection
$str = file_get_contents($this->_urlRSS, false, $context);
}
catch (Exception $e) {

View File

@ -327,6 +327,7 @@ class Translate
/**
* Return translated value of key. Search in lang file, then into database.
* Key must be any complete entry into lang file: CurrencyEUR, ...
* If not found, return key.
* WARNING: To avoid infinite loop (getLabelFromKey->transnoentities->getTradFromKey), getLabelFromKey must
* not be called with same value than input.
@ -334,9 +335,11 @@ class Translate
* @param string $key Key to translate
* @return string Translated string
*/
function getTradFromKey($key)
private function getTradFromKey($key)
{
global $db;
//print 'xx'.$key;
$newstr=$key;
if (preg_match('/^Currency([A-Z][A-Z][A-Z])$/i',$key,$reg))
{
@ -614,25 +617,28 @@ class Translate
/**
* Return a label for a key. Store key-label into cache variable $this->cache_labels to save SQL requests to get labels.
* This function can be used to get label in database but more often to get code from key id.
* Return a label for a key.
* Search into translation array, then into cache, then if still not found, search into database.
* Store key-label found into cache variable $this->cache_labels to save SQL requests to get labels.
*
* @param DoliBD $db Database handler
* @param string $key Key to get label (key in language file)
* @param string $tablename Table name without prefix
* @param string $fieldkey Field for key
* @param string $fieldlabel Field for label
* @return string Label in UTF8 (but without entities)
* @param DoliBD $db Database handler
* @param string $key Key to get label (key in language file)
* @param string $tablename Table name without prefix
* @param string $fieldkey Field for key
* @param string $fieldlabel Field for label
* @return string Label in UTF8 (but without entities)
*/
function getLabelFromKey($db,$key,$tablename,$fieldkey,$fieldlabel)
{
// If key empty
if ($key == '') return '';
// Check in language array
if ($this->transnoentities($key) != $key)
//print 'param: '.$key.'-'.$keydatabase.'-'.$this->trans($key); exit;
// Check if in language array (this can call getTradFromKey)
if ($this->transnoentitiesnoconv($key) != $key)
{
return $this->transnoentities($key); // Found in language array
return $this->transnoentitiesnoconv($key); // Found in language array
}
// Check in cache

View File

@ -56,6 +56,7 @@ function dol_dir_list($path, $types="all", $recursive=0, $filter="", $excludefil
global $object;
dol_syslog("files.lib.php::dol_dir_list path=".$path." types=".$types." recursive=".$recursive." filter=".$filter." excludefilter=".json_encode($excludefilter));
//print 'xxx'."files.lib.php::dol_dir_list path=".$path." types=".$types." recursive=".$recursive." filter=".$filter." excludefilter=".json_encode($excludefilter);
$loaddate=($mode==1||$mode==2)?true:false;
$loadsize=($mode==1||$mode==3)?true:false;

View File

@ -106,8 +106,7 @@ function member_prepare_head($object)
/**
* Return array head with list of tabs to view object informations
*
* @param Object $object Member
* @return array head
* @return array head
*/
function member_admin_prepare_head()
{
@ -184,4 +183,4 @@ function member_stats_prepare_head($object)
return $head;
}
?>
?>

View File

@ -146,28 +146,28 @@ function group_prepare_head($object)
return $head;
}
/**
* Prepare array with list of tabs
*
/**
* Prepare array with list of tabs
*
* @param Object $object Object related to tabs
* @param array $aEntities Entities array
* @return array Array of tabs
*/
function entity_prepare_head($object, $aEntities)
{
global $mc;
* @param array $aEntities Entities array
* @return array Array of tabs
*/
function entity_prepare_head($object, $aEntities)
{
global $mc;
$head = array();
foreach($aEntities as $entity)
{
$mc->getInfo($entity);
$head[$entity][0] = $_SERVER['PHP_SELF'].'?id='.$object->id.'&amp;entity='.$entity;
$head[$entity][1] = $mc->label;
$head[$entity][0] = $_SERVER['PHP_SELF'].'?id='.$object->id.'&amp;entity='.$entity;
$head[$entity][1] = $mc->label;
$head[$entity][2] = $entity;
}
return $head;
}
return $head;
}
/**

View File

@ -951,10 +951,10 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after)
if (! empty($conf->commande->enabled))
{
$langs->load("orders");
if (! empty($conf->facture->enabled)) $newmenu->add("/commande/liste.php?leftmenu=orders&amp;viewstatut=3", $langs->trans("MenuOrdersToBill"), 0, $user->rights->commande->lire, '', $mainmenu, 'orders');
if (! empty($conf->facture->enabled)) $newmenu->add("/commande/liste.php?leftmenu=orders&amp;viewstatut=-3", $langs->trans("MenuOrdersToBill2"), 0, $user->rights->commande->lire, '', $mainmenu, 'orders');
// if ($leftmenu=="orders") $newmenu->add("/commande/", $langs->trans("StatusOrderToBill"), 1, $user->rights->commande->lire);
if (isset($conf->global->MAIN_FEATURES_LEVEL) && $conf->global->MAIN_FEATURES_LEVEL > 1)
if ($leftmenu=="orders") $newmenu->add("/commande/customer.php", $langs->trans("GenerateBill"), 1, $user->rights->commande->lire);
// Does this link is required now we have link into "Orders to bill" list ?
//if ($leftmenu=="orders") $newmenu->add("/commande/customer.php", $langs->trans("GenerateBill"), 1, $user->rights->commande->lire);
}
// Donations

View File

@ -546,7 +546,7 @@ class pdf_crabe extends ModelePDFFactures
$pdf->SetXY($tab3_posx+21, $tab3_top+$y);
$pdf->MultiCell(20, 3, price($row->amount), 0, 'L', 0);
$pdf->SetXY($tab3_posx+40, $tab3_top+$y);
$oper = $outputlangs->getTradFromKey("PaymentTypeShort" . $row->code);
$oper = $outputlangs->transnoentitiesnoconv("PaymentTypeShort" . $row->code);
$pdf->MultiCell(20, 3, $oper, 0, 'L', 0);
$pdf->SetXY($tab3_posx+58, $tab3_top+$y);

View File

@ -30,8 +30,7 @@ include_once DOL_DOCUMENT_ROOT .'/core/modules/DolibarrModules.class.php';
/**
* \class modAccounting
* \brief Classe de description et activation du module Comptabilite Expert
* Classe de description et activation du module Comptabilite Expert
*/
class modAccounting extends DolibarrModules
{
@ -85,47 +84,47 @@ class modAccounting extends DolibarrModules
$this->rights = array();
$this->rights_class = 'accounting';
$this->rights[1][0] = 50401;
$this->rights[1][1] = 'Lire le plan de compte';
$this->rights[1][2] = 'r';
$this->rights[1][3] = 1;
$this->rights[1][4] = 'plancompte';
$this->rights[1][5] = 'lire';
$this->rights[$r][0] = 50401;
$this->rights[$r][1] = 'Lire le plan de compte';
$this->rights[$r][2] = 'r';
$this->rights[$r][3] = 1;
$this->rights[$r][4] = 'plancompte';
$this->rights[$r][5] = 'lire';
$this->rights[2][0] = 50402;
$this->rights[2][1] = 'Creer/modifier un plan de compte';
$this->rights[2][2] = 'w';
$this->rights[2][3] = 0;
$this->rights[2][4] = 'plancompte';
$this->rights[2][5] = 'creer';
$this->rights[$r][0] = 50402;
$this->rights[$r][1] = 'Creer/modifier un plan de compte';
$this->rights[$r][2] = 'w';
$this->rights[$r][3] = 0;
$this->rights[$r][4] = 'plancompte';
$this->rights[$r][5] = 'creer';
$this->rights[3][0] = 50403;
$this->rights[3][1] = 'Cloturer plan de compte';
$this->rights[3][2] = 'w';
$this->rights[3][3] = 0;
$this->rights[3][4] = 'plancompte';
$this->rights[3][5] = 'cloturer';
$this->rights[$r][0] = 50403;
$this->rights[$r][1] = 'Cloturer plan de compte';
$this->rights[$r][2] = 'w';
$this->rights[$r][3] = 0;
$this->rights[$r][4] = 'plancompte';
$this->rights[$r][5] = 'cloturer';
$this->rights[4][0] = 50411;
$this->rights[4][1] = 'Lire les mouvements comptables';
$this->rights[4][2] = 'r';
$this->rights[4][3] = 1;
$this->rights[4][4] = 'mouvements';
$this->rights[4][5] = 'lire';
$this->rights[$r][0] = 50411;
$this->rights[$r][1] = 'Lire les mouvements comptables';
$this->rights[$r][2] = 'r';
$this->rights[$r][3] = 1;
$this->rights[$r][4] = 'mouvements';
$this->rights[$r][5] = 'lire';
$this->rights[5][0] = 50412;
$this->rights[5][1] = 'Creer/modifier/annuler les mouvements comptables';
$this->rights[5][2] = 'w';
$this->rights[5][3] = 0;
$this->rights[5][4] = 'mouvements';
$this->rights[5][5] = 'creer';
$this->rights[$r][0] = 50412;
$this->rights[$r][1] = 'Creer/modifier/annuler les mouvements comptables';
$this->rights[$r][2] = 'w';
$this->rights[$r][3] = 0;
$this->rights[$r][4] = 'mouvements';
$this->rights[$r][5] = 'creer';
$this->rights[6][0] = 50415;
$this->rights[6][1] = 'Lire CA, bilans, resultats, journaux, grands livres';
$this->rights[6][2] = 'r';
$this->rights[6][3] = 0;
$this->rights[6][4] = 'comptarapport';
$this->rights[6][5] = 'lire';
$this->rights[$r][0] = 50415;
$this->rights[$r][1] = 'Lire CA, bilans, resultats, journaux, grands livres';
$this->rights[$r][2] = 'r';
$this->rights[$r][3] = 0;
$this->rights[$r][4] = 'comptarapport';
$this->rights[$r][5] = 'lire';
}

View File

@ -26,7 +26,6 @@
* \ingroup member
* \brief File descriptor or module Member
*/
include_once DOL_DOCUMENT_ROOT .'/core/modules/DolibarrModules.class.php';
/**

View File

@ -30,8 +30,7 @@
include_once DOL_DOCUMENT_ROOT .'/core/modules/DolibarrModules.class.php';
/**
* \class modAgenda
* \brief Classe de description et activation du module Adherent
* Classe de description et activation du module Adherent
*/
class modAgenda extends DolibarrModules
{

View File

@ -31,10 +31,8 @@ include_once DOL_DOCUMENT_ROOT .'/core/modules/DolibarrModules.class.php';
/**
* \class modBanque
* \brief Classe de description et activation du module Banque
* Classe de description et activation du module Banque
*/
class modBanque extends DolibarrModules
{

View File

@ -28,10 +28,8 @@
include_once DOL_DOCUMENT_ROOT .'/core/modules/DolibarrModules.class.php';
/**
* \class modBarcode
* \brief Classe de description et activation du module Barcode
* Classe de description et activation du module Barcode
*/
class modBarcode extends DolibarrModules
{

View File

@ -28,10 +28,8 @@ include_once DOL_DOCUMENT_ROOT .'/core/modules/DolibarrModules.class.php';
/**
* \class modBookmark
* \brief Classe de description et activation du module Bookmark
* Classe de description et activation du module Bookmark
*/
class modBookmark extends DolibarrModules
{

View File

@ -30,8 +30,7 @@ include_once DOL_DOCUMENT_ROOT .'/core/modules/DolibarrModules.class.php';
/**
* \class modBoutique
* \brief Classe de description et activation du module OSCommerce
* Classe de description et activation du module OSCommerce
*/
class modBoutique extends DolibarrModules
{

View File

@ -26,8 +26,7 @@ include_once DOL_DOCUMENT_ROOT .'/core/modules/DolibarrModules.class.php';
/**
* \class modCashDesk
* \brief Class to describe and enable module Point Of Sales
* Class to describe and enable module Point Of Sales
*/
class modCashDesk extends DolibarrModules
{

View File

@ -27,8 +27,7 @@ include_once DOL_DOCUMENT_ROOT .'/core/modules/DolibarrModules.class.php';
/**
* \class modCategorie
* \brief Classe de description et activation du module Categorie
* Classe de description et activation du module Categorie
*/
class modCategorie extends DolibarrModules
{

View File

@ -28,10 +28,8 @@ include_once DOL_DOCUMENT_ROOT .'/core/modules/DolibarrModules.class.php';
/**
* \class modClickToDial
* \brief Classe de description et activation du module de Click to Dial
* Classe de description et activation du module de Click to Dial
*/
class modClickToDial extends DolibarrModules
{

View File

@ -17,8 +17,8 @@
*/
/**
* \defgroup commissions Module Commissions
* \brief Example of a module descriptor.
* \defgroup commissions Module commissions
* \brief Module commissions
* \file htdocs/core/modules/modCommissions.class.php
* \ingroup commissions
* \brief Description and activation file for module Commissions

View File

@ -30,8 +30,7 @@ include_once DOL_DOCUMENT_ROOT .'/core/modules/DolibarrModules.class.php';
/**
* \class modComptabilite
* \brief Classe de description et activation du module Comptabilite
* Classe de description et activation du module Comptabilite
*/
class modComptabilite extends DolibarrModules
{

View File

@ -29,10 +29,8 @@ include_once DOL_DOCUMENT_ROOT .'/core/modules/DolibarrModules.class.php';
/**
\class modContrat
\brief Classe de description et activation du module Contrat
* Classe de description et activation du module Contrat
*/
class modContrat extends DolibarrModules
{

View File

@ -27,8 +27,7 @@ include_once DOL_DOCUMENT_ROOT .'/core/modules/DolibarrModules.class.php';
/**
* \class modDeplacement
* \brief Classe de description et activation du module Deplacement
* Classe de description et activation du module Deplacement
*/
class modDeplacement extends DolibarrModules
{

View File

@ -29,10 +29,8 @@ include_once DOL_DOCUMENT_ROOT .'/core/modules/DolibarrModules.class.php';
/**
* \class modDocument
* \brief Classe de description et activation du module Document
* Classe de description et activation du module Document
*/
class modDocument extends DolibarrModules
{

View File

@ -29,8 +29,7 @@ include_once DOL_DOCUMENT_ROOT .'/core/modules/DolibarrModules.class.php';
/**
* \class modDon
* \brief Classe de description et activation du module Don
* Classe de description et activation du module Don
*/
class modDon extends DolibarrModules
{

View File

@ -26,8 +26,8 @@
include_once DOL_DOCUMENT_ROOT .'/core/modules/DolibarrModules.class.php';
/** \class modECM
* \brief Description and activation class for module ECM
/**
* Description and activation class for module ECM
*/
class modECM extends DolibarrModules
{

View File

@ -30,8 +30,7 @@ include_once DOL_DOCUMENT_ROOT .'/core/modules/DolibarrModules.class.php';
/**
* \class modExpedition
* \brief Classe de description et activation du module Expedition
* Classe de description et activation du module Expedition
*/
class modExpedition extends DolibarrModules
{

View File

@ -27,10 +27,9 @@
include_once DOL_DOCUMENT_ROOT .'/core/modules/DolibarrModules.class.php';
/** \class modExport
* \brief Classe de description et activation du module export
/**
* Classe de description et activation du module export
*/
class modExport extends DolibarrModules
{

View File

@ -27,10 +27,9 @@
include_once DOL_DOCUMENT_ROOT .'/core/modules/DolibarrModules.class.php';
/** \class modExternalRss
* \brief Classe de description et activation du module externalrss
/**
* Classe de description et activation du module externalrss
*/
class modExternalRss extends DolibarrModules
{
@ -130,10 +129,10 @@ class modExternalRss extends DolibarrModules
function remove($options='')
{
$sql = array();
// Delete old declarations of RSS box
$this->boxes[0][1] = "box_external_rss.php";
return $this->_remove($sql,$options);
}

View File

@ -28,18 +28,17 @@
include_once DOL_DOCUMENT_ROOT .'/core/modules/DolibarrModules.class.php';
/** \class modExternalSite
\brief Description and activation class for module ExternalSite
*/
/**
* Description and activation class for module ExternalSite
*/
class modExternalSite extends DolibarrModules
{
/**
/**
* Constructor. Define names, constants, directories, boxes, permissions
*
* @param DoliDB $db Database handler
*/
*/
function __construct($db)
{
$this->db = $db;

View File

@ -27,8 +27,8 @@
include_once DOL_DOCUMENT_ROOT .'/core/modules/DolibarrModules.class.php';
/** \class modFTP
* \brief Description and activation class for module FTP
/**
* Description and activation class for module FTP
*/
class modFTP extends DolibarrModules
{

View File

@ -29,8 +29,7 @@ include_once DOL_DOCUMENT_ROOT .'/core/modules/DolibarrModules.class.php';
/**
* \class modFckeditor
* \brief Classe de description et activation du module Fckeditor
* Classe de description et activation du module Fckeditor
*/
class modFckeditor extends DolibarrModules

View File

@ -32,8 +32,7 @@ include_once DOL_DOCUMENT_ROOT .'/core/modules/DolibarrModules.class.php';
/**
* \class modFicheinter
* \brief Classe de description et activation du module Ficheinter
* Classe de description et activation du module Ficheinter
*/
class modFicheinter extends DolibarrModules
{

View File

@ -26,8 +26,8 @@
include_once DOL_DOCUMENT_ROOT .'/core/modules/DolibarrModules.class.php';
/** \class modGeoIPMaxmind
* \brief Classe de description et activation du module Import
/**
* Classe de description et activation du module Import
*/
class modGeoIPMaxmind extends DolibarrModules
{

View File

@ -26,8 +26,8 @@
include_once DOL_DOCUMENT_ROOT .'/core/modules/DolibarrModules.class.php';
/** \class modGravatar
* \brief Description and activation class for module Gravatar
/**
* Description and activation class for module Gravatar
*/
class modGravatar extends DolibarrModules
{

View File

@ -20,16 +20,12 @@
*/
/**
* \defgroup holiday Payes Module holiday Payes
* \brief Module de gestion des congés payés
* \defgroup holiday Module holiday
* \brief Module de gestion des congés
* \file htdocs/includes/modules/modHoliday.class.php
* \ingroup holiday
* \brief Description and activation file for module holiday
*/
/**
* \file htdocs/includes/modules/modHoliday.class.php
* \ingroup holiday
* \brief Description and activation file for module holiday
*/
include_once(DOL_DOCUMENT_ROOT ."/core/modules/DolibarrModules.class.php");

View File

@ -27,8 +27,8 @@
include_once DOL_DOCUMENT_ROOT .'/core/modules/DolibarrModules.class.php';
/** \class modImport
* \brief Classe de description et activation du module Import
/**
* Classe de description et activation du module Import
*/
class modImport extends DolibarrModules
{

View File

@ -28,10 +28,8 @@ include_once DOL_DOCUMENT_ROOT .'/core/modules/DolibarrModules.class.php';
/**
* \class modLabel
* \brief Classe de description et activation du module Label
* Classe de description et activation du module Label
*/
class modLabel extends DolibarrModules
{

View File

@ -28,8 +28,7 @@ include_once DOL_DOCUMENT_ROOT .'/core/modules/DolibarrModules.class.php';
/**
* \class modLdap
* \brief Classe de description et activation du module Ldap
* Classe de description et activation du module Ldap
*/
class modLdap extends DolibarrModules
{

View File

@ -29,8 +29,7 @@ include_once DOL_DOCUMENT_ROOT .'/core/modules/DolibarrModules.class.php';
/**
* \class modMailing
* \brief Classe de description et activation du module Mailing
* Classe de description et activation du module Mailing
*/
class modMailing extends DolibarrModules
{
@ -75,35 +74,35 @@ class modMailing extends DolibarrModules
$this->rights = array();
$this->rights_class = 'mailing';
$r=0;
$r++;
$this->rights[$r][0] = 221; // id de la permission
$this->rights[$r][1] = 'Consulter les mailings'; // libelle de la permission
$this->rights[$r][2] = 'r'; // type de la permission (deprecie a ce jour)
$this->rights[$r][3] = 1; // La permission est-elle une permission par defaut
$this->rights[$r][4] = 'lire';
$r++;
$this->rights[$r][0] = 222;
$this->rights[$r][1] = 'Creer/modifier les mailings (sujet, destinataires...)';
$this->rights[$r][2] = 'w';
$this->rights[$r][3] = 0;
$this->rights[$r][4] = 'creer';
$r++;
$this->rights[$r][0] = 223;
$this->rights[$r][1] = 'Valider les mailings (permet leur envoi)';
$this->rights[$r][2] = 'w';
$this->rights[$r][3] = 0;
$this->rights[$r][4] = 'valider';
$r++;
$this->rights[$r][0] = 229;
$this->rights[$r][1] = 'Supprimer les mailings';
$this->rights[$r][2] = 'd';
$this->rights[$r][3] = 0;
$this->rights[$r][4] = 'supprimer';
$r++;
$this->rights[$r][0] = 237;
$this->rights[$r][1] = 'View recipients and info';
@ -111,7 +110,7 @@ class modMailing extends DolibarrModules
$this->rights[$r][3] = 0;
$this->rights[$r][4] = 'mailing_advance'; // Visible if option MAIN_USE_ADVANCED_PERMS is on
$this->rights[$r][5] = 'recipient';
$r++;
$this->rights[$r][0] = 238;
$this->rights[$r][1] = 'Manually send mailings';
@ -119,7 +118,7 @@ class modMailing extends DolibarrModules
$this->rights[$r][3] = 0;
$this->rights[$r][4] = 'mailing_advance'; // Visible if option MAIN_USE_ADVANCED_PERMS is on
$this->rights[$r][5] = 'send';
$r++;
$this->rights[$r][0] = 239;
$this->rights[$r][1] = 'Delete mailings after validation and/or sent';

View File

@ -15,7 +15,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/** \defgroup margin Module Margin
/** \defgroup margin Module margin
* \brief Module to manage margins
* \file htdocs/includes/modules/modMargin.class.php
* \ingroup margin

View File

@ -23,12 +23,10 @@
* \ingroup notification
* \brief Fichier de description et activation du module Notification
*/
include_once DOL_DOCUMENT_ROOT .'/core/modules/DolibarrModules.class.php';
/**
* \class modNotification
* \brief Classe de description et activation du module Mailing
* Classe de description et activation du module Mailing
*/
class modNotification extends DolibarrModules
{

View File

@ -26,8 +26,8 @@
include_once DOL_DOCUMENT_ROOT .'/core/modules/DolibarrModules.class.php';
/** \class modPayBox
* \brief Description and activation class for module Paybox
/**
* Description and activation class for module Paybox
*/
class modPayBox extends DolibarrModules
{

View File

@ -27,8 +27,8 @@
include_once DOL_DOCUMENT_ROOT .'/core/modules/DolibarrModules.class.php';
/** \class modPaypal
* \brief Description and activation class for module Paypal
/**
* Description and activation class for module Paypal
*/
class modPaypal extends DolibarrModules
{

View File

@ -30,8 +30,7 @@ include_once DOL_DOCUMENT_ROOT .'/core/modules/DolibarrModules.class.php';
/**
* \class modPrelevement
* \brief Classe de description et activation du module Prelevement
* Classe de description et activation du module Prelevement
*/
class modPrelevement extends DolibarrModules
{

View File

@ -22,14 +22,10 @@
/**
* \defgroup produit Module products
* \brief Module to manage catalog of predefined products
*/
/**
* \file htdocs/core/modules/modProduct.class.php
* \ingroup produit
* \brief File to describe module to manage catalog of predefined products
*/
include_once DOL_DOCUMENT_ROOT .'/core/modules/DolibarrModules.class.php';

View File

@ -26,13 +26,11 @@
* \ingroup projet
* \brief Fichier de description et activation du module Projet
*/
include_once DOL_DOCUMENT_ROOT .'/core/modules/DolibarrModules.class.php';
/**
* \class modProjet
* \brief Classe de description et activation du module Projet
* Classe de description et activation du module Projet
*/
class modProjet extends DolibarrModules
{

View File

@ -27,13 +27,11 @@
* \ingroup propale
* \brief Fichier de description et activation du module Propale
*/
include_once DOL_DOCUMENT_ROOT .'/core/modules/DolibarrModules.class.php';
/**
* \class modPropale
* \brief Classe de description et activation du module Propale
* Classe de description et activation du module Propale
*/
class modPropale extends DolibarrModules
{

View File

@ -27,7 +27,6 @@
* \ingroup service
* \brief Fichier de description et activation du module Service
*/
include_once DOL_DOCUMENT_ROOT .'/core/modules/DolibarrModules.class.php';

View File

@ -26,13 +26,11 @@
* \ingroup societe
* \brief Fichier de description et activation du module Societe
*/
include_once DOL_DOCUMENT_ROOT .'/core/modules/DolibarrModules.class.php';
/**
* \class modSociete
* \brief Classe de description et activation du module Societe
* Classe de description et activation du module Societe
*/
class modSociete extends DolibarrModules
{

View File

@ -29,8 +29,7 @@ include_once DOL_DOCUMENT_ROOT .'/core/modules/DolibarrModules.class.php';
/**
* \class modStock
* \brief Classe de description et activation du module Stock
* Classe de description et activation du module Stock
*/
class modStock extends DolibarrModules
{

View File

@ -27,8 +27,7 @@
include_once DOL_DOCUMENT_ROOT .'/core/modules/DolibarrModules.class.php';
/**
* \class modSyslog
* \brief Class to enable/disable module Logs
* Class to enable/disable module Logs
*/
class modSyslog extends DolibarrModules
{

View File

@ -27,13 +27,11 @@
* \ingroup tax
* \brief Fichier de description et activation du module Taxe
*/
include_once DOL_DOCUMENT_ROOT .'/core/modules/DolibarrModules.class.php';
/**
* \class modTax
* \brief Classe de description et activation du module Tax
* Classe de description et activation du module Tax
*/
class modTax extends DolibarrModules
{

View File

@ -28,8 +28,7 @@
include_once DOL_DOCUMENT_ROOT .'/core/modules/DolibarrModules.class.php';
/**
* \class modUser
* \brief Classe de description et activation du module User
* Classe de description et activation du module User
*/
class modUser extends DolibarrModules
{

View File

@ -22,14 +22,11 @@
* \ingroup webservices
* \brief File to describe webservices module
*/
include_once DOL_DOCUMENT_ROOT .'/core/modules/DolibarrModules.class.php';
/**
* \class modWebServices
* \brief Class to describe a WebServices module
* Class to describe a WebServices module
*/
class modWebServices extends DolibarrModules
{

Some files were not shown because too many files have changed in this diff Show More