Merge remote-tracking branch 'Dolibarr/develop' into develop
This commit is contained in:
commit
2fea95f813
@ -112,6 +112,7 @@ NEW: When you create product or service, sell accountancy account by default is
|
||||
NEW: Widget birthdays of the month.
|
||||
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: Add mass action to close several members.
|
||||
|
||||
For Developers:
|
||||
NEW: Module "DebugBar" is available as a stable module.
|
||||
@ -121,7 +122,7 @@ NEW: Add constant XFRAMEOPTIONS_ALLOWALL
|
||||
NEW: Add function isValidVATID()
|
||||
NEW: ADD document's product support in APIs
|
||||
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: Add hook 'addHtmlHeader()'
|
||||
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.
|
||||
* 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.
|
||||
* Column llx_facture.facnumber change to llx_facture.ref
|
||||
|
||||
|
||||
***** ChangeLog for 9.0.3 compared to 9.0.2 *****
|
||||
|
||||
@ -247,11 +247,10 @@ if ($resql)
|
||||
print '<input type="hidden" name="page" value="'.$page.'">';
|
||||
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.= '<span class="fa fa-plus-circle valignmiddle"></span>';
|
||||
$newcardbutton.= '</a>';
|
||||
$newcardbutton.= dolGetButtonTitle($langs->trans("New"), $langs->trans("Addanaccount"), 'fa fa-plus-circle', './card.php?action=create');
|
||||
|
||||
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);
|
||||
|
||||
// Box to select active chart of account
|
||||
print $langs->trans("Selectchartofaccounts") . " : ";
|
||||
|
||||
@ -111,14 +111,9 @@ if ($result)
|
||||
|
||||
$i = 0;
|
||||
|
||||
if (! empty($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>';
|
||||
}
|
||||
|
||||
$addbutton.= dolGetButtonTitle($langs->trans('NewFiscalYear'), '', 'fa fa-plus-circle', 'fiscalyear_card.php?action=create', '', $user->rights->accounting->fiscalyear);
|
||||
|
||||
|
||||
$title = $langs->trans('AccountingPeriods');
|
||||
print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $params, $sortfield, $sortorder, '', $num, $nbtotalofrecords, 'title_accountancy', 0, $addbutton, '', $limit, 1);
|
||||
|
||||
@ -443,19 +443,18 @@ print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
|
||||
print '<input type="hidden" name="page" value="'.$page.'">';
|
||||
|
||||
$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");
|
||||
else $button.= $langs->trans("ExportList");
|
||||
//$button.=' ('.$listofformat[$conf->global->ACCOUNTING_EXPORT_MODELCSV].')';
|
||||
$button.= '</a>';
|
||||
|
||||
if (count($filter)) $buttonLabel = $langs->trans("ExportFilteredList");
|
||||
else $buttonLabel = $langs->trans("ExportList");
|
||||
|
||||
$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>';
|
||||
$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);
|
||||
print_barre_liste($title_page, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $result, $nbtotalofrecords, 'title_accountancy', 0, $newcardbutton, '', $limit);
|
||||
|
||||
$varpage=empty($contextpage)?$_SERVER["PHP_SELF"]:$contextpage;
|
||||
$selectedfields=$form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage); // This also change content of $arrayfields
|
||||
|
||||
@ -256,10 +256,8 @@ if ($action == 'delbookkeepingyear') {
|
||||
|
||||
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 = '<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>';
|
||||
$newcardbutton.= dolGetButtonTitle($langs->trans('ViewFlatList'), '', 'fa fa-list', DOL_URL_ROOT.'/accountancy/bookkeeping/list.php?'.$param);
|
||||
$newcardbutton.= dolGetButtonTitle($langs->trans('NewAccountingMvt'), '', 'fa fa-plus-circle', './card.php?action=create');
|
||||
|
||||
if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.urlencode($contextpage);
|
||||
if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.urlencode($limit);
|
||||
|
||||
@ -151,9 +151,7 @@ if ($object->id > 0)
|
||||
$newcardbutton = '';
|
||||
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.= '<span class="fa fa-plus-circle valignmiddle"></span>';
|
||||
$newcardbutton.= '</a>';
|
||||
$newcardbutton.= dolGetButtonTitle($langs->trans('AddAction'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/comm/action/card.php?action=create&backtopage=1&origin=member&originid='.$id);
|
||||
}
|
||||
|
||||
if (! empty($conf->agenda->enabled) && (!empty($user->rights->agenda->myactions->read) || !empty($user->rights->agenda->allactions->read) ))
|
||||
|
||||
@ -1567,7 +1567,7 @@ else
|
||||
$formquestion=array();
|
||||
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"]));
|
||||
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
|
||||
|
||||
@ -189,6 +189,42 @@ if (empty($reshook))
|
||||
$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
|
||||
$objectclass='Adherent';
|
||||
$objectlabel='Members';
|
||||
@ -326,12 +362,11 @@ if ($search_type > 0)
|
||||
}
|
||||
|
||||
$param='';
|
||||
if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.$contextpage;
|
||||
if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.$limit;
|
||||
if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.urlencode($contextpage);
|
||||
if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.urlencode($limit);
|
||||
if ($sall != "") $param.="&sall=".urlencode($sall);
|
||||
if ($statut != "") $param.="&statut=".urlencode($statut);
|
||||
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_firstname) $param.="&search_firstname=".urlencode($search_firstname);
|
||||
if ($search_lastname) $param.="&search_lastname=".urlencode($search_lastname);
|
||||
@ -358,6 +393,7 @@ $arrayofmassactions = array(
|
||||
//'presend'=>$langs->trans("SendByMail"),
|
||||
//'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 (in_array($massaction, array('presend','predelete'))) $arrayofmassactions=array();
|
||||
$massactionbutton=$form->selectMassAction('', $arrayofmassactions);
|
||||
@ -365,9 +401,7 @@ $massactionbutton=$form->selectMassAction('', $arrayofmassactions);
|
||||
$newcardbutton='';
|
||||
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.= '<span class="fa fa-plus-circle valignmiddle"></span>';
|
||||
$newcardbutton.= '</a>';
|
||||
$newcardbutton.= dolGetButtonTitle($langs->trans('NewMember'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/adherents/card.php?action=create');
|
||||
}
|
||||
|
||||
print '<form method="POST" id="searchFormList" action="'.$_SERVER["PHP_SELF"].'">';
|
||||
@ -457,7 +491,7 @@ if (! empty($arrayfields['d.lastname']['checked']))
|
||||
if (! empty($arrayfields['d.gender']['checked']))
|
||||
{
|
||||
print '<td class="liste_titre">';
|
||||
$arraygender=array('man'=>$langs->trans("Genderman"),'woman'=>$langs->trans("Genderwoman"));
|
||||
$arraygender=array('man'=>$langs->trans("Genderman"), 'woman'=>$langs->trans("Genderwoman"));
|
||||
print $form->selectarray('search_gender', $arraygender, $search_gender, 1);
|
||||
print '</td>';
|
||||
}
|
||||
|
||||
@ -247,9 +247,7 @@ $massactionbutton=$form->selectMassAction('', $arrayofmassactions);
|
||||
$newcardbutton='';
|
||||
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.= '<span class="fa fa-plus-circle valignmiddle"></span>';
|
||||
$newcardbutton.= '</a>';
|
||||
$newcardbutton.= dolGetButtonTitle($langs->trans('NewSubscription'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/adherents/list.php?status=-1,1');
|
||||
}
|
||||
|
||||
print '<form method="POST" id="searchFormList" action="'.$_SERVER["PHP_SELF"].'">';
|
||||
|
||||
@ -236,10 +236,8 @@ if (! $rowid && $action != 'create' && $action != 'edit')
|
||||
$newcardbutton='';
|
||||
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.= '<span class="fa fa-plus-circle valignmiddle"></span>';
|
||||
$newcardbutton.= '</a>';
|
||||
}
|
||||
$newcardbutton.= dolGetButtonTitle($langs->trans('NewMemberType'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/adherents/type.php?action=create');
|
||||
}
|
||||
|
||||
print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'">';
|
||||
if ($optioncss != '') print '<input type="hidden" name="optioncss" value="'.$optioncss.'">';
|
||||
|
||||
@ -322,9 +322,7 @@ print '<input type="hidden" name="contextpage" value="'.$contextpage.'">';
|
||||
$newcardbutton='';
|
||||
//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.= '<span class="fa fa-plus-circle valignmiddle"></span>';
|
||||
$newcardbutton.= '</a>';
|
||||
$newcardbutton.= dolGetButtonTitle($langs->trans('New'), '', 'fa fa-plus-circle', 'emailcollector_card.php?action=create&backtopage='.urlencode($_SERVER['PHP_SELF']));
|
||||
//}
|
||||
|
||||
print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'title_companies', 0, $newcardbutton, '', $limit);
|
||||
|
||||
@ -256,9 +256,7 @@ if ($action == 'delete')
|
||||
$newcardbutton='';
|
||||
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.= '<span class="fa fa-plus-circle valignmiddle"></span>';
|
||||
$newcardbutton.= '</a>';
|
||||
$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']));
|
||||
}
|
||||
|
||||
print '<form name="newmenu" class="nocellnopadd" action="'.$_SERVER["PHP_SELF"].'">';
|
||||
|
||||
261
htdocs/bom/bom_agenda.php
Normal file
261
htdocs/bom/bom_agenda.php
Normal 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&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.='&socid='.$objthirdparty->id;
|
||||
$out.=(! empty($objcon->id)?'&contactid='.$objcon->id:'').'&backtopage=1&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();
|
||||
@ -82,12 +82,8 @@ $userstatic=new User($db);
|
||||
llxHeader('', $langs->trans("ListOfBookmarks"));
|
||||
|
||||
$newcardbutton='';
|
||||
if ($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>';
|
||||
}
|
||||
$newcardbutton.= dolGetButtonTitle($langs->trans('NewBookmark'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/bookmarks/card.php?action=create', '', !empty($user->rights->bookmark->creer));
|
||||
|
||||
|
||||
print_barre_liste($langs->trans("ListOfBookmarks"), $page, $_SERVER['PHP_SELF'], $param, $sortfield, $sortorder, '', -1, '', 'title_generic.png', 0, $newcardbutton);
|
||||
|
||||
|
||||
@ -65,9 +65,7 @@ $arrayofcss=array('/includes/jquery/plugins/jquerytreeview/jquery.treeview.css')
|
||||
|
||||
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.= '<span class="fa fa-plus-circle valignmiddle"></span>';
|
||||
$newcardbutton.= '</a>';
|
||||
$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));
|
||||
|
||||
print load_fiche_titre($title, $newcardbutton);
|
||||
|
||||
|
||||
@ -95,6 +95,20 @@ class ActionComm extends CommonObject
|
||||
*/
|
||||
public $datec;
|
||||
|
||||
/**
|
||||
* Date end record (datef)
|
||||
*
|
||||
* @var integer
|
||||
*/
|
||||
public $datef;
|
||||
|
||||
/**
|
||||
* Duration (duree)
|
||||
*
|
||||
* @var integer
|
||||
*/
|
||||
public $duree;
|
||||
|
||||
/**
|
||||
* Date modification record (tms)
|
||||
*
|
||||
|
||||
@ -435,9 +435,7 @@ if ($resql)
|
||||
|
||||
//$param='month='.$monthshown.'&year='.$year;
|
||||
$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.= '<span class="fa fa-plus-circle valignmiddle"></span>';
|
||||
$newcardbutton.= '</a>';
|
||||
$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:'')));
|
||||
}
|
||||
|
||||
print_barre_liste($s, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, -1 * $nbtotalofrecords, '', 0, $nav.$newcardbutton, '', $limit);
|
||||
|
||||
@ -367,9 +367,7 @@ if ($user->rights->agenda->myactions->create || $user->rights->agenda->allaction
|
||||
|
||||
//$param='month='.$monthshown.'&year='.$year;
|
||||
$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.= '<span class="fa fa-plus-circle valignmiddle"></span>';
|
||||
$newcardbutton.= '</a>';
|
||||
$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:'')));
|
||||
}
|
||||
|
||||
$link='';
|
||||
|
||||
@ -156,9 +156,7 @@ if ($result)
|
||||
$newcardbutton='';
|
||||
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.= '<span class="fa fa-plus-circle valignmiddle"></span>';
|
||||
$newcardbutton.= '</a>';
|
||||
$newcardbutton.= dolGetButtonTitle($langs->trans('NewMailing'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/comm/mailing/card.php?action=create');
|
||||
}
|
||||
|
||||
$i = 0;
|
||||
|
||||
@ -441,10 +441,8 @@ if ($resql)
|
||||
$newcardbutton='';
|
||||
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.= '<span class="fa fa-plus-circle valignmiddle"></span>';
|
||||
$newcardbutton.= '</a>';
|
||||
}
|
||||
$newcardbutton.= dolGetButtonTitle($langs->trans('NewPropal'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/comm/propal/card.php?action=create');
|
||||
}
|
||||
|
||||
// Lignes des champs de filtre
|
||||
print '<form method="POST" id="searchFormList" action="'.$_SERVER["PHP_SELF"].'">';
|
||||
|
||||
@ -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_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_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';
|
||||
|
||||
if ($id) $sql.= " WHERE c.rowid=".$id;
|
||||
|
||||
@ -443,10 +443,8 @@ if ($resql)
|
||||
$newcardbutton='';
|
||||
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.= '<span class="fa fa-plus-circle valignmiddle"></span>';
|
||||
$newcardbutton.= '</a>';
|
||||
}
|
||||
$newcardbutton.= dolGetButtonTitle($langs->trans('NewOrder'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/commande/card.php?action=create');
|
||||
}
|
||||
|
||||
// Lines of title fields
|
||||
print '<form method="POST" id="searchFormList" action="'.$_SERVER["PHP_SELF"].'">';
|
||||
|
||||
@ -756,34 +756,16 @@ if ($resql)
|
||||
{
|
||||
if (empty($conf->global->BANK_USE_OLD_VARIOUS_PAYMENT)) // If direct entries is done using miscellaneous payments
|
||||
{
|
||||
if ($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>';
|
||||
}
|
||||
$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);
|
||||
}
|
||||
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 = '<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>';
|
||||
}
|
||||
$newcardbutton = dolGetButtonTitle($langs->trans('AddBankRecord'), '', 'fa fa-plus-circle', $_SERVER["PHP_SELF"].'?action=addline&page='.$page.$param, '', $user->rights->banque->modifier);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$newcardbutton = '<a class="butActionNewRefused" title="'.$langs->trans("FeatureDisabled").'" href="#"><span class="valignmiddle text-plus-circle">'.$langs->trans("AddBankRecord").'</span>';
|
||||
$newcardbutton.= '<span class="fa fa-plus-circle valignmiddle"></span>';
|
||||
$newcardbutton.= '</a>';
|
||||
$newcardbutton = dolGetButtonTitle($langs->trans('AddBankRecord'), '', 'fa fa-plus-circle', $_SERVER["PHP_SELF"].'?action=addline&page='.$page.$param, '', -1);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -227,9 +227,7 @@ $massactionbutton=$form->selectMassAction('', $arrayofmassactions);
|
||||
$newcardbutton='';
|
||||
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.= '<span class="fa fa-plus-circle valignmiddle"></span>';
|
||||
$newcardbutton.= '</a>';
|
||||
$newcardbutton.= dolGetButtonTitle($langs->trans('NewFinancialAccount'), '', 'fa fa-plus-circle', 'card.php?action=create');
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -73,10 +73,10 @@ class Invoices extends DolibarrApi
|
||||
}
|
||||
|
||||
// Get payment details
|
||||
$this->invoice->totalpaye = $this->invoice->getSommePaiement();
|
||||
$this->invoice->totalpaid = $this->invoice->getSommePaiement();
|
||||
$this->invoice->totalcreditnotes = $this->invoice->getSumCreditNotesUsed();
|
||||
$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)) {
|
||||
throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login);
|
||||
|
||||
@ -607,9 +607,7 @@ if ($resql)
|
||||
$newcardbutton='';
|
||||
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.= '<span class="fa fa-plus-circle valignmiddle"></span>';
|
||||
$newcardbutton.= '</a>';
|
||||
$newcardbutton.= dolGetButtonTitle($langs->trans('NewBill'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/compta/facture/card.php?action=create');
|
||||
}
|
||||
|
||||
$i = 0;
|
||||
|
||||
@ -45,9 +45,7 @@ $localtax_static = new Localtax($db);
|
||||
$newcardbutton='';
|
||||
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.= '<span class="fa fa-plus-circle valignmiddle"></span>';
|
||||
$newcardbutton.= '</a>';
|
||||
$newcardbutton.= dolGetButtonTitle($langs->trans('NewLocalTaxPayment', ($ltt+1)), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/compta/localtax/card.php?action=create&localTaxType='.$ltt);
|
||||
}
|
||||
|
||||
print load_fiche_titre($langs->transcountry($ltt==2?"LT2Payments":"LT1Payments", $mysoc->country_code), $newcardbutton);
|
||||
|
||||
@ -138,9 +138,7 @@ if ($resql)
|
||||
$newcardbutton='';
|
||||
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.= '<span class="fa fa-plus-circle valignmiddle"></span>';
|
||||
$newcardbutton.= '</a>';
|
||||
$newcardbutton.= dolGetButtonTitle($langs->trans('NewCheckDeposit'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/compta/paiement/cheque/card.php?action=new');
|
||||
}
|
||||
|
||||
print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'">';
|
||||
|
||||
@ -108,9 +108,7 @@ if ($result)
|
||||
$newcardbutton='';
|
||||
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.= '<span class="fa fa-plus-circle valignmiddle"></span>';
|
||||
$newcardbutton.= '</a>';
|
||||
$newcardbutton.= dolGetButtonTitle($langs->trans('NewStandingOrder'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/compta/prelevement/create.php');
|
||||
}
|
||||
|
||||
// Lines of title fields
|
||||
|
||||
@ -150,10 +150,8 @@ if ($result)
|
||||
$newcardbutton='';
|
||||
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.= '<span class="fa fa-plus-circle valignmiddle"></span>';
|
||||
$newcardbutton.= '</a>';
|
||||
}
|
||||
$newcardbutton.= dolGetButtonTitle($langs->trans('NewVATPayment', ($ltt+1)), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/compta/tva/card.php?action=create');
|
||||
}
|
||||
|
||||
print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'">';
|
||||
if ($optioncss != '') print '<input type="hidden" name="optioncss" value="'.$optioncss.'">';
|
||||
|
||||
@ -261,9 +261,7 @@ else
|
||||
{
|
||||
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.= '<span class="fa fa-plus-circle valignmiddle"></span>';
|
||||
$newcardbutton.= '</a>';
|
||||
$newcardbutton.= dolGetButtonTitle($langs->trans('AddAction'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/comm/action/card.php?action=create'.$out);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -698,9 +698,9 @@ class Contact extends CommonObject
|
||||
|
||||
$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';
|
||||
return -1;
|
||||
|
||||
@ -455,9 +455,7 @@ $massactionbutton=$form->selectMassAction('', $arrayofmassactions);
|
||||
$newcardbutton='';
|
||||
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.= '<span class="fa fa-plus-circle valignmiddle"></span>';
|
||||
$newcardbutton.= '</a>';
|
||||
$newcardbutton.= dolGetButtonTitle($langs->trans('NewContactAddress'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/contact/card.php?action=create');
|
||||
}
|
||||
|
||||
print '<form method="post" action="'.$_SERVER["PHP_SELF"].'" name="formfilter">';
|
||||
|
||||
@ -376,9 +376,7 @@ $massactionbutton=$form->selectMassAction('', $arrayofmassactions);
|
||||
$newcardbutton='';
|
||||
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.= '<span class="fa fa-plus-circle valignmiddle"></span>';
|
||||
$newcardbutton.= '</a>';
|
||||
$newcardbutton.= dolGetButtonTitle($langs->trans('NewContractSubscription'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/contrat/card.php?action=create');
|
||||
}
|
||||
|
||||
print '<form method="POST" action="'.$_SERVER['PHP_SELF'].'">';
|
||||
|
||||
@ -103,7 +103,7 @@ class Form
|
||||
* @return string HTML edit field
|
||||
*/
|
||||
public function editfieldkey($text, $htmlname, $preselected, $object, $perm, $typeofdata = 'string', $moreparam = '', $fieldrequired = 0, $notabletag = 0, $paramid = 'id')
|
||||
{
|
||||
{
|
||||
global $conf,$langs;
|
||||
|
||||
$ret='';
|
||||
@ -144,7 +144,7 @@ class Form
|
||||
}
|
||||
|
||||
return $ret;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Output value of a field for an editable field
|
||||
|
||||
@ -205,9 +205,7 @@ class FormActions
|
||||
$newcardbutton='';
|
||||
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.= '<span class="fa fa-plus-circle valignmiddle"></span>';
|
||||
$newcardbutton.= '</a>';
|
||||
$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));
|
||||
}
|
||||
|
||||
print '<!-- formactions->showactions -->'."\n";
|
||||
|
||||
@ -96,7 +96,7 @@ class FormMargin
|
||||
$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 = $line->qty * $pa_ht;
|
||||
|
||||
|
||||
@ -1044,9 +1044,9 @@ function unActivateModule($value, $requiredby = 1)
|
||||
$result=$objMod->remove();
|
||||
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
|
||||
include_once DOL_DOCUMENT_ROOT.'/core/modules/DolibarrModules.class.php';
|
||||
$genericMod = new DolibarrModules($db);
|
||||
@ -1054,11 +1054,11 @@ function unActivateModule($value, $requiredby = 1)
|
||||
$genericMod->rights_class=strtolower(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);
|
||||
$genericMod->_remove(array());
|
||||
$genericMod->remove('');
|
||||
}
|
||||
|
||||
// Desactivation des modules qui dependent de lui
|
||||
if (! $ret && $requiredby)
|
||||
// Disable modules that depends on module we disable
|
||||
if (! $ret && $requiredby && is_object($objMod) && is_array($objMod->requiredby))
|
||||
{
|
||||
$countrb=count($objMod->requiredby);
|
||||
for ($i = 0; $i < $countrb; $i++)
|
||||
|
||||
@ -730,9 +730,7 @@ function show_projects($conf, $langs, $db, $object, $backtopage = '', $nocreatel
|
||||
$newcardbutton='';
|
||||
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.'&action=create&backtopage='.urlencode($backtopage).'"><span class="valignmiddle text-plus-circle">'.$langs->trans("AddProject").'</span>';
|
||||
$newcardbutton.= '<span class="fa fa-plus-circle valignmiddle"></span>';
|
||||
$newcardbutton.= '</a>';
|
||||
$newcardbutton.= dolGetButtonTitle($langs->trans('AddProject'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/projet/card.php?socid='.$object->id.'&action=create&backtopage='.urlencode($backtopage));
|
||||
}
|
||||
|
||||
print "\n";
|
||||
@ -934,9 +932,7 @@ function show_contacts($conf, $langs, $db, $object, $backtopage = '')
|
||||
if ($user->rights->societe->contact->creer)
|
||||
{
|
||||
$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.'&action=create&backtopage='.urlencode($backtopage).'"><span class="valignmiddle text-plus-circle">'.$addcontact.'</span>';
|
||||
$newcardbutton.= '<span class="fa fa-plus-circle valignmiddle"></span>';
|
||||
$newcardbutton.= '</a>';
|
||||
$newcardbutton.= dolGetButtonTitle($addcontact, '', 'fa fa-plus-circle', DOL_URL_ROOT.'/contact/card.php?socid='.$object->id.'&action=create&backtopage='.urlencode($backtopage));
|
||||
}
|
||||
|
||||
print "\n";
|
||||
|
||||
@ -8017,6 +8017,8 @@ function dolGetStatus($statusLabel = '', $statusLabelShort = '', $html = '', $st
|
||||
{
|
||||
global $conf;
|
||||
|
||||
$return = '';
|
||||
|
||||
// image's filename are still in French
|
||||
$statusImg=array(
|
||||
'status0' => 'statut0'
|
||||
@ -8153,3 +8155,117 @@ function dolGetButtonAction($label, $html = '', $actionType = 'default', $url =
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
@ -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))
|
||||
{
|
||||
$format='day';
|
||||
$period = '';
|
||||
// Show duration if exists
|
||||
if ($object->lines[$i]->date_start && $object->lines[$i]->date_end)
|
||||
{
|
||||
|
||||
@ -145,8 +145,8 @@ function user_prepare_head($object)
|
||||
|
||||
if ((! empty($conf->salaries->enabled) && ! empty($user->rights->salaries->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->holiday->enabled) && ! empty($user->rights->holiday->read) && $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 || $user->rights->holiday->read_all))
|
||||
)
|
||||
{
|
||||
// Bank
|
||||
|
||||
@ -667,7 +667,7 @@ class DolibarrModules // Can not be abstract, because we need to instantiate it
|
||||
array(
|
||||
'doc/' => dol_buildpath(strtolower($this->name).'/doc/', 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;
|
||||
|
||||
// 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);
|
||||
if (dol_is_file($pathoffile)) {
|
||||
$filefound = true;
|
||||
|
||||
@ -301,7 +301,7 @@ class pdf_beluga extends ModelePDFProjects
|
||||
'table'=>'commande',
|
||||
'datefieldname'=>'date_commande',
|
||||
'test'=>$conf->commande->enabled && $user->rights->commande->lire,
|
||||
'lang'=>'order'),
|
||||
'lang'=>'orders'),
|
||||
'invoice'=>array(
|
||||
'name'=>"CustomersInvoices",
|
||||
'title'=>"ListInvoicesAssociatedProject",
|
||||
|
||||
@ -1810,7 +1810,6 @@ class pdf_cornas extends ModelePDFSuppliersOrders
|
||||
global $hookmanager;
|
||||
|
||||
$parameters=array(
|
||||
'object' => $object,
|
||||
'curY' =>& $curY,
|
||||
'columnText' => $columnText,
|
||||
'colKey' => $colKey
|
||||
|
||||
@ -342,18 +342,8 @@ print '<input type="hidden" name="viewstatut" value="'.$viewstatut.'">';
|
||||
|
||||
// Line with explanation and button new job
|
||||
$newcardbutton='';
|
||||
if ($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>';
|
||||
}
|
||||
$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);
|
||||
|
||||
|
||||
print_barre_liste($pagetitle, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'title_setup', 0, $newcardbutton, '', $limit);
|
||||
|
||||
|
||||
@ -33,7 +33,7 @@ class DolibarrDebugBar extends DebugBar
|
||||
//$this->addCollector(new PhpInfoCollector());
|
||||
//$this->addCollector(new DolMessagesCollector());
|
||||
$this->addCollector(new DolRequestDataCollector());
|
||||
$this->addCollector(new DolConfigCollector());
|
||||
//$this->addCollector(new DolConfigCollector()); // Disabled for security purpose
|
||||
$this->addCollector(new DolTimeDataCollector());
|
||||
$this->addCollector(new DolMemoryCollector());
|
||||
//$this->addCollector(new DolExceptionsCollector());
|
||||
|
||||
@ -142,9 +142,7 @@ if ($resql)
|
||||
$newcardbutton='';
|
||||
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.= '<span class="fa fa-plus-circle valignmiddle"></span>';
|
||||
$newcardbutton.= '</a>';
|
||||
$newcardbutton.= dolGetButtonTitle($langs->trans('NewDonation'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/don/card.php?action=create');
|
||||
}
|
||||
|
||||
print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'">'."\n";
|
||||
|
||||
@ -1287,13 +1287,14 @@ class EmailCollector extends CommonObject
|
||||
if (empty($contactid)) // Try to find contact using email
|
||||
{
|
||||
$result = $contactstatic->fetch(0, null, '', $from);
|
||||
|
||||
if ($result > 0)
|
||||
{
|
||||
$contactid = $contactstatic->id;
|
||||
$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)
|
||||
{
|
||||
$thirdpartyid = $thirdpartystatic->id;
|
||||
@ -1309,7 +1310,6 @@ class EmailCollector extends CommonObject
|
||||
if ($result > 0) $thirdpartyfoundby = 'email ('.$from.')';
|
||||
}
|
||||
|
||||
|
||||
// Do operations
|
||||
foreach($this->actions as $operation)
|
||||
{
|
||||
@ -1492,7 +1492,6 @@ class EmailCollector extends CommonObject
|
||||
|
||||
// Insert record of emails sent
|
||||
$actioncomm = new ActionComm($this->db);
|
||||
|
||||
$actioncomm->type_code = 'AC_OTH_AUTO'; // Type of event ('AC_OTH', 'AC_OTH_AUTO', 'AC_XXX'...)
|
||||
$actioncomm->code = 'AC_'.$actioncode;
|
||||
$actioncomm->label = $langs->trans("ActionAC_".$actioncode).' - '.$langs->trans("MailFrom").' '.$from;
|
||||
@ -1503,6 +1502,7 @@ class EmailCollector extends CommonObject
|
||||
$actioncomm->percentage = -1; // Not applicable
|
||||
$actioncomm->socid = $thirdpartystatic->id;
|
||||
$actioncomm->contactid = $contactstatic->id;
|
||||
$actioncomm->socpeopleassigned = (!empty($contactstatic->id) ? array($contactstatic->id => '') : array());
|
||||
$actioncomm->authorid = $user->id; // User saving action
|
||||
$actioncomm->userownerid = $user->id; // Owner of action
|
||||
// Fields when action is an email (content should be added into note)
|
||||
|
||||
@ -280,10 +280,8 @@ if ($resql)
|
||||
$newcardbutton='';
|
||||
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.= '<span class="fa fa-plus-circle valignmiddle"></span>';
|
||||
$newcardbutton.= '</a>';
|
||||
}
|
||||
$newcardbutton.= dolGetButtonTitle($langs->trans('NewSending'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/expedition/card.php?action=create2');
|
||||
}
|
||||
|
||||
$i = 0;
|
||||
print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'">'."\n";
|
||||
|
||||
@ -456,9 +456,7 @@ if ($resql)
|
||||
$newcardbutton='';
|
||||
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.= '<span class="fa fa-plus-circle valignmiddle"></span>';
|
||||
$newcardbutton.= '</a>';
|
||||
$newcardbutton.= dolGetButtonTitle($langs->trans('NewTrip'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/expensereport/card.php?action=create');
|
||||
}
|
||||
|
||||
print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'title_generic.png', 0, $newcardbutton, '', $limit);
|
||||
|
||||
@ -50,14 +50,7 @@ print '<br>';
|
||||
print '<div class="center">';
|
||||
if (count($export->array_export_code))
|
||||
{
|
||||
if ($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 dolGetButtonTitle($langs->trans('NewExport'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/exports/export.php?leftmenu=export', '', $user->rights->export->creer);
|
||||
}
|
||||
print '</div>';
|
||||
print '<br>';
|
||||
|
||||
@ -314,12 +314,7 @@ if ($resql)
|
||||
$massactionbutton=$form->selectMassAction('', $arrayofmassactions);
|
||||
|
||||
$newcardbutton='';
|
||||
if ($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>';
|
||||
}
|
||||
$morehtmlcenter.= dolGetButtonTitle($langs->trans('NewIntervention'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/fichinter/card.php?action=create', '', $user->rights->ficheinter->creer);
|
||||
|
||||
// Lines of title fields
|
||||
print '<form method="POST" id="searchFormList" action="'.$_SERVER["PHP_SELF"].'">'."\n";
|
||||
|
||||
@ -632,10 +632,8 @@ if ($resql)
|
||||
$newcardbutton='';
|
||||
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.= '<span class="fa fa-plus-circle valignmiddle"></span>';
|
||||
$newcardbutton.= '</a>';
|
||||
}
|
||||
$newcardbutton.= dolGetButtonTitle($langs->trans('NewOrder'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/fourn/commande/card.php?action=create');
|
||||
}
|
||||
|
||||
// Lignes des champs de filtre
|
||||
print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'">';
|
||||
|
||||
@ -466,9 +466,7 @@ if ($resql)
|
||||
$newcardbutton='';
|
||||
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.= '<span class="fa fa-plus-circle valignmiddle"></span>';
|
||||
$newcardbutton.= '</a>';
|
||||
$newcardbutton.= dolGetButtonTitle($langs->trans('NewBill'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/fourn/facture/card.php?action=create');
|
||||
}
|
||||
|
||||
$i = 0;
|
||||
|
||||
@ -340,10 +340,8 @@ else
|
||||
$newcardbutton='';
|
||||
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.= '<span class="fa fa-plus-circle valignmiddle"></span>';
|
||||
$newcardbutton.= '</a>';
|
||||
}
|
||||
$newcardbutton.= dolGetButtonTitle($langs->trans('MenuAddCP'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/holiday/card.php?action=request');
|
||||
}
|
||||
|
||||
print_barre_liste($langs->trans("ListeCP"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'title_hrm.png', 0, $newcardbutton, '', $limit);
|
||||
|
||||
|
||||
@ -92,7 +92,7 @@ if (count($import->array_import_code))
|
||||
{
|
||||
//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
|
||||
//{
|
||||
|
||||
@ -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(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);
|
||||
|
||||
|
||||
@ -368,4 +368,10 @@ ALTER TABLE llx_reception_extrafields ADD INDEX idx_reception_extrafields (fk_ob
|
||||
ALTER TABLE llx_commande_fournisseur_dispatch ADD COLUMN fk_projet 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);
|
||||
|
||||
@ -26,7 +26,7 @@ CREATE TABLE llx_asset(
|
||||
note_public text,
|
||||
note_private text,
|
||||
date_creation datetime NOT NULL,
|
||||
tms timestamp NOT NULL,
|
||||
tms timestamp,
|
||||
fk_user_creat integer NOT NULL,
|
||||
fk_user_modif integer,
|
||||
import_key varchar(14),
|
||||
|
||||
@ -24,7 +24,7 @@ CREATE TABLE llx_bom_bom(
|
||||
note_public text,
|
||||
note_private text,
|
||||
date_creation datetime NOT NULL,
|
||||
tms timestamp NOT NULL,
|
||||
tms timestamp,
|
||||
date_valid datetime,
|
||||
fk_user_creat integer NOT NULL,
|
||||
fk_user_modif integer,
|
||||
|
||||
@ -34,7 +34,7 @@ CREATE TABLE llx_emailcollector_emailcollector(
|
||||
note_public text,
|
||||
note_private text,
|
||||
date_creation datetime NOT NULL,
|
||||
tms timestamp NOT NULL,
|
||||
tms timestamp,
|
||||
fk_user_creat integer NOT NULL,
|
||||
fk_user_modif integer,
|
||||
import_key varchar(14),
|
||||
|
||||
@ -21,7 +21,7 @@ CREATE TABLE llx_emailcollector_emailcollectoraction(
|
||||
type varchar(128) NOT NULL,
|
||||
actionparam varchar(255) NULL,
|
||||
date_creation datetime NOT NULL,
|
||||
tms timestamp NOT NULL,
|
||||
tms timestamp,
|
||||
fk_user_creat integer NOT NULL,
|
||||
fk_user_modif integer,
|
||||
position integer DEFAULT 0,
|
||||
|
||||
@ -21,7 +21,7 @@ CREATE TABLE llx_emailcollector_emailcollectorfilter(
|
||||
type varchar(128) NOT NULL,
|
||||
rulevalue varchar(128) NULL,
|
||||
date_creation datetime NOT NULL,
|
||||
tms timestamp NOT NULL,
|
||||
tms timestamp,
|
||||
fk_user_creat integer NOT NULL,
|
||||
fk_user_modif integer,
|
||||
import_key varchar(14),
|
||||
|
||||
@ -33,6 +33,6 @@ CREATE TABLE llx_pos_cash_fence(
|
||||
posnumber VARCHAR(30),
|
||||
fk_user_creat integer,
|
||||
fk_user_valid integer,
|
||||
tms TIMESTAMP NOT NULL,
|
||||
tms TIMESTAMP,
|
||||
import_key VARCHAR(14)
|
||||
) ENGINE=innodb;
|
||||
@ -32,7 +32,7 @@ CREATE TABLE llx_societe_account(
|
||||
date_last_login datetime,
|
||||
date_previous_login datetime,
|
||||
date_creation datetime NOT NULL,
|
||||
tms timestamp NOT NULL,
|
||||
tms timestamp,
|
||||
fk_user_creat integer NOT NULL,
|
||||
fk_user_modif integer,
|
||||
import_key varchar(14),
|
||||
|
||||
@ -69,6 +69,12 @@ CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_adherent_type_extraf
|
||||
CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_bank FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms();
|
||||
CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_bank_account FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms();
|
||||
CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_bank_account_extrafields FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms();
|
||||
CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_blockedlog FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms();
|
||||
CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_blockedlog_authority FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms();
|
||||
CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_bom_bom FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms();
|
||||
CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_bom_bom_extrafields FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms();
|
||||
CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_bom_bomline FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms();
|
||||
CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_bom_bomline_extrafields FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms();
|
||||
CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_bordereau_cheque FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms();
|
||||
CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_boxes_def FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms();
|
||||
CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_c_email_templates FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms();
|
||||
@ -96,6 +102,9 @@ CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_deplacement FOR EACH
|
||||
CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_don FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms();
|
||||
CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_don_extrafields FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms();
|
||||
CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_element_resources FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms();
|
||||
CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_emailcollector_emailcollector FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms();
|
||||
CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_emailcollector_emailcollectoraction FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms();
|
||||
CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_emailcollector_emailcollectorfilter FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms();
|
||||
CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_entrepot FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms();
|
||||
CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_events FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms();
|
||||
CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_expedition FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms();
|
||||
|
||||
@ -196,4 +196,5 @@ EmailSentToMember=Email sent to member at %s
|
||||
SendReminderForExpiredSubscriptionTitle=Send reminder by email for expired subscription
|
||||
SendReminderForExpiredSubscription=Send reminder by email to members when subscription is about to expire (parameter is number of days before end of subscription to send the remind. It can be a list of days separated by a semicolon, for example '10;5;0;-5')
|
||||
MembershipPaid=Membership paid for current period (until %s)
|
||||
YouMayFindYourInvoiceInThisEmail=You may find your invoice attached to this email
|
||||
YouMayFindYourInvoiceInThisEmail=You may find your invoice attached to this email
|
||||
XMembersClosed=%s member(s) closed
|
||||
@ -116,9 +116,7 @@ if ($resql)
|
||||
$newcardbutton='';
|
||||
if ($user->rights->loan->write)
|
||||
{
|
||||
$newcardbutton='<a class="butActionNew" href="'.DOL_URL_ROOT.'/loan/card.php?action=create"><span class="valignmiddle text-plus-circle">'.$langs->trans('NewLoan').'</span>';
|
||||
$newcardbutton.= '<span class="fa fa-plus-circle valignmiddle"></span>';
|
||||
$newcardbutton.= '</a>';
|
||||
$newcardbutton.= dolGetButtonTitle($langs->trans('NewLoan'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/loan/card.php?action=create');
|
||||
}
|
||||
|
||||
print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'">'."\n";
|
||||
|
||||
@ -1740,8 +1740,8 @@ function top_menu_user(User $user, Translate $langs)
|
||||
}
|
||||
else{
|
||||
$nophoto='/public/theme/common/user_anonymous.png';
|
||||
if ($object->gender == 'man') $nophoto='/public/theme/common/user_man.png';
|
||||
if ($object->gender == 'woman') $nophoto='/public/theme/common/user_woman.png';
|
||||
if ($user->gender == 'man') $nophoto='/public/theme/common/user_man.png';
|
||||
if ($user->gender == 'woman') $nophoto='/public/theme/common/user_woman.png';
|
||||
|
||||
$userImage = '<img class="photo photouserphoto userphoto" alt="No photo" src="'.DOL_URL_ROOT.$nophoto.'">';
|
||||
$userDropDownImage = '<img class="photo dropdown-user-image" alt="No photo" src="'.DOL_URL_ROOT.$nophoto.'">';
|
||||
|
||||
@ -292,6 +292,9 @@ class InterfaceMyModuleTriggers extends DolibarrTriggers
|
||||
//case 'TASK_TIMESPENT_CREATE':
|
||||
//case 'TASK_TIMESPENT_MODIFY':
|
||||
//case 'TASK_TIMESPENT_DELETE':
|
||||
//case 'PROJECT_ADD_CONTACT':
|
||||
//case 'PROJECT_DELETE_CONTACT':
|
||||
//case 'PROJECT_DELETE_RESOURCE':
|
||||
|
||||
// Shipping
|
||||
//case 'SHIPPING_CREATE':
|
||||
|
||||
@ -127,7 +127,7 @@ if (empty($reshook))
|
||||
$backurlforlist = dol_buildpath('/mymodule/myobject_list.php', 1);
|
||||
if (empty($backtopage)) {
|
||||
if (empty($id)) $backtopage = $backurlforlist;
|
||||
else $backtopage = dol_buildpath('/mymodule/myobject_card.php', 1).($id > 0 ? $id : '__ID__');
|
||||
else $backtopage = dol_buildpath('/mymodule/myobject_card.php', 1).'?id='.($id > 0 ? $id : '__ID__');
|
||||
}
|
||||
$triggermodname = 'MYMODULE_MYOBJECT_MODIFY'; // Name of trigger action code to execute when we modify record
|
||||
|
||||
|
||||
@ -22,7 +22,7 @@ CREATE TABLE llx_mymodule_myobject(
|
||||
qty INTEGER,
|
||||
status INTEGER,
|
||||
date_creation DATETIME NOT NULL,
|
||||
tms TIMESTAMP NOT NULL,
|
||||
tms TIMESTAMP,
|
||||
import_key VARCHAR(14)
|
||||
-- END MODULEBUILDER FIELDS
|
||||
) ENGINE=innodb;
|
||||
@ -243,18 +243,7 @@ print '<input type="hidden" name="page" value="'.$page.'">';
|
||||
print '<input type="hidden" name="contextpage" value="'.$contextpage.'">';
|
||||
|
||||
$newcardbutton='';
|
||||
if (! empty($user->rights->opensurvey->write))
|
||||
{
|
||||
$newcardbutton='<a class="butActionNew" href="'.DOL_URL_ROOT.'/opensurvey/wizard/index.php"><span class="valignmiddle text-plus-circle">'.$langs->trans('NewSurvey').'</span>';
|
||||
$newcardbutton.= '<span class="fa fa-plus-circle valignmiddle"></span>';
|
||||
$newcardbutton.= '</a>';
|
||||
}
|
||||
else
|
||||
{
|
||||
$newcardbutton='<a class="butActionNewRefused" href="#"><span class="valignmiddle text-plus-circle">'.$langs->trans('NewSurvey').'</span>';
|
||||
$newcardbutton.= '<span class="fa fa-plus-circle valignmiddle"></span>';
|
||||
$newcardbutton.= '</a>';
|
||||
}
|
||||
$newcardbutton.= dolGetButtonTitle($langs->trans('NewSurvey'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/opensurvey/wizard/index.php', '', $user->rights->opensurvey->write);
|
||||
|
||||
print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'title_generic.png', 0, $newcardbutton, '', $limit);
|
||||
|
||||
|
||||
@ -174,14 +174,8 @@ if ($id > 0 || $ref)
|
||||
$morehtmlcenter='';
|
||||
if (! empty($conf->agenda->enabled))
|
||||
{
|
||||
if (! empty($user->rights->agenda->myactions->create) || ! empty($user->rights->agenda->allactions->create))
|
||||
{
|
||||
$morehtmlcenter.='<a class="butActionNew" href="'.DOL_URL_ROOT.'/comm/action/card.php?action=create'.$out.'"><span class="valignmiddle text-plus-circle">'.$langs->trans("AddAction").'</span><span class="fa fa-plus-circle valignmiddle"></span></a>';
|
||||
}
|
||||
else
|
||||
{
|
||||
$morehtmlcenter.='<a class="butActionNewRefused" href="#"><span class="valignmiddle text-plus-circle">'.$langs->trans("AddAction").'</span><span class="fa fa-plus-circle valignmiddle"></span></a>';
|
||||
}
|
||||
$linktocreatetimeBtnStatus = ! empty($user->rights->agenda->myactions->create) || ! empty($user->rights->agenda->allactions->create);
|
||||
$morehtmlcenter = dolGetButtonTitle($langs->trans('AddAction'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/comm/action/card.php?action=create'.$out, '', $linktocreatetimeBtnStatus);
|
||||
}
|
||||
|
||||
if (! empty($conf->agenda->enabled) && (!empty($user->rights->agenda->myactions->read) || !empty($user->rights->agenda->allactions->read) ))
|
||||
|
||||
@ -4155,6 +4155,8 @@ class Product extends CommonObject
|
||||
// phpcs:enable
|
||||
global $conf, $langs;
|
||||
|
||||
$labelstatut = $labelstatutShort = '';
|
||||
|
||||
$langs->load('products');
|
||||
if (! empty($conf->productbatch->enabled)) { $langs->load("productbatch");
|
||||
}
|
||||
|
||||
@ -452,10 +452,8 @@ if ($resql)
|
||||
{
|
||||
$label='NewProduct';
|
||||
if($type == Product::TYPE_SERVICE) $label='NewService';
|
||||
$newcardbutton='<a class="butActionNew" href="'.DOL_URL_ROOT.'/product/card.php?action=create&type='.$type.'"><span class="valignmiddle text-plus-circle">'.$langs->trans($label).'</span>';
|
||||
$newcardbutton.= '<span class="fa fa-plus-circle valignmiddle"></span>';
|
||||
$newcardbutton.= '</a>';
|
||||
}
|
||||
$newcardbutton.= dolGetButtonTitle($langs->trans($label), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/product/card.php?action=create&type='.$type);
|
||||
}
|
||||
|
||||
print '<form action="'.$_SERVER["PHP_SELF"].'" method="post" name="formulaire">';
|
||||
if ($optioncss != '') print '<input type="hidden" name="optioncss" value="'.$optioncss.'">';
|
||||
|
||||
@ -194,23 +194,19 @@ if (($id > 0 && is_numeric($id)) || ! empty($ref))
|
||||
}
|
||||
|
||||
// Link to create task
|
||||
if ($user->rights->projet->all->creer || $user->rights->projet->creer)
|
||||
{
|
||||
if ($object->public || $userWrite > 0)
|
||||
{
|
||||
$linktocreatetask = '<a class="butActionNew" href="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'&action=create'.$param.'&backtopage='.urlencode($_SERVER['PHP_SELF'].'?id='.$object->id).'"><span class="valignmiddle text-plus-circle">'.$langs->trans('AddTask').'</span><span class="fa fa-plus-circle valignmiddle"></span></a>';
|
||||
$linktocreatetaskParam = array();
|
||||
$linktocreatetaskUserRight = false;
|
||||
if ($user->rights->projet->all->creer || $user->rights->projet->creer) {
|
||||
if ($object->public || $userWrite > 0){
|
||||
$linktocreatetaskUserRight = true;
|
||||
}else{
|
||||
$linktocreatetaskParam['attr']['title'] = $langs->trans("NotOwnerOfProject");
|
||||
}
|
||||
else
|
||||
{
|
||||
$linktocreatetask = '<a class="butActionNewRefused" href="#" title="'.$langs->trans("NotOwnerOfProject").'"><span class="valignmiddle text-plus-circle">'.$langs->trans('AddTask').'</span><span class="fa fa-plus-circle valignmiddle"></span></a>';
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$linktocreatetask = '<a class="butActionNewRefused" href="#" title="'.$langs->trans("NotEnoughPermissions").'"><span class="valignmiddle text-plus-circle">'.$langs->trans('AddTask').'</span><span class="fa fa-plus-circle valignmiddle"></span></a>';
|
||||
}
|
||||
|
||||
$linktolist='<a href="'.DOL_URL_ROOT.'/projet/tasks.php?id='.$object->id.'">'.$langs->trans("GoToListOfTasks").'<span class="paddingleft fa fa-list-ul valignmiddle"></span></a>';
|
||||
$linktocreatetask = dolGetButtonTitle($langs->trans('AddTask'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/projet/tasks.php?id='.$object->id.'&action=create'.$param.'&backtopage='.urlencode($_SERVER['PHP_SELF'].'?id='.$object->id), '', $linktocreatetaskUserRight, $linktocreatetaskParam);
|
||||
|
||||
$linktolist = dolGetButtonTitle($langs->trans('GoToListOfTasks'), '', 'fa fa-tasks', DOL_URL_ROOT.'/projet/tasks.php?id='.$object->id);
|
||||
|
||||
//print_barre_liste($title, 0, $_SERVER["PHP_SELF"], '', $sortfield, $sortorder, $linktotasks, $num, $totalnboflines, 'title_generic.png', 0, '', '', 0, 1);
|
||||
print load_fiche_titre($title, $linktolist.' '.$linktocreatetask, 'title_generic.png');
|
||||
|
||||
@ -63,7 +63,6 @@ $projectset = ($mine?$mine:(empty($user->rights->projet->all->lire)?0:2));
|
||||
$projectsListId = $projectstatic->getProjectsAuthorizedForUser($user, $projetset, 1);
|
||||
//var_dump($projectsListId);
|
||||
|
||||
|
||||
llxHeader("", $langs->trans("Projects"), "EN:Module_Projects|FR:Module_Projets|ES:Módulo_Proyectos");
|
||||
|
||||
$title=$langs->trans("ProjectsArea");
|
||||
|
||||
@ -161,16 +161,8 @@ if ($permok)
|
||||
$morehtmlcenter='';
|
||||
if (! empty($conf->agenda->enabled))
|
||||
{
|
||||
if (! empty($user->rights->agenda->myactions->create) || ! empty($user->rights->agenda->allactions->create))
|
||||
{
|
||||
$morehtmlcenter.='<a class="butActionNew" href="'.DOL_URL_ROOT.'/comm/action/card.php?action=create'.$out.'&backtopage='.urlencode($_SERVER["PHP_SELF"].'?id='.$object->id).'"><span class="valignmiddle text-plus-circle">'.$langs->trans("AddAction").'</span>';
|
||||
$morehtmlcenter.='<span class="fa fa-plus-circle valignmiddle"></span>';
|
||||
$morehtmlcenter.='</a>';
|
||||
}
|
||||
else
|
||||
{
|
||||
$morehtmlcenter.='<a class="butActionRefused classfortooltip" href="#">'.$langs->trans("AddAction").'</a>';
|
||||
}
|
||||
$addActionBtnRight = ! empty($user->rights->agenda->myactions->create) || ! empty($user->rights->agenda->allactions->create);
|
||||
$morehtmlcenter.= dolGetButtonTitle($langs->trans('AddAction'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/comm/action/card.php?action=create'.$out.'&backtopage='.urlencode($_SERVER["PHP_SELF"].'?id='.$object->id), '', $addActionBtnRight);
|
||||
}
|
||||
|
||||
//print '</div>';
|
||||
|
||||
@ -451,9 +451,7 @@ $massactionbutton=$form->selectMassAction('', $arrayofmassactions);
|
||||
$newcardbutton='';
|
||||
if ($user->rights->projet->creer)
|
||||
{
|
||||
$newcardbutton = '<a class="butActionNew" href="'.DOL_URL_ROOT.'/projet/card.php?action=create"><span class="valignmiddle text-plus-circle">'.$langs->trans('NewProject').'</span>';
|
||||
$newcardbutton.= '<span class="fa fa-plus-circle valignmiddle"></span>';
|
||||
$newcardbutton.= '</a>';
|
||||
$newcardbutton.= dolGetButtonTitle($langs->trans('NewProject'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/projet/card.php?action=create');
|
||||
}
|
||||
|
||||
print '<form method="POST" id="searchFormList" action="'.$_SERVER["PHP_SELF"].'">';
|
||||
|
||||
@ -642,23 +642,18 @@ elseif ($id > 0 || ! empty($ref))
|
||||
|
||||
print '<br>';
|
||||
|
||||
// Link to create task
|
||||
if ($user->rights->projet->all->creer || $user->rights->projet->creer)
|
||||
{
|
||||
if ($object->public || $userWrite > 0)
|
||||
{
|
||||
$linktocreatetask = '<a class="butActionNew" href="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'&action=create'.$param.'&backtopage='.urlencode($_SERVER['PHP_SELF'].'?id='.$object->id).'"><span class="valignmiddle text-plus-circle">'.$langs->trans('AddTask').'</span><span class="fa fa-plus-circle valignmiddle"></span></a>';
|
||||
}
|
||||
else
|
||||
{
|
||||
$linktocreatetask = '<a class="butActionNewRefused" href="#" title="'.$langs->trans("NotOwnerOfProject").'"><span class="valignmiddle text-plus-circle">'.$langs->trans('AddTask').'</span><span class="fa fa-plus-circle valignmiddle"></span></a>';
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$linktocreatetask = '<a class="butActionNewRefused" href="#" title="'.$langs->trans("NotEnoughPermissions").'"><span class="valignmiddle text-plus-circle">'.$langs->trans('AddTask').'</span><span class="fa fa-plus-circle valignmiddle"></span></a>';
|
||||
}
|
||||
// Link to create task
|
||||
$linktocreatetaskParam = array();
|
||||
$linktocreatetaskUserRight = false;
|
||||
if ($user->rights->projet->all->creer || $user->rights->projet->creer) {
|
||||
if ($object->public || $userWrite > 0){
|
||||
$linktocreatetaskUserRight = true;
|
||||
}else{
|
||||
$linktocreatetaskParam['attr']['title'] = $langs->trans("NotOwnerOfProject");
|
||||
}
|
||||
}
|
||||
|
||||
$linktocreatetask = dolGetButtonTitle($langs->trans('AddTask'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/projet/tasks.php?id='.$object->id.'&action=create'.$param.'&backtopage='.urlencode($_SERVER['PHP_SELF'].'?id='.$object->id), '', $linktocreatetaskUserRight, $linktocreatetaskParam);
|
||||
|
||||
|
||||
print '<form method="POST" id="searchFormList" action="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'">';
|
||||
@ -672,7 +667,7 @@ elseif ($id > 0 || ! empty($ref))
|
||||
print '<input type="hidden" name="contextpage" value="'.$contextpage.'">';
|
||||
|
||||
$title=$langs->trans("ListOfTasks");
|
||||
$linktotasks='<a href="'.DOL_URL_ROOT.'/projet/ganttview.php?id='.$object->id.'&withproject=1">'.$langs->trans("GoToGanttView").'<span class="paddingleft fa fa-calendar-minus-o valignmiddle"></span></a>';
|
||||
$linktotasks = dolGetButtonTitle($langs->trans('GoToGanttView'), '', 'fa fa-calendar-minus-o', DOL_URL_ROOT.'/projet/ganttview.php?id='.$object->id.'&withproject=1');
|
||||
|
||||
//print_barre_liste($title, 0, $_SERVER["PHP_SELF"], '', $sortfield, $sortorder, $linktotasks, $num, $totalnboflines, 'title_generic.png', 0, '', '', 0, 1);
|
||||
print load_fiche_titre($title, $linktotasks.' '.$linktocreatetask, 'title_generic.png');
|
||||
|
||||
@ -425,9 +425,7 @@ $massactionbutton=$form->selectMassAction('', $arrayofmassactions);
|
||||
$newcardbutton='';
|
||||
if ($user->rights->projet->creer)
|
||||
{
|
||||
$newcardbutton = '<a class="butActionNew" href="'.DOL_URL_ROOT.'/projet/tasks.php?action=create"><span class="valignmiddle text-plus-circle">'.$langs->trans('NewTask').'</span>';
|
||||
$newcardbutton.= '<span class="fa fa-plus-circle valignmiddle"></span>';
|
||||
$newcardbutton.= '</a>';
|
||||
$newcardbutton.= dolGetButtonTitle($langs->trans('NewTask'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/projet/tasks.php?action=create');
|
||||
}
|
||||
|
||||
print '<form method="POST" id="searchFormList" action="'.$_SERVER["PHP_SELF"].'">';
|
||||
|
||||
@ -579,31 +579,35 @@ if (($id > 0 || ! empty($ref)) || $projectidforalltimes > 0)
|
||||
}
|
||||
|
||||
// Link to create time
|
||||
$linktocreatetimeBtnStatus = 0;
|
||||
$linktocreatetimeUrl = '';
|
||||
$linktocreatetimeHelpText = '';
|
||||
if ($user->rights->projet->all->creer || $user->rights->projet->creer)
|
||||
{
|
||||
if ($projectstatic->public || $userWrite > 0)
|
||||
{
|
||||
$linktocreatetimeBtnStatus = 1;
|
||||
|
||||
if (! empty($projectidforalltimes)) // We are on tab 'Time Spent' of project
|
||||
{
|
||||
$backtourl = $_SERVER['PHP_SELF'].'?projectid='.$projectstatic->id.($withproject?'&withproject=1':'');
|
||||
$linktocreatetime = '<a class="butActionNew" href="'.$_SERVER['PHP_SELF'].'?'.($withproject?'withproject=1':'').'&projectid='.$projectstatic->id.'&action=createtime'.$param.'&backtopage='.urlencode($backtourl).'"><span class="valignmiddle text-plus-circle">'.$langs->trans('AddTimeSpent').'</span><span class="fa fa-plus-circle valignmiddle"></span></a>';
|
||||
$linktocreatetimeUrl = $_SERVER['PHP_SELF'].'?'.($withproject?'withproject=1':'').'&projectid='.$projectstatic->id.'&action=createtime'.$param.'&backtopage='.urlencode($backtourl);
|
||||
}
|
||||
else // We are on tab 'Time Spent' of task
|
||||
{
|
||||
$backtourl = $_SERVER['PHP_SELF'].'?id='.$object->id.($withproject?'&withproject=1':'');
|
||||
$linktocreatetime = '<a class="butActionNew" href="'.$_SERVER['PHP_SELF'].'?'.($withproject?'withproject=1':'').($object->id > 0 ? '&id='.$object->id : '&projectid='.$projectstatic->id).'&action=createtime'.$param.'&backtopage='.urlencode($backtourl).'"><span class="valignmiddle text-plus-circle">'.$langs->trans('AddTimeSpent').'</span><span class="fa fa-plus-circle valignmiddle"></span></a>';
|
||||
$linktocreatetimeUrl = $_SERVER['PHP_SELF'].'?'.($withproject?'withproject=1':'').($object->id > 0 ? '&id='.$object->id : '&projectid='.$projectstatic->id).'&action=createtime'.$param.'&backtopage='.urlencode($backtourl);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$linktocreatetime = '<a class="butActionNewRefused" href="#" title="'.$langs->trans("NotOwnerOfProject").'"><span class="valignmiddle text-plus-circle">'.$langs->trans('AddTime').'</span><span class="fa fa-plus-circle valignmiddle"></span></a>';
|
||||
$linktocreatetimeBtnStatus = -2;
|
||||
$linktocreatetimeHelpText = $langs->trans("NotOwnerOfProject");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$linktocreatetime = '<a class="butActionNewRefused" href="#" title="'.$langs->trans("NotEnoughPermissions").'"><span class="valignmiddle text-plus-circle">'.$langs->trans('AddTime').'</span><span class="fa fa-plus-circle valignmiddle"></span></a>';
|
||||
}
|
||||
}
|
||||
|
||||
$linktocreatetime = dolGetButtonTitle($langs->trans('AddTimeSpent'), $linktocreatetimeHelpText, 'fa fa-plus-circle', $linktocreatetimeUrl, '', $linktocreatetimeBtnStatus);
|
||||
}
|
||||
|
||||
$massactionbutton = '';
|
||||
if ($projectstatic->bill_time)
|
||||
|
||||
@ -1943,241 +1943,249 @@ if (preg_match('/^dopayment/', $action))
|
||||
|
||||
print '</form>'."\n";
|
||||
|
||||
print '<script src="https://js.stripe.com/v3/"></script>'."\n";
|
||||
|
||||
// Code to ask the credit card. This use the default "API version". No way to force API version when using JS code.
|
||||
print '<script type="text/javascript" language="javascript">'."\n";
|
||||
|
||||
if (! empty($conf->global->STRIPE_USE_INTENT_WITH_AUTOMATIC_CONFIRMATION))
|
||||
if (empty($stripearrayofkeys['publishable_key']))
|
||||
{
|
||||
?>
|
||||
|
||||
// Create a Stripe client.
|
||||
var stripe = Stripe('<?php echo $stripearrayofkeys['publishable_key']; // Defined into config.php ?>');
|
||||
|
||||
// Create an instance of Elements
|
||||
var elements = stripe.elements();
|
||||
|
||||
// Custom styling can be passed to options when creating an Element.
|
||||
// (Note that this demo uses a wider set of styles than the guide below.)
|
||||
var style = {
|
||||
base: {
|
||||
color: '#32325d',
|
||||
lineHeight: '24px',
|
||||
fontFamily: '"Helvetica Neue", Helvetica, sans-serif',
|
||||
fontSmoothing: 'antialiased',
|
||||
fontSize: '16px',
|
||||
'::placeholder': {
|
||||
color: '#aab7c4'
|
||||
}
|
||||
},
|
||||
invalid: {
|
||||
color: '#fa755a',
|
||||
iconColor: '#fa755a'
|
||||
}
|
||||
};
|
||||
|
||||
var cardElement = elements.create('card', {style: style});
|
||||
|
||||
// Add an instance of the card Element into the `card-element` <div>
|
||||
cardElement.mount('#card-element');
|
||||
|
||||
// Handle real-time validation errors from the card Element.
|
||||
cardElement.addEventListener('change', function(event) {
|
||||
var displayError = document.getElementById('card-errors');
|
||||
if (event.error) {
|
||||
console.log("Show event error (like 'Incorrect card number', ...)");
|
||||
displayError.textContent = event.error.message;
|
||||
} else {
|
||||
console.log("Reset error message");
|
||||
displayError.textContent = '';
|
||||
}
|
||||
});
|
||||
|
||||
// Handle form submission
|
||||
var cardholderName = document.getElementById('cardholder-name');
|
||||
var cardButton = document.getElementById('buttontopay');
|
||||
var clientSecret = cardButton.dataset.secret;
|
||||
|
||||
cardButton.addEventListener('click', function(event) {
|
||||
console.log("We click on buttontopay");
|
||||
event.preventDefault();
|
||||
|
||||
if (cardholderName.value == '')
|
||||
{
|
||||
console.log("Field Card holder is empty");
|
||||
var displayError = document.getElementById('card-errors');
|
||||
displayError.textContent = '<?php print dol_escape_js($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("CardOwner"))); ?>';
|
||||
}
|
||||
else
|
||||
{
|
||||
stripe.handleCardPayment(
|
||||
clientSecret, cardElement, {
|
||||
payment_method_data: {
|
||||
billing_details: {
|
||||
name: cardholderName.value
|
||||
<?php if (GETPOST('email', 'alpha')) { ?>, email: '<?php echo GETPOST('email', 'alpha'); ?>'<?php } ?>
|
||||
<?php if (is_object($object) && is_object($object->thirdparty) && is_object($object->thirdparty->phone)) { ?>, phone: '<?php echo $object->thirdparty->phone; ?>'<?php } ?>
|
||||
<?php if (is_object($object) && is_object($object->thirdparty)) { ?>, address: {
|
||||
city: '<?php echo $object->thirdparty->town; ?>',
|
||||
country: '<?php echo $object->thirdparty->country_code; ?>',
|
||||
line1: '<?php echo $object->thirdparty->address; ?>',
|
||||
postal_code: '<?php echo $object->thirdparty->zip; ?>'}<?php } ?>
|
||||
} /* TODO Add all other known data like emails, ... to be SCA compliant */
|
||||
},
|
||||
save_payment_method: true /* the card will be saved */
|
||||
}
|
||||
).then(function(result) {
|
||||
console.log(result);
|
||||
if (result.error) {
|
||||
console.log("Error on result of handleCardPayment");
|
||||
jQuery('#buttontopay').show();
|
||||
jQuery('#hourglasstopay').hide();
|
||||
// Inform the user if there was an error
|
||||
var errorElement = document.getElementById('card-errors');
|
||||
errorElement.textContent = result.error.message;
|
||||
} else {
|
||||
// The payment has succeeded. Display a success message.
|
||||
console.log("No error on result of handleCardPayment, so we submit the form");
|
||||
// Submit the form
|
||||
jQuery('#buttontopay').hide();
|
||||
jQuery('#hourglasstopay').show();
|
||||
// Send form (action=charge that will do nothing)
|
||||
jQuery('#payment-form').submit();
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
<?php
|
||||
print info_admin($langs->trans("ErrorModuleSetupNotComplete", "stripe"), 0, 0, 'error');
|
||||
}
|
||||
else
|
||||
{
|
||||
?>
|
||||
print '<script src="https://js.stripe.com/v3/"></script>'."\n";
|
||||
|
||||
// Code to ask the credit card. This use the default "API version". No way to force API version when using JS code.
|
||||
print '<script type="text/javascript" language="javascript">'."\n";
|
||||
|
||||
if (! empty($conf->global->STRIPE_USE_INTENT_WITH_AUTOMATIC_CONFIRMATION))
|
||||
{
|
||||
?>
|
||||
// Code for payment with option STRIPE_USE_INTENT_WITH_AUTOMATIC_CONFIRMATION set
|
||||
|
||||
// Create a Stripe client.
|
||||
var stripe = Stripe('<?php echo $stripearrayofkeys['publishable_key']; // Defined into config.php ?>');
|
||||
|
||||
// Create an instance of Elements
|
||||
var elements = stripe.elements();
|
||||
|
||||
// Custom styling can be passed to options when creating an Element.
|
||||
// (Note that this demo uses a wider set of styles than the guide below.)
|
||||
var style = {
|
||||
base: {
|
||||
color: '#32325d',
|
||||
lineHeight: '24px',
|
||||
fontFamily: '"Helvetica Neue", Helvetica, sans-serif',
|
||||
fontSmoothing: 'antialiased',
|
||||
fontSize: '16px',
|
||||
'::placeholder': {
|
||||
color: '#aab7c4'
|
||||
}
|
||||
},
|
||||
invalid: {
|
||||
color: '#fa755a',
|
||||
iconColor: '#fa755a'
|
||||
}
|
||||
};
|
||||
|
||||
var cardElement = elements.create('card', {style: style});
|
||||
|
||||
// Add an instance of the card Element into the `card-element` <div>
|
||||
cardElement.mount('#card-element');
|
||||
|
||||
// Handle real-time validation errors from the card Element.
|
||||
cardElement.addEventListener('change', function(event) {
|
||||
var displayError = document.getElementById('card-errors');
|
||||
if (event.error) {
|
||||
console.log("Show event error (like 'Incorrect card number', ...)");
|
||||
displayError.textContent = event.error.message;
|
||||
} else {
|
||||
console.log("Reset error message");
|
||||
displayError.textContent = '';
|
||||
}
|
||||
});
|
||||
|
||||
// Handle form submission
|
||||
var cardholderName = document.getElementById('cardholder-name');
|
||||
var cardButton = document.getElementById('buttontopay');
|
||||
var clientSecret = cardButton.dataset.secret;
|
||||
|
||||
cardButton.addEventListener('click', function(event) {
|
||||
console.log("We click on buttontopay");
|
||||
event.preventDefault();
|
||||
|
||||
if (cardholderName.value == '')
|
||||
{
|
||||
console.log("Field Card holder is empty");
|
||||
var displayError = document.getElementById('card-errors');
|
||||
displayError.textContent = '<?php print dol_escape_js($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("CardOwner"))); ?>';
|
||||
}
|
||||
else
|
||||
{
|
||||
stripe.handleCardPayment(
|
||||
clientSecret, cardElement, {
|
||||
payment_method_data: {
|
||||
billing_details: {
|
||||
name: cardholderName.value
|
||||
<?php if (GETPOST('email', 'alpha')) { ?>, email: '<?php echo GETPOST('email', 'alpha'); ?>'<?php } ?>
|
||||
<?php if (is_object($object) && is_object($object->thirdparty) && is_object($object->thirdparty->phone)) { ?>, phone: '<?php echo $object->thirdparty->phone; ?>'<?php } ?>
|
||||
<?php if (is_object($object) && is_object($object->thirdparty)) { ?>, address: {
|
||||
city: '<?php echo $object->thirdparty->town; ?>',
|
||||
country: '<?php echo $object->thirdparty->country_code; ?>',
|
||||
line1: '<?php echo $object->thirdparty->address; ?>',
|
||||
postal_code: '<?php echo $object->thirdparty->zip; ?>'}<?php } ?>
|
||||
} /* TODO Add all other known data like emails, ... to be SCA compliant */
|
||||
},
|
||||
save_payment_method: true /* the card will be saved */
|
||||
}
|
||||
).then(function(result) {
|
||||
console.log(result);
|
||||
if (result.error) {
|
||||
console.log("Error on result of handleCardPayment");
|
||||
jQuery('#buttontopay').show();
|
||||
jQuery('#hourglasstopay').hide();
|
||||
// Inform the user if there was an error
|
||||
var errorElement = document.getElementById('card-errors');
|
||||
errorElement.textContent = result.error.message;
|
||||
} else {
|
||||
// The payment has succeeded. Display a success message.
|
||||
console.log("No error on result of handleCardPayment, so we submit the form");
|
||||
// Submit the form
|
||||
jQuery('#buttontopay').hide();
|
||||
jQuery('#hourglasstopay').show();
|
||||
// Send form (action=charge that will do nothing)
|
||||
jQuery('#payment-form').submit();
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
// Create a Stripe client.
|
||||
var stripe = Stripe('<?php echo $stripearrayofkeys['publishable_key']; // Defined into config.php ?>');
|
||||
<?php
|
||||
}
|
||||
else
|
||||
{
|
||||
?>
|
||||
// Code for payment with option STRIPE_USE_INTENT_WITH_AUTOMATIC_CONFIRMATION off
|
||||
|
||||
// Create an instance of Elements
|
||||
var elements = stripe.elements();
|
||||
// Create a Stripe client.
|
||||
var stripe = Stripe('<?php echo $stripearrayofkeys['publishable_key']; // Defined into config.php ?>');
|
||||
|
||||
// Custom styling can be passed to options when creating an Element.
|
||||
// (Note that this demo uses a wider set of styles than the guide below.)
|
||||
var style = {
|
||||
base: {
|
||||
color: '#32325d',
|
||||
lineHeight: '24px',
|
||||
fontFamily: '"Helvetica Neue", Helvetica, sans-serif',
|
||||
fontSmoothing: 'antialiased',
|
||||
fontSize: '16px',
|
||||
'::placeholder': {
|
||||
color: '#aab7c4'
|
||||
}
|
||||
},
|
||||
invalid: {
|
||||
color: '#fa755a',
|
||||
iconColor: '#fa755a'
|
||||
}
|
||||
};
|
||||
// Create an instance of Elements
|
||||
var elements = stripe.elements();
|
||||
|
||||
// Create an instance of the card Element
|
||||
var card = elements.create('card', {style: style});
|
||||
// Custom styling can be passed to options when creating an Element.
|
||||
// (Note that this demo uses a wider set of styles than the guide below.)
|
||||
var style = {
|
||||
base: {
|
||||
color: '#32325d',
|
||||
lineHeight: '24px',
|
||||
fontFamily: '"Helvetica Neue", Helvetica, sans-serif',
|
||||
fontSmoothing: 'antialiased',
|
||||
fontSize: '16px',
|
||||
'::placeholder': {
|
||||
color: '#aab7c4'
|
||||
}
|
||||
},
|
||||
invalid: {
|
||||
color: '#fa755a',
|
||||
iconColor: '#fa755a'
|
||||
}
|
||||
};
|
||||
|
||||
// Add an instance of the card Element into the `card-element` <div>
|
||||
card.mount('#card-element');
|
||||
// Create an instance of the card Element
|
||||
var card = elements.create('card', {style: style});
|
||||
|
||||
// Handle real-time validation errors from the card Element.
|
||||
card.addEventListener('change', function(event) {
|
||||
var displayError = document.getElementById('card-errors');
|
||||
if (event.error) {
|
||||
displayError.textContent = event.error.message;
|
||||
} else {
|
||||
displayError.textContent = '';
|
||||
}
|
||||
});
|
||||
// Add an instance of the card Element into the `card-element` <div>
|
||||
card.mount('#card-element');
|
||||
|
||||
// Handle form submission
|
||||
var form = document.getElementById('payment-form');
|
||||
console.log(form);
|
||||
form.addEventListener('submit', function(event) {
|
||||
event.preventDefault();
|
||||
<?php
|
||||
if (empty($conf->global->STRIPE_USE_3DSECURE)) // Ask credit card directly, no 3DS test
|
||||
{
|
||||
?>
|
||||
/* Use token */
|
||||
stripe.createToken(card).then(function(result) {
|
||||
if (result.error) {
|
||||
// Inform the user if there was an error
|
||||
var errorElement = document.getElementById('card-errors');
|
||||
errorElement.textContent = result.error.message;
|
||||
} else {
|
||||
// Send the token to your server
|
||||
stripeTokenHandler(result.token);
|
||||
}
|
||||
});
|
||||
<?php
|
||||
}
|
||||
else // Ask credit card with 3DS test
|
||||
{
|
||||
?>
|
||||
/* Use 3DS source */
|
||||
stripe.createSource(card).then(function(result) {
|
||||
if (result.error) {
|
||||
// Inform the user if there was an error
|
||||
var errorElement = document.getElementById('card-errors');
|
||||
errorElement.textContent = result.error.message;
|
||||
} else {
|
||||
// Send the source to your server
|
||||
stripeSourceHandler(result.source);
|
||||
}
|
||||
});
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
});
|
||||
// Handle real-time validation errors from the card Element.
|
||||
card.addEventListener('change', function(event) {
|
||||
var displayError = document.getElementById('card-errors');
|
||||
if (event.error) {
|
||||
displayError.textContent = event.error.message;
|
||||
} else {
|
||||
displayError.textContent = '';
|
||||
}
|
||||
});
|
||||
|
||||
// Handle form submission
|
||||
var form = document.getElementById('payment-form');
|
||||
console.log(form);
|
||||
form.addEventListener('submit', function(event) {
|
||||
event.preventDefault();
|
||||
<?php
|
||||
if (empty($conf->global->STRIPE_USE_3DSECURE)) // Ask credit card directly, no 3DS test
|
||||
{
|
||||
?>
|
||||
/* Use token */
|
||||
stripe.createToken(card).then(function(result) {
|
||||
if (result.error) {
|
||||
// Inform the user if there was an error
|
||||
var errorElement = document.getElementById('card-errors');
|
||||
errorElement.textContent = result.error.message;
|
||||
} else {
|
||||
// Send the token to your server
|
||||
stripeTokenHandler(result.token);
|
||||
}
|
||||
});
|
||||
<?php
|
||||
}
|
||||
else // Ask credit card with 3DS test
|
||||
{
|
||||
?>
|
||||
/* Use 3DS source */
|
||||
stripe.createSource(card).then(function(result) {
|
||||
if (result.error) {
|
||||
// Inform the user if there was an error
|
||||
var errorElement = document.getElementById('card-errors');
|
||||
errorElement.textContent = result.error.message;
|
||||
} else {
|
||||
// Send the source to your server
|
||||
stripeSourceHandler(result.source);
|
||||
}
|
||||
});
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
});
|
||||
|
||||
|
||||
/* Insert the Token into the form so it gets submitted to the server */
|
||||
function stripeTokenHandler(token) {
|
||||
// Insert the token ID into the form so it gets submitted to the server
|
||||
var form = document.getElementById('payment-form');
|
||||
var hiddenInput = document.createElement('input');
|
||||
hiddenInput.setAttribute('type', 'hidden');
|
||||
hiddenInput.setAttribute('name', 'stripeToken');
|
||||
hiddenInput.setAttribute('value', token.id);
|
||||
form.appendChild(hiddenInput);
|
||||
/* Insert the Token into the form so it gets submitted to the server */
|
||||
function stripeTokenHandler(token) {
|
||||
// Insert the token ID into the form so it gets submitted to the server
|
||||
var form = document.getElementById('payment-form');
|
||||
var hiddenInput = document.createElement('input');
|
||||
hiddenInput.setAttribute('type', 'hidden');
|
||||
hiddenInput.setAttribute('name', 'stripeToken');
|
||||
hiddenInput.setAttribute('value', token.id);
|
||||
form.appendChild(hiddenInput);
|
||||
|
||||
// Submit the form
|
||||
jQuery('#buttontopay').hide();
|
||||
jQuery('#hourglasstopay').show();
|
||||
console.log("submit token");
|
||||
form.submit();
|
||||
}
|
||||
// Submit the form
|
||||
jQuery('#buttontopay').hide();
|
||||
jQuery('#hourglasstopay').show();
|
||||
console.log("submit token");
|
||||
form.submit();
|
||||
}
|
||||
|
||||
/* Insert the Source into the form so it gets submitted to the server */
|
||||
function stripeSourceHandler(source) {
|
||||
// Insert the source ID into the form so it gets submitted to the server
|
||||
var form = document.getElementById('payment-form');
|
||||
var hiddenInput = document.createElement('input');
|
||||
hiddenInput.setAttribute('type', 'hidden');
|
||||
hiddenInput.setAttribute('name', 'stripeSource');
|
||||
hiddenInput.setAttribute('value', source.id);
|
||||
form.appendChild(hiddenInput);
|
||||
/* Insert the Source into the form so it gets submitted to the server */
|
||||
function stripeSourceHandler(source) {
|
||||
// Insert the source ID into the form so it gets submitted to the server
|
||||
var form = document.getElementById('payment-form');
|
||||
var hiddenInput = document.createElement('input');
|
||||
hiddenInput.setAttribute('type', 'hidden');
|
||||
hiddenInput.setAttribute('name', 'stripeSource');
|
||||
hiddenInput.setAttribute('value', source.id);
|
||||
form.appendChild(hiddenInput);
|
||||
|
||||
// Submit the form
|
||||
jQuery('#buttontopay').hide();
|
||||
jQuery('#hourglasstopay').show();
|
||||
console.log("submit source");
|
||||
form.submit();
|
||||
// Submit the form
|
||||
jQuery('#buttontopay').hide();
|
||||
jQuery('#hourglasstopay').show();
|
||||
console.log("submit source");
|
||||
form.submit();
|
||||
}
|
||||
|
||||
<?php
|
||||
}
|
||||
|
||||
print '</script>';
|
||||
}
|
||||
|
||||
<?php
|
||||
}
|
||||
|
||||
print '</script>';
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -408,6 +408,7 @@ class Dolresource extends CommonObject
|
||||
public function delete($rowid, $notrigger = 0)
|
||||
{
|
||||
global $user,$langs,$conf;
|
||||
require_once DOL_DOCUMENT_ROOT . '/core/lib/files.lib.php';
|
||||
|
||||
$error=0;
|
||||
|
||||
@ -841,6 +842,8 @@ class Dolresource extends CommonObject
|
||||
*/
|
||||
public function getElementResources($element, $element_id, $resource_type = '')
|
||||
{
|
||||
$resources=array();
|
||||
|
||||
// Links beetween objects are stored in this table
|
||||
$sql = 'SELECT rowid, resource_id, resource_type, busy, mandatory';
|
||||
$sql.= ' FROM '.MAIN_DB_PREFIX.'element_resources';
|
||||
|
||||
@ -197,10 +197,8 @@ if($ret == -1) {
|
||||
$newcardbutton='';
|
||||
if ($user->rights->resource->write)
|
||||
{
|
||||
$newcardbutton='<a class="butActionNew" href="'.DOL_URL_ROOT.'/resource/card.php?action=create"><span class="valignmiddle text-plus-circle">'.$langs->trans('MenuResourceAdd').'</span>';
|
||||
$newcardbutton.= '<span class="fa fa-plus-circle valignmiddle"></span>';
|
||||
$newcardbutton.= '</a>';
|
||||
}
|
||||
$newcardbutton.= dolGetButtonTitle($langs->trans('MenuResourceAdd'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/resource/card.php?action=create');
|
||||
}
|
||||
|
||||
print_barre_liste($pagetitle, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $ret+1, $nbtotalofrecords, 'title_generic.png', 0, $newcardbutton, '', $limit);
|
||||
}
|
||||
|
||||
@ -162,9 +162,7 @@ if ($socid > 0)
|
||||
{
|
||||
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.= '<span class="fa fa-plus-circle valignmiddle"></span>';
|
||||
$newcardbutton.= '</a>';
|
||||
$newcardbutton.= dolGetButtonTitle($langs->trans('AddAction'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/comm/action/card.php?action=create'.$out);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -1207,7 +1207,7 @@ else
|
||||
{
|
||||
// Supplier
|
||||
print '<tr>';
|
||||
print '<td>'.$form->editfieldkey('Supplier', 'fournisseur', '', $object, 0, 'string', '', 1).'</td><td>';
|
||||
print '<td>'.$form->editfieldkey('Vendor', 'fournisseur', '', $object, 0, 'string', '', 1).'</td><td>';
|
||||
$default = -1;
|
||||
if (! empty($conf->global->THIRDPARTY_SUPPLIER_BY_DEFAULT)) $default=1;
|
||||
print $form->selectyesno("fournisseur", (GETPOST('fournisseur', 'int')!=''?GETPOST('fournisseur', 'int'):(GETPOST("type", 'alpha') == '' ? $default : $object->fournisseur)), 1, 0, (GETPOST("type", 'alpha') == '' ? 1 : 0));
|
||||
@ -2709,9 +2709,7 @@ else
|
||||
|
||||
$MAXEVENT = 10;
|
||||
|
||||
$morehtmlright = '<a href="'.DOL_URL_ROOT.'/societe/agenda.php?socid='.$object->id.'">';
|
||||
$morehtmlright.= $langs->trans("SeeAll");
|
||||
$morehtmlright.= '</a>';
|
||||
$morehtmlright.= dolGetButtonTitle($langs->trans('SeeAll'), '', 'fa fa-list-alt', DOL_URL_ROOT.'/societe/agenda.php?socid='.$object->id);
|
||||
|
||||
// List of actions on element
|
||||
include_once DOL_DOCUMENT_ROOT . '/core/class/html.formactions.class.php';
|
||||
|
||||
@ -581,9 +581,7 @@ if ($user->rights->societe->creer && $contextpage != 'poslist')
|
||||
if($type == 'f') $label='NewSupplier';
|
||||
}
|
||||
|
||||
$newcardbutton = '<a class="butActionNew" href="'.DOL_URL_ROOT.'/societe/card.php?action=create'.$typefilter.'"><span class="valignmiddle text-plus-circle">'.$langs->trans($label).'</span>';
|
||||
$newcardbutton.= '<span class="fa fa-plus-circle valignmiddle"></span>';
|
||||
$newcardbutton.= '</a>';
|
||||
$newcardbutton.= dolGetButtonTitle($langs->trans($label), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/societe/card.php?action=create'.$typefilter);
|
||||
}
|
||||
|
||||
print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'" name="formfilter" autocomplete="off">';
|
||||
|
||||
@ -800,7 +800,7 @@ if ($socid && $action != 'edit' && $action != 'create' && $action != 'editcard'
|
||||
$morehtmlright='';
|
||||
if (! empty($conf->global->STRIPE_ALLOW_LOCAL_CARD))
|
||||
{
|
||||
$morehtmlright='<a class="butActionNew" href="'.$_SERVER["PHP_SELF"].'?socid='.$object->id.'&action=createcard"><span class="valignmiddle text-plus-circle">'.$langs->trans("Add").'</span><span class="fa fa-plus-circle valignmiddle"></span></a>';
|
||||
$morehtmlright.= dolGetButtonTitle($langs->trans('Add'), '', 'fa fa-plus-circle', $_SERVER["PHP_SELF"].'?socid='.$object->id.'&action=createcard');
|
||||
}
|
||||
print load_fiche_titre($langs->trans('StripePaymentModes').($stripeacc?' (Stripe connection with StripeConnect account '.$stripeacc.')':' (Stripe connection with keys from Stripe module setup)'), $morehtmlright, '');
|
||||
|
||||
@ -1162,7 +1162,7 @@ if ($socid && $action != 'edit' && $action != 'create' && $action != 'editcard'
|
||||
// List of bank accounts
|
||||
print '<br>';
|
||||
|
||||
$morehtmlright='<a class="butActionNew" href="'.$_SERVER["PHP_SELF"].'?socid='.$object->id.'&action=create"><span class="valignmiddle text-plus-circle">'.$langs->trans("Add").'</span><span class="fa fa-plus-circle valignmiddle"></span></a>';
|
||||
$morehtmlright= dolGetButtonTitle($langs->trans('Add'), '', 'fa fa-plus-circle', $_SERVER["PHP_SELF"].'?socid='.$object->id.'&action=create');
|
||||
|
||||
print load_fiche_titre($langs->trans("BankAccounts"), $morehtmlright, '');
|
||||
|
||||
|
||||
@ -230,13 +230,9 @@ dol_fiche_end();
|
||||
$newcardbutton = '';
|
||||
if (! empty($conf->website->enabled)) {
|
||||
if (! empty($user->rights->societe->lire)) {
|
||||
$newcardbutton .= '<a class="butActionNew" href="' . DOL_URL_ROOT.'/website/websiteaccount_card.php?action=create&fk_soc='.$object->id.'&backtopage='.urlencode($_SERVER["PHP_SELF"].'?id='.$object->id).'"><span class="valignmiddle text-plus-circle">' . $langs->trans("AddWebsiteAccount").'</span>';
|
||||
$newcardbutton.= '<span class="fa fa-plus-circle valignmiddle"></span>';
|
||||
$newcardbutton.= '</a>';
|
||||
} else {
|
||||
$newcardbutton .= '<a class="butActionNewRefused" href="#"><span class="valignmiddle text-plus-circle">'.$langs->trans("AddAction").'</span>';
|
||||
$newcardbutton.= '<span class="fa fa-plus-circle valignmiddle"></span>';
|
||||
$newcardbutton.= '</a>';
|
||||
$morehtmlright.= dolGetButtonTitle($langs->trans("AddWebsiteAccount"), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/website/websiteaccount_card.php?action=create&fk_soc='.$object->id.'&backtopage='.urlencode($_SERVER["PHP_SELF"].'?id='.$object->id));
|
||||
} else {
|
||||
$morehtmlright.= dolGetButtonTitle($langs->trans("AddAction"), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/website/websiteaccount_card.php?action=create&fk_soc='.$object->id.'&backtopage='.urlencode($_SERVER["PHP_SELF"].'?id='.$object->id), '', 0);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -388,10 +388,8 @@ if ($resql)
|
||||
$newcardbutton='';
|
||||
if($user->rights->supplier_proposal->creer)
|
||||
{
|
||||
$newcardbutton='<a class="butActionNew" href="'.DOL_URL_ROOT.'/supplier_proposal/card.php?action=create"><span class="valignmiddle text-plus-circle">'.$langs->trans('NewAskPrice').'</span>';
|
||||
$newcardbutton.= '<span class="fa fa-plus-circle valignmiddle"></span>';
|
||||
$newcardbutton.= '</a>';
|
||||
}
|
||||
$newcardbutton.= dolGetButtonTitle($langs->trans('NewAskPrice'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/supplier_proposal/card.php?action=create');
|
||||
}
|
||||
|
||||
// Lignes des champs de filtre
|
||||
print '<form method="POST" id="searchFormList" action="'.$_SERVER["PHP_SELF"].'">';
|
||||
|
||||
@ -84,7 +84,7 @@ if ($resql) {
|
||||
if ($paycode == 'CB') $paycode = 'CB';
|
||||
if ($paycode == 'CHQ') $paycode = 'CHEQUE';
|
||||
|
||||
$accountname="CASHDESK_ID_BANKACCOUNT_".$paycode;
|
||||
$accountname="CASHDESK_ID_BANKACCOUNT_".$paycode.$_SESSION["takeposterminal"];
|
||||
if (! empty($conf->global->$accountname) && $conf->global->$accountname > 0) array_push($paiements, $obj);
|
||||
}
|
||||
}
|
||||
|
||||
@ -624,7 +624,7 @@ if ($resql){
|
||||
if ($paycode == 'CB') $paycode = 'CARD';
|
||||
if ($paycode == 'CHQ') $paycode = 'CHEQUE';
|
||||
|
||||
$accountname="CASHDESK_ID_BANKACCOUNT_".$paycode;
|
||||
$accountname="CASHDESK_ID_BANKACCOUNT_".$paycode.$_SESSION["takeposterminal"];
|
||||
if (! empty($conf->global->$accountname) && $conf->global->$accountname > 0) array_push($paiementsModes, $obj);
|
||||
}
|
||||
}
|
||||
|
||||
219
htdocs/theme/eldy/btn.inc.php
Normal file
219
htdocs/theme/eldy/btn.inc.php
Normal file
@ -0,0 +1,219 @@
|
||||
<?php
|
||||
if (! defined('ISLOADEDBYSTEELSHEET')) die('Must be call by steelsheet'); ?>
|
||||
/* <style type="text/css" > */
|
||||
|
||||
|
||||
|
||||
/* ============================================================================== */
|
||||
/* Boutons actions */
|
||||
/* ============================================================================== */
|
||||
|
||||
div.divButAction {
|
||||
margin-bottom: 1.4em;
|
||||
}
|
||||
div.tabsAction > a.butAction, div.tabsAction > a.butActionRefused {
|
||||
margin-bottom: 1.4em !important;
|
||||
}
|
||||
div.tabsActionNoBottom > a.butAction, div.tabsActionNoBottom > a.butActionRefused {
|
||||
margin-bottom: 0 !important;
|
||||
}
|
||||
|
||||
span.butAction, span.butActionDelete {
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.butAction {
|
||||
background: rgb(225, 231, 225)
|
||||
/* background: rgb(230, 232, 239); */
|
||||
}
|
||||
.butActionRefused, .butAction, .butAction:link, .butAction:visited, .butAction:hover, .butAction:active, .butActionDelete, .butActionDelete:link, .butActionDelete:visited, .butActionDelete:hover, .butActionDelete:active {
|
||||
text-decoration: none;
|
||||
text-transform: uppercase;
|
||||
font-weight: bold;
|
||||
|
||||
margin: 0em <?php echo ($dol_optimize_smallscreen?'0.6':'0.9'); ?>em !important;
|
||||
padding: 0.6em <?php echo ($dol_optimize_smallscreen?'0.6':'0.7'); ?>em;
|
||||
font-family: <?php print $fontlist ?>;
|
||||
display: inline-block;
|
||||
text-align: center;
|
||||
cursor: pointer;
|
||||
/* color: #fff; */
|
||||
/* background: rgb(<?php echo $colorbackhmenu1 ?>); */
|
||||
color: #444;
|
||||
/* border: 1px solid #aaa; */
|
||||
/* border-color: rgba(0, 0, 0, 0.15) rgba(0, 0, 0, 0.15) rgba(0, 0, 0, 0.25); */
|
||||
|
||||
border-top-right-radius: 0 !important;
|
||||
border-bottom-right-radius: 0 !important;
|
||||
border-top-left-radius: 0 !important;
|
||||
border-bottom-left-radius: 0 !important;
|
||||
}
|
||||
.butActionNew, .butActionNewRefused, .butActionNew:link, .butActionNew:visited, .butActionNew:hover, .butActionNew:active {
|
||||
text-decoration: none;
|
||||
text-transform: uppercase;
|
||||
font-weight: normal;
|
||||
|
||||
margin: 0em 0.3em 0 0.3em !important;
|
||||
padding: 0.2em <?php echo ($dol_optimize_smallscreen?'0.4':'0.7'); ?>em 0.3em;
|
||||
font-family: <?php print $fontlist ?>;
|
||||
display: inline-block;
|
||||
/* text-align: center; New button are on right of screen */
|
||||
cursor: pointer;
|
||||
/*color: #fff !important;
|
||||
background: rgb(<?php echo $colorbackhmenu1 ?>);
|
||||
border: 1px solid rgb(<?php echo $colorbackhmenu1 ?>);
|
||||
border-color: rgba(0, 0, 0, 0.15) rgba(0, 0, 0, 0.15) rgba(0, 0, 0, 0.25);
|
||||
border-top-right-radius: 0 !important;
|
||||
border-bottom-right-radius: 0 !important;
|
||||
border-top-left-radius: 0 !important;
|
||||
border-bottom-left-radius: 0 !important;*/
|
||||
}
|
||||
a.butActionNew>span.fa-plus-circle, a.butActionNew>span.fa-plus-circle:hover { padding-left: 6px; font-size: 1.5em; border: none; box-shadow: none; webkit-box-shadow: none; }
|
||||
a.butActionNewRefused>span.fa-plus-circle, a.butActionNewRefused>span.fa-plus-circle:hover { padding-left: 6px; font-size: 1.5em; border: none; box-shadow: none; webkit-box-shadow: none; }
|
||||
|
||||
.butAction:hover {
|
||||
-webkit-box-shadow: 0px 0px 6px 1px rgba(50, 50, 50, 0.4), 0px 0px 0px rgba(60,60,60,0.1);
|
||||
box-shadow: 0px 0px 6px 1px rgba(50, 50, 50, 0.4), 0px 0px 0px rgba(60,60,60,0.1);
|
||||
}
|
||||
.butActionNew:hover {
|
||||
text-decoration: underline;
|
||||
box-shadow: unset !important;
|
||||
}
|
||||
|
||||
.butActionDelete, .butActionDelete:link, .butActionDelete:visited, .butActionDelete:hover, .butActionDelete:active, .buttonDelete {
|
||||
background: rgb(234, 228, 225);
|
||||
/* border: 1px solid #633; */
|
||||
color: #633;
|
||||
}
|
||||
|
||||
.butActionDelete:hover {
|
||||
-webkit-box-shadow: 0px 0px 6px 1px rgba(50, 50, 50, 0.4), 0px 0px 0px rgba(60,60,60,0.1);
|
||||
box-shadow: 0px 0px 6px 1px rgba(50, 50, 50, 0.4), 0px 0px 0px rgba(60,60,60,0.1);
|
||||
}
|
||||
|
||||
.butActionRefused {
|
||||
text-decoration: none !important;
|
||||
text-transform: uppercase;
|
||||
font-weight: bold !important;
|
||||
|
||||
white-space: nowrap !important;
|
||||
cursor: not-allowed !important;
|
||||
margin: 0em <?php echo ($dol_optimize_smallscreen?'0.6':'0.9'); ?>em;
|
||||
padding: 0.6em <?php echo ($dol_optimize_smallscreen?'0.6':'0.7'); ?>em;
|
||||
font-family: <?php print $fontlist ?> !important;
|
||||
display: inline-block;
|
||||
text-align: center;
|
||||
cursor: pointer;
|
||||
color: #999 !important;
|
||||
border: 1px solid #ccc;
|
||||
box-sizing: border-box;
|
||||
-moz-box-sizing: border-box;
|
||||
-webkit-box-sizing: border-box;
|
||||
}
|
||||
.butActionNewRefused, .butActionNewRefused:link, .butActionNewRefused:visited, .butActionNewRefused:hover, .butActionNewRefused:active {
|
||||
text-decoration: none !important;
|
||||
text-transform: uppercase;
|
||||
font-weight: normal !important;
|
||||
|
||||
white-space: nowrap !important;
|
||||
cursor: not-allowed !important;
|
||||
margin: 0em <?php echo ($dol_optimize_smallscreen?'0.7':'0.9'); ?>em;
|
||||
padding: 0.2em <?php echo ($dol_optimize_smallscreen?'0.4':'0.7'); ?>em;
|
||||
font-family: <?php print $fontlist ?> !important;
|
||||
display: inline-block;
|
||||
/* text-align: center; New button are on right of screen */
|
||||
cursor: pointer;
|
||||
color: #999 !important;
|
||||
padding-top: 0.2em;
|
||||
box-shadow: none !important;
|
||||
-webkit-box-shadow: none !important;
|
||||
}
|
||||
|
||||
.butActionTransparent {
|
||||
color: #222 ! important;
|
||||
background-color: transparent ! important;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
TITLE BUTTON
|
||||
*/
|
||||
|
||||
.btnTitle, a.btnTitle {
|
||||
display: inline-block;
|
||||
padding: 6px 12px;
|
||||
font-size: 14px
|
||||
font-weight: 400;
|
||||
line-height: 1.4;
|
||||
text-align: center;
|
||||
white-space: nowrap;
|
||||
vertical-align: middle;
|
||||
-ms-touch-action: manipulation;
|
||||
touch-action: manipulation;
|
||||
cursor: pointer;
|
||||
-webkit-user-select: none;
|
||||
-moz-user-select: none;
|
||||
-ms-user-select: none;
|
||||
user-select: none;
|
||||
box-shadow: none;
|
||||
text-decoration: none;
|
||||
position: relative;
|
||||
margin: 0 0 0 10px;
|
||||
min-width: 80px;
|
||||
text-align: center;
|
||||
color: rgb(<?php print $colortextlink; ?>);
|
||||
border: none;
|
||||
font-size: 12px;
|
||||
font-weight: 300;
|
||||
background-color: #fbfbfb;
|
||||
}
|
||||
|
||||
.btnTitle > .btnTitle-icon{
|
||||
|
||||
}
|
||||
|
||||
.btnTitle > .btnTitle-label{
|
||||
color: #666666;
|
||||
}
|
||||
|
||||
.btnTitle:hover, a.btnTitle:hover {
|
||||
border-radius: 3px;
|
||||
position: relative;
|
||||
margin: 0 0 0 10px;
|
||||
text-align: center;
|
||||
color: #ffffff;
|
||||
background-color: rgb(<?php print $colortextlink; ?>);
|
||||
font-size: 12px;
|
||||
text-decoration: none;
|
||||
box-shadow: none;
|
||||
}
|
||||
|
||||
.btnTitle.refused, a.btnTitle.refused, .btnTitle.refused:hover, a.btnTitle.refused:hover {
|
||||
color: #8a8a8a;
|
||||
cursor: not-allowed;
|
||||
background-color: #fbfbfb;
|
||||
background: repeating-linear-gradient( 45deg, #ffffff, #f1f1f1 4px, #f1f1f1 4px, #f1f1f1 4px );
|
||||
}
|
||||
|
||||
.btnTitle:hover .btnTitle-label{
|
||||
color: #ffffff;
|
||||
}
|
||||
|
||||
.btnTitle.refused .btnTitle-label, .btnTitle.refused:hover .btnTitle-label{
|
||||
color: #8a8a8a;
|
||||
}
|
||||
|
||||
.btnTitle>.fa {
|
||||
font-size: 20px;
|
||||
display: block;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<?php if (! empty($conf->global->MAIN_BUTTON_HIDE_UNAUTHORIZED) && (! $user->admin)) { ?>
|
||||
.butActionRefused, .butActionNewRefused, .btnTitle.refused {
|
||||
display: none !important;
|
||||
}
|
||||
<?php }
|
||||
@ -2348,139 +2348,7 @@ span.tabspan {
|
||||
/* ============================================================================== */
|
||||
/* Boutons actions */
|
||||
/* ============================================================================== */
|
||||
|
||||
div.divButAction {
|
||||
margin-bottom: 1.4em;
|
||||
}
|
||||
div.tabsAction > a.butAction, div.tabsAction > a.butActionRefused {
|
||||
margin-bottom: 1.4em !important;
|
||||
}
|
||||
div.tabsActionNoBottom > a.butAction, div.tabsActionNoBottom > a.butActionRefused {
|
||||
margin-bottom: 0 !important;
|
||||
}
|
||||
|
||||
span.butAction, span.butActionDelete {
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.butAction {
|
||||
background: rgb(225, 231, 225)
|
||||
/* background: rgb(230, 232, 239); */
|
||||
}
|
||||
.butActionRefused, .butAction, .butAction:link, .butAction:visited, .butAction:hover, .butAction:active, .butActionDelete, .butActionDelete:link, .butActionDelete:visited, .butActionDelete:hover, .butActionDelete:active {
|
||||
text-decoration: none;
|
||||
text-transform: uppercase;
|
||||
font-weight: bold;
|
||||
|
||||
margin: 0em <?php echo ($dol_optimize_smallscreen?'0.6':'0.9'); ?>em !important;
|
||||
padding: 0.6em <?php echo ($dol_optimize_smallscreen?'0.6':'0.7'); ?>em;
|
||||
font-family: <?php print $fontlist ?>;
|
||||
display: inline-block;
|
||||
text-align: center;
|
||||
cursor: pointer;
|
||||
/* color: #fff; */
|
||||
/* background: rgb(<?php echo $colorbackhmenu1 ?>); */
|
||||
color: #444;
|
||||
/* border: 1px solid #aaa; */
|
||||
/* border-color: rgba(0, 0, 0, 0.15) rgba(0, 0, 0, 0.15) rgba(0, 0, 0, 0.25); */
|
||||
|
||||
border-top-right-radius: 0 !important;
|
||||
border-bottom-right-radius: 0 !important;
|
||||
border-top-left-radius: 0 !important;
|
||||
border-bottom-left-radius: 0 !important;
|
||||
}
|
||||
.butActionNew, .butActionNewRefused, .butActionNew:link, .butActionNew:visited, .butActionNew:hover, .butActionNew:active {
|
||||
text-decoration: none;
|
||||
text-transform: uppercase;
|
||||
font-weight: normal;
|
||||
|
||||
margin: 0em 0.3em 0 0.3em !important;
|
||||
padding: 0.2em <?php echo ($dol_optimize_smallscreen?'0.4':'0.7'); ?>em 0.3em;
|
||||
font-family: <?php print $fontlist ?>;
|
||||
display: inline-block;
|
||||
/* text-align: center; New button are on right of screen */
|
||||
cursor: pointer;
|
||||
/*color: #fff !important;
|
||||
background: rgb(<?php echo $colorbackhmenu1 ?>);
|
||||
border: 1px solid rgb(<?php echo $colorbackhmenu1 ?>);
|
||||
border-color: rgba(0, 0, 0, 0.15) rgba(0, 0, 0, 0.15) rgba(0, 0, 0, 0.25);
|
||||
border-top-right-radius: 0 !important;
|
||||
border-bottom-right-radius: 0 !important;
|
||||
border-top-left-radius: 0 !important;
|
||||
border-bottom-left-radius: 0 !important;*/
|
||||
}
|
||||
a.butActionNew>span.fa-plus-circle, a.butActionNew>span.fa-plus-circle:hover { padding-left: 6px; font-size: 1.5em; border: none; box-shadow: none; webkit-box-shadow: none; }
|
||||
a.butActionNewRefused>span.fa-plus-circle, a.butActionNewRefused>span.fa-plus-circle:hover { padding-left: 6px; font-size: 1.5em; border: none; box-shadow: none; webkit-box-shadow: none; }
|
||||
|
||||
.butAction:hover {
|
||||
-webkit-box-shadow: 0px 0px 6px 1px rgba(50, 50, 50, 0.4), 0px 0px 0px rgba(60,60,60,0.1);
|
||||
box-shadow: 0px 0px 6px 1px rgba(50, 50, 50, 0.4), 0px 0px 0px rgba(60,60,60,0.1);
|
||||
}
|
||||
.butActionNew:hover {
|
||||
text-decoration: underline;
|
||||
box-shadow: unset !important;
|
||||
}
|
||||
|
||||
.butActionDelete, .butActionDelete:link, .butActionDelete:visited, .butActionDelete:hover, .butActionDelete:active, .buttonDelete {
|
||||
background: rgb(234, 228, 225);
|
||||
/* border: 1px solid #633; */
|
||||
color: #633;
|
||||
}
|
||||
|
||||
.butActionDelete:hover {
|
||||
-webkit-box-shadow: 0px 0px 6px 1px rgba(50, 50, 50, 0.4), 0px 0px 0px rgba(60,60,60,0.1);
|
||||
box-shadow: 0px 0px 6px 1px rgba(50, 50, 50, 0.4), 0px 0px 0px rgba(60,60,60,0.1);
|
||||
}
|
||||
|
||||
.butActionRefused {
|
||||
text-decoration: none !important;
|
||||
text-transform: uppercase;
|
||||
font-weight: bold !important;
|
||||
|
||||
white-space: nowrap !important;
|
||||
cursor: not-allowed !important;
|
||||
margin: 0em <?php echo ($dol_optimize_smallscreen?'0.6':'0.9'); ?>em;
|
||||
padding: 0.6em <?php echo ($dol_optimize_smallscreen?'0.6':'0.7'); ?>em;
|
||||
font-family: <?php print $fontlist ?> !important;
|
||||
display: inline-block;
|
||||
text-align: center;
|
||||
cursor: pointer;
|
||||
color: #999 !important;
|
||||
border: 1px solid #ccc;
|
||||
box-sizing: border-box;
|
||||
-moz-box-sizing: border-box;
|
||||
-webkit-box-sizing: border-box;
|
||||
}
|
||||
.butActionNewRefused, .butActionNewRefused:link, .butActionNewRefused:visited, .butActionNewRefused:hover, .butActionNewRefused:active {
|
||||
text-decoration: none !important;
|
||||
text-transform: uppercase;
|
||||
font-weight: normal !important;
|
||||
|
||||
white-space: nowrap !important;
|
||||
cursor: not-allowed !important;
|
||||
margin: 0em <?php echo ($dol_optimize_smallscreen?'0.7':'0.9'); ?>em;
|
||||
padding: 0.2em <?php echo ($dol_optimize_smallscreen?'0.4':'0.7'); ?>em;
|
||||
font-family: <?php print $fontlist ?> !important;
|
||||
display: inline-block;
|
||||
/* text-align: center; New button are on right of screen */
|
||||
cursor: pointer;
|
||||
color: #999 !important;
|
||||
padding-top: 0.2em;
|
||||
box-shadow: none !important;
|
||||
-webkit-box-shadow: none !important;
|
||||
}
|
||||
|
||||
.butActionTransparent {
|
||||
color: #222 ! important;
|
||||
background-color: transparent ! important;
|
||||
}
|
||||
|
||||
<?php if (! empty($conf->global->MAIN_BUTTON_HIDE_UNAUTHORIZED) && (! $user->admin)) { ?>
|
||||
.butActionRefused, .butActionNewRefused {
|
||||
display: none;
|
||||
}
|
||||
<?php } ?>
|
||||
|
||||
<?php include dol_buildpath($path.'/theme/'.$theme.'/btn.inc.php', 0); ?>
|
||||
|
||||
|
||||
/* ============================================================================== */
|
||||
@ -2839,9 +2707,9 @@ div.pagination li:last-child span {
|
||||
border-bottom-right-radius: 4px;*/
|
||||
}
|
||||
div.pagination li a:hover,
|
||||
div.pagination li:not(.paginationafterarrows) span:hover,
|
||||
div.pagination li:not(.paginationafterarrows,.title-button) span:hover,
|
||||
div.pagination li a:focus,
|
||||
div.pagination li:not(.paginationafterarrows) span:focus {
|
||||
div.pagination li:not(.paginationafterarrows,.title-button) span:focus {
|
||||
-webkit-box-shadow: 0px 0px 6px 1px rgba(50, 50, 50, 0.4), 0px 0px 0px rgba(60,60,60,0.1);
|
||||
box-shadow: 0px 0px 6px 1px rgba(50, 50, 50, 0.4), 0px 0px 0px rgba(60,60,60,0.1);
|
||||
}
|
||||
|
||||
@ -54,7 +54,7 @@ $colorbackbody='255,255,255';
|
||||
$colortexttitlenotab='100,60,20';
|
||||
$colortexttitle='0,0,0';
|
||||
$colortext='0,0,0';
|
||||
$colortextlink='0,0,100';
|
||||
$colortextlink='8, 85, 134';
|
||||
$fontsize='0.86em';
|
||||
$fontsizesmaller='0.75em';
|
||||
$topMenuFontSize='1.2em';
|
||||
|
||||
@ -451,12 +451,8 @@ if ($socid) print '<input type="hidden" name="socid" value="' . $socid . '"
|
||||
if ($projectid) print '<input type="hidden" name="projectid" value="' . $projectid . '" >';
|
||||
|
||||
$newcardbutton='';
|
||||
if ($user->rights->ticket->write)
|
||||
{
|
||||
$newcardbutton = '<a class="butActionNew" href="'.DOL_URL_ROOT.'/ticket/card.php?action=create' . ($socid ? '&socid=' . $socid : '') . ($projectid ? '&origin=projet_project&originid=' . $projectid : '') . '"><span class="valignmiddle text-plus-circle">' . $langs->trans('NewTicket').'</span>';
|
||||
$newcardbutton.= '<span class="fa fa-plus-circle valignmiddle"></span>';
|
||||
$newcardbutton.= '</a>';
|
||||
}
|
||||
$newcardbutton.= dolGetButtonTitle($langs->trans('NewTicket'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/ticket/card.php?action=create' . ($socid ? '&socid=' . $socid : '') . ($projectid ? '&origin=projet_project&originid=' . $projectid : ''), '', !empty($user->rights->ticket->write));
|
||||
|
||||
|
||||
print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'title_ticket', 0, $newcardbutton, '', $limit);
|
||||
|
||||
|
||||
@ -143,9 +143,7 @@ if ($resql)
|
||||
$newcardbutton='';
|
||||
if ($caneditperms)
|
||||
{
|
||||
$newcardbutton='<a class="butActionNew" href="'.DOL_URL_ROOT.'/user/group/card.php?action=create&leftmenu="><span class="valignmiddle text-plus-circle">'.$langs->trans('NewGroup').'</span>';
|
||||
$newcardbutton.= '<span class="fa fa-plus-circle valignmiddle"></span>';
|
||||
$newcardbutton.= '</a>';
|
||||
$newcardbutton.= dolGetButtonTitle($langs->trans('NewGroup'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/user/group/card.php?action=create&leftmenu=');
|
||||
}
|
||||
|
||||
print '<form method="POST" id="searchFormList" action="'.$_SERVER["PHP_SELF"].'">'."\n";
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user