Skip to content

Commit

Permalink
Merge branch '4.0-dev_content-drafting-david' into 4.0-dev_content-dr…
Browse files Browse the repository at this point in the history
…afting-pavlo
  • Loading branch information
prozb committed Aug 24, 2021
2 parents 0c0701c + 17226f0 commit 6f2efaf
Show file tree
Hide file tree
Showing 85 changed files with 76 additions and 13,438 deletions.
2 changes: 2 additions & 0 deletions administrator/components/com_content/config.xml
Expand Up @@ -943,6 +943,8 @@
<option value="ralpha">JGLOBAL_TITLE_REVERSE_ALPHABETICAL</option>
<option value="author">JGLOBAL_AUTHOR_ALPHABETICAL</option>
<option value="rauthor">JGLOBAL_AUTHOR_REVERSE_ALPHABETICAL</option>
<option value="draft" >JGLOBAL_DRAFT_DESC</option>
<option value="rdraft">JGLOBAL_DRAFT_ASC</option>
<option value="hits" requires="hits">JGLOBAL_MOST_HITS</option>
<option value="rhits" requires="hits">JGLOBAL_LEAST_HITS</option>
<option value="order">JGLOBAL_ARTICLE_MANAGER_ORDER</option>
Expand Down
Expand Up @@ -133,6 +133,8 @@
<option value="a.title DESC">JGLOBAL_TITLE_DESC</option>
<option value="category_title ASC">JCATEGORY_ASC</option>
<option value="category_title DESC">JCATEGORY_DESC</option>
<option value="a.draft ASC">JGLOBAL_DRAFT_ASC</option>
<option value="a.draft DESC">JGLOBAL_DRAFT_DESC</option>
<option value="a.access ASC">JGRID_HEADING_ACCESS_ASC</option>
<option value="a.access DESC">JGRID_HEADING_ACCESS_DESC</option>
<option value="a.created_by ASC">JAUTHOR_ASC</option>
Expand Down
12 changes: 12 additions & 0 deletions administrator/components/com_content/src/Model/ArticleModel.php
Expand Up @@ -682,6 +682,7 @@ public function validate($form, $data, $group = null)
*
* @since 1.6
*/

public function save($data)
{
$input = Factory::getApplication()->input;
Expand All @@ -694,6 +695,17 @@ public function save($data)
$data['metadata']['author'] = $filter->clean($data['metadata']['author'], 'TRIM');
}

if(!isset($data['draft']) || $data['state'] != 1)
{
$data['draft'] = 1;
}

if($data['state'] == 1)
{
$data['draft'] = 0;
}


