Merge remote-tracking branch 'Upstream/develop' into develop-loan

This commit is contained in:
aspangaro 2014-09-28 14:00:26 +02:00
commit 250b57ca0a
143 changed files with 1192 additions and 726 deletions

View File

@ -109,6 +109,7 @@ For developers:
- New: Added hook "formConfirm" and "doActions" for supplier invoice card. - New: Added hook "formConfirm" and "doActions" for supplier invoice card.
- New: [ task #1511, #1426 ] Added hook "doActions" for supplier card and supplier order card. - New: [ task #1511, #1426 ] Added hook "doActions" for supplier card and supplier order card.
- New: renamed table llx_c_pays to llx_c_country & libelle field to label. - New: renamed table llx_c_pays to llx_c_country & libelle field to label.
- New: Added hook "formConfirm" and "doActions" for fichinter card
- Qual: Renamed table llx_c_civilite into llx_c_civility, - Qual: Renamed table llx_c_civilite into llx_c_civility,
field civilite into label in the same table, field civilite into label in the same table,
and field civilite into civility in other table. and field civilite into civility in other table.

View File

@ -1,3 +1,10 @@
dolibarr (3.6.1-3) unstable; urgency=low
[ Laurent Destailleur (eldy) ]
* New upstream release.
-- Laurent Destailleur (eldy) <eldy@users.sourceforge.net> Tue, 23 Sep 2014 12:00:00 +0100
dolibarr (3.6.0-3) unstable; urgency=low dolibarr (3.6.0-3) unstable; urgency=low
[ Laurent Destailleur (eldy) ] [ Laurent Destailleur (eldy) ]

View File

@ -17,9 +17,9 @@
; ----- Change this ----- ; ----- Change this -----
AppName=DoliWamp AppName=DoliWamp
; DoliWamp-x.x.x or DoliWamp-x.x.x-alpha or DoliWamp-x.x.x-beta or DoliWamp-x.x.x-rc or DoliWamp-x.x.x ; DoliWamp-x.x.x or DoliWamp-x.x.x-alpha or DoliWamp-x.x.x-beta or DoliWamp-x.x.x-rc or DoliWamp-x.x.x
AppVerName=DoliWamp-3.6.0 AppVerName=DoliWamp-3.6.1
; DoliWamp-x.x x or DoliWamp-x.x.x-alpha or DoliWamp-x.x.x-beta or DoliWamp-x.x.x-rc or DoliWamp-x.x.x ; DoliWamp-x.x x or DoliWamp-x.x.x-alpha or DoliWamp-x.x.x-beta or DoliWamp-x.x.x-rc or DoliWamp-x.x.x
OutputBaseFilename=DoliWamp-3.6.0 OutputBaseFilename=DoliWamp-3.6.1
; ----- End of change ; ----- End of change
;OutputManifestFile=build\doliwampbuild.log ;OutputManifestFile=build\doliwampbuild.log
; Define full path from which all relative path are defined ; Define full path from which all relative path are defined

View File

@ -460,8 +460,8 @@ if ($nboftargetok) {
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/phpexcel/license.txt`; $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/phpexcel/license.txt`;
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/phpexcel/PHPExcel/Shared/PDF`; $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/phpexcel/PHPExcel/Shared/PDF`;
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/phpexcel/PHPExcel/Shared/PCLZip`; $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/phpexcel/PHPExcel/Shared/PCLZip`;
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/tcpdf/fonts/dejavu-fonts-ttf-2.33`; $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/tcpdf/fonts/dejavu-fonts-ttf-*`;
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/tcpdf/fonts/freefont-20100919`; $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/tcpdf/fonts/freefont-*`;
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/tcpdf/fonts/utils`; $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/tcpdf/fonts/utils`;
$ret=`rm -f $BUILDROOT/$PROJECT/htdocs/includes/tcpdf/LICENSE.TXT`; $ret=`rm -f $BUILDROOT/$PROJECT/htdocs/includes/tcpdf/LICENSE.TXT`;
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/savant`; $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/savant`;
@ -610,9 +610,6 @@ if ($nboftargetok) {
print "Version is $MAJOR.$MINOR.$REL1-$RPMSUBVERSION\n"; print "Version is $MAJOR.$MINOR.$REL1-$RPMSUBVERSION\n";
#print "Create directory $RPMDIR\n";
#$ret=`mkdir -p "$RPMDIR"`;
print "Remove target ".$FILENAMERPM."...\n"; print "Remove target ".$FILENAMERPM."...\n";
unlink("$NEWDESTI/".$FILENAMERPM); unlink("$NEWDESTI/".$FILENAMERPM);
print "Remove target ".$FILENAMETGZ2."-".$RPMSUBVERSION.".src.rpm...\n"; print "Remove target ".$FILENAMETGZ2."-".$RPMSUBVERSION.".src.rpm...\n";
@ -620,13 +617,13 @@ if ($nboftargetok) {
print "Create directory $BUILDROOT/$FILENAMETGZ2\n"; print "Create directory $BUILDROOT/$FILENAMETGZ2\n";
$ret=`rm -fr $BUILDROOT/$FILENAMETGZ2`; $ret=`rm -fr $BUILDROOT/$FILENAMETGZ2`;
print "Copy $BUILDROOT/$PROJECT to $BUILDROOT/$FILENAMETGZ2\n"; print "Copy $BUILDROOT/$PROJECT to $BUILDROOT/$FILENAMETGZ2\n";
$cmd="cp -pr '$BUILDROOT/$PROJECT' '$BUILDROOT/$FILENAMETGZ2'"; $cmd="cp -pr '$BUILDROOT/$PROJECT' '$BUILDROOT/$FILENAMETGZ2'";
$ret=`$cmd`; $ret=`$cmd`;
# Set owners # Removed files we don't need
#print "Set owners on files/dir\n"; $ret=`rm -fr $BUILDROOT/$FILENAMETGZ2/htdocs/includes/ckeditor/_source`;
#$ret=`chown -R root.root $BUILDROOT/$FILENAMETGZ2`;
print "Set permissions on files/dir\n"; print "Set permissions on files/dir\n";
$ret=`chmod -R 755 $BUILDROOT/$FILENAMETGZ2`; $ret=`chmod -R 755 $BUILDROOT/$FILENAMETGZ2`;
@ -747,10 +744,18 @@ if ($nboftargetok) {
$ret=`rm -fr $BUILDROOT/$PROJECT.tmp/build/rpm`; $ret=`rm -fr $BUILDROOT/$PROJECT.tmp/build/rpm`;
$ret=`rm -fr $BUILDROOT/$PROJECT.tmp/build/zip`; $ret=`rm -fr $BUILDROOT/$PROJECT.tmp/build/zip`;
# Removed duplicate license files # Removed duplicate license files
$ret=`rm -fr $BUILDROOT/$PROJECT.tmp/htdocs/includes/ckeditor/_source/LICENSE.md`;
$ret=`rm -fr $BUILDROOT/$PROJECT.tmp/htdocs/includes/ckeditor/_source/plugins/scayt/LICENSE.md`;
$ret=`rm -fr $BUILDROOT/$PROJECT.tmp/htdocs/includes/ckeditor/_source/plugins/wsc/LICENSE.md`;
$ret=`rm -fr $BUILDROOT/$PROJECT.tmp/htdocs/includes/ckeditor/LICENSE.md`; $ret=`rm -fr $BUILDROOT/$PROJECT.tmp/htdocs/includes/ckeditor/LICENSE.md`;
$ret=`rm -fr $BUILDROOT/$PROJECT.tmp/htdocs/includes/ckeditor/plugins/scayt/LICENSE.md`; $ret=`rm -fr $BUILDROOT/$PROJECT.tmp/htdocs/includes/ckeditor/plugins/scayt/LICENSE.md`;
$ret=`rm -fr $BUILDROOT/$PROJECT.tmp/htdocs/includes/ckeditor/plugins/wsc/LICENSE.md`; $ret=`rm -fr $BUILDROOT/$PROJECT.tmp/htdocs/includes/ckeditor/plugins/wsc/LICENSE.md`;
$ret=`rm -fr $BUILDROOT/$PROJECT.tmp/htdocs/includes/jquery/plugins/flot/LICENSE.txt`; $ret=`rm -fr $BUILDROOT/$PROJECT.tmp/htdocs/includes/jquery/plugins/flot/LICENSE.txt`;
$ret=`rm -fr $BUILDROOT/$PROJECT.tmp/htdocs/includes/tcpdf/fonts/dejavu-fonts-ttf-2.34/LICENSE`;
$ret=`rm -fr $BUILDROOT/$PROJECT.tmp/htdocs/includes/tcpdf/fonts/freefont-20120503/COPYING`;
# Removed files we don't need
$ret=`rm -fr $BUILDROOT/$PROJECT.tmp/htdocs/includes/ckeditor/_source`;
# Rename upstream changelog to match debian rules # Rename upstream changelog to match debian rules
$ret=`mv $BUILDROOT/$PROJECT.tmp/ChangeLog $BUILDROOT/$PROJECT.tmp/changelog`; $ret=`mv $BUILDROOT/$PROJECT.tmp/ChangeLog $BUILDROOT/$PROJECT.tmp/changelog`;

View File

@ -36,14 +36,13 @@ complete release of Dolibarr, step by step.
- Update version number with x.y.z in build/exe/doliwamp/doliwamp.iss - Update version number with x.y.z in build/exe/doliwamp/doliwamp.iss
- Update version number with x.y.z in build/rpm/*.spec - Update version number with x.y.z in build/rpm/*.spec
- Commit all changes. - Commit all changes.
- Add a Tag (x.y.z)
- Build Dolibarr and DoliWamp packages with makepack-dolibarr.pl - Build Dolibarr and DoliWamp packages with makepack-dolibarr.pl
- Check content of built packages. - Check content of built packages.
- Move build files into www.dolibarr.org web site - Move build files into www.dolibarr.org web site
(/home/dolibarr/wwwroot/files/stable). (/home/dolibarr/wwwroot/files/stable).
- Run makepack-dolibarr.pl again with option to publish files on - Run makepack-dolibarr.pl again with option to publish files on
sourceforge. sourceforge. This will also add official tag.
- Edit symbolic links in directory "/home/dolibarr/wwwroot/files/stable/xxx" - Edit symbolic links in directory "/home/dolibarr/wwwroot/files/stable/xxx"
on server to point to new files (used by some web sites). on server to point to new files (used by some web sites).

View File

@ -333,6 +333,9 @@ fi
# version x.y.z-0.1.a for alpha, x.y.z-0.2.b for beta, x.y.z-0.3 for release # version x.y.z-0.1.a for alpha, x.y.z-0.2.b for beta, x.y.z-0.3 for release
%changelog %changelog
* Wed Sep 24 2014 Laurent Destailleur 3.6.1-0.3
- Upstream release
* Wed Jul 15 2014 Laurent Destailleur 3.6.0-0.3 * Wed Jul 15 2014 Laurent Destailleur 3.6.0-0.3
- Upstream release - Upstream release

View File

@ -569,6 +569,9 @@ fi
# version x.y.z-0.1.a for alpha, x.y.z-0.2.b for beta, x.y.z-0.3 for release # version x.y.z-0.1.a for alpha, x.y.z-0.2.b for beta, x.y.z-0.3 for release
%changelog %changelog
* Wed Sep 24 2014 Laurent Destailleur 3.6.1-0.3
- Upstream release
* Wed Jul 15 2014 Laurent Destailleur 3.6.0-0.3 * Wed Jul 15 2014 Laurent Destailleur 3.6.0-0.3
- Upstream release - Upstream release

View File

@ -338,6 +338,9 @@ fi
# version x.y.z-0.1.a for alpha, x.y.z-0.2.b for beta, x.y.z-0.3 for release # version x.y.z-0.1.a for alpha, x.y.z-0.2.b for beta, x.y.z-0.3 for release
%changelog %changelog
* Wed Sep 24 2014 Laurent Destailleur 3.6.1-0.3
- Upstream release
* Wed Jul 15 2014 Laurent Destailleur 3.6.0-0.3 * Wed Jul 15 2014 Laurent Destailleur 3.6.0-0.3
- Upstream release - Upstream release

View File

@ -349,6 +349,9 @@ fi
# version x.y.z-0.1.a for alpha, x.y.z-0.2.b for beta, x.y.z-0.3 for release # version x.y.z-0.1.a for alpha, x.y.z-0.2.b for beta, x.y.z-0.3 for release
%changelog %changelog
* Wed Sep 24 2014 Laurent Destailleur 3.6.1-0.3
- Upstream release
* Wed Jul 15 2014 Laurent Destailleur 3.6.0-0.3 * Wed Jul 15 2014 Laurent Destailleur 3.6.0-0.3
- Upstream release - Upstream release

View File

@ -114,8 +114,8 @@ if ($action == 'add')
} }
{ {
// Creation KO // Creation KO
if (! empty($object->errors)) setEventMessage($object->errors, 'errors'); if (! empty($object->errors)) setEventMessages(null, $object->errors, 'errors');
else setEventMessage($object->error, 'errors'); else setEventMessages($object->error, null, 'errors');
$action='create'; $action='create';
} }
} }
@ -139,7 +139,7 @@ if ($action == 'update' && ! GETPOST('cancel'))
if (empty($object->ref)) if (empty($object->ref))
{ {
$error++; $error++;
setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("Ref")),'errors'); setEventMessages($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("Ref")),null,'errors');
} }
if (! $error) if (! $error)
@ -152,8 +152,8 @@ if ($action == 'update' && ! GETPOST('cancel'))
else else
{ {
// Creation KO // Creation KO
if (! empty($object->errors)) setEventMessage($object->errors, 'errors'); if (! empty($object->errors)) setEventMessages(null, $object->errors, 'errors');
else setEventMessage($object->error, 'errors'); else setEventMessages($object->error, null, 'errors');
$action='edit'; $action='edit';
} }
} }
@ -170,14 +170,14 @@ if ($action == 'confirm_delete')
if ($result > 0) if ($result > 0)
{ {
// Delete OK // Delete OK
setEventMessage($langs->trans("RecordDeleted")); setEventMessages($langs->trans("RecordDeleted"), null, 'mesgs');
header("Location: ".dol_buildpath('/buildingmanagement/list.php',1)); header("Location: ".dol_buildpath('/buildingmanagement/list.php',1));
exit; exit;
} }
else else
{ {
if (! empty($object->errors)) setEventMessage($object->errors,'errors'); if (! empty($object->errors)) setEventMessages(null,$object->errors,'errors');
else setEventMessage($object->error,'errors'); else setEventMessages($object->error,null,'errors');
} }
} }
@ -327,6 +327,8 @@ if ($id && (empty($action) || $action == 'view'))
print '<div class="tabsAction">'."\n"; print '<div class="tabsAction">'."\n";
$parameters=array(); $parameters=array();
$reshook=$hookmanager->executeHooks('addMoreActionsButtons',$parameters,$object,$action); // Note that $action and $object may have been modified by hook $reshook=$hookmanager->executeHooks('addMoreActionsButtons',$parameters,$object,$action); // Note that $action and $object may have been modified by hook
if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
if (empty($reshook)) if (empty($reshook))
{ {
if ($user->rights->mymodule->write) if ($user->rights->mymodule->write)

View File

@ -94,7 +94,7 @@ abstract class ActionsAdherentCardCommon
/** /**
* Load data control * Load data control
* *
* @param string &$action Type of action * @param string $action Type of action
* @param int $id Id of object * @param int $id Id of object
* @return void * @return void
*/ */
@ -228,7 +228,7 @@ abstract class ActionsAdherentCardCommon
/** /**
* Set content of ->tpl array, to use into template * Set content of ->tpl array, to use into template
* *
* @param string &$action Type of action * @param string $action Type of action
* @param int $id Id * @param int $id Id
* @return string HTML output * @return string HTML output
*/ */

View File

@ -76,7 +76,7 @@ class ActionsAdherentCardDefault extends ActionsAdherentCardCommon
/** /**
* Assign custom values for canvas * Assign custom values for canvas
* *
* @param string &$action Type of action * @param string $action Type of action
* @param int $id Id * @param int $id Id
* @return void * @return void
*/ */

View File

@ -117,6 +117,7 @@ $hookmanager->initHooks(array('membercard'));
$parameters=array('rowid'=>$rowid, 'objcanvas'=>$objcanvas); $parameters=array('rowid'=>$rowid, 'objcanvas'=>$objcanvas);
$reshook=$hookmanager->executeHooks('doActions',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks $reshook=$hookmanager->executeHooks('doActions',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks
if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
if ($action == 'setuserid' && ($user->rights->user->self->creer || $user->rights->user->user->creer)) if ($action == 'setuserid' && ($user->rights->user->self->creer || $user->rights->user->user->creer))
{ {

View File

@ -4,7 +4,7 @@
* Copyright (C) 2004 Sebastien Di Cintio <sdicintio@ressource-toi.org> * Copyright (C) 2004 Sebastien Di Cintio <sdicintio@ressource-toi.org>
* Copyright (C) 2004 Benoit Mortier <benoit.mortier@opensides.be> * Copyright (C) 2004 Benoit Mortier <benoit.mortier@opensides.be>
* Copyright (C) 2004 Andre Cianfarani <acianfa@free.fr> * Copyright (C) 2004 Andre Cianfarani <acianfa@free.fr>
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com> * Copyright (C) 2005-2014 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2008 Raphael Bertrand (Resultic) <raphael.bertrand@resultic.fr> * Copyright (C) 2008 Raphael Bertrand (Resultic) <raphael.bertrand@resultic.fr>
* Copyright (C) 2011-2013 Juanjo Menent <jmenent@2byte.es> * Copyright (C) 2011-2013 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2011-2013 Philippe Grand <philippe.grand@atoo-net.com> * Copyright (C) 2011-2013 Philippe Grand <philippe.grand@atoo-net.com>
@ -117,6 +117,35 @@ else if ($action == 'specimen')
} }
} }
// Define constants for submodules that contains parameters (forms with param1, param2, ... and value1, value2, ...)
if ($action == 'setModuleOptions')
{
$post_size=count($_POST);
$db->begin();
for($i=0;$i < $post_size;$i++)
{
if (array_key_exists('param'.$i,$_POST))
{
$param=GETPOST("param".$i,'alpha');
$value=GETPOST("value".$i,'alpha');
if ($param) $res = dolibarr_set_const($db,$param,$value,'chaine',0,'',$conf->entity);
if (! $res > 0) $error++;
}
}
if (! $error)
{
$db->commit();
setEventMessage($langs->trans("SetupSaved"));
}
else
{
$db->rollback();
setEventMessage($langs->trans("Error"),'errors');
}
}
// Activate a model // Activate a model
if ($action == 'set') if ($action == 'set')
{ {
@ -192,14 +221,6 @@ else if ($action == 'set_COMMANDE_FREE_TEXT')
setEventMessage($langs->trans("Error"),'errors'); setEventMessage($langs->trans("Error"),'errors');
} }
} }
else if ($action=='setModuleOptions') {
if (dolibarr_set_const($db, "COMMANDE_ADDON_PDF_ODT_PATH",GETPOST('value1'),'chaine',0,'',$conf->entity))
{
// La constante qui a ete lue en avant du nouveau set
// on passe donc par une variable pour avoir un affichage coherent
$conf->global->COMMANDE_ADDON_PDF_ODT_PATH = GETPOST('value1');
}
}
/* /*

View File

@ -138,6 +138,35 @@ else if ($action == 'specimen')
} }
} }
// Define constants for submodules that contains parameters (forms with param1, param2, ... and value1, value2, ...)
else if ($action == 'setModuleOptions')
{
$post_size=count($_POST);
$db->begin();
for($i=0;$i < $post_size;$i++)
{
if (array_key_exists('param'.$i,$_POST))
{
$param=GETPOST("param".$i,'alpha');
$value=GETPOST("value".$i,'alpha');
if ($param) $res = dolibarr_set_const($db,$param,$value,'chaine',0,'',$conf->entity);
if (! $res > 0) $error++;
}
}
if (! $error)
{
$db->commit();
setEventMessage($langs->trans("SetupSaved"));
}
else
{
$db->rollback();
setEventMessage($langs->trans("Error"),'errors');
}
}
// Activate a model // Activate a model
else if ($action == 'set') else if ($action == 'set')
{ {
@ -175,14 +204,6 @@ else if ($action == 'setmodel')
{ {
dolibarr_set_const($db, "EXPEDITION_ADDON_NUMBER",$value,'chaine',0,'',$conf->entity); dolibarr_set_const($db, "EXPEDITION_ADDON_NUMBER",$value,'chaine',0,'',$conf->entity);
} }
else if ($action=='setModuleOptions') {
if (dolibarr_set_const($db, "EXPEDITION_ADDON_PDF_ODT_PATH",GETPOST('value1'),'chaine',0,'',$conf->entity))
{
// La constante qui a ete lue en avant du nouveau set
// on passe donc par une variable pour avoir un affichage coherent
$conf->global->EXPEDITION_ADDON_PDF_ODT_PATH = GETPOST('value1');
}
}
/* /*

View File

@ -3,7 +3,7 @@
* Copyright (C) 2004-2011 Laurent Destailleur <eldy@users.sourceforge.net> * Copyright (C) 2004-2011 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2004 Sebastien Di Cintio <sdicintio@ressource-toi.org> * Copyright (C) 2004 Sebastien Di Cintio <sdicintio@ressource-toi.org>
* Copyright (C) 2004 Benoit Mortier <benoit.mortier@opensides.be> * Copyright (C) 2004 Benoit Mortier <benoit.mortier@opensides.be>
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com> * Copyright (C) 2005-2014 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2008 Raphael Bertrand (Resultic) <raphael.bertrand@resultic.fr> * Copyright (C) 2008 Raphael Bertrand (Resultic) <raphael.bertrand@resultic.fr>
* Copyright (C) 2011-2013 Juanjo Menent <jmenent@2byte.es> * Copyright (C) 2011-2013 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2011-2013 Philippe Grand <philippe.grand@atoo-net.com> * Copyright (C) 2011-2013 Philippe Grand <philippe.grand@atoo-net.com>
@ -113,6 +113,35 @@ else if ($action == 'specimen') // For fiche inter
} }
} }
// Define constants for submodules that contains parameters (forms with param1, param2, ... and value1, value2, ...)
if ($action == 'setModuleOptions')
{
$post_size=count($_POST);
$db->begin();
for($i=0;$i < $post_size;$i++)
{
if (array_key_exists('param'.$i,$_POST))
{
$param=GETPOST("param".$i,'alpha');
$value=GETPOST("value".$i,'alpha');
if ($param) $res = dolibarr_set_const($db,$param,$value,'chaine',0,'',$conf->entity);
if (! $res > 0) $error++;
}
}
if (! $error)
{
$db->commit();
setEventMessage($langs->trans("SetupSaved"));
}
else
{
$db->rollback();
setEventMessage($langs->trans("Error"),'errors');
}
}
// Activate a model // Activate a model
else if ($action == 'set') else if ($action == 'set')
{ {
@ -261,13 +290,13 @@ foreach ($dirmodels as $reldir)
require_once $dir.$file.'.php'; require_once $dir.$file.'.php';
$module = new $file; $module = new $file;
if ($module->isEnabled()) if ($module->isEnabled())
{ {
// Show modules according to features level // Show modules according to features level
if ($module->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL < 2) continue; if ($module->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL < 2) continue;
if ($module->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1) continue; if ($module->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1) continue;
$var=!$var; $var=!$var;
print '<tr '.$bc[$var].'><td>'.$module->nom."</td><td>\n"; print '<tr '.$bc[$var].'><td>'.$module->nom."</td><td>\n";
print $module->info(); print $module->info();
@ -372,78 +401,99 @@ foreach ($dirmodels as $reldir)
$handle=opendir($dir); $handle=opendir($dir);
if (is_resource($handle)) if (is_resource($handle))
{ {
while (($file = readdir($handle))!==false) while (($file = readdir($handle))!==false)
{ {
if (substr($file, dol_strlen($file) -12) == '.modules.php' && substr($file,0,4) == 'pdf_') $filelist[]=$file;
}
closedir($handle);
arsort($filelist);
foreach($filelist as $file)
{
if (preg_match('/\.modules\.php$/i',$file) && preg_match('/^(pdf_|doc_)/',$file))
{ {
$var=!$var; if (file_exists($dir.'/'.$file))
$name = substr($file, 4, dol_strlen($file) -16);
$classname = substr($file, 0, dol_strlen($file) -12);
require_once $dir.'/'.$file;
$module = new $classname($db);
print '<tr '.$bc[$var].'><td>';
print (empty($module->name)?$name:$module->name);
print "</td><td>\n";
require_once $dir.$file;
$module = new $classname($db);
print $module->description;
print '</td>';
// Active
if (in_array($name, $def))
{ {
print "<td align=\"center\">\n"; $var=!$var;
print '<a href="'.$_SERVER["PHP_SELF"].'?action=del&amp;value='.$name.'&amp;scandir='.$module->scandir.'&amp;label='.urlencode($module->name).'">';
print img_picto($langs->trans("Enabled"),'switch_on');
print '</a>';
print "</td>";
}
else
{
print "<td align=\"center\">\n";
print '<a href="'.$_SERVER["PHP_SELF"].'?action=set&amp;value='.$name.'&amp;scandir='.$module->scandir.'&amp;label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"),'switch_off').'</a>';
print "</td>";
}
// Default $name = substr($file, 4, dol_strlen($file) -16);
print "<td align=\"center\">"; $classname = substr($file, 0, dol_strlen($file) -12);
if ($conf->global->FICHEINTER_ADDON_PDF == "$name")
{
print img_picto($langs->trans("Default"),'on');
}
else
{
print '<a href="'.$_SERVER["PHP_SELF"].'?action=setdoc&amp;value='.$name.'&amp;scandir='.$module->scandir.'&amp;label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"),'off').'</a>';
}
print '</td>';
// Info require_once $dir.'/'.$file;
$htmltooltip = ''.$langs->trans("Name").': '.$module->name; $module = new $classname($db);
$htmltooltip.='<br>'.$langs->trans("Type").': '.($module->type?$module->type:$langs->trans("Unknown"));
$htmltooltip.='<br>'.$langs->trans("Width").'/'.$langs->trans("Height").': '.$module->page_largeur.'/'.$module->page_hauteur;
$htmltooltip.='<br><br><u>'.$langs->trans("FeaturesSupported").':</u>';
$htmltooltip.='<br>'.$langs->trans("Logo").': '.yn($module->option_logo,1,1);
$htmltooltip.='<br>'.$langs->trans("PaymentMode").': '.yn($module->option_modereg,1,1);
$htmltooltip.='<br>'.$langs->trans("PaymentConditions").': '.yn($module->option_condreg,1,1);
$htmltooltip.='<br>'.$langs->trans("MultiLanguage").': '.yn($module->option_multilang,1,1);
$htmltooltip.='<br>'.$langs->trans("WatermarkOnDraftOrders").': '.yn($module->option_draft_watermark,1,1);
print '<td align="center">';
print $form->textwithpicto('',$htmltooltip,-1,0);
print '</td>';
// Preview
$link='<a href="'.$_SERVER["PHP_SELF"].'?action=specimen&module='.$name.'">'.img_object($langs->trans("Preview"),'intervention').'</a>';
print '<td align="center">';
print $link;
print '</td>';
print '</tr>'; $modulequalified=1;
if ($module->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL < 2) $modulequalified=0;
if ($module->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1) $modulequalified=0;
if ($modulequalified)
{
print '<tr '.$bc[$var].'><td width="100">';
print (empty($module->name)?$name:$module->name);
print "</td><td>\n";
if (method_exists($module,'info')) print $module->info($langs);
else print $module->description;
print '</td>';
// Active
if (in_array($name, $def))
{
print "<td align=\"center\">\n";
print '<a href="'.$_SERVER["PHP_SELF"].'?action=del&amp;value='.$name.'&amp;scandir='.$module->scandir.'&amp;label='.urlencode($module->name).'">';
print img_picto($langs->trans("Enabled"),'switch_on');
print '</a>';
print "</td>";
}
else
{
print "<td align=\"center\">\n";
print '<a href="'.$_SERVER["PHP_SELF"].'?action=set&amp;value='.$name.'&amp;scandir='.$module->scandir.'&amp;label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"),'switch_off').'</a>';
print "</td>";
}
// Default
print "<td align=\"center\">";
if ($conf->global->FICHEINTER_ADDON_PDF == "$name")
{
print img_picto($langs->trans("Default"),'on');
}
else
{
print '<a href="'.$_SERVER["PHP_SELF"].'?action=setdoc&amp;value='.$name.'&amp;scandir='.$module->scandir.'&amp;label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"),'off').'</a>';
}
print '</td>';
// Info
$htmltooltip = ''.$langs->trans("Name").': '.$module->name;
$htmltooltip.='<br>'.$langs->trans("Type").': '.($module->type?$module->type:$langs->trans("Unknown"));
$htmltooltip.='<br>'.$langs->trans("Width").'/'.$langs->trans("Height").': '.$module->page_largeur.'/'.$module->page_hauteur;
$htmltooltip.='<br><br><u>'.$langs->trans("FeaturesSupported").':</u>';
$htmltooltip.='<br>'.$langs->trans("Logo").': '.yn($module->option_logo,1,1);
$htmltooltip.='<br>'.$langs->trans("PaymentMode").': '.yn($module->option_modereg,1,1);
$htmltooltip.='<br>'.$langs->trans("PaymentConditions").': '.yn($module->option_condreg,1,1);
$htmltooltip.='<br>'.$langs->trans("MultiLanguage").': '.yn($module->option_multilang,1,1);
$htmltooltip.='<br>'.$langs->trans("WatermarkOnDraftOrders").': '.yn($module->option_draft_watermark,1,1);
print '<td align="center">';
print $form->textwithpicto('',$htmltooltip,-1,0);
print '</td>';
// Preview
print '<td align="center">';
if ($module->type == 'pdf')
{
print '<a href="'.$_SERVER["PHP_SELF"].'?action=specimen&module='.$name.'">'.img_object($langs->trans("Preview"),'intervention').'</a>';
}
else
{
print img_object($langs->trans("PreviewNotAvailable"),'generic');
}
print '</td>';
print '</tr>';
}
}
} }
} }
closedir($handle);
} }
} }
} }

View File

@ -4,7 +4,7 @@
* Copyright (C) 2004 Sebastien Di Cintio <sdicintio@ressource-toi.org> * Copyright (C) 2004 Sebastien Di Cintio <sdicintio@ressource-toi.org>
* Copyright (C) 2004 Benoit Mortier <benoit.mortier@opensides.be> * Copyright (C) 2004 Benoit Mortier <benoit.mortier@opensides.be>
* Copyright (C) 2004 Eric Seigne <eric.seigne@ryxeo.com> * Copyright (C) 2004 Eric Seigne <eric.seigne@ryxeo.com>
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com> * Copyright (C) 2005-2014 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2011-2013 Juanjo Menent <jmenent@2byte.es> * Copyright (C) 2011-2013 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2011-2013 Philippe Grand <philippe.grand@atoo-net.com> * Copyright (C) 2011-2013 Philippe Grand <philippe.grand@atoo-net.com>
* *
@ -95,7 +95,7 @@ if ($action == 'specimen')
$dirmodels=array_merge(array('/'),(array) $conf->modules_parts['models']); $dirmodels=array_merge(array('/'),(array) $conf->modules_parts['models']);
foreach($dirmodels as $reldir) foreach($dirmodels as $reldir)
{ {
$file=dol_buildpath($reldir."core/modules/livraison/pdf/pdf_".$modele.".modules.php",0); $file=dol_buildpath($reldir."core/modules/livraison/doc/pdf_".$modele.".modules.php",0);
if (file_exists($file)) if (file_exists($file))
{ {
$filefound=1; $filefound=1;
@ -128,6 +128,35 @@ if ($action == 'specimen')
} }
} }
// Define constants for submodules that contains parameters (forms with param1, param2, ... and value1, value2, ...)
if ($action == 'setModuleOptions')
{
$post_size=count($_POST);
$db->begin();
for($i=0;$i < $post_size;$i++)
{
if (array_key_exists('param'.$i,$_POST))
{
$param=GETPOST("param".$i,'alpha');
$value=GETPOST("value".$i,'alpha');
if ($param) $res = dolibarr_set_const($db,$param,$value,'chaine',0,'',$conf->entity);
if (! $res > 0) $error++;
}
}
if (! $error)
{
$db->commit();
setEventMessage($langs->trans("SetupSaved"));
}
else
{
$db->rollback();
setEventMessage($langs->trans("Error"),'errors');
}
}
if ($action == 'set') if ($action == 'set')
{ {
$ret = addDocumentModel($value, $type, $label, $scandir); $ret = addDocumentModel($value, $type, $label, $scandir);
@ -356,75 +385,101 @@ clearstatcache();
$var=true; $var=true;
foreach ($dirmodels as $reldir) foreach ($dirmodels as $reldir)
{ {
$dir = dol_buildpath($reldir."core/modules/livraison/pdf/"); $dir = dol_buildpath($reldir."core/modules/livraison/doc/");
if (is_dir($dir)) if (is_dir($dir))
{ {
$handle = opendir($dir); $handle = opendir($dir);
if (is_resource($handle)) if (is_resource($handle))
{ {
while (($file = readdir($handle))!==false) while (($file = readdir($handle))!==false)
{ {
if (substr($file, dol_strlen($file) -12) == '.modules.php' && substr($file,0,4) == 'pdf_') $filelist[]=$file;
}
closedir($handle);
arsort($filelist);
foreach($filelist as $file)
{
if (preg_match('/\.modules\.php$/i',$file) && preg_match('/^(pdf_|doc_)/',$file))
{ {
$name = substr($file, 4, dol_strlen($file) - 16); if (file_exists($dir.'/'.$file))
$classname = substr($file, 0, dol_strlen($file) - 12); {
$var=!$var;
$var=!$var; $name = substr($file, 4, dol_strlen($file) -16);
$classname = substr($file, 0, dol_strlen($file) -12);
print '<tr '.$bc[$var].'><td>'; require_once $dir.'/'.$file;
print $name; $module = new $classname($db);
print "</td><td>\n";
require_once $dir.$file;
$module = new $classname($db);
print $module->description; $modulequalified=1;
print '</td>'; if ($module->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL < 2) $modulequalified=0;
if ($module->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1) $modulequalified=0;
// Activ if ($modulequalified)
if (in_array($name, $def)) {
{ print '<tr '.$bc[$var].'><td width="100">';
print "<td align=\"center\">\n"; print (empty($module->name)?$name:$module->name);
print '<a href="'.$_SERVER["PHP_SELF"].'?action=del&amp;value='.$name.'&amp;scandir='.$module->scandir.'&amp;label='.urlencode($module->name).'">'; print "</td><td>\n";
print img_picto($langs->trans("Enabled"),'switch_on'); if (method_exists($module,'info')) print $module->info($langs);
print '</a>'; else print $module->description;
print "</td>"; print '</td>';
}
else
{
print "<td align=\"center\">\n";
print '<a href="'.$_SERVER["PHP_SELF"].'?action=set&amp;value='.$name.'&amp;scandir='.$module->scandir.'&amp;label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"),'switch_off').'</a>';
print "</td>";
}
// Default // Active
print "<td align=\"center\">"; if (in_array($name, $def))
if ($conf->global->LIVRAISON_ADDON_PDF == "$name") {
{ print "<td align=\"center\">\n";
print img_picto($langs->trans("Default"),'on'); print '<a href="'.$_SERVER["PHP_SELF"].'?action=del&amp;value='.$name.'&amp;scandir='.$module->scandir.'&amp;label='.urlencode($module->name).'">';
} print img_picto($langs->trans("Enabled"),'switch_on');
else print '</a>';
{ print "</td>";
print '<a href="'.$_SERVER["PHP_SELF"].'?action=setdoc&amp;value='.$name.'&amp;scandir='.$module->scandir.'&amp;label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"),'off').'</a>'; }
} else
print '</td>'; {
print "<td align=\"center\">\n";
print '<a href="'.$_SERVER["PHP_SELF"].'?action=set&amp;value='.$name.'&amp;scandir='.$module->scandir.'&amp;label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"),'switch_off').'</a>';
print "</td>";
}
// Info // Default
$htmltooltip = ''.$langs->trans("Type").': '.($module->type?$module->type:$langs->trans("Unknown")); print "<td align=\"center\">";
$htmltooltip.='<br>'.$langs->trans("Width").'/'.$langs->trans("Height").': '.$module->page_largeur.'/'.$module->page_hauteur; if ($conf->global->LIVRAISON_ADDON_PDF == "$name")
$htmltooltip.='<br><br><u>'.$langs->trans("FeaturesSupported").'</u>:'; {
$htmltooltip.='<br>'.$langs->trans("Logo").': '.yn($module->option_logo,1,1); print img_picto($langs->trans("Default"),'on');
print '<td align="center">'; }
print $form->textwithpicto('',$htmltooltip,1,0); else
print '</td>'; {
print '<td align="center">'; print '<a href="'.$_SERVER["PHP_SELF"].'?action=setdoc&amp;value='.$name.'&amp;scandir='.$module->scandir.'&amp;label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"),'off').'</a>';
print '<a href="'.$_SERVER["PHP_SELF"].'?action=specimen&module='.$name.'">'.img_object($langs->trans("Preview"),'sending').'</a>'; }
print '</td>'; print '</td>';
print '</tr>'; // Info
$htmltooltip = ''.$langs->trans("Type").': '.($module->type?$module->type:$langs->trans("Unknown"));
$htmltooltip.='<br>'.$langs->trans("Width").'/'.$langs->trans("Height").': '.$module->page_largeur.'/'.$module->page_hauteur;
$htmltooltip.='<br><br><u>'.$langs->trans("FeaturesSupported").'</u>:';
$htmltooltip.='<br>'.$langs->trans("Logo").': '.yn($module->option_logo,1,1);
print '<td align="center">';
print $form->textwithpicto('',$htmltooltip,1,0);
print '</td>';
// Preview
print '<td align="center">';
if ($module->type == 'pdf')
{
print '<a href="'.$_SERVER["PHP_SELF"].'?action=specimen&module='.$name.'">'.img_object($langs->trans("Preview"),'sending').'</a>';
}
else
{
print img_object($langs->trans("PreviewNotAvailable"),'generic');
}
print '</td>';
print '</tr>';
}
}
} }
} }
closedir($handle);
} }
} }
} }

View File

@ -117,4 +117,3 @@ print info_admin($langs->trans("SystemInfoDesc")).'<br>';
llxFooter(); llxFooter();
$db->close(); $db->close();

View File

@ -102,7 +102,7 @@ $hookmanager->initHooks(array('categorycard'));
$parameters=array('id'=>$socid); $parameters=array('id'=>$socid);
$reshook=$hookmanager->executeHooks('doActions',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks $reshook=$hookmanager->executeHooks('doActions',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks
$error=$hookmanager->error; $errors=array_merge($errors, (array) $hookmanager->errors); if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
if (empty($reshook)) if (empty($reshook))
{ {

View File

@ -219,6 +219,7 @@ if ($action == 'add')
if ($value['id'] > 0) if ($value['id'] > 0)
{ {
$usertodo->fetch($value['id']); $usertodo->fetch($value['id']);
$object->userownerid = $usertodo->id;
} }
$object->usertodo = $usertodo; $object->usertodo = $usertodo;
$object->transparency = (GETPOST("transparency")=='on'?1:0); $object->transparency = (GETPOST("transparency")=='on'?1:0);
@ -235,17 +236,21 @@ if ($action == 'add')
if ($_POST["doneby"] > 0) if ($_POST["doneby"] > 0)
{ {
$userdone->fetch($_POST["doneby"]); $userdone->fetch($_POST["doneby"]);
$object->userdoneid = $userdone->id;
} }
$object->userdone = $userdone; $object->userdone = $userdone;
} }
$object->note = trim($_POST["note"]); $object->note = trim($_POST["note"]);
if (isset($_POST["contactid"])) $object->contact = $contact; if (isset($_POST["contactid"])) $object->contact = $contact;
if (GETPOST('socid','int') > 0) if (GETPOST('socid','int') > 0)
{ {
$societe = new Societe($db); $societe = new Societe($db);
$societe->fetch(GETPOST('socid','int')); $societe->fetch(GETPOST('socid','int'));
$object->societe = $societe; $object->societe = $societe; // deprecated
$object->thirdparty = $societe;
} }
// Special for module webcal and phenix // Special for module webcal and phenix
@ -359,8 +364,10 @@ if ($action == 'update')
$object->priority = $_POST["priority"]; $object->priority = $_POST["priority"];
$object->fulldayevent= $_POST["fullday"]?1:0; $object->fulldayevent= $_POST["fullday"]?1:0;
$object->location = GETPOST('location'); $object->location = GETPOST('location');
$object->societe->id = $_POST["socid"]; $object->socid = $_POST["socid"];
$object->contact->id = $_POST["contactid"]; $object->contactid = $_POST["contactid"];
$object->societe->id = $_POST["socid"]; // deprecated
$object->contact->id = $_POST["contactid"]; // deprecated
$object->fk_project = $_POST["projectid"]; $object->fk_project = $_POST["projectid"];
$object->note = $_POST["note"]; $object->note = $_POST["note"];
$object->pnote = $_POST["note"]; $object->pnote = $_POST["note"];
@ -795,22 +802,16 @@ if ($action == 'create')
if ($id > 0) if ($id > 0)
{ {
$result1=$object->fetch($id); $result1=$object->fetch($id);
$result2=$object->fetch_userassigned(); $result2=$object->fetch_thirdparty();
$result3=$object->fetch_optionals($id,$extralabels); $result3=$object->fetch_userassigned();
$result4=$object->fetch_optionals($id,$extralabels);
if ($result1 < 0 || $result2 < 0 || $result3 < 0) if ($result1 < 0 || $result2 < 0 || $result3 < 0 || $result4 < 0)
{ {
dol_print_error($db,$object->error); dol_print_error($db,$object->error);
exit; exit;
} }
$societe = new Societe($db);
if ($object->societe->id)
{
$result=$societe->fetch($object->societe->id);
}
$object->societe = $societe;
if ($object->author->id > 0) { $tmpuser=new User($db); $res=$tmpuser->fetch($object->author->id); $object->author=$tmpuser; } if ($object->author->id > 0) { $tmpuser=new User($db); $res=$tmpuser->fetch($object->author->id); $object->author=$tmpuser; }
if ($object->usermod->id > 0) { $tmpuser=new User($db); $res=$tmpuser->fetch($object->usermod->id); $object->usermod=$tmpuser; } if ($object->usermod->id > 0) { $tmpuser=new User($db); $res=$tmpuser->fetch($object->usermod->id); $object->usermod=$tmpuser; }
if ($object->usertodo->id > 0) { $tmpuser=new User($db); $res=$tmpuser->fetch($object->usertodo->id); $object->usertodo=$tmpuser; } if ($object->usertodo->id > 0) { $tmpuser=new User($db); $res=$tmpuser->fetch($object->usertodo->id); $object->usertodo=$tmpuser; }
@ -959,12 +960,12 @@ if ($id > 0)
print '<td>'; print '<td>';
$events=array(); $events=array();
$events[]=array('method' => 'getContacts', 'url' => dol_buildpath('/core/ajax/contacts.php',1), 'htmlname' => 'contactid', 'params' => array('add-customer-contact' => 'disabled')); $events[]=array('method' => 'getContacts', 'url' => dol_buildpath('/core/ajax/contacts.php',1), 'htmlname' => 'contactid', 'params' => array('add-customer-contact' => 'disabled'));
print $form->select_company($object->societe->id,'socid','',1,1,0,$events); print $form->select_company($object->thirdparty->id,'socid','',1,1,0,$events);
print '</td>'; print '</td>';
// Contact // Contact
print '<td>'.$langs->trans("Contact").'</td><td width="30%">'; print '<td>'.$langs->trans("Contact").'</td><td width="30%">';
$form->select_contacts($object->societe->id, $object->contact->id,'contactid',1); $form->select_contacts($object->thirdparty->id, $object->contact->id,'contactid',1);
print '</td></tr>'; print '</td></tr>';
} }
@ -978,7 +979,7 @@ if ($id > 0)
$langs->load("project"); $langs->load("project");
print '<tr><td width="30%" valign="top">'.$langs->trans("Project").'</td><td colspan="3">'; print '<tr><td width="30%" valign="top">'.$langs->trans("Project").'</td><td colspan="3">';
$numprojet=$formproject->select_projects($object->societe->id,$object->fk_project,'projectid'); $numprojet=$formproject->select_projects($object->thirdparty->id,$object->fk_project,'projectid');
if ($numprojet==0) if ($numprojet==0)
{ {
print ' &nbsp; <a href="../../projet/card.php?socid='.$societe->id.'&action=create">'.$langs->trans("AddProject").'</a>'; print ' &nbsp; <a href="../../projet/card.php?socid='.$societe->id.'&action=create">'.$langs->trans("AddProject").'</a>';
@ -1152,12 +1153,12 @@ if ($id > 0)
// Third party - Contact // Third party - Contact
if ($conf->societe->enabled) if ($conf->societe->enabled)
{ {
print '<tr><td width="30%">'.$langs->trans("ActionOnCompany").'</td><td>'.($object->societe->id?$object->societe->getNomUrl(1):$langs->trans("None")); print '<tr><td width="30%">'.$langs->trans("ActionOnCompany").'</td><td>'.($object->thirdparty->id?$object->thirdparty->getNomUrl(1):$langs->trans("None"));
if ($object->societe->id && $object->type_code == 'AC_TEL') if (is_object($object->thirdparty) && $object->thirdparty->id > 0 && $object->type_code == 'AC_TEL')
{ {
if ($object->societe->fetch($object->societe->id)) if ($object->thirdparty->fetch($object->thirdparty->id))
{ {
print "<br>".dol_print_phone($object->societe->phone); print "<br>".dol_print_phone($object->thirdparty->phone);
} }
} }
print '</td>'; print '</td>';

View File

@ -47,8 +47,10 @@ class ActionComm extends CommonObject
var $datec; // Date creation record (datec) var $datec; // Date creation record (datec)
var $datem; // Date modification record (tms) var $datem; // Date modification record (tms)
var $author; // Object user that create action var $author; // Object user that create action //deprecated
var $usermod; // Object user that modified action var $usermod; // Object user that modified action // deprecated
var $authorid; // Id user that create action
var $usermodid; // Id user that modified action
var $datep; // Date action start (datep) var $datep; // Date action start (datep)
var $datef; // Date action end (datep2) var $datef; // Date action end (datep2)
@ -63,8 +65,9 @@ class ActionComm extends CommonObject
var $note; // Description var $note; // Description
var $userassigned = array(); // Array of user ids var $userassigned = array(); // Array of user ids
var $usertodo; // Object user of owner var $userownerid; // Id of user owner
var $userdone; // Object user that did action (deprecated) var $usertodo; // Object user of owner // deprecated
var $userdone; // Object user that did action // deprecated
var $socid; var $socid;
var $contactid; var $contactid;
@ -134,6 +137,9 @@ class ActionComm extends CommonObject
if ($this->elementtype=='commande') $this->elementtype='order'; if ($this->elementtype=='commande') $this->elementtype='order';
if ($this->elementtype=='contrat') $this->elementtype='contract'; if ($this->elementtype=='contrat') $this->elementtype='contract';
$userownerid=isset($this->usertodo->id)?$this->usertodo->id:$this->userownerid; // For backward compatibility
$userdoneid=isset($this->userdone->id)?$this->userdone->id:$this->userdoneid; // For backward compatibility
if (! $this->type_id && $this->type_code) if (! $this->type_id && $this->type_code)
{ {
// Get id from code // Get id from code
@ -192,13 +198,13 @@ class ActionComm extends CommonObject
$sql.= (isset($this->durationp) && $this->durationp >= 0 && $this->durationp != ''?"'".$this->durationp."'":"null").","; // deprecated $sql.= (isset($this->durationp) && $this->durationp >= 0 && $this->durationp != ''?"'".$this->durationp."'":"null").","; // deprecated
$sql.= (isset($this->type_id)?$this->type_id:"null").","; $sql.= (isset($this->type_id)?$this->type_id:"null").",";
$sql.= (isset($this->code)?" '".$this->code."'":"null").","; $sql.= (isset($this->code)?" '".$this->code."'":"null").",";
$sql.= (isset($this->societe->id) && $this->societe->id > 0?" '".$this->societe->id."'":"null").","; $sql.= (isset($this->socid) && $this->socid > 0?" '".$this->socid."'":"null").",";
$sql.= (isset($this->fk_project) && $this->fk_project > 0?" '".$this->fk_project."'":"null").","; $sql.= (isset($this->fk_project) && $this->fk_project > 0?" '".$this->fk_project."'":"null").",";
$sql.= " '".$this->db->escape($this->note)."',"; $sql.= " '".$this->db->escape($this->note)."',";
$sql.= (isset($this->contact->id) && $this->contact->id > 0?"'".$this->contact->id."'":"null").","; $sql.= (isset($this->contactid) && $this->contactid > 0?"'".$this->contactid."'":"null").",";
$sql.= (isset($user->id) && $user->id > 0 ? "'".$user->id."'":"null").","; $sql.= (isset($user->id) && $user->id > 0 ? "'".$user->id."'":"null").",";
$sql.= (isset($this->usertodo->id) && $this->usertodo->id > 0?"'".$this->usertodo->id."'":"null").","; $sql.= ($userownerid>0?"'".$userownerid."'":"null").",";
$sql.= (isset($this->userdone->id) && $this->userdone->id > 0?"'".$this->userdone->id."'":"null").","; $sql.= ($userdoneid>0?"'".$userdoneid."'":"null").",";
$sql.= "'".$this->db->escape($this->label)."','".$this->percentage."','".$this->priority."','".$this->fulldayevent."','".$this->db->escape($this->location)."','".$this->punctual."',"; $sql.= "'".$this->db->escape($this->label)."','".$this->percentage."','".$this->priority."','".$this->fulldayevent."','".$this->db->escape($this->location)."','".$this->punctual."',";
$sql.= "'".$this->transparency."',"; $sql.= "'".$this->transparency."',";
$sql.= (! empty($this->fk_element)?$this->fk_element:"null").","; $sql.= (! empty($this->fk_element)?$this->fk_element:"null").",";
@ -351,17 +357,20 @@ class ActionComm extends CommonObject
$this->author->lastname = $obj->lastname; $this->author->lastname = $obj->lastname;
$this->usermod->id = $obj->fk_user_mod; $this->usermod->id = $obj->fk_user_mod;
$this->usertodo->id = $obj->fk_user_action; $this->userownerid = $obj->fk_user_action;
$this->userdone->id = $obj->fk_user_done; $this->usertodo->id = $obj->fk_user_action; // deprecated
//$this->userdone->id = $obj->fk_user_done;
$this->priority = $obj->priority; $this->priority = $obj->priority;
$this->fulldayevent = $obj->fulldayevent; $this->fulldayevent = $obj->fulldayevent;
$this->location = $obj->location; $this->location = $obj->location;
$this->transparency = $obj->transparency; $this->transparency = $obj->transparency;
$this->socid = $obj->fk_soc; // To have fetch_thirdparty method working $this->socid = $obj->fk_soc; // To have fetch_thirdparty method working
$this->societe->id = $obj->fk_soc; $this->contactid = $obj->fk_contact;
$this->contact->id = $obj->fk_contact; $this->fk_project = $obj->fk_project; // To have fetch_project method working
$this->fk_project = $obj->fk_project;
$this->societe->id = $obj->fk_soc; // For backward compatibility
$this->contact->id = $obj->fk_contact; // For backward compatibility
$this->fk_element = $obj->fk_element; $this->fk_element = $obj->fk_element;
$this->elementtype = $obj->elementtype; $this->elementtype = $obj->elementtype;
@ -378,19 +387,25 @@ class ActionComm extends CommonObject
/** /**
* Initialize this->userassigned array * Initialize this->userassigned array with list of id of user assigned to event
* *
* @return int <0 if KO, >0 if OK * @return int <0 if KO, >0 if OK
*/ */
function fetch_userassigned() function fetch_userassigned()
{ {
global $langs; global $langs;
$sql.="SELECT fk_actioncomm, element_type, fk_element, answer_status, mandatory, transparency"; $sql.="SELECT fk_actioncomm, element_type, fk_element, answer_status, mandatory, transparency";
$sql.=" FROM ".MAIN_DB_PREFIX."actioncomm_resources"; $sql.=" FROM ".MAIN_DB_PREFIX."actioncomm_resources";
$sql.=" WHERE element_type = 'user' AND fk_actioncomm = ".$this->id; $sql.=" WHERE element_type = 'user' AND fk_actioncomm = ".$this->id;
$resql2=$this->db->query($sql); $resql2=$this->db->query($sql);
if ($resql2) if ($resql2)
{ {
$this->userassigned=array();
// If owner is known, we must but id first into list
if ($this->userownerid > 0) $this->userassigned[$this->userownerid]=array('id'=>$this->userownerid); // Set first so will be first into list.
while ($obj = $this->db->fetch_object($resql2)) while ($obj = $this->db->fetch_object($resql2))
{ {
$this->userassigned[$obj->fk_element]=array('id'=>$obj->fk_element, 'mandatory'=>$obj->mandatory, 'answer_status'=>$obj->answer_status, 'transparency'=>$obj->transparency); $this->userassigned[$obj->fk_element]=array('id'=>$obj->fk_element, 'mandatory'=>$obj->mandatory, 'answer_status'=>$obj->answer_status, 'transparency'=>$obj->transparency);

View File

@ -1,6 +1,6 @@
<?php <?php
/* Copyright (C) 2002-2003 Rodolphe Quiedeville <rodolphe@quiedeville.org> /* Copyright (C) 2002-2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2005 Laurent Destailleur <eldy@users.sourceforge.net> * Copyright (C) 2004-2014 Laurent Destailleur <eldy@users.sourceforge.net>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
@ -37,6 +37,7 @@ class CActionComm
var $type; var $type;
var $libelle; var $libelle;
var $active; var $active;
var $color;
var $type_actions=array(); var $type_actions=array();
@ -59,7 +60,7 @@ class CActionComm
*/ */
function fetch($id) function fetch($id)
{ {
$sql = "SELECT id, code, type, libelle, active"; $sql = "SELECT id, code, type, libelle, color, active";
$sql.= " FROM ".MAIN_DB_PREFIX."c_actioncomm"; $sql.= " FROM ".MAIN_DB_PREFIX."c_actioncomm";
if (is_numeric($id)) $sql.= " WHERE id=".$id; if (is_numeric($id)) $sql.= " WHERE id=".$id;
else $sql.= " WHERE code='".$id."'"; else $sql.= " WHERE code='".$id."'";
@ -77,12 +78,13 @@ class CActionComm
$this->type = $obj->type; $this->type = $obj->type;
$this->libelle = $obj->libelle; $this->libelle = $obj->libelle;
$this->active = $obj->active; $this->active = $obj->active;
$this->color = $obj->color;
$this->db->free($resql); $this->db->free($resql);
return 1; return 1;
} }
else else
{ {
$this->db->free($resql); $this->db->free($resql);
return 0; return 0;
} }
@ -95,7 +97,7 @@ class CActionComm
} }
/** /**
* Return list of event types * Return list of event types: array(id=>label) or array(code=>label)
* *
* @param int $active 1 or 0 to filter on event state active or not ('' by default = no filter) * @param int $active 1 or 0 to filter on event state active or not ('' by default = no filter)
* @param string $idorcode 'id' or 'code' * @param string $idorcode 'id' or 'code'
@ -111,7 +113,7 @@ class CActionComm
$repid = array(); $repid = array();
$repcode = array(); $repcode = array();
$sql = "SELECT id, code, libelle, module, type"; $sql = "SELECT id, code, libelle, module, type, color";
$sql.= " FROM ".MAIN_DB_PREFIX."c_actioncomm"; $sql.= " FROM ".MAIN_DB_PREFIX."c_actioncomm";
if ($active != '') $sql.=" WHERE active=".$active; if ($active != '') $sql.=" WHERE active=".$active;
if (! empty($excludetype)) $sql.=($active != ''?" AND":" WHERE")." type <> '".$excludetype."'"; if (! empty($excludetype)) $sql.=($active != ''?" AND":" WHERE")." type <> '".$excludetype."'";

View File

@ -60,12 +60,7 @@ $object = new ActionComm($db);
if ($objectid > 0) if ($objectid > 0)
{ {
$ret = $object->fetch($objectid); $ret = $object->fetch($objectid);
if ($ret > 0) { $object->fetch_thirdparty();
$company=new Societe($db);
$company->fetch($object->societe->id);
$object->societe=$company; // For backward compatibility
$object->thirdparty=$company;
}
} }
// Get parameters // Get parameters
@ -112,7 +107,7 @@ if ($object->id > 0)
$now=dol_now(); $now=dol_now();
$delay_warning=$conf->global->MAIN_DELAY_ACTIONS_TODO*24*60*60; $delay_warning=$conf->global->MAIN_DELAY_ACTIONS_TODO*24*60*60;
dol_fiche_head($head, 'documents', $langs->trans("Action"),0,'action'); dol_fiche_head($head, 'documents', $langs->trans("Action"),0,'action');
// Affichage fiche action en mode visu // Affichage fiche action en mode visu
@ -202,17 +197,17 @@ if ($object->id > 0)
print '<tr><td width="30%" class="nowrap">'.$langs->trans("ActionAffectedTo").'</td><td>'; print '<tr><td width="30%" class="nowrap">'.$langs->trans("ActionAffectedTo").'</td><td>';
if ($object->usertodo->id > 0) print $object->usertodo->getNomUrl(1); if ($object->usertodo->id > 0) print $object->usertodo->getNomUrl(1);
print '</td></tr>'; print '</td></tr>';
print '</table><br><br><table class="border" width="100%">'; print '</table><br><br><table class="border" width="100%">';
// Third party - Contact // Third party - Contact
print '<tr><td width="30%">'.$langs->trans("ActionOnCompany").'</td><td>'.($object->societe->id?$object->societe->getNomUrl(1):$langs->trans("None")); print '<tr><td width="30%">'.$langs->trans("ActionOnCompany").'</td><td>'.($object->thirdparty->id?$object->thirdparty->getNomUrl(1):$langs->trans("None"));
if ($object->societe->id && $object->type_code == 'AC_TEL') if (is_object($object->thirdparty) && $object->thirdparty->id > 0 && $object->type_code == 'AC_TEL')
{ {
if ($object->societe->fetch($object->societe->id)) if ($object->thirdparty->fetch($object->thirdparty->id))
{ {
print "<br>".dol_print_phone($object->societe->phone); print "<br>".dol_print_phone($object->thirdparty->phone);
} }
} }
print '</td>'; print '</td>';

View File

@ -419,6 +419,7 @@ if ($actioncode) $sql.=" AND ca.code='".$db->escape($actioncode)."'";
if ($pid) $sql.=" AND a.fk_project=".$db->escape($pid); if ($pid) $sql.=" AND a.fk_project=".$db->escape($pid);
if (! $user->rights->societe->client->voir && ! $socid) $sql.= " AND (a.fk_soc IS NULL OR sc.fk_user = " .$user->id . ")"; if (! $user->rights->societe->client->voir && ! $socid) $sql.= " AND (a.fk_soc IS NULL OR sc.fk_user = " .$user->id . ")";
if ($socid > 0) $sql.= ' AND a.fk_soc = '.$socid; if ($socid > 0) $sql.= ' AND a.fk_soc = '.$socid;
// FIXME: We must filter on assignement table
if ($usergroup > 0) $sql.= " AND ugu.fk_user = a.fk_user_action"; if ($usergroup > 0) $sql.= " AND ugu.fk_user = a.fk_user_action";
if ($action == 'show_day') if ($action == 'show_day')
{ {
@ -453,6 +454,7 @@ if ($status == '-1') { $sql.= " AND a.percent = -1"; } // Not applicable
if ($status == '50') { $sql.= " AND (a.percent > 0 AND a.percent < 100)"; } // Running already started if ($status == '50') { $sql.= " AND (a.percent > 0 AND a.percent < 100)"; } // Running already started
if ($status == 'done' || $status == '100') { $sql.= " AND (a.percent = 100 OR (a.percent = -1 AND a.datep2 <= '".$db->idate($now)."'))"; } if ($status == 'done' || $status == '100') { $sql.= " AND (a.percent = 100 OR (a.percent = -1 AND a.datep2 <= '".$db->idate($now)."'))"; }
if ($status == 'todo') { $sql.= " AND ((a.percent >= 0 AND a.percent < 100) OR (a.percent = -1 AND a.datep2 > '".$db->idate($now)."'))"; } if ($status == 'todo') { $sql.= " AND ((a.percent >= 0 AND a.percent < 100) OR (a.percent = -1 AND a.datep2 > '".$db->idate($now)."'))"; }
// FIXME: We must filter on assignement table
if ($filtera > 0 || $filtert > 0 || $filterd > 0 || $usergroup > 0) if ($filtera > 0 || $filtert > 0 || $filterd > 0 || $usergroup > 0)
{ {
$sql.= " AND ("; $sql.= " AND (";
@ -484,10 +486,12 @@ if ($resql)
$event->type_code=$obj->code; $event->type_code=$obj->code;
$event->libelle=$obj->label; $event->libelle=$obj->label;
$event->percentage=$obj->percent; $event->percentage=$obj->percent;
$event->author->id=$obj->fk_user_author; // user id of creator //$event->author->id=$obj->fk_user_author; // user id of creator
$event->usertodo->id=$obj->fk_user_action; // user id of owner $event->authorid=$obj->fk_user_author; // user id of creator
$event->userdone->id=$obj->fk_user_done; // deprecated $event->userownerid=$obj->fk_user_action; // user id of owner
// $event->userstodo=... with s after user, in future version, will be an array with all id of user assigned to event $event->fetch_userassigned(); // This load $event->userassigned
//$event->usertodo->id=$obj->fk_user_action; // user id of owner
//$event->userdone->id=$obj->fk_user_done; // deprecated
$event->priority=$obj->priority; $event->priority=$obj->priority;
$event->fulldayevent=$obj->fulldayevent; $event->fulldayevent=$obj->fulldayevent;
$event->location=$obj->location; $event->location=$obj->location;
@ -1069,7 +1073,7 @@ $db->close();
* @param int $year Year * @param int $year Year
* @param int $monthshown Current month shown in calendar view * @param int $monthshown Current month shown in calendar view
* @param string $style Style to use for this day * @param string $style Style to use for this day
* @param array &$eventarray Array of events * @param array $eventarray Array of events
* @param int $maxprint Nb of actions to show each day on month view (0 means no limit) * @param int $maxprint Nb of actions to show each day on month view (0 means no limit)
* @param int $maxnbofchar Nb of characters to show for event line * @param int $maxnbofchar Nb of characters to show for event line
* @param string $newparam Parameters on current URL * @param string $newparam Parameters on current URL
@ -1132,19 +1136,19 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa
{ {
if ($i < $maxprint || $maxprint == 0 || ! empty($conf->global->MAIN_JS_SWITCH_AGENDA)) if ($i < $maxprint || $maxprint == 0 || ! empty($conf->global->MAIN_JS_SWITCH_AGENDA))
{ {
$ponct=($event->date_start_in_calendar == $event->date_end_in_calendar); $keysofuserassigned=array_keys($event->userassigned);
$ponct=($event->date_start_in_calendar == $event->date_end_in_calendar);
// Define $color and $cssclass of event // Define $color and $cssclass of event
$color=-1; $cssclass=''; $colorindex=-1; $color=-1; $cssclass=''; $colorindex=-1;
if ((! empty($event->author->id) && $event->author->id == $user->id) if (in_array($user->id, $keysofuserassigned))
|| (! empty($event->usertodo->id) && $event->usertodo->id == $user->id) {
|| (! empty($event->userdone->id) && $event->userdone->id == $user->id)) $nummytasks++; $cssclass='family_mytasks';
{
$nummytasks++; $cssclass='family_mytasks';
// TODO Set a color using user color // TODO Set a color using user color
// Must defined rule to choose color of who to use. // Must defined rule to choose color of who to use.
// event->usertodo->id will still contains user id of owner // event->ownerid will still contains user id of owner
// event->userstodo will be an array in future. // event->userassigned will be an array in future.
// $color=$user->color; // $color=$user->color;
} }
else if ($event->type_code == 'ICALEVENT') else if ($event->type_code == 'ICALEVENT')
@ -1164,7 +1168,7 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa
if ($color == -1) // Color was not forced. Set color according to color index. if ($color == -1) // Color was not forced. Set color according to color index.
{ {
// Define color index if not yet defined // Define color index if not yet defined
$idusertouse=($event->usertodo->id?$event->usertodo->id:0); $idusertouse=($event->userownerid?$event->userownerid:0);
if (isset($colorindexused[$idusertouse])) if (isset($colorindexused[$idusertouse]))
{ {
$colorindex=$colorindexused[$idusertouse]; // Color already assigned to this user $colorindex=$colorindexused[$idusertouse]; // Color already assigned to this user
@ -1344,7 +1348,7 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa
} }
else else
{ {
print '<a href="'.DOL_URL_ROOT.'/comm/action/index.php?maxprint=0&month='.$monthshown.'&year='.$year; print '<a href="'.DOL_URL_ROOT.'/comm/action/index.php?action='.$action.'&maxprint=0&month='.$monthshown.'&year='.$year;
print ($status?'&status='.$status:'').($filter?'&filter='.$filter:''); print ($status?'&status='.$status:'').($filter?'&filter='.$filter:'');
print ($filtera?'&filtera='.$filtera:'').($filtert?'&filtert='.$filtert:'').($filterd?'&filterd='.$filterd:''); print ($filtera?'&filtera='.$filtera:'').($filtert?'&filtert='.$filtert:'').($filterd?'&filterd='.$filterd:'');
print ($actioncode!=''?'&actioncode='.$actioncode:''); print ($actioncode!=''?'&actioncode='.$actioncode:'');

View File

@ -163,6 +163,7 @@ if ($actioncode) $sql.=" AND c.code='".$db->escape($actioncode)."'";
if ($pid) $sql.=" AND a.fk_project=".$db->escape($pid); if ($pid) $sql.=" AND a.fk_project=".$db->escape($pid);
if (! $user->rights->societe->client->voir && ! $socid) $sql.= " AND (a.fk_soc IS NULL OR sc.fk_user = " .$user->id . ")"; if (! $user->rights->societe->client->voir && ! $socid) $sql.= " AND (a.fk_soc IS NULL OR sc.fk_user = " .$user->id . ")";
if ($socid > 0) $sql.= " AND s.rowid = ".$socid; if ($socid > 0) $sql.= " AND s.rowid = ".$socid;
// FIXME: We must filter on assignement table
if ($usergroup > 0) $sql.= " AND ugu.fk_user = a.fk_user_action"; if ($usergroup > 0) $sql.= " AND ugu.fk_user = a.fk_user_action";
if ($type) $sql.= " AND c.id = ".$type; if ($type) $sql.= " AND c.id = ".$type;
if ($status == '0') { $sql.= " AND a.percent = 0"; } if ($status == '0') { $sql.= " AND a.percent = 0"; }
@ -170,6 +171,7 @@ if ($status == '-1') { $sql.= " AND a.percent = -1"; } // Not applicable
if ($status == '50') { $sql.= " AND (a.percent > 0 AND a.percent < 100)"; } // Running already started if ($status == '50') { $sql.= " AND (a.percent > 0 AND a.percent < 100)"; } // Running already started
if ($status == 'done' || $status == '100') { $sql.= " AND (a.percent = 100 OR (a.percent = -1 AND a.datep2 <= '".$db->idate($now)."'))"; } if ($status == 'done' || $status == '100') { $sql.= " AND (a.percent = 100 OR (a.percent = -1 AND a.datep2 <= '".$db->idate($now)."'))"; }
if ($status == 'todo') { $sql.= " AND ((a.percent >= 0 AND a.percent < 100) OR (a.percent = -1 AND a.datep2 > '".$db->idate($now)."'))"; } if ($status == 'todo') { $sql.= " AND ((a.percent >= 0 AND a.percent < 100) OR (a.percent = -1 AND a.datep2 > '".$db->idate($now)."'))"; }
// FIXME: We must filter on assignement table
if ($filtera > 0 || $filtert > 0 || $filterd > 0 || $usergroup > 0) if ($filtera > 0 || $filtert > 0 || $filterd > 0 || $usergroup > 0)
{ {
$sql.= " AND ("; $sql.= " AND (";

View File

@ -335,6 +335,7 @@ if ($actioncode) $sql.=" AND ca.code='".$db->escape($actioncode)."'";
if ($pid) $sql.=" AND a.fk_project=".$db->escape($pid); if ($pid) $sql.=" AND a.fk_project=".$db->escape($pid);
if (! $user->rights->societe->client->voir && ! $socid) $sql.= " AND (a.fk_soc IS NULL OR sc.fk_user = " .$user->id . ")"; if (! $user->rights->societe->client->voir && ! $socid) $sql.= " AND (a.fk_soc IS NULL OR sc.fk_user = " .$user->id . ")";
if ($socid > 0) $sql.= ' AND a.fk_soc = '.$socid; if ($socid > 0) $sql.= ' AND a.fk_soc = '.$socid;
// FIXME: We must filter on assignement table
if ($usergroup > 0) $sql.= " AND ugu.fk_user = a.fk_user_action"; if ($usergroup > 0) $sql.= " AND ugu.fk_user = a.fk_user_action";
if ($action == 'show_day') if ($action == 'show_day')
{ {
@ -369,6 +370,7 @@ if ($status == '-1') { $sql.= " AND a.percent = -1"; } // Not applicable
if ($status == '50') { $sql.= " AND (a.percent > 0 AND a.percent < 100)"; } // Running already started if ($status == '50') { $sql.= " AND (a.percent > 0 AND a.percent < 100)"; } // Running already started
if ($status == 'done' || $status == '100') { $sql.= " AND (a.percent = 100 OR (a.percent = -1 AND a.datep2 <= '".$db->idate($now)."'))"; } if ($status == 'done' || $status == '100') { $sql.= " AND (a.percent = 100 OR (a.percent = -1 AND a.datep2 <= '".$db->idate($now)."'))"; }
if ($status == 'todo') { $sql.= " AND ((a.percent >= 0 AND a.percent < 100) OR (a.percent = -1 AND a.datep2 > '".$db->idate($now)."'))"; } if ($status == 'todo') { $sql.= " AND ((a.percent >= 0 AND a.percent < 100) OR (a.percent = -1 AND a.datep2 > '".$db->idate($now)."'))"; }
// FIXME: We must filter on assignement table
if ($filtera > 0 || $filtert > 0 || $filterd > 0 || $usergroup > 0) if ($filtera > 0 || $filtert > 0 || $filterd > 0 || $usergroup > 0)
{ {
$sql.= " AND ("; $sql.= " AND (";
@ -398,13 +400,14 @@ if ($resql)
$event->datep=$db->jdate($obj->datep); // datep and datef are GMT date $event->datep=$db->jdate($obj->datep); // datep and datef are GMT date
$event->datef=$db->jdate($obj->datep2); $event->datef=$db->jdate($obj->datep2);
$event->type_code=$obj->code; $event->type_code=$obj->code;
$event->libelle=$obj->label; // deprecated //$event->libelle=$obj->label; // deprecated
$event->label=$obj->label; $event->label=$obj->label;
$event->percentage=$obj->percent; $event->percentage=$obj->percent;
$event->author->id=$obj->fk_user_author; // user id of creator //$event->author->id=$obj->fk_user_author; // user id of creator
$event->usertodo->id=$obj->fk_user_action; // user id of owner $event->authorid=$obj->fk_user_author; // user id of creator
$event->userdone->id=$obj->fk_user_done; // deprecated $event->userownerid=$obj->fk_user_action; // user id of owner
// $event->userstodo=... with s after user, in future version, will be an array with all id of user assigned to event $event->fetch_userassigned(); // This load $event->userassigned
//$event->userdone->id=$obj->fk_user_done; // deprecated
$event->priority=$obj->priority; $event->priority=$obj->priority;
$event->fulldayevent=$obj->fulldayevent; $event->fulldayevent=$obj->fulldayevent;
$event->location=$obj->location; $event->location=$obj->location;
@ -412,8 +415,8 @@ if ($resql)
$event->socid=$obj->fk_soc; $event->socid=$obj->fk_soc;
$event->contactid=$obj->fk_contact; $event->contactid=$obj->fk_contact;
$event->societe->id=$obj->fk_soc; //$event->societe->id=$obj->fk_soc; // deprecated
$event->contact->id=$obj->fk_contact; //$event->contact->id=$obj->fk_contact; // deprecated
// Defined date_start_in_calendar and date_end_in_calendar property // Defined date_start_in_calendar and date_end_in_calendar property
// They are date start and end of action but modified to not be outside calendar view. // They are date start and end of action but modified to not be outside calendar view.
@ -424,7 +427,7 @@ if ($resql)
else $event->date_end_in_calendar=$event->datep; else $event->date_end_in_calendar=$event->datep;
} }
else else
{ {
$event->date_start_in_calendar=$event->datep; $event->date_start_in_calendar=$event->datep;
if ($event->datef != '' && $event->datef >= $event->datep) $event->date_end_in_calendar=$event->datef; if ($event->datef != '' && $event->datef >= $event->datep) $event->date_end_in_calendar=$event->datef;
else $event->date_end_in_calendar=$event->datep; else $event->date_end_in_calendar=$event->datep;
@ -442,7 +445,7 @@ if ($resql)
// This record is out of visible range // This record is out of visible range
} }
else else
{ {
if ($event->date_start_in_calendar < $firstdaytoshow) $event->date_start_in_calendar=$firstdaytoshow; if ($event->date_start_in_calendar < $firstdaytoshow) $event->date_start_in_calendar=$firstdaytoshow;
if ($event->date_end_in_calendar > $lastdaytoshow) $event->date_end_in_calendar=$lastdaytoshow; if ($event->date_end_in_calendar > $lastdaytoshow) $event->date_end_in_calendar=$lastdaytoshow;
@ -598,6 +601,9 @@ else
$usernames = $tmpgroup->listUsersForGroup(); $usernames = $tmpgroup->listUsersForGroup();
} }
// Load array of colors by type
// TODO
$colorsbytype=array();
// Loop on each user to show calendar // Loop on each user to show calendar
$sav = $tmpday; $sav = $tmpday;
@ -608,6 +614,7 @@ foreach ($usernames as $username)
echo '<td class="cal_current_month">' . $username->getNomUrl(1). '</td>'; echo '<td class="cal_current_month">' . $username->getNomUrl(1). '</td>';
$tmpday = $sav; $tmpday = $sav;
// Lopp on each day of week
$i = 0; $i = 0;
for ($iter_day = 0; $iter_day < 7; $iter_day++) for ($iter_day = 0; $iter_day < 7; $iter_day++)
{ {
@ -631,7 +638,7 @@ foreach ($usernames as $username)
if ($todayarray['mday']==$tmpday && $todayarray['mon']==$month && $todayarray['year']==$year) $today=1; if ($todayarray['mday']==$tmpday && $todayarray['mon']==$month && $todayarray['year']==$year) $today=1;
if ($today) $style='cal_today_peruser'; if ($today) $style='cal_today_peruser';
show_day_events2($username, $tmpday, $month, $year, $monthshown, $style, $eventarray, 0, $maxnbofchar, $newparam, 1, 300, $showheader); show_day_events2($username, $tmpday, $month, $year, $monthshown, $style, $eventarray, 0, $maxnbofchar, $newparam, 1, 300, $showheader, $colorsbytype);
$i++; $i++;
} }
@ -695,7 +702,7 @@ $db->close();
* @param int $year Year * @param int $year Year
* @param int $monthshown Current month shown in calendar view * @param int $monthshown Current month shown in calendar view
* @param string $style Style to use for this day * @param string $style Style to use for this day
* @param array &$eventarray Array of events * @param array $eventarray Array of events
* @param int $maxprint Nb of actions to show each day on month view (0 means no limit) * @param int $maxprint Nb of actions to show each day on month view (0 means no limit)
* @param int $maxnbofchar Nb of characters to show for event line * @param int $maxnbofchar Nb of characters to show for event line
* @param string $newparam Parameters on current URL * @param string $newparam Parameters on current URL
@ -721,8 +728,9 @@ function show_day_events2($username, $day, $month, $year, $monthshown, $style, &
$i=0; $nummytasks=0; $numother=0; $numbirthday=0; $numical=0; $numicals=array(); $i=0; $nummytasks=0; $numother=0; $numbirthday=0; $numical=0; $numicals=array();
$ymd=sprintf("%04d",$year).sprintf("%02d",$month).sprintf("%02d",$day); $ymd=sprintf("%04d",$year).sprintf("%02d",$month).sprintf("%02d",$day);
$nextindextouse=count($colorindexused); // At first run this is 0, so fist user has 0, next 1, ... $nextindextouse=count($colorindexused); // At first run, this is 0, so fist user has 0, next 1, ...
// We are in a particular day for $username, now we scan all events
foreach ($eventarray as $daykey => $notused) foreach ($eventarray as $daykey => $notused)
{ {
$annee = date('Y',$daykey); $annee = date('Y',$daykey);
@ -733,17 +741,18 @@ function show_day_events2($username, $day, $month, $year, $monthshown, $style, &
//Tout les events à la même date : //Tout les events à la même date :
foreach ($eventarray[$daykey] as $index => $event) foreach ($eventarray[$daykey] as $index => $event)
{ {
if ($username->id != $event->usertodo->id) continue; // We discard record if event is from another user than user we want to show $keysofuserassigned=array_keys($event->userassigned);
if (! in_array($username->id,$keysofuserassigned)) continue; // We discard record if event is from another user than user we want to show
//if ($username->id != $event->userownerid) continue; // We discard record if event is from another user than user we want to show
$ponct=($event->date_start_in_calendar == $event->date_end_in_calendar); $ponct=($event->date_start_in_calendar == $event->date_end_in_calendar);
// Define $color and $cssclass of event // Define $color and $cssclass of event
$color=-1; $cssclass=''; $colorindex=-1; $color=-1; $cssclass=''; $colorindex=-1;
if ((! empty($event->author->id) && $event->author->id == $user->id) if (in_array($user->id, $keysofuserassigned))
|| (! empty($event->usertodo->id) && $event->usertodo->id == $user->id)
|| (! empty($event->userdone->id) && $event->userdone->id == $user->id))
{ {
$nummytasks++; $cssclass='family_mytasks'; $nummytasks++; $cssclass='family_mytasks';
// TODO Set color according to event type
} }
else if ($event->type_code == 'ICALEVENT') else if ($event->type_code == 'ICALEVENT')
{ {
@ -765,7 +774,7 @@ function show_day_events2($username, $day, $month, $year, $monthshown, $style, &
if ($color == -1) // Color was not forced. Set color according to color index. if ($color == -1) // Color was not forced. Set color according to color index.
{ {
// Define color index if not yet defined // Define color index if not yet defined
$idusertouse=($event->usertodo->id?$event->usertodo->id:0); $idusertouse=($event->userownerid?$event->userownerid:0);
if (isset($colorindexused[$idusertouse])) if (isset($colorindexused[$idusertouse]))
{ {
$colorindex=$colorindexused[$idusertouse]; // Color already assigned to this user $colorindex=$colorindexused[$idusertouse]; // Color already assigned to this user

View File

@ -78,6 +78,7 @@ $object = new Societe($db);
$parameters = array('socid' => $id); $parameters = array('socid' => $id);
$reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some $reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some
if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
if ($action == 'setcustomeraccountancycode') if ($action == 'setcustomeraccountancycode')

View File

@ -73,6 +73,7 @@ $hookmanager->initHooks(array('customerlist'));
$parameters=array(); $parameters=array();
$reshook=$hookmanager->executeHooks('doActions',$parameters); // Note that $action and $object may have been modified by some hooks $reshook=$hookmanager->executeHooks('doActions',$parameters); // Note that $action and $object may have been modified by some hooks
if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
// Do we click on purge search criteria ? // Do we click on purge search criteria ?
if (GETPOST("button_removefilter_x")) if (GETPOST("button_removefilter_x"))
@ -269,7 +270,7 @@ if ($result)
print '<td align="center">'.$thirdpartystatic->getLibStatut(3); print '<td align="center">'.$thirdpartystatic->getLibStatut(3);
print '</td>'; print '</td>';
print '<td></td>'; print '<td></td>';
$parameters=array('obj' => $obj); $parameters=array('obj' => $obj);
$formconfirm=$hookmanager->executeHooks('printFieldListValue',$parameters); // Note that $action and $object may have been modified by hook $formconfirm=$hookmanager->executeHooks('printFieldListValue',$parameters); // Note that $action and $object may have been modified by hook

View File

@ -101,6 +101,7 @@ $object->substitutionarrayfortest=array(
$parameters=array(); $parameters=array();
$reshook=$hookmanager->executeHooks('doActions',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks $reshook=$hookmanager->executeHooks('doActions',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks
if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
// Action clone object // Action clone object
if ($action == 'confirm_clone' && $confirm == 'yes') if ($action == 'confirm_clone' && $confirm == 'yes')

View File

@ -105,8 +105,8 @@ $permissionnote = $user->rights->propale->creer; // Used by the include of actio
*/ */
$parameters = array('socid' => $socid); $parameters = array('socid' => $socid);
$reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some $reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
// hooks if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
include DOL_DOCUMENT_ROOT . '/core/actions_setnotes.inc.php'; // Must be include, not includ_once include DOL_DOCUMENT_ROOT . '/core/actions_setnotes.inc.php'; // Must be include, not includ_once

View File

@ -91,6 +91,7 @@ $hookmanager->initHooks(array('propallist'));
$parameters=array('socid'=>$socid); $parameters=array('socid'=>$socid);
$reshook=$hookmanager->executeHooks('doActions',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks $reshook=$hookmanager->executeHooks('doActions',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks
if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
// Do we click on purge search criteria ? // Do we click on purge search criteria ?
if (GETPOST("button_removefilter_x")) if (GETPOST("button_removefilter_x"))

View File

@ -161,6 +161,7 @@ $hookmanager->initHooks(array('prospectlist'));
$parameters=array(); $parameters=array();
$reshook=$hookmanager->executeHooks('doActions',$parameters); // Note that $action and $object may have been modified by some hooks $reshook=$hookmanager->executeHooks('doActions',$parameters); // Note that $action and $object may have been modified by some hooks
if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
if ($action == 'cstc') if ($action == 'cstc')
{ {

View File

@ -100,6 +100,7 @@ $permissionnote = $user->rights->commande->creer; // Used by the include of acti
$parameters = array('socid' => $socid); $parameters = array('socid' => $socid);
$reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks $reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
include DOL_DOCUMENT_ROOT . '/core/actions_setnotes.inc.php'; // Must be include, not includ_once include DOL_DOCUMENT_ROOT . '/core/actions_setnotes.inc.php'; // Must be include, not includ_once
@ -371,11 +372,11 @@ else if ($action == 'add' && $user->rights->commande->creer) {
// If some invoice's lines already known // If some invoice's lines already known
$NBLINES = 8; $NBLINES = 8;
for($i = 1; $i <= $NBLINES; $i ++) { for($i = 1; $i <= $NBLINES; $i ++) {
if ($_POST ['idprod' . $i]) { if ($_POST['idprod' . $i]) {
$xid = 'idprod' . $i; $xid = 'idprod' . $i;
$xqty = 'qty' . $i; $xqty = 'qty' . $i;
$xremise = 'remise_percent' . $i; $xremise = 'remise_percent' . $i;
$object->add_product($_POST [$xid], $_POST [$xqty], $_POST [$xremise]); $object->add_product($_POST[$xid], $_POST[$xqty], $_POST[$xremise]);
} }
} }
} }
@ -546,7 +547,7 @@ else if ($action == 'addline' && $user->rights->commande->creer) {
if (is_array($extralabelsline)) { if (is_array($extralabelsline)) {
// Get extra fields // Get extra fields
foreach ($extralabelsline as $key => $value) { foreach ($extralabelsline as $key => $value) {
unset($_POST ["options_" . $key]); unset($_POST["options_" . $key]);
} }
} }
@ -725,23 +726,23 @@ else if ($action == 'addline' && $user->rights->commande->creer) {
$object->generateDocument($object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref); $object->generateDocument($object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref);
} }
unset($_POST ['prod_entry_mode']); unset($_POST['prod_entry_mode']);
unset($_POST ['qty']); unset($_POST['qty']);
unset($_POST ['type']); unset($_POST['type']);
unset($_POST ['remise_percent']); unset($_POST['remise_percent']);
unset($_POST ['price_ht']); unset($_POST['price_ht']);
unset($_POST ['price_ttc']); unset($_POST['price_ttc']);
unset($_POST ['tva_tx']); unset($_POST['tva_tx']);
unset($_POST ['product_ref']); unset($_POST['product_ref']);
unset($_POST ['product_label']); unset($_POST['product_label']);
unset($_POST ['product_desc']); unset($_POST['product_desc']);
unset($_POST ['fournprice']); unset($_POST['fournprice']);
unset($_POST ['buying_price']); unset($_POST['buying_price']);
unset($_POST ['np_marginRate']); unset($_POST['np_marginRate']);
unset($_POST ['np_markRate']); unset($_POST['np_markRate']);
unset($_POST ['dp_desc']); unset($_POST['dp_desc']);
unset($_POST ['idprod']); unset($_POST['idprod']);
unset($_POST['date_starthour']); unset($_POST['date_starthour']);
unset($_POST['date_startmin']); unset($_POST['date_startmin']);
@ -796,7 +797,7 @@ else if ($action == 'updateligne' && $user->rights->commande->creer && GETPOST('
// Unset extrafield POST Data // Unset extrafield POST Data
if (is_array($extralabelsline)) { if (is_array($extralabelsline)) {
foreach ($extralabelsline as $key => $value) { foreach ($extralabelsline as $key => $value) {
unset($_POST ["options_" . $key]); unset($_POST["options_" . $key]);
} }
} }
@ -850,18 +851,18 @@ else if ($action == 'updateligne' && $user->rights->commande->creer && GETPOST('
$object->generateDocument($object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref); $object->generateDocument($object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref);
} }
unset($_POST ['qty']); unset($_POST['qty']);
unset($_POST ['type']); unset($_POST['type']);
unset($_POST ['productid']); unset($_POST['productid']);
unset($_POST ['remise_percent']); unset($_POST['remise_percent']);
unset($_POST ['price_ht']); unset($_POST['price_ht']);
unset($_POST ['price_ttc']); unset($_POST['price_ttc']);
unset($_POST ['tva_tx']); unset($_POST['tva_tx']);
unset($_POST ['product_ref']); unset($_POST['product_ref']);
unset($_POST ['product_label']); unset($_POST['product_label']);
unset($_POST ['product_desc']); unset($_POST['product_desc']);
unset($_POST ['fournprice']); unset($_POST['fournprice']);
unset($_POST ['buying_price']); unset($_POST['buying_price']);
} else { } else {
setEventMessage($object->error, 'errors'); setEventMessage($object->error, 'errors');
} }
@ -1699,6 +1700,8 @@ if ($action == 'create' && $user->rights->commande->creer) {
$author = new User($db); $author = new User($db);
$author->fetch($object->user_author_id); $author->fetch($object->user_author_id);
$res = $object->fetch_optionals($object->id, $extralabels);
$head = commande_prepare_head($object); $head = commande_prepare_head($object);
dol_fiche_head($head, 'order', $langs->trans("CustomerOrder"), 0, 'order'); dol_fiche_head($head, 'order', $langs->trans("CustomerOrder"), 0, 'order');
@ -2120,30 +2123,38 @@ if ($action == 'create' && $user->rights->commande->creer) {
} }
// Other attributes (TODO Move this into an include) // Other attributes (TODO Move this into an include)
$res = $object->fetch_optionals($object->id, $extralabels);
$parameters = array('colspan' => ' colspan="3"'); $parameters = array('colspan' => ' colspan="3"');
$reshook = $hookmanager->executeHooks('formObjectOptions', $parameters, $object, $action); // Note that $action and $object may have been modified by $reshook = $hookmanager->executeHooks('formObjectOptions', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
// hook if (empty($reshook) && ! empty($extrafields->attribute_label))
if (empty($reshook) && ! empty($extrafields->attribute_label)) { {
foreach ($extrafields->attribute_label as $key => $label) { foreach ($extrafields->attribute_label as $key => $label)
if ($action == 'edit_extras') { {
$value = (isset($_POST ["options_" . $key]) ? $_POST ["options_" . $key] : $object->array_options ["options_" . $key]); if ($action == 'edit_extras')
} else { {
$value = $object->array_options ["options_" . $key]; $value = (isset($_POST["options_".$key])?$_POST["options_".$key]:$object->array_options["options_".$key]);
} }
if ($extrafields->attribute_type [$key] == 'separate') { else
{
$value = $object->array_options["options_" . $key];
}
if ($extrafields->attribute_type[$key] == 'separate')
{
print $extrafields->showSeparator($key); print $extrafields->showSeparator($key);
} else { }
else
{
print '<tr><td'; print '<tr><td';
if (! empty($extrafields->attribute_required [$key])) if (! empty($extrafields->attribute_required [$key])) print ' class="fieldrequired"';
print ' class="fieldrequired"';
print '>' . $label . '</td><td colspan="5">'; print '>' . $label . '</td><td colspan="5">';
// Convert date into timestamp format // Convert date into timestamp format
if (in_array($extrafields->attribute_type [$key], array('date','datetime'))) { if (in_array($extrafields->attribute_type [$key], array('date','datetime')))
$value = isset($_POST ["options_" . $key]) ? dol_mktime($_POST ["options_" . $key . "hour"], $_POST ["options_" . $key . "min"], 0, $_POST ["options_" . $key . "month"], $_POST ["options_" . $key . "day"], $_POST ["options_" . $key . "year"]) : $db->jdate($object->array_options ['options_' . $key]); {
$value = isset($_POST["options_" . $key]) ? dol_mktime($_POST["options_" . $key . "hour"], $_POST["options_" . $key . "min"], 0, $_POST["options_" . $key . "month"], $_POST["options_" . $key . "day"], $_POST["options_" . $key . "year"]) : $db->jdate($object->array_options ['options_' . $key]);
} }
if ($action == 'edit_extras' && $user->rights->commande->creer && GETPOST('attribute') == $key) { if ($action == 'edit_extras' && $user->rights->commande->creer && GETPOST('attribute') == $key)
{
print '<form enctype="multipart/form-data" action="' . $_SERVER["PHP_SELF"] . '" method="post" name="formsoc">'; print '<form enctype="multipart/form-data" action="' . $_SERVER["PHP_SELF"] . '" method="post" name="formsoc">';
print '<input type="hidden" name="action" value="update_extras">'; print '<input type="hidden" name="action" value="update_extras">';
print '<input type="hidden" name="attribute" value="' . $key . '">'; print '<input type="hidden" name="attribute" value="' . $key . '">';
@ -2154,7 +2165,9 @@ if ($action == 'create' && $user->rights->commande->creer) {
print '<input type="submit" class="button" value="' . $langs->trans('Modify') . '">'; print '<input type="submit" class="button" value="' . $langs->trans('Modify') . '">';
print '</form>'; print '</form>';
} else { }
else
{
print $extrafields->showOutputField($key, $value); print $extrafields->showOutputField($key, $value);
if ($object->statut == 0 && $user->rights->commande->creer) if ($object->statut == 0 && $user->rights->commande->creer)
print '<a href="' . $_SERVER['PHP_SELF'] . '?id=' . $object->id . '&action=edit_extras&attribute=' . $key . '">' . img_picto('', 'edit') . ' ' . $langs->trans('Modify') . '</a>'; print '<a href="' . $_SERVER['PHP_SELF'] . '?id=' . $object->id . '&action=edit_extras&attribute=' . $key . '">' . img_picto('', 'edit') . ' ' . $langs->trans('Modify') . '</a>';

View File

@ -78,6 +78,7 @@ $hookmanager->initHooks(array('orderlist'));
$parameters=array('socid'=>$socid); $parameters=array('socid'=>$socid);
$reshook=$hookmanager->executeHooks('doActions',$parameters,$object,$action); // Note that $action and $object may have been modified by some hook $reshook=$hookmanager->executeHooks('doActions',$parameters,$object,$action); // Note that $action and $object may have been modified by some hook
if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
// Do we click on purge search criteria ? // Do we click on purge search criteria ?
if (GETPOST("button_removefilter_x")) if (GETPOST("button_removefilter_x"))
@ -423,7 +424,7 @@ if ($resql)
print '</form>'."\n"; print '</form>'."\n";
print '<br>'.img_help(1,'').' '.$langs->trans("ToBillSeveralOrderSelectCustomer", $langs->transnoentitiesnoconv("CreateInvoiceForThisCustomer")).'<br>'; print '<br>'.img_help(1,'').' '.$langs->trans("ToBillSeveralOrderSelectCustomer", $langs->transnoentitiesnoconv("CreateInvoiceForThisCustomer")).'<br>';
$db->free($resql); $db->free($resql);
} }
else else

View File

@ -111,6 +111,7 @@ $permissionnote = $user->rights->facture->creer; // Used by the include of actio
$parameters = array('socid' => $socid); $parameters = array('socid' => $socid);
$reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks $reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
include DOL_DOCUMENT_ROOT . '/core/actions_setnotes.inc.php'; // Must be include, not includ_once include DOL_DOCUMENT_ROOT . '/core/actions_setnotes.inc.php'; // Must be include, not includ_once

View File

@ -108,6 +108,7 @@ $now=dol_now();
$parameters=array('socid'=>$socid); $parameters=array('socid'=>$socid);
$reshook=$hookmanager->executeHooks('doActions',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks $reshook=$hookmanager->executeHooks('doActions',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks
if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
// Do we click on purge search criteria ? // Do we click on purge search criteria ?
if (GETPOST("button_removefilter_x")) if (GETPOST("button_removefilter_x"))

View File

@ -71,10 +71,13 @@ $hookmanager->initHooks(array('paiementcard'));
$parameters=array('socid'=>$socid); $parameters=array('socid'=>$socid);
$reshook=$hookmanager->executeHooks('doActions',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks $reshook=$hookmanager->executeHooks('doActions',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks
if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
/* /*
* Actions * Actions
*/ */
if ($action == 'add_paiement' || ($action == 'confirm_paiement' && $confirm=='yes')) if ($action == 'add_paiement' || ($action == 'confirm_paiement' && $confirm=='yes'))
{ {
$error = 0; $error = 0;

View File

@ -164,7 +164,7 @@ class BonPrelevement extends CommonObject
/** /**
* Add line to withdrawal * Add line to withdrawal
* *
* @param int &$line_id id line to add * @param int $line_id id line to add
* @param int $client_id id invoice customer * @param int $client_id id invoice customer
* @param string $client_nom name of cliente * @param string $client_nom name of cliente
* @param int $amount amount of invoice * @param int $amount amount of invoice

View File

@ -149,6 +149,68 @@ if ($action == 'update' && ! $_POST["cancel"] && $user->rights->tax->charges->cr
} }
} }
// Action clone object
if ($action == 'confirm_clone' && $confirm != 'yes') { $action=''; }
if ($action == 'confirm_clone' && $confirm == 'yes' && ($user->rights->tax->charges->creer))
{
$db->begin();
$originalId = $id;
$object = new ChargeSociales($db);
$object->fetch($id);
if ($object->id > 0)
{
$object->paye = 0;
$object->id = $object->ref = null;
if(GETPOST('clone_for_next_month') != '') {
$object->date_ech = strtotime('+1month', $object->date_ech);
$object->periode = strtotime('+1month', $object->periode);
}
if ($object->check())
{
$id = $object->create($user);
if ($id > 0)
{
$db->commit();
$db->close();
header("Location: ".$_SERVER["PHP_SELF"]."?id=".$id);
exit;
}
else
{
$id=$originalId;
$db->rollback();
if (count($object->errors))
{
setEventMessage($object->errors, 'errors');
dol_print_error($db,$object->errors);
}
else
{
setEventMessage($langs->trans($object->error), 'errors');
dol_print_error($db,$object->error);
}
}
}
}
else
{
$db->rollback();
dol_print_error($db,$object->error);
}
}
/* /*
@ -239,7 +301,18 @@ if ($id > 0)
$head=tax_prepare_head($object); $head=tax_prepare_head($object);
dol_fiche_head($head, 'card', $langs->trans("SocialContribution"),0,'bill'); dol_fiche_head($head, 'card', $langs->trans("SocialContribution"),0,'bill');
// Clone confirmation
if ($action === 'clone')
{
$formclone=array(
array('type' => 'checkbox', 'name' => 'clone_for_next_month','label' => $langs->trans("CloneTaxForNextMonth"), 'value' => 1),
);
print $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id,$langs->trans('CloneTax'),$langs->trans('ConfirmCloneTax',$object->ref),'confirm_clone',$formclone,'yes');
}
// Confirmation de la suppression de la charge // Confirmation de la suppression de la charge
if ($action == 'paid') if ($action == 'paid')
{ {
@ -419,6 +492,12 @@ if ($id > 0)
{ {
print "<a class=\"butAction\" href=\"".DOL_URL_ROOT."/compta/sociales/charges.php?id=$object->id&amp;action=paid\">".$langs->trans("ClassifyPaid")."</a>"; print "<a class=\"butAction\" href=\"".DOL_URL_ROOT."/compta/sociales/charges.php?id=$object->id&amp;action=paid\">".$langs->trans("ClassifyPaid")."</a>";
} }
// Clone
if ($user->rights->tax->charges->creer)
{
print "<a class=\"butAction\" href=\"".dol_buildpath("/compta/sociales/charges.php",1). "?id=$object->id&amp;action=clone\">".$langs->trans("ToClone")."</a>";
}
// Delete // Delete
if ($user->rights->tax->charges->supprimer) if ($user->rights->tax->charges->supprimer)

View File

@ -106,7 +106,24 @@ class ChargeSociales extends CommonObject
return -1; return -1;
} }
} }
/*
* Check if a social contribution can be created into database
*
*/
function check() {
$newamount=price2num($this->amount,'MT');
// Validation parametres
if (! $newamount > 0 || empty($this->date_ech) || empty($this->periode))
{
return false;
}
return true;
}
/** /**
* Create a social contribution into database * Create a social contribution into database
@ -121,12 +138,11 @@ class ChargeSociales extends CommonObject
// Nettoyage parametres // Nettoyage parametres
$newamount=price2num($this->amount,'MT'); $newamount=price2num($this->amount,'MT');
// Validation parametres if(!$this->check()) {
if (! $newamount > 0 || empty($this->date_ech) || empty($this->periode)) $this->error="ErrorBadParameter";
{ return -2;
$this->error="ErrorBadParameter"; }
return -2;
}
$this->db->begin(); $this->db->begin();

View File

@ -94,7 +94,7 @@ abstract class ActionsContactCardCommon
/** /**
* Load data control * Load data control
* *
* @param string &$action Type of action * @param string $action Type of action
* @param int $id Id of object * @param int $id Id of object
* @return void * @return void
*/ */
@ -228,7 +228,7 @@ abstract class ActionsContactCardCommon
/** /**
* Set content of ->tpl array, to use into template * Set content of ->tpl array, to use into template
* *
* @param string &$action Type of action * @param string $action Type of action
* @param int $id Id * @param int $id Id
* @return string HTML output * @return string HTML output
*/ */

View File

@ -75,7 +75,7 @@ class ActionsContactCardDefault extends ActionsContactCardCommon
/** /**
* Assign custom values for canvas * Assign custom values for canvas
* *
* @param string &$action Type of action * @param string $action Type of action
* @param int $id Id * @param int $id Id
* @return void * @return void
*/ */

View File

@ -83,7 +83,7 @@ $hookmanager->initHooks(array('contactcard'));
$parameters=array('id'=>$id, 'objcanvas'=>$objcanvas); $parameters=array('id'=>$id, 'objcanvas'=>$objcanvas);
$reshook=$hookmanager->executeHooks('doActions',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks $reshook=$hookmanager->executeHooks('doActions',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks
$error=$hookmanager->error; $errors=array_merge($errors, (array) $hookmanager->errors); if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
if (empty($reshook)) if (empty($reshook))
{ {
@ -142,10 +142,10 @@ if (empty($reshook))
{ {
setEventMessage($object->error,'errors'); setEventMessage($object->error,'errors');
} }
else else
{ {
header("Location: ".$_SERVER['PHP_SELF'].'?id='.$id); header("Location: ".$_SERVER['PHP_SELF'].'?id='.$id);
exit; exit;
} }
} }
@ -157,11 +157,11 @@ if (empty($reshook))
{ {
setEventMessage($object->error,'errors'); setEventMessage($object->error,'errors');
} }
else else
{ {
header("Location: ".$_SERVER['PHP_SELF'].'?id='.$id); header("Location: ".$_SERVER['PHP_SELF'].'?id='.$id);
exit; exit;
} }
} }
// Add contact // Add contact
@ -380,7 +380,7 @@ else
$title = (! empty($conf->global->SOCIETE_ADDRESSES_MANAGEMENT) ? $langs->trans("Contacts") : $langs->trans("ContactsAddresses")); $title = (! empty($conf->global->SOCIETE_ADDRESSES_MANAGEMENT) ? $langs->trans("Contacts") : $langs->trans("ContactsAddresses"));
dol_fiche_head($head, 'card', $title, 0, 'contact'); dol_fiche_head($head, 'card', $title, 0, 'contact');
dol_htmloutput_events(); dol_htmloutput_events();
} }

View File

@ -1,5 +1,5 @@
<?php <?php
/* Copyright (C) 2011-2012 Regis Houssin <regis.houssin@capnetworks.com> /* Copyright (C) 2011-2014 Regis Houssin <regis.houssin@capnetworks.com>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
@ -98,7 +98,7 @@ if (! empty($field) && ! empty($element) && ! empty($table_element) && ! empty($
dol_include_once('/'.$module.'/class/actions_'.$subelement.'.class.php'); dol_include_once('/'.$module.'/class/actions_'.$subelement.'.class.php');
$classname = 'Actions'.ucfirst($subelement); $classname = 'Actions'.ucfirst($subelement);
$object = new $classname($db); $object = new $classname($db);
$ret = $object->$methodname(); $ret = $object->$methodname($fk_element);
if ($ret > 0) echo json_encode($object->$cachename); if ($ret > 0) echo json_encode($object->$cachename);
} }
} }

View File

@ -125,7 +125,7 @@ class Canvas
/** /**
* Shared method for canvas to assign values for templates * Shared method for canvas to assign values for templates
* *
* @param string &$action Action string * @param string $action Action string
* @param int $id Object id (if ref not provided) * @param int $id Object id (if ref not provided)
* @param string $ref Object ref (if id not provided) * @param string $ref Object ref (if id not provided)
* @return void * @return void
@ -181,7 +181,7 @@ class Canvas
/** /**
* Shared method for canvas to execute actions * Shared method for canvas to execute actions
* *
* @param string &$action Action string * @param string $action Action string
* @param int $id Object id * @param int $id Object id
* @return mixed Return return code of doActions of canvas * @return mixed Return return code of doActions of canvas
* @deprecated This function is called if you add a doActions class inside your canvas. Try to not * @deprecated This function is called if you add a doActions class inside your canvas. Try to not

View File

@ -1040,7 +1040,7 @@ class ExtraFields
* Fill array_options property of object by extrafields value (using for data sent by forms) * Fill array_options property of object by extrafields value (using for data sent by forms)
* *
* @param array $extralabels $array of extrafields * @param array $extralabels $array of extrafields
* @param object &$object Object * @param object $object Object
* @param string $onlykey Only following key is filled * @param string $onlykey Only following key is filled
* @return int 1 if array_options set / 0 if no value * @return int 1 if array_options set / 0 if no value
*/ */

View File

@ -114,8 +114,8 @@ class HookManager
* *
* @param string $method Name of method hooked ('doActions', 'printSearchForm', 'showInputField', ...) * @param string $method Name of method hooked ('doActions', 'printSearchForm', 'showInputField', ...)
* @param array $parameters Array of parameters * @param array $parameters Array of parameters
* @param Object &$object Object to use hooks on * @param Object $object Object to use hooks on
* @param string &$action Action code on calling page ('create', 'edit', 'view', 'add', 'update', 'delete'...) * @param string $action Action code on calling page ('create', 'edit', 'view', 'add', 'update', 'delete'...)
* @return mixed For doActions,formObjectOptions,pdf_xxx: Return 0 if we want to keep standard actions, >0 if if want to stop standard actions, <0 means KO. * @return mixed For doActions,formObjectOptions,pdf_xxx: Return 0 if we want to keep standard actions, >0 if if want to stop standard actions, <0 means KO.
* For printSearchForm,printLeftBlock,printTopRightMenu,formAddObjectLine,...: Return HTML string. TODO Deprecated. Must always return an int and things to print into ->resprints. * For printSearchForm,printLeftBlock,printTopRightMenu,formAddObjectLine,...: Return HTML string. TODO Deprecated. Must always return an int and things to print into ->resprints.
* Can also return some values into an array ->results. * Can also return some values into an array ->results.

View File

@ -4,7 +4,7 @@
* Copyright (C) 2004 Benoit Mortier <benoit.mortier@opensides.be> * Copyright (C) 2004 Benoit Mortier <benoit.mortier@opensides.be>
* Copyright (C) 2004 Sebastien Di Cintio <sdicintio@ressource-toi.org> * Copyright (C) 2004 Sebastien Di Cintio <sdicintio@ressource-toi.org>
* Copyright (C) 2004 Eric Seigne <eric.seigne@ryxeo.com> * Copyright (C) 2004 Eric Seigne <eric.seigne@ryxeo.com>
* Copyright (C) 2005-2013 Regis Houssin <regis.houssin@capnetworks.com> * Copyright (C) 2005-2014 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2006 Andre Cianfarani <acianfa@free.fr> * Copyright (C) 2006 Andre Cianfarani <acianfa@free.fr>
* Copyright (C) 2006 Marc Barilley/Ocebo <marc@ocebo.com> * Copyright (C) 2006 Marc Barilley/Ocebo <marc@ocebo.com>
* Copyright (C) 2007 Franky Van Liedekerke <franky.van.liedekerker@telenet.be> * Copyright (C) 2007 Franky Van Liedekerke <franky.van.liedekerker@telenet.be>
@ -124,11 +124,11 @@ class Form
* @param string $typeofdata Type of data ('string' by default, 'amount', 'email', 'numeric:99', 'text' or 'textarea:rows:cols', 'day' or 'datepicker', 'ckeditor:dolibarr_zzz:width:height:savemethod:toolbarstartexpanded:rows:cols', 'select:xxx'...) * @param string $typeofdata Type of data ('string' by default, 'amount', 'email', 'numeric:99', 'text' or 'textarea:rows:cols', 'day' or 'datepicker', 'ckeditor:dolibarr_zzz:width:height:savemethod:toolbarstartexpanded:rows:cols', 'select:xxx'...)
* @param string $editvalue When in edit mode, use this value as $value instead of value (for example, you can provide here a formated price instead of value). Use '' to use same than $value * @param string $editvalue When in edit mode, use this value as $value instead of value (for example, you can provide here a formated price instead of value). Use '' to use same than $value
* @param object $extObject External object * @param object $extObject External object
* @param string $success Success message * @param mixed $custommsg String or Array of custom messages : eg array('success' => 'MyMessage', 'error' => 'MyMessage')
* @param string $moreparam More param to add on a href URL * @param string $moreparam More param to add on a href URL
* @return string HTML edit field * @return string HTML edit field
*/ */
function editfieldval($text, $htmlname, $value, $object, $perm, $typeofdata='string', $editvalue='', $extObject=null, $success=null, $moreparam='') function editfieldval($text, $htmlname, $value, $object, $perm, $typeofdata='string', $editvalue='', $extObject=null, $custommsg=null, $moreparam='')
{ {
global $conf,$langs,$db; global $conf,$langs,$db;
@ -140,7 +140,7 @@ class Form
// When option to edit inline is activated // When option to edit inline is activated
if (! empty($conf->global->MAIN_USE_JQUERY_JEDITABLE) && ! preg_match('/^select;|datehourpicker/',$typeofdata)) // TODO add jquery timepicker if (! empty($conf->global->MAIN_USE_JQUERY_JEDITABLE) && ! preg_match('/^select;|datehourpicker/',$typeofdata)) // TODO add jquery timepicker
{ {
$ret.=$this->editInPlace($object, $value, $htmlname, $perm, $typeofdata, $editvalue, $extObject, $success); $ret.=$this->editInPlace($object, $value, $htmlname, $perm, $typeofdata, $editvalue, $extObject, $custommsg);
} }
else else
{ {
@ -244,10 +244,10 @@ class Form
* @param string $inputType Type of input ('numeric', 'datepicker', 'textarea:rows:cols', 'ckeditor:dolibarr_zzz:width:height:?:1:rows:cols', 'select:xxx') * @param string $inputType Type of input ('numeric', 'datepicker', 'textarea:rows:cols', 'ckeditor:dolibarr_zzz:width:height:?:1:rows:cols', 'select:xxx')
* @param string $editvalue When in edit mode, use this value as $value instead of value * @param string $editvalue When in edit mode, use this value as $value instead of value
* @param object $extObject External object * @param object $extObject External object
* @param string $success Success message * @param mixed $custommsg String or Array of custom messages : eg array('success' => 'MyMessage', 'error' => 'MyMessage')
* @return string HTML edit in place * @return string HTML edit in place
*/ */
private function editInPlace($object, $value, $htmlname, $condition, $inputType='textarea', $editvalue=null, $extObject=null, $success=null) private function editInPlace($object, $value, $htmlname, $condition, $inputType='textarea', $editvalue=null, $extObject=null, $custommsg=null)
{ {
global $conf; global $conf;
@ -334,7 +334,18 @@ class Form
$out.= '<input id="loadmethod_'.$htmlname.'" value="'.$loadmethod.'" type="hidden"/>'."\n"; $out.= '<input id="loadmethod_'.$htmlname.'" value="'.$loadmethod.'" type="hidden"/>'."\n";
if (! empty($savemethod)) $out.= '<input id="savemethod_'.$htmlname.'" value="'.$savemethod.'" type="hidden"/>'."\n"; if (! empty($savemethod)) $out.= '<input id="savemethod_'.$htmlname.'" value="'.$savemethod.'" type="hidden"/>'."\n";
if (! empty($ext_element)) $out.= '<input id="ext_element_'.$htmlname.'" value="'.$ext_element.'" type="hidden"/>'."\n"; if (! empty($ext_element)) $out.= '<input id="ext_element_'.$htmlname.'" value="'.$ext_element.'" type="hidden"/>'."\n";
if (! empty($success)) $out.= '<input id="success_'.$htmlname.'" value="'.$success.'" type="hidden"/>'."\n"; if (! empty($custommsg))
{
if (is_array($custommsg))
{
if (!empty($custommsg['success']))
$out.= '<input id="successmsg_'.$htmlname.'" value="'.$custommsg['success'].'" type="hidden"/>'."\n";
if (!empty($custommsg['error']))
$out.= '<input id="errormsg_'.$htmlname.'" value="'.$custommsg['error'].'" type="hidden"/>'."\n";
}
else
$out.= '<input id="successmsg_'.$htmlname.'" value="'.$custommsg.'" type="hidden"/>'."\n";
}
if ($inputType == 'textarea') { if ($inputType == 'textarea') {
$out.= '<input id="textarea_'.$htmlname.'_rows" value="'.$rows.'" type="hidden"/>'."\n"; $out.= '<input id="textarea_'.$htmlname.'_rows" value="'.$rows.'" type="hidden"/>'."\n";
$out.= '<input id="textarea_'.$htmlname.'_cols" value="'.$cols.'" type="hidden"/>'."\n"; $out.= '<input id="textarea_'.$htmlname.'_cols" value="'.$cols.'" type="hidden"/>'."\n";
@ -1318,7 +1329,9 @@ class Form
{ {
$assignedtouser=dol_json_decode($_SESSION['assignedtouser'], true); $assignedtouser=dol_json_decode($_SESSION['assignedtouser'], true);
} }
if (count($assignedtouser) && $action != 'view') $out.='<br>'; $numassignetouser=count($assignedtouser);
if ($numassignetouser && $action != 'view') $out.='<br>';
$i=0; $ownerid=0; $i=0; $ownerid=0;
foreach($assignedtouser as $key => $value) foreach($assignedtouser as $key => $value)
{ {
@ -1326,7 +1339,7 @@ class Form
$userstatic->fetch($value['id']); $userstatic->fetch($value['id']);
$out.=$userstatic->getNomUrl(1); $out.=$userstatic->getNomUrl(1);
if ($i == 0) { $ownerid = $value['id']; $out.=' ('.$langs->trans("Owner").')'; } if ($i == 0) { $ownerid = $value['id']; $out.=' ('.$langs->trans("Owner").')'; }
if ($i > 0 && $action != 'view') $out.=' <input type="image" style="border: 0px;" src="'.img_picto($langs->trans("Remove"), 'delete', '', 0, 1).'" value="'.$userstatic->id.'" class="removedassigned" id="removedassigned_'.$userstatic->id.'" name="removedassigned_'.$userstatic->id.'">'; if ($numassignetouser > 1 && $action != 'view') $out.=' <input type="image" style="border: 0px;" src="'.img_picto($langs->trans("Remove"), 'delete', '', 0, 1).'" value="'.$userstatic->id.'" class="removedassigned" id="removedassigned_'.$userstatic->id.'" name="removedassigned_'.$userstatic->id.'">';
//$out.=' '.($value['mandatory']?$langs->trans("Mandatory"):$langs->trans("Optional")); //$out.=' '.($value['mandatory']?$langs->trans("Mandatory"):$langs->trans("Optional"));
//$out.=' '.($value['transparency']?$langs->trans("Busy"):$langs->trans("NotBusy")); //$out.=' '.($value['transparency']?$langs->trans("Busy"):$langs->trans("NotBusy"));
$out.='<br>'; $out.='<br>';
@ -1575,9 +1588,9 @@ class Form
/** /**
* constructProductListOption * constructProductListOption
* *
* @param resultset &$objp Resultset of fetch * @param resultset $objp Resultset of fetch
* @param string &$opt Option * @param string $opt Option
* @param string &$optJson Option * @param string $optJson Option
* @param int $price_level Price level * @param int $price_level Price level
* @param string $selected Preselected value * @param string $selected Preselected value
* @return void * @return void
@ -2817,8 +2830,8 @@ class Form
} }
else if ($input['type'] == 'select') else if ($input['type'] == 'select')
{ {
$more.='<tr><td valign="top" style="padding: 4px !important;">'; $more.='<tr><td valign="top">';
if (! empty($input['label'])) $more.=$input['label'].'</td><td valign="top" colspan="2" align="left" style="padding: 4px !important;">'; if (! empty($input['label'])) $more.=$input['label'].'</td><td valign="top" colspan="2" align="left">';
$more.=$this->selectarray($input['name'],$input['values'],$input['default'],1); $more.=$this->selectarray($input['name'],$input['values'],$input['default'],1);
$more.='</td></tr>'."\n"; $more.='</td></tr>'."\n";
} }
@ -4289,7 +4302,7 @@ class Form
/** /**
* Return HTML code to output a barcode * Return HTML code to output a barcode
* *
* @param Object &$object Object containing data to retrieve file name * @param Object $object Object containing data to retrieve file name
* @param int $width Width of photo * @param int $width Width of photo
* @return string HTML code to output barcode * @return string HTML code to output barcode
*/ */

View File

@ -462,7 +462,7 @@ class FormOther
/** /**
* Write lines of a project (all lines of a project if parent = 0) * Write lines of a project (all lines of a project if parent = 0)
* *
* @param int &$inc Cursor counter * @param int $inc Cursor counter
* @param int $parent Id of parent task we want to see * @param int $parent Id of parent task we want to see
* @param array $lines Array of task lines * @param array $lines Array of task lines
* @param int $level Level * @param int $level Level

View File

@ -370,7 +370,7 @@ class Ldap
* Ldap object connect and bind must have been done * Ldap object connect and bind must have been done
* *
* @param string $dn DN entry key * @param string $dn DN entry key
* @param string[] $info Attributes array * @param array $info Attributes array
* @param User $user Objet user that create * @param User $user Objet user that create
* @return int <0 if KO, >0 if OK * @return int <0 if KO, >0 if OK
*/ */
@ -423,7 +423,7 @@ class Ldap
* Ldap object connect and bind must have been done * Ldap object connect and bind must have been done
* *
* @param string $dn DN entry key * @param string $dn DN entry key
* @param string[] $info Attributes array * @param array $info Attributes array
* @param string $user Objet user that modify * @param string $user Objet user that modify
* @return int <0 if KO, >0 if OK * @return int <0 if KO, >0 if OK
*/ */
@ -475,7 +475,7 @@ class Ldap
* Ldap object connect and bind must have been done * Ldap object connect and bind must have been done
* *
* @param string $dn DN entry key * @param string $dn DN entry key
* @param string[] $info Attributes array * @param array $info Attributes array
* @param User $user Objet user that update * @param User $user Objet user that update
* @param string $olddn Old DN entry key (before update) * @param string $olddn Old DN entry key (before update)
* @return int <0 if KO, >0 if OK * @return int <0 if KO, >0 if OK
@ -563,7 +563,7 @@ class Ldap
* Build a LDAP message * Build a LDAP message
* *
* @param string $dn DN entry key * @param string $dn DN entry key
* @param string[] $info Attributes array * @param array $info Attributes array
* @return string Content of file * @return string Content of file
*/ */
function dump_content($dn, $info) function dump_content($dn, $info)
@ -605,7 +605,7 @@ class Ldap
* Dump a LDAP message to ldapinput.in file * Dump a LDAP message to ldapinput.in file
* *
* @param string $dn DN entry key * @param string $dn DN entry key
* @param string[] $info Attributes array * @param array $info Attributes array
* @return int <0 if KO, >0 if OK * @return int <0 if KO, >0 if OK
*/ */
function dump($dn, $info) function dump($dn, $info)
@ -642,7 +642,7 @@ class Ldap
* Ldap object connect and bind must have been done * Ldap object connect and bind must have been done
* *
* @param string $dn DN entry key * @param string $dn DN entry key
* @param string[] $info Attributes array * @param array $info Attributes array
* @param User $user Objet user that create * @param User $user Objet user that create
* @return int <0 if KO, >0 if OK * @return int <0 if KO, >0 if OK
*/ */
@ -694,7 +694,7 @@ class Ldap
* Ldap object connect and bind must have been done * Ldap object connect and bind must have been done
* *
* @param string $dn DN entry key * @param string $dn DN entry key
* @param string[] $info Attributes array * @param array $info Attributes array
* @param User $user Objet user that create * @param User $user Objet user that create
* @return int <0 if KO, >0 if OK * @return int <0 if KO, >0 if OK
*/ */
@ -746,7 +746,7 @@ class Ldap
* Ldap object connect and bind must have been done * Ldap object connect and bind must have been done
* *
* @param string $dn DN entry key * @param string $dn DN entry key
* @param string[] $info Attributes array * @param array $info Attributes array
* @param User $user Objet user that create * @param User $user Objet user that create
* @return int <0 if KO, >0 if OK * @return int <0 if KO, >0 if OK
*/ */

View File

@ -222,7 +222,7 @@ class Link extends CommonObject
/** /**
* Loads all links from database * Loads all links from database
* *
* @param array &$links array of Link objects to fill * @param array $links array of Link objects to fill
* @param string $objecttype type of the associated object in dolibarr * @param string $objecttype type of the associated object in dolibarr
* @param int $objectid id of the associated object in dolibarr * @param int $objectid id of the associated object in dolibarr
* @param string $sortfield field used to sort * @param string $sortfield field used to sort

View File

@ -376,7 +376,7 @@ class Menubase
* @param string $myleftmenu Value for leftmenu to filter menu to load (always '') * @param string $myleftmenu Value for leftmenu to filter menu to load (always '')
* @param int $type_user 0=Menu for backoffice, 1=Menu for front office * @param int $type_user 0=Menu for backoffice, 1=Menu for front office
* @param string $menu_handler Filter on name of menu_handler used (auguria, eldy...) * @param string $menu_handler Filter on name of menu_handler used (auguria, eldy...)
* @param array &$tabMenu If array with menu entries already loaded, we put this array here (in most cases, it's empty) * @param array $tabMenu If array with menu entries already loaded, we put this array here (in most cases, it's empty)
* @return array Return array with menu entries for top menu * @return array Return array with menu entries for top menu
*/ */
function menuTopCharger($mymainmenu, $myleftmenu, $type_user, $menu_handler, &$tabMenu) function menuTopCharger($mymainmenu, $myleftmenu, $type_user, $menu_handler, &$tabMenu)
@ -404,7 +404,7 @@ class Menubase
* @param string $myleftmenu Value for leftmenu to filter menu to load (always '') * @param string $myleftmenu Value for leftmenu to filter menu to load (always '')
* @param int $type_user 0=Menu for backoffice, 1=Menu for front office * @param int $type_user 0=Menu for backoffice, 1=Menu for front office
* @param string $menu_handler Filter on name of menu_handler used (auguria, eldy...) * @param string $menu_handler Filter on name of menu_handler used (auguria, eldy...)
* @param array &$tabMenu Array with menu entries already loaded * @param array $tabMenu Array with menu entries already loaded
* @return Menu Menu array for particular mainmenu value or full tabArray * @return Menu Menu array for particular mainmenu value or full tabArray
*/ */
function menuLeftCharger($newmenu, $mymainmenu, $myleftmenu, $type_user, $menu_handler, &$tabMenu) function menuLeftCharger($newmenu, $mymainmenu, $myleftmenu, $type_user, $menu_handler, &$tabMenu)
@ -489,7 +489,7 @@ class Menubase
* @param string $myleftmenu Value for left that defined leftmenu * @param string $myleftmenu Value for left that defined leftmenu
* @param int $type_user Looks for menu entry for 0=Internal users, 1=External users * @param int $type_user Looks for menu entry for 0=Internal users, 1=External users
* @param string $menu_handler Name of menu_handler used ('auguria', 'eldy'...) * @param string $menu_handler Name of menu_handler used ('auguria', 'eldy'...)
* @param array &$tabMenu Array to store new entries found (in most cases, it's empty, but may be alreay filled) * @param array $tabMenu Array to store new entries found (in most cases, it's empty, but may be alreay filled)
* @return int >0 if OK, <0 if KO * @return int >0 if OK, <0 if KO
*/ */
function menuLoad($mymainmenu, $myleftmenu, $type_user, $menu_handler, &$tabMenu) function menuLoad($mymainmenu, $myleftmenu, $type_user, $menu_handler, &$tabMenu)

View File

@ -258,7 +258,7 @@ class RssParser
if (!is_resource($xmlparser)) { if (!is_resource($xmlparser)) {
$this->error="ErrorFailedToCreateParser"; return -1; $this->error="ErrorFailedToCreateParser"; return -1;
} }
xml_set_object($xmlparser, $this); xml_set_object($xmlparser, $this);
xml_set_element_handler($xmlparser, 'feed_start_element', 'feed_end_element'); xml_set_element_handler($xmlparser, 'feed_start_element', 'feed_end_element');
xml_set_character_data_handler($xmlparser, 'feed_cdata'); xml_set_character_data_handler($xmlparser, 'feed_cdata');
@ -268,7 +268,7 @@ class RssParser
//var_dump($rss->_format);exit; //var_dump($rss->_format);exit;
} }
} }
// If $rss loaded // If $rss loaded
if ($rss) if ($rss)
{ {
@ -452,7 +452,7 @@ class RssParser
* *
* @param string $p Start * @param string $p Start
* @param string $element Tag * @param string $element Tag
* @param array &$attrs Attributes of tags * @param array $attrs Attributes of tags
* @return void * @return void
*/ */
function feed_start_element($p, $element, &$attrs) function feed_start_element($p, $element, &$attrs)
@ -644,7 +644,7 @@ class RssParser
/** /**
* To concat 2 string with no warning if an operand is not defined * To concat 2 string with no warning if an operand is not defined
* *
* @param string &$str1 Str1 * @param string $str1 Str1
* @param string $str2 Str2 * @param string $str2 Str2
* @return string String cancatenated * @return string String cancatenated
*/ */

View File

@ -17,8 +17,8 @@
*/ */
/** /**
* \file htdocs/core/db/dolidb.class.php * \file htdocs/core/db/DoliDB.class.php
* \brief Class file to manage Dolibarr database access * \brief Class file to manage Dolibarr database access
*/ */
require_once DOL_DOCUMENT_ROOT .'/core/db/Database.interface.php'; require_once DOL_DOCUMENT_ROOT .'/core/db/Database.interface.php';

View File

@ -1,4 +1,4 @@
// Copyright (C) 2011-2012 Regis Houssin <regis.houssin@capnetworks.com> // Copyright (C) 2011-2014 Regis Houssin <regis.houssin@capnetworks.com>
// Copyright (C) 2011 Laurent Destailleur <eldy@users.sourceforge.net> // Copyright (C) 2011 Laurent Destailleur <eldy@users.sourceforge.net>
// //
// This program is free software; you can redistribute it and/or modify // This program is free software; you can redistribute it and/or modify
@ -358,12 +358,19 @@ $(document).ready(function() {
var res = $.parseJSON(result); var res = $.parseJSON(result);
if (res.error) { if (res.error) {
$(obj).html(obj.revert); $(obj).html(obj.revert);
$.jnotify(res.error, "error", true); var htmlname = $(obj).attr('id').substr(8);
var errormsg = $( '#errormsg_' + htmlname ).val();
if (errormsg != undefined) {
$.jnotify(errormsg, "error", true);
} else {
$.jnotify(res.error, "error", true);
}
} else { } else {
var htmlname = $(obj).attr('id').substr(8); var htmlname = $(obj).attr('id').substr(8);
var success = $( '#success_' + htmlname ).val(); var successmsg = $( '#successmsg_' + htmlname ).val();
if (success != undefined) { if (successmsg != undefined) {
$.jnotify(success, "ok"); $.jnotify(successmsg, "ok");
} }
$(obj).html(res.value); $(obj).html(res.value);
$(obj).hide(); $(obj).hide();

View File

@ -851,18 +851,18 @@ function unActivateModule($value, $requiredby=1)
/** /**
* Add external modules to list of dictionaries * Add external modules to list of dictionaries
* *
* @param array &$taborder Taborder * @param array $taborder Taborder
* @param array &$tabname Tabname * @param array $tabname Tabname
* @param array &$tablib Tablib * @param array $tablib Tablib
* @param array &$tabsql Tabsql * @param array $tabsql Tabsql
* @param array &$tabsqlsort Tabsqlsort * @param array $tabsqlsort Tabsqlsort
* @param array &$tabfield Tabfield * @param array $tabfield Tabfield
* @param array &$tabfieldvalue Tabfieldvalue * @param array $tabfieldvalue Tabfieldvalue
* @param array &$tabfieldinsert Tabfieldinsert * @param array $tabfieldinsert Tabfieldinsert
* @param array &$tabrowid Tabrowid * @param array $tabrowid Tabrowid
* @param array &$tabcond Tabcond * @param array $tabcond Tabcond
* @param array &$tabhelp Tabhelp * @param array $tabhelp Tabhelp
* @param array &$tabfieldcheck Tabfieldcheck * @param array $tabfieldcheck Tabfieldcheck
* @return int 1 * @return int 1
*/ */
function complete_dictionary_with_modules(&$taborder,&$tabname,&$tablib,&$tabsql,&$tabsqlsort,&$tabfield,&$tabfieldvalue,&$tabfieldinsert,&$tabrowid,&$tabcond,&$tabhelp,&$tabfieldcheck) function complete_dictionary_with_modules(&$taborder,&$tabname,&$tablib,&$tabsql,&$tabsqlsort,&$tabfield,&$tabfieldvalue,&$tabfieldinsert,&$tabrowid,&$tabcond,&$tabhelp,&$tabfieldcheck)

View File

@ -43,7 +43,7 @@ function dol_basename($pathfile)
* @param string $types Can be "directories", "files", or "all" * @param string $types Can be "directories", "files", or "all"
* @param int $recursive Determines whether subdirectories are searched * @param int $recursive Determines whether subdirectories are searched
* @param string $filter Regex filter to restrict list. This regex value must be escaped for '/', since this char is used for preg_match function * @param string $filter Regex filter to restrict list. This regex value must be escaped for '/', since this char is used for preg_match function
* @param string[] $excludefilter Array of Regex for exclude filter (example: array('(\.meta|_preview\.png)$','^\.')) * @param array $excludefilter Array of Regex for exclude filter (example: array('(\.meta|_preview\.png)$','^\.'))
* @param string $sortcriteria Sort criteria ("","fullname","name","date","size") * @param string $sortcriteria Sort criteria ("","fullname","name","date","size")
* @param string $sortorder Sort order (SORT_ASC, SORT_DESC) * @param string $sortorder Sort order (SORT_ASC, SORT_DESC)
* @param int $mode 0=Return array minimum keys loaded (faster), 1=Force all keys like date and size to be loaded (slower), 2=Force load of date only, 3=Force load of size only * @param int $mode 0=Return array minimum keys loaded (faster), 1=Force all keys like date and size to be loaded (slower), 2=Force load of date only, 3=Force load of size only
@ -1294,7 +1294,7 @@ function dol_uncompress($inputfile,$outputdir)
* *
* @param string $dir Directory to scan * @param string $dir Directory to scan
* @param string $regexfilter Regex filter to restrict list. This regex value must be escaped for '/', since this char is used for preg_match function * @param string $regexfilter Regex filter to restrict list. This regex value must be escaped for '/', since this char is used for preg_match function
* @param string[] $excludefilter Array of Regex for exclude filter (example: array('(\.meta|_preview\.png)$','^\.')). This regex value must be escaped for '/', since this char is used for preg_match function * @param array $excludefilter Array of Regex for exclude filter (example: array('(\.meta|_preview\.png)$','^\.')). This regex value must be escaped for '/', since this char is used for preg_match function
* @param int $nohook Disable all hooks * @param int $nohook Disable all hooks
* @return string Full path to most recent file * @return string Full path to most recent file
*/ */

View File

@ -3985,7 +3985,7 @@ function make_substitutions($chaine,$substitutionarray)
/** /**
* Complete the $substitutionarray with more entries * Complete the $substitutionarray with more entries
* *
* @param array &$substitutionarray Array substitution old value => new value value * @param array $substitutionarray Array substitution old value => new value value
* @param Translate $outputlangs If we want substitution from special constants, we provide a language * @param Translate $outputlangs If we want substitution from special constants, we provide a language
* @param Object $object If we want substitution from special constants, we provide data in a source object * @param Object $object If we want substitution from special constants, we provide data in a source object
* @param Mixed $parameters Add more parameters (useful to pass product lines) * @param Mixed $parameters Add more parameters (useful to pass product lines)
@ -4344,7 +4344,7 @@ function dol_htmloutput_errors($mesgstring='', $mesgarray='', $keepembedded=0)
* or descending output and uses optionally natural case insensitive sorting (which * or descending output and uses optionally natural case insensitive sorting (which
* can be optionally case sensitive as well). * can be optionally case sensitive as well).
* *
* @param array &$array Array to sort (array of array('key','otherkey1','otherkey2'...)) * @param array $array Array to sort (array of array('key','otherkey1','otherkey2'...))
* @param string $index Key in array to use for sorting criteria * @param string $index Key in array to use for sorting criteria
* @param int $order Sort order * @param int $order Sort order
* @param int $natsort 1=use "natural" sort (natsort), 0=use "standard" sort (asort) * @param int $natsort 1=use "natural" sort (natsort), 0=use "standard" sort (asort)
@ -4564,8 +4564,8 @@ function picto_from_langcode($codelang)
* @param Conf $conf Object conf * @param Conf $conf Object conf
* @param Translate $langs Object langs * @param Translate $langs Object langs
* @param Object $object Object object * @param Object $object Object object
* @param array &$head Object head * @param array $head Object head
* @param int &$h New position to fill * @param int $h New position to fill
* @param string $type Value for object where objectvalue can be * @param string $type Value for object where objectvalue can be
* 'thirdparty' to add a tab in third party view * 'thirdparty' to add a tab in third party view
* 'intervention' to add a tab in intervention view * 'intervention' to add a tab in intervention view

View File

@ -1108,7 +1108,7 @@ function numero_semaine($time)
* Convertit une masse d'une unite vers une autre unite * Convertit une masse d'une unite vers une autre unite
* *
* @param float $weight Masse a convertir * @param float $weight Masse a convertir
* @param int &$from_unit Unite originale en puissance de 10 * @param int $from_unit Unite originale en puissance de 10
* @param int $to_unit Nouvelle unite en puissance de 10 * @param int $to_unit Nouvelle unite en puissance de 10
* @return float Masse convertie * @return float Masse convertie
*/ */
@ -1143,7 +1143,7 @@ function weight_convert($weight,&$from_unit,$to_unit)
* *
* @param DoliDB $db Handler database * @param DoliDB $db Handler database
* @param Conf $conf Object conf * @param Conf $conf Object conf
* @param User &$user Object user * @param User $user Object user
* @param array $tab Tableau (cle=>valeur) des parametres a sauvegarder * @param array $tab Tableau (cle=>valeur) des parametres a sauvegarder
* @return int <0 if KO, >0 if OK * @return int <0 if KO, >0 if OK
* *

View File

@ -422,7 +422,7 @@ function pdf_build_address($outputlangs,$sourcecompany,$targetcompany='',$target
/** /**
* Show header of page for PDF generation * Show header of page for PDF generation
* *
* @param PDF &$pdf Object PDF * @param PDF $pdf Object PDF
* @param Translate $outputlangs Object lang for output * @param Translate $outputlangs Object lang for output
* @param int $page_height Height of page * @param int $page_height Height of page
* @return void * @return void
@ -443,7 +443,7 @@ function pdf_pagehead(&$pdf,$outputlangs,$page_height)
/** /**
* Add a draft watermark on PDF files * Add a draft watermark on PDF files
* *
* @param PDF &$pdf Object PDF * @param PDF $pdf Object PDF
* @param Translate $outputlangs Object lang * @param Translate $outputlangs Object lang
* @param int $h Height of PDF * @param int $h Height of PDF
* @param int $w Width of PDF * @param int $w Width of PDF
@ -483,7 +483,7 @@ function pdf_watermark(&$pdf, $outputlangs, $h, $w, $unit, $text)
/** /**
* Show bank informations for PDF generation * Show bank informations for PDF generation
* *
* @param PDF &$pdf Object PDF * @param PDF $pdf Object PDF
* @param Translate $outputlangs Object lang * @param Translate $outputlangs Object lang
* @param int $curx X * @param int $curx X
* @param int $cury Y * @param int $cury Y
@ -645,7 +645,7 @@ function pdf_bank(&$pdf,$outputlangs,$curx,$cury,$account,$onlynumber=0,$default
/** /**
* Show footer of page for PDF generation * Show footer of page for PDF generation
* *
* @param PDF &$pdf The PDF factory * @param PDF $pdf The PDF factory
* @param Translate $outputlangs Object lang for output * @param Translate $outputlangs Object lang for output
* @param string $paramfreetext Constant name of free text * @param string $paramfreetext Constant name of free text
* @param Societe $fromcompany Object company * @param Societe $fromcompany Object company
@ -859,7 +859,7 @@ function pdf_pagefoot(&$pdf,$outputlangs,$paramfreetext,$fromcompany,$marge_bass
/** /**
* Show linked objects for PDF generation * Show linked objects for PDF generation
* *
* @param PDF &$pdf Object PDF * @param PDF $pdf Object PDF
* @param object $object Object * @param object $object Object
* @param Translate $outputlangs Object lang * @param Translate $outputlangs Object lang
* @param int $posx X * @param int $posx X
@ -897,7 +897,7 @@ function pdf_writeLinkedObjects(&$pdf,$object,$outputlangs,$posx,$posy,$w,$h,$al
/** /**
* Output line description into PDF * Output line description into PDF
* *
* @param PDF &$pdf PDF object * @param PDF $pdf PDF object
* @param Object $object Object * @param Object $object Object
* @param int $i Current line number * @param int $i Current line number
* @param Translate $outputlangs Object lang for output * @param Translate $outputlangs Object lang for output

View File

@ -206,13 +206,13 @@ function project_admin_prepare_head()
/** /**
* Show task lines with a particular parent * Show task lines with a particular parent
* *
* @param string &$inc Counter that count number of lines legitimate to show (for return) * @param string $inc Counter that count number of lines legitimate to show (for return)
* @param int $parent Id of parent task to start * @param int $parent Id of parent task to start
* @param array &$lines Array of all tasks * @param array $lines Array of all tasks
* @param int &$level Level of task * @param int $level Level of task
* @param string $var Color * @param string $var Color
* @param int $showproject Show project columns * @param int $showproject Show project columns
* @param int &$taskrole Array of roles of user for each tasks * @param int $taskrole Array of roles of user for each tasks
* @param int $projectsListId List of id of project allowed to user (string separated with comma) * @param int $projectsListId List of id of project allowed to user (string separated with comma)
* @param int $addordertick Add a tick to move task * @param int $addordertick Add a tick to move task
* @return void * @return void
@ -443,12 +443,12 @@ function projectLinesa(&$inc, $parent, &$lines, &$level, $var, $showproject, &$t
/** /**
* Output a task line * Output a task line
* *
* @param string &$inc ? * @param string $inc ?
* @param string $parent ? * @param string $parent ?
* @param Object $lines ? * @param Object $lines ?
* @param int &$level ? * @param int $level ?
* @param string &$projectsrole ? * @param string $projectsrole ?
* @param string &$tasksrole ? * @param string $tasksrole ?
* @param string $mine Show only task lines I am assigned to * @param string $mine Show only task lines I am assigned to
* @param int $restricteditformytask 0=No restriction, 1=Enable add time only if task is a task i am affected to * @param int $restricteditformytask 0=No restriction, 1=Enable add time only if task is a task i am affected to
* @return $inc * @return $inc
@ -589,10 +589,10 @@ function projectLinesb(&$inc, $parent, $lines, &$level, &$projectsrole, &$tasksr
/** /**
* Search in task lines with a particular parent if there is a task for a particular user (in taskrole) * Search in task lines with a particular parent if there is a task for a particular user (in taskrole)
* *
* @param string &$inc Counter that count number of lines legitimate to show (for return) * @param string $inc Counter that count number of lines legitimate to show (for return)
* @param int $parent Id of parent task to start * @param int $parent Id of parent task to start
* @param array &$lines Array of all tasks * @param array $lines Array of all tasks
* @param string &$taskrole Array of task filtered on a particular user * @param string $taskrole Array of task filtered on a particular user
* @return int 1 if there is * @return int 1 if there is
*/ */
function searchTaskInChild(&$inc, $parent, &$lines, &$taskrole) function searchTaskInChild(&$inc, $parent, &$lines, &$taskrole)

View File

@ -28,7 +28,7 @@
/** /**
* Show indent and picto of a tree line. Return array with information of line. * Show indent and picto of a tree line. Return array with information of line.
* *
* @param array &$fulltree Array of entries in correct order * @param array $fulltree Array of entries in correct order
* @param string $key Key of entry into fulltree to show picto * @param string $key Key of entry into fulltree to show picto
* @param int $silent Do not output indent and picto, returns only value * @param int $silent Do not output indent and picto, returns only value
* @return array array(0 or 1 if at least one of this level after, 0 or 1 if at least one of higher level after, nbofdirinsub, nbofdocinsub) * @return array array(0 or 1 if at least one of this level after, 0 or 1 if at least one of higher level after, nbofdirinsub, nbofdocinsub)

View File

@ -27,9 +27,9 @@
* Check authentication array and set error, errorcode, errorlabel * Check authentication array and set error, errorcode, errorlabel
* *
* @param array $authentication Array with authentication informations ('login'=>,'password'=>,'entity'=>,'dolibarrkey'=>) * @param array $authentication Array with authentication informations ('login'=>,'password'=>,'entity'=>,'dolibarrkey'=>)
* @param int &$error Number of errors * @param int $error Number of errors
* @param string &$errorcode Error string code * @param string $errorcode Error string code
* @param string &$errorlabel Error string label * @param string $errorlabel Error string label
* @return User Return user object identified by login/pass/entity into authentication array * @return User Return user object identified by login/pass/entity into authentication array
*/ */
function check_authentication($authentication,&$error,&$errorcode,&$errorlabel) function check_authentication($authentication,&$error,&$errorcode,&$errorlabel)

View File

@ -46,4 +46,3 @@ function check_user_password_forceuser($usertotest,$passwordtotest,$entitytotest
return $login; return $login;
} }

View File

@ -43,4 +43,3 @@ function check_user_password_http($usertotest,$passwordtotest,$entitytotest)
return $login; return $login;
} }

View File

@ -31,8 +31,8 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/menubase.class.php';
* @param DoliDB $db Database handler * @param DoliDB $db Database handler
* @param string $atarget Target * @param string $atarget Target
* @param int $type_user 0=Menu for backoffice, 1=Menu for front office * @param int $type_user 0=Menu for backoffice, 1=Menu for front office
* @param array &$tabMenu If array with menu entries already loaded, we put this array here (in most cases, it's empty) * @param array $tabMenu If array with menu entries already loaded, we put this array here (in most cases, it's empty)
* @param array &$menu Object Menu to return back list of menu entries * @param array $menu Object Menu to return back list of menu entries
* @param int $noout Disable output (Initialise &$menu only). * @param int $noout Disable output (Initialise &$menu only).
* @return int 0 * @return int 0
*/ */
@ -203,8 +203,8 @@ function print_end_menu_array_auguria()
* @param DoliDB $db Database handler * @param DoliDB $db Database handler
* @param array $menu_array_before Table of menu entries to show before entries of menu handler * @param array $menu_array_before Table of menu entries to show before entries of menu handler
* @param array $menu_array_after Table of menu entries to show after entries of menu handler * @param array $menu_array_after Table of menu entries to show after entries of menu handler
* @param array &$tabMenu If array with menu entries already loaded, we put this array here (in most cases, it's empty) * @param array $tabMenu If array with menu entries already loaded, we put this array here (in most cases, it's empty)
* @param Menu &$menu Object Menu to return back list of menu entries * @param Menu $menu Object Menu to return back list of menu entries
* @param int $noout Disable output (Initialise &$menu only). * @param int $noout Disable output (Initialise &$menu only).
* @param string $forcemainmenu 'x'=Force mainmenu to mainmenu='x' * @param string $forcemainmenu 'x'=Force mainmenu to mainmenu='x'
* @param string $forceleftmenu 'all'=Force leftmenu to '' (= all) * @param string $forceleftmenu 'all'=Force leftmenu to '' (= all)
@ -402,8 +402,8 @@ function print_left_auguria_menu($db,$menu_array_before,$menu_array_after,&$tabM
* Function to test if an entry is enabled or not * Function to test if an entry is enabled or not
* *
* @param string $type_user 0=We need backoffice menu, 1=We need frontoffice menu * @param string $type_user 0=We need backoffice menu, 1=We need frontoffice menu
* @param array &$menuentry Array for menu entry * @param array $menuentry Array for menu entry
* @param array &$listofmodulesforexternal Array with list of modules allowed to external users * @param array $listofmodulesforexternal Array with list of modules allowed to external users
* @return int 0=Hide, 1=Show, 2=Show gray * @return int 0=Hide, 1=Show, 2=Show gray
*/ */
function dol_auguria_showmenu($type_user, &$menuentry, &$listofmodulesforexternal) function dol_auguria_showmenu($type_user, &$menuentry, &$listofmodulesforexternal)
@ -430,4 +430,3 @@ function dol_auguria_showmenu($type_user, &$menuentry, &$listofmodulesforexterna
if (! $menuentry['perms']) return 2; // No permissions and user is external if (! $menuentry['perms']) return 2; // No permissions and user is external
return 1; return 1;
} }

View File

@ -32,8 +32,8 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/menubase.class.php';
* @param DoliDB $db Database handler * @param DoliDB $db Database handler
* @param string $atarget Target (Example: '' or '_top') * @param string $atarget Target (Example: '' or '_top')
* @param int $type_user 0=Menu for backoffice, 1=Menu for front office * @param int $type_user 0=Menu for backoffice, 1=Menu for front office
* @param array &$tabMenu If array with menu entries already loaded, we put this array here (in most cases, it's empty) * @param array $tabMenu If array with menu entries already loaded, we put this array here (in most cases, it's empty)
* @param array &$menu Object Menu to return back list of menu entries * @param array $menu Object Menu to return back list of menu entries
* @param int $noout Disable output (Initialise &$menu only). * @param int $noout Disable output (Initialise &$menu only).
* @return int 0 * @return int 0
*/ */
@ -428,8 +428,8 @@ function print_end_menu_array()
* @param DoliDB $db Database handler * @param DoliDB $db Database handler
* @param array $menu_array_before Table of menu entries to show before entries of menu handler (menu->liste filled with menu->add) * @param array $menu_array_before Table of menu entries to show before entries of menu handler (menu->liste filled with menu->add)
* @param array $menu_array_after Table of menu entries to show after entries of menu handler (menu->liste filled with menu->add) * @param array $menu_array_after Table of menu entries to show after entries of menu handler (menu->liste filled with menu->add)
* @param array &$tabMenu If array with menu entries already loaded, we put this array here (in most cases, it's empty) * @param array $tabMenu If array with menu entries already loaded, we put this array here (in most cases, it's empty)
* @param Menu &$menu Object Menu to return back list of menu entries * @param Menu $menu Object Menu to return back list of menu entries
* @param int $noout Disable output (Initialise &$menu only). * @param int $noout Disable output (Initialise &$menu only).
* @param string $forcemainmenu 'x'=Force mainmenu to mainmenu='x' * @param string $forcemainmenu 'x'=Force mainmenu to mainmenu='x'
* @param string $forceleftmenu 'all'=Force leftmenu to '' (= all) * @param string $forceleftmenu 'all'=Force leftmenu to '' (= all)
@ -1443,8 +1443,8 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu
* Function to test if an entry is enabled or not * Function to test if an entry is enabled or not
* *
* @param string $type_user 0=We need backoffice menu, 1=We need frontoffice menu * @param string $type_user 0=We need backoffice menu, 1=We need frontoffice menu
* @param array &$menuentry Array for menu entry * @param array $menuentry Array for menu entry
* @param array &$listofmodulesforexternal Array with list of modules allowed to external users * @param array $listofmodulesforexternal Array with list of modules allowed to external users
* @return int 0=Hide, 1=Show, 2=Show gray * @return int 0=Hide, 1=Show, 2=Show gray
*/ */
function dol_eldy_showmenu($type_user, &$menuentry, &$listofmodulesforexternal) function dol_eldy_showmenu($type_user, &$menuentry, &$listofmodulesforexternal)

View File

@ -185,7 +185,7 @@ class CommActionRapport
/** /**
* Write content of pages * Write content of pages
* *
* @param PDF &$pdf Object pdf * @param PDF $pdf Object pdf
* @param Translate $outputlangs Object langs * @param Translate $outputlangs Object langs
* @return int 1 * @return int 1
*/ */
@ -299,7 +299,7 @@ class CommActionRapport
/** /**
* Show top header of page. * Show top header of page.
* *
* @param PDF &$pdf Object PDF * @param PDF $pdf Object PDF
* @param Translate $outputlangs Object lang for output * @param Translate $outputlangs Object lang for output
* @param int $pagenb Page nb * @param int $pagenb Page nb
* @return void * @return void

View File

@ -20,7 +20,7 @@
*/ */
/** /**
* \file htdocs/core/modules/product/mod_barcode_product_standard.php * \file htdocs/core/modules/barcode/mod_barcode_product_standard.php
* \ingroup barcode * \ingroup barcode
* \brief File of class to manage barcode numbering with standard rule * \brief File of class to manage barcode numbering with standard rule
*/ */
@ -162,7 +162,7 @@ class mod_barcode_product_standard extends ModeleNumRefBarCode
* Check validity of code according to its rules * Check validity of code according to its rules
* *
* @param DoliDB $db Database handler * @param DoliDB $db Database handler
* @param string &$code Code to check/correct * @param string $code Code to check/correct
* @param Product $product Object product * @param Product $product Object product
* @param int $thirdparty_type 0 = customer/prospect , 1 = supplier * @param int $thirdparty_type 0 = customer/prospect , 1 = supplier
* @param string $type type of barcode (EAN, ISBN, ...) * @param string $type type of barcode (EAN, ISBN, ...)
@ -177,7 +177,7 @@ class mod_barcode_product_standard extends ModeleNumRefBarCode
global $conf; global $conf;
//var_dump($code.' '.$product->ref.' '.$thirdparty_type);exit; //var_dump($code.' '.$product->ref.' '.$thirdparty_type);exit;
require_once DOL_DOCUMENT_ROOT .'/core/lib/functions2.lib.php'; require_once DOL_DOCUMENT_ROOT .'/core/lib/functions2.lib.php';
$result=0; $result=0;
@ -282,7 +282,7 @@ class mod_barcode_product_standard extends ModeleNumRefBarCode
{ {
$newcodefortest=substr($newcodefortest,0,12); $newcodefortest=substr($newcodefortest,0,12);
} }
$result=check_value($mask,$newcodefortest); $result=check_value($mask,$newcodefortest);
return $result; return $result;

View File

@ -201,7 +201,7 @@ class BordereauChequeBlochet extends ModeleChequeReceipts
/** /**
* Generate Header * Generate Header
* *
* @param PDF &$pdf Pdf object * @param PDF $pdf Pdf object
* @param int $page Current page number * @param int $page Current page number
* @param int $pages Total number of pages * @param int $pages Total number of pages
* @param Translate $outputlangs Object language for output * @param Translate $outputlangs Object language for output
@ -307,7 +307,7 @@ class BordereauChequeBlochet extends ModeleChequeReceipts
/** /**
* Output array * Output array
* *
* @param PDF &$pdf PDF object * @param PDF $pdf PDF object
* @param int $pagenb Page nb * @param int $pagenb Page nb
* @param int $pages Pages * @param int $pages Pages
* @param Translate $outputlangs Object lang * @param Translate $outputlangs Object lang
@ -365,7 +365,7 @@ class BordereauChequeBlochet extends ModeleChequeReceipts
/** /**
* Show footer of page. Need this->emetteur object * Show footer of page. Need this->emetteur object
* *
* @param PDF &$pdf PDF * @param PDF $pdf PDF
* @param Object $object Object to show * @param Object $object Object to show
* @param Translate $outputlangs Object lang for output * @param Translate $outputlangs Object lang for output
* @param int $hidefreetext 1=Hide free text * @param int $hidefreetext 1=Hide free text

View File

@ -544,7 +544,7 @@ class pdf_einstein extends ModelePDFCommandes
/** /**
* Show payments table * Show payments table
* *
* @param PDF &$pdf Object PDF * @param PDF $pdf Object PDF
* @param Object $object Object order * @param Object $object Object order
* @param int $posy Position y in PDF * @param int $posy Position y in PDF
* @param Translate $outputlangs Object langs for output * @param Translate $outputlangs Object langs for output
@ -559,7 +559,7 @@ class pdf_einstein extends ModelePDFCommandes
/** /**
* Show miscellaneous information (payment mode, payment term, ...) * Show miscellaneous information (payment mode, payment term, ...)
* *
* @param PDF &$pdf Object PDF * @param PDF $pdf Object PDF
* @param Object $object Object to show * @param Object $object Object to show
* @param int $posy Y * @param int $posy Y
* @param Translate $outputlangs Langs object * @param Translate $outputlangs Langs object
@ -743,7 +743,7 @@ class pdf_einstein extends ModelePDFCommandes
/** /**
* Show total to pay * Show total to pay
* *
* @param PDF &$pdf Object PDF * @param PDF $pdf Object PDF
* @param Facture $object Object invoice * @param Facture $object Object invoice
* @param int $deja_regle Montant deja regle * @param int $deja_regle Montant deja regle
* @param int $posy Position depart * @param int $posy Position depart
@ -1000,7 +1000,7 @@ class pdf_einstein extends ModelePDFCommandes
/** /**
* Show table for lines * Show table for lines
* *
* @param PDF &$pdf Object PDF * @param PDF $pdf Object PDF
* @param string $tab_top Top position of table * @param string $tab_top Top position of table
* @param string $tab_height Height of table (rectangle) * @param string $tab_height Height of table (rectangle)
* @param int $nexY Y (not used) * @param int $nexY Y (not used)
@ -1095,7 +1095,7 @@ class pdf_einstein extends ModelePDFCommandes
/** /**
* Show top header of page. * Show top header of page.
* *
* @param PDF &$pdf Object PDF * @param PDF $pdf Object PDF
* @param Object $object Object to show * @param Object $object Object to show
* @param int $showaddress 0=no, 1=yes * @param int $showaddress 0=no, 1=yes
* @param Translate $outputlangs Object lang for output * @param Translate $outputlangs Object lang for output
@ -1274,7 +1274,7 @@ class pdf_einstein extends ModelePDFCommandes
/** /**
* Show footer of page. Need this->emetteur object * Show footer of page. Need this->emetteur object
* *
* @param PDF &$pdf PDF * @param PDF $pdf PDF
* @param Object $object Object to show * @param Object $object Object to show
* @param Translate $outputlangs Object lang for output * @param Translate $outputlangs Object lang for output
* @param int $hidefreetext 1=Hide free text * @param int $hidefreetext 1=Hide free text

View File

@ -543,7 +543,7 @@ class pdf_proforma extends ModelePDFCommandes
/** /**
* Show payments table * Show payments table
* *
* @param PDF &$pdf Object PDF * @param PDF $pdf Object PDF
* @param Object $object Object order * @param Object $object Object order
* @param int $posy Position y in PDF * @param int $posy Position y in PDF
* @param Translate $outputlangs Object langs for output * @param Translate $outputlangs Object langs for output
@ -558,7 +558,7 @@ class pdf_proforma extends ModelePDFCommandes
/** /**
* Show miscellaneous information (payment mode, payment term, ...) * Show miscellaneous information (payment mode, payment term, ...)
* *
* @param PDF &$pdf Object PDF * @param PDF $pdf Object PDF
* @param Object $object Object to show * @param Object $object Object to show
* @param int $posy Y * @param int $posy Y
* @param Translate $outputlangs Langs object * @param Translate $outputlangs Langs object
@ -700,7 +700,7 @@ class pdf_proforma extends ModelePDFCommandes
/** /**
* Show total to pay * Show total to pay
* *
* @param PDF &$pdf Object PDF * @param PDF $pdf Object PDF
* @param Facture $object Object invoice * @param Facture $object Object invoice
* @param int $deja_regle Montant deja regle * @param int $deja_regle Montant deja regle
* @param int $posy Position depart * @param int $posy Position depart
@ -957,7 +957,7 @@ class pdf_proforma extends ModelePDFCommandes
/** /**
* Show table for lines * Show table for lines
* *
* @param PDF &$pdf Object PDF * @param PDF $pdf Object PDF
* @param string $tab_top Top position of table * @param string $tab_top Top position of table
* @param string $tab_height Height of table (rectangle) * @param string $tab_height Height of table (rectangle)
* @param int $nexY Y (not used) * @param int $nexY Y (not used)
@ -1052,7 +1052,7 @@ class pdf_proforma extends ModelePDFCommandes
/** /**
* Show top header of page. * Show top header of page.
* *
* @param PDF &$pdf Object PDF * @param PDF $pdf Object PDF
* @param Object $object Object to show * @param Object $object Object to show
* @param int $showaddress 0=no, 1=yes * @param int $showaddress 0=no, 1=yes
* @param Translate $outputlangs Object lang for output * @param Translate $outputlangs Object lang for output
@ -1231,7 +1231,7 @@ class pdf_proforma extends ModelePDFCommandes
/** /**
* Show footer of page. Need this->emetteur object * Show footer of page. Need this->emetteur object
* *
* @param PDF &$pdf PDF * @param PDF $pdf PDF
* @param Object $object Object to show * @param Object $object Object to show
* @param Translate $outputlangs Object lang for output * @param Translate $outputlangs Object lang for output
* @param int $hidefreetext 1=Hide free text * @param int $hidefreetext 1=Hide free text

View File

@ -380,7 +380,7 @@ class pdf_strato extends ModelePDFContract
/** /**
* Show table for lines * Show table for lines
* *
* @param PDF &$pdf Object PDF * @param PDF $pdf Object PDF
* @param string $tab_top Top position of table * @param string $tab_top Top position of table
* @param string $tab_height Height of table (rectangle) * @param string $tab_height Height of table (rectangle)
* @param int $nexY Y * @param int $nexY Y
@ -446,7 +446,7 @@ class pdf_strato extends ModelePDFContract
/** /**
* Show top header of page. * Show top header of page.
* *
* @param PDF &$pdf Object PDF * @param PDF $pdf Object PDF
* @param Object $object Object to show * @param Object $object Object to show
* @param int $showaddress 0=no, 1=yes * @param int $showaddress 0=no, 1=yes
* @param Translate $outputlangs Object lang for output * @param Translate $outputlangs Object lang for output
@ -625,7 +625,7 @@ class pdf_strato extends ModelePDFContract
/** /**
* Show footer of page. Need this->emetteur object * Show footer of page. Need this->emetteur object
* *
* @param PDF &$pdf PDF * @param PDF $pdf PDF
* @param Object $object Object to show * @param Object $object Object to show
* @param Translate $outputlangs Object lang for output * @param Translate $outputlangs Object lang for output
* @param int $hidefreetext 1=Hide free text * @param int $hidefreetext 1=Hide free text

View File

@ -43,7 +43,7 @@ class mod_contract_olive extends ModelNumRefContracts
var $code_auto = 0; // Numerotation automatique var $code_auto = 0; // Numerotation automatique
/** /**
* Return description of module * Return description of module
* *
* @return string Description of module * @return string Description of module
@ -51,7 +51,7 @@ class mod_contract_olive extends ModelNumRefContracts
function info() function info()
{ {
global $langs; global $langs;
$langs->load("companies"); $langs->load("companies");
return $langs->trans("LeopardNumRefModelDesc"); return $langs->trans("LeopardNumRefModelDesc");
} }
@ -74,7 +74,7 @@ class mod_contract_olive extends ModelNumRefContracts
* Check validity of code according to its rules * Check validity of code according to its rules
* *
* @param DoliDB $db Database handler * @param DoliDB $db Database handler
* @param string &$code Code to check/correct * @param string $code Code to check/correct
* @param Product $product Object product * @param Product $product Object product
* @param int $type 0 = product , 1 = service * @param int $type 0 = product , 1 = service
* @return int 0 if OK * @return int 0 if OK

View File

@ -73,7 +73,7 @@ class pdf_merou extends ModelePdfExpedition
/** /**
* Function to build pdf onto disk * Function to build pdf onto disk
* *
* @param Object &$object Object expedition to generate (or id if old method) * @param Object $object Object expedition to generate (or id if old method)
* @param Translate $outputlangs Lang output object * @param Translate $outputlangs Lang output object
* @param string $srctemplatepath Full path of source filename for generator using a template file * @param string $srctemplatepath Full path of source filename for generator using a template file
* @param int $hidedetails Do not show line details * @param int $hidedetails Do not show line details
@ -376,7 +376,7 @@ class pdf_merou extends ModelePdfExpedition
/** /**
* Show table for lines * Show table for lines
* *
* @param PDF &$pdf Object PDF * @param PDF $pdf Object PDF
* @param string $tab_top Top position of table * @param string $tab_top Top position of table
* @param string $tab_height Height of table (rectangle) * @param string $tab_height Height of table (rectangle)
* @param int $nexY Y * @param int $nexY Y
@ -417,7 +417,7 @@ class pdf_merou extends ModelePdfExpedition
/** /**
* Show footer of page. Need this->emetteur object * Show footer of page. Need this->emetteur object
* *
* @param PDF &$pdf PDF * @param PDF $pdf PDF
* @param Object $object Object to show * @param Object $object Object to show
* @param Translate $outputlangs Object lang for output * @param Translate $outputlangs Object lang for output
* @param int $hidefreetext 1=Hide free text * @param int $hidefreetext 1=Hide free text
@ -446,7 +446,7 @@ class pdf_merou extends ModelePdfExpedition
/** /**
* Show top header of page. * Show top header of page.
* *
* @param PDF &$pdf Object PDF * @param PDF $pdf Object PDF
* @param Object $object Object to show * @param Object $object Object to show
* @param int $showaddress 0=no, 1=yes * @param int $showaddress 0=no, 1=yes
* @param Translate $outputlangs Object lang for output * @param Translate $outputlangs Object lang for output

View File

@ -76,7 +76,7 @@ class pdf_rouget extends ModelePdfExpedition
/** /**
* Function to build pdf onto disk * Function to build pdf onto disk
* *
* @param Object &$object Object expedition to generate (or id if old method) * @param Object $object Object expedition to generate (or id if old method)
* @param Translate $outputlangs Lang output object * @param Translate $outputlangs Lang output object
* @param string $srctemplatepath Full path of source filename for generator using a template file * @param string $srctemplatepath Full path of source filename for generator using a template file
* @param int $hidedetails Do not show line details * @param int $hidedetails Do not show line details
@ -377,7 +377,7 @@ class pdf_rouget extends ModelePdfExpedition
/** /**
* Show table for lines * Show table for lines
* *
* @param PDF &$pdf Object PDF * @param PDF $pdf Object PDF
* @param string $tab_top Top position of table * @param string $tab_top Top position of table
* @param string $tab_height Height of table (rectangle) * @param string $tab_height Height of table (rectangle)
* @param int $nexY Y * @param int $nexY Y
@ -432,7 +432,7 @@ class pdf_rouget extends ModelePdfExpedition
/** /**
* Show top header of page. * Show top header of page.
* *
* @param PDF &$pdf Object PDF * @param PDF $pdf Object PDF
* @param Object $object Object to show * @param Object $object Object to show
* @param int $showaddress 0=no, 1=yes * @param int $showaddress 0=no, 1=yes
* @param Translate $outputlangs Object lang for output * @param Translate $outputlangs Object lang for output
@ -672,7 +672,7 @@ class pdf_rouget extends ModelePdfExpedition
/** /**
* Show footer of page. Need this->emetteur object * Show footer of page. Need this->emetteur object
* *
* @param PDF &$pdf PDF * @param PDF $pdf PDF
* @param Object $object Object to show * @param Object $object Object to show
* @param Translate $outputlangs Object lang for output * @param Translate $outputlangs Object lang for output
* @param int $hidefreetext 1=Hide free text * @param int $hidefreetext 1=Hide free text

View File

@ -599,7 +599,7 @@ class pdf_crabe extends ModelePDFFactures
/** /**
* Show payments table * Show payments table
* *
* @param PDF &$pdf Object PDF * @param PDF $pdf Object PDF
* @param Object $object Object invoice * @param Object $object Object invoice
* @param int $posy Position y in PDF * @param int $posy Position y in PDF
* @param Translate $outputlangs Object langs for output * @param Translate $outputlangs Object langs for output
@ -735,7 +735,7 @@ class pdf_crabe extends ModelePDFFactures
/** /**
* Show miscellaneous information (payment mode, payment term, ...) * Show miscellaneous information (payment mode, payment term, ...)
* *
* @param PDF &$pdf Object PDF * @param PDF $pdf Object PDF
* @param Object $object Object to show * @param Object $object Object to show
* @param int $posy Y * @param int $posy Y
* @param Translate $outputlangs Langs object * @param Translate $outputlangs Langs object
@ -891,7 +891,7 @@ class pdf_crabe extends ModelePDFFactures
/** /**
* Show total to pay * Show total to pay
* *
* @param PDF &$pdf Object PDF * @param PDF $pdf Object PDF
* @param Facture $object Object invoice * @param Facture $object Object invoice
* @param int $deja_regle Montant deja regle * @param int $deja_regle Montant deja regle
* @param int $posy Position depart * @param int $posy Position depart
@ -1185,7 +1185,7 @@ class pdf_crabe extends ModelePDFFactures
/** /**
* Show table for lines * Show table for lines
* *
* @param PDF &$pdf Object PDF * @param PDF $pdf Object PDF
* @param string $tab_top Top position of table * @param string $tab_top Top position of table
* @param string $tab_height Height of table (rectangle) * @param string $tab_height Height of table (rectangle)
* @param int $nexY Y (not used) * @param int $nexY Y (not used)
@ -1289,7 +1289,7 @@ class pdf_crabe extends ModelePDFFactures
/** /**
* Show top header of page. * Show top header of page.
* *
* @param PDF &$pdf Object PDF * @param PDF $pdf Object PDF
* @param Object $object Object to show * @param Object $object Object to show
* @param int $showaddress 0=no, 1=yes * @param int $showaddress 0=no, 1=yes
* @param Translate $outputlangs Object lang for output * @param Translate $outputlangs Object lang for output
@ -1520,7 +1520,7 @@ class pdf_crabe extends ModelePDFFactures
/** /**
* Show footer of page. Need this->emetteur object * Show footer of page. Need this->emetteur object
* *
* @param PDF &$pdf PDF * @param PDF $pdf PDF
* @param Object $object Object to show * @param Object $object Object to show
* @param Translate $outputlangs Object lang for output * @param Translate $outputlangs Object lang for output
* @param int $hidefreetext 1=Hide free text * @param int $hidefreetext 1=Hide free text

View File

@ -362,7 +362,7 @@ class pdf_soleil extends ModelePDFFicheinter
/** /**
* Show table for lines * Show table for lines
* *
* @param PDF &$pdf Object PDF * @param PDF $pdf Object PDF
* @param string $tab_top Top position of table * @param string $tab_top Top position of table
* @param string $tab_height Height of table (rectangle) * @param string $tab_height Height of table (rectangle)
* @param int $nexY Y * @param int $nexY Y
@ -425,7 +425,7 @@ class pdf_soleil extends ModelePDFFicheinter
/** /**
* Show top header of page. * Show top header of page.
* *
* @param PDF &$pdf Object PDF * @param PDF $pdf Object PDF
* @param Object $object Object to show * @param Object $object Object to show
* @param int $showaddress 0=no, 1=yes * @param int $showaddress 0=no, 1=yes
* @param Translate $outputlangs Object lang for output * @param Translate $outputlangs Object lang for output
@ -604,7 +604,7 @@ class pdf_soleil extends ModelePDFFicheinter
/** /**
* Show footer of page. Need this->emetteur object * Show footer of page. Need this->emetteur object
* *
* @param PDF &$pdf PDF * @param PDF $pdf PDF
* @param Object $object Object to show * @param Object $object Object to show
* @param Translate $outputlangs Object lang for output * @param Translate $outputlangs Object lang for output
* @param int $hidefreetext 1=Hide free text * @param int $hidefreetext 1=Hide free text

View File

@ -1,6 +1,6 @@
<?php <?php
/* Copyright (C) 2004-2014 Laurent Destailleur <eldy@users.sourceforge.net> /* Copyright (C) 2004-2014 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2009 Regis Houssin <regis.houssin@capnetworks.com> * Copyright (C) 2005-2014 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2007 Franky Van Liedekerke <franky.van.liedekerke@telenet.be> * Copyright (C) 2007 Franky Van Liedekerke <franky.van.liedekerke@telenet.be>
* Copyright (C) 2008 Chiptronik * Copyright (C) 2008 Chiptronik
* Copyright (C) 2011-2012 Philippe Grand <philippe.grand@atoo-net.com> * Copyright (C) 2011-2012 Philippe Grand <philippe.grand@atoo-net.com>
@ -21,7 +21,7 @@
*/ */
/** /**
* \file htdocs/core/modules/livraison/pdf/pdf_typhon.modules.php * \file htdocs/core/modules/livraison/doc/pdf_typhon.modules.php
* \ingroup livraison * \ingroup livraison
* \brief File of class to manage receving receipts with template Typhon * \brief File of class to manage receving receipts with template Typhon
* \author Laurent Destailleur * \author Laurent Destailleur
@ -97,10 +97,10 @@ class pdf_typhon extends ModelePDFDeliveryOrder
// Define position of columns // Define position of columns
$this->posxdesc=$this->marge_gauche+1; $this->posxdesc=$this->marge_gauche+1;
$this->posxcomm=900; $this->posxcomm=112;
//$this->posxtva=112; //$this->posxtva=112;
//$this->posxup=126; //$this->posxup=126;
$this->posxqty=140; $this->posxqty=174;
$this->posxremainingqty=165; $this->posxremainingqty=165;
//$this->posxdiscount=162; //$this->posxdiscount=162;
//$this->postotalht=174; //$this->postotalht=174;
@ -558,7 +558,7 @@ class pdf_typhon extends ModelePDFDeliveryOrder
/** /**
* Show miscellaneous information (payment mode, payment term, ...) * Show miscellaneous information (payment mode, payment term, ...)
* *
* @param PDF &$pdf Object PDF * @param PDF $pdf Object PDF
* @param Object $object Object to show * @param Object $object Object to show
* @param int $posy Y * @param int $posy Y
* @param Translate $outputlangs Langs object * @param Translate $outputlangs Langs object
@ -585,7 +585,7 @@ class pdf_typhon extends ModelePDFDeliveryOrder
/** /**
* Show table for lines * Show table for lines
* *
* @param PDF &$pdf Object PDF * @param PDF $pdf Object PDF
* @param string $tab_top Top position of table * @param string $tab_top Top position of table
* @param string $tab_height Height of table (rectangle) * @param string $tab_height Height of table (rectangle)
* @param int $nexY Y (not used) * @param int $nexY Y (not used)
@ -636,21 +636,21 @@ class pdf_typhon extends ModelePDFDeliveryOrder
$pdf->line($this->posxqty, $tab_top, $this->posxqty, $tab_top + $tab_height); $pdf->line($this->posxqty, $tab_top, $this->posxqty, $tab_top + $tab_height);
if (empty($hidetop)) { if (empty($hidetop)) {
$pdf->SetXY($this->posxqty, $tab_top+1); $pdf->SetXY($this->posxqty, $tab_top+1);
$pdf->MultiCell($this->posxremainingqty - $this->posxqty, 2, $outputlangs->transnoentities("QtyShipped"),'','C'); $pdf->MultiCell($this->posxremainingqty - $this->posxqty, 2, $outputlangs->transnoentities("QtyShipped"),'','R');
} }
// Remain to ship // Remain to ship
$pdf->line($this->posxremainingqty, $tab_top, $this->posxremainingqty, $tab_top + $tab_height); $pdf->line($this->posxremainingqty, $tab_top, $this->posxremainingqty, $tab_top + $tab_height);
if (empty($hidetop)) { if (empty($hidetop)) {
$pdf->SetXY($this->posxremainingqty, $tab_top+1); $pdf->SetXY($this->posxremainingqty, $tab_top+1);
$pdf->MultiCell($this->page_largeur-$this->marge_droite-$this->posxremainingqty, 2, $outputlangs->transnoentities("KeepToShip"),'','C'); $pdf->MultiCell($this->page_largeur-$this->marge_droite-$this->posxremainingqty, 2, $outputlangs->transnoentities("KeepToShip"),'','R');
} }
} }
/** /**
* Show top header of page. * Show top header of page.
* *
* @param PDF &$pdf Object PDF * @param PDF $pdf Object PDF
* @param Object $object Object to show * @param Object $object Object to show
* @param int $showaddress 0=no, 1=yes * @param int $showaddress 0=no, 1=yes
* @param Translate $outputlangs Object lang for output * @param Translate $outputlangs Object lang for output
@ -866,7 +866,7 @@ class pdf_typhon extends ModelePDFDeliveryOrder
/** /**
* Show footer of page. Need this->emetteur object * Show footer of page. Need this->emetteur object
* *
* @param PDF &$pdf PDF * @param PDF $pdf PDF
* @param Object $object Object to show * @param Object $object Object to show
* @param Translate $outputlangs Object lang for output * @param Translate $outputlangs Object lang for output
* @param int $hidefreetext 1=Hide free text * @param int $hidefreetext 1=Hide free text

View File

@ -99,7 +99,7 @@ class pdf_standard
* Methode qui permet de modifier la taille des caracteres * Methode qui permet de modifier la taille des caracteres
* Cela modiera aussi l'espace entre chaque ligne * Cela modiera aussi l'espace entre chaque ligne
* *
* @param PDF &$pdf PDF * @param PDF $pdf PDF
* @param int $pt point * @param int $pt point
* @return void * @return void
*/ */
@ -118,7 +118,7 @@ class pdf_standard
* - %LOGO% is replace with company logo * - %LOGO% is replace with company logo
* - %PHOTO% is replace with photo provided as parameter * - %PHOTO% is replace with photo provided as parameter
* *
* @param PDF &$pdf PDF * @param PDF $pdf PDF
* @param string $textleft Text left * @param string $textleft Text left
* @param string $header Header * @param string $header Header
* @param string $footer Footer * @param string $footer Footer
@ -300,7 +300,7 @@ class pdf_standard
/** /**
* Print dot line * Print dot line
* *
* @param PDF &$pdf PDF * @param PDF $pdf PDF
* @param int $x1 X1 * @param int $x1 X1
* @param int $y1 Y1 * @param int $y1 Y1
* @param int $x2 X2 * @param int $x2 X2
@ -341,7 +341,7 @@ class pdf_standard
/** /**
* Fonction realisant une croix aux 4 coins des cartes * Fonction realisant une croix aux 4 coins des cartes
* *
* @param PDF &$pdf PDF * @param PDF $pdf PDF
* @param int $x1 X1 * @param int $x1 X1
* @param int $y1 Y1 * @param int $y1 Y1
* @param int $x2 X2 * @param int $x2 X2
@ -412,7 +412,7 @@ class pdf_standard
/** /**
* Set format * Set format
* *
* @param PDF &$pdf PDF * @param PDF $pdf PDF
* @param string $format Format * @param string $format Format
* @return void * @return void
*/ */

View File

@ -23,7 +23,7 @@
*/ */
/** /**
* \defgroup tax Module salaries * \defgroup salaries Module salaries
* \brief Module to include salaries management * \brief Module to include salaries management
* \file htdocs/core/modules/modSalaries.class.php * \file htdocs/core/modules/modSalaries.class.php
* \ingroup salaries * \ingroup salaries

View File

@ -99,7 +99,7 @@ class pdf_standardlabel
* Methode qui permet de modifier la taille des caracteres * Methode qui permet de modifier la taille des caracteres
* Cela modiera aussi l'espace entre chaque ligne * Cela modiera aussi l'espace entre chaque ligne
* *
* @param PDF &$pdf PDF * @param PDF $pdf PDF
* @param int $pt point * @param int $pt point
* @return void * @return void
*/ */
@ -117,7 +117,7 @@ class pdf_standardlabel
* - %LOGO% is replace with company logo * - %LOGO% is replace with company logo
* - %PHOTO% is replace with photo provided as parameter * - %PHOTO% is replace with photo provided as parameter
* *
* @param PDF &$pdf PDF * @param PDF $pdf PDF
* @param string $textleft Text left * @param string $textleft Text left
* @param string $header Header * @param string $header Header
* @param string $footer Footer * @param string $footer Footer
@ -292,7 +292,7 @@ class pdf_standardlabel
/** /**
* Print dot line * Print dot line
* *
* @param PDF &$pdf PDF * @param PDF $pdf PDF
* @param int $x1 X1 * @param int $x1 X1
* @param int $y1 Y1 * @param int $y1 Y1
* @param int $x2 X2 * @param int $x2 X2
@ -333,7 +333,7 @@ class pdf_standardlabel
/** /**
* Fonction realisant une croix aux 4 coins des cartes * Fonction realisant une croix aux 4 coins des cartes
* *
* @param PDF &$pdf PDF * @param PDF $pdf PDF
* @param int $x1 X1 * @param int $x1 X1
* @param int $y1 Y1 * @param int $y1 Y1
* @param int $x2 X2 * @param int $x2 X2
@ -404,7 +404,7 @@ class pdf_standardlabel
/** /**
* Set format * Set format
* *
* @param PDF &$pdf PDF * @param PDF $pdf PDF
* @param string $format Format * @param string $format Format
* @return void * @return void
*/ */

View File

@ -220,7 +220,7 @@ class mod_codeproduct_elephant extends ModeleProductCode
* Check validity of code according to its rules * Check validity of code according to its rules
* *
* @param DoliDB $db Database handler * @param DoliDB $db Database handler
* @param string &$code Code to check/correct * @param string $code Code to check/correct
* @param Product $product Object product * @param Product $product Object product
* @param int $type 0 = customer/prospect , 1 = supplier * @param int $type 0 = customer/prospect , 1 = supplier
* @return int 0 if OK * @return int 0 if OK

View File

@ -91,7 +91,7 @@ class mod_codeproduct_leopard extends ModeleProductCode
* Check validity of code according to its rules * Check validity of code according to its rules
* *
* @param DoliDB $db Database handler * @param DoliDB $db Database handler
* @param string &$code Code to check/correct * @param string $code Code to check/correct
* @param Product $product Object product * @param Product $product Object product
* @param int $type 0 = product , 1 = service * @param int $type 0 = product , 1 = service
* @return int 0 if OK * @return int 0 if OK

View File

@ -337,7 +337,7 @@ class pdf_baleine extends ModelePDFProjects
/** /**
* Show table for lines * Show table for lines
* *
* @param PDF &$pdf Object PDF * @param PDF $pdf Object PDF
* @param string $tab_top Top position of table * @param string $tab_top Top position of table
* @param string $tab_height Height of table (rectangle) * @param string $tab_height Height of table (rectangle)
* @param int $nexY Y * @param int $nexY Y
@ -370,7 +370,7 @@ class pdf_baleine extends ModelePDFProjects
/** /**
* Show top header of page. * Show top header of page.
* *
* @param PDF &$pdf Object PDF * @param PDF $pdf Object PDF
* @param Object $object Object to show * @param Object $object Object to show
* @param int $showaddress 0=no, 1=yes * @param int $showaddress 0=no, 1=yes
* @param Translate $outputlangs Object lang for output * @param Translate $outputlangs Object lang for output
@ -456,7 +456,7 @@ class pdf_baleine extends ModelePDFProjects
/** /**
* Show footer of page. Need this->emetteur object * Show footer of page. Need this->emetteur object
* *
* @param PDF &$pdf PDF * @param PDF $pdf PDF
* @param Object $object Object to show * @param Object $object Object to show
* @param Translate $outputlangs Object lang for output * @param Translate $outputlangs Object lang for output
* @param int $hidefreetext 1=Hide free text * @param int $hidefreetext 1=Hide free text

View File

@ -600,7 +600,7 @@ class pdf_azur extends ModelePDFPropales
/** /**
* Show payments table * Show payments table
* *
* @param PDF &$pdf Object PDF * @param PDF $pdf Object PDF
* @param Object $object Object proposal * @param Object $object Object proposal
* @param int $posy Position y in PDF * @param int $posy Position y in PDF
* @param Translate $outputlangs Object langs for output * @param Translate $outputlangs Object langs for output
@ -615,7 +615,7 @@ class pdf_azur extends ModelePDFPropales
/** /**
* Show miscellaneous information (payment mode, payment term, ...) * Show miscellaneous information (payment mode, payment term, ...)
* *
* @param PDF &$pdf Object PDF * @param PDF $pdf Object PDF
* @param Object $object Object to show * @param Object $object Object to show
* @param int $posy Y * @param int $posy Y
* @param Translate $outputlangs Langs object * @param Translate $outputlangs Langs object
@ -793,7 +793,7 @@ class pdf_azur extends ModelePDFPropales
/** /**
* Show total to pay * Show total to pay
* *
* @param PDF &$pdf Object PDF * @param PDF $pdf Object PDF
* @param Facture $object Object invoice * @param Facture $object Object invoice
* @param int $deja_regle Montant deja regle * @param int $deja_regle Montant deja regle
* @param int $posy Position depart * @param int $posy Position depart
@ -1065,7 +1065,7 @@ class pdf_azur extends ModelePDFPropales
/** /**
* Show table for lines * Show table for lines
* *
* @param PDF &$pdf Object PDF * @param PDF $pdf Object PDF
* @param string $tab_top Top position of table * @param string $tab_top Top position of table
* @param string $tab_height Height of table (rectangle) * @param string $tab_height Height of table (rectangle)
* @param int $nexY Y (not used) * @param int $nexY Y (not used)
@ -1169,7 +1169,7 @@ class pdf_azur extends ModelePDFPropales
/** /**
* Show top header of page. * Show top header of page.
* *
* @param PDF &$pdf Object PDF * @param PDF $pdf Object PDF
* @param Object $object Object to show * @param Object $object Object to show
* @param int $showaddress 0=no, 1=yes * @param int $showaddress 0=no, 1=yes
* @param Translate $outputlangs Object lang for output * @param Translate $outputlangs Object lang for output
@ -1369,7 +1369,7 @@ class pdf_azur extends ModelePDFPropales
/** /**
* Show footer of page. Need this->emetteur object * Show footer of page. Need this->emetteur object
* *
* @param PDF &$pdf PDF * @param PDF $pdf PDF
* @param Object $object Object to show * @param Object $object Object to show
* @param Translate $outputlangs Object lang for output * @param Translate $outputlangs Object lang for output
* @param int $hidefreetext 1=Hide free text * @param int $hidefreetext 1=Hide free text

View File

@ -260,7 +260,7 @@ class pdf_paiement
/** /**
* Show top header of page. * Show top header of page.
* *
* @param PDF &$pdf Object PDF * @param PDF $pdf Object PDF
* @param int $page Object to show * @param int $page Object to show
* @param int $showaddress 0=no, 1=yes * @param int $showaddress 0=no, 1=yes
* @param Translate $outputlangs Object lang for output * @param Translate $outputlangs Object lang for output
@ -319,7 +319,7 @@ class pdf_paiement
/** /**
* Output body * Output body
* *
* @param PDF &$pdf PDF object * @param PDF $pdf PDF object
* @param string $page Page * @param string $page Page
* @param array $lines Array of lines * @param array $lines Array of lines
* @param Translate $outputlangs Object langs * @param Translate $outputlangs Object langs

View File

@ -239,7 +239,7 @@ class mod_codeclient_elephant extends ModeleThirdPartyCode
* Check validity of code according to its rules * Check validity of code according to its rules
* *
* @param DoliDB $db Database handler * @param DoliDB $db Database handler
* @param string &$code Code to check/correct * @param string $code Code to check/correct
* @param Societe $soc Object third party * @param Societe $soc Object third party
* @param int $type 0 = customer/prospect , 1 = supplier * @param int $type 0 = customer/prospect , 1 = supplier
* @return int 0 if OK * @return int 0 if OK

View File

@ -90,7 +90,7 @@ class mod_codeclient_leopard extends ModeleThirdPartyCode
* Check validity of code according to its rules * Check validity of code according to its rules
* *
* @param DoliDB $db Database handler * @param DoliDB $db Database handler
* @param string &$code Code to check/correct * @param string $code Code to check/correct
* @param Societe $soc Object third party * @param Societe $soc Object third party
* @param int $type 0 = customer/prospect , 1 = supplier * @param int $type 0 = customer/prospect , 1 = supplier
* @return int 0 if OK * @return int 0 if OK

View File

@ -140,7 +140,7 @@ class mod_codeclient_monkey extends ModeleThirdPartyCode
$date = dol_now(); $date = dol_now();
$yymm = strftime("%y%m",$date); $yymm = strftime("%y%m",$date);
if ($max >= (pow(10, 4) - 1)) $num=$max+1; // If counter > 9999, we do not format on 4 chars, we take number as it is if ($max >= (pow(10, 4) - 1)) $num=$max+1; // If counter > 9999, we do not format on 4 chars, we take number as it is
else $num = sprintf("%04s",$max+1); else $num = sprintf("%04s",$max+1);
@ -153,7 +153,7 @@ class mod_codeclient_monkey extends ModeleThirdPartyCode
* Check validity of code according to its rules * Check validity of code according to its rules
* *
* @param DoliDB $db Database handler * @param DoliDB $db Database handler
* @param string &$code Code to check/correct * @param string $code Code to check/correct
* @param Societe $soc Object third party * @param Societe $soc Object third party
* @param int $type 0 = customer/prospect , 1 = supplier * @param int $type 0 = customer/prospect , 1 = supplier
* @return int 0 if OK * @return int 0 if OK

View File

@ -504,7 +504,7 @@ class pdf_canelle extends ModelePDFSuppliersInvoices
/** /**
* Show total to pay * Show total to pay
* *
* @param PDF &$pdf Object PDF * @param PDF $pdf Object PDF
* @param Facture $object Object invoice * @param Facture $object Object invoice
* @param int $deja_regle Montant deja regle * @param int $deja_regle Montant deja regle
* @param int $posy Position depart * @param int $posy Position depart
@ -699,7 +699,7 @@ class pdf_canelle extends ModelePDFSuppliersInvoices
/** /**
* Show table for lines * Show table for lines
* *
* @param PDF &$pdf Object PDF * @param PDF $pdf Object PDF
* @param string $tab_top Top position of table * @param string $tab_top Top position of table
* @param string $tab_height Height of table (rectangle) * @param string $tab_height Height of table (rectangle)
* @param int $nexY Y (not used) * @param int $nexY Y (not used)
@ -795,7 +795,7 @@ class pdf_canelle extends ModelePDFSuppliersInvoices
/** /**
* Show payments table * Show payments table
* *
* @param PDF &$pdf Object PDF * @param PDF $pdf Object PDF
* @param Object $object Object invoice * @param Object $object Object invoice
* @param int $posy Position y in PDF * @param int $posy Position y in PDF
* @param Translate $outputlangs Object langs for output * @param Translate $outputlangs Object langs for output
@ -879,7 +879,7 @@ class pdf_canelle extends ModelePDFSuppliersInvoices
/** /**
* Show top header of page. * Show top header of page.
* *
* @param PDF &$pdf Object PDF * @param PDF $pdf Object PDF
* @param Object $object Object to show * @param Object $object Object to show
* @param int $showaddress 0=no, 1=yes * @param int $showaddress 0=no, 1=yes
* @param Translate $outputlangs Object lang for output * @param Translate $outputlangs Object lang for output
@ -1054,7 +1054,7 @@ class pdf_canelle extends ModelePDFSuppliersInvoices
/** /**
* Show footer of page. Need this->emetteur object * Show footer of page. Need this->emetteur object
* *
* @param PDF &$pdf PDF * @param PDF $pdf PDF
* @param Object $object Object to show * @param Object $object Object to show
* @param Translate $outputlangs Object lang for output * @param Translate $outputlangs Object lang for output
* @param int $hidefreetext 1=Hide free text * @param int $hidefreetext 1=Hide free text

View File

@ -530,7 +530,7 @@ class pdf_muscadet extends ModelePDFSuppliersOrders
/** /**
* Show payments table * Show payments table
* *
* @param PDF &$pdf Object PDF * @param PDF $pdf Object PDF
* @param Object $object Object order * @param Object $object Object order
* @param int $posy Position y in PDF * @param int $posy Position y in PDF
* @param Translate $outputlangs Object langs for output * @param Translate $outputlangs Object langs for output
@ -545,7 +545,7 @@ class pdf_muscadet extends ModelePDFSuppliersOrders
/** /**
* Show miscellaneous information (payment mode, payment term, ...) * Show miscellaneous information (payment mode, payment term, ...)
* *
* @param PDF &$pdf Object PDF * @param PDF $pdf Object PDF
* @param Object $object Object to show * @param Object $object Object to show
* @param int $posy Y * @param int $posy Y
* @param Translate $outputlangs Langs object * @param Translate $outputlangs Langs object
@ -608,7 +608,7 @@ class pdf_muscadet extends ModelePDFSuppliersOrders
/** /**
* Show total to pay * Show total to pay
* *
* @param PDF &$pdf Object PDF * @param PDF $pdf Object PDF
* @param Facture $object Object invoice * @param Facture $object Object invoice
* @param int $deja_regle Montant deja regle * @param int $deja_regle Montant deja regle
* @param int $posy Position depart * @param int $posy Position depart
@ -819,7 +819,7 @@ class pdf_muscadet extends ModelePDFSuppliersOrders
/** /**
* Show table for lines * Show table for lines
* *
* @param PDF &$pdf Object PDF * @param PDF $pdf Object PDF
* @param string $tab_top Top position of table * @param string $tab_top Top position of table
* @param string $tab_height Height of table (rectangle) * @param string $tab_height Height of table (rectangle)
* @param int $nexY Y (not used) * @param int $nexY Y (not used)
@ -914,7 +914,7 @@ class pdf_muscadet extends ModelePDFSuppliersOrders
/** /**
* Show top header of page. * Show top header of page.
* *
* @param PDF &$pdf Object PDF * @param PDF $pdf Object PDF
* @param Object $object Object to show * @param Object $object Object to show
* @param int $showaddress 0=no, 1=yes * @param int $showaddress 0=no, 1=yes
* @param Translate $outputlangs Object lang for output * @param Translate $outputlangs Object lang for output
@ -1106,7 +1106,7 @@ class pdf_muscadet extends ModelePDFSuppliersOrders
/** /**
* Show footer of page. Need this->emetteur object * Show footer of page. Need this->emetteur object
* *
* @param PDF &$pdf PDF * @param PDF $pdf PDF
* @param Object $object Object to show * @param Object $object Object to show
* @param Translate $outputlangs Object lang for output * @param Translate $outputlangs Object lang for output
* @param int $hidefreetext 1=Hide free text * @param int $hidefreetext 1=Hide free text

View File

@ -88,6 +88,7 @@ $hookmanager->initHooks(array('expeditioncard'));
*/ */
$parameters=array(); $parameters=array();
$reshook=$hookmanager->executeHooks('doActions',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks $reshook=$hookmanager->executeHooks('doActions',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks
if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
if ($action == 'add') if ($action == 'add')
{ {

View File

@ -4,6 +4,7 @@
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com> * Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2011-2013 Juanjo Menent <jmenent@2byte.es> * Copyright (C) 2011-2013 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro> * Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
* Copyright (C) 2014 Ferran Marcet <fmarcet@2byte.es>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
@ -64,6 +65,7 @@ $mesg = GETPOST('msg','alpha');
$origin=GETPOST('origin','alpha'); $origin=GETPOST('origin','alpha');
$originid=(GETPOST('originid','int')?GETPOST('originid','int'):GETPOST('origin_id','int')); // For backward compatibility $originid=(GETPOST('originid','int')?GETPOST('originid','int'):GETPOST('origin_id','int')); // For backward compatibility
$note_public = GETPOST('note_public'); $note_public = GETPOST('note_public');
$lineid = GETPOST('line_id','int');
//PDF //PDF
$hidedetails = (GETPOST('hidedetails','int') ? GETPOST('hidedetails','int') : (! empty($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_DETAILS) ? 1 : 0)); $hidedetails = (GETPOST('hidedetails','int') ? GETPOST('hidedetails','int') : (! empty($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_DETAILS) ? 1 : 0));
@ -96,7 +98,11 @@ $permissionnote=$user->rights->ficheinter->creer; // Used by the include of acti
* Actions * Actions
*/ */
include DOL_DOCUMENT_ROOT.'/core/actions_setnotes.inc.php'; // Must be include, not includ_once $parameters=array('socid'=>$socid);
$reshook=$hookmanager->executeHooks('doActions',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks
if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
include DOL_DOCUMENT_ROOT.'/core/actions_setnotes.inc.php'; // Must be include, not include_once
if ($action == 'confirm_validate' && $confirm == 'yes' && $user->rights->ficheinter->creer) if ($action == 'confirm_validate' && $confirm == 'yes' && $user->rights->ficheinter->creer)
{ {
@ -538,7 +544,7 @@ else if ($action == 'classifyunbilled' && $user->rights->ficheinter->creer)
else if ($action == 'updateline' && $user->rights->ficheinter->creer && GETPOST('save','alpha') == $langs->trans("Save")) else if ($action == 'updateline' && $user->rights->ficheinter->creer && GETPOST('save','alpha') == $langs->trans("Save"))
{ {
$objectline = new FichinterLigne($db); $objectline = new FichinterLigne($db);
if ($objectline->fetch(GETPOST('line_id','int')) <= 0) if ($objectline->fetch($lineid) <= 0)
{ {
dol_print_error($db); dol_print_error($db);
exit; exit;
@ -594,7 +600,7 @@ else if ($action == 'updateline' && $user->rights->ficheinter->creer && GETPOST(
else if ($action == 'confirm_deleteline' && $confirm == 'yes' && $user->rights->ficheinter->creer) else if ($action == 'confirm_deleteline' && $confirm == 'yes' && $user->rights->ficheinter->creer)
{ {
$objectline = new FichinterLigne($db); $objectline = new FichinterLigne($db);
if ($objectline->fetch(GETPOST('line_id','int')) <= 0) if ($objectline->fetch($lineid) <= 0)
{ {
dol_print_error($db); dol_print_error($db);
exit; exit;
@ -626,7 +632,7 @@ else if ($action == 'confirm_deleteline' && $confirm == 'yes' && $user->rights->
else if ($action == 'up' && $user->rights->ficheinter->creer) else if ($action == 'up' && $user->rights->ficheinter->creer)
{ {
$object->line_up(GETPOST('line_id','int')); $object->line_up($lineid);
// Define output language // Define output language
$outputlangs = $langs; $outputlangs = $langs;
@ -640,13 +646,13 @@ else if ($action == 'up' && $user->rights->ficheinter->creer)
} }
if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) fichinter_create($db, $object, $object->modelpdf, $outputlangs); if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) fichinter_create($db, $object, $object->modelpdf, $outputlangs);
header('Location: '.$_SERVER["PHP_SELF"].'?id='.$object->id.'#'.GETPOST('line_id','int')); header('Location: '.$_SERVER["PHP_SELF"].'?id='.$object->id.'#'.$lineid);
exit; exit;
} }
else if ($action == 'down' && $user->rights->ficheinter->creer) else if ($action == 'down' && $user->rights->ficheinter->creer)
{ {
$object->line_down(GETPOST('line_id','int')); $object->line_down($lineid);
// Define output language // Define output language
$outputlangs = $langs; $outputlangs = $langs;
@ -660,7 +666,7 @@ else if ($action == 'down' && $user->rights->ficheinter->creer)
} }
if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) fichinter_create($db, $object, $object->modelpdf, $outputlangs); if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) fichinter_create($db, $object, $object->modelpdf, $outputlangs);
header('Location: '.$_SERVER["PHP_SELF"].'?id='.$object->id.'#'.GETPOST('line_id','int')); header('Location: '.$_SERVER["PHP_SELF"].'?id='.$object->id.'#'.$lineid);
exit; exit;
} }
@ -1157,11 +1163,12 @@ else if ($id > 0 || ! empty($ref))
dol_fiche_head($head, 'card', $langs->trans("InterventionCard"), 0, 'intervention'); dol_fiche_head($head, 'card', $langs->trans("InterventionCard"), 0, 'intervention');
$formconfirm='';
// Confirmation de la suppression de la fiche d'intervention // Confirmation de la suppression de la fiche d'intervention
if ($action == 'delete') if ($action == 'delete')
{ {
print $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('DeleteIntervention'), $langs->trans('ConfirmDeleteIntervention'), 'confirm_delete','',0,1); $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('DeleteIntervention'), $langs->trans('ConfirmDeleteIntervention'), 'confirm_delete','',0,1);
} }
// Confirmation validation // Confirmation validation
@ -1184,29 +1191,34 @@ else if ($id > 0 || ! empty($ref))
} }
$text=$langs->trans('ConfirmValidateIntervention',$numref); $text=$langs->trans('ConfirmValidateIntervention',$numref);
print $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('ValidateIntervention'), $text, 'confirm_validate','',0,1); $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('ValidateIntervention'), $text, 'confirm_validate','',0,1);
} }
// Confirmation de la validation de la fiche d'intervention // Confirmation de la validation de la fiche d'intervention
if ($action == 'modify') if ($action == 'modify')
{ {
print $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('ModifyIntervention'), $langs->trans('ConfirmModifyIntervention'), 'confirm_modify','',0,1); $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('ModifyIntervention'), $langs->trans('ConfirmModifyIntervention'), 'confirm_modify','',0,1);
} }
// Confirmation de la suppression d'une ligne d'intervention // Confirmation de la suppression d'une ligne d'intervention
if ($action == 'ask_deleteline') if ($action == 'ask_deleteline')
{ {
print $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id.'&line_id='.GETPOST('line_id','int'), $langs->trans('DeleteInterventionLine'), $langs->trans('ConfirmDeleteInterventionLine'), 'confirm_deleteline','',0,1); $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id.'&line_id='.$lineid, $langs->trans('DeleteInterventionLine'), $langs->trans('ConfirmDeleteInterventionLine'), 'confirm_deleteline','',0,1);
} }
if (!$formconfirm)
{
$parameters=array('lineid'=>$lineid);
$formconfirm=$hookmanager->executeHooks('formConfirm',$parameters,$object,$action); // Note that $action and $object may have been modified by hook
}
// Print form confirm
print $formconfirm;
print '<form action="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'" method="POST" name="formfichinter">'; print '<form action="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'" method="POST" name="formfichinter">';
print '<input type="hidden" name="id" value="'.$object->id.'">'; print '<input type="hidden" name="id" value="'.$object->id.'">';
if ($action == 'edit_extras') print '<input type="hidden" name="action" value="update_extras">'; if ($action == 'edit_extras') print '<input type="hidden" name="action" value="update_extras">';
if ($action == 'contrat') print '<input type="hidden" name="action" value="setcontrat">'; if ($action == 'contrat') print '<input type="hidden" name="action" value="setcontrat">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">'; print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<table class="border" width="100%">'; print '<table class="border" width="100%">';
@ -1214,18 +1226,18 @@ else if ($id > 0 || ! empty($ref))
$linkback = '<a href="'.DOL_URL_ROOT.'/fichinter/list.php'.(! empty($socid)?'?socid='.$socid:'').'">'.$langs->trans("BackToList").'</a>'; $linkback = '<a href="'.DOL_URL_ROOT.'/fichinter/list.php'.(! empty($socid)?'?socid='.$socid:'').'">'.$langs->trans("BackToList").'</a>';
// Ref // Ref
print '<tr><td width="25%">'.$langs->trans("Ref").'</td><td>'; print '<tr><td width="25%">'.$langs->trans("Ref").'</td><td colspan="3">';
print $form->showrefnav($object, 'ref', $linkback, 1, 'ref', 'ref'); print $form->showrefnav($object, 'ref', $linkback, 1, 'ref', 'ref');
print '</td></tr>'; print '</td></tr>';
// Third party // Third party
print "<tr><td>".$langs->trans("Company")."</td><td>".$object->client->getNomUrl(1)."</td></tr>"; print "<tr><td>".$langs->trans("Company").'</td><td colspan="3">'.$object->client->getNomUrl(1)."</td></tr>";
if (empty($conf->global->FICHINTER_DISABLE_DETAILS)) if (empty($conf->global->FICHINTER_DISABLE_DETAILS))
{ {
// Duration // Duration
print '<tr><td>'.$langs->trans("TotalDuration").'</td>'; print '<tr><td>'.$langs->trans("TotalDuration").'</td>';
print '<td>'.convertSecondToTime($object->duree, 'all', $conf->global->MAIN_DURATION_OF_WORKDAY).'</td>'; print '<td colspan="3">'.convertSecondToTime($object->duree, 'all', $conf->global->MAIN_DURATION_OF_WORKDAY).'</td>';
print '</tr>'; print '</tr>';
} }
@ -1316,7 +1328,7 @@ else if ($id > 0 || ! empty($ref))
} }
// Statut // Statut
print '<tr><td>'.$langs->trans("Status").'</td><td>'.$object->getLibStatut(4).'</td></tr>'; print '<tr><td>'.$langs->trans("Status").'</td><td colspan="3">'.$object->getLibStatut(4).'</td></tr>';
// Other attributes (TODO Move this into an include) // Other attributes (TODO Move this into an include)
$parameters=array('colspan' => ' colspan="3"'); $parameters=array('colspan' => ' colspan="3"');

View File

@ -131,6 +131,7 @@ else
print $langs->trans("ErrorUnknown"); print $langs->trans("ErrorUnknown");
} }
llxFooter(); llxFooter();
$db->close(); $db->close();

View File

@ -54,6 +54,7 @@ $object = new Fournisseur($db);
$parameters=array('socid'=>$socid); $parameters=array('socid'=>$socid);
$reshook=$hookmanager->executeHooks('doActions',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks $reshook=$hookmanager->executeHooks('doActions',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks
if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
if ($action == 'setsupplieraccountancycode') if ($action == 'setsupplieraccountancycode')
{ {

View File

@ -110,6 +110,7 @@ $permissionnote=$user->rights->fournisseur->commande->creer; // Used by the incl
$parameters=array('socid'=>$socid); $parameters=array('socid'=>$socid);
$reshook=$hookmanager->executeHooks('doActions',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks $reshook=$hookmanager->executeHooks('doActions',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks
if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
include DOL_DOCUMENT_ROOT.'/core/actions_setnotes.inc.php'; // Must be include, not includ_once include DOL_DOCUMENT_ROOT.'/core/actions_setnotes.inc.php'; // Must be include, not includ_once
@ -1188,19 +1189,20 @@ if ($action=="create")
} }
elseif (! empty($object->id)) elseif (! empty($object->id))
{ {
$author = new User($db);
$author->fetch($object->user_author_id);
$societe = new Fournisseur($db); $societe = new Fournisseur($db);
$result=$societe->fetch($object->socid); $result=$societe->fetch($object->socid);
if ($result < 0) dol_print_error($db); if ($result < 0) dol_print_error($db);
$author = new User($db);
$author->fetch($object->user_author_id);
$res=$object->fetch_optionals($object->id,$extralabels);
$head = ordersupplier_prepare_head($object); $head = ordersupplier_prepare_head($object);
$title=$langs->trans("SupplierOrder"); $title=$langs->trans("SupplierOrder");
dol_fiche_head($head, 'card', $title, 0, 'order'); dol_fiche_head($head, 'card', $title, 0, 'order');
$res=$object->fetch_optionals($object->id,$extralabels);
/* /*
* Confirmation de la suppression de la commande * Confirmation de la suppression de la commande
@ -1435,7 +1437,7 @@ elseif (! empty($object->id))
print '</tr>'; print '</tr>';
// Delivery date planed // Delivery date planed
print '<tr><td height="10">'; print '<tr><td>';
print '<table class="nobordernopadding" width="100%"><tr><td>'; print '<table class="nobordernopadding" width="100%"><tr><td>';
print $langs->trans('DateDeliveryPlanned'); print $langs->trans('DateDeliveryPlanned');
print '</td>'; print '</td>';
@ -1456,13 +1458,13 @@ elseif (! empty($object->id))
{ {
print $object->date_livraison ? dol_print_date($object->date_livraison,'daytext') : '&nbsp;'; print $object->date_livraison ? dol_print_date($object->date_livraison,'daytext') : '&nbsp;';
} }
print '</td>'; print '</td></tr>';
// Project // Project
if (! empty($conf->projet->enabled)) if (! empty($conf->projet->enabled))
{ {
$langs->load('projects'); $langs->load('projects');
print '<tr><td height="10">'; print '<tr><td>';
print '<table class="nobordernopadding" width="100%"><tr><td>'; print '<table class="nobordernopadding" width="100%"><tr><td>';
print $langs->trans('Project'); print $langs->trans('Project');
print '</td>'; print '</td>';
@ -1482,24 +1484,19 @@ elseif (! empty($object->id))
print '</tr>'; print '</tr>';
} }
// Other attributes // Other attributes (TODO Move this into an include)
$parameters=array('socid'=>$socid, 'colspan' => ' colspan="3"'); $parameters=array('socid'=>$socid, 'colspan' => ' colspan="3"');
$reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$object,$action); // Note that $action and $object may have been modified by hook $reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$object,$action); // Note that $action and $object may have been modified by hook
if (empty($reshook) && ! empty($extrafields->attribute_label)) if (empty($reshook) && ! empty($extrafields->attribute_label))
{ {
if ($action == 'edit_extras')
{
print '<form enctype="multipart/form-data" action="'.$_SERVER["PHP_SELF"].'" method="post" name="formsoc">';
print '<input type="hidden" name="action" value="update_extras">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<input type="hidden" name="id" value="'.$object->id.'">';
}
foreach($extrafields->attribute_label as $key=>$label) foreach($extrafields->attribute_label as $key=>$label)
{ {
if ($action == 'edit_extras') { if ($action == 'edit_extras')
{
$value=(isset($_POST["options_".$key])?$_POST["options_".$key]:$object->array_options["options_".$key]); $value=(isset($_POST["options_".$key])?$_POST["options_".$key]:$object->array_options["options_".$key]);
} else { }
else
{
$value=$object->array_options["options_".$key]; $value=$object->array_options["options_".$key];
} }
@ -1518,15 +1515,25 @@ elseif (! empty($object->id))
$value = isset($_POST["options_".$key])?dol_mktime($_POST["options_".$key."hour"], $_POST["options_".$key."min"], 0, $_POST["options_".$key."month"], $_POST["options_".$key."day"], $_POST["options_".$key."year"]):$db->jdate($object->array_options['options_'.$key]); $value = isset($_POST["options_".$key])?dol_mktime($_POST["options_".$key."hour"], $_POST["options_".$key."min"], 0, $_POST["options_".$key."month"], $_POST["options_".$key."day"], $_POST["options_".$key."year"]):$db->jdate($object->array_options['options_'.$key]);
} }
if ($action == 'edit_extras' && $user->rights->fournisseur->commande->creer) if ($action == 'edit_extras' && $user->rights->commande->creer && GETPOST('attribute') == $key)
{ {
print $extrafields->showInputField($key,$value); print '<form enctype="multipart/form-data" action="' . $_SERVER["PHP_SELF"] . '" method="post" name="formsoc">';
print '<input type="hidden" name="action" value="update_extras">';
print '<input type="hidden" name="attribute" value="' . $key . '">';
print '<input type="hidden" name="token" value="' . $_SESSION ['newtoken'] . '">';
print '<input type="hidden" name="id" value="' . $object->id . '">';
print $extrafields->showInputField($key, $value);
print '<input type="submit" class="button" value="' . $langs->trans('Modify') . '">';
print '</form>';
} }
else else
{ {
print $extrafields->showOutputField($key,$value); print $extrafields->showOutputField($key, $value);
if ($object->statut == 0 && $user->rights->commande->creer)
print '<a href="' . $_SERVER['PHP_SELF'] . '?id=' . $object->id . '&action=edit_extras&attribute=' . $key . '">' . img_picto('', 'edit') . ' ' . $langs->trans('Modify') . '</a>';
} }
print '</td></tr>'."\n"; print '</td></tr>'."\n";
} }
} }

View File

@ -88,6 +88,7 @@ $permissionnote=$user->rights->fournisseur->facture->creer; // Used by the inclu
$parameters=array('socid'=>$socid); $parameters=array('socid'=>$socid);
$reshook=$hookmanager->executeHooks('doActions',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks $reshook=$hookmanager->executeHooks('doActions',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks
if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
include DOL_DOCUMENT_ROOT.'/core/actions_setnotes.inc.php'; // Must be include, not includ_once include DOL_DOCUMENT_ROOT.'/core/actions_setnotes.inc.php'; // Must be include, not includ_once

View File

@ -68,10 +68,13 @@ $hookmanager->initHooks(array('paymentsupplier'));
$parameters=array('socid'=>$socid); $parameters=array('socid'=>$socid);
$reshook=$hookmanager->executeHooks('doActions',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks $reshook=$hookmanager->executeHooks('doActions',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks
if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
/* /*
* Actions * Actions
*/ */
if ($action == 'add_paiement' || ($action == 'confirm_paiement' && $confirm=='yes')) if ($action == 'add_paiement' || ($action == 'confirm_paiement' && $confirm=='yes'))
{ {
$error = 0; $error = 0;

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