Merge branch 'develop' into Add_param_color_button_action
This commit is contained in:
commit
49efba7ded
@ -237,7 +237,7 @@ if ($action != 'export_csv') {
|
|||||||
print '<input type="hidden" name="page" value="'.$page.'">';
|
print '<input type="hidden" name="page" value="'.$page.'">';
|
||||||
|
|
||||||
$parameters = array();
|
$parameters = array();
|
||||||
$reshook = $hookmanager->executeHooks('addMoreActionsButtons', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
|
$reshook = $hookmanager->executeHooks('addMoreActionsButtonsList', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
|
||||||
if (empty($reshook)) {
|
if (empty($reshook)) {
|
||||||
$button = '<input type="button" id="exportcsvbutton" name="exportcsvbutton" class="butAction" value="'.$langs->trans("Export").' ('.$conf->global->ACCOUNTING_EXPORT_FORMAT.')" />';
|
$button = '<input type="button" id="exportcsvbutton" name="exportcsvbutton" class="butAction" value="'.$langs->trans("Export").' ('.$conf->global->ACCOUNTING_EXPORT_FORMAT.')" />';
|
||||||
|
|
||||||
|
|||||||
@ -766,7 +766,7 @@ if (count($filter)) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
$parameters = array();
|
$parameters = array();
|
||||||
$reshook = $hookmanager->executeHooks('addMoreActionsButtons', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
|
$reshook = $hookmanager->executeHooks('addMoreActionsButtonsList', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
|
||||||
if (empty($reshook)) {
|
if (empty($reshook)) {
|
||||||
// Button re-export
|
// Button re-export
|
||||||
if (!empty($conf->global->ACCOUNTING_REEXPORT)) {
|
if (!empty($conf->global->ACCOUNTING_REEXPORT)) {
|
||||||
|
|||||||
@ -473,7 +473,7 @@ print '<input type="hidden" name="sortfield" value="'.$sortfield.'">';
|
|||||||
print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
|
print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
|
||||||
|
|
||||||
$parameters = array();
|
$parameters = array();
|
||||||
$reshook = $hookmanager->executeHooks('addMoreActionsButtons', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
|
$reshook = $hookmanager->executeHooks('addMoreActionsButtonsList', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
|
||||||
if (empty($reshook)) {
|
if (empty($reshook)) {
|
||||||
$newcardbutton = dolGetButtonTitle($langs->trans('ViewFlatList'), '', 'fa fa-list paddingleft imgforviewmode', DOL_URL_ROOT.'/accountancy/bookkeeping/list.php?'.$param);
|
$newcardbutton = dolGetButtonTitle($langs->trans('ViewFlatList'), '', 'fa fa-list paddingleft imgforviewmode', DOL_URL_ROOT.'/accountancy/bookkeeping/list.php?'.$param);
|
||||||
$newcardbutton .= dolGetButtonTitle($langs->trans('GroupByAccountAccounting'), '', 'fa fa-stream paddingleft imgforviewmode', DOL_URL_ROOT.'/accountancy/bookkeeping/listbyaccount.php?'.$param, '', 1, array('morecss' => 'marginleftonly btnTitleSelected'));
|
$newcardbutton .= dolGetButtonTitle($langs->trans('GroupByAccountAccounting'), '', 'fa fa-stream paddingleft imgforviewmode', DOL_URL_ROOT.'/accountancy/bookkeeping/listbyaccount.php?'.$param, '', 1, array('morecss' => 'marginleftonly btnTitleSelected'));
|
||||||
|
|||||||
@ -473,7 +473,7 @@ print '<input type="hidden" name="sortfield" value="'.$sortfield.'">';
|
|||||||
print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
|
print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
|
||||||
|
|
||||||
$parameters = array();
|
$parameters = array();
|
||||||
$reshook = $hookmanager->executeHooks('addMoreActionsButtons', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
|
$reshook = $hookmanager->executeHooks('addMoreActionsButtonsList', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
|
||||||
if (empty($reshook)) {
|
if (empty($reshook)) {
|
||||||
$newcardbutton = dolGetButtonTitle($langs->trans('ViewFlatList'), '', 'fa fa-list paddingleft imgforviewmode', DOL_URL_ROOT.'/accountancy/bookkeeping/list.php?'.$param);
|
$newcardbutton = dolGetButtonTitle($langs->trans('ViewFlatList'), '', 'fa fa-list paddingleft imgforviewmode', DOL_URL_ROOT.'/accountancy/bookkeeping/list.php?'.$param);
|
||||||
$newcardbutton .= dolGetButtonTitle($langs->trans('GroupByAccountAccounting'), '', 'fa fa-stream paddingleft imgforviewmode', DOL_URL_ROOT.'/accountancy/bookkeeping/listbyaccount.php?'.$param, '', 1, array('morecss' => 'marginleftonly'));
|
$newcardbutton .= dolGetButtonTitle($langs->trans('GroupByAccountAccounting'), '', 'fa fa-stream paddingleft imgforviewmode', DOL_URL_ROOT.'/accountancy/bookkeeping/listbyaccount.php?'.$param, '', 1, array('morecss' => 'marginleftonly'));
|
||||||
|
|||||||
@ -41,6 +41,8 @@ $langs->loadLangs(array('admin', 'other', 'agenda', 'users'));
|
|||||||
|
|
||||||
$action = GETPOST('action', 'aZ09');
|
$action = GETPOST('action', 'aZ09');
|
||||||
$value = GETPOST('value', 'alpha');
|
$value = GETPOST('value', 'alpha');
|
||||||
|
$modulepart = GETPOST('modulepart', 'aZ09'); // Used by actions_setmoduleoptions.inc.php
|
||||||
|
|
||||||
$param = GETPOST('param', 'alpha');
|
$param = GETPOST('param', 'alpha');
|
||||||
$cancel = GETPOST('cancel', 'alpha');
|
$cancel = GETPOST('cancel', 'alpha');
|
||||||
$scandir = GETPOST('scan_dir', 'alpha');
|
$scandir = GETPOST('scan_dir', 'alpha');
|
||||||
|
|||||||
@ -36,6 +36,8 @@ $langs->loadLangs(array("admin", "other", "agenda"));
|
|||||||
|
|
||||||
$action = GETPOST('action', 'aZ09');
|
$action = GETPOST('action', 'aZ09');
|
||||||
$value = GETPOST('value', 'alpha');
|
$value = GETPOST('value', 'alpha');
|
||||||
|
$modulepart = GETPOST('modulepart', 'aZ09'); // Used by actions_setmoduleoptions.inc.php
|
||||||
|
|
||||||
$param = GETPOST('param', 'alpha');
|
$param = GETPOST('param', 'alpha');
|
||||||
$cancel = GETPOST('cancel', 'alpha');
|
$cancel = GETPOST('cancel', 'alpha');
|
||||||
$scandir = GETPOST('scandir', 'alpha');
|
$scandir = GETPOST('scandir', 'alpha');
|
||||||
|
|||||||
@ -36,6 +36,7 @@ if (!$user->admin) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
$action = GETPOST('action', 'aZ09');
|
$action = GETPOST('action', 'aZ09');
|
||||||
|
$modulepart = GETPOST('modulepart', 'aZ09'); // Used by actions_setmoduleoptions.inc.php
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|||||||
@ -36,6 +36,8 @@ if (!$user->admin) {
|
|||||||
|
|
||||||
$action = GETPOST('action', 'aZ09');
|
$action = GETPOST('action', 'aZ09');
|
||||||
$value = GETPOST('value', 'alpha');
|
$value = GETPOST('value', 'alpha');
|
||||||
|
$modulepart = GETPOST('modulepart', 'aZ09'); // Used by actions_setmoduleoptions.inc.php
|
||||||
|
|
||||||
$label = GETPOST('label', 'alpha');
|
$label = GETPOST('label', 'alpha');
|
||||||
$scandir = GETPOST('scan_dir', 'alpha');
|
$scandir = GETPOST('scan_dir', 'alpha');
|
||||||
$type = 'bom';
|
$type = 'bom';
|
||||||
|
|||||||
@ -46,6 +46,8 @@ if (!$user->admin) {
|
|||||||
|
|
||||||
$action = GETPOST('action', 'aZ09');
|
$action = GETPOST('action', 'aZ09');
|
||||||
$value = GETPOST('value', 'alpha');
|
$value = GETPOST('value', 'alpha');
|
||||||
|
$modulepart = GETPOST('modulepart', 'aZ09'); // Used by actions_setmoduleoptions.inc.php
|
||||||
|
|
||||||
$label = GETPOST('label', 'alpha');
|
$label = GETPOST('label', 'alpha');
|
||||||
$scandir = GETPOST('scan_dir', 'alpha');
|
$scandir = GETPOST('scan_dir', 'alpha');
|
||||||
$type = 'order';
|
$type = 'order';
|
||||||
|
|||||||
@ -37,6 +37,8 @@ if (!$user->admin) {
|
|||||||
|
|
||||||
$action = GETPOST('action', 'aZ09');
|
$action = GETPOST('action', 'aZ09');
|
||||||
$value = GETPOST('value', 'alpha');
|
$value = GETPOST('value', 'alpha');
|
||||||
|
$modulepart = GETPOST('modulepart', 'aZ09'); // Used by actions_setmoduleoptions.inc.php
|
||||||
|
|
||||||
$label = GETPOST('label', 'alpha');
|
$label = GETPOST('label', 'alpha');
|
||||||
$scandir = GETPOST('scan_dir', 'alpha');
|
$scandir = GETPOST('scan_dir', 'alpha');
|
||||||
$type = 'contract';
|
$type = 'contract';
|
||||||
|
|||||||
@ -43,6 +43,8 @@ if (!$user->admin) {
|
|||||||
|
|
||||||
$action = GETPOST('action', 'alpha');
|
$action = GETPOST('action', 'alpha');
|
||||||
$value = GETPOST('value', 'alpha');
|
$value = GETPOST('value', 'alpha');
|
||||||
|
$modulepart = GETPOST('modulepart', 'aZ09'); // Used by actions_setmoduleoptions.inc.php
|
||||||
|
|
||||||
$label = GETPOST('label', 'alpha');
|
$label = GETPOST('label', 'alpha');
|
||||||
$scandir = GETPOST('scan_dir', 'alpha');
|
$scandir = GETPOST('scan_dir', 'alpha');
|
||||||
$type = 'delivery';
|
$type = 'delivery';
|
||||||
|
|||||||
@ -41,6 +41,8 @@ $backtopage = GETPOST('backtopage', 'alpha');
|
|||||||
|
|
||||||
$value = GETPOST('value', 'alpha');
|
$value = GETPOST('value', 'alpha');
|
||||||
$label = GETPOST('label', 'alpha');
|
$label = GETPOST('label', 'alpha');
|
||||||
|
$modulepart = GETPOST('modulepart', 'aZ09'); // Used by actions_setmoduleoptions.inc.php
|
||||||
|
|
||||||
$scandir = GETPOST('scan_dir', 'alpha');
|
$scandir = GETPOST('scan_dir', 'alpha');
|
||||||
$type = 'myobject';
|
$type = 'myobject';
|
||||||
|
|
||||||
|
|||||||
@ -43,6 +43,8 @@ if (!$user->admin) {
|
|||||||
|
|
||||||
$action = GETPOST('action', 'aZ09');
|
$action = GETPOST('action', 'aZ09');
|
||||||
$value = GETPOST('value', 'alpha');
|
$value = GETPOST('value', 'alpha');
|
||||||
|
$modulepart = GETPOST('modulepart', 'aZ09'); // Used by actions_setmoduleoptions.inc.php
|
||||||
|
|
||||||
$label = GETPOST('label', 'alpha');
|
$label = GETPOST('label', 'alpha');
|
||||||
$scandir = GETPOST('scan_dir', 'alpha');
|
$scandir = GETPOST('scan_dir', 'alpha');
|
||||||
$type = 'shipping';
|
$type = 'shipping';
|
||||||
|
|||||||
@ -43,6 +43,8 @@ if (!$user->admin) {
|
|||||||
|
|
||||||
$action = GETPOST('action', 'aZ09');
|
$action = GETPOST('action', 'aZ09');
|
||||||
$value = GETPOST('value', 'alpha');
|
$value = GETPOST('value', 'alpha');
|
||||||
|
$modulepart = GETPOST('modulepart', 'aZ09'); // Used by actions_setmoduleoptions.inc.php
|
||||||
|
|
||||||
$label = GETPOST('label', 'alpha');
|
$label = GETPOST('label', 'alpha');
|
||||||
$scandir = GETPOST('scan_dir', 'alpha');
|
$scandir = GETPOST('scan_dir', 'alpha');
|
||||||
$type = 'expensereport';
|
$type = 'expensereport';
|
||||||
|
|||||||
@ -42,6 +42,8 @@ if (!$user->admin) {
|
|||||||
|
|
||||||
$action = GETPOST('action', 'aZ09');
|
$action = GETPOST('action', 'aZ09');
|
||||||
$value = GETPOST('value', 'alpha');
|
$value = GETPOST('value', 'alpha');
|
||||||
|
$modulepart = GETPOST('modulepart', 'aZ09'); // Used by actions_setmoduleoptions.inc.php
|
||||||
|
|
||||||
$label = GETPOST('label', 'alpha');
|
$label = GETPOST('label', 'alpha');
|
||||||
$scandir = GETPOST('scan_dir', 'alpha');
|
$scandir = GETPOST('scan_dir', 'alpha');
|
||||||
$type = 'invoice';
|
$type = 'invoice';
|
||||||
|
|||||||
@ -51,6 +51,8 @@ $backtopage = GETPOST('backtopage', 'alpha');
|
|||||||
|
|
||||||
$value = GETPOST('value', 'alpha');
|
$value = GETPOST('value', 'alpha');
|
||||||
$label = GETPOST('label', 'alpha');
|
$label = GETPOST('label', 'alpha');
|
||||||
|
$modulepart = GETPOST('modulepart', 'aZ09'); // Used by actions_setmoduleoptions.inc.php
|
||||||
|
|
||||||
$scandir = GETPOST('scan_dir', 'alpha');
|
$scandir = GETPOST('scan_dir', 'alpha');
|
||||||
$type = 'invoice';
|
$type = 'invoice';
|
||||||
|
|
||||||
|
|||||||
@ -43,6 +43,8 @@ if (!$user->admin) {
|
|||||||
|
|
||||||
$action = GETPOST('action', 'aZ09');
|
$action = GETPOST('action', 'aZ09');
|
||||||
$value = GETPOST('value', 'alpha');
|
$value = GETPOST('value', 'alpha');
|
||||||
|
$modulepart = GETPOST('modulepart', 'aZ09'); // Used by actions_setmoduleoptions.inc.php
|
||||||
|
|
||||||
$label = GETPOST('label', 'alpha');
|
$label = GETPOST('label', 'alpha');
|
||||||
$scandir = GETPOST('scan_dir', 'alpha');
|
$scandir = GETPOST('scan_dir', 'alpha');
|
||||||
$type = 'ficheinter';
|
$type = 'ficheinter';
|
||||||
|
|||||||
@ -39,6 +39,8 @@ if (!$user->admin) {
|
|||||||
|
|
||||||
$action = GETPOST('action', 'aZ09');
|
$action = GETPOST('action', 'aZ09');
|
||||||
$value = GETPOST('value', 'alpha');
|
$value = GETPOST('value', 'alpha');
|
||||||
|
$modulepart = GETPOST('modulepart', 'aZ09'); // Used by actions_setmoduleoptions.inc.php
|
||||||
|
|
||||||
$label = GETPOST('label', 'alpha');
|
$label = GETPOST('label', 'alpha');
|
||||||
$scandir = GETPOST('scan_dir', 'alpha');
|
$scandir = GETPOST('scan_dir', 'alpha');
|
||||||
$type = 'contract';
|
$type = 'contract';
|
||||||
|
|||||||
@ -50,6 +50,8 @@ $backtopage = GETPOST('backtopage', 'alpha');
|
|||||||
|
|
||||||
$value = GETPOST('value', 'alpha');
|
$value = GETPOST('value', 'alpha');
|
||||||
$label = GETPOST('label', 'alpha');
|
$label = GETPOST('label', 'alpha');
|
||||||
|
$modulepart = GETPOST('modulepart', 'aZ09'); // Used by actions_setmoduleoptions.inc.php
|
||||||
|
|
||||||
$scandir = GETPOST('scan_dir', 'alpha');
|
$scandir = GETPOST('scan_dir', 'alpha');
|
||||||
$type = 'myobject';
|
$type = 'myobject';
|
||||||
|
|
||||||
|
|||||||
@ -41,6 +41,8 @@ if (!$user->admin) {
|
|||||||
|
|
||||||
$action = GETPOST('action', 'aZ09');
|
$action = GETPOST('action', 'aZ09');
|
||||||
$value = GETPOST('value', 'alpha');
|
$value = GETPOST('value', 'alpha');
|
||||||
|
$modulepart = GETPOST('modulepart', 'aZ09'); // Used by actions_setmoduleoptions.inc.php
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Actions
|
* Actions
|
||||||
|
|||||||
@ -37,8 +37,9 @@ $langs->loadLangs(array("admin", "knowledgemanagement"));
|
|||||||
// Parameters
|
// Parameters
|
||||||
$action = GETPOST('action', 'aZ09');
|
$action = GETPOST('action', 'aZ09');
|
||||||
$backtopage = GETPOST('backtopage', 'alpha');
|
$backtopage = GETPOST('backtopage', 'alpha');
|
||||||
|
|
||||||
$value = GETPOST('value', 'alpha');
|
$value = GETPOST('value', 'alpha');
|
||||||
|
$modulepart = GETPOST('modulepart', 'aZ09'); // Used by actions_setmoduleoptions.inc.php
|
||||||
|
|
||||||
$label = GETPOST('label', 'alpha');
|
$label = GETPOST('label', 'alpha');
|
||||||
$scandir = GETPOST('scan_dir', 'alpha');
|
$scandir = GETPOST('scan_dir', 'alpha');
|
||||||
$type = 'knowledgemanagement';
|
$type = 'knowledgemanagement';
|
||||||
|
|||||||
@ -37,6 +37,8 @@ if (!$user->admin) {
|
|||||||
|
|
||||||
$action = GETPOST('action', 'aZ09');
|
$action = GETPOST('action', 'aZ09');
|
||||||
$value = GETPOST('value', 'alpha');
|
$value = GETPOST('value', 'alpha');
|
||||||
|
$modulepart = GETPOST('modulepart', 'aZ09'); // Used by actions_setmoduleoptions.inc.php
|
||||||
|
|
||||||
$label = GETPOST('label', 'alpha');
|
$label = GETPOST('label', 'alpha');
|
||||||
$scandir = GETPOST('scan_dir', 'alpha');
|
$scandir = GETPOST('scan_dir', 'alpha');
|
||||||
$type = 'mrp';
|
$type = 'mrp';
|
||||||
|
|||||||
@ -43,6 +43,8 @@ if (!$user->admin) {
|
|||||||
|
|
||||||
$action = GETPOST('action', 'aZ09');
|
$action = GETPOST('action', 'aZ09');
|
||||||
$value = GETPOST('value', 'alpha');
|
$value = GETPOST('value', 'alpha');
|
||||||
|
$modulepart = GETPOST('modulepart', 'aZ09'); // Used by actions_setmoduleoptions.inc.php
|
||||||
|
|
||||||
$label = GETPOST('label', 'alpha');
|
$label = GETPOST('label', 'alpha');
|
||||||
$scandir = GETPOST('scan_dir', 'alpha');
|
$scandir = GETPOST('scan_dir', 'alpha');
|
||||||
$type = 'propal';
|
$type = 'propal';
|
||||||
|
|||||||
@ -36,6 +36,8 @@ if (!$user->admin) {
|
|||||||
|
|
||||||
$action = GETPOST('action', 'aZ09');
|
$action = GETPOST('action', 'aZ09');
|
||||||
$value = GETPOST('value', 'alpha');
|
$value = GETPOST('value', 'alpha');
|
||||||
|
$modulepart = GETPOST('modulepart', 'aZ09'); // Used by actions_setmoduleoptions.inc.php
|
||||||
|
|
||||||
$label = GETPOST('label', 'alpha');
|
$label = GETPOST('label', 'alpha');
|
||||||
$scandir = GETPOST('scan_dir', 'alpha');
|
$scandir = GETPOST('scan_dir', 'alpha');
|
||||||
$type = 'reception';
|
$type = 'reception';
|
||||||
|
|||||||
@ -43,6 +43,8 @@ if (!$user->admin) {
|
|||||||
|
|
||||||
$type = GETPOST('type', 'alpha');
|
$type = GETPOST('type', 'alpha');
|
||||||
$value = GETPOST('value', 'alpha');
|
$value = GETPOST('value', 'alpha');
|
||||||
|
$modulepart = GETPOST('modulepart', 'aZ09'); // Used by actions_setmoduleoptions.inc.php
|
||||||
|
|
||||||
$label = GETPOST('label', 'alpha');
|
$label = GETPOST('label', 'alpha');
|
||||||
$action = GETPOST('action', 'aZ09');
|
$action = GETPOST('action', 'aZ09');
|
||||||
$scandir = GETPOST('scan_dir', 'alpha');
|
$scandir = GETPOST('scan_dir', 'alpha');
|
||||||
|
|||||||
@ -37,6 +37,8 @@ if (!$user->admin) {
|
|||||||
|
|
||||||
$action = GETPOST('action', 'aZ09');
|
$action = GETPOST('action', 'aZ09');
|
||||||
$value = GETPOST('value', 'alpha');
|
$value = GETPOST('value', 'alpha');
|
||||||
|
$modulepart = GETPOST('modulepart', 'aZ09'); // Used by actions_setmoduleoptions.inc.php
|
||||||
|
|
||||||
$label = GETPOST('label', 'alpha');
|
$label = GETPOST('label', 'alpha');
|
||||||
$scandir = GETPOST('scandir', 'alpha');
|
$scandir = GETPOST('scandir', 'alpha');
|
||||||
$type = 'supplier_payment';
|
$type = 'supplier_payment';
|
||||||
|
|||||||
@ -38,6 +38,8 @@ if (!$user->admin) {
|
|||||||
|
|
||||||
$action = GETPOST('action', 'aZ09');
|
$action = GETPOST('action', 'aZ09');
|
||||||
$value = GETPOST('value', 'alpha');
|
$value = GETPOST('value', 'alpha');
|
||||||
|
$modulepart = GETPOST('modulepart', 'aZ09'); // Used by actions_setmoduleoptions.inc.php
|
||||||
|
|
||||||
$label = GETPOST('label', 'alpha');
|
$label = GETPOST('label', 'alpha');
|
||||||
$scandir = GETPOST('scan_dir', 'alpha');
|
$scandir = GETPOST('scan_dir', 'alpha');
|
||||||
$type = 'supplier_proposal';
|
$type = 'supplier_proposal';
|
||||||
|
|||||||
@ -38,6 +38,8 @@ if (!$user->admin) {
|
|||||||
// Parameters
|
// Parameters
|
||||||
$value = GETPOST('value', 'alpha');
|
$value = GETPOST('value', 'alpha');
|
||||||
$action = GETPOST('action', 'aZ09');
|
$action = GETPOST('action', 'aZ09');
|
||||||
|
$modulepart = GETPOST('modulepart', 'aZ09'); // Used by actions_setmoduleoptions.inc.php
|
||||||
|
|
||||||
$label = GETPOST('label', 'alpha');
|
$label = GETPOST('label', 'alpha');
|
||||||
$scandir = GETPOST('scandir', 'alpha');
|
$scandir = GETPOST('scandir', 'alpha');
|
||||||
$type = 'ticket';
|
$type = 'ticket';
|
||||||
|
|||||||
@ -43,9 +43,11 @@ $extrafields = new ExtraFields($db);
|
|||||||
|
|
||||||
$action = GETPOST('action', 'aZ09');
|
$action = GETPOST('action', 'aZ09');
|
||||||
$backtopage = GETPOST('backtopage', 'alpha');
|
$backtopage = GETPOST('backtopage', 'alpha');
|
||||||
|
$modulepart = GETPOST('modulepart', 'aZ09'); // Used by actions_setmoduleoptions.inc.php
|
||||||
|
|
||||||
$value = GETPOST('value', 'alpha');
|
$value = GETPOST('value', 'alpha');
|
||||||
$label = GETPOST('label', 'alpha');
|
$label = GETPOST('label', 'alpha');
|
||||||
|
|
||||||
$scandir = GETPOST('scandir', 'alpha');
|
$scandir = GETPOST('scandir', 'alpha');
|
||||||
$type = 'user';
|
$type = 'user';
|
||||||
|
|
||||||
|
|||||||
@ -42,6 +42,8 @@ $extrafields = new ExtraFields($db);
|
|||||||
|
|
||||||
$action = GETPOST('action', 'aZ09');
|
$action = GETPOST('action', 'aZ09');
|
||||||
$value = GETPOST('value', 'alpha');
|
$value = GETPOST('value', 'alpha');
|
||||||
|
$modulepart = GETPOST('modulepart', 'aZ09'); // Used by actions_setmoduleoptions.inc.php
|
||||||
|
|
||||||
$type = 'group';
|
$type = 'group';
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|||||||
@ -36,6 +36,7 @@ $langs->loadLangs(array("admin", "workstation"));
|
|||||||
// Parameters
|
// Parameters
|
||||||
$action = GETPOST('action', 'aZ09');
|
$action = GETPOST('action', 'aZ09');
|
||||||
$backtopage = GETPOST('backtopage', 'alpha');
|
$backtopage = GETPOST('backtopage', 'alpha');
|
||||||
|
$modulepart = GETPOST('modulepart', 'aZ09'); // Used by actions_setmoduleoptions.inc.php
|
||||||
|
|
||||||
$value = GETPOST('value', 'alpha');
|
$value = GETPOST('value', 'alpha');
|
||||||
|
|
||||||
|
|||||||
@ -2269,7 +2269,10 @@ abstract class CommonObject
|
|||||||
*/
|
*/
|
||||||
public function setPaymentMethods($id)
|
public function setPaymentMethods($id)
|
||||||
{
|
{
|
||||||
|
$error = 0; $notrigger = 0;
|
||||||
|
|
||||||
dol_syslog(get_class($this).'::setPaymentMethods('.$id.')');
|
dol_syslog(get_class($this).'::setPaymentMethods('.$id.')');
|
||||||
|
|
||||||
if ($this->statut >= 0 || $this->element == 'societe') {
|
if ($this->statut >= 0 || $this->element == 'societe') {
|
||||||
// TODO uniformize field name
|
// TODO uniformize field name
|
||||||
$fieldname = 'fk_mode_reglement';
|
$fieldname = 'fk_mode_reglement';
|
||||||
@ -2296,6 +2299,15 @@ abstract class CommonObject
|
|||||||
if (get_class($this) == 'Fournisseur') {
|
if (get_class($this) == 'Fournisseur') {
|
||||||
$this->mode_reglement_supplier_id = $id;
|
$this->mode_reglement_supplier_id = $id;
|
||||||
}
|
}
|
||||||
|
// Triggers
|
||||||
|
if (!$error && !$notrigger) {
|
||||||
|
// Call triggers
|
||||||
|
$result = $this->call_trigger(strtoupper(get_class($this)).'_MODIFY', $user);
|
||||||
|
if ($result < 0) {
|
||||||
|
$error++;
|
||||||
|
}
|
||||||
|
// End call triggers
|
||||||
|
}
|
||||||
return 1;
|
return 1;
|
||||||
} else {
|
} else {
|
||||||
dol_syslog(get_class($this).'::setPaymentMethods Error '.$this->db->error());
|
dol_syslog(get_class($this).'::setPaymentMethods Error '.$this->db->error());
|
||||||
|
|||||||
@ -783,7 +783,7 @@ function checkVal($out = '', $check = 'alphanohtml', $filter = null, $options =
|
|||||||
// keep lines feed
|
// keep lines feed
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 'alphawithlgt': // No " and no ../ but we keep balanced < > tags with no special chars inside. Can be used for email string like "Name <email>"
|
case 'alphawithlgt': // No " and no ../ but we keep balanced < > tags with no special chars inside. Can be used for email string like "Name <email>". Less secured than 'alphanohtml'
|
||||||
if (!is_array($out)) {
|
if (!is_array($out)) {
|
||||||
$out = trim($out);
|
$out = trim($out);
|
||||||
do {
|
do {
|
||||||
@ -1666,7 +1666,11 @@ function dol_get_fiche_head($links = array(), $active = '', $title = '', $notab
|
|||||||
$limittitle = 30;
|
$limittitle = 30;
|
||||||
$out .= '<a class="tabTitle">';
|
$out .= '<a class="tabTitle">';
|
||||||
if ($picto) {
|
if ($picto) {
|
||||||
$out .= img_picto($title, ($pictoisfullpath ? '' : 'object_').$picto, '', $pictoisfullpath, 0, 0, '', 'imgTabTitle').' ';
|
$noprefix = $pictoisfullpath;
|
||||||
|
if (strpos($picto, 'fontawesome_') !== false) {
|
||||||
|
$noprefix = 1;
|
||||||
|
}
|
||||||
|
$out .= img_picto($title, ($noprefix ? '' : 'object_').$picto, '', $pictoisfullpath, 0, 0, '', 'imgTabTitle').' ';
|
||||||
}
|
}
|
||||||
$out .= '<span class="tabTitleText">'.dol_escape_htmltag(dol_trunc($title, $limittitle)).'</span>';
|
$out .= '<span class="tabTitleText">'.dol_escape_htmltag(dol_trunc($title, $limittitle)).'</span>';
|
||||||
$out .= '</a>';
|
$out .= '</a>';
|
||||||
@ -2021,10 +2025,14 @@ function dol_banner_tab($object, $paramid, $morehtml = '', $shownav = 1, $fieldi
|
|||||||
$width = 14;
|
$width = 14;
|
||||||
$cssclass = 'photorefcenter';
|
$cssclass = 'photorefcenter';
|
||||||
$picto = $object->picto;
|
$picto = $object->picto;
|
||||||
|
$prefix = 'object_';
|
||||||
if ($object->element == 'project' && !$object->public) {
|
if ($object->element == 'project' && !$object->public) {
|
||||||
$picto = 'project'; // instead of projectpub
|
$picto = 'project'; // instead of projectpub
|
||||||
}
|
}
|
||||||
$nophoto = img_picto('No photo', 'object_'.$picto);
|
if (strpos($picto, 'fontawesome_') !== false) {
|
||||||
|
$prefix = '';
|
||||||
|
}
|
||||||
|
$nophoto = img_picto('No photo', $prefix.$picto);
|
||||||
}
|
}
|
||||||
$morehtmlleft .= '<!-- No photo to show -->';
|
$morehtmlleft .= '<!-- No photo to show -->';
|
||||||
$morehtmlleft .= '<div class="floatleft inline-block valignmiddle divphotoref"><div class="photoref">';
|
$morehtmlleft .= '<div class="floatleft inline-block valignmiddle divphotoref"><div class="photoref">';
|
||||||
@ -3609,6 +3617,7 @@ function dol_trunc($string, $size = 40, $trunc = 'right', $stringencoding = 'UTF
|
|||||||
* Example: picto.png if picto.png is stored into htdocs/theme/mytheme/img
|
* Example: picto.png if picto.png is stored into htdocs/theme/mytheme/img
|
||||||
* Example: picto.png@mymodule if picto.png is stored into htdocs/mymodule/img
|
* Example: picto.png@mymodule if picto.png is stored into htdocs/mymodule/img
|
||||||
* Example: /mydir/mysubdir/picto.png if picto.png is stored into htdocs/mydir/mysubdir (pictoisfullpath must be set to 1)
|
* Example: /mydir/mysubdir/picto.png if picto.png is stored into htdocs/mydir/mysubdir (pictoisfullpath must be set to 1)
|
||||||
|
* Example: fontawesome_envelope-open-text_fas_red_1em if you want to use fontaweseome icons: fontawesome_<icon-name>_<style>_<color>_<size> (only icon-name is mandatory)
|
||||||
* @param string $moreatt Add more attribute on img tag (For example 'class="pictofixedwidth"')
|
* @param string $moreatt Add more attribute on img tag (For example 'class="pictofixedwidth"')
|
||||||
* @param boolean|int $pictoisfullpath If true or 1, image path is a full path
|
* @param boolean|int $pictoisfullpath If true or 1, image path is a full path
|
||||||
* @param int $srconly Return only content of the src attribute of img.
|
* @param int $srconly Return only content of the src attribute of img.
|
||||||
@ -3640,6 +3649,40 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
$pictowithouttext = preg_replace('/(\.png|\.gif|\.svg)$/', '', $picto);
|
$pictowithouttext = preg_replace('/(\.png|\.gif|\.svg)$/', '', $picto);
|
||||||
|
|
||||||
|
if (strpos($pictowithouttext, 'fontawesome_') !== false) {
|
||||||
|
$pictowithouttext = explode('_', $pictowithouttext);
|
||||||
|
$marginleftonlyshort = 0;
|
||||||
|
|
||||||
|
$fakey = 'fa-'.$pictowithouttext[1];
|
||||||
|
$fa = $pictowithouttext[2] ? $pictowithouttext[2] : 'fa';
|
||||||
|
$facolor = $pictowithouttext[3] ? $pictowithouttext[3] : '';
|
||||||
|
$fasize = $pictowithouttext[4] ? $pictowithouttext[4] : '';
|
||||||
|
|
||||||
|
// This snippet only needed since function img_edit accepts only one additional parameter: no separate one for css only.
|
||||||
|
// class/style need to be extracted to avoid duplicate class/style validation errors when $moreatt is added to the end of the attributes.
|
||||||
|
$morestyle = '';
|
||||||
|
$reg = array();
|
||||||
|
if (preg_match('/class="([^"]+)"/', $moreatt, $reg)) {
|
||||||
|
$morecss .= ($morecss ? ' ' : '').$reg[1];
|
||||||
|
$moreatt = str_replace('class="'.$reg[1].'"', '', $moreatt);
|
||||||
|
}
|
||||||
|
if (preg_match('/style="([^"]+)"/', $moreatt, $reg)) {
|
||||||
|
$morestyle = $reg[1];
|
||||||
|
$moreatt = str_replace('style="'.$reg[1].'"', '', $moreatt);
|
||||||
|
}
|
||||||
|
$moreatt = trim($moreatt);
|
||||||
|
|
||||||
|
$enabledisablehtml = '<span class="'.$fa.' '.$fakey.($marginleftonlyshort ? ($marginleftonlyshort == 1 ? ' marginleftonlyshort' : ' marginleftonly') : '');
|
||||||
|
$enabledisablehtml .= ($morecss ? ' '.$morecss : '').'" style="'.($fasize ? ('font-size: '.$fasize.';') : '').($facolor ? (' color: '.$facolor.';') : '').($morestyle ? ' '.$morestyle : '').'"'.(($notitle || empty($titlealt)) ? '' : ' title="'.dol_escape_htmltag($titlealt).'"').($moreatt ? ' '.$moreatt : '').'>';
|
||||||
|
/*if (!empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) {
|
||||||
|
$enabledisablehtml .= $titlealt;
|
||||||
|
}*/
|
||||||
|
$enabledisablehtml .= '</span>';
|
||||||
|
|
||||||
|
return $enabledisablehtml;
|
||||||
|
}
|
||||||
|
|
||||||
$pictowithouttext = str_replace('object_', '', $pictowithouttext);
|
$pictowithouttext = str_replace('object_', '', $pictowithouttext);
|
||||||
if (empty($srconly) && in_array($pictowithouttext, array(
|
if (empty($srconly) && in_array($pictowithouttext, array(
|
||||||
'1downarrow', '1uparrow', '1leftarrow', '1rightarrow', '1uparrow_selected', '1downarrow_selected', '1leftarrow_selected', '1rightarrow_selected',
|
'1downarrow', '1uparrow', '1leftarrow', '1rightarrow', '1uparrow_selected', '1downarrow_selected', '1leftarrow_selected', '1rightarrow_selected',
|
||||||
|
|||||||
@ -178,7 +178,10 @@ class doc_generic_proposal_odt extends ModelePDFPropales
|
|||||||
$texte .= '<div id="div_'.get_class($this).'" class="hiddenx">';
|
$texte .= '<div id="div_'.get_class($this).'" class="hiddenx">';
|
||||||
// Show list of found files
|
// Show list of found files
|
||||||
foreach ($listoffiles as $file) {
|
foreach ($listoffiles as $file) {
|
||||||
$texte .= '- '.$file['name'].' <a href="'.DOL_URL_ROOT.'/document.php?modulepart=doctemplates&file=proposals/'.urlencode(basename($file['name'])).'">'.img_picto('', 'listlight').'</a><br>';
|
$texte .= '- '.$file['name'];
|
||||||
|
$texte .= ' <a href="'.DOL_URL_ROOT.'/document.php?modulepart=doctemplates&file=proposals/'.urlencode(basename($file['name'])).'">'.img_picto('', 'listlight').'</a>';
|
||||||
|
$texte .= ' <a class="reposition" href="'.$_SERVER["PHP_SELF"].'?modulepart=doctemplates&keyforuploaddir=PROPALE_ADDON_PDF_ODT_PATH&action=deletefile&token='.newToken().'&file='.urlencode(basename($file['name'])).'">'.img_picto('', 'delete').'</a>';
|
||||||
|
$texte .= '<br>';
|
||||||
}
|
}
|
||||||
$texte .= '</div>';
|
$texte .= '</div>';
|
||||||
|
|
||||||
|
|||||||
@ -16,296 +16,292 @@ class SegmentException extends Exception
|
|||||||
*/
|
*/
|
||||||
class Segment implements IteratorAggregate, Countable
|
class Segment implements IteratorAggregate, Countable
|
||||||
{
|
{
|
||||||
protected $xml;
|
protected $xml;
|
||||||
protected $xmlParsed = '';
|
protected $xmlParsed = '';
|
||||||
protected $name;
|
protected $name;
|
||||||
protected $children = array();
|
protected $children = array();
|
||||||
protected $vars = array();
|
protected $vars = array();
|
||||||
protected $images = array();
|
protected $images = array();
|
||||||
protected $odf;
|
protected $odf;
|
||||||
protected $file;
|
protected $file;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor
|
* Constructor
|
||||||
*
|
*
|
||||||
* @param string $name name of the segment to construct
|
* @param string $name name of the segment to construct
|
||||||
* @param string $xml XML tree of the segment
|
* @param string $xml XML tree of the segment
|
||||||
* @param string $odf odf
|
* @param string $odf odf
|
||||||
*/
|
*/
|
||||||
public function __construct($name, $xml, $odf)
|
public function __construct($name, $xml, $odf)
|
||||||
{
|
{
|
||||||
$this->name = (string) $name;
|
$this->name = (string) $name;
|
||||||
$this->xml = (string) $xml;
|
$this->xml = (string) $xml;
|
||||||
$this->odf = $odf;
|
$this->odf = $odf;
|
||||||
$zipHandler = $this->odf->getConfig('ZIP_PROXY');
|
$zipHandler = $this->odf->getConfig('ZIP_PROXY');
|
||||||
$this->file = new $zipHandler($this->odf->getConfig('PATH_TO_TMP'));
|
$this->file = new $zipHandler($this->odf->getConfig('PATH_TO_TMP'));
|
||||||
$this->_analyseChildren($this->xml);
|
$this->_analyseChildren($this->xml);
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* Returns the name of the segment
|
* Returns the name of the segment
|
||||||
*
|
*
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
public function getName()
|
public function getName()
|
||||||
{
|
{
|
||||||
return $this->name;
|
return $this->name;
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* Does the segment have children ?
|
* Does the segment have children ?
|
||||||
*
|
*
|
||||||
* @return bool
|
* @return bool
|
||||||
*/
|
*/
|
||||||
public function hasChildren()
|
public function hasChildren()
|
||||||
{
|
{
|
||||||
return $this->getIterator()->hasChildren();
|
return $this->getIterator()->hasChildren();
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* Countable interface
|
* Countable interface
|
||||||
*
|
*
|
||||||
* @return int
|
* @return int
|
||||||
*/
|
*/
|
||||||
public function count()
|
public function count()
|
||||||
{
|
{
|
||||||
return count($this->children);
|
return count($this->children);
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* IteratorAggregate interface
|
* IteratorAggregate interface
|
||||||
*
|
*
|
||||||
* @return Iterator
|
* @return Iterator
|
||||||
*/
|
*/
|
||||||
public function getIterator()
|
public function getIterator()
|
||||||
{
|
{
|
||||||
return new RecursiveIteratorIterator(new SegmentIterator($this->children), 1);
|
return new RecursiveIteratorIterator(new SegmentIterator($this->children), 1);
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* Replace variables of the template in the XML code
|
* Replace variables of the template in the XML code
|
||||||
* All the children are also called
|
* All the children are also called
|
||||||
* Complete the current segment with new line
|
* Complete the current segment with new line
|
||||||
*
|
*
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
public function merge()
|
public function merge()
|
||||||
{
|
{
|
||||||
// To provide debug information on line number processed
|
// To provide debug information on line number processed
|
||||||
global $count;
|
global $count;
|
||||||
if (empty($count)) $count=1;
|
if (empty($count)) $count=1;
|
||||||
else $count++;
|
else $count++;
|
||||||
|
|
||||||
if (empty($this->savxml)) $this->savxml = $this->xml; // Sav content of line at first line merged, so we will reuse original for next steps
|
if (empty($this->savxml)) $this->savxml = $this->xml; // Sav content of line at first line merged, so we will reuse original for next steps
|
||||||
$this->xml = $this->savxml;
|
$this->xml = $this->savxml;
|
||||||
$tmpvars = $this->vars; // Store into $tmpvars so we won't modify this->vars when completing data with empty values
|
$tmpvars = $this->vars; // Store into $tmpvars so we won't modify this->vars when completing data with empty values
|
||||||
|
|
||||||
// Search all tags fou into condition to complete $tmpvars, so we will proceed all tests even if not defined
|
// Search all tags fou into condition to complete $tmpvars, so we will proceed all tests even if not defined
|
||||||
$reg='@\[!--\sIF\s([{}a-zA-Z0-9\.\,_]+)\s--\]@smU';
|
$reg='@\[!--\sIF\s([{}a-zA-Z0-9\.\,_]+)\s--\]@smU';
|
||||||
preg_match_all($reg, $this->xml, $matches, PREG_SET_ORDER);
|
$matches = array();
|
||||||
//var_dump($tmpvars);exit;
|
preg_match_all($reg, $this->xml, $matches, PREG_SET_ORDER);
|
||||||
foreach($matches as $match) // For each match, if there is no entry into this->vars, we add it
|
//var_dump($tmpvars);exit;
|
||||||
{
|
foreach ($matches as $match) { // For each match, if there is no entry into this->vars, we add it
|
||||||
if (! empty($match[1]) && ! isset($tmpvars[$match[1]]))
|
if (! empty($match[1]) && ! isset($tmpvars[$match[1]])) {
|
||||||
{
|
$tmpvars[$match[1]] = ''; // Not defined, so we set it to '', we just need entry into this->vars for next loop
|
||||||
$tmpvars[$match[1]] = ''; // Not defined, so we set it to '', we just need entry into this->vars for next loop
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
// Conditionals substitution
|
// Conditionals substitution
|
||||||
// Note: must be done before static substitution, else the variable will be replaced by its value and the conditional won't work anymore
|
// Note: must be done before static substitution, else the variable will be replaced by its value and the conditional won't work anymore
|
||||||
foreach($tmpvars as $key => $value)
|
foreach ($tmpvars as $key => $value) {
|
||||||
{
|
// If value is true (not 0 nor false nor null nor empty string)
|
||||||
// If value is true (not 0 nor false nor null nor empty string)
|
if ($value) {
|
||||||
if ($value)
|
// Remove the IF tag
|
||||||
{
|
$this->xml = str_replace('[!-- IF '.$key.' --]', '', $this->xml);
|
||||||
// Remove the IF tag
|
// Remove everything between the ELSE tag (if it exists) and the ENDIF tag
|
||||||
$this->xml = str_replace('[!-- IF '.$key.' --]', '', $this->xml);
|
$reg = '@(\[!--\sELSE\s' . $key . '\s--\](.*))?\[!--\sENDIF\s' . $key . '\s--\]@smU'; // U modifier = all quantifiers are non-greedy
|
||||||
// Remove everything between the ELSE tag (if it exists) and the ENDIF tag
|
$this->xml = preg_replace($reg, '', $this->xml);
|
||||||
$reg = '@(\[!--\sELSE\s' . $key . '\s--\](.*))?\[!--\sENDIF\s' . $key . '\s--\]@smU'; // U modifier = all quantifiers are non-greedy
|
}
|
||||||
$this->xml = preg_replace($reg, '', $this->xml);
|
// Else the value is false, then two cases: no ELSE and we're done, or there is at least one place where there is an ELSE clause, then we replace it
|
||||||
}
|
else {
|
||||||
// Else the value is false, then two cases: no ELSE and we're done, or there is at least one place where there is an ELSE clause, then we replace it
|
// Find all conditional blocks for this variable: from IF to ELSE and to ENDIF
|
||||||
else
|
$reg = '@\[!--\sIF\s' . $key . '\s--\](.*)(\[!--\sELSE\s' . $key . '\s--\](.*))?\[!--\sENDIF\s' . $key . '\s--\]@smU'; // U modifier = all quantifiers are non-greedy
|
||||||
{
|
preg_match_all($reg, $this->xml, $matches, PREG_SET_ORDER);
|
||||||
// Find all conditional blocks for this variable: from IF to ELSE and to ENDIF
|
foreach ($matches as $match) { // For each match, if there is an ELSE clause, we replace the whole block by the value in the ELSE clause
|
||||||
$reg = '@\[!--\sIF\s' . $key . '\s--\](.*)(\[!--\sELSE\s' . $key . '\s--\](.*))?\[!--\sENDIF\s' . $key . '\s--\]@smU'; // U modifier = all quantifiers are non-greedy
|
if (!empty($match[3])) $this->xml = str_replace($match[0], $match[3], $this->xml);
|
||||||
preg_match_all($reg, $this->xml, $matches, PREG_SET_ORDER);
|
}
|
||||||
foreach($matches as $match) { // For each match, if there is an ELSE clause, we replace the whole block by the value in the ELSE clause
|
// Cleanup the other conditional blocks (all the others where there were no ELSE clause, we can just remove them altogether)
|
||||||
if (!empty($match[3])) $this->xml = str_replace($match[0], $match[3], $this->xml);
|
$this->xml = preg_replace($reg, '', $this->xml);
|
||||||
}
|
}
|
||||||
// Cleanup the other conditional blocks (all the others where there were no ELSE clause, we can just remove them altogether)
|
}
|
||||||
$this->xml = preg_replace($reg, '', $this->xml);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
$this->xmlParsed .= str_replace(array_keys($tmpvars), array_values($tmpvars), $this->xml);
|
$this->xmlParsed .= str_replace(array_keys($tmpvars), array_values($tmpvars), $this->xml);
|
||||||
if ($this->hasChildren()) {
|
if ($this->hasChildren()) {
|
||||||
foreach ($this->children as $child) {
|
foreach ($this->children as $child) {
|
||||||
$this->xmlParsed = str_replace($child->xml, ($child->xmlParsed=="")?$child->merge():$child->xmlParsed, $this->xmlParsed);
|
$this->xmlParsed = str_replace($child->xml, ($child->xmlParsed=="")?$child->merge():$child->xmlParsed, $this->xmlParsed);
|
||||||
$child->xmlParsed = '';
|
$child->xmlParsed = '';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$reg = "/\[!--\sBEGIN\s$this->name\s--\](.*)\[!--\sEND\s$this->name\s--\]/sm";
|
$reg = "/\[!--\sBEGIN\s$this->name\s--\](.*)\[!--\sEND\s$this->name\s--\]/sm";
|
||||||
$this->xmlParsed = preg_replace($reg, '$1', $this->xmlParsed);
|
$this->xmlParsed = preg_replace($reg, '$1', $this->xmlParsed);
|
||||||
// Miguel Erill 09704/2017 - Add macro replacement to invoice lines
|
// Miguel Erill 09704/2017 - Add macro replacement to invoice lines
|
||||||
$this->xmlParsed = $this->macroReplace($this->xmlParsed);
|
$this->xmlParsed = $this->macroReplace($this->xmlParsed);
|
||||||
$this->file->open($this->odf->getTmpfile());
|
$this->file->open($this->odf->getTmpfile());
|
||||||
foreach ($this->images as $imageKey => $imageValue) {
|
foreach ($this->images as $imageKey => $imageValue) {
|
||||||
if ($this->file->getFromName('Pictures/' . $imageValue) === false) {
|
if ($this->file->getFromName('Pictures/' . $imageValue) === false) {
|
||||||
// Add the image inside the ODT document
|
// Add the image inside the ODT document
|
||||||
$this->file->addFile($imageKey, 'Pictures/' . $imageValue);
|
$this->file->addFile($imageKey, 'Pictures/' . $imageValue);
|
||||||
// Add the image to the Manifest (which maintains a list of images, necessary to avoid "Corrupt ODT file. Repair?" when opening the file with LibreOffice)
|
// Add the image to the Manifest (which maintains a list of images, necessary to avoid "Corrupt ODT file. Repair?" when opening the file with LibreOffice)
|
||||||
$this->odf->addImageToManifest($imageValue);
|
$this->odf->addImageToManifest($imageValue);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$this->file->close();
|
$this->file->close();
|
||||||
|
|
||||||
return $this->xmlParsed;
|
return $this->xmlParsed;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Function to replace macros for invoice short and long month, invoice year
|
* Function to replace macros for invoice short and long month, invoice year
|
||||||
*
|
*
|
||||||
* Substitution occur when the invoice is generated, not considering the invoice date
|
* Substitution occur when the invoice is generated, not considering the invoice date
|
||||||
* so do not (re)generate in a diferent date than the one that the invoice belongs to
|
* so do not (re)generate in a diferent date than the one that the invoice belongs to
|
||||||
* Perhaps it would be better to use the invoice issued date but I still do not know
|
* Perhaps it would be better to use the invoice issued date but I still do not know
|
||||||
* how to get it here
|
* how to get it here
|
||||||
*
|
*
|
||||||
* Miguel Erill 09/04/2017
|
* Miguel Erill 09/04/2017
|
||||||
*
|
*
|
||||||
* @param string $value String to convert
|
* @param string $value String to convert
|
||||||
*/
|
*/
|
||||||
public function macroReplace($text)
|
public function macroReplace($text)
|
||||||
{
|
{
|
||||||
include_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
|
include_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
|
||||||
global $langs;
|
global $langs;
|
||||||
|
|
||||||
$hoy = dol_getdate(dol_now('tzuser'));
|
$hoy = dol_getdate(dol_now('tzuser'));
|
||||||
$dateinonemontharray = dol_get_next_month($hoy['mon'], $hoy['year']);
|
$dateinonemontharray = dol_get_next_month($hoy['mon'], $hoy['year']);
|
||||||
$nextMonth = $dateinonemontharray['month'];
|
$nextMonth = $dateinonemontharray['month'];
|
||||||
|
|
||||||
$patterns=array( '/__CURRENTDAY__/u','/__CURENTWEEKDAY__/u',
|
$patterns=array( '/__CURRENTDAY__/u','/__CURENTWEEKDAY__/u',
|
||||||
'/__CURRENTMONTH__/u','/__CURRENTMONTHLONG__/u',
|
'/__CURRENTMONTH__/u','/__CURRENTMONTHLONG__/u',
|
||||||
'/__NEXTMONTH__/u','/__NEXTMONTHLONG__/u',
|
'/__NEXTMONTH__/u','/__NEXTMONTHLONG__/u',
|
||||||
'/__CURRENTYEAR__/u','/__NEXTYEAR__/u' );
|
'/__CURRENTYEAR__/u','/__NEXTYEAR__/u' );
|
||||||
$values=array( $hoy['mday'], $langs->transnoentitiesnoconv($hoy['weekday']),
|
$values=array( $hoy['mday'], $langs->transnoentitiesnoconv($hoy['weekday']),
|
||||||
$hoy['mon'], $langs->transnoentitiesnoconv($hoy['month']),
|
$hoy['mon'], $langs->transnoentitiesnoconv($hoy['month']),
|
||||||
$nextMonth, monthArray($langs)[$nextMonth],
|
$nextMonth, monthArray($langs)[$nextMonth],
|
||||||
$hoy['year'], $hoy['year']+1 );
|
$hoy['year'], $hoy['year']+1 );
|
||||||
|
|
||||||
$text=preg_replace($patterns, $values, $text);
|
$text=preg_replace($patterns, $values, $text);
|
||||||
|
|
||||||
return $text;
|
return $text;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Analyse the XML code in order to find children
|
* Analyse the XML code in order to find children
|
||||||
*
|
*
|
||||||
* @param string $xml Xml
|
* @param string $xml Xml
|
||||||
* @return Segment
|
* @return Segment
|
||||||
*/
|
*/
|
||||||
protected function _analyseChildren($xml)
|
protected function _analyseChildren($xml)
|
||||||
{
|
{
|
||||||
// $reg2 = "#\[!--\sBEGIN\s([\S]*)\s--\](?:<\/text:p>)?(.*)(?:<text:p\s.*>)?\[!--\sEND\s(\\1)\s--\]#sm";
|
// $reg2 = "#\[!--\sBEGIN\s([\S]*)\s--\](?:<\/text:p>)?(.*)(?:<text:p\s.*>)?\[!--\sEND\s(\\1)\s--\]#sm";
|
||||||
$reg2 = "#\[!--\sBEGIN\s([\S]*)\s--\](.*)\[!--\sEND\s(\\1)\s--\]#sm";
|
$reg2 = "#\[!--\sBEGIN\s([\S]*)\s--\](.*)\[!--\sEND\s(\\1)\s--\]#sm";
|
||||||
preg_match_all($reg2, $xml, $matches);
|
preg_match_all($reg2, $xml, $matches);
|
||||||
for ($i = 0, $size = count($matches[0]); $i < $size; $i++) {
|
for ($i = 0, $size = count($matches[0]); $i < $size; $i++) {
|
||||||
if ($matches[1][$i] != $this->name) {
|
if ($matches[1][$i] != $this->name) {
|
||||||
$this->children[$matches[1][$i]] = new self($matches[1][$i], $matches[0][$i], $this->odf);
|
$this->children[$matches[1][$i]] = new self($matches[1][$i], $matches[0][$i], $this->odf);
|
||||||
} else {
|
} else {
|
||||||
$this->_analyseChildren($matches[2][$i]);
|
$this->_analyseChildren($matches[2][$i]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Assign a template variable to replace
|
* Assign a template variable to replace
|
||||||
*
|
*
|
||||||
* @param string $key Key
|
* @param string $key Key
|
||||||
* @param string $value Value
|
* @param string $value Value
|
||||||
* @param string $encode Encode
|
* @param string $encode Encode
|
||||||
* @param string $charset Charset
|
* @param string $charset Charset
|
||||||
* @throws SegmentException
|
* @throws SegmentException
|
||||||
* @return Segment
|
* @return Segment
|
||||||
*/
|
*/
|
||||||
public function setVars($key, $value, $encode = true, $charset = 'ISO-8859')
|
public function setVars($key, $value, $encode = true, $charset = 'ISO-8859')
|
||||||
{
|
{
|
||||||
if (strpos($this->xml, $this->odf->getConfig('DELIMITER_LEFT') . $key . $this->odf->getConfig('DELIMITER_RIGHT')) === false) {
|
$tag = $this->odf->getConfig('DELIMITER_LEFT') . $key . $this->odf->getConfig('DELIMITER_RIGHT');
|
||||||
//throw new SegmentException("var $key not found in {$this->getName()}");
|
|
||||||
}
|
|
||||||
|
|
||||||
$tag = $this->odf->getConfig('DELIMITER_LEFT') . $key . $this->odf->getConfig('DELIMITER_RIGHT');
|
if (strpos($this->xml, $tag) === false) {
|
||||||
|
//throw new SegmentException("var $key not found in {$this->getName()}");
|
||||||
|
}
|
||||||
|
|
||||||
$this->vars[$tag] = $this->odf->convertVarToOdf($value, $encode, $charset);
|
$this->vars[$tag] = $this->odf->convertVarToOdf($value, $encode, $charset);
|
||||||
|
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
/**
|
|
||||||
* Assign a template variable as a picture
|
|
||||||
*
|
|
||||||
* @param string $key name of the variable within the template
|
|
||||||
* @param string $value path to the picture
|
|
||||||
* @throws OdfException
|
|
||||||
* @return Segment
|
|
||||||
*/
|
|
||||||
public function setImage($key, $value)
|
|
||||||
{
|
|
||||||
$filename = strtok(strrchr($value, '/'), '/.');
|
|
||||||
$file = substr(strrchr($value, '/'), 1);
|
|
||||||
$size = @getimagesize($value);
|
|
||||||
if ($size === false) {
|
|
||||||
throw new OdfException("Invalid image");
|
|
||||||
}
|
|
||||||
// Set the width and height of the page
|
|
||||||
list ($width, $height) = $size;
|
|
||||||
$width *= Odf::PIXEL_TO_CM;
|
|
||||||
$height *= Odf::PIXEL_TO_CM;
|
|
||||||
// Fix local-aware issues (eg: 12,10 -> 12.10)
|
|
||||||
$width = sprintf("%F", $width);
|
|
||||||
$height = sprintf("%F", $height);
|
|
||||||
|
|
||||||
$xml = <<<IMG
|
/**
|
||||||
|
* Assign a template variable as a picture
|
||||||
|
*
|
||||||
|
* @param string $key name of the variable within the template
|
||||||
|
* @param string $value path to the picture
|
||||||
|
* @throws OdfException
|
||||||
|
* @return Segment
|
||||||
|
*/
|
||||||
|
public function setImage($key, $value)
|
||||||
|
{
|
||||||
|
$filename = strtok(strrchr($value, '/'), '/.');
|
||||||
|
$file = substr(strrchr($value, '/'), 1);
|
||||||
|
$size = @getimagesize($value);
|
||||||
|
if ($size === false) {
|
||||||
|
throw new OdfException("Invalid image");
|
||||||
|
}
|
||||||
|
// Set the width and height of the page
|
||||||
|
list ($width, $height) = $size;
|
||||||
|
$width *= Odf::PIXEL_TO_CM;
|
||||||
|
$height *= Odf::PIXEL_TO_CM;
|
||||||
|
// Fix local-aware issues (eg: 12,10 -> 12.10)
|
||||||
|
$width = sprintf("%F", $width);
|
||||||
|
$height = sprintf("%F", $height);
|
||||||
|
|
||||||
|
$xml = <<<IMG
|
||||||
<draw:frame draw:style-name="fr1" draw:name="$filename" text:anchor-type="aschar" svg:width="{$width}cm" svg:height="{$height}cm" draw:z-index="3"><draw:image xlink:href="Pictures/$file" xlink:type="simple" xlink:show="embed" xlink:actuate="onLoad"/></draw:frame>
|
<draw:frame draw:style-name="fr1" draw:name="$filename" text:anchor-type="aschar" svg:width="{$width}cm" svg:height="{$height}cm" draw:z-index="3"><draw:image xlink:href="Pictures/$file" xlink:type="simple" xlink:show="embed" xlink:actuate="onLoad"/></draw:frame>
|
||||||
IMG;
|
IMG;
|
||||||
$this->images[$value] = $file;
|
$this->images[$value] = $file;
|
||||||
$this->setVars($key, $xml, false);
|
$this->setVars($key, $xml, false);
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* Shortcut to retrieve a child
|
* Shortcut to retrieve a child
|
||||||
*
|
*
|
||||||
* @param string $prop Prop
|
* @param string $prop Prop
|
||||||
* @return Segment
|
* @return Segment
|
||||||
* @throws SegmentException
|
* @throws SegmentException
|
||||||
*/
|
*/
|
||||||
public function __get($prop)
|
public function __get($prop)
|
||||||
{
|
{
|
||||||
if (array_key_exists($prop, $this->children)) {
|
if (array_key_exists($prop, $this->children)) {
|
||||||
return $this->children[$prop];
|
return $this->children[$prop];
|
||||||
} else {
|
} else {
|
||||||
throw new SegmentException('child ' . $prop . ' does not exist');
|
throw new SegmentException('child ' . $prop . ' does not exist');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* Proxy for setVars
|
* Proxy for setVars
|
||||||
*
|
*
|
||||||
* @param string $meth Meth
|
* @param string $meth Meth
|
||||||
* @param array $args Args
|
* @param array $args Args
|
||||||
* @return Segment
|
* @return Segment
|
||||||
*/
|
*/
|
||||||
public function __call($meth, $args)
|
public function __call($meth, $args)
|
||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
return $this->setVars($meth, $args[0]);
|
return $this->setVars($meth, $args[0]);
|
||||||
} catch (SegmentException $e) {
|
} catch (SegmentException $e) {
|
||||||
throw new SegmentException("method $meth nor var $meth exist");
|
throw new SegmentException("method $meth nor var $meth exist");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* Returns the parsed XML
|
* Returns the parsed XML
|
||||||
*
|
*
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
public function getXmlParsed()
|
public function getXmlParsed()
|
||||||
{
|
{
|
||||||
return $this->xmlParsed;
|
return $this->xmlParsed;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -122,7 +122,8 @@ class Odf
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Assing a template variable
|
* Assing a template variable into ->vars.
|
||||||
|
* For example, key is {object_date} and value is '2021-01-01'
|
||||||
*
|
*
|
||||||
* @param string $key Name of the variable within the template
|
* @param string $key Name of the variable within the template
|
||||||
* @param string $value Replacement value
|
* @param string $value Replacement value
|
||||||
@ -134,6 +135,7 @@ class Odf
|
|||||||
public function setVars($key, $value, $encode = true, $charset = 'ISO-8859')
|
public function setVars($key, $value, $encode = true, $charset = 'ISO-8859')
|
||||||
{
|
{
|
||||||
$tag = $this->config['DELIMITER_LEFT'] . $key . $this->config['DELIMITER_RIGHT'];
|
$tag = $this->config['DELIMITER_LEFT'] . $key . $this->config['DELIMITER_RIGHT'];
|
||||||
|
|
||||||
// TODO Warning string may be:
|
// TODO Warning string may be:
|
||||||
// <text:span text:style-name="T13">{</text:span><text:span text:style-name="T12">aaa</text:span><text:span text:style-name="T13">}</text:span>
|
// <text:span text:style-name="T13">{</text:span><text:span text:style-name="T12">aaa</text:span><text:span text:style-name="T13">}</text:span>
|
||||||
// instead of {aaa} so we should enhance this function.
|
// instead of {aaa} so we should enhance this function.
|
||||||
|
|||||||
@ -70,14 +70,14 @@ function addDispatchLine(index, type, mode)
|
|||||||
mode = mode || 'qtymissing'
|
mode = mode || 'qtymissing'
|
||||||
|
|
||||||
console.log("fourn/js/lib_dispatch.js.php Split line type="+type+" index="+index+" mode="+mode);
|
console.log("fourn/js/lib_dispatch.js.php Split line type="+type+" index="+index+" mode="+mode);
|
||||||
if(mode == 'qtymissingconsume') {
|
if(mode == 'qtymissingconsume') {
|
||||||
var inputId = 'qtytoconsume';
|
var inputId = 'qtytoconsume';
|
||||||
var warehouseId = 'idwarehouse';
|
var warehouseId = 'idwarehouse';
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
var inputId = 'qtytoproduce';
|
var inputId = 'qtytoproduce';
|
||||||
var warehouseId = 'idwarehousetoproduce';
|
var warehouseId = 'idwarehousetoproduce';
|
||||||
}
|
}
|
||||||
var nbrTrs = $("tr[name^='"+type+"_"+index+"']").length; // position of line for batch
|
var nbrTrs = $("tr[name^='"+type+"_"+index+"']").length; // position of line for batch
|
||||||
var $row = $("tr[name='"+type+'_'+index+"_1']").clone(true); // clone last batch line to jQuery object
|
var $row = $("tr[name='"+type+'_'+index+"_1']").clone(true); // clone last batch line to jQuery object
|
||||||
var qtyOrdered = parseFloat($("#qty_ordered_"+index).val()); // Qty ordered is same for all rows
|
var qtyOrdered = parseFloat($("#qty_ordered_"+index).val()); // Qty ordered is same for all rows
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user