Add cache excel export on harddrive with

MAIN_USE_FILECACHE_EXPORT_EXCEL_DIR const. It can avoid lot's of stack
overflow on large excel export
This commit is contained in:
Florian HENRY 2014-09-29 10:16:48 +02:00
commit ce145cc056
143 changed files with 1159 additions and 715 deletions

View File

@ -110,6 +110,7 @@ For developers:
- 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: 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,
field civilite into label in the same 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
[ Laurent Destailleur (eldy) ]

View File

@ -17,9 +17,9 @@
; ----- Change this -----
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
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
OutputBaseFilename=DoliWamp-3.6.0
OutputBaseFilename=DoliWamp-3.6.1
; ----- End of change
;OutputManifestFile=build\doliwampbuild.log
; 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/PHPExcel/Shared/PDF`;
$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/freefont-20100919`;
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/tcpdf/fonts/dejavu-fonts-ttf-*`;
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/tcpdf/fonts/freefont-*`;
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/tcpdf/fonts/utils`;
$ret=`rm -f $BUILDROOT/$PROJECT/htdocs/includes/tcpdf/LICENSE.TXT`;
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/savant`;
@ -610,9 +610,6 @@ if ($nboftargetok) {
print "Version is $MAJOR.$MINOR.$REL1-$RPMSUBVERSION\n";
#print "Create directory $RPMDIR\n";
#$ret=`mkdir -p "$RPMDIR"`;
print "Remove target ".$FILENAMERPM."...\n";
unlink("$NEWDESTI/".$FILENAMERPM);
print "Remove target ".$FILENAMETGZ2."-".$RPMSUBVERSION.".src.rpm...\n";
@ -620,13 +617,13 @@ if ($nboftargetok) {
print "Create directory $BUILDROOT/$FILENAMETGZ2\n";
$ret=`rm -fr $BUILDROOT/$FILENAMETGZ2`;
print "Copy $BUILDROOT/$PROJECT to $BUILDROOT/$FILENAMETGZ2\n";
$cmd="cp -pr '$BUILDROOT/$PROJECT' '$BUILDROOT/$FILENAMETGZ2'";
$ret=`$cmd`;
# Set owners
#print "Set owners on files/dir\n";
#$ret=`chown -R root.root $BUILDROOT/$FILENAMETGZ2`;
# Removed files we don't need
$ret=`rm -fr $BUILDROOT/$FILENAMETGZ2/htdocs/includes/ckeditor/_source`;
print "Set permissions on files/dir\n";
$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/zip`;
# 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/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/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
$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/rpm/*.spec
- Commit all changes.
- Add a Tag (x.y.z)
- Build Dolibarr and DoliWamp packages with makepack-dolibarr.pl
- Check content of built packages.
- Move build files into www.dolibarr.org web site
(/home/dolibarr/wwwroot/files/stable).
- 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"
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
%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
- 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
%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
- 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
%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
- 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
%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
- Upstream release

View File

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

View File

@ -44,6 +44,8 @@ $object = new Adherent($db);
$result=$object->fetch($id);
if ($result > 0)
{
$object->fetch_thirdparty();
$adht = new AdherentType($db);
$result=$adht->fetch($object->typeid);
}
@ -146,7 +148,23 @@ if ($object->id > 0)
print '<br>';
print load_fiche_titre($langs->trans("ActionsOnMember"),'','');
$out='';
/*$objthirdparty=$object->thirdparty;
$objcon=new stdClass();
$permok=$user->rights->agenda->myactions->create;
if ((! empty($objthirdparty->id) || ! empty($objcon->id)) && $permok)
{
$out.='<a href="'.DOL_URL_ROOT.'/comm/action/card.php?action=create';
if (get_class($objthirdparty) == 'Societe') $out.='&amp;socid='.$objthirdparty->id;
$out.=(! empty($objcon->id)?'&amp;contactid='.$objcon->id:'').'&amp;backtopage=1&amp;percentage=-1">';
$out.=$langs->trans("AddAnAction").' ';
$out.=img_picto($langs->trans("AddAnAction"),'filenew');
$out.="</a>";
}*/
print load_fiche_titre($langs->trans("ActionsOnMember"),$out,'');
// List of todo actions
show_actions_todo($conf,$langs,$db,$object);

View File

@ -94,7 +94,7 @@ abstract class ActionsAdherentCardCommon
/**
* Load data control
*
* @param string &$action Type of action
* @param string $action Type of action
* @param int $id Id of object
* @return void
*/
@ -228,7 +228,7 @@ abstract class ActionsAdherentCardCommon
/**
* 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
* @return string HTML output
*/

View File

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

View File

@ -117,6 +117,7 @@ $hookmanager->initHooks(array('membercard'));
$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
if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
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 Benoit Mortier <benoit.mortier@opensides.be>
* 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) 2011-2013 Juanjo Menent <jmenent@2byte.es>
* 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
if ($action == 'set')
{
@ -192,14 +221,6 @@ else if ($action == 'set_COMMANDE_FREE_TEXT')
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

@ -35,8 +35,9 @@ if (!$user->admin) accessforbidden();
$action = GETPOST('action','alpha');
$value = GETPOST('value','alpha');
$label = GETPOST('label','alpha');
$scandir = GETPOST('scandir','alpha');
$type='contrat';
$type='contract';
if (empty($conf->global->CONTRACT_ADDON))
{
@ -111,6 +112,35 @@ else if ($action == 'specimen') // For contract
}
}
// 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
else if ($action == 'set')
{
@ -192,7 +222,7 @@ else if ($action == 'set_CONTRACT_DRAFT_WATERMARK')
*/
$dirmodels=array_merge(array('/'),(array) $conf->modules_parts['models']);
llxHeader();
$form=new Form($db);
@ -318,7 +348,6 @@ print '</table><br>';
print_titre($langs->trans("TemplatePDFContracts"));
// Defini tableau def des modeles
$type='contrat';
$def = array();
$sql = "SELECT nom";
$sql.= " FROM ".MAIN_DB_PREFIX."document_model";

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
else if ($action == 'set')
{
@ -175,14 +204,6 @@ else if ($action == 'setmodel')
{
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 Sebastien Di Cintio <sdicintio@ressource-toi.org>
* 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) 2011-2013 Juanjo Menent <jmenent@2byte.es>
* 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
else if ($action == 'set')
{
@ -261,13 +290,13 @@ foreach ($dirmodels as $reldir)
require_once $dir.$file.'.php';
$module = new $file;
if ($module->isEnabled())
{
// Show modules according to features level
if ($module->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL < 2) continue;
if ($module->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1) continue;
$var=!$var;
print '<tr '.$bc[$var].'><td>'.$module->nom."</td><td>\n";
print $module->info();
@ -372,78 +401,99 @@ foreach ($dirmodels as $reldir)
$handle=opendir($dir);
if (is_resource($handle))
{
while (($file = readdir($handle))!==false)
{
if (substr($file, dol_strlen($file) -12) == '.modules.php' && substr($file,0,4) == 'pdf_')
while (($file = readdir($handle))!==false)
{
$filelist[]=$file;
}
closedir($handle);
arsort($filelist);
foreach($filelist as $file)
{
if (preg_match('/\.modules\.php$/i',$file) && preg_match('/^(pdf_|doc_)/',$file))
{
$var=!$var;
$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))
if (file_exists($dir.'/'.$file))
{
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>";
}
$var=!$var;
// 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>';
$name = substr($file, 4, dol_strlen($file) -16);
$classname = substr($file, 0, dol_strlen($file) -12);
// 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
$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>';
require_once $dir.'/'.$file;
$module = new $classname($db);
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 Benoit Mortier <benoit.mortier@opensides.be>
* 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 Philippe Grand <philippe.grand@atoo-net.com>
*
@ -95,7 +95,7 @@ if ($action == 'specimen')
$dirmodels=array_merge(array('/'),(array) $conf->modules_parts['models']);
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))
{
$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')
{
$ret = addDocumentModel($value, $type, $label, $scandir);
@ -356,75 +385,101 @@ clearstatcache();
$var=true;
foreach ($dirmodels as $reldir)
{
$dir = dol_buildpath($reldir."core/modules/livraison/pdf/");
$dir = dol_buildpath($reldir."core/modules/livraison/doc/");
if (is_dir($dir))
{
$handle = opendir($dir);
if (is_resource($handle))
{
while (($file = readdir($handle))!==false)
{
if (substr($file, dol_strlen($file) -12) == '.modules.php' && substr($file,0,4) == 'pdf_')
while (($file = readdir($handle))!==false)
{
$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);
$classname = substr($file, 0, dol_strlen($file) - 12);
if (file_exists($dir.'/'.$file))
{
$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>';
print $name;
print "</td><td>\n";
require_once $dir.$file;
$module = new $classname($db);
require_once $dir.'/'.$file;
$module = new $classname($db);
print $module->description;
print '</td>';
$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;
// Activ
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>";
}
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>';
// Default
print "<td align=\"center\">";
if ($conf->global->LIVRAISON_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>';
// 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>";
}
// 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>';
print '<td align="center">';
print '<a href="'.$_SERVER["PHP_SELF"].'?action=specimen&module='.$name.'">'.img_object($langs->trans("Preview"),'sending').'</a>';
print '</td>';
// Default
print "<td align=\"center\">";
if ($conf->global->LIVRAISON_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>';
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();
$db->close();

View File

@ -102,7 +102,7 @@ $hookmanager->initHooks(array('categorycard'));
$parameters=array('id'=>$socid);
$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))
{

View File

@ -219,6 +219,7 @@ if ($action == 'add')
if ($value['id'] > 0)
{
$usertodo->fetch($value['id']);
$object->userownerid = $usertodo->id;
}
$object->usertodo = $usertodo;
$object->transparency = (GETPOST("transparency")=='on'?1:0);
@ -235,6 +236,7 @@ if ($action == 'add')
if ($_POST["doneby"] > 0)
{
$userdone->fetch($_POST["doneby"]);
$object->userdoneid = $userdone->id;
}
$object->userdone = $userdone;
}

View File

@ -47,8 +47,10 @@ class ActionComm extends CommonObject
var $datec; // Date creation record (datec)
var $datem; // Date modification record (tms)
var $author; // Object user that create action
var $usermod; // Object user that modified action
var $author; // Object user that create action //deprecated
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 $datef; // Date action end (datep2)
@ -63,8 +65,9 @@ class ActionComm extends CommonObject
var $note; // Description
var $userassigned = array(); // Array of user ids
var $usertodo; // Object user of owner
var $userdone; // Object user that did action (deprecated)
var $userownerid; // Id of user owner
var $usertodo; // Object user of owner // deprecated
var $userdone; // Object user that did action // deprecated
var $socid;
var $contactid;
@ -134,6 +137,9 @@ class ActionComm extends CommonObject
if ($this->elementtype=='commande') $this->elementtype='order';
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)
{
// Get id from code
@ -197,8 +203,8 @@ class ActionComm extends CommonObject
$sql.= " '".$this->db->escape($this->note)."',";
$sql.= (isset($this->contactid) && $this->contactid > 0?"'".$this->contactid."'":"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.= (isset($this->userdone->id) && $this->userdone->id > 0?"'".$this->userdone->id."'":"null").",";
$sql.= ($userownerid>0?"'".$userownerid."'":"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->transparency."',";
$sql.= (! empty($this->fk_element)?$this->fk_element:"null").",";
@ -304,7 +310,7 @@ class ActionComm extends CommonObject
$sql.= " a.fk_user_action, a.fk_user_done,";
$sql.= " a.fk_contact, a.percent as percentage,";
$sql.= " a.fk_element, a.elementtype,";
$sql.= " a.priority, a.fulldayevent, a.location, a.transparency,";
$sql.= " a.priority, a.fulldayevent, a.location, a.punctual, a.transparency,";
$sql.= " c.id as type_id, c.code as type_code, c.libelle,";
$sql.= " s.nom as socname,";
$sql.= " u.firstname, u.lastname as lastname";
@ -351,8 +357,9 @@ class ActionComm extends CommonObject
$this->author->lastname = $obj->lastname;
$this->usermod->id = $obj->fk_user_mod;
$this->usertodo->id = $obj->fk_user_action;
$this->userdone->id = $obj->fk_user_done;
$this->userownerid = $obj->fk_user_action;
$this->usertodo->id = $obj->fk_user_action; // deprecated
//$this->userdone->id = $obj->fk_user_done;
$this->priority = $obj->priority;
$this->fulldayevent = $obj->fulldayevent;
$this->location = $obj->location;
@ -380,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
*/
function fetch_userassigned()
{
global $langs;
$sql.="SELECT fk_actioncomm, element_type, fk_element, answer_status, mandatory, transparency";
$sql.=" FROM ".MAIN_DB_PREFIX."actioncomm_resources";
$sql.=" WHERE element_type = 'user' AND fk_actioncomm = ".$this->id;
$resql2=$this->db->query($sql);
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))
{
$this->userassigned[$obj->fk_element]=array('id'=>$obj->fk_element, 'mandatory'=>$obj->mandatory, 'answer_status'=>$obj->answer_status, 'transparency'=>$obj->transparency);
@ -948,7 +961,7 @@ class ActionComm extends CommonObject
$sql.= " a.fk_user_action, a.fk_user_done,";
$sql.= " a.fk_contact, a.percent as percentage,";
$sql.= " a.fk_element, a.elementtype,";
$sql.= " a.priority, a.fulldayevent, a.location,";
$sql.= " a.priority, a.fulldayevent, a.location, a.punctual, a.transparency,";
$sql.= " u.firstname, u.lastname,";
$sql.= " s.nom as socname,";
$sql.= " c.id as type_id, c.code as type_code, c.libelle";

View File

@ -218,9 +218,9 @@ if (empty($action) || $action=='show_month')
$tmpday = -date("w",dol_mktime(0,0,0,$month,1,$year))+2;
$tmpday+=((isset($conf->global->MAIN_START_WEEK)?$conf->global->MAIN_START_WEEK:1)-1);
if ($tmpday >= 1) $tmpday -= 7;
// Define firstdaytoshow and lastdaytoshow
// Define firstdaytoshow and lastdaytoshow (warning: lastdaytoshow is last second to show + 1)
$firstdaytoshow=dol_mktime(0,0,0,$prev_month,$max_day_in_prev_month+$tmpday,$prev_year);
$next_day=7-($max_day_in_month+1-$tmpday)%7;
$next_day=7 - ($max_day_in_month+1-$tmpday) % 7;
if ($next_day < 6) $next_day+=7;
$lastdaytoshow=dol_mktime(0,0,0,$next_month,$next_day,$next_year);
}
@ -242,9 +242,9 @@ if ($action=='show_week')
$next_month = $next['month'];
$next_day = $next['day'];
// Define firstdaytoshow and lastdaytoshow
// Define firstdaytoshow and lastdaytoshow (warning: lastdaytoshow is last second to show + 1)
$firstdaytoshow=dol_mktime(0,0,0,$first_month,$first_day,$first_year);
$lastdaytoshow=dol_time_plus_duree($firstdaytoshow, 6, 'd');
$lastdaytoshow=dol_time_plus_duree($firstdaytoshow, 7, 'd');
$max_day_in_month = date("t",dol_mktime(0,0,0,$month,1,$year));
@ -261,7 +261,7 @@ if ($action == 'show_day')
$next_month = $next['month'];
$next_day = $next['day'];
// Define firstdaytoshow and lastdaytoshow
// Define firstdaytoshow and lastdaytoshow (warning: lastdaytoshow is last second to show + 1)
$firstdaytoshow=dol_mktime(0,0,0,$prev_month,$prev_day,$prev_year);
$lastdaytoshow=dol_mktime(0,0,0,$next_month,$next_day,$next_year);
}
@ -419,6 +419,7 @@ if ($actioncode) $sql.=" AND ca.code='".$db->escape($actioncode)."'";
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 ($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 ($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 == '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)."'))"; }
// FIXME: We must filter on assignement table
if ($filtera > 0 || $filtert > 0 || $filterd > 0 || $usergroup > 0)
{
$sql.= " AND (";
@ -484,10 +486,12 @@ if ($resql)
$event->type_code=$obj->code;
$event->libelle=$obj->label;
$event->percentage=$obj->percent;
$event->author->id=$obj->fk_user_author; // user id of creator
$event->usertodo->id=$obj->fk_user_action; // user id of owner
$event->userdone->id=$obj->fk_user_done; // deprecated
// $event->userstodo=... with s after user, in future version, will be an array with all id of user assigned to event
//$event->author->id=$obj->fk_user_author; // user id of creator
$event->authorid=$obj->fk_user_author; // user id of creator
$event->userownerid=$obj->fk_user_action; // user id of owner
$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->fulldayevent=$obj->fulldayevent;
$event->location=$obj->location;
@ -518,14 +522,14 @@ if ($resql)
// Check values
if ($event->date_end_in_calendar < $firstdaytoshow ||
$event->date_start_in_calendar > $lastdaytoshow)
$event->date_start_in_calendar >= $lastdaytoshow)
{
// This record is out of visible range
}
else
{
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-1);
// Add an entry in actionarray for each day
$daycursor=$event->date_start_in_calendar;
@ -655,7 +659,7 @@ if (count($listofextcals))
if (isset($icalevent['RRULE']) && is_array($icalevent['RRULE'])) //repeatable event
{
//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-1);
if ($icalevent['DTSTART;VALUE=DATE']) //fullday event
{
$datecurstart=dol_stringtotime($icalevent['DTSTART;VALUE=DATE'],1);
@ -694,10 +698,10 @@ if (count($listofextcals))
$until=empty($icalevent['RRULE']['UNTIL'])?0:dol_stringtotime($icalevent['RRULE']['UNTIL'],1);
$maxrepeat=empty($icalevent['RRULE']['COUNT'])?0:$icalevent['RRULE']['COUNT'];
if ($until && ($until+($datecurend-$datecurstart)) < $firstdaytoshow) continue; // We discard repeatable event that end before start date to show
if ($datecurstart > $lastdaytoshow) continue; // We discard repeatable event that start after end date to show
if ($datecurstart >= $lastdaytoshow) continue; // We discard repeatable event that start after end date to show
$numofevent=0;
while (($datecurstart <= $lastdaytoshow) && (empty($maxrepeat) || ($numofevent < $maxrepeat)))
while (($datecurstart < $lastdaytoshow) && (empty($maxrepeat) || ($numofevent < $maxrepeat)))
{
if ($datecurend >= $firstdaytoshow) // We add event
{
@ -829,7 +833,7 @@ if (count($listofextcals))
}
// Add event into $eventarray if date range are ok.
if ($event->date_end_in_calendar < $firstdaytoshow || $event->date_start_in_calendar > $lastdaytoshow)
if ($event->date_end_in_calendar < $firstdaytoshow || $event->date_start_in_calendar >= $lastdaytoshow)
{
//print 'x'.$datestart.'-'.$dateend;exit;
//print 'x'.$datestart.'-'.$dateend;exit;
@ -839,7 +843,7 @@ if (count($listofextcals))
else
{
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 - 1);
// Add an entry in actionarray for each day
$daycursor=$event->date_start_in_calendar;
@ -1069,7 +1073,7 @@ $db->close();
* @param int $year Year
* @param int $monthshown Current month shown in calendar view
* @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 $maxnbofchar Nb of characters to show for event line
* @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))
{
$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
$color=-1; $cssclass=''; $colorindex=-1;
if ((! empty($event->author->id) && $event->author->id == $user->id)
|| (! empty($event->usertodo->id) && $event->usertodo->id == $user->id)
|| (! empty($event->userdone->id) && $event->userdone->id == $user->id))
{
$nummytasks++; $cssclass='family_mytasks';
if (in_array($user->id, $keysofuserassigned))
{
$nummytasks++; $cssclass='family_mytasks';
// TODO Set a color using user color
// Must defined rule to choose color of who to use.
// event->usertodo->id will still contains user id of owner
// event->userstodo will be an array in future.
// event->ownerid will still contains user id of owner
// event->userassigned will be an array in future.
// $color=$user->color;
}
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.
{
// 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]))
{
$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
{
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 ($filtera?'&filtera='.$filtera:'').($filtert?'&filtert='.$filtert:'').($filterd?'&filterd='.$filterd:'');
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 (! $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;
// FIXME: We must filter on assignement table
if ($usergroup > 0) $sql.= " AND ugu.fk_user = a.fk_user_action";
if ($type) $sql.= " AND c.id = ".$type;
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 == '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)."'))"; }
// FIXME: We must filter on assignement table
if ($filtera > 0 || $filtert > 0 || $filterd > 0 || $usergroup > 0)
{
$sql.= " AND (";

View File

@ -96,7 +96,7 @@ if ($dateselect > 0)
$tmp=empty($conf->global->MAIN_DEFAULT_WORKING_HOURS)?'9-18':$conf->global->MAIN_DEFAULT_WORKING_HOURS;
$tmparray=explode('-',$tmp);
$begin_h = GETPOST('begin_h')?GETPOST('begin_h','int'):($tmparray[0] != '' ? $tmparray[0] : 9);
$begin_h = GETPOST('begin_h')!=''?GETPOST('begin_h','int'):($tmparray[0] != '' ? $tmparray[0] : 9);
$end_h = GETPOST('end_h')?GETPOST('end_h'):($tmparray[1] != '' ? $tmparray[1] : 18);
if ($begin_h < 0 || $begin_h > 23) $begin_h = 9;
if ($end_h < 1 || $end_h > 24) $end_h = 18;
@ -179,17 +179,11 @@ $next_year = $next['year'];
$next_month = $next['month'];
$next_day = $next['day'];
// Define firstdaytoshow and lastdaytoshow
$firstdaytoshow=dol_mktime(0,0,0,$first_month,$first_day,$first_year);
$lastdaytoshow=dol_time_plus_duree($firstdaytoshow, 6, 'd');
$max_day_in_month = date("t",dol_mktime(0,0,0,$month,1,$year));
$tmpday = $first_day;
//print 'xx'.$prev_year.'-'.$prev_month.'-'.$prev_day;
//print 'xx'.$next_year.'-'.$next_month.'-'.$next_day;
//print dol_print_date($firstdaytoshow,'day');
//print dol_print_date($lastdaytoshow,'day');
$title=$langs->trans("DoneAndToDoActions");
if ($status == 'done') $title=$langs->trans("DoneActions");
@ -225,9 +219,11 @@ $next_year = $next['year'];
$next_month = $next['month'];
$next_day = $next['day'];
// Define firstdaytoshow and lastdaytoshow
// Define firstdaytoshow and lastdaytoshow (warning: lastdaytoshow is last second to show + 1)
$firstdaytoshow=dol_mktime(0,0,0,$first_month,$first_day,$first_year);
$lastdaytoshow=dol_time_plus_duree($firstdaytoshow, 6, 'd');
$lastdaytoshow=dol_time_plus_duree($firstdaytoshow, 7, 'd');
//print dol_print_date($firstdaytoshow,'dayhour');
//print dol_print_date($lastdaytoshow,'dayhour');
$max_day_in_month = date("t",dol_mktime(0,0,0,$month,1,$year));
@ -335,6 +331,7 @@ if ($actioncode) $sql.=" AND ca.code='".$db->escape($actioncode)."'";
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 ($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 ($action == 'show_day')
{
@ -369,6 +366,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 == '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)."'))"; }
// FIXME: We must filter on assignement table
if ($filtera > 0 || $filtert > 0 || $filterd > 0 || $usergroup > 0)
{
$sql.= " AND (";
@ -398,13 +396,14 @@ if ($resql)
$event->datep=$db->jdate($obj->datep); // datep and datef are GMT date
$event->datef=$db->jdate($obj->datep2);
$event->type_code=$obj->code;
$event->libelle=$obj->label; // deprecated
//$event->libelle=$obj->label; // deprecated
$event->label=$obj->label;
$event->percentage=$obj->percent;
$event->author->id=$obj->fk_user_author; // user id of creator
$event->usertodo->id=$obj->fk_user_action; // user id of owner
$event->userdone->id=$obj->fk_user_done; // deprecated
// $event->userstodo=... with s after user, in future version, will be an array with all id of user assigned to event
//$event->author->id=$obj->fk_user_author; // user id of creator
$event->authorid=$obj->fk_user_author; // user id of creator
$event->userownerid=$obj->fk_user_action; // user id of owner
$event->fetch_userassigned(); // This load $event->userassigned
//$event->userdone->id=$obj->fk_user_done; // deprecated
$event->priority=$obj->priority;
$event->fulldayevent=$obj->fulldayevent;
$event->location=$obj->location;
@ -412,8 +411,8 @@ if ($resql)
$event->socid=$obj->fk_soc;
$event->contactid=$obj->fk_contact;
$event->societe->id=$obj->fk_soc;
$event->contact->id=$obj->fk_contact;
//$event->societe->id=$obj->fk_soc; // deprecated
//$event->contact->id=$obj->fk_contact; // deprecated
// 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.
@ -424,7 +423,7 @@ if ($resql)
else $event->date_end_in_calendar=$event->datep;
}
else
{
{
$event->date_start_in_calendar=$event->datep;
if ($event->datef != '' && $event->datef >= $event->datep) $event->date_end_in_calendar=$event->datef;
else $event->date_end_in_calendar=$event->datep;
@ -437,14 +436,14 @@ if ($resql)
// Check values
if ($event->date_end_in_calendar < $firstdaytoshow ||
$event->date_start_in_calendar > $lastdaytoshow)
$event->date_start_in_calendar >= $lastdaytoshow)
{
// This record is out of visible range
}
else
{
{
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 - 1);
// Add an entry in actionarray for each day
$daycursor=$event->date_start_in_calendar;
@ -456,7 +455,7 @@ if ($resql)
$loop=true; $j=0;
$daykey=dol_mktime(0,0,0,$mois,$jour,$annee);
do
{
{
//if ($event->id==408) print 'daykey='.$daykey.' '.$event->datep.' '.$event->datef.'<br>';
$eventarray[$daykey][]=$event;
@ -479,7 +478,6 @@ else
dol_print_error($db);
}
$maxnbofchar=18;
$cachethirdparties=array();
$cachecontacts=array();
@ -598,8 +596,12 @@ else
$usernames = $tmpgroup->listUsersForGroup();
}
// Load array of colors by type
// TODO
$colorsbytype=array();
// Loop on each user to show calendar
$todayarray=dol_getdate($now,'fast');
$sav = $tmpday;
$showheader = true;
foreach ($usernames as $username)
@ -608,6 +610,7 @@ foreach ($usernames as $username)
echo '<td class="cal_current_month">' . $username->getNomUrl(1). '</td>';
$tmpday = $sav;
// Lopp on each day of week
$i = 0;
for ($iter_day = 0; $iter_day < 7; $iter_day++)
{
@ -627,11 +630,10 @@ foreach ($usernames as $username)
$style='cal_current_month';
if ($iter_day == 6) $style.=' cal_other_month';
$today=0;
$todayarray=dol_getdate($now,'fast');
if ($todayarray['mday']==$tmpday && $todayarray['mon']==$month && $todayarray['year']==$year) $today=1;
if ($todayarray['mday']==$tmpday && $todayarray['mon']==$tmpmonth && $todayarray['year']==$tmpyear) $today=1;
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, $tmpmonth, $tmpyear, $monthshown, $style, $eventarray, 0, $maxnbofchar, $newparam, 1, 300, $showheader, $colorsbytype);
$i++;
}
@ -641,7 +643,6 @@ foreach ($usernames as $username)
echo "</table>\n";
// Add js code to manage click on a box
print '<script type="text/javascript" language="javascript">
jQuery(document).ready(function() {
@ -687,7 +688,7 @@ $db->close();
/**
* Show event of a particular day
* Show event of a particular day for a user
*
* @param string $username Login
* @param int $day Day
@ -695,7 +696,7 @@ $db->close();
* @param int $year Year
* @param int $monthshown Current month shown in calendar view
* @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 $maxnbofchar Nb of characters to show for event line
* @param string $newparam Parameters on current URL
@ -721,29 +722,34 @@ function show_day_events2($username, $day, $month, $year, $monthshown, $style, &
$i=0; $nummytasks=0; $numother=0; $numbirthday=0; $numical=0; $numicals=array();
$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, ...
//if ($username->id && $day==1) var_dump($eventarray);
// We are in a particular day for $username, now we scan all events
foreach ($eventarray as $daykey => $notused)
{
$annee = date('Y',$daykey);
$mois = date('m',$daykey);
$jour = date('d',$daykey);
if ($day==$jour && $month==$mois && $year==$annee)
//print $annee.'-'.$mois.'-'.$jour.' '.$year.'-'.$month.'-'.$day."<br>\n";
if ($day==$jour && $month==$mois && $year==$annee) // Is it the day we are looking for when calling function ?
{
//Tout les events à la même date :
// Scan all event for this date
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);
// Define $color and $cssclass of event
$color=-1; $cssclass=''; $colorindex=-1;
if ((! empty($event->author->id) && $event->author->id == $user->id)
|| (! empty($event->usertodo->id) && $event->usertodo->id == $user->id)
|| (! empty($event->userdone->id) && $event->userdone->id == $user->id))
if (in_array($user->id, $keysofuserassigned))
{
$nummytasks++; $cssclass='family_mytasks';
// TODO Set color according to event type
}
else if ($event->type_code == 'ICALEVENT')
{
@ -765,7 +771,7 @@ function show_day_events2($username, $day, $month, $year, $monthshown, $style, &
if ($color == -1) // Color was not forced. Set color according to color index.
{
// 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]))
{
$colorindex=$colorindexused[$idusertouse]; // Color already assigned to this user
@ -784,6 +790,7 @@ function show_day_events2($username, $day, $month, $year, $monthshown, $style, &
// Define all rects with event (cases1 is first half hour, cases2 is second half hour)
for ($h = $begin_h; $h < $end_h; $h++)
{
//if ($username->id == 1 && $day==1) print 'h='.$h;
$color = ''; //init
if (empty($event->fulldayevent))
{
@ -798,7 +805,15 @@ function show_day_events2($username, $day, $month, $year, $monthshown, $style, &
{
$busy=$event->transparency;
$cases1[$h][$event->id]['busy']=$busy;
$cases1[$h][$event->id]['string']=dol_print_date($event->date_start_in_calendar,'dayhour').' - '.dol_print_date($event->date_end_in_calendar,'dayhour').' - '.$event->label;
$cases1[$h][$event->id]['string']=dol_print_date($event->date_start_in_calendar,'dayhour');
if ($event->date_end_in_calendar && $event->date_end_in_calendar != $event->date_start_in_calendar)
{
$tmpa=dol_getdate($event->date_start_in_calendar,true);
$tmpb=dol_getdate($event->date_end_in_calendar,true);
if ($tmpa['mday'] == $tmpb['mday'] && $tmpa['mon'] == $tmpb['mon'] && $tmpa['year'] == $tmpb['year']) $cases1[$h][$event->id]['string'].='-'.dol_print_date($event->date_end_in_calendar,'hour');
else $cases1[$h][$event->id]['string'].='-'.dol_print_date($event->date_end_in_calendar,'dayhour');
}
$cases1[$h][$event->id]['string'].=' - '.$event->label;
$cases1[$h][$event->id]['typecode']=$event->type_code;
if ($event->socid)
{
@ -809,8 +824,16 @@ function show_day_events2($username, $day, $month, $year, $monthshown, $style, &
{
$busy=$event->transparency;
$cases2[$h][$event->id]['busy']=$busy;
$cases2[$h][$event->id]['string']=dol_print_date($event->date_start_in_calendar,'dayhour').' - '.dol_print_date($event->date_end_in_calendar,'dayhour').' - '.$event->label;
$cases1[$h][$event->id]['typecode']=$event->type_code;
$cases2[$h][$event->id]['string']=dol_print_date($event->date_start_in_calendar,'dayhour');
if ($event->date_end_in_calendar && $event->date_end_in_calendar != $event->date_start_in_calendar)
{
$tmpa=dol_getdate($event->date_start_in_calendar,true);
$tmpb=dol_getdate($event->date_end_in_calendar,true);
if ($tmpa['mday'] == $tmpb['mday'] && $tmpa['mon'] == $tmpb['mon'] && $tmpa['year'] == $tmpb['year']) $cases2[$h][$event->id]['string'].='-'.dol_print_date($event->date_end_in_calendar,'hour');
else $cases2[$h][$event->id]['string'].='-'.dol_print_date($event->date_end_in_calendar,'dayhour');
}
$cases2[$h][$event->id]['string'].=' - '.$event->label;
$cases2[$h][$event->id]['typecode']=$event->type_code;
if ($event->socid)
{
$cases2[$h][$event->id]['string'].='xxx';
@ -826,13 +849,13 @@ function show_day_events2($username, $day, $month, $year, $monthshown, $style, &
$cases2[$h][$event->id]['string']=$event->label;
$cases1[$h][$event->id]['typecode']=$event->type_code;
$cases2[$h][$event->id]['typecode']=$event->type_code;
break;
//break;
}
}
$i++;
}
break;
break; // We found the date we were looking for. No need to search anymore.
}
}

View File

@ -78,6 +78,7 @@ $object = new Societe($db);
$parameters = array('socid' => $id);
$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')

View File

@ -73,6 +73,7 @@ $hookmanager->initHooks(array('customerlist'));
$parameters=array();
$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 ?
if (GETPOST("button_removefilter_x"))
@ -269,7 +270,7 @@ if ($result)
print '<td align="center">'.$thirdpartystatic->getLibStatut(3);
print '</td>';
print '<td></td>';
$parameters=array('obj' => $obj);
$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();
$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
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);
$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

View File

@ -91,6 +91,7 @@ $hookmanager->initHooks(array('propallist'));
$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');
// Do we click on purge search criteria ?
if (GETPOST("button_removefilter_x"))

View File

@ -161,6 +161,7 @@ $hookmanager->initHooks(array('prospectlist'));
$parameters=array();
$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')
{

View File

@ -100,6 +100,7 @@ $permissionnote = $user->rights->commande->creer; // Used by the include of acti
$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 includ_once
@ -371,11 +372,11 @@ else if ($action == 'add' && $user->rights->commande->creer) {
// If some invoice's lines already known
$NBLINES = 8;
for($i = 1; $i <= $NBLINES; $i ++) {
if ($_POST ['idprod' . $i]) {
if ($_POST['idprod' . $i]) {
$xid = 'idprod' . $i;
$xqty = 'qty' . $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)) {
// Get extra fields
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);
}
unset($_POST ['prod_entry_mode']);
unset($_POST['prod_entry_mode']);
unset($_POST ['qty']);
unset($_POST ['type']);
unset($_POST ['remise_percent']);
unset($_POST ['price_ht']);
unset($_POST ['price_ttc']);
unset($_POST ['tva_tx']);
unset($_POST ['product_ref']);
unset($_POST ['product_label']);
unset($_POST ['product_desc']);
unset($_POST ['fournprice']);
unset($_POST ['buying_price']);
unset($_POST ['np_marginRate']);
unset($_POST ['np_markRate']);
unset($_POST ['dp_desc']);
unset($_POST ['idprod']);
unset($_POST['qty']);
unset($_POST['type']);
unset($_POST['remise_percent']);
unset($_POST['price_ht']);
unset($_POST['price_ttc']);
unset($_POST['tva_tx']);
unset($_POST['product_ref']);
unset($_POST['product_label']);
unset($_POST['product_desc']);
unset($_POST['fournprice']);
unset($_POST['buying_price']);
unset($_POST['np_marginRate']);
unset($_POST['np_markRate']);
unset($_POST['dp_desc']);
unset($_POST['idprod']);
unset($_POST['date_starthour']);
unset($_POST['date_startmin']);
@ -796,7 +797,7 @@ else if ($action == 'updateligne' && $user->rights->commande->creer && GETPOST('
// Unset extrafield POST Data
if (is_array($extralabelsline)) {
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);
}
unset($_POST ['qty']);
unset($_POST ['type']);
unset($_POST ['productid']);
unset($_POST ['remise_percent']);
unset($_POST ['price_ht']);
unset($_POST ['price_ttc']);
unset($_POST ['tva_tx']);
unset($_POST ['product_ref']);
unset($_POST ['product_label']);
unset($_POST ['product_desc']);
unset($_POST ['fournprice']);
unset($_POST ['buying_price']);
unset($_POST['qty']);
unset($_POST['type']);
unset($_POST['productid']);
unset($_POST['remise_percent']);
unset($_POST['price_ht']);
unset($_POST['price_ttc']);
unset($_POST['tva_tx']);
unset($_POST['product_ref']);
unset($_POST['product_label']);
unset($_POST['product_desc']);
unset($_POST['fournprice']);
unset($_POST['buying_price']);
} else {
setEventMessage($object->error, 'errors');
}
@ -1699,6 +1700,8 @@ if ($action == 'create' && $user->rights->commande->creer) {
$author = new User($db);
$author->fetch($object->user_author_id);
$res = $object->fetch_optionals($object->id, $extralabels);
$head = commande_prepare_head($object);
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)
$res = $object->fetch_optionals($object->id, $extralabels);
$parameters = array('colspan' => ' colspan="3"');
$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)) {
foreach ($extrafields->attribute_label as $key => $label) {
if ($action == 'edit_extras') {
$value = (isset($_POST ["options_" . $key]) ? $_POST ["options_" . $key] : $object->array_options ["options_" . $key]);
} else {
$value = $object->array_options ["options_" . $key];
$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))
{
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 ($extrafields->attribute_type [$key] == 'separate') {
else
{
$value = $object->array_options["options_" . $key];
}
if ($extrafields->attribute_type[$key] == 'separate')
{
print $extrafields->showSeparator($key);
} else {
}
else
{
print '<tr><td';
if (! empty($extrafields->attribute_required [$key]))
print ' class="fieldrequired"';
if (! empty($extrafields->attribute_required [$key])) print ' class="fieldrequired"';
print '>' . $label . '</td><td colspan="5">';
// Convert date into timestamp format
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]);
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]);
}
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 '<input type="hidden" name="action" value="update_extras">';
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 '</form>';
} else {
}
else
{
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>';

View File

@ -78,6 +78,7 @@ $hookmanager->initHooks(array('orderlist'));
$parameters=array('socid'=>$socid);
$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 ?
if (GETPOST("button_removefilter_x"))
@ -423,7 +424,7 @@ if ($resql)
print '</form>'."\n";
print '<br>'.img_help(1,'').' '.$langs->trans("ToBillSeveralOrderSelectCustomer", $langs->transnoentitiesnoconv("CreateInvoiceForThisCustomer")).'<br>';
$db->free($resql);
}
else

View File

@ -111,6 +111,7 @@ $permissionnote = $user->rights->facture->creer; // Used by the include of actio
$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 includ_once

View File

@ -108,6 +108,7 @@ $now=dol_now();
$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');
// Do we click on purge search criteria ?
if (GETPOST("button_removefilter_x"))

View File

@ -71,10 +71,13 @@ $hookmanager->initHooks(array('paiementcard'));
$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');
/*
* Actions
*/
if ($action == 'add_paiement' || ($action == 'confirm_paiement' && $confirm=='yes'))
{
$error = 0;

View File

@ -164,7 +164,7 @@ class BonPrelevement extends CommonObject
/**
* 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 string $client_nom name of cliente
* @param int $amount amount of invoice

View File

@ -94,7 +94,7 @@ abstract class ActionsContactCardCommon
/**
* Load data control
*
* @param string &$action Type of action
* @param string $action Type of action
* @param int $id Id of object
* @return void
*/
@ -228,7 +228,7 @@ abstract class ActionsContactCardCommon
/**
* 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
* @return string HTML output
*/

View File

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

View File

@ -83,7 +83,7 @@ $hookmanager->initHooks(array('contactcard'));
$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
$error=$hookmanager->error; $errors=array_merge($errors, (array) $hookmanager->errors);
if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
if (empty($reshook))
{
@ -142,10 +142,10 @@ if (empty($reshook))
{
setEventMessage($object->error,'errors');
}
else
else
{
header("Location: ".$_SERVER['PHP_SELF'].'?id='.$id);
exit;
exit;
}
}
@ -157,11 +157,11 @@ if (empty($reshook))
{
setEventMessage($object->error,'errors');
}
else
else
{
header("Location: ".$_SERVER['PHP_SELF'].'?id='.$id);
exit;
}
exit;
}
}
// Add contact
@ -380,7 +380,7 @@ else
$title = (! empty($conf->global->SOCIETE_ADDRESSES_MANAGEMENT) ? $langs->trans("Contacts") : $langs->trans("ContactsAddresses"));
dol_fiche_head($head, 'card', $title, 0, 'contact');
dol_htmloutput_events();
}
@ -1110,7 +1110,22 @@ else
if (! empty($conf->agenda->enabled))
{
print load_fiche_titre($langs->trans("TasksHistoryForThisContact"),'','');
$objthirdparty=$objsoc;
$objcon=$object;
$out='';
$permok=$user->rights->agenda->myactions->create;
if ((! empty($objthirdparty->id) || ! empty($objcon->id)) && $permok)
{
$out.='<a href="'.DOL_URL_ROOT.'/comm/action/card.php?action=create';
if (get_class($objthirdparty) == 'Societe') $out.='&amp;socid='.$objthirdparty->id;
$out.=(! empty($objcon->id)?'&amp;contactid='.$objcon->id:'').'&amp;backtopage=1&amp;percentage=-1">';
$out.=$langs->trans("AddAnAction").' ';
$out.=img_picto($langs->trans("AddAnAction"),'filenew');
$out.="</a>";
}
print load_fiche_titre($langs->trans("TasksHistoryForThisContact"),$out,'');
print show_actions_todo($conf,$langs,$db,$objsoc,$object);

View File

@ -1,7 +1,7 @@
<?php
/* Copyright (C) 2003-2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2012 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2012 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) 2010-2014 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2013 Christophe Battarel <christophe.battarel@altairis.fr>
@ -35,6 +35,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/contract.lib.php';
require_once DOL_DOCUMENT_ROOT.'/contrat/class/contrat.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/modules/contract/modules_contract.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
require_once DOL_DOCUMENT_ROOT . '/core/class/html.formfile.class.php';
if (! empty($conf->produit->enabled) || ! empty($conf->service->enabled)) require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
if (! empty($conf->propal->enabled)) require_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php';
if (! empty($conf->projet->enabled)) {
@ -70,6 +71,15 @@ $hookmanager->initHooks(array('contractcard'));
$object = new Contrat($db);
$extrafields = new ExtraFields($db);
// Load object
if ($id > 0 || ! empty($ref)) {
$ret = $object->fetch($id, $ref);
if ($ret > 0)
$ret = $object->fetch_thirdparty();
if ($ret < 0)
dol_print_error('', $object->error);
}
// fetch optionals attributes and labels
$extralabels = $extrafields->fetch_name_optionals_label($object->table_element);
@ -84,7 +94,6 @@ include DOL_DOCUMENT_ROOT.'/core/actions_setnotes.inc.php'; // Must be include,
if ($action == 'confirm_active' && $confirm == 'yes' && $user->rights->contrat->activer)
{
$object->fetch($id);
$result = $object->active_line($user, GETPOST('ligne'), GETPOST('date'), GETPOST('dateend'), GETPOST('comment'));
if ($result > 0)
@ -106,7 +115,6 @@ else if ($action == 'confirm_closeline' && $confirm == 'yes' && $user->rights->c
}
if (! $error)
{
$object->fetch($id);
$result = $object->close_line($user, GETPOST('ligne'), GETPOST('dateend'), urldecode(GETPOST('comment')));
if ($result > 0)
{
@ -363,7 +371,6 @@ if ($action == 'add' && $user->rights->contrat->creer)
else if ($action == 'classin' && $user->rights->contrat->creer)
{
$object->fetch($id);
$object->setProject(GETPOST('projectid'));
}
@ -402,14 +409,6 @@ else if ($action == 'addline' && $user->rights->contrat->creer)
if (! $error)
{
$ret=$object->fetch($id);
if ($ret < 0)
{
setEventMessage($object->error,'errors');
exit;
}
$ret=$object->fetch_thirdparty();
// Clean parameters
$date_start=dol_mktime(GETPOST('date_start'.$predef.'hour'), GETPOST('date_start'.$predef.'min'), GETPOST('date_start'.$predef.'sec'), GETPOST('date_start'.$predef.'month'), GETPOST('date_start'.$predef.'day'), GETPOST('date_start'.$predef.'year'));
$date_end=dol_mktime(GETPOST('date_end'.$predef.'hour'), GETPOST('date_end'.$predef.'min'), GETPOST('date_end'.$predef.'sec'), GETPOST('date_end'.$predef.'month'), GETPOST('date_end'.$predef.'day'), GETPOST('date_end'.$predef.'year'));
@ -584,14 +583,6 @@ else if ($action == 'addline' && $user->rights->contrat->creer)
else if ($action == 'updateligne' && $user->rights->contrat->creer && ! GETPOST('cancel'))
{
$ret=$object->fetch($id);
if ($ret < 0)
{
dol_print_error($db,$object->error);
exit;
}
$object->fetch_thirdparty();
$objectline = new ContratLigne($db);
if ($objectline->fetch(GETPOST('elrowid')))
{
@ -647,7 +638,6 @@ else if ($action == 'updateligne' && $user->rights->contrat->creer && ! GETPOST(
else if ($action == 'confirm_deleteline' && $confirm == 'yes' && $user->rights->contrat->creer)
{
$object->fetch($id);
$result = $object->deleteline(GETPOST('lineid'),$user);
if ($result >= 0)
@ -663,21 +653,17 @@ else if ($action == 'confirm_deleteline' && $confirm == 'yes' && $user->rights->
else if ($action == 'confirm_valid' && $confirm == 'yes' && $user->rights->contrat->creer)
{
$object->fetch($id);
$result = $object->validate($user);
}
// Close all lines
else if ($action == 'confirm_close' && $confirm == 'yes' && $user->rights->contrat->creer)
{
$object->fetch($id);
$result = $object->cloture($user);
}
else if ($action == 'confirm_delete' && $confirm == 'yes' && $user->rights->contrat->supprimer)
{
$object->fetch($id);
$object->fetch_thirdparty();
$result=$object->delete($user);
if ($result >= 0)
{
@ -714,7 +700,6 @@ else if ($action == 'confirm_move' && $confirm == 'yes' && $user->rights->contra
}
} else if ($action == 'update_extras') {
// Fill array 'array_options' with data from update form
$object->fetch($id);
$extralabels = $extrafields->fetch_name_optionals_label($object->table_element);
$ret = $extrafields->setOptionalsFromPost($extralabels, $object, GETPOST('attribute'));
if ($ret < 0)
@ -749,10 +734,6 @@ else if ($action == 'confirm_move' && $confirm == 'yes' && $user->rights->contra
exit;
}
} elseif ($action=='setref') {
$result = $object->fetch($id);
if ($result < 0) {
setEventMessage($object->errors,'errors');
}
$object->ref=GETPOST('ref','alpha');
$result = $object->update($user);
@ -765,17 +746,53 @@ else if ($action == 'confirm_move' && $confirm == 'yes' && $user->rights->contra
}
}
// Generation doc (depuis lien ou depuis cartouche doc)
else if ($action == 'builddoc' && $user->rights->contrat->creer) {
if (GETPOST('model')) {
$object->setDocModel($user, GETPOST('model'));
}
// Define output language
$outputlangs = $langs;
if (! empty($conf->global->MAIN_MULTILANGS)) {
$outputlangs = new Translate("", $conf);
$newlang = (GETPOST('lang_id') ? GETPOST('lang_id') : $object->thirdparty->default_lang);
$outputlangs->setDefaultLang($newlang);
}
$ret = $object->fetch($id); // Reload to get new records
$result = $object->generateDocument($object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref);
if ($result <= 0) {
dol_print_error($db, $result);
exit();
} else {
header('Location: ' . $_SERVER["PHP_SELF"] . '?id=' . $object->id . (empty($conf->global->MAIN_JUMP_TAG) ? '' : '#builddoc'));
exit();
}
}
// Remove file in doc form
else if ($action == 'remove_file' && $user->rights->contrat->creer) {
if ($object->id > 0) {
require_once DOL_DOCUMENT_ROOT . '/core/lib/files.lib.php';
$langs->load("other");
$upload_dir = $conf->contrat->dir_output;
$file = $upload_dir . '/' . GETPOST('file');
$ret = dol_delete_file($file, 0, 0, 0, $object);
if ($ret)
setEventMessage($langs->trans("FileWasRemoved", GETPOST('file')));
else
setEventMessage($langs->trans("ErrorFailToDeleteFile", GETPOST('file')), 'errors');
}
}
if (! empty($conf->global->MAIN_DISABLE_CONTACTS_TAB) && $user->rights->contrat->creer)
{
if ($action == 'addcontact')
{
$result = $object->fetch($id);
if ($result > 0 && $id > 0)
{
$contactid = (GETPOST('userid') ? GETPOST('userid') : GETPOST('contactid'));
$result = $object->add_contact($contactid, GETPOST('type'), GETPOST('source'));
}
$contactid = (GETPOST('userid') ? GETPOST('userid') : GETPOST('contactid'));
$result = $object->add_contact($contactid, GETPOST('type'), GETPOST('source'));
if ($result >= 0)
{
@ -799,20 +816,12 @@ if (! empty($conf->global->MAIN_DISABLE_CONTACTS_TAB) && $user->rights->contrat-
// bascule du statut d'un contact
else if ($action == 'swapstatut')
{
if ($object->fetch($id))
{
$result=$object->swapContactStatus(GETPOST('ligne'));
}
else
{
setEventMessage($object->error,'errors');
}
$result=$object->swapContactStatus(GETPOST('ligne'));
}
// Efface un contact
else if ($action == 'deletecontact')
{
$object->fetch($id);
$result = $object->delete_contact(GETPOST('lineid'));
if ($result >= 0)
@ -834,6 +843,7 @@ if (! empty($conf->global->MAIN_DISABLE_CONTACTS_TAB) && $user->rights->contrat-
llxHeader('',$langs->trans("ContractCard"),"Contrat");
$form = new Form($db);
$formfile = new FormFile($db);
$objectlignestatic=new ContratLigne($db);
@ -1032,14 +1042,10 @@ else
{
$now=dol_now();
if ($id > 0 || ! empty($ref))
if ($object->id > 0)
{
$result=$object->fetch($id,$ref);
if ($result < 0) dol_print_error($db,$object->error);
$result=$object->fetch_lines(); // This also init $this->nbofserviceswait, $this->nbofservicesopened, $this->nbofservicesexpired=, $this->nbofservicesclosed
if ($result < 0) dol_print_error($db,$object->error);
$result=$object->fetch_thirdparty();
if ($result < 0) dol_print_error($db,$object->error);
$nbofservices=count($object->lines);
@ -1793,16 +1799,29 @@ else
print "</div>";
}
print '<div class="fichecenter"><div class="fichehalfleft">';
print '<table width="100%"><tr><td width="50%" valign="top">';
/*
* Documents generes
*/
$filename = dol_sanitizeFileName($object->ref);
$filedir = $conf->contrat->dir_output . "/" . dol_sanitizeFileName($object->ref);
$urlsource = $_SERVER["PHP_SELF"] . "?id=" . $object->id;
$genallowed = $user->rights->contrat->creer;
$delallowed = $user->rights->contrat->supprimer;
$var = true;
$somethingshown = $formfile->show_documents('contract', $filename, $filedir, $urlsource, $genallowed, $delallowed, $object->modelpdf, 1, 0, 0, 28, 0, '', 0, '', $soc->default_lang);
/*
* Linked object block
*/
$somethingshown=$object->showLinkedObjectBlock();
print '</td><td valign="top" width="50%">';
print '</td></tr></table>';
print '</div><div class="fichehalfright"><div class="ficheaddleft">';
print '</div></div></div>';
}
}

View File

@ -744,7 +744,7 @@ class Contrat extends CommonObject
$this->id = $this->db->last_insert_id(MAIN_DB_PREFIX."contrat");
// Load object modContract
$module=(! empty($conf->global->CONTRACT_ADDON)?$conf->global->CONTRACT_ADDON:'mod_contract_olive');
if (substr($module, 0, 13) == 'mod_contract_' && substr($module, -3) == 'php')
@ -1866,6 +1866,40 @@ class Contrat extends CommonObject
$this->total_tva = $xnbp*19.6;
$this->total_ttc = $xnbp*119.6;
}
/**
* Create a document onto disk according to template module.
*
* @param string $modele Force model to use ('' to not force)
* @param Translate $outputlangs Object langs to use for output
* @param int $hidedetails Hide details of lines
* @param int $hidedesc Hide description
* @param int $hideref Hide ref
* @return int 0 if KO, 1 if OK
*/
public function generateDocument($modele, $outputlangs, $hidedetails=0, $hidedesc=0, $hideref=0)
{
global $conf,$user,$langs;
$langs->load("contracts");
// Positionne le modele sur le nom du modele a utiliser
if (! dol_strlen($modele))
{
if (! empty($conf->global->CONTRACT_ADDON_PDF))
{
$modele = $conf->global->CONTRACT_ADDON_PDF;
}
else
{
$modele = 'strato';
}
}
$modelpath = "core/modules/contract/doc/";
return $this->commonGenerateDocument($modelpath, $modele, $outputlangs, $hidedetails, $hidedesc, $hideref);
}
}

View File

@ -1,5 +1,5 @@
<?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
* 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');
$classname = 'Actions'.ucfirst($subelement);
$object = new $classname($db);
$ret = $object->$methodname();
$ret = $object->$methodname($fk_element);
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
*
* @param string &$action Action string
* @param string $action Action string
* @param int $id Object id (if ref not provided)
* @param string $ref Object ref (if id not provided)
* @return void
@ -181,7 +181,7 @@ class Canvas
/**
* Shared method for canvas to execute actions
*
* @param string &$action Action string
* @param string $action Action string
* @param int $id Object id
* @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

View File

@ -1040,7 +1040,7 @@ class ExtraFields
* Fill array_options property of object by extrafields value (using for data sent by forms)
*
* @param array $extralabels $array of extrafields
* @param object &$object Object
* @param object $object Object
* @param string $onlykey Only following key is filled
* @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 array $parameters Array of parameters
* @param Object &$object Object to use hooks on
* @param string &$action Action code on calling page ('create', 'edit', 'view', 'add', 'update', 'delete'...)
* @param Object $object Object to use hooks on
* @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.
* 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.

View File

@ -4,7 +4,7 @@
* Copyright (C) 2004 Benoit Mortier <benoit.mortier@opensides.be>
* Copyright (C) 2004 Sebastien Di Cintio <sdicintio@ressource-toi.org>
* 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 Marc Barilley/Ocebo <marc@ocebo.com>
* 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 $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 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
* @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;
@ -140,7 +140,7 @@ class Form
// When option to edit inline is activated
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
{
@ -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 $editvalue When in edit mode, use this value as $value instead of value
* @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
*/
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;
@ -334,7 +334,18 @@ class Form
$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($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') {
$out.= '<input id="textarea_'.$htmlname.'_rows" value="'.$rows.'" 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);
}
if (count($assignedtouser) && $action != 'view') $out.='<br>';
$numassignetouser=count($assignedtouser);
if ($numassignetouser && $action != 'view') $out.='<br>';
$i=0; $ownerid=0;
foreach($assignedtouser as $key => $value)
{
@ -1326,7 +1339,7 @@ class Form
$userstatic->fetch($value['id']);
$out.=$userstatic->getNomUrl(1);
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['transparency']?$langs->trans("Busy"):$langs->trans("NotBusy"));
$out.='<br>';
@ -1575,9 +1588,9 @@ class Form
/**
* constructProductListOption
*
* @param resultset &$objp Resultset of fetch
* @param string &$opt Option
* @param string &$optJson Option
* @param resultset $objp Resultset of fetch
* @param string $opt Option
* @param string $optJson Option
* @param int $price_level Price level
* @param string $selected Preselected value
* @return void
@ -2817,8 +2830,8 @@ class Form
}
else if ($input['type'] == 'select')
{
$more.='<tr><td valign="top" style="padding: 4px !important;">';
if (! empty($input['label'])) $more.=$input['label'].'</td><td valign="top" colspan="2" align="left" style="padding: 4px !important;">';
$more.='<tr><td valign="top">';
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.='</td></tr>'."\n";
}
@ -4289,7 +4302,7 @@ class Form
/**
* 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
* @return string HTML code to output barcode
*/

View File

@ -355,6 +355,15 @@ class FormFile
$modellist=ModelePDFFactures::liste_modeles($this->db);
}
}
elseif ($modulepart == 'contract')
{
if (is_array($genallowed)) $modellist=$genallowed;
else
{
include_once DOL_DOCUMENT_ROOT.'/core/modules/contract/modules_contract.php';
$modellist=ModelePDFContract::liste_modeles($this->db);
}
}
elseif ($modulepart == 'project')
{
if (is_array($genallowed)) $modellist=$genallowed;

View File

@ -462,7 +462,7 @@ class FormOther
/**
* 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 array $lines Array of task lines
* @param int $level Level

View File

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

View File

@ -222,7 +222,7 @@ class Link extends CommonObject
/**
* 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 int $objectid id of the associated object in dolibarr
* @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 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 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
*/
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 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 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
*/
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 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 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
*/
function menuLoad($mymainmenu, $myleftmenu, $type_user, $menu_handler, &$tabMenu)

View File

@ -258,7 +258,7 @@ class RssParser
if (!is_resource($xmlparser)) {
$this->error="ErrorFailedToCreateParser"; return -1;
}
xml_set_object($xmlparser, $this);
xml_set_element_handler($xmlparser, 'feed_start_element', 'feed_end_element');
xml_set_character_data_handler($xmlparser, 'feed_cdata');
@ -268,7 +268,7 @@ class RssParser
//var_dump($rss->_format);exit;
}
}
// If $rss loaded
if ($rss)
{
@ -452,7 +452,7 @@ class RssParser
*
* @param string $p Start
* @param string $element Tag
* @param array &$attrs Attributes of tags
* @param array $attrs Attributes of tags
* @return void
*/
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
*
* @param string &$str1 Str1
* @param string $str1 Str1
* @param string $str2 Str2
* @return string String cancatenated
*/

View File

@ -17,8 +17,8 @@
*/
/**
* \file htdocs/core/db/dolidb.class.php
* \brief Class file to manage Dolibarr database access
* \file htdocs/core/db/DoliDB.class.php
* \brief Class file to manage Dolibarr database access
*/
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>
//
// This program is free software; you can redistribute it and/or modify
@ -358,12 +358,19 @@ $(document).ready(function() {
var res = $.parseJSON(result);
if (res.error) {
$(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 {
var htmlname = $(obj).attr('id').substr(8);
var success = $( '#success_' + htmlname ).val();
if (success != undefined) {
$.jnotify(success, "ok");
var successmsg = $( '#successmsg_' + htmlname ).val();
if (successmsg != undefined) {
$.jnotify(successmsg, "ok");
}
$(obj).html(res.value);
$(obj).hide();

View File

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

View File

@ -914,22 +914,12 @@ function show_actions_todo($conf,$langs,$db,$object,$objcon='',$noprint=0)
if (get_class($object) == 'Societe') $out.='</a>';
$out.='</td>';
$out.='<td colspan="5" align="right">';
$permok=$user->rights->agenda->myactions->create;
if (($object->id || $objcon->id) && $permok)
{
$out.='<a href="'.DOL_URL_ROOT.'/comm/action/card.php?action=create';
if (get_class($object) == 'Societe') $out.='&amp;socid='.$object->id;
$out.=(! empty($objcon->id)?'&amp;contactid='.$objcon->id:'').'&amp;backtopage=1&amp;percentage=-1">';
$out.=$langs->trans("AddAnAction").' ';
$out.=img_picto($langs->trans("AddAnAction"),'filenew');
$out.="</a>";
}
$out.='</td>';
$out.='</tr>';
$sql = "SELECT a.id, a.label,";
$sql.= " a.datep as dp,";
$sql.= " a.datea as da,";
$sql.= " a.datep2 as dp2,";
$sql.= " a.percent,";
$sql.= " a.fk_user_author, a.fk_contact,";
$sql.= " a.fk_element, a.elementtype,";
@ -970,10 +960,20 @@ function show_actions_todo($conf,$langs,$db,$object,$objcon='',$noprint=0)
$obj = $db->fetch_object($result);
$datep=$db->jdate($obj->dp);
$datep2=$db->jdate($obj->dp2);
$out.="<tr ".$bc[$var].">";
$out.='<td width="120" align="left" class="nowrap">'.dol_print_date($datep,'dayhour')."</td>\n";
$out.='<td width="120" align="left" class="nowrap">';
$out.=dol_print_date($datep,'dayhour');
if ($datep2 && $datep2 != $datep)
{
$tmpa=dol_getdate($datep,true);
$tmpb=dol_getdate($datep2,true);
if ($tmpa['mday'] == $tmpb['mday'] && $tmpa['mon'] == $tmpb['mon'] && $tmpa['year'] == $tmpb['year']) $out.='-'.dol_print_date($datep2,'hour');
else $out.='-'.dol_print_date($datep2,'dayhour');
}
$out.="</td>\n";
// Picto warning
$out.='<td width="16">';
@ -1103,7 +1103,7 @@ function show_actions_done($conf,$langs,$db,$object,$objcon='',$noprint=0)
'type'=>'action',
'id'=>$obj->id,
'datestart'=>$db->jdate($obj->dp),
'date'=>$db->jdate($obj->dp2),
'dateend'=>$db->jdate($obj->dp2),
'note'=>$obj->label,
'percent'=>$obj->percent,
'acode'=>$obj->acode,
@ -1154,7 +1154,8 @@ function show_actions_done($conf,$langs,$db,$object,$objcon='',$noprint=0)
$histo[$numaction]=array(
'type'=>'mailing',
'id'=>$obj->id,
'date'=>$db->jdate($obj->da),
'datestart'=>$db->jdate($obj->da),
'dateend'=>$db->jdate($obj->da),
'note'=>$obj->note,
'percent'=>$obj->percentage,
'acode'=>$obj->acode,
@ -1197,16 +1198,6 @@ function show_actions_done($conf,$langs,$db,$object,$objcon='',$noprint=0)
if (get_class($object) == 'Societe') $out.='</a>';
$out.='</td>';
$out.='<td colspan="5" align="right">';
$permok=$user->rights->agenda->myactions->create;
if ((! empty($object->id) || ! empty($objcon->id)) && $permok)
{
$out.='<a href="'.DOL_URL_ROOT.'/comm/action/card.php?action=create';
if (get_class($object) == 'Societe') $out.='&amp;socid='.$object->id;
$out.=(! empty($objcon->id)?'&amp;contactid='.$objcon->id:'').'&amp;backtopage=1&amp;percentage=-1">';
$out.=$langs->trans("AddAnAction").' ';
$out.=img_picto($langs->trans("AddAnAction"),'filenew');
$out.="</a>";
}
$out.='</td>';
$out.='</tr>';
@ -1217,8 +1208,14 @@ function show_actions_done($conf,$langs,$db,$object,$objcon='',$noprint=0)
// Champ date
$out.='<td width="120" class="nowrap">';
if ($histo[$key]['date']) $out.=dol_print_date($histo[$key]['date'],'dayhour');
else if ($histo[$key]['datestart']) $out.=dol_print_date($histo[$key]['datestart'],'dayhour');
$out.=dol_print_date($histo[$key]['datestart'],'dayhour');
if ($histo[$key]['dateend'] && $histo[$key]['dateend'] != $histo[$key]['datestart'])
{
$tmpa=dol_getdate($histo[$key]['datestart'],true);
$tmpb=dol_getdate($histo[$key]['dateend'],true);
if ($tmpa['mday'] == $tmpb['mday'] && $tmpa['mon'] == $tmpb['mon'] && $tmpa['year'] == $tmpb['year']) $out.='-'.dol_print_date($histo[$key]['dateend'],'hour');
else $out.='-'.dol_print_date($histo[$key]['dateend'],'dayhour');
}
$out.="</td>\n";
// Picto
@ -1251,6 +1248,7 @@ function show_actions_done($conf,$langs,$db,$object,$objcon='',$noprint=0)
// Objet lie
// TODO uniformize
$out.='<td>';
//var_dump($histo[$key]['elementtype']);
if (isset($histo[$key]['elementtype']))
{
if ($histo[$key]['elementtype'] == 'propal' && ! empty($conf->propal->enabled))
@ -1259,13 +1257,13 @@ function show_actions_done($conf,$langs,$db,$object,$objcon='',$noprint=0)
$propalstatic->id=$histo[$key]['fk_element'];
$out.=$propalstatic->getNomUrl(1);
}
elseif ($histo[$key]['elementtype'] == 'commande' && ! empty($conf->commande->enabled))
elseif (($histo[$key]['elementtype'] == 'order' || $histo[$key]['elementtype'] == 'commande') && ! empty($conf->commande->enabled))
{
$orderstatic->ref=$langs->trans("Order");
$orderstatic->id=$histo[$key]['fk_element'];
$out.=$orderstatic->getNomUrl(1);
}
elseif ($histo[$key]['elementtype'] == 'facture' && ! empty($conf->facture->enabled))
elseif (($histo[$key]['elementtype'] == 'invoice' || $histo[$key]['elementtype'] == 'facture') && ! empty($conf->facture->enabled))
{
$facturestatic->ref=$langs->trans("Invoice");
$facturestatic->id=$histo[$key]['fk_element'];

View File

@ -43,7 +43,7 @@ function dol_basename($pathfile)
* @param string $types Can be "directories", "files", or "all"
* @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[] $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 $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
@ -1294,7 +1294,7 @@ function dol_uncompress($inputfile,$outputdir)
*
* @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[] $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
* @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
*
* @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 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)
@ -4344,7 +4344,7 @@ function dol_htmloutput_errors($mesgstring='', $mesgarray='', $keepembedded=0)
* or descending output and uses optionally natural case insensitive sorting (which
* 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 int $order Sort order
* @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 Translate $langs Object langs
* @param Object $object Object object
* @param array &$head Object head
* @param int &$h New position to fill
* @param array $head Object head
* @param int $h New position to fill
* @param string $type Value for object where objectvalue can be
* 'thirdparty' to add a tab in third party 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
*
* @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
* @return float Masse convertie
*/
@ -1143,7 +1143,7 @@ function weight_convert($weight,&$from_unit,$to_unit)
*
* @param DoliDB $db Handler database
* @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
* @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
*
* @param PDF &$pdf Object PDF
* @param PDF $pdf Object PDF
* @param Translate $outputlangs Object lang for output
* @param int $page_height Height of page
* @return void
@ -443,7 +443,7 @@ function pdf_pagehead(&$pdf,$outputlangs,$page_height)
/**
* Add a draft watermark on PDF files
*
* @param PDF &$pdf Object PDF
* @param PDF $pdf Object PDF
* @param Translate $outputlangs Object lang
* @param int $h Height 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
*
* @param PDF &$pdf Object PDF
* @param PDF $pdf Object PDF
* @param Translate $outputlangs Object lang
* @param int $curx X
* @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
*
* @param PDF &$pdf The PDF factory
* @param PDF $pdf The PDF factory
* @param Translate $outputlangs Object lang for output
* @param string $paramfreetext Constant name of free text
* @param Societe $fromcompany Object company
@ -859,7 +859,7 @@ function pdf_pagefoot(&$pdf,$outputlangs,$paramfreetext,$fromcompany,$marge_bass
/**
* Show linked objects for PDF generation
*
* @param PDF &$pdf Object PDF
* @param PDF $pdf Object PDF
* @param object $object Object
* @param Translate $outputlangs Object lang
* @param int $posx X
@ -897,7 +897,7 @@ function pdf_writeLinkedObjects(&$pdf,$object,$outputlangs,$posx,$posy,$w,$h,$al
/**
* Output line description into PDF
*
* @param PDF &$pdf PDF object
* @param PDF $pdf PDF object
* @param Object $object Object
* @param int $i Current line number
* @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
*
* @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 array &$lines Array of all tasks
* @param int &$level Level of task
* @param array $lines Array of all tasks
* @param int $level Level of task
* @param string $var Color
* @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 $addordertick Add a tick to move task
* @return void
@ -443,12 +443,12 @@ function projectLinesa(&$inc, $parent, &$lines, &$level, $var, $showproject, &$t
/**
* Output a task line
*
* @param string &$inc ?
* @param string $inc ?
* @param string $parent ?
* @param Object $lines ?
* @param int &$level ?
* @param string &$projectsrole ?
* @param string &$tasksrole ?
* @param int $level ?
* @param string $projectsrole ?
* @param string $tasksrole ?
* @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
* @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)
*
* @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 array &$lines Array of all tasks
* @param string &$taskrole Array of task filtered on a particular user
* @param array $lines Array of all tasks
* @param string $taskrole Array of task filtered on a particular user
* @return int 1 if there is
*/
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.
*
* @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 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)

View File

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

View File

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

View File

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

View File

@ -31,8 +31,8 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/menubase.class.php';
* @param DoliDB $db Database handler
* @param string $atarget Target
* @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 &$menu Object Menu to return back list of menu entries
* @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 int $noout Disable output (Initialise &$menu only).
* @return int 0
*/
@ -203,8 +203,8 @@ function print_end_menu_array_auguria()
* @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_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 Menu &$menu Object Menu to return back list of menu entries
* @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 int $noout Disable output (Initialise &$menu only).
* @param string $forcemainmenu 'x'=Force mainmenu to mainmenu='x'
* @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
*
* @param string $type_user 0=We need backoffice menu, 1=We need frontoffice menu
* @param array &$menuentry Array for menu entry
* @param array &$listofmodulesforexternal Array with list of modules allowed to external users
* @param array $menuentry Array for menu entry
* @param array $listofmodulesforexternal Array with list of modules allowed to external users
* @return int 0=Hide, 1=Show, 2=Show gray
*/
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
return 1;
}

View File

@ -32,8 +32,8 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/menubase.class.php';
* @param DoliDB $db Database handler
* @param string $atarget Target (Example: '' or '_top')
* @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 &$menu Object Menu to return back list of menu entries
* @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 int $noout Disable output (Initialise &$menu only).
* @return int 0
*/
@ -428,8 +428,8 @@ function print_end_menu_array()
* @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_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 Menu &$menu Object Menu to return back list of menu entries
* @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 int $noout Disable output (Initialise &$menu only).
* @param string $forcemainmenu 'x'=Force mainmenu to mainmenu='x'
* @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
*
* @param string $type_user 0=We need backoffice menu, 1=We need frontoffice menu
* @param array &$menuentry Array for menu entry
* @param array &$listofmodulesforexternal Array with list of modules allowed to external users
* @param array $menuentry Array for menu entry
* @param array $listofmodulesforexternal Array with list of modules allowed to external users
* @return int 0=Hide, 1=Show, 2=Show gray
*/
function dol_eldy_showmenu($type_user, &$menuentry, &$listofmodulesforexternal)

View File

@ -185,7 +185,7 @@ class CommActionRapport
/**
* Write content of pages
*
* @param PDF &$pdf Object pdf
* @param PDF $pdf Object pdf
* @param Translate $outputlangs Object langs
* @return int 1
*/
@ -299,7 +299,7 @@ class CommActionRapport
/**
* Show top header of page.
*
* @param PDF &$pdf Object PDF
* @param PDF $pdf Object PDF
* @param Translate $outputlangs Object lang for output
* @param int $pagenb Page nb
* @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
* \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
*
* @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 int $thirdparty_type 0 = customer/prospect , 1 = supplier
* @param string $type type of barcode (EAN, ISBN, ...)
@ -177,7 +177,7 @@ class mod_barcode_product_standard extends ModeleNumRefBarCode
global $conf;
//var_dump($code.' '.$product->ref.' '.$thirdparty_type);exit;
require_once DOL_DOCUMENT_ROOT .'/core/lib/functions2.lib.php';
$result=0;
@ -282,7 +282,7 @@ class mod_barcode_product_standard extends ModeleNumRefBarCode
{
$newcodefortest=substr($newcodefortest,0,12);
}
$result=check_value($mask,$newcodefortest);
return $result;

View File

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

View File

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

View File

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

View File

@ -380,7 +380,7 @@ class pdf_strato extends ModelePDFContract
/**
* 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_height Height of table (rectangle)
* @param int $nexY Y
@ -446,7 +446,7 @@ class pdf_strato extends ModelePDFContract
/**
* Show top header of page.
*
* @param PDF &$pdf Object PDF
* @param PDF $pdf Object PDF
* @param Object $object Object to show
* @param int $showaddress 0=no, 1=yes
* @param Translate $outputlangs Object lang for output
@ -625,7 +625,7 @@ class pdf_strato extends ModelePDFContract
/**
* Show footer of page. Need this->emetteur object
*
* @param PDF &$pdf PDF
* @param PDF $pdf PDF
* @param Object $object Object to show
* @param Translate $outputlangs Object lang for output
* @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
/**
/**
* Return description of module
*
* @return string Description of module
@ -51,7 +51,7 @@ class mod_contract_olive extends ModelNumRefContracts
function info()
{
global $langs;
$langs->load("companies");
return $langs->trans("LeopardNumRefModelDesc");
}
@ -74,7 +74,7 @@ class mod_contract_olive extends ModelNumRefContracts
* Check validity of code according to its rules
*
* @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 int $type 0 = product , 1 = service
* @return int 0 if OK

View File

@ -73,7 +73,7 @@ class pdf_merou extends ModelePdfExpedition
/**
* 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 string $srctemplatepath Full path of source filename for generator using a template file
* @param int $hidedetails Do not show line details
@ -376,7 +376,7 @@ class pdf_merou extends ModelePdfExpedition
/**
* 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_height Height of table (rectangle)
* @param int $nexY Y
@ -417,7 +417,7 @@ class pdf_merou extends ModelePdfExpedition
/**
* Show footer of page. Need this->emetteur object
*
* @param PDF &$pdf PDF
* @param PDF $pdf PDF
* @param Object $object Object to show
* @param Translate $outputlangs Object lang for output
* @param int $hidefreetext 1=Hide free text
@ -446,7 +446,7 @@ class pdf_merou extends ModelePdfExpedition
/**
* Show top header of page.
*
* @param PDF &$pdf Object PDF
* @param PDF $pdf Object PDF
* @param Object $object Object to show
* @param int $showaddress 0=no, 1=yes
* @param Translate $outputlangs Object lang for output

View File

@ -76,7 +76,7 @@ class pdf_rouget extends ModelePdfExpedition
/**
* 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 string $srctemplatepath Full path of source filename for generator using a template file
* @param int $hidedetails Do not show line details
@ -377,7 +377,7 @@ class pdf_rouget extends ModelePdfExpedition
/**
* 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_height Height of table (rectangle)
* @param int $nexY Y
@ -432,7 +432,7 @@ class pdf_rouget extends ModelePdfExpedition
/**
* Show top header of page.
*
* @param PDF &$pdf Object PDF
* @param PDF $pdf Object PDF
* @param Object $object Object to show
* @param int $showaddress 0=no, 1=yes
* @param Translate $outputlangs Object lang for output
@ -672,7 +672,7 @@ class pdf_rouget extends ModelePdfExpedition
/**
* Show footer of page. Need this->emetteur object
*
* @param PDF &$pdf PDF
* @param PDF $pdf PDF
* @param Object $object Object to show
* @param Translate $outputlangs Object lang for output
* @param int $hidefreetext 1=Hide free text

View File

@ -190,6 +190,14 @@ class ExportExcel extends ModeleExports
return -1;
}
}
if (!empty($conf->global->MAIN_USE_FILECACHE_EXPORT_EXCEL_DIR)) {
$cacheMethod = PHPExcel_CachedObjectStorageFactory::cache_to_discISAM;
$cacheSettings = array (
'dir' => $conf->global->MAIN_USE_FILECACHE_EXPORT_EXCEL_DIR
);
PHPExcel_Settings::setCacheStorageMethod($cacheMethod, $cacheSettings);
}
$this->workbook = new PHPExcel();
$this->workbook->getProperties()->setCreator($user->getFullName($outputlangs).' - Dolibarr '.DOL_VERSION);

View File

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

View File

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

View File

@ -1,6 +1,6 @@
<?php
/* 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) 2008 Chiptronik
* 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
* \brief File of class to manage receving receipts with template Typhon
* \author Laurent Destailleur
@ -97,10 +97,10 @@ class pdf_typhon extends ModelePDFDeliveryOrder
// Define position of columns
$this->posxdesc=$this->marge_gauche+1;
$this->posxcomm=900;
$this->posxcomm=112;
//$this->posxtva=112;
//$this->posxup=126;
$this->posxqty=140;
$this->posxqty=174;
$this->posxremainingqty=165;
//$this->posxdiscount=162;
//$this->postotalht=174;
@ -558,7 +558,7 @@ class pdf_typhon extends ModelePDFDeliveryOrder
/**
* Show miscellaneous information (payment mode, payment term, ...)
*
* @param PDF &$pdf Object PDF
* @param PDF $pdf Object PDF
* @param Object $object Object to show
* @param int $posy Y
* @param Translate $outputlangs Langs object
@ -585,7 +585,7 @@ class pdf_typhon extends ModelePDFDeliveryOrder
/**
* 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_height Height of table (rectangle)
* @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);
if (empty($hidetop)) {
$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
$pdf->line($this->posxremainingqty, $tab_top, $this->posxremainingqty, $tab_top + $tab_height);
if (empty($hidetop)) {
$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.
*
* @param PDF &$pdf Object PDF
* @param PDF $pdf Object PDF
* @param Object $object Object to show
* @param int $showaddress 0=no, 1=yes
* @param Translate $outputlangs Object lang for output
@ -866,7 +866,7 @@ class pdf_typhon extends ModelePDFDeliveryOrder
/**
* Show footer of page. Need this->emetteur object
*
* @param PDF &$pdf PDF
* @param PDF $pdf PDF
* @param Object $object Object to show
* @param Translate $outputlangs Object lang for output
* @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
* Cela modiera aussi l'espace entre chaque ligne
*
* @param PDF &$pdf PDF
* @param PDF $pdf PDF
* @param int $pt point
* @return void
*/
@ -118,7 +118,7 @@ class pdf_standard
* - %LOGO% is replace with company logo
* - %PHOTO% is replace with photo provided as parameter
*
* @param PDF &$pdf PDF
* @param PDF $pdf PDF
* @param string $textleft Text left
* @param string $header Header
* @param string $footer Footer
@ -300,7 +300,7 @@ class pdf_standard
/**
* Print dot line
*
* @param PDF &$pdf PDF
* @param PDF $pdf PDF
* @param int $x1 X1
* @param int $y1 Y1
* @param int $x2 X2
@ -341,7 +341,7 @@ class pdf_standard
/**
* Fonction realisant une croix aux 4 coins des cartes
*
* @param PDF &$pdf PDF
* @param PDF $pdf PDF
* @param int $x1 X1
* @param int $y1 Y1
* @param int $x2 X2
@ -412,7 +412,7 @@ class pdf_standard
/**
* Set format
*
* @param PDF &$pdf PDF
* @param PDF $pdf PDF
* @param string $format Format
* @return void
*/

View File

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

View File

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

View File

@ -220,7 +220,7 @@ class mod_codeproduct_elephant extends ModeleProductCode
* Check validity of code according to its rules
*
* @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 int $type 0 = customer/prospect , 1 = supplier
* @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
*
* @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 int $type 0 = product , 1 = service
* @return int 0 if OK

View File

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

View File

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

View File

@ -260,7 +260,7 @@ class pdf_paiement
/**
* Show top header of page.
*
* @param PDF &$pdf Object PDF
* @param PDF $pdf Object PDF
* @param int $page Object to show
* @param int $showaddress 0=no, 1=yes
* @param Translate $outputlangs Object lang for output
@ -319,7 +319,7 @@ class pdf_paiement
/**
* Output body
*
* @param PDF &$pdf PDF object
* @param PDF $pdf PDF object
* @param string $page Page
* @param array $lines Array of lines
* @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
*
* @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 int $type 0 = customer/prospect , 1 = supplier
* @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
*
* @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 int $type 0 = customer/prospect , 1 = supplier
* @return int 0 if OK

View File

@ -140,7 +140,7 @@ class mod_codeclient_monkey extends ModeleThirdPartyCode
$date = dol_now();
$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
else $num = sprintf("%04s",$max+1);
@ -153,7 +153,7 @@ class mod_codeclient_monkey extends ModeleThirdPartyCode
* Check validity of code according to its rules
*
* @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 int $type 0 = customer/prospect , 1 = supplier
* @return int 0 if OK

View File

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

View File

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

View File

@ -88,6 +88,7 @@ $hookmanager->initHooks(array('expeditioncard'));
*/
$parameters=array();
$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')
{

View File

@ -4,6 +4,7 @@
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2011-2013 Juanjo Menent <jmenent@2byte.es>
* 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
* 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');
$originid=(GETPOST('originid','int')?GETPOST('originid','int'):GETPOST('origin_id','int')); // For backward compatibility
$note_public = GETPOST('note_public');
$lineid = GETPOST('line_id','int');
//PDF
$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
*/
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)
{
@ -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"))
{
$objectline = new FichinterLigne($db);
if ($objectline->fetch(GETPOST('line_id','int')) <= 0)
if ($objectline->fetch($lineid) <= 0)
{
dol_print_error($db);
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)
{
$objectline = new FichinterLigne($db);
if ($objectline->fetch(GETPOST('line_id','int')) <= 0)
if ($objectline->fetch($lineid) <= 0)
{
dol_print_error($db);
exit;
@ -626,7 +632,7 @@ else if ($action == 'confirm_deleteline' && $confirm == 'yes' && $user->rights->
else if ($action == 'up' && $user->rights->ficheinter->creer)
{
$object->line_up(GETPOST('line_id','int'));
$object->line_up($lineid);
// Define output language
$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);
header('Location: '.$_SERVER["PHP_SELF"].'?id='.$object->id.'#'.GETPOST('line_id','int'));
header('Location: '.$_SERVER["PHP_SELF"].'?id='.$object->id.'#'.$lineid);
exit;
}
else if ($action == 'down' && $user->rights->ficheinter->creer)
{
$object->line_down(GETPOST('line_id','int'));
$object->line_down($lineid);
// Define output language
$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);
header('Location: '.$_SERVER["PHP_SELF"].'?id='.$object->id.'#'.GETPOST('line_id','int'));
header('Location: '.$_SERVER["PHP_SELF"].'?id='.$object->id.'#'.$lineid);
exit;
}
@ -1157,11 +1163,12 @@ else if ($id > 0 || ! empty($ref))
dol_fiche_head($head, 'card', $langs->trans("InterventionCard"), 0, 'intervention');
$formconfirm='';
// Confirmation de la suppression de la fiche d'intervention
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
@ -1184,29 +1191,34 @@ else if ($id > 0 || ! empty($ref))
}
$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
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
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 '<input type="hidden" name="id" value="'.$object->id.'">';
if ($action == 'edit_extras') print '<input type="hidden" name="action" value="update_extras">';
if ($action == 'contrat') print '<input type="hidden" name="action" value="setcontrat">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
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>';
// 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 '</td></tr>';
// 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))
{
// Duration
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>';
}
@ -1316,7 +1328,7 @@ else if ($id > 0 || ! empty($ref))
}
// 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)
$parameters=array('colspan' => ' colspan="3"');

View File

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

View File

@ -57,6 +57,7 @@ $hookmanager->initHooks(array('suppliercard'));
$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');
if ($action == 'setsupplieraccountancycode')
{

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