Merge branch 'develop' of https://github.com/Dolibarr/dolibarr into develop
This commit is contained in:
commit
31f06f2c71
42
ChangeLog
42
ChangeLog
@ -17,8 +17,48 @@ Following changes may create regressions for some external modules, but were nec
|
||||
__PROPALREF__, ...)
|
||||
|
||||
|
||||
***** ChangeLog for 6.0.1 compared to 6.0.* *****
|
||||
FIX: #7000 Dashboard link for late pending payment supplier invoices do not work
|
||||
FIX: #7325 Default VAT rate when editing template invoices is 0%
|
||||
FIX: #7330
|
||||
FIX: #7359
|
||||
FIX: #7367
|
||||
FIX: #7368
|
||||
FIX: #7391
|
||||
FIX: #7420
|
||||
FIX: Add some missing attributes in Adherent:makeSubstitution (type, phone…
|
||||
FIX: Bad const name
|
||||
FIX: Bad link to unpayed suppliers invoices
|
||||
FIX: Better protection to no send email when we change limit
|
||||
FIX: Calculation in the activity box
|
||||
FIX: Clean bad parameters when inserting line of template invoice
|
||||
FIX: dateSelector was not taken into account
|
||||
FIX: hidden option MAIN_PROPAGATE_CONTACTS_FROM_ORIGIN
|
||||
FIX: journalization for bank journal should not rely on a label.
|
||||
FIX: menu enty when url is external link
|
||||
FIX: missing supplier qty and supplier discount in available fields for product export.
|
||||
FIX: multicompany better accuracy in rounding and with revenue stamp.
|
||||
FIX: Must use pdf format page as default for merging PDF.
|
||||
FIX: PDF output was sharing 2 different currencies in same total
|
||||
FIX: Position of signature on strato template
|
||||
FIX: Protection to avoid to apply credit note discount > remain to pay
|
||||
FIX: Remove warning when using log into syslog
|
||||
FIX: Responsive
|
||||
FIX: Security fixes (filter onload js, less verbose error message in
|
||||
FIX: SEPA recording payment must save one payment in bank per customer
|
||||
FIX: Several problem with the last event box on project/tasks
|
||||
FIX: Sign of amount in origin currency on credit note created from lines
|
||||
FIX: Some page of admin were not responsive
|
||||
FIX: SQL injection
|
||||
FIX: time.php crashed without project id in param
|
||||
FIX: transfer of line extrafields from order to invoice
|
||||
FIX: Upgrade missing on field
|
||||
FIX: View of timespent for another user
|
||||
FIX: ODT generation
|
||||
FIX: CVE-2017-9840, CVE-2017-14238, CVE-2017-14239, CVE-2017-14240, CVE-2017-14241,
|
||||
CVE-2017-14242
|
||||
|
||||
***** ChangeLog for 6.0.0 compared to 5.0.* *****
|
||||
|
||||
NEW: Add experimental BlockeLog module (to log business events in a non reversible log file).
|
||||
NEW: Add a payment module for Stripe.
|
||||
NEW: Add module "Product variant" (like red, blue for the product shoes)
|
||||
|
||||
@ -121,14 +121,22 @@ $hookmanager->initHooks(array('membercard','globalcard'));
|
||||
* Actions
|
||||
*/
|
||||
|
||||
if ($cancel) $action='';
|
||||
|
||||
$parameters=array('id'=>$id, 'rowid'=>$id, '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 (empty($reshook))
|
||||
{
|
||||
if ($cancel)
|
||||
{
|
||||
if (! empty($backtopage))
|
||||
{
|
||||
header("Location: ".$backtopage);
|
||||
exit;
|
||||
}
|
||||
$action='';
|
||||
}
|
||||
|
||||
if ($action == 'setuserid' && ($user->rights->user->self->creer || $user->rights->user->user->creer))
|
||||
{
|
||||
$error=0;
|
||||
@ -230,6 +238,7 @@ if (empty($reshook))
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
if ($action == 'confirm_sendinfo' && $confirm == 'yes')
|
||||
{
|
||||
if ($object->email)
|
||||
@ -242,7 +251,7 @@ if (empty($reshook))
|
||||
$langs->load("mails");
|
||||
setEventMessages($langs->trans("MailSuccessfulySent", $from, $object->email), null, 'mesgs');
|
||||
}
|
||||
}
|
||||
}*/
|
||||
|
||||
if ($action == 'update' && ! $cancel && $user->rights->adherent->creer)
|
||||
{
|
||||
@ -715,10 +724,21 @@ if (empty($reshook))
|
||||
}
|
||||
}
|
||||
|
||||
// Actions when printing a doc from card
|
||||
include DOL_DOCUMENT_ROOT.'/core/actions_printing.inc.php';
|
||||
|
||||
// Actions to build doc
|
||||
$upload_dir = $conf->adherent->dir_output;
|
||||
$permissioncreate=$user->rights->adherent->creer;
|
||||
include DOL_DOCUMENT_ROOT.'/core/actions_builddoc.inc.php';
|
||||
|
||||
// Actions to send emails
|
||||
$trigger_name='MEMBER_SENTBYMAIL';
|
||||
$paramname='id';
|
||||
$mode='emailfrommember';
|
||||
$trackid='mem'.$object->id;
|
||||
include DOL_DOCUMENT_ROOT.'/core/actions_sendmails.inc.php';
|
||||
|
||||
}
|
||||
|
||||
|
||||
@ -1344,10 +1364,10 @@ else
|
||||
}
|
||||
|
||||
// Confirm send card by mail
|
||||
if ($action == 'sendinfo')
|
||||
/*if ($action == 'sendinfo')
|
||||
{
|
||||
print $form->formconfirm("card.php?rowid=".$id,$langs->trans("SendCardByMail"),$langs->trans("ConfirmSendCardByMail",$object->email),"confirm_sendinfo",'',0,1);
|
||||
}
|
||||
}*/
|
||||
|
||||
// Confirm terminate
|
||||
if ($action == 'resign')
|
||||
@ -1590,6 +1610,31 @@ else
|
||||
if (empty($reshook)) {
|
||||
if ($action != 'valid' && $action != 'editlogin' && $action != 'editthirdparty')
|
||||
{
|
||||
// Send
|
||||
if ($object->statut == 1) {
|
||||
print '<div class="inline-block divButAction"><a class="butAction" href="' . $_SERVER["PHP_SELF"] . '?id=' . $object->id . '&action=presend&mode=init#formmailbeforetitle">' . $langs->trans('SendByMail') . '</a></div>';
|
||||
}
|
||||
|
||||
// Send card by email
|
||||
// TODO Remove this to replace with a template
|
||||
/*
|
||||
if ($user->rights->adherent->creer)
|
||||
{
|
||||
if ($object->statut >= 1)
|
||||
{
|
||||
if ($object->email) print '<div class="inline-block divButAction"><a class="butAction" href="card.php?rowid='.$object->id.'&action=sendinfo">'.$langs->trans("SendCardByMail")."</a></div>\n";
|
||||
else print '<div class="inline-block divButAction"><a class="butActionRefused" href="#" title="'.dol_escape_htmltag($langs->trans("NoEMail")).'">'.$langs->trans("SendCardByMail")."</a></div>\n";
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<div class="inline-block divButAction"><font class="butActionRefused" href="#" title="'.dol_escape_htmltag($langs->trans("ValidateBefore")).'">'.$langs->trans("SendCardByMail")."</font></div>";
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<div class="inline-block divButAction"><font class="butActionRefused" href="#" title="'.dol_escape_htmltag($langs->trans("NotEnoughPermissions")).'">'.$langs->trans("SendCardByMail")."</font></div>";
|
||||
}*/
|
||||
|
||||
// Modify
|
||||
if ($user->rights->adherent->creer)
|
||||
{
|
||||
@ -1626,24 +1671,6 @@ else
|
||||
}
|
||||
}
|
||||
|
||||
// Send card by email
|
||||
if ($user->rights->adherent->creer)
|
||||
{
|
||||
if ($object->statut >= 1)
|
||||
{
|
||||
if ($object->email) print '<div class="inline-block divButAction"><a class="butAction" href="card.php?rowid='.$object->id.'&action=sendinfo">'.$langs->trans("SendCardByMail")."</a></div>\n";
|
||||
else print '<div class="inline-block divButAction"><a class="butActionRefused" href="#" title="'.dol_escape_htmltag($langs->trans("NoEMail")).'">'.$langs->trans("SendCardByMail")."</a></div>\n";
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<div class="inline-block divButAction"><font class="butActionRefused" href="#" title="'.dol_escape_htmltag($langs->trans("ValidateBefore")).'">'.$langs->trans("SendCardByMail")."</font></div>";
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<div class="inline-block divButAction"><font class="butActionRefused" href="#" title="'.dol_escape_htmltag($langs->trans("NotEnoughPermissions")).'">'.$langs->trans("SendCardByMail")."</font></div>";
|
||||
}
|
||||
|
||||
// Terminate
|
||||
if ($object->statut >= 1)
|
||||
{
|
||||
@ -1720,52 +1747,65 @@ else
|
||||
}
|
||||
|
||||
|
||||
|
||||
print '<div class="fichecenter"><div class="fichehalfleft">';
|
||||
print '<a name="builddoc"></a>'; // ancre
|
||||
|
||||
// Documents generes
|
||||
$filename = dol_sanitizeFileName($object->ref);
|
||||
//$filename = 'tmp_cards.php';
|
||||
//$filedir = $conf->adherent->dir_output . '/' . get_exdir($object->id, 2, 0, 0, $object, 'member') . dol_sanitizeFileName($object->ref);
|
||||
$filedir = $conf->adherent->dir_output . '/' . get_exdir(0, 0, 0, 0, $object, 'member');
|
||||
$urlsource = $_SERVER['PHP_SELF'] . '?id=' . $object->id;
|
||||
$genallowed = $user->rights->adherent->creer;
|
||||
$delallowed = $user->rights->adherent->supprimer;
|
||||
|
||||
print $formfile->showdocuments('member', $filename, $filedir, $urlsource, $genallowed, $delallowed, $object->modelpdf, 1, 0, 0, 28, 0, '', '', '', $object->default_lang, '', $object);
|
||||
$somethingshown = $formfile->numoffiles;
|
||||
|
||||
// Show links to link elements
|
||||
//$linktoelem = $form->showLinkToObjectBlock($object, null, array('subscription'));
|
||||
//$somethingshown = $form->showLinkedObjectBlock($object, '');
|
||||
|
||||
// Show links to link elements
|
||||
/*$linktoelem = $form->showLinkToObjectBlock($object,array('order'));
|
||||
if ($linktoelem) print ($somethingshown?'':'<br>').$linktoelem;
|
||||
*/
|
||||
|
||||
// Shon online payment link
|
||||
$useonlinepayment = (! empty($conf->paypal->enabled) || ! empty($conf->stripe->enabled) || ! empty($conf->paybox->enabled));
|
||||
|
||||
if ($useonlinepayment)
|
||||
{
|
||||
print '<br>';
|
||||
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/payments.lib.php';
|
||||
print showOnlinePaymentUrl('membersubscription', $object->ref);
|
||||
// Select mail models is same action as presend
|
||||
if (GETPOST('modelselected')) {
|
||||
$action = 'presend';
|
||||
}
|
||||
|
||||
print '</div><div class="fichehalfright"><div class="ficheaddleft">';
|
||||
if ($action != 'presend')
|
||||
{
|
||||
print '<div class="fichecenter"><div class="fichehalfleft">';
|
||||
print '<a name="builddoc"></a>'; // ancre
|
||||
|
||||
// List of actions on element
|
||||
/* Already in tab Agenda/Events
|
||||
include_once DOL_DOCUMENT_ROOT . '/core/class/html.formactions.class.php';
|
||||
$formactions = new FormActions($db);
|
||||
$somethingshown = $formactions->showactions($object, 'member', $socid, 1);
|
||||
*/
|
||||
print '</div></div></div>';
|
||||
// Documents generes
|
||||
$filename = dol_sanitizeFileName($object->ref);
|
||||
//$filename = 'tmp_cards.php';
|
||||
//$filedir = $conf->adherent->dir_output . '/' . get_exdir($object->id, 2, 0, 0, $object, 'member') . dol_sanitizeFileName($object->ref);
|
||||
$filedir = $conf->adherent->dir_output . '/' . get_exdir(0, 0, 0, 0, $object, 'member');
|
||||
$urlsource = $_SERVER['PHP_SELF'] . '?id=' . $object->id;
|
||||
$genallowed = $user->rights->adherent->creer;
|
||||
$delallowed = $user->rights->adherent->supprimer;
|
||||
|
||||
print $formfile->showdocuments('member', $filename, $filedir, $urlsource, $genallowed, $delallowed, $object->modelpdf, 1, 0, 0, 28, 0, '', '', '', $object->default_lang, '', $object);
|
||||
$somethingshown = $formfile->numoffiles;
|
||||
|
||||
// Show links to link elements
|
||||
//$linktoelem = $form->showLinkToObjectBlock($object, null, array('subscription'));
|
||||
//$somethingshown = $form->showLinkedObjectBlock($object, '');
|
||||
|
||||
// Show links to link elements
|
||||
/*$linktoelem = $form->showLinkToObjectBlock($object,array('order'));
|
||||
if ($linktoelem) print ($somethingshown?'':'<br>').$linktoelem;
|
||||
*/
|
||||
|
||||
// Shon online payment link
|
||||
$useonlinepayment = (! empty($conf->paypal->enabled) || ! empty($conf->stripe->enabled) || ! empty($conf->paybox->enabled));
|
||||
|
||||
if ($useonlinepayment)
|
||||
{
|
||||
print '<br>';
|
||||
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/payments.lib.php';
|
||||
print showOnlinePaymentUrl('membersubscription', $object->ref);
|
||||
}
|
||||
|
||||
print '</div><div class="fichehalfright"><div class="ficheaddleft">';
|
||||
|
||||
// List of actions on element
|
||||
include_once DOL_DOCUMENT_ROOT . '/core/class/html.formactions.class.php';
|
||||
$formactions = new FormActions($db);
|
||||
$somethingshown = $formactions->showactions($object, 'member', $socid, 1, 'listactions', 10);
|
||||
|
||||
print '</div></div></div>';
|
||||
}
|
||||
|
||||
// Presend form
|
||||
$modelmail='member';
|
||||
$defaulttopic='SendMemberRef';
|
||||
$diroutput = $conf->adherent->dir_output;
|
||||
$trackid = 'mem'.$object->id;
|
||||
|
||||
include DOL_DOCUMENT_ROOT.'/core/tpl/card_presend.tpl.php';
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -213,51 +213,23 @@ class Adherent extends CommonObject
|
||||
|
||||
// Substitutions
|
||||
$substitutionarray=array(
|
||||
'__DOL_MAIN_URL_ROOT__'=>DOL_MAIN_URL_ROOT,
|
||||
'__ID__'=>$msgishtml?dol_htmlentitiesbr($this->id):$this->id,
|
||||
'__CIVILITY__'=>$this->getCivilityLabel(),
|
||||
'__FIRSTNAME__'=>$msgishtml?dol_htmlentitiesbr($this->firstname):$this->firstname,
|
||||
'__LASTNAME__'=>$msgishtml?dol_htmlentitiesbr($this->lastname):$this->lastname,
|
||||
'__FULLNAME__'=>$msgishtml?dol_htmlentitiesbr($this->getFullName($langs)):$this->getFullName($langs),
|
||||
'__COMPANY__'=>$msgishtml?dol_htmlentitiesbr($this->societe):$this->societe,
|
||||
'__ADDRESS__'=>$msgishtml?dol_htmlentitiesbr($this->address):$this->address,
|
||||
'__ZIP__'=>$msgishtml?dol_htmlentitiesbr($this->zip):$this->zip,
|
||||
'__TOWN_'=>$msgishtml?dol_htmlentitiesbr($this->town):$this->town,
|
||||
'__COUNTRY__'=>$msgishtml?dol_htmlentitiesbr($this->country):$this->country,
|
||||
'__EMAIL__'=>$msgishtml?dol_htmlentitiesbr($this->email):$this->email,
|
||||
'__BIRTH__'=>$msgishtml?dol_htmlentitiesbr($birthday):$birthday,
|
||||
'__PHOTO__'=>$msgishtml?dol_htmlentitiesbr($this->photo):$this->photo,
|
||||
'__LOGIN__'=>$msgishtml?dol_htmlentitiesbr($this->login):$this->login,
|
||||
'__PASSWORD__'=>$msgishtml?dol_htmlentitiesbr($this->pass):$this->pass,
|
||||
// For backward compatibility
|
||||
'%DOL_MAIN_URL_ROOT%'=>DOL_MAIN_URL_ROOT,
|
||||
'%ID%'=>$msgishtml?dol_htmlentitiesbr($this->id):$this->id,
|
||||
'%CIVILITY%'=>$this->getCivilityLabel(),
|
||||
'%FIRSTNAME%'=>$msgishtml?dol_htmlentitiesbr($this->firstname):$this->firstname,
|
||||
'%LASTNAME%'=>$msgishtml?dol_htmlentitiesbr($this->lastname):$this->lastname,
|
||||
'%FULLNAME%'=>$msgishtml?dol_htmlentitiesbr($this->getFullName($langs)):$this->getFullName($langs),
|
||||
'%COMPANY%'=>$msgishtml?dol_htmlentitiesbr($this->societe):$this->societe,
|
||||
'%ADDRESS%'=>$msgishtml?dol_htmlentitiesbr($this->address):$this->address,
|
||||
'%ZIP%'=>$msgishtml?dol_htmlentitiesbr($this->zip):$this->zip,
|
||||
'%TOWN%'=>$msgishtml?dol_htmlentitiesbr($this->town):$this->town,
|
||||
'%COUNTRY%'=>$msgishtml?dol_htmlentitiesbr($this->country):$this->country,
|
||||
'%EMAIL%'=>$msgishtml?dol_htmlentitiesbr($this->email):$this->email,
|
||||
'%BIRTH%'=>$msgishtml?dol_htmlentitiesbr($birthday):$birthday,
|
||||
'%PHOTO%'=>$msgishtml?dol_htmlentitiesbr($this->photo):$this->photo,
|
||||
'%LOGIN%'=>$msgishtml?dol_htmlentitiesbr($this->login):$this->login,
|
||||
'%PASSWORD%'=>$msgishtml?dol_htmlentitiesbr($this->pass):$this->pass,
|
||||
'%TYPE%'=>$msgishtml?dol_htmlentitiesbr($this->type):$this->type,
|
||||
'%PHONE_PRO%'=>$msgishtml?dol_htmlentitiesbr($this->phone):$this->phone,
|
||||
'%PHONE_PERSO%'=>$msgishtml?dol_htmlentitiesbr($this->phone_perso):$this->phone_perso,
|
||||
'%PHONE_MOBILE%'=>$msgishtml?dol_htmlentitiesbr($this->phone_mobile):$this->phone_mobile,
|
||||
// For backward compatibility
|
||||
'%INFOS%'=>$msgishtml?dol_htmlentitiesbr($infos):$infos,
|
||||
'%SOCIETE%'=>$msgishtml?dol_htmlentitiesbr($this->societe):$this->societe,
|
||||
'%PRENOM%'=>$msgishtml?dol_htmlentitiesbr($this->firstname):$this->firstname,
|
||||
'%NOM%'=>$msgishtml?dol_htmlentitiesbr($this->lastname):$this->lastname,
|
||||
'%CP%'=>$msgishtml?dol_htmlentitiesbr($this->zip):$this->zip,
|
||||
'%VILLE%'=>$msgishtml?dol_htmlentitiesbr($this->town):$this->town,
|
||||
'%PAYS%'=>$msgishtml?dol_htmlentitiesbr($this->country):$this->country,
|
||||
'__CIVILITY__'=>$this->getCivilityLabel(),
|
||||
'__FIRSTNAME__'=>$msgishtml?dol_htmlentitiesbr($this->firstname):$this->firstname,
|
||||
'__LASTNAME__'=>$msgishtml?dol_htmlentitiesbr($this->lastname):$this->lastname,
|
||||
'__FULLNAME__'=>$msgishtml?dol_htmlentitiesbr($this->getFullName($langs)):$this->getFullName($langs),
|
||||
'__COMPANY__'=>$msgishtml?dol_htmlentitiesbr($this->societe):$this->societe,
|
||||
'__ADDRESS__'=>$msgishtml?dol_htmlentitiesbr($this->address):$this->address,
|
||||
'__ZIP__'=>$msgishtml?dol_htmlentitiesbr($this->zip):$this->zip,
|
||||
'__TOWN__'=>$msgishtml?dol_htmlentitiesbr($this->town):$this->town,
|
||||
'__COUNTRY__'=>$msgishtml?dol_htmlentitiesbr($this->country):$this->country,
|
||||
'__EMAIL__'=>$msgishtml?dol_htmlentitiesbr($this->email):$this->email,
|
||||
'__BIRTH__'=>$msgishtml?dol_htmlentitiesbr($birthday):$birthday,
|
||||
'__PHOTO__'=>$msgishtml?dol_htmlentitiesbr($this->photo):$this->photo,
|
||||
'__LOGIN__'=>$msgishtml?dol_htmlentitiesbr($this->login):$this->login,
|
||||
'__PASSWORD__'=>$msgishtml?dol_htmlentitiesbr($this->pass):$this->pass,
|
||||
'__PHONE__'=>$msgishtml?dol_htmlentitiesbr($this->phone):$this->phone,
|
||||
'__PHONEPRO__'=>$msgishtml?dol_htmlentitiesbr($this->phone_perso):$this->phone_perso,
|
||||
'__PHONEMOBILE__'=>$msgishtml?dol_htmlentitiesbr($this->phone_mobile):$this->phone_mobile,
|
||||
);
|
||||
|
||||
complete_substitutions_array($substitutionarray, $langs, $this);
|
||||
@ -1192,7 +1164,7 @@ class Adherent extends CommonObject
|
||||
// Load other properties
|
||||
$result=$this->fetch_subscriptions();
|
||||
|
||||
return $result;
|
||||
return $this->id;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@ -64,4 +64,5 @@ try {
|
||||
if ($trace[0]['args'][0] == 404) die('Bad ID');
|
||||
else if ($trace[0]['args'][0] == 401) die('Bad auth key');
|
||||
else die('Can not access to '.$conf->global->MAIN_MODULE_DOLISTORE_API_SRV);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -230,14 +230,14 @@ if ($action == 'edit') // Edit
|
||||
print '</tr>';
|
||||
|
||||
// Default language
|
||||
print '<tr class="oddeven"><td class="titlefield">'.$langs->trans("DefaultLanguage").'</td><td>';
|
||||
print '<tr><td class="titlefield">'.$langs->trans("DefaultLanguage").'</td><td>';
|
||||
print $formadmin->select_language($conf->global->MAIN_LANG_DEFAULT, 'MAIN_LANG_DEFAULT', 1, 0, 0, 0, 0, 'minwidth300');
|
||||
print '</td>';
|
||||
print '<td width="20"> </td>';
|
||||
print '</tr>';
|
||||
|
||||
// Multilingual GUI
|
||||
print '<tr class="oddeven"><td class="titlefield">'.$langs->trans("EnableMultilangInterface").'</td><td>';
|
||||
print '<tr><td class="titlefield">'.$langs->trans("EnableMultilangInterface").'</td><td>';
|
||||
print $form->selectyesno('MAIN_MULTILANGS',$conf->global->MAIN_MULTILANGS,1);
|
||||
print '</td>';
|
||||
print '<td width="20"> </td>';
|
||||
@ -349,9 +349,8 @@ if ($action == 'edit') // Edit
|
||||
print '</tr>';
|
||||
|
||||
// Message of the day on home page
|
||||
$substitutionarray=getCommonSubstitutionArray($langs, 0, array('object'));
|
||||
$substitutionarray=getCommonSubstitutionArray($langs, 0, array('object','objectamount'));
|
||||
complete_substitutions_array($substitutionarray, $langs);
|
||||
$substitutionarray['__(AnyTranslationKey)__']=$langs->trans('TranslationKey');
|
||||
|
||||
print '<tr><td class="titlefield">';
|
||||
$texthelp=$langs->trans("FollowingConstantsWillBeSubstituted").'<br>';
|
||||
@ -359,7 +358,7 @@ if ($action == 'edit') // Edit
|
||||
{
|
||||
$texthelp.=$key.'<br>';
|
||||
}
|
||||
print $form->textwithpicto($langs->trans("MessageOfDay"), $texthelp, 1, 'help', '', 0, 2, '');
|
||||
print $form->textwithpicto($langs->trans("MessageOfDay"), $texthelp, 1, 'help', '', 0, 2, 'tooltipmessageofday');
|
||||
|
||||
print '</td><td colspan="2">';
|
||||
|
||||
@ -379,16 +378,15 @@ if ($action == 'edit') // Edit
|
||||
print '</tr>';
|
||||
|
||||
// Message on login page
|
||||
$substitutionarray=getCommonSubstitutionArray($langs, 0, array('object','user'));
|
||||
$substitutionarray=getCommonSubstitutionArray($langs, 0, array('object','objectamount','user'));
|
||||
complete_substitutions_array($substitutionarray, $langs);
|
||||
$substitutionarray['__(AnyTranslationKey)__']=$langs->trans('TranslationKey');
|
||||
print '<tr><td>';
|
||||
$texthelp=$langs->trans("FollowingConstantsWillBeSubstituted").'<br>';
|
||||
foreach($substitutionarray as $key => $val)
|
||||
{
|
||||
$texthelp.=$key.'<br>';
|
||||
}
|
||||
print $form->textwithpicto($langs->trans("MessageLogin"), $texthelp, 1, 'help', '', 0, 2, '');
|
||||
print $form->textwithpicto($langs->trans("MessageLogin"), $texthelp, 1, 'help', '', 0, 2, 'tooltipmessagelogin');
|
||||
print '</td><td colspan="2">';
|
||||
$doleditor = new DolEditor('main_home', (isset($conf->global->MAIN_HOME)?$conf->global->MAIN_HOME:''), '', 142, 'dolibarr_notes', 'In', false, true, true, ROWS_4, '90%');
|
||||
$doleditor->Create();
|
||||
|
||||
@ -175,6 +175,7 @@ if ($conf->supplier_proposal->enabled) $elementList['supplier_proposal_send']=$l
|
||||
if ($conf->fournisseur->enabled) $elementList['order_supplier_send']=$langs->trans('MailToSendSupplierOrder');
|
||||
if ($conf->fournisseur->enabled) $elementList['invoice_supplier_send']=$langs->trans('MailToSendSupplierInvoice');
|
||||
if ($conf->societe->enabled) $elementList['thirdparty']=$langs->trans('MailToThirdparty');
|
||||
if ($conf->adherent->enabled) $elementList['member']=$langs->trans('MailToMember');
|
||||
if ($conf->contrat->enabled) $elementList['contract']=$langs->trans('MailToSendContract');
|
||||
$elementList['all']=$langs->trans('VisibleEverywhere');
|
||||
$elementList['none']=$langs->trans('VisibleNowhere');
|
||||
|
||||
@ -77,6 +77,8 @@ if ($action == 'setproductionmode')
|
||||
}
|
||||
}
|
||||
|
||||
dol_mkdir(DOL_DATA_ROOT.'/api/temp'); // May have been deleted by a purge
|
||||
|
||||
|
||||
/*
|
||||
* View
|
||||
|
||||
@ -48,7 +48,7 @@ class DolibarrApi
|
||||
*/
|
||||
function __construct($db, $cachedir='', $refreshCache=false)
|
||||
{
|
||||
global $conf;
|
||||
global $conf, $dolibarr_main_url_root;
|
||||
|
||||
if (empty($cachedir)) $cachedir = $conf->api->dir_temp;
|
||||
Defaults::$cacheDirectory = $cachedir;
|
||||
@ -56,7 +56,9 @@ class DolibarrApi
|
||||
$this->db = $db;
|
||||
$production_mode = ( empty($conf->global->API_PRODUCTION_MODE) ? false : true );
|
||||
$this->r = new Restler($production_mode, $refreshCache);
|
||||
|
||||
$urlwithouturlroot=preg_replace('/'.preg_quote(DOL_URL_ROOT,'/').'$/i','',trim($dolibarr_main_url_root));
|
||||
$urlwithroot=$urlwithouturlroot.DOL_URL_ROOT; // This is to use external domain name found into config file
|
||||
$this->r->setBaseUrls(DOL_MAIN_URL_ROOT, $urlwithroot);
|
||||
$this->r->setAPIVersion(1);
|
||||
}
|
||||
|
||||
|
||||
@ -824,7 +824,7 @@ if ($action == 'create')
|
||||
// Description
|
||||
print '<tr><td class="tdtop">'.$langs->trans("Description").'</td><td>';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
|
||||
$doleditor=new DolEditor('note',(GETPOST('note')?GETPOST('note'):$object->note),'',180,'dolibarr_notes','In',true,true,$conf->fckeditor->enabled,ROWS_5,'90%');
|
||||
$doleditor=new DolEditor('note',(GETPOST('note','none')?GETPOST('note','none'):$object->note),'',180,'dolibarr_notes','In',true,true,$conf->fckeditor->enabled,ROWS_5,'90%');
|
||||
$doleditor->Create();
|
||||
print '</td></tr>';
|
||||
|
||||
|
||||
@ -358,8 +358,8 @@ if (empty($reshook))
|
||||
$object->fk_project = GETPOST('projectid');
|
||||
$object->modelpdf = GETPOST('model');
|
||||
$object->author = $user->id; // deprecated
|
||||
$object->note_private = GETPOST('note_private');
|
||||
$object->note_public = GETPOST('note_public');
|
||||
$object->note_private = GETPOST('note_private','none');
|
||||
$object->note_public = GETPOST('note_public','none');
|
||||
$object->statut = Propal::STATUS_DRAFT;
|
||||
$object->fk_incoterms = GETPOST('incoterm_id', 'int');
|
||||
$object->location_incoterms = GETPOST('location_incoterms', 'alpha');
|
||||
@ -386,8 +386,8 @@ if (empty($reshook))
|
||||
$object->fk_project = GETPOST('projectid');
|
||||
$object->modelpdf = GETPOST('model');
|
||||
$object->author = $user->id; // deprecated
|
||||
$object->note_private = GETPOST('note_private');
|
||||
$object->note_public = GETPOST('note_public');
|
||||
$object->note_private = GETPOST('note_private','none');
|
||||
$object->note_public = GETPOST('note_public','none');
|
||||
$object->fk_incoterms = GETPOST('incoterm_id', 'int');
|
||||
$object->location_incoterms = GETPOST('location_incoterms', 'alpha');
|
||||
|
||||
@ -979,7 +979,7 @@ if (empty($reshook))
|
||||
$info_bits |= 0x01;
|
||||
|
||||
// Clean parameters
|
||||
$description = dol_htmlcleanlastbr(GETPOST('product_desc'));
|
||||
$description = dol_htmlcleanlastbr(GETPOST('product_desc','none'));
|
||||
|
||||
// Define vat_rate
|
||||
$vat_rate = (GETPOST('tva_tx') ? GETPOST('tva_tx') : 0);
|
||||
|
||||
@ -292,7 +292,7 @@ if ($socid > 0)
|
||||
print $form->load_tva('tva_tx',GETPOST('tva_tx'),$mysoc,$object);
|
||||
print '</td></tr>';
|
||||
print '<tr><td class="fieldrequired" >'.$langs->trans("NoteReason").'</td>';
|
||||
print '<td><input type="text" class="quatrevingtpercent" name="desc" value="'.GETPOST('desc').'"></td></tr>';
|
||||
print '<td><input type="text" class="quatrevingtpercent" name="desc" value="'.GETPOST('desc','none').'"></td></tr>';
|
||||
|
||||
print "</table>";
|
||||
}
|
||||
|
||||
@ -256,8 +256,8 @@ if (empty($reshook))
|
||||
$db->begin();
|
||||
|
||||
$object->date_commande = $datecommande;
|
||||
$object->note_private = GETPOST('note_private');
|
||||
$object->note_public = GETPOST('note_public');
|
||||
$object->note_private = GETPOST('note_private','none');
|
||||
$object->note_public = GETPOST('note_public','none');
|
||||
$object->source = GETPOST('source_id');
|
||||
$object->fk_project = GETPOST('projectid');
|
||||
$object->ref_client = GETPOST('ref_client');
|
||||
@ -927,7 +927,7 @@ if (empty($reshook))
|
||||
$date_end='';
|
||||
$date_start=dol_mktime(GETPOST('date_starthour'), GETPOST('date_startmin'), GETPOST('date_startsec'), GETPOST('date_startmonth'), GETPOST('date_startday'), GETPOST('date_startyear'));
|
||||
$date_end=dol_mktime(GETPOST('date_endhour'), GETPOST('date_endmin'), GETPOST('date_endsec'), GETPOST('date_endmonth'), GETPOST('date_endday'), GETPOST('date_endyear'));
|
||||
$description=dol_htmlcleanlastbr(GETPOST('product_desc'));
|
||||
$description=dol_htmlcleanlastbr(GETPOST('product_desc','none'));
|
||||
$pu_ht=GETPOST('price_ht');
|
||||
$vat_rate=(GETPOST('tva_tx')?GETPOST('tva_tx'):0);
|
||||
$pu_ht_devise = GETPOST('multicurrency_subprice');
|
||||
@ -1210,11 +1210,6 @@ if (empty($reshook))
|
||||
}
|
||||
}
|
||||
|
||||
// Actions to build doc
|
||||
$upload_dir = $conf->commande->dir_output;
|
||||
$permissioncreate = $user->rights->commande->creer;
|
||||
include DOL_DOCUMENT_ROOT.'/core/actions_builddoc.inc.php';
|
||||
|
||||
if ($action == 'update_extras')
|
||||
{
|
||||
// Fill array 'array_options' with data from update form
|
||||
@ -1254,6 +1249,11 @@ if (empty($reshook))
|
||||
// Actions when printing a doc from card
|
||||
include DOL_DOCUMENT_ROOT.'/core/actions_printing.inc.php';
|
||||
|
||||
// Actions to build doc
|
||||
$upload_dir = $conf->commande->dir_output;
|
||||
$permissioncreate = $user->rights->commande->creer;
|
||||
include DOL_DOCUMENT_ROOT.'/core/actions_builddoc.inc.php';
|
||||
|
||||
// Actions to send emails
|
||||
$trigger_name='ORDER_SENTBYMAIL';
|
||||
$paramname='id';
|
||||
|
||||
@ -743,7 +743,7 @@ if ($resql)
|
||||
|
||||
// Title
|
||||
$bankcateg=new BankCateg($db);
|
||||
$morehtml='<div data-role="fieldcontain">';
|
||||
$morehtml='<div>';
|
||||
$morehtml.= '<label for="pageplusone">'.$langs->trans("Page")."</label> "; // ' Page ';
|
||||
$morehtml.='<input type="text" name="pageplusone" id="pageplusone" size="1" class="flat" value="'.($page+1).'">';
|
||||
$morehtml.='/'.$nbtotalofpages.' ';
|
||||
|
||||
@ -1414,6 +1414,7 @@ if (empty($reshook))
|
||||
{
|
||||
$line->origin = $object->origin;
|
||||
$line->origin_id = $line->id;
|
||||
$line->fetch_optionals($line->id);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1435,7 +1436,21 @@ if (empty($reshook))
|
||||
|
||||
$object->situation_counter = $object->situation_counter + 1;
|
||||
$id = $object->createFromCurrent($user);
|
||||
if ($id <= 0) $mesg = $object->error;
|
||||
if ($id <= 0)
|
||||
{
|
||||
$mesg = $object->error;
|
||||
}
|
||||
else
|
||||
{
|
||||
$nextSituationInvoice = new Facture($db);
|
||||
$nextSituationInvoice->fetch($id);
|
||||
// create extrafields with data from create form
|
||||
$extralabels = $extrafields->fetch_name_optionals_label($nextSituationInvoice->table_element);
|
||||
$ret = $extrafields->setOptionalsFromPost($extralabels, $nextSituationInvoice);
|
||||
if ($ret > 0) {
|
||||
$nextSituationInvoice->insertExtraFields();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -1801,7 +1816,7 @@ if (empty($reshook))
|
||||
$date_end = '';
|
||||
$date_start = dol_mktime(GETPOST('date_starthour'), GETPOST('date_startmin'), GETPOST('date_startsec'), GETPOST('date_startmonth'), GETPOST('date_startday'), GETPOST('date_startyear'));
|
||||
$date_end = dol_mktime(GETPOST('date_endhour'), GETPOST('date_endmin'), GETPOST('date_endsec'), GETPOST('date_endmonth'), GETPOST('date_endday'), GETPOST('date_endyear'));
|
||||
$description = dol_htmlcleanlastbr(GETPOST('product_desc') ? GETPOST('product_desc') : GETPOST('desc'));
|
||||
$description = dol_htmlcleanlastbr(GETPOST('product_desc','none') ? GETPOST('product_desc','none') : GETPOST('desc','none'));
|
||||
$pu_ht = GETPOST('price_ht');
|
||||
$vat_rate = (GETPOST('tva_tx') ? GETPOST('tva_tx') : 0);
|
||||
$qty = GETPOST('qty');
|
||||
@ -2550,8 +2565,8 @@ if ($action == 'create')
|
||||
print $desc;
|
||||
|
||||
print '<div id="credit_note_options" class="clearboth">';
|
||||
print ' <input data-role="none" type="checkbox" name="invoiceAvoirWithLines" id="invoiceAvoirWithLines" value="1" onclick="if($(this).is(\':checked\') ) { $(\'#radio_creditnote\').prop(\'checked\', true); $(\'#invoiceAvoirWithPaymentRestAmount\').removeAttr(\'checked\'); }" '.(GETPOST('invoiceAvoirWithLines','int')>0 ? 'checked':'').' /> <label for="invoiceAvoirWithLines">'.$langs->trans('invoiceAvoirWithLines')."</label>";
|
||||
print '<br> <input data-role="none" type="checkbox" name="invoiceAvoirWithPaymentRestAmount" id="invoiceAvoirWithPaymentRestAmount" value="1" onclick="if($(this).is(\':checked\') ) { $(\'#radio_creditnote\').prop(\'checked\', true); $(\'#invoiceAvoirWithLines\').removeAttr(\'checked\'); }" '.(GETPOST('invoiceAvoirWithPaymentRestAmount','int')>0 ? 'checked':'').' /> <label for="invoiceAvoirWithPaymentRestAmount">'.$langs->trans('invoiceAvoirWithPaymentRestAmount')."</label>";
|
||||
print ' <input type="checkbox" name="invoiceAvoirWithLines" id="invoiceAvoirWithLines" value="1" onclick="if($(this).is(\':checked\') ) { $(\'#radio_creditnote\').prop(\'checked\', true); $(\'#invoiceAvoirWithPaymentRestAmount\').removeAttr(\'checked\'); }" '.(GETPOST('invoiceAvoirWithLines','int')>0 ? 'checked':'').' /> <label for="invoiceAvoirWithLines">'.$langs->trans('invoiceAvoirWithLines')."</label>";
|
||||
print '<br> <input type="checkbox" name="invoiceAvoirWithPaymentRestAmount" id="invoiceAvoirWithPaymentRestAmount" value="1" onclick="if($(this).is(\':checked\') ) { $(\'#radio_creditnote\').prop(\'checked\', true); $(\'#invoiceAvoirWithLines\').removeAttr(\'checked\'); }" '.(GETPOST('invoiceAvoirWithPaymentRestAmount','int')>0 ? 'checked':'').' /> <label for="invoiceAvoirWithPaymentRestAmount">'.$langs->trans('invoiceAvoirWithPaymentRestAmount')."</label>";
|
||||
print '</div>';
|
||||
|
||||
print '</div></div>';
|
||||
|
||||
@ -192,7 +192,7 @@ class Invoices extends DolibarrApi
|
||||
foreach($request_data as $field => $value) {
|
||||
$this->invoice->$field = $value;
|
||||
}
|
||||
if(! array_keys($request_data,'date')) {
|
||||
if(! array_key_exists('date', $request_data)) {
|
||||
$this->invoice->date = dol_now();
|
||||
}
|
||||
/* We keep lines as an array
|
||||
@ -276,6 +276,107 @@ class Invoices extends DolibarrApi
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get lines of a given invoice
|
||||
*
|
||||
* @param int $id Id of invoice
|
||||
*
|
||||
* @url GET {id}/lines
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
function getLines($id) {
|
||||
if(! DolibarrApiAccess::$user->rights->facture->lire) {
|
||||
throw new RestException(401);
|
||||
}
|
||||
|
||||
$result = $this->invoice->fetch($id);
|
||||
if( ! $result ) {
|
||||
throw new RestException(404, 'Invoice not found');
|
||||
}
|
||||
|
||||
if( ! DolibarrApi::_checkAccessToResource('facture',$this->invoice->id)) {
|
||||
throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login);
|
||||
}
|
||||
$this->invoice->getLinesArray();
|
||||
$result = array();
|
||||
foreach ($this->invoice->lines as $line) {
|
||||
array_push($result,$this->_cleanObjectDatas($line));
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Add a line to a given invoice
|
||||
*
|
||||
* Exemple of POST query : { "desc": "Desc", "subprice": "1.00000000", "qty": "1", "tva_tx": "20.000", "localtax1_tx": "0.000", "localtax2_tx": "0.000", "fk_product": "1", "remise_percent": "0", "date_start": "", "date_end": "", "fk_code_ventilation": 0, "info_bits": "0", "fk_remise_except": null, "product_type": "1", "rang": "-1", "special_code": "0", "fk_parent_line": null, "fk_fournprice": null, "pa_ht": "0.00000000", "label": "", "array_options": [], "situation_percent": "100", "fk_prev_id": null, "fk_unit": null }
|
||||
*
|
||||
* @param int $id Id of invoice
|
||||
* @param array $request_data Invoiceline data
|
||||
*
|
||||
* @url POST {id}/lines
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
function postLine($id, $request_data = NULL) {
|
||||
if(! DolibarrApiAccess::$user->rights->facture->creer) {
|
||||
throw new RestException(401);
|
||||
}
|
||||
|
||||
$result = $this->invoice->fetch($id);
|
||||
if( ! $result ) {
|
||||
throw new RestException(404, 'Invoice not found');
|
||||
}
|
||||
|
||||
if( ! DolibarrApi::_checkAccessToResource('facture',$this->invoice->id)) {
|
||||
throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login);
|
||||
}
|
||||
|
||||
$request_data = (object) $request_data;
|
||||
|
||||
// Reset fk_parent_line for no child products and special product
|
||||
if (($request_data->product_type != 9 && empty($request_data->fk_parent_line)) || $request_data->product_type == 9) {
|
||||
$request_data->fk_parent_line = 0;
|
||||
}
|
||||
|
||||
$updateRes = $this->invoice->addline(
|
||||
$request_data->desc,
|
||||
$request_data->subprice,
|
||||
$request_data->qty,
|
||||
$request_data->tva_tx,
|
||||
$request_data->localtax1_tx,
|
||||
$request_data->localtax2_tx,
|
||||
$request_data->fk_product,
|
||||
$request_data->remise_percent,
|
||||
$request_data->date_start,
|
||||
$request_data->date_end,
|
||||
$request_data->fk_code_ventilation,
|
||||
$request_data->info_bits,
|
||||
$request_data->fk_remise_except,
|
||||
'HT',
|
||||
0,
|
||||
$request_data->product_type,
|
||||
$request_data->rang,
|
||||
$request_data->special_code,
|
||||
'facture',
|
||||
$id,
|
||||
$request_data->fk_parent_line,
|
||||
$request_data->fk_fournprice,
|
||||
$request_data->pa_ht,
|
||||
$request_data->label,
|
||||
$request_data->array_options,
|
||||
$request_data->situation_percent,
|
||||
$request_data->fk_prev_id,
|
||||
$request_data->fk_unit
|
||||
);
|
||||
|
||||
if ($updateRes > 0) {
|
||||
return $this->get($id)->line->rowid;
|
||||
|
||||
}
|
||||
throw new RestException(400, 'Unable to insert the new line. Check your inputs.');
|
||||
}
|
||||
|
||||
/**
|
||||
* Validate an order
|
||||
*
|
||||
|
||||
@ -293,8 +293,8 @@ class Facture extends CommonInvoice
|
||||
|
||||
// Fields coming from GUI (priority on template). TODO Value of template should be used as default value on GUI so we can use here always value from GUI
|
||||
$this->fk_project = GETPOST('projectid','int') > 0 ? GETPOST('projectid','int') : $_facrec->fk_project;
|
||||
$this->note_public = GETPOST('note_public') ? GETPOST('note_public') : $_facrec->note_public;
|
||||
$this->note_private = GETPOST('note_private') ? GETPOST('note_private') : $_facrec->note_private;
|
||||
$this->note_public = GETPOST('note_public','none') ? GETPOST('note_public','none') : $_facrec->note_public;
|
||||
$this->note_private = GETPOST('note_private','none') ? GETPOST('note_private','none') : $_facrec->note_private;
|
||||
$this->modelpdf = GETPOST('model') ? GETPOST('model') : $_facrec->modelpdf;
|
||||
$this->cond_reglement_id = GETPOST('cond_reglement_id') > 0 ? GETPOST('cond_reglement_id') : $_facrec->cond_reglement_id;
|
||||
$this->mode_reglement_id = GETPOST('mode_reglement_id') > 0 ? GETPOST('mode_reglement_id') : $_facrec->mode_reglement_id;
|
||||
|
||||
@ -209,8 +209,8 @@ if (empty($reshook))
|
||||
if (! $error)
|
||||
{
|
||||
$object->titre = GETPOST('titre', 'alpha');
|
||||
$object->note_private = GETPOST('note_private');
|
||||
$object->note_public = GETPOST('note_public');
|
||||
$object->note_private = GETPOST('note_private','none');
|
||||
$object->note_public = GETPOST('note_public','none');
|
||||
$object->usenewprice = GETPOST('usenewprice');
|
||||
|
||||
$object->frequency = $frequency;
|
||||
@ -360,7 +360,7 @@ if (empty($reshook))
|
||||
// For triggers
|
||||
$line->id = $lineid;
|
||||
|
||||
if ($line->delete() > 0)
|
||||
if ($line->delete($user) > 0)
|
||||
{
|
||||
$result=$object->update_price(1);
|
||||
|
||||
@ -723,7 +723,7 @@ if (empty($reshook))
|
||||
$date_end = '';
|
||||
//$date_start = dol_mktime(GETPOST('date_starthour'), GETPOST('date_startmin'), GETPOST('date_startsec'), GETPOST('date_startmonth'), GETPOST('date_startday'), GETPOST('date_startyear'));
|
||||
//$date_end = dol_mktime(GETPOST('date_endhour'), GETPOST('date_endmin'), GETPOST('date_endsec'), GETPOST('date_endmonth'), GETPOST('date_endday'), GETPOST('date_endyear'));
|
||||
$description = dol_htmlcleanlastbr(GETPOST('product_desc') ? GETPOST('product_desc') : GETPOST('desc'));
|
||||
$description = dol_htmlcleanlastbr(GETPOST('product_desc','none') ? GETPOST('product_desc','none') : GETPOST('desc','none'));
|
||||
$pu_ht = GETPOST('price_ht');
|
||||
$vat_rate = (GETPOST('tva_tx') ? GETPOST('tva_tx') : 0);
|
||||
$qty = GETPOST('qty');
|
||||
@ -965,8 +965,8 @@ if ($action == 'create')
|
||||
print '<tr><td class="titlefieldcreate">'.$langs->trans("Customer").'</td><td>'.$object->thirdparty->getNomUrl(1,'customer').'</td>';
|
||||
print '</tr>';
|
||||
|
||||
$note_public=GETPOST('note_public')?GETPOST('note_public'):$object->note_public;
|
||||
$note_private=GETPOST('note_private')?GETPOST('note_private'):$object->note_private;
|
||||
$note_public=GETPOST('note_public','none')?GETPOST('note_public','none'):$object->note_public;
|
||||
$note_private=GETPOST('note_private','none')?GETPOST('note_private','none'):$object->note_private;
|
||||
|
||||
// Help of substitution key
|
||||
$substitutionarray=array(
|
||||
|
||||
@ -60,7 +60,7 @@ if ($action == 'setnote' && $user->rights->facture->paiement)
|
||||
$db->begin();
|
||||
|
||||
$object->fetch($id);
|
||||
$result = $object->update_note(GETPOST('note'));
|
||||
$result = $object->update_note(GETPOST('note','none'));
|
||||
if ($result > 0)
|
||||
{
|
||||
$db->commit();
|
||||
|
||||
@ -676,7 +676,7 @@ if (empty($reshook))
|
||||
|
||||
$fk_unit = GETPOST('unit', 'alpha');
|
||||
|
||||
$objectline->description=GETPOST('product_desc');
|
||||
$objectline->description=GETPOST('product_desc','none');
|
||||
$objectline->price_ht=GETPOST('elprice');
|
||||
$objectline->subprice=GETPOST('elprice');
|
||||
$objectline->qty=GETPOST('elqty');
|
||||
@ -918,51 +918,17 @@ if (empty($reshook))
|
||||
}
|
||||
}
|
||||
|
||||
// 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','aZ09') ? GETPOST('lang_id','aZ09') : $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)
|
||||
{
|
||||
setEventMessages($object->error, $object->errors, 'errors');
|
||||
$action='';
|
||||
}
|
||||
}
|
||||
|
||||
// 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) setEventMessages($langs->trans("FileWasRemoved", GETPOST('file')), null, 'mesgs');
|
||||
else setEventMessages($langs->trans("ErrorFailToDeleteFile", GETPOST('file')), null, 'errors');
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Send mail
|
||||
*/
|
||||
// Actions to build doc
|
||||
$upload_dir = $conf->contrat->dir_output;
|
||||
$permissioncreate = $user->rights->contrat->creer;
|
||||
include DOL_DOCUMENT_ROOT.'/core/actions_builddoc.inc.php';
|
||||
|
||||
// Actions to send emails
|
||||
$trigger_name='CONTRACT_SENTBYMAIL';
|
||||
$paramname='id';
|
||||
$mode='emailfromcontract';
|
||||
$trackid='cont'.$object->id;
|
||||
$trackid='con'.$object->id;
|
||||
include DOL_DOCUMENT_ROOT.'/core/actions_sendmails.inc.php';
|
||||
|
||||
|
||||
@ -2164,138 +2130,13 @@ else
|
||||
print '</div></div></div>';
|
||||
}
|
||||
|
||||
/*
|
||||
* Action presend
|
||||
*/
|
||||
if ($action == 'presend')
|
||||
{
|
||||
$object->fetch_projet();
|
||||
|
||||
$ref = dol_sanitizeFileName($object->ref);
|
||||
include_once DOL_DOCUMENT_ROOT . '/core/lib/files.lib.php';
|
||||
$fileparams = dol_most_recent_file($conf->contrat->dir_output . '/' . $ref, preg_quote($ref, '/').'[^\-]+');
|
||||
$file = $fileparams['fullname'];
|
||||
|
||||
// Define output language
|
||||
$outputlangs = $langs;
|
||||
$newlang = '';
|
||||
if ($conf->global->MAIN_MULTILANGS && empty($newlang) && ! empty($_REQUEST['lang_id']))
|
||||
$newlang = $_REQUEST['lang_id'];
|
||||
if ($conf->global->MAIN_MULTILANGS && empty($newlang))
|
||||
$newlang = $object->thirdparty->default_lang;
|
||||
|
||||
if (!empty($newlang))
|
||||
{
|
||||
$outputlangs = new Translate('', $conf);
|
||||
$outputlangs->setDefaultLang($newlang);
|
||||
$outputlangs->load('commercial');
|
||||
}
|
||||
|
||||
// Build document if it not exists
|
||||
if (! $file || ! is_readable($file)) {
|
||||
$result = $object->generateDocument(GETPOST('model') ? GETPOST('model') : $object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref);
|
||||
if ($result <= 0) {
|
||||
dol_print_error($db, $object->error, $object->errors);
|
||||
exit();
|
||||
}
|
||||
$fileparams = dol_most_recent_file($conf->contrat->dir_output . '/' . $ref, preg_quote($ref, '/').'[^\-]+');
|
||||
$file = $fileparams['fullname'];
|
||||
}
|
||||
|
||||
print '<div id="formmailbeforetitle" name="formmailbeforetitle"></div>';
|
||||
print '<div class="clearboth"></div>';
|
||||
print '<br>';
|
||||
print load_fiche_titre($langs->trans('SendByMail'));
|
||||
|
||||
dol_fiche_head('');
|
||||
|
||||
// Cree l'objet formulaire mail
|
||||
include_once DOL_DOCUMENT_ROOT . '/core/class/html.formmail.class.php';
|
||||
$formmail = new FormMail($db);
|
||||
$formmail->param['langsmodels']=(empty($newlang)?$langs->defaultlang:$newlang);
|
||||
$formmail->fromtype = (GETPOST('fromtype')?GETPOST('fromtype'):(!empty($conf->global->MAIN_MAIL_DEFAULT_FROMTYPE)?$conf->global->MAIN_MAIL_DEFAULT_FROMTYPE:'user'));
|
||||
|
||||
if($formmail->fromtype === 'user'){
|
||||
$formmail->fromid = $user->id;
|
||||
|
||||
}
|
||||
$formmail->trackid='cont'.$object->id;
|
||||
if (! empty($conf->global->MAIN_EMAIL_ADD_TRACK_ID) && ($conf->global->MAIN_EMAIL_ADD_TRACK_ID & 2)) // If bit 2 is set
|
||||
{
|
||||
include DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
|
||||
$formmail->frommail=dolAddEmailTrackId($formmail->frommail, 'ord'.$object->id);
|
||||
}
|
||||
$formmail->withfrom = 1;
|
||||
$liste = array();
|
||||
foreach ($object->thirdparty->thirdparty_and_contact_email_array(1) as $key => $value)
|
||||
$liste [$key] = $value;
|
||||
$formmail->withto = GETPOST('sendto') ? GETPOST('sendto') : $liste;
|
||||
$formmail->withtocc = $liste;
|
||||
$formmail->withtoccc = $conf->global->MAIN_EMAIL_USECCC;
|
||||
if (empty($object->ref_client)) {
|
||||
$formmail->withtopic = $outputlangs->trans('SendContractRef', '__CONTRACTREF__');
|
||||
} else if (! empty($object->ref_client)) {
|
||||
$formmail->withtopic = $outputlangs->trans('SendContractRef', '__CONTRACTREF__ (__REFCLIENT__)');
|
||||
}
|
||||
$formmail->withfile = 2;
|
||||
$formmail->withbody = 1;
|
||||
$formmail->withdeliveryreceipt = 1;
|
||||
$formmail->withcancel = 1;
|
||||
// Array of substitutions
|
||||
$formmail->setSubstitFromObject($object);
|
||||
$dateplannedstart='';
|
||||
$datenextexpiration='';
|
||||
foreach($object->lines as $line)
|
||||
{
|
||||
if ($line->date_ouverture_prevue > $dateplannedstart) $dateplannedstart = $line->date_ouverture_prevue;
|
||||
if ($line->statut == 4 && $line->date_fin_prevue && (! $datenextexpiration || $line->date_fin_prevue < $datenextexpiration)) $datenextexpiration = $line->date_fin_prevue;
|
||||
}
|
||||
$formmail->substit['__CONTRACT_HIGHEST_PLANNED_START_DATE__'] = dol_print_date($dateplannedstart, 'dayrfc');
|
||||
$formmail->substit['__CONTRACT_HIGHEST_PLANNED_START_DATETIME__'] = dol_print_date($dateplannedstart, 'standard');
|
||||
$formmail->substit['__CONTRACT_LOWEST_EXPIRATION_DATE__'] = dol_print_date($datenextexpiration, 'dayrfc');
|
||||
$formmail->substit['__CONTRACT_LOWEST_EXPIRATION_DATETIME__'] = dol_print_date($datenextexpiration, 'standard');
|
||||
$formmail->substit['__PERSONALIZED__']=''; // deprecated
|
||||
$formmail->substit['__CONTACTCIVNAME__']='';
|
||||
|
||||
$custcontact = '';
|
||||
$contactarr = array();
|
||||
$contactarr = $object->liste_contact(- 1, 'external');
|
||||
|
||||
if (is_array($contactarr) && count($contactarr) > 0)
|
||||
{
|
||||
foreach ($contactarr as $contact)
|
||||
{
|
||||
if ($contact['libelle'] == $langs->trans('TypeContact_contract_external_CUSTOMER')) { // TODO Use code and not label
|
||||
$contactstatic = new Contact($db);
|
||||
$contactstatic->fetch($contact['id']);
|
||||
$custcontact = $contactstatic->getFullName($langs, 1);
|
||||
}
|
||||
}
|
||||
|
||||
if (! empty($custcontact)) {
|
||||
$formmail->substit['__CONTACTCIVNAME__'] = $custcontact;
|
||||
}
|
||||
}
|
||||
|
||||
// Tableau des parametres complementaires
|
||||
$formmail->param['action'] = 'send';
|
||||
$formmail->param['models'] = 'contract';
|
||||
$formmail->param['models_id']=GETPOST('modelmailselected','int');
|
||||
$formmail->param['contractid'] = $object->id;
|
||||
$formmail->param['returnurl'] = $_SERVER["PHP_SELF"] . '?id=' . $object->id;
|
||||
|
||||
// Init list of files
|
||||
if (GETPOST("mode") == 'init') {
|
||||
$formmail->clear_attached_files();
|
||||
$formmail->add_attached_files($file, basename($file), dol_mimetype($file));
|
||||
}
|
||||
|
||||
// Show form
|
||||
print $formmail->get_form();
|
||||
|
||||
dol_fiche_end();
|
||||
}
|
||||
// Presend form
|
||||
$modelmail='contract';
|
||||
$defaulttopic='SendContractRef';
|
||||
$diroutput = $conf->contrat->dir_output;
|
||||
$trackid = 'con'.$object->id;
|
||||
|
||||
include DOL_DOCUMENT_ROOT.'/core/tpl/card_presend.tpl.php';
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -47,6 +47,7 @@ $confirm=GETPOST('confirm','alpha');
|
||||
$toselect = GETPOST('toselect', 'array');
|
||||
|
||||
$search_name=GETPOST('search_name');
|
||||
$search_email=GETPOST('search_email');
|
||||
$search_town=GETPOST('search_town','alpha');
|
||||
$search_zip=GETPOST('search_zip','alpha');
|
||||
$search_state=trim(GETPOST("search_state"));
|
||||
@ -116,7 +117,8 @@ $arrayfields=array(
|
||||
'c.ref_customer'=>array('label'=>$langs->trans("RefCustomer"), 'checked'=>1),
|
||||
'c.ref_supplier'=>array('label'=>$langs->trans("RefSupplier"), 'checked'=>1),
|
||||
's.nom'=>array('label'=>$langs->trans("ThirdParty"), 'checked'=>1),
|
||||
's.town'=>array('label'=>$langs->trans("Town"), 'checked'=>0),
|
||||
's.email'=>array('label'=>$langs->trans("ThirdPartyEmail"), 'checked'=>0),
|
||||
's.town'=>array('label'=>$langs->trans("Town"), 'checked'=>0),
|
||||
's.zip'=>array('label'=>$langs->trans("Zip"), 'checked'=>0),
|
||||
'state.nom'=>array('label'=>$langs->trans("StateShort"), 'checked'=>0),
|
||||
'country.code_iso'=>array('label'=>$langs->trans("Country"), 'checked'=>0),
|
||||
@ -156,7 +158,8 @@ if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter.x',
|
||||
$month='';
|
||||
$year='';
|
||||
$search_name="";
|
||||
$search_town='';
|
||||
$search_email="";
|
||||
$search_town='';
|
||||
$search_zip="";
|
||||
$search_state="";
|
||||
$search_type='';
|
||||
@ -199,7 +202,7 @@ llxHeader('', $langs->trans("Contracts"));
|
||||
|
||||
$sql = 'SELECT';
|
||||
$sql.= " c.rowid, c.ref, c.datec as date_creation, c.tms as date_update, c.date_contrat, c.statut, c.ref_customer, c.ref_supplier, c.note_private, c.note_public,";
|
||||
$sql.= ' s.rowid as socid, s.nom as name, s.town, s.zip, s.fk_pays, s.client, s.code_client,';
|
||||
$sql.= ' s.rowid as socid, s.nom as name, s.email, s.town, s.zip, s.fk_pays, s.client, s.code_client,';
|
||||
$sql.= " typent.code as typent_code,";
|
||||
$sql.= " state.code_departement as state_code, state.nom as state_name,";
|
||||
$sql.= ' SUM('.$db->ifsql("cd.statut=0",1,0).') as nb_initial,';
|
||||
@ -246,6 +249,7 @@ else if ($year > 0)
|
||||
$sql.= " AND c.date_contrat BETWEEN '".$db->idate(dol_get_first_day($year,1,false))."' AND '".$db->idate(dol_get_last_day($year,12,false))."'";
|
||||
}
|
||||
if ($search_name) $sql .= natural_search('s.nom', $search_name);
|
||||
if ($search_email) $sql .= natural_search('s.email', $search_name);
|
||||
if ($search_contract) $sql .= natural_search(array('c.rowid', 'c.ref'), $search_contract);
|
||||
if (!empty($search_ref_customer)) $sql .= natural_search(array('c.ref_customer'), $search_ref_customer);
|
||||
if (!empty($search_ref_supplier)) $sql .= natural_search(array('c.ref_supplier'), $search_ref_supplier);
|
||||
@ -275,7 +279,7 @@ $reshook=$hookmanager->executeHooks('printFieldListWhere',$parameters); // No
|
||||
$sql.=$hookmanager->resPrint;
|
||||
|
||||
$sql.= " GROUP BY c.rowid, c.ref, c.datec, c.tms, c.date_contrat, c.statut, c.ref_customer, c.ref_supplier, c.note_private, c.note_public,";
|
||||
$sql.= ' s.rowid, s.nom, s.town, s.zip, s.fk_pays, s.client, s.code_client,';
|
||||
$sql.= ' s.rowid, s.nom, s.email, s.town, s.zip, s.fk_pays, s.client, s.code_client,';
|
||||
$sql.= " typent.code,";
|
||||
$sql.= " state.code_departement, state.nom";
|
||||
// Add fields from extrafields
|
||||
@ -324,6 +328,7 @@ if ($resql)
|
||||
if ($sall != '') $param.='&sall='.$sall;
|
||||
if ($search_contract != '') $param.='&search_contract='.$search_contract;
|
||||
if ($search_name != '') $param.='&search_name='.$search_name;
|
||||
if ($search_email != '') $param.='&search_email='.$search_email;
|
||||
if ($search_ref_supplier != '') $param.='&search_ref_supplier='.$search_ref_supplier;
|
||||
if ($search_sale != '') $param.='&search_sale=' .$search_sale;
|
||||
if ($show_files) $param.='&show_files=' .$show_files;
|
||||
@ -446,6 +451,12 @@ if ($resql)
|
||||
print '<input type="text" class="flat" size="8" name="search_name" value="'.dol_escape_htmltag($search_name).'">';
|
||||
print '</td>';
|
||||
}
|
||||
if (! empty($arrayfields['s.email']['checked']))
|
||||
{
|
||||
print '<td class="liste_titre">';
|
||||
print '<input type="text" class="flat" size="6" name="search_email" value="'.dol_escape_htmltag($search_email).'">';
|
||||
print '</td>';
|
||||
}
|
||||
// Town
|
||||
if (! empty($arrayfields['s.town']['checked'])) print '<td class="liste_titre"><input class="flat" type="text" size="6" name="search_town" value="'.$search_town.'"></td>';
|
||||
// Zip
|
||||
@ -542,7 +553,8 @@ if ($resql)
|
||||
if (! empty($arrayfields['c.ref_customer']['checked'])) print_liste_field_titre($arrayfields['c.ref_customer']['label'], $_SERVER["PHP_SELF"], "c.ref_customer","","$param",'',$sortfield,$sortorder);
|
||||
if (! empty($arrayfields['c.ref_supplier']['checked'])) print_liste_field_titre($arrayfields['c.ref_supplier']['label'], $_SERVER["PHP_SELF"], "c.ref_supplier","","$param",'',$sortfield,$sortorder);
|
||||
if (! empty($arrayfields['s.nom']['checked'])) print_liste_field_titre($arrayfields['s.nom']['label'], $_SERVER["PHP_SELF"], "s.nom","","$param",'',$sortfield,$sortorder);
|
||||
if (! empty($arrayfields['s.town']['checked'])) print_liste_field_titre($arrayfields['s.town']['label'],$_SERVER["PHP_SELF"],'s.town','',$param,'',$sortfield,$sortorder);
|
||||
if (! empty($arrayfields['s.email']['checked'])) print_liste_field_titre($arrayfields['s.email']['label'], $_SERVER["PHP_SELF"], "s.email","","$param",'',$sortfield,$sortorder);
|
||||
if (! empty($arrayfields['s.town']['checked'])) print_liste_field_titre($arrayfields['s.town']['label'],$_SERVER["PHP_SELF"],'s.town','',$param,'',$sortfield,$sortorder);
|
||||
if (! empty($arrayfields['s.zip']['checked'])) print_liste_field_titre($arrayfields['s.zip']['label'],$_SERVER["PHP_SELF"],'s.zip','',$param,'',$sortfield,$sortorder);
|
||||
if (! empty($arrayfields['state.nom']['checked'])) print_liste_field_titre($arrayfields['state.nom']['label'],$_SERVER["PHP_SELF"],"state.nom","",$param,'',$sortfield,$sortorder);
|
||||
if (! empty($arrayfields['country.code_iso']['checked'])) print_liste_field_titre($arrayfields['country.code_iso']['label'],$_SERVER["PHP_SELF"],"country.code_iso","",$param,'align="center"',$sortfield,$sortorder);
|
||||
@ -621,6 +633,10 @@ if ($resql)
|
||||
{
|
||||
print '<td><a href="../comm/card.php?socid='.$obj->socid.'">'.img_object($langs->trans("ShowCompany"),"company").' '.$obj->name.'</a></td>';
|
||||
}
|
||||
if (! empty($arrayfields['s.email']['checked']))
|
||||
{
|
||||
print '<td>'.$obj->email.'</td>';
|
||||
}
|
||||
// Town
|
||||
if (! empty($arrayfields['s.town']['checked']))
|
||||
{
|
||||
|
||||
@ -104,7 +104,7 @@ if (! $error && $massaction == 'confirm_presend')
|
||||
if (empty($receiver) || $receiver == '-1') $receiver=array();
|
||||
else $receiver=array($receiver);
|
||||
}
|
||||
if (count($receiver) == 0 && count($listofobjectthirdparties) == 1) // if only one recipient, receiver is mandatory
|
||||
if (! trim($_POST['sendto']) && count($receiver) == 0 && count($listofobjectthirdparties) == 1) // if only one recipient, receiver is mandatory
|
||||
{
|
||||
$error++;
|
||||
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Recipient")), null, 'warnings');
|
||||
@ -322,114 +322,129 @@ if (! $error && $massaction == 'confirm_presend')
|
||||
if ($objectclass == 'CommandeFournisseur') $sendtocc = (empty($conf->global->MAIN_MAIL_AUTOCOPY_SUPPLIER_ORDER_TO)?'':$conf->global->MAIN_MAIL_AUTOCOPY_SUPPLIER_ORDER_TO);
|
||||
if ($objectclass == 'FactureFournisseur') $sendtocc = (empty($conf->global->MAIN_MAIL_AUTOCOPY_SUPPLIER_INVOICE_TO)?'':$conf->global->MAIN_MAIL_AUTOCOPY_SUPPLIER_INVOICE_TO);
|
||||
|
||||
$objecttmp=new $objectclass($db);
|
||||
$objecttmp->thirdparty = $thirdparty;
|
||||
|
||||
// Make substitution in email content
|
||||
$substitutionarray=getCommonSubstitutionArray($langs, 0, null, $objecttmp);
|
||||
$substitutionarray['__ID__'] = join(', ',array_keys($listofqualifiedid));
|
||||
$substitutionarray['__EMAIL__'] = $thirdparty->email;
|
||||
$substitutionarray['__CHECK_READ__'] = '<img src="'.DOL_MAIN_URL_ROOT.'/public/emailing/mailing-read.php?tag='.$thirdparty->tag.'&securitykey='.urlencode($conf->global->MAILING_EMAIL_UNSUBSCRIBE_KEY).'" width="1" height="1" style="width:1px;height:1px" border="0"/>';
|
||||
$substitutionarray['__REF__'] = join(', ',$listofqualifiedref);
|
||||
|
||||
$parameters=array('mode'=>'formemail');
|
||||
complete_substitutions_array($substitutionarray, $langs, $objecttmp, $parameters);
|
||||
|
||||
$subject=make_substitutions($subject, $substitutionarray);
|
||||
$message=make_substitutions($message, $substitutionarray);
|
||||
|
||||
$filepath = $attachedfiles['paths'];
|
||||
$filename = $attachedfiles['names'];
|
||||
$mimetype = $attachedfiles['mimes'];
|
||||
|
||||
//var_dump($filepath);
|
||||
|
||||
// Send mail (substitutionarray must be done just before this)
|
||||
require_once(DOL_DOCUMENT_ROOT.'/core/class/CMailFile.class.php');
|
||||
$mailfile = new CMailFile($subject,$sendto,$from,$message,$filepath,$mimetype,$filename,$sendtocc,$sendtobcc,$deliveryreceipt,-1);
|
||||
if ($mailfile->error)
|
||||
// $listofqualifiedid is array with key = object id of qualified objects for the current thirdparty
|
||||
$oneemailperrecipient=(GETPOST('oneemailperrecipient')=='on'?1:0);
|
||||
$looparray=array();
|
||||
if (! $oneemailperrecipient)
|
||||
{
|
||||
$resaction.='<div class="error">'.$mailfile->error.'</div>';
|
||||
$looparray = $listofqualifiedid;
|
||||
}
|
||||
else
|
||||
{
|
||||
$result=$mailfile->sendfile();
|
||||
if ($result)
|
||||
{
|
||||
$resaction.=$langs->trans('MailSuccessfulySent',$mailfile->getValidAddress($from,2),$mailfile->getValidAddress($sendto,2)).'<br>'; // Must not contain "
|
||||
|
||||
$error=0;
|
||||
|
||||
// Insert logs into agenda
|
||||
foreach($listofqualifiedid as $objid => $object)
|
||||
{
|
||||
/*if ($objectclass == 'Propale') $actiontypecode='AC_PROP';
|
||||
if ($objectclass == 'Commande') $actiontypecode='AC_COM';
|
||||
if ($objectclass == 'Facture') $actiontypecode='AC_FAC';
|
||||
if ($objectclass == 'Supplier_Proposal') $actiontypecode='AC_SUP_PRO';
|
||||
if ($objectclass == 'CommandeFournisseur') $actiontypecode='AC_SUP_ORD';
|
||||
if ($objectclass == 'FactureFournisseur') $actiontypecode='AC_SUP_INV';*/
|
||||
|
||||
$actionmsg=$langs->transnoentities('MailSentBy').' '.$from.' '.$langs->transnoentities('To').' '.$sendto;
|
||||
if ($message)
|
||||
{
|
||||
if ($sendtocc) $actionmsg = dol_concatdesc($actionmsg, $langs->transnoentities('Bcc') . ": " . $sendtocc);
|
||||
$actionmsg = dol_concatdesc($actionmsg, $langs->transnoentities('MailTopic') . ": " . $subject);
|
||||
$actionmsg = dol_concatdesc($actionmsg, $langs->transnoentities('TextUsedInTheMessageBody') . ":");
|
||||
$actionmsg = dol_concatdesc($actionmsg, $message);
|
||||
}
|
||||
$actionmsg2='';
|
||||
|
||||
// Initialisation donnees
|
||||
$object->sendtoid = 0;
|
||||
$object->actionmsg = $actionmsg; // Long text
|
||||
$object->actionmsg2 = $actionmsg2; // Short text
|
||||
$object->fk_element = $objid;
|
||||
$object->elementtype = $object->element;
|
||||
|
||||
$triggername = strtoupper(get_class($object)) .'_SENTBYMAIL';
|
||||
if ($triggername == 'SOCIETE_SENTBYMAIL') $triggername = 'COMPANY_SENTBYEMAIL';
|
||||
if ($triggername == 'CONTRAT_SENTBYMAIL') $triggername = 'CONTRACT_SENTBYEMAIL';
|
||||
if ($triggername == 'COMMANDE_SENTBYMAIL') $triggername = 'ORDER_SENTBYEMAIL';
|
||||
if ($triggername == 'FACTURE_SENTBYMAIL') $triggername = 'BILL_SENTBYEMAIL';
|
||||
if ($triggername == 'EXPEDITION_SENTBYMAIL') $triggername = 'SHIPPING_SENTBYEMAIL';
|
||||
if ($triggername == 'COMMANDEFOURNISSEUR_SENTBYMAIL') $triggername = 'ORDER_SUPPLIER_SENTBYMAIL';
|
||||
if ($triggername == 'FACTUREFOURNISSEUR_SENTBYMAIL') $triggername = 'BILL_SUPPLIER_SENTBYEMAIL';
|
||||
if ($triggername == 'SUPPLIERPROPOSAL_SENTBYMAIL') $triggername = 'PROPOSAL_SUPPLIER_SENTBYEMAIL';
|
||||
|
||||
if (! empty($trigger_name))
|
||||
{
|
||||
// Appel des triggers
|
||||
include_once(DOL_DOCUMENT_ROOT . "/core/class/interfaces.class.php");
|
||||
$interface=new Interfaces($db);
|
||||
$result=$interface->run_triggers($trigger_name, $object, $user, $langs, $conf);
|
||||
if ($result < 0) { $error++; $errors=$interface->errors; }
|
||||
// Fin appel triggers
|
||||
|
||||
if ($error)
|
||||
{
|
||||
setEventMessages($db->lasterror(), $errors, 'errors');
|
||||
dol_syslog("Error in trigger ".$trigger_name.' '.$db->lasterror(), LOG_ERR);
|
||||
}
|
||||
}
|
||||
|
||||
$nbsent++;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$langs->load("other");
|
||||
if ($mailfile->error)
|
||||
{
|
||||
$resaction.=$langs->trans('ErrorFailedToSendMail',$from,$sendto);
|
||||
$resaction.='<br><div class="error">'.$mailfile->error.'</div>';
|
||||
}
|
||||
else
|
||||
{
|
||||
$resaction.='<div class="warning">No mail sent. Feature is disabled by option MAIN_DISABLE_ALL_MAILS</div>';
|
||||
}
|
||||
}
|
||||
$objectforloop=new $objectclass($db);
|
||||
$objectforloop->thirdparty = $thirdparty;
|
||||
$looparray[0]=$objectforloop;
|
||||
}
|
||||
//var_dump($looparray);exit;
|
||||
|
||||
foreach ($looparray as $objecttmp) // $objecttmp is a real object or an empty if we choose to send one email per thirdparty instead of per record
|
||||
{
|
||||
// Make substitution in email content
|
||||
$substitutionarray=getCommonSubstitutionArray($langs, 0, null, $objecttmp);
|
||||
$substitutionarray['__ID__'] = ($oneemailperrecipient ? join(', ',array_keys($listofqualifiedid)) : $objecttmp->id);
|
||||
$substitutionarray['__REF__'] = ($oneemailperrecipient ? join(', ',$listofqualifiedref) : $objecttmp->ref);
|
||||
$substitutionarray['__EMAIL__'] = $thirdparty->email;
|
||||
$substitutionarray['__CHECK_READ__'] = '<img src="'.DOL_MAIN_URL_ROOT.'/public/emailing/mailing-read.php?tag='.$thirdparty->tag.'&securitykey='.urlencode($conf->global->MAILING_EMAIL_UNSUBSCRIBE_KEY).'" width="1" height="1" style="width:1px;height:1px" border="0"/>';
|
||||
|
||||
$parameters=array('mode'=>'formemail');
|
||||
complete_substitutions_array($substitutionarray, $langs, $objecttmp, $parameters);
|
||||
|
||||
$subject=make_substitutions($subject, $substitutionarray);
|
||||
$message=make_substitutions($message, $substitutionarray);
|
||||
|
||||
$filepath = $attachedfiles['paths'];
|
||||
$filename = $attachedfiles['names'];
|
||||
$mimetype = $attachedfiles['mimes'];
|
||||
|
||||
//var_dump($filepath);
|
||||
|
||||
// Send mail (substitutionarray must be done just before this)
|
||||
require_once(DOL_DOCUMENT_ROOT.'/core/class/CMailFile.class.php');
|
||||
$mailfile = new CMailFile($subject,$sendto,$from,$message,$filepath,$mimetype,$filename,$sendtocc,$sendtobcc,$deliveryreceipt,-1);
|
||||
if ($mailfile->error)
|
||||
{
|
||||
$resaction.='<div class="error">'.$mailfile->error.'</div>';
|
||||
}
|
||||
else
|
||||
{
|
||||
$result=$mailfile->sendfile();
|
||||
if ($result)
|
||||
{
|
||||
$resaction.=$langs->trans('MailSuccessfulySent',$mailfile->getValidAddress($from,2),$mailfile->getValidAddress($sendto,2)).'<br>'; // Must not contain "
|
||||
|
||||
$error=0;
|
||||
|
||||
// Insert logs into agenda
|
||||
foreach($listofqualifiedid as $objid => $object)
|
||||
{
|
||||
/*if ($objectclass == 'Propale') $actiontypecode='AC_PROP';
|
||||
if ($objectclass == 'Commande') $actiontypecode='AC_COM';
|
||||
if ($objectclass == 'Facture') $actiontypecode='AC_FAC';
|
||||
if ($objectclass == 'Supplier_Proposal') $actiontypecode='AC_SUP_PRO';
|
||||
if ($objectclass == 'CommandeFournisseur') $actiontypecode='AC_SUP_ORD';
|
||||
if ($objectclass == 'FactureFournisseur') $actiontypecode='AC_SUP_INV';*/
|
||||
|
||||
$actionmsg=$langs->transnoentities('MailSentBy').' '.$from.' '.$langs->transnoentities('To').' '.$sendto;
|
||||
if ($message)
|
||||
{
|
||||
if ($sendtocc) $actionmsg = dol_concatdesc($actionmsg, $langs->transnoentities('Bcc') . ": " . $sendtocc);
|
||||
$actionmsg = dol_concatdesc($actionmsg, $langs->transnoentities('MailTopic') . ": " . $subject);
|
||||
$actionmsg = dol_concatdesc($actionmsg, $langs->transnoentities('TextUsedInTheMessageBody') . ":");
|
||||
$actionmsg = dol_concatdesc($actionmsg, $message);
|
||||
}
|
||||
$actionmsg2='';
|
||||
|
||||
// Initialisation donnees
|
||||
$object->sendtoid = 0;
|
||||
$object->actionmsg = $actionmsg; // Long text
|
||||
$object->actionmsg2 = $actionmsg2; // Short text
|
||||
$object->fk_element = $objid;
|
||||
$object->elementtype = $object->element;
|
||||
|
||||
$triggername = strtoupper(get_class($object)) .'_SENTBYMAIL';
|
||||
if ($triggername == 'SOCIETE_SENTBYMAIL') $triggername = 'COMPANY_SENTBYEMAIL';
|
||||
if ($triggername == 'CONTRAT_SENTBYMAIL') $triggername = 'CONTRACT_SENTBYEMAIL';
|
||||
if ($triggername == 'COMMANDE_SENTBYMAIL') $triggername = 'ORDER_SENTBYEMAIL';
|
||||
if ($triggername == 'FACTURE_SENTBYMAIL') $triggername = 'BILL_SENTBYEMAIL';
|
||||
if ($triggername == 'EXPEDITION_SENTBYMAIL') $triggername = 'SHIPPING_SENTBYEMAIL';
|
||||
if ($triggername == 'COMMANDEFOURNISSEUR_SENTBYMAIL') $triggername = 'ORDER_SUPPLIER_SENTBYMAIL';
|
||||
if ($triggername == 'FACTUREFOURNISSEUR_SENTBYMAIL') $triggername = 'BILL_SUPPLIER_SENTBYEMAIL';
|
||||
if ($triggername == 'SUPPLIERPROPOSAL_SENTBYMAIL') $triggername = 'PROPOSAL_SUPPLIER_SENTBYEMAIL';
|
||||
|
||||
if (! empty($trigger_name))
|
||||
{
|
||||
// Appel des triggers
|
||||
include_once(DOL_DOCUMENT_ROOT . "/core/class/interfaces.class.php");
|
||||
$interface=new Interfaces($db);
|
||||
$result=$interface->run_triggers($trigger_name, $object, $user, $langs, $conf);
|
||||
if ($result < 0) { $error++; $errors=$interface->errors; }
|
||||
// Fin appel triggers
|
||||
|
||||
if ($error)
|
||||
{
|
||||
setEventMessages($db->lasterror(), $errors, 'errors');
|
||||
dol_syslog("Error in trigger ".$trigger_name.' '.$db->lasterror(), LOG_ERR);
|
||||
}
|
||||
}
|
||||
|
||||
$nbsent++;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$langs->load("other");
|
||||
if ($mailfile->error)
|
||||
{
|
||||
$resaction.=$langs->trans('ErrorFailedToSendMail',$from,$sendto);
|
||||
$resaction.='<br><div class="error">'.$mailfile->error.'</div>';
|
||||
}
|
||||
else
|
||||
{
|
||||
$resaction.='<div class="warning">No mail sent. Feature is disabled by option MAIN_DISABLE_ALL_MAILS</div>';
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -18,8 +18,8 @@
|
||||
|
||||
/**
|
||||
* \file htdocs/core/actions_sendmails.inc.php
|
||||
* \brief Code for actions on sending mails from object page
|
||||
*/
|
||||
* \brief Code for actions on sending mails from object page
|
||||
*/
|
||||
|
||||
// $mysoc must be defined
|
||||
// $id must be defined
|
||||
@ -113,13 +113,18 @@ if (($action == 'send' || $action == 'relance') && ! $_POST['addfile'] && ! $_PO
|
||||
$result=$object->fetch($id);
|
||||
|
||||
$sendtosocid=0; // Thirdparty on object
|
||||
if (method_exists($object,"fetch_thirdparty") && $object->element != 'societe')
|
||||
if (method_exists($object,"fetch_thirdparty") && ! in_array($object->element, array('societe','member')))
|
||||
{
|
||||
$result=$object->fetch_thirdparty();
|
||||
if ($object->element == 'user' && $result == 0) $result=1; // Even if not found, we consider ok
|
||||
$thirdparty=$object->thirdparty;
|
||||
$sendtosocid=$thirdparty->id;
|
||||
}
|
||||
else if ($object->element == 'member')
|
||||
{
|
||||
$thirdparty=$object;
|
||||
if ($thirdparty->id > 0) $sendtosocid=$thirdparty->id;
|
||||
}
|
||||
else if ($object->element == 'societe')
|
||||
{
|
||||
$thirdparty=$object;
|
||||
@ -348,21 +353,6 @@ if (($action == 'send' || $action == 'relance') && ! $_POST['addfile'] && ! $_PO
|
||||
$substitutionarray=getCommonSubstitutionArray($langs, 0, null, $object);
|
||||
$substitutionarray['__EMAIL__'] = $sendto;
|
||||
$substitutionarray['__CHECK_READ__'] = (is_object($object) && is_object($object->thirdparty))?'<img src="'.DOL_MAIN_URL_ROOT.'/public/emailing/mailing-read.php?tag='.$object->thirdparty->tag.'&securitykey='.urlencode($conf->global->MAILING_EMAIL_UNSUBSCRIBE_KEY).'" width="1" height="1" style="width:1px;height:1px" border="0"/>':'';
|
||||
// Add specific substitution for contracts
|
||||
if (is_object($object) && $object->element == 'contrat' && is_array($object->lines))
|
||||
{
|
||||
$dateplannedstart='';
|
||||
$datenextexpiration='';
|
||||
foreach($object->lines as $line)
|
||||
{
|
||||
if ($line->date_ouverture_prevue > $dateplannedstart) $dateplannedstart = $line->date_ouverture_prevue;
|
||||
if ($line->statut == 4 && $line->date_fin_prevue && (! $datenextexpiration || $line->date_fin_prevue < $datenextexpiration)) $datenextexpiration = $line->date_fin_prevue;
|
||||
}
|
||||
$substitutionarray['__CONTRACT_HIGHEST_PLANNED_START_DATE__'] = dol_print_date($dateplannedstart, 'dayrfc');
|
||||
$substitutionarray['__CONTRACT_HIGHEST_PLANNED_START_DATETIME__'] = dol_print_date($dateplannedstart, 'standard');
|
||||
$substitutionarray['__CONTRACT_LOWEST_EXPIRATION_DATE__'] = dol_print_date($datenextexpiration, 'dayrfc');
|
||||
$substitutionarray['__CONTRACT_LOWEST_EXPIRATION_DATETIME__'] = dol_print_date($datenextexpiration, 'standard');
|
||||
}
|
||||
|
||||
$parameters=array('mode'=>'formemail');
|
||||
complete_substitutions_array($substitutionarray, $langs, $object, $parameters);
|
||||
@ -370,6 +360,12 @@ if (($action == 'send' || $action == 'relance') && ! $_POST['addfile'] && ! $_PO
|
||||
$subject=make_substitutions($subject, $substitutionarray);
|
||||
$message=make_substitutions($message, $substitutionarray);
|
||||
|
||||
if (method_exists($object, 'makeSubstitution'))
|
||||
{
|
||||
$subject = $object->makeSubstitution($subject);
|
||||
$message = $object->makeSubstitution($message);
|
||||
}
|
||||
|
||||
// Send mail (substitutionarray must be done just before this)
|
||||
if (empty($sendcontext)) $sendcontext = 'standard';
|
||||
$mailfile = new CMailFile($subject,$sendto,$from,$message,$filepath,$mimetype,$filename,$sendtocc,$sendtobcc,$deliveryreceipt,-1,'','',$trackid,'', $sendcontext);
|
||||
@ -485,7 +481,7 @@ if (($action == 'send' || $action == 'relance') && ! $_POST['addfile'] && ! $_PO
|
||||
else
|
||||
{
|
||||
$langs->load("other");
|
||||
setEventMessages($langs->trans('ErrorFailedToReadEntity',$object->element), null, 'errors');
|
||||
setEventMessages($langs->trans('ErrorFailedToReadObject',$object->element), null, 'errors');
|
||||
dol_syslog('Failed to read data of object id='.$object->id.' element='.$object->element);
|
||||
$action = 'presend';
|
||||
}
|
||||
|
||||
@ -32,7 +32,7 @@ if ($action == 'setnote_public' && ! empty($permissionnote) && ! GETPOST('cancel
|
||||
{
|
||||
if (empty($action) || ! is_object($object) || empty($id)) dol_print_error('','Include of actions_setnotes.inc.php was done but required variable was not set before');
|
||||
if (empty($object->id)) $object->fetch($id); // Fetch may not be already done
|
||||
$result=$object->update_note(dol_html_entity_decode(GETPOST('note_public'), ENT_QUOTES),'_public');
|
||||
$result=$object->update_note(dol_html_entity_decode(GETPOST('note_public', 'none'), ENT_QUOTES),'_public');
|
||||
if ($result < 0) setEventMessages($object->error, $object->errors, 'errors');
|
||||
}
|
||||
// Set public note
|
||||
@ -40,6 +40,6 @@ else if ($action == 'setnote_private' && ! empty($permissionnote) && ! GETPOST('
|
||||
{
|
||||
if (empty($action) || ! is_object($object) || empty($id)) dol_print_error('','Include of actions_setnotes.inc.php was done but required variable was not set before');
|
||||
if (empty($object->id)) $object->fetch($id); // Fetch may not be already done
|
||||
$result=$object->update_note(dol_html_entity_decode(GETPOST('note_private'), ENT_QUOTES),'_private');
|
||||
$result=$object->update_note(dol_html_entity_decode(GETPOST('note_private', 'none'), ENT_QUOTES),'_private');
|
||||
if ($result < 0) setEventMessages($object->error, $object->errors, 'errors');
|
||||
}
|
||||
|
||||
@ -435,7 +435,7 @@ class box_activity extends ModeleBoxes
|
||||
}
|
||||
|
||||
// Add the sum in the bottom of the boxes
|
||||
$this->info_box_contents[$line][0] = array('tr' => 'class="liste_total"');
|
||||
$this->info_box_contents[$line][0] = array('tr' => 'class="liste_total_wrap"');
|
||||
$this->info_box_contents[$line][1] = array('td' => 'align="left" class="liste_total" ', 'text' => $langs->trans("Total")." ".$textHead);
|
||||
$this->info_box_contents[$line][2] = array('td' => 'align="right" class="liste_total" ', 'text' => $totalnb);
|
||||
$this->info_box_contents[$line][3] = array('td' => 'align="right" class="liste_total" ', 'text' => '');
|
||||
|
||||
@ -286,7 +286,7 @@ class ModeleBoxes // Can't be abtract as it is instantiated to build "empty"
|
||||
if (isset($contents[$i]))
|
||||
{
|
||||
// TR
|
||||
if (isset($contents[$i][0]['tr'])) $out.= '<tr class="tdtop" '.$contents[$i][0]['tr'].'>';
|
||||
if (isset($contents[$i][0]['tr'])) $out.= '<tr '.$contents[$i][0]['tr'].'>';
|
||||
else $out.= '<tr class="oddeven">';
|
||||
|
||||
// Loop on each TD
|
||||
|
||||
@ -544,7 +544,7 @@ class Form
|
||||
|
||||
$disabled=0;
|
||||
$ret='<div class="centpercent center">';
|
||||
$ret.='<select data-role="none" class="flat'.(empty($conf->use_javascript_ajax)?'':' hideobject').' massaction massactionselect" name="massaction"'.($disabled?' disabled="disabled"':'').'>';
|
||||
$ret.='<select class="flat'.(empty($conf->use_javascript_ajax)?'':' hideobject').' massaction massactionselect" name="massaction"'.($disabled?' disabled="disabled"':'').'>';
|
||||
|
||||
// Complete list with data from external modules. THe module can use $_SERVER['PHP_SELF'] to know on which page we are, or use the $parameters['currentcontext'] completed by executeHooks.
|
||||
$parameters=array();
|
||||
@ -561,7 +561,7 @@ class Form
|
||||
|
||||
$ret.='</select>';
|
||||
// Warning: if you set submit button to disabled, post using 'Enter' will no more work.
|
||||
$ret.='<input type="submit" data-role="none" name="confirmmassaction" class="button'.(empty($conf->use_javascript_ajax)?'':' hideobject').' massaction massactionconfirmed" value="'.dol_escape_htmltag($langs->trans("Confirm")).'">';
|
||||
$ret.='<input type="submit" name="confirmmassaction" class="button'.(empty($conf->use_javascript_ajax)?'':' hideobject').' massaction massactionconfirmed" value="'.dol_escape_htmltag($langs->trans("Confirm")).'">';
|
||||
$ret.='</div>';
|
||||
|
||||
if (! empty($conf->use_javascript_ajax))
|
||||
@ -2987,12 +2987,12 @@ class Form
|
||||
* Constant MAIN_DEFAULT_PAYMENT_TERM_ID can used to set default value but scope is all application, probably not what you want.
|
||||
* See instead to force the default value by the caller.
|
||||
*
|
||||
* @param int $selected Id of payment term to preselect by default
|
||||
* @param string $htmlname Nom de la zone select
|
||||
* @param int $filtertype Not used
|
||||
* @param int $selected Id of payment term to preselect by default
|
||||
* @param string $htmlname Nom de la zone select
|
||||
* @param int $filtertype Not used
|
||||
* @param int $addempty Add an empty entry
|
||||
* @param int $noadmininfo 0=Add admin info, 1=Disable admin info
|
||||
* @param string $morecss Add more CSS on select tag
|
||||
* @param int $noinfoadmin 0=Add admin info, 1=Disable admin info
|
||||
* @param string $morecss Add more CSS on select tag
|
||||
* @return void
|
||||
*/
|
||||
function select_conditions_paiements($selected=0, $htmlname='condid', $filtertype=-1, $addempty=0, $noinfoadmin=0, $morecss='')
|
||||
@ -3277,7 +3277,7 @@ class Form
|
||||
|
||||
$return= '<select class="flat" id="'.$htmlname.'" name="'.$htmlname.'">';
|
||||
|
||||
$sql = 'SELECT rowid, label from '.MAIN_DB_PREFIX.'c_units';
|
||||
$sql = 'SELECT rowid, label, code from '.MAIN_DB_PREFIX.'c_units';
|
||||
$sql.= ' WHERE active > 0';
|
||||
|
||||
$resql = $this->db->query($sql);
|
||||
@ -5215,15 +5215,16 @@ class Form
|
||||
*/
|
||||
static function selectArrayAjax($htmlname, $url, $id='', $moreparam='', $moreparamtourl='', $disabled=0, $minimumInputLength=1, $morecss='', $callurlonselect=0, $placeholder='', $acceptdelayedhtml=0)
|
||||
{
|
||||
global $langs;
|
||||
global $conf, $langs;
|
||||
global $delayedhtmlcontent;
|
||||
|
||||
$tmpplugin='select2';
|
||||
// TODO Use an internal dolibarr component instead of select2
|
||||
if (empty($conf->global->MAIN_USE_JQUERY_MULTISELECT) && ! defined('REQUIRE_JQUERY_MULTISELECT')) return '';
|
||||
|
||||
$out='<input type="text" class="'.$htmlname.($morecss?' '.$morecss:'').'" '.($moreparam?$moreparam.' ':'').'name="'.$htmlname.'">';
|
||||
|
||||
// TODO Use an internal dolibarr component instead of select2
|
||||
$outdelayed='<!-- JS CODE TO ENABLE '.$tmpplugin.' for id '.$htmlname.' -->
|
||||
$tmpplugin='select2';
|
||||
$outdelayed="\n".'<!-- JS CODE TO ENABLE '.$tmpplugin.' for id '.$htmlname.' -->
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function () {
|
||||
|
||||
@ -5325,7 +5326,7 @@ class Form
|
||||
if (! empty($conf->global->MAIN_USE_JQUERY_MULTISELECT) || defined('REQUIRE_JQUERY_MULTISELECT'))
|
||||
{
|
||||
$tmpplugin=empty($conf->global->MAIN_USE_JQUERY_MULTISELECT)?constant('REQUIRE_JQUERY_MULTISELECT'):$conf->global->MAIN_USE_JQUERY_MULTISELECT;
|
||||
$out.='<!-- JS CODE TO ENABLE '.$tmpplugin.' for id '.$htmlname.' -->
|
||||
$out.="\n".'<!-- JS CODE TO ENABLE '.$tmpplugin.' for id '.$htmlname.' -->
|
||||
<script type="text/javascript">
|
||||
function formatResult(record) {'."\n";
|
||||
if ($elemtype == 'category')
|
||||
@ -5551,8 +5552,8 @@ class Form
|
||||
{
|
||||
$nbofdifferenttypes = count($object->linkedObjects);
|
||||
|
||||
print '<br><!-- showLinkedObjectBlock -->';
|
||||
print load_fiche_titre($langs->trans('RelatedObjects'), $morehtmlright, '');
|
||||
print '<!-- showLinkedObjectBlock -->';
|
||||
print load_fiche_titre($langs->trans('RelatedObjects'), $morehtmlright, '', 0, 0, 'showlinkedobjectblock');
|
||||
|
||||
|
||||
print '<div class="div-table-responsive-no-min">';
|
||||
|
||||
@ -150,14 +150,14 @@ class FormActions
|
||||
/**
|
||||
* Show list of actions for element
|
||||
*
|
||||
* @param Object $object Object
|
||||
* @param string $typeelement 'invoice','propal','order','invoice_supplier','order_supplier','fichinter'
|
||||
* @param int $socid socid of user
|
||||
* @param int $forceshowtitle Show title even if there is no actions to show
|
||||
* @param string $morecss More css on table
|
||||
* @param int $max Max number of record
|
||||
* @param Object $object Object
|
||||
* @param string $typeelement 'invoice','propal','order','invoice_supplier','order_supplier','fichinter'
|
||||
* @param int $socid Socid of user
|
||||
* @param int $forceshowtitle Show title even if there is no actions to show
|
||||
* @param string $morecss More css on table
|
||||
* @param int $max Max number of record
|
||||
* @param string $moreparambacktopage More param for the backtopage
|
||||
* @return int <0 if KO, >=0 if OK
|
||||
* @return int <0 if KO, >=0 if OK
|
||||
*/
|
||||
function showactions($object, $typeelement, $socid=0, $forceshowtitle=0, $morecss='listactions', $max=0, $moreparambacktopage='')
|
||||
{
|
||||
@ -175,31 +175,34 @@ class FormActions
|
||||
$num = count($listofactions);
|
||||
if ($num || $forceshowtitle)
|
||||
{
|
||||
if ($typeelement == 'invoice') $title=$langs->trans('ActionsOnBill');
|
||||
if ($typeelement == 'invoice') $title=$langs->trans('ActionsOnBill');
|
||||
elseif ($typeelement == 'invoice_supplier' || $typeelement == 'supplier_invoice') $title=$langs->trans('ActionsOnBill');
|
||||
elseif ($typeelement == 'propal') $title=$langs->trans('ActionsOnPropal');
|
||||
elseif ($typeelement == 'supplier_payment') $title=$langs->trans('ActionsOnSupplierPayment');
|
||||
elseif ($typeelement == 'supplier_proposal') $title=$langs->trans('ActionsOnSupplierProposal');
|
||||
elseif ($typeelement == 'order') $title=$langs->trans('ActionsOnOrder');
|
||||
elseif ($typeelement == 'propal') $title=$langs->trans('ActionsOnPropal');
|
||||
elseif ($typeelement == 'supplier_payment') $title=$langs->trans('ActionsOnSupplierPayment');
|
||||
elseif ($typeelement == 'supplier_proposal') $title=$langs->trans('ActionsOnSupplierProposal');
|
||||
elseif ($typeelement == 'order') $title=$langs->trans('ActionsOnOrder');
|
||||
elseif ($typeelement == 'order_supplier' || $typeelement == 'supplier_order') $title=$langs->trans('ActionsOnOrder');
|
||||
elseif ($typeelement == 'shipping') $title=$langs->trans('ActionsOnShipping');
|
||||
elseif ($typeelement == 'fichinter') $title=$langs->trans('ActionsOnFicheInter');
|
||||
elseif ($typeelement == 'project') $title=$langs->trans('LatestLinkedEvents', $max?$max:'');
|
||||
elseif ($typeelement == 'task') $title=$langs->trans('LatestLinkedEvents', $max?$max:'');
|
||||
else $title=$langs->trans("Actions");
|
||||
elseif ($typeelement == 'shipping') $title=$langs->trans('ActionsOnShipping');
|
||||
elseif ($typeelement == 'fichinter') $title=$langs->trans('ActionsOnFicheInter');
|
||||
elseif ($typeelement == 'project') $title=$langs->trans('LatestLinkedEvents', $max?$max:'');
|
||||
elseif ($typeelement == 'task') $title=$langs->trans('LatestLinkedEvents', $max?$max:'');
|
||||
elseif ($typeelement == 'member') $title=$langs->trans('LatestLinkedEvents', $max?$max:'');
|
||||
else $title=$langs->trans("LatestLinkedEvents", $max?$max:'');
|
||||
|
||||
$urlbacktopage=$_SERVER['PHP_SELF'].'?id='.$object->id.($moreparambacktopage?'&'.$moreparambacktopage:'');
|
||||
|
||||
$buttontoaddnewevent = '<a href="'.DOL_URL_ROOT.'/comm/action/card.php?action=create&datep='.dol_print_date(dol_now(),'dayhourlog').'&origin='.$typeelement.'&originid='.$object->id.'&socid='.$object->socid.'&projectid='.$object->fk_project.'&backtopage='.urlencode($urlbacktopage).'">';
|
||||
$buttontoaddnewevent.= $langs->trans("AddEvent");
|
||||
$buttontoaddnewevent.= '</a>';
|
||||
|
||||
print '<!-- formactions->showactions -->'."\n";
|
||||
print load_fiche_titre($title, $buttontoaddnewevent, '');
|
||||
|
||||
$page=0; $param='';
|
||||
|
||||
$total = 0;
|
||||
|
||||
print '<div class="div-table-responsive">';
|
||||
print '<div class="div-table-responsive-no-min">';
|
||||
print '<table class="noborder'.($morecss?' '.$morecss:'').'" width="100%">';
|
||||
print '<tr class="liste_titre">';
|
||||
print getTitleFieldOfList('Ref', 0, $_SERVER["PHP_SELF"], '', $page, $param, '', $sortfield, $sortorder, '', 1);
|
||||
@ -213,63 +216,70 @@ class FormActions
|
||||
|
||||
$userstatic = new User($this->db);
|
||||
|
||||
$cursorevent = 0;
|
||||
foreach($listofactions as $action)
|
||||
if (count($listofactions))
|
||||
{
|
||||
if ($max && $cursorevent >= $max) break;
|
||||
$cursorevent = 0;
|
||||
foreach($listofactions as $action)
|
||||
{
|
||||
if ($max && $cursorevent >= $max) break;
|
||||
|
||||
$ref=$action->getNomUrl(1,-1);
|
||||
$label=$action->getNomUrl(0,38);
|
||||
$ref=$action->getNomUrl(1,-1);
|
||||
$label=$action->getNomUrl(0,38);
|
||||
|
||||
print '<tr class="oddeven">';
|
||||
print '<td>'.$ref.'</td>';
|
||||
print '<td>'.$label.'</td>';
|
||||
print '<td>';
|
||||
if (! empty($conf->global->AGENDA_USE_EVENT_TYPE))
|
||||
{
|
||||
if ($action->type_picto) print img_picto('', $action->type_picto);
|
||||
else {
|
||||
if ($action->type_code == 'AC_RDV') print img_picto('', 'object_group').' ';
|
||||
if ($action->type_code == 'AC_TEL') print img_picto('', 'object_phoning').' ';
|
||||
if ($action->type_code == 'AC_FAX') print img_picto('', 'object_phoning_fax').' ';
|
||||
if ($action->type_code == 'AC_EMAIL') print img_picto('', 'object_email').' ';
|
||||
}
|
||||
}
|
||||
print $action->type;
|
||||
print '</td>';
|
||||
print '<td align="center">'.dol_print_date($action->datep,'dayhour');
|
||||
if ($action->datef)
|
||||
{
|
||||
$tmpa=dol_getdate($action->datep);
|
||||
$tmpb=dol_getdate($action->datef);
|
||||
if ($tmpa['mday'] == $tmpb['mday'] && $tmpa['mon'] == $tmpb['mon'] && $tmpa['year'] == $tmpb['year'])
|
||||
print '<tr class="oddeven">';
|
||||
print '<td>'.$ref.'</td>';
|
||||
print '<td>'.$label.'</td>';
|
||||
print '<td>';
|
||||
if (! empty($conf->global->AGENDA_USE_EVENT_TYPE))
|
||||
{
|
||||
if ($tmpa['hours'] != $tmpb['hours'] || $tmpa['minutes'] != $tmpb['minutes'] && $tmpa['seconds'] != $tmpb['seconds']) print '-'.dol_print_date($action->datef,'hour');
|
||||
if ($action->type_picto) print img_picto('', $action->type_picto);
|
||||
else {
|
||||
if ($action->type_code == 'AC_RDV') print img_picto('', 'object_group').' ';
|
||||
if ($action->type_code == 'AC_TEL') print img_picto('', 'object_phoning').' ';
|
||||
if ($action->type_code == 'AC_FAX') print img_picto('', 'object_phoning_fax').' ';
|
||||
if ($action->type_code == 'AC_EMAIL') print img_picto('', 'object_email').' ';
|
||||
}
|
||||
}
|
||||
else print '-'.dol_print_date($action->datef,'dayhour');
|
||||
}
|
||||
print '</td>';
|
||||
print '<td>';
|
||||
if (! empty($action->userownerid))
|
||||
{
|
||||
$userstatic->fetch($action->userownerid); // TODO Introduce a cache on users fetched
|
||||
print $userstatic->getNomUrl(-1, '', 0, 0, 16, 0, '', '');
|
||||
}
|
||||
print '</td>';
|
||||
print '<td align="right">';
|
||||
if (! empty($action->author->id))
|
||||
{
|
||||
print $action->getLibStatut(3);
|
||||
}
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
print $action->type;
|
||||
print '</td>';
|
||||
print '<td align="center">'.dol_print_date($action->datep,'dayhour');
|
||||
if ($action->datef)
|
||||
{
|
||||
$tmpa=dol_getdate($action->datep);
|
||||
$tmpb=dol_getdate($action->datef);
|
||||
if ($tmpa['mday'] == $tmpb['mday'] && $tmpa['mon'] == $tmpb['mon'] && $tmpa['year'] == $tmpb['year'])
|
||||
{
|
||||
if ($tmpa['hours'] != $tmpb['hours'] || $tmpa['minutes'] != $tmpb['minutes'] && $tmpa['seconds'] != $tmpb['seconds']) print '-'.dol_print_date($action->datef,'hour');
|
||||
}
|
||||
else print '-'.dol_print_date($action->datef,'dayhour');
|
||||
}
|
||||
print '</td>';
|
||||
print '<td>';
|
||||
if (! empty($action->userownerid))
|
||||
{
|
||||
$userstatic->fetch($action->userownerid); // TODO Introduce a cache on users fetched
|
||||
print $userstatic->getNomUrl(-1, '', 0, 0, 16, 0, '', '');
|
||||
}
|
||||
print '</td>';
|
||||
print '<td align="right">';
|
||||
if (! empty($action->author->id))
|
||||
{
|
||||
print $action->getLibStatut(3);
|
||||
}
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
|
||||
$cursorevent++;
|
||||
$cursorevent++;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<tr class="oddeven"><td colspan="6" class="opacitymedium">'.$langs->trans("None").'</td></tr>';
|
||||
}
|
||||
|
||||
if ($max && $num > $max)
|
||||
{
|
||||
print '<tr class="oddeven"><td colspan="6">'.$langs->trans("More").'...</td></tr>';
|
||||
print '<tr class="oddeven"><td colspan="6" class="opacitymedium">'.$langs->trans("More").'...</td></tr>';
|
||||
}
|
||||
|
||||
print '</table>';
|
||||
|
||||
@ -339,16 +339,25 @@ class FormMail extends Form
|
||||
$modelmail_array=array();
|
||||
foreach($this->lines_model as $line)
|
||||
{
|
||||
$modelmail_array[$line->id]=$line->label;
|
||||
$langs->trans("members");
|
||||
if (preg_match('/\((.*)\)/', $line->label, $reg))
|
||||
{
|
||||
$modelmail_array[$line->id]=$langs->trans($reg[1]); // langs->trans when label is __(xxx)__
|
||||
}
|
||||
else
|
||||
{
|
||||
$modelmail_array[$line->id]=$line->label;
|
||||
}
|
||||
if ($line->lang) $modelmail_array[$line->id].=' ('.$line->lang.')';
|
||||
if ($line->private) $modelmail_array[$line->id].=' - '.$langs->trans("Private");
|
||||
//if ($line->fk_user != $user->id) $modelmail_array[$line->id].=' - '.$langs->trans("By").' ';
|
||||
}
|
||||
}
|
||||
|
||||
// Zone to select its email template
|
||||
// Zone to select email template
|
||||
if (count($modelmail_array)>0)
|
||||
{
|
||||
// If list of template is filled
|
||||
$out.= '<div class="center" style="padding: 0px 0 12px 0">'."\n";
|
||||
$out.= '<span class="opacitymedium">'.$langs->trans('SelectMailModel').':</span> '.$this->selectarray('modelmailselected', $modelmail_array, 0, 1, 0, 0, '', 0, 0, 0, '', 'minwidth100');
|
||||
if ($user->admin) $out.= info_admin($langs->trans("YouCanChangeValuesForThisListFrom", $langs->transnoentitiesnoconv('Setup').' - '.$langs->transnoentitiesnoconv('EMails')),1);
|
||||
@ -363,6 +372,7 @@ class FormMail extends Form
|
||||
'invoice_supplier_send','thirdparty','contract','all'
|
||||
)))
|
||||
{
|
||||
// If list of template is empty
|
||||
$out.= '<div class="center" style="padding: 0px 0 12px 0">'."\n";
|
||||
$out.= $langs->trans('SelectMailModel').': <select name="modelmailselected" disabled="disabled"><option value="none">'.$langs->trans("NoTemplateDefined").'</option></select>'; // Do not put 'disabled' on 'option' tag, it is already on 'select' and it makes chrome crazy.
|
||||
if ($user->admin) $out.= info_admin($langs->trans("YouCanChangeValuesForThisListFrom", $langs->transnoentitiesnoconv('Setup').' - '.$langs->transnoentitiesnoconv('EMails')),1);
|
||||
@ -502,6 +512,7 @@ class FormMail extends Form
|
||||
}
|
||||
else
|
||||
{
|
||||
// Note withto may be a text like 'AllRecipientSelected'
|
||||
$out.= (! is_array($this->withto) && ! is_numeric($this->withto))?$this->withto:"";
|
||||
}
|
||||
}
|
||||
@ -531,10 +542,22 @@ class FormMail extends Form
|
||||
$out.= "</td></tr>\n";
|
||||
}
|
||||
|
||||
// withoptiononeemailperrecipient
|
||||
if (! empty($this->withoptiononeemailperrecipient))
|
||||
{
|
||||
$out.= '<tr><td>';
|
||||
$out.= $langs->trans("GroupEmails");
|
||||
$out.= '</td><td>';
|
||||
$out.=' <input type="checkbox" name="oneemailperrecipient"'.($this->withoptiononeemailperrecipient > 0?' checked="checked"':'').'> ';
|
||||
$out.= $langs->trans("OneEmailPerRecipient").' - ';
|
||||
$out.= $langs->trans("WarningIfYouCheckOneRecipientPerEmail");
|
||||
$out.= '</td></tr>';
|
||||
}
|
||||
|
||||
// CC
|
||||
if (! empty($this->withtocc) || is_array($this->withtocc))
|
||||
{
|
||||
$out.= '<tr><td width="180">';
|
||||
$out.= '<tr><td>';
|
||||
$out.= $form->textwithpicto($langs->trans("MailCC"),$langs->trans("YouCanUseCommaSeparatorForSeveralRecipients"));
|
||||
$out.= '</td><td>';
|
||||
if ($this->withtoccreadonly)
|
||||
@ -563,7 +586,7 @@ class FormMail extends Form
|
||||
// CCC
|
||||
if (! empty($this->withtoccc) || is_array($this->withtoccc))
|
||||
{
|
||||
$out.= '<tr><td width="180">';
|
||||
$out.= '<tr><td>';
|
||||
$out.= $form->textwithpicto($langs->trans("MailCCC"),$langs->trans("YouCanUseCommaSeparatorForSeveralRecipients"));
|
||||
$out.= '</td><td>';
|
||||
if (! empty($this->withtocccreadonly))
|
||||
@ -631,7 +654,7 @@ class FormMail extends Form
|
||||
// Ask delivery receipt
|
||||
if (! empty($this->withdeliveryreceipt))
|
||||
{
|
||||
$out.= '<tr><td width="180">'.$langs->trans("DeliveryReceipt").'</td><td>';
|
||||
$out.= '<tr><td>'.$langs->trans("DeliveryReceipt").'</td><td>';
|
||||
|
||||
if (! empty($this->withdeliveryreceiptreadonly))
|
||||
{
|
||||
@ -663,7 +686,7 @@ class FormMail extends Form
|
||||
$defaulttopic=make_substitutions($defaulttopic,$this->substit);
|
||||
|
||||
$out.= '<tr>';
|
||||
$out.= '<td class="fieldrequired" width="180">'.$langs->trans("MailTopic").'</td>';
|
||||
$out.= '<td class="fieldrequired">'.$langs->trans("MailTopic").'</td>';
|
||||
$out.= '<td>';
|
||||
if ($this->withtopicreadonly)
|
||||
{
|
||||
@ -681,7 +704,7 @@ class FormMail extends Form
|
||||
if (! empty($this->withfile))
|
||||
{
|
||||
$out.= '<tr>';
|
||||
$out.= '<td width="180">'.$langs->trans("MailFile").'</td>';
|
||||
$out.= '<td>'.$langs->trans("MailFile").'</td>';
|
||||
|
||||
$out.= '<td>';
|
||||
if (! empty($this->withmaindocfile))
|
||||
@ -771,7 +794,8 @@ class FormMail extends Form
|
||||
$typeforonlinepayment='free';
|
||||
if ($this->param["models"]=='order_send') $typeforonlinepayment='order'; // TODO use detection on something else than template
|
||||
if ($this->param["models"]=='facture_send') $typeforonlinepayment='invoice'; // TODO use detection on something else than template
|
||||
$url=getOnlinePaymentUrl(0, $typeforonlinepayment, $this->substit['__REF__']);
|
||||
if ($this->param["models"]=='member_send') $typeforonlinepayment='member'; // TODO use detection on something else than template
|
||||
$url=getOnlinePaymentUrl(0, $typeforonlinepayment, $this->substit['__REF__']);
|
||||
//$paymenturl=str_replace('\n',"\n",$langs->transnoentitiesnoconv("PredefinedMailContentLink",$url));
|
||||
$paymenturl=$url;
|
||||
}
|
||||
@ -811,7 +835,7 @@ class FormMail extends Form
|
||||
}
|
||||
|
||||
$out.= '<tr>';
|
||||
$out.= '<td width="180" valign="top">'.$langs->trans("MailText").'</td>';
|
||||
$out.= '<td valign="top">'.$langs->trans("MailText").'</td>';
|
||||
$out.= '<td>';
|
||||
if ($this->withbodyreadonly)
|
||||
{
|
||||
@ -1006,7 +1030,7 @@ class FormMail extends Form
|
||||
$sql = "SELECT rowid, label, topic, content, content_lines, lang, fk_user, private, position";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX.'c_email_templates';
|
||||
$sql.= " WHERE type_template IN ('".$this->db->escape($type_template)."', 'all')";
|
||||
$sql.= " AND entity IN (".getEntity('c_email_templates', 0).")";
|
||||
$sql.= " AND entity IN (".getEntity('c_email_templates', 1).")";
|
||||
$sql.= " AND (private = 0 OR fk_user = ".$user->id.")"; // See all public templates or templates I own.
|
||||
if ($active >= 0) $sql.=" AND active = ".$active;
|
||||
//if (is_object($outputlangs)) $sql.= " AND (lang = '".$outputlangs->defaultlang."' OR lang IS NULL OR lang = '')"; // Return all languages
|
||||
|
||||
@ -44,6 +44,35 @@ top_httphead('text/javascript; charset=UTF-8');
|
||||
if (empty($dolibarr_nocache)) header('Cache-Control: max-age=3600, public, must-revalidate');
|
||||
else header('Cache-Control: no-cache');
|
||||
?>
|
||||
// Javascript libraries for Dolibarr ERP CRM (https://www.dolibarr.org)
|
||||
|
||||
|
||||
/**
|
||||
* Set select2 translations (if module was loaded).
|
||||
*/
|
||||
(function ($) {
|
||||
"use strict";
|
||||
|
||||
if (typeof $.fn.select2 != "undefined") {
|
||||
/* console.log($.fn.select2);
|
||||
console.log("ok"); */
|
||||
|
||||
$.fn.select2.locales['xx'] = {
|
||||
formatMatches: function (matches) { return matches + " <?php echo dol_escape_js($langs->trans("Select2ResultFoundUseArrows")); ?>"; },
|
||||
formatNoMatches: function () { return "<?php echo dol_escape_js($langs->trans("Select2NotFound")); ?>"; },
|
||||
formatInputTooShort: function (input, min) { var n = min - input.length;
|
||||
if (n > 1) return "<?php echo dol_escape_js($langs->trans("Select2Enter")); ?> " + n + " <?php echo dol_escape_js($langs->trans("Select2MoreCharacters")); ?>";
|
||||
else return "<?php echo dol_escape_js($langs->trans("Select2Enter")); ?> " + n + " <?php echo dol_escape_js($langs->trans("Select2MoreCharacter")); ?>"
|
||||
},
|
||||
formatLoadMore: function (pageNumber) { return "<?php echo dol_escape_js($langs->trans("Select2LoadingMoreResults")); ?>"; },
|
||||
formatSearching: function () { return "<?php echo dol_escape_js($langs->trans("Select2SearchInProgress")); ?>"; }
|
||||
};
|
||||
|
||||
$.extend($.fn.select2.defaults, $.fn.select2.locales['xx']);
|
||||
|
||||
}
|
||||
})(jQuery);
|
||||
|
||||
|
||||
/*
|
||||
* =================================================================
|
||||
@ -53,6 +82,7 @@ else header('Cache-Control: no-cache');
|
||||
* SimpleDateFormat a utiliser pour retour
|
||||
* ==================================================================
|
||||
*/
|
||||
/*
|
||||
function showDP(base,dateFieldID,format,codelang)
|
||||
{
|
||||
// check to see if another box is already showing
|
||||
@ -136,7 +166,7 @@ function resetDP(base,dateFieldID,format,codelang)
|
||||
|
||||
function loadMonth(base,month,year,ymd,codelang)
|
||||
{
|
||||
/* showDP.box.innerHTML="Loading..."; */
|
||||
// showDP.box.innerHTML="Loading...";
|
||||
// alert(codelang);
|
||||
var theURL=base+"datepicker.php?cm=shw&lang="+codelang;
|
||||
theURL+="&m="+encodeURIComponent(month);
|
||||
@ -163,37 +193,6 @@ function closeDPBox()
|
||||
showDP.datefieldID=null;
|
||||
}
|
||||
|
||||
function dpChangeDay(dateFieldID,format)
|
||||
{
|
||||
showDP.datefieldID=dateFieldID;
|
||||
console.log("Call dpChangeDay, we save date into detailed fields.");
|
||||
|
||||
var thefield=getObjectFromID(showDP.datefieldID);
|
||||
var thefieldday=getObjectFromID(showDP.datefieldID+"day");
|
||||
var thefieldmonth=getObjectFromID(showDP.datefieldID+"month");
|
||||
var thefieldyear=getObjectFromID(showDP.datefieldID+"year");
|
||||
|
||||
var date=getDateFromFormat(thefield.value,format);
|
||||
if (date)
|
||||
{
|
||||
thefieldday.value=date.getDate();
|
||||
if(thefieldday.onchange) thefieldday.onchange.call(thefieldday);
|
||||
thefieldmonth.value=date.getMonth()+1;
|
||||
if(thefieldmonth.onchange) thefieldmonth.onchange.call(thefieldmonth);
|
||||
thefieldyear.value=date.getFullYear();
|
||||
if(thefieldyear.onchange) thefieldyear.onchange.call(thefieldyear);
|
||||
}
|
||||
else
|
||||
{
|
||||
thefieldday.value='';
|
||||
if(thefieldday.onchange) thefieldday.onchange.call(thefieldday);
|
||||
thefieldmonth.value='';
|
||||
if(thefieldmonth.onchange) thefieldmonth.onchange.call(thefieldmonth);
|
||||
thefieldyear.value='';
|
||||
if(thefieldyear.onchange) thefieldyear.onchange.call(thefieldyear);
|
||||
}
|
||||
}
|
||||
|
||||
function dpClickDay(year,month,day,format)
|
||||
{
|
||||
var thefield=getObjectFromID(showDP.datefieldID);
|
||||
@ -221,16 +220,6 @@ function dpHighlightDay(year,month,day,months){
|
||||
displayinfo.innerHTML=months[month-1]+" "+day+", "+year;
|
||||
}
|
||||
|
||||
// Returns an object given an id
|
||||
function getObjectFromID(id){
|
||||
var theObject;
|
||||
if(document.getElementById)
|
||||
theObject=document.getElementById(id);
|
||||
else
|
||||
theObject=document.all[id];
|
||||
return theObject;
|
||||
}
|
||||
|
||||
// This Function returns the top position of an object
|
||||
function getTop(theitem){
|
||||
var offsetTrail = theitem;
|
||||
@ -257,6 +246,85 @@ function getLeft(theitem){
|
||||
return offsetLeft;
|
||||
}
|
||||
|
||||
// To hide/show select Boxes with IE6 (and only IE6 because IE6 has a bug and
|
||||
// not put popup completely on the front)
|
||||
// Used only bu popup calendar
|
||||
function hideSelectBoxes() {
|
||||
var brsVersion = parseInt(window.navigator.appVersion.charAt(0), 10);
|
||||
if (brsVersion <= 6 && window.navigator.userAgent.indexOf("MSIE 6") > -1)
|
||||
{
|
||||
for(var i = 0; i < document.all.length; i++)
|
||||
{
|
||||
if(document.all[i].tagName)
|
||||
if(document.all[i].tagName == "SELECT")
|
||||
document.all[i].style.visibility="hidden";
|
||||
}
|
||||
}
|
||||
}
|
||||
// To hide/show select Boxes with IE6 (and only IE6 because IE6 has a bug and
|
||||
// not put popup completely on the front)
|
||||
// Used only bu popup calendar
|
||||
function displaySelectBoxes() {
|
||||
var brsVersion = parseInt(window.navigator.appVersion.charAt(0), 10);
|
||||
if (brsVersion <= 6 && window.navigator.userAgent.indexOf("MSIE 6") > -1)
|
||||
{
|
||||
for(var i = 0; i < document.all.length; i++)
|
||||
{
|
||||
if(document.all[i].tagName)
|
||||
if(document.all[i].tagName == "SELECT")
|
||||
document.all[i].style.visibility="visible";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
*/
|
||||
|
||||
|
||||
// Returns an object given an id
|
||||
function getObjectFromID(id){
|
||||
var theObject;
|
||||
if(document.getElementById)
|
||||
theObject=document.getElementById(id);
|
||||
else
|
||||
theObject=document.all[id];
|
||||
return theObject;
|
||||
}
|
||||
|
||||
// Called after selection of a date to save details into detailed fields
|
||||
function dpChangeDay(dateFieldID,format)
|
||||
{
|
||||
//showDP.datefieldID=dateFieldID;
|
||||
console.log("Call dpChangeDay, we save date into detailed fields.");
|
||||
|
||||
var thefield=getObjectFromID(dateFieldID);
|
||||
var thefieldday=getObjectFromID(dateFieldID+"day");
|
||||
var thefieldmonth=getObjectFromID(dateFieldID+"month");
|
||||
var thefieldyear=getObjectFromID(dateFieldID+"year");
|
||||
|
||||
var date=getDateFromFormat(thefield.value,format);
|
||||
if (date)
|
||||
{
|
||||
thefieldday.value=date.getDate();
|
||||
if(thefieldday.onchange) thefieldday.onchange.call(thefieldday);
|
||||
thefieldmonth.value=date.getMonth()+1;
|
||||
if(thefieldmonth.onchange) thefieldmonth.onchange.call(thefieldmonth);
|
||||
thefieldyear.value=date.getFullYear();
|
||||
if(thefieldyear.onchange) thefieldyear.onchange.call(thefieldyear);
|
||||
}
|
||||
else
|
||||
{
|
||||
thefieldday.value='';
|
||||
if(thefieldday.onchange) thefieldday.onchange.call(thefieldday);
|
||||
thefieldmonth.value='';
|
||||
if(thefieldmonth.onchange) thefieldmonth.onchange.call(thefieldmonth);
|
||||
thefieldyear.value='';
|
||||
if(thefieldyear.onchange) thefieldyear.onchange.call(thefieldyear);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// Create XMLHttpRequest object and load url
|
||||
// Used by calendar or other ajax processes
|
||||
@ -316,40 +384,6 @@ function loadXMLDoc(url,readyStateFunction,async)
|
||||
return req;
|
||||
}
|
||||
|
||||
/* To hide/show select Boxes with IE6 (and only IE6 because IE6 has a bug and
|
||||
* not put popup completely on the front)
|
||||
* Used only bu popup calendar
|
||||
*/
|
||||
function hideSelectBoxes() {
|
||||
var brsVersion = parseInt(window.navigator.appVersion.charAt(0), 10);
|
||||
if (brsVersion <= 6 && window.navigator.userAgent.indexOf("MSIE 6") > -1)
|
||||
{
|
||||
for(var i = 0; i < document.all.length; i++)
|
||||
{
|
||||
if(document.all[i].tagName)
|
||||
if(document.all[i].tagName == "SELECT")
|
||||
document.all[i].style.visibility="hidden";
|
||||
}
|
||||
}
|
||||
}
|
||||
/* To hide/show select Boxes with IE6 (and only IE6 because IE6 has a bug and
|
||||
* not put popup completely on the front)
|
||||
* Used only bu popup calendar
|
||||
*/
|
||||
function displaySelectBoxes() {
|
||||
var brsVersion = parseInt(window.navigator.appVersion.charAt(0), 10);
|
||||
if (brsVersion <= 6 && window.navigator.userAgent.indexOf("MSIE 6") > -1)
|
||||
{
|
||||
for(var i = 0; i < document.all.length; i++)
|
||||
{
|
||||
if(document.all[i].tagName)
|
||||
if(document.all[i].tagName == "SELECT")
|
||||
document.all[i].style.visibility="visible";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* =================================================================
|
||||
|
||||
@ -1,67 +0,0 @@
|
||||
<?php
|
||||
/* Copyright (C) 2012 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
* Copyright (C) 2012 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
/**
|
||||
* \file htdocs/core/js/select2_locale.js.php
|
||||
* \brief File that include javascript functions for timepicker
|
||||
*/
|
||||
|
||||
//if (! defined('NOREQUIREUSER')) define('NOREQUIREUSER','1'); // Not disabled cause need to load personalized language
|
||||
//if (! defined('NOREQUIREDB')) define('NOREQUIREDB','1');
|
||||
if (! defined('NOREQUIRESOC')) define('NOREQUIRESOC','1');
|
||||
//if (! defined('NOREQUIRETRAN')) define('NOREQUIRETRAN','1'); // Not disabled cause need to do translations
|
||||
if (! defined('NOCSRFCHECK')) define('NOCSRFCHECK',1);
|
||||
if (! defined('NOTOKENRENEWAL')) define('NOTOKENRENEWAL',1);
|
||||
if (! defined('NOLOGIN')) define('NOLOGIN',1);
|
||||
if (! defined('NOREQUIREMENU')) define('NOREQUIREMENU',1);
|
||||
if (! defined('NOREQUIREHTML')) define('NOREQUIREHTML',1);
|
||||
if (! defined('NOREQUIREAJAX')) define('NOREQUIREAJAX','1');
|
||||
|
||||
session_cache_limiter(FALSE);
|
||||
|
||||
require_once '../../main.inc.php';
|
||||
|
||||
// Define javascript type
|
||||
top_httphead('text/javascript; charset=UTF-8');
|
||||
// Important: Following code is to avoid page request by browser and PHP CPU at each Dolibarr page access.
|
||||
if (empty($dolibarr_nocache)) header('Cache-Control: max-age=3600, public, must-revalidate');
|
||||
else header('Cache-Control: no-cache');
|
||||
?>
|
||||
|
||||
/**
|
||||
* Select2 French translation
|
||||
*/
|
||||
(function ($) {
|
||||
"use strict";
|
||||
|
||||
$.fn.select2.locales['xx'] = {
|
||||
formatMatches: function (matches) { return matches + " <?php echo dol_escape_js($langs->trans("Select2ResultFoundUseArrows")); ?>"; },
|
||||
formatNoMatches: function () { return "<?php echo dol_escape_js($langs->trans("Select2NotFound")); ?>"; },
|
||||
formatInputTooShort: function (input, min) { var n = min - input.length;
|
||||
if (n > 1) return "<?php echo dol_escape_js($langs->trans("Select2Enter")); ?> " + n + " <?php echo dol_escape_js($langs->trans("Select2MoreCharacters")); ?>";
|
||||
else return "<?php echo dol_escape_js($langs->trans("Select2Enter")); ?> " + n + " <?php echo dol_escape_js($langs->trans("Select2MoreCharacter")); ?>"
|
||||
},
|
||||
formatLoadMore: function (pageNumber) { return "<?php echo dol_escape_js($langs->trans("Select2LoadingMoreResults")); ?>"; },
|
||||
formatSearching: function () { return "<?php echo dol_escape_js($langs->trans("Select2SearchInProgress")); ?>"; }
|
||||
};
|
||||
|
||||
$.extend($.fn.select2.defaults, $.fn.select2.locales['xx']);
|
||||
})(jQuery);
|
||||
|
||||
<?php
|
||||
if (is_object($db)) $db->close();
|
||||
@ -396,14 +396,15 @@ function ajax_combobox($htmlname, $events=array(), $minLengthToAutocomplete=0, $
|
||||
global $conf;
|
||||
|
||||
if (! empty($conf->browser->phone)) return ''; // select2 disabled for smartphones with standard browser (does not works, popup appears outside screen)
|
||||
if (! empty($conf->dol_use_jmobile)) return ''; // select2 works with jmobile but it breaks the autosize feature of jmobile.
|
||||
//if (! empty($conf->dol_use_jmobile)) return ''; // select2 works with jmobile but it breaks the autosize feature of jmobile.
|
||||
if (! empty($conf->global->MAIN_DISABLE_AJAX_COMBOX)) return '';
|
||||
if (empty($conf->use_javascript_ajax)) return '';
|
||||
if (empty($conf->global->MAIN_USE_JQUERY_MULTISELECT) && ! defined('REQUIRE_JQUERY_MULTISELECT')) return '';
|
||||
|
||||
if (empty($minLengthToAutocomplete)) $minLengthToAutocomplete=0;
|
||||
|
||||
$tmpplugin='select2';
|
||||
$msg='<!-- JS CODE TO ENABLE '.$tmpplugin.' for id = '.$htmlname.' -->
|
||||
$msg="\n".'<!-- JS CODE TO ENABLE '.$tmpplugin.' for id = '.$htmlname.' -->
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function () {
|
||||
$(\''.(preg_match('/^\./',$htmlname)?$htmlname:'#'.$htmlname).'\').'.$tmpplugin.'({
|
||||
|
||||
@ -129,7 +129,7 @@ function getEntity($element, $shared=1)
|
||||
else
|
||||
{
|
||||
$out='';
|
||||
$addzero = array('user', 'usergroup', 'email_template', 'default_values');
|
||||
$addzero = array('user', 'usergroup', 'c_email_templates', 'email_template', 'default_values');
|
||||
if (in_array($element, $addzero)) $out.= '0,';
|
||||
$out.= $conf->entity;
|
||||
return $out;
|
||||
@ -599,11 +599,12 @@ function dol_include_once($relpath, $classname='')
|
||||
/**
|
||||
* Return path of url or filesystem. Return alternate root if exists.
|
||||
*
|
||||
* @param string $path Relative path to file (if mode=0) or relative url (if mode=1). Ie: mydir/myfile, ../myfile
|
||||
* @param int $type 0=Used for a Filesystem path, 1=Used for an URL path (output relative), 2=Used for an URL path (output full path using same host that current url), 3=Used for an URL path (output full path using host defined into $dolibarr_main_url_root of conf file)
|
||||
* @return string Full filesystem path (if mode=0), Full url path (if mode=1)
|
||||
* @param string $path Relative path to file (if mode=0) or relative url (if mode=1). Ie: mydir/myfile, ../myfile
|
||||
* @param int $type 0=Used for a Filesystem path, 1=Used for an URL path (output relative), 2=Used for an URL path (output full path using same host that current url), 3=Used for an URL path (output full path using host defined into $dolibarr_main_url_root of conf file)
|
||||
* @param int $returnemptyifnotfound If path==0 and if file was not found, do not return default path but an empty string
|
||||
* @return string Full filesystem path (if path=0), Full url path (if mode=1)
|
||||
*/
|
||||
function dol_buildpath($path, $type=0)
|
||||
function dol_buildpath($path, $type=0, $returnemptyifnotfound=0)
|
||||
{
|
||||
global $conf;
|
||||
|
||||
@ -611,16 +612,20 @@ function dol_buildpath($path, $type=0)
|
||||
|
||||
if (empty($type)) // For a filesystem path
|
||||
{
|
||||
$res = DOL_DOCUMENT_ROOT.'/'.$path; // Standard value
|
||||
$res = DOL_DOCUMENT_ROOT.'/'.$path; // Standard default path
|
||||
foreach ($conf->file->dol_document_root as $key => $dirroot) // ex: array(["main"]=>"/home/main/htdocs", ["alt0"]=>"/home/dirmod/htdocs", ...)
|
||||
{
|
||||
if ($key == 'main') continue;
|
||||
if (file_exists($dirroot.'/'.$path))
|
||||
{
|
||||
$res=$dirroot.'/'.$path;
|
||||
break;
|
||||
return $res;
|
||||
}
|
||||
}
|
||||
if ($returnemptyifnotfound) // Not found, we return empty string
|
||||
{
|
||||
return '';
|
||||
}
|
||||
}
|
||||
else // For an url path
|
||||
{
|
||||
@ -1011,11 +1016,12 @@ function dol_syslog($message, $level = LOG_INFO, $ident = 0, $suffixinfilename='
|
||||
* @param int $notab -1 or 0=Add tab header, 1=no tab header. If you set this to 1, using dol_fiche_end() to close tab is not required.
|
||||
* @param string $picto Add a picto on tab title
|
||||
* @param int $pictoisfullpath If 1, image path is a full path. If you set this to 1, you can use url returned by dol_buildpath('/mymodyle/img/myimg.png',1) for $picto.
|
||||
* @param string $morehtmlright Add more html content on right of tabs title
|
||||
* @return void
|
||||
*/
|
||||
function dol_fiche_head($links=array(), $active='0', $title='', $notab=0, $picto='', $pictoisfullpath=0)
|
||||
function dol_fiche_head($links=array(), $active='0', $title='', $notab=0, $picto='', $pictoisfullpath=0, $morehtmlright='')
|
||||
{
|
||||
print dol_get_fiche_head($links, $active, $title, $notab, $picto, $pictoisfullpath);
|
||||
print dol_get_fiche_head($links, $active, $title, $notab, $picto, $pictoisfullpath, $morehtmlright);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -1027,14 +1033,17 @@ function dol_fiche_head($links=array(), $active='0', $title='', $notab=0, $picto
|
||||
* @param int $notab -1 or 0=Add tab header, 1=no tab header. If you set this to 1, using dol_fiche_end() to close tab is not required.
|
||||
* @param string $picto Add a picto on tab title
|
||||
* @param int $pictoisfullpath If 1, image path is a full path. If you set this to 1, you can use url returned by dol_buildpath('/mymodyle/img/myimg.png',1) for $picto.
|
||||
* @param string $morehtmlright Add more html content on right of tabs title
|
||||
* @return string
|
||||
*/
|
||||
function dol_get_fiche_head($links=array(), $active='', $title='', $notab=0, $picto='', $pictoisfullpath=0)
|
||||
function dol_get_fiche_head($links=array(), $active='', $title='', $notab=0, $picto='', $pictoisfullpath=0, $morehtmlright='')
|
||||
{
|
||||
global $conf, $langs, $hookmanager;
|
||||
|
||||
$out="\n".'<div class="tabs" data-role="controlgroup" data-type="horizontal">'."\n";
|
||||
|
||||
if ($morehtmlright) $out.='<div class="inline-block floatright tabsElem">'.$morehtmlright.'</div>'; // Output right area first so when space is missing, text is in front of tabs and not under.
|
||||
|
||||
// Show title
|
||||
$showtitle=1;
|
||||
if (! empty($conf->dol_optimize_smallscreen)) $showtitle=0;
|
||||
@ -1055,6 +1064,8 @@ function dol_get_fiche_head($links=array(), $active='', $title='', $notab=0, $pi
|
||||
if (count($keys)) $maxkey=max($keys);
|
||||
}
|
||||
|
||||
//$conf->global->MAIN_MAXTABS_IN_CARD=3;
|
||||
|
||||
// Show tabs
|
||||
$bactive=false;
|
||||
// if =0 we don't use the feature
|
||||
@ -1142,7 +1153,7 @@ function dol_get_fiche_head($links=array(), $active='', $title='', $notab=0, $pi
|
||||
{
|
||||
$tabsname=str_replace("@", "", $picto);
|
||||
$out.='<div id="moretabs'.$tabsname.'" class="inline-block tabsElem">';
|
||||
$out.='<a href="#" data-role="button" class="tab moretab inline-block">'.$langs->trans("More").'... ('.$nbintab.')</a>';
|
||||
$out.='<a href="#" data-role="button" class="tab moretab inline-block tabunactive">'.$langs->trans("More").'... ('.$nbintab.')</a>';
|
||||
$out.='<div id="moretabsList'.$tabsname.'" style="position: absolute; left: -999em;text-align: left;margin:0px;padding:2px">'.$outmore.'</div>';
|
||||
$out.="</div>\n";
|
||||
|
||||
@ -5208,9 +5219,8 @@ function getCommonSubstitutionArray($outputlangs, $onlykey=0, $exclude=null, $ob
|
||||
|
||||
if (empty($exclude) || ! in_array('system', $exclude))
|
||||
{
|
||||
$substitutionarray=array_merge($substitutionarray, array(
|
||||
'__DOL_MAIN_URL_ROOT__'=>DOL_MAIN_URL_ROOT
|
||||
));
|
||||
$substitutionarray['__(AnyTranslationKey)__']=$outputlangs->trans('TranslationKey');
|
||||
$substitutionarray['__DOL_MAIN_URL_ROOT__']=DOL_MAIN_URL_ROOT;
|
||||
}
|
||||
if (empty($exclude) || ! in_array('mycompany', $exclude))
|
||||
{
|
||||
@ -5240,6 +5250,10 @@ function getCommonSubstitutionArray($outputlangs, $onlykey=0, $exclude=null, $ob
|
||||
$substitutionarray['__THIRDPARTY_ID__'] = '__THIRDPARTY_ID__';
|
||||
$substitutionarray['__THIRDPARTY_NAME__'] = '__THIRDPARTY_NAME__';
|
||||
|
||||
$substitutionarray['__MEMBER_CIVILITY__'] = '__MEMBER_CIVILITY__';
|
||||
$substitutionarray['__MEMBER_FIRSTNAME__'] = '__MEMBER_FIRSTNAME__';
|
||||
$substitutionarray['__MEMBER_LASTNAME__'] = '__MEMBER_LASTNAME__';
|
||||
|
||||
$substitutionarray['__PROJECT_ID__'] = '__PROJECT_ID__';
|
||||
$substitutionarray['__PROJECT_REF__'] = '__PROJECT_REF__';
|
||||
$substitutionarray['__PROJECT_NAME__'] = '__PROJECT_REF__';
|
||||
@ -5263,6 +5277,27 @@ function getCommonSubstitutionArray($outputlangs, $onlykey=0, $exclude=null, $ob
|
||||
$substitutionarray['__REFCLIENT__'] = (isset($object->ref_client) ? $object->ref_client : (isset($object->ref_customer) ? $object->ref_customer : ''));
|
||||
$substitutionarray['__REFSUPPLIER__'] = (isset($object->ref_supplier) ? $object->ref_supplier : '');
|
||||
|
||||
// TODO USe this ?
|
||||
$msgishtml = 0;
|
||||
|
||||
if (method_exists($object, 'getCivilityLabel')) $substitutionarray['__MEMBER_CIVILITY__'] = $object->getCivilityLabel();
|
||||
$substitutionarray['__MEMBER_FIRSTNAME__']=$msgishtml?dol_htmlentitiesbr($object->firstname):$object->firstname;
|
||||
$substitutionarray['__MEMBER_LASTNAME__']=$msgishtml?dol_htmlentitiesbr($object->lastname):$object->lastname;
|
||||
if (method_exists($object, 'getFullName')) $substitutionarray['__MEMBER_FULLNAME__']=$msgishtml?dol_htmlentitiesbr($object->getFullName($langs)):$object->getFullName($langs);
|
||||
$substitutionarray['__MEMBER_COMPANY__']=$msgishtml?dol_htmlentitiesbr($object->societe):$object->societe;
|
||||
$substitutionarray['__MEMBER_ADDRESS__']=$msgishtml?dol_htmlentitiesbr($object->address):$object->address;
|
||||
$substitutionarray['__MEMBER_ZIP__']=$msgishtml?dol_htmlentitiesbr($object->zip):$object->zip;
|
||||
$substitutionarray['__MEMBER_TOWN__']=$msgishtml?dol_htmlentitiesbr($object->town):$object->town;
|
||||
$substitutionarray['__MEMBER_COUNTRY__']=$msgishtml?dol_htmlentitiesbr($object->country):$object->country;
|
||||
$substitutionarray['__MEMBER_EMAIL__']=$msgishtml?dol_htmlentitiesbr($object->email):$object->email;
|
||||
$substitutionarray['__MEMBER_BIRTH__']=$msgishtml?dol_htmlentitiesbr($birthday):$birthday;
|
||||
$substitutionarray['__MEMBER_PHOTO__']=$msgishtml?dol_htmlentitiesbr($object->photo):$object->photo;
|
||||
$substitutionarray['__MEMBER_LOGIN__']=$msgishtml?dol_htmlentitiesbr($object->login):$object->login;
|
||||
$substitutionarray['__MEMBER_PASSWORD__']=$msgishtml?dol_htmlentitiesbr($object->pass):$object->pass;
|
||||
$substitutionarray['__MEMBER_PHONE__']=$msgishtml?dol_htmlentitiesbr($object->phone):$object->phone;
|
||||
$substitutionarray['__MEMBER_PHONEPRO__']=$msgishtml?dol_htmlentitiesbr($object->phone_perso):$object->phone_perso;
|
||||
$substitutionarray['__MEMBER_PHONEMOBILE__']=$msgishtml?dol_htmlentitiesbr($object->phone_mobile):$object->phone_mobile;
|
||||
|
||||
if (is_object($object->thirdparty) && $object->thirdparty->id > 0)
|
||||
{
|
||||
$substitutionarray['__THIRDPARTY_ID__'] = (is_object($object->thirdparty)?$object->thirdparty->id:'');
|
||||
@ -5287,10 +5322,20 @@ function getCommonSubstitutionArray($outputlangs, $onlykey=0, $exclude=null, $ob
|
||||
}
|
||||
}
|
||||
|
||||
$substitutionarray['__CONTRACT_HIGHEST_PLANNED_START_DATE__'] = 'TODO';
|
||||
$substitutionarray['__CONTRACT_HIGHEST_PLANNED_START_DATETIME__'] = 'TODO';
|
||||
$substitutionarray['__CONTRACT_LOWEST_EXPIRATION_DATE__'] = 'TODO';
|
||||
$substitutionarray['__CONTRACT_LOWEST_EXPIRATION_DATETIME__'] = 'TODO';
|
||||
if (is_object($object) && $object->element == 'contrat' && is_array($object->lines))
|
||||
{
|
||||
$dateplannedstart='';
|
||||
$datenextexpiration='';
|
||||
foreach($object->lines as $line)
|
||||
{
|
||||
if ($line->date_ouverture_prevue > $dateplannedstart) $dateplannedstart = $line->date_ouverture_prevue;
|
||||
if ($line->statut == 4 && $line->date_fin_prevue && (! $datenextexpiration || $line->date_fin_prevue < $datenextexpiration)) $datenextexpiration = $line->date_fin_prevue;
|
||||
}
|
||||
$substitutionarray['__CONTRACT_HIGHEST_PLANNED_START_DATE__'] = dol_print_date($dateplannedstart, 'dayrfc');
|
||||
$substitutionarray['__CONTRACT_HIGHEST_PLANNED_START_DATETIME__'] = dol_print_date($dateplannedstart, 'standard');
|
||||
$substitutionarray['__CONTRACT_LOWEST_EXPIRATION_DATE__'] = dol_print_date($datenextexpiration, 'dayrfc');
|
||||
$substitutionarray['__CONTRACT_LOWEST_EXPIRATION_DATETIME__'] = dol_print_date($datenextexpiration, 'standard');
|
||||
}
|
||||
|
||||
$substitutionarray['__ONLINE_PAYMENT_URL__'] = 'TODO';
|
||||
}
|
||||
|
||||
@ -34,7 +34,7 @@
|
||||
* @param string $readdir Directory source (use $destdir when not defined)
|
||||
* @param string $addfieldentry Array of the field entry to add array('key'=>,'type'=>,''label'=>,'visible'=>,'enabled'=>,'position'=>,'notnull'=>','index'=>,'searchall'=>,'comment'=>,'help'=>,'isameasure')
|
||||
* @param string $delfieldentry Id of field to remove
|
||||
* @return int <=0 if KO, >0 if OK
|
||||
* @return int|object <=0 if KO, Object if OK
|
||||
*/
|
||||
function rebuildObjectClass($destdir, $module, $objectname, $newmask, $readdir='', $addfieldentry=array() ,$delfieldentry='')
|
||||
{
|
||||
@ -43,13 +43,29 @@ function rebuildObjectClass($destdir, $module, $objectname, $newmask, $readdir='
|
||||
if (empty($objectname)) return -1;
|
||||
if (empty($readdir)) $readdir=$destdir;
|
||||
|
||||
if (! empty($addfieldentry['arrayofkeyval']) && ! is_array($addfieldentry['arrayofkeyval']))
|
||||
{
|
||||
dol_print_error('', 'Bad parameter addfieldentry with a property arrayofkeyval defined but that is not an array.');
|
||||
return -1;
|
||||
}
|
||||
|
||||
// Check parameters
|
||||
if (count($addfieldentry) > 0)
|
||||
{
|
||||
if (empty($addfieldentry['name']))
|
||||
{
|
||||
setEventMessages($langs->trans('ErrorFieldRequired', $langs->transnoentitiesnoconv("Name")), null, 'errors');
|
||||
return -2;
|
||||
}
|
||||
if (empty($addfieldentry['label']))
|
||||
{
|
||||
setEventMessages($langs->trans('ErrorFieldRequired', $langs->transnoentitiesnoconv("Label")), null, 'errors');
|
||||
return -2;
|
||||
}
|
||||
if (! preg_match('/^(integer|date|timestamp|varchar|double)/', $addfieldentry['type']))
|
||||
{
|
||||
setEventMessages($langs->trans('FilesForObjectUpdated', $objectname), null, 'errors');
|
||||
return -1;
|
||||
setEventMessages($langs->trans('BadFormatForType', $objectname), null, 'errors');
|
||||
return -2;
|
||||
}
|
||||
}
|
||||
|
||||
@ -59,7 +75,7 @@ function rebuildObjectClass($destdir, $module, $objectname, $newmask, $readdir='
|
||||
{
|
||||
$langs->load("errors");
|
||||
setEventMessages($langs->trans("ErrorFileNotFound", $pathoffiletoeditsrc), null, 'errors');
|
||||
return -1;
|
||||
return -3;
|
||||
}
|
||||
|
||||
//$pathoffiletoedittmp=$destdir.'/class/'.strtolower($objectname).'.class.php.tmp';
|
||||
@ -69,7 +85,7 @@ function rebuildObjectClass($destdir, $module, $objectname, $newmask, $readdir='
|
||||
{
|
||||
include_once $pathoffiletoeditsrc;
|
||||
if (class_exists($objectname)) $object=new $objectname($db);
|
||||
else return -1;
|
||||
else return -4;
|
||||
|
||||
// Backup old file
|
||||
dol_copy($pathoffiletoedittarget, $pathoffiletoedittarget.'.back', $newmask, 1);
|
||||
@ -82,8 +98,9 @@ function rebuildObjectClass($destdir, $module, $objectname, $newmask, $readdir='
|
||||
{
|
||||
if (is_array($addfieldentry) && count($addfieldentry))
|
||||
{
|
||||
$name=$addfieldentry['name'];
|
||||
$name=$addfieldentry['name'];
|
||||
unset($addfieldentry['name']);
|
||||
|
||||
$object->fields[$name]=$addfieldentry;
|
||||
}
|
||||
if (! empty($delfieldentry))
|
||||
@ -104,6 +121,7 @@ function rebuildObjectClass($destdir, $module, $objectname, $newmask, $readdir='
|
||||
|
||||
if (count($object->fields))
|
||||
{
|
||||
|
||||
foreach($object->fields as $key => $val)
|
||||
{
|
||||
$i++;
|
||||
@ -117,11 +135,24 @@ function rebuildObjectClass($destdir, $module, $objectname, $newmask, $readdir='
|
||||
if ($val['comment']) $texttoinsert.= " 'comment'=>'".$val['comment']."',";
|
||||
if ($val['isameasure']) $texttoinsert.= " 'isameasure'=>'".$val['isameasure']."',";
|
||||
if ($val['help']) $texttoinsert.= " 'help'=>'".$val['help']."',";
|
||||
if ($val['arrayofkeyval'])
|
||||
{
|
||||
$texttoinsert.= " 'arrayofkeyval'=>array(";
|
||||
$i=0;
|
||||
foreach($val['arrayofkeyval'] as $key2 => $val2)
|
||||
{
|
||||
if ($i) $texttoinsert.=", ";
|
||||
$texttoinsert.="'".$key2."'=>'".$val2."'";
|
||||
$i++;
|
||||
}
|
||||
$texttoinsert.= ")";
|
||||
}
|
||||
$texttoinsert.= "),\n";
|
||||
}
|
||||
}
|
||||
|
||||
$texttoinsert.= "\t".');'."\n";
|
||||
//print ($texttoinsert);exit;
|
||||
|
||||
if (count($object->fields))
|
||||
{
|
||||
@ -152,12 +183,12 @@ function rebuildObjectClass($destdir, $module, $objectname, $newmask, $readdir='
|
||||
file_put_contents(dol_osencode($pathoffiletoedittarget), $contentclass);
|
||||
@chmod($pathoffiletoedittarget, octdec($newmask));
|
||||
|
||||
return 1;
|
||||
return $object;
|
||||
}
|
||||
catch(Exception $e)
|
||||
{
|
||||
print $e->getMessage();
|
||||
return -1;
|
||||
return -5;
|
||||
}
|
||||
}
|
||||
|
||||
@ -169,12 +200,15 @@ function rebuildObjectClass($destdir, $module, $objectname, $newmask, $readdir='
|
||||
* @param string $objectname Name of object
|
||||
* @param string $newmask New mask
|
||||
* @param string $readdir Directory source (use $destdir when not defined)
|
||||
* @param Object $object If object was already loaded/known, it is pass to avaoid another include and new.
|
||||
* @return int <=0 if KO, >0 if OK
|
||||
*/
|
||||
function rebuildObjectSql($destdir, $module, $objectname, $newmask, $readdir='')
|
||||
function rebuildObjectSql($destdir, $module, $objectname, $newmask, $readdir='', $object=null)
|
||||
{
|
||||
global $db, $langs;
|
||||
|
||||
$error = 0;
|
||||
|
||||
if (empty($objectname)) return -1;
|
||||
if (empty($readdir)) $readdir=$destdir;
|
||||
|
||||
@ -190,11 +224,15 @@ function rebuildObjectSql($destdir, $module, $objectname, $newmask, $readdir='')
|
||||
return -1;
|
||||
}
|
||||
|
||||
// Load object from myobject.class.php
|
||||
try
|
||||
{
|
||||
include_once $pathoffiletoclasssrc;
|
||||
if (class_exists($objectname)) $object=new $objectname($db);
|
||||
else return -1;
|
||||
if (! is_object($object))
|
||||
{
|
||||
include_once $pathoffiletoclasssrc;
|
||||
if (class_exists($objectname)) $object=new $objectname($db);
|
||||
else return -1;
|
||||
}
|
||||
}
|
||||
catch(Exception $e)
|
||||
{
|
||||
@ -225,9 +263,15 @@ function rebuildObjectSql($destdir, $module, $objectname, $newmask, $readdir='')
|
||||
|
||||
$contentsql = preg_replace('/-- BEGIN MODULEBUILDER FIELDS.*END MODULEBUILDER FIELDS/ims', $texttoinsert, $contentsql);
|
||||
|
||||
file_put_contents($pathoffiletoedittarget, $contentsql);
|
||||
@chmod($pathoffiletoedittarget, octdec($newmask));
|
||||
|
||||
$result = file_put_contents($pathoffiletoedittarget, $contentsql);
|
||||
if ($result)
|
||||
{
|
||||
@chmod($pathoffiletoedittarget, octdec($newmask));
|
||||
}
|
||||
else
|
||||
{
|
||||
$error++;
|
||||
}
|
||||
|
||||
// Edit .key.sql file
|
||||
$pathoffiletoeditsrc=$destdir.'/sql/llx_'.strtolower($objectname).'.key.sql';
|
||||
@ -255,10 +299,17 @@ function rebuildObjectSql($destdir, $module, $objectname, $newmask, $readdir='')
|
||||
|
||||
dol_mkdir(dirname($pathoffiletoedittarget));
|
||||
|
||||
file_put_contents($pathoffiletoedittarget, $contentsql);
|
||||
@chmod($pathoffiletoedittarget, octdec($newmask));
|
||||
$result2 = file_put_contents($pathoffiletoedittarget, $contentsql);
|
||||
if ($result)
|
||||
{
|
||||
@chmod($pathoffiletoedittarget, octdec($newmask));
|
||||
}
|
||||
else
|
||||
{
|
||||
$error++;
|
||||
}
|
||||
|
||||
return 1;
|
||||
return $error ? -1 : 1;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -184,7 +184,7 @@ function dol_loginfunction($langs,$conf,$mysoc)
|
||||
// Set cookie for timeout management
|
||||
$prefix=dol_getprefix();
|
||||
$sessiontimeout='DOLSESSTIMEOUT_'.$prefix;
|
||||
if (! empty($conf->global->MAIN_SESSION_TIMEOUT)) setcookie($sessiontimeout, $conf->global->MAIN_SESSION_TIMEOUT, 0, "/", '', 0);
|
||||
if (! empty($conf->global->MAIN_SESSION_TIMEOUT)) setcookie($sessiontimeout, $conf->global->MAIN_SESSION_TIMEOUT, 0, "/", null, false, true);
|
||||
|
||||
if (GETPOST('urlfrom','alpha')) $_SESSION["urlfrom"]=GETPOST('urlfrom','alpha');
|
||||
else unset($_SESSION["urlfrom"]);
|
||||
|
||||
@ -73,6 +73,13 @@ function print_auguria_menu($db,$atarget,$type_user,&$tabMenu,&$menu,$noout=0,$m
|
||||
$showmode=dol_auguria_showmenu($type_user,$newTabMenu[$i],$listofmodulesforexternal);
|
||||
if ($showmode == 1)
|
||||
{
|
||||
// $menu_array[$i]['url'] can be a relative url, a full external url or a dynamic value like '$conf->global->APARAM)
|
||||
if (preg_match('/^\$conf->global->([^\?]+)/', $newTabMenu[$i]['url'], $reg))
|
||||
{
|
||||
$keyforsconst=$reg[1];
|
||||
$newTabMenu[$i]['url'] = $conf->global->$keyforsconst;
|
||||
}
|
||||
|
||||
$url = $shorturl = $newTabMenu[$i]['url'];
|
||||
|
||||
if (! preg_match("/^(http:\/\/|https:\/\/)/i",$newTabMenu[$i]['url']))
|
||||
|
||||
@ -1598,6 +1598,13 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu
|
||||
}
|
||||
}
|
||||
|
||||
// $menu_array[$i]['url'] can be a relative url, a full external url or a dynamic value like '$conf->global->APARAM)
|
||||
if (preg_match('/^\$conf->global->([^\?]+)/', $menu_array[$i]['url'], $reg))
|
||||
{
|
||||
$keyforsconst=$reg[1];
|
||||
$menu_array[$i]['url'] = $conf->global->$keyforsconst;
|
||||
}
|
||||
|
||||
$url = $shorturl = $menu_array[$i]['url'];
|
||||
|
||||
if (! preg_match("/^(http:\/\/|https:\/\/)/i",$menu_array[$i]['url']))
|
||||
|
||||
@ -73,7 +73,7 @@ if ($conf->use_javascript_ajax && 1 == 2) // select2 is ko with jmobile
|
||||
{
|
||||
if (! is_object($form)) $form=new Form($db);
|
||||
$selected=-1;
|
||||
$searchform.='<br><br>'.$form->selectArrayAjax('searchselectcombo', DOL_URL_ROOT.'/core/ajax/selectsearchbox.php', $selected, 'data-role="none"', '', 0, 1, 'minwidth300', 1, $langs->trans("Search"), 0);
|
||||
$searchform.='<br><br>'.$form->selectArrayAjax('searchselectcombo', DOL_URL_ROOT.'/core/ajax/selectsearchbox.php', $selected, '', '', 0, 1, 'minwidth300', 1, $langs->trans("Search"), 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@ -73,13 +73,16 @@ if ($action == 'presend')
|
||||
|
||||
// Build document if it not exists
|
||||
if (! $file || ! is_readable($file)) {
|
||||
$result = $object->generateDocument(GETPOST('model') ? GETPOST('model') : $object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref);
|
||||
if ($result <= 0) {
|
||||
dol_print_error($db, $object->error, $object->errors);
|
||||
exit();
|
||||
if ($object->element != 'member')
|
||||
{
|
||||
$result = $object->generateDocument(GETPOST('model') ? GETPOST('model') : $object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref);
|
||||
if ($result <= 0) {
|
||||
dol_print_error($db, $object->error, $object->errors);
|
||||
exit();
|
||||
}
|
||||
$fileparams = dol_most_recent_file($diroutput . '/' . $ref, preg_quote($ref, '/').'[^\-]+');
|
||||
$file = $fileparams['fullname'];
|
||||
}
|
||||
$fileparams = dol_most_recent_file($diroutput . '/' . $ref, preg_quote($ref, '/').'[^\-]+');
|
||||
$file = $fileparams['fullname'];
|
||||
}
|
||||
|
||||
print '<div id="formmailbeforetitle" name="formmailbeforetitle"></div>';
|
||||
@ -120,6 +123,10 @@ if ($action == 'presend')
|
||||
$liste[$key] = $value;
|
||||
}
|
||||
}
|
||||
elseif ($object->element == 'member')
|
||||
{
|
||||
$liste['thirdparty'] = $object->getFullName($langs)." <".$object->email.">";
|
||||
}
|
||||
else
|
||||
{
|
||||
foreach ($object->thirdparty->thirdparty_and_contact_email_array(1) as $key => $value) {
|
||||
@ -141,42 +148,6 @@ if ($action == 'presend')
|
||||
$substitutionarray['__CHECK_READ__'] = (is_object($object) && is_object($object->thirdparty)) ? '<img src="' . DOL_MAIN_URL_ROOT . '/public/emailing/mailing-read.php?tag=' . $object->thirdparty->tag . '&securitykey=' . urlencode($conf->global->MAILING_EMAIL_UNSUBSCRIBE_KEY) . '" width="1" height="1" style="width:1px;height:1px" border="0"/>' : '';
|
||||
$substitutionarray['__PERSONALIZED__'] = ''; // deprecated
|
||||
$substitutionarray['__CONTACTCIVNAME__'] = '';
|
||||
// Add specific substitution for contracts
|
||||
if (is_object($object) && $object->element == 'contrat' && is_array($object->lines))
|
||||
{
|
||||
$dateplannedstart='';
|
||||
$datenextexpiration='';
|
||||
foreach($object->lines as $line)
|
||||
{
|
||||
if ($line->date_ouverture_prevue > $dateplannedstart) $dateplannedstart = $line->date_ouverture_prevue;
|
||||
if ($line->statut == 4 && $line->date_fin_prevue && (! $datenextexpiration || $line->date_fin_prevue < $datenextexpiration)) $datenextexpiration = $line->date_fin_prevue;
|
||||
}
|
||||
$substitutionarray['__CONTRACT_HIGHEST_PLANNED_START_DATE__'] = dol_print_date($dateplannedstart, 'dayrfc');
|
||||
$substitutionarray['__CONTRACT_HIGHEST_PLANNED_START_DATETIME__'] = dol_print_date($dateplannedstart, 'standard');
|
||||
$substitutionarray['__CONTRACT_LOWEST_EXPIRATION_DATE__'] = dol_print_date($datenextexpiration, 'dayrfc');
|
||||
$substitutionarray['__CONTRACT_LOWEST_EXPIRATION_DATETIME__'] = dol_print_date($datenextexpiration, 'standard');
|
||||
}
|
||||
|
||||
// Choose one contact for the __CONTACTCIVNAME__ TODO Really not reliable.
|
||||
/*
|
||||
$custcontact = '';
|
||||
$contactarr = array();
|
||||
$contactarr = $object->liste_contact(-1, 'external');
|
||||
if (is_array($contactarr) && count($contactarr) > 0)
|
||||
{
|
||||
foreach ($contactarr as $contact)
|
||||
{
|
||||
if ($contact['libelle'] == $langs->trans('TypeContact_commande_external_CUSTOMER')) { // TODO Use code and not label
|
||||
$contactstatic = new Contact($db);
|
||||
$contactstatic->fetch($contact ['id']);
|
||||
$custcontact = $contactstatic->getFullName($langs, 1);
|
||||
}
|
||||
}
|
||||
|
||||
if (! empty($custcontact)) {
|
||||
$formmail->substit['__CONTACTCIVNAME__'] = $custcontact;
|
||||
}
|
||||
}*/
|
||||
|
||||
$parameters = array(
|
||||
'mode' => 'formemail'
|
||||
|
||||
@ -74,7 +74,7 @@ if (! empty($conf->global->MAIN_EMAIL_ADD_TRACK_ID) && ($conf->global->MAIN_EMAI
|
||||
$formmail->frommail = dolAddEmailTrackId($formmail->frommail, $trackid);
|
||||
}
|
||||
$formmail->withfrom = 1;
|
||||
$liste = $langs->trans("AllRecipientSelected", count($listofselectedthirdparties));
|
||||
$liste = $langs->trans("AllRecipientSelected", count($arrayofselected));
|
||||
if (count($listofselectedthirdparties) == 1) // Only 1 different recipient selected, we can suggest contacts
|
||||
{
|
||||
$liste = array();
|
||||
@ -97,8 +97,10 @@ if (count($listofselectedthirdparties) == 1) // Only 1 different recipient selec
|
||||
} else {
|
||||
$formmail->withtoreadonly = 1;
|
||||
}
|
||||
$formmail->withto = $liste;
|
||||
$formmail->withtofree = 0;
|
||||
|
||||
$formmail->withoptiononeemailperrecipient = empty($liste)?0:((GETPOST('oneemailperrecipient')=='on')?1:-1);
|
||||
$formmail->withto = empty($liste)?(GETPOST('sendto','alpha')?GETPOST('sendto','alpha'):array()):$liste;
|
||||
$formmail->withtofree = empty($liste)?1:0;
|
||||
$formmail->withtocc = 1;
|
||||
$formmail->withtoccc = $conf->global->MAIN_EMAIL_USECCC;
|
||||
$formmail->withtopic = $langs->transnoentities($topicmail, '__REF__', '__REFCLIENT__');
|
||||
@ -119,21 +121,6 @@ $substitutionarray['__EMAIL__'] = $sendto;
|
||||
$substitutionarray['__CHECK_READ__'] = (is_object($object) && is_object($object->thirdparty)) ? '<img src="' . DOL_MAIN_URL_ROOT . '/public/emailing/mailing-read.php?tag=' . $object->thirdparty->tag . '&securitykey=' . urlencode($conf->global->MAILING_EMAIL_UNSUBSCRIBE_KEY) . '" width="1" height="1" style="width:1px;height:1px" border="0"/>' : '';
|
||||
$substitutionarray['__PERSONALIZED__'] = ''; // deprecated
|
||||
$substitutionarray['__CONTACTCIVNAME__'] = '';
|
||||
// Add specific substitution for contracts
|
||||
if (is_object($object) && $object->element == 'contrat' && is_array($object->lines))
|
||||
{
|
||||
$dateplannedstart='';
|
||||
$datenextexpiration='';
|
||||
foreach($object->lines as $line)
|
||||
{
|
||||
if ($line->date_ouverture_prevue > $dateplannedstart) $dateplannedstart = $line->date_ouverture_prevue;
|
||||
if ($line->statut == 4 && $line->date_fin_prevue && (! $datenextexpiration || $line->date_fin_prevue < $datenextexpiration)) $datenextexpiration = $line->date_fin_prevue;
|
||||
}
|
||||
$substitutionarray['__CONTRACT_HIGHEST_PLANNED_START_DATE__'] = dol_print_date($dateplannedstart, 'dayrfc');
|
||||
$substitutionarray['__CONTRACT_HIGHEST_PLANNED_START_DATETIME__'] = dol_print_date($dateplannedstart, 'standard');
|
||||
$substitutionarray['__CONTRACT_LOWEST_EXPIRATION_DATE__'] = dol_print_date($datenextexpiration, 'dayrfc');
|
||||
$substitutionarray['__CONTRACT_LOWEST_EXPIRATION_DATETIME__'] = dol_print_date($datenextexpiration, 'standard');
|
||||
}
|
||||
|
||||
$parameters = array(
|
||||
'mode' => 'formemail'
|
||||
|
||||
@ -317,7 +317,7 @@ else {
|
||||
<td align="right" class="nobottom margininfos linecolmargin">
|
||||
<!-- For predef product -->
|
||||
<?php if (! empty($conf->product->enabled) || ! empty($conf->service->enabled)) { ?>
|
||||
<select id="fournprice_predef" name="fournprice_predef" class="flat" data-role="none" style="display: none;"></select>
|
||||
<select id="fournprice_predef" name="fournprice_predef" class="flat" style="display: none;"></select>
|
||||
<?php } ?>
|
||||
<!-- For free product -->
|
||||
<input type="text" size="5" id="buying_price" name="buying_price" class="flat right" value="<?php echo (isset($_POST["buying_price"])?GETPOST("buying_price",'alpha',2):''); ?>">
|
||||
|
||||
@ -179,7 +179,7 @@ $coldisplay=-1; // We remove first td
|
||||
<td align="right" class="margininfos"><?php $coldisplay++; ?>
|
||||
<!-- For predef product -->
|
||||
<?php if (! empty($conf->product->enabled) || ! empty($conf->service->enabled)) { ?>
|
||||
<select id="fournprice_predef" name="fournprice_predef" class="flat right" data-role="none" style="display: none;"></select>
|
||||
<select id="fournprice_predef" name="fournprice_predef" class="flat right" style="display: none;"></select>
|
||||
<?php } ?>
|
||||
<!-- For free product -->
|
||||
<input class="flat right" type="text" size="5" id="buying_price" name="buying_price" class="hideobject" value="<?php echo price($line->pa_ht,0,'',0); ?>">
|
||||
@ -266,21 +266,21 @@ jQuery(document).ready(function()
|
||||
if (event.which != 9 && (event.which < 37 ||event.which > 40) && jQuery("#price_ht").val() != '') {
|
||||
jQuery("#price_ttc").val('');
|
||||
jQuery("#multicurrency_subprice").val('');
|
||||
}
|
||||
}
|
||||
});
|
||||
jQuery("#price_ttc").keyup(function(event) {
|
||||
// console.log(event.which); // discard event tag and arrows
|
||||
if (event.which != 9 && (event.which < 37 || event.which > 40) && jQuery("#price_ttc").val() != '') {
|
||||
jQuery("#price_ht").val('');
|
||||
jQuery("#multicurrency_subprice").val('');
|
||||
}
|
||||
}
|
||||
});
|
||||
jQuery("#multicurrency_subprice").keyup(function(event) {
|
||||
// console.log(event.which); // discard event tag and arrows
|
||||
if (event.which != 9 && (event.which < 37 || event.which > 40) && jQuery("#price_ttc").val() != '') {
|
||||
jQuery("#price_ht").val('');
|
||||
jQuery("#price_ttc").val('');
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
<?php
|
||||
|
||||
@ -148,7 +148,7 @@ if ($action=='add')
|
||||
$object->params=GETPOST('params');
|
||||
$object->md5params=GETPOST('md5params');
|
||||
$object->module_name=GETPOST('module_name','alpha');
|
||||
$object->note=GETPOST('note');
|
||||
$object->note=GETPOST('note','none');
|
||||
$object->datestart=dol_mktime(GETPOST('datestarthour','int'), GETPOST('datestartmin','int'), 0, GETPOST('datestartmonth','int'), GETPOST('datestartday','int'), GETPOST('datestartyear','int'));
|
||||
$object->dateend=dol_mktime(GETPOST('dateendhour','int'), GETPOST('dateendmin','int'), 0, GETPOST('dateendmonth','int'), GETPOST('dateendday','int'), GETPOST('dateendyear','int'));
|
||||
$object->datenextrun=dol_mktime(GETPOST('datenextrunhour','int'), GETPOST('datenextrunmin','int'), 0, GETPOST('datenextrunmonth','int'), GETPOST('datenextrunday','int'), GETPOST('datenextrunyear','int'));
|
||||
@ -184,7 +184,7 @@ if ($action=='update')
|
||||
$object->params=GETPOST('params');
|
||||
$object->md5params=GETPOST('md5params');
|
||||
$object->module_name=GETPOST('module_name','alpha');
|
||||
$object->note=GETPOST('note');
|
||||
$object->note=GETPOST('note','none');
|
||||
$object->datestart=dol_mktime(GETPOST('datestarthour','int'), GETPOST('datestartmin','int'), 0, GETPOST('datestartmonth','int'), GETPOST('datestartday','int'), GETPOST('datestartyear','int'));
|
||||
$object->dateend=dol_mktime(GETPOST('dateendhour','int'), GETPOST('dateendmin','int'), 0, GETPOST('dateendmonth','int'), GETPOST('dateendday','int'), GETPOST('dateendyear','int'));
|
||||
$object->datenextrun=dol_mktime(GETPOST('datenextrunhour','int'), GETPOST('datenextrunmin','int'), 0, GETPOST('datenextrunmonth','int'), GETPOST('datenextrunday','int'), GETPOST('datenextrunyear','int'));
|
||||
|
||||
@ -219,8 +219,8 @@ if (empty($reshook))
|
||||
$object->shipping_method_id = GETPOST('shipping_method_id','int');
|
||||
$object->tracking_number = GETPOST('tracking_number','alpha');
|
||||
$object->ref_int = GETPOST('ref_int','alpha');
|
||||
$object->note_private = GETPOST('note_private');
|
||||
$object->note_public = GETPOST('note_public');
|
||||
$object->note_private = GETPOST('note_private','none');
|
||||
$object->note_public = GETPOST('note_public','none');
|
||||
$object->fk_incoterms = GETPOST('incoterm_id', 'int');
|
||||
$object->location_incoterms = GETPOST('location_incoterms', 'alpha');
|
||||
|
||||
@ -780,9 +780,15 @@ if ($action == 'create')
|
||||
$reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$object,$action); // Note that $action and $object may have been modified by hook
|
||||
print $hookmanager->resPrint;
|
||||
|
||||
if (empty($reshook) && ! empty($extrafields->attribute_label)) {
|
||||
print $object->showOptionals($extrafields, 'edit');
|
||||
}
|
||||
if (empty($reshook) && ! empty($extrafields->attribute_label)) {
|
||||
// copy from order
|
||||
$orderExtrafields = new Extrafields($db);
|
||||
$orderExtrafieldLabels = $orderExtrafields->fetch_name_optionals_label($object->table_element);
|
||||
if ($object->fetch_optionals($object->id, $orderExtrafieldLabels) > 0) {
|
||||
$expe->array_options = array_merge($expe->array_options, $object->array_options);
|
||||
}
|
||||
print $object->showOptionals($extrafields, 'edit');
|
||||
}
|
||||
|
||||
|
||||
// Incoterms
|
||||
@ -1304,8 +1310,13 @@ if ($action == 'create')
|
||||
if (is_array($extralabelslines) && count($extralabelslines)>0)
|
||||
{
|
||||
$colspan=5;
|
||||
$orderLineExtrafields = new Extrafields($db);
|
||||
$orderLineExtrafieldLabels = $orderLineExtrafields->fetch_name_optionals_label($object->table_element_line);
|
||||
$srcLine = new OrderLine($db);
|
||||
$srcLine->fetch_optionals($line->id,$orderLineExtrafieldLabels); // fetch extrafields also available in orderline
|
||||
$line = new ExpeditionLigne($db);
|
||||
$line->fetch_optionals($object->id,$extralabelslines);
|
||||
$line->array_options = array_merge($line->array_options, $srcLine->array_options);
|
||||
print '<tr class="oddeven">';
|
||||
print $line->showOptionals($extrafieldsline, 'edit', array('style'=>$bc[$var], 'colspan'=>$colspan),$indiceAsked);
|
||||
print '</tr>';
|
||||
|
||||
@ -213,8 +213,8 @@ if (empty($reshook))
|
||||
$object->fk_statut = 1;
|
||||
$object->fk_c_paiement = GETPOST('fk_c_paiement','int');
|
||||
$object->fk_user_validator = GETPOST('fk_user_validator','int');
|
||||
$object->note_public = GETPOST('note_public');
|
||||
$object->note_private = GETPOST('note_private');
|
||||
$object->note_public = GETPOST('note_public','none');
|
||||
$object->note_private = GETPOST('note_private','none');
|
||||
// Fill array 'array_options' with data from add form
|
||||
if (! $error)
|
||||
{
|
||||
@ -264,8 +264,8 @@ if (empty($reshook))
|
||||
}
|
||||
|
||||
$object->fk_c_paiement = GETPOST('fk_c_paiement','int');
|
||||
$object->note_public = GETPOST('note_public');
|
||||
$object->note_private = GETPOST('note_private');
|
||||
$object->note_public = GETPOST('note_public','none');
|
||||
$object->note_private = GETPOST('note_private','none');
|
||||
$object->fk_user_modif = $user->id;
|
||||
|
||||
$result = $object->update($user);
|
||||
|
||||
@ -64,7 +64,7 @@ $confirm = GETPOST('confirm','alpha');
|
||||
$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');
|
||||
$note_public = GETPOST('note_public','none');
|
||||
$lineid = GETPOST('line_id','int');
|
||||
|
||||
//PDF
|
||||
@ -208,8 +208,8 @@ if (empty($reshook))
|
||||
$object->description = GETPOST('description');
|
||||
$object->ref = $ref;
|
||||
$object->modelpdf = GETPOST('model','alpha');
|
||||
$object->note_private = GETPOST('note_private');
|
||||
$object->note_public = GETPOST('note_public');
|
||||
$object->note_private = GETPOST('note_private','none');
|
||||
$object->note_public = GETPOST('note_public','none');
|
||||
|
||||
if ($object->socid > 0)
|
||||
{
|
||||
@ -877,8 +877,8 @@ if ($action == 'create')
|
||||
|
||||
$soc = $objectsrc->client;
|
||||
|
||||
$note_private = (! empty($objectsrc->note) ? $objectsrc->note : (! empty($objectsrc->note_private) ? $objectsrc->note_private : GETPOST('note_private')));
|
||||
$note_public = (! empty($objectsrc->note_public) ? $objectsrc->note_public : GETPOST('note_public'));
|
||||
$note_private = (! empty($objectsrc->note) ? $objectsrc->note : (! empty($objectsrc->note_private) ? $objectsrc->note_private : GETPOST('note_private','none')));
|
||||
$note_public = (! empty($objectsrc->note_public) ? $objectsrc->note_public : GETPOST('note_public','none'));
|
||||
|
||||
// Object source contacts list
|
||||
$srccontactslist = $objectsrc->liste_contact(-1,'external',1);
|
||||
|
||||
@ -417,7 +417,7 @@ if (empty($reshook))
|
||||
$localtax1_tx,
|
||||
$localtax2_tx,
|
||||
$idprod,
|
||||
$productsupplier->id,
|
||||
$productsupplier->product_fourn_price_id,
|
||||
$productsupplier->fourn_ref,
|
||||
$remise_percent,
|
||||
'HT',
|
||||
@ -988,8 +988,8 @@ if (empty($reshook))
|
||||
$object->cond_reglement_id = GETPOST('cond_reglement_id');
|
||||
$object->mode_reglement_id = GETPOST('mode_reglement_id');
|
||||
$object->fk_account = GETPOST('fk_account', 'int');
|
||||
$object->note_private = GETPOST('note_private');
|
||||
$object->note_public = GETPOST('note_public');
|
||||
$object->note_private = GETPOST('note_private','none');
|
||||
$object->note_public = GETPOST('note_public','none');
|
||||
$object->date_livraison = $datelivraison;
|
||||
$object->fk_incoterms = GETPOST('incoterm_id', 'int');
|
||||
$object->location_incoterms = GETPOST('location_incoterms', 'alpha');
|
||||
@ -1534,7 +1534,7 @@ if ($action=='create')
|
||||
|
||||
print '<tr><td>'.$langs->trans('NotePublic').'</td>';
|
||||
print '<td>';
|
||||
$doleditor = new DolEditor('note_public', isset($note_public) ? $note_public : GETPOST('note_public'), '', 80, 'dolibarr_notes', 'In', 0, false, true, ROWS_3, '90%');
|
||||
$doleditor = new DolEditor('note_public', isset($note_public) ? $note_public : GETPOST('note_public','none'), '', 80, 'dolibarr_notes', 'In', 0, false, true, ROWS_3, '90%');
|
||||
print $doleditor->Create(1);
|
||||
print '</td>';
|
||||
//print '<textarea name="note_public" wrap="soft" cols="60" rows="'.ROWS_5.'"></textarea>';
|
||||
@ -1542,7 +1542,7 @@ if ($action=='create')
|
||||
|
||||
print '<tr><td>'.$langs->trans('NotePrivate').'</td>';
|
||||
print '<td>';
|
||||
$doleditor = new DolEditor('note_private', isset($note_private) ? $note_private : GETPOST('note_private'), '', 80, 'dolibarr_notes', 'In', 0, false, true, ROWS_3, '90%');
|
||||
$doleditor = new DolEditor('note_private', isset($note_private) ? $note_private : GETPOST('note_private','none'), '', 80, 'dolibarr_notes', 'In', 0, false, true, ROWS_3, '90%');
|
||||
print $doleditor->Create(1);
|
||||
print '</td>';
|
||||
//print '<td><textarea name="note_private" wrap="soft" cols="60" rows="'.ROWS_5.'"></textarea></td>';
|
||||
|
||||
@ -155,8 +155,8 @@ if (($action == 'create' || $action == 'add') && ! $error) {
|
||||
$object->libelle = GETPOST('libelle');
|
||||
$object->date = $datefacture;
|
||||
$object->date_echeance = $datedue;
|
||||
$object->note_public = GETPOST('note_public');
|
||||
$object->note_private = GETPOST('note_private');
|
||||
$object->note_public = GETPOST('note_public','none');
|
||||
$object->note_private = GETPOST('note_private','none');
|
||||
$object->cond_reglement_id = GETPOST('cond_reglement_id');
|
||||
$object->mode_reglement_id = GETPOST('mode_reglement_id');
|
||||
$projectid = GETPOST('projectid');
|
||||
|
||||
@ -443,8 +443,8 @@ if (empty($reshook))
|
||||
$object->libelle = GETPOST('label');
|
||||
$object->date = $datefacture;
|
||||
$object->date_echeance = $datedue;
|
||||
$object->note_public = GETPOST('note_public');
|
||||
$object->note_private = GETPOST('note_private');
|
||||
$object->note_public = GETPOST('note_public','none');
|
||||
$object->note_private = GETPOST('note_private','none');
|
||||
$object->cond_reglement_id = GETPOST('cond_reglement_id');
|
||||
$object->mode_reglement_id = GETPOST('mode_reglement_id');
|
||||
$object->fk_account = GETPOST('fk_account', 'int');
|
||||
@ -507,8 +507,8 @@ if (empty($reshook))
|
||||
$object->libelle = $_POST['label'];
|
||||
$object->date = $datefacture;
|
||||
$object->date_echeance = $datedue;
|
||||
$object->note_public = GETPOST('note_public');
|
||||
$object->note_private = GETPOST('note_private');
|
||||
$object->note_public = GETPOST('note_public','none');
|
||||
$object->note_private = GETPOST('note_private','none');
|
||||
$object->cond_reglement_id = GETPOST('cond_reglement_id');
|
||||
$object->mode_reglement_id = GETPOST('mode_reglement_id');
|
||||
$object->fk_account = GETPOST('fk_account', 'int');
|
||||
@ -616,8 +616,8 @@ if (empty($reshook))
|
||||
$object->libelle = $_POST['label'];
|
||||
$object->date = $datefacture;
|
||||
$object->date_echeance = $datedue;
|
||||
$object->note_public = GETPOST('note_public');
|
||||
$object->note_private = GETPOST('note_private');
|
||||
$object->note_public = GETPOST('note_public','none');
|
||||
$object->note_private = GETPOST('note_private','none');
|
||||
$object->cond_reglement_id = GETPOST('cond_reglement_id');
|
||||
$object->mode_reglement_id = GETPOST('mode_reglement_id');
|
||||
$object->fk_account = GETPOST('fk_account', 'int');
|
||||
@ -1683,8 +1683,8 @@ if ($action == 'create')
|
||||
print $desc;
|
||||
|
||||
print '<div id="credit_note_options" class="clearboth">';
|
||||
print ' <input data-role="none" type="checkbox" name="invoiceAvoirWithLines" id="invoiceAvoirWithLines" value="1" onclick="if($(this).is(\':checked\') ) { $(\'#radio_creditnote\').prop(\'checked\', true); $(\'#invoiceAvoirWithPaymentRestAmount\').removeAttr(\'checked\'); }" '.(GETPOST('invoiceAvoirWithLines','int')>0 ? 'checked':'').' /> <label for="invoiceAvoirWithLines">'.$langs->trans('invoiceAvoirWithLines')."</label>";
|
||||
print '<br> <input data-role="none" type="checkbox" name="invoiceAvoirWithPaymentRestAmount" id="invoiceAvoirWithPaymentRestAmount" value="1" onclick="if($(this).is(\':checked\') ) { $(\'#radio_creditnote\').prop(\'checked\', true); $(\'#invoiceAvoirWithLines\').removeAttr(\'checked\'); }" '.(GETPOST('invoiceAvoirWithPaymentRestAmount','int')>0 ? 'checked':'').' /> <label for="invoiceAvoirWithPaymentRestAmount">'.$langs->trans('invoiceAvoirWithPaymentRestAmount')."</label>";
|
||||
print ' <input type="checkbox" name="invoiceAvoirWithLines" id="invoiceAvoirWithLines" value="1" onclick="if($(this).is(\':checked\') ) { $(\'#radio_creditnote\').prop(\'checked\', true); $(\'#invoiceAvoirWithPaymentRestAmount\').removeAttr(\'checked\'); }" '.(GETPOST('invoiceAvoirWithLines','int')>0 ? 'checked':'').' /> <label for="invoiceAvoirWithLines">'.$langs->trans('invoiceAvoirWithLines')."</label>";
|
||||
print '<br> <input type="checkbox" name="invoiceAvoirWithPaymentRestAmount" id="invoiceAvoirWithPaymentRestAmount" value="1" onclick="if($(this).is(\':checked\') ) { $(\'#radio_creditnote\').prop(\'checked\', true); $(\'#invoiceAvoirWithLines\').removeAttr(\'checked\'); }" '.(GETPOST('invoiceAvoirWithPaymentRestAmount','int')>0 ? 'checked':'').' /> <label for="invoiceAvoirWithPaymentRestAmount">'.$langs->trans('invoiceAvoirWithPaymentRestAmount')."</label>";
|
||||
print '</div>';
|
||||
|
||||
print '</div></div>';
|
||||
|
||||
@ -57,7 +57,7 @@ if ($action == 'setnote' && $user->rights->fournisseur->facture->creer)
|
||||
$db->begin();
|
||||
|
||||
$object->fetch($id);
|
||||
$result = $object->update_note(GETPOST('note'));
|
||||
$result = $object->update_note(GETPOST('note','none'));
|
||||
if ($result > 0)
|
||||
{
|
||||
$db->commit();
|
||||
|
||||
@ -73,6 +73,7 @@ insert into llx_c_action_trigger (code,label,description,elementtype,rang) value
|
||||
insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('SHIPPING_VALIDATE','Shipping validated','Executed when a shipping is validated','shipping',20);
|
||||
insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('SHIPPING_SENTBYMAIL','Shipping sent by mail','Executed when a shipping is sent by mail','shipping',21);
|
||||
insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('MEMBER_VALIDATE','Member validated','Executed when a member is validated','member',22);
|
||||
insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('MEMBER_SENTBYMAIL','Mails sent from member card','Executed when you send email from member card','member',23);
|
||||
insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('MEMBER_SUBSCRIPTION','Member subscribed','Executed when a member is subscribed','member',24);
|
||||
insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('MEMBER_RESILIATE','Member resiliated','Executed when a member is resiliated','member',25);
|
||||
insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('MEMBER_DELETE','Member deleted','Executed when a member is deleted','member',26);
|
||||
|
||||
23
htdocs/install/mysql/data/llx_c_email_templates.sql
Normal file
23
htdocs/install/mysql/data/llx_c_email_templates.sql
Normal file
@ -0,0 +1,23 @@
|
||||
-- Copyright (C) 2017 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
--
|
||||
-- This program is free software; you can redistribute it and/or modify
|
||||
-- it under the terms of the GNU General Public License as published by
|
||||
-- the Free Software Foundation; either version 3 of the License, or
|
||||
-- (at your option) any later version.
|
||||
--
|
||||
-- This program is distributed in the hope that it will be useful,
|
||||
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
-- GNU General Public License for more details.
|
||||
--
|
||||
-- You should have received a copy of the GNU General Public License
|
||||
-- along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
--
|
||||
--
|
||||
|
||||
--
|
||||
-- Ne pas placer de commentaire en fin de ligne, ce fichier est parsé lors
|
||||
-- de l'install et tous les sigles '--' sont supprimés.
|
||||
--
|
||||
|
||||
INSERT INTO llx_c_email_templates (entity,module,type_template,lang,private,fk_user,datec,label,position,active,topic,content,content_lines) VALUES (0,null,'member',null,0,null,null,'(SendAnEMailToMember)',1,1,'__(CardContent)__','__(ThisIsContentOfYourCard)__<br />\n__(ID)__ : __ID__<br />\n__(Civiliyty)__ : __MEMBER_CIVILITY__<br />\n__(Firstname)__ : __MEMBER_FIRSTNAME__<br />\n__(Lastname)__ : __MEMBER_LASTNAME__<br />\n__(Fullname)__ : __MEMBER_FULLNAME__<br />\n__(Company)__ : __MEMBER_COMPANY__<br />\n__(Address)__ : __MEMBER_ADDRESS__<br />\n__(Zip)__ : __MEMBER_ZIP__<br />\n__(Town)__ : __MEMBER_TOWN__<br />\n__(Country)__ : __MEMBER_COUNTRY__<br />\n__(Email)__ : __MEMBER_EMAIL__<br />\n__(Birthday)__ : __MEMBER_BIRTH__<br />\n__(Photo)__ : __MEMBER_PHOTO__<br />\n__(Login)__ : __MEMBER_LOGIN__<br />\n__(Password)__ : __MEMBER_PASSWORD__<br />\n__(Phone)__ : __MEMBER_PHONE__<br />\n__(PhonePerso)__ : __MEMBER_PHONEPRO__<br />\n__(PhoneMobile)__ : __MEMBER_PHONEMOBILE__',null);
|
||||
@ -42,6 +42,8 @@ ALTER TABLE llx_website_page ADD COLUMN fk_user_modif integer;
|
||||
-- For 7.0
|
||||
|
||||
|
||||
insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('MEMBER_SENTBYMAIL','Mails sent from member card','Executed when you send email from member card','member',23);
|
||||
|
||||
ALTER TABLE llx_ecm_files MODIFY label varchar(128) NOT NULL;
|
||||
ALTER TABLE llx_ecm_files ADD COLUMN share varchar(128) NULL after label;
|
||||
|
||||
@ -64,6 +66,8 @@ ALTER TABLE llx_contrat MODIFY COLUMN ref_ext varchar(50);
|
||||
|
||||
UPDATE llx_c_email_templates SET position = 0 WHERE position IS NULL;
|
||||
|
||||
INSERT INTO llx_c_email_templates (entity,module,type_template,lang,private,fk_user,datec,label,position,active,topic,content,content_lines) VALUES (0,null,'member',null,0,null,null,'(SendAnEMailToMember)',1,1,'__(CardContent)__','__(ThisIsContentOfYourCard)__<br />\n__(ID)__ : __ID__<br />\n__(Civiliyty)__ : __MEMBER_CIVILITY__<br />\n__(Firstname)__ : __MEMBER_FIRSTNAME__<br />\n__(Lastname)__ : __MEMBER_LASTNAME__<br />\n__(Fullname)__ : __MEMBER_FULLNAME__<br />\n__(Company)__ : __MEMBER_COMPANY__<br />\n__(Address)__ : __MEMBER_ADDRESS__<br />\n__(Zip)__ : __MEMBER_ZIP__<br />\n__(Town)__ : __MEMBER_TOWN__<br />\n__(Country)__ : __MEMBER_COUNTRY__<br />\n__(Email)__ : __MEMBER_EMAIL__<br />\n__(Birthday)__ : __MEMBER_BIRTH__<br />\n__(Photo)__ : __MEMBER_PHOTO__<br />\n__(Login)__ : __MEMBER_LOGIN__<br />\n__(Password)__ : __MEMBER_PASSWORD__<br />\n__(Phone)__ : __MEMBER_PHONE__<br />\n__(PhonePerso)__ : __MEMBER_PHONEPRO__<br />\n__(PhoneMobile)__ : __MEMBER_PHONEMOBILE__',null);
|
||||
|
||||
INSERT INTO llx_c_accounting_category (rowid, code, label, range_account, sens, category_type, formula, position, fk_country, active) VALUES ( 1, 'VENTES', 'Income of products/services', 'Exemple: 7xxxxx', 0, 0, '', '10', 1, 1);
|
||||
INSERT INTO llx_c_accounting_category (rowid, code, label, range_account, sens, category_type, formula, position, fk_country, active) VALUES ( 2, 'DEPENSES', 'Expenses of products/services', 'Exemple: 6xxxxx', 0, 0, '', '20', 1, 1);
|
||||
INSERT INTO llx_c_accounting_category (rowid, code, label, range_account, sens, category_type, formula, position, fk_country, active) VALUES ( 3, 'PROFIT', 'Balance', '', 0, 1, 'VENTES+DEPENSES', '30', 1, 1);
|
||||
|
||||
@ -1694,6 +1694,7 @@ MailToSendSupplierOrder=To send supplier order
|
||||
MailToSendSupplierInvoice=To send supplier invoice
|
||||
MailToSendContract=To send a contract
|
||||
MailToThirdparty=To send email from third party page
|
||||
MailToMember=To send email from member page
|
||||
ByDefaultInList=Show by default on list view
|
||||
YouUseLastStableVersion=You use the latest stable version
|
||||
TitleExampleForMajorRelease=Example of message you can use to announce this major release (feel free to use it on your web sites)
|
||||
|
||||
@ -157,7 +157,7 @@ ErrorPriceExpression22=Negative result '%s'
|
||||
ErrorPriceExpressionInternal=Internal error '%s'
|
||||
ErrorPriceExpressionUnknown=Unknown error '%s'
|
||||
ErrorSrcAndTargetWarehouseMustDiffers=Source and target warehouses must differs
|
||||
ErrorTryToMakeMoveOnProductRequiringBatchData=Error, trying to make a stock movement without lot/serial information, on a product requiring lot/serial information
|
||||
ErrorTryToMakeMoveOnProductRequiringBatchData=Error, trying to make a stock movement without lot/serial information, on product '%s' requiring lot/serial information
|
||||
ErrorCantSetReceptionToTotalDoneWithReceptionToApprove=All recorded receptions must first be verified (approved or denied) before being allowed to do this action
|
||||
ErrorCantSetReceptionToTotalDoneWithReceptionDenied=All recorded receptions must first be verified (approved) before being allowed to do this action
|
||||
ErrorGlobalVariableUpdater0=HTTP request failed with error '%s'
|
||||
|
||||
@ -70,7 +70,10 @@ EMailSentToNRecipients=EMail sent to %s recipients.
|
||||
EMailSentForNElements=EMail sent for %s elements.
|
||||
XTargetsAdded=<b>%s</b> recipients added into target list
|
||||
OnlyPDFattachmentSupported=If the PDF documents were already generated for the objects to send, they will be attached to email. If not, no email will be sent (also, note that only pdf documents are supported as attachment in mass sending in this version).
|
||||
AllRecipientSelected=The %s unique recipients selected (1 email per recipient), and if an email is set.
|
||||
AllRecipientSelected=The recipients of the %s record selected (if their email is known).
|
||||
GroupEmails=Group emails
|
||||
OneEmailPerRecipient=One email per recipient (by default, one email per record selected)
|
||||
WarningIfYouCheckOneRecipientPerEmail=Warning, if you check this box, it means only one email will be sent for several different record selected, so, if your message contains substitution variables that refers to data of a record, it becomes not possible to replace them.
|
||||
ResultOfMailSending=Result of mass EMail sending
|
||||
NbSelected=Nb selected
|
||||
NbIgnored=Nb ignored
|
||||
|
||||
@ -3,7 +3,8 @@ ModuleBuilderDesc=This tools must be used by experienced users or developers. It
|
||||
EnterNameOfModuleDesc=Enter name of the module/application to create with no spaces. Use uppercase to separate words (For example: MyModule, EcommerceForShop, SyncWithMySystem...)
|
||||
EnterNameOfObjectDesc=Enter name of the object to create with no spaces. Use uppercase to separate words (For example: MyObject, Student, Teacher...). The CRUD class file, but also API file, pages to list/add/edit/delete object and SQL files will be generated.
|
||||
ModuleBuilderDesc2=Path where modules are generated/edited (first alternative directory defined into %s): <strong>%s</strong>
|
||||
ModuleBuilderDesc3=Generated/editable modules found: <strong>%s</strong> (they are detected as editable when the file <strong>%s</strong> exists in root of module directory).
|
||||
ModuleBuilderDesc3=Generated/editable modules found: <strong>%s</strong>
|
||||
ModuleBuilderDesc4=A module is detected as 'editable' when the file <strong>%s</strong> exists in root of module directory
|
||||
NewModule=New module
|
||||
NewObject=New object
|
||||
ModuleKey=Module key
|
||||
@ -51,6 +52,8 @@ DatabaseIndex=Database index
|
||||
FileAlreadyExists=File %s already exists
|
||||
TriggersFile=File for triggers code
|
||||
HooksFile=File for hooks code
|
||||
ArrayOfKeyValues=Array of key-val
|
||||
ArrayOfKeyValuesDesc=Array of keys and values if field is a combo list with fixed values
|
||||
WidgetFile=Widget file
|
||||
ReadmeFile=Readme file
|
||||
ChangeLog=ChangeLog file
|
||||
@ -63,4 +66,16 @@ UseAsciiDocFormat=You can use Markdown format, but it is recommanded to use Asci
|
||||
IsAMeasure=Is a measure
|
||||
DirScanned=Directory scanned
|
||||
NoTrigger=No trigger
|
||||
NoWidget=No widget
|
||||
NoWidget=No widget
|
||||
GoToApiExplorer=Go to API explorer
|
||||
ListOfPermissionsDefined=List of defined permissions
|
||||
EnabledDesc=Condition to have this field active (Examples: 1 or $conf->global->MYMODULE_MYOPTION)
|
||||
VisibleDesc=Is the field visible into list ? (Examples: 0=not visible, 1=visible by default on list, -1=not shown by default on list but can be added into list to be viewed)
|
||||
IsAMeasureDesc=Can the value of field be cumulated to get a total into list ? (Examples: 1 or 0)
|
||||
SearchAllDesc=Is the field used to make a search from the quick search tool ? (Examples: 1 or 0)
|
||||
SpecDefDesc=Enter here all documentation you want to provide with your module that is not already defined by other tabs. You can use .md or better, the rich .asciidoc syntax.
|
||||
LanguageDefDesc=Enter in this files, all the key and the translation for each language file.
|
||||
MenusDefDesc=Define here the menus provided by your module (once defined, they are visible into the menu editor %s)
|
||||
PermissionsDefDesc=Define here the new permissions provided by your module (once defined, they are visible into the default permissions setup %s)
|
||||
HooksDefDesc=Define in the <b>module_parts['hooks']</b> property in the module descriptor the context of hooks you want to manage (list of contexts can be found by a search on '<b>initHooks(</b>' in core code).<br>Edit the hook file to add code of your hooked functions (hookable functions can be found by a search on '<b>executeHooks</b>' in core code).
|
||||
TriggerDefDesc=Define in the trigger file the code you want to execute for each business event executed
|
||||
|
||||
@ -565,6 +565,14 @@ else
|
||||
}
|
||||
|
||||
// Other attributes
|
||||
if ($action = 'create_delivery') {
|
||||
// copy from expedition
|
||||
$expeditionExtrafields = new Extrafields($db);
|
||||
$expeditionExtrafieldLabels = $expeditionExtrafields->fetch_name_optionals_label($expedition->table_element);
|
||||
if ($expedition->fetch_optionals($object->origin_id, $expeditionExtrafieldLabels) > 0) {
|
||||
$object->array_options = array_merge($object->array_options, $expedition->array_options);
|
||||
}
|
||||
}
|
||||
$cols = 2;
|
||||
include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_view.tpl.php';
|
||||
|
||||
@ -665,6 +673,13 @@ else
|
||||
$mode = ($object->statut == 0) ? 'edit' : 'view';
|
||||
$line = new LivraisonLigne($db);
|
||||
$line->fetch_optionals($object->lines[$i]->id,$extralabelslines);
|
||||
if ($action = 'create_delivery') {
|
||||
$srcLine = new ExpeditionLigne($db);
|
||||
$expeditionLineExtrafields = new Extrafields($db);
|
||||
$expeditionLineExtrafieldLabels = $expeditionLineExtrafields->fetch_name_optionals_label($srcLine->table_element);
|
||||
$srcLine->fetch_optionals($expedition->lines[$i]->id,$expeditionLineExtrafieldLabels);
|
||||
$line->array_options = array_merge($line->array_options, $srcLine->array_options);
|
||||
}
|
||||
print '<tr class="oddeven">';
|
||||
print $line->showOptionals($extrafieldsline, $mode, array('style'=>$bc[$var], 'colspan'=>$colspan),$i);
|
||||
print '</tr>';
|
||||
|
||||
@ -133,8 +133,8 @@ if (empty($reshook))
|
||||
$object->dateend = $dateend;
|
||||
$object->nbterm = GETPOST('nbterm');
|
||||
$object->rate = $rate;
|
||||
$object->note_private = GETPOST('note_private');
|
||||
$object->note_public = GETPOST('note_public');
|
||||
$object->note_private = GETPOST('note_private','none');
|
||||
$object->note_public = GETPOST('note_public','none');
|
||||
$object->fk_project = GETPOST('projectid','int');
|
||||
|
||||
$accountancy_account_capital = GETPOST('accountancy_account_capital');
|
||||
|
||||
@ -101,8 +101,8 @@ if ($action == 'add_payment')
|
||||
$payment->amount_interest = GETPOST('amount_interest');
|
||||
$payment->paymenttype = GETPOST('paymenttype');
|
||||
$payment->num_payment = GETPOST('num_payment');
|
||||
$payment->note_private = GETPOST('note_private');
|
||||
$payment->note_public = GETPOST('note_public');
|
||||
$payment->note_private = GETPOST('note_private','none');
|
||||
$payment->note_public = GETPOST('note_public','none');
|
||||
|
||||
if (! $error)
|
||||
{
|
||||
|
||||
@ -179,7 +179,9 @@ if (! empty($_SERVER['DOCUMENT_ROOT']) && substr($_SERVER['DOCUMENT_ROOT'], -6)
|
||||
// Include the conf.php and functions.lib.php
|
||||
require_once 'filefunc.inc.php';
|
||||
|
||||
// If there is a POST parameter to tell to save automatically some POST parameters into cookies, we do it
|
||||
// If there is a POST parameter to tell to save automatically some POST parameters into cookies, we do it.
|
||||
// This is used for example by form of boxes to save personalization of some options.
|
||||
// DOL_AUTOSET_COOKIE=cookiename:val1,val2 and cookiename_val1=aaa cookiename_val2=bbb will set cookie_name with value json_encode(array('val1'=> , ))
|
||||
if (! empty($_POST["DOL_AUTOSET_COOKIE"]))
|
||||
{
|
||||
$tmpautoset=explode(':',$_POST["DOL_AUTOSET_COOKIE"],2);
|
||||
@ -194,7 +196,7 @@ if (! empty($_POST["DOL_AUTOSET_COOKIE"]))
|
||||
$cookiename=$tmpautoset[0];
|
||||
$cookievalue=json_encode($cookiearrayvalue);
|
||||
//var_dump('setcookie cookiename='.$cookiename.' cookievalue='.$cookievalue);
|
||||
setcookie($cookiename, empty($cookievalue)?'':$cookievalue, empty($cookievalue)?0:(time()+(86400*354)), '/'); // keep cookie 1 year
|
||||
setcookie($cookiename, empty($cookievalue)?'':$cookievalue, empty($cookievalue)?0:(time()+(86400*354)), '/', null, false, true); // keep cookie 1 year and add tag httponly
|
||||
if (empty($cookievalue)) unset($_COOKIE[$cookiename]);
|
||||
}
|
||||
|
||||
@ -204,7 +206,7 @@ $sessionname='DOLSESSID_'.$prefix;
|
||||
$sessiontimeout='DOLSESSTIMEOUT_'.$prefix;
|
||||
if (! empty($_COOKIE[$sessiontimeout])) ini_set('session.gc_maxlifetime',$_COOKIE[$sessiontimeout]);
|
||||
session_name($sessionname);
|
||||
session_set_cookie_params(0, '/', null, false, true); // Add tag httponly on session cookie
|
||||
session_set_cookie_params(0, '/', null, false, true); // Add tag httponly on session cookie (same as setting session.cookie_httponly into php.ini). Must be called before the session_start.
|
||||
// This create lock released until session_write_close() or end of page.
|
||||
// We need this lock as long as we read/write $_SESSION ['vars']. We can close released when finished.
|
||||
if (! defined('NOSESSION'))
|
||||
@ -1279,7 +1281,6 @@ function top_htmlhead($head, $title='', $disablejs=0, $disablehead=0, $arrayofjs
|
||||
{
|
||||
$tmpplugin=empty($conf->global->MAIN_USE_JQUERY_MULTISELECT)?constant('REQUIRE_JQUERY_MULTISELECT'):$conf->global->MAIN_USE_JQUERY_MULTISELECT;
|
||||
print '<script type="text/javascript" src="'.DOL_URL_ROOT.'/includes/jquery/plugins/'.$tmpplugin.'/'.$tmpplugin.'.min.js'.($ext?'?'.$ext:'').'"></script>'."\n";
|
||||
print '<script type="text/javascript" src="'.DOL_URL_ROOT.'/core/js/select2_locale.js.php?lang='.$langs->defaultlang.($ext?'&'.$ext:'').'"></script>'."\n";
|
||||
}
|
||||
}
|
||||
|
||||
@ -1319,7 +1320,7 @@ function top_htmlhead($head, $title='', $disablejs=0, $disablehead=0, $arrayofjs
|
||||
|
||||
// Global js function
|
||||
print '<!-- Includes JS of Dolibarr -->'."\n";
|
||||
print '<script type="text/javascript" src="'.DOL_URL_ROOT.'/core/js/lib_head.js.php'.($ext?'?'.$ext:'').'"></script>'."\n";
|
||||
print '<script type="text/javascript" src="'.DOL_URL_ROOT.'/core/js/lib_head.js.php?lang='.$langs->defaultlang.($ext?'&'.$ext:'').'"></script>'."\n";
|
||||
|
||||
// Add datepicker default options
|
||||
/*if (! defined('DISABLE_DATE_PICKER'))
|
||||
|
||||
@ -23,7 +23,7 @@
|
||||
* \brief Home page for module builder module
|
||||
*/
|
||||
|
||||
if (! defined('NOSCANPOSTFORINJECTION')) define('NOSCANPOSTFORINJECTION','1'); // Do not check anti CSRF attack test
|
||||
if (! defined('NOSCANPOSTFORINJECTION')) define('NOSCANPOSTFORINJECTION','1'); // Do not check anti SQL+XSS injection attack test
|
||||
|
||||
require '../main.inc.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
|
||||
@ -337,13 +337,13 @@ if ($dirins && $action == 'initobject' && $module && $objectname)
|
||||
if (! $error)
|
||||
{
|
||||
// Edit the class file to write properties
|
||||
$result=rebuildObjectClass($destdir, $module, $objectname, $newmask);
|
||||
if ($result < 0) $error++;
|
||||
$object=rebuildObjectClass($destdir, $module, $objectname, $newmask);
|
||||
if (is_numeric($object) && $object < 0) $error++;
|
||||
}
|
||||
if (! $error)
|
||||
{
|
||||
// Edit sql with new properties
|
||||
$result=rebuildObjectSql($destdir, $module, $objectname, $newmask);
|
||||
$result=rebuildObjectSql($destdir, $module, $objectname, $newmask, '', $object);
|
||||
if ($result < 0) $error++;
|
||||
}
|
||||
|
||||
@ -362,22 +362,32 @@ if ($dirins && $action == 'addproperty' && !empty($module) && ! empty($tabobj))
|
||||
dol_mkdir($destdir);
|
||||
|
||||
$addfieldentry = array(
|
||||
'name'=>GETPOST('propname','aZ09'),'type'=>GETPOST('proptype','aZ09'),'label'=>GETPOST('proplabel','aZ09'),'visible'=>GETPOST('propvisible','int'),'enabled'=>GETPOST('propenabled','int'),
|
||||
'name'=>GETPOST('propname','aZ09'),'label'=>GETPOST('proplabel','alpha'),'type'=>GETPOST('proptype','alpha'),
|
||||
'arrayofkeyval'=>GETPOST('proparrayofkeyval','none'), // Example json string '{"0":"Draft","1":"Active","-1":"Cancel"}'
|
||||
'visible'=>GETPOST('propvisible','int'),'enabled'=>GETPOST('propenabled','int'),
|
||||
'position'=>GETPOST('propposition','int'),'notnull'=>GETPOST('propnotnull','int'),'index'=>GETPOST('propindex','int'),'searchall'=>GETPOST('propsearchall','int'),
|
||||
'isameasure'=>GETPOST('propisameasure','int'), 'comment'=>GETPOST('propcomment','alpha'),'help'=>GETPOST('prophelp'));
|
||||
|
||||
if (! empty($addfieldentry['arrayofkeyval']) && ! is_array($addfieldentry['arrayofkeyval']))
|
||||
{
|
||||
$addfieldentry['arrayofkeyval'] = dol_json_decode($addfieldentry['arrayofkeyval'], true);
|
||||
}
|
||||
|
||||
// Edit the class file to write properties
|
||||
if (! $error)
|
||||
{
|
||||
$result=rebuildObjectClass($destdir, $module, $objectname, $newmask, $srcdir, $addfieldentry);
|
||||
if ($result <= 0) $error++;
|
||||
$object=rebuildObjectClass($destdir, $module, $objectname, $newmask, $srcdir, $addfieldentry);
|
||||
if (is_numeric($result) && $result <= 0) $error++;
|
||||
}
|
||||
|
||||
// Edit sql with new properties
|
||||
if (! $error)
|
||||
{
|
||||
$result=rebuildObjectSql($destdir, $module, $objectname, $newmask, $srcdir);
|
||||
if ($result <= 0) $error++;
|
||||
$result=rebuildObjectSql($destdir, $module, $objectname, $newmask, $srcdir, $object);
|
||||
if ($result <= 0)
|
||||
{
|
||||
$error++;
|
||||
}
|
||||
}
|
||||
|
||||
if (! $error)
|
||||
@ -405,14 +415,14 @@ if ($dirins && $action == 'confirm_deleteproperty' && $propertykey)
|
||||
// Edit the class file to write properties
|
||||
if (! $error)
|
||||
{
|
||||
$result=rebuildObjectClass($destdir, $module, $objectname, $newmask, $srcdir, array(), $propertykey);
|
||||
if ($result <= 0) $error++;
|
||||
$object=rebuildObjectClass($destdir, $module, $objectname, $newmask, $srcdir, array(), $propertykey);
|
||||
if (is_numeric($object) && $object <= 0) $error++;
|
||||
}
|
||||
|
||||
// Edit sql with new properties
|
||||
if (! $error)
|
||||
{
|
||||
$result=rebuildObjectSql($destdir, $module, $objectname, $newmask, $srcdir);
|
||||
$result=rebuildObjectSql($destdir, $module, $objectname, $newmask, $srcdir, $object);
|
||||
if ($result <= 0) $error++;
|
||||
}
|
||||
|
||||
@ -675,16 +685,26 @@ if ($action == 'savefile' && empty($cancel))
|
||||
// Save old version
|
||||
if (dol_is_file($pathoffile))
|
||||
{
|
||||
dol_move($pathoffile, $pathoffilebackup, 0, 1, 0, 0);
|
||||
dol_copy($pathoffile, $pathoffilebackup, 0, 1);
|
||||
}
|
||||
|
||||
$content = GETPOST('editfilecontent');
|
||||
$content = GETPOST('editfilecontent','none');
|
||||
|
||||
// Save file on disk
|
||||
file_put_contents($pathoffile, $content);
|
||||
@chmod($pathoffile, octdec($newmask));
|
||||
if ($content)
|
||||
{
|
||||
dol_delete_file($pathoffile);
|
||||
file_put_contents($pathoffile, $content);
|
||||
@chmod($pathoffile, octdec($newmask));
|
||||
|
||||
setEventMessages($langs->trans("FileSaved"), null);
|
||||
setEventMessages($langs->trans("FileSaved"), null);
|
||||
}
|
||||
else
|
||||
{
|
||||
setEventMessages($langs->trans("ContentCantBeEmpty"), null, 'errors');
|
||||
//$action='editfile';
|
||||
$error++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -831,7 +851,8 @@ if ($message)
|
||||
print $message;
|
||||
}
|
||||
|
||||
print $langs->trans("ModuleBuilderDesc3", count($listofmodules), $FILEFLAG).'<br>';
|
||||
//print $langs->trans("ModuleBuilderDesc3", count($listofmodules), $FILEFLAG).'<br>';
|
||||
$infomodulesfound = '<div style="padding: 12px 9px 12px">'.$form->textwithpicto($langs->trans("ModuleBuilderDesc3", count($listofmodules)), $langs->trans("ModuleBuilderDesc4", $FILEFLAG)).'</div>';
|
||||
|
||||
|
||||
// Load module descriptor
|
||||
@ -891,7 +912,7 @@ $head[$h][2] = 'deletemodule';
|
||||
$h++;
|
||||
|
||||
|
||||
dol_fiche_head($head, $module, $langs->trans("Modules"), -1, 'generic'); // Modules
|
||||
dol_fiche_head($head, $module, $langs->trans("Modules"), -1, 'generic', 0, $infomodulesfound); // Modules
|
||||
|
||||
if ($module == 'initmodule')
|
||||
{
|
||||
@ -950,12 +971,14 @@ elseif (! empty($module))
|
||||
$linktoenabledisable.=img_picto($langs->trans("Disabled"),'switch_off');
|
||||
$linktoenabledisable.="</a>\n";
|
||||
}
|
||||
|
||||
$modulestatusinfo=img_info('').' '.$langs->trans("ModuleIsNotActive", $urltomodulesetup);
|
||||
if (! empty($conf->$module->enabled))
|
||||
if (! empty($conf->$modulelowercase->enabled))
|
||||
{
|
||||
$modulestatusinfo=img_warning().' '.$langs->trans("ModuleIsLive");
|
||||
}
|
||||
else
|
||||
{
|
||||
$modulestatusinfo=img_info('').' '.$langs->trans("ModuleIsNotActive", $urltomodulesetup);
|
||||
}
|
||||
|
||||
$head2[$h][0] = $_SERVER["PHP_SELF"].'?tab=description&module='.$module.($forceddirread?'@'.$dirread:'');
|
||||
$head2[$h][1] = $langs->trans("Description");
|
||||
@ -1134,9 +1157,12 @@ elseif (! empty($module))
|
||||
}
|
||||
else
|
||||
{
|
||||
$fullpathoffile=dol_buildpath($file, 0); // Description - level 2
|
||||
$fullpathoffile=dol_buildpath($file, 0, 1); // Description - level 2
|
||||
|
||||
$content = file_get_contents($fullpathoffile);
|
||||
if ($fullpathoffile)
|
||||
{
|
||||
$content = file_get_contents($fullpathoffile);
|
||||
}
|
||||
|
||||
// New module
|
||||
print '<form action="'.$_SERVER["PHP_SELF"].'" method="POST">';
|
||||
@ -1154,7 +1180,7 @@ elseif (! empty($module))
|
||||
dol_fiche_end();
|
||||
|
||||
print '<center>';
|
||||
print '<input type="submit" class="button" id="savefile" name="savefile" value="'.dol_escape_htmltag($langs->trans("Save")).'">';
|
||||
print '<input type="submit" class="button buttonforacesave" id="savefile" name="savefile" value="'.dol_escape_htmltag($langs->trans("Save")).'">';
|
||||
print ' ';
|
||||
print '<input type="submit" class="button" name="cancel" value="'.dol_escape_htmltag($langs->trans("Cancel")).'">';
|
||||
print '</center>';
|
||||
@ -1172,6 +1198,9 @@ elseif (! empty($module))
|
||||
{
|
||||
if ($action != 'editfile' || empty($file))
|
||||
{
|
||||
print $langs->trans("SpecDefDesc").'<br>';
|
||||
print '<br>';
|
||||
|
||||
$specs=dol_dir_list(dol_buildpath($modulelowercase.'/doc', 0), 'files', 1, '(\.md|\.asciidoc)$');
|
||||
|
||||
foreach ($specs as $spec)
|
||||
@ -1206,7 +1235,7 @@ elseif (! empty($module))
|
||||
print $doleditor->Create(1, '', false, $langs->trans("File").' : '.$file, (GETPOST('format','aZ09')?GETPOST('format','aZ09'):'html'));
|
||||
print '<br>';
|
||||
print '<center>';
|
||||
print '<input type="submit" class="button" id="savefile" name="savefile" value="'.dol_escape_htmltag($langs->trans("Save")).'">';
|
||||
print '<input type="submit" class="button buttonforacesave" id="savefile" name="savefile" value="'.dol_escape_htmltag($langs->trans("Save")).'">';
|
||||
print ' ';
|
||||
print '<input type="submit" class="button" name="cancel" value="'.dol_escape_htmltag($langs->trans("Cancel")).'">';
|
||||
print '</center>';
|
||||
@ -1219,6 +1248,9 @@ elseif (! empty($module))
|
||||
{
|
||||
if ($action != 'editfile' || empty($file))
|
||||
{
|
||||
print $langs->trans("LanguageDefDesc").'<br>';
|
||||
print '<br>';
|
||||
|
||||
$langfiles=dol_dir_list(dol_buildpath($modulelowercase.'/langs', 0), 'files', 1, '\.lang$');
|
||||
|
||||
foreach ($langfiles as $langfile)
|
||||
@ -1251,7 +1283,7 @@ elseif (! empty($module))
|
||||
print $doleditor->Create(1, '', false, $langs->trans("File").' : '.$file, (GETPOST('format','aZ09')?GETPOST('format','aZ09'):'text'));
|
||||
print '<br>';
|
||||
print '<center>';
|
||||
print '<input type="submit" class="button" id="savefile" name="savefile" value="'.dol_escape_htmltag($langs->trans("Save")).'">';
|
||||
print '<input type="submit" class="button buttonforacesave" id="savefile" name="savefile" value="'.dol_escape_htmltag($langs->trans("Save")).'">';
|
||||
print ' ';
|
||||
print '<input type="submit" class="button" name="cancel" value="'.dol_escape_htmltag($langs->trans("Cancel")).'">';
|
||||
print '</center>';
|
||||
@ -1288,12 +1320,12 @@ elseif (! empty($module))
|
||||
//$objectname = preg_replace('/\.txt$/', '', $fileobj['name']);
|
||||
$objectname = $reg[1];
|
||||
if (empty($firstobjectname)) $firstobjectname = $objectname;
|
||||
}
|
||||
|
||||
$head3[$h][0] = $_SERVER["PHP_SELF"].'?tab=objects&module='.$module.($forceddirread?'@'.$dirread:'').'&tabobj='.$objectname;
|
||||
$head3[$h][1] = $objectname;
|
||||
$head3[$h][2] = $objectname;
|
||||
$h++;
|
||||
$head3[$h][0] = $_SERVER["PHP_SELF"].'?tab=objects&module='.$module.($forceddirread?'@'.$dirread:'').'&tabobj='.$objectname;
|
||||
$head3[$h][1] = $objectname;
|
||||
$head3[$h][2] = $objectname;
|
||||
$h++;
|
||||
}
|
||||
}
|
||||
|
||||
$head3[$h][0] = $_SERVER["PHP_SELF"].'?tab=objects&module='.$module.($forceddirread?'@'.$dirread:'').'&tabobj=deleteobject';
|
||||
@ -1367,40 +1399,84 @@ elseif (! empty($module))
|
||||
$pathtosql = strtolower($module).'/sql/llx_'.strtolower($tabobj).'.sql';
|
||||
$pathtosqlextra = strtolower($module).'/sql/llx_'.strtolower($tabobj).'_extrafields.sql';
|
||||
$pathtosqlkey = strtolower($module).'/sql/llx_'.strtolower($tabobj).'.key.sql';
|
||||
$pathtolib = strtolower($module).'/lib/'.strtolower($tabobj).'.lib.php';
|
||||
$pathtopicto = strtolower($module).'/img/object_'.strtolower($tabobj).'.png';
|
||||
|
||||
$realpathtoclass = dol_buildpath($pathtoclass, 0, 1);
|
||||
$realpathtoapi = dol_buildpath($pathtoapi, 0, 1);
|
||||
$realpathtoagenda = dol_buildpath($pathtoagenda, 0, 1);
|
||||
$realpathtocard = dol_buildpath($pathtocard, 0, 1);
|
||||
$realpathtodocument = dol_buildpath($pathtodocument, 0, 1);
|
||||
$realpathtolist = dol_buildpath($pathtolist, 0, 1);
|
||||
$realpathtonote = dol_buildpath($pathtonote, 0, 1);
|
||||
$realpathtophpunit = dol_buildpath($pathtophpunit, 0, 1);
|
||||
$realpathtosql = dol_buildpath($pathtosql, 0, 1);
|
||||
$realpathtosqlextra = dol_buildpath($pathtosqlextra, 0, 1);
|
||||
$realpathtosqlkey = dol_buildpath($pathtosqlkey, 0, 1);
|
||||
$realpathtolib = dol_buildpath($pathtolib, 0, 1);
|
||||
$realpathtopicto = dol_buildpath($pathtopicto, 0, 1);
|
||||
|
||||
print '<div class="fichehalfleft">';
|
||||
print '<span class="fa fa-file"></span> '.$langs->trans("ClassFile").' : <strong>'.$pathtoclass.'</strong>';
|
||||
print ' <a href="'.$_SERVER['PHP_SELF'].'?tab='.$tab.'&module='.$module.($forceddirread?'@'.$dirread:'').'&action=editfile&format=php&file='.urlencode($pathtoclass).'">'.img_picto($langs->trans("Edit"), 'edit').'</a>';
|
||||
print '<span class="fa fa-file"></span> '.$langs->trans("ClassFile").' : <strong>'.($realpathtoclass?'':'<strike>').$pathtoclass.($realpathtoclass?'':'</strike>').'</strong>';
|
||||
print ' <a href="'.$_SERVER['PHP_SELF'].'?tab='.$tab.'&tabobj='.$tabobj.'&module='.$module.($forceddirread?'@'.$dirread:'').'&action=editfile&format=php&file='.urlencode($pathtoclass).'">'.img_picto($langs->trans("Edit"), 'edit').'</a>';
|
||||
print '<br>';
|
||||
print '<span class="fa fa-file"></span> '.$langs->trans("ApiClassFile").' : <strong>'.$pathtoapi.'</strong>';
|
||||
print ' <a href="'.$_SERVER['PHP_SELF'].'?tab='.$tab.'&module='.$module.($forceddirread?'@'.$dirread:'').'&action=editfile&format=php&file='.urlencode($pathtoapi).'">'.img_picto($langs->trans("Edit"), 'edit').'</a>';
|
||||
print '<span class="fa fa-file"></span> '.$langs->trans("ApiClassFile").' : <strong>'.($realpathtoapi?'':'<strike>').$pathtoapi.($realpathtoapi?'':'</strike>').'</strong>';
|
||||
print ' <a href="'.$_SERVER['PHP_SELF'].'?tab='.$tab.'&tabobj='.$tabobj.'&module='.$module.($forceddirread?'@'.$dirread:'').'&action=editfile&format=php&file='.urlencode($pathtoapi).'">'.img_picto($langs->trans("Edit"), 'edit').'</a>';
|
||||
print ' <a href="'.DOL_URL_ROOT.'/api/index.php/explorer/" target="apiexplorer">'.$langs->trans("GoToApiExplorer").'</a>';
|
||||
print '<br>';
|
||||
print '<span class="fa fa-file"></span> '.$langs->trans("TestClassFile").' : <strong>'.$pathtophpunit.'</strong>';
|
||||
print ' <a href="'.$_SERVER['PHP_SELF'].'?tab='.$tab.'&module='.$module.($forceddirread?'@'.$dirread:'').'&action=editfile&format=php&file='.urlencode($pathtophpunit).'">'.img_picto($langs->trans("Edit"), 'edit').'</a>';
|
||||
print '<span class="fa fa-file"></span> '.$langs->trans("TestClassFile").' : <strong>'.($realpathtophpunit?'':'<strike>').$pathtophpunit.($realpathtophpunit?'':'</strike>').'</strong>';
|
||||
print ' <a href="'.$_SERVER['PHP_SELF'].'?tab='.$tab.'&tabobj='.$tabobj.'&module='.$module.($forceddirread?'@'.$dirread:'').'&action=editfile&format=php&file='.urlencode($pathtophpunit).'">'.img_picto($langs->trans("Edit"), 'edit').'</a>';
|
||||
print '<br>';
|
||||
print '<span class="fa fa-file"></span> '.$langs->trans("SqlFile").' : <strong>'.$pathtosql.'</strong>';
|
||||
print ' <a href="'.$_SERVER['PHP_SELF'].'?tab='.$tab.'&module='.$module.($forceddirread?'@'.$dirread:'').'&action=editfile&format=sql&file='.urlencode($pathtosql).'">'.img_picto($langs->trans("Edit"), 'edit').'</a>';
|
||||
|
||||
print '<br>';
|
||||
print '<span class="fa fa-file"></span> '.$langs->trans("SqlFileExtraFields").' : <strong>'.$pathtosqlextra.'</strong>';
|
||||
print ' <a href="'.$_SERVER['PHP_SELF'].'?tab='.$tab.'&module='.$module.($forceddirread?'@'.$dirread:'').'&action=editfile&file='.urlencode($pathtosqlextra).'">'.img_picto($langs->trans("Edit"), 'edit').'</a>';
|
||||
|
||||
print '<span class="fa fa-file"></span> '.$langs->trans("PageForLib").' : <strong>'.($realpathtolib?'':'<strike>').$pathtolib.($realpathtodocument?'':'</strike>').'</strong>';
|
||||
print ' <a href="'.$_SERVER['PHP_SELF'].'?tab='.$tab.'&tabobj='.$tabobj.'&module='.$module.($forceddirread?'@'.$dirread:'').'&action=editfile&format=php&file='.urlencode($pathtolib).'">'.img_picto($langs->trans("Edit"), 'edit').'</a>';
|
||||
print '<br>';
|
||||
print '<span class="fa fa-file"></span> '.$langs->trans("PageForPicto").' : <strong>'.($realpathtopicto?'':'<strike>').$pathtopicto.($realpathtopicto?'':'</strike>').'</strong>';
|
||||
//print ' <a href="'.$_SERVER['PHP_SELF'].'?tab='.$tab.'&tabobj='.$tabobj.'&module='.$module.($forceddirread?'@'.$dirread:'').'&action=editfile&format=php&file='.urlencode($pathtopicto).'">'.img_picto($langs->trans("Edit"), 'edit').'</a>';
|
||||
print '<br>';
|
||||
|
||||
print '<br>';
|
||||
print '<span class="fa fa-file"></span> '.$langs->trans("SqlFile").' : <strong>'.($realpathtosql?'':'<strike>').$pathtosql.($realpathtosql?'':'</strike>').'</strong>';
|
||||
print ' <a href="'.$_SERVER['PHP_SELF'].'?tab='.$tab.'&tabobj='.$tabobj.'&module='.$module.($forceddirread?'@'.$dirread:'').'&action=editfile&format=sql&file='.urlencode($pathtosql).'">'.img_picto($langs->trans("Edit"), 'edit').'</a>';
|
||||
print ' <a href="'.$_SERVER["PHP_SELF"].'">'.$langs->trans("DropTableIfEmpty").'</a>';
|
||||
//print ' <a href="'.$_SERVER["PHP_SELF"].'">'.$langs->trans("RunSql").'</a>';
|
||||
print '<br>';
|
||||
print '<span class="fa fa-file"></span> '.$langs->trans("SqlFileExtraFields").' : <strong>'.($realpathtosqlextra?'':'<strike>').$pathtosqlextra.($realpathtosqlextra?'':'</strike>').'</strong>';
|
||||
print ' <a href="'.$_SERVER['PHP_SELF'].'?tab='.$tab.'&tabobj='.$tabobj.'&module='.$module.($forceddirread?'@'.$dirread:'').'&action=editfile&file='.urlencode($pathtosqlextra).'">'.img_picto($langs->trans("Edit"), 'edit').'</a>';
|
||||
//print ' <a href="'.$_SERVER["PHP_SELF"].'">'.$langs->trans("RunSql").'</a>';
|
||||
print '<br>';
|
||||
print '<span class="fa fa-file"></span> '.$langs->trans("SqlFileKey").' : <strong>'.($realpathtosqlkey?'':'<strike>').$pathtosqlkey.($realpathtosqlkey?'':'</strike>').'</strong>';
|
||||
print ' <a href="'.$_SERVER['PHP_SELF'].'?tab='.$tab.'&tabobj='.$tabobj.'&module='.$module.($forceddirread?'@'.$dirread:'').'&action=editfile&format=sql&file='.urlencode($pathtosqlkey).'">'.img_picto($langs->trans("Edit"), 'edit').'</a>';
|
||||
//print ' <a href="'.$_SERVER["PHP_SELF"].'">'.$langs->trans("RunSql").'</a>';
|
||||
print '<br>';
|
||||
|
||||
print '<br>';
|
||||
print '<span class="fa fa-file"></span> '.$langs->trans("SqlFileKey").' : <strong>'.$pathtosqlkey.'</strong>';
|
||||
print ' <a href="'.$_SERVER['PHP_SELF'].'?tab='.$tab.'&module='.$module.($forceddirread?'@'.$dirread:'').'&action=editfile&format=sql&file='.urlencode($pathtosqlkey).'">'.img_picto($langs->trans("Edit"), 'edit').'</a>';
|
||||
print '</div>';
|
||||
|
||||
$urloflist = dol_buildpath($pathtolist, 1);
|
||||
$urlofcard = dol_buildpath($pathtocard, 1);
|
||||
|
||||
print '<div class="fichehalfleft">';
|
||||
print '<span class="fa fa-file"></span> '.$langs->trans("PageForList").' : <strong>'.$pathtolist.'</strong>';
|
||||
print ' <a href="'.$_SERVER['PHP_SELF'].'?tab='.$tab.'&module='.$module.($forceddirread?'@'.$dirread:'').'&action=editfile&format=php&file='.urlencode($pathtolist).'">'.img_picto($langs->trans("Edit"), 'edit').'</a>';
|
||||
print '<span class="fa fa-file"></span> '.$langs->trans("PageForList").' : <strong><a href="'.$urloflist.'" target="_test">'.($realpathtosql?'':'<strike>').$pathtolist.($realpathtosql?'':'</strike>').'</a></strong>';
|
||||
print ' <a href="'.$_SERVER['PHP_SELF'].'?tab='.$tab.'&tabobj='.$tabobj.'&module='.$module.($forceddirread?'@'.$dirread:'').'&action=editfile&format=php&file='.urlencode($pathtolist).'">'.img_picto($langs->trans("Edit"), 'edit').'</a>';
|
||||
print '<br>';
|
||||
print '<span class="fa fa-file"></span> '.$langs->trans("PageForCreateEditView").' : <strong>'.$pathtocard.'</strong>';
|
||||
print ' <a href="'.$_SERVER['PHP_SELF'].'?tab='.$tab.'&module='.$module.($forceddirread?'@'.$dirread:'').'&action=editfile&format=php&file='.urlencode($pathtocard).'">'.img_picto($langs->trans("Edit"), 'edit').'</a>';
|
||||
print '<span class="fa fa-file"></span> '.$langs->trans("PageForCreateEditView").' : <strong><a href="'.$urlofcard.'?action=create" target="_test">'.($realpathtocard?'':'<strike>').$pathtocard.($realpathtocard?'':'</strike>').'?action=create</a></strong>';
|
||||
print ' <a href="'.$_SERVER['PHP_SELF'].'?tab='.$tab.'&tabobj='.$tabobj.'&module='.$module.($forceddirread?'@'.$dirread:'').'&action=editfile&format=php&file='.urlencode($pathtocard).'">'.img_picto($langs->trans("Edit"), 'edit').'</a>';
|
||||
print '<br>';
|
||||
print '<span class="fa fa-file"></span> '.$langs->trans("PageForAgendaTab").' : <strong>'.$pathtoagenda.'</strong>';
|
||||
print ' <a href="'.$_SERVER['PHP_SELF'].'?tab='.$tab.'&module='.$module.($forceddirread?'@'.$dirread:'').'&action=editfile&format=php&file='.urlencode($pathtoagenda).'">'.img_picto($langs->trans("Edit"), 'edit').'</a>';
|
||||
print '<span class="fa fa-file"></span> '.$langs->trans("PageForAgendaTab").' : <strong>'.($realpathtoagenda?'':'<strike>').$pathtoagenda.($realpathtoagenda?'':'</strike>').'</strong>';
|
||||
print ' <a href="'.$_SERVER['PHP_SELF'].'?tab='.$tab.'&tabobj='.$tabobj.'&module='.$module.($forceddirread?'@'.$dirread:'').'&action=editfile&format=php&file='.urlencode($pathtoagenda).'">'.img_picto($langs->trans("Edit"), 'edit').'</a>';
|
||||
print '<br>';
|
||||
print '<span class="fa fa-file"></span> '.$langs->trans("PageForDocumentTab").' : <strong>'.$pathtodocument.'</strong>';
|
||||
print ' <a href="'.$_SERVER['PHP_SELF'].'?tab='.$tab.'&module='.$module.($forceddirread?'@'.$dirread:'').'&action=editfile&format=php&file='.urlencode($pathtodocument).'">'.img_picto($langs->trans("Edit"), 'edit').'</a>';
|
||||
print '<span class="fa fa-file"></span> '.$langs->trans("PageForDocumentTab").' : <strong>'.($realpathtodocument?'':'<strike>').$pathtodocument.($realpathtodocument?'':'</strike>').'</strong>';
|
||||
print ' <a href="'.$_SERVER['PHP_SELF'].'?tab='.$tab.'&tabobj='.$tabobj.'&module='.$module.($forceddirread?'@'.$dirread:'').'&action=editfile&format=php&file='.urlencode($pathtodocument).'">'.img_picto($langs->trans("Edit"), 'edit').'</a>';
|
||||
print '<br>';
|
||||
print '<span class="fa fa-file"></span> '.$langs->trans("PageForNoteTab").' : <strong>'.$pathtonote.'</strong>';
|
||||
print ' <a href="'.$_SERVER['PHP_SELF'].'?tab='.$tab.'&module='.$module.($forceddirread?'@'.$dirread:'').'&action=editfile&format=php&file='.urlencode($pathtonote).'">'.img_picto($langs->trans("Edit"), 'edit').'</a>';
|
||||
print '<span class="fa fa-file"></span> '.$langs->trans("PageForNoteTab").' : <strong>'.($realpathtonote?'':'<strike>').$pathtonote.($realpathtonote?'':'</strike>').'</strong>';
|
||||
print ' <a href="'.$_SERVER['PHP_SELF'].'?tab='.$tab.'&tabobj='.$tabobj.'&module='.$module.($forceddirread?'@'.$dirread:'').'&action=editfile&format=php&file='.urlencode($pathtonote).'">'.img_picto($langs->trans("Edit"), 'edit').'</a>';
|
||||
print '<br>';
|
||||
|
||||
print '<br>';
|
||||
|
||||
print '</div>';
|
||||
|
||||
print '<br><br><br>';
|
||||
@ -1413,139 +1489,174 @@ elseif (! empty($module))
|
||||
{
|
||||
$result = @include_once($dirread.'/'.$pathtoclass);
|
||||
}
|
||||
if (class_exists($tabobj)) $tmpobjet = new $tabobj($db);
|
||||
|
||||
$reflector = new ReflectionClass($tabobj);
|
||||
$properties = $reflector->getProperties(); // Can also use get_object_vars
|
||||
$propdefault = $reflector->getDefaultProperties(); // Can also use get_object_vars
|
||||
//$propstat = $reflector->getStaticProperties();
|
||||
|
||||
print load_fiche_titre($langs->trans("Properties"), '', '');
|
||||
|
||||
print '<form action="'.$_SERVER["PHP_SELF"].'" method="POST">';
|
||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
print '<input type="hidden" name="action" value="addproperty">';
|
||||
print '<input type="hidden" name="tab" value="objects">';
|
||||
print '<input type="hidden" name="module" value="'.dol_escape_htmltag($module.($forceddirread?'@'.$dirread:'')).'">';
|
||||
print '<input type="hidden" name="tabobj" value="'.dol_escape_htmltag($tabobj).'">';
|
||||
|
||||
print '<div class="div-table-responsive">';
|
||||
print '<table class="noborder">';
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td>'.$langs->trans("Property");
|
||||
print ' (<a href="https://wiki.dolibarr.org/index.php/Language_and_development_rules#Table_and_fields_structures" target="_blank">'.$langs->trans("Example").'</a>)';
|
||||
print '</td>';
|
||||
print '<td>';
|
||||
print $form->textwithpicto($langs->trans("Label"), $langs->trans("YouCanUseTranslationKey"));
|
||||
print '</td>';
|
||||
print '<td>'.$langs->trans("Type").'</td>';
|
||||
print '<td class="center">'.$langs->trans("NotNull").'</td>';
|
||||
//print '<td>'.$langs->trans("DefaultValue").'</td>';
|
||||
print '<td class="center">'.$langs->trans("DatabaseIndex").'</td>';
|
||||
print '<td class="right">'.$langs->trans("Position").'</td>';
|
||||
print '<td class="right">'.$langs->trans("Enabled").'</td>';
|
||||
print '<td class="right">'.$langs->trans("Visible").'</td>';
|
||||
print '<td class="right">'.$langs->trans("IsAMeasure").'</td>';
|
||||
print '<td class="center">'.$langs->trans("SearchAll").'</td>';
|
||||
print '<td>'.$langs->trans("Comment").'</td>';
|
||||
print '<td></td>';
|
||||
print '</tr>';
|
||||
print '<tr>';
|
||||
print '<td><input class="text" name="propname" value=""></td>';
|
||||
print '<td><input class="text" name="proplabel" value=""></td>';
|
||||
print '<td><input class="text" name="proptype" value=""></td>';
|
||||
print '<td class="center"><input class="text" size="2" name="propnotnull" value=""></td>';
|
||||
//print '<td><input class="text" name="propdefault" value=""></td>';
|
||||
print '<td class="center"><input class="text" size="2" name="propindex" value=""></td>';
|
||||
print '<td class="right"><input class="text right" size="2" name="propposition" value=""></td>';
|
||||
print '<td class="center"><input class="text" size="2" name="propenabled" value=""></td>';
|
||||
print '<td class="center"><input class="text" size="2" name="propvisible" value=""></td>';
|
||||
print '<td class="center"><input class="text" size="2" name="propisameasure" value=""></td>';
|
||||
print '<td class="center"><input class="text" size="2" name="propsearchall" value=""></td>';
|
||||
print '<td><input class="text" name="propcomment" value=""></td>';
|
||||
print '<td align="center">';
|
||||
print '<input class="button" type="submit" name="add" value="'.$langs->trans("Add").'">';
|
||||
print '</td></tr>';
|
||||
|
||||
$properties = $tmpobjet->fields;
|
||||
|
||||
foreach($properties as $propkey => $propval)
|
||||
if (class_exists($tabobj))
|
||||
{
|
||||
/* If from Reflection
|
||||
if ($propval->class == $tabobj)
|
||||
{
|
||||
$propname=$propval->getName();
|
||||
$comment=$propval->getDocComment();
|
||||
$type=gettype($tmpobjet->$propname);
|
||||
$default=$propdefault[$propname];
|
||||
// Discard generic properties
|
||||
if (in_array($propname, array('element', 'childtables', 'table_element', 'table_element_line', 'class_element_line', 'isnolinkedbythird', 'ismultientitymanaged'))) continue;
|
||||
|
||||
// Keep or not lines
|
||||
if (in_array($propname, array('fk_element', 'lines'))) continue;
|
||||
}*/
|
||||
|
||||
$propname=$propkey;
|
||||
$proplabel=$propval['label'];
|
||||
$proptype=$propval['type'];
|
||||
$propnotnull=$propval['notnull'];
|
||||
$propsearchall=$propval['searchall'];
|
||||
//$propdefault=$propval['default'];
|
||||
$propindex=$propval['index'];
|
||||
$propposition=$propval['position'];
|
||||
$propenabled=$propval['enabled'];
|
||||
$propvisible=$propval['visible'];
|
||||
$propisameasure=$propval['isameasure'];
|
||||
$propcomment=$propval['comment'];
|
||||
|
||||
print '<tr class="oddeven">';
|
||||
|
||||
print '<td>';
|
||||
print $propname;
|
||||
print '</td>';
|
||||
print '<td>';
|
||||
print $proplabel;
|
||||
print '</td>';
|
||||
print '<td>';
|
||||
print $proptype;
|
||||
print '</td>';
|
||||
print '<td class="center">';
|
||||
print $propnotnull;
|
||||
print '</td>';
|
||||
/*print '<td>';
|
||||
print $propdefault;
|
||||
print '</td>';*/
|
||||
print '<td class="center">';
|
||||
print $propindex?'X':'';
|
||||
print '</td>';
|
||||
print '<td align="right">';
|
||||
print $propposition;
|
||||
print '</td>';
|
||||
print '<td class="center">';
|
||||
print $propenabled?$propenabled:'';
|
||||
print '</td>';
|
||||
print '<td class="center">';
|
||||
print $propvisible?$propvisible:'';
|
||||
print '</td>';
|
||||
print '<td class="center">';
|
||||
print $propisameasure?$propisameasure:'';
|
||||
print '</td>';
|
||||
print '<td class="center">';
|
||||
print $propsearchall?'X':'';
|
||||
print '</td>';
|
||||
print '<td>';
|
||||
print $propcomment;
|
||||
print '</td>';
|
||||
print '<td class="center">';
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=deleteproperty&propertykey='.urlencode($propname).'&tab='.urlencode($tab).'&module='.urlencode($module).'&tabobj='.urlencode($tabobj).'">'.img_delete().'</a>';
|
||||
print '</td>';
|
||||
|
||||
print '</tr>';
|
||||
try {
|
||||
$tmpobjet = @new $tabobj($db);
|
||||
}
|
||||
catch(Exception $e)
|
||||
{
|
||||
dol_syslog('Failed to load Constructor of class: '.$e->getMessage(), LOG_WARNING);
|
||||
}
|
||||
}
|
||||
print '</table>';
|
||||
print '</div>';
|
||||
|
||||
print '</form>';
|
||||
if (! empty($tmpobjet))
|
||||
{
|
||||
$reflector = new ReflectionClass($tabobj);
|
||||
$properties = $reflector->getProperties(); // Can also use get_object_vars
|
||||
$propdefault = $reflector->getDefaultProperties(); // Can also use get_object_vars
|
||||
//$propstat = $reflector->getStaticProperties();
|
||||
|
||||
print load_fiche_titre($langs->trans("Properties"), '', '');
|
||||
|
||||
print '<form action="'.$_SERVER["PHP_SELF"].'" method="POST">';
|
||||
|
||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
print '<input type="hidden" name="action" value="addproperty">';
|
||||
print '<input type="hidden" name="tab" value="objects">';
|
||||
print '<input type="hidden" name="module" value="'.dol_escape_htmltag($module.($forceddirread?'@'.$dirread:'')).'">';
|
||||
print '<input type="hidden" name="tabobj" value="'.dol_escape_htmltag($tabobj).'">';
|
||||
|
||||
print '<div class="div-table-responsive">';
|
||||
print '<table class="noborder">';
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td>'.$langs->trans("Property");
|
||||
print ' (<a href="https://wiki.dolibarr.org/index.php/Language_and_development_rules#Table_and_fields_structures" target="_blank">'.$langs->trans("Example").'</a>)';
|
||||
print '</td>';
|
||||
print '<td>';
|
||||
print $form->textwithpicto($langs->trans("Label"), $langs->trans("YouCanUseTranslationKey"));
|
||||
print '</td>';
|
||||
print '<td>'.$langs->trans("Type").'</td>';
|
||||
print '<td>'.$form->textwithpicto($langs->trans("ArrayOfKeyValues"), $langs->trans("ArrayOfKeyValuesDesc")).'</td>';
|
||||
print '<td class="center">'.$langs->trans("NotNull").'</td>';
|
||||
//print '<td>'.$langs->trans("DefaultValue").'</td>';
|
||||
print '<td class="center">'.$langs->trans("DatabaseIndex").'</td>';
|
||||
print '<td class="right">'.$langs->trans("Position").'</td>';
|
||||
print '<td class="center">'.$form->textwithpicto($langs->trans("Enabled"), $langs->trans("EnabledDesc")).'</td>';
|
||||
print '<td class="center">'.$form->textwithpicto($langs->trans("Visible"), $langs->trans("VisibleDesc")).'</td>';
|
||||
print '<td class="center">'.$form->textwithpicto($langs->trans("IsAMeasure"), $langs->trans("IsAMeasureDesc")).'</td>';
|
||||
print '<td class="center">'.$form->textwithpicto($langs->trans("SearchAll"), $langs->trans("SearchAllDesc")).'</td>';
|
||||
print '<td>'.$langs->trans("Comment").'</td>';
|
||||
print '<td></td>';
|
||||
print '</tr>';
|
||||
|
||||
$properties = dol_sort_array($tmpobjet->fields, 'position');
|
||||
|
||||
if (! empty($properties))
|
||||
{
|
||||
// Line to add a property
|
||||
print '<tr>';
|
||||
print '<td><input class="text" name="propname" value="'.dol_escape_htmltag(GETPOST('propname','alpha')).'"></td>';
|
||||
print '<td><input class="text" name="proplabel" value="'.dol_escape_htmltag(GETPOST('proplabel','alpha')).'"></td>';
|
||||
print '<td><input class="text" name="proptype" value="'.dol_escape_htmltag(GETPOST('proptype','alpha')).'"></td>';
|
||||
print '<td><input class="text" name="proparrayofkeyval" value="'.dol_escape_htmltag(GETPOST('proparrayofkeyval','none')).'"></td>';
|
||||
print '<td class="center"><input class="text" size="2" name="propnotnull" value="'.dol_escape_htmltag(GETPOST('propnotnull','alpha')).'"></td>';
|
||||
//print '<td><input class="text" name="propdefault" value=""></td>';
|
||||
print '<td class="center"><input class="text" size="2" name="propindex" value="'.dol_escape_htmltag(GETPOST('propindex','alpha')).'"></td>';
|
||||
print '<td class="right"><input class="text right" size="2" name="propposition" value="'.dol_escape_htmltag(GETPOST('propposition','alpha')).'"></td>';
|
||||
print '<td class="center"><input class="text" size="2" name="propenabled" value="'.dol_escape_htmltag(GETPOST('propenabled','alpha')).'"></td>';
|
||||
print '<td class="center"><input class="text" size="2" name="propvisible" value="'.dol_escape_htmltag(GETPOST('propvisible','alpha')).'"></td>';
|
||||
print '<td class="center"><input class="text" size="2" name="propisameasure" value="'.dol_escape_htmltag(GETPOST('propisameasure','alpha')).'"></td>';
|
||||
print '<td class="center"><input class="text" size="2" name="propsearchall" value="'.dol_escape_htmltag(GETPOST('propsearchall','alpha')).'"></td>';
|
||||
print '<td><input class="text" name="propcomment" value="'.dol_escape_htmltag(GETPOST('propcomment','alpha')).'"></td>';
|
||||
print '<td align="center">';
|
||||
print '<input class="button" type="submit" name="add" value="'.$langs->trans("Add").'">';
|
||||
print '</td></tr>';
|
||||
|
||||
foreach($properties as $propkey => $propval)
|
||||
{
|
||||
/* If from Reflection
|
||||
if ($propval->class == $tabobj)
|
||||
{
|
||||
$propname=$propval->getName();
|
||||
$comment=$propval->getDocComment();
|
||||
$type=gettype($tmpobjet->$propname);
|
||||
$default=$propdefault[$propname];
|
||||
// Discard generic properties
|
||||
if (in_array($propname, array('element', 'childtables', 'table_element', 'table_element_line', 'class_element_line', 'isnolinkedbythird', 'ismultientitymanaged'))) continue;
|
||||
|
||||
// Keep or not lines
|
||||
if (in_array($propname, array('fk_element', 'lines'))) continue;
|
||||
}*/
|
||||
|
||||
$propname=$propkey;
|
||||
$proplabel=$propval['label'];
|
||||
$proptype=$propval['type'];
|
||||
$proparrayofkeyval=$propval['arrayofkeyval'];
|
||||
$propnotnull=$propval['notnull'];
|
||||
$propsearchall=$propval['searchall'];
|
||||
//$propdefault=$propval['default'];
|
||||
$propindex=$propval['index'];
|
||||
$propposition=$propval['position'];
|
||||
$propenabled=$propval['enabled'];
|
||||
$propvisible=$propval['visible'];
|
||||
$propisameasure=$propval['isameasure'];
|
||||
$propcomment=$propval['comment'];
|
||||
|
||||
print '<tr class="oddeven">';
|
||||
|
||||
print '<td>';
|
||||
print $propname;
|
||||
print '</td>';
|
||||
print '<td>';
|
||||
print $proplabel;
|
||||
print '</td>';
|
||||
print '<td>';
|
||||
print $proptype;
|
||||
print '</td>';
|
||||
print '<td>';
|
||||
if ($proparrayofkeyval)
|
||||
{
|
||||
print json_encode($proparrayofkeyval);
|
||||
}
|
||||
print '</td>';
|
||||
print '<td class="center">';
|
||||
print $propnotnull;
|
||||
print '</td>';
|
||||
/*print '<td>';
|
||||
print $propdefault;
|
||||
print '</td>';*/
|
||||
print '<td class="center">';
|
||||
print $propindex?'X':'';
|
||||
print '</td>';
|
||||
print '<td align="right">';
|
||||
print $propposition;
|
||||
print '</td>';
|
||||
print '<td class="center">';
|
||||
print $propenabled?$propenabled:'';
|
||||
print '</td>';
|
||||
print '<td class="center">';
|
||||
print $propvisible?$propvisible:'';
|
||||
print '</td>';
|
||||
print '<td class="center">';
|
||||
print $propisameasure?$propisameasure:'';
|
||||
print '</td>';
|
||||
print '<td class="center">';
|
||||
print $propsearchall?'X':'';
|
||||
print '</td>';
|
||||
print '<td>';
|
||||
print $propcomment;
|
||||
print '</td>';
|
||||
print '<td class="center">';
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=deleteproperty&propertykey='.urlencode($propname).'&tab='.urlencode($tab).'&module='.urlencode($module).'&tabobj='.urlencode($tabobj).'">'.img_delete().'</a>';
|
||||
print '</td>';
|
||||
|
||||
print '</tr>';
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<tr><td><span class="warning">'.$langs->trans('Property $field not found into the class. The class was probably not generated by modulebuilder.').'</warning></td></tr>';
|
||||
}
|
||||
print '</table>';
|
||||
print '</div>';
|
||||
|
||||
print '</form>';
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<tr><td><span class="warning">'.$langs->trans('Failed to init the object with the new.').'</warning></td></tr>';
|
||||
}
|
||||
}
|
||||
catch(Exception $e)
|
||||
{
|
||||
@ -1571,13 +1682,14 @@ elseif (! empty($module))
|
||||
print '<input type="hidden" name="action" value="savefile">';
|
||||
print '<input type="hidden" name="file" value="'.dol_escape_htmltag($file).'">';
|
||||
print '<input type="hidden" name="tab" value="'.$tab.'">';
|
||||
print '<input type="hidden" name="tabobj" value="'.dol_escape_htmltag($tabobj).'">';
|
||||
print '<input type="hidden" name="module" value="'.$module.($forceddirread?'@'.$dirread:'').'">';
|
||||
|
||||
$doleditor=new DolEditor('editfilecontent', $content, '', '300', 'Full', 'In', true, false, 'ace', 0, '99%');
|
||||
print $doleditor->Create(1, '', false, $langs->trans("File").' : '.$file, (GETPOST('format','aZ09')?GETPOST('format','aZ09'):'html'));
|
||||
print '<br>';
|
||||
print '<center>';
|
||||
print '<input type="submit" class="button" id="savefile" name="savefile" value="'.dol_escape_htmltag($langs->trans("Save")).'">';
|
||||
print '<input type="submit" class="button buttonforacesave" id="savefile" name="savefile" value="'.dol_escape_htmltag($langs->trans("Save")).'">';
|
||||
print ' ';
|
||||
print '<input type="submit" class="button" name="cancel" value="'.dol_escape_htmltag($langs->trans("Cancel")).'">';
|
||||
print '</center>';
|
||||
@ -1591,22 +1703,267 @@ elseif (! empty($module))
|
||||
|
||||
if ($tab == 'menus')
|
||||
{
|
||||
print $langs->trans("FeatureNotYetAvailable");
|
||||
$pathtofile = $modulelowercase.'/core/modules/mod'.$module.'.class.php';
|
||||
|
||||
//$menus = $moduleobj->;
|
||||
|
||||
if ($action != 'editfile' || empty($file))
|
||||
{
|
||||
print $langs->trans("MenusDefDesc", '<a href="'.DOL_URL_ROOT.'/admin/menus/index.php">'.$langs->trans('Menus').'</a>').'<br>';
|
||||
print '<br>';
|
||||
|
||||
print '<span class="fa fa-file"></span> '.$langs->trans("DescriptorFile").' : <strong>'.$pathtofile.'</strong>';
|
||||
print ' <a href="'.$_SERVER['PHP_SELF'].'?tab='.$tab.'&module='.$module.'&action=editfile&format=php&file='.urlencode($pathtofile).'">'.img_picto($langs->trans("Edit"), 'edit').'</a>';
|
||||
print '<br>';
|
||||
|
||||
print '<br>';
|
||||
//print load_fiche_titre($langs->trans("MenusList"), '', '');
|
||||
|
||||
print '<form action="'.$_SERVER["PHP_SELF"].'" method="POST">';
|
||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
print '<input type="hidden" name="action" value="addproperty">';
|
||||
print '<input type="hidden" name="tab" value="objects">';
|
||||
print '<input type="hidden" name="module" value="'.dol_escape_htmltag($module).'">';
|
||||
print '<input type="hidden" name="tabobj" value="'.dol_escape_htmltag($tabobj).'">';
|
||||
|
||||
/*
|
||||
print '<div class="div-table-responsive">';
|
||||
print '<table class="noborder">';
|
||||
|
||||
print '<tr class="liste_titre">';
|
||||
print_liste_field_titre("Menu",$_SERVER["PHP_SELF"],"","",$param,'',$sortfield,$sortorder);
|
||||
print_liste_field_titre("CronTask",'','',"",$param,'',$sortfield,$sortorder);
|
||||
print_liste_field_titre("CronFrequency",'',"","",$param,'',$sortfield,$sortorder);
|
||||
print_liste_field_titre("StatusAtInstall",$_SERVER["PHP_SELF"],"","",$param,'',$sortfield,$sortorder);
|
||||
print_liste_field_titre("Comment",$_SERVER["PHP_SELF"],"","",$param,'',$sortfield,$sortorder);
|
||||
print "</tr>\n";
|
||||
|
||||
if (count($menus))
|
||||
{
|
||||
foreach ($cronjobs as $cron)
|
||||
{
|
||||
print '<tr class="oddeven">';
|
||||
|
||||
print '<td>';
|
||||
print $cron['label'];
|
||||
print '</td>';
|
||||
|
||||
print '<td>';
|
||||
if ($cron['jobtype']=='method')
|
||||
{
|
||||
$text=$langs->trans("CronClass");
|
||||
$texttoshow=$langs->trans('CronModule').': '.$module.'<br>';
|
||||
$texttoshow.=$langs->trans('CronClass').': '. $cron['class'].'<br>';
|
||||
$texttoshow.=$langs->trans('CronObject').': '. $cron['objectname'].'<br>';
|
||||
$texttoshow.=$langs->trans('CronMethod').': '. $cron['method'];
|
||||
$texttoshow.='<br>'.$langs->trans('CronArgs').': '. $cron['parameters'];
|
||||
$texttoshow.='<br>'.$langs->trans('Comment').': '. $langs->trans($cron['comment']);
|
||||
}
|
||||
elseif ($cron['jobtype']=='command')
|
||||
{
|
||||
$text=$langs->trans('CronCommand');
|
||||
$texttoshow=$langs->trans('CronCommand').': '.dol_trunc($cron['command']);
|
||||
$texttoshow.='<br>'.$langs->trans('CronArgs').': '. $cron['parameters'];
|
||||
$texttoshow.='<br>'.$langs->trans('Comment').': '. $langs->trans($cron['comment']);
|
||||
}
|
||||
print $form->textwithpicto($text, $texttoshow, 1);
|
||||
print '</td>';
|
||||
|
||||
print '<td>';
|
||||
if($cron['unitfrequency'] == "60") print $langs->trans('CronEach')." ".($cron['frequency'])." ".$langs->trans('Minutes');
|
||||
if($cron['unitfrequency'] == "3600") print $langs->trans('CronEach')." ".($cron['frequency'])." ".$langs->trans('Hours');
|
||||
if($cron['unitfrequency'] == "86400") print $langs->trans('CronEach')." ".($cron['frequency'])." ".$langs->trans('Days');
|
||||
if($cron['unitfrequency'] == "604800") print $langs->trans('CronEach')." ".($cron['frequency'])." ".$langs->trans('Weeks');
|
||||
print '</td>';
|
||||
|
||||
print '<td>';
|
||||
print $cron['status'];
|
||||
print '</td>';
|
||||
|
||||
print '<td>';
|
||||
if (!empty($cron['comment'])) {print $cron['comment'];}
|
||||
print '</td>';
|
||||
|
||||
print '</tr>';
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<tr><td class="opacitymedium" colspan="5">'.$langs->trans("None").'</td></tr>';
|
||||
}
|
||||
|
||||
print '</table>';
|
||||
print '</div>';
|
||||
|
||||
print '</form>';
|
||||
*/
|
||||
}
|
||||
else
|
||||
{
|
||||
$fullpathoffile=dol_buildpath($file, 0);
|
||||
|
||||
$content = file_get_contents($fullpathoffile);
|
||||
|
||||
// New module
|
||||
print '<form action="'.$_SERVER["PHP_SELF"].'" method="POST">';
|
||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
print '<input type="hidden" name="action" value="savefile">';
|
||||
print '<input type="hidden" name="file" value="'.dol_escape_htmltag($file).'">';
|
||||
print '<input type="hidden" name="tab" value="'.$tab.'">';
|
||||
print '<input type="hidden" name="module" value="'.$module.'">';
|
||||
|
||||
$doleditor=new DolEditor('editfilecontent', $content, '', '300', 'Full', 'In', true, false, 'ace', 0, '99%');
|
||||
print $doleditor->Create(1, '', false, $langs->trans("File").' : '.$file, (GETPOST('format','aZ09')?GETPOST('format','aZ09'):'html'));
|
||||
print '<br>';
|
||||
print '<center>';
|
||||
print '<input type="submit" class="button buttonforacesave" id="savefile" name="savefile" value="'.dol_escape_htmltag($langs->trans("Save")).'">';
|
||||
print ' ';
|
||||
print '<input type="submit" class="button" name="cancel" value="'.dol_escape_htmltag($langs->trans("Cancel")).'">';
|
||||
print '</center>';
|
||||
|
||||
print '</form>';
|
||||
}
|
||||
}
|
||||
|
||||
if ($tab == 'permissions')
|
||||
{
|
||||
print $langs->trans("FeatureNotYetAvailable");
|
||||
$pathtofile = $modulelowercase.'/core/modules/mod'.$module.'.class.php';
|
||||
|
||||
//$perms = $moduleobj->;
|
||||
|
||||
if ($action != 'editfile' || empty($file))
|
||||
{
|
||||
print $langs->trans("PermissionsDefDesc", '<a href="'.DOL_URL_ROOT.'/admin/perms.php">'.$langs->trans('DefaultPermissions').'</a>').'<br>';
|
||||
print '<br>';
|
||||
|
||||
print '<span class="fa fa-file"></span> '.$langs->trans("DescriptorFile").' : <strong>'.$pathtofile.'</strong>';
|
||||
print ' <a href="'.$_SERVER['PHP_SELF'].'?tab='.$tab.'&module='.$module.'&action=editfile&format=php&file='.urlencode($pathtofile).'">'.img_picto($langs->trans("Edit"), 'edit').'</a>';
|
||||
print '<br>';
|
||||
|
||||
print '<br>';
|
||||
print load_fiche_titre($langs->trans("ListOfPermissionsDefined"), '', '');
|
||||
|
||||
print '<form action="'.$_SERVER["PHP_SELF"].'" method="POST">';
|
||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
print '<input type="hidden" name="action" value="addproperty">';
|
||||
print '<input type="hidden" name="tab" value="objects">';
|
||||
print '<input type="hidden" name="module" value="'.dol_escape_htmltag($module).'">';
|
||||
print '<input type="hidden" name="tabobj" value="'.dol_escape_htmltag($tabobj).'">';
|
||||
|
||||
print 'TODO...';
|
||||
/*
|
||||
print '<div class="div-table-responsive">';
|
||||
print '<table class="noborder">';
|
||||
|
||||
print '<tr class="liste_titre">';
|
||||
print_liste_field_titre("CronLabel",$_SERVER["PHP_SELF"],"","",$param,'',$sortfield,$sortorder);
|
||||
print_liste_field_titre("CronTask",'','',"",$param,'',$sortfield,$sortorder);
|
||||
print_liste_field_titre("CronFrequency",'',"","",$param,'',$sortfield,$sortorder);
|
||||
print_liste_field_titre("StatusAtInstall",$_SERVER["PHP_SELF"],"","",$param,'',$sortfield,$sortorder);
|
||||
print_liste_field_titre("Comment",$_SERVER["PHP_SELF"],"","",$param,'',$sortfield,$sortorder);
|
||||
print "</tr>\n";
|
||||
|
||||
if (count($cronjobs))
|
||||
{
|
||||
foreach ($cronjobs as $cron)
|
||||
{
|
||||
print '<tr class="oddeven">';
|
||||
|
||||
print '<td>';
|
||||
print $cron['label'];
|
||||
print '</td>';
|
||||
|
||||
print '<td>';
|
||||
if ($cron['jobtype']=='method')
|
||||
{
|
||||
$text=$langs->trans("CronClass");
|
||||
$texttoshow=$langs->trans('CronModule').': '.$module.'<br>';
|
||||
$texttoshow.=$langs->trans('CronClass').': '. $cron['class'].'<br>';
|
||||
$texttoshow.=$langs->trans('CronObject').': '. $cron['objectname'].'<br>';
|
||||
$texttoshow.=$langs->trans('CronMethod').': '. $cron['method'];
|
||||
$texttoshow.='<br>'.$langs->trans('CronArgs').': '. $cron['parameters'];
|
||||
$texttoshow.='<br>'.$langs->trans('Comment').': '. $langs->trans($cron['comment']);
|
||||
}
|
||||
elseif ($cron['jobtype']=='command')
|
||||
{
|
||||
$text=$langs->trans('CronCommand');
|
||||
$texttoshow=$langs->trans('CronCommand').': '.dol_trunc($cron['command']);
|
||||
$texttoshow.='<br>'.$langs->trans('CronArgs').': '. $cron['parameters'];
|
||||
$texttoshow.='<br>'.$langs->trans('Comment').': '. $langs->trans($cron['comment']);
|
||||
}
|
||||
print $form->textwithpicto($text, $texttoshow, 1);
|
||||
print '</td>';
|
||||
|
||||
print '<td>';
|
||||
if($cron['unitfrequency'] == "60") print $langs->trans('CronEach')." ".($cron['frequency'])." ".$langs->trans('Minutes');
|
||||
if($cron['unitfrequency'] == "3600") print $langs->trans('CronEach')." ".($cron['frequency'])." ".$langs->trans('Hours');
|
||||
if($cron['unitfrequency'] == "86400") print $langs->trans('CronEach')." ".($cron['frequency'])." ".$langs->trans('Days');
|
||||
if($cron['unitfrequency'] == "604800") print $langs->trans('CronEach')." ".($cron['frequency'])." ".$langs->trans('Weeks');
|
||||
print '</td>';
|
||||
|
||||
print '<td>';
|
||||
print $cron['status'];
|
||||
print '</td>';
|
||||
|
||||
print '<td>';
|
||||
if (!empty($cron['comment'])) {print $cron['comment'];}
|
||||
print '</td>';
|
||||
|
||||
print '</tr>';
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<tr><td class="opacitymedium" colspan="5">'.$langs->trans("None").'</td></tr>';
|
||||
}
|
||||
|
||||
print '</table>';
|
||||
print '</div>';
|
||||
|
||||
print '</form>';
|
||||
*/
|
||||
}
|
||||
else
|
||||
{
|
||||
$fullpathoffile=dol_buildpath($file, 0);
|
||||
|
||||
$content = file_get_contents($fullpathoffile);
|
||||
|
||||
// New module
|
||||
print '<form action="'.$_SERVER["PHP_SELF"].'" method="POST">';
|
||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
print '<input type="hidden" name="action" value="savefile">';
|
||||
print '<input type="hidden" name="file" value="'.dol_escape_htmltag($file).'">';
|
||||
print '<input type="hidden" name="tab" value="'.$tab.'">';
|
||||
print '<input type="hidden" name="module" value="'.$module.'">';
|
||||
|
||||
$doleditor=new DolEditor('editfilecontent', $content, '', '300', 'Full', 'In', true, false, 'ace', 0, '99%');
|
||||
print $doleditor->Create(1, '', false, $langs->trans("File").' : '.$file, (GETPOST('format','aZ09')?GETPOST('format','aZ09'):'html'));
|
||||
print '<br>';
|
||||
print '<center>';
|
||||
print '<input type="submit" class="button buttonforacesave" id="savefile" name="savefile" value="'.dol_escape_htmltag($langs->trans("Save")).'">';
|
||||
print ' ';
|
||||
print '<input type="submit" class="button" name="cancel" value="'.dol_escape_htmltag($langs->trans("Cancel")).'">';
|
||||
print '</center>';
|
||||
|
||||
print '</form>';
|
||||
}
|
||||
}
|
||||
|
||||
if ($tab == 'hooks')
|
||||
{
|
||||
if ($action != 'editfile' || empty($file))
|
||||
{
|
||||
$pathtohook = strtolower($module).'/class/actions_'.strtolower($module).'.class.php';
|
||||
print '<span class="fa fa-file"></span> '.$langs->trans("HooksFile").' : <strong>'.$pathtohook.'</strong>';
|
||||
print $langs->trans("HooksDefDesc").'<br>';
|
||||
print '<br>';
|
||||
|
||||
$pathtofile = $modulelowercase.'/core/modules/mod'.$module.'.class.php';
|
||||
print '<span class="fa fa-file"></span> '.$langs->trans("DescriptorFile").' : <strong>'.$pathtofile.'</strong>';
|
||||
print ' <a href="'.$_SERVER['PHP_SELF'].'?tab='.$tab.'&module='.$module.'&action=editfile&format=php&file='.urlencode($pathtofile).'">'.img_picto($langs->trans("Edit"), 'edit').'</a>';
|
||||
print '<br>';
|
||||
|
||||
$pathtohook = strtolower($module).'/class/actions_'.strtolower($module).'.class.php';
|
||||
print '<span class="fa fa-file"></span> '.$langs->trans("HooksFile").' : <strong>'.$pathtohook.'</strong>';
|
||||
print ' <a href="'.$_SERVER['PHP_SELF'].'?tab='.$tab.'&module='.$module.'&action=editfile&format=php&file='.urlencode($pathtohook).'">'.img_picto($langs->trans("Edit"), 'edit').'</a>';
|
||||
print '<br>';
|
||||
}
|
||||
@ -1628,7 +1985,7 @@ elseif (! empty($module))
|
||||
print $doleditor->Create(1, '', false, $langs->trans("File").' : '.$file, (GETPOST('format','aZ09')?GETPOST('format','aZ09'):'html'));
|
||||
print '<br>';
|
||||
print '<center>';
|
||||
print '<input type="submit" class="button" id="savefile" name="savefile" value="'.dol_escape_htmltag($langs->trans("Save")).'">';
|
||||
print '<input type="submit" class="button buttonforacesave" id="savefile" name="savefile" value="'.dol_escape_htmltag($langs->trans("Save")).'">';
|
||||
print ' ';
|
||||
print '<input type="submit" class="button" name="cancel" value="'.dol_escape_htmltag($langs->trans("Cancel")).'">';
|
||||
print '</center>';
|
||||
@ -1646,6 +2003,9 @@ elseif (! empty($module))
|
||||
|
||||
if ($action != 'editfile' || empty($file))
|
||||
{
|
||||
print $langs->trans("TriggerDefDesc").'<br>';
|
||||
print '<br>';
|
||||
|
||||
if (! empty($triggers))
|
||||
{
|
||||
foreach ($triggers as $trigger)
|
||||
@ -1680,7 +2040,7 @@ elseif (! empty($module))
|
||||
print $doleditor->Create(1, '', false, $langs->trans("File").' : '.$file, (GETPOST('format','aZ09')?GETPOST('format','aZ09'):'html'));
|
||||
print '<br>';
|
||||
print '<center>';
|
||||
print '<input type="submit" class="button" id="savefile" name="savefile" value="'.dol_escape_htmltag($langs->trans("Save")).'">';
|
||||
print '<input type="submit" class="button buttonforacesave" id="savefile" name="savefile" value="'.dol_escape_htmltag($langs->trans("Save")).'">';
|
||||
print ' ';
|
||||
print '<input type="submit" class="button" name="cancel" value="'.dol_escape_htmltag($langs->trans("Cancel")).'">';
|
||||
print '</center>';
|
||||
@ -1731,7 +2091,7 @@ elseif (! empty($module))
|
||||
print $doleditor->Create(1, '', false, $langs->trans("File").' : '.$file, (GETPOST('format','aZ09')?GETPOST('format','aZ09'):'html'));
|
||||
print '<br>';
|
||||
print '<center>';
|
||||
print '<input type="submit" class="button" id="savefile" name="savefile" value="'.dol_escape_htmltag($langs->trans("Save")).'">';
|
||||
print '<input type="submit" class="button buttonforacesave" id="savefile" name="savefile" value="'.dol_escape_htmltag($langs->trans("Save")).'">';
|
||||
print ' ';
|
||||
print '<input type="submit" class="button" name="cancel" value="'.dol_escape_htmltag($langs->trans("Cancel")).'">';
|
||||
print '</center>';
|
||||
@ -1832,6 +2192,8 @@ elseif (! empty($module))
|
||||
|
||||
print '</table>';
|
||||
print '</div>';
|
||||
|
||||
print '</form>';
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -1851,7 +2213,7 @@ elseif (! empty($module))
|
||||
print $doleditor->Create(1, '', false, $langs->trans("File").' : '.$file, (GETPOST('format','aZ09')?GETPOST('format','aZ09'):'html'));
|
||||
print '<br>';
|
||||
print '<center>';
|
||||
print '<input type="submit" class="button" id="savefile" name="savefile" value="'.dol_escape_htmltag($langs->trans("Save")).'">';
|
||||
print '<input type="submit" class="button buttonforacesave" id="savefile" name="savefile" value="'.dol_escape_htmltag($langs->trans("Save")).'">';
|
||||
print ' ';
|
||||
print '<input type="submit" class="button" name="cancel" value="'.dol_escape_htmltag($langs->trans("Cancel")).'">';
|
||||
print '</center>';
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
# CHANGELOG FOR DOLIBARR ERP CRM
|
||||
# CHANGELOG MYMODULE FOR DOLIBARR ERP CRM
|
||||
|
||||
## 1.0
|
||||
Initial version
|
||||
|
||||
@ -62,7 +62,7 @@ class MyObject extends CommonObject
|
||||
* 'type' if the field format.
|
||||
* 'label' the translation key.
|
||||
* 'enabled' is a condition when the filed must be managed.
|
||||
* 'visible' says if field is visible in list (-1 means not shown by default but can be aded into list to be viewed).
|
||||
* 'visible' says if field is visible in list (-1 means not shown by default but can be added into list to be viewed).
|
||||
* 'notnull' is set to 1 if not null in database. Set to -1 if we must set data to null if empty ('' or 0).
|
||||
* 'index' if we want an index in database.
|
||||
* 'foreignkey'=>'tablename.field' if the field is a foreign key (it is recommanded to name the field fk_...).
|
||||
@ -78,19 +78,19 @@ class MyObject extends CommonObject
|
||||
* @var array Array with all fields and their property. Do not use it as a static var. It may be modified by constructor.
|
||||
*/
|
||||
public $fields=array(
|
||||
'rowid' =>array('type'=>'integer', 'label'=>'TechnicalID', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'index'=>1, 'position'=>1, 'comment'=>'Id'),
|
||||
'ref' =>array('type'=>'varchar(64)', 'label'=>'Ref', 'enabled'=>1, 'visible'=>1, 'notnull'=>1, 'index'=>1, 'position'=>10, 'searchall'=>1, 'comment'=>'Reference of object'),
|
||||
'entity' =>array('type'=>'integer', 'label'=>'Entity', 'enabled'=>1, 'visible'=>0, 'notnull'=>1, 'index'=>1, 'position'=>20),
|
||||
'rowid' =>array('type'=>'integer', 'label'=>'TechnicalID', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'index'=>1, 'position'=>1, 'comment'=>'Id'),
|
||||
'ref' =>array('type'=>'varchar(64)', 'label'=>'Ref', 'enabled'=>1, 'visible'=>1, 'notnull'=>1, 'index'=>1, 'position'=>10, 'searchall'=>1, 'comment'=>'Reference of object'),
|
||||
'entity' =>array('type'=>'integer', 'label'=>'Entity', 'enabled'=>1, 'visible'=>0, 'notnull'=>1, 'index'=>1, 'position'=>20),
|
||||
'label' =>array('type'=>'varchar(255)', 'label'=>'Label', 'enabled'=>1, 'visible'=>1, 'position'=>30, 'searchall'=>1),
|
||||
'amount' =>array('type'=>'double(24,8)', 'label'=>'Amount', 'enabled'=>1, 'visible'=>1, 'position'=>40, 'searchall'=>0, 'isameasure'=>1, 'help'=>'Amount'),
|
||||
'status' =>array('type'=>'integer', 'label'=>'Status', 'enabled'=>1, 'visible'=>1, 'index'=>1, 'position'=>1000),
|
||||
'date_creation' =>array('type'=>'datetime', 'label'=>'DateCreation', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>500),
|
||||
'tms' =>array('type'=>'timestamp', 'label'=>'DateModification', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>500),
|
||||
'date_creation' =>array('type'=>'datetime', 'label'=>'DateCreation', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>500),
|
||||
'tms' =>array('type'=>'timestamp', 'label'=>'DateModification', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>500),
|
||||
//'date_valid' =>array('type'=>'datetime', 'label'=>'DateCreation', 'enabled'=>1, 'visible'=>-1, 'position'=>500),
|
||||
'fk_user_creat' =>array('type'=>'integer', 'label'=>'UserAuthor', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>500),
|
||||
'fk_user_creat' =>array('type'=>'integer', 'label'=>'UserAuthor', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>500),
|
||||
'fk_user_modif' =>array('type'=>'integer', 'label'=>'UserModif', 'enabled'=>1, 'visible'=>-1, 'notnull'=>-1, 'position'=>500),
|
||||
//'fk_user_valid' =>array('type'=>'integer', 'label'=>'UserValid', 'enabled'=>1, 'visible'=>-1, 'position'=>500),
|
||||
'import_key' =>array('type'=>'varchar(14)', 'label'=>'ImportId', 'enabled'=>1, 'visible'=>-1, 'notnull'=>-1, 'index'=>1, 'position'=>1000),
|
||||
'status' =>array('type'=>'integer', 'label'=>'Status', 'enabled'=>1, 'visible'=>1, 'index'=>1, 'position'=>1000, 'arrayofkeyval'=>array(0=>'Draft', 1=>'Active', -1=>'Cancel')),
|
||||
);
|
||||
|
||||
public $rowid;
|
||||
@ -144,7 +144,7 @@ class MyObject extends CommonObject
|
||||
|
||||
$this->db = $db;
|
||||
|
||||
if (empty($conf->global->MAIN_SHOW_TECHNICAL_ID)) $fields['rowid']['visible']=0;
|
||||
if (empty($conf->global->MAIN_SHOW_TECHNICAL_ID)) $this->fields['rowid']['visible']=0;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@ -1 +1,127 @@
|
||||
# SPECIFICATIONS OF MODULE MYMODULE FOR DOLIBARR ERP CRM
|
||||
= 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.
|
||||
|
||||
|
||||
|
||||
*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
|
||||
|
||||
|
||||
|
||||
@ -27,8 +27,8 @@
|
||||
//if (! defined('NOREQUIRESOC')) define('NOREQUIRESOC','1');
|
||||
//if (! defined('NOREQUIRETRAN')) define('NOREQUIRETRAN','1');
|
||||
//if (! defined('NOSCANGETFORINJECTION')) define('NOSCANGETFORINJECTION','1'); // Do not check anti CSRF attack test
|
||||
//if (! defined('NOSCANPOSTFORINJECTION')) define('NOSCANPOSTFORINJECTION','1'); // Do not check anti CSRF attack test
|
||||
//if (! defined('NOCSRFCHECK')) define('NOCSRFCHECK','1'); // Do not check anti CSRF attack test
|
||||
//if (! defined('NOSCANPOSTFORINJECTION')) define('NOSCANPOSTFORINJECTION','1'); // Do not check anti CSRF attack test
|
||||
//if (! defined('NOCSRFCHECK')) define('NOCSRFCHECK','1'); // Do not check anti CSRF attack test done when option MAIN_SECURITY_CSRF_WITH_TOKEN is on.
|
||||
//if (! defined('NOSTYLECHECK')) define('NOSTYLECHECK','1'); // Do not check style html tag into posted data
|
||||
//if (! defined('NOTOKENRENEWAL')) define('NOTOKENRENEWAL','1'); // Do not check anti POST attack test
|
||||
//if (! defined('NOREQUIREMENU')) define('NOREQUIREMENU','1'); // If there is no need to load and show top and left menu
|
||||
@ -270,12 +270,32 @@ if ($action == 'create')
|
||||
foreach($object->fields as $key => $val)
|
||||
{
|
||||
if (in_array($key, array('rowid', 'entity', 'date_creation', 'tms', 'fk_user_creat', 'fk_user_modif', 'import_key'))) continue;
|
||||
print '<tr id="field_'.$key.'"><td';
|
||||
print '<tr id="field_'.$key.'">';
|
||||
print '<td';
|
||||
print ' class="titlefieldcreate';
|
||||
if ($val['notnull'] > 0) print ' fieldrequired';
|
||||
print '"';
|
||||
print '>'.$langs->trans($val['label']).'</td>';
|
||||
print '<td><input class="flat" type="text" name="'.$key.'" value="'.(GETPOST($key,'alpha')?GETPOST($key,'alpha'):'').'"></td>';
|
||||
if ($val['type'] == 'text') print ' tdtop';
|
||||
print '"';
|
||||
print '>';
|
||||
print $langs->trans($val['label']);
|
||||
print '</td>';
|
||||
print '<td>';
|
||||
if ($val['type'] == 'text')
|
||||
{
|
||||
print '<textarea class="flat quatrevingtpercent" rows="'.ROWS_4.'" name="'.$key.'">';
|
||||
print GETPOST($key,'none');
|
||||
print '</textarea>';
|
||||
}
|
||||
elseif (is_array($val['arrayofkeyval']))
|
||||
{
|
||||
print $form->selectarray($key, $val['arrayofkeyval'], GETPOST($key, 'int'));
|
||||
}
|
||||
else
|
||||
{
|
||||
$cssforinput = 'minwidth100';
|
||||
print '<input class="flat" class="'.$cssforinput.'" type="text" name="'.$key.'" value="'.(GETPOST($key,'alpha')?GETPOST($key,'alpha'):'').'">';
|
||||
}
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
}
|
||||
print '</table>'."\n";
|
||||
@ -292,7 +312,7 @@ if ($action == 'create')
|
||||
// Part to edit record
|
||||
if (($id || $ref) && $action == 'edit')
|
||||
{
|
||||
print load_fiche_titre($langs->trans("MyModule"));
|
||||
print load_fiche_titre($langs->trans("MyObject"));
|
||||
|
||||
print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'">';
|
||||
print '<input type="hidden" name="action" value="update">';
|
||||
@ -308,9 +328,26 @@ if (($id || $ref) && $action == 'edit')
|
||||
print '<tr><td';
|
||||
print ' class="titlefieldcreate';
|
||||
if ($val['notnull'] > 0) print ' fieldrequired';
|
||||
if ($val['type'] == 'text') print ' tdtop';
|
||||
print '"';
|
||||
print '>'.$langs->trans($val['label']).'</td>';
|
||||
print '<td><input class="flat" type="text" name="'.$key.'" value="'.(GETPOST($key,'alpha')?GETPOST($key,'alpha'):'').'"></td>';
|
||||
print '<td>';
|
||||
if ($val['type'] == 'text')
|
||||
{
|
||||
print '<textarea class="flat quatrevingtpercent" rows="'.ROWS_4.'" name="'.$key.'">';
|
||||
print GETPOST($key,'none');
|
||||
print '</textarea>';
|
||||
}
|
||||
elseif (is_array($val['arrayofkeyval']))
|
||||
{
|
||||
print $form->selectarray($key, $val['arrayofkeyval'], GETPOST($key, 'int'));
|
||||
}
|
||||
else
|
||||
{
|
||||
$cssforinput = 'minwidth100';
|
||||
print '<input class="flat" class="'.$cssforinput.'" type="text" name="'.$key.'" value="'.(GETPOST($key,'alpha')?GETPOST($key,'alpha'):'').'">';
|
||||
}
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
}
|
||||
print '</table>';
|
||||
@ -326,6 +363,7 @@ if (($id || $ref) && $action == 'edit')
|
||||
|
||||
|
||||
|
||||
|
||||
// Part to show record
|
||||
if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'create')))
|
||||
{
|
||||
@ -509,10 +547,12 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
||||
|
||||
print '</div><div class="fichehalfright"><div class="ficheaddleft">';
|
||||
|
||||
$MAXEVENT = 10;
|
||||
|
||||
// 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);
|
||||
$somethingshown = $formactions->showactions($object, 'myobject', $socid, 1, '', $MAXEVENT);
|
||||
|
||||
print '</div></div></div>';
|
||||
}
|
||||
|
||||
@ -27,8 +27,8 @@
|
||||
//if (! defined('NOREQUIRESOC')) define('NOREQUIRESOC','1');
|
||||
//if (! defined('NOREQUIRETRAN')) define('NOREQUIRETRAN','1');
|
||||
//if (! defined('NOSCANGETFORINJECTION')) define('NOSCANGETFORINJECTION','1'); // Do not check anti CSRF attack test
|
||||
//if (! defined('NOSCANPOSTFORINJECTION')) define('NOSCANPOSTFORINJECTION','1'); // Do not check anti CSRF attack test
|
||||
//if (! defined('NOCSRFCHECK')) define('NOCSRFCHECK','1'); // Do not check anti CSRF attack test
|
||||
//if (! defined('NOSCANPOSTFORINJECTION')) define('NOSCANPOSTFORINJECTION','1'); // Do not check anti CSRF attack test
|
||||
//if (! defined('NOCSRFCHECK')) define('NOCSRFCHECK','1'); // Do not check anti CSRF attack test done when option MAIN_SECURITY_CSRF_WITH_TOKEN is on.
|
||||
//if (! defined('NOSTYLECHECK')) define('NOSTYLECHECK','1'); // Do not check style html tag into posted data
|
||||
//if (! defined('NOTOKENRENEWAL')) define('NOTOKENRENEWAL','1'); // Do not check anti POST attack test
|
||||
//if (! defined('NOREQUIREMENU')) define('NOREQUIREMENU','1'); // If there is no need to load and show top and left menu
|
||||
|
||||
@ -281,9 +281,9 @@ if (empty($reshook))
|
||||
$object->barcode_type_coder = $stdobject->barcode_type_coder;
|
||||
$object->barcode_type_label = $stdobject->barcode_type_label;
|
||||
|
||||
$object->description = dol_htmlcleanlastbr(GETPOST('desc'));
|
||||
$object->description = dol_htmlcleanlastbr(GETPOST('desc','none'));
|
||||
$object->url = GETPOST('url');
|
||||
$object->note_private = dol_htmlcleanlastbr(GETPOST('note_private'));
|
||||
$object->note_private = dol_htmlcleanlastbr(GETPOST('note_private','none'));
|
||||
$object->note = $object->note_private; // deprecated
|
||||
$object->customcode = GETPOST('customcode');
|
||||
$object->country_id = GETPOST('country_id');
|
||||
@ -370,11 +370,11 @@ if (empty($reshook))
|
||||
|
||||
$object->ref = $ref;
|
||||
$object->label = GETPOST('label');
|
||||
$object->description = dol_htmlcleanlastbr(GETPOST('desc'));
|
||||
$object->description = dol_htmlcleanlastbr(GETPOST('desc','none'));
|
||||
$object->url = GETPOST('url');
|
||||
if (! empty($conf->global->MAIN_DISABLE_NOTES_TAB))
|
||||
{
|
||||
$object->note_private = dol_htmlcleanlastbr(GETPOST('note_private'));
|
||||
$object->note_private = dol_htmlcleanlastbr(GETPOST('note_private','none'));
|
||||
$object->note = $object->note_private;
|
||||
}
|
||||
$object->customcode = GETPOST('customcode');
|
||||
@ -977,7 +977,7 @@ else
|
||||
// Description (used in invoice, propal...)
|
||||
print '<tr><td class="tdtop">'.$langs->trans("Description").'</td><td colspan="3">';
|
||||
|
||||
$doleditor = new DolEditor('desc', GETPOST('desc'), '', 160, 'dolibarr_details', '', false, true, $conf->global->FCKEDITOR_ENABLE_PRODUCTDESC, ROWS_4, '90%');
|
||||
$doleditor = new DolEditor('desc', GETPOST('desc','none'), '', 160, 'dolibarr_details', '', false, true, $conf->global->FCKEDITOR_ENABLE_PRODUCTDESC, ROWS_4, '90%');
|
||||
$doleditor->Create();
|
||||
|
||||
print "</td></tr>";
|
||||
@ -1092,7 +1092,7 @@ else
|
||||
print '<tr><td class="tdtop">'.$langs->trans("NoteNotVisibleOnBill").'</td><td colspan="3">';
|
||||
|
||||
// We use dolibarr_details as type of DolEditor here, because we must not accept images as description is included into PDF and not accepted by TCPDF.
|
||||
$doleditor = new DolEditor('note_private', GETPOST('note_private'), '', 140, 'dolibarr_details', '', false, true, $conf->global->FCKEDITOR_ENABLE_PRODUCTDESC, ROWS_8, '90%');
|
||||
$doleditor = new DolEditor('note_private', GETPOST('note_private','none'), '', 140, 'dolibarr_details', '', false, true, $conf->global->FCKEDITOR_ENABLE_PRODUCTDESC, ROWS_8, '90%');
|
||||
$doleditor->Create();
|
||||
|
||||
print "</td></tr>";
|
||||
|
||||
@ -219,10 +219,9 @@ class FormProduct
|
||||
include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
|
||||
$comboenhancement = ajax_combobox($htmlname, $events);
|
||||
$out.= $comboenhancement;
|
||||
$nodatarole=($comboenhancement?' data-role="none"':'');
|
||||
}
|
||||
|
||||
$out.='<select class="flat'.($morecss?' '.$morecss:'').'"'.($disabled?' disabled':'').' id="'.$htmlname.'" name="'.($htmlname.($disabled?'_disabled':'')).'"'.$nodatarole.'>';
|
||||
$out.='<select class="flat'.($morecss?' '.$morecss:'').'"'.($disabled?' disabled':'').' id="'.$htmlname.'" name="'.($htmlname.($disabled?'_disabled':'')).'">';
|
||||
if ($empty) $out.='<option value="-1">'.($empty_label?$empty_label:' ').'</option>';
|
||||
foreach($this->cache_warehouses as $id => $arraytypes)
|
||||
{
|
||||
|
||||
@ -1532,6 +1532,7 @@ class Product extends CommonObject
|
||||
$obj->price = $price_result;
|
||||
}
|
||||
}
|
||||
$this->product_fourn_price_id = $obj->rowid;
|
||||
$this->buyprice = $obj->price; // deprecated
|
||||
$this->fourn_pu = $obj->price / $obj->quantity; // Unit price of product of supplier
|
||||
$this->fourn_price_base_type = 'HT'; // Price base type
|
||||
@ -1577,6 +1578,7 @@ class Product extends CommonObject
|
||||
$obj->price = $price_result;
|
||||
}
|
||||
}
|
||||
$this->product_fourn_price_id = $obj->rowid;
|
||||
$this->buyprice = $obj->price; // deprecated
|
||||
$this->fourn_qty = $obj->quantity; // min quantity for price for a virtual supplier
|
||||
$this->fourn_pu = $obj->price / $obj->quantity; // Unit price of product for a virtual supplier
|
||||
|
||||
@ -96,6 +96,7 @@ class MouvementStock extends CommonObject
|
||||
|
||||
require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/product/stock/class/productlot.class.php';
|
||||
$langs->load("errors");
|
||||
$error = 0;
|
||||
dol_syslog(get_class($this)."::_create start userid=$user->id, fk_product=$fk_product, warehouse_id=$entrepot_id, qty=$qty, type=$type, price=$price, label=$label, inventorycode=$inventorycode, datem=".$datem.", eatby=".$eatby.", sellby=".$sellby.", batch=".$batch.", skip_batch=".$skip_batch);
|
||||
|
||||
@ -141,7 +142,7 @@ class MouvementStock extends CommonObject
|
||||
{
|
||||
if (empty($batch))
|
||||
{
|
||||
$this->errors[]=$langs->trans("ErrorTryToMakeMoveOnProductRequiringBatchData", $product->name);
|
||||
$this->errors[]=$langs->trans("ErrorTryToMakeMoveOnProductRequiringBatchData", $product->ref);
|
||||
dol_syslog("Try to make a movement of a product with status_batch on without any batch data");
|
||||
|
||||
$this->db->rollback();
|
||||
|
||||
@ -1133,13 +1133,11 @@ foreach ($listofreferent as $key => $value)
|
||||
}
|
||||
|
||||
// Enhance with select2
|
||||
$nodatarole='';
|
||||
if ($conf->use_javascript_ajax)
|
||||
{
|
||||
include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
|
||||
$comboenhancement = ajax_combobox('.elementselect');
|
||||
$out.=$comboenhancement;
|
||||
$nodatarole=($comboenhancement?' data-role="none"':'');
|
||||
|
||||
print $comboenhancement;
|
||||
}
|
||||
|
||||
@ -572,7 +572,7 @@ foreach($extrafields->attribute_label as $key=>$value)
|
||||
// Comments
|
||||
print '<tr>';
|
||||
print '<td class="tdtop">'.$langs->trans("Comments").'</td>';
|
||||
print '<td class="tdtop"><textarea name="note_private" id="note_private" wrap="soft" class="quatrevingtpercent" rows="'.ROWS_3.'">'.dol_escape_htmltag(GETPOST('note_private')).'</textarea></td>';
|
||||
print '<td class="tdtop"><textarea name="note_private" id="note_private" wrap="soft" class="quatrevingtpercent" rows="'.ROWS_3.'">'.dol_escape_htmltag(GETPOST('note_private','none')).'</textarea></td>';
|
||||
print '</tr>'."\n";
|
||||
|
||||
// Add specific fields used by Dolibarr foundation for example
|
||||
|
||||
@ -237,7 +237,7 @@ print "</tr>\n";
|
||||
|
||||
print '<tr class="liste_titre">';
|
||||
if (! empty($arrayfields['t.ref']['checked'])) print_liste_field_titre($arrayfields['t.ref']['label'],$_SERVER["PHP_SELF"],"t.ref","",$param,"",$sortfield,$sortorder);
|
||||
if (! empty($arrayfields['ty.label']['checked'])) print_liste_field_titre($arrayfields['ty.label']['label'],$_SERVER["PHP_SELF"],"t.code","",$param,"",$sortfield,$sortorder);
|
||||
if (! empty($arrayfields['ty.label']['checked'])) print_liste_field_titre($arrayfields['ty.label']['label'],$_SERVER["PHP_SELF"],"ty.label","",$param,"",$sortfield,$sortorder);
|
||||
// Extra fields
|
||||
if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label))
|
||||
{
|
||||
|
||||
@ -268,7 +268,7 @@ if (empty($reshook))
|
||||
$object->fk_project = GETPOST('projectid');
|
||||
$object->modelpdf = GETPOST('model');
|
||||
$object->author = $user->id; // deprecated
|
||||
$object->note = GETPOST('note');
|
||||
$object->note = GETPOST('note','none');
|
||||
$object->statut = SupplierProposal::STATUS_DRAFT;
|
||||
|
||||
$id = $object->create_from($user);
|
||||
@ -286,7 +286,7 @@ if (empty($reshook))
|
||||
$object->fk_project = GETPOST('projectid');
|
||||
$object->modelpdf = GETPOST('model');
|
||||
$object->author = $user->id; // deprecated
|
||||
$object->note = GETPOST('note');
|
||||
$object->note = GETPOST('note','none');
|
||||
|
||||
$object->origin = GETPOST('origin');
|
||||
$object->origin_id = GETPOST('originid');
|
||||
@ -465,7 +465,7 @@ if (empty($reshook))
|
||||
} else {
|
||||
// prevent browser refresh from closing proposal several times
|
||||
if ($object->statut == SupplierProposal::STATUS_VALIDATED) {
|
||||
$object->cloture($user, GETPOST('statut'), GETPOST('note'));
|
||||
$object->cloture($user, GETPOST('statut'), GETPOST('note','none'));
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -774,7 +774,7 @@ if (empty($reshook))
|
||||
$info_bits |= 0x01;
|
||||
|
||||
// Clean parameters
|
||||
$description = dol_htmlcleanlastbr(GETPOST('product_desc'));
|
||||
$description = dol_htmlcleanlastbr(GETPOST('product_desc','none'));
|
||||
|
||||
// Define vat_rate
|
||||
$vat_rate = (GETPOST('tva_tx') ? GETPOST('tva_tx') : 0);
|
||||
|
||||
@ -719,7 +719,9 @@ div.myavailability {
|
||||
margin-top: 6px;
|
||||
margin-bottom: 12px;
|
||||
}
|
||||
|
||||
#builddoc_form ~ .showlinkedobjectblock {
|
||||
margin-top: 20px;
|
||||
}
|
||||
|
||||
/* For the long description of module */
|
||||
.moduledesclong p img, .moduledesclong p a img {
|
||||
@ -863,11 +865,11 @@ div.fiche>form>div.div-table-responsive {
|
||||
.minwidth500imp { min-width: 250px !important; }
|
||||
}
|
||||
|
||||
/* Force values for small screen 570 */
|
||||
/* Force values for small screen 767 */
|
||||
@media only screen and (max-width: 767px)
|
||||
{
|
||||
body {
|
||||
font-size: <?php print $fontsize+1; ?>px;
|
||||
font-size: <?php print $fontsize+3; ?>px;
|
||||
}
|
||||
}
|
||||
|
||||
@ -875,7 +877,7 @@ div.fiche>form>div.div-table-responsive {
|
||||
@media only screen and (max-width: 570px)
|
||||
{
|
||||
body {
|
||||
font-size: <?php print $fontsize+1; ?>px;
|
||||
font-size: <?php print $fontsize+3; ?>px;
|
||||
}
|
||||
|
||||
.divmainbodylarge { margin-left: 20px !important; margin-right: 20px !important; }
|
||||
@ -2037,7 +2039,9 @@ div.tabs {
|
||||
div.tabsElem {
|
||||
margin-top: 1px;
|
||||
} /* To avoid overlap of tabs when not browser */
|
||||
|
||||
div.tabsElem a {
|
||||
font-weight: normal !important;
|
||||
}
|
||||
div.tabBar {
|
||||
color: #<?php echo $colortextbacktab; ?>;
|
||||
padding-top: 16px;
|
||||
@ -2749,14 +2753,16 @@ input.liste_titre {
|
||||
line-height: 24px;
|
||||
}
|
||||
|
||||
.noborder tr.liste_total, .noborder tr.liste_total td, tr.liste_total, form.liste_total {
|
||||
/* height: 32px; */
|
||||
}
|
||||
.noborder tr.liste_total td, tr.liste_total td, form.liste_total div {
|
||||
.noborder tr.liste_total td, tr.liste_total td, form.liste_total div, .noborder tr.liste_total_wrap td, tr.liste_total_wrap td, form.liste_total_wrap div {
|
||||
color: #551188;
|
||||
font-weight: normal;
|
||||
}
|
||||
.noborder tr.liste_total td, tr.liste_total td, form.liste_total div {
|
||||
white-space: nowrap;
|
||||
}
|
||||
.noborder tr.liste_total_wrap td, tr.liste_total_wrap td, form.liste_total_wrap div {
|
||||
white-space: normal;
|
||||
}
|
||||
form.liste_total div {
|
||||
border-top: 1px solid #DDDDDD;
|
||||
}
|
||||
@ -3025,11 +3031,12 @@ div.warning {
|
||||
color: #302020;
|
||||
padding: 0.3em 0.3em 0.3em 0.3em;
|
||||
margin: 0.5em 0em 0.5em 0em;
|
||||
border: 1px solid #e0d0b0;
|
||||
/* border: 1px solid #e0d0b0; */
|
||||
border: 2px solid #805000;
|
||||
-moz-border-radius: 4px;
|
||||
-webkit-border-radius: 4px;
|
||||
border-radius: 4px;
|
||||
background: #EFDF9A;
|
||||
/* background: #EFDF9A; */
|
||||
text-shadow: 0 1px 0 rgba(255, 255, 255, 0.5);
|
||||
}
|
||||
|
||||
@ -3131,12 +3138,11 @@ td.legendLabel { padding: 2px 2px 2px 0 !important; }
|
||||
div.titre {
|
||||
font-family: <?php print $fontlist ?>;
|
||||
font-size: 14px;
|
||||
font-weight: bold;
|
||||
/* font-weight: bold; */
|
||||
color: rgb(<?php print $colortexttitlenotab; ?>);
|
||||
text-decoration: none;
|
||||
padding-top: 5px;
|
||||
padding-bottom: 5px;
|
||||
/* text-shadow: 1px 1px 2px #FFFFFF; */
|
||||
}
|
||||
|
||||
#dolpaymenttable { min-width: 310px; font-size: 16px; } /* Width must have min to make stripe input area visible */
|
||||
@ -3984,6 +3990,12 @@ div#ecm-layout-center {
|
||||
padding-left: 10px !important;
|
||||
padding-right: 10px !important;
|
||||
}
|
||||
.jnotify-container .jnotify-notification .jnotify-message {
|
||||
font-weight: normal;
|
||||
}
|
||||
.jnotify-container .jnotify-notification-warning .jnotify-close, .jnotify-container .jnotify-notification-warning .jnotify-message {
|
||||
color: #a28918 !important;
|
||||
}
|
||||
|
||||
/* use or not ? */
|
||||
div.jnotify-background {
|
||||
|
||||
@ -730,7 +730,9 @@ div.myavailability {
|
||||
margin-top: 6px;
|
||||
margin-bottom: 12px;
|
||||
}
|
||||
|
||||
#builddoc_form ~ .showlinkedobjectblock {
|
||||
margin-top: 20px;
|
||||
}
|
||||
|
||||
/* For the long description of module */
|
||||
.moduledesclong p img,.moduledesclong p a img {
|
||||
@ -865,11 +867,11 @@ div.fiche>form>div.div-table-responsive {
|
||||
.minwidth500imp { min-width: 100px !important; }
|
||||
}
|
||||
|
||||
/* Force values for small screen 570 */
|
||||
/* Force values for small screen 767 */
|
||||
@media only screen and (max-width: 767px)
|
||||
{
|
||||
body {
|
||||
font-size: <?php print $fontsize+1; ?>px;
|
||||
font-size: <?php print $fontsize+3; ?>px;
|
||||
}
|
||||
}
|
||||
|
||||
@ -877,7 +879,7 @@ div.fiche>form>div.div-table-responsive {
|
||||
@media only screen and (max-width: 570px)
|
||||
{
|
||||
body {
|
||||
font-size: <?php print $fontsize+1; ?>px;
|
||||
font-size: <?php print $fontsize+3; ?>px;
|
||||
}
|
||||
|
||||
.divmainbodylarge { margin-left: 20px; margin-right: 20px; }
|
||||
@ -2062,8 +2064,12 @@ div.tabs {
|
||||
clear:both;
|
||||
height:100%;
|
||||
}
|
||||
div.tabsElem { margin-top: 6px; } /* To avoid overlap of tabs when not browser */
|
||||
|
||||
div.tabsElem {
|
||||
margin-top: 6px;
|
||||
} /* To avoid overlap of tabs when not browser */
|
||||
div.tabsElem a {
|
||||
font-weight: normal !important;
|
||||
}
|
||||
div.tabBar {
|
||||
color: #<?php echo $colortextbacktab; ?>;
|
||||
padding-top: 16px;
|
||||
@ -2865,16 +2871,19 @@ input.liste_titre {
|
||||
border: 0px;
|
||||
}
|
||||
|
||||
.noborder tr.liste_total, .noborder tr.liste_total td, tr.liste_total, form.liste_total {
|
||||
/* height: 32px; */
|
||||
}
|
||||
.noborder tr.liste_total td, tr.liste_total td, form.liste_total div {
|
||||
/* border-top: 1px solid #f4f4f4; */
|
||||
.noborder tr.liste_total td, tr.liste_total td, form.liste_total div, .noborder tr.liste_total_wrap td, tr.liste_total_wrap td, form.liste_total_wrap div {
|
||||
color: #332266;
|
||||
font-weight: normal;
|
||||
white-space: nowrap;
|
||||
padding: 4px;
|
||||
}
|
||||
.noborder tr.liste_total td, tr.liste_total td, form.liste_total div {
|
||||
white-space: nowrap;
|
||||
}
|
||||
.noborder tr.liste_total_wrap td, tr.liste_total_wrap td, form.liste_total_wrap div {
|
||||
white-space: normal;
|
||||
}
|
||||
|
||||
|
||||
tr.liste_sub_total, tr.liste_sub_total td {
|
||||
border-bottom: 2px solid #aaa;
|
||||
}
|
||||
@ -3124,11 +3133,12 @@ div.warning {
|
||||
color: #302020;
|
||||
padding: 0.3em 0.3em 0.3em 0.3em;
|
||||
margin: 0.5em 0em 0.5em 0em;
|
||||
border: 1px solid #e0d0b0;
|
||||
/* border: 1px solid #e0d0b0; */
|
||||
border: 2px solid #805000
|
||||
-moz-border-radius:3px;
|
||||
-webkit-border-radius: 3px;
|
||||
border-radius: 3px;
|
||||
background: #EFDF9A;
|
||||
/* background: #EFDF9A; */
|
||||
text-shadow: 0 1px 0 rgba(255, 255, 255, 0.5);
|
||||
}
|
||||
|
||||
@ -4033,6 +4043,12 @@ div#ecm-layout-center {
|
||||
padding-left: 10px !important;
|
||||
padding-right: 10px !important;
|
||||
}
|
||||
.jnotify-container .jnotify-notification .jnotify-message {
|
||||
font-weight: normal;
|
||||
}
|
||||
.jnotify-container .jnotify-notification-warning .jnotify-close, .jnotify-container .jnotify-notification-warning .jnotify-message {
|
||||
color: #a28918 !important;
|
||||
}
|
||||
|
||||
/* use or not ? */
|
||||
div.jnotify-background {
|
||||
|
||||
@ -65,7 +65,7 @@ if (empty($reshook)) {
|
||||
if ($action == 'update' && $user->rights->user->user->creer && !$_POST["cancel"]) {
|
||||
$db->begin();
|
||||
|
||||
$res = $object->update_note(dol_html_entity_decode(GETPOST('note_private'), ENT_QUOTES));
|
||||
$res = $object->update_note(dol_html_entity_decode(GETPOST('note_private','none'), ENT_QUOTES));
|
||||
if ($res < 0) {
|
||||
$mesg = '<div class="error">'.$adh->error.'</div>';
|
||||
$db->rollback();
|
||||
|
||||
@ -275,11 +275,11 @@ if ($action == 'add')
|
||||
}
|
||||
else
|
||||
{
|
||||
$objectpage->title = GETPOST('WEBSITE_TITLE');
|
||||
$objectpage->pageurl = GETPOST('WEBSITE_PAGENAME');
|
||||
$objectpage->description = GETPOST('WEBSITE_DESCRIPTION');
|
||||
$objectpage->keywords = GETPOST('WEBSITE_KEYWORDS');
|
||||
$objectpage->lang = GETPOST('WEBSITE_LANG');
|
||||
$objectpage->title = GETPOST('WEBSITE_TITLE','alpha');
|
||||
$objectpage->pageurl = GETPOST('WEBSITE_PAGENAME','alpha');
|
||||
$objectpage->description = GETPOST('WEBSITE_DESCRIPTION','alpha');
|
||||
$objectpage->keywords = GETPOST('WEBSITE_KEYWORDS','alpha');
|
||||
$objectpage->lang = GETPOST('WEBSITE_LANG','alpha');
|
||||
}
|
||||
|
||||
if (! $error)
|
||||
@ -392,7 +392,7 @@ if ($action == 'updatecss')
|
||||
// $htmlheadercontent.= "header('Content-type: text/html');\n"; // Not required. htmlheader.html is never call as a standalone page
|
||||
$htmlheadercontent.= "// END PHP ?>\n";*/
|
||||
|
||||
$htmlheadercontent.= preg_replace(array('/<html>\n*/ims','/<\/html>\n*/ims'),array('',''),GETPOST('WEBSITE_HTML_HEADER'));
|
||||
$htmlheadercontent.= preg_replace(array('/<html>\n*/ims','/<\/html>\n*/ims'),array('',''),GETPOST('WEBSITE_HTML_HEADER', 'none'));
|
||||
|
||||
/*$htmlheadercontent.= "\n".'<?php // BEGIN PHP'."\n";
|
||||
$htmlheadercontent.= '$tmp = ob_get_contents(); ob_end_clean(); dolWebsiteOutput($tmp);'."\n";
|
||||
@ -425,7 +425,7 @@ if ($action == 'updatecss')
|
||||
$csscontent.= "header('Content-type: text/css');\n";
|
||||
$csscontent.= "// END PHP ?>\n";
|
||||
|
||||
$csscontent.= GETPOST('WEBSITE_CSS_INLINE');
|
||||
$csscontent.= GETPOST('WEBSITE_CSS_INLINE', 'none');
|
||||
|
||||
$csscontent.= "\n".'<?php // BEGIN PHP'."\n";
|
||||
$csscontent.= '$tmp = ob_get_contents(); ob_end_clean(); dolWebsiteOutput($tmp);'."\n";
|
||||
@ -457,7 +457,7 @@ if ($action == 'updatecss')
|
||||
$robotcontent.= "header('Content-type: text/css');\n";
|
||||
$robotcontent.= "// END PHP ?>\n";*/
|
||||
|
||||
$robotcontent.= GETPOST('WEBSITE_ROBOT');
|
||||
$robotcontent.= GETPOST('WEBSITE_ROBOT', 'none');
|
||||
|
||||
/*$robotcontent.= "\n".'<?php // BEGIN PHP'."\n";
|
||||
$robotcontent.= '$tmp = ob_get_contents(); ob_end_clean(); dolWebsiteOutput($tmp);'."\n";
|
||||
@ -489,7 +489,7 @@ if ($action == 'updatecss')
|
||||
$robotcontent.= "header('Content-type: text/css');\n";
|
||||
$robotcontent.= "// END PHP ?>\n";*/
|
||||
|
||||
$htaccesscontent.= GETPOST('WEBSITE_HTACCESS');
|
||||
$htaccesscontent.= GETPOST('WEBSITE_HTACCESS', 'none');
|
||||
|
||||
/*$robotcontent.= "\n".'<?php // BEGIN PHP'."\n";
|
||||
$robotcontent.= '$tmp = ob_get_contents(); ob_end_clean(); dolWebsiteOutput($tmp);'."\n";
|
||||
@ -587,11 +587,11 @@ if ($action == 'updatemeta')
|
||||
{
|
||||
$objectpage->old_object = clone $objectpage;
|
||||
|
||||
$objectpage->pageurl = GETPOST('WEBSITE_PAGENAME');
|
||||
$objectpage->title = GETPOST('WEBSITE_TITLE');
|
||||
$objectpage->description = GETPOST('WEBSITE_DESCRIPTION');
|
||||
$objectpage->keywords = GETPOST('WEBSITE_KEYWORDS');
|
||||
$objectpage->lang = GETPOST('WEBSITE_LANG');
|
||||
$objectpage->pageurl = GETPOST('WEBSITE_PAGENAME', 'alpha');
|
||||
$objectpage->title = GETPOST('WEBSITE_TITLE', 'alpha');
|
||||
$objectpage->description = GETPOST('WEBSITE_DESCRIPTION', 'alpha');
|
||||
$objectpage->keywords = GETPOST('WEBSITE_KEYWORDS', 'alpha');
|
||||
$objectpage->lang = GETPOST('WEBSITE_LANG', 'alpha');
|
||||
|
||||
$res = $objectpage->update($user);
|
||||
if (! $res > 0)
|
||||
|
||||
@ -196,7 +196,6 @@ class AdherentTest extends PHPUnit_Framework_TestCase
|
||||
$result=$localobject->fetch($id);
|
||||
print __METHOD__." id=".$id." result=".$result."\n";
|
||||
$this->assertLessThan($result, 0);
|
||||
|
||||
return $localobject;
|
||||
}
|
||||
|
||||
@ -318,14 +317,13 @@ class AdherentTest extends PHPUnit_Framework_TestCase
|
||||
$langs=$this->savlangs;
|
||||
$db=$this->savdb;
|
||||
|
||||
$template = '%DOL_MAIN_URL_ROOT%,%ID%,%CIVILITY%,%FIRSTNAME%,%LASTNAME%,%FULLNAME%,%COMPANY%,'.
|
||||
'%ADDRESS%,%ZIP%,%TOWN%,%COUNTRY%,%EMAIL%,%BIRTH%,%PHOTO%,%LOGIN%,%PASSWORD%,%PRENOM%,'.
|
||||
'%NOM%,%SOCIETE%,%ADDRESS%,%ZIP%,%TOWN%,%COUNTRY%';
|
||||
$template = '__CIVILITY__,__FIRSTNAME__,__LASTNAME__,__FULLNAME__,__COMPANY__,'.
|
||||
'__ADDRESS__,__ZIP__,__TOWN__,__COUNTRY__,__EMAIL__,__BIRTH__,__PHOTO__,__LOGIN__';
|
||||
|
||||
// If option to store clear password has been set, we get 'dolibspec' into PASSWORD field.
|
||||
$expected = DOL_MAIN_URL_ROOT.','.$localobject->id.',,New firstname,New name,New firstname New name,'.
|
||||
$expected = ',New firstname,New name,New firstname New name,'.
|
||||
'New company,New address,New zip,New town,Belgium,newemail@newemail.com,'.dol_print_date($localobject->birth,'day').',,'.
|
||||
'newlogin,dolibspec,New firstname,New name,New company,New address,New zip,New town,Belgium';
|
||||
'newlogin';
|
||||
|
||||
$result = $localobject->makeSubstitution($template);
|
||||
print __METHOD__." result=".$result."\n";
|
||||
|
||||
Loading…
Reference in New Issue
Block a user