Merge branch 'develop' of https://github.com/Dolibarr/dolibarr into develop

This commit is contained in:
Rui Strecht
2017-10-06 18:57:54 +01:00
15 changed files with 122 additions and 24 deletions

View File

@@ -46,7 +46,8 @@ if (! $user->admin) accessforbidden();
$error=0;
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
$hookmanager->initHooks(array('admincompany','globaladmin'));
$contextpage=array('admincompany','globaladmin');
$hookmanager->initHooks($contextpage);
/*
* Actions

View File

@@ -95,9 +95,13 @@ if ($action == 'update')
if ($val == '') dolibarr_del_const($db, 'THEME_ELDY_BACKBODY', $conf->entity);
else dolibarr_set_const($db, 'THEME_ELDY_BACKBODY', $val,'chaine',0,'',$conf->entity);
$val=(implode(',',(colorStringToArray(GETPOST('THEME_ELDY_TOPMENU_BACK1'),array()))));
$val=(implode(',',(colorStringToArray(GETPOST('THEME_ELDY_TOPMENU_BACK1'),array()))));
if ($val == '') dolibarr_del_const($db, 'THEME_ELDY_TOPMENU_BACK1', $conf->entity);
else dolibarr_set_const($db, 'THEME_ELDY_TOPMENU_BACK1', $val,'chaine',0,'',$conf->entity);
else dolibarr_set_const($db, 'THEME_ELDY_TOPMENU_BACK1', $val,'chaine',0,'',$conf->entity);
$val=(implode(',',(colorStringToArray(GETPOST('THEME_ELDY_VERMENU_BACK1'),array()))));
if ($val == '') dolibarr_del_const($db, 'THEME_ELDY_VERMENU_BACK1', $conf->entity);
else dolibarr_set_const($db, 'THEME_ELDY_VERMENU_BACK1', $val,'chaine',0,'',$conf->entity);
$val=(implode(',',(colorStringToArray(GETPOST('THEME_ELDY_BACKTITLE1'),array()))));
if ($val == '') dolibarr_del_const($db, 'THEME_ELDY_BACKTITLE1', $conf->entity);

View File

@@ -1690,7 +1690,15 @@ if ($action == 'create')
//array('type' => 'other','name' => 'note_private', 'label' => $langs->trans("Note"),'value' => '<textarea cols="30" rows="' . ROWS_3 . '" wrap="soft" name="note_private" id="note_private">'.$object->note_private.'</textarea>'));
array('type' => 'text', 'name' => 'note_private', 'label' => $langs->trans("Note"),'value' => $object->note_private));
$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id, $langs->trans('SetAcceptedRefused'), '', 'setstatut', $formquestion, '', 1, 250);
if (! empty($conf->notification->enabled)) {
require_once DOL_DOCUMENT_ROOT . '/core/class/notify.class.php';
$notify = new Notify($db);
$formquestion = array_merge($formquestion, array(
array('type' => 'onecolumn', 'value' => $notify->confirmMessage('PROPAL_CLOSE_SIGNED', $object->socid, $object)),
));
}
$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id, $langs->trans('SetAcceptedRefused'), $text, 'setstatut', $formquestion, '', 1, 250);
}

View File

@@ -298,7 +298,7 @@ class Comment extends CommonObject
$sql.= " c.rowid";
$sql.= " FROM ".MAIN_DB_PREFIX."comment as c";
$sql.= " WHERE c.fk_element = ".$fk_element;
$sql.= " AND c.element_type = '".$this->db->escape($element_type)."'";
$sql.= " AND c.element_type = '".$db->escape($element_type)."'";
$sql.= " AND c.entity = ".$conf->entity;
$sql.= " ORDER BY c.tms DESC";

View File

@@ -1687,7 +1687,7 @@ class ExtraFields
*/
function showSeparator($key)
{
$out = '<tr class="liste_titre"><td colspan="4"><strong>'.$this->attribute_label[$key].'</strong></td></tr>';
$out = '<tr class="trextrafieldseparator"><td colspan="4"><strong>'.$this->attribute_label[$key].'</strong></td></tr>';
return $out;
}

