Merge branch 'develop' into PreselectThirpartyOnNewFromList
This commit is contained in:
commit
6f919f1dd0
47
ChangeLog
47
ChangeLog
@ -2,6 +2,7 @@
|
||||
English Dolibarr ChangeLog
|
||||
--------------------------------------------------------------
|
||||
|
||||
|
||||
***** ChangeLog for 13.0.0 compared to 12.0.0 *****
|
||||
For users:
|
||||
NEW: Add module Credit transfer SEPA to manage payment of supplier using bank credit transfer SEPA files
|
||||
@ -22,6 +23,52 @@ Following changes may create regressions for some external modules, but were nec
|
||||
you must now also include declaration of the Trait CommonIncoterm in your class. All incoterm functions were moved into this Trait.
|
||||
* The GETPOST(..., 'alpha') has now the same behaviour than GETPOST(..., 'alpahnohtml');
|
||||
|
||||
|
||||
***** ChangeLog for 12.0.3 compared to 12.0.2 *****
|
||||
FIX: 10.0 - when the mime file name is different from the filesystem name, the attachment name should be the mime filename
|
||||
FIX: 11.0 - expenses lines overlapping the total amounts frame
|
||||
FIX: 12.0 - round value of virtual stock on product stock reassort list
|
||||
FIX: #14469
|
||||
FIX: #14474 Error when deleting
|
||||
FIX: #14530
|
||||
FIX: #14703
|
||||
FIX: - Accountancy balance Error SQL on entity
|
||||
FIX: Bad number of subscription (forgotten when member was resiliated)
|
||||
FIX: bad route url to delete subproduct with API
|
||||
FIX: Category for suplements not saved
|
||||
FIX: Compatibility with modules without document generation
|
||||
FIX: Cron load lang
|
||||
FIX: CSS
|
||||
FIX: Error management. Do no try to approve PO if validation fails.
|
||||
FIX: expenses lines overlapping the frame for total amounts.
|
||||
FIX: Filter in "billed" of orders was not saved
|
||||
FIX: infinite fetch object linked loop
|
||||
FIX: Intervention lose html tags when updating
|
||||
FIX: JS CRASH - bad usage of moreparam
|
||||
FIX: lang fr retained warranty
|
||||
FIX: Look and feel v12: First tab must be name of object
|
||||
FIX: missing entity check
|
||||
FIX: missing param for hook
|
||||
FIX: Missing transaction on PO actions
|
||||
FIX: MySql Strict mode
|
||||
FIX: param entity in html form file
|
||||
FIX: Problems on FEC format
|
||||
FIX: round stock value on product list
|
||||
FIX: - Send mail from contact : select mail model
|
||||
FIX: set sales representatives on create company card
|
||||
FIX: Setup of stock increase/decrease
|
||||
FIX: sign of amount with credit note and multicurrencies
|
||||
FIX: Static property called as non static
|
||||
FIX: task leftmenu
|
||||
FIX: title button attribute id empty
|
||||
FIX: unit price divided by quantity when accepting supplier price proposal
|
||||
FIX: Update extrafields on line only if it is supported
|
||||
FIX: Update line of BOM
|
||||
FIX: using decimal on stock correction
|
||||
FIX: Visualization rights correction on last modified contacts box
|
||||
FIX: Wrong redirection
|
||||
FIX: Yogosha report 4425 (backport)
|
||||
|
||||
***** ChangeLog for 12.0.2 compared to 12.0.1 *****
|
||||
FIX: computation of the bottom margin of <body> returns NaN because body is not loaded yet
|
||||
FIX: DebugBar hides content at page bottom
|
||||
|
||||
@ -411,7 +411,7 @@ print "<br>\n";
|
||||
// Confirmation de la suppression de la ligne
|
||||
if ($action == 'delete')
|
||||
{
|
||||
print $form->formconfirm($_SERVER["PHP_SELF"].'?'.($page ? 'page='.$page.'&' : '').'sortfield='.$sortfield.'&sortorder='.$sortorder.'&rowid='.$rowid, $langs->trans('DeleteWebsite'), $langs->trans('ConfirmDeleteWebsite'), 'confirm_delete', '', 0, 1);
|
||||
print $form->formconfirm($_SERVER["PHP_SELF"].'?'.($page ? 'page='.$page.'&' : '').'sortfield='.$sortfield.'&sortorder='.$sortorder.'&rowid='.$rowid, $langs->trans('DeleteWebsite'), $langs->trans('ConfirmDeleteWebsite'), 'confirm_delete', '', 0, 1, 220);
|
||||
}
|
||||
//var_dump($elementList);
|
||||
|
||||
|
||||
@ -88,6 +88,10 @@ if ($action == 'add' && $user->rights->categorie->creer)
|
||||
{
|
||||
header("Location: ".$urlfrom);
|
||||
exit;
|
||||
} elseif ($backtopage)
|
||||
{
|
||||
header("Location: ".$backtopage);
|
||||
exit;
|
||||
} elseif ($idProdOrigin)
|
||||
{
|
||||
header("Location: ".DOL_URL_ROOT.'/categories/viewcat.php?id='.$idProdOrigin.'&type='.$type);
|
||||
@ -235,13 +239,13 @@ if ($user->rights->categorie->creer)
|
||||
|
||||
// Ref
|
||||
print '<tr>';
|
||||
print '<td class="titlefieldcreate fieldrequired">'.$langs->trans("Ref").'</td><td><input id="label" class="minwidth100" name="label" value="'.$label.'">';
|
||||
print '<td class="titlefieldcreate fieldrequired">'.$langs->trans("Ref").'</td><td><input id="label" class="minwidth100" name="label" value="'.dol_escape_htmltag($label).'">';
|
||||
print'</td></tr>';
|
||||
|
||||
// Description
|
||||
print '<tr><td class="tdtop">'.$langs->trans("Description").'</td><td>';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
|
||||
$doleditor = new DolEditor('description', $description, '', 200, 'dolibarr_notes', '', false, true, $conf->global->FCKEDITOR_ENABLE_PRODUCTDESC, ROWS_6, '90%');
|
||||
$doleditor = new DolEditor('description', $description, '', 160, 'dolibarr_notes', '', false, true, $conf->global->FCKEDITOR_ENABLE_PRODUCTDESC, ROWS_5, '90%');
|
||||
$doleditor->Create();
|
||||
print '</td></tr>';
|
||||
|
||||
|
||||
@ -1616,9 +1616,10 @@ class Categorie extends CommonObject
|
||||
* @param int $withpicto 0=No picto, 1=Include picto into link, 2=Only picto
|
||||
* @param string $option Sur quoi pointe le lien ('', 'xyz')
|
||||
* @param int $maxlength Max length of text
|
||||
* @param string $moreparam More param on URL link
|
||||
* @return string Chaine avec URL
|
||||
*/
|
||||
public function getNomUrl($withpicto = 0, $option = '', $maxlength = 0)
|
||||
public function getNomUrl($withpicto = 0, $option = '', $maxlength = 0, $moreparam = '')
|
||||
{
|
||||
global $langs;
|
||||
|
||||
@ -1632,7 +1633,7 @@ class Categorie extends CommonObject
|
||||
if (colorIsLight($this->color)) $forced_color = 'categtextblack';
|
||||
}
|
||||
|
||||
$link = '<a href="'.DOL_URL_ROOT.'/categories/viewcat.php?id='.$this->id.'&type='.$this->type.'&backtopage='.urlencode($_SERVER['PHP_SELF']).'" title="'.dol_escape_htmltag($label, 1).'" class="classfortooltip '.$forced_color.'">';
|
||||
$link = '<a href="'.DOL_URL_ROOT.'/categories/viewcat.php?id='.$this->id.'&type='.$this->type.$moreparam.'&backtopage='.urlencode($_SERVER['PHP_SELF'].($moreparam?'?'.$moreparam:'')).'" title="'.dol_escape_htmltag($label, 1).'" class="classfortooltip '.$forced_color.'">';
|
||||
$linkend = '</a>';
|
||||
|
||||
$picto = 'category';
|
||||
|
||||
@ -39,6 +39,7 @@ if (!$user->rights->categorie->lire) accessforbidden();
|
||||
$id = GETPOST('id', 'int');
|
||||
$type = (GETPOST('type', 'aZ09') ? GETPOST('type', 'aZ09') : Categorie::TYPE_PRODUCT);
|
||||
$catname = GETPOST('catname', 'alpha');
|
||||
$nosearch = GETPOST('nosearch', 'int');
|
||||
|
||||
$categstatic = new Categorie($db);
|
||||
if (is_numeric($type)) $type = Categorie::$MAP_ID_TO_CODE[$type]; // For backward compatibility
|
||||
@ -50,6 +51,8 @@ if (is_numeric($type)) $type = Categorie::$MAP_ID_TO_CODE[$type]; // For backwar
|
||||
|
||||
$form = new Form($db);
|
||||
|
||||
$moreparam = ($nosearch ? '&nosearch=1' : '');
|
||||
|
||||
$typetext = $type;
|
||||
if ($type == Categorie::TYPE_ACCOUNT) $title = $langs->trans('AccountsCategoriesArea');
|
||||
elseif ($type == Categorie::TYPE_WAREHOUSE) $title = $langs->trans('StocksCategoriesArea');
|
||||
@ -64,66 +67,69 @@ $arrayofcss = array('/includes/jquery/plugins/jquerytreeview/jquery.treeview.css
|
||||
|
||||
llxHeader('', $title, '', '', 0, 0, $arrayofjs, $arrayofcss);
|
||||
|
||||
$newcardbutton = dolGetButtonTitle($langs->trans('NewCategory'), '', 'fa fa-plus-circle', $url, '', $user->rights->categorie->creer);
|
||||
$newcardbutton = '';
|
||||
if (!empty($user->rights->categorie->creer)) {
|
||||
$newcardbutton .= dolGetButtonTitle($langs->trans('NewCategory'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/categories/card.php?action=create&type='.$type.'&backtopage='.urlencode($_SERVER["PHP_SELF"].'?type='.$type.$moreparam).$moreparam);
|
||||
}
|
||||
|
||||
print load_fiche_titre($title, $newcardbutton, 'object_category');
|
||||
|
||||
print '<div class="fichecenter"><div class="fichethirdleft">';
|
||||
// Search categories
|
||||
if (empty($nosearch)) {
|
||||
print '<div class="fichecenter"><div class="fichehalfleft">';
|
||||
|
||||
|
||||
/*
|
||||
* Zone recherche produit/service
|
||||
*/
|
||||
print '<form method="post" action="index.php?type='.$type.'">';
|
||||
print '<input type="hidden" name="token" value="'.newToken().'">';
|
||||
print '<input type="hidden" name="type" value="'.$type.'">';
|
||||
print '<form method="post" action="index.php?type='.$type.'">';
|
||||
print '<input type="hidden" name="token" value="'.newToken().'">';
|
||||
print '<input type="hidden" name="type" value="'.$type.'">';
|
||||
print '<input type="hidden" name="nosearch" value="'.$nosearch.'">';
|
||||
|
||||
|
||||
print '<table class="noborder nohover centpercent">';
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td colspan="3">'.$langs->trans("Search").'</td>';
|
||||
print '</tr>';
|
||||
print '<tr class="oddeven nohover"><td>';
|
||||
print $langs->trans("Name").':</td><td><input class="flat inputsearch" type="text" name="catname" value="'.$catname.'"/></td><td><input type="submit" class="button" value="'.$langs->trans("Search").'"></td></tr>';
|
||||
print '</table></form>';
|
||||
print '<table class="noborder nohover centpercent">';
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td colspan="3">'.$langs->trans("Search").'</td>';
|
||||
print '</tr>';
|
||||
print '<tr class="oddeven nohover"><td>';
|
||||
print $langs->trans("Name").':</td><td><input class="flat inputsearch" type="text" name="catname" value="'.$catname.'"/></td><td><input type="submit" class="button" value="'.$langs->trans("Search").'"></td></tr>';
|
||||
print '</table></form>';
|
||||
|
||||
|
||||
print '</div><div class="fichetwothirdright"><div class="ficheaddleft">';
|
||||
print '</div><div class="fichehalfright">';
|
||||
|
||||
|
||||
/*
|
||||
* Categories found
|
||||
*/
|
||||
if ($catname || $id > 0)
|
||||
{
|
||||
$cats = $categstatic->rechercher($id, $catname, $typetext);
|
||||
|
||||
print '<table class="noborder centpercent">';
|
||||
print '<tr class="liste_titre"><td colspan="2">'.$langs->trans("FoundCats").'</td></tr>';
|
||||
|
||||
foreach ($cats as $cat)
|
||||
/*
|
||||
* Categories found
|
||||
*/
|
||||
if ($catname || $id > 0)
|
||||
{
|
||||
print "\t".'<tr class="oddeven">'."\n";
|
||||
print "\t\t<td>";
|
||||
$categstatic->id = $cat->id;
|
||||
$categstatic->ref = $cat->label;
|
||||
$categstatic->label = $cat->label;
|
||||
$categstatic->type = $cat->type;
|
||||
$categstatic->color = $cat->color;
|
||||
print '<span class="noborderoncategories" '.($categstatic->color ? ' style="background: #'.$categstatic->color.';"' : ' style="background: #aaa"').'>';
|
||||
print $categstatic->getNomUrl(1, '');
|
||||
print '</span>';
|
||||
print "</td>\n";
|
||||
print "\t\t<td>";
|
||||
print dolGetFirstLineOfText($cat->description);
|
||||
print "</td>\n";
|
||||
print "\t</tr>\n";
|
||||
}
|
||||
print "</table>";
|
||||
} else print ' ';
|
||||
$cats = $categstatic->rechercher($id, $catname, $typetext);
|
||||
|
||||
print '<table class="noborder centpercent">';
|
||||
print '<tr class="liste_titre"><td colspan="2">'.$langs->trans("FoundCats").'</td></tr>';
|
||||
|
||||
print '</div></div></div>';
|
||||
foreach ($cats as $cat)
|
||||
{
|
||||
print "\t".'<tr class="oddeven">'."\n";
|
||||
print "\t\t<td>";
|
||||
$categstatic->id = $cat->id;
|
||||
$categstatic->ref = $cat->label;
|
||||
$categstatic->label = $cat->label;
|
||||
$categstatic->type = $cat->type;
|
||||
$categstatic->color = $cat->color;
|
||||
print '<span class="noborderoncategories" '.($categstatic->color ? ' style="background: #'.$categstatic->color.';"' : ' style="background: #aaa"').'>';
|
||||
print $categstatic->getNomUrl(1, '');
|
||||
print '</span>';
|
||||
print "</td>\n";
|
||||
print "\t\t<td>";
|
||||
print dolGetFirstLineOfText($cat->description);
|
||||
print "</td>\n";
|
||||
print "\t</tr>\n";
|
||||
}
|
||||
print "</table>";
|
||||
} else print ' ';
|
||||
|
||||
print '</div></div>';
|
||||
}
|
||||
|
||||
print '<div class="fichecenter"><br>';
|
||||
|
||||
@ -152,7 +158,7 @@ foreach ($fulltree as $key => $val)
|
||||
$categstatic->ref = $val['label'];
|
||||
$categstatic->color = $val['color'];
|
||||
$categstatic->type = $type;
|
||||
$li = $categstatic->getNomUrl(1, '', 60);
|
||||
$li = $categstatic->getNomUrl(1, '', 60, $moreparam.'&backtolist='.urlencode($_SERVER["PHP_SELF"].'?type='.$type.$moreparam));
|
||||
$desc = dol_htmlcleanlastbr($val['description']);
|
||||
|
||||
$counter = '';
|
||||
@ -168,7 +174,7 @@ foreach ($fulltree as $key => $val)
|
||||
'rowid'=>$val['rowid'],
|
||||
'fk_menu'=>$val['fk_parent'],
|
||||
'entry'=>'<table class="nobordernopadding centpercent"><tr><td><span class="noborderoncategories" '.($categstatic->color ? ' style="background: #'.$categstatic->color.';"' : ' style="background: #aaa"').'>'.$li.'</span></td>'.$counter.
|
||||
'<td class="right" width="20px;"><a href="'.DOL_URL_ROOT.'/categories/viewcat.php?id='.$val['id'].'&type='.$type.'">'.img_view().'</a></td></tr></table>'
|
||||
'<td class="right" width="20px;"><a href="'.DOL_URL_ROOT.'/categories/viewcat.php?id='.$val['id'].'&type='.$type.$moreparam.'&backtolist='.urlencode($_SERVER["PHP_SELF"].'?type='.$type.$moreparam).'">'.img_view().'</a></td></tr></table>'
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@ -51,6 +51,7 @@ $contextpage = GETPOST('contextpage', 'aZ') ?GETPOST('contextpage', 'aZ') : 'myo
|
||||
$backtopage = GETPOST('backtopage', 'alpha'); // Go back to a dedicated page
|
||||
$optioncss = GETPOST('optioncss', 'aZ'); // Option for the css output (always '' except when 'print')
|
||||
|
||||
|
||||
// Load variable for pagination
|
||||
$limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : $conf->liste_limit;
|
||||
$sortfield = GETPOST('sortfield', 'aZ09comma');
|
||||
|
||||
@ -1617,13 +1617,12 @@ if ($action == 'create')
|
||||
// Show object lines
|
||||
if (!empty($object->lines))
|
||||
{
|
||||
//$disableedit=1;
|
||||
//$disablemove=1;
|
||||
$canchangeproduct = 1;
|
||||
$ret = $object->printObjectLines($action, $mysoc, $object->thirdparty, $lineid, 0); // No date selector for template invoice
|
||||
}
|
||||
|
||||
// Form to add new line
|
||||
if ($object->statut == 0 && $user->rights->facture->creer && $action != 'valid' && $action != 'editline')
|
||||
if ($object->statut == $object::STATUS_DRAFT && $user->rights->facture->creer && $action != 'valid' && $action != 'editline')
|
||||
{
|
||||
if ($action != 'editline')
|
||||
{
|
||||
|
||||
@ -665,6 +665,7 @@ if (empty($reshook))
|
||||
|
||||
$fk_unit = GETPOST('unit', 'alpha');
|
||||
|
||||
$objectline->fk_product = GETPOST('idprod', 'int');
|
||||
$objectline->description = GETPOST('product_desc', 'restricthtml');
|
||||
$objectline->price_ht = GETPOST('elprice');
|
||||
$objectline->subprice = GETPOST('elprice');
|
||||
@ -1436,8 +1437,6 @@ if ($action == 'create')
|
||||
$usemargins = 0;
|
||||
if (!empty($conf->margin->enabled) && !empty($object->element) && in_array($object->element, array('facture', 'propal', 'commande'))) $usemargins = 1;
|
||||
|
||||
$var = false;
|
||||
|
||||
// Title line for service
|
||||
$cursorline = 1;
|
||||
print '<div id="contrat-lines-container" data-contractid="'.$object->id.'" data-element="'.$object->element.'" >';
|
||||
@ -1448,7 +1447,6 @@ if ($action == 'create')
|
||||
print '<input type="hidden" name="token" value="'.newToken().'">';
|
||||
print '<input type="hidden" name="action" value="updateline">';
|
||||
print '<input type="hidden" name="elrowid" value="'.$object->lines[$cursorline - 1]->id.'">';
|
||||
print '<input type="hidden" name="idprod" value="'.(!empty($object->lines[$cursorline - 1]->fk_product) ? $object->lines[$cursorline - 1]->fk_product : 0).'">';
|
||||
print '<input type="hidden" name="fournprice" value="'.(!empty($object->lines[$cursorline - 1]->fk_fournprice) ? $object->lines[$cursorline - 1]->fk_fournprice : 0).'">';
|
||||
|
||||
// Area with common detail of line
|
||||
@ -1632,17 +1630,29 @@ if ($action == 'create')
|
||||
// Ligne carac
|
||||
print '<tr class="oddeven">';
|
||||
print '<td>';
|
||||
if ($objp->fk_product)
|
||||
if ($objp->fk_product > 0)
|
||||
{
|
||||
$productstatic->id = $objp->fk_product;
|
||||
$productstatic->type = $objp->ptype;
|
||||
$productstatic->ref = $objp->pref;
|
||||
$productstatic->entity = $objp->pentity;
|
||||
print $productstatic->getNomUrl(1, '', 32);
|
||||
print $objp->label ? ' - '.dol_trunc($objp->label, 32) : '';
|
||||
$canchangeproduct = 1;
|
||||
if (empty($canchangeproduct)) {
|
||||
$productstatic->id = $objp->fk_product;
|
||||
$productstatic->type = $objp->ptype;
|
||||
$productstatic->ref = $objp->pref;
|
||||
$productstatic->entity = $objp->pentity;
|
||||
print $productstatic->getNomUrl(1, '', 32);
|
||||
print $objp->label ? ' - '.dol_trunc($objp->label, 32) : '';
|
||||
print '<input type="hidden" name="idprod" value="'.(!empty($object->lines[$cursorline - 1]->fk_product) ? $object->lines[$cursorline - 1]->fk_product : 0).'">';
|
||||
} else {
|
||||
$senderissupplier = 0;
|
||||
if (empty($senderissupplier)) {
|
||||
print $form->select_produits((!empty($object->lines[$cursorline - 1]->fk_product) ? $object->lines[$cursorline - 1]->fk_product : 0), 'idprod');
|
||||
} else {
|
||||
print $form->select_produits_fournisseurs((!empty($object->lines[$cursorline - 1]->fk_product) ? $object->lines[$cursorline - 1]->fk_product : 0), 'idprod');
|
||||
}
|
||||
}
|
||||
print '<br>';
|
||||
} else {
|
||||
print $objp->label ? $objp->label.'<br>' : '';
|
||||
print '<input type="hidden" name="idprod" value="'.(!empty($object->lines[$cursorline - 1]->fk_product) ? $object->lines[$cursorline - 1]->fk_product : 0).'">';
|
||||
}
|
||||
|
||||
// editeur wysiwyg
|
||||
|
||||
@ -4038,7 +4038,7 @@ class Form
|
||||
* type can be 'hidden', 'text', 'password', 'checkbox', 'radio', 'date', 'morecss', ...
|
||||
* @param string $selectedchoice '' or 'no', or 'yes' or '1' or '0'
|
||||
* @param int|string $useajax 0=No, 1=Yes, 2=Yes but submit page with &confirm=no if choice is No, 'xxx'=Yes and preoutput confirm box with div id=dialog-confirm-xxx
|
||||
* @param int $height Force height of box (0 = auto)
|
||||
* @param int|string $height Force height of box (0 = auto)
|
||||
* @param int $width Force width of box ('999' or '90%'). Ignored and forced to 90% on smartphones.
|
||||
* @param int $disableformtag 1=Disable form tag. Can be used if we are already inside a <form> section.
|
||||
* @return string HTML ajax code if a confirm ajax popup is required, Pure HTML code if it's an html form
|
||||
|
||||
@ -1130,4 +1130,15 @@ $(document).ready(function() {
|
||||
});
|
||||
<?php } ?>
|
||||
|
||||
// Force to hide menus when page is inside an iFrame
|
||||
$(document).ready(function() {
|
||||
if (window.location !== window.parent.location ) {
|
||||
console.log("Page is detected to be into an iframe, we hide by CSS the menus");
|
||||
// The page is in an iframe
|
||||
jQuery(".side-nav-vert, .side-nav").hide();
|
||||
jQuery(".id-container").css('width', '100%');
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
// End of lib_head.js.php
|
||||
|
||||
@ -103,15 +103,16 @@ function tree_showpad(&$fulltree, $key, $silent = 0)
|
||||
* $arrayofcss=array('/includes/jquery/plugins/jquerytreeview/jquery.treeview.css');
|
||||
* TODO Replace with jstree plugin instead of treeview plugin.
|
||||
*
|
||||
* @param array $tab Array of all elements
|
||||
* @param array $pere Array with parent ids ('rowid'=>,'mainmenu'=>,'leftmenu'=>,'fk_mainmenu=>,'fk_leftmenu=>)
|
||||
* @param int $rang Level of element
|
||||
* @param string $iddivjstree Id to use for parent ul element
|
||||
* @param array $tab Array of all elements
|
||||
* @param array $pere Array with parent ids ('rowid'=>,'mainmenu'=>,'leftmenu'=>,'fk_mainmenu=>,'fk_leftmenu=>)
|
||||
* @param int $rang Level of element
|
||||
* @param string $iddivjstree Id to use for parent ul element
|
||||
* @param int $donoresetalreadyloaded Do not reset global array $donoresetalreadyloaded used to avoid to go down on an aleady processed record
|
||||
* @param int $showfk 1=show fk_links to parent into label (used by menu editor only)
|
||||
* @param int $showfk 1=show fk_links to parent into label (used by menu editor only)
|
||||
* @param string $moreparam Add more param on url of elements
|
||||
* @return void
|
||||
*/
|
||||
function tree_recur($tab, $pere, $rang, $iddivjstree = 'iddivjstree', $donoresetalreadyloaded = 0, $showfk = 0)
|
||||
function tree_recur($tab, $pere, $rang, $iddivjstree = 'iddivjstree', $donoresetalreadyloaded = 0, $showfk = 0, $moreparam = '')
|
||||
{
|
||||
global $tree_recur_alreadyadded, $menu_handler_to_search;
|
||||
|
||||
@ -197,7 +198,7 @@ function tree_recur($tab, $pere, $rang, $iddivjstree = 'iddivjstree', $donoreset
|
||||
if ($showfk)
|
||||
{
|
||||
print '<table class="nobordernopadding centpercent"><tr><td>';
|
||||
print '<strong> <a href="edit.php?menu_handler='.$menu_handler_to_search.'&action=edit&menuId='.$tab[$x]['rowid'].'">';
|
||||
print '<strong> <a href="edit.php?menu_handler='.$menu_handler_to_search.'&action=edit&menuId='.$tab[$x]['rowid'].$moreparam.'">';
|
||||
print $tab[$x]['title'];
|
||||
print '</a></strong>';
|
||||
print ' (mainmenu='.$tab[$x]['mainmenu'].' leftmenu='.$tab[$x]['leftmenu'].' - fk_mainmenu='.$tab[$x]['fk_mainmenu'].' fk_leftmenu='.$tab[$x]['fk_leftmenu'].')';
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/* Copyright (C) 2010-2012 Regis Houssin <regis.houssin@inodbox.com>
|
||||
* Copyright (C) 2010-2012 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2010-2020 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2012 Christophe Battarel <christophe.battarel@altairis.fr>
|
||||
* Copyright (C) 2012 Cédric Salvador <csalvador@gpcsolutions.fr>
|
||||
* Copyright (C) 2012-2014 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
|
||||
@ -29,6 +29,7 @@
|
||||
* $forceall (0 by default, 1 for supplier invoices/orders)
|
||||
* $senderissupplier (0 by default, 1 for supplier invoices/orders)
|
||||
* $inputalsopricewithtax (0 by default, 1 to also show column with unit price including tax)
|
||||
* $canchangeproduct (0 by default, 1 to allow to change the product if it is a predefined product)
|
||||
*/
|
||||
|
||||
// Protection to avoid direct call of template
|
||||
@ -42,12 +43,12 @@ if (empty($object) || !is_object($object))
|
||||
$usemargins = 0;
|
||||
if (!empty($conf->margin->enabled) && !empty($object->element) && in_array($object->element, array('facture', 'facturerec', 'propal', 'commande'))) $usemargins = 1;
|
||||
|
||||
global $forceall, $senderissupplier, $inputalsopricewithtax;
|
||||
global $forceall, $senderissupplier, $inputalsopricewithtax, $canchangeproduct;
|
||||
if (empty($dateSelector)) $dateSelector = 0;
|
||||
if (empty($forceall)) $forceall = 0;
|
||||
if (empty($senderissupplier)) $senderissupplier = 0;
|
||||
if (empty($inputalsopricewithtax)) $inputalsopricewithtax = 0;
|
||||
|
||||
if (empty($canchangeproduct)) $canchangeproduct = 0;
|
||||
|
||||
// Define colspan for the button 'Add'
|
||||
$colspan = 3; // Col total ht + col edit + col delete
|
||||
@ -71,27 +72,33 @@ $coldisplay++;
|
||||
|
||||
<input type="hidden" name="lineid" value="<?php echo $line->id; ?>">
|
||||
<input type="hidden" id="product_type" name="type" value="<?php echo $line->product_type; ?>">
|
||||
<input type="hidden" id="product_id" name="productid" value="<?php echo (!empty($line->fk_product) ? $line->fk_product : 0); ?>" />
|
||||
<input type="hidden" id="special_code" name="special_code" value="<?php echo $line->special_code; ?>">
|
||||
<input type="hidden" id="fk_parent_line" name="fk_parent_line" value="<?php echo $line->fk_parent_line; ?>">
|
||||
|
||||
<?php if ($line->fk_product > 0) { ?>
|
||||
<?php
|
||||
if ($line->fk_parent_line > 0) echo img_picto('', 'rightarrow');
|
||||
if (empty($canchangeproduct)) {
|
||||
if ($line->fk_parent_line > 0) echo img_picto('', 'rightarrow');
|
||||
?>
|
||||
<a href="<?php echo DOL_URL_ROOT.'/product/card.php?id='.$line->fk_product; ?>">
|
||||
<?php
|
||||
if ($line->product_type == 1) echo img_object($langs->trans('ShowService'), 'service');
|
||||
else print img_object($langs->trans('ShowProduct'), 'product');
|
||||
echo ' '.$line->ref;
|
||||
?>
|
||||
</a>
|
||||
<?php
|
||||
echo ' - '.nl2br($line->product_label);
|
||||
print '<input type="hidden" id="product_id" name="productid" value="'.(!empty($line->fk_product) ? $line->fk_product : 0).'">';
|
||||
} else {
|
||||
if ($senderissupplier) {
|
||||
print $form->select_produits_fournisseurs(!empty($line->fk_product) ? $line->fk_product : 0, 'productid');
|
||||
} else {
|
||||
print $form->select_produits(!empty($line->fk_product) ? $line->fk_product : 0, 'productid');
|
||||
}
|
||||
}
|
||||
?>
|
||||
<a href="<?php echo DOL_URL_ROOT.'/product/card.php?id='.$line->fk_product; ?>">
|
||||
<?php
|
||||
if ($line->product_type == 1) echo img_object($langs->trans('ShowService'), 'service');
|
||||
else print img_object($langs->trans('ShowProduct'), 'product');
|
||||
echo ' '.$line->ref;
|
||||
?>
|
||||
</a>
|
||||
<?php
|
||||
echo ' - '.nl2br($line->product_label);
|
||||
?>
|
||||
|
||||
<br><br>
|
||||
|
||||
<?php } ?>
|
||||
|
||||
<?php
|
||||
|
||||
@ -61,7 +61,8 @@ if (!empty($actionsave))
|
||||
* View
|
||||
*/
|
||||
|
||||
llxHeader();
|
||||
$help_url = '';
|
||||
llxHeader('', '', $help_url);
|
||||
|
||||
$linkback = '<a href="'.DOL_URL_ROOT.'/admin/modules.php?restore_lastsearch_values=1">'.$langs->trans("BackToModuleList").'</a>';
|
||||
print load_fiche_titre($langs->trans("CronSetup"), $linkback, 'title_setup');
|
||||
@ -81,17 +82,17 @@ print '<table class="noborder centpercent">';
|
||||
print '<tr class="liste_titre">';
|
||||
print "<td>".$langs->trans("Parameter")."</td>";
|
||||
print "<td>".$langs->trans("Value")."</td>";
|
||||
print "<td> </td>";
|
||||
print "<td></td>";
|
||||
print "</tr>";
|
||||
|
||||
print '<tr class="impair">';
|
||||
print '<tr class="oddeven">';
|
||||
print '<td class="fieldrequired">'.$langs->trans("KeyForCronAccess").'</td>';
|
||||
$disabled = '';
|
||||
if (!empty($conf->global->CRON_DISABLE_KEY_CHANGE)) $disabled = ' disabled="disabled"';
|
||||
print '<td>';
|
||||
if (empty($conf->global->CRON_DISABLE_KEY_CHANGE))
|
||||
{
|
||||
print '<input type="text" class="flat minwidth200"'.$disabled.' id="CRON_KEY" name="CRON_KEY" value="'.(GETPOST('CRON_KEY') ?GETPOST('CRON_KEY') : (!empty($conf->global->CRON_KEY) ? $conf->global->CRON_KEY : '')).'">';
|
||||
print '<input type="text" class="flat minwidth300"'.$disabled.' id="CRON_KEY" name="CRON_KEY" value="'.(GETPOST('CRON_KEY') ?GETPOST('CRON_KEY') : (!empty($conf->global->CRON_KEY) ? $conf->global->CRON_KEY : '')).'">';
|
||||
if (!empty($conf->use_javascript_ajax))
|
||||
print ' '.img_picto($langs->trans('Generate'), 'refresh', 'id="generate_token" class="linkobject"');
|
||||
} else {
|
||||
|
||||
@ -95,9 +95,10 @@ $fieldstosearchall = array(
|
||||
's.nom'=>"ThirdParty",
|
||||
'f.description'=>'Description',
|
||||
'f.note_public'=>'NotePublic',
|
||||
'fd.description'=>'DescriptionOfLine',
|
||||
);
|
||||
if (empty($user->socid)) $fieldstosearchall["f.note_private"] = "NotePrivate";
|
||||
if (!empty($conf->global->FICHINTER_DISABLE_DETAILS)) unset($fieldstosearchall['f.description']);
|
||||
if (!empty($conf->global->FICHINTER_DISABLE_DETAILS)) unset($fieldstosearchall['fd.description']);
|
||||
|
||||
// Definition of fields for list
|
||||
$arrayfields = array(
|
||||
|
||||
@ -32,13 +32,13 @@ create table llx_bank
|
||||
fk_type varchar(6), -- TIP,VIR,PRE,CB,CHQ,... (Code in llx_c_paiement)
|
||||
num_releve varchar(50),
|
||||
num_chq varchar(50),
|
||||
numero_compte varchar(32) NULL, -- FEC:CompteNum | account number
|
||||
numero_compte varchar(32) NULL, -- FEC:CompteNum | account number
|
||||
rappro tinyint default 0,
|
||||
note text,
|
||||
fk_bordereau integer DEFAULT 0,
|
||||
banque varchar(255), -- banque pour les cheques
|
||||
emetteur varchar(255), -- emetteur du cheque
|
||||
author varchar(40) -- a supprimer apres migration
|
||||
banque varchar(255), -- banque pour les cheques
|
||||
emetteur varchar(255), -- emetteur du cheque
|
||||
author varchar(40), -- a supprimer apres migration
|
||||
origin_id integer,
|
||||
origin_type varchar(64) NULL,
|
||||
import_key varchar(14)
|
||||
|
||||
@ -84,7 +84,7 @@ AddProductServiceIntoCategory=Add the following product/service
|
||||
ShowCategory=Show tag/category
|
||||
ByDefaultInList=By default in list
|
||||
ChooseCategory=Choose category
|
||||
StocksCategoriesArea=Warehouses Categories Area
|
||||
ActionCommCategoriesArea=Events Categories Area
|
||||
WebsitePagesCategoriesArea=Page-Container Categories Area
|
||||
StocksCategoriesArea=Warehouses Categories
|
||||
ActionCommCategoriesArea=Events Categories
|
||||
WebsitePagesCategoriesArea=Page-Container Categories
|
||||
UseOrOperatorForCategories=Use or operator for categories
|
||||
|
||||
@ -31,7 +31,7 @@ AddWebsite=Add website
|
||||
Webpage=Web page/container
|
||||
AddPage=Add page/container
|
||||
HomePage=Home Page
|
||||
PageContainer=Page/container
|
||||
PageContainer=Page
|
||||
PreviewOfSiteNotYetAvailable=Preview of your website <strong>%s</strong> not yet available. You must first '<strong>Import a full website template</strong>' or just '<strong>Add a page/container</strong>'.
|
||||
RequestedPageHasNoContentYet=Requested page with id %s has no content yet, or cache file .tpl.php was removed. Edit content of the page to solve this.
|
||||
SiteDeleted=Web site '%s' deleted
|
||||
@ -134,4 +134,5 @@ AvailableLanguagesAreDefinedIntoWebsiteProperties=Available languages are define
|
||||
ReplacementDoneInXPages=Replacement done in %s pages or containers
|
||||
RSSFeed=RSS Feed
|
||||
RSSFeedDesc=You can get a RSS feed of latest articles with type 'blogpost' using this URL
|
||||
PagesRegenerated=%s page(s)/container(s) regenerated
|
||||
PagesRegenerated=%s page(s)/container(s) regenerated
|
||||
RegenerateWebsiteContent=Regenerate web site cache files
|
||||
@ -385,11 +385,10 @@ if ((!defined('NOCSRFCHECK') && empty($dolibarr_nocsrfcheck) && !empty($conf->gl
|
||||
$savid = ((int) $_POST['id']);
|
||||
unset($_POST);
|
||||
//unset($_POST['action']);
|
||||
unset($_POST['confirm']);
|
||||
//unset($_POST['confirm']);
|
||||
unset($_GET['confirm']);
|
||||
unset($_GET['action']);
|
||||
$_POST['id'] = ((int) $savid);
|
||||
$_POST['action'] = '';
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -313,8 +313,6 @@ if (empty($reshook))
|
||||
* View
|
||||
*/
|
||||
|
||||
$htmlother = new FormOther($db);
|
||||
|
||||
$title = $langs->trans("ProductsAndServices");
|
||||
|
||||
if ($search_type != '' && $search_type != '-1')
|
||||
|
||||
@ -1065,7 +1065,30 @@ if ($placeid > 0)
|
||||
|
||||
$htmlforlines .= '</td>';
|
||||
$htmlforlines .= '<td class="right">'.vatrate($line->remise_percent, true).'</td>';
|
||||
$htmlforlines .= '<td class="right">'.$line->qty.'</td>';
|
||||
$htmlforlines .= '<td class="right">';
|
||||
if (!empty($conf->stock->enabled))
|
||||
{
|
||||
$constantforkey = 'CASHDESK_ID_WAREHOUSE'.$_SESSION["takeposterminal"];
|
||||
$sql = "SELECT e.rowid, e.ref, e.lieu, e.fk_parent, e.statut, ps.reel, ps.rowid as product_stock_id, p.pmp";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."entrepot as e,";
|
||||
$sql .= " ".MAIN_DB_PREFIX."product_stock as ps";
|
||||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."product as p ON p.rowid = ps.fk_product";
|
||||
$sql .= " WHERE ps.reel != 0";
|
||||
$sql .= " AND ps.fk_entrepot = ".$conf->global->$constantforkey;
|
||||
$sql .= " AND e.entity IN (".getEntity('stock').")";
|
||||
$sql .= " AND ps.fk_product = ".$line->fk_product;
|
||||
$resql = $db->query($sql);
|
||||
if ($resql) {
|
||||
$obj = $db->fetch_object($resql);
|
||||
$stock_real = price2num($obj->reel, 'MS');
|
||||
$htmlforlines .= $line->qty
|
||||
if ($line->qty>$stock_real) $htmlforlines .= '<b><span style="color: var(--amountremaintopaycolor)">';
|
||||
$htmlforlines .= ' <span class="opacitymedium">('.$langs->trans("Stock").' '.$stock_real.')</span>';
|
||||
if ($line->qty>$stock_real) $htmlforlines .= "</span></b>";
|
||||
}
|
||||
}
|
||||
else $htmlforlines .= $line->qty;
|
||||
$htmlforlines .= '</td>';
|
||||
$htmlforlines .= '<td class="right classfortooltip" title="'.$moreinfo.'">'.price($line->total_ttc).'</td>';
|
||||
}
|
||||
$htmlforlines .= '</tr>'."\n";
|
||||
|
||||
@ -118,7 +118,7 @@ body {
|
||||
th a { font-weight: <?php echo ($useboldtitle ? 'bold' : 'normal'); ?> !important; }
|
||||
a.tab { font-weight: 500 !important; }
|
||||
|
||||
a:link, a:visited, a:hover, a:active { color: var(--colortextlink); text-decoration: none; }
|
||||
a:link, a:visited, a:hover, a:active, .classlink { color: var(--colortextlink); text-decoration: none; }
|
||||
a:hover { text-decoration: underline; color: var(--colortextlink); }
|
||||
a.commonlink { color: var(--colortextlink) !important; text-decoration: none; }
|
||||
th.liste_titre a div div:hover, th.liste_titre_sel a div div:hover { text-decoration: underline; }
|
||||
@ -1866,7 +1866,7 @@ div.attacharea {
|
||||
}
|
||||
div.attachareaformuserfileecm {
|
||||
padding-top: 0;
|
||||
padding-bottom: 0;
|
||||
padding-bottom: 6px;
|
||||
}
|
||||
|
||||
div.arearef {
|
||||
@ -4418,7 +4418,7 @@ span[phptag] {
|
||||
border-bottom: 1px solid #ccc;
|
||||
background: #e6e6e6;
|
||||
display: inline-block;
|
||||
padding: 4px 0 4px 0;
|
||||
padding: 5px 0 5px 0;
|
||||
z-index: 1000;
|
||||
}
|
||||
.websitebar .buttonDelete, .websitebar .button {
|
||||
|
||||
@ -108,7 +108,7 @@ $objectpage = new WebsitePage($db);
|
||||
$object->fetchAll('ASC', 'position'); // Init $object->records with list of websites
|
||||
|
||||
// If website not defined, we take first found
|
||||
if (!($websiteid > 0) && empty($websitekey))
|
||||
if (!($websiteid > 0) && empty($websitekey) && $action != 'createsite')
|
||||
{
|
||||
foreach ($object->records as $key => $valwebsite)
|
||||
{
|
||||
@ -2182,7 +2182,7 @@ $formadmin = new FormAdmin($db);
|
||||
$formwebsite = new FormWebsite($db);
|
||||
$formother = new FormOther($db);
|
||||
|
||||
$help_url = '';
|
||||
$helpurl = 'EN:Module_Website|FR:Module_Website_FR|ES:Módulo_Website';
|
||||
|
||||
$arrayofjs = array(
|
||||
'/includes/ace/src/ace.js',
|
||||
@ -2204,7 +2204,7 @@ $moreheadjs .= '<script type="text/javascript">'."\n";
|
||||
$moreheadjs .= 'var indicatorBlockUI = \''.DOL_URL_ROOT."/theme/".$conf->theme."/img/working.gif".'\';'."\n";
|
||||
$moreheadjs .= '</script>'."\n";
|
||||
|
||||
llxHeader($moreheadcss.$moreheadjs, $langs->trans("WebsiteSetup"), $help_url, '', 0, 0, $arrayofjs, $arrayofcss, '', '', '<!-- Begin div class="fiche" -->'."\n".'<div class="fichebutwithotherclass">');
|
||||
llxHeader($moreheadcss.$moreheadjs, $langs->trans("WebsiteSetup"), $helpurl, '', 0, 0, $arrayofjs, $arrayofcss, '', '', '<!-- Begin div class="fiche" -->'."\n".'<div class="fichebutwithotherclass">');
|
||||
|
||||
print "\n";
|
||||
print '<form action="'.$_SERVER["PHP_SELF"].'" method="POST" enctype="multipart/form-data">';
|
||||
@ -2276,45 +2276,6 @@ if (!GETPOST('hide_websitemenu'))
|
||||
$disabled = '';
|
||||
if (empty($user->rights->website->write)) $disabled = ' disabled="disabled"';
|
||||
|
||||
//var_dump($objectpage);exit;
|
||||
print '<div class="centpercent websitebar">';
|
||||
|
||||
|
||||
// ***** Part for web sites
|
||||
print '<!-- Bar for website -->';
|
||||
print '<span class="websiteselection hideonsmartphoneimp minwidth100 tdoverflowmax100">';
|
||||
print $langs->trans("Website").' : ';
|
||||
print '</span>';
|
||||
|
||||
print '<span class="websiteselection hideonsmartphoneimp">';
|
||||
print '<a href="'.$_SERVER["PHP_SEFL"].'?action=createsite&website='.$website->ref.'" class="button bordertransp"'.$disabled.' title="'.dol_escape_htmltag($langs->trans("AddWebsite")).'"><span class="fa fa-plus-circle valignmiddle btnTitle-icon"><span></a>';
|
||||
print '</span>';
|
||||
|
||||
// List of website
|
||||
print '<span class="websiteselection">';
|
||||
$out = '';
|
||||
$out .= '<select name="website" class="minwidth100 maxwidth300 maxwidth150onsmartphone" id="website">';
|
||||
if (empty($object->records)) $out .= '<option value="-1"> </option>';
|
||||
// Loop on each sites
|
||||
$i = 0;
|
||||
foreach ($object->records as $key => $valwebsite)
|
||||
{
|
||||
if (empty($websitekey)) $websitekey = $valwebsite->ref;
|
||||
|
||||
$out .= '<option value="'.$valwebsite->ref.'"';
|
||||
if ($websitekey == $valwebsite->ref) $out .= ' selected'; // To preselect a value
|
||||
$out .= '>';
|
||||
$out .= $valwebsite->ref;
|
||||
$out .= '</option>';
|
||||
$i++;
|
||||
}
|
||||
$out .= '</select>';
|
||||
$out .= ajax_combobox('website');
|
||||
print $out;
|
||||
//print '<input type="submit" class="button" name="refreshsite" value="'.$langs->trans("Load").'">';
|
||||
print '<input type="image" class="valignmiddle" src="'.img_picto('', 'refresh', '', 0, 1).'" name="refreshsite" value="'.$langs->trans("Load").'">';
|
||||
|
||||
|
||||
if ($websitekey)
|
||||
{
|
||||
$virtualurl = '';
|
||||
@ -2331,70 +2292,146 @@ if (!GETPOST('hide_websitemenu'))
|
||||
if (!is_array($array) && $array < 0) dol_print_error('', $objectpage->error, $objectpage->errors);
|
||||
$atleastonepage = (is_array($array) && count($array) > 0);
|
||||
|
||||
if ($websitekey && $websitekey != '-1' && ($action == 'preview' || $action == 'createfromclone' || $action == 'createpagefromclone' || $action == 'deletesite'))
|
||||
{
|
||||
print ' ';
|
||||
|
||||
print '<input type="submit" class="button bordertransp"'.$disabled.' value="'.dol_escape_htmltag($langs->trans("EditCss")).'" name="editcss">';
|
||||
//var_dump($objectpage);exit;
|
||||
print '<div class="centpercent websitebar">';
|
||||
|
||||
$importlabel = $langs->trans("ImportSite");
|
||||
$exportlabel = $langs->trans("ExportSite");
|
||||
if (! empty($conf->dol_optimize_smallscreen)) {
|
||||
$importlabel = $langs->trans("Import");
|
||||
$exportlabel = $langs->trans("Export");
|
||||
//
|
||||
// Toolbar for websites
|
||||
//
|
||||
|
||||
print '<!-- Bar for website -->';
|
||||
if ($action != 'file_manager') {
|
||||
print '<span class="websiteselection hideonsmartphoneimp minwidth100 tdoverflowmax100">';
|
||||
print $langs->trans("Website").' : ';
|
||||
print '</span>';
|
||||
|
||||
$urltocreatenewwebsite = $_SERVER["PHP_SEFL"].'?action=createsite';
|
||||
if (empty($conf->use_javascript_ajax)) {
|
||||
print '<span class="websiteselection hideonsmartphoneimp">';
|
||||
print '<a href="'.$urltocreatenewwebsite.'" class="button bordertransp"'.$disabled.' title="'.dol_escape_htmltag($langs->trans("AddWebsite")).'"><span class="fa fa-plus-circle valignmiddle btnTitle-icon"><span></a>';
|
||||
print '</span>';
|
||||
}
|
||||
|
||||
if ($atleastonepage)
|
||||
// List of website
|
||||
print '<span class="websiteselection">';
|
||||
$out = '';
|
||||
$out .= '<select name="website" class="minwidth100 width200 maxwidth150onsmartphone" id="website">';
|
||||
if (empty($object->records)) $out .= '<option value="-1"> </option>';
|
||||
if (! empty($conf->use_javascript_ajax)) {
|
||||
$valueoption = '<span class="classlink">'.img_picto('', 'add', 'class="paddingrightonly"').$langs->trans("AddWebsite").'</span>';
|
||||
$out .= '<option value="-2" data-html="'.dol_escape_htmltag($valueoption).'">'.$valueoption.'</option>';
|
||||
}
|
||||
// Loop on each sites
|
||||
$i = 0;
|
||||
foreach ($object->records as $key => $valwebsite)
|
||||
{
|
||||
print '<input type="submit" class="button bordertransp" disabled="disabled" value="'.dol_escape_htmltag($importlabel).'" name="importsite">';
|
||||
if (empty($websitekey)) {
|
||||
if ($action != 'createsite') $websitekey = $valwebsite->ref;
|
||||
}
|
||||
|
||||
$out .= '<option value="'.$valwebsite->ref.'"';
|
||||
if ($websitekey == $valwebsite->ref) $out .= ' selected'; // To preselect a value
|
||||
//$outoption = $valwebsite->getLibStatut(3).' '.$valwebsite->ref.' ';
|
||||
$outoption = (($valwebsite->status == $valwebsite::STATUS_DRAFT)?'<span class="opacitymedium">':'').$valwebsite->ref.(($valwebsite->status == $valwebsite::STATUS_DRAFT)?'</span>':'');
|
||||
$out .= ' data-html="'.dol_escape_htmltag($outoption).'"';
|
||||
$out .= '>';
|
||||
$out .= $valwebsite->ref;
|
||||
$out .= '</option>';
|
||||
$i++;
|
||||
}
|
||||
else {
|
||||
print '<input type="submit" class="button bordertransp"'.$disabled.' value="'.dol_escape_htmltag($importlabel).'" name="importsite">';
|
||||
$out .= '</select>';
|
||||
$out .= ajax_combobox('website');
|
||||
|
||||
if (!empty($conf->use_javascript_ajax)) {
|
||||
$out .= '<script language="javascript">';
|
||||
$out .= 'jQuery(document).ready(function () {';
|
||||
$out .= ' jQuery("#website").change(function () {';
|
||||
$out .= ' console.log("We select "+jQuery("#website option:selected").val());';
|
||||
$out .= ' if (jQuery("#website option:selected").val() == \'-2\') {';
|
||||
$out .= ' window.location.href = "'.$urltocreatenewwebsite.'";';
|
||||
$out .= ' } else {';
|
||||
$out .= ' window.location.href = "'.$_SERVER["PHP_SEFL"].'?website="+jQuery("#website option:selected").val();';
|
||||
$out .= ' }';
|
||||
$out .= ' });';
|
||||
$out .= '});';
|
||||
$out .= '</script>';
|
||||
}
|
||||
print $out;
|
||||
|
||||
if (empty($conf->use_javascript_ajax)) {
|
||||
print '<input type="image" class="valignmiddle" src="'.img_picto('', 'refresh', '', 0, 1).'" name="refreshsite" value="'.$langs->trans("Load").'">';
|
||||
}
|
||||
|
||||
//print '<input type="submit" class="button"'.$disabled.' value="'.dol_escape_htmltag($langs->trans("EditMenu")).'" name="editmenu">';
|
||||
print '<input type="submit" class="button bordertransp"'.$disabled.' value="'.dol_escape_htmltag($exportlabel).'" name="exportsite">';
|
||||
print '<input type="submit" class="button bordertransp"'.$disabled.' value="'.dol_escape_htmltag($langs->trans("CloneSite")).'" name="createfromclone">';
|
||||
if ($websitekey && $websitekey != '-1' && ($action == 'preview' || $action == 'createfromclone' || $action == 'createpagefromclone' || $action == 'deletesite'))
|
||||
{
|
||||
print ' ';
|
||||
|
||||
print '<input type="submit" class="buttonDelete bordertransp" name="deletesite" value="'.$langs->trans("Delete").'"'.($atleastonepage ? ' disabled="disabled"' : '').'>';
|
||||
print '<input type="submit" class="button bordertransp"'.$disabled.' value="'.dol_escape_htmltag($langs->trans("EditCss")).'" name="editcss">';
|
||||
|
||||
print ' ';
|
||||
$importlabel = $langs->trans("ImportSite");
|
||||
$exportlabel = $langs->trans("ExportSite");
|
||||
if (! empty($conf->dol_optimize_smallscreen)) {
|
||||
$importlabel = $langs->trans("Import");
|
||||
$exportlabel = $langs->trans("Export");
|
||||
}
|
||||
|
||||
print '<a href="'.$_SERVER["PHP_SEFL"].'?action=file_manager&website='.$website->ref.'" class="button bordertransp"'.$disabled.' title="'.dol_escape_htmltag($langs->trans("MediaFiles")).'"><span class="fa fa-image"><span></a>';
|
||||
//print '<input type="submit" class="button bordertransp"'.$disabled.' value="'.dol_escape_htmltag($langs->trans("MediaFiles")).'" name="file_manager">';
|
||||
/*print '<a class="button button_file_manager"'.$disabled.'>'.dol_escape_htmltag($langs->trans("MediaFiles")).'</a>';
|
||||
print '<script language="javascript">
|
||||
jQuery(document).ready(function () {
|
||||
jQuery(".button_file_manager").click(function () {
|
||||
var $dialog = $(\'<div></div>\').html(\'<iframe style="border: 0px;" src="'.DOL_URL_ROOT.'/website/index.php?hide_websitemenu=1&dol_hide_topmenu=1&dol_hide_leftmenu=1&file_manager=1&website='.$websitekey.'&pageid='.$pageid.'" width="100%" height="100%"></iframe>\')
|
||||
.dialog({
|
||||
autoOpen: false,
|
||||
modal: true,
|
||||
height: 500,
|
||||
width: \'80%\',
|
||||
title: "'.dol_escape_js($langs->trans("FileManager")).'"
|
||||
});
|
||||
$dialog.dialog(\'open\');
|
||||
});
|
||||
});
|
||||
</script>';
|
||||
*/
|
||||
if ($atleastonepage)
|
||||
{
|
||||
print '<input type="submit" class="button bordertransp" disabled="disabled" value="'.dol_escape_htmltag($importlabel).'" name="importsite">';
|
||||
}
|
||||
else {
|
||||
print '<input type="submit" class="button bordertransp"'.$disabled.' value="'.dol_escape_htmltag($importlabel).'" name="importsite">';
|
||||
}
|
||||
|
||||
print '<a href="'.$_SERVER["PHP_SEFL"].'?action=replacesite&website='.$website->ref.'" class="button bordertransp"'.$disabled.' title="'.dol_escape_htmltag($langs->trans("ReplaceWebsiteContent")).'"><span class="fa fa-search"><span></a>';
|
||||
//print '<input type="submit" class="button"'.$disabled.' value="'.dol_escape_htmltag($langs->trans("EditMenu")).'" name="editmenu">';
|
||||
print '<input type="submit" class="button bordertransp"'.$disabled.' value="'.dol_escape_htmltag($exportlabel).'" name="exportsite">';
|
||||
print '<input type="submit" class="button bordertransp"'.$disabled.' value="'.dol_escape_htmltag($langs->trans("CloneSite")).'" name="createfromclone">';
|
||||
|
||||
if (! empty($conf->categorie->enabled)) {
|
||||
print '<a href="'.DOL_URL_ROOT.'/categories/index.php?leftmenu=website&type=website_page&website='.$website->ref.'" class="button bordertransp"'.$disabled.' title="'.dol_escape_htmltag($langs->trans("Categories")).'"><span class="fa fa-tags"><span></a>';
|
||||
}
|
||||
print '<input type="submit" class="buttonDelete bordertransp" name="deletesite" value="'.$langs->trans("Delete").'"'.($atleastonepage ? ' disabled="disabled"' : '').'>';
|
||||
|
||||
print ' ';
|
||||
|
||||
print '<a href="'.$_SERVER["PHP_SEFL"].'?action=replacesite&website='.$website->ref.'" class="button bordertransp"'.$disabled.' title="'.dol_escape_htmltag($langs->trans("ReplaceWebsiteContent")).'"><span class="fa fa-search"><span></a>';
|
||||
|
||||
if (! empty($conf->global->WEBSITE_ADD_REGENERATE_BUTTON)) {
|
||||
print '<a href="'.$_SERVER["PHP_SEFL"].'?action=regeneratesite&website='.$website->ref.'" class="button bordertransp"'.$disabled.' title="'.dol_escape_htmltag($langs->trans("RegenerateWebsiteContent")).'"><span class="fa fa-cogs"><span></a>';
|
||||
}
|
||||
|
||||
print '</span>';
|
||||
|
||||
if ($websitekey && $websitekey != '-1' && ($action == 'preview' || $action == 'createfromclone' || $action == 'createpagefromclone' || $action == 'deletesite'))
|
||||
{
|
||||
print '<span class="websiteselection">';
|
||||
print '<a href="'.$_SERVER["PHP_SEFL"].'?action=file_manager&website='.$website->ref.'" class="button bordertransp"'.$disabled.' title="'.dol_escape_htmltag($langs->trans("MediaFiles")).'"><span class="fa fa-image"><span></a>';
|
||||
|
||||
if (! empty($conf->categorie->enabled)) {
|
||||
//print '<a href="'.DOL_URL_ROOT.'/categories/index.php?leftmenu=website&dol_hide_leftmenu=1&nosearch=1&type=website_page&website='.$website->ref.'" class="button bordertransp"'.$disabled.' title="'.dol_escape_htmltag($langs->trans("Categories")).'"><span class="fa fa-tags"><span></a>';
|
||||
|
||||
//print '<input type="submit" class="button bordertransp"'.$disabled.' value="'.dol_escape_htmltag($langs->trans("MediaFiles")).'" name="file_manager">';
|
||||
print '<a class="button bordertransp button_categories"'.$disabled.' title="'.dol_escape_htmltag($langs->trans("Categories")).'"><span class="fa fa-tags"><span></a>';
|
||||
print '<script language="javascript">
|
||||
jQuery(document).ready(function () {
|
||||
jQuery(".button_categories").click(function () {
|
||||
var $dialog = $(\'<div></div>\').html(\'<iframe class="iframedialog" style="border: 0px;" src="'.DOL_URL_ROOT.'/categories/index.php?leftmenu=website&nosearch=1&type=website_page&website='.$website->ref.'" width="100%" height="98%"></iframe>\')
|
||||
.dialog({
|
||||
autoOpen: false,
|
||||
modal: true,
|
||||
height: (window.innerHeight - 150),
|
||||
width: \'80%\',
|
||||
title: "'.dol_escape_js($langs->transnoentitiesnoconv("Categories")).'"
|
||||
});
|
||||
$dialog.dialog(\'open\');
|
||||
});
|
||||
});
|
||||
</script>';
|
||||
}
|
||||
|
||||
print '</span>';
|
||||
}
|
||||
} else {
|
||||
print '<input type="hidden" name="website" id="website" value='.$websitekey.'">';
|
||||
}
|
||||
|
||||
print '</span>';
|
||||
|
||||
|
||||
// Toolbar for websites
|
||||
|
||||
print '<span class="websitetools websiteselection">';
|
||||
|
||||
@ -2405,7 +2442,7 @@ if (!GETPOST('hide_websitemenu'))
|
||||
|
||||
print '<span class="websiteinputurl valignmiddle" id="websiteinputurl">';
|
||||
$linktotestonwebserver = '<a href="'.($virtualurl ? $virtualurl : '#').'" class="valignmiddle">';
|
||||
$linktotestonwebserver .= '<span class="hideonsmartphone">'.$langs->trans("TestDeployOnWeb", $virtualurl).' </span>'.img_picto('', 'globe');
|
||||
$linktotestonwebserver .= '<span class="hideonsmartphone paddingrightonly">'.$langs->trans("TestDeployOnWeb", $virtualurl).'</span>'.img_picto('', 'globe');
|
||||
$linktotestonwebserver .= '</a>';
|
||||
$htmltext = '';
|
||||
if (empty($object->fk_default_home))
|
||||
@ -2469,8 +2506,10 @@ if (!GETPOST('hide_websitemenu'))
|
||||
|
||||
print '</span>';
|
||||
|
||||
|
||||
//
|
||||
// Toolbar for pages
|
||||
//
|
||||
|
||||
if ($websitekey && $websitekey != '-1' && !in_array($action, array('editcss', 'editmenu', 'importsite', 'file_manager', 'replacesite', 'replacesiteconfirm')) && !$file_manager)
|
||||
{
|
||||
print '</div>'; // Close current websitebar to open a new one
|
||||
@ -2483,7 +2522,6 @@ if (!GETPOST('hide_websitemenu'))
|
||||
print '</span>';
|
||||
|
||||
print '<span class="websiteselection hideonsmartphoneimp">';
|
||||
//print '<input type="submit"'.$disabled.' class="button" value="'.dol_escape_htmltag($langs->trans("Add")).'" name="createcontainer">';
|
||||
print '<a href="'.$_SERVER["PHP_SEFL"].'?action=createcontainer&website='.$website->ref.'" class="button bordertransp"'.$disabled.' title="'.dol_escape_htmltag($langs->trans("AddPage")).'"><span class="fa fa-plus-circle valignmiddle btnTitle-icon"><span></a>';
|
||||
print '</span>';
|
||||
|
||||
@ -2491,7 +2529,28 @@ if (!GETPOST('hide_websitemenu'))
|
||||
|
||||
if ($action != 'addcontainer')
|
||||
{
|
||||
print '<span class="websiteselection">'.$formwebsite->selectContainer($website, 'pageid', $pageid, 0, $action, 'maxwidth200onsmartphone').'</span>';
|
||||
print '<span class="websiteselection">';
|
||||
print $formwebsite->selectContainer($website, 'pageid', $pageid, 0, $action, 'maxwidth200onsmartphone');
|
||||
print '</span>';
|
||||
|
||||
$urltocreatenewpage = $_SERVER["PHP_SEFL"].'?action=createcontainer&website='.$website->ref;
|
||||
|
||||
$out = '';
|
||||
if (!empty($conf->use_javascript_ajax)) {
|
||||
$out .= '<script language="javascript">';
|
||||
$out .= 'jQuery(document).ready(function () {';
|
||||
$out .= ' jQuery("#pageid").change(function () {';
|
||||
$out .= ' console.log("We select "+jQuery("#pageid option:selected").val());';
|
||||
$out .= ' if (jQuery("#pgeid option:selected").val() == \'-2\') {';
|
||||
$out .= ' window.location.href = "'.$urltocreatenewpage.'";';
|
||||
$out .= ' } else {';
|
||||
$out .= ' window.location.href = "'.$_SERVER["PHP_SEFL"].'?website='.$website->ref.'&pageid="+jQuery("#pageid option:selected").val();';
|
||||
$out .= ' }';
|
||||
$out .= ' });';
|
||||
$out .= '});';
|
||||
$out .= '</script>';
|
||||
}
|
||||
print $out;
|
||||
}
|
||||
else {
|
||||
print $langs->trans("New");
|
||||
@ -3142,7 +3201,7 @@ if ($action == 'createsite')
|
||||
if (GETPOST('WEBSITE_OTHERLANG')) $siteotherlang = GETPOST('WEBSITE_OTHERLANG', 'aZ09comma');
|
||||
|
||||
print '<tr><td class="titlefieldcreate fieldrequired">';
|
||||
print $langs->trans('Ref');
|
||||
print $form->textwithpicto($langs->trans('WebSite'), $langs->trans("Example").': www.mywebsite.com, myportal, ...');
|
||||
print '</td><td>';
|
||||
print '<input type="text" class="flat maxwidth300" name="WEBSITE_REF" value="'.dol_escape_htmltag($siteref).'" autofocus>';
|
||||
print '</td></tr>';
|
||||
|
||||
Loading…
Reference in New Issue
Block a user