Merge pull request #6891 from hregis/develop_api

NEW add REST api "memberstypes"
This commit is contained in:
Laurent Destailleur
2017-05-29 10:29:04 +02:00
committed by GitHub
6 changed files with 458 additions and 122 deletions

View File

@@ -429,23 +429,23 @@ class Form
if ($direction > 0) { $extracss=($extracss?$extracss.' ':'').'inline-block'; $extrastyle='padding: 0px; padding-right: 3px !important;'; }
$classfortooltip='classfortooltip';
$s='';$textfordialog='';
$htmltext=str_replace('"',""",$htmltext);
if ($tooltiptrigger != '')
if ($tooltiptrigger != '')
{
$classfortooltip='classfortooltiponclick';
$textfordialog.='<div style="display: none;" id="idfortooltiponclick_'.$tooltiptrigger.'" class="classfortooltiponclicktext">'.$htmltext.'</div>';
}
if ($tooltipon == 2 || $tooltipon == 3)
if ($tooltipon == 2 || $tooltipon == 3)
{
$paramfortooltipimg=' class="'.$classfortooltip.' inline-block'.($extracss?' '.$extracss:'').'" style="padding: 0px;'.($extrastyle?' '.$extrastyle:'').'"';
if ($tooltiptrigger == '') $paramfortooltipimg.=' title="'.($noencodehtmltext?$htmltext:dol_escape_htmltag($htmltext,1)).'"'; // Attribut to put on img tag to store tooltip
else $paramfortooltipimg.=' dolid="'.$tooltiptrigger.'"';
}
else $paramfortooltipimg =($extracss?' class="'.$extracss.'"':'').($extrastyle?' style="'.$extrastyle.'"':''); // Attribut to put on td text tag
if ($tooltipon == 1 || $tooltipon == 3)
if ($tooltipon == 1 || $tooltipon == 3)
{
$paramfortooltiptd=' class="'.($tooltipon == 3 ? 'cursorpointer ' : '').$classfortooltip.' inline-block'.($extracss?' '.$extracss:'').'" style="padding: 0px;'.($extrastyle?' '.$extrastyle:'').'" ';
if ($tooltiptrigger == '') $paramfortooltiptd.=' title="'.($noencodehtmltext?$htmltext:dol_escape_htmltag($htmltext,1)).'"'; // Attribut to put on td tag to store tooltip
@@ -496,7 +496,7 @@ class Form
$alt = '';
if ($tooltiptrigger) $alt=$langs->trans("ClickToShowHelp");
//For backwards compatibility
if ($type == '0') $type = 'info';
elseif ($type == '1') $type = 'help';
@@ -577,16 +577,16 @@ class Form
jQuery(".massaction").hide();
}
}
jQuery(document).ready(function () {
initCheckForSelect();
jQuery(".checkforselect").click(function() {
initCheckForSelect();
});
jQuery(".massactionselect").change(function() {
var massaction = $( this ).val();
var massaction = $( this ).val();
var urlform = $( this ).closest("form").attr("action").replace("#show_files","");
if (massaction == "builddoc")
if (massaction == "builddoc")
{
urlform = urlform + "#show_files";
}
@@ -1034,7 +1034,7 @@ class Form
{
global $conf,$user,$langs;
$out='';
$out='';
$num=0;
$outarray=array();
@@ -1077,7 +1077,7 @@ class Form
if ($resql)
{
$events = null;
if ($conf->use_javascript_ajax && ! $forcecombo)
{
include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
@@ -3450,7 +3450,7 @@ class Form
$cat = new Categorie($this->db);
$cate_arbo = $cat->get_full_arbo($type,$excludeafterid);
}
$output = '<select class="flat" name="'.$htmlname.'">';
$outarray=array();
if (is_array($cate_arbo))
@@ -4178,7 +4178,7 @@ class Form
}
print '</div>';
}
if ($more)
if ($more)
{
print '<div class="inline-block">';
print $more;
@@ -4923,7 +4923,7 @@ class Form
* @param int $iSecond Default preselected duration (number of seconds or '')
* @param int $disabled Disable the combo box
* @param string $typehour If 'select' then input hour and input min is a combo,
* if 'text' input hour is in text and input min is a text,
* if 'text' input hour is in text and input min is a text,
* if 'textselect' input hour is in text and input min is a combo
* @param integer $minunderhours If 1, show minutes selection under the hours
* @param int $nooutput Do not output html string but return it
@@ -4968,7 +4968,7 @@ class Form
if ($typehour!='text') $retstring.=' '.$langs->trans('HourShort');
else $retstring.=':';
// Minutes
if ($minunderhours) $retstring.='<br>';
else $retstring.="&nbsp;";
@@ -4988,7 +4988,7 @@ class Form
{
$retstring.='<input placeholder="'.$langs->trans('MinuteShort').'" type="number" min="0" size="1" name="'.$prefix.'min"'.($disabled?' disabled':'').' class="flat maxwidth50" value="'.(($minSelected != '')?((int) $minSelected):'').'">';
}
if ($typehour!='text') $retstring.=' '.$langs->trans('MinuteShort');
//$retstring.="&nbsp;";
@@ -5594,7 +5594,7 @@ class Form
{
$listofidcompanytoscan=$object->thirdparty->id;
if (($object->thirdparty->parent > 0) && ! empty($conf->global->THIRDPARTY_INCLUDE_PARENT_IN_LINKTO)) $listofidcompanytoscan.=','.$object->thirdparty->parent;
$possiblelinks=array(
'propal'=>array('enabled'=>$conf->propal->enabled, 'perms'=>1, 'label'=>'LinkToProposal', 'sql'=>"SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, t.ref_client, t.total_ht FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."propal as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (".$listofidcompanytoscan.') AND t.entity IN ('.getEntity('propal',1).')'),
'order'=>array('enabled'=>$conf->commande->enabled, 'perms'=>1, 'label'=>'LinkToOrder', 'sql'=>"SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, t.ref_client, t.total_ht FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."commande as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (".$listofidcompanytoscan.') AND t.entity IN ('.getEntity('commande',1).')'),
@@ -5606,7 +5606,7 @@ class Form
'invoice_supplier'=>array('enabled'=>$conf->fournisseur->facture->enabled , 'perms'=>1, 'label'=>'LinkToSupplierInvoice', 'sql'=>"SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, t.ref_supplier, t.total_ht FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."facture_fourn as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (".$listofidcompanytoscan.') AND t.entity IN ('.getEntity('facture_fourn',1).')')
);
}
global $action;
// Can complete the possiblelink array
@@ -5845,7 +5845,7 @@ class Form
//print "paramid=$paramid,morehtml=$morehtml,shownav=$shownav,$fieldid,$fieldref,$morehtmlref,$moreparam";
$object->load_previous_next_ref((isset($object->next_prev_filter)?$object->next_prev_filter:''),$fieldid,$nodbprefix);
$navurl = $_SERVER["PHP_SELF"];
// Special case for project/task page
if ($paramid == 'project_ref')
@@ -5902,11 +5902,15 @@ class Form
}
else if (in_array($object->element, array('action', 'agenda')))
{
$ret.=$object->ref.'<br>'.$object->label;
$ret.=$object->ref.'<br>'.$object->label;
}
else if (in_array($object->element, array('adherent_type')))
{
$ret.=$object->label;
}
else if ($fieldref != 'none') $ret.=dol_htmlentities($object->$fieldref);
if ($morehtmlref)
{
$ret.=' '.$morehtmlref;
@@ -6207,7 +6211,7 @@ class Form
return $out;
}
/**
* Return HTML to show the search and clear seach button
*
@@ -6216,7 +6220,7 @@ class Form
function showFilterButtons()
{
global $conf, $langs;
$out='<div class="nowrap">';
$out.='<input type="image" class="liste_titre" name="button_search" src="'.img_picto($langs->trans("Search"),'search.png','','',1).'" value="'.dol_escape_htmltag($langs->trans("Search")).'" title="'.dol_escape_htmltag($langs->trans("Search")).'">';
$out.='<input type="image" class="liste_titre" name="button_removefilter" src="'.img_picto($langs->trans("Search"),'searchclear.png','','',1).'" value="'.dol_escape_htmltag($langs->trans("RemoveFilter")).'" title="'.dol_escape_htmltag($langs->trans("RemoveFilter")).'">';
@@ -6235,7 +6239,7 @@ class Form
function showCheckAddButtons($cssclass='checkforaction', $calljsfunction=0)
{
global $conf, $langs;
$out='';
if (! empty($conf->use_javascript_ajax)) $out.='<div class="inline-block checkallactions"><input type="checkbox" id="checkallactions" name="checkallactions" class="checkallactions"></div>';
$out.='<script type="text/javascript">