View File

@@ -3635,6 +3635,13 @@ class Form
$more.=$input['value'];
$more.='</td></tr>'."\n";
}
else if ($input['type'] == 'onecolumn')
{
$more.='<tr><td colspan="3" align="left">';
$more.=$input['value'];
$more.='</td></tr>'."\n";
}
}
}
$more.='</table>'."\n";

View File

@@ -50,6 +50,7 @@ class Notify
'BILL_PAYED',
'ORDER_VALIDATE',
'PROPAL_VALIDATE',
'PROPAL_CLOSE_SIGNED',
'FICHINTER_VALIDATE',
'FICHINTER_ADD_CONTACT',
'ORDER_SUPPLIER_VALIDATE',
@@ -395,6 +396,12 @@ class Notify
$object_type = 'propal';
$mesg = $langs->transnoentitiesnoconv("EMailTextProposalValidated",$newref);
break;
case 'PROPAL_CLOSE_SIGNED':
$link='/comm/propal/card.php?id='.$object->id;
$dir_output = $conf->propal->dir_output;
$object_type = 'propal';
$mesg = $langs->transnoentitiesnoconv("EMailTextProposalClosedSigned",$newref);
break;
case 'FICHINTER_ADD_CONTACT':
$link='/fichinter/card.php?id='.$object->id;
$dir_output = $conf->facture->dir_output;
@@ -571,6 +578,12 @@ class Notify
$object_type = 'propal';
$mesg = $langs->transnoentitiesnoconv("EMailTextProposalValidated",$newref);
break;
case 'PROPAL_CLOSE_SIGNED':
$link='/comm/propal/card.php?id='.$object->id;
$dir_output = $conf->propal->dir_output;
$object_type = 'propal';
$mesg = $langs->transnoentitiesnoconv("EMailTextProposalClosedSigned",$newref);
break;
case 'FICHINTER_ADD_CONTACT':
$link='/fichinter/card.php?id='.$object->id;
$dir_output = $conf->facture->dir_output;

View File

