26require
'../main.inc.php';
27require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formfile.class.php';
28require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formprojet.class.php';
29require_once DOL_DOCUMENT_ROOT.
'/core/lib/member.lib.php';
30require_once DOL_DOCUMENT_ROOT.
'/adherents/class/adherent.class.php';
31require_once DOL_DOCUMENT_ROOT.
'/adherents/class/adherent_type.class.php';
32require_once DOL_DOCUMENT_ROOT.
'/partnership/class/partnership.class.php';
33require_once DOL_DOCUMENT_ROOT.
'/partnership/lib/partnership.lib.php';
36$langs->loadLangs(array(
"companies",
"members",
"partnership",
"other"));
41$action =
GETPOST(
'action',
'aZ09');
42$confirm =
GETPOST(
'confirm',
'alpha');
43$cancel =
GETPOST(
'cancel',
'aZ09');
44$contextpage =
GETPOST(
'contextpage',
'aZ') ?
GETPOST(
'contextpage',
'aZ') :
'partnershipcard';
45$backtopage =
GETPOST(
'backtopage',
'alpha');
46$backtopageforcancel =
GETPOST(
'backtopageforcancel',
'alpha');
58$diroutputmassaction = $conf->partnership->dir_output.
'/temp/massgeneration/'.$user->id;
59$hookmanager->initHooks(array(
'partnershipthirdparty',
'globalcard'));
62$extrafields->fetch_name_optionals_label($object->table_element);
64$search_array_options = $extrafields->getOptionalsFromPost($object->table_element,
'',
'search_');
67$search_all =
GETPOST(
"search_all",
'alpha');
70foreach ($object->fields as $key => $val) {
71 if (
GETPOST(
'search_'.$key,
'alpha')) {
72 $search[$key] =
GETPOST(
'search_'.$key,
'alpha');
77include DOL_DOCUMENT_ROOT.
'/core/actions_fetchobject.inc.php';
79$permissiontoread = $user->hasRight(
'partnership',
'read');
80$permissiontoadd = $user->hasRight(
'partnership',
'write');
81$permissiontodelete = $user->hasRight(
'partnership',
'delete') || ($permissiontoadd && isset($object->status) && $object->status == $object::STATUS_DRAFT);
82$permissionnote = $user->hasRight(
'partnership',
'write');
83$permissiondellink = $user->hasRight(
'partnership',
'write');
84$usercanclose = $user->hasRight(
'partnership',
'write');
85$upload_dir = $conf->partnership->multidir_output[isset($object->entity) ? $object->entity : 1];
91if (!isModEnabled(
'partnership')) {
94if (empty($permissiontoread)) {
97if ($action ==
'edit' && empty($permissiontoadd)) {
100if (($action ==
'update' || $action ==
'edit') && $object->status != $object::STATUS_DRAFT) {
106$result =
restrictedArea($user,
'adherent', $id,
'',
'',
'socid',
'rowid', 0);
113$parameters = array();
114$reshook = $hookmanager->executeHooks(
'doActions', $parameters, $object, $action);
119$date_start =
dol_mktime(0, 0, 0,
GETPOST(
'date_partnership_startmonth',
'int'),
GETPOST(
'date_partnership_startday',
'int'),
GETPOST(
'date_partnership_startyear',
'int'));
120$date_end =
dol_mktime(0, 0, 0,
GETPOST(
'date_partnership_endmonth',
'int'),
GETPOST(
'date_partnership_endday',
'int'),
GETPOST(
'date_partnership_endyear',
'int'));
122if (empty($reshook)) {
125 $backtopage =
dol_buildpath(
'/partnership/partnership.php', 1).
'?rowid='.($id > 0 ? $id :
'__ID__');
128 include DOL_DOCUMENT_ROOT.
'/core/actions_dellink.inc.php';
131$object->fields[
'fk_member'][
'visible'] = 0;
132if ($object->id > 0 && $object->status == $object::STATUS_REFUSED && empty($action)) $object->fields[
'reason_decline_or_cancel'][
'visible'] = 1;
133$object->fields[
'note_public'][
'visible'] = 1;
140$form =
new Form($db);
143$title = $langs->trans(
"Partnership");
146$form =
new Form($db);
149 $langs->load(
"members");
152 $result = $object->fetch($id);
154 if (isModEnabled(
'notification')) {
155 $langs->load(
"mails");
158 $adht->fetch($object->typeid);
162 print
dol_get_fiche_head($head,
'partnership', $langs->trans(
"ThirdParty"), -1,
'user');
164 $linkback =
'<a href="'.DOL_URL_ROOT.
'/adherents/list.php?restore_lastsearch_values=1">'.$langs->trans(
"BackToList").
'</a>';
168 print
'<div class="fichecenter">';
170 print
'<div class="underbanner clearboth"></div>';
171 print
'<table class="border centpercent tableforfield">';
174 if (empty($conf->global->ADHERENT_LOGIN_NOT_REQUIRED)) {
175 print
'<tr><td class="titlefield">'.$langs->trans(
"Login").
' / '.$langs->trans(
"Id").
'</td><td class="valeur">'.$object->login.
' </td></tr>';
179 print
'<tr><td class="titlefield">'.$langs->trans(
"Type").
'</td><td class="valeur">'.$adht->getNomUrl(1).
"</td></tr>\n";
182 print
'<tr><td>'.$langs->trans(
"MemberNature").
'</td><td class="valeur" >'.$object->getmorphylib().
'</td>';
186 print
'<tr><td>'.$langs->trans(
"Company").
'</td><td class="valeur">'.$object->company.
'</td></tr>';
189 print
'<tr><td>'.$langs->trans(
"UserTitle").
'</td><td class="valeur">'.$object->getCivilityLabel().
' </td>';
203if ($object->id > 0 && (empty($action) || ($action !=
'edit' && $action !=
'create'))) {
206 if ($action !=
'presend') {
207 print
'<div class="tabsAction">'.
"\n";
208 $parameters = array();
209 $reshook = $hookmanager->executeHooks(
'addMoreActionsButtons', $parameters, $object, $action);
214 if (empty($reshook)) {
216 if ($permissiontoadd) {
217 print
dolGetButtonAction($langs->trans(
'AddPartnership'),
'',
'default', DOL_URL_ROOT.
'/partnership/partnership_card.php?action=create&fk_member='.$object->id.
'&backtopage='.urlencode(DOL_URL_ROOT.
'/adherents/partnership.php?id='.$object->id),
'', $permissiontoadd);
227 print
load_fiche_titre($langs->trans(
"PartnershipDedicatedToThisMember", $langs->transnoentitiesnoconv(
"Partnership")), $morehtmlright,
'');
229 $memberid = $object->id;
235 $partnershipid = $object->fetch(0,
"", $memberid);
237 if ($partnershipid > 0) {
238 print
'<div class="fichecenter">';
239 print
'<div class="fichehalfleft">';
240 print
'<div class="underbanner clearboth"></div>';
241 print
'<table class="border centpercent tableforfield">'.
"\n";
247 include DOL_DOCUMENT_ROOT.
'/core/tpl/commonfields_view.tpl.php';
251 $fadherent->fetch($object->fk_member);
252 print
'<tr><td>'.$langs->trans(
"SubscriptionEndDate").
'</td><td class="valeur">';
253 if ($fadherent->datefin) {
255 if ($fadherent->hasDelay()) {
256 print
" ".img_warning($langs->trans(
"Late"));
259 if (!$adht->subscription) {
260 print $langs->trans(
"SubscriptionNotRecorded");
261 if ($fadherent->statut > 0) {
262 print
" ".img_warning($langs->trans(
"Late"));
265 print $langs->trans(
"SubscriptionNotReceived");
266 if ($fadherent->statut > 0) {
267 print
" ".img_warning($langs->trans(
"Late"));
if(!defined('NOREQUIRESOC')) if(!defined( 'NOREQUIRETRAN')) if(!defined('NOTOKENRENEWAL')) if(!defined( 'NOREQUIREMENU')) if(!defined('NOREQUIREHTML')) if(!defined( 'NOREQUIREAJAX')) llxHeader()
Empty header.
Class to manage members of a foundation.
Class to manage members type.
dol_banner_tab($object, $paramid, $morehtml='', $shownav=1, $fieldid='rowid', $fieldref='ref', $morehtmlref='', $moreparam='', $nodbprefix=0, $morehtmlleft='', $morehtmlstatus='', $onlybanner=0, $morehtmlright='')
Show tab footer of a card.
dol_mktime($hour, $minute, $second, $month, $day, $year, $gm='auto', $check=1)
Return a timestamp date built from detailed informations (by default a local PHP server timestamp) Re...
load_fiche_titre($titre, $morehtmlright='', $picto='generic', $pictoisfullpath=0, $id='', $morecssontable='', $morehtmlcenter='')
Load a title with picto.
dol_get_fiche_head($links=array(), $active='', $title='', $notab=0, $picto='', $pictoisfullpath=0, $morehtmlright='', $morecss='', $limittoshow=0, $moretabssuffix='', $dragdropfile=0)
Show tabs of a record.
dol_print_error($db='', $error='', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
dol_get_fiche_end($notab=0)
Return tab footer of a card.
dol_print_date($time, $format='', $tzoutput='auto', $outputlangs='', $encodetooutput=false)
Output date in a string format according to outputlangs (or langs if not defined).
dolGetButtonAction($label, $text='', $actionType='default', $url='', $id='', $userRight=1, $params=array())
Function dolGetButtonAction.
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
setEventMessages($mesg, $mesgs, $style='mesgs', $messagekey='', $noduplicate=0)
Set event messages in dol_events session object.
dol_buildpath($path, $type=0, $returnemptyifnotfound=0)
Return path of url or filesystem.
getDolGlobalString($key, $default='')
Return dolibarr global constant string value.
member_prepare_head(Adherent $object)
Return array head with list of tabs to view object informations.
restrictedArea(User $user, $features, $object=0, $tableandshare='', $feature2='', $dbt_keyfield='fk_soc', $dbt_select='rowid', $isdraft=0, $mode=0)
Check permissions of a user to show a page and an object.
accessforbidden($message='', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Show a message to say access is forbidden and stop program.