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

This commit is contained in:
Laurent Destailleur 2019-05-19 19:15:28 +02:00
commit c92994f7ed
162 changed files with 1609 additions and 850 deletions

View File

@ -112,6 +112,7 @@ NEW: When you create product or service, sell accountancy account by default is
NEW: Widget birthdays of the month. NEW: Widget birthdays of the month.
NEW: Option in workflow module to set a reception billed on validate supplier bill. NEW: Option in workflow module to set a reception billed on validate supplier bill.
NEW: Autocompletion on lists should be available on mobile applications. NEW: Autocompletion on lists should be available on mobile applications.
NEW: Add mass action to close several members.
For Developers: For Developers:
NEW: Module "DebugBar" is available as a stable module. NEW: Module "DebugBar" is available as a stable module.
@ -121,7 +122,7 @@ NEW: Add constant XFRAMEOPTIONS_ALLOWALL
NEW: Add function isValidVATID() NEW: Add function isValidVATID()
NEW: ADD document's product support in APIs NEW: ADD document's product support in APIs
NEW: REST API: get the list of objects in a category. NEW: REST API: get the list of objects in a category.
NEW: Update Stripe library to 6.34.3 NEW: Update Stripe library to 6.35
NEW: Upgrade jquery lib to 3.3.1 NEW: Upgrade jquery lib to 3.3.1
NEW: Add hook 'addHtmlHeader()' NEW: Add hook 'addHtmlHeader()'
NEW: Add hook 'createRecurringInvoices()' NEW: Add hook 'createRecurringInvoices()'
@ -174,6 +175,7 @@ Following changes may create regressions for some external modules, but were nec
* Removed deprecated use of string in dol_print_date(). Only date allowed. * Removed deprecated use of string in dol_print_date(). Only date allowed.
* Deprecated property ->fk_departement is now ->state_id everywhere. * Deprecated property ->fk_departement is now ->state_id everywhere.
* Removed the method 4 of GETPOST (to get $_COOKIE). It was not used and not recommanded to use in Dolibarr. * Removed the method 4 of GETPOST (to get $_COOKIE). It was not used and not recommanded to use in Dolibarr.
* Column llx_facture.facnumber change to llx_facture.ref
***** ChangeLog for 9.0.3 compared to 9.0.2 ***** ***** ChangeLog for 9.0.3 compared to 9.0.2 *****

View File

@ -247,9 +247,8 @@ if ($resql)
print '<input type="hidden" name="page" value="'.$page.'">'; print '<input type="hidden" name="page" value="'.$page.'">';
print '<input type="hidden" name="contextpage" value="'.$contextpage.'">'; print '<input type="hidden" name="contextpage" value="'.$contextpage.'">';
$newcardbutton = '<a class="butActionNew" href="./card.php?action=create"><span class="valignmiddle text-plus-circle">' . $langs->trans("Addanaccount").'</span>'; $newcardbutton.= dolGetButtonTitle($langs->trans("New"), $langs->trans("Addanaccount"), 'fa fa-plus-circle', './card.php?action=create');
$newcardbutton.= '<span class="fa fa-plus-circle valignmiddle"></span>';
$newcardbutton.= '</a>';
print_barre_liste($langs->trans('ListAccounts'), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords, 'title_accountancy', 0, $newcardbutton, '', $limit); print_barre_liste($langs->trans('ListAccounts'), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords, 'title_accountancy', 0, $newcardbutton, '', $limit);
@ -298,7 +297,7 @@ if ($resql)
if (! empty($arrayfields['aa.pcg_type']['checked'])) print '<td class="liste_titre"><input type="text" class="flat" size="6" name="search_pcgtype" value="' . $search_pcgtype . '"></td>'; if (! empty($arrayfields['aa.pcg_type']['checked'])) print '<td class="liste_titre"><input type="text" class="flat" size="6" name="search_pcgtype" value="' . $search_pcgtype . '"></td>';
if (! empty($arrayfields['aa.pcg_subtype']['checked'])) print '<td class="liste_titre"><input type="text" class="flat" size="6" name="search_pcgsubtype" value="' . $search_pcgsubtype . '"></td>'; if (! empty($arrayfields['aa.pcg_subtype']['checked'])) print '<td class="liste_titre"><input type="text" class="flat" size="6" name="search_pcgsubtype" value="' . $search_pcgsubtype . '"></td>';
if (! empty($arrayfields['aa.active']['checked'])) print '<td class="liste_titre">&nbsp;</td>'; if (! empty($arrayfields['aa.active']['checked'])) print '<td class="liste_titre">&nbsp;</td>';
print '<td class="liste_titre right">'; print '<td class="liste_titre maxwidthsearch">';
$searchpicto=$form->showFilterAndCheckAddButtons($massactionbutton?1:0, 'checkforselect', 1); $searchpicto=$form->showFilterAndCheckAddButtons($massactionbutton?1:0, 'checkforselect', 1);
print $searchpicto; print $searchpicto;
print '</td>'; print '</td>';

View File

@ -111,14 +111,9 @@ if ($result)
$i = 0; $i = 0;
if (! empty($user->rights->accounting->fiscalyear))
{ $addbutton.= dolGetButtonTitle($langs->trans('NewFiscalYear'), '', 'fa fa-plus-circle', 'fiscalyear_card.php?action=create', '', $user->rights->accounting->fiscalyear);
$addbutton = '<a class="butActionNew" href="fiscalyear_card.php?action=create"><span class="valignmiddle text-plus-circle">' . $langs->trans("NewFiscalYear") .'</span><span class="fa fa-plus-circle valignmiddle"></span></a>';
}
else
{
$addbutton = '<a class="butActionRefused classfortooltip" href="#" title="'.dol_escape_htmltag($langs->trans("NotAllowed")).'"><span class="valignmiddle text-plus-circle">' . $langs->trans("NewFiscalYear") .'</span><span class="fa fa-plus-circle valignmiddle"></span></a>';
}
$title = $langs->trans('AccountingPeriods'); $title = $langs->trans('AccountingPeriods');
print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $params, $sortfield, $sortorder, '', $num, $nbtotalofrecords, 'title_accountancy', 0, $addbutton, '', $limit, 1); print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $params, $sortfield, $sortorder, '', $num, $nbtotalofrecords, 'title_accountancy', 0, $addbutton, '', $limit, 1);

View File

@ -443,19 +443,18 @@ print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
print '<input type="hidden" name="page" value="'.$page.'">'; print '<input type="hidden" name="page" value="'.$page.'">';
$listofformat=AccountancyExport::getType(); $listofformat=AccountancyExport::getType();
$button = '<a class="butAction" name="button_export_file" href="'.$_SERVER["PHP_SELF"].'?action=export_file'.($param?'&'.$param:'').'">';
if (count($filter)) $button.= $langs->trans("ExportFilteredList"); if (count($filter)) $buttonLabel = $langs->trans("ExportFilteredList");
else $button.= $langs->trans("ExportList"); else $buttonLabel = $langs->trans("ExportList");
//$button.=' ('.$listofformat[$conf->global->ACCOUNTING_EXPORT_MODELCSV].')';
$button.= '</a>'; $newcardbutton = dolGetButtonTitle($buttonLabel, '', 'fa fa-file-export', $_SERVER["PHP_SELF"].'?action=export_file'.($param?'&'.$param:''));
$newcardbutton.= dolGetButtonTitle($langs->trans('GroupByAccountAccounting'), '', 'fa fa-object-group', DOL_URL_ROOT.'/accountancy/bookkeeping/listbyaccount.php?'.$param);
$newcardbutton.= dolGetButtonTitle($langs->trans('NewAccountingMvt'), '', 'fa fa-plus-circle', './card.php?action=create');
$groupby = ' <a class="nohover marginrightonly" href="'.DOL_URL_ROOT.'/accountancy/bookkeeping/listbyaccount.php?'.$param.'">' . $langs->trans("GroupByAccountAccounting") . '</a>'; print_barre_liste($title_page, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $result, $nbtotalofrecords, 'title_accountancy', 0, $newcardbutton, '', $limit);
$newcardbutton = '<a class="butActionNew" href="./card.php?action=create"><span class="valignmiddle text-plus-circle">'.$langs->trans("NewAccountingMvt").'</span>';
$newcardbutton.= '<span class="fa fa-plus-circle valignmiddle"></span>';
$newcardbutton.= '</a>';
print_barre_liste($title_page, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $button, $result, $nbtotalofrecords, 'title_accountancy', 0, $groupby.$newcardbutton, '', $limit);
$varpage=empty($contextpage)?$_SERVER["PHP_SELF"]:$contextpage; $varpage=empty($contextpage)?$_SERVER["PHP_SELF"]:$contextpage;
$selectedfields=$form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage); // This also change content of $arrayfields $selectedfields=$form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage); // This also change content of $arrayfields

View File

@ -256,10 +256,8 @@ if ($action == 'delbookkeepingyear') {
print '<form method="POST" id="searchFormList" action="' . $_SERVER["PHP_SELF"] . '">'; print '<form method="POST" id="searchFormList" action="' . $_SERVER["PHP_SELF"] . '">';
$viewflat = ' <a class="nohover marginrightonly" href="'.DOL_URL_ROOT.'/accountancy/bookkeeping/list.php?'.$param.'">' . $langs->trans("ViewFlatList") . '</a>'; $newcardbutton.= dolGetButtonTitle($langs->trans('ViewFlatList'), '', 'fa fa-list', DOL_URL_ROOT.'/accountancy/bookkeeping/list.php?'.$param);
$newcardbutton = '<a class="butActionNew" href="./card.php?action=create"><span class="valignmiddle text-plus-circle">'.$langs->trans("NewAccountingMvt").'</span>'; $newcardbutton.= dolGetButtonTitle($langs->trans('NewAccountingMvt'), '', 'fa fa-plus-circle', './card.php?action=create');
$newcardbutton.= '<span class="fa fa-plus-circle valignmiddle"></span>';
$newcardbutton.= '</a>';
if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.urlencode($contextpage); if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.urlencode($contextpage);
if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.urlencode($limit); if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.urlencode($limit);

View File

@ -151,9 +151,7 @@ if ($object->id > 0)
$newcardbutton = ''; $newcardbutton = '';
if (! empty($conf->agenda->enabled)) if (! empty($conf->agenda->enabled))
{ {
$newcardbutton.='<a class="butActionNew" href="'.DOL_URL_ROOT.'/comm/action/card.php?action=create&backtopage=1&origin=member&originid='.$id.'"><span class="valignmiddle text-plus-circle">'.$langs->trans("AddAction").'</span>'; $newcardbutton.= dolGetButtonTitle($langs->trans('AddAction'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/comm/action/card.php?action=create&backtopage=1&origin=member&originid='.$id);
$newcardbutton.= '<span class="fa fa-plus-circle valignmiddle"></span>';
$newcardbutton.= '</a>';
} }
if (! empty($conf->agenda->enabled) && (!empty($user->rights->agenda->myactions->read) || !empty($user->rights->agenda->allactions->read) )) if (! empty($conf->agenda->enabled) && (!empty($user->rights->agenda->myactions->read) || !empty($user->rights->agenda->allactions->read) ))

View File

@ -1567,7 +1567,7 @@ else
$formquestion=array(); $formquestion=array();
if ($object->email) $formquestion[]=array('type' => 'checkbox', 'name' => 'send_mail', 'label' => $label, 'value' => (! empty($conf->global->ADHERENT_DEFAULT_SENDINFOBYMAIL)?'true':'false')); if ($object->email) $formquestion[]=array('type' => 'checkbox', 'name' => 'send_mail', 'label' => $label, 'value' => (! empty($conf->global->ADHERENT_DEFAULT_SENDINFOBYMAIL)?'true':'false'));
if ($backtopage) $formquestion[]=array('type' => 'hidden', 'name' => 'backtopage', 'value' => ($backtopage != '1' ? $backtopage : $_SERVER["HTTP_REFERER"])); if ($backtopage) $formquestion[]=array('type' => 'hidden', 'name' => 'backtopage', 'value' => ($backtopage != '1' ? $backtopage : $_SERVER["HTTP_REFERER"]));
print $form->formconfirm("card.php?rowid=".$id, $langs->trans("ResiliateMember"), $langs->trans("ConfirmResiliateMember"), "confirm_resign", $formquestion, 'no', 1, 220); print $form->formconfirm("card.php?rowid=".$id, $langs->trans("ResiliateMember"), $langs->trans("ConfirmResiliateMember"), "confirm_resign", $formquestion, 'no', 1, 240);
} }
// Confirm remove member // Confirm remove member

View File

@ -189,6 +189,42 @@ if (empty($reshook))
$search_array_options=array(); $search_array_options=array();
} }
// Close
if ($massaction == 'close' && $user->rights->adherent->creer)
{
$tmpmember = new Adherent($db);
$error=0;
$nbclose=0;
$db->begin();
foreach($toselect as $idtoclose)
{
$tmpmember->fetch($idtoclose);
$result=$tmpmember->resiliate($user);
if ($result < 0 && ! count($tmpmember->errors))
{
setEventMessages($tmpmember->error, $tmpmember->errors, 'errors');
}
else
{
if ($result > 0) $nbclose++;
}
}
if (! $error)
{
setEventMessages($langs->trans("XMembersClosed", $nbclose), null, 'mesgs');
$db->commit();
}
else
{
$db->rollback();
}
}
// Mass actions // Mass actions
$objectclass='Adherent'; $objectclass='Adherent';
$objectlabel='Members'; $objectlabel='Members';
@ -326,12 +362,11 @@ if ($search_type > 0)
} }
$param=''; $param='';
if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.$contextpage; if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.urlencode($contextpage);
if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.$limit; if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.urlencode($limit);
if ($sall != "") $param.="&sall=".urlencode($sall); if ($sall != "") $param.="&sall=".urlencode($sall);
if ($statut != "") $param.="&statut=".urlencode($statut); if ($statut != "") $param.="&statut=".urlencode($statut);
if ($search_ref) $param.="&search_ref=".urlencode($search_ref); if ($search_ref) $param.="&search_ref=".urlencode($search_ref);
if ($search_nom) $param.="&search_nom=".urlencode($search_nom);
if ($search_civility) $param.="&search_civility=".urlencode($search_civility); if ($search_civility) $param.="&search_civility=".urlencode($search_civility);
if ($search_firstname) $param.="&search_firstname=".urlencode($search_firstname); if ($search_firstname) $param.="&search_firstname=".urlencode($search_firstname);
if ($search_lastname) $param.="&search_lastname=".urlencode($search_lastname); if ($search_lastname) $param.="&search_lastname=".urlencode($search_lastname);
@ -358,6 +393,7 @@ $arrayofmassactions = array(
//'presend'=>$langs->trans("SendByMail"), //'presend'=>$langs->trans("SendByMail"),
//'builddoc'=>$langs->trans("PDFMerge"), //'builddoc'=>$langs->trans("PDFMerge"),
); );
if ($user->rights->adherent->creer) $arrayofmassactions['close']=$langs->trans("Resiliate");
if ($user->rights->adherent->supprimer) $arrayofmassactions['predelete']='<span class="fa fa-trash paddingrightonly"></span>'.$langs->trans("Delete"); if ($user->rights->adherent->supprimer) $arrayofmassactions['predelete']='<span class="fa fa-trash paddingrightonly"></span>'.$langs->trans("Delete");
if (in_array($massaction, array('presend','predelete'))) $arrayofmassactions=array(); if (in_array($massaction, array('presend','predelete'))) $arrayofmassactions=array();
$massactionbutton=$form->selectMassAction('', $arrayofmassactions); $massactionbutton=$form->selectMassAction('', $arrayofmassactions);
@ -365,9 +401,7 @@ $massactionbutton=$form->selectMassAction('', $arrayofmassactions);
$newcardbutton=''; $newcardbutton='';
if ($user->rights->adherent->creer) if ($user->rights->adherent->creer)
{ {
$newcardbutton='<a class="butActionNew" href="'.DOL_URL_ROOT.'/adherents/card.php?action=create"><span class="valignmiddle text-plus-circle">'.$langs->trans('NewMember').'</span>'; $newcardbutton.= dolGetButtonTitle($langs->trans('NewMember'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/adherents/card.php?action=create');
$newcardbutton.= '<span class="fa fa-plus-circle valignmiddle"></span>';
$newcardbutton.= '</a>';
} }
print '<form method="POST" id="searchFormList" action="'.$_SERVER["PHP_SELF"].'">'; print '<form method="POST" id="searchFormList" action="'.$_SERVER["PHP_SELF"].'">';

View File

@ -247,9 +247,7 @@ $massactionbutton=$form->selectMassAction('', $arrayofmassactions);
$newcardbutton=''; $newcardbutton='';
if ($user->rights->adherent->cotisation->creer) if ($user->rights->adherent->cotisation->creer)
{ {
$newcardbutton='<a class="butActionNew" href="'.DOL_URL_ROOT.'/adherents/list.php?status=-1,1"><span class="valignmiddle text-plus-circle">'.$langs->trans('NewSubscription').'</span>'; $newcardbutton.= dolGetButtonTitle($langs->trans('NewSubscription'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/adherents/list.php?status=-1,1');
$newcardbutton.= '<span class="fa fa-plus-circle valignmiddle"></span>';
$newcardbutton.= '</a>';
} }
print '<form method="POST" id="searchFormList" action="'.$_SERVER["PHP_SELF"].'">'; print '<form method="POST" id="searchFormList" action="'.$_SERVER["PHP_SELF"].'">';

View File

@ -236,9 +236,7 @@ if (! $rowid && $action != 'create' && $action != 'edit')
$newcardbutton=''; $newcardbutton='';
if ($user->rights->adherent->configurer) if ($user->rights->adherent->configurer)
{ {
$newcardbutton='<a class="butActionNew" href="'.DOL_URL_ROOT.'/adherents/type.php?action=create"><span class="valignmiddle text-plus-circle">'.$langs->trans('NewMemberType').'</span>'; $newcardbutton.= dolGetButtonTitle($langs->trans('NewMemberType'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/adherents/type.php?action=create');
$newcardbutton.= '<span class="fa fa-plus-circle valignmiddle"></span>';
$newcardbutton.= '</a>';
} }
print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'">'; print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'">';

View File

@ -143,7 +143,7 @@ print '<tr class="liste_titre">';
print '<td class="liste_titre"><input type="text" name="search_event" value="'.dol_escape_htmltag($search_event).'"></td>'; print '<td class="liste_titre"><input type="text" name="search_event" value="'.dol_escape_htmltag($search_event).'"></td>';
print '<td class="liste_titre"></td>'; print '<td class="liste_titre"></td>';
// Action column // Action column
print '<td class="liste_titre right">'; print '<td class="liste_titre maxwidthsearch">';
$searchpicto=$form->showFilterButtons(); $searchpicto=$form->showFilterButtons();
print $searchpicto; print $searchpicto;
print '</td>'; print '</td>';

View File

@ -77,10 +77,17 @@ $form=new Form($db);
$linkback='<a href="'.DOL_URL_ROOT.'/admin/modules.php?restore_lastsearch_values=1">'.$langs->trans("BackToModuleList").'</a>'; $linkback='<a href="'.DOL_URL_ROOT.'/admin/modules.php?restore_lastsearch_values=1">'.$langs->trans("BackToModuleList").'</a>';
print load_fiche_titre($langs->trans("DebugBarSetup"), $linkback, 'title_setup'); print load_fiche_titre($langs->trans("DebugBarSetup"), $linkback, 'title_setup');
print '<br>';
//print load_fiche_titre($langs->trans("DebugBar")); //print load_fiche_titre($langs->trans("DebugBar"));
if (! function_exists('mb_check_encoding'))
{
$langs->load("errors");
print info_admin($langs->trans("ErrorPHPNeedModule", 'mbstring'), 0, 0, 'error');
}
print '<br>';
// Level // Level
print '<form action="'.$_SERVER["PHP_SELF"].'" method="post">'; print '<form action="'.$_SERVER["PHP_SELF"].'" method="post">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">'; print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';

View File

@ -120,6 +120,12 @@ $modules=array(
'img' => 'trip' 'img' => 'trip'
)*/ )*/
), ),
'holiday' => array(
array(
'code' => 'MAIN_DELAY_HOLIDAYS',
'img' => 'holiday'
),
),
); );
$labelmeteo = array(0=>$langs->trans("No"), 1=>$langs->trans("Yes"), 2=>$langs->trans("OnMobileOnly")); $labelmeteo = array(0=>$langs->trans("No"), 1=>$langs->trans("Yes"), 2=>$langs->trans("OnMobileOnly"));

View File

@ -322,9 +322,7 @@ print '<input type="hidden" name="contextpage" value="'.$contextpage.'">';
$newcardbutton=''; $newcardbutton='';
//if ($user->rights->emailcollector->creer) //if ($user->rights->emailcollector->creer)
//{ //{
$newcardbutton='<a class="butActionNew" href="emailcollector_card.php?action=create&backtopage='.urlencode($_SERVER['PHP_SELF']).'"><span class="valignmiddle text-plus-circle">'.$langs->trans('New').'</span>'; $newcardbutton.= dolGetButtonTitle($langs->trans('New'), '', 'fa fa-plus-circle', 'emailcollector_card.php?action=create&backtopage='.urlencode($_SERVER['PHP_SELF']));
$newcardbutton.= '<span class="fa fa-plus-circle valignmiddle"></span>';
$newcardbutton.= '</a>';
//} //}
print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'title_companies', 0, $newcardbutton, '', $limit); print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'title_companies', 0, $newcardbutton, '', $limit);
@ -386,7 +384,7 @@ $parameters=array('arrayfields'=>$arrayfields);
$reshook=$hookmanager->executeHooks('printFieldListOption', $parameters, $object); // Note that $action and $object may have been modified by hook $reshook=$hookmanager->executeHooks('printFieldListOption', $parameters, $object); // Note that $action and $object may have been modified by hook
print $hookmanager->resPrint; print $hookmanager->resPrint;
// Action column // Action column
print '<td class="liste_titre right">'; print '<td class="liste_titre maxwidthsearch">';
$searchpicto=$form->showFilterButtons(); $searchpicto=$form->showFilterButtons();
print $searchpicto; print $searchpicto;
print '</td>'; print '</td>';