@@ -424,7 +424,7 @@ function show_theme($fuser,$edit=0,$foruserprofile=false)
print '<tr class="oddeven">';
print '<td>'.$langs->trans("TopMenuDisableImages").'</td>';
print '<td>'.($conf->global->THEME_TOPMENU_DISABLE_IMAGE?$conf->global->THEME_TOPMENU_DISABLE_IMAGE:$langs->trans("Default")).'</td>';
print '<td align="left" class="nowrap" width="20%"><input '.$bc[$var].' name="check_THEME_TOPMENU_DISABLE_IMAGE" id="check_THEME_TOPMENU_DISABLE_IMAGE" type="checkbox" '.(! empty($object->conf->THEME_ELDY_TOPMENU_BACK1)?" checked":"");
print '<td align="left" class="nowrap" width="20%"><input '.$bc[$var].' name="check_THEME_TOPMENU_DISABLE_IMAGE" id="check_THEME_TOPMENU_DISABLE_IMAGE" type="checkbox" '.(! empty($object->conf->THEME_ELDY_TEXTLINK)?" checked":"");
print (empty($dolibarr_main_demo) && $edit)?'':' disabled="disabled"'; // Disabled for demo
print '> '.$langs->trans("UsePersonalValue").'</td>';
print '<td>';
@@ -552,6 +552,53 @@ function show_theme($fuser,$edit=0,$foruserprofile=false)
print '</td>';
}
// LeftMenuBackgroundColor
if ($foruserprofile)
{
/*
print '<tr class="oddeven">';
print '<td>'.$langs->trans("TopMenuBackgroundColor").'</td>';
print '<td>'.($conf->global->THEME_ELDY_TOPMENU_BACK1?$conf->global->THEME_ELDY_VERMENU_BACK1:$langs->trans("Default")).'</td>';
print '<td align="left" class="nowrap" width="20%"><input '.$bc[$var].' name="check_THEME_ELDY_VERMENU_BACK1" id="check_THEME_ELDY_VERMENU_BACK1" type="checkbox" '.(! empty($object->conf->THEME_ELDY_TOPMENU_BACK1)?" checked":"");
print (empty($dolibarr_main_demo) && $edit)?'':' disabled="disabled"'; // Disabled for demo
print '> '.$langs->trans("UsePersonalValue").'</td>';
print '<td>';
if ($edit)
{
print $formother->selectColor(colorArrayToHex(colorStringToArray($conf->global->THEME_ELDY_VERMENU_BACK1,array()),''),'THEME_ELDY_VERMENU_BACK1','formcolor',1).' ';
}
else
{
$color = colorArrayToHex(colorStringToArray($conf->global->THEME_ELDY_VERMENU_BACK1,array()),'');
if ($color) print '<input type="text" class="colorthumb" disabled style="padding: 1px; margin-top: 0; margin-bottom: 0; background-color: #'.$color.'" value="'.$color.'">';
else print '';
}
if ($edit) print '<br>('.$langs->trans("NotSupportedByAllThemes").', '.$langs->trans("PressF5AfterChangingThis").')';
print '</td>';*/
}
else
{
$default='ffffff';
if ($conf->theme == 'md') $default='ffffff';
print '<tr class="oddeven">';
print '<td>'.$langs->trans("LeftMenuBackgroundColor").'</td>';
print '<td colspan="'.($colspan-1).'">';
if ($edit)
{
print $formother->selectColor(colorArrayToHex(colorStringToArray($conf->global->THEME_ELDY_VERMENU_BACK1,array()),''),'THEME_ELDY_VERMENU_BACK1','formcolor',1).' ';
}
else
{
$color = colorArrayToHex(colorStringToArray($conf->global->THEME_ELDY_VERMENU_BACK1,array()),'');
if ($color) print '<input type="text" class="colorthumb" disabled="disabled" style="padding: 1px; margin-top: 0; margin-bottom: 0; background-color: #'.$color.'" value="'.$color.'">';
else print $langs->trans("Default");
}
print ' &nbsp; ('.$langs->trans("Default").': <strong>'.$default.'</strong>) ';
print $form->textwithpicto('', $langs->trans("NotSupportedByAllThemes").', '.$langs->trans("PressF5AfterChangingThis"));
print '</td>';
}
// BackgroundTableTitleColor
if ($foruserprofile)
{
@@ -667,18 +714,18 @@ function show_theme($fuser,$edit=0,$foruserprofile=false)
/*
print '<tr class="oddeven">';
print '<td>'.$langs->trans("TopMenuBackgroundColor").'</td>';
print '<td>'.($conf->global->THEME_ELDY_TOPMENU_BACK1?$conf->global->THEME_ELDY_TOPMENU_BACK1:$langs->trans("Default")).'</td>';
print '<td align="left" class="nowrap" width="20%"><input '.$bc[$var].' name="check_THEME_ELDY_TOPMENU_BACK1" id="check_THEME_ELDY_TOPMENU_BACK1" type="checkbox" '.(! empty($object->conf->THEME_ELDY_TOPMENU_BACK1)?" checked":"");
print '<td>'.($conf->global->THEME_ELDY_TOPMENU_BACK1?$conf->global->THEME_ELDY_TEXTLINK:$langs->trans("Default")).'</td>';
print '<td align="left" class="nowrap" width="20%"><input '.$bc[$var].' name="check_THEME_ELDY_TEXTLINK" id="check_THEME_ELDY_TEXTLINK" type="checkbox" '.(! empty($object->conf->THEME_ELDY_TEXTLINK)?" checked":"");
print (empty($dolibarr_main_demo) && $edit)?'':' disabled="disabled"'; // Disabled for demo
print '> '.$langs->trans("UsePersonalValue").'</td>';
print '<td>';
if ($edit)
{
print $formother->selectColor(colorArrayToHex(colorStringToArray($conf->global->THEME_ELDY_TOPMENU_BACK1,array()),''),'THEME_ELDY_TOPMENU_BACK1','formcolor',1).' ';
print $formother->selectColor(colorArrayToHex(colorStringToArray($conf->global->THEME_ELDY_TEXTLINK,array()),''),'THEME_ELDY_TEXTLINK','formcolor',1).' ';
}
else
{
$color = colorArrayToHex(colorStringToArray($conf->global->THEME_ELDY_TOPMENU_BACK1,array()),'');
$color = colorArrayToHex(colorStringToArray($conf->global->THEME_ELDY_TEXTLINK,array()),'');
if ($color) print '<input type="text" class="colorthumb" disabled style="padding: 1px; margin-top: 0; margin-bottom: 0; background-color: #'.$color.'" value="'.$color.'">';
else print '';
}

View File

@@ -40,6 +40,7 @@ class InterfaceNotification extends DolibarrTriggers
'BILL_PAYED',
'ORDER_VALIDATE',
'PROPAL_VALIDATE',
'PROPAL_CLOSE_SIGNED',
'FICHINTER_VALIDATE',
'FICHINTER_ADD_CONTACT',
'ORDER_SUPPLIER_VALIDATE',

View File

@@ -186,6 +186,7 @@ EMailTextInterventionAddedContact=A newintervention %s has been assigned to you.
EMailTextInterventionValidated=The intervention %s has been validated.
EMailTextInvoiceValidated=The invoice %s has been validated.
EMailTextProposalValidated=The proposal %s has been validated.
EMailTextProposalClosedSigned=The proposal %s has been closed signed.
EMailTextOrderValidated=The order %s has been validated.
EMailTextOrderApproved=The order %s has been approved.
EMailTextOrderValidatedBy=The order %s has been recorded by %s.

View File

@@ -4,7 +4,8 @@ WebsiteSetupDesc=Create here as much entry as number of different websites you n
DeleteWebsite=Delete website
ConfirmDeleteWebsite=Are you sure you want to delete this web site. All its pages and content will also be removed.
WEBSITE_PAGENAME=Page name/alias
WEBSITE_HTML_HEADER=HTML Header
WEBSITE_HTML_HEADER=HTML Header (common to all pages)
HtmlHeaderPage=HTML specific header for ppage
WEBSITE_CSS_URL=URL of external CSS file
WEBSITE_CSS_INLINE=CSS content
WEBSITE_ROBOT=Robot file (robots.txt)

View File

@@ -180,6 +180,7 @@ EMailTextInterventionAddedContact=Une nouvelle intervention %s vous a été assi
EMailTextInterventionValidated=La fiche intervention %s vous concernant a été validée.
EMailTextInvoiceValidated=La facture %s vous concernant a été validée.
EMailTextProposalValidated=La proposition commerciale %s vous concernant a été validée.
EMailTextProposalClosedSigned=La proposition commerciale %s a été fermée signée.
EMailTextOrderValidated=La commande %s vous concernant a été validée.
EMailTextOrderApproved=La commande %s a été approuvée.
EMailTextOrderValidatedBy=La commande %s a été enregistrée par %s

View File

@@ -120,7 +120,7 @@ $arrayfields=array(
'p.ref'=>array('label'=>$langs->trans("Ref"), 'checked'=>1),
'p.title'=>array('label'=>$langs->trans("Label"), 'checked'=>1),
's.nom'=>array('label'=>$langs->trans("ThirdParty"), 'checked'=>1, 'enabled'=>$conf->societe->enabled),
'commercial'=>array('label'=>$langs->trans("SaleRepresentativesOfThirdParty"), 'checked'=>1),
'commercial'=>array('label'=>$langs->trans("SaleRepresentativesOfThirdParty"), 'checked'=>0),
'p.dateo'=>array('label'=>$langs->trans("DateStart"), 'checked'=>1, 'position'=>100),
'p.datee'=>array('label'=>$langs->trans("DateEnd"), 'checked'=>1, 'position'=>101),
'p.public'=>array('label'=>$langs->trans("Visibility"), 'checked'=>1, 'position'=>102),

View File

@@ -106,6 +106,7 @@ $borderwith=2;
// Case of option always editable
if (! isset($conf->global->THEME_ELDY_BACKBODY)) $conf->global->THEME_ELDY_BACKBODY=$colorbackbody;
if (! isset($conf->global->THEME_ELDY_TOPMENU_BACK1)) $conf->global->THEME_ELDY_TOPMENU_BACK1=$colorbackhmenu1;
if (! isset($conf->global->THEME_ELDY_VERMENU_BACK1)) $conf->global->THEME_ELDY_VERMENU_BACK1=$colorbackvmenu1;
if (! isset($conf->global->THEME_ELDY_BACKTITLE1)) $conf->global->THEME_ELDY_BACKTITLE1=$colorbacktitle1;
if (! isset($conf->global->THEME_ELDY_USE_HOVER)) $conf->global->THEME_ELDY_USE_HOVER=$colorbacklinepairhover;
if (! isset($conf->global->THEME_ELDY_TEXTTITLENOTAB)) $conf->global->THEME_ELDY_TEXTTITLENOTAB=$colortexttitlenotab;
@@ -114,7 +115,6 @@ if (! isset($conf->global->THEME_ELDY_TEXTLINK)) $conf->global->THEME_ELDY_TEXTL
// Case of option editable only if option THEME_ELDY_ENABLE_PERSONALIZED is on
if (empty($conf->global->THEME_ELDY_ENABLE_PERSONALIZED))
{
$conf->global->THEME_ELDY_VERMENU_BACK1='255,255,255'; // vmenu
$conf->global->THEME_ELDY_BACKTABCARD1='255,255,255'; // card
$conf->global->THEME_ELDY_BACKTABACTIVE='234,234,234';
$conf->global->THEME_ELDY_TEXT='0,0,0';
@@ -445,6 +445,9 @@ input[name=weight], input[name=volume], input[name=surface], input[name=sizeheig
input[name=surface] { margin-right: 4px; }
fieldset { border: 1px solid #AAAAAA !important; }
.legendforfieldsetstep { padding-bottom: 10px; }
.trextrafieldseparator td {
border-bottom: 2px solid rgb(120,120,120) !important;
}
hr { border: 0; border-top: 1px solid #ccc; }
@@ -1087,7 +1090,7 @@ div.fiche {
div.fiche {
margin-<?php print $left; ?>: <?php print (GETPOST('optioncss','aZ09') == 'print'?6:($dol_hide_leftmenu?'6':'26')); ?>px;
margin-<?php print $right; ?>: <?php print (GETPOST('optioncss','aZ09') == 'print'?8:(empty($conf->dol_optimize_smallscreen)?'16':'12')); ?>px;
margin-<?php print $right; ?>: <?php print (GETPOST('optioncss','aZ09') == 'print'?8:(empty($conf->dol_optimize_smallscreen)?'20':'12')); ?>px;
<?php if (! empty($conf->dol_hide_leftmenu) && ! empty($conf->dol_hide_topmenu)) print 'margin-top: 4px;'."\n"; ?>
<?php if (! empty($conf->dol_hide_leftmenu)) print 'margin-bottom: 12px;'."\n"; ?>
}

View File

@@ -330,7 +330,8 @@ if ($action == 'add')
$objectpage->pageurl = GETPOST('WEBSITE_PAGENAME','alpha');
$objectpage->description = GETPOST('WEBSITE_DESCRIPTION','alpha');
$objectpage->keywords = GETPOST('WEBSITE_KEYWORDS','alpha');
$objectpage->lang = GETPOST('WEBSITE_LANG','alpha');
$objectpage->lang = GETPOST('WEBSITE_LANG','aZ09');
$objectpage->htmlheader = GETPOST('htmlheader','none');
}
if (! $error)
@@ -687,7 +688,8 @@ if ($action == 'updatemeta')
$objectpage->title = GETPOST('WEBSITE_TITLE', 'alpha');
$objectpage->description = GETPOST('WEBSITE_DESCRIPTION', 'alpha');
$objectpage->keywords = GETPOST('WEBSITE_KEYWORDS', 'alpha');
$objectpage->lang = GETPOST('WEBSITE_LANG', 'alpha');
$objectpage->lang = GETPOST('WEBSITE_LANG', 'aZ09');
$objectpage->htmlheader = GETPOST('htmlheader', 'none');
$res = $objectpage->update($user);
if (! $res > 0)
@@ -943,11 +945,11 @@ if (GETPOST('exportsite'))
{
$fileofzip = exportWebSite($object);
$file_name = basename($yourfile);
$file_name = basename($fileofzip);
header("Content-Type: application/zip");
header("Content-Disposition: attachment; filename=".$file_name);
header("Content-Length: " . filesize($yourfile));
header("Content-Length: " . filesize($fileofzip));
readfile($fileofzip);
exit;
@@ -1567,12 +1569,14 @@ if ($action == 'editmeta' || $action == 'create')
$pagedescription=$objectpage->description;
$pagekeywords=$objectpage->keywords;
$pagelang=$objectpage->lang;
$pagehtmlheader=$objectpage->htmlheader;
}
if (GETPOST('WEBSITE_PAGENAME')) $pageurl=GETPOST('WEBSITE_PAGENAME','alpha');
if (GETPOST('WEBSITE_TITLE')) $pagetitle=GETPOST('WEBSITE_TITLE','alpha');
if (GETPOST('WEBSITE_DESCRIPTION')) $pagedescription=GETPOST('WEBSITE_DESCRIPTION','alpha');
if (GETPOST('WEBSITE_KEYWORDS')) $pagekeywords=GETPOST('WEBSITE_KEYWORDS','alpha');
if (GETPOST('WEBSITE_LANG')) $pagelang=GETPOST('WEBSITE_LANG','aZ09');
if (GETPOST('WEBSITE_PAGENAME','alpha')) $pageurl=GETPOST('WEBSITE_PAGENAME','alpha');
if (GETPOST('WEBSITE_TITLE','alpha')) $pagetitle=GETPOST('WEBSITE_TITLE','alpha');
if (GETPOST('WEBSITE_DESCRIPTION','alpha')) $pagedescription=GETPOST('WEBSITE_DESCRIPTION','alpha');
if (GETPOST('WEBSITE_KEYWORDS','alpha')) $pagekeywords=GETPOST('WEBSITE_KEYWORDS','alpha');
if (GETPOST('WEBSITE_LANG','aZ09')) $pagelang=GETPOST('WEBSITE_LANG','aZ09');
if (GETPOST('htmlheader','none')) $pagehtmlheader=GETPOST('htmlheader','none');
print '<tr><td class="titlefieldcreate fieldrequired">';
print $langs->trans('WEBSITE_PAGENAME');
@@ -1604,6 +1608,13 @@ if ($action == 'editmeta' || $action == 'create')
print $formadmin->select_language($pagelang?$pagelang:$langs->defaultlang, 'WEBSITE_LANG');
print '</td></tr>';
print '<tr><td>';
print $langs->trans('HtmlHeaderPage');
print '</td><td>';
$doleditor=new DolEditor('htmlheader', $pagehtmlheader, '', '220', 'ace', 'In', true, false, 'ace', 0, '100%', '');
print $doleditor->Create(1, '', true, 'HTML Header', 'html');
print '</td></tr>';
print '</table>';
if ($action == 'create')