if (isset($data['created_by_alias']))
{
$data['created_by_alias'] = $filter->clean($data['created_by_alias'], 'TRIM');
Expand Down
Expand Up @@ -49,6 +49,7 @@ public function __construct($config = array())
'checked_out', 'a.checked_out',
'checked_out_time', 'a.checked_out_time',
'catid', 'a.catid', 'category_title',
'draft', 'a.draft',
'state', 'a.state',
'access', 'a.access', 'access_level',
'created', 'a.created',
Expand Down
18 changes: 12 additions & 6 deletions administrator/components/com_content/tmpl/articles/default.php
Expand Up @@ -134,7 +134,9 @@
<th scope="col" style="min-width:100px">
<?php echo HTMLHelper::_('searchtools.sort', 'JGLOBAL_TITLE', 'a.title', $listDirn, $listOrder); ?>
</th>
<th></th>
<th scope="col" class="w-10 d-none d-md-table-cell">
<?php echo HTMLHelper::_('searchtools.sort', 'JGLOBAL_DRAFT', 'a.draft', $listDirn, $listOrder); ?>
</th>
<th scope="col" class="w-10 d-none d-md-table-cell">
<?php echo HTMLHelper::_('searchtools.sort', 'JGRID_HEADING_ACCESS', 'a.access', $listDirn, $listOrder); ?>
</th>
Expand Down Expand Up @@ -327,12 +329,16 @@
</div>
</div>
</th>
<!--TODO: HERE-->
<!--TODO: HERE-->
<td class="small d-none d-md-table-cell">
<?php
$draft = (rand() % 2 ? '<span class="badge rounded-pill bg-success">Draft</span>': "");
echo $draft;
echo ($draft && rand() % 2) ? '<span class="badge rounded-pill bg-warning">Shared</span>' : '';
<?php
if($item->draft == 1){
echo '<span class="badge rounded-pill bg-success">Draft</span>';
}
echo '<span> </span>';
if($item->shared == 1) {
echo '<span class="badge rounded-pill bg-warning">Shared</span>';
}
?>
</td>
<td class="small d-none d-md-table-cell">
Expand Down
23 changes: 23 additions & 0 deletions administrator/components/com_finder/forms/filter_searches.xml
Expand Up @@ -33,4 +33,27 @@
onchange="this.form.submit();"
/>
</fields>
<fields name="list">
<field
name="fullordering"
type="list"
label="JGLOBAL_SORT_BY"
onchange="this.form.submit();"
default="a.draft ASC"
validate="options"
>
<option value="">JGLOBAL_SORT_BY</option>
<option value="a.searchterm ASC">COM_FINDER_HEADING_SEARCH_TERM_ASC</option>
<option value="a.searchterm DESC">COM_FINDER_HEADING_SEARCH_TERM_DESC</option>
<option value="a.draft ASC">JGLOBAL_DRAFT_ASC</option>
<option value="a.draft DESC">JGLOBAL_DRAFT_DESC</option>
</field>
<field
name="limit"
type="limitbox"
label="JGLOBAL_LIST_LIMIT"
default="25"
onchange="this.form.submit();"
/>
</fields>
</form>
1 change: 1 addition & 0 deletions administrator/language/en-GB/com_content.ini
Expand Up @@ -32,6 +32,7 @@ COM_CONTENT_CREATE_ARTICLE_ERROR="When default category is enabled, a category s
COM_CONTENT_CREATE_ARTICLE_REDIRECTMENU_DESC="Select the page the user will be redirected to after a successful article submission and after cancel (if not set differently below). The default is to redirect to the home page."
COM_CONTENT_CREATE_ARTICLE_REDIRECTMENU_LABEL="Submission/Cancel Redirect"
COM_CONTENT_DASHBOARD_TITLE="Content Dashboard"
COM_CONTENT_DRAFT="Draft"
COM_CONTENT_EDIT_ARTICLE="Edit Article"
COM_CONTENT_EDIT_CATEGORY="Edit Category"
COM_CONTENT_EDITING_LAYOUT="Editing Layout"
Expand Down
5 changes: 4 additions & 1 deletion administrator/language/en-GB/joomla.ini
Expand Up @@ -401,6 +401,9 @@ JGLOBAL_DESCRIPTION="Description"
JGLOBAL_DISPLAY_NUM="Display #"
JGLOBAL_DISPLAY_SELECT_DESC="Show or hide the Display Select dropdown listbox."
JGLOBAL_DISPLAY_SELECT_LABEL="Display Select"
JGLOBAL_DRAFT = "Draft"
JGLOBAL_DRAFT_ASC="Draft ascending"
JGLOBAL_DRAFT_DESC="Draft descending"
JGLOBAL_EDIT_ITEM="Edit item"
JGLOBAL_EDIT_PREFERENCES="Edit Preferences"
JGLOBAL_EMAIL="Email"
Expand Down Expand Up @@ -1015,7 +1018,7 @@ JTOOLBAR_REMOVE="Remove"
JTOOLBAR_SAVE="Save &amp; Close"
JTOOLBAR_SAVE_AND_NEW="Save &amp; New"
JTOOLBAR_SAVE_AS_COPY="Save as Copy"
JTOOLBAR_SAVE_AS_DRAFT="Save as Draft"
JTOOLBAR_SAVE_AS_DRAFT="Share as Draft"
JTOOLBAR_SAVE_TO_MENU="Save to Menu"
JTOOLBAR_TRASH="Trash"
JTOOLBAR_UNARCHIVE="Unarchive"
Expand Down
1 change: 1 addition & 0 deletions api/language/en-GB/joomla.ini
Expand Up @@ -79,6 +79,7 @@ JDEFAULT="Default"
JDEFAULTLANGUAGE="Language - Default"
JDETAILS="Details"
JDISABLED="Disabled"
JDRAFT="Draft"
JENABLED="Enabled"
JFALSE="False"
JFEATURE="Feature"
Expand Down
8 changes: 8 additions & 0 deletions components/com_content/src/Helper/QueryHelper.php
Expand Up @@ -91,6 +91,14 @@ public static function orderbySecondary($orderby, $orderDate = 'created', Databa
$orderby = 'a.title DESC';
break;

case 'draft':
$orderby = 'a.draft DESC';
break;

case 'rdraft':
$orderby = 'a.draft';
break;

case 'hits':
$orderby = 'a.hits DESC';
break;
Expand Down
2 changes: 2 additions & 0 deletions components/com_content/src/Model/ArticlesModel.php
Expand Up @@ -230,6 +230,8 @@ protected function getListQuery()
$db->quoteName('a.metakey'),
$db->quoteName('a.metadesc'),
$db->quoteName('a.access'),
$db->quoteName('a.draft'),
$db->quoteName('a.shared'),
$db->quoteName('a.hits'),
$db->quoteName('a.featured'),
$db->quoteName('a.language'),
Expand Down
149 changes: 0 additions & 149 deletions installation/INSTALL

This file was deleted.

0 comments on commit 6f2efaf

Please sign in to comment.