Merge remote-tracking branch 'upstream/develop' into new_branch_20_04_2018

This commit is contained in:
Philippe GRAND 2018-04-20 16:46:53 +02:00
commit 53efccd98e
9 changed files with 59 additions and 30 deletions

View File

@ -384,7 +384,7 @@ print $form->textwithpicto('', $langs->trans("TicketsEmailMustExistHelp"), 1, 'h
print '</td>';
print '</tr>';
if ($conf->global->MAIN_FEATURES_LEVEL >= 2)
/*if ($conf->global->MAIN_FEATURES_LEVEL >= 2)
{
// Show logo for module
print '<tr class="pair"><td width="70%">' . $langs->trans("TicketsShowModuleLogo") . '</td>';
@ -400,7 +400,7 @@ if ($conf->global->MAIN_FEATURES_LEVEL >= 2)
print $form->textwithpicto('', $langs->trans("TicketsShowModuleLogoHelp"), 1, 'help');
print '</td>';
print '</tr>';
}
}*/
// Show logo for company
print '<tr class="pair"><td width="70%">' . $langs->trans("TicketsShowCompanyLogo") . '</td>';

View File

@ -126,7 +126,7 @@ $hookmanager->initHooks(array('agenda'));
* Actions
*/
if (GETPOST("viewlist") || $action == 'show_list')
if (GETPOST("viewlist",'alpha') || $action == 'show_list')
{
$param='';
if (is_array($_POST))
@ -142,7 +142,7 @@ if (GETPOST("viewlist") || $action == 'show_list')
exit;
}
if (GETPOST("viewperuser") || $action == 'show_peruser')
if (GETPOST("viewperuser",'alpha') || $action == 'show_peruser')
{
$param='';
if (is_array($_POST))

View File

@ -599,7 +599,7 @@ abstract class CommonObject
if (empty($this->last_main_doc))
{
return ''; // No known last doc
return ''; // No way to known which document name to use
}
include_once DOL_DOCUMENT_ROOT.'/ecm/class/ecmfiles.class.php';
@ -4387,6 +4387,9 @@ abstract class CommonObject
$ecmfile->gen_or_uploaded = 'generated';
$ecmfile->description = ''; // indexed content
$ecmfile->keyword = ''; // keyword content
$ecmfile->src_object_type = $this->table_element;
$ecmfile->src_object_id = $this->id;
$result = $ecmfile->create($user);
if ($result < 0)
{

View File

@ -7219,10 +7219,10 @@ function natural_search($fields, $value, $mode=0, $nofirstand=0)
}
/**
* Return string with full Url
* Return string with full Url. The file qualified is the one defined by relative path in $object->last_main_doc
*
* @param Object $object Object
* @return string Url string
* @param Object $object Object
* @return string Url string
*/
function showDirectDownloadLink($object)
{

View File

@ -245,7 +245,7 @@ class modAgenda extends DolibarrModules
'type'=>'left',
'titre'=>'Agenda',
'mainmenu'=>'agenda',
'url'=>'/comm/action/index.php?mainmenu=agenda&amp;leftmenu=agenda',
'url'=>'/comm/action/index.php?action='.($conf->global->AGENDA_DEFAULT_VIEW!='show_list'?$conf->global->AGENDA_DEFAULT_VIEW:'show_month').'&amp;mainmenu=agenda&amp;leftmenu=agenda',
'langs'=>'agenda',
'position'=>140,
'perms'=>'$user->rights->agenda->myactions->read',
@ -257,7 +257,7 @@ class modAgenda extends DolibarrModules
'type'=>'left',
'titre'=>'MenuToDoMyActions',
'mainmenu'=>'agenda',
'url'=>'/comm/action/index.php?mainmenu=agenda&amp;leftmenu=agenda&amp;status=todo&amp;filter=mine',
'url'=>'/comm/action/index.php?action='.($conf->global->AGENDA_DEFAULT_VIEW!='show_list'?$conf->global->AGENDA_DEFAULT_VIEW:'show_month').'&amp;mainmenu=agenda&amp;leftmenu=agenda&amp;status=todo&amp;filter=mine',
'langs'=>'agenda',
'position'=>141,
'perms'=>'$user->rights->agenda->myactions->read',
@ -269,7 +269,7 @@ class modAgenda extends DolibarrModules
'type'=>'left',
'titre'=>'MenuDoneMyActions',
'mainmenu'=>'agenda',
'url'=>'/comm/action/index.php?mainmenu=agenda&amp;leftmenu=agenda&amp;status=done&amp;filter=mine',
'url'=>'/comm/action/index.php?action='.($conf->global->AGENDA_DEFAULT_VIEW!='show_list'?$conf->global->AGENDA_DEFAULT_VIEW:'show_month').'&amp;mainmenu=agenda&amp;leftmenu=agenda&amp;status=done&amp;filter=mine',
'langs'=>'agenda',
'position'=>142,
'perms'=>'$user->rights->agenda->myactions->read',
@ -281,7 +281,7 @@ class modAgenda extends DolibarrModules
'type'=>'left',
'titre'=>'MenuToDoActions',
'mainmenu'=>'agenda',
'url'=>'/comm/action/index.php?mainmenu=agenda&amp;leftmenu=agenda&amp;status=todo&amp;filtert=-1',
'url'=>'/comm/action/index.php?action='.($conf->global->AGENDA_DEFAULT_VIEW!='show_list'?$conf->global->AGENDA_DEFAULT_VIEW:'show_month').'&amp;mainmenu=agenda&amp;leftmenu=agenda&amp;status=todo&amp;filtert=-1',
'langs'=>'agenda',
'position'=>143,
'perms'=>'$user->rights->agenda->allactions->read',
@ -293,15 +293,16 @@ class modAgenda extends DolibarrModules
'type'=>'left',
'titre'=>'MenuDoneActions',
'mainmenu'=>'agenda',
'url'=>'/comm/action/index.php?mainmenu=agenda&amp;leftmenu=agenda&amp;status=done&amp;filtert=-1',
'url'=>'/comm/action/index.php?action='.($conf->global->AGENDA_DEFAULT_VIEW!='show_list'?$conf->global->AGENDA_DEFAULT_VIEW:'show_month').'&amp;mainmenu=agenda&amp;leftmenu=agenda&amp;status=done&amp;filtert=-1',
'langs'=>'agenda',
'position'=>144,
'perms'=>'$user->rights->agenda->allactions->read',
'enabled'=>'$user->rights->agenda->allactions->read',
'target'=>'',
'user'=>2);
$r++;
// List
$r++;
$this->menu[$r]=array('fk_menu'=>'r=1',
'type'=>'left',
'titre'=>'List',

View File

@ -167,13 +167,13 @@ class EcmFiles extends CommonObject
$obj = $this->db->fetch_object($resql);
$maxposition = (int) $obj->maxposition;
}
else
else
{
$this->errors[] = 'Error ' . $this->db->lasterror();
return --$error;
}
$maxposition=$maxposition+1;
}
}
else
{
$maxposition=$this->position;
@ -274,14 +274,16 @@ class EcmFiles extends CommonObject
/**
* Load object in memory from the database
*
* @param int $id Id object
* @param string $ref Hash of file name (filename+filepath). Not always defined on some version.
* @param string $relativepath Relative path of file from document directory. Example: path/path2/file
* @param string $hashoffile Hash of file content. Take the first one found if same file is at different places. This hash will also change if file content is changed.
* @param string $hashforshare Hash of file sharing.
* @return int <0 if KO, 0 if not found, >0 if OK
* @param int $id Id object
* @param string $ref Hash of file name (filename+filepath). Not always defined on some version.
* @param string $relativepath Relative path of file from document directory. Example: path/path2/file
* @param string $hashoffile Hash of file content. Take the first one found if same file is at different places. This hash will also change if file content is changed.
* @param string $hashforshare Hash of file sharing.
* @param string $src_object_type src_object_type to search
* @param string $src_object_id src_object_id to search
* @return int <0 if KO, 0 if not found, >0 if OK
*/
public function fetch($id, $ref = '', $relativepath = '', $hashoffile='', $hashforshare='')
public function fetch($id, $ref = '', $relativepath = '', $hashoffile='', $hashforshare='', $src_object_type='', $src_object_id=0)
{
dol_syslog(__METHOD__, LOG_DEBUG);
@ -324,8 +326,13 @@ class EcmFiles extends CommonObject
}
elseif (! empty($hashforshare)) {
$sql .= " AND t.share = '".$this->db->escape($hashforshare)."'";
} else {
$sql .= ' AND t.rowid = ' . $id;
}
elseif ($src_object_type && $src_object_id)
{
$sql.= " AND t.src_object_type ='".$this->db->escape($src_object_type)."' AND t.src_object_id = ".$this->db->escape($src_object_id);
}
else {
$sql .= ' AND t.rowid = '.$this->db->escape($id);
}
// When we search on hash of content, we take the first one. Solve also hash conflict.
$this->db->plimit(1);
@ -363,7 +370,7 @@ class EcmFiles extends CommonObject
// Retrieve all extrafields for invoice
// fetch optionals attributes and labels
// $this->fetch_optionals();
// $this->fetch_lines();
$this->db->free($resql);

View File

@ -578,7 +578,7 @@ Module2200Desc=Enable the usage of math expressions for prices
Module2300Name=Scheduled jobs
Module2300Desc=Scheduled jobs management (alias cron or chrono table)
Module2400Name=Events/Agenda
Module2400Desc=Follow done and upcoming events. Let application logs automatic events for tracking purposes or record manual events or rendez-vous.
Module2400Desc=Follow done and upcoming events. Let application logs automatic events for tracking purposes or record manual events or rendez-vous. This is the main important module for a good Customer or Supplier Relationship Management.
Module2500Name=DMS / ECM
Module2500Desc=Document Management System / Electronic Content Management. Automatic organization of your generated or stored documents. Share them when you need.
Module2600Name=API/Web services (SOAP server)

View File

@ -103,7 +103,7 @@ TicketPublicInterfaceTopicHelp=This text will appear as the title of the public
TicketPublicInterfaceTextHelpMessageLabelAdmin=Help text to the message entry
TicketPublicInterfaceTextHelpMessageHelpAdmin=This text will appear above the message input area of the user.
ExtraFieldsTicketSup=Extra attributes
TicketSupCkEditorEmailNotActivated=HTML editor is not activated. Please put FCKEDITOR_ENABLE_MAIL contant equal to 1
TicketSupCkEditorEmailNotActivated=HTML editor is not activated. Please put FCKEDITOR_ENABLE_MAIL content to 1 to get it.
TicketsDisableEmail=Do not send ticket creation or message send emails
TicketsDisableEmailHelp=By default, emails are sent when new tickets or messages created. Enable this option to disable *all* email notifications
TicketsLogEnableEmail=Enable log by email

View File

@ -469,8 +469,8 @@ if (empty($reshook))
'use_companybankid'=>GETPOST('companybankid'),
'force_dir_output'=>$conf->societe->multidir_output[$object->entity].'/'.dol_sanitizeFileName($object->id)
);
$_POST['lang_id'] = GETPOST('lang_idrib'.GETPOST('companybankid'));
$_POST['model'] = GETPOST('modelrib'.GETPOST('companybankid'));
$_POST['lang_id'] = GETPOST('lang_idrib'.GETPOST('companybankid','int'), 'alpha');
$_POST['model'] = GETPOST('modelrib'.GETPOST('companybankid','int'), 'alpha');
}
$id = $socid;
@ -1255,6 +1255,24 @@ if ($socid && $action != 'edit' && $action != 'create' && $action != 'editcard'
print $formfile->showdocuments('company', $object->id, $filedir, $urlsource, $genallowed, $delallowed, $object->modelpdf, 0, 0, 0, 28, 0, 'entity='.$object->entity, 0, '', $object->default_lang);
// Show direct download link
if (! empty($conf->global->BANK_ACCOUNT_ALLOW_EXTERNAL_DOWNLOAD))
{
$companybankaccounttemp = new CompanyBankAccount($db);
$companypaymentmodetemp = new CompanyPaymentMode($db);
$result = $companypaymentmodetemp->fetch(0, null, $object->id, 'ban');
include_once DOL_DOCUMENT_ROOT.'/ecm/class/ecmfiles.class.php';
$ecmfile = new EcmFiles($db);
$result = $ecmfile->fetch(0, '', '', '', '', $companybankaccounttemp->table_element, $companypaymentmodetemp->id);
if ($result > 0)
{
$companybankaccounttemp->last_main_doc = $ecmfile->filepath.'/'.$ecmfile->filename;
print '<br><!-- Link to download main doc -->'."\n";
print showDirectDownloadLink($companybankaccounttemp).'<br>';
}
}
print '</div><div class="fichehalfright"><div class="ficheaddleft">';