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

This commit is contained in:
Marc de Lima Lucio 2018-03-05 11:05:38 +01:00
commit 1765b09fda
101 changed files with 1214 additions and 539 deletions

View File

@ -48,9 +48,11 @@ $MAXAGENDA=$conf->global->AGENDA_EXT_NB;
// List of aviable colors
$colorlist=array('BECEDD','DDBECE','BFDDBE','F598B4','F68654','CBF654','A4A4A5');
/*
* Actions
*/
if ($actionsave)
{
$db->begin();

View File

@ -631,7 +631,7 @@ print "<tr class=\"liste_titre\">\n";
print " <td>".$langs->trans("Name")."</td>\n";
print " <td>".$langs->trans("Value")."</td>\n";
print "</tr>\n";
print "<tr ".$bc[false].">\n <td width=\"140\">".$langs->trans("PathDirectory")."</td>\n <td>".$conf->propal->dir_output."</td>\n</tr>\n";
print "<tr ".$bc[false].">\n <td width=\"140\">".$langs->trans("PathDirectory")."</td>\n <td>".$conf->propal->multidir_output[$conf->entity]."</td>\n</tr>\n";
print "</table>\n<br>";

View File

@ -86,7 +86,7 @@ if (! empty($conf->syslog->enabled))
$filelogparam=$filelog;
if ($user->admin && preg_match('/^dolibarr.*\.log$/', basename($filelog)))
{
$filelogparam ='<a href="'.DOL_URL_ROOT.'/document.php?modulepart=logs&file=';
$filelogparam ='<a class="wordbreak" href="'.DOL_URL_ROOT.'/document.php?modulepart=logs&file=';
$filelogparam.=basename($filelog);
$filelogparam.='">'.$filelog.'</a>';
}

View File

@ -306,7 +306,7 @@ class Documents extends DolibarrApi
throw new RestException(404, 'Proposal not found');
}
$upload_dir = $conf->propal->dir_output . "/" . get_exdir(0, 0, 0, 1, $object, 'propal');
$upload_dir = $conf->propal->multidir_output[$object->entity] . "/" . get_exdir(0, 0, 0, 1, $object, 'propal');
}
else if ($modulepart == 'commande' || $modulepart == 'order')
{

View File

@ -667,11 +667,12 @@ class BlockedLog
return -2;
}
if (empty($this->action) || empty($this->fk_user) || empty($this->user_fullname)) {
if (empty($this->action)) {
$this->error=$langs->trans("BadParameterWhenCallingCreateOfBlockedLog");
dol_syslog($this->error, LOG_WARNING);
return -3;
}
if (empty($this->fk_user)) $this->user_fullname='(Anonymous)';
$this->date_creation = dol_now();

View File

@ -212,7 +212,7 @@ class ActionComm extends CommonObject
$now=dol_now();
// Check parameters
if (empty($this->userownerid))
if (! isset($this->userownerid) || $this->userownerid === '') // $this->userownerid may be 0 (anonymous event) of > 0
{
dol_syslog("You tried to create an event but mandatory property ownerid was not defined", LOG_WARNING);
$this->errors[]='ErrorPropertyUserowneridNotDefined';

View File

@ -559,7 +559,7 @@ if ($object->id > 0)
// Lien recap
$boxstat.='<div class="box">';
$boxstat.='<table summary="'.dol_escape_htmltag($langs->trans("DolibarrStateBoard")).'" class="border boxtable boxtablenobottom" width="100%">';
$boxstat.='<table summary="'.dol_escape_htmltag($langs->trans("DolibarrStateBoard")).'" class="border boxtable boxtablenobottom boxtablenotop" width="100%">';
$boxstat.='<tr class="impair"><td colspan="2" class="tdboxstats nohover">';
if (! empty($conf->propal->enabled))

View File

@ -676,8 +676,8 @@ if (! empty($conf->propal->enabled) && $user->rights->propal->lire)
{
$langs->load("propal");
$sql = "SELECT s.nom as name, s.rowid, p.rowid as propalid, p.total as total_ttc, p.total_ht, p.tva as total_tva, p.ref, p.ref_client, p.fk_statut, p.datep as dp, p.fin_validite as dfv";
$sql.= ", s.code_client";
$sql = "SELECT s.nom as name, s.rowid, s.code_client";
$sql.= ", p.rowid as propalid, p.entity, p.total as total_ttc, p.total_ht, p.tva as total_tva, p.ref, p.ref_client, p.fk_statut, p.datep as dp, p.fin_validite as dfv";
$sql.= " FROM ".MAIN_DB_PREFIX."societe as s";
$sql.= ", ".MAIN_DB_PREFIX."propal as p";
if (! $user->rights->societe->client->voir && ! $socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
@ -726,7 +726,7 @@ if (! empty($conf->propal->enabled) && $user->rights->propal->lire)
print '</td>';
print '<td width="16" align="center" class="nobordernopadding">';
$filename=dol_sanitizeFileName($obj->ref);
$filedir=$conf->propal->dir_output . '/' . dol_sanitizeFileName($obj->ref);
$filedir=$conf->propal->multidir_output[$obj->entity] . '/' . dol_sanitizeFileName($obj->ref);
$urlsource=$_SERVER['PHP_SELF'].'?id='.$obj->propalid;
print $formfile->getDocumentsLink($propalstatic->element, $filename, $filedir);
print '</td></tr></table>';

View File

@ -967,7 +967,7 @@ else
* Boutons d'action
*/
if (GETPOST('cancel','alpha') || $confirm=='no' || $action == '' || in_array($action,array('settodraft', 'valid','delete','sendall','clone')))
if (GETPOST('cancel','alpha') || $confirm=='no' || $action == '' || in_array($action,array('settodraft','valid','delete','sendall','clone','test')))
{
print "\n\n<div class=\"tabsAction\">\n";
@ -1071,7 +1071,9 @@ else
print '<div id="formmailbeforetitle" name="formmailbeforetitle"></div>';
print load_fiche_titre($langs->trans("TestMailing"));
// Create l'objet formulaire mail
dol_fiche_head(null, '', '', -1);
// Create l'objet formulaire mail
include_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php';
$formmail = new FormMail($db);
$formmail->fromname = $object->email_from;
@ -1099,6 +1101,10 @@ else
print $formmail->get_form();
print '<br>';
dol_fiche_end();
print dol_set_focus('#sendto');
}
@ -1114,7 +1120,7 @@ else
dol_fiche_head('', '', '', -1);
print '<table class="border" width="100%">';
print '<table class="bordernooddeven" width="100%">';
// Subject
print '<tr><td class="titlefield">'.$langs->trans("MailTopic").'</td><td colspan="3">'.$object->sujet.'</td></tr>';
@ -1260,7 +1266,7 @@ else
dol_fiche_head(null, '', '', -1);
print '<table class="border" width="100%">';
print '<table class="bordernooddeven" width="100%">';
// Subject
print '<tr><td class="fieldrequired titlefield">'.$langs->trans("MailTopic").'</td><td colspan="3"><input class="flat quatrevingtpercent" type="text" name="sujet" value="'.$object->sujet.'"></td></tr>';

View File

@ -260,7 +260,7 @@ if ($object->fetch($id) >= 0)
print load_fiche_titre($langs->trans("ToAddRecipientsChooseHere"), ($user->admin?info_admin($langs->trans("YouCanAddYourOwnPredefindedListHere"),1):''), 'title_generic');
//print '<table class="noborder" width="100%">';
print '<div class="tagtable centpercent liste_titre_bydiv" id="tablelines">';
print '<div class="tagtable centpercent liste_titre_bydiv borderbottom" id="tablelines">';
//print '<tr class="liste_titre">';
print '<div class="tagtr liste_titre">';

View File

@ -1292,7 +1292,7 @@ if (empty($reshook))
}
// Actions to build doc
$upload_dir = $conf->propal->dir_output;
$upload_dir = $conf->propal->multidir_output[$object->entity];
$permissioncreate=$user->rights->propal->creer;
include DOL_DOCUMENT_ROOT.'/core/actions_builddoc.inc.php';
@ -1912,7 +1912,7 @@ if ($action == 'create')
print '</form>';
} else {
if ($object->date) {
print dol_print_date($object->date, 'daytext');
print dol_print_date($object->date, 'day');
} else {
print '&nbsp;';
}
@ -1938,7 +1938,7 @@ if ($action == 'create')
print '</form>';
} else {
if (! empty($object->fin_validite)) {
print dol_print_date($object->fin_validite, 'daytext');
print dol_print_date($object->fin_validite, 'day');
if ($object->statut == Propal::STATUS_VALIDATED && $object->fin_validite < ($now - $conf->propal->cloture->warning_delay))
print img_warning($langs->trans("Late"));
} else {
@ -2416,7 +2416,7 @@ if ($action == 'create')
* Documents generes
*/
$filename = dol_sanitizeFileName($object->ref);
$filedir = $conf->propal->dir_output . "/" . dol_sanitizeFileName($object->ref);
$filedir = $conf->propal->multidir_output[$object->entity] . "/" . dol_sanitizeFileName($object->ref);
$urlsource = $_SERVER["PHP_SELF"] . "?id=" . $object->id;
$genallowed = $user->rights->propal->lire;
$delallowed = $user->rights->propal->creer;
@ -2457,7 +2457,7 @@ if ($action == 'create')
// Presend form
$modelmail='propal_send';
$defaulttopic='SendPropalRef';
$diroutput = $conf->propal->dir_output;
$diroutput = $conf->propal->multidir_output[$object->entity];
$trackid = 'pro'.$object->id;
include DOL_DOCUMENT_ROOT.'/core/tpl/card_presend.tpl.php';

View File

@ -1749,8 +1749,8 @@ class Propal extends CommonObject
// to not lose the linked files
$oldref = dol_sanitizeFileName($this->ref);
$newref = dol_sanitizeFileName($num);
$dirsource = $conf->propal->dir_output.'/'.$oldref;
$dirdest = $conf->propal->dir_output.'/'.$newref;
$dirsource = $conf->propal->multidir_output[$this->entity].'/'.$oldref;
$dirdest = $conf->propal->multidir_output[$this->entity].'/'.$newref;
if (file_exists($dirsource))
{
@ -1759,7 +1759,7 @@ class Propal extends CommonObject
{
dol_syslog("Rename ok");
// Rename docs starting with $oldref with $newref
$listoffiles=dol_dir_list($conf->propal->dir_output.'/'.$newref, 'files', 1, '^'.preg_quote($oldref,'/'));
$listoffiles=dol_dir_list($dirdest, 'files', 1, '^'.preg_quote($oldref,'/'));
foreach($listoffiles as $fileentry)
{
$dirsource=$fileentry['name'];
@ -2815,9 +2815,9 @@ class Propal extends CommonObject
{
// We remove directory
$ref = dol_sanitizeFileName($this->ref);
if ($conf->propal->dir_output && !empty($this->ref))
if ($conf->propal->multidir_output[$this->entity] && !empty($this->ref))
{
$dir = $conf->propal->dir_output . "/" . $ref ;
$dir = $conf->propal->multidir_output[$this->entity] . "/" . $ref ;
$file = $dir . "/" . $ref . ".pdf";
if (file_exists($file))
{

View File

@ -75,7 +75,7 @@ $object->fetch($id,$ref);
if ($object->id > 0)
{
$object->fetch_thirdparty();
$upload_dir = $conf->propal->dir_output.'/'.dol_sanitizeFileName($object->ref);
$upload_dir = $conf->propal->multidir_output[$object->entity].'/'.dol_sanitizeFileName($object->ref);
include_once DOL_DOCUMENT_ROOT . '/core/actions_linkedfiles.inc.php';
}
@ -90,7 +90,7 @@ $form = new Form($db);
if ($object->id > 0)
{
$upload_dir = $conf->propal->dir_output.'/'.dol_sanitizeFileName($object->ref);
$upload_dir = $conf->propal->multidir_output[$object->entity].'/'.dol_sanitizeFileName($object->ref);
$head = propal_prepare_head($object);
dol_fiche_head($head, 'document', $langs->trans('Proposal'), -1, 'propal');

View File

@ -216,7 +216,7 @@ $max=5;
* Last modified proposals
*/
$sql = "SELECT c.rowid, c.ref, c.fk_statut, s.nom as socname, s.rowid as socid, s.canvas, s.client,";
$sql = "SELECT c.rowid, c.entity, c.ref, c.fk_statut, s.nom as socname, s.rowid as socid, s.canvas, s.client,";
$sql.= " date_cloture as datec";
$sql.= " FROM ".MAIN_DB_PREFIX."propal as c";
$sql.= ", ".MAIN_DB_PREFIX."societe as s";
@ -262,7 +262,7 @@ if ($resql)
print '<td width="16" align="right" class="nobordernopadding">';
$filename=dol_sanitizeFileName($obj->ref);
$filedir=$conf->propal->dir_output . '/' . dol_sanitizeFileName($obj->ref);
$filedir=$conf->propal->multidir_output[$obj->entity] . '/' . dol_sanitizeFileName($obj->ref);
$urlsource=$_SERVER['PHP_SELF'].'?id='.$obj->rowid;
print $formfile->getDocumentsLink($propalstatic->element, $filename, $filedir);
print '</td></tr></table>';
@ -296,7 +296,8 @@ if (! empty($conf->propal->enabled) && $user->rights->propale->lire)
$now=dol_now();
$sql = "SELECT s.nom as socname, s.rowid as socid, s.canvas, s.client, p.rowid as propalid, p.total as total_ttc, p.total_ht, p.ref, p.fk_statut, p.datep as dp, p.fin_validite as dfv";
$sql = "SELECT s.nom as socname, s.rowid as socid, s.canvas, s.client";
$sql.= ", p.rowid as propalid, p.entity, p.total as total_ttc, p.total_ht, p.ref, p.fk_statut, p.datep as dp, p.fin_validite as dfv";
$sql.= " FROM ".MAIN_DB_PREFIX."societe as s";
$sql.= ", ".MAIN_DB_PREFIX."propal as p";
if (!$user->rights->societe->client->voir && !$socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
@ -341,7 +342,7 @@ if (! empty($conf->propal->enabled) && $user->rights->propale->lire)
print '</td>';
print '<td width="16" align="center" class="nobordernopadding">';
$filename=dol_sanitizeFileName($obj->ref);
$filedir=$conf->propal->dir_output . '/' . dol_sanitizeFileName($obj->ref);
$filedir=$conf->propal->multidir_output[$obj->entity] . '/' . dol_sanitizeFileName($obj->ref);
$urlsource=$_SERVER['PHP_SELF'].'?id='.$obj->propalid;
print $formfile->getDocumentsLink($propalstatic->element, $filename, $filedir);
print '</td></tr></table>';

View File

@ -110,7 +110,7 @@ if (! empty($socid))
}
$result = restrictedArea($user, $module, $objectid, $dbtable);
$diroutputmassaction=$conf->propal->dir_output . '/temp/massgeneration/'.$user->id;
$diroutputmassaction=$conf->propal->multidir_output[$conf->entity] . '/temp/massgeneration/'.$user->id;
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
$hookmanager->initHooks(array('propallist'));
@ -214,7 +214,7 @@ if (empty($reshook))
$objectlabel='Proposals';
$permtoread = $user->rights->propal->lire;
$permtodelete = $user->rights->propal->supprimer;
$uploaddir = $conf->propal->dir_output;
$uploaddir = $conf->propal->multidir_output[$conf->entity];
include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php';
}
@ -242,7 +242,7 @@ if ($sall || $search_product_category > 0) $sql = 'SELECT DISTINCT';
$sql.= ' s.rowid as socid, s.nom as name, s.email, s.town, s.zip, s.fk_pays, s.client, s.code_client, ';
$sql.= " typent.code as typent_code,";
$sql.= " state.code_departement as state_code, state.nom as state_name,";
$sql.= ' p.rowid, p.note_private, p.total_ht, p.tva as total_vat, p.total as total_ttc, p.localtax1, p.localtax2, p.ref, p.ref_client, p.fk_statut, p.fk_user_author, p.datep as dp, p.fin_validite as dfv,';
$sql.= ' p.rowid, p.entity, p.note_private, p.total_ht, p.tva as total_vat, p.total as total_ttc, p.localtax1, p.localtax2, p.ref, p.ref_client, p.fk_statut, p.fk_user_author, p.datep as dp, p.fin_validite as dfv,';
$sql.= ' p.datec as date_creation, p.tms as date_update,';
$sql.= " pr.rowid as project_id, pr.ref as project_ref,";
if (! $user->rights->societe->client->voir && ! $socid) $sql .= " sc.fk_soc, sc.fk_user,";
@ -462,7 +462,7 @@ if ($resql)
$varpage=empty($contextpage)?$_SERVER["PHP_SELF"]:$contextpage;
$selectedfields=$form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage); // This also change content of $arrayfields
if ($massactionbutton) $selectedfields.=$form->showCheckAddButtons('checkforselect', 1);
$selectedfields.=(count($arrayofmassactions) ? $form->showCheckAddButtons('checkforselect', 1) : '');
print '<div class="div-table-responsive">';
print '<table class="tagtable liste'.($moreforfilter?" listwithfilterbefore":"").'">'."\n";
@ -663,7 +663,7 @@ if ($resql)
// Other picto tool
print '<td width="16" align="right" class="nobordernopadding">';
$filename=dol_sanitizeFileName($obj->ref);
$filedir=$conf->propal->dir_output . '/' . dol_sanitizeFileName($obj->ref);
$filedir=$conf->propal->multidir_output[$obj->entity] . '/' . dol_sanitizeFileName($obj->ref);
$urlsource=$_SERVER['PHP_SELF'].'?id='.$obj->rowid;
print $formfile->getDocumentsLink($objectstatic->element, $filename, $filedir);
print '</td></tr></table>';

View File

@ -4067,7 +4067,7 @@ class OrderLine extends CommonOrderLine
$sql.= " ".(! empty($this->date_start)?"'".$this->db->idate($this->date_start)."'":"null").',';
$sql.= " ".(! empty($this->date_end)?"'".$this->db->idate($this->date_end)."'":"null").',';
$sql.= ' '.(!$this->fk_unit ? 'NULL' : $this->fk_unit);
$sql.= ", ".$this->fk_multicurrency;
$sql.= ", ".(! empty($this->fk_multicurrency) ? $this->fk_multicurrency : 'NULL');
$sql.= ", '".$this->db->escape($this->multicurrency_code)."'";
$sql.= ", ".$this->multicurrency_subprice;
$sql.= ", ".$this->multicurrency_total_ht;

View File

@ -73,16 +73,16 @@ $description=GETPOST("description",'alpha');
$dateop = dol_mktime(12,0,0,GETPOST("opmonth",'int'),GETPOST("opday",'int'),GETPOST("opyear",'int'));
$debit=GETPOST("debit",'alpha');
$credit=GETPOST("credit",'alpha');
$type=GETPOST("type",'alpha');
$account=GETPOST("account",'int');
$accountancy_code=GETPOST('accountancy_code', 'alpha');
$bid=GETPOST("bid","int");
$search_type=GETPOST("search_type",'alpha');
$search_account=GETPOST("search_account",'int')?GETPOST("search_account",'int'):GETPOST("account",'int');
$search_accountancy_code=GETPOST('search_accountancy_code', 'alpha')?GETPOST('search_accountancy_code', 'alpha'):GETPOST('accountancy_code', 'alpha');
$search_bid=GETPOST("search_bid","int")?GETPOST("search_bid","int"):GETPOST("bid","int");
$search_ref=GETPOST('search_ref','alpha');
$search_dt_start = dol_mktime(0, 0, 0, GETPOST('search_start_dtmonth', 'int'), GETPOST('search_start_dtday', 'int'), GETPOST('search_start_dtyear', 'int'));
$search_dt_end = dol_mktime(0, 0, 0, GETPOST('search_end_dtmonth', 'int'), GETPOST('search_end_dtday', 'int'), GETPOST('search_end_dtyear', 'int'));
$search_dv_start = dol_mktime(0, 0, 0, GETPOST('search_start_dvmonth', 'int'), GETPOST('search_start_dvday', 'int'), GETPOST('search_start_dvyear', 'int'));
$search_dv_end = dol_mktime(0, 0, 0, GETPOST('search_end_dvmonth', 'int'), GETPOST('search_end_dvday', 'int'), GETPOST('search_end_dvyear', 'int'));
$search_thirdparty=GETPOST("thirdparty",'alpha');
$search_thirdparty=GETPOST("search_thirdparty",'alpha')?GETPOST("search_thirdparty",'alpha'):GETPOST("thirdparty",'alpha');
$search_req_nb=GETPOST("req_nb",'alpha');
$search_num_releve=GETPOST("search_num_releve",'alpha');
$search_conciliated=GETPOST("search_conciliated",'int');
@ -108,7 +108,7 @@ $mode_balance_ok=false;
if (($sortfield == 'b.datev' || $sortfield == 'b.datev,b.dateo,b.rowid'))
{
$sortfield = 'b.datev,b.dateo,b.rowid';
if ($id > 0 || ! empty($ref) || $account > 0) $mode_balance_ok = true;
if ($id > 0 || ! empty($ref) || $search_account > 0) $mode_balance_ok = true;
}
if (strtolower($sortorder) == 'desc') $mode_balance_ok = false;
@ -116,7 +116,7 @@ $object = new Account($db);
if ($id > 0 || ! empty($ref))
{
$result=$object->fetch($id, $ref);
$account = $object->id; // Force the search field on id of account
$search_account = $object->id; // Force the search field on id of account
}
@ -179,10 +179,10 @@ if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter.x',
$search_dv_start='';
$search_dv_end='';
$description="";
$type="";
$search_type="";
$debit="";
$credit="";
$bid="";
$search_bid="";
$search_ref="";
$search_req_nb='';
$search_thirdparty='';
@ -190,8 +190,8 @@ if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter.x',
$search_conciliated='';
$thirdparty='';
$account="";
if ($id > 0 || ! empty($ref)) $account=$object->id;
$search_account="";
if ($id > 0 || ! empty($ref)) $search_account=$object->id;
}
if (empty($reshook))
@ -297,7 +297,7 @@ if (GETPOST('save') && ! $cancel && $user->rights->banque->modifier)
$error++;
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("BankAccount")), null, 'errors');
}
/*if (! empty($conf->accounting->enabled) && (empty($accountancy_code) || $accountancy_code == '-1'))
/*if (! empty($conf->accounting->enabled) && (empty($search_accountancy_code) || $search_accountancy_code == '-1'))
{
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("AccountAccounting")), null, 'errors');
$error++;
@ -307,7 +307,7 @@ if (GETPOST('save') && ! $cancel && $user->rights->banque->modifier)
{
$objecttmp = new Account($db);
$objecttmp->fetch($bankaccountid);
$insertid = $objecttmp->addline($dateop, $operation, $label, $amount, $num_chq, ($cat1 > 0 ? $cat1 : 0), $user, '', '', $accountancy_code);
$insertid = $objecttmp->addline($dateop, $operation, $label, $amount, $num_chq, ($cat1 > 0 ? $cat1 : 0), $user, '', '', $search_accountancy_code);
if ($insertid > 0)
{
setEventMessages($langs->trans("RecordSaved"), null, 'mesgs');
@ -364,26 +364,27 @@ $now = dol_now();
// Must be before button action
$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 ($id > 0) $param.='&id='.urlencode($id);
if (!empty($ref)) $param.='&ref='.urlencode($ref);
if (!empty($search_ref)) $param.='&search_ref='.urlencode($search_ref);
if (!empty($description)) $param.='&description='.urlencode($description);
if (!empty($type)) $param.='&type='.urlencode($type);
if (!empty($debit)) $param.='&debit='.$debit;
if (!empty($credit)) $param.='&credit='.$credit;
if (!empty($account)) $param.='&account='.$account;
if (!empty($search_type)) $param.='&type='.urlencode($search_type);
if (!empty($search_thirdparty)) $param.='&search_thirdparty='.urlencode($search_thirdparty);
if (!empty($debit)) $param.='&debit='.urlencode($debit);
if (!empty($credit)) $param.='&credit='.urlencode($credit);
if (!empty($search_account)) $param.='&search_account='.urlencode($search_account);
if (!empty($search_num_releve)) $param.='&search_num_releve='.urlencode($search_num_releve);
if ($search_conciliated != '' && $search_conciliated != '-1') $param.='&search_conciliated='.urlencode($search_conciliated);
if (!empty($bid)) $param.='&bid='.$bid;
if ($search_bid > 0) $param.='&search_bid='.urlencode($search_bid);
if (dol_strlen($search_dt_start) > 0) $param .= '&search_start_dtmonth=' . GETPOST('search_start_dtmonth', 'int') . '&search_start_dtday=' . GETPOST('search_start_dtday', 'int') . '&search_start_dtyear=' . GETPOST('search_start_dtyear', 'int');
if (dol_strlen($search_dt_end) > 0) $param .= '&search_end_dtmonth=' . GETPOST('search_end_dtmonth', 'int') . '&search_end_dtday=' . GETPOST('search_end_dtday', 'int') . '&search_end_dtyear=' . GETPOST('search_end_dtyear', 'int');
if (dol_strlen($search_dv_start) > 0) $param .= '&search_start_dvmonth=' . GETPOST('search_start_dvmonth', 'int') . '&search_start_dvday=' . GETPOST('search_start_dvday', 'int') . '&search_start_dvyear=' . GETPOST('search_start_dvyear', 'int');
if (dol_strlen($search_dv_end) > 0) $param .= '&search_end_dvmonth=' . GETPOST('search_end_dvmonth', 'int') . '&search_end_dvday=' . GETPOST('search_end_dvday', 'int') . '&search_end_dvyear=' . GETPOST('search_end_dvyear', 'int');
if ($search_req_nb) $param.='&amp;req_nb='.urlencode($search_req_nb);
if (GETPOST("thirdparty")) $param.='&amp;thirdparty='.urlencode(GETPOST("thirdparty"));
if ($optioncss != '') $param.='&optioncss='.$optioncss;
if ($search_req_nb) $param.='&req_nb='.urlencode($search_req_nb);
if (GETPOST("search_thirdparty",'int')) $param.='&thirdparty='.urlencode(GETPOST("search_thirdparty",'int'));
if ($optioncss != '') $param.='&optioncss='.urlencode($optioncss);
// Add $param from extra fields
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_param.tpl.php';
@ -454,7 +455,7 @@ $parameters=array();
$reshook=$hookmanager->executeHooks('printFieldListSelect',$parameters); // Note that $action and $object may have been modified by hook
$sql.=$hookmanager->resPrint;
$sql.= " FROM ";
if ($bid) $sql.= MAIN_DB_PREFIX."bank_class as l,";
if ($search_bid) $sql.= MAIN_DB_PREFIX."bank_class as l,";
$sql.= " ".MAIN_DB_PREFIX."bank_account as ba,";
$sql.= " ".MAIN_DB_PREFIX."bank as b";
if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label)) $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."bank_extrafields as ef on (b.rowid = ef.fk_object)";
@ -462,21 +463,21 @@ $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."bank_url as bu ON bu.fk_bank = b.rowid AND
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON bu.url_id = s.rowid";
$sql.= " WHERE b.fk_account = ba.rowid";
$sql.= " AND ba.entity IN (".getEntity('bank_account').")";
if ($account > 0) $sql.=" AND b.fk_account = ".$account;
if ($search_account > 0) $sql.=" AND b.fk_account = ".$search_account;
// Search period criteria
if (dol_strlen($search_dt_start)>0) $sql .= " AND b.dateo >= '" . $db->idate($search_dt_start) . "'";
if (dol_strlen($search_dt_end)>0) $sql .= " AND b.dateo <= '" . $db->idate($search_dt_end) . "'";
// Search period criteria
if (dol_strlen($search_dv_start)>0) $sql .= " AND b.datev >= '" . $db->idate($search_dv_start) . "'";
if (dol_strlen($search_dv_end)>0) $sql .= " AND b.datev <= '" . $db->idate($search_dv_end) . "'";
if ($search_ref) $sql.=natural_search("b.rowid", $search_ref);
if ($search_ref) $sql.=natural_search("b.rowid", $search_ref, 1);
if ($search_req_nb) $sql.= natural_search("b.num_chq", $search_req_nb);
if ($search_num_releve) $sql.= natural_search("b.num_releve", $search_num_releve);
if ($search_conciliated != '' && $search_conciliated != '-1') $sql.= " AND b.rappro = ".$search_conciliated;
if ($search_thirdparty) $sql.= natural_search("s.nom", $search_thirdparty);
if ($description) $sql.= natural_search("b.label", $description); // Warning some text are just translation keys, not translated strings
if ($bid) $sql.= " AND b.rowid=l.lineid AND l.fk_categ=".$bid;
if (! empty($type)) $sql.= " AND b.fk_type = '".$db->escape($type)."' ";
if ($search_bid > 0) $sql.= " AND b.rowid=l.lineid AND l.fk_categ=".$search_bid;
if (! empty($search_type)) $sql.= " AND b.fk_type = '".$db->escape($search_type)."' ";
// Search criteria amount
$debit = price2num(str_replace('-','',$debit));
$credit = price2num(str_replace('-','',$credit));
@ -518,11 +519,11 @@ if ($page >= $nbtotalofpages)
}
// If not account defined $mode_balance_ok=false
if (empty($account)) $mode_balance_ok=false;
if (empty($search_account)) $mode_balance_ok=false;
// If a search is done $mode_balance_ok=false
if (! empty($search_ref)) $mode_balance_ok=false;
if (! empty($req_nb)) $mode_balance_ok=false;
if (! empty($type)) $mode_balance_ok=false;
if (! empty($search_type)) $mode_balance_ok=false;
if (! empty($debit)) $mode_balance_ok=false;
if (! empty($credit)) $mode_balance_ok=false;
if (! empty($thirdparty)) $mode_balance_ok=false;
@ -643,7 +644,7 @@ if ($resql)
print '<td>&nbsp;</td>';
print '<td>'.$langs->trans("Type").'</td>';
print '<td>'.$langs->trans("Numero").'</td>';
//if (! $account > 0)
//if (! $search_account > 0)
//{
print '<td align=right>'.$langs->trans("BankAccount").'</td>';
//}
@ -677,10 +678,10 @@ if ($resql)
print '<td>';
print '<input name="num_chq" class="flat" type="text" size="4" value="'.GETPOST("num_chq","alpha").'">';
print '</td>';
//if (! $account > 0)
//if (! $search_account > 0)
//{
print '<td align=right>';
$form->select_comptes(GETPOST('add_account','int')?GETPOST('add_account','int'):$account,'add_account',0,'',1, ($id > 0 || ! empty($ref)?' disabled="disabled"':''));
$form->select_comptes(GETPOST('add_account','int')?GETPOST('add_account','int'):$search_account,'add_account',0,'',1, ($id > 0 || ! empty($ref)?' disabled="disabled"':''));
print '</td>';
//}
print '<td align="right"><input name="adddebit" class="flat" type="text" size="4" value="'.GETPOST("adddebit","alpha").'"></td>';
@ -688,7 +689,7 @@ if ($resql)
/*if (! empty($conf->accounting->enabled))
{
print '<td align="center">';
print $formaccounting->select_account($accountancy_code, 'accountancy_code', 1, null, 1, 1, '');
print $formaccounting->select_account($search_accountancy_code, 'search_accountancy_code', 1, null, 1, 1, '');
print '</td>';
}*/
print '<td align="center">';
@ -733,7 +734,7 @@ if ($resql)
if (! empty($conf->global->BANK_USE_VARIOUS_PAYMENT)) // If direct entries is done using miscellaneous payments
{
if ($user->rights->banque->modifier) {
$addbutton = '<a class="butAction" href="'.DOL_URL_ROOT.'/compta/bank/various_payment/card.php?action=create&accountid='.$account.'&backtopage='.urlencode($_SERVER['PHP_SELF'].'?id='.$account).'">'.$langs->trans("AddBankRecord").'</a>';
$addbutton = '<a class="butAction" href="'.DOL_URL_ROOT.'/compta/bank/various_payment/card.php?action=create&accountid='.$search_account.'&backtopage='.urlencode($_SERVER['PHP_SELF'].'?id='.$search_account).'">'.$langs->trans("AddBankRecord").'</a>';
} else {
$addbutton = '<a class="butActionRefused" title="'.$langs->trans("NotEnoughPermissions").'" href="#">'.$langs->trans("AddBankRecord").'</a>';
}
@ -768,15 +769,8 @@ if ($resql)
$picto='title_bank';
if ($id > 0 || ! empty($ref)) $picto='';
if (GETPOST("bid"))
{
$result=$bankcateg->fetch(GETPOST("bid"));
print_barre_liste($langs->trans("BankTransactionForCategory",$bankcateg->label).' '.($socid?' '.$soc->name:''), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, $picto, 0, $morehtml, '', $limit);
}
else
{
print_barre_liste($langs->trans("BankTransactions"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, $picto, 0, $morehtml, '', $limit);
}
print_barre_liste($langs->trans("BankTransactions"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, $picto, 0, $morehtml, '', $limit);
// We can add page now to param
if ($page != '') $param.='&page='.urlencode($page);
@ -799,6 +793,22 @@ if ($resql)
$moreforfilter .= '<div class="nowrap'.($conf->browser->layout=='phone'?' centpercent':'').' inline-block">'.$langs->trans('to') . ' ' . $form->select_date($search_dv_end, 'search_end_dv', 0, 0, 1, "search_form", 1, 0, 1).'</div>';
$moreforfilter .= '</div>';
if (! empty($conf->categorie->enabled))
{
// Categories
if (! empty($conf->categorie->enabled) && ! empty($user->rights->categorie->lire))
{
$langs->load('categories');
// Bank line
$moreforfilter.='<div class="divsearchfield">';
$moreforfilter.=$langs->trans('RubriquesTransactions').' : ';
$cate_arbo = $form->select_all_categories(Categorie::TYPE_BANK_LINE, $search_bid, 'parent', null, null, 1);
$moreforfilter.=$form->selectarray('search_bid', $cate_arbo, $search_bid, 1);
$moreforfilter.='</div>';
}
}
$parameters=array();
$reshook=$hookmanager->executeHooks('printFieldPreListTitle',$parameters); // Note that $action and $object may have been modified by hook
if (empty($reshook)) $moreforfilter .= $hookmanager->resPrint;
@ -842,7 +852,7 @@ if ($resql)
if (! empty($arrayfields['type']['checked']))
{
print '<td class="liste_titre" align="center">';
$form->select_types_paiements(empty($type)?'':$type, 'type', '', 2, 0, 1, 0, 1, 'maxwidth100');
$form->select_types_paiements(empty($search_type)?'':$search_type, 'search_type', '', 2, 0, 1, 0, 1, 'maxwidth100');
print '</td>';
}
if (! empty($arrayfields['b.num_chq']['checked']))
@ -852,12 +862,12 @@ if ($resql)
}
if (! empty($arrayfields['bu.label']['checked']))
{
print '<td class="liste_titre"><input type="text" class="flat" name="thirdparty" value="'.dol_escape_htmltag($search_thirdparty).'" size="10"></td>';
print '<td class="liste_titre"><input type="text" class="flat" name="search_thirdparty" value="'.dol_escape_htmltag($search_thirdparty).'" size="10"></td>';
}
if (! empty($arrayfields['ba.ref']['checked']))
{
print '<td class="liste_titre" align="right">';
$form->select_comptes($account,'account',0,'',1, ($id > 0 || ! empty($ref)?' disabled="disabled"':''));
$form->select_comptes($search_account,'search_account',0,'',1, ($id > 0 || ! empty($ref)?' disabled="disabled"':''));
print '</td>';
}
if (! empty($arrayfields['b.debit']['checked']))
@ -947,7 +957,7 @@ if ($resql)
// If we are in a situation where we need/can show balance, we calculate the start of balance
if (! $balancecalculated && (! empty($arrayfields['balancebefore']['checked']) || ! empty($arrayfields['balance']['checked'])) && $mode_balance_ok)
{
if (! $account)
if (! $search_account)
{
dol_print_error('', 'account is not defined but $mode_balance_ok is true');
exit;
@ -962,7 +972,7 @@ if ($resql)
$sqlforbalance.= " ".MAIN_DB_PREFIX."bank as b";
$sqlforbalance.= " WHERE b.fk_account = ba.rowid";
$sqlforbalance.= " AND ba.entity IN (".getEntity('bank_account').")";
$sqlforbalance.= " AND b.fk_account = ".$account;
$sqlforbalance.= " AND b.fk_account = ".$search_account;
$sqlforbalance.= " AND (b.datev < '" . $db->idate($db->jdate($objp->dv)) . "' OR (b.datev = '" . $db->idate($db->jdate($objp->dv)) . "' AND (b.dateo < '".$db->idate($db->jdate($objp->do))."' OR (b.dateo = '".$db->idate($db->jdate($objp->do))."' AND b.rowid < ".$objp->rowid."))))";
$resqlforbalance = $db->query($sqlforbalance);
//print $sqlforbalance;
@ -1048,7 +1058,7 @@ if ($resql)
if (! empty($arrayfields['b.rowid']['checked']))
{
print '<td align="left" class="nowrap">';
print "<a href=\"ligne.php?rowid=".$objp->rowid.'">'.img_object($langs->trans("ShowPayment").': '.$objp->rowid, 'account', 'class="classfortooltip"').' '.$objp->rowid."</a> &nbsp; ";
print "<a href=\"ligne.php?rowid=".$objp->rowid.'&save_lastsearch_values=1">'.img_object($langs->trans("ShowPayment").': '.$objp->rowid, 'account', 'class="classfortooltip"').' '.$objp->rowid."</a> &nbsp; ";
print '</td>';
if (! $i) $totalarray['nbfield']++;
}

View File

@ -1189,7 +1189,7 @@ if ($action == 'create')
$disableedit=1;
$disablemove=1;
$disableremove=1;
$ret = $object->printObjectLines('', $mysoc, $object->thirdparty, $lineid, 0); // No date selector for template invoice
$object->printObjectLines('', $mysoc, $object->thirdparty, $lineid, 0); // No date selector for template invoice
}
print "</table>\n";

View File

@ -599,8 +599,10 @@ if ($resql)
if (! empty($arrayfields['f.date_when']['checked']))
{
print '<td align="center">';
print '<div class="nowraponall">';
print ($objp->frequency ? ($invoicerectmp->isMaxNbGenReached()?'<strike>':'').dol_print_date($db->jdate($objp->date_when),'day').($invoicerectmp->isMaxNbGenReached()?'</strike>':'') : '<span class="opacitymedium">'.$langs->trans('NA').'</span>');
if ($objp->frequency > 0 && $db->jdate($objp->date_when) && $db->jdate($objp->date_when) < $now) print img_warning($langs->trans("Late"));
print '</div>';
print '</td>';
if (! $i) $totalarray['nbfield']++;
}
@ -636,7 +638,7 @@ if ($resql)
}
else
{
print $langs->trans("DateIsNotEnough");
print $form->textwithpicto('', $langs->trans("DateIsNotEnough"));
}
}
else

View File

@ -132,7 +132,7 @@ class Localtax extends CommonObject
* @param int $notrigger 0=no, 1=yes (no update trigger)
* @return int <0 if KO, >0 if OK
*/
function update($user=null, $notrigger=0)
function update(User $user, $notrigger=0)
{
global $conf, $langs;
@ -149,8 +149,8 @@ class Localtax extends CommonObject
$this->db->begin();
// Update request
$sql = "UPDATE ".MAIN_DB_PREFIX."localtax SET";
$sql.= " localtaxtype=".$this->ltt.",";
$sql = "UPDATE ".MAIN_DB_PREFIX."localtax SET";
$sql.= " localtaxtype=".$this->ltt.",";
$sql.= " tms='".$this->db->idate($this->tms)."',";
$sql.= " datep='".$this->db->idate($this->datep)."',";
$sql.= " datev='".$this->db->idate($this->datev)."',";
@ -160,7 +160,7 @@ class Localtax extends CommonObject
$sql.= " fk_bank=".$this->fk_bank.",";
$sql.= " fk_user_creat=".$this->fk_user_creat.",";
$sql.= " fk_user_modif=".$this->fk_user_modif;
$sql.= " WHERE rowid=".$this->id;
$sql.= " WHERE rowid=".$this->id;
dol_syslog(get_class($this)."::update", LOG_DEBUG);
$resql = $this->db->query($sql);
@ -255,12 +255,12 @@ class Localtax extends CommonObject
}
/**
* Delete object in database
*
* @param User $user User that delete
* @return int <0 if KO, >0 if OK
*/
/**
* Delete object in database
*
* @param User $user User that delete
* @return int <0 if KO, >0 if OK
*/
function delete($user)
{
// Call trigger
@ -285,11 +285,11 @@ class Localtax extends CommonObject
/**
* Initialise an instance with random values.
* Used to build previews or test instances.
* id must be 0 if object instance is a specimen.
*
* @return void
* Initialise an instance with random values.
* Used to build previews or test instances.
* id must be 0 if object instance is a specimen.
*
* @return void
*/
function initAsSpecimen()
{

View File

@ -88,11 +88,11 @@ if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'e
if (empty($reshook))
{
if ($action == 'add_paiement' || ($action == 'confirm_paiement' && $confirm=='yes'))
if ($action == 'add_paiement' || ($action == 'confirm_paiement' && $confirm == 'yes'))
{
$error = 0;
$datepaye = dol_mktime(12, 0, 0, GETPOST('remonth'), GETPOST('reday'), GETPOST('reyear'));
$datepaye = dol_mktime(12, 0, 0, GETPOST('remonth','int'), GETPOST('reday','int'), GETPOST('reyear','int'));
$paiement_id = 0;
$totalpayment = 0;
$multicurrency_totalpayment = 0;

View File

@ -564,7 +564,7 @@ else
$accountstatic=new Account($db);
$accountstatic->fetch($object->account_id);
$linkback='<a href="'.DOL_URL_ROOT.'/compta/paiement/cheque/list.php">'.$langs->trans("BackToList").'</a>';
$linkback='<a href="'.DOL_URL_ROOT.'/compta/paiement/cheque/list.php?restore_lastsearch_values=1">'.$langs->trans("BackToList").'</a>';
$morehtmlref='';
dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref);

View File

@ -979,25 +979,56 @@ class RemiseCheque extends CommonObject
}
/**
* Return clicable name (with picto eventually)
* Return clicable name (with picto eventually)
*
* @param int $withpicto 0=No picto, 1=Include picto into link, 2=Only picto
* @param string $option Sur quoi pointe le lien
* @return string Chaine avec URL
* @param int $withpicto 0=No picto, 1=Include picto into link, 2=Only picto
* @param string $option Sur quoi pointe le lien
* @param int $notooltip 1=Disable tooltip
* @param string $morecss Add more css on link
* @param int $save_lastsearch_value -1=Auto, 0=No save of lastsearch_values when clicking, 1=Save lastsearch_values whenclicking
* @return string Chaine avec URL
*/
function getNomUrl($withpicto=0,$option='')
function getNomUrl($withpicto=0, $option='', $notooltip=0, $morecss='', $save_lastsearch_value=-1)
{
global $langs;
global $conf, $langs;
$result='';
$label = $langs->trans("ShowCheckReceipt").': '.$this->ref;
$link = '<a href="'.DOL_URL_ROOT.'/compta/paiement/cheque/card.php?id='.$this->id.'" title="'.dol_escape_htmltag($label, 1).'" class="classfortooltip">';
$label = '<u>'.$langs->trans("ShowCheckReceipt").'</u>';
$label.= '<br>';
$label.= '<b>' . $langs->trans('Ref') . ':</b> ' . $this->ref;
$url = DOL_URL_ROOT.'/compta/paiement/cheque/card.php?id='.$this->id;
if ($option != 'nolink')
{
// Add param to save lastsearch_values or not
$add_save_lastsearch_values=($save_lastsearch_value == 1 ? 1 : 0);
if ($save_lastsearch_value == -1 && preg_match('/list\.php/',$_SERVER["PHP_SELF"])) $add_save_lastsearch_values=1;
if ($add_save_lastsearch_values) $url.='&save_lastsearch_values=1';
}
$linkclose='';
if (empty($notooltip))
{
if (! empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER))
{
$label=$langs->trans("ShowCheckReceipt");
$linkclose.=' alt="'.dol_escape_htmltag($label, 1).'"';
}
$linkclose.=' title="'.dol_escape_htmltag($label, 1).'"';
$linkclose.=' class="classfortooltip'.($morecss?' '.$morecss:'').'"';
}
else $linkclose = ($morecss?' class="'.$morecss.'"':'');
$linkstart = '<a href="'.$url.'"';
$linkstart.=$linkclose.'>';
$linkend='</a>';
if ($withpicto) $result.=($link.img_object($label, 'payment', 'class="classfortooltip"').$linkend);
if ($withpicto && $withpicto != 2) $result.=' ';
if ($withpicto != 2) $result.=$link.$this->ref.$linkend;
$result .= $linkstart;
if ($withpicto) $result.=img_object(($notooltip?'':$label), ($this->picto?$this->picto:'generic'), ($notooltip?(($withpicto != 2) ? 'class="paddingright"' : ''):'class="'.(($withpicto != 2) ? 'paddingright ' : '').'classfortooltip"'), 0, 0, $notooltip?0:1);
if ($withpicto != 2) $result.= $this->ref;
$result .= $linkend;
return $result;
}

View File

@ -92,10 +92,12 @@ print '</div><div class="fichetwothirdright"><div class="ficheaddleft">';
$max=10;
$sql = "SELECT bc.rowid, bc.date_bordereau as db, bc.amount, bc.ref as ref";
$sql.= ", bc.statut, bc.nbcheque";
$sql.= ", ba.label, ba.rowid as bid";
$sql = "SELECT bc.rowid, bc.date_bordereau as db, bc.amount, bc.ref as ref,";
$sql.= " bc.statut, bc.nbcheque,";
$sql.= " ba.ref, ba.label, ba.rowid as bid, ba.number, ba.currency_code, ba.account_number, ba.accountancy_journal,";
$sql.= " aj.code";
$sql.= " FROM ".MAIN_DB_PREFIX."bordereau_cheque as bc, ".MAIN_DB_PREFIX."bank_account as ba";
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."accounting_journal as aj ON aj.rowid = ba.fk_accountancy_journal";
$sql.= " WHERE ba.rowid = bc.fk_bank_account";
$sql.= " AND bc.entity = ".$conf->entity;
$sql.= " ORDER BY bc.date_bordereau DESC, rowid DESC";
@ -122,8 +124,13 @@ if ($resql)
$checkdepositstatic->statut=$objp->statut;
$accountstatic->id=$objp->bid;
$accountstatic->ref=$objp->ref;
$accountstatic->label=$objp->label;
$accountstatic->number=$objp->number;
$accountstatic->currency_code=$objp->currency_code;
$accountstatic->account_number=$objp->account_number;
$accountstatic->accountancy_journal=$objp->code;
print '<tr class="oddeven">'."\n";
print '<td>'.$checkdepositstatic->getNomUrl(1).'</td>';

View File

@ -209,9 +209,10 @@ class Paiement extends CommonObject
$total = $totalamount_converted; // Maybe use price2num with MT for the converted value
$mtotal = $totalamount;
}
$note = ($this->note_public?$this->note_public:$this->note);
$sql = "INSERT INTO ".MAIN_DB_PREFIX."paiement (entity, ref, datec, datep, amount, multicurrency_amount, fk_paiement, num_paiement, note, fk_user_creat)";
$sql.= " VALUES (".$conf->entity.", '".$this->ref."', '". $this->db->idate($now)."', '".$this->db->idate($this->datepaye)."', '".$total."', '".$mtotal."', ".$this->paiementid.", '".$this->num_paiement."', '".$this->db->escape($this->note)."', ".$user->id.")";
$sql.= " VALUES (".$conf->entity.", '".$this->ref."', '". $this->db->idate($now)."', '".$this->db->idate($this->datepaye)."', '".$total."', '".$mtotal."', ".$this->paiementid.", '".$this->num_paiement."', '".$this->db->escape($note)."', ".$user->id.")";
dol_syslog(get_class($this)."::Create insert paiement", LOG_DEBUG);
$resql = $this->db->query($sql);

View File

@ -17,9 +17,9 @@
*/
/**
* \file htdocs/compta/paiement/avalider.php
* \file htdocs/compta/paiement/tovalidate.php
* \ingroup compta
* \brief Page liste des paiements a valider des factures clients
* \brief Page list payment to validate. Visible in menu when option BILL_ADD_PAYMENT_VALIDATION is on.
*/
require '../../main.inc.php';

View File

@ -1926,7 +1926,7 @@ else
print $langs->trans("DateEndReal").': ';
print dol_print_date($objp->date_fin_reelle, 'day');
}
if (! empty($objp->comment)) print "<br>".$objp->comment;
if (! empty($objp->comment)) print " &nbsp;-&nbsp; ".$objp->comment;
print '</td>';
print '<td align="center">&nbsp;</td>';

View File

@ -49,8 +49,13 @@ $result=restrictedArea($user,'contrat',$id);
$object = new Contrat($db);
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
$hookmanager->initHooks(array('contractcard','globalcard'));
// Add new contact
/*
* Actions
*/
if ($action == 'addcontact' && $user->rights->contrat->creer)
{

View File

@ -77,10 +77,14 @@ if ($object->id > 0)
$upload_dir = $conf->contrat->dir_output.'/'.dol_sanitizeFileName($object->ref);
$modulepart='contract';
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
$hookmanager->initHooks(array('contractcard','globalcard'));
/*
* Actions
*/
include_once DOL_DOCUMENT_ROOT . '/core/actions_linkedfiles.inc.php';

View File

@ -41,6 +41,17 @@ $ref = GETPOST('ref','alpha');
if ($user->societe_id) $socid=$user->societe_id;
$result = restrictedArea($user, 'contrat', $id, '');
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
$hookmanager->initHooks(array('contractcard','globalcard'));
/*
* Actions
*/
// None
/*
* View

View File

@ -487,13 +487,13 @@ if ($resql)
if (! empty($arrayfields['c.date_contrat']['checked']))
{
// Date contract
print '<td class="liste_titre center">';
print '<td class="liste_titre center nowraponall">';
//print $langs->trans('Month').': ';
if (! empty($conf->global->MAIN_LIST_FILTER_ON_DAY)) print '<input class="flat" type="text" size="1" maxlength="2" name="day" value="'.$day.'">';
print '<input class="flat" type="text" size="1" maxlength="2" name="month" value="'.$month.'">';
//print '&nbsp;'.$langs->trans('Year').': ';
$syear = $year;
$formother->select_year($syear,'year',1, 20, 5);
print $formother->selectyear($syear,'year',1, 20, 5, 0, 0, '', 'widthauto');
print '</td>';
}
// Extra fields

View File

@ -49,6 +49,10 @@ $object->fetch($id,$ref);
$permissionnote=$user->rights->contrat->creer; // Used by the include of actions_setnotes.inc.php
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
$hookmanager->initHooks(array('contractcard','globalcard'));
/*
* Actions

View File

@ -91,6 +91,8 @@ class box_graph_invoices_permonth extends ModeleBoxes
if ($user->rights->facture->lire)
{
$mesg = '';
$param_year='DOLUSERCOOKIE_box_'.$this->boxcode.'_year';
$param_shownb='DOLUSERCOOKIE_box_'.$this->boxcode.'_shownb';
$param_showtot='DOLUSERCOOKIE_box_'.$this->boxcode.'_showtot';
@ -246,13 +248,11 @@ class box_graph_invoices_permonth extends ModeleBoxes
$stringtoshow.='</div>';
$stringtoshow.='</div>';
}
$this->info_box_contents[0][0] = array('td' => 'align="center" class="nohover"','textnoformat'=>$stringtoshow);
$this->info_box_contents[0][0] = array('tr'=>'class="oddeven nohover"', 'td' => 'align="center" class="nohover"','textnoformat'=>$stringtoshow);
}
else
{
$this->info_box_contents[0][0] = array( 'td' => 'align="left" class="nohover"',
'maxlength'=>500,
'text' => $mesg);
$this->info_box_contents[0][0] = array('tr'=>'class="oddeven nohover"', 'td' => 'align="left" class="nohover"', 'maxlength'=>500, 'text' => $mesg);
}
}

View File

@ -245,11 +245,11 @@ class box_graph_invoices_supplier_permonth extends ModeleBoxes
$stringtoshow.='</div>';
$stringtoshow.='</div>';
}
$this->info_box_contents[0][0] = array('td' => 'align="center" class="nohover"','textnoformat'=>$stringtoshow);
$this->info_box_contents[0][0] = array('tr'=>'class="oddeven nohover"','td' => 'align="center" class="nohover"','textnoformat'=>$stringtoshow);
}
else
{
$this->info_box_contents[0][0] = array( 'td' => 'align="left" class="nohover"',
$this->info_box_contents[0][0] = array('tr'=>'class="oddeven nohover"', 'td' => 'align="left" class="nohover"',
'maxlength'=>500,
'text' => $mesg);
}

View File

@ -244,11 +244,11 @@ class box_graph_orders_permonth extends ModeleBoxes
$stringtoshow.='</div>';
$stringtoshow.='</div>';
}
$this->info_box_contents[0][0] = array('td' => 'align="center" class="nohover"','textnoformat'=>$stringtoshow);
$this->info_box_contents[0][0] = array('tr'=>'class="oddeven nohover"', 'td' => 'align="center" class="nohover"','textnoformat'=>$stringtoshow);
}
else
{
$this->info_box_contents[0][0] = array( 'td' => 'align="left" class="nohover"',
$this->info_box_contents[0][0] = array('tr'=>'class="oddeven nohover"', 'td' => 'align="left" class="nohover"',
'maxlength'=>500,
'text' => $mesg);
}

View File

@ -243,11 +243,11 @@ class box_graph_orders_supplier_permonth extends ModeleBoxes
$stringtoshow.='</div>';
$stringtoshow.='</div>';
}
$this->info_box_contents[0][0] = array('td' => 'align="center" class="nohover"','textnoformat'=>$stringtoshow);
$this->info_box_contents[0][0] = array('tr'=>'class="oddeven nohover"', 'td' => 'align="center" class="nohover"','textnoformat'=>$stringtoshow);
}
else
{
$this->info_box_contents[0][0] = array( 'td' => 'align="left" class="nohover"',
$this->info_box_contents[0][0] = array('tr'=>'class="oddeven nohover"', 'td' => 'align="left" class="nohover"',
'maxlength'=>500,
'text' => $mesg);
}

View File

@ -386,7 +386,7 @@ class box_graph_product_distribution extends ModeleBoxes
$stringtoshow.=$px3->show();
$stringtoshow.='</div></div>';
}
$this->info_box_contents[0][0] = array('td' => 'align="center" class="nohover"','textnoformat'=>$stringtoshow);
$this->info_box_contents[0][0] = array('tr'=>'class="oddeven nohover"', 'td' => 'align="center" class="nohover"','textnoformat'=>$stringtoshow);
}
else
{

View File

@ -245,11 +245,11 @@ class box_graph_propales_permonth extends ModeleBoxes
$stringtoshow.='</div>';
$stringtoshow.='</div>';
}
$this->info_box_contents[0][0] = array('td' => 'align="center" class="nohover"','textnoformat'=>$stringtoshow);
$this->info_box_contents[0][0] = array('tr'=>'class="oddeven nohover"', 'td' => 'align="center" class="nohover"','textnoformat'=>$stringtoshow);
}
else
{
$this->info_box_contents[0][0] = array( 'td' => 'align="left" class="nohover"',
$this->info_box_contents[0][0] = array('tr'=>'class="oddeven nohover"', 'td' => 'align="left" class="nohover"',
'maxlength'=>500,
'text' => $mesg);
}

View File

@ -319,7 +319,7 @@ abstract class CommonDocGenerator
foreach($conf->global as $key => $val)
{
if (preg_match('/(_pass|password|secret|_key|key$)/i', $keyfound)) $newval = '*****forbidden*****';
if (preg_match('/(_pass|password|secret|_key|key$)/i', $key)) $newval = '*****forbidden*****';
else $newval = $val;
$array_other['__['.$key.']__'] = $newval;
}

View File

@ -2739,7 +2739,7 @@ abstract class CommonObject
* @param string $targettype Object target type (if not defined, elemennt name of object)
* @param string $clause 'OR' or 'AND' clause used when both source id and target id are provided
* @param int $alsosametype 0=Return only links to object that differs from source. 1=Include also link to objects of same type.
* @return void
* @return int <0 if KO, >0 if OK
* @see add_object_linked, updateObjectLinked, deleteObjectLinked
*/
function fetchObjectLinked($sourceid=null,$sourcetype='',$targetid=null,$targettype='',$clause='OR',$alsosametype=1)
@ -2920,10 +2920,12 @@ abstract class CommonObject
}
}
}
return 1;
}
else
{
dol_print_error($this->db);
return -1;
}
}
@ -3057,6 +3059,7 @@ abstract class CommonObject
$fieldstatus="fk_statut";
if ($elementTable == 'mailing') $fieldstatus="statut";
if ($elementTable == 'cronjob') $fieldstatus="status";
if ($elementTable == 'user') $fieldstatus="statut";
if ($elementTable == 'expensereport') $fieldstatus="fk_statut";
if ($elementTable == 'commande_fournisseur_dispatch') $fieldstatus="status";
@ -3581,7 +3584,7 @@ abstract class CommonObject
* Return HTML table for object lines
* TODO Move this into an output class file (htmlline.class.php)
* If lines are into a template, title must also be into a template
* But for the moment we don't know if it'st possible as we keep a method available on overloaded objects.
* But for the moment we don't know if it's possible as we keep a method available on overloaded objects.
*
* @param string $action Action code
* @param string $seller Object of seller third party
@ -4519,10 +4522,11 @@ abstract class CommonObject
{
$extrafields->fetch_name_optionals_label($this->table_element);
}
$optionsArray = $extrafields->attributes[$this->table_element]['label'];
$optionsArray = (! empty($extrafields->attributes[$this->table_element]['label'])?$extrafields->attributes[$this->table_element]['label']:null);
}
else
{
global $extrafields;
dol_syslog("Warning: fetch_optionals was called with param optionsArray defined when you should pass null now", LOG_WARNING);
}
@ -4696,7 +4700,8 @@ abstract class CommonObject
if ($this->array_options[$key] != '' && is_array($extrafields->attributes[$this->table_element]['param'][$attributeKey]['options']))
{
// If there is an encryption choice, we use it to crypt data before insert
$algo=reset(array_keys($extrafields->attributes[$this->table_element]['param'][$attributeKey]['options']));
$tmparrays = array_keys($extrafields->attributes[$this->table_element]['param'][$attributeKey]['options']);
$algo=reset($tmparrays);
if ($algo != '')
{
//global $action; // $action may be 'create', 'update', 'update_extras'...

View File

@ -310,7 +310,7 @@ class Conf
// For user storage
$this->user->multidir_output = array($this->entity => $rootfordata."/users");
$this->user->multidir_temp = array($this->entity => $rootfordata."/users/temp");
$this->user->multidir_temp = array($this->entity => $rootfordata."/users/temp");
// For backward compatibility
$this->user->dir_output=$rootforuser."/users";
$this->user->dir_temp=$rootforuser."/users/temp";
@ -320,6 +320,9 @@ class Conf
$this->usergroup->dir_temp=$rootforuser."/usergroups/temp";
// For propal storage
$this->propal->multidir_output = array($this->entity => $rootfordata."/propale");
$this->propal->multidir_temp = array($this->entity => $rootfordata."/propale/temp");
// For backward compatibility
$this->propal->dir_output=$rootfordata."/propale";
$this->propal->dir_temp=$rootfordata."/propale/temp";

View File

@ -235,6 +235,7 @@ class ExtraFields
$lengthdb='11';
} elseif ($type=='html') {
$typedb='text';
$lengthdb=$length;
} elseif($type=='password') {
$typedb='varchar';
$lengthdb='128';
@ -742,7 +743,7 @@ class ExtraFields
dol_syslog("fetch_name_optionals_label elementtype=".$elementtype);
$sql = "SELECT rowid,name,label,type,size,elementtype,fieldunique,fieldrequired,param,pos,alwayseditable,perms,langs,list,fielddefault,fieldcomputed";
$sql .= ",entity";
$sql.= ",entity";
$sql.= " FROM ".MAIN_DB_PREFIX."extrafields";
$sql.= " WHERE entity IN (0,".$conf->entity.")";
if ($elementtype) $sql.= " AND elementtype = '".$elementtype."'";

View File

@ -3426,7 +3426,8 @@ class Form
}
else
{
print $langs->trans("NoActiveBankAccountDefined");
if ($statut == 0) print $langs->trans("NoActiveBankAccountDefined");
else print $langs->trans("NoBankAccountFound");
}
}
else {

View File

@ -194,6 +194,7 @@ class FormActions
$projectid = $object->fk_project;
if ($typeelement == 'project') $projectid = $object->id;
$buttontoaddnewevent='';
if (! empty($conf->agenda->enabled))
{
$buttontoaddnewevent = '<a 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:'').($projectid>0?'&projectid='.$projectid:'').'&backtopage='.urlencode($urlbacktopage).'">';

View File

@ -299,6 +299,9 @@ class FormFile
return $this->getDocumentsLink($modulepart, $modulesubdir, $filedir);
}
// Add entity in $param
$param.= 'entity='.(!empty($object->entity)?$object->entity:$conf->entity);
$printer=0;
if (in_array($modulepart,array('facture','supplier_proposal','propal','proposal','order','commande','expedition', 'commande_fournisseur', 'expensereport'))) // The direct print feature is implemented only for such elements
{
@ -699,7 +702,8 @@ class FormFile
$out.= '<!-- html.formfile::showdocuments -->'."\n";
// Show title of array if not already shown
if ((! empty($file_list) || ! empty($link_list) || preg_match('/^massfilesarea/', $modulepart)) && ! $headershown)
if ((! empty($file_list) || ! empty($link_list) || preg_match('/^massfilesarea/', $modulepart))
&& ! $headershown)
{
$headershown=1;
$out.= '<div class="titre">'.$titletoshow.'</div>'."\n";
@ -744,7 +748,7 @@ class FormFile
if ($delallowed || $printer || $morepicto)
{
$out.= '<td align="right">';
$out.= '<td class="right nowraponall">';
if ($delallowed)
{
$out.= '<a href="'.$urlsource.(strpos($urlsource,'?')?'&amp;':'?').'action=remove_file&amp;file='.urlencode($relativepath);
@ -847,6 +851,17 @@ class FormFile
$out='';
$this->infofiles=array('nboffiles'=>0,'extensions'=>array(),'files'=>array());
// Get object entity
if (empty($conf->multicompany->enabled))
{
$entity = $conf->entity;
}
else
{
preg_match('/\/([0-9]+)\/[^\/]+\/'.preg_quote($modulesubdir).'$/', $filedir, $regs);
$entity = ((! empty($regs[1]) && $regs[1] > 1) ? $regs[1] : $conf->entity);
}
$filterforfilesearch = preg_quote(basename($modulesubdir),'/').'[^\-]+';
$file_list=dol_dir_list($filedir, 'files', 0, $filterforfilesearch, '\.meta$|\.png$'); // Get list of files starting with name of ref (but not followed by "-" to discard uploaded files)
@ -900,7 +915,7 @@ class FormFile
}
// Download
$tmpout.= '<li class="nowrap"><a class="pictopreview nowrap" href="'.DOL_URL_ROOT . '/document.php?modulepart='.$modulepart.'&amp;file='.urlencode($relativepath).'"';
$tmpout.= '<li class="nowrap"><a class="pictopreview nowrap" href="'.DOL_URL_ROOT . '/document.php?modulepart='.$modulepart.'&amp;entity='.$entity.'&amp;file='.urlencode($relativepath).'"';
$mime=dol_mimetype($relativepath,'',0);
if (preg_match('/text/',$mime)) $tmpout.= ' target="_blank"';
$tmpout.= '>';

View File

@ -406,7 +406,7 @@ class FormMail extends Form
$out.= '<table class="border" width="100%" style="border-top: 1px solid #BBB;">'."\n";
$out.= '<table class="tableforemailform boxtablenotop" width="100%">'."\n";
// Substitution array
if (! empty($this->withsubstit)) // Unset or set ->withsubstit=0 to disable this.

View File

@ -881,9 +881,10 @@ class FormOther
* @param int $offset Offset
* @param int $invert Invert
* @param string $option Option
* @param string $morecss More css
* @return string
*/
function selectyear($selected='',$htmlname='yearid',$useempty=0, $min_year=10, $max_year=5, $offset=0, $invert=0, $option='')
function selectyear($selected='',$htmlname='yearid',$useempty=0, $min_year=10, $max_year=5, $offset=0, $invert=0, $option='', $morecss='')
{
$out='';
@ -892,7 +893,7 @@ class FormOther
$min_year = $currentyear-$min_year;
if(empty($selected) && empty($useempty)) $selected = $currentyear;
$out.= '<select class="flat" placeholder="aa" id="' . $htmlname . '" name="' . $htmlname . '"'.$option.' >';
$out.= '<select class="flat'.($morecss?' '.$morecss:'').'" id="' . $htmlname . '" name="' . $htmlname . '"'.$option.' >';
if($useempty)
{
$selected_html='';

View File

@ -164,7 +164,7 @@ class FormWebsite
*
* @param string $htmlname Name of select zone
* @param string $selected Selected value
* @param int $useempty 1=Add an empty value in list, 2=Add an empty value in list only if there is more than 2 entries.
* @param int $useempty 1=Add an empty value in list
* @param string $moreattrib More attributes on HTML select tag
* @return void
*/
@ -177,9 +177,9 @@ class FormWebsite
$arrayofsamples=array('corporatehome'=>'CorporateHomePage', 'empty'=>'EmptyPage');
$out = '';
$out .= '<select id="select'.$htmlname.'" class="flat selectTypeOfContainer" name="'.$htmlname.'"'.($moreattrib?' '.$moreattrib:'').'>';
if ($useempty == 1 || ($useempty == 2 && $num > 1))
if ($useempty == 1 || $useempty == 2)
{
$out .= '<option value="-1">&nbsp;</option>';
}
@ -196,7 +196,6 @@ class FormWebsite
}
$out .= $langs->trans($val);
$out .= '</option>';
$i++;
}
$out .= "</select>";

View File

@ -392,13 +392,13 @@ class Notify
break;
case 'PROPAL_VALIDATE':
$link='/comm/propal/card.php?id='.$object->id;
$dir_output = $conf->propal->dir_output;
$dir_output = $conf->propal->multidir_output[$object->entity];
$object_type = 'propal';
$mesg = $langs->transnoentitiesnoconv("EMailTextProposalValidated",$newref);
break;
case 'PROPAL_CLOSE_SIGNED':
$link='/comm/propal/card.php?id='.$object->id;
$dir_output = $conf->propal->dir_output;
$dir_output = $conf->propal->multidir_output[$object->entity];
$object_type = 'propal';
$mesg = $langs->transnoentitiesnoconv("EMailTextProposalClosedSigned",$newref);
break;
@ -574,13 +574,13 @@ class Notify
break;
case 'PROPAL_VALIDATE':
$link='/comm/propal/card.php?id='.$object->id;
$dir_output = $conf->propal->dir_output;
$dir_output = $conf->propal->multidir_output[$object->entity];
$object_type = 'propal';
$mesg = $langs->transnoentitiesnoconv("EMailTextProposalValidated",$newref);
break;
case 'PROPAL_CLOSE_SIGNED':
$link='/comm/propal/card.php?id='.$object->id;
$dir_output = $conf->propal->dir_output;
$dir_output = $conf->propal->multidir_output[$object->entity];
$object_type = 'propal';
$mesg = $langs->transnoentitiesnoconv("EMailTextProposalClosedSigned",$newref);
break;

View File

@ -67,7 +67,7 @@ class Utils
// Delete temporary files
if ($dolibarr_main_data_root)
{
$filesarray=dol_dir_list($dolibarr_main_data_root,"directories",1,'^temp$','','','',2);
$filesarray=dol_dir_list($dolibarr_main_data_root, "directories", 1, '^temp$', '', '', '', 2, 0, '', 1); // Do not follow symlinks
if ($choice == 'tempfilesold')
{
$now = dol_now();

View File

@ -1288,9 +1288,10 @@ function complete_elementList_with_modules(&$elementList)
$modules[$i] = $objMod;
$filename[$i]= $modName;
$orders[$i] = $objMod->family."_".$j; // Tri par famille puis numero module
$orders[$i] = $objMod->family."_".$j; // Sort on family then module number
$dirmod[$i] = $dir;
//print "x".$modName." ".$orders[$i]."\n<br>";
$dirmod[$i] = $dirroot;
if (! empty($objMod->module_parts['contactelement']))
{
$elementList[$objMod->name] = $langs->trans($objMod->name);

View File

@ -52,10 +52,11 @@ function dol_basename($pathfile)
* @param int $mode 0=Return array minimum keys loaded (faster), 1=Force all keys like date and size to be loaded (slower), 2=Force load of date only, 3=Force load of size only
* @param int $nohook Disable all hooks
* @param string $relativename For recursive purpose only. Must be "" at first call.
* @param string $donotfollowsymlinks Do not follow symbolic links
* @return array Array of array('name'=>'xxx','fullname'=>'/abc/xxx','date'=>'yyy','size'=>99,'type'=>'dir|file',...)
* @see dol_dir_list_indatabase
*/
function dol_dir_list($path, $types="all", $recursive=0, $filter="", $excludefilter=null, $sortcriteria="name", $sortorder=SORT_ASC, $mode=0, $nohook=0, $relativename="")
function dol_dir_list($path, $types="all", $recursive=0, $filter="", $excludefilter=null, $sortcriteria="name", $sortorder=SORT_ASC, $mode=0, $nohook=0, $relativename="", $donotfollowsymlinks=0)
{
global $db, $hookmanager;
global $object;
@ -159,7 +160,11 @@ function dol_dir_list($path, $types="all", $recursive=0, $filter="", $excludefil
// if we're in a directory and we want recursive behavior, call this function again
if ($recursive)
{
$file_list = array_merge($file_list, dol_dir_list($path."/".$file, $types, $recursive, $filter, $excludefilter, $sortcriteria, $sortorder, $mode, $nohook, ($relativename!=''?$relativename.'/':'').$file));
if (empty($donotfollowsymlinks) || ! is_link($path."/".$file))
{
//var_dump('eee '. $path."/".$file. ' '.is_dir($path."/".$file).' '.is_link($path."/".$file));
$file_list = array_merge($file_list, dol_dir_list($path."/".$file, $types, $recursive, $filter, $excludefilter, $sortcriteria, $sortorder, $mode, $nohook, ($relativename!=''?$relativename.'/':'').$file, $donotfollowsymlinks));
}
}
}
else if (! $isdir && (($types == "files") || ($types == "all")))
@ -2147,10 +2152,10 @@ function dol_check_secure_access_document($modulepart, $original_file, $entity,
$original_file=$conf->facture->dir_output.'/'.$original_file;
}
// Wrapping pour les apercu propal
elseif ($modulepart == 'apercupropal' && !empty($conf->propal->dir_output))
elseif ($modulepart == 'apercupropal' && !empty($conf->propal->multidir_output[$entity]))
{
if ($fuser->rights->propale->{$lire}) $accessallowed=1;
$original_file=$conf->propal->dir_output.'/'.$original_file;
$original_file=$conf->propal->multidir_output[$entity].'/'.$original_file;
}
// Wrapping pour les apercu commande
elseif ($modulepart == 'apercucommande' && !empty($conf->commande->dir_output))
@ -2195,10 +2200,10 @@ function dol_check_secure_access_document($modulepart, $original_file, $entity,
$original_file=$conf->expensereport->dir_output.'/'.$original_file;
}
// Wrapping pour les images des stats propales
elseif ($modulepart == 'propalstats' && !empty($conf->propal->dir_temp))
elseif ($modulepart == 'propalstats' && !empty($conf->propal->multidir_temp[$entity]))
{
if ($fuser->rights->propale->{$lire}) $accessallowed=1;
$original_file=$conf->propal->dir_temp.'/'.$original_file;
$original_file=$conf->propal->multidir_temp[$entity].'/'.$original_file;
}
// Wrapping pour les images des stats commandes
elseif ($modulepart == 'orderstats' && !empty($conf->commande->dir_temp))
@ -2362,13 +2367,13 @@ function dol_check_secure_access_document($modulepart, $original_file, $entity,
$sqlprotectagainstexternals = "SELECT fk_soc as fk_soc FROM ".MAIN_DB_PREFIX."facture WHERE ref='".$db->escape($refname)."' AND entity=".$conf->entity;
}
// Wrapping for mass actions
else if ($modulepart == 'massfilesarea_proposals' && !empty($conf->propal->dir_output))
else if ($modulepart == 'massfilesarea_proposals' && !empty($conf->propal->multidir_output[$entity]))
{
if ($fuser->rights->propal->{$lire} || preg_match('/^specimen/i',$original_file))
{
$accessallowed=1;
}
$original_file=$conf->propal->dir_output.'/temp/massgeneration/'.$user->id.'/'.$original_file;
$original_file=$conf->propal->multidir_output[$entity].'/temp/massgeneration/'.$user->id.'/'.$original_file;
}
else if ($modulepart == 'massfilesarea_orders')
{
@ -2402,7 +2407,7 @@ function dol_check_secure_access_document($modulepart, $original_file, $entity,
}
$original_file=$conf->ficheinter->dir_output.'/temp/massgeneration/'.$user->id.'/'.$original_file;
}
else if ($modulepart == 'massfilesarea_supplier_proposal' && !empty($conf->propal->dir_output))
else if ($modulepart == 'massfilesarea_supplier_proposal' && !empty($conf->supplier_proposal->dir_output))
{
if ($fuser->rights->supplier_proposal->{$lire} || preg_match('/^specimen/i',$original_file))
{
@ -2457,14 +2462,13 @@ function dol_check_secure_access_document($modulepart, $original_file, $entity,
//$sqlprotectagainstexternals = "SELECT fk_soc as fk_soc FROM ".MAIN_DB_PREFIX."fichinter WHERE ref='".$db->escape($refname)."' AND entity=".$conf->entity;
}
// Wrapping pour les propales
else if ($modulepart == 'propal' && !empty($conf->propal->dir_output))
else if ($modulepart == 'propal' && !empty($conf->propal->multidir_output[$entity]))
{
if ($fuser->rights->propale->{$lire} || preg_match('/^specimen/i',$original_file))
{
$accessallowed=1;
}
$original_file=$conf->propal->dir_output.'/'.$original_file;
$original_file=$conf->propal->multidir_output[$entity].'/'.$original_file;
$sqlprotectagainstexternals = "SELECT fk_soc as fk_soc FROM ".MAIN_DB_PREFIX."propal WHERE ref='".$db->escape($refname)."' AND entity=".$conf->entity;
}

View File

@ -7108,7 +7108,7 @@ function getAdvancedPreviewUrl($modulepart, $relativepath, $alldata=0, $param=''
if ($alldata == 1)
{
if ($num_mime !== false) return array('target'=>'_blank', 'css'=>'documentpreview', 'url'=>DOL_URL_ROOT.'/document.php?modulepart='.$modulepart.'&attachment=0&file='.urlencode($relativepath), 'mime'=>dol_mimetype($relativepath), );
if ($num_mime !== false) return array('target'=>'_blank', 'css'=>'documentpreview', 'url'=>DOL_URL_ROOT.'/document.php?modulepart='.$modulepart.'&attachment=0&file='.urlencode($relativepath).($param?'&'.$param:''), 'mime'=>dol_mimetype($relativepath), );
else return array();
}

View File

@ -35,7 +35,7 @@ function propal_prepare_head($object)
$langs->load("propal");
$langs->load("compta");
$langs->load("companies");
$h = 0;
$head = array();
@ -86,7 +86,7 @@ function propal_prepare_head($object)
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/link.class.php';
$upload_dir = $conf->propal->dir_output . "/" . dol_sanitizeFileName($object->ref);
$upload_dir = $conf->propal->multidir_output[$object->entity] . "/" . dol_sanitizeFileName($object->ref);
$nbFiles = count(dol_dir_list($upload_dir,'files',0,'','(\.meta|_preview.*\.png)$'));
$nbLinks=Link::count($db, $object->element, $object->id);
$head[$h][0] = DOL_URL_ROOT.'/comm/propal/document.php?id='.$object->id;

View File

@ -177,6 +177,7 @@ function redirectToContainer($containerref, $containeraliasalt='',$containerid=0
global $db, $website;
$newurl = '';
$result=0;
// We make redirect using the alternative alias, we must find the real $containerref
if ($containeraliasalt)

View File

@ -818,7 +818,7 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu
if (! empty($conf->global->BILL_ADD_PAYMENT_VALIDATION))
{
$newmenu->add("/compta/paiement/avalider.php?leftmenu=customers_bills_tovalid",$langs->trans("MenuToValid"),2,$user->rights->facture->lire,'',$mainmenu,'customer_bills_tovalid');
$newmenu->add("/compta/paiement/tovalidate.php?leftmenu=customers_bills_tovalid",$langs->trans("MenuToValid"),2,$user->rights->facture->lire,'',$mainmenu,'customer_bills_tovalid');
}
$newmenu->add("/compta/paiement/rapport.php?leftmenu=customers_bills_reports",$langs->trans("Reportings"),2,$user->rights->facture->lire,'',$mainmenu,'customers_bills_reports');

View File

@ -72,7 +72,7 @@
<td>Fondation d'entreprise</td>
</tr>
<tr>
<td class="tdtop"><INPUT type="checkbox" checked="checked"></td>
<td class="tdtop"><INPUT type="checkbox"></td>
<td>Oeuvre ou organisme d'intérêt général</td>
</tr>
<tr>

View File

@ -3,7 +3,7 @@
* Copyright (C) 2005-2006 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2012 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2012 Marcos García <marcosgdf@gmail.com>
* Copyright (C) 2014-2015 Alexandre Spangaro <aspangaro.dolibarr@gmail.com>
* Copyright (C) 2014-2015 Alexandre Spangaro <aspangaro.dolibarr@gmail.com>
* Copyright (C) 2015 Benoit Bruchard <benoitb21@gmail.com>
*
* This program is free software; you can redistribute it and/or modify
@ -89,7 +89,7 @@ class html_cerfafr extends ModeleDon
$outputlangs->load("donations");
$currency = !empty($currency) ? $currency : $conf->currency;
if (! empty($conf->don->dir_output))
{
// Definition of the object don (for upward compatibility)
@ -134,21 +134,21 @@ class html_cerfafr extends ModeleDon
$paymentmode = $formclass->cache_types_paiements[$don->modepaiementid]['label'];
}
else $paymentmode = '';
if ($don->modepaiementid==7){
if ($don->modepaymentcode=='CHQ'){
$ModePaiement = '<td width="25%"><input type="checkbox"> Remise d\'espèces</td><td width="25%"><input type="checkbox" disabled="true" checked="checked"> Chèque</td><td width="50%"><input type="checkbox"> Virement, prélèvement, carte bancaire</td>';
}
else if ($don->modepaiementid==4){
else if ($don->modepaymentcode=='LIQ'){
$ModePaiement = '<td width="25%"><input type="checkbox" checked="checked"> Remise d\'espèces</td><td width="25%"><input type="checkbox"> Chèque</td><td width="50%"><input type="checkbox"> Virement, prélèvement, carte bancaire</td>';
}
else if ($don->modepaiementid==2 || $don->modepaiementid==3 || $don->modepaiementid==6){
else if ($don->modepaymentcode=='VIR' || $don->modepaymentcode=='PRE' || $don->modepaymentcode=='CB'){
$ModePaiement = '<td width="25%"><input type="checkbox"> Remise d\'espèces</td><td width="25%"><input type="checkbox"> Chèque</td><td width="50%"><input type="checkbox" checked="checked"> Virement, prélèvement, carte bancaire</td>';
}
else
}
else
{
$ModePaiement = '<td width="25%"><input type="checkbox"> Remise d\'espèces</td><td width="25%"><input type="checkbox"> Chèque</td><td width="50%"><input type="checkbox"> Virement, prélèvement, carte bancaire</td>';
}
/*
if (empty($don->societe))
{
@ -159,14 +159,14 @@ class html_cerfafr extends ModeleDon
$CodeDon = '<td width="33%"><input type="checkbox" disabled="true" > 200 du CGI</td><td width="33%"><input type="checkbox" disabled="true" checked="checked" > 238 bis du CGI</td><td width="33%"><input type="checkbox" disabled="true" > 885-0 V bis A du CGI</td>';
}
*/
// Define contents
$donmodel=DOL_DOCUMENT_ROOT ."/core/modules/dons/html_cerfafr.html";
$form = implode('', file($donmodel));
$form = str_replace('__REF__',$don->id,$form);
$form = str_replace('__DATE__',dol_print_date($don->date,'day',false,$outputlangs),$form);
//$form = str_replace('__IP__',$user->ip,$form); // TODO $user->ip not exist
$form = str_replace('__AMOUNT__',$don->amount,$form);
$form = str_replace('__AMOUNT__', price($don->amount), $form);
$form = str_replace('__AMOUNTLETTERS__',chiffre_en_lettre($don->amount),$form);
$form = str_replace('__CURRENCY__',$outputlangs->transnoentitiesnoconv("Currency".$currency),$form);
$form = str_replace('__CURRENCYCODE__',$conf->currency,$form);
@ -183,7 +183,6 @@ class html_cerfafr extends ModeleDon
$form = str_replace('__DONATOR_ZIP__',$don->zip,$form);
$form = str_replace('__DONATOR_TOWN__',$don->town,$form);
$form = str_replace('__PAYMENTMODE_LIB__ ', $paymentmode,$form);
$form = str_replace('__ModePaiement__', $ModePaiement,$form);
$form = str_replace('__NOW__',dol_print_date($now,'day',false,$outputlangs),$form);
$form = str_replace('__DonationRef__',$outputlangs->trans("DonationRef"),$form);
$form = str_replace('__DonationTitle__',$outputlangs->trans("DonationTitle"),$form);
@ -204,6 +203,8 @@ class html_cerfafr extends ModeleDon
$form = str_replace('__IConfirmDonationReception__',$outputlangs->trans("IConfirmDonationReception"),$form);
$form = str_replace('__DonationMessage__',$conf->global->DONATION_MESSAGE,$form);
$form = str_replace('__ModePaiement__', $ModePaiement,$form);
$frencharticle='';
if (preg_match('/fr/i',$outputlangs->defaultlang)) $frencharticle='<font size="+1">Article 200, 238 bis et 885-0 V bis A du code général des impôts (CGI)</font>';
$form = str_replace('__FrenchArticle__',$frencharticle,$form);
@ -260,7 +261,7 @@ class html_cerfafr extends ModeleDon
@chmod($file, octdec($conf->global->MAIN_UMASK));
$this->result = array('fullpath'=>$file);
return 1;
}
else
@ -394,34 +395,34 @@ function chiffre_en_lettre($montant, $devise1='', $devise2='')
if($cent[$i]==1) $trio[$i]='cent';
else if($cent[$i]!=0 || $cent[$i]!='') $trio[$i]=$chif[$cent[$i]] .' cents';
}
$chif2=array('', 'dix', 'vingt', 'trente', 'quarante', 'cinquante', 'soixante', 'soixante-dix', 'quatre-vingts', 'quatre-vingts dix');
$secon_c=$chif2[$dix_c];
if($cent_c==1) $trio_c='cent';
else if($cent_c!=0 || $cent_c!='') $trio_c=$chif[$cent_c] .' cents';
if(($cent[3]==0 || $cent[3]=='') && ($dix[3]==0 || $dix[3]=='') && ($unite[3]==1))
$somme = $trio[3]. ' ' .$secon[3]. ' ' . $prim[3]. ' million ';
else if(($cent[3]!=0 && $cent[3]!='') || ($dix[3]!=0 && $dix[3]!='') || ($unite[3]!=0 && $unite[3]!=''))
$somme = $trio[3]. ' ' .$secon[3]. ' ' . $prim[3]. ' millions ';
else
$somme = $trio[3]. ' ' .$secon[3]. ' ' . $prim[3];
if(($cent[2]==0 || $cent[2]=='') && ($dix[2]==0 || $dix[2]=='') && ($unite[2]==1))
$somme = $somme.' mille ';
else if(($cent[2]!=0 && $cent[2]!='') || ($dix[2]!=0 && $dix[2]!='') || ($unite[2]!=0 && $unite[2]!=''))
$somme = $somme. $trio[2]. ' ' .$secon[2]. ' ' . $prim[2]. ' milles ';
else
$somme = $somme. $trio[2]. ' ' .$secon[2]. ' ' . $prim[2];
$somme = $somme. $trio[1]. ' ' .$secon[1]. ' ' . $prim[1];
$somme = $somme. ' '. $dev1 .' ' ;
if(($cent_c=='0' || $cent_c=='') && ($dix_c=='0' || $dix_c==''))
return $somme. ' et z&eacute;ro '. $dev2;
else
return $somme. $trio_c. ' ' .$secon_c. ' ' . $dev2;
}

View File

@ -114,7 +114,7 @@ class modPaypal extends DolibarrModules
'url'=>'/paypal/importpayments.php',
'langs'=>'paypal', // Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory.
'position'=>501,
'enabled'=>'$conf->paypal->enabled && $conf->banque->enabled && $conf->global->MAIN_FEATURES_LEVEL >= 1', // Define condition to show or hide menu entry. Use '$conf->mymodule->enabled' if entry must be visible if module is enabled. Use '$leftmenu==\'system\'' to show if leftmenu system is selected.
'enabled'=>'$conf->paypal->enabled && $conf->banque->enabled && $conf->global->MAIN_FEATURES_LEVEL >= 2', // Define condition to show or hide menu entry. Use '$conf->mymodule->enabled' if entry must be visible if module is enabled. Use '$leftmenu==\'system\'' to show if leftmenu system is selected.
'perms'=>'$user->rights->banque->consolidate', // Use 'perms'=>'$user->rights->mymodule->level1->level2' if you want your menu with a permission rules
'target'=>'',
'user'=>2

View File

@ -100,7 +100,7 @@ class modStripe extends DolibarrModules
'url'=>'/stripe/importpayments.php',
'langs'=>'stripe', // Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory.
'position'=>500,
'enabled'=>'$conf->stripe->enabled && $conf->banque->enabled && $conf->global->MAIN_FEATURES_LEVEL >= 1', // Define condition to show or hide menu entry. Use '$conf->mymodule->enabled' if entry must be visible if module is enabled. Use '$leftmenu==\'system\'' to show if leftmenu system is selected.
'enabled'=>'$conf->stripe->enabled && $conf->banque->enabled && $conf->global->MAIN_FEATURES_LEVEL >= 2', // Define condition to show or hide menu entry. Use '$conf->mymodule->enabled' if entry must be visible if module is enabled. Use '$leftmenu==\'system\'' to show if leftmenu system is selected.
'perms'=>'$user->rights->banque->consolidate', // Use 'perms'=>'$user->rights->mymodule->level1->level2' if you want your menu with a permission rules
'target'=>'',
'user'=>2

View File

@ -246,7 +246,7 @@ class doc_generic_proposal_odt extends ModelePDFPropales
$outputlangs->load("companies");
$outputlangs->load("bills");
if ($conf->propal->dir_output)
if ($conf->propal->multidir_output[$conf->entity])
{
// If $object is id instead of object
if (! is_object($object))
@ -261,7 +261,7 @@ class doc_generic_proposal_odt extends ModelePDFPropales
}
}
$dir = $conf->propal->dir_output;
$dir = $conf->propal->multidir_output[$object->entity];
$objectref = dol_sanitizeFileName($object->ref);
if (! preg_match('/specimen/i',$objectref)) $dir.= "/" . $objectref;
$file = $dir . "/" . $objectref . ".odt";
@ -303,7 +303,7 @@ class doc_generic_proposal_odt extends ModelePDFPropales
//print "file=".$file;
//print "conf->propal->dir_temp=".$conf->propal->dir_temp;
dol_mkdir($conf->propal->dir_temp);
dol_mkdir($conf->propal->multidir_temp[$object->entity]);
// If CUSTOMER contact defined on proposal, we use it
@ -357,7 +357,7 @@ class doc_generic_proposal_odt extends ModelePDFPropales
$odfHandler = new odf(
$srctemplatepath,
array(
'PATH_TO_TMP' => $conf->propal->dir_temp,
'PATH_TO_TMP' => $conf->propal->multidir_temp[$object->entity],
'ZIP_PROXY' => 'PclZipProxy', // PhpZipProxy or PclZipProxy. Got "bad compression method" error when using PhpZipProxy.
'DELIMITER_LEFT' => '{',
'DELIMITER_RIGHT' => '}'

View File

@ -230,7 +230,7 @@ class pdf_azur extends ModelePDFPropales
if (count($realpatharray) == 0) $this->posxpicture=$this->posxtva;
if ($conf->propal->dir_output)
if ($conf->propal->multidir_output[$conf->entity])
{
$object->fetch_thirdparty();
@ -239,13 +239,13 @@ class pdf_azur extends ModelePDFPropales
// Definition of $dir and $file
if ($object->specimen)
{
$dir = $conf->propal->dir_output;
$dir = $conf->propal->multidir_output[$conf->entity];
$file = $dir . "/SPECIMEN.pdf";
}
else
{
$objectref = dol_sanitizeFileName($object->ref);
$dir = $conf->propal->dir_output . "/" . $objectref;
$dir = $conf->propal->multidir_output[$object->entity] . "/" . $objectref;
$file = $dir . "/" . $objectref . ".pdf";
}
@ -1501,7 +1501,7 @@ class pdf_azur extends ModelePDFPropales
{
$top_shift = $pdf->getY() - $current_y;
}
if ($showaddress)
{
// Sender properties

View File

@ -67,7 +67,7 @@ if ($conf->multicompany->enabled) {
print '<td width="80">&nbsp;</td>';
print "</tr>\n";
if (count($extrafields->attributes[$elementtype]['type']))
if (is_array($extrafields->attributes[$elementtype]['type']) && count($extrafields->attributes[$elementtype]['type']))
{
foreach($extrafields->attributes[$elementtype]['type'] as $key => $value)
{

View File

@ -60,8 +60,9 @@ $userstatic=new User($db);
?>
<!-- BEGIN PHP TEMPLATE CONTACTS -->
<div class="underbanner clearboth"></div>
<div class="div-table-responsive">
<div class="tagtable centpercent noborder allwidth">
<div class="tagtable centpercent noborder nobordertop allwidth">
<?php
if ($permission) {

View File

@ -78,7 +78,7 @@ print '<!-- BEGIN PHP TEMPLATE NOTES -->'."\n";
print '<div class="tagtable border table-border centpercent">'."\n";
if ($module != 'product') {
// No public note yet on products
print '<div class="tagtr table-border-row">'."\n";
print '<div class="tagtr pair table-border-row">'."\n";
print '<div class="tagtd tdtop table-key-border-col'.(empty($cssclass)?'':' '.$cssclass).'"'.($colwidth ? ' style="width: '.$colwidth.'%"' : '').'>'."\n";
print $form->editfieldkey("NotePublic", $note_public, $value_public, $object, $permission, $typeofdata, $moreparam, '', 0);
print '</div>'."\n";
@ -88,7 +88,7 @@ if ($module != 'product') {
print '</div>'."\n";
}
if (empty($user->societe_id)) {
print '<div class="tagtr table-border-row">'."\n";
print '<div class="tagtr '.($module != 'product'?'impair':'pair').' table-border-row">'."\n";
print '<div class="tagtd tdtop table-key-border-col'.(empty($cssclass)?'':' '.$cssclass).'"'.($colwidth ? ' style="width: '.$colwidth.'%"' : '').'>'."\n";
print $form->editfieldkey("NotePrivate", $note_private, $value_private, $object, $permission, $typeofdata, $moreparam, '', 0);
print '</div>'."\n";

View File

@ -63,6 +63,11 @@ class Cronjob extends CommonObject
public $libname;
public $test; // A test condition to know if job is visible/qualified
const STATUS_DISABLED = 0;
const STATUS_ENABLED = 1;
const STATUS_ARCHIVED = 2;
/**
* Constructor
*

View File

@ -29,17 +29,18 @@ require_once(DOL_DOCUMENT_ROOT."/core/lib/admin.lib.php");
require_once DOL_DOCUMENT_ROOT."/cron/class/cronjob.class.php";
require_once DOL_DOCUMENT_ROOT.'/core/lib/cron.lib.php';
$langs->load("admin");
$langs->load("cron");
$langs->load("bills");
$langs->loadLangs(array("admin","cron","bills"));
if (!$user->rights->cron->read) accessforbidden();
$action=GETPOST('action','alpha');
$massaction = GETPOST('massaction','alpha'); // The bulk action (combo box choice into lists)
$confirm=GETPOST('confirm','alpha');
$id=GETPOST('id','int');
$toselect = GETPOST('toselect', 'array'); // Array of ids of elements selected into a list
$contextpage= GETPOST('contextpage','aZ')?GETPOST('contextpage','aZ'):'cronjoblist'; // To manage different context of search
$id=GETPOST('id','int');
$limit = GETPOST('limit','int')?GETPOST('limit','int'):$conf->liste_limit;
$sortfield = GETPOST("sortfield",'alpha');
$sortorder = GETPOST("sortorder",'alpha');
@ -51,8 +52,8 @@ $pagenext = $page + 1;
if (! $sortfield) $sortfield='t.status,t.priority';
if (! $sortorder) $sortorder='DESC,ASC';
$status=GETPOST('status','int');
if ($status == '') $status=-2;
$search_status=GETPOST('search_status','int')?GETPOST('search_status','int'):GETPOST('status','int');
if ($search_status == '') $search_status=-2;
//Search criteria
$search_label=GETPOST("search_label",'alpha');
@ -75,80 +76,129 @@ $object = new Cronjob($db);
* Actions
*/
// Do we click on 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
{
$search_label='';
$status=-1;
}
if (GETPOST('cancel','alpha')) { $action='list'; $massaction=''; }
if (! GETPOST('confirmmassaction','alpha') && $massaction != 'presend' && $massaction != 'confirm_presend') { $massaction=''; }
$filter=array();
if (!empty($search_label))
{
$filter['t.label']=$search_label;
}
$parameters=array();
$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');
// Delete jobs
if ($action == 'confirm_delete' && $confirm == "yes" && $user->rights->cron->delete)
if (empty($reshook))
{
//Delete cron task
$object = new Cronjob($db);
$object->id=$id;
$result = $object->delete($user);
// Selection of new fields
include DOL_DOCUMENT_ROOT.'/core/actions_changeselectedfields.inc.php';
if ($result < 0) {
setEventMessages($object->error, $object->errors, 'errors');
// 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
{
$search_label='';
$search_status=-1;
$toselect='';
$search_array_options=array();
}
if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter.x','alpha') || GETPOST('button_removefilter','alpha')
|| GETPOST('button_search_x','alpha') || GETPOST('button_search.x','alpha') || GETPOST('button_search','alpha'))
{
$massaction=''; // Protection to avoid mass action if we force a new search during a mass action confirmation
}
}
// Execute jobs
if ($action == 'confirm_execute' && $confirm == "yes" && $user->rights->cron->execute)
{
if (! empty($conf->global->CRON_KEY) && $conf->global->CRON_KEY != $securitykey)
{
setEventMessages('Security key '.$securitykey.' is wrong', null, 'errors');
$action='';
}
else
{
$object = new Cronjob($db);
$job = $object->fetch($id);
$filter=array();
if (!empty($search_label))
{
$filter['t.label']=$search_label;
}
$now = dol_now(); // Date we start
// Delete jobs
if ($action == 'confirm_delete' && $confirm == "yes" && $user->rights->cron->delete)
{
//Delete cron task
$object = new Cronjob($db);
$object->id=$id;
$result = $object->delete($user);
$resrunjob = $object->run_jobs($user->login); // Return -1 if KO, 1 if OK
if ($resrunjob < 0) {
setEventMessages($object->error, $object->errors, 'errors');
}
if ($result < 0) {
setEventMessages($object->error, $object->errors, 'errors');
}
}
// Programm next run
$res = $object->reprogram_jobs($user->login, $now);
if ($res > 0)
{
if ($resrunjob >= 0) // We show the result of reprogram only if no error message already reported
{
if ($object->lastresult >= 0) setEventMessages($langs->trans("JobFinished"), null, 'mesgs');
else setEventMessages($langs->trans("JobFinished"), null, 'errors');
}
$action='';
}
else
{
setEventMessages($object->error, $object->errors, 'errors');
$action='';
}
// Execute jobs
if ($action == 'confirm_execute' && $confirm == "yes" && $user->rights->cron->execute)
{
if (! empty($conf->global->CRON_KEY) && $conf->global->CRON_KEY != $securitykey)
{
setEventMessages('Security key '.$securitykey.' is wrong', null, 'errors');
$action='';
}
else
{
$object = new Cronjob($db);
$job = $object->fetch($id);
$param='&status='.$status;
if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.$contextpage;
if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.$limit;
if ($search_label) $param.='&search_label='.$search_label;
if ($optioncss != '') $param.='&optioncss='.$optioncss;
// Add $param from extra fields
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_param.tpl.php';
$now = dol_now(); // Date we start
header("Location: ".DOL_URL_ROOT.'/cron/list.php?'.$param.($sortfield?'&sortfield='.$sortfield:'').($sortorder?'&sortorder='.$sortorder:'')); // Make a redirect to avoid to run twice the job when using back
exit;
}
$resrunjob = $object->run_jobs($user->login); // Return -1 if KO, 1 if OK
if ($resrunjob < 0) {
setEventMessages($object->error, $object->errors, 'errors');
}
// Programm next run
$res = $object->reprogram_jobs($user->login, $now);
if ($res > 0)
{
if ($resrunjob >= 0) // We show the result of reprogram only if no error message already reported
{
if ($object->lastresult >= 0) setEventMessages($langs->trans("JobFinished"), null, 'mesgs');
else setEventMessages($langs->trans("JobFinished"), null, 'errors');
}
$action='';
}
else
{
setEventMessages($object->error, $object->errors, 'errors');
$action='';
}
$param='&search_status='.urlencode($search_status);
if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.urlencode($contextpage);
if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.urlencode($limit);
if ($search_label) $param.='&search_label='.urlencode($search_label);
if ($optioncss != '') $param.='&optioncss='.urlencode($optioncss);
// Add $param from extra fields
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_param.tpl.php';
header("Location: ".DOL_URL_ROOT.'/cron/list.php?'.$param.($sortfield?'&sortfield='.$sortfield:'').($sortorder?'&sortorder='.$sortorder:'')); // Make a redirect to avoid to run twice the job when using back
exit;
}
}
// Mass actions
$objectclass='CronJob';
$objectlabel='CronJob';
$permtoread = $user->rights->cron->read;
$permtocreate = $user->rights->cron->create?$user->rights->cron->create:$user->rights->cron->write;
$permtodelete = $user->rights->cron->delete;
$uploaddir = $conf->cron->dir_output;
include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php';
if ($permtocreate)
{
$tmpcron = new Cronjob($db);
foreach($toselect as $id)
{
$result = $tmpcron->fetch($id);
if ($result)
{
$result = 0;
if ($massaction == 'disable') $result = $tmpcron->setStatut(Cronjob::STATUS_DISABLED);
elseif ($massaction == 'enable') $result = $tmpcron->setStatut(Cronjob::STATUS_ENABLED);
else dol_print_error($db, 'Bad value for massaction');
if ($result < 0) setEventMessages($tmpcron->error, $tmpcron->errors, 'errors');
}
else
{
$error++;
}
}
}
}
@ -196,8 +246,8 @@ $sql.= " t.libname,";
$sql.= " t.test";
$sql.= " FROM ".MAIN_DB_PREFIX."cronjob as t";
$sql.= " WHERE 1 = 1";
if ($status >= 0 && $status < 2) $sql.= " AND t.status = ".(empty($status)?'0':'1');
if ($status == 2) $sql.= " AND t.status = 2";
if ($search_status >= 0 && $search_status < 2) $sql.= " AND t.status = ".(empty($search_status)?'0':'1');
if ($search_status == 2) $sql.= " AND t.status = 2";
//Manage filter
if (is_array($filter) && count($filter)>0) {
foreach($filter as $key => $value) {
@ -235,16 +285,17 @@ if (! $result) dol_print_error($db);
$num = $db->num_rows($result);
$param='&status='.$status;
$arrayofselected=is_array($toselect)?$toselect:array();
$param = '';
if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.$contextpage;
if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.$limit;
if ($search_status) $param.='&search_status='.$search_status;
if ($search_label) $param.='&search_label='.$search_label;
if ($optioncss != '') $param.='&optioncss='.$optioncss;
// Add $param from extra fields
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_param.tpl.php';
//$massactionbutton=$form->selectMassAction('', $massaction == 'presend' ? array() : array('presend'=>$langs->trans("SendByMail"), 'builddoc'=>$langs->trans("PDFMerge")));
$stringcurrentdate = $langs->trans("CurrentHour").': '.dol_print_date(dol_now(), 'dayhour');
if ($action == 'delete')
@ -256,15 +307,28 @@ if ($action == 'execute')
print $form->formconfirm($_SERVER['PHP_SELF']."?id=".$id.'&securitykey='.$securitykey.$param, $langs->trans("CronExecute"),$langs->trans("CronConfirmExecute"),"confirm_execute",'','',1);
}
// List of mass actions available
$arrayofmassactions = array(
//'presend'=>$langs->trans("SendByMail"),
//'builddoc'=>$langs->trans("PDFMerge"),
'enable'=>$langs->trans("Enable"),
'disable'=>$langs->trans("Disable"),
);
if ($user->rights->mymodule->delete) $arrayofmassactions['predelete']=$langs->trans("Delete");
if (in_array($massaction, array('presend','predelete'))) $arrayofmassactions=array();
$massactionbutton=$form->selectMassAction('', $arrayofmassactions);
print '<form method="GET" action="'.$url_form.'" name="search_form">'."\n";
print '<input type="hidden" name="status" value="'.$status.'" >';
print '<form method="POST" id="searchFormList" action="'.$_SERVER["PHP_SELF"].'" name="search_form">'."\n";
if ($optioncss != '') print '<input type="hidden" name="optioncss" value="'.$optioncss.'">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
print '<input type="hidden" name="action" value="list">';
print '<input type="hidden" name="sortfield" value="'.$sortfield.'">';
print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
print '<input type="hidden" name="page" value="'.$page.'">';
print '<input type="hidden" name="contextpage" value="'.$contextpage.'">';
print '<input type="hidden" name="search_status" value="'.$search_status.'" >';
print '<input type="hidden" name="viewstatut" value="'.$viewstatut.'">';
// Line with explanation and button new job
@ -277,7 +341,7 @@ else
$buttontoshow.='<a class="butAction" style="margin-right: 0px;margin-left: 0px;" href="'.DOL_URL_ROOT.'/cron/card.php?action=create">'.$langs->trans("CronCreateJob").'</a>';
}
print_barre_liste($pagetitle, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords, 'title_setup', 0, $buttontoshow, '', $limit);
print_barre_liste($pagetitle, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'title_setup', 0, $buttontoshow, '', $limit);
print $langs->trans('CronInfo').'<br>';
@ -288,8 +352,9 @@ print info_admin($text);
print '<br>';
$varpage=empty($contextpage)?$_SERVER["PHP_SELF"]:$contextpage;
$selectedfields='';
//$selectedfields=$form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage); // This also change content of $arrayfields
//$selectedfields.=(count($arrayofmassactions) ? $form->showCheckAddButtons('checkforselect', 1) : '');
$selectedfields.=(count($arrayofmassactions) ? $form->showCheckAddButtons('checkforselect', 1) : '');
print '<div class="div-table-responsive">';
print '<table class="noborder">';
@ -311,7 +376,7 @@ print '<td class="liste_titre">&nbsp;</td>';
print '<td class="liste_titre">&nbsp;</td>';
print '<td class="liste_titre">&nbsp;</td>';
print '<td class="liste_titre" align="center">';
print $form->selectarray('status', array('0'=>$langs->trans("Disabled"), '1'=>$langs->trans("Enabled"), '-2'=>$langs->trans("EnabledAndDisabled"), '2'=>$langs->trans("Archived")), $status, 1);
print $form->selectarray('search_status', array('0'=>$langs->trans("Disabled"), '1'=>$langs->trans("Enabled"), '-2'=>$langs->trans("EnabledAndDisabled"), '2'=>$langs->trans("Archived")), $search_status, 1);
print '</td><td class="liste_titre" align="right">';
$searchpicto=$form->showFilterButtons();
print $searchpicto;
@ -333,7 +398,7 @@ print_liste_field_titre("CronLastResult",$_SERVER["PHP_SELF"],"t.lastresult","",
print_liste_field_titre("CronLastOutput",$_SERVER["PHP_SELF"],"t.lastoutput","",$param,'',$sortfield,$sortorder);
print_liste_field_titre("CronDtNextLaunch",$_SERVER["PHP_SELF"],"t.datenextrun","",$param,'align="center"',$sortfield,$sortorder);
print_liste_field_titre("Status",$_SERVER["PHP_SELF"],"t.status,t.priority","",$param,'align="center"',$sortfield,$sortorder);
print_liste_field_titre('');
print_liste_field_titre($selectedfields,$_SERVER["PHP_SELF"],"","",$param,'align="center"',$sortfield,$sortorder,'maxwidthsearch ');
print "</tr>\n";
@ -467,6 +532,12 @@ if ($num > 0)
} else {
print "<a href=\"#\" title=\"".dol_escape_htmltag($langs->trans('NotEnoughPermissions'))."\">".img_picto($langs->trans('NotEnoughPermissions'),"playdisabled")."</a>";
}
if ($massactionbutton || $massaction) // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined
{
$selected=0;
if (in_array($obj->rowid, $arrayofselected)) $selected=1;
print ' &nbsp; <input id="cb'.$obj->rowid.'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$obj->rowid.'"'.($selected?' checked="checked"':'').'>';
}
print '</td>';
print '</tr>';

View File

@ -209,7 +209,7 @@ print load_fiche_titre($langs->trans("DonationsSetup"),$linkback,'title_setup');
$head = donation_admin_prepare_head();
dol_fiche_head($head, 'general', $langs->trans("Donations"), 0, 'payment');
dol_fiche_head($head, 'general', $langs->trans("Donations"), -1, 'payment');
// Document templates

View File

@ -67,7 +67,7 @@ print load_fiche_titre($langs->trans("DonationsSetup"),$linkback,'title_setup');
$head = donation_admin_prepare_head();
dol_fiche_head($head, 'attributes', $langs->trans("Donations"), 0, 'payment');
dol_fiche_head($head, 'attributes', $langs->trans("Donations"), -1, 'payment');
require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_view.tpl.php';

View File

@ -98,20 +98,21 @@ if ($action == 'update')
{
$object->fetch($id);
$object->firstname = GETPOST("firstname");
$object->lastname = GETPOST("lastname");
$object->societe = GETPOST("societe");
$object->address = GETPOST("address");
$object->amount = price2num(GETPOST("amount"));
$object->town = GETPOST("town");
$object->zip = GETPOST("zipcode");
$object->firstname = GETPOST("firstname",'alpha');
$object->lastname = GETPOST("lastname",'alpha');
$object->societe = GETPOST("societe",'alpha');
$object->address = GETPOST("address",'alpha');
$object->amount = price2num(GETPOST("amount",'alpha'));
$object->town = GETPOST("town",'alpha');
$object->zip = GETPOST("zipcode",'alpha');
$object->country_id = GETPOST('country_id', 'int');
$object->email = GETPOST("email");
$object->email = GETPOST("email",'alpha');
$object->date = $donation_date;
$object->public = GETPOST("public");
$object->fk_project = GETPOST("fk_project");
$object->note_private= GETPOST("note_private");
$object->note_public = GETPOST("note_public");
$object->public = GETPOST("public",'alpha');
$object->fk_project = GETPOST("fk_project",'alpha');
$object->note_private= GETPOST("note_private",'none');
$object->note_public = GETPOST("note_public",'none');
$object->modepaymentid = GETPOST('modepayment','int');
// Fill array 'array_options' with data from add form
$ret = $extrafields->setOptionalsFromPost($extralabels,$object);
@ -151,20 +152,21 @@ if ($action == 'add')
if (! $error)
{
$object->firstname = GETPOST("firstname");
$object->lastname = GETPOST("lastname");
$object->societe = GETPOST("societe");
$object->address = GETPOST("address");
$object->amount = price2num(GETPOST("amount"));
$object->zip = GETPOST("zipcode");
$object->town = GETPOST("town");
$object->firstname = GETPOST("firstname",'alpha');
$object->lastname = GETPOST("lastname",'alpha');
$object->societe = GETPOST("societe",'alpha');
$object->address = GETPOST("address",'alpha');
$object->amount = price2num(GETPOST("amount",'alpha'));
$object->zip = GETPOST("zipcode",'alpha');
$object->town = GETPOST("town",'alpha');
$object->country_id = GETPOST('country_id', 'int');
$object->email = GETPOST("email");
$object->email = GETPOST("email",'alpha');
$object->date = $donation_date;
$object->note_private= GETPOST("note_private");
$object->note_public = GETPOST("note_public");
$object->public = GETPOST("public");
$object->fk_project = GETPOST("fk_project");
$object->note_private= GETPOST("note_private",'none');
$object->note_public = GETPOST("note_public",'none');
$object->public = GETPOST("public",'alpha');
$object->fk_project = GETPOST("fk_project",'alpha');
$object->modepaymentid = GETPOST('modepayment','int');
// Fill array 'array_options' with data from add form
$ret = $extrafields->setOptionalsFromPost($extralabels,$object);
@ -348,6 +350,12 @@ if ($action == 'create')
print "<tr>".'<td>'.$langs->trans("EMail").'</td><td><input type="text" name="email" value="'.dol_escape_htmltag(GETPOST("email")).'" class="maxwidth200"></td></tr>';
// Payment mode
print "<tr><td>".$langs->trans("PaymentMode")."</td><td>\n";
$selected = GETPOST('modepayment','int');
$form->select_types_paiements($selected, 'modepayment', 'CRDT', 0, 1);
print "</td></tr>\n";
// Public note
print '<tr>';
print '<td class="tdtop">' . $langs->trans('NotePublic') . '</td>';
@ -480,14 +488,14 @@ if (! empty($id) && $action == 'edit')
print "<tr>".'<td>'.$langs->trans("EMail").'</td><td><input type="text" name="email" class="maxwidth200" value="'.dol_escape_htmltag($object->email).'"></td></tr>';
// Payment mode
print "<tr><td>".$langs->trans("PaymentMode")."</td><td>\n";
if ($object->modepaymentid) $selected = $object->modepaymentid;
else $selected = '';
$form->select_types_paiements($selected, 'modepayment', 'CRDT', 0, 1);
print "</td></tr>\n";
// Status
print "<tr>".'<td>'.$langs->trans("Status").'</td><td>'.$object->getLibStatut(4).'</td></tr>';
// Project
@ -764,7 +772,7 @@ if (! empty($id) && $action != 'edit')
$filename = dol_sanitizeFileName($object->id);
$filedir = $conf->don->dir_output . "/" . dol_sanitizeFileName($object->id);
$urlsource = $_SERVER['PHP_SELF'].'?rowid='.$object->id;
$genallowed = ($object->statut == 2 && ($object->paid == 0 || $user->admin) && $user->rights->don->lire);
$genallowed = (($object->paid == 0 || $user->admin) && $user->rights->don->lire);
$delallowed = $user->rights->don->creer;
print $formfile->showdocuments('donation',$filename,$filedir,$urlsource,$genallowed,$delallowed,$object->modelpdf);

View File

@ -69,7 +69,7 @@ class Don extends CommonObject
global $langs;
$this->db = $db;
$this->modepaiementid = 0;
$this->modepaymentid = 0;
$langs->load("donations");
$this->labelstatut[-1]=$langs->trans("Canceled");
@ -338,7 +338,6 @@ class Don extends CommonObject
$sql.= ", address";
$sql.= ", zip";
$sql.= ", town";
// $sql.= ", country"; -- Deprecated
$sql.= ", fk_country";
$sql.= ", public";
$sql.= ", fk_projet";
@ -354,7 +353,7 @@ class Don extends CommonObject
$sql.= " '".$this->db->idate($now)."'";
$sql.= ", ".$conf->entity;
$sql.= ", ".price2num($this->amount);
$sql.= ", ".($this->modepaiementid?$this->modepaiementid:"null");
$sql.= ", ".($this->modepaymentid?$this->modepaymentid:"null");
$sql.= ", '".$this->db->escape($this->firstname)."'";
$sql.= ", '".$this->db->escape($this->lastname)."'";
$sql.= ", '".$this->db->escape($this->societe)."'";
@ -605,9 +604,10 @@ class Don extends CommonObject
$sql = "SELECT d.rowid, d.datec, d.date_valid, d.tms as datem, d.datedon,";
$sql.= " d.firstname, d.lastname, d.societe, d.amount, d.fk_statut, d.address, d.zip, d.town, ";
$sql.= " d.fk_country, d.country as country_olddata, d.public, d.amount, d.fk_payment, d.paid, d.note_private, d.note_public, cp.libelle, d.email, d.phone, ";
$sql.= " d.fk_country, d.country as country_olddata, d.public, d.amount, d.fk_payment, d.paid, d.note_private, d.note_public, d.email, d.phone, ";
$sql.= " d.phone_mobile, d.fk_projet as fk_project, d.model_pdf,";
$sql.= " p.ref as project_ref,";
$sql.= " cp.libelle as payment_label, cp.code as payment_code,";
$sql.= " c.code as country_code, c.label as country";
$sql.= " FROM ".MAIN_DB_PREFIX."don as d";
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."projet as p ON p.rowid = d.fk_projet";
@ -657,7 +657,8 @@ class Don extends CommonObject
$this->fk_project = $obj->fk_project;
$this->public = $obj->public;
$this->modepaymentid = $obj->fk_payment;
$this->modepayment = $obj->libelle;
$this->modepaymentcode = $obj->payment_code;
$this->modepayment = $obj->payment_label;
$this->paid = $obj->paid;
$this->amount = $obj->amount;
$this->note_private = $obj->note_private;

View File

@ -1272,7 +1272,7 @@ if ($action == 'create')
print '<td align="center">';
if ($line->product_type == Product::TYPE_PRODUCT || ! empty($conf->global->STOCK_SUPPORTS_SERVICES))
{
if (GETPOST('qtyl'.$indiceAsked, 'int')) $defaultqty=GETPOST('qtyl'.$indiceAsked, 'int');
if (GETPOST('qtyl'.$indiceAsked, 'int')) $deliverableQty=GETPOST('qtyl'.$indiceAsked, 'int');
print '<input name="idl'.$indiceAsked.'" type="hidden" value="'.$line->id.'">';
print '<input name="qtyl'.$indiceAsked.'" id="qtyl'.$indiceAsked.'" type="text" size="4" value="'.$deliverableQty.'">';
}

View File

@ -59,14 +59,15 @@ class ExpeditionLineBatch extends CommonObject
function fetchFromStock($id_stockdluo)
{
$sql = "SELECT";
$sql.= " t.sellby,";
$sql.= " t.eatby,";
$sql.= " t.batch,";
$sql.= " e.fk_entrepot";
$sql.= " pb.batch,";
$sql.= " pl.sellby,";
$sql.= " pl.eatby,";
$sql.= " ps.fk_entrepot";
$sql.= " FROM ".MAIN_DB_PREFIX."product_batch as t inner join ";
$sql.= MAIN_DB_PREFIX."product_stock as e on t.fk_product_stock=e.rowid ";
$sql.= " WHERE t.rowid = ".(int) $id_stockdluo;
$sql.= " FROM ".MAIN_DB_PREFIX."product_batch as pb";
$sql.= " JOIN ".MAIN_DB_PREFIX."product_stock as ps on pb.fk_product_stock=ps.rowid";
$sql.= ' LEFT JOIN '.MAIN_DB_PREFIX."product_lot as pl on pl.batch = pb.batch AND pl.fk_product = ps.fk_product";
$sql.= " WHERE pb.rowid = ".(int) $id_stockdluo;
dol_syslog(get_class($this)."::fetch", LOG_DEBUG);
$resql=$this->db->query($sql);

View File

@ -347,9 +347,11 @@ if ($object->id > 0)
// Nbre max d'elements des petites listes
$MAXLIST=$conf->global->MAIN_SIZE_SHORTLIST_LIMIT;
print '<div class="underbanner clearboth"></div>';
// Lien recap
$boxstat.='<div class="box">';
$boxstat.='<table summary="'.dol_escape_htmltag($langs->trans("DolibarrStateBoard")).'" class="noborder boxtable boxtablenobottom" width="100%">';
$boxstat.='<table summary="'.dol_escape_htmltag($langs->trans("DolibarrStateBoard")).'" class="border boxtable boxtablenobottom boxtablenotop" width="100%">';
$boxstat.='<tr class="impair"><td colspan="2" class="tdboxstats nohover">';
if ($conf->supplier_proposal->enabled)

View File

@ -339,14 +339,14 @@ if (empty($user->societe_id))
}
}
$boxstat.='<a class="boxstatsindicator thumbstat nobold nounderline"></a>';
$boxstat.='<a class="boxstatsindicator thumbstat nobold nounderline"></a>';
$boxstat.='<a class="boxstatsindicator thumbstat nobold nounderline"></a>';
$boxstat.='<a class="boxstatsindicator thumbstat nobold nounderline"></a>';
$boxstat.='<a class="boxstatsindicator thumbstat nobold nounderline"></a>';
$boxstat.='<a class="boxstatsindicator thumbstat nobold nounderline"></a>';
$boxstat.='<a class="boxstatsindicator thumbstat nobold nounderline"></a>';
$boxstat.='<a class="boxstatsindicator thumbstat nobold nounderline"></a>';
$boxstat.='<a class="boxstatsindicator thumbstat nobold nounderline"><div class="boxstatsempty"></div></a>';
$boxstat.='<a class="boxstatsindicator thumbstat nobold nounderline"><div class="boxstatsempty"></div></a>';
$boxstat.='<a class="boxstatsindicator thumbstat nobold nounderline"><div class="boxstatsempty"></div></a>';
$boxstat.='<a class="boxstatsindicator thumbstat nobold nounderline"><div class="boxstatsempty"></div></a>';
$boxstat.='<a class="boxstatsindicator thumbstat nobold nounderline"><div class="boxstatsempty"></div></a>';
$boxstat.='<a class="boxstatsindicator thumbstat nobold nounderline"><div class="boxstatsempty"></div></a>';
$boxstat.='<a class="boxstatsindicator thumbstat nobold nounderline"><div class="boxstatsempty"></div></a>';
$boxstat.='<a class="boxstatsindicator thumbstat nobold nounderline"><div class="boxstatsempty"></div></a>';
$boxstat.='</td></tr>';
$boxstat.='</table>';
@ -583,12 +583,12 @@ if (! empty($valid_dashboardlines))
$boxwork .="\n";
}
$boxwork .='<div class="boxstatsindicator thumbstat150 nobold nounderline"></div>';
$boxwork .='<div class="boxstatsindicator thumbstat150 nobold nounderline"></div>';
$boxwork .='<div class="boxstatsindicator thumbstat150 nobold nounderline"></div>';
$boxwork .='<div class="boxstatsindicator thumbstat150 nobold nounderline"></div>';
$boxwork .='<div class="boxstatsindicator thumbstat150 nobold nounderline"></div>';
$boxwork .='<div class="boxstatsindicator thumbstat150 nobold nounderline"></div>';
$boxwork .='<div class="boxstatsindicator thumbstat150 nobold nounderline"><div class="boxstats150empty"></div></div>';
$boxwork .='<div class="boxstatsindicator thumbstat150 nobold nounderline"><div class="boxstats150empty"></div></div>';
$boxwork .='<div class="boxstatsindicator thumbstat150 nobold nounderline"><div class="boxstats150empty"></div></div>';
$boxwork .='<div class="boxstatsindicator thumbstat150 nobold nounderline"><div class="boxstats150empty"></div></div>';
$boxwork .='<div class="boxstatsindicator thumbstat150 nobold nounderline"><div class="boxstats150empty"></div></div>';
$boxwork .='<div class="boxstatsindicator thumbstat150 nobold nounderline"><div class="boxstats150empty"></div></div>';
$boxwork .='</td></tr>';
}
else

View File

@ -29,7 +29,7 @@ create table llx_don
fk_statut smallint NOT NULL DEFAULT 0, -- Status of donation promise or validate
datedon datetime, -- Date of the donation/promise
amount double(24,8) DEFAULT 0,
fk_payment integer,
fk_payment integer, -- Id of payment mode
paid smallint default 0 NOT NULL,
firstname varchar(50),
lastname varchar(50),

View File

@ -31,4 +31,4 @@ CREATE TABLE llx_expensereport_rules (
code_expense_rules_type varchar(50) NOT NULL,
is_for_all tinyint DEFAULT '0',
entity integer DEFAULT 1
) ENGINE=InnoDB
) ENGINE=InnoDB;

View File

@ -201,8 +201,10 @@ if ($action == "set")
{
$buffer=preg_replace('/type=innodb/i','ENGINE=innodb',$buffer);
}
else if ($conf->db->type == 'mssql')
else
{
// Keyword ENGINE is MySQL-specific, so scrub it for
// other database types (mssql, pgsql)
$buffer=preg_replace('/type=innodb/i','',$buffer);
$buffer=preg_replace('/ENGINE=innodb/i','',$buffer);
}

View File

@ -707,6 +707,8 @@ WarningYouAreInMaintenanceMode=Warning, you are in a maintenance mode, so only l
CoreErrorTitle=System error
CoreErrorMessage=Sorry, an error occurred. Contact your system administrator to check the logs or disable $dolibarr_main_prod=1 to get more information.
CreditCard=Credit card
ValidatePayment=Validate payment
CreditOrDebitCard=Credit or debit card
FieldsWithAreMandatory=Fields with <b>%s</b> are mandatory
FieldsWithIsForPublic=Fields with <b>%s</b> are shown on public list of members. If you don't want this, check off the "public" box.
AccordingToGeoIPDatabase=(according to GeoIP convertion)

View File

@ -216,6 +216,7 @@ StartUpload=Start upload
CancelUpload=Cancel upload
FileIsTooBig=Files is too big
PleaseBePatient=Please be patient...
NewPassword=New password
ResetPassword=Reset password
RequestToResetPasswordReceived=A request to change your Dolibarr password has been received
NewKeyIs=This is your new keys to login

View File

@ -29,4 +29,6 @@ ShortErrorMessage=Short Error Message
ErrorCode=Error Code
ErrorSeverityCode=Error Severity Code
OnlinePaymentSystem=Online payment system
PaypalLiveEnabled=Paypal live enabled (otherwise test/sandbox mode)
PaypalLiveEnabled=Paypal live enabled (otherwise test/sandbox mode)
PaypalImportPayment=Import Paypal payments
PostActionAfterPayment=Post actions after payments

View File

@ -100,6 +100,7 @@ ActivityOnProjectThisMonth=Activity on project this month
ActivityOnProjectThisYear=Activity on project this year
ChildOfProjectTask=Child of project/task
ChildOfTask=Child of task
TaskHasChild=Task has child
NotOwnerOfProject=Not owner of this private project
AffectedTo=Allocated to
CantRemoveProject=This project can't be removed as it is referenced by some other objects (invoice, orders or other). See referers tab.

View File

@ -37,4 +37,6 @@ STRIPE_TEST_SECRET_KEY=Secret test key
STRIPE_TEST_PUBLISHABLE_KEY=Publishable test key
STRIPE_LIVE_SECRET_KEY=Secret live key
STRIPE_LIVE_PUBLISHABLE_KEY=Publishable live key
StripeLiveEnabled=Stripe live enabled (otherwise test/sandbox mode)
StripeLiveEnabled=Stripe live enabled (otherwise test/sandbox mode)
StripeImportPayment=Import Stripe payments
ExampleOfTestCreditCard=Example of credit card for test: %s (valid), %s (error CVC), %s (expired), %s (charge fails)

View File

@ -42,12 +42,17 @@ $error=0;
@set_time_limit(0); // No timeout for this script
define('EVEN_IF_ONLY_LOGIN_ALLOWED',1); // Set this define to 0 if you want to lock your script when dolibarr setup is "locked to admin user only".
// Include and load Dolibarr environment variables
// Load Dolibarr environment
$res=0;
if (! $res && file_exists($path."master.inc.php")) $res=@include($path."master.inc.php");
if (! $res && file_exists($path."../master.inc.php")) $res=@include($path."../master.inc.php");
if (! $res && file_exists($path."../../master.inc.php")) $res=@include($path."../../master.inc.php");
if (! $res && file_exists($path."../../../master.inc.php")) $res=@include($path."../../../master.inc.php");
// Try master.inc.php into web root detected using web root caluclated 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))."/master.inc.php")) $res=@include(substr($tmp, 0, ($i+1))."/master.inc.php");
if (! $res && $i > 0 && file_exists(dirname(substr($tmp, 0, ($i+1)))."/master.inc.php")) $res=@include(dirname(substr($tmp, 0, ($i+1)))."/master.inc.php");
// Try master.inc.php using relative path
if (! $res && file_exists("../master.inc.php")) $res=@include("../master.inc.php");
if (! $res && file_exists("../../master.inc.php")) $res=@include("../../master.inc.php");
if (! $res && file_exists("../../../master.inc.php")) $res=@include("../../../master.inc.php");
if (! $res) die("Include of master fails");
// After this $db, $mysoc, $langs, $conf and $hookmanager are defined (Opened $db handler to database will be closed at end of file).
// $user is created but empty.

View File

@ -55,6 +55,8 @@ if ($action == 'setvalue' && $user->admin)
$result=dolibarr_set_const($db, "PAYBOX_PBX_IDENTIFIANT",GETPOST('PAYBOX_PBX_IDENTIFIANT','alpha'),'chaine',0,'',$conf->entity);
if (! $result > 0) $error++;
$result=dolibarr_set_const($db, "ONLINE_PAYMENT_CREDITOR",GETPOST('ONLINE_PAYMENT_CREDITOR','alpha'),'chaine',0,'',$conf->entity);
if (! $result > 0) $error++;
$result=dolibarr_set_const($db, "PAYBOX_BANK_ACCOUNT_FOR_PAYMENTS",GETPOST('PAYBOX_BANK_ACCOUNT_FOR_PAYMENTS','int'),'chaine',0,'',$conf->entity);
if (! $result > 0) $error++;
$result=dolibarr_set_const($db, "ONLINE_PAYMENT_CSS_URL",GETPOST('ONLINE_PAYMENT_CSS_URL','alpha'),'chaine',0,'',$conf->entity);
if (! $result > 0) $error++;
@ -183,6 +185,15 @@ print '<br>'.$langs->trans("Example").': '.$mysoc->name;
print '</td></tr>';
if (! empty($conf->banque->enabled))
{
print '<tr class="oddeven"><td>';
print $langs->trans("BankAccount").'</td><td>';
print $form->select_comptes($conf->global->PAYBOX_BANK_ACCOUNT_FOR_PAYMENTS, 'PAYBOX_BANK_ACCOUNT_FOR_PAYMENTS', 0, '', 1);
print '</td></tr>';
}
print '<tr class="oddeven"><td>';
print $langs->trans("CSSUrlForPaymentForm").'</td><td>';
print '<input size="64" type="text" name="ONLINE_PAYMENT_CSS_URL" value="'.$conf->global->ONLINE_PAYMENT_CSS_URL.'">';

View File

@ -55,6 +55,8 @@ if ($action == 'setvalue' && $user->admin)
if (! $result > 0) $error++;
$result=dolibarr_set_const($db, "ONLINE_PAYMENT_CREDITOR",GETPOST('ONLINE_PAYMENT_CREDITOR','alpha'),'chaine',0,'',$conf->entity);
if (! $result > 0) $error++;
$result=dolibarr_set_const($db, "PAYPAL_BANK_ACCOUNT_FOR_PAYMENTS",GETPOST('PAYPAL_BANK_ACCOUNT_FOR_PAYMENTS','int'),'chaine',0,'',$conf->entity);
if (! $result > 0) $error++;
$result=dolibarr_set_const($db, "PAYPAL_API_INTEGRAL_OR_PAYPALONLY",GETPOST('PAYPAL_API_INTEGRAL_OR_PAYPALONLY','alpha'),'chaine',0,'',$conf->entity);
if (! $result > 0) $error++;
$result=dolibarr_set_const($db, "ONLINE_PAYMENT_CSS_URL",GETPOST('ONLINE_PAYMENT_CSS_URL','alpha'),'chaine',0,'',$conf->entity);
@ -210,6 +212,13 @@ print '<input size="64" type="text" name="ONLINE_PAYMENT_CREDITOR" value="'.$con
print ' &nbsp; '.$langs->trans("Example").': '.$mysoc->name;
print '</td></tr>';
if (! empty($conf->banque->enabled))
{
print '<tr class="oddeven"><td>';
print $langs->trans("BankAccount").'</td><td>';
print $form->select_comptes($conf->global->PAYPAL_BANK_ACCOUNT_FOR_PAYMENTS, 'PAYPAL_BANK_ACCOUNT_FOR_PAYMENTS', 0, '', 1);
print '</td></tr>';
}
print '<tr class="oddeven"><td>';
print $langs->trans("CSSUrlForPaymentForm").'</td><td>';

View File

@ -192,7 +192,7 @@ function getPaypalPaymentUrl($mode,$type,$ref='',$amount='9.99',$freetag='your_f
* @param string $returnURL Url to use if payment is OK
* @param string $cancelURL Url to use if payment is KO
* @param string $tag Full tag
* @return void
* @return string No return (a redirect is done) if OK, or Error message if KO
*/
function print_paypal_redirect($paymentAmount,$currencyCodeType,$paymentType,$returnURL,$cancelURL,$tag)
{
@ -272,11 +272,20 @@ function print_paypal_redirect($paymentAmount,$currencyCodeType,$paymentType,$re
$ErrorLongMsg = urldecode($resArray["L_LONGMESSAGE0"]);
$ErrorSeverityCode = urldecode($resArray["L_SEVERITYCODE0"]);
echo $langs->trans('SetExpressCheckoutAPICallFailed') . "<br>\n";
echo $langs->trans('DetailedErrorMessage') . ": " . $ErrorLongMsg."<br>\n";
echo $langs->trans('ShortErrorMessage') . ": " . $ErrorShortMsg."<br>\n";
echo $langs->trans('ErrorCode') . ": " . $ErrorCode."<br>\n";
echo $langs->trans('ErrorSeverityCode') . ": " . $ErrorSeverityCode."<br>\n";
if ($ErrorCode == 10729)
{
$mesg.= "PayPal can't accept payments for this thirdparty. An address is defined but is not complete (missing State).<br>Ask system administrator to fix address or to setup Paypal module to accept payments even on not complete addresses (remove option PAYPAL_REQUIRE_VALID_SHIPPING_ADDRESS).<br>\n";
}
else
{
$mesg = $langs->trans('SetExpressCheckoutAPICallFailed') . "<br>\n";
$mesg.= $langs->trans('DetailedErrorMessage') . ": " . $ErrorLongMsg."<br>\n";
$mesg.= $langs->trans('ShortErrorMessage') . ": " . $ErrorShortMsg."<br>\n";
$mesg.= $langs->trans('ErrorCode') . ": " . $ErrorCode."<br>\n";
$mesg.= $langs->trans('ErrorSeverityCode') . ": " . $ErrorSeverityCode."<br>\n";
}
return $mesg;
}
}
@ -300,6 +309,7 @@ function print_paypal_redirect($paymentAmount,$currencyCodeType,$paymentType,$re
* phoneNum: the phoneNum entered on the merchant's site
* email: the buyer email
* desc: Product description
* See https://developer.paypal.com/docs/classic/api/merchant/SetExpressCheckout_API_Operation_NVP/
*
* @param double $paymentAmount Payment amount
* @param string $currencyCodeType Currency
@ -307,8 +317,8 @@ function print_paypal_redirect($paymentAmount,$currencyCodeType,$paymentType,$re
* @param string $returnURL Return Url
* @param string $cancelURL Cancel Url
* @param string $tag Full tag
* @param string $solutionType Type
* @param string $landingPage Landing page
* @param string $solutionType Type ('Mark' or 'Sole')
* @param string $landingPage Landing page ('Login' or 'Billing')
* @param string $shipToName Ship to name
* @param string $shipToStreet Ship to street
* @param string $shipToCity Ship to city
@ -327,38 +337,86 @@ function callSetExpressCheckout($paymentAmount, $currencyCodeType, $paymentType,
// Construct the parameter string that describes the SetExpressCheckout API call in the shortcut implementation
//declaring of global variables
global $conf, $langs;
global $conf, $langs, $mysoc;
global $API_Endpoint, $API_Url, $API_version, $USE_PROXY, $PROXY_HOST, $PROXY_PORT;
global $PAYPAL_API_USER, $PAYPAL_API_PASSWORD, $PAYPAL_API_SIGNATURE;
$nvpstr = '';
$nvpstr = $nvpstr . "&AMT=". urlencode($paymentAmount); // AMT deprecated by paypal -> PAYMENTREQUEST_n_AMT
$nvpstr = $nvpstr . "&PAYMENTACTION=" . urlencode($paymentType); // PAYMENTACTION deprecated by paypal -> PAYMENTREQUEST_n_PAYMENTACTION
$nvpstr = $nvpstr . "&VERSION=98.0";
$nvpstr = $nvpstr . "&RETURNURL=" . urlencode($returnURL);
$nvpstr = $nvpstr . "&CANCELURL=" . urlencode($cancelURL);
$nvpstr = $nvpstr . "&CURRENCYCODE=" . urlencode($currencyCodeType); // CURRENCYCODE deprecated by paypal -> PAYMENTREQUEST_n_CURRENCYCODE
$nvpstr = $nvpstr . "&ADDROVERRIDE=1";
//$nvpstr = $nvpstr . "&ALLOWNOTE=0";
$nvpstr = $nvpstr . "&SHIPTONAME=" . urlencode($shipToName); // SHIPTONAME deprecated by paypal -> PAYMENTREQUEST_n_SHIPTONAME
$nvpstr = $nvpstr . "&SHIPTOSTREET=" . urlencode($shipToStreet); //
$nvpstr = $nvpstr . "&SHIPTOSTREET2=" . urlencode($shipToStreet2);
$nvpstr = $nvpstr . "&SHIPTOCITY=" . urlencode($shipToCity);
$nvpstr = $nvpstr . "&SHIPTOSTATE=" . urlencode($shipToState);
$nvpstr = $nvpstr . "&SHIPTOCOUNTRYCODE=" . urlencode($shipToCountryCode);
$nvpstr = $nvpstr . "&SHIPTOZIP=" . urlencode($shipToZip);
$nvpstr = $nvpstr . "&PHONENUM=" . urlencode($phoneNum);
if (! empty($conf->global->PAYPAL_ALLOW_NOTES))
{
$nvpstr = $nvpstr . "&ALLOWNOTE=0";
}
if (empty($conf->global->PAYPAL_REQUIRE_VALID_SHIPPING_ADDRESS))
{
$nvpstr = $nvpstr . "&NOSHIPPING=1"; // An empty or not complete shipping address will be accepted
}
else
{
$nvpstr = $nvpstr . "&NOSHIPPING=0"; // A valid shipping address is required (full required fields mandatory)
}
$nvpstr = $nvpstr . "&SOLUTIONTYPE=" . urlencode($solutionType);
$nvpstr = $nvpstr . "&LANDINGPAGE=" . urlencode($landingPage);
//$nvpstr = $nvpstr . "&CUSTOMERSERVICENUMBER=" . urlencode($tag); // Hotline phone number
$nvpstr = $nvpstr . "&INVNUM=" . urlencode($tag);
if (! empty($email)) $nvpstr = $nvpstr . "&EMAIL=" . urlencode($email);
if (! empty($desc)) $nvpstr = $nvpstr . "&DESC=" . urlencode($desc); // DESC deprecated by paypal -> PAYMENTREQUEST_n_DESC
if (! empty($conf->global->PAYPAL_CUSTOMER_SERVICE_NUMBER))
{
$nvpstr = $nvpstr . "&CUSTOMERSERVICENUMBER=" . urlencode($conf->global->PAYPAL_CUSTOMER_SERVICE_NUMBER); // Hotline phone number
}
$paypalprefix = 'PAYMENTREQUEST_0_';
//$paypalprefix = '';
if (! empty($paypalprefix) && $paymentType == 'Sole') $paymentType='Sale';
$nvpstr = $nvpstr . "&AMT=". urlencode($paymentAmount); // Total for all elements
$nvpstr = $nvpstr . "&".$paypalprefix."INVNUM=" . urlencode($tag);
$nvpstr = $nvpstr . "&".$paypalprefix."AMT=". urlencode($paymentAmount); // AMT deprecated by paypal -> PAYMENTREQUEST_n_AMT
$nvpstr = $nvpstr . "&".$paypalprefix."ITEMAMT=". urlencode($paymentAmount); // AMT deprecated by paypal -> PAYMENTREQUEST_n_AMT
$nvpstr = $nvpstr . "&".$paypalprefix."PAYMENTACTION=" . urlencode($paymentType); // PAYMENTACTION deprecated by paypal -> PAYMENTREQUEST_n_PAYMENTACTION
$nvpstr = $nvpstr . "&".$paypalprefix."CURRENCYCODE=" . urlencode($currencyCodeType); // CURRENCYCODE deprecated by paypal -> PAYMENTREQUEST_n_CURRENCYCODE
$nvpstr = $nvpstr . "&".$paypalprefix."L_PAYMENTREQUEST_0_QTY0=1";
$nvpstr = $nvpstr . "&".$paypalprefix."L_PAYMENTREQUEST_0_AMT0=".urlencode($paymentAmount);
$nvpstr = $nvpstr . "&".$paypalprefix."L_PAYMENTREQUEST_0_NAME0=".urlencode($desc);
$nvpstr = $nvpstr . "&".$paypalprefix."L_PAYMENTREQUEST_0_NUMBER0=0";
$nvpstr = $nvpstr . "&".$paypalprefix."SHIPTONAME=" . urlencode($shipToName); // SHIPTONAME deprecated by paypal -> PAYMENTREQUEST_n_SHIPTONAME
$nvpstr = $nvpstr . "&".$paypalprefix."SHIPTOSTREET=" . urlencode($shipToStreet); //
$nvpstr = $nvpstr . "&".$paypalprefix."SHIPTOSTREET2=" . urlencode($shipToStreet2);
$nvpstr = $nvpstr . "&".$paypalprefix."SHIPTOCITY=" . urlencode($shipToCity);
$nvpstr = $nvpstr . "&".$paypalprefix."SHIPTOSTATE=" . urlencode($shipToState);
$nvpstr = $nvpstr . "&".$paypalprefix."SHIPTOCOUNTRYCODE=" . urlencode($shipToCountryCode);
$nvpstr = $nvpstr . "&".$paypalprefix."SHIPTOZIP=" . urlencode($shipToZip);
$nvpstr = $nvpstr . "&".$paypalprefix."PHONENUM=" . urlencode($phoneNum);
if (! empty($email)) $nvpstr = $nvpstr . "&".$paypalprefix."EMAIL=" . urlencode($email); // EMAIL deprecated by paypal -> PAYMENTREQUEST_n_EMAIL
if (! empty($desc)) $nvpstr = $nvpstr . "&".$paypalprefix."DESC=" . urlencode($desc); // DESC deprecated by paypal -> PAYMENTREQUEST_n_DESC
if (! empty($conf->global->PAYPAL_LOGOIMG) && $mysoc->logo)
{
global $dolibarr_main_url_root;
// Define $urlwithroot
$urlwithouturlroot=preg_replace('/'.preg_quote(DOL_URL_ROOT,'/').'$/i','',trim($dolibarr_main_url_root));
$urlwithroot=$urlwithouturlroot.DOL_URL_ROOT; // This is to use external domain name found into config file
//$urlwithroot=DOL_MAIN_URL_ROOT; // This is to use same domain name than current
$urllogo=$urlwithroot."/viewimage.php?modulepart=mycompany&file=".$mysoc->logo;
$nvpstr = $nvpstr . "&LOGOIMG=" . urlencode($urllogo);
}
if (! empty($conf->global->PAYPAL_BRANDNAME))
{
$nvpstr = $nvpstr . "&BRANDNAME=" . urlencode($conf->global->PAYPAL_BRANDNAME); // BRANDNAME
}
if (! empty($conf->global->PAYPAL_NOTETOBUYER))
{
$nvpstr = $nvpstr . "&NOTETOBUYER=" . urlencode($conf->global->PAYPAL_NOTETOBUYER); // PAYPAL_NOTETOBUYER
}
$_SESSION["FinalPaymentAmt"] = $paymentAmount;
$_SESSION["currencyCodeType"] = $currencyCodeType;
$_SESSION["PaymentType"] = $paymentType;
$_SESSION['ipaddress'] = $_SERVER['REMOTE_ADDR ']; // Payer ip
$_SESSION["PaymentType"] = $paymentType; // 'Mark', 'Sole'
$_SESSION['ipaddress'] = $_SERVER['REMOTE_ADDR']; // Payer ip
//'---------------------------------------------------------------------------------------------------------------
//' Make the API call to PayPal

View File

@ -117,7 +117,7 @@ if ($action == 'confirm_delete' && $confirm == 'yes' && $user->rights->stock->su
if ($result > 0)
{
setEventMessages($langs->trans("RecordDeleted"), null, 'mesgs');
header("Location: ".DOL_URL_ROOT.'/product/stock/list.php?resotre_lastsearch_values=1');
header("Location: ".DOL_URL_ROOT.'/product/stock/list.php?restore_lastsearch_values=1');
exit;
}
else

View File

@ -332,7 +332,7 @@ $titletoadd=$langs->trans("Select");
$buttonrecord=$langs->trans("RecordMovement");
$titletoaddnoent=$langs->transnoentitiesnoconv("Select");
$buttonrecordnoent=$langs->transnoentitiesnoconv("RecordMovement");
print $langs->trans("SelectProductInAndOutWareHouse",$titletoaddnoent,$buttonrecordnoent).'<br>';
print '<span class="opacitymedium">'.$langs->trans("SelectProductInAndOutWareHouse",$titletoaddnoent,$buttonrecordnoent).'</span><br>';
print '<br>'."\n";
$var=true;
@ -445,14 +445,14 @@ print '<input type="hidden" name="token" value="' .$_SESSION['newtoken'] . '">';
print '<input type="hidden" name="action" value="createmovements">';
// Button to record mass movement
$codemove=(isset($_POST["codemove"])?GETPOST("codemove",'alpha'):dol_print_date(dol_now(),'%y%m%d%H%M%S'));
$codemove=(isset($_POST["codemove"])?GETPOST("codemove",'alpha'):dol_print_date(dol_now(),'%Y%m%d%H%M%S'));
$labelmovement=GETPOST("label")?GETPOST('label'):$langs->trans("StockTransfer").' '.dol_print_date($now,'%Y-%m-%d %H:%M');
print '<table class="border" width="100%">';
print '<table class="noborder" width="100%">';
print '<tr>';
print '<td class="titlefield">'.$langs->trans("InventoryCode").'</td>';
print '<td class="titlefield fieldrequired">'.$langs->trans("InventoryCode").'</td>';
print '<td>';
print '<input type="text" name="codemove" size="10" value="'.dol_escape_htmltag($codemove).'">';
print '<input type="text" name="codemove" size="15" value="'.dol_escape_htmltag($codemove).'">';
print '</td>';
print '</tr>';
print '<tr>';

View File

@ -196,6 +196,7 @@ class Project extends CommonObject
$sql.= ", " . ($this->date_end != '' ? "'".$this->db->idate($this->date_end)."'" : 'null');
$sql.= ", " . (strcmp($this->opp_amount,'') ? price2num($this->opp_amount) : 'null');
$sql.= ", " . (strcmp($this->budget_amount,'') ? price2num($this->budget_amount) : 'null');
$sql.= ", " . ($this->bill_time ? 1 : 0);
$sql.= ", ".$conf->entity;
$sql.= ")";

View File

@ -586,7 +586,7 @@ if ($id > 0 || ! empty($ref))
}
else
{
print '<a class="butActionRefused" href="#" title="'.$langs->trans("ProjecHasChild").'">'.$langs->trans('Delete').'</a>';
print '<a class="butActionRefused" href="#" title="'.$langs->trans("TaskHasChild").'">'.$langs->trans('Delete').'</a>';
}
}
else

View File

@ -264,6 +264,7 @@ else if (! empty($conf->global->$paramcreditor)) $creditor=$conf->global->$param
* Actions
*/
// Action dopayment is called after choosing the payment mode
if ($action == 'dopayment')
{
if ($paymentmethod == 'paypal')
@ -310,6 +311,7 @@ if ($action == 'dopayment')
dol_syslog("PAYPAL_API_KO: $PAYPAL_API_KO", LOG_DEBUG);
dol_syslog("PAYPAL_API_PRICE: $PAYPAL_API_PRICE", LOG_DEBUG);
dol_syslog("PAYPAL_API_DEVISE: $PAYPAL_API_DEVISE", LOG_DEBUG);
// All those fields may be empty when making a payment for a free amount for example
dol_syslog("shipToName: $shipToName", LOG_DEBUG);
dol_syslog("shipToStreet: $shipToStreet", LOG_DEBUG);
dol_syslog("shipToCity: $shipToCity", LOG_DEBUG);
@ -327,9 +329,10 @@ if ($action == 'dopayment')
//$_SESSION["FinalPaymentAmt"]=$PAYPAL_API_PRICE;
// A redirect is added if API call successfull
print_paypal_redirect($PAYPAL_API_PRICE,$PAYPAL_API_DEVISE,$PAYPAL_PAYMENT_TYPE,$PAYPAL_API_OK,$PAYPAL_API_KO, $FULLTAG);
$mesg = print_paypal_redirect($PAYPAL_API_PRICE,$PAYPAL_API_DEVISE,$PAYPAL_PAYMENT_TYPE,$PAYPAL_API_OK,$PAYPAL_API_KO, $FULLTAG);
exit;
// If we are here, it means the Paypal redirect was not done, so we show error message
$action = '';
}
}
@ -379,10 +382,12 @@ if ($action == 'dopayment')
// Called when choosing Stripe mode, after the 'dopayment'
if ($action == 'charge')
{
$amountstripe = $amount;
// Correct the amount according to unit of currency
// See https://support.stripe.com/questions/which-zero-decimal-currencies-does-stripe-support
$arrayzerounitcurrency=array('BIF', 'CLP', 'DJF', 'GNF', 'JPY', 'KMF', 'KRW', 'MGA', 'PYG', 'RWF', 'VND', 'VUV', 'XAF', 'XOF', 'XPF');
if (! in_array($currency, $arrayzerounitcurrency)) $amount=$amount * 100;
if (! in_array($currency, $arrayzerounitcurrency)) $amountstripe=$amountstripe * 100;
dol_syslog("POST keys : ".join(',', array_keys($_POST)), LOG_DEBUG, 0, '_stripe');
dol_syslog("POST values: ".join(',', $_POST), LOG_DEBUG, 0, '_stripe');
@ -411,7 +416,7 @@ if ($action == 'charge')
dol_syslog("Create charge", LOG_DEBUG, 0, '_stripe');
$charge = \Stripe\Charge::create(array(
'customer' => $customer->id,
'amount' => price2num($amount, 'MU'),
'amount' => price2num($amountstripe, 'MU'),
'currency' => $currency,
'description' => 'Stripe payment: '.$FULLTAG,
'metadata' => array("FULLTAG" => $FULLTAG, 'Recipient' => $mysoc->name),
@ -850,7 +855,7 @@ if ($source == 'invoice')
print '</td></tr>'."\n";
// Amount
print '<tr class="CTableRow'.($var?'1':'2').'"><td class="CTableRow'.($var?'1':'2').'">'.$langs->trans("Amount");
print '<tr class="CTableRow'.($var?'1':'2').'"><td class="CTableRow'.($var?'1':'2').'">'.$langs->trans("PaymentAmount");
if (empty($amount) && empty($object->paye)) print ' ('.$langs->trans("ToComplete").')';
print '</td><td class="CTableRow'.($var?'1':'2').'">';
if (empty($object->paye))
@ -1432,7 +1437,7 @@ if (preg_match('/^dopayment/',$action))
<div class="form-row left">
<label for="card-element">
Credit or debit card
'.$langs->trans("CreditOrDebitCard").'
</label>
<div id="card-element">
<!-- a Stripe Element will be inserted here. -->
@ -1442,7 +1447,7 @@ if (preg_match('/^dopayment/',$action))
<div id="card-errors" role="alert"></div>
</div>
<br>
<button class="button" id="buttontopay">'.$langs->trans("ToPay").'</button>
<button class="butAction" id="buttontopay">'.$langs->trans("ValidatePayment").'</button>
<img id="hourglasstopay" class="hidden" src="'.DOL_URL_ROOT.'/theme/'.$conf->theme.'/img/working.gif'.'">
</td></tr></tbody></table>

View File

@ -44,13 +44,7 @@ if (! empty($conf->paypal->enabled))
require_once DOL_DOCUMENT_ROOT.'/paypal/lib/paypalfunctions.lib.php';
}
$langs->load("main");
$langs->load("other");
$langs->load("dict");
$langs->load("bills");
$langs->load("companies");
$langs->load("paybox");
$langs->load("paypal");
$langs->loadLangs(array("main","other","dict","bills","companies","paybox","paypal"));
// Clean parameters
if (! empty($conf->paypal->enabled))
@ -130,6 +124,8 @@ $object = new stdClass(); // For triggers
* View
*/
$now = dol_now();
dol_syslog("Callback url when a payment was done. query_string=".(dol_escape_htmltag($_SERVER["QUERY_STRING"])?dol_escape_htmltag($_SERVER["QUERY_STRING"]):'')." script_uri=".(dol_escape_htmltag($_SERVER["SCRIPT_URI"])?dol_escape_htmltag($_SERVER["SCRIPT_URI"]):''), LOG_DEBUG, 0, '_payment');
$tracepost = "";
@ -183,7 +179,7 @@ if ($urllogo)
if (! empty($conf->paypal->enabled))
{
if ($paymentmethod == 'paypal')
if ($paymentmethod == 'paypal') // We call this page only if payment is ok on payment system
{
if ($PAYPALTOKEN)
{
@ -251,28 +247,187 @@ if (! empty($conf->paypal->enabled))
if (! empty($conf->paybox->enabled))
{
if ($paymentmethod == 'paybox') $ispaymentok = true; // We call this page only if payment is ok
if ($paymentmethod == 'paybox') $ispaymentok = true; // We call this page only if payment is ok on payment system
}
if (! empty($conf->stripe->enabled))
{
if ($paymentmethod == 'stripe') $ispaymentok = true; // We call this page only if payment is ok
if ($paymentmethod == 'stripe') $ispaymentok = true; // We call this page only if payment is ok on payment system
}
// If data not provided from back url, search them into the session env
if (empty($ipaddress)) $ipaddress = $_SESSION['ipaddress'];
if (empty($TRANSACTIONID)) $TRANSACTIONID = $_SESSION['TRANSACTIONID'];
if (empty($FinalPaymentAmt)) $FinalPaymentAmt = $_SESSION["FinalPaymentAmt"];
if (empty($paymentType)) $paymentType = $_SESSION["paymentType"];
$fulltag = $FULLTAG;
$tmptag=dolExplodeIntoArray($fulltag,'.','=');
// Make complementary actions
$ispostactionok = 0;
$postactionmessages = array();
if ($ispaymentok)
{
if (in_array('MEM', array_keys($tmptag)))
{
// Record subscription
include_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php';
$member = new Adherent($db);
$result = $member->fetch(0, $tmptag['MEM']);
if ($result)
{
if (empty($paymentType)) $paymentType = 'CB';
$paymentTypeId = dol_getIdFromCode($db, $paymentType,'c_paiement','code','id',1);
if (! empty($FinalPaymentAmt) && $paymentTypeId > 0)
{
}
else
{
$postactionmessages[] = 'Failed to get a valid value for "amount paid" or "payment type" to record the payment of subscription for member '.$tmptag['MEM'];
$ispostactionok = -1;
}
}
else
{
$postactionmessages[] = 'Member for subscription payed '.$tmptag['MEM'].' was not found';
$ispostactionok = -1;
}
}
elseif (in_array('INV', array_keys($tmptag)))
{
// Record payment
include_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
$invoice = new Facture($db);
$result = $invoice->fetch(0, $tmptag['INV']);
if ($result)
{
$FinalPaymentAmt = $_SESSION["FinalPaymentAmt"];
$paymentTypeId = 0;
if ($paymentmethod == 'paybox') $paymentTypeId = $conf->global->PAYBOX_PAYMENT_MODE_FOR_PAYMENTS;
if ($paymentmethod == 'paypal') $paymentTypeId = $conf->global->PAYPAL_PAYMENT_MODE_FOR_PAYMENTS;
if ($paymentmethod == 'stripe') $paymentTypeId = $conf->global->STRIPE_PAYMENT_MODE_FOR_PAYMENTS;
if (empty($paymentTypeId))
{
$paymentType = $_SESSION["paymentType"];
if (empty($paymentType)) $paymentType = 'CB';
$paymentTypeId = dol_getIdFromCode($db, $paymentType, 'c_paiement', 'code', 'id', 1);
}
$currencyCodeType = $_SESSION['currencyCodeType'];
if (! empty($FinalPaymentAmt) && $paymentTypeId > 0)
{
// Creation of payment line
include_once DOL_DOCUMENT_ROOT.'/compta/paiement/class/paiement.class.php';
$paiement = new Paiement($db);
$paiement->datepaye = $now;
if ($currencyCodeType == $conf->currency)
{
$paiement->amounts = array($invoice->id => $FinalPaymentAmt); // Array with all payments dispatching with invoice id
}
else
{
$paiement->multicurrency_amounts = array($invoice->id => $FinalPaymentAmt); // Array with all payments dispatching
$postactionmessages[] = 'Payment was done in a different currency that currency expected of company';
$ispostactionok = -1;
$error++; // Not yet supported
}
$paiement->paiementid = $paymentTypeId;
$paiement->num_paiement = '';
$paiement->note_public = 'Online payment using '.$paymentmethod.' from '.$ipaddress.' - Transaction ID = '.$TRANSACTIONID;
if (! $error)
{
$paiement_id = $paiement->create($user, 1); // This include closing invoices and regenerating documents
if ($paiement_id < 0)
{
$postactionmessages[] = $paiement->error.' '.join("<br>\n", $paiement->errors);
$ispostactionok = -1;
$error++;
}
else
{
$postactionmessages[] = 'Payment created';
$ispostactionok=1;
}
}
if (! $error && ! empty($conf->banque->enabled))
{
$bankaccountid = 0;
if ($paymentmethod == 'paybox') $bankaccountid = $conf->global->PAYBOX_BANK_ACCOUNT_FOR_PAYMENTS;
if ($paymentmethod == 'paypal') $bankaccountid = $conf->global->PAYPAL_BANK_ACCOUNT_FOR_PAYMENTS;
if ($paymentmethod == 'stripe') $bankaccountid = $conf->global->STRIPE_BANK_ACCOUNT_FOR_PAYMENTS;
if ($bankaccountid > 0)
{
$label='(CustomerInvoicePayment)';
if ($invoice->type == Facture::TYPE_CREDIT_NOTE) $label='(CustomerInvoicePaymentBack)'; // Refund of a credit note
$result=$paiement->addPaymentToBank($user,'payment',$label, $bankaccountid, '', '');
if ($result < 0)
{
$postactionmessages[] = $paiement->error.' '.joint("<br>\n", $paiement->errors);
$ispostactionok = -1;
$error++;
}
else
{
$postactionmessages[] = 'Bank entry of payment created';
$ispostactionok=1;
}
}
else
{
$postactionmessages[] = 'Setup of bank account to use in module '.$paymentmethod.' was not set. Not way to record the payment.';
$ispostactionok = -1;
$error++;
}
}
if (! $error)
{
$db->commit();
}
else
{
$db->rollback();
}
}
else
{
$postactionmessages[] = 'Failed to get a valid value for "amount paid" ('.$FinalPaymentAmt.') or "payment type" ('.$paymentType.') to record the payment of invoice '.$tmptag['INV'];
$ispostactionok = -1;
}
}
else
{
$postactionmessages[] = 'Invoice payed '.$tmptag['INV'].' was not found';
$ispostactionok = -1;
}
}
else
{
// Nothing done
}
}
if ($ispaymentok)
{
// Get on url call
$fulltag = $FULLTAG;
$onlinetoken = empty($PAYPALTOKEN)?$_SESSION['onlinetoken']:$PAYPALTOKEN;
$payerID = empty($PAYPALPAYERID)?$_SESSION['payerID']:$PAYPALPAYERID;
// Set by newpayment.php
$paymentType = $_SESSION['PaymentType'];
$currencyCodeType = $_SESSION['currencyCodeType'];
$FinalPaymentAmt = $_SESSION["FinalPaymentAmt"];
// From env
$ipaddress = $_SESSION['ipaddress'];
$TRANSACTIONID = $_SESSION['TRANSACTIONID'];
// Appel des triggers
include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php';
@ -296,6 +451,10 @@ if ($ispaymentok)
// Send an email
if ($sendemail)
{
$companylangs = new Translate('', $conf);
$companylangs->setDefaultLang($mysoc->default_lang);
$companylangs->loadLangs(array('main','members','bills','paypal','paybox'));
$sendto=$sendemail;
$from=$conf->global->MAILING_EMAIL_FROM;
// Define $urlwithroot
@ -317,25 +476,56 @@ if ($ispaymentok)
else $appli.=" ".DOL_VERSION;
$urlback=$_SERVER["REQUEST_URI"];
$topic='['.$appli.'] '.$langs->transnoentitiesnoconv("NewOnlinePaymentReceived");
$topic='['.$appli.'] '.$companylangs->transnoentitiesnoconv("NewOnlinePaymentReceived");
$content="";
if (! empty($tmptag['MEM']))
if (in_array('MEM', array_keys($tmptag)))
{
$langs->load("members");
$url=$urlwithroot."/adherents/card_subscriptions.php?rowid=".$tmptag['MEM'];
$content.=$langs->trans("PaymentSubscription")."<br>\n";
$content.=$langs->trans("MemberId").': '.$tmptag['MEM']."<br>\n";
$content.=$langs->trans("Link").': <a href="'.$url.'">'.$url.'</a>'."<br>\n";
$content.='<strong>'.$companylangs->trans("PaymentSubscription")."</strong><br><br>\n";
$content.=$companylangs->trans("MemberId").': <strong>'.$tmptag['MEM']."</strong><br>\n";
$content.=$companylangs->trans("Link").': <a href="'.$url.'">'.$url.'</a>'."<br>\n";
}
elseif (in_array('INV', array_keys($tmptag)))
{
$url=$urlwithroot."/compta/facture/card.php?ref=".$tmptag['INV'];
$content.='<strong>'.$companylangs->trans("Payment")."</strong><br><br>\n";
$content.=$companylangs->trans("Invoice").': <strong>'.$tmptag['INV']."</strong><br>\n";
//$content.=$companylangs->trans("ThirdPartyId").': '.$tmptag['CUS']."<br>\n";
$content.=$companylangs->trans("Link").': <a href="'.$url.'">'.$url.'</a>'."<br>\n";
}
else
{
$content.=$langs->transnoentitiesnoconv("NewOnlinePaymentReceived")."<br>\n";
$content.=$companylangs->transnoentitiesnoconv("NewOnlinePaymentReceived")."<br>\n";
}
$content.=$companylangs->transnoentities("PostActionAfterPayment").' : ';
if ($ispostactionok > 0)
{
//$topic.=' ('.$companylangs->transnoentitiesnoconv("Status").' '.$companylangs->transnoentitiesnoconv("OK").')';
$content.='<font color="green">'.$companylangs->transnoentitiesnoconv("OK").'</font>';
}
elseif ($ispostactionok == 0)
{
$content.=$companylangs->transnoentitiesnoconv("None");
}
else
{
$topic.=($ispostactionok ? '' : ' ('.$companylangs->trans("WarningPostActionErrorAfterPayment").')');
$content.='<font color="red">'.$companylangs->transnoentitiesnoconv("Error").'</font>';
}
$content.='<br>'."\n";
foreach($postactionmessages as $postactionmessage)
{
$content.=' * '.$postactionmessage.'<br>'."\n";
}
$content.='<br>'."\n";
$content.="<br>\n";
$content.=$langs->transnoentitiesnoconv("TechnicalInformation").":<br>\n";
$content.=$langs->transnoentitiesnoconv("OnlinePaymentSystem").': '.$paymentmethod."<br>\n";
$content.=$langs->transnoentitiesnoconv("ReturnURLAfterPayment").': '.$urlback."<br>\n";
$content.="tag=".$fulltag."\ntoken=".$onlinetoken." paymentType=".$paymentType." currencycodeType=".$currencyCodeType." payerId=".$payerID." ipaddress=".$ipaddress." FinalPaymentAmt=".$FinalPaymentAmt;
$content.='<u>'.$companylangs->transnoentitiesnoconv("TechnicalInformation").":</u><br>\n";
$content.=$companylangs->transnoentitiesnoconv("OnlinePaymentSystem").': <strong>'.$paymentmethod."</strong><br>\n";
$content.=$companylangs->transnoentitiesnoconv("TransactionId").': <strong>'.$TRANSACTIONID."</strong><br>\n";
$content.=$companylangs->transnoentitiesnoconv("ReturnURLAfterPayment").': '.$urlback."<br>\n";
$content.="<br>\n";
$content.="tag=".$fulltag."<br>\ntoken=".$onlinetoken."<br>\npaymentType=".$paymentType."<br>\ncurrencycodeType=".$currencyCodeType."<br>\npayerId=".$payerID."<br>\nipaddress=".$ipaddress."<br>\nFinalPaymentAmt=".$FinalPaymentAmt."<br>\n";
$ishtml=dol_textishtml($content); // May contain urls
@ -356,15 +546,12 @@ if ($ispaymentok)
else
{
// Get on url call
$fulltag = $FULLTAG;
$onlinetoken = empty($PAYPALTOKEN)?$_SESSION['onlinetoken']:$PAYPALTOKEN;
$onlinetoken = empty($PAYPALTOKEN)?$_SESSION['onlinetoken']:$PAYPALTOKEN;
$payerID = empty($PAYPALPAYERID)?$_SESSION['payerID']:$PAYPALPAYERID;
// Set by newpayment.php
$paymentType = $_SESSION['PaymentType'];
$currencyCodeType = $_SESSION['currencyCodeType'];
$FinalPaymentAmt = $_SESSION["FinalPaymentAmt"];
// From env
$ipaddress = $_SESSION['ipaddress'];
// Appel des triggers
include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php';
@ -389,12 +576,14 @@ else
if ($paymentmethod == 'paybox' && ! empty($conf->global->PAYBOX_PAYONLINE_SENDEMAIL)) $sendemail=$conf->global->PAYBOX_PAYONLINE_SENDEMAIL;
if ($paymentmethod == 'stripe' && ! empty($conf->global->STRIPE_PAYONLINE_SENDEMAIL)) $sendemail=$conf->global->STRIPE_PAYONLINE_SENDEMAIL;
$tmptag=dolExplodeIntoArray($fulltag,'.','=');
// Send an email
if ($sendemail)
{
$sendto=$sendemail;
$companylangs = new Translate('', $conf);
$companylangs->setDefaultLang($mysoc->default_lang);
$companylangs->loadLangs(array('main','members','bills','paypal','paybox'));
$sendto=$sendemail;
$from=$conf->global->MAILING_EMAIL_FROM;
// Define $urlwithroot
$urlwithouturlroot=preg_replace('/'.preg_quote(DOL_URL_ROOT,'/').'$/i','',trim($dolibarr_main_url_root));
@ -415,14 +604,17 @@ else
else $appli.=" ".DOL_VERSION;
$urlback=$_SERVER["REQUEST_URI"];
$topic='['.$appli.'] '.$langs->transnoentitiesnoconv("ValidationOfPaymentFailed");
$topic='['.$appli.'] '.$companylangs->transnoentitiesnoconv("ValidationOfPaymentFailed");
$content="";
$content.=$langs->transnoentitiesnoconv("PaymentSystemConfirmPaymentPageWasCalledButFailed")."\n";
$content.="\n";
$content.=$langs->transnoentitiesnoconv("TechnicalInformation").":\n";
$content.=$langs->transnoentitiesnoconv("OnlinePaymentSystem").': '.$paymentmethod."\n";
$content.=$langs->transnoentitiesnoconv("ReturnURLAfterPayment").': '.$urlback."\n";
$content.="tag=".$fulltag."\ntoken=".$onlinetoken." paymentType=".$paymentType." currencycodeType=".$currencyCodeType." payerId=".$payerID." ipaddress=".$ipaddress." FinalPaymentAmt=".$FinalPaymentAmt;
$content.='<font color="orange">'.$companylangs->transnoentitiesnoconv("PaymentSystemConfirmPaymentPageWasCalledButFailed")."</font>\n";
$content.="<br>\n";
$content.='<u>'.$companylangs->transnoentitiesnoconv("TechnicalInformation").":</u><br>\n";
$content.=$companylangs->transnoentitiesnoconv("OnlinePaymentSystem").': <strong>'.$paymentmethod."</strong><br>\n";
$content.=$companylangs->transnoentitiesnoconv("ReturnURLAfterPayment").': '.$urlback."<br>\n";
$content.="<br>\n";
$content.="tag=".$fulltag."<br>\ntoken=".$onlinetoken."<br>\npaymentType=".$paymentType."<br>\ncurrencycodeType=".$currencyCodeType."<br>\npayerId=".$payerID."<br>\nipaddress=".$ipaddress."<br>\nFinalPaymentAmt=".$FinalPaymentAmt."<br>\n";
$ishtml=dol_textishtml($content); // May contain urls
@ -448,6 +640,10 @@ print "\n</div>\n";
htmlPrintOnlinePaymentFooter($mysoc,$langs,0,$suffix);
// Clean session variables to avoid duplicate actions if post is resent
unset($_SESSION["FinalPaymentAmt"]);
unset($_SESSION["TRANSACTIONID"]);
llxFooter('', 'public');
$db->close();

View File

@ -250,7 +250,7 @@ if (GETPOST('action','aZ09') == 'dopayment')
//$_SESSION["FinalPaymentAmt"]=$PAYPAL_API_PRICE;
// A redirect is added if API call successfull
print_paypal_redirect($PAYPAL_API_PRICE,$PAYPAL_API_DEVISE,$PAYPAL_PAYMENT_TYPE,$PAYPAL_API_OK,$PAYPAL_API_KO, $FULLTAG);
$mesg = print_paypal_redirect($PAYPAL_API_PRICE,$PAYPAL_API_DEVISE,$PAYPAL_PAYMENT_TYPE,$PAYPAL_API_OK,$PAYPAL_API_KO, $FULLTAG);
exit;
}

View File

@ -1168,7 +1168,7 @@ if (preg_match('/^dopayment/',$action))
<div id="card-errors" role="alert"></div>
</div>
<br>
<button class="button" id="buttontopay">'.$langs->trans("ToPay").'</button>
<button class="button" id="buttontopay">'.$langs->trans("ValidatePayment").'</button>
<img id="hourglasstopay" class="hidden" src="'.DOL_URL_ROOT.'/theme/'.$conf->theme.'/img/working.gif'.'">
</td></tr></tbody></table>

View File

@ -1170,7 +1170,7 @@ class Societe extends CommonObject
$sql .= ' WHERE s.entity IN ('.getEntity($this->element).')';
if ($rowid) $sql .= ' AND s.rowid = '.$rowid;
if ($ref) $sql .= " AND s.nom = '".$this->db->escape($ref)."'";
if ($ref_alias) $sql .= " AND s.nom_alias = '".$this->db->escape($nom_alias)."'";
if ($ref_alias) $sql .= " AND s.nom_alias = '".$this->db->escape($ref_alias)."'";
if ($ref_ext) $sql .= " AND s.ref_ext = '".$this->db->escape($ref_ext)."'";
if ($ref_int) $sql .= " AND s.ref_int = '".$this->db->escape($ref_int)."'";
if ($idprof1) $sql .= " AND s.siren = '".$this->db->escape($idprof1)."'";
@ -2900,10 +2900,10 @@ class Societe extends CommonObject
//Check NIF
if (preg_match('/(^[0-9]{8}[A-Z]{1}$)/', $string))
if ($num[8] == substr('TRWAGMYFPDXBNJZSQVHLCKE', substr($string, 0, 8) % 23, 1))
return 1;
else
return -1;
if ($num[8] == substr('TRWAGMYFPDXBNJZSQVHLCKE', substr($string, 0, 8) % 23, 1))
return 1;
else
return -1;
//algorithm checking type code CIF
$sum = $num[2] + $num[4] + $num[6];
@ -2913,36 +2913,56 @@ class Societe extends CommonObject
//Chek special NIF
if (preg_match('/^[KLM]{1}/', $string))
if ($num[8] == chr(64 + $n) || $num[8] == substr('TRWAGMYFPDXBNJZSQVHLCKE', substr($string, 1, 8) % 23, 1))
return 1;
else
return -1;
if ($num[8] == chr(64 + $n) || $num[8] == substr('TRWAGMYFPDXBNJZSQVHLCKE', substr($string, 1, 8) % 23, 1))
return 1;
else
return -1;
//Check CIF
if (preg_match('/^[ABCDEFGHJNPQRSUVW]{1}/', $string))
if ($num[8] == chr(64 + $n) || $num[8] == substr($n, strlen($n) - 1, 1))
return 2;
else
return -2;
if ($num[8] == chr(64 + $n) || $num[8] == substr($n, strlen($n) - 1, 1))
return 2;
else
return -2;
//Check NIE T
if (preg_match('/^[T]{1}/', $string))
if ($num[8] == preg_match('/^[T]{1}[A-Z0-9]{8}$/', $string))
return 3;
else
return -3;
if ($num[8] == preg_match('/^[T]{1}[A-Z0-9]{8}$/', $string))
return 3;
else
return -3;
//Check NIE XYZ
if (preg_match('/^[XYZ]{1}/', $string))
if ($num[8] == substr('TRWAGMYFPDXBNJZSQVHLCKE', substr(str_replace(array('X','Y','Z'), array('0','1','2'), $string), 0, 8) % 23, 1))
return 3;
else
return -3;
if ($num[8] == substr('TRWAGMYFPDXBNJZSQVHLCKE', substr(str_replace(array('X','Y','Z'), array('0','1','2'), $string), 0, 8) % 23, 1))
return 3;
else
return -3;
//Can not be verified
return -4;
}
//Verify NIF if country is PT
//Returns: 1 if NIF ok, -1 if NIF bad, 0 if unexpected bad
if ($idprof == 1 && $soc->country_code == 'PT')
{
$string=trim($this->idprof1);
$string=preg_replace('/(\s)/','',$string);
for ($i = 0; $i < 9; $i ++) {
$num[$i] = substr($string, $i, 1);
}
//Check NIF
if (preg_match('/(^[0-9]{9}$)/', $string)) {
return 1;
}
else {
return -1;
}
}
return $ok;
}
@ -2964,20 +2984,33 @@ class Societe extends CommonObject
$hookmanager->initHooks(array('idprofurl'));
$parameters=array('idprof'=>$idprof, 'company'=>$thirdparty);
$reshook=$hookmanager->executeHooks('getIdProfUrl',$parameters,$this,$action); // Note that $action and $object may have been modified by some hooks
if (empty($reshook))
{
if (! empty($conf->global->MAIN_DISABLEPROFIDRULES)) return '';
if (empty($reshook)) {
if (! empty($conf->global->MAIN_DISABLEPROFIDRULES)) {
return '';
}
// TODO Move links to validate professional ID into a dictionary table "country" + "link"
if ($idprof == 1 && $thirdparty->country_code == 'FR') $url='http://www.societe.com/cgi-bin/search?champs='.$thirdparty->idprof1; // See also http://avis-situation-sirene.insee.fr/
//if ($idprof == 1 && ($thirdparty->country_code == 'GB' || $thirdparty->country_code == 'UK')) $url='http://www.companieshouse.gov.uk/WebCHeck/findinfolink/'; // Link no more valid
if ($idprof == 1 && $thirdparty->country_code == 'ES') $url='http://www.e-informa.es/servlet/app/portal/ENTP/screen/SProducto/prod/ETIQUETA_EMPRESA/nif/'.$thirdparty->idprof1;
if ($idprof == 1 && $thirdparty->country_code == 'IN') $url='http://www.tinxsys.com/TinxsysInternetWeb/dealerControllerServlet?tinNumber='.$thirdparty->idprof1.';&searchBy=TIN&backPage=searchByTin_Inter.jsp';
if ($idprof == 1 && $thirdparty->country_code == 'FR') {
$url='http://www.societe.com/cgi-bin/search?champs='.$thirdparty->idprof1; // See also http://avis-situation-sirene.insee.fr/
}
if ($idprof == 1 && ($thirdparty->country_code == 'GB' || $thirdparty->country_code == 'UK')) {
$url='https://beta.companieshouse.gov.uk/company/'.$thirdparty->idprof1;
}
if ($idprof == 1 && $thirdparty->country_code == 'ES') {
$url='http://www.e-informa.es/servlet/app/portal/ENTP/screen/SProducto/prod/ETIQUETA_EMPRESA/nif/'.$thirdparty->idprof1;
}
if ($idprof == 1 && $thirdparty->country_code == 'IN') {
$url='http://www.tinxsys.com/TinxsysInternetWeb/dealerControllerServlet?tinNumber='.$thirdparty->idprof1.';&searchBy=TIN&backPage=searchByTin_Inter.jsp';
}
if ($idprof == 1 && $thirdparty->country_code == 'PT') {
$url='http://www.nif.pt/'.$thirdparty->idprof1;
}
if ($url) return '<a target="_blank" href="'.$url.'">'.$langs->trans("Check").'</a>';
if ($url) {
return '<a target="_blank" href="'.$url.'">'.$langs->trans("Check").'</a>';
}
}
else
{
else {
return $hookmanager->resPrint;
}

View File

@ -56,7 +56,9 @@ if ($action == 'setvalue' && $user->admin)
$result=dolibarr_set_const($db, "STRIPE_LIVE_SECRET_KEY",GETPOST('STRIPE_LIVE_SECRET_KEY','alpha'),'chaine',0,'',$conf->entity);
if (! $result > 0) $error++;
$result=dolibarr_set_const($db, "ONLINE_PAYMENT_CREDITOR",GETPOST('ONLINE_PAYMENT_CREDITOR','alpha'),'chaine',0,'',$conf->entity);
if (! $result > 0) $error++;
if (! $result > 0) $error++;
$result=dolibarr_set_const($db, "STRIPE_BANK_ACCOUNT_FOR_PAYMENTS",GETPOST('STRIPE_BANK_ACCOUNT_FOR_PAYMENTS','int'),'chaine',0,'',$conf->entity);
if (! $result > 0) $error++;
$result=dolibarr_set_const($db, "ONLINE_PAYMENT_CSS_URL",GETPOST('ONLINE_PAYMENT_CSS_URL','alpha'),'chaine',0,'',$conf->entity);
if (! $result > 0) $error++;
$result=dolibarr_set_const($db, "ONLINE_PAYMENT_MESSAGE_FORM",GETPOST('ONLINE_PAYMENT_MESSAGE_FORM','alpha'),'chaine',0,'',$conf->entity);
@ -195,6 +197,14 @@ print '<input size="64" type="text" name="ONLINE_PAYMENT_CREDITOR" value="'.$con
print ' &nbsp; '.$langs->trans("Example").': '.$mysoc->name;
print '</td></tr>';
if (! empty($conf->banque->enabled))
{
print '<tr class="oddeven"><td>';
print $langs->trans("BankAccount").'</td><td>';
print $form->select_comptes($conf->global->STRIPE_BANK_ACCOUNT_FOR_PAYMENTS, 'STRIPE_BANK_ACCOUNT_FOR_PAYMENTS', 0, '', 1);
print '</td></tr>';
}
print '<tr class="oddeven"><td>';
print $langs->trans("CSSUrlForPaymentForm").'</td><td>';
print '<input size="64" type="text" name="ONLINE_PAYMENT_CSS_URL" value="'.$conf->global->ONLINE_PAYMENT_CSS_URL.'">';
@ -253,6 +263,8 @@ $token='';
include DOL_DOCUMENT_ROOT.'/core/tpl/onlinepaymentlinks.tpl.php';
print info_admin($langs->trans("ExampleOfTestCreditCard", '4242424242424242', '4000000000000101', '4000000000000069', '4000000000000341'));
if (! empty($conf->use_javascript_ajax))
{
print "\n".'<script type="text/javascript">';

View File

@ -39,7 +39,7 @@ if (! defined('NOREQUIREAJAX')) define('NOREQUIREAJAX','1');
$colorbackhmenu1='80,90,120'; // topmenu
$colorbackvmenu1='248,248,248'; // vmenu
$colortopbordertitle1='200,200,200'; // top border of title
$colorbacktitle1='230,230,233'; // title of tables,list
$colorbacktitle1='220,220,223'; // title of tables,list
$colorbacktabcard1='255,255,255'; // card
$colorbacktabactive='234,234,234';
$colorbacklineimpair1='255,255,255'; // line impair
@ -356,23 +356,24 @@ input.buttonpayment {
line-height: 24px;
padding: 8px;
background: none;
padding-left: 30px;
padding-left: 38px;
text-align: <?php echo $left; ?>;
border: 1px solid #ddd;
background-color: #eee;
white-space: normal;
box-shadow: 1px 1px 8px #bbb;
}
input.buttonpaymentcb {
background-image: url(<?php echo dol_buildpath($path.'/theme/common/credit_card.png',1) ?>);
background-size: 26px;
background-repeat: no-repeat;
background-position: 2px 11px;
background-position: 5px 11px;
}
input.buttonpaymentcheque {
background-image: url(<?php echo dol_buildpath($path.'/theme/common/cheque.png',1) ?>);
background-size: 24px;
background-repeat: no-repeat;
background-position: 2px 8px;
background-position: 5px 8px;
}
input.buttonpaymentpaypal {
background-image: url(<?php echo dol_buildpath($path.'/paypal/img/object_paypal.png',1) ?>);
@ -768,13 +769,16 @@ select.flat.selectlimit {
.amountpaymentcomplete {
color: #008800;
font-weight: bold;
font-size: 1.4em;
}
.amountremaintopay {
color: #880000;
font-weight: bold;
font-size: 1.4em;
}
.amountremaintopayback {
font-weight: bold;
font-size: 1.4em;
}
.savingdocmask {
margin-top: 6px;
@ -831,19 +835,15 @@ div.fiche>div.tabBar>form>div.div-table-responsive {
justify-content: flex-start;
}
.thumbstat {
flex: 1 1 116px;
min-width: 150px;
}
.thumbstat150 {
flex: 1 1 170px;
min-width: 170px;
}
.thumbstat, .thumbstat150 {
/* flex-grow: 1; */
/* flex-shrink: 1; */
/* flex-basis: 140px; */
display: inline;
width: 100%;
justify-content: flex-start;
align-self: flex-start;
flex-grow: 1;
flex-shrink: 0;
min-width: 150px;
}
select.selectarrowonleft {
@ -864,7 +864,9 @@ select.selectarrowonleft option {
/* rule for not too small screen only */
@media only screen and (min-width: <?php echo round($nbtopmenuentries * $fontsize * 3.4, 0) + 7; ?>px)
{
.width25 { width: 25px; }
.width50 { width: 50px; }
.width75 { width: 75px; }
.width100 { width: 100px; }
.width200 { width: 200px; }
.minwidth100 { min-width: 100px; }
@ -880,8 +882,10 @@ select.selectarrowonleft option {
.minwidth400imp { min-width: 400px !important; }
.minwidth500imp { min-width: 500px !important; }
}
.widthauto { width: auto; }
.width25 { width: 25px; }
.width50 { width: 50px; }
.width75 { width: 75px; }
.width100 { width: 100px; }
.width200 { width: 200px; }
.maxwidth25 { max-width: 25px; }
@ -1049,6 +1053,13 @@ select.selectarrowonleft option {
div.statusrefbis {
padding-right: 3px !important;
}
/* TODO
div.statusref {
padding-top: 0px !important;
padding-left: 0px !important;
border: none !important;
}
*/
input.buttonpayment {
min-width: 300px;
@ -1341,7 +1352,7 @@ div.attachareaformuserfileecm {
div.arearef {
padding-top: 2px;
margin-bottom: 10px;
padding-bottom: 7px;
padding-bottom: 10px;
}
div.arearefnobottom {
padding-top: 2px;
@ -1356,6 +1367,12 @@ div.divphotoref {
div.paginationref {
padding-bottom: 10px;
}
/* TODO
div.statusref {
padding: 10px;
border: 1px solid #bbb;
border-radius: 6px;
} */
div.statusref {
float: right;
padding-left: 12px;
@ -1401,11 +1418,12 @@ img.photorefnoborder {
.underrefbanner {
}
.underbanner {
/* border-bottom: <?php echo $borderwidth ?>px solid rgb(<?php echo $colortopbordertitle1 ?>); */
border-bottom: 2px solid rgb(<?php echo $colorbackhmenu1 ?>);
border-bottom: <?php echo $borderwidth ?>px solid rgb(<?php echo $colortopbordertitle1 ?>);
/* border-bottom: 2px solid rgb(<?php echo $colorbackhmenu1 ?>); */
}
.trextrafieldseparator td {
border-bottom: 2px solid rgb(<?php echo $colorbackhmenu1 ?>) !important;
/* border-bottom: 2px solid rgb(<?php echo $colorbackhmenu1 ?>) !important; */
border-bottom: 2px solid rgb(<?php echo $colortopbordertitle1 ?>) !important;
}
.tdhrthin {
@ -2192,13 +2210,24 @@ div.tabBar div.titre {
padding-top: 20px;
}
/* tabBar used for creation/update/send forms */
div.tabBarWithBottom {
padding-bottom: 18px;
border-bottom: 1px solid #aaa;
}
div.tabBarWithBottom tr {
background: unset !important;
}
div.tabBarWithBottom table.border>tbody>tr:last-of-type>td {
border-bottom: none !important;
}
div.tabBar table.tableforservicepart2:last-child {
border-bottom: 1px solid #aaa;
}
.tableforservicepart1 .tdhrthin {
height: unset;
}
div.popuptabset {
padding: 6px;
@ -2256,8 +2285,8 @@ a.tab:link, a.tab:visited, a.tab:hover, a.tab#active {
background: rgb(<?php echo $colorbacktabcard1; ?>) !important;
margin: 0 0.2em 0 0.2em !important;
border-right: 1px solid #AAA !important;
border-left: 1px solid #AAA !important;
border-right: 1px solid #CCC !important;
border-left: 1px solid #CCC !important;
/* border-top: <?php echo 2; ?>px solid rgb(<?php echo $colortopbordertitle1; ?>) !important; */
border-top: <?php echo 2; ?>px solid rgb(<?php echo $colorbackhmenu1 ?>) !important;
}
@ -2430,16 +2459,20 @@ tr.nocellnopadd td.nobordernopadding, tr.nocellnopadd td.nocellnopadd
}
table.border, table.dataTable, .table-border, .table-border-col, .table-key-border-col, .table-val-border-col, div.border {
table.border, table.bordernooddeven, table.dataTable, .table-border, .table-border-col, .table-key-border-col, .table-val-border-col, div.border {
border-collapse: collapse !important;
padding: 1px 2px 1px 3px; /* t r b l */
}
table.borderplus {
border: 1px solid #BBB;
}
.border tbody tr, .border tbody tr td, div.tabBar table.border tr, div.tabBar table.border tr td, div.tabBar div.border .table-border-row, div.tabBar div.border .table-key-border-col, div.tabBar div.border .table-val-border-col {
.border tbody tr, .bordernooddeven tbody tr, .border tbody tr td, .bordernooddeven tbody tr td, div.tabBar table.border tr, div.tabBar table.border tr td, div.tabBar div.border .table-border-row, div.tabBar div.border .table-key-border-col, div.tabBar div.border .table-val-border-col {
height: 22px;
}
tr.liste_titre.box_titre td table td, .bordernooddeven tr td {
height: 22px;
}
div.tabBar div.border .table-border-row, div.tabBar div.border .table-key-border-col, div.tabBar .table-val-border-col {
vertical-align: middle;
}
@ -2450,7 +2483,7 @@ div .tdtop {
padding-bottom: 0px;
}
table.border td, div.border div div.tagtd {
table.border td, table.bordernooddeven td, div.border div div.tagtd {
padding: 5px 2px 5px 2px;
border-collapse: collapse;
}
@ -2476,9 +2509,20 @@ td.border, div.tagtable div div.border {
/* Main boxes */
.noborderbottom {
.nobordertop, .nobordertop tr:first-of-type td {
border-top: none !important;
}
.noborderbottom, .noborderbottom tr:last-of-type td {
border-bottom: none !important;
}
.bordertop {
border-top: 1px solid rgb(<?php echo $colortopbordertitle1 ?>);
}
.borderbottom {
border-bottom: 1px solid rgb(<?php echo $colortopbordertitle1 ?>);
}
/*.ficheaddleft table.noborder {
margin: 0px 0px 0px 0px;
}*/
@ -2491,6 +2535,9 @@ table.liste, table.noborder, table.formdoc, div.noborder {
border-top-width: <?php echo $borderwidth ?>px;
border-top-color: rgb(<?php echo $colortopbordertitle1 ?>);
border-top-style: solid;
/* border-top-width: 2px;
border-top-color: rgb(<?php echo $colorbackhmenu1 ?>);
border-top-style: solid; */
border-bottom-width: 1px;
border-bottom-color: rgb(<?php echo $colortopbordertitle1 ?>);
@ -2499,7 +2546,12 @@ table.liste, table.noborder, table.formdoc, div.noborder {
margin: 0px 0px 5px 0px;
}
div.tabBar div.ficheaddleft table.noborder:last-of-type {
border-bottom: 1px solid #aaa;
border-bottom: 1px solid rgb(<?php echo $colortopbordertitle1 ?>);
}
div.tabBar table.border>tbody>tr:last-of-type>td {
border-bottom-width: 1px;
border-bottom-color: rgb(<?php echo $colortopbordertitle1 ?>);
border-bottom-style: solid;
}
div.tabBar div.ficheaddleft table.noborder {
border-bottom: none;
@ -2529,7 +2581,7 @@ tr#trlinefordates td {
}
.liste_titre_add td, .liste_titre_add th, .liste_titre_add .tagtd
{
border-top-width: 2px;
border-top-width: 1px;
border-top-color: rgb(<?php echo $colortopbordertitle1 ?>);
border-top-style: solid;
}
@ -2543,6 +2595,7 @@ table.liste th, table.noborder th, table.noborder tr.liste_titre td, table.nobor
table.liste td, table.noborder td, div.noborder form div, table.tableforservicepart1 td, table.tableforservicepart2 td {
padding: 7px 8px 7px 8px; /* t r b l */
line-height: 1.2em;
height: 22px;
}
div.liste_titre_bydiv .divsearchfield {
padding: 2px 1px 2px 7px; /* t r b l */
@ -2778,7 +2831,7 @@ td.oddeven, table.nohover tr.impair, table.nohover tr.pair, table.nohover tr.imp
background-color: #<?php echo colorArrayToHex(colorStringToArray($colorbacklineimpair1)); ?> !important;
background: #<?php echo colorArrayToHex(colorStringToArray($colorbacklineimpair1)); ?> !important;
}
td.evenodd, tr.nohoverpair td {
td.evenodd, tr.nohoverpair td, #trlinefordates td {
background-color: #<?php echo colorArrayToHex(colorStringToArray($colorbacklinepair1)); ?> !important;
background: #<?php echo colorArrayToHex(colorStringToArray($colorbacklinepair1)); ?> !important;
}
@ -2930,15 +2983,19 @@ table.tableforservicepart1 tr td {
}
.paymenttable, .margintable {
border-top-width: <?php echo $borderwidth ?>px !important;
/*border-top-width: <?php echo $borderwidth ?>px !important;
border-top-color: rgb(<?php echo $colortopbordertitle1 ?>) !important;
border-top-style: solid !important;
border-top-style: solid !important;*/
border-top: none !important;
margin: 0px 0px 0px 0px !important;
}
.paymenttable tr td:first-child, .margintable tr td:first-child
{
padding-left: 2px;
}
.paymenttable, .margintable tr td {
height: 22px;
}
/* Disable shadows */
.noshadow {
@ -3004,32 +3061,58 @@ ul.noborder li:nth-child(even):not(.liste_titre) {
}
.boxstats, .boxstats130 {
display: inline-block;
margin: 3px;
/* border: 1px solid #CCC; */
margin: 8px;
margin-top: 5px;
margin-bottom: 5px;
text-align: center;
border-radius: 2px;
background: #eee;
background: #f8f8f8;
border: 1px solid #eee;
box-shadow: 1px 1px 6px #bbb;
border-radius: 0px;
}
.boxstats, .boxstats130, .boxstatscontent {
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.boxstats {
padding: 3px;
width: 104px;
}
.boxstats130 {
width: 158px;
height: 48px;
padding: 3px
}
.boxstats {
padding: 3px;
width: 121px;
}
.boxstatscontent {
padding: 3px;
}
.boxstatsempty {
width: 121px;
padding-left: 3px;
padding-right: 3px;
margin-left: 8px;
margin-right: 8px;
}
.boxstats150empty {
width: 158px;
padding-left: 3px;
padding-right: 3px;
margin-left: 8px;
margin-right: 8px;
}
@media only screen and (max-width: 767px)
{
.boxstats, .boxstats130 {
margin: 3px;
border: 1px solid #ccc;
box-shadow: none;
}
.boxstats130 {
text-align: <?php echo $left; ?>
}
.thumbstat {
flex: 1 1 110px;
}
@ -3044,8 +3127,12 @@ ul.noborder li:nth-child(even):not(.liste_titre) {
width: 148px;
}
.boxstats {
width: 100px;
width: 111px;
}
.boxstatsempty {
width: 111px;
}
}
.boxstats:hover {
@ -3106,6 +3193,15 @@ span.dashboardlineko {
.boxtable {
margin-bottom: 8px !important;
border-bottom-width: 1px;
border-top: <?php echo $borderwidth ?>px solid rgb(<?php echo $colortopbordertitle1 ?>);
/* border-top: 2px solid rgb(<?php echo $colorbackhmenu1 ?>) !important; */
}
table.noborder.boxtable tr td {
height: unset;
}
.boxtablenotop {
border-top-width: 0 !important;
}
.boxtablenobottom {
border-bottom-width: 0 !important;
@ -3153,9 +3249,6 @@ img.boxhandle, img.boxclose {
padding-left: 5px;
}
.noborderbottom {
border-bottom: none !important;
}
.formboxfilter {
vertical-align: middle;
margin-bottom: 6px;
@ -3467,7 +3560,10 @@ div.ui-tooltip {
/* Calendar */
/* ============================================================================== */
.ui-state-default, .ui-widget-content .ui-state-default, .ui-widget-header .ui-state-default, .ui-button, html .ui-button.ui-state-disabled:hover, html .ui-button.ui-state-disabled:active {
.ui-datepicker-calendar .ui-state-default, .ui-datepicker-calendar .ui-widget-content .ui-state-default,
.ui-datepicker-calendar .ui-widget-header .ui-state-default, .ui-datepicker-calendar .ui-button,
html .ui-datepicker-calendar .ui-button.ui-state-disabled:hover, html .ui-button.ui-state-disabled:active
{
border: unset;
}

View File

@ -153,7 +153,7 @@ if (! empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED))
$colorbacklinepairhover=((! isset($user->conf->THEME_ELDY_USE_HOVER) || $user->conf->THEME_ELDY_USE_HOVER === '0')?'':($user->conf->THEME_ELDY_USE_HOVER === '1'?'edf4fb':$user->conf->THEME_ELDY_USE_HOVER));
}
//if (empty($colortopbordertitle1)) $colortopbordertitle1=$colorbackhmenu1;
if (empty($colortopbordertitle1)) $colortopbordertitle1=$colorbackhmenu1;
// Set text color to black or white
@ -864,7 +864,9 @@ select.selectarrowonleft option {
/* rule for not too small screen only */
@media only screen and (min-width: <?php echo round($nbtopmenuentries * $fontsize * 3.4, 0) + 7; ?>px)
{
.width25 { width: 25px; }
.width50 { width: 50px; }
.width75 { width: 75px; }
.width100 { width: 100px; }
.width200 { width: 200px; }
.minwidth100 { min-width: 100px; }
@ -880,8 +882,10 @@ select.selectarrowonleft option {
.minwidth400imp { min-width: 400px !important; }
.minwidth500imp { min-width: 500px !important; }
}
.widthauto { width: auto; }
.width25 { width: 25px; }
.width50 { width: 50px; }
.width75 { width: 75px; }
.width100 { width: 100px; }
.width200 { width: 200px; }
.maxwidth25 { max-width: 25px; }
@ -1204,7 +1208,7 @@ div.fiche {
div.fiche {
margin-<?php print $left; ?>: <?php print (GETPOST('optioncss','aZ09') == 'print'?6:(empty($conf->dol_optimize_smallscreen)?'24':'6')); ?>px;
margin-<?php print $right; ?>: <?php print (GETPOST('optioncss','aZ09') == 'print'?6:(empty($conf->dol_optimize_smallscreen)?'16':'6')); ?>px;
margin-<?php print $right; ?>: <?php print (GETPOST('optioncss','aZ09') == 'print'?6:(empty($conf->dol_optimize_smallscreen)?'22':'6')); ?>px;
<?php if (! empty($conf->dol_hide_leftmenu) && ! empty($conf->dol_hide_topmenu)) print 'margin-top: 4px;'; ?>
margin-bottom: 15px;
}
@ -2194,6 +2198,9 @@ div.tabBarWithBottom {
div.tabBar table.tableforservicepart2:last-child {
border-bottom: 1px solid #aaa;
}
.tableforservicepart1 .tdhrthin {
height: unset;
}
/* ============================================================================== */
/* Boutons actions */
@ -2466,7 +2473,7 @@ tr.nocellnopadd td.nobordernopadding, tr.nocellnopadd td.nocellnopadd
}
table.border, table.dataTable, .table-border, .table-border-col, .table-key-border-col, .table-val-border-col, div.border {
table.border, table.bordernooddeven, table.dataTable, .table-border, .table-border-col, .table-key-border-col, .table-val-border-col, div.border {
border: 1px solid #f4f4f4;
border-collapse: collapse !important;
padding: 1px 2px 1px 3px; /* t r b l */
@ -2474,10 +2481,12 @@ table.border, table.dataTable, .table-border, .table-border-col, .table-key-bord
table.borderplus {
border: 1px solid #BBB;
}
.border tbody tr, .border tbody tr td, div.tabBar table.border tr {
.border tbody tr, .border tbody tr td, div.tabBar table.border tr, div.tabBar table.border tr td, div.tabBar div.border .table-border-row, div.tabBar div.border .table-key-border-col, div.tabBar div.border .table-val-border-col {
height: 22px;
}
tr.liste_titre.box_titre td table td, .bordernooddeven tr td {
height: 22px;
}
table.border td, div.border div div.tagtd {
padding: 2px 2px 2px 2px;
@ -2502,9 +2511,19 @@ td.border, div.tagtable div div.border {
/* Main boxes */
.noborderbottom {
.nobordertop, .nobordertop tr:first-of-type td {
border-top: none !important;
}
.noborderbottom, .noborderbottom tr:last-of-type td {
border-bottom: none !important;
}
.bordertop {
border-top: 1px solid rgb(<?php echo $colortopbordertitle1 ?>);
}
.borderbottom {
border-bottom: 1px solid rgb(<?php echo $colortopbordertitle1 ?>);
}
.ficheaddleft table.noborder {
margin: 0px 0px 0px 0px;
}
@ -2720,7 +2739,7 @@ div.pagination li span:focus {
color: #000;
background-color: #eee;
border-color: #ddd;
padding-top: 8px;
/* padding-top: 8px; */
}
div.pagination li .active a,
div.pagination li .active span,
@ -2996,6 +3015,9 @@ tr.liste_sub_total, tr.liste_sub_total td {
{
padding-left: 2px;
}
.paymenttable, .margintable tr td {
height: 22px;
}
/* Disable shadows */
.noshadow {
@ -3059,7 +3081,7 @@ div .tdtop {
}
.boxstats, .boxstats130 {
display: inline-block;
margin: 3px;
margin: 8px;
/* border: 1px solid #CCC; */
text-align: center;
border-radius: 2px;
@ -3082,6 +3104,12 @@ div .tdtop {
}
@media only screen and (max-width: 767px)
{
.boxstats, .boxstats130 {
margin: 3px;
border: 1px solid #ddd;
box-shadow: none;
background: #ddd;
}
.thumbstat {
flex: 1 1 110px;
}
@ -3143,6 +3171,9 @@ span.dashboardlineko {
margin-bottom: 8px !important;
border-bottom-width: 1px;
}
.boxtablenotop {
/* border-top-width: 0 !important; */
}
.boxtablenobottom {
/* border-bottom-width: 0 !important; */
}
@ -3153,8 +3184,8 @@ span.dashboardlineko {
text-align: center;
}
.boxworkingboard .tdboxstats {
padding-left: 0px !important;
padding-right: 0px !important;
padding-left: 1px !important;
padding-right: 1px !important;
}
a.valignmiddle.dashboardlineindicator {
line-height: 30px;
@ -3191,10 +3222,6 @@ img.boxhandle, img.boxclose {
padding-left: 5px;
}
.noborderbottom {
border-bottom: none !important;
}
.formboxfilter {
vertical-align: middle;
margin-bottom: 6px;
@ -3497,6 +3524,13 @@ div.ui-tooltip {
/* Calendar */
/* ============================================================================== */
.ui-datepicker-calendar .ui-state-default, .ui-datepicker-calendar .ui-widget-content .ui-state-default,
.ui-datepicker-calendar .ui-widget-header .ui-state-default, .ui-datepicker-calendar .ui-button,
html .ui-datepicker-calendar .ui-button.ui-state-disabled:hover, html .ui-button.ui-state-disabled:active
{
border: unset;
}
img.datecallink { padding-left: 2px !important; padding-right: 2px !important; }
.ui-datepicker-trigger {

View File

@ -67,9 +67,7 @@ if (! empty($conf->global->MAIN_USE_ADVANCED_PERMS))
$canreadgroup=(! empty($user->admin) || $user->rights->user->group_advance->read);
$caneditgroup=(! empty($user->admin) || $user->rights->user->group_advance->write);
}
if(! empty($conf->multicompany->enabled) && ! empty($conf->global->MULTICOMPANY_TRANSVERSE_MODE)) {
$caneditgroup = ($conf->entity == 1) && ! empty($user->admin) && empty($user->entity);
}
// Define value to know what current user can do on properties of edited user
if ($id)
{

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