View File

@ -356,7 +356,7 @@ $parameters=array('arrayfields'=>$arrayfields);
$reshook=$hookmanager->executeHooks('printFieldListOption', $parameters, $object); // Note that $action and $object may have been modified by hook $reshook=$hookmanager->executeHooks('printFieldListOption', $parameters, $object); // Note that $action and $object may have been modified by hook
print $hookmanager->resPrint; print $hookmanager->resPrint;
// Action column // Action column
print '<td class="liste_titre right">'; print '<td class="liste_titre maxwidthsearch">';
$searchpicto=$form->showFilterButtons(); $searchpicto=$form->showFilterButtons();
print $searchpicto; print $searchpicto;
print '</td>'; print '</td>';

View File

@ -256,9 +256,7 @@ if ($action == 'delete')
$newcardbutton=''; $newcardbutton='';
if ($user->admin) if ($user->admin)
{ {
$newcardbutton='<a class="butActionNew" href="'.DOL_URL_ROOT.'/admin/menus/edit.php?menuId=0&action=create&menu_handler='.urlencode($menu_handler).'&backtopage='.urlencode($_SERVER['PHP_SELF']).'"><span class="valignmiddle text-plus-circle">'.$langs->trans('New').'</span>'; $newcardbutton.= dolGetButtonTitle($langs->trans('New'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/admin/menus/edit.php?menuId=0&action=create&menu_handler='.urlencode($menu_handler).'&backtopage='.urlencode($_SERVER['PHP_SELF']));
$newcardbutton.= '<span class="fa fa-plus-circle valignmiddle"></span>';
$newcardbutton.= '</a>';
} }
print '<form name="newmenu" class="nocellnopadd" action="'.$_SERVER["PHP_SELF"].'">'; print '<form name="newmenu" class="nocellnopadd" action="'.$_SERVER["PHP_SELF"].'">';

View File

@ -255,7 +255,7 @@ if ($result)
//print '<input class="flat" type="text" size="10" name="search_desc" value="'.$search_desc.'">'; //print '<input class="flat" type="text" size="10" name="search_desc" value="'.$search_desc.'">';
print '</td>'; print '</td>';
print '<td class="liste_titre right">'; print '<td class="liste_titre maxwidthsearch">';
$searchpicto=$form->showFilterAndCheckAddButtons(0); $searchpicto=$form->showFilterAndCheckAddButtons(0);
print $searchpicto; print $searchpicto;
print '</td>'; print '</td>';

View File

@ -372,7 +372,7 @@ $parameters=array('arrayfields'=>$arrayfields);
$reshook=$hookmanager->executeHooks('printFieldListOption', $parameters, $object); // Note that $action and $object may have been modified by hook $reshook=$hookmanager->executeHooks('printFieldListOption', $parameters, $object); // Note that $action and $object may have been modified by hook
print $hookmanager->resPrint; print $hookmanager->resPrint;
// Action column // Action column
print '<td class="liste_titre right">'; print '<td class="liste_titre maxwidthsearch">';
$searchpicto=$form->showFilterButtons(); $searchpicto=$form->showFilterButtons();
print $searchpicto; print $searchpicto;
print '</td>'; print '</td>';

261
htdocs/bom/bom_agenda.php Normal file
View File

@ -0,0 +1,261 @@
<?php
/* Copyright (C) 2017 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) ---Put here your own copyright and developer email---
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/**
* \file htdocs/modulebuilder/template/myobject_agenda.php
* \ingroup bom
* \brief Page of MyObject events
*/
// Load Dolibarr environment
$res=0;
// Try main.inc.php into web root known defined into CONTEXT_DOCUMENT_ROOT (not always defined)
if (! $res && ! empty($_SERVER["CONTEXT_DOCUMENT_ROOT"])) $res=@include $_SERVER["CONTEXT_DOCUMENT_ROOT"]."/main.inc.php";
// Try main.inc.php into web root detected using web root calculated from SCRIPT_FILENAME
$tmp=empty($_SERVER['SCRIPT_FILENAME'])?'':$_SERVER['SCRIPT_FILENAME'];$tmp2=realpath(__FILE__); $i=strlen($tmp)-1; $j=strlen($tmp2)-1;
while($i > 0 && $j > 0 && isset($tmp[$i]) && isset($tmp2[$j]) && $tmp[$i]==$tmp2[$j]) { $i--; $j--; }
if (! $res && $i > 0 && file_exists(substr($tmp, 0, ($i+1))."/main.inc.php")) $res=@include substr($tmp, 0, ($i+1))."/main.inc.php";
if (! $res && $i > 0 && file_exists(dirname(substr($tmp, 0, ($i+1)))."/main.inc.php")) $res=@include dirname(substr($tmp, 0, ($i+1)))."/main.inc.php";
// Try main.inc.php using relative path
if (! $res && file_exists("../main.inc.php")) $res=@include "../main.inc.php";
if (! $res && file_exists("../../main.inc.php")) $res=@include "../../main.inc.php";
if (! $res && file_exists("../../../main.inc.php")) $res=@include "../../../main.inc.php";
if (! $res) die("Include of main fails");
require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
dol_include_once('/bom/class/bom.class.php');
dol_include_once('/bom/lib/bom.lib.php');
// Load translation files required by the page
$langs->loadLangs(array("mrp","other"));
// Get parameters
$id = GETPOST('id', 'int');
$ref = GETPOST('ref', 'alpha');
$action = GETPOST('action', 'alpha');
$cancel = GETPOST('cancel', 'aZ09');
$backtopage = GETPOST('backtopage', 'alpha');
if (GETPOST('actioncode', 'array'))
{
$actioncode=GETPOST('actioncode', 'array', 3);
if (! count($actioncode)) $actioncode='0';
}
else
{
$actioncode=GETPOST("actioncode", "alpha", 3)?GETPOST("actioncode", "alpha", 3):(GETPOST("actioncode")=='0'?'0':(empty($conf->global->AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT)?'':$conf->global->AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT));
}
$search_agenda_label=GETPOST('search_agenda_label');
// Security check - Protection if external user
//if ($user->societe_id > 0) access_forbidden();
//if ($user->societe_id > 0) $socid = $user->societe_id;
//$result = restrictedArea($user, 'bom', $id);
$limit = GETPOST('limit', 'int')?GETPOST('limit', 'int'):$conf->liste_limit;
$sortfield = GETPOST("sortfield", 'alpha');
$sortorder = GETPOST("sortorder", 'alpha');
$page = GETPOST("page", 'int');
if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1
$offset = $limit * $page;
$pageprev = $page - 1;
$pagenext = $page + 1;
if (! $sortfield) $sortfield='a.datep,a.id';
if (! $sortorder) $sortorder='DESC';
// Initialize technical objects
$object=new BOM($db);
$extrafields = new ExtraFields($db);
$diroutputmassaction=$conf->bom->dir_output . '/temp/massgeneration/'.$user->id;
$hookmanager->initHooks(array('bomagenda','globalcard')); // Note that conf->hooks_modules contains array
// Fetch optionals attributes and labels
$extralabels = $extrafields->fetch_name_optionals_label('bom');
// Load object
include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once // Must be include, not include_once. Include fetch and fetch_thirdparty but not fetch_optionals
if ($id > 0 || ! empty($ref)) $upload_dir = $conf->bom->multidir_output[$object->entity] . "/" . $object->id;
/*
* Actions
*/
$parameters=array('id'=>$socid);
$reshook=$hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
if (empty($reshook))
{
// Cancel
if (GETPOST('cancel', 'alpha') && ! empty($backtopage))
{
header("Location: ".$backtopage);
exit;
}
// Purge search criteria
if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x', 'alpha') || GETPOST('button_removefilter', 'alpha')) // All tests are required to be compatible with all browsers
{
$actioncode='';
$search_agenda_label='';
}
}
/*
* View
*/
$contactstatic = new Contact($db);
$form = new Form($db);
if ($object->id > 0)
{
$title=$langs->trans("Agenda");
//if (! empty($conf->global->MAIN_HTML_TITLE) && preg_match('/thirdpartynameonly/',$conf->global->MAIN_HTML_TITLE) && $object->name) $title=$object->name." - ".$title;
$help_url = '';
llxHeader('', $title, $help_url);
if (! empty($conf->notification->enabled)) $langs->load("mails");
$head = bomPrepareHead($object);
dol_fiche_head($head, 'agenda', $langs->trans("BillOfMaterials"), -1, 'bom');
// Object card
// ------------------------------------------------------------
$linkback = '<a href="' .dol_buildpath('/bom/myobject_list.php', 1) . '?restore_lastsearch_values=1' . (! empty($socid) ? '&socid=' . $socid : '') . '">' . $langs->trans("BackToList") . '</a>';
$morehtmlref='<div class="refidno">';
/*
// Ref customer
$morehtmlref.=$form->editfieldkey("RefCustomer", 'ref_client', $object->ref_client, $object, 0, 'string', '', 0, 1);
$morehtmlref.=$form->editfieldval("RefCustomer", 'ref_client', $object->ref_client, $object, 0, 'string', '', null, null, '', 1);
// Thirdparty
$morehtmlref.='<br>'.$langs->trans('ThirdParty') . ' : ' . $object->thirdparty->getNomUrl(1);
// Project
if (! empty($conf->projet->enabled))
{
$langs->load("projects");
$morehtmlref.='<br>'.$langs->trans('Project') . ' ';
if ($user->rights->bom->creer)
{
if ($action != 'classify')
//$morehtmlref.='<a href="' . $_SERVER['PHP_SELF'] . '?action=classify&amp;id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a> : ';
$morehtmlref.=' : ';
if ($action == 'classify') {
//$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1);
$morehtmlref.='<form method="post" action="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'">';
$morehtmlref.='<input type="hidden" name="action" value="classin">';
$morehtmlref.='<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
$morehtmlref.=$formproject->select_projects($object->socid, $object->fk_project, 'projectid', $maxlength, 0, 1, 0, 1, 0, 0, '', 1);
$morehtmlref.='<input type="submit" class="button valignmiddle" value="'.$langs->trans("Modify").'">';
$morehtmlref.='</form>';
} else {
$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'none', 0, 0, 0, 1);
}
} else {
if (! empty($object->fk_project)) {
$proj = new Project($db);
$proj->fetch($object->fk_project);
$morehtmlref.='<a href="'.DOL_URL_ROOT.'/projet/card.php?id=' . $object->fk_project . '" title="' . $langs->trans('ShowProject') . '">';
$morehtmlref.=$proj->ref;
$morehtmlref.='</a>';
} else {
$morehtmlref.='';
}
}
}*/
$morehtmlref.='</div>';
dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref);
print '<div class="fichecenter">';
print '<div class="underbanner clearboth"></div>';
$object->info($object->id);
print dol_print_object_info($object, 1);
print '</div>';
dol_fiche_end();
// Actions buttons
$objthirdparty=$object;
$objcon=new stdClass();
$out='';
$permok=$user->rights->agenda->myactions->create;
if ((! empty($objthirdparty->id) || ! empty($objcon->id)) && $permok)
{
//$out.='<a href="'.DOL_URL_ROOT.'/comm/action/card.php?action=create';
if (get_class($objthirdparty) == 'Societe') $out.='&amp;socid='.$objthirdparty->id;
$out.=(! empty($objcon->id)?'&amp;contactid='.$objcon->id:'').'&amp;backtopage=1&amp;percentage=-1';
//$out.=$langs->trans("AddAnAction").' ';
//$out.=img_picto($langs->trans("AddAnAction"),'filenew');
//$out.="</a>";
}
print '<div class="tabsAction">';
if (! empty($conf->agenda->enabled))
{
if (! empty($user->rights->agenda->myactions->create) || ! empty($user->rights->agenda->allactions->create))
{
print '<a class="butAction" href="'.DOL_URL_ROOT.'/comm/action/card.php?action=create'.$out.'">'.$langs->trans("AddAction").'</a>';
}
else
{
print '<a class="butActionRefused classfortooltip" href="#">'.$langs->trans("AddAction").'</a>';
}
}
print '</div>';
if (! empty($conf->agenda->enabled) && (!empty($user->rights->agenda->myactions->read) || !empty($user->rights->agenda->allactions->read) ))
{
$param='&socid='.$socid;
if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.$contextpage;
if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.$limit;
//print load_fiche_titre($langs->trans("ActionsOnBom"), '', '');
// List of all actions
$filters=array();
$filters['search_agenda_label']=$search_agenda_label;
// TODO Replace this with same code than into list.php
//show_actions_done($conf,$langs,$db,$object,null,0,$actioncode, '', $filters, $sortfield, $sortorder);
}
}
// End of page
llxFooter();
$db->close();

View File

@ -310,7 +310,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
print '<table class="border centpercent">'."\n"; print '<table class="border centpercent">'."\n";
// Common attributes // Common attributes
//$keyforbreak='fieldkeytoswithonsecondcolumn'; $keyforbreak='description';
include DOL_DOCUMENT_ROOT . '/core/tpl/commonfields_view.tpl.php'; include DOL_DOCUMENT_ROOT . '/core/tpl/commonfields_view.tpl.php';
// Other attributes // Other attributes
@ -325,6 +325,62 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
dol_fiche_end(); dol_fiche_end();
/*
* Lines
*/
if (! empty($object->table_element_line))
{
// Show object lines
$result = $object->getLinesArray();
print ' <form name="addproduct" id="addproduct" action="' . $_SERVER["PHP_SELF"] . '?id=' . $object->id . (($action != 'editline') ? '#addline' : '#line_' . GETPOST('lineid', 'int')) . '" method="POST">
<input type="hidden" name="token" value="' . $_SESSION ['newtoken'] . '">
<input type="hidden" name="action" value="' . (($action != 'editline') ? 'addline' : 'updateline') . '">
<input type="hidden" name="mode" value="">
<input type="hidden" name="id" value="' . $object->id . '">
';
if (! empty($conf->use_javascript_ajax) && $object->status == 0) {
include DOL_DOCUMENT_ROOT . '/core/tpl/ajaxrow.tpl.php';
}
print '<div class="div-table-responsive-no-min">';
if (! empty($object->lines) && $object->status == 0 && $permissiontoadd && $action != 'selectlines' && $action != 'editline')
{
print '<table id="tablelines" class="noborder noshadow" width="100%">';
}
if (! empty($object->lines))
{
// $ret = $object->printObjectLines($action, $mysoc, $soc, $lineid, 1);
}
// Form to add new line
if ($object->status == 0 && $permissiontoadd && $action != 'selectlines')
{
if ($action != 'editline')
{
// Add products/services form
// $object->formAddObjectLine(1, $mysoc, $soc);
$parameters = array();
$reshook = $hookmanager->executeHooks('formAddObjectLine', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
}
}
if (! empty($object->lines) && $object->status == 0 && $permissiontoadd && $action != 'selectlines' && $action != 'editline')
{
print '</table>';
}
print '</div>';
print "</form>\n";
}
// Buttons for actions // Buttons for actions
if ($action != 'presend' && $action != 'editline') { if ($action != 'presend' && $action != 'editline') {
print '<div class="tabsAction">'."\n"; print '<div class="tabsAction">'."\n";

View File

@ -132,10 +132,8 @@ if ($object->id)
dol_fiche_end(); dol_fiche_end();
$modulepart = 'bom'; $modulepart = 'bom';
//$permission = $user->rights->bom->create; $permission = $user->rights->bom->write;
$permission = 1; $permtoedit = $user->rights->bom->write;
//$permtoedit = $user->rights->bom->create;
$permtoedit = 1;
$param = '&id=' . $object->id; $param = '&id=' . $object->id;
//$relativepathwithnofile='bom/' . dol_sanitizeFileName($object->id).'/'; //$relativepathwithnofile='bom/' . dol_sanitizeFileName($object->id).'/';

View File

@ -387,7 +387,7 @@ $parameters=array('arrayfields'=>$arrayfields);
$reshook=$hookmanager->executeHooks('printFieldListOption', $parameters, $object); // Note that $action and $object may have been modified by hook $reshook=$hookmanager->executeHooks('printFieldListOption', $parameters, $object); // Note that $action and $object may have been modified by hook
print $hookmanager->resPrint; print $hookmanager->resPrint;
// Action column // Action column
print '<td class="liste_titre right">'; print '<td class="liste_titre maxwidthsearch">';
$searchpicto=$form->showFilterButtons(); $searchpicto=$form->showFilterButtons();
print $searchpicto; print $searchpicto;
print '</td>'; print '</td>';

View File

@ -16,7 +16,7 @@
*/ */
/** /**
* \file class/bom.class.php * \file bom/class/bom.class.php
* \ingroup bom * \ingroup bom
* \brief This file is a CRUD class file for BOM (Create/Read/Update/Delete) * \brief This file is a CRUD class file for BOM (Create/Read/Update/Delete)
*/ */
@ -98,7 +98,7 @@ class BOM extends CommonObject
'note_private' => array('type'=>'html', 'label'=>'NotePrivate', 'enabled'=>1, 'visible'=>-1, 'position'=>62, 'notnull'=>-1,), 'note_private' => array('type'=>'html', 'label'=>'NotePrivate', 'enabled'=>1, 'visible'=>-1, 'position'=>62, 'notnull'=>-1,),
'date_creation' => array('type'=>'datetime', 'label'=>'DateCreation', 'enabled'=>1, 'visible'=>-2, 'position'=>500, 'notnull'=>1,), 'date_creation' => array('type'=>'datetime', 'label'=>'DateCreation', 'enabled'=>1, 'visible'=>-2, 'position'=>500, 'notnull'=>1,),
'tms' => array('type'=>'timestamp', 'label'=>'DateModification', 'enabled'=>1, 'visible'=>-2, 'position'=>501, 'notnull'=>1,), 'tms' => array('type'=>'timestamp', 'label'=>'DateModification', 'enabled'=>1, 'visible'=>-2, 'position'=>501, 'notnull'=>1,),
'date_valid' => array('type'=>'datetime', 'label'=>'DateValid', 'enabled'=>1, 'visible'=>-2, 'position'=>502, 'notnull'=>0,), 'date_valid' => array('type'=>'datetime', 'label'=>'DateValidation', 'enabled'=>1, 'visible'=>-2, 'position'=>502, 'notnull'=>0,),
'fk_user_creat' => array('type'=>'integer', 'label'=>'UserValidation', 'enabled'=>1, 'visible'=>-2, 'position'=>510, 'notnull'=>1, 'foreignkey'=>'llx_user.rowid',), 'fk_user_creat' => array('type'=>'integer', 'label'=>'UserValidation', 'enabled'=>1, 'visible'=>-2, 'position'=>510, 'notnull'=>1, 'foreignkey'=>'llx_user.rowid',),
'fk_user_modif' => array('type'=>'integer', 'label'=>'UserModif', 'enabled'=>1, 'visible'=>-2, 'position'=>511, 'notnull'=>-1,), 'fk_user_modif' => array('type'=>'integer', 'label'=>'UserModif', 'enabled'=>1, 'visible'=>-2, 'position'=>511, 'notnull'=>-1,),
'fk_user_valid' => array('type'=>'integer', 'label'=>'UserValidation', 'enabled'=>1, 'visible'=>-2, 'position'=>512, 'notnull'=>0,), 'fk_user_valid' => array('type'=>'integer', 'label'=>'UserValidation', 'enabled'=>1, 'visible'=>-2, 'position'=>512, 'notnull'=>0,),
@ -850,6 +850,31 @@ class BOM extends CommonObject
} }
} }
/**
* Create an array of lines
*
* @return array|int array of lines if OK, <0 if KO
*/
public function getLinesArray()
{
$this->lines=array();
$objectline = new BOMLine($this->db);
$result = $objectline->fetchAll('', '', 0, 0, array('fk_bom'=>$this->id));
if (is_numeric($result))
{
$this->error = $this->error;
$this->errors = $this->errors;
return $result;
}
else
{
$this->lines = $result;
return $this->lines();
}
}
/** /**
* Initialise object with example values * Initialise object with example values
* Id must be 0 if object instance is a specimen * Id must be 0 if object instance is a specimen

View File

@ -82,12 +82,8 @@ $userstatic=new User($db);
llxHeader('', $langs->trans("ListOfBookmarks")); llxHeader('', $langs->trans("ListOfBookmarks"));
$newcardbutton=''; $newcardbutton='';
if ($user->rights->bookmark->creer) $newcardbutton.= dolGetButtonTitle($langs->trans('NewBookmark'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/bookmarks/card.php?action=create', '', !empty($user->rights->bookmark->creer));
{
$newcardbutton='<a class="butActionNew" href="'.DOL_URL_ROOT.'/bookmarks/card.php?action=create"><span class="valignmiddle text-plus-circle">'.$langs->trans('NewBookmark').'</span>';
$newcardbutton.= '<span class="fa fa-plus-circle valignmiddle"></span>';
$newcardbutton.= '</a>';
}
print_barre_liste($langs->trans("ListOfBookmarks"), $page, $_SERVER['PHP_SELF'], $param, $sortfield, $sortorder, '', -1, '', 'title_generic.png', 0, $newcardbutton); print_barre_liste($langs->trans("ListOfBookmarks"), $page, $_SERVER['PHP_SELF'], $param, $sortfield, $sortorder, '', -1, '', 'title_generic.png', 0, $newcardbutton);

View File

@ -65,9 +65,7 @@ $arrayofcss=array('/includes/jquery/plugins/jquerytreeview/jquery.treeview.css')
llxHeader('', $title, '', '', 0, 0, $arrayofjs, $arrayofcss); llxHeader('', $title, '', '', 0, 0, $arrayofjs, $arrayofcss);
$newcardbutton = '<a class="butActionNew" href="'.DOL_URL_ROOT.'/categories/card.php?action=create&type='.$type.'&backtopage='.urlencode($_SERVER["PHP_SELF"].'?type='.$type).'"><span class="valignmiddle text-plus-circle">'.$langs->trans("NewCategory").'</span>'; $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));
$newcardbutton.= '<span class="fa fa-plus-circle valignmiddle"></span>';
$newcardbutton.= '</a>';
print load_fiche_titre($title, $newcardbutton); print load_fiche_titre($title, $newcardbutton);

View File

@ -95,6 +95,20 @@ class ActionComm extends CommonObject
*/ */
public $datec; public $datec;
/**
* Date end record (datef)
*
* @var integer
*/
public $datef;
/**
* Duration (duree)
*
* @var integer
*/
public $duree;
/** /**
* Date modification record (tms) * Date modification record (tms)
* *

View File

@ -435,9 +435,7 @@ if ($resql)
//$param='month='.$monthshown.'&year='.$year; //$param='month='.$monthshown.'&year='.$year;
$hourminsec='100000'; $hourminsec='100000';
$newcardbutton = '<a class="butActionNew" href="'.DOL_URL_ROOT.'/comm/action/card.php?action=create&datep='.sprintf("%04d%02d%02d", $tmpforcreatebutton['year'], $tmpforcreatebutton['mon'], $tmpforcreatebutton['mday']).$hourminsec.'&backtopage='.urlencode($_SERVER["PHP_SELF"].($newparam?'?'.$newparam:'')).'"><span class="valignmiddle text-plus-circle">'.$langs->trans("AddAction").'</span>'; $newcardbutton.= dolGetButtonTitle($langs->trans('AddAction'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/comm/action/card.php?action=create&datep='.sprintf("%04d%02d%02d", $tmpforcreatebutton['year'], $tmpforcreatebutton['mon'], $tmpforcreatebutton['mday']).$hourminsec.'&backtopage='.urlencode($_SERVER["PHP_SELF"].($newparam?'?'.$newparam:'')));
$newcardbutton.= '<span class="fa fa-plus-circle valignmiddle"></span>';
$newcardbutton.= '</a>';
} }
print_barre_liste($s, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, -1 * $nbtotalofrecords, '', 0, $nav.$newcardbutton, '', $limit); print_barre_liste($s, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, -1 * $nbtotalofrecords, '', 0, $nav.$newcardbutton, '', $limit);

View File

@ -367,9 +367,7 @@ if ($user->rights->agenda->myactions->create || $user->rights->agenda->allaction
//$param='month='.$monthshown.'&year='.$year; //$param='month='.$monthshown.'&year='.$year;
$hourminsec='100000'; $hourminsec='100000';
$newcardbutton = '<a class="butActionNew" href="'.DOL_URL_ROOT.'/comm/action/card.php?action=create&datep='.sprintf("%04d%02d%02d", $tmpforcreatebutton['year'], $tmpforcreatebutton['mon'], $tmpforcreatebutton['mday']).$hourminsec.'&backtopage='.urlencode($_SERVER["PHP_SELF"].($newparam?'?'.$newparam:'')).'"><span class="valignmiddle text-plus-circle">'.$langs->trans("AddAction").'</span>'; $newcardbutton.= dolGetButtonTitle($langs->trans("AddAction"), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/comm/action/card.php?action=create&datep='.sprintf("%04d%02d%02d", $tmpforcreatebutton['year'], $tmpforcreatebutton['mon'], $tmpforcreatebutton['mday']).$hourminsec.'&backtopage='.urlencode($_SERVER["PHP_SELF"].($newparam?'?'.$newparam:'')));
$newcardbutton.= '<span class="fa fa-plus-circle valignmiddle"></span>';
$newcardbutton.= '</a>';
} }
$link=''; $link='';

View File

@ -505,7 +505,7 @@ if ($object->fetch($id) >= 0)
print $formmailing->selectDestinariesStatus($search_dest_status, 'search_dest_status', 1); print $formmailing->selectDestinariesStatus($search_dest_status, 'search_dest_status', 1);
print '</td>'; print '</td>';
// Action column // Action column
print '<td class="liste_titre right">'; print '<td class="liste_titre maxwidthsearch">';
$searchpicto=$form->showFilterAndCheckAddButtons($massactionbutton?1:0, 'checkforselect', 1); $searchpicto=$form->showFilterAndCheckAddButtons($massactionbutton?1:0, 'checkforselect', 1);
print $searchpicto; print $searchpicto;
print '</td>'; print '</td>';

View File

@ -156,9 +156,7 @@ if ($result)
$newcardbutton=''; $newcardbutton='';
if ($user->rights->mailing->creer) if ($user->rights->mailing->creer)
{ {
$newcardbutton='<a class="butActionNew" href="'.DOL_URL_ROOT.'/comm/mailing/card.php?action=create"><span class="valignmiddle text-plus-circle">'.$langs->trans('NewMailing').'</span>'; $newcardbutton.= dolGetButtonTitle($langs->trans('NewMailing'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/comm/mailing/card.php?action=create');
$newcardbutton.= '<span class="fa fa-plus-circle valignmiddle"></span>';
$newcardbutton.= '</a>';
} }
$i = 0; $i = 0;
@ -193,7 +191,7 @@ if ($result)
if (! $filteremail) print '<td class="liste_titre">&nbsp;</td>'; if (! $filteremail) print '<td class="liste_titre">&nbsp;</td>';
print '<td class="liste_titre">&nbsp;</td>'; print '<td class="liste_titre">&nbsp;</td>';
print '<td class="liste_titre">&nbsp;</td>'; print '<td class="liste_titre">&nbsp;</td>';
print '<td class="liste_titre right">'; print '<td class="liste_titre maxwidthsearch">';
$searchpicto=$form->showFilterAndCheckAddButtons(0); $searchpicto=$form->showFilterAndCheckAddButtons(0);
print $searchpicto; print $searchpicto;
print '</td>'; print '</td>';

View File

@ -2421,10 +2421,15 @@ $formquestion = array_merge($formquestion, array(
} }
print '<div class="div-table-responsive-no-min">'; print '<div class="div-table-responsive-no-min">';
if (! empty($object->lines) || ($object->statut == Propal::STATUS_DRAFT && $usercancreate && $action != 'selectlines' && $action != 'editline'))
{
print '<table id="tablelines" class="noborder noshadow" width="100%">'; print '<table id="tablelines" class="noborder noshadow" width="100%">';
}
if (! empty($object->lines)) if (! empty($object->lines))
{
$ret = $object->printObjectLines($action, $mysoc, $soc, $lineid, 1); $ret = $object->printObjectLines($action, $mysoc, $soc, $lineid, 1);
}
// Form to add new line // Form to add new line
if ($object->statut == Propal::STATUS_DRAFT && $usercancreate && $action != 'selectlines') if ($object->statut == Propal::STATUS_DRAFT && $usercancreate && $action != 'selectlines')
@ -2439,16 +2444,21 @@ $formquestion = array_merge($formquestion, array(
} }
} }
if (! empty($object->lines) || ($object->statut == Propal::STATUS_DRAFT && $usercancreate && $action != 'selectlines' && $action != 'editline'))
{
print '</table>'; print '</table>';
}
print '</div>'; print '</div>';
print "</form>\n"; print "</form>\n";
dol_fiche_end(); dol_fiche_end();
/* /*
* Boutons Actions * Button Actions
*/ */
if ($action != 'presend') { if ($action != 'presend') {
print '<div class="tabsAction">'; print '<div class="tabsAction">';

View File

@ -441,9 +441,7 @@ if ($resql)
$newcardbutton=''; $newcardbutton='';
if ($user->rights->propal->creer) if ($user->rights->propal->creer)
{ {
$newcardbutton='<a class="butActionNew" href="'.DOL_URL_ROOT.'/comm/propal/card.php?action=create"><span class="valignmiddle text-plus-circle">'.$langs->trans('NewPropal').'</span>'; $newcardbutton.= dolGetButtonTitle($langs->trans('NewPropal'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/comm/propal/card.php?action=create');
$newcardbutton.= '<span class="fa fa-plus-circle valignmiddle"></span>';
$newcardbutton.= '</a>';
} }
// Lignes des champs de filtre // Lignes des champs de filtre

View File

@ -1685,7 +1685,7 @@ class Commande extends CommonOrder
$sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_payment_term as cr ON c.fk_cond_reglement = cr.rowid'; $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_payment_term as cr ON c.fk_cond_reglement = cr.rowid';
$sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_paiement as p ON c.fk_mode_reglement = p.id'; $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_paiement as p ON c.fk_mode_reglement = p.id';
$sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_availability as ca ON c.fk_availability = ca.rowid'; $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_availability as ca ON c.fk_availability = ca.rowid';
$sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_input_reason as dr ON c.fk_input_reason = ca.rowid'; $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_input_reason as dr ON c.fk_input_reason = dr.rowid';
$sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_incoterms as i ON c.fk_incoterms = i.rowid'; $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_incoterms as i ON c.fk_incoterms = i.rowid';
if ($id) $sql.= " WHERE c.rowid=".$id; if ($id) $sql.= " WHERE c.rowid=".$id;

View File

@ -443,9 +443,7 @@ if ($resql)
$newcardbutton=''; $newcardbutton='';
if ($contextpage == 'orderlist' && $user->rights->commande->creer) if ($contextpage == 'orderlist' && $user->rights->commande->creer)
{ {
$newcardbutton='<a class="butActionNew" href="'.DOL_URL_ROOT.'/commande/card.php?action=create"><span class="valignmiddle text-plus-circle">'.$langs->trans('NewOrder').'</span>'; $newcardbutton.= dolGetButtonTitle($langs->trans('NewOrder'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/commande/card.php?action=create');
$newcardbutton.= '<span class="fa fa-plus-circle valignmiddle"></span>';
$newcardbutton.= '</a>';
} }
// Lines of title fields // Lines of title fields

View File

@ -756,34 +756,16 @@ if ($resql)
{ {
if (empty($conf->global->BANK_USE_OLD_VARIOUS_PAYMENT)) // If direct entries is done using miscellaneous payments if (empty($conf->global->BANK_USE_OLD_VARIOUS_PAYMENT)) // If direct entries is done using miscellaneous payments
{ {
if ($user->rights->banque->modifier) { $newcardbutton = dolGetButtonTitle($langs->trans('AddBankRecord'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/compta/bank/various_payment/card.php?action=create&accountid='.$search_account.'&backtopage='.urlencode($_SERVER['PHP_SELF'].'?id='.urlencode($search_account)), '', $user->rights->banque->modifier);
$newcardbutton = '<a class="butActionNew" href="'.DOL_URL_ROOT.'/compta/bank/various_payment/card.php?action=create&accountid='.$search_account.'&backtopage='.urlencode($_SERVER['PHP_SELF'].'?id='.urlencode($search_account)).'"><span class="valignmiddle text-plus-circle">'.$langs->trans("AddBankRecord").'</span>';
$newcardbutton.= '<span class="fa fa-plus-circle valignmiddle"></span>';
$newcardbutton.= '</a>';
} else {
$newcardbutton = '<a class="butActionNewRefused" title="'.$langs->trans("NotEnoughPermissions").'" href="#"><span class="valignmiddle text-plus-circle">'.$langs->trans("AddBankRecord").'</span>';
$newcardbutton.= '<span class="fa fa-plus-circle valignmiddle"></span>';
$newcardbutton.= '</a>';
}
} }
else // If direct entries is not done using miscellaneous payments else // If direct entries is not done using miscellaneous payments
{ {
if ($user->rights->banque->modifier) { $newcardbutton = dolGetButtonTitle($langs->trans('AddBankRecord'), '', 'fa fa-plus-circle', $_SERVER["PHP_SELF"].'?action=addline&page='.$page.$param, '', $user->rights->banque->modifier);
$newcardbutton = '<a class="butActionNew" href="'.$_SERVER["PHP_SELF"].'?action=addline&page='.$page.$param.'"><span class="valignmiddle text-plus-circle">'.$langs->trans("AddBankRecord").'</span>';
$newcardbutton.= '<span class="fa fa-plus-circle valignmiddle"></span>';
$newcardbutton.= '</a>';
} else {
$newcardbutton = '<a class="butActionNewRefused" title="'.$langs->trans("NotEnoughPermissions").'" href="#"><span class="valignmiddle text-plus-circle">'.$langs->trans("AddBankRecord").'</span>';
$newcardbutton.= '<span class="fa fa-plus-circle valignmiddle"></span>';
$newcardbutton.= '</a>';
}
} }
} }
else else
{ {
$newcardbutton = '<a class="butActionNewRefused" title="'.$langs->trans("FeatureDisabled").'" href="#"><span class="valignmiddle text-plus-circle">'.$langs->trans("AddBankRecord").'</span>'; $newcardbutton = dolGetButtonTitle($langs->trans('AddBankRecord'), '', 'fa fa-plus-circle', $_SERVER["PHP_SELF"].'?action=addline&page='.$page.$param, '', -1);
$newcardbutton.= '<span class="fa fa-plus-circle valignmiddle"></span>';
$newcardbutton.= '</a>';
} }
} }
@ -924,7 +906,7 @@ if ($resql)
} }
if (! empty($arrayfields['balance']['checked'])) if (! empty($arrayfields['balance']['checked']))
{ {
print '<td class="liste_titre right">'; print '<td class="liste_titre maxwidthsearch">';
$htmltext=$langs->trans("BalanceVisibilityDependsOnSortAndFilters", $langs->transnoentitiesnoconv("DateValue")); $htmltext=$langs->trans("BalanceVisibilityDependsOnSortAndFilters", $langs->transnoentitiesnoconv("DateValue"));
print $form->textwithpicto('', $htmltext, 1); print $form->textwithpicto('', $htmltext, 1);
print '</td>'; print '</td>';

View File

@ -227,9 +227,7 @@ $massactionbutton=$form->selectMassAction('', $arrayofmassactions);
$newcardbutton=''; $newcardbutton='';
if ($user->rights->banque->configurer) if ($user->rights->banque->configurer)
{ {
$newcardbutton.='<a class="butActionNew" href="card.php?action=create"><span class="valignmiddle text-plus-circle">'.$langs->trans("NewFinancialAccount").'</span>'; $newcardbutton.= dolGetButtonTitle($langs->trans('NewFinancialAccount'), '', 'fa fa-plus-circle', 'card.php?action=create');
$newcardbutton.= '<span class="fa fa-plus-circle valignmiddle"></span>';
$newcardbutton.= '</a>';
} }

View File

@ -223,7 +223,7 @@ if ($result)
// Credit // Credit
print '<td class="liste_titre right"><input name="search_amount_cred" class="flat" type="text" size="8" value="'.$search_amount_cred.'"></td>'; print '<td class="liste_titre right"><input name="search_amount_cred" class="flat" type="text" size="8" value="'.$search_amount_cred.'"></td>';
print '<td class="liste_titre right">'; print '<td class="liste_titre maxwidthsearch">';
$searchpicto=$form->showFilterAndCheckAddButtons(0); $searchpicto=$form->showFilterAndCheckAddButtons(0);
print $searchpicto; print $searchpicto;
print '</td>'; print '</td>';

View File

@ -402,7 +402,7 @@ $parameters=array('arrayfields'=>$arrayfields);
$reshook=$hookmanager->executeHooks('printFieldListOption', $parameters, $object); // Note that $action and $object may have been modified by hook $reshook=$hookmanager->executeHooks('printFieldListOption', $parameters, $object); // Note that $action and $object may have been modified by hook
print $hookmanager->resPrint; print $hookmanager->resPrint;
// Action column // Action column
print '<td class="liste_titre right">'; print '<td class="liste_titre maxwidthsearch">';
$searchpicto=$form->showFilterButtons(); $searchpicto=$form->showFilterButtons();
print $searchpicto; print $searchpicto;
print '</td>'; print '</td>';

View File

@ -41,7 +41,7 @@ include_once 'class/cashcontrol.class.php';
$cashcontrol= new CashControl($db); $cashcontrol= new CashControl($db);
$cashcontrol->fetch($id); $cashcontrol->fetch($id);
$limit = GETPOST('limit')?GETPOST('limit', 'int'):$conf->liste_limit; //$limit = GETPOST('limit')?GETPOST('limit', 'int'):$conf->liste_limit;
$sortorder='ASC'; $sortorder='ASC';
$sortfield='b.datev,b.dateo,b.rowid'; $sortfield='b.datev,b.dateo,b.rowid';
@ -152,7 +152,7 @@ if ($resql)
$cash=$bank=$cheque=$other=0; $cash=$bank=$cheque=$other=0;
$totalarray=array(); $totalarray=array();
while ($i < min($num, $limit)) while ($i < $num)
{ {
$objp = $db->fetch_object($resql); $objp = $db->fetch_object($resql);

View File

@ -153,7 +153,7 @@ if ($resql)
print '<td class="liste_titre right">'; print '<td class="liste_titre right">';
// print '<input class="flat" size="10" type="text" name="search_amount" value="'.$search_amount.'">'; // print '<input class="flat" size="10" type="text" name="search_amount" value="'.$search_amount.'">';
print '</td>'; print '</td>';
print '<td class="liste_titre right">'; print '<td class="liste_titre maxwidthsearch">';
$searchpicto=$form->showFilterAndCheckAddButtons(0); $searchpicto=$form->showFilterAndCheckAddButtons(0);
print $searchpicto; print $searchpicto;
print '</td>'; print '</td>';

View File

@ -73,10 +73,10 @@ class Invoices extends DolibarrApi
} }
// Get payment details // Get payment details
$this->invoice->totalpaye = $this->invoice->getSommePaiement(); $this->invoice->totalpaid = $this->invoice->getSommePaiement();
$this->invoice->totalcreditnotes = $this->invoice->getSumCreditNotesUsed(); $this->invoice->totalcreditnotes = $this->invoice->getSumCreditNotesUsed();
$this->invoice->totaldeposits = $this->invoice->getSumDepositsUsed(); $this->invoice->totaldeposits = $this->invoice->getSumDepositsUsed();
$this->invoice->resteapayer = price2num($this->invoice->total_ttc - $this->invoice->totalpaye - $this->invoice->totalcreditnotes - $this->invoice->totaldeposits, 'MT'); $this->invoice->remaintopay = price2num($this->invoice->total_ttc - $this->invoice->totalpaid - $this->invoice->totalcreditnotes - $this->invoice->totaldeposits, 'MT');
if (! DolibarrApi::_checkAccessToResource('facture', $this->invoice->id)) { if (! DolibarrApi::_checkAccessToResource('facture', $this->invoice->id)) {
throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login); throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login);

View File

@ -4627,7 +4627,7 @@ class FactureLigne extends CommonInvoiceLine
$sql.= " '".$this->db->escape($this->localtax1_type)."',"; $sql.= " '".$this->db->escape($this->localtax1_type)."',";
$sql.= " '".$this->db->escape($this->localtax2_type)."',"; $sql.= " '".$this->db->escape($this->localtax2_type)."',";
$sql.= ' '.(! empty($this->fk_product)?$this->fk_product:"null").','; $sql.= ' '.(! empty($this->fk_product)?$this->fk_product:"null").',';
$sql.= " ".$this->product_type.","; $sql.= " ".((int) $this->product_type).",";
$sql.= " ".price2num($this->remise_percent).","; $sql.= " ".price2num($this->remise_percent).",";
$sql.= " ".price2num($this->subprice).","; $sql.= " ".price2num($this->subprice).",";
$sql.= ' '.(! empty($this->fk_remise_except)?$this->fk_remise_except:"null").','; $sql.= ' '.(! empty($this->fk_remise_except)?$this->fk_remise_except:"null").',';

View File

@ -607,9 +607,7 @@ if ($resql)
$newcardbutton=''; $newcardbutton='';
if($user->rights->facture->creer) if($user->rights->facture->creer)
{ {
$newcardbutton='<a class="butActionNew" href="'.DOL_URL_ROOT.'/compta/facture/card.php?action=create"><span class="valignmiddle text-plus-circle">'.$langs->trans('NewBill').'</span>'; $newcardbutton.= dolGetButtonTitle($langs->trans('NewBill'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/compta/facture/card.php?action=create');
$newcardbutton.= '<span class="fa fa-plus-circle valignmiddle"></span>';
$newcardbutton.= '</a>';
} }
$i = 0; $i = 0;

View File

@ -45,9 +45,7 @@ $localtax_static = new Localtax($db);
$newcardbutton=''; $newcardbutton='';
if ($user->rights->tax->charges->creer) if ($user->rights->tax->charges->creer)
{ {
$newcardbutton='<a class="butActionNew" href="'.DOL_URL_ROOT.'/compta/localtax/card.php?action=create&localTaxType='.$ltt.'"><span class="valignmiddle text-plus-circle">'.$langs->trans('NewLocalTaxPayment', ($ltt+1)).'</span>'; $newcardbutton.= dolGetButtonTitle($langs->trans('NewLocalTaxPayment', ($ltt+1)), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/compta/localtax/card.php?action=create&localTaxType='.$ltt);
$newcardbutton.= '<span class="fa fa-plus-circle valignmiddle"></span>';
$newcardbutton.= '</a>';
} }
print load_fiche_titre($langs->transcountry($ltt==2?"LT2Payments":"LT1Payments", $mysoc->country_code), $newcardbutton); print load_fiche_titre($langs->transcountry($ltt==2?"LT2Payments":"LT1Payments", $mysoc->country_code), $newcardbutton);

View File

@ -138,9 +138,7 @@ if ($resql)
$newcardbutton=''; $newcardbutton='';
if ($user->rights->banque->cheque) if ($user->rights->banque->cheque)
{ {
$newcardbutton = '<a class="butActionNew" href="'.DOL_URL_ROOT.'/compta/paiement/cheque/card.php?action=new"><span class="valignmiddle text-plus-circle">'.$langs->trans('NewCheckDeposit').'</span>'; $newcardbutton.= dolGetButtonTitle($langs->trans('NewCheckDeposit'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/compta/paiement/cheque/card.php?action=new');
$newcardbutton.= '<span class="fa fa-plus-circle valignmiddle"></span>';
$newcardbutton.= '</a>';
} }
print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'">'; print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'">';
@ -177,7 +175,7 @@ if ($resql)
print '<input class="flat maxwidth50" type="text" name="search_amount" value="'.$search_amount.'">'; print '<input class="flat maxwidth50" type="text" name="search_amount" value="'.$search_amount.'">';
print '</td>'; print '</td>';
print '<td class="liste_titre"></td>'; print '<td class="liste_titre"></td>';
print '<td class="liste_titre right">'; print '<td class="liste_titre maxwidthsearch">';
$searchpicto=$form->showFilterAndCheckAddButtons(0); $searchpicto=$form->showFilterAndCheckAddButtons(0);
print $searchpicto; print $searchpicto;
print '</td>'; print '</td>';

View File

@ -255,7 +255,7 @@ if ($resql)
print '<td class="liste_titre right">'; print '<td class="liste_titre right">';
print '<input class="flat" type="text" size="4" name="search_amount" value="'.dol_escape_htmltag($search_amount).'">'; print '<input class="flat" type="text" size="4" name="search_amount" value="'.dol_escape_htmltag($search_amount).'">';
print '</td>'; print '</td>';
print '<td class="liste_titre right">'; print '<td class="liste_titre maxwidthsearch">';
$searchpicto=$form->showFilterAndCheckAddButtons(0); $searchpicto=$form->showFilterAndCheckAddButtons(0);
print $searchpicto; print $searchpicto;
print '</td>'; print '</td>';

View File

@ -108,9 +108,7 @@ if ($result)
$newcardbutton=''; $newcardbutton='';
if ($user->rights->prelevement->bons->creer) if ($user->rights->prelevement->bons->creer)
{ {
$newcardbutton = '<a class="butActionNew" href="'.DOL_URL_ROOT.'/compta/prelevement/create.php"><span class="valignmiddle text-plus-circle">'.$langs->trans('NewStandingOrder').'</span>'; $newcardbutton.= dolGetButtonTitle($langs->trans('NewStandingOrder'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/compta/prelevement/create.php');
$newcardbutton.= '<span class="fa fa-plus-circle valignmiddle"></span>';
$newcardbutton.= '</a>';
} }
// Lines of title fields // Lines of title fields
@ -136,7 +134,7 @@ if ($result)
print '<td class="liste_titre">&nbsp;</td>'; print '<td class="liste_titre">&nbsp;</td>';
print '<td class="liste_titre right"><input type="text" class="flat maxwidth100" name="search_amount" value="'. dol_escape_htmltag($search_amount).'"></td>'; print '<td class="liste_titre right"><input type="text" class="flat maxwidth100" name="search_amount" value="'. dol_escape_htmltag($search_amount).'"></td>';
print '<td class="liste_titre">&nbsp;</td>'; print '<td class="liste_titre">&nbsp;</td>';
print '<td class="liste_titre right">'; print '<td class="liste_titre maxwidthsearch">';
$searchpicto=$form->showFilterButtons(); $searchpicto=$form->showFilterButtons();
print $searchpicto; print $searchpicto;
print '</td>'; print '</td>';

View File

@ -146,7 +146,7 @@ if ($result)
print '<td class="liste_titre" align="center"><input type="text" class="flat" name="search_code" value="'. dol_escape_htmltag($search_code).'" size="6"></td>'; print '<td class="liste_titre" align="center"><input type="text" class="flat" name="search_code" value="'. dol_escape_htmltag($search_code).'" size="6"></td>';
print '<td class="liste_titre">&nbsp;</td>'; print '<td class="liste_titre">&nbsp;</td>';
print '<td class="liste_titre">&nbsp;</td>'; print '<td class="liste_titre">&nbsp;</td>';
print '<td class="liste_titre right">'; print '<td class="liste_titre maxwidthsearch">';
$searchpicto=$form->showFilterButtons(); $searchpicto=$form->showFilterButtons();
print $searchpicto; print $searchpicto;
print '</td>'; print '</td>';

View File

@ -196,7 +196,7 @@ if ($result)
// Amount // Amount
print '<td class="liste_titre right"><input name="search_amount" class="flat" type="text" size="8" value="'.$db->escape($search_amount).'"></td>'; print '<td class="liste_titre right"><input name="search_amount" class="flat" type="text" size="8" value="'.$db->escape($search_amount).'"></td>';
print '<td class="liste_titre right">'; print '<td class="liste_titre maxwidthsearch">';
$searchpicto=$form->showFilterAndCheckAddButtons(0); $searchpicto=$form->showFilterAndCheckAddButtons(0);
print $searchpicto; print $searchpicto;
print '</td>'; print '</td>';

View File

@ -236,7 +236,7 @@ if ($resql)
print $form->selectarray('search_status', $liststatus, $search_status, 1); print $form->selectarray('search_status', $liststatus, $search_status, 1);
print '</td>'; print '</td>';
print '<td class="liste_titre right">'; print '<td class="liste_titre maxwidthsearch">';
$searchpicto=$form->showFilterAndCheckAddButtons(0); $searchpicto=$form->showFilterAndCheckAddButtons(0);
print $searchpicto; print $searchpicto;
print '</td>'; print '</td>';

View File

@ -150,9 +150,7 @@ if ($result)
$newcardbutton=''; $newcardbutton='';
if ($user->rights->tax->charges->creer) if ($user->rights->tax->charges->creer)
{ {
$newcardbutton='<a class="butActionNew" href="'.DOL_URL_ROOT.'/compta/tva/card.php?action=create"><span class="valignmiddle text-plus-circle">'.$langs->trans('NewVATPayment').'</span>'; $newcardbutton.= dolGetButtonTitle($langs->trans('NewVATPayment', ($ltt+1)), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/compta/tva/card.php?action=create');
$newcardbutton.= '<span class="fa fa-plus-circle valignmiddle"></span>';
$newcardbutton.= '</a>';
} }
print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'">'; print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'">';
@ -189,7 +187,7 @@ if ($result)
print '</td>'; print '</td>';
} }
print '<td class="liste_titre right"><input name="search_amount" class="flat" type="text" size="8" value="'.$search_amount.'"></td>'; print '<td class="liste_titre right"><input name="search_amount" class="flat" type="text" size="8" value="'.$search_amount.'"></td>';
print '<td class="liste_titre right">'; print '<td class="liste_titre maxwidthsearch">';
$searchpicto=$form->showFilterAndCheckAddButtons(0); $searchpicto=$form->showFilterAndCheckAddButtons(0);
print $searchpicto; print $searchpicto;
print '</td>'; print '</td>';

View File

@ -261,9 +261,7 @@ else
{ {
if (! empty($user->rights->agenda->myactions->create) || ! empty($user->rights->agenda->allactions->create)) if (! empty($user->rights->agenda->myactions->create) || ! empty($user->rights->agenda->allactions->create))
{ {
$newcardbutton.='<a class="butActionNew" href="'.DOL_URL_ROOT.'/comm/action/card.php?action=create'.$out.'"><span class="valignmiddle text-plus-circle">'.$langs->trans("AddAction").'</span>'; $newcardbutton.= dolGetButtonTitle($langs->trans('AddAction'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/comm/action/card.php?action=create'.$out);
$newcardbutton.= '<span class="fa fa-plus-circle valignmiddle"></span>';
$newcardbutton.= '</a>';
} }
} }

View File

@ -698,9 +698,9 @@ class Contact extends CommonObject
$langs->load("dict"); $langs->load("dict");
dol_syslog(get_class($this)."::fetch id=".$id, LOG_DEBUG); dol_syslog(get_class($this) . "::fetch id=" . $id . " ref_ext=" . $ref_ext . " email=" . $email, LOG_DEBUG);
if (empty($id) && empty($ref_ext)) if (empty($id) && empty($ref_ext) && empty($email))
{ {
$this->error='BadParameter'; $this->error='BadParameter';
return -1; return -1;

View File

@ -390,7 +390,7 @@ if ($sql_select)
print '</td>'; print '</td>';
print '<td class="liste_titre center">'; print '<td class="liste_titre center">';
print '</td>'; print '</td>';
print '<td class="liste_titre right">'; print '<td class="liste_titre maxwidthsearch">';
$searchpicto=$form->showFilterAndCheckAddButtons(0); $searchpicto=$form->showFilterAndCheckAddButtons(0);
print $searchpicto; print $searchpicto;
print '</td>'; print '</td>';

View File

@ -455,9 +455,7 @@ $massactionbutton=$form->selectMassAction('', $arrayofmassactions);
$newcardbutton=''; $newcardbutton='';
if ($user->rights->societe->contact->creer) if ($user->rights->societe->contact->creer)
{ {
$newcardbutton='<a class="butActionNew" href="'.DOL_URL_ROOT.'/contact/card.php?action=create"><span class="valignmiddle text-plus-circle">'.$langs->trans('NewContactAddress').'</span>'; $newcardbutton.= dolGetButtonTitle($langs->trans('NewContactAddress'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/contact/card.php?action=create');
$newcardbutton.= '<span class="fa fa-plus-circle valignmiddle"></span>';
$newcardbutton.= '</a>';
} }
print '<form method="post" action="'.$_SERVER["PHP_SELF"].'" name="formfilter">'; print '<form method="post" action="'.$_SERVER["PHP_SELF"].'" name="formfilter">';
@ -695,8 +693,8 @@ if (! empty($arrayfields['p.import_key']['checked']))
print '</td>'; print '</td>';
} }
// Action column // Action column
print '<td class="liste_titre right">'; print '<td class="liste_titre maxwidthsearch">';
$searchpicto=$form->showFilterButtons(); $searchpicto=$form->showFilterAndCheckAddButtons(0);
print $searchpicto; print $searchpicto;
print '</td>'; print '</td>';
@ -785,7 +783,7 @@ while ($i < min($num, $limit))
// Name // Name
if (! empty($arrayfields['p.lastname']['checked'])) if (! empty($arrayfields['p.lastname']['checked']))
{ {
print '<td valign="middle">'; print '<td class="middle tdoverflowmax200">';
print $contactstatic->getNomUrl(1, '', 0); print $contactstatic->getNomUrl(1, '', 0);
print '</td>'; print '</td>';
if (! $i) $totalarray['nbfield']++; if (! $i) $totalarray['nbfield']++;
@ -793,7 +791,7 @@ while ($i < min($num, $limit))
// Firstname // Firstname
if (! empty($arrayfields['p.firstname']['checked'])) if (! empty($arrayfields['p.firstname']['checked']))
{ {
print '<td>'.$obj->firstname.'</td>'; print '<td class="tdoverflowmax200">'.$obj->firstname.'</td>';
if (! $i) $totalarray['nbfield']++; if (! $i) $totalarray['nbfield']++;
} }
// Job position // Job position

View File

@ -376,9 +376,7 @@ $massactionbutton=$form->selectMassAction('', $arrayofmassactions);
$newcardbutton=''; $newcardbutton='';
if ($user->rights->contrat->creer) if ($user->rights->contrat->creer)
{ {
$newcardbutton='<a class="butActionNew" href="'.DOL_URL_ROOT.'/contrat/card.php?action=create"><span class="valignmiddle text-plus-circle">'.$langs->trans('NewContractSubscription').'</span>'; $newcardbutton.= dolGetButtonTitle($langs->trans('NewContractSubscription'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/contrat/card.php?action=create');
$newcardbutton.= '<span class="fa fa-plus-circle valignmiddle"></span>';
$newcardbutton.= '</a>';
} }
print '<form method="POST" action="'.$_SERVER['PHP_SELF'].'">'; print '<form method="POST" action="'.$_SERVER['PHP_SELF'].'">';

View File

@ -524,7 +524,7 @@ if (! empty($arrayfields['status']['checked']))
print '</td>'; print '</td>';
} }
// Action column // Action column
print '<td class="liste_titre right">'; print '<td class="liste_titre maxwidthsearch">';
$searchpicto=$form->showFilterAndCheckAddButtons(0); $searchpicto=$form->showFilterAndCheckAddButtons(0);
print $searchpicto; print $searchpicto;
print '</td>'; print '</td>';

View File

@ -43,7 +43,7 @@ if (GETPOST('addfile', 'alpha'))
$vardir=$conf->user->dir_output."/".$user->id; $vardir=$conf->user->dir_output."/".$user->id;
$upload_dir_tmp = $vardir.'/temp'; // TODO Add $keytoavoidconflict in upload_dir path $upload_dir_tmp = $vardir.'/temp'; // TODO Add $keytoavoidconflict in upload_dir path
dol_add_file_process($upload_dir_tmp, 0, 0, 'addedfile', '', null, $trackid, 0); dol_add_file_process($upload_dir_tmp, 1, 0, 'addedfile', '', null, $trackid, 0);
$action='presend'; $action='presend';
} }

View File

@ -637,6 +637,10 @@ class Conf
$this->expensereport->payment = new stdClass(); $this->expensereport->payment = new stdClass();
$this->expensereport->payment->warning_delay=(isset($this->global->MAIN_DELAY_EXPENSEREPORTS_TO_PAY)?$this->global->MAIN_DELAY_EXPENSEREPORTS_TO_PAY:0)*24*60*60; $this->expensereport->payment->warning_delay=(isset($this->global->MAIN_DELAY_EXPENSEREPORTS_TO_PAY)?$this->global->MAIN_DELAY_EXPENSEREPORTS_TO_PAY:0)*24*60*60;
} }
if (isset($this->holiday)) {
$this->holiday->approve = new stdClass();
$this->holiday->approve->warning_delay=(isset($this->global->MAIN_DELAY_HOLIDAYS)?$this->global->MAIN_DELAY_HOLIDAYS:0)*24*60*60;
}
if (! empty($this->global->PRODUIT_MULTIPRICES) && empty($this->global->PRODUIT_MULTIPRICES_LIMIT)) if (! empty($this->global->PRODUIT_MULTIPRICES) && empty($this->global->PRODUIT_MULTIPRICES_LIMIT))
{ {

View File

@ -205,9 +205,7 @@ class FormActions
$newcardbutton=''; $newcardbutton='';
if (! empty($conf->agenda->enabled)) if (! empty($conf->agenda->enabled))
{ {
$newcardbutton = '<a class="butActionNew" href="'.DOL_URL_ROOT.'/comm/action/card.php?action=create&datep='.dol_print_date(dol_now(), 'dayhourlog').'&origin='.$typeelement.'&originid='.$object->id.($object->socid>0?'&socid='.$object->socid:($socid>0?'&socid='.$socid:'')).($projectid>0?'&projectid='.$projectid:'').'&backtopage='.urlencode($urlbacktopage).'"><span class="valignmiddle text-plus-circle">'.$langs->trans("AddEvent").'</span>'; $newcardbutton.= dolGetButtonTitle($langs->trans("AddEvent"), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/comm/action/card.php?action=create&datep='.dol_print_date(dol_now(), 'dayhourlog').'&origin='.$typeelement.'&originid='.$object->id.($object->socid>0?'&socid='.$object->socid:($socid>0?'&socid='.$socid:'')).($projectid>0?'&projectid='.$projectid:'').'&backtopage='.urlencode($urlbacktopage));
$newcardbutton.= '<span class="fa fa-plus-circle valignmiddle"></span>';
$newcardbutton.= '</a>';
} }
print '<!-- formactions->showactions -->'."\n"; print '<!-- formactions->showactions -->'."\n";

View File

@ -1830,7 +1830,7 @@ class FormFile
print '<td class="center">' . dol_print_date($link->datea, "dayhour", "tzuser") . '</td>'; print '<td class="center">' . dol_print_date($link->datea, "dayhour", "tzuser") . '</td>';
print '<td class="center"></td>'; print '<td class="center"></td>';
print '<td class="right">'; print '<td class="right">';
print '<a href="' . $_SERVER['PHP_SELF'] . '?action=update&linkid=' . $link->id . $param . '" class="editfilelink" >' . img_edit() . '</a>'; // id= is included into $param print '<a href="' . $_SERVER['PHP_SELF'] . '?action=update&linkid=' . $link->id . $param . '" class="editfilelink reposition" >' . img_edit() . '</a>'; // id= is included into $param
if ($permtodelete) { if ($permtodelete) {
print ' &nbsp; <a href="'. $_SERVER['PHP_SELF'] .'?action=delete&linkid=' . $link->id . $param . '" class="deletefilelink">' . img_delete() . '</a>'; // id= is included into $param print ' &nbsp; <a href="'. $_SERVER['PHP_SELF'] .'?action=delete&linkid=' . $link->id . $param . '" class="deletefilelink">' . img_delete() . '</a>'; // id= is included into $param
} else { } else {

View File

@ -96,7 +96,7 @@ class FormMargin
$line->pa_ht = $line->subprice * (1 - ($line->remise_percent / 100)); $line->pa_ht = $line->subprice * (1 - ($line->remise_percent / 100));
} }
$pv = $line->qty * $line->subprice * (1 - $line->remise_percent / 100); $pv = $line->total_ht;
$pa_ht = ($pv < 0 ? - $line->pa_ht : $line->pa_ht); // We choosed to have line->pa_ht always positive in database, so we guess the correct sign $pa_ht = ($pv < 0 ? - $line->pa_ht : $line->pa_ht); // We choosed to have line->pa_ht always positive in database, so we guess the correct sign
$pa = $line->qty * $pa_ht; $pa = $line->qty * $pa_ht;

View File

@ -1044,9 +1044,9 @@ function unActivateModule($value, $requiredby = 1)
$result=$objMod->remove(); $result=$objMod->remove();
if ($result <= 0) $ret=$objMod->error; if ($result <= 0) $ret=$objMod->error;
} }
else else // We come here when we try to unactivate a module when module does not exists anymore in sources
{ {
//print $dir.$modFile; //print $dir.$modFile;exit;
// TODO Replace this after DolibarrModules is moved as abstract class with a try catch to show module we try to disable has not been found or could not be loaded // TODO Replace this after DolibarrModules is moved as abstract class with a try catch to show module we try to disable has not been found or could not be loaded
include_once DOL_DOCUMENT_ROOT.'/core/modules/DolibarrModules.class.php'; include_once DOL_DOCUMENT_ROOT.'/core/modules/DolibarrModules.class.php';
$genericMod = new DolibarrModules($db); $genericMod = new DolibarrModules($db);
@ -1054,11 +1054,11 @@ function unActivateModule($value, $requiredby = 1)
$genericMod->rights_class=strtolower(preg_replace('/^mod/i', '', $modName)); $genericMod->rights_class=strtolower(preg_replace('/^mod/i', '', $modName));
$genericMod->const_name='MAIN_MODULE_'.strtoupper(preg_replace('/^mod/i', '', $modName)); $genericMod->const_name='MAIN_MODULE_'.strtoupper(preg_replace('/^mod/i', '', $modName));
dol_syslog("modules::unActivateModule Failed to find module file, we use generic function with name " . $modName); dol_syslog("modules::unActivateModule Failed to find module file, we use generic function with name " . $modName);
$genericMod->_remove(array()); $genericMod->remove('');
} }
// Desactivation des modules qui dependent de lui // Disable modules that depends on module we disable
if (! $ret && $requiredby) if (! $ret && $requiredby && is_object($objMod) && is_array($objMod->requiredby))
{ {
$countrb=count($objMod->requiredby); $countrb=count($objMod->requiredby);
for ($i = 0; $i < $countrb; $i++) for ($i = 0; $i < $countrb; $i++)

View File

@ -730,9 +730,7 @@ function show_projects($conf, $langs, $db, $object, $backtopage = '', $nocreatel
$newcardbutton=''; $newcardbutton='';
if (! empty($conf->projet->enabled) && $user->rights->projet->creer && empty($nocreatelink)) if (! empty($conf->projet->enabled) && $user->rights->projet->creer && empty($nocreatelink))
{ {
$newcardbutton='<a class="butActionNew" href="'.DOL_URL_ROOT.'/projet/card.php?socid='.$object->id.'&amp;action=create&amp;backtopage='.urlencode($backtopage).'"><span class="valignmiddle text-plus-circle">'.$langs->trans("AddProject").'</span>'; $newcardbutton.= dolGetButtonTitle($langs->trans('AddProject'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/projet/card.php?socid='.$object->id.'&amp;action=create&amp;backtopage='.urlencode($backtopage));
$newcardbutton.= '<span class="fa fa-plus-circle valignmiddle"></span>';
$newcardbutton.= '</a>';
} }
print "\n"; print "\n";
@ -934,9 +932,7 @@ function show_contacts($conf, $langs, $db, $object, $backtopage = '')
if ($user->rights->societe->contact->creer) if ($user->rights->societe->contact->creer)
{ {
$addcontact = (! empty($conf->global->SOCIETE_ADDRESSES_MANAGEMENT) ? $langs->trans("AddContact") : $langs->trans("AddContactAddress")); $addcontact = (! empty($conf->global->SOCIETE_ADDRESSES_MANAGEMENT) ? $langs->trans("AddContact") : $langs->trans("AddContactAddress"));
$newcardbutton='<a class="butActionNew" href="'.DOL_URL_ROOT.'/contact/card.php?socid='.$object->id.'&amp;action=create&amp;backtopage='.urlencode($backtopage).'"><span class="valignmiddle text-plus-circle">'.$addcontact.'</span>'; $newcardbutton.= dolGetButtonTitle($addcontact, '', 'fa fa-plus-circle', DOL_URL_ROOT.'/contact/card.php?socid='.$object->id.'&amp;action=create&amp;backtopage='.urlencode($backtopage));
$newcardbutton.= '<span class="fa fa-plus-circle valignmiddle"></span>';
$newcardbutton.= '</a>';
} }
print "\n"; print "\n";

View File

@ -8017,6 +8017,8 @@ function dolGetStatus($statusLabel = '', $statusLabelShort = '', $html = '', $st
{ {
global $conf; global $conf;
$return = '';
// image's filename are still in French // image's filename are still in French
$statusImg=array( $statusImg=array(
'status0' => 'statut0' 'status0' => 'statut0'
@ -8153,3 +8155,117 @@ function dolGetButtonAction($label, $html = '', $actionType = 'default', $url =
return '<div class="inline-block divButAction"><'.$tag.' '.$compiledAttributes.'>'.$html.'</'.$tag.'></div>'; return '<div class="inline-block divButAction"><'.$tag.' '.$compiledAttributes.'>'.$html.'</'.$tag.'></div>';
} }
/**
* Function dolGetButtonTitle : this kind of buttons are used in title in list
*
* @param string $label label of button
* @param string $helpText optional : content for help tooltip
* @param string $iconClass class for icon element
* @param string $url the url for link
* @param string $id attribute id of button
* @param int $status 0 no user rights, 1 active, -1 Feature Disabled, -2 disable Other reason use helpText as tooltip
* @param array $params various params for future : recommended rather than adding more function arguments
* @return string html button
*/
function dolGetButtonTitle($label, $helpText = '', $iconClass = 'fa fa-file', $url = '', $id = '', $status = 1, $params = array())
{
global $langs, $conf, $user;
// Actually this conf is used in css too for external module compatibility and smooth transition to this function
if (! empty($conf->global->MAIN_BUTTON_HIDE_UNAUTHORIZED) && (! $user->admin) && $status <= 0) {
return '';
}
$class = 'btnTitle' ;
// hidden conf keep during button transition TODO: remove this block
if(empty($conf->global->MAIN_USE_NEW_TITLE_BUTTON)){
$class = 'butActionNew';
}
$attr=array(
'class' => $class
,'href' => empty($url)?'':$url
);
if(!empty($helpText)){
$attr['title'] = dol_escape_htmltag($helpText);
}
if($status <= 0){
$attr['class'] .= ' refused';
// hidden conf keep during button transition TODO: remove this block
if(empty($conf->global->MAIN_USE_NEW_TITLE_BUTTON)){
$attr['class'] = 'butActionNewRefused';
}
$attr['href'] = '';
if($status == -1){ // Not enough permissions
$attr['title'] = dol_escape_htmltag($langs->transnoentitiesnoconv("FeatureDisabled"));
}
elseif($status == 0){ // disable
$attr['title'] = dol_escape_htmltag($langs->transnoentitiesnoconv("NotEnoughPermissions"));
}
}
if(!empty($attr['title'])){
$attr['class'] .= ' classfortooltip';
}
if(empty($id)){
$attr['id'] = $id;
}
// Override attr
if(!empty($params['attr']) && is_array($params['attr'])){
foreach($params['attr'] as $key => $value){
if($key == 'class'){
$attr['class'].= ' '.$value;
}
elseif($key == 'classOverride'){
$attr['class'] = $value;
}
else{
$attr[$key] = $value;
}
}
}
if(isset($attr['href']) && empty($attr['href'])){
unset($attr['href']);
}
// TODO : add a hook
// escape all attribute
$attr = array_map('dol_escape_htmltag', $attr);
$TCompiledAttr = array();
foreach($attr as $key => $value){
$TCompiledAttr[] = $key.'="'.$value.'"';
}
$compiledAttributes = !empty($TCompiledAttr)?implode(' ', $TCompiledAttr):'';
$tag = !empty($attr['href'])?'a':'span';
$button ='<'.$tag.' '.$compiledAttributes.' >';
$button.= '<span class="'.$iconClass.' valignmiddle btnTitle-icon"></span>';
$button.= '<span class="valignmiddle text-plus-circle btnTitle-label">'.$label.'</span>';
$button.= '</'.$tag.'>';
// hidden conf keep during button transition TODO: remove this block
if(empty($conf->global->MAIN_USE_NEW_TITLE_BUTTON)){
$button='<'.$tag.' '.$compiledAttributes.' ><span class="text-plus-circle">'.$label.'</span>';
$button.= '<span class="'.$iconClass.' valignmiddle"></span>';
$button.= '</'.$tag.'>';
}
return $button;
}

View File

@ -1282,6 +1282,10 @@ function check_value($mask, $value)
if (! empty($reg[3]) && preg_match('/^@/', $reg[3])) $maskraz=preg_replace('/^@/', '', $reg[3]); if (! empty($reg[3]) && preg_match('/^@/', $reg[3])) $maskraz=preg_replace('/^@/', '', $reg[3]);
if ($maskraz >= 0) if ($maskraz >= 0)
{ {
if ($maskraz == 99) {
$maskraz = date('m');
$resetEveryMonth = true;
}
if ($maskraz > 12) return 'ErrorBadMaskBadRazMonth'; if ($maskraz > 12) return 'ErrorBadMaskBadRazMonth';
// Define reg // Define reg

View File

@ -1374,6 +1374,7 @@ function pdf_getlinedesc($object, $i, $outputlangs, $hideref = 0, $hidedesc = 0,
if (! empty($object->lines[$i]->date_start) || ! empty($object->lines[$i]->date_end)) if (! empty($object->lines[$i]->date_start) || ! empty($object->lines[$i]->date_end))
{ {
$format='day'; $format='day';
$period = '';
// Show duration if exists // Show duration if exists
if ($object->lines[$i]->date_start && $object->lines[$i]->date_end) if ($object->lines[$i]->date_start && $object->lines[$i]->date_end)
{ {

View File

@ -145,8 +145,8 @@ function user_prepare_head($object)
if ((! empty($conf->salaries->enabled) && ! empty($user->rights->salaries->read)) if ((! empty($conf->salaries->enabled) && ! empty($user->rights->salaries->read))
|| (! empty($conf->hrm->enabled) && ! empty($user->rights->hrm->employee->read)) || (! empty($conf->hrm->enabled) && ! empty($user->rights->hrm->employee->read))
|| (! empty($conf->expensereport->enabled) && ! empty($user->rights->expensereport->lire) && $user->id == $object->id) || (! empty($conf->expensereport->enabled) && ! empty($user->rights->expensereport->lire) && ($user->id == $object->id || $user->rights->expensereport->readall))
|| (! empty($conf->holiday->enabled) && ! empty($user->rights->holiday->read) && $user->id == $object->id ) || (! empty($conf->holiday->enabled) && ! empty($user->rights->holiday->read) && ($user->id == $object->id || $user->rights->holiday->read_all))
) )
{ {
// Bank // Bank

View File

@ -1659,9 +1659,9 @@ function print_left_eldy_menu($db, $menu_array_before, $menu_array_after, &$tabM
{ {
$langs->load("hrm"); $langs->load("hrm");
$newmenu->add("/user/list.php?leftmenu=hrm&mode=employee", $langs->trans("Employees"), 0, $user->rights->hrm->employee->read, '', $mainmenu, 'hrm'); $newmenu->add("/user/list.php?mainmenu=hrm&leftmenu=hrm&mode=employee", $langs->trans("Employees"), 0, $user->rights->hrm->employee->read, '', $mainmenu, 'hrm');
$newmenu->add("/user/card.php?action=create&employee=1", $langs->trans("NewEmployee"), 1, $user->rights->hrm->employee->write); $newmenu->add("/user/card.php?mainmenu=hrm&leftmenu=hrm&action=create&employee=1", $langs->trans("NewEmployee"), 1, $user->rights->hrm->employee->write);
$newmenu->add("/user/list.php?leftmenu=hrm&mode=employee&contextpage=employeelist", $langs->trans("List"), 1, $user->rights->hrm->employee->read); $newmenu->add("/user/list.php?mainmenu=hrm&leftmenu=hrm&mode=employee&contextpage=employeelist", $langs->trans("List"), 1, $user->rights->hrm->employee->read);
} }
// Leave/Holiday/Vacation module // Leave/Holiday/Vacation module
@ -1670,19 +1670,19 @@ function print_left_eldy_menu($db, $menu_array_before, $menu_array_after, &$tabM
// Load translation files required by the page // Load translation files required by the page
$langs->loadLangs(array("holiday","trips")); $langs->loadLangs(array("holiday","trips"));
$newmenu->add("/holiday/list.php?leftmenu=hrm", $langs->trans("CPTitreMenu"), 0, $user->rights->holiday->read, '', $mainmenu, 'hrm'); $newmenu->add("/holiday/list.php?mainmenu=hrm&leftmenu=hrm", $langs->trans("CPTitreMenu"), 0, $user->rights->holiday->read, '', $mainmenu, 'hrm');
$newmenu->add("/holiday/card.php?action=request", $langs->trans("New"), 1, $user->rights->holiday->write); $newmenu->add("/holiday/card.php?mainmenu=hrm&leftmenu=holiday&action=request", $langs->trans("New"), 1, $user->rights->holiday->write);
$newmenu->add("/holiday/list.php?leftmenu=hrm", $langs->trans("List"), 1, $user->rights->holiday->read); $newmenu->add("/holiday/list.php?mainmenu=hrm&leftmenu=hrm", $langs->trans("List"), 1, $user->rights->holiday->read);
if ($usemenuhider || empty($leftmenu) || $leftmenu=="hrm") { if ($usemenuhider || empty($leftmenu) || $leftmenu=="hrm") {
$newmenu->add("/holiday/list.php?search_statut=1&leftmenu=hrm", $langs->trans("DraftCP"), 2, $user->rights->holiday->read); $newmenu->add("/holiday/list.php?search_statut=1&mainmenu=hrm&leftmenu=hrm", $langs->trans("DraftCP"), 2, $user->rights->holiday->read);
$newmenu->add("/holiday/list.php?search_statut=2&leftmenu=hrm", $langs->trans("ToReviewCP"), 2, $user->rights->holiday->read); $newmenu->add("/holiday/list.php?search_statut=2&mainmenu=hrm&leftmenu=hrm", $langs->trans("ToReviewCP"), 2, $user->rights->holiday->read);
$newmenu->add("/holiday/list.php?search_statut=3&leftmenu=hrm", $langs->trans("ApprovedCP"), 2, $user->rights->holiday->read); $newmenu->add("/holiday/list.php?search_statut=3&mainmenu=hrm&leftmenu=hrm", $langs->trans("ApprovedCP"), 2, $user->rights->holiday->read);
$newmenu->add("/holiday/list.php?search_statut=4&leftmenu=hrm", $langs->trans("CancelCP"), 2, $user->rights->holiday->read); $newmenu->add("/holiday/list.php?search_statut=4&mainmenu=hrm&leftmenu=hrm", $langs->trans("CancelCP"), 2, $user->rights->holiday->read);
$newmenu->add("/holiday/list.php?search_statut=5&leftmenu=hrm", $langs->trans("RefuseCP"), 2, $user->rights->holiday->read); $newmenu->add("/holiday/list.php?search_statut=5&mainmenu=hrm&leftmenu=hrm", $langs->trans("RefuseCP"), 2, $user->rights->holiday->read);
} }
$newmenu->add("/holiday/define_holiday.php?action=request", $langs->trans("MenuConfCP"), 1, $user->rights->holiday->read); $newmenu->add("/holiday/define_holiday.php?mainmenu=hrm&action=request", $langs->trans("MenuConfCP"), 1, $user->rights->holiday->read);
$newmenu->add("/holiday/month_report.php", $langs->trans("MenuReportMonth"), 1, $user->rights->holiday->read_all); $newmenu->add("/holiday/month_report.php?mainmenu=hrm&leftmenu=holiday", $langs->trans("MenuReportMonth"), 1, $user->rights->holiday->read_all);
$newmenu->add("/holiday/view_log.php?action=request", $langs->trans("MenuLogCP"), 1, $user->rights->holiday->define_holiday); $newmenu->add("/holiday/view_log.php?mainmenu=hrm&leftmenu=holiday&action=request", $langs->trans("MenuLogCP"), 1, $user->rights->holiday->define_holiday);
} }
// Trips and expenses (old module) // Trips and expenses (old module)

View File

@ -667,7 +667,7 @@ class DolibarrModules // Can not be abstract, because we need to instantiate it
array( array(
'doc/' => dol_buildpath(strtolower($this->name).'/doc/', 1), 'doc/' => dol_buildpath(strtolower($this->name).'/doc/', 1),
'img/' => dol_buildpath(strtolower($this->name).'/img/', 1), 'img/' => dol_buildpath(strtolower($this->name).'/img/', 1),
'images/' => dol_buildpath(strtolower($this->name).'/imgages/', 1), 'images/' => dol_buildpath(strtolower($this->name).'/images/', 1),
) )
); );
} }
@ -746,7 +746,7 @@ class DolibarrModules // Can not be abstract, because we need to instantiate it
$filefound= false; $filefound= false;
// Define path to file README.md. // Define path to file README.md.
// First check README-la_LA.md then README.md // First check ChangeLog-la_LA.md then ChangeLog.md
$pathoffile = dol_buildpath(strtolower($this->name).'/ChangeLog-'.$langs->defaultlang.'.md', 0); $pathoffile = dol_buildpath(strtolower($this->name).'/ChangeLog-'.$langs->defaultlang.'.md', 0);
if (dol_is_file($pathoffile)) { if (dol_is_file($pathoffile)) {
$filefound = true; $filefound = true;

View File

@ -301,7 +301,7 @@ class pdf_beluga extends ModelePDFProjects
'table'=>'commande', 'table'=>'commande',
'datefieldname'=>'date_commande', 'datefieldname'=>'date_commande',
'test'=>$conf->commande->enabled && $user->rights->commande->lire, 'test'=>$conf->commande->enabled && $user->rights->commande->lire,
'lang'=>'order'), 'lang'=>'orders'),
'invoice'=>array( 'invoice'=>array(
'name'=>"CustomersInvoices", 'name'=>"CustomersInvoices",
'title'=>"ListInvoicesAssociatedProject", 'title'=>"ListInvoicesAssociatedProject",

View File

@ -1810,7 +1810,6 @@ class pdf_cornas extends ModelePDFSuppliersOrders
global $hookmanager; global $hookmanager;
$parameters=array( $parameters=array(
'object' => $object,
'curY' =>& $curY, 'curY' =>& $curY,
'columnText' => $columnText, 'columnText' => $columnText,
'colKey' => $colKey 'colKey' => $colKey

View File

@ -48,7 +48,7 @@ foreach($object->fields as $key => $val)
$value=$object->$key; $value=$object->$key;
print '<tr><td'; print '<tr><td';
print ' class="titlefield'; print ' class="titlefield fieldname_'.$key;
//if ($val['notnull'] > 0) print ' fieldrequired'; // No fieldrequired on the view output //if ($val['notnull'] > 0) print ' fieldrequired'; // No fieldrequired on the view output
if ($val['type'] == 'text' || $val['type'] == 'html') print ' tdtop'; if ($val['type'] == 'text' || $val['type'] == 'html') print ' tdtop';
print '">'; print '">';
@ -65,9 +65,11 @@ foreach($object->fields as $key => $val)
} }
print '</table>'; print '</table>';
// We close div and reopen for second column
print '</div>'; print '</div>';
print '<div class="fichehalfright">'; print '<div class="fichehalfright">';
print '<div class="ficheaddleft">';
print '<div class="underbanner clearboth"></div>'; print '<div class="underbanner clearboth"></div>';
print '<table class="border centpercent">'; print '<table class="border centpercent">';
@ -87,7 +89,7 @@ foreach($object->fields as $key => $val)
$value=$object->$key; $value=$object->$key;
print '<tr><td'; print '<tr><td';
print ' class="titlefield'; print ' class="titlefield fieldname_'.$key;
if ($val['notnull'] > 0) print ' fieldrequired'; if ($val['notnull'] > 0) print ' fieldrequired';
if ($val['type'] == 'text' || $val['type'] == 'html') print ' tdtop'; if ($val['type'] == 'text' || $val['type'] == 'html') print ' tdtop';
print '">'; print '">';

View File

@ -155,7 +155,6 @@ if (empty($reshook) && is_array($extrafields->attributes[$object->table_element]
print '<input type="hidden" name="'.$fieldid.'" value="' . $object->id . '">'; print '<input type="hidden" name="'.$fieldid.'" value="' . $object->id . '">';
print $extrafields->showInputField($key, $value, '', '', '', 0, $object->id); print $extrafields->showInputField($key, $value, '', '', '', 0, $object->id);
print '<input type="submit" class="button" value="' . dol_escape_htmltag($langs->trans('Modify')) . '">'; print '<input type="submit" class="button" value="' . dol_escape_htmltag($langs->trans('Modify')) . '">';
print '</form>'; print '</form>';

View File

@ -342,18 +342,8 @@ print '<input type="hidden" name="viewstatut" value="'.$viewstatut.'">';
// Line with explanation and button new job // Line with explanation and button new job
$newcardbutton=''; $newcardbutton='';
if ($user->rights->cron->create) $newcardbutton.= dolGetButtonTitle($langs->trans('New'), $langs->trans('CronCreateJob'), 'fa fa-plus-circle', DOL_URL_ROOT.'/societe/card.php?action=create'.$typefilter, '', $user->rights->cron->create);
{
$newcardbutton.='<a class="butActionNew" style="margin-right: 0px;margin-left: 0px;" href="'.DOL_URL_ROOT.'/cron/card.php?action=create"><span class="valignmiddle text-plus-circle">'.$langs->trans("CronCreateJob").'</span>';
$newcardbutton.= '<span class="fa fa-plus-circle valignmiddle"></span>';
$newcardbutton.= '</a>';
}
else
{
$newcardbutton.='<a class="butActionNewRefused" href="#" title="'.dol_escape_htmltag($langs->transnoentitiesnoconv("NotEnoughPermissions")).'"><span class="valignmiddle text-plus-circle">'.$langs->trans("CronCreateJob").'</span>';
$newcardbutton.= '<span class="fa fa-plus-circle valignmiddle"></span>';
$newcardbutton.= '</a>';
}
print_barre_liste($pagetitle, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'title_setup', 0, $newcardbutton, '', $limit); print_barre_liste($pagetitle, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'title_setup', 0, $newcardbutton, '', $limit);

View File

@ -33,7 +33,7 @@ class DolibarrDebugBar extends DebugBar
//$this->addCollector(new PhpInfoCollector()); //$this->addCollector(new PhpInfoCollector());
//$this->addCollector(new DolMessagesCollector()); //$this->addCollector(new DolMessagesCollector());
$this->addCollector(new DolRequestDataCollector()); $this->addCollector(new DolRequestDataCollector());
$this->addCollector(new DolConfigCollector()); //$this->addCollector(new DolConfigCollector()); // Disabled for security purpose
$this->addCollector(new DolTimeDataCollector()); $this->addCollector(new DolTimeDataCollector());
$this->addCollector(new DolMemoryCollector()); $this->addCollector(new DolMemoryCollector());
//$this->addCollector(new DolExceptionsCollector()); //$this->addCollector(new DolExceptionsCollector());

View File

@ -142,9 +142,7 @@ if ($resql)
$newcardbutton=''; $newcardbutton='';
if ($user->rights->don->creer) if ($user->rights->don->creer)
{ {
$newcardbutton='<a class="butActionNew" href="'.DOL_URL_ROOT.'/don/card.php?action=create"><span class="valignmiddle text-plus-circle">'.$langs->trans('NewDonation').'</span>'; $newcardbutton.= dolGetButtonTitle($langs->trans('NewDonation'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/don/card.php?action=create');
$newcardbutton.= '<span class="fa fa-plus-circle valignmiddle"></span>';
$newcardbutton.= '</a>';
} }
print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'">'."\n"; print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'">'."\n";
@ -195,7 +193,7 @@ if ($resql)
} }
print '<td class="liste_titre right"><input name="search_amount" class="flat" type="text" size="8" value="'.$search_amount.'"></td>'; print '<td class="liste_titre right"><input name="search_amount" class="flat" type="text" size="8" value="'.$search_amount.'"></td>';
print '<td class="liste_titre right"></td>'; print '<td class="liste_titre right"></td>';
print '<td class="liste_titre right">'; print '<td class="liste_titre maxwidthsearch">';
$searchpicto=$form->showFilterAndCheckAddButtons(0); $searchpicto=$form->showFilterAndCheckAddButtons(0);
print $searchpicto; print $searchpicto;
print '</td>'; print '</td>';

View File

@ -1287,13 +1287,14 @@ class EmailCollector extends CommonObject
if (empty($contactid)) // Try to find contact using email if (empty($contactid)) // Try to find contact using email
{ {
$result = $contactstatic->fetch(0, null, '', $from); $result = $contactstatic->fetch(0, null, '', $from);
if ($result > 0) if ($result > 0)
{ {
$contactid = $contactstatic->id; $contactid = $contactstatic->id;
$contactfoundby = 'email of contact ('.$from.')'; $contactfoundby = 'email of contact ('.$from.')';
if ($contactstatic->fk_soc > 0) if ($contactstatic->socid > 0)
{ {
$result = $thirdpartystatic->fetch($contactstatic->fk_soc); $result = $thirdpartystatic->fetch($contactstatic->socid);
if ($result > 0) if ($result > 0)
{ {
$thirdpartyid = $thirdpartystatic->id; $thirdpartyid = $thirdpartystatic->id;
@ -1309,7 +1310,6 @@ class EmailCollector extends CommonObject
if ($result > 0) $thirdpartyfoundby = 'email ('.$from.')'; if ($result > 0) $thirdpartyfoundby = 'email ('.$from.')';
} }
// Do operations // Do operations
foreach($this->actions as $operation) foreach($this->actions as $operation)
{ {
@ -1492,7 +1492,6 @@ class EmailCollector extends CommonObject
// Insert record of emails sent // Insert record of emails sent
$actioncomm = new ActionComm($this->db); $actioncomm = new ActionComm($this->db);
$actioncomm->type_code = 'AC_OTH_AUTO'; // Type of event ('AC_OTH', 'AC_OTH_AUTO', 'AC_XXX'...) $actioncomm->type_code = 'AC_OTH_AUTO'; // Type of event ('AC_OTH', 'AC_OTH_AUTO', 'AC_XXX'...)
$actioncomm->code = 'AC_'.$actioncode; $actioncomm->code = 'AC_'.$actioncode;
$actioncomm->label = $langs->trans("ActionAC_".$actioncode).' - '.$langs->trans("MailFrom").' '.$from; $actioncomm->label = $langs->trans("ActionAC_".$actioncode).' - '.$langs->trans("MailFrom").' '.$from;
@ -1503,6 +1502,7 @@ class EmailCollector extends CommonObject
$actioncomm->percentage = -1; // Not applicable $actioncomm->percentage = -1; // Not applicable
$actioncomm->socid = $thirdpartystatic->id; $actioncomm->socid = $thirdpartystatic->id;
$actioncomm->contactid = $contactstatic->id; $actioncomm->contactid = $contactstatic->id;
$actioncomm->socpeopleassigned = (!empty($contactstatic->id) ? array($contactstatic->id => '') : array());
$actioncomm->authorid = $user->id; // User saving action $actioncomm->authorid = $user->id; // User saving action
$actioncomm->userownerid = $user->id; // Owner of action $actioncomm->userownerid = $user->id; // Owner of action
// Fields when action is an email (content should be added into note) // Fields when action is an email (content should be added into note)

View File

@ -280,9 +280,7 @@ if ($resql)
$newcardbutton=''; $newcardbutton='';
if ($user->rights->expedition->creer) if ($user->rights->expedition->creer)
{ {
$newcardbutton='<a class="butActionNew" href="'.DOL_URL_ROOT.'/expedition/card.php?action=create2"><span class="valignmiddle text-plus-circle">'.$langs->trans('NewSending').'</span>'; $newcardbutton.= dolGetButtonTitle($langs->trans('NewSending'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/expedition/card.php?action=create2');
$newcardbutton.= '<span class="fa fa-plus-circle valignmiddle"></span>';
$newcardbutton.= '</a>';
} }
$i = 0; $i = 0;

View File

@ -456,9 +456,7 @@ if ($resql)
$newcardbutton=''; $newcardbutton='';
if ($user->rights->expensereport->creer) if ($user->rights->expensereport->creer)
{ {
$newcardbutton='<a class="butActionNew" href="'.DOL_URL_ROOT.'/expensereport/card.php?action=create"><span class="valignmiddle text-plus-circle">'.$langs->trans('NewTrip').'</span>'; $newcardbutton.= dolGetButtonTitle($langs->trans('NewTrip'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/expensereport/card.php?action=create');
$newcardbutton.= '<span class="fa fa-plus-circle valignmiddle"></span>';
$newcardbutton.= '</a>';
} }
print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'title_generic.png', 0, $newcardbutton, '', $limit); print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'title_generic.png', 0, $newcardbutton, '', $limit);

View File

@ -50,14 +50,7 @@ print '<br>';
print '<div class="center">'; print '<div class="center">';
if (count($export->array_export_code)) if (count($export->array_export_code))
{ {
if ($user->rights->export->creer) print dolGetButtonTitle($langs->trans('NewExport'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/exports/export.php?leftmenu=export', '', $user->rights->export->creer);
{
print '<a class="butActionNew" href="'.DOL_URL_ROOT.'/exports/export.php?leftmenu=export"><span class="valignmiddle text-plus-circle">'.$langs->trans("NewExport").'</span><span class="fa fa-plus-circle valignmiddle"></span></a>';
}
else
{
print '<a class="butActionNewRefused" href="#" title="'.dol_escape_htmltag($langs->transnoentitiesnoconv("NotEnoughPermissions")).'"><span class="valignmiddle text-plus-circle">'.$langs->trans("NewExport").'</span><span class="fa fa-plus-circle valignmiddle"></span></a>';
}
} }
print '</div>'; print '</div>';
print '<br>'; print '<br>';

View File

@ -314,12 +314,7 @@ if ($resql)
$massactionbutton=$form->selectMassAction('', $arrayofmassactions); $massactionbutton=$form->selectMassAction('', $arrayofmassactions);
$newcardbutton=''; $newcardbutton='';
if ($user->rights->ficheinter->creer) $morehtmlcenter.= dolGetButtonTitle($langs->trans('NewIntervention'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/fichinter/card.php?action=create', '', $user->rights->ficheinter->creer);
{
$newcardbutton='<a class="butActionNew" href="'.DOL_URL_ROOT.'/fichinter/card.php?action=create"><span class="valignmiddle text-plus-circle">'.$langs->trans('NewIntervention').'</span>';
$newcardbutton.= '<span class="fa fa-plus-circle valignmiddle"></span>';
$newcardbutton.= '</a>';
}
// Lines of title fields // Lines of title fields
print '<form method="POST" id="searchFormList" action="'.$_SERVER["PHP_SELF"].'">'."\n"; print '<form method="POST" id="searchFormList" action="'.$_SERVER["PHP_SELF"].'">'."\n";
@ -438,7 +433,7 @@ if ($resql)
{ {
print '<td class="liste_titre">&nbsp;</td>'; print '<td class="liste_titre">&nbsp;</td>';
} }
print '<td class="liste_titre right">'; print '<td class="liste_titre maxwidthsearch">';
$searchpicto=$form->showFilterButtons(); $searchpicto=$form->showFilterButtons();
print $searchpicto; print $searchpicto;
print '</td>'; print '</td>';

View File

@ -632,9 +632,7 @@ if ($resql)
$newcardbutton=''; $newcardbutton='';
if($user->rights->fournisseur->commande->creer) if($user->rights->fournisseur->commande->creer)
{ {
$newcardbutton='<a class="butActionNew" href="'.DOL_URL_ROOT.'/fourn/commande/card.php?action=create"><span class="valignmiddle text-plus-circle">'.$langs->trans('NewOrder').'</span>'; $newcardbutton.= dolGetButtonTitle($langs->trans('NewOrder'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/fourn/commande/card.php?action=create');
$newcardbutton.= '<span class="fa fa-plus-circle valignmiddle"></span>';
$newcardbutton.= '</a>';
} }
// Lignes des champs de filtre // Lignes des champs de filtre

View File

@ -213,7 +213,7 @@ if ($user->rights->fournisseur->facture->lire)
print '</td><td class="liste_titre right">'; print '</td><td class="liste_titre right">';
print '<input class="flat" type="text" size="8" name="search_amount_all_tax" value="'.$search_amount_all_tax.'">'; print '<input class="flat" type="text" size="8" name="search_amount_all_tax" value="'.$search_amount_all_tax.'">';
print '</td>'; print '</td>';
print '<td class="liste_titre right">'; print '<td class="liste_titre maxwidthsearch">';
$searchpicto=$form->showFilterAndCheckAddButtons(0); $searchpicto=$form->showFilterAndCheckAddButtons(0);
print $searchpicto; print $searchpicto;
print '</td>'; print '</td>';

View File

@ -466,9 +466,7 @@ if ($resql)
$newcardbutton=''; $newcardbutton='';
if ($user->rights->fournisseur->facture->creer) if ($user->rights->fournisseur->facture->creer)
{ {
$newcardbutton='<a class="butActionNew" href="'.DOL_URL_ROOT.'/fourn/facture/card.php?action=create"><span class="valignmiddle text-plus-circle">'.$langs->trans('NewBill').'</span>'; $newcardbutton.= dolGetButtonTitle($langs->trans('NewBill'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/fourn/facture/card.php?action=create');
$newcardbutton.= '<span class="fa fa-plus-circle valignmiddle"></span>';
$newcardbutton.= '</a>';
} }
$i = 0; $i = 0;
@ -730,7 +728,7 @@ if ($resql)
} }
if (! empty($arrayfields['rtp']['checked'])) if (! empty($arrayfields['rtp']['checked']))
{ {
print '<td class="liste_titre right">'; print '<td class="liste_titre">';
print '</td>'; print '</td>';
} }
// Extra fields // Extra fields

View File

@ -944,7 +944,7 @@ if (empty($action) || $action == 'list')
print '<td class="liste_titre right">'; print '<td class="liste_titre right">';
print '<input class="flat" type="text" size="4" name="search_amount" value="'.dol_escape_htmltag($search_amount).'">'; print '<input class="flat" type="text" size="4" name="search_amount" value="'.dol_escape_htmltag($search_amount).'">';
print '</td>'; print '</td>';
print '<td class="liste_titre right">'; print '<td class="liste_titre maxwidthsearch">';
$searchpicto=$form->showFilterAndCheckAddButtons(0); $searchpicto=$form->showFilterAndCheckAddButtons(0);
print $searchpicto; print $searchpicto;
print '</td>'; print '</td>';

View File

@ -243,7 +243,7 @@ if ($resql)
print '<td></td>'; print '<td></td>';
print '<td></td>'; print '<td></td>';
print '<td></td>'; print '<td></td>';
print '<td class="liste_titre right">'; print '<td class="liste_titre maxwidthsearch">';
$searchpicto=$form->showFilterButtons(); $searchpicto=$form->showFilterButtons();
print $searchpicto; print $searchpicto;
print '</td>'; print '</td>';

View File

@ -877,6 +877,7 @@ if ((empty($id) && empty($ref)) || $action == 'add' || $action == 'request' || $
// Formulaire de demande // Formulaire de demande
print '<form method="POST" action="'.$_SERVER['PHP_SELF'].'" onsubmit="return valider()" name="demandeCP">'."\n"; print '<form method="POST" action="'.$_SERVER['PHP_SELF'].'" onsubmit="return valider()" name="demandeCP">'."\n";
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'" />'."\n";
print '<input type="hidden" name="action" value="create" />'."\n"; print '<input type="hidden" name="action" value="create" />'."\n";
if (empty($conf->global->HOLIDAY_HIDE_BALANCE)) if (empty($conf->global->HOLIDAY_HIDE_BALANCE))

View File

@ -2177,4 +2177,91 @@ class Holiday extends CommonObject
$this->fk_type=1; $this->fk_type=1;
$this->statut=Holiday::STATUS_VALIDATED; $this->statut=Holiday::STATUS_VALIDATED;
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/**
* Load this->nb for dashboard
*
* @return int <0 if KO, >0 if OK
*/
public function load_state_board()
{
// phpcs:enable
$this->nb=array();
$sql = "SELECT count(h.rowid) as nb";
$sql.= " FROM ".MAIN_DB_PREFIX."holiday as h";
$sql.= " WHERE h.statut > 1";
$sql.= " AND h.entity IN (".getEntity('holiday').")";
$resql=$this->db->query($sql);
if ($resql) {
while ($obj=$this->db->fetch_object($resql)) {
$this->nb["holidays"]=$obj->nb;
}
$this->db->free($resql);
return 1;
}
else
{
dol_print_error($this->db);
$this->error=$this->db->error();
return -1;
}
}
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/**
* Load indicators for dashboard (this->nbtodo and this->nbtodolate)
*
* @param User $user Objet user
* @return WorkboardResponse|int <0 if KO, WorkboardResponse if OK
*/
public function load_board($user)
{
// phpcs:enable
global $conf, $langs;
if ($user->societe_id) return -1; // protection pour eviter appel par utilisateur externe
$now=dol_now();
$userchildids = $user->getAllChildIds(1);
$sql = "SELECT h.rowid, h.date_debut";
$sql.= " FROM ".MAIN_DB_PREFIX."holiday as h";
$sql.= " WHERE h.statut = 2";
$sql.= " AND h.entity IN (".getEntity('holiday').")";
$sql.= " AND (h.fk_user IN (".join(',', $userchildids).")";
$sql.= " OR h.fk_validator IN (".join(',', $userchildids)."))";
$resql=$this->db->query($sql);
if ($resql)
{
$langs->load("members");
$response = new WorkboardResponse();
$response->warning_delay=$conf->holiday->approve->warning_delay/60/60/24;
$response->label=$langs->trans("HolidaysToApprove");
$response->url=DOL_URL_ROOT.'/holiday/list.php?search_statut=2&mainmenu=hrm&leftmenu=holiday';
$response->img=img_object('', "holiday");
while ($obj=$this->db->fetch_object($resql))
{
$response->nbtodo++;
if ($this->db->jdate($obj->date_debut) < ($now - $conf->holiday->approve->warning_delay)) {
$response->nbtodolate++;
}
}
return $response;
}
else
{
dol_print_error($this->db);
$this->error=$this->db->error();
return -1;
}
}
} }

View File

@ -271,7 +271,7 @@ else
print '<td class="liste_titre"></td>'; print '<td class="liste_titre"></td>';
// Action column // Action column
print '<td class="liste_titre right">'; print '<td class="liste_titre maxwidthsearch">';
$searchpicto=$form->showFilterButtons(); $searchpicto=$form->showFilterButtons();
print $searchpicto; print $searchpicto;
print '</td>'; print '</td>';

View File

@ -340,9 +340,7 @@ else
$newcardbutton=''; $newcardbutton='';
if ($user->rights->holiday->write) if ($user->rights->holiday->write)
{ {
$newcardbutton='<a class="butActionNew" href="'.DOL_URL_ROOT.'/holiday/card.php?action=request"><span class="valignmiddle text-plus-circle">'.$langs->trans('MenuAddCP').'</span>'; $newcardbutton.= dolGetButtonTitle($langs->trans('MenuAddCP'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/holiday/card.php?action=request');
$newcardbutton.= '<span class="fa fa-plus-circle valignmiddle"></span>';
$newcardbutton.= '</a>';
} }
print_barre_liste($langs->trans("ListeCP"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'title_hrm.png', 0, $newcardbutton, '', $limit); print_barre_liste($langs->trans("ListeCP"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'title_hrm.png', 0, $newcardbutton, '', $limit);
@ -462,7 +460,7 @@ $holiday->selectStatutCP($search_statut, 'search_statut');
print '</td>'; print '</td>';
// Actions // Actions
print '<td class="liste_titre right">'; print '<td class="liste_titre maxwidthsearch">';
$searchpicto=$form->showFilterAndCheckAddButtons(0); $searchpicto=$form->showFilterAndCheckAddButtons(0);
print $searchpicto; print $searchpicto;
print '</td>'; print '</td>';

View File

@ -193,7 +193,7 @@ print '<td class="liste_titre"></td>';
print '<td class="liste_titre"></td>'; print '<td class="liste_titre"></td>';
print '<td class="liste_titre"></td>'; print '<td class="liste_titre"></td>';
// Action column // Action column
print '<td class="liste_titre right">'; print '<td class="liste_titre maxwidthsearch">';
$searchpicto=$form->showFilterButtons(); $searchpicto=$form->showFilterButtons();
print $searchpicto; print $searchpicto;
print '</td>'; print '</td>';

View File

@ -92,7 +92,7 @@ if (count($import->array_import_code))
{ {
//if ($user->rights->import->run) //if ($user->rights->import->run)
//{ //{
print '<a class="butActionNew" href="'.DOL_URL_ROOT.'/imports/import.php?leftmenu=import"><span class="valignmiddle text-plus-circle">'.$langs->trans("NewImport").'</span><span class="fa fa-plus-circle valignmiddle"></span></a>'; print dolGetButtonTitle($langs->trans('NewImport'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/imports/import.php?leftmenu=import');
//} //}
//else //else
//{ //{

View File

@ -151,6 +151,7 @@ if (empty($user->societe_id))
! empty($conf->supplier_proposal->enabled) && $user->rights->supplier_proposal->lire && empty($conf->global->SOCIETE_DISABLE_SUPPLIERS_PROPOSAL_STATS), ! empty($conf->supplier_proposal->enabled) && $user->rights->supplier_proposal->lire && empty($conf->global->SOCIETE_DISABLE_SUPPLIERS_PROPOSAL_STATS),
! empty($conf->projet->enabled) && $user->rights->projet->lire, ! empty($conf->projet->enabled) && $user->rights->projet->lire,
! empty($conf->expensereport->enabled) && $user->rights->expensereport->lire, ! empty($conf->expensereport->enabled) && $user->rights->expensereport->lire,
! empty($conf->holiday->enabled) && $user->rights->holiday->read,
! empty($conf->don->enabled) && $user->rights->don->lire ! empty($conf->don->enabled) && $user->rights->don->lire
); );
// Class file containing the method load_state_board for each line // Class file containing the method load_state_board for each line
@ -173,6 +174,7 @@ if (empty($user->societe_id))
DOL_DOCUMENT_ROOT."/supplier_proposal/class/supplier_proposal.class.php", DOL_DOCUMENT_ROOT."/supplier_proposal/class/supplier_proposal.class.php",
DOL_DOCUMENT_ROOT."/projet/class/project.class.php", DOL_DOCUMENT_ROOT."/projet/class/project.class.php",
DOL_DOCUMENT_ROOT."/expensereport/class/expensereport.class.php", DOL_DOCUMENT_ROOT."/expensereport/class/expensereport.class.php",
DOL_DOCUMENT_ROOT."/holiday/class/holiday.class.php",
DOL_DOCUMENT_ROOT."/don/class/don.class.php" DOL_DOCUMENT_ROOT."/don/class/don.class.php"
); );
// Name class containing the method load_state_board for each line // Name class containing the method load_state_board for each line
@ -194,6 +196,7 @@ if (empty($user->societe_id))
'SupplierProposal', 'SupplierProposal',
'Project', 'Project',
'ExpenseReport', 'ExpenseReport',
'Holiday',
'Don' 'Don'
); );
// Cle array returned by the method load_state_board for each line // Cle array returned by the method load_state_board for each line
@ -215,6 +218,7 @@ if (empty($user->societe_id))
'askprice', 'askprice',
'projects', 'projects',
'expensereports', 'expensereports',
'holidays',
'donations' 'donations'
); );
// Dashboard Icon lines // Dashboard Icon lines
@ -236,6 +240,7 @@ if (empty($user->societe_id))
'propal', 'propal',
'projectpub', 'projectpub',
'trip', 'trip',
'holiday',
'generic' 'generic'
); );
// Translation keyword // Translation keyword
@ -257,6 +262,7 @@ if (empty($user->societe_id))
"SupplierProposalShort", "SupplierProposalShort",
"Projects", "Projects",
"ExpenseReports", "ExpenseReports",
"Holidays",
"Donations" "Donations"
); );
// Dashboard Link lines // Dashboard Link lines
@ -279,6 +285,7 @@ if (empty($user->societe_id))
DOL_URL_ROOT.'/supplier_proposal/list.php?mainmenu=commercial&leftmenu=', DOL_URL_ROOT.'/supplier_proposal/list.php?mainmenu=commercial&leftmenu=',
DOL_URL_ROOT.'/projet/list.php?mainmenu=project', DOL_URL_ROOT.'/projet/list.php?mainmenu=project',
DOL_URL_ROOT.'/expensereport/list.php?mainmenu=hrm&leftmenu=expensereport', DOL_URL_ROOT.'/expensereport/list.php?mainmenu=hrm&leftmenu=expensereport',
DOL_URL_ROOT.'/holiday/list.php?mainmenu=hrm&leftmenu=holiday',
DOL_URL_ROOT.'/don/list.php?leftmenu=donations' DOL_URL_ROOT.'/don/list.php?leftmenu=donations'
); );
// Translation lang files // Translation lang files
@ -300,6 +307,7 @@ if (empty($user->societe_id))
"supplier_proposal", "supplier_proposal",
"projects", "projects",
"trips", "trips",
"holidays",
"donations" "donations"
); );
@ -497,6 +505,14 @@ if (! empty($conf->expensereport->enabled) && $user->rights->expensereport->to_p
$dashboardlines[] = $board->load_board($user, 'topay'); $dashboardlines[] = $board->load_board($user, 'topay');
} }
// Number of holidays to approve
if (! empty($conf->holiday->enabled) && $user->rights->holiday->approve)
{
include_once DOL_DOCUMENT_ROOT.'/holiday/class/holiday.class.php';
$board=new Holiday($db);
$dashboardlines[] = $board->load_board($user);
}
$object=new stdClass(); $object=new stdClass();
$parameters=array(); $parameters=array();
$action=''; $action='';

View File

@ -92,3 +92,10 @@ INSERT INTO llx_c_type_contact (rowid, element, source, code, libelle, active, m
INSERT INTO llx_c_type_contact (rowid, element, source, code, libelle, active, module) VALUES(157, 'ticket', 'external', 'SUPPORTCLI', 'Contact client suivi incident', 1, NULL); INSERT INTO llx_c_type_contact (rowid, element, source, code, libelle, active, module) VALUES(157, 'ticket', 'external', 'SUPPORTCLI', 'Contact client suivi incident', 1, NULL);
INSERT INTO llx_c_type_contact (rowid, element, source, code, libelle, active, module) VALUES(158, 'ticket', 'external', 'CONTRIBUTOR', 'Intervenant', 1, NULL); INSERT INTO llx_c_type_contact (rowid, element, source, code, libelle, active, module) VALUES(158, 'ticket', 'external', 'CONTRIBUTOR', 'Intervenant', 1, NULL);
-- Supplier proposal
insert into llx_c_type_contact(rowid, element, source, code, libelle, active ) values (110, 'supplier_proposal', 'internal', 'SALESREPFOLL', 'Responsable suivi de la demande', 1);
insert into llx_c_type_contact(rowid, element, source, code, libelle, active ) values (111, 'supplier_proposal', 'external', 'BILLING', 'Contact fournisseur facturation', 1);
insert into llx_c_type_contact(rowid, element, source, code, libelle, active ) values (112, 'supplier_proposal', 'external', 'SHIPPING', 'Contact fournisseur livraison', 1);
insert into llx_c_type_contact(rowid, element, source, code, libelle, active ) values (113, 'supplier_proposal', 'external', 'SERVICE', 'Contact fournisseur prestation', 1);

View File

@ -369,3 +369,10 @@ ALTER TABLE llx_commande_fournisseur_dispatch ADD COLUMN fk_projet integer DEFAU
ALTER TABLE llx_commande_fournisseur_dispatch ADD COLUMN fk_reception integer DEFAULT NULL; ALTER TABLE llx_commande_fournisseur_dispatch ADD COLUMN fk_reception integer DEFAULT NULL;
insert into llx_c_type_contact(rowid, element, source, code, libelle, active ) values (110, 'supplier_proposal', 'internal', 'SALESREPFOLL', 'Responsable suivi de la demande', 1);
insert into llx_c_type_contact(rowid, element, source, code, libelle, active ) values (111, 'supplier_proposal', 'external', 'BILLING', 'Contact fournisseur facturation', 1);
insert into llx_c_type_contact(rowid, element, source, code, libelle, active ) values (112, 'supplier_proposal', 'external', 'SHIPPING', 'Contact fournisseur livraison', 1);
insert into llx_c_type_contact(rowid, element, source, code, libelle, active ) values (113, 'supplier_proposal', 'external', 'SERVICE', 'Contact fournisseur prestation', 1);
ALTER TABLE llx_ticket_extrafields ADD INDEX idx_ticket_extrafields (fk_object);

View File

@ -26,7 +26,7 @@ CREATE TABLE llx_asset(
note_public text, note_public text,
note_private text, note_private text,
date_creation datetime NOT NULL, date_creation datetime NOT NULL,
tms timestamp NOT NULL, tms timestamp,
fk_user_creat integer NOT NULL, fk_user_creat integer NOT NULL,
fk_user_modif integer, fk_user_modif integer,
import_key varchar(14), import_key varchar(14),

View File

@ -24,7 +24,7 @@ CREATE TABLE llx_bom_bom(
note_public text, note_public text,
note_private text, note_private text,
date_creation datetime NOT NULL, date_creation datetime NOT NULL,
tms timestamp NOT NULL, tms timestamp,
date_valid datetime, date_valid datetime,
fk_user_creat integer NOT NULL, fk_user_creat integer NOT NULL,
fk_user_modif integer, fk_user_modif integer,

View File

@ -34,7 +34,7 @@ CREATE TABLE llx_emailcollector_emailcollector(
note_public text, note_public text,
note_private text, note_private text,
date_creation datetime NOT NULL, date_creation datetime NOT NULL,
tms timestamp NOT NULL, tms timestamp,
fk_user_creat integer NOT NULL, fk_user_creat integer NOT NULL,
fk_user_modif integer, fk_user_modif integer,
import_key varchar(14), import_key varchar(14),

View File

@ -21,7 +21,7 @@ CREATE TABLE llx_emailcollector_emailcollectoraction(
type varchar(128) NOT NULL, type varchar(128) NOT NULL,
actionparam varchar(255) NULL, actionparam varchar(255) NULL,
date_creation datetime NOT NULL, date_creation datetime NOT NULL,
tms timestamp NOT NULL, tms timestamp,
fk_user_creat integer NOT NULL, fk_user_creat integer NOT NULL,
fk_user_modif integer, fk_user_modif integer,
position integer DEFAULT 0, position integer DEFAULT 0,

Some files were not shown because too many files have changed in this diff Show More