'.$langs->trans("TotalSizeOfAttachedFiles").' ';
@@ -321,12 +368,12 @@ if ($action != 'edit' && $action != 'delete')
if ($user->rights->ecm->setup)
{
- print ''.$langs->trans('Edit').' ';
+ print ''.$langs->trans('Edit').' ';
}
if ($user->rights->ecm->setup)
{
- print ''.$langs->trans('ECMAddSection').' ';
+ print ''.$langs->trans('ECMAddSection').' ';
}
else
{
@@ -337,7 +384,7 @@ if ($action != 'edit' && $action != 'delete')
{
if ($user->rights->ecm->setup)
{
- print ''.$langs->trans('Delete').' ';
+ print ''.$langs->trans('Delete').' ';
}
else
{
@@ -354,25 +401,24 @@ if ($action != 'edit' && $action != 'delete')
// Confirm remove file
if ($action == 'delete')
{
- print $form->formconfirm($_SERVER["PHP_SELF"].'?section='.$_REQUEST["section"].'&urlfile='.urlencode($_GET["urlfile"]), $langs->trans('DeleteFile'), $langs->trans('ConfirmDeleteFile'), 'confirm_deletefile');
-
+ print $form->formconfirm($_SERVER["PHP_SELF"].'?section='.GETPOST("section",'alpha').'&urlfile='.urlencode($_GET["urlfile"]), $langs->trans('DeleteFile'), $langs->trans('ConfirmDeleteFile'), 'confirm_deletefile');
}
// Confirm remove file
if ($action == 'delete_dir')
{
$relativepathwithoutslash=preg_replace('/[\/]$/','',$relativepath);
- print $form->formconfirm($_SERVER["PHP_SELF"].'?section='.$_REQUEST["section"], $langs->trans('DeleteSection'), $langs->trans('ConfirmDeleteSection',$relativepathwithoutslash), 'confirm_deletedir', '', 1, 1);
-
+ print $form->formconfirm($_SERVER["PHP_SELF"].'?section='.GETPOST('section','alpha').($module?'&module='.$module:''), $langs->trans('DeleteSection'), $langs->trans('ConfirmDeleteSection',$relativepathwithoutslash), 'confirm_deletedir', '', 1, 1);
}
-$formfile=new FormFile($db);
/*
+$formfile=new FormFile($db);
+
// Display upload form
if ($user->rights->ecm->upload)
{
- $formfile->form_attach_new_file(DOL_URL_ROOT.'/ecm/docmine.php','',0,$section);
+ $formfile->form_attach_new_file(DOL_URL_ROOT.'/ecm/dir_card.php','',0,$section);
}
// List of document
diff --git a/htdocs/ecm/docother.php b/htdocs/ecm/docother.php
deleted file mode 100644
index addf559e01c..00000000000
--- a/htdocs/ecm/docother.php
+++ /dev/null
@@ -1,171 +0,0 @@
-
- */
-
-/**
- * \file htdocs/ecm/docother.php
- * \ingroup ecm
- * \brief Main ecm page
- * \author Laurent Destailleur
- */
-
-require '../main.inc.php';
-require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php';
-require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
-
-// Load traductions files
-$langs->load("ecm");
-$langs->load("companies");
-$langs->load("other");
-
-// Get parameters
-$socid = GETPOST("socid","int");
-
-// Security check
-if ($user->societe_id > 0)
-{
- $action = '';
- $socid = $user->societe_id;
-}
-
-$section=$_GET["section"];
-if (! $section) $section='misc';
-$upload_dir = $conf->ecm->dir_output.'/'.$section;
-
-
-
-/*******************************************************************
- * ACTIONS
- *
- * Put here all code to do according to value of "action" parameter
- ********************************************************************/
-
-// Envoie fichier
-if ( $_POST["sendit"] && ! empty($conf->global->MAIN_UPLOAD_DOC))
-{
- if (dol_mkdir($upload_dir) >= 0)
- {
- $resupload = dol_move_uploaded_file($_FILES['userfile']['tmp_name'], $upload_dir . "/" . dol_unescapefile($_FILES['userfile']['name']),0,0,$_FILES['userfile']['error']);
- if (is_numeric($resupload) && $resupload > 0)
- {
- $result=$ecmdir->changeNbOfFiles('+');
- }
- else
- {
- $langs->load("errors");
- if ($resupload < 0) // Unknown error
- {
- setEventMessages($langs->trans("ErrorFileNotUploaded"), null, 'errors');
- }
- else if (preg_match('/ErrorFileIsInfectedWithAVirus/',$resupload)) // Files infected by a virus
- {
- setEventMessages($langs->trans("ErrorFileIsInfectedWithAVirus"), null, 'errors');
- }
- else // Known error
- {
- setEventMessages($langs->trans($resupload), null, 'errors');
- }
- }
- }
- else
- {
- // Echec transfert (fichier depassant la limite ?)
- $langs->load("errors");
- $mesg = ''.$langs->trans("ErrorFailToCreateDir",$upload_dir).'
';
- }
-}
-
-// Suppression fichier
-if ($_POST['action'] == 'confirm_deletefile' && $_POST['confirm'] == 'yes')
-{
- $langs->load("other");
- $file = $upload_dir . "/" . GETPOST('urlfile'); // Do not use urldecode here ($_GET and $_REQUEST are already decoded by PHP).
- $ret=dol_delete_file($file);
- if ($ret) setEventMessages($langs->trans("FileWasRemoved", GETPOST('urlfile')), null, 'mesgs');
- else setEventMessages($langs->trans("ErrorFailToDeleteFile", GETPOST('urlfile')), null, 'errors');
-}
-
-
-
-
-
-/*******************************************************************
- * PAGE
- *
- * Put here all code to do according to value of "action" parameter
- ********************************************************************/
-
-llxHeader();
-
-$form=new Form($db);
-
-print load_fiche_titre($langs->trans("ECMAutoOrg"));
-
-//$head = societe_prepare_head($societe);
-
-
-
-/*
- * Confirmation of deleting a product line
- */
-if ($_GET['action'] == 'delete_file')
-{
- print $form->formconfirm($_SERVER["PHP_SELF"].'?socid='.$socid.'&urlfile='.urldecode($_GET["urlfile"]), $langs->trans('DeleteFile'), $langs->trans('ConfirmDeleteFile'), 'confirm_deletefile');
-
-}
-
-// Construct files list
-clearstatcache();
-$totalsize=0;
-$filearray=array();
-$errorlevel=error_reporting();
-error_reporting(0);
-$handle=opendir($upload_dir);
-error_reporting($errorlevel);
-if (is_resource($handle))
-{
- $i=0;
- while (($file = readdir($handle))!==false)
- {
- if (!is_dir($dir.$file) && substr($file, 0, 1) <> '.' && substr($file, 0, 3) <> 'CVS')
- {
- $filearray[$i]->name=$file;
- $filearray[$i]->size=dol_filesize($upload_dir."/".$file);
- $filearray[$i]->date=dol_filemtime($upload_dir."/".$file);
- $totalsize+=$filearray[$i]->size;
- $i++;
- }
- }
- closedir($handle);
-}
-else
-{
- // print ''.$langs->trans("ErrorCanNotReadDir",$upload_dir).'
';
-}
-
-
-/*
-
-print '';
-
-// Nbre fichiers
-print ''.$langs->trans("NbOfAttachedFiles").' '.count($filearray).' ';
-
-//Total taille
-print ''.$langs->trans("TotalSizeOfAttachedFiles").' '.$totalsize.' '.$langs->trans("bytes").' ';
-
-print '
';
-
-print '';
-
-*/
-
-
-if ($mesg) { print $mesg." "; }
-
-
-print $langs->trans("FeatureNotYetAvailable");
-
-// End of page
-llxFooter();
-$db->close();
diff --git a/htdocs/ecm/docfile.php b/htdocs/ecm/file_card.php
similarity index 90%
rename from htdocs/ecm/docfile.php
rename to htdocs/ecm/file_card.php
index 5a14b95291f..8c62cbe18f2 100644
--- a/htdocs/ecm/docfile.php
+++ b/htdocs/ecm/file_card.php
@@ -16,7 +16,7 @@
*/
/**
- * \file htdocs/ecm/docfile.php
+ * \file htdocs/ecm/file_card.php
* \ingroup ecm
* \brief Card of a file for ECM module
*/
@@ -123,7 +123,7 @@ if ($cancel)
}
else
{
- header("Location: ".DOL_URL_ROOT.'/ecm/docfile.php?urlfile='.urlencode($urlfile).'§ion='.urlencode($section));
+ header('Location: '.$_SERVER["PHP_SELF"].'?urlfile='.urlencode($urlfile).'§ion='.urlencode($section).($module?'&module='.urlencode($module):''));
exit;
}
}
@@ -216,7 +216,7 @@ if ($action == 'update')
$db->commit();
$urlfile=$newlabel;
- header("Location: ".DOL_URL_ROOT.'/ecm/docfile.php?urlfile='.urlencode($urlfile).'§ion='.urlencode($section));
+ header('Location: '.$_SERVER["PHP_SELF"].'?urlfile='.urlencode($urlfile).'§ion='.urlencode($section));
exit;
}
else
@@ -242,7 +242,8 @@ if ($action == 'edit')
print '';
@@ -1282,7 +1371,7 @@ elseif (! empty($module))
foreach ($langfiles as $langfile)
{
$pathtofile = $modulelowercase.'/langs/'.$langfile['relativename'];
- print ' '.$langs->trans("LanguageFile").' '.basename(dirname($pathtofile)).' : '.$pathtofile.' ';
+ print ' '.$langs->trans("LanguageFile").' '.basename(dirname($pathtofile)).' : '.$pathtofile.' ';
print ' '.img_picto($langs->trans("Edit"), 'edit').' ';
print ' ';
}
@@ -1379,7 +1468,7 @@ elseif (! empty($module))
print $langs->trans("EnterNameOfObjectDesc").' ';
- print ' ';
+ print ' ';
print ' ';
print '';
}
@@ -1443,37 +1532,38 @@ elseif (! empty($module))
$realpathtopicto = dol_buildpath($pathtopicto, 0, 1);
print '';
- print '
'.$langs->trans("ClassFile").' :
'.($realpathtoclass?'':'').$pathtoclass.($realpathtoclass?'':' ').' ';
+ print '
'.$langs->trans("ClassFile").' :
'.($realpathtoclass?'':'').$pathtoclass.($realpathtoclass?'':' ').' ';
print '
'.img_picto($langs->trans("Edit"), 'edit').' ';
print '
';
- print '
'.$langs->trans("ApiClassFile").' :
'.($realpathtoapi?'':'').$pathtoapi.($realpathtoapi?'':' ').' ';
+ print '
'.$langs->trans("ApiClassFile").' :
'.($realpathtoapi?'':'').$pathtoapi.($realpathtoapi?'':' ').' ';
print '
'.img_picto($langs->trans("Edit"), 'edit').' ';
print '
'.$langs->trans("GoToApiExplorer").' ';
print '
';
- print '
'.$langs->trans("TestClassFile").' :
'.($realpathtophpunit?'':'').$pathtophpunit.($realpathtophpunit?'':' ').' ';
+ print '
'.$langs->trans("TestClassFile").' :
'.($realpathtophpunit?'':'').$pathtophpunit.($realpathtophpunit?'':' ').' ';
print '
'.img_picto($langs->trans("Edit"), 'edit').' ';
print '
';
print '
';
- print '
'.$langs->trans("PageForLib").' :
'.($realpathtolib?'':'').$pathtolib.($realpathtodocument?'':' ').' ';
+ print '
'.$langs->trans("PageForLib").' :
'.($realpathtolib?'':'').$pathtolib.($realpathtodocument?'':' ').' ';
print '
'.img_picto($langs->trans("Edit"), 'edit').' ';
print '
';
- print '
'.$langs->trans("PageForPicto").' :
'.($realpathtopicto?'':'').$pathtopicto.($realpathtopicto?'':' ').' ';
+ print '
'.$langs->trans("Image").' :
'.($realpathtopicto?'':'').$pathtopicto.($realpathtopicto?'':' ').' ';
//print '
'.img_picto($langs->trans("Edit"), 'edit').' ';
print '
';
print '
';
- print '
'.$langs->trans("SqlFile").' :
'.($realpathtosql?'':'').$pathtosql.($realpathtosql?'':' ').' ';
+ print '
'.$langs->trans("SqlFile").' :
'.($realpathtosql?'':'').$pathtosql.($realpathtosql?'':' ').' ';
print '
'.img_picto($langs->trans("Edit"), 'edit').' ';
- print '
'.$langs->trans("DropTableIfEmpty").' ';
+ print '
'.$langs->trans("DropTableIfEmpty").' ';
//print '
'.$langs->trans("RunSql").' ';
print '
';
- print '
'.$langs->trans("SqlFileExtraFields").' :
'.($realpathtosqlextra?'':'').$pathtosqlextra.($realpathtosqlextra?'':' ').' ';
+ print '
'.$langs->trans("SqlFileExtraFields").' :
'.($realpathtosqlextra?'':'').$pathtosqlextra.($realpathtosqlextra?'':' ').' ';
print '
'.img_picto($langs->trans("Edit"), 'edit').' ';
+ print '
'.$langs->trans("DropTableIfEmpty").' ';
//print '
'.$langs->trans("RunSql").' ';
print '
';
- print '
'.$langs->trans("SqlFileKey").' :
'.($realpathtosqlkey?'':'').$pathtosqlkey.($realpathtosqlkey?'':' ').' ';
+ print '
'.$langs->trans("SqlFileKey").' :
'.($realpathtosqlkey?'':'').$pathtosqlkey.($realpathtosqlkey?'':' ').' ';
print '
'.img_picto($langs->trans("Edit"), 'edit').' ';
//print '
'.$langs->trans("RunSql").' ';
print '
';
@@ -1485,19 +1575,19 @@ elseif (! empty($module))
$urlofcard = dol_buildpath($pathtocard, 1);
print '
';
- print '
'.$langs->trans("PageForList").' :
'.($realpathtosql?'':'').$pathtolist.($realpathtosql?'':' ').' ';
+ print '
'.$langs->trans("PageForList").' :
'.($realpathtosql?'':'').$pathtolist.($realpathtosql?'':' ').' ';
print '
'.img_picto($langs->trans("Edit"), 'edit').' ';
print '
';
- print '
'.$langs->trans("PageForCreateEditView").' :
'.($realpathtocard?'':'').$pathtocard.($realpathtocard?'':' ').'?action=create ';
+ print '
'.$langs->trans("PageForCreateEditView").' :
'.($realpathtocard?'':'').$pathtocard.($realpathtocard?'':' ').'?action=create ';
print '
'.img_picto($langs->trans("Edit"), 'edit').' ';
print '
';
- print '
'.$langs->trans("PageForAgendaTab").' :
'.($realpathtoagenda?'':'').$pathtoagenda.($realpathtoagenda?'':' ').' ';
+ print '
'.$langs->trans("PageForAgendaTab").' :
'.($realpathtoagenda?'':'').$pathtoagenda.($realpathtoagenda?'':' ').' ';
print '
'.img_picto($langs->trans("Edit"), 'edit').' ';
print '
';
- print '
'.$langs->trans("PageForDocumentTab").' :
'.($realpathtodocument?'':'').$pathtodocument.($realpathtodocument?'':' ').' ';
+ print '
'.$langs->trans("PageForDocumentTab").' :
'.($realpathtodocument?'':'').$pathtodocument.($realpathtodocument?'':' ').' ';
print '
'.img_picto($langs->trans("Edit"), 'edit').' ';
print '
';
- print '
'.$langs->trans("PageForNoteTab").' :
'.($realpathtonote?'':'').$pathtonote.($realpathtonote?'':' ').' ';
+ print '
'.$langs->trans("PageForNoteTab").' :
'.($realpathtonote?'':'').$pathtonote.($realpathtonote?'':' ').' ';
print '
'.img_picto($langs->trans("Edit"), 'edit').' ';
print '
';
@@ -1742,13 +1832,14 @@ elseif (! empty($module))
print $langs->trans("MenusDefDesc", '
'.$langs->trans('Menus').' ').'
';
print '
';
- print '
'.$langs->trans("DescriptorFile").' :
'.$pathtofile.' ';
+ print '
'.$langs->trans("DescriptorFile").' :
'.$pathtofile.' ';
print '
'.img_picto($langs->trans("Edit"), 'edit').' ';
print '
';
print '
';
- //print load_fiche_titre($langs->trans("MenusList"), '', '');
+ print load_fiche_titre($langs->trans("ListOfMenusEntries"), '', '');
+ print 'TODO...';
print '
';
print ' ';
print ' ';
@@ -1866,7 +1957,7 @@ elseif (! empty($module))
print $langs->trans("PermissionsDefDesc", ''.$langs->trans('DefaultPermissions').' ').' ';
print ' ';
- print ' '.$langs->trans("DescriptorFile").' : '.$pathtofile.' ';
+ print ' '.$langs->trans("DescriptorFile").' : '.$pathtofile.' ';
print ' '.img_picto($langs->trans("Edit"), 'edit').' ';
print ' ';
@@ -1988,12 +2079,12 @@ elseif (! empty($module))
print ' ';
$pathtofile = $modulelowercase.'/core/modules/mod'.$module.'.class.php';
- print ' '.$langs->trans("DescriptorFile").' : '.$pathtofile.' ';
+ print ' '.$langs->trans("DescriptorFile").' : '.$pathtofile.' ';
print ' '.img_picto($langs->trans("Edit"), 'edit').' ';
print ' ';
$pathtohook = strtolower($module).'/class/actions_'.strtolower($module).'.class.php';
- print ' '.$langs->trans("HooksFile").' : '.$pathtohook.' ';
+ print ' '.$langs->trans("HooksFile").' : '.$pathtohook.' ';
print ' '.img_picto($langs->trans("Edit"), 'edit').' ';
print ' ';
}
@@ -2042,7 +2133,7 @@ elseif (! empty($module))
{
$pathtofile = $trigger['relpath'];
- print ' '.$langs->trans("TriggersFile").' : '.$pathtofile.' ';
+ print ' '.$langs->trans("TriggersFile").' : '.$pathtofile.' ';
print ' '.img_picto($langs->trans("Edit"), 'edit').' ';
print ' ';
}
@@ -2093,7 +2184,7 @@ elseif (! empty($module))
{
$pathtofile = $widget['relpath'];
- print ' '.$langs->trans("WidgetFile").' : '.$pathtofile.' ';
+ print ' '.$langs->trans("WidgetFile").' : '.$pathtofile.' ';
print ' '.img_picto($langs->trans("Edit"), 'edit').' ';
print ' ';
}
@@ -2138,10 +2229,10 @@ elseif (! empty($module))
if ($action != 'editfile' || empty($file))
{
- print $langs->trans("CronJobDefDesc", ''.$langs->trans('CronList').' ').' ';
+ print $langs->trans("CronJobDefDesc", ''.$langs->transnoentities('CronList').' ').' ';
print ' ';
- print ' '.$langs->trans("DescriptorFile").' : '.$pathtofile.' ';
+ print ' '.$langs->trans("DescriptorFile").' : '.$pathtofile.' ';
print ' '.img_picto($langs->trans("Edit"), 'edit').' ';
print ' ';
@@ -2296,11 +2387,13 @@ elseif (! empty($module))
$FILENAMEDOC=$modulelowercase.'.html';
$outputfiledoc = dol_buildpath($modulelowercase, 0).'/doc/'.$FILENAMEDOC;
+ $outputfiledocurl = dol_buildpath($modulelowercase, 1).'/doc/'.$FILENAMEDOC;
+ // TODO Use/test PDF
}
print ' ';
- print ' '. $langs->trans("PathToModulePackage") . ' : ';
+ print ' '. $langs->trans("PathToModulePackage") . ' : ';
if (! dol_is_file($outputfilezip)) print ''.$langs->trans("FileNotYetGenerated").' ';
else {
$relativepath = $modulelowercase.'/bin/'.$FILENAMEZIP;
@@ -2320,10 +2413,14 @@ elseif (! empty($module))
print ' ';
- print ' '. $langs->trans("PathToModuleDocumentation") . ' : ';
+ print ' '. $langs->trans("PathToModuleDocumentation") . ' : ';
if (! dol_is_file($outputfiledoc)) print ''.$langs->trans("FileNotYetGenerated").' ';
else {
- print ''.$outputfiledoc.' ';
+ print '';
+ print '';
+ print $outputfiledoc;
+ print ' ';
+ print ' ';
print ' ('.$langs->trans("GeneratedOn").' '.dol_print_date(dol_filemtime($outputfiledoc), 'dayhour').')';
}
print ' ';
diff --git a/htdocs/modulebuilder/template/class/myobject.class.php b/htdocs/modulebuilder/template/class/myobject.class.php
index 90026e7389c..affda50a617 100644
--- a/htdocs/modulebuilder/template/class/myobject.class.php
+++ b/htdocs/modulebuilder/template/class/myobject.class.php
@@ -39,7 +39,7 @@ class MyObject extends CommonObject
/**
* @var string Name of table without prefix where object is stored
*/
- public $table_element = 'myobject';
+ public $table_element = 'mymodule_myobject';
/**
* @var array Does myobject support multicompany module ? 0=No test on entity, 1=Test with field entity, 2=Test with link by societe
*/
diff --git a/htdocs/modulebuilder/template/core/modules/modMyModule.class.php b/htdocs/modulebuilder/template/core/modules/modMyModule.class.php
index 63a132699b7..a9e29a1a0ab 100644
--- a/htdocs/modulebuilder/template/core/modules/modMyModule.class.php
+++ b/htdocs/modulebuilder/template/core/modules/modMyModule.class.php
@@ -230,7 +230,6 @@ class modMyModule extends DolibarrModules
// Add here entries to declare new menus
- // Example to declare a new Top Menu entry and its Left menu entry:
/* BEGIN MODULEBUILDER TOPMENU */
$this->menu[$r++]=array('fk_menu'=>'', // '' if this is a top menu. For left menu, use 'fk_mainmenu=xxx' or 'fk_mainmenu=xxx,fk_leftmenu=yyy' where xxx is mainmenucode and yyy is a leftmenucode
'type'=>'top', // This is a Top menu entry
@@ -247,7 +246,6 @@ class modMyModule extends DolibarrModules
/* END MODULEBUILDER TOPMENU */
- // Example to declare a Left Menu entry into an existing Top menu entry:
/* BEGIN MODULEBUILDER LEFTMENU MYOBJECT
$this->menu[$r++]=array( 'fk_menu'=>'fk_mainmenu=mymodule', // '' if this is a top menu. For left menu, use 'fk_mainmenu=xxx' or 'fk_mainmenu=xxx,fk_leftmenu=yyy' where xxx is mainmenucode and yyy is a leftmenucode
'type'=>'left', // This is a Left menu entry
diff --git a/htdocs/modulebuilder/template/core/triggers/interface_99_modMyModule_MyModuleTriggers.class.php b/htdocs/modulebuilder/template/core/triggers/interface_99_modMyModule_MyModuleTriggers.class.php
index 3ea9ed8a090..62b35bfdf39 100644
--- a/htdocs/modulebuilder/template/core/triggers/interface_99_modMyModule_MyModuleTriggers.class.php
+++ b/htdocs/modulebuilder/template/core/triggers/interface_99_modMyModule_MyModuleTriggers.class.php
@@ -97,7 +97,7 @@ class InterfaceMyModuleTriggers extends DolibarrTriggers
*/
public function runTrigger($action, $object, User $user, Translate $langs, Conf $conf)
{
- if (!empty($conf->mymodule->enabled)) return 0; // Module not active, we do nothing
+ if (empty($conf->mymodule->enabled)) return 0; // Module not active, we do nothing
// Put here code you want to execute when a Dolibarr business events occurs.
// Data and type of action are stored into $object and $action
diff --git a/htdocs/modulebuilder/template/doc/Specifications.asciidoc b/htdocs/modulebuilder/template/doc/Specifications.asciidoc
index adfaeb4e9b5..4610cb188f9 100644
--- a/htdocs/modulebuilder/template/doc/Specifications.asciidoc
+++ b/htdocs/modulebuilder/template/doc/Specifications.asciidoc
@@ -1,38 +1,11 @@
= MYMODULE =
-Copyright (C) ---Put here your own copyright and developer email---
:subtitle: MYMODULE SPECIFICATIONS
-== Topic of document
-
-This document was build from following input:
-
-* Date 1
-...
-
-* Date 2
-...
-
-
-The document includes an introductory chapter of functional specifications, presenting the different actors involved in the rebuild of the definitions
-of business terms that will be used (some of which may be new or different).
-The main following chapter will present the entire process, also known as *uses cases*, according to a principle of a description, in chronological sequence if possible,
-to present the actor and the action performed, as in the following example:
-
-* *X* Actor realizes Action A.
-* *Y* Actor communicates Info B to Actor *Z*
-* *Automaton* performs update of data for...
-* Etc ...
-
-Functional requirements are complemented by a chapter of technical requirements.
-The chapter on data lists key information specific to Presto that were identified at the time of writing specification. It will be enriched as
-iterations occurs.
-
-Finally, in the Appendix, the documents known when writing this document are centralized to illustrate the existing document or inspire the new expected one.
-These documents have their content directly integrated in this specification or have a reference to
-external documents stored in the *Appendices* directory accompanying this document.
+== TOPIC OF DOCUMENT
+This document describe specifications of module MyModule
*Log of versions*
@@ -40,88 +13,14 @@ external documents stored in the *Appendices* directory accompanying this docume
[options="header",format="csv"]
|===
Author, Date, Version
-John Doe, Date YYY-MM-DD, Version 1.0
+---Put here your own copyright and developer email---, Date YYY-MM-DD, Version 1.0
|===
-
-<<<
-
-
-== BUSINESS SPECIFICATIONS - INTRODUCTION
-
-=== List of actors [[actors]]
-
-Actors are physical people or moral entities working on at least one process.
-The following chart prensts list of actors or partners identified by the project for the defined scope of project. We will use then the name defined into first column to speak about roles in the rest of documents.
-
-[options="header",format="csv"]
-|===
-Actor/profil/role, Description of role, Access to system or not, Example of actor
-Customer Service, Receive and create Sales orders (SO), Yes, Mr Smith
-Purchase, Make puchase order (PO), Yes, 5 people
-Administrator - IT, Administration of users/groups and IT services, Yes, John Doe
-Automaton, Execute automatic data processing, Yes, NA
-|===
-
-
-=== Definitions [[definitions]]
-
-To understand the descriptions of the target process, it was necessary to define or redefine some vocabulary concepts. We must see these definitions as defined in the
-new system. Indeed, some terms are already being used but have either not a definition in line with standards, or even differs between services. To bring everyone,
-and to consolidate the process, these terms are redefined here, and with their definition in the target objective.
-
-*Definition ABC*
-
-...
-
-*Definition DEF*
-
-...
-
-
[NOTE]
==============
-Important information will be noticed with a notice like this one.
-
-* Main information 1
-* Main information 2
+This document was generated using Dolibarr ERP CRM process
==============
-
-
-== BUSINESS SPECIFICATION - PROCESS
-
-Specifications were cut into different business process. We call a business process a workflow with a starting situation and ending situation. Between start and end, we will find actions
-done by actors to bring the value of the company. This actions are described using the syntax rule:
-*Actor X* do action Y, *Actor Z* do action W.
-
-_Each process/use case is described into a separate chapter._
-
-
-=== Use case / Process 1 [[process_1]]
-
-==== Title and goals
-
-...
-
-==== Actors or roles
-
-* Members of group *...*
-
-==== Standard flow
-
-* Members of Groupe *...*: Do ...
-* Members of Groupe *...*: Do ...
-* Members of Groupe *...*: Do ...
-
-==== Alternative flow
-
-* A user without role *...*: Can't do ...
-
-==== Business rules
-
-* Business rule 1
-* Business rule 2
-
+<<<
diff --git a/htdocs/modulebuilder/template/doc/Specifications_full_en.asciidoc b/htdocs/modulebuilder/template/doc/Specifications_full_en.asciidoc
new file mode 100644
index 00000000000..72d1d5f4d82
--- /dev/null
+++ b/htdocs/modulebuilder/template/doc/Specifications_full_en.asciidoc
@@ -0,0 +1,126 @@
+= MYMODULE =
+:subtitle: MYMODULE SPECIFICATIONS
+
+
+
+== TOPIC OF DOCUMENT
+
+This document was build from following input:
+
+* Date 1
+...
+
+* Date 2
+...
+
+
+The document includes an introductory chapter of functional specifications, presenting the different actors involved in the rebuild of the definitions
+of business terms that will be used (some of which may be new or different).
+The main following chapter will present the entire process, also known as *uses cases*, according to a principle of a description, in chronological sequence if possible,
+to present the actor and the action performed, as in the following example:
+
+* *X* Actor realizes Action A.
+* *Y* Actor communicates Info B to Actor *Z*
+* *Automaton* performs update of data for...
+* Etc ...
+
+Functional requirements are complemented by a chapter of technical requirements.
+The chapter on data lists key information specific to Presto that were identified at the time of writing specification. It will be enriched as
+iterations occurs.
+
+Finally, in the Appendix, the documents known when writing this document are centralized to illustrate the existing document or inspire the new expected one.
+These documents have their content directly integrated in this specification or have a reference to
+external documents stored in the *Appendices* directory accompanying this document.
+
+
+
+*Log of versions*
+
+[options="header",format="csv"]
+|===
+Author, Date, Version
+John Doe, Date YYY-MM-DD, Version 1.0
+|===
+
+
+
+<<<
+
+
+== BUSINESS SPECIFICATIONS - INTRODUCTION
+
+=== List of actors [[actors]]
+
+Actors are physical people or moral entities working on at least one process.
+The following chart prensts list of actors or partners identified by the project for the defined scope of project. We will use then the name defined into first column to speak about roles in the rest of documents.
+
+[options="header",format="csv"]
+|===
+Actor/profil/role, Description of role, Access to system or not, Example of actor
+Customer Service, Receive and create Sales orders (SO), Yes, Mr Smith
+Purchase, Make puchase order (PO), Yes, 5 people
+Administrator - IT, Administration of users/groups and IT services, Yes, John Doe
+Automaton, Execute automatic data processing, Yes, NA
+|===
+
+
+=== Definitions [[definitions]]
+
+To understand the descriptions of the target process, it was necessary to define or redefine some vocabulary concepts. We must see these definitions as defined in the
+new system. Indeed, some terms are already being used but have either not a definition in line with standards, or even differs between services. To bring everyone,
+and to consolidate the process, these terms are redefined here, and with their definition in the target objective.
+
+*Definition ABC*
+
+...
+
+*Definition DEF*
+
+...
+
+
+[NOTE]
+==============
+Important information will be noticed with a notice like this one.
+
+* Main information 1
+* Main information 2
+==============
+
+
+
+== BUSINESS SPECIFICATION - PROCESS
+
+Specifications were cut into different business process. We call a business process a workflow with a starting situation and ending situation. Between start and end, we will find actions
+done by actors to bring the value of the company. This actions are described using the syntax rule:
+*Actor X* do action Y, *Actor Z* do action W.
+
+_Each process/use case is described into a separate chapter._
+
+
+=== Use case / Process 1 [[process_1]]
+
+==== Title and goals
+
+...
+
+==== Actors or roles
+
+* Members of group *...*
+
+==== Standard flow
+
+* Members of Groupe *...*: Do ...
+* Members of Groupe *...*: Do ...
+* Members of Groupe *...*: Do ...
+
+==== Alternative flow
+
+* A user without role *...*: Can't do ...
+
+==== Business rules
+
+* Business rule 1
+* Business rule 2
+
+
diff --git a/htdocs/modulebuilder/template/langs/en_US/mymodule.lang b/htdocs/modulebuilder/template/langs/en_US/mymodule.lang
index a37d8e0c241..314e5a7269b 100644
--- a/htdocs/modulebuilder/template/langs/en_US/mymodule.lang
+++ b/htdocs/modulebuilder/template/langs/en_US/mymodule.lang
@@ -18,16 +18,16 @@
#
# Module label 'ModuleMyModuleName'
-ModuleMyModuleName = My module
+ModuleMyModuleName = MyModule
# Module description 'ModuleMyModuleDesc'
-ModuleMyModuleDesc = My module description
+ModuleMyModuleDesc = MyModule description
#
# Admin page
#
-MyModuleSetup = My module setup
+MyModuleSetup = MyModule setup
Settings = Settings
-MyModuleSetupPage = My module setup page
+MyModuleSetupPage = MyModule setup page
MYMODULE_MYPARAM1 = My param 1
MYMODULE_MYPARAM1Tooltip = My param 1 tooltip
MYMODULE_MYPARAM2=My param 2
@@ -38,8 +38,8 @@ MYMODULE_MYPARAM2Tooltip=My param 2 tooltip
# About page
#
About = About
-MyModuleAbout = About my module
-MyModuleAboutPage = My module about page
+MyModuleAbout = About MyModule
+MyModuleAboutPage = MyModule about page
#
# Sample page
@@ -47,7 +47,7 @@ MyModuleAboutPage = My module about page
MyPageName = My page name
#
-# Sample box
+# Sample widget
#
MyWidget = My widget
-MyWidgetDescription = My widget description
\ No newline at end of file
+MyWidgetDescription = My widget description
diff --git a/htdocs/modulebuilder/template/langs/fr_FR/mymodule.lang b/htdocs/modulebuilder/template/langs/fr_FR/mymodule.lang
index aa271536edf..740734ce04c 100644
--- a/htdocs/modulebuilder/template/langs/fr_FR/mymodule.lang
+++ b/htdocs/modulebuilder/template/langs/fr_FR/mymodule.lang
@@ -20,21 +20,21 @@
# Module label 'ModuleMyModuleName'
ModuleMyModuleName = Mon module
# Module description 'ModuleMyModuleDesc'
-ModuleMyModuleDesc = Description de mon module
+ModuleMyModuleDesc = Description de MyModule
#
# Page d'administration
#
-MyModuleSetup = Configuration du module mon module
+MyModuleSetup = Configuration du module MyModule
Settings = Réglages
-MyModuleSetupPage = Page de réglage de mon module
+MyModuleSetupPage = Page de configuration du module MyModule
#
# Page À propos
#
About = À propos
-MyModuleAbout = À propos de mon module
-MyModuleAboutPage = Page à propos de mon module
+MyModuleAbout = À propos de MyModule
+MyModuleAboutPage = Page à propos de MyModule
#
# Page d'exemple
diff --git a/htdocs/modulebuilder/template/myobject_card.php b/htdocs/modulebuilder/template/myobject_card.php
index ae00feaab95..8aa3899f82c 100644
--- a/htdocs/modulebuilder/template/myobject_card.php
+++ b/htdocs/modulebuilder/template/myobject_card.php
@@ -414,10 +414,14 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
$MAXEVENT = 10;
+ $morehtmlright = '';
+ $morehtmlright.= $langs->trans("SeeAll");
+ $morehtmlright.= ' ';
+
// List of actions on element
include_once DOL_DOCUMENT_ROOT . '/core/class/html.formactions.class.php';
$formactions = new FormActions($db);
- $somethingshown = $formactions->showactions($object, 'myobject', $socid, 1, '', $MAXEVENT);
+ $somethingshown = $formactions->showactions($object, 'myobject', $socid, 1, '', $MAXEVENT, '', $morehtmlright);
print ' ';
}
diff --git a/htdocs/modulebuilder/template/myobject_list.php b/htdocs/modulebuilder/template/myobject_list.php
index db30a2de934..cd99c94f969 100644
--- a/htdocs/modulebuilder/template/myobject_list.php
+++ b/htdocs/modulebuilder/template/myobject_list.php
@@ -211,7 +211,7 @@ $parameters=array();
$reshook=$hookmanager->executeHooks('printFieldListSelect', $parameters, $object); // Note that $action and $object may have been modified by hook
$sql.=$hookmanager->resPrint;
$sql=preg_replace('/, $/','', $sql);
-$sql.= " FROM ".MAIN_DB_PREFIX."myobject as t";
+$sql.= " FROM ".MAIN_DB_PREFIX.$object->table_element." as t";
if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label)) $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."myobject_extrafields as ef on (t.rowid = ef.fk_object)";
if ($object->ismultientitymanaged == 1) $sql.= " WHERE t.entity IN (".getEntity('myobject').")";
else $sql.=" WHERE 1 = 1";
diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php
index 8703350c737..6c5ebdd6e81 100644
--- a/htdocs/product/class/product.class.php
+++ b/htdocs/product/class/product.class.php
@@ -1520,6 +1520,7 @@ class Product extends CommonObject
// We do a first seach with a select by searching with couple prodfournprice and qty only (later we will search on triplet qty/product_id/fourn_ref)
$sql = "SELECT pfp.rowid, pfp.price as price, pfp.quantity as quantity, pfp.remise_percent,";
$sql.= " pfp.fk_product, pfp.ref_fourn, pfp.fk_soc, pfp.tva_tx, pfp.fk_supplier_price_expression";
+ $sql.= " ,pfp.default_vat_code";
$sql.= " FROM ".MAIN_DB_PREFIX."product_fournisseur_price as pfp";
$sql.= " WHERE pfp.rowid = ".$prodfournprice;
if ($qty > 0) $sql.= " AND pfp.quantity <= ".$qty;
@@ -1555,6 +1556,7 @@ class Product extends CommonObject
$this->ref_supplier = $obj->ref_fourn; // Ref supplier
$this->remise_percent = $obj->remise_percent; // remise percent if present and not typed
$this->vatrate_supplier = $obj->tva_tx; // Vat ref supplier
+ $this->default_vat_code = $obj->default_vat_code; // Vat code supplier
$result=$obj->fk_product;
return $result;
}
@@ -1563,6 +1565,7 @@ class Product extends CommonObject
// We do a second search by doing a select again but searching with less reliable criteria: couple qty/id product, and if set fourn_ref or fk_soc.
$sql = "SELECT pfp.rowid, pfp.price as price, pfp.quantity as quantity, pfp.fk_soc,";
$sql.= " pfp.fk_product, pfp.ref_fourn as ref_supplier, pfp.tva_tx, pfp.fk_supplier_price_expression";
+ $sql.= " ,pfp.default_vat_code";
$sql.= " FROM ".MAIN_DB_PREFIX."product_fournisseur_price as pfp";
$sql.= " WHERE pfp.fk_product = ".$product_id;
if ($fourn_ref != 'none') $sql.= " AND pfp.ref_fourn = '".$fourn_ref."'";
@@ -1602,6 +1605,7 @@ class Product extends CommonObject
$this->ref_supplier = $obj->ref_supplier; // Ref supplier
$this->remise_percent = $obj->remise_percent; // remise percent if present and not typed
$this->vatrate_supplier = $obj->tva_tx; // Vat ref supplier
+ $this->default_vat_code = $obj->default_vat_code; // Vat code supplier
$result=$obj->fk_product;
return $result;
}
diff --git a/htdocs/product/stock/replenishorders.php b/htdocs/product/stock/replenishorders.php
index 694f9cae1ad..8332da36eaa 100644
--- a/htdocs/product/stock/replenishorders.php
+++ b/htdocs/product/stock/replenishorders.php
@@ -29,7 +29,8 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.form.class.php';
require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.commande.class.php';
-require_once './lib/replenishment.lib.php';
+require_once DOL_DOCUMENT_ROOT.'/product/stock/lib/replenishment.lib.php';
+require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
$langs->load("products");
$langs->load("stocks");
@@ -44,9 +45,12 @@ $sref = GETPOST('search_ref', 'alpha');
$snom = GETPOST('search_nom', 'alpha');
$suser = GETPOST('search_user', 'alpha');
$sttc = GETPOST('search_ttc', 'alpha');
-$sdate = GETPOST('search_date', 'alpha');
$page = GETPOST('page', 'int');
$sproduct = GETPOST('sproduct', 'int');
+$search_dateyear = GETPOST('search_dateyear', 'int');
+$search_datemonth = GETPOST('search_datemonth', 'int');
+$search_dateday = GETPOST('search_dateday', 'int');
+$search_date = dol_mktime(0, 0, 0, $search_datemonth, $search_dateday, $search_dateyear);
$limit = GETPOST('limit')?GETPOST('limit','int'):$conf->liste_limit;
$sortfield = GETPOST("sortfield");
@@ -58,7 +62,6 @@ if ($page < 0) $page = 0;
$offset = $limit * $page;
-
/*
* Actions
*/
@@ -70,7 +73,10 @@ if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter.x',
$snom="";
$suser="";
$sttc="";
- $sdate='';
+ $search_date='';
+ $search_datemonth='';
+ $search_dateday='';
+ $search_dateyear='';
$sproduct=0;
}
@@ -125,17 +131,19 @@ if ($sref) $sql .= natural_search('cf.ref', $sref);
if ($snom) $sql .= natural_search('s.nom', $snom);
if ($suser) $sql .= natural_search('u.login', $suser);
if ($sttc) $sql .= natural_search('cf.total_ttc', $sttc, 1);
-if ($sdate)
+
+if ($search_datemonth > 0)
{
- if (GETPOST('search_datemonth', 'int') && GETPOST('search_dateday', 'int') && GETPOST('search_dateyear', 'int'))
- {
- $date = dol_mktime(0, 0, 0, GETPOST('search_datemonth', 'int'), GETPOST('search_dateday', 'int'), GETPOST('search_dateyear', 'int'));
- }
- else
- {
- $date = dol_stringtotime($sdate);
- }
- $sql .= " AND cf.date_creation = '" . $db->idate($date) . "'";
+ if ($search_dateyear > 0 && empty($search_dateday))
+ $sql.= " AND cf.date_creation BETWEEN '".$db->idate(dol_get_first_day($search_dateyear,$search_datemonth,false))."' AND '".$db->idate(dol_get_last_day($search_dateyear,$search_datemonth,false))."'";
+ else if ($search_dateyear > 0 && ! empty($search_dateday))
+ $sql.= " AND cf.date_creation BETWEEN '".$db->idate(dol_mktime(0, 0, 0, $search_datemonth, $search_dateday, $search_dateyear))."' AND '".$db->idate(dol_mktime(23, 59, 59, $search_datemonth, $search_dateday, $search_dateyear))."'";
+ else
+ $sql.= " AND date_format(cf.date_creation, '%m') = '".$search_datemonth."'";
+}
+else if ($search_dateyear > 0)
+{
+ $sql.= " AND cf.date_creation BETWEEN '".$db->idate(dol_get_first_day($search_dateyear,1,false))."' AND '".$db->idate(dol_get_last_day($search_dateyear,12,false))."'";
}
if ($sall) $sql .= natural_search(array('cf.ref','cf.note'), $sall);
if (!empty($socid)) $sql .= ' AND s.rowid = ' . $socid;
@@ -146,7 +154,6 @@ $sql .= ' GROUP BY cf.rowid, cf.ref, cf.date_creation, cf.fk_statut';
$sql .= ', cf.total_ttc, cf.fk_user_author, u.login, s.rowid, s.nom';
$sql .= $db->order($sortfield, $sortorder);
$sql .= $db->plimit($limit+1, $offset);
-//print $sql;
$resql = $db->query($sql);
if ($resql)
@@ -158,25 +165,38 @@ if ($resql)
print_barre_liste('', $page, $_SERVER["PHP_SELF"], '', $sortfield, $sortorder, '', $num, 0, '');
+ $param='';
+ if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.urlencode($contextpage);
+ if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.urlencode($limit);
+ if ($sref) $param.='&search_ref='.urlencode($sref);
+ if ($snom) $param.='&search_nom='.urlencode($snom);
+ if ($suser) $param.='&search_user='.urlencode($suser);
+ if ($sttc) $param.='&search_ttc='.urlencode($sttc);
+ if ($search_dateyear) $param.='&search_dateyear='.urlencode($search_dateyear);
+ if ($search_datemonth) $param.='&search_datemonth='.urlencode($search_datemonth);
+ if ($search_dateday) $param.='&search_dateday='.urlencode($search_dateday);
+ if ($optioncss != '') $param.='&optioncss='.urlencode($optioncss);
+
+
print '';
print '';
- print ''.
- ''.
- ' '.
+ print ' ';
+ print ''.
+ ' '.
' '.
''.
- ' '.
+ ' '.
' '.
''.
- ' '.
+ ' '.
' '.
''.
- ' '.
+ ' '.
' '.
''.
- $form->select_date('', 'search_date', 0, 0, 1, '', 1, 0, 1, 0, '').
+ $form->select_date($search_date, 'search_date', 0, 0, 1, '', 1, 0, 1, 0, '').
' '.
'';
$searchpicto=$form->showFilterAndCheckAddButtons(0);
@@ -190,7 +210,7 @@ if ($resql)
$_SERVER['PHP_SELF'],
'cf.ref',
'',
- '',
+ $param,
'',
$sortfield,
$sortorder
@@ -200,7 +220,7 @@ if ($resql)
$_SERVER['PHP_SELF'],
's.nom',
'',
- '',
+ $param,
'',
$sortfield,
$sortorder
@@ -220,7 +240,7 @@ if ($resql)
$_SERVER['PHP_SELF'],
'cf.total_ttc',
'',
- '',
+ $param,
'',
$sortfield,
$sortorder
@@ -230,7 +250,7 @@ if ($resql)
$_SERVER['PHP_SELF'],
'cf.date_creation',
'',
- '',
+ $param,
'',
$sortfield,
$sortorder
@@ -240,7 +260,7 @@ if ($resql)
$_SERVER['PHP_SELF'],
'cf.fk_statut',
'',
- '',
+ $param,
'align="right"',
$sortfield,
$sortorder
diff --git a/htdocs/projet/card.php b/htdocs/projet/card.php
index 700feba4bd8..4b4e6a0ea58 100644
--- a/htdocs/projet/card.php
+++ b/htdocs/projet/card.php
@@ -1196,7 +1196,7 @@ elseif ($object->id > 0)
print '';
- $MAX = 10;
+ $MAXEVENT = 10;
$morehtmlright = '
';
$morehtmlright.= $langs->trans("SeeAll");
@@ -1205,7 +1205,7 @@ elseif ($object->id > 0)
// List of actions on element
include_once DOL_DOCUMENT_ROOT . '/core/class/html.formactions.class.php';
$formactions = new FormActions($db);
- $somethingshown = $formactions->showactions($object, 'project', $socid, 1, '', $MAX, '', $morehtmlright);
+ $somethingshown = $formactions->showactions($object, 'project', $socid, 1, '', $MAXEVENT, '', $morehtmlright);
print ' ';
}
diff --git a/htdocs/resource/class/dolresource.class.php b/htdocs/resource/class/dolresource.class.php
index 1933d670cab..59a5412b0c7 100644
--- a/htdocs/resource/class/dolresource.class.php
+++ b/htdocs/resource/class/dolresource.class.php
@@ -927,9 +927,10 @@ class Dolresource extends CommonObject
* @param int $withpicto Add picto into link
* @param string $option Where point the link ('compta', 'expedition', 'document', ...)
* @param string $get_params Parametres added to url
+ * @param int $notooltip 1=Disable tooltip
* @return string String with URL
*/
- function getNomUrl($withpicto=0,$option='', $get_params='')
+ function getNomUrl($withpicto=0,$option='', $get_params='', $notooltip=0)
{
global $langs;
diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php
index 5b203c71693..2594a4c9466 100644
--- a/htdocs/societe/class/societe.class.php
+++ b/htdocs/societe/class/societe.class.php
@@ -2021,7 +2021,7 @@ class Societe extends CommonObject
/**
* Return label of status (activity, closed)
*
- * @param int $mode 0=libelle long, 1=libelle court, 2=Picto + Libelle court, 3=Picto, 4=Picto + Libelle long
+ * @param int $mode 0=libelle long, 1=libelle court, 2=Picto + Libelle court, 3=Picto, 4=Picto + Libelle long, 5=Libelle court + Picto
* @return string Libelle
*/
function getLibStatut($mode=0)
@@ -2033,7 +2033,7 @@ class Societe extends CommonObject
* Renvoi le libelle d'un statut donne
*
* @param int $statut Id statut
- * @param int $mode 0=libelle long, 1=libelle court, 2=Picto + Libelle court, 3=Picto, 4=Picto + Libelle long, 5=Libelle court + Picto
+ * @param int $mode 0=Long label, 1=Short label, 2=Picto + Short label, 3=Picto, 4=Picto + Long label, 5=Short label + Picto, 6=Long label + Picto
* @return string Libelle du statut
*/
function LibStatut($statut,$mode=0)
@@ -2068,8 +2068,13 @@ class Societe extends CommonObject
}
if ($mode == 5)
{
- if ($statut==0) return $langs->trans("ActivityCeased").' '.img_picto($langs->trans("ActivityCeased"),'statut5', 'class="pictostatus"');
- if ($statut==1) return $langs->trans("InActivity").' '.img_picto($langs->trans("InActivity"),'statut4', 'class="pictostatus"');
+ if ($statut==0) return ''.$langs->trans("ActivityCeased").' '.img_picto($langs->trans("ActivityCeased"),'statut5', 'class="pictostatus"');
+ if ($statut==1) return ''.$langs->trans("InActivity").' '.img_picto($langs->trans("InActivity"),'statut4', 'class="pictostatus"');
+ }
+ if ($mode == 6)
+ {
+ if ($statut==0) return ''.$langs->trans("ActivityCeased").' '.img_picto($langs->trans("ActivityCeased"),'statut5', 'class="pictostatus"');
+ if ($statut==1) return ''.$langs->trans("InActivity").' '.img_picto($langs->trans("InActivity"),'statut4', 'class="pictostatus"');
}
}
diff --git a/htdocs/supplier_proposal/class/api_supplier_proposals.class.php b/htdocs/supplier_proposal/class/api_supplier_proposals.class.php
index 8cb883a2d9b..306c7e3e177 100644
--- a/htdocs/supplier_proposal/class/api_supplier_proposals.class.php
+++ b/htdocs/supplier_proposal/class/api_supplier_proposals.class.php
@@ -38,7 +38,7 @@ class Supplierproposals extends DolibarrApi
);
/**
- * @var supplier_proposal $supplier_proposal {@type supplier_proposal}
+ * @var SupplierProposal $supplier_proposal {@type SupplierProposal}
*/
public $supplier_proposal;
@@ -149,6 +149,7 @@ class Supplierproposals extends DolibarrApi
{
$num = $db->num_rows($result);
$min = min($num, ($limit <= 0 ? $num : $limit));
+ $i=0;
while ($i < $min)
{
$obj = $db->fetch_object($result);
diff --git a/htdocs/theme/eldy/style.css.php b/htdocs/theme/eldy/style.css.php
index f58eb5fed86..b9eaac506e9 100644
--- a/htdocs/theme/eldy/style.css.php
+++ b/htdocs/theme/eldy/style.css.php
@@ -272,7 +272,7 @@ input.select2-input {
border-bottom: solid 1px rgba(0,0,0,.2) !important; /* required to avoid to lose bottom line when focus is lost on select2. */
}
-.liste_titre input[name=monthvalid], .liste_titre input[name=search_ordermonth], .liste_titre input[name=search_deliverymonth],
+.liste_titre input[name=month_date_when], .liste_titre input[name=monthvalid], .liste_titre input[name=search_ordermonth], .liste_titre input[name=search_deliverymonth],
.liste_titre input[name=search_smonth], .liste_titre input[name=search_month], .liste_titre input[name=search_emonth], .liste_titre input[name=smonth], .liste_titre input[name=month], .liste_titre select[name=month],
.liste_titre input[name=month_lim], .liste_titre input[name=month_create] {
margin-right: 4px;
@@ -403,7 +403,7 @@ td.actionbuttons a {
}
select.flat, form.flat select {
font-weight: normal;
- height: 2.1em;
+ height: 2em;
}
.optionblue {
color: rgb();
@@ -449,7 +449,7 @@ input:-webkit-autofill {
}
::-webkit-input-placeholder { color:#ccc; }
input:-moz-placeholder { color:#ccc; }
-input[name=weight], input[name=volume], input[name=surface], input[name=sizeheight], select[name=incoterm_id] { margin-right: 6px; }
+input[name=price], input[name=weight], input[name=volume], input[name=surface], input[name=sizeheight], select[name=incoterm_id] { margin-right: 6px; }
input[name=surface] { margin-right: 4px; }
fieldset { border: 1px solid #AAAAAA !important; }
.legendforfieldsetstep { padding-bottom: 10px; }
@@ -854,6 +854,7 @@ select.selectarrowonleft option {
.titlefield { width: 25%; }
.titlefieldmiddle { width: 50%; }
.imgmaxwidth180 { max-width: 180px; }
+.imgmaxheight50 { max-height: 50px; }
.width20p { width:20%; }
.width25p { width:25%; }
@@ -987,6 +988,9 @@ select.selectarrowonleft option {
div.statusref {
padding-right: 10px;
}
+ div.statusref img {
+ padding-right: 3px !important;
+ }
}
.linkobject { cursor: pointer; }
@@ -1121,8 +1125,8 @@ div.fiche {
div.fiche {
- margin-: px;
- margin-: dol_optimize_smallscreen)?'20':'12')); ?>px;
+ margin-: dol_optimize_smallscreen)?'22':'6')); ?>px;
+ margin-: dol_optimize_smallscreen)?'25':'6')); ?>px;
dol_hide_leftmenu) && ! empty($conf->dol_hide_topmenu)) print 'margin-top: 4px;'."\n"; ?>
dol_hide_leftmenu)) print 'margin-bottom: 12px;'."\n"; ?>
}
@@ -1280,6 +1284,8 @@ div.statusref {
}
div.statusref img {
padding-left: 8px;
+ padding-right: 9px;
+ vertical-align: text-bottom;
}
img.photoref, div.photoref {
border: 1px solid #CCC;
@@ -3182,6 +3188,15 @@ div.titre {
#divsubscribe { max-width: 900px; }
#tablesubscribe { width: 100%; }
+div#card-element {
+ border: 1px solid #ccc;
+}
+div#card-errors {
+ color: #fa755a;
+ text-align: center;
+ padding-top: 3px;
+}
+
/*
* Effect Postit
@@ -4175,6 +4190,11 @@ div.dataTables_length select {
/* Select2 */
/* ============================================================================== */
+.blockvmenusearch .select2-container--default .select2-selection--single,
+.blockvmenubookmarks .select2-container--default .select2-selection--single
+{
+ background-color: unset;
+}
.select2-container--default .select2-selection--single .select2-selection__rendered {
color: unset;
}
diff --git a/htdocs/theme/md/style.css.php b/htdocs/theme/md/style.css.php
index 7e9bdc70c8b..1558f9f280c 100644
--- a/htdocs/theme/md/style.css.php
+++ b/htdocs/theme/md/style.css.php
@@ -287,7 +287,7 @@ textarea.cke_source:focus
box-shadow: none;
}
-.liste_titre input[name=monthvalid], .liste_titre input[name=search_ordermonth], .liste_titre input[name=search_deliverymonth],
+.liste_titre input[name=month_date_when], .liste_titre input[name=monthvalid], .liste_titre input[name=search_ordermonth], .liste_titre input[name=search_deliverymonth],
.liste_titre input[name=search_smonth], .liste_titre input[name=search_month], .liste_titre input[name=search_emonth], .liste_titre input[name=smonth], .liste_titre input[name=month],
.liste_titre input[name=month_lim], .liste_titre input[name=month_create] {
margin-right: 4px;
@@ -411,7 +411,7 @@ td.actionbuttons a {
}
select.flat, form.flat select {
font-weight: normal;
- height: 2.1em;
+ height: 2em;
}
.optionblue {
color: rgb();
@@ -983,6 +983,9 @@ select.selectarrowonleft option {
div.statusref {
padding-right: 10px;
}
+ div.statusref img {
+ padding-right: 3px !important;
+ }
}
.linkobject { cursor: pointer; }
@@ -1144,8 +1147,8 @@ div.fiche {
div.fiche {
- margin-: px;
- margin-: dol_optimize_smallscreen)?'16':'12')); ?>px;
+ margin-: dol_optimize_smallscreen)?'24':'6')); ?>px;
+ margin-: dol_optimize_smallscreen)?'16':'6')); ?>px;
dol_hide_leftmenu) && ! empty($conf->dol_hide_topmenu)) print 'margin-top: 4px;'; ?>
margin-bottom: 15px;
}
@@ -1306,6 +1309,8 @@ div.statusref {
}
div.statusref img {
padding-left: 8px;
+ padding-right: 9px;
+ vertical-align: text-bottom;
}
img.photoref, div.photoref {
border: 1px solid #CCC;
@@ -3217,8 +3222,8 @@ td.legendLabel { padding: 2px 2px 2px 0 !important; }
}
.photointoolitp {
margin-top: 8px;
- float: left;
- /*text-align: center; */
+ margin-bottom: 6px;
+ text-align: center;
}
.photodelete {
margin-top: 6px !important;
@@ -3263,10 +3268,21 @@ div.titre {
#divsubscribe { max-width: 900px; }
#tablesubscribe { width: 100%; }
+div#card-element {
+ border: 1px solid #ccc;
+}
+div#card-errors {
+ color: #fa755a;
+ text-align: center;
+ padding-top: 3px;
+}
+
+
/*
* Effect Postit
*/
+
.effectpostit
{
position: relative;
@@ -4173,6 +4189,11 @@ div.dataTables_length select {
/* Select2 */
/* ============================================================================== */
+.blockvmenusearch .select2-container--default .select2-selection--single,
+.blockvmenubookmarks .select2-container--default .select2-selection--single
+{
+ background-color: unset;
+}
.select2-container--default .select2-selection--single .select2-selection__rendered {
color: unset;
}
diff --git a/htdocs/webservices/server_actioncomm.php b/htdocs/webservices/server_actioncomm.php
index c7e1f769d9a..4f0081551ca 100644
--- a/htdocs/webservices/server_actioncomm.php
+++ b/htdocs/webservices/server_actioncomm.php
@@ -115,7 +115,8 @@ $actioncomm_fields= array(
// fetch optionals attributes and labels
$extrafields=new ExtraFields($db);
$extralabels=$extrafields->fetch_name_optionals_label('actioncomm',true);
-if (count($extrafields)>0) {
+$extrafield_array=null;
+if (is_array($extrafields) && count($extrafields)>0) {
$extrafield_array = array();
}
foreach($extrafields->attribute_label as $key=>$label)
@@ -127,7 +128,7 @@ foreach($extrafields->attribute_label as $key=>$label)
$extrafield_array['options_'.$key]=array('name'=>'options_'.$key,'type'=>$type);
}
-$actioncomm_fields=array_merge($actioncomm_fields,$extrafield_array);
+if (is_array($extrafield_array)) $actioncomm_fields=array_merge($actioncomm_fields,$extrafield_array);
// Define other specific objects
$server->wsdl->addComplexType(
diff --git a/htdocs/webservices/server_contact.php b/htdocs/webservices/server_contact.php
index cab58268f57..fe4fcc3378f 100644
--- a/htdocs/webservices/server_contact.php
+++ b/htdocs/webservices/server_contact.php
@@ -120,7 +120,8 @@ $contact_fields = array(
// fetch optionals attributes and labels
$extrafields=new ExtraFields($db);
$extralabels=$extrafields->fetch_name_optionals_label('socpeople',true);
-if (count($extrafields)>0) {
+$extrafield_array=null;
+if (is_array($extrafields) && count($extrafields)>0) {
$extrafield_array = array();
}
foreach($extrafields->attribute_label as $key=>$label)
@@ -132,7 +133,7 @@ foreach($extrafields->attribute_label as $key=>$label)
$extrafield_array['options_'.$key]=array('name'=>'options_'.$key,'type'=>$type);
}
-$contact_fields=array_merge($contact_fields,$extrafield_array);
+if (is_array($extrafield_array)) $contact_fields=array_merge($contact_fields,$extrafield_array);
// Define other specific objects
$server->wsdl->addComplexType(
diff --git a/htdocs/webservices/server_order.php b/htdocs/webservices/server_order.php
index 1bc0fa6a60e..eb42dd74ce4 100644
--- a/htdocs/webservices/server_order.php
+++ b/htdocs/webservices/server_order.php
@@ -116,7 +116,8 @@ $line_fields = array(
// fetch optionals attributes and labels
$extrafields=new ExtraFields($db);
$extralabels=$extrafields->fetch_name_optionals_label('commandedet',true);
-if (count($extrafields)>0) {
+$extrafield_line_array=null;
+if (is_array($extrafields) && count($extrafields)>0) {
$extrafield_line_array = array();
}
foreach($extrafields->attribute_label as $key=>$label)
@@ -127,7 +128,7 @@ foreach($extrafields->attribute_label as $key=>$label)
else {$type='xsd:string';}
$extrafield_line_array['options_'.$key]=array('name'=>'options_'.$key,'type'=>$type);
}
-$line_fields=array_merge($line_fields,$extrafield_line_array);
+if (is_array($extrafield_line_array)) $line_fields=array_merge($line_fields,$extrafield_line_array);
// Define other specific objects
$server->wsdl->addComplexType(
@@ -215,7 +216,8 @@ $order_fields = array(
// fetch optionals attributes and labels
$extrafields=new ExtraFields($db);
$extralabels=$extrafields->fetch_name_optionals_label('commande',true);
-if (count($extrafields)>0) {
+$extrafield_array=null;
+if (is_array($extrafields) && count($extrafields)>0) {
$extrafield_array = array();
}
foreach($extrafields->attribute_label as $key=>$label)
@@ -226,7 +228,7 @@ foreach($extrafields->attribute_label as $key=>$label)
else {$type='xsd:string';}
$extrafield_array['options_'.$key]=array('name'=>'options_'.$key,'type'=>$type);
}
-$order_fields=array_merge($order_fields,$extrafield_array);
+if (is_array($extrafield_array)) $order_fields=array_merge($order_fields,$extrafield_array);
$server->wsdl->addComplexType(
'order',
diff --git a/htdocs/webservices/server_productorservice.php b/htdocs/webservices/server_productorservice.php
index cf926c6409e..00dcd2fe4fc 100644
--- a/htdocs/webservices/server_productorservice.php
+++ b/htdocs/webservices/server_productorservice.php
@@ -134,7 +134,8 @@ $productorservice_fields = array(
// fetch optionals attributes and labels
$extrafields=new ExtraFields($db);
$extralabels=$extrafields->fetch_name_optionals_label('product',true);
-if (count($extrafields)>0) {
+$extrafield_array=null;
+if (is_array($extrafields) && count($extrafields) > 0) {
$extrafield_array = array();
}
foreach($extrafields->attribute_label as $key=>$label)
@@ -146,7 +147,7 @@ foreach($extrafields->attribute_label as $key=>$label)
$extrafield_array['options_'.$key]=array('name'=>'options_'.$key,'type'=>$type);
}
-$productorservice_fields=array_merge($productorservice_fields,$extrafield_array);
+if (is_array($extrafield_array)) $productorservice_fields=array_merge($productorservice_fields,$extrafield_array);
// Define other specific objects
$server->wsdl->addComplexType(
diff --git a/htdocs/webservices/server_project.php b/htdocs/webservices/server_project.php
index 5400e069c3f..9e10b0212ec 100644
--- a/htdocs/webservices/server_project.php
+++ b/htdocs/webservices/server_project.php
@@ -163,7 +163,8 @@ $project_fields = array(
// fetch optionals attributes and labels
$extrafields=new ExtraFields($db);
$extralabels=$extrafields->fetch_name_optionals_label('project',true);
-if (count($extrafields)>0) {
+$extrafield_array=null;
+if (is_array($extrafields) && count($extrafields)>0) {
$extrafield_array = array();
}
foreach($extrafields->attribute_label as $key=>$label)
@@ -174,7 +175,7 @@ foreach($extrafields->attribute_label as $key=>$label)
else {$type='xsd:string';}
$extrafield_array['options_'.$key]=array('name'=>'options_'.$key,'type'=>$type);
}
-$project_fields=array_merge($project_fields,$extrafield_array);
+if (is_array($extrafield_array)) $project_fields=array_merge($project_fields,$extrafield_array);
$server->wsdl->addComplexType(
'project',
diff --git a/htdocs/webservices/server_thirdparty.php b/htdocs/webservices/server_thirdparty.php
index 6b2c94a36fd..8e358e21924 100644
--- a/htdocs/webservices/server_thirdparty.php
+++ b/htdocs/webservices/server_thirdparty.php
@@ -124,7 +124,8 @@ $thirdparty_fields= array(
// fetch optionals attributes and labels
$extrafields=new ExtraFields($db);
$extralabels=$extrafields->fetch_name_optionals_label('societe',true);
-if (count($extrafields)>0) {
+$extrafield_array=null;
+if (is_array($extrafields) && count($extrafields)>0) {
$extrafield_array = array();
}
foreach($extrafields->attribute_label as $key=>$label)
@@ -137,7 +138,7 @@ foreach($extrafields->attribute_label as $key=>$label)
$extrafield_array['options_'.$key]=array('name'=>'options_'.$key,'type'=>$type);
}
-$thirdparty_fields=array_merge($thirdparty_fields,$extrafield_array);
+if (is_array($extrafield_array)) $thirdparty_fields=array_merge($thirdparty_fields,$extrafield_array);
// Define other specific objects
$server->wsdl->addComplexType(
@@ -780,7 +781,7 @@ function deleteThirdParty($authentication,$id='',$ref='',$ref_ext='')
$errorcode='BAD_PARAMETERS'; $errorlabel="Parameter id, ref and ref_ext can't be both provided. You must choose one or other but not both.";
}
dol_syslog("Function: deleteThirdParty 1");
-
+
if (! $error)
{
$fuser->getrights();
@@ -789,21 +790,21 @@ function deleteThirdParty($authentication,$id='',$ref='',$ref_ext='')
{
$thirdparty=new Societe($db);
$result=$thirdparty->fetch($id,$ref,$ref_ext);
-
+
if ($result > 0)
{
$db->begin();
-
+
$result=$thirdparty->delete($thirdparty->id, $fuser);
-
+
if ($result > 0)
{
$db->commit();
-
+
$objectresp = array('result'=>array('result_code'=>'OK', 'result_label'=>''));
}
else
- {
+ {
$db->rollback();
$error++;
$errorcode='KO';
@@ -815,7 +816,7 @@ function deleteThirdParty($authentication,$id='',$ref='',$ref_ext='')
{
$error++;
$errorcode='NOT_FOUND'; $errorlabel='Object not found for id='.$id.' nor ref='.$ref.' nor ref_ext='.$ref_ext;
-
+
}
}
else
diff --git a/htdocs/webservices/server_user.php b/htdocs/webservices/server_user.php
index 3de5ef815c9..60bf95bd20c 100644
--- a/htdocs/webservices/server_user.php
+++ b/htdocs/webservices/server_user.php
@@ -187,7 +187,8 @@ $thirdpartywithuser_fields = array(
// fetch optionals attributes and labels
$extrafields=new ExtraFields($db);
$extralabels=$extrafields->fetch_name_optionals_label('socpeople',true);
-if (count($extrafields)>0) {
+$extrafield_array=null;
+if (is_array($extrafields) && count($extrafields)>0) {
$extrafield_array = array();
}
foreach($extrafields->attribute_label as $key=>$label)
@@ -199,7 +200,7 @@ foreach($extrafields->attribute_label as $key=>$label)
$extrafield_array['contact_options_'.$key]=array('name'=>'contact_options_'.$key,'type'=>$type);
}
-$thirdpartywithuser_fields=array_merge($thirdpartywithuser_fields,$extrafield_array);
+if (is_array($extrafield_array)) $thirdpartywithuser_fields=array_merge($thirdpartywithuser_fields,$extrafield_array);
$server->wsdl->addComplexType(
diff --git a/htdocs/website/index.php b/htdocs/website/index.php
index 08ce57cfede..0250e2d28f8 100644
--- a/htdocs/website/index.php
+++ b/htdocs/website/index.php
@@ -51,12 +51,16 @@ $page=GETPOST('page', 'alpha');
$pageid=GETPOST('pageid', 'int');
$pageref=GETPOST('pageref', 'aZ09');
$action=GETPOST('action','alpha');
+$confirm=GETPOST('confirm','alpha');
+$cancel=GETPOST('cancel','alpha');
+
+$section_dir = GETPOST('section_dir', 'alpha');
+$file_manager = GETPOST('file_manager', 'alpha');
if (GETPOST('delete')) { $action='delete'; }
if (GETPOST('preview')) $action='preview';
if (GETPOST('createsite')) { $action='createsite'; }
if (GETPOST('create')) { $action='create'; }
-if (GETPOST('file_manager')) { $action='file_manager'; }
if (GETPOST('editcss')) { $action='editcss'; }
if (GETPOST('editmenu')) { $action='editmenu'; }
if (GETPOST('setashome')) { $action='setashome'; }
@@ -65,6 +69,7 @@ if (GETPOST('editsource')) { $action='editsource'; }
if (GETPOST('editcontent')) { $action='editcontent'; }
if (GETPOST('createfromclone')) { $action='createfromclone'; }
if (GETPOST('createpagefromclone')) { $action='createpagefromclone'; }
+if (empty($action) && $file_manager) $action='file_manager';
// Load variable for pagination
$limit = GETPOST('limit','int')?GETPOST('limit','int'):$conf->liste_limit;
@@ -122,10 +127,55 @@ $urlwithroot=$urlwithouturlroot.DOL_URL_ROOT; // This is to use external domain
//$urlwithroot=DOL_MAIN_URL_ROOT; // This is to use same domain name than current
+$permtouploadfile = $user->rights->website->write;
+$diroutput = $conf->medias->multidir_output[$conf->entity];
+
+$relativepath=$section_dir;
+$upload_dir = $diroutput.'/'.$relativepath;
+
+
/*
* Actions
*/
+$backtopage=$_SERVER["PHP_SELF"].'?file_manager=1&website='.$website.'&pageid='.$pageid; // used after a confirm_deletefile into actions_linkedfiles.inc.php
+include DOL_DOCUMENT_ROOT.'/core/actions_linkedfiles.inc.php';
+
+if ($action == 'renamefile') $action='file_manager'; // After actions_linkedfiles, if action were renamefile, we set it to 'file_manager'
+
+// Add directory
+if ($action == 'add' && $permtouploadfile)
+{
+ $ecmdir->ref = 'NOTUSEDYET';
+ $ecmdir->label = GETPOST("label");
+ $ecmdir->description = GETPOST("desc");
+
+ //$id = $ecmdir->create($user);
+ if ($id > 0)
+ {
+ header("Location: ".$_SERVER["PHP_SELF"]);
+ exit;
+ }
+ else
+ {
+ setEventMessages('Error '.$langs->trans($ecmdir->error), null, 'errors');
+ $action = "create";
+ }
+
+ clearstatcache();
+}
+
+
+// Remove directory
+if ($action == 'confirm_deletesection' && GETPOST('confirm') == 'yes')
+{
+ //$result=$ecmdir->delete($user);
+ setEventMessages($langs->trans("ECMSectionWasRemoved", $ecmdir->label), null, 'mesgs');
+
+ clearstatcache();
+}
+
+
if (GETPOST('refreshsite')) // If we change the site, we reset the pageid and cancel addsite action.
{
$pageid=0;
@@ -1117,7 +1167,7 @@ $moreheadjs.=''."\n";
llxHeader($moreheadcss.$moreheadjs, $langs->trans("websiteetup"), $help_url, '', 0, 0, $arrayofjs, $arrayofcss, '', '', ''."\n".'');
-print "\n".'
';
+print "\n".' ';
print ' ';
if ($action == 'createsite')
@@ -1156,6 +1206,10 @@ if ($action == 'edit')
{
print ' ';
}
+if ($action == 'file_manager')
+{
+ print ' ';
+}
print '';
@@ -1283,7 +1337,7 @@ if (count($object->records) > 0)
// ***** Part for pages
- if ($website && ! in_array($action, array('editcss','editmenu','file_manager')))
+ if ($website && ! in_array($action, array('editcss','editmenu')))
{
print '
'; // Close current websitebar to open a new one
@@ -1822,15 +1876,17 @@ if ($action == 'editmeta' || $action == 'create')
print ' ';
}
-if ($action == 'file_manager')
+if ($action == 'editfile' || $action == 'file_manager')
{
print ''."\n";
- print ' ';
+ print '';
//print '
'.$langs->trans("FeatureNotYetAvailable").'';
$module = 'medias';
- if (empty($url)) $url=DOL_URL_ROOT.'/website/index.php';
- include DOL_DOCUMENT_ROOT.'/ecm/tpl/filemanager.tpl.php';
+ if (empty($url)) $url=DOL_URL_ROOT.'/website/index.php'; // Must be an url without param
+ include DOL_DOCUMENT_ROOT.'/core/tpl/filemanager.tpl.php';
+
+ print '
';
}
if ($action == 'editmenu')
diff --git a/scripts/emailings/mailing-send.php b/scripts/emailings/mailing-send.php
index a56c2be2055..ef9a35fc1ed 100755
--- a/scripts/emailings/mailing-send.php
+++ b/scripts/emailings/mailing-send.php
@@ -113,7 +113,7 @@ if ($resql)
// On choisit les mails non deja envoyes pour ce mailing (statut=0)
// ou envoyes en erreur (statut=-1)
- $sql2 = "SELECT mc.rowid, mc.lastname as lastname, mc.firstname as firstname, mc.email, mc.other, mc.source_url, mc.source_id, mc.source_type, mc.tag";
+ $sql2 = "SELECT mc.rowid, mc.fk_mailing, mc.lastname, mc.firstname, mc.email, mc.other, mc.source_url, mc.source_id, mc.source_type, mc.tag";
$sql2.= " FROM ".MAIN_DB_PREFIX."mailing_cibles as mc";
$sql2.= " WHERE mc.statut < 1 AND mc.fk_mailing = ".$id;
if ($conf->global->MAILING_LIMIT_SENDBYCLI > 0)
@@ -149,13 +149,13 @@ if ($resql)
$res=1;
$now=dol_now();
- $obj2 = $db->fetch_object($resql2);
+ $obj = $db->fetch_object($resql2);
// sendto en RFC2822
- $sendto = str_replace(',',' ',dolGetFirstLastname($obj2->firstname, $obj2->lastname) ." <".$obj2->email.">");
+ $sendto = str_replace(',',' ',dolGetFirstLastname($obj->firstname, $obj->lastname) ." <".$obj->email.">");
// Make subtsitutions on topic and body
- $other=explode(';',$obj2->other);
+ $other=explode(';',$obj->other);
$tmpfield=explode('=',$other[0],2); $other1=(isset($tmpfield[1])?$tmpfield[1]:$tmpfield[0]);
$tmpfield=explode('=',$other[1],2); $other2=(isset($tmpfield[1])?$tmpfield[1]:$tmpfield[0]);
$tmpfield=explode('=',$other[2],2); $other3=(isset($tmpfield[1])?$tmpfield[1]:$tmpfield[0]);
@@ -230,7 +230,7 @@ if ($resql)
$substitutionisok=true;
// Fabrication du mail
- $trackid='emailing-'.$obj2->source_type.$obj2->source_id;
+ $trackid='emailing-'.$obj->fk_mailing.'-'.$obj->rowid;
$mail = new CMailFile(
$newsubject,
$sendto,
@@ -277,13 +277,13 @@ if ($resql)
// We must union table llx_mailing_taget for event tab OR enter 1 event with a special table link (id of email in event)
// Run trigger
/*
- if ($obj2->source_type == 'contact')
+ if ($obj->source_type == 'contact')
{
- $emailing->sendtoid = $obj2->source_id;
+ $emailing->sendtoid = $obj->source_id;
}
- if ($obj2->source_type == 'thirdparty')
+ if ($obj->source_type == 'thirdparty')
{
- $emailing->socid = $obj2->source_id;
+ $emailing->socid = $obj->source_id;
}
// Call trigger
$result=$emailing->call_trigger('EMAILING_SENTBYMAIL',$user);
@@ -292,7 +292,7 @@ if ($resql)
*/
$sqlok ="UPDATE ".MAIN_DB_PREFIX."mailing_cibles";
- $sqlok.=" SET statut=1, date_envoi='".$db->idate($now)."' WHERE rowid=".$obj2->rowid;
+ $sqlok.=" SET statut=1, date_envoi='".$db->idate($now)."' WHERE rowid=".$obj->rowid;
$resqlok=$db->query($sqlok);
if (! $resqlok)
{
@@ -305,7 +305,7 @@ if ($resql)
if (strpos($message, '__CHECK_READ__') !== false)
{
//Update status communication of thirdparty prospect
- $sqlx = "UPDATE ".MAIN_DB_PREFIX."societe SET fk_stcomm=2 WHERE rowid IN (SELECT source_id FROM ".MAIN_DB_PREFIX."mailing_cibles WHERE rowid=".$obj2->rowid.")";
+ $sqlx = "UPDATE ".MAIN_DB_PREFIX."societe SET fk_stcomm=2 WHERE rowid IN (SELECT source_id FROM ".MAIN_DB_PREFIX."mailing_cibles WHERE rowid=".$obj->rowid.")";
dol_syslog("card.php: set prospect thirdparty status", LOG_DEBUG);
$resqlx=$db->query($sqlx);
if (! $resqlx)
@@ -315,7 +315,7 @@ if ($resql)
}
//Update status communication of contact prospect
- $sqlx = "UPDATE ".MAIN_DB_PREFIX."societe SET fk_stcomm=2 WHERE rowid IN (SELECT sc.fk_soc FROM ".MAIN_DB_PREFIX."socpeople AS sc INNER JOIN ".MAIN_DB_PREFIX."mailing_cibles AS mc ON mc.rowid=".$obj2->rowid." AND mc.source_type = 'contact' AND mc.source_id = sc.rowid)";
+ $sqlx = "UPDATE ".MAIN_DB_PREFIX."societe SET fk_stcomm=2 WHERE rowid IN (SELECT sc.fk_soc FROM ".MAIN_DB_PREFIX."socpeople AS sc INNER JOIN ".MAIN_DB_PREFIX."mailing_cibles AS mc ON mc.rowid=".$obj->rowid." AND mc.source_type = 'contact' AND mc.source_id = sc.rowid)";
dol_syslog("card.php: set prospect contact status", LOG_DEBUG);
$resqlx=$db->query($sqlx);
@@ -340,7 +340,7 @@ if ($resql)
dol_syslog("error for emailing id ".$id." #".$i.($mail->error?' - '.$mail->error:''), LOG_DEBUG);
$sqlerror="UPDATE ".MAIN_DB_PREFIX."mailing_cibles";
- $sqlerror.=" SET statut=-1, date_envoi=".$db->idate($now)." WHERE rowid=".$obj2->rowid;
+ $sqlerror.=" SET statut=-1, date_envoi=".$db->idate($now)." WHERE rowid=".$obj->rowid;
$resqlerror=$db->query($sqlerror);
if (! $resqlerror)
{
diff --git a/test/phpunit/AllTests.php b/test/phpunit/AllTests.php
index d1c39e4358b..71b57fb82c7 100644
--- a/test/phpunit/AllTests.php
+++ b/test/phpunit/AllTests.php
@@ -201,18 +201,22 @@ class AllTests
require_once dirname(__FILE__).'/RestAPIUserTest.php';
$suite->addTestSuite('RestAPIUserTest');
- require_once dirname(__FILE__).'/WebservicesProductsTest.php';
- $suite->addTestSuite('WebservicesProductsTest');
- require_once dirname(__FILE__).'/WebservicesInvoicesTest.php';
- $suite->addTestSuite('WebservicesInvoicesTest');
- require_once dirname(__FILE__).'/WebservicesOrdersTest.php';
- $suite->addTestSuite('WebservicesOrdersTest');
- require_once dirname(__FILE__).'/WebservicesOtherTest.php';
- $suite->addTestSuite('WebservicesOtherTest');
- require_once dirname(__FILE__).'/WebservicesThirdpartyTest.php';
- $suite->addTestSuite('WebservicesThirdpartyTest');
- require_once dirname(__FILE__).'/WebservicesUserTest.php';
- $suite->addTestSuite('WebservicesUserTest');
+ // Test only with php7.2 or less
+ //if ((float) phpversion() < 7.3)
+ //{
+ require_once dirname(__FILE__).'/WebservicesProductsTest.php';
+ $suite->addTestSuite('WebservicesProductsTest');
+ require_once dirname(__FILE__).'/WebservicesInvoicesTest.php';
+ $suite->addTestSuite('WebservicesInvoicesTest');
+ require_once dirname(__FILE__).'/WebservicesOrdersTest.php';
+ $suite->addTestSuite('WebservicesOrdersTest');
+ require_once dirname(__FILE__).'/WebservicesOtherTest.php';
+ $suite->addTestSuite('WebservicesOtherTest');
+ require_once dirname(__FILE__).'/WebservicesThirdpartyTest.php';
+ $suite->addTestSuite('WebservicesThirdpartyTest');
+ require_once dirname(__FILE__).'/WebservicesUserTest.php';
+ $suite->addTestSuite('WebservicesUserTest');
+ //}
require_once dirname(__FILE__).'/ExportTest.php';
$suite->addTestSuite('ExportTest');
diff --git a/test/phpunit/WebservicesInvoicesTest.php b/test/phpunit/WebservicesInvoicesTest.php
index 07bd95e01f2..75cc767b8ee 100644
--- a/test/phpunit/WebservicesInvoicesTest.php
+++ b/test/phpunit/WebservicesInvoicesTest.php
@@ -56,11 +56,11 @@ class WebservicesInvoicesTest extends PHPUnit_Framework_TestCase
protected $savlangs;
protected $savdb;
protected $soapclient;
-
+
private static $socid;
-
+
protected $ns = 'http://www.dolibarr.org/ns/';
-
+
/**
* Constructor
* We save global variables into local variables
@@ -75,7 +75,7 @@ class WebservicesInvoicesTest extends PHPUnit_Framework_TestCase
$this->savuser=$user;
$this->savlangs=$langs;
$this->savdb=$db;
-
+
// Set the WebService URL
$WS_DOL_URL = DOL_MAIN_URL_ROOT.'/webservices/server_invoice.php';
print __METHOD__." create nusoap_client for URL=".$WS_DOL_URL."\n";
@@ -85,7 +85,7 @@ class WebservicesInvoicesTest extends PHPUnit_Framework_TestCase
$this->soapclient->soap_defencoding='UTF-8';
$this->soapclient->decodeUTF8(false);
}
-
+
print __METHOD__." db->type=".$db->type." user->id=".$user->id;
//print " - db ".$db->db;
print "\n";
@@ -114,11 +114,13 @@ class WebservicesInvoicesTest extends PHPUnit_Framework_TestCase
$societe->ref_ext='ref-phpunit';
$societe->status=1;
$societe->client=1;
+ $societe->code_client='CU0901-1234';
+ $societe->code_fournisseur='SU0901-1234';
$societe->fournisseur=0;
$societe->date_creation=$now;
$societe->tva_assuj=0;
$societe->particulier=0;
-
+
$societe->create($user);
self::$socid = $societe->id;
@@ -259,13 +261,13 @@ class WebservicesInvoicesTest extends PHPUnit_Framework_TestCase
return $result;
}
-
+
/**
* testWSInvoicesGetInvoiceByRefExt
- *
+ *
* Retrieve an invoice using ref_ext
* @depends testWSInvoicesCreateInvoice
- *
+ *
* @param array $result Invoice created by create method
* @return array Invoice
*/
@@ -315,13 +317,13 @@ class WebservicesInvoicesTest extends PHPUnit_Framework_TestCase
return $result;
}
-
+
/**
* testWSInvoicesUpdateInvoiceByRefExt
- *
+ *
* Update an invoice using ref_ext
* @depends testWSInvoicesCreateInvoice
- *
+ *
* @param array $result invoice created by create method
* @return array Invoice
*/
diff --git a/test/phpunit/WebservicesThirdpartyTest.php b/test/phpunit/WebservicesThirdpartyTest.php
index 59907b36194..e0e22125afe 100644
--- a/test/phpunit/WebservicesThirdpartyTest.php
+++ b/test/phpunit/WebservicesThirdpartyTest.php
@@ -55,12 +55,12 @@ class WebservicesThirdpartyTest extends PHPUnit_Framework_TestCase
protected $savlangs;
protected $savdb;
protected $soapclient;
-
+
private $_WS_DOL_URL;
private $_ns='http://www.dolibarr.org/ns/';
-
-
-
+
+
+
/**
* Constructor
@@ -76,9 +76,9 @@ class WebservicesThirdpartyTest extends PHPUnit_Framework_TestCase
$this->savuser=$user;
$this->savlangs=$langs;
$this->savdb=$db;
-
+
$this->_WS_DOL_URL = DOL_MAIN_URL_ROOT.'/webservices/server_thirdparty.php';
-
+
// Set the WebService URL
print __METHOD__." create nusoap_client for URL=".$this->_WS_DOL_URL."\n";
$this->soapclient = new nusoap_client($this->_WS_DOL_URL);
@@ -148,10 +148,10 @@ class WebservicesThirdpartyTest extends PHPUnit_Framework_TestCase
$user=$this->savuser;
$langs=$this->savlangs;
$db=$this->savdb;
-
+
$WS_METHOD = 'createThirdParty';
-
-
+
+
// Call the WebService method and store its result in $result.
$authentication=array(
'dolibarrkey'=>$conf->global->WEBSERVICES_KEY,
@@ -159,7 +159,7 @@ class WebservicesThirdpartyTest extends PHPUnit_Framework_TestCase
'login'=>'admin',
'password'=>'admin',
'entity'=>'');
-
+
$body = array (
"id" => NULL,
"ref" => "name",
@@ -168,8 +168,8 @@ class WebservicesThirdpartyTest extends PHPUnit_Framework_TestCase
"status" => NULL,
"client" => 1,
"supplier" => 0,
- "customer_code" => "",
- "supplier_code" => "",
+ "customer_code" => "CU0901-5678",
+ "supplier_code" => "SU0901-5678",
"customer_code_accountancy" => "",
"supplier_code_accountancy" => "",
"date_creation" => "", // dateTime
@@ -197,7 +197,7 @@ class WebservicesThirdpartyTest extends PHPUnit_Framework_TestCase
"vat_used" => "",
"vat_number" => ""
);
-
+
// Test URL
$result='';
$parameters = array('authentication'=>$authentication, 'thirdparty'=>$body);
@@ -217,20 +217,20 @@ class WebservicesThirdpartyTest extends PHPUnit_Framework_TestCase
print $this->soapclient->response;
print "\n";
}
-
+
print __METHOD__." result=".$result['result']['result_code']."\n";
$this->assertEquals('OK',$result['result']['result_code']);
- $this->assertEquals('name',$result['ref']);
-
+ $this->assertEquals('name',$result['ref']);
+
return $result;
}
/**
* testWSThirdpartygetThirdPartyById
- *
+ *
* Use id to retrieve thirdparty
* @depends testWSThirdpartycreateThirdParty
- *
+ *
* @param array $result thirdparty created by create method
* @return array thirpdarty updated
*/
@@ -280,18 +280,18 @@ class WebservicesThirdpartyTest extends PHPUnit_Framework_TestCase
$this->assertEquals('0', $result['thirdparty']['status']);
$this->assertEquals('1', $result['thirdparty']['client']);
$this->assertEquals('0', $result['thirdparty']['supplier']);
-
-
+
+
return $result;
}
-
+
/**
* testWSThirdpartygetThirdPartyByRefExt
*
* Use ref_ext to retrieve thirdparty
*
* @depends testWSThirdpartycreateThirdParty
- *
+ *
* @param array $result thirdparty created by create method
* @return array thirdparty
*/
@@ -303,9 +303,9 @@ class WebservicesThirdpartyTest extends PHPUnit_Framework_TestCase
$langs=$this->savlangs;
$db=$this->savdb;
$id = $result['id'];
-
+
$WS_METHOD = 'getThirdParty';
-
+
// Call the WebService method and store its result in $result.
$authentication=array(
'dolibarrkey'=>$conf->global->WEBSERVICES_KEY,
@@ -313,7 +313,7 @@ class WebservicesThirdpartyTest extends PHPUnit_Framework_TestCase
'login'=>'admin',
'password'=>'admin',
'entity'=>'');
-
+
// Test URL
$result='';
$parameters = array('authentication'=>$authentication, 'id'=>'', 'ref'=>'', 'ref_ext'=>'12');
@@ -334,7 +334,7 @@ class WebservicesThirdpartyTest extends PHPUnit_Framework_TestCase
print $this->soapclient->response;
print "\n";
}
-
+
print __METHOD__." result=".$result['result']['result_code']."\n";
$this->assertEquals('OK',$result['result']['result_code']);
$this->assertEquals($id, $result['thirdparty']['id']);
@@ -343,11 +343,11 @@ class WebservicesThirdpartyTest extends PHPUnit_Framework_TestCase
$this->assertEquals('0', $result['thirdparty']['status']);
$this->assertEquals('1', $result['thirdparty']['client']);
$this->assertEquals('0', $result['thirdparty']['supplier']);
-
-
+
+
return $result;
}
-
+
/**
* testWSThirdpartydeleteThirdParty
*
@@ -364,9 +364,9 @@ class WebservicesThirdpartyTest extends PHPUnit_Framework_TestCase
$langs=$this->savlangs;
$db=$this->savdb;
$id = $result['id'];
-
+
$WS_METHOD = 'deleteThirdParty';
-
+
// Call the WebService method and store its result in $result.
$authentication=array(
'dolibarrkey'=>$conf->global->WEBSERVICES_KEY,
@@ -374,7 +374,7 @@ class WebservicesThirdpartyTest extends PHPUnit_Framework_TestCase
'login'=>'admin',
'password'=>'admin',
'entity'=>'');
-
+
$result='';
$parameters = array('authentication'=>$authentication, 'id'=>$id, 'ref'=>'', 'ref_ext'=>'');
print __METHOD__." call method ".$WS_METHOD."\n";
@@ -395,7 +395,7 @@ class WebservicesThirdpartyTest extends PHPUnit_Framework_TestCase
print __METHOD__." result=".$result['result']['result_code']."\n";
$this->assertEquals('OK',$result['result']['result_code']);
-
+
return $result